summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2018-07-22 17:08:36 +0100
committerAndy Williams <andy@andywilliams.me>2018-07-22 17:08:36 +0100
commit58bcf4074c305c02b9c7a03272e1d30fb527ce39 (patch)
tree96c96ffc037ea751db05adb2c3b90ef0978003ce
parent2101cd686b4032ef688717ca7dce5772f076ff85 (diff)
parent3ca3f865fd14e1058cdf33feb6ed6f63c83d0c6f (diff)
downloadefl-devs/ajwillia-ms/elm_code_wrap.tar.gz
Merge branch 'master' into elm_code_wrapdevs/ajwillia-ms/elm_code_wrap
-rw-r--r--.arcconfig5
-rwxr-xr-x.ci/build-efl-app.sh19
-rwxr-xr-x.ci/ci-linux-build.sh69
-rwxr-xr-x.ci/ci-osx-build.sh14
-rwxr-xr-x.ci/ci-osx-deps.sh3
-rw-r--r--.ci/dockerfiles/Dockerfile-Archlinux (renamed from .ci/Dockerfile-Archlinux)6
-rw-r--r--.ci/dockerfiles/Dockerfile-Debian91 (renamed from .ci/Dockerfile-Debian91)6
-rw-r--r--.ci/dockerfiles/Dockerfile-Fedora26 (renamed from .ci/Dockerfile-Fedora26)6
-rw-r--r--.ci/dockerfiles/Dockerfile-Fedora27 (renamed from .ci/Dockerfile-Fedora27)10
-rw-r--r--.ci/dockerfiles/Dockerfile-Opensuse4237
-rw-r--r--.ci/dockerfiles/Dockerfile-Ubuntu1704 (renamed from .ci/Dockerfile-Ubuntu1704)6
-rw-r--r--.ci/dockerfiles/Dockerfile-Ubuntu1710 (renamed from .ci/Dockerfile-Ubuntu1710)8
-rw-r--r--.travis.yml83
-rw-r--r--AUTHORS7
-rw-r--r--COPYING.images3
-rw-r--r--Makefile.am13
-rw-r--r--NEWS450
-rw-r--r--configure.ac76
-rw-r--r--data/Makefile.am18
-rw-r--r--data/elementary/config/.gitignore (renamed from config/.gitignore)0
-rw-r--r--data/elementary/config/Makefile.am (renamed from config/Makefile.am)6
-rw-r--r--data/elementary/config/default/Makefile.am (renamed from config/default/Makefile.am)6
-rw-r--r--data/elementary/config/default/base.src.in (renamed from config/default/base.src.in)56
-rw-r--r--data/elementary/config/default/icon.png (renamed from config/default/icon.png)bin6871 -> 6871 bytes
-rw-r--r--data/elementary/config/default/profile.desktop (renamed from config/default/profile.desktop)0
-rw-r--r--data/elementary/config/mobile/Makefile.am (renamed from config/mobile/Makefile.am)6
-rw-r--r--data/elementary/config/mobile/base.src.in (renamed from config/mobile/base.src.in)56
-rw-r--r--data/elementary/config/mobile/icon.png (renamed from config/mobile/icon.png)bin7555 -> 7555 bytes
-rw-r--r--data/elementary/config/mobile/profile.desktop (renamed from config/mobile/profile.desktop)0
-rw-r--r--data/elementary/config/profile.src (renamed from config/profile.src)0
-rw-r--r--data/elementary/config/standard/Makefile.am (renamed from config/standard/Makefile.am)6
-rw-r--r--data/elementary/config/standard/base.src.in (renamed from config/standard/base.src.in)56
-rw-r--r--data/elementary/config/standard/icon.png (renamed from config/standard/icon.png)bin12068 -> 12068 bytes
-rw-r--r--data/elementary/config/standard/profile.desktop (renamed from config/standard/profile.desktop)0
-rw-r--r--data/elementary/desktop/Makefile.am2
-rw-r--r--data/elementary/images/Makefile.am3
-rw-r--r--data/elementary/images/image_items.eetbin0 -> 573646 bytes
-rw-r--r--data/elementary/objects/Makefile.am1
-rw-r--r--data/elementary/objects/test_tab_pager.edc66
-rw-r--r--data/elementary/themes/Makefile.am24
-rw-r--r--data/elementary/themes/colorclasses.edc32
-rw-r--r--data/elementary/themes/default.edc15
-rw-r--r--data/elementary/themes/edc/dialog.edc6
-rw-r--r--data/elementary/themes/edc/efl/bg.edc45
-rw-r--r--data/elementary/themes/edc/efl/border.edc1207
-rw-r--r--data/elementary/themes/edc/efl/button.edc785
-rw-r--r--data/elementary/themes/edc/efl/calendar.edc386
-rw-r--r--data/elementary/themes/edc/efl/check.edc934
-rw-r--r--data/elementary/themes/edc/efl/cursor.edc78
-rw-r--r--data/elementary/themes/edc/efl/datepicker.edc345
-rw-r--r--data/elementary/themes/edc/efl/focus.edc178
-rw-r--r--data/elementary/themes/edc/efl/frame.edc167
-rw-r--r--data/elementary/themes/edc/efl/list.edc469
-rw-r--r--data/elementary/themes/edc/efl/navigation_bar.edc114
-rw-r--r--data/elementary/themes/edc/efl/navigation_layout.edc27
-rw-r--r--data/elementary/themes/edc/efl/nstate.edc2
-rw-r--r--data/elementary/themes/edc/efl/pager.edc66
-rw-r--r--data/elementary/themes/edc/efl/panes.edc1006
-rw-r--r--data/elementary/themes/edc/efl/photocam.edc101
-rw-r--r--data/elementary/themes/edc/efl/pointer.edc221
-rw-r--r--data/elementary/themes/edc/efl/popup.edc70
-rw-r--r--data/elementary/themes/edc/efl/progress.edc1392
-rw-r--r--data/elementary/themes/edc/efl/radio.edc291
-rw-r--r--data/elementary/themes/edc/efl/scroller.edc1336
-rw-r--r--data/elementary/themes/edc/efl/slider.edc1044
-rw-r--r--data/elementary/themes/edc/efl/spin.edc2
-rw-r--r--data/elementary/themes/edc/efl/spin_button.edc365
-rw-r--r--data/elementary/themes/edc/efl/tab_bar.edc596
-rw-r--r--data/elementary/themes/edc/efl/tab_page.edc15
-rw-r--r--data/elementary/themes/edc/efl/tab_pager.edc34
-rw-r--r--data/elementary/themes/edc/efl/tags.edc (renamed from data/elementary/themes/edc/efl/multibuttonentry.edc)122
-rw-r--r--data/elementary/themes/edc/efl/text.edc155
-rw-r--r--data/elementary/themes/edc/efl/textpath.edc25
-rw-r--r--data/elementary/themes/edc/efl/timepicker.edc409
-rw-r--r--data/elementary/themes/edc/efl/tooltip.edc428
-rw-r--r--data/elementary/themes/edc/efl/uiclock.edc72
-rw-r--r--data/elementary/themes/edc/efl/video.edc44
-rw-r--r--data/elementary/themes/edc/efl/win.edc30
-rw-r--r--data/elementary/themes/edc/elm/actionslider.edc12
-rw-r--r--data/elementary/themes/edc/elm/bubble.edc24
-rw-r--r--data/elementary/themes/edc/elm/button.edc62
-rw-r--r--data/elementary/themes/edc/elm/calendar.edc162
-rw-r--r--data/elementary/themes/edc/elm/check.edc36
-rw-r--r--data/elementary/themes/edc/elm/clock.edc2
-rw-r--r--data/elementary/themes/edc/elm/colorsel.edc3
-rw-r--r--data/elementary/themes/edc/elm/dayselector.edc29
-rw-r--r--data/elementary/themes/edc/elm/entry.edc2
-rw-r--r--data/elementary/themes/edc/elm/ews.edc2
-rw-r--r--data/elementary/themes/edc/elm/genlist.edc8
-rw-r--r--data/elementary/themes/edc/elm/icon_fdo.edc2
-rw-r--r--data/elementary/themes/edc/elm/label.edc16
-rw-r--r--data/elementary/themes/edc/elm/multibuttonentry.edc4
-rw-r--r--data/elementary/themes/edc/elm/panel.edc112
-rw-r--r--data/elementary/themes/edc/elm/photo.edc2
-rw-r--r--data/elementary/themes/edc/elm/popup.edc6
-rw-r--r--data/elementary/themes/edc/elm/progress.edc12
-rw-r--r--data/elementary/themes/edc/elm/radio.edc18
-rw-r--r--data/elementary/themes/edc/elm/slider.edc66
-rw-r--r--data/elementary/themes/edc/elm/uiclock.edc207
-rw-r--r--data/elementary/themes/edc/fileman.edc9
-rw-r--r--data/elementary/themes/edc/illume.edc6
-rw-r--r--data/elementary/themes/edc/init.edc49
-rw-r--r--data/elementary/themes/edc/music_control.edc6
-rw-r--r--data/elementary/themes/edc/notification.edc6
-rw-r--r--data/elementary/themes/edc/systray.edc33
-rw-r--r--data/elementary/themes/fdo/index.theme16
-rw-r--r--data/elementary/themes/fdo/mimetypes/128/inode-directory.pngbin0 -> 2436 bytes
-rw-r--r--data/elementary/themes/fdo/mimetypes/16/inode-directory.pngbin0 -> 466 bytes
-rw-r--r--m4/efl.m42
-rw-r--r--m4/efl_find_x.m41
-rw-r--r--pc/efl-mono.pc.in7
-rw-r--r--po/POTFILES.in8
-rw-r--r--po/ca.po158
-rw-r--r--po/cs.po158
-rw-r--r--po/da.po158
-rw-r--r--po/de.po158
-rw-r--r--po/el.po158
-rw-r--r--po/eo.po158
-rw-r--r--po/es.po158
-rw-r--r--po/fi.po158
-rw-r--r--po/fr.po158
-rw-r--r--po/gl.po158
-rw-r--r--po/hu.po158
-rw-r--r--po/it.po165
-rw-r--r--po/ja.po158
-rw-r--r--po/ko.po158
-rw-r--r--po/lt.po158
-rw-r--r--po/nl.po158
-rw-r--r--po/pl.po158
-rw-r--r--po/pt.po158
-rw-r--r--po/ru.po158
-rw-r--r--po/sl.po158
-rw-r--r--po/sr.po158
-rw-r--r--po/tr.po158
-rw-r--r--po/vi.po158
-rw-r--r--po/zh_CN.po158
-rw-r--r--src/Makefile.am18
-rw-r--r--src/Makefile_Cxx.am11
-rw-r--r--src/Makefile_Ecore.am101
-rw-r--r--src/Makefile_Ecore_Con.am7
-rw-r--r--src/Makefile_Ecore_Evas.am28
-rw-r--r--src/Makefile_Ecore_IMF.am13
-rw-r--r--src/Makefile_Ecore_Wl2.am32
-rw-r--r--src/Makefile_Ector.am4
-rw-r--r--src/Makefile_Edje.am17
-rw-r--r--src/Makefile_Eeze.am5
-rw-r--r--src/Makefile_Efl.am26
-rw-r--r--src/Makefile_Efl_Mono.am152
-rw-r--r--src/Makefile_Efreet.am5
-rw-r--r--src/Makefile_Eina.am16
-rw-r--r--src/Makefile_Eldbus.am4
-rw-r--r--src/Makefile_Elementary.am203
-rw-r--r--src/Makefile_Elua.am46
-rw-r--r--src/Makefile_Elua_Helper.am1
-rw-r--r--src/Makefile_Embryo.am5
-rw-r--r--src/Makefile_Emotion.am5
-rw-r--r--src/Makefile_Eo.am12
-rw-r--r--src/Makefile_Eolian.am14
-rw-r--r--src/Makefile_Eolian_Cxx.am3
-rw-r--r--src/Makefile_Eolian_Js.am3
-rw-r--r--src/Makefile_Ethumb.am5
-rw-r--r--src/Makefile_Evas.am147
-rw-r--r--src/Makefile_Evil.am45
-rw-r--r--src/Makefile_efl_wl.am4
-rw-r--r--src/benchmarks/eina/Ecore_Data.h8
-rw-r--r--src/benchmarks/eina/Evas_Data.h8
-rw-r--r--src/benchmarks/eo/eo_bench_callbacks.c4
-rw-r--r--src/benchmarks/eo/eo_bench_eo_add.c6
-rw-r--r--src/benchmarks/eo/eo_bench_eo_do.c12
-rw-r--r--src/bin/edje/edje_cc.c356
-rw-r--r--src/bin/edje/edje_cc.h4
-rw-r--r--src/bin/edje/edje_cc_handlers.c6485
-rw-r--r--src/bin/edje/edje_cc_mem.c1
-rw-r--r--src/bin/edje/edje_cc_out.c1547
-rw-r--r--src/bin/edje/edje_cc_parse.c271
-rw-r--r--src/bin/edje/edje_cc_script.c129
-rw-r--r--src/bin/edje/edje_cc_sources.c191
-rw-r--r--src/bin/edje/edje_codegen.c1084
-rw-r--r--src/bin/edje/edje_convert.c397
-rw-r--r--src/bin/edje/edje_convert_main.c105
-rw-r--r--src/bin/edje/edje_data_convert.c45
-rw-r--r--src/bin/edje/edje_decc.c549
-rw-r--r--src/bin/edje/edje_external_inspector.c322
-rw-r--r--src/bin/edje/edje_inspector.c649
-rw-r--r--src/bin/edje/edje_multisense_convert.c32
-rw-r--r--src/bin/edje/edje_pick.c897
-rw-r--r--src/bin/edje/edje_player.c5
-rw-r--r--src/bin/edje/edje_watch.c7
-rw-r--r--src/bin/efl/efl_debugd.c1
-rw-r--r--src/bin/elementary/Makefile.am5
-rw-r--r--src/bin/elementary/config.c43
-rw-r--r--src/bin/elementary/quicklaunch.c7
-rw-r--r--src/bin/elementary/run.c5
-rw-r--r--src/bin/elementary/test.c39
-rw-r--r--src/bin/elementary/test_access.c10
-rw-r--r--src/bin/elementary/test_bg.c24
-rw-r--r--src/bin/elementary/test_box.c4
-rw-r--r--src/bin/elementary/test_calendar.c4
-rw-r--r--src/bin/elementary/test_code.c50
-rw-r--r--src/bin/elementary/test_ctxpopup.c33
-rw-r--r--src/bin/elementary/test_datetime.c1
-rw-r--r--src/bin/elementary/test_dnd.c14
-rw-r--r--src/bin/elementary/test_efl_anim_alpha.c54
-rw-r--r--src/bin/elementary/test_efl_anim_event_anim.c14
-rw-r--r--src/bin/elementary/test_efl_anim_group_parallel.c66
-rw-r--r--src/bin/elementary/test_efl_anim_group_sequential.c92
-rw-r--r--src/bin/elementary/test_efl_anim_interpolator.c77
-rw-r--r--src/bin/elementary/test_efl_anim_pause.c55
-rw-r--r--src/bin/elementary/test_efl_anim_repeat.c62
-rw-r--r--src/bin/elementary/test_efl_anim_rotate.c92
-rw-r--r--src/bin/elementary/test_efl_anim_scale.c89
-rw-r--r--src/bin/elementary/test_efl_anim_start_delay.c51
-rw-r--r--src/bin/elementary/test_efl_anim_translate.c71
-rw-r--r--src/bin/elementary/test_efl_gfx_map.c6
-rw-r--r--src/bin/elementary/test_efl_ui_text.c205
-rw-r--r--src/bin/elementary/test_evas_map.c8
-rw-r--r--src/bin/elementary/test_evas_mask.c6
-rw-r--r--src/bin/elementary/test_evas_snapshot.c8
-rw-r--r--src/bin/elementary/test_events.c2
-rw-r--r--src/bin/elementary/test_flip_page_eo.c2
-rw-r--r--src/bin/elementary/test_focus.c98
-rw-r--r--src/bin/elementary/test_genlist.c366
-rw-r--r--src/bin/elementary/test_gesture_framework.c20
-rw-r--r--src/bin/elementary/test_gesture_layer.c1
-rw-r--r--src/bin/elementary/test_gfx_filters.c22
-rw-r--r--src/bin/elementary/test_glview.c2
-rw-r--r--src/bin/elementary/test_icon.c3
-rw-r--r--src/bin/elementary/test_image.c16
-rw-r--r--src/bin/elementary/test_multibuttonentry.c2
-rw-r--r--src/bin/elementary/test_nstate.c4
-rw-r--r--src/bin/elementary/test_panel.c55
-rw-r--r--src/bin/elementary/test_part_bg.c47
-rw-r--r--src/bin/elementary/test_part_shadow.c8
-rw-r--r--src/bin/elementary/test_photocam.c20
-rw-r--r--src/bin/elementary/test_progressbar.c23
-rw-r--r--src/bin/elementary/test_scroller.c8
-rw-r--r--src/bin/elementary/test_ui_box.c72
-rw-r--r--src/bin/elementary/test_ui_button.c78
-rw-r--r--src/bin/elementary/test_ui_clock.c2
-rw-r--r--src/bin/elementary/test_ui_datepicker.c37
-rw-r--r--src/bin/elementary/test_ui_panes.c4
-rw-r--r--src/bin/elementary/test_ui_popup.c188
-rw-r--r--src/bin/elementary/test_ui_progressbar.c178
-rw-r--r--src/bin/elementary/test_ui_scroller.c7
-rw-r--r--src/bin/elementary/test_ui_slider.c80
-rw-r--r--src/bin/elementary/test_ui_slider_interval.c69
-rw-r--r--src/bin/elementary/test_ui_spin.c4
-rw-r--r--src/bin/elementary/test_ui_spin_button.c25
-rw-r--r--src/bin/elementary/test_ui_stack.c228
-rw-r--r--src/bin/elementary/test_ui_tab_pager.c591
-rw-r--r--src/bin/elementary/test_ui_table.c100
-rw-r--r--src/bin/elementary/test_ui_table_static.c20
-rw-r--r--src/bin/elementary/test_ui_tags.c89
-rw-r--r--src/bin/elementary/test_ui_textpath.c62
-rw-r--r--src/bin/elementary/test_ui_timepicker.c36
-rw-r--r--src/bin/elementary/test_win_dialog.c12
-rw-r--r--src/bin/elementary/test_win_indicator.c8
-rw-r--r--src/bin/elementary/test_win_stack.c4
-rw-r--r--src/bin/embryo/embryo_cc_sc1.c15
-rw-r--r--src/bin/eolian/docs.c70
-rw-r--r--src/bin/eolian/docs.h6
-rw-r--r--src/bin/eolian/headers.c40
-rw-r--r--src/bin/eolian/headers.h4
-rw-r--r--src/bin/eolian/main.c53
-rw-r--r--src/bin/eolian/sources.c99
-rw-r--r--src/bin/eolian/sources.h4
-rw-r--r--src/bin/eolian/types.c91
-rw-r--r--src/bin/eolian/types.h6
-rw-r--r--src/bin/eolian_cxx/eolian_cxx.cc53
-rw-r--r--src/bin/eolian_js/eolian/class.hh10
-rw-r--r--src/bin/eolian_js/main.cc25
-rw-r--r--src/bin/eolian_mono/eolian/mono/alias_definition.hh77
-rw-r--r--src/bin/eolian_mono/eolian/mono/async_function_definition.hh145
-rw-r--r--src/bin/eolian_mono/eolian/mono/blacklist.hh (renamed from src/bin/eolian_mono/eolian/mono/function_blacklist.hh)41
-rw-r--r--src/bin/eolian_mono/eolian/mono/documentation.hh4
-rw-r--r--src/bin/eolian_mono/eolian/mono/enum_definition.hh16
-rw-r--r--src/bin/eolian_mono/eolian/mono/events.hh308
-rw-r--r--src/bin/eolian_mono/eolian/mono/function_declaration.hh7
-rw-r--r--src/bin/eolian_mono/eolian/mono/function_definition.hh38
-rw-r--r--src/bin/eolian_mono/eolian/mono/function_helpers.hh18
-rw-r--r--src/bin/eolian_mono/eolian/mono/function_pointer.hh62
-rw-r--r--src/bin/eolian_mono/eolian/mono/function_registration.hh10
-rw-r--r--src/bin/eolian_mono/eolian/mono/generation_contexts.hh2
-rw-r--r--src/bin/eolian_mono/eolian/mono/helpers.hh62
-rw-r--r--src/bin/eolian_mono/eolian/mono/keyword.hh52
-rw-r--r--src/bin/eolian_mono/eolian/mono/klass.hh462
-rw-r--r--src/bin/eolian_mono/eolian/mono/logging.hh12
-rw-r--r--src/bin/eolian_mono/eolian/mono/marshall_annotation.hh52
-rw-r--r--src/bin/eolian_mono/eolian/mono/marshall_type.hh17
-rw-r--r--src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh24
-rw-r--r--src/bin/eolian_mono/eolian/mono/name_helpers.hh220
-rw-r--r--src/bin/eolian_mono/eolian/mono/namespace.hh27
-rw-r--r--src/bin/eolian_mono/eolian/mono/parameter.hh236
-rw-r--r--src/bin/eolian_mono/eolian/mono/part_definition.hh54
-rw-r--r--src/bin/eolian_mono/eolian/mono/struct_definition.hh97
-rw-r--r--src/bin/eolian_mono/eolian/mono/struct_fields.hh67
-rw-r--r--src/bin/eolian_mono/eolian/mono/type_impl.hh77
-rw-r--r--src/bin/eolian_mono/eolian/mono/utils.hh50
-rw-r--r--src/bin/eolian_mono/eolian_mono.cc86
-rw-r--r--src/bin/evas/evas_cserve2.h2
-rw-r--r--src/bin/evil/evil_suite.c220
-rw-r--r--src/bin/evil/evil_suite.h14
-rw-r--r--src/bin/evil/evil_test_dlfcn.c79
-rw-r--r--src/bin/evil/evil_test_dlfcn.h8
-rw-r--r--src/bin/evil/evil_test_environment.c178
-rw-r--r--src/bin/evil/evil_test_environment.h8
-rw-r--r--src/bin/evil/evil_test_gettimeofday.c51
-rw-r--r--src/bin/evil/evil_test_gettimeofday.h8
-rw-r--r--src/bin/evil/evil_test_link.c159
-rw-r--r--src/bin/evil/evil_test_link.h8
-rw-r--r--src/bin/evil/evil_test_mkstemp.c95
-rw-r--r--src/bin/evil/evil_test_mkstemp.h8
-rw-r--r--src/bin/evil/evil_test_pipe.c126
-rw-r--r--src/bin/evil/evil_test_pipe.h8
-rw-r--r--src/bin/evil/evil_test_print.c46
-rw-r--r--src/bin/evil/evil_test_print.h8
-rw-r--r--src/bin/evil/evil_test_realpath.c45
-rw-r--r--src/bin/evil/evil_test_realpath.h8
-rw-r--r--src/bin/evil/evil_test_util.c110
-rw-r--r--src/bin/evil/evil_test_util.h8
-rw-r--r--src/bin/evil/test_evil.c27
-rw-r--r--src/bindings/cxx/eo_cxx/Eo.hh1
-rw-r--r--src/bindings/cxx/eo_cxx/eo_cxx_interop.hh29
-rw-r--r--src/bindings/cxx/eo_cxx/eo_future.hh505
-rw-r--r--src/bindings/cxx/eo_cxx/eo_promise.hh148
-rw-r--r--src/bindings/cxx/eo_cxx/eo_promise_meta.hh332
-rw-r--r--src/bindings/js/ecore_js/Ecore_Js.hh11
-rw-r--r--src/bindings/js/eina_js/Eina_Js.hh8
-rw-r--r--src/bindings/js/eldbus_js/Eldbus_Js.hh13
-rw-r--r--src/bindings/luajit/eolian.lua806
-rw-r--r--src/bindings/mono/ecore_evas_mono/ecore_evas.cs4
-rw-r--r--src/bindings/mono/efl_mono/efl_all.cs2
-rw-r--r--src/bindings/mono/eina_mono/eina_accessor.cs126
-rw-r--r--src/bindings/mono/eina_mono/eina_array.cs8
-rw-r--r--src/bindings/mono/eina_mono/eina_common.cs33
-rw-r--r--src/bindings/mono/eina_mono/eina_container_common.cs37
-rw-r--r--src/bindings/mono/eina_mono/eina_error.cs7
-rw-r--r--src/bindings/mono/eina_mono/eina_inarray.cs6
-rw-r--r--src/bindings/mono/eina_mono/eina_inlist.cs6
-rw-r--r--src/bindings/mono/eina_mono/eina_list.cs6
-rw-r--r--src/bindings/mono/eina_mono/eina_log.cs9
-rw-r--r--src/bindings/mono/eina_mono/eina_promises.cs356
-rw-r--r--src/bindings/mono/eina_mono/eina_strbuf.cs156
-rw-r--r--src/bindings/mono/eina_mono/eina_value.cs153
-rw-r--r--src/bindings/mono/eldbus_mono/eldbus_connection.cs2
-rw-r--r--src/bindings/mono/eo_mono/iwrapper.cs145
-rw-r--r--src/bindings/mono/eo_mono/object.cs10
-rw-r--r--src/bindings/mono/eo_mono/workaround.cs112
-rw-r--r--src/examples/ecore/ecore_audio_custom.c6
-rw-r--r--src/examples/ecore/ecore_audio_playback.c12
-rw-r--r--src/examples/ecore/ecore_audio_to_ogg.c20
-rw-r--r--src/examples/ecore/ecore_evas_cursor_example.c2
-rw-r--r--src/examples/ecore/ecore_evas_vnc_example.c6
-rw-r--r--src/examples/ecore/ecore_evas_wayland_multiseat_example.c14
-rw-r--r--src/examples/ecore/ecore_idler_example.c2
-rw-r--r--src/examples/ecore/ecore_poller_example.c6
-rw-r--r--src/examples/ecore/ecore_promise2_example.c157
-rw-r--r--src/examples/ecore/ecore_thread_example.c66
-rw-r--r--src/examples/ecore/efl_io_buffered_stream_example.c40
-rw-r--r--src/examples/ecore/efl_io_copier_example.c107
-rw-r--r--src/examples/ecore/efl_io_copier_simple_example.c63
-rw-r--r--src/examples/ecore/efl_io_queue_example.c84
-rw-r--r--src/examples/ecore/efl_net_control_example.c152
-rw-r--r--src/examples/ecore/efl_net_dialer_http_example.c94
-rw-r--r--src/examples/ecore/efl_net_dialer_simple_example.c83
-rw-r--r--src/examples/ecore/efl_net_dialer_udp_example.c84
-rw-r--r--src/examples/ecore/efl_net_dialer_unix_example.c84
-rw-r--r--src/examples/ecore/efl_net_dialer_websocket_autobahntestee.c114
-rw-r--r--src/examples/ecore/efl_net_dialer_websocket_example.c75
-rw-r--r--src/examples/ecore/efl_net_dialer_windows_example.c80
-rw-r--r--src/examples/ecore/efl_net_ip_address_example.c77
-rw-r--r--src/examples/ecore/efl_net_server_example.c86
-rw-r--r--src/examples/ecore/efl_net_server_simple_example.c75
-rw-r--r--src/examples/ecore/efl_net_session_example.c66
-rw-r--r--src/examples/ecore/efl_net_socket_ssl_dialer_example.c113
-rw-r--r--src/examples/ecore/efl_net_socket_ssl_server_example.c98
-rw-r--r--src/examples/edje/edje-multiseat-custom-names.c4
-rw-r--r--src/examples/edje/edje-multiseat-filter.c2
-rw-r--r--src/examples/edje/edje-multiseat.c2
-rw-r--r--src/examples/efl_mono/EoInherit01.cs4
-rw-r--r--src/examples/efl_mono/FunctionPointer01.cs2
-rw-r--r--src/examples/efl_mono/Makefile.am24
-rw-r--r--src/examples/efl_mono/example_numberwrapper.c10
-rw-r--r--src/examples/eina/Makefile.am8
-rw-r--r--src/examples/eina/eina_simple_xml_parser_01.c5
-rw-r--r--src/examples/eio/efl_io_manager_ls.c5
-rw-r--r--src/examples/eio/efl_io_manager_open_multi.c16
-rw-r--r--src/examples/eio/eio_sentry.c2
-rw-r--r--src/examples/eldbus/dbusmodel.c196
-rw-r--r--src/examples/elementary/.gitignore7
-rw-r--r--src/examples/elementary/Makefile.am54
-rw-r--r--src/examples/elementary/bg_cxx_example_01.cc8
-rw-r--r--src/examples/elementary/bg_cxx_example_02.cc2
-rw-r--r--src/examples/elementary/button_cxx_example_01.cc4
-rw-r--r--src/examples/elementary/calendar_cxx_example_04.cc4
-rw-r--r--src/examples/elementary/calendar_cxx_example_05.cc2
-rw-r--r--src/examples/elementary/calendar_example_06.c17
-rw-r--r--src/examples/elementary/codegen_example.edjbin12063 -> 0 bytes
-rw-r--r--src/examples/elementary/efl_ui_list_example_1.c340
-rw-r--r--src/examples/elementary/efl_ui_scroller_example.c6
-rw-r--r--src/examples/elementary/efl_ui_slider_mono.cs46
-rw-r--r--src/examples/elementary/efl_ui_unit_converter.cs80
-rw-r--r--src/examples/elementary/efl_ui_view_list_example.edc (renamed from src/examples/elementary/efl_ui_list_example.edc)62
-rw-r--r--src/examples/elementary/efl_ui_view_list_example_1.c111
-rw-r--r--src/examples/elementary/efl_ui_view_list_example_2.c (renamed from src/examples/elementary/efl_ui_list_example_2.c)18
-rw-r--r--src/examples/elementary/efl_ui_view_list_example_3.c (renamed from src/examples/elementary/efl_ui_list_example_3.c)47
-rw-r--r--src/examples/elementary/evas3d_map_example.c10
-rw-r--r--src/examples/elementary/evas3d_object_on_button_example.c12
-rw-r--r--src/examples/elementary/evas3d_scene_on_button_example.c10
-rw-r--r--src/examples/elementary/filemvc.c46
-rw-r--r--src/examples/elementary/fileviewlist.c4
-rw-r--r--src/examples/elementary/icon_cxx_example_01.cc2
-rw-r--r--src/examples/elementary/layout_model_connect.c6
-rw-r--r--src/examples/elementary/menu_cxx_example_01.cc2
-rw-r--r--src/examples/elementary/performance/graphical.c12
-rw-r--r--src/examples/elementary/popup_cxx_example.cc10
-rw-r--r--src/examples/elementary/slider_cxx_example.cc21
-rw-r--r--src/examples/elementary/sphere_hunter/evas_3d_sphere_hunter.c14
-rw-r--r--src/examples/elua/Makefile.am12
-rw-r--r--src/examples/eolian_cxx/Makefile.am18
-rw-r--r--src/examples/eolian_cxx/colourable.c4
-rw-r--r--src/examples/eolian_cxx/colourablesquare.c2
-rw-r--r--src/examples/ethumb_client/ethumb_dbus.c1
-rw-r--r--src/examples/evas/Makefile.am12
-rw-r--r--src/examples/evas/evas-3d-aabb.c22
-rw-r--r--src/examples/evas/evas-3d-blending.c14
-rw-r--r--src/examples/evas/evas-3d-colorpick.c16
-rw-r--r--src/examples/evas/evas-3d-cube-rotate.c10
-rw-r--r--src/examples/evas/evas-3d-cube.c20
-rw-r--r--src/examples/evas/evas-3d-cube2.c20
-rw-r--r--src/examples/evas/evas-3d-eet.c22
-rw-r--r--src/examples/evas/evas-3d-fog.c24
-rw-r--r--src/examples/evas/evas-3d-frustum.c10
-rw-r--r--src/examples/evas/evas-3d-hull.c24
-rw-r--r--src/examples/evas/evas-3d-md2.c20
-rw-r--r--src/examples/evas/evas-3d-mmap-set.c20
-rw-r--r--src/examples/evas/evas-3d-obj.c20
-rw-r--r--src/examples/evas/evas-3d-parallax-occlusion.c20
-rw-r--r--src/examples/evas/evas-3d-pick.c14
-rw-r--r--src/examples/evas/evas-3d-ply.c20
-rw-r--r--src/examples/evas/evas-3d-proxy.c26
-rw-r--r--src/examples/evas/evas-3d-shadows.c36
-rw-r--r--src/examples/evas/evas-3d-static-lod.c24
-rw-r--r--src/examples/evas/evas-event-filter.c6
-rw-r--r--src/examples/evas/evas-gl.c6
-rw-r--r--src/examples/evas/evas-images5.c6
-rw-r--r--src/examples/evas/evas-map-utils-eo.c19
-rw-r--r--src/examples/evas/evas-multiseat-events.c8
-rw-r--r--src/examples/evas/evas-object-manipulation-eo.c34
-rw-r--r--src/examples/evas/evas-vg-batman.c42
-rw-r--r--src/examples/evas/evas-vg-simple.c14
-rw-r--r--src/examples/evas/evas_mono_box.cs14
-rw-r--r--src/examples/evas/evas_mono_image.cs14
-rw-r--r--src/examples/evas/evas_mono_image2.cs12
-rw-r--r--src/examples/evas/evas_mono_rectangle.cs10
-rw-r--r--src/examples/evas/evas_mono_table.cs18
-rw-r--r--src/examples/evas/evas_mono_text.cs16
-rw-r--r--src/examples/evas/shooter/evas-3d-shooter-header.c6
-rw-r--r--src/examples/evas/shooter/evas-3d-shooter-macros.h2
-rw-r--r--src/examples/evas/shooter/evas-3d-shooter.c4
-rw-r--r--src/lib/ecore/Ecore.h8
-rw-r--r--src/lib/ecore/Ecore_Common.h53
-rw-r--r--src/lib/ecore/Ecore_Eo.h95
-rw-r--r--src/lib/ecore/Ecore_Getopt.h8
-rw-r--r--src/lib/ecore/Efl_Core.h8
-rw-r--r--src/lib/ecore/ecore.c60
-rw-r--r--src/lib/ecore/ecore_anim.c33
-rw-r--r--src/lib/ecore/ecore_event_message.c2
-rw-r--r--src/lib/ecore/ecore_event_message.eo5
-rw-r--r--src/lib/ecore/ecore_event_message_handler.c44
-rw-r--r--src/lib/ecore/ecore_event_message_handler.eo16
-rw-r--r--src/lib/ecore/ecore_events.c19
-rw-r--r--src/lib/ecore/ecore_exe.c4
-rw-r--r--src/lib/ecore/ecore_glib.c26
-rw-r--r--src/lib/ecore/ecore_internal.h37
-rw-r--r--src/lib/ecore/ecore_main.c189
-rw-r--r--src/lib/ecore/ecore_pipe.c11
-rw-r--r--src/lib/ecore/ecore_private.h77
-rw-r--r--src/lib/ecore/ecore_signal.c199
-rw-r--r--src/lib/ecore/ecore_thread.c639
-rw-r--r--src/lib/ecore/ecore_timer.c27
-rw-r--r--src/lib/ecore/efl_app.c412
-rw-r--r--src/lib/ecore/efl_app.eo56
-rw-r--r--src/lib/ecore/efl_appthread.c261
-rw-r--r--src/lib/ecore/efl_appthread.eo21
-rw-r--r--src/lib/ecore/efl_exe.c844
-rw-r--r--src/lib/ecore/efl_exe.eo60
-rw-r--r--src/lib/ecore/efl_general.h6
-rw-r--r--src/lib/ecore/efl_interpolator_accelerate.c2
-rw-r--r--src/lib/ecore/efl_interpolator_accelerate.eo2
-rw-r--r--src/lib/ecore/efl_interpolator_bounce.c2
-rw-r--r--src/lib/ecore/efl_interpolator_bounce.eo2
-rw-r--r--src/lib/ecore/efl_interpolator_cubic_bezier.c2
-rw-r--r--src/lib/ecore/efl_interpolator_cubic_bezier.eo2
-rw-r--r--src/lib/ecore/efl_interpolator_decelerate.c2
-rw-r--r--src/lib/ecore/efl_interpolator_decelerate.eo2
-rw-r--r--src/lib/ecore/efl_interpolator_divisor.c2
-rw-r--r--src/lib/ecore/efl_interpolator_divisor.eo2
-rw-r--r--src/lib/ecore/efl_interpolator_linear.eo2
-rw-r--r--src/lib/ecore/efl_interpolator_sinusoidal.c2
-rw-r--r--src/lib/ecore/efl_interpolator_sinusoidal.eo2
-rw-r--r--src/lib/ecore/efl_interpolator_spring.c2
-rw-r--r--src/lib/ecore/efl_interpolator_spring.eo2
-rw-r--r--src/lib/ecore/efl_io_buffered_stream.c82
-rw-r--r--src/lib/ecore/efl_io_buffered_stream.eo16
-rw-r--r--src/lib/ecore/efl_io_closer_fd.c16
-rw-r--r--src/lib/ecore/efl_io_closer_fd.eo4
-rw-r--r--src/lib/ecore/efl_io_copier.c87
-rw-r--r--src/lib/ecore/efl_io_copier.eo17
-rw-r--r--src/lib/ecore/efl_io_file.c10
-rw-r--r--src/lib/ecore/efl_io_file.eo6
-rw-r--r--src/lib/ecore/efl_io_positioner_fd.c4
-rw-r--r--src/lib/ecore/efl_io_positioner_fd.eo2
-rw-r--r--src/lib/ecore/efl_io_reader_fd.c6
-rw-r--r--src/lib/ecore/efl_io_reader_fd.eo2
-rw-r--r--src/lib/ecore/efl_io_sizer_fd.c4
-rw-r--r--src/lib/ecore/efl_io_sizer_fd.eo2
-rw-r--r--src/lib/ecore/efl_io_stderr.eo4
-rw-r--r--src/lib/ecore/efl_io_stdin.eo4
-rw-r--r--src/lib/ecore/efl_io_stdout.eo4
-rw-r--r--src/lib/ecore/efl_io_writer_fd.c4
-rw-r--r--src/lib/ecore/efl_io_writer_fd.eo2
-rw-r--r--src/lib/ecore/efl_loop.c376
-rw-r--r--src/lib/ecore/efl_loop.eo68
-rw-r--r--src/lib/ecore/efl_loop_consumer.c2
-rw-r--r--src/lib/ecore/efl_loop_consumer.eo4
-rw-r--r--src/lib/ecore/efl_loop_fd.c14
-rw-r--r--src/lib/ecore/efl_loop_fd.eo44
-rw-r--r--src/lib/ecore/efl_loop_handler.c24
-rw-r--r--src/lib/ecore/efl_loop_handler.eo14
-rw-r--r--src/lib/ecore/efl_loop_message.eo7
-rw-r--r--src/lib/ecore/efl_loop_message_future.c2
-rw-r--r--src/lib/ecore/efl_loop_message_future.eo5
-rw-r--r--src/lib/ecore/efl_loop_message_future_handler.eo11
-rw-r--r--src/lib/ecore/efl_loop_message_handler.eo13
-rw-r--r--src/lib/ecore/efl_loop_timer.eo6
-rw-r--r--src/lib/ecore/efl_model_accessor_view.c2
-rw-r--r--src/lib/ecore/efl_model_composite.c108
-rw-r--r--src/lib/ecore/efl_model_composite.eo15
-rw-r--r--src/lib/ecore/efl_model_composite_boolean.c764
-rw-r--r--src/lib/ecore/efl_model_composite_boolean.eo30
-rw-r--r--src/lib/ecore/efl_model_composite_boolean_children.eo25
-rw-r--r--src/lib/ecore/efl_model_composite_selection.c534
-rw-r--r--src/lib/ecore/efl_model_composite_selection.eo24
-rw-r--r--src/lib/ecore/efl_model_composite_selection_children.eo4
-rw-r--r--src/lib/ecore/efl_model_container.c218
-rw-r--r--src/lib/ecore/efl_model_container.eo9
-rw-r--r--src/lib/ecore/efl_model_container_item.c210
-rw-r--r--src/lib/ecore/efl_model_container_item.eo25
-rw-r--r--src/lib/ecore/efl_model_container_private.h11
-rw-r--r--src/lib/ecore/efl_model_item.c169
-rw-r--r--src/lib/ecore/efl_model_item.eo9
-rw-r--r--src/lib/ecore/efl_promise.c1423
-rw-r--r--src/lib/ecore/efl_promise.eo80
-rw-r--r--src/lib/ecore/efl_task.c439
-rw-r--r--src/lib/ecore/efl_task.eo158
-rw-r--r--src/lib/ecore/efl_thread.c1073
-rw-r--r--src/lib/ecore/efl_thread.eo21
-rw-r--r--src/lib/ecore/efl_threadio.c59
-rw-r--r--src/lib/ecore/efl_threadio.eo52
-rw-r--r--src/lib/ecore_audio/Ecore_Audio.h25
-rw-r--r--src/lib/ecore_audio/ecore_audio.c38
-rw-r--r--src/lib/ecore_audio/ecore_audio.eo13
-rw-r--r--src/lib/ecore_audio/ecore_audio_in.eo6
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj.c15
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_in.c17
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_in.h3
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c5
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_out_pulse.c2
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c5
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_out_wasapi.c33
-rw-r--r--src/lib/ecore_audio/ecore_audio_out_pulse.eo4
-rw-r--r--src/lib/ecore_audio/ecore_audio_out_wasapi.eo8
-rw-r--r--src/lib/ecore_avahi/Ecore_Avahi.h8
-rw-r--r--src/lib/ecore_buffer/Ecore_Buffer.h11
-rw-r--r--src/lib/ecore_buffer/Ecore_Buffer_Queue.h11
-rw-r--r--src/lib/ecore_cocoa/ecore_cocoa.m69
-rw-r--r--src/lib/ecore_cocoa/ecore_cocoa_cnp.m6
-rw-r--r--src/lib/ecore_con/Ecore_Con.h19
-rw-r--r--src/lib/ecore_con/Ecore_Con_Eet.h4
-rw-r--r--src/lib/ecore_con/Efl_Net.h4
-rw-r--r--src/lib/ecore_con/ecore_con.c29
-rw-r--r--src/lib/ecore_con/ecore_con_eet.c28
-rw-r--r--src/lib/ecore_con/ecore_con_eet_base.eo3
-rw-r--r--src/lib/ecore_con/ecore_con_legacy.c189
-rw-r--r--src/lib/ecore_con/ecore_con_local_win32.c2
-rw-r--r--src/lib/ecore_con/ecore_con_private.h2
-rw-r--r--src/lib/ecore_con/ecore_con_proxy_helper.c11
-rw-r--r--src/lib/ecore_con/ecore_con_url.c36
-rw-r--r--src/lib/ecore_con/ecore_con_url_curl.h2
-rw-r--r--src/lib/ecore_con/efl_net-connman.h12
-rw-r--r--src/lib/ecore_con/efl_net_control-connman.c128
-rw-r--r--src/lib/ecore_con/efl_net_control-none.c34
-rw-r--r--src/lib/ecore_con/efl_net_control_access_point-connman.c67
-rw-r--r--src/lib/ecore_con/efl_net_control_access_point-none.c46
-rw-r--r--src/lib/ecore_con/efl_net_control_access_point.eo52
-rw-r--r--src/lib/ecore_con/efl_net_control_manager.eo (renamed from src/lib/ecore_con/efl_net_control.eo)30
-rw-r--r--src/lib/ecore_con/efl_net_control_technology-connman.c12
-rw-r--r--src/lib/ecore_con/efl_net_control_technology-none.c10
-rw-r--r--src/lib/ecore_con/efl_net_control_technology.eo25
-rw-r--r--src/lib/ecore_con/efl_net_dialer.eo9
-rw-r--r--src/lib/ecore_con/efl_net_dialer_http.c80
-rw-r--r--src/lib/ecore_con/efl_net_dialer_http.eo25
-rw-r--r--src/lib/ecore_con/efl_net_dialer_simple.c45
-rw-r--r--src/lib/ecore_con/efl_net_dialer_simple.eo5
-rw-r--r--src/lib/ecore_con/efl_net_dialer_ssl.c45
-rw-r--r--src/lib/ecore_con/efl_net_dialer_ssl.eo6
-rw-r--r--src/lib/ecore_con/efl_net_dialer_tcp.c18
-rw-r--r--src/lib/ecore_con/efl_net_dialer_tcp.eo3
-rw-r--r--src/lib/ecore_con/efl_net_dialer_udp.c18
-rw-r--r--src/lib/ecore_con/efl_net_dialer_udp.eo11
-rw-r--r--src/lib/ecore_con/efl_net_dialer_unix.c16
-rw-r--r--src/lib/ecore_con/efl_net_dialer_unix.eo3
-rw-r--r--src/lib/ecore_con/efl_net_dialer_websocket.c51
-rw-r--r--src/lib/ecore_con/efl_net_dialer_websocket.eo29
-rw-r--r--src/lib/ecore_con/efl_net_dialer_windows.c6
-rw-r--r--src/lib/ecore_con/efl_net_dialer_windows.eo2
-rw-r--r--src/lib/ecore_con/efl_net_ip_address.c188
-rw-r--r--src/lib/ecore_con/efl_net_ip_address.eo4
-rw-r--r--src/lib/ecore_con/efl_net_server.eo2
-rw-r--r--src/lib/ecore_con/efl_net_server_fd.c16
-rw-r--r--src/lib/ecore_con/efl_net_server_fd.eo8
-rw-r--r--src/lib/ecore_con/efl_net_server_ip.c2
-rw-r--r--src/lib/ecore_con/efl_net_server_ip.eo2
-rw-r--r--src/lib/ecore_con/efl_net_server_simple.c28
-rw-r--r--src/lib/ecore_con/efl_net_server_simple.eo6
-rw-r--r--src/lib/ecore_con/efl_net_server_ssl.c18
-rw-r--r--src/lib/ecore_con/efl_net_server_ssl.eo5
-rw-r--r--src/lib/ecore_con/efl_net_server_tcp.c4
-rw-r--r--src/lib/ecore_con/efl_net_server_tcp.eo8
-rw-r--r--src/lib/ecore_con/efl_net_server_udp.c8
-rw-r--r--src/lib/ecore_con/efl_net_server_udp.eo6
-rw-r--r--src/lib/ecore_con/efl_net_server_udp_client.c34
-rw-r--r--src/lib/ecore_con/efl_net_server_udp_client.eo7
-rw-r--r--src/lib/ecore_con/efl_net_server_unix.c6
-rw-r--r--src/lib/ecore_con/efl_net_server_unix.eo8
-rw-r--r--src/lib/ecore_con/efl_net_server_windows.c26
-rw-r--r--src/lib/ecore_con/efl_net_server_windows.eo3
-rw-r--r--src/lib/ecore_con/efl_net_session-connman.c12
-rw-r--r--src/lib/ecore_con/efl_net_session-none.c12
-rw-r--r--src/lib/ecore_con/efl_net_session.eo26
-rw-r--r--src/lib/ecore_con/efl_net_socket_fd.c20
-rw-r--r--src/lib/ecore_con/efl_net_socket_fd.eo9
-rw-r--r--src/lib/ecore_con/efl_net_socket_simple.c4
-rw-r--r--src/lib/ecore_con/efl_net_socket_simple.eo2
-rw-r--r--src/lib/ecore_con/efl_net_socket_ssl.c45
-rw-r--r--src/lib/ecore_con/efl_net_socket_ssl.eo17
-rw-r--r--src/lib/ecore_con/efl_net_socket_tcp.c6
-rw-r--r--src/lib/ecore_con/efl_net_socket_tcp.eo4
-rw-r--r--src/lib/ecore_con/efl_net_socket_udp.c14
-rw-r--r--src/lib/ecore_con/efl_net_socket_udp.eo6
-rw-r--r--src/lib/ecore_con/efl_net_socket_unix.eo4
-rw-r--r--src/lib/ecore_con/efl_net_socket_windows.c34
-rw-r--r--src/lib/ecore_con/efl_net_socket_windows.eo4
-rw-r--r--src/lib/ecore_con/efl_net_ssl_conn-openssl.c2
-rw-r--r--src/lib/ecore_con/efl_net_ssl_context.c24
-rw-r--r--src/lib/ecore_con/efl_net_ssl_ctx-gnutls.c3
-rw-r--r--src/lib/ecore_con/efl_net_ssl_ctx-openssl.c27
-rw-r--r--src/lib/ecore_con/efl_net_ssl_types.eot1
-rw-r--r--src/lib/ecore_drm2/Ecore_Drm2.h69
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_device.c34
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_outputs.c62
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_plane.c4
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_private.h6
-rw-r--r--src/lib/ecore_evas/Ecore_Evas.h24
-rw-r--r--src/lib/ecore_evas/ecore_evas.c181
-rw-r--r--src/lib/ecore_evas/ecore_evas_buffer.c34
-rw-r--r--src/lib/ecore_evas/ecore_evas_buffer.h1
-rw-r--r--src/lib/ecore_evas/ecore_evas_drm.h2
-rw-r--r--src/lib/ecore_evas/ecore_evas_module.c72
-rw-r--r--src/lib/ecore_evas/ecore_evas_private.h15
-rw-r--r--src/lib/ecore_fb/ecore_fb_li.c2
-rw-r--r--src/lib/ecore_file/Ecore_File.h22
-rw-r--r--src/lib/ecore_file/ecore_file.c20
-rw-r--r--src/lib/ecore_file/ecore_file_download.c4
-rw-r--r--src/lib/ecore_file/ecore_file_monitor_inotify.c35
-rw-r--r--src/lib/ecore_imf/Ecore_IMF.h25
-rw-r--r--src/lib/ecore_imf/ecore_imf_context.c88
-rw-r--r--src/lib/ecore_imf/ecore_imf_module.c6
-rw-r--r--src/lib/ecore_imf_evas/Ecore_IMF_Evas.h8
-rw-r--r--src/lib/ecore_input/Ecore_Input.h6
-rw-r--r--src/lib/ecore_input_evas/Ecore_Input_Evas.h6
-rw-r--r--src/lib/ecore_input_evas/ecore_input_evas.c28
-rw-r--r--src/lib/ecore_ipc/Ecore_Ipc.h2
-rw-r--r--src/lib/ecore_ipc/ecore_ipc.c72
-rw-r--r--src/lib/ecore_sdl/Ecore_Sdl.h8
-rw-r--r--src/lib/ecore_wayland/ecore_wl_dnd.c9
-rw-r--r--src/lib/ecore_wayland/ecore_wl_input.c2
-rw-r--r--src/lib/ecore_win32/Ecore_Win32.h8
-rw-r--r--src/lib/ecore_win32/ecore_win32.c17
-rw-r--r--src/lib/ecore_win32/ecore_win32_event.c13
-rw-r--r--src/lib/ecore_win32/ecore_win32_private.h2
-rw-r--r--src/lib/ecore_wl2/Ecore_Wl2.h172
-rw-r--r--src/lib/ecore_wl2/ecore_wl2.c50
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_buffer.c164
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_display.c60
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_dnd.c38
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_input.c180
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_output.c11
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_private.h42
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_surface.c281
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_surface_module_dmabuf.c269
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_window.c764
-rw-r--r--src/lib/ecore_wl2/window_v6.x192
-rw-r--r--src/lib/ecore_x/Ecore_X.h10
-rw-r--r--src/lib/ecore_x/ecore_x.c96
-rw-r--r--src/lib/ecore_x/ecore_x_error.c6
-rw-r--r--src/lib/ecore_x/ecore_x_events.c13
-rw-r--r--src/lib/ecore_x/ecore_x_private.h2
-rw-r--r--src/lib/ector/Ector.h8
-rw-r--r--src/lib/ector/cairo/Ector_Cairo.h8
-rw-r--r--src/lib/ector/cairo/ector_cairo_software_surface.c4
-rw-r--r--src/lib/ector/cairo/ector_cairo_surface.c8
-rw-r--r--src/lib/ector/cairo/ector_cairo_surface.eo14
-rw-r--r--src/lib/ector/cairo/ector_renderer_cairo.c2
-rw-r--r--src/lib/ector/cairo/ector_renderer_cairo.eo4
-rw-r--r--src/lib/ector/cairo/ector_renderer_cairo_gradient_linear.c6
-rw-r--r--src/lib/ector/cairo/ector_renderer_cairo_gradient_linear.eo6
-rw-r--r--src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c13
-rw-r--r--src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.eo6
-rw-r--r--src/lib/ector/cairo/ector_renderer_cairo_shape.c10
-rw-r--r--src/lib/ector/cairo/ector_renderer_cairo_shape.eo6
-rw-r--r--src/lib/ector/ector_buffer.c6
-rw-r--r--src/lib/ector/ector_buffer.eo3
-rw-r--r--src/lib/ector/ector_renderer.c16
-rw-r--r--src/lib/ector/ector_renderer.eo114
-rw-r--r--src/lib/ector/ector_renderer_gradient.c4
-rw-r--r--src/lib/ector/ector_renderer_gradient_linear.c4
-rw-r--r--src/lib/ector/ector_renderer_gradient_linear.eo6
-rw-r--r--src/lib/ector/ector_renderer_gradient_radial.c6
-rw-r--r--src/lib/ector/ector_renderer_gradient_radial.eo8
-rw-r--r--src/lib/ector/ector_renderer_shape.c6
-rw-r--r--src/lib/ector/ector_renderer_shape.eo42
-rw-r--r--src/lib/ector/gl/Ector_GL.h8
-rw-r--r--src/lib/ector/gl/ector_gl_surface.c6
-rw-r--r--src/lib/ector/gl/ector_gl_surface.eo22
-rw-r--r--src/lib/ector/gl/ector_renderer_gl.eo16
-rw-r--r--src/lib/ector/gl/ector_renderer_gl_gradient_linear.c6
-rw-r--r--src/lib/ector/gl/ector_renderer_gl_gradient_linear.eo6
-rw-r--r--src/lib/ector/gl/ector_renderer_gl_gradient_radial.c6
-rw-r--r--src/lib/ector/gl/ector_renderer_gl_gradient_radial.eo6
-rw-r--r--src/lib/ector/gl/ector_renderer_gl_shape.c10
-rw-r--r--src/lib/ector/gl/ector_renderer_gl_shape.eo6
-rw-r--r--src/lib/ector/software/Ector_Software.h8
-rw-r--r--src/lib/ector/software/ector_renderer_software.eo4
-rw-r--r--src/lib/ector/software/ector_renderer_software_gradient_linear.c4
-rw-r--r--src/lib/ector/software/ector_renderer_software_gradient_linear.eo2
-rw-r--r--src/lib/ector/software/ector_renderer_software_gradient_radial.c4
-rw-r--r--src/lib/ector/software/ector_renderer_software_gradient_radial.eo2
-rw-r--r--src/lib/ector/software/ector_renderer_software_shape.c8
-rw-r--r--src/lib/ector/software/ector_renderer_software_shape.eo2
-rw-r--r--src/lib/ector/software/ector_software_buffer.c12
-rw-r--r--src/lib/ector/software/ector_software_surface.c6
-rw-r--r--src/lib/edje/Edje.h6
-rw-r--r--src/lib/edje/Edje_Common.h18
-rw-r--r--src/lib/edje/Edje_Edit.h6
-rw-r--r--src/lib/edje/Edje_Legacy.h45
-rw-r--r--src/lib/edje/edje_cache.c75
-rw-r--r--src/lib/edje/edje_calc.c208
-rw-r--r--src/lib/edje/edje_callbacks.c2
-rw-r--r--src/lib/edje/edje_data.c11
-rw-r--r--src/lib/edje/edje_edit.c41
-rw-r--r--src/lib/edje/edje_embryo.c2
-rw-r--r--src/lib/edje/edje_entry.c53
-rw-r--r--src/lib/edje/edje_legacy.c83
-rw-r--r--src/lib/edje/edje_load.c113
-rw-r--r--src/lib/edje/edje_lua.c2
-rw-r--r--src/lib/edje/edje_lua2.c5
-rw-r--r--src/lib/edje/edje_main.c8
-rw-r--r--src/lib/edje/edje_message_queue.c11
-rw-r--r--src/lib/edje/edje_multisense.c74
-rw-r--r--src/lib/edje/edje_part.c19
-rw-r--r--src/lib/edje/edje_part_box.c75
-rw-r--r--src/lib/edje/edje_part_external.c4
-rw-r--r--src/lib/edje/edje_part_helper.h35
-rw-r--r--src/lib/edje/edje_part_invalid.c101
-rw-r--r--src/lib/edje/edje_part_swallow.c10
-rw-r--r--src/lib/edje/edje_part_table.c68
-rw-r--r--src/lib/edje/edje_part_text.c24
-rw-r--r--src/lib/edje/edje_private.h61
-rw-r--r--src/lib/edje/edje_program.c135
-rw-r--r--src/lib/edje/edje_smart.c69
-rw-r--r--src/lib/edje/edje_text.c62
-rw-r--r--src/lib/edje/edje_textblock.c37
-rw-r--r--src/lib/edje/edje_textblock_styles.c24
-rw-r--r--src/lib/edje/edje_types.eot2
-rw-r--r--src/lib/edje/edje_util.c170
-rw-r--r--src/lib/edje/efl_canvas_layout.eo35
-rw-r--r--src/lib/edje/efl_canvas_layout_part.eo13
-rw-r--r--src/lib/edje/efl_canvas_layout_part_box.eo18
-rw-r--r--src/lib/edje/efl_canvas_layout_part_external.eo4
-rw-r--r--src/lib/edje/efl_canvas_layout_part_invalid.eo74
-rw-r--r--src/lib/edje/efl_canvas_layout_part_swallow.eo2
-rw-r--r--src/lib/edje/efl_canvas_layout_part_table.eo16
-rw-r--r--src/lib/edje/efl_canvas_layout_part_text.eo34
-rw-r--r--src/lib/edje/efl_layout_calc.eo5
-rw-r--r--src/lib/edje/efl_layout_group.eo22
-rw-r--r--src/lib/eet/Eet.h26
-rw-r--r--src/lib/eet/Eet_private.h1
-rw-r--r--src/lib/eet/eet_data.c96
-rw-r--r--src/lib/eet/eet_lib.c70
-rw-r--r--src/lib/eet/eet_node.c4
-rw-r--r--src/lib/eeze/eeze_sensor.c5
-rw-r--r--src/lib/eeze/eeze_udev_watch.c139
-rw-r--r--src/lib/efl/CMakeLists.txt4
-rw-r--r--src/lib/efl/Efl.h68
-rw-r--r--src/lib/efl/Efl.hh2
-rw-r--r--src/lib/efl/Efl_Model_Common.h39
-rw-r--r--src/lib/efl/cxx/efl_part_impl.hh3
-rw-r--r--src/lib/efl/interfaces/efl_animator.eo4
-rw-r--r--src/lib/efl/interfaces/efl_canvas_scene.eo (renamed from src/lib/efl/interfaces/efl_canvas.eo)28
-rw-r--r--src/lib/efl/interfaces/efl_common_internal.h2
-rw-r--r--src/lib/efl/interfaces/efl_container.eo8
-rw-r--r--src/lib/efl/interfaces/efl_content.eo4
-rw-r--r--src/lib/efl/interfaces/efl_file.c35
-rw-r--r--src/lib/efl/interfaces/efl_file.eo2
-rw-r--r--src/lib/efl/interfaces/efl_flipable.eo29
-rw-r--r--src/lib/efl/interfaces/efl_gfx_buffer.eo12
-rw-r--r--src/lib/efl/interfaces/efl_gfx_color.c4
-rw-r--r--src/lib/efl/interfaces/efl_gfx_color.eo2
-rw-r--r--src/lib/efl/interfaces/efl_gfx_color_class.eo2
-rw-r--r--src/lib/efl/interfaces/efl_gfx_entity.eo (renamed from src/lib/efl/interfaces/efl_gfx.eo)15
-rw-r--r--src/lib/efl/interfaces/efl_gfx_filter.eo2
-rw-r--r--src/lib/efl/interfaces/efl_gfx_gradient.eo4
-rw-r--r--src/lib/efl/interfaces/efl_gfx_gradient_linear.eo2
-rw-r--r--src/lib/efl/interfaces/efl_gfx_gradient_radial.eo2
-rw-r--r--src/lib/efl/interfaces/efl_gfx_image.eo (renamed from src/lib/efl/interfaces/efl_image.eo)29
-rw-r--r--src/lib/efl/interfaces/efl_gfx_image_animation_controller.eo (renamed from src/lib/efl/interfaces/efl_image_animated.eo)16
-rw-r--r--src/lib/efl/interfaces/efl_gfx_image_load_controller.eo (renamed from src/lib/efl/interfaces/efl_image_load.eo)20
-rw-r--r--src/lib/efl/interfaces/efl_gfx_path.c810
-rw-r--r--src/lib/efl/interfaces/efl_gfx_path.eo6
-rw-r--r--src/lib/efl/interfaces/efl_gfx_shape.c74
-rw-r--r--src/lib/efl/interfaces/efl_gfx_shape.eo2
-rw-r--r--src/lib/efl/interfaces/efl_gfx_size_hint.eo25
-rw-r--r--src/lib/efl/interfaces/efl_gfx_stack.eo8
-rw-r--r--src/lib/efl/interfaces/efl_gfx_types.eot26
-rw-r--r--src/lib/efl/interfaces/efl_input_device.c22
-rw-r--r--src/lib/efl/interfaces/efl_input_device.eo10
-rw-r--r--src/lib/efl/interfaces/efl_interfaces_main.c51
-rw-r--r--src/lib/efl/interfaces/efl_io_buffer.c26
-rw-r--r--src/lib/efl/interfaces/efl_io_buffer.eo8
-rw-r--r--src/lib/efl/interfaces/efl_io_closer.eo12
-rw-r--r--src/lib/efl/interfaces/efl_io_positioner.eo6
-rw-r--r--src/lib/efl/interfaces/efl_io_queue.c21
-rw-r--r--src/lib/efl/interfaces/efl_io_queue.eo4
-rw-r--r--src/lib/efl/interfaces/efl_io_reader.eo6
-rw-r--r--src/lib/efl/interfaces/efl_io_sizer.eo2
-rw-r--r--src/lib/efl/interfaces/efl_io_writer.eo4
-rw-r--r--src/lib/efl/interfaces/efl_model.eo110
-rw-r--r--src/lib/efl/interfaces/efl_model_common.c88
-rw-r--r--src/lib/efl/interfaces/efl_observable.eo2
-rw-r--r--src/lib/efl/interfaces/efl_orientation.eo24
-rw-r--r--src/lib/efl/interfaces/efl_pack.eo8
-rw-r--r--src/lib/efl/interfaces/efl_pack_layout.eo2
-rw-r--r--src/lib/efl/interfaces/efl_pack_linear.eo22
-rw-r--r--src/lib/efl/interfaces/efl_pack_table.eo16
-rw-r--r--src/lib/efl/interfaces/efl_part.eo9
-rw-r--r--src/lib/efl/interfaces/efl_playable.eo29
-rw-r--r--src/lib/efl/interfaces/efl_player.eo10
-rw-r--r--src/lib/efl/interfaces/efl_text_annotate.eo92
-rw-r--r--src/lib/efl/interfaces/efl_text_cursor.eo68
-rw-r--r--src/lib/efl/interfaces/efl_text_font.eo79
-rw-r--r--src/lib/efl/interfaces/efl_text_format.eo10
-rw-r--r--src/lib/efl/interfaces/efl_text_markup.eo4
-rw-r--r--src/lib/efl/interfaces/efl_text_markup_util.eo2
-rw-r--r--src/lib/efl/interfaces/efl_text_properties.eo60
-rw-r--r--src/lib/efl/interfaces/efl_text_style.eo28
-rw-r--r--src/lib/efl/interfaces/efl_text_types.eot8
-rw-r--r--src/lib/efl/interfaces/efl_types.eot2
-rw-r--r--src/lib/efl/interfaces/efl_ui_base.eo2
-rw-r--r--src/lib/efl/interfaces/efl_ui_clickable.eo20
-rw-r--r--src/lib/efl/interfaces/efl_ui_direction.eo2
-rw-r--r--src/lib/efl/interfaces/efl_ui_drag.eo2
-rw-r--r--src/lib/efl/interfaces/efl_ui_draggable.eo17
-rw-r--r--src/lib/efl/interfaces/efl_ui_factory.eo13
-rw-r--r--src/lib/efl/interfaces/efl_ui_format.c39
-rw-r--r--src/lib/efl/interfaces/efl_ui_format.eo2
-rw-r--r--src/lib/efl/interfaces/efl_ui_item.eo54
-rw-r--r--src/lib/efl/interfaces/efl_ui_model_factory_connect.eo13
-rw-r--r--src/lib/efl/interfaces/efl_ui_multi_selectable.eo28
-rw-r--r--src/lib/efl/interfaces/efl_ui_scrollable.eo30
-rw-r--r--src/lib/efl/interfaces/efl_ui_scrollable_interactive.eo2
-rw-r--r--src/lib/efl/interfaces/efl_ui_scrollbar.eo14
-rw-r--r--src/lib/efl/interfaces/efl_ui_selectable.eo18
-rw-r--r--src/lib/efl/interfaces/efl_ui_types.eot2
-rw-r--r--src/lib/efl/interfaces/efl_ui_zoom.eo14
-rw-r--r--src/lib/efl/interfaces/efl_vpath.eo31
-rw-r--r--src/lib/efl/interfaces/efl_vpath_core.c436
-rw-r--r--src/lib/efl/interfaces/efl_vpath_core.eo33
-rw-r--r--src/lib/efl/interfaces/efl_vpath_file.c74
-rw-r--r--src/lib/efl/interfaces/efl_vpath_file.eo55
-rw-r--r--src/lib/efl/interfaces/efl_vpath_file_core.c66
-rw-r--r--src/lib/efl/interfaces/efl_vpath_file_core.eo14
-rw-r--r--src/lib/efl/interfaces/efl_vpath_manager.c88
-rw-r--r--src/lib/efl/interfaces/efl_vpath_manager.eo30
-rw-r--r--src/lib/efl_mono/efl_custom_exports_mono.c13
-rw-r--r--src/lib/efl_wl/Efl_Wl.h89
-rw-r--r--src/lib/efl_wl/copiedfromweston.x57
-rw-r--r--src/lib/efl_wl/efl_wl.c982
-rw-r--r--src/lib/efl_wl/x11.x118
-rw-r--r--src/lib/efreet/Efreet.h24
-rw-r--r--src/lib/efreet/Efreet_Mime.h9
-rw-r--r--src/lib/efreet/Efreet_Trash.h9
-rw-r--r--src/lib/efreet/efreet.c78
-rw-r--r--src/lib/efreet/efreet_base.c8
-rw-r--r--src/lib/efreet/efreet_cache.c88
-rw-r--r--src/lib/efreet/efreet_cache_private.h6
-rw-r--r--src/lib/efreet/efreet_menu.c14
-rw-r--r--src/lib/efreet/efreet_menu.h8
-rw-r--r--src/lib/efreet/efreet_mime.c2
-rw-r--r--src/lib/efreet/efreet_private.h6
-rw-r--r--src/lib/efreet/efreet_xml.c7
-rw-r--r--src/lib/eina/Eina.h1
-rw-r--r--src/lib/eina/eina_alloca.h3
-rw-r--r--src/lib/eina/eina_array.h216
-rw-r--r--src/lib/eina/eina_benchmark.h57
-rw-r--r--src/lib/eina/eina_bezier.c15
-rw-r--r--src/lib/eina/eina_bezier.h120
-rw-r--r--src/lib/eina/eina_binbuf.h289
-rw-r--r--src/lib/eina/eina_binshare.h6
-rw-r--r--src/lib/eina/eina_clist.h82
-rw-r--r--src/lib/eina/eina_convert.h41
-rw-r--r--src/lib/eina/eina_counter.h2
-rw-r--r--src/lib/eina/eina_cow.c19
-rw-r--r--src/lib/eina/eina_cow.h60
-rw-r--r--src/lib/eina/eina_cpu.h6
-rw-r--r--src/lib/eina/eina_debug.c75
-rw-r--r--src/lib/eina/eina_debug.h73
-rw-r--r--src/lib/eina/eina_debug_bt.c85
-rw-r--r--src/lib/eina/eina_debug_chunk.c23
-rw-r--r--src/lib/eina/eina_debug_cpu.c114
-rw-r--r--src/lib/eina/eina_debug_private.h4
-rw-r--r--src/lib/eina/eina_debug_thread.c8
-rw-r--r--src/lib/eina/eina_debug_timer.c24
-rw-r--r--src/lib/eina/eina_evlog.c33
-rw-r--r--src/lib/eina/eina_evlog.h2
-rw-r--r--src/lib/eina/eina_file.h6
-rw-r--r--src/lib/eina/eina_file_common.c3
-rw-r--r--src/lib/eina/eina_file_common.h6
-rw-r--r--src/lib/eina/eina_file_win32.c8
-rw-r--r--src/lib/eina/eina_freeq.h8
-rw-r--r--src/lib/eina/eina_hash.h535
-rw-r--r--src/lib/eina/eina_inarray.h2
-rw-r--r--src/lib/eina/eina_inline_lock_posix.x190
-rw-r--r--src/lib/eina/eina_inline_value.x9
-rw-r--r--src/lib/eina/eina_inline_value_util.x6
-rw-r--r--src/lib/eina/eina_internal.h55
-rw-r--r--src/lib/eina/eina_iterator.h2
-rw-r--r--src/lib/eina/eina_lalloc.h2
-rw-r--r--src/lib/eina/eina_list.h202
-rw-r--r--src/lib/eina/eina_lock.c39
-rw-r--r--src/lib/eina/eina_lock.h8
-rw-r--r--src/lib/eina/eina_log.h8
-rw-r--r--src/lib/eina/eina_main.c72
-rw-r--r--src/lib/eina/eina_main.h4
-rw-r--r--src/lib/eina/eina_matrix.c12
-rw-r--r--src/lib/eina/eina_matrix.h288
-rw-r--r--src/lib/eina/eina_matrixsparse.h235
-rw-r--r--src/lib/eina/eina_module.c4
-rw-r--r--src/lib/eina/eina_module.h6
-rw-r--r--src/lib/eina/eina_prefix.h16
-rw-r--r--src/lib/eina/eina_private.h2
-rw-r--r--src/lib/eina/eina_promise.c88
-rw-r--r--src/lib/eina/eina_promise.h117
-rw-r--r--src/lib/eina/eina_quad.h44
-rw-r--r--src/lib/eina/eina_quadtree.h172
-rw-r--r--src/lib/eina/eina_quaternion.h2
-rw-r--r--src/lib/eina/eina_rectangle.c13
-rw-r--r--src/lib/eina/eina_rectangle.h261
-rw-r--r--src/lib/eina/eina_safepointer.c85
-rw-r--r--src/lib/eina/eina_safepointer.h2
-rw-r--r--src/lib/eina/eina_share_common.c62
-rw-r--r--src/lib/eina/eina_slice.h7
-rw-r--r--src/lib/eina/eina_slstr.h2
-rw-r--r--src/lib/eina/eina_str.h2
-rw-r--r--src/lib/eina/eina_strbuf.h586
-rw-r--r--src/lib/eina/eina_strbuf_common.h1
-rw-r--r--src/lib/eina/eina_stringshare.c4
-rw-r--r--src/lib/eina/eina_stringshare.h4
-rw-r--r--src/lib/eina/eina_thread.c3
-rw-r--r--src/lib/eina/eina_thread.h4
-rw-r--r--src/lib/eina/eina_thread_queue.c152
-rw-r--r--src/lib/eina/eina_tiler.c4
-rw-r--r--src/lib/eina/eina_tiler.h2
-rw-r--r--src/lib/eina/eina_tmpstr.h4
-rw-r--r--src/lib/eina/eina_types.h14
-rw-r--r--src/lib/eina/eina_unicode.h2
-rw-r--r--src/lib/eina/eina_ustrbuf.h323
-rw-r--r--src/lib/eina/eina_ustringshare.h4
-rw-r--r--src/lib/eina/eina_util.c15
-rw-r--r--src/lib/eina/eina_util.h12
-rw-r--r--src/lib/eina/eina_value.c21
-rw-r--r--src/lib/eina/eina_value.h32
-rw-r--r--src/lib/eina/eina_vector.h6
-rw-r--r--src/lib/eina/eina_vpath.c363
-rw-r--r--src/lib/eina/eina_vpath.h91
-rw-r--r--src/lib/eina/eina_xattr.h10
-rw-r--r--src/lib/eio/Eio.h27
-rw-r--r--src/lib/eio/Eio_Legacy.h27
-rw-r--r--src/lib/eio/efl_io_manager.c267
-rw-r--r--src/lib/eio/efl_io_manager.eo44
-rw-r--r--src/lib/eio/eio_dir.c9
-rw-r--r--src/lib/eio/eio_file.c91
-rw-r--r--src/lib/eio/eio_model.c1343
-rw-r--r--src/lib/eio/eio_model.eo34
-rw-r--r--src/lib/eio/eio_model_private.h102
-rw-r--r--src/lib/eio/eio_monitor.c14
-rw-r--r--src/lib/eio/eio_monitor_inotify.c23
-rw-r--r--src/lib/eio/eio_monitor_poll.c116
-rw-r--r--src/lib/eio/eio_monitor_win32.c1
-rw-r--r--src/lib/eio/eio_private.h41
-rw-r--r--src/lib/eio/eio_sentry.c16
-rw-r--r--src/lib/eio/eio_sentry.eo20
-rw-r--r--src/lib/eldbus/Eldbus.h7
-rw-r--r--src/lib/eldbus/eldbus_core.c78
-rw-r--r--src/lib/eldbus/eldbus_model.c198
-rw-r--r--src/lib/eldbus/eldbus_model.eo62
-rw-r--r--src/lib/eldbus/eldbus_model_arguments.c124
-rw-r--r--src/lib/eldbus/eldbus_model_arguments.eo16
-rw-r--r--src/lib/eldbus/eldbus_model_connection.c323
-rw-r--r--src/lib/eldbus/eldbus_model_connection.eo49
-rw-r--r--src/lib/eldbus/eldbus_model_connection_private.h18
-rw-r--r--src/lib/eldbus/eldbus_model_method.c32
-rw-r--r--src/lib/eldbus/eldbus_model_method.eo23
-rw-r--r--src/lib/eldbus/eldbus_model_method_private.h4
-rw-r--r--src/lib/eldbus/eldbus_model_object.c489
-rw-r--r--src/lib/eldbus/eldbus_model_object.eo66
-rw-r--r--src/lib/eldbus/eldbus_model_object_private.h22
-rw-r--r--src/lib/eldbus/eldbus_model_private.h35
-rw-r--r--src/lib/eldbus/eldbus_model_proxy.c810
-rw-r--r--src/lib/eldbus/eldbus_model_proxy.eo32
-rw-r--r--src/lib/eldbus/eldbus_model_proxy_private.h23
-rw-r--r--src/lib/eldbus/eldbus_model_signal.c4
-rw-r--r--src/lib/eldbus/eldbus_model_signal.eo4
-rw-r--r--src/lib/eldbus/eldbus_signal_handler.c30
-rw-r--r--src/lib/eldbus/eldbus_types.eot2
-rw-r--r--src/lib/elementary/Efl_Ui.h43
-rw-r--r--src/lib/elementary/Elementary.h70
-rw-r--r--src/lib/elementary/Elementary.hh1
-rw-r--r--src/lib/elementary/efl_access_action.c2
-rw-r--r--src/lib/elementary/efl_access_action.eo2
-rw-r--r--src/lib/elementary/efl_access_component.c57
-rw-r--r--src/lib/elementary/efl_access_component.eo38
-rw-r--r--src/lib/elementary/efl_access_editable_text.eo2
-rw-r--r--src/lib/elementary/efl_access_image.c53
-rw-r--r--src/lib/elementary/efl_access_image.eo39
-rw-r--r--src/lib/elementary/efl_access_object.c (renamed from src/lib/elementary/efl_access.c)309
-rw-r--r--src/lib/elementary/efl_access_object.eo (renamed from src/lib/elementary/efl_access.eo)63
-rw-r--r--src/lib/elementary/efl_access_object.h (renamed from src/lib/elementary/efl_access.h)67
-rw-r--r--src/lib/elementary/efl_access_selection.eo4
-rw-r--r--src/lib/elementary/efl_access_text.eo56
-rw-r--r--src/lib/elementary/efl_access_value.eo2
-rw-r--r--src/lib/elementary/efl_access_widget_action.c8
-rw-r--r--src/lib/elementary/efl_access_widget_action.eo2
-rw-r--r--src/lib/elementary/efl_access_window.eo14
-rw-r--r--src/lib/elementary/efl_access_window.h14
-rw-r--r--src/lib/elementary/efl_config_global.eo2
-rw-r--r--src/lib/elementary/efl_datetime_manager.c193
-rw-r--r--src/lib/elementary/efl_datetime_manager.eo50
-rw-r--r--src/lib/elementary/efl_page_indicator.c58
-rw-r--r--src/lib/elementary/efl_page_indicator.eo18
-rw-r--r--src/lib/elementary/efl_page_indicator.h23
-rw-r--r--src/lib/elementary/efl_page_indicator_icon.c152
-rw-r--r--src/lib/elementary/efl_page_indicator_icon.eo13
-rw-r--r--src/lib/elementary/efl_page_indicator_icon.h19
-rw-r--r--src/lib/elementary/efl_page_transition.c107
-rw-r--r--src/lib/elementary/efl_page_transition.eo17
-rw-r--r--src/lib/elementary/efl_page_transition.h27
-rw-r--r--src/lib/elementary/efl_page_transition_scroll.c606
-rw-r--r--src/lib/elementary/efl_page_transition_scroll.eo22
-rw-r--r--src/lib/elementary/efl_page_transition_scroll.h93
-rw-r--r--src/lib/elementary/efl_selection.c328
-rw-r--r--src/lib/elementary/efl_selection.eo45
-rw-r--r--src/lib/elementary/efl_selection_manager.c5626
-rw-r--r--src/lib/elementary/efl_selection_manager.eo139
-rw-r--r--src/lib/elementary/efl_selection_manager_private.h320
-rw-r--r--src/lib/elementary/efl_selection_types.eot59
-rw-r--r--src/lib/elementary/efl_text_interactive.eo (renamed from src/lib/elementary/efl_ui_text_interactive.eo)10
-rw-r--r--src/lib/elementary/efl_ui.eot19
-rw-r--r--src/lib/elementary/efl_ui_bg.eo2
-rw-r--r--src/lib/elementary/efl_ui_bg_widget.c150
-rw-r--r--src/lib/elementary/efl_ui_bg_widget.eo8
-rw-r--r--src/lib/elementary/efl_ui_bg_widget_legacy.eo14
-rw-r--r--src/lib/elementary/efl_ui_bg_widget_private.h6
-rw-r--r--src/lib/elementary/efl_ui_box.c36
-rw-r--r--src/lib/elementary/efl_ui_box.eo22
-rw-r--r--src/lib/elementary/efl_ui_box_flow.c4
-rw-r--r--src/lib/elementary/efl_ui_box_flow.eo8
-rw-r--r--src/lib/elementary/efl_ui_box_stack.eo4
-rw-r--r--src/lib/elementary/efl_ui_button.c269
-rw-r--r--src/lib/elementary/efl_ui_button.eo11
-rw-r--r--src/lib/elementary/efl_ui_button_legacy.eo15
-rw-r--r--src/lib/elementary/efl_ui_button_legacy_part.eo (renamed from src/lib/elementary/efl_ui_button_part.eo)2
-rw-r--r--src/lib/elementary/efl_ui_button_private.h4
-rw-r--r--src/lib/elementary/efl_ui_calendar.c92
-rw-r--r--src/lib/elementary/efl_ui_calendar.eo16
-rw-r--r--src/lib/elementary/efl_ui_calendar_item.eo2
-rw-r--r--src/lib/elementary/efl_ui_check.c375
-rw-r--r--src/lib/elementary/efl_ui_check.eo10
-rw-r--r--src/lib/elementary/efl_ui_check_legacy.eo18
-rw-r--r--src/lib/elementary/efl_ui_check_legacy_part.eo8
-rw-r--r--src/lib/elementary/efl_ui_check_private.h4
-rw-r--r--src/lib/elementary/efl_ui_clock.c121
-rw-r--r--src/lib/elementary/efl_ui_clock.eo17
-rw-r--r--src/lib/elementary/efl_ui_clock_legacy.eo9
-rw-r--r--src/lib/elementary/efl_ui_clock_private.h4
-rw-r--r--src/lib/elementary/efl_ui_datepicker.c349
-rw-r--r--src/lib/elementary/efl_ui_datepicker.eo75
-rw-r--r--src/lib/elementary/efl_ui_datepicker_private.h22
-rw-r--r--src/lib/elementary/efl_ui_dnd.c838
-rw-r--r--src/lib/elementary/efl_ui_dnd.eo63
-rw-r--r--src/lib/elementary/efl_ui_dnd_container.eo48
-rw-r--r--src/lib/elementary/efl_ui_dnd_types.eot58
-rw-r--r--src/lib/elementary/efl_ui_flip.c97
-rw-r--r--src/lib/elementary/efl_ui_flip.eo43
-rw-r--r--src/lib/elementary/efl_ui_flip_legacy.eo9
-rw-r--r--src/lib/elementary/efl_ui_flip_legacy.h2
-rw-r--r--src/lib/elementary/efl_ui_flip_part.eo2
-rw-r--r--src/lib/elementary/efl_ui_focus_composition.c151
-rw-r--r--src/lib/elementary/efl_ui_focus_composition.eo18
-rw-r--r--src/lib/elementary/efl_ui_focus_composition_adapter.eo17
-rw-r--r--src/lib/elementary/efl_ui_focus_graph.c226
-rw-r--r--src/lib/elementary/efl_ui_focus_graph.h27
-rw-r--r--src/lib/elementary/efl_ui_focus_layer.c78
-rw-r--r--src/lib/elementary/efl_ui_focus_layer.eo11
-rw-r--r--src/lib/elementary/efl_ui_focus_manager.c1
-rw-r--r--src/lib/elementary/efl_ui_focus_manager.eo14
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_calc.c801
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_calc.eo2
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_root_focus.c173
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_root_focus.eo21
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_sub.c47
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_sub.eo5
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_window_root.eo7
-rw-r--r--src/lib/elementary/efl_ui_focus_object.c17
-rw-r--r--src/lib/elementary/efl_ui_focus_object.eo34
-rw-r--r--src/lib/elementary/efl_ui_focus_parent_provider_gen.c78
-rw-r--r--src/lib/elementary/efl_ui_focus_parent_provider_gen.eo13
-rw-r--r--src/lib/elementary/efl_ui_focus_parent_provider_standard.eo2
-rw-r--r--src/lib/elementary/efl_ui_focus_rectangle.eo8
-rw-r--r--src/lib/elementary/efl_ui_focus_user.eo32
-rw-r--r--src/lib/elementary/efl_ui_focus_util.c66
-rw-r--r--src/lib/elementary/efl_ui_focus_util.eo13
-rw-r--r--src/lib/elementary/efl_ui_frame.c119
-rw-r--r--src/lib/elementary/efl_ui_frame.eo5
-rw-r--r--src/lib/elementary/efl_ui_frame_legacy.eo14
-rw-r--r--src/lib/elementary/efl_ui_frame_legacy.h4
-rw-r--r--src/lib/elementary/efl_ui_image.c428
-rw-r--r--src/lib/elementary/efl_ui_image.eo37
-rw-r--r--src/lib/elementary/efl_ui_image_factory.c8
-rw-r--r--src/lib/elementary/efl_ui_image_factory.eo2
-rw-r--r--src/lib/elementary/efl_ui_image_legacy.eo9
-rw-r--r--src/lib/elementary/efl_ui_image_zoomable.c646
-rw-r--r--src/lib/elementary/efl_ui_image_zoomable.eo48
-rw-r--r--src/lib/elementary/efl_ui_image_zoomable_legacy.eo9
-rw-r--r--src/lib/elementary/efl_ui_image_zoomable_pan.eo6
-rw-r--r--src/lib/elementary/efl_ui_image_zoomable_private.h4
-rw-r--r--src/lib/elementary/efl_ui_internal_text_interactive.c14
-rw-r--r--src/lib/elementary/efl_ui_internal_text_interactive.eo8
-rw-r--r--src/lib/elementary/efl_ui_item.c260
-rw-r--r--src/lib/elementary/efl_ui_item.eo30
-rw-r--r--src/lib/elementary/efl_ui_item_private.h37
-rw-r--r--src/lib/elementary/efl_ui_layout_factory.c12
-rw-r--r--src/lib/elementary/efl_ui_layout_legacy.eo8
-rw-r--r--src/lib/elementary/efl_ui_layout_object.c (renamed from src/lib/elementary/efl_ui_layout.c)1281
-rw-r--r--src/lib/elementary/efl_ui_layout_object.eo (renamed from src/lib/elementary/efl_ui_layout.eo)27
-rw-r--r--src/lib/elementary/efl_ui_layout_pack.c175
-rw-r--r--src/lib/elementary/efl_ui_layout_part.eo2
-rw-r--r--src/lib/elementary/efl_ui_layout_part_bg.eo2
-rw-r--r--src/lib/elementary/efl_ui_layout_part_box.eo20
-rw-r--r--src/lib/elementary/efl_ui_layout_part_legacy.eo4
-rw-r--r--src/lib/elementary/efl_ui_layout_part_table.eo18
-rw-r--r--src/lib/elementary/efl_ui_layout_part_text.eo4
-rw-r--r--src/lib/elementary/efl_ui_legacy.c8
-rw-r--r--src/lib/elementary/efl_ui_legacy.eo9
-rw-r--r--src/lib/elementary/efl_ui_list.c1483
-rw-r--r--src/lib/elementary/efl_ui_list.eo158
-rw-r--r--src/lib/elementary/efl_ui_list_default_item.c112
-rw-r--r--src/lib/elementary/efl_ui_list_default_item.eo24
-rw-r--r--src/lib/elementary/efl_ui_list_default_item_part_end.eo9
-rw-r--r--src/lib/elementary/efl_ui_list_default_item_part_icon.eo9
-rw-r--r--src/lib/elementary/efl_ui_list_empty_item.c57
-rw-r--r--src/lib/elementary/efl_ui_list_empty_item.eo16
-rw-r--r--src/lib/elementary/efl_ui_list_item.c83
-rw-r--r--src/lib/elementary/efl_ui_list_item.eo12
-rw-r--r--src/lib/elementary/efl_ui_list_item_private.h31
-rw-r--r--src/lib/elementary/efl_ui_list_precise_layouter.eo8
-rw-r--r--src/lib/elementary/efl_ui_list_private.h173
-rw-r--r--src/lib/elementary/efl_ui_list_relayout.eo23
-rw-r--r--src/lib/elementary/efl_ui_list_segarray.c426
-rw-r--r--src/lib/elementary/efl_ui_list_segarray.h42
-rw-r--r--src/lib/elementary/efl_ui_model_state.eo18
-rw-r--r--src/lib/elementary/efl_ui_multibuttonentry.h68
-rw-r--r--src/lib/elementary/efl_ui_navigation_bar.c226
-rw-r--r--src/lib/elementary/efl_ui_navigation_bar.eo30
-rw-r--r--src/lib/elementary/efl_ui_navigation_bar_part.eo9
-rw-r--r--src/lib/elementary/efl_ui_navigation_bar_part_back_button.eo11
-rw-r--r--src/lib/elementary/efl_ui_navigation_bar_private.h20
-rw-r--r--src/lib/elementary/efl_ui_navigation_layout.c55
-rw-r--r--src/lib/elementary/efl_ui_navigation_layout.eo30
-rw-r--r--src/lib/elementary/efl_ui_navigation_layout_private.h20
-rw-r--r--src/lib/elementary/efl_ui_nstate.c29
-rw-r--r--src/lib/elementary/efl_ui_nstate.eo8
-rw-r--r--src/lib/elementary/efl_ui_nstate_private.h57
-rw-r--r--src/lib/elementary/efl_ui_pager.c811
-rw-r--r--src/lib/elementary/efl_ui_pager.eo101
-rw-r--r--src/lib/elementary/efl_ui_pan.c30
-rw-r--r--src/lib/elementary/efl_ui_pan.eo26
-rw-r--r--src/lib/elementary/efl_ui_panes.c212
-rw-r--r--src/lib/elementary/efl_ui_panes.eo15
-rw-r--r--src/lib/elementary/efl_ui_panes_legacy.eo9
-rw-r--r--src/lib/elementary/efl_ui_panes_part.eo6
-rw-r--r--src/lib/elementary/efl_ui_panes_private.h4
-rw-r--r--src/lib/elementary/efl_ui_popup.c83
-rw-r--r--src/lib/elementary/efl_ui_popup.eo22
-rw-r--r--src/lib/elementary/efl_ui_popup_alert.c26
-rw-r--r--src/lib/elementary/efl_ui_popup_alert.eo12
-rw-r--r--src/lib/elementary/efl_ui_popup_alert_part.eo2
-rw-r--r--src/lib/elementary/efl_ui_popup_alert_scroll.c29
-rw-r--r--src/lib/elementary/efl_ui_popup_alert_scroll.eo2
-rw-r--r--src/lib/elementary/efl_ui_popup_alert_scroll_part.eo2
-rw-r--r--src/lib/elementary/efl_ui_popup_alert_text.c32
-rw-r--r--src/lib/elementary/efl_ui_popup_alert_text.eo2
-rw-r--r--src/lib/elementary/efl_ui_popup_alert_text_part.eo2
-rw-r--r--src/lib/elementary/efl_ui_popup_anchor.c30
-rw-r--r--src/lib/elementary/efl_ui_popup_anchor.eo12
-rw-r--r--src/lib/elementary/efl_ui_popup_part.eo2
-rw-r--r--src/lib/elementary/efl_ui_progressbar.c440
-rw-r--r--src/lib/elementary/efl_ui_progressbar.eo22
-rw-r--r--src/lib/elementary/efl_ui_progressbar_legacy.eo12
-rw-r--r--src/lib/elementary/efl_ui_progressbar_legacy_part.eo8
-rw-r--r--src/lib/elementary/efl_ui_progressbar_part.eo3
-rw-r--r--src/lib/elementary/efl_ui_progressbar_private.h4
-rw-r--r--src/lib/elementary/efl_ui_radio.c202
-rw-r--r--src/lib/elementary/efl_ui_radio.eo11
-rw-r--r--src/lib/elementary/efl_ui_radio_legacy.eo12
-rw-r--r--src/lib/elementary/efl_ui_radio_legacy_part.eo8
-rw-r--r--src/lib/elementary/efl_ui_radio_private.h8
-rw-r--r--src/lib/elementary/efl_ui_scroll_manager.c39
-rw-r--r--src/lib/elementary/efl_ui_scroll_manager.eo38
-rw-r--r--src/lib/elementary/efl_ui_scroller.c122
-rw-r--r--src/lib/elementary/efl_ui_scroller.eo20
-rw-r--r--src/lib/elementary/efl_ui_slider.c1333
-rw-r--r--src/lib/elementary/efl_ui_slider.eo63
-rw-r--r--src/lib/elementary/efl_ui_slider_eo.h1
-rw-r--r--src/lib/elementary/efl_ui_slider_interval.c292
-rw-r--r--src/lib/elementary/efl_ui_slider_interval.eo4
-rw-r--r--src/lib/elementary/efl_ui_slider_interval_private.h29
-rw-r--r--src/lib/elementary/efl_ui_slider_private.h62
-rw-r--r--src/lib/elementary/efl_ui_spin.c86
-rw-r--r--src/lib/elementary/efl_ui_spin.eo35
-rw-r--r--src/lib/elementary/efl_ui_spin_button.c88
-rw-r--r--src/lib/elementary/efl_ui_spin_button.eo12
-rw-r--r--src/lib/elementary/efl_ui_spin_private.h2
-rw-r--r--src/lib/elementary/efl_ui_stack.c972
-rw-r--r--src/lib/elementary/efl_ui_stack.eo131
-rw-r--r--src/lib/elementary/efl_ui_stack_private.h30
-rw-r--r--src/lib/elementary/efl_ui_tab_bar.c392
-rw-r--r--src/lib/elementary/efl_ui_tab_bar.eo42
-rw-r--r--src/lib/elementary/efl_ui_tab_bar_private.h43
-rw-r--r--src/lib/elementary/efl_ui_tab_page.c131
-rw-r--r--src/lib/elementary/efl_ui_tab_page.eo28
-rw-r--r--src/lib/elementary/efl_ui_tab_page_part_tab.eo15
-rw-r--r--src/lib/elementary/efl_ui_tab_page_private.h28
-rw-r--r--src/lib/elementary/efl_ui_tab_pager.c354
-rw-r--r--src/lib/elementary/efl_ui_tab_pager.eo28
-rw-r--r--src/lib/elementary/efl_ui_tab_pager_private.h28
-rw-r--r--src/lib/elementary/efl_ui_table.c37
-rw-r--r--src/lib/elementary/efl_ui_table.eo26
-rw-r--r--src/lib/elementary/efl_ui_table_private.h2
-rw-r--r--src/lib/elementary/efl_ui_table_static.c6
-rw-r--r--src/lib/elementary/efl_ui_table_static.eo2
-rw-r--r--src/lib/elementary/efl_ui_tags.c1177
-rw-r--r--src/lib/elementary/efl_ui_tags.eo59
-rw-r--r--src/lib/elementary/efl_ui_tags_private.h48
-rw-r--r--src/lib/elementary/efl_ui_text.c637
-rw-r--r--src/lib/elementary/efl_ui_text.eo129
-rw-r--r--src/lib/elementary/efl_ui_text_editable.eo2
-rw-r--r--src/lib/elementary/efl_ui_text_factory_emoticons.c35
-rw-r--r--src/lib/elementary/efl_ui_text_factory_emoticons.eo10
-rw-r--r--src/lib/elementary/efl_ui_text_factory_fallback.c62
-rw-r--r--src/lib/elementary/efl_ui_text_factory_fallback.eo16
-rw-r--r--src/lib/elementary/efl_ui_text_factory_images.c147
-rw-r--r--src/lib/elementary/efl_ui_text_factory_images.eo69
-rw-r--r--src/lib/elementary/efl_ui_textpath.c253
-rw-r--r--src/lib/elementary/efl_ui_textpath.eo23
-rw-r--r--src/lib/elementary/efl_ui_textpath_part.eo2
-rw-r--r--src/lib/elementary/efl_ui_timepicker.c285
-rw-r--r--src/lib/elementary/efl_ui_timepicker.eo44
-rw-r--r--src/lib/elementary/efl_ui_timepicker_private.h21
-rw-r--r--src/lib/elementary/efl_ui_video.c194
-rw-r--r--src/lib/elementary/efl_ui_video.eo27
-rw-r--r--src/lib/elementary/efl_ui_video_legacy.eo9
-rw-r--r--src/lib/elementary/efl_ui_video_legacy.h34
-rw-r--r--src/lib/elementary/efl_ui_video_private.h4
-rw-r--r--src/lib/elementary/efl_ui_view_list.c1035
-rw-r--r--src/lib/elementary/efl_ui_view_list.eo105
-rw-r--r--src/lib/elementary/efl_ui_view_list_model.eo (renamed from src/lib/elementary/efl_ui_list_model.eo)12
-rw-r--r--src/lib/elementary/efl_ui_view_list_pan.eo (renamed from src/lib/elementary/efl_ui_list_pan.eo)10
-rw-r--r--src/lib/elementary/efl_ui_view_list_precise_layouter.c (renamed from src/lib/elementary/efl_ui_list_precise_layouter.c)375
-rw-r--r--src/lib/elementary/efl_ui_view_list_precise_layouter.eo9
-rw-r--r--src/lib/elementary/efl_ui_view_list_private.h102
-rw-r--r--src/lib/elementary/efl_ui_view_list_relayout.eo25
-rw-r--r--src/lib/elementary/efl_ui_view_list_segarray.c470
-rw-r--r--src/lib/elementary/efl_ui_view_list_segarray.eo61
-rw-r--r--src/lib/elementary/efl_ui_view_list_segarray.h28
-rw-r--r--src/lib/elementary/efl_ui_view_list_types.eot (renamed from src/lib/elementary/efl_ui_list_types.eot)6
-rw-r--r--src/lib/elementary/efl_ui_widget.c (renamed from src/lib/elementary/elm_widget.c)887
-rw-r--r--src/lib/elementary/efl_ui_widget.eo (renamed from src/lib/elementary/elm_widget.eo)131
-rw-r--r--src/lib/elementary/efl_ui_widget_flip.h4
-rw-r--r--src/lib/elementary/efl_ui_widget_focus_manager.c60
-rw-r--r--src/lib/elementary/efl_ui_widget_focus_manager.eo22
-rw-r--r--src/lib/elementary/efl_ui_widget_frame.h4
-rw-r--r--src/lib/elementary/efl_ui_widget_image.h19
-rw-r--r--src/lib/elementary/efl_ui_widget_pager.h69
-rw-r--r--src/lib/elementary/efl_ui_widget_part.eo4
-rw-r--r--src/lib/elementary/efl_ui_widget_part_bg.eo4
-rw-r--r--src/lib/elementary/efl_ui_widget_part_shadow.eo2
-rw-r--r--src/lib/elementary/efl_ui_win.c1351
-rw-r--r--src/lib/elementary/efl_ui_win.eo165
-rw-r--r--src/lib/elementary/efl_ui_win_inlined.c22
-rw-r--r--src/lib/elementary/efl_ui_win_inlined_legacy.eo9
-rw-r--r--src/lib/elementary/efl_ui_win_legacy.eo9
-rw-r--r--src/lib/elementary/efl_ui_win_part.eo2
-rw-r--r--src/lib/elementary/efl_ui_win_socket.c20
-rw-r--r--src/lib/elementary/efl_ui_win_socket_legacy.eo9
-rw-r--r--src/lib/elementary/elc_combobox.c22
-rw-r--r--src/lib/elementary/elc_ctxpopup.c144
-rw-r--r--src/lib/elementary/elc_ctxpopup_legacy.h77
-rw-r--r--src/lib/elementary/elc_fileselector.c1237
-rw-r--r--src/lib/elementary/elc_fileselector_button.c178
-rw-r--r--src/lib/elementary/elc_fileselector_entry.c131
-rw-r--r--src/lib/elementary/elc_hoversel.c64
-rw-r--r--src/lib/elementary/elc_multibuttonentry.c (renamed from src/lib/elementary/efl_ui_multibuttonentry.c)525
-rw-r--r--src/lib/elementary/elc_multibuttonentry.h2
-rw-r--r--src/lib/elementary/elc_multibuttonentry_common.h2
-rw-r--r--src/lib/elementary/elc_multibuttonentry_eo.h (renamed from src/lib/elementary/efl_ui_multibuttonentry_eo.h)2
-rw-r--r--src/lib/elementary/elc_multibuttonentry_legacy.h6
-rw-r--r--src/lib/elementary/elc_naviframe.c91
-rw-r--r--src/lib/elementary/elc_naviframe_legacy.h21
-rw-r--r--src/lib/elementary/elc_player.c13
-rw-r--r--src/lib/elementary/elc_popup.c91
-rw-r--r--src/lib/elementary/elementary_config.h7
-rw-r--r--src/lib/elementary/elm_access.c18
-rw-r--r--src/lib/elementary/elm_access.eo8
-rw-r--r--src/lib/elementary/elm_actionslider.c15
-rw-r--r--src/lib/elementary/elm_actionslider.eo8
-rw-r--r--src/lib/elementary/elm_atspi_app_object.c16
-rw-r--r--src/lib/elementary/elm_atspi_app_object.eo10
-rw-r--r--src/lib/elementary/elm_atspi_bridge.c345
-rw-r--r--src/lib/elementary/elm_atspi_bridge.eo4
-rw-r--r--src/lib/elementary/elm_bg_legacy.h18
-rw-r--r--src/lib/elementary/elm_box.c26
-rw-r--r--src/lib/elementary/elm_box.eo12
-rw-r--r--src/lib/elementary/elm_bubble.c9
-rw-r--r--src/lib/elementary/elm_bubble.eo6
-rw-r--r--src/lib/elementary/elm_button_legacy.h2
-rw-r--r--src/lib/elementary/elm_calendar.c96
-rw-r--r--src/lib/elementary/elm_calendar.eo15
-rw-r--r--src/lib/elementary/elm_check_legacy.h8
-rw-r--r--src/lib/elementary/elm_clock.c79
-rw-r--r--src/lib/elementary/elm_clock.eo8
-rw-r--r--src/lib/elementary/elm_cnp.c5851
-rw-r--r--src/lib/elementary/elm_cnp.h62
-rw-r--r--src/lib/elementary/elm_code.c1
-rw-r--r--src/lib/elementary/elm_code_common.h1
-rw-r--r--src/lib/elementary/elm_code_diff_widget.c5
-rw-r--r--src/lib/elementary/elm_code_indent.c25
-rw-r--r--src/lib/elementary/elm_code_parse.c4
-rw-r--r--src/lib/elementary/elm_code_syntax.c2
-rw-r--r--src/lib/elementary/elm_code_widget.c88
-rw-r--r--src/lib/elementary/elm_code_widget.eo72
-rw-r--r--src/lib/elementary/elm_code_widget_legacy.eo5
-rw-r--r--src/lib/elementary/elm_code_widget_private.h2
-rw-r--r--src/lib/elementary/elm_code_widget_selection.c25
-rw-r--r--src/lib/elementary/elm_code_widget_text.c4
-rw-r--r--src/lib/elementary/elm_color_item.eo6
-rw-r--r--src/lib/elementary/elm_colorselector.c88
-rw-r--r--src/lib/elementary/elm_colorselector.eo26
-rw-r--r--src/lib/elementary/elm_combobox.eo22
-rw-r--r--src/lib/elementary/elm_config.c238
-rw-r--r--src/lib/elementary/elm_config.h19
-rw-r--r--src/lib/elementary/elm_conform.c10
-rw-r--r--src/lib/elementary/elm_conformant.eo14
-rw-r--r--src/lib/elementary/elm_ctxpopup.eo56
-rw-r--r--src/lib/elementary/elm_ctxpopup_item.eo58
-rw-r--r--src/lib/elementary/elm_datetime.c80
-rw-r--r--src/lib/elementary/elm_datetime.h2
-rw-r--r--src/lib/elementary/elm_dayselector.c76
-rw-r--r--src/lib/elementary/elm_dayselector.eo8
-rw-r--r--src/lib/elementary/elm_dbus_menu.c16
-rw-r--r--src/lib/elementary/elm_diskselector.c56
-rw-r--r--src/lib/elementary/elm_diskselector.eo18
-rw-r--r--src/lib/elementary/elm_diskselector_item.eo2
-rw-r--r--src/lib/elementary/elm_entry.c294
-rw-r--r--src/lib/elementary/elm_entry.eo116
-rw-r--r--src/lib/elementary/elm_entry.h1
-rw-r--r--src/lib/elementary/elm_entry_legacy.h12
-rw-r--r--src/lib/elementary/elm_fileselector.eo27
-rw-r--r--src/lib/elementary/elm_fileselector_button.eo13
-rw-r--r--src/lib/elementary/elm_fileselector_entry.eo24
-rw-r--r--src/lib/elementary/elm_flipselector.c30
-rw-r--r--src/lib/elementary/elm_flipselector.eo12
-rw-r--r--src/lib/elementary/elm_focus_legacy.c342
-rw-r--r--src/lib/elementary/elm_gen_common.h3
-rw-r--r--src/lib/elementary/elm_general.eot158
-rw-r--r--src/lib/elementary/elm_general.h2
-rw-r--r--src/lib/elementary/elm_gengrid.c277
-rw-r--r--src/lib/elementary/elm_gengrid.eo103
-rw-r--r--src/lib/elementary/elm_gengrid_item.eo35
-rw-r--r--src/lib/elementary/elm_gengrid_legacy.h64
-rw-r--r--src/lib/elementary/elm_gengrid_pan.eo4
-rw-r--r--src/lib/elementary/elm_genlist.c468
-rw-r--r--src/lib/elementary/elm_genlist.eo107
-rw-r--r--src/lib/elementary/elm_genlist_item.eo68
-rw-r--r--src/lib/elementary/elm_genlist_pan.eo6
-rw-r--r--src/lib/elementary/elm_gesture_layer.c46
-rw-r--r--src/lib/elementary/elm_gesture_layer.eo4
-rw-r--r--src/lib/elementary/elm_glview.c39
-rw-r--r--src/lib/elementary/elm_glview.eo18
-rw-r--r--src/lib/elementary/elm_grid.c23
-rw-r--r--src/lib/elementary/elm_grid.eo8
-rw-r--r--src/lib/elementary/elm_hover.c52
-rw-r--r--src/lib/elementary/elm_hover.eo25
-rw-r--r--src/lib/elementary/elm_hoversel.eo23
-rw-r--r--src/lib/elementary/elm_hoversel_item.eo4
-rw-r--r--src/lib/elementary/elm_icon.c6
-rw-r--r--src/lib/elementary/elm_icon.eo8
-rw-r--r--src/lib/elementary/elm_image_legacy.h4
-rw-r--r--src/lib/elementary/elm_index.c50
-rw-r--r--src/lib/elementary/elm_index.eo22
-rw-r--r--src/lib/elementary/elm_index_item.eo4
-rw-r--r--src/lib/elementary/elm_interface_fileselector.c4
-rw-r--r--src/lib/elementary/elm_interface_fileselector.eo34
-rw-r--r--src/lib/elementary/elm_interface_scrollable.c445
-rw-r--r--src/lib/elementary/elm_interface_scrollable.eo51
-rw-r--r--src/lib/elementary/elm_interfaces.h6
-rw-r--r--src/lib/elementary/elm_inwin.c38
-rw-r--r--src/lib/elementary/elm_inwin.eo4
-rw-r--r--src/lib/elementary/elm_label.c32
-rw-r--r--src/lib/elementary/elm_label.eo8
-rw-r--r--src/lib/elementary/elm_layout.h2
-rw-r--r--src/lib/elementary/elm_layout_legacy.h4
-rw-r--r--src/lib/elementary/elm_list.c521
-rw-r--r--src/lib/elementary/elm_list.eo88
-rw-r--r--src/lib/elementary/elm_list_item.eo10
-rw-r--r--src/lib/elementary/elm_main.c397
-rw-r--r--src/lib/elementary/elm_map.c198
-rw-r--r--src/lib/elementary/elm_map.eo166
-rw-r--r--src/lib/elementary/elm_map_legacy.h131
-rw-r--r--src/lib/elementary/elm_map_pan.eo6
-rw-r--r--src/lib/elementary/elm_mapbuf.c37
-rw-r--r--src/lib/elementary/elm_mapbuf.eo14
-rw-r--r--src/lib/elementary/elm_mapbuf_part.eo2
-rw-r--r--src/lib/elementary/elm_menu.c189
-rw-r--r--src/lib/elementary/elm_menu.eo58
-rw-r--r--src/lib/elementary/elm_menu_item.eo100
-rw-r--r--src/lib/elementary/elm_menu_legacy.h57
-rw-r--r--src/lib/elementary/elm_module.c7
-rw-r--r--src/lib/elementary/elm_module_helper.h6
-rw-r--r--src/lib/elementary/elm_multibuttonentry.eo (renamed from src/lib/elementary/efl_ui_multibuttonentry.eo)56
-rw-r--r--src/lib/elementary/elm_multibuttonentry_item.eo7
-rw-r--r--src/lib/elementary/elm_multibuttonentry_part.eo (renamed from src/lib/elementary/efl_ui_multibuttonentry_part.eo)2
-rw-r--r--src/lib/elementary/elm_naviframe.eo22
-rw-r--r--src/lib/elementary/elm_naviframe_item.eo16
-rw-r--r--src/lib/elementary/elm_notify.c52
-rw-r--r--src/lib/elementary/elm_notify.eo22
-rw-r--r--src/lib/elementary/elm_notify_part.eo2
-rw-r--r--src/lib/elementary/elm_object_item.h6
-rw-r--r--src/lib/elementary/elm_pan.eo16
-rw-r--r--src/lib/elementary/elm_panel.c109
-rw-r--r--src/lib/elementary/elm_panel.eo22
-rw-r--r--src/lib/elementary/elm_panel_part.eo2
-rw-r--r--src/lib/elementary/elm_panes_legacy.h26
-rw-r--r--src/lib/elementary/elm_part_helper.h147
-rw-r--r--src/lib/elementary/elm_photo.c14
-rw-r--r--src/lib/elementary/elm_photo.eo5
-rw-r--r--src/lib/elementary/elm_photocam_legacy.h2
-rw-r--r--src/lib/elementary/elm_player.eo30
-rw-r--r--src/lib/elementary/elm_plug.c12
-rw-r--r--src/lib/elementary/elm_plug.eo10
-rw-r--r--src/lib/elementary/elm_popup.eo28
-rw-r--r--src/lib/elementary/elm_popup_item.eo2
-rw-r--r--src/lib/elementary/elm_prefs.c10
-rw-r--r--src/lib/elementary/elm_prefs.eo16
-rw-r--r--src/lib/elementary/elm_priv.h68
-rw-r--r--src/lib/elementary/elm_progressbar_legacy.h4
-rw-r--r--src/lib/elementary/elm_radio_legacy.h2
-rw-r--r--src/lib/elementary/elm_route.c6
-rw-r--r--src/lib/elementary/elm_route.eo4
-rw-r--r--src/lib/elementary/elm_scroller.c77
-rw-r--r--src/lib/elementary/elm_scroller.eo50
-rw-r--r--src/lib/elementary/elm_segment_control.c30
-rw-r--r--src/lib/elementary/elm_segment_control.eo10
-rw-r--r--src/lib/elementary/elm_segment_control_item.eo2
-rw-r--r--src/lib/elementary/elm_separator.c8
-rw-r--r--src/lib/elementary/elm_separator.eo4
-rw-r--r--src/lib/elementary/elm_slider.c1493
-rw-r--r--src/lib/elementary/elm_slider.eo26
-rw-r--r--src/lib/elementary/elm_slider.h5
-rw-r--r--src/lib/elementary/elm_slider_legacy.h32
-rw-r--r--src/lib/elementary/elm_slider_part_indicator.eo (renamed from src/lib/elementary/efl_ui_slider_part_indicator.eo)4
-rw-r--r--src/lib/elementary/elm_slideshow.c40
-rw-r--r--src/lib/elementary/elm_slideshow.eo12
-rw-r--r--src/lib/elementary/elm_spinner.c88
-rw-r--r--src/lib/elementary/elm_spinner.eo27
-rw-r--r--src/lib/elementary/elm_sys_notify.c4
-rw-r--r--src/lib/elementary/elm_systray.c16
-rw-r--r--src/lib/elementary/elm_table.c25
-rw-r--r--src/lib/elementary/elm_table.eo6
-rw-r--r--src/lib/elementary/elm_theme.c302
-rw-r--r--src/lib/elementary/elm_thumb.c14
-rw-r--r--src/lib/elementary/elm_thumb.eo16
-rw-r--r--src/lib/elementary/elm_toolbar.c236
-rw-r--r--src/lib/elementary/elm_toolbar.eo72
-rw-r--r--src/lib/elementary/elm_toolbar_item.eo79
-rw-r--r--src/lib/elementary/elm_toolbar_legacy.h86
-rw-r--r--src/lib/elementary/elm_transit.c2
-rw-r--r--src/lib/elementary/elm_view_form.c263
-rw-r--r--src/lib/elementary/elm_view_form.eo1
-rw-r--r--src/lib/elementary/elm_view_list.c312
-rw-r--r--src/lib/elementary/elm_view_list.eo29
-rw-r--r--src/lib/elementary/elm_web.eo65
-rw-r--r--src/lib/elementary/elm_web2.c77
-rw-r--r--src/lib/elementary/elm_web_legacy.h81
-rw-r--r--src/lib/elementary/elm_widget.h66
-rw-r--r--src/lib/elementary/elm_widget_actionslider.h4
-rw-r--r--src/lib/elementary/elm_widget_bg.h4
-rw-r--r--src/lib/elementary/elm_widget_box.h4
-rw-r--r--src/lib/elementary/elm_widget_bubble.h4
-rw-r--r--src/lib/elementary/elm_widget_clipper.h4
-rw-r--r--src/lib/elementary/elm_widget_clock.h4
-rw-r--r--src/lib/elementary/elm_widget_colorselector.h4
-rw-r--r--src/lib/elementary/elm_widget_combobox.h4
-rw-r--r--src/lib/elementary/elm_widget_conform.h4
-rw-r--r--src/lib/elementary/elm_widget_ctxpopup.h4
-rw-r--r--src/lib/elementary/elm_widget_dayselector.h4
-rw-r--r--src/lib/elementary/elm_widget_diskselector.h4
-rw-r--r--src/lib/elementary/elm_widget_entry.h4
-rw-r--r--src/lib/elementary/elm_widget_fileselector.h13
-rw-r--r--src/lib/elementary/elm_widget_fileselector_button.h4
-rw-r--r--src/lib/elementary/elm_widget_fileselector_entry.h4
-rw-r--r--src/lib/elementary/elm_widget_flipselector.h4
-rw-r--r--src/lib/elementary/elm_widget_gengrid.h5
-rw-r--r--src/lib/elementary/elm_widget_genlist.h19
-rw-r--r--src/lib/elementary/elm_widget_glview.h4
-rw-r--r--src/lib/elementary/elm_widget_hover.h6
-rw-r--r--src/lib/elementary/elm_widget_hoversel.h4
-rw-r--r--src/lib/elementary/elm_widget_icon.h4
-rw-r--r--src/lib/elementary/elm_widget_index.h4
-rw-r--r--src/lib/elementary/elm_widget_inwin.h4
-rw-r--r--src/lib/elementary/elm_widget_item.eo21
-rw-r--r--src/lib/elementary/elm_widget_item_static_focus.c136
-rw-r--r--src/lib/elementary/elm_widget_item_static_focus.eo4
-rw-r--r--src/lib/elementary/elm_widget_label.h4
-rw-r--r--src/lib/elementary/elm_widget_layout.h20
-rw-r--r--src/lib/elementary/elm_widget_list.h7
-rw-r--r--src/lib/elementary/elm_widget_map.h6
-rw-r--r--src/lib/elementary/elm_widget_mapbuf.h4
-rw-r--r--src/lib/elementary/elm_widget_menu.h4
-rw-r--r--src/lib/elementary/elm_widget_multibuttonentry.h (renamed from src/lib/elementary/efl_ui_multibuttonentry_private.h)27
-rw-r--r--src/lib/elementary/elm_widget_naviframe.h5
-rw-r--r--src/lib/elementary/elm_widget_notify.h4
-rw-r--r--src/lib/elementary/elm_widget_panel.h5
-rw-r--r--src/lib/elementary/elm_widget_photo.h4
-rw-r--r--src/lib/elementary/elm_widget_player.h4
-rw-r--r--src/lib/elementary/elm_widget_plug.h4
-rw-r--r--src/lib/elementary/elm_widget_popup.h4
-rw-r--r--src/lib/elementary/elm_widget_prefs.h4
-rw-r--r--src/lib/elementary/elm_widget_route.h4
-rw-r--r--src/lib/elementary/elm_widget_scroller.h4
-rw-r--r--src/lib/elementary/elm_widget_segment_control.h4
-rw-r--r--src/lib/elementary/elm_widget_separator.h4
-rw-r--r--src/lib/elementary/elm_widget_slider.h73
-rw-r--r--src/lib/elementary/elm_widget_slideshow.h4
-rw-r--r--src/lib/elementary/elm_widget_spinner.h4
-rw-r--r--src/lib/elementary/elm_widget_thumb.h4
-rw-r--r--src/lib/elementary/elm_widget_toolbar.h4
-rw-r--r--src/lib/elementary/elm_widget_web.h4
-rw-r--r--src/lib/elementary/elm_win_legacy.h7
-rw-r--r--src/lib/elementary/els_cursor.c122
-rw-r--r--src/lib/elementary/els_tooltip.c57
-rw-r--r--src/lib/elocation/Elocation.h11
-rw-r--r--src/lib/elput/Elput.h29
-rw-r--r--src/lib/elput/elput.c5
-rw-r--r--src/lib/elput/elput_evdev.c10
-rw-r--r--src/lib/elput/elput_input.c6
-rw-r--r--src/lib/elput/elput_logind.c19
-rw-r--r--src/lib/elua/Elua.h8
-rw-r--r--src/lib/elua/elua.c42
-rw-r--r--src/lib/elua/elua_private.h1
-rw-r--r--src/lib/embryo/Embryo.h8
-rw-r--r--src/lib/emile/Emile.h2
-rw-r--r--src/lib/emile/emile_image.c2
-rw-r--r--src/lib/emile/emile_main.c5
-rw-r--r--src/lib/emotion/Emotion.h8
-rw-r--r--src/lib/emotion/efl_canvas_video.eo50
-rw-r--r--src/lib/emotion/emotion_modules.c5
-rw-r--r--src/lib/emotion/emotion_modules.h11
-rw-r--r--src/lib/emotion/emotion_smart.c76
-rw-r--r--src/lib/eo/Eo.h229
-rw-r--r--src/lib/eo/efl_future.c60
-rw-r--r--src/lib/eo/efl_future.h142
-rw-r--r--src/lib/eo/efl_object.eo46
-rw-r--r--src/lib/eo/efl_object_override.eo2
-rw-r--r--src/lib/eo/eina_types.eot26
-rw-r--r--src/lib/eo/eo.c274
-rw-r--r--src/lib/eo/eo_add_fallback.c39
-rw-r--r--src/lib/eo/eo_base_class.c453
-rw-r--r--src/lib/eo/eo_internal.h41
-rw-r--r--src/lib/eo/eo_private.h49
-rw-r--r--src/lib/eo/eo_ptr_indirection.x81
-rw-r--r--src/lib/eolian/Eolian.h1457
-rw-r--r--src/lib/eolian/database_check.c299
-rw-r--r--src/lib/eolian/database_class.c11
-rw-r--r--src/lib/eolian/database_class_api.c66
-rw-r--r--src/lib/eolian/database_constructor.c4
-rw-r--r--src/lib/eolian/database_constructor_api.c11
-rw-r--r--src/lib/eolian/database_event.c3
-rw-r--r--src/lib/eolian/database_event_api.c17
-rw-r--r--src/lib/eolian/database_expr.c165
-rw-r--r--src/lib/eolian/database_expr_api.c87
-rw-r--r--src/lib/eolian/database_function.c6
-rw-r--r--src/lib/eolian/database_function_api.c11
-rw-r--r--src/lib/eolian/database_function_parameter.c4
-rw-r--r--src/lib/eolian/database_function_parameter_api.c7
-rw-r--r--src/lib/eolian/database_implement.c4
-rw-r--r--src/lib/eolian/database_implement_api.c7
-rw-r--r--src/lib/eolian/database_part.c5
-rw-r--r--src/lib/eolian/database_part_api.c7
-rw-r--r--src/lib/eolian/database_type.c184
-rw-r--r--src/lib/eolian/database_type_api.c198
-rw-r--r--src/lib/eolian/database_validate.c637
-rw-r--r--src/lib/eolian/database_var.c35
-rw-r--r--src/lib/eolian/database_var_api.c84
-rw-r--r--src/lib/eolian/eo_lexer.c218
-rw-r--r--src/lib/eolian/eo_lexer.h120
-rw-r--r--src/lib/eolian/eo_parser.c981
-rw-r--r--src/lib/eolian/eo_parser.h2
-rw-r--r--src/lib/eolian/eolian_database.c948
-rw-r--r--src/lib/eolian/eolian_database.h188
-rw-r--r--src/lib/eolian/eolian_priv.h35
-rw-r--r--src/lib/eolian_cxx/Eolian_Cxx.hh6
-rw-r--r--src/lib/eolian_cxx/grammar/blacklist.hpp54
-rw-r--r--src/lib/eolian_cxx/grammar/class_definition.hpp8
-rw-r--r--src/lib/eolian_cxx/grammar/converting_argument.hpp4
-rw-r--r--src/lib/eolian_cxx/grammar/function_declaration.hpp4
-rw-r--r--src/lib/eolian_cxx/grammar/function_definition.hpp4
-rw-r--r--src/lib/eolian_cxx/grammar/implementation_include_directive.hpp2
-rw-r--r--src/lib/eolian_cxx/grammar/klass_def.hpp145
-rw-r--r--src/lib/eolian_cxx/grammar/parameter.hpp5
-rw-r--r--src/lib/eolian_cxx/grammar/part_implementation.hpp5
-rw-r--r--src/lib/eolian_cxx/grammar/type_impl.hpp12
-rw-r--r--src/lib/ephysics/EPhysics.h8
-rw-r--r--src/lib/ethumb/Ethumb.h8
-rw-r--r--src/lib/ethumb/Ethumb_Plugin.h8
-rw-r--r--src/lib/ethumb/ethumb.c6
-rw-r--r--src/lib/ethumb/ethumb_private.h11
-rw-r--r--src/lib/ethumb_client/Ethumb_Client.h8
-rw-r--r--src/lib/evas/Evas.h8
-rw-r--r--src/lib/evas/Evas_Common.h61
-rw-r--r--src/lib/evas/Evas_Eo.h195
-rw-r--r--src/lib/evas/Evas_GL.h8
-rw-r--r--src/lib/evas/Evas_Internal.h88
-rw-r--r--src/lib/evas/Evas_Legacy.h229
-rw-r--r--src/lib/evas/Evas_Loader.h28
-rw-r--r--src/lib/evas/cache/evas_cache_image.c36
-rw-r--r--src/lib/evas/cache/evas_preload.c2
-rw-r--r--src/lib/evas/canvas/efl_animation.c183
-rw-r--r--src/lib/evas/canvas/efl_animation_alpha.c71
-rw-r--r--src/lib/evas/canvas/efl_animation_alpha_private.h21
-rw-r--r--src/lib/evas/canvas/efl_animation_group.c135
-rw-r--r--src/lib/evas/canvas/efl_animation_group.eo33
-rw-r--r--src/lib/evas/canvas/efl_animation_group_parallel.c98
-rw-r--r--src/lib/evas/canvas/efl_animation_group_parallel.eo15
-rw-r--r--src/lib/evas/canvas/efl_animation_group_parallel_private.h14
-rw-r--r--src/lib/evas/canvas/efl_animation_group_private.h15
-rw-r--r--src/lib/evas/canvas/efl_animation_group_sequential.c94
-rw-r--r--src/lib/evas/canvas/efl_animation_group_sequential.eo15
-rw-r--r--src/lib/evas/canvas/efl_animation_group_sequential_private.h14
-rw-r--r--src/lib/evas/canvas/efl_animation_object.c585
-rw-r--r--src/lib/evas/canvas/efl_animation_object.eo46
-rw-r--r--src/lib/evas/canvas/efl_animation_object_alpha.c84
-rw-r--r--src/lib/evas/canvas/efl_animation_object_alpha.eo11
-rw-r--r--src/lib/evas/canvas/efl_animation_object_alpha_private.h24
-rw-r--r--src/lib/evas/canvas/efl_animation_object_group.c200
-rw-r--r--src/lib/evas/canvas/efl_animation_object_group.eo11
-rw-r--r--src/lib/evas/canvas/efl_animation_object_group_parallel.c256
-rw-r--r--src/lib/evas/canvas/efl_animation_object_group_parallel.eo12
-rw-r--r--src/lib/evas/canvas/efl_animation_object_group_parallel_private.h23
-rw-r--r--src/lib/evas/canvas/efl_animation_object_group_private.h15
-rw-r--r--src/lib/evas/canvas/efl_animation_object_group_sequential.c269
-rw-r--r--src/lib/evas/canvas/efl_animation_object_group_sequential.eo12
-rw-r--r--src/lib/evas/canvas/efl_animation_object_group_sequential_private.h23
-rw-r--r--src/lib/evas/canvas/efl_animation_object_private.h56
-rw-r--r--src/lib/evas/canvas/efl_animation_object_rotate.c243
-rw-r--r--src/lib/evas/canvas/efl_animation_object_rotate.eo11
-rw-r--r--src/lib/evas/canvas/efl_animation_object_rotate_private.h37
-rw-r--r--src/lib/evas/canvas/efl_animation_object_scale.c272
-rw-r--r--src/lib/evas/canvas/efl_animation_object_scale.eo11
-rw-r--r--src/lib/evas/canvas/efl_animation_object_scale_private.h37
-rw-r--r--src/lib/evas/canvas/efl_animation_object_translate.c240
-rw-r--r--src/lib/evas/canvas/efl_animation_object_translate.eo11
-rw-r--r--src/lib/evas/canvas/efl_animation_object_translate_private.h25
-rw-r--r--src/lib/evas/canvas/efl_animation_private.h26
-rw-r--r--src/lib/evas/canvas/efl_animation_rotate.c240
-rw-r--r--src/lib/evas/canvas/efl_animation_rotate_private.h37
-rw-r--r--src/lib/evas/canvas/efl_animation_scale.c264
-rw-r--r--src/lib/evas/canvas/efl_animation_scale_private.h37
-rw-r--r--src/lib/evas/canvas/efl_animation_translate.c207
-rw-r--r--src/lib/evas/canvas/efl_animation_translate_private.h24
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation.c138
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation.eo (renamed from src/lib/evas/canvas/efl_animation.eo)46
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_alpha.c64
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_alpha.eo (renamed from src/lib/evas/canvas/efl_animation_alpha.eo)9
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_alpha_private.h19
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_group.c127
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_group.eo31
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_group_parallel.c77
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_group_parallel.eo12
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_group_parallel_private.h5
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_group_private.h15
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_group_sequential.c81
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_group_sequential.eo11
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_group_sequential_private.h5
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_player.c386
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_player.eo56
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_player_private.h52
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_private.h28
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_rotate.c164
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_rotate.eo (renamed from src/lib/evas/canvas/efl_animation_rotate.eo)9
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_rotate_private.h35
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_scale.c204
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_scale.eo (renamed from src/lib/evas/canvas/efl_animation_scale.eo)9
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_scale_private.h35
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_translate.c162
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_translate.eo (renamed from src/lib/evas/canvas/efl_animation_translate.eo)9
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_translate_private.h22
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_types.eot (renamed from src/lib/evas/canvas/efl_animation_types.eot)4
-rw-r--r--src/lib/evas/canvas/efl_canvas_event_grabber.c (renamed from src/lib/evas/canvas/efl_canvas_object_event_grabber.c)76
-rw-r--r--src/lib/evas/canvas/efl_canvas_event_grabber.eo (renamed from src/lib/evas/canvas/efl_canvas_object_event_grabber.eo)8
-rw-r--r--src/lib/evas/canvas/efl_canvas_filter_internal.eo7
-rw-r--r--src/lib/evas/canvas/efl_canvas_group.eo4
-rw-r--r--src/lib/evas/canvas/efl_canvas_image.c68
-rw-r--r--src/lib/evas/canvas/efl_canvas_image.eo34
-rw-r--r--src/lib/evas/canvas/efl_canvas_image_internal.eo25
-rw-r--r--src/lib/evas/canvas/efl_canvas_object.eo56
-rw-r--r--src/lib/evas/canvas/efl_canvas_proxy.c6
-rw-r--r--src/lib/evas/canvas/efl_canvas_proxy.eo2
-rw-r--r--src/lib/evas/canvas/efl_canvas_scene3d.c2
-rw-r--r--src/lib/evas/canvas/efl_canvas_scene3d.eo2
-rw-r--r--src/lib/evas/canvas/efl_canvas_snapshot.eo2
-rw-r--r--src/lib/evas/canvas/efl_canvas_surface.c2
-rw-r--r--src/lib/evas/canvas/efl_canvas_surface.eo2
-rw-r--r--src/lib/evas/canvas/efl_canvas_surface_tbm.eo2
-rw-r--r--src/lib/evas/canvas/efl_canvas_surface_wayland.eo2
-rw-r--r--src/lib/evas/canvas/efl_canvas_surface_x11.c2
-rw-r--r--src/lib/evas/canvas/efl_canvas_surface_x11.eo4
-rw-r--r--src/lib/evas/canvas/efl_canvas_text.eo191
-rw-r--r--src/lib/evas/canvas/efl_canvas_text_factory.eo25
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_container.eo (renamed from src/lib/evas/canvas/efl_vg_container.eo)14
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_gradient.eo (renamed from src/lib/evas/canvas/efl_vg_gradient.eo)4
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_gradient_linear.eo14
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_gradient_radial.eo15
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_node.eo (renamed from src/lib/evas/canvas/efl_vg.eo)60
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_object.c (renamed from src/lib/evas/canvas/efl_canvas_vg.c)125
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_object.eo (renamed from src/lib/evas/canvas/efl_canvas_vg.eo)8
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_shape.eo43
-rw-r--r--src/lib/evas/canvas/efl_gfx_map.c56
-rw-r--r--src/lib/evas/canvas/efl_gfx_map.eo12
-rw-r--r--src/lib/evas/canvas/efl_input_event.c75
-rw-r--r--src/lib/evas/canvas/efl_input_focus.c62
-rw-r--r--src/lib/evas/canvas/efl_input_hold.c21
-rw-r--r--src/lib/evas/canvas/efl_input_hold.eo1
-rw-r--r--src/lib/evas/canvas/efl_input_interface.eo2
-rw-r--r--src/lib/evas/canvas/efl_input_key.c71
-rw-r--r--src/lib/evas/canvas/efl_input_key.eo2
-rw-r--r--src/lib/evas/canvas/efl_input_pointer.c111
-rw-r--r--src/lib/evas/canvas/efl_input_pointer.eo3
-rw-r--r--src/lib/evas/canvas/efl_vg_gradient_linear.eo14
-rw-r--r--src/lib/evas/canvas/efl_vg_gradient_radial.eo15
-rw-r--r--src/lib/evas/canvas/efl_vg_shape.eo44
-rw-r--r--src/lib/evas/canvas/evas_async_events.c10
-rw-r--r--src/lib/evas/canvas/evas_box.eo8
-rw-r--r--src/lib/evas/canvas/evas_callbacks.c131
-rw-r--r--src/lib/evas/canvas/evas_canvas.eo161
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_light.c8
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_material.c6
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_mesh.c24
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_mesh.eo1
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_node.c59
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_node.eo24
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_object.eo5
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_primitive.c10
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_scene.c6
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_texture.c6
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_types.eot1
-rw-r--r--src/lib/evas/canvas/evas_clip.c23
-rw-r--r--src/lib/evas/canvas/evas_device.c36
-rw-r--r--src/lib/evas/canvas/evas_events.c62
-rw-r--r--src/lib/evas/canvas/evas_filter_mixin.c16
-rw-r--r--src/lib/evas/canvas/evas_focus.c59
-rw-r--r--src/lib/evas/canvas/evas_font_dir.c11
-rw-r--r--src/lib/evas/canvas/evas_gl.c5
-rw-r--r--src/lib/evas/canvas/evas_grid.eo26
-rw-r--r--src/lib/evas/canvas/evas_image.eo2
-rw-r--r--src/lib/evas/canvas/evas_image_legacy.c51
-rw-r--r--src/lib/evas/canvas/evas_image_private.h10
-rw-r--r--src/lib/evas/canvas/evas_layer.c8
-rw-r--r--src/lib/evas/canvas/evas_main.c772
-rw-r--r--src/lib/evas/canvas/evas_map.c1
-rw-r--r--src/lib/evas/canvas/evas_object_box.c26
-rw-r--r--src/lib/evas/canvas/evas_object_grid.c28
-rw-r--r--src/lib/evas/canvas/evas_object_image.c158
-rw-r--r--src/lib/evas/canvas/evas_object_inform.c21
-rw-r--r--src/lib/evas/canvas/evas_object_intercept.c8
-rw-r--r--src/lib/evas/canvas/evas_object_line.c4
-rw-r--r--src/lib/evas/canvas/evas_object_main.c849
-rw-r--r--src/lib/evas/canvas/evas_object_polygon.c5
-rw-r--r--src/lib/evas/canvas/evas_object_rectangle.c2
-rw-r--r--src/lib/evas/canvas/evas_object_smart.c66
-rw-r--r--src/lib/evas/canvas/evas_object_table.c48
-rw-r--r--src/lib/evas/canvas/evas_object_text.c90
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c385
-rw-r--r--src/lib/evas/canvas/evas_object_textgrid.c40
-rw-r--r--src/lib/evas/canvas/evas_out.c7
-rw-r--r--src/lib/evas/canvas/evas_render.c113
-rw-r--r--src/lib/evas/canvas/evas_stack.x (renamed from src/lib/evas/canvas/evas_stack.c)8
-rw-r--r--src/lib/evas/canvas/evas_table.eo19
-rw-r--r--src/lib/evas/canvas/evas_text.eo32
-rw-r--r--src/lib/evas/canvas/evas_textblock_hyphenation.x67
-rw-r--r--src/lib/evas/canvas/evas_textblock_legacy.h9
-rw-r--r--src/lib/evas/canvas/evas_textgrid.eo22
-rw-r--r--src/lib/evas/canvas/evas_vg_container.c110
-rw-r--r--src/lib/evas/canvas/evas_vg_gradient.c38
-rw-r--r--src/lib/evas/canvas/evas_vg_gradient_linear.c74
-rw-r--r--src/lib/evas/canvas/evas_vg_gradient_radial.c84
-rw-r--r--src/lib/evas/canvas/evas_vg_node.c461
-rw-r--r--src/lib/evas/canvas/evas_vg_private.h46
-rw-r--r--src/lib/evas/canvas/evas_vg_shape.c177
-rw-r--r--src/lib/evas/canvas/render2/evas_render2_th_main.c2
-rw-r--r--src/lib/evas/common/evas_cpu.c124
-rw-r--r--src/lib/evas/common/evas_font.h8
-rw-r--r--src/lib/evas/common/evas_image_load.c7
-rw-r--r--src/lib/evas/common/evas_image_main.c5
-rw-r--r--src/lib/evas/common/evas_map_image.c2
-rw-r--r--src/lib/evas/common/evas_map_image_aa.c395
-rw-r--r--src/lib/evas/common/evas_map_image_internal.c34
-rw-r--r--src/lib/evas/common/evas_map_image_loop.c4
-rw-r--r--src/lib/evas/common/evas_scale_sample.c4
-rw-r--r--src/lib/evas/common/evas_thread_render.c34
-rw-r--r--src/lib/evas/common/language/evas_bidi_utils.c70
-rw-r--r--src/lib/evas/common/language/evas_bidi_utils.h3
-rw-r--r--src/lib/evas/cserve2/evas_cs2_private.h8
-rw-r--r--src/lib/evas/file/evas_module.c12
-rw-r--r--src/lib/evas/filters/evas_filter.c2
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture.c36
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture.eo (renamed from src/lib/evas/gesture/efl_gesture.eo)9
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_long_tap.c27
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_long_tap.eo13
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_manager.c (renamed from src/lib/evas/gesture/efl_gesture_manager.c)101
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_manager.eo (renamed from src/lib/evas/gesture/efl_gesture_manager.eo)15
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_private.h42
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer.c18
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer.eo (renamed from src/lib/evas/gesture/efl_gesture_recognizer.eo)17
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_long_tap.c (renamed from src/lib/evas/gesture/efl_gesture_recognizer_long_tap.c)34
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_long_tap.eo11
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_tap.c (renamed from src/lib/evas/gesture/efl_gesture_recognizer_tap.c)22
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_tap.eo10
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_tap.c19
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_tap.eo12
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_touch.c (renamed from src/lib/evas/gesture/efl_gesture_touch.c)32
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_touch.eo (renamed from src/lib/evas/gesture/efl_gesture_touch.eo)7
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_types.eot (renamed from src/lib/evas/gesture/efl_gesture_types.eot)6
-rw-r--r--src/lib/evas/gesture/efl_gesture.c36
-rw-r--r--src/lib/evas/gesture/efl_gesture_long_tap.c27
-rw-r--r--src/lib/evas/gesture/efl_gesture_long_tap.eo14
-rw-r--r--src/lib/evas/gesture/efl_gesture_private.h42
-rw-r--r--src/lib/evas/gesture/efl_gesture_recognizer.c18
-rw-r--r--src/lib/evas/gesture/efl_gesture_recognizer_long_tap.eo10
-rw-r--r--src/lib/evas/gesture/efl_gesture_recognizer_tap.eo9
-rw-r--r--src/lib/evas/gesture/efl_gesture_tap.c19
-rw-r--r--src/lib/evas/gesture/efl_gesture_tap.eo13
-rw-r--r--src/lib/evas/include/evas_common_private.h8
-rw-r--r--src/lib/evas/include/evas_ector_buffer.eo2
-rw-r--r--src/lib/evas/include/evas_filter.h8
-rw-r--r--src/lib/evas/include/evas_inline.x8
-rw-r--r--src/lib/evas/include/evas_private.h35
-rw-r--r--src/lib/evas/vg/evas_vg_cache.c18
-rw-r--r--src/lib/evil/Evil.h11
-rw-r--r--src/lib/evil/dirent.h146
-rw-r--r--src/lib/evil/evil_dirent.c180
-rw-r--r--src/lib/evil/evil_link_xp.cpp149
-rw-r--r--src/lib/evil/evil_macro.h2
-rw-r--r--src/lib/evil/evil_unistd.h56
-rw-r--r--src/lib/evil/evil_util.c28
-rw-r--r--src/lib/evil/evil_util.h12
-rw-r--r--src/lib/evil/fnmatch.h13
-rw-r--r--src/lib/evil/pwd.h6
-rw-r--r--src/modules/ecore/system/systemd/ecore_system_systemd.c14
-rw-r--r--src/modules/ecore/system/upower/ecore_system_upower.c26
-rw-r--r--src/modules/ecore_buffer/shm/ecore_buffer_shm.c6
-rw-r--r--src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c18
-rw-r--r--src/modules/ecore_evas/engines/drm/ecore_evas_drm.c65
-rw-r--r--src/modules/ecore_evas/engines/extn/ecore_evas_extn.c66
-rw-r--r--src/modules/ecore_evas/engines/fb/ecore_evas_fb.c29
-rw-r--r--src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c23
-rw-r--r--src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c405
-rw-r--r--src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h3
-rw-r--r--src/modules/ecore_evas/engines/win32/ecore_evas_win32.c51
-rw-r--r--src/modules/ecore_evas/engines/x/ecore_evas_x.c134
-rw-r--r--src/modules/ecore_evas/vnc_server/ecore_evas_vnc_server.c11
-rw-r--r--src/modules/ecore_evas/vnc_server/ecore_evas_vnc_server_fb_keymap.c2
-rw-r--r--src/modules/ecore_imf/ibus/ibus_imcontext.c2
-rw-r--r--src/modules/ecore_imf/wayland/wayland_imcontext.c9
-rw-r--r--src/modules/ecore_imf/xim/ecore_imf_xim.c15
-rw-r--r--src/modules/eina/mp/chained_pool/eina_chained_mempool.c4
-rw-r--r--src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c5
-rw-r--r--src/modules/elementary/web/none/elm_web_none.c38
-rw-r--r--src/modules/elementary/web/none/elm_web_none.eo6
-rw-r--r--src/modules/emotion/generic/emotion_generic.c4
-rw-r--r--src/modules/emotion/generic/emotion_generic.h2
-rw-r--r--src/modules/evas/engines/drm/Evas_Engine_Drm.h2
-rw-r--r--src/modules/evas/engines/drm/evas_engine.h7
-rw-r--r--src/modules/evas/engines/drm/evas_outbuf.c171
-rw-r--r--src/modules/evas/engines/eglfs/evas_engine.c11
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_common.h10
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_context.c80
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_core.h8
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_image.c6
-rw-r--r--src/modules/evas/engines/gl_drm/Evas_Engine_GL_Drm.h2
-rw-r--r--src/modules/evas/engines/gl_drm/evas_engine.c33
-rw-r--r--src/modules/evas/engines/gl_drm/evas_engine.h6
-rw-r--r--src/modules/evas/engines/gl_drm/evas_outbuf.c44
-rw-r--r--src/modules/evas/engines/gl_generic/evas_ector_gl.h8
-rw-r--r--src/modules/evas/engines/gl_generic/evas_ector_gl_buffer.c6
-rw-r--r--src/modules/evas/engines/gl_generic/evas_ector_gl_image_buffer.c6
-rw-r--r--src/modules/evas/engines/gl_generic/evas_engine.c54
-rw-r--r--src/modules/evas/engines/gl_x11/evas_engine.c16
-rw-r--r--src/modules/evas/engines/gl_x11/evas_engine.h2
-rw-r--r--src/modules/evas/engines/gl_x11/evas_x_main.c7
-rw-r--r--src/modules/evas/engines/software_ddraw/Evas_Engine_Software_DDraw.h1
-rw-r--r--src/modules/evas/engines/software_ddraw/evas_ddraw_buffer.c17
-rw-r--r--src/modules/evas/engines/software_ddraw/evas_ddraw_main.cpp18
-rw-r--r--src/modules/evas/engines/software_ddraw/evas_engine.c2
-rw-r--r--src/modules/evas/engines/software_ddraw/evas_engine.h18
-rw-r--r--src/modules/evas/engines/software_ddraw/evas_outbuf.c155
-rw-r--r--src/modules/evas/engines/software_gdi/Evas_Engine_Software_Gdi.h1
-rw-r--r--src/modules/evas/engines/software_gdi/evas_engine.c13
-rw-r--r--src/modules/evas/engines/software_gdi/evas_engine.h11
-rw-r--r--src/modules/evas/engines/software_gdi/evas_gdi_buffer.c13
-rw-r--r--src/modules/evas/engines/software_gdi/evas_gdi_main.c33
-rw-r--r--src/modules/evas/engines/software_gdi/evas_outbuf.c168
-rw-r--r--src/modules/evas/engines/software_generic/evas_ector_software.h12
-rw-r--r--src/modules/evas/engines/software_generic/evas_ector_software_buffer.c2
-rw-r--r--src/modules/evas/engines/software_generic/evas_engine.c125
-rw-r--r--src/modules/evas/engines/software_generic/evas_native_common.h8
-rw-r--r--src/modules/evas/engines/wayland_common/Evas_Engine_Wayland.h2
-rw-r--r--src/modules/evas/engines/wayland_egl/evas_engine.c10
-rw-r--r--src/modules/evas/engines/wayland_egl/evas_wl_main.c33
-rw-r--r--src/modules/evas/engines/wayland_shm/evas_engine.c9
-rw-r--r--src/modules/evas/engines/wayland_shm/evas_engine.h10
-rw-r--r--src/modules/evas/engines/wayland_shm/evas_outbuf.c11
-rw-r--r--src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c1
-rw-r--r--src/modules/evas/vg_savers/svg/evas_vg_save_svg.c2
-rw-r--r--src/scripts/elua/apps/docgen/doctree.lua474
-rw-r--r--src/scripts/elua/apps/docgen/mono.lua614
-rw-r--r--src/scripts/elua/apps/docgen/stats.lua22
-rw-r--r--src/scripts/elua/apps/docgen/writer.lua2
-rw-r--r--src/scripts/elua/apps/gendoc.lua74
-rw-r--r--src/scripts/elua/apps/lualian.lua2
-rw-r--r--src/scripts/elua/modules/lualian.lua40
-rw-r--r--src/scripts/gendoc/doc_alias.template4
-rw-r--r--src/scripts/gendoc/doc_class.template4
-rw-r--r--src/scripts/gendoc/doc_enum.template8
-rw-r--r--src/scripts/gendoc/doc_macros.include26
-rw-r--r--src/scripts/gendoc/doc_start.template69
-rw-r--r--src/scripts/gendoc/doc_struct.template10
-rwxr-xr-xsrc/scripts/gendoc/gendoc.py82
-rw-r--r--src/scripts/gendoc/namespaces.template83
-rw-r--r--src/scripts/pyolian/README.md6
-rw-r--r--src/scripts/pyolian/eolian.py840
-rw-r--r--src/scripts/pyolian/eolian_lib.py789
-rwxr-xr-xsrc/scripts/pyolian/generator.py18
-rwxr-xr-xsrc/scripts/pyolian/test_eolian.py354
-rw-r--r--src/scripts/pyolian/test_gen_class.template14
-rw-r--r--src/scripts/pyolian/test_gen_namespace.template26
-rw-r--r--src/static_libs/buildsystem/buildsystem.h24
-rw-r--r--src/static_libs/buildsystem/buildsystem_autotools.c50
-rw-r--r--src/static_libs/vg_common/vg_common.c43
-rw-r--r--src/tests/.gitignore2
-rw-r--r--src/tests/ecore/ecore_suite.c49
-rw-r--r--src/tests/ecore/ecore_suite.h9
-rw-r--r--src/tests/ecore/ecore_test_animator.c24
-rw-r--r--src/tests/ecore/ecore_test_args.c18
-rw-r--r--src/tests/ecore/ecore_test_ecore.c491
-rw-r--r--src/tests/ecore/ecore_test_ecore_audio.c122
-rw-r--r--src/tests/ecore/ecore_test_ecore_drm.c56
-rw-r--r--src/tests/ecore/ecore_test_ecore_evas.c8
-rw-r--r--src/tests/ecore/ecore_test_ecore_fb.c4
-rw-r--r--src/tests/ecore/ecore_test_ecore_file.c75
-rw-r--r--src/tests/ecore/ecore_test_ecore_imf.c42
-rw-r--r--src/tests/ecore/ecore_test_ecore_input.c6
-rw-r--r--src/tests/ecore/ecore_test_ecore_thread_eina_thread_queue.c250
-rw-r--r--src/tests/ecore/ecore_test_ecore_x.c8
-rw-r--r--src/tests/ecore/ecore_test_idle.c103
-rw-r--r--src/tests/ecore/ecore_test_job.c8
-rw-r--r--src/tests/ecore/ecore_test_poller.c168
-rw-r--r--src/tests/ecore/ecore_test_promise.c1067
-rw-r--r--src/tests/ecore/ecore_test_timer.c129
-rw-r--r--src/tests/ecore/efl_app_suite.c90
-rw-r--r--src/tests/ecore/efl_app_suite.h15
-rw-r--r--src/tests/ecore/efl_app_test_loop.c46
-rw-r--r--src/tests/ecore/efl_app_test_loop_fd.c97
-rw-r--r--src/tests/ecore/efl_app_test_loop_timer.c82
-rw-r--r--src/tests/ecore/efl_app_test_promise.c (renamed from src/tests/ecore/ecore_test_promise2.c)177
-rw-r--r--src/tests/ecore_con/ecore_con_suite.c28
-rw-r--r--src/tests/ecore_con/ecore_con_suite.h2
-rw-r--r--src/tests/ecore_con/ecore_con_test_ecore_con.c139
-rw-r--r--src/tests/ecore_con/ecore_con_test_ecore_con_eet.c18
-rw-r--r--src/tests/ecore_con/ecore_con_test_ecore_con_url.c48
-rw-r--r--src/tests/ecore_con/ecore_con_test_efl_net_ip_address.c333
-rw-r--r--src/tests/ecore_cxx/ecore_cxx_suite.cc2
-rw-r--r--src/tests/ecore_cxx/ecore_cxx_suite.h2
-rw-r--r--src/tests/ecore_cxx/ecore_cxx_test_safe_call.cc8
-rw-r--r--src/tests/ector/suite/ector_suite.c13
-rw-r--r--src/tests/ector/suite/ector_suite.h2
-rw-r--r--src/tests/ector/suite/ector_test_init.c6
-rw-r--r--src/tests/edje/data/test_text_cursor.edc22
-rw-r--r--src/tests/edje/data/test_textblock.edc20
-rw-r--r--src/tests/edje/edje_suite.c48
-rw-r--r--src/tests/edje/edje_suite.h9
-rw-r--r--src/tests/edje/edje_test_container.c282
-rw-r--r--src/tests/edje/edje_test_edje.c830
-rw-r--r--src/tests/edje/edje_test_features.c229
-rw-r--r--src/tests/edje/edje_test_signal.c240
-rw-r--r--src/tests/edje/edje_test_swallow.c133
-rw-r--r--src/tests/edje/edje_test_text.c120
-rw-r--r--src/tests/edje/edje_tests_helpers.h42
-rw-r--r--src/tests/eet/eet_suite.c13
-rw-r--r--src/tests/eet/eet_suite.h2
-rw-r--r--src/tests/eet/eet_test_cache.c6
-rw-r--r--src/tests/eet/eet_test_cipher.c8
-rw-r--r--src/tests/eet/eet_test_connection.c8
-rw-r--r--src/tests/eet/eet_test_data.c70
-rw-r--r--src/tests/eet/eet_test_file.c28
-rw-r--r--src/tests/eet/eet_test_identity.c36
-rw-r--r--src/tests/eet/eet_test_image.c14
-rw-r--r--src/tests/eet/eet_test_init.c11
-rw-r--r--src/tests/eet_cxx/eet_cxx_suite.cc2
-rw-r--r--src/tests/eet_cxx/eet_cxx_suite.h2
-rw-r--r--src/tests/eet_cxx/eet_cxx_test_descriptors.cc12
-rw-r--r--src/tests/eeze/eeze_suite.c13
-rw-r--r--src/tests/eeze/eeze_suite.h2
-rw-r--r--src/tests/eeze/eeze_test_init.c11
-rw-r--r--src/tests/eeze/eeze_test_net.c33
-rw-r--r--src/tests/eeze/eeze_test_sensor.c36
-rw-r--r--src/tests/eeze/eeze_test_udev.c41
-rw-r--r--src/tests/efl/efl_suite.c14
-rw-r--r--src/tests/efl/efl_suite.h2
-rw-r--r--src/tests/efl/efl_test_model_composite.c240
-rw-r--r--src/tests/efl/efl_test_model_container.c118
-rw-r--r--src/tests/efl_check.h227
-rw-r--r--src/tests/efl_mono/BasicDirection.cs34
-rw-r--r--src/tests/efl_mono/Eina.cs647
-rw-r--r--src/tests/efl_mono/Eldbus.cs16
-rw-r--r--src/tests/efl_mono/Eo.cs101
-rw-r--r--src/tests/efl_mono/EoPromises.cs195
-rw-r--r--src/tests/efl_mono/Errors.cs16
-rw-r--r--src/tests/efl_mono/Events.cs126
-rw-r--r--src/tests/efl_mono/FunctionPointerMarshalling.cs31
-rw-r--r--src/tests/efl_mono/FunctionPointers.cs6
-rw-r--r--src/tests/efl_mono/Parts.cs41
-rw-r--r--src/tests/efl_mono/Promises.cs261
-rw-r--r--src/tests/efl_mono/Strbuf.cs59
-rw-r--r--src/tests/efl_mono/Strings.cs40
-rw-r--r--src/tests/efl_mono/Structs.cs269
-rw-r--r--src/tests/efl_mono/Value.cs77
-rw-r--r--src/tests/efl_mono/ValueEolian.cs67
-rw-r--r--src/tests/efl_mono/libefl_mono_native_test.c390
-rw-r--r--src/tests/efl_mono/test_child.eo9
-rw-r--r--src/tests/efl_mono/test_testing.eo291
-rw-r--r--src/tests/efreet/efreet_async_test.c14
-rw-r--r--src/tests/efreet/efreet_suite.c13
-rw-r--r--src/tests/efreet/efreet_suite.h2
-rw-r--r--src/tests/efreet/efreet_test_efreet.c11
-rw-r--r--src/tests/efreet/efreet_test_efreet_cache.c12
-rw-r--r--src/tests/eina/eina_suite.c95
-rw-r--r--src/tests/eina/eina_suite.h3
-rw-r--r--src/tests/eina/eina_test_abi.c15
-rw-r--r--src/tests/eina/eina_test_accessor.c17
-rw-r--r--src/tests/eina/eina_test_array.c21
-rw-r--r--src/tests/eina/eina_test_barrier.c13
-rw-r--r--src/tests/eina/eina_test_benchmark.c4
-rw-r--r--src/tests/eina/eina_test_bezier.c48
-rw-r--r--src/tests/eina/eina_test_binbuf.c50
-rw-r--r--src/tests/eina/eina_test_binshare.c96
-rw-r--r--src/tests/eina/eina_test_clist.c4
-rw-r--r--src/tests/eina/eina_test_convert.c15
-rw-r--r--src/tests/eina/eina_test_counter.c14
-rw-r--r--src/tests/eina/eina_test_cow.c8
-rw-r--r--src/tests/eina/eina_test_crc.c4
-rw-r--r--src/tests/eina/eina_test_debug.c27
-rw-r--r--src/tests/eina/eina_test_error.c35
-rw-r--r--src/tests/eina/eina_test_file.c103
-rw-r--r--src/tests/eina/eina_test_fp.c36
-rw-r--r--src/tests/eina/eina_test_freeq.c27
-rw-r--r--src/tests/eina/eina_test_hash.c298
-rw-r--r--src/tests/eina/eina_test_inarray.c49
-rw-r--r--src/tests/eina/eina_test_inlist.c207
-rw-r--r--src/tests/eina/eina_test_iterator.c44
-rw-r--r--src/tests/eina/eina_test_lalloc.c4
-rw-r--r--src/tests/eina/eina_test_list.c95
-rw-r--r--src/tests/eina/eina_test_lock.c24
-rw-r--r--src/tests/eina/eina_test_log.c44
-rw-r--r--src/tests/eina/eina_test_magic.c6
-rw-r--r--src/tests/eina/eina_test_main.c21
-rw-r--r--src/tests/eina/eina_test_matrix.c54
-rw-r--r--src/tests/eina/eina_test_matrixsparse.c18
-rw-r--r--src/tests/eina/eina_test_mempool.c47
-rw-r--r--src/tests/eina/eina_test_module.c16
-rw-r--r--src/tests/eina/eina_test_quad.c6
-rw-r--r--src/tests/eina/eina_test_quadtree.c6
-rw-r--r--src/tests/eina/eina_test_quaternion.c101
-rw-r--r--src/tests/eina/eina_test_rbtree.c300
-rw-r--r--src/tests/eina/eina_test_rectangle.c22
-rw-r--r--src/tests/eina/eina_test_safepointer.c121
-rw-r--r--src/tests/eina/eina_test_sched.c10
-rw-r--r--src/tests/eina/eina_test_simple_xml_parser.c24
-rw-r--r--src/tests/eina/eina_test_slice.c22
-rw-r--r--src/tests/eina/eina_test_slstr.c56
-rw-r--r--src/tests/eina/eina_test_str.c42
-rw-r--r--src/tests/eina/eina_test_strbuf.c282
-rw-r--r--src/tests/eina/eina_test_tiler.c30
-rw-r--r--src/tests/eina/eina_test_tmpstr.c30
-rw-r--r--src/tests/eina/eina_test_trash.c6
-rw-r--r--src/tests/eina/eina_test_ustr.c60
-rw-r--r--src/tests/eina/eina_test_ustringshare.c20
-rw-r--r--src/tests/eina/eina_test_value.c162
-rw-r--r--src/tests/eina/eina_test_vector.c12
-rw-r--r--src/tests/eina/eina_test_vpath.c42
-rw-r--r--src/tests/eina/eina_test_xattr.c18
-rw-r--r--src/tests/eina_cxx/eina_cxx_suite.cc2
-rw-r--r--src/tests/eina_cxx/eina_cxx_suite.h2
-rw-r--r--src/tests/eina_cxx/eina_cxx_test_accessor.cc20
-rw-r--r--src/tests/eina_cxx/eina_cxx_test_error.cc8
-rw-r--r--src/tests/eina_cxx/eina_cxx_test_inarray.cc48
-rw-r--r--src/tests/eina_cxx/eina_cxx_test_inlist.cc36
-rw-r--r--src/tests/eina_cxx/eina_cxx_test_iterator.cc8
-rw-r--r--src/tests/eina_cxx/eina_cxx_test_log.cc20
-rw-r--r--src/tests/eina_cxx/eina_cxx_test_optional.cc16
-rw-r--r--src/tests/eina_cxx/eina_cxx_test_ptrarray.cc24
-rw-r--r--src/tests/eina_cxx/eina_cxx_test_ptrlist.cc36
-rw-r--r--src/tests/eina_cxx/eina_cxx_test_stringshare.cc8
-rw-r--r--src/tests/eina_cxx/eina_cxx_test_thread.cc12
-rw-r--r--src/tests/eina_cxx/eina_cxx_test_value.cc24
-rw-r--r--src/tests/eio/eio_model_test_file.c187
-rw-r--r--src/tests/eio/eio_model_test_monitor_add.c133
-rw-r--r--src/tests/eio/eio_suite.c24
-rw-r--r--src/tests/eio/eio_suite.h2
-rw-r--r--src/tests/eio/eio_test_eet.c16
-rw-r--r--src/tests/eio/eio_test_file.c42
-rw-r--r--src/tests/eio/eio_test_manager.c128
-rw-r--r--src/tests/eio/eio_test_manager_xattr.c24
-rw-r--r--src/tests/eio/eio_test_map.c11
-rw-r--r--src/tests/eio/eio_test_monitor.c199
-rw-r--r--src/tests/eio/eio_test_sentry.c241
-rw-r--r--src/tests/eio/eio_test_xattr.c22
-rw-r--r--src/tests/eldbus/eldbus_fake_server.c9
-rw-r--r--src/tests/eldbus/eldbus_fake_server.h8
-rw-r--r--src/tests/eldbus/eldbus_suite.c14
-rw-r--r--src/tests/eldbus/eldbus_suite.h2
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_init.c103
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_message.c143
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_model.c378
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_model.h7
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_model_connection.c121
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_model_method.c111
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_model_object.c164
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_model_proxy.c98
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_model_signal.c72
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_object.c46
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_pending_cancel.c36
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_pending_data.c27
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_proxy.c51
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_signal_handler.c64
-rw-r--r--src/tests/eldbus/eldbus_test_fake_server_eldbus_model_proxy.c105
-rw-r--r--src/tests/eldbus_cxx/eldbus_cxx_suite.cc2
-rw-r--r--src/tests/eldbus_cxx/eldbus_cxx_suite.h2
-rw-r--r--src/tests/eldbus_cxx/eldbus_cxx_test_eldbus_client.cc4
-rw-r--r--src/tests/eldbus_cxx/eldbus_cxx_test_eldbus_connect.cc14
-rw-r--r--src/tests/elementary/efl_ui_suite.c83
-rw-r--r--src/tests/elementary/elm_code_file_test_load.c51
-rw-r--r--src/tests/elementary/elm_code_file_test_memory.c14
-rw-r--r--src/tests/elementary/elm_code_test_basic.c18
-rw-r--r--src/tests/elementary/elm_code_test_indent.c94
-rw-r--r--src/tests/elementary/elm_code_test_line.c21
-rw-r--r--src/tests/elementary/elm_code_test_parse.c21
-rw-r--r--src/tests/elementary/elm_code_test_syntax.c20
-rw-r--r--src/tests/elementary/elm_code_test_text.c42
-rw-r--r--src/tests/elementary/elm_code_test_widget.c80
-rw-r--r--src/tests/elementary/elm_code_test_widget_selection.c169
-rw-r--r--src/tests/elementary/elm_code_test_widget_text.c18
-rw-r--r--src/tests/elementary/elm_code_test_widget_undo.c159
-rw-r--r--src/tests/elementary/elm_suite.c97
-rw-r--r--src/tests/elementary/elm_suite.h4
-rw-r--r--src/tests/elementary/elm_test_actionslider.c35
-rw-r--r--src/tests/elementary/elm_test_atspi.c315
-rw-r--r--src/tests/elementary/elm_test_bg.c47
-rw-r--r--src/tests/elementary/elm_test_box.c35
-rw-r--r--src/tests/elementary/elm_test_bubble.c35
-rw-r--r--src/tests/elementary/elm_test_button.c47
-rw-r--r--src/tests/elementary/elm_test_calendar.c35
-rw-r--r--src/tests/elementary/elm_test_check.c49
-rw-r--r--src/tests/elementary/elm_test_clock.c35
-rw-r--r--src/tests/elementary/elm_test_colorselector.c41
-rw-r--r--src/tests/elementary/elm_test_config.c30
-rw-r--r--src/tests/elementary/elm_test_conformant.c35
-rw-r--r--src/tests/elementary/elm_test_ctxpopup.c35
-rw-r--r--src/tests/elementary/elm_test_datetime.c35
-rw-r--r--src/tests/elementary/elm_test_dayselector.c35
-rw-r--r--src/tests/elementary/elm_test_diskselector.c35
-rw-r--r--src/tests/elementary/elm_test_entry.c117
-rw-r--r--src/tests/elementary/elm_test_fileselector.c43
-rw-r--r--src/tests/elementary/elm_test_fileselector_button.c35
-rw-r--r--src/tests/elementary/elm_test_fileselector_entry.c35
-rw-r--r--src/tests/elementary/elm_test_flip.c34
-rw-r--r--src/tests/elementary/elm_test_flipselector.c34
-rw-r--r--src/tests/elementary/elm_test_focus.c601
-rw-r--r--src/tests/elementary/elm_test_focus_common.c15
-rw-r--r--src/tests/elementary/elm_test_focus_common.h2
-rw-r--r--src/tests/elementary/elm_test_focus_sub.c67
-rw-r--r--src/tests/elementary/elm_test_frame.c34
-rw-r--r--src/tests/elementary/elm_test_gengrid.c46
-rw-r--r--src/tests/elementary/elm_test_genlist.c212
-rw-r--r--src/tests/elementary/elm_test_glview.c42
-rw-r--r--src/tests/elementary/elm_test_grid.c34
-rw-r--r--src/tests/elementary/elm_test_hover.c34
-rw-r--r--src/tests/elementary/elm_test_hoversel.c34
-rw-r--r--src/tests/elementary/elm_test_icon.c34
-rw-r--r--src/tests/elementary/elm_test_image.c96
-rw-r--r--src/tests/elementary/elm_test_index.c34
-rw-r--r--src/tests/elementary/elm_test_init.c6
-rw-r--r--src/tests/elementary/elm_test_inwin.c34
-rw-r--r--src/tests/elementary/elm_test_label.c34
-rw-r--r--src/tests/elementary/elm_test_layout.c72
-rw-r--r--src/tests/elementary/elm_test_list.c138
-rw-r--r--src/tests/elementary/elm_test_map.c34
-rw-r--r--src/tests/elementary/elm_test_mapbuf.c34
-rw-r--r--src/tests/elementary/elm_test_menu.c34
-rw-r--r--src/tests/elementary/elm_test_multibuttonentry.c34
-rw-r--r--src/tests/elementary/elm_test_naviframe.c34
-rw-r--r--src/tests/elementary/elm_test_notify.c34
-rw-r--r--src/tests/elementary/elm_test_panel.c34
-rw-r--r--src/tests/elementary/elm_test_panes.c34
-rw-r--r--src/tests/elementary/elm_test_photo.c34
-rw-r--r--src/tests/elementary/elm_test_photocam.c40
-rw-r--r--src/tests/elementary/elm_test_player.c34
-rw-r--r--src/tests/elementary/elm_test_plug.c34
-rw-r--r--src/tests/elementary/elm_test_popup.c64
-rw-r--r--src/tests/elementary/elm_test_prefs.c35
-rw-r--r--src/tests/elementary/elm_test_progressbar.c34
-rw-r--r--src/tests/elementary/elm_test_radio.c34
-rw-r--r--src/tests/elementary/elm_test_scroller.c34
-rw-r--r--src/tests/elementary/elm_test_segmentcontrol.c34
-rw-r--r--src/tests/elementary/elm_test_separator.c34
-rw-r--r--src/tests/elementary/elm_test_slider.c34
-rw-r--r--src/tests/elementary/elm_test_slideshow.c34
-rw-r--r--src/tests/elementary/elm_test_spinner.c34
-rw-r--r--src/tests/elementary/elm_test_table.c34
-rw-r--r--src/tests/elementary/elm_test_thumb.c35
-rw-r--r--src/tests/elementary/elm_test_toolbar.c34
-rw-r--r--src/tests/elementary/elm_test_video.c34
-rw-r--r--src/tests/elementary/elm_test_web.c34
-rw-r--r--src/tests/elementary/elm_test_win.c193
-rw-r--r--src/tests/elementary/focus_test.eo10
-rw-r--r--src/tests/elementary/focus_test_sub_main.eo6
-rw-r--r--src/tests/elocation/elocation_suite.c28
-rw-r--r--src/tests/elput/elput_suite.c13
-rw-r--r--src/tests/elput/elput_suite.h2
-rw-r--r--src/tests/elput/elput_test_elput.c11
-rw-r--r--src/tests/elua/elua_lib.c8
-rw-r--r--src/tests/elua/elua_suite.c13
-rw-r--r--src/tests/elua/elua_suite.h2
-rw-r--r--src/tests/emile/emile_suite.c13
-rw-r--r--src/tests/emile/emile_suite.h2
-rw-r--r--src/tests/emile/emile_test_base.c6
-rw-r--r--src/tests/emile/emile_test_base64.c8
-rw-r--r--src/tests/emotion/emotion_test_main-eo.c22
-rw-r--r--src/tests/emotion/emotion_test_main.c1
-rw-r--r--src/tests/eo/access/access_main.c2
-rw-r--r--src/tests/eo/children/children_main.c2
-rw-r--r--src/tests/eo/composite_objects/composite_objects_main.c2
-rw-r--r--src/tests/eo/constructors/constructors_main.c20
-rw-r--r--src/tests/eo/function_overrides/function_overrides_main.c8
-rw-r--r--src/tests/eo/interface/interface_main.c2
-rw-r--r--src/tests/eo/mixin/mixin_main.c4
-rw-r--r--src/tests/eo/signals/signals_main.c2
-rw-r--r--src/tests/eo/signals/signals_simple.c4
-rw-r--r--src/tests/eo/suite/eo_error_msgs.c28
-rw-r--r--src/tests/eo/suite/eo_error_msgs.h6
-rw-r--r--src/tests/eo/suite/eo_suite.c14
-rw-r--r--src/tests/eo/suite/eo_suite.h4
-rw-r--r--src/tests/eo/suite/eo_test_call_errors.c32
-rw-r--r--src/tests/eo/suite/eo_test_class_behaviour_errors.c24
-rw-r--r--src/tests/eo/suite/eo_test_class_errors.c36
-rw-r--r--src/tests/eo/suite/eo_test_class_singleton.c2
-rw-r--r--src/tests/eo/suite/eo_test_domain.c3
-rw-r--r--src/tests/eo/suite/eo_test_event.c24
-rw-r--r--src/tests/eo/suite/eo_test_general.c475
-rw-r--r--src/tests/eo/suite/eo_test_init.c14
-rw-r--r--src/tests/eo/suite/eo_test_lifecycle.c172
-rw-r--r--src/tests/eo/suite/eo_test_threaded_calls.c8
-rw-r--r--src/tests/eo/suite/eo_test_value.c8
-rw-r--r--src/tests/eo_cxx/eo_cxx_suite.cc3
-rw-r--r--src/tests/eo_cxx/eo_cxx_suite.h3
-rw-r--r--src/tests/eo_cxx/eo_cxx_test_promise.cc1001
-rw-r--r--src/tests/eolian/data/class_simple_ref.c2
-rw-r--r--src/tests/eolian/data/docs.eo2
-rw-r--r--src/tests/eolian/data/events.eo8
-rw-r--r--src/tests/eolian/data/object_impl_add_ref.c4
-rw-r--r--src/tests/eolian/data/object_impl_ref.c2
-rw-r--r--src/tests/eolian/data/override_ref.c8
-rw-r--r--src/tests/eolian/eolian_generated_future.c46
-rw-r--r--src/tests/eolian/eolian_generation.c36
-rw-r--r--src/tests/eolian/eolian_parsing.c722
-rw-r--r--src/tests/eolian/eolian_static.c26
-rw-r--r--src/tests/eolian/eolian_suite.c14
-rw-r--r--src/tests/eolian/eolian_suite.h3
-rw-r--r--src/tests/eolian/generated_future.eo51
-rw-r--r--src/tests/eolian_cxx/callback.eo2
-rw-r--r--src/tests/eolian_cxx/docs.eo2
-rw-r--r--src/tests/eolian_cxx/eolian_cxx_suite.cc2
-rw-r--r--src/tests/eolian_cxx/eolian_cxx_suite.h2
-rw-r--r--src/tests/eolian_cxx/eolian_cxx_test_address_of.cc4
-rw-r--r--src/tests/eolian_cxx/eolian_cxx_test_binding.cc40
-rw-r--r--src/tests/eolian_cxx/eolian_cxx_test_cyclic.cc4
-rw-r--r--src/tests/eolian_cxx/eolian_cxx_test_documentation.cc36
-rw-r--r--src/tests/eolian_cxx/eolian_cxx_test_generate.cc4
-rw-r--r--src/tests/eolian_cxx/eolian_cxx_test_parse.cc12
-rw-r--r--src/tests/eolian_cxx/eolian_cxx_test_wrapper.cc4
-rw-r--r--src/tests/eolian_cxx/generic.c8
-rw-r--r--src/tests/eolian_cxx/generic.eo8
-rw-r--r--src/tests/eolian_js/eolian_js_test_constructor_method_impl.c4
-rw-r--r--src/tests/eolian_js/test_object.eo4
-rw-r--r--src/tests/evas/dicts/README_hyph_de_DE.txt30
-rw-r--r--src/tests/evas/dicts/README_hyph_en_US.txt53
-rw-r--r--src/tests/evas/dicts/hyph_de_DE.dic7500
-rw-r--r--src/tests/evas/dicts/hyph_en_US.dic11128
-rw-r--r--src/tests/evas/evas_suite.c23
-rw-r--r--src/tests/evas/evas_suite.h7
-rw-r--r--src/tests/evas/evas_test_callbacks.c9
-rw-r--r--src/tests/evas/evas_test_evasgl.c10
-rw-r--r--src/tests/evas/evas_test_filters.c18
-rw-r--r--src/tests/evas/evas_test_image.c154
-rw-r--r--src/tests/evas/evas_test_init.c4
-rw-r--r--src/tests/evas/evas_test_mask.c15
-rw-r--r--src/tests/evas/evas_test_matrix.c4
-rw-r--r--src/tests/evas/evas_test_mesh.c53
-rw-r--r--src/tests/evas/evas_test_new.c21
-rw-r--r--src/tests/evas/evas_test_object.c7
-rw-r--r--src/tests/evas/evas_test_object_smart.c5
-rw-r--r--src/tests/evas/evas_test_render_engines.c8
-rw-r--r--src/tests/evas/evas_test_text.c41
-rw-r--r--src/tests/evas/evas_test_textblock.c211
-rw-r--r--src/tests/evas/evas_tests_helpers.h2
-rw-r--r--src/tests/evil/evil_suite.c19
-rw-r--r--src/tests/evil/evil_suite.h7
-rw-r--r--src/tests/evil/evil_test_dlfcn.c24
-rw-r--r--src/tests/evil/evil_test_libgen.c48
-rw-r--r--src/tests/evil/evil_test_main.c6
-rw-r--r--src/tests/evil/evil_test_stdio.c28
-rw-r--r--src/tests/evil/evil_test_stdlib.c68
-rw-r--r--src/tests/evil/evil_test_unistd.c115
-rw-r--r--src/wayland_protocol/efl-hints.xml4
2375 files changed, 130092 insertions, 75720 deletions
diff --git a/.arcconfig b/.arcconfig
index 2179df69b6..e049d1637f 100644
--- a/.arcconfig
+++ b/.arcconfig
@@ -1,4 +1,7 @@
{
"project_id" : "efl",
- "conduit_uri" : "https://phab.enlightenment.org/"
+ "projects" : "efl",
+ "conduit_uri" : "https://phab.enlightenment.org/",
+ "phabricator.uri" : "https://phab.enlightenment.org/",
+ "repository.callsign" : "EFL"
}
diff --git a/.ci/build-efl-app.sh b/.ci/build-efl-app.sh
new file mode 100755
index 0000000000..ac22e09db5
--- /dev/null
+++ b/.ci/build-efl-app.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+set -e
+
+cd /
+
+#clone our examples from efl
+git clone http://git.enlightenment.org/tools/examples.git/
+
+cd examples/apps/c/life/
+
+#build the example
+mkdir build
+meson . ./build
+ninja -C build all
+
+#remove the folder again so its not left in the artifacts
+cd /
+rm -rf examples
diff --git a/.ci/ci-linux-build.sh b/.ci/ci-linux-build.sh
index 5472495b5a..ddc33fef50 100755
--- a/.ci/ci-linux-build.sh
+++ b/.ci/ci-linux-build.sh
@@ -1,10 +1,63 @@
#!/bin/sh
-COPTS="--with-tests=regular"
-PARALLEL_JOBS=10
-
-# Normal build test of all targets
-./autogen.sh $COPTS $@
-make -j $PARALLEL_JOBS
-make -j $PARALLEL_JOBS examples
-make -j $PARALLEL_JOBS benchmark
+set -e
+
+CI_BUILD_TYPE=$1
+
+DEFAULT_COPTS="--prefix=/usr/ --with-tests=regular --disable-cxx-bindings"
+
+WAYLAND_COPTS="--with-tests=regular --enable-wayland --enable-elput --enable-drm \
+--enable-wayland-ivi-shell --enable-gl-drm --with-opengl=es --enable-egl"
+
+MISC_COPTS="--enable-harfbuzz --enable-liblz4 --enable-image-loader-webp --enable-xinput22 \
+--enable-multisense --enable-lua-old --enable-xpresent --enable-hyphen \
+--enable-pixman --enable-pixman-font --enable-pixman-rect --enable-pixman-line \
+--enable-pixman-poly --enable-pixman-image --enable-pixman-image-scale-sample \
+--enable-image-loader-generic --enable-libuv --enable-tile-rotate --enable-vnc-server \
+--enable-sdl --enable-fb --enable-v4l2 --enable-cserve --enable-always-build-examples \
+--enable-ecore-wayland --enable-ecore-drm --enable-cancel-ok --with-crypto=gnutls \
+--enable-debug --disable-gstreamer1 --enable-gstreamer"
+
+MISC_DISABLED_COPTS="--disable-neon --disable-libeeze --disable-systemd --disable-magic-debug \
+--disable-valgrind --disable-cxx-bindings --disable-gstreamer1 \
+--disable-fontconfig --disable-fribidi --disable-poppler --disable-spectre --disable-libraw \
+--disable-librsvg --disable-xcf --disable-libmount --disable-tslib --disable-audio \
+--disable-pulseaudio --disable-avahi --disable-xinput2 --disable-xim --disable-scim \
+--disable-ibus --disable-physics --disable-quick-launch --disable-elua"
+
+RELEASE_READY_COPTS="--with-profile=release"
+
+if [ "$CI_BUILD_TYPE" = "" ]; then
+ # Normal build test of all targets
+ ./autogen.sh $DEFAULT_COPTS
+ make
+ make check-build
+ make examples
+ make benchmark
+ make install
+ ./.ci/build-efl-app.sh
+fi
+
+if [ "$CI_BUILD_TYPE" = "wayland" ]; then
+ ./autogen.sh $WAYLAND_COPTS
+ make
+ make examples
+fi
+
+if [ "$CI_BUILD_TYPE" = "misc" ]; then
+ ./autogen.sh $MISC_COPTS
+ make
+ make examples
+fi
+
+if [ "$CI_BUILD_TYPE" = "misc-disabled" ]; then
+ ./autogen.sh $MISC_DISABLED_COPTS
+ make
+ make examples
+fi
+
+if [ "$CI_BUILD_TYPE" = "release-ready" ]; then
+ ./autogen.sh $RELEASE_READY_COPTS
+ make
+ make distcheck
+fi
diff --git a/.ci/ci-osx-build.sh b/.ci/ci-osx-build.sh
index 628ec20abe..4e7a0f05cc 100755
--- a/.ci/ci-osx-build.sh
+++ b/.ci/ci-osx-build.sh
@@ -1,7 +1,8 @@
#!/bin/sh
-COPTS="--with-crypto=none --disable-pulseaudio --disable-cxx-bindings"
-PARALLEL_JOBS=10
+set -e
+
+COPTS="--disable-cxx-bindings"
# Prepare OSX env for build
mkdir -p ~/Library/LaunchAgents
@@ -9,8 +10,11 @@ ln -sfv /usr/local/opt/d-bus/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/org.freedesktop.dbus-session.plist
export PATH="$(brew --prefix gettext)/bin:$PATH"
+export CFLAGS="-I/usr/local/opt/openssl/include $CFLAGS"
+export LDFLAGS="-L/usr/local/opt/openssl/lib $LDFLAGS"
+
# Normal build test of all targets
./autogen.sh $COPTS $@
-make -j $PARALLEL_JOBS
-#make -j $PARALLEL_JOBS examples
-#make -j $PARALLEL_JOBS benchmark
+make
+make examples
+#make benchmark
diff --git a/.ci/ci-osx-deps.sh b/.ci/ci-osx-deps.sh
index 4be656a8fa..859842624e 100755
--- a/.ci/ci-osx-deps.sh
+++ b/.ci/ci-osx-deps.sh
@@ -1,4 +1,5 @@
#!/bin/sh
brew update
-brew install gettext check bullet dbus fontconfig freetype fribidi gst-plugins-good gstreamer luajit openssl webp libsndfile glib libspectre libraw librsvg poppler lz4
+brew unlink python
+brew install gettext check bullet dbus fontconfig freetype fribidi gst-plugins-good gstreamer luajit openssl webp libsndfile glib libspectre libraw librsvg poppler lz4 pulseaudio
diff --git a/.ci/Dockerfile-Archlinux b/.ci/dockerfiles/Dockerfile-Archlinux
index a94dc2a5fb..2b335e31c1 100644
--- a/.ci/Dockerfile-Archlinux
+++ b/.ci/dockerfiles/Dockerfile-Archlinux
@@ -10,9 +10,3 @@ RUN pacman -S --noconfirm git bullet libjpeg-turbo gst-plugins-base \
libspectre libraw librsvg wayland-protocols \
git ninja clang gcc pkgconfig check autoconf make base-devel \
mesa poppler
-
-# Build
-RUN mkdir -p /src/
-WORKDIR /src/
-COPY . /src/
-RUN .ci/ci-linux-build.sh
diff --git a/.ci/Dockerfile-Debian91 b/.ci/dockerfiles/Dockerfile-Debian91
index 10d8a1e8b0..a8d2ea20af 100644
--- a/.ci/Dockerfile-Debian91
+++ b/.ci/dockerfiles/Dockerfile-Debian91
@@ -3,9 +3,3 @@ FROM debian:9.1
# Install
RUN apt-get update -y
RUN apt-get install -y make gcc bison flex gawk subversion automake autoconf doxygen check autotools-dev autoconf-archive autopoint libtool gettext libpam0g-dev libfreetype6-dev libpng-dev zlib1g-dev libjpeg-dev libdbus-1-dev luajit libluajit-5.1-dev libx11-dev libxcursor-dev libxrender-dev libxrandr-dev libxfixes-dev libxdamage-dev libxcomposite-dev libxss-dev libxext-dev libxinerama-dev libxkbfile-dev libxtst-dev libxcb1-dev libxcb-shape0-dev libxcb-keysyms1-dev libpulse-dev libsndfile1-dev libudev-dev libblkid-dev libmount-dev libgstreamer1.0-dev libtiff5-dev libgif-dev curl libssl-dev libspectre-dev libpoppler-dev librsvg2-dev libraw-dev libxinerama-dev git libfribidi-dev libcogl-gles2-dev libbullet-dev libgstreamer-plugins-base1.0-dev libvlc-dev libpoppler-cpp-dev libsystemd-dev systemd libsystemd0
-
-# Build
-RUN mkdir -p /src/
-WORKDIR /src/
-COPY . /src/
-RUN .ci/ci-linux-build.sh
diff --git a/.ci/Dockerfile-Fedora26 b/.ci/dockerfiles/Dockerfile-Fedora26
index 50afa45af1..6649c937f1 100644
--- a/.ci/Dockerfile-Fedora26
+++ b/.ci/dockerfiles/Dockerfile-Fedora26
@@ -3,9 +3,3 @@ FROM fedora:26
# Install
RUN dnf update --assumeyes
RUN dnf install --assumeyes bullet-devel libpng-devel libjpeg-turbo-devel gstreamer1-devel gstreamer1-plugins-base-devel zlib-devel luajit-devel libtiff-devel openssl-devel libcurl-devel dbus-devel glibc-devel fontconfig-devel freetype-devel fribidi-devel pulseaudio-libs-devel libsndfile-devel libX11-devel libXau-devel libXcomposite-devel libXdamage-devel libXdmcp-devel libXext-devel libXfixes-devel libXinerama-devel libXrandr-devel libXrender-devel libXScrnSaver-devel libXtst-devel libXcursor-devel libXp-devel libXi-devel mesa-libGL-devel giflib-devel libmount-devel libblkid-devel systemd-devel poppler-cpp-devel poppler-devel LibRaw-devel libspectre-devel librsvg2-devel autoconf automake gcc gcc-c++ gettext-devel findutils tar xz libtool make
-
-# Build
-RUN mkdir -p /src/
-WORKDIR /src/
-COPY . /src/
-RUN .ci/ci-linux-build.sh
diff --git a/.ci/Dockerfile-Fedora27 b/.ci/dockerfiles/Dockerfile-Fedora27
index 346339218e..e0d4b8c4fe 100644
--- a/.ci/Dockerfile-Fedora27
+++ b/.ci/dockerfiles/Dockerfile-Fedora27
@@ -4,8 +4,8 @@ FROM fedora:27
RUN dnf update --assumeyes
RUN dnf install --assumeyes bullet-devel libpng-devel libjpeg-turbo-devel gstreamer1-devel gstreamer1-plugins-base-devel zlib-devel luajit-devel libtiff-devel openssl-devel libcurl-devel dbus-devel glibc-devel fontconfig-devel freetype-devel fribidi-devel pulseaudio-libs-devel libsndfile-devel libX11-devel libXau-devel libXcomposite-devel libXdamage-devel libXdmcp-devel libXext-devel libXfixes-devel libXinerama-devel libXrandr-devel libXrender-devel libXScrnSaver-devel libXtst-devel libXcursor-devel libXp-devel libXi-devel mesa-libGL-devel giflib-devel libmount-devel libblkid-devel systemd-devel poppler-cpp-devel poppler-devel LibRaw-devel libspectre-devel librsvg2-devel autoconf automake gcc gcc-c++ gettext-devel findutils tar xz libtool make
-# Build
-RUN mkdir -p /src/
-WORKDIR /src/
-COPY . /src/
-RUN .ci/ci-linux-build.sh
+# Install wayland build dependencies
+RUN dnf install --assumeyes wayland-protocols-devel libwayland-client libwayland-server libinput-devel libdrm-devel libxkbcommon-devel uuid-devel wayland-devel mesa-libgbm-devel
+
+# Install misc build dependencies
+RUN dnf install --assumeyes lz4-devel harfbuzz-devel libXpresent-devel libwebp-devel hyphen-devel lua-devel
diff --git a/.ci/dockerfiles/Dockerfile-Opensuse423 b/.ci/dockerfiles/Dockerfile-Opensuse423
new file mode 100644
index 0000000000..697766d659
--- /dev/null
+++ b/.ci/dockerfiles/Dockerfile-Opensuse423
@@ -0,0 +1,7 @@
+FROM opensuse:42.3
+
+# Install
+RUN zypper --non-interactive update
+RUN zypper --non-interactive install -t pattern devel_basis
+RUN zypper --non-interactive in -d efl
+RUN zypper --non-interactive install gcc-c++ gettext-devel doxygen check libcheck0 check-devel libopenssl-devel systemd-devel libjpeg-devel glib2-devel gstreamer-devel gstreamer-plugins-base-devel luajit-devel freetype2-devel fontconfig-devel fribidi-devel libpng-devel libtiff-devel libcurl-devel libsndfile-devel libX11-devel libXau-devel libXcomposite-devel libXdamage-devel libXdmcp-devel libXext-devel libXfixes-devel libXinerama-devel libXrandr-devel libXrender-devel libXScrnSaver-devel libXtst-devel libXcursor-devel libXp-devel libXi-devel Mesa-libGL-devel giflib-devel libmount-devel libblkid-devel poppler-devel libraw-devel libspectre-devel librsvg2-devel gettext-devel libbullet-devel libudev-devel dbus-1-devel libpulse-devel
diff --git a/.ci/Dockerfile-Ubuntu1704 b/.ci/dockerfiles/Dockerfile-Ubuntu1704
index 426ac9ec6f..ecec07e07c 100644
--- a/.ci/Dockerfile-Ubuntu1704
+++ b/.ci/dockerfiles/Dockerfile-Ubuntu1704
@@ -3,9 +3,3 @@ FROM ubuntu:17.04
# Install
RUN apt-get update -y
RUN apt-get install -y build-essential autoconf automake autopoint doxygen check luajit libharfbuzz-dev libpng-dev libudev-dev libwebp-dev libssl-dev libluajit-5.1-dev libfribidi-dev libcogl-gles2-dev libgif-dev libtiff5-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libdbus-1-dev libmount-dev libblkid-dev libpulse-dev libxrandr-dev libxtst-dev libxcursor-dev libxcomposite-dev libxinerama-dev libxkbfile-dev libbullet-dev libvlc-dev libsndfile1-dev libraw-dev libspectre-dev libpoppler-cpp-dev libpam0g-dev liblz4-dev faenza-icon-theme gettext git imagemagick libasound2-dev libbluetooth-dev libfontconfig1-dev libfreetype6-dev libibus-1.0-dev libiconv-hook-dev libjpeg-dev libjpeg-turbo8-dev libpoppler-dev libpoppler-private-dev libproxy-dev librsvg2-dev libscim-dev libsystemd-dev libtool libudisks2-dev libunibreak-dev libxcb-keysyms1-dev libxine2-dev libxss-dev linux-tools-common libcurl4-openssl-dev
-
-# Build
-RUN mkdir -p /src/
-WORKDIR /src/
-COPY . /src/
-RUN .ci/ci-linux-build.sh
diff --git a/.ci/Dockerfile-Ubuntu1710 b/.ci/dockerfiles/Dockerfile-Ubuntu1710
index 23a134b598..8a7e7cae53 100644
--- a/.ci/Dockerfile-Ubuntu1710
+++ b/.ci/dockerfiles/Dockerfile-Ubuntu1710
@@ -2,10 +2,4 @@ FROM ubuntu:17.10
# Install
RUN apt-get update -y
-RUN apt-get install -y build-essential autoconf automake autopoint doxygen check luajit libharfbuzz-dev libpng-dev libudev-dev libwebp-dev libssl-dev libluajit-5.1-dev libfribidi-dev libcogl-gles2-dev libgif-dev libtiff5-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libdbus-1-dev libmount-dev libblkid-dev libpulse-dev libxrandr-dev libxtst-dev libxcursor-dev libxcomposite-dev libxinerama-dev libxkbfile-dev libbullet-dev libvlc-dev libsndfile1-dev libraw-dev libspectre-dev libpoppler-cpp-dev libpam0g-dev liblz4-dev faenza-icon-theme gettext git imagemagick libasound2-dev libbluetooth-dev libfontconfig1-dev libfreetype6-dev libibus-1.0-dev libiconv-hook-dev libjpeg-dev libjpeg-turbo8-dev libpoppler-dev libpoppler-private-dev libproxy-dev librsvg2-dev libscim-dev libsystemd-dev libtool libudisks2-dev libunibreak-dev libxcb-keysyms1-dev libxine2-dev libxss-dev linux-tools-common libcurl4-openssl-dev
-
-# Build
-RUN mkdir -p /src/
-WORKDIR /src/
-COPY . /src/
-RUN .ci/ci-linux-build.sh
+RUN apt-get install -y build-essential autoconf automake autopoint doxygen check luajit libharfbuzz-dev libpng-dev libudev-dev libwebp-dev libssl-dev libluajit-5.1-dev libfribidi-dev libcogl-gles2-dev libgif-dev libtiff5-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libdbus-1-dev libmount-dev libblkid-dev libpulse-dev libxrandr-dev libxtst-dev libxcursor-dev libxcomposite-dev libxinerama-dev libxkbfile-dev libbullet-dev libvlc-dev libsndfile1-dev libraw-dev libspectre-dev libpoppler-cpp-dev libpam0g-dev liblz4-dev faenza-icon-theme gettext git imagemagick libasound2-dev libbluetooth-dev libfontconfig1-dev libfreetype6-dev libibus-1.0-dev libiconv-hook-dev libjpeg-dev libjpeg-turbo8-dev libpoppler-dev libpoppler-private-dev libproxy-dev librsvg2-dev libscim-dev libsystemd-dev libtool libudisks2-dev libunibreak-dev libxcb-keysyms1-dev libxine2-dev libxss-dev linux-tools-common libcurl4-openssl-dev systemd
diff --git a/.travis.yml b/.travis.yml
index 2f60f7ee8f..60a3658b8b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,28 +3,83 @@ language: c
sudo: required
dist: trusty
-os: linux
+os:
+ - linux
+ - osx
+
+env:
+ global:
+ - MAKEFLAGS="-j5"
+ matrix:
+ -
+ - DISTRO=Ubuntu1804
+ - DISTRO=Fedora28 CI_BUILD_TYPE=wayland
+ - DISTRO=Fedora28 CI_BUILD_TYPE=misc
+ - DISTRO=Fedora28 CI_BUILD_TYPE=misc-disabled
+ - DISTRO=Fedora28 CI_BUILD_TYPE=release-ready
+ - DISTRO=Debian91
+ - DISTRO=Archlinux
services:
- docker
-before_install:
- - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then .ci/ci-osx-deps.sh ; fi
-
matrix:
- include:
- - env: DISTRO=Ubuntu1704
- - env: DISTRO=Fedora27
- - env: DISTRO=Debian91
- - env: DISTRO=Archlinux
+ fast_finish: true
+ exclude:
+ - os: osx
+ env: DISTRO=Ubuntu1804
+ - os: osx
+ env: DISTRO=Fedora28 CI_BUILD_TYPE=wayland
+ - os: osx
+ env: DISTRO=Fedora28 CI_BUILD_TYPE=misc
+ - os: osx
+ env: DISTRO=Fedora28 CI_BUILD_TYPE=misc-disabled
- os: osx
- osx_image: xcode7.3
+ env: DISTRO=Fedora28 CI_BUILD_TYPE=release-ready
- os: osx
- osx_image: xcode8.3
+ env: DISTRO=Debian91
+ - os: osx
+ env: DISTRO=Archlinux
+
+ - os: linux
+ env:
+ allow_failures:
+ - os: linux
+ env: DISTRO=Fedora28 CI_BUILD_TYPE=release-ready
-# Xcode 7.3.1, OS X 10.11
-# Xcode 8.3.3, OS X 10.12
+before_install:
+ - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then .ci/ci-osx-deps.sh ; fi
+
+before_script:
+ - |
+ if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$DISTRO" != "" ]]; then
+ docker pull stefanschmidt1/ci-support-files:$DISTRO
+ fi
script:
- - if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$DISTRO" != "" ]]; then docker build -f .ci/Dockerfile-$DISTRO . ; fi
+ - |
+ if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$DISTRO" != "" ]]; then
+ docker run -v `pwd`:/src -w /src stefanschmidt1/ci-support-files:$DISTRO /src/.ci/ci-linux-build.sh $CI_BUILD_TYPE
+ fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then .ci/ci-osx-build.sh ; fi
+
+after_success:
+ - |
+ if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$DISTRO" != "" ]]; then
+ docker login -u stefanschmidt1 -p "$DOCKER_PASSWORD"
+ docker tag stefanschmidt1/ci-support-files:$DISTRO stefanschmidt1/ci-support-files:$DISTRO-$TRAVIS_BUILD_NUMBER
+ docker push stefanschmidt1/ci-support-files:$DISTRO
+ docker push stefanschmidt1/ci-support-files:$DISTRO-$TRAVIS_BUILD_NUMBER
+ fi
+
+notifications:
+ irc:
+ channels:
+ - "chat.freenode.net#edevelop"
+ on_success: change
+ on_failure: always
+ template:
+ - "TravisCI build %{build_number} in branch %{branch}: %{result} - %{message}"
+ - "Commit: %{commit_subject} (%{commit}) from %{author}"
+ - "Change view : %{compare_url}"
+ - "Build details : %{build_url}"
diff --git a/AUTHORS b/AUTHORS
index 894fd3a798..66237b1e68 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -676,7 +676,7 @@ Vitaliy Venzak <v.venzak@samsung.com>
perepelits.m <perepelits.m@samsung.com>
rustyBSD <rustyBSD@gmx.fr>
Haifeng Deng <haifeng.deng@samsung.com>
-Al Poole <netstar@gmail.com>
+Alastair Poole <netstar@gmail.com>
Marcel Hollerbach <marcel-hollerbach@t-online.de>
Hermet Park <hermetpark@gmail.com>
Jeeyong Um <conr2d@gmail.com>
@@ -687,3 +687,8 @@ Jinyong Park <j4939.park@samsung.com>
Woochan Lee <wc0917.lee@samsung.com>
Taehyub Kim <taehyub.kim@samsung.com>
Sungtaek Hong <taxi2se@gmail.com>
+Bryce Harrington <bryce@osg.samsung.com>
+YeongJong Lee <yj34.lee@samsung.com>
+Bowon Ryu <bowon.ryu@samsung.com>
+Wonki Kim <wonki_.kim@samsung.com>
+Junsu Choi <jsuya.choi@samsung.com>
diff --git a/COPYING.images b/COPYING.images
index 951d874d1b..1683e24744 100644
--- a/COPYING.images
+++ b/COPYING.images
@@ -1,6 +1,7 @@
-Gesture Layer 2:
+Gesture Layer 2 (all the icons in data/elementary/images/g_layer):
Illustrations provided by GestureWorks® (www.gestureworks.com)
Creative Commons Attribution Sharealike license v 3.0.
+ http://gestureworks.com/
http://gestureworks.com/icons-fonts
http://creativecommons.org/licenses/by-sa/3.0/us/
diff --git a/Makefile.am b/Makefile.am
index 35a0315270..a753de855d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,7 +5,7 @@ AM_DISTCHECK_CONFIGURE_FLAGS = \
--with-systemdunitdir=. \
--enable-always-build-examples
-SUBDIRS = src data config doc
+SUBDIRS = src data doc
if HAVE_PO
@@ -470,12 +470,11 @@ lcov-baseline:
lcov-report: lcov-baseline
lcov --capture --compat-libtool --no-external --output-file $(abs_top_builddir)/coverage/coverage-check.info --directory $(abs_top_builddir) --config-file .lcov-config
lcov --no-external --compat-libtool --add-tracefile $(abs_top_builddir)/coverage/coverage-baseline.info --add-tracefile $(abs_top_builddir)/coverage/coverage-check.info --output-file $(abs_top_builddir)/coverage/coverage.info --config-file .lcov-config
- lcov --no-external --compat-libtool --remove $(abs_top_builddir)/coverage/coverage.info '*.h' --output-file $(abs_top_builddir)/coverage/coverage.cleaned.info --config-file .lcov-config
- lcov --no-external --compat-libtool --remove $(abs_top_builddir)/coverage/coverage.cleaned.info '*/tests/*' --output-file $(abs_top_builddir)/coverage/coverage.cleaned2.info --config-file .lcov-config
- lcov --no-external --compat-libtool --remove $(abs_top_builddir)/coverage/coverage.cleaned2.info '*NONE*' --output-file $(abs_top_builddir)/coverage/coverage.cleaned3.info --config-file .lcov-config
- lcov --no-external --compat-libtool --remove $(abs_top_builddir)/coverage/coverage.cleaned3.info '*/doc/*' --output-file $(abs_top_builddir)/coverage/coverage.cleaned4.info --config-file .lcov-config
- lcov --no-external --compat-libtool --remove $(abs_top_builddir)/coverage/coverage.cleaned4.info '*usr/include*' --output-file $(abs_top_builddir)/coverage/coverage.cleaned5.info --config-file .lcov-config
- genhtml --config-file .lcov-config --legend -t "$(PACKAGE_STRING)" -o $(abs_top_builddir)/coverage/html $(abs_top_builddir)/coverage/coverage.cleaned5.info
+ lcov --no-external --compat-libtool --remove $(abs_top_builddir)/coverage/coverage.info \
+ '*.h' '*/tests/*' '*NONE*' '*/doc/*' '*usr/include*' '*/bin*' '*/edje_external*' \
+ '*/generic/*' '*/modules/*' '*/static_libs/*' \
+ --output-file $(abs_top_builddir)/coverage/coverage.cleaned.info --config-file .lcov-config
+ genhtml --config-file .lcov-config --legend -t "$(PACKAGE_STRING)" -o $(abs_top_builddir)/coverage/html $(abs_top_builddir)/coverage/coverage.cleaned.info
@echo "Coverage Report at $(abs_top_builddir)/coverage/html"
endif
diff --git a/NEWS b/NEWS
index 4c531e9a7e..6a918692bc 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,455 @@
==========
-EFL 1.20.0
+EFL 1.21.0
==========
+Changes since 1.20.0:
+---------------------
+
+Features:
+
+ * evas: Make all EO canvas objects visible by default
+ * Eo: Allow multiple functions overrides (T5580)
+ * eo: Add debug_name read-only property to ease debugging
+ * evas/edje/elm: Override debug_name in core classes
+ * wayland: add efl-hints protocol for setting aspect on surfaces
+ * efl-wl: support min/max hinting
+ * efl-wl: add handling for external protocol interfaces
+ * edje - add embryo echo command for debugging
+ * layout: Implement missing edje APIs (T5315)
+ * ecore-wl2: Add support for Window Iconify State Change
+ * ecore-evas-wayland: Add handler for Iconify State Change event
+ * efl: Introduce Efl.Ui.Direction interface (T5870)
+ * Efl.Ui.Panes: implement allow_user_size_hints on parts (T5359)
+ * Efl.Ui.Panes: rename left/right_size_set to split_ratio (T5359)
+ * efl-wl: add EFL_WL_DEBUG env variable for enabling wayland debug
+ * efl-wl: add functionality for extracting surfaces for external use
+ * elput: Add API to set pointer acceleration speed (T4736)
+ * ecore-drm2: Add API function to allow setting pointer acceleration speed (T4736)
+ * ecore-drm2: Add API to allow setting pointer acceleration profile (T4736)
+ * Introduce text on path widget
+ * eina: Add convenience eina_rectangle_equal
+ * evas textblock: support ZWJ, ZWNJ, LRM, RLM in escaped form
+ * evas: Add EO API to get clipper in smart object
+ * evas: Add group_member_is to smart objects
+ * efl: Introduce Eina.Rect and switch EO APIs to it
+ * efl_ui_image: add new scale type: EFL_UI_IMAGE_SCALE_TYPE_TILE
+ * Canvas text async: add async layout functionality
+ * Ui text: add Efl.Ui.Text_Async object
+ * edje: Add part_type_get API
+ * ecore exe - add an "isolate io"f lag for sending io to /dev/null
+ * evas: Add scale feature for embedded bitmap fonts.
+ * eo_debug: Enable logging of all ref/unref
+ * eo: Add API to allow deletion by unref
+ * Efl text: add Efl.Text.Markup interface
+ * evas: Implement support for different H/V font DPI
+ * elm_config: add offline and powersave config members
+ * efl_wl: add function for returning the evas object for an extracted surface
+ * wayland: add support for efl weight hint propagation from elm_win to efl_wl
+ * evas textblocke: add align=end for putting a text at the opposite side of LTR/RTL
+ * eina: eina_value - Add "struct tm" support (T6204)
+ * edje_cc - add offset_scale/offscale per desc to allow offsets to scale
+ * Genlist Item Pin Feature (T6241)
+ * saver/svg: parse loaded tree data into svg XML file and save it
+ * build: improve configure accessibility
+ * eolian: Add API's for part enumeration
+ * evas filters: Add "alphaonly" flag for blend and blur
+ * elm: Add "shadow" part to all widgets
+ * efl-wl: add function to get the parent of an extracted surface
+ * ecore_imf: Add transaction start and end event callback
+ * entry: Add autofill hint
+ * eo: Add "destruct" event
+ * efl-wl: move to xdg-shell vfinal
+ * wayland: add xdg-shell vfinal support for client-side
+ * Canvas image: add Efl.Canvas.Text.Factory + use in Ui.Text
+ * efl-wl: add functionality for directly passing through xkb objects
+ * ecore-x: add more info to Ecore_X_Event_Xkb event
+ * ecore-x: add some useful xkb function wrappers
+ * eolian: deferred parsing of inherits + better static checks
+ * ecore: add function for prepending an event handler
+ * efl-wl: add functions for managing allowed client pids
+ * efl-wl: add function for passing ecore-exe flags to launched exes
+ * ecore-drm2: Add API functions to get/set output relative mode
+ * efl-wl: send surface enter/leave based on compositor object visibility
+ * ecore-drm2: Add API to get/set which output is relative to another
+ * ecore-drm2: Add API function to retrieve output user data
+ * edje: add ability to reference images from other edje files
+ * eolian: add API to query information about Objects
+ * eolian: clean rollback support
+ * evas: apply fribidi bracket types to show paired bracket properly
+ * efreet: add method for disabling efreetd connection
+ * efl_ui_spin: Added special value feature.
+ * elm_entry: add elm_entry_prediction_hint_hash_set/del API
+ * edje_cc: add option for verifying namespace usage (T6911)
+ * eio: add method for setting the global file polling rate for fallback monitors
+ * eina_debug: add function to reset debug subsystem after fork
+ * eio: add method for determining if a monitor is using the fallback mechanism
+ * edje_cc: add 'skip_namespace_validation' keyword (T7072)
+
+Fixes:
+
+ * ecore-wl2: pass display to aux hint event_adds
+ * ecore-wl2: don't send null set_parent requests for every window
+ * ecore-wl2: sync aux hints after window creation
+ * efl-wl: block connection attempts from unmanaged clients
+ * wayland: fix min/max size setting
+ * efl-wl: do shm pool ref/unref for bm safety
+ * ecore-evas-wayland: update size when size hints are changed
+ * efl-wl: add handling for commit during canvas render
+ * efl-wl: set cursor surface roles
+ * theme: clip start gadget arrow to intended clipper
+ * edje crash with run program references - fix
+ * Allow to override build date (T5495)
+ * elm_win: simplify/fix recalc logic when changing csd
+ * elm_win: set shadow geometry based on borderless state
+ * elementary cursor: remove a warning message from Wayland supports
+ * elm: Add missing undef EAPI to Elementary.h
+ * ecore glib support - if we are not the main ctx owner loop to acquire
+ * evas: Fix crash in E (T5868)
+ * eolian: implement proper return type serialization (T5024)
+ * eo: Check refs in efl_data_scope_safe_get (T5869)
+ * wayland: fix xdg-shell popup windows
+ * efl-wl: use correct accessor method for keyboard resource hash
+ * elm_widget: do not reparent subobjs to top widget for non-elm objects
+ * efl-wl: always dismiss popups on hide
+ * efl-wl: handle case where eglBindWaylandDisplay fails
+ * ecore: always set delete_me before removing fd from poll
+ * efl-wl: initialize seat keymap fd to -1
+ * ecore_evas_extn: Fix socket & plug windows
+ * elm_test: Fail nicely if plug can't connect
+ * evas: make top object returning functions return the top object
+ * theme: handle e dialog sizing when no buttons are present
+ * wayland: fix num/caps lock handling in events (T5737)
+ * elm segment control: delete event cbs on obj delete.
+ * glview: Fix ALWAYS render policy
+ * elm_box: Fix support of aspect hints (T5888)
+ * theme: fix dialog sizing when no buttons are present
+ * edje: Fix warning message
+ * efl_ui_clock: Parses the format recursively.
+ * photocam: Fix key zoom in/out
+ * elm init - fix init seq and quicklaunch as we shut down x before evas
+ * ecore-wl2: normalize axis event values (T5427)
+ * efl-wl: match nested wl seats based on display ordering
+ * elm_win: update opaque region for fake windows
+ * elm_win: check for wayland engine during finalize by checking for wl win
+ * efl_ui_image: maintain geometry for prev image while preloading new image (T5936)
+ * access: Fix crash in ecore
+ * Canvas text: fix non-dirty paragraph width calculation (T5939)
+ * evas: fix invalid return of evas_textgrid_cellrow_get()
+ * eina file - use recursive locks for cache and file to avoid deadlock
+ * eina mmap safety - only map zeropages if it's an eina file that sigbuses
+ * multibuttonentry: Separate selected item and focused item logic.
+ * efl_ui_clock: Add 'O' character to ignore POSIX alternative format in format.
+ * elm focus manager - dont leak child lists when updating focus order (T5800)
+ * elm focus manager - dont leak child lists when updating focus order (T5800)
+ * eina_array: Fix magic checks to return
+ * evas: handle object names with a list hash
+ * evas: fix event grabber child stacking
+ * ecore_exe - fix failed finalize fork to reutrn NULL not ecore_exe_free
+ * evas: proceed glyph iterator to handle next index properly
+ * evas_thread: only join the thread if the thread is still alive (T5245)
+ * filters: Safety++
+ * cxx: generate a constructor with a parent and a lambda function (T5980)
+ * evas: don't search other fonts only for INHERITED script unicodes
+ * edje: Add legacy compatibility code (T5944)
+ * evas box - fix longstanding bug where min size is miscalculated
+ * ecore exe - fix fix malloc fail handling
+ * efl net - adapt to openssl 1.1.0 changes with tls method support
+ * eina: prevent memory corruption in chained mempool
+ * efl net http - fix protocol error handling to not crash and handle it
+ * flip: Fix invalid use of EOAPI in legacy header
+ * eina file: Fix map_populate on the global map
+ * eina file: Ensure populate is safe to call
+ * elm image: Fix async open to avoid multiple mmap
+ * Entry: use _edje_seat_name_get to get the seat
+ * edje: Fix invalid storage of efl_part objects (T6032)
+ * efl po files - fix LTR/RTL translation string to be correct for langs
+ * efl ui layout - handle content unset properly and remove the unset item
+ * hover: Fix hover parts usage
+ * ecore-x: reject successive MappingNotify events if they are identical
+ * elm hoversel - fix alignment in ephoto (T6078)
+ * evas textblock: use primary font's size as minimum size of a line
+ * elm: Fix module load with ELM_RUN_IN_TREE
+ * elm: Properly unregister providers on shutdown
+ * evas: Fix shutdown of async cmd cache
+ * eo: Fix crashes with call cache after init cycle
+ * elm: Delete atspi root object on shutdown
+ * ecore: Reset do_quit when ecore shuts down
+ * elm: Fix shutdown of atspi (unregister handlers)
+ * evas textblock: use main font's ascent/descent as minimum value
+ * evas: Fix dangling references with input devices
+ * eo: Fix unnecessary ERR logs with eo_debug
+ * eo: Allow efl_reuse to be called with a parent
+ * evas ector gl - fix leak of image data on data put (CID1374645)
+ * evas font: check returned value of FcPatternGet function
+ * edje entry: fill content info when text is deleted by imf event
+ * ecore-file: do not emit events when an inotify watch is removed
+ * elput: Fix issue of pointer rotation not being set on startup
+ * eolian-bin: Free previously allocated eina_strbuf (CID1381502)
+ * evas-gl-common: Fix dereference after null check (CID1374272)
+ * evas-gl-image: Fix dereference after null check (CID1374273)
+ * elementary: passing NULL to variadic funtion can be undefined.
+ * eet: wrong comparision to less than zero with unsigned integer.
+ * evas: there is no effect of variable assignment outside the function.
+ * efreet: unsigned int cannot be compared to less than zero.
+ * emotion gst1 - handle null imagwe data returrn and dont crash
+ * eina: same expression on both statement.
+ * eina: comparing less than zero with unsigned long int
+ * emile: comparing less than zero with unsigned interger.
+ * ephysic: comparing with same statement.
+ * evas: there is no effect of variable assignment while clean up.
+ * emotion: Properly unmap video frame
+ * efl_ui_bg: fix ELM_BG_OPTION_CENTER bg in left top side.
+ * edje_cc: fix a memory leak issue when edje_cc writes images
+ * evas gl generic/common - add more linking for gles mode to fix deb build (T6158)
+ * jp2k module - dont print ERR on llading if format wrong
+ * edje_edit: duplicate assignment to variable.
+ * ecore_wayland: fix assigned value is never used.
+ * ecore: remove doxygen warning messages
+ * win: Do not forward all key events on win (legacy) (T6148)
+ * evas: Prevent crash with image_data_get (T5957)
+ * elm_code_widget: make sure the widget is cleared properly. (T6185)
+ * ecore_wl2: Remove just the flush from the idle handler (T6250)
+ * elm_tooltip: set parent window for windowed tooltips
+ * efl_wl: more closely follow wl spec for input regions
+ * efl_wl: destroy extant shell surface upon surface deletion
+ * efl_wl: do not propagate hints to main widget for child surfaces
+ * ecore-wl2: correctly handle configure events on popup surfaces
+ * ecore_cocoa: fix the backspace key
+ * edje_cc: fix errors in documentation
+ * edje_cc: add missing default values to documentation
+ * edje_cc: fix color2 and color3 descriptions
+ * edje_cc: fix state.no_render description
+ * edje_cc: parse "fixed" as bool
+ * edje_cc: fix incorrect type in minmul defaults
+ * edje_cc: fix color_class description
+ * edje_cc: move part_remove and program_remove to group
+ * edje_cc: fix default color_class colors
+ * edje_cc: fix spelling
+ * edje_cc: make bool parsing consistent
+ * edje_cc: make color parsing consistent
+ * edje_cc: move box and table properties documentation
+ * edje_cc: limit map.zoom to non-negative values
+ * edje_cc: fix text.align description
+ * edje_cc: fix program.filter description
+ * edje_cc: fix item.max parsing
+ * edje_cc: fix parsing and documentation
+ * ecore-drm2: Fix issue of not being able to set output mode
+ * Efl.Ui.Radio: remove value{} api
+ * edje: don't return negative width and height from _parts_extends
+ * evas textblock: handle ellipsis when text's height exceed its area by "br"
+ * evas-software-generic: Check for render engine function before calling
+ * evas-wayland-shm: Do not dereference a potentially freed pointer (CID1381707)
+ * emotion: Fix data race condition (CID1381624)
+ * evas-object-main: Fix null dereference (CID1381710)
+ * evas-object-main: Fix null dereference (CID1381711)
+ * evas-object-main: Fix potential null dereference (CID1381713)
+ * evas_vg_cache: load svg from any file, not from defined only
+ * ector: use cairo_pattern_add_color_stop_rgba in gradient_radial
+ * vg_loaders/svg: set up default focal values for radialGradient
+ * efl_gfx_path: fix typo in _path_bounds_get
+ * evas_vg_load_svg: default stop opacity color should be 255, not 0
+ * evas_vg_load_svg: get rid of static Evas_SVG_Parsing
+ * efl ui win - make win centering work with multiple screens (T6323)
+ * eo - fix freeq usage to not use freeq for a vtable cleaning
+ * efl_ui_radio: keep radio state when theme is changed
+ * efl net - handle proxy helper fails better and abort proxy lookups
+ * elput - re-enable switches (power buttons, lid etc.)
+ * elm_code_widget: keep track of visibility.
+ * Ctxpopup: resizing ctxpopup after its content is removed (T6327)
+ * genlist: fix state corruption of content
+ * Efl.Ui.Slider: add default indicator format to %0.2f
+ * elm_genlist: fix rare segfault
+ * elput: Remove unreachable code (CID1382857)
+ * ecore-wl2: Destroy buffer before we exit the buffer_test function
+ * efl_ui_bg: fix unclipped image on EFL_UI_IMAGE_SCALE_TYPE_NONE
+ * eo - by default on 64bit only use 47 bits because of luajit
+ * elm ifrace scrollable - fix uninitialized values on scroll asjust
+ * ecore ipc/con: fix nasty ... they dont mutually exclude
+ * efl_ui_bg: add Efl.Gfx.color_get.
+ * eina_file: make sure we use a stringshare when virtualized. (T6449)
+ * ecore-evas-drm: Check for XDG_SEAT existence (T6455)
+ * efl_ui_text: apply new theme logic and use constructor/destructor
+ * Efl.Ui.Popup.Alert: add message signal process function for scroller size calculation
+ * elementary: Fix resource leak (CID1383549)
+ * elementary: Fix resource leak (CID1383550)
+ * elementary: Fix resource leak (CID1383551)
+ * eina: Fix typo in doxygen
+ * evas: Fix potential crash with draw context
+ * eeze: Don't leak udev enumeration
+ * eeze: Remove unused device variables
+ * eldbus test - del not unref obj as it has a parent ...
+ * eina: fix random segfaults when displaying BT
+ * Elementary: fix makefile ignore efl_ui_theme edc's change
+ * ecore_con: bug workaround SO_REUSEADDR and EADDRINUSE from bind (fix)
+ * elm - scroll manager - fix up momentum animator code to use real consts
+ * elm: fix memleak in combobox
+ * emotion: unset DISPLAY when loading an engine under wayland (T6418)
+ * ecore evas init - init ecore then evas not the other way...
+ * fix evas test suite to now init both ecore and evas.... correctly.
+ * ecore-drm2: Fix enabling outputs
+ * ecore-drm2: return supported rotations if not using hardware
+ * efl-wl: do not modify extracted surface visibility during commit (T6443)
+ * elementary: Remove use of implicit declaration
+ * evas sw generic - don't dlopen osmesa until first needed.
+ * ecore_audio - don't about destruction because of failed sndfile load
+ * elm_tooltip: force immediate hint recalc during tooltip creation if 0x0 size
+ * elm_tooltip: immediately show tooltip if callback is set for obj under pointer
+ * efl-wl: unset cursor role on existing cursor surface if new cursor is set
+ * ecore_audio wasapi - fix ecore win32 handler deletion and destruction (T6607)
+ * efl theme - fix bug in e init splash that would do hide anim 2x (T6619)
+ * efl-wl: send more mouse buttons to clients
+ * efl-wl: propagate surface activation back to parent if child is hidden
+ * efl-wl: set event ON_HOLD flag when they are sent to a surface
+ * efl-wl: remove some broken logic for activating toplevel parents
+ * efl-wl: only send keyboard enter and activation for mapped surfaces
+ * efl-wl: immediately unset a destroyed surface's cursor
+ * efl-wl: only perform mouse-out operations for a seat if the mouse was "in"
+ * wayland: always flush client display when protocol sends are pending
+ * ecore-wl2: correctly translate spacebar keyname into key events (T6620)
+ * ecore-x: perform internal shutdown on io error if callback is set
+ * ecore-x: add more null checks for functions
+ * elementary config: Fix to use ELEMENTARY_BASE_DIR for configure path
+ * ecore-x: filter XkbNewKeyboardNotifyEvent before emitting ecore-x event
+ * ecore-x: re-add implementation of ecore_x_connection_get()
+ * efl-wl: fix no-op of setting keyboard enter on already-entered surface
+ * efl-wl: unset kbd mods changed flag after sending modifiers
+ * ecore: prune existing thread_join callbacks during ecore_fork_reset
+ * edje_cc: make -thread option
+ * Efl.Ui.Image: remove previous image when NULL is set
+ * elm: call ecore_event_init() during init
+ * ecore-file: make monitoring truly fork-safe
+ * eio: make inotify monitors fork-safe
+ * disable async mode (use sync mode) for ibus when keymap changes
+ * ecore-drm2: Ensure output changed event is sent for removed outputs
+ * eio: remove broken pid-based monitor reset copied from ecore-file
+ * ecore-imf: do ecore-x init during ctx creation instead of module init
+ * elm: call ecore_app_args_set() after quicklaunch fork
+ * elm: remove ecore-x init from quicklaunch post-fork
+ * elm progressbar - fix val set (T6697)
+ * efl ui format - fix format checking to be correct (T6697)
+ * edje - entry - fix empty item handling (T6668)
+ * ecore-evas-drm: Use output viewport in ecore_evas_animator_tick calls
+ * evas drm engines: Fix variable type for output
+ * elementary: fix legacy widget type name for backward compat
+ * ecore - fix fd handlers to also set read/write/err flags on hup's
+ * ecore - loop handler - fix wakeup to reslect active flag mask
+ * evas event_grabber: fix child ordering when adding non-top children
+ * elm_datetime: Handle wrong param case for legacy.
+ * elm: set default theme name internally when applying config
+ * efreet_xml: make sure we unmap the right pointer. (T5949)
+ * evas: increase offset by 4 to do work for next map points
+ * efl_ui_multibuttonentry: maintainance legacy function type.
+ * elementary: add missed type for legacy.
+ * elementary: bg - keep file path and key string for legacy bg widget
+ * ecore-wl2: Reduce calls to strlen
+ * ecore-wl2: Check for valid string before passing to strlen()
+ * genlist: fix "insane" order [BUG COMPATIBILITY] (T5938)
+ * efl_ui_clock: Fix wrong target to compare with.
+ * ecore ipc - fix flush to not lose messages
+ * evas: fix Evas Map AA changes the alpha flag of an image issue. (T1975)
+ * eldbus: call ecore_init in eldbus_init
+ * efl selection - fix paste with multiple windows and filter by window
+ * efl selection manager - handle multi window selections properly
+ * evas - plug in dirty + pixels get hold in "is inside" for images (T6791)
+ * elm - selection manager - fix string buffer handling and format types (T6284)
+ * ecore: poll the thread pipe twice during shutdown
+ * ecore: reduce pipe wait time during shutdown
+ * edje: fix potential memory leak.
+ * edje: fix potential memory leak.
+ * ecore: fix a potential memory leak.
+ * ecore ipc - fix send to skip data payload if null/0
+ * evas - loading extension query - fix to not skip small extensions
+ * efl selection manager - fix crashes when doing selections on non-x11
+ * efl selection manager - fix anoyther binary buffer treated as string bug
+ * efl selection - fix entry <-> plain text compy and paste in wl
+ * efl selection - fix another binary buffer treates as string bug
+ * efl selection manager - fix dnd end handling to only handle on dnd
+ * efl selection manager - fix x11 cnp from entry to plain text conversion
+ * edje: Dont append font source if fonts are not embedded in edje
+ * edje edje_cc: fix memory leak.
+ * ecore: fix a potential memory leak.
+ * ecore_wl_dnd: correct wrong variable assignment
+ * elm: resolve possible memory leak.
+ * elm: resolve possible memory leak.
+ * ector cairo: fix a memory leak.
+ * elm: resolve possible memory leak.
+ * elm: resolve possible memory leak.
+ * elementary bg: allow NULL pointers in legacy usage
+ * elementary: fix build on X11.
+ * edje: remove recalc from content_get and text_get
+ * ecore animator, x, vsync ecore evas restore x vsync to work again
+ * evas: fix default return value of image-related legacy functions
+ * edje: fix backward compatibility issue caused by legacy cursor funcs
+ * ecore-evas-win32: set draw_block until the window receives a configure event (T6907)
+ * efl_ui_image: add NULL check in elm_image_memfile_set() function
+ * evas textblock: fix double free issue from user style push/pop and free
+ * Evas textblock: fix wrong hyphenation issues with non UTF8 encoded dictionary (T3221)
+ * edje: return proper value from the function.
+ * elm_multibuttonentry: Fix to install eo header files
+ * edje: Fix to support translation for textblock part
+ * evas textblock: update format nodes when a Evas Textblock Style is updated
+ * evas textblock: manage default style properly for new interfaces
+ * efl_ui_tags: Fixed bug when setting format string.
+ * evas: fix a map rendering problem.
+ * elm_main: call _elm_config_shutdown() after loop_iterate()
+ * efl_ui_win: fix wrong comparison in icon_object_set
+ * elm_interface_scrollable: change return value for post events.
+ * edje: don't give a wrong Edje data when an Edje object has group parts
+ * elm_notify: remove allow_events_set call in destructor
+ * elm_spinner: Spinner value adjust when round enabled.
+ * elementary textpath: update Evas map when text is updated
+ * elementary widget: fix to trigger object signal emit properly. (T6981)
+ * evas engines: do not immediately free native surface when unsetting it (T6970)
+ * edje_cc: fixup edje_collections_lookup hash ids during collection pruning
+ * evas vg: fix broken vg rendering. (T6993)
+ * edje: fix an issue "description.text.text" is not shown (T6997)
+ * evas vg: get rid of memory leak.
+ * ecore_evas: fix crash on free of smart data. (T6974)
+ * eina_barrier: handle PTHREAD_BARRIER_SERIAL_THREAD return from barrier_wait
+ * evas vg: fix broken morphing(interpolation) (T6996)
+ * evas vg: fix another memory leak
+ * efreet: mark efreet_menu_async_parse() deprecated. (T585)
+ * eina_lock: do not set PTHREAD_MUTEX_ERRORCHECK on recursive locks (T1984)
+ * eina_lock: modify mutex debugging to ignore recursive locks
+ * eina_lock: remove locks from eina tracking list on free while thread debugging
+ * eina: disable abort on shutdown when triggered by system monitoring thread
+ * eet: handle decode failures as errors in variant decoding (T5379)
+ * ecore - handle G_IO_ERR conditions for net sockets (T5725)
+ * emotion_generic: clean up event handlers on fork failure
+ * eina_threadqueue: fix spinlock destruction by using spinlock api
+ * eina_threadqueue: add locking for variable used between threads
+ * eina: call eina_threads_init from eina_debug_init
+ * eina: prevent threads subcomponent from being shutdown while eina is active
+ * eina_debug_bt: only enable SIGPROF handler when profiling is enabled (T7028)
+ * Edje load: add safecheck for TEXTBLOCK-specific code path (T6279)
+ * ecore_cocoa: fix ECORE_EVENT_KEY_DOWN/UP on MacOS. (T6944)
+ * efl: Bump required libinput version for Elput
+ * edje: fix text set/get issue without edje calculation
+ * Edje: recalc edje before fetching the real part (T7057)
+ * ecore/thread: track "no_queue" threads (T7041)
+ * ecore_con: make dns resolver thread stop blocking when canceled (T7041)
+ * elm/win: move trigger for "shot" to first pre-render callback (T6929)
+ * eina/lock: add errno wrapping for backtrace() calls in thread debug blocks
+ * ecore/thread: track "no_queue" threads (T7041)
+ * ecore/thread: flush main loop threads during ecore_thread_wait()
+ * eio/fallback: fix fallback shutdown when threads exist
+ * eio/fallback: remove intermediate idler
+ * eio/fallback: fix MODIFY event emission on base path when monitoring (T7042)
+ * eio/fallback: mark all fallback monitors as fallbacks, not just for win32
+ * eio/fallback: do not modify the children hash while iterating it
+ * tests: cancel the timeout timer when cleaning up eio tests
+ * evas map: check render condition more elaborately. (T6975)
+ * Elm label: fix "horizontal_fixed" usage with different styles (T5382)
+ * eet: set parent struct member when adding a child to a parent node (T4600)
+ * Evas font: fix inifinite loop problem for fallback fonts
+ * Evas font: add comparison for fallbacks in evas_font_desc_cmp()
+ * Evas font: simplify fallback parsing step
+ * Evas textblock: clear ellipsis item at start of layout (T6986)
+ * elm_test: fix invalid read in dnd image drop
+ * ecore-con/legacy: kill server with DEL event if a dialer error occurs (T6330)
+ * efreet: use correct path when generating error message about stale efreetd socket (T7045)
+ * eo/base_class: explicitly refuse to set an object as its own parent
+
Changes since 1.19.0:
---------------------
diff --git a/configure.ac b/configure.ac
index c399877c59..182292e06c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
-EFL_VERSION([1], [20], [99], [dev])
-AC_INIT([efl], [efl_version], [enlightenment-devel@lists.sourceforge.net])
+EFL_VERSION([1], [21], [0], [release])
+AC_INIT([efl], [efl_version-alpha1], [enlightenment-devel@lists.sourceforge.net])
AC_PREREQ([2.60])
AC_CONFIG_SRCDIR([configure.ac])
@@ -15,7 +15,7 @@ AH_BOTTOM([
])
-AM_INIT_AUTOMAKE([1.6 dist-xz -Wall color-tests subdir-objects])
+AM_INIT_AUTOMAKE([1.6 dist-xz no-dist-gzip -Wall color-tests subdir-objects])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# Due to a bug in automake 1.14 we need to use this after AM_INIT_AUTOMAKE
@@ -470,7 +470,6 @@ AC_HEADER_TIME
AC_CHECK_HEADERS([ \
execinfo.h \
mcheck.h \
-sys/inotify.h \
sys/signalfd.h \
sys/types.h \
sys/param.h \
@@ -480,7 +479,8 @@ sys/auxv.h \
asm/hwcap.h \
])
-if test "x${have_solaris}" != "xyes" ; then
+if test "x${have_linux}" = "xyes" ; then
+ AC_CHECK_HEADERS([sys/inotify.h])
AC_CHECK_HEADERS([sys/epoll.h])
fi
@@ -689,6 +689,7 @@ pause \
gmtime_r \
pthread_getcpuclockid \
clock_gettime \
+clearenv
])
AC_FUNC_ALLOCA
@@ -1355,6 +1356,13 @@ AC_DEFINE_IF([HAVE_CSHARP], [test "x${want_csharp}" = "xyes"],
[1], [Compiling bindings for C Sharp])
AC_SUBST([want_csharp])
+if test "x${have_windows}" = "xyes"; then
+ eflmonodlldir="$prefix/bin"
+else
+ eflmonodlldir="$libdir/efl-mono-${EFL_VERSION_MAJOR}"
+fi
+AC_SUBST([eflmonodlldir])
+
# Efl Mono
EFL_LIB_START_OPTIONAL([Efl_Mono], [test "x${want_csharp}" = "xyes"])
@@ -1445,7 +1453,15 @@ AC_SUBST([CUSTOM_EXPORTS_MONO_DL_MONO])
# Eos file/library mapping
# Unescaped sed pattern: sed -n 's/src\/lib\/\([a-z0-9_]*\)\/[a-z\/]*\/\([a-z0-9\._]*\)/\2,\1/pg'
-_configure_path=`realpath $0`
+AC_CHECK_PROG([have_realpath], [realpath], [yes], [no])
+if test "x${have_realpath}" = "xyes" ; then
+ _configure_path=`realpath $0`
+else
+ AC_CHECK_PROG([have_readlink], [readlink], [yes], [no])
+ if test "x${have_readlink}" = "xyes" ; then
+ _configure_path=`readlink -f $0`
+ fi
+fi
efl_mono_top_srcdir=`dirname ${_configure_path}`
EFL_MONO_LIBRARY_MAP=`find ${efl_mono_top_srcdir}/src/lib/ -iname "*\.eo" | sed -n 's/.*\/src\/lib\/\(@<:@a-z0-9_@:>@*\)@<:@\/a-z@:>@*\/\(@<:@a-z0-9\._@:>@*\)/\2,\1/pg'`
@@ -2141,7 +2157,7 @@ AC_ARG_ENABLE([wayland],
[want_wayland="no"])
if test "${want_wayland}" = "yes"; then
- EFL_PKG_CHECK_STRICT([wayland-client >= 1.11.0 wayland-scanner >= 1.11.0 wayland-protocols >= 1.9])
+ EFL_PKG_CHECK_STRICT([wayland-client >= 1.11.0 wayland-scanner >= 1.11.0 wayland-protocols >= 1.12])
PKG_CHECK_MODULES([WAYLAND], [wayland-scanner >= 1.11.0],
[
AC_ARG_VAR([wayland_scanner], [The wayland-scanner executable])
@@ -3807,6 +3823,7 @@ EFL_OPTIONAL_INTERNAL_DEPEND_PKG([EFL_WL], [${want_x11_any}], [ecore_x])
EFL_DEPEND_PKG([EFL_WL], [WAYLAND],
[wayland-server >= 1.11.0 xkbcommon >= 0.6.0])
+EFL_OPTIONAL_DEPEND_PKG([EFL_WL], [${want_x11_any}], [XKBCOMMONX11], [xkbcommon-x11])
EFL_EVAL_PKGS([EFL_WL])
@@ -3930,7 +3947,7 @@ EFL_INTERNAL_DEPEND_PKG([ELPUT], [eeze])
EFL_INTERNAL_DEPEND_PKG([ELPUT], [eo])
EFL_INTERNAL_DEPEND_PKG([ELPUT], [eina])
-EFL_DEPEND_PKG([ELPUT], [LIBINPUT], [libinput >= 1.6.0 xkbcommon >= 0.3.0 libudev])
+EFL_DEPEND_PKG([ELPUT], [LIBINPUT], [libinput >= 1.7.0 xkbcommon >= 0.3.0 libudev])
EFL_OPTIONAL_DEPEND_PKG([ELPUT], [${want_systemd}], [SYSTEMD], [libsystemd])
EFL_ADD_FEATURE([ELPUT], [systemd-logind], [${want_systemd}])
@@ -4581,10 +4598,8 @@ EFL_INTERNAL_DEPEND_PKG([ECORE_EVAS], [emile])
ECORE_EVAS_MODULE([extn], [${want_ecore_evas_extn}])
ECORE_EVAS_MODULE([ews], [yes])
ECORE_EVAS_MODULE([fb], [${want_fb}])
-ECORE_EVAS_MODULE([drm], [${want_drm}],
- [EFL_OPTIONAL_INTERNAL_DEPEND_PKG([ECORE_EVAS], [${want_drm}], [ecore-drm2])])
-ECORE_EVAS_MODULE([gl-drm], [${want_gl_drm}],
- [EFL_OPTIONAL_INTERNAL_DEPEND_PKG([ECORE_EVAS], [${want_gl_drm}], [ecore-drm2])])
+ECORE_EVAS_MODULE([drm], [${want_drm}])
+ECORE_EVAS_MODULE([gl-drm], [${want_gl_drm}])
ECORE_EVAS_MODULE([opengl-cocoa], [${want_ecore_evas_gl_cocoa}])
@@ -4754,12 +4769,6 @@ dnl TODO: remove these ifdefs from code!
AC_DEFINE([HAVE_EIO], [1], [Have eio library])
#### End of Eio
-# Eo Id
-if test "x${want_eo_id}" = "xyes" ; then
- AC_DEFINE([HAVE_EO_ID], [1], [Have eo id])
-fi
-
-
#### Efreet
EFL_LIB_START([Efreet])
@@ -4782,6 +4791,7 @@ EFL_INTERNAL_DEPEND_PKG([EFREET], [eo])
EFL_INTERNAL_DEPEND_PKG([EFREET], [efl])
EFL_INTERNAL_DEPEND_PKG([EFREET], [eina])
EFL_INTERNAL_DEPEND_PKG([EFREET], [emile])
+EFL_INTERNAL_DEPEND_PKG([EFREET], [ecore-con])
EFL_INTERNAL_DEPEND_PKG([EFREET], [ecore-ipc])
### Checks for header files
@@ -5552,9 +5562,7 @@ AC_FUNC_ALLOCA
AC_CHECK_FUNCS([geteuid getuid getpwent])
-if test "x${want_quicklaunch}" != "xno"; then
- AC_CHECK_FUNCS([fork clearenv])
-fi
+AC_CHECK_FUNCS([fork clearenv])
build_quicklaunch="no"
if test "x${ac_cv_func_fork}" = "xyes" -a "x${efl_func_dlopen}" = "xyes"; then
@@ -5691,13 +5699,13 @@ esac
AC_CONFIG_FILES([
Makefile
data/Makefile
-config/Makefile
-config/default/Makefile
-config/default/base.src
-config/mobile/Makefile
-config/mobile/base.src
-config/standard/Makefile
-config/standard/base.src
+data/elementary/config/Makefile
+data/elementary/config/default/Makefile
+data/elementary/config/default/base.src
+data/elementary/config/mobile/Makefile
+data/elementary/config/mobile/base.src
+data/elementary/config/standard/Makefile
+data/elementary/config/standard/base.src
doc/Makefile
doc/Doxyfile
doc/previews/Makefile
@@ -5870,8 +5878,6 @@ AC_OUTPUT
#### Info
-EFL_ADD_FEATURE([EO], [eo-id], [${want_eo_id}])
-
case $host_cpu in
i*86|x86_64|amd64)
EFL_ADD_FEATURE([cpu], [mmx], [${build_cpu_mmx}])
@@ -6121,16 +6127,6 @@ if test -n "$CFOPT_WARNING"; then
echo "some functionality as useless, leading to visible application bugs."
echo "_____________________________________________________________________"
fi
- if test "x${want_eo_id}" = "xno"; then
- echo "_____________________________________________________________________"
- echo "Eo's ID abstraction interface is a major safety system that"
- echo "protects code from crashing or misbehaving in many cases. It does"
- echo "come at a slight cost, but the safety and protection is worth it."
- echo "Also by disabling this, you may also introduce security holes in"
- echo "EFL as well as cause all sorts of previously non-existant crashes."
- echo "Seriously reconsider disabling EO ID."
- echo "_____________________________________________________________________"
- fi
if test "x${want_evas_cserve2}" = "xno"; then
echo "_____________________________________________________________________"
echo "Evas Cserve is built and on by default and no testing is done"
diff --git a/data/Makefile.am b/data/Makefile.am
index 8fc26addb3..a326711dc0 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -2,6 +2,7 @@ MAINTAINERCLEANFILES = Makefile.in
EXTRA_DIST =
CLEANFILES =
+SUBDIRS =
########################################################################
# Embryo
@@ -119,6 +120,8 @@ EXTRA_DIST += $(eluafiles_DATA)
# themes
+SUBDIRS += elementary/config
+
elementaryfilesdir = $(datadir)/elementary/themes
elementaryfiles_DATA = elementary/themes/default.edj
CLEANFILES += elementary/themes/default.edj
@@ -128,14 +131,14 @@ include elementary/themes/Makefile.am
elementary/themes/default.edj: elementary/themes/default.edc $(elementary_themes_files) $(efl_ui_themes_files) $(elementary_fdo_files) $(top_builddir)/src/bin/edje/edje_cc${EXEEXT}
$(AM_V_EDJ) \
$(MKDIR_P) elementary/themes/; \
- $(EDJE_CC) $(EDJE_CC_FLAGS) $(EDJE_CC_ELM_FLAGS) $< $@
+ $(EDJE_CC) $(EDJE_CC_FLAGS) $(EDJE_CC_ELM_FLAGS) -N $< $@
# desktop files
elementarydesktopdir = $(datadir)/applications
elementarydesktop_DATA = elementary/desktop/elementary_test.desktop elementary/desktop/elementary_config.desktop
-elementaryicondir = $(datadir)/icons
+elementaryicondir = $(datadir)/icons/hicolor/128x128/apps
elementaryicon_DATA = elementary/desktop/elementary.png
EXTRA_DIST += $(elementarydesktop_DATA) $(elementaryicon_DATA)
@@ -177,6 +180,12 @@ elementaryfdo_apps_64_DATA = $(elementary_fdo_apps_64_files)
elementaryfdo_intl_128dir = $(datadir)/icons/Enlightenment-X/intl/128
elementaryfdo_intl_128_DATA = $(elementary_fdo_intl_128_files)
+elementaryfdo_mimetypes_16dir = $(datadir)/icons/Enlightenment-X/mimetypes/16
+elementaryfdo_mimetypes_16_DATA = $(elementary_fdo_mimetypes_16_files)
+
+elementaryfdo_mimetypes_128dir = $(datadir)/icons/Enlightenment-X/mimetypes/128
+elementaryfdo_mimetypes_128_DATA = $(elementary_fdo_mimetypes_128_files)
+
# edje_externals
elementaryedje_externalsdir = $(datadir)/elementary/edje_externals
@@ -220,6 +229,7 @@ elementary/objects/test_prefs.edj \
elementary/objects/test_prefs.epb \
elementary/objects/test_focus_style.edj \
elementary/objects/test_tooltip.edj \
+elementary/objects/test_tab_pager.edj \
$(NULL)
CLEANFILES += $(elementaryobjects_DATA)
@@ -286,3 +296,7 @@ elementary/objects/test_prefs.epb: elementary/objects/test_prefs.epc
$(MKDIR_P) elementary/objects/; \
$(ELM_PREFS_CC) $(ELM_PREFS_FLAGS) $< $@
+elementary/objects/test_tab_pager.edj: elementary/objects/test_tab_pager.edc
+ $(AM_V_EDJ) \
+ $(MKDIR_P) elementary/objects/; \
+ $(EDJE_CC) $(EDJE_CC_FLAGS) $< $@
diff --git a/config/.gitignore b/data/elementary/config/.gitignore
index fb84a6a5b1..fb84a6a5b1 100644
--- a/config/.gitignore
+++ b/data/elementary/config/.gitignore
diff --git a/config/Makefile.am b/data/elementary/config/Makefile.am
index 690067909d..692651353e 100644
--- a/config/Makefile.am
+++ b/data/elementary/config/Makefile.am
@@ -1,7 +1,7 @@
MAINTAINERCLEANFILES = Makefile.in
SUBDIRS = default standard mobile
-include ../src/Makefile_Eet_Helper.am
+include ../../../src/Makefile_Eet_Helper.am
EXTRA_DIST = profile.src
@@ -11,8 +11,8 @@ files_DATA = profile.cfg
%.cfg: %.src
$(AM_V_EET) \
- $(MKDIR_P) $(top_builddir)/config/; \
- $(EET) -i $(top_builddir)/config/$@ config $< 0
+ $(MKDIR_P) $(top_builddir)/data/elementary/config/; \
+ $(EET) -i $(top_builddir)/data/elementary/config/$@ config $< 0
clean-local:
rm -rf *.cfg *~
diff --git a/config/default/Makefile.am b/data/elementary/config/default/Makefile.am
index 6211ff7e1f..3986ae6b20 100644
--- a/config/default/Makefile.am
+++ b/data/elementary/config/default/Makefile.am
@@ -1,6 +1,6 @@
MAINTAINERCLEANFILES = Makefile.in
-include ../../src/Makefile_Eet_Helper.am
+include ../../../../src/Makefile_Eet_Helper.am
EXTRA_DIST = \
profile.desktop \
@@ -15,8 +15,8 @@ files_DATA = \
%.cfg: %.src
$(AM_V_EET) \
- $(MKDIR_P) $(top_builddir)/config/default/; \
- $(EET) -e $(top_builddir)/config/default/$@ config $< 1
+ $(MKDIR_P) $(top_builddir)/data/elementary/config/default/; \
+ $(EET) -e $(top_builddir)/data/elementary/config/default/$@ config $< 1
clean-local:
rm -rf *.cfg *~
diff --git a/config/default/base.src.in b/data/elementary/config/default/base.src.in
index 7e9444c10c..e95d7faadd 100644
--- a/config/default/base.src.in
+++ b/data/elementary/config/default/base.src.in
@@ -1,5 +1,5 @@
group "Elm_Config" struct {
- value "config_version" int: 131087;
+ value "config_version" int: 131089;
value "entry_select_allow" uchar: 1;
value "engine" string: "";
value "vsync" uchar: 0;
@@ -72,6 +72,7 @@ group "Elm_Config" struct {
value "glayer_long_tap_start_timeout" double: 1.2; /* sec to start long-tap */
value "glayer_double_tap_timeout" double: 0.25; /* Timeout between two mouse dows when doing double click (and more). */
value "glayer_continues_enable" uchar: 1; /* Continues gesture enabled */
+ value "glayer_tap_finger_size" int: 10;
value "week_start" int: 1;
value "weekend_start" int: 6;
value "weekend_len" int: 2;
@@ -2327,6 +2328,59 @@ group "Elm_Config" struct {
}
}
}
+ group "Elm_Config_Bindings_Widget" struct {
+ value "name" string: "Efl.Ui.Slider";
+ group "key_bindings" list {
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Left";
+ value "action" string: "drag";
+ value "params" string: "left";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "KP_Left";
+ value "action" string: "drag";
+ value "params" string: "left";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Right";
+ value "action" string: "drag";
+ value "params" string: "right";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "KP_Right";
+ value "action" string: "drag";
+ value "params" string: "right";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Up";
+ value "action" string: "drag";
+ value "params" string: "up";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "KP_Up";
+ value "action" string: "drag";
+ value "params" string: "up";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Down";
+ value "action" string: "drag";
+ value "params" string: "down";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "KP_Down";
+ value "action" string: "drag";
+ value "params" string: "down";
+ }
+ }
+ }
group "Elm_Config_Bindings_Widget" struct {
value "name" string: "Efl.Ui.Slider_Interval";
group "key_bindings" list {
diff --git a/config/default/icon.png b/data/elementary/config/default/icon.png
index 1f33694ace..1f33694ace 100644
--- a/config/default/icon.png
+++ b/data/elementary/config/default/icon.png
Binary files differ
diff --git a/config/default/profile.desktop b/data/elementary/config/default/profile.desktop
index be4045df0b..be4045df0b 100644
--- a/config/default/profile.desktop
+++ b/data/elementary/config/default/profile.desktop
diff --git a/config/mobile/Makefile.am b/data/elementary/config/mobile/Makefile.am
index 7cdfbd5881..2c6c9e2ef7 100644
--- a/config/mobile/Makefile.am
+++ b/data/elementary/config/mobile/Makefile.am
@@ -1,6 +1,6 @@
MAINTAINERCLEANFILES = Makefile.in
-include ../../src/Makefile_Eet_Helper.am
+include ../../../../src/Makefile_Eet_Helper.am
EXTRA_DIST = \
profile.desktop \
@@ -15,8 +15,8 @@ files_DATA = \
%.cfg: %.src
$(AM_V_EET) \
- $(MKDIR_P) $(top_builddir)/config/; \
- $(EET) -e $(top_builddir)/config/mobile/$@ config $< 1
+ $(MKDIR_P) $(top_builddir)/data/elementary/config/; \
+ $(EET) -e $(top_builddir)/data/elementary/config/mobile/$@ config $< 1
clean-local:
rm -rf *.cfg *~
diff --git a/config/mobile/base.src.in b/data/elementary/config/mobile/base.src.in
index 18d3612548..abccea5b14 100644
--- a/config/mobile/base.src.in
+++ b/data/elementary/config/mobile/base.src.in
@@ -1,5 +1,5 @@
group "Elm_Config" struct {
- value "config_version" int: 131087;
+ value "config_version" int: 131089;
value "entry_select_allow" uchar: 1;
value "engine" string: "";
value "vsync" uchar: 0;
@@ -72,6 +72,7 @@ group "Elm_Config" struct {
value "glayer_long_tap_start_timeout" double: 1.2; /* sec to start long-tap */
value "glayer_double_tap_timeout" double: 0.25; /* Timeout between two mouse dows when doing double click (and more). */
value "glayer_continues_enable" uchar: 1; /* Continues gesture enabled */
+ value "glayer_tap_finger_size" int: 10;
value "week_start" int: 1;
value "weekend_start" int: 6;
value "weekend_len" int: 2;
@@ -2332,6 +2333,59 @@ group "Elm_Config" struct {
}
}
group "Elm_Config_Bindings_Widget" struct {
+ value "name" string: "Efl.Ui.Slider";
+ group "key_bindings" list {
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Left";
+ value "action" string: "drag";
+ value "params" string: "left";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "KP_Left";
+ value "action" string: "drag";
+ value "params" string: "left";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Right";
+ value "action" string: "drag";
+ value "params" string: "right";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "KP_Right";
+ value "action" string: "drag";
+ value "params" string: "right";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Up";
+ value "action" string: "drag";
+ value "params" string: "up";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "KP_Up";
+ value "action" string: "drag";
+ value "params" string: "up";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Down";
+ value "action" string: "drag";
+ value "params" string: "down";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "KP_Down";
+ value "action" string: "drag";
+ value "params" string: "down";
+ }
+ }
+ }
+ group "Elm_Config_Bindings_Widget" struct {
value "name" string: "Efl.Ui.Slider_Interval";
group "key_bindings" list {
group "Elm_Config_Binding_Key" struct {
diff --git a/config/mobile/icon.png b/data/elementary/config/mobile/icon.png
index 9e0ed3dac8..9e0ed3dac8 100644
--- a/config/mobile/icon.png
+++ b/data/elementary/config/mobile/icon.png
Binary files differ
diff --git a/config/mobile/profile.desktop b/data/elementary/config/mobile/profile.desktop
index 9ed279a9d0..9ed279a9d0 100644
--- a/config/mobile/profile.desktop
+++ b/data/elementary/config/mobile/profile.desktop
diff --git a/config/profile.src b/data/elementary/config/profile.src
index aa0bc074b6..aa0bc074b6 100644
--- a/config/profile.src
+++ b/data/elementary/config/profile.src
diff --git a/config/standard/Makefile.am b/data/elementary/config/standard/Makefile.am
index 3dd3c88c68..7ab55d0f80 100644
--- a/config/standard/Makefile.am
+++ b/data/elementary/config/standard/Makefile.am
@@ -1,6 +1,6 @@
MAINTAINERCLEANFILES = Makefile.in
-include ../../src/Makefile_Eet_Helper.am
+include ../../../../src/Makefile_Eet_Helper.am
EXTRA_DIST = \
profile.desktop \
@@ -15,8 +15,8 @@ files_DATA = \
%.cfg: %.src
$(AM_V_EET) \
- $(MKDIR_P) $(top_builddir)/config/standard/; \
- $(EET) -e $(top_builddir)/config/standard/$@ config $< 1
+ $(MKDIR_P) $(top_builddir)/data/elementary/config/standard/; \
+ $(EET) -e $(top_builddir)/data/elementary/config/standard/$@ config $< 1
clean-local:
rm -rf *.cfg *~
diff --git a/config/standard/base.src.in b/data/elementary/config/standard/base.src.in
index 9781512539..ae0de27562 100644
--- a/config/standard/base.src.in
+++ b/data/elementary/config/standard/base.src.in
@@ -1,5 +1,5 @@
group "Elm_Config" struct {
- value "config_version" int: 131087;
+ value "config_version" int: 131089;
value "entry_select_allow" uchar: 1;
value "engine" string: "";
value "vsync" uchar: 0;
@@ -73,6 +73,7 @@ group "Elm_Config" struct {
value "glayer_long_tap_start_timeout" double: 1.2; /* sec to start long-tap */
value "glayer_double_tap_timeout" double: 0.25; /* Timeout between two mouse dows when doing double click (and more). */
value "glayer_continues_enable" uchar: 1; /* Continues gesture enabled */
+ value "glayer_tap_finger_size" int: 10;
value "week_start" int: 1;
value "weekend_start" int: 6;
value "weekend_len" int: 2;
@@ -2329,6 +2330,59 @@ group "Elm_Config" struct {
}
}
group "Elm_Config_Bindings_Widget" struct {
+ value "name" string: "Efl.Ui.Slider";
+ group "key_bindings" list {
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Left";
+ value "action" string: "drag";
+ value "params" string: "left";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "KP_Left";
+ value "action" string: "drag";
+ value "params" string: "left";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Right";
+ value "action" string: "drag";
+ value "params" string: "right";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "KP_Right";
+ value "action" string: "drag";
+ value "params" string: "right";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Up";
+ value "action" string: "drag";
+ value "params" string: "up";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "KP_Up";
+ value "action" string: "drag";
+ value "params" string: "up";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Down";
+ value "action" string: "drag";
+ value "params" string: "down";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "KP_Down";
+ value "action" string: "drag";
+ value "params" string: "down";
+ }
+ }
+ }
+ group "Elm_Config_Bindings_Widget" struct {
value "name" string: "Efl.Ui.Slider_Interval";
group "key_bindings" list {
group "Elm_Config_Binding_Key" struct {
diff --git a/config/standard/icon.png b/data/elementary/config/standard/icon.png
index 90b57af47d..90b57af47d 100644
--- a/config/standard/icon.png
+++ b/data/elementary/config/standard/icon.png
Binary files differ
diff --git a/config/standard/profile.desktop b/data/elementary/config/standard/profile.desktop
index 361da2b862..361da2b862 100644
--- a/config/standard/profile.desktop
+++ b/data/elementary/config/standard/profile.desktop
diff --git a/data/elementary/desktop/Makefile.am b/data/elementary/desktop/Makefile.am
index c49fe4e7f9..19d9f8c777 100644
--- a/data/elementary/desktop/Makefile.am
+++ b/data/elementary/desktop/Makefile.am
@@ -4,7 +4,7 @@ MAINTAINERCLEANFILES = Makefile.in
desktopdir = $(datadir)/applications
desktop_DATA = elementary_test.desktop elementary_config.desktop
-icondir = $(datadir)/icons
+icondir = $(datadir)/icons/hicolor/128x128/apps
icon_DATA = elementary.png
EXTRA_DIST = $(desktop_DATA) $(icon_DATA)
diff --git a/data/elementary/images/Makefile.am b/data/elementary/images/Makefile.am
index 6ecc178d52..6f028257cb 100644
--- a/data/elementary/images/Makefile.am
+++ b/data/elementary/images/Makefile.am
@@ -50,7 +50,8 @@ elementary_images_files = \
elementary/images/pm_fill.png \
elementary/images/pt.png \
elementary/images/earth_normal.png \
- elementary/images/space.png
+ elementary/images/space.png \
+ elementary/images/image_items.eet
elementary_images_glayer_files = \
elementary/images/g_layer/double_tap_1.png \
diff --git a/data/elementary/images/image_items.eet b/data/elementary/images/image_items.eet
new file mode 100644
index 0000000000..1db45dfaa3
--- /dev/null
+++ b/data/elementary/images/image_items.eet
Binary files differ
diff --git a/data/elementary/objects/Makefile.am b/data/elementary/objects/Makefile.am
index 1c98813325..ac8391f79a 100644
--- a/data/elementary/objects/Makefile.am
+++ b/data/elementary/objects/Makefile.am
@@ -6,6 +6,7 @@ elementary/objects/test_external.edc \
elementary/objects/test_masking.edc \
elementary/objects/test_prefs.edc \
elementary/objects/test_prefs.epc \
+elementary/objects/test_tab_pager.edc \
elementary/objects/multip.edc \
elementary/objects/cursors.edc \
elementary/objects/font_preview.edc \
diff --git a/data/elementary/objects/test_tab_pager.edc b/data/elementary/objects/test_tab_pager.edc
new file mode 100644
index 0000000000..95715713ae
--- /dev/null
+++ b/data/elementary/objects/test_tab_pager.edc
@@ -0,0 +1,66 @@
+collections {
+ group { "tab_page_layout";
+ parts {
+ spacer { "base";
+ scale;
+ desc { "default";
+ }
+ }
+ swallow { "menu";
+ scale;
+ desc { "default";
+ rel.to: "base";
+ align: 0 0;
+ min: 200 0;
+ max: 200 -1;
+ fixed: 0 1;
+ }
+ }
+ rect { "separator";
+ scale;
+ desc { "default";
+ rel.to: "menu";
+ rel1.relative: 1 0;
+ align: 0 0;
+ min: 1 0;
+ max: 1 -1;
+ fixed: 0 1;
+ color: 75 75 75 255;
+ }
+ }
+ swallow { "tab_pager";
+ scale;
+ desc { "default";
+ rel1.to: "separator";
+ rel2.to: "base";
+ rel1.relative: 1 0;
+ }
+ }
+ }
+ }
+ group { "page_layout";
+ parts {
+ spacer { "base";
+ scale;
+ desc { "default";
+ }
+ }
+ rect { "bg";
+ scale;
+ desc { "default";
+ rel.to: "base";
+ color: 255 255 255 255;
+ }
+ }
+ text { "text";
+ scale;
+ desc { "default";
+ rel.to: "base";
+ align: 0.5 0.5;
+ color: 0 0 0 255;
+ text.size: 20;
+ }
+ }
+ }
+ }
+}
diff --git a/data/elementary/themes/Makefile.am b/data/elementary/themes/Makefile.am
index 74ba32fa63..e6777477ed 100644
--- a/data/elementary/themes/Makefile.am
+++ b/data/elementary/themes/Makefile.am
@@ -149,7 +149,6 @@ elementary/themes/edc/elm/textpath.edc \
elementary/themes/edc/elm/thumb.edc \
elementary/themes/edc/elm/toolbar.edc \
elementary/themes/edc/elm/tooltip.edc \
-elementary/themes/edc/elm/uiclock.edc \
elementary/themes/edc/elm/video.edc \
elementary/themes/edc/elm/win.edc \
\
@@ -1022,23 +1021,32 @@ elementary/themes/edc/efl/uiclock.edc \
elementary/themes/edc/efl/cursor.edc \
elementary/themes/edc/efl/focus.edc \
elementary/themes/edc/efl/frame.edc \
-elementary/themes/edc/efl/multibuttonentry.edc \
+elementary/themes/edc/efl/navigation_bar.edc \
+elementary/themes/edc/efl/navigation_layout.edc \
+elementary/themes/edc/efl/tags.edc \
elementary/themes/edc/efl/nstate.edc \
elementary/themes/edc/efl/panes.edc \
elementary/themes/edc/efl/photocam.edc \
elementary/themes/edc/efl/popup.edc \
+elementary/themes/edc/efl/pointer.edc \
elementary/themes/edc/efl/progress.edc \
elementary/themes/edc/efl/radio.edc \
elementary/themes/edc/efl/scroller.edc \
elementary/themes/edc/efl/slider.edc \
elementary/themes/edc/efl/spin.edc \
elementary/themes/edc/efl/spin_button.edc \
+elementary/themes/edc/efl/datepicker.edc \
+elementary/themes/edc/efl/timepicker.edc \
elementary/themes/edc/efl/text.edc \
elementary/themes/edc/efl/textpath.edc \
elementary/themes/edc/efl/tooltip.edc \
elementary/themes/edc/efl/video.edc \
elementary/themes/edc/efl/list.edc \
-elementary/themes/edc/efl/win.edc
+elementary/themes/edc/efl/win.edc \
+elementary/themes/edc/efl/pager.edc \
+elementary/themes/edc/efl/tab_pager.edc \
+elementary/themes/edc/efl/tab_bar.edc \
+elementary/themes/edc/efl/tab_page.edc
elementary_fdo_actions_128_files = \
elementary/themes/fdo/actions/128/address-book-new.png \
@@ -1492,6 +1500,12 @@ elementary_fdo_intl_128_files = \
elementary/themes/fdo/intl/128/flag-vn.png \
elementary/themes/fdo/intl/128/flag-za.png
+elementary_fdo_mimetypes_16_files = \
+ elementary/themes/fdo/mimetypes/16/inode-directory.png
+
+elementary_fdo_mimetypes_128_files = \
+ elementary/themes/fdo/mimetypes/128/inode-directory.png
+
elementary_fdo_files = \
$(elementary_fdo_actions_128_files) \
@@ -1503,7 +1517,9 @@ elementary_fdo_files = \
$(elementary_fdo_status_128_files) \
$(elementary_fdo_devices_128_files) \
$(elementary_fdo_apps_64_files) \
- $(elementary_fdo_intl_128_files)
+ $(elementary_fdo_intl_128_files) \
+ $(elementary_fdo_mimetypes_16_files) \
+ $(elementary_fdo_mimetypes_128_files)
EXTRA_DIST += $(elementary_themes_files) $(efl_ui_themes_files) $(elementary_fdo_files)
diff --git a/data/elementary/themes/colorclasses.edc b/data/elementary/themes/colorclasses.edc
index bf294bfe1c..0af1fc4875 100644
--- a/data/elementary/themes/colorclasses.edc
+++ b/data/elementary/themes/colorclasses.edc
@@ -208,6 +208,14 @@ color_classes {
color: 0 0 0 0;
desc: "Background of a datetime widget";
}
+ color_class { name: "datepicker_bg";
+ color: 0 0 0 0;
+ desc: "Background of a datepicker widget";
+ }
+ color_class { name: "timepicker_bg";
+ color: 0 0 0 0;
+ desc: "Background of a timepicker widget";
+ }
color_class { name: "datetime_separator_text";
color: FN_COL_DEFAULT;
desc: "Text in a datetime separator area";
@@ -386,6 +394,30 @@ color_classes {
color: FN_COL_DISABLE;
desc: "Text of a disabled multibuttonentry item";
}
+ color_class { name: "tags_bg";
+ color: 0 0 0 0;
+ desc: "Background of a tags widget";
+ }
+ color_class { name: "tags_item_bg";
+ color: 0 0 0 0;
+ desc: "Background of a tags item object";
+ }
+ color_class { name: "tags_item_bg_selected";
+ color: 0 0 0 0;
+ desc: "Background of a selected tags item object";
+ }
+ color_class { name: "tags_item_text";
+ color: FN_COL_DEFAULT;
+ desc: "Text of a tags item";
+ }
+ color_class { name: "tags_item_text_pressed";
+ color: FN_COL_HIGHLIGHT;
+ desc: "Text of a pressed tags item";
+ }
+ color_class { name: "tags_item_text_disabled";
+ color: FN_COL_DISABLE;
+ desc: "Text of a disabled tags item";
+ }
color_class { "elm/win/background";
color: 64 64 64 255;
desc: "Background color of a standard window";
diff --git a/data/elementary/themes/default.edc b/data/elementary/themes/default.edc
index 0b43454863..b48a26b0b2 100644
--- a/data/elementary/themes/default.edc
+++ b/data/elementary/themes/default.edc
@@ -5,6 +5,7 @@ externals.external: "elm";
// theme api version. from 1.10 on we will check version to avoid
// compat issues
data.item: "version" "119";
+data.item: "efl_theme_base" "dark";
collections {
#include "fonts.edc"
@@ -35,7 +36,6 @@ collections {
#include "edc/elm/access.edc"
#include "edc/elm/photo.edc"
#include "edc/elm/focus.edc"
-#include "edc/elm/uiclock.edc"
#include "edc/elm/player.edc"
#include "edc/elm/thumb.edc"
#include "edc/elm/pointer.edc"
@@ -167,10 +167,12 @@ collections {
#include "edc/efl/bg.edc"
#include "edc/efl/button.edc"
#include "edc/efl/calendar.edc"
+#include "edc/efl/navigation_bar.edc"
+#include "edc/efl/navigation_layout.edc"
#include "edc/efl/nstate.edc"
-#include "edc/efl/list.edc"
// XXX: mobile mode needs invisible scrollers... make signals that do this
#include "edc/efl/scroller.edc"
+#include "edc/efl/list.edc"
// XXX: mobile mode needs different entry setup
#include "edc/efl/text.edc"
#include "edc/efl/frame.edc"
@@ -181,16 +183,23 @@ collections {
#include "edc/efl/popup.edc"
#include "edc/efl/video.edc"
#include "edc/efl/focus.edc"
-#include "edc/efl/multibuttonentry.edc"
+#include "edc/efl/tags.edc"
#include "edc/efl/tooltip.edc"
#include "edc/efl/photocam.edc"
#include "edc/efl/progress.edc"
#include "edc/efl/border.edc"
#include "edc/efl/spin.edc"
#include "edc/efl/spin_button.edc"
+#include "edc/efl/datepicker.edc"
+#include "edc/efl/timepicker.edc"
// XXX: min size calc problems - too wide! ... err ok on my 32bit box... eh?
#include "edc/efl/cursor.edc"
+#include "edc/efl/pointer.edc"
#include "edc/efl/textpath.edc"
#include "edc/efl/win.edc"
#include "edc/efl/uiclock.edc"
+#include "edc/efl/pager.edc"
+#include "edc/efl/tab_pager.edc"
+#include "edc/efl/tab_bar.edc"
+#include "edc/efl/tab_page.edc"
}
diff --git a/data/elementary/themes/edc/dialog.edc b/data/elementary/themes/edc/dialog.edc
index 343197df10..907aca29f5 100644
--- a/data/elementary/themes/edc/dialog.edc
+++ b/data/elementary/themes/edc/dialog.edc
@@ -43,7 +43,7 @@ group { name: "e/widgets/dialog/main";
rel1.offset: 4 4;
rel2.relative: 0.0 1.0;
rel2.offset: -1 0;
- rel2.to_y: "button.spacer";
+ rel2.to_y: "button_spacer";
fixed: 1 0;
visible: 0;
}
@@ -58,7 +58,7 @@ group { name: "e/widgets/dialog/main";
rel1.to_x: "base";
rel2.to_x: "base";
rel2.offset: -5 -1;
- rel2.to_y: "button.spacer";
+ rel2.to_y: "button_spacer";
}
description { state: "icon" 0.0;
inherit: "default" 0.0;
@@ -66,7 +66,7 @@ group { name: "e/widgets/dialog/main";
rel1.to_x: "e.swallow.icon";
}
}
- spacer { "button.spacer";
+ spacer { "button_spacer";
desc {
rel2.relative: 1.0 0.0;
rel2.offset: -5 -8;
diff --git a/data/elementary/themes/edc/efl/bg.edc b/data/elementary/themes/edc/efl/bg.edc
index 43547d3033..98c449d79e 100644
--- a/data/elementary/themes/edc/efl/bg.edc
+++ b/data/elementary/themes/edc/efl/bg.edc
@@ -1,11 +1,46 @@
/* bg widget style information
[SWALLOW]
- elm.swallow.rectangle: Used for elm_bg_color_set()
- elm.swallow.background: Used for elm_bg_file_set()
- elm.swallow.content: Used for elm_layout_part_content_set(bg, "overlay", content).
+ efl.rectangle: Used for elm_bg_color_set()
+ efl.background: Used for elm_bg_file_set()
+ efl.content: Used for elm_layout_part_content_set(bg, "overlay", content).
*/
group { "efl/bg";
- inherit: "elm/bg/base/default";
-}
+ data.item: "version" "119";
+ images.image: "bevel_dark_out.png" COMP;
+ parts {
+ part { name: "clipper"; type: RECT;
+ description { state: "default" 0.0;
+ }
+ }
+ part { name: "base"; type: RECT;
+ description { state: "default" 0.0;
+ color_class: "dialog_base";
+ color: 64 64 64 255;
+ }
+ }
+ part { name: "efl.rectangle"; type: SWALLOW;
+ description { state: "default" 0.0;
+ }
+ }
+ part { name: "efl.background"; type: SWALLOW;
+ clip_to: "clipper";
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ }
+ }
+ part { name: "bevel";
+ description { state: "default" 0.0;
+ image.normal: "bevel_dark_out.png";
+ image.border: 1 1 1 1;
+ image.middle: 0;
+ fill.smooth: 0;
+ }
+ }
+ part { name: "efl.content"; type: SWALLOW;
+ description { state: "default" 0.0;
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/data/elementary/themes/edc/efl/border.edc b/data/elementary/themes/edc/efl/border.edc
index 55748268de..1bd5a738ac 100644
--- a/data/elementary/themes/edc/efl/border.edc
+++ b/data/elementary/themes/edc/efl/border.edc
@@ -8,14 +8,1215 @@
*/
group { "efl/border";
- inherit: "elm/border/base/default";
+ images.image: "vgrad_med_lighter.png" COMP;
+ images.image: "vgrad_med_dark.png" COMP;
+ images.image: "bevel_out.png" COMP;
+ images.image: "shine.png" COMP;
+ images.image: "bevel_dark_out.png" COMP;
+ images.image: "sym_close_dark_normal.png" COMP;
+ images.image: "sym_close_dark_selected.png" COMP;
+ images.image: "sym_close_light_normal.png" COMP;
+ images.image: "sym_close_light_selected.png" COMP;
+ images.image: "sym_down_dark_normal.png" COMP;
+ images.image: "sym_down_dark_selected.png" COMP;
+ images.image: "sym_down_light_normal.png" COMP;
+ images.image: "sym_down_light_selected.png" COMP;
+ images.image: "sym_up_dark_normal.png" COMP;
+ images.image: "sym_up_dark_selected.png" COMP;
+ images.image: "sym_up_light_normal.png" COMP;
+ images.image: "sym_up_light_selected.png" COMP;
+ images.image: "glow_round_corners_small.png" COMP;
+ images.image: "knob_round_small_busy.png" COMP;
+ images.image: "screen_circular_shadow.png" COMP;
+ images.image: "win_shadow.png" COMP;
+ data.item: "shadow" "1";
+ data.item: "version" "119";
+ parts {
+ /* opaque region of the window, to inform the compositor */
+ spacer { "efl.spacer.opaque";
+ desc {
+ rel1.to: "top_clip";
+ rel2.to: "bottom_clip";
+ }
+ desc { "max"; inherit: "default"; }
+ }
+ /* covers the entire client contents, excluding the main menu */
+ spacer { "efl.spacer.content";
+ required; // since 1.19
+ desc {
+ rel1.to: "efl.menu";
+ rel1.relative: 0.0 1.0;
+ rel2.to: "efl.keyboard";
+ rel2.relative: 1.0 0.0;
+ }
+ }
+ /* shadow spacer and clipper */
+ spacer { "shadow_spacer";
+ desc { "default";
+ WIN_SHADOW_SPACER;
+ }
+ desc { "hidden";
+ rel1.offset: 0 0;
+ rel2.offset: -1 -1;
+ }
+ }
+ image { "shadow"; nomouse;
+ desc { "default";
+ rel.to: "shadow_spacer";
+ WIN_SHADOW;
+ }
+ desc { "hidden"; inherit: "default"; hid; }
+ }
+ /* window background: solid color */
+ rect { "bg_clip";
+ nomouse;
+ desc { "default";
+ rel1.to: "top_clip";
+ rel1.relative: 0.0 1.0;
+ rel2.to: "bottom_clip";
+ }
+ }
+ rect { "efl.rect.background";
+ required; // @since 1.19
+ clip: "bg_clip";
+ desc { "default";
+ color: 255 255 255 255;
+ color_class: "elm/win/background"; // FIXME: color_class naming scheme
+ visible: 0;
+ }
+ desc { "visible";
+ inherit: "default";
+ visible: 1;
+ }
+ }
+ /* window background: image */
+ swallow { "efl.background";
+ required; // @since 1.19
+ clip: "client_clip";
+ }
+ image { "background_bevel";
+ desc { "default";
+ image {
+ normal: "bevel_dark_out.png";
+ border: 1 1 1 1;
+ middle: 0;
+ }
+ fill.smooth: 0;
+ rel.to: "efl.spacer.content";
+ visible: 0;
+ }
+ desc { "visible";
+ inherit: "default";
+ visible: 1;
+ }
+ }
+ spacer { "indicator_spacer";
+ desc { "default";
+ rel.to: "efl.indicator";
+ }
+ desc { "hidden";
+ rel.to: "top_clip";
+ rel1.relative: 0.0 1.0;
+ align: 0.5 0.0;
+ fixed: 1 1;
+ }
+ }
+
+ /* main menu */
+ rect { "menu_bg";
+ desc { "default";
+ color: 64 64 64 255; // FIXME: color_class
+ align: 0.5 0.0;
+ rel.to: "efl.menu";
+ }
+ }
+ swallow { "efl.menu";
+ required: 1; // since 1.19
+ desc { "default";
+ rel.to: "indicator_spacer";
+ rel1.relative: 0.0 1.0;
+ visible: 0;
+ align: 0.5 0.0;
+ fixed: 1 1;
+ }
+ desc { "visible"; inherit: "default";
+ visible: 1;
+ fixed: 0 1;
+ }
+ }
+
+ /* application contents - spacer and clipper (without main menu) */
+ spacer { "client_spacer";
+ desc { "default";
+ rel1.to: "efl.menu";
+ rel1.relative: 0.0 1.0;
+ rel2.to: "efl.keyboard";
+ rel2.relative: 1.0 0.0;
+ }
+ }
+ rect { "client_clip";
+ nomouse;
+ desc { "default";
+ rel.to: "client_spacer";
+ }
+ }
+
+ /* application contents */
+ swallow { "efl.client";
+ clip: "client_clip";
+ desc { "default";
+ rel.to: "client_spacer";
+ }
+ }
+
+ /* modal window blocker */
+ rect { "rect.blocker";
+ required;
+ desc { "default";
+ rel1.to: "top_clip";
+ rel1.relative: 0.0 1.0;
+ rel2.to: "bottom_clip";
+ rel2.relative: 1.0 0.0;
+ color: 0 0 0 0;
+ hid;
+ }
+ desc { "visible";
+ inherit: "default";
+ color_class: "elm/win/blocker";
+ color: 255 255 255 255;
+ vis;
+ }
+ }
+
+ /* top title bar - spacer and clipper */
+ rect { "top_clip"; //nomouse;
+ desc { "default";
+ rel1.to: "shadow_spacer";
+ rel2.to_y: "title2";
+ rel2.to_x: "shadow_spacer";
+ vis;
+ }
+ desc { "hidden";
+ inherit: "default";
+ rel1.relative: 0.0 0.0;
+ rel2.to: "shadow_spacer";
+ rel2.relative: 1.0 0.0;
+ rel2.offset: -1 -1;
+ max: -1 0;
+ min: 0 0;
+ fixed: 0 1;
+ hid;
+ }
+ }
+ /* top title bar */
+ image { "top"; nomouse;
+ clip: "top_clip";
+ desc { "default";
+ image.normal: "vgrad_med_lighter.png";
+ rel.to: "top_clip";
+ fill.smooth: 0;
+ TILED_HORIZ(120)
+ color_class: "border_frame";
+ }
+ desc { "focused";
+ inherit: "default";
+ image.normal: "vgrad_med_dark.png";
+ color_class: "border_frame_active";
+ }
+ }
+ image { "bevel"; nomouse;
+ clip: "top_clip";
+ desc { "default";
+ image.normal: "bevel_out.png";
+ image.border: 1 1 1 1;
+ image.middle: 0;
+ rel.to: "top_clip";
+ fill.smooth: 0;
+ }
+ }
+ text { "efl.text.title"; nomouse;
+ scale: 1;
+ effect: SHADOW BOTTOM;
+ clip: "top_clip";
+ desc { "default";
+ rel1.relative: 1.0 0.0;
+ rel1.offset: 1 3;
+ rel1.to_x: "event.icon";
+ rel1.to_y: "shadow_spacer";
+ rel2.relative: 0.0 0.0;
+ rel2.offset: -2 3;
+ rel2.to_x: "event.minimize";
+ rel2.to_y: "shadow_spacer";
+ align: 0.5 0.0;
+ color_class: "border_title";
+ color3: 255 255 255 255;
+ text { font: FNBD; size: 10;
+ text_class: "title_bar";
+ align: 0.5 0.0;
+ min: 0 1;
+ }
+ fixed: 0 1;
+ }
+ desc { "focused";
+ inherit: "default";
+ visible: 0;
+ }
+ }
+ text { "title2"; nomouse;
+ scale: 1;
+ effect: SOFT_SHADOW BOTTOM;
+ clip: "top_clip";
+ desc { "default";
+ rel1.relative: 1.0 0.0;
+ rel1.offset: 1 2;
+ rel1.to_x: "event.icon";
+ rel1.to_y: "shadow_spacer";
+ rel2.relative: 0.0 0.0;
+ rel2.offset: -1 2;
+ rel2.to_x: "event.minimize";
+ rel2.to_y: "shadow_spacer";
+ align: 0.5 0.0;
+ color_class: "border_title_active";
+ color3: 255 255 255 255;
+ text { font: FNBD; size: 10;
+ text_source: "efl.text.title";
+ text_class: "title_bar";
+ align: 0.5 0.0;
+ min: 0 1;
+ }
+ fixed: 0 1;
+ visible: 0;
+ }
+ desc { "focused";
+ inherit: "default";
+ visible: 1;
+ }
+ }
+ spacer { "icon";
+ desc { "default";
+ rel1.to: "event.icon";
+ rel2.to: "event.icon";
+ }
+ desc { "bounce1";
+ inherit: "default";
+ rel1.relative: 0.5 0.5;
+ rel2.relative: 0.5 0.5;
+ }
+ desc { "bounce2";
+ inherit: "default";
+ rel1.relative: -0.5 -0.5;
+ rel2.relative: 1.2 1.2;
+ }
+ }
+ swallow { "efl.icon"; nomouse;
+ clip_to: "top_clip";
+ desc { "default";
+ rel1.to: "icon";
+ rel1.relative: 0.15 0.15;
+ rel2.to: "icon";
+ rel2.relative: 0.85 0.85;
+ rel2.offset: 0 0;
+ }
+ }
+ rect { "busy_clip"; nomouse;
+ desc { "default";
+ color: 255 255 255 0;
+ visible: 0;
+ }
+ desc { "hung";
+ inherit: "default";
+ color: 255 255 255 255;
+ visible: 1;
+ }
+ }
+ image { "knob"; nomouse;
+ clip: "busy_clip";
+ desc { "default";
+ fixed: 1 1;
+ image.normal: "knob_round_small_busy.png";
+ aspect: 1.0 1.0; aspect_preference: VERTICAL;
+ max: 20 20;
+ rel1.relative: 1.0 0.0;
+ rel1.offset: 2 -0;
+ rel1.to: "event.icon";
+ rel2.relative: 1.0 1.0;
+ rel2.offset: 2 -1;
+ rel2.to: "event.icon";
+ align: 0.0 0.5;
+ fixed: 1 1;
+ }
+ }
+ image { "knob_spinner"; nomouse;
+ clip: "busy_clip";
+ desc { "default";
+ fixed: 1 1;
+ rel1.to: "knob";
+ rel2.to: "knob";
+ image.normal: "glow_round_corners_small.png";
+ map.on: 1;
+ map.smooth: 1;
+ map.rotation.center: "knob";
+ }
+ desc { "spin";
+ inherit: "default";
+ map.rotation.z: 360;
+ }
+ }
+ rect { "clip1"; nomouse;
+ desc { "default";
+ rel1.to: "top_clip";
+ rel2.to: "top_clip";
+ }
+ desc { "focused";
+ inherit: "default";
+ visible: 0;
+ }
+ }
+ rect { "clip2"; nomouse;
+ desc { "default";
+ rel1.to: "top_clip";
+ rel2.to: "top_clip";
+ visible: 0;
+ }
+ desc { "focused";
+ inherit: "default";
+ visible: 1;
+ }
+ }
+ image { "close1"; nomouse;
+ clip: "clip1";
+ desc { "default";
+ image.normal: "sym_close_dark_normal.png";
+ rel1.to: "event.close";
+ rel2.to: "event.close";
+ min: 15 15;
+ max: 15 15;
+ fixed: 1 1;
+ }
+ desc { "selected";
+ inherit: "default";
+ image.normal: "sym_close_dark_selected.png";
+ }
+ }
+ image { "max1"; nomouse;
+ clip: "clip1";
+ desc { "default";
+ image.normal: "sym_up_dark_normal.png";
+ rel1.to: "event.maximize";
+ rel2.to: "event.maximize";
+ min: 15 15;
+ max: 15 15;
+ fixed: 1 1;
+ }
+ desc { "selected";
+ inherit: "default";
+ image.normal: "sym_up_dark_selected.png";
+ }
+ }
+ image { "min1"; nomouse;
+ clip: "clip1";
+ desc { "default";
+ image.normal: "sym_down_dark_normal.png";
+ rel1.to: "event.minimize";
+ rel2.to: "event.minimize";
+ min: 15 15;
+ max: 15 15;
+ fixed: 1 1;
+ }
+ desc { "selected";
+ inherit: "default";
+ image.normal: "sym_down_dark_selected.png";
+ }
+ }
+ image { "close2"; nomouse;
+ clip: "clip2";
+ desc { "default";
+ image.normal: "sym_close_light_normal.png";
+ rel1.to: "event.close";
+ rel2.to: "event.close";
+ min: 15 15;
+ max: 15 15;
+ fixed: 1 1;
+ }
+ desc { "selected";
+ inherit: "default";
+ image.normal: "sym_close_light_selected.png";
+ }
+ }
+ image { "max2"; nomouse;
+ clip: "clip2";
+ desc { "default";
+ image.normal: "sym_up_light_normal.png";
+ rel1.to: "event.maximize";
+ rel2.to: "event.maximize";
+ min: 15 15;
+ max: 15 15;
+ fixed: 1 1;
+ }
+ desc { "selected";
+ inherit: "default";
+ image.normal: "sym_up_light_selected.png";
+ }
+ }
+ image { "min2"; nomouse;
+ clip: "clip2";
+ desc { "default";
+ image.normal: "sym_down_light_normal.png";
+ rel1.to: "event.minimize";
+ rel2.to: "event.minimize";
+ min: 15 15;
+ max: 15 15;
+ fixed: 1 1;
+ }
+ desc { "selected";
+ inherit: "default";
+ image.normal: "sym_down_light_selected.png";
+ }
+ }
+ rect { "event.icon";
+ desc { "default";
+ rel1.relative: 0.0 0.0;
+ rel1.to: "top_clip";
+ rel2.relative: 0.0 1.0;
+ rel2.to: "top_clip";
+ align: 0.0 0.5;
+ aspect: 1.0 1.0; aspect_preference: VERTICAL;
+ color: 0 0 0 0;
+ }
+ }
+ rect { "event.titlebar";
+ desc { "default";
+ rel1.relative: 1.0 0.0;
+ rel1.to_x: "event.icon";
+ rel1.to_y: "top_clip";
+ rel2.relative: 0.0 1.0;
+ rel2.offset: 0 -1;
+ rel2.to_x: "event.minimize";
+ rel2.to_y: "top_clip";
+ color: 0 0 0 0;
+ }
+ }
+ rect { "event.close";
+ desc { "default";
+ rel.to: "top_clip";
+ rel1.relative: 1.0 0.0;
+ rel2.relative: 1.0 1.0;
+ align: 1.0 0.5;
+ aspect: 1.0 1.0; aspect_preference: VERTICAL;
+ color: 0 0 0 0;
+ }
+ }
+ rect { "event.maximize";
+ desc { "default";
+ rel1.relative: -0.25 0.0;
+ rel1.offset: -1 0;
+ rel1.to_x: "event.close";
+ rel1.to_y: "top_clip";
+ rel2.relative: -0.25 1.0;
+ rel2.to_x: "event.close";
+ rel2.to_y: "top_clip";
+ align: 1.0 0.5;
+ aspect: 1.0 1.0; aspect_preference: VERTICAL;
+ color: 0 0 0 0;
+ }
+ }
+ rect { "event.minimize";
+ desc { "default";
+ rel1.relative: 0.0 0.0;
+ rel1.offset: -1 0;
+ rel1.to_x: "event.maximize";
+ rel1.to_y: "top_clip";
+ rel2.relative: 0.0 1.0;
+ rel2.to_y: "top_clip";
+ rel2.to_x: "event.maximize";
+ align: 1.0 0.5;
+ aspect: 1.0 1.0; aspect_preference: VERTICAL;
+ color: 0 0 0 0;
+ }
+ }
+ rect { "top_resize_clip";
+ clip: "top_clip";
+ desc { "default";
+ rel.to: "top_clip";
+ }
+ desc { "hidden";
+ inherit: "default";
+ hid;
+ }
+ }
+ rect { "efl.event.resize.tl";
+ clip: "top_resize_clip";
+ desc { "default";
+ rel.to: "top_clip";
+ rel2.relative: 0.0 0.0;
+ min: 32 4;
+ align: 0.0 0.0;
+ color: 0 0 0 0;
+ fixed: 1 1;
+ }
+ desc { "hidden"; inherit: "default"; hid; }
+ }
+ rect { "efl.event.resize.t";
+ clip: "top_resize_clip";
+ desc { "default";
+ rel1.relative: 1.0 0.0;
+ rel1.to_y: "top_clip";
+ rel1.to_x: "efl.event.resize.tl";
+ rel2.relative: 0.0 0.0;
+ rel2.to_x: "efl.event.resize.tr";
+ rel2.to_y: "top_clip";
+ min: 0 4;
+ align: 0.5 0.0;
+ color: 0 0 0 0;
+ fixed: 1 1;
+ }
+ desc { "hidden"; inherit: "default"; hid; }
+ }
+ rect { "efl.event.resize.tr";
+ clip: "top_resize_clip";
+ desc { "default";
+ rel.to: "top_clip";
+ rel1.relative: 1.0 0.0;
+ rel2.relative: 1.0 0.0;
+ min: 32 4;
+ align: 1.0 0.0;
+ color: 0 0 0 0;
+ fixed: 1 1;
+ }
+ desc { "hidden"; inherit: "default"; hid; }
+ }
+ /* bottom border - spacer and clipper */
+ swallow { "efl.keyboard";
+ desc { "default";
+ rel.to: "bottom_clip";
+ rel2.relative: 1.0 0.0;
+ align: 0.0 1.0;
+ fixed: 0 1;
+ }
+ }
+ rect { "bottom_clip";
+ desc { "default";
+ rel.to: "shadow_spacer";
+ rel1 { relative: 0.0 1.0; offset: 0 -5; }
+ min: 0 5;
+ fixed: 0 1;
+ }
+ desc { "hidden";
+ inherit: "default";
+ rel1 { relative: 0.0 1.0; offset: 0 0; }
+ min: 0 0;
+ hid;
+ }
+ }
+ rect { "bottom";
+ nomouse;
+ desc { "default";
+ color_class: "border_bottom";
+ color: 64 64 64 255; /* FIXME */
+ rel.to: "bottom_clip";
+ }
+ }
+ image { "bevel2"; nomouse;
+ clip: "bottom_clip";
+ desc { "default";
+ image.normal: "bevel_dark_out.png";
+ image.border: 1 1 1 1;
+ image.middle: 0;
+ rel.to: "bottom_clip";
+ fill.smooth: 0;
+ }
+ }
+ rect { "efl.event.resize.bl";
+ clip: "bottom_clip";
+ desc { "default";
+ rel1.relative: 0.0 1.0;
+ rel1.to: "bottom_clip";
+ rel2.relative: 0.0 1.0;
+ rel2.to: "bottom_clip";
+ min: 32 5;
+ align: 0.0 1.0;
+ color: 0 0 0 0;
+ fixed: 1 1;
+ }
+ desc { "hidden"; inherit: "default"; hid; }
+ }
+ rect { "efl.event.resize.b";
+ clip: "bottom_clip";
+ desc { "default";
+ rel1.relative: 1.0 1.0;
+ rel1.to_x: "efl.event.resize.tl";
+ rel1.to_y: "bottom_clip";
+ rel1.offset: 0 -1;
+ rel2.relative: 0.0 1.0;
+ rel2.to_x: "efl.event.resize.tr";
+ rel2.to_y: "bottom_clip";
+ min: 0 5;
+ align: 0.5 1.0;
+ color: 0 0 0 0;
+ fixed: 0 1;
+ }
+ desc { "hidden"; inherit: "default"; hid; }
+ }
+ rect { "efl.event.resize.br";
+ clip: "bottom_clip";
+ desc { "default";
+ rel1.relative: 1.0 1.0;
+ rel1.to: "bottom_clip";
+ rel2.relative: 1.0 1.0;
+ rel2.to: "bottom_clip";
+ min: 32 5;
+ align: 1.0 1.0;
+ color: 0 0 0 0;
+ fixed: 1 1;
+ }
+ desc { "hidden"; inherit: "default"; hid; }
+ }
+ /* top title bar decoration */
+ image { "shine"; nomouse;
+ clip: "top_clip";
+ desc { "default";
+ image.normal: "shine.png";
+ rel.to: "top_clip";
+ rel1.offset: 0 -2;
+ rel2.relative: 1.0 0.0;
+ rel2.offset: -1 2;
+ FIXED_SIZE(69, 5)
+ }
+ }
+ rect { "indicator_bg";
+ clip: "bg_clip";
+ desc { "default";
+ color: 148 23 45 255;
+ rel.to: "efl.indicator";
+ }
+ desc { "bg_transparent";
+ inherit: "default";
+ color: 0 0 0 0;
+ }
+ }
+ swallow { "efl.indicator";
+ clip: "bg_clip";
+ desc { "default";
+ rel.to: "top_clip";
+ rel1.relative: 0.0 1.0;
+ visible: 0;
+ align: 0.5 0.0;
+ fixed: 1 1;
+ }
+ desc { "visible"; inherit: "default";
+ visible: 1;
+ fixed: 0 1;
+ }
+ desc { "hidden"; inherit: "visible";
+ align: 0.5 1.0;
+ }
+ }
+ }
+
+#define BORDERLESS 1
+#define MAXIMIZED 2
+#define UNRESIZABLE 4
+#define SET_MODE(a) script { new m = get_int(border_mode); m |= (a); set_int(border_mode, m); eval_mode(m); }
+#define UNSET_MODE(a) script { new m = get_int(border_mode); m &= ~(a); set_int(border_mode, m); eval_mode(m); }
+
+#define INDICATOR_TYPE_UNKNOWN 0
+#define INDICATOR_TYPE_BG_OPAQUE 1
+#define INDICATOR_TYPE_BG_TRANSPARENT 2
+#define INDICATOR_TYPE_HIDDEN 3
+
+ programs {
+ script {
+ public border_mode;
+ public indicator_type = 0;
+ public indicator_enabled = 0;
+ public eval_mode(m) {
+ if (m & (BORDERLESS | MAXIMIZED | UNRESIZABLE)) {
+ set_state(PART:"bottom_clip", "hidden", 0.0);
+ set_state(PART:"top_resize_clip", "hidden", 0.0);
+ } else {
+ set_state(PART:"bottom_clip", "default", 0.0);
+ set_state(PART:"top_resize_clip", "default", 0.0);
+ }
+ }
+ }
+ program {
+ signal: "efl,state,borderless,on"; source: "efl";
+ action: STATE_SET "hidden";
+ targets: "top_clip" "bottom_clip";
+ after: "borderless,on";
+ }
+ program { "borderless,on"; SET_MODE(BORDERLESS); }
+ program {
+ signal: "efl,state,borderless,off"; source: "efl";
+ action: STATE_SET "default";
+ targets: "top_clip" "bottom_clip";
+ after: "borderless,off";
+ }
+ program { "borderless,off"; UNSET_MODE(BORDERLESS); }
+ program {
+ signal: "efl,state,unresizable,on"; source: "efl";
+ SET_MODE(UNRESIZABLE);
+ }
+ program {
+ signal: "efl,state,unresizable,off"; source: "efl";
+ UNSET_MODE(UNRESIZABLE);
+ }
+ program {
+ signal: "efl,state,shadow,on"; source: "efl";
+ action: STATE_SET "default";
+ targets: "shadow_spacer" "shadow";
+ }
+ program {
+ signal: "efl,state,shadow,off"; source: "efl";
+ action: STATE_SET "hidden";
+ targets: "shadow_spacer" "shadow";
+ }
+ program {
+ signal: "efl,state,background,solid,on"; source: "efl";
+ action: STATE_SET "visible";
+ target: "efl.rect.background";
+ }
+ program {
+ signal: "efl,state,background,solid,off"; source: "efl";
+ action: STATE_SET "default";
+ target: "efl.rect.background";
+ }
+ program {
+ signal: "efl,state,background,standard,on"; source: "efl";
+ action: STATE_SET "visible";
+ target: "background_bevel";
+ }
+ program {
+ signal: "efl,state,background,standard,off"; source: "efl";
+ action: STATE_SET "default";
+ target: "background_bevel";
+ }
+ program {
+ signal: "efl,action,focus"; source: "efl";
+ action: STATE_SET "focused";
+ target: "top";
+ target: "efl.text.title";
+ target: "title2";
+ target: "clip1";
+ target: "clip2";
+ }
+ program {
+ signal: "efl,action,unfocus"; source: "efl";
+ action: STATE_SET "default";
+ target: "top";
+ target: "efl.text.title";
+ target: "title2";
+ target: "clip1";
+ target: "clip2";
+ }
+ program {
+ signal: "efl,state,urgent"; source: "efl";
+ action: STATE_SET "bounce1";
+ target: "icon";
+ after: "urg1";
+ }
+ program { name: "urg1";
+ action: STATE_SET "bounce2";
+ transition: DECELERATE 0.4;
+ target: "icon";
+ after: "urg2";
+ }
+ program { name: "urg2";
+ action: STATE_SET "bounce1";
+ transition: ACCELERATE 0.3;
+ target: "icon";
+ after: "urg1";
+ }
+ program {
+ signal: "efl,state,not_urgent"; source: "efl";
+ action: STATE_SET "default";
+ target: "icon";
+ }
+ program { name: "spin";
+ signal: "efl,state,hung"; source: "efl";
+ action: STATE_SET "spin";
+ transition: LINEAR 1.0;
+ target: "knob_spinner";
+ after: "spin2";
+ }
+ program { name: "spin2";
+ action: STATE_SET "default";
+ target: "knob_spinner";
+ after: "spin";
+ }
+ program {
+ signal: "efl,state,hung"; source: "efl";
+ action: STATE_SET "hung";
+ transition: SINUSOIDAL 0.25;
+ target: "busy_clip";
+ }
+ program {
+ signal: "efl,state,unhung"; source: "efl";
+ action: STATE_SET "default";
+ transition: SINUSOIDAL 1.0;
+ target: "busy_clip";
+ after: "spin3";
+ }
+ program { name: "spin3";
+ action: ACTION_STOP;
+ target: "spin";
+ target: "spin2";
+ after: "spin4";
+ }
+ program { name: "spin4";
+ action: STATE_SET "default";
+ target: "knob_spinner";
+ }
+
+ /* maximize & unmaximize */
+ program {
+ signal: "efl,state,maximize*"; source: "efl";
+ action: STATE_SET "max";
+ target: "efl.spacer.opaque";
+ }
+ program {
+ signal: "efl,state,maximize*"; source: "efl";
+ SET_MODE(MAXIMIZED);
+ }
+ program {
+ signal: "efl,state,unmaximize*"; source: "efl";
+ action: STATE_SET "default";
+ target: "efl.spacer.opaque";
+ }
+ program {
+ signal: "efl,state,unmaximize*"; source: "efl";
+ UNSET_MODE(MAXIMIZED);
+ }
+
+ /*indicator*/
+ program {
+ signal: "efl,action,show_indicator"; source: "efl";
+ script {
+ set_int(indicator_enabled, 1);
+ }
+ after: "update_indicator";
+ }
+ program {
+ signal: "efl,action,hide_indicator"; source: "efl";
+ script {
+ set_int(indicator_enabled, 0);
+ }
+ after: "update_indicator";
+ }
+ program {
+ signal: "efl,action,indicator,bg_opaque"; source: "efl";
+ script {
+ set_int(indicator_type, INDICATOR_TYPE_BG_OPAQUE);
+ }
+ after: "update_indicator";
+ }
+ program {
+ signal: "efl,action,indicator,bg_transparent"; source: "efl";
+ script {
+ set_int(indicator_type, INDICATOR_TYPE_BG_TRANSPARENT);
+ }
+ after: "update_indicator";
+ }
+ program {
+ signal: "efl,action,indicator,hidden"; source: "efl";
+ script {
+ set_int(indicator_type, INDICATOR_TYPE_HIDDEN);
+ }
+ after: "update_indicator";
+ }
+ program {
+ signal: "efl,action,indicator,show_effect"; source: "efl";
+ action: STATE_SET "visible";
+ transition: DECELERATE 0.2;
+ target: "efl.indicator";
+ }
+ program {
+ signal: "efl,action,indicator,hide_effect"; source: "efl";
+ action: STATE_SET "hidden";
+ transition: DECELERATE 0.2;
+ target: "efl.indicator";
+ }
+ program { name: "update_indicator";
+ script {
+ if (get_int(indicator_enabled)) {
+ if ((get_int(indicator_type) == INDICATOR_TYPE_BG_OPAQUE) ||
+ (get_int(indicator_type) == INDICATOR_TYPE_UNKNOWN)) {
+ set_state(PART:"efl.indicator", "visible", 0.0);
+ set_state(PART:"indicator_spacer", "default", 0.0);
+ set_state(PART:"indicator_bg", "default", 0.0);
+ } else if (get_int(indicator_type) == INDICATOR_TYPE_BG_TRANSPARENT) {
+ set_state(PART:"efl.indicator", "visible", 0.0);
+ set_state(PART:"indicator_spacer", "default", 0.0);
+ set_state(PART:"indicator_bg", "bg_transparent", 0.0);
+ } else if (get_int(indicator_type) == INDICATOR_TYPE_HIDDEN) {
+ set_state(PART:"efl.indicator", "hidden", 0.0);
+ set_state(PART:"indicator_spacer", "hidden", 0.0);
+ set_state(PART:"indicator_bg", "default", 0.0);
+ }
+ } else {
+ set_state(PART:"efl.indicator", "default", 0.0);
+ set_state(PART:"indicator_spacer", "default", 0.0);
+ }
+ }
+ }
+
+ /* application desktop menu */
+ program { name: "show_menu";
+ signal: "efl,action,show_menu"; source: "efl";
+ action: STATE_SET "visible";
+ target: "efl.menu";
+ }
+ program { name: "hide_menu";
+ signal: "efl,action,hide"; source: "efl";
+ action: STATE_SET "default";
+ target: "efl.menu";
+ }
+
+ /* modal windows */
+ program { name: "hide_blocker";
+ signal: "efl,action,hide_blocker"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "rect.blocker";
+ transition: DECELERATE 0.2;
+ }
+ program { name: "show_blocker";
+ signal: "efl,action,show_blocker"; source: "efl";
+ action: STATE_SET "visible" 0.0;
+ target: "rect.blocker";
+ transition: DECELERATE 0.2;
+ }
+
+ /* minimize, maximize & close buttons */
+ program {
+ signal: "mouse,down,*"; source: "event.close";
+ action: STATE_SET "selected";
+ target: "close1";
+ target: "close2";
+ }
+ program {
+ signal: "mouse,up,*"; source: "event.close";
+ action: STATE_SET "default";
+ target: "close1";
+ target: "close2";
+ }
+ program {
+ signal: "mouse,down,*"; source: "event.maximize";
+ action: STATE_SET "selected";
+ target: "max1";
+ target: "max2";
+ }
+ program {
+ signal: "mouse,up,*"; source: "event.maximize";
+ action: STATE_SET "default";
+ target: "max1";
+ target: "max2";
+ }
+ program {
+ signal: "mouse,down,*"; source: "event.minimize";
+ action: STATE_SET "selected";
+ target: "min1";
+ target: "min2";
+ }
+ program {
+ signal: "mouse,up,*"; source: "event.minimize";
+ action: STATE_SET "default";
+ target: "min1";
+ target: "min2";
+ }
+ program {
+ signal: "mouse,down,1"; source: "event.titlebar";
+ action: SIGNAL_EMIT "efl,action,move,start" "efl";
+ }
+ program {
+ signal: "mouse,up,1"; source: "event.titlebar";
+ action: SIGNAL_EMIT "efl,action,move,stop" "efl";
+ }
+ program {
+ signal: "mouse,clicked,1"; source: "event.minimize";
+ action: SIGNAL_EMIT "efl,action,minimize" "efl";
+ }
+ program {
+ signal: "mouse,clicked,1"; source: "event.maximize";
+ action: SIGNAL_EMIT "efl,action,maximize" "efl";
+ }
+ program {
+ signal: "mouse,clicked,1"; source: "event.close";
+ action: SIGNAL_EMIT "efl,action,close" "efl";
+ }
+ program {
+ signal: "mouse,in"; source: "efl.event.resize.t";
+ action: SIGNAL_EMIT "efl,action,resize,show" "efl.event.resize.t";
+ }
+ program {
+ signal: "mouse,out"; source: "efl.event.resize.t";
+ action: SIGNAL_EMIT "efl,action,resize,hide" "efl.event.resize.t";
+ }
+ program {
+ signal: "mouse,down,1"; source: "efl.event.resize.t";
+ action: SIGNAL_EMIT "efl,action,resize,start" "efl.event.resize.t";
+ }
+ program {
+ signal: "mouse,in"; source: "efl.event.resize.b";
+ action: SIGNAL_EMIT "efl,action,resize,show" "efl.event.resize.b";
+ }
+ program {
+ signal: "mouse,out"; source: "efl.event.resize.b";
+ action: SIGNAL_EMIT "efl,action,resize,hide" "efl.event.resize.b";
+ }
+ program {
+ signal: "mouse,down,1"; source: "efl.event.resize.b";
+ action: SIGNAL_EMIT "efl,action,resize,start" "efl.event.resize.b";
+ }
+ program {
+ signal: "mouse,in"; source: "efl.event.resize.tl";
+ action: SIGNAL_EMIT "efl,action,resize,show" "efl.event.resize.tl";
+ }
+ program {
+ signal: "mouse,out"; source: "efl.event.resize.tl";
+ action: SIGNAL_EMIT "efl,action,resize,hide" "efl.event.resize.tl";
+ }
+ program {
+ signal: "mouse,down,1"; source: "efl.event.resize.tl";
+ action: SIGNAL_EMIT "efl,action,resize,start" "efl.event.resize.tl";
+ }
+ program {
+ signal: "mouse,in"; source: "efl.event.resize.tr";
+ action: SIGNAL_EMIT "efl,action,resize,show" "efl.event.resize.tr";
+ }
+ program {
+ signal: "mouse,out"; source: "efl.event.resize.tr";
+ action: SIGNAL_EMIT "efl,action,resize,hide" "efl.event.resize.tr";
+ }
+ program {
+ signal: "mouse,down,1"; source: "efl.event.resize.tr";
+ action: SIGNAL_EMIT "efl,action,resize,start" "efl.event.resize.tr";
+ }
+ program {
+ signal: "mouse,in"; source: "efl.event.resize.bl";
+ action: SIGNAL_EMIT "efl,action,resize,show" "efl.event.resize.bl";
+ }
+ program {
+ signal: "mouse,out"; source: "efl.event.resize.bl";
+ action: SIGNAL_EMIT "efl,action,resize,hide" "efl.event.resize.bl";
+ }
+ program {
+ signal: "mouse,down,1"; source: "efl.event.resize.bl";
+ action: SIGNAL_EMIT "efl,action,resize,start" "efl.event.resize.bl";
+ }
+ program {
+ signal: "mouse,in"; source: "efl.event.resize.br";
+ action: SIGNAL_EMIT "efl,action,resize,show" "efl.event.resize.br";
+ }
+ program {
+ signal: "mouse,out"; source: "efl.event.resize.br";
+ action: SIGNAL_EMIT "efl,action,resize,hide" "efl.event.resize.br";
+ }
+ program {
+ signal: "mouse,down,1"; source: "efl.event.resize.br";
+ action: SIGNAL_EMIT "efl,action,resize,start" "efl.event.resize.br";
+ }
+ program {
+ signal: "mouse,clicked,1"; source: "event.icon";
+ action: SIGNAL_EMIT "efl,action,menu" "efl";
+ }
+ }
}
group { "efl/border/dialog";
- inherit: "elm/border/dialog/default";
+ inherit: "efl/border";
+ parts {
+ text { "efl.text.title";
+ clip: "top_clip";
+ desc { "default";
+ rel2.to_x: "event.close";
+ }
+ desc { "focused";
+ inherit: "default";
+ visible: 0;
+ }
+ }
+ text { "title2";
+ desc { "default";
+ rel2.to_x: "event.close";
+ }
+ desc { "focused";
+ inherit: "default";
+ visible: 1;
+ }
+ }
+ image { "max1";
+ desc { "default";
+ visible: 0;
+ }
+ desc { "selected";
+ visible: 0;
+ }
+ }
+ image { "min1";
+ desc { "default";
+ visible: 0;
+ }
+ desc { "selected";
+ visible: 0;
+ }
+ }
+ image { "max2";
+ desc { "default";
+ visible: 0;
+ }
+ desc { "selected";
+ visible: 0;
+ }
+ }
+ image { "min2";
+ desc { "default";
+ visible: 0;
+ }
+ desc { "selected";
+ visible: 0;
+ }
+ }
+ rect { "event.maximize";
+ desc { "default";
+ visible: 0;
+ }
+ }
+ rect { "event.minimize";
+ desc { "default";
+ visible: 0;
+ }
+ }
+ }
}
group { "efl/border/naviframe";
- inherit: "elm/border/naviframe/default";
+ inherit: "efl/border";
+ images.image: "sym_left_dark_normal.png" COMP;
+ images.image: "sym_left_glow_normal.png" COMP;
+ images.image: "sym_left_light_normal.png" COMP;
+ parts {
+ image { "close1";
+ desc { "default";
+ image.normal: "sym_left_dark_normal.png";
+ }
+ desc { "selected";
+ image.normal: "sym_left_glow_normal.png";
+ }
+ }
+ image { "close2"; nomouse;
+ clip: "clip2";
+ desc { "default";
+ image.normal: "sym_left_light_normal.png";
+ }
+ desc { "selected";
+ image.normal: "sym_left_glow_normal.png";
+ }
+ }
+ }
}
+#undef UNRESIZABLE
+#undef BORDERLESS
+#undef MAXIMIZED
+#undef SET_MODE
+#undef UNSET_MODE
diff --git a/data/elementary/themes/edc/efl/button.edc b/data/elementary/themes/edc/efl/button.edc
index 1fe935b37e..55867d7ceb 100644
--- a/data/elementary/themes/edc/efl/button.edc
+++ b/data/elementary/themes/edc/efl/button.edc
@@ -1,8 +1,783 @@
-group { "efl/button";
- inherit: "elm/button/base/default";
-}
+group { name: "efl/button";
+ images.image: "button_normal.png" COMP;
+ images.image: "button_clicked.png" COMP;
-group { "efl/button:anchor";
- inherit: "elm/button/base/anchor";
+#undef ICON
+#define ICON 1
+#define LABEL 2
+#define MASK 3
+#define DISABLE 4
+#define PRESSED 8
+#define BACKGROUND 16
+ script {
+ public btmode;
+ public eval_mode(m) {
+ new m1 = m & MASK;
+ new d = m & DISABLE;
+ new p = m & PRESSED;
+ new bg = m & BACKGROUND;
+ if (bg) {
+ set_state(PART:"base", "hidden", 0.0);
+ set_state(PART:"efl.background", "visible", 0.0);
+ } else {
+ set_state(PART:"efl.background", "default", 0.0);
+ if (!d) {
+ if (!p)
+ {
+ set_state(PART:"base", "default", 0.0);
+ set_state(PART:"base", "default", 0.0);
+ }
+ else {
+ set_state(PART:"base", "pressed", 0.0);
+ }
+ } else {
+ set_state(PART:"base", "disabled", 0.0);
+ }
+ }
+ if (m1 == (ICON | LABEL)) {
+ if (!d) {
+ set_state(PART:"efl.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
+ set_state(PART:"event", "default", 0.0);
+ if (!p) {
+ set_state(PART:"efl.text", "visible", 0.0);
+ set_state(PART:"icon_clip", "default", 0.0);
+ } else {
+ set_state(PART:"efl.text", "pressed_visible", 0.0);
+ set_state(PART:"icon_clip", "pressed", 0.0);
+ }
+ } else {
+ set_state(PART:"efl.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
+ set_state(PART:"efl.text", "disabled_visible", 0.0);
+ set_state(PART:"icon_clip", "disabled", 0.0);
+ set_state(PART:"event", "disabled", 0.0);
+ }
+ } else if (m1 == (ICON)) {
+ if (!d) {
+ set_state(PART:"efl.content", "icononly", 0.0);
+ set_state(PART:"sizer_content", "icononly", 0.0);
+ set_state(PART:"event", "default", 0.0);
+ set_state(PART:"efl.text", "default", 0.0);
+ if (!p)
+ set_state(PART:"icon_clip", "default", 0.0);
+ else
+ set_state(PART:"icon_clip", "pressed", 0.0);
+ } else {
+ set_state(PART:"efl.content", "icononly", 0.0);
+ set_state(PART:"sizer_content", "icononly", 0.0);
+ set_state(PART:"efl.text", "default", 0.0);
+ set_state(PART:"icon_clip", "disabled", 0.0);
+ set_state(PART:"event", "disabled", 0.0);
+ }
+ } else if (m1 == (LABEL)) {
+ if (!d) {
+ set_state(PART:"efl.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
+ set_state(PART:"icon_clip", "default", 0.0);
+ set_state(PART:"event", "default", 0.0);
+ if (!p)
+ set_state(PART:"efl.text", "textonly", 0.0);
+ else
+ set_state(PART:"efl.text", "pressed_textonly", 0.0);
+ } else {
+ set_state(PART:"efl.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
+ set_state(PART:"efl.text", "disabled_textonly", 0.0);
+ set_state(PART:"icon_clip", "disabled", 0.0);
+ set_state(PART:"event", "disabled", 0.0);
+ }
+ } else {
+ if (!d) {
+ set_state(PART:"efl.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
+ set_state(PART:"icon_clip", "default", 0.0);
+ set_state(PART:"event", "default", 0.0);
+ } else {
+ set_state(PART:"efl.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
+ set_state(PART:"icon_clip", "disabled", 0.0);
+ set_state(PART:"event", "disabled", 0.0);
+ }
+ }
+ }
+ }
+ parts {
+ image { "base";
+ desc { "default";
+ image.normal: "button_normal.png";
+ image.border: 4 4 3 5;
+ image.middle: SOLID;
+ rel1.offset: -1 0;
+ rel2.offset: 0 1;
+ fill.smooth: 0;
+ color_class: "button_bg";
+ }
+ desc { "pressed";
+ inherit: "default";
+ image.normal: "button_clicked.png";
+ image.border: 5 5 4 6;
+ color_class: "button_bg_pressed";
+ }
+ desc { "disabled";
+ inherit: "default";
+ color_class: "button_bg_disabled";
+ }
+ desc { "hidden";
+ inherit: "default";
+ visible: 0;
+ }
+ }
+ swallow { "efl.background"; nomouse;
+ required;
+ desc { "default";
+ rel1.to: "base";
+ rel2.to: "base";
+ visible: 0;
+ }
+ desc { "visible";
+ inherit: "default";
+ visible: 1;
+ }
+ }
+ rect { "icon_clip";
+ desc { "default";
+ color_class: "button_icon";
+ }
+ desc { "pressed";
+ inherit: "default";
+ color_class: "button_icon_pressed";
+ }
+ desc { "disabled";
+ inherit: "default";
+ color_class: "button_icon_disabled";
+ }
+ }
+ swallow { "efl.content"; nomouse;
+ clip_to: "icon_clip";
+ required;
+ desc { "default";
+ fixed: 1 0;
+ align: 0.0 0.5;
+ rel1.offset: 6 5;
+ rel1.to: "base";
+ rel2.relative: 0.0 1.0;
+ rel2.offset: 6 -8;
+ rel2.to: "base";
+ visible: 0;
+ }
+ desc { "visible";
+ inherit: "default";
+ fixed: 1 0;
+ aspect: 1.0 1.0;
+ visible: 1;
+ }
+ desc { "icononly";
+ inherit: "default";
+ fixed: 0 0;
+ align: 0.5 0.5;
+ rel2.relative: 1.0 1.0;
+ rel2.offset: -7 -8;
+ visible: 1;
+ }
+ }
+ text { "sizer_content"; nomouse;
+ scale: 1;
+ desc { "default";
+// fixed: 1 1;
+ visible: 0;
+ text { font: FN; size: 10;
+ min: 0 0;
+ text_class: "button_text";
+ }
+ }
+ desc { "visible";
+ inherit: "default";
+ rel1.to: "efl.content";
+ rel2.to: "efl.content";
+ text {
+ min: 1 1;
+ ellipsis: -1;
+ text: "M";
+ }
+ }
+ desc { "icononly";
+ inherit: "default";
+ rel1.to: "efl.content";
+ rel2.to: "efl.content";
+ text {
+ min: 1 1;
+ ellipsis: -1;
+ text: "M";
+ }
+ }
+ }
+ text { "efl.text"; nomouse;
+ effect: SHADOW BOTTOM;
+ scale;
+ required;
+ desc { "default";
+ rel1.offset: 0 5;
+ rel1.relative: 1.0 0.0;
+ rel1.to_x: "efl.content";
+ rel1.to_y: "base";
+ rel2.offset: -8 -8;
+ rel2.to: "base";
+ color_class: "button_text";
+ color3: 255 255 255 255;
+ text { font: FN; size: 10;
+ align: 0.5 0.5;
+ min: 0 0;
+ text_class: "button";
+ }
+ visible: 0;
+ fixed: 1 1;
+ }
+ desc { "visible";
+ inherit: "default";
+ rel1.offset: 2 5;
+ text.min: 1 1;
+ text.ellipsis: -1;
+ visible: 1;
+ fixed: 0 0;
+ }
+ desc { "pressed_visible";
+ inherit: "default";
+ rel1.offset: 2 5;
+ text.min: 1 1;
+ text.ellipsis: -1;
+ visible: 1;
+ fixed: 0 0;
+ color_class: "button_text_pressed";
+ }
+ desc { "textonly";
+ inherit: "default";
+ text.min: 1 1;
+ text.ellipsis: -1;
+ visible: 1;
+ fixed: 0 0;
+ }
+ desc { "pressed_textonly";
+ inherit: "default";
+ text.min: 1 1;
+ text.ellipsis: -1;
+ visible: 1;
+ fixed: 0 0;
+ color_class: "button_text_pressed";
+ }
+ desc { "disabled_visible";
+ inherit: "default";
+ rel1.offset: 2 5;
+ color_class: "button_text_disabled";
+ color3: 255 255 255 255;
+ text.min: 1 1;
+ text.ellipsis: -1;
+ visible: 1;
+ fixed: 0 0;
+ }
+ desc { "disabled_textonly";
+ inherit: "default";
+ color_class: "button_text_disabled";
+ color3: 255 255 255 255;
+ text.min: 1 1;
+ text.ellipsis: -1;
+ visible: 1;
+ fixed: 0 0;
+ }
+ }
+ rect { "event";
+ desc { "default";
+ color: 0 0 0 0;
+ }
+ desc { "disabled";
+ inherit: "default";
+ visible: 0;
+ }
+ }
+ }
+ programs {
+ program {
+ signal: "mouse,down,1"; source: "event";
+ action: SIGNAL_EMIT "efl,action,press" "efl";
+ after: "button_click_anim";
+ }
+ program { name: "button_click_anim";
+ script {
+ new m = get_int(btmode);
+ m |= PRESSED; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "button_unclick";
+ signal: "mouse,up,1"; source: "event";
+ action: SIGNAL_EMIT "efl,action,unpress" "efl";
+ after: "button_unclick_anim";
+ }
+ program { name: "button_unclick_anim";
+ script {
+ new m = get_int(btmode);
+ m &= ~PRESSED; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "buttonactivate";
+ signal: "efl,anim,activate"; source: "efl";
+ action: STATE_SET "pressed" 0.0;
+ target: "base";
+ after: "button_unpressed_anim";
+ }
+ program { name: "button_unpressed_anim";
+ action: STATE_SET "default" 0.0;
+ in: 0.5 0.0;
+ target: "base";
+ }
+ program {
+ signal: "mouse,clicked,1"; source: "event";
+ action: SIGNAL_EMIT "efl,action,click" "efl";
+ }
+ program { name: "button_text_visible";
+ signal: "efl,state,text,set"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m |= LABEL; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "button_text_hidden";
+ signal: "efl,state,text,unset"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m &= ~LABEL; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "button_icon_visible";
+ signal: "efl,state,content,set"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m |= ICON; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "button_icon_hidden";
+ signal: "efl,state,content,unset"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m &= ~ICON; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "button_background_visible";
+ signal: "efl,state,background,set"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m |= BACKGROUND; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "button_background_hidden";
+ signal: "efl,state,background,unset"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m &= ~BACKGROUND; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "button_state_disabled";
+ signal: "efl,state,disabled"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m |= DISABLE; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "button_state_enabled";
+ signal: "efl,state,enabled"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m &= ~DISABLE; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ }
+#undef ICON
+#undef LABEL
+#undef MASK
+#undef DISABLE
+#undef PRESSED
+#undef BACKGROUND
}
+group { name: "efl/button:anchor";
+ images.image: "horizontal_separated_bar_small_glow.png" COMP;
+#define ICON 1
+#define LABEL 2
+#define MASK 3
+#define DISABLE 4
+ script {
+ public btmode;
+ public eval_mode(m) {
+ new m1 = m & MASK;
+ new d = m & DISABLE;
+ if (m1 == (ICON | LABEL)) {
+ if (!d) {
+ set_state(PART:"efl.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
+ set_state(PART:"efl.text", "visible", 0.0);
+ set_state(PART:"icon_clip", "default", 0.0);
+ set_state(PART:"bar", "default", 0.0);
+ set_state(PART:"event", "default", 0.0);
+ } else {
+ set_state(PART:"efl.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
+ set_state(PART:"efl.text", "disabled_visible", 0.0);
+ set_state(PART:"icon_clip", "disabled", 0.0);
+ set_state(PART:"bar", "disabled", 0.0);
+ set_state(PART:"event", "disabled", 0.0);
+ }
+ } else if (m1 == (ICON)) {
+ if (!d) {
+ set_state(PART:"efl.content", "icononly", 0.0);
+ set_state(PART:"sizer_content", "icononly", 0.0);
+ set_state(PART:"efl.text", "default", 0.0);
+ set_state(PART:"icon_clip", "default", 0.0);
+ set_state(PART:"bar", "default", 0.0);
+ set_state(PART:"event", "default", 0.0);
+ } else {
+ set_state(PART:"efl.content", "icononly", 0.0);
+ set_state(PART:"sizer_content", "icononly", 0.0);
+ set_state(PART:"efl.text", "default", 0.0);
+ set_state(PART:"icon_clip", "disabled", 0.0);
+ set_state(PART:"bar", "disabled", 0.0);
+ set_state(PART:"event", "disabled", 0.0);
+ }
+ } else if (m1 == (LABEL)) {
+ if (!d) {
+ set_state(PART:"efl.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
+ set_state(PART:"efl.text", "textonly", 0.0);
+ set_state(PART:"icon_clip", "default", 0.0);
+ set_state(PART:"bar", "default", 0.0);
+ set_state(PART:"event", "default", 0.0);
+ } else {
+ set_state(PART:"efl.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
+ set_state(PART:"efl.text", "disabled_textonly", 0.0);
+ set_state(PART:"icon_clip", "disabled", 0.0);
+ set_state(PART:"bar", "disabled", 0.0);
+ set_state(PART:"event", "disabled", 0.0);
+ }
+ } else {
+ if (!d) {
+ set_state(PART:"efl.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
+ set_state(PART:"icon_clip", "default", 0.0);
+ set_state(PART:"bar", "default", 0.0);
+ set_state(PART:"event", "default", 0.0);
+ } else {
+ set_state(PART:"efl.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
+ set_state(PART:"icon_clip", "disabled", 0.0);
+ set_state(PART:"bar", "disabled", 0.0);
+ set_state(PART:"event", "disabled", 0.0);
+ }
+ }
+ }
+ }
+ parts {
+ rect { "base";
+ desc { "default";
+ color: 0 0 0 0;
+ }
+ }
+ rect { "icon_clip";
+ desc { "default";
+ }
+ desc { "disabled";
+ inherit: "default";
+ color: 255 255 255 64;
+ }
+ }
+ swallow { "efl.background"; nomouse;
+ desc { "default";
+ rel1.to: "base";
+ rel2.to: "base";
+ visible: 0;
+ }
+ desc { "visible";
+ inherit: "default";
+ visible: 1;
+ }
+ }
+ swallow { "efl.content"; nomouse;
+ clip_to: "icon_clip";
+ desc { "default";
+ fixed: 1 0;
+ align: 0.0 0.5;
+ rel1.offset: 0 4;
+ rel1.to: "base";
+ rel2.relative: 0.0 1.0;
+ rel2.offset: 0 -5;
+ rel2.to: "base";
+ visible: 0;
+ }
+ desc { "visible";
+ inherit: "default";
+ fixed: 1 0;
+ aspect: 1.0 1.0;
+ visible: 1;
+ }
+ desc { "icononly";
+ inherit: "default";
+ fixed: 0 0;
+ align: 0.5 0.5;
+ rel2.relative: 1.0 1.0;
+ rel2.offset: -1 -5;
+ visible: 1;
+ }
+ }
+ text { "sizer_content"; nomouse;
+ scale: 1;
+ desc { "default";
+ visible: 0;
+ text { font: FN; size: 10;
+ min: 0 0;
+ text_class: "button_text";
+ }
+ }
+ desc { "visible";
+ inherit: "default";
+ rel1.to: "efl.content";
+ rel2.to: "efl.content";
+ text {
+ min: 1 1;
+ ellipsis: -1;
+ text: "M";
+ }
+ }
+ desc { "icononly";
+ inherit: "default";
+ rel1.to: "efl.content";
+ rel2.to: "efl.content";
+ text {
+ min: 1 1;
+ ellipsis: -1;
+ text: "M";
+ }
+ }
+ }
+ text { "efl.text"; nomouse;
+ effect: GLOW;
+ scale: 1;
+ desc { "default";
+ rel1.offset: -2 0;
+ rel1.relative: 1.0 0.0;
+ rel1.to_x: "efl.content";
+ rel1.to_y: "base";
+ rel2.offset: -1 -1;
+ rel2.to: "base";
+ color_class: "button_text_anchor";
+ color2: 255 255 255 255;
+ color3: 255 255 255 255;
+ text { font: FN; size: 10;
+ align: 0.5 0.5;
+ min: 0 0;
+ text_class: "button_anchor";
+ }
+ visible: 0;
+ }
+ desc { "visible";
+ inherit: "default";
+ rel1.offset: 0 0;
+ text.min: 1 1;
+ text.ellipsis: -1;
+ visible: 1;
+ }
+ desc { "textonly";
+ inherit: "default";
+ text.min: 1 1;
+ text.ellipsis: -1;
+ visible: 1;
+ }
+ desc { "disabled_visible";
+ inherit: "default";
+ rel1.offset: 0 0;
+ color_class: "button_text_anchor_disabled";
+ text.min: 1 1;
+ text.ellipsis: -1;
+ visible: 1;
+ }
+ desc { "disabled_textonly";
+ inherit: "default";
+ color_class: "button_text_anchor_disabled";
+ text.min: 1 1;
+ text.ellipsis: -1;
+ visible: 1;
+ }
+ }
+ text { "text2"; nomouse;
+ effect: GLOW;
+ scale: 1;
+ desc { "default";
+ fixed: 1 1;
+ rel1.to: "efl.text";
+ rel2.to: "efl.text";
+ color_class: "button_text_anchor";
+ color2: 255 255 255 255;
+ color3: 255 255 255 255;
+ text { font: FN; size: 10;
+ text_source: "efl.text";
+ min: 1 1;
+ ellipsis: -1;
+ text_class: "button_anchor";
+ }
+ visible: 0;
+ }
+ desc { "clicked";
+ inherit: "default";
+ visible: 1;
+ }
+ }
+ image { "bar"; nomouse;
+ desc { "default";
+ image.normal: "horizontal_separated_bar_small_glow.png";
+ image.border: 4 4 4 4;
+ fill.smooth: 0;
+ fixed: 0 1;
+ rel1.relative: 0.0 1.0;
+ rel1.offset: -3 -6;
+ rel2.offset: 2 3;
+ }
+ desc { "disabled";
+ inherit: "default";
+ color: 255 255 255 64;
+ }
+ }
+ image { "bar2"; nomouse;
+ desc { "default";
+ image.normal: "horizontal_separated_bar_small_glow.png";
+ image.border: 4 4 4 4;
+ fill.smooth: 0;
+ rel1.to: "bar";
+ rel2.to: "bar";
+ color: 255 255 255 0;
+ visible: 0;
+ }
+ desc { "clicked";
+ inherit: "default";
+ color: 255 255 255 255;
+ visible: 1;
+ }
+ }
+ rect { "event";
+ desc { "default";
+ color: 0 0 0 0;
+ }
+ desc { "disabled";
+ inherit: "default";
+ visible: 0;
+ }
+ }
+ }
+ programs {
+ program {
+ signal: "mouse,down,1"; source: "event";
+ action: SIGNAL_EMIT "efl,action,press" "efl";
+ after: "button_click_anim";
+ }
+ program { name: "button_click_anim";
+ action: STATE_SET "clicked" 0.0;
+ target: "bar2";
+ target: "text2";
+ }
+ program {
+ signal: "mouse,up,1"; source: "event";
+ action: SIGNAL_EMIT "efl,action,unpress" "efl";
+ after: "button_unclick_anim";
+ }
+ program { name: "button_unclick_anim";
+ action: STATE_SET "default" 0.0;
+ target: "bar2";
+ target: "text2";
+ }
+ program {
+ signal: "efl,anim,activate"; source: "efl";
+ action: STATE_SET "clicked" 0.0;
+ target: "bar2";
+ target: "text2";
+ after: "button_unpressed_anim";
+ }
+ program { name: "button_unpressed_anim";
+ action: STATE_SET "default" 0.0;
+ in: 0.5 0.0;
+ target: "bar2";
+ target: "text2";
+ }
+ program {
+ signal: "mouse,clicked,1"; source: "event";
+ action: SIGNAL_EMIT "efl,action,click" "efl";
+ }
+ program { name: "button_text_visible";
+ signal: "efl,state,text,set"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m |= LABEL; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "button_text_hidden";
+ signal: "efl,state,text,unset"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m &= ~LABEL; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "button_icon_visible";
+ signal: "efl,state,content,set"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m |= ICON; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "button_icon_hidden";
+ signal: "efl,state,content,unset"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m &= ~ICON; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "button_background_visible";
+ signal: "efl,state,background,set"; source: "efl";
+ action: STATE_SET "visible" 0.0;
+ target: "efl.background";
+ }
+ program { name: "button_background_hidden";
+ signal: "efl,state,background,unset"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "efl.background";
+ }
+ program { name: "button_state_disabled";
+ signal: "efl,state,disabled"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m |= DISABLE; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "button_state_enabled";
+ signal: "efl,state,enabled"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m &= ~DISABLE; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ }
+#undef ICON
+#undef LABEL
+#undef MASK
+#undef DISABLE
+}
diff --git a/data/elementary/themes/edc/efl/calendar.edc b/data/elementary/themes/edc/efl/calendar.edc
index 86aee2ce42..5408d44951 100644
--- a/data/elementary/themes/edc/efl/calendar.edc
+++ b/data/elementary/themes/edc/efl/calendar.edc
@@ -41,7 +41,7 @@
color: 0 0 0 0;\
}\
}\
- part { name: "elm,calendar,button"#_sufix",left";\
+ part { name: "efl.calendar.button"#_sufix".left";\
type: SWALLOW;\
scale: 1;\
description { state: "default" 0.0;\
@@ -55,7 +55,7 @@
rel2.to: "right_bt"#_sufix;\
}\
}\
- part { name: "elm,calendar,button"#_sufix",right";\
+ part { name: "efl.calendar.button"#_sufix".right";\
type: SWALLOW;\
scale: 1;\
description { state: "default" 0.0;\
@@ -89,7 +89,7 @@
}
#define CH(_pos) \
- part { name: "ch_"#_pos".base"; type: SPACER; \
+ part { name: "ch_"#_pos"_base"; type: SPACER; \
description { state: "default" 0.0; \
rel1 { \
relative: (_pos % 7 / 7) 0.0; \
@@ -101,13 +101,13 @@
} \
} \
} \
- part { name: "ch_"#_pos".text"; type: TEXT; mouse_events: 0; \
+ part { name: "efl.ch_"#_pos".text"; type: TEXT; mouse_events: 0; \
effect: SHADOW BOTTOM; \
scale: 1; \
- clip_to: "ch_"#_pos".clipper"; \
+ clip_to: "ch_"#_pos"_clipper"; \
description { state: "default" 0.0; \
- rel1.to: "ch_"#_pos".base"; \
- rel2.to: "ch_"#_pos".base"; \
+ rel1.to: "ch_"#_pos"_base"; \
+ rel2.to: "ch_"#_pos"_base"; \
text { font: FN; size: 8; \
min: 1 1; \
ellipsis: -1; \
@@ -116,15 +116,15 @@
color_class: "calendar_weekday_text"; \
} \
} \
- part { name: "ch_"#_pos".clipper"; type: RECT; \
+ part { name: "ch_"#_pos"_clipper"; type: RECT; \
description { state: "default" 0.0; \
- rel1.to: "ch_"#_pos".base"; \
- rel2.to: "ch_"#_pos".base"; \
+ rel1.to: "ch_"#_pos"_base"; \
+ rel2.to: "ch_"#_pos"_base"; \
} \
}
#define CIT(_pos) \
- part { name: "cit_"#_pos".rect"; type: SPACER; \
+ part { name: "cit_"#_pos"_rect"; type: SPACER; \
description { state: "default" 0.0; \
rel1 { \
relative: (_pos % 7 / 7) \
@@ -138,18 +138,18 @@
} \
} \
} \
- part { name: "cit_"#_pos".event"; type: RECT; repeat_events: 1; \
+ part { name: "cit_"#_pos"_event"; type: RECT; repeat_events: 1; \
description { state: "default" 0.0; \
- rel1.to: "cit_"#_pos".rect"; \
- rel2.to: "cit_"#_pos".rect"; \
+ rel1.to: "cit_"#_pos"_rect"; \
+ rel2.to: "cit_"#_pos"_rect"; \
color: 0 0 0 0; \
} \
} \
- part { name: "cit_"#_pos".pat"; mouse_events: 0; \
+ part { name: "cit_"#_pos"_pat"; mouse_events: 0; \
description { state: "default" 0.0; \
- rel1.to: "cit_"#_pos".selected"; \
+ rel1.to: "cit_"#_pos"_selected"; \
rel1.offset: 1 1; \
- rel2.to: "cit_"#_pos".selected"; \
+ rel2.to: "cit_"#_pos"_selected"; \
rel2.offset: -2 -2; \
image.normal: "diagonal_stripes.png"; \
color: 255 255 255 25; \
@@ -162,10 +162,10 @@
visible: 1; \
} \
} \
- part { name: "cit_"#_pos".selected"; mouse_events: 0; \
+ part { name: "cit_"#_pos"_selected"; mouse_events: 0; \
description { state: "default" 0.0; \
- rel1.to: "cit_"#_pos".rect"; \
- rel2.to: "cit_"#_pos".rect"; \
+ rel1.to: "cit_"#_pos"_rect"; \
+ rel2.to: "cit_"#_pos"_rect"; \
image.normal: "outline_glow.png"; \
image.border: 4 4 4 4; \
color_class: "calendar_day_selected"; \
@@ -176,10 +176,10 @@
visible: 1; \
} \
} \
- part { name: "cit_"#_pos".selected2"; mouse_events: 0; \
+ part { name: "cit_"#_pos"_selected2"; mouse_events: 0; \
description { state: "default" 0.0; \
- rel1.to: "cit_"#_pos".rect"; \
- rel2.to: "cit_"#_pos".rect"; \
+ rel1.to: "cit_"#_pos"_rect"; \
+ rel2.to: "cit_"#_pos"_rect"; \
image.normal: "outline_glow.png"; \
image.border: 4 4 4 4; \
color: 255 255 255 128; \
@@ -191,10 +191,10 @@
visible: 1; \
} \
} \
- part { name: "cit_"#_pos".glow"; mouse_events: 0; \
+ part { name: "cit_"#_pos"_glow"; mouse_events: 0; \
description { state: "default" 0.0; \
- rel1.to: "cit_"#_pos".rect"; \
- rel2.to: "cit_"#_pos".rect"; \
+ rel1.to: "cit_"#_pos"_rect"; \
+ rel2.to: "cit_"#_pos"_rect"; \
image.normal: "box_glow.png"; \
image.border: 12 12 12 12; \
image.middle: 0; \
@@ -206,11 +206,11 @@
visible: 1; \
} \
} \
- part { name: "cit_"#_pos".text"; type: TEXTBLOCK; mouse_events: 0; \
+ part { name: "efl.cit_"#_pos".text"; type: TEXTBLOCK; mouse_events: 0; \
scale: 1; \
description { state: "default" 0.0; \
- rel1.to: "cit_"#_pos".rect"; \
- rel2.to: "cit_"#_pos".rect"; \
+ rel1.to: "cit_"#_pos"_rect"; \
+ rel2.to: "cit_"#_pos"_rect"; \
text.style: "efl_ui_calendar_date_style"; \
text.min: 1 1; \
text.ellipsis: -1; \
@@ -224,16 +224,16 @@
text.style: "efl_ui_calendar_date_disabled_style"; \
} \
} \
- part { name: "cit_"#_pos".check"; mouse_events: 0; \
+ part { name: "cit_"#_pos"_check"; mouse_events: 0; \
scale: 1; \
description { state: "default" 0.0; \
fixed: 1 1; \
rel1 { \
- to: "cit_"#_pos".rect"; \
+ to: "cit_"#_pos"_rect"; \
relative: 0.6 0.5; \
} \
rel2 { \
- to: "cit_"#_pos".rect"; \
+ to: "cit_"#_pos"_rect"; \
relative: 0.6 0.5; \
} \
min: 16 16; \
@@ -249,173 +249,173 @@
visible: 1; \
} \
} \
- part { name: "cit_"#_pos".access"; type: RECT; repeat_events: 1; \
+ part { name: "efl.cit_"#_pos".access"; type: RECT; repeat_events: 1; \
description { state: "default" 0.0; \
- rel1.to: "cit_"#_pos".event"; \
- rel2.to: "cit_"#_pos".event"; \
+ rel1.to: "cit_"#_pos"_event"; \
+ rel2.to: "cit_"#_pos"_event"; \
color: 0 0 0 0; \
} \
} \
programs { \
program { \
- name: "cit_"#_pos".go_active"; \
+ name: "cit_"#_pos"_go_active"; \
signal: "cit_"#_pos",selected"; \
- source: "elm"; \
+ source: "efl"; \
action: STATE_SET "selected" 0.0; \
- target: "cit_"#_pos".pat"; \
- target: "cit_"#_pos".selected"; \
+ target: "cit_"#_pos"_pat"; \
+ target: "cit_"#_pos"_selected"; \
} \
program { \
- name: "cit_"#_pos".go_passive"; \
+ name: "cit_"#_pos"_go_passive"; \
signal: "cit_"#_pos",unselected"; \
- source: "elm"; \
+ source: "efl"; \
action: STATE_SET "default" 0.0; \
- target: "cit_"#_pos".pat"; \
- target: "cit_"#_pos".selected"; \
+ target: "cit_"#_pos"_pat"; \
+ target: "cit_"#_pos"_selected"; \
} \
program { \
- name: "cit_"#_pos".focus_highlighted"; \
+ name: "cit_"#_pos"_focus_highlighted"; \
signal: "cit_"#_pos",focused"; \
- source: "elm"; \
+ source: "efl"; \
script { \
set_int(item_focus_enabled, 1); \
set_int(last_focused_item, _pos); \
if (get_int(win_focus_enabled) == 1) \
- set_state(PART:"cit_"#_pos".glow", "focused", 0.0); \
+ set_state(PART:"cit_"#_pos"_glow", "focused", 0.0); \
} \
} \
program { \
- name: "cit_"#_pos".focus_unhighlighed"; \
+ name: "cit_"#_pos"_focus_unhighlighed"; \
signal: "cit_"#_pos",unfocused"; \
- source: "elm"; \
+ source: "efl"; \
script { \
set_int(item_focus_enabled, 0); \
- set_state(PART:"cit_"#_pos".glow", "default", 0.0); \
+ set_state(PART:"cit_"#_pos"_glow", "default", 0.0); \
} \
} \
program { \
- name: "cit_"#_pos".is_today"; \
+ name: "cit_"#_pos"_is_today"; \
signal: "cit_"#_pos",today"; \
- source: "elm"; \
+ source: "efl"; \
action: STATE_SET "today" 0.0; \
- target: "cit_"#_pos".text"; \
+ target: "efl.cit_"#_pos".text"; \
} \
program { \
- name: "cit_"#_pos".not_today"; \
+ name: "cit_"#_pos"_not_today"; \
signal: "cit_"#_pos",not_today"; \
- source: "elm"; \
+ source: "efl"; \
action: STATE_SET "default" 0.0; \
- target: "cit_"#_pos".text"; \
+ target: "efl.cit_"#_pos".text"; \
} \
program { \
- name: "cit_"#_pos".enable"; \
+ name: "cit_"#_pos"_enable"; \
signal: "cit_"#_pos",enable"; \
- source: "elm"; \
+ source: "efl"; \
script { \
new st[31]; \
new Float:vl; \
- get_state(PART:"cit_"#_pos".text", st, 30, vl); \
+ get_state(PART:"efl.cit_"#_pos".text", st, 30, vl); \
if (!strcmp(st, "disabled")) \
- set_state(PART:"cit_"#_pos".text", "default", 0.0); \
+ set_state(PART:"efl.cit_"#_pos".text", "default", 0.0); \
} \
} \
program { \
- name: "cit_"#_pos".disable"; \
+ name: "cit_"#_pos"_disable"; \
signal: "cit_"#_pos",disable"; \
- source: "elm"; \
+ source: "efl"; \
action: STATE_SET "disabled" 0.0; \
- target: "cit_"#_pos".text"; \
+ target: "efl.cit_"#_pos".text"; \
} \
program { \
- source: "cit_"#_pos".clicked"; \
+ source: "cit_"#_pos"_clicked"; \
signal: "mouse,down,1"; \
- source: "cit_"#_pos".event"; \
+ source: "cit_"#_pos"_event"; \
action: STATE_SET "highlighted" 0.0; \
- target: "cit_"#_pos".selected2"; \
+ target: "cit_"#_pos"_selected2"; \
} \
program { \
- source: "cit_"#_pos".clicked"; \
+ source: "cit_"#_pos"_clicked"; \
signal: "mouse,up,1"; \
- source: "cit_"#_pos".event"; \
+ source: "cit_"#_pos"_event"; \
action: STATE_SET "default" 0.0; \
- target: "cit_"#_pos".selected2"; \
+ target: "cit_"#_pos"_selected2"; \
} \
program { \
- source: "cit_"#_pos".clicked"; \
+ source: "cit_"#_pos"_clicked"; \
signal: "mouse,clicked,1"; \
- source: "cit_"#_pos".event"; \
- action: SIGNAL_EMIT "elm,action,selected" #_pos; \
+ source: "cit_"#_pos"_event"; \
+ action: SIGNAL_EMIT "efl,action,selected" #_pos; \
} \
program { \
- name: "cit_"#_pos".clear"; \
+ name: "cit_"#_pos"_clear"; \
signal: "cit_"#_pos",clear"; \
- source: "elm"; \
+ source: "efl"; \
action: STATE_SET "default" 0.0; \
- target: "cit_"#_pos".check"; \
- after: "cit_"#_pos".weekends_clear"; \
- after: "cit_"#_pos".holiday_clear"; \
+ target: "cit_"#_pos"_check"; \
+ after: "cit_"#_pos"_weekends_clear"; \
+ after: "cit_"#_pos"_holiday_clear"; \
} \
program { \
- name: "cit_"#_pos".weekends_clear"; \
+ name: "cit_"#_pos"_weekends_clear"; \
script { \
new st[31]; \
new Float:vl; \
- get_state(PART:"cit_"#_pos".text", st, 30, vl); \
+ get_state(PART:"efl.cit_"#_pos".text", st, 30, vl); \
if (!strcmp(st, "weekend/day1") || !strcmp(st, "weekend/day2")) \
- set_state(PART:"cit_"#_pos".text", "default", 0.0); \
+ set_state(PART:"efl.cit_"#_pos".text", "default", 0.0); \
} \
} \
program { \
- name: "cit_"#_pos".holiday_clear"; \
+ name: "cit_"#_pos"_holiday_clear"; \
script { \
new st[31]; \
new Float:vl; \
- get_state(PART:"cit_"#_pos".text", st, 30, vl); \
+ get_state(PART:"efl.cit_"#_pos".text", st, 30, vl); \
if (!strcmp(st, "holiday")) \
- set_state(PART:"cit_"#_pos".text", "default", 0.0); \
+ set_state(PART:"efl.cit_"#_pos".text", "default", 0.0); \
} \
} \
program { \
- name: "cit_"#_pos".checked"; \
+ name: "cit_"#_pos"_checked"; \
signal: "cit_"#_pos",checked"; \
- source: "elm"; \
+ source: "efl"; \
action: STATE_SET "visible" 0.0; \
- target: "cit_"#_pos".check"; \
+ target: "cit_"#_pos"_check"; \
} \
program { \
- name: "cit_"#_pos".holiday"; \
+ name: "cit_"#_pos"_holiday"; \
signal: "cit_"#_pos",holiday"; \
- source: "elm"; \
+ source: "efl"; \
script { \
new st[31]; \
new Float:vl; \
- get_state(PART:"cit_"#_pos".text", st, 30, vl); \
+ get_state(PART:"efl.cit_"#_pos".text", st, 30, vl); \
if (strcmp(st, "today")) \
- set_state(PART:"cit_"#_pos".text", "holiday", 0.0); \
+ set_state(PART:"efl.cit_"#_pos".text", "holiday", 0.0); \
} \
} \
program { \
- name: "cit_"#_pos".weekend/day1"; \
+ name: "cit_"#_pos"_weekend/day1"; \
signal: "cit_"#_pos",weekend/day1"; \
- source: "elm"; \
+ source: "efl"; \
script { \
new st[31]; \
new Float:vl; \
- get_state(PART:"cit_"#_pos".text", st, 30, vl); \
+ get_state(PART:"efl.cit_"#_pos".text", st, 30, vl); \
if ((strcmp(st, "today")) && (strcmp(st, "holiday")) )\
- set_state(PART:"cit_"#_pos".text", "weekend/day1", 0.0); \
+ set_state(PART:"efl.cit_"#_pos".text", "weekend/day1", 0.0); \
} \
} \
program { \
- name: "cit_"#_pos".weekend/day2"; \
+ name: "cit_"#_pos"_weekend/day2"; \
signal: "cit_"#_pos",weekend/day2"; \
- source: "elm"; \
+ source: "efl"; \
script { \
new st[31]; \
new Float:vl; \
- get_state(PART:"cit_"#_pos".text", st, 30, vl); \
+ get_state(PART:"efl.cit_"#_pos".text", st, 30, vl); \
if ((strcmp(st, "today")) && (strcmp(st, "holiday")) )\
- set_state(PART:"cit_"#_pos".text", "weekend/day2", 0.0); \
+ set_state(PART:"efl.cit_"#_pos".text", "weekend/day2", 0.0); \
} \
} \
}
@@ -446,7 +446,7 @@ group { "efl/calendar";
rel2.offset: -2 -2;
}
}
- part { name: "background"; type: SWALLOW;
+ part { name: "efl.background"; type: SWALLOW;
description { state: "default" 0.0;
rel1.to: "bg";
rel2.to: "bg";
@@ -516,20 +516,20 @@ group { "efl/calendar";
}
programs {
program {
- signal: "elm,action,focus_highlight,show";
- source: "elm";
+ signal: "efl,action,focus_highlight,show";
+ source: "efl";
script {
set_int(win_focus_enabled, 1);
if (get_int(item_focus_enabled) == 1) {
new value[32];
snprintf(value, 32, "cit_%d,focused", get_int(last_focused_item));
- emit(value, "elm");
+ emit(value, "efl");
}
}
}
program {
- signal: "elm,action,focus_highlight,hide";
- source: "elm";
+ signal: "efl,action,focus_highlight,hide";
+ source: "efl";
script {
set_int(win_focus_enabled, 0);
}
@@ -541,11 +541,177 @@ group { "efl/calendar";
#undef CIT
#undef CH
+ group { name: "efl/calendar/inc_button";
+ images.image: "sym_right_light_normal.png" COMP;
+ images.image: "sym_right_glow_normal.png" COMP;
+ images.image: "sym_right_dark_normal.png" COMP;
+ script {
+ public mouse_down = 0;
+ public multi_down = 0;
+ }
+ parts {
+ part { name: "arrow.image";
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 15 15;
+ max: 15 15;
+ color_class: "F032L1";
+ image.normal: "sym_right_light_normal.png";
+ }
+ description { state: "pressed" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "sym_right_glow_normal.png";
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "sym_right_dark_normal.png";
+ }
+ }
+ part { name: "over";
+ type: RECT;
+ repeat_events: 1;
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ }
+ }
+ part { name: "disabler";
+ type: RECT;
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ visible: 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ }
+ programs {
+ program { name: "button_press";
+ signal: "mouse,down,1";
+ source: "over";
+ script {
+ if ((get_int(multi_down) == 0) &&
+ (get_int(mouse_down) == 0)) {
+ set_int(mouse_down, 1);
+ run_program(PROGRAM:"button_press2");
+ }
+ }
+ }
+ program { name: "button_press2";
+ action: SIGNAL_EMIT "efl,action,press" "";
+ after: "button_press_anim";
+ }
+ program { name: "button_press_anim";
+ action: STATE_SET "pressed" 0.0;
+ target: "arrow.image";
+ }
+ program { name: "button_unpress";
+ signal: "mouse,up,1";
+ source: "over";
+ script {
+ if (get_int(mouse_down) == 1) {
+ set_int(mouse_down, 0);
+ run_program(PROGRAM:"button_unpress2");
+ run_program(PROGRAM:"button_unpress_anim");
+ }
+ }
+ }
+ program { name: "button_unpress2";
+ action: SIGNAL_EMIT "efl,action,unpress" "";
+ }
+ program { name: "button_unpress_anim";
+ action: STATE_SET "default" 0.0;
+ target: "arrow.image";
+ }
+ program { name: "button_click";
+ signal: "mouse,clicked,1";
+ source: "over";
+ script {
+ if (get_int(multi_down) == 0) {
+ run_program(PROGRAM:"button_click2");
+ }
+ }
+ }
+ program { name: "action_unpressed";
+ signal: "efl,action,unpressed";
+ source: "efl";
+ after: "button_unpress_anim";
+ }
+ program { name: "action_pressed";
+ signal: "efl,action,pressed";
+ source: "efl";
+ after: "button_press_anim";
+ }
+ program { name: "button_click2";
+ action: SIGNAL_EMIT "efl,action,click" "";
+ }
+ program { name: "access_pressed";
+ signal: "efl,action,anim,activate";
+ source: "efl";
+ action: STATE_SET "pressed" 0.0;
+ target: "arrow.image";
+ after: "access_pressed_anim";
+ }
+ program { name: "access_pressed_anim";
+ action: STATE_SET "default" 0.0;
+ transition: DECELERATE 0.1;
+ target: "arrow.image";
+ }
+ program { name: "disable";
+ signal: "efl,state,disabled";
+ source: "efl";
+ action: STATE_SET "disabled" 0.0;
+ target: "arrow.image";
+ target: "disabler";
+ }
+ program { name: "enable";
+ signal: "efl,state,enabled";
+ source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "arrow.image";
+ target: "disabler";
+ }
+ program {
+ name: "multi_down";
+ signal: "efl,action,multi,down";
+ source: "efl";
+ script {
+ set_int(multi_down, 1);
+ }
+ }
+ program {
+ name: "multi_up";
+ signal: "efl,action,multi,up";
+ source: "efl";
+ script {
+ set_int(multi_down, 0);
+ }
+ }
+ }
+ }
-group { "efl/calendar/inc_button";
- inherit: "elm/button/base/calendar/increase/default";
-}
-
-group { "efl/calendar/dec_button";
- inherit: "elm/button/base/calendar/decrease/default";
-}
+ group { name: "efl/calendar/dec_button";
+ inherit: "efl/calendar/inc_button";
+ images.image: "sym_left_light_normal.png" COMP;
+ images.image: "sym_left_glow_normal.png" COMP;
+ images.image: "sym_left_dark_normal.png" COMP;
+ parts {
+ part { name: "arrow.image";
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 15 15;
+ max: 15 15;
+ image.normal: "sym_left_light_normal.png";
+ }
+ description { state: "pressed" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "sym_left_glow_normal.png";
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "sym_left_dark_normal.png";
+ }
+ }
+ }
+ }
diff --git a/data/elementary/themes/edc/efl/check.edc b/data/elementary/themes/edc/efl/check.edc
index 76db7a8d28..96e1a923f2 100644
--- a/data/elementary/themes/edc/efl/check.edc
+++ b/data/elementary/themes/edc/efl/check.edc
@@ -1,7 +1,937 @@
group { "efl/check";
- inherit: "elm/check/base/default";
+ images.image: "inset_shadow_tiny.png" COMP;
+ images.image: "bevel_in.png" COMP;
+ images.image: "sym_check_alum.png" COMP;
+#define ICON 1
+#define LABEL 2
+#define MASK 3
+#define DISABLE 4
+ script {
+ public btmode;
+ public eval_mode(m) {
+ new m1 = m & MASK;
+ new d = m & DISABLE;
+ if (m1 == (ICON | LABEL)) {
+ if (!d) {
+ set_state(PART:"efl.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
+ set_state(PART:"efl.text", "visible", 0.0);
+ set_state(PART:"shadow", "default", 0.0);
+ set_state(PART:"base", "default", 0.0);
+ set_state(PART:"clip", "default", 0.0);
+ set_state(PART:"event", "default", 0.0);
+ } else {
+ set_state(PART:"efl.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
+ set_state(PART:"efl.text", "disabled_visible", 0.0);
+ set_state(PART:"shadow", "disabled", 0.0);
+ set_state(PART:"base", "disabled", 0.0);
+ set_state(PART:"clip", "disabled", 0.0);
+ set_state(PART:"event", "disabled", 0.0);
+ }
+ } else if (m1 == (ICON)) {
+ if (!d) {
+ set_state(PART:"efl.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "icononly", 0.0);
+ set_state(PART:"efl.text", "default", 0.0);
+ set_state(PART:"shadow", "default", 0.0);
+ set_state(PART:"base", "default", 0.0);
+ set_state(PART:"clip", "default", 0.0);
+ set_state(PART:"event", "default", 0.0);
+ } else {
+ set_state(PART:"efl.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "icononly", 0.0);
+ set_state(PART:"efl.text", "disabled", 0.0);
+ set_state(PART:"shadow", "disabled", 0.0);
+ set_state(PART:"base", "disabled", 0.0);
+ set_state(PART:"clip", "disabled", 0.0);
+ set_state(PART:"event", "disabled", 0.0);
+ }
+ } else if (m1 == (LABEL)) {
+ if (!d) {
+ set_state(PART:"efl.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
+ set_state(PART:"efl.text", "visible", 0.0);
+ set_state(PART:"shadow", "default", 0.0);
+ set_state(PART:"base", "default", 0.0);
+ set_state(PART:"clip", "default", 0.0);
+ set_state(PART:"event", "default", 0.0);
+ } else {
+ set_state(PART:"efl.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
+ set_state(PART:"efl.text", "disabled_visible", 0.0);
+ set_state(PART:"shadow", "disabled", 0.0);
+ set_state(PART:"base", "disabled", 0.0);
+ set_state(PART:"clip", "disabled", 0.0);
+ set_state(PART:"event", "disabled", 0.0);
+ }
+ } else {
+ if (!d) {
+ set_state(PART:"efl.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
+ set_state(PART:"efl.text", "default", 0.0);
+ set_state(PART:"shadow", "default", 0.0);
+ set_state(PART:"base", "default", 0.0);
+ set_state(PART:"clip", "default", 0.0);
+ set_state(PART:"event", "default", 0.0);
+ } else {
+ set_state(PART:"efl.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
+ set_state(PART:"efl.text", "default", 0.0);
+ set_state(PART:"shadow", "disabled", 0.0);
+ set_state(PART:"base", "disabled", 0.0);
+ set_state(PART:"clip", "disabled", 0.0);
+ set_state(PART:"event", "disabled", 0.0);
+ }
+ }
+ }
+ }
+ parts {
+ part { name: "base"; type: RECT;
+ description { state: "default" 0.0;
+ rel1.offset: 1 1;
+ rel1.to: "inset";
+ rel2.offset: -2 -2;
+ rel2.to: "inset";
+ color: 24 24 24 255;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 64 64 64 255;
+ }
+ }
+ part { name: "shadow"; mouse_events: 0;
+ description { state: "default" 0.0;
+ image.normal: "inset_shadow_tiny.png";
+ image.border: 4 4 4 4;
+ rel1.to: "base";
+ rel2.to: "base";
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "inset"; mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 0;
+ rel1.offset: 2 2;
+ rel2.relative: 0.0 1.0;
+ rel2.offset: 2 -3;
+ align: 0.0 0.5;
+ min: 13 13;
+ max: 13 13;
+ image.normal: "bevel_in.png";
+ image.border: 1 1 1 1;
+ image.middle: 0;
+ fill.smooth: 0;
+ }
+ }
+ part { name: "indicator"; mouse_events: 0;
+ scale: 1;
+ clip_to: "clip";
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "base";
+ rel2.to: "base";
+ image.normal: "sym_check_alum.png";
+ min: 11 11;
+ max: 11 11;
+ visible: 0;
+ }
+ description { state: "selected" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ part { name: "clip"; type: RECT;
+ description { state: "default" 0.0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 64;
+ }
+ }
+ part { name: "efl.content"; type: SWALLOW;
+ scale: 1;
+ clip_to: "clip";
+ required;
+ description { state: "default" 0.0;
+ fixed: 1 0;
+ visible: 0;
+ align: 0.0 0.5;
+ max: 0 0;
+ rel1.to_x: "inset";
+ rel1.relative: 1.0 0.0;
+ rel1.offset: 1 1;
+ rel2.to_x: "inset";
+ rel2.offset: 1 -2;
+ rel2.relative: 1.0 1.0;
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ aspect: 1.0 1.0;
+ min: 16 16;
+ }
+ }
+ part { name: "sizer_content"; type: TEXT; mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ visible: 0;
+ text { font: FN; size: 10;
+ min: 0 0;
+ text_class: "check_text";
+ }
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ rel1.to: "efl.content";
+ rel2.to: "efl.content";
+ text {
+ min: 1 1;
+ ellipsis: -1;
+ text: "M";
+ }
+ }
+ description { state: "icononly" 0.0;
+ inherit: "default" 0.0;
+ rel1.to: "efl.content";
+ rel2.to: "efl.content";
+ text {
+ min: 1 1;
+ ellipsis: -1;
+ text: "M";
+ }
+ }
+ }
+ part { name: "efl.text"; type: TEXT; mouse_events: 0;
+ effect: SHADOW BOTTOM;
+ scale: 1;
+ required;
+ description { state: "default" 0.0;
+ rel1.offset: 2 2;
+ rel1.to_x: "efl.content";
+ rel1.relative: 1.0 0.0;
+ rel2.offset: -3 -3;
+ color: FN_COL_DEFAULT;
+ color_class: "check_text";
+ text { font: FN; size: 10;
+ min: 0 0;
+ align: 0.0 0.5;
+ text_class: "check";
+ }
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color_class: "check_text_disabled";
+ color3: 255 255 255 255;
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ text.min: 1 1;
+ text.ellipsis: -1;
+ }
+ description { state: "disabled_visible" 0.0;
+ inherit: "default" 0.0;
+ color_class: "check_text_disabled";
+ color3: 255 255 255 255;
+ visible: 1;
+ text.min: 1 1;
+ text.ellipsis: -1;
+ }
+ }
+ part { name: "event"; type: RECT;
+ ignore_flags: ON_HOLD;
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ }
+ programs {
+ program {
+ signal: "mouse,clicked,1"; source: "event";
+ action: SIGNAL_EMIT "efl,action,check,toggle" "efl";
+ }
+ program {
+ signal: "efl,state,check,on"; source: "efl";
+ action: STATE_SET "selected" 0.0;
+ target: "indicator";
+ }
+ program {
+ signal: "efl,state,check,off"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "indicator";
+ }
+ program {
+ signal: "efl,state,text,set"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m |= LABEL; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program {
+ signal: "efl,state,text,unset"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m &= ~LABEL; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program {
+ signal: "efl,state,content,set"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m |= ICON; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program {
+ signal: "efl,state,content,unset"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m &= ~ICON; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program {
+ signal: "efl,state,disabled"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m |= DISABLE; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program {
+ signal: "efl,state,enabled"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m &= ~DISABLE; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ }
+#undef ICON
+#undef LABEL
+#undef MASK
+#undef DISABLE
}
group { "efl/check:toggle";
- inherit: "elm/check/base/toggle";
+ images.image: "inset_shadow_tiny.png" COMP;
+ images.image: "bevel_in.png" COMP;
+ images.image: "bevel_out.png" COMP;
+ images.image: "vgrad_med_lighter.png" COMP;
+ images.image: "shadow_square_tiny.png" COMP;
+ images.image: "glow_small.png" COMP;
+
+#define ICON 1
+#define LABEL 2
+#define MASK 3
+#define DISABLE 4
+ script {
+ public is_rtl;
+ public is_drag;
+ public was_drag;
+ public btmode;
+ public eval_mode(m) {
+ new m1 = m & MASK;
+ new d = m & DISABLE;
+ if (m1 == (ICON | LABEL)) {
+ if (!d) {
+ set_state(PART:"efl.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
+ set_state(PART:"efl.text", "visible", 0.0);
+ set_state(PART:"shadow", "default", 0.0);
+ set_state(PART:"clip", "default", 0.0);
+ set_state(PART:"event", "default", 0.0);
+ set_state(PART:"event2", "default", 0.0);
+ set_state(PART:"efl.ontext", "default", 0.0);
+ set_state(PART:"efl.offtext", "default", 0.0);
+ set_state(PART:"onrect", "default", 0.0);
+ set_state(PART:"offrect", "default", 0.0);
+ } else {
+ set_state(PART:"efl.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
+ set_state(PART:"efl.text", "disabled_visible", 0.0);
+ set_state(PART:"shadow", "disabled", 0.0);
+ set_state(PART:"clip", "disabled", 0.0);
+ set_state(PART:"event", "disabled", 0.0);
+ set_state(PART:"event2", "disabled", 0.0);
+ set_state(PART:"efl.ontext", "disabled", 0.0);
+ set_state(PART:"efl.offtext", "disabled", 0.0);
+ set_state(PART:"onrect", "disabled", 0.0);
+ set_state(PART:"offrect", "disabled", 0.0);
+ }
+ } else if (m1 == (ICON)) {
+ if (!d) {
+ set_state(PART:"efl.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "icononly", 0.0);
+ set_state(PART:"efl.text", "default", 0.0);
+ set_state(PART:"shadow", "default", 0.0);
+ set_state(PART:"clip", "default", 0.0);
+ set_state(PART:"event", "default", 0.0);
+ set_state(PART:"event2", "default", 0.0);
+ set_state(PART:"efl.ontext", "default", 0.0);
+ set_state(PART:"efl.offtext", "default", 0.0);
+ set_state(PART:"onrect", "default", 0.0);
+ set_state(PART:"offrect", "default", 0.0);
+ } else {
+ set_state(PART:"efl.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "icononly", 0.0);
+ set_state(PART:"efl.text", "disabled", 0.0);
+ set_state(PART:"shadow", "disabled", 0.0);
+ set_state(PART:"clip", "disabled", 0.0);
+ set_state(PART:"event", "disabled", 0.0);
+ set_state(PART:"event2", "disabled", 0.0);
+ set_state(PART:"efl.ontext", "disabled", 0.0);
+ set_state(PART:"efl.offtext", "disabled", 0.0);
+ set_state(PART:"onrect", "disabled", 0.0);
+ set_state(PART:"offrect", "disabled", 0.0);
+ }
+ } else if (m1 == (LABEL)) {
+ if (!d) {
+ set_state(PART:"efl.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
+ set_state(PART:"efl.text", "visible", 0.0);
+ set_state(PART:"shadow", "default", 0.0);
+ set_state(PART:"clip", "default", 0.0);
+ set_state(PART:"event", "default", 0.0);
+ set_state(PART:"event2", "default", 0.0);
+ set_state(PART:"efl.ontext", "default", 0.0);
+ set_state(PART:"efl.offtext", "default", 0.0);
+ set_state(PART:"onrect", "default", 0.0);
+ set_state(PART:"offrect", "default", 0.0);
+ } else {
+ set_state(PART:"efl.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
+ set_state(PART:"efl.text", "disabled_visible", 0.0);
+ set_state(PART:"shadow", "disabled", 0.0);
+ set_state(PART:"clip", "disabled", 0.0);
+ set_state(PART:"event", "disabled", 0.0);
+ set_state(PART:"event2", "disabled", 0.0);
+ set_state(PART:"efl.ontext", "disabled", 0.0);
+ set_state(PART:"efl.offtext", "disabled", 0.0);
+ set_state(PART:"onrect", "disabled", 0.0);
+ set_state(PART:"offrect", "disabled", 0.0);
+ }
+ } else {
+ if (!d) {
+ set_state(PART:"efl.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
+ set_state(PART:"efl.text", "default", 0.0);
+ set_state(PART:"shadow", "default", 0.0);
+ set_state(PART:"clip", "default", 0.0);
+ set_state(PART:"event", "default", 0.0);
+ set_state(PART:"event2", "default", 0.0);
+ set_state(PART:"efl.ontext", "default", 0.0);
+ set_state(PART:"efl.offtext", "default", 0.0);
+ set_state(PART:"onrect", "default", 0.0);
+ set_state(PART:"offrect", "default", 0.0);
+ } else {
+ set_state(PART:"efl.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
+ set_state(PART:"efl.text", "default", 0.0);
+ set_state(PART:"shadow", "disabled", 0.0);
+ set_state(PART:"clip", "disabled", 0.0);
+ set_state(PART:"event", "disabled", 0.0);
+ set_state(PART:"event2", "disabled", 0.0);
+ set_state(PART:"efl.ontext", "disabled", 0.0);
+ set_state(PART:"efl.offtext", "disabled", 0.0);
+ set_state(PART:"onrect", "disabled", 0.0);
+ set_state(PART:"offrect", "disabled", 0.0);
+ }
+ }
+ }
+ }
+ parts {
+ part { name: "tog"; type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 0;
+ rel1.relative: 1.0 0.0;
+ rel1.offset: 2 2;
+ rel2.offset: -3 -3;
+ align: 1.0 0.5;
+ min: 88 15;
+ max: 88 15;
+ }
+ }
+ part { name: "onrect"; type: RECT; mouse_events: 0;
+ scale: 1;
+ clip_to: "tog_clip";
+ description { state: "default" 0.0;
+ rel1.to: "button";
+ rel1.relative: -5.0 0.0;
+ rel2.to: "button";
+ rel2.relative: 0.5 1.0;
+ color: 24 24 24 255;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 64 64 64 255;
+ }
+ }
+ part { name: "offrect"; type: RECT; mouse_events: 0;
+ scale: 1;
+ clip_to: "tog_clip";
+ description { state: "default" 0.0;
+ rel1.to: "button";
+ rel1.relative: 0.5 0.0;
+ rel2.to: "button";
+ rel2.relative: 6.0 1.0;
+ color: 24 24 24 255;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 64 64 64 255;
+ }
+ }
+ part { name: "efl.offtext"; type: TEXT; mouse_events: 0;
+ effect: SHADOW BOTTOM;
+ scale: 1;
+ clip_to: "tog_clip";
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "button";
+ rel1.relative: 1.0 0.0;
+ rel2.to: "offrect";
+ color: FN_COL_DEFAULT;
+ color_class: "check_off_text";
+ text { font: FN; size: 10;
+ min: 0 1;
+ align: 0.5 0.5;
+ text_class: "check_off_text";
+ text: "OFF";
+ }
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color_class: "check_off_text_disabled";
+ color3: 255 255 255 255;
+ }
+ }
+ part { name: "efl.ontext"; type: TEXT; mouse_events: 0;
+ effect: GLOW;
+ scale: 1;
+ clip_to: "tog_clip";
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "onrect";
+ rel1.offset: 2 -1;
+ rel2.to: "button";
+ rel2.relative: 0.0 1.0;
+ rel2.offset: -1 -2;
+ color_class: "check_on_text";
+ color2: 255 255 255 255;
+ color3: 255 255 255 255;
+ text { font: FN; size: 10;
+ min: 0 1;
+ align: 0.5 0.5;
+ text_class: "check_on_text";
+ text: "ON";
+ }
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color_class: "check_on_text_disabled";
+ color3: 255 255 255 255;
+ }
+ }
+ part { name: "shadow"; mouse_events: 0;
+ description { state: "default" 0.0;
+ image.normal: "inset_shadow_tiny.png";
+ image.border: 4 4 4 4;
+ rel1.to: "tog";
+ rel2.to: "tog";
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "inset"; mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "tog";
+ rel1.offset: -1 -1;
+ rel2.to: "tog";
+ rel2.offset: 0 0;
+ image.normal: "bevel_in.png";
+ image.border: 1 1 1 1;
+ image.middle: 0;
+ fill.smooth: 0;
+ }
+ }
+ part { name: "tog_clip"; type: RECT;
+ description { state: "default" 0.0;
+ rel1.to: "tog";
+ rel2.to: "tog";
+ }
+ }
+ part { name: "button"; type: RECT;
+ scale: 1;
+ clip_to: "tog_clip";
+ dragable {
+ x: 1 1 0;
+ y: 0 0 0;
+ confine: "tog";
+ }
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "tog";
+ rel2.to: "tog";
+ min: 15 15;
+ max: 15 99999;
+ color: 0 0 0 0;
+ }
+ }
+ part { name: "shadow_but"; mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.offset: -3 -2;
+ rel1.to: "base_but";
+ rel2.offset: 2 4;
+ rel2.to: "base_but";
+ image.normal: "shadow_square_tiny.png";
+ image.border: 6 6 6 6;
+ fill.smooth: 0;
+ }
+ description { state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ rel1.offset: -2 -2;
+ rel2.offset: 1 1;
+ color: 255 255 255 128;
+ }
+ }
+ part { name: "glow_but"; mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.offset: -3 -3;
+ rel1.to: "base_but";
+ rel2.offset: 2 2;
+ rel2.to: "base_but";
+ image.normal: "glow_small.png";
+ image.border: 7 7 7 7;
+ fill.smooth: 0;
+ visible: 0;
+ }
+ description { state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ part { name: "base_but"; mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.to: "button";
+ rel2.to: "button";
+ image.normal: "vgrad_med_lighter.png";
+ fill.smooth: 0;
+ TILED_HORIZ(120)
+ }
+ }
+ part { name: "bevel_but"; mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.to: "base_but";
+ rel2.to: "base_but";
+ image.normal: "bevel_out.png";
+ image.border: 1 1 1 1;
+ image.middle: 0;
+ fill.smooth: 0;
+ }
+ }
+ part { name: "button_events"; type: RECT;
+ dragable.events: "button";
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ }
+ }
+ part { name: "clip"; type: RECT;
+ description { state: "default" 0.0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 64;
+ }
+ }
+ part { name: "efl.content"; type: SWALLOW;
+ scale: 1;
+ clip_to: "clip";
+ description { state: "default" 0.0;
+ fixed: 1 0;
+ visible: 0;
+ align: 0.0 0.5;
+ max: 0 0;
+ rel1.offset: 1 1;
+ rel2.offset: 1 -2;
+ rel2.relative: 0.0 1.0;
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ fixed: 0 0;
+ visible: 1;
+ min: 16 16;
+ }
+ }
+ part { name: "sizer_content"; type: TEXT; mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ visible: 0;
+ text { font: FN; size: 10;
+ min: 0 0;
+ text_class: "check_text";
+ }
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ rel1.to: "efl.content";
+ rel2.to: "efl.content";
+ text {
+ min: 1 1;
+ ellipsis: -1;
+ text: "M";
+ }
+ }
+ description { state: "icononly" 0.0;
+ inherit: "default" 0.0;
+ rel1.to: "efl.content";
+ rel2.to: "efl.content";
+ text {
+ min: 1 1;
+ ellipsis: -1;
+ text: "M";
+ }
+ }
+ }
+ part { name: "efl.text"; type: TEXT; mouse_events: 0;
+ effect: SHADOW BOTTOM;
+ scale: 1;
+ description { state: "default" 0.0;
+ rel1.to_x: "efl.content";
+ rel1.relative: 1.0 0.0;
+ rel1.offset: 2 2;
+ rel2.to_x: "tog";
+ rel2.relative: 0.0 1.0;
+ rel2.offset: -5 -3;
+ color: FN_COL_DEFAULT;
+ color_class: "check_text";
+ text { font: FN; size: 10;
+ min: 0 0;
+ align: 0.0 0.5;
+ text_class: "check";
+ }
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color_class: "check_text_disabled";
+ color3: 255 255 255 255;
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ text.min: 1 1;
+ text.ellipsis: -1;
+ }
+ description { state: "disabled_visible" 0.0;
+ inherit: "default" 0.0;
+ color_class: "check_text_disabled";
+ color3: 255 255 255 255;
+ visible: 1;
+ text.min: 1 1;
+ text.ellipsis: -1;
+ }
+ }
+ part { name: "event"; type: RECT;
+ ignore_flags: ON_HOLD;
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ rel1.to_x: "efl.content";
+ rel2.to_x: "efl.text";
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "event2"; type: RECT;
+ ignore_flags: ON_HOLD;
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ visible: 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ }
+ programs {
+ program {
+ signal: "mouse,clicked,1"; source: "event";
+ action: SIGNAL_EMIT "efl,action,check,toggle" "efl";
+ }
+ program {
+ signal: "efl,state,check,on"; source: "efl";
+ script {
+ new Float:drag;
+ if (get_int(is_rtl) == 0) {
+ drag = 100.0;
+ } else {
+ drag = 0.0;
+ }
+ set_drag(PART:"button", drag, 0.0);
+ }
+ }
+ program {
+ signal: "efl,state,check,off"; source: "efl";
+ script {
+ new Float:drag;
+ if (get_int(is_rtl) == 0) {
+ drag = 0.0;
+ } else {
+ drag = 100.0;
+ }
+ set_drag(PART:"button", drag, 0.0);
+ }
+ }
+ program {
+ signal: "mouse,clicked,1"; source: "button";
+ script {
+ new Float:dx, Float:dy;
+ get_drag(PART:"button", dx, dy);
+ if (!get_int(was_drag)) {
+ if (dx > 0.5) {
+ set_drag(PART:"button", 0.0, 0.0);
+ } else {
+ set_drag(PART:"button", 1.0, 0.0);
+ }
+ if (((get_int(is_rtl) == 1) && (dx <= 0.5)) ||
+ (get_int(is_rtl) == 0) && (dx > 0.5)) {
+ emit("efl,action,check,off", "efl");
+ } else {
+ emit("efl,action,check,on", "efl");
+ }
+ }
+ }
+ }
+ program {
+ signal: "drag"; source: "button";
+ script {
+ set_int(is_drag, 1);
+ }
+ }
+ program {
+ signal: "mouse,down,1"; source: "button";
+ script {
+ set_int(was_drag, 0);
+ set_int(is_drag, 0);
+ }
+ }
+ program { name: "drag_end";
+ signal: "mouse,up,1"; source: "button";
+ script {
+ new Float:dx, Float:dy;
+ get_drag(PART:"button", dx, dy);
+ if (get_int(is_drag)) {
+ if (dx > 0.5) {
+ set_drag(PART:"button", 1.0, 0.0);
+ } else {
+ set_drag(PART:"button", 0.0, 0.0);
+ }
+ if (((get_int(is_rtl) == 1) && (dx <= 0.5)) ||
+ (get_int(is_rtl) == 0) && (dx > 0.5)) {
+ emit("efl,action,check,on", "efl");
+ } else {
+ emit("efl,action,check,off", "efl");
+ }
+ set_int(was_drag, 1);
+ set_int(is_drag, 0);
+ }
+ }
+ }
+ program {
+ signal: "mouse,down,1"; source: "button";
+ action: STATE_SET "clicked" 0.0;
+ target: "shadow_but";
+ target: "glow_but";
+ }
+ program {
+ signal: "mouse,up,1"; source: "button";
+ action: STATE_SET "default" 0.0;
+ target: "shadow_but";
+ target: "glow_but";
+ }
+ program {
+ signal: "efl,state,text,set"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m |= LABEL; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program {
+ signal: "efl,state,text,unset"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m &= ~LABEL; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program {
+ signal: "efl,state,content,set"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m |= ICON; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program {
+ signal: "efl,state,content,unset"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m &= ~ICON; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program {
+ signal: "efl,state,disabled"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m |= DISABLE; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program {
+ signal: "efl,state,enabled"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m &= ~DISABLE; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program {
+ signal: "edje,state,rtl"; source: "edje";
+ script {
+ set_int(is_rtl, 1);
+ }
+ }
+ program {
+ signal: "edje,state,ltr"; source: "edje";
+ script {
+ set_int(is_rtl, 0);
+ }
+ }
+ }
+#undef ICON
+#undef LABEL
+#undef MASK
+#undef DISABLE
}
diff --git a/data/elementary/themes/edc/efl/cursor.edc b/data/elementary/themes/edc/efl/cursor.edc
index 1302e4c228..a62817708b 100644
--- a/data/elementary/themes/edc/efl/cursor.edc
+++ b/data/elementary/themes/edc/efl/cursor.edc
@@ -78,14 +78,80 @@
// "watch"
// "xterm"
-group { "efl/cursor/hand1";
- inherit: "elm/cursor/hand1/default";
+group { name: "efl/cursor/hand1";
+ images.image: "pointer_hand1.png" COMP;
+ parts {
+ part { name: "base"; mouse_events: 0; scale: 1;
+ description { state: "default" 0.0;
+ FIXED_SIZE(32, 32)
+ image.normal: "pointer_hand1.png";
+ }
+ }
+ part { name: "efl.hotspot"; type: SWALLOW;
+ description { state: "default" 0.0;
+ visible: 0;
+ fixed: 1 1;
+ rel1.relative: (26/32) (9/32);
+ rel1.to: "base";
+ rel2.to: "base";
+ rel2.relative: (26/32) (9/32);
+ rel2.offset: 0 0;
+ }
+ }
+ /* efl.content.hotspot is the old name for the above part */
+ alias: "efl.content.hotspot" "efl.hotspot";
+ }
}
-group { "efl/cursor/blank";
- inherit: "elm/cursor/blank/default";
+group { name: "efl/cursor/blank";
+ parts {
+ part { name: "efl.hotspot"; type: SWALLOW;
+ description { state: "default" 0.0;
+ visible: 0;
+ max: 1 1;
+ }
+ }
+ /* efl.content.hotspot is the old name for the above part */
+ alias: "efl.content.hotspot" "efl.hotspot";
+ }
}
-group { "efl/cursor/xterm";
- inherit: "elm/cursor/xterm/default";
+group { name: "efl/cursor/xterm";
+ images.image: "pointer_entry_bar.png" COMP;
+ images.image: "led_dot_white.png" COMP;
+ parts {
+ part { name: "base"; mouse_events: 0; scale: 1;
+ description { state: "default" 0.0;
+ min: 15 20;
+ max: 15 99999;
+ image.normal: "pointer_entry_bar.png";
+ image.border: 0 0 10 10;
+ rel1.offset: 0 2;
+ rel2.offset: -1 -3;
+ }
+ }
+ part { name: "efl.hotspot"; type: SWALLOW;
+ description { state: "default" 0.0;
+ visible: 0;
+ fixed: 1 1;
+ rel1.to: "base";
+ rel2.to: "base";
+ rel1.relative: 0.5 0.5;
+ rel2.relative: 0.5 0.5;
+ rel2.offset: 0 0;
+ }
+ }
+ /* efl.content.hotspot is the old name for the above part */
+ alias: "efl.content.hotspot" "efl.hotspot";
+ part { name: "shine";
+ description { state: "default" 0.0;
+ rel1.to: "base";
+ rel2.to: "base";
+ image.normal: "led_dot_white.png";
+ max: 27 27;
+ aspect: 1.0 1.0;
+ aspect_preference: VERTICAL;
+ }
+ }
+ }
}
diff --git a/data/elementary/themes/edc/efl/datepicker.edc b/data/elementary/themes/edc/efl/datepicker.edc
new file mode 100644
index 0000000000..e15343af46
--- /dev/null
+++ b/data/elementary/themes/edc/efl/datepicker.edc
@@ -0,0 +1,345 @@
+group { "efl/datepicker";
+ parts {
+ spacer { "base";
+ scale;
+ desc { "default";
+ min: 150 170;
+ }
+ }
+ rect { "base_bg";
+ scale;
+ desc { "default";
+ rel.to: "base";
+ color_class: "datepicker_bg";
+ }
+ }
+ spacer { "padding_bg_top";
+ scale;
+ desc { "default";
+ min: 0 10;
+ max: -1 10;
+ fixed: 0 1;
+ rel1 {
+ relative: 0.0 0.0;
+ to: "base_bg";
+ }
+ rel2 {
+ relative: 1.0 0.0;
+ to: "base_bg";
+ }
+ align: 0.5 0.0;
+ }
+ }
+ spacer { "padding_bg_bottom";
+ scale;
+ desc { "default";
+ min: 0 10;
+ max: -1 10;
+ fixed: 0 1;
+ rel1 {
+ relative: 0.0 1.0;
+ to: "base_bg";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ to: "base_bg";
+ }
+ align: 0.5 1.0;
+ }
+ }
+ spacer { "bg";
+ scale;
+ desc { "default";
+ min: 150 150;
+ max: 150 150;
+ rel1 {
+ relative: 0.0 1.0;
+ to: "padding_bg_top";
+ }
+ rel2 {
+ relative: 1.0 0.0;
+ to: "padding_bg_bottom";
+ }
+ }
+ }
+ spacer { "padding_left";
+ scale;
+ desc { "default";
+ min: 5 0;
+ max: 5 -1;
+ fixed: 1 0;
+ rel1 {
+ relative: 0.0 0.0;
+ to: "bg";
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ to: "bg";
+ }
+ align: 0.0 0.0;
+ }
+ }
+ spacer { "padding_right";
+ scale;
+ desc { "default";
+ min: 5 0;
+ max: 5 -1;
+ fixed: 1 0;
+ rel2.to: "bg";
+ rel1 {
+ relative: 1.0 0.0;
+ to: "bg";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ to: "bg";
+ }
+ align: 1.0 1.0;
+ }
+ }
+ swallow { "efl.field0";
+ mouse;
+ scale;
+ desc { "default";
+ fixed: 1 0;
+ min: 40 0;
+ rel1 {
+ relative: 1.0 0.0;
+ to: "padding_left";
+ }
+ rel2.to: "padding_left";
+ align: 0.0 0.5;
+ }
+ }
+ spacer { "padding_center1";
+ scale;
+ desc { "default";
+ fixed: 1 0;
+ min: 10 0;
+ max: 10 -1;
+ rel1 {
+ relative: 1.0 0.0;
+ to: "efl.field0";
+ }
+ rel2.to: "efl.field0";
+ align: 0.0 0.5;
+ }
+ }
+ swallow { "efl.field1";
+ mouse;
+ scale;
+ desc { "default";
+ fixed: 1 0;
+ min: 40 0;
+ rel1 {
+ relative: 1.0 0.0;
+ to: "padding_center1";
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ to_x: "padding_center2";
+ to_y: "padding_center1";
+ }
+ }
+ }
+ spacer { "padding_center2";
+ scale;
+ desc { "default";
+ fixed: 1 0;
+ min: 10 0;
+ max: 10 -1;
+ rel1.to: "efl.field2";
+ rel2 {
+ relative: 0.0 1.0;
+ to: "efl.field2";
+ }
+ align: 1.0 0.5;
+ }
+ }
+ swallow { "efl.field2";
+ mouse;
+ scale;
+ desc { "default";
+ fixed: 1 0;
+ min: 40 0;
+ rel1.to: "padding_right";
+ rel2 {
+ relative: 0.0 1.0;
+ to: "padding_right";
+ }
+ align: 1.0 0.5;
+ }
+ }
+ rect { "access";
+ repeat;
+ desc { "default";
+ fixed: 1 1;
+ rel1.to: "bg";
+ rel2.to: "bg";
+ color: 0 0 0 0;
+ }
+ }
+ }
+}
+
+group { "efl/datepicker/spin_button";
+ parts {
+ rect { "clip";
+ desc { "default";
+ rel.to: "efl.text_button";
+ }
+ }
+ spacer { "base";
+ scale;
+ desc { "default";
+ min: 40 150;
+ }
+ }
+ rect { "bg";
+ scale;
+ desc { "default";
+ color_class: "spinner_bg";
+ }
+ }
+ rect { "access";
+ repeat;
+ desc { "default";
+ fixed: 1 1;
+ color: 0 0 0 0;
+ rel1.to: "base";
+ rel2.to: "base";
+ hid;
+ }
+ desc { "active";
+ inherit: "default";
+ vis;
+ }
+ }
+ swallow { "efl.inc_button";
+ scale;
+ desc { "default";
+ align: 0.5 0.0;
+ min: 40 40;
+ max: 40 40;
+ fixed: 1 1;
+ }
+ }
+ swallow { "efl.dec_button";
+ scale;
+ desc { "default";
+ align: 0.5 1.0;
+ min: 40 40;
+ max: 40 40;
+ fixed: 1 1;
+ }
+ }
+ swallow { "efl.entry";
+ clip: "clip";
+ desc { "default";
+ fixed: 1 1;
+ rel1.to: "efl.text_button";
+ rel2.to: "efl.text_button";
+ hid;
+ }
+ desc { "active";
+ inherit: "default";
+ vis;
+ }
+ }
+ swallow { "efl.text_button";
+ scale;
+ desc { "default";
+ rel.to_x: "base";
+ rel1 {
+ to_y: "efl.inc_button";
+ relative: 0.0 1.0;
+ }
+ rel2 {
+ to_y: "efl.dec_button";
+ relative: 1.0 0.0;
+ }
+ min: 0 70;
+ max: -1 70;
+ fixed: 0 1;
+ }
+ desc { "inactive";
+ inherit: "default";
+ hid;
+ }
+ }
+ rect { "disabler";
+ norepeat;
+ nomouse;
+ desc { "default";
+ color: 0 0 0 0;
+ hid;
+ }
+ desc { "disabled";
+ inherit: "default";
+ vis;
+ }
+ }
+ }
+ programs {
+ program { "entry_active";
+ signal: "efl,state,entry,active";
+ source: "efl";
+ action: STATE_SET "active";
+ target: "efl.entry";
+ }
+ program { "entry_inactive";
+ signal: "efl,state,entry,inactive";
+ source: "efl";
+ action: STATE_SET "default";
+ target: "efl.entry";
+ }
+ program { "text_button_active";
+ signal: "efl,state,button,active";
+ source: "efl";
+ action: STATE_SET "default";
+ target: "efl.text_button";
+ }
+ program { "text_button_inactive";
+ signal: "efl,state,button,inactive";
+ source: "efl";
+ action: STATE_SET "inactive";
+ target: "efl.text_button";
+ }
+ program { "access_activate";
+ signal: "efl,state,access,active";
+ source: "efl";
+ action: STATE_SET "active";
+ target: "access";
+ }
+ program { "access_inactivate";
+ signal: "efl,state,access,inactive";
+ source: "efl";
+ action: STATE_SET "default";
+ target: "access";
+ }
+ program { "disable";
+ signal: "efl,state,disabled";
+ source: "efl";
+ action: STATE_SET "disabled";
+ target: "disabler";
+ }
+ program { "enable";
+ signal: "efl,state,enabled";
+ source: "efl";
+ action: STATE_SET "default";
+ target: "disabler";
+ }
+ }
+}
+
+group { "efl/datepicker/spin_button/text_button";
+ inherit: "efl/spin_button/text_button";
+}
+
+group { "efl/datepicker/spin_button/inc_button";
+ inherit: "efl/spin_button/inc_button:vertical";
+}
+
+group { "efl/datepicker/spin_button/dec_button";
+ inherit: "efl/spin_button/dec_button:vertical";
+}
diff --git a/data/elementary/themes/edc/efl/focus.edc b/data/elementary/themes/edc/efl/focus.edc
index d7c3b78f19..a5edbe49b3 100644
--- a/data/elementary/themes/edc/efl/focus.edc
+++ b/data/elementary/themes/edc/efl/focus.edc
@@ -1,7 +1,177 @@
-group { "efl/focus_highlight/top";
- inherit: "elm/focus_highlight/top/default";
+group { name: "efl/focus_highlight/top";
+ images.image: "box_glow.png" COMP;
+ images.image: "box_outline.png" COMP;
+ data.item: "animate" "on";
+ script {
+ public s_x, s_y, s_w, s_h; /* source */
+ public difx, dify, difw, difh;
+ public g_anim_id;
+
+ public animator1(val, Float:pos) {
+ new x, y, w, h, dx, dy, dw, dh, Float:p;
+ p = 1.0 - ((1.0 - pos) * (1.0 - pos) * (1.0 - pos));
+ dx = round(float_mul(float(get_int(difx)), p));
+ x = get_int(s_x) + dx;
+ dy = round(float_mul(float(get_int(dify)), p));
+ y = get_int(s_y) + dy;
+ dw = round(float_mul(float(get_int(difw)), p));
+ w = get_int(s_w) + dw;
+ dh = round(float_mul(float(get_int(difh)), p));
+ h = get_int(s_h) + dh;
+ update_offset(x, y, w, h);
+
+ if (pos >= 1.0) {
+ set_int(g_anim_id, 0);
+ }
+ }
+
+ public update_offset(x, y, w, h) {
+ set_state_val(PART:"base", STATE_REL1_OFFSET, x, y);
+ set_state_val(PART:"base", STATE_REL2_OFFSET, x + w, y + h);
+ }
+
+ public message(Msg_Type:type, id, ...) {
+ if ((type == MSG_INT_SET) && (id == 1)) {
+ new x1, y1, w1, h1, x2, y2, w2, h2;
+ new anim_id;
+
+ anim_id = get_int(g_anim_id);
+ if (anim_id != 0) {
+ cancel_anim(anim_id);
+ }
+
+ x1 = getarg(2);
+ y1 = getarg(3);
+ w1 = getarg(4);
+ h1 = getarg(5);
+ x2 = getarg(6);
+ y2 = getarg(7);
+ w2 = getarg(8);
+ h2 = getarg(9);
+
+ set_int(s_x, x1);
+ set_int(s_y, y1);
+ set_int(s_w, w1);
+ set_int(s_h, h1);
+ set_int(difx, x2 - x1);
+ set_int(dify, y2 - y1);
+ set_int(difw, w2 - w1);
+ set_int(difh, h2 - h1);
+
+ custom_state(PART:"base", "default", 0.0);
+ set_state_val(PART:"base", STATE_REL1, 0.0, 0.0);
+ set_state_val(PART:"base", STATE_REL2, 0.0, 0.0);
+ update_offset(x1, y1, w1, h1);
+ set_state(PART:"base", "custom", 0.0);
+
+ anim_id = anim(0.2, "animator1", 1);
+ set_int(g_anim_id, anim_id);
+ }
+ }
+ }
+ parts {
+ part { name: "base"; type: SPACER;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ }
+ }
+ part { name: "clip"; type: RECT;
+ description { state: "default" 0.0;
+ rel1.to: "glow";
+ rel2.to: "glow";
+ color: 255 255 255 0;
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ part { name: "glow"; mouse_events: 0;
+ clip_to: "clip";
+ description { state: "default" 0.0;
+ image.normal: "box_glow.png";
+ image.border: 12 12 12 12;
+ image.middle: 0;
+ fill.smooth: 0;
+ rel1.to: "base";
+ rel1.offset: -7 -7;
+ rel2.to: "base";
+ rel2.offset: 5 5;
+ }
+ }
+ part { name: "sel"; mouse_events: 0;
+ clip_to: "clip";
+ description { state: "default" 0.0;
+ image.normal: "box_outline.png";
+ image.border: 12 12 12 12;
+ image.middle: 0;
+ fill.smooth: 0;
+ rel1.to: "glow";
+ rel2.to: "glow";
+ color: 255 255 255 0;
+ }
+ description { state: "hi" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ }
+ programs {
+ program {
+ signal: "efl,action,focus,show"; source: "efl";
+ action: ACTION_STOP;
+ target: "pulse";
+ target: "pulse2";
+ after: "go2";
+ }
+ program { name: "go2";
+ action: STATE_SET "visible" 0.0;
+ transition: DECELERATE 0.2;
+ target: "clip";
+ after: "pulse";
+ after: "go3";
+ }
+ program { name: "go3";
+ action: SIGNAL_EMIT "efl,action,focus,show,end" "efl";
+ }
+ program {
+ signal: "efl,action,focus,hide"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ transition: DECELERATE 0.4;
+ target: "clip";
+ after: "stop2";
+ }
+ program { name: "stop2";
+ action: SIGNAL_EMIT "efl,action,focus,hide,end" "efl";
+ after: "stop3";
+ }
+ program { name: "stop3";
+ action: ACTION_STOP;
+ target: "pulse";
+ target: "pulse2";
+ }
+ program { name: "pulse";
+ action: STATE_SET "hi" 0.0;
+ transition: SINUSOIDAL 0.2;
+ in: 3.0 0.0;
+ target: "sel";
+ after: "pulse2";
+ }
+ program { name: "pulse2";
+ action: STATE_SET "default" 0.0;
+ transition: SINUSOIDAL 0.4;
+ target: "sel";
+ after: "pulse";
+ }
+ program {
+ signal: "efl,state,anim,stop"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "base";
+ }
+ }
}
-group { "efl/focus_highlight/top:blank";
- inherit: "elm/focus_highlight/top/blank";
+group { name: "efl/focus_highlight/top:blank";
+ parts {
+ }
}
diff --git a/data/elementary/themes/edc/efl/frame.edc b/data/elementary/themes/edc/efl/frame.edc
index f8b4690b24..6d3067170a 100644
--- a/data/elementary/themes/edc/efl/frame.edc
+++ b/data/elementary/themes/edc/efl/frame.edc
@@ -1,3 +1,166 @@
-group { "efl/frame";
- inherit: "elm/frame/base/default";
+group { name: "efl/frame";
+ images.image: "shadow_square_tiny.png" COMP;
+ images.image: "vgrad_med_curved.png" COMP;
+ images.image: "bevel_out.png" COMP;
+ images.image: "holes_tiny_vert.png" COMP;
+ parts {
+ part { name: "shadow"; mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.offset: -1 0;
+ rel2.offset: 0 1;
+ image.normal: "shadow_square_tiny.png";
+ image.border: 6 6 6 6;
+ fill.smooth: 0;
+ }
+ }
+ part { name: "base"; type: RECT;
+ description { state: "default" 0.0;
+ rel1.relative: 0.0 1.0;
+ rel1.offset: 2 0;
+ rel1.to_y: "top";
+ rel2.offset: -3 -3;
+ color: 64 64 64 255;
+ }
+ }
+ part { name: "top";
+ description { state: "default" 0.0;
+ image.normal: "vgrad_med_curved.png";
+ rel1.offset: 2 2;
+ rel2.to_y: "efl.text";
+ rel2.offset: -3 -1;
+ fill.smooth: 0;
+ TILED_HORIZ(120)
+ }
+ }
+ part { name: "edge1";
+ description { state: "default" 0.0;
+ image.normal: "holes_tiny_vert.png";
+ rel1.offset: 4 0;
+ rel1.to_y: "efl.text";
+ rel2.offset: 4 -1;
+ rel2.relative: 0.0 1.0;
+ rel2.to_y: "efl.text";
+ align: 0.0 0.5;
+ FIXED_SIZE(3, 11)
+ }
+ }
+ part { name: "edge2";
+ description { state: "default" 0.0;
+ image.normal: "holes_tiny_vert.png";
+ rel1.offset: -5 0;
+ rel1.to_y: "efl.text";
+ rel1.relative: 1.0 0.0;
+ rel2.offset: -5 -1;
+ rel2.relative: 1.0 1.0;
+ rel2.to_y: "efl.text";
+ align: 1.0 0.5;
+ FIXED_SIZE(3, 11)
+ }
+ }
+ part { name: "efl.text"; type: TEXT;
+ scale: 1;
+ effect: SHADOW BOTTOM;
+ description { state: "default" 0.0;
+ color_class: "frame";
+ rel1.relative: 1.0 0.0;
+ rel1.offset: 1 2;
+ rel1.to_x: "edge1";
+ rel2.relative: 0.0 0.0;
+ rel2.offset: -3 1;
+ rel2.to_x: "edge2";
+ align: 0.0 0.0;
+ color: FN_COL_DISABLE;
+ text { font: FNBD; size: 10;
+ text_class: "frame";
+ align: 0.0 0.0;
+ min: 0 1;
+ }
+ fixed: 0 1;
+ }
+ }
+ part { name: "clip"; type: RECT;
+ description { state: "default" 0.0;
+ rel1.relative: 0.0 1.0;
+ rel1.offset: 5 0;
+ rel1.to_y: "efl.text";
+ rel2.offset: -7 -7;
+ }
+ }
+ part { name: "efl.content"; type: SWALLOW;
+ clip_to: "clip";
+ description { state: "default" 0.0;
+ align: 0.0 1.0;
+ rel1.relative: 0.0 1.0;
+ rel1.offset: 5 0;
+ rel1.to_y: "efl.text";
+ rel2.offset: -7 -7;
+ }
+ description { state: "collapsed" 0.0;
+ inherit: "default" 0.0;
+ minmul: 1.0 0.0;
+ }
+ }
+ part { name: "bevel"; mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.offset: 2 2;
+ rel2.offset: -3 -3;
+ image.normal: "bevel_out.png";
+ image.border: 1 1 1 1;
+ image.middle: 0;
+ fill.smooth: 0;
+ }
+ }
+ part { name: "event"; type: RECT; ignore_flags: ON_HOLD;
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ rel1.to_y: "efl.text";
+ rel2.to_y: "efl.text";
+ }
+ }
+ }
+ programs {
+ program { name: "collapse";
+ action: STATE_SET "collapsed" 0.0;
+ target: "efl.content";
+ transition: ACCELERATE 0.3;
+ after: "signal";
+ }
+ program { name: "expand";
+ action: STATE_SET "default" 0.0;
+ target: "efl.content";
+ transition: DECELERATE 0.3;
+ after: "signal";
+ }
+ program {
+ signal: "mouse,up,1"; source: "event";
+ action: SIGNAL_EMIT "efl,action,click" "efl";
+ }
+ program {
+ signal: "efl,action,toggle"; source: "efl";
+ script {
+ new st[31];
+ new Float:vl;
+ get_state(PART:"efl.content", st, 30, vl);
+ if (!strcmp(st, "default"))
+ run_program(PROGRAM:"collapse");
+ else
+ run_program(PROGRAM:"expand");
+ }
+ }
+ program {
+ signal: "efl,action,switch"; source: "efl";
+ script {
+ new st[31];
+ new Float:vl;
+ get_state(PART:"efl.content", st, 30, vl);
+ if (!strcmp(st, "default"))
+ set_state(PART:"efl.content", "collapsed", 0.0);
+ else
+ set_state(PART:"efl.content", "default", 0.0);
+ }
+ }
+ program { name: "signal";
+ action: SIGNAL_EMIT "efl,anim,done" "efl";
+ }
+ }
}
diff --git a/data/elementary/themes/edc/efl/list.edc b/data/elementary/themes/edc/efl/list.edc
index 2707924020..1bc55ec4d6 100644
--- a/data/elementary/themes/edc/efl/list.edc
+++ b/data/elementary/themes/edc/efl/list.edc
@@ -1,8 +1,471 @@
group { "efl/list";
- inherit: "elm/list/base/default";
+ inherit: "efl/scroller";
}
-group { "efl/list/item";
- inherit: "elm/list/item/default";
+group { "efl/view_list";
+ inherit: "efl/list";
}
+group { "efl/list_item";
+ data.item: "selectraise" "on";
+ data.item: "focusraise" "on";
+ images.image: "bevel_curved_horiz_out.png" COMP;
+ images.image: "shadow_rounded_horiz.png" COMP;
+ images.image: "vgrad_med_dark.png" COMP;
+ images.image: "bevel_horiz_out.png" COMP;
+ images.image: "shine.png" COMP;
+ parts {
+ rect { "event";
+ desc { "default";
+ color: 0 0 0 0;
+ }
+ desc { "disabled";
+ inherit: "default";
+ hid;
+ }
+ }
+ rect { "base"; nomouse;
+ desc { "default";
+ color: 64 64 64 255;
+ color_class: "list_item_base";
+ }
+ desc { "odd";
+ color: 56 56 56 255;
+ color_class: "list_item_base_odd";
+ }
+ }
+
+ image { "bevel"; nomouse;
+ desc { "default";
+ image.normal: "bevel_curved_horiz_out.png";
+ image.border: 0 0 2 2;
+ image.middle: 0;
+ fill.smooth: 0;
+ }
+ }
+ swallow { "efl.background";
+ desc { "default";
+ rel.to: "base";
+ vis;
+ }
+ }
+ image { "sel_shadow"; nomouse;
+ desc { "default";
+ image.normal: "shadow_rounded_horiz.png";
+ image.border: 0 0 9 9;
+ rel1.offset: 0 -4;
+ rel2.offset: -1 5;
+ fill.smooth: 0;
+ hid;
+ }
+ desc { "selected";
+ inherit: "default";
+ vis;
+ }
+ }
+ image { "sel_base"; nomouse;
+ desc { "default";
+ image.normal: "vgrad_med_dark.png";
+ fill.smooth: 0;
+ hid;
+ TILED_HORIZ(120)
+ }
+ desc { "selected";
+ inherit: "default";
+ vis;
+ }
+ }
+ image { "sel_bevel"; nomouse;
+ desc { "default";
+ image.normal: "bevel_horiz_out.png";
+ image.border: 0 0 2 2;
+ image.middle: 0;
+ fill.smooth: 0;
+ hid;
+ }
+ desc { "selected";
+ inherit: "default";
+ vis;
+ }
+ }
+
+ //##//
+ text { "efl.text"; nomouse;
+ effect: SHADOW BOTTOM;
+ scale: 1;
+ desc { "default";
+ rel1.offset: 2 3;
+ rel1.relative: 1.0 0.0;
+ rel1.to_x: "efl.icon";
+ rel2.offset: -3 -3;
+ rel2.relative: 0.0 1.0;
+ rel2.to_x: "efl.end";
+ color: FN_COL_DEFAULT;
+ color_class: "list_item";
+ text { font: FN; size: 10;
+ min: 1 1;
+ ellipsis: -1;
+ align: 0.0 0.5;
+ text_class: "list_item";
+ }
+ }
+ desc { "selected";
+ inherit: "default";
+ hid;
+ }
+ desc { "disabled";
+ inherit: "default";
+ hid;
+ }
+ }
+ text { "label2"; nomouse;
+ effect: SHADOW BOTTOM;
+ scale: 1;
+ desc { "default";
+ rel1.to: "efl.text";
+ rel2.to: "efl.text";
+ color: FN_COL_DISABLE;
+ color_class: "list_item_disabled";
+ text { font: FN; size: 10;
+ text_source: "efl.text";
+ align: 0.0 0.5;
+ text_class: "list_item";
+ }
+ hid;
+ }
+ desc { "selected";
+ inherit: "default";
+ hid;
+ }
+ desc { "disabled";
+ inherit: "default";
+ vis;
+ }
+ }
+ text { "label3"; nomouse;
+ effect: GLOW;
+ scale: 1;
+ desc { "default";
+ rel1.offset: -2 -3;
+ rel1.to: "efl.text";
+ rel2.offset: 1 1;
+ rel2.to: "efl.text";
+ color: FN_COL_HIGHLIGHT;
+ color_class: "list_item_selected";
+ text { font: FN; size: 10;
+ text_source: "efl.text";
+ align: 0.0 0.5;
+ text_class: "list_item";
+ }
+ hid;
+ }
+ desc { "selected";
+ inherit: "default";
+ vis;
+ }
+ desc { "disabled";
+ inherit: "default";
+ hid;
+ }
+ }
+ //##//
+ swallow { "efl.icon";
+ desc { "default";
+ fixed: 1 0;
+ align: 0.0 0.5;
+ aspect: 1.0 1.0;
+ rel1.offset: 2 2;
+ rel2.relative: 0.0 1.0;
+ rel2.offset: 2 -3;
+ }
+ }
+ swallow { "efl.end";
+ desc { "default";
+ fixed: 1 0;
+ align: 1.0 0.5;
+ aspect: 1.0 1.0;
+ rel1.offset: -3 2;
+ rel1.relative: 1.0 0.0;
+ rel2.offset: -3 -3;
+ }
+ }
+ //##//
+ image { "sel_shine"; nomouse;
+ desc { "default";
+ image.normal: "shine.png";
+ rel1.offset: 0 -2;
+ rel1.to: "sel_base";
+ rel2.relative: 1.0 0.0;
+ rel2.offset: -1 2;
+ rel2.to: "sel_base";
+ hid;
+ FIXED_SIZE(69, 5)
+ }
+ desc { "selected";
+ inherit: "default";
+ vis;
+ }
+ }
+ rect { "event_block";
+ desc { "default";
+ color: 0 0 0 0;
+ hid;
+ }
+ desc { "disabled";
+ inherit: "default";
+ vis;
+ }
+ }
+ }
+ programs {
+ program {
+ signal: "efl,state,odd"; source: "efl";
+ action: STATE_SET "odd";
+ target: "base";
+ }
+ program {
+ signal: "efl,state,even"; source: "efl";
+ action: STATE_SET "default";
+ target: "base";
+ }
+ program {
+ signal: "efl,state,pressed"; source: "efl";
+ action: STATE_SET "selected";
+ target: "sel_shadow";
+ target: "sel_base";
+ target: "sel_bevel";
+ target: "efl.text";
+ target: "label2";
+ target: "label3";
+ target: "sel_shine";
+ }
+ program {
+ signal: "efl,state,unpressed"; source: "efl";
+ action: STATE_SET "default";
+ target: "sel_shadow";
+ target: "sel_base";
+ target: "sel_bevel";
+ target: "efl.text";
+ target: "label2";
+ target: "label3";
+ target: "sel_shine";
+ }
+ program {
+ signal: "efl,state,selected"; source: "efl";
+ action: STATE_SET "selected";
+ target: "sel_shadow";
+ target: "sel_base";
+ target: "sel_bevel";
+ target: "efl.text";
+ target: "label2";
+ target: "label3";
+ target: "sel_shine";
+ }
+ program {
+ signal: "efl,state,unselected"; source: "efl";
+ action: STATE_SET "default";
+ target: "sel_shadow";
+ target: "sel_base";
+ target: "sel_bevel";
+ target: "efl.text";
+ target: "label2";
+ target: "label3";
+ target: "sel_shine";
+ }
+ program {
+ signal: "efl,state,disabled"; source: "efl";
+ action: STATE_SET "disabled";
+ target: "event";
+ target: "efl.text";
+ target: "label2";
+ target: "label3";
+ target: "event_block";
+ }
+ program {
+ signal: "efl,state,enabled"; source: "efl";
+ action: STATE_SET "default";
+ target: "event";
+ target: "efl.text";
+ target: "label2";
+ target: "label3";
+ target: "event_block";
+ }
+ }
+}
+
+group { "efl/list_item:empty";
+ data.item: "selectraise" "on";
+ data.item: "focusraise" "on";
+ images.image: "bevel_curved_horiz_out.png" COMP;
+ images.image: "shadow_rounded_horiz.png" COMP;
+ images.image: "vgrad_med_dark.png" COMP;
+ images.image: "bevel_horiz_out.png" COMP;
+ images.image: "shine.png" COMP;
+ parts {
+ rect { "event";
+ desc { "default";
+ color: 0 0 0 0;
+ }
+ desc { "disabled";
+ inherit: "default";
+ hid;
+ }
+ }
+ rect { "base"; nomouse;
+ desc { "default";
+ color: 64 64 64 255;
+ color_class: "list_item_base";
+ }
+ desc { "odd";
+ color: 56 56 56 255;
+ color_class: "list_item_base_odd";
+ }
+ }
+
+ image { "bevel"; nomouse;
+ desc { "default";
+ image.normal: "bevel_curved_horiz_out.png";
+ image.border: 0 0 2 2;
+ image.middle: 0;
+ fill.smooth: 0;
+ }
+ }
+ swallow { "efl.background";
+ desc { "default";
+ rel.to: "base";
+ vis;
+ }
+ }
+ image { "sel_shadow"; nomouse;
+ desc { "default";
+ image.normal: "shadow_rounded_horiz.png";
+ image.border: 0 0 9 9;
+ rel1.offset: 0 -4;
+ rel2.offset: -1 5;
+ fill.smooth: 0;
+ hid;
+ }
+ desc { "selected";
+ inherit: "default";
+ vis;
+ }
+ }
+ image { "sel_base"; nomouse;
+ desc { "default";
+ image.normal: "vgrad_med_dark.png";
+ fill.smooth: 0;
+ hid;
+ TILED_HORIZ(120)
+ }
+ desc { "selected";
+ inherit: "default";
+ vis;
+ }
+ }
+ image { "sel_bevel"; nomouse;
+ desc { "default";
+ image.normal: "bevel_horiz_out.png";
+ image.border: 0 0 2 2;
+ image.middle: 0;
+ fill.smooth: 0;
+ hid;
+ }
+ desc { "selected";
+ inherit: "default";
+ vis;
+ }
+ }
+ //##//
+ swallow { "efl.content"; mouse;
+ scale;
+ desc { "default";
+ min: 19 19;
+ rel1.offset: -1 2;
+ rel2.offset: -3 -3;
+ }
+ }
+ //##//
+ image { "sel_shine";
+ desc { "default";
+ image.normal: "shine.png";
+ rel1.offset: 0 -2;
+ rel1.to: "sel_base";
+ rel2.relative: 1.0 0.0;
+ rel2.offset: -1 2;
+ rel2.to: "sel_base";
+ hid;
+ FIXED_SIZE(69, 5)
+ }
+ desc { "selected";
+ inherit: "default";
+ vis;
+ }
+ }
+ rect { "event_block"; mouse;
+ desc { "default";
+ color: 0 0 0 0;
+ hid;
+ }
+ desc { "disabled";
+ inherit: "default";
+ vis;
+ }
+ }
+ }
+ programs {
+ program {
+ signal: "efl,state,odd"; source: "efl";
+ action: STATE_SET "odd";
+ target: "base";
+ }
+ program {
+ signal: "efl,state,even"; source: "efl";
+ action: STATE_SET "default";
+ target: "base";
+ }
+ program {
+ signal: "efl,state,pressed"; source: "efl";
+ action: STATE_SET "selected";
+ target: "sel_shadow";
+ target: "sel_base";
+ target: "sel_bevel";
+ target: "sel_shine";
+ }
+ program {
+ signal: "efl,state,unpressed"; source: "efl";
+ action: STATE_SET "default";
+ target: "sel_shadow";
+ target: "sel_base";
+ target: "sel_bevel";
+ target: "sel_shine";
+ }
+ program {
+ signal: "efl,state,selected"; source: "efl";
+ action: STATE_SET "selected";
+ target: "sel_shadow";
+ target: "sel_base";
+ target: "sel_bevel";
+ target: "sel_shine";
+ }
+ program {
+ signal: "efl,state,unselected"; source: "efl";
+ action: STATE_SET "default";
+ target: "sel_shadow";
+ target: "sel_base";
+ target: "sel_bevel";
+ target: "sel_shine";
+ }
+ program {
+ signal: "efl,state,disabled"; source: "efl";
+ action: STATE_SET "disabled";
+ target: "event";
+ target: "event_block";
+ }
+ program {
+ signal: "efl,state,enabled"; source: "efl";
+ action: STATE_SET "default";
+ target: "event";
+ target: "event_block";
+ }
+ }
+} \ No newline at end of file
diff --git a/data/elementary/themes/edc/efl/navigation_bar.edc b/data/elementary/themes/edc/efl/navigation_bar.edc
new file mode 100644
index 0000000000..c2b4cee795
--- /dev/null
+++ b/data/elementary/themes/edc/efl/navigation_bar.edc
@@ -0,0 +1,114 @@
+//Efl.Ui.Navigation_Bar Themes
+group { "efl/navigation_bar";
+ styles {
+ style { name: "navigation_bar_text";
+ base: "font="FNBD" font_size=10 text_class=label align=center color=#fff color_class=navigation_bar_text style=shadow,bottom shadow_color=#00000080 ellipsis=1.0 wrap=mixed";
+ tag: "br" "\n";
+ tag: "hilight" "+ font="FNBD" text_class=label_light";
+ tag: "b" "+ font="FNBD" text_class=label_light";
+ tag: "whitecolor" "+ color=#fff";
+ tag: "tab" "\t";
+ }
+ }
+ parts {
+ spacer { "base";
+ desc { "default";
+ }
+ }
+ swallow { "efl.back_button";
+ desc { "default";
+ fixed: 1 0;
+ min: 0 0;
+ max: 0 -1;
+ rel.to: "base";
+ rel2.relative: 0.0 1.0;
+ align: 0.0 0.5;
+ hid;
+ }
+ desc { "visible";
+ inherit: "default";
+ min: 40 0;
+ max: 40 -1;
+ vis;
+ }
+ }
+ swallow { "efl.left_content";
+ desc { "default";
+ rel.to: "base";
+ rel2.relative: 0.0 1.0;
+ align: 0.0 0.5;
+ }
+ }
+ swallow { "efl.right_content";
+ desc { "default";
+ rel.to: "base";
+ rel1.relative: 1.0 0.0;
+ align: 1.0 0.5;
+ }
+ }
+ spacer { "text_base";
+ desc { "default";
+ rel1 {
+ to: "efl.back_button";
+ relative: 1.0 0.0;
+ }
+ rel2 {
+ to: "efl.right_content";
+ relative: 0.0 1.0;
+ }
+ }
+ desc { "left_content";
+ inherit: "default";
+ rel1 {
+ to: "efl.left_content";
+ relative: 1.0 0.0;
+ }
+ }
+ }
+ textblock { "efl.text";
+ scale;
+ desc { "default";
+ text {
+ style: "navigation_bar_text";
+ }
+ rel.to: "text_base";
+ }
+ }
+ programs {
+ program {
+ signal: "efl,state,back_button,visible"; source: "efl";
+ action: STATE_SET "visible" 0.0;
+ target: "efl.back_button";
+ }
+ program {
+ signal: "efl,state,back_button,hidden"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "efl.back_button";
+ }
+ program {
+ signal: "efl,state,left_content,set"; source: "efl";
+ action: STATE_SET "left_content" 0.0;
+ target: "text_base";
+ }
+ program {
+ signal: "efl,state,left_content,unset"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "text_base";
+ }
+ }
+ }
+}
+
+group { name: "efl/navigation_bar/back_button";
+ inherit: "efl/button";
+ images.image: "icon_arrow_left.png" COMP;
+ parts {
+ image { name: "icon_arrow_left";
+ insert_before: "efl.content";
+ desc { "default";
+ image.normal: "icon_arrow_left.png";
+ fill.smooth: 0;
+ }
+ }
+ }
+}
diff --git a/data/elementary/themes/edc/efl/navigation_layout.edc b/data/elementary/themes/edc/efl/navigation_layout.edc
new file mode 100644
index 0000000000..4319453b96
--- /dev/null
+++ b/data/elementary/themes/edc/efl/navigation_layout.edc
@@ -0,0 +1,27 @@
+//Efl.Ui.Navigation_Layout Themes
+group { "efl/navigation_layout";
+ parts {
+ spacer { "base";
+ desc { "default";
+ }
+ }
+ swallow { "efl.bar";
+ desc { "default";
+ fixed: 0 1;
+ min: 0 40;
+ rel2.relative: 1.0 0.0;
+ align: 0.5 0.0;
+ }
+ }
+ swallow { "efl.content";
+ desc { "default";
+ rel1 {
+ to_x: "base";
+ to_y: "efl.bar";
+ relative: 0.0 1.0;
+ }
+ rel2.to_x: "base";
+ }
+ }
+ }
+}
diff --git a/data/elementary/themes/edc/efl/nstate.edc b/data/elementary/themes/edc/efl/nstate.edc
index c63624deec..1d7a724411 100644
--- a/data/elementary/themes/edc/efl/nstate.edc
+++ b/data/elementary/themes/edc/efl/nstate.edc
@@ -3,7 +3,7 @@ group { "efl/nstate";
programs {
program {
signal: "mouse,clicked,1"; source: "event";
- action: SIGNAL_EMIT "elm,action,state,changed" "elm";
+ action: SIGNAL_EMIT "efl,action,state,changed" "efl";
}
}
}
diff --git a/data/elementary/themes/edc/efl/pager.edc b/data/elementary/themes/edc/efl/pager.edc
new file mode 100644
index 0000000000..d02be54b82
--- /dev/null
+++ b/data/elementary/themes/edc/efl/pager.edc
@@ -0,0 +1,66 @@
+group { "efl/pager";
+ parts {
+ spacer { "base";
+ scale;
+ desc { "default";
+ }
+ }
+ swallow { "efl.background";
+ scale;
+ desc { "default";
+ }
+ }
+ swallow { "efl.page_root";
+ scale;
+ desc { "default";
+ rel1.relative: 0.0 1.0;
+ rel1.to: "efl.indicator";
+ }
+ }
+ swallow { "efl.indicator";
+ scale;
+ desc { "default";
+ rel2.relative: 1.0 0.0;
+ align: 0.5 0.0;
+ min: 0 50;
+ }
+ }
+ swallow { "efl.event";
+ scale;
+ repeat_events: 1;
+ desc { "default";
+ }
+ }
+ }
+}
+
+group { "efl/pager/indicator";
+ images {
+ image: "ring_white_middle.png" COMP;
+ }
+ parts {
+ spacer { "base";
+ scale;
+ desc { "default";
+ }
+ }
+ image { "icon";
+ scale;
+ desc { "default";
+ image.normal: "ring_white_middle.png";
+ color: 0 0 0 255;
+ min: 6 6;
+ }
+ desc { "selected";
+ inherit: "default";
+ color: 255 0 0 255;
+ }
+ }
+ }
+ script {
+ public message(Msg_Type:type, id, ...) {
+ set_tween_state(PART:"icon", getfarg(2),
+ "default", 0.0, "selected", 0.0);
+ }
+ }
+}
diff --git a/data/elementary/themes/edc/efl/panes.edc b/data/elementary/themes/edc/efl/panes.edc
index 46a1c07d1c..6dc5e26537 100644
--- a/data/elementary/themes/edc/efl/panes.edc
+++ b/data/elementary/themes/edc/efl/panes.edc
@@ -1,52 +1,1006 @@
/* panes widget style information
[SIGNAL]
- elm,panes,fixed: Used for elm_panes_fixed_set()
- elm,panes,unfixed: Used for elm_panes_fixed_set()
+ efl,panes,fixed: Used for elm_panes_fixed_set()
+ efl,panes,unfixed: Used for elm_panes_fixed_set()
[SIGNAL EMIT]
- elm,action,click: Used for "clicked" smart callback.
- elm,action,click,double: Used for "clicked,double" smart callback.
- elm,action,press: Used for "press" smart callback.
- elm,action,unpress: Used for "unpress" smart callback.
+ efl,action,click: Used for "clicked" smart callback.
+ efl,action,click,double: Used for "clicked,double" smart callback.
+ efl,action,press: Used for "press" smart callback.
+ efl,action,unpress: Used for "unpress" smart callback.
*/
-group { "efl/panes/vertical";
- inherit: "elm/panes/vertical/default";
+#define PANEMIN 10
+#define PANEMIN2 16
+#define PANEWID 32
+
+group { name: "efl/panes/vertical";
+ images.image: "holes_vert.png" COMP;
parts {
- alias: "first" "elm.swallow.left";
- alias: "second" "elm.swallow.right";
+ //TODO: remove left/right
+ alias: "first" "efl.left";
+ alias: "second" "efl.right";
+ alias: "left" "efl.left";
+ alias: "right" "efl.right";
+
+ part { name: "whole"; type: SPACER;
+ description { state: "default" 0.0;
+ }
+ }
+ part { name: "right_constraint"; type: SPACER;
+ dragable { confine: "whole";
+ x: 1 1 1;
+ y: 0 0 0;
+ }
+ description { state: "default" 0.0;
+ max: 0 0;
+ }
+ }
+ part { name: "left_constraint"; type: SPACER;
+ dragable { confine: "whole";
+ x: 1 1 1;
+ y: 0 0 0;
+ }
+ description { state: "default" 0.0;
+ max: 0 0;
+ }
+ }
+ part { name: "sub_whole"; type: SPACER;
+ description { state: "default" 0.0;
+ rel1.relative: 1.0 0.0;
+ rel1.to_x: "left_constraint";
+ rel2.relative: 0.0 1.0;
+ rel2.to_x: "right_constraint";
+ }
+ }
+ part { name: "whole_left"; type: RECT;
+ description { state: "default" 0.0;
+ rel2.to_x: "efl.bar";
+ rel2.relative: 1.0 1.0;
+ rel2.offset: -4 -1;
+ }
+ }
+ part { name: "whole_right"; type: RECT;
+ description { state: "default" 0.0;
+ rel1.to_x: "efl.bar";
+ rel1.relative: 0.0 0.0;
+ rel1.offset: 3 0;
+ }
+ }
+ part { name: "efl.left"; type: SWALLOW;
+ clip_to: "whole_left";
+ description { state: "default" 0.0;
+ rel2.to_x: "efl.bar";
+ rel2.relative: 1.0 1.0;
+ rel2.offset: -4 -1;
+ }
+ }
+ part { name: "efl.right"; type: SWALLOW;
+ clip_to: "whole_right";
+ description { state: "default" 0.0;
+ rel1.to_x: "efl.bar";
+ rel1.relative: 0.0 0.0;
+ rel1.offset: 3 0;
+ }
+ }
+ part { name: "efl.bar"; type: SPACER;
+ dragable { confine: "sub_whole";
+ x: 1 1 1;
+ y: 0 0 0;
+ }
+ description { state: "default" 0.0;
+ max: 0 99999;
+ min: 0 14;
+ fixed: 1 1;
+ rel1.relative: 0.0 0.5;
+ rel2.relative: 1.0 0.5;
+ }
+ }
+ part { name: "dots"; mouse_events: 0;
+ description { state: "default" 0.0;
+ image.normal: "holes_vert.png";
+ rel1.to: "efl.bar";
+ rel2.to: "efl.bar";
+ FIXED_SIZE(4, 14)
+ }
+ }
+ part { name: "efl.event"; type: SWALLOW;
+ description { state: "default" 0.0;
+ visible: 0;
+ min: PANEMIN PANEMIN2;
+ fixed: 1 1;
+ rel1.to: "efl.bar";
+ rel2.to: "efl.bar";
+ }
+ }
+ part { name: "bar"; type: RECT;
+ dragable.events: "efl.bar";
+ description { state: "default" 0.0;
+ min: PANEMIN PANEWID;
+ max: 99999 99999;
+ fixed: 1 1;
+ rel1.to_x: "efl.event";
+ rel2.to_x: "efl.event";
+ color: 0 0 0 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ }
+ programs {
+ program {signal: "mouse,down,1"; source: "bar"; // for "press" smart callback
+ action: SIGNAL_EMIT "efl,action,press" "efl";
+ }
+ program { signal: "mouse,up,1"; source: "bar"; // for "unpress" smart callback
+ action: SIGNAL_EMIT "efl,action,unpress" "efl";
+ }
+ program { signal: "mouse,clicked,1"; source: "bar"; // for "clicked" smart callback
+ action: SIGNAL_EMIT "efl,action,click" "efl";
+ }
+ program { signal: "mouse,down,1,double"; source: "bar"; // for "clicked,double" smart callback
+ action: SIGNAL_EMIT "efl,action,click,double" "efl";
+ }
+ program { // for elm_panes_fixed_set()
+ signal: "efl,panes,fixed"; source: "efl";
+ action: STATE_SET "disabled" 0.0;
+ target: "bar";
+ }
+ program { // for elm_panes_fixed_set()
+ signal: "efl,panes,unfixed"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "bar";
+ }
}
}
-group { "efl/panes/horizontal";
- inherit: "elm/panes/horizontal/default";
+group { name: "efl/panes/horizontal";
+ images.image: "holes_horiz.png" COMP;
parts {
- alias: "first" "elm.swallow.left";
- alias: "second" "elm.swallow.right";
+ //TODO: remove left/right
+ alias: "first" "efl.left";
+ alias: "second" "efl.right";
+ alias: "left" "efl.left";
+ alias: "right" "efl.right";
+
+ part { name: "whole"; type: SPACER;
+ description { state: "default" 0.0;
+ }
+ }
+ part { name: "right_constraint"; type: SPACER;
+ dragable { confine: "whole";
+ x: 0 0 0;
+ y: 1 1 1;
+ }
+ description { state: "default" 0.0;
+ max: 0 0;
+ }
+ }
+ part { name: "left_constraint"; type: SPACER;
+ dragable { confine: "whole";
+ x: 0 0 0;
+ y: 1 1 1;
+ }
+ description { state: "default" 0.0;
+ max: 0 0;
+ }
+ }
+ part { name: "sub_whole"; type: SPACER;
+ description { state: "default" 0.0;
+ rel1.relative: 0.0 1.0;
+ rel1.to_y: "left_constraint";
+ rel2.relative: 1.0 0.0;
+ rel2.to_y: "right_constraint";
+ }
+ }
+ part { name: "whole_left"; type: RECT;
+ description { state: "default" 0.0;
+ rel2.to_y: "efl.bar";
+ rel2.relative: 1.0 1.0;
+ rel2.offset: -1 -4;
+ }
+ }
+ part { name: "whole_right"; type: RECT;
+ description { state: "default" 0.0;
+ rel1.to_y: "efl.bar";
+ rel1.relative: 0.0 0.0;
+ rel1.offset: 0 3;
+ }
+ }
+ part { name: "efl.left"; type: SWALLOW;
+ clip_to: "whole_left";
+ description { state: "default" 0.0;
+ rel2.to_y: "efl.bar";
+ rel2.relative: 1.0 1.0;
+ rel2.offset: -1 -4;
+ }
+ }
+ part { name: "efl.right"; type: SWALLOW;
+ clip_to: "whole_right";
+ description { state: "default" 0.0;
+ rel1.to_y: "efl.bar";
+ rel1.relative: 0.0 0.0;
+ rel1.offset: 0 3;
+ }
+ }
+ part { name: "efl.bar"; type: SPACER;
+ dragable { confine: "sub_whole";
+ x: 0 0 0;
+ y: 1 1 1;
+ }
+ description { state: "default" 0.0;
+ max: 99999 0;
+ min: 14 0;
+ fixed: 1 1;
+ rel1.relative: 0.5 0.0;
+ rel2.relative: 0.5 1.0;
+ }
+ }
+ part { name: "dots"; mouse_events: 0;
+ description { state: "default" 0.0;
+ image.normal: "holes_horiz.png";
+ rel1.to: "efl.bar";
+ rel2.to: "efl.bar";
+ FIXED_SIZE(14, 4)
+ }
+ }
+ part { name: "efl.event"; type: SWALLOW;
+ description { state: "default" 0.0;
+ visible: 0;
+ min: PANEMIN2 PANEMIN;
+ fixed: 1 1;
+ rel1.to: "efl.bar";
+ rel2.to: "efl.bar";
+ }
+ }
+ part { name: "bar"; type: RECT;
+ dragable.events: "efl.bar";
+ description { state: "default" 0.0;
+ min: PANEWID PANEMIN;
+ max: 99999 99999;
+ fixed: 1 1;
+ rel1.to_y: "efl.event";
+ rel2.to_y: "efl.event";
+ color: 0 0 0 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ }
+ programs {
+ program {signal: "mouse,down,1"; source: "bar"; // for "press" smart callback
+ action: SIGNAL_EMIT "efl,action,press" "efl";
+ }
+ program { signal: "mouse,up,1"; source: "bar"; // for "unpress" smart callback
+ action: SIGNAL_EMIT "efl,action,unpress" "efl";
+ }
+ program { signal: "mouse,clicked,1"; source: "bar"; // for "clicked" smart callback
+ action: SIGNAL_EMIT "efl,action,click" "efl";
+ }
+ program { signal: "mouse,down,1,double"; source: "bar"; // for "clicked,double" smart callback
+ action: SIGNAL_EMIT "efl,action,click,double" "efl";
+ }
+ program { // for elm_panes_fixed_set()
+ signal: "efl,panes,fixed"; source: "efl";
+ action: STATE_SET "disabled" 0.0;
+ target: "bar";
+ }
+ program { // for elm_panes_fixed_set()
+ signal: "efl,panes,unfixed"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "bar";
+ }
}
}
-group { "efl/panes/vertical:flush";
- inherit: "elm/panes/vertical/flush";
+group { name: "efl/panes/vertical:flush";
+ images.image: "downlight_glow_left.png" COMP;
+ images.image: "downlight_glow_right.png" COMP;
+ parts {
+ part { name: "whole"; type: SPACER;
+ description { state: "default" 0.0;
+ }
+ }
+ part { name: "right_constraint"; type: SPACER;
+ dragable { confine: "whole";
+ x: 1 1 1;
+ y: 0 0 0;
+ }
+ description { state: "default" 0.0;
+ max: 0 0;
+ }
+ }
+ part { name: "left_constraint"; type: SPACER;
+ dragable { confine: "whole";
+ x: 1 1 1;
+ y: 0 0 0;
+ }
+ description { state: "default" 0.0;
+ max: 0 0;
+ }
+ }
+ part { name: "sub_whole"; type: SPACER;
+ description { state: "default" 0.0;
+ rel1.relative: 1.0 0.0;
+ rel1.to_x: "left_constraint";
+ rel2.relative: 0.0 1.0;
+ rel2.to_x: "right_constraint";
+ }
+ }
+ part { name: "whole_left"; type: RECT;
+ description { state: "default" 0.0;
+ rel2.to_x: "efl.bar";
+ rel2.relative: 1.0 1.0;
+ }
+ }
+ part { name: "whole_right"; type: RECT;
+ description { state: "default" 0.0;
+ rel1.to_x: "efl.bar";
+ rel1.relative: 0.0 0.0;
+ }
+ }
+ part { name: "efl.left"; type: SWALLOW;
+ clip_to: "whole_left";
+ description { state: "default" 0.0;
+ rel2.to_x: "efl.bar";
+ rel2.relative: 1.0 1.0;
+ fixed: 1 0;
+ }
+ }
+ part { name: "efl.right"; type: SWALLOW;
+ clip_to: "whole_right";
+ description { state: "default" 0.0;
+ rel1.to_x: "efl.bar";
+ rel1.relative: 0.0 0.0;
+ fixed: 1 0;
+ }
+ }
+ part { name: "efl.bar"; type: SPACER;
+ dragable { confine: "sub_whole";
+ x: 1 1 1;
+ y: 0 0 0;
+ }
+ description { state: "default" 0.0;
+ max: 0 99999;
+ min: 0 14;
+ fixed: 1 1;
+ rel1.relative: 0.0 0.5;
+ rel2.relative: 1.0 0.5;
+ }
+ }
+ part { name: "efl.event"; type: SWALLOW;
+ description { state: "default" 0.0;
+ visible: 0;
+ min: PANEMIN PANEMIN2;
+ fixed: 1 1;
+ rel1.to: "efl.bar";
+ rel2.to: "efl.bar";
+ }
+ }
+ part { name: "bar"; type: RECT;
+ dragable.events: "efl.bar";
+ description { state: "default" 0.0;
+ min: PANEMIN PANEWID;
+ max: 99999 99999;
+ fixed: 1 1;
+ rel1.to_x: "efl.event";
+ rel1.relative: 0.0 0.25;
+ rel2.to_x: "efl.event";
+ rel2.relative: 1.0 0.75;
+ color: 0 0 0 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "glow1a"; mouse_events: 0;
+ description { state: "default" 0.0;
+ image.normal: "downlight_glow_left.png";
+ image.border: 0 3 0 0;
+ max: 32 99999;
+ rel2.to_x: "efl.bar";
+ color: 255 255 255 0;
+ align: 1.0 0.5;
+ }
+ description { state: "active" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ part { name: "glow1b"; mouse_events: 0;
+ description { state: "default" 0.0;
+ image.normal: "downlight_glow_right.png";
+ max: 4 99999;
+ rel1.to_x: "efl.bar";
+ color: 255 255 255 0;
+ align: 0.0 0.5;
+ }
+ description { state: "active" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ part { name: "glow2a"; mouse_events: 0;
+ description { state: "default" 0.0;
+ image.normal: "downlight_glow_left.png";
+ max: 4 99999;
+ rel2.to_x: "efl.bar";
+ color: 255 255 255 0;
+ align: 1.0 0.5;
+ }
+ description { state: "active" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ part { name: "glow2b"; mouse_events: 0;
+ description { state: "default" 0.0;
+ image.normal: "downlight_glow_right.png";
+ image.border: 3 0 0 0;
+ max: 32 99999;
+ rel1.to_x: "efl.bar";
+ color: 255 255 255 0;
+ align: 0.0 0.5;
+ }
+ description { state: "active" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ part { name: "bar1"; type: RECT; repeat_events: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "bar";
+ rel2.to: "bar";
+ rel2.relative: 0.5 1.0;
+ color: 0 0 0 0;
+ }
+ }
+ part { name: "bar2"; type: RECT; repeat_events: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "bar";
+ rel1.relative: 0.5 0.0;
+ rel2.to: "bar";
+ color: 0 0 0 0;
+ }
+ }
+ }
+ programs {
+ program {signal: "mouse,down,1"; source: "bar"; // for "press" smart callback
+ action: SIGNAL_EMIT "efl,action,press" "efl";
+ }
+ program { signal: "mouse,up,1"; source: "bar"; // for "unpress" smart callback
+ action: SIGNAL_EMIT "efl,action,unpress" "efl";
+ }
+ program { signal: "mouse,clicked,1"; source: "bar"; // for "clicked" smart callback
+ action: SIGNAL_EMIT "efl,action,click" "efl";
+ }
+ program { signal: "mouse,down,1,double"; source: "bar"; // for "clicked,double" smart callback
+ action: SIGNAL_EMIT "efl,action,click,double" "efl";
+ }
+ program { // for elm_panes_fixed_set()
+ signal: "efl,panes,fixed"; source: "efl";
+ action: STATE_SET "disabled" 0.0;
+ target: "bar";
+ }
+ program { // for elm_panes_fixed_set()
+ signal: "efl,panes,unfixed"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "bar";
+ }
+ program {
+ signal: "mouse,in"; source: "bar1";
+ action: STATE_SET "active" 0.0;
+ transition: BOUNCE 0.4 0.5 4;
+ target: "glow1a";
+ target: "glow1b";
+ }
+ program {
+ signal: "mouse,out"; source: "bar1";
+ action: STATE_SET "default" 0.0;
+ transition: DECELERATE 0.5;
+ target: "glow1a";
+ target: "glow1b";
+ }
+ program {
+ signal: "mouse,in"; source: "bar2";
+ action: STATE_SET "active" 0.0;
+ transition: BOUNCE 0.4 0.5 4;
+ target: "glow2a";
+ target: "glow2b";
+ }
+ program {
+ signal: "mouse,out"; source: "bar2";
+ action: STATE_SET "default" 0.0;
+ transition: DECELERATE 0.5;
+ target: "glow2a";
+ target: "glow2b";
+ }
+ }
}
-group { "efl/panes/horizontal:flush";
- inherit: "elm/panes/horizontal/flush";
+group { name: "efl/panes/horizontal:flush";
+ images.image: "downlight_glow.png" COMP;
+ images.image: "downlight_glow_up.png" COMP;
+ parts {
+ part { name: "whole"; type: SPACER;
+ description { state: "default" 0.0;
+ }
+ }
+ part { name: "right_constraint"; type: SPACER;
+ dragable { confine: "whole";
+ x: 0 0 0;
+ y: 1 1 1;
+ }
+ description { state: "default" 0.0;
+ max: 0 0;
+ }
+ }
+ part { name: "left_constraint"; type: SPACER;
+ dragable { confine: "whole";
+ x: 0 0 0;
+ y: 1 1 1;
+ }
+ description { state: "default" 0.0;
+ max: 0 0;
+ }
+ }
+ part { name: "sub_whole"; type: SPACER;
+ description { state: "default" 0.0;
+ rel1.relative: 0.0 1.0;
+ rel1.to_y: "left_constraint";
+ rel2.relative: 1.0 0.0;
+ rel2.to_y: "right_constraint";
+ }
+ }
+ part { name: "whole_left"; type: RECT;
+ description { state: "default" 0.0;
+ rel2.to_y: "efl.bar";
+ rel2.relative: 1.0 1.0;
+ }
+ }
+ part { name: "whole_right"; type: RECT;
+ description { state: "default" 0.0;
+ rel1.to_y: "efl.bar";
+ rel1.relative: 0.0 0.0;
+ }
+ }
+ part { name: "efl.left"; type: SWALLOW;
+ clip_to: "whole_left";
+ description { state: "default" 0.0;
+ rel2.to_y: "efl.bar";
+ rel2.relative: 1.0 1.0;
+ fixed: 0 1;
+ }
+ }
+ part { name: "efl.right"; type: SWALLOW;
+ clip_to: "whole_right";
+ description { state: "default" 0.0;
+ rel1.to_y: "efl.bar";
+ rel1.relative: 0.0 0.0;
+ fixed: 0 1;
+ }
+ }
+ part { name: "efl.bar"; type: SPACER;
+ dragable { confine: "sub_whole";
+ x: 0 0 0;
+ y: 1 1 1;
+ }
+ description { state: "default" 0.0;
+ max: 99999 0;
+ min: 14 0;
+ fixed: 1 1;
+ rel1.relative: 0.5 0.0;
+ rel2.relative: 0.5 1.0;
+ }
+ }
+ part { name: "efl.event"; type: SWALLOW;
+ description { state: "default" 0.0;
+ visible: 0;
+ min: PANEMIN2 PANEMIN;
+ fixed: 1 1;
+ rel1.to: "efl.bar";
+ rel2.to: "efl.bar";
+ }
+ }
+ part { name: "bar"; type: RECT;
+ dragable.events: "efl.bar";
+ description { state: "default" 0.0;
+ min: PANEWID PANEMIN;
+ max: 99999 99999;
+ fixed: 1 1;
+ rel1.to_y: "efl.event";
+ rel1.relative: 0.25 0.0;
+ rel2.to_y: "efl.event";
+ rel2.relative: 0.75 1.0;
+ color: 0 0 0 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "glow1a"; mouse_events: 0;
+ description { state: "default" 0.0;
+ image.normal: "downlight_glow_up.png";
+ image.border: 0 0 0 3;
+ max: 99999 32;
+ rel2.to_y: "efl.bar";
+ color: 255 255 255 0;
+ align: 0.5 1.0;
+ }
+ description { state: "active" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ part { name: "glow1b"; mouse_events: 0;
+ description { state: "default" 0.0;
+ image.normal: "downlight_glow.png";
+ max: 99999 4;
+ rel1.to_y: "efl.bar";
+ color: 255 255 255 0;
+ align: 0.5 0.0;
+ }
+ description { state: "active" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ part { name: "glow2a"; mouse_events: 0;
+ description { state: "default" 0.0;
+ image.normal: "downlight_glow_up.png";
+ max: 99999 4;
+ rel2.to_y: "efl.bar";
+ color: 255 255 255 0;
+ align: 0.5 1.0;
+ }
+ description { state: "active" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ part { name: "glow2b"; mouse_events: 0;
+ description { state: "default" 0.0;
+ image.normal: "downlight_glow.png";
+ image.border: 0 0 3 0;
+ max: 99999 32;
+ rel1.to_y: "efl.bar";
+ color: 255 255 255 0;
+ align: 0.5 0.0;
+ }
+ description { state: "active" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ part { name: "bar1"; type: RECT; repeat_events: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "bar";
+ rel2.to: "bar";
+ rel2.relative: 1.0 0.5;
+ color: 0 0 0 0;
+ }
+ }
+ part { name: "bar2"; type: RECT; repeat_events: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "bar";
+ rel1.relative: 0.0 0.5;
+ rel2.to: "bar";
+ color: 0 0 0 0;
+ }
+ }
+ }
+ programs {
+ program {
+ signal: "mouse,in"; source: "bar1";
+ action: STATE_SET "active" 0.0;
+ transition: BOUNCE 0.4 0.5 4;
+ target: "glow1a";
+ target: "glow1b";
+ }
+ program {
+ signal: "mouse,out"; source: "bar1";
+ action: STATE_SET "default" 0.0;
+ transition: DECELERATE 0.5;
+ target: "glow1a";
+ target: "glow1b";
+ }
+ program {
+ signal: "mouse,in"; source: "bar2";
+ action: STATE_SET "active" 0.0;
+ transition: BOUNCE 0.4 0.5 4;
+ target: "glow2a";
+ target: "glow2b";
+ }
+ program {
+ signal: "mouse,out"; source: "bar2";
+ action: STATE_SET "default" 0.0;
+ transition: DECELERATE 0.5;
+ target: "glow2a";
+ target: "glow2b";
+ }
+ program {signal: "mouse,down,1"; source: "bar"; // for "press" smart callback
+ action: SIGNAL_EMIT "efl,action,press" "efl";
+ }
+ program { signal: "mouse,up,1"; source: "bar"; // for "unpress" smart callback
+ action: SIGNAL_EMIT "efl,action,unpress" "efl";
+ }
+ program { signal: "mouse,clicked,1"; source: "bar"; // for "clicked" smart callback
+ action: SIGNAL_EMIT "efl,action,click" "efl";
+ }
+ program { signal: "mouse,down,1,double"; source: "bar"; // for "clicked,double" smart callback
+ action: SIGNAL_EMIT "efl,action,click,double" "efl";
+ }
+ program { // for elm_panes_fixed_set()
+ signal: "efl,panes,fixed"; source: "efl";
+ action: STATE_SET "disabled" 0.0;
+ target: "bar";
+ }
+ program { // for elm_panes_fixed_set()
+ signal: "efl,panes,unfixed"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "bar";
+ }
+ }
}
-group { "efl/panes/vertical:left-fold";
- inherit: "elm/panes/vertical/left-fold";
+group { name: "efl/panes/vertical:left-fold";
+ inherit: "efl/panes/vertical";
+ images.image: "icon_arrow_left.png" COMP;
+ images.image: "icon_arrow_right.png" COMP;
+ script {
+ public open;
+ public drag_x;
+ public drag_y;
+ }
+ parts {
+ spacer { "sub_whole";
+ desc { "default";
+ rel1.offset: 3 0;
+ }
+ }
+ image { "dots";
+ desc { "default";
+ image.normal: "icon_arrow_left.png";
+ FIXED_SIZE(14, 14)
+ }
+ desc { "closed";
+ inherit: "default" 0.0;
+ image.normal: "icon_arrow_right.png";
+ }
+ }
+ rect { "event";
+ repeat;
+ desc { "default";
+ rel1.to: "dots";
+ rel2.to: "dots";
+ color: 0 0 0 0;
+ }
+ }
+ }
+ programs {
+ program { signal: "load"; source: "";
+ script {
+ set_int(open, 1);
+ }
+ }
+ program { signal: "mouse,clicked,1"; source: "event";
+ script {
+ if (get_int(open) == 1)
+ {
+ new Float: dx;
+ new Float: dy;
+ set_int(open, 0);
+ get_drag(PART:"efl.bar", dx, dy);
+ set_float(drag_x, dx);
+ set_drag(PART:"efl.bar", 0.0, 0.5);
+ set_state(PART:"dots", "closed", 0.0);
+ }
+ else if (get_int(open) == 0)
+ {
+ set_int(open, 1);
+ set_drag(PART:"efl.bar", get_float(drag_x), 0.5);
+ set_state(PART:"dots", "default", 0.0);
+ }
+ }
+ }
+ }
}
-group { "efl/panes/vertical:right-fold";
- inherit: "elm/panes/vertical/right-fold";
+group { name: "efl/panes/vertical:right-fold";
+ inherit: "efl/panes/vertical";
+ images.image: "icon_arrow_left.png" COMP;
+ images.image: "icon_arrow_right.png" COMP;
+ script {
+ public open;
+ public drag_x;
+ public drag_y;
+ }
+ parts {
+ spacer { "sub_whole";
+ desc { "default";
+ rel2.offset: -4 0;
+ }
+ }
+ image { "dots";
+ desc { "default";
+ image.normal: "icon_arrow_right.png";
+ FIXED_SIZE(14, 17)
+ }
+ desc { "closed";
+ inherit: "default" 0.0;
+ image.normal: "icon_arrow_left.png";
+ }
+ }
+ rect { "event";
+ repeat;
+ desc { "default";
+ rel1.to: "dots";
+ rel2.to: "dots";
+ color: 0 0 0 0;
+ }
+ }
+ }
+ programs {
+ program { signal: "load"; source: "";
+ script {
+ set_int(open, 1);
+ }
+ }
+ program { signal: "mouse,clicked,1"; source: "event";
+ script {
+ if (get_int(open) == 1)
+ {
+ new Float: dx;
+ new Float: dy;
+ set_int(open, 0);
+ get_drag(PART:"efl.bar", dx, dy);
+ set_float(drag_x, dx);
+ set_drag(PART:"efl.bar", 1.0, 0.5);
+ set_state(PART:"dots", "closed", 0.0);
+ }
+ else if (get_int(open) == 0)
+ {
+ set_int(open, 1);
+ set_drag(PART:"efl.bar", get_float(drag_x), 0.5);
+ set_state(PART:"dots", "default", 0.0);
+ }
+ }
+ }
+ }
}
-group { "efl/panes/horizontal:up-fold";
- inherit: "elm/panes/horizontal/up-fold";
+group { name: "efl/panes/horizontal:up-fold";
+ inherit: "efl/panes/horizontal";
+ images.image: "icon_arrow_up.png" COMP;
+ images.image: "icon_arrow_down.png" COMP;
+ script {
+ public open;
+ public drag_x;
+ public drag_y;
+ }
+ parts {
+ spacer { "sub_whole";
+ desc { "default";
+ rel1.offset: 0 3;
+ }
+ }
+ image { "dots";
+ desc { "default";
+ image.normal: "icon_arrow_up.png";
+ FIXED_SIZE(17, 14)
+ }
+ desc { "closed";
+ inherit: "default" 0.0;
+ image.normal: "icon_arrow_down.png";
+ }
+ }
+ rect { "event";
+ repeat;
+ desc { "default";
+ rel1.to: "dots";
+ rel2.to: "dots";
+ color: 0 0 0 0;
+ }
+ }
+ }
+ programs {
+ program { signal: "load"; source: "";
+ script {
+ set_int(open, 1);
+ }
+ }
+ program { signal: "mouse,clicked,1"; source: "event";
+ script {
+ if (get_int(open) == 1)
+ {
+ new Float: dx;
+ new Float: dy;
+ set_int(open, 0);
+ get_drag(PART:"efl.bar", dx, dy);
+ set_float(drag_y, dy);
+ set_drag(PART:"efl.bar", 0.5, 0.0);
+ set_state(PART:"dots", "closed", 0.0);
+ }
+ else if (get_int(open) == 0)
+ {
+ set_int(open, 1);
+ set_drag(PART:"efl.bar", 0.5, get_float(drag_y));
+ set_state(PART:"dots", "default", 0.0);
+ }
+ }
+ }
+ }
}
-group { "efl/panes/horizontal:down-fold";
- inherit: "elm/panes/horizontal/down-fold";
+group { name: "efl/panes/horizontal:down-fold";
+ inherit: "efl/panes/horizontal";
+ images.image: "icon_arrow_up.png" COMP;
+ images.image: "icon_arrow_down.png" COMP;
+ script {
+ public open;
+ public drag_x;
+ public drag_y;
+ }
+ parts {
+ spacer { "sub_whole";
+ desc { "default";
+ rel2.offset: 0 -4;
+ }
+ }
+ image { "dots";
+ desc { "default";
+ image.normal: "icon_arrow_down.png";
+ FIXED_SIZE(17, 14)
+ }
+ desc { "closed";
+ inherit: "default" 0.0;
+ image.normal: "icon_arrow_up.png";
+ }
+ }
+ rect { "event";
+ repeat;
+ desc { "default";
+ rel1.to: "dots";
+ rel2.to: "dots";
+ color: 0 0 0 0;
+ }
+ }
+ }
+ programs {
+ program { signal: "load"; source: "";
+ script {
+ set_int(open, 1);
+ }
+ }
+ program { signal: "mouse,clicked,1"; source: "event";
+ script {
+ if (get_int(open) == 1)
+ {
+ new Float: dx;
+ new Float: dy;
+ set_int(open, 0);
+ get_drag(PART:"efl.bar", dx, dy);
+ set_float(drag_y, dy);
+ set_drag(PART:"efl.bar", 0.5, 1.0);
+ set_state(PART:"dots", "closed", 0.0);
+ }
+ else if (get_int(open) == 0)
+ {
+ set_int(open, 1);
+ set_drag(PART:"efl.bar", 0.5, get_float(drag_y));
+ set_state(PART:"dots", "default", 0.0);
+ }
+ }
+ }
+ }
}
diff --git a/data/elementary/themes/edc/efl/photocam.edc b/data/elementary/themes/edc/efl/photocam.edc
index ccc226ed39..e69f7ed355 100644
--- a/data/elementary/themes/edc/efl/photocam.edc
+++ b/data/elementary/themes/edc/efl/photocam.edc
@@ -1,3 +1,100 @@
-group { "efl/photocam";
- inherit: "elm/photocam/base/default";
+group { name: "efl/photocam";
+ inherit: "efl/scroller";
+ images.image: "knob_round_busy.png" COMP;
+ images.image: "glow_round_corners.png" COMP;
+ parts {
+ part { name: "busy_clip"; type: RECT;
+ description { state: "default" 0.0;
+ visible: 0;
+ color: 255 255 255 0;
+ }
+ description { state: "active" 0.0;
+ visible: 1;
+ color: 255 255 255 255;
+ }
+ }
+ part { name: "knob"; mouse_events: 0;
+ clip_to: "busy_clip";
+ scale: 1;
+ description { state: "default" 0.0;
+ image.normal: "knob_round_busy.png";
+ min: 40 40;
+ max: 40 40;
+ align: 0.0 0.0;
+ rel1.offset: 3 3;
+ rel2.offset: 3 3;
+ fixed: 1 1;
+ }
+ }
+ part { name: "knob_spinner"; mouse_events: 0;
+ clip_to: "busy_clip";
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "knob";
+ rel2.to: "knob";
+ image.normal: "glow_round_corners.png";
+ map.on: 1;
+ map.smooth: 1;
+ map.rotation.center: "knob";
+ }
+ description { state: "spin" 0.0;
+ inherit: "default" 0.0;
+ map.rotation.z: 360;
+ }
+ }
+ }
+ programs {
+ program { name: "spin";
+ signal: "efl,state,busy,start"; source: "efl";
+ action: ACTION_STOP;
+ target: "spin";
+ target: "spin0";
+ target: "spin1";
+ target: "spin2";
+ target: "spin3";
+ target: "spin4";
+ after: "spin0";
+ }
+ program { name: "spin0";
+ action: STATE_SET "default" 0.0;
+ target: "knob_spinner";
+ after: "spin1";
+ }
+ program { name: "spin1";
+ action: STATE_SET "spin" 0.0;
+ transition: LINEAR 1.0;
+ target: "knob_spinner";
+ after: "spin2";
+ }
+ program { name: "spin2";
+ action: STATE_SET "default" 0.0;
+ target: "knob_spinner";
+ after: "spin1";
+ }
+
+ program {
+ signal: "efl,state,busy,start"; source: "efl";
+ action: STATE_SET "active" 0.0;
+ transition: SINUSOIDAL 0.25;
+ target: "busy_clip";
+ }
+
+ program {
+ signal: "efl,state,busy,stop"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ transition: SINUSOIDAL 1.0;
+ target: "busy_clip";
+ after: "spin3";
+ }
+ program { name: "spin3";
+ action: ACTION_STOP;
+ target: "spin";
+ target: "spin2";
+ after: "spin4";
+ }
+ program { name: "spin4";
+ action: STATE_SET "default" 0.0;
+ target: "knob_spinner";
+ }
+ }
}
diff --git a/data/elementary/themes/edc/efl/pointer.edc b/data/elementary/themes/edc/efl/pointer.edc
new file mode 100644
index 0000000000..0794400b23
--- /dev/null
+++ b/data/elementary/themes/edc/efl/pointer.edc
@@ -0,0 +1,221 @@
+group { name: "efl/pointer";
+ images {
+ image: "pointer.png" COMP;
+ image: "pointer_glow.png" COMP;
+ }
+ parts {
+ part {
+ name: "base";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ aspect: 1.0 1.0;
+ min: 32 32;
+ /* force a specific aspect ratio so
+ * when it gets scaled it wont squash
+ * or stretch */
+ aspect_preference: BOTH;
+ /* both axes control aspect - thus it
+ * will be WITHIN the bounds the axes
+ * of thre part describe */
+ image {
+ normal: "pointer.png";
+ }
+ }
+ }
+ part { name: "glow";
+ description { state: "default" 0.0;
+ image.normal: "pointer_glow.png";
+ color: 255 255 255 0;
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ description { state: "faded" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 128;
+ }
+ }
+ part {
+ name: "efl.hotspot";
+ /* this is a "fake" swallow part
+ * that is used by e to determine
+ * the pointer hotspot - or where
+ * the actual mouse events get
+ * reported from on the cursor */
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ visible: 0;
+ fixed: 1 1;
+ rel1 {
+ /* the hotspot will scale with the cursor here */
+ to: "base";
+ relative: 0.1875 0.1875;
+ offset: 0 0;
+ }
+ rel2 {
+ to: "base";
+ relative: 0.1875 0.1875;
+ offset: 0 0;
+ }
+ }
+ }
+ }
+ programs {
+ program {
+ signal: "efl,action,mouse,down"; source: "efl";
+ action: STATE_SET "visible" 0.0;
+ target: "glow";
+ after: "fade";
+ }
+ program { name: "fade";
+ action: STATE_SET "default" 0.0;
+ transition: SINUSOIDAL 0.5;
+ target: "glow";
+ }
+ program { name: "pulse";
+ signal: "e,state,mouse,idle"; source: "e";
+ in: 10.0 0.0;
+ action: STATE_SET "faded" 0.0;
+ transition: SINUSOIDAL 0.25;
+ target: "glow";
+ after: "pulse2";
+ }
+ program { name: "pulse2";
+ action: STATE_SET "default" 0.0;
+ transition: SINUSOIDAL 0.5;
+ target: "glow";
+ after: "pulse";
+ }
+ program {
+ signal: "efl,action,mouse,move"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "glow";
+ after: "stop2";
+ }
+ program { name: "stop2";
+ action: ACTION_STOP;
+ target: "pulse";
+ target: "pulse2";
+ }
+ }
+}
+
+group { name: "efl/pointer:bottom_right_corner";
+ inherit: "efl/pointer";
+ images.image: "mini_box_glow.png" COMP;
+ parts {
+ part { name: "box";
+ insert_after: "glow";
+ description { state: "default" 0.0;
+ image.normal: "mini_box_glow.png";
+ image.border: 7 7 7 7;
+ rel1.relative: 0.3 0.3;
+ rel2.relative: 0.7 0.7;
+ }
+ description { state: "p1" 0.0;
+ inherit: "default" 0.0;
+ rel1.relative: 0.3 0.3;
+ rel2.relative: 1.0 1.0;
+ }
+ }
+ }
+ programs {
+ program { name: "box1";
+ signal: "load"; source: "";
+ action: STATE_SET "p1" 0.0;
+ transition: SINUSOIDAL 0.5;
+ target: "box";
+ after: "box2";
+ }
+ program { name: "box2";
+ action: STATE_SET "default" 0.0;
+ transition: SINUSOIDAL 0.5;
+ target: "box";
+ after: "box1";
+ }
+ }
+}
+
+group { name: "efl/pointer:bottom_left_corner";
+ inherit: "efl/pointer:bottom_right_corner";
+ parts {
+ part { name: "box";
+ description { state: "default" 0.0;
+ rel1.relative: 0.7 0.3;
+ rel2.relative: 1.0 0.7;
+ }
+ description { state: "p1" 0.0;
+ rel1.relative: 0.3 0.3;
+ rel2.relative: 1.0 1.0;
+ }
+ }
+ }
+}
+
+
+group { name: "efl/pointer:bottom_side";
+ inherit: "efl/pointer:bottom_right_corner";
+ parts {
+ part { name: "box";
+ description { state: "default" 0.0;
+ rel1.relative: 0.3 0.3;
+ rel2.relative: 1.0 0.7;
+ }
+ description { state: "p1" 0.0;
+ rel1.relative: 0.3 0.3;
+ rel2.relative: 1.0 1.0;
+ }
+ }
+ }
+}
+
+group { name: "efl/pointer:top_right_corner";
+ inherit: "efl/pointer:bottom_right_corner";
+ parts {
+ part { name: "box";
+ description { state: "default" 0.0;
+ rel1.relative: 0.3 0.3;
+ rel2.relative: 0.7 0.7;
+ }
+ description { state: "p1" 0.0;
+ rel1.relative: 0.3 0.0;
+ rel2.relative: 1.0 0.7;
+ }
+ }
+ }
+}
+
+group { name: "efl/pointer:top_left_corner";
+ inherit: "efl/pointer:bottom_right_corner";
+ parts {
+ part { name: "box";
+ description { state: "default" 0.0;
+ rel1.relative: 0.6 0.6;
+ rel2.relative: 1.0 1.0;
+ }
+ description { state: "p1" 0.0;
+ rel1.relative: 0.3 0.3;
+ rel2.relative: 1.0 1.0;
+ }
+ }
+ }
+}
+
+group { name: "efl/pointer:top_side";
+ inherit: "efl/pointer:bottom_right_corner";
+ parts {
+ part { name: "box";
+ description { state: "default" 0.0;
+ rel1.relative: 0.3 0.6;
+ rel2.relative: 1.0 1.0;
+ }
+ description { state: "p1" 0.0;
+ rel1.relative: 0.3 0.3;
+ rel2.relative: 1.0 1.0;
+ }
+ }
+ }
+}
diff --git a/data/elementary/themes/edc/efl/popup.edc b/data/elementary/themes/edc/efl/popup.edc
index 491d483b42..eb656c76e4 100644
--- a/data/elementary/themes/edc/efl/popup.edc
+++ b/data/elementary/themes/edc/efl/popup.edc
@@ -15,7 +15,7 @@ group { "efl/popup";
image.normal: "rounded_square.png";
}
}
- swallow { "elm.swallow.content";
+ swallow { "efl.content";
desc { "default";
rel.to: "base";
}
@@ -28,7 +28,7 @@ group { "efl/popup_alert";
alias: "efl/popup_alert_text";
images.image: "rounded_square.png" COMP;
parts {
- alias: "title" "elm.text.title";
+ alias: "title" "efl.text.title";
image { "bg";
desc { "default";
min: 100 100;
@@ -57,7 +57,7 @@ group { "efl/popup_alert";
min: 0 20;
}
}
- textblock { "elm.text.title";
+ textblock { "efl.text.title";
scale;
desc { "default";
fixed: 1 1;
@@ -72,7 +72,7 @@ group { "efl/popup_alert";
vis;
}
}
- swallow { "buttons";
+ swallow { "efl.buttons";
desc { "default";
fixed: 0 1;
rel.to: "base";
@@ -85,12 +85,12 @@ group { "efl/popup_alert";
min: 0 30;
}
}
- swallow { "elm.swallow.content";
+ swallow { "efl.content";
desc { "default";
rel1.to_x: "base";
rel1.to_y: "title_bg";
rel2.to_x: "base";
- rel2.to_y: "buttons";
+ rel2.to_y: "efl.buttons";
rel1.relative: 0.0 1.0;
rel2.relative: 1.0 0.0;
}
@@ -98,15 +98,15 @@ group { "efl/popup_alert";
}
programs {
program {
- signal: "elm,title,show"; source: "elm";
+ signal: "efl,title,show"; source: "efl";
action: STATE_SET "title_visible" 0.0;
target: "title_bg";
- target: "elm.text.title";
+ target: "efl.text.title";
}
program {
- signal: "elm,buttons,show"; source: "elm";
+ signal: "efl,buttons,show"; source: "efl";
action: STATE_SET "button_visible" 0.0;
- target: "buttons";
+ target: "efl.buttons";
}
}
}
@@ -125,17 +125,17 @@ group { "efl/popup/backwall";
desc { "default";
color: 0 0 0 64;
}
- desc { "show_image";
+ desc { "content_visible";
inherit: "default";
hid;
}
}
- swallow { "elm.swallow.image";
+ swallow { "efl.content";
desc { "default";
rel.to: "base";
hid;
}
- desc { "show_image";
+ desc { "content_visible";
inherit: "default";
vis;
}
@@ -150,20 +150,20 @@ group { "efl/popup/backwall";
programs {
program {
- signal: "elm,state,image,visible"; source: "elm";
- action: STATE_SET "show_image" 0.0;
+ signal: "efl,state,content,set"; source: "efl";
+ action: STATE_SET "content_visible" 0.0;
target: "base";
- target: "elm.swallow.image";
+ target: "efl.content";
}
program {
- signal: "elm,state,image,hidden"; source: "elm";
+ signal: "efl,state,content,unset"; source: "efl";
action: STATE_SET "default" 0.0;
target: "base";
- target: "elm.swallow.image";
+ target: "efl.content";
}
program {
signal: "mouse,clicked,1"; source: "block";
- action: SIGNAL_EMIT "elm,action,clicked" "elm";
+ action: SIGNAL_EMIT "efl,action,clicked" "efl";
}
}
}
@@ -172,7 +172,7 @@ group { "efl/popup_alert/button_layout1";
alias: "efl/popup_alert_scroll/button_layout1";
alias: "efl/popup_alert_text/button_layout1";
parts {
- swallow { "elm.swallow.button1";
+ swallow { "efl.button1";
}
}
}
@@ -188,13 +188,13 @@ group { "efl/popup_alert/button_layout2";
min: 5 5;
}
}
- swallow { "elm.swallow.button1";
+ swallow { "efl.button1";
desc { "default";
rel2.to_x: "div1";
rel2.relative: 0.0 1.0;
}
}
- swallow { "elm.swallow.button2";
+ swallow { "efl.button2";
desc { "default";
rel1.to_x: "div1";
rel1.relative: 1.0 0.0;
@@ -221,13 +221,13 @@ group { "efl/popup_alert/button_layout3";
min: 5 5;
}
}
- swallow { "elm.swallow.button1";
+ swallow { "efl.button1";
desc { "default";
rel2.to_x: "div1";
rel2.relative: 0.0 1.0;
}
}
- swallow { "elm.swallow.button2";
+ swallow { "efl.button2";
desc { "default";
rel1.to_x: "div1";
rel2.to_x: "div2";
@@ -235,7 +235,7 @@ group { "efl/popup_alert/button_layout3";
rel2.relative: 0.0 1.0;
}
}
- swallow { "elm.swallow.button3";
+ swallow { "efl.button3";
desc { "default";
rel1.to_x: "div2";
rel1.relative: 1.0 0.0;
@@ -251,8 +251,26 @@ group { "efl/popup_alert/button";
}
group { "efl/popup_alert_scroll/scroller";
- inherit: "elm/scroller/base/popup/no_inset_shadow";
+ inherit: "efl/scroller";
alias: "efl/popup_alert_text/scroller";
+ parts {
+ swallow { "efl.content";
+ desc { "default";
+ rel1.offset: 0 0;
+ rel2.offset: 0 0;
+ }
+ }
+ spacer { "inset";
+ desc { "default";
+ hid;
+ }
+ }
+ spacer { "shadow";
+ desc { "default";
+ hid;
+ }
+ }
+ }
}
group { "efl/popup_alert_text/text";
diff --git a/data/elementary/themes/edc/efl/progress.edc b/data/elementary/themes/edc/efl/progress.edc
index 2cb11b29db..1d48b20545 100644
--- a/data/elementary/themes/edc/efl/progress.edc
+++ b/data/elementary/themes/edc/efl/progress.edc
@@ -1,20 +1,1402 @@
group { "efl/progressbar/horizontal";
- inherit: "elm/progressbar/horizontal/default";
+ images.image: "inset_bar_horiz_base.png" COMP;
+ images.image: "inset_bar_horiz_light.png" COMP;
+ images.image: "inset_bar_horiz_inside_base.png" COMP;
+ images.image: "inset_bar_horiz_inside_light.png" COMP;
+ images.image: "inset_bar_horiz_glow_base.png" COMP;
+ images.image: "inset_bar_horiz_glow_light.png" COMP;
+ images.image: "inset_bar_horiz_glow_inv_base.png" COMP;
+ images.image: "inset_bar_horiz_glow_inv_light.png" COMP;
+ images.image: "inset_bar_horiz_glow_mid_base.png" COMP;
+ images.image: "inset_bar_horiz_glow_mid_light.png" COMP;
+#define ICON 1
+#define LABEL 2
+#define DISABLE 4
+ script {
+ public slmode;
+ public eval_mode(m) {
+ new ic = m & ICON;
+ new l = m & LABEL;
+ new d = m & DISABLE;
+ if (l) {
+ if (!d) {
+ set_state(PART:"efl.text", "visible", 0.0);
+ } else {
+ set_state(PART:"efl.text", "disabled_visible", 0.0);
+ }
+ } else {
+ set_state(PART:"efl.text", "default", 0.0);
+ }
+ if (ic) {
+ set_state(PART:"efl.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
+ } else {
+ set_state(PART:"efl.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
+ }
+ if (!d) {
+ set_state(PART:"dis_clip", "default", 0.0);
+ } else {
+ set_state(PART:"dis_clip", "disabled", 0.0);
+ }
+ }
+ }
+ parts {
+ part { name: "dis_clip"; type: RECT;
+ description { state: "default" 0.0;
+ rel1.to: "efl.content";
+ rel2.to: "efl.content";
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 64;
+ }
+ }
+ part { name: "pulse_clip"; type: RECT;
+ description { state: "default" 0.0;
+ rel1.relative: -2.0 -2.0;
+ rel2.relative: 3.0 3.0;
+ visible: 0;
+ }
+ description { state: "pulse" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ part { name: "fract_clip"; type: RECT;
+ description { state: "default" 0.0;
+ rel1.relative: -2.0 -2.0;
+ rel2.relative: 3.0 3.0;
+ }
+ description { state: "pulse" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "efl.content"; type: SWALLOW;
+ clip_to: "dis_clip";
+ required;
+ description { state: "default" 0.0;
+ visible: 0;
+ align: 0.0 0.5;
+ fixed: 1 0;
+ rel1.offset: 0 2;
+ rel2.offset: -1 -3;
+ rel2.relative: 0.0 1.0;
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ aspect: 1.0 1.0; aspect_preference: VERTICAL;
+ rel1.offset: 2 2;
+ rel2.offset: 2 -3;
+ }
+ }
+ part { name: "sizer_content"; type: TEXT; mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ visible: 0;
+ text { font: FN; size: 10;
+ min: 0 0;
+ text_class: "progressbar_text";
+ }
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ rel1.to: "efl.content";
+ rel2.to: "efl.content";
+ text {
+ min: 1 1;
+ ellipsis: -1;
+ text: "M";
+ }
+ }
+ }
+ part { name: "efl.text"; type: TEXT; mouse_events: 0;
+ effect: SHADOW BOTTOM;
+ scale: 1;
+ required;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ align: 0.0 0.5;
+ rel1.to_x: "efl.content";
+ rel1.relative: 1.0 0.0;
+ rel1.offset: -1 2;
+ rel2.to_x: "efl.content";
+ rel2.relative: 1.0 1.0;
+ rel2.offset: -1 -3;
+ color: FN_COL_DEFAULT;
+ color_class: "progressbar_text";
+ text { font: FN; size: 10;
+ text_class: "progressbar";
+ min: 0 0;
+ align: 0.0 0.5;
+ }
+ visible: 0;
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ fixed: 1 0;
+ visible: 1;
+ rel1.offset: 2 2;
+ rel2.offset: 2 -3;
+ text.min: 1 1;
+ text.ellipsis: -1;
+ }
+ description { state: "disabled_visible" 0.0;
+ inherit: "visible" 0.0;
+ color_class: "progressbar_text_disabled";
+ color: FN_COL_DISABLE_LIGHTER_SHADOW;
+ }
+ }
+ part { name: "bg-hi";
+ description { state: "default" 0.0;
+ rel1.to: "bg";
+ rel1.offset: 0 1;
+ rel2.to: "bg";
+ rel2.offset: -1 0;
+ image.normal: "inset_bar_horiz_light.png";
+ image.border: 32 32 0 0;
+ image.border_scale_by: 0.25; image.border_scale: 1;
+ }
+ }
+ part { name: "bg";
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 16 16;
+ max: -1 16;
+ rel1.to_x: "efl.text";
+ rel1.relative: 1.0 0.0;
+ rel1.offset: 3 3;
+ rel2.offset: -4 -4;
+ image.normal: "inset_bar_horiz_base.png";
+ image.border: 32 32 0 0;
+ image.border_scale_by: 0.25; image.border_scale: 1;
+ }
+ }
+ part { name: "ins0"; type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 0;
+ rel1.to: "bg";
+ rel2.to: "bg";
+ rel2.relative: 0.0 1.0;
+ min: 5 16;
+ align: 0.0 0.5;
+ }
+ }
+ part { name: "ins1"; type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 0;
+ rel1.to: "bg";
+ rel1.relative: 1.0 0.0;
+ rel2.to: "bg";
+ min: 5 16;
+ align: 1.0 0.5;
+ }
+ }
+ part { name: "inside-hi";
+ scale: 1;
+ description { state: "default" 0.0;
+ rel1.to: "inside";
+ rel1.offset: 0 1;
+ rel2.to: "inside";
+ rel2.offset: -1 0;
+ image.normal: "inset_bar_horiz_inside_light.png";
+ image.border: 8 8 0 0;
+ image.border_scale_by: 0.25; image.border_scale: 1;
+ }
+ }
+ part { name: "inside";
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 4 4;
+ rel1.to: "ins0";
+ rel1.relative: 1.0 (6/16);
+ rel2.to: "ins1";
+ rel2.relative: 0.0 (10/16);
+ image.normal: "inset_bar_horiz_inside_base.png";
+ image.border: 8 8 0 0;
+ image.border_scale_by: 0.25; image.border_scale: 1;
+ }
+ }
+ part { name: "efl.bar"; type: SWALLOW; mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.to: "inside";
+ rel2.to: "inside";
+ }
+ }
+ part { name: "efl.cur.progressbar"; mouse_events: 0; type: SPACER;
+ scale: 1;
+ dragable.confine: "inside";
+ dragable.x: 1 1 1;
+ dragable.y: 0 0 0;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ min: 8 4;
+ max: 8 4;
+ rel1.to: "inside";
+ rel2.to: "inside";
+ }
+ }
+ part { name: "barend"; type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 0;
+ min: 14 16;
+ rel1.to_x: "efl.cur.progressbar";
+ rel1.relative: 1.0 0.0;
+ rel2.to_x: "efl.cur.progressbar";
+ rel2.relative: 1.0 1.0;
+ align: 0.0 0.5;
+ }
+ description { state: "inv" 0.0;
+ inherit: "default" 0.0;
+ rel1.relative: 0.0 0.0;
+ rel2.relative: 0.0 1.0;
+ align: 1.0 0.5;
+ }
+ }
+ part { name: "bar";
+ clip_to: "fract_clip";
+ scale: 1;
+ description { state: "default" 0.0;
+ rel1.to_x: "ins0";
+ rel1.to_y: "bg";
+ rel1.relative: (12/16) -0.25;
+ rel2.to_x: "barend";
+ rel2.to_y: "bg";
+ rel2.relative: 1.0 1.25;
+ image.normal: "inset_bar_horiz_glow_base.png";
+ image.border: 0 72 0 0;
+ image.border_scale_by: 0.25; image.border_scale: 1;
+ }
+ description { state: "inv" 0.0;
+ inherit: "default" 0.0;
+ rel1.to_x: "barend";
+ rel1.relative: 0.0 -0.25;
+ rel2.to_x: "ins1";
+ rel2.relative: (4/16) 1.25;
+ image.normal: "inset_bar_horiz_glow_inv_base.png";
+ image.border: 72 0 0 0;
+ }
+ }
+ part { name: "insidep0"; type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 0;
+ min: 20 16;
+ rel1.to_x: "inside";
+ rel1.relative: 0.0 0.0;
+ rel2.to_x: "inside";
+ rel2.relative: 0.0 1.0;
+ align: 1.0 0.5;
+ }
+ }
+ part { name: "insidep1"; type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 0;
+ min: 20 16;
+ rel1.to_x: "inside";
+ rel1.relative: 1.0 0.0;
+ rel2.to_x: "inside";
+ rel2.relative: 1.0 1.0;
+ align: 0.0 0.5;
+ }
+ }
+ part { name: "pulse";
+ clip_to: "pulse_clip";
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ min: 64 24;
+ max: 64 24;
+ rel1.to_x: "insidep0";
+ rel1.to_y: "bar";
+ rel1.relative: 0.0 0.0;
+ rel2.to_x: "insidep1";
+ rel2.to_y: "bar";
+ rel2.relative: 1.0 1.0;
+ image.normal: "inset_bar_horiz_glow_mid_base.png";
+ align: 0.0 0.5;
+ }
+ description { state: "end" 0.0;
+ inherit: "default" 0.0;
+ align: 1.0 0.5;
+ }
+ }
+ part { name: "efl.text.status"; type: TEXT; mouse_events: 0;
+ scale: 1;
+ effect: GLOW;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "inside";
+ rel2.to: "inside";
+ color_class: "progress_status";
+ align: 1.0 0.5;
+ text { font: FN; size: 10;
+ min: 0 1;
+ text_class: "progress_status";
+ align: 1.0 0.5;
+ }
+ color: FN_COL_HIGHLIGHT_CLICKED;
+ visible: 1;
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "pulse2";
+ clip_to: "pulse_clip";
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ min: 36 14;
+ max: 36 14;
+ rel1.to: "pulse";
+ rel2.to: "pulse";
+ image.normal: "inset_bar_horiz_glow_mid_light.png";
+ color: 255 255 255 0;
+ }
+ description { state: "glow" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ part { name: "light";
+ clip_to: "fract_clip";
+ scale: 1;
+ description { state: "default" 0.0;
+ max: 36 11;
+ rel1.to_x: "bar";
+ rel1.to_y: "bar";
+ rel1.relative: 0.0 (26/96);
+ rel2.to_x: "barend";
+ rel2.to_y: "bar";
+ rel2.relative: 0.2 ((26+44)/96);
+ align: 1.0 0.0;
+ image.normal: "inset_bar_horiz_glow_light.png";
+ image.border: 0 20 0 0;
+ image.border_scale_by: 0.25; image.border_scale: 1;
+ color: 255 255 255 0;
+ }
+ description { state: "inv" 0.0;
+ inherit: "default" 0.0;
+ rel1.to_x: "barend";
+ rel1.to_y: "bar";
+ rel1.relative: 0.8 (26/96);
+ rel2.to_x: "bar";
+ rel2.to_y: "bar";
+ rel2.relative: 1.0 ((26+44)/96);
+ align: 0.0 0.0;
+ image.normal: "inset_bar_horiz_glow_inv_light.png";
+ image.border: 20 0 0 0;
+ }
+ }
+ }
+ programs {
+ program { name: "inverted-on";
+ signal: "efl,state,inverted,on"; source: "efl";
+ action: STATE_SET "inv" 0.0;
+ target: "bar";
+ target: "barend";
+ target: "light";
+ }
+ program { name: "inverted-off";
+ signal: "efl,state,inverted,off"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "bar";
+ target: "barend";
+ target: "light";
+ }
+ program { name: "drag-set";
+ signal: "drag,set"; source: "efl.cur.progressbar";
+ script {
+ new a, Float:dx, Float:dy, Float:vl, st[20];
+
+ get_drag(PART:"efl.cur.progressbar", dx, dy);
+ get_state(PART:"bar", st, 19, vl);
+ if (!strcmp(st, "inv")) {
+ a = round(((1.0 - dx) * 255) / 0.2);
+ custom_state(PART:"light", "inv", 0.0);
+ } else {
+ a = round((dx * 255) / 0.2);
+ custom_state(PART:"light", "default", 0.0);
+ }
+ if (a > 255) { a = 255; }
+ set_state_val(PART:"light", STATE_COLOR, 255, 255, 255, a);
+ set_state(PART:"light", "custom", 0.0);
+ }
+ }
+ program { name: "pulse-mode0";
+ signal: "efl,state,pulse"; source: "efl";
+ action: STATE_SET "hidden" 0.0;
+ target: "efl.text.status";
+ after: "pulse-mode1";
+ }
+ program { name: "pulse-mode1";
+ signal: "efl,state,pulse,start"; source: "efl";
+ action: STATE_SET "pulse" 0.0;
+ target: "fract_clip";
+ }
+ program { name: "pulse-start";
+ signal: "efl,state,pulse,start"; source: "efl";
+ action: STATE_SET "pulse" 0.0;
+ target: "pulse_clip";
+ target: "fract_clip";
+ after: "pulse0";
+ after: "pulse0.1";
+ }
+ program { name: "pulse0.1";
+ action: STATE_SET "glow" 0.0;
+ transition: ACCELERATE 0.4;
+ target: "pulse2";
+ after: "pulse0.2";
+ }
+ program { name: "pulse0.2";
+ action: STATE_SET "default" 0.0;
+ transition: DECELERATE 0.4;
+ target: "pulse2";
+ }
+ program { name: "pulse0";
+ action: STATE_SET "end" 0.0;
+ transition: SINUSOIDAL 0.8;
+ target: "pulse";
+ after: "pulse1";
+ after: "pulse0.1";
+ }
+ program { name: "pulse1";
+ action: STATE_SET "default" 0.0;
+ transition: SINUSOIDAL 0.8;
+ target: "pulse";
+ after: "pulse0";
+ after: "pulse0.1";
+ }
+ program { name: "fraction";
+ signal: "efl,state,fraction"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "efl.text.status";
+ after: "pulse-stop";
+ }
+ program { name: "elmpulse-stop";
+ signal: "efl,state,pulse,stop"; source: "efl";
+ action: ACTION_STOP;
+ target: "pulse0";
+ target: "pulse1";
+ after: "pulse-stop";
+ }
+ program { name: "pulse-stop";
+ action: STATE_SET "default" 0.0;
+ target: "pulse_clip";
+ }
+ program { name: "units-visible";
+ signal: "efl,state,units,visible"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "efl.text.status";
+ }
+ program { name: "units-hidden";
+ signal: "efl,state,units,hidden"; source: "efl";
+ action: STATE_SET "hidden" 0.0;
+ target: "efl.text.status";
+ }
+ program { name: "text-visible";
+ signal: "efl,state,text,set"; source: "efl";
+ script {
+ new m = get_int(slmode);
+ m |= LABEL; set_int(slmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "text-hidden";
+ signal: "efl,state,text,unset"; source: "efl";
+ script {
+ new m = get_int(slmode);
+ m &= ~LABEL; set_int(slmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "icon-visible";
+ signal: "efl,state,content,set"; source: "efl";
+ script {
+ new m = get_int(slmode);
+ m |= ICON; set_int(slmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "icon-hidden";
+ signal: "efl,state,content,unset"; source: "efl";
+ script {
+ new m = get_int(slmode);
+ m &= ~ICON; set_int(slmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "state-disabled";
+ signal: "efl,state,disabled"; source: "efl";
+ script {
+ new m = get_int(slmode);
+ m |= DISABLE; set_int(slmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "state-enabled";
+ signal: "efl,state,enabled"; source: "efl";
+ script {
+ new m = get_int(slmode);
+ m &= ~DISABLE; set_int(slmode, m);
+ eval_mode(m);
+ }
+ }
+ }
+#undef ICON
+#undef LABEL
+#undef UNITS
+#undef DISABLE
}
group { "efl/progressbar/vertical";
- inherit: "elm/progressbar/vertical/default";
+ images.image: "inset_bar_vert_base.png" COMP;
+ images.image: "inset_bar_vert_light.png" COMP;
+ images.image: "inset_bar_vert_inside_base.png" COMP;
+ images.image: "inset_bar_vert_inside_light.png" COMP;
+ images.image: "inset_bar_vert_glow_base.png" COMP;
+ images.image: "inset_bar_vert_glow_light.png" COMP;
+ images.image: "inset_bar_vert_glow_inv_base.png" COMP;
+ images.image: "inset_bar_vert_glow_inv_light.png" COMP;
+ images.image: "inset_bar_vert_glow_mid_base.png" COMP;
+ images.image: "inset_bar_vert_glow_mid_light.png" COMP;
+#define ICON 1
+#define LABEL 2
+#define DISABLE 4
+ script {
+ public slmode;
+ public eval_mode(m) {
+ new ic = m & ICON;
+ new l = m & LABEL;
+ new d = m & DISABLE;
+ if (l) {
+ if (!d) {
+ set_state(PART:"efl.text", "visible", 0.0);
+ } else {
+ set_state(PART:"efl.text", "disabled_visible", 0.0);
+ }
+ } else {
+ set_state(PART:"efl.text", "default", 0.0);
+ }
+ if (ic) {
+ set_state(PART:"efl.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
+ } else {
+ set_state(PART:"efl.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
+ }
+ if (!d) {
+ set_state(PART:"dis_clip", "default", 0.0);
+ } else {
+ set_state(PART:"dis_clip", "disabled", 0.0);
+ }
+ }
+ }
+ parts {
+ part { name: "dis_clip"; type: RECT;
+ description { state: "default" 0.0;
+ rel1.to: "efl.content";
+ rel2.to: "efl.content";
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 64;
+ }
+ }
+ part { name: "pulse_clip"; type: RECT;
+ description { state: "default" 0.0;
+ rel1.relative: -2.0 -2.0;
+ rel2.relative: 3.0 3.0;
+ visible: 0;
+ }
+ description { state: "pulse" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ part { name: "fract_clip"; type: RECT;
+ description { state: "default" 0.0;
+ rel1.relative: -2.0 -2.0;
+ rel2.relative: 3.0 3.0;
+ }
+ description { state: "pulse" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "efl.content"; type: SWALLOW;
+ clip_to: "dis_clip";
+ required;
+ description { state: "default" 0.0;
+ visible: 0;
+ align: 0.5 0.0;
+ fixed: 0 1;
+ rel1.offset: 2 0;
+ rel2.offset: -3 -1;
+ rel2.relative: 1.0 0.0;
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ aspect: 1.0 1.0; aspect_preference: HORIZONTAL;
+ rel1.offset: 2 2;
+ rel2.offset: -3 2;
+ }
+ }
+ part { name: "sizer_content"; type: TEXT; mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ visible: 0;
+ text { font: FN; size: 10;
+ min: 0 0;
+ text_class: "progressbar_text";
+ }
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ rel1.to: "efl.content";
+ rel2.to: "efl.content";
+ text {
+ min: 1 1;
+ ellipsis: -1;
+ text: "M";
+ }
+ }
+ }
+ part { name: "efl.text"; type: TEXT; mouse_events: 0;
+ effect: SHADOW BOTTOM;
+ scale: 1;
+ required;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ align: 0.5 0.0;
+ rel1.to_y: "efl.content";
+ rel1.relative: 0.0 1.0;
+ rel1.offset: 2 -1;
+ rel2.to_y: "efl.content";
+ rel2.relative: 1.0 1.0;
+ rel2.offset: -3 -1;
+ color: FN_COL_DEFAULT;
+ color_class: "progressbar_text";
+ text { font: FN; size: 10;
+ text_class: "progressbar";
+ min: 0 0;
+ align: 0.5 0.0;
+ }
+ visible: 0;
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ fixed: 0 1;
+ visible: 1;
+ rel1.offset: 2 2;
+ rel2.offset: -3 2;
+ text.min: 1 1;
+ text.ellipsis: -1;
+ }
+ description { state: "disabled_visible" 0.0;
+ inherit: "visible" 0.0;
+ color_class: "progressbar_text_disabled";
+ color: FN_COL_DISABLE_LIGHTER_SHADOW;
+ }
+ }
+ part { name: "bg-hi";
+ description { state: "default" 0.0;
+ rel1.to: "bg";
+ rel1.offset: 0 1;
+ rel2.to: "bg";
+ rel2.offset: -1 0;
+ image.normal: "inset_bar_vert_light.png";
+ image.border: 0 0 32 32;
+ image.border_scale_by: 0.25; image.border_scale: 1;
+ }
+ }
+ part { name: "bg";
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 16 16;
+ max: 16 -1;
+ rel1.to_y: "efl.text";
+ rel1.relative: 0.0 1.0;
+ rel1.offset: 3 3;
+ rel2.offset: -4 -4;
+ image.normal: "inset_bar_vert_base.png";
+ image.border: 0 0 32 32;
+ image.border_scale_by: 0.25; image.border_scale: 1;
+ }
+ }
+ part { name: "ins0"; type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 0 1;
+ rel1.to: "bg";
+ rel2.to: "bg";
+ rel2.relative: 1.0 0.0;
+ min: 16 5;
+ align: 0.5 0.0;
+ }
+ }
+ part { name: "ins1"; type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 0 1;
+ rel1.to: "bg";
+ rel1.relative: 0.0 1.0;
+ rel2.to: "bg";
+ min: 16 5;
+ align: 0.5 1.0;
+ }
+ }
+ part { name: "inside-hi";
+ scale: 1;
+ description { state: "default" 0.0;
+ rel1.to: "inside";
+ rel1.offset: 0 1;
+ rel2.to: "inside";
+ rel2.offset: -1 0;
+ image.normal: "inset_bar_vert_inside_light.png";
+ image.border: 0 0 8 8;
+ image.border_scale_by: 0.25; image.border_scale: 1;
+ }
+ }
+ part { name: "inside";
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 4 4;
+ rel1.to: "ins0";
+ rel1.relative: (6/16) 1.0;
+ rel2.to: "ins1";
+ rel2.relative: (10/16) 0.0;
+ image.normal: "inset_bar_vert_inside_base.png";
+ image.border: 0 0 8 8;
+ image.border_scale_by: 0.25; image.border_scale: 1;
+ }
+ }
+ part { name: "efl.bar"; type: SWALLOW; mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.to: "inside";
+ rel2.to: "inside";
+ }
+ }
+ part { name: "efl.cur.progressbar"; mouse_events: 0; type: SPACER;
+ scale: 1;
+ dragable.confine: "inside";
+ dragable.x: 0 0 0;
+ dragable.y: 1 1 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ min: 4 8;
+ max: 4 8;
+ rel1.to: "inside";
+ rel2.to: "inside";
+ }
+ }
+ part { name: "barend"; type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 0 1;
+ min: 16 14;
+ rel1.to_y: "efl.cur.progressbar";
+ rel1.relative: 0.0 1.0;
+ rel2.to_y: "efl.cur.progressbar";
+ rel2.relative: 1.0 1.0;
+ align: 0.5 0.0;
+ }
+ description { state: "inv" 0.0;
+ inherit: "default" 0.0;
+ rel1.relative: 0.0 0.0;
+ rel2.relative: 1.0 0.0;
+ align: 0.5 1.0;
+ }
+ }
+ part { name: "bar";
+ clip_to: "fract_clip";
+ scale: 1;
+ description { state: "default" 0.0;
+ rel1.to_y: "ins0";
+ rel1.to_x: "bg";
+ rel1.relative: -0.25 (12/16);
+ rel2.to_y: "barend";
+ rel2.to_x: "bg";
+ rel2.relative: 1.25 1.0;
+ image.normal: "inset_bar_vert_glow_base.png";
+ image.border: 0 0 0 72;
+ image.border_scale_by: 0.25; image.border_scale: 1;
+ }
+ description { state: "inv" 0.0;
+ inherit: "default" 0.0;
+ rel1.to_y: "barend";
+ rel1.relative: -0.25 0.0;
+ rel2.to_y: "ins1";
+ rel2.relative: 1.25 (4/16);
+ image.normal: "inset_bar_vert_glow_inv_base.png";
+ image.border: 0 0 72 0;
+ }
+ }
+ part { name: "insidep0"; type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 0 1;
+ min: 16 20;
+ rel1.to_y: "inside";
+ rel1.relative: 0.0 0.0;
+ rel2.to_y: "inside";
+ rel2.relative: 1.0 0.0;
+ align: 0.5 1.0;
+ }
+ }
+ part { name: "insidep1"; type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 0 1;
+ min: 16 20;
+ rel1.to_y: "inside";
+ rel1.relative: 0.0 1.0;
+ rel2.to_y: "inside";
+ rel2.relative: 1.0 1.0;
+ align: 0.5 0.0;
+ }
+ }
+ part { name: "pulse";
+ clip_to: "pulse_clip";
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ min: 24 64;
+ max: 24 64;
+ rel1.to_y: "insidep0";
+ rel1.to_x: "bar";
+ rel1.relative: 0.0 0.0;
+ rel2.to_y: "insidep1";
+ rel2.to_x: "bar";
+ rel2.relative: 1.0 1.0;
+ image.normal: "inset_bar_vert_glow_mid_base.png";
+ align: 0.5 0.0;
+ }
+ description { state: "end" 0.0;
+ inherit: "default" 0.0;
+ align: 0.5 1.0;
+ }
+ }
+ part { name: "statbox"; type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "inside";
+ rel2.to: "inside";
+ aspect: 1.0 1.0; aspect_preference: NONE;
+ }
+ }
+ part { name: "efl.text.status"; type: TEXT; mouse_events: 0;
+ scale: 1;
+ effect: GLOW;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "statbox";
+ rel2.to: "statbox";
+ color_class: "progress_status";
+ align: 1.0 0.5;
+ text { font: FN; size: 10;
+ min: 0 1;
+ text_class: "progress_status";
+ align: 1.0 0.5;
+ }
+ color: FN_COL_HIGHLIGHT_CLICKED;
+ visible: 1;
+ map.on: 1;
+ map.smooth: 0;
+ map.rotation.center: "statbox";
+ map.rotation.z: 90;
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "pulse2";
+ clip_to: "pulse_clip";
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ min: 14 36;
+ max: 14 36;
+ rel1.to: "pulse";
+ rel2.to: "pulse";
+ image.normal: "inset_bar_vert_glow_mid_light.png";
+ color: 255 255 255 0;
+ }
+ description { state: "glow" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ part { name: "light";
+ clip_to: "fract_clip";
+ scale: 1;
+ description { state: "default" 0.0;
+ max: 11 36;
+ rel1.to_y: "bar";
+ rel1.to_x: "bar";
+ rel1.relative: (26/96) 0.0;
+ rel2.to_y: "barend";
+ rel2.to_x: "bar";
+ rel2.relative: ((26+44)/96) 0.2;
+ align: 0.0 1.0;
+ image.normal: "inset_bar_vert_glow_light.png";
+ image.border: 0 0 0 20;
+ image.border_scale_by: 0.25; image.border_scale: 1;
+ color: 255 255 255 0;
+ }
+ description { state: "inv" 0.0;
+ inherit: "default" 0.0;
+ rel1.to_y: "barend";
+ rel1.to_x: "bar";
+ rel1.relative: (26/96) 0.8;
+ rel2.to_y: "bar";
+ rel2.to_x: "bar";
+ rel2.relative: ((26+44)/96) 1.0;
+ align: 0.0 0.0;
+ image.normal: "inset_bar_vert_glow_inv_light.png";
+ image.border: 0 0 20 0;
+ }
+ }
+ }
+ programs {
+ program { name: "inverted-on";
+ signal: "efl,state,inverted,on"; source: "efl";
+ action: STATE_SET "inv" 0.0;
+ target: "bar";
+ target: "barend";
+ target: "light";
+ }
+ program { name: "inverted-off";
+ signal: "efl,state,inverted,off"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "bar";
+ target: "barend";
+ target: "light";
+ }
+ program { name: "drag-set";
+ signal: "drag,set"; source: "efl.cur.progressbar";
+ script {
+ new a, Float:dx, Float:dy, Float:vl, st[20];
+
+ get_drag(PART:"efl.cur.progressbar", dx, dy);
+ get_state(PART:"bar", st, 19, vl);
+ if (!strcmp(st, "inv")) {
+ a = round(((1.0 - dy) * 255) / 0.2);
+ custom_state(PART:"light", "inv", 0.0);
+ } else {
+ a = round((dy * 255) / 0.2);
+ custom_state(PART:"light", "default", 0.0);
+ }
+ if (a > 255) { a = 255; }
+ set_state_val(PART:"light", STATE_COLOR, 255, 255, 255, a);
+ set_state(PART:"light", "custom", 0.0);
+ }
+ }
+ program { name: "pulse-mode0";
+ signal: "efl,state,pulse"; source: "efl";
+ action: STATE_SET "hidden" 0.0;
+ target: "efl.text.status";
+ after: "pulse-mode1";
+ }
+ program { name: "pulse-mode1";
+ signal: "efl,state,pulse,start"; source: "efl";
+ action: STATE_SET "pulse" 0.0;
+ target: "fract_clip";
+ }
+ program { name: "pulse-start";
+ signal: "efl,state,pulse,start"; source: "efl";
+ action: STATE_SET "pulse" 0.0;
+ target: "pulse_clip";
+ target: "fract_clip";
+ after: "pulse0";
+ after: "pulse0.1";
+ }
+ program { name: "pulse0.1";
+ action: STATE_SET "glow" 0.0;
+ transition: ACCELERATE 0.4;
+ target: "pulse2";
+ after: "pulse0.2";
+ }
+ program { name: "pulse0.2";
+ action: STATE_SET "default" 0.0;
+ transition: DECELERATE 0.4;
+ target: "pulse2";
+ }
+ program { name: "pulse0";
+ action: STATE_SET "end" 0.0;
+ transition: SINUSOIDAL 0.8;
+ target: "pulse";
+ after: "pulse1";
+ after: "pulse0.1";
+ }
+ program { name: "pulse1";
+ action: STATE_SET "default" 0.0;
+ transition: SINUSOIDAL 0.8;
+ target: "pulse";
+ after: "pulse0";
+ after: "pulse0.1";
+ }
+ program { name: "fraction";
+ signal: "efl,state,fraction"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "efl.text.status";
+ after: "pulse-stop";
+ }
+ program { name: "elmpulsestop";
+ signal: "efl,state,pulse,stop"; source: "efl";
+ action: ACTION_STOP;
+ target: "pulse0";
+ target: "pulse1";
+ after: "pulse-stop";
+ }
+ program { name: "pulse-stop";
+ action: STATE_SET "default" 0.0;
+ target: "pulse_clip";
+ }
+ program { name: "unit-visible";
+ signal: "efl,state,units,visible"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "efl.text.status";
+ }
+ program { name: "unit-hidden";
+ signal: "efl,state,units,hidden"; source: "efl";
+ action: STATE_SET "hidden" 0.0;
+ target: "efl.text.status";
+ }
+ program { name: "text-visible";
+ signal: "efl,state,text,set"; source: "efl";
+ script {
+ new m = get_int(slmode);
+ m |= LABEL; set_int(slmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "text-hidden";
+ signal: "efl,state,text,unset"; source: "efl";
+ script {
+ new m = get_int(slmode);
+ m &= ~LABEL; set_int(slmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "icon-visible";
+ signal: "efl,state,content,set"; source: "efl";
+ script {
+ new m = get_int(slmode);
+ m |= ICON; set_int(slmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "icon-hidden";
+ signal: "efl,state,content,unset"; source: "efl";
+ script {
+ new m = get_int(slmode);
+ m &= ~ICON; set_int(slmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "elmdisabled";
+ signal: "efl,state,disabled"; source: "efl";
+ script {
+ new m = get_int(slmode);
+ m |= DISABLE; set_int(slmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "elmenabled";
+ signal: "efl,state,enabled"; source: "efl";
+ script {
+ new m = get_int(slmode);
+ m &= ~DISABLE; set_int(slmode, m);
+ eval_mode(m);
+ }
+ }
+ }
+#undef ICON
+#undef LABEL
+#undef UNITS
+#undef DISABLE
}
group { "efl/progressbar/horizontal:wheel";
- inherit: "elm/progressbar/horizontal/wheel";
alias: "efl/progressbar/vertical:wheel";
+ images.image: "knob_round_busy.png" COMP;
+ images.image: "glow_round_corners.png" COMP;
+ parts {
+ part { name: "efl.bar" ; type: SWALLOW; mouse_events: 0;
+ description { state: "default" 0.0;
+ min: 0 0;
+ max: 0 0;
+ visible: 0;
+ }
+ }
+ part { name: "efl.content"; type: SWALLOW;
+ description { state: "default" 0.0;
+ min: 0 0;
+ max: 0 0;
+ visible: 0;
+ }
+ }
+ part { name: "busy_clip"; type: RECT;
+ description { state: "default" 0.0;
+ visible: 0;
+ color: 255 255 255 0;
+ }
+ description { state: "active" 0.0;
+ visible: 1;
+ color: 255 255 255 255;
+ }
+ }
+ part { name: "knob"; mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ image.normal: "knob_round_busy.png";
+ min: 40 40;
+ max: 40 40;
+ }
+ }
+ part { name: "knob_spinner"; mouse_events: 0;
+ clip_to: "busy_clip";
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "knob";
+ rel2.to: "knob";
+ image.normal: "glow_round_corners.png";
+ map.on: 1;
+ map.smooth: 1;
+ map.rotation.center: "knob";
+ }
+ description { state: "spin" 0.0;
+ inherit: "default" 0.0;
+ map.rotation.z: 360;
+ }
+ }
+ }
+ programs {
+ program { name: "spin";
+ signal: "efl,state,pulse,start"; source: "efl";
+ action: STATE_SET "spin" 0.0;
+ transition: LINEAR 1.0;
+ target: "knob_spinner";
+ after: "spin2";
+ }
+ program { name: "spin2";
+ action: STATE_SET "default" 0.0;
+ target: "knob_spinner";
+ after: "spin";
+ }
+ program {
+ signal: "efl,state,pulse,start"; source: "efl";
+ action: STATE_SET "active" 0.0;
+ transition: SINUSOIDAL 0.25;
+ target: "busy_clip";
+ }
+ program {
+ signal: "efl,state,pulse,stop"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ transition: SINUSOIDAL 1.0;
+ target: "busy_clip";
+ after: "spin3";
+ }
+ program { name: "spin3";
+ action: ACTION_STOP;
+ target: "spin";
+ target: "spin2";
+ after: "spin4";
+ }
+ program { name: "spin4";
+ action: STATE_SET "default" 0.0;
+ target: "knob_spinner";
+ }
+ }
}
group { "efl/progressbar/horizontal:double";
- inherit: "elm/progressbar/horizontal/double";
+ inherit: "efl/progressbar/horizontal";
+ images {
+ image: "inset_bar_horiz_glow_base_double.png" COMP;
+ image: "inset_bar_horiz_glow_inv_base_double.png" COMP;
+ }
+ parts {
+ part { name: "efl.cur.progressbar1"; mouse_events: 0; type: SPACER;
+ insert_after: "inside";
+ scale: 1;
+ dragable.confine: "inside";
+ dragable.x: 1 1 1;
+ dragable.y: 0 0 0;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ min: 8 4;
+ max: 8 4;
+ rel1.to: "inside";
+ rel2.to: "inside";
+ }
+ }
+ part { name: "barend1"; type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 0;
+ min: 14 16;
+ rel1.to_x: "efl.cur.progressbar1";
+ rel1.relative: 1.0 0.0;
+ rel2.to_x: "efl.cur.progressbar1";
+ rel2.relative: 1.0 1.0;
+ align: 0.0 0.5;
+ }
+ description { state: "inv" 0.0;
+ inherit: "default" 0.0;
+ rel1.relative: 0.0 0.0;
+ rel2.relative: 0.0 1.0;
+ align: 1.0 0.5;
+ }
+ }
+ part { name: "bar1";
+ insert_after: "barend";
+ clip_to: "fract_clip";
+ scale: 1;
+ description { state: "default" 0.0;
+ rel1.to_x: "ins0";
+ rel1.to_y: "bg";
+ rel1.relative: (12/16) -0.25;
+ rel2.to_x: "barend1";
+ rel2.to_y: "bg";
+ rel2.relative: 1.0 1.25;
+ image.normal: "inset_bar_horiz_glow_base_double.png";
+ image.border: 0 72 0 0;
+ image.border_scale_by: 0.25; image.border_scale: 1;
+ color: 51 153 255 128;
+ }
+ description { state: "inv" 0.0;
+ inherit: "default" 0.0;
+ rel1.to_x: "barend";
+ rel1.relative: 0.0 -0.25;
+ rel2.to_x: "ins1";
+ rel2.relative: (4/16) 1.25;
+ image.normal: "inset_bar_horiz_glow_inv_base_double.png";
+ image.border: 72 0 0 0;
+ }
+ }
+ }
+ programs {
+ program { name: "inverted-on";
+ signal: "efl,state,inverted,on"; source: "efl";
+ action: STATE_SET "inv" 0.0;
+ target: "bar";
+ target: "bar1";
+ target: "barend";
+ target: "barend1";
+ target: "light";
+ }
+ program
+ { name: "inverted-off";
+ signal: "efl,state,inverted,off"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "bar";
+ target: "bar1";
+ target: "barend";
+ target: "barend1";
+ target: "light";
+ }
+ }
}
group { "efl/progressbar/vertical:double";
- inherit: "elm/progressbar/vertical/double";
+ inherit: "efl/progressbar/vertical";
+ images {
+ image: "inset_bar_vert_glow_base_double.png" COMP;
+ image: "inset_bar_vert_glow_inv_base_double.png" COMP;
+ }
+ parts {
+ part { name: "efl.cur.progressbar1"; mouse_events: 0; type: SPACER;
+ insert_after: "inside";
+ scale: 1;
+ dragable.confine: "inside";
+ dragable.x: 0 0 0;
+ dragable.y: 1 1 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ min: 4 8;
+ max: 4 8;
+ rel1.to: "inside";
+ rel2.to: "inside";
+ }
+ }
+ part { name: "barend1"; type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 0 1;
+ min: 16 14;
+ rel1.to_y: "efl.cur.progressbar1";
+ rel1.relative: 0.0 1.0;
+ rel2.to_y: "efl.cur.progressbar1";
+ rel2.relative: 1.0 1.0;
+ align: 0.5 0.0;
+ }
+ description { state: "inv" 0.0;
+ inherit: "default" 0.0;
+ rel1.relative: 0.0 0.0;
+ rel2.relative: 1.0 0.0;
+ align: 0.5 1.0;
+ }
+ }
+ part { name: "bar1";
+ insert_after: "barend";
+ clip_to: "fract_clip";
+ scale: 1;
+ description { state: "default" 0.0;
+ rel1.to_y: "ins0";
+ rel1.to_x: "bg";
+ rel1.relative: -0.25 (12/16);
+ rel2.to_y: "barend1";
+ rel2.to_x: "bg";
+ rel2.relative: 1.25 1.0;
+ image.normal: "inset_bar_vert_glow_base_double.png";
+ image.border: 0 0 0 72;
+ image.border_scale_by: 0.25; image.border_scale: 1;
+ color: 51 153 255 128;
+ }
+ description { state: "inv" 0.0;
+ inherit: "default" 0.0;
+ rel1.to_y: "barend1";
+ rel1.relative: -0.25 0.0;
+ rel2.to_y: "ins1";
+ rel2.relative: 1.25 (4/16);
+ image.normal: "inset_bar_vert_glow_inv_base_double.png";
+ image.border: 0 0 72 0;
+ }
+ }
+ }
+ programs {
+ program { name: "inverted-on";
+ signal: "efl,state,inverted,on"; source: "efl";
+ action: STATE_SET "inv" 0.0;
+ target: "bar";
+ target: "barend";
+ target: "light";
+ target: "bar1";
+ target: "barend1";
+ }
+ program { name: "inverted-off";
+ signal: "efl,state,inverted,off"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "bar";
+ target: "barend";
+ target: "light";
+ target: "bar1";
+ target: "barend1";
+ }
+ }
}
diff --git a/data/elementary/themes/edc/efl/radio.edc b/data/elementary/themes/edc/efl/radio.edc
index 5c6dc64aa3..962655c57a 100644
--- a/data/elementary/themes/edc/efl/radio.edc
+++ b/data/elementary/themes/edc/efl/radio.edc
@@ -1,3 +1,292 @@
group { "efl/radio";
- inherit: "elm/radio/base/default";
+ images.image: "inset_shadow_circle_tiny.png" COMP;
+ images.image: "inset_circle_tiny.png" COMP;
+ images.image: "sym_radio_alum.png" COMP;
+#define ICON 1
+#define LABEL 2
+#define MASK 3
+#define DISABLE 4
+ script {
+ public btmode;
+ public eval_mode(m) {
+ new m1 = m & MASK;
+ new d = m & DISABLE;
+ if (m1 == (ICON | LABEL)) {
+ if (!d) {
+ set_state(PART:"efl.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
+ set_state(PART:"efl.text", "visible", 0.0);
+ set_state(PART:"inset", "default", 0.0);
+ set_state(PART:"clip", "default", 0.0);
+ set_state(PART:"event", "default", 0.0);
+ } else {
+ set_state(PART:"efl.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
+ set_state(PART:"efl.text", "disabled_visible", 0.0);
+ set_state(PART:"inset", "disabled", 0.0);
+ set_state(PART:"clip", "disabled", 0.0);
+ set_state(PART:"event", "disabled", 0.0);
+ }
+ } else if (m1 == (ICON)) {
+ if (!d) {
+ set_state(PART:"efl.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "icononly", 0.0);
+ set_state(PART:"efl.text", "default", 0.0);
+ set_state(PART:"inset", "default", 0.0);
+ set_state(PART:"clip", "default", 0.0);
+ set_state(PART:"event", "default", 0.0);
+ } else {
+ set_state(PART:"efl.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "icononly", 0.0);
+ set_state(PART:"efl.text", "disabled", 0.0);
+ set_state(PART:"inset", "disabled", 0.0);
+ set_state(PART:"clip", "disabled", 0.0);
+ set_state(PART:"event", "disabled", 0.0);
+ }
+ } else if (m1 == (LABEL)) {
+ if (!d) {
+ set_state(PART:"efl.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
+ set_state(PART:"efl.text", "visible", 0.0);
+ set_state(PART:"inset", "default", 0.0);
+ set_state(PART:"clip", "default", 0.0);
+ set_state(PART:"event", "default", 0.0);
+ } else {
+ set_state(PART:"efl.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
+ set_state(PART:"efl.text", "disabled_visible", 0.0);
+ set_state(PART:"inset", "disabled", 0.0);
+ set_state(PART:"clip", "disabled", 0.0);
+ set_state(PART:"event", "disabled", 0.0);
+ }
+ } else {
+ if (!d) {
+ set_state(PART:"efl.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
+ set_state(PART:"efl.text", "default", 0.0);
+ set_state(PART:"inset", "default", 0.0);
+ set_state(PART:"clip", "default", 0.0);
+ set_state(PART:"event", "default", 0.0);
+ } else {
+ set_state(PART:"efl.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
+ set_state(PART:"efl.text", "default", 0.0);
+ set_state(PART:"inset", "disabled", 0.0);
+ set_state(PART:"clip", "disabled", 0.0);
+ set_state(PART:"event", "disabled", 0.0);
+ }
+ }
+ }
+ }
+ parts {
+ part { name: "inset"; mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ rel1.offset: 2 2;
+ rel2.relative: 0.0 1.0;
+ rel2.offset: 2 -3;
+ image.normal: "inset_shadow_circle_tiny.png";
+ align: 0.0 0.5;
+ min: 13 13;
+ max: 13 13;
+ fixed: 1 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "inset_circle_tiny.png";
+ }
+ }
+ part { name: "indicator"; mouse_events: 0;
+ scale: 1;
+ clip_to: "clip";
+ description { state: "default" 0.0;
+ rel1.to: "inset";
+ rel2.to: "inset";
+ image.normal: "sym_radio_alum.png";
+ min: 11 11;
+ max: 11 11;
+ visible: 0;
+ }
+ description { state: "selected" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ part { name: "clip"; type: RECT;
+ description { state: "default" 0.0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 64;
+ }
+ }
+ part { name: "efl.content"; type: SWALLOW;
+ required;
+ scale: 1;
+ clip_to: "clip";
+ description { state: "default" 0.0;
+ fixed: 1 0;
+ visible: 0;
+ align: 0.0 0.5;
+ max: 0 0;
+ rel1.to_x: "inset";
+ rel1.relative: 1.0 0.0;
+ rel1.offset: 1 1;
+ rel2.to_x: "inset";
+ rel2.offset: 1 -2;
+ rel2.relative: 1.0 1.0;
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ aspect: 1.0 1.0;
+ min: 16 16;
+ }
+ }
+ part { name: "sizer_content"; type: TEXT; mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ visible: 0;
+ text { font: FN; size: 10;
+ min: 0 0;
+ text_class: "radio_text";
+ }
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ rel1.to: "efl.content";
+ rel2.to: "efl.content";
+ text {
+ min: 1 1;
+ ellipsis: -1;
+ text: "M";
+ }
+ }
+ description { state: "icononly" 0.0;
+ inherit: "default" 0.0;
+ rel1.to: "efl.content";
+ rel2.to: "efl.content";
+ text {
+ min: 1 1;
+ ellipsis: -1;
+ text: "M";
+ }
+ }
+ }
+ part { name: "efl.text"; type: TEXT; mouse_events: 0;
+ effect: SHADOW BOTTOM;
+ scale: 1;
+ required;
+ description { state: "default" 0.0;
+ rel1.offset: 2 2;
+ rel1.to_x: "efl.content";
+ rel1.relative: 1.0 0.0;
+ rel2.offset: -3 -3;
+ color: FN_COL_DEFAULT;
+ color_class: "radio_text";
+ text { font: FN; size: 10;
+ min: 0 0;
+ align: 0.0 0.5;
+ text_class: "radio";
+ }
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color_class: "radio_text_disabled";
+ color3: 255 255 255 255;
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ text.min: 1 1;
+ text.ellipsis: -1;
+ }
+ description { state: "disabled_visible" 0.0;
+ inherit: "default" 0.0;
+ color_class: "radio_text_disabled";
+ color3: 255 255 255 255;
+ visible: 1;
+ text.min: 1 1;
+ text.ellipsis: -1;
+ }
+ }
+ part { name: "event"; type: RECT;
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ }
+ programs {
+ program {
+ signal: "mouse,clicked,1"; source: "event";
+ action: SIGNAL_EMIT "efl,action,radio,toggle" "efl";
+ }
+ program {
+ signal: "efl,state,radio,on"; source: "efl";
+ action: STATE_SET "selected" 0.0;
+ target: "indicator";
+ }
+ program {
+ signal: "efl,state,radio,off"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "indicator";
+ }
+ program {
+ signal: "efl,state,text,set"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m |= LABEL; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program {
+ signal: "efl,state,text,unset"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m &= ~LABEL; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program {
+ signal: "efl,state,content,set"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m |= ICON; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program {
+ signal: "efl,state,content,unset"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m &= ~ICON; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program {
+ signal: "efl,state,disabled"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m |= DISABLE; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program {
+ signal: "efl,state,enabled"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m &= ~DISABLE; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ }
+#undef ICON
+#undef LABEL
+#undef MASK
+#undef DISABLE
}
diff --git a/data/elementary/themes/edc/efl/scroller.edc b/data/elementary/themes/edc/efl/scroller.edc
index e0d81482c0..56265262b0 100644
--- a/data/elementary/themes/edc/efl/scroller.edc
+++ b/data/elementary/themes/edc/efl/scroller.edc
@@ -1,12 +1,1334 @@
-group { "efl/scroller";
- inherit: "elm/scroller/base/default";
-}
+group { name: "efl/scroller";
+ images.image: "inset_shadow.png" COMP;
+ images.image: "bevel_in.png" COMP;
+ images.image: "bevel_out.png" COMP;
+ images.image: "runner_horiz.png" COMP;
+ images.image: "runner_vert.png" COMP;
+ images.image: "runner_glow_horiz.png" COMP;
+ images.image: "runner_glow_vert.png" COMP;
+ images.image: "holes_tiny_horiz.png" COMP;
+ images.image: "holes_tiny_vert.png" COMP;
+ images.image: "holes_tiny_glow_horiz.png" COMP;
+ images.image: "holes_tiny_glow_vert.png" COMP;
+ images.image: "vgrad_med_lighter.png" COMP;
+ images.image: "shadow_square_tiny.png" COMP;
+ images.image: "glow_small.png" COMP;
+ images.image: "sym_left_light_normal.png" COMP;
+ images.image: "sym_right_light_normal.png" COMP;
+ images.image: "sym_up_light_normal.png" COMP;
+ images.image: "sym_down_light_normal.png" COMP;
+ images.image: "sym_left_glow_normal.png" COMP;
+ images.image: "sym_right_glow_normal.png" COMP;
+ images.image: "sym_up_glow_normal.png" COMP;
+ images.image: "sym_down_glow_normal.png" COMP;
+ images.image: "sym_up_dark_normal.png" COMP;
+ images.image: "sym_down_dark_normal.png" COMP;
+ images.image: "sym_left_dark_normal.png" COMP;
+ images.image: "sym_right_dark_normal.png" COMP;
+
+
+ data.item: "focus_highlight" "on";
+
+ script {
+ public loop_x, loop_y;
+ public action_on_pos_vbar(val) {
+ new x, y , w, h, x1, y1 , w1, h1;
+
+ get_geometry(PART:"y_vbar_up", x,y,w, h);
+ get_geometry(PART:"y_vbar_up_mapper", x1,y1,w1, h1);
+
+ if(((y1 <= y) && (y <= (y1 + h1))) && (0 == get_int(loop_y)))
+ {
+ set_state(PART:"arrow1_vbar", "hidden", 0.0);
+ set_state(PART:"sb_vbar_a1", "hidden", 0.0);
+ }
+ else
+ {
+ set_state(PART:"arrow1_vbar", "default", 0.0);
+ set_state(PART:"sb_vbar_a1", "default", 0.0);
+ }
+
+ get_geometry(PART:"y_vbar_down", x,y,w, h);
+ get_geometry(PART:"y_vbar_down_mapper", x1,y1,w1, h1);
+
+ if(((y1 <= (y + h)) && ((y+ h) <= (y1 + h1))) && (0 == get_int(loop_y)))
+ {
+ set_state(PART:"arrow2_vbar", "hidden", 0.0);
+ set_state(PART:"sb_vbar_a2", "hidden", 0.0);
+ }
+ else
+ {
+ set_state(PART:"arrow2_vbar", "default", 0.0);
+ set_state(PART:"sb_vbar_a2", "default", 0.0);
+ }
+
+ if(val < 10)
+ timer(0.1,"action_on_pos_vbar", val+1);
+ }
-group { "efl/scroller:noclip";
- inherit: "elm/scroller/base/noclip";
+ public action_on_pos_hbar(val) {
+ new x, y , w, h, x1, y1 , w1, h1;
+
+ get_geometry(PART:"x_hbar_left", x,y,w, h);
+ get_geometry(PART:"x_hbar_left_mapper", x1,y1,w1, h1);
+
+ if(((x1 <= x) && (x <= (x1 + w1))) && (0 == get_int(loop_x)))
+ {
+ set_state(PART:"arrow1_hbar", "hidden", 0.0);
+ set_state(PART:"sb_hbar_a1", "hidden", 0.0);
+ }
+ else
+ {
+ set_state(PART:"arrow1_hbar", "default", 0.0);
+ set_state(PART:"sb_hbar_a1", "default", 0.0);
+ }
+
+ get_geometry(PART:"x_hbar_right", x,y,w, h);
+ get_geometry(PART:"x_hbar_right_mapper", x1,y1,w1, h1);
+
+ if(((x1 <= (x + w)) && ((x + w) <= (x1 + w1))) && (0 == get_int(loop_x)))
+ {
+ set_state(PART:"arrow2_hbar", "hidden", 0.0);
+ set_state(PART:"sb_hbar_a2", "hidden", 0.0);
+ }
+ else
+ {
+ set_state(PART:"arrow2_hbar", "default", 0.0);
+ set_state(PART:"sb_hbar_a2", "default", 0.0);
+ }
+
+ if(val < 10)
+ timer(0.1,"action_on_pos_hbar", val+1);
+ }
+ }
+
+ parts {
+ program {
+ signal: "load"; source: "";
+ script {
+ emit("reload", "efl");
+ action_on_pos_vbar(0);
+ action_on_pos_hbar(0);
+ }
+ }
+// vert bar ////////////////////////////////////////////////////////////////
+ part { name: "sb_vbar_show"; type: RECT;
+ description { state: "default" 0.0;
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "sb_vbar"; type: RECT;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ min: 15 1;
+ align: 1.0 0.0;
+ rel1.relative: 1.0 0.0;
+ rel1.offset: -1 0;
+ rel2.relative: 1.0 0.0;
+ rel2.to_y: "sb_hbar";
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ min: 0 0;
+ max: 0 99999;
+ }
+ }
+ part { name: "sb_vbar_base"; type: RECT;
+ clip_to: "sb_vbar";
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ rel1.relative: 0.0 1.0;
+ rel1.to: "sb_vbar_a1";
+ rel2.relative: 1.0 0.0;
+ rel2.to: "sb_vbar_a2";
+ fixed: 1 1;
+ }
+ }
+ part { name: "sb_vbar_p1"; type: RECT;
+ clip_to: "sb_vbar";
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ rel1.relative: 0.0 1.0;
+ rel1.to: "sb_vbar_a1";
+ rel2.relative: 1.0 0.0;
+ rel2.to: "efl.dragable.vbar";
+ fixed: 1 1;
+ }
+ }
+ part { name: "sb_vbar_p2"; type: RECT;
+ clip_to: "sb_vbar";
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ rel1.relative: 0.0 1.0;
+ rel1.to: "efl.dragable.vbar";
+ rel2.relative: 1.0 0.0;
+ rel2.to: "sb_vbar_a2";
+ fixed: 1 1;
+ }
+ }
+ part { name: "efl.dragable.vbar"; type: RECT;
+ clip_to: "sb_vbar";
+ scale: 1;
+ dragable.x: 0 0 0;
+ dragable.y: 1 1 0;
+ dragable.confine: "sb_vbar_base";
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ min: 15 13;
+ rel1.relative: 0.5 0.5;
+ rel1.to: "sb_vbar_base";
+ rel2.relative: 0.5 0.5;
+ rel2.to: "sb_vbar_base";
+ color: 0 0 0 0;
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ min: 0 0;
+ }
+ description { state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ }
+ }
+ part { name: "y_vbar_up_mapper"; type: SPACER;
+ scale: 1;
+ repeat_events: 1;
+ description { state: "default" 0.0;
+ min: 4 2;
+ max: 4 2;
+ fixed: 1 1;
+ align: 0.0 0.0;
+ rel1.to: "sb_vbar_base";
+ rel2.to: "sb_vbar_base";
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ min: 0 0;
+ max: 0 0;
+ }
+ }
+ part { name: "y_vbar_up"; type: SPACER;
+ scale: 1;
+ repeat_events: 1;
+ description { state: "default" 0.0;
+ min: 4 2;
+ max: 4 2;
+ fixed: 1 1;
+ align: 0.0 0.0;
+ rel1.to: "efl.dragable.vbar";
+ rel2.to: "efl.dragable.vbar";
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ min: 0 0;
+ max: 0 0;
+ }
+ }
+ part { name: "y_vbar_down_mapper"; type: SPACER;
+ scale: 1;
+ repeat_events: 1;
+ description { state: "default" 0.0;
+ min: 4 2;
+ max: 4 2;
+ fixed: 1 1;
+ align: 0.0 1.0;
+ rel1.to: "sb_vbar_base";
+ rel2.to: "sb_vbar_base";
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ min: 0 0;
+ max: 0 0;
+ }
+ }
+ part { name: "y_vbar_down"; type: SPACER;
+ scale: 1;
+ repeat_events: 1;
+ description { state: "default" 0.0;
+ min: 4 2;
+ max: 4 2;
+ fixed: 1 1;
+ align: 0.0 1.0;
+ rel1.to: "efl.dragable.vbar";
+ rel2.to: "efl.dragable.vbar";
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ min: 0 0;
+ max: 0 0;
+ }
+ }
+ part { name: "sb_vbar_a1"; type: RECT;
+ clip_to: "sb_vbar";
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ min: 15 15;
+ align: 0.5 0.0;
+ aspect: 1.0 1.0; aspect_preference: HORIZONTAL;
+ color: 0 0 0 0;
+ rel1.to: "sb_vbar";
+ rel2.to: "sb_vbar";
+ rel2.relative: 1.0 0.0;
+ rel2.offset: -1 0;
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ min: 0 0;
+ visible: 0;
+ }
+ }
+ part { name: "sb_vbar_a2"; type: RECT;
+ clip_to: "sb_vbar";
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ min: 15 15;
+ align: 0.5 1.0;
+ aspect: 1.0 1.0; aspect_preference: HORIZONTAL;
+ color: 0 0 0 0;
+ rel1.to: "sb_vbar";
+ rel1.offset: 0 -1;
+ rel1.relative: 0.0 1.0;
+ rel2.to: "sb_vbar";
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ min: 0 0;
+ visible: 0;
+ }
+ }
+ program {
+ signal: "efl,action,show,vbar"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "sb_vbar";
+ target: "sb_vbar_show";
+ target: "efl.dragable.vbar";
+ target: "sb_vbar_a1";
+ target: "sb_vbar_a2";
+ target: "y_vbar_up_mapper";
+ target: "y_vbar_up";
+ target: "y_vbar_down_mapper";
+ target: "y_vbar_down";
+ target: "arrow1_vbar_indent";
+ target: "arrow2_vbar_indent";
+ after: "check_pos_vbar";
+ }
+ program {
+ signal: "efl,action,hide,vbar"; source: "efl";
+ action: STATE_SET "hidden" 0.0;
+ target: "sb_vbar";
+ target: "sb_vbar_show";
+ target: "efl.dragable.vbar";
+ target: "sb_vbar_a1";
+ target: "sb_vbar_a2";
+ target: "y_vbar_up_mapper";
+ target: "y_vbar_up";
+ target: "y_vbar_down_mapper";
+ target: "y_vbar_down";
+ target: "arrow1_vbar_indent";
+ target: "arrow2_vbar_indent";
+ }
+ program {
+ signal: "mouse,down,1*"; source: "sb_vbar_a1";//ok
+ action: STATE_SET "clicked" 0.0;
+ target: "arrow1_vbar";
+ after: "anim1_up";
+ }
+ program { name: "anim1_up";
+ action: STATE_SET "default" 0.0;
+ transition: LINEAR 0.1;
+ target: "arrow1_vbar";
+ after: "drag_up";
+ }
+ program { name: "drag_up";
+ action: DRAG_VAL_STEP 0.0 -1.0;
+ target: "efl.dragable.vbar";
+ }
+ program {
+ signal: "mouse,down,1*"; source: "sb_vbar_a2";//ok
+ action: STATE_SET "clicked" 0.0;
+ target: "arrow2_vbar";
+ after: "anim1_down";
+ }
+ program { name: "anim1_down";
+ action: STATE_SET "default" 0.0;
+ transition: LINEAR 0.1;
+ target: "arrow2_vbar";
+ after: "drag_down";
+ }
+ program { name: "drag_down";
+ action: DRAG_VAL_STEP 0.0 1.0;
+ target: "efl.dragable.vbar";
+ }
+ program {
+ signal: "mouse,down,1*"; source: "sb_vbar_p1";
+ action: DRAG_VAL_PAGE 0.0 -1.0;
+ target: "efl.dragable.vbar";
+ }
+ program {
+ signal: "mouse,down,1*"; source: "sb_vbar_p2";
+ action: DRAG_VAL_PAGE 0.0 1.0;
+ target: "efl.dragable.vbar";
+ }
+ program {
+ signal: "efl,action,scroll"; source: "efl";
+ script {
+ action_on_pos_vbar(10);
+ }
+ }
+ program { name: "check_pos_vbar";
+ script {
+ action_on_pos_vbar(10);
+ }
+ }
+ program { name: "loop_set_vbar";
+ signal: "efl,loop_y,set"; source: "efl";
+ script {
+ set_int(loop_y, 1);
+ action_on_pos_vbar(10);
+ }
+ }
+ program { name: "loop_unset_vbar";
+ signal: "efl,loop_y,unset"; source: "efl";
+ script {
+ set_int(loop_y, 0);
+ action_on_pos_vbar(10);
+ }
+ }
+
+// horiz bar /////////////////////////////////////////////////////////////
+ part { name: "sb_hbar_show"; type: RECT;
+ description { state: "default" 0.0;
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "sb_hbar"; type: RECT; mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ min: 1 15;
+ align: 0.0 1.0;
+ rel1.relative: 0.0 1.0;
+ rel1.offset: 0 -1;
+ rel2.relative: 0.0 1.0;
+ rel2.to_x: "sb_vbar";
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ min: 0 0;
+ max: 99999 0;
+ }
+ }
+ part { name: "sb_hbar_base"; type: RECT;
+ clip_to: "sb_hbar";
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ rel1.relative: 1.0 0.0;
+ rel1.to: "sb_hbar_a1";
+ rel2.relative: 0.0 1.0;
+ rel2.to: "sb_hbar_a2";
+ fixed: 1 1;
+ }
+ }
+ part { name: "sb_hbar_p1"; type: RECT;
+ clip_to: "sb_hbar";
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ rel1.relative: 1.0 0.0;
+ rel1.to: "sb_hbar_a1";
+ rel2.relative: 0.0 1.0;
+ rel2.to: "efl.dragable.hbar";
+ fixed: 1 1;
+ }
+ }
+ part { name: "sb_hbar_p2"; type: RECT;
+ clip_to: "sb_hbar";
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ rel1.relative: 1.0 0.0;
+ rel1.to: "efl.dragable.hbar";
+ rel2.relative: 0.0 1.0;
+ rel2.to: "sb_hbar_a2";
+ fixed: 1 1;
+ }
+ }
+ part { name: "efl.dragable.hbar"; type: RECT;
+ clip_to: "sb_hbar";
+ scale: 1;
+ dragable.x: 1 1 0;
+ dragable.y: 0 0 0;
+ dragable.confine: "sb_hbar_base";
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ min: 13 15;
+ rel1.relative: 0.5 0.5;
+ rel1.to: "sb_hbar_base";
+ rel2.relative: 0.5 0.5;
+ rel2.to: "sb_hbar_base";
+ color: 0 0 0 0;
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ min: 0 0;
+ }
+ description { state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ }
+ }
+ part { name: "x_hbar_left_mapper"; type: SPACER;
+ scale: 1;
+ repeat_events: 1;
+ description { state: "default" 0.0;
+ min: 2 4;
+ max: 2 4;
+ fixed: 1 1;
+ align: 0.0 1.0;
+ rel1.to: "sb_hbar_base";
+ rel2.to: "sb_hbar_base";
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ min: 0 0;
+ max: 0 0;
+ }
+ }
+ part { name: "x_hbar_left"; type: SPACER;
+ scale: 1;
+ repeat_events: 1;
+ description { state: "default" 0.0;
+ min: 2 4;
+ max: 2 4;
+ fixed: 1 1;
+ align: 0.0 1.0;
+ rel1.to: "efl.dragable.hbar";
+ rel2.to: "efl.dragable.hbar";
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ min: 0 0;
+ max: 0 0;
+ }
+ }
+ part { name: "x_hbar_right_mapper"; type: SPACER;
+ scale: 1;
+ repeat_events: 1;
+ description { state: "default" 0.0;
+ min: 2 4;
+ max: 2 4;
+ fixed: 1 1;
+ align: 1.0 1.0;
+ rel1.to: "sb_hbar_base";
+ rel2.to: "sb_hbar_base";
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ min: 0 0;
+ max: 0 0;
+ }
+ }
+ part { name: "x_hbar_right"; type: SPACER;
+ scale: 1;
+ repeat_events: 1;
+ description { state: "default" 0.0;
+ min: 2 4;
+ max: 2 4;
+ fixed: 1 1;
+ align: 1.0 1.0;
+ rel1.to: "efl.dragable.hbar";
+ rel2.to: "efl.dragable.hbar";
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ min: 0 0;
+ max: 0 0;
+ }
+ }
+ part { name: "sb_hbar_a1"; type: RECT;
+ clip_to: "sb_hbar";
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ min: 15 15;
+ align: 0.0 0.5;
+ aspect: 1.0 1.0; aspect_preference: VERTICAL;
+ color: 0 0 0 0;
+ rel1.to: "sb_hbar";
+ rel2.to: "sb_hbar";
+ rel2.relative: 0.0 1.0;
+ rel2.offset: 0 -1;
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ min: 0 0;
+ visible: 0;
+ }
+ }
+ part { name: "sb_hbar_a2"; type: RECT;
+ clip_to: "sb_hbar";
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ min: 15 15;
+ align: 1.0 0.5;
+ aspect: 1.0 1.0; aspect_preference: VERTICAL;
+ color: 0 0 0 0;
+ rel1.to: "sb_hbar";
+ rel1.offset: -1 0;
+ rel1.relative: 1.0 0.0;
+ rel2.to: "sb_hbar";
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ min: 0 0;
+ visible: 0;
+ }
+ }
+ program {
+ signal: "efl,action,show,hbar"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "sb_hbar";
+ target: "sb_hbar_show";
+ target: "efl.dragable.hbar";
+ target: "sb_hbar_a1";
+ target: "sb_hbar_a2";
+ target: "x_hbar_left_mapper";
+ target: "x_hbar_left";
+ target: "x_hbar_right_mapper";
+ target: "x_hbar_right";
+ target: "arrow1_hbar_indent";
+ target: "arrow2_hbar_indent";
+ after: "check_pos_hbar";
+ }
+ program {
+ signal: "efl,action,hide,hbar"; source: "efl";
+ action: STATE_SET "hidden" 0.0;
+ target: "sb_hbar";
+ target: "sb_hbar_show";
+ target: "efl.dragable.hbar";
+ target: "sb_hbar_a1";
+ target: "sb_hbar_a2";
+ target: "x_hbar_left_mapper";
+ target: "x_hbar_left";
+ target: "x_hbar_right_mapper";
+ target: "x_hbar_right";
+ target: "arrow1_hbar_indent";
+ target: "arrow2_hbar_indent";
+ }
+ program {
+ signal: "mouse,down,1*"; source: "sb_hbar_a1";
+ action: STATE_SET "clicked" 0.0;
+ target: "arrow1_hbar";
+ after: "anim1_left";
+ }
+ program { name: "anim1_left";
+ action: STATE_SET "default" 0.0;
+ transition: LINEAR 0.1;
+ target: "arrow1_hbar";
+ after: "drag_left";
+ }
+ program { name: "drag_left";
+ action: DRAG_VAL_STEP -1.0 0.0;
+ target: "efl.dragable.hbar";
+ }
+ program {
+ signal: "mouse,down,1*"; source: "sb_hbar_a2";
+ action: STATE_SET "clicked" 0.0;
+ target: "arrow2_hbar";
+ after: "anim2_left";
+ }
+ program { name: "anim2_left";
+ action: STATE_SET "default" 0.0;
+ transition: LINEAR 0.1;
+ target: "arrow2_hbar";
+ after: "drag_right";
+ }
+ program { name: "drag_right";
+ action: DRAG_VAL_STEP 1.0 0.0;
+ target: "efl.dragable.hbar";
+ }
+ program {
+ signal: "mouse,down,1*"; source: "sb_hbar_p1";
+ action: DRAG_VAL_PAGE -1.0 0.0;
+ target: "efl.dragable.hbar";
+ after: "check_pos_hbar";
+ }
+ program {
+ signal: "mouse,down,1*"; source: "sb_hbar_p2";
+ action: DRAG_VAL_PAGE 1.0 0.0;
+ target: "efl.dragable.hbar";
+ after: "check_pos_hbar";
+ }
+ program {
+ signal: "efl,action,scroll"; source: "efl";
+ script {
+ action_on_pos_hbar(10);
+ }
+ }
+ program { name: "check_pos_hbar";
+ script {
+ action_on_pos_hbar(10);
+ }
+ }
+ program { name: "loop_set_hbar";
+ signal: "efl,loop_x,set"; source: "efl";
+ script {
+ set_int(loop_x, 1);
+ action_on_pos_hbar(10);
+ }
+ }
+ program { name: "loop_unset_hbar";
+ signal: "efl,loop_x,unset"; source: "efl";
+ script {
+ set_int(loop_x, 0);
+ action_on_pos_hbar(10);
+ }
+ }
+ part { name: "bg"; type: RECT;
+ description { state: "default" 0.0;
+ rel1.to: "efl.background";
+ rel2.to: "efl.background";
+// color: 64 64 64 200;
+ color: 0 0 0 0;
+ color_class: "scroller_bg";
+ }
+ }
+ part { name: "clipper"; type: RECT;
+ description { state: "default" 0.0;
+ rel1.to: "efl.background";
+ rel2.to: "efl.background";
+ }
+ }
+ part { name: "efl.background"; type: SWALLOW;
+ clip_to: "clipper";
+ description { state: "default" 0.0;
+ rel1.offset: 1 1;
+ rel2.relative: 0.0 0.0;
+ rel2.offset: -2 -2;
+ rel2.to_x: "sb_vbar";
+ rel2.to_y: "sb_hbar";
+ }
+ }
+ part { name: "efl.content"; type: SWALLOW;
+ clip_to: "clipper";
+ description { state: "default" 0.0;
+ rel1.offset: 1 1;
+ rel2.relative: 0.0 0.0;
+ rel2.offset: -2 -2;
+ rel2.to_x: "sb_vbar";
+ rel2.to_y: "sb_hbar";
+ }
+ }
+ part { name: "inset"; mouse_events: 0;
+ description { state: "default" 0.0;
+ image.normal: "bevel_in.png";
+ image.border: 1 1 1 1;
+ image.middle: 0;
+ rel1.to: "bg";
+ rel1.offset: -1 -1;
+ rel2.to: "bg";
+ rel2.offset: 0 0;
+ fill.smooth: 0;
+ }
+ }
+ part { name: "shadow"; mouse_events: 0;
+ description { state: "default" 0.0;
+ image.normal: "inset_shadow.png";
+ image.border: 5 5 7 3;
+ image.middle: 0;
+ rel1.to: "bg";
+ rel2.to: "bg";
+ fill.smooth: 0;
+ color: 255 255 255 128;
+ }
+ }
+ part { name: "efl.overlay"; type: SWALLOW;
+ clip_to: "clipper";
+ description { state: "default" 0.0;
+ rel1.to: "efl.content";
+ rel2.to: "efl.content";
+ }
+ }
+ part { name: "runner_vbar"; mouse_events: 0;
+ clip_to: "sb_vbar_show";
+ description { state: "default" 0.0;
+ image.normal: "runner_vert.png";
+ image.border: 0 0 2 2;
+ rel1.to: "sb_vbar_base";
+ rel2.to: "sb_vbar_base";
+ fill.smooth: 0;
+ min: 3 4;
+ max: 3 99999;
+ fixed: 1 1;
+ }
+ }
+ part { name: "runner_hbar"; mouse_events: 0;
+ clip_to: "sb_hbar_show";
+ description { state: "default" 0.0;
+ image.normal: "runner_horiz.png";
+ image.border: 2 2 0 0;
+ rel1.to: "sb_hbar_base";
+ rel2.to: "sb_hbar_base";
+ fill.smooth: 0;
+ min: 4 3;
+ max: 99999 3;
+ fixed: 1 1;
+ }
+ }
+ part { name: "runner_vbar_clip"; type: RECT;
+ clip_to: "sb_vbar_show";
+ description { state: "default" 0.0;
+ min: 1 1;
+ max: 1 99999;
+ rel1.to: "runner_vbar";
+ rel1.offset: 0 1;
+ rel2.to: "runner_vbar";
+ rel2.offset: -1 -2;
+ fixed: 1 1;
+ }
+ }
+ part { name: "runner_hbar_clip"; type: RECT;
+ clip_to: "sb_hbar_show";
+ description { state: "default" 0.0;
+ min: 1 1;
+ max: 99999 1;
+ rel1.to: "runner_hbar";
+ rel1.offset: 1 0;
+ rel2.to: "runner_hbar";
+ rel2.offset: -2 -1;
+ fixed: 1 1;
+ }
+ }
+ part { name: "arrow1_vbar_indent"; mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.to: "sb_vbar_a1";
+ rel2.to: "sb_vbar_a1";
+ image.normal: "sym_up_dark_normal.png";
+ FIXED_SIZE(15, 15)
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "arrow1_vbar"; mouse_events: 0;
+ clip_to: "sb_vbar_show";
+ description { state: "default" 0.0;
+ rel1.to: "sb_vbar_a1";
+ rel2.to: "sb_vbar_a1";
+ image.normal: "sym_up_light_normal.png";
+ FIXED_SIZE(15, 15)
+ }
+ description { state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "sym_up_glow_normal.png";
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "arrow2_vbar_indent"; mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.to: "sb_vbar_a2";
+ rel2.to: "sb_vbar_a2";
+ image.normal: "sym_down_dark_normal.png";
+ FIXED_SIZE(15, 15)
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "arrow2_vbar"; mouse_events: 0;
+ clip_to: "sb_vbar_show";
+ description { state: "default" 0.0;
+ rel1.to: "sb_vbar_a2";
+ rel2.to: "sb_vbar_a2";
+ image.normal: "sym_down_light_normal.png";
+ FIXED_SIZE(15, 15)
+ }
+ description { state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "sym_down_glow_normal.png";
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "shadow_vbar"; mouse_events: 0;
+ clip_to: "sb_vbar_show";
+ description { state: "default" 0.0;
+ rel1.offset: -3 -2;
+ rel1.to: "base_vbar";
+ rel2.offset: 2 4;
+ rel2.to: "base_vbar";
+ image.normal: "shadow_square_tiny.png";
+ image.border: 6 6 6 6;
+ fill.smooth: 0;
+ fixed: 1 1;
+ }
+ description { state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ rel1.offset: -2 -2;
+ rel2.offset: 1 1;
+ color: 255 255 255 128;
+ }
+ }
+ part { name: "glow_vbar"; mouse_events: 0;
+ clip_to: "sb_vbar_show";
+ description { state: "default" 0.0;
+ rel1.offset: -3 -3;
+ rel1.to: "base_vbar";
+ rel2.offset: 2 2;
+ rel2.to: "base_vbar";
+ image.normal: "glow_small.png";
+ image.border: 7 7 7 7;
+ fill.smooth: 0;
+ visible: 0;
+ fixed: 1 1;
+ }
+ description { state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ part { name: "runner_glow_vbar"; mouse_events: 0;
+ clip_to: "runner_vbar_clip";
+ description { state: "default" 0.0;
+ rel1.offset: 0 -30;
+ rel1.to_x: "runner_vbar_clip";
+ rel1.to_y: "base_vbar";
+ rel2.offset: -1 29;
+ rel2.to_x: "runner_vbar_clip";
+ rel2.to_y: "base_vbar";
+ image.normal: "runner_glow_vert.png";
+ image.border: 0 0 33 33;
+ fixed: 1 1;
+ }
+ }
+ part { name: "base_vbar"; mouse_events: 0;
+ clip_to: "sb_vbar_show";
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.offset: 2 0;
+ rel1.to: "efl.dragable.vbar";
+ rel2.offset: -3 -1;
+ rel2.to: "efl.dragable.vbar";
+ image.normal: "vgrad_med_lighter.png";
+ fill.smooth: 0;
+ min: 3 13;
+ TILED_HORIZ(120)
+ fixed: 1 1;
+ color_class: "scroller_bar";
+ }
+ }
+ part { name: "bevel_vbar"; mouse_events: 0;
+ clip_to: "sb_vbar_show";
+ description { state: "default" 0.0;
+ rel1.to: "base_vbar";
+ rel2.to: "base_vbar";
+ image.normal: "bevel_out.png";
+ image.border: 1 1 1 1;
+ image.middle: 0;
+ fill.smooth: 0;
+ min: 3 3;
+ fixed: 1 1;
+ }
+ }
+ part { name: "center_vbar"; mouse_events: 0;
+ clip_to: "sb_vbar_show";
+ description { state: "default" 0.0;
+ rel1.to: "base_vbar";
+ rel2.to: "base_vbar";
+ image.normal: "holes_tiny_vert.png";
+ FIXED_SIZE(3, 11)
+ }
+ }
+ part { name: "center_glow_vbar"; mouse_events: 0;
+ clip_to: "sb_vbar_show";
+ description { state: "default" 0.0;
+ rel1.to: "center_vbar";
+ rel2.to: "center_vbar";
+ image.normal: "holes_tiny_glow_vert.png";
+ FIXED_SIZE(11, 17)
+ visible: 0;
+ }
+ description { state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ part { name: "arrow1_hbar_indent"; mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.to: "sb_hbar_a1";
+ rel2.to: "sb_hbar_a1";
+ image.normal: "sym_left_dark_normal.png";
+ FIXED_SIZE(15, 15)
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "arrow1_hbar"; mouse_events: 0;
+ clip_to: "sb_hbar_show";
+ description { state: "default" 0.0;
+ rel1.to: "sb_hbar_a1";
+ rel2.to: "sb_hbar_a1";
+ image.normal: "sym_left_light_normal.png";
+ FIXED_SIZE(15, 15)
+ }
+ description { state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "sym_left_glow_normal.png";
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "arrow2_hbar_indent"; mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.to: "sb_hbar_a2";
+ rel2.to: "sb_hbar_a2";
+ image.normal: "sym_right_dark_normal.png";
+ FIXED_SIZE(15, 15)
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "arrow2_hbar"; mouse_events: 0;
+ clip_to: "sb_hbar_show";
+ description { state: "default" 0.0;
+ rel1.to: "sb_hbar_a2";
+ rel2.to: "sb_hbar_a2";
+ image.normal: "sym_right_light_normal.png";
+ FIXED_SIZE(15, 15)
+ }
+ description { state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "sym_right_glow_normal.png";
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "shadow_hbar"; mouse_events: 0;
+ clip_to: "sb_hbar_show";
+ description { state: "default" 0.0;
+ rel1.offset: -3 -2;
+ rel1.to: "base_hbar";
+ rel2.offset: 2 4;
+ rel2.to: "base_hbar";
+ image.normal: "shadow_square_tiny.png";
+ image.border: 6 6 6 6;
+ fill.smooth: 0;
+ fixed: 1 1;
+ }
+ description { state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ rel1.offset: -2 -2;
+ rel2.offset: 1 1;
+ color: 255 255 255 128;
+ }
+ }
+ part { name: "glow_hbar"; mouse_events: 0;
+ clip_to: "sb_hbar_show";
+ description { state: "default" 0.0;
+ rel1.offset: -3 -3;
+ rel1.to: "base_hbar";
+ rel2.offset: 2 2;
+ rel2.to: "base_hbar";
+ image.normal: "glow_small.png";
+ image.border: 7 7 7 7;
+ fill.smooth: 0;
+ visible: 0;
+ fixed: 1 1;
+ }
+ description { state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ part { name: "runner_glow_hbar"; mouse_events: 0;
+ clip_to: "runner_hbar_clip";
+ description { state: "default" 0.0;
+ rel1.offset: -30 0;
+ rel1.to_x: "base_hbar";
+ rel1.to_y: "runner_hbar_clip";
+ rel2.offset: 29 -1;
+ rel2.to_x: "base_hbar";
+ rel2.to_y: "runner_hbar_clip";
+ image.normal: "runner_glow_horiz.png";
+ image.border: 33 33 0 0;
+ fixed: 1 1;
+ }
+ }
+ part { name: "base_hbar"; mouse_events: 0;
+ clip_to: "sb_hbar_show";
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.offset: 0 2;
+ rel1.to: "efl.dragable.hbar";
+ rel2.offset: -1 -3;
+ rel2.to: "efl.dragable.hbar";
+ image.normal: "vgrad_med_lighter.png";
+ fill.smooth: 0;
+ min: 13 3;
+ TILED_HORIZ(120)
+ }
+ }
+ part { name: "bevel_hbar"; mouse_events: 0;
+ clip_to: "sb_hbar_show";
+ description { state: "default" 0.0;
+ rel1.to: "base_hbar";
+ rel2.to: "base_hbar";
+ image.normal: "bevel_out.png";
+ image.border: 1 1 1 1;
+ image.middle: 0;
+ fill.smooth: 0;
+ min: 3 3;
+ fixed: 1 1;
+ }
+ }
+ part { name: "center_hbar"; mouse_events: 0;
+ clip_to: "sb_hbar_show";
+ description { state: "default" 0.0;
+ rel1.to: "base_hbar";
+ rel2.to: "base_hbar";
+ image.normal: "holes_tiny_horiz.png";
+ FIXED_SIZE(11, 3)
+ fixed: 1 1;
+ }
+ }
+ part { name: "center_glow_hbar"; mouse_events: 0;
+ clip_to: "sb_hbar_show";
+ description { state: "default" 0.0;
+ rel1.to: "center_hbar";
+ rel2.to: "center_hbar";
+ image.normal: "holes_tiny_glow_horiz.png";
+ FIXED_SIZE(17, 11)
+ visible: 0;
+ }
+ description { state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ part { name: "dim_effect"; type: RECT; mouse_events: 0;
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ }
+ description { state: "effect" 0.0;
+ color: 50 50 50 255;
+ }
+ }
+ }
+ programs {
+ program {
+ signal: "mouse,down,1*"; source: "efl.dragable.vbar";
+ action: STATE_SET "clicked" 0.0;
+ target: "efl.dragable.vbar";
+ target: "shadow_vbar";
+ target: "glow_vbar";
+ target: "center_glow_vbar";
+ }
+ program {
+ signal: "mouse,down,*"; source: "efl.dragable.vbar";
+ action: SIGNAL_EMIT "efl,vbar,press" "efl";
+ }
+ program {
+ signal: "mouse,up,1"; source: "efl.dragable.vbar";
+ action: STATE_SET "default" 0.0;
+ target: "efl.dragable.vbar";
+ target: "shadow_vbar";
+ target: "glow_vbar";
+ target: "center_glow_vbar";
+ }
+ program {
+ signal: "mouse,up,*"; source: "efl.dragable.vbar";
+ action: SIGNAL_EMIT "efl,vbar,unpress" "efl";
+ }
+ program {
+ signal: "mouse,down,1*"; source: "efl.dragable.hbar";
+ action: STATE_SET "clicked" 0.0;
+ target: "efl.dragable.hbar";
+ target: "shadow_hbar";
+ target: "glow_hbar";
+ target: "center_glow_hbar";
+ }
+ program {
+ signal: "mouse,down,*"; source: "efl.dragable.hbar";
+ action: SIGNAL_EMIT "efl,hbar,press" "efl";
+ }
+ program {
+ signal: "mouse,up,1"; source: "efl.dragable.hbar";
+ action: STATE_SET "default" 0.0;
+ target: "efl.dragable.hbar";
+ target: "shadow_hbar";
+ target: "glow_hbar";
+ target: "center_glow_hbar";
+ }
+ program {
+ signal: "mouse,up,*"; source: "efl.dragable.hbar";
+ action: SIGNAL_EMIT "efl,hbar,unpress" "efl";
+ }
+ program {
+ signal: "efl,action,looping,left"; source: "efl";
+ action: STATE_SET "effect" 0.0;
+ transition: LINEAR 0.3;
+ target: "dim_effect";
+ after: "looping,left,done";
+ }
+ program { name: "looping,left,done";
+ action: SIGNAL_EMIT "efl,looping,left,done" "efl";
+ }
+ program {
+ signal: "efl,action,looping,left,end"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ transition: LINEAR 0.3;
+ target: "dim_effect";
+ }
+ program {
+ signal: "efl,action,looping,right"; source: "efl";
+ action: STATE_SET "effect" 0.0;
+ transition: LINEAR 0.3;
+ target: "dim_effect";
+ after: "looping,right,done";
+ }
+ program { name: "looping,right,done";
+ action: SIGNAL_EMIT "efl,looping,right,done" "efl";
+ }
+ program {
+ signal: "efl,action,looping,right,end"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ transition: LINEAR 0.3;
+ target: "dim_effect";
+ }
+ program {
+ signal: "efl,action,looping,up"; source: "efl";
+ action: STATE_SET "effect" 0.0;
+ transition: LINEAR 0.3;
+ target: "dim_effect";
+ after: "looping,up,done";
+ }
+ program { name: "looping,up,done";
+ action: SIGNAL_EMIT "efl,looping,up,done" "efl";
+ }
+ program {
+ signal: "efl,action,looping,up,end"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ transition: LINEAR 0.3;
+ target: "dim_effect";
+ }
+ program {
+ signal: "efl,action,looping,down"; source: "efl";
+ action: STATE_SET "effect" 0.0;
+ transition: LINEAR 0.3;
+ target: "dim_effect";
+ after: "looping,down,done";
+ }
+ program { name: "looping,down,done";
+ action: SIGNAL_EMIT "efl,looping,down,done" "efl";
+ }
+ program {
+ signal: "efl,action,looping,down,end"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ transition: LINEAR 0.3;
+ target: "dim_effect";
+ }
+ }
}
-group { "efl/scroller/contents";
- inherit: "elm/scroller/contents/default";
+group { name: "efl/scroller:noclip";
+ inherit: "efl/scroller";
+ parts {
+ part { name: "clipper";
+ description { state: "default" 0.0;
+ rel1.offset: -999999 -999999;
+ rel2.offset: 999999 999999;
+ }
+ }
+ part { name: "efl.background";
+ description { state: "default" 0.0;
+ rel1.offset: 0 0;
+ rel2.offset: -1 -1;
+ }
+ }
+ part { name: "efl.content";
+ description { state: "default" 0.0;
+ rel1.offset: 0 1;
+ rel2.offset: -1 -1;
+ }
+ }
+ part { name: "inset";
+ description { state: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "shadow";
+ description { state: "default" 0.0;
+ visible: 0;
+ }
+ }
+ }
}
+group { name: "efl/scroller/contents";
+ parts {
+ part { name: "efl.content";
+ type: SWALLOW;
+ description { state: "default" 0.0;
+ }
+ }
+ part { name: "efl.content_r";
+ type: SWALLOW;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1 {
+ relative: 1.0 0.0;
+ to: "efl.content";
+ }
+ rel2 {
+ relative: 2.0 1.0;
+ to: "efl.content";
+ }
+ }
+ }
+ part { name: "efl.content_b";
+ type: SWALLOW;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1 {
+ relative: 0.0 1.0;
+ to: "efl.content";
+ }
+ rel2 {
+ relative: 1.0 2.0;
+ to: "efl.content";
+ }
+ }
+ }
+ part { name: "efl.content_rb";
+ type: SWALLOW;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1 {
+ relative: 1.0 1.0;
+ to: "efl.content";
+ }
+ rel2 {
+ relative: 2.0 2.0;
+ to: "efl.content";
+ }
+ }
+ }
+ }
+}
diff --git a/data/elementary/themes/edc/efl/slider.edc b/data/elementary/themes/edc/efl/slider.edc
index 20b479b1f1..095e3aca33 100644
--- a/data/elementary/themes/edc/efl/slider.edc
+++ b/data/elementary/themes/edc/efl/slider.edc
@@ -1,73 +1,1037 @@
-group { "efl/slider/hidden/limit";
- inherit: "elm/slider/hidden/limit";
-}
-
-group { "efl/slider/horizontal/indicator";
- inherit: "elm/slider/horizontal/indicator/default";
- alias: "efl/slider/horizontal/indicator:disabled";
- alias: "efl/slider/horizontal/popup";
- alias: "efl/slider_interval/horizontal/indicator";
- alias: "efl/slider_interval/horizontal/popup";
-}
-
-group { "efl/slider/vertical/indicator";
- inherit: "elm/slider/vertical/indicator/default";
- alias: "efl/slider/vertical/indicator:disabled";
- alias: "efl/slider/vertical/popup";
- alias: "efl/slider_interval/vertical/indicator";
- alias: "efl/slider_interval/vertical/popup";
-}
-
group { "efl/slider/horizontal";
- inherit: "elm/slider/horizontal/default";
alias: "efl/slider/horizontal:disabled";
+ images.image: "slider_run_base_horiz.png" COMP;
+ images.image: "slider_run_bevel_horiz.png" COMP;
+ images.image: "slider_run_base_light_horiz.png" COMP;
+ images.image: "horiz_glow_run.png" COMP;
+ images.image: "horiz_glow_run_rev.png" COMP;
+ images.image: "knob_round_small_normal.png" COMP;
+ images.image: "knob_round_small_selected.png" COMP;
+ set { name: "knob";
+ // XXX: add more sizes (at least up to 128x128)
+ image { image: "knob_sz_24.png" COMP; size: 31 31 32 32; }
+ image { image: "knob_sz_22.png" COMP; size: 29 29 30 30; }
+ image { image: "knob_sz_20.png" COMP; size: 27 27 28 28; }
+ image { image: "knob_sz_18.png" COMP; size: 25 25 26 26; }
+ image { image: "knob_sz_16.png" COMP; size: 23 23 24 24; }
+ image { image: "knob_sz_14.png" COMP; size: 21 21 22 22; }
+ image { image: "knob_sz_12.png" COMP; size: 19 19 20 20; }
+ image { image: "knob_sz_10.png" COMP; size: 17 17 18 18; }
+ image { image: "knob_sz_08.png" COMP; size: 15 15 16 16; }
+ image { image: "knob_sz_06.png" COMP; size: 13 13 14 14; }
+ image { image: "knob_sz_04.png" COMP; size: 0 0 12 12; }
+ }
+#define MASK 15
+#define INVERT 16
+#define DISABLE 32
+ script {
+ public slmode;
+ public eval_mode(m) {
+ new d = m & DISABLE;
+ new i = m & INVERT;
+ if (i) {
+ if (!d) {
+ set_state(PART:"base", "default", 0.0);
+ set_state(PART:"glow", "inverted", 0.0);
+ } else {
+ set_state(PART:"base", "disabled", 0.0);
+ set_state(PART:"glow", "disabled_inverted", 0.0);
+ }
+ } else {
+ if (!d) {
+ set_state(PART:"base", "default", 0.0);
+ set_state(PART:"glow", "default", 0.0);
+ } else {
+ set_state(PART:"base", "disabled", 0.0);
+ set_state(PART:"glow", "disabled", 0.0);
+ }
+ }
+ if (!d) {
+ set_state(PART:"event", "default", 0.0);
+ } else {
+ set_state(PART:"event", "disabled", 0.0);
+ }
+ }
+ }
parts {
- part { "limits";
- source: "efl/slider/hidden/limit";
+ part { name: "efl.bar"; type: SWALLOW;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 42 21;
+ max: 99999 21;
+ align: 1.0 0.5;
+ rel1.relative: 0.0 0.0;
+ rel1.offset: 2 0;
+ rel2.relative: 1.0 1.0;
+ rel2.offset: -3 -1;
+ }
+ }
+ part { name: "base"; mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.to: "efl.bar";
+ rel2.to: "efl.bar";
+ image.normal: "slider_run_base_horiz.png";
+ image.border: 4 4 0 0;
+ fill.smooth: 0;
+ min: 8 5;
+ max: 99999 5;
+ fixed: 0 1;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "slider_run_base_light_horiz.png";
+ }
+ }
+ part { name: "glow"; mouse_events: 0;
+ description { state: "default" 0.0;
+ image.normal: "horiz_glow_run.png";
+ rel1.offset: 1 1;
+ rel1.to: "base";
+ rel2.relative: 0.5 1.0;
+ rel2.offset: -1 -2;
+ rel2.to_x: "efl.dragable.slider";
+ rel2.to_y: "base";
+ image.border: 0 4 0 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 64;
+ }
+ description { state: "inverted" 0.0;
+ image.normal: "horiz_glow_run_rev.png";
+ rel1.relative: 0.5 0.0;
+ rel1.offset: 0 1;
+ rel1.to_x: "efl.dragable.slider";
+ rel1.to_y: "base";
+ rel2.offset: -2 -2;
+ rel2.to: "base";
+ image.border: 4 0 0 0;
+ }
+ description { state: "disabled_inverted" 0.0;
+ inherit: "inverted" 0.0;
+ color: 255 255 255 64;
+ }
+ }
+ part { name: "bevel"; mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.to: "base";
+ rel2.to: "base";
+ image.normal: "slider_run_bevel_horiz.png";
+ image.border: 5 5 0 0;
+ fill.smooth: 0;
+ }
+ }
+ part { name: "efl.dragable.slider"; type: RECT;
+ nomouse;
+ scale: 1;
+ dragable.x: 1 1 0;
+ dragable.y: 0 0 0;
+ dragable.confine: "efl.bar";
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ min: 16 16;
+ max: 16 16;
+ fixed: 1 1;
+ rel1.relative: 0.5 0.0;
+ rel1.to_x: "efl.bar";
+ rel2.relative: 0.5 1.0;
+ rel2.to_x: "efl.bar";
+ }
+ }
+ part { name: "knob";
+ nomouse;
+ description { state: "default" 0.0;
+ image.normal: "knob";
+ fixed: 1 1;
+ min: 12 12;
+ step: 2 2;
+ max: 32 32; // XXX allow bigger sizes with more knob images
+ rel1.to: "efl.dragable.slider";
+ rel1.offset: -4 -4;
+ rel2.to: "efl.dragable.slider";
+ rel2.offset: 3 3;
+ }
+ description { state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ }
+ }
+ part { name: "slideevent"; type: RECT; repeat_events: 1;
+ nomouse;
+ scale: 1;
+ ignore_flags: ON_HOLD;
+ dragable.events: "efl.dragable.slider";
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "efl.dragable.slider";
+ rel2.to: "efl.dragable.slider";
+ color: 0 0 0 0;
+ }
+ }
+ part { name: "efl.track.slider"; type: SWALLOW; mouse_events: 0;
+ description { state: "default" 0.0;
+ max: 0 0;
+ rel1.to: "efl.dragable.slider";
+ rel2.to: "efl.dragable.slider";
+ }
+ }
+ part { name: "event"; type: RECT;
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ visible: 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ }
+ programs {
+ program {
+ signal: "mouse,down,1"; source: "efl.dragable.slider";
+ action: STATE_SET "clicked" 0.0;
+ target: "knob";
+ }
+ program {
+ signal: "mouse,up,1"; source: "efl.dragable.slider";
+ action: STATE_SET "default" 0.0;
+ target: "knob";
}
- part { "button";
- source: "efl/slider/horizontal/indicator";
+ program {
+ signal: "efl,state,inverted,on"; source: "efl";
+ script {
+ new m = get_int(slmode);
+ m |= INVERT; set_int(slmode, m);
+ eval_mode(m);
+ }
+ }
+ program {
+ signal: "efl,state,inverted,off"; source: "efl";
+ script {
+ new m = get_int(slmode);
+ m &= ~INVERT; set_int(slmode, m);
+ eval_mode(m);
+ }
+ }
+ program {
+ signal: "efl,state,disabled"; source: "efl";
+ script {
+ new m = get_int(slmode);
+ m |= DISABLE; set_int(slmode, m);
+ eval_mode(m);
+ }
+ }
+ program {
+ signal: "efl,state,enabled"; source: "efl";
+ script {
+ new m = get_int(slmode);
+ m &= ~DISABLE; set_int(slmode, m);
+ eval_mode(m);
+ }
}
}
+#undef MASK
+#undef INVERT
+#undef DISABLE
}
group { "efl/slider/vertical";
- inherit: "elm/slider/vertical/default";
alias: "efl/slider/vertical:disabled";
+ images.image: "slider_run_base_vert.png" COMP;
+ images.image: "slider_run_bevel_vert.png" COMP;
+ images.image: "slider_run_base_light_vert.png" COMP;
+ images.image: "vert_glow_run.png" COMP;
+ images.image: "vert_glow_run_rev.png" COMP;
+ images.image: "knob_round_small_normal.png" COMP;
+ images.image: "knob_round_small_selected.png" COMP;
+ set { name: "knob";
+ // XXX: add more sizes (at least up to 128x128)
+ image { image: "knob_sz_24.png" COMP; size: 31 31 32 32; }
+ image { image: "knob_sz_22.png" COMP; size: 29 29 30 30; }
+ image { image: "knob_sz_20.png" COMP; size: 27 27 28 28; }
+ image { image: "knob_sz_18.png" COMP; size: 25 25 26 26; }
+ image { image: "knob_sz_16.png" COMP; size: 23 23 24 24; }
+ image { image: "knob_sz_14.png" COMP; size: 21 21 22 22; }
+ image { image: "knob_sz_12.png" COMP; size: 19 19 20 20; }
+ image { image: "knob_sz_10.png" COMP; size: 17 17 18 18; }
+ image { image: "knob_sz_08.png" COMP; size: 15 15 16 16; }
+ image { image: "knob_sz_06.png" COMP; size: 13 13 14 14; }
+ image { image: "knob_sz_04.png" COMP; size: 0 0 12 12; }
+ }
+#define MASK 15
+#define INVERT 16
+#define DISABLE 32
+ script {
+ public slmode;
+ public eval_mode(m) {
+ new d = m & DISABLE;
+ new i = m & INVERT;
+ if (i) {
+ if (!d) {
+ set_state(PART:"base", "default", 0.0);
+ set_state(PART:"glow", "inverted", 0.0);
+ } else {
+ set_state(PART:"base", "disabled", 0.0);
+ set_state(PART:"glow", "disabled_inverted", 0.0);
+ }
+ } else {
+ if (!d) {
+ set_state(PART:"base", "default", 0.0);
+ set_state(PART:"glow", "default", 0.0);
+ } else {
+ set_state(PART:"base", "disabled", 0.0);
+ set_state(PART:"glow", "disabled", 0.0);
+ }
+ }
+ if (!d) {
+ set_state(PART:"event", "default", 0.0);
+ } else {
+ set_state(PART:"event", "disabled", 0.0);
+ }
+ }
+ }
parts {
- part { "limits";
- source: "efl/slider/hidden/limit";
+ part { name: "efl.bar"; type: SWALLOW;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 21 42;
+ max: 21 99999;
+ align: 0.5 1.0;
+ rel1.relative: 0.0 0.0;
+ rel1.offset: 0 2;
+ rel2.relative: 1.0 1.0;
+ rel2.offset: -1 -3;
+ }
+ }
+ part { name: "base"; mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.to: "efl.bar";
+ rel2.to: "efl.bar";
+ image.normal: "slider_run_base_vert.png";
+ image.border: 0 0 4 4;
+ fill.smooth: 0;
+ min: 5 8;
+ max: 5 99999;
+ fixed: 1 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "slider_run_base_light_vert.png";
+ }
+ }
+ part { name: "glow"; mouse_events: 0;
+ description { state: "default" 0.0;
+ image.normal: "vert_glow_run.png";
+ rel1.relative: 0.0 0.5;
+ rel1.offset: 1 0;
+ rel1.to_y: "efl.dragable.slider";
+ rel1.to_x: "base";
+ rel2.offset: -2 -2;
+ rel2.to: "base";
+ image.border: 0 0 4 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 64;
+ }
+ description { state: "inverted" 0.0;
+ image.normal: "vert_glow_run_rev.png";
+ rel1.offset: 1 1;
+ rel1.to: "base";
+ rel2.relative: 1.0 0.5;
+ rel2.offset: -2 -1;
+ rel2.to_y: "efl.dragable.slider";
+ rel2.to_x: "base";
+ image.border: 0 0 0 4;
+ }
+ description { state: "disabled_inverted" 0.0;
+ inherit: "inverted" 0.0;
+ color: 255 255 255 64;
+ }
+ }
+ part { name: "bevel"; mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.to: "base";
+ rel2.to: "base";
+ image.normal: "slider_run_bevel_vert.png";
+ image.border: 0 0 5 5;
+ fill.smooth: 0;
+ }
+ }
+ part { name: "efl.dragable.slider"; type: RECT;
+ nomouse;
+ scale: 1;
+ dragable.x: 0 0 0;
+ dragable.y: 1 1 0;
+ dragable.confine: "efl.bar";
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ min: 16 16;
+ max: 16 16;
+ fixed: 1 1;
+ rel1.relative: 0.0 0.5;
+ rel1.to_x: "efl.bar";
+ rel2.relative: 1.0 0.5;
+ rel2.to_x: "efl.bar";
+ }
+ }
+ part { name: "knob";
+ nomouse;
+ description { state: "default" 0.0;
+ image.normal: "knob";
+ fixed: 1 1;
+ min: 12 12;
+ step: 2 2;
+ max: 32 32; // XXX allow bigger sizes with more knob images
+ rel1.to: "efl.dragable.slider";
+ rel1.offset: -4 -4;
+ rel2.to: "efl.dragable.slider";
+ rel2.offset: 3 3;
+ }
+ description { state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ }
+ }
+ part { name: "slideevent"; type: RECT; repeat_events: 1;
+ nomouse;
+ scale: 1;
+ ignore_flags: ON_HOLD;
+ dragable.events: "efl.dragable.slider";
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "efl.dragable.slider";
+ rel2.to: "efl.dragable.slider";
+ color: 0 0 0 0;
+ }
+ }
+ part { name: "efl.track.slider"; type: SWALLOW; mouse_events: 0;
+ description { state: "default" 0.0;
+ max: 0 0;
+ rel1.to: "efl.dragable.slider";
+ rel2.to: "efl.dragable.slider";
+ }
+ }
+ part { name: "event"; type: RECT;
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ visible: 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ }
+ programs {
+ program {
+ signal: "mouse,down,1"; source: "efl.dragable.slider";
+ action: STATE_SET "clicked" 0.0;
+ target: "knob";
+ }
+ program {
+ signal: "mouse,up,1"; source: "efl.dragable.slider";
+ action: STATE_SET "default" 0.0;
+ target: "knob";
+ }
+ program {
+ signal: "efl,state,inverted,on"; source: "efl";
+ script {
+ new m = get_int(slmode);
+ m |= INVERT; set_int(slmode, m);
+ eval_mode(m);
+ }
+ }
+ program {
+ signal: "efl,state,inverted,off"; source: "efl";
+ script {
+ new m = get_int(slmode);
+ m &= ~INVERT; set_int(slmode, m);
+ eval_mode(m);
+ }
+ }
+ program {
+ signal: "efl,state,disabled"; source: "efl";
+ script {
+ new m = get_int(slmode);
+ m |= DISABLE; set_int(slmode, m);
+ eval_mode(m);
+ }
}
- part { "button";
- source: "efl/slider/vertical/indicator";
+ program {
+ signal: "efl,state,enabled"; source: "efl";
+ script {
+ new m = get_int(slmode);
+ m &= ~DISABLE; set_int(slmode, m);
+ eval_mode(m);
+ }
}
}
+#undef MASK
+#undef INVERT
+#undef DISABLE
}
//Range
group { "efl/slider_interval/horizontal";
- inherit: "elm/slider/range/horizontal/default";
alias: "efl/slider/horizontal:disabled";
+ images.image: "slider_run_base_horiz.png" COMP;
+ images.image: "slider_run_bevel_horiz.png" COMP;
+ images.image: "slider_run_base_light_horiz.png" COMP;
+ images.image: "horiz_glow_run.png" COMP;
+ images.image: "horiz_glow_range.png" COMP;
+ images.image: "horiz_glow_run_rev.png" COMP;
+ images.image: "knob_round_small_normal.png" COMP;
+ images.image: "knob_round_small_selected.png" COMP;
+ set { name: "knob";
+ // XXX: add more sizes (at least up to 128x128)
+ image { image: "knob_sz_24.png" COMP; size: 31 31 32 32; }
+ image { image: "knob_sz_22.png" COMP; size: 29 29 30 30; }
+ image { image: "knob_sz_20.png" COMP; size: 27 27 28 28; }
+ image { image: "knob_sz_18.png" COMP; size: 25 25 26 26; }
+ image { image: "knob_sz_16.png" COMP; size: 23 23 24 24; }
+ image { image: "knob_sz_14.png" COMP; size: 21 21 22 22; }
+ image { image: "knob_sz_12.png" COMP; size: 19 19 20 20; }
+ image { image: "knob_sz_10.png" COMP; size: 17 17 18 18; }
+ image { image: "knob_sz_08.png" COMP; size: 15 15 16 16; }
+ image { image: "knob_sz_06.png" COMP; size: 13 13 14 14; }
+ image { image: "knob_sz_04.png" COMP; size: 0 0 12 12; }
+ }
+#define MASK 15
+#define DISABLE 32
+ script {
+ public slmode;
+ public g_timer_id;
+ public update_glow()
+ {
+ new x1,y1,w1,h1;
+ new x2,y2,w2,h2;
+ get_geometry(PART:"knob", x1, y1, w1, h1);
+ get_geometry(PART:"knob2", x2, y2, w2, h2);
+ if(x2 < x1)
+ set_state(PART:"glow", "range_reverse", 0.0);
+ else
+ set_state(PART:"glow", "default", 0.0);
+ }
+ public eval_mode(m) {
+ new d = m & DISABLE;
+ if (d) {
+ new x1,y1,w1,h1;
+ new x2,y2,w2,h2;
+ get_geometry(PART:"knob", x1, y1, w1, h1);
+ get_geometry(PART:"knob2", x2, y2, w2, h2);
+ set_state(PART:"base", "disabled", 0.0);
+ if(x2 < x1)
+ set_state(PART:"glow", "disabled_range_reverse", 0.0);
+ else
+ set_state(PART:"glow", "disabled_range", 0.0);
+ }
+ if (!d) {
+ set_state(PART:"event", "default", 0.0);
+ } else {
+ set_state(PART:"event", "disabled", 0.0);
+ }
+ }
+ }
parts {
- part { "limits";
- source: "efl/slider/hidden/limit";
+ part { name: "efl.bar"; type: SWALLOW;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 42 21;
+ max: 99999 21;
+ align: 1.0 0.5;
+ rel1.relative: 0.0 0.0;
+ rel1.offset: 2 0;
+ rel2.relative: 1.0 1.0;
+ rel2.offset: -3 -1;
+ }
+ }
+ part { name: "base"; mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.to: "efl.bar";
+ rel2.to: "efl.bar";
+ image.normal: "slider_run_base_horiz.png";
+ image.border: 4 4 0 0;
+ fill.smooth: 0;
+ min: 8 5;
+ max: 99999 5;
+ fixed: 0 1;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "slider_run_base_light_horiz.png";
+ }
+ }
+ part { name: "glow"; mouse_events: 0;
+ description { state: "default" 0.0;
+ image.normal: "horiz_glow_range.png";
+ rel1.relative: 0.5 1.0;
+ rel1.offset: -1 -2;
+ rel1.to_x: "efl.dragable.slider";
+ rel1.to_y: "base";
+ rel2.relative: 0.5 1.0;
+ rel2.offset: -1 -2;
+ rel2.to_x: "efl.dragable2.slider";
+ rel2.to_y: "base";
+ fixed: 0 1;
+ image.border: 0 4 0 0;
+ }
+ description { state: "disabled_range" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 64;
+ }
+ description { state: "range_reverse" 0.0;
+ inherit: "default" 0.0;
+ rel1.to_x: "efl.dragable2.slider";
+ rel2.to_x: "efl.dragable.slider";
+ }
+ description { state: "disabled_range_reverse" 0.0;
+ inherit: "range_reverse" 0.0;
+ color: 255 255 255 64;
+ }
+ }
+ part { name: "bevel"; mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.to: "base";
+ rel2.to: "base";
+ image.normal: "slider_run_bevel_horiz.png";
+ image.border: 5 5 0 0;
+ fill.smooth: 0;
+ }
+ }
+ part { name: "efl.dragable.slider"; type: RECT;
+ nomouse;
+ scale: 1;
+ dragable.x: 1 1 0;
+ dragable.y: 0 0 0;
+ dragable.confine: "efl.bar";
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ min: 16 16;
+ max: 16 16;
+ fixed: 1 1;
+ rel1.relative: 0.5 0.0;
+ rel1.to_x: "efl.bar";
+ rel2.relative: 0.5 1.0;
+ rel2.to_x: "efl.bar";
+ }
+ }
+ part { name: "knob";
+ nomouse;
+ description { state: "default" 0.0;
+ image.normal: "knob";
+ fixed: 1 1;
+ min: 12 12;
+ step: 2 2;
+ max: 32 32; // XXX allow bigger sizes with more knob images
+ rel1.to: "efl.dragable.slider";
+ rel1.offset: -4 -4;
+ rel2.to: "efl.dragable.slider";
+ rel2.offset: 3 3;
+ }
+ description { state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ }
+ }
+ part { name: "slideevent"; type: RECT; repeat_events: 1;
+ nomouse;
+ scale: 1;
+ ignore_flags: ON_HOLD;
+ dragable.events: "efl.dragable.slider";
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "efl.dragable.slider";
+ rel2.to: "efl.dragable.slider";
+ color: 0 0 0 0;
+ }
+ }
+ part { name: "efl.track.slider"; type: SWALLOW; mouse_events: 0;
+ description { state: "default" 0.0;
+ max: 0 0;
+ rel1.to: "efl.dragable.slider";
+ rel2.to: "efl.dragable.slider";
+ }
+ }
+ part { name: "efl.dragable2.slider"; type: RECT;
+ nomouse;
+ scale: 1;
+ dragable.x: 1 1 0;
+ dragable.y: 0 0 0;
+ dragable.confine: "efl.bar";
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ min: 16 16;
+ max: 16 16;
+ fixed: 1 1;
+ rel1.relative: 0.5 0.0;
+ rel1.to_x: "efl.bar";
+ rel2.relative: 0.5 1.0;
+ rel2.to_x: "efl.bar";
+ }
+ }
+ part { name: "knob2";
+ nomouse;
+ description { state: "default" 0.0;
+ image.normal: "knob";
+ fixed: 1 1;
+ min: 12 12;
+ step: 2 2;
+ max: 32 32; // XXX allow bigger sizes with more knob images
+ rel1.to: "efl.dragable2.slider";
+ rel1.offset: -4 -4;
+ rel2.to: "efl.dragable2.slider";
+ rel2.offset: 3 3;
+ }
+ description { state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ }
+ }
+ part { name: "slideevent2"; type: RECT; repeat_events: 1;
+ nomouse;
+ scale: 1;
+ ignore_flags: ON_HOLD;
+ dragable.events: "efl.dragable2.slider";
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "efl.dragable2.slider";
+ rel2.to: "efl.dragable2.slider";
+ color: 0 0 0 0;
+ }
+ }
+ part { name: "efl.track2.slider"; type: SWALLOW; mouse_events: 0;
+ description { state: "default" 0.0;
+ max: 0 0;
+ rel1.to: "efl.dragable2.slider";
+ rel2.to: "efl.dragable2.slider";
+ }
+ }
+ part { name: "event"; type: RECT;
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ visible: 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ }
+ programs {
+ program {
+ signal: "mouse,down,1"; source: "efl.dragable.slider";
+ action: STATE_SET "clicked" 0.0;
+ target: "knob";
+ }
+ program {
+ signal: "mouse,up,1"; source: "efl.dragable.slider";
+ action: STATE_SET "default" 0.0;
+ target: "knob";
+ }
+ program {
+ signal: "drag";
+ source: "efl.dragable*";
+ script {
+ update_glow();
+ }
+ }
+ program {
+ signal: "efl,state,disabled"; source: "efl";
+ script {
+ new m = get_int(slmode);
+ m |= DISABLE; set_int(slmode, m);
+ eval_mode(m);
+ }
}
- part { "button";
- source: "efl/slider_interval/horizontal/indicator";
+ program {
+ signal: "efl,state,enabled"; source: "efl";
+ script {
+ new m = get_int(slmode);
+ m &= ~DISABLE; set_int(slmode, m);
+ eval_mode(m);
+ }
}
}
+#undef MASK
+#undef DISABLE
}
group { "efl/slider_interval/vertical";
- inherit: "elm/slider/range/vertical/default";
alias: "efl/slider/vertical:disabled";
+ images.image: "slider_run_base_vert.png" COMP;
+ images.image: "slider_run_bevel_vert.png" COMP;
+ images.image: "slider_run_base_light_vert.png" COMP;
+ images.image: "vert_glow_run.png" COMP;
+ images.image: "vert_glow_range.png" COMP;
+ images.image: "vert_glow_run_rev.png" COMP;
+ images.image: "knob_round_small_normal.png" COMP;
+ images.image: "knob_round_small_selected.png" COMP;
+ set { name: "knob";
+ // XXX: add more sizes (at least up to 128x128)
+ image { image: "knob_sz_24.png" COMP; size: 31 31 32 32; }
+ image { image: "knob_sz_22.png" COMP; size: 29 29 30 30; }
+ image { image: "knob_sz_20.png" COMP; size: 27 27 28 28; }
+ image { image: "knob_sz_18.png" COMP; size: 25 25 26 26; }
+ image { image: "knob_sz_16.png" COMP; size: 23 23 24 24; }
+ image { image: "knob_sz_14.png" COMP; size: 21 21 22 22; }
+ image { image: "knob_sz_12.png" COMP; size: 19 19 20 20; }
+ image { image: "knob_sz_10.png" COMP; size: 17 17 18 18; }
+ image { image: "knob_sz_08.png" COMP; size: 15 15 16 16; }
+ image { image: "knob_sz_06.png" COMP; size: 13 13 14 14; }
+ image { image: "knob_sz_04.png" COMP; size: 0 0 12 12; }
+ }
+#define MASK 15
+#define DISABLE 32
+ script {
+ public slmode;
+ public g_timer_id;
+ public update_glow()
+ {
+ new x1,y1,w1,h1;
+ new x2,y2,w2,h2;
+ get_geometry(PART:"knob", x1, y1, w1, h1);
+ get_geometry(PART:"knob2", x2, y2, w2, h2);
+ if(y2 < y1)
+ set_state(PART:"glow", "range_reverse", 0.0);
+ else
+ set_state(PART:"glow", "default", 0.0);
+ }
+ public eval_mode(m) {
+ new d = m & DISABLE;
+ if (d) {
+ new x1,y1,w1,h1;
+ new x2,y2,w2,h2;
+ get_geometry(PART:"knob", x1, y1, w1, h1);
+ get_geometry(PART:"knob2", x2, y2, w2, h2);
+ set_state(PART:"base", "disabled", 0.0);
+ if(y2 < y1)
+ set_state(PART:"glow", "disabled_range_reverse", 0.0);
+ else
+ set_state(PART:"glow", "disabled_range", 0.0);
+ }
+ if (!d) {
+ set_state(PART:"event", "default", 0.0);
+ } else {
+ set_state(PART:"event", "disabled", 0.0);
+ }
+ }
+ }
parts {
- part { "limits";
- source: "efl/slider/hidden/limit";
+ part { name: "efl.bar"; type: SWALLOW;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 21 42;
+ max: 21 99999;
+ align: 0.5 1.0;
+ rel1.relative: 0.0 0.0;
+ rel1.offset: 0 2;
+ rel2.relative: 1.0 1.0;
+ rel2.offset: -1 -3;
+ }
+ }
+ part { name: "base"; mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.to: "efl.bar";
+ rel2.to: "efl.bar";
+ image.normal: "slider_run_base_vert.png";
+ image.border: 0 0 4 4;
+ fill.smooth: 0;
+ min: 5 8;
+ max: 5 99999;
+ fixed: 1 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "slider_run_base_light_vert.png";
+ }
+ }
+ part { name: "glow"; mouse_events: 0;
+ description { state: "default" 0.0;
+ image.normal: "vert_glow_range.png";
+ rel1.relative: 0.5 1.0;
+ rel1.offset: -1 -2;
+ rel1.to_x: "base";
+ rel1.to_y: "efl.dragable.slider";
+ rel2.relative: 0.5 1.0;
+ rel2.offset: -1 -2;
+ rel2.to_x: "base";
+ rel2.to_y: "efl.dragable2.slider";
+ fixed: 1 0;
+ image.border: 0 4 0 0;
+ }
+ description { state: "disabled_range" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 64;
+ }
+ description { state: "range_reverse" 0.0;
+ inherit: "default" 0.0;
+ rel1.to_y: "efl.dragable2.slider";
+ rel2.to_y: "efl.dragable.slider";
+ }
+ description { state: "disabled_range_reverse" 0.0;
+ inherit: "range_reverse" 0.0;
+ color: 255 255 255 64;
+ }
+ }
+ part { name: "bevel"; mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.to: "base";
+ rel2.to: "base";
+ image.normal: "slider_run_bevel_vert.png";
+ image.border: 0 0 5 5;
+ fill.smooth: 0;
+ }
+ }
+ part { name: "efl.dragable.slider"; type: RECT;
+ nomouse;
+ scale: 1;
+ dragable.x: 0 0 0;
+ dragable.y: 1 1 0;
+ dragable.confine: "efl.bar";
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ min: 16 16;
+ max: 16 16;
+ fixed: 1 1;
+ rel1.relative: 0.0 0.5;
+ rel1.to_x: "efl.bar";
+ rel2.relative: 1.0 0.5;
+ rel2.to_x: "efl.bar";
+ }
+ }
+ part { name: "knob";
+ nomouse;
+ description { state: "default" 0.0;
+ image.normal: "knob";
+ fixed: 1 1;
+ min: 12 12;
+ step: 2 2;
+ max: 32 32; // XXX allow bigger sizes with more knob images
+ rel1.to: "efl.dragable.slider";
+ rel1.offset: -4 -4;
+ rel2.to: "efl.dragable.slider";
+ rel2.offset: 3 3;
+ }
+ description { state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ }
+ }
+ part { name: "slideevent"; type: RECT; repeat_events: 1;
+ nomouse;
+ scale: 1;
+ ignore_flags: ON_HOLD;
+ dragable.events: "efl.dragable.slider";
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "efl.dragable.slider";
+ rel2.to: "efl.dragable.slider";
+ color: 0 0 0 0;
+ }
+ }
+ part { name: "efl.track.slider"; type: SWALLOW; mouse_events: 0;
+ description { state: "default" 0.0;
+ max: 0 0;
+ rel1.to: "efl.dragable.slider";
+ rel2.to: "efl.dragable.slider";
+ }
+ }
+ part { name: "efl.dragable2.slider"; type: RECT;
+ nomouse;
+ scale: 1;
+ dragable.x: 0 0 0;
+ dragable.y: 1 1 0;
+ dragable.confine: "efl.bar";
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ min: 16 16;
+ max: 16 16;
+ fixed: 1 1;
+ rel1.relative: 0.0 0.5;
+ rel1.to_x: "efl.bar";
+ rel2.relative: 1.0 0.5;
+ rel2.to_x: "efl.bar";
+ }
+ }
+ part { name: "knob2";
+ nomouse;
+ description { state: "default" 0.0;
+ image.normal: "knob";
+ fixed: 1 1;
+ min: 12 12;
+ step: 2 2;
+ max: 32 32; // XXX allow bigger sizes with more knob images
+ rel1.to: "efl.dragable2.slider";
+ rel1.offset: -4 -4;
+ rel2.to: "efl.dragable2.slider";
+ rel2.offset: 3 3;
+ }
+ description { state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ }
+ }
+ part { name: "slideevent2"; type: RECT; repeat_events: 1;
+ nomouse;
+ scale: 1;
+ ignore_flags: ON_HOLD;
+ dragable.events: "efl.dragable2.slider";
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "efl.dragable2.slider";
+ rel2.to: "efl.dragable2.slider";
+ color: 0 0 0 0;
+ }
+ }
+ part { name: "efl.track2.slider"; type: SWALLOW; mouse_events: 0;
+ description { state: "default" 0.0;
+ max: 0 0;
+ rel1.to: "efl.dragable2.slider";
+ rel2.to: "efl.dragable2.slider";
+ }
+ }
+ part { name: "event"; type: RECT;
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ visible: 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ }
+ programs {
+ program {
+ signal: "mouse,down,1"; source: "efl.dragable.slider";
+ action: STATE_SET "clicked" 0.0;
+ target: "knob";
+ }
+ program {
+ signal: "mouse,up,1"; source: "efl.dragable.slider";
+ action: STATE_SET "default" 0.0;
+ target: "knob";
+ }
+ program {
+ signal: "drag";
+ source: "efl.dragable*";
+ script {
+ update_glow();
+ }
+ }
+ program {
+ signal: "efl,state,disabled"; source: "efl";
+ script {
+ new m = get_int(slmode);
+ m |= DISABLE; set_int(slmode, m);
+ eval_mode(m);
+ }
}
- part { "button";
- source: "efl/slider_interval/vertical/indicator";
+ program {
+ signal: "efl,state,enabled"; source: "efl";
+ script {
+ new m = get_int(slmode);
+ m &= ~DISABLE; set_int(slmode, m);
+ eval_mode(m);
+ }
}
}
+#undef MASK
+#undef DISABLE
}
diff --git a/data/elementary/themes/edc/efl/spin.edc b/data/elementary/themes/edc/efl/spin.edc
index a794080dae..d16d15e8ce 100644
--- a/data/elementary/themes/edc/efl/spin.edc
+++ b/data/elementary/themes/edc/efl/spin.edc
@@ -6,7 +6,7 @@ group { "efl/spin";
color: 0 0 0 0;
}
}
- text { "elm.text";
+ text { "efl.text";
nomouse;
scale;
desc { "default";
diff --git a/data/elementary/themes/edc/efl/spin_button.edc b/data/elementary/themes/edc/efl/spin_button.edc
index 40e9492a2e..4cb7783f1f 100644
--- a/data/elementary/themes/edc/efl/spin_button.edc
+++ b/data/elementary/themes/edc/efl/spin_button.edc
@@ -3,7 +3,7 @@ group { "efl/spin_button";
parts {
rect { "clip";
desc { "default";
- rel.to: "elm.swallow.text_button";
+ rel.to: "efl.text_button";
}
}
rect { "bg";
@@ -36,12 +36,12 @@ group { "efl/spin_button";
vis;
}
}
- swallow { "elm.swallow.entry";
+ swallow { "efl.entry";
clip: "clip";
desc { "default";
fixed: 1 1;
- rel1.to: "elm.swallow.text_button";
- rel2.to: "elm.swallow.text_button";
+ rel1.to: "efl.text_button";
+ rel2.to: "efl.text_button";
hid;
}
desc { "active";
@@ -49,7 +49,7 @@ group { "efl/spin_button";
vis;
}
}
- swallow { "elm.swallow.dec_button";
+ swallow { "efl.dec_button";
scale;
desc { "default";
fixed: 1 0;
@@ -63,7 +63,7 @@ group { "efl/spin_button";
aspect: 1.0 1.0; aspect_preference: VERTICAL;
}
}
- swallow { "elm.swallow.inc_button";
+ swallow { "efl.inc_button";
scale;
desc { "default";
fixed: 1 0;
@@ -77,16 +77,16 @@ group { "efl/spin_button";
aspect: 1.0 1.0; aspect_preference: VERTICAL;
}
}
- swallow { "elm.swallow.text_button";
+ swallow { "efl.text_button";
scale;
desc { "default";
vis;
rel1.to_y: "inset";
- rel1.to_x: "elm.swallow.dec_button";
+ rel1.to_x: "efl.dec_button";
rel1.relative: 1.0 0.0;
rel1.offset: 1 1;
rel2.to_y: "inset";
- rel2.to_x: "elm.swallow.inc_button";
+ rel2.to_x: "efl.inc_button";
rel2.relative: 0.0 1.0;
rel2.offset: -2 -2;
}
@@ -110,50 +110,50 @@ group { "efl/spin_button";
}
programs {
program { "entry_active";
- signal: "elm,state,entry,active";
- source: "elm";
+ signal: "efl,state,entry,active";
+ source: "efl";
action: STATE_SET "active";
- target: "elm.swallow.entry";
+ target: "efl.entry";
}
program { "entry_inactive";
- signal: "elm,state,entry,inactive";
- source: "elm";
+ signal: "efl,state,entry,inactive";
+ source: "efl";
action: STATE_SET "default";
- target: "elm.swallow.entry";
+ target: "efl.entry";
}
program { "text_button_active";
- signal: "elm,state,button,active";
- source: "elm";
+ signal: "efl,state,button,active";
+ source: "efl";
action: STATE_SET "default";
- target: "elm.swallow.text_button";
+ target: "efl.text_button";
}
program { "text_button_inactive";
- signal: "elm,state,button,inactive";
- source: "elm";
+ signal: "efl,state,button,inactive";
+ source: "efl";
action: STATE_SET "inactive";
- target: "elm.swallow.text_button";
+ target: "efl.text_button";
}
program { "access_activate";
- signal: "elm,state,access,active";
- source: "elm";
+ signal: "efl,state,access,active";
+ source: "efl";
action: STATE_SET "active";
target: "access";
}
program { "access_inactivate";
- signal: "elm,state,access,inactive";
- source: "elm";
+ signal: "efl,state,access,inactive";
+ source: "efl";
action: STATE_SET "default";
target: "access";
}
program { "disable";
- signal: "elm,state,disabled";
- source: "elm";
+ signal: "efl,state,disabled";
+ source: "efl";
action: STATE_SET "disabled";
target: "disabler";
}
program { "enable";
- signal: "elm,state,enabled";
- source: "elm";
+ signal: "efl,state,enabled";
+ source: "efl";
action: STATE_SET "default";
target: "disabler";
}
@@ -163,7 +163,7 @@ group { "efl/spin_button";
group { "efl/spin_button:vertical";
inherit: "efl/spin_button";
parts {
- swallow { "elm.swallow.inc_button";
+ swallow { "efl.inc_button";
scale;
desc { "default";
rel1.to: "inset";
@@ -174,16 +174,16 @@ group { "efl/spin_button:vertical";
align: 1.0 0.5;
}
}
- swallow { "elm.swallow.text_button";
+ swallow { "efl.text_button";
scale;
desc { "default";
vis;
rel1.to_y: "inset";
- rel1.to_x: "elm.swallow.dec_button";
+ rel1.to_x: "efl.dec_button";
rel1.relative: 1.0 0.0;
rel1.offset: 1 1;
rel2.to_y: "inset";
- rel2.to_x: "elm.swallow.inc_button";
+ rel2.to_x: "efl.inc_button";
rel2.relative: 0.0 1.0;
rel2.offset: -2 -2;
}
@@ -192,7 +192,7 @@ group { "efl/spin_button:vertical";
hid;
}
}
- swallow { "elm.swallow.dec_button";
+ swallow { "efl.dec_button";
scale;
desc { "default";
rel1.to: "inset";
@@ -207,22 +207,307 @@ group { "efl/spin_button:vertical";
}
group { "efl/spin_button/inc_button";
- inherit: "elm/button/base/spinner/increase/default";
+ images.image: "sym_right_light_normal.png" COMP;
+ images.image: "sym_right_glow_normal.png" COMP;
+ images.image: "sym_right_dark_normal.png" COMP;
+ script {
+ public mouse_down = 0;
+ public multi_down = 0;
+ }
+ parts {
+ part { name: "arrow.image";
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 15 15;
+ max: 15 15;
+ color_class: "F032L1";
+ image.normal: "sym_right_light_normal.png";
+ }
+ description { state: "pressed" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "sym_right_glow_normal.png";
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "sym_right_dark_normal.png";
+ }
+ }
+ part { name: "over";
+ type: RECT;
+ repeat_events: 1;
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ }
+ }
+ part { name: "disabler";
+ type: RECT;
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ visible: 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ }
+ programs {
+ program { name: "button_press";
+ signal: "mouse,down,1";
+ source: "over";
+ script {
+ if ((get_int(multi_down) == 0) &&
+ (get_int(mouse_down) == 0)) {
+ set_int(mouse_down, 1);
+ run_program(PROGRAM:"button_press2");
+ }
+ }
+ }
+ program { name: "button_press2";
+ action: SIGNAL_EMIT "efl,action,press" "";
+ after: "button_press_anim";
+ }
+ program { name: "button_press_anim";
+ action: STATE_SET "pressed" 0.0;
+ target: "arrow.image";
+ }
+ program { name: "button_unpress";
+ signal: "mouse,up,1";
+ source: "over";
+ script {
+ if (get_int(mouse_down) == 1) {
+ set_int(mouse_down, 0);
+ run_program(PROGRAM:"button_unpress2");
+ run_program(PROGRAM:"button_unpress_anim");
+ }
+ }
+ }
+ program { name: "button_unpress2";
+ action: SIGNAL_EMIT "efl,action,unpress" "";
+ }
+ program { name: "button_unpress_anim";
+ action: STATE_SET "default" 0.0;
+ target: "arrow.image";
+ }
+ program { name: "button_click";
+ signal: "mouse,clicked,1";
+ source: "over";
+ script {
+ if (get_int(multi_down) == 0) {
+ run_program(PROGRAM:"button_click2");
+ }
+ }
+ }
+ program { name: "action_unpressed";
+ signal: "efl,action,unpressed";
+ source: "efl";
+ after: "button_unpress_anim";
+ }
+ program { name: "action_pressed";
+ signal: "efl,action,pressed";
+ source: "efl";
+ after: "button_press_anim";
+ }
+ program { name: "button_click2";
+ action: SIGNAL_EMIT "efl,action,click" "";
+ }
+ program { name: "access_pressed";
+ signal: "efl,action,anim,activate";
+ source: "efl";
+ action: STATE_SET "pressed" 0.0;
+ target: "arrow.image";
+ after: "access_pressed_anim";
+ }
+ program { name: "access_pressed_anim";
+ action: STATE_SET "default" 0.0;
+ transition: DECELERATE 0.1;
+ target: "arrow.image";
+ }
+ program { name: "disable";
+ signal: "efl,state,disabled";
+ source: "efl";
+ action: STATE_SET "disabled" 0.0;
+ target: "arrow.image";
+ target: "disabler";
+ }
+ program { name: "enable";
+ signal: "efl,state,enabled";
+ source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "arrow.image";
+ target: "disabler";
+ }
+ program {
+ name: "multi_down";
+ signal: "efl,action,multi,down";
+ source: "efl";
+ script {
+ set_int(multi_down, 1);
+ }
+ }
+ program {
+ name: "multi_up";
+ signal: "efl,action,multi,up";
+ source: "efl";
+ script {
+ set_int(multi_down, 0);
+ }
+ }
+ }
+}
+
+group { "efl/spin_button/entry";
+ inherit: "efl/text";
}
group { "efl/spin_button/dec_button";
- inherit: "elm/button/base/spinner/decrease/default";
+ inherit: "efl/spin_button/inc_button";
+ images.image: "sym_left_light_normal.png" COMP;
+ images.image: "sym_left_glow_normal.png" COMP;
+ images.image: "sym_left_dark_normal.png" COMP;
+ parts {
+ part { name: "arrow.image";
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 15 15;
+ max: 15 15;
+ image.normal: "sym_left_light_normal.png";
+ }
+ description { state: "pressed" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "sym_left_glow_normal.png";
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "sym_left_dark_normal.png";
+ }
+ }
+ }
}
group { "efl/spin_button/text_button";
- inherit: "elm/button/base/spinner/default";
alias: "efl/spin_button/text_button:vertical";
+ parts {
+ part { name: "bg";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ }
+ }
+ part { name: "efl.text";
+ type: TEXT;
+ scale: 1;
+ effect: SHADOW BOTTOM;
+ description { state: "default" 0.0;
+ color: FN_COL_DEFAULT;
+ color_class: "spinner";
+ rel1.to: "bg";
+ rel2.to: "bg";
+ text { font: FN; size: 10;
+ min: 1 1;
+ text_class: "spinner";
+ ellipsis: -1;
+ }
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0 ;
+ color: FN_COL_DISABLE;
+ color_class: "spinner_disabled";
+ }
+ }
+ part { name: "over";
+ type: RECT;
+ repeat_events: 1;
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ }
+ }
+ part { name: "disabler";
+ type: RECT;
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ visible: 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ }
+ programs {
+ program { name: "button_click";
+ signal: "mouse,clicked,1";
+ source: "over";
+ script {
+ run_program(PROGRAM:"button_click2");
+ }
+ }
+ program { name: "button_click2";
+ action: SIGNAL_EMIT "efl,action,click" "";
+ }
+ program { name: "disable";
+ signal: "efl,state,disabled";
+ source: "efl";
+ action: STATE_SET "disabled" 0.0;
+ target: "disabler";
+ target: "efl.text";
+ }
+ program { name: "enable";
+ signal: "efl,state,enabled";
+ source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "disabler";
+ target: "efl.text";
+ }
+ }
}
group { "efl/spin_button/inc_button:vertical";
- inherit: "elm/button/base/spinner/increase/vertical";
+ inherit: "efl/spin_button/inc_button";
+ images.image: "sym_up_light_normal.png" COMP;
+ images.image: "sym_up_glow_normal.png" COMP;
+ images.image: "sym_up_dark_normal.png" COMP;
+ parts {
+ part { name: "arrow.image";
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 15 15;
+ max: 15 15;
+ image.normal: "sym_up_light_normal.png";
+ }
+ description { state: "pressed" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "sym_up_glow_normal.png";
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "sym_up_dark_normal.png";
+ }
+ }
+ }
}
group { "efl/spin_button/dec_button:vertical";
- inherit: "elm/button/base/spinner/decrease/vertical";
-} \ No newline at end of file
+ inherit: "efl/spin_button/dec_button";
+ images.image: "sym_down_light_normal.png" COMP;
+ images.image: "sym_down_glow_normal.png" COMP;
+ images.image: "sym_down_dark_normal.png" COMP;
+ parts {
+ part { name: "arrow.image";
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 15 15;
+ max: 15 15;
+ image.normal: "sym_down_light_normal.png";
+ }
+ description { state: "pressed" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "sym_down_glow_normal.png";
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "sym_down_dark_normal.png";
+ }
+ }
+ }
+}
diff --git a/data/elementary/themes/edc/efl/tab_bar.edc b/data/elementary/themes/edc/efl/tab_bar.edc
new file mode 100644
index 0000000000..f7f039cb79
--- /dev/null
+++ b/data/elementary/themes/edc/efl/tab_bar.edc
@@ -0,0 +1,596 @@
+group { "efl/tab_bar";
+ images.image: "vgrad_med_lighter.png" COMP;
+ images.image: "bevel_out.png" COMP;
+ images.image: "shine.png" COMP;
+ images.image: "shadow_square_tiny.png" COMP;
+ parts {
+ spacer { "base";
+ scale;
+ desc { "default";
+ }
+ }
+ image { "shadow";
+ nomouse;
+ desc { "default";
+ rel.to: "base";
+ rel1.offset: -3 -2;
+ rel2.offset: 2 3;
+ image.normal: "shadow_square_tiny.png";
+ image.border: 6 6 6 6;
+ fill.smooth: 0;
+ }
+ }
+ image { "bg";
+ desc { "default";
+ rel.to: "base";
+ image.normal: "vgrad_med_lighter.png";
+ rel1.offset: 0 0;
+ rel2.offset: -1 -1;
+ fill.smooth: 0;
+ }
+ }
+ swallow { "efl.content";
+ scale;
+ desc { "default";
+ rel.to: "base";
+ }
+ }
+ image { "bevel";
+ nomouse;
+ desc { "default";
+ rel.to: "base";
+ image.normal: "bevel_out.png";
+ image.border: 1 1 1 1;
+ image.middle: 0;
+ fill.smooth: 0;
+ }
+ }
+ image { "shine";
+ nomouse;
+ desc { "default";
+ image.normal: "shine.png";
+ rel.to: "base";
+ rel1.offset: 0 -2;
+ rel2.relative: 1.0 0.0;
+ rel2.offset: -1 2;
+ FIXED_SIZE(69, 5)
+ }
+ }
+ }
+}
+
+group { "efl/tab_bar/tab";
+ images.image: "shadow_inset_bevels.png" COMP;
+ images.image: "shadow_angled_in_sides.png" COMP;
+ images.image: "horizontal_separated_bar_small_glow.png" COMP;
+ data.item: "transition_animation_on" "1";
+ images.image: "bevel_dark_in.png" COMP;
+
+#define ICON 1
+#define LABEL 2
+#define MASK 3
+#define DISABLE 4
+ script {
+ public btmode;
+ public eval_mode(m) {
+ new m1 = m & MASK;
+ new d = m & DISABLE;
+ if (m1 == (ICON | LABEL)) {
+ if (!d) {
+ set_state(PART:"efl.icon", "default", 0.0);
+ set_state(PART:"icon_clip", "default", 0.0);
+ set_state(PART:"efl.text", "default", 0.0);
+ set_state(PART:"label2", "default", 0.0);
+ } else {
+ set_state(PART:"efl.icon", "default", 0.0);
+ set_state(PART:"icon_clip", "disabled", 0.0);
+ set_state(PART:"efl.text", "disabled", 0.0);
+ set_state(PART:"label2", "default", 0.0);
+ }
+ } else if (m1 == (ICON)) {
+ if (!d) {
+ set_state(PART:"efl.icon", "icononly", 0.0);
+ set_state(PART:"icon_clip", "default", 0.0);
+ set_state(PART:"efl.text", "icononly", 0.0);
+ set_state(PART:"label2", "icononly", 0.0);
+ } else {
+ set_state(PART:"efl.icon", "icononly", 0.0);
+ set_state(PART:"icon_clip", "disabled", 0.0);
+ set_state(PART:"efl.text", "icononly", 0.0);
+ set_state(PART:"label2", "icononly", 0.0);
+ }
+ } else if (m1 == (LABEL)) {
+ if (!d) {
+ set_state(PART:"efl.icon", "noicon", 0.0);
+ set_state(PART:"icon_clip", "default", 0.0);
+ set_state(PART:"efl.text", "noicon", 0.0);
+ set_state(PART:"label2", "noicon", 0.0);
+ } else {
+ set_state(PART:"efl.icon", "noicon", 0.0);
+ set_state(PART:"icon_clip", "disabled", 0.0);
+ set_state(PART:"efl.text", "noicon_disabled", 0.0);
+ set_state(PART:"label2", "noicon_disabled", 0.0);
+ }
+ } else {
+ if (!d) {
+ set_state(PART:"efl.icon", "noicon", 0.0);
+ set_state(PART:"icon_clip", "default", 0.0);
+ set_state(PART:"efl.text", "noicon", 0.0);
+ set_state(PART:"label2", "noicon", 0.0);
+ } else {
+ set_state(PART:"efl.icon", "noicon", 0.0);
+ set_state(PART:"icon_clip", "disabled", 0.0);
+ set_state(PART:"efl.text", "noicon_disabled", 0.0);
+ set_state(PART:"label2", "noicon_disabled", 0.0);
+ }
+ }
+ }
+ }
+ parts {
+ spacer { "base";
+ scale;
+ desc { "default";
+ }
+ desc { "vert";
+ rel1.offset: -1 0;
+ rel2.offset: 0 -1;
+ }
+ }
+ image { "shadow1";
+ nomouse;
+ desc { "default";
+ rel.to: "base";
+ image.normal: "shadow_inset_bevels.png";
+ image.border: 2 2 0 1;
+ hid;
+ }
+ desc { "selected";
+ inherit: "default";
+ vis;
+ }
+ }
+ image { "shadow2";
+ nomouse;
+ desc { "default";
+ rel.to: "shadow1";
+ rel1.offset: 1 0;
+ rel2.offset: -2 -1;
+ image.normal: "shadow_angled_in_sides.png";
+ image.border: 8 8 0 1;
+ image.middle: 0;
+ hid;
+ }
+ desc { "selected";
+ inherit: "default";
+ vis;
+ }
+ }
+ rect { "bend_clip";
+ desc { "default";
+ hid;
+ }
+ desc { "vert";
+ vis;
+ }
+ }
+ image { "bend";
+ clip_to: "bend_clip";
+ desc { "default";
+ min: 2 2;
+ max: 99999 2;
+ rel2.offset: -1 1;
+ rel2.relative: 1.0 0.0;
+ image.normal: "bevel_dark_in.png";
+ image.border: 2 2 2 2;
+ fill.smooth: 0;
+ hid;
+ fixed: 1 1;
+ }
+ desc { "selected";
+ inherit: "default";
+ vis;
+ }
+ }
+ rect { "icon_clip";
+ desc { "default";
+ }
+ desc { "disabled";
+ inherit: "default";
+ color: 255 255 255 64;
+ }
+ }
+ rect { "icon_clip1";
+ clip_to: "icon_clip";
+ desc { "default";
+ color: 255 255 255 255;
+ vis;
+ }
+ desc { "animation";
+ inherit: "default";
+ color: 255 255 255 0;
+ hid;
+ }
+ }
+ swallow { "efl.icon";
+ clip_to: "icon_clip1";
+ desc { "default";
+ align: 0.5 0.5;
+ rel1.relative: 0.0 0.0;
+ rel1.offset: 2 2;
+ rel2.to_y: "efl.text";
+ rel2.relative: 1.0 0.0;
+ rel2.offset: -3 -1;
+ }
+ desc { "noicon";
+ inherit: "default" 0.0;
+ hid;
+ rel1.offset: 2 0;
+ rel2.relative: 1.0 0.0;
+ rel2.offset: -3 -4;
+ }
+ desc { "icononly";
+ inherit: "default" 0.0;
+ vis;
+ rel2.relative: 1.0 1.0;
+ rel2.offset: -3 -3;
+ rel2.to_y: "icon_clip";
+ }
+ }
+ rect { "icon_clip2";
+ clip_to: "icon_clip";
+ desc { "default";
+ color: 255 255 255 0;
+ hid;
+ }
+ desc { "animation";
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ vis;
+ }
+ }
+ swallow { "efl.icon_new";
+ clip_to: "icon_clip2";
+ desc { "default";
+ align: 0.5 0.5;
+ rel1.relative: 0.0 0.0;
+ rel1.offset: 2 2;
+ rel2.to_y: "efl.text";
+ rel2.relative: 1.0 0.0;
+ rel2.offset: -3 -1;
+ }
+ desc { "noicon";
+ inherit: "default";
+ hid;
+ rel1.offset: 2 0;
+ rel2.relative: 1.0 0.0;
+ rel2.offset: -3 -4;
+ }
+ desc { "icononly";
+ inherit: "default" 0.0;
+ vis;
+ rel2.relative: 1.0 1.0;
+ rel2.offset: -3 -3;
+ rel2.to_y: "icon_clip";
+ }
+ }
+ rect { "text_clip1";
+ desc { "default";
+ color: 255 255 255 255;
+ vis;
+ }
+ desc { "animation";
+ inherit: "default";
+ color: 255 255 255 0;
+ hid;
+ }
+ }
+ text { "efl.text";
+ nomouse;
+ effect: SHADOW BOTTOM;
+ scale;
+ clip_to: "text_clip1";
+ desc { "default";
+ rel1.offset: 4 -3;
+ rel1.relative: 0.0 1.0;
+ rel2.offset: -5 -3;
+ align: 0.5 1.0;
+ color: FN_COL_DEFAULT;
+ color_class: "toolbar_item";
+ text { font: FN; size: 10;
+ min: 1 1;
+ ellipsis: -1;
+ align: 0.5 0.5;
+ text_class: "toolbar_item";
+ }
+ fixed: 0 1;
+ }
+ desc { "selected";
+ inherit: "default";
+ hid;
+ color_class: "toolbar_item_selected";
+ }
+ desc { "disabled";
+ inherit: "default";
+ color: FN_COL_DISABLE;
+ color_class: "toolbar_item_disabled";
+ }
+ desc { "noicon";
+ inherit: "default";
+ rel1.offset: 4 2;
+ rel1.relative: 0.0 0.0;
+ }
+ desc { "noicon_disabled";
+ inherit: "noicon";
+ color: FN_COL_DISABLE;
+ color_class: "toolbar_item_disabled";
+ }
+ desc { "icononly";
+ inherit: "default";
+ text.min: 0 0;
+ hid;
+ fixed: 1 1;
+ }
+ }
+ text { "label2";
+ nomouse;
+ effect: GLOW;
+ scale;
+ clip_to: "text_clip1";
+ desc { "default";
+ rel1.offset: -3 -3;
+ rel1.to: "efl.text";
+ rel2.offset: 2 1;
+ rel2.to: "efl.text";
+ color: FN_COL_HIGHLIGHT;
+ color_class: "toolbar_item_active";
+ text { font: FN; size: 10;
+ text_source: "efl.text";
+ align: 0.5 0.5;
+ text_class: "toolbar_item";
+ }
+ hid;
+ }
+ desc { "selected";
+ inherit: "default";
+ vis;
+ }
+ desc { "noicon";
+ inherit: "default";
+ }
+ desc { "noicon_disabled";
+ inherit: "noicon";
+ }
+ desc { "icononly";
+ inherit: "default";
+ text.min: 0 0;
+ hid;
+ fixed: 1 1;
+ }
+ }
+ rect { "text_clip2";
+ desc { "default";
+ color: 255 255 255 0;
+ hid;
+ }
+ desc { "animation";
+ inherit: "default";
+ color: 255 255 255 255;
+ vis;
+ }
+ }
+ image { "bar";
+ nomouse;
+ desc { "default";
+ fixed: 0 1;
+ rel1.offset: -3 -7;
+ rel1.relative: 0.0 1.0;
+ rel1.to: "shadow2";
+ rel2.offset: 2 2;
+ rel2.to: "shadow2";
+ image.normal: "horizontal_separated_bar_small_glow.png";
+ image.border: 4 4 4 4;
+ fill.smooth: 0;
+ hid;
+ }
+ desc { "selected";
+ inherit: "default";
+ vis;
+ }
+ }
+ image { "highlight";
+ nomouse;
+ desc { "default";
+ fixed: 0 1;
+ rel1.offset: -3 -7;
+ rel1.relative: 0.0 1.0;
+ rel1.to: "shadow2";
+ rel2.offset: 2 2;
+ rel2.to: "shadow2";
+ image.normal: "horizontal_separated_bar_small_glow.png";
+ image.border: 4 4 4 4;
+ fill.smooth: 0;
+ hid;
+ }
+ desc { "selected";
+ inherit: "default";
+ vis;
+ }
+ }
+ rect { "event";
+ ignore_flags: ON_HOLD;
+ desc { "default";
+ color: 0 0 0 0;
+ }
+ }
+ programs {
+ program {
+ signal: "efl,orient,horizontal"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "base";
+ target: "bend_clip";
+ }
+ program {
+ signal: "efl,orient,vertical"; source: "efl";
+ action: STATE_SET "vert" 0.0;
+ target: "base";
+ target: "bend_clip";
+ }
+ program { name: "st0";
+ signal: "load"; source: "";
+ script {
+ set_int(btmode, LABEL | ICON);
+ }
+ }
+ program {
+ signal: "efl,state,selected"; source: "efl";
+ action: STATE_SET "selected" 0.0;
+ target: "efl.text";
+ target: "label2";
+ target: "shadow1";
+ target: "shadow2";
+ target: "bar";
+ target: "bend";
+ }
+ program {
+ signal: "efl,state,unselected"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "efl.text";
+ target: "label2";
+ target: "shadow1";
+ target: "shadow2";
+ target: "bar";
+ target: "bend";
+ }
+ program {
+ signal: "mouse,up,1"; source: "event";
+ action: SIGNAL_EMIT "efl,action,click" "efl";
+ }
+ program {
+ signal: "efl,highlight,on"; source: "efl";
+ action: STATE_SET "selected" 0.0;
+ target: "highlight";
+ }
+ program {
+ signal: "efl,highlight,off"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "highlight";
+ }
+ program {
+ signal: "mouse,in"; source: "event";
+ action: SIGNAL_EMIT "efl,mouse,in" "efl";
+ }
+ program { name: "mouse,out";
+ signal: "mouse,out"; source: "event";
+ action: SIGNAL_EMIT "efl,mouse,out" "efl";
+ }
+ program { name: "st1";
+ signal: "efl,text,hidden"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m &= ~LABEL; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "st2";
+ signal: "efl,text,visible"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m |= LABEL; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "st3";
+ signal: "efl,icon,hidden"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m &= ~ICON; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "st4";
+ signal: "efl,icon,visible"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m |= ICON; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "st5";
+ signal: "efl,state,disabled"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m |= DISABLE; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program { name: "st6";
+ signal: "efl,state,enabled"; source: "efl";
+ script {
+ new m = get_int(btmode);
+ m &= ~DISABLE; set_int(btmode, m);
+ eval_mode(m);
+ }
+ }
+ program {
+ signal: "efl,state,moving"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "shadow1";
+ target: "shadow2";
+ }
+ program {
+ signal: "efl,state,icon_set,forward"; source: "efl";
+ after: "icon_set,animation";
+ }
+ program {
+ signal: "efl,state,icon_set,backward"; source: "efl";
+ after: "icon_set,animation";
+ }
+ program { name: "icon_set,animation";
+ signal: "efl,state,icon_set"; source: "efl";
+ action: STATE_SET "animation" 0.0;
+ target: "icon_clip1";
+ target: "icon_clip2";
+ transition: LINEAR 0.2;
+ after: "icon_set,animation,done";
+ }
+ program { name: "icon_set,animation,done";
+ action: SIGNAL_EMIT "efl,state,icon_set,done" "efl";
+ }
+ program {
+ signal: "efl,state,icon,reset"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "icon_clip1";
+ target: "icon_clip2";
+ }
+ program {
+ signal: "efl,state,label_set,forward"; source: "efl";
+ after: "label_set,animation";
+ }
+ program {
+ signal: "efl,state,label_set,backward"; source: "efl";
+ after: "label_set,animation";
+ }
+ program { name: "label_set,animation";
+ signal: "efl,state,label_set"; source: "efl";
+ action: STATE_SET "animation" 0.0;
+ target: "text_clip1";
+ target: "text_clip2";
+ transition: LINEAR 0.2;
+ after: "label_set,animation,done";
+ }
+ program { name: "label_set,animation,done";
+ action: SIGNAL_EMIT "efl,state,label_set,done" "efl";
+ }
+ program {
+ signal: "efl,state,label,reset"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ target: "text_clip1";
+ target: "text_clip2";
+ }
+ }
+#undef ICON
+#undef LABEL
+#undef MASK
+#undef DISABLE
+ }
+}
diff --git a/data/elementary/themes/edc/efl/tab_page.edc b/data/elementary/themes/edc/efl/tab_page.edc
new file mode 100644
index 0000000000..68bbd6b55c
--- /dev/null
+++ b/data/elementary/themes/edc/efl/tab_page.edc
@@ -0,0 +1,15 @@
+group { "efl/tab_page";
+ parts {
+ spacer { "base";
+ scale;
+ desc { "default";
+ }
+ }
+ swallow { "efl.content";
+ scale;
+ desc { "default";
+ rel.to: "base";
+ }
+ }
+ }
+}
diff --git a/data/elementary/themes/edc/efl/tab_pager.edc b/data/elementary/themes/edc/efl/tab_pager.edc
new file mode 100644
index 0000000000..fb63e58a61
--- /dev/null
+++ b/data/elementary/themes/edc/efl/tab_pager.edc
@@ -0,0 +1,34 @@
+group { "efl/tab_pager";
+ parts {
+ spacer { "base";
+ scale;
+ desc { "default";
+ }
+ }
+ swallow { "efl.tab_root";
+ scale;
+ desc { "default";
+ rel.to: "base";
+ align: 0 0;
+ min: 0 50;
+ max: -1 50;
+ fixed: 0 1;
+ }
+ }
+ swallow { "efl.page_root";
+ scale;
+ desc { "default";
+ rel1.to: "efl.tab_root";
+ rel2.to: "base";
+ rel1.relative: 0 1;
+ }
+ }
+ swallow { "efl.event";
+ scale;
+ repeat_events: 1;
+ desc { "default";
+ rel.to: "efl.page_root";
+ }
+ }
+ }
+}
diff --git a/data/elementary/themes/edc/efl/multibuttonentry.edc b/data/elementary/themes/edc/efl/tags.edc
index 5996a6c8a0..9c9b7352d8 100644
--- a/data/elementary/themes/edc/efl/multibuttonentry.edc
+++ b/data/elementary/themes/edc/efl/tags.edc
@@ -1,4 +1,4 @@
-group { "efl/multibuttonentry";
+group { "efl/tags";
data.item: "horizontal_pad" 0;
data.item: "vertical_pad" 0;
data.item: "closed_height" 0;
@@ -6,16 +6,16 @@ group { "efl/multibuttonentry";
rect { "bg";
scale;
desc { "default";
- color_class: "multibuttonentry_bg";
+ color_class: "tags_bg";
}
}
- swallow { "elm.swallow.background";
+ swallow { "efl.background";
scale;
desc { "default";
rel.to: "bg";
}
}
- swallow { "box.swallow";
+ swallow { "efl.box";
desc { "default";
rel.to: "bg";
}
@@ -23,20 +23,20 @@ group { "efl/multibuttonentry";
}
}
-group { "efl/multibuttonentry/label";
+group { "efl/tags/label";
parts {
- text { "elm.text";
+ text { "efl.text";
nomouse;
effect: GLOW;
scale;
desc { "default";
color: FN_COL_HIGHLIGHT;
- color_class: "multibuttonentry_label";
+ color_class: "tags_label";
text { font: FNBD; size: 10;
min: 1 1;
ellipsis: -1;
align: 0.5 0.5;
- text_class: "multibuttonentry_label";
+ text_class: "tags_label";
}
rel1.offset: 2 2;
rel2.offset: -5 -5;
@@ -45,33 +45,15 @@ group { "efl/multibuttonentry/label";
}
}
-group { "efl/multibuttonentry/guidetext";
- parts {
- text { "elm.text";
- scale;
- effect: SHADOW BOTTOM;
- desc { "default";
- rel1.offset: 2 2;
- rel2.offset: -4 -4;
- color: FN_COL_DISABLE;
- text { font: FNBD; size: 10;
- min: 0 1;
- align: 0.0 0.5;
- }
- }
- }
- }
-}
-
-group { "efl/multibuttonentry/btn";
+group { "efl/tags/btn";
images.image: "button_normal.png" COMP;
images.image: "button_clicked.png" COMP;
images.image: "sym_close_dark_normal.png" COMP;
images.image: "sym_close_dark_selected.png" COMP;
images.image: "win_glow.png" COMP;
styles {
- style { name: "efl_multibuttonentry_textblock_style";
- base: "font="FN" align=0.5 font_size=10 color=#ffffffff style=shadow,bottom shadow_color=#00000080 text_class=multibuttonentry_item ellipsis=1.0";
+ style { name: "efl_tags_textblock_style";
+ base: "font="FN" align=0.5 font_size=10 color=#ffffffff style=shadow,bottom shadow_color=#00000080 text_class=tags_item ellipsis=1.0";
tag: "br" "\n";
tag: "ps" "ps";
tag: "hilight" "+ font="FNBD;
@@ -87,10 +69,10 @@ group { "efl/multibuttonentry/btn";
parts {
rect { "bg";
desc { "default";
- color_class: "multibuttonentry_item_bg";
+ color_class: "tags_item_bg";
}
desc { "pressed";
- color_class: "multibuttonentry_item_bg_selected";
+ color_class: "tags_item_bg_selected";
}
}
image { "base";
@@ -161,15 +143,15 @@ group { "efl/multibuttonentry/btn";
color: 0 0 0 0;
}
}
- textblock { "elm.btn.text";
+ textblock { "efl.btn.text";
nomouse;
scale;
desc { "default";
- color_class: "multibuttonentry_item_text";
- text { style: "efl_multibuttonentry_textblock_style";
+ color_class: "tags_item_text";
+ text { style: "efl_tags_textblock_style";
min: 1 1;
ellipsis: -1;
- text_class: "multibuttonentry_item_text";
+ text_class: "tags_item_text";
}
hid;
rel1.offset: 5 5;
@@ -184,12 +166,12 @@ group { "efl/multibuttonentry/btn";
nomouse;
scale;
desc { "default";
- color_class: "multibuttonentry_item_text";
- text { style: "efl_multibuttonentry_textblock_style";
- text_source: "elm.btn.text";
+ color_class: "tags_item_text";
+ text { style: "efl_tags_textblock_style";
+ text_source: "efl.btn.text";
min: 0 1;
align: 0.0 0.5;
- text_class: "multibuttonentry_item_text";
+ text_class: "tags_item_text";
}
align: 0.0 0.5;
rel1.offset: 5 5;
@@ -201,16 +183,16 @@ group { "efl/multibuttonentry/btn";
}
desc { "pressed";
inherit: "default";
- color_class: "multibuttonentry_item_text_pressed";
+ color_class: "tags_item_text_pressed";
text {
- text_class: "multibuttonentry_item_text_pressed";
+ text_class: "tags_item_text_pressed";
}
}
desc { "disabled";
inherit: "default";
- color_class: "multibuttonentry_item_text_disabled";
+ color_class: "tags_item_text_disabled";
text {
- text_class: "multibuttonentry_item_text_disabled";
+ text_class: "tags_item_text_disabled";
}
}
}
@@ -226,28 +208,28 @@ group { "efl/multibuttonentry/btn";
}
}
program {
- signal: "elm,state,default";
- source: "elm";
+ signal: "efl,state,default";
+ source: "efl";
action: STATE_SET "default";
target: "glow";
}
program {
- signal: "elm,state,focused";
- source: "elm";
+ signal: "efl,state,focused";
+ source: "efl";
action: STATE_SET "focused";
target: "glow";
}
program {
- signal: "elm,state,enabled";
- source: "elm";
+ signal: "efl,state,enabled";
+ source: "efl";
script {
set_state(PART:"text", "default", 0.0);
set_int(disabled , 0);
}
}
program {
- signal: "elm,state,disabled";
- source: "elm";
+ signal: "efl,state,disabled";
+ source: "efl";
script {
new st[31];
new Float: vl;
@@ -259,8 +241,8 @@ group { "efl/multibuttonentry/btn";
}
}
program {
- signal: "elm,state,unfocused";
- source: "elm";
+ signal: "efl,state,unfocused";
+ source: "efl";
action: STATE_SET "unfocused";
target: "glow";
}
@@ -289,7 +271,7 @@ group { "efl/multibuttonentry/btn";
program {
signal: "mouse,clicked,1";
source: "del";
- action: SIGNAL_EMIT "elm,deleted" "elm";
+ action: SIGNAL_EMIT "efl,deleted" "efl";
}
program {
signal: "mouse,down,1";
@@ -306,35 +288,23 @@ group { "efl/multibuttonentry/btn";
}
}
-group { "efl/multibuttonentry/closedbutton";
- styles {
- style { name: "textblock_style_efl_multibuttonentry_default";
- base: "font="FNBD" font_size=10 text_class=multibuttonentry_closed style=glow color=#3399ffff glow_color=#3399ff18 align=center glow2_color=#3399ff12 wrap=char";
- tag: "br" "\n";
- tag: "ps" "ps";
- tag: "hilight" "+ font="FNBD;
- tag: "b" "+ font="FNBD;
- tag: "tab" "\t";
- }
- }
+group { "efl/tags/number";
parts {
- rect { "bg";
- desc { "default";
- color: 0 0 0 0;
- }
- }
- textblock { "elm.text";
+ text { "efl.text";
nomouse;
+ effect: GLOW;
scale;
desc { "default";
- rel1.offset: 2 2;
- rel1.to: "bg";
- rel2.offset: -3 -3;
- rel2.to: "bg";
- text { style: "textblock_style_multibuttonentry_default";
+ color: FN_COL_HIGHLIGHT;
+ color_class: "tags_number";
+ text { font: FNBD; size: 10;
min: 1 1;
ellipsis: -1;
+ align: 0.5 0.5;
+ text_class: "tags_number";
}
+ rel1.offset: 2 2;
+ rel2.offset: -5 -5;
}
}
}
diff --git a/data/elementary/themes/edc/efl/text.edc b/data/elementary/themes/edc/efl/text.edc
index 728c905399..61986b82f5 100644
--- a/data/elementary/themes/edc/efl/text.edc
+++ b/data/elementary/themes/edc/efl/text.edc
@@ -1,8 +1,9 @@
+
group { "efl/text/scroller";
- inherit: "elm/scroller/base/default";
+ inherit: "efl/scroller";
image: "bg_glow_in.png" COMP;
parts {
- part { name: "elm.swallow.background"; type: SWALLOW;
+ part { name: "efl.background"; type: SWALLOW;
clip_to: "clipper";
description { state: "default" 0.0;
rel1.offset: 1 1;
@@ -28,17 +29,17 @@ group { "efl/text/scroller";
color: DARK_GREY_BG_COLOR;
}
}
- part { name: "elm.swallow.content";
+ part { name: "efl.content"; type: SWALLOW;
description { state: "default" 0.0;
- rel1.to: "elm.swallow.icon";
+ rel1.to: "efl.icon";
rel1.relative: 1.0 0.0;
rel1.offset: 0 0;
- rel2.to: "elm.swallow.end";
+ rel2.to: "efl.end";
rel2.relative: 0.0 1.0;
rel2.offset: -1 -1;
}
}
- part { name: "elm.swallow.icon"; type: SWALLOW;
+ part { name: "efl.icon"; type: SWALLOW;
clip_to: "clipper";
description { state: "default" 0.0;
fixed: 1 1;
@@ -57,16 +58,16 @@ group { "efl/text/scroller";
}
}
program {
- signal: "elm,action,show,icon"; source: "elm";
+ signal: "efl,action,show,icon"; source: "efl";
action: STATE_SET "visible" 0.0;
- target: "elm.swallow.icon";
+ target: "efl.icon";
}
program {
- signal: "elm,action,hide,icon"; source: "elm";
+ signal: "efl,action,hide,icon"; source: "efl";
action: STATE_SET "default" 0.0;
- target: "elm.swallow.icon";
+ target: "efl.icon";
}
- part { name: "elm.swallow.end"; type: SWALLOW;
+ part { name: "efl.end"; type: SWALLOW;
clip_to: "clipper";
description { state: "default" 0.0;
fixed: 1 1;
@@ -85,14 +86,14 @@ group { "efl/text/scroller";
}
}
program {
- signal: "elm,action,show,end"; source: "elm";
+ signal: "efl,action,show,end"; source: "efl";
action: STATE_SET "visible" 0.0;
- target: "elm.swallow.end";
+ target: "efl.end";
}
program {
- signal: "elm,action,hide,end"; source: "elm";
+ signal: "efl,action,hide,end"; source: "efl";
action: STATE_SET "default" 0.0;
- target: "elm.swallow.end";
+ target: "efl.end";
}
part { name: "glow";
insert_after: "shadow";
@@ -118,7 +119,7 @@ group { "efl/text/scroller";
}
programs {
program {
- signal: "elm,action,focus_highlight,show"; source: "elm";
+ signal: "efl,action,focus_highlight,show"; source: "efl";
action: STATE_SET "focused" 0.0;
target: "glow";
after: "focus_in2";
@@ -129,26 +130,26 @@ group { "efl/text/scroller";
target: "glow";
}
program {
- signal: "elm,action,focus_highlight,hide"; source: "elm";
+ signal: "efl,action,focus_highlight,hide"; source: "efl";
action: STATE_SET "default" 0.0;
transition: DECELERATE 0.3;
target: "glow";
}
program { name: "validation_fail";
signal: "validation,default,fail";
- source: "elm";
+ source: "efl";
action: STATE_SET "fail" 0.0;
target: "validation_glow";
}
program { name: "validation_pass";
signal: "validation,default,pass";
- source: "elm";
+ source: "efl";
action: STATE_SET "pass" 0.0;
target: "validation_glow";
}
program { name: "validation_off";
signal: "validation,default";
- source: "elm";
+ source: "efl";
action: STATE_SET "default" 0.0;
target: "validation_glow";
}
@@ -182,7 +183,7 @@ group { "efl/text/single/scroller";
visible: 0;
}
}
- part { name: "elm.dragable.vbar"; type: RECT;
+ part { name: "efl.dragable.vbar"; type: RECT;
dragable.x: 0 0 0;
dragable.y: 1 1 0;
dragable.confine: "sb_vbar_base";
@@ -202,7 +203,7 @@ group { "efl/text/single/scroller";
visible: 0;
}
}
- part { name: "elm.dragable.hbar"; type: RECT;
+ part { name: "efl.dragable.hbar"; type: RECT;
dragable.x: 1 1 0;
dragable.y: 0 0 0;
dragable.confine: "sb_hbar_base";
@@ -217,35 +218,35 @@ group { "efl/text/single/scroller";
}
part { name: "bg"; type: RECT;
description { state: "default" 0.0;
- rel1.to: "elm.swallow.background";
- rel2.to: "elm.swallow.background";
+ rel1.to: "efl.background";
+ rel2.to: "efl.background";
color: DARK_GREY_BG_COLOR;
color_class: "scroller_bg";
}
}
part { name: "clipper"; type: RECT;
description { state: "default" 0.0;
- rel1.to: "elm.swallow.background";
- rel2.to: "elm.swallow.background";
+ rel1.to: "efl.background";
+ rel2.to: "efl.background";
}
}
- part { name: "elm.swallow.background"; type: SWALLOW;
+ part { name: "efl.background"; type: SWALLOW;
clip_to: "clipper";
description { state: "default" 0.0;
rel1.offset: 1 1;
rel2.offset: -2 -2;
}
}
- part { name: "elm.swallow.content"; type: SWALLOW;
+ part { name: "efl.content"; type: SWALLOW;
clip_to: "clipper";
description { state: "default" 0.0;
- rel1.to: "elm.swallow.icon";
+ rel1.to: "efl.icon";
rel1.relative: 1.0 0.0;
- rel2.to: "elm.swallow.end";
+ rel2.to: "efl.end";
rel2.relative: 0.0 1.0;
}
}
- part { name: "elm.swallow.icon"; type: SWALLOW;
+ part { name: "efl.icon"; type: SWALLOW;
clip_to: "clipper";
description { state: "default" 0.0;
fixed: 1 1;
@@ -262,16 +263,16 @@ group { "efl/text/single/scroller";
}
}
program {
- signal: "elm,action,show,icon"; source: "elm";
+ signal: "efl,action,show,icon"; source: "efl";
action: STATE_SET "visible" 0.0;
- target: "elm.swallow.icon";
+ target: "efl.icon";
}
program {
- signal: "elm,action,hide,icon"; source: "elm";
+ signal: "efl,action,hide,icon"; source: "efl";
action: STATE_SET "default" 0.0;
- target: "elm.swallow.icon";
+ target: "efl.icon";
}
- part { name: "elm.swallow.end"; type: SWALLOW;
+ part { name: "efl.end"; type: SWALLOW;
clip_to: "clipper";
description { state: "default" 0.0;
fixed: 1 1;
@@ -288,14 +289,14 @@ group { "efl/text/single/scroller";
}
}
program {
- signal: "elm,action,show,end"; source: "elm";
+ signal: "efl,action,show,end"; source: "efl";
action: STATE_SET "visible" 0.0;
- target: "elm.swallow.end";
+ target: "efl.end";
}
program {
- signal: "elm,action,hide,end"; source: "elm";
+ signal: "efl,action,hide,end"; source: "efl";
action: STATE_SET "default" 0.0;
- target: "elm.swallow.end";
+ target: "efl.end";
}
part { name: "inset"; mouse_events: 0;
description { state: "default" 0.0;
@@ -320,7 +321,7 @@ group { "efl/text/single/scroller";
color: 255 255 255 128;
}
}
- part { name: "elm.swallow.overlay"; type: SWALLOW;
+ part { name: "efl.overlay"; type: SWALLOW;
clip_to: "clipper";
description { state: "default" 0.0;
rel1.offset: 1 1;
@@ -350,7 +351,7 @@ group { "efl/text/single/scroller";
}
programs {
program {
- signal: "elm,action,focus_highlight,show"; source: "elm";
+ signal: "efl,action,focus_highlight,show"; source: "efl";
action: STATE_SET "focused" 0.0;
target: "glow";
after: "focus_in2";
@@ -361,26 +362,26 @@ group { "efl/text/single/scroller";
target: "glow";
}
program {
- signal: "elm,action,focus_highlight,hide"; source: "elm";
+ signal: "efl,action,focus_highlight,hide"; source: "efl";
action: STATE_SET "default" 0.0;
transition: DECELERATE 0.3;
target: "glow";
}
program { name: "validation_fail";
signal: "validation,default,fail";
- source: "elm";
+ source: "efl";
action: STATE_SET "fail" 0.0;
target: "validation_glow";
}
program { name: "validation_pass";
signal: "validation,default,pass";
- source: "elm";
+ source: "efl";
action: STATE_SET "pass" 0.0;
target: "validation_glow";
}
program { name: "validation_off";
signal: "validation,default";
- source: "elm";
+ source: "efl";
action: STATE_SET "default" 0.0;
target: "validation_glow";
}
@@ -422,22 +423,22 @@ group { "efl/text/cursor";
}
programs {
program {
- signal: "selection,changed"; source: "elm.text";
+ signal: "selection,changed"; source: "efl.text";
action: STATE_SET "hidden" 0.0;
target: "clipper";
}
program {
- signal: "selection,cleared"; source: "elm.text";
+ signal: "selection,cleared"; source: "efl.text";
action: STATE_SET "default" 0.0;
target: "clipper";
}
program {
- signal: "selection,reset"; source: "elm.text";
+ signal: "selection,reset"; source: "efl.text";
action: STATE_SET "default" 0.0;
target: "clipper";
}
program {
- signal: "elm,action,focus"; source: "elm";
+ signal: "efl,action,focus"; source: "efl";
action: ACTION_STOP;
target: "cursor_show";
target: "cursor_hide";
@@ -446,7 +447,7 @@ group { "efl/text/cursor";
after: "cursor_show";
}
program {
- signal: "elm,action,unfocus"; source: "elm";
+ signal: "efl,action,unfocus"; source: "efl";
action: ACTION_STOP;
target: "cursor_show";
target: "cursor_hide";
@@ -455,7 +456,7 @@ group { "efl/text/cursor";
after: "cursor_hide_stop";
}
program {
- signal: "elm,action,show,cursor"; source: "elm";
+ signal: "efl,action,show,cursor"; source: "efl";
action: ACTION_STOP;
target: "cursor_show";
target: "cursor_hide";
@@ -541,17 +542,17 @@ group { "efl/text";
}
}
parts {
- part { name: "elm.swallow.background"; type: SWALLOW;
+ part { name: "efl.background"; type: SWALLOW;
description { state: "default" 0.0;
rel1.offset: 1 1;
rel2.offset: -2 -2;
}
}
- part { name: "elm.guide"; type: TEXTBLOCK; mouse_events: 0;
+ part { name: "efl.guide"; type: TEXTBLOCK; mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
- rel1.to: "elm.text";
- rel2.to: "elm.text";
+ rel1.to: "efl.text";
+ rel2.to: "efl.text";
text { style: "efl_ui_text_guide_style";
min: 0 1;
align: 0.0 0.0;
@@ -562,7 +563,7 @@ group { "efl/text";
visible: 0;
}
}
- part { name: "elm.text"; type: SWALLOW;
+ part { name: "efl.text"; type: SWALLOW;
scale: 1;
description { state: "default" 0.0;
/* we gotta use 0 0 here, because of scrolled entries */
@@ -579,32 +580,32 @@ group { "efl/text";
program {
signal: "load"; source: "";
action: FOCUS_SET;
- target: "elm.text";
+ target: "efl.text";
}
program {
- signal: "elm,state,disabled"; source: "elm";
+ signal: "efl,state,disabled"; source: "efl";
action: STATE_SET "disabled" 0.0;
- target: "elm.text";
+ target: "efl.text";
}
program {
- signal: "elm,state,enabled"; source: "elm";
+ signal: "efl,state,enabled"; source: "efl";
action: STATE_SET "default" 0.0;
- target: "elm.text";
+ target: "efl.text";
}
#if 0
program {
- signal: "elm,guide,disabled"; source: "elm";
+ signal: "efl,guide,disabled"; source: "efl";
action: STATE_SET "hidden" 0.0;
- target: "elm.guide";
+ target: "efl.guide";
}
program {
- signal: "elm,guide,enabled"; source: "elm";
+ signal: "efl,guide,enabled"; source: "efl";
action: STATE_SET "default" 0.0;
- target: "elm.guide";
+ target: "efl.guide";
}
#endif
program { name: "key-down";
- signal: "entry,keydown"; source: "elm.text";
+ signal: "entry,keydown"; source: "efl.text";
script {
new buf[32];
snprintf(buf, 31, "key-down%i", (rand() % 5) + 1);
@@ -645,7 +646,7 @@ group { "efl/text/magnifier";
visible: 0;
}
}
- part { name: "elm.swallow.content"; type: SWALLOW; mouse_events: 0;
+ part { name: "efl.content"; type: SWALLOW; mouse_events: 0;
description { state: "default" 0.0;
rel1.offset: 10 10;
rel1.to: "over";
@@ -675,16 +676,16 @@ group { "efl/text/magnifier";
}
programs {
program { name: "magnifier_show";
- signal: "elm,action,show,magnifier"; source: "elm";
+ signal: "efl,action,show,magnifier"; source: "efl";
action: STATE_SET "default" 0.0;
- target: "elm.swallow.content";
+ target: "efl.content";
target: "bg";
target: "over";
}
program { name: "magnifier_hide";
- signal: "elm,action,hide,magnifier"; source: "elm";
+ signal: "efl,action,hide,magnifier"; source: "efl";
action: STATE_SET "hidden" 0.0;
- target: "elm.swallow.content";
+ target: "efl.content";
target: "bg";
target: "over";
}
@@ -725,13 +726,13 @@ group { "efl/text/handler/start";
}
programs {
program {
- signal: "elm,handler,show"; source: "elm";
+ signal: "efl,handler,show"; source: "efl";
action: STATE_SET "visible" 0.0;
target: "base";
target: "event";
}
program {
- signal: "elm,handler,hide"; source: "elm";
+ signal: "efl,handler,hide"; source: "efl";
action: STATE_SET "default" 0.0;
target: "base";
target: "event";
@@ -773,13 +774,13 @@ group { "efl/text/handler/end";
}
programs {
program {
- signal: "elm,handler,show"; source: "elm";
+ signal: "efl,handler,show"; source: "efl";
action: STATE_SET "visible" 0.0;
target: "base";
target: "event";
}
program {
- signal: "elm,handler,hide"; source: "elm";
+ signal: "efl,handler,hide"; source: "efl";
action: STATE_SET "default" 0.0;
target: "base";
target: "event";
@@ -913,4 +914,4 @@ group { "efl/text/emoticon/worried"; images.image:
group { "efl/text/emoticon/wtf"; images.image:
"emo-wtf.png" COMP; parts { part { "icon"; nomouse; desc { "default"; max: 64 64; image.normal:
"emo-wtf.png"; } } } }
-//------------------------------------------------------------
+//------------------------------------------------------------ \ No newline at end of file
diff --git a/data/elementary/themes/edc/efl/textpath.edc b/data/elementary/themes/edc/efl/textpath.edc
index ed4924f9fb..3f880c11a5 100644
--- a/data/elementary/themes/edc/efl/textpath.edc
+++ b/data/elementary/themes/edc/efl/textpath.edc
@@ -1,3 +1,24 @@
-group { "efl/textpath";
- inherit: "elm/textpath/base/default";
+group { name: "efl/textpath";
+ styles {
+ style { name: "textpath_style2";
+ base: "font="FN" font_size=16 text_class=tb_plain wrap=none align=left color=#ffffffff style=shadow,bottom shadow_color=#00000080";
+ tag: "br" "\n";
+ tag: "b" "+ font="FNBD" text_class=tb_light";
+ ENABLED_TEXTBLOCK_TAGS
+ }
+ }
+ parts {
+ part { name: "efl.text";
+ type: TEXTBLOCK;
+ scale: 1;
+ description { state: "default" 0.0;
+ align: 0.0 0.0;
+ text {
+ style: "textpath_style2";
+ min: 0 1;
+ align: 0.0 0.5;
+ }
+ }
+ }
+ }
}
diff --git a/data/elementary/themes/edc/efl/timepicker.edc b/data/elementary/themes/edc/efl/timepicker.edc
new file mode 100644
index 0000000000..c5a2a6a480
--- /dev/null
+++ b/data/elementary/themes/edc/efl/timepicker.edc
@@ -0,0 +1,409 @@
+group { "efl/timepicker";
+ nomouse;
+ parts {
+ spacer { "base";
+ scale;
+ desc { "default";
+ min: 150 170;
+ }
+ desc { "24layout";
+ min: 110 170;
+ }
+ }
+ rect { "base_bg";
+ scale;
+ desc { "default";
+ rel.to: "base";
+ color_class: "timepicker_bg";
+ }
+ }
+ spacer { "padding_bg_top";
+ scale;
+ desc { "default";
+ min: 0 10;
+ max: -1 10;
+ fixed: 0 1;
+ rel1 {
+ relative: 0.0 0.0;
+ to: "base_bg";
+ }
+ rel2 {
+ relative: 1.0 0.0;
+ to: "base_bg";
+ }
+ align: 0.5 0.0;
+ }
+ }
+ spacer { "padding_bg_bottom";
+ scale;
+ desc { "default";
+ min: 0 10;
+ max: -1 10;
+ fixed: 0 1;
+ rel1 {
+ relative: 0.0 1.0;
+ to: "base_bg";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ to: "base_bg";
+ }
+ align: 0.5 1.0;
+ }
+ }
+ spacer { "bg";
+ scale;
+ desc { "default";
+ min: 150 150;
+ max: 150 150;
+ rel1 {
+ relative: 0.0 1.0;
+ to: "padding_bg_top";
+ }
+ rel2 {
+ relative: 1.0 0.0;
+ to: "padding_bg_bottom";
+ }
+ }
+ desc { "24layout";
+ inherit: "default";
+ min: 110 150;
+ max: 110 150;
+ }
+ }
+ spacer { "padding_left";
+ scale;
+ desc { "default";
+ min: 0 0;
+ max: 0 -1;
+ fixed: 1 0;
+ rel1 {
+ relative: 0.0 0.0;
+ to: "bg";
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ to: "bg";
+ }
+ align: 0.0 0.0;
+ }
+ }
+ spacer { "padding_right";
+ scale;
+ desc { "default";
+ min: 0 0;
+ max: 0 -1;
+ fixed: 1 0;
+ rel1 {
+ relative: 1.0 0.0;
+ to: "bg";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ to: "bg";
+ }
+ align: 1.0 1.0;
+ }
+ }
+ swallow { "efl.field0";
+ mouse;
+ scale;
+ desc { "default";
+ fixed: 1 0;
+ min: 40 0;
+ rel1 {
+ relative: 1.0 0.0;
+ to: "padding_left";
+ }
+ rel2.to: "padding_left";
+ align: 0.0 0.5;
+ }
+ }
+ spacer{ "padding_center1";
+ scale;
+ desc { "default";
+ fixed: 1 0;
+ min: 3 0;
+ max: 3 -1;
+ rel1 {
+ relative: 1.0 0.0;
+ to: "efl.field0";
+ }
+ rel2.to: "efl.field0";
+ align: 0.0 0.5;
+ }
+ desc { "invisible";
+ inherit: default 0.0;
+ min: 15 0;
+ max: 15 -1;
+ }
+ }
+ spacer { "bg_text";
+ scale;
+ desc { "default";
+ rel1 {
+ relative: 1.0 0.0;
+ to: "padding_center1";
+ }
+ rel2.to: "padding_center1";
+ align: 0.0 0.5;
+ min: 9 0;
+ max: 9 -1;
+ fixed: 1 0;
+ }
+ desc { "invisible";
+ inherit: default 0.0;
+ min: 0 0;
+ max: 0 0;
+ }
+ }
+ text { "hour_minute_colon";
+ scale;
+ desc { "default";
+ rel1.to: "bg_text";
+ rel2.to: "bg_text";
+ color: 255 255 255 255;
+ fixed: 1 1;
+ text {
+ min: 1 0;
+ font: "Sans";
+ size: "15";
+ //text: ":";
+ align: 0.5 0.44;
+ }
+ vis;
+ }
+ desc { "invisible";
+ inherit: default 0.0;
+ hid;
+ }
+ }
+ spacer { "padding_center2";
+ scale;
+ desc { "default";
+ fixed: 1 0;
+ min: 3 0;
+ max: 3 -1;
+ rel1 {
+ relative: 1.0 0.0;
+ to: "bg_text";
+ }
+ rel2.to: "bg_text";
+ align: 0.0 0.5;
+ }
+ desc { "invisible";
+ inherit: default 0.0;
+ min: 0 0;
+ max: 0 0;
+ }
+ }
+ swallow { "efl.field1";
+ mouse;
+ scale;
+ desc { "default";
+ fixed: 1 0;
+ min: 40 0;
+ rel1 {
+ relative: 1.0 0.0;
+ to: "padding_center2";
+ }
+ rel2.to: "padding_center2";
+ align: 0.0 0.5;
+ }
+ }
+ spacer { "padding_center3";
+ scale;
+ desc { "default";
+ fixed: 1 0;
+ min: 3 0;
+ max: 3 -1;
+ rel1 {
+ relative: 1.0 0.0;
+ to: "efl.field1";
+ }
+ rel2.to: "efl.field1";
+ align: 0.0 0.5;
+ }
+ desc { "invisible";
+ inherit: default 0.0;
+ min: 15 0;
+ max: 15 -1;
+ }
+ }
+ spacer { "bg_text2";
+ scale;
+ desc { "default";
+ rel1 {
+ relative: 1.0 0.0;
+ to: "padding_center3";
+ }
+ rel2.to: "padding_center3";
+ align: 0.0 0.5;
+ min: 9 0;
+ max: 9 -1;
+ fixed: 1 0;
+ }
+ desc { "invisible";
+ inherit: default 0.0;
+ min: 0 0;
+ max: 0 0;
+ }
+ }
+ text { "hour_minute_colon2";
+ scale;
+ desc { "default";
+ rel1.to: "bg_text2";
+ rel2.to: "bg_text2";
+ color: 255 255 255 255;
+ fixed: 1 1;
+ text {
+ min: 1 0;
+ font: "Sans";
+ size: "15";
+ //text: ":";
+ align: 0.5 0.44;
+ }
+ vis;
+ }
+ desc { "invisible";
+ inherit: default 0.0;
+ hid;
+ }
+ }
+ spacer { "padding_center4";
+ scale;
+ desc { "default";
+ fixed: 1 0;
+ min: 3 0;
+ max: 3 -1;
+ rel1 {
+ relative: 1.0 0.0;
+ to: "bg_text2";
+ }
+ rel2.to: "bg_text2";
+ align: 0.0 0.5;
+ }
+ desc { "invisible";
+ inherit: default 0.0;
+ min: 0 0;
+ max: 0 0;
+ }
+ }
+ swallow { "efl.field2";
+ mouse;
+ scale;
+ desc { "default";
+ fixed: 1 0;
+ min: 40 0;
+ max: 40 -1;
+ rel1 {
+ relative: 1.0 0.0;
+ to: "padding_center4";
+ }
+ rel2.to: "padding_center4";
+ align: 0.0 0.5;
+ }
+ desc { "24layout";
+ hid;
+ min: 0 0;
+ max: 0 -1;
+ }
+ }
+ rect { "access";
+ repeat;
+ desc { "default";
+ fixed: 1 1;
+ rel1.to: "bg";
+ rel2.to: "bg";
+ color: 0 0 0 0;
+ }
+ }
+ }
+ programs {
+ program { "visible_ampm";
+ signal: "efl,state,ampm,visible";
+ source: "efl";
+ script {
+ set_state(PART:"base", "default", 0.0);
+ set_state(PART:"bg", "default", 0.0);
+ set_state(PART:"efl.field2", "default", 0.0);
+ }
+ }
+ program { "invisible_ampm";
+ signal: "efl,state,ampm,invisible";
+ source: "efl";
+ script {
+ set_state(PART:"base", "24layout", 0.0);
+ set_state(PART:"bg", "24layout", 0.0);
+ set_state(PART:"efl.field2", "24layout", 0.0);
+ }
+ }
+ program { "visible_colon_field0";
+ signal: "efl,state,colon,visible,field0";
+ source: "efl";
+ action: STATE_SET "default";
+ target: "padding_center1";
+ target: "hour_minute_colon";
+ target: "bg_text";
+ target: "padding_center2";
+ }
+ program { "invisible_colon_field0";
+ signal: "efl,state,colon,invisible,field0";
+ source: "efl";
+ action: STATE_SET "invisible";
+ target: "padding_center1";
+ target: "hour_minute_colon";
+ target: "bg_text";
+ target: "padding_center2";
+ }
+ program { "visible_colon_field1";
+ signal: "efl,state,colon,visible,field1";
+ source: "efl";
+ action: STATE_SET "default";
+ target: "padding_center3";
+ target: "hour_minute_colon2";
+ target: "bg_text2";
+ target: "padding_center4";
+ }
+ program { "invisible_colon_field1";
+ signal: "efl,state,colon,invisible,field1";
+ source: "efl";
+ action: STATE_SET "invisible";
+ target: "padding_center3";
+ target: "hour_minute_colon2";
+ target: "bg_text2";
+ target: "padding_center4";
+ }
+ }
+}
+
+group { "efl/timepicker/spin_button";
+ inherit: "efl/datepicker/spin_button";
+}
+
+group { "efl/timepicker/spin_button/text_button";
+ inherit: "efl/spin_button/text_button";
+}
+
+group { "efl/timepicker/spin_button/inc_button";
+ inherit: "efl/spin_button/inc_button:vertical";
+}
+
+group { "efl/timepicker/spin_button/dec_button";
+ inherit: "efl/spin_button/dec_button:vertical";
+}
+group { "efl/timepicker/button";
+ inherit: "efl/button";
+ parts {
+ image { "base";
+ desc { "default";
+ min: 40 40;
+ max: 40 40;
+ }
+ desc { "pressed";
+ min: 40 40;
+ max: 40 40;
+ }
+ }
+ }
+}
diff --git a/data/elementary/themes/edc/efl/tooltip.edc b/data/elementary/themes/edc/efl/tooltip.edc
index 204b2b4ddc..3022781443 100644
--- a/data/elementary/themes/edc/efl/tooltip.edc
+++ b/data/elementary/themes/edc/efl/tooltip.edc
@@ -1,15 +1,431 @@
-group { "efl/label/tooltip";
- inherit: "elm/label/base/tooltip/default";
+group { name: "efl/label/tooltip";
alias: "efl/label/base/tooltip"; //XXX: Remove it in EFL 2.0
alias: "efl/label/base/tooltip/transparent";
+ styles {
+ style { name: "tooltip_style2";
+ base: "font="FN" font_size=10 color=#ffffff style=shadow,bottom shadow_color=#00000080 text_class=bubble";
+ tag: "br" "\n";
+ tag: "hilight" "+ font="FN" text_class=bubble";
+ tag: "b" "+ font="FN" text_class=bubble";
+ tag: "tab" "\t";
+ }
+ }
+ parts {
+ part { name: "efl.text"; type: TEXTBLOCK; mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ text {
+ style: "tooltip_style2";
+ min: 1 1;
+ ellipsis: -1;
+ }
+ }
+ }
+ }
}
-group { "efl/tooltip";
- inherit: "elm/tooltip/base/default";
+group { name: "efl/tooltip";
+ min: 30 30;
+ data.item: "pad_x" "10";
+ data.item: "pad_y" "10";
+ data.item: "pad_border_x" "1";
+ data.item: "pad_border_y" "1";
+ /* tooltip is hidden after this amount.
+ Keep in sync with hide animations */
+ data.item: "hide_timeout" "0.35";
+ // if in a window... it's transparent!
+ data.item: "transparent" "enabled";
+ images.image: "tooltip-base.png" COMP;
+ images.image: "tooltip-corner-top-left-tip.png" COMP;
+ images.image: "tooltip-corner-top-right-tip.png" COMP;
+ images.image: "tooltip-corner-bottom-left-tip.png" COMP;
+ images.image: "tooltip-corner-bottom-right-tip.png" COMP;
+ images.image: "tooltip-edge-left-tip.png" COMP;
+ images.image: "tooltip-edge-right-tip.png" COMP;
+ images.image: "tooltip-edge-bottom-tip.png" COMP;
+ images.image: "tooltip-edge-top-tip.png" COMP;
+ script {
+ hide_corners() {
+ set_state(PART:"corner-top-left", "default", 0.0);
+ set_state(PART:"corner-top-right", "default", 0.0);
+ set_state(PART:"corner-bottom-left", "default", 0.0);
+ set_state(PART:"corner-bottom-right", "default", 0.0);
+ }
+ hide_edges() {
+ set_state(PART:"clipper-edge-left", "default", 0.0);
+ set_state(PART:"clipper-edge-right", "default", 0.0);
+ set_state(PART:"clipper-edge-top", "default", 0.0);
+ set_state(PART:"clipper-edge-bottom", "default", 0.0);
+ }
+ show_corner_top_left() {
+ set_state(PART:"corner-top-left", "visible", 0.0);
+ set_state(PART:"corner-top-right", "default", 0.0);
+ set_state(PART:"corner-bottom-left", "default", 0.0);
+ set_state(PART:"corner-bottom-right", "default", 0.0);
+ hide_edges();
+ }
+ show_corner_top_right() {
+ set_state(PART:"corner-top-right", "visible", 0.0);
+ set_state(PART:"corner-top-left", "default", 0.0);
+ set_state(PART:"corner-bottom-left", "default", 0.0);
+ set_state(PART:"corner-bottom-right", "default", 0.0);
+ hide_edges();
+ }
+ show_corner_bottom_left() {
+ set_state(PART:"corner-bottom-left", "visible", 0.0);
+ set_state(PART:"corner-bottom-right", "default", 0.0);
+ set_state(PART:"corner-top-left", "default", 0.0);
+ set_state(PART:"corner-top-right", "default", 0.0);
+ hide_edges();
+ }
+ show_corner_bottom_right() {
+ set_state(PART:"corner-bottom-right", "visible", 0.0);
+ set_state(PART:"corner-bottom-left", "default", 0.0);
+ set_state(PART:"corner-top-left", "default", 0.0);
+ set_state(PART:"corner-top-right", "default", 0.0);
+ hide_edges();
+ }
+ show_edge_left(Float:val) {
+ set_state(PART:"clipper-edge-left", "visible", 0.0);
+ set_drag(PART:"edge-drag-left", 0.0, val);
+ set_state(PART:"clipper-edge-right", "default", 0.0);
+ set_state(PART:"clipper-edge-top", "default", 0.0);
+ set_state(PART:"clipper-edge-bottom", "default", 0.0);
+ hide_corners();
+ }
+ show_edge_right(Float:val) {
+ set_state(PART:"clipper-edge-right", "visible", 0.0);
+ set_drag(PART:"edge-drag-right", 0.0, val);
+ set_state(PART:"clipper-edge-left", "default", 0.0);
+ set_state(PART:"clipper-edge-top", "default", 0.0);
+ set_state(PART:"clipper-edge-bottom", "default", 0.0);
+ hide_corners();
+ }
+ show_edge_top(Float:val) {
+ set_state(PART:"clipper-edge-top", "visible", 0.0);
+ set_drag(PART:"edge-drag-top", val, 0.0);
+ set_state(PART:"clipper-edge-bottom", "default", 0.0);
+ set_state(PART:"clipper-edge-left", "default", 0.0);
+ set_state(PART:"clipper-edge-right", "default", 0.0);
+ hide_corners();
+ }
+ show_edge_bottom(Float:val) {
+ set_state(PART:"clipper-edge-bottom", "visible", 0.0);
+ set_drag(PART:"edge-drag-bottom", val, 0.0);
+ set_state(PART:"clipper-edge-top", "default", 0.0);
+ set_state(PART:"clipper-edge-left", "default", 0.0);
+ set_state(PART:"clipper-edge-right", "default", 0.0);
+ hide_corners();
+ }
+ public message(Msg_Type:type, id, ...) {
+ if ((type == MSG_FLOAT_SET) && (id == 1)) {
+ new Float:x, Float:y;
+
+ x = getfarg(2);
+ y = getfarg(3);
+
+ if (x < 0.0) {
+ if (y < 0.0) show_corner_top_left();
+ else if (y > 1.0) show_corner_bottom_left();
+ else show_edge_left(y);
+ } else if (x > 1.0) {
+ if (y < 0.0) show_corner_top_right();
+ else if (y > 1.0) show_corner_bottom_right();
+ else show_edge_right(y);
+ } else {
+ if (y < 0.0) show_edge_top(x);
+ else if (y > 1.0) show_edge_bottom(x);
+ else {
+ hide_corners();
+ hide_edges();
+ }
+ }
+ }
+ }
+ }
+ parts {
+ part { name: "clipper"; type: RECT;
+ description { state: "default" 0.0;
+ color: 255 255 255 0;
+ rel1 { to: "pop"; offset: -5 -5; }
+ rel2 { to: "pop"; offset: 5 5; }
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ part { name: "pop"; mouse_events: 0;
+ clip_to: "clipper";
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 30 30;
+ rel1 {
+ to: "efl.content";
+ offset: -5 -4;
+ }
+ rel2 {
+ to: "efl.content";
+ offset: 4 5;
+ }
+ image {
+ normal: "tooltip-base.png";
+ border: 7 7 6 8;
+ }
+ image.middle: SOLID;
+ }
+ }
+ #define TT_CORNER(name_, rx, ry, ax, ay, ox, oy) \
+ part { name: "corner-"name_; mouse_events: 0; \
+ clip_to: "clipper"; \
+ scale: 1; \
+ description { state: "default" 0.0; \
+ visible: 0; \
+ align: ax ay; \
+ FIXED_SIZE(12, 12) \
+ rel1 { \
+ relative: rx ry; \
+ offset: ox oy; \
+ to: "pop"; \
+ } \
+ rel2 { \
+ relative: rx ry; \
+ offset: ox oy; \
+ to: "pop"; \
+ } \
+ image.normal: "tooltip-corner-"name_"-tip.png"; \
+ } \
+ description { state: "visible" 0.0; \
+ inherit: "default" 0.0; \
+ visible: 1; \
+ } \
+ }
+ TT_CORNER("top-left", 0, 0, 0, 0, -4, -5);
+ TT_CORNER("top-right", 1, 0, 1, 0, 3, -5);
+ TT_CORNER("bottom-left", 0, 1, 0, 1, -4, 2);
+ TT_CORNER("bottom-right", 1, 1, 1, 1, 3, 2);
+ #undef TT_CORNER
+
+ #define TT_EDGE_VERT(name_, rx, ax, ox) \
+ part { name: "clipper-edge-"name_; type: RECT; \
+ clip_to: "clipper"; \
+ description { state: "default" 0.0; \
+ visible: 0; \
+ min: 9 13; \
+ align: ax 0.5; \
+ fixed: 1 1; \
+ rel1 { \
+ relative: rx 0.0; \
+ offset: ox 0; \
+ to: "efl.content"; \
+ } \
+ rel2 { \
+ relative: rx 1.0; \
+ offset: ox 0; \
+ to: "efl.content"; \
+ } \
+ } \
+ description { state: "visible" 0.0; \
+ inherit: "default" 0.0; \
+ visible: 1; \
+ } \
+ } \
+ part { name: "edge-area-"name_; type: RECT; mouse_events: 0; \
+ clip_to: "clipper-edge-"name_; \
+ scale: 1; \
+ description { state: "default" 0.0; \
+ color: 0 0 0 0; \
+ min: 9 13; \
+ align: ax 0.5; \
+ fixed: 1 1; \
+ rel1 { \
+ relative: rx 0.0; \
+ offset: ox 0; \
+ to: "efl.content"; \
+ } \
+ rel2 { \
+ relative: rx 1.0; \
+ offset: ox 0; \
+ to: "efl.content"; \
+ } \
+ } \
+ } \
+ part { name: "edge-drag-"name_; type: RECT; mouse_events: 0; \
+ clip_to: "clipper-edge-"name_; \
+ scale: 1; \
+ dragable { \
+ x: 0 0 0; \
+ y: 1 1 0; \
+ confine: "edge-area-"name_; \
+ } \
+ description { state: "default" 0.0; \
+ color: 0 0 0 0; \
+ min: 9 13; \
+ rel1.to: "edge-area-"name_; \
+ rel2.to: "edge-area-"name_; \
+ } \
+ } \
+ part { name: "edge-img-"name_; mouse_events: 0; \
+ clip_to: "clipper-edge-"name_; \
+ description { state: "default" 0.0; \
+ FIXED_SIZE(9, 13) \
+ align: ax 0.5; \
+ rel1.to: "edge-drag-"name_; \
+ rel2.to: "edge-drag-"name_; \
+ image.normal: "tooltip-edge-"name_"-tip.png"; \
+ } \
+ }
+ TT_EDGE_VERT("left", 0, 1, -3);
+ TT_EDGE_VERT("right", 1, 0, 2);
+ #undef TT_EDGE_VERT
+
+ #define TT_EDGE_HORIZ(name_, ry, ay, oy) \
+ part { name: "clipper-edge-"name_; type: RECT; \
+ clip_to: "clipper"; \
+ scale: 1; \
+ description { state: "default" 0.0; \
+ visible: 0; \
+ min: 11 9; \
+ align: 0.5 ay; \
+ fixed: 1 1; \
+ rel1 { \
+ relative: 0.0 ry; \
+ offset: 0 oy; \
+ to: "efl.content"; \
+ } \
+ rel2 { \
+ relative: 1.0 ry; \
+ offset: 0 oy; \
+ to: "efl.content"; \
+ } \
+ } \
+ description { state: "visible" 0.0; \
+ inherit: "default" 0.0; \
+ visible: 1; \
+ } \
+ } \
+ part { name: "edge-area-"name_; type: RECT; mouse_events: 0; \
+ clip_to: "clipper-edge-"name_; \
+ scale: 1; \
+ description { state: "default" 0.0; \
+ color: 0 0 0 0; \
+ min: 11 9; \
+ align: 0.5 ay; \
+ fixed: 1 1; \
+ rel1.to: "clipper-edge-"name_; \
+ rel2.to: "clipper-edge-"name_; \
+ } \
+ } \
+ part { name: "edge-drag-"name_; type: RECT; mouse_events: 0; \
+ clip_to: "clipper-edge-"name_; \
+ scale: 1; \
+ dragable { \
+ x: 1 1 0; \
+ y: 0 0 0; \
+ confine: "edge-area-"name_; \
+ } \
+ description { state: "default" 0.0; \
+ color: 0 0 0 0; \
+ min: 11 9; \
+ rel1.to: "edge-area-"name_; \
+ rel2.to: "edge-area-"name_; \
+ } \
+ } \
+ part { name: "edge-img-"name_; mouse_events: 0; \
+ clip_to: "clipper-edge-"name_; \
+ scale: 1; \
+ description { state: "default" 0.0; \
+ FIXED_SIZE(11, 9) \
+ align: 0.5 ay; \
+ rel1.to: "edge-drag-"name_; \
+ rel2.to: "edge-drag-"name_; \
+ image.normal: "tooltip-edge-"name_"-tip.png"; \
+ } \
+ }
+ TT_EDGE_HORIZ("top", 0, 1, -1);
+ TT_EDGE_HORIZ("bottom", 1, 0, 1);
+ #undef TT_EDGE_HORIZ
+ part { name: "clipper_content"; type: RECT;
+ description { state: "default" 0.0;
+ color: 255 255 255 0;
+ rel1.to: "efl.content";
+ rel2.to: "efl.content";
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ part { name: "efl.content"; type: SWALLOW;
+ clip_to: "clipper_content";
+ description { state: "default" 0.0;
+ rel1.offset: 10 10;
+ rel2.offset: -11 -11;
+ }
+ }
+ programs {
+ program { name: "show0";
+ signal: "efl,action,show"; source: "efl";
+ action: ACTION_STOP;
+ target: "hide0";
+ target: "hide1";
+ target: "hide2";
+ target: "hide3";
+ after: "show1";
+ after: "show2";
+ }
+ program { name: "show1";
+ action: STATE_SET "visible" 0.0;
+ transition: LINEAR 0.15;
+ target: "clipper";
+ }
+ program { name: "show2";
+ in: 0.1 0.0;
+ action: STATE_SET "visible" 0.0;
+ transition: LINEAR 0.15;
+ target: "clipper_content";
+ }
+ program { name: "hide0";
+ signal: "efl,action,hide"; source: "efl";
+ action: ACTION_STOP;
+ target: "show0";
+ target: "show1";
+ target: "show2";
+ after: "hide1";
+ after: "hide2";
+ after: "hide3";
+ }
+ program { name: "hide1";
+ script {
+ hide_corners();
+ hide_edges();
+ }
+ }
+ program { name: "hide2";
+ action: STATE_SET "default" 0.0;
+ transition: LINEAR 0.1;
+ target: "clipper_content";
+ }
+ program { name: "hide3";
+ in: 0.1 0.0;
+ action: STATE_SET "default" 0.0;
+ transition: LINEAR 0.1;
+ target: "clipper";
+ }
+ }
+ }
}
-group { "efl/tooltip:transparent";
- inherit: "elm/tooltip/base/transparent";
+group { name: "efl/tooltip:transparent";
+ data.item: "pad_x" "10";
+ data.item: "pad_y" "10";
+ data.item: "transparent" "enabled";
+ parts {
+ part { name: "efl.content"; type: SWALLOW; mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0; }
+ }
+ }
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/data/elementary/themes/edc/efl/uiclock.edc b/data/elementary/themes/edc/efl/uiclock.edc
index ac37fdc793..ce448b37ea 100644
--- a/data/elementary/themes/edc/efl/uiclock.edc
+++ b/data/elementary/themes/edc/efl/uiclock.edc
@@ -1,5 +1,5 @@
#define DATETIME_FIELD(_pos) \
- swallow { "field"#_pos; \
+ swallow { "efl.field"#_pos; \
scale; \
clip_to: "clip"; \
desc { "default"; \
@@ -8,9 +8,9 @@
align: 0.0 0.5; \
fixed: 1 1; \
rel1.relative: 1.0 0.0; \
- rel1.to: "separator"#_pos; \
+ rel1.to: "efl.separator"#_pos; \
rel2.relative: 1.0 1.0; \
- rel2.to: "separator"#_pos; \
+ rel2.to: "efl.separator"#_pos; \
} \
desc { "enable"; \
inherit: "default"; \
@@ -21,19 +21,19 @@
programs{ \
program { "field_"#_pos"enabled"; \
signal: "field"#_pos",enable"; \
- source: "elm"; \
+ source: "efl"; \
action: STATE_SET "enable"; \
- target: "field"#_pos; \
+ target: "efl.field"#_pos; \
} \
program { "field_"#_pos"disabled"; \
signal: "field"#_pos",disable"; \
- source: "elm"; \
+ source: "efl"; \
action: STATE_SET "default"; \
- target: "field"#_pos; \
+ target: "efl.field"#_pos; \
} \
}
#define DATETIME_SEPARATOR(_pos, _after) \
- text { "separator"#_pos; \
+ text { "efl.separator"#_pos; \
scale; \
effect: SHADOW BOTTOM; \
clip_to: "disclip"; \
@@ -44,11 +44,11 @@
fixed: 1 0; \
rel1 { \
relative: 1.0 0.0; \
- to: "field"#_after; \
+ to: "efl.field"#_after; \
} \
rel2 { \
relative: 1.0 1.0; \
- to: "field"#_after; \
+ to: "efl.field"#_after; \
} \
color_class: "datetime_separator_text"; \
text { \
@@ -65,17 +65,17 @@
min: 8 10; \
} \
} \
- text { "separator"#_pos"d"; \
+ text { "efl.separator"#_pos"d"; \
scale; \
effect: SHADOW BOTTOM; \
clip_to: "disclip2"; \
desc { "default"; \
hid; \
- rel1.to: "separator"#_pos; \
- rel2.to: "separator"#_pos; \
+ rel1.to: "efl.separator"#_pos; \
+ rel2.to: "efl.separator"#_pos; \
color_class: "datetime_separator_text_disabled"; \
text { \
- text_source: "separator"#_pos; \
+ text_source: "efl.separator"#_pos; \
font: "Sans"; size: 10; \
text_class: "datetime_separator_text_disabled"; \
} \
@@ -88,17 +88,17 @@
programs { \
program { \
signal: "field"#_after",enable"; \
- source: "elm"; \
+ source: "efl"; \
action: STATE_SET "enable"; \
- target: "separator"#_pos; \
- target: "separator"#_pos"d"; \
+ target: "efl.separator"#_pos; \
+ target: "efl.separator"#_pos"d"; \
} \
program { \
signal: "field"#_after",disable"; \
- source: "elm"; \
+ source: "efl"; \
action: STATE_SET "default"; \
- target: "separator"#_pos; \
- target: "separator"#_pos"d"; \
+ target: "efl.separator"#_pos; \
+ target: "efl.separator"#_pos"d"; \
} \
}
@@ -111,15 +111,15 @@ group { "efl/uiclock";
}
rect { "clip";
desc { "default";
- rel1.to: "separator0";
- rel2.to: "separator7";
+ rel1.to: "efl.separator0";
+ rel2.to: "efl.separator7";
}
}
rect { "disclip";
clip_to: "clip";
desc { "default";
- rel1.to: "separator0";
- rel2.to: "separator7";
+ rel1.to: "efl.separator0";
+ rel2.to: "efl.separator7";
}
desc { "disabled";
inherit: "default";
@@ -129,8 +129,8 @@ group { "efl/uiclock";
rect { "disclip2";;
clip_to: "clip";
desc { "default";
- rel1.to: "separator0";
- rel2.to: "separator7";
+ rel1.to: "efl.separator0";
+ rel2.to: "efl.separator7";
hid;
}
desc { "disabled";
@@ -138,7 +138,7 @@ group { "efl/uiclock";
vis;
}
}
- spacer { "separator0";;
+ spacer { "efl.separator0";;
scale;
desc { "default";
min: 8 10;
@@ -163,17 +163,17 @@ group { "efl/uiclock";
DATETIME_SEPARATOR(7,6)
DATETIME_FIELD(7)
DATETIME_SEPARATOR(8,7)
- spacer { "separator9";;
+ spacer { "efl.separator9";;
desc { "default";
- rel1.to: "separator7";
+ rel1.to: "efl.separator7";
rel1.relative: 1.0 0.0;
min: 8 10;
}
}
rect { "discover";;
desc { "default";
- rel1.to: "separator0";
- rel2.to: "separator7";
+ rel1.to: "efl.separator0";
+ rel2.to: "efl.separator7";
hid;
color: 0 0 0 0;
}
@@ -182,7 +182,7 @@ group { "efl/uiclock";
vis;
}
}
- rect { "elm.access";
+ rect { "efl.access";
repeat;
desc { "default";
color: 0 0 0 0;
@@ -191,16 +191,16 @@ group { "efl/uiclock";
}
programs {
program {
- signal: "elm,state,disabled";
- source: "elm";
+ signal: "efl,state,disabled";
+ source: "efl";
action: STATE_SET "disabled";
target: "disclip";
target: "disclip2";
target: "discover";
}
program {
- signal: "elm,state,enabled";
- source: "elm";
+ signal: "efl,state,enabled";
+ source: "efl";
action: STATE_SET "default";
target: "disclip";
target: "disclip2";
diff --git a/data/elementary/themes/edc/efl/video.edc b/data/elementary/themes/edc/efl/video.edc
index 3a2a658b06..e6de3dd88e 100644
--- a/data/elementary/themes/edc/efl/video.edc
+++ b/data/elementary/themes/edc/efl/video.edc
@@ -1,3 +1,43 @@
-group { "efl/video";
- inherit: "elm/video/base/default";
+group { name: "efl/video";
+ parts {
+ part { name: "clipper"; type: RECT;
+ description { state: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ description { state: "darker" 0.0;
+ color: 128 128 128 255;
+ }
+ }
+ part { name: "efl.video"; type: SWALLOW; mouse_events: 1;
+ clip_to: "clipper";
+ description { state: "default" 0.0;
+ aspect: 1.0 1.0; aspect_preference: BOTH;
+ }
+ }
+ }
+ programs {
+ program {
+ signal: "efl,video,load"; source: "efl";
+ action: STATE_SET "darker" 0.0;
+ target: "clipper";
+ }
+ program {
+ signal: "efl,video,play"; source: "efl";
+ action: STATE_SET "default" 0.0;
+ transition: SINUSOIDAL 0.2 CURRENT;
+ target: "clipper";
+ }
+ program {
+ signal: "efl,video,end"; source: "efl";
+ action: STATE_SET "darker" 0.0;
+ transition: SINUSOIDAL 0.5 CURRENT;
+ target: "clipper";
+ }
+ program {
+ signal: "efl,video,pause"; source: "efl";
+ action: STATE_SET "darker" 0.0;
+ transition: SINUSOIDAL 0.7 CURRENT;
+ target: "clipper";
+ }
+ }
}
diff --git a/data/elementary/themes/edc/efl/win.edc b/data/elementary/themes/edc/efl/win.edc
index d0b66110f7..b0223d4ebc 100644
--- a/data/elementary/themes/edc/efl/win.edc
+++ b/data/elementary/themes/edc/efl/win.edc
@@ -1,3 +1,31 @@
group { "efl/win";
- inherit: "elm/win/base/default";
+ data.item: "version" "119";
+ parts {
+ rect { "client_clip"; nomouse; }
+ swallow { "efl.menu";
+ clip_to: "client_clip";
+ desc { "default";
+ rel2.relative: 1 0;
+ link.base: "efl,action,hide" "efl";
+ align: 0.5 0.0;
+ hid;
+ }
+ desc { "visible";
+ inherit: "default";
+ link.base: "efl,action,show_menu" "efl";
+ fixed: 0 1;
+ vis;
+ }
+ }
+ swallow { "efl.contents";
+ clip_to: "client_clip";
+ desc { "default";
+ }
+ desc { "with_menu";
+ rel1.to: "efl.menu";
+ rel1.relative: 0 1;
+ link.base: "efl,action,show_menu" "efl";
+ }
+ }
+ }
}
diff --git a/data/elementary/themes/edc/elm/actionslider.edc b/data/elementary/themes/edc/elm/actionslider.edc
index dc382c24bd..985fd640cb 100644
--- a/data/elementary/themes/edc/elm/actionslider.edc
+++ b/data/elementary/themes/edc/elm/actionslider.edc
@@ -36,7 +36,7 @@ group { name: "elm/actionslider/base/default";
fill.smooth: 0;
}
}
- part { name: "icon.dragable.area"; type: SPACER;
+ part { name: "icon_dragable_area"; type: SPACER;
description { state: "default" 0.0;
rel1.to: "bg";
rel2.to: "bg";
@@ -105,14 +105,14 @@ group { name: "elm/actionslider/base/default";
fixed: 1 1;
min: 40 10;
align: 0.5 0.5;
- rel1.to: "icon.dragable.area";
+ rel1.to: "icon_dragable_area";
rel2 {
relative: 0.0 1.0;
- to: "icon.dragable.area";
+ to: "icon_dragable_area";
}
}
dragable {
- confine: "icon.dragable.area";
+ confine: "icon_dragable_area";
x: 1 1 0;
y: 0 0 0;
}
@@ -123,9 +123,9 @@ group { name: "elm/actionslider/base/default";
min: 40 10;
color: 0 0 0 0;
rel1.to_x: "elm.drag_button_base";
- rel1.to_y: "icon.dragable.area";
+ rel1.to_y: "icon_dragable_area";
rel2.to_x: "elm.drag_button_base";
- rel2.to_y: "icon.dragable.area";
+ rel2.to_y: "icon_dragable_area";
}
dragable {
events: "elm.drag_button_base";
diff --git a/data/elementary/themes/edc/elm/bubble.edc b/data/elementary/themes/edc/elm/bubble.edc
index 4fd5a28025..95214e774f 100644
--- a/data/elementary/themes/edc/elm/bubble.edc
+++ b/data/elementary/themes/edc/elm/bubble.edc
@@ -28,7 +28,7 @@ group { name: "elm/bubble/top_left/default";
visible: 1;
}
}
- part { name: "sizer.content"; type: TEXT; mouse_events: 0;
+ part { name: "sizer_content"; type: TEXT; mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
fixed: 1 1;
@@ -164,13 +164,13 @@ group { name: "elm/bubble/top_left/default";
signal: "elm,state,icon,visible"; source: "elm";
action: STATE_SET "visible" 0.0;
target: "elm.swallow.icon";
- target: "sizer.content";
+ target: "sizer_content";
}
program {
signal: "elm,state,icon,hidden"; source: "elm";
action: STATE_SET "default" 0.0;
target: "elm.swallow.icon";
- target: "sizer.content";
+ target: "sizer_content";
}
program {
signal: "edje,state,rtl"; source: "edje";
@@ -217,7 +217,7 @@ group { name: "elm/bubble/top_right/default";
visible: 1;
}
}
- part { name: "sizer.content"; type: TEXT; mouse_events: 0;
+ part { name: "sizer_content"; type: TEXT; mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
fixed: 1 1;
@@ -350,13 +350,13 @@ group { name: "elm/bubble/top_right/default";
signal: "elm,state,icon,visible"; source: "elm";
action: STATE_SET "visible" 0.0;
target: "elm.swallow.icon";
- target: "sizer.content";
+ target: "sizer_content";
}
program {
signal: "elm,state,icon,hidden"; source: "elm";
action: STATE_SET "default" 0.0;
target: "elm.swallow.icon";
- target: "sizer.content";
+ target: "sizer_content";
}
program {
signal: "edje,state,rtl"; source: "edje";
@@ -404,7 +404,7 @@ group { name: "elm/bubble/bottom_left/default";
visible: 1;
}
}
- part { name: "sizer.content"; type: TEXT; mouse_events: 0;
+ part { name: "sizer_content"; type: TEXT; mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
fixed: 1 1;
@@ -534,13 +534,13 @@ group { name: "elm/bubble/bottom_left/default";
signal: "elm,state,icon,visible"; source: "elm";
action: STATE_SET "visible" 0.0;
target: "elm.swallow.icon";
- target: "sizer.content";
+ target: "sizer_content";
}
program {
signal: "elm,state,icon,hidden"; source: "elm";
action: STATE_SET "default" 0.0;
target: "elm.swallow.icon";
- target: "sizer.content";
+ target: "sizer_content";
}
program {
signal: "edje,state,rtl"; source: "edje";
@@ -586,7 +586,7 @@ group { name: "elm/bubble/bottom_right/default";
visible: 1;
}
}
- part { name: "sizer.content"; type: TEXT; mouse_events: 0;
+ part { name: "sizer_content"; type: TEXT; mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
fixed: 1 1;
@@ -716,13 +716,13 @@ group { name: "elm/bubble/bottom_right/default";
signal: "elm,state,icon,visible"; source: "elm";
action: STATE_SET "visible" 0.0;
target: "elm.swallow.icon";
- target: "sizer.content";
+ target: "sizer_content";
}
program {
signal: "elm,state,icon,hidden"; source: "elm";
action: STATE_SET "default" 0.0;
target: "elm.swallow.icon";
- target: "sizer.content";
+ target: "sizer_content";
}
program {
signal: "edje,state,rtl"; source: "edje";
diff --git a/data/elementary/themes/edc/elm/button.edc b/data/elementary/themes/edc/elm/button.edc
index c5c48d3a21..cd0f4eb190 100644
--- a/data/elementary/themes/edc/elm/button.edc
+++ b/data/elementary/themes/edc/elm/button.edc
@@ -37,7 +37,7 @@ group { name: "elm/button/base/default";
if (m1 == (ICON | LABEL)) {
if (!d) {
set_state(PART:"elm.swallow.content", "visible", 0.0);
- set_state(PART:"sizer.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
set_state(PART:"event", "default", 0.0);
if (!p) {
set_state(PART:"elm.text", "visible", 0.0);
@@ -48,7 +48,7 @@ group { name: "elm/button/base/default";
}
} else {
set_state(PART:"elm.swallow.content", "visible", 0.0);
- set_state(PART:"sizer.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
set_state(PART:"elm.text", "disabled_visible", 0.0);
set_state(PART:"icon_clip", "disabled", 0.0);
set_state(PART:"event", "disabled", 0.0);
@@ -56,7 +56,7 @@ group { name: "elm/button/base/default";
} else if (m1 == (ICON)) {
if (!d) {
set_state(PART:"elm.swallow.content", "icononly", 0.0);
- set_state(PART:"sizer.content", "icononly", 0.0);
+ set_state(PART:"sizer_content", "icononly", 0.0);
set_state(PART:"event", "default", 0.0);
set_state(PART:"elm.text", "default", 0.0);
if (!p)
@@ -65,7 +65,7 @@ group { name: "elm/button/base/default";
set_state(PART:"icon_clip", "pressed", 0.0);
} else {
set_state(PART:"elm.swallow.content", "icononly", 0.0);
- set_state(PART:"sizer.content", "icononly", 0.0);
+ set_state(PART:"sizer_content", "icononly", 0.0);
set_state(PART:"elm.text", "default", 0.0);
set_state(PART:"icon_clip", "disabled", 0.0);
set_state(PART:"event", "disabled", 0.0);
@@ -73,7 +73,7 @@ group { name: "elm/button/base/default";
} else if (m1 == (LABEL)) {
if (!d) {
set_state(PART:"elm.swallow.content", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
set_state(PART:"icon_clip", "default", 0.0);
set_state(PART:"event", "default", 0.0);
if (!p)
@@ -82,7 +82,7 @@ group { name: "elm/button/base/default";
set_state(PART:"elm.text", "pressed_textonly", 0.0);
} else {
set_state(PART:"elm.swallow.content", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
set_state(PART:"elm.text", "disabled_textonly", 0.0);
set_state(PART:"icon_clip", "disabled", 0.0);
set_state(PART:"event", "disabled", 0.0);
@@ -90,12 +90,12 @@ group { name: "elm/button/base/default";
} else {
if (!d) {
set_state(PART:"elm.swallow.content", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
set_state(PART:"icon_clip", "default", 0.0);
set_state(PART:"event", "default", 0.0);
} else {
set_state(PART:"elm.swallow.content", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
set_state(PART:"icon_clip", "disabled", 0.0);
set_state(PART:"event", "disabled", 0.0);
}
@@ -179,7 +179,7 @@ group { name: "elm/button/base/default";
visible: 1;
}
}
- text { "sizer.content"; nomouse;
+ text { "sizer_content"; nomouse;
scale: 1;
desc { "default";
// fixed: 1 1;
@@ -419,14 +419,14 @@ group { name: "elm/button/base/anchor";
if (m1 == (ICON | LABEL)) {
if (!d) {
set_state(PART:"elm.swallow.content", "visible", 0.0);
- set_state(PART:"sizer.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
set_state(PART:"elm.text", "visible", 0.0);
set_state(PART:"icon_clip", "default", 0.0);
set_state(PART:"bar", "default", 0.0);
set_state(PART:"event", "default", 0.0);
} else {
set_state(PART:"elm.swallow.content", "visible", 0.0);
- set_state(PART:"sizer.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
set_state(PART:"elm.text", "disabled_visible", 0.0);
set_state(PART:"icon_clip", "disabled", 0.0);
set_state(PART:"bar", "disabled", 0.0);
@@ -435,14 +435,14 @@ group { name: "elm/button/base/anchor";
} else if (m1 == (ICON)) {
if (!d) {
set_state(PART:"elm.swallow.content", "icononly", 0.0);
- set_state(PART:"sizer.content", "icononly", 0.0);
+ set_state(PART:"sizer_content", "icononly", 0.0);
set_state(PART:"elm.text", "default", 0.0);
set_state(PART:"icon_clip", "default", 0.0);
set_state(PART:"bar", "default", 0.0);
set_state(PART:"event", "default", 0.0);
} else {
set_state(PART:"elm.swallow.content", "icononly", 0.0);
- set_state(PART:"sizer.content", "icononly", 0.0);
+ set_state(PART:"sizer_content", "icononly", 0.0);
set_state(PART:"elm.text", "default", 0.0);
set_state(PART:"icon_clip", "disabled", 0.0);
set_state(PART:"bar", "disabled", 0.0);
@@ -451,14 +451,14 @@ group { name: "elm/button/base/anchor";
} else if (m1 == (LABEL)) {
if (!d) {
set_state(PART:"elm.swallow.content", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
set_state(PART:"elm.text", "textonly", 0.0);
set_state(PART:"icon_clip", "default", 0.0);
set_state(PART:"bar", "default", 0.0);
set_state(PART:"event", "default", 0.0);
} else {
set_state(PART:"elm.swallow.content", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
set_state(PART:"elm.text", "disabled_textonly", 0.0);
set_state(PART:"icon_clip", "disabled", 0.0);
set_state(PART:"bar", "disabled", 0.0);
@@ -467,13 +467,13 @@ group { name: "elm/button/base/anchor";
} else {
if (!d) {
set_state(PART:"elm.swallow.content", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
set_state(PART:"icon_clip", "default", 0.0);
set_state(PART:"bar", "default", 0.0);
set_state(PART:"event", "default", 0.0);
} else {
set_state(PART:"elm.swallow.content", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
set_state(PART:"icon_clip", "disabled", 0.0);
set_state(PART:"bar", "disabled", 0.0);
set_state(PART:"event", "disabled", 0.0);
@@ -533,7 +533,7 @@ group { name: "elm/button/base/anchor";
visible: 1;
}
}
- text { "sizer.content"; nomouse;
+ text { "sizer_content"; nomouse;
scale: 1;
desc { "default";
visible: 0;
@@ -1039,13 +1039,13 @@ group { name: "elm/button/base/hoversel_vertical_entry/default";
if (m1 == (ICON | LABEL)) {
if (!d) {
set_state(PART:"elm.swallow.content", "visible", 0.0);
- set_state(PART:"sizer.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
set_state(PART:"elm.text", "visible", 0.0);
set_state(PART:"icon_clip", "default", 0.0);
set_state(PART:"event", "default", 0.0);
} else {
set_state(PART:"elm.swallow.content", "visible", 0.0);
- set_state(PART:"sizer.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
set_state(PART:"elm.text", "disabled_visible", 0.0);
set_state(PART:"icon_clip", "disabled", 0.0);
set_state(PART:"event", "disabled", 0.0);
@@ -1053,13 +1053,13 @@ group { name: "elm/button/base/hoversel_vertical_entry/default";
} else if (m1 == (ICON)) {
if (!d) {
set_state(PART:"elm.swallow.content", "icononly", 0.0);
- set_state(PART:"sizer.content", "icononly", 0.0);
+ set_state(PART:"sizer_content", "icononly", 0.0);
set_state(PART:"elm.text", "default", 0.0);
set_state(PART:"icon_clip", "default", 0.0);
set_state(PART:"event", "default", 0.0);
} else {
set_state(PART:"elm.swallow.content", "icononly", 0.0);
- set_state(PART:"sizer.content", "icononly", 0.0);
+ set_state(PART:"sizer_content", "icononly", 0.0);
set_state(PART:"elm.text", "default", 0.0);
set_state(PART:"icon_clip", "disabled", 0.0);
set_state(PART:"event", "disabled", 0.0);
@@ -1067,13 +1067,13 @@ group { name: "elm/button/base/hoversel_vertical_entry/default";
} else if (m1 == (LABEL)) {
if (!d) {
set_state(PART:"elm.swallow.content", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
set_state(PART:"elm.text", "textonly", 0.0);
set_state(PART:"icon_clip", "default", 0.0);
set_state(PART:"event", "default", 0.0);
} else {
set_state(PART:"elm.swallow.content", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
set_state(PART:"elm.text", "disabled_textonly", 0.0);
set_state(PART:"icon_clip", "disabled", 0.0);
set_state(PART:"event", "disabled", 0.0);
@@ -1081,12 +1081,12 @@ group { name: "elm/button/base/hoversel_vertical_entry/default";
} else {
if (!d) {
set_state(PART:"elm.swallow.content", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
set_state(PART:"icon_clip", "default", 0.0);
set_state(PART:"event", "default", 0.0);
} else {
set_state(PART:"elm.swallow.content", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
set_state(PART:"icon_clip", "disabled", 0.0);
set_state(PART:"event", "disabled", 0.0);
}
@@ -1160,7 +1160,7 @@ group { name: "elm/button/base/hoversel_vertical_entry/default";
visible: 1;
}
}
- text { "sizer.content"; nomouse;
+ text { "sizer_content"; nomouse;
scale: 1;
desc { "default";
fixed: 1 1;
@@ -1532,7 +1532,7 @@ group { name: "elm/button/base/hoversel_horizontal_entry/default";
}
}
program { name: "button_press2";
- action: SIGNAL_EMIT "elm,action,press" "";
+ action: SIGNAL_EMIT "elm,action,press" "elm";
after: "button_press_anim";
}
program { name: "button_press_anim";
@@ -1551,7 +1551,7 @@ group { name: "elm/button/base/hoversel_horizontal_entry/default";
}
}
program { name: "button_unpress2";
- action: SIGNAL_EMIT "elm,action,unpress" "";
+ action: SIGNAL_EMIT "elm,action,unpress" "elm";
}
program { name: "button_unpress_anim";
action: STATE_SET "default" 0.0;
@@ -1577,7 +1577,7 @@ group { name: "elm/button/base/hoversel_horizontal_entry/default";
after: "button_press_anim";
}
program { name: "button_click2";
- action: SIGNAL_EMIT "elm,action,click" "";
+ action: SIGNAL_EMIT "elm,action,click" "elm";
}
program { name: "access_pressed";
signal: "elm,action,anim,activate";
@@ -1714,7 +1714,7 @@ group { name: "elm/button/base/hoversel_horizontal_entry/default";
}
}
program { name: "button_click2";
- action: SIGNAL_EMIT "elm,action,click" "";
+ action: SIGNAL_EMIT "elm,action,click" "elm";
}
program { name: "disable";
signal: "elm,state,disabled";
diff --git a/data/elementary/themes/edc/elm/calendar.edc b/data/elementary/themes/edc/elm/calendar.edc
index 8dfffc169c..cc60f67082 100644
--- a/data/elementary/themes/edc/elm/calendar.edc
+++ b/data/elementary/themes/edc/elm/calendar.edc
@@ -98,7 +98,7 @@
}
#define CH(_pos) \
- part { name: "ch_"#_pos".base"; type: SPACER; \
+ part { name: "ch_"#_pos"_base"; type: SPACER; \
description { state: "default" 0.0; \
rel1 { \
relative: (_pos % 7 / 7) 0.0; \
@@ -110,13 +110,13 @@
} \
} \
} \
- part { name: "ch_"#_pos".text"; type: TEXT; mouse_events: 0; \
+ part { name: "elm.ch_"#_pos".text"; type: TEXT; mouse_events: 0; \
effect: SHADOW BOTTOM; \
scale: 1; \
- clip_to: "ch_"#_pos".clipper"; \
+ clip_to: "ch_"#_pos"_clipper"; \
description { state: "default" 0.0; \
- rel1.to: "ch_"#_pos".base"; \
- rel2.to: "ch_"#_pos".base"; \
+ rel1.to: "ch_"#_pos"_base"; \
+ rel2.to: "ch_"#_pos"_base"; \
text { font: FN; size: 8; \
min: 1 1; \
ellipsis: -1; \
@@ -125,15 +125,15 @@
color_class: "calendar_weekday_text"; \
} \
} \
- part { name: "ch_"#_pos".clipper"; type: RECT; \
+ part { name: "ch_"#_pos"_clipper"; type: RECT; \
description { state: "default" 0.0; \
- rel1.to: "ch_"#_pos".base"; \
- rel2.to: "ch_"#_pos".base"; \
+ rel1.to: "ch_"#_pos"_base"; \
+ rel2.to: "ch_"#_pos"_base"; \
} \
}
#define CIT(_pos) \
- part { name: "cit_"#_pos".rect"; type: SPACER; \
+ part { name: "cit_"#_pos"_rect"; type: SPACER; \
description { state: "default" 0.0; \
rel1 { \
relative: (_pos % 7 / 7) \
@@ -147,18 +147,18 @@
} \
} \
} \
- part { name: "cit_"#_pos".event"; type: RECT; repeat_events: 1; \
+ part { name: "cit_"#_pos"_event"; type: RECT; repeat_events: 1; \
description { state: "default" 0.0; \
- rel1.to: "cit_"#_pos".rect"; \
- rel2.to: "cit_"#_pos".rect"; \
+ rel1.to: "cit_"#_pos"_rect"; \
+ rel2.to: "cit_"#_pos"_rect"; \
color: 0 0 0 0; \
} \
} \
- part { name: "cit_"#_pos".pat"; mouse_events: 0; \
+ part { name: "cit_"#_pos"_pat"; mouse_events: 0; \
description { state: "default" 0.0; \
- rel1.to: "cit_"#_pos".selected"; \
+ rel1.to: "cit_"#_pos"_selected"; \
rel1.offset: 1 1; \
- rel2.to: "cit_"#_pos".selected"; \
+ rel2.to: "cit_"#_pos"_selected"; \
rel2.offset: -2 -2; \
image.normal: "diagonal_stripes.png"; \
color: 255 255 255 25; \
@@ -171,10 +171,10 @@
visible: 1; \
} \
} \
- part { name: "cit_"#_pos".selected"; mouse_events: 0; \
+ part { name: "cit_"#_pos"_selected"; mouse_events: 0; \
description { state: "default" 0.0; \
- rel1.to: "cit_"#_pos".rect"; \
- rel2.to: "cit_"#_pos".rect"; \
+ rel1.to: "cit_"#_pos"_rect"; \
+ rel2.to: "cit_"#_pos"_rect"; \
image.normal: "outline_glow.png"; \
image.border: 4 4 4 4; \
color_class: "calendar_day_selected"; \
@@ -185,10 +185,10 @@
visible: 1; \
} \
} \
- part { name: "cit_"#_pos".selected2"; mouse_events: 0; \
+ part { name: "cit_"#_pos"_selected2"; mouse_events: 0; \
description { state: "default" 0.0; \
- rel1.to: "cit_"#_pos".rect"; \
- rel2.to: "cit_"#_pos".rect"; \
+ rel1.to: "cit_"#_pos"_rect"; \
+ rel2.to: "cit_"#_pos"_rect"; \
image.normal: "outline_glow.png"; \
image.border: 4 4 4 4; \
color: 255 255 255 128; \
@@ -200,10 +200,10 @@
visible: 1; \
} \
} \
- part { name: "cit_"#_pos".glow"; mouse_events: 0; \
+ part { name: "cit_"#_pos"_glow"; mouse_events: 0; \
description { state: "default" 0.0; \
- rel1.to: "cit_"#_pos".rect"; \
- rel2.to: "cit_"#_pos".rect"; \
+ rel1.to: "cit_"#_pos"_rect"; \
+ rel2.to: "cit_"#_pos"_rect"; \
image.normal: "box_glow.png"; \
image.border: 12 12 12 12; \
image.middle: 0; \
@@ -215,11 +215,11 @@
visible: 1; \
} \
} \
- part { name: "cit_"#_pos".text"; type: TEXTBLOCK; mouse_events: 0; \
+ part { name: "elm.cit_"#_pos".text"; type: TEXTBLOCK; mouse_events: 0; \
scale: 1; \
description { state: "default" 0.0; \
- rel1.to: "cit_"#_pos".rect"; \
- rel2.to: "cit_"#_pos".rect"; \
+ rel1.to: "cit_"#_pos"_rect"; \
+ rel2.to: "cit_"#_pos"_rect"; \
text.style: "calendar_date_style"; \
text.min: 1 1; \
text.ellipsis: -1; \
@@ -245,16 +245,16 @@
text.style: "calendar_date_weekend2_style"; \
} \
} \
- part { name: "cit_"#_pos".check"; mouse_events: 0; \
+ part { name: "cit_"#_pos"_check"; mouse_events: 0; \
scale: 1; \
description { state: "default" 0.0; \
fixed: 1 1; \
rel1 { \
- to: "cit_"#_pos".rect"; \
+ to: "cit_"#_pos"_rect"; \
relative: 0.6 0.5; \
} \
rel2 { \
- to: "cit_"#_pos".rect"; \
+ to: "cit_"#_pos"_rect"; \
relative: 0.6 0.5; \
} \
min: 16 16; \
@@ -270,173 +270,173 @@
visible: 1; \
} \
} \
- part { name: "cit_"#_pos".access"; type: RECT; repeat_events: 1; \
+ part { name: "elm.cit_"#_pos".access"; type: RECT; repeat_events: 1; \
description { state: "default" 0.0; \
- rel1.to: "cit_"#_pos".event"; \
- rel2.to: "cit_"#_pos".event"; \
+ rel1.to: "cit_"#_pos"_event"; \
+ rel2.to: "cit_"#_pos"_event"; \
color: 0 0 0 0; \
} \
} \
programs { \
program { \
- name: "cit_"#_pos".go_active"; \
+ name: "cit_"#_pos"_go_active"; \
signal: "cit_"#_pos",selected"; \
source: "elm"; \
action: STATE_SET "selected" 0.0; \
- target: "cit_"#_pos".pat"; \
- target: "cit_"#_pos".selected"; \
+ target: "cit_"#_pos"_pat"; \
+ target: "cit_"#_pos"_selected"; \
} \
program { \
- name: "cit_"#_pos".go_passive"; \
+ name: "cit_"#_pos"_go_passive"; \
signal: "cit_"#_pos",unselected"; \
source: "elm"; \
action: STATE_SET "default" 0.0; \
- target: "cit_"#_pos".pat"; \
- target: "cit_"#_pos".selected"; \
+ target: "cit_"#_pos"_pat"; \
+ target: "cit_"#_pos"_selected"; \
} \
program { \
- name: "cit_"#_pos".focus_highlighted"; \
+ name: "cit_"#_pos"_focus_highlighted"; \
signal: "cit_"#_pos",focused"; \
source: "elm"; \
script { \
set_int(item_focus_enabled, 1); \
set_int(last_focused_item, _pos); \
if (get_int(win_focus_enabled) == 1) \
- set_state(PART:"cit_"#_pos".glow", "focused", 0.0); \
+ set_state(PART:"cit_"#_pos"_glow", "focused", 0.0); \
} \
} \
program { \
- name: "cit_"#_pos".focus_unhighlighed"; \
+ name: "cit_"#_pos"_focus_unhighlighed"; \
signal: "cit_"#_pos",unfocused"; \
source: "elm"; \
script { \
set_int(item_focus_enabled, 0); \
- set_state(PART:"cit_"#_pos".glow", "default", 0.0); \
+ set_state(PART:"cit_"#_pos"_glow", "default", 0.0); \
} \
} \
program { \
- name: "cit_"#_pos".is_today"; \
+ name: "cit_"#_pos"_is_today"; \
signal: "cit_"#_pos",today"; \
source: "elm"; \
action: STATE_SET "today" 0.0; \
- target: "cit_"#_pos".text"; \
+ target: "elm.cit_"#_pos".text"; \
} \
program { \
- name: "cit_"#_pos".not_today"; \
+ name: "cit_"#_pos"_not_today"; \
signal: "cit_"#_pos",not_today"; \
source: "elm"; \
action: STATE_SET "default" 0.0; \
- target: "cit_"#_pos".text"; \
+ target: "elm.cit_"#_pos".text"; \
} \
program { \
- name: "cit_"#_pos".enable"; \
+ name: "cit_"#_pos"_enable"; \
signal: "cit_"#_pos",enable"; \
source: "elm"; \
script { \
new st[31]; \
new Float:vl; \
- get_state(PART:"cit_"#_pos".text", st, 30, vl); \
+ get_state(PART:"elm.cit_"#_pos".text", st, 30, vl); \
if (!strcmp(st, "disabled")) \
- set_state(PART:"cit_"#_pos".text", "default", 0.0); \
+ set_state(PART:"elm.cit_"#_pos".text", "default", 0.0); \
} \
} \
program { \
- name: "cit_"#_pos".disable"; \
+ name: "cit_"#_pos"_disable"; \
signal: "cit_"#_pos",disable"; \
source: "elm"; \
action: STATE_SET "disabled" 0.0; \
- target: "cit_"#_pos".text"; \
+ target: "elm.cit_"#_pos".text"; \
} \
program { \
- source: "cit_"#_pos".clicked"; \
+ source: "cit_"#_pos"_clicked"; \
signal: "mouse,down,1"; \
- source: "cit_"#_pos".event"; \
+ source: "cit_"#_pos"_event"; \
action: STATE_SET "highlighted" 0.0; \
- target: "cit_"#_pos".selected2"; \
+ target: "cit_"#_pos"_selected2"; \
} \
program { \
- source: "cit_"#_pos".clicked"; \
+ source: "cit_"#_pos"_clicked"; \
signal: "mouse,up,1"; \
- source: "cit_"#_pos".event"; \
+ source: "cit_"#_pos"_event"; \
action: STATE_SET "default" 0.0; \
- target: "cit_"#_pos".selected2"; \
+ target: "cit_"#_pos"_selected2"; \
} \
program { \
- source: "cit_"#_pos".clicked"; \
+ source: "cit_"#_pos"_clicked"; \
signal: "mouse,clicked,1"; \
- source: "cit_"#_pos".event"; \
+ source: "cit_"#_pos"_event"; \
action: SIGNAL_EMIT "elm,action,selected" #_pos; \
} \
program { \
- name: "cit_"#_pos".clear"; \
+ name: "cit_"#_pos"_clear"; \
signal: "cit_"#_pos",clear"; \
source: "elm"; \
action: STATE_SET "default" 0.0; \
- target: "cit_"#_pos".check"; \
- after: "cit_"#_pos".weekends_clear"; \
- after: "cit_"#_pos".holiday_clear"; \
+ target: "cit_"#_pos"_check"; \
+ after: "cit_"#_pos"_weekends_clear"; \
+ after: "cit_"#_pos"_holiday_clear"; \
} \
program { \
- name: "cit_"#_pos".weekends_clear"; \
+ name: "cit_"#_pos"_weekends_clear"; \
script { \
new st[31]; \
new Float:vl; \
- get_state(PART:"cit_"#_pos".text", st, 30, vl); \
+ get_state(PART:"elm.cit_"#_pos".text", st, 30, vl); \
if (!strcmp(st, "weekend/day1") || !strcmp(st, "weekend/day2")) \
- set_state(PART:"cit_"#_pos".text", "default", 0.0); \
+ set_state(PART:"elm.cit_"#_pos".text", "default", 0.0); \
} \
} \
program { \
- name: "cit_"#_pos".holiday_clear"; \
+ name: "cit_"#_pos"_holiday_clear"; \
script { \
new st[31]; \
new Float:vl; \
- get_state(PART:"cit_"#_pos".text", st, 30, vl); \
+ get_state(PART:"elm.cit_"#_pos".text", st, 30, vl); \
if (!strcmp(st, "holiday")) \
- set_state(PART:"cit_"#_pos".text", "default", 0.0); \
+ set_state(PART:"elm.cit_"#_pos".text", "default", 0.0); \
} \
} \
program { \
- name: "cit_"#_pos".checked"; \
+ name: "cit_"#_pos"_checked"; \
signal: "cit_"#_pos",checked"; \
source: "elm"; \
action: STATE_SET "visible" 0.0; \
- target: "cit_"#_pos".check"; \
+ target: "cit_"#_pos"_check"; \
} \
program { \
- name: "cit_"#_pos".holiday"; \
+ name: "cit_"#_pos"_holiday"; \
signal: "cit_"#_pos",holiday"; \
source: "elm"; \
script { \
new st[31]; \
new Float:vl; \
- get_state(PART:"cit_"#_pos".text", st, 30, vl); \
+ get_state(PART:"elm.cit_"#_pos".text", st, 30, vl); \
if (strcmp(st, "today")) \
- set_state(PART:"cit_"#_pos".text", "holiday", 0.0); \
+ set_state(PART:"elm.cit_"#_pos".text", "holiday", 0.0); \
} \
} \
program { \
- name: "cit_"#_pos".weekend/day1"; \
+ name: "cit_"#_pos"_weekend/day1"; \
signal: "cit_"#_pos",weekend/day1"; \
source: "elm"; \
script { \
new st[31]; \
new Float:vl; \
- get_state(PART:"cit_"#_pos".text", st, 30, vl); \
+ get_state(PART:"elm.cit_"#_pos".text", st, 30, vl); \
if ((strcmp(st, "today")) && (strcmp(st, "holiday")) )\
- set_state(PART:"cit_"#_pos".text", "weekend/day1", 0.0); \
+ set_state(PART:"elm.cit_"#_pos".text", "weekend/day1", 0.0); \
} \
} \
program { \
- name: "cit_"#_pos".weekend/day2"; \
+ name: "cit_"#_pos"_weekend/day2"; \
signal: "cit_"#_pos",weekend/day2"; \
source: "elm"; \
script { \
new st[31]; \
new Float:vl; \
- get_state(PART:"cit_"#_pos".text", st, 30, vl); \
+ get_state(PART:"elm.cit_"#_pos".text", st, 30, vl); \
if ((strcmp(st, "today")) && (strcmp(st, "holiday")) )\
- set_state(PART:"cit_"#_pos".text", "weekend/day2", 0.0); \
+ set_state(PART:"elm.cit_"#_pos".text", "weekend/day2", 0.0); \
} \
} \
}
diff --git a/data/elementary/themes/edc/elm/check.edc b/data/elementary/themes/edc/elm/check.edc
index 1a1cfd436c..4d71b41739 100644
--- a/data/elementary/themes/edc/elm/check.edc
+++ b/data/elementary/themes/edc/elm/check.edc
@@ -14,7 +14,7 @@ group { name: "elm/check/base/default";
if (m1 == (ICON | LABEL)) {
if (!d) {
set_state(PART:"elm.swallow.content", "visible", 0.0);
- set_state(PART:"sizer.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
set_state(PART:"elm.text", "visible", 0.0);
set_state(PART:"shadow", "default", 0.0);
set_state(PART:"base", "default", 0.0);
@@ -22,7 +22,7 @@ group { name: "elm/check/base/default";
set_state(PART:"event", "default", 0.0);
} else {
set_state(PART:"elm.swallow.content", "visible", 0.0);
- set_state(PART:"sizer.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
set_state(PART:"elm.text", "disabled_visible", 0.0);
set_state(PART:"shadow", "disabled", 0.0);
set_state(PART:"base", "disabled", 0.0);
@@ -32,7 +32,7 @@ group { name: "elm/check/base/default";
} else if (m1 == (ICON)) {
if (!d) {
set_state(PART:"elm.swallow.content", "visible", 0.0);
- set_state(PART:"sizer.content", "icononly", 0.0);
+ set_state(PART:"sizer_content", "icononly", 0.0);
set_state(PART:"elm.text", "default", 0.0);
set_state(PART:"shadow", "default", 0.0);
set_state(PART:"base", "default", 0.0);
@@ -40,7 +40,7 @@ group { name: "elm/check/base/default";
set_state(PART:"event", "default", 0.0);
} else {
set_state(PART:"elm.swallow.content", "visible", 0.0);
- set_state(PART:"sizer.content", "icononly", 0.0);
+ set_state(PART:"sizer_content", "icononly", 0.0);
set_state(PART:"elm.text", "disabled", 0.0);
set_state(PART:"shadow", "disabled", 0.0);
set_state(PART:"base", "disabled", 0.0);
@@ -50,7 +50,7 @@ group { name: "elm/check/base/default";
} else if (m1 == (LABEL)) {
if (!d) {
set_state(PART:"elm.swallow.content", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
set_state(PART:"elm.text", "visible", 0.0);
set_state(PART:"shadow", "default", 0.0);
set_state(PART:"base", "default", 0.0);
@@ -58,7 +58,7 @@ group { name: "elm/check/base/default";
set_state(PART:"event", "default", 0.0);
} else {
set_state(PART:"elm.swallow.content", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
set_state(PART:"elm.text", "disabled_visible", 0.0);
set_state(PART:"shadow", "disabled", 0.0);
set_state(PART:"base", "disabled", 0.0);
@@ -68,7 +68,7 @@ group { name: "elm/check/base/default";
} else {
if (!d) {
set_state(PART:"elm.swallow.content", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
set_state(PART:"elm.text", "default", 0.0);
set_state(PART:"shadow", "default", 0.0);
set_state(PART:"base", "default", 0.0);
@@ -76,7 +76,7 @@ group { name: "elm/check/base/default";
set_state(PART:"event", "default", 0.0);
} else {
set_state(PART:"elm.swallow.content", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
set_state(PART:"elm.text", "default", 0.0);
set_state(PART:"shadow", "disabled", 0.0);
set_state(PART:"base", "disabled", 0.0);
@@ -175,7 +175,7 @@ group { name: "elm/check/base/default";
min: 16 16;
}
}
- part { name: "sizer.content"; type: TEXT; mouse_events: 0;
+ part { name: "sizer_content"; type: TEXT; mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
fixed: 1 1;
@@ -347,7 +347,7 @@ group { name: "elm/check/base/toggle";
if (m1 == (ICON | LABEL)) {
if (!d) {
set_state(PART:"elm.swallow.content", "visible", 0.0);
- set_state(PART:"sizer.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
set_state(PART:"elm.text", "visible", 0.0);
set_state(PART:"shadow", "default", 0.0);
set_state(PART:"clip", "default", 0.0);
@@ -359,7 +359,7 @@ group { name: "elm/check/base/toggle";
set_state(PART:"offrect", "default", 0.0);
} else {
set_state(PART:"elm.swallow.content", "visible", 0.0);
- set_state(PART:"sizer.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
set_state(PART:"elm.text", "disabled_visible", 0.0);
set_state(PART:"shadow", "disabled", 0.0);
set_state(PART:"clip", "disabled", 0.0);
@@ -373,7 +373,7 @@ group { name: "elm/check/base/toggle";
} else if (m1 == (ICON)) {
if (!d) {
set_state(PART:"elm.swallow.content", "visible", 0.0);
- set_state(PART:"sizer.content", "icononly", 0.0);
+ set_state(PART:"sizer_content", "icononly", 0.0);
set_state(PART:"elm.text", "default", 0.0);
set_state(PART:"shadow", "default", 0.0);
set_state(PART:"clip", "default", 0.0);
@@ -385,7 +385,7 @@ group { name: "elm/check/base/toggle";
set_state(PART:"offrect", "default", 0.0);
} else {
set_state(PART:"elm.swallow.content", "visible", 0.0);
- set_state(PART:"sizer.content", "icononly", 0.0);
+ set_state(PART:"sizer_content", "icononly", 0.0);
set_state(PART:"elm.text", "disabled", 0.0);
set_state(PART:"shadow", "disabled", 0.0);
set_state(PART:"clip", "disabled", 0.0);
@@ -399,7 +399,7 @@ group { name: "elm/check/base/toggle";
} else if (m1 == (LABEL)) {
if (!d) {
set_state(PART:"elm.swallow.content", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
set_state(PART:"elm.text", "visible", 0.0);
set_state(PART:"shadow", "default", 0.0);
set_state(PART:"clip", "default", 0.0);
@@ -411,7 +411,7 @@ group { name: "elm/check/base/toggle";
set_state(PART:"offrect", "default", 0.0);
} else {
set_state(PART:"elm.swallow.content", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
set_state(PART:"elm.text", "disabled_visible", 0.0);
set_state(PART:"shadow", "disabled", 0.0);
set_state(PART:"clip", "disabled", 0.0);
@@ -425,7 +425,7 @@ group { name: "elm/check/base/toggle";
} else {
if (!d) {
set_state(PART:"elm.swallow.content", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
set_state(PART:"elm.text", "default", 0.0);
set_state(PART:"shadow", "default", 0.0);
set_state(PART:"clip", "default", 0.0);
@@ -437,7 +437,7 @@ group { name: "elm/check/base/toggle";
set_state(PART:"offrect", "default", 0.0);
} else {
set_state(PART:"elm.swallow.content", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
set_state(PART:"elm.text", "default", 0.0);
set_state(PART:"shadow", "disabled", 0.0);
set_state(PART:"clip", "disabled", 0.0);
@@ -679,7 +679,7 @@ group { name: "elm/check/base/toggle";
min: 16 16;
}
}
- part { name: "sizer.content"; type: TEXT; mouse_events: 0;
+ part { name: "sizer_content"; type: TEXT; mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
fixed: 1 1;
diff --git a/data/elementary/themes/edc/elm/clock.edc b/data/elementary/themes/edc/elm/clock.edc
index f3bbd44167..43072a65d1 100644
--- a/data/elementary/themes/edc/elm/clock.edc
+++ b/data/elementary/themes/edc/elm/clock.edc
@@ -287,7 +287,7 @@ group { name: "elm/clock/flipampm/default";
}
#define SWALLOW_PART(_NAME, _R1X, _R1Y, _R2X, _R2Y) \
- part { name: _NAME; \
+ part { name: "elm."_NAME; \
type: SWALLOW; \
description { state: "default" 0.0; \
rel1.relative: _R1X _R1Y; \
diff --git a/data/elementary/themes/edc/elm/colorsel.edc b/data/elementary/themes/edc/elm/colorsel.edc
index cb5af47238..610791e6bc 100644
--- a/data/elementary/themes/edc/elm/colorsel.edc
+++ b/data/elementary/themes/edc/elm/colorsel.edc
@@ -660,7 +660,8 @@ group { name: "elm/colorselector/item/default";
color: 255 255 255 64;
}
}
- part { name: "color_obj"; type: SWALLOW;
+ alias: "color_obj" "elm.swallow.color_obj";
+ part { name: "elm.swallow.color_obj"; type: SWALLOW;
clip_to: "clipper";
description { state: "default" 0.0;
rel1.offset: 3 3;
diff --git a/data/elementary/themes/edc/elm/dayselector.edc b/data/elementary/themes/edc/elm/dayselector.edc
index 8c83ae5ec5..98ffd034b8 100644
--- a/data/elementary/themes/edc/elm/dayselector.edc
+++ b/data/elementary/themes/edc/elm/dayselector.edc
@@ -9,8 +9,9 @@
#define DAYSELECOR_DAY_STATE_SELECTED 3
#define DAYSELECTOR_DAY(_pos, _after)\
+ alias: "day"#_pos "elm.swallow.day"#_pos; \
part {\
- name: "day"#_pos;\
+ name: "elm.swallow.day"#_pos;\
type: SWALLOW;\
scale: 1;\
clip_to: "clipper";\
@@ -21,12 +22,12 @@
fixed: 1 0;\
rel1 {\
relative: 1.0 0.0;\
- to: "day"#_after;\
+ to: "elm.swallow.day"#_after;\
offset: 0 0;\
}\
rel2 {\
relative: 1.0 1.0;\
- to: "day"#_after;\
+ to: "elm.swallow.day"#_after;\
}\
}\
description { state: "visible" 0.0;\
@@ -38,24 +39,24 @@
programs{\
program {\
name: "day"#_pos"visible";\
- signal: "day"#_pos",visible";\
+ signal: "elm,day"#_pos",visible";\
source: "elm";\
action: STATE_SET "visible" 0.0;\
- target: "day"#_pos;\
+ target: "elm.swallow.day"#_pos;\
}\
program {\
name: "day"#_pos"notvisible";\
- signal: "day"#_pos",default";\
+ signal: "elm,day"#_pos",default";\
source: "elm";\
action: STATE_SET "default" 0.0;\
- target: "day"#_pos;\
+ target: "elm.swallow.day"#_pos;\
}\
}
group { name: "elm/dayselector/base/default";
parts {
part {
- name: "day0";
+ name: "elm.swallow.day0";
type: SWALLOW;
scale: 1;
clip_to: "clipper";
@@ -82,8 +83,8 @@ group { name: "elm/dayselector/base/default";
type: RECT;
description {
state: "default" 0.0;
- rel1.to: "day0";
- rel2.to: "day6";
+ rel1.to: "elm.swallow.day0";
+ rel2.to: "elm.swallow.day6";
}
description {
state: "visible" 0.0;
@@ -125,17 +126,17 @@ group { name: "elm/dayselector/base/default";
}
program {
name: "day0_visible";
- signal: "day0,visible";
+ signal: "elm,day0,visible";
source: "elm";
action: STATE_SET "visible" 0.0;
- target: "day0";
+ target: "elm.swallow.day0";
}
program {
name: "day0_default";
- signal: "day0,default";
+ signal: "elm,day0,default";
source: "elm";
action: STATE_SET "default" 0.0;
- target: "day0";
+ target: "elm.swallow.day0";
}
}
}
diff --git a/data/elementary/themes/edc/elm/entry.edc b/data/elementary/themes/edc/elm/entry.edc
index 189bf968d7..303857db07 100644
--- a/data/elementary/themes/edc/elm/entry.edc
+++ b/data/elementary/themes/edc/elm/entry.edc
@@ -854,8 +854,6 @@ group { name: "elm/entry/base-single/default";
group { name: "elm/entry/base-single/spinner/default";
alias: "elm/entry/base-single/spinner/vertical";
- alias: "elm/entry/base-single/spin_button/default";
- alias: "elm/entry/base-single/spin_button/vertical";
inherit: "elm/entry/base-single/default";
styles {
style { name: "entry_single_spinner_style";
diff --git a/data/elementary/themes/edc/elm/ews.edc b/data/elementary/themes/edc/elm/ews.edc
index fd654f37a2..82e28626b9 100644
--- a/data/elementary/themes/edc/elm/ews.edc
+++ b/data/elementary/themes/edc/elm/ews.edc
@@ -167,7 +167,7 @@ group { name: "elm/ews/decoration/default";
rel2.relative: 1.0 0.85;
}
}
- part { name: "e.swallow.icon"; type: SWALLOW; nomouse;
+ part { name: "elm.swallow.icon"; type: SWALLOW; nomouse;
description { state: "default" 0.0;
rel1.to: "icon";
rel1.relative: 0.15 0.15;
diff --git a/data/elementary/themes/edc/elm/genlist.edc b/data/elementary/themes/edc/elm/genlist.edc
index b3843d8e94..5cd6838cb8 100644
--- a/data/elementary/themes/edc/elm/genlist.edc
+++ b/data/elementary/themes/edc/elm/genlist.edc
@@ -1975,7 +1975,7 @@ group { "elm/genlist/item/icon_top_text_bottom/default"; nomouse;
target: "elm.text.flip";
}
//##//
- text { "sizer.content";
+ text { "sizer_content";
scale;
desc { "default";
fixed: 1 1;
@@ -2009,8 +2009,8 @@ group { "elm/genlist/item/icon_top_text_bottom/default"; nomouse;
desc { "default";
fixed: 1 1;
aspect: 1.0 1.0;
- rel1.to: "sizer.content";
- rel2.to: "sizer.content";
+ rel1.to: "sizer_content";
+ rel2.to: "sizer_content";
link.base: "elm,state,flip,disabled";
}
desc { "flip_enabled";
@@ -2031,7 +2031,7 @@ COMPRESS_ODD("elm/genlist/item_compress_odd/icon_top_text_bottom/default", "elm/
group { "elm/genlist/tree/icon_top_text_bottom/default";
inherit: "elm/genlist/item/icon_top_text_bottom/default";
parts {
- image { "sizer.content";
+ image { "sizer_content";
desc { "default";
rel1.to_x: "arrow";
rel1.offset: 1 2;
diff --git a/data/elementary/themes/edc/elm/icon_fdo.edc b/data/elementary/themes/edc/elm/icon_fdo.edc
index c608afd115..86659b4716 100644
--- a/data/elementary/themes/edc/elm/icon_fdo.edc
+++ b/data/elementary/themes/edc/elm/icon_fdo.edc
@@ -18,6 +18,7 @@
* - src/bin/elementary/test_icon.c (elementary_test -to "Icon Standard")
* - data/elementary/themes/Makefile.am
* - data/Makefile.am (only for new dirs)
+ * - data/elementary/themes/fdo/index.theme (only for new dirs)
* - elm_icon documentation ????? really?
* - don't forget to run "make distcheck"
*
@@ -588,6 +589,7 @@ FLAG(CTX, "flag-za")
//// mimetypes //////////////////////////////////////////////////////////////
#define CTX "mimetypes"
+ICO2(CTX, "inode-directory")
// TODO ... don't really know about this one (they are LOTS of icons)
#undef CTX
diff --git a/data/elementary/themes/edc/elm/label.edc b/data/elementary/themes/edc/elm/label.edc
index 99227d8067..477f4cbad5 100644
--- a/data/elementary/themes/edc/elm/label.edc
+++ b/data/elementary/themes/edc/elm/label.edc
@@ -1,3 +1,10 @@
+#define HORIZONTAL_FIXED \
+ description { state: "horizontal_fixed" 0.0; \
+ inherit: "default" 0.0; \
+ fixed: 1 0; \
+ text.min: 0 1; \
+ }
+
group { name: "elm/label/base/default";
styles {
style { name: "label_style";
@@ -28,11 +35,7 @@ group { name: "elm/label/base/default";
min: 1 1;
}
}
- description { state: "horizontal_fixed" 0.0;
- inherit: "default" 0.0;
- fixed: 1 0;
- text.min: 0 1;
- }
+ HORIZONTAL_FIXED
}
}
programs {
@@ -62,6 +65,7 @@ group { name: "elm/label/base/default/left";
parts {
textblock { "elm.text";
desc { "default"; text.style: "label_style_left"; }
+ HORIZONTAL_FIXED
}
}
}
@@ -79,6 +83,7 @@ group { name: "elm/label/base/default/right";
parts {
textblock { "elm.text";
desc { "default"; text.style: "label_style_right"; }
+ HORIZONTAL_FIXED
}
}
}
@@ -509,3 +514,4 @@ group { name: "elm/label/base/slide_bounce";
}
}
}
+#undef HORIZONTAL_FIXED
diff --git a/data/elementary/themes/edc/elm/multibuttonentry.edc b/data/elementary/themes/edc/elm/multibuttonentry.edc
index cefb816419..63ad74ff3d 100644
--- a/data/elementary/themes/edc/elm/multibuttonentry.edc
+++ b/data/elementary/themes/edc/elm/multibuttonentry.edc
@@ -18,7 +18,9 @@ group { name: "elm/multibuttonentry/base/default";
rel2.to: "bg";
}
}
- part { name: "box.swallow"; type: SWALLOW;
+ /* this widget was released with non-namespaced parts in legacy api */
+ alias: "box.swallow" "elm.swallow.box";
+ part { name: "elm.swallow.box"; type: SWALLOW;
description { state: "default" 0.0;
rel1.to: "bg";
rel2.to: "bg";
diff --git a/data/elementary/themes/edc/elm/panel.edc b/data/elementary/themes/edc/elm/panel.edc
index ad3bb5e9ac..02dbdadf8f 100644
--- a/data/elementary/themes/edc/elm/panel.edc
+++ b/data/elementary/themes/edc/elm/panel.edc
@@ -13,7 +13,7 @@ group { name: "elm/scroller/panel/default";
group { name: "elm/scroller/panel/left/default";
parts {
- part { name: "panel_area";
+ part { name: "elm.panel_area";
type: SWALLOW;
description { state: "default" 0.0;
rel2.relative: 0.0 1.0;
@@ -26,16 +26,16 @@ group { name: "elm/scroller/panel/left/default";
visible: 1;
}
}
- part { name: "event_area";
+ part { name: "elm.event_area";
type: SWALLOW;
description { state: "default" 0.0;
rel1 {
relative: 1.0 0.0;
- to: "panel_area";
+ to: "elm.panel_area";
}
rel2 {
relative: 1.0 1.0;
- to: "panel_area";
+ to: "elm.panel_area";
}
align: 0.0 0.5;
fixed: 1 1;
@@ -50,16 +50,16 @@ group { name: "elm/scroller/panel/left/default";
type: RECT;
repeat_events: 1;
description { state: "default" 0.0;
- rel1.to: "panel_area";
- rel2.to: "panel_area";
+ rel1.to: "elm.panel_area";
+ rel2.to: "elm.panel_area";
color: 0 0 0 0;
}
}
part { name: "bg";
type: RECT;
description { state: "default" 0.0;
- rel1.to: "panel_area";
- rel2.to: "panel_area";
+ rel1.to: "elm.panel_area";
+ rel2.to: "elm.panel_area";
color: 64 64 64 255;
visible: 0;
}
@@ -71,8 +71,8 @@ group { name: "elm/scroller/panel/left/default";
part { name: "elm.swallow.content";
type: SWALLOW;
description { state: "default" 0.0;
- rel1.to: "panel_area";
- rel2.to: "panel_area";
+ rel1.to: "elm.panel_area";
+ rel2.to: "elm.panel_area";
visible: 0;
}
description { state: "visible" 0.0;
@@ -86,8 +86,8 @@ group { name: "elm/scroller/panel/left/default";
signal: "elm,state,content,visible";
source: "elm";
action: STATE_SET "visible" 0.0;
- target: "panel_area";
- target: "event_area";
+ target: "elm.panel_area";
+ target: "elm.event_area";
target: "bg";
target: "elm.swallow.content";
}
@@ -95,8 +95,8 @@ group { name: "elm/scroller/panel/left/default";
signal: "elm,state,content,hidden";
source: "elm";
action: STATE_SET "default" 0.0;
- target: "panel_area";
- target: "event_area";
+ target: "elm.panel_area";
+ target: "elm.event_area";
target: "bg";
target: "elm.swallow.content";
}
@@ -105,7 +105,7 @@ group { name: "elm/scroller/panel/left/default";
group { name: "elm/scroller/panel/right/default";
parts {
- part { name: "event_area";
+ part { name: "elm.event_area";
type: SWALLOW;
description { state: "default" 0.0;
rel2.relative: 0.0 1.0;
@@ -118,16 +118,16 @@ group { name: "elm/scroller/panel/right/default";
visible: 1;
}
}
- part { name: "panel_area";
+ part { name: "elm.panel_area";
type: SWALLOW;
description { state: "default" 0.0;
rel1 {
relative: 1.0 0.0;
- to: "event_area";
+ to: "elm.event_area";
}
rel2 {
relative: 1.0 1.0;
- to: "event_area";
+ to: "elm.event_area";
}
align: 0.0 0.5;
fixed: 1 1;
@@ -142,16 +142,16 @@ group { name: "elm/scroller/panel/right/default";
type: RECT;
repeat_events: 1;
description { state: "default" 0.0;
- rel1.to: "panel_area";
- rel2.to: "panel_area";
+ rel1.to: "elm.panel_area";
+ rel2.to: "elm.panel_area";
color: 0 0 0 0;
}
}
part { name: "bg";
type: RECT;
description { state: "default" 0.0;
- rel1.to: "panel_area";
- rel2.to: "panel_area";
+ rel1.to: "elm.panel_area";
+ rel2.to: "elm.panel_area";
color: 64 64 64 255;
visible: 0;
}
@@ -163,8 +163,8 @@ group { name: "elm/scroller/panel/right/default";
part { name: "elm.swallow.content";
type: SWALLOW;
description { state: "default" 0.0;
- rel1.to: "panel_area";
- rel2.to: "panel_area";
+ rel1.to: "elm.panel_area";
+ rel2.to: "elm.panel_area";
visible: 0;
}
description { state: "visible" 0.0;
@@ -178,8 +178,8 @@ group { name: "elm/scroller/panel/right/default";
signal: "elm,state,content,visible";
source: "elm";
action: STATE_SET "visible" 0.0;
- target: "panel_area";
- target: "event_area";
+ target: "elm.panel_area";
+ target: "elm.event_area";
target: "bg";
target: "elm.swallow.content";
}
@@ -187,8 +187,8 @@ group { name: "elm/scroller/panel/right/default";
signal: "elm,state,content,hidden";
source: "elm";
action: STATE_SET "default" 0.0;
- target: "panel_area";
- target: "event_area";
+ target: "elm.panel_area";
+ target: "elm.event_area";
target: "bg";
target: "elm.swallow.content";
}
@@ -197,7 +197,7 @@ group { name: "elm/scroller/panel/right/default";
group { name: "elm/scroller/panel/top/default";
parts {
- part { name: "panel_area";
+ part { name: "elm.panel_area";
type: SWALLOW;
description { state: "default" 0.0;
rel2.relative: 1.0 0.0;
@@ -210,16 +210,16 @@ group { name: "elm/scroller/panel/top/default";
visible: 1;
}
}
- part { name: "event_area";
+ part { name: "elm.event_area";
type: SWALLOW;
description { state: "default" 0.0;
rel1 {
relative: 0.0 1.0;
- to: "panel_area";
+ to: "elm.panel_area";
}
rel2 {
relative: 1.0 1.0;
- to: "panel_area";
+ to: "elm.panel_area";
}
align: 0.5 0.0;
fixed: 1 1;
@@ -234,16 +234,16 @@ group { name: "elm/scroller/panel/top/default";
type: RECT;
repeat_events: 1;
description { state: "default" 0.0;
- rel1.to: "panel_area";
- rel2.to: "panel_area";
+ rel1.to: "elm.panel_area";
+ rel2.to: "elm.panel_area";
color: 0 0 0 0;
}
}
part { name: "bg";
type: RECT;
description { state: "default" 0.0;
- rel1.to: "panel_area";
- rel2.to: "panel_area";
+ rel1.to: "elm.panel_area";
+ rel2.to: "elm.panel_area";
color: 64 64 64 255;
visible: 0;
}
@@ -255,8 +255,8 @@ group { name: "elm/scroller/panel/top/default";
part { name: "elm.swallow.content";
type: SWALLOW;
description { state: "default" 0.0;
- rel1.to: "panel_area";
- rel2.to: "panel_area";
+ rel1.to: "elm.panel_area";
+ rel2.to: "elm.panel_area";
visible: 0;
}
description { state: "visible" 0.0;
@@ -270,8 +270,8 @@ group { name: "elm/scroller/panel/top/default";
signal: "elm,state,content,visible";
source: "elm";
action: STATE_SET "visible" 0.0;
- target: "panel_area";
- target: "event_area";
+ target: "elm.panel_area";
+ target: "elm.event_area";
target: "bg";
target: "elm.swallow.content";
}
@@ -279,8 +279,8 @@ group { name: "elm/scroller/panel/top/default";
signal: "elm,state,content,hidden";
source: "elm";
action: STATE_SET "default" 0.0;
- target: "panel_area";
- target: "event_area";
+ target: "elm.panel_area";
+ target: "elm.event_area";
target: "bg";
target: "elm.swallow.content";
}
@@ -289,7 +289,7 @@ group { name: "elm/scroller/panel/top/default";
group { name: "elm/scroller/panel/bottom/default";
parts {
- part { name: "event_area";
+ part { name: "elm.event_area";
type: SWALLOW;
description { state: "default" 0.0;
rel2.relative: 1.0 0.0;
@@ -302,16 +302,16 @@ group { name: "elm/scroller/panel/bottom/default";
visible: 1;
}
}
- part { name: "panel_area";
+ part { name: "elm.panel_area";
type: SWALLOW;
description { state: "default" 0.0;
rel1 {
relative: 0.0 1.0;
- to: "event_area";
+ to: "elm.event_area";
}
rel2 {
relative: 1.0 1.0;
- to: "event_area";
+ to: "elm.event_area";
}
align: 0.5 0.0;
fixed: 1 1;
@@ -326,16 +326,16 @@ group { name: "elm/scroller/panel/bottom/default";
type: RECT;
repeat_events: 1;
description { state: "default" 0.0;
- rel1.to: "panel_area";
- rel2.to: "panel_area";
+ rel1.to: "elm.panel_area";
+ rel2.to: "elm.panel_area";
color: 0 0 0 0;
}
}
part { name: "bg";
type: RECT;
description { state: "default" 0.0;
- rel1.to: "panel_area";
- rel2.to: "panel_area";
+ rel1.to: "elm.panel_area";
+ rel2.to: "elm.panel_area";
color: 64 64 64 255;
visible: 0;
}
@@ -347,8 +347,8 @@ group { name: "elm/scroller/panel/bottom/default";
part { name: "elm.swallow.content";
type: SWALLOW;
description { state: "default" 0.0;
- rel1.to: "panel_area";
- rel2.to: "panel_area";
+ rel1.to: "elm.panel_area";
+ rel2.to: "elm.panel_area";
visible: 0;
}
description { state: "visible" 0.0;
@@ -362,8 +362,8 @@ group { name: "elm/scroller/panel/bottom/default";
signal: "elm,state,content,visible";
source: "elm";
action: STATE_SET "visible" 0.0;
- target: "panel_area";
- target: "event_area";
+ target: "elm.panel_area";
+ target: "elm.event_area";
target: "bg";
target: "elm.swallow.content";
}
@@ -371,8 +371,8 @@ group { name: "elm/scroller/panel/bottom/default";
signal: "elm,state,content,hidden";
source: "elm";
action: STATE_SET "default" 0.0;
- target: "panel_area";
- target: "event_area";
+ target: "elm.panel_area";
+ target: "elm.event_area";
target: "bg";
target: "elm.swallow.content";
}
diff --git a/data/elementary/themes/edc/elm/photo.edc b/data/elementary/themes/edc/elm/photo.edc
index 40eb10edfa..6c5e402278 100644
--- a/data/elementary/themes/edc/elm/photo.edc
+++ b/data/elementary/themes/edc/elm/photo.edc
@@ -62,7 +62,7 @@ group { name: "elm/photo/base/shadow";
}
}
parts {
- part { name: "size"; type: SWALLOW;
+ part { name: "size"; type: SPACER;
description { state: "default" 0.0;
rel1.offset: 7 7;
rel2.offset: -8 -8;
diff --git a/data/elementary/themes/edc/elm/popup.edc b/data/elementary/themes/edc/elm/popup.edc
index a4c5f07d7e..0636602fda 100644
--- a/data/elementary/themes/edc/elm/popup.edc
+++ b/data/elementary/themes/edc/elm/popup.edc
@@ -490,7 +490,7 @@ group { name: "elm/popup/item/popup/default";
group { name: "elm/popup/base/subpopup";
inherit: "elm/popup/base/default";
parts {
- part { name: "pad.closebtn"; type: SPACER;
+ part { name: "pad_closebtn"; type: SPACER;
description { state: "default" 0.0;
rel1.to: "base";
rel1.relative: 1 0;
@@ -505,9 +505,9 @@ group { name: "elm/popup/base/subpopup";
part { name: "elm.swallow.closebtn"; type: SWALLOW;
scale: 1;
description { state: "default" 0.0;
- rel1.to: "pad.closebtn";
+ rel1.to: "pad_closebtn";
rel1.relative: 1 0;
- rel2.to: "pad.closebtn";
+ rel2.to: "pad_closebtn";
rel2.relative: 1 0;
align: 0 1;
fixed: 1 1;
diff --git a/data/elementary/themes/edc/elm/progress.edc b/data/elementary/themes/edc/elm/progress.edc
index 703fe46d7a..71291323c9 100644
--- a/data/elementary/themes/edc/elm/progress.edc
+++ b/data/elementary/themes/edc/elm/progress.edc
@@ -29,10 +29,10 @@ group { name: "elm/progressbar/horizontal/default";
}
if (ic) {
set_state(PART:"elm.swallow.content", "visible", 0.0);
- set_state(PART:"sizer.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
} else {
set_state(PART:"elm.swallow.content", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
}
if (!d) {
set_state(PART:"dis_clip", "default", 0.0);
@@ -91,7 +91,7 @@ group { name: "elm/progressbar/horizontal/default";
rel2.offset: 2 -3;
}
}
- part { name: "sizer.content"; type: TEXT; mouse_events: 0;
+ part { name: "sizer_content"; type: TEXT; mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
fixed: 1 1;
@@ -587,10 +587,10 @@ group { name: "elm/progressbar/vertical/default";
}
if (ic) {
set_state(PART:"elm.swallow.content", "visible", 0.0);
- set_state(PART:"sizer.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
} else {
set_state(PART:"elm.swallow.content", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
}
if (!d) {
set_state(PART:"dis_clip", "default", 0.0);
@@ -649,7 +649,7 @@ group { name: "elm/progressbar/vertical/default";
rel2.offset: -3 2;
}
}
- part { name: "sizer.content"; type: TEXT; mouse_events: 0;
+ part { name: "sizer_content"; type: TEXT; mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
fixed: 1 1;
diff --git a/data/elementary/themes/edc/elm/radio.edc b/data/elementary/themes/edc/elm/radio.edc
index e820f32896..6d137b8a17 100644
--- a/data/elementary/themes/edc/elm/radio.edc
+++ b/data/elementary/themes/edc/elm/radio.edc
@@ -14,14 +14,14 @@ group { name: "elm/radio/base/default";
if (m1 == (ICON | LABEL)) {
if (!d) {
set_state(PART:"elm.swallow.content", "visible", 0.0);
- set_state(PART:"sizer.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
set_state(PART:"elm.text", "visible", 0.0);
set_state(PART:"inset", "default", 0.0);
set_state(PART:"clip", "default", 0.0);
set_state(PART:"event", "default", 0.0);
} else {
set_state(PART:"elm.swallow.content", "visible", 0.0);
- set_state(PART:"sizer.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
set_state(PART:"elm.text", "disabled_visible", 0.0);
set_state(PART:"inset", "disabled", 0.0);
set_state(PART:"clip", "disabled", 0.0);
@@ -30,14 +30,14 @@ group { name: "elm/radio/base/default";
} else if (m1 == (ICON)) {
if (!d) {
set_state(PART:"elm.swallow.content", "visible", 0.0);
- set_state(PART:"sizer.content", "icononly", 0.0);
+ set_state(PART:"sizer_content", "icononly", 0.0);
set_state(PART:"elm.text", "default", 0.0);
set_state(PART:"inset", "default", 0.0);
set_state(PART:"clip", "default", 0.0);
set_state(PART:"event", "default", 0.0);
} else {
set_state(PART:"elm.swallow.content", "visible", 0.0);
- set_state(PART:"sizer.content", "icononly", 0.0);
+ set_state(PART:"sizer_content", "icononly", 0.0);
set_state(PART:"elm.text", "disabled", 0.0);
set_state(PART:"inset", "disabled", 0.0);
set_state(PART:"clip", "disabled", 0.0);
@@ -46,14 +46,14 @@ group { name: "elm/radio/base/default";
} else if (m1 == (LABEL)) {
if (!d) {
set_state(PART:"elm.swallow.content", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
set_state(PART:"elm.text", "visible", 0.0);
set_state(PART:"inset", "default", 0.0);
set_state(PART:"clip", "default", 0.0);
set_state(PART:"event", "default", 0.0);
} else {
set_state(PART:"elm.swallow.content", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
set_state(PART:"elm.text", "disabled_visible", 0.0);
set_state(PART:"inset", "disabled", 0.0);
set_state(PART:"clip", "disabled", 0.0);
@@ -62,14 +62,14 @@ group { name: "elm/radio/base/default";
} else {
if (!d) {
set_state(PART:"elm.swallow.content", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
set_state(PART:"elm.text", "default", 0.0);
set_state(PART:"inset", "default", 0.0);
set_state(PART:"clip", "default", 0.0);
set_state(PART:"event", "default", 0.0);
} else {
set_state(PART:"elm.swallow.content", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
set_state(PART:"elm.text", "default", 0.0);
set_state(PART:"inset", "disabled", 0.0);
set_state(PART:"clip", "disabled", 0.0);
@@ -142,7 +142,7 @@ group { name: "elm/radio/base/default";
min: 16 16;
}
}
- part { name: "sizer.content"; type: TEXT; mouse_events: 0;
+ part { name: "sizer_content"; type: TEXT; mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
fixed: 1 1;
diff --git a/data/elementary/themes/edc/elm/slider.edc b/data/elementary/themes/edc/elm/slider.edc
index ff19ce8ab6..9f935efa88 100644
--- a/data/elementary/themes/edc/elm/slider.edc
+++ b/data/elementary/themes/edc/elm/slider.edc
@@ -112,17 +112,17 @@ group { name: "elm/slider/horizontal/default";
}
if (ic) {
set_state(PART:"elm.swallow.icon", "visible", 0.0);
- set_state(PART:"sizer.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
} else {
set_state(PART:"elm.swallow.icon", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
}
if (e) {
set_state(PART:"elm.swallow.end", "visible", 0.0);
- set_state(PART:"sizer.content.end", "visible", 0.0);
+ set_state(PART:"sizer_content_end", "visible", 0.0);
} else {
set_state(PART:"elm.swallow.end", "default", 0.0);
- set_state(PART:"sizer.content.end", "default", 0.0);
+ set_state(PART:"sizer_content_end", "default", 0.0);
}
if (!d) {
set_state(PART:"event", "default", 0.0);
@@ -233,7 +233,7 @@ group { name: "elm/slider/horizontal/default";
rel2.offset: 2 -3;
}
}
- part { name: "sizer.content"; type: TEXT; mouse_events: 0;
+ part { name: "sizer_content"; type: TEXT; mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
fixed: 1 1;
@@ -309,7 +309,7 @@ group { name: "elm/slider/horizontal/default";
rel2.offset: -3 -3;
}
}
- part { name: "sizer.content.end"; type: TEXT; mouse_events: 0;
+ part { name: "sizer_content_end"; type: TEXT; mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
fixed: 1 1;
@@ -399,6 +399,7 @@ group { name: "elm/slider/horizontal/default";
}
}
part { name: "elm.dragable.slider"; type: RECT;
+ nomouse;
scale: 1;
dragable.x: 1 1 0;
dragable.y: 0 0 0;
@@ -415,6 +416,7 @@ group { name: "elm/slider/horizontal/default";
}
}
part { name: "knob";
+ nomouse;
description { state: "default" 0.0;
image.normal: "knob";
fixed: 1 1;
@@ -432,6 +434,7 @@ group { name: "elm/slider/horizontal/default";
}
part { name: "slideevent"; type: RECT; repeat_events: 1;
scale: 1;
+ nomouse;
ignore_flags: ON_HOLD;
dragable.events: "elm.dragable.slider";
description { state: "default" 0.0;
@@ -829,17 +832,17 @@ group { name: "elm/slider/vertical/default";
}
if (ic) {
set_state(PART:"elm.swallow.icon", "visible", 0.0);
- set_state(PART:"sizer.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
} else {
set_state(PART:"elm.swallow.icon", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
}
if (e) {
set_state(PART:"elm.swallow.end", "visible", 0.0);
- set_state(PART:"sizer.content.end", "visible", 0.0);
+ set_state(PART:"sizer_content_end", "visible", 0.0);
} else {
set_state(PART:"elm.swallow.end", "default", 0.0);
- set_state(PART:"sizer.content.end", "default", 0.0);
+ set_state(PART:"sizer_content_end", "default", 0.0);
}
if (!d) {
set_state(PART:"event", "default", 0.0);
@@ -950,7 +953,7 @@ group { name: "elm/slider/vertical/default";
rel2.offset: -3 2;
}
}
- part { name: "sizer.content"; type: TEXT; mouse_events: 0;
+ part { name: "sizer_content"; type: TEXT; mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
fixed: 1 1;
@@ -1027,7 +1030,7 @@ group { name: "elm/slider/vertical/default";
rel2.offset: -3 -3;
}
}
- part { name: "sizer.content.end"; type: TEXT; mouse_events: 0;
+ part { name: "sizer_content_end"; type: TEXT; mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
fixed: 1 1;
@@ -1120,6 +1123,7 @@ group { name: "elm/slider/vertical/default";
}
part { name: "elm.dragable.slider"; type: RECT;
scale: 1;
+ nomouse;
dragable.x: 0 0 0;
dragable.y: 1 1 0;
dragable.confine: "elm.swallow.bar";
@@ -1135,6 +1139,7 @@ group { name: "elm/slider/vertical/default";
}
}
part { name: "knob";
+ nomouse;
description { state: "default" 0.0;
image.normal: "knob";
fixed: 1 1;
@@ -1152,6 +1157,7 @@ group { name: "elm/slider/vertical/default";
}
part { name: "slideevent"; type: RECT; repeat_events: 1;
scale: 1;
+ nomouse;
ignore_flags: ON_HOLD;
dragable.events: "elm.dragable.slider";
description { state: "default" 0.0;
@@ -1577,17 +1583,17 @@ group { name: "elm/slider/range/horizontal/default";
}
if (ic) {
set_state(PART:"elm.swallow.icon", "visible", 0.0);
- set_state(PART:"sizer.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
} else {
set_state(PART:"elm.swallow.icon", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
}
if (e) {
set_state(PART:"elm.swallow.end", "visible", 0.0);
- set_state(PART:"sizer.content.end", "visible", 0.0);
+ set_state(PART:"sizer_content_end", "visible", 0.0);
} else {
set_state(PART:"elm.swallow.end", "default", 0.0);
- set_state(PART:"sizer.content.end", "default", 0.0);
+ set_state(PART:"sizer_content_end", "default", 0.0);
}
if (!d) {
set_state(PART:"event", "default", 0.0);
@@ -1724,7 +1730,7 @@ group { name: "elm/slider/range/horizontal/default";
rel2.offset: 2 -3;
}
}
- part { name: "sizer.content"; type: TEXT; mouse_events: 0;
+ part { name: "sizer_content"; type: TEXT; mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
fixed: 1 1;
@@ -1800,7 +1806,7 @@ group { name: "elm/slider/range/horizontal/default";
rel2.offset: -3 -3;
}
}
- part { name: "sizer.content.end"; type: TEXT; mouse_events: 0;
+ part { name: "sizer_content_end"; type: TEXT; mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
fixed: 1 1;
@@ -1891,6 +1897,7 @@ group { name: "elm/slider/range/horizontal/default";
}
part { name: "elm.dragable.slider"; type: RECT;
scale: 1;
+ nomouse;
dragable.x: 1 1 0;
dragable.y: 0 0 0;
dragable.confine: "elm.swallow.bar";
@@ -1906,6 +1913,7 @@ group { name: "elm/slider/range/horizontal/default";
}
}
part { name: "knob";
+ nomouse;
description { state: "default" 0.0;
image.normal: "knob";
fixed: 1 1;
@@ -1923,6 +1931,7 @@ group { name: "elm/slider/range/horizontal/default";
}
part { name: "slideevent"; type: RECT; repeat_events: 1;
scale: 1;
+ nomouse;
ignore_flags: ON_HOLD;
dragable.events: "elm.dragable.slider";
description { state: "default" 0.0;
@@ -1958,6 +1967,7 @@ group { name: "elm/slider/range/horizontal/default";
}
part { name: "elm.dragable2.slider"; type: RECT;
scale: 1;
+ nomouse;
dragable.x: 1 1 0;
dragable.y: 0 0 0;
dragable.confine: "elm.swallow.bar";
@@ -1978,6 +1988,7 @@ group { name: "elm/slider/range/horizontal/default";
}
}
part { name: "knob2";
+ nomouse;
description { state: "default" 0.0;
image.normal: "knob";
fixed: 1 1;
@@ -2000,6 +2011,7 @@ group { name: "elm/slider/range/horizontal/default";
}
part { name: "slideevent2"; type: RECT; repeat_events: 1;
scale: 1;
+ nomouse;
ignore_flags: ON_HOLD;
dragable.events: "elm.dragable2.slider";
description { state: "default" 0.0;
@@ -2361,17 +2373,17 @@ group { name: "elm/slider/range/vertical/default";
}
if (ic) {
set_state(PART:"elm.swallow.icon", "visible", 0.0);
- set_state(PART:"sizer.content", "visible", 0.0);
+ set_state(PART:"sizer_content", "visible", 0.0);
} else {
set_state(PART:"elm.swallow.icon", "default", 0.0);
- set_state(PART:"sizer.content", "default", 0.0);
+ set_state(PART:"sizer_content", "default", 0.0);
}
if (e) {
set_state(PART:"elm.swallow.end", "visible", 0.0);
- set_state(PART:"sizer.content.end", "visible", 0.0);
+ set_state(PART:"sizer_content_end", "visible", 0.0);
} else {
set_state(PART:"elm.swallow.end", "default", 0.0);
- set_state(PART:"sizer.content.end", "default", 0.0);
+ set_state(PART:"sizer_content_end", "default", 0.0);
}
if (!d) {
set_state(PART:"event", "default", 0.0);
@@ -2508,7 +2520,7 @@ group { name: "elm/slider/range/vertical/default";
rel2.offset: -3 2;
}
}
- part { name: "sizer.content"; type: TEXT; mouse_events: 0;
+ part { name: "sizer_content"; type: TEXT; mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
fixed: 1 1;
@@ -2585,7 +2597,7 @@ group { name: "elm/slider/range/vertical/default";
rel2.offset: -3 -3;
}
}
- part { name: "sizer.content.end"; type: TEXT; mouse_events: 0;
+ part { name: "sizer_content_end"; type: TEXT; mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
fixed: 1 1;
@@ -2678,6 +2690,7 @@ group { name: "elm/slider/range/vertical/default";
}
part { name: "elm.dragable.slider"; type: RECT;
scale: 1;
+ nomouse;
dragable.x: 0 0 0;
dragable.y: 1 1 0;
dragable.confine: "elm.swallow.bar";
@@ -2693,6 +2706,7 @@ group { name: "elm/slider/range/vertical/default";
}
}
part { name: "knob";
+ nomouse;
description { state: "default" 0.0;
image.normal: "knob";
fixed: 1 1;
@@ -2710,6 +2724,7 @@ group { name: "elm/slider/range/vertical/default";
}
part { name: "slideevent"; type: RECT; repeat_events: 1;
scale: 1;
+ nomouse;
ignore_flags: ON_HOLD;
dragable.events: "elm.dragable.slider";
description { state: "default" 0.0;
@@ -2745,6 +2760,7 @@ group { name: "elm/slider/range/vertical/default";
}
part { name: "elm.dragable2.slider"; type: RECT;
scale: 1;
+ nomouse;
dragable.x: 0 0 0;
dragable.y: 1 1 0;
dragable.confine: "elm.swallow.bar";
@@ -2765,6 +2781,7 @@ group { name: "elm/slider/range/vertical/default";
}
}
part { name: "knob2";
+ nomouse;
description { state: "default" 0.0;
image.normal: "knob";
fixed: 1 1;
@@ -2787,6 +2804,7 @@ group { name: "elm/slider/range/vertical/default";
}
part { name: "slideevent2"; type: RECT; repeat_events: 1;
scale: 1;
+ nomouse;
ignore_flags: ON_HOLD;
dragable.events: "elm.dragable2.slider";
description { state: "default" 0.0;
diff --git a/data/elementary/themes/edc/elm/uiclock.edc b/data/elementary/themes/edc/elm/uiclock.edc
deleted file mode 100644
index 348c2f221f..0000000000
--- a/data/elementary/themes/edc/elm/uiclock.edc
+++ /dev/null
@@ -1,207 +0,0 @@
-#define DATETIME_FIELD(_pos) \
- part { \
- name: "field"#_pos; type: SWALLOW; \
- scale: 1; \
- clip_to: "clip"; \
- description { state: "default" 0.0; \
- visible: 0; \
- min: 0 0; \
- align: 0.0 0.5; \
- fixed: 1 1; \
- rel1.relative: 1.0 0.0; \
- rel1.to: "separator"#_pos; \
- rel2.relative: 1.0 1.0; \
- rel2.to: "separator"#_pos; \
- } \
- description { state: "enable" 0.0; \
- inherit: "default" 0.0; \
- visible: 1; \
- min: 8 10; \
- } \
- } \
- programs{ \
- program { name: "field_"#_pos"enabled"; \
- signal: "field"#_pos",enable"; source: "elm"; \
- action: STATE_SET "enable" 0.0; \
- target: "field"#_pos; \
- } \
- program { name: "field_"#_pos"disabled"; \
- signal: "field"#_pos",disable"; source: "elm"; \
- action: STATE_SET "default" 0.0; \
- target: "field"#_pos; \
- } \
- }
-#define DATETIME_SEPARATOR(_pos, _after) \
- part { \
- name: "separator"#_pos; type: TEXT; \
- scale: 1; \
- effect: SHADOW BOTTOM; \
- clip_to: "disclip"; \
- description { state: "default" 0.0; \
- visible: 0; \
- min: 0 0; \
- align: 0.0 0.5; \
- fixed: 1 0; \
- rel1 { \
- relative: 1.0 0.0; \
- to: "field"#_after; \
- } \
- rel2 { \
- relative: 1.0 1.0; \
- to: "field"#_after; \
- } \
- color_class: "datetime_separator_text"; \
- text { \
- font: "Sans"; size: 10; \
- min: 1 0; \
- ellipsis: -1; \
- align: 0.5 0.5; \
- text_class: "datetime_separator_text"; \
- } \
- } \
- description { state: "enable" 0.0; \
- inherit: "default" 0.0; \
- visible: 1; \
- min: 8 10; \
- } \
- } \
- part { \
- name: "separator"#_pos"d"; type: TEXT; \
- scale: 1; \
- effect: SHADOW BOTTOM; \
- clip_to: "disclip2"; \
- description { state: "default" 0.0; \
- visible: 0; \
- rel1.to: "separator"#_pos; \
- rel2.to: "separator"#_pos; \
- color_class: "datetime_separator_text_disabled"; \
- text { \
- text_source: "separator"#_pos; \
- font: "Sans"; size: 10; \
- text_class: "datetime_separator_text_disabled"; \
- } \
- } \
- description { state: "enable" 0.0; \
- inherit: "default" 0.0; \
- visible: 1; \
- } \
- } \
- programs { \
- program { \
- signal: "field"#_after",enable"; source: "elm"; \
- action: STATE_SET "enable" 0.0; \
- target: "separator"#_pos; \
- target: "separator"#_pos"d"; \
- } \
- program { \
- signal: "field"#_after",disable"; source: "elm"; \
- action: STATE_SET "default" 0.0; \
- target: "separator"#_pos; \
- target: "separator"#_pos"d"; \
- } \
- }
-group { name: "elm/uiclock/base/default";
- parts {
- part { name: "bg"; type: RECT;
- description { state: "default" 0.0;
- color_class: "datetime_bg";
- }
- }
- part { name: "clip"; type: RECT;
- description { state: "default" 0.0;
- rel1.to: "separator0";
- rel2.to: "separator7";
- }
- }
- part { name: "disclip"; type: RECT;
- clip_to: "clip";
- description { state: "default" 0.0;
- rel1.to: "separator0";
- rel2.to: "separator7";
- }
- description { state: "disabled" 0.0;
- inherit: "default" 0.0;
- visible: 0;
- }
- }
- part { name: "disclip2"; type: RECT;
- clip_to: "clip";
- description { state: "default" 0.0;
- rel1.to: "separator0";
- rel2.to: "separator7";
- visible: 0;
- }
- description { state: "disabled" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- }
- }
- part { name: "separator0"; type: SPACER;
- scale: 1;
- description { state: "default" 0.0;
- min: 8 10;
- align: 0.0 0.5;
- fixed: 1 0;
- rel2.relative: 0.0 1.0;
- }
- }
- DATETIME_FIELD(0)
- DATETIME_SEPARATOR(1,0)
- DATETIME_FIELD(1)
- DATETIME_SEPARATOR(2,1)
- DATETIME_FIELD(2)
- DATETIME_SEPARATOR(3,2)
- DATETIME_FIELD(3)
- DATETIME_SEPARATOR(4,3)
- DATETIME_FIELD(4)
- DATETIME_SEPARATOR(5,4)
- DATETIME_FIELD(5)
- DATETIME_SEPARATOR(6,5)
- DATETIME_FIELD(6)
- DATETIME_SEPARATOR(7,6)
- DATETIME_FIELD(7)
- DATETIME_SEPARATOR(8,7)
- part { name: "separator9"; type: SPACER;
- description { state: "default" 0.0;
- rel1.to: "separator7";
- rel1.relative: 1.0 0.0;
- min: 8 10;
- }
- }
- part { name: "discover"; type: RECT;
- description { state: "default" 0.0;
- rel1.to: "separator0";
- rel2.to: "separator7";
- visible: 0;
- color: 0 0 0 0;
- }
- description { state: "disabled" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- }
- }
- part { name: "elm.access"; type: RECT; repeat_events: 1;
- description { state: "default" 0.0;
- color: 0 0 0 0;
- }
- }
- }
- programs {
- program {
- signal: "elm,state,disabled"; source: "elm";
- action: STATE_SET "disabled" 0.0;
- target: "disclip";
- target: "disclip2";
- target: "discover";
- }
- program {
- signal: "elm,state,enabled"; source: "elm";
- action: STATE_SET "default" 0.0;
- target: "disclip";
- target: "disclip2";
- target: "discover";
- }
- }
-}
-#undef DATETIME_SEPARATOR
-#undef DATETIME_FIELD
diff --git a/data/elementary/themes/edc/fileman.edc b/data/elementary/themes/edc/fileman.edc
index 3dd3ac0305..6305e2ed02 100644
--- a/data/elementary/themes/edc/fileman.edc
+++ b/data/elementary/themes/edc/fileman.edc
@@ -2058,7 +2058,8 @@ group { name: "e/fileman/default/progress";
}
}
-group { name: "modules/efm_navigation/main";
+group { name: "e/modules/efm_navigation/main";
+ alias: "modules/efm_navigation/main";
images.image: "shadow_inset_light.png" COMP;
images.image: "shadow_angled_in_light.png" COMP;
images.image: "sym_left_light_normal.png" COMP;
@@ -2214,7 +2215,8 @@ group { name: "modules/efm_navigation/main";
}
}
-group { name: "modules/efm_navigation/pathbar_button";
+group { name: "e/modules/efm_navigation/pathbar_button";
+ alias: "modules/efm_navigation/pathbar_button";
images.image: "horizontal_separated_bar_small_glow.png" COMP;
parts {
part { name: "e.text.label"; type: TEXT; mouse_events: 0;
@@ -2302,7 +2304,8 @@ group { name: "modules/efm_navigation/pathbar_button";
}
}
-group { name: "modules/efm_navigation/pathbar_scrollframe";
+group { name: "e/modules/efm_navigation/pathbar_scrollframe";
+ alias: "modules/efm_navigation/pathbar_scrollframe";
images.image: "sym_left_light_normal.png" COMP;
images.image: "sym_right_light_normal.png" COMP;
images.image: "sym_left_glow_normal.png" COMP;
diff --git a/data/elementary/themes/edc/illume.edc b/data/elementary/themes/edc/illume.edc
index 54d8818d57..3e71c97197 100644
--- a/data/elementary/themes/edc/illume.edc
+++ b/data/elementary/themes/edc/illume.edc
@@ -471,7 +471,8 @@ group { name: "e/modules/illume_mode_toggle/main";
}
}
-group { name: "modules/illume-indicator/window";
+group { name: "e/modules/illume-indicator/window";
+ alias: "modules/illume-indicator/window";
data {
// item: "shaped" "1";
}
@@ -564,7 +565,8 @@ group { name: "modules/illume-indicator/window";
}
}
-group { name: "modules/illume-softkey/window";
+group { name: "e/modules/illume-softkey/window";
+ alias: "modules/illume-softkey/window";
data {
// item: "shaped" "1";
}
diff --git a/data/elementary/themes/edc/init.edc b/data/elementary/themes/edc/init.edc
index 630b714a51..630ff20c9b 100644
--- a/data/elementary/themes/edc/init.edc
+++ b/data/elementary/themes/edc/init.edc
@@ -385,14 +385,13 @@ group { name: "e/init/splash";
}
}
programs {
- program {
- signal: "load"; source: "";
+ program { signal: "load"; source: "";
script {
set_int(is_ready, 0);
set_int(do_end, 0);
}
}
-
+
#define PROG(_NAME) \
program { name: _NAME"0"; \
signal: "show"; source: ""; \
@@ -460,8 +459,7 @@ group { name: "e/init/splash";
PROG("l+3")
#undef PROG
- program {
- signal: "show"; source: "";
+ program { signal: "show"; source: "";
action: STATE_SET "visible" 0.0;
transition: DECELERATE 1.0;
target: "shadow";
@@ -491,19 +489,16 @@ group { name: "e/init/splash";
set_int(is_ready, 1);
}
}
- program {
- signal: "e,state,done"; source: "e";
+ program { signal: "e,state,done"; source: "e";
script {
new val;
+ set_int(do_end, 1);
val = get_int(is_ready);
if (val == 1)
run_program(PROGRAM:"exit1");
- else
- set_int(do_end, 1);
}
}
program { name: "exit1";
- signal: "e,state,done"; source: "e";
action: STATE_SET "default" 0.0;
transition: SINUSOIDAL 1.0 CURRENT;
target: "shadow";
@@ -520,6 +515,10 @@ group { name: "e/init/extra_screen";
images.image: "screen_circular_shadow.png" COMP;
images.image: "bg_radgrad.png" COMP;
images.image: "dot_pattern.png" COMP;
+ script {
+ public is_ready;
+ public do_end;
+ }
parts {
part { name: "clip"; type: RECT; mouse_events: 0;
description { state: "default" 0.0;
@@ -574,6 +573,36 @@ group { name: "e/init/extra_screen";
transition: DECELERATE 1.0;
target: "shadow";
target: "blanker";
+ after: "ready";
}
+ program { name: "ready";
+ script {
+ new val;
+ val = get_int(do_end);
+ if (val == 1)
+ run_program(PROGRAM:"exit1");
+ else
+ set_int(is_ready, 1);
+ }
+ }
+ program { signal: "e,state,done"; source: "e";
+ script {
+ new val;
+ set_int(do_end, 1);
+ val = get_int(is_ready);
+ if (val == 1)
+ run_program(PROGRAM:"exit1");
+ }
+ }
+ program { name: "exit1";
+ action: STATE_SET "default" 0.0;
+ transition: SINUSOIDAL 1.0 CURRENT;
+ target: "shadow";
+ target: "blanker";
+ after: "exit2";
+ }
+ program { name: "exit2";
+ action: SIGNAL_EMIT "e,state,done_ok" "e";
+ }
}
}
diff --git a/data/elementary/themes/edc/music_control.edc b/data/elementary/themes/edc/music_control.edc
index f9d29b4726..11870eca72 100644
--- a/data/elementary/themes/edc/music_control.edc
+++ b/data/elementary/themes/edc/music_control.edc
@@ -27,6 +27,9 @@ group { name: "e/modules/music-control/main";
group { name: "e/modules/music-control/popup";
alias: "modules/music-control/popup";
+#ifdef SKIP_NAMESPACE_VALIDATION
+ skip_namespace_validation: 1;
+#endif
min: 150 50;
images.image: "icon_prev.png" COMP;
images.image: "icon_next.png" COMP;
@@ -48,6 +51,7 @@ group { name: "e/modules/music-control/popup";
}
}
parts {
+ alias: "cover_swallow" "e.cover_swallow";
part { name: "cover_bg";
description { state: "default" 0;
min: 90 90;
@@ -56,7 +60,7 @@ group { name: "e/modules/music-control/popup";
image.normal: "music_control_icon.png";
}
}
- part { name: "cover_swallow"; type: SWALLOW;
+ part { name: "e.cover_swallow"; type: SWALLOW;
description { state: "default" 0;
rel1.to: "cover_bg";
rel2.to: "cover_bg";
diff --git a/data/elementary/themes/edc/notification.edc b/data/elementary/themes/edc/notification.edc
index ae93d03ba4..63a401b1d3 100644
--- a/data/elementary/themes/edc/notification.edc
+++ b/data/elementary/themes/edc/notification.edc
@@ -11,7 +11,8 @@ group { name: "e/modules/notification/logo";
}
}
-group { name: "e/modules/notification/main";
+group { name: "notification/main";
+ alias: "e/modules/notification/main";
images.image: "darken_square.png" COMP;
images.image: "sym_close_light_normal.png" COMP;
images.image: "sym_close_light_selected.png" COMP;
@@ -45,6 +46,7 @@ group { name: "e/modules/notification/main";
}
parts {
+ alias: "e.event.close" "notification.event.close";
part { name: "base";
description { state: "default" 0.0;
image.normal: "darken_square.png";
@@ -128,7 +130,7 @@ group { name: "e/modules/notification/main";
image.normal: "sym_close_light_selected.png";
}
}
- part { name: "e.event.close"; type: RECT;
+ part { name: "notification.event.close"; type: RECT;
scale: 1;
description { state: "default" 0.0;
rel1.relative: 1.0 0.0;
diff --git a/data/elementary/themes/edc/systray.edc b/data/elementary/themes/edc/systray.edc
index 93f17667c5..fefe075de2 100644
--- a/data/elementary/themes/edc/systray.edc
+++ b/data/elementary/themes/edc/systray.edc
@@ -5,6 +5,7 @@ group { name: "e/modules/systray/main";
data.item: "inset" "64 64 64";
data.item: "plain" "64 64 64";
parts {
+ alias: "box" "e.box";
part { name: "base"; type: RECT;
description { state: "default" 0.0;
color: 0 0 0 0;
@@ -15,7 +16,7 @@ group { name: "e/modules/systray/main";
color: 255 0 0 128;
}
}
- part { name: "box"; type: BOX;
+ part { name: "e.box"; type: BOX;
description { state: "default" 0.0;
align: 0 0;
box {
@@ -38,72 +39,72 @@ group { name: "e/modules/systray/main";
program {
signal: "e,action,orient,horiz"; source: "e";
action: STATE_SET "default" 0.0;
- target: "box";
+ target: "e.box";
}
program {
signal: "e,action,orient,vert"; source: "e";
action: STATE_SET "vertical" 0.0;
- target: "box";
+ target: "e.box";
}
program {
signal: "e,action,orient,left"; source: "e";
action: STATE_SET "vertical" 0.0;
- target: "box";
+ target: "e.box";
}
program {
signal: "e,action,orient,right"; source: "e";
action: STATE_SET "vertical" 0.0;
- target: "box";
+ target: "e.box";
}
program {
signal: "e,action,orient,top"; source: "e";
action: STATE_SET "default" 0.0;
- target: "box";
+ target: "e.box";
}
program {
signal: "e,action,orient,bottom"; source: "e";
action: STATE_SET "default" 0.0;
- target: "box";
+ target: "e.box";
}
program {
signal: "e,action,orient,corner_tl"; source: "e";
action: STATE_SET "default" 0.0;
- target: "box";
+ target: "e.box";
}
program {
signal: "e,action,orient,corner_tr"; source: "e";
action: STATE_SET "default" 0.0;
- target: "box";
+ target: "e.box";
}
program {
signal: "e,action,orient,corner_bl"; source: "e";
action: STATE_SET "default" 0.0;
- target: "box";
+ target: "e.box";
}
program {
signal: "e,action,orient,corner_br"; source: "e";
action: STATE_SET "default" 0.0;
- target: "box";
+ target: "e.box";
}
program {
signal: "e,action,orient,corner_lt"; source: "e";
action: STATE_SET "vertical" 0.0;
- target: "box";
+ target: "e.box";
}
program {
signal: "e,action,orient,corner_rt"; source: "e";
action: STATE_SET "vertical" 0.0;
- target: "box";
+ target: "e.box";
}
program {
signal: "e,action,orient,corner_lb"; source: "e";
action: STATE_SET "vertical" 0.0;
- target: "box";
+ target: "e.box";
}
program {
signal: "e,action,orient,corner_rb"; source: "e";
action: STATE_SET "vertical" 0.0;
- target: "box";
+ target: "e.box";
}
}
-} \ No newline at end of file
+}
diff --git a/data/elementary/themes/fdo/index.theme b/data/elementary/themes/fdo/index.theme
index cc96656e44..d1b1e2f9d3 100644
--- a/data/elementary/themes/fdo/index.theme
+++ b/data/elementary/themes/fdo/index.theme
@@ -2,7 +2,7 @@
Name=Enlightenment-X
Inherits=Mint-X,RAVE-X,Faenza,hicolor
Comment=The Enlightenment-X Icon theme. Orig. based on Rave-X, Mint-X and Faenza Icon Themes.
-Directories=actions/128,status/128,places/128,places/16,devices/128,emblems/96,categories/128,categories/16,apps/64,intl/128
+Directories=actions/128,status/128,places/128,places/16,devices/128,emblems/96,categories/128,categories/16,apps/64,intl/128,mimetypes/16,mimetypes/128
Example=folder-home
@@ -75,3 +75,17 @@ Context=International
Type=Scalable
MinSize=16
MaxSize=256
+
+[mimetypes/128]
+Size=128
+Context=MimeTypes
+Type=Scalable
+MinSize=23
+MaxSize=256
+
+[mimetypes/16]
+Size=16
+Context=MimeTypes
+Type=Scalable
+MinSize=16
+MaxSize=22
diff --git a/data/elementary/themes/fdo/mimetypes/128/inode-directory.png b/data/elementary/themes/fdo/mimetypes/128/inode-directory.png
new file mode 100644
index 0000000000..e877858b4c
--- /dev/null
+++ b/data/elementary/themes/fdo/mimetypes/128/inode-directory.png
Binary files differ
diff --git a/data/elementary/themes/fdo/mimetypes/16/inode-directory.png b/data/elementary/themes/fdo/mimetypes/16/inode-directory.png
new file mode 100644
index 0000000000..d2f27d6e16
--- /dev/null
+++ b/data/elementary/themes/fdo/mimetypes/16/inode-directory.png
Binary files differ
diff --git a/m4/efl.m4 b/m4/efl.m4
index 4b896eda88..0514ba04e1 100644
--- a/m4/efl.m4
+++ b/m4/efl.m4
@@ -427,7 +427,7 @@ m4_defn([UP])_LIBS=" ${m4_defn([UP])_LDFLAGS} ${EFLALL_COV_LIBS} ${EFLALL_LIBS}
m4_defn([UP])_INTERNAL_LIBS="${m4_defn([UP])_INTERNAL_LIBS} ${requirements_internal_libs_[]m4_defn([DOWN])}"
USE_[]m4_defn([UP])_LIBS="${m4_defn([UP])_LIBS} lib/${libdirname}/lib${libname}.la"
USE_[]m4_defn([UP])_INTERNAL_LIBS="${m4_defn([UP])_INTERNAL_LIBS} lib/${libdirname}/lib${libname}.la"
-m4_defn([UP])_CFLAGS="${EFL_WINDOWS_VERSION_CFLAGS} ${EFLALL_COV_CFLAGS} ${EFLALL_CFLAGS} ${m4_defn([UP])_CFLAGS} -I\$(top_srcdir)/src/lib/${libdirname} -I\$(top_builddir)/src/lib/${libdirname} -I\$(top_srcdir)/src/bindings/cxx/${libdirname} -I\$(top_builddir)/src/bindings/${libdirname} ${requirements_cflags_[]m4_defn([DOWN])} ${requirements_cflags_eflall} -DEFL_[]m4_defn([UP])_BUILD=1"
+m4_defn([UP])_CFLAGS="${EFL_WINDOWS_VERSION_CFLAGS} ${EFLALL_COV_CFLAGS} ${EFLALL_CFLAGS} ${m4_defn([UP])_CFLAGS} -I\$(top_srcdir)/src/lib/${libdirname} -I\$(top_builddir)/src/lib/${libdirname} -I\$(top_srcdir)/src/bindings/cxx/${libdirname} -I\$(top_builddir)/src/bindings/${libdirname} ${requirements_cflags_[]m4_defn([DOWN])} ${requirements_cflags_eflall} -DEFL_BUILD=1"
requirements_pc_[]m4_defn([DOWN])="${requirements_pc_[]m4_defn([DOWN])} ${requirements_pc_eflall}"
requirements_pc_deps_[]m4_defn([DOWN])="${requirements_pc_deps_[]m4_defn([DOWN])} ${requirements_pc_deps_eflall}"
diff --git a/m4/efl_find_x.m4 b/m4/efl_find_x.m4
index dad401fcf8..8c9f5c3677 100644
--- a/m4/efl_find_x.m4
+++ b/m4/efl_find_x.m4
@@ -120,6 +120,7 @@ AC_DEFUN([EFL_FIND_X],
efl_x11_lib=
fi
done
+ efl_x11_modules="$efl_x11_modules x11-xcb"
PKG_CHECK_EXISTS([$efl_x11_modules],
[
diff --git a/pc/efl-mono.pc.in b/pc/efl-mono.pc.in
index 8b4a147af3..2dfafea23f 100644
--- a/pc/efl-mono.pc.in
+++ b/pc/efl-mono.pc.in
@@ -5,11 +5,14 @@ includedir=@includedir@
datarootdir=@datarootdir@
datadir=@datadir@
+assemblies_dir=@eflmonodlldir@
+Libraries=${assemblies_dir}/libefl_mono.dll
+
#variable to be used with meson
-mono_libs=-r:@prefix@/bin/libefl_mono.dll
+mono_libs=-r:${assemblies_dir}/libefl_mono.dll
Name: EFL-Mono
Description: EFL's C-Sharp bindings
Version: @PACKAGE_VERSION@
-Libs: -r:${prefix}/bin/libefl_mono.dll
+Libs: -r:${assemblies_dir}/libefl_mono.dll
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 06b1e60a02..bcd0447360 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -49,6 +49,7 @@ src/bin/elementary/test_panes.c
src/bin/elementary/test_photo.c
src/bin/elementary/test_photocam.c
src/bin/elementary/test_progressbar.c
+src/bin/elementary/test_ui_progressbar.c
src/bin/elementary/test_radio.c
src/bin/elementary/test_scaling.c
src/bin/elementary/test_scroller.c
@@ -96,7 +97,7 @@ src/lib/elementary/elc_fileselector.c
src/lib/elementary/elc_fileselector_button.c
src/lib/elementary/elc_fileselector_entry.c
src/lib/elementary/elc_hoversel.c
-src/lib/elementary/efl_ui_multibuttonentry.c
+src/lib/elementary/elc_multibuttonentry.c
src/lib/elementary/elc_naviframe.c
src/lib/elementary/elc_player.c
src/lib/elementary/elc_popup.c
@@ -111,7 +112,6 @@ src/lib/elementary/elm_calendar.c
src/lib/elementary/efl_ui_calendar.c
src/lib/elementary/efl_ui_check.c
src/lib/elementary/elm_clock.c
-src/lib/elementary/elm_cnp.c
src/lib/elementary/elm_colorselector.c
src/lib/elementary/elm_config.c
src/lib/elementary/elm_conform.c
@@ -137,7 +137,7 @@ src/lib/elementary/elm_index.c
src/lib/elementary/elm_interface_scrollable.c
src/lib/elementary/elm_inwin.c
src/lib/elementary/elm_label.c
-src/lib/elementary/efl_ui_layout.c
+src/lib/elementary/efl_ui_layout_object.c
src/lib/elementary/elm_list.c
src/lib/elementary/elm_main.c
src/lib/elementary/elm_map.c
@@ -174,7 +174,7 @@ src/lib/elementary/elm_transit.c
src/lib/elementary/elm_util.c
src/lib/elementary/efl_ui_video.c
src/lib/elementary/elm_web2.c
-src/lib/elementary/elm_widget.c
+src/lib/elementary/efl_ui_widget.c
src/lib/elementary/efl_ui_win.c
src/lib/elementary/els_box.c
src/lib/elementary/els_cursor.c
diff --git a/po/ca.po b/po/ca.po
index 4c554e339f..a0f203b54a 100644
--- a/po/ca.po
+++ b/po/ca.po
@@ -4,12 +4,12 @@
# Marc Furtià i Puig <marc.furtia@gmail.com>, 2013.
# Joan Coll <jcoll2@gmail.com>, 2013.
#
-#: src/lib/elementary/elm_config.c:4086
+#: src/lib/elementary/elm_config.c:4164
msgid ""
msgstr ""
"Project-Id-Version: Elementary\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2017-12-20 00:20+0900\n"
+"POT-Creation-Date: 2018-07-09 16:07+0900\n"
"PO-Revision-Date: 2015-02-10 09:34+0000\n"
"Last-Translator: JoanColl <Unknown>\n"
"Language-Team: Catalan\n"
@@ -240,172 +240,172 @@ msgstr "Imatges"
msgid "Videos"
msgstr "Vídeos"
-#: src/lib/elementary/elc_fileselector.c:1907
+#: src/lib/elementary/elc_fileselector.c:1798
msgid "Up"
msgstr "Amunt"
-#: src/lib/elementary/elc_fileselector.c:1921
+#: src/lib/elementary/elc_fileselector.c:1812
msgid "Home"
msgstr "Carpeta personal"
-#: src/lib/elementary/elc_fileselector.c:1940
+#: src/lib/elementary/elc_fileselector.c:1831
msgid "Search"
msgstr "Cerca"
-#: src/lib/elementary/elc_fileselector.c:2232
+#: src/lib/elementary/elc_fileselector.c:2107
msgid "OK"
msgstr "Accepta"
-#: src/lib/elementary/elc_fileselector.c:2242
-#: src/lib/elementary/elm_entry.c:1719 src/lib/elementary/elm_entry.c:1744
+#: src/lib/elementary/elc_fileselector.c:2117
+#: src/lib/elementary/elm_entry.c:1733 src/lib/elementary/elm_entry.c:1758
msgid "Cancel"
msgstr "Cancel·la"
-#: src/lib/elementary/elc_hoversel.c:436 src/lib/elementary/efl_ui_button.c:263
-#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/elm_gengrid.c:1483
-#: src/lib/elementary/elm_genlist.c:1750 src/lib/elementary/elm_list.c:2157
-#: src/lib/elementary/efl_ui_radio.c:198
+#: src/lib/elementary/elc_hoversel.c:438 src/lib/elementary/efl_ui_button.c:208
+#: src/lib/elementary/efl_ui_check.c:188 src/lib/elementary/elm_gengrid.c:1511
+#: src/lib/elementary/elm_genlist.c:1759 src/lib/elementary/elm_list.c:2172
+#: src/lib/elementary/efl_ui_radio.c:201
#: src/lib/elementary/elm_segment_control.c:529
-#: src/lib/elementary/elm_spinner.c:1031 src/lib/elementary/elm_toolbar.c:2276
+#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2281
msgid "State: Disabled"
msgstr "Estat: desactivat"
-#: src/lib/elementary/elc_hoversel.c:638
+#: src/lib/elementary/elc_hoversel.c:651
msgid "Hoversel"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:675
+#: src/lib/elementary/elc_multibuttonentry.c:682
msgid "multi button entry label"
msgstr "etiqueta d'entrada múltiple"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:697
+#: src/lib/elementary/elc_multibuttonentry.c:704
msgid "multi button entry item"
msgstr "element entrada múltiple"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:1579
+#: src/lib/elementary/elc_multibuttonentry.c:1586
msgid "multi button entry"
msgstr "entrada múltiple"
-#: src/lib/elementary/elc_naviframe.c:433
-#: src/lib/elementary/elc_naviframe.c:461
+#: src/lib/elementary/elc_naviframe.c:435
+#: src/lib/elementary/elc_naviframe.c:463
msgid "Title"
msgstr "Títol"
-#: src/lib/elementary/elc_naviframe.c:440
+#: src/lib/elementary/elc_naviframe.c:442
#, fuzzy
msgid "Subtitle"
msgstr "Títol"
-#: src/lib/elementary/elc_naviframe.c:1027
-#: src/lib/elementary/elc_naviframe.c:1245
+#: src/lib/elementary/elc_naviframe.c:1029
+#: src/lib/elementary/elc_naviframe.c:1247
msgid "Back"
msgstr "Enrere"
-#: src/lib/elementary/elc_naviframe.c:1343
+#: src/lib/elementary/elc_naviframe.c:1345
msgid "Next"
msgstr "Següent"
-#: src/lib/elementary/elc_popup.c:305 src/lib/elementary/elc_popup.c:969
+#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992
msgid "Popup Title"
msgstr "Títol finestra emergent"
-#: src/lib/elementary/elc_popup.c:315 src/lib/elementary/elc_popup.c:1045
+#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068
msgid "Popup Body Text"
msgstr "Text de la finestra emergent"
-#: src/lib/elementary/elc_popup.c:1820
+#: src/lib/elementary/elc_popup.c:1841
msgid "Alert"
msgstr ""
-#: src/lib/elementary/elm_bubble.c:162
+#: src/lib/elementary/elm_bubble.c:163
msgid "Bubble"
msgstr "Bombolla"
-#: src/lib/elementary/efl_ui_button.c:70
+#: src/lib/elementary/efl_ui_button.c:71
msgid "Clicked"
msgstr "Clicat"
-#: src/lib/elementary/efl_ui_button.c:290
+#: src/lib/elementary/efl_ui_button.c:250
msgid "Button"
msgstr "Botó"
-#: src/lib/elementary/elm_calendar.c:228
+#: src/lib/elementary/elm_calendar.c:244
#: src/lib/elementary/efl_ui_calendar.c:198
msgid "%B %Y"
msgstr "%B %Y"
-#: src/lib/elementary/elm_calendar.c:234
+#: src/lib/elementary/elm_calendar.c:250
msgid "%B"
msgstr "%B"
-#: src/lib/elementary/elm_calendar.c:240
+#: src/lib/elementary/elm_calendar.c:256
msgid "%Y"
msgstr "%Y"
-#: src/lib/elementary/elm_calendar.c:365
+#: src/lib/elementary/elm_calendar.c:382
#: src/lib/elementary/efl_ui_calendar.c:245
msgid "calendar item"
msgstr "element de calendari"
-#: src/lib/elementary/elm_calendar.c:392
+#: src/lib/elementary/elm_calendar.c:410
#: src/lib/elementary/efl_ui_calendar.c:272
msgid "calendar decrement month button"
msgstr "botó decrement de mes"
-#: src/lib/elementary/elm_calendar.c:398
+#: src/lib/elementary/elm_calendar.c:416
msgid "calendar decrement year button"
msgstr "botó decrement d'any"
-#: src/lib/elementary/elm_calendar.c:404
+#: src/lib/elementary/elm_calendar.c:422
#: src/lib/elementary/efl_ui_calendar.c:278
msgid "calendar increment month button"
msgstr "botó increment de mes"
-#: src/lib/elementary/elm_calendar.c:410
+#: src/lib/elementary/elm_calendar.c:428
msgid "calendar increment year button"
msgstr "botó increment d'any"
-#: src/lib/elementary/elm_calendar.c:415
+#: src/lib/elementary/elm_calendar.c:433
#: src/lib/elementary/efl_ui_calendar.c:283
msgid "calendar month"
msgstr "mes del calendari"
-#: src/lib/elementary/elm_calendar.c:420
+#: src/lib/elementary/elm_calendar.c:438
#: src/lib/elementary/efl_ui_calendar.c:286
msgid "calendar year"
msgstr "any del calendari"
-#: src/lib/elementary/efl_ui_check.c:65 src/lib/elementary/efl_ui_check.c:210
-#: src/lib/elementary/efl_ui_radio.c:120 src/lib/elementary/efl_ui_radio.c:199
+#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201
+#: src/lib/elementary/efl_ui_radio.c:136 src/lib/elementary/efl_ui_radio.c:202
msgid "State: On"
msgstr "Estat: activat"
-#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:222
-#: src/lib/elementary/efl_ui_radio.c:201
+#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:213
+#: src/lib/elementary/efl_ui_radio.c:204
msgid "State: Off"
msgstr "Estat: desactivat"
-#: src/lib/elementary/efl_ui_check.c:206 src/lib/elementary/efl_ui_check.c:219
+#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210
msgid "State"
msgstr "Estat"
-#: src/lib/elementary/efl_ui_check.c:340
+#: src/lib/elementary/efl_ui_check.c:355
msgid "Check"
msgstr "Comprova"
-#: src/lib/elementary/elm_clock.c:304
+#: src/lib/elementary/elm_clock.c:309
msgid "clock increment button for am,pm"
msgstr "botó increment de rellotge per am,pm"
-#: src/lib/elementary/elm_clock.c:312
+#: src/lib/elementary/elm_clock.c:317
msgid "clock decrement button for am,pm"
msgstr "botó decrement de rellotge per am,pm"
-#: src/lib/elementary/elm_clock.c:691
+#: src/lib/elementary/elm_clock.c:714
msgid "State: Editable"
msgstr "Estat: Editable"
-#: src/lib/elementary/elm_clock.c:726
+#: src/lib/elementary/elm_clock.c:749
msgid "Clock"
msgstr "Rellotge"
@@ -429,7 +429,7 @@ msgstr "B:"
msgid "A:"
msgstr "A:"
-#: src/lib/elementary/elm_colorselector.c:1706
+#: src/lib/elementary/elm_colorselector.c:1707
msgid "color selector palette item"
msgstr "paleta de selecció de color"
@@ -439,11 +439,11 @@ msgstr "paleta de selecció de color"
#. but if this is a right-to-left language like arabic, Farsi,
#. Hebrew, etc. then change this string to be "default:RTL"
#.
-#: src/lib/elementary/elm_config.c:4109
+#: src/lib/elementary/elm_config.c:4187
msgid "default:LTR"
msgstr "default:LTR"
-#: src/lib/elementary/elm_dayselector.c:402
+#: src/lib/elementary/elm_dayselector.c:437
msgid "day selector item"
msgstr "selector de dia"
@@ -451,27 +451,27 @@ msgstr "selector de dia"
msgid "diskselector item"
msgstr "selector de disc"
-#: src/lib/elementary/elm_entry.c:1709
+#: src/lib/elementary/elm_entry.c:1723
msgid "Cut"
msgstr "Retalla"
-#: src/lib/elementary/elm_entry.c:1712
+#: src/lib/elementary/elm_entry.c:1726
msgid "Copy"
msgstr "Copia"
-#: src/lib/elementary/elm_entry.c:1716 src/lib/elementary/elm_entry.c:1738
+#: src/lib/elementary/elm_entry.c:1730 src/lib/elementary/elm_entry.c:1752
msgid "Paste"
msgstr "Enganxa"
-#: src/lib/elementary/elm_entry.c:1731
+#: src/lib/elementary/elm_entry.c:1745
msgid "Select"
msgstr "Selecciona"
-#: src/lib/elementary/elm_entry.c:3831
+#: src/lib/elementary/elm_entry.c:3894
msgid "Entry"
msgstr "Entrada"
-#: src/lib/elementary/elm_gengrid.c:1513
+#: src/lib/elementary/elm_gengrid.c:1541
msgid "Gengrid Item"
msgstr "Quadrícula genèrica"
@@ -483,40 +483,40 @@ msgstr "Índex"
msgid "Index Item"
msgstr "Element d'índex"
-#: src/lib/elementary/elm_label.c:405
+#: src/lib/elementary/elm_label.c:403
msgid "Label"
msgstr "Etiqueta"
-#: src/lib/elementary/elm_panel.c:83
+#: src/lib/elementary/elm_panel.c:84
msgid "state: opened"
msgstr "estat: obert"
-#: src/lib/elementary/elm_panel.c:84
+#: src/lib/elementary/elm_panel.c:85
msgid "state: closed"
msgstr "estat: tancat"
-#: src/lib/elementary/elm_panel.c:124
+#: src/lib/elementary/elm_panel.c:127
msgid "A panel is open"
msgstr "Hi ha un tauler obert"
-#: src/lib/elementary/elm_panel.c:126
+#: src/lib/elementary/elm_panel.c:129
msgid "Double tap to close panel menu"
msgstr "Feu doble clic per tancar el menú del tauler"
-#: src/lib/elementary/elm_panel.c:178
+#: src/lib/elementary/elm_panel.c:181
msgid "panel button"
msgstr "botó del tauler"
-#: src/lib/elementary/efl_ui_progressbar.c:393
+#: src/lib/elementary/efl_ui_progressbar.c:397
msgid "progressbar"
msgstr "barra de progrés"
-#: src/lib/elementary/efl_ui_radio.c:224
+#: src/lib/elementary/efl_ui_radio.c:231
msgid "Radio"
msgstr "Opció"
#: src/lib/elementary/elm_segment_control.c:532
-#: src/lib/elementary/elm_toolbar.c:2278
+#: src/lib/elementary/elm_toolbar.c:2283
msgid "State: Selected"
msgstr "Estat: Seleccionat"
@@ -528,50 +528,50 @@ msgstr "Estat: No seleccionat"
msgid "Segment Control Item"
msgstr "Element de control del segment"
-#: src/lib/elementary/efl_ui_slider.c:1193
+#: src/lib/elementary/efl_ui_slider.c:681
msgid "slider"
msgstr "control lliscant"
-#: src/lib/elementary/elm_spinner.c:1061
+#: src/lib/elementary/elm_spinner.c:1071
msgid "incremented"
msgstr "incrementat"
-#: src/lib/elementary/elm_spinner.c:1067
+#: src/lib/elementary/elm_spinner.c:1077
msgid "decremented"
msgstr "decrementat"
-#: src/lib/elementary/elm_spinner.c:1100 src/lib/elementary/elm_spinner.c:1167
+#: src/lib/elementary/elm_spinner.c:1110 src/lib/elementary/elm_spinner.c:1177
msgid "spinner"
msgstr "spinner"
-#: src/lib/elementary/elm_spinner.c:1109 src/lib/elementary/elm_spinner.c:1150
+#: src/lib/elementary/elm_spinner.c:1119 src/lib/elementary/elm_spinner.c:1160
msgid "spinner increment button"
msgstr "botó d'increment del spinner"
-#: src/lib/elementary/elm_spinner.c:1112 src/lib/elementary/elm_spinner.c:1159
+#: src/lib/elementary/elm_spinner.c:1122 src/lib/elementary/elm_spinner.c:1169
msgid "spinner decrement button"
msgstr "botó de decrement del spinner"
-#: src/lib/elementary/elm_spinner.c:1114
+#: src/lib/elementary/elm_spinner.c:1124
msgid "spinner text"
msgstr "text rotatiu"
-#: src/lib/elementary/elm_toolbar.c:1733 src/lib/elementary/elm_toolbar.c:2335
+#: src/lib/elementary/elm_toolbar.c:1738 src/lib/elementary/elm_toolbar.c:2342
msgid "Selected"
msgstr "Seleccionat"
-#: src/lib/elementary/elm_toolbar.c:2274
+#: src/lib/elementary/elm_toolbar.c:2279
msgid "Separator"
msgstr "Separador"
-#: src/lib/elementary/elm_toolbar.c:2280
+#: src/lib/elementary/elm_toolbar.c:2285
msgid "Has menu"
msgstr "Té menú"
-#: src/lib/elementary/elm_toolbar.c:2330
+#: src/lib/elementary/elm_toolbar.c:2337
msgid "Unselected"
msgstr "No seleccionat"
-#: src/lib/elementary/elm_toolbar.c:2347
+#: src/lib/elementary/elm_toolbar.c:2354
msgid "Toolbar Item"
msgstr "Element de barra d'eines"
diff --git a/po/cs.po b/po/cs.po
index 4529dc4a62..9e4ea44957 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -5,12 +5,12 @@
# quaker66@gmail.com
# Vít Pelčák <vit@pelcak.org>, 2011.
# Tomáš Čech <sleep_walker@suse.cz>, 2012.
-#: src/lib/elementary/elm_config.c:4086
+#: src/lib/elementary/elm_config.c:4164
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2017-12-20 00:20+0900\n"
+"POT-Creation-Date: 2018-07-09 16:07+0900\n"
"PO-Revision-Date: 2014-05-22 22:44+0200\n"
"Last-Translator: Tomáš Čech <sleep_walker@suse.cz>\n"
"Language-Team: Czech <kde-i18n-doc@kde.org>\n"
@@ -243,172 +243,172 @@ msgstr "Obrázky"
msgid "Videos"
msgstr "Videa"
-#: src/lib/elementary/elc_fileselector.c:1907
+#: src/lib/elementary/elc_fileselector.c:1798
msgid "Up"
msgstr "Nahoru"
-#: src/lib/elementary/elc_fileselector.c:1921
+#: src/lib/elementary/elc_fileselector.c:1812
msgid "Home"
msgstr "Domů"
-#: src/lib/elementary/elc_fileselector.c:1940
+#: src/lib/elementary/elc_fileselector.c:1831
msgid "Search"
msgstr ""
-#: src/lib/elementary/elc_fileselector.c:2232
+#: src/lib/elementary/elc_fileselector.c:2107
msgid "OK"
msgstr "OK"
-#: src/lib/elementary/elc_fileselector.c:2242
-#: src/lib/elementary/elm_entry.c:1719 src/lib/elementary/elm_entry.c:1744
+#: src/lib/elementary/elc_fileselector.c:2117
+#: src/lib/elementary/elm_entry.c:1733 src/lib/elementary/elm_entry.c:1758
msgid "Cancel"
msgstr "Zrušit"
-#: src/lib/elementary/elc_hoversel.c:436 src/lib/elementary/efl_ui_button.c:263
-#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/elm_gengrid.c:1483
-#: src/lib/elementary/elm_genlist.c:1750 src/lib/elementary/elm_list.c:2157
-#: src/lib/elementary/efl_ui_radio.c:198
+#: src/lib/elementary/elc_hoversel.c:438 src/lib/elementary/efl_ui_button.c:208
+#: src/lib/elementary/efl_ui_check.c:188 src/lib/elementary/elm_gengrid.c:1511
+#: src/lib/elementary/elm_genlist.c:1759 src/lib/elementary/elm_list.c:2172
+#: src/lib/elementary/efl_ui_radio.c:201
#: src/lib/elementary/elm_segment_control.c:529
-#: src/lib/elementary/elm_spinner.c:1031 src/lib/elementary/elm_toolbar.c:2276
+#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2281
msgid "State: Disabled"
msgstr "Stav: Zakázáno"
-#: src/lib/elementary/elc_hoversel.c:638
+#: src/lib/elementary/elc_hoversel.c:651
msgid "Hoversel"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:675
+#: src/lib/elementary/elc_multibuttonentry.c:682
msgid "multi button entry label"
msgstr "popisek vícetlačítkového vstupu"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:697
+#: src/lib/elementary/elc_multibuttonentry.c:704
msgid "multi button entry item"
msgstr "položka vícetlačítkového vstupu"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:1579
+#: src/lib/elementary/elc_multibuttonentry.c:1586
msgid "multi button entry"
msgstr "vícetlačítkový vstup"
-#: src/lib/elementary/elc_naviframe.c:433
-#: src/lib/elementary/elc_naviframe.c:461
+#: src/lib/elementary/elc_naviframe.c:435
+#: src/lib/elementary/elc_naviframe.c:463
msgid "Title"
msgstr "Název"
-#: src/lib/elementary/elc_naviframe.c:440
+#: src/lib/elementary/elc_naviframe.c:442
#, fuzzy
msgid "Subtitle"
msgstr "Název"
-#: src/lib/elementary/elc_naviframe.c:1027
-#: src/lib/elementary/elc_naviframe.c:1245
+#: src/lib/elementary/elc_naviframe.c:1029
+#: src/lib/elementary/elc_naviframe.c:1247
msgid "Back"
msgstr "Zpět"
-#: src/lib/elementary/elc_naviframe.c:1343
+#: src/lib/elementary/elc_naviframe.c:1345
msgid "Next"
msgstr "Další"
-#: src/lib/elementary/elc_popup.c:305 src/lib/elementary/elc_popup.c:969
+#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992
msgid "Popup Title"
msgstr "Titulek vyskakujícího okna"
-#: src/lib/elementary/elc_popup.c:315 src/lib/elementary/elc_popup.c:1045
+#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068
msgid "Popup Body Text"
msgstr "Text vyskakovacího okna"
-#: src/lib/elementary/elc_popup.c:1820
+#: src/lib/elementary/elc_popup.c:1841
msgid "Alert"
msgstr ""
-#: src/lib/elementary/elm_bubble.c:162
+#: src/lib/elementary/elm_bubble.c:163
msgid "Bubble"
msgstr "Bublina"
-#: src/lib/elementary/efl_ui_button.c:70
+#: src/lib/elementary/efl_ui_button.c:71
msgid "Clicked"
msgstr "Kliknuto"
-#: src/lib/elementary/efl_ui_button.c:290
+#: src/lib/elementary/efl_ui_button.c:250
msgid "Button"
msgstr "Tlačítko"
-#: src/lib/elementary/elm_calendar.c:228
+#: src/lib/elementary/elm_calendar.c:244
#: src/lib/elementary/efl_ui_calendar.c:198
msgid "%B %Y"
msgstr "%B %Y"
-#: src/lib/elementary/elm_calendar.c:234
+#: src/lib/elementary/elm_calendar.c:250
msgid "%B"
msgstr "%B"
-#: src/lib/elementary/elm_calendar.c:240
+#: src/lib/elementary/elm_calendar.c:256
msgid "%Y"
msgstr "%Y"
-#: src/lib/elementary/elm_calendar.c:365
+#: src/lib/elementary/elm_calendar.c:382
#: src/lib/elementary/efl_ui_calendar.c:245
msgid "calendar item"
msgstr "položka kalendáře"
-#: src/lib/elementary/elm_calendar.c:392
+#: src/lib/elementary/elm_calendar.c:410
#: src/lib/elementary/efl_ui_calendar.c:272
msgid "calendar decrement month button"
msgstr "odečítací tlačítko pro měsíc"
-#: src/lib/elementary/elm_calendar.c:398
+#: src/lib/elementary/elm_calendar.c:416
msgid "calendar decrement year button"
msgstr "odečítací tlačítko pro rok"
-#: src/lib/elementary/elm_calendar.c:404
+#: src/lib/elementary/elm_calendar.c:422
#: src/lib/elementary/efl_ui_calendar.c:278
msgid "calendar increment month button"
msgstr "přičítací tlačítko pro měsíc"
-#: src/lib/elementary/elm_calendar.c:410
+#: src/lib/elementary/elm_calendar.c:428
msgid "calendar increment year button"
msgstr "přičítací tlačítko pro rok"
-#: src/lib/elementary/elm_calendar.c:415
+#: src/lib/elementary/elm_calendar.c:433
#: src/lib/elementary/efl_ui_calendar.c:283
msgid "calendar month"
msgstr "kalendářní měsíc"
-#: src/lib/elementary/elm_calendar.c:420
+#: src/lib/elementary/elm_calendar.c:438
#: src/lib/elementary/efl_ui_calendar.c:286
msgid "calendar year"
msgstr "kalendářní rok"
-#: src/lib/elementary/efl_ui_check.c:65 src/lib/elementary/efl_ui_check.c:210
-#: src/lib/elementary/efl_ui_radio.c:120 src/lib/elementary/efl_ui_radio.c:199
+#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201
+#: src/lib/elementary/efl_ui_radio.c:136 src/lib/elementary/efl_ui_radio.c:202
msgid "State: On"
msgstr "Stav: Zapnuto"
-#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:222
-#: src/lib/elementary/efl_ui_radio.c:201
+#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:213
+#: src/lib/elementary/efl_ui_radio.c:204
msgid "State: Off"
msgstr "Stav: Vypnuto"
-#: src/lib/elementary/efl_ui_check.c:206 src/lib/elementary/efl_ui_check.c:219
+#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210
msgid "State"
msgstr "Stav"
-#: src/lib/elementary/efl_ui_check.c:340
+#: src/lib/elementary/efl_ui_check.c:355
msgid "Check"
msgstr "Ověřit"
-#: src/lib/elementary/elm_clock.c:304
+#: src/lib/elementary/elm_clock.c:309
msgid "clock increment button for am,pm"
msgstr "přičítací tlačítko hodin pro am,pm"
-#: src/lib/elementary/elm_clock.c:312
+#: src/lib/elementary/elm_clock.c:317
msgid "clock decrement button for am,pm"
msgstr "odečítací tlačítko hodin pro am,pm"
-#: src/lib/elementary/elm_clock.c:691
+#: src/lib/elementary/elm_clock.c:714
msgid "State: Editable"
msgstr "Stav: Upravitelný"
-#: src/lib/elementary/elm_clock.c:726
+#: src/lib/elementary/elm_clock.c:749
msgid "Clock"
msgstr "Hodiny"
@@ -432,7 +432,7 @@ msgstr ""
msgid "A:"
msgstr ""
-#: src/lib/elementary/elm_colorselector.c:1706
+#: src/lib/elementary/elm_colorselector.c:1707
msgid "color selector palette item"
msgstr "položka výběru barvy z palety"
@@ -442,11 +442,11 @@ msgstr "položka výběru barvy z palety"
#. but if this is a right-to-left language like arabic, Farsi,
#. Hebrew, etc. then change this string to be "default:RTL"
#.
-#: src/lib/elementary/elm_config.c:4109
+#: src/lib/elementary/elm_config.c:4187
msgid "default:LTR"
msgstr "default:LTR"
-#: src/lib/elementary/elm_dayselector.c:402
+#: src/lib/elementary/elm_dayselector.c:437
msgid "day selector item"
msgstr "položka výběru dne"
@@ -454,27 +454,27 @@ msgstr "položka výběru dne"
msgid "diskselector item"
msgstr "položka výběru disků"
-#: src/lib/elementary/elm_entry.c:1709
+#: src/lib/elementary/elm_entry.c:1723
msgid "Cut"
msgstr "Vyjmout"
-#: src/lib/elementary/elm_entry.c:1712
+#: src/lib/elementary/elm_entry.c:1726
msgid "Copy"
msgstr "Kopírovat"
-#: src/lib/elementary/elm_entry.c:1716 src/lib/elementary/elm_entry.c:1738
+#: src/lib/elementary/elm_entry.c:1730 src/lib/elementary/elm_entry.c:1752
msgid "Paste"
msgstr "Vložit"
-#: src/lib/elementary/elm_entry.c:1731
+#: src/lib/elementary/elm_entry.c:1745
msgid "Select"
msgstr "Vybrat"
-#: src/lib/elementary/elm_entry.c:3831
+#: src/lib/elementary/elm_entry.c:3894
msgid "Entry"
msgstr "Vstup"
-#: src/lib/elementary/elm_gengrid.c:1513
+#: src/lib/elementary/elm_gengrid.c:1541
msgid "Gengrid Item"
msgstr "Položka mřížky"
@@ -486,40 +486,40 @@ msgstr "Index"
msgid "Index Item"
msgstr "Položka indexu"
-#: src/lib/elementary/elm_label.c:405
+#: src/lib/elementary/elm_label.c:403
msgid "Label"
msgstr "Popisek"
-#: src/lib/elementary/elm_panel.c:83
+#: src/lib/elementary/elm_panel.c:84
msgid "state: opened"
msgstr "stav: otevřeno"
-#: src/lib/elementary/elm_panel.c:84
+#: src/lib/elementary/elm_panel.c:85
msgid "state: closed"
msgstr "stav: zavřeno"
-#: src/lib/elementary/elm_panel.c:124
+#: src/lib/elementary/elm_panel.c:127
msgid "A panel is open"
msgstr ""
-#: src/lib/elementary/elm_panel.c:126
+#: src/lib/elementary/elm_panel.c:129
msgid "Double tap to close panel menu"
msgstr ""
-#: src/lib/elementary/elm_panel.c:178
+#: src/lib/elementary/elm_panel.c:181
msgid "panel button"
msgstr "tlačítko panelu"
-#: src/lib/elementary/efl_ui_progressbar.c:393
+#: src/lib/elementary/efl_ui_progressbar.c:397
msgid "progressbar"
msgstr "ukazatel průběhu"
-#: src/lib/elementary/efl_ui_radio.c:224
+#: src/lib/elementary/efl_ui_radio.c:231
msgid "Radio"
msgstr "Přepínač"
#: src/lib/elementary/elm_segment_control.c:532
-#: src/lib/elementary/elm_toolbar.c:2278
+#: src/lib/elementary/elm_toolbar.c:2283
msgid "State: Selected"
msgstr "Stav: Vybráno"
@@ -531,51 +531,51 @@ msgstr "Stav: Nevybráno"
msgid "Segment Control Item"
msgstr "položka ovládání segmentu"
-#: src/lib/elementary/efl_ui_slider.c:1193
+#: src/lib/elementary/efl_ui_slider.c:681
msgid "slider"
msgstr "šoupátko"
-#: src/lib/elementary/elm_spinner.c:1061
+#: src/lib/elementary/elm_spinner.c:1071
msgid "incremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1067
+#: src/lib/elementary/elm_spinner.c:1077
msgid "decremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1100 src/lib/elementary/elm_spinner.c:1167
+#: src/lib/elementary/elm_spinner.c:1110 src/lib/elementary/elm_spinner.c:1177
msgid "spinner"
msgstr "spinner"
-#: src/lib/elementary/elm_spinner.c:1109 src/lib/elementary/elm_spinner.c:1150
+#: src/lib/elementary/elm_spinner.c:1119 src/lib/elementary/elm_spinner.c:1160
msgid "spinner increment button"
msgstr "přičítací tlačítko spinneru"
-#: src/lib/elementary/elm_spinner.c:1112 src/lib/elementary/elm_spinner.c:1159
+#: src/lib/elementary/elm_spinner.c:1122 src/lib/elementary/elm_spinner.c:1169
msgid "spinner decrement button"
msgstr "odečítací tlačítko spinneru"
-#: src/lib/elementary/elm_spinner.c:1114
+#: src/lib/elementary/elm_spinner.c:1124
#, fuzzy
msgid "spinner text"
msgstr "spinner"
-#: src/lib/elementary/elm_toolbar.c:1733 src/lib/elementary/elm_toolbar.c:2335
+#: src/lib/elementary/elm_toolbar.c:1738 src/lib/elementary/elm_toolbar.c:2342
msgid "Selected"
msgstr "Vybrané"
-#: src/lib/elementary/elm_toolbar.c:2274
+#: src/lib/elementary/elm_toolbar.c:2279
msgid "Separator"
msgstr "Oddělovač"
-#: src/lib/elementary/elm_toolbar.c:2280
+#: src/lib/elementary/elm_toolbar.c:2285
msgid "Has menu"
msgstr "Má nabídku"
-#: src/lib/elementary/elm_toolbar.c:2330
+#: src/lib/elementary/elm_toolbar.c:2337
msgid "Unselected"
msgstr "Nevybrané"
-#: src/lib/elementary/elm_toolbar.c:2347
+#: src/lib/elementary/elm_toolbar.c:2354
msgid "Toolbar Item"
msgstr "Položka panelu nástrojů"
diff --git a/po/da.po b/po/da.po
index d2136c5ec0..abe13fb56c 100644
--- a/po/da.po
+++ b/po/da.po
@@ -2,12 +2,12 @@
# Copyright (C) 2017 Enlightenment development team
# This file is distributed under the same license as the efl package.
# scootergrisen, 2017.
-#: src/lib/elementary/elm_config.c:4086
+#: src/lib/elementary/elm_config.c:4164
msgid ""
msgstr ""
"Project-Id-Version: efl 1.20.5\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2017-12-20 00:20+0900\n"
+"POT-Creation-Date: 2018-07-09 16:07+0900\n"
"PO-Revision-Date: 2017-11-04 00:00+0200\n"
"Last-Translator: scootergrisen\n"
"Language-Team: Danish\n"
@@ -237,172 +237,172 @@ msgstr "Billeder"
msgid "Videos"
msgstr "Videoer"
-#: src/lib/elementary/elc_fileselector.c:1907
+#: src/lib/elementary/elc_fileselector.c:1798
msgid "Up"
msgstr "Op"
-#: src/lib/elementary/elc_fileselector.c:1921
+#: src/lib/elementary/elc_fileselector.c:1812
msgid "Home"
msgstr "Hjem"
-#: src/lib/elementary/elc_fileselector.c:1940
+#: src/lib/elementary/elc_fileselector.c:1831
msgid "Search"
msgstr "Søg"
-#: src/lib/elementary/elc_fileselector.c:2232
+#: src/lib/elementary/elc_fileselector.c:2107
msgid "OK"
msgstr "OK"
-#: src/lib/elementary/elc_fileselector.c:2242
-#: src/lib/elementary/elm_entry.c:1719 src/lib/elementary/elm_entry.c:1744
+#: src/lib/elementary/elc_fileselector.c:2117
+#: src/lib/elementary/elm_entry.c:1733 src/lib/elementary/elm_entry.c:1758
msgid "Cancel"
msgstr "Annuller"
-#: src/lib/elementary/elc_hoversel.c:436 src/lib/elementary/efl_ui_button.c:263
-#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/elm_gengrid.c:1483
-#: src/lib/elementary/elm_genlist.c:1750 src/lib/elementary/elm_list.c:2157
-#: src/lib/elementary/efl_ui_radio.c:198
+#: src/lib/elementary/elc_hoversel.c:438 src/lib/elementary/efl_ui_button.c:208
+#: src/lib/elementary/efl_ui_check.c:188 src/lib/elementary/elm_gengrid.c:1511
+#: src/lib/elementary/elm_genlist.c:1759 src/lib/elementary/elm_list.c:2172
+#: src/lib/elementary/efl_ui_radio.c:201
#: src/lib/elementary/elm_segment_control.c:529
-#: src/lib/elementary/elm_spinner.c:1031 src/lib/elementary/elm_toolbar.c:2276
+#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2281
msgid "State: Disabled"
msgstr "Tilstand: Deaktiveret"
-#: src/lib/elementary/elc_hoversel.c:638
+#: src/lib/elementary/elc_hoversel.c:651
msgid "Hoversel"
msgstr "Svævemarkering"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:675
+#: src/lib/elementary/elc_multibuttonentry.c:682
msgid "multi button entry label"
msgstr "indtastningsetiket til multiknap"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:697
+#: src/lib/elementary/elc_multibuttonentry.c:704
msgid "multi button entry item"
msgstr "indtastningselement til multiknap"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:1579
+#: src/lib/elementary/elc_multibuttonentry.c:1586
msgid "multi button entry"
msgstr "indtastning til multiknap"
-#: src/lib/elementary/elc_naviframe.c:433
-#: src/lib/elementary/elc_naviframe.c:461
+#: src/lib/elementary/elc_naviframe.c:435
+#: src/lib/elementary/elc_naviframe.c:463
msgid "Title"
msgstr "Titel"
-#: src/lib/elementary/elc_naviframe.c:440
+#: src/lib/elementary/elc_naviframe.c:442
#, fuzzy
msgid "Subtitle"
msgstr "Titel"
-#: src/lib/elementary/elc_naviframe.c:1027
-#: src/lib/elementary/elc_naviframe.c:1245
+#: src/lib/elementary/elc_naviframe.c:1029
+#: src/lib/elementary/elc_naviframe.c:1247
msgid "Back"
msgstr "Tilbage"
-#: src/lib/elementary/elc_naviframe.c:1343
+#: src/lib/elementary/elc_naviframe.c:1345
msgid "Next"
msgstr "Næste"
-#: src/lib/elementary/elc_popup.c:305 src/lib/elementary/elc_popup.c:969
+#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992
msgid "Popup Title"
msgstr "Titel til pop op"
-#: src/lib/elementary/elc_popup.c:315 src/lib/elementary/elc_popup.c:1045
+#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068
msgid "Popup Body Text"
msgstr "Brødtekst til pop op"
-#: src/lib/elementary/elc_popup.c:1820
+#: src/lib/elementary/elc_popup.c:1841
msgid "Alert"
msgstr ""
-#: src/lib/elementary/elm_bubble.c:162
+#: src/lib/elementary/elm_bubble.c:163
msgid "Bubble"
msgstr "Bobbel"
-#: src/lib/elementary/efl_ui_button.c:70
+#: src/lib/elementary/efl_ui_button.c:71
msgid "Clicked"
msgstr "Klikket"
-#: src/lib/elementary/efl_ui_button.c:290
+#: src/lib/elementary/efl_ui_button.c:250
msgid "Button"
msgstr "Knap"
-#: src/lib/elementary/elm_calendar.c:228
+#: src/lib/elementary/elm_calendar.c:244
#: src/lib/elementary/efl_ui_calendar.c:198
msgid "%B %Y"
msgstr "%B %Y"
-#: src/lib/elementary/elm_calendar.c:234
+#: src/lib/elementary/elm_calendar.c:250
msgid "%B"
msgstr "%B"
-#: src/lib/elementary/elm_calendar.c:240
+#: src/lib/elementary/elm_calendar.c:256
msgid "%Y"
msgstr "%Y"
-#: src/lib/elementary/elm_calendar.c:365
+#: src/lib/elementary/elm_calendar.c:382
#: src/lib/elementary/efl_ui_calendar.c:245
msgid "calendar item"
msgstr "kalender-element"
-#: src/lib/elementary/elm_calendar.c:392
+#: src/lib/elementary/elm_calendar.c:410
#: src/lib/elementary/efl_ui_calendar.c:272
msgid "calendar decrement month button"
msgstr "formindsk-knap til kalender måned"
-#: src/lib/elementary/elm_calendar.c:398
+#: src/lib/elementary/elm_calendar.c:416
msgid "calendar decrement year button"
msgstr "formindsk-knap til kalender år"
-#: src/lib/elementary/elm_calendar.c:404
+#: src/lib/elementary/elm_calendar.c:422
#: src/lib/elementary/efl_ui_calendar.c:278
msgid "calendar increment month button"
msgstr "forøg-knap til kalender måned"
-#: src/lib/elementary/elm_calendar.c:410
+#: src/lib/elementary/elm_calendar.c:428
msgid "calendar increment year button"
msgstr "forøg-knap til kalender år"
-#: src/lib/elementary/elm_calendar.c:415
+#: src/lib/elementary/elm_calendar.c:433
#: src/lib/elementary/efl_ui_calendar.c:283
msgid "calendar month"
msgstr "kalender måned"
-#: src/lib/elementary/elm_calendar.c:420
+#: src/lib/elementary/elm_calendar.c:438
#: src/lib/elementary/efl_ui_calendar.c:286
msgid "calendar year"
msgstr "kalender år"
-#: src/lib/elementary/efl_ui_check.c:65 src/lib/elementary/efl_ui_check.c:210
-#: src/lib/elementary/efl_ui_radio.c:120 src/lib/elementary/efl_ui_radio.c:199
+#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201
+#: src/lib/elementary/efl_ui_radio.c:136 src/lib/elementary/efl_ui_radio.c:202
msgid "State: On"
msgstr "Tilstand: Til"
-#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:222
-#: src/lib/elementary/efl_ui_radio.c:201
+#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:213
+#: src/lib/elementary/efl_ui_radio.c:204
msgid "State: Off"
msgstr "Tilstand: Fra"
-#: src/lib/elementary/efl_ui_check.c:206 src/lib/elementary/efl_ui_check.c:219
+#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210
msgid "State"
msgstr "Tilstand"
-#: src/lib/elementary/efl_ui_check.c:340
+#: src/lib/elementary/efl_ui_check.c:355
msgid "Check"
msgstr "Tilvælg"
-#: src/lib/elementary/elm_clock.c:304
+#: src/lib/elementary/elm_clock.c:309
msgid "clock increment button for am,pm"
msgstr "forøg-knap til ur am,pm"
-#: src/lib/elementary/elm_clock.c:312
+#: src/lib/elementary/elm_clock.c:317
msgid "clock decrement button for am,pm"
msgstr "formindsk-knap til ur am,pm"
-#: src/lib/elementary/elm_clock.c:691
+#: src/lib/elementary/elm_clock.c:714
msgid "State: Editable"
msgstr "Tilstand: Redigerbar"
-#: src/lib/elementary/elm_clock.c:726
+#: src/lib/elementary/elm_clock.c:749
msgid "Clock"
msgstr "Ur"
@@ -426,7 +426,7 @@ msgstr "B:"
msgid "A:"
msgstr "A:"
-#: src/lib/elementary/elm_colorselector.c:1706
+#: src/lib/elementary/elm_colorselector.c:1707
msgid "color selector palette item"
msgstr "palet-element til farvevælger"
@@ -436,11 +436,11 @@ msgstr "palet-element til farvevælger"
#. but if this is a right-to-left language like arabic, Farsi,
#. Hebrew, etc. then change this string to be "default:RTL"
#.
-#: src/lib/elementary/elm_config.c:4109
+#: src/lib/elementary/elm_config.c:4187
msgid "default:LTR"
msgstr "default:LTR"
-#: src/lib/elementary/elm_dayselector.c:402
+#: src/lib/elementary/elm_dayselector.c:437
msgid "day selector item"
msgstr "dagvælger-element"
@@ -448,27 +448,27 @@ msgstr "dagvælger-element"
msgid "diskselector item"
msgstr "diskvælger-element"
-#: src/lib/elementary/elm_entry.c:1709
+#: src/lib/elementary/elm_entry.c:1723
msgid "Cut"
msgstr "Klip"
-#: src/lib/elementary/elm_entry.c:1712
+#: src/lib/elementary/elm_entry.c:1726
msgid "Copy"
msgstr "Kopiér"
-#: src/lib/elementary/elm_entry.c:1716 src/lib/elementary/elm_entry.c:1738
+#: src/lib/elementary/elm_entry.c:1730 src/lib/elementary/elm_entry.c:1752
msgid "Paste"
msgstr "Indsæt"
-#: src/lib/elementary/elm_entry.c:1731
+#: src/lib/elementary/elm_entry.c:1745
msgid "Select"
msgstr "Vælg"
-#: src/lib/elementary/elm_entry.c:3831
+#: src/lib/elementary/elm_entry.c:3894
msgid "Entry"
msgstr "Indtastning"
-#: src/lib/elementary/elm_gengrid.c:1513
+#: src/lib/elementary/elm_gengrid.c:1541
msgid "Gengrid Item"
msgstr "Gengitter-element"
@@ -480,40 +480,40 @@ msgstr "Indeks"
msgid "Index Item"
msgstr "Indeks-element"
-#: src/lib/elementary/elm_label.c:405
+#: src/lib/elementary/elm_label.c:403
msgid "Label"
msgstr "Etiket"
-#: src/lib/elementary/elm_panel.c:83
+#: src/lib/elementary/elm_panel.c:84
msgid "state: opened"
msgstr "tilstand: åbnet"
-#: src/lib/elementary/elm_panel.c:84
+#: src/lib/elementary/elm_panel.c:85
msgid "state: closed"
msgstr "tilstand: lukket"
-#: src/lib/elementary/elm_panel.c:124
+#: src/lib/elementary/elm_panel.c:127
msgid "A panel is open"
msgstr "Et panel er åbent"
-#: src/lib/elementary/elm_panel.c:126
+#: src/lib/elementary/elm_panel.c:129
msgid "Double tap to close panel menu"
msgstr "Dobbelttryk for at lukke panelmenu"
-#: src/lib/elementary/elm_panel.c:178
+#: src/lib/elementary/elm_panel.c:181
msgid "panel button"
msgstr "panelknap"
-#: src/lib/elementary/efl_ui_progressbar.c:393
+#: src/lib/elementary/efl_ui_progressbar.c:397
msgid "progressbar"
msgstr "forløbslinje"
-#: src/lib/elementary/efl_ui_radio.c:224
+#: src/lib/elementary/efl_ui_radio.c:231
msgid "Radio"
msgstr "Radio"
#: src/lib/elementary/elm_segment_control.c:532
-#: src/lib/elementary/elm_toolbar.c:2278
+#: src/lib/elementary/elm_toolbar.c:2283
msgid "State: Selected"
msgstr "Tilstand: Valgt"
@@ -525,50 +525,50 @@ msgstr "Tilstand: Fravalgt"
msgid "Segment Control Item"
msgstr "Segmentkontrol-element"
-#: src/lib/elementary/efl_ui_slider.c:1193
+#: src/lib/elementary/efl_ui_slider.c:681
msgid "slider"
msgstr "skyder"
-#: src/lib/elementary/elm_spinner.c:1061
+#: src/lib/elementary/elm_spinner.c:1071
msgid "incremented"
msgstr "forøget"
-#: src/lib/elementary/elm_spinner.c:1067
+#: src/lib/elementary/elm_spinner.c:1077
msgid "decremented"
msgstr "formindsket"
-#: src/lib/elementary/elm_spinner.c:1100 src/lib/elementary/elm_spinner.c:1167
+#: src/lib/elementary/elm_spinner.c:1110 src/lib/elementary/elm_spinner.c:1177
msgid "spinner"
msgstr "ruller"
-#: src/lib/elementary/elm_spinner.c:1109 src/lib/elementary/elm_spinner.c:1150
+#: src/lib/elementary/elm_spinner.c:1119 src/lib/elementary/elm_spinner.c:1160
msgid "spinner increment button"
msgstr "forøg-knap til ruller"
-#: src/lib/elementary/elm_spinner.c:1112 src/lib/elementary/elm_spinner.c:1159
+#: src/lib/elementary/elm_spinner.c:1122 src/lib/elementary/elm_spinner.c:1169
msgid "spinner decrement button"
msgstr "formindsk-knap til ruller"
-#: src/lib/elementary/elm_spinner.c:1114
+#: src/lib/elementary/elm_spinner.c:1124
msgid "spinner text"
msgstr "rullertekst"
-#: src/lib/elementary/elm_toolbar.c:1733 src/lib/elementary/elm_toolbar.c:2335
+#: src/lib/elementary/elm_toolbar.c:1738 src/lib/elementary/elm_toolbar.c:2342
msgid "Selected"
msgstr "Valgt"
-#: src/lib/elementary/elm_toolbar.c:2274
+#: src/lib/elementary/elm_toolbar.c:2279
msgid "Separator"
msgstr "Separator"
-#: src/lib/elementary/elm_toolbar.c:2280
+#: src/lib/elementary/elm_toolbar.c:2285
msgid "Has menu"
msgstr "Har menu"
-#: src/lib/elementary/elm_toolbar.c:2330
+#: src/lib/elementary/elm_toolbar.c:2337
msgid "Unselected"
msgstr "Fravalgt"
-#: src/lib/elementary/elm_toolbar.c:2347
+#: src/lib/elementary/elm_toolbar.c:2354
msgid "Toolbar Item"
msgstr "Værktøjslinje-element"
diff --git a/po/de.po b/po/de.po
index 89e8263128..e9b2848339 100644
--- a/po/de.po
+++ b/po/de.po
@@ -4,12 +4,12 @@
# Chris Leick <c.leick@vollbio.de>, 2009.
# Fabian Nowak <timystery@arcor.de>, 2010.
#
-#: src/lib/elementary/elm_config.c:4086
+#: src/lib/elementary/elm_config.c:4164
msgid ""
msgstr ""
"Project-Id-Version: elementary 0.7.0.57309\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2017-12-20 00:20+0900\n"
+"POT-Creation-Date: 2018-07-09 16:07+0900\n"
"PO-Revision-Date: 2011-02-25 20:22+0100\n"
"Last-Translator: Fabian Nowak <timystery@arcor.de>\n"
"Language-Team: German\n"
@@ -241,171 +241,171 @@ msgstr ""
msgid "Videos"
msgstr ""
-#: src/lib/elementary/elc_fileselector.c:1907
+#: src/lib/elementary/elc_fileselector.c:1798
msgid "Up"
msgstr "Aufwärts"
-#: src/lib/elementary/elc_fileselector.c:1921
+#: src/lib/elementary/elc_fileselector.c:1812
msgid "Home"
msgstr "Persönlicher Ordner"
-#: src/lib/elementary/elc_fileselector.c:1940
+#: src/lib/elementary/elc_fileselector.c:1831
msgid "Search"
msgstr ""
-#: src/lib/elementary/elc_fileselector.c:2232
+#: src/lib/elementary/elc_fileselector.c:2107
msgid "OK"
msgstr "OK"
-#: src/lib/elementary/elc_fileselector.c:2242
-#: src/lib/elementary/elm_entry.c:1719 src/lib/elementary/elm_entry.c:1744
+#: src/lib/elementary/elc_fileselector.c:2117
+#: src/lib/elementary/elm_entry.c:1733 src/lib/elementary/elm_entry.c:1758
msgid "Cancel"
msgstr "Abbrechen"
-#: src/lib/elementary/elc_hoversel.c:436 src/lib/elementary/efl_ui_button.c:263
-#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/elm_gengrid.c:1483
-#: src/lib/elementary/elm_genlist.c:1750 src/lib/elementary/elm_list.c:2157
-#: src/lib/elementary/efl_ui_radio.c:198
+#: src/lib/elementary/elc_hoversel.c:438 src/lib/elementary/efl_ui_button.c:208
+#: src/lib/elementary/efl_ui_check.c:188 src/lib/elementary/elm_gengrid.c:1511
+#: src/lib/elementary/elm_genlist.c:1759 src/lib/elementary/elm_list.c:2172
+#: src/lib/elementary/efl_ui_radio.c:201
#: src/lib/elementary/elm_segment_control.c:529
-#: src/lib/elementary/elm_spinner.c:1031 src/lib/elementary/elm_toolbar.c:2276
+#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2281
msgid "State: Disabled"
msgstr ""
-#: src/lib/elementary/elc_hoversel.c:638
+#: src/lib/elementary/elc_hoversel.c:651
msgid "Hoversel"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:675
+#: src/lib/elementary/elc_multibuttonentry.c:682
msgid "multi button entry label"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:697
+#: src/lib/elementary/elc_multibuttonentry.c:704
msgid "multi button entry item"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:1579
+#: src/lib/elementary/elc_multibuttonentry.c:1586
msgid "multi button entry"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:433
-#: src/lib/elementary/elc_naviframe.c:461
+#: src/lib/elementary/elc_naviframe.c:435
+#: src/lib/elementary/elc_naviframe.c:463
msgid "Title"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:440
+#: src/lib/elementary/elc_naviframe.c:442
msgid "Subtitle"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:1027
-#: src/lib/elementary/elc_naviframe.c:1245
+#: src/lib/elementary/elc_naviframe.c:1029
+#: src/lib/elementary/elc_naviframe.c:1247
msgid "Back"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:1343
+#: src/lib/elementary/elc_naviframe.c:1345
msgid "Next"
msgstr ""
-#: src/lib/elementary/elc_popup.c:305 src/lib/elementary/elc_popup.c:969
+#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992
msgid "Popup Title"
msgstr ""
-#: src/lib/elementary/elc_popup.c:315 src/lib/elementary/elc_popup.c:1045
+#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068
msgid "Popup Body Text"
msgstr ""
-#: src/lib/elementary/elc_popup.c:1820
+#: src/lib/elementary/elc_popup.c:1841
msgid "Alert"
msgstr ""
-#: src/lib/elementary/elm_bubble.c:162
+#: src/lib/elementary/elm_bubble.c:163
msgid "Bubble"
msgstr ""
-#: src/lib/elementary/efl_ui_button.c:70
+#: src/lib/elementary/efl_ui_button.c:71
msgid "Clicked"
msgstr ""
-#: src/lib/elementary/efl_ui_button.c:290
+#: src/lib/elementary/efl_ui_button.c:250
msgid "Button"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:228
+#: src/lib/elementary/elm_calendar.c:244
#: src/lib/elementary/efl_ui_calendar.c:198
msgid "%B %Y"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:234
+#: src/lib/elementary/elm_calendar.c:250
msgid "%B"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:240
+#: src/lib/elementary/elm_calendar.c:256
msgid "%Y"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:365
+#: src/lib/elementary/elm_calendar.c:382
#: src/lib/elementary/efl_ui_calendar.c:245
msgid "calendar item"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:392
+#: src/lib/elementary/elm_calendar.c:410
#: src/lib/elementary/efl_ui_calendar.c:272
msgid "calendar decrement month button"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:398
+#: src/lib/elementary/elm_calendar.c:416
msgid "calendar decrement year button"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:404
+#: src/lib/elementary/elm_calendar.c:422
#: src/lib/elementary/efl_ui_calendar.c:278
msgid "calendar increment month button"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:410
+#: src/lib/elementary/elm_calendar.c:428
msgid "calendar increment year button"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:415
+#: src/lib/elementary/elm_calendar.c:433
#: src/lib/elementary/efl_ui_calendar.c:283
msgid "calendar month"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:420
+#: src/lib/elementary/elm_calendar.c:438
#: src/lib/elementary/efl_ui_calendar.c:286
msgid "calendar year"
msgstr ""
-#: src/lib/elementary/efl_ui_check.c:65 src/lib/elementary/efl_ui_check.c:210
-#: src/lib/elementary/efl_ui_radio.c:120 src/lib/elementary/efl_ui_radio.c:199
+#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201
+#: src/lib/elementary/efl_ui_radio.c:136 src/lib/elementary/efl_ui_radio.c:202
msgid "State: On"
msgstr ""
-#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:222
-#: src/lib/elementary/efl_ui_radio.c:201
+#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:213
+#: src/lib/elementary/efl_ui_radio.c:204
msgid "State: Off"
msgstr ""
-#: src/lib/elementary/efl_ui_check.c:206 src/lib/elementary/efl_ui_check.c:219
+#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210
msgid "State"
msgstr ""
-#: src/lib/elementary/efl_ui_check.c:340
+#: src/lib/elementary/efl_ui_check.c:355
msgid "Check"
msgstr ""
-#: src/lib/elementary/elm_clock.c:304
+#: src/lib/elementary/elm_clock.c:309
msgid "clock increment button for am,pm"
msgstr ""
-#: src/lib/elementary/elm_clock.c:312
+#: src/lib/elementary/elm_clock.c:317
msgid "clock decrement button for am,pm"
msgstr ""
-#: src/lib/elementary/elm_clock.c:691
+#: src/lib/elementary/elm_clock.c:714
msgid "State: Editable"
msgstr ""
-#: src/lib/elementary/elm_clock.c:726
+#: src/lib/elementary/elm_clock.c:749
msgid "Clock"
msgstr ""
@@ -429,7 +429,7 @@ msgstr ""
msgid "A:"
msgstr ""
-#: src/lib/elementary/elm_colorselector.c:1706
+#: src/lib/elementary/elm_colorselector.c:1707
msgid "color selector palette item"
msgstr ""
@@ -439,11 +439,11 @@ msgstr ""
#. but if this is a right-to-left language like arabic, Farsi,
#. Hebrew, etc. then change this string to be "default:RTL"
#.
-#: src/lib/elementary/elm_config.c:4109
+#: src/lib/elementary/elm_config.c:4187
msgid "default:LTR"
msgstr "default:LTR"
-#: src/lib/elementary/elm_dayselector.c:402
+#: src/lib/elementary/elm_dayselector.c:437
msgid "day selector item"
msgstr ""
@@ -451,27 +451,27 @@ msgstr ""
msgid "diskselector item"
msgstr ""
-#: src/lib/elementary/elm_entry.c:1709
+#: src/lib/elementary/elm_entry.c:1723
msgid "Cut"
msgstr "Ausschneiden"
-#: src/lib/elementary/elm_entry.c:1712
+#: src/lib/elementary/elm_entry.c:1726
msgid "Copy"
msgstr "Kopieren"
-#: src/lib/elementary/elm_entry.c:1716 src/lib/elementary/elm_entry.c:1738
+#: src/lib/elementary/elm_entry.c:1730 src/lib/elementary/elm_entry.c:1752
msgid "Paste"
msgstr "Einfügen"
-#: src/lib/elementary/elm_entry.c:1731
+#: src/lib/elementary/elm_entry.c:1745
msgid "Select"
msgstr "Auswählen"
-#: src/lib/elementary/elm_entry.c:3831
+#: src/lib/elementary/elm_entry.c:3894
msgid "Entry"
msgstr ""
-#: src/lib/elementary/elm_gengrid.c:1513
+#: src/lib/elementary/elm_gengrid.c:1541
msgid "Gengrid Item"
msgstr ""
@@ -483,40 +483,40 @@ msgstr ""
msgid "Index Item"
msgstr ""
-#: src/lib/elementary/elm_label.c:405
+#: src/lib/elementary/elm_label.c:403
msgid "Label"
msgstr ""
-#: src/lib/elementary/elm_panel.c:83
+#: src/lib/elementary/elm_panel.c:84
msgid "state: opened"
msgstr ""
-#: src/lib/elementary/elm_panel.c:84
+#: src/lib/elementary/elm_panel.c:85
msgid "state: closed"
msgstr ""
-#: src/lib/elementary/elm_panel.c:124
+#: src/lib/elementary/elm_panel.c:127
msgid "A panel is open"
msgstr ""
-#: src/lib/elementary/elm_panel.c:126
+#: src/lib/elementary/elm_panel.c:129
msgid "Double tap to close panel menu"
msgstr ""
-#: src/lib/elementary/elm_panel.c:178
+#: src/lib/elementary/elm_panel.c:181
msgid "panel button"
msgstr ""
-#: src/lib/elementary/efl_ui_progressbar.c:393
+#: src/lib/elementary/efl_ui_progressbar.c:397
msgid "progressbar"
msgstr ""
-#: src/lib/elementary/efl_ui_radio.c:224
+#: src/lib/elementary/efl_ui_radio.c:231
msgid "Radio"
msgstr ""
#: src/lib/elementary/elm_segment_control.c:532
-#: src/lib/elementary/elm_toolbar.c:2278
+#: src/lib/elementary/elm_toolbar.c:2283
msgid "State: Selected"
msgstr ""
@@ -529,52 +529,52 @@ msgstr "Auswählen"
msgid "Segment Control Item"
msgstr ""
-#: src/lib/elementary/efl_ui_slider.c:1193
+#: src/lib/elementary/efl_ui_slider.c:681
msgid "slider"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1061
+#: src/lib/elementary/elm_spinner.c:1071
msgid "incremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1067
+#: src/lib/elementary/elm_spinner.c:1077
msgid "decremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1100 src/lib/elementary/elm_spinner.c:1167
+#: src/lib/elementary/elm_spinner.c:1110 src/lib/elementary/elm_spinner.c:1177
msgid "spinner"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1109 src/lib/elementary/elm_spinner.c:1150
+#: src/lib/elementary/elm_spinner.c:1119 src/lib/elementary/elm_spinner.c:1160
msgid "spinner increment button"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1112 src/lib/elementary/elm_spinner.c:1159
+#: src/lib/elementary/elm_spinner.c:1122 src/lib/elementary/elm_spinner.c:1169
msgid "spinner decrement button"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1114
+#: src/lib/elementary/elm_spinner.c:1124
msgid "spinner text"
msgstr ""
-#: src/lib/elementary/elm_toolbar.c:1733 src/lib/elementary/elm_toolbar.c:2335
+#: src/lib/elementary/elm_toolbar.c:1738 src/lib/elementary/elm_toolbar.c:2342
#, fuzzy
msgid "Selected"
msgstr "Auswählen"
-#: src/lib/elementary/elm_toolbar.c:2274
+#: src/lib/elementary/elm_toolbar.c:2279
msgid "Separator"
msgstr ""
-#: src/lib/elementary/elm_toolbar.c:2280
+#: src/lib/elementary/elm_toolbar.c:2285
msgid "Has menu"
msgstr ""
-#: src/lib/elementary/elm_toolbar.c:2330
+#: src/lib/elementary/elm_toolbar.c:2337
#, fuzzy
msgid "Unselected"
msgstr "Auswählen"
-#: src/lib/elementary/elm_toolbar.c:2347
+#: src/lib/elementary/elm_toolbar.c:2354
msgid "Toolbar Item"
msgstr ""
diff --git a/po/el.po b/po/el.po
index 3f6fd057a7..1153c90167 100644
--- a/po/el.po
+++ b/po/el.po
@@ -6,12 +6,12 @@
# Alex-P. Natsios <drakevr@linuxteam.teilar.gr> 2012
# Efstathios Iosifidis <iosifidis@opensuse.org>, 2012.
#
-#: src/lib/elementary/elm_config.c:4086
+#: src/lib/elementary/elm_config.c:4164
msgid ""
msgstr ""
"Project-Id-Version: elementary\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2017-12-20 00:20+0900\n"
+"POT-Creation-Date: 2018-07-09 16:07+0900\n"
"PO-Revision-Date: 2012-12-19 15:58+0200\n"
"Last-Translator: Efstathios Iosifidis <iosifidis@opensuse.org>\n"
"Language-Team: Ελληνικά, Σύγχρονα <opensuse-translation-el@opensuse.org>\n"
@@ -244,179 +244,179 @@ msgstr "Εικόνες"
msgid "Videos"
msgstr "Βίντεο"
-#: src/lib/elementary/elc_fileselector.c:1907
+#: src/lib/elementary/elc_fileselector.c:1798
msgid "Up"
msgstr "Πάνω"
-#: src/lib/elementary/elc_fileselector.c:1921
+#: src/lib/elementary/elc_fileselector.c:1812
msgid "Home"
msgstr "Αρχική"
-#: src/lib/elementary/elc_fileselector.c:1940
+#: src/lib/elementary/elc_fileselector.c:1831
msgid "Search"
msgstr ""
-#: src/lib/elementary/elc_fileselector.c:2232
+#: src/lib/elementary/elc_fileselector.c:2107
msgid "OK"
msgstr "Εντάξει"
-#: src/lib/elementary/elc_fileselector.c:2242
-#: src/lib/elementary/elm_entry.c:1719 src/lib/elementary/elm_entry.c:1744
+#: src/lib/elementary/elc_fileselector.c:2117
+#: src/lib/elementary/elm_entry.c:1733 src/lib/elementary/elm_entry.c:1758
msgid "Cancel"
msgstr "Άκυρο"
-#: src/lib/elementary/elc_hoversel.c:436 src/lib/elementary/efl_ui_button.c:263
-#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/elm_gengrid.c:1483
-#: src/lib/elementary/elm_genlist.c:1750 src/lib/elementary/elm_list.c:2157
-#: src/lib/elementary/efl_ui_radio.c:198
+#: src/lib/elementary/elc_hoversel.c:438 src/lib/elementary/efl_ui_button.c:208
+#: src/lib/elementary/efl_ui_check.c:188 src/lib/elementary/elm_gengrid.c:1511
+#: src/lib/elementary/elm_genlist.c:1759 src/lib/elementary/elm_list.c:2172
+#: src/lib/elementary/efl_ui_radio.c:201
#: src/lib/elementary/elm_segment_control.c:529
-#: src/lib/elementary/elm_spinner.c:1031 src/lib/elementary/elm_toolbar.c:2276
+#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2281
msgid "State: Disabled"
msgstr "Κατάσταση: Απενεργοποιημένο"
-#: src/lib/elementary/elc_hoversel.c:638
+#: src/lib/elementary/elc_hoversel.c:651
msgid "Hoversel"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:675
+#: src/lib/elementary/elc_multibuttonentry.c:682
msgid "multi button entry label"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:697
+#: src/lib/elementary/elc_multibuttonentry.c:704
msgid "multi button entry item"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:1579
+#: src/lib/elementary/elc_multibuttonentry.c:1586
msgid "multi button entry"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:433
-#: src/lib/elementary/elc_naviframe.c:461
+#: src/lib/elementary/elc_naviframe.c:435
+#: src/lib/elementary/elc_naviframe.c:463
msgid "Title"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:440
+#: src/lib/elementary/elc_naviframe.c:442
msgid "Subtitle"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:1027
-#: src/lib/elementary/elc_naviframe.c:1245
+#: src/lib/elementary/elc_naviframe.c:1029
+#: src/lib/elementary/elc_naviframe.c:1247
msgid "Back"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:1343
+#: src/lib/elementary/elc_naviframe.c:1345
msgid "Next"
msgstr ""
-#: src/lib/elementary/elc_popup.c:305 src/lib/elementary/elc_popup.c:969
+#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992
msgid "Popup Title"
msgstr ""
-#: src/lib/elementary/elc_popup.c:315 src/lib/elementary/elc_popup.c:1045
+#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068
msgid "Popup Body Text"
msgstr ""
-#: src/lib/elementary/elc_popup.c:1820
+#: src/lib/elementary/elc_popup.c:1841
msgid "Alert"
msgstr ""
-#: src/lib/elementary/elm_bubble.c:162
+#: src/lib/elementary/elm_bubble.c:163
#, fuzzy
msgid "Bubble"
msgstr "Πλαίσιο"
-#: src/lib/elementary/efl_ui_button.c:70
+#: src/lib/elementary/efl_ui_button.c:71
msgid "Clicked"
msgstr "Επιλεγμένο"
-#: src/lib/elementary/efl_ui_button.c:290
+#: src/lib/elementary/efl_ui_button.c:250
msgid "Button"
msgstr "Κουμπί"
-#: src/lib/elementary/elm_calendar.c:228
+#: src/lib/elementary/elm_calendar.c:244
#: src/lib/elementary/efl_ui_calendar.c:198
msgid "%B %Y"
msgstr "%B %Y"
-#: src/lib/elementary/elm_calendar.c:234
+#: src/lib/elementary/elm_calendar.c:250
msgid "%B"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:240
+#: src/lib/elementary/elm_calendar.c:256
msgid "%Y"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:365
+#: src/lib/elementary/elm_calendar.c:382
#: src/lib/elementary/efl_ui_calendar.c:245
msgid "calendar item"
msgstr "αντικείμενο ημερολογίου"
-#: src/lib/elementary/elm_calendar.c:392
+#: src/lib/elementary/elm_calendar.c:410
#: src/lib/elementary/efl_ui_calendar.c:272
#, fuzzy
msgid "calendar decrement month button"
msgstr "Προηγούμενο Ημερολόγιο"
-#: src/lib/elementary/elm_calendar.c:398
+#: src/lib/elementary/elm_calendar.c:416
#, fuzzy
msgid "calendar decrement year button"
msgstr "Προηγούμενο Ημερολόγιο"
-#: src/lib/elementary/elm_calendar.c:404
+#: src/lib/elementary/elm_calendar.c:422
#: src/lib/elementary/efl_ui_calendar.c:278
#, fuzzy
msgid "calendar increment month button"
msgstr "Επόμενο Ημερολόγιο"
-#: src/lib/elementary/elm_calendar.c:410
+#: src/lib/elementary/elm_calendar.c:428
#, fuzzy
msgid "calendar increment year button"
msgstr "Επόμενο Ημερολόγιο"
-#: src/lib/elementary/elm_calendar.c:415
+#: src/lib/elementary/elm_calendar.c:433
#: src/lib/elementary/efl_ui_calendar.c:283
msgid "calendar month"
msgstr "Μηνας Ημερολογίου"
-#: src/lib/elementary/elm_calendar.c:420
+#: src/lib/elementary/elm_calendar.c:438
#: src/lib/elementary/efl_ui_calendar.c:286
#, fuzzy
msgid "calendar year"
msgstr "αντικείμενο ημερολογίου"
-#: src/lib/elementary/efl_ui_check.c:65 src/lib/elementary/efl_ui_check.c:210
-#: src/lib/elementary/efl_ui_radio.c:120 src/lib/elementary/efl_ui_radio.c:199
+#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201
+#: src/lib/elementary/efl_ui_radio.c:136 src/lib/elementary/efl_ui_radio.c:202
msgid "State: On"
msgstr "Κατάσταση: Ενεργό"
-#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:222
-#: src/lib/elementary/efl_ui_radio.c:201
+#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:213
+#: src/lib/elementary/efl_ui_radio.c:204
msgid "State: Off"
msgstr "Κατάσταση: Ανενεργό"
-#: src/lib/elementary/efl_ui_check.c:206 src/lib/elementary/efl_ui_check.c:219
+#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210
msgid "State"
msgstr "Κατάσταση"
-#: src/lib/elementary/efl_ui_check.c:340
+#: src/lib/elementary/efl_ui_check.c:355
msgid "Check"
msgstr "Επιλογή"
-#: src/lib/elementary/elm_clock.c:304
+#: src/lib/elementary/elm_clock.c:309
#, fuzzy
msgid "clock increment button for am,pm"
msgstr "επόμενο κουμπί ρολογιού για πμ,μμ"
-#: src/lib/elementary/elm_clock.c:312
+#: src/lib/elementary/elm_clock.c:317
#, fuzzy
msgid "clock decrement button for am,pm"
msgstr "προηγούμενο κουμπί ρολογιού για πμ,μμ"
-#: src/lib/elementary/elm_clock.c:691
+#: src/lib/elementary/elm_clock.c:714
msgid "State: Editable"
msgstr "Κατάσταση: Επεξεργάσιμο"
-#: src/lib/elementary/elm_clock.c:726
+#: src/lib/elementary/elm_clock.c:749
msgid "Clock"
msgstr "Ρολοι"
@@ -440,7 +440,7 @@ msgstr ""
msgid "A:"
msgstr ""
-#: src/lib/elementary/elm_colorselector.c:1706
+#: src/lib/elementary/elm_colorselector.c:1707
msgid "color selector palette item"
msgstr "παλέτα επιλογής χρώματος"
@@ -450,11 +450,11 @@ msgstr "παλέτα επιλογής χρώματος"
#. but if this is a right-to-left language like arabic, Farsi,
#. Hebrew, etc. then change this string to be "default:RTL"
#.
-#: src/lib/elementary/elm_config.c:4109
+#: src/lib/elementary/elm_config.c:4187
msgid "default:LTR"
msgstr "default:LTR"
-#: src/lib/elementary/elm_dayselector.c:402
+#: src/lib/elementary/elm_dayselector.c:437
#, fuzzy
msgid "day selector item"
msgstr "επιλογή δίσκου"
@@ -463,27 +463,27 @@ msgstr "επιλογή δίσκου"
msgid "diskselector item"
msgstr "επιλογή δίσκου"
-#: src/lib/elementary/elm_entry.c:1709
+#: src/lib/elementary/elm_entry.c:1723
msgid "Cut"
msgstr "Αποκοπή"
-#: src/lib/elementary/elm_entry.c:1712
+#: src/lib/elementary/elm_entry.c:1726
msgid "Copy"
msgstr "Αντιγραφή"
-#: src/lib/elementary/elm_entry.c:1716 src/lib/elementary/elm_entry.c:1738
+#: src/lib/elementary/elm_entry.c:1730 src/lib/elementary/elm_entry.c:1752
msgid "Paste"
msgstr "Επικόλληση"
-#: src/lib/elementary/elm_entry.c:1731
+#: src/lib/elementary/elm_entry.c:1745
msgid "Select"
msgstr "Επιλογή"
-#: src/lib/elementary/elm_entry.c:3831
+#: src/lib/elementary/elm_entry.c:3894
msgid "Entry"
msgstr "Καταχώριση"
-#: src/lib/elementary/elm_gengrid.c:1513
+#: src/lib/elementary/elm_gengrid.c:1541
msgid "Gengrid Item"
msgstr "Αντικείμενο Gengrid"
@@ -495,40 +495,40 @@ msgstr "Κατάλογος"
msgid "Index Item"
msgstr "Αντικείμενο Καταλόγου"
-#: src/lib/elementary/elm_label.c:405
+#: src/lib/elementary/elm_label.c:403
msgid "Label"
msgstr "Ετικέτα"
-#: src/lib/elementary/elm_panel.c:83
+#: src/lib/elementary/elm_panel.c:84
msgid "state: opened"
msgstr "Κατάσταση: Ανοικτό"
-#: src/lib/elementary/elm_panel.c:84
+#: src/lib/elementary/elm_panel.c:85
msgid "state: closed"
msgstr "Κατάσταση: Κλειστό"
-#: src/lib/elementary/elm_panel.c:124
+#: src/lib/elementary/elm_panel.c:127
msgid "A panel is open"
msgstr ""
-#: src/lib/elementary/elm_panel.c:126
+#: src/lib/elementary/elm_panel.c:129
msgid "Double tap to close panel menu"
msgstr ""
-#: src/lib/elementary/elm_panel.c:178
+#: src/lib/elementary/elm_panel.c:181
msgid "panel button"
msgstr "κουμπί πινακα"
-#: src/lib/elementary/efl_ui_progressbar.c:393
+#: src/lib/elementary/efl_ui_progressbar.c:397
msgid "progressbar"
msgstr "Μπάρα Προόδου"
-#: src/lib/elementary/efl_ui_radio.c:224
+#: src/lib/elementary/efl_ui_radio.c:231
msgid "Radio"
msgstr "Επιλογή"
#: src/lib/elementary/elm_segment_control.c:532
-#: src/lib/elementary/elm_toolbar.c:2278
+#: src/lib/elementary/elm_toolbar.c:2283
msgid "State: Selected"
msgstr "Κατάσταση: Επιλεγμένο"
@@ -541,55 +541,55 @@ msgstr "Κατάσταση: Επιλεγμένο"
msgid "Segment Control Item"
msgstr ""
-#: src/lib/elementary/efl_ui_slider.c:1193
+#: src/lib/elementary/efl_ui_slider.c:681
msgid "slider"
msgstr "μπάρα κύλισης"
-#: src/lib/elementary/elm_spinner.c:1061
+#: src/lib/elementary/elm_spinner.c:1071
msgid "incremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1067
+#: src/lib/elementary/elm_spinner.c:1077
msgid "decremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1100 src/lib/elementary/elm_spinner.c:1167
+#: src/lib/elementary/elm_spinner.c:1110 src/lib/elementary/elm_spinner.c:1177
#, fuzzy
msgid "spinner"
msgstr "spinner"
-#: src/lib/elementary/elm_spinner.c:1109 src/lib/elementary/elm_spinner.c:1150
+#: src/lib/elementary/elm_spinner.c:1119 src/lib/elementary/elm_spinner.c:1160
#, fuzzy
msgid "spinner increment button"
msgstr "κουμπί spinner επόμενο"
-#: src/lib/elementary/elm_spinner.c:1112 src/lib/elementary/elm_spinner.c:1159
+#: src/lib/elementary/elm_spinner.c:1122 src/lib/elementary/elm_spinner.c:1169
#, fuzzy
msgid "spinner decrement button"
msgstr "κουμπί spinner προηγούμενο"
-#: src/lib/elementary/elm_spinner.c:1114
+#: src/lib/elementary/elm_spinner.c:1124
#, fuzzy
msgid "spinner text"
msgstr "spinner"
-#: src/lib/elementary/elm_toolbar.c:1733 src/lib/elementary/elm_toolbar.c:2335
+#: src/lib/elementary/elm_toolbar.c:1738 src/lib/elementary/elm_toolbar.c:2342
msgid "Selected"
msgstr "Επιλεγμένο"
-#: src/lib/elementary/elm_toolbar.c:2274
+#: src/lib/elementary/elm_toolbar.c:2279
msgid "Separator"
msgstr "Διαχωριστικό"
-#: src/lib/elementary/elm_toolbar.c:2280
+#: src/lib/elementary/elm_toolbar.c:2285
msgid "Has menu"
msgstr "Έχει μενού"
-#: src/lib/elementary/elm_toolbar.c:2330
+#: src/lib/elementary/elm_toolbar.c:2337
msgid "Unselected"
msgstr "Μη Επιλεγμένο"
-#: src/lib/elementary/elm_toolbar.c:2347
+#: src/lib/elementary/elm_toolbar.c:2354
msgid "Toolbar Item"
msgstr "Αντικείμενο μπάρας εργαλείων"
diff --git a/po/eo.po b/po/eo.po
index ff9d65902b..ab0e435df7 100644
--- a/po/eo.po
+++ b/po/eo.po
@@ -3,12 +3,12 @@
# This file is distributed under the same license as the enlightenment package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
-#: src/lib/elementary/elm_config.c:4086
+#: src/lib/elementary/elm_config.c:4164
msgid ""
msgstr ""
"Project-Id-Version: enlightenment\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2017-12-20 00:20+0900\n"
+"POT-Creation-Date: 2018-07-09 16:07+0900\n"
"PO-Revision-Date: 2013-11-05 18:59+0000\n"
"Last-Translator: Eliovir <Unknown>\n"
"Language-Team: Esperanto <eo@li.org>\n"
@@ -239,172 +239,172 @@ msgstr "Bildujo"
msgid "Videos"
msgstr "Videujo"
-#: src/lib/elementary/elc_fileselector.c:1907
+#: src/lib/elementary/elc_fileselector.c:1798
msgid "Up"
msgstr "Supren"
-#: src/lib/elementary/elc_fileselector.c:1921
+#: src/lib/elementary/elc_fileselector.c:1812
msgid "Home"
msgstr "Hejmo"
-#: src/lib/elementary/elc_fileselector.c:1940
+#: src/lib/elementary/elc_fileselector.c:1831
msgid "Search"
msgstr ""
-#: src/lib/elementary/elc_fileselector.c:2232
+#: src/lib/elementary/elc_fileselector.c:2107
msgid "OK"
msgstr "Bone"
-#: src/lib/elementary/elc_fileselector.c:2242
-#: src/lib/elementary/elm_entry.c:1719 src/lib/elementary/elm_entry.c:1744
+#: src/lib/elementary/elc_fileselector.c:2117
+#: src/lib/elementary/elm_entry.c:1733 src/lib/elementary/elm_entry.c:1758
msgid "Cancel"
msgstr "Nuligi"
-#: src/lib/elementary/elc_hoversel.c:436 src/lib/elementary/efl_ui_button.c:263
-#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/elm_gengrid.c:1483
-#: src/lib/elementary/elm_genlist.c:1750 src/lib/elementary/elm_list.c:2157
-#: src/lib/elementary/efl_ui_radio.c:198
+#: src/lib/elementary/elc_hoversel.c:438 src/lib/elementary/efl_ui_button.c:208
+#: src/lib/elementary/efl_ui_check.c:188 src/lib/elementary/elm_gengrid.c:1511
+#: src/lib/elementary/elm_genlist.c:1759 src/lib/elementary/elm_list.c:2172
+#: src/lib/elementary/efl_ui_radio.c:201
#: src/lib/elementary/elm_segment_control.c:529
-#: src/lib/elementary/elm_spinner.c:1031 src/lib/elementary/elm_toolbar.c:2276
+#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2281
msgid "State: Disabled"
msgstr "Stato: malŝaltita"
-#: src/lib/elementary/elc_hoversel.c:638
+#: src/lib/elementary/elc_hoversel.c:651
msgid "Hoversel"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:675
+#: src/lib/elementary/elc_multibuttonentry.c:682
msgid "multi button entry label"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:697
+#: src/lib/elementary/elc_multibuttonentry.c:704
msgid "multi button entry item"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:1579
+#: src/lib/elementary/elc_multibuttonentry.c:1586
msgid "multi button entry"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:433
-#: src/lib/elementary/elc_naviframe.c:461
+#: src/lib/elementary/elc_naviframe.c:435
+#: src/lib/elementary/elc_naviframe.c:463
msgid "Title"
msgstr "Titolo"
-#: src/lib/elementary/elc_naviframe.c:440
+#: src/lib/elementary/elc_naviframe.c:442
#, fuzzy
msgid "Subtitle"
msgstr "Titolo"
-#: src/lib/elementary/elc_naviframe.c:1027
-#: src/lib/elementary/elc_naviframe.c:1245
+#: src/lib/elementary/elc_naviframe.c:1029
+#: src/lib/elementary/elc_naviframe.c:1247
msgid "Back"
msgstr "Reen"
-#: src/lib/elementary/elc_naviframe.c:1343
+#: src/lib/elementary/elc_naviframe.c:1345
msgid "Next"
msgstr "Antaŭen"
-#: src/lib/elementary/elc_popup.c:305 src/lib/elementary/elc_popup.c:969
+#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992
msgid "Popup Title"
msgstr "Titolo de spruĉfenestro"
-#: src/lib/elementary/elc_popup.c:315 src/lib/elementary/elc_popup.c:1045
+#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068
msgid "Popup Body Text"
msgstr "Enhava teksto de spruĉfenestro"
-#: src/lib/elementary/elc_popup.c:1820
+#: src/lib/elementary/elc_popup.c:1841
msgid "Alert"
msgstr ""
-#: src/lib/elementary/elm_bubble.c:162
+#: src/lib/elementary/elm_bubble.c:163
msgid "Bubble"
msgstr "Veziko"
-#: src/lib/elementary/efl_ui_button.c:70
+#: src/lib/elementary/efl_ui_button.c:71
msgid "Clicked"
msgstr "Alklakita"
-#: src/lib/elementary/efl_ui_button.c:290
+#: src/lib/elementary/efl_ui_button.c:250
msgid "Button"
msgstr "Butono"
-#: src/lib/elementary/elm_calendar.c:228
+#: src/lib/elementary/elm_calendar.c:244
#: src/lib/elementary/efl_ui_calendar.c:198
msgid "%B %Y"
msgstr "%B %Y"
-#: src/lib/elementary/elm_calendar.c:234
+#: src/lib/elementary/elm_calendar.c:250
msgid "%B"
msgstr "%B"
-#: src/lib/elementary/elm_calendar.c:240
+#: src/lib/elementary/elm_calendar.c:256
msgid "%Y"
msgstr "%V"
-#: src/lib/elementary/elm_calendar.c:365
+#: src/lib/elementary/elm_calendar.c:382
#: src/lib/elementary/efl_ui_calendar.c:245
msgid "calendar item"
msgstr "kalendarero"
-#: src/lib/elementary/elm_calendar.c:392
+#: src/lib/elementary/elm_calendar.c:410
#: src/lib/elementary/efl_ui_calendar.c:272
msgid "calendar decrement month button"
msgstr "Dekrementa butono de monata kalendaro"
-#: src/lib/elementary/elm_calendar.c:398
+#: src/lib/elementary/elm_calendar.c:416
msgid "calendar decrement year button"
msgstr "Dekrementa butono de jara kalendaro"
-#: src/lib/elementary/elm_calendar.c:404
+#: src/lib/elementary/elm_calendar.c:422
#: src/lib/elementary/efl_ui_calendar.c:278
msgid "calendar increment month button"
msgstr "Alkrementa butono de monata kalendaro"
-#: src/lib/elementary/elm_calendar.c:410
+#: src/lib/elementary/elm_calendar.c:428
msgid "calendar increment year button"
msgstr "Alkrementa butono de jara kalendaro"
-#: src/lib/elementary/elm_calendar.c:415
+#: src/lib/elementary/elm_calendar.c:433
#: src/lib/elementary/efl_ui_calendar.c:283
msgid "calendar month"
msgstr "monato de kalendaro"
-#: src/lib/elementary/elm_calendar.c:420
+#: src/lib/elementary/elm_calendar.c:438
#: src/lib/elementary/efl_ui_calendar.c:286
msgid "calendar year"
msgstr "jara kalendaro"
-#: src/lib/elementary/efl_ui_check.c:65 src/lib/elementary/efl_ui_check.c:210
-#: src/lib/elementary/efl_ui_radio.c:120 src/lib/elementary/efl_ui_radio.c:199
+#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201
+#: src/lib/elementary/efl_ui_radio.c:136 src/lib/elementary/efl_ui_radio.c:202
msgid "State: On"
msgstr "Stato: enŝaltita"
-#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:222
-#: src/lib/elementary/efl_ui_radio.c:201
+#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:213
+#: src/lib/elementary/efl_ui_radio.c:204
msgid "State: Off"
msgstr "Stato: malŝaltita"
-#: src/lib/elementary/efl_ui_check.c:206 src/lib/elementary/efl_ui_check.c:219
+#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210
msgid "State"
msgstr "Stato"
-#: src/lib/elementary/efl_ui_check.c:340
+#: src/lib/elementary/efl_ui_check.c:355
msgid "Check"
msgstr "Kontroli"
-#: src/lib/elementary/elm_clock.c:304
+#: src/lib/elementary/elm_clock.c:309
msgid "clock increment button for am,pm"
msgstr "Alkrementa butono de ĥorloĝo por m,ptm"
-#: src/lib/elementary/elm_clock.c:312
+#: src/lib/elementary/elm_clock.c:317
msgid "clock decrement button for am,pm"
msgstr "Dekrementa butono de ĥorloĝo por m,ptm"
-#: src/lib/elementary/elm_clock.c:691
+#: src/lib/elementary/elm_clock.c:714
msgid "State: Editable"
msgstr "Stato: redaktebla"
-#: src/lib/elementary/elm_clock.c:726
+#: src/lib/elementary/elm_clock.c:749
msgid "Clock"
msgstr "Horloĝo"
@@ -428,7 +428,7 @@ msgstr ""
msgid "A:"
msgstr ""
-#: src/lib/elementary/elm_colorselector.c:1706
+#: src/lib/elementary/elm_colorselector.c:1707
msgid "color selector palette item"
msgstr "ero de elektilo de kolorpaletro"
@@ -438,11 +438,11 @@ msgstr "ero de elektilo de kolorpaletro"
#. but if this is a right-to-left language like arabic, Farsi,
#. Hebrew, etc. then change this string to be "default:RTL"
#.
-#: src/lib/elementary/elm_config.c:4109
+#: src/lib/elementary/elm_config.c:4187
msgid "default:LTR"
msgstr "default:LTR"
-#: src/lib/elementary/elm_dayselector.c:402
+#: src/lib/elementary/elm_dayselector.c:437
msgid "day selector item"
msgstr ""
@@ -450,27 +450,27 @@ msgstr ""
msgid "diskselector item"
msgstr "ero de diskelektilo"
-#: src/lib/elementary/elm_entry.c:1709
+#: src/lib/elementary/elm_entry.c:1723
msgid "Cut"
msgstr "Eltondi"
-#: src/lib/elementary/elm_entry.c:1712
+#: src/lib/elementary/elm_entry.c:1726
msgid "Copy"
msgstr "Kopii"
-#: src/lib/elementary/elm_entry.c:1716 src/lib/elementary/elm_entry.c:1738
+#: src/lib/elementary/elm_entry.c:1730 src/lib/elementary/elm_entry.c:1752
msgid "Paste"
msgstr "Alglui"
-#: src/lib/elementary/elm_entry.c:1731
+#: src/lib/elementary/elm_entry.c:1745
msgid "Select"
msgstr "Elekti"
-#: src/lib/elementary/elm_entry.c:3831
+#: src/lib/elementary/elm_entry.c:3894
msgid "Entry"
msgstr "Ero"
-#: src/lib/elementary/elm_gengrid.c:1513
+#: src/lib/elementary/elm_gengrid.c:1541
msgid "Gengrid Item"
msgstr "Ero de komuna krado"
@@ -482,40 +482,40 @@ msgstr "Indekso"
msgid "Index Item"
msgstr "Indeksero"
-#: src/lib/elementary/elm_label.c:405
+#: src/lib/elementary/elm_label.c:403
msgid "Label"
msgstr "Etikedo"
-#: src/lib/elementary/elm_panel.c:83
+#: src/lib/elementary/elm_panel.c:84
msgid "state: opened"
msgstr "stato: malfermita"
-#: src/lib/elementary/elm_panel.c:84
+#: src/lib/elementary/elm_panel.c:85
msgid "state: closed"
msgstr "stato: fermita"
-#: src/lib/elementary/elm_panel.c:124
+#: src/lib/elementary/elm_panel.c:127
msgid "A panel is open"
msgstr ""
-#: src/lib/elementary/elm_panel.c:126
+#: src/lib/elementary/elm_panel.c:129
msgid "Double tap to close panel menu"
msgstr ""
-#: src/lib/elementary/elm_panel.c:178
+#: src/lib/elementary/elm_panel.c:181
msgid "panel button"
msgstr "butono de panelo"
-#: src/lib/elementary/efl_ui_progressbar.c:393
+#: src/lib/elementary/efl_ui_progressbar.c:397
msgid "progressbar"
msgstr "progresbreto"
-#: src/lib/elementary/efl_ui_radio.c:224
+#: src/lib/elementary/efl_ui_radio.c:231
msgid "Radio"
msgstr "Radiobutono"
#: src/lib/elementary/elm_segment_control.c:532
-#: src/lib/elementary/elm_toolbar.c:2278
+#: src/lib/elementary/elm_toolbar.c:2283
msgid "State: Selected"
msgstr "Stato: elektita"
@@ -527,51 +527,51 @@ msgstr "Stato: ne elektita"
msgid "Segment Control Item"
msgstr ""
-#: src/lib/elementary/efl_ui_slider.c:1193
+#: src/lib/elementary/efl_ui_slider.c:681
msgid "slider"
msgstr "ŝovilo"
-#: src/lib/elementary/elm_spinner.c:1061
+#: src/lib/elementary/elm_spinner.c:1071
msgid "incremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1067
+#: src/lib/elementary/elm_spinner.c:1077
msgid "decremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1100 src/lib/elementary/elm_spinner.c:1167
+#: src/lib/elementary/elm_spinner.c:1110 src/lib/elementary/elm_spinner.c:1177
msgid "spinner"
msgstr "sago-butono"
-#: src/lib/elementary/elm_spinner.c:1109 src/lib/elementary/elm_spinner.c:1150
+#: src/lib/elementary/elm_spinner.c:1119 src/lib/elementary/elm_spinner.c:1160
msgid "spinner increment button"
msgstr "alkrementa sago-butono"
-#: src/lib/elementary/elm_spinner.c:1112 src/lib/elementary/elm_spinner.c:1159
+#: src/lib/elementary/elm_spinner.c:1122 src/lib/elementary/elm_spinner.c:1169
msgid "spinner decrement button"
msgstr "dekrementa sago-butono"
-#: src/lib/elementary/elm_spinner.c:1114
+#: src/lib/elementary/elm_spinner.c:1124
#, fuzzy
msgid "spinner text"
msgstr "sago-butono"
-#: src/lib/elementary/elm_toolbar.c:1733 src/lib/elementary/elm_toolbar.c:2335
+#: src/lib/elementary/elm_toolbar.c:1738 src/lib/elementary/elm_toolbar.c:2342
msgid "Selected"
msgstr "Elektita"
-#: src/lib/elementary/elm_toolbar.c:2274
+#: src/lib/elementary/elm_toolbar.c:2279
msgid "Separator"
msgstr "Disigilo"
-#: src/lib/elementary/elm_toolbar.c:2280
+#: src/lib/elementary/elm_toolbar.c:2285
msgid "Has menu"
msgstr "Ĝi havas menuo"
-#: src/lib/elementary/elm_toolbar.c:2330
+#: src/lib/elementary/elm_toolbar.c:2337
msgid "Unselected"
msgstr "Malelektita"
-#: src/lib/elementary/elm_toolbar.c:2347
+#: src/lib/elementary/elm_toolbar.c:2354
msgid "Toolbar Item"
msgstr "Ilobretero"
diff --git a/po/es.po b/po/es.po
index e88a18d9d8..5f4b6eef12 100644
--- a/po/es.po
+++ b/po/es.po
@@ -4,12 +4,12 @@
# Aníbal Garrido <khany@member.trisquel.info>, 2012.
# Adrián Arévalo <adri58@gmail.com>, 2015.
# Roy W. Reese <waterbearer54@gmx.com> 2015.
-#: src/lib/elementary/elm_config.c:4086
+#: src/lib/elementary/elm_config.c:4164
msgid ""
msgstr ""
"Project-Id-Version: elementary\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2017-12-20 00:20+0900\n"
+"POT-Creation-Date: 2018-07-09 16:07+0900\n"
"PO-Revision-Date: 2015-05-03 18:19+0100\n"
"Last-Translator: Adrián Arévalo <adri58@gmail.com>\n"
"Language-Team: Enlightenment Team\n"
@@ -239,176 +239,176 @@ msgstr "Imágenes"
msgid "Videos"
msgstr "Vídeos"
-#: src/lib/elementary/elc_fileselector.c:1907
+#: src/lib/elementary/elc_fileselector.c:1798
msgid "Up"
msgstr "Arriba"
-#: src/lib/elementary/elc_fileselector.c:1921
+#: src/lib/elementary/elc_fileselector.c:1812
msgid "Home"
msgstr "Carpeta personal"
-#: src/lib/elementary/elc_fileselector.c:1940
+#: src/lib/elementary/elc_fileselector.c:1831
msgid "Search"
msgstr "Buscar"
-#: src/lib/elementary/elc_fileselector.c:2232
+#: src/lib/elementary/elc_fileselector.c:2107
msgid "OK"
msgstr "Aceptar"
-#: src/lib/elementary/elc_fileselector.c:2242
-#: src/lib/elementary/elm_entry.c:1719 src/lib/elementary/elm_entry.c:1744
+#: src/lib/elementary/elc_fileselector.c:2117
+#: src/lib/elementary/elm_entry.c:1733 src/lib/elementary/elm_entry.c:1758
msgid "Cancel"
msgstr "Cancelar"
-#: src/lib/elementary/elc_hoversel.c:436 src/lib/elementary/efl_ui_button.c:263
-#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/elm_gengrid.c:1483
-#: src/lib/elementary/elm_genlist.c:1750 src/lib/elementary/elm_list.c:2157
-#: src/lib/elementary/efl_ui_radio.c:198
+#: src/lib/elementary/elc_hoversel.c:438 src/lib/elementary/efl_ui_button.c:208
+#: src/lib/elementary/efl_ui_check.c:188 src/lib/elementary/elm_gengrid.c:1511
+#: src/lib/elementary/elm_genlist.c:1759 src/lib/elementary/elm_list.c:2172
+#: src/lib/elementary/efl_ui_radio.c:201
#: src/lib/elementary/elm_segment_control.c:529
-#: src/lib/elementary/elm_spinner.c:1031 src/lib/elementary/elm_toolbar.c:2276
+#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2281
msgid "State: Disabled"
msgstr "Estado: Desactivado"
-#: src/lib/elementary/elc_hoversel.c:638
+#: src/lib/elementary/elc_hoversel.c:651
msgid "Hoversel"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:675
+#: src/lib/elementary/elc_multibuttonentry.c:682
msgid "multi button entry label"
msgstr "etiqueta de entrada multi-botón"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:697
+#: src/lib/elementary/elc_multibuttonentry.c:704
msgid "multi button entry item"
msgstr "elemento de entrada multi-botón"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:1579
+#: src/lib/elementary/elc_multibuttonentry.c:1586
msgid "multi button entry"
msgstr "entrada multi-botón"
-#: src/lib/elementary/elc_naviframe.c:433
-#: src/lib/elementary/elc_naviframe.c:461
+#: src/lib/elementary/elc_naviframe.c:435
+#: src/lib/elementary/elc_naviframe.c:463
msgid "Title"
msgstr "Título"
-#: src/lib/elementary/elc_naviframe.c:440
+#: src/lib/elementary/elc_naviframe.c:442
#, fuzzy
msgid "Subtitle"
msgstr "Título"
-#: src/lib/elementary/elc_naviframe.c:1027
-#: src/lib/elementary/elc_naviframe.c:1245
+#: src/lib/elementary/elc_naviframe.c:1029
+#: src/lib/elementary/elc_naviframe.c:1247
msgid "Back"
msgstr "Atrás"
-#: src/lib/elementary/elc_naviframe.c:1343
+#: src/lib/elementary/elc_naviframe.c:1345
msgid "Next"
msgstr "Siguiente"
-#: src/lib/elementary/elc_popup.c:305 src/lib/elementary/elc_popup.c:969
+#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992
#, fuzzy
msgid "Popup Title"
msgstr "Nombre emergente"
-#: src/lib/elementary/elc_popup.c:315 src/lib/elementary/elc_popup.c:1045
+#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068
#, fuzzy
msgid "Popup Body Text"
msgstr "Texto emergente"
-#: src/lib/elementary/elc_popup.c:1820
+#: src/lib/elementary/elc_popup.c:1841
msgid "Alert"
msgstr ""
-#: src/lib/elementary/elm_bubble.c:162
+#: src/lib/elementary/elm_bubble.c:163
msgid "Bubble"
msgstr "Burbuja"
# Antiguemente: "Clickado"
-#: src/lib/elementary/efl_ui_button.c:70
+#: src/lib/elementary/efl_ui_button.c:71
msgid "Clicked"
msgstr "Seleccionado"
-#: src/lib/elementary/efl_ui_button.c:290
+#: src/lib/elementary/efl_ui_button.c:250
msgid "Button"
msgstr "Botón"
-#: src/lib/elementary/elm_calendar.c:228
+#: src/lib/elementary/elm_calendar.c:244
#: src/lib/elementary/efl_ui_calendar.c:198
msgid "%B %Y"
msgstr "%B %Y"
-#: src/lib/elementary/elm_calendar.c:234
+#: src/lib/elementary/elm_calendar.c:250
msgid "%B"
msgstr "%B"
-#: src/lib/elementary/elm_calendar.c:240
+#: src/lib/elementary/elm_calendar.c:256
msgid "%Y"
msgstr "%Y"
-#: src/lib/elementary/elm_calendar.c:365
+#: src/lib/elementary/elm_calendar.c:382
#: src/lib/elementary/efl_ui_calendar.c:245
msgid "calendar item"
msgstr "elemento de calendario"
-#: src/lib/elementary/elm_calendar.c:392
+#: src/lib/elementary/elm_calendar.c:410
#: src/lib/elementary/efl_ui_calendar.c:272
msgid "calendar decrement month button"
msgstr "Botón de decremento del mes"
-#: src/lib/elementary/elm_calendar.c:398
+#: src/lib/elementary/elm_calendar.c:416
msgid "calendar decrement year button"
msgstr "Botón de decremento del año"
-#: src/lib/elementary/elm_calendar.c:404
+#: src/lib/elementary/elm_calendar.c:422
#: src/lib/elementary/efl_ui_calendar.c:278
msgid "calendar increment month button"
msgstr "Botón de incremento del mes"
-#: src/lib/elementary/elm_calendar.c:410
+#: src/lib/elementary/elm_calendar.c:428
msgid "calendar increment year button"
msgstr "Botón de incremento del año"
-#: src/lib/elementary/elm_calendar.c:415
+#: src/lib/elementary/elm_calendar.c:433
#: src/lib/elementary/efl_ui_calendar.c:283
msgid "calendar month"
msgstr "mes del calendario"
-#: src/lib/elementary/elm_calendar.c:420
+#: src/lib/elementary/elm_calendar.c:438
#: src/lib/elementary/efl_ui_calendar.c:286
msgid "calendar year"
msgstr "año del calendario"
# RR: Traducción italiana usa ativado/desactivado. No sé a que refiere la cadena.
-#: src/lib/elementary/efl_ui_check.c:65 src/lib/elementary/efl_ui_check.c:210
-#: src/lib/elementary/efl_ui_radio.c:120 src/lib/elementary/efl_ui_radio.c:199
+#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201
+#: src/lib/elementary/efl_ui_radio.c:136 src/lib/elementary/efl_ui_radio.c:202
msgid "State: On"
msgstr "Estado: Conectado"
-#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:222
-#: src/lib/elementary/efl_ui_radio.c:201
+#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:213
+#: src/lib/elementary/efl_ui_radio.c:204
msgid "State: Off"
msgstr "Estado: Desconectado"
-#: src/lib/elementary/efl_ui_check.c:206 src/lib/elementary/efl_ui_check.c:219
+#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210
msgid "State"
msgstr "Estado"
-#: src/lib/elementary/efl_ui_check.c:340
+#: src/lib/elementary/efl_ui_check.c:355
msgid "Check"
msgstr "Comprobar"
-#: src/lib/elementary/elm_clock.c:304
+#: src/lib/elementary/elm_clock.c:309
msgid "clock increment button for am,pm"
msgstr "Botón de aumento del reloj para am,pm"
-#: src/lib/elementary/elm_clock.c:312
+#: src/lib/elementary/elm_clock.c:317
msgid "clock decrement button for am,pm"
msgstr "Botón de decremento del reloj para am,pm"
-#: src/lib/elementary/elm_clock.c:691
+#: src/lib/elementary/elm_clock.c:714
msgid "State: Editable"
msgstr "Estado: Editable"
-#: src/lib/elementary/elm_clock.c:726
+#: src/lib/elementary/elm_clock.c:749
msgid "Clock"
msgstr "Reloj"
@@ -433,7 +433,7 @@ msgid "A:"
msgstr ""
# RR: Antiguamente - "Paleta de selección de color", pero creo que refiere a un selector como en las cadenas más abajo.
-#: src/lib/elementary/elm_colorselector.c:1706
+#: src/lib/elementary/elm_colorselector.c:1707
msgid "color selector palette item"
msgstr "Selector de color de paleta"
@@ -443,11 +443,11 @@ msgstr "Selector de color de paleta"
#. but if this is a right-to-left language like arabic, Farsi,
#. Hebrew, etc. then change this string to be "default:RTL"
#.
-#: src/lib/elementary/elm_config.c:4109
+#: src/lib/elementary/elm_config.c:4187
msgid "default:LTR"
msgstr "default:LTR"
-#: src/lib/elementary/elm_dayselector.c:402
+#: src/lib/elementary/elm_dayselector.c:437
msgid "day selector item"
msgstr "Selector de día"
@@ -455,27 +455,27 @@ msgstr "Selector de día"
msgid "diskselector item"
msgstr "Selector de disco"
-#: src/lib/elementary/elm_entry.c:1709
+#: src/lib/elementary/elm_entry.c:1723
msgid "Cut"
msgstr "Cortar"
-#: src/lib/elementary/elm_entry.c:1712
+#: src/lib/elementary/elm_entry.c:1726
msgid "Copy"
msgstr "Copiar"
-#: src/lib/elementary/elm_entry.c:1716 src/lib/elementary/elm_entry.c:1738
+#: src/lib/elementary/elm_entry.c:1730 src/lib/elementary/elm_entry.c:1752
msgid "Paste"
msgstr "Pegar"
-#: src/lib/elementary/elm_entry.c:1731
+#: src/lib/elementary/elm_entry.c:1745
msgid "Select"
msgstr "Seleccionar"
-#: src/lib/elementary/elm_entry.c:3831
+#: src/lib/elementary/elm_entry.c:3894
msgid "Entry"
msgstr "Entrada"
-#: src/lib/elementary/elm_gengrid.c:1513
+#: src/lib/elementary/elm_gengrid.c:1541
msgid "Gengrid Item"
msgstr "Cuadrícula genérica"
@@ -487,40 +487,40 @@ msgstr "Índice"
msgid "Index Item"
msgstr "Elemento del índice"
-#: src/lib/elementary/elm_label.c:405
+#: src/lib/elementary/elm_label.c:403
msgid "Label"
msgstr "Etiqueta"
-#: src/lib/elementary/elm_panel.c:83
+#: src/lib/elementary/elm_panel.c:84
msgid "state: opened"
msgstr "estado: abierto"
-#: src/lib/elementary/elm_panel.c:84
+#: src/lib/elementary/elm_panel.c:85
msgid "state: closed"
msgstr "estado: cerrado"
-#: src/lib/elementary/elm_panel.c:124
+#: src/lib/elementary/elm_panel.c:127
msgid "A panel is open"
msgstr "Ya hay un panel abierto"
-#: src/lib/elementary/elm_panel.c:126
+#: src/lib/elementary/elm_panel.c:129
msgid "Double tap to close panel menu"
msgstr "Doble click para cerrar el menú de panel"
-#: src/lib/elementary/elm_panel.c:178
+#: src/lib/elementary/elm_panel.c:181
msgid "panel button"
msgstr "botón del panel"
-#: src/lib/elementary/efl_ui_progressbar.c:393
+#: src/lib/elementary/efl_ui_progressbar.c:397
msgid "progressbar"
msgstr "barra de progreso"
-#: src/lib/elementary/efl_ui_radio.c:224
+#: src/lib/elementary/efl_ui_radio.c:231
msgid "Radio"
msgstr "Radio"
#: src/lib/elementary/elm_segment_control.c:532
-#: src/lib/elementary/elm_toolbar.c:2278
+#: src/lib/elementary/elm_toolbar.c:2283
msgid "State: Selected"
msgstr "Estado: Seleccionado"
@@ -532,52 +532,52 @@ msgstr "Estado: No seleccionado"
msgid "Segment Control Item"
msgstr "Elemento del control del segmento"
-#: src/lib/elementary/efl_ui_slider.c:1193
+#: src/lib/elementary/efl_ui_slider.c:681
msgid "slider"
msgstr "deslizador"
-#: src/lib/elementary/elm_spinner.c:1061
+#: src/lib/elementary/elm_spinner.c:1071
msgid "incremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1067
+#: src/lib/elementary/elm_spinner.c:1077
msgid "decremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1100 src/lib/elementary/elm_spinner.c:1167
+#: src/lib/elementary/elm_spinner.c:1110 src/lib/elementary/elm_spinner.c:1177
msgid "spinner"
msgstr "spinner"
-#: src/lib/elementary/elm_spinner.c:1109 src/lib/elementary/elm_spinner.c:1150
+#: src/lib/elementary/elm_spinner.c:1119 src/lib/elementary/elm_spinner.c:1160
msgid "spinner increment button"
msgstr "botón de incremento del spinner"
-#: src/lib/elementary/elm_spinner.c:1112 src/lib/elementary/elm_spinner.c:1159
+#: src/lib/elementary/elm_spinner.c:1122 src/lib/elementary/elm_spinner.c:1169
msgid "spinner decrement button"
msgstr "botón de decremento del spinner"
-#: src/lib/elementary/elm_spinner.c:1114
+#: src/lib/elementary/elm_spinner.c:1124
#, fuzzy
msgid "spinner text"
msgstr "spinner"
-#: src/lib/elementary/elm_toolbar.c:1733 src/lib/elementary/elm_toolbar.c:2335
+#: src/lib/elementary/elm_toolbar.c:1738 src/lib/elementary/elm_toolbar.c:2342
msgid "Selected"
msgstr "Seleccionado"
-#: src/lib/elementary/elm_toolbar.c:2274
+#: src/lib/elementary/elm_toolbar.c:2279
msgid "Separator"
msgstr "Separador"
-#: src/lib/elementary/elm_toolbar.c:2280
+#: src/lib/elementary/elm_toolbar.c:2285
msgid "Has menu"
msgstr "Tiene menú"
-#: src/lib/elementary/elm_toolbar.c:2330
+#: src/lib/elementary/elm_toolbar.c:2337
msgid "Unselected"
msgstr "Sin seleccionar"
-#: src/lib/elementary/elm_toolbar.c:2347
+#: src/lib/elementary/elm_toolbar.c:2354
msgid "Toolbar Item"
msgstr "Elemento de la barra de herramientas"
diff --git a/po/fi.po b/po/fi.po
index 50d01ef391..1d31121816 100644
--- a/po/fi.po
+++ b/po/fi.po
@@ -3,12 +3,12 @@
# This file is distributed under the same license as the enlightenment package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
#
-#: src/lib/elementary/elm_config.c:4086
+#: src/lib/elementary/elm_config.c:4164
msgid ""
msgstr ""
"Project-Id-Version: enlightenment\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2017-12-20 00:20+0900\n"
+"POT-Creation-Date: 2018-07-09 16:07+0900\n"
"PO-Revision-Date: 2014-08-31 15:13+0000\n"
"Last-Translator: Kai Huuhko <kai.huuhko@gmail.com>\n"
"Language-Team: Finnish <fi@li.org>\n"
@@ -239,172 +239,172 @@ msgstr "Kuvat"
msgid "Videos"
msgstr "Videot"
-#: src/lib/elementary/elc_fileselector.c:1907
+#: src/lib/elementary/elc_fileselector.c:1798
msgid "Up"
msgstr "Ylös"
-#: src/lib/elementary/elc_fileselector.c:1921
+#: src/lib/elementary/elc_fileselector.c:1812
msgid "Home"
msgstr "Koti"
-#: src/lib/elementary/elc_fileselector.c:1940
+#: src/lib/elementary/elc_fileselector.c:1831
msgid "Search"
msgstr ""
-#: src/lib/elementary/elc_fileselector.c:2232
+#: src/lib/elementary/elc_fileselector.c:2107
msgid "OK"
msgstr "OK"
-#: src/lib/elementary/elc_fileselector.c:2242
-#: src/lib/elementary/elm_entry.c:1719 src/lib/elementary/elm_entry.c:1744
+#: src/lib/elementary/elc_fileselector.c:2117
+#: src/lib/elementary/elm_entry.c:1733 src/lib/elementary/elm_entry.c:1758
msgid "Cancel"
msgstr "Peruuta"
-#: src/lib/elementary/elc_hoversel.c:436 src/lib/elementary/efl_ui_button.c:263
-#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/elm_gengrid.c:1483
-#: src/lib/elementary/elm_genlist.c:1750 src/lib/elementary/elm_list.c:2157
-#: src/lib/elementary/efl_ui_radio.c:198
+#: src/lib/elementary/elc_hoversel.c:438 src/lib/elementary/efl_ui_button.c:208
+#: src/lib/elementary/efl_ui_check.c:188 src/lib/elementary/elm_gengrid.c:1511
+#: src/lib/elementary/elm_genlist.c:1759 src/lib/elementary/elm_list.c:2172
+#: src/lib/elementary/efl_ui_radio.c:201
#: src/lib/elementary/elm_segment_control.c:529
-#: src/lib/elementary/elm_spinner.c:1031 src/lib/elementary/elm_toolbar.c:2276
+#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2281
msgid "State: Disabled"
msgstr "Tila: Pois käytöstä"
-#: src/lib/elementary/elc_hoversel.c:638
+#: src/lib/elementary/elc_hoversel.c:651
msgid "Hoversel"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:675
+#: src/lib/elementary/elc_multibuttonentry.c:682
msgid "multi button entry label"
msgstr "moninappisyöttökentän nimiö"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:697
+#: src/lib/elementary/elc_multibuttonentry.c:704
msgid "multi button entry item"
msgstr "moninappisyöttökentän kohta"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:1579
+#: src/lib/elementary/elc_multibuttonentry.c:1586
msgid "multi button entry"
msgstr "moninappisyöttökenttä"
-#: src/lib/elementary/elc_naviframe.c:433
-#: src/lib/elementary/elc_naviframe.c:461
+#: src/lib/elementary/elc_naviframe.c:435
+#: src/lib/elementary/elc_naviframe.c:463
msgid "Title"
msgstr "Otsikko"
-#: src/lib/elementary/elc_naviframe.c:440
+#: src/lib/elementary/elc_naviframe.c:442
#, fuzzy
msgid "Subtitle"
msgstr "Otsikko"
-#: src/lib/elementary/elc_naviframe.c:1027
-#: src/lib/elementary/elc_naviframe.c:1245
+#: src/lib/elementary/elc_naviframe.c:1029
+#: src/lib/elementary/elc_naviframe.c:1247
msgid "Back"
msgstr "Takaisin"
-#: src/lib/elementary/elc_naviframe.c:1343
+#: src/lib/elementary/elc_naviframe.c:1345
msgid "Next"
msgstr "Seuraava"
-#: src/lib/elementary/elc_popup.c:305 src/lib/elementary/elc_popup.c:969
+#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992
msgid "Popup Title"
msgstr "Ponnahdusikkunan otsikko"
-#: src/lib/elementary/elc_popup.c:315 src/lib/elementary/elc_popup.c:1045
+#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068
msgid "Popup Body Text"
msgstr "Ponnahdusikkunan leipäteksti"
-#: src/lib/elementary/elc_popup.c:1820
+#: src/lib/elementary/elc_popup.c:1841
msgid "Alert"
msgstr ""
-#: src/lib/elementary/elm_bubble.c:162
+#: src/lib/elementary/elm_bubble.c:163
msgid "Bubble"
msgstr "Kupla"
-#: src/lib/elementary/efl_ui_button.c:70
+#: src/lib/elementary/efl_ui_button.c:71
msgid "Clicked"
msgstr "Napsautettu"
-#: src/lib/elementary/efl_ui_button.c:290
+#: src/lib/elementary/efl_ui_button.c:250
msgid "Button"
msgstr "Painike"
-#: src/lib/elementary/elm_calendar.c:228
+#: src/lib/elementary/elm_calendar.c:244
#: src/lib/elementary/efl_ui_calendar.c:198
msgid "%B %Y"
msgstr "%B %Y"
-#: src/lib/elementary/elm_calendar.c:234
+#: src/lib/elementary/elm_calendar.c:250
msgid "%B"
msgstr "%B"
-#: src/lib/elementary/elm_calendar.c:240
+#: src/lib/elementary/elm_calendar.c:256
msgid "%Y"
msgstr "%Y"
-#: src/lib/elementary/elm_calendar.c:365
+#: src/lib/elementary/elm_calendar.c:382
#: src/lib/elementary/efl_ui_calendar.c:245
msgid "calendar item"
msgstr "kalenterin kohta"
-#: src/lib/elementary/elm_calendar.c:392
+#: src/lib/elementary/elm_calendar.c:410
#: src/lib/elementary/efl_ui_calendar.c:272
msgid "calendar decrement month button"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:398
+#: src/lib/elementary/elm_calendar.c:416
msgid "calendar decrement year button"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:404
+#: src/lib/elementary/elm_calendar.c:422
#: src/lib/elementary/efl_ui_calendar.c:278
msgid "calendar increment month button"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:410
+#: src/lib/elementary/elm_calendar.c:428
msgid "calendar increment year button"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:415
+#: src/lib/elementary/elm_calendar.c:433
#: src/lib/elementary/efl_ui_calendar.c:283
msgid "calendar month"
msgstr "kalenterikuukausi"
-#: src/lib/elementary/elm_calendar.c:420
+#: src/lib/elementary/elm_calendar.c:438
#: src/lib/elementary/efl_ui_calendar.c:286
msgid "calendar year"
msgstr "kalenterivuosi"
-#: src/lib/elementary/efl_ui_check.c:65 src/lib/elementary/efl_ui_check.c:210
-#: src/lib/elementary/efl_ui_radio.c:120 src/lib/elementary/efl_ui_radio.c:199
+#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201
+#: src/lib/elementary/efl_ui_radio.c:136 src/lib/elementary/efl_ui_radio.c:202
msgid "State: On"
msgstr "Tila: päällä"
-#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:222
-#: src/lib/elementary/efl_ui_radio.c:201
+#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:213
+#: src/lib/elementary/efl_ui_radio.c:204
msgid "State: Off"
msgstr "Tila: pois päältä"
-#: src/lib/elementary/efl_ui_check.c:206 src/lib/elementary/efl_ui_check.c:219
+#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210
msgid "State"
msgstr "Tila"
-#: src/lib/elementary/efl_ui_check.c:340
+#: src/lib/elementary/efl_ui_check.c:355
msgid "Check"
msgstr "Valinta"
-#: src/lib/elementary/elm_clock.c:304
+#: src/lib/elementary/elm_clock.c:309
msgid "clock increment button for am,pm"
msgstr ""
-#: src/lib/elementary/elm_clock.c:312
+#: src/lib/elementary/elm_clock.c:317
msgid "clock decrement button for am,pm"
msgstr ""
-#: src/lib/elementary/elm_clock.c:691
+#: src/lib/elementary/elm_clock.c:714
msgid "State: Editable"
msgstr "Tila: muokattavissa"
-#: src/lib/elementary/elm_clock.c:726
+#: src/lib/elementary/elm_clock.c:749
msgid "Clock"
msgstr "Kello"
@@ -428,7 +428,7 @@ msgstr ""
msgid "A:"
msgstr ""
-#: src/lib/elementary/elm_colorselector.c:1706
+#: src/lib/elementary/elm_colorselector.c:1707
msgid "color selector palette item"
msgstr "värivalitsimen palettikohta"
@@ -438,11 +438,11 @@ msgstr "värivalitsimen palettikohta"
#. but if this is a right-to-left language like arabic, Farsi,
#. Hebrew, etc. then change this string to be "default:RTL"
#.
-#: src/lib/elementary/elm_config.c:4109
+#: src/lib/elementary/elm_config.c:4187
msgid "default:LTR"
msgstr "default:LTR"
-#: src/lib/elementary/elm_dayselector.c:402
+#: src/lib/elementary/elm_dayselector.c:437
msgid "day selector item"
msgstr "päivyrin kohta"
@@ -450,27 +450,27 @@ msgstr "päivyrin kohta"
msgid "diskselector item"
msgstr "kiekkovalitsimen kohta"
-#: src/lib/elementary/elm_entry.c:1709
+#: src/lib/elementary/elm_entry.c:1723
msgid "Cut"
msgstr "Leikkaa"
-#: src/lib/elementary/elm_entry.c:1712
+#: src/lib/elementary/elm_entry.c:1726
msgid "Copy"
msgstr "Kopioi"
-#: src/lib/elementary/elm_entry.c:1716 src/lib/elementary/elm_entry.c:1738
+#: src/lib/elementary/elm_entry.c:1730 src/lib/elementary/elm_entry.c:1752
msgid "Paste"
msgstr "Liitä"
-#: src/lib/elementary/elm_entry.c:1731
+#: src/lib/elementary/elm_entry.c:1745
msgid "Select"
msgstr "Valitse"
-#: src/lib/elementary/elm_entry.c:3831
+#: src/lib/elementary/elm_entry.c:3894
msgid "Entry"
msgstr "Syöttökenttä"
-#: src/lib/elementary/elm_gengrid.c:1513
+#: src/lib/elementary/elm_gengrid.c:1541
msgid "Gengrid Item"
msgstr "Gengridin kohta"
@@ -482,40 +482,40 @@ msgstr "Indeksi"
msgid "Index Item"
msgstr "Indeksin kohta"
-#: src/lib/elementary/elm_label.c:405
+#: src/lib/elementary/elm_label.c:403
msgid "Label"
msgstr "Nimiö"
-#: src/lib/elementary/elm_panel.c:83
+#: src/lib/elementary/elm_panel.c:84
msgid "state: opened"
msgstr "tila: avattu"
-#: src/lib/elementary/elm_panel.c:84
+#: src/lib/elementary/elm_panel.c:85
msgid "state: closed"
msgstr "tila: suljettu"
-#: src/lib/elementary/elm_panel.c:124
+#: src/lib/elementary/elm_panel.c:127
msgid "A panel is open"
msgstr "Paneeli on auki"
-#: src/lib/elementary/elm_panel.c:126
+#: src/lib/elementary/elm_panel.c:129
msgid "Double tap to close panel menu"
msgstr "Kaksoisnäpäytä sulkeaksesi paneelivalikon"
-#: src/lib/elementary/elm_panel.c:178
+#: src/lib/elementary/elm_panel.c:181
msgid "panel button"
msgstr "Paneelinappi"
-#: src/lib/elementary/efl_ui_progressbar.c:393
+#: src/lib/elementary/efl_ui_progressbar.c:397
msgid "progressbar"
msgstr "Tilanneilmaisin"
-#: src/lib/elementary/efl_ui_radio.c:224
+#: src/lib/elementary/efl_ui_radio.c:231
msgid "Radio"
msgstr "Vaihtoehto"
#: src/lib/elementary/elm_segment_control.c:532
-#: src/lib/elementary/elm_toolbar.c:2278
+#: src/lib/elementary/elm_toolbar.c:2283
msgid "State: Selected"
msgstr "Tila: valittu"
@@ -527,51 +527,51 @@ msgstr "Tila: valitsematon"
msgid "Segment Control Item"
msgstr ""
-#: src/lib/elementary/efl_ui_slider.c:1193
+#: src/lib/elementary/efl_ui_slider.c:681
msgid "slider"
msgstr "liukusäädin"
-#: src/lib/elementary/elm_spinner.c:1061
+#: src/lib/elementary/elm_spinner.c:1071
msgid "incremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1067
+#: src/lib/elementary/elm_spinner.c:1077
msgid "decremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1100 src/lib/elementary/elm_spinner.c:1167
+#: src/lib/elementary/elm_spinner.c:1110 src/lib/elementary/elm_spinner.c:1177
msgid "spinner"
msgstr "pyörövalitsin"
-#: src/lib/elementary/elm_spinner.c:1109 src/lib/elementary/elm_spinner.c:1150
+#: src/lib/elementary/elm_spinner.c:1119 src/lib/elementary/elm_spinner.c:1160
msgid "spinner increment button"
msgstr "Pyörövalitsimen lisää-nappi"
-#: src/lib/elementary/elm_spinner.c:1112 src/lib/elementary/elm_spinner.c:1159
+#: src/lib/elementary/elm_spinner.c:1122 src/lib/elementary/elm_spinner.c:1169
msgid "spinner decrement button"
msgstr "Pyörövalitsimen vähennä-nappi"
-#: src/lib/elementary/elm_spinner.c:1114
+#: src/lib/elementary/elm_spinner.c:1124
#, fuzzy
msgid "spinner text"
msgstr "pyörövalitsin"
-#: src/lib/elementary/elm_toolbar.c:1733 src/lib/elementary/elm_toolbar.c:2335
+#: src/lib/elementary/elm_toolbar.c:1738 src/lib/elementary/elm_toolbar.c:2342
msgid "Selected"
msgstr "Valittu"
-#: src/lib/elementary/elm_toolbar.c:2274
+#: src/lib/elementary/elm_toolbar.c:2279
msgid "Separator"
msgstr "Erotin"
-#: src/lib/elementary/elm_toolbar.c:2280
+#: src/lib/elementary/elm_toolbar.c:2285
msgid "Has menu"
msgstr "Valikollinen"
-#: src/lib/elementary/elm_toolbar.c:2330
+#: src/lib/elementary/elm_toolbar.c:2337
msgid "Unselected"
msgstr "Valitsematon"
-#: src/lib/elementary/elm_toolbar.c:2347
+#: src/lib/elementary/elm_toolbar.c:2354
msgid "Toolbar Item"
msgstr "Työkalupalkin kohta"
diff --git a/po/fr.po b/po/fr.po
index 8ca27b620b..a00ce8c671 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -6,12 +6,12 @@
# Jerome Pinot <ngc891@gmail.com>, 2012.
# Chidambar Zinnoury <illogict@online.fr>, 2013.
#
-#: src/lib/elementary/elm_config.c:4086
+#: src/lib/elementary/elm_config.c:4164
msgid ""
msgstr ""
"Project-Id-Version: Elementary\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2017-12-20 00:20+0900\n"
+"POT-Creation-Date: 2018-07-09 16:07+0900\n"
"PO-Revision-Date: 2014-05-25 20:18+0000\n"
"Last-Translator: Eliovir <Unknown>\n"
"Language-Team: French <sansgourou@gmail.com>\n"
@@ -245,172 +245,172 @@ msgstr "Images"
msgid "Videos"
msgstr "Vidéos"
-#: src/lib/elementary/elc_fileselector.c:1907
+#: src/lib/elementary/elc_fileselector.c:1798
msgid "Up"
msgstr "Monter"
-#: src/lib/elementary/elc_fileselector.c:1921
+#: src/lib/elementary/elc_fileselector.c:1812
msgid "Home"
msgstr "Home"
-#: src/lib/elementary/elc_fileselector.c:1940
+#: src/lib/elementary/elc_fileselector.c:1831
msgid "Search"
msgstr ""
-#: src/lib/elementary/elc_fileselector.c:2232
+#: src/lib/elementary/elc_fileselector.c:2107
msgid "OK"
msgstr "OK"
-#: src/lib/elementary/elc_fileselector.c:2242
-#: src/lib/elementary/elm_entry.c:1719 src/lib/elementary/elm_entry.c:1744
+#: src/lib/elementary/elc_fileselector.c:2117
+#: src/lib/elementary/elm_entry.c:1733 src/lib/elementary/elm_entry.c:1758
msgid "Cancel"
msgstr "Annuler"
-#: src/lib/elementary/elc_hoversel.c:436 src/lib/elementary/efl_ui_button.c:263
-#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/elm_gengrid.c:1483
-#: src/lib/elementary/elm_genlist.c:1750 src/lib/elementary/elm_list.c:2157
-#: src/lib/elementary/efl_ui_radio.c:198
+#: src/lib/elementary/elc_hoversel.c:438 src/lib/elementary/efl_ui_button.c:208
+#: src/lib/elementary/efl_ui_check.c:188 src/lib/elementary/elm_gengrid.c:1511
+#: src/lib/elementary/elm_genlist.c:1759 src/lib/elementary/elm_list.c:2172
+#: src/lib/elementary/efl_ui_radio.c:201
#: src/lib/elementary/elm_segment_control.c:529
-#: src/lib/elementary/elm_spinner.c:1031 src/lib/elementary/elm_toolbar.c:2276
+#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2281
msgid "State: Disabled"
msgstr "État : désactivé"
-#: src/lib/elementary/elc_hoversel.c:638
+#: src/lib/elementary/elc_hoversel.c:651
msgid "Hoversel"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:675
+#: src/lib/elementary/elc_multibuttonentry.c:682
msgid "multi button entry label"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:697
+#: src/lib/elementary/elc_multibuttonentry.c:704
msgid "multi button entry item"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:1579
+#: src/lib/elementary/elc_multibuttonentry.c:1586
msgid "multi button entry"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:433
-#: src/lib/elementary/elc_naviframe.c:461
+#: src/lib/elementary/elc_naviframe.c:435
+#: src/lib/elementary/elc_naviframe.c:463
msgid "Title"
msgstr "Titre"
-#: src/lib/elementary/elc_naviframe.c:440
+#: src/lib/elementary/elc_naviframe.c:442
#, fuzzy
msgid "Subtitle"
msgstr "Titre"
-#: src/lib/elementary/elc_naviframe.c:1027
-#: src/lib/elementary/elc_naviframe.c:1245
+#: src/lib/elementary/elc_naviframe.c:1029
+#: src/lib/elementary/elc_naviframe.c:1247
msgid "Back"
msgstr "Retour"
-#: src/lib/elementary/elc_naviframe.c:1343
+#: src/lib/elementary/elc_naviframe.c:1345
msgid "Next"
msgstr "Suivant"
-#: src/lib/elementary/elc_popup.c:305 src/lib/elementary/elc_popup.c:969
+#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992
msgid "Popup Title"
msgstr "Titre du Popup"
-#: src/lib/elementary/elc_popup.c:315 src/lib/elementary/elc_popup.c:1045
+#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068
msgid "Popup Body Text"
msgstr "Corps du texte du Popup"
-#: src/lib/elementary/elc_popup.c:1820
+#: src/lib/elementary/elc_popup.c:1841
msgid "Alert"
msgstr ""
-#: src/lib/elementary/elm_bubble.c:162
+#: src/lib/elementary/elm_bubble.c:163
msgid "Bubble"
msgstr "Bulle"
-#: src/lib/elementary/efl_ui_button.c:70
+#: src/lib/elementary/efl_ui_button.c:71
msgid "Clicked"
msgstr "Cliqué"
-#: src/lib/elementary/efl_ui_button.c:290
+#: src/lib/elementary/efl_ui_button.c:250
msgid "Button"
msgstr "Bouton"
-#: src/lib/elementary/elm_calendar.c:228
+#: src/lib/elementary/elm_calendar.c:244
#: src/lib/elementary/efl_ui_calendar.c:198
msgid "%B %Y"
msgstr "%B %Y"
-#: src/lib/elementary/elm_calendar.c:234
+#: src/lib/elementary/elm_calendar.c:250
msgid "%B"
msgstr "%B"
-#: src/lib/elementary/elm_calendar.c:240
+#: src/lib/elementary/elm_calendar.c:256
msgid "%Y"
msgstr "%Y"
-#: src/lib/elementary/elm_calendar.c:365
+#: src/lib/elementary/elm_calendar.c:382
#: src/lib/elementary/efl_ui_calendar.c:245
msgid "calendar item"
msgstr "élément du calendrier"
-#: src/lib/elementary/elm_calendar.c:392
+#: src/lib/elementary/elm_calendar.c:410
#: src/lib/elementary/efl_ui_calendar.c:272
msgid "calendar decrement month button"
msgstr "bouton du mois précédent"
-#: src/lib/elementary/elm_calendar.c:398
+#: src/lib/elementary/elm_calendar.c:416
msgid "calendar decrement year button"
msgstr "bouton de l'année précédente"
-#: src/lib/elementary/elm_calendar.c:404
+#: src/lib/elementary/elm_calendar.c:422
#: src/lib/elementary/efl_ui_calendar.c:278
msgid "calendar increment month button"
msgstr "bouton du mois suivant"
-#: src/lib/elementary/elm_calendar.c:410
+#: src/lib/elementary/elm_calendar.c:428
msgid "calendar increment year button"
msgstr "bouton de l'année suivante"
-#: src/lib/elementary/elm_calendar.c:415
+#: src/lib/elementary/elm_calendar.c:433
#: src/lib/elementary/efl_ui_calendar.c:283
msgid "calendar month"
msgstr "Mois du calendrier"
-#: src/lib/elementary/elm_calendar.c:420
+#: src/lib/elementary/elm_calendar.c:438
#: src/lib/elementary/efl_ui_calendar.c:286
msgid "calendar year"
msgstr "Année du calendrier"
-#: src/lib/elementary/efl_ui_check.c:65 src/lib/elementary/efl_ui_check.c:210
-#: src/lib/elementary/efl_ui_radio.c:120 src/lib/elementary/efl_ui_radio.c:199
+#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201
+#: src/lib/elementary/efl_ui_radio.c:136 src/lib/elementary/efl_ui_radio.c:202
msgid "State: On"
msgstr "État : activé"
-#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:222
-#: src/lib/elementary/efl_ui_radio.c:201
+#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:213
+#: src/lib/elementary/efl_ui_radio.c:204
msgid "State: Off"
msgstr "État : désactivé"
-#: src/lib/elementary/efl_ui_check.c:206 src/lib/elementary/efl_ui_check.c:219
+#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210
msgid "State"
msgstr "État"
-#: src/lib/elementary/efl_ui_check.c:340
+#: src/lib/elementary/efl_ui_check.c:355
msgid "Check"
msgstr "À cocher"
-#: src/lib/elementary/elm_clock.c:304
+#: src/lib/elementary/elm_clock.c:309
msgid "clock increment button for am,pm"
msgstr "Bouton d'incrémentation pour matin, après-midi"
-#: src/lib/elementary/elm_clock.c:312
+#: src/lib/elementary/elm_clock.c:317
msgid "clock decrement button for am,pm"
msgstr "Bouton de décrémentation pour matin, après-midi"
-#: src/lib/elementary/elm_clock.c:691
+#: src/lib/elementary/elm_clock.c:714
msgid "State: Editable"
msgstr "État : éditable"
-#: src/lib/elementary/elm_clock.c:726
+#: src/lib/elementary/elm_clock.c:749
msgid "Clock"
msgstr "Horloge"
@@ -434,7 +434,7 @@ msgstr ""
msgid "A:"
msgstr ""
-#: src/lib/elementary/elm_colorselector.c:1706
+#: src/lib/elementary/elm_colorselector.c:1707
msgid "color selector palette item"
msgstr "élément de palette de choix de couleur"
@@ -444,11 +444,11 @@ msgstr "élément de palette de choix de couleur"
#. but if this is a right-to-left language like arabic, Farsi,
#. Hebrew, etc. then change this string to be "default:RTL"
#.
-#: src/lib/elementary/elm_config.c:4109
+#: src/lib/elementary/elm_config.c:4187
msgid "default:LTR"
msgstr "default:LTR"
-#: src/lib/elementary/elm_dayselector.c:402
+#: src/lib/elementary/elm_dayselector.c:437
msgid "day selector item"
msgstr "élement de choix de date"
@@ -456,27 +456,27 @@ msgstr "élement de choix de date"
msgid "diskselector item"
msgstr "élément de choix de disque"
-#: src/lib/elementary/elm_entry.c:1709
+#: src/lib/elementary/elm_entry.c:1723
msgid "Cut"
msgstr "Couper"
-#: src/lib/elementary/elm_entry.c:1712
+#: src/lib/elementary/elm_entry.c:1726
msgid "Copy"
msgstr "Copier"
-#: src/lib/elementary/elm_entry.c:1716 src/lib/elementary/elm_entry.c:1738
+#: src/lib/elementary/elm_entry.c:1730 src/lib/elementary/elm_entry.c:1752
msgid "Paste"
msgstr "Coller"
-#: src/lib/elementary/elm_entry.c:1731
+#: src/lib/elementary/elm_entry.c:1745
msgid "Select"
msgstr "Sélectionner"
-#: src/lib/elementary/elm_entry.c:3831
+#: src/lib/elementary/elm_entry.c:3894
msgid "Entry"
msgstr "Entrée"
-#: src/lib/elementary/elm_gengrid.c:1513
+#: src/lib/elementary/elm_gengrid.c:1541
msgid "Gengrid Item"
msgstr ""
@@ -488,40 +488,40 @@ msgstr "Index"
msgid "Index Item"
msgstr ""
-#: src/lib/elementary/elm_label.c:405
+#: src/lib/elementary/elm_label.c:403
msgid "Label"
msgstr "Étiquette"
-#: src/lib/elementary/elm_panel.c:83
+#: src/lib/elementary/elm_panel.c:84
msgid "state: opened"
msgstr "état : ouvert"
-#: src/lib/elementary/elm_panel.c:84
+#: src/lib/elementary/elm_panel.c:85
msgid "state: closed"
msgstr "état : fermé"
-#: src/lib/elementary/elm_panel.c:124
+#: src/lib/elementary/elm_panel.c:127
msgid "A panel is open"
msgstr ""
-#: src/lib/elementary/elm_panel.c:126
+#: src/lib/elementary/elm_panel.c:129
msgid "Double tap to close panel menu"
msgstr ""
-#: src/lib/elementary/elm_panel.c:178
+#: src/lib/elementary/elm_panel.c:181
msgid "panel button"
msgstr "bouton de panneau"
-#: src/lib/elementary/efl_ui_progressbar.c:393
+#: src/lib/elementary/efl_ui_progressbar.c:397
msgid "progressbar"
msgstr "barre de progression"
-#: src/lib/elementary/efl_ui_radio.c:224
+#: src/lib/elementary/efl_ui_radio.c:231
msgid "Radio"
msgstr "Radio"
#: src/lib/elementary/elm_segment_control.c:532
-#: src/lib/elementary/elm_toolbar.c:2278
+#: src/lib/elementary/elm_toolbar.c:2283
msgid "State: Selected"
msgstr "État : sélectionné"
@@ -533,51 +533,51 @@ msgstr "État : désélectionné"
msgid "Segment Control Item"
msgstr "Élément de contrôle de segment"
-#: src/lib/elementary/efl_ui_slider.c:1193
+#: src/lib/elementary/efl_ui_slider.c:681
msgid "slider"
msgstr "curseur"
-#: src/lib/elementary/elm_spinner.c:1061
+#: src/lib/elementary/elm_spinner.c:1071
msgid "incremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1067
+#: src/lib/elementary/elm_spinner.c:1077
msgid "decremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1100 src/lib/elementary/elm_spinner.c:1167
+#: src/lib/elementary/elm_spinner.c:1110 src/lib/elementary/elm_spinner.c:1177
msgid "spinner"
msgstr "bouton fléché"
-#: src/lib/elementary/elm_spinner.c:1109 src/lib/elementary/elm_spinner.c:1150
+#: src/lib/elementary/elm_spinner.c:1119 src/lib/elementary/elm_spinner.c:1160
msgid "spinner increment button"
msgstr "bouton fléché d'incrémentation"
-#: src/lib/elementary/elm_spinner.c:1112 src/lib/elementary/elm_spinner.c:1159
+#: src/lib/elementary/elm_spinner.c:1122 src/lib/elementary/elm_spinner.c:1169
msgid "spinner decrement button"
msgstr "bouton fléché de décrémentation"
-#: src/lib/elementary/elm_spinner.c:1114
+#: src/lib/elementary/elm_spinner.c:1124
#, fuzzy
msgid "spinner text"
msgstr "bouton fléché"
-#: src/lib/elementary/elm_toolbar.c:1733 src/lib/elementary/elm_toolbar.c:2335
+#: src/lib/elementary/elm_toolbar.c:1738 src/lib/elementary/elm_toolbar.c:2342
msgid "Selected"
msgstr "Sélectionné"
-#: src/lib/elementary/elm_toolbar.c:2274
+#: src/lib/elementary/elm_toolbar.c:2279
msgid "Separator"
msgstr "Séparateur"
-#: src/lib/elementary/elm_toolbar.c:2280
+#: src/lib/elementary/elm_toolbar.c:2285
msgid "Has menu"
msgstr "Possède un menu"
-#: src/lib/elementary/elm_toolbar.c:2330
+#: src/lib/elementary/elm_toolbar.c:2337
msgid "Unselected"
msgstr "Désélectionné"
-#: src/lib/elementary/elm_toolbar.c:2347
+#: src/lib/elementary/elm_toolbar.c:2354
msgid "Toolbar Item"
msgstr "Élément de barre d'outils"
diff --git a/po/gl.po b/po/gl.po
index 0e76697619..de82eab78b 100644
--- a/po/gl.po
+++ b/po/gl.po
@@ -2,12 +2,12 @@
# This file is put in the public domain.
# Aníbal Garrido <khany@member.trisquel.info>, 2012.
#
-#: src/lib/elementary/elm_config.c:4086
+#: src/lib/elementary/elm_config.c:4164
msgid ""
msgstr ""
"Project-Id-Version: elementary\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2017-12-20 00:20+0900\n"
+"POT-Creation-Date: 2018-07-09 16:07+0900\n"
"PO-Revision-Date: 2014-05-24 08:39+0000\n"
"Last-Translator: Kaptan <khanyux@gmail.com>\n"
"Language-Team: Galician <proxecto@trasno.net>\n"
@@ -238,172 +238,172 @@ msgstr "Imaxes"
msgid "Videos"
msgstr "Vídeos"
-#: src/lib/elementary/elc_fileselector.c:1907
+#: src/lib/elementary/elc_fileselector.c:1798
msgid "Up"
msgstr "Arriba"
-#: src/lib/elementary/elc_fileselector.c:1921
+#: src/lib/elementary/elc_fileselector.c:1812
msgid "Home"
msgstr "Cartafol persoal"
-#: src/lib/elementary/elc_fileselector.c:1940
+#: src/lib/elementary/elc_fileselector.c:1831
msgid "Search"
msgstr ""
-#: src/lib/elementary/elc_fileselector.c:2232
+#: src/lib/elementary/elc_fileselector.c:2107
msgid "OK"
msgstr "Aceptar"
-#: src/lib/elementary/elc_fileselector.c:2242
-#: src/lib/elementary/elm_entry.c:1719 src/lib/elementary/elm_entry.c:1744
+#: src/lib/elementary/elc_fileselector.c:2117
+#: src/lib/elementary/elm_entry.c:1733 src/lib/elementary/elm_entry.c:1758
msgid "Cancel"
msgstr "Cancelar"
-#: src/lib/elementary/elc_hoversel.c:436 src/lib/elementary/efl_ui_button.c:263
-#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/elm_gengrid.c:1483
-#: src/lib/elementary/elm_genlist.c:1750 src/lib/elementary/elm_list.c:2157
-#: src/lib/elementary/efl_ui_radio.c:198
+#: src/lib/elementary/elc_hoversel.c:438 src/lib/elementary/efl_ui_button.c:208
+#: src/lib/elementary/efl_ui_check.c:188 src/lib/elementary/elm_gengrid.c:1511
+#: src/lib/elementary/elm_genlist.c:1759 src/lib/elementary/elm_list.c:2172
+#: src/lib/elementary/efl_ui_radio.c:201
#: src/lib/elementary/elm_segment_control.c:529
-#: src/lib/elementary/elm_spinner.c:1031 src/lib/elementary/elm_toolbar.c:2276
+#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2281
msgid "State: Disabled"
msgstr "Estado: Desactivado"
-#: src/lib/elementary/elc_hoversel.c:638
+#: src/lib/elementary/elc_hoversel.c:651
msgid "Hoversel"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:675
+#: src/lib/elementary/elc_multibuttonentry.c:682
msgid "multi button entry label"
msgstr "etiqueta de entrada de botón múltiplo"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:697
+#: src/lib/elementary/elc_multibuttonentry.c:704
msgid "multi button entry item"
msgstr "elemento de entrada de botón múltiplo"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:1579
+#: src/lib/elementary/elc_multibuttonentry.c:1586
msgid "multi button entry"
msgstr "entrada de botón múltiplo"
-#: src/lib/elementary/elc_naviframe.c:433
-#: src/lib/elementary/elc_naviframe.c:461
+#: src/lib/elementary/elc_naviframe.c:435
+#: src/lib/elementary/elc_naviframe.c:463
msgid "Title"
msgstr "Título"
-#: src/lib/elementary/elc_naviframe.c:440
+#: src/lib/elementary/elc_naviframe.c:442
#, fuzzy
msgid "Subtitle"
msgstr "subtítulo"
-#: src/lib/elementary/elc_naviframe.c:1027
-#: src/lib/elementary/elc_naviframe.c:1245
+#: src/lib/elementary/elc_naviframe.c:1029
+#: src/lib/elementary/elc_naviframe.c:1247
msgid "Back"
msgstr "Atrás"
-#: src/lib/elementary/elc_naviframe.c:1343
+#: src/lib/elementary/elc_naviframe.c:1345
msgid "Next"
msgstr "Seguinte"
-#: src/lib/elementary/elc_popup.c:305 src/lib/elementary/elc_popup.c:969
+#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992
msgid "Popup Title"
msgstr "Título da emerxente"
-#: src/lib/elementary/elc_popup.c:315 src/lib/elementary/elc_popup.c:1045
+#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068
msgid "Popup Body Text"
msgstr "Corpo de texto emerxente"
-#: src/lib/elementary/elc_popup.c:1820
+#: src/lib/elementary/elc_popup.c:1841
msgid "Alert"
msgstr ""
-#: src/lib/elementary/elm_bubble.c:162
+#: src/lib/elementary/elm_bubble.c:163
msgid "Bubble"
msgstr "Burbulla"
-#: src/lib/elementary/efl_ui_button.c:70
+#: src/lib/elementary/efl_ui_button.c:71
msgid "Clicked"
msgstr "Premido"
-#: src/lib/elementary/efl_ui_button.c:290
+#: src/lib/elementary/efl_ui_button.c:250
msgid "Button"
msgstr "Botón"
-#: src/lib/elementary/elm_calendar.c:228
+#: src/lib/elementary/elm_calendar.c:244
#: src/lib/elementary/efl_ui_calendar.c:198
msgid "%B %Y"
msgstr "%B %Y"
-#: src/lib/elementary/elm_calendar.c:234
+#: src/lib/elementary/elm_calendar.c:250
msgid "%B"
msgstr "%B"
-#: src/lib/elementary/elm_calendar.c:240
+#: src/lib/elementary/elm_calendar.c:256
msgid "%Y"
msgstr "%Y"
-#: src/lib/elementary/elm_calendar.c:365
+#: src/lib/elementary/elm_calendar.c:382
#: src/lib/elementary/efl_ui_calendar.c:245
msgid "calendar item"
msgstr "calendario"
-#: src/lib/elementary/elm_calendar.c:392
+#: src/lib/elementary/elm_calendar.c:410
#: src/lib/elementary/efl_ui_calendar.c:272
msgid "calendar decrement month button"
msgstr "Botón de diminución de mes do calendario"
-#: src/lib/elementary/elm_calendar.c:398
+#: src/lib/elementary/elm_calendar.c:416
msgid "calendar decrement year button"
msgstr "Botón de diminución de ano do calendario"
-#: src/lib/elementary/elm_calendar.c:404
+#: src/lib/elementary/elm_calendar.c:422
#: src/lib/elementary/efl_ui_calendar.c:278
msgid "calendar increment month button"
msgstr "Botón de aumento de mes do calendario"
-#: src/lib/elementary/elm_calendar.c:410
+#: src/lib/elementary/elm_calendar.c:428
msgid "calendar increment year button"
msgstr "Botón de aumento de ano do calendario"
-#: src/lib/elementary/elm_calendar.c:415
+#: src/lib/elementary/elm_calendar.c:433
#: src/lib/elementary/efl_ui_calendar.c:283
msgid "calendar month"
msgstr "mes do calendario"
-#: src/lib/elementary/elm_calendar.c:420
+#: src/lib/elementary/elm_calendar.c:438
#: src/lib/elementary/efl_ui_calendar.c:286
msgid "calendar year"
msgstr "ano do calendario"
-#: src/lib/elementary/efl_ui_check.c:65 src/lib/elementary/efl_ui_check.c:210
-#: src/lib/elementary/efl_ui_radio.c:120 src/lib/elementary/efl_ui_radio.c:199
+#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201
+#: src/lib/elementary/efl_ui_radio.c:136 src/lib/elementary/efl_ui_radio.c:202
msgid "State: On"
msgstr "Estado: Conectado"
-#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:222
-#: src/lib/elementary/efl_ui_radio.c:201
+#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:213
+#: src/lib/elementary/efl_ui_radio.c:204
msgid "State: Off"
msgstr "Estado: Desconectado"
-#: src/lib/elementary/efl_ui_check.c:206 src/lib/elementary/efl_ui_check.c:219
+#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210
msgid "State"
msgstr "Estado"
-#: src/lib/elementary/efl_ui_check.c:340
+#: src/lib/elementary/efl_ui_check.c:355
msgid "Check"
msgstr "Comprobar"
-#: src/lib/elementary/elm_clock.c:304
+#: src/lib/elementary/elm_clock.c:309
msgid "clock increment button for am,pm"
msgstr "Botón de aumento do reloxo para am,pm"
-#: src/lib/elementary/elm_clock.c:312
+#: src/lib/elementary/elm_clock.c:317
msgid "clock decrement button for am,pm"
msgstr "Botón de diminución do reloxo para am,pm"
-#: src/lib/elementary/elm_clock.c:691
+#: src/lib/elementary/elm_clock.c:714
msgid "State: Editable"
msgstr "Estado: Editable"
-#: src/lib/elementary/elm_clock.c:726
+#: src/lib/elementary/elm_clock.c:749
msgid "Clock"
msgstr "Reloxo"
@@ -427,7 +427,7 @@ msgstr ""
msgid "A:"
msgstr ""
-#: src/lib/elementary/elm_colorselector.c:1706
+#: src/lib/elementary/elm_colorselector.c:1707
msgid "color selector palette item"
msgstr "Paleta de selección de cor"
@@ -437,11 +437,11 @@ msgstr "Paleta de selección de cor"
#. but if this is a right-to-left language like arabic, Farsi,
#. Hebrew, etc. then change this string to be "default:RTL"
#.
-#: src/lib/elementary/elm_config.c:4109
+#: src/lib/elementary/elm_config.c:4187
msgid "default:LTR"
msgstr "default:LTR"
-#: src/lib/elementary/elm_dayselector.c:402
+#: src/lib/elementary/elm_dayselector.c:437
msgid "day selector item"
msgstr "selector de día"
@@ -449,27 +449,27 @@ msgstr "selector de día"
msgid "diskselector item"
msgstr "Selector de disco"
-#: src/lib/elementary/elm_entry.c:1709
+#: src/lib/elementary/elm_entry.c:1723
msgid "Cut"
msgstr "Cortar"
-#: src/lib/elementary/elm_entry.c:1712
+#: src/lib/elementary/elm_entry.c:1726
msgid "Copy"
msgstr "Copiar"
-#: src/lib/elementary/elm_entry.c:1716 src/lib/elementary/elm_entry.c:1738
+#: src/lib/elementary/elm_entry.c:1730 src/lib/elementary/elm_entry.c:1752
msgid "Paste"
msgstr "Pegar"
-#: src/lib/elementary/elm_entry.c:1731
+#: src/lib/elementary/elm_entry.c:1745
msgid "Select"
msgstr "Seleccionar"
-#: src/lib/elementary/elm_entry.c:3831
+#: src/lib/elementary/elm_entry.c:3894
msgid "Entry"
msgstr "Entrada"
-#: src/lib/elementary/elm_gengrid.c:1513
+#: src/lib/elementary/elm_gengrid.c:1541
msgid "Gengrid Item"
msgstr "Grella xenérica"
@@ -481,40 +481,40 @@ msgstr "Índice"
msgid "Index Item"
msgstr "Elemento do índice"
-#: src/lib/elementary/elm_label.c:405
+#: src/lib/elementary/elm_label.c:403
msgid "Label"
msgstr "Etiqueta"
-#: src/lib/elementary/elm_panel.c:83
+#: src/lib/elementary/elm_panel.c:84
msgid "state: opened"
msgstr "Estado: aberto"
-#: src/lib/elementary/elm_panel.c:84
+#: src/lib/elementary/elm_panel.c:85
msgid "state: closed"
msgstr "Estado: pechado"
-#: src/lib/elementary/elm_panel.c:124
+#: src/lib/elementary/elm_panel.c:127
msgid "A panel is open"
msgstr ""
-#: src/lib/elementary/elm_panel.c:126
+#: src/lib/elementary/elm_panel.c:129
msgid "Double tap to close panel menu"
msgstr ""
-#: src/lib/elementary/elm_panel.c:178
+#: src/lib/elementary/elm_panel.c:181
msgid "panel button"
msgstr "botón do panel"
-#: src/lib/elementary/efl_ui_progressbar.c:393
+#: src/lib/elementary/efl_ui_progressbar.c:397
msgid "progressbar"
msgstr "barra de progreso"
-#: src/lib/elementary/efl_ui_radio.c:224
+#: src/lib/elementary/efl_ui_radio.c:231
msgid "Radio"
msgstr "Radio"
#: src/lib/elementary/elm_segment_control.c:532
-#: src/lib/elementary/elm_toolbar.c:2278
+#: src/lib/elementary/elm_toolbar.c:2283
msgid "State: Selected"
msgstr "Estado: Seleccionado"
@@ -526,52 +526,52 @@ msgstr "Estado: Sen seleccionar"
msgid "Segment Control Item"
msgstr "Segmento de control"
-#: src/lib/elementary/efl_ui_slider.c:1193
+#: src/lib/elementary/efl_ui_slider.c:681
msgid "slider"
msgstr "Barra de desprazamento"
-#: src/lib/elementary/elm_spinner.c:1061
+#: src/lib/elementary/elm_spinner.c:1071
msgid "incremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1067
+#: src/lib/elementary/elm_spinner.c:1077
msgid "decremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1100 src/lib/elementary/elm_spinner.c:1167
+#: src/lib/elementary/elm_spinner.c:1110 src/lib/elementary/elm_spinner.c:1177
msgid "spinner"
msgstr "botón de spinner"
-#: src/lib/elementary/elm_spinner.c:1109 src/lib/elementary/elm_spinner.c:1150
+#: src/lib/elementary/elm_spinner.c:1119 src/lib/elementary/elm_spinner.c:1160
msgid "spinner increment button"
msgstr "botón de aumento"
-#: src/lib/elementary/elm_spinner.c:1112 src/lib/elementary/elm_spinner.c:1159
+#: src/lib/elementary/elm_spinner.c:1122 src/lib/elementary/elm_spinner.c:1169
msgid "spinner decrement button"
msgstr "botón de disminución"
-#: src/lib/elementary/elm_spinner.c:1114
+#: src/lib/elementary/elm_spinner.c:1124
#, fuzzy
msgid "spinner text"
msgstr "botón de spinner"
-#: src/lib/elementary/elm_toolbar.c:1733 src/lib/elementary/elm_toolbar.c:2335
+#: src/lib/elementary/elm_toolbar.c:1738 src/lib/elementary/elm_toolbar.c:2342
msgid "Selected"
msgstr "Seleccionado"
-#: src/lib/elementary/elm_toolbar.c:2274
+#: src/lib/elementary/elm_toolbar.c:2279
msgid "Separator"
msgstr "Separador"
-#: src/lib/elementary/elm_toolbar.c:2280
+#: src/lib/elementary/elm_toolbar.c:2285
msgid "Has menu"
msgstr "Ten menú"
-#: src/lib/elementary/elm_toolbar.c:2330
+#: src/lib/elementary/elm_toolbar.c:2337
msgid "Unselected"
msgstr "Non seleccionado"
-#: src/lib/elementary/elm_toolbar.c:2347
+#: src/lib/elementary/elm_toolbar.c:2354
msgid "Toolbar Item"
msgstr "Elemento da barra de ferramentas"
diff --git a/po/hu.po b/po/hu.po
index 79549589fa..5a3dfd5b65 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -3,12 +3,12 @@
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
-#: src/lib/elementary/elm_config.c:4086
+#: src/lib/elementary/elm_config.c:4164
msgid ""
msgstr ""
"Project-Id-Version: elementary 1.8.2\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2017-12-20 00:20+0900\n"
+"POT-Creation-Date: 2018-07-09 16:07+0900\n"
"PO-Revision-Date: 2014-01-29 15:27+0100\n"
"Last-Translator: rezso <rezso@rezso.net>\n"
"Language-Team: General\n"
@@ -240,172 +240,172 @@ msgstr "Képek"
msgid "Videos"
msgstr "Videók"
-#: src/lib/elementary/elc_fileselector.c:1907
+#: src/lib/elementary/elc_fileselector.c:1798
msgid "Up"
msgstr "Fel"
-#: src/lib/elementary/elc_fileselector.c:1921
+#: src/lib/elementary/elc_fileselector.c:1812
msgid "Home"
msgstr "Kezdőlap"
-#: src/lib/elementary/elc_fileselector.c:1940
+#: src/lib/elementary/elc_fileselector.c:1831
msgid "Search"
msgstr ""
-#: src/lib/elementary/elc_fileselector.c:2232
+#: src/lib/elementary/elc_fileselector.c:2107
msgid "OK"
msgstr "OK"
-#: src/lib/elementary/elc_fileselector.c:2242
-#: src/lib/elementary/elm_entry.c:1719 src/lib/elementary/elm_entry.c:1744
+#: src/lib/elementary/elc_fileselector.c:2117
+#: src/lib/elementary/elm_entry.c:1733 src/lib/elementary/elm_entry.c:1758
msgid "Cancel"
msgstr "Mégsem"
-#: src/lib/elementary/elc_hoversel.c:436 src/lib/elementary/efl_ui_button.c:263
-#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/elm_gengrid.c:1483
-#: src/lib/elementary/elm_genlist.c:1750 src/lib/elementary/elm_list.c:2157
-#: src/lib/elementary/efl_ui_radio.c:198
+#: src/lib/elementary/elc_hoversel.c:438 src/lib/elementary/efl_ui_button.c:208
+#: src/lib/elementary/efl_ui_check.c:188 src/lib/elementary/elm_gengrid.c:1511
+#: src/lib/elementary/elm_genlist.c:1759 src/lib/elementary/elm_list.c:2172
+#: src/lib/elementary/efl_ui_radio.c:201
#: src/lib/elementary/elm_segment_control.c:529
-#: src/lib/elementary/elm_spinner.c:1031 src/lib/elementary/elm_toolbar.c:2276
+#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2281
msgid "State: Disabled"
msgstr "Állapot: letiltva"
-#: src/lib/elementary/elc_hoversel.c:638
+#: src/lib/elementary/elc_hoversel.c:651
msgid "Hoversel"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:675
+#: src/lib/elementary/elc_multibuttonentry.c:682
msgid "multi button entry label"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:697
+#: src/lib/elementary/elc_multibuttonentry.c:704
msgid "multi button entry item"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:1579
+#: src/lib/elementary/elc_multibuttonentry.c:1586
msgid "multi button entry"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:433
-#: src/lib/elementary/elc_naviframe.c:461
+#: src/lib/elementary/elc_naviframe.c:435
+#: src/lib/elementary/elc_naviframe.c:463
msgid "Title"
msgstr "Cím"
-#: src/lib/elementary/elc_naviframe.c:440
+#: src/lib/elementary/elc_naviframe.c:442
#, fuzzy
msgid "Subtitle"
msgstr "Cím"
-#: src/lib/elementary/elc_naviframe.c:1027
-#: src/lib/elementary/elc_naviframe.c:1245
+#: src/lib/elementary/elc_naviframe.c:1029
+#: src/lib/elementary/elc_naviframe.c:1247
msgid "Back"
msgstr "Vissza"
-#: src/lib/elementary/elc_naviframe.c:1343
+#: src/lib/elementary/elc_naviframe.c:1345
msgid "Next"
msgstr "Következő"
-#: src/lib/elementary/elc_popup.c:305 src/lib/elementary/elc_popup.c:969
+#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992
msgid "Popup Title"
msgstr "Popup címsora"
-#: src/lib/elementary/elc_popup.c:315 src/lib/elementary/elc_popup.c:1045
+#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068
msgid "Popup Body Text"
msgstr "Popup szövege"
-#: src/lib/elementary/elc_popup.c:1820
+#: src/lib/elementary/elc_popup.c:1841
msgid "Alert"
msgstr ""
-#: src/lib/elementary/elm_bubble.c:162
+#: src/lib/elementary/elm_bubble.c:163
msgid "Bubble"
msgstr "Buborék"
-#: src/lib/elementary/efl_ui_button.c:70
+#: src/lib/elementary/efl_ui_button.c:71
msgid "Clicked"
msgstr ""
-#: src/lib/elementary/efl_ui_button.c:290
+#: src/lib/elementary/efl_ui_button.c:250
msgid "Button"
msgstr "Gomb"
-#: src/lib/elementary/elm_calendar.c:228
+#: src/lib/elementary/elm_calendar.c:244
#: src/lib/elementary/efl_ui_calendar.c:198
msgid "%B %Y"
msgstr "%Y. %B"
-#: src/lib/elementary/elm_calendar.c:234
+#: src/lib/elementary/elm_calendar.c:250
msgid "%B"
msgstr "%B"
-#: src/lib/elementary/elm_calendar.c:240
+#: src/lib/elementary/elm_calendar.c:256
msgid "%Y"
msgstr "%Y"
-#: src/lib/elementary/elm_calendar.c:365
+#: src/lib/elementary/elm_calendar.c:382
#: src/lib/elementary/efl_ui_calendar.c:245
msgid "calendar item"
msgstr "naptárelem"
-#: src/lib/elementary/elm_calendar.c:392
+#: src/lib/elementary/elm_calendar.c:410
#: src/lib/elementary/efl_ui_calendar.c:272
msgid "calendar decrement month button"
msgstr "naptár: hónap csökkentése gomb"
-#: src/lib/elementary/elm_calendar.c:398
+#: src/lib/elementary/elm_calendar.c:416
msgid "calendar decrement year button"
msgstr "naptár: év csökkentése gomb"
-#: src/lib/elementary/elm_calendar.c:404
+#: src/lib/elementary/elm_calendar.c:422
#: src/lib/elementary/efl_ui_calendar.c:278
msgid "calendar increment month button"
msgstr "naptár: hónap növelése gomb"
-#: src/lib/elementary/elm_calendar.c:410
+#: src/lib/elementary/elm_calendar.c:428
msgid "calendar increment year button"
msgstr "naptár: év növelése gomb"
-#: src/lib/elementary/elm_calendar.c:415
+#: src/lib/elementary/elm_calendar.c:433
#: src/lib/elementary/efl_ui_calendar.c:283
msgid "calendar month"
msgstr "naptár hónapja"
-#: src/lib/elementary/elm_calendar.c:420
+#: src/lib/elementary/elm_calendar.c:438
#: src/lib/elementary/efl_ui_calendar.c:286
msgid "calendar year"
msgstr "naptár éve"
-#: src/lib/elementary/efl_ui_check.c:65 src/lib/elementary/efl_ui_check.c:210
-#: src/lib/elementary/efl_ui_radio.c:120 src/lib/elementary/efl_ui_radio.c:199
+#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201
+#: src/lib/elementary/efl_ui_radio.c:136 src/lib/elementary/efl_ui_radio.c:202
msgid "State: On"
msgstr "Állapot: be"
-#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:222
-#: src/lib/elementary/efl_ui_radio.c:201
+#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:213
+#: src/lib/elementary/efl_ui_radio.c:204
msgid "State: Off"
msgstr "Állapot: ki"
-#: src/lib/elementary/efl_ui_check.c:206 src/lib/elementary/efl_ui_check.c:219
+#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210
msgid "State"
msgstr "Állapot"
-#: src/lib/elementary/efl_ui_check.c:340
+#: src/lib/elementary/efl_ui_check.c:355
msgid "Check"
msgstr "Ellenőrzés"
-#: src/lib/elementary/elm_clock.c:304
+#: src/lib/elementary/elm_clock.c:309
msgid "clock increment button for am,pm"
msgstr ""
-#: src/lib/elementary/elm_clock.c:312
+#: src/lib/elementary/elm_clock.c:317
msgid "clock decrement button for am,pm"
msgstr ""
-#: src/lib/elementary/elm_clock.c:691
+#: src/lib/elementary/elm_clock.c:714
msgid "State: Editable"
msgstr "Állapot: szerkeszthető"
-#: src/lib/elementary/elm_clock.c:726
+#: src/lib/elementary/elm_clock.c:749
msgid "Clock"
msgstr "Óra"
@@ -429,7 +429,7 @@ msgstr ""
msgid "A:"
msgstr ""
-#: src/lib/elementary/elm_colorselector.c:1706
+#: src/lib/elementary/elm_colorselector.c:1707
msgid "color selector palette item"
msgstr ""
@@ -439,11 +439,11 @@ msgstr ""
#. but if this is a right-to-left language like arabic, Farsi,
#. Hebrew, etc. then change this string to be "default:RTL"
#.
-#: src/lib/elementary/elm_config.c:4109
+#: src/lib/elementary/elm_config.c:4187
msgid "default:LTR"
msgstr "default:LTR"
-#: src/lib/elementary/elm_dayselector.c:402
+#: src/lib/elementary/elm_dayselector.c:437
msgid "day selector item"
msgstr ""
@@ -451,27 +451,27 @@ msgstr ""
msgid "diskselector item"
msgstr ""
-#: src/lib/elementary/elm_entry.c:1709
+#: src/lib/elementary/elm_entry.c:1723
msgid "Cut"
msgstr "Kivágás"
-#: src/lib/elementary/elm_entry.c:1712
+#: src/lib/elementary/elm_entry.c:1726
msgid "Copy"
msgstr "Másolás"
-#: src/lib/elementary/elm_entry.c:1716 src/lib/elementary/elm_entry.c:1738
+#: src/lib/elementary/elm_entry.c:1730 src/lib/elementary/elm_entry.c:1752
msgid "Paste"
msgstr "Beillesztés"
-#: src/lib/elementary/elm_entry.c:1731
+#: src/lib/elementary/elm_entry.c:1745
msgid "Select"
msgstr "Kiválaszt"
-#: src/lib/elementary/elm_entry.c:3831
+#: src/lib/elementary/elm_entry.c:3894
msgid "Entry"
msgstr "Bejegyzés"
-#: src/lib/elementary/elm_gengrid.c:1513
+#: src/lib/elementary/elm_gengrid.c:1541
msgid "Gengrid Item"
msgstr ""
@@ -483,40 +483,40 @@ msgstr ""
msgid "Index Item"
msgstr ""
-#: src/lib/elementary/elm_label.c:405
+#: src/lib/elementary/elm_label.c:403
msgid "Label"
msgstr "Címke"
-#: src/lib/elementary/elm_panel.c:83
+#: src/lib/elementary/elm_panel.c:84
msgid "state: opened"
msgstr "állapot: nyitott"
-#: src/lib/elementary/elm_panel.c:84
+#: src/lib/elementary/elm_panel.c:85
msgid "state: closed"
msgstr "állapot: zárt"
-#: src/lib/elementary/elm_panel.c:124
+#: src/lib/elementary/elm_panel.c:127
msgid "A panel is open"
msgstr ""
-#: src/lib/elementary/elm_panel.c:126
+#: src/lib/elementary/elm_panel.c:129
msgid "Double tap to close panel menu"
msgstr ""
-#: src/lib/elementary/elm_panel.c:178
+#: src/lib/elementary/elm_panel.c:181
msgid "panel button"
msgstr "panelgomb"
-#: src/lib/elementary/efl_ui_progressbar.c:393
+#: src/lib/elementary/efl_ui_progressbar.c:397
msgid "progressbar"
msgstr "folyamatjelző"
-#: src/lib/elementary/efl_ui_radio.c:224
+#: src/lib/elementary/efl_ui_radio.c:231
msgid "Radio"
msgstr "Rádió"
#: src/lib/elementary/elm_segment_control.c:532
-#: src/lib/elementary/elm_toolbar.c:2278
+#: src/lib/elementary/elm_toolbar.c:2283
msgid "State: Selected"
msgstr "Állapot: kijelölve"
@@ -528,50 +528,50 @@ msgstr "Állapot: nincs kijelölve"
msgid "Segment Control Item"
msgstr ""
-#: src/lib/elementary/efl_ui_slider.c:1193
+#: src/lib/elementary/efl_ui_slider.c:681
msgid "slider"
msgstr "csúszka"
-#: src/lib/elementary/elm_spinner.c:1061
+#: src/lib/elementary/elm_spinner.c:1071
msgid "incremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1067
+#: src/lib/elementary/elm_spinner.c:1077
msgid "decremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1100 src/lib/elementary/elm_spinner.c:1167
+#: src/lib/elementary/elm_spinner.c:1110 src/lib/elementary/elm_spinner.c:1177
msgid "spinner"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1109 src/lib/elementary/elm_spinner.c:1150
+#: src/lib/elementary/elm_spinner.c:1119 src/lib/elementary/elm_spinner.c:1160
msgid "spinner increment button"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1112 src/lib/elementary/elm_spinner.c:1159
+#: src/lib/elementary/elm_spinner.c:1122 src/lib/elementary/elm_spinner.c:1169
msgid "spinner decrement button"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1114
+#: src/lib/elementary/elm_spinner.c:1124
msgid "spinner text"
msgstr ""
-#: src/lib/elementary/elm_toolbar.c:1733 src/lib/elementary/elm_toolbar.c:2335
+#: src/lib/elementary/elm_toolbar.c:1738 src/lib/elementary/elm_toolbar.c:2342
msgid "Selected"
msgstr "Kiválasztva"
-#: src/lib/elementary/elm_toolbar.c:2274
+#: src/lib/elementary/elm_toolbar.c:2279
msgid "Separator"
msgstr "Elválasztó"
-#: src/lib/elementary/elm_toolbar.c:2280
+#: src/lib/elementary/elm_toolbar.c:2285
msgid "Has menu"
msgstr ""
-#: src/lib/elementary/elm_toolbar.c:2330
+#: src/lib/elementary/elm_toolbar.c:2337
msgid "Unselected"
msgstr "Nincs kijelölve"
-#: src/lib/elementary/elm_toolbar.c:2347
+#: src/lib/elementary/elm_toolbar.c:2354
msgid "Toolbar Item"
msgstr "Eszköztár elem"
diff --git a/po/it.po b/po/it.po
index 1e1c7b166d..228d970353 100644
--- a/po/it.po
+++ b/po/it.po
@@ -3,13 +3,13 @@
# This file is put in the public domain.
# Massimo Maiurana <maiurana@gmail.com>, 2013
#
-#: src/lib/elementary/elm_config.c:4086
+#: src/lib/elementary/elm_config.c:4164
msgid ""
msgstr ""
"Project-Id-Version: Elementary\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2017-12-20 00:20+0900\n"
-"PO-Revision-Date: 2017-01-01 16:29+0100\n"
+"POT-Creation-Date: 2018-07-09 16:07+0900\n"
+"PO-Revision-Date: 2018-04-01 19:01+0200\n"
"Last-Translator: Massimo Maiurana <maiurana@gmail.com>\n"
"Language-Team: General\n"
"Language: it\n"
@@ -238,172 +238,171 @@ msgstr "Immagini"
msgid "Videos"
msgstr "Video"
-#: src/lib/elementary/elc_fileselector.c:1907
+#: src/lib/elementary/elc_fileselector.c:1798
msgid "Up"
msgstr "Su"
-#: src/lib/elementary/elc_fileselector.c:1921
+#: src/lib/elementary/elc_fileselector.c:1812
msgid "Home"
msgstr "Home"
-#: src/lib/elementary/elc_fileselector.c:1940
+#: src/lib/elementary/elc_fileselector.c:1831
msgid "Search"
msgstr "Cerca"
-#: src/lib/elementary/elc_fileselector.c:2232
+#: src/lib/elementary/elc_fileselector.c:2107
msgid "OK"
msgstr "OK"
-#: src/lib/elementary/elc_fileselector.c:2242
-#: src/lib/elementary/elm_entry.c:1719 src/lib/elementary/elm_entry.c:1744
+#: src/lib/elementary/elc_fileselector.c:2117
+#: src/lib/elementary/elm_entry.c:1733 src/lib/elementary/elm_entry.c:1758
msgid "Cancel"
msgstr "Annulla"
-#: src/lib/elementary/elc_hoversel.c:436 src/lib/elementary/efl_ui_button.c:263
-#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/elm_gengrid.c:1483
-#: src/lib/elementary/elm_genlist.c:1750 src/lib/elementary/elm_list.c:2157
-#: src/lib/elementary/efl_ui_radio.c:198
+#: src/lib/elementary/elc_hoversel.c:438 src/lib/elementary/efl_ui_button.c:208
+#: src/lib/elementary/efl_ui_check.c:188 src/lib/elementary/elm_gengrid.c:1511
+#: src/lib/elementary/elm_genlist.c:1759 src/lib/elementary/elm_list.c:2172
+#: src/lib/elementary/efl_ui_radio.c:201
#: src/lib/elementary/elm_segment_control.c:529
-#: src/lib/elementary/elm_spinner.c:1031 src/lib/elementary/elm_toolbar.c:2276
+#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2281
msgid "State: Disabled"
msgstr "Stato: disabilitato"
-#: src/lib/elementary/elc_hoversel.c:638
+#: src/lib/elementary/elc_hoversel.c:651
msgid "Hoversel"
msgstr "Lista per bottone (hoversel)"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:675
+#: src/lib/elementary/elc_multibuttonentry.c:682
msgid "multi button entry label"
msgstr "etichetta voce multibottone"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:697
+#: src/lib/elementary/elc_multibuttonentry.c:704
msgid "multi button entry item"
msgstr "oggetto voce multibottone"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:1579
+#: src/lib/elementary/elc_multibuttonentry.c:1586
msgid "multi button entry"
msgstr "voce multibottone"
-#: src/lib/elementary/elc_naviframe.c:433
-#: src/lib/elementary/elc_naviframe.c:461
+#: src/lib/elementary/elc_naviframe.c:435
+#: src/lib/elementary/elc_naviframe.c:463
msgid "Title"
msgstr "Titolo"
-#: src/lib/elementary/elc_naviframe.c:440
-#, fuzzy
+#: src/lib/elementary/elc_naviframe.c:442
msgid "Subtitle"
-msgstr "Titolo"
+msgstr "Sottotitolo"
-#: src/lib/elementary/elc_naviframe.c:1027
-#: src/lib/elementary/elc_naviframe.c:1245
+#: src/lib/elementary/elc_naviframe.c:1029
+#: src/lib/elementary/elc_naviframe.c:1247
msgid "Back"
msgstr "Indietro"
-#: src/lib/elementary/elc_naviframe.c:1343
+#: src/lib/elementary/elc_naviframe.c:1345
msgid "Next"
msgstr "Avanti"
-#: src/lib/elementary/elc_popup.c:305 src/lib/elementary/elc_popup.c:969
+#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992
msgid "Popup Title"
msgstr "Titolo popup"
-#: src/lib/elementary/elc_popup.c:315 src/lib/elementary/elc_popup.c:1045
+#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068
msgid "Popup Body Text"
msgstr "Testo corpo popup"
-#: src/lib/elementary/elc_popup.c:1820
+#: src/lib/elementary/elc_popup.c:1841
msgid "Alert"
-msgstr ""
+msgstr "Allarme"
-#: src/lib/elementary/elm_bubble.c:162
+#: src/lib/elementary/elm_bubble.c:163
msgid "Bubble"
msgstr "Bolla"
-#: src/lib/elementary/efl_ui_button.c:70
+#: src/lib/elementary/efl_ui_button.c:71
msgid "Clicked"
msgstr "Cliccato"
-#: src/lib/elementary/efl_ui_button.c:290
+#: src/lib/elementary/efl_ui_button.c:250
msgid "Button"
msgstr "Bottone"
-#: src/lib/elementary/elm_calendar.c:228
+#: src/lib/elementary/elm_calendar.c:244
#: src/lib/elementary/efl_ui_calendar.c:198
msgid "%B %Y"
msgstr "%B %Y"
-#: src/lib/elementary/elm_calendar.c:234
+#: src/lib/elementary/elm_calendar.c:250
msgid "%B"
msgstr "%B"
-#: src/lib/elementary/elm_calendar.c:240
+#: src/lib/elementary/elm_calendar.c:256
msgid "%Y"
msgstr "%Y"
-#: src/lib/elementary/elm_calendar.c:365
+#: src/lib/elementary/elm_calendar.c:382
#: src/lib/elementary/efl_ui_calendar.c:245
msgid "calendar item"
msgstr "oggetto calendario"
-#: src/lib/elementary/elm_calendar.c:392
+#: src/lib/elementary/elm_calendar.c:410
#: src/lib/elementary/efl_ui_calendar.c:272
msgid "calendar decrement month button"
msgstr "bottone diminuzione mese calendario"
-#: src/lib/elementary/elm_calendar.c:398
+#: src/lib/elementary/elm_calendar.c:416
msgid "calendar decrement year button"
msgstr "bottone diminuzione anno calendario"
-#: src/lib/elementary/elm_calendar.c:404
+#: src/lib/elementary/elm_calendar.c:422
#: src/lib/elementary/efl_ui_calendar.c:278
msgid "calendar increment month button"
msgstr "bottone aumento mese calendario"
-#: src/lib/elementary/elm_calendar.c:410
+#: src/lib/elementary/elm_calendar.c:428
msgid "calendar increment year button"
msgstr "bottone aumento anno calendario"
-#: src/lib/elementary/elm_calendar.c:415
+#: src/lib/elementary/elm_calendar.c:433
#: src/lib/elementary/efl_ui_calendar.c:283
msgid "calendar month"
msgstr "mese del calendario"
-#: src/lib/elementary/elm_calendar.c:420
+#: src/lib/elementary/elm_calendar.c:438
#: src/lib/elementary/efl_ui_calendar.c:286
msgid "calendar year"
msgstr "anno del calendario"
-#: src/lib/elementary/efl_ui_check.c:65 src/lib/elementary/efl_ui_check.c:210
-#: src/lib/elementary/efl_ui_radio.c:120 src/lib/elementary/efl_ui_radio.c:199
+#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201
+#: src/lib/elementary/efl_ui_radio.c:136 src/lib/elementary/efl_ui_radio.c:202
msgid "State: On"
msgstr "Stato: attivo"
-#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:222
-#: src/lib/elementary/efl_ui_radio.c:201
+#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:213
+#: src/lib/elementary/efl_ui_radio.c:204
msgid "State: Off"
msgstr "Stato: inattivo"
-#: src/lib/elementary/efl_ui_check.c:206 src/lib/elementary/efl_ui_check.c:219
+#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210
msgid "State"
msgstr "Stato"
-#: src/lib/elementary/efl_ui_check.c:340
+#: src/lib/elementary/efl_ui_check.c:355
msgid "Check"
msgstr "Controllo"
-#: src/lib/elementary/elm_clock.c:304
+#: src/lib/elementary/elm_clock.c:309
msgid "clock increment button for am,pm"
msgstr "bottone aumento orologio am/pm"
-#: src/lib/elementary/elm_clock.c:312
+#: src/lib/elementary/elm_clock.c:317
msgid "clock decrement button for am,pm"
msgstr "bottone diminuzione orologio am/pm"
-#: src/lib/elementary/elm_clock.c:691
+#: src/lib/elementary/elm_clock.c:714
msgid "State: Editable"
msgstr "Stato: modificabile"
-#: src/lib/elementary/elm_clock.c:726
+#: src/lib/elementary/elm_clock.c:749
msgid "Clock"
msgstr "Orologio"
@@ -427,7 +426,7 @@ msgstr "B:"
msgid "A:"
msgstr "A:"
-#: src/lib/elementary/elm_colorselector.c:1706
+#: src/lib/elementary/elm_colorselector.c:1707
msgid "color selector palette item"
msgstr "oggetto palette selezione colore"
@@ -437,11 +436,11 @@ msgstr "oggetto palette selezione colore"
#. but if this is a right-to-left language like arabic, Farsi,
#. Hebrew, etc. then change this string to be "default:RTL"
#.
-#: src/lib/elementary/elm_config.c:4109
+#: src/lib/elementary/elm_config.c:4187
msgid "default:LTR"
msgstr "default:LTR"
-#: src/lib/elementary/elm_dayselector.c:402
+#: src/lib/elementary/elm_dayselector.c:437
msgid "day selector item"
msgstr "oggetto selettore giorno"
@@ -449,27 +448,27 @@ msgstr "oggetto selettore giorno"
msgid "diskselector item"
msgstr "selettore disco"
-#: src/lib/elementary/elm_entry.c:1709
+#: src/lib/elementary/elm_entry.c:1723
msgid "Cut"
msgstr "Taglia"
-#: src/lib/elementary/elm_entry.c:1712
+#: src/lib/elementary/elm_entry.c:1726
msgid "Copy"
msgstr "Copia"
-#: src/lib/elementary/elm_entry.c:1716 src/lib/elementary/elm_entry.c:1738
+#: src/lib/elementary/elm_entry.c:1730 src/lib/elementary/elm_entry.c:1752
msgid "Paste"
msgstr "Incolla"
-#: src/lib/elementary/elm_entry.c:1731
+#: src/lib/elementary/elm_entry.c:1745
msgid "Select"
msgstr "Seleziona"
-#: src/lib/elementary/elm_entry.c:3831
+#: src/lib/elementary/elm_entry.c:3894
msgid "Entry"
msgstr "Voce"
-#: src/lib/elementary/elm_gengrid.c:1513
+#: src/lib/elementary/elm_gengrid.c:1541
msgid "Gengrid Item"
msgstr "oggetto griglia generica"
@@ -481,40 +480,40 @@ msgstr "Indice"
msgid "Index Item"
msgstr "oggetto indice"
-#: src/lib/elementary/elm_label.c:405
+#: src/lib/elementary/elm_label.c:403
msgid "Label"
msgstr "Etichetta"
-#: src/lib/elementary/elm_panel.c:83
+#: src/lib/elementary/elm_panel.c:84
msgid "state: opened"
msgstr "Stato: aperto"
-#: src/lib/elementary/elm_panel.c:84
+#: src/lib/elementary/elm_panel.c:85
msgid "state: closed"
msgstr "Stato: chiuso"
-#: src/lib/elementary/elm_panel.c:124
+#: src/lib/elementary/elm_panel.c:127
msgid "A panel is open"
msgstr "C'è un pannello aperto"
-#: src/lib/elementary/elm_panel.c:126
+#: src/lib/elementary/elm_panel.c:129
msgid "Double tap to close panel menu"
msgstr "Doppio tap per chiudere il menù del pannello"
-#: src/lib/elementary/elm_panel.c:178
+#: src/lib/elementary/elm_panel.c:181
msgid "panel button"
msgstr "bottone del pannello"
-#: src/lib/elementary/efl_ui_progressbar.c:393
+#: src/lib/elementary/efl_ui_progressbar.c:397
msgid "progressbar"
msgstr "barra avanzamento"
-#: src/lib/elementary/efl_ui_radio.c:224
+#: src/lib/elementary/efl_ui_radio.c:231
msgid "Radio"
msgstr "Opzione"
#: src/lib/elementary/elm_segment_control.c:532
-#: src/lib/elementary/elm_toolbar.c:2278
+#: src/lib/elementary/elm_toolbar.c:2283
msgid "State: Selected"
msgstr "Stato: selezionato"
@@ -526,50 +525,50 @@ msgstr "Stato: non selezionato"
msgid "Segment Control Item"
msgstr "Oggetto controllo segmento"
-#: src/lib/elementary/efl_ui_slider.c:1193
+#: src/lib/elementary/efl_ui_slider.c:681
msgid "slider"
msgstr "cursore"
-#: src/lib/elementary/elm_spinner.c:1061
+#: src/lib/elementary/elm_spinner.c:1071
msgid "incremented"
msgstr "incrementato"
-#: src/lib/elementary/elm_spinner.c:1067
+#: src/lib/elementary/elm_spinner.c:1077
msgid "decremented"
msgstr "decrementato"
-#: src/lib/elementary/elm_spinner.c:1100 src/lib/elementary/elm_spinner.c:1167
+#: src/lib/elementary/elm_spinner.c:1110 src/lib/elementary/elm_spinner.c:1177
msgid "spinner"
msgstr "spinner"
-#: src/lib/elementary/elm_spinner.c:1109 src/lib/elementary/elm_spinner.c:1150
+#: src/lib/elementary/elm_spinner.c:1119 src/lib/elementary/elm_spinner.c:1160
msgid "spinner increment button"
msgstr "bottone aumento spinner"
-#: src/lib/elementary/elm_spinner.c:1112 src/lib/elementary/elm_spinner.c:1159
+#: src/lib/elementary/elm_spinner.c:1122 src/lib/elementary/elm_spinner.c:1169
msgid "spinner decrement button"
msgstr "bottone diminuzione spinner"
-#: src/lib/elementary/elm_spinner.c:1114
+#: src/lib/elementary/elm_spinner.c:1124
msgid "spinner text"
msgstr "testo spinner"
-#: src/lib/elementary/elm_toolbar.c:1733 src/lib/elementary/elm_toolbar.c:2335
+#: src/lib/elementary/elm_toolbar.c:1738 src/lib/elementary/elm_toolbar.c:2342
msgid "Selected"
msgstr "Selezionato"
-#: src/lib/elementary/elm_toolbar.c:2274
+#: src/lib/elementary/elm_toolbar.c:2279
msgid "Separator"
msgstr "Separatore"
-#: src/lib/elementary/elm_toolbar.c:2280
+#: src/lib/elementary/elm_toolbar.c:2285
msgid "Has menu"
msgstr "Include menù"
-#: src/lib/elementary/elm_toolbar.c:2330
+#: src/lib/elementary/elm_toolbar.c:2337
msgid "Unselected"
msgstr "Non selezionato"
-#: src/lib/elementary/elm_toolbar.c:2347
+#: src/lib/elementary/elm_toolbar.c:2354
msgid "Toolbar Item"
msgstr "Oggetto della barra strumenti"
diff --git a/po/ja.po b/po/ja.po
index 535055182d..90578d9173 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -2,12 +2,12 @@
# Copyright (C) 2012 Enlightenment development team
# This file is put in the public domain.
#
-#: src/lib/elementary/elm_config.c:4086
+#: src/lib/elementary/elm_config.c:4164
msgid ""
msgstr ""
"Project-Id-Version: Efl\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2017-12-20 00:20+0900\n"
+"POT-Creation-Date: 2018-07-09 16:07+0900\n"
"PO-Revision-Date: 2012-06-24 17:10+0900\n"
"Last-Translator: Daichi Fukui<when.a.cat.sits.beside.you@gmail.com>\n"
"Language-Team: Enlightenment Team\n"
@@ -238,171 +238,171 @@ msgstr "Pictures"
msgid "Videos"
msgstr "Videos"
-#: src/lib/elementary/elc_fileselector.c:1907
+#: src/lib/elementary/elc_fileselector.c:1798
msgid "Up"
msgstr ""
-#: src/lib/elementary/elc_fileselector.c:1921
+#: src/lib/elementary/elc_fileselector.c:1812
msgid "Home"
msgstr ""
-#: src/lib/elementary/elc_fileselector.c:1940
+#: src/lib/elementary/elc_fileselector.c:1831
msgid "Search"
msgstr ""
-#: src/lib/elementary/elc_fileselector.c:2232
+#: src/lib/elementary/elc_fileselector.c:2107
msgid "OK"
msgstr ""
-#: src/lib/elementary/elc_fileselector.c:2242
-#: src/lib/elementary/elm_entry.c:1719 src/lib/elementary/elm_entry.c:1744
+#: src/lib/elementary/elc_fileselector.c:2117
+#: src/lib/elementary/elm_entry.c:1733 src/lib/elementary/elm_entry.c:1758
msgid "Cancel"
msgstr ""
-#: src/lib/elementary/elc_hoversel.c:436 src/lib/elementary/efl_ui_button.c:263
-#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/elm_gengrid.c:1483
-#: src/lib/elementary/elm_genlist.c:1750 src/lib/elementary/elm_list.c:2157
-#: src/lib/elementary/efl_ui_radio.c:198
+#: src/lib/elementary/elc_hoversel.c:438 src/lib/elementary/efl_ui_button.c:208
+#: src/lib/elementary/efl_ui_check.c:188 src/lib/elementary/elm_gengrid.c:1511
+#: src/lib/elementary/elm_genlist.c:1759 src/lib/elementary/elm_list.c:2172
+#: src/lib/elementary/efl_ui_radio.c:201
#: src/lib/elementary/elm_segment_control.c:529
-#: src/lib/elementary/elm_spinner.c:1031 src/lib/elementary/elm_toolbar.c:2276
+#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2281
msgid "State: Disabled"
msgstr ""
-#: src/lib/elementary/elc_hoversel.c:638
+#: src/lib/elementary/elc_hoversel.c:651
msgid "Hoversel"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:675
+#: src/lib/elementary/elc_multibuttonentry.c:682
msgid "multi button entry label"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:697
+#: src/lib/elementary/elc_multibuttonentry.c:704
msgid "multi button entry item"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:1579
+#: src/lib/elementary/elc_multibuttonentry.c:1586
msgid "multi button entry"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:433
-#: src/lib/elementary/elc_naviframe.c:461
+#: src/lib/elementary/elc_naviframe.c:435
+#: src/lib/elementary/elc_naviframe.c:463
msgid "Title"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:440
+#: src/lib/elementary/elc_naviframe.c:442
msgid "Subtitle"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:1027
-#: src/lib/elementary/elc_naviframe.c:1245
+#: src/lib/elementary/elc_naviframe.c:1029
+#: src/lib/elementary/elc_naviframe.c:1247
msgid "Back"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:1343
+#: src/lib/elementary/elc_naviframe.c:1345
msgid "Next"
msgstr ""
-#: src/lib/elementary/elc_popup.c:305 src/lib/elementary/elc_popup.c:969
+#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992
msgid "Popup Title"
msgstr ""
-#: src/lib/elementary/elc_popup.c:315 src/lib/elementary/elc_popup.c:1045
+#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068
msgid "Popup Body Text"
msgstr ""
-#: src/lib/elementary/elc_popup.c:1820
+#: src/lib/elementary/elc_popup.c:1841
msgid "Alert"
msgstr ""
-#: src/lib/elementary/elm_bubble.c:162
+#: src/lib/elementary/elm_bubble.c:163
msgid "Bubble"
msgstr ""
-#: src/lib/elementary/efl_ui_button.c:70
+#: src/lib/elementary/efl_ui_button.c:71
msgid "Clicked"
msgstr ""
-#: src/lib/elementary/efl_ui_button.c:290
+#: src/lib/elementary/efl_ui_button.c:250
msgid "Button"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:228
+#: src/lib/elementary/elm_calendar.c:244
#: src/lib/elementary/efl_ui_calendar.c:198
msgid "%B %Y"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:234
+#: src/lib/elementary/elm_calendar.c:250
msgid "%B"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:240
+#: src/lib/elementary/elm_calendar.c:256
msgid "%Y"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:365
+#: src/lib/elementary/elm_calendar.c:382
#: src/lib/elementary/efl_ui_calendar.c:245
msgid "calendar item"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:392
+#: src/lib/elementary/elm_calendar.c:410
#: src/lib/elementary/efl_ui_calendar.c:272
msgid "calendar decrement month button"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:398
+#: src/lib/elementary/elm_calendar.c:416
msgid "calendar decrement year button"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:404
+#: src/lib/elementary/elm_calendar.c:422
#: src/lib/elementary/efl_ui_calendar.c:278
msgid "calendar increment month button"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:410
+#: src/lib/elementary/elm_calendar.c:428
msgid "calendar increment year button"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:415
+#: src/lib/elementary/elm_calendar.c:433
#: src/lib/elementary/efl_ui_calendar.c:283
msgid "calendar month"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:420
+#: src/lib/elementary/elm_calendar.c:438
#: src/lib/elementary/efl_ui_calendar.c:286
msgid "calendar year"
msgstr ""
-#: src/lib/elementary/efl_ui_check.c:65 src/lib/elementary/efl_ui_check.c:210
-#: src/lib/elementary/efl_ui_radio.c:120 src/lib/elementary/efl_ui_radio.c:199
+#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201
+#: src/lib/elementary/efl_ui_radio.c:136 src/lib/elementary/efl_ui_radio.c:202
msgid "State: On"
msgstr ""
-#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:222
-#: src/lib/elementary/efl_ui_radio.c:201
+#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:213
+#: src/lib/elementary/efl_ui_radio.c:204
msgid "State: Off"
msgstr ""
-#: src/lib/elementary/efl_ui_check.c:206 src/lib/elementary/efl_ui_check.c:219
+#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210
msgid "State"
msgstr ""
-#: src/lib/elementary/efl_ui_check.c:340
+#: src/lib/elementary/efl_ui_check.c:355
msgid "Check"
msgstr ""
-#: src/lib/elementary/elm_clock.c:304
+#: src/lib/elementary/elm_clock.c:309
msgid "clock increment button for am,pm"
msgstr ""
-#: src/lib/elementary/elm_clock.c:312
+#: src/lib/elementary/elm_clock.c:317
msgid "clock decrement button for am,pm"
msgstr ""
-#: src/lib/elementary/elm_clock.c:691
+#: src/lib/elementary/elm_clock.c:714
msgid "State: Editable"
msgstr ""
-#: src/lib/elementary/elm_clock.c:726
+#: src/lib/elementary/elm_clock.c:749
msgid "Clock"
msgstr ""
@@ -426,7 +426,7 @@ msgstr ""
msgid "A:"
msgstr ""
-#: src/lib/elementary/elm_colorselector.c:1706
+#: src/lib/elementary/elm_colorselector.c:1707
msgid "color selector palette item"
msgstr ""
@@ -436,12 +436,12 @@ msgstr ""
#. but if this is a right-to-left language like arabic, Farsi,
#. Hebrew, etc. then change this string to be "default:RTL"
#.
-#: src/lib/elementary/elm_config.c:4109
+#: src/lib/elementary/elm_config.c:4187
#, fuzzy
msgid "default:LTR"
msgstr "default:LTR"
-#: src/lib/elementary/elm_dayselector.c:402
+#: src/lib/elementary/elm_dayselector.c:437
msgid "day selector item"
msgstr ""
@@ -449,27 +449,27 @@ msgstr ""
msgid "diskselector item"
msgstr ""
-#: src/lib/elementary/elm_entry.c:1709
+#: src/lib/elementary/elm_entry.c:1723
msgid "Cut"
msgstr ""
-#: src/lib/elementary/elm_entry.c:1712
+#: src/lib/elementary/elm_entry.c:1726
msgid "Copy"
msgstr ""
-#: src/lib/elementary/elm_entry.c:1716 src/lib/elementary/elm_entry.c:1738
+#: src/lib/elementary/elm_entry.c:1730 src/lib/elementary/elm_entry.c:1752
msgid "Paste"
msgstr ""
-#: src/lib/elementary/elm_entry.c:1731
+#: src/lib/elementary/elm_entry.c:1745
msgid "Select"
msgstr ""
-#: src/lib/elementary/elm_entry.c:3831
+#: src/lib/elementary/elm_entry.c:3894
msgid "Entry"
msgstr ""
-#: src/lib/elementary/elm_gengrid.c:1513
+#: src/lib/elementary/elm_gengrid.c:1541
msgid "Gengrid Item"
msgstr ""
@@ -481,40 +481,40 @@ msgstr ""
msgid "Index Item"
msgstr ""
-#: src/lib/elementary/elm_label.c:405
+#: src/lib/elementary/elm_label.c:403
msgid "Label"
msgstr ""
-#: src/lib/elementary/elm_panel.c:83
+#: src/lib/elementary/elm_panel.c:84
msgid "state: opened"
msgstr ""
-#: src/lib/elementary/elm_panel.c:84
+#: src/lib/elementary/elm_panel.c:85
msgid "state: closed"
msgstr ""
-#: src/lib/elementary/elm_panel.c:124
+#: src/lib/elementary/elm_panel.c:127
msgid "A panel is open"
msgstr ""
-#: src/lib/elementary/elm_panel.c:126
+#: src/lib/elementary/elm_panel.c:129
msgid "Double tap to close panel menu"
msgstr ""
-#: src/lib/elementary/elm_panel.c:178
+#: src/lib/elementary/elm_panel.c:181
msgid "panel button"
msgstr ""
-#: src/lib/elementary/efl_ui_progressbar.c:393
+#: src/lib/elementary/efl_ui_progressbar.c:397
msgid "progressbar"
msgstr ""
-#: src/lib/elementary/efl_ui_radio.c:224
+#: src/lib/elementary/efl_ui_radio.c:231
msgid "Radio"
msgstr ""
#: src/lib/elementary/elm_segment_control.c:532
-#: src/lib/elementary/elm_toolbar.c:2278
+#: src/lib/elementary/elm_toolbar.c:2283
msgid "State: Selected"
msgstr ""
@@ -526,50 +526,50 @@ msgstr ""
msgid "Segment Control Item"
msgstr ""
-#: src/lib/elementary/efl_ui_slider.c:1193
+#: src/lib/elementary/efl_ui_slider.c:681
msgid "slider"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1061
+#: src/lib/elementary/elm_spinner.c:1071
msgid "incremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1067
+#: src/lib/elementary/elm_spinner.c:1077
msgid "decremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1100 src/lib/elementary/elm_spinner.c:1167
+#: src/lib/elementary/elm_spinner.c:1110 src/lib/elementary/elm_spinner.c:1177
msgid "spinner"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1109 src/lib/elementary/elm_spinner.c:1150
+#: src/lib/elementary/elm_spinner.c:1119 src/lib/elementary/elm_spinner.c:1160
msgid "spinner increment button"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1112 src/lib/elementary/elm_spinner.c:1159
+#: src/lib/elementary/elm_spinner.c:1122 src/lib/elementary/elm_spinner.c:1169
msgid "spinner decrement button"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1114
+#: src/lib/elementary/elm_spinner.c:1124
msgid "spinner text"
msgstr ""
-#: src/lib/elementary/elm_toolbar.c:1733 src/lib/elementary/elm_toolbar.c:2335
+#: src/lib/elementary/elm_toolbar.c:1738 src/lib/elementary/elm_toolbar.c:2342
msgid "Selected"
msgstr ""
-#: src/lib/elementary/elm_toolbar.c:2274
+#: src/lib/elementary/elm_toolbar.c:2279
msgid "Separator"
msgstr ""
-#: src/lib/elementary/elm_toolbar.c:2280
+#: src/lib/elementary/elm_toolbar.c:2285
msgid "Has menu"
msgstr ""
-#: src/lib/elementary/elm_toolbar.c:2330
+#: src/lib/elementary/elm_toolbar.c:2337
msgid "Unselected"
msgstr ""
-#: src/lib/elementary/elm_toolbar.c:2347
+#: src/lib/elementary/elm_toolbar.c:2354
msgid "Toolbar Item"
msgstr ""
diff --git a/po/ko.po b/po/ko.po
index 95a806c189..8c6c2e5864 100644
--- a/po/ko.po
+++ b/po/ko.po
@@ -5,12 +5,12 @@
# Daniel Juyung Seo <seojuyung2@gmail.com>, 2011-2013
# Seong-ho Cho <darkcircle.0426@gmail.com>, 2012-2013
#
-#: src/lib/elementary/elm_config.c:4086
+#: src/lib/elementary/elm_config.c:4164
msgid ""
msgstr ""
"Project-Id-Version: Efl\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2017-12-20 00:20+0900\n"
+"POT-Creation-Date: 2018-07-09 16:07+0900\n"
"PO-Revision-Date: 2014-11-10 01:01+0900\n"
"Last-Translator: Daniel Juyung Seo <seojuyung2@gmail.com>\n"
"Language-Team: Enlightenment Team\n"
@@ -242,171 +242,171 @@ msgstr "사진"
msgid "Videos"
msgstr "영상"
-#: src/lib/elementary/elc_fileselector.c:1907
+#: src/lib/elementary/elc_fileselector.c:1798
msgid "Up"
msgstr ""
-#: src/lib/elementary/elc_fileselector.c:1921
+#: src/lib/elementary/elc_fileselector.c:1812
msgid "Home"
msgstr ""
-#: src/lib/elementary/elc_fileselector.c:1940
+#: src/lib/elementary/elc_fileselector.c:1831
msgid "Search"
msgstr ""
-#: src/lib/elementary/elc_fileselector.c:2232
+#: src/lib/elementary/elc_fileselector.c:2107
msgid "OK"
msgstr ""
-#: src/lib/elementary/elc_fileselector.c:2242
-#: src/lib/elementary/elm_entry.c:1719 src/lib/elementary/elm_entry.c:1744
+#: src/lib/elementary/elc_fileselector.c:2117
+#: src/lib/elementary/elm_entry.c:1733 src/lib/elementary/elm_entry.c:1758
msgid "Cancel"
msgstr ""
-#: src/lib/elementary/elc_hoversel.c:436 src/lib/elementary/efl_ui_button.c:263
-#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/elm_gengrid.c:1483
-#: src/lib/elementary/elm_genlist.c:1750 src/lib/elementary/elm_list.c:2157
-#: src/lib/elementary/efl_ui_radio.c:198
+#: src/lib/elementary/elc_hoversel.c:438 src/lib/elementary/efl_ui_button.c:208
+#: src/lib/elementary/efl_ui_check.c:188 src/lib/elementary/elm_gengrid.c:1511
+#: src/lib/elementary/elm_genlist.c:1759 src/lib/elementary/elm_list.c:2172
+#: src/lib/elementary/efl_ui_radio.c:201
#: src/lib/elementary/elm_segment_control.c:529
-#: src/lib/elementary/elm_spinner.c:1031 src/lib/elementary/elm_toolbar.c:2276
+#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2281
msgid "State: Disabled"
msgstr ""
-#: src/lib/elementary/elc_hoversel.c:638
+#: src/lib/elementary/elc_hoversel.c:651
msgid "Hoversel"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:675
+#: src/lib/elementary/elc_multibuttonentry.c:682
msgid "multi button entry label"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:697
+#: src/lib/elementary/elc_multibuttonentry.c:704
msgid "multi button entry item"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:1579
+#: src/lib/elementary/elc_multibuttonentry.c:1586
msgid "multi button entry"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:433
-#: src/lib/elementary/elc_naviframe.c:461
+#: src/lib/elementary/elc_naviframe.c:435
+#: src/lib/elementary/elc_naviframe.c:463
msgid "Title"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:440
+#: src/lib/elementary/elc_naviframe.c:442
msgid "Subtitle"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:1027
-#: src/lib/elementary/elc_naviframe.c:1245
+#: src/lib/elementary/elc_naviframe.c:1029
+#: src/lib/elementary/elc_naviframe.c:1247
msgid "Back"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:1343
+#: src/lib/elementary/elc_naviframe.c:1345
msgid "Next"
msgstr ""
-#: src/lib/elementary/elc_popup.c:305 src/lib/elementary/elc_popup.c:969
+#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992
msgid "Popup Title"
msgstr ""
-#: src/lib/elementary/elc_popup.c:315 src/lib/elementary/elc_popup.c:1045
+#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068
msgid "Popup Body Text"
msgstr ""
-#: src/lib/elementary/elc_popup.c:1820
+#: src/lib/elementary/elc_popup.c:1841
msgid "Alert"
msgstr ""
-#: src/lib/elementary/elm_bubble.c:162
+#: src/lib/elementary/elm_bubble.c:163
msgid "Bubble"
msgstr ""
-#: src/lib/elementary/efl_ui_button.c:70
+#: src/lib/elementary/efl_ui_button.c:71
msgid "Clicked"
msgstr ""
-#: src/lib/elementary/efl_ui_button.c:290
+#: src/lib/elementary/efl_ui_button.c:250
msgid "Button"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:228
+#: src/lib/elementary/elm_calendar.c:244
#: src/lib/elementary/efl_ui_calendar.c:198
msgid "%B %Y"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:234
+#: src/lib/elementary/elm_calendar.c:250
msgid "%B"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:240
+#: src/lib/elementary/elm_calendar.c:256
msgid "%Y"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:365
+#: src/lib/elementary/elm_calendar.c:382
#: src/lib/elementary/efl_ui_calendar.c:245
msgid "calendar item"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:392
+#: src/lib/elementary/elm_calendar.c:410
#: src/lib/elementary/efl_ui_calendar.c:272
msgid "calendar decrement month button"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:398
+#: src/lib/elementary/elm_calendar.c:416
msgid "calendar decrement year button"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:404
+#: src/lib/elementary/elm_calendar.c:422
#: src/lib/elementary/efl_ui_calendar.c:278
msgid "calendar increment month button"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:410
+#: src/lib/elementary/elm_calendar.c:428
msgid "calendar increment year button"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:415
+#: src/lib/elementary/elm_calendar.c:433
#: src/lib/elementary/efl_ui_calendar.c:283
msgid "calendar month"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:420
+#: src/lib/elementary/elm_calendar.c:438
#: src/lib/elementary/efl_ui_calendar.c:286
msgid "calendar year"
msgstr ""
-#: src/lib/elementary/efl_ui_check.c:65 src/lib/elementary/efl_ui_check.c:210
-#: src/lib/elementary/efl_ui_radio.c:120 src/lib/elementary/efl_ui_radio.c:199
+#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201
+#: src/lib/elementary/efl_ui_radio.c:136 src/lib/elementary/efl_ui_radio.c:202
msgid "State: On"
msgstr ""
-#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:222
-#: src/lib/elementary/efl_ui_radio.c:201
+#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:213
+#: src/lib/elementary/efl_ui_radio.c:204
msgid "State: Off"
msgstr ""
-#: src/lib/elementary/efl_ui_check.c:206 src/lib/elementary/efl_ui_check.c:219
+#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210
msgid "State"
msgstr ""
-#: src/lib/elementary/efl_ui_check.c:340
+#: src/lib/elementary/efl_ui_check.c:355
msgid "Check"
msgstr ""
-#: src/lib/elementary/elm_clock.c:304
+#: src/lib/elementary/elm_clock.c:309
msgid "clock increment button for am,pm"
msgstr ""
-#: src/lib/elementary/elm_clock.c:312
+#: src/lib/elementary/elm_clock.c:317
msgid "clock decrement button for am,pm"
msgstr ""
-#: src/lib/elementary/elm_clock.c:691
+#: src/lib/elementary/elm_clock.c:714
msgid "State: Editable"
msgstr ""
-#: src/lib/elementary/elm_clock.c:726
+#: src/lib/elementary/elm_clock.c:749
msgid "Clock"
msgstr ""
@@ -430,7 +430,7 @@ msgstr ""
msgid "A:"
msgstr ""
-#: src/lib/elementary/elm_colorselector.c:1706
+#: src/lib/elementary/elm_colorselector.c:1707
msgid "color selector palette item"
msgstr ""
@@ -440,12 +440,12 @@ msgstr ""
#. but if this is a right-to-left language like arabic, Farsi,
#. Hebrew, etc. then change this string to be "default:RTL"
#.
-#: src/lib/elementary/elm_config.c:4109
+#: src/lib/elementary/elm_config.c:4187
#, fuzzy
msgid "default:LTR"
msgstr "default:LTR"
-#: src/lib/elementary/elm_dayselector.c:402
+#: src/lib/elementary/elm_dayselector.c:437
msgid "day selector item"
msgstr ""
@@ -453,27 +453,27 @@ msgstr ""
msgid "diskselector item"
msgstr ""
-#: src/lib/elementary/elm_entry.c:1709
+#: src/lib/elementary/elm_entry.c:1723
msgid "Cut"
msgstr ""
-#: src/lib/elementary/elm_entry.c:1712
+#: src/lib/elementary/elm_entry.c:1726
msgid "Copy"
msgstr ""
-#: src/lib/elementary/elm_entry.c:1716 src/lib/elementary/elm_entry.c:1738
+#: src/lib/elementary/elm_entry.c:1730 src/lib/elementary/elm_entry.c:1752
msgid "Paste"
msgstr ""
-#: src/lib/elementary/elm_entry.c:1731
+#: src/lib/elementary/elm_entry.c:1745
msgid "Select"
msgstr ""
-#: src/lib/elementary/elm_entry.c:3831
+#: src/lib/elementary/elm_entry.c:3894
msgid "Entry"
msgstr ""
-#: src/lib/elementary/elm_gengrid.c:1513
+#: src/lib/elementary/elm_gengrid.c:1541
msgid "Gengrid Item"
msgstr ""
@@ -485,40 +485,40 @@ msgstr ""
msgid "Index Item"
msgstr ""
-#: src/lib/elementary/elm_label.c:405
+#: src/lib/elementary/elm_label.c:403
msgid "Label"
msgstr ""
-#: src/lib/elementary/elm_panel.c:83
+#: src/lib/elementary/elm_panel.c:84
msgid "state: opened"
msgstr ""
-#: src/lib/elementary/elm_panel.c:84
+#: src/lib/elementary/elm_panel.c:85
msgid "state: closed"
msgstr ""
-#: src/lib/elementary/elm_panel.c:124
+#: src/lib/elementary/elm_panel.c:127
msgid "A panel is open"
msgstr ""
-#: src/lib/elementary/elm_panel.c:126
+#: src/lib/elementary/elm_panel.c:129
msgid "Double tap to close panel menu"
msgstr ""
-#: src/lib/elementary/elm_panel.c:178
+#: src/lib/elementary/elm_panel.c:181
msgid "panel button"
msgstr ""
-#: src/lib/elementary/efl_ui_progressbar.c:393
+#: src/lib/elementary/efl_ui_progressbar.c:397
msgid "progressbar"
msgstr ""
-#: src/lib/elementary/efl_ui_radio.c:224
+#: src/lib/elementary/efl_ui_radio.c:231
msgid "Radio"
msgstr ""
#: src/lib/elementary/elm_segment_control.c:532
-#: src/lib/elementary/elm_toolbar.c:2278
+#: src/lib/elementary/elm_toolbar.c:2283
msgid "State: Selected"
msgstr ""
@@ -530,50 +530,50 @@ msgstr ""
msgid "Segment Control Item"
msgstr ""
-#: src/lib/elementary/efl_ui_slider.c:1193
+#: src/lib/elementary/efl_ui_slider.c:681
msgid "slider"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1061
+#: src/lib/elementary/elm_spinner.c:1071
msgid "incremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1067
+#: src/lib/elementary/elm_spinner.c:1077
msgid "decremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1100 src/lib/elementary/elm_spinner.c:1167
+#: src/lib/elementary/elm_spinner.c:1110 src/lib/elementary/elm_spinner.c:1177
msgid "spinner"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1109 src/lib/elementary/elm_spinner.c:1150
+#: src/lib/elementary/elm_spinner.c:1119 src/lib/elementary/elm_spinner.c:1160
msgid "spinner increment button"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1112 src/lib/elementary/elm_spinner.c:1159
+#: src/lib/elementary/elm_spinner.c:1122 src/lib/elementary/elm_spinner.c:1169
msgid "spinner decrement button"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1114
+#: src/lib/elementary/elm_spinner.c:1124
msgid "spinner text"
msgstr ""
-#: src/lib/elementary/elm_toolbar.c:1733 src/lib/elementary/elm_toolbar.c:2335
+#: src/lib/elementary/elm_toolbar.c:1738 src/lib/elementary/elm_toolbar.c:2342
msgid "Selected"
msgstr ""
-#: src/lib/elementary/elm_toolbar.c:2274
+#: src/lib/elementary/elm_toolbar.c:2279
msgid "Separator"
msgstr ""
-#: src/lib/elementary/elm_toolbar.c:2280
+#: src/lib/elementary/elm_toolbar.c:2285
msgid "Has menu"
msgstr ""
-#: src/lib/elementary/elm_toolbar.c:2330
+#: src/lib/elementary/elm_toolbar.c:2337
msgid "Unselected"
msgstr ""
-#: src/lib/elementary/elm_toolbar.c:2347
+#: src/lib/elementary/elm_toolbar.c:2354
msgid "Toolbar Item"
msgstr ""
diff --git a/po/lt.po b/po/lt.po
index 5dba59ceef..723b62d213 100644
--- a/po/lt.po
+++ b/po/lt.po
@@ -3,12 +3,12 @@
# This file is distributed under the same license as the enlightenment package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
#
-#: src/lib/elementary/elm_config.c:4086
+#: src/lib/elementary/elm_config.c:4164
msgid ""
msgstr ""
"Project-Id-Version: enlightenment\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2017-12-20 00:20+0900\n"
+"POT-Creation-Date: 2018-07-09 16:07+0900\n"
"PO-Revision-Date: 2014-02-21 22:38+0000\n"
"Last-Translator: Mantas Kriaučiūnas <mantas@akl.lt>\n"
"Language-Team: Lithuanian <lt@li.org>\n"
@@ -239,171 +239,171 @@ msgstr "Paveikslėliai"
msgid "Videos"
msgstr "Video"
-#: src/lib/elementary/elc_fileselector.c:1907
+#: src/lib/elementary/elc_fileselector.c:1798
msgid "Up"
msgstr ""
-#: src/lib/elementary/elc_fileselector.c:1921
+#: src/lib/elementary/elc_fileselector.c:1812
msgid "Home"
msgstr ""
-#: src/lib/elementary/elc_fileselector.c:1940
+#: src/lib/elementary/elc_fileselector.c:1831
msgid "Search"
msgstr ""
-#: src/lib/elementary/elc_fileselector.c:2232
+#: src/lib/elementary/elc_fileselector.c:2107
msgid "OK"
msgstr "Gerai"
-#: src/lib/elementary/elc_fileselector.c:2242
-#: src/lib/elementary/elm_entry.c:1719 src/lib/elementary/elm_entry.c:1744
+#: src/lib/elementary/elc_fileselector.c:2117
+#: src/lib/elementary/elm_entry.c:1733 src/lib/elementary/elm_entry.c:1758
msgid "Cancel"
msgstr "Atsisakyti"
-#: src/lib/elementary/elc_hoversel.c:436 src/lib/elementary/efl_ui_button.c:263
-#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/elm_gengrid.c:1483
-#: src/lib/elementary/elm_genlist.c:1750 src/lib/elementary/elm_list.c:2157
-#: src/lib/elementary/efl_ui_radio.c:198
+#: src/lib/elementary/elc_hoversel.c:438 src/lib/elementary/efl_ui_button.c:208
+#: src/lib/elementary/efl_ui_check.c:188 src/lib/elementary/elm_gengrid.c:1511
+#: src/lib/elementary/elm_genlist.c:1759 src/lib/elementary/elm_list.c:2172
+#: src/lib/elementary/efl_ui_radio.c:201
#: src/lib/elementary/elm_segment_control.c:529
-#: src/lib/elementary/elm_spinner.c:1031 src/lib/elementary/elm_toolbar.c:2276
+#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2281
msgid "State: Disabled"
msgstr ""
-#: src/lib/elementary/elc_hoversel.c:638
+#: src/lib/elementary/elc_hoversel.c:651
msgid "Hoversel"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:675
+#: src/lib/elementary/elc_multibuttonentry.c:682
msgid "multi button entry label"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:697
+#: src/lib/elementary/elc_multibuttonentry.c:704
msgid "multi button entry item"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:1579
+#: src/lib/elementary/elc_multibuttonentry.c:1586
msgid "multi button entry"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:433
-#: src/lib/elementary/elc_naviframe.c:461
+#: src/lib/elementary/elc_naviframe.c:435
+#: src/lib/elementary/elc_naviframe.c:463
msgid "Title"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:440
+#: src/lib/elementary/elc_naviframe.c:442
msgid "Subtitle"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:1027
-#: src/lib/elementary/elc_naviframe.c:1245
+#: src/lib/elementary/elc_naviframe.c:1029
+#: src/lib/elementary/elc_naviframe.c:1247
msgid "Back"
msgstr "Atgal"
-#: src/lib/elementary/elc_naviframe.c:1343
+#: src/lib/elementary/elc_naviframe.c:1345
msgid "Next"
msgstr ""
-#: src/lib/elementary/elc_popup.c:305 src/lib/elementary/elc_popup.c:969
+#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992
msgid "Popup Title"
msgstr ""
-#: src/lib/elementary/elc_popup.c:315 src/lib/elementary/elc_popup.c:1045
+#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068
msgid "Popup Body Text"
msgstr ""
-#: src/lib/elementary/elc_popup.c:1820
+#: src/lib/elementary/elc_popup.c:1841
msgid "Alert"
msgstr ""
-#: src/lib/elementary/elm_bubble.c:162
+#: src/lib/elementary/elm_bubble.c:163
msgid "Bubble"
msgstr ""
-#: src/lib/elementary/efl_ui_button.c:70
+#: src/lib/elementary/efl_ui_button.c:71
msgid "Clicked"
msgstr ""
-#: src/lib/elementary/efl_ui_button.c:290
+#: src/lib/elementary/efl_ui_button.c:250
msgid "Button"
msgstr "Mygtukas"
-#: src/lib/elementary/elm_calendar.c:228
+#: src/lib/elementary/elm_calendar.c:244
#: src/lib/elementary/efl_ui_calendar.c:198
msgid "%B %Y"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:234
+#: src/lib/elementary/elm_calendar.c:250
msgid "%B"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:240
+#: src/lib/elementary/elm_calendar.c:256
msgid "%Y"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:365
+#: src/lib/elementary/elm_calendar.c:382
#: src/lib/elementary/efl_ui_calendar.c:245
msgid "calendar item"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:392
+#: src/lib/elementary/elm_calendar.c:410
#: src/lib/elementary/efl_ui_calendar.c:272
msgid "calendar decrement month button"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:398
+#: src/lib/elementary/elm_calendar.c:416
msgid "calendar decrement year button"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:404
+#: src/lib/elementary/elm_calendar.c:422
#: src/lib/elementary/efl_ui_calendar.c:278
msgid "calendar increment month button"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:410
+#: src/lib/elementary/elm_calendar.c:428
msgid "calendar increment year button"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:415
+#: src/lib/elementary/elm_calendar.c:433
#: src/lib/elementary/efl_ui_calendar.c:283
msgid "calendar month"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:420
+#: src/lib/elementary/elm_calendar.c:438
#: src/lib/elementary/efl_ui_calendar.c:286
msgid "calendar year"
msgstr ""
-#: src/lib/elementary/efl_ui_check.c:65 src/lib/elementary/efl_ui_check.c:210
-#: src/lib/elementary/efl_ui_radio.c:120 src/lib/elementary/efl_ui_radio.c:199
+#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201
+#: src/lib/elementary/efl_ui_radio.c:136 src/lib/elementary/efl_ui_radio.c:202
msgid "State: On"
msgstr ""
-#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:222
-#: src/lib/elementary/efl_ui_radio.c:201
+#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:213
+#: src/lib/elementary/efl_ui_radio.c:204
msgid "State: Off"
msgstr ""
-#: src/lib/elementary/efl_ui_check.c:206 src/lib/elementary/efl_ui_check.c:219
+#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210
msgid "State"
msgstr "Būsena"
-#: src/lib/elementary/efl_ui_check.c:340
+#: src/lib/elementary/efl_ui_check.c:355
msgid "Check"
msgstr ""
-#: src/lib/elementary/elm_clock.c:304
+#: src/lib/elementary/elm_clock.c:309
msgid "clock increment button for am,pm"
msgstr ""
-#: src/lib/elementary/elm_clock.c:312
+#: src/lib/elementary/elm_clock.c:317
msgid "clock decrement button for am,pm"
msgstr ""
-#: src/lib/elementary/elm_clock.c:691
+#: src/lib/elementary/elm_clock.c:714
msgid "State: Editable"
msgstr ""
-#: src/lib/elementary/elm_clock.c:726
+#: src/lib/elementary/elm_clock.c:749
msgid "Clock"
msgstr "Laikrodis"
@@ -427,7 +427,7 @@ msgstr ""
msgid "A:"
msgstr ""
-#: src/lib/elementary/elm_colorselector.c:1706
+#: src/lib/elementary/elm_colorselector.c:1707
msgid "color selector palette item"
msgstr ""
@@ -437,11 +437,11 @@ msgstr ""
#. but if this is a right-to-left language like arabic, Farsi,
#. Hebrew, etc. then change this string to be "default:RTL"
#.
-#: src/lib/elementary/elm_config.c:4109
+#: src/lib/elementary/elm_config.c:4187
msgid "default:LTR"
msgstr "default:LTR"
-#: src/lib/elementary/elm_dayselector.c:402
+#: src/lib/elementary/elm_dayselector.c:437
msgid "day selector item"
msgstr ""
@@ -449,27 +449,27 @@ msgstr ""
msgid "diskselector item"
msgstr ""
-#: src/lib/elementary/elm_entry.c:1709
+#: src/lib/elementary/elm_entry.c:1723
msgid "Cut"
msgstr "Iškirpti"
-#: src/lib/elementary/elm_entry.c:1712
+#: src/lib/elementary/elm_entry.c:1726
msgid "Copy"
msgstr "Kopijuoti"
-#: src/lib/elementary/elm_entry.c:1716 src/lib/elementary/elm_entry.c:1738
+#: src/lib/elementary/elm_entry.c:1730 src/lib/elementary/elm_entry.c:1752
msgid "Paste"
msgstr "Įdėti"
-#: src/lib/elementary/elm_entry.c:1731
+#: src/lib/elementary/elm_entry.c:1745
msgid "Select"
msgstr "Pasirinkti"
-#: src/lib/elementary/elm_entry.c:3831
+#: src/lib/elementary/elm_entry.c:3894
msgid "Entry"
msgstr ""
-#: src/lib/elementary/elm_gengrid.c:1513
+#: src/lib/elementary/elm_gengrid.c:1541
msgid "Gengrid Item"
msgstr ""
@@ -481,40 +481,40 @@ msgstr ""
msgid "Index Item"
msgstr ""
-#: src/lib/elementary/elm_label.c:405
+#: src/lib/elementary/elm_label.c:403
msgid "Label"
msgstr "Etiketė"
-#: src/lib/elementary/elm_panel.c:83
+#: src/lib/elementary/elm_panel.c:84
msgid "state: opened"
msgstr ""
-#: src/lib/elementary/elm_panel.c:84
+#: src/lib/elementary/elm_panel.c:85
msgid "state: closed"
msgstr ""
-#: src/lib/elementary/elm_panel.c:124
+#: src/lib/elementary/elm_panel.c:127
msgid "A panel is open"
msgstr ""
-#: src/lib/elementary/elm_panel.c:126
+#: src/lib/elementary/elm_panel.c:129
msgid "Double tap to close panel menu"
msgstr ""
-#: src/lib/elementary/elm_panel.c:178
+#: src/lib/elementary/elm_panel.c:181
msgid "panel button"
msgstr "skydelio mygtukas"
-#: src/lib/elementary/efl_ui_progressbar.c:393
+#: src/lib/elementary/efl_ui_progressbar.c:397
msgid "progressbar"
msgstr ""
-#: src/lib/elementary/efl_ui_radio.c:224
+#: src/lib/elementary/efl_ui_radio.c:231
msgid "Radio"
msgstr ""
#: src/lib/elementary/elm_segment_control.c:532
-#: src/lib/elementary/elm_toolbar.c:2278
+#: src/lib/elementary/elm_toolbar.c:2283
msgid "State: Selected"
msgstr ""
@@ -526,50 +526,50 @@ msgstr ""
msgid "Segment Control Item"
msgstr ""
-#: src/lib/elementary/efl_ui_slider.c:1193
+#: src/lib/elementary/efl_ui_slider.c:681
msgid "slider"
msgstr "šliaužiklis"
-#: src/lib/elementary/elm_spinner.c:1061
+#: src/lib/elementary/elm_spinner.c:1071
msgid "incremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1067
+#: src/lib/elementary/elm_spinner.c:1077
msgid "decremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1100 src/lib/elementary/elm_spinner.c:1167
+#: src/lib/elementary/elm_spinner.c:1110 src/lib/elementary/elm_spinner.c:1177
msgid "spinner"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1109 src/lib/elementary/elm_spinner.c:1150
+#: src/lib/elementary/elm_spinner.c:1119 src/lib/elementary/elm_spinner.c:1160
msgid "spinner increment button"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1112 src/lib/elementary/elm_spinner.c:1159
+#: src/lib/elementary/elm_spinner.c:1122 src/lib/elementary/elm_spinner.c:1169
msgid "spinner decrement button"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1114
+#: src/lib/elementary/elm_spinner.c:1124
msgid "spinner text"
msgstr ""
-#: src/lib/elementary/elm_toolbar.c:1733 src/lib/elementary/elm_toolbar.c:2335
+#: src/lib/elementary/elm_toolbar.c:1738 src/lib/elementary/elm_toolbar.c:2342
msgid "Selected"
msgstr ""
-#: src/lib/elementary/elm_toolbar.c:2274
+#: src/lib/elementary/elm_toolbar.c:2279
msgid "Separator"
msgstr "Skirtukas"
-#: src/lib/elementary/elm_toolbar.c:2280
+#: src/lib/elementary/elm_toolbar.c:2285
msgid "Has menu"
msgstr "Turi meniu"
-#: src/lib/elementary/elm_toolbar.c:2330
+#: src/lib/elementary/elm_toolbar.c:2337
msgid "Unselected"
msgstr "Nepasirinkta(s)"
-#: src/lib/elementary/elm_toolbar.c:2347
+#: src/lib/elementary/elm_toolbar.c:2354
msgid "Toolbar Item"
msgstr ""
diff --git a/po/nl.po b/po/nl.po
index 528040b6cd..3fd33c7554 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -3,12 +3,12 @@
# This file is put in the public domain.
# Fabian Nowak <timystery@arcor.de>, 2011.
#
-#: src/lib/elementary/elm_config.c:4086
+#: src/lib/elementary/elm_config.c:4164
msgid ""
msgstr ""
"Project-Id-Version: elementary 0.7.0.57309\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2017-12-20 00:20+0900\n"
+"POT-Creation-Date: 2018-07-09 16:07+0900\n"
"PO-Revision-Date: 2011-06-19 16:41+0100\n"
"Last-Translator: Heimen Stoffels <vistausss@gmail.com>\n"
"Language-Team: Dutch <vistausss@gmail.com>\n"
@@ -242,171 +242,171 @@ msgstr ""
msgid "Videos"
msgstr ""
-#: src/lib/elementary/elc_fileselector.c:1907
+#: src/lib/elementary/elc_fileselector.c:1798
msgid "Up"
msgstr "Omhoog"
-#: src/lib/elementary/elc_fileselector.c:1921
+#: src/lib/elementary/elc_fileselector.c:1812
msgid "Home"
msgstr "Persoonlijke map"
-#: src/lib/elementary/elc_fileselector.c:1940
+#: src/lib/elementary/elc_fileselector.c:1831
msgid "Search"
msgstr ""
-#: src/lib/elementary/elc_fileselector.c:2232
+#: src/lib/elementary/elc_fileselector.c:2107
msgid "OK"
msgstr "OK"
-#: src/lib/elementary/elc_fileselector.c:2242
-#: src/lib/elementary/elm_entry.c:1719 src/lib/elementary/elm_entry.c:1744
+#: src/lib/elementary/elc_fileselector.c:2117
+#: src/lib/elementary/elm_entry.c:1733 src/lib/elementary/elm_entry.c:1758
msgid "Cancel"
msgstr "Annuleren"
-#: src/lib/elementary/elc_hoversel.c:436 src/lib/elementary/efl_ui_button.c:263
-#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/elm_gengrid.c:1483
-#: src/lib/elementary/elm_genlist.c:1750 src/lib/elementary/elm_list.c:2157
-#: src/lib/elementary/efl_ui_radio.c:198
+#: src/lib/elementary/elc_hoversel.c:438 src/lib/elementary/efl_ui_button.c:208
+#: src/lib/elementary/efl_ui_check.c:188 src/lib/elementary/elm_gengrid.c:1511
+#: src/lib/elementary/elm_genlist.c:1759 src/lib/elementary/elm_list.c:2172
+#: src/lib/elementary/efl_ui_radio.c:201
#: src/lib/elementary/elm_segment_control.c:529
-#: src/lib/elementary/elm_spinner.c:1031 src/lib/elementary/elm_toolbar.c:2276
+#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2281
msgid "State: Disabled"
msgstr ""
-#: src/lib/elementary/elc_hoversel.c:638
+#: src/lib/elementary/elc_hoversel.c:651
msgid "Hoversel"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:675
+#: src/lib/elementary/elc_multibuttonentry.c:682
msgid "multi button entry label"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:697
+#: src/lib/elementary/elc_multibuttonentry.c:704
msgid "multi button entry item"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:1579
+#: src/lib/elementary/elc_multibuttonentry.c:1586
msgid "multi button entry"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:433
-#: src/lib/elementary/elc_naviframe.c:461
+#: src/lib/elementary/elc_naviframe.c:435
+#: src/lib/elementary/elc_naviframe.c:463
msgid "Title"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:440
+#: src/lib/elementary/elc_naviframe.c:442
msgid "Subtitle"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:1027
-#: src/lib/elementary/elc_naviframe.c:1245
+#: src/lib/elementary/elc_naviframe.c:1029
+#: src/lib/elementary/elc_naviframe.c:1247
msgid "Back"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:1343
+#: src/lib/elementary/elc_naviframe.c:1345
msgid "Next"
msgstr ""
-#: src/lib/elementary/elc_popup.c:305 src/lib/elementary/elc_popup.c:969
+#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992
msgid "Popup Title"
msgstr ""
-#: src/lib/elementary/elc_popup.c:315 src/lib/elementary/elc_popup.c:1045
+#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068
msgid "Popup Body Text"
msgstr ""
-#: src/lib/elementary/elc_popup.c:1820
+#: src/lib/elementary/elc_popup.c:1841
msgid "Alert"
msgstr ""
-#: src/lib/elementary/elm_bubble.c:162
+#: src/lib/elementary/elm_bubble.c:163
msgid "Bubble"
msgstr ""
-#: src/lib/elementary/efl_ui_button.c:70
+#: src/lib/elementary/efl_ui_button.c:71
msgid "Clicked"
msgstr ""
-#: src/lib/elementary/efl_ui_button.c:290
+#: src/lib/elementary/efl_ui_button.c:250
msgid "Button"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:228
+#: src/lib/elementary/elm_calendar.c:244
#: src/lib/elementary/efl_ui_calendar.c:198
msgid "%B %Y"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:234
+#: src/lib/elementary/elm_calendar.c:250
msgid "%B"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:240
+#: src/lib/elementary/elm_calendar.c:256
msgid "%Y"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:365
+#: src/lib/elementary/elm_calendar.c:382
#: src/lib/elementary/efl_ui_calendar.c:245
msgid "calendar item"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:392
+#: src/lib/elementary/elm_calendar.c:410
#: src/lib/elementary/efl_ui_calendar.c:272
msgid "calendar decrement month button"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:398
+#: src/lib/elementary/elm_calendar.c:416
msgid "calendar decrement year button"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:404
+#: src/lib/elementary/elm_calendar.c:422
#: src/lib/elementary/efl_ui_calendar.c:278
msgid "calendar increment month button"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:410
+#: src/lib/elementary/elm_calendar.c:428
msgid "calendar increment year button"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:415
+#: src/lib/elementary/elm_calendar.c:433
#: src/lib/elementary/efl_ui_calendar.c:283
msgid "calendar month"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:420
+#: src/lib/elementary/elm_calendar.c:438
#: src/lib/elementary/efl_ui_calendar.c:286
msgid "calendar year"
msgstr ""
-#: src/lib/elementary/efl_ui_check.c:65 src/lib/elementary/efl_ui_check.c:210
-#: src/lib/elementary/efl_ui_radio.c:120 src/lib/elementary/efl_ui_radio.c:199
+#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201
+#: src/lib/elementary/efl_ui_radio.c:136 src/lib/elementary/efl_ui_radio.c:202
msgid "State: On"
msgstr ""
-#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:222
-#: src/lib/elementary/efl_ui_radio.c:201
+#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:213
+#: src/lib/elementary/efl_ui_radio.c:204
msgid "State: Off"
msgstr ""
-#: src/lib/elementary/efl_ui_check.c:206 src/lib/elementary/efl_ui_check.c:219
+#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210
msgid "State"
msgstr ""
-#: src/lib/elementary/efl_ui_check.c:340
+#: src/lib/elementary/efl_ui_check.c:355
msgid "Check"
msgstr ""
-#: src/lib/elementary/elm_clock.c:304
+#: src/lib/elementary/elm_clock.c:309
msgid "clock increment button for am,pm"
msgstr ""
-#: src/lib/elementary/elm_clock.c:312
+#: src/lib/elementary/elm_clock.c:317
msgid "clock decrement button for am,pm"
msgstr ""
-#: src/lib/elementary/elm_clock.c:691
+#: src/lib/elementary/elm_clock.c:714
msgid "State: Editable"
msgstr ""
-#: src/lib/elementary/elm_clock.c:726
+#: src/lib/elementary/elm_clock.c:749
msgid "Clock"
msgstr ""
@@ -430,7 +430,7 @@ msgstr ""
msgid "A:"
msgstr ""
-#: src/lib/elementary/elm_colorselector.c:1706
+#: src/lib/elementary/elm_colorselector.c:1707
msgid "color selector palette item"
msgstr ""
@@ -440,11 +440,11 @@ msgstr ""
#. but if this is a right-to-left language like arabic, Farsi,
#. Hebrew, etc. then change this string to be "default:RTL"
#.
-#: src/lib/elementary/elm_config.c:4109
+#: src/lib/elementary/elm_config.c:4187
msgid "default:LTR"
msgstr "default:LTR"
-#: src/lib/elementary/elm_dayselector.c:402
+#: src/lib/elementary/elm_dayselector.c:437
msgid "day selector item"
msgstr ""
@@ -452,27 +452,27 @@ msgstr ""
msgid "diskselector item"
msgstr ""
-#: src/lib/elementary/elm_entry.c:1709
+#: src/lib/elementary/elm_entry.c:1723
msgid "Cut"
msgstr "Knippen"
-#: src/lib/elementary/elm_entry.c:1712
+#: src/lib/elementary/elm_entry.c:1726
msgid "Copy"
msgstr "Kopiëren"
-#: src/lib/elementary/elm_entry.c:1716 src/lib/elementary/elm_entry.c:1738
+#: src/lib/elementary/elm_entry.c:1730 src/lib/elementary/elm_entry.c:1752
msgid "Paste"
msgstr "Plakken"
-#: src/lib/elementary/elm_entry.c:1731
+#: src/lib/elementary/elm_entry.c:1745
msgid "Select"
msgstr "Selecteren"
-#: src/lib/elementary/elm_entry.c:3831
+#: src/lib/elementary/elm_entry.c:3894
msgid "Entry"
msgstr ""
-#: src/lib/elementary/elm_gengrid.c:1513
+#: src/lib/elementary/elm_gengrid.c:1541
msgid "Gengrid Item"
msgstr ""
@@ -484,40 +484,40 @@ msgstr ""
msgid "Index Item"
msgstr ""
-#: src/lib/elementary/elm_label.c:405
+#: src/lib/elementary/elm_label.c:403
msgid "Label"
msgstr ""
-#: src/lib/elementary/elm_panel.c:83
+#: src/lib/elementary/elm_panel.c:84
msgid "state: opened"
msgstr ""
-#: src/lib/elementary/elm_panel.c:84
+#: src/lib/elementary/elm_panel.c:85
msgid "state: closed"
msgstr ""
-#: src/lib/elementary/elm_panel.c:124
+#: src/lib/elementary/elm_panel.c:127
msgid "A panel is open"
msgstr ""
-#: src/lib/elementary/elm_panel.c:126
+#: src/lib/elementary/elm_panel.c:129
msgid "Double tap to close panel menu"
msgstr ""
-#: src/lib/elementary/elm_panel.c:178
+#: src/lib/elementary/elm_panel.c:181
msgid "panel button"
msgstr ""
-#: src/lib/elementary/efl_ui_progressbar.c:393
+#: src/lib/elementary/efl_ui_progressbar.c:397
msgid "progressbar"
msgstr ""
-#: src/lib/elementary/efl_ui_radio.c:224
+#: src/lib/elementary/efl_ui_radio.c:231
msgid "Radio"
msgstr ""
#: src/lib/elementary/elm_segment_control.c:532
-#: src/lib/elementary/elm_toolbar.c:2278
+#: src/lib/elementary/elm_toolbar.c:2283
msgid "State: Selected"
msgstr ""
@@ -530,52 +530,52 @@ msgstr "Selecteren"
msgid "Segment Control Item"
msgstr ""
-#: src/lib/elementary/efl_ui_slider.c:1193
+#: src/lib/elementary/efl_ui_slider.c:681
msgid "slider"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1061
+#: src/lib/elementary/elm_spinner.c:1071
msgid "incremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1067
+#: src/lib/elementary/elm_spinner.c:1077
msgid "decremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1100 src/lib/elementary/elm_spinner.c:1167
+#: src/lib/elementary/elm_spinner.c:1110 src/lib/elementary/elm_spinner.c:1177
msgid "spinner"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1109 src/lib/elementary/elm_spinner.c:1150
+#: src/lib/elementary/elm_spinner.c:1119 src/lib/elementary/elm_spinner.c:1160
msgid "spinner increment button"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1112 src/lib/elementary/elm_spinner.c:1159
+#: src/lib/elementary/elm_spinner.c:1122 src/lib/elementary/elm_spinner.c:1169
msgid "spinner decrement button"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1114
+#: src/lib/elementary/elm_spinner.c:1124
msgid "spinner text"
msgstr ""
-#: src/lib/elementary/elm_toolbar.c:1733 src/lib/elementary/elm_toolbar.c:2335
+#: src/lib/elementary/elm_toolbar.c:1738 src/lib/elementary/elm_toolbar.c:2342
#, fuzzy
msgid "Selected"
msgstr "Selecteren"
-#: src/lib/elementary/elm_toolbar.c:2274
+#: src/lib/elementary/elm_toolbar.c:2279
msgid "Separator"
msgstr ""
-#: src/lib/elementary/elm_toolbar.c:2280
+#: src/lib/elementary/elm_toolbar.c:2285
msgid "Has menu"
msgstr ""
-#: src/lib/elementary/elm_toolbar.c:2330
+#: src/lib/elementary/elm_toolbar.c:2337
#, fuzzy
msgid "Unselected"
msgstr "Selecteren"
-#: src/lib/elementary/elm_toolbar.c:2347
+#: src/lib/elementary/elm_toolbar.c:2354
msgid "Toolbar Item"
msgstr ""
diff --git a/po/pl.po b/po/pl.po
index fc44f9eb80..6b2161bffd 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -3,12 +3,12 @@
# This file is put in the public domain.
# Konrad Makowski <poczta@konradmakowski.pl>, 2013
#
-#: src/lib/elementary/elm_config.c:4086
+#: src/lib/elementary/elm_config.c:4164
msgid ""
msgstr ""
"Project-Id-Version: elementary\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2017-12-20 00:20+0900\n"
+"POT-Creation-Date: 2018-07-09 16:07+0900\n"
"PO-Revision-Date: 2013-11-23 14:48+0100\n"
"Last-Translator: Konrad Makowski <poczta@konradmakowski.pl>\n"
"Language-Team: General\n"
@@ -241,172 +241,172 @@ msgstr "Obrazy"
msgid "Videos"
msgstr "Wideo"
-#: src/lib/elementary/elc_fileselector.c:1907
+#: src/lib/elementary/elc_fileselector.c:1798
msgid "Up"
msgstr "Do góry"
-#: src/lib/elementary/elc_fileselector.c:1921
+#: src/lib/elementary/elc_fileselector.c:1812
msgid "Home"
msgstr "Początek"
-#: src/lib/elementary/elc_fileselector.c:1940
+#: src/lib/elementary/elc_fileselector.c:1831
msgid "Search"
msgstr ""
-#: src/lib/elementary/elc_fileselector.c:2232
+#: src/lib/elementary/elc_fileselector.c:2107
msgid "OK"
msgstr "OK"
-#: src/lib/elementary/elc_fileselector.c:2242
-#: src/lib/elementary/elm_entry.c:1719 src/lib/elementary/elm_entry.c:1744
+#: src/lib/elementary/elc_fileselector.c:2117
+#: src/lib/elementary/elm_entry.c:1733 src/lib/elementary/elm_entry.c:1758
msgid "Cancel"
msgstr "Anuluj"
-#: src/lib/elementary/elc_hoversel.c:436 src/lib/elementary/efl_ui_button.c:263
-#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/elm_gengrid.c:1483
-#: src/lib/elementary/elm_genlist.c:1750 src/lib/elementary/elm_list.c:2157
-#: src/lib/elementary/efl_ui_radio.c:198
+#: src/lib/elementary/elc_hoversel.c:438 src/lib/elementary/efl_ui_button.c:208
+#: src/lib/elementary/efl_ui_check.c:188 src/lib/elementary/elm_gengrid.c:1511
+#: src/lib/elementary/elm_genlist.c:1759 src/lib/elementary/elm_list.c:2172
+#: src/lib/elementary/efl_ui_radio.c:201
#: src/lib/elementary/elm_segment_control.c:529
-#: src/lib/elementary/elm_spinner.c:1031 src/lib/elementary/elm_toolbar.c:2276
+#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2281
msgid "State: Disabled"
msgstr "Statuj: wyłączony"
-#: src/lib/elementary/elc_hoversel.c:638
+#: src/lib/elementary/elc_hoversel.c:651
msgid "Hoversel"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:675
+#: src/lib/elementary/elc_multibuttonentry.c:682
msgid "multi button entry label"
msgstr "etykietka przycisku wyboru"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:697
+#: src/lib/elementary/elc_multibuttonentry.c:704
msgid "multi button entry item"
msgstr "wartość pozycji przycisku wyboru"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:1579
+#: src/lib/elementary/elc_multibuttonentry.c:1586
msgid "multi button entry"
msgstr "przycisk wyboru"
-#: src/lib/elementary/elc_naviframe.c:433
-#: src/lib/elementary/elc_naviframe.c:461
+#: src/lib/elementary/elc_naviframe.c:435
+#: src/lib/elementary/elc_naviframe.c:463
msgid "Title"
msgstr "Tytuł"
-#: src/lib/elementary/elc_naviframe.c:440
+#: src/lib/elementary/elc_naviframe.c:442
#, fuzzy
msgid "Subtitle"
msgstr "Tytuł"
-#: src/lib/elementary/elc_naviframe.c:1027
-#: src/lib/elementary/elc_naviframe.c:1245
+#: src/lib/elementary/elc_naviframe.c:1029
+#: src/lib/elementary/elc_naviframe.c:1247
msgid "Back"
msgstr "Cofnij"
-#: src/lib/elementary/elc_naviframe.c:1343
+#: src/lib/elementary/elc_naviframe.c:1345
msgid "Next"
msgstr "Następny"
-#: src/lib/elementary/elc_popup.c:305 src/lib/elementary/elc_popup.c:969
+#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992
msgid "Popup Title"
msgstr "Tytuł okienka"
-#: src/lib/elementary/elc_popup.c:315 src/lib/elementary/elc_popup.c:1045
+#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068
msgid "Popup Body Text"
msgstr "Treść główna okienka"
-#: src/lib/elementary/elc_popup.c:1820
+#: src/lib/elementary/elc_popup.c:1841
msgid "Alert"
msgstr ""
-#: src/lib/elementary/elm_bubble.c:162
+#: src/lib/elementary/elm_bubble.c:163
msgid "Bubble"
msgstr "Bąbelek"
-#: src/lib/elementary/efl_ui_button.c:70
+#: src/lib/elementary/efl_ui_button.c:71
msgid "Clicked"
msgstr "Kliknięty"
-#: src/lib/elementary/efl_ui_button.c:290
+#: src/lib/elementary/efl_ui_button.c:250
msgid "Button"
msgstr "Przycisk"
-#: src/lib/elementary/elm_calendar.c:228
+#: src/lib/elementary/elm_calendar.c:244
#: src/lib/elementary/efl_ui_calendar.c:198
msgid "%B %Y"
msgstr "%B %Y"
-#: src/lib/elementary/elm_calendar.c:234
+#: src/lib/elementary/elm_calendar.c:250
msgid "%B"
msgstr "%B"
-#: src/lib/elementary/elm_calendar.c:240
+#: src/lib/elementary/elm_calendar.c:256
msgid "%Y"
msgstr "%Y"
-#: src/lib/elementary/elm_calendar.c:365
+#: src/lib/elementary/elm_calendar.c:382
#: src/lib/elementary/efl_ui_calendar.c:245
msgid "calendar item"
msgstr "pozycja w kalendarzu"
-#: src/lib/elementary/elm_calendar.c:392
+#: src/lib/elementary/elm_calendar.c:410
#: src/lib/elementary/efl_ui_calendar.c:272
msgid "calendar decrement month button"
msgstr "przycisk cofający o miesiąc w kalendarzu"
-#: src/lib/elementary/elm_calendar.c:398
+#: src/lib/elementary/elm_calendar.c:416
msgid "calendar decrement year button"
msgstr "przycisk cofający o rok w kalendarzu"
-#: src/lib/elementary/elm_calendar.c:404
+#: src/lib/elementary/elm_calendar.c:422
#: src/lib/elementary/efl_ui_calendar.c:278
msgid "calendar increment month button"
msgstr "przycisk przesuwający o miesiąc do przodu w kalendarzu"
-#: src/lib/elementary/elm_calendar.c:410
+#: src/lib/elementary/elm_calendar.c:428
msgid "calendar increment year button"
msgstr "przycisk przesuwający o rok do przodu w kalendarzu"
-#: src/lib/elementary/elm_calendar.c:415
+#: src/lib/elementary/elm_calendar.c:433
#: src/lib/elementary/efl_ui_calendar.c:283
msgid "calendar month"
msgstr "kalendarz z miesiącami"
-#: src/lib/elementary/elm_calendar.c:420
+#: src/lib/elementary/elm_calendar.c:438
#: src/lib/elementary/efl_ui_calendar.c:286
msgid "calendar year"
msgstr "kalendarz roczny"
-#: src/lib/elementary/efl_ui_check.c:65 src/lib/elementary/efl_ui_check.c:210
-#: src/lib/elementary/efl_ui_radio.c:120 src/lib/elementary/efl_ui_radio.c:199
+#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201
+#: src/lib/elementary/efl_ui_radio.c:136 src/lib/elementary/efl_ui_radio.c:202
msgid "State: On"
msgstr "Stan: włączony"
-#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:222
-#: src/lib/elementary/efl_ui_radio.c:201
+#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:213
+#: src/lib/elementary/efl_ui_radio.c:204
msgid "State: Off"
msgstr "Stan: wyłączony"
-#: src/lib/elementary/efl_ui_check.c:206 src/lib/elementary/efl_ui_check.c:219
+#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210
msgid "State"
msgstr "Stan"
-#: src/lib/elementary/efl_ui_check.c:340
+#: src/lib/elementary/efl_ui_check.c:355
msgid "Check"
msgstr "Sprawdzony"
-#: src/lib/elementary/elm_clock.c:304
+#: src/lib/elementary/elm_clock.c:309
msgid "clock increment button for am,pm"
msgstr "przycisk poganiający czas am,pm"
-#: src/lib/elementary/elm_clock.c:312
+#: src/lib/elementary/elm_clock.c:317
msgid "clock decrement button for am,pm"
msgstr "przycik cofający czas am,pm"
-#: src/lib/elementary/elm_clock.c:691
+#: src/lib/elementary/elm_clock.c:714
msgid "State: Editable"
msgstr "Stan: edytowalny"
-#: src/lib/elementary/elm_clock.c:726
+#: src/lib/elementary/elm_clock.c:749
msgid "Clock"
msgstr "Zegar"
@@ -430,7 +430,7 @@ msgstr ""
msgid "A:"
msgstr ""
-#: src/lib/elementary/elm_colorselector.c:1706
+#: src/lib/elementary/elm_colorselector.c:1707
msgid "color selector palette item"
msgstr "paleta wyboru kolorów"
@@ -440,11 +440,11 @@ msgstr "paleta wyboru kolorów"
#. but if this is a right-to-left language like arabic, Farsi,
#. Hebrew, etc. then change this string to be "default:RTL"
#.
-#: src/lib/elementary/elm_config.c:4109
+#: src/lib/elementary/elm_config.c:4187
msgid "default:LTR"
msgstr "default:LTR"
-#: src/lib/elementary/elm_dayselector.c:402
+#: src/lib/elementary/elm_dayselector.c:437
msgid "day selector item"
msgstr "wybór dni"
@@ -452,27 +452,27 @@ msgstr "wybór dni"
msgid "diskselector item"
msgstr "wybór dysków"
-#: src/lib/elementary/elm_entry.c:1709
+#: src/lib/elementary/elm_entry.c:1723
msgid "Cut"
msgstr "Wytnij"
-#: src/lib/elementary/elm_entry.c:1712
+#: src/lib/elementary/elm_entry.c:1726
msgid "Copy"
msgstr "Kopiuj"
-#: src/lib/elementary/elm_entry.c:1716 src/lib/elementary/elm_entry.c:1738
+#: src/lib/elementary/elm_entry.c:1730 src/lib/elementary/elm_entry.c:1752
msgid "Paste"
msgstr "Wklej"
-#: src/lib/elementary/elm_entry.c:1731
+#: src/lib/elementary/elm_entry.c:1745
msgid "Select"
msgstr "Wybór"
-#: src/lib/elementary/elm_entry.c:3831
+#: src/lib/elementary/elm_entry.c:3894
msgid "Entry"
msgstr "Pozycja"
-#: src/lib/elementary/elm_gengrid.c:1513
+#: src/lib/elementary/elm_gengrid.c:1541
msgid "Gengrid Item"
msgstr ""
@@ -484,40 +484,40 @@ msgstr "Indeks"
msgid "Index Item"
msgstr "Indeks"
-#: src/lib/elementary/elm_label.c:405
+#: src/lib/elementary/elm_label.c:403
msgid "Label"
msgstr "Etykieta"
-#: src/lib/elementary/elm_panel.c:83
+#: src/lib/elementary/elm_panel.c:84
msgid "state: opened"
msgstr "stan: otwarty"
-#: src/lib/elementary/elm_panel.c:84
+#: src/lib/elementary/elm_panel.c:85
msgid "state: closed"
msgstr "stan: zamknięty"
-#: src/lib/elementary/elm_panel.c:124
+#: src/lib/elementary/elm_panel.c:127
msgid "A panel is open"
msgstr ""
-#: src/lib/elementary/elm_panel.c:126
+#: src/lib/elementary/elm_panel.c:129
msgid "Double tap to close panel menu"
msgstr ""
-#: src/lib/elementary/elm_panel.c:178
+#: src/lib/elementary/elm_panel.c:181
msgid "panel button"
msgstr "panel przycisków"
-#: src/lib/elementary/efl_ui_progressbar.c:393
+#: src/lib/elementary/efl_ui_progressbar.c:397
msgid "progressbar"
msgstr "pasek postępu"
-#: src/lib/elementary/efl_ui_radio.c:224
+#: src/lib/elementary/efl_ui_radio.c:231
msgid "Radio"
msgstr ""
#: src/lib/elementary/elm_segment_control.c:532
-#: src/lib/elementary/elm_toolbar.c:2278
+#: src/lib/elementary/elm_toolbar.c:2283
msgid "State: Selected"
msgstr "Stan: wybrany"
@@ -529,51 +529,51 @@ msgstr "Stan: nie wybrany"
msgid "Segment Control Item"
msgstr "Kontrola Segmentami"
-#: src/lib/elementary/efl_ui_slider.c:1193
+#: src/lib/elementary/efl_ui_slider.c:681
msgid "slider"
msgstr "slajder"
-#: src/lib/elementary/elm_spinner.c:1061
+#: src/lib/elementary/elm_spinner.c:1071
msgid "incremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1067
+#: src/lib/elementary/elm_spinner.c:1077
msgid "decremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1100 src/lib/elementary/elm_spinner.c:1167
+#: src/lib/elementary/elm_spinner.c:1110 src/lib/elementary/elm_spinner.c:1177
msgid "spinner"
msgstr "spinner"
-#: src/lib/elementary/elm_spinner.c:1109 src/lib/elementary/elm_spinner.c:1150
+#: src/lib/elementary/elm_spinner.c:1119 src/lib/elementary/elm_spinner.c:1160
msgid "spinner increment button"
msgstr "przycisk zwiększający typu spinner"
-#: src/lib/elementary/elm_spinner.c:1112 src/lib/elementary/elm_spinner.c:1159
+#: src/lib/elementary/elm_spinner.c:1122 src/lib/elementary/elm_spinner.c:1169
msgid "spinner decrement button"
msgstr "przycisk zmniejszający typu spinner"
-#: src/lib/elementary/elm_spinner.c:1114
+#: src/lib/elementary/elm_spinner.c:1124
#, fuzzy
msgid "spinner text"
msgstr "spinner"
-#: src/lib/elementary/elm_toolbar.c:1733 src/lib/elementary/elm_toolbar.c:2335
+#: src/lib/elementary/elm_toolbar.c:1738 src/lib/elementary/elm_toolbar.c:2342
msgid "Selected"
msgstr "Wybrany"
-#: src/lib/elementary/elm_toolbar.c:2274
+#: src/lib/elementary/elm_toolbar.c:2279
msgid "Separator"
msgstr "Separator"
-#: src/lib/elementary/elm_toolbar.c:2280
+#: src/lib/elementary/elm_toolbar.c:2285
msgid "Has menu"
msgstr "Posiada menu"
-#: src/lib/elementary/elm_toolbar.c:2330
+#: src/lib/elementary/elm_toolbar.c:2337
msgid "Unselected"
msgstr "Nie wybrany"
-#: src/lib/elementary/elm_toolbar.c:2347
+#: src/lib/elementary/elm_toolbar.c:2354
msgid "Toolbar Item"
msgstr "Pasek narzędzi"
diff --git a/po/pt.po b/po/pt.po
index 11c3cc0a9b..21b40583fe 100644
--- a/po/pt.po
+++ b/po/pt.po
@@ -3,12 +3,12 @@
# This file is public domain.
# Sérgio Marques <smarquespt@gmail.com>, 2010-2014
#
-#: src/lib/elementary/elm_config.c:4086
+#: src/lib/elementary/elm_config.c:4164
msgid ""
msgstr ""
"Project-Id-Version: Elementary\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2017-12-20 00:20+0900\n"
+"POT-Creation-Date: 2018-07-09 16:07+0900\n"
"PO-Revision-Date: 2013-11-05 14:11-0000\n"
"Last-Translator: Sérgio Marques <smarquespt@gmail.com>\n"
"Language-Team: General\n"
@@ -239,172 +239,172 @@ msgstr "Imagens"
msgid "Videos"
msgstr "Vídeos"
-#: src/lib/elementary/elc_fileselector.c:1907
+#: src/lib/elementary/elc_fileselector.c:1798
msgid "Up"
msgstr "Para cima"
-#: src/lib/elementary/elc_fileselector.c:1921
+#: src/lib/elementary/elc_fileselector.c:1812
msgid "Home"
msgstr "Pasta pessoal"
-#: src/lib/elementary/elc_fileselector.c:1940
+#: src/lib/elementary/elc_fileselector.c:1831
msgid "Search"
msgstr ""
-#: src/lib/elementary/elc_fileselector.c:2232
+#: src/lib/elementary/elc_fileselector.c:2107
msgid "OK"
msgstr "Aceitar"
-#: src/lib/elementary/elc_fileselector.c:2242
-#: src/lib/elementary/elm_entry.c:1719 src/lib/elementary/elm_entry.c:1744
+#: src/lib/elementary/elc_fileselector.c:2117
+#: src/lib/elementary/elm_entry.c:1733 src/lib/elementary/elm_entry.c:1758
msgid "Cancel"
msgstr "Cancelar"
-#: src/lib/elementary/elc_hoversel.c:436 src/lib/elementary/efl_ui_button.c:263
-#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/elm_gengrid.c:1483
-#: src/lib/elementary/elm_genlist.c:1750 src/lib/elementary/elm_list.c:2157
-#: src/lib/elementary/efl_ui_radio.c:198
+#: src/lib/elementary/elc_hoversel.c:438 src/lib/elementary/efl_ui_button.c:208
+#: src/lib/elementary/efl_ui_check.c:188 src/lib/elementary/elm_gengrid.c:1511
+#: src/lib/elementary/elm_genlist.c:1759 src/lib/elementary/elm_list.c:2172
+#: src/lib/elementary/efl_ui_radio.c:201
#: src/lib/elementary/elm_segment_control.c:529
-#: src/lib/elementary/elm_spinner.c:1031 src/lib/elementary/elm_toolbar.c:2276
+#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2281
msgid "State: Disabled"
msgstr "Estado: inativo"
-#: src/lib/elementary/elc_hoversel.c:638
+#: src/lib/elementary/elc_hoversel.c:651
msgid "Hoversel"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:675
+#: src/lib/elementary/elc_multibuttonentry.c:682
msgid "multi button entry label"
msgstr "texto da entrada de botão múltiplo"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:697
+#: src/lib/elementary/elc_multibuttonentry.c:704
msgid "multi button entry item"
msgstr "item da entrada de botão múltiplo"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:1579
+#: src/lib/elementary/elc_multibuttonentry.c:1586
msgid "multi button entry"
msgstr "entrada do botão múltiplo"
-#: src/lib/elementary/elc_naviframe.c:433
-#: src/lib/elementary/elc_naviframe.c:461
+#: src/lib/elementary/elc_naviframe.c:435
+#: src/lib/elementary/elc_naviframe.c:463
msgid "Title"
msgstr "Título"
-#: src/lib/elementary/elc_naviframe.c:440
+#: src/lib/elementary/elc_naviframe.c:442
#, fuzzy
msgid "Subtitle"
msgstr "Título"
-#: src/lib/elementary/elc_naviframe.c:1027
-#: src/lib/elementary/elc_naviframe.c:1245
+#: src/lib/elementary/elc_naviframe.c:1029
+#: src/lib/elementary/elc_naviframe.c:1247
msgid "Back"
msgstr "Recuar"
-#: src/lib/elementary/elc_naviframe.c:1343
+#: src/lib/elementary/elc_naviframe.c:1345
msgid "Next"
msgstr "Avançar"
-#: src/lib/elementary/elc_popup.c:305 src/lib/elementary/elc_popup.c:969
+#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992
msgid "Popup Title"
msgstr "Título do alerta"
-#: src/lib/elementary/elc_popup.c:315 src/lib/elementary/elc_popup.c:1045
+#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068
msgid "Popup Body Text"
msgstr "Texto do alerta"
-#: src/lib/elementary/elc_popup.c:1820
+#: src/lib/elementary/elc_popup.c:1841
msgid "Alert"
msgstr ""
-#: src/lib/elementary/elm_bubble.c:162
+#: src/lib/elementary/elm_bubble.c:163
msgid "Bubble"
msgstr "Balão"
-#: src/lib/elementary/efl_ui_button.c:70
+#: src/lib/elementary/efl_ui_button.c:71
msgid "Clicked"
msgstr "Clicado"
-#: src/lib/elementary/efl_ui_button.c:290
+#: src/lib/elementary/efl_ui_button.c:250
msgid "Button"
msgstr "Botão"
-#: src/lib/elementary/elm_calendar.c:228
+#: src/lib/elementary/elm_calendar.c:244
#: src/lib/elementary/efl_ui_calendar.c:198
msgid "%B %Y"
msgstr "%B %Y"
-#: src/lib/elementary/elm_calendar.c:234
+#: src/lib/elementary/elm_calendar.c:250
msgid "%B"
msgstr "%B"
-#: src/lib/elementary/elm_calendar.c:240
+#: src/lib/elementary/elm_calendar.c:256
msgid "%Y"
msgstr "%Y"
-#: src/lib/elementary/elm_calendar.c:365
+#: src/lib/elementary/elm_calendar.c:382
#: src/lib/elementary/efl_ui_calendar.c:245
msgid "calendar item"
msgstr "item do calendário"
-#: src/lib/elementary/elm_calendar.c:392
+#: src/lib/elementary/elm_calendar.c:410
#: src/lib/elementary/efl_ui_calendar.c:272
msgid "calendar decrement month button"
msgstr "botão de redução do mês de calendário"
-#: src/lib/elementary/elm_calendar.c:398
+#: src/lib/elementary/elm_calendar.c:416
msgid "calendar decrement year button"
msgstr "botão de redução do ano de calendário"
-#: src/lib/elementary/elm_calendar.c:404
+#: src/lib/elementary/elm_calendar.c:422
#: src/lib/elementary/efl_ui_calendar.c:278
msgid "calendar increment month button"
msgstr "botão de aumento do mês de calendário"
-#: src/lib/elementary/elm_calendar.c:410
+#: src/lib/elementary/elm_calendar.c:428
msgid "calendar increment year button"
msgstr "botão de aumento do ano de calendário"
-#: src/lib/elementary/elm_calendar.c:415
+#: src/lib/elementary/elm_calendar.c:433
#: src/lib/elementary/efl_ui_calendar.c:283
msgid "calendar month"
msgstr "mês do calendário"
-#: src/lib/elementary/elm_calendar.c:420
+#: src/lib/elementary/elm_calendar.c:438
#: src/lib/elementary/efl_ui_calendar.c:286
msgid "calendar year"
msgstr "ano do calendário"
-#: src/lib/elementary/efl_ui_check.c:65 src/lib/elementary/efl_ui_check.c:210
-#: src/lib/elementary/efl_ui_radio.c:120 src/lib/elementary/efl_ui_radio.c:199
+#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201
+#: src/lib/elementary/efl_ui_radio.c:136 src/lib/elementary/efl_ui_radio.c:202
msgid "State: On"
msgstr "Estado: ligado"
-#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:222
-#: src/lib/elementary/efl_ui_radio.c:201
+#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:213
+#: src/lib/elementary/efl_ui_radio.c:204
msgid "State: Off"
msgstr "Estado: desligado"
-#: src/lib/elementary/efl_ui_check.c:206 src/lib/elementary/efl_ui_check.c:219
+#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210
msgid "State"
msgstr "Estado"
-#: src/lib/elementary/efl_ui_check.c:340
+#: src/lib/elementary/efl_ui_check.c:355
msgid "Check"
msgstr "Seleção"
-#: src/lib/elementary/elm_clock.c:304
+#: src/lib/elementary/elm_clock.c:309
msgid "clock increment button for am,pm"
msgstr "botão de aumento do relógio para am, pm"
-#: src/lib/elementary/elm_clock.c:312
+#: src/lib/elementary/elm_clock.c:317
msgid "clock decrement button for am,pm"
msgstr "botão de redução do relógio para am, pm"
-#: src/lib/elementary/elm_clock.c:691
+#: src/lib/elementary/elm_clock.c:714
msgid "State: Editable"
msgstr "Estado: editável"
-#: src/lib/elementary/elm_clock.c:726
+#: src/lib/elementary/elm_clock.c:749
msgid "Clock"
msgstr "Relógio"
@@ -428,7 +428,7 @@ msgstr ""
msgid "A:"
msgstr ""
-#: src/lib/elementary/elm_colorselector.c:1706
+#: src/lib/elementary/elm_colorselector.c:1707
msgid "color selector palette item"
msgstr "item do seletor de cor"
@@ -438,11 +438,11 @@ msgstr "item do seletor de cor"
#. but if this is a right-to-left language like arabic, Farsi,
#. Hebrew, etc. then change this string to be "default:RTL"
#.
-#: src/lib/elementary/elm_config.c:4109
+#: src/lib/elementary/elm_config.c:4187
msgid "default:LTR"
msgstr "default:LTR"
-#: src/lib/elementary/elm_dayselector.c:402
+#: src/lib/elementary/elm_dayselector.c:437
msgid "day selector item"
msgstr "item do seletor de dia"
@@ -450,27 +450,27 @@ msgstr "item do seletor de dia"
msgid "diskselector item"
msgstr "item do seletor de disco"
-#: src/lib/elementary/elm_entry.c:1709
+#: src/lib/elementary/elm_entry.c:1723
msgid "Cut"
msgstr "Cortar"
-#: src/lib/elementary/elm_entry.c:1712
+#: src/lib/elementary/elm_entry.c:1726
msgid "Copy"
msgstr "Copiar"
-#: src/lib/elementary/elm_entry.c:1716 src/lib/elementary/elm_entry.c:1738
+#: src/lib/elementary/elm_entry.c:1730 src/lib/elementary/elm_entry.c:1752
msgid "Paste"
msgstr "Colar"
-#: src/lib/elementary/elm_entry.c:1731
+#: src/lib/elementary/elm_entry.c:1745
msgid "Select"
msgstr "Selecionar"
-#: src/lib/elementary/elm_entry.c:3831
+#: src/lib/elementary/elm_entry.c:3894
msgid "Entry"
msgstr "Entrada"
-#: src/lib/elementary/elm_gengrid.c:1513
+#: src/lib/elementary/elm_gengrid.c:1541
msgid "Gengrid Item"
msgstr "Item da grelha genérica"
@@ -482,40 +482,40 @@ msgstr "Índice"
msgid "Index Item"
msgstr "Item do índice"
-#: src/lib/elementary/elm_label.c:405
+#: src/lib/elementary/elm_label.c:403
msgid "Label"
msgstr "Texto"
-#: src/lib/elementary/elm_panel.c:83
+#: src/lib/elementary/elm_panel.c:84
msgid "state: opened"
msgstr "estado: aberto"
-#: src/lib/elementary/elm_panel.c:84
+#: src/lib/elementary/elm_panel.c:85
msgid "state: closed"
msgstr "estado: fechado"
-#: src/lib/elementary/elm_panel.c:124
+#: src/lib/elementary/elm_panel.c:127
msgid "A panel is open"
msgstr ""
-#: src/lib/elementary/elm_panel.c:126
+#: src/lib/elementary/elm_panel.c:129
msgid "Double tap to close panel menu"
msgstr ""
-#: src/lib/elementary/elm_panel.c:178
+#: src/lib/elementary/elm_panel.c:181
msgid "panel button"
msgstr "botão do painel"
-#: src/lib/elementary/efl_ui_progressbar.c:393
+#: src/lib/elementary/efl_ui_progressbar.c:397
msgid "progressbar"
msgstr "barra de progresso"
-#: src/lib/elementary/efl_ui_radio.c:224
+#: src/lib/elementary/efl_ui_radio.c:231
msgid "Radio"
msgstr "Opção"
#: src/lib/elementary/elm_segment_control.c:532
-#: src/lib/elementary/elm_toolbar.c:2278
+#: src/lib/elementary/elm_toolbar.c:2283
msgid "State: Selected"
msgstr "Estado: selecionado"
@@ -527,52 +527,52 @@ msgstr "Estado: não selecionado"
msgid "Segment Control Item"
msgstr "Item do controlo de segmento"
-#: src/lib/elementary/efl_ui_slider.c:1193
+#: src/lib/elementary/efl_ui_slider.c:681
msgid "slider"
msgstr "barra deslizante"
-#: src/lib/elementary/elm_spinner.c:1061
+#: src/lib/elementary/elm_spinner.c:1071
msgid "incremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1067
+#: src/lib/elementary/elm_spinner.c:1077
msgid "decremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1100 src/lib/elementary/elm_spinner.c:1167
+#: src/lib/elementary/elm_spinner.c:1110 src/lib/elementary/elm_spinner.c:1177
msgid "spinner"
msgstr "spinner"
-#: src/lib/elementary/elm_spinner.c:1109 src/lib/elementary/elm_spinner.c:1150
+#: src/lib/elementary/elm_spinner.c:1119 src/lib/elementary/elm_spinner.c:1160
msgid "spinner increment button"
msgstr "botão de aumento do spinner"
-#: src/lib/elementary/elm_spinner.c:1112 src/lib/elementary/elm_spinner.c:1159
+#: src/lib/elementary/elm_spinner.c:1122 src/lib/elementary/elm_spinner.c:1169
msgid "spinner decrement button"
msgstr "botão de diminuição do spinner"
-#: src/lib/elementary/elm_spinner.c:1114
+#: src/lib/elementary/elm_spinner.c:1124
#, fuzzy
msgid "spinner text"
msgstr "spinner"
-#: src/lib/elementary/elm_toolbar.c:1733 src/lib/elementary/elm_toolbar.c:2335
+#: src/lib/elementary/elm_toolbar.c:1738 src/lib/elementary/elm_toolbar.c:2342
msgid "Selected"
msgstr "Selecionado"
-#: src/lib/elementary/elm_toolbar.c:2274
+#: src/lib/elementary/elm_toolbar.c:2279
msgid "Separator"
msgstr "Separador"
-#: src/lib/elementary/elm_toolbar.c:2280
+#: src/lib/elementary/elm_toolbar.c:2285
msgid "Has menu"
msgstr "Tem menu"
-#: src/lib/elementary/elm_toolbar.c:2330
+#: src/lib/elementary/elm_toolbar.c:2337
msgid "Unselected"
msgstr "Não selecionado"
-#: src/lib/elementary/elm_toolbar.c:2347
+#: src/lib/elementary/elm_toolbar.c:2354
msgid "Toolbar Item"
msgstr "Item da barra de ferramentas"
diff --git a/po/ru.po b/po/ru.po
index 23e0ef5888..bb8457b526 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -4,12 +4,12 @@
# Danny Moshnakov <dm@agent.co.il>, 2012.
# Igor Murzov <garik@efl.so>, 2015.
#
-#: src/lib/elementary/elm_config.c:4086
+#: src/lib/elementary/elm_config.c:4164
msgid ""
msgstr ""
"Project-Id-Version: elementary 1.11\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2017-12-20 00:20+0900\n"
+"POT-Creation-Date: 2018-07-09 16:07+0900\n"
"PO-Revision-Date: 2015-02-07 15:16+0300\n"
"Last-Translator: Игорь Мурзов <garik@efl.so>\n"
"Language-Team: ru <enlightenment-intl@lists.sourceforge.net>\n"
@@ -240,172 +240,172 @@ msgstr "Изображения"
msgid "Videos"
msgstr "Видео"
-#: src/lib/elementary/elc_fileselector.c:1907
+#: src/lib/elementary/elc_fileselector.c:1798
msgid "Up"
msgstr "Вверх"
-#: src/lib/elementary/elc_fileselector.c:1921
+#: src/lib/elementary/elc_fileselector.c:1812
msgid "Home"
msgstr "Дом"
-#: src/lib/elementary/elc_fileselector.c:1940
+#: src/lib/elementary/elc_fileselector.c:1831
msgid "Search"
msgstr "Поиск"
-#: src/lib/elementary/elc_fileselector.c:2232
+#: src/lib/elementary/elc_fileselector.c:2107
msgid "OK"
msgstr "ОК"
-#: src/lib/elementary/elc_fileselector.c:2242
-#: src/lib/elementary/elm_entry.c:1719 src/lib/elementary/elm_entry.c:1744
+#: src/lib/elementary/elc_fileselector.c:2117
+#: src/lib/elementary/elm_entry.c:1733 src/lib/elementary/elm_entry.c:1758
msgid "Cancel"
msgstr "Отмена"
-#: src/lib/elementary/elc_hoversel.c:436 src/lib/elementary/efl_ui_button.c:263
-#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/elm_gengrid.c:1483
-#: src/lib/elementary/elm_genlist.c:1750 src/lib/elementary/elm_list.c:2157
-#: src/lib/elementary/efl_ui_radio.c:198
+#: src/lib/elementary/elc_hoversel.c:438 src/lib/elementary/efl_ui_button.c:208
+#: src/lib/elementary/efl_ui_check.c:188 src/lib/elementary/elm_gengrid.c:1511
+#: src/lib/elementary/elm_genlist.c:1759 src/lib/elementary/elm_list.c:2172
+#: src/lib/elementary/efl_ui_radio.c:201
#: src/lib/elementary/elm_segment_control.c:529
-#: src/lib/elementary/elm_spinner.c:1031 src/lib/elementary/elm_toolbar.c:2276
+#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2281
msgid "State: Disabled"
msgstr "Состояние: Отключено"
-#: src/lib/elementary/elc_hoversel.c:638
+#: src/lib/elementary/elc_hoversel.c:651
msgid "Hoversel"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:675
+#: src/lib/elementary/elc_multibuttonentry.c:682
msgid "multi button entry label"
msgstr "метка многокопочного элемента"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:697
+#: src/lib/elementary/elc_multibuttonentry.c:704
msgid "multi button entry item"
msgstr "кнопка многокопочного элемента"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:1579
+#: src/lib/elementary/elc_multibuttonentry.c:1586
msgid "multi button entry"
msgstr "многокнопочный элемент"
-#: src/lib/elementary/elc_naviframe.c:433
-#: src/lib/elementary/elc_naviframe.c:461
+#: src/lib/elementary/elc_naviframe.c:435
+#: src/lib/elementary/elc_naviframe.c:463
msgid "Title"
msgstr "Заголовок"
-#: src/lib/elementary/elc_naviframe.c:440
+#: src/lib/elementary/elc_naviframe.c:442
#, fuzzy
msgid "Subtitle"
msgstr "Заголовок"
-#: src/lib/elementary/elc_naviframe.c:1027
-#: src/lib/elementary/elc_naviframe.c:1245
+#: src/lib/elementary/elc_naviframe.c:1029
+#: src/lib/elementary/elc_naviframe.c:1247
msgid "Back"
msgstr "Назад"
-#: src/lib/elementary/elc_naviframe.c:1343
+#: src/lib/elementary/elc_naviframe.c:1345
msgid "Next"
msgstr "Вперёд"
-#: src/lib/elementary/elc_popup.c:305 src/lib/elementary/elc_popup.c:969
+#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992
msgid "Popup Title"
msgstr "Заголовок всплывающего окна"
-#: src/lib/elementary/elc_popup.c:315 src/lib/elementary/elc_popup.c:1045
+#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068
msgid "Popup Body Text"
msgstr "Текст всплывающего окна"
-#: src/lib/elementary/elc_popup.c:1820
+#: src/lib/elementary/elc_popup.c:1841
msgid "Alert"
msgstr ""
-#: src/lib/elementary/elm_bubble.c:162
+#: src/lib/elementary/elm_bubble.c:163
msgid "Bubble"
msgstr "Облачко"
-#: src/lib/elementary/efl_ui_button.c:70
+#: src/lib/elementary/efl_ui_button.c:71
msgid "Clicked"
msgstr "Нажато"
-#: src/lib/elementary/efl_ui_button.c:290
+#: src/lib/elementary/efl_ui_button.c:250
msgid "Button"
msgstr "Кнопка"
-#: src/lib/elementary/elm_calendar.c:228
+#: src/lib/elementary/elm_calendar.c:244
#: src/lib/elementary/efl_ui_calendar.c:198
msgid "%B %Y"
msgstr "%B %Y"
-#: src/lib/elementary/elm_calendar.c:234
+#: src/lib/elementary/elm_calendar.c:250
msgid "%B"
msgstr "%B"
-#: src/lib/elementary/elm_calendar.c:240
+#: src/lib/elementary/elm_calendar.c:256
msgid "%Y"
msgstr "%Y"
-#: src/lib/elementary/elm_calendar.c:365
+#: src/lib/elementary/elm_calendar.c:382
#: src/lib/elementary/efl_ui_calendar.c:245
msgid "calendar item"
msgstr "элемент календаря"
-#: src/lib/elementary/elm_calendar.c:392
+#: src/lib/elementary/elm_calendar.c:410
#: src/lib/elementary/efl_ui_calendar.c:272
msgid "calendar decrement month button"
msgstr "кнопка календаря для уменьшения месяца"
-#: src/lib/elementary/elm_calendar.c:398
+#: src/lib/elementary/elm_calendar.c:416
msgid "calendar decrement year button"
msgstr "кнопка календаря для уменьшения года"
-#: src/lib/elementary/elm_calendar.c:404
+#: src/lib/elementary/elm_calendar.c:422
#: src/lib/elementary/efl_ui_calendar.c:278
msgid "calendar increment month button"
msgstr "кнопка календаря для увеличения месяца"
-#: src/lib/elementary/elm_calendar.c:410
+#: src/lib/elementary/elm_calendar.c:428
msgid "calendar increment year button"
msgstr "кнопка календаря для увеличения года"
-#: src/lib/elementary/elm_calendar.c:415
+#: src/lib/elementary/elm_calendar.c:433
#: src/lib/elementary/efl_ui_calendar.c:283
msgid "calendar month"
msgstr "месяц календаря"
-#: src/lib/elementary/elm_calendar.c:420
+#: src/lib/elementary/elm_calendar.c:438
#: src/lib/elementary/efl_ui_calendar.c:286
msgid "calendar year"
msgstr "год календаря"
-#: src/lib/elementary/efl_ui_check.c:65 src/lib/elementary/efl_ui_check.c:210
-#: src/lib/elementary/efl_ui_radio.c:120 src/lib/elementary/efl_ui_radio.c:199
+#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201
+#: src/lib/elementary/efl_ui_radio.c:136 src/lib/elementary/efl_ui_radio.c:202
msgid "State: On"
msgstr "Состояния: Включено"
-#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:222
-#: src/lib/elementary/efl_ui_radio.c:201
+#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:213
+#: src/lib/elementary/efl_ui_radio.c:204
msgid "State: Off"
msgstr "Состояние: Выключено"
-#: src/lib/elementary/efl_ui_check.c:206 src/lib/elementary/efl_ui_check.c:219
+#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210
msgid "State"
msgstr "Состояние"
-#: src/lib/elementary/efl_ui_check.c:340
+#: src/lib/elementary/efl_ui_check.c:355
msgid "Check"
msgstr "Флажок"
-#: src/lib/elementary/elm_clock.c:304
+#: src/lib/elementary/elm_clock.c:309
msgid "clock increment button for am,pm"
msgstr "кнопка часов для увеличения am,pm"
-#: src/lib/elementary/elm_clock.c:312
+#: src/lib/elementary/elm_clock.c:317
msgid "clock decrement button for am,pm"
msgstr "кнопка часов для уменьшения am,pm"
-#: src/lib/elementary/elm_clock.c:691
+#: src/lib/elementary/elm_clock.c:714
msgid "State: Editable"
msgstr "Состояние: Редактируемо"
-#: src/lib/elementary/elm_clock.c:726
+#: src/lib/elementary/elm_clock.c:749
msgid "Clock"
msgstr "Часы"
@@ -429,7 +429,7 @@ msgstr ""
msgid "A:"
msgstr ""
-#: src/lib/elementary/elm_colorselector.c:1706
+#: src/lib/elementary/elm_colorselector.c:1707
msgid "color selector palette item"
msgstr "элемент выбора цвета палитры"
@@ -439,11 +439,11 @@ msgstr "элемент выбора цвета палитры"
#. but if this is a right-to-left language like arabic, Farsi,
#. Hebrew, etc. then change this string to be "default:RTL"
#.
-#: src/lib/elementary/elm_config.c:4109
+#: src/lib/elementary/elm_config.c:4187
msgid "default:LTR"
msgstr "default:LTR"
-#: src/lib/elementary/elm_dayselector.c:402
+#: src/lib/elementary/elm_dayselector.c:437
msgid "day selector item"
msgstr "элемент выбора дня"
@@ -451,27 +451,27 @@ msgstr "элемент выбора дня"
msgid "diskselector item"
msgstr "элемент диска выбора"
-#: src/lib/elementary/elm_entry.c:1709
+#: src/lib/elementary/elm_entry.c:1723
msgid "Cut"
msgstr "Вырезать"
-#: src/lib/elementary/elm_entry.c:1712
+#: src/lib/elementary/elm_entry.c:1726
msgid "Copy"
msgstr "Копировать"
-#: src/lib/elementary/elm_entry.c:1716 src/lib/elementary/elm_entry.c:1738
+#: src/lib/elementary/elm_entry.c:1730 src/lib/elementary/elm_entry.c:1752
msgid "Paste"
msgstr "Вставить"
-#: src/lib/elementary/elm_entry.c:1731
+#: src/lib/elementary/elm_entry.c:1745
msgid "Select"
msgstr "Выбрать"
-#: src/lib/elementary/elm_entry.c:3831
+#: src/lib/elementary/elm_entry.c:3894
msgid "Entry"
msgstr "Запись"
-#: src/lib/elementary/elm_gengrid.c:1513
+#: src/lib/elementary/elm_gengrid.c:1541
msgid "Gengrid Item"
msgstr "Элемент сетки"
@@ -483,40 +483,40 @@ msgstr "Алфавитный указатель"
msgid "Index Item"
msgstr "Элемент алфавитного указателя"
-#: src/lib/elementary/elm_label.c:405
+#: src/lib/elementary/elm_label.c:403
msgid "Label"
msgstr "Метка"
-#: src/lib/elementary/elm_panel.c:83
+#: src/lib/elementary/elm_panel.c:84
msgid "state: opened"
msgstr "состояние: открыто"
-#: src/lib/elementary/elm_panel.c:84
+#: src/lib/elementary/elm_panel.c:85
msgid "state: closed"
msgstr "состояние: закрыто"
-#: src/lib/elementary/elm_panel.c:124
+#: src/lib/elementary/elm_panel.c:127
msgid "A panel is open"
msgstr "Панель открыта"
-#: src/lib/elementary/elm_panel.c:126
+#: src/lib/elementary/elm_panel.c:129
msgid "Double tap to close panel menu"
msgstr "Двойной щелчок, чтобы закрыть меню панели"
-#: src/lib/elementary/elm_panel.c:178
+#: src/lib/elementary/elm_panel.c:181
msgid "panel button"
msgstr "кнопка панели"
-#: src/lib/elementary/efl_ui_progressbar.c:393
+#: src/lib/elementary/efl_ui_progressbar.c:397
msgid "progressbar"
msgstr "индикатор выполнения"
-#: src/lib/elementary/efl_ui_radio.c:224
+#: src/lib/elementary/efl_ui_radio.c:231
msgid "Radio"
msgstr "Радио флажок"
#: src/lib/elementary/elm_segment_control.c:532
-#: src/lib/elementary/elm_toolbar.c:2278
+#: src/lib/elementary/elm_toolbar.c:2283
msgid "State: Selected"
msgstr "Состояние: Выбрано"
@@ -528,51 +528,51 @@ msgstr "Состояние: Невыбрано"
msgid "Segment Control Item"
msgstr "Элемент сегментного элемента управления"
-#: src/lib/elementary/efl_ui_slider.c:1193
+#: src/lib/elementary/efl_ui_slider.c:681
msgid "slider"
msgstr "бегунок"
-#: src/lib/elementary/elm_spinner.c:1061
+#: src/lib/elementary/elm_spinner.c:1071
msgid "incremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1067
+#: src/lib/elementary/elm_spinner.c:1077
msgid "decremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1100 src/lib/elementary/elm_spinner.c:1167
+#: src/lib/elementary/elm_spinner.c:1110 src/lib/elementary/elm_spinner.c:1177
msgid "spinner"
msgstr "счётчик"
-#: src/lib/elementary/elm_spinner.c:1109 src/lib/elementary/elm_spinner.c:1150
+#: src/lib/elementary/elm_spinner.c:1119 src/lib/elementary/elm_spinner.c:1160
msgid "spinner increment button"
msgstr "кнопка увеличения счётчика"
-#: src/lib/elementary/elm_spinner.c:1112 src/lib/elementary/elm_spinner.c:1159
+#: src/lib/elementary/elm_spinner.c:1122 src/lib/elementary/elm_spinner.c:1169
msgid "spinner decrement button"
msgstr "кнопка уменьшения счётчика"
-#: src/lib/elementary/elm_spinner.c:1114
+#: src/lib/elementary/elm_spinner.c:1124
#, fuzzy
msgid "spinner text"
msgstr "счётчик"
-#: src/lib/elementary/elm_toolbar.c:1733 src/lib/elementary/elm_toolbar.c:2335
+#: src/lib/elementary/elm_toolbar.c:1738 src/lib/elementary/elm_toolbar.c:2342
msgid "Selected"
msgstr "Выбрано"
-#: src/lib/elementary/elm_toolbar.c:2274
+#: src/lib/elementary/elm_toolbar.c:2279
msgid "Separator"
msgstr "Разделитель"
-#: src/lib/elementary/elm_toolbar.c:2280
+#: src/lib/elementary/elm_toolbar.c:2285
msgid "Has menu"
msgstr "С меню"
-#: src/lib/elementary/elm_toolbar.c:2330
+#: src/lib/elementary/elm_toolbar.c:2337
msgid "Unselected"
msgstr "Невыбрано"
-#: src/lib/elementary/elm_toolbar.c:2347
+#: src/lib/elementary/elm_toolbar.c:2354
msgid "Toolbar Item"
msgstr "Элемент панели инструментов"
diff --git a/po/sl.po b/po/sl.po
index 07f9a84c24..50620c5023 100644
--- a/po/sl.po
+++ b/po/sl.po
@@ -3,12 +3,12 @@
# This file is put in the public domain.
# r1to <renato.rener@gmail.com>, 2011.
#
-#: src/lib/elementary/elm_config.c:4086
+#: src/lib/elementary/elm_config.c:4164
msgid ""
msgstr ""
"Project-Id-Version: Efl\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2017-12-20 00:20+0900\n"
+"POT-Creation-Date: 2018-07-09 16:07+0900\n"
"PO-Revision-Date: 2016-09-21 17:00+0200\n"
"Last-Translator: Renato Rener <renato.rener@gmail.com>\n"
"Language-Team: Enlightenment Team\n"
@@ -238,172 +238,172 @@ msgstr "Slike"
msgid "Videos"
msgstr "Videi"
-#: src/lib/elementary/elc_fileselector.c:1907
+#: src/lib/elementary/elc_fileselector.c:1798
msgid "Up"
msgstr "Gor"
-#: src/lib/elementary/elc_fileselector.c:1921
+#: src/lib/elementary/elc_fileselector.c:1812
msgid "Home"
msgstr "Dom"
-#: src/lib/elementary/elc_fileselector.c:1940
+#: src/lib/elementary/elc_fileselector.c:1831
msgid "Search"
msgstr "Poišči"
-#: src/lib/elementary/elc_fileselector.c:2232
+#: src/lib/elementary/elc_fileselector.c:2107
msgid "OK"
msgstr "V redu"
-#: src/lib/elementary/elc_fileselector.c:2242
-#: src/lib/elementary/elm_entry.c:1719 src/lib/elementary/elm_entry.c:1744
+#: src/lib/elementary/elc_fileselector.c:2117
+#: src/lib/elementary/elm_entry.c:1733 src/lib/elementary/elm_entry.c:1758
msgid "Cancel"
msgstr "Prekliči"
-#: src/lib/elementary/elc_hoversel.c:436 src/lib/elementary/efl_ui_button.c:263
-#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/elm_gengrid.c:1483
-#: src/lib/elementary/elm_genlist.c:1750 src/lib/elementary/elm_list.c:2157
-#: src/lib/elementary/efl_ui_radio.c:198
+#: src/lib/elementary/elc_hoversel.c:438 src/lib/elementary/efl_ui_button.c:208
+#: src/lib/elementary/efl_ui_check.c:188 src/lib/elementary/elm_gengrid.c:1511
+#: src/lib/elementary/elm_genlist.c:1759 src/lib/elementary/elm_list.c:2172
+#: src/lib/elementary/efl_ui_radio.c:201
#: src/lib/elementary/elm_segment_control.c:529
-#: src/lib/elementary/elm_spinner.c:1031 src/lib/elementary/elm_toolbar.c:2276
+#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2281
msgid "State: Disabled"
msgstr "Stanje: onemogočeno"
-#: src/lib/elementary/elc_hoversel.c:638
+#: src/lib/elementary/elc_hoversel.c:651
msgid "Hoversel"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:675
+#: src/lib/elementary/elc_multibuttonentry.c:682
msgid "multi button entry label"
msgstr "oznaka vnosa večkratnih gumbov"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:697
+#: src/lib/elementary/elc_multibuttonentry.c:704
msgid "multi button entry item"
msgstr "predmet vnosa večkratnih gumbov"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:1579
+#: src/lib/elementary/elc_multibuttonentry.c:1586
msgid "multi button entry"
msgstr "vnos večkratnih gumbov"
-#: src/lib/elementary/elc_naviframe.c:433
-#: src/lib/elementary/elc_naviframe.c:461
+#: src/lib/elementary/elc_naviframe.c:435
+#: src/lib/elementary/elc_naviframe.c:463
msgid "Title"
msgstr "Naslov"
-#: src/lib/elementary/elc_naviframe.c:440
+#: src/lib/elementary/elc_naviframe.c:442
#, fuzzy
msgid "Subtitle"
msgstr "Naslov"
-#: src/lib/elementary/elc_naviframe.c:1027
-#: src/lib/elementary/elc_naviframe.c:1245
+#: src/lib/elementary/elc_naviframe.c:1029
+#: src/lib/elementary/elc_naviframe.c:1247
msgid "Back"
msgstr "Nazaj"
-#: src/lib/elementary/elc_naviframe.c:1343
+#: src/lib/elementary/elc_naviframe.c:1345
msgid "Next"
msgstr "Naslednje"
-#: src/lib/elementary/elc_popup.c:305 src/lib/elementary/elc_popup.c:969
+#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992
msgid "Popup Title"
msgstr "Naslov pojavnika"
-#: src/lib/elementary/elc_popup.c:315 src/lib/elementary/elc_popup.c:1045
+#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068
msgid "Popup Body Text"
msgstr "Besedilo telesa pojavnika"
-#: src/lib/elementary/elc_popup.c:1820
+#: src/lib/elementary/elc_popup.c:1841
msgid "Alert"
msgstr ""
-#: src/lib/elementary/elm_bubble.c:162
+#: src/lib/elementary/elm_bubble.c:163
msgid "Bubble"
msgstr "Mehurček"
-#: src/lib/elementary/efl_ui_button.c:70
+#: src/lib/elementary/efl_ui_button.c:71
msgid "Clicked"
msgstr "Kliknjeno"
-#: src/lib/elementary/efl_ui_button.c:290
+#: src/lib/elementary/efl_ui_button.c:250
msgid "Button"
msgstr "Gumb"
-#: src/lib/elementary/elm_calendar.c:228
+#: src/lib/elementary/elm_calendar.c:244
#: src/lib/elementary/efl_ui_calendar.c:198
msgid "%B %Y"
msgstr "%B %Y"
-#: src/lib/elementary/elm_calendar.c:234
+#: src/lib/elementary/elm_calendar.c:250
msgid "%B"
msgstr "%B"
-#: src/lib/elementary/elm_calendar.c:240
+#: src/lib/elementary/elm_calendar.c:256
msgid "%Y"
msgstr "%Y"
-#: src/lib/elementary/elm_calendar.c:365
+#: src/lib/elementary/elm_calendar.c:382
#: src/lib/elementary/efl_ui_calendar.c:245
msgid "calendar item"
msgstr "predmet koledarja"
-#: src/lib/elementary/elm_calendar.c:392
+#: src/lib/elementary/elm_calendar.c:410
#: src/lib/elementary/efl_ui_calendar.c:272
msgid "calendar decrement month button"
msgstr "koledarski gumb za mesec nazaj"
-#: src/lib/elementary/elm_calendar.c:398
+#: src/lib/elementary/elm_calendar.c:416
msgid "calendar decrement year button"
msgstr "koledarski gumb za leto nazaj"
-#: src/lib/elementary/elm_calendar.c:404
+#: src/lib/elementary/elm_calendar.c:422
#: src/lib/elementary/efl_ui_calendar.c:278
msgid "calendar increment month button"
msgstr "koledarski gumb za mesec naprej"
-#: src/lib/elementary/elm_calendar.c:410
+#: src/lib/elementary/elm_calendar.c:428
msgid "calendar increment year button"
msgstr "koledarski gumb za leto naprej"
-#: src/lib/elementary/elm_calendar.c:415
+#: src/lib/elementary/elm_calendar.c:433
#: src/lib/elementary/efl_ui_calendar.c:283
msgid "calendar month"
msgstr "mesečni koledar"
-#: src/lib/elementary/elm_calendar.c:420
+#: src/lib/elementary/elm_calendar.c:438
#: src/lib/elementary/efl_ui_calendar.c:286
msgid "calendar year"
msgstr "letni koledar"
-#: src/lib/elementary/efl_ui_check.c:65 src/lib/elementary/efl_ui_check.c:210
-#: src/lib/elementary/efl_ui_radio.c:120 src/lib/elementary/efl_ui_radio.c:199
+#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201
+#: src/lib/elementary/efl_ui_radio.c:136 src/lib/elementary/efl_ui_radio.c:202
msgid "State: On"
msgstr "Stanje: Vključeno"
-#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:222
-#: src/lib/elementary/efl_ui_radio.c:201
+#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:213
+#: src/lib/elementary/efl_ui_radio.c:204
msgid "State: Off"
msgstr "Stanje: Izključeno"
-#: src/lib/elementary/efl_ui_check.c:206 src/lib/elementary/efl_ui_check.c:219
+#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210
msgid "State"
msgstr "Stanje"
-#: src/lib/elementary/efl_ui_check.c:340
+#: src/lib/elementary/efl_ui_check.c:355
msgid "Check"
msgstr "Preveri"
-#: src/lib/elementary/elm_clock.c:304
+#: src/lib/elementary/elm_clock.c:309
msgid "clock increment button for am,pm"
msgstr "gumb zviševanja ure za am,pm"
-#: src/lib/elementary/elm_clock.c:312
+#: src/lib/elementary/elm_clock.c:317
msgid "clock decrement button for am,pm"
msgstr "gumb zniževanja ure za am,pm"
-#: src/lib/elementary/elm_clock.c:691
+#: src/lib/elementary/elm_clock.c:714
msgid "State: Editable"
msgstr "Stanje: Urejanje možno"
-#: src/lib/elementary/elm_clock.c:726
+#: src/lib/elementary/elm_clock.c:749
msgid "Clock"
msgstr "Ura"
@@ -427,7 +427,7 @@ msgstr "B:"
msgid "A:"
msgstr "A:"
-#: src/lib/elementary/elm_colorselector.c:1706
+#: src/lib/elementary/elm_colorselector.c:1707
msgid "color selector palette item"
msgstr "izbirnik s paleto barve"
@@ -437,11 +437,11 @@ msgstr "izbirnik s paleto barve"
#. but if this is a right-to-left language like arabic, Farsi,
#. Hebrew, etc. then change this string to be "default:RTL"
#.
-#: src/lib/elementary/elm_config.c:4109
+#: src/lib/elementary/elm_config.c:4187
msgid "default:LTR"
msgstr "default:LTR"
-#: src/lib/elementary/elm_dayselector.c:402
+#: src/lib/elementary/elm_dayselector.c:437
msgid "day selector item"
msgstr "izbirnik dneva"
@@ -449,27 +449,27 @@ msgstr "izbirnik dneva"
msgid "diskselector item"
msgstr "izbirnik diska"
-#: src/lib/elementary/elm_entry.c:1709
+#: src/lib/elementary/elm_entry.c:1723
msgid "Cut"
msgstr "Izreži"
-#: src/lib/elementary/elm_entry.c:1712
+#: src/lib/elementary/elm_entry.c:1726
msgid "Copy"
msgstr "Kopiraj"
-#: src/lib/elementary/elm_entry.c:1716 src/lib/elementary/elm_entry.c:1738
+#: src/lib/elementary/elm_entry.c:1730 src/lib/elementary/elm_entry.c:1752
msgid "Paste"
msgstr "Prilepi"
-#: src/lib/elementary/elm_entry.c:1731
+#: src/lib/elementary/elm_entry.c:1745
msgid "Select"
msgstr "Izberi"
-#: src/lib/elementary/elm_entry.c:3831
+#: src/lib/elementary/elm_entry.c:3894
msgid "Entry"
msgstr "Vnos"
-#: src/lib/elementary/elm_gengrid.c:1513
+#: src/lib/elementary/elm_gengrid.c:1541
msgid "Gengrid Item"
msgstr "Generator mreže"
@@ -481,40 +481,40 @@ msgstr "Kazalo"
msgid "Index Item"
msgstr "Predmet kazala"
-#: src/lib/elementary/elm_label.c:405
+#: src/lib/elementary/elm_label.c:403
msgid "Label"
msgstr "Oznaka"
-#: src/lib/elementary/elm_panel.c:83
+#: src/lib/elementary/elm_panel.c:84
msgid "state: opened"
msgstr "stanje: odprto"
-#: src/lib/elementary/elm_panel.c:84
+#: src/lib/elementary/elm_panel.c:85
msgid "state: closed"
msgstr "stanje: zaprto"
-#: src/lib/elementary/elm_panel.c:124
+#: src/lib/elementary/elm_panel.c:127
msgid "A panel is open"
msgstr "Vrstica je odprta"
-#: src/lib/elementary/elm_panel.c:126
+#: src/lib/elementary/elm_panel.c:129
msgid "Double tap to close panel menu"
msgstr "Dvoklik za zaprtje menija vrstice"
-#: src/lib/elementary/elm_panel.c:178
+#: src/lib/elementary/elm_panel.c:181
msgid "panel button"
msgstr "gumb vrstice"
-#: src/lib/elementary/efl_ui_progressbar.c:393
+#: src/lib/elementary/efl_ui_progressbar.c:397
msgid "progressbar"
msgstr "vrstica poteka"
-#: src/lib/elementary/efl_ui_radio.c:224
+#: src/lib/elementary/efl_ui_radio.c:231
msgid "Radio"
msgstr "Radio"
#: src/lib/elementary/elm_segment_control.c:532
-#: src/lib/elementary/elm_toolbar.c:2278
+#: src/lib/elementary/elm_toolbar.c:2283
msgid "State: Selected"
msgstr "Stanje: Izbrano"
@@ -526,50 +526,50 @@ msgstr "Stanje: Neizbrano"
msgid "Segment Control Item"
msgstr "Nadzornik segmenta"
-#: src/lib/elementary/efl_ui_slider.c:1193
+#: src/lib/elementary/efl_ui_slider.c:681
msgid "slider"
msgstr "drsnik"
-#: src/lib/elementary/elm_spinner.c:1061
+#: src/lib/elementary/elm_spinner.c:1071
msgid "incremented"
msgstr "povečevano"
-#: src/lib/elementary/elm_spinner.c:1067
+#: src/lib/elementary/elm_spinner.c:1077
msgid "decremented"
msgstr "zniževano"
-#: src/lib/elementary/elm_spinner.c:1100 src/lib/elementary/elm_spinner.c:1167
+#: src/lib/elementary/elm_spinner.c:1110 src/lib/elementary/elm_spinner.c:1177
msgid "spinner"
msgstr "vrtilnik"
-#: src/lib/elementary/elm_spinner.c:1109 src/lib/elementary/elm_spinner.c:1150
+#: src/lib/elementary/elm_spinner.c:1119 src/lib/elementary/elm_spinner.c:1160
msgid "spinner increment button"
msgstr "gumb za povečevanje vrtilnika"
-#: src/lib/elementary/elm_spinner.c:1112 src/lib/elementary/elm_spinner.c:1159
+#: src/lib/elementary/elm_spinner.c:1122 src/lib/elementary/elm_spinner.c:1169
msgid "spinner decrement button"
msgstr "gumb za zniževanje vrtilnika"
-#: src/lib/elementary/elm_spinner.c:1114
+#: src/lib/elementary/elm_spinner.c:1124
msgid "spinner text"
msgstr "besedilo vrtilnika"
-#: src/lib/elementary/elm_toolbar.c:1733 src/lib/elementary/elm_toolbar.c:2335
+#: src/lib/elementary/elm_toolbar.c:1738 src/lib/elementary/elm_toolbar.c:2342
msgid "Selected"
msgstr "Izbrano"
-#: src/lib/elementary/elm_toolbar.c:2274
+#: src/lib/elementary/elm_toolbar.c:2279
msgid "Separator"
msgstr "Ločilnik"
-#: src/lib/elementary/elm_toolbar.c:2280
+#: src/lib/elementary/elm_toolbar.c:2285
msgid "Has menu"
msgstr "Ima meni"
-#: src/lib/elementary/elm_toolbar.c:2330
+#: src/lib/elementary/elm_toolbar.c:2337
msgid "Unselected"
msgstr "Neizbrano"
-#: src/lib/elementary/elm_toolbar.c:2347
+#: src/lib/elementary/elm_toolbar.c:2354
msgid "Toolbar Item"
msgstr "Predmet orodne vrstice"
diff --git a/po/sr.po b/po/sr.po
index 504edb9ac2..7e14a29b68 100644
--- a/po/sr.po
+++ b/po/sr.po
@@ -4,12 +4,12 @@
# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
# Саша Петровић <salepetronije@gmail.com>, 2013, 2015.
#
-#: src/lib/elementary/elm_config.c:4086
+#: src/lib/elementary/elm_config.c:4164
msgid ""
msgstr ""
"Project-Id-Version: а\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2017-12-20 00:20+0900\n"
+"POT-Creation-Date: 2018-07-09 16:07+0900\n"
"PO-Revision-Date: 2015-01-31 14:06+0100\n"
"Last-Translator: Саша Петровић <salepetronije@gmail.com>\n"
"Language-Team: српски <xfce4@xfce4.org>\n"
@@ -242,172 +242,172 @@ msgstr "Слике"
msgid "Videos"
msgstr "Видео снимци"
-#: src/lib/elementary/elc_fileselector.c:1907
+#: src/lib/elementary/elc_fileselector.c:1798
msgid "Up"
msgstr "Горе"
-#: src/lib/elementary/elc_fileselector.c:1921
+#: src/lib/elementary/elc_fileselector.c:1812
msgid "Home"
msgstr "Лична фасцикла"
-#: src/lib/elementary/elc_fileselector.c:1940
+#: src/lib/elementary/elc_fileselector.c:1831
msgid "Search"
msgstr "Тражи"
-#: src/lib/elementary/elc_fileselector.c:2232
+#: src/lib/elementary/elc_fileselector.c:2107
msgid "OK"
msgstr "У реду"
-#: src/lib/elementary/elc_fileselector.c:2242
-#: src/lib/elementary/elm_entry.c:1719 src/lib/elementary/elm_entry.c:1744
+#: src/lib/elementary/elc_fileselector.c:2117
+#: src/lib/elementary/elm_entry.c:1733 src/lib/elementary/elm_entry.c:1758
msgid "Cancel"
msgstr "Откажи"
-#: src/lib/elementary/elc_hoversel.c:436 src/lib/elementary/efl_ui_button.c:263
-#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/elm_gengrid.c:1483
-#: src/lib/elementary/elm_genlist.c:1750 src/lib/elementary/elm_list.c:2157
-#: src/lib/elementary/efl_ui_radio.c:198
+#: src/lib/elementary/elc_hoversel.c:438 src/lib/elementary/efl_ui_button.c:208
+#: src/lib/elementary/efl_ui_check.c:188 src/lib/elementary/elm_gengrid.c:1511
+#: src/lib/elementary/elm_genlist.c:1759 src/lib/elementary/elm_list.c:2172
+#: src/lib/elementary/efl_ui_radio.c:201
#: src/lib/elementary/elm_segment_control.c:529
-#: src/lib/elementary/elm_spinner.c:1031 src/lib/elementary/elm_toolbar.c:2276
+#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2281
msgid "State: Disabled"
msgstr "Стање: онемогућено"
-#: src/lib/elementary/elc_hoversel.c:638
+#: src/lib/elementary/elc_hoversel.c:651
msgid "Hoversel"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:675
+#: src/lib/elementary/elc_multibuttonentry.c:682
msgid "multi button entry label"
msgstr "ознака улаза са више дугмади"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:697
+#: src/lib/elementary/elc_multibuttonentry.c:704
msgid "multi button entry item"
msgstr "ставка улаза са више дугмади"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:1579
+#: src/lib/elementary/elc_multibuttonentry.c:1586
msgid "multi button entry"
msgstr "улаз са више дугмади"
-#: src/lib/elementary/elc_naviframe.c:433
-#: src/lib/elementary/elc_naviframe.c:461
+#: src/lib/elementary/elc_naviframe.c:435
+#: src/lib/elementary/elc_naviframe.c:463
msgid "Title"
msgstr "Наслов"
-#: src/lib/elementary/elc_naviframe.c:440
+#: src/lib/elementary/elc_naviframe.c:442
#, fuzzy
msgid "Subtitle"
msgstr "Наслов"
-#: src/lib/elementary/elc_naviframe.c:1027
-#: src/lib/elementary/elc_naviframe.c:1245
+#: src/lib/elementary/elc_naviframe.c:1029
+#: src/lib/elementary/elc_naviframe.c:1247
msgid "Back"
msgstr "Назад"
-#: src/lib/elementary/elc_naviframe.c:1343
+#: src/lib/elementary/elc_naviframe.c:1345
msgid "Next"
msgstr "Следеће"
-#: src/lib/elementary/elc_popup.c:305 src/lib/elementary/elc_popup.c:969
+#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992
msgid "Popup Title"
msgstr "Искачући наслов"
-#: src/lib/elementary/elc_popup.c:315 src/lib/elementary/elc_popup.c:1045
+#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068
msgid "Popup Body Text"
msgstr "Тело искачућег текста"
-#: src/lib/elementary/elc_popup.c:1820
+#: src/lib/elementary/elc_popup.c:1841
msgid "Alert"
msgstr ""
-#: src/lib/elementary/elm_bubble.c:162
+#: src/lib/elementary/elm_bubble.c:163
msgid "Bubble"
msgstr "Мехур"
-#: src/lib/elementary/efl_ui_button.c:70
+#: src/lib/elementary/efl_ui_button.c:71
msgid "Clicked"
msgstr "Кликнуто"
-#: src/lib/elementary/efl_ui_button.c:290
+#: src/lib/elementary/efl_ui_button.c:250
msgid "Button"
msgstr "Дугме"
-#: src/lib/elementary/elm_calendar.c:228
+#: src/lib/elementary/elm_calendar.c:244
#: src/lib/elementary/efl_ui_calendar.c:198
msgid "%B %Y"
msgstr "%B %Y"
-#: src/lib/elementary/elm_calendar.c:234
+#: src/lib/elementary/elm_calendar.c:250
msgid "%B"
msgstr "%B"
-#: src/lib/elementary/elm_calendar.c:240
+#: src/lib/elementary/elm_calendar.c:256
msgid "%Y"
msgstr "%Y"
-#: src/lib/elementary/elm_calendar.c:365
+#: src/lib/elementary/elm_calendar.c:382
#: src/lib/elementary/efl_ui_calendar.c:245
msgid "calendar item"
msgstr "ставка календара"
-#: src/lib/elementary/elm_calendar.c:392
+#: src/lib/elementary/elm_calendar.c:410
#: src/lib/elementary/efl_ui_calendar.c:272
msgid "calendar decrement month button"
msgstr "дугме померања месеца календара уназад"
-#: src/lib/elementary/elm_calendar.c:398
+#: src/lib/elementary/elm_calendar.c:416
msgid "calendar decrement year button"
msgstr "дугме померања година календара уназад"
-#: src/lib/elementary/elm_calendar.c:404
+#: src/lib/elementary/elm_calendar.c:422
#: src/lib/elementary/efl_ui_calendar.c:278
msgid "calendar increment month button"
msgstr "дугме померања месеца календара унапред"
-#: src/lib/elementary/elm_calendar.c:410
+#: src/lib/elementary/elm_calendar.c:428
msgid "calendar increment year button"
msgstr "дугме померања година календара унапред"
-#: src/lib/elementary/elm_calendar.c:415
+#: src/lib/elementary/elm_calendar.c:433
#: src/lib/elementary/efl_ui_calendar.c:283
msgid "calendar month"
msgstr "месец календара"
-#: src/lib/elementary/elm_calendar.c:420
+#: src/lib/elementary/elm_calendar.c:438
#: src/lib/elementary/efl_ui_calendar.c:286
msgid "calendar year"
msgstr "година календара"
-#: src/lib/elementary/efl_ui_check.c:65 src/lib/elementary/efl_ui_check.c:210
-#: src/lib/elementary/efl_ui_radio.c:120 src/lib/elementary/efl_ui_radio.c:199
+#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201
+#: src/lib/elementary/efl_ui_radio.c:136 src/lib/elementary/efl_ui_radio.c:202
msgid "State: On"
msgstr "Стање : укључен"
-#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:222
-#: src/lib/elementary/efl_ui_radio.c:201
+#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:213
+#: src/lib/elementary/efl_ui_radio.c:204
msgid "State: Off"
msgstr "Стање: искључен"
-#: src/lib/elementary/efl_ui_check.c:206 src/lib/elementary/efl_ui_check.c:219
+#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210
msgid "State"
msgstr "Стање"
-#: src/lib/elementary/efl_ui_check.c:340
+#: src/lib/elementary/efl_ui_check.c:355
msgid "Check"
msgstr "Провера"
-#: src/lib/elementary/elm_clock.c:304
+#: src/lib/elementary/elm_clock.c:309
msgid "clock increment button for am,pm"
msgstr "дугме за увећање часовника са am,pm"
-#: src/lib/elementary/elm_clock.c:312
+#: src/lib/elementary/elm_clock.c:317
msgid "clock decrement button for am,pm"
msgstr "дугме за смањивање часовника са am,pm"
-#: src/lib/elementary/elm_clock.c:691
+#: src/lib/elementary/elm_clock.c:714
msgid "State: Editable"
msgstr "Стање: уредиво"
-#: src/lib/elementary/elm_clock.c:726
+#: src/lib/elementary/elm_clock.c:749
msgid "Clock"
msgstr "Сат"
@@ -431,7 +431,7 @@ msgstr ""
msgid "A:"
msgstr ""
-#: src/lib/elementary/elm_colorselector.c:1706
+#: src/lib/elementary/elm_colorselector.c:1707
msgid "color selector palette item"
msgstr "ставка избирача палете боја"
@@ -441,11 +441,11 @@ msgstr "ставка избирача палете боја"
#. but if this is a right-to-left language like arabic, Farsi,
#. Hebrew, etc. then change this string to be "default:RTL"
#.
-#: src/lib/elementary/elm_config.c:4109
+#: src/lib/elementary/elm_config.c:4187
msgid "default:LTR"
msgstr "default:LTR"
-#: src/lib/elementary/elm_dayselector.c:402
+#: src/lib/elementary/elm_dayselector.c:437
msgid "day selector item"
msgstr "ставка одабирач дана"
@@ -453,27 +453,27 @@ msgstr "ставка одабирач дана"
msgid "diskselector item"
msgstr "ставка одабира диска"
-#: src/lib/elementary/elm_entry.c:1709
+#: src/lib/elementary/elm_entry.c:1723
msgid "Cut"
msgstr "Исеци"
-#: src/lib/elementary/elm_entry.c:1712
+#: src/lib/elementary/elm_entry.c:1726
msgid "Copy"
msgstr "Умножи"
-#: src/lib/elementary/elm_entry.c:1716 src/lib/elementary/elm_entry.c:1738
+#: src/lib/elementary/elm_entry.c:1730 src/lib/elementary/elm_entry.c:1752
msgid "Paste"
msgstr "Прилепи"
-#: src/lib/elementary/elm_entry.c:1731
+#: src/lib/elementary/elm_entry.c:1745
msgid "Select"
msgstr "Изаберите"
-#: src/lib/elementary/elm_entry.c:3831
+#: src/lib/elementary/elm_entry.c:3894
msgid "Entry"
msgstr "Улаз"
-#: src/lib/elementary/elm_gengrid.c:1513
+#: src/lib/elementary/elm_gengrid.c:1541
msgid "Gengrid Item"
msgstr "Ставка родне мреже"
@@ -485,40 +485,40 @@ msgstr "Садржина"
msgid "Index Item"
msgstr "Ставка садржине"
-#: src/lib/elementary/elm_label.c:405
+#: src/lib/elementary/elm_label.c:403
msgid "Label"
msgstr "Натпис"
-#: src/lib/elementary/elm_panel.c:83
+#: src/lib/elementary/elm_panel.c:84
msgid "state: opened"
msgstr "стање: отворено"
-#: src/lib/elementary/elm_panel.c:84
+#: src/lib/elementary/elm_panel.c:85
msgid "state: closed"
msgstr "стање: затворено"
-#: src/lib/elementary/elm_panel.c:124
+#: src/lib/elementary/elm_panel.c:127
msgid "A panel is open"
msgstr "Полица је отворена"
-#: src/lib/elementary/elm_panel.c:126
+#: src/lib/elementary/elm_panel.c:129
msgid "Double tap to close panel menu"
msgstr "Двапут додирните за затварање изборника полице"
-#: src/lib/elementary/elm_panel.c:178
+#: src/lib/elementary/elm_panel.c:181
msgid "panel button"
msgstr "дугме полице"
-#: src/lib/elementary/efl_ui_progressbar.c:393
+#: src/lib/elementary/efl_ui_progressbar.c:397
msgid "progressbar"
msgstr "трака напретка"
-#: src/lib/elementary/efl_ui_radio.c:224
+#: src/lib/elementary/efl_ui_radio.c:231
msgid "Radio"
msgstr "Искључујуће дугме"
#: src/lib/elementary/elm_segment_control.c:532
-#: src/lib/elementary/elm_toolbar.c:2278
+#: src/lib/elementary/elm_toolbar.c:2283
msgid "State: Selected"
msgstr "Стање: означено"
@@ -530,51 +530,51 @@ msgstr "Стање: неозначено"
msgid "Segment Control Item"
msgstr "Ставка провере дела"
-#: src/lib/elementary/efl_ui_slider.c:1193
+#: src/lib/elementary/efl_ui_slider.c:681
msgid "slider"
msgstr "клизач"
-#: src/lib/elementary/elm_spinner.c:1061
+#: src/lib/elementary/elm_spinner.c:1071
msgid "incremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1067
+#: src/lib/elementary/elm_spinner.c:1077
msgid "decremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1100 src/lib/elementary/elm_spinner.c:1167
+#: src/lib/elementary/elm_spinner.c:1110 src/lib/elementary/elm_spinner.c:1177
msgid "spinner"
msgstr "избирач са стрелицама"
-#: src/lib/elementary/elm_spinner.c:1109 src/lib/elementary/elm_spinner.c:1150
+#: src/lib/elementary/elm_spinner.c:1119 src/lib/elementary/elm_spinner.c:1160
msgid "spinner increment button"
msgstr "стрелица избирача увећaња"
-#: src/lib/elementary/elm_spinner.c:1112 src/lib/elementary/elm_spinner.c:1159
+#: src/lib/elementary/elm_spinner.c:1122 src/lib/elementary/elm_spinner.c:1169
msgid "spinner decrement button"
msgstr "стрелица избирача смањења"
-#: src/lib/elementary/elm_spinner.c:1114
+#: src/lib/elementary/elm_spinner.c:1124
#, fuzzy
msgid "spinner text"
msgstr "избирач са стрелицама"
-#: src/lib/elementary/elm_toolbar.c:1733 src/lib/elementary/elm_toolbar.c:2335
+#: src/lib/elementary/elm_toolbar.c:1738 src/lib/elementary/elm_toolbar.c:2342
msgid "Selected"
msgstr "Изабрано"
-#: src/lib/elementary/elm_toolbar.c:2274
+#: src/lib/elementary/elm_toolbar.c:2279
msgid "Separator"
msgstr "Одвајач"
-#: src/lib/elementary/elm_toolbar.c:2280
+#: src/lib/elementary/elm_toolbar.c:2285
msgid "Has menu"
msgstr "Има изборник"
-#: src/lib/elementary/elm_toolbar.c:2330
+#: src/lib/elementary/elm_toolbar.c:2337
msgid "Unselected"
msgstr "Неозначено"
-#: src/lib/elementary/elm_toolbar.c:2347
+#: src/lib/elementary/elm_toolbar.c:2354
msgid "Toolbar Item"
msgstr "Ставка траке алата"
diff --git a/po/tr.po b/po/tr.po
index 4b61649b0a..1bbff72966 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -3,12 +3,12 @@
# This file is distributed under the same license as the enlightenment package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
#
-#: src/lib/elementary/elm_config.c:4086
+#: src/lib/elementary/elm_config.c:4164
msgid ""
msgstr ""
"Project-Id-Version: enlightenment\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2017-12-20 00:20+0900\n"
+"POT-Creation-Date: 2018-07-09 16:07+0900\n"
"PO-Revision-Date: 2014-04-18 13:35+0000\n"
"Last-Translator: Ali E.İMREK <alierkanimrek@gmail.com>\n"
"Language-Team: Turkish <tr@li.org>\n"
@@ -239,172 +239,172 @@ msgstr "Resimler"
msgid "Videos"
msgstr "Videolar"
-#: src/lib/elementary/elc_fileselector.c:1907
+#: src/lib/elementary/elc_fileselector.c:1798
msgid "Up"
msgstr "Yukarı"
-#: src/lib/elementary/elc_fileselector.c:1921
+#: src/lib/elementary/elc_fileselector.c:1812
msgid "Home"
msgstr "Ev"
-#: src/lib/elementary/elc_fileselector.c:1940
+#: src/lib/elementary/elc_fileselector.c:1831
msgid "Search"
msgstr ""
-#: src/lib/elementary/elc_fileselector.c:2232
+#: src/lib/elementary/elc_fileselector.c:2107
msgid "OK"
msgstr "Tamam"
-#: src/lib/elementary/elc_fileselector.c:2242
-#: src/lib/elementary/elm_entry.c:1719 src/lib/elementary/elm_entry.c:1744
+#: src/lib/elementary/elc_fileselector.c:2117
+#: src/lib/elementary/elm_entry.c:1733 src/lib/elementary/elm_entry.c:1758
msgid "Cancel"
msgstr "İptal"
-#: src/lib/elementary/elc_hoversel.c:436 src/lib/elementary/efl_ui_button.c:263
-#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/elm_gengrid.c:1483
-#: src/lib/elementary/elm_genlist.c:1750 src/lib/elementary/elm_list.c:2157
-#: src/lib/elementary/efl_ui_radio.c:198
+#: src/lib/elementary/elc_hoversel.c:438 src/lib/elementary/efl_ui_button.c:208
+#: src/lib/elementary/efl_ui_check.c:188 src/lib/elementary/elm_gengrid.c:1511
+#: src/lib/elementary/elm_genlist.c:1759 src/lib/elementary/elm_list.c:2172
+#: src/lib/elementary/efl_ui_radio.c:201
#: src/lib/elementary/elm_segment_control.c:529
-#: src/lib/elementary/elm_spinner.c:1031 src/lib/elementary/elm_toolbar.c:2276
+#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2281
msgid "State: Disabled"
msgstr "Durum: Kapalı"
-#: src/lib/elementary/elc_hoversel.c:638
+#: src/lib/elementary/elc_hoversel.c:651
msgid "Hoversel"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:675
+#: src/lib/elementary/elc_multibuttonentry.c:682
msgid "multi button entry label"
msgstr "çoklu düğme giriş etiketi"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:697
+#: src/lib/elementary/elc_multibuttonentry.c:704
msgid "multi button entry item"
msgstr "çoklu düğme giriş öğesi"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:1579
+#: src/lib/elementary/elc_multibuttonentry.c:1586
msgid "multi button entry"
msgstr "çoklu düğme girişi"
-#: src/lib/elementary/elc_naviframe.c:433
-#: src/lib/elementary/elc_naviframe.c:461
+#: src/lib/elementary/elc_naviframe.c:435
+#: src/lib/elementary/elc_naviframe.c:463
msgid "Title"
msgstr "Başlık"
-#: src/lib/elementary/elc_naviframe.c:440
+#: src/lib/elementary/elc_naviframe.c:442
#, fuzzy
msgid "Subtitle"
msgstr "Başlık"
-#: src/lib/elementary/elc_naviframe.c:1027
-#: src/lib/elementary/elc_naviframe.c:1245
+#: src/lib/elementary/elc_naviframe.c:1029
+#: src/lib/elementary/elc_naviframe.c:1247
msgid "Back"
msgstr "Geri"
-#: src/lib/elementary/elc_naviframe.c:1343
+#: src/lib/elementary/elc_naviframe.c:1345
msgid "Next"
msgstr "Sonraki"
-#: src/lib/elementary/elc_popup.c:305 src/lib/elementary/elc_popup.c:969
+#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992
msgid "Popup Title"
msgstr "Pencere başlığı"
-#: src/lib/elementary/elc_popup.c:315 src/lib/elementary/elc_popup.c:1045
+#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068
msgid "Popup Body Text"
msgstr "Pencere gövde metni"
-#: src/lib/elementary/elc_popup.c:1820
+#: src/lib/elementary/elc_popup.c:1841
msgid "Alert"
msgstr ""
-#: src/lib/elementary/elm_bubble.c:162
+#: src/lib/elementary/elm_bubble.c:163
msgid "Bubble"
msgstr "Balon"
-#: src/lib/elementary/efl_ui_button.c:70
+#: src/lib/elementary/efl_ui_button.c:71
msgid "Clicked"
msgstr "Tıklanmış"
-#: src/lib/elementary/efl_ui_button.c:290
+#: src/lib/elementary/efl_ui_button.c:250
msgid "Button"
msgstr "Düğme"
-#: src/lib/elementary/elm_calendar.c:228
+#: src/lib/elementary/elm_calendar.c:244
#: src/lib/elementary/efl_ui_calendar.c:198
msgid "%B %Y"
msgstr "%B %Y"
-#: src/lib/elementary/elm_calendar.c:234
+#: src/lib/elementary/elm_calendar.c:250
msgid "%B"
msgstr "%B"
-#: src/lib/elementary/elm_calendar.c:240
+#: src/lib/elementary/elm_calendar.c:256
msgid "%Y"
msgstr "%Y"
-#: src/lib/elementary/elm_calendar.c:365
+#: src/lib/elementary/elm_calendar.c:382
#: src/lib/elementary/efl_ui_calendar.c:245
msgid "calendar item"
msgstr "takvim nesnesi"
-#: src/lib/elementary/elm_calendar.c:392
+#: src/lib/elementary/elm_calendar.c:410
#: src/lib/elementary/efl_ui_calendar.c:272
msgid "calendar decrement month button"
msgstr "takvim ayı azaltma düğmesi"
-#: src/lib/elementary/elm_calendar.c:398
+#: src/lib/elementary/elm_calendar.c:416
msgid "calendar decrement year button"
msgstr "takvim yılı azaltma düğmesi"
-#: src/lib/elementary/elm_calendar.c:404
+#: src/lib/elementary/elm_calendar.c:422
#: src/lib/elementary/efl_ui_calendar.c:278
msgid "calendar increment month button"
msgstr "takvim ayı arttırma düğmesi"
-#: src/lib/elementary/elm_calendar.c:410
+#: src/lib/elementary/elm_calendar.c:428
msgid "calendar increment year button"
msgstr "takvim yılı arttırma düğmesi"
-#: src/lib/elementary/elm_calendar.c:415
+#: src/lib/elementary/elm_calendar.c:433
#: src/lib/elementary/efl_ui_calendar.c:283
msgid "calendar month"
msgstr "takvim ayı"
-#: src/lib/elementary/elm_calendar.c:420
+#: src/lib/elementary/elm_calendar.c:438
#: src/lib/elementary/efl_ui_calendar.c:286
msgid "calendar year"
msgstr "takvim yılı"
-#: src/lib/elementary/efl_ui_check.c:65 src/lib/elementary/efl_ui_check.c:210
-#: src/lib/elementary/efl_ui_radio.c:120 src/lib/elementary/efl_ui_radio.c:199
+#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201
+#: src/lib/elementary/efl_ui_radio.c:136 src/lib/elementary/efl_ui_radio.c:202
msgid "State: On"
msgstr "Durum: Açık"
-#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:222
-#: src/lib/elementary/efl_ui_radio.c:201
+#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:213
+#: src/lib/elementary/efl_ui_radio.c:204
msgid "State: Off"
msgstr "Durum: Kapalı"
-#: src/lib/elementary/efl_ui_check.c:206 src/lib/elementary/efl_ui_check.c:219
+#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210
msgid "State"
msgstr "Durum"
-#: src/lib/elementary/efl_ui_check.c:340
+#: src/lib/elementary/efl_ui_check.c:355
msgid "Check"
msgstr "Kontrol et"
-#: src/lib/elementary/elm_clock.c:304
+#: src/lib/elementary/elm_clock.c:309
msgid "clock increment button for am,pm"
msgstr "öö,ös için saat arttırma düğmesi"
-#: src/lib/elementary/elm_clock.c:312
+#: src/lib/elementary/elm_clock.c:317
msgid "clock decrement button for am,pm"
msgstr "öö,ös için saat azaltma düğmesi"
-#: src/lib/elementary/elm_clock.c:691
+#: src/lib/elementary/elm_clock.c:714
msgid "State: Editable"
msgstr "Durum: Düzenlenebilir"
-#: src/lib/elementary/elm_clock.c:726
+#: src/lib/elementary/elm_clock.c:749
msgid "Clock"
msgstr "Saat"
@@ -428,7 +428,7 @@ msgstr ""
msgid "A:"
msgstr ""
-#: src/lib/elementary/elm_colorselector.c:1706
+#: src/lib/elementary/elm_colorselector.c:1707
msgid "color selector palette item"
msgstr "renk seçici paleti öğesi"
@@ -438,11 +438,11 @@ msgstr "renk seçici paleti öğesi"
#. but if this is a right-to-left language like arabic, Farsi,
#. Hebrew, etc. then change this string to be "default:RTL"
#.
-#: src/lib/elementary/elm_config.c:4109
+#: src/lib/elementary/elm_config.c:4187
msgid "default:LTR"
msgstr "default:LTR"
-#: src/lib/elementary/elm_dayselector.c:402
+#: src/lib/elementary/elm_dayselector.c:437
msgid "day selector item"
msgstr "gün seçici ögesi"
@@ -450,27 +450,27 @@ msgstr "gün seçici ögesi"
msgid "diskselector item"
msgstr "disk seçici öğesi"
-#: src/lib/elementary/elm_entry.c:1709
+#: src/lib/elementary/elm_entry.c:1723
msgid "Cut"
msgstr "Kes"
-#: src/lib/elementary/elm_entry.c:1712
+#: src/lib/elementary/elm_entry.c:1726
msgid "Copy"
msgstr "Kopyala"
-#: src/lib/elementary/elm_entry.c:1716 src/lib/elementary/elm_entry.c:1738
+#: src/lib/elementary/elm_entry.c:1730 src/lib/elementary/elm_entry.c:1752
msgid "Paste"
msgstr "Yapıştır"
-#: src/lib/elementary/elm_entry.c:1731
+#: src/lib/elementary/elm_entry.c:1745
msgid "Select"
msgstr "Seç"
-#: src/lib/elementary/elm_entry.c:3831
+#: src/lib/elementary/elm_entry.c:3894
msgid "Entry"
msgstr "Girdi"
-#: src/lib/elementary/elm_gengrid.c:1513
+#: src/lib/elementary/elm_gengrid.c:1541
msgid "Gengrid Item"
msgstr "Izgara öğesi"
@@ -482,40 +482,40 @@ msgstr "Dizin"
msgid "Index Item"
msgstr "fihrist öğesi"
-#: src/lib/elementary/elm_label.c:405
+#: src/lib/elementary/elm_label.c:403
msgid "Label"
msgstr "Etiket"
-#: src/lib/elementary/elm_panel.c:83
+#: src/lib/elementary/elm_panel.c:84
msgid "state: opened"
msgstr "durum: açık"
-#: src/lib/elementary/elm_panel.c:84
+#: src/lib/elementary/elm_panel.c:85
msgid "state: closed"
msgstr "durum: kapalı"
-#: src/lib/elementary/elm_panel.c:124
+#: src/lib/elementary/elm_panel.c:127
msgid "A panel is open"
msgstr ""
-#: src/lib/elementary/elm_panel.c:126
+#: src/lib/elementary/elm_panel.c:129
msgid "Double tap to close panel menu"
msgstr ""
-#: src/lib/elementary/elm_panel.c:178
+#: src/lib/elementary/elm_panel.c:181
msgid "panel button"
msgstr "panel düğmesi"
-#: src/lib/elementary/efl_ui_progressbar.c:393
+#: src/lib/elementary/efl_ui_progressbar.c:397
msgid "progressbar"
msgstr "ilerleme çubuğu"
-#: src/lib/elementary/efl_ui_radio.c:224
+#: src/lib/elementary/efl_ui_radio.c:231
msgid "Radio"
msgstr "Radyo"
#: src/lib/elementary/elm_segment_control.c:532
-#: src/lib/elementary/elm_toolbar.c:2278
+#: src/lib/elementary/elm_toolbar.c:2283
msgid "State: Selected"
msgstr "Durum: Seçili"
@@ -527,51 +527,51 @@ msgstr "Bölge: Seçilmedi"
msgid "Segment Control Item"
msgstr "Bölüm Kontrol Öğesi"
-#: src/lib/elementary/efl_ui_slider.c:1193
+#: src/lib/elementary/efl_ui_slider.c:681
msgid "slider"
msgstr "kaydırıcı"
-#: src/lib/elementary/elm_spinner.c:1061
+#: src/lib/elementary/elm_spinner.c:1071
msgid "incremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1067
+#: src/lib/elementary/elm_spinner.c:1077
msgid "decremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1100 src/lib/elementary/elm_spinner.c:1167
+#: src/lib/elementary/elm_spinner.c:1110 src/lib/elementary/elm_spinner.c:1177
msgid "spinner"
msgstr "değiştirici"
-#: src/lib/elementary/elm_spinner.c:1109 src/lib/elementary/elm_spinner.c:1150
+#: src/lib/elementary/elm_spinner.c:1119 src/lib/elementary/elm_spinner.c:1160
msgid "spinner increment button"
msgstr "değiştirici arttırma düğmesi"
-#: src/lib/elementary/elm_spinner.c:1112 src/lib/elementary/elm_spinner.c:1159
+#: src/lib/elementary/elm_spinner.c:1122 src/lib/elementary/elm_spinner.c:1169
msgid "spinner decrement button"
msgstr "değiştirici azaltma düğmesi"
-#: src/lib/elementary/elm_spinner.c:1114
+#: src/lib/elementary/elm_spinner.c:1124
#, fuzzy
msgid "spinner text"
msgstr "değiştirici"
-#: src/lib/elementary/elm_toolbar.c:1733 src/lib/elementary/elm_toolbar.c:2335
+#: src/lib/elementary/elm_toolbar.c:1738 src/lib/elementary/elm_toolbar.c:2342
msgid "Selected"
msgstr "Seçili"
-#: src/lib/elementary/elm_toolbar.c:2274
+#: src/lib/elementary/elm_toolbar.c:2279
msgid "Separator"
msgstr "Ayraç"
-#: src/lib/elementary/elm_toolbar.c:2280
+#: src/lib/elementary/elm_toolbar.c:2285
msgid "Has menu"
msgstr "menü"
-#: src/lib/elementary/elm_toolbar.c:2330
+#: src/lib/elementary/elm_toolbar.c:2337
msgid "Unselected"
msgstr "Seçili değil"
-#: src/lib/elementary/elm_toolbar.c:2347
+#: src/lib/elementary/elm_toolbar.c:2354
msgid "Toolbar Item"
msgstr "Araç Çubuğu Öğesi"
diff --git a/po/vi.po b/po/vi.po
index 48b8191634..09d3b0ac3d 100644
--- a/po/vi.po
+++ b/po/vi.po
@@ -3,12 +3,12 @@
# This file is put in the public domain.
# Thiep Ha <thiepha@gmail.com>, 2015.
#
-#: src/lib/elementary/elm_config.c:4086
+#: src/lib/elementary/elm_config.c:4164
msgid ""
msgstr ""
"Project-Id-Version: elementary\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2017-12-20 00:20+0900\n"
+"POT-Creation-Date: 2018-07-09 16:07+0900\n"
"PO-Revision-Date: 2015-09-29 18:06+0900\n"
"Last-Translator: Thiep Ha <thiepha@gmail.com>\n"
"Language-Team: General\n"
@@ -240,172 +240,172 @@ msgstr "Hình Ảnh"
msgid "Videos"
msgstr "Video"
-#: src/lib/elementary/elc_fileselector.c:1907
+#: src/lib/elementary/elc_fileselector.c:1798
msgid "Up"
msgstr "Trên"
-#: src/lib/elementary/elc_fileselector.c:1921
+#: src/lib/elementary/elc_fileselector.c:1812
msgid "Home"
msgstr "Trang Chủ"
-#: src/lib/elementary/elc_fileselector.c:1940
+#: src/lib/elementary/elc_fileselector.c:1831
msgid "Search"
msgstr "Tìm Kiếm"
-#: src/lib/elementary/elc_fileselector.c:2232
+#: src/lib/elementary/elc_fileselector.c:2107
msgid "OK"
msgstr "Đồng Ý"
-#: src/lib/elementary/elc_fileselector.c:2242
-#: src/lib/elementary/elm_entry.c:1719 src/lib/elementary/elm_entry.c:1744
+#: src/lib/elementary/elc_fileselector.c:2117
+#: src/lib/elementary/elm_entry.c:1733 src/lib/elementary/elm_entry.c:1758
msgid "Cancel"
msgstr "Hủy"
-#: src/lib/elementary/elc_hoversel.c:436 src/lib/elementary/efl_ui_button.c:263
-#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/elm_gengrid.c:1483
-#: src/lib/elementary/elm_genlist.c:1750 src/lib/elementary/elm_list.c:2157
-#: src/lib/elementary/efl_ui_radio.c:198
+#: src/lib/elementary/elc_hoversel.c:438 src/lib/elementary/efl_ui_button.c:208
+#: src/lib/elementary/efl_ui_check.c:188 src/lib/elementary/elm_gengrid.c:1511
+#: src/lib/elementary/elm_genlist.c:1759 src/lib/elementary/elm_list.c:2172
+#: src/lib/elementary/efl_ui_radio.c:201
#: src/lib/elementary/elm_segment_control.c:529
-#: src/lib/elementary/elm_spinner.c:1031 src/lib/elementary/elm_toolbar.c:2276
+#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2281
msgid "State: Disabled"
msgstr "Trạng Thái: Không Khả Dụng"
-#: src/lib/elementary/elc_hoversel.c:638
+#: src/lib/elementary/elc_hoversel.c:651
msgid "Hoversel"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:675
+#: src/lib/elementary/elc_multibuttonentry.c:682
msgid "multi button entry label"
msgstr "Nhãn Của Bộ Nhập Nhiều Nút"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:697
+#: src/lib/elementary/elc_multibuttonentry.c:704
msgid "multi button entry item"
msgstr "Mục Của Bộ Nhập Nhiều Nút"
-#: src/lib/elementary/efl_ui_multibuttonentry.c:1579
+#: src/lib/elementary/elc_multibuttonentry.c:1586
msgid "multi button entry"
msgstr "Bộ Nhập Nhiều Nút"
-#: src/lib/elementary/elc_naviframe.c:433
-#: src/lib/elementary/elc_naviframe.c:461
+#: src/lib/elementary/elc_naviframe.c:435
+#: src/lib/elementary/elc_naviframe.c:463
msgid "Title"
msgstr "Đề Mục"
-#: src/lib/elementary/elc_naviframe.c:440
+#: src/lib/elementary/elc_naviframe.c:442
#, fuzzy
msgid "Subtitle"
msgstr "Đề Mục"
-#: src/lib/elementary/elc_naviframe.c:1027
-#: src/lib/elementary/elc_naviframe.c:1245
+#: src/lib/elementary/elc_naviframe.c:1029
+#: src/lib/elementary/elc_naviframe.c:1247
msgid "Back"
msgstr "Quay Lại"
-#: src/lib/elementary/elc_naviframe.c:1343
+#: src/lib/elementary/elc_naviframe.c:1345
msgid "Next"
msgstr "Tiếp"
-#: src/lib/elementary/elc_popup.c:305 src/lib/elementary/elc_popup.c:969
+#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992
msgid "Popup Title"
msgstr "Tiêu Đề Hộp Thoại"
-#: src/lib/elementary/elc_popup.c:315 src/lib/elementary/elc_popup.c:1045
+#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068
msgid "Popup Body Text"
msgstr "Văn Bản Thân Hộp Thoại"
-#: src/lib/elementary/elc_popup.c:1820
+#: src/lib/elementary/elc_popup.c:1841
msgid "Alert"
msgstr ""
-#: src/lib/elementary/elm_bubble.c:162
+#: src/lib/elementary/elm_bubble.c:163
msgid "Bubble"
msgstr "Bubble"
-#: src/lib/elementary/efl_ui_button.c:70
+#: src/lib/elementary/efl_ui_button.c:71
msgid "Clicked"
msgstr "Đã Nhấp"
-#: src/lib/elementary/efl_ui_button.c:290
+#: src/lib/elementary/efl_ui_button.c:250
msgid "Button"
msgstr "Nút"
-#: src/lib/elementary/elm_calendar.c:228
+#: src/lib/elementary/elm_calendar.c:244
#: src/lib/elementary/efl_ui_calendar.c:198
msgid "%B %Y"
msgstr "%B %Y"
-#: src/lib/elementary/elm_calendar.c:234
+#: src/lib/elementary/elm_calendar.c:250
msgid "%B"
msgstr "%B"
-#: src/lib/elementary/elm_calendar.c:240
+#: src/lib/elementary/elm_calendar.c:256
msgid "%Y"
msgstr "%Y"
-#: src/lib/elementary/elm_calendar.c:365
+#: src/lib/elementary/elm_calendar.c:382
#: src/lib/elementary/efl_ui_calendar.c:245
msgid "calendar item"
msgstr "Mục Của Lịch"
-#: src/lib/elementary/elm_calendar.c:392
+#: src/lib/elementary/elm_calendar.c:410
#: src/lib/elementary/efl_ui_calendar.c:272
msgid "calendar decrement month button"
msgstr "Nút Giảm Tháng"
-#: src/lib/elementary/elm_calendar.c:398
+#: src/lib/elementary/elm_calendar.c:416
msgid "calendar decrement year button"
msgstr "Nút Giảm Năm"
-#: src/lib/elementary/elm_calendar.c:404
+#: src/lib/elementary/elm_calendar.c:422
#: src/lib/elementary/efl_ui_calendar.c:278
msgid "calendar increment month button"
msgstr "Nút Tăng Tháng"
-#: src/lib/elementary/elm_calendar.c:410
+#: src/lib/elementary/elm_calendar.c:428
msgid "calendar increment year button"
msgstr "Nút Tăng Năm"
-#: src/lib/elementary/elm_calendar.c:415
+#: src/lib/elementary/elm_calendar.c:433
#: src/lib/elementary/efl_ui_calendar.c:283
msgid "calendar month"
msgstr "Lịch Tháng"
-#: src/lib/elementary/elm_calendar.c:420
+#: src/lib/elementary/elm_calendar.c:438
#: src/lib/elementary/efl_ui_calendar.c:286
msgid "calendar year"
msgstr "Lịch Năm"
-#: src/lib/elementary/efl_ui_check.c:65 src/lib/elementary/efl_ui_check.c:210
-#: src/lib/elementary/efl_ui_radio.c:120 src/lib/elementary/efl_ui_radio.c:199
+#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201
+#: src/lib/elementary/efl_ui_radio.c:136 src/lib/elementary/efl_ui_radio.c:202
msgid "State: On"
msgstr "Trạng Thái: Bật"
-#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:222
-#: src/lib/elementary/efl_ui_radio.c:201
+#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:213
+#: src/lib/elementary/efl_ui_radio.c:204
msgid "State: Off"
msgstr "Trạng Thái: Tắt"
-#: src/lib/elementary/efl_ui_check.c:206 src/lib/elementary/efl_ui_check.c:219
+#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210
msgid "State"
msgstr "Trạng Thái"
-#: src/lib/elementary/efl_ui_check.c:340
+#: src/lib/elementary/efl_ui_check.c:355
msgid "Check"
msgstr "Chọn"
-#: src/lib/elementary/elm_clock.c:304
+#: src/lib/elementary/elm_clock.c:309
msgid "clock increment button for am,pm"
msgstr "Nút Tăng Cho SA,CH Của Đồng Hồ"
-#: src/lib/elementary/elm_clock.c:312
+#: src/lib/elementary/elm_clock.c:317
msgid "clock decrement button for am,pm"
msgstr "Nút Giảm Cho SA,CH Của Đồng Hồ"
-#: src/lib/elementary/elm_clock.c:691
+#: src/lib/elementary/elm_clock.c:714
msgid "State: Editable"
msgstr "Trạng Thái: Có Thể Chỉnh Sửa"
-#: src/lib/elementary/elm_clock.c:726
+#: src/lib/elementary/elm_clock.c:749
msgid "Clock"
msgstr "Đồng Hồ"
@@ -429,7 +429,7 @@ msgstr "Xanh Da Trời:"
msgid "A:"
msgstr "Độ Mờ:"
-#: src/lib/elementary/elm_colorselector.c:1706
+#: src/lib/elementary/elm_colorselector.c:1707
msgid "color selector palette item"
msgstr "Mục Của Bảng Chọn Màu"
@@ -439,11 +439,11 @@ msgstr "Mục Của Bảng Chọn Màu"
#. but if this is a right-to-left language like arabic, Farsi,
#. Hebrew, etc. then change this string to be "default:RTL"
#.
-#: src/lib/elementary/elm_config.c:4109
+#: src/lib/elementary/elm_config.c:4187
msgid "default:LTR"
msgstr "default:LTR"
-#: src/lib/elementary/elm_dayselector.c:402
+#: src/lib/elementary/elm_dayselector.c:437
msgid "day selector item"
msgstr "Mục Của Bảng Chọn Ngày"
@@ -451,27 +451,27 @@ msgstr "Mục Của Bảng Chọn Ngày"
msgid "diskselector item"
msgstr "Mục Của Bộ Chọn Đĩa"
-#: src/lib/elementary/elm_entry.c:1709
+#: src/lib/elementary/elm_entry.c:1723
msgid "Cut"
msgstr "Cắt"
-#: src/lib/elementary/elm_entry.c:1712
+#: src/lib/elementary/elm_entry.c:1726
msgid "Copy"
msgstr "Sao Chép"
-#: src/lib/elementary/elm_entry.c:1716 src/lib/elementary/elm_entry.c:1738
+#: src/lib/elementary/elm_entry.c:1730 src/lib/elementary/elm_entry.c:1752
msgid "Paste"
msgstr "Dán"
-#: src/lib/elementary/elm_entry.c:1731
+#: src/lib/elementary/elm_entry.c:1745
msgid "Select"
msgstr "Chọn"
-#: src/lib/elementary/elm_entry.c:3831
+#: src/lib/elementary/elm_entry.c:3894
msgid "Entry"
msgstr "Bộ Nhập"
-#: src/lib/elementary/elm_gengrid.c:1513
+#: src/lib/elementary/elm_gengrid.c:1541
msgid "Gengrid Item"
msgstr "Mục Của Gengrid"
@@ -483,40 +483,40 @@ msgstr "Chỉ Mục"
msgid "Index Item"
msgstr "Mục Của Bộ Chỉ Mục"
-#: src/lib/elementary/elm_label.c:405
+#: src/lib/elementary/elm_label.c:403
msgid "Label"
msgstr "Nhãn"
-#: src/lib/elementary/elm_panel.c:83
+#: src/lib/elementary/elm_panel.c:84
msgid "state: opened"
msgstr "Trạng Thái: Mở"
-#: src/lib/elementary/elm_panel.c:84
+#: src/lib/elementary/elm_panel.c:85
msgid "state: closed"
msgstr "Trạng Thái: Đóng"
-#: src/lib/elementary/elm_panel.c:124
+#: src/lib/elementary/elm_panel.c:127
msgid "A panel is open"
msgstr "Một Bảng Đang Mở"
-#: src/lib/elementary/elm_panel.c:126
+#: src/lib/elementary/elm_panel.c:129
msgid "Double tap to close panel menu"
msgstr "Nhấn kép để đóng bảng chọn"
-#: src/lib/elementary/elm_panel.c:178
+#: src/lib/elementary/elm_panel.c:181
msgid "panel button"
msgstr "Nút Bảng"
-#: src/lib/elementary/efl_ui_progressbar.c:393
+#: src/lib/elementary/efl_ui_progressbar.c:397
msgid "progressbar"
msgstr "Thanh Trạng Thái"
-#: src/lib/elementary/efl_ui_radio.c:224
+#: src/lib/elementary/efl_ui_radio.c:231
msgid "Radio"
msgstr "Đài"
#: src/lib/elementary/elm_segment_control.c:532
-#: src/lib/elementary/elm_toolbar.c:2278
+#: src/lib/elementary/elm_toolbar.c:2283
msgid "State: Selected"
msgstr "Trạng Thái: Đã Chọn"
@@ -528,50 +528,50 @@ msgstr "Trạng Thái: Chưa Chọn"
msgid "Segment Control Item"
msgstr "Mục Điều Khiển Đoạn"
-#: src/lib/elementary/efl_ui_slider.c:1193
+#: src/lib/elementary/efl_ui_slider.c:681
msgid "slider"
msgstr "Thanh Trượt"
-#: src/lib/elementary/elm_spinner.c:1061
+#: src/lib/elementary/elm_spinner.c:1071
msgid "incremented"
msgstr "Đã Tăng"
-#: src/lib/elementary/elm_spinner.c:1067
+#: src/lib/elementary/elm_spinner.c:1077
msgid "decremented"
msgstr "Đã Giảm"
-#: src/lib/elementary/elm_spinner.c:1100 src/lib/elementary/elm_spinner.c:1167
+#: src/lib/elementary/elm_spinner.c:1110 src/lib/elementary/elm_spinner.c:1177
msgid "spinner"
msgstr "Bộ Xoay"
-#: src/lib/elementary/elm_spinner.c:1109 src/lib/elementary/elm_spinner.c:1150
+#: src/lib/elementary/elm_spinner.c:1119 src/lib/elementary/elm_spinner.c:1160
msgid "spinner increment button"
msgstr "Bút Tăng Bộ Xoay"
-#: src/lib/elementary/elm_spinner.c:1112 src/lib/elementary/elm_spinner.c:1159
+#: src/lib/elementary/elm_spinner.c:1122 src/lib/elementary/elm_spinner.c:1169
msgid "spinner decrement button"
msgstr "Nút Giảm Bộ Xoay"
-#: src/lib/elementary/elm_spinner.c:1114
+#: src/lib/elementary/elm_spinner.c:1124
msgid "spinner text"
msgstr "Văn Bản Bộ Xoay"
-#: src/lib/elementary/elm_toolbar.c:1733 src/lib/elementary/elm_toolbar.c:2335
+#: src/lib/elementary/elm_toolbar.c:1738 src/lib/elementary/elm_toolbar.c:2342
msgid "Selected"
msgstr "Đã Chọn"
-#: src/lib/elementary/elm_toolbar.c:2274
+#: src/lib/elementary/elm_toolbar.c:2279
msgid "Separator"
msgstr "Bộ Tách"
-#: src/lib/elementary/elm_toolbar.c:2280
+#: src/lib/elementary/elm_toolbar.c:2285
msgid "Has menu"
msgstr "Có Bảng Chọn"
-#: src/lib/elementary/elm_toolbar.c:2330
+#: src/lib/elementary/elm_toolbar.c:2337
msgid "Unselected"
msgstr "Không Chọn"
-#: src/lib/elementary/elm_toolbar.c:2347
+#: src/lib/elementary/elm_toolbar.c:2354
msgid "Toolbar Item"
msgstr "Mục Của Thanh Công Cụ"
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 667d3a2620..11d17f5a4a 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -4,12 +4,12 @@
# This file is distributed under the same license as the Efl package.
# Aron Xu <happyaron.xu@gmail.com>, 2012.
#
-#: src/lib/elementary/elm_config.c:4086
+#: src/lib/elementary/elm_config.c:4164
msgid ""
msgstr ""
"Project-Id-Version: elementary\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2017-12-20 00:20+0900\n"
+"POT-Creation-Date: 2018-07-09 16:07+0900\n"
"PO-Revision-Date: 2012-12-22 03:55+0800\n"
"Last-Translator: Aron Xu <happyaron.xu@gmail.com>\n"
"Language-Team: Chinese (simplified)\n"
@@ -240,176 +240,176 @@ msgstr "图片"
msgid "Videos"
msgstr "视频"
-#: src/lib/elementary/elc_fileselector.c:1907
+#: src/lib/elementary/elc_fileselector.c:1798
msgid "Up"
msgstr "向上"
-#: src/lib/elementary/elc_fileselector.c:1921
+#: src/lib/elementary/elc_fileselector.c:1812
msgid "Home"
msgstr "主目录"
-#: src/lib/elementary/elc_fileselector.c:1940
+#: src/lib/elementary/elc_fileselector.c:1831
msgid "Search"
msgstr ""
-#: src/lib/elementary/elc_fileselector.c:2232
+#: src/lib/elementary/elc_fileselector.c:2107
msgid "OK"
msgstr "确定"
-#: src/lib/elementary/elc_fileselector.c:2242
-#: src/lib/elementary/elm_entry.c:1719 src/lib/elementary/elm_entry.c:1744
+#: src/lib/elementary/elc_fileselector.c:2117
+#: src/lib/elementary/elm_entry.c:1733 src/lib/elementary/elm_entry.c:1758
msgid "Cancel"
msgstr "取消"
-#: src/lib/elementary/elc_hoversel.c:436 src/lib/elementary/efl_ui_button.c:263
-#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/elm_gengrid.c:1483
-#: src/lib/elementary/elm_genlist.c:1750 src/lib/elementary/elm_list.c:2157
-#: src/lib/elementary/efl_ui_radio.c:198
+#: src/lib/elementary/elc_hoversel.c:438 src/lib/elementary/efl_ui_button.c:208
+#: src/lib/elementary/efl_ui_check.c:188 src/lib/elementary/elm_gengrid.c:1511
+#: src/lib/elementary/elm_genlist.c:1759 src/lib/elementary/elm_list.c:2172
+#: src/lib/elementary/efl_ui_radio.c:201
#: src/lib/elementary/elm_segment_control.c:529
-#: src/lib/elementary/elm_spinner.c:1031 src/lib/elementary/elm_toolbar.c:2276
+#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2281
msgid "State: Disabled"
msgstr "状态:已禁用"
-#: src/lib/elementary/elc_hoversel.c:638
+#: src/lib/elementary/elc_hoversel.c:651
msgid "Hoversel"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:675
+#: src/lib/elementary/elc_multibuttonentry.c:682
msgid "multi button entry label"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:697
+#: src/lib/elementary/elc_multibuttonentry.c:704
msgid "multi button entry item"
msgstr ""
-#: src/lib/elementary/efl_ui_multibuttonentry.c:1579
+#: src/lib/elementary/elc_multibuttonentry.c:1586
msgid "multi button entry"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:433
-#: src/lib/elementary/elc_naviframe.c:461
+#: src/lib/elementary/elc_naviframe.c:435
+#: src/lib/elementary/elc_naviframe.c:463
msgid "Title"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:440
+#: src/lib/elementary/elc_naviframe.c:442
msgid "Subtitle"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:1027
-#: src/lib/elementary/elc_naviframe.c:1245
+#: src/lib/elementary/elc_naviframe.c:1029
+#: src/lib/elementary/elc_naviframe.c:1247
msgid "Back"
msgstr ""
-#: src/lib/elementary/elc_naviframe.c:1343
+#: src/lib/elementary/elc_naviframe.c:1345
msgid "Next"
msgstr ""
-#: src/lib/elementary/elc_popup.c:305 src/lib/elementary/elc_popup.c:969
+#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992
msgid "Popup Title"
msgstr ""
-#: src/lib/elementary/elc_popup.c:315 src/lib/elementary/elc_popup.c:1045
+#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068
msgid "Popup Body Text"
msgstr ""
-#: src/lib/elementary/elc_popup.c:1820
+#: src/lib/elementary/elc_popup.c:1841
msgid "Alert"
msgstr ""
-#: src/lib/elementary/elm_bubble.c:162
+#: src/lib/elementary/elm_bubble.c:163
msgid "Bubble"
msgstr "气泡"
-#: src/lib/elementary/efl_ui_button.c:70
+#: src/lib/elementary/efl_ui_button.c:71
msgid "Clicked"
msgstr "点击"
-#: src/lib/elementary/efl_ui_button.c:290
+#: src/lib/elementary/efl_ui_button.c:250
msgid "Button"
msgstr "按钮"
-#: src/lib/elementary/elm_calendar.c:228
+#: src/lib/elementary/elm_calendar.c:244
#: src/lib/elementary/efl_ui_calendar.c:198
msgid "%B %Y"
msgstr "%B %Y"
-#: src/lib/elementary/elm_calendar.c:234
+#: src/lib/elementary/elm_calendar.c:250
msgid "%B"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:240
+#: src/lib/elementary/elm_calendar.c:256
msgid "%Y"
msgstr ""
-#: src/lib/elementary/elm_calendar.c:365
+#: src/lib/elementary/elm_calendar.c:382
#: src/lib/elementary/efl_ui_calendar.c:245
msgid "calendar item"
msgstr "日历条目"
-#: src/lib/elementary/elm_calendar.c:392
+#: src/lib/elementary/elm_calendar.c:410
#: src/lib/elementary/efl_ui_calendar.c:272
#, fuzzy
msgid "calendar decrement month button"
msgstr "日历减量按钮"
-#: src/lib/elementary/elm_calendar.c:398
+#: src/lib/elementary/elm_calendar.c:416
#, fuzzy
msgid "calendar decrement year button"
msgstr "日历减量按钮"
-#: src/lib/elementary/elm_calendar.c:404
+#: src/lib/elementary/elm_calendar.c:422
#: src/lib/elementary/efl_ui_calendar.c:278
#, fuzzy
msgid "calendar increment month button"
msgstr "日历增量按钮"
-#: src/lib/elementary/elm_calendar.c:410
+#: src/lib/elementary/elm_calendar.c:428
#, fuzzy
msgid "calendar increment year button"
msgstr "日历增量按钮"
-#: src/lib/elementary/elm_calendar.c:415
+#: src/lib/elementary/elm_calendar.c:433
#: src/lib/elementary/efl_ui_calendar.c:283
msgid "calendar month"
msgstr "日历月"
-#: src/lib/elementary/elm_calendar.c:420
+#: src/lib/elementary/elm_calendar.c:438
#: src/lib/elementary/efl_ui_calendar.c:286
#, fuzzy
msgid "calendar year"
msgstr "日历条目"
-#: src/lib/elementary/efl_ui_check.c:65 src/lib/elementary/efl_ui_check.c:210
-#: src/lib/elementary/efl_ui_radio.c:120 src/lib/elementary/efl_ui_radio.c:199
+#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201
+#: src/lib/elementary/efl_ui_radio.c:136 src/lib/elementary/efl_ui_radio.c:202
msgid "State: On"
msgstr "状态:开启"
-#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:222
-#: src/lib/elementary/efl_ui_radio.c:201
+#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:213
+#: src/lib/elementary/efl_ui_radio.c:204
msgid "State: Off"
msgstr "状态:关闭"
-#: src/lib/elementary/efl_ui_check.c:206 src/lib/elementary/efl_ui_check.c:219
+#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210
msgid "State"
msgstr "状态"
-#: src/lib/elementary/efl_ui_check.c:340
+#: src/lib/elementary/efl_ui_check.c:355
msgid "Check"
msgstr "检查"
-#: src/lib/elementary/elm_clock.c:304
+#: src/lib/elementary/elm_clock.c:309
msgid "clock increment button for am,pm"
msgstr "上下午的时钟增量按钮"
-#: src/lib/elementary/elm_clock.c:312
+#: src/lib/elementary/elm_clock.c:317
msgid "clock decrement button for am,pm"
msgstr "上下午的时钟减量按钮"
-#: src/lib/elementary/elm_clock.c:691
+#: src/lib/elementary/elm_clock.c:714
msgid "State: Editable"
msgstr "状态:可编辑"
-#: src/lib/elementary/elm_clock.c:726
+#: src/lib/elementary/elm_clock.c:749
msgid "Clock"
msgstr "时钟"
@@ -433,7 +433,7 @@ msgstr ""
msgid "A:"
msgstr ""
-#: src/lib/elementary/elm_colorselector.c:1706
+#: src/lib/elementary/elm_colorselector.c:1707
msgid "color selector palette item"
msgstr "色彩选择器项目"
@@ -444,11 +444,11 @@ msgstr "色彩选择器项目"
#. but if this is a right-to-left language like arabic, Farsi,
#. Hebrew, etc. then change this string to be "default:RTL"
#.
-#: src/lib/elementary/elm_config.c:4109
+#: src/lib/elementary/elm_config.c:4187
msgid "default:LTR"
msgstr "default:LTR"
-#: src/lib/elementary/elm_dayselector.c:402
+#: src/lib/elementary/elm_dayselector.c:437
#, fuzzy
msgid "day selector item"
msgstr "磁盘选择器项目"
@@ -457,27 +457,27 @@ msgstr "磁盘选择器项目"
msgid "diskselector item"
msgstr "磁盘选择器项目"
-#: src/lib/elementary/elm_entry.c:1709
+#: src/lib/elementary/elm_entry.c:1723
msgid "Cut"
msgstr "粘贴"
-#: src/lib/elementary/elm_entry.c:1712
+#: src/lib/elementary/elm_entry.c:1726
msgid "Copy"
msgstr "复制"
-#: src/lib/elementary/elm_entry.c:1716 src/lib/elementary/elm_entry.c:1738
+#: src/lib/elementary/elm_entry.c:1730 src/lib/elementary/elm_entry.c:1752
msgid "Paste"
msgstr "粘贴"
-#: src/lib/elementary/elm_entry.c:1731
+#: src/lib/elementary/elm_entry.c:1745
msgid "Select"
msgstr "选择"
-#: src/lib/elementary/elm_entry.c:3831
+#: src/lib/elementary/elm_entry.c:3894
msgid "Entry"
msgstr "条目"
-#: src/lib/elementary/elm_gengrid.c:1513
+#: src/lib/elementary/elm_gengrid.c:1541
msgid "Gengrid Item"
msgstr ""
@@ -489,40 +489,40 @@ msgstr "索引"
msgid "Index Item"
msgstr "索引条目"
-#: src/lib/elementary/elm_label.c:405
+#: src/lib/elementary/elm_label.c:403
msgid "Label"
msgstr "标签"
-#: src/lib/elementary/elm_panel.c:83
+#: src/lib/elementary/elm_panel.c:84
msgid "state: opened"
msgstr "状态:已打开"
-#: src/lib/elementary/elm_panel.c:84
+#: src/lib/elementary/elm_panel.c:85
msgid "state: closed"
msgstr "状态:已关闭"
-#: src/lib/elementary/elm_panel.c:124
+#: src/lib/elementary/elm_panel.c:127
msgid "A panel is open"
msgstr ""
-#: src/lib/elementary/elm_panel.c:126
+#: src/lib/elementary/elm_panel.c:129
msgid "Double tap to close panel menu"
msgstr ""
-#: src/lib/elementary/elm_panel.c:178
+#: src/lib/elementary/elm_panel.c:181
msgid "panel button"
msgstr "面板按钮"
-#: src/lib/elementary/efl_ui_progressbar.c:393
+#: src/lib/elementary/efl_ui_progressbar.c:397
msgid "progressbar"
msgstr "进度条"
-#: src/lib/elementary/efl_ui_radio.c:224
+#: src/lib/elementary/efl_ui_radio.c:231
msgid "Radio"
msgstr "无线电"
#: src/lib/elementary/elm_segment_control.c:532
-#: src/lib/elementary/elm_toolbar.c:2278
+#: src/lib/elementary/elm_toolbar.c:2283
msgid "State: Selected"
msgstr "状态:已选择"
@@ -535,51 +535,51 @@ msgstr "状态:已选择"
msgid "Segment Control Item"
msgstr ""
-#: src/lib/elementary/efl_ui_slider.c:1193
+#: src/lib/elementary/efl_ui_slider.c:681
msgid "slider"
msgstr "滑块"
-#: src/lib/elementary/elm_spinner.c:1061
+#: src/lib/elementary/elm_spinner.c:1071
msgid "incremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1067
+#: src/lib/elementary/elm_spinner.c:1077
msgid "decremented"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1100 src/lib/elementary/elm_spinner.c:1167
+#: src/lib/elementary/elm_spinner.c:1110 src/lib/elementary/elm_spinner.c:1177
msgid "spinner"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1109 src/lib/elementary/elm_spinner.c:1150
+#: src/lib/elementary/elm_spinner.c:1119 src/lib/elementary/elm_spinner.c:1160
msgid "spinner increment button"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1112 src/lib/elementary/elm_spinner.c:1159
+#: src/lib/elementary/elm_spinner.c:1122 src/lib/elementary/elm_spinner.c:1169
msgid "spinner decrement button"
msgstr ""
-#: src/lib/elementary/elm_spinner.c:1114
+#: src/lib/elementary/elm_spinner.c:1124
msgid "spinner text"
msgstr ""
-#: src/lib/elementary/elm_toolbar.c:1733 src/lib/elementary/elm_toolbar.c:2335
+#: src/lib/elementary/elm_toolbar.c:1738 src/lib/elementary/elm_toolbar.c:2342
msgid "Selected"
msgstr "已选择"
-#: src/lib/elementary/elm_toolbar.c:2274
+#: src/lib/elementary/elm_toolbar.c:2279
msgid "Separator"
msgstr "分隔符"
-#: src/lib/elementary/elm_toolbar.c:2280
+#: src/lib/elementary/elm_toolbar.c:2285
msgid "Has menu"
msgstr "有菜单"
-#: src/lib/elementary/elm_toolbar.c:2330
+#: src/lib/elementary/elm_toolbar.c:2337
msgid "Unselected"
msgstr "未选择"
-#: src/lib/elementary/elm_toolbar.c:2347
+#: src/lib/elementary/elm_toolbar.c:2354
msgid "Toolbar Item"
msgstr "工具栏项目"
diff --git a/src/Makefile.am b/src/Makefile.am
index b87c91c561..a988467d84 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -6,6 +6,9 @@ BUILT_SOURCES =
EOLIAN_FLAGS = -I$(srcdir)
EOLIAN_GEN_FLAGS = -S
+LOG_COMPILER = dbus-run-session
+AM_LOG_FLAGS = --
+
DIST_SUBDIRS =
SUBDIRS =
@@ -129,11 +132,8 @@ examples/ethumb_client \
examples/eina_cxx \
examples/eolian_cxx \
examples/efl_mono \
-examples/elementary
-
-if HAVE_ELUA
-EXAMPLES_SUBDIRS += examples/elua
-endif
+examples/elementary \
+examples/elua
if ALWAYS_BUILD_EXAMPLES
SUBDIRS += . $(EXAMPLES_SUBDIRS)
@@ -165,6 +165,7 @@ dist-hook:
@mkdir -p $(distdir)/tests/efreet/data $(distdir)/tests/edje/data
@mkdir -p $(distdir)/tests/emotion/data $(distdir)/tests/evas/meshes/md2
@mkdir -p $(distdir)/tests/evas/meshes/obj $(distdir)/tests/efreet/data/sub
+ @mkdir -p $(distdir)/tests/efl_mono
@mkdir -p $(distdir)/scripts/eina $(distdir)/scripts/elua/modules
@mkdir -p $(distdir)/scripts/elua/core $(distdir)/scripts/elua/apps/docgen
@mkdir -p $(distdir)/lib/evas/common/evas_op_add $(distdir)/lib/evas/common/evas_op_copy
@@ -173,12 +174,17 @@ dist-hook:
@mkdir -p $(distdir)/static_libs/http-parser/contrib $(distdir)/bindings/luajit/eina
@mkdir -p $(distdir)/wayland_protocol $(distdir)/lib/efl_wl/
@mkdir -p $(distdir)/modules/evas/engines/software_generic/filters/blur
+ @mkdir -p $(distdir)/bindings/mono/ecore_evas_mono
+ @mkdir -p $(distdir)/bindings/mono/efl_mono
+ @mkdir -p $(distdir)/bindings/mono/eina_mono
+ @mkdir -p $(distdir)/bindings/mono/eldbus_mono
+ @mkdir -p $(distdir)/bindings/mono/eo_mono
for F in $(EXTRA_DIST2); do cp -f $(srcdir)/$$F $(distdir)/$$F; done
clean-local:
find . -type f -name '*.gcno' -delete
find . -type f -name '*.gcda' -delete
- find . -type f -name check-results.xml -delete
+ find . -type f -name check-results*.xml -delete
rm -f $(GENERATED_JS_BINDINGS)
rm -f $(GENERATED_LUA_BINDINGS)
rm -f $(BUILT_SOURCES)
diff --git a/src/Makefile_Cxx.am b/src/Makefile_Cxx.am
index 8f929d2f8e..b13880c674 100644
--- a/src/Makefile_Cxx.am
+++ b/src/Makefile_Cxx.am
@@ -16,14 +16,14 @@ bindings/cxx/eo_cxx/Eo.hh \
bindings/cxx/eo_cxx/eo_init.hh \
bindings/cxx/eo_cxx/eo_ops.hh \
bindings/cxx/eo_cxx/eo_wref.hh \
-bindings/cxx/eo_cxx/eo_future.hh \
-bindings/cxx/eo_cxx/eo_promise.hh \
-bindings/cxx/eo_cxx/eo_promise_meta.hh \
bindings/cxx/eo_cxx/eo_private.hh \
bindings/cxx/eo_cxx/efl_object_impl.hh
installed_eflcxxmainheadersdir = $(includedir)/efl-cxx-@VMAJ@/
-dist_installed_eflcxxmainheaders_DATA = lib/efl/Efl.hh lib/efl/cxx/efl_part_impl.hh
+dist_installed_eflcxxmainheaders_DATA = lib/efl/Efl.hh
+
+installed_eflcxxextraheadersdir = $(includedir)/efl-cxx-@VMAJ@/cxx
+dist_installed_eflcxxextraheaders_DATA = lib/efl/cxx/efl_part_impl.hh
installed_elementarycxxmainheadersdir = $(includedir)/elementary-cxx-@VMAJ@/
dist_installed_elementarycxxmainheaders_DATA = lib/elementary/Elementary.hh
@@ -244,8 +244,7 @@ tests_eina_cxx_eina_cxx_suite_DEPENDENCIES = @USE_EINA_INTERNAL_LIBS@ @USE_EO_IN
tests_eo_cxx_eo_cxx_suite_SOURCES = \
tests/eo_cxx/eo_cxx_suite.cc \
-tests/eo_cxx/eo_cxx_suite.h \
-tests/eo_cxx/eo_cxx_test_promise.cc
+tests/eo_cxx/eo_cxx_suite.h
tests_eo_cxx_eo_cxx_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-DTESTS_WD=\"`pwd`\" \
diff --git a/src/Makefile_Ecore.am b/src/Makefile_Ecore.am
index b9553079fc..a33c8f8d9b 100644
--- a/src/Makefile_Ecore.am
+++ b/src/Makefile_Ecore.am
@@ -8,12 +8,20 @@ ecore_eolian_files_legacy = \
lib/ecore/efl_loop_timer.eo
ecore_eolian_files_public = \
+ lib/ecore/efl_app.eo \
lib/ecore/efl_loop.eo \
lib/ecore/efl_loop_consumer.eo \
lib/ecore/efl_loop_fd.eo \
lib/ecore/efl_loop_handler.eo \
lib/ecore/efl_loop_message.eo \
lib/ecore/efl_loop_message_handler.eo \
+ lib/ecore/efl_loop_message_future.eo \
+ lib/ecore/efl_loop_message_future_handler.eo \
+ lib/ecore/efl_exe.eo \
+ lib/ecore/efl_thread.eo \
+ lib/ecore/efl_threadio.eo \
+ lib/ecore/efl_appthread.eo \
+ lib/ecore/efl_task.eo \
lib/ecore/efl_io_closer_fd.eo \
lib/ecore/efl_io_positioner_fd.eo \
lib/ecore/efl_io_reader_fd.eo \
@@ -33,14 +41,7 @@ ecore_eolian_files_public = \
lib/ecore/efl_interpolator_divisor.eo \
lib/ecore/efl_interpolator_bounce.eo \
lib/ecore/efl_interpolator_spring.eo \
- lib/ecore/efl_interpolator_cubic_bezier.eo
-
-
-ecore_eolian_files = \
- $(ecore_eolian_files_public) \
- lib/ecore/efl_loop_message_future_handler.eo \
- lib/ecore/efl_loop_message_future.eo \
- lib/ecore/efl_promise.eo \
+ lib/ecore/efl_interpolator_cubic_bezier.eo \
lib/ecore/efl_model_item.eo \
lib/ecore/efl_model_container.eo \
lib/ecore/efl_model_container_item.eo \
@@ -48,7 +49,11 @@ ecore_eolian_files = \
lib/ecore/efl_model_composite_boolean_children.eo \
lib/ecore/efl_model_composite_selection.eo \
lib/ecore/efl_model_composite_selection_children.eo \
- $(ecore_eolian_files_legacy)
+ lib/ecore/efl_model_composite.eo
+
+ecore_eolian_files = \
+ $(ecore_eolian_files_legacy) \
+ $(ecore_eolian_files_public)
ecore_eolian_c = $(ecore_eolian_files:%.eo=%.eo.c)
ecore_eolian_h = $(ecore_eolian_files:%.eo=%.eo.h) \
@@ -59,9 +64,9 @@ BUILT_SOURCES += \
$(ecore_eolian_h)
ecoreeolianfilesdir = $(datadir)/eolian/include/ecore-@VMAJ@
-ecoreeolianfiles_DATA = $(ecore_eolian_files)
+ecoreeolianfiles_DATA = $(ecore_eolian_files_public) lib/ecore/efl_loop_timer.eo
-EXTRA_DIST2 += ${ecoreeolianfiles_DATA}
+EXTRA_DIST2 += $(ecore_eolian_files)
lib_LTLIBRARIES += lib/ecore/libecore.la
@@ -93,6 +98,7 @@ lib/ecore/ecore_job.c \
lib/ecore/ecore_main.c \
lib/ecore/ecore_event_message.c \
lib/ecore/ecore_event_message_handler.c \
+lib/ecore/efl_app.c \
lib/ecore/efl_loop.c \
lib/ecore/efl_loop_consumer.c \
lib/ecore/efl_loop_fd.c \
@@ -112,11 +118,11 @@ lib/ecore/efl_io_stderr.c \
lib/ecore/efl_io_file.c \
lib/ecore/efl_io_copier.c \
lib/ecore/efl_io_buffered_stream.c \
-lib/ecore/efl_promise.c \
lib/ecore/efl_model_item.c \
lib/ecore/efl_model_container.c \
lib/ecore/efl_model_container_item.c \
lib/ecore/efl_model_container_private.h \
+lib/ecore/efl_model_composite.c \
lib/ecore/efl_model_composite_boolean.c \
lib/ecore/efl_model_composite_selection.c \
lib/ecore/efl_model_accessor_view.c \
@@ -130,6 +136,11 @@ lib/ecore/efl_interpolator_divisor.c \
lib/ecore/efl_interpolator_bounce.c \
lib/ecore/efl_interpolator_spring.c \
lib/ecore/efl_interpolator_cubic_bezier.c \
+lib/ecore/efl_task.c \
+lib/ecore/efl_exe.c \
+lib/ecore/efl_thread.c \
+lib/ecore/efl_threadio.c \
+lib/ecore/efl_appthread.c \
lib/ecore/ecore_main_timechanges.c \
lib/ecore/ecore_pipe.c \
lib/ecore/ecore_poller.c \
@@ -141,7 +152,9 @@ lib/ecore/ecore_exe.c \
lib/ecore/ecore_exe_private.h \
lib/ecore/ecore_private.h \
lib/ecore/ecore_internal.h \
-lib/ecore/ecore_main_common.h
+lib/ecore/ecore_main_common.h \
+static_libs/buildsystem/buildsystem.h \
+static_libs/buildsystem/buildsystem_autotools.c
if HAVE_WIN32
@@ -164,6 +177,7 @@ lib_ecore_libecore_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/ecore\" \
-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \
+-DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \
@ECORE_CFLAGS@
lib_ecore_libecore_la_LIBADD = @ECORE_LIBS@ @EVIL_LIBS@
lib_ecore_libecore_la_DEPENDENCIES = @ECORE_INTERNAL_LIBS@
@@ -255,21 +269,21 @@ endif
if EFL_ENABLE_TESTS
-check_PROGRAMS += tests/ecore/ecore_suite
-TESTS += tests/ecore/ecore_suite
+check_PROGRAMS += tests/ecore/ecore_suite tests/ecore/efl_app_suite
+TESTS += tests/ecore/ecore_suite tests/ecore/efl_app_suite
tests_ecore_ecore_suite_SOURCES = \
tests/ecore/ecore_suite.c \
tests/ecore/ecore_test_ecore.c \
tests/ecore/ecore_test_ecore_imf.c \
+tests/ecore/ecore_test_idle.c \
+tests/ecore/ecore_test_poller.c \
tests/ecore/ecore_test_timer.c \
tests/ecore/ecore_test_ecore_evas.c \
tests/ecore/ecore_test_animator.c \
tests/ecore/ecore_test_ecore_thread_eina_thread_queue.c \
tests/ecore/ecore_test_ecore_input.c \
tests/ecore/ecore_test_ecore_file.c \
-tests/ecore/ecore_test_promise.c \
-tests/ecore/ecore_test_promise2.c \
tests/ecore/ecore_test_job.c \
tests/ecore/ecore_test_args.c \
tests/ecore/ecore_suite.h
@@ -286,7 +300,6 @@ tests_ecore_ecore_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
@ECORE_EVAS_CFLAGS@ \
@ECORE_WAYLAND_CFLAGS@ \
@ECORE_WAYLAND_SRV_CFLAGS@ \
-@ECORE_DRM_CFLAGS@ \
@ECORE_FB_CFLAGS@ \
@ECORE_INPUT_CFLAGS@
@@ -301,7 +314,6 @@ tests_ecore_ecore_suite_LDADD = \
@USE_ECORE_WAYLAND_LIBS@ \
@USE_ECORE_FB_LIBS@ \
@ECORE_WAYLAND_SRV_LIBS@ \
-@ECORE_DRM_LIBS@ \
@USE_ECORE_INPUT_LIBS@
tests_ecore_ecore_suite_DEPENDENCIES = \
@USE_ECORE_INTERNAL_LIBS@ \
@@ -311,7 +323,52 @@ tests_ecore_ecore_suite_DEPENDENCIES = \
@USE_ECORE_IMF_INTERNAL_LIBS@ \
@USE_ECORE_EVAS_INTERNAL_LIBS@ \
@USE_ECORE_WAYLAND_INTERNAL_LIBS@ \
-@USE_ECORE_DRM_INTERNAL_LIBS@ \
+@USE_ECORE_FB_INTERNAL_LIBS@ \
+@USE_ECORE_INPUT_INTERNAL_LIBS@
+
+tests_ecore_efl_app_suite_SOURCES = \
+tests/ecore/efl_app_test_loop.c \
+tests/ecore/efl_app_test_loop_fd.c \
+tests/ecore/efl_app_test_loop_timer.c \
+tests/ecore/efl_app_test_promise.c \
+tests/ecore/efl_app_suite.c \
+tests/ecore/efl_app_suite.h
+
+tests_ecore_efl_app_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
+-DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/ecore\" \
+-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/ecore\" \
+@CHECK_CFLAGS@ \
+@ECORE_CFLAGS@ \
+@ECORE_AUDIO_CFLAGS@ \
+@ECORE_FILE_CFLAGS@ \
+@ECORE_X_CFLAGS@ \
+@ECORE_IMF_CFLAGS@ \
+@ECORE_EVAS_CFLAGS@ \
+@ECORE_WAYLAND_CFLAGS@ \
+@ECORE_WAYLAND_SRV_CFLAGS@ \
+@ECORE_FB_CFLAGS@ \
+@ECORE_INPUT_CFLAGS@
+
+tests_ecore_efl_app_suite_LDADD = \
+@CHECK_LIBS@ \
+@USE_ECORE_LIBS@ \
+@USE_ECORE_AUDIO_LIBS@ \
+@USE_ECORE_FILE_LIBS@ \
+@USE_ECORE_X_LIBS@ \
+@USE_ECORE_IMF_LIBS@ \
+@USE_ECORE_EVAS_LIBS@ \
+@USE_ECORE_WAYLAND_LIBS@ \
+@USE_ECORE_FB_LIBS@ \
+@ECORE_WAYLAND_SRV_LIBS@ \
+@USE_ECORE_INPUT_LIBS@
+tests_ecore_efl_app_suite_DEPENDENCIES = \
+@USE_ECORE_INTERNAL_LIBS@ \
+@USE_ECORE_AUDIO_INTERNAL_LIBS@ \
+@USE_ECORE_FILE_INTERNAL_LIBS@ \
+@USE_ECORE_X_INTERNAL_LIBS@ \
+@USE_ECORE_IMF_INTERNAL_LIBS@ \
+@USE_ECORE_EVAS_INTERNAL_LIBS@ \
+@USE_ECORE_WAYLAND_INTERNAL_LIBS@ \
@USE_ECORE_FB_INTERNAL_LIBS@ \
@USE_ECORE_INPUT_INTERNAL_LIBS@
@@ -323,10 +380,6 @@ if HAVE_ECORE_AUDIO
tests_ecore_ecore_suite_SOURCES += tests/ecore/ecore_test_ecore_audio.c
endif
-if HAVE_ECORE_DRM
-tests_ecore_ecore_suite_SOURCES += tests/ecore/ecore_test_ecore_drm.c
-endif
-
if HAVE_ECORE_FB
tests_ecore_ecore_suite_SOURCES += tests/ecore/ecore_test_ecore_fb.c
endif
diff --git a/src/Makefile_Ecore_Con.am b/src/Makefile_Ecore_Con.am
index f8d35d2636..2568922992 100644
--- a/src/Makefile_Ecore_Con.am
+++ b/src/Makefile_Ecore_Con.am
@@ -26,7 +26,7 @@ ecore_con_eolian_files = \
lib/ecore_con/efl_net_server_ssl.eo \
lib/ecore_con/efl_net_control_access_point.eo \
lib/ecore_con/efl_net_control_technology.eo \
- lib/ecore_con/efl_net_control.eo \
+ lib/ecore_con/efl_net_control_manager.eo \
lib/ecore_con/efl_net_session.eo \
lib/ecore_con/efl_net_ip_address.eo \
lib/ecore_con/ecore_con_eet_base.eo \
@@ -118,7 +118,9 @@ lib/ecore_con/efl_net_ssl_context.c \
lib/ecore_con/efl_net_dialer_ssl.c \
lib/ecore_con/efl_net_server_ssl.c \
lib/ecore_con/ecore_con_local.c \
-lib/ecore_con/efl_net_ip_address.c
+lib/ecore_con/efl_net_ip_address.c \
+static_libs/buildsystem/buildsystem.h \
+static_libs/buildsystem/buildsystem_autotools.c
if EFL_NET_CONTROL_BACKEND_CONNMAN
lib_ecore_con_libecore_con_la_SOURCES += \
@@ -167,6 +169,7 @@ lib_ecore_con_libecore_con_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/ecore\" \
-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \
+-DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \
@ECORE_CON_CFLAGS@
lib_ecore_con_libecore_con_la_LIBADD = @ECORE_CON_LIBS@ @EVIL_LIBS@
lib_ecore_con_libecore_con_la_DEPENDENCIES = @ECORE_CON_INTERNAL_LIBS@
diff --git a/src/Makefile_Ecore_Evas.am b/src/Makefile_Ecore_Evas.am
index debc9963fc..29bcea3f06 100644
--- a/src/Makefile_Ecore_Evas.am
+++ b/src/Makefile_Ecore_Evas.am
@@ -23,7 +23,9 @@ lib/ecore_evas/ecore_evas_wayland.h \
lib/ecore_evas/ecore_evas_cocoa.h \
lib/ecore_evas/ecore_evas_win32.h \
lib/ecore_evas/ecore_evas_x11.h \
-lib/ecore_evas/ecore_evas_util.c
+lib/ecore_evas/ecore_evas_util.c \
+static_libs/buildsystem/buildsystem.h \
+static_libs/buildsystem/buildsystem_autotools.c
lib_ecore_evas_libecore_evas_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-I$(top_srcdir)/src/modules/evas/engines/buffer \
@@ -31,6 +33,7 @@ lib_ecore_evas_libecore_evas_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/ecore_evas\" \
-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \
+-DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \
@ECORE_EVAS_CFLAGS@
lib_ecore_evas_libecore_evas_la_LIBADD = @ECORE_EVAS_LIBS@
lib_ecore_evas_libecore_evas_la_DEPENDENCIES = @ECORE_EVAS_INTERNAL_LIBS@
@@ -268,7 +271,8 @@ endif
if BUILD_ECORE_EVAS_VNC_SERVER
VNCSERVERSOURCES = \
-modules/ecore_evas/vnc_server/ecore_evas_vnc_server.c
+modules/ecore_evas/vnc_server/ecore_evas_vnc_server.c \
+modules/ecore_evas/vnc_server/ecore_evas_vnc_server_fb_keymap.c
ecoreevasenginevncserverpkgdir = $(libdir)/ecore_evas/vnc_server/$(MODULE_ARCH)
ecoreevasenginevncserverpkg_LTLIBRARIES = modules/ecore_evas/vnc_server/module.la
@@ -279,26 +283,16 @@ $(install_ecoreevasenginevncserverpkgLTLIBRARIES): install-libLTLIBRARIES
modules_ecore_evas_vnc_server_module_la_SOURCES = $(VNCSERVERSOURCES)
modules_ecore_evas_vnc_server_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-@ECORE_EVAS_CFLAGS@ \
-@LIBVNCSERVER_CFLAGS@
+-I$(top_builddir)/src/lib/ecore_fb \
+@LIBVNCSERVER_CFLAGS@ \
+@ECORE_EVAS_CFLAGS@
modules_ecore_evas_vnc_server_module_la_LIBADD = \
-@USE_ECORE_EVAS_LIBS@ \
-@LIBVNCSERVER_LIBS@
+@LIBVNCSERVER_LIBS@ \
+@USE_ECORE_EVAS_LIBS@
modules_ecore_evas_vnc_server_module_la_DEPENDENCIES = \
@USE_ECORE_EVAS_INTERNAL_LIBS@
modules_ecore_evas_vnc_server_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@
modules_ecore_evas_vnc_server_module_la_LIBTOOLFLAGS = --tag=disable-static
-if BUILD_ECORE_EVAS_FB
-modules_ecore_evas_vnc_server_module_la_CPPFLAGS += @ECORE_FB_CFLAGS@ -I$(top_srcdir)/src/modules/evas/engines/fb
-modules_ecore_evas_vnc_server_module_la_LIBADD += @USE_ECORE_FB_LIBS@
-VNCSERVERSOURCES += \
-modules/ecore_evas/vnc_server/ecore_evas_vnc_server_fb_keymap.c \
-modules/ecore_evas/vnc_server/ecore_evas_vnc_server_fb_keymap.h
-endif
-if BUILD_ECORE_EVAS_X11
-modules_ecore_evas_vnc_server_module_la_LIBADD += @USE_ECORE_X_LIBS@
-modules_ecore_evas_vnc_server_module_la_CPPFLAGS += @ECORE_X_CFLAGS@ -I$(top_srcdir)/src/modules/evas/engines/software_x11
-endif
endif
### Binary
diff --git a/src/Makefile_Ecore_IMF.am b/src/Makefile_Ecore_IMF.am
index 001927fe62..c43f2a82c1 100644
--- a/src/Makefile_Ecore_IMF.am
+++ b/src/Makefile_Ecore_IMF.am
@@ -12,13 +12,16 @@ lib_ecore_imf_libecore_imf_la_SOURCES = \
lib/ecore_imf/ecore_imf.c \
lib/ecore_imf/ecore_imf_context.c \
lib/ecore_imf/ecore_imf_module.c \
-lib/ecore_imf/ecore_imf_private.h
+lib/ecore_imf/ecore_imf_private.h \
+static_libs/buildsystem/buildsystem.h \
+static_libs/buildsystem/buildsystem_autotools.c
lib_ecore_imf_libecore_imf_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/ecore_imf\" \
-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \
+-DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \
@ECORE_IMF_CFLAGS@
lib_ecore_imf_libecore_imf_la_LIBADD = @ECORE_IMF_LIBS@
lib_ecore_imf_libecore_imf_la_DEPENDENCIES = @ECORE_IMF_INTERNAL_LIBS@
@@ -135,6 +138,14 @@ modules/ecore_imf/wayland/wayland_module.c \
modules/ecore_imf/wayland/wayland_imcontext.c \
modules/ecore_imf/wayland/wayland_imcontext.h
+nodist_modules_ecore_imf_wayland_module_la_SOURCES = \
+modules/ecore_imf/wayland/text-input-unstable-v1-client-protocol.h \
+modules/ecore_imf/wayland/text-input-unstable-v1-protocol.c
+
+BUILT_SOURCES += \
+modules/ecore_imf/wayland/text-input-unstable-v1-client-protocol.h \
+modules/ecore_imf/wayland/text-input-unstable-v1-protocol.c
+
modules_ecore_imf_wayland_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-I$(top_builddir)/src/modules/ecore_imf/wayland \
@ECORE_IMF_CFLAGS@ \
diff --git a/src/Makefile_Ecore_Wl2.am b/src/Makefile_Ecore_Wl2.am
index a794d0b3ba..3415d0762e 100644
--- a/src/Makefile_Ecore_Wl2.am
+++ b/src/Makefile_Ecore_Wl2.am
@@ -40,14 +40,18 @@ lib/ecore_wl2/www-client-protocol.h \
lib/ecore_wl2/www-protocol.c \
lib/ecore_wl2/linux-dmabuf-unstable-v1-protocol.c \
lib/ecore_wl2/linux-dmabuf-unstable-v1-client-protocol.h \
+lib/ecore_wl2/xdg-shell-client-protocol.h \
+lib/ecore_wl2/xdg-shell-protocol.c \
lib/ecore_wl2/xdg-shell-unstable-v6-client-protocol.h \
lib/ecore_wl2/xdg-shell-unstable-v6-protocol.c \
-lib/ecore_wl2/text-input-unstable-v1-client-protocol.h \
-lib/ecore_wl2/text-input-unstable-v1-protocol.c \
lib/ecore_wl2/efl-hints-client-protocol.h \
lib/ecore_wl2/efl-hints-protocol.c
-lib_ecore_wl2_libecore_wl2_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_WL2_CFLAGS@ -I$(top_srcdir)/src/static_libs/libdrm
+lib_ecore_wl2_libecore_wl2_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
+@ECORE_WL2_CFLAGS@ \
+-I$(top_srcdir)/src/static_libs/libdrm \
+-DPACKAGE_LIB_DIR=\"$(libdir)\" \
+-DMODULE_ARCH=\"$(MODULE_ARCH)\"
lib_ecore_wl2_libecore_wl2_la_LIBADD = @ECORE_WL2_LIBS@
lib_ecore_wl2_libecore_wl2_la_DEPENDENCIES = @ECORE_WL2_INTERNAL_LIBS@
lib_ecore_wl2_libecore_wl2_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@
@@ -59,15 +63,33 @@ lib/ecore_wl2/efl-aux-hints-client-protocol.h \
lib/ecore_wl2/www-protocol.c \
lib/ecore_wl2/teamwork-protocol.c \
lib/ecore_wl2/teamwork-client-protocol.h \
+ lib/ecore_wl2/xdg-shell-client-protocol.h \
+ lib/ecore_wl2/xdg-shell-protocol.c \
lib/ecore_wl2/xdg-shell-unstable-v6-client-protocol.h \
lib/ecore_wl2/xdg-shell-unstable-v6-protocol.c \
lib/ecore_wl2/linux-dmabuf-unstable-v1-protocol.c \
lib/ecore_wl2/linux-dmabuf-unstable-v1-client-protocol.h \
lib/ecore_wl2/session-recovery-protocol.c \
lib/ecore_wl2/session-recovery-client-protocol.h \
- lib/ecore_wl2/text-input-unstable-v1-client-protocol.h \
- lib/ecore_wl2/text-input-unstable-v1-protocol.c \
lib/ecore_wl2/efl-hints-client-protocol.h \
lib/ecore_wl2/efl-hints-protocol.c
+DMABUFSOURCES = lib/ecore_wl2/ecore_wl2_surface_module_dmabuf.c
+ecorewl2enginedmabufpkgdir = $(libdir)/ecore_wl2/engines/dmabuf/$(MODULE_ARCH)
+ecorewl2enginedmabufpkg_LTLIBRARIES = modules/ecore_wl2/engines/dmabuf/module.la
+
+# Workaround for broken parallel install support in automake (relink issue)
+# http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7328
+install_ecorewl2enginedmabufpkgLTLIBRARIES = install-ecorewl2enginedmabufpkgLTLIBRARIES
+$(install_ecorewl2enginedmabufpkgLTLIBRARIES): install-libLTLIBRARIES
+
+modules_ecore_wl2_engines_dmabuf_module_la_SOURCES = $(DMABUFSOURCES)
+modules_ecore_wl2_engines_dmabuf_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_WL2_CFLAGS@
+modules_ecore_wl2_engines_dmabuf_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@
+modules_ecore_wl2_engines_dmabuf_module_la_LIBTOOLFLAGS = --tag=disable-static
+
endif
+
+#We want this in the release tarball even if the builder isn't compiling
+#wayland support.
+EXTRA_DIST2 += lib/ecore_wl2/window_v6.x
diff --git a/src/Makefile_Ector.am b/src/Makefile_Ector.am
index 7baa0767d1..fae39311f4 100644
--- a/src/Makefile_Ector.am
+++ b/src/Makefile_Ector.am
@@ -190,8 +190,8 @@ tests_ector_suite_ector_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-I$(top_srcdir)/src/tests/ector \
-DTESTS_WD=\"`pwd`\" \
-DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/ector/suite\" \
--DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)/src/tests/ector/suite\" \
--DTESTS_BUILD_DIR=PACKAGE_BUILD_DIR \
+-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)/\" \
+-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/ector\" \
@CHECK_CFLAGS@ \
@ECTOR_CFLAGS@
tests_ector_suite_ector_suite_LDADD = @CHECK_LIBS@ @USE_ECTOR_LIBS@
diff --git a/src/Makefile_Edje.am b/src/Makefile_Edje.am
index c57f11130e..fc83eaadc6 100644
--- a/src/Makefile_Edje.am
+++ b/src/Makefile_Edje.am
@@ -19,6 +19,7 @@ edje_eolian_type_files = \
edje_eolian_priv_files = \
lib/edje/edje_global.eo \
+ lib/edje/efl_canvas_layout_part_invalid.eo \
$(NULL)
edje_eolian_c = $(edje_eolian_files:%.eo=%.eo.c)
@@ -108,7 +109,11 @@ lib/edje/edje_part_external.c \
lib/edje/edje_part_swallow.c \
lib/edje/edje_part_table.c \
lib/edje/edje_part_box.c \
-lib/edje/edje_part_text.c
+lib/edje/edje_part_text.c \
+lib/edje/edje_part_invalid.c \
+static_libs/buildsystem/buildsystem.h \
+static_libs/buildsystem/buildsystem_autotools.c
+
lib_edje_libedje_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl $(EDJE_COMMON_CPPFLAGS)
lib_edje_libedje_la_LIBADD = @EDJE_LIBS@ @EDJE_LUA_LIBS@
@@ -278,7 +283,6 @@ bin/edje/edje_convert.c \
bin/edje/edje_data_convert.c \
bin/edje/edje_convert_main.c \
lib/edje/edje_convert.c \
-tests/edje/edje_tests_helpers.h \
tests/edje/data/complex_layout.edc \
tests/edje/data/test_layout.edc \
tests/edje/data/test_parens.edc \
@@ -294,6 +298,8 @@ tests/edje/data/test_combine_keywords.edc \
tests/edje/data/test_messages.edc \
tests/edje/data/test_signals.edc \
tests/edje/data/test_signal_callback_del_full.edc \
+tests/edje/data/test_text_cursor.edc \
+tests/edje/data/test_textblock.edc \
tests/edje/data/filter.lua
@@ -311,7 +317,12 @@ TESTS += tests/edje/edje_suite
tests_edje_edje_suite_SOURCES = \
tests/edje/edje_suite.c \
+tests/edje/edje_test_container.c \
tests/edje/edje_test_edje.c \
+tests/edje/edje_test_features.c \
+tests/edje/edje_test_signal.c \
+tests/edje/edje_test_swallow.c \
+tests/edje/edje_test_text.c \
tests/edje/edje_suite.h
tests/edje/data/%.edj: tests/edje/data/%.edc bin/edje/edje_cc${EXEEXT}
@@ -337,6 +348,8 @@ EDJE_TEST_FILES = tests/edje/data/test_layout.edj \
tests/edje/data/test_messages.edj \
tests/edje/data/test_signals.edj \
tests/edje/data/test_signal_callback_del_full.edj \
+ tests/edje/data/test_text_cursor.edj \
+ tests/edje/data/test_textblock.edj \
$(NULL)
CLEANFILES += $(EDJE_TEST_FILES)
diff --git a/src/Makefile_Eeze.am b/src/Makefile_Eeze.am
index 9f86fa1631..82b96a1470 100644
--- a/src/Makefile_Eeze.am
+++ b/src/Makefile_Eeze.am
@@ -29,7 +29,9 @@ lib/eeze/eeze_udev_watch.c \
lib/eeze/eeze_disk.c \
lib/eeze/eeze_disk_udev.c \
lib/eeze/eeze_disk_mount.c \
-lib/eeze/eeze_disk_private.h
+lib/eeze/eeze_disk_private.h \
+static_libs/buildsystem/buildsystem.h \
+static_libs/buildsystem/buildsystem_autotools.c
if HAVE_EEZE_MOUNT
if EEZE_LIBMOUNT_BEFORE_219
@@ -50,6 +52,7 @@ lib_eeze_libeeze_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/eeze\" \
-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \
+-DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \
@EEZE_CFLAGS@
lib_eeze_libeeze_la_LIBADD = @EEZE_LIBS@
lib_eeze_libeeze_la_DEPENDENCIES = @EEZE_INTERNAL_LIBS@
diff --git a/src/Makefile_Efl.am b/src/Makefile_Efl.am
index 30b6cdb040..972eda7e04 100644
--- a/src/Makefile_Efl.am
+++ b/src/Makefile_Efl.am
@@ -1,10 +1,10 @@
# Even though libefl is new, it contains definitions used by legacy APIs
efl_eolian_legacy_files = \
lib/efl/interfaces/efl_gfx_fill.eo \
- lib/efl/interfaces/efl_gfx.eo \
+ lib/efl/interfaces/efl_gfx_entity.eo \
lib/efl/interfaces/efl_gfx_color.eo \
- lib/efl/interfaces/efl_image.eo \
- lib/efl/interfaces/efl_image_animated.eo \
+ lib/efl/interfaces/efl_gfx_image.eo \
+ lib/efl/interfaces/efl_gfx_image_animation_controller.eo \
lib/efl/interfaces/efl_input_device.eo \
lib/efl/interfaces/efl_ui_draggable.eo \
lib/efl/interfaces/efl_ui_clickable.eo \
@@ -12,18 +12,20 @@ efl_eolian_legacy_files = \
lib/efl/interfaces/efl_ui_scrollable_interactive.eo \
lib/efl/interfaces/efl_ui_scrollbar.eo \
lib/efl/interfaces/efl_ui_selectable.eo \
+ lib/efl/interfaces/efl_ui_multi_selectable.eo \
lib/efl/interfaces/efl_ui_zoom.eo \
$(NULL)
efl_eolian_files = \
- lib/efl/interfaces/efl_canvas.eo \
+ lib/efl/interfaces/efl_canvas_scene.eo \
lib/efl/interfaces/efl_canvas_pointer.eo \
lib/efl/interfaces/efl_config.eo \
lib/efl/interfaces/efl_control.eo \
lib/efl/interfaces/efl_duplicate.eo \
lib/efl/interfaces/efl_file.eo \
- lib/efl/interfaces/efl_image_load.eo \
+ lib/efl/interfaces/efl_gfx_image_load_controller.eo \
lib/efl/interfaces/efl_part.eo \
+ lib/efl/interfaces/efl_playable.eo \
lib/efl/interfaces/efl_player.eo \
lib/efl/interfaces/efl_text.eo \
lib/efl/interfaces/efl_text_font.eo \
@@ -33,7 +35,6 @@ efl_eolian_files = \
lib/efl/interfaces/efl_text_annotate.eo \
lib/efl/interfaces/efl_text_markup.eo \
lib/efl/interfaces/efl_text_markup_util.eo \
- lib/efl/interfaces/efl_text_properties.eo \
lib/efl/interfaces/efl_gfx_stack.eo \
lib/efl/interfaces/efl_gfx_view.eo \
lib/efl/interfaces/efl_gfx_buffer.eo \
@@ -48,18 +49,12 @@ efl_eolian_files = \
lib/efl/interfaces/efl_model.eo \
lib/efl/interfaces/efl_animator.eo \
lib/efl/interfaces/efl_orientation.eo \
- lib/efl/interfaces/efl_flipable.eo \
lib/efl/interfaces/efl_container.eo \
lib/efl/interfaces/efl_content.eo \
lib/efl/interfaces/efl_pack.eo \
lib/efl/interfaces/efl_pack_layout.eo \
lib/efl/interfaces/efl_pack_linear.eo \
lib/efl/interfaces/efl_pack_table.eo \
- lib/efl/interfaces/efl_vpath.eo \
- lib/efl/interfaces/efl_vpath_manager.eo \
- lib/efl/interfaces/efl_vpath_file.eo \
- lib/efl/interfaces/efl_vpath_core.eo \
- lib/efl/interfaces/efl_vpath_file_core.eo \
lib/efl/interfaces/efl_ui_base.eo \
lib/efl/interfaces/efl_ui_direction.eo \
lib/efl/interfaces/efl_ui_drag.eo \
@@ -67,7 +62,6 @@ efl_eolian_files = \
lib/efl/interfaces/efl_ui_view.eo \
lib/efl/interfaces/efl_ui_model_connect.eo \
lib/efl/interfaces/efl_ui_factory.eo \
- lib/efl/interfaces/efl_ui_model_factory_connect.eo \
lib/efl/interfaces/efl_screen.eo \
lib/efl/interfaces/efl_io_closer.eo \
lib/efl/interfaces/efl_io_positioner.eo \
@@ -78,8 +72,6 @@ efl_eolian_files = \
lib/efl/interfaces/efl_io_queue.eo \
lib/efl/interfaces/efl_observer.eo \
lib/efl/interfaces/efl_observable.eo \
- lib/efl/interfaces/efl_ui_item.eo \
- lib/efl/interfaces/efl_ui_menu.eo \
lib/efl/interfaces/efl_ui_autorepeat.eo \
lib/efl/interfaces/efl_ui_format.eo \
lib/efl/interfaces/efl_gfx_color_class.eo \
@@ -124,10 +116,6 @@ lib/efl/interfaces/efl_interfaces_main.c \
lib/efl/interfaces/efl_model_common.c \
lib/efl/interfaces/efl_gfx_path.c \
lib/efl/interfaces/efl_gfx_shape.c \
-lib/efl/interfaces/efl_vpath_file.c \
-lib/efl/interfaces/efl_vpath_manager.c \
-lib/efl/interfaces/efl_vpath_core.c \
-lib/efl/interfaces/efl_vpath_file_core.c \
lib/efl/interfaces/efl_input_device.c \
lib/efl/interfaces/efl_io_closer.c \
lib/efl/interfaces/efl_io_positioner.c \
diff --git a/src/Makefile_Efl_Mono.am b/src/Makefile_Efl_Mono.am
index 7cfa20d4da..78ebc073ec 100644
--- a/src/Makefile_Efl_Mono.am
+++ b/src/Makefile_Efl_Mono.am
@@ -3,7 +3,6 @@ efl_custom_exports_mono_files = \
lib/efl_mono/efl_custom_exports_mono.c
efl_eo_mono_files = \
- bindings/mono/eo_mono/object.cs \
bindings/mono/eo_mono/iwrapper.cs \
bindings/mono/eo_mono/workaround.cs
@@ -22,7 +21,10 @@ efl_eina_mono_files = \
bindings/mono/eina_mono/eina_slice.cs \
bindings/mono/eina_mono/eina_stringshare.cs \
bindings/mono/eina_mono/eina_error.cs \
- bindings/mono/eina_mono/eina_value.cs
+ bindings/mono/eina_mono/eina_value.cs \
+ bindings/mono/eina_mono/eina_promises.cs \
+ bindings/mono/eina_mono/eina_accessor.cs \
+ bindings/mono/eina_mono/eina_strbuf.cs
efl_eldbus_mono_files = \
bindings/mono/eldbus_mono/eldbus_common.cs \
@@ -37,6 +39,8 @@ efl_eldbus_mono_files = \
efl_ecore_evas_mono_files = \
bindings/mono/ecore_evas_mono/ecore_evas.cs
+# Static C# source files don't go into a _SOURCES var as the dll target
+# is custom built instead of through _LTLIBRARIES/_LIBRARIES
lib_efl_mono_libefl_mono_dll_sources = \
bindings/mono/efl_mono/efl_all.cs \
$(efl_eo_mono_files) \
@@ -44,16 +48,49 @@ lib_efl_mono_libefl_mono_dll_sources = \
$(efl_eldbus_mono_files) \
$(efl_ecore_evas_mono_files)
+efl_mono_test_files = \
+ tests/efl_mono/test_testing.eo \
+ tests/efl_mono/test_child.eo \
+ tests/efl_mono/test_numberwrapper.eo \
+ tests/efl_mono/mono_test_driver.sh
+
EXTRA_DIST2 += \
-bindings/mono/efl_mono/efl_libs.cs.in \
-bindings/mono/efl_mono/efl_libs.csv.in
+ $(lib_efl_mono_libefl_mono_dll_sources) \
+ $(efl_mono_test_files) \
+ bindings/mono/efl_mono/efl_libs.cs.in \
+ bindings/mono/efl_mono/efl_libs.csv.in
if HAVE_CSHARP
bin_PROGRAMS += bin/eolian_mono/eolian_mono
bin_eolian_mono_eolian_mono_SOURCES = \
- bin/eolian_mono/eolian_mono.cc
+ bin/eolian_mono/eolian_mono.cc \
+ bin/eolian_mono/eolian/mono/documentation.hh \
+ bin/eolian_mono/eolian/mono/type.hh \
+ bin/eolian_mono/eolian/mono/marshall_annotation.hh \
+ bin/eolian_mono/eolian/mono/async_function_definition.hh \
+ bin/eolian_mono/eolian/mono/function_pointer.hh \
+ bin/eolian_mono/eolian/mono/function_definition.hh \
+ bin/eolian_mono/eolian/mono/name_helpers.hh \
+ bin/eolian_mono/eolian/mono/function_declaration.hh \
+ bin/eolian_mono/eolian/mono/helpers.hh \
+ bin/eolian_mono/eolian/mono/function_helpers.hh \
+ bin/eolian_mono/eolian/mono/marshall_type_impl.hh \
+ bin/eolian_mono/eolian/mono/function_registration.hh \
+ bin/eolian_mono/eolian/mono/enum_definition.hh \
+ bin/eolian_mono/eolian/mono/struct_definition.hh \
+ bin/eolian_mono/eolian/mono/part_definition.hh \
+ bin/eolian_mono/eolian/mono/struct_fields.hh \
+ bin/eolian_mono/eolian/mono/parameter.hh \
+ bin/eolian_mono/eolian/mono/utils.hh \
+ bin/eolian_mono/eolian/mono/using_decl.hh \
+ bin/eolian_mono/eolian/mono/marshall_type.hh \
+ bin/eolian_mono/eolian/mono/klass.hh \
+ bin/eolian_mono/eolian/mono/type_impl.hh \
+ bin/eolian_mono/eolian/mono/events.hh \
+ bin/eolian_mono/eolian/mono/generation_contexts.hh
+
bin_eolian_mono_eolian_mono_CXXFLAGS = -I$(top_builddir)/src/lib/efl \
-I$(top_srcdir)/src/lib/eolian_cxx/ \
-I$(top_srcdir)/src/bin/eolian_mono/ \
@@ -82,7 +119,7 @@ lib/evas/canvas/evas_canvas3d_object.eo.cs \
lib/evas/canvas/evas_canvas3d_primitive.eo.cs \
lib/evas/canvas/evas_canvas3d_scene.eo.cs \
lib/evas/canvas/evas_canvas3d_texture.eo.cs \
-lib/evas/canvas/efl_canvas_vg.eo.cs \
+lib/evas/canvas/efl_canvas_vg_object.eo.cs \
lib/evas/canvas/efl_vg.eo.cs \
lib/evas/canvas/efl_vg_container.eo.cs \
lib/evas/canvas/efl_vg_gradient.eo.cs \
@@ -93,18 +130,9 @@ lib/evas/canvas/efl_vg_shape.eo.cs
efl_eolian_blacklisted_files = \
lib/efl/interfaces/efl_io_buffer.eo.cs \
-lib/efl/interfaces/efl_io_closer.eo.cs \
lib/efl/interfaces/efl_io_positioner.eo.cs \
lib/efl/interfaces/efl_io_queue.eo.cs \
-lib/efl/interfaces/efl_io_reader.eo.cs \
-lib/efl/interfaces/efl_io_sizer.eo.cs \
-lib/efl/interfaces/efl_io_writer.eo.cs \
-lib/efl/interfaces/efl_text_properties.eo.cs \
-lib/efl/interfaces/efl_gfx_buffer.eo.cs \
-lib/efl/interfaces/efl_gfx_shape.eo.cs \
-lib/efl/interfaces/efl_gfx_gradient.eo.cs \
-lib/efl/interfaces/efl_gfx_gradient_linear.eo.cs \
-lib/efl/interfaces/efl_gfx_gradient_radial.eo.cs
+lib/efl/interfaces/efl_io_sizer.eo.cs
ecore_eolian_blacklisted_files = \
lib/ecore/efl_io_closer_fd.eo.cs \
@@ -134,6 +162,13 @@ lib/elementary/elm_genlist_item.eo.cs \
lib/elementary/elm_gengrid.eo.cs \
lib/elementary/elm_glview.eo.cs
+efl_mono_blacklisted_files = \
+$(evas_eolian_blacklisted_files) \
+$(efl_eolian_blacklisted_files) \
+$(ecore_eolian_blacklisted_files) \
+$(eo_eolian_blacklisted_files) \
+$(elementary_eolian_blacklisted_files)
+
efl_eolian_mono_files = \
$(filter-out $(eo_eolian_blacklisted_files),$(eo_eolian_files:%.eo=%.eo.cs)) \
$(filter-out $(ecore_eolian_blacklisted_files),$(ecore_eolian_files_public:%.eo=%.eo.cs)) \
@@ -150,12 +185,11 @@ lib/evas/canvas/evas_image.eo.cs \
lib/evas/canvas/efl_canvas_image.eo.cs \
lib/evas/canvas/evas_table.eo.cs \
lib/evas/canvas/evas_text.eo.cs \
-lib/efl/interfaces/efl_text_properties.eo.cs \
$(evas_canvas_eolian_type_files:%.eot=%.eot.cs) \
-lib/eo/eina_types.eot.cs
+lib/eo/eina_types.eot.cs \
+lib/ecore/efl_loop_timer.eo.cs
efl_mono_files_gen =\
-$(lib_efl_mono_libefl_mono_dll_sources) \
$(efl_eolian_mono_files) \
$(builddir)/bindings/mono/efl_mono/efl_libs.cs
@@ -163,12 +197,15 @@ $(builddir)/bindings/mono/efl_mono/efl_libs.cs
installed_eflmonomainheadersdir = $(includedir)/efl-mono-@VMAJ@/
nodist_installed_eflmonomainheaders_DATA = $(efl_eolian_files:%.eo=%.eo.cs) $(builddir)/bindings/mono/efl_mono/efl_libs.csv
-CLEANFILES += $(efl_mono_files_gen)
+CLEANFILES += $(efl_mono_files_gen) $(efl_mono_blacklisted_files) \
+ $(builddir)/lib/efl_mono/libefl_mono.dll \
+ $(builddir)/lib/efl_mono/libefl_mono.xml \
+ $(builddir)/lib/efl_mono/libefl_mono.dll.config
if HAVE_WIN32
-MCS_FLAGS := $(MCS_FLAGS)
-MCS_FLAGS += -define:WIN32
+MCSFLAGS ?=
+MCSFLAGS += -define:WIN32
endif
@@ -190,11 +227,11 @@ lib_efl_mono_libeflcustomexportsmono_la_DEPENDENCIES = @EFL_CUSTOM_EXPORTS_MONO_
#Efl Mono - C Sharp binding library
-libefl_mono_dll_MCS_FLAGS = -doc:lib/efl_mono/libefl_mono.xml
+libefl_mono_dll_MCSFLAGS = -doc:lib/efl_mono/libefl_mono.xml
-lib/efl_mono/libefl_mono.dll: $(efl_mono_files_dist) lib/efl_mono/$(am__dirstamp) $(efl_mono_files_gen) lib/efl_mono/libefl_mono.dll.config
+lib/efl_mono/libefl_mono.dll: $(efl_mono_files_dist) lib/efl_mono/$(am__dirstamp) $(lib_efl_mono_libefl_mono_dll_sources) $(efl_mono_files_gen) lib/efl_mono/libefl_mono.dll.config
@rm -f lib/efl_mono/libefl_mono.dll
- $(AM_V_MCS) $(MCS) $(MCS_FLAGS) $(libefl_mono_dll_MCS_FLAGS) -out:$@ -t:library $(filter %.cs, $(^))
+ $(AM_V_MCS) $(MCS) $(MCSFLAGS) $(libefl_mono_dll_MCSFLAGS) -out:$@ -t:library $(filter %.cs, $(^))
lib/efl_mono/libefl_mono.dll.config:
echo "<configuration>" > $@
@@ -206,21 +243,21 @@ lib/efl_mono/libefl_mono.dll.config:
echo " <dllmap dll=\"elementary\" target=\"$(abs_top_builddir)/src/lib/elementary/.libs/libelementary.so\"/>" >> $@
echo "</configuration>" >> $@
-if HAVE_WIN32
-efl_mono_dll_dest = $(DESTDIR)$(bindir)
-else
-efl_mono_dll_dest = $(DESTDIR)$(libdir)/efl-mono-@VMAJ@
-endif
-
EFL_INSTALL_EXEC_HOOK += \
-$(MKDIR_P) $(efl_mono_dll_dest); \
-cp -f $(builddir)/lib/efl_mono/libefl_mono.dll $(efl_mono_dll_dest)/libefl_mono.dll; \
-cp -f $(builddir)/lib/efl_mono/libefl_mono.xml $(efl_mono_dll_dest)/libefl_mono.xml; \
+$(MKDIR_P) @eflmonodlldir@; \
+cp -f $(builddir)/lib/efl_mono/libefl_mono.dll @eflmonodlldir@/libefl_mono.dll; \
+cp -f $(builddir)/lib/efl_mono/libefl_mono.xml @eflmonodlldir@/libefl_mono.xml; \
$(MKDIR_P) $(DESTDIR)$(datadir)/efl_mono; \
cp -f $(builddir)/bindings/mono/efl_mono/efl_libs.csv $(DESTDIR)$(datadir)/efl_mono/efl_libs.csv;
all-local: lib/efl_mono/libefl_mono.dll
+uninstall-local:
+ rm -rf @eflmonodlldir@/libefl_mono.dll
+ rm -rf @eflmonodlldir@/libefl_mono.xml
+ rm -rf $(DESTDIR)$(datadir)/efl_mono
+ rm -rf src/tests/efl_mono
+
### MSBuild
@@ -267,11 +304,7 @@ WIN_ADD_TEST_PATHS = $(abs_top_builddir)/src/lib/evil/.libs:$(abs_top_builddir)/
### Rules for generating the .cs files
-if HAVE_WIN32
ALL_EO_REFS = -r $(top_builddir)/src/bindings/mono/efl_mono/efl_libs.csv
-else
-ALL_EO_REFS=
-endif
lib/eo/%.eo.cs: lib/eo/%.eo $(_EOLIAN_MONO_DEP)
$(AM_V_EOLMONO) \
@@ -351,57 +384,76 @@ tests_efl_mono_libefl_mono_native_test_la_LDFLAGS = -rpath $(abs_top_builddir)/t
tests_efl_mono_libefl_mono_native_test_la_DEPENDENCIES = @USE_EINA_INTERNAL_LIBS@ @USE_EO_INTERNAL_LIBS@ @USE_ECORE_INTERNAL_LIBS@ @USE_ELDBUS_INTERNAL_LIBS@
tests_efl_mono_libefl_mono_native_test_la_LIBTOOLFLAGS = --tag=disable-static
-tests/efl_mono/libefl_mono_native_test.c: tests/efl_mono/test_testing.eo.h tests/efl_mono/test_testing.eo.c tests/efl_mono/test_numberwrapper.eo.h tests/efl_mono/test_numberwrapper.eo.c
+tests/efl_mono/libefl_mono_native_test.c: tests/efl_mono/test_testing.eo.h tests/efl_mono/test_testing.eo.c tests/efl_mono/test_child.eo.h tests/efl_mono/test_child.eo.c tests/efl_mono/test_numberwrapper.eo.h tests/efl_mono/test_numberwrapper.eo.c
# Intermediate C Sharp test DLL
efl_mono_test_eolian_mono_files = tests/efl_mono/test_testing.eo.cs \
+tests/efl_mono/test_child.eo.cs \
tests/efl_mono/test_numberwrapper.eo.cs
-tests/efl_mono/libefl_mono_test.dll: $(efl_mono_test_eolian_mono_files) tests/efl_mono/$(am__dirstamp) lib/efl_mono/libefl_mono.dll tests/efl_mono/libefl_mono_native_test.la
+tests/efl_mono/libefl_mono_test.dll: $(efl_mono_test_eolian_mono_files) tests/efl_mono/$(am__dirstamp) lib/efl_mono/libefl_mono.dll tests/efl_mono/libefl_mono_native_test.la tests/efl_mono/libefl_mono_test.dll.config
@rm -f tests/efl_mono/libefl_mono_test.dll
- $(AM_V_MCS) $(MCS) $(MCS_FLAGS) -r:$(abs_builddir)/lib/efl_mono/libefl_mono.dll -out:$@ -t:library $(filter %.cs, $(^))
+ $(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_builddir)/lib/efl_mono/libefl_mono.dll -out:$@ -t:library $(filter %.cs, $(^))
tests/efl_mono/efl_mono$(EXEEXT).config:
echo "<configuration>" > $@
echo " <dllmap dll=\"eina\" target=\"$(abs_top_builddir)/src/lib/eina/.libs/libeina.so\"/>" >> $@
echo " <dllmap dll=\"ecore\" target=\"$(abs_top_builddir)/src/lib/ecore/.libs/libecore.so\"/>" >> $@
echo " <dllmap dll=\"eo\" target=\"$(abs_top_builddir)/src/lib/eo/.libs/libeo.so\"/>" >> $@
+ echo " <dllmap dll=\"efl\" target=\"$(abs_top_builddir)/src/lib/efl/.libs/libefl.so\"/>" >> $@
+ echo " <dllmap dll=\"evas\" target=\"$(abs_top_builddir)/src/lib/evas/.libs/libevas.so\"/>" >> $@
+ echo " <dllmap dll=\"eldbus\" target=\"$(abs_top_builddir)/src/lib/eldbus/.libs/libeldbus.so\"/>" >> $@
+ echo " <dllmap dll=\"elementary\" target=\"$(abs_top_builddir)/src/lib/elementary/.libs/libelementary.so\"/>" >> $@
+ echo "</configuration>" >> $@
+
+tests/efl_mono/libefl_mono_test.dll.config:
+ echo "<configuration>" > $@
+ echo " <dllmap dll=\"eina\" target=\"$(abs_top_builddir)/src/lib/eina/.libs/libeina.so\"/>" >> $@
+ echo " <dllmap dll=\"ecore\" target=\"$(abs_top_builddir)/src/lib/ecore/.libs/libecore.so\"/>" >> $@
+ echo " <dllmap dll=\"eo\" target=\"$(abs_top_builddir)/src/lib/eo/.libs/libeo.so\"/>" >> $@
+ echo " <dllmap dll=\"efl\" target=\"$(abs_top_builddir)/src/lib/efl/.libs/libefl.so\"/>" >> $@
echo " <dllmap dll=\"evas\" target=\"$(abs_top_builddir)/src/lib/evas/.libs/libevas.so\"/>" >> $@
echo " <dllmap dll=\"eldbus\" target=\"$(abs_top_builddir)/src/lib/eldbus/.libs/libeldbus.so\"/>" >> $@
echo " <dllmap dll=\"elementary\" target=\"$(abs_top_builddir)/src/lib/elementary/.libs/libelementary.so\"/>" >> $@
echo "</configuration>" >> $@
# C Sharp test executable
-AM_TESTS_ENVIRONMENT += MONO='mono'; export MONO;
-AM_TESTS_ENVIRONMENT += MONO_BUILDPATH='$(abs_top_builddir)'; export MONO_BUILDPATH;
-AM_TESTS_ENVIRONMENT += MONO_PATH='$(TEST_PATHS)'; export MONO_PATH;
-AM_TESTS_ENVIRONMENT += EXEEXT='$(EXEEXT)'; export EXEEXT;
+AM_TESTS_ENVIRONMENT += MONO='mono'
+AM_TESTS_ENVIRONMENT += MONO_BUILDPATH='$(abs_top_builddir)'
+AM_TESTS_ENVIRONMENT += MONO_PATH='$(TEST_PATHS)'
+AM_TESTS_ENVIRONMENT += EXEEXT='$(EXEEXT)'
if HAVE_WIN32
-AM_TESTS_ENVIRONMENT += PATH='$(PATH):$(TEST_PATHS):$(WIN_ADD_TEST_PATHS)'; export PATH;
+AM_TESTS_ENVIRONMENT += PATH='$(PATH):$(TEST_PATHS):$(WIN_ADD_TEST_PATHS)'
else
-AM_TESTS_ENVIRONMENT += LD_LIBRARY_PATH='$(LD_LIBRARY_PATH):$(TEST_PATHS)'; export LD_LIBRARY_PATH;
+AM_TESTS_ENVIRONMENT += LD_LIBRARY_PATH='$(LD_LIBRARY_PATH):$(TEST_PATHS)'
check_PROGRAMS += tests/efl_mono/efl_mono
TESTS += tests/efl_mono/mono_test_driver.sh
tests_efl_mono_efl_mono_SOURCES = \
tests/efl_mono/Main.cs \
+ tests/efl_mono/TestUtils.cs \
+ tests/efl_mono/BasicDirection.cs \
tests/efl_mono/Eina.cs \
tests/efl_mono/Eldbus.cs \
tests/efl_mono/Eo.cs \
+ tests/efl_mono/EoPromises.cs \
tests/efl_mono/Errors.cs \
tests/efl_mono/Evas.cs \
tests/efl_mono/Events.cs \
tests/efl_mono/FunctionPointers.cs \
+ tests/efl_mono/FunctionPointerMarshalling.cs \
+ tests/efl_mono/Parts.cs \
+ tests/efl_mono/Promises.cs \
+ tests/efl_mono/Strbuf.cs \
tests/efl_mono/Strings.cs \
tests/efl_mono/Structs.cs \
- tests/efl_mono/TestUtils.cs \
tests/efl_mono/Value.cs \
tests/efl_mono/ValueEolian.cs
tests/efl_mono/efl_mono$(EXEEXT): $(tests_efl_mono_efl_mono_SOURCES) tests/efl_mono/$(am__dirstamp) lib/efl_mono/libefl_mono.dll tests/efl_mono/libefl_mono_test.dll tests/efl_mono/efl_mono$(EXEEXT).config
@rm -f $@
- $(AM_V_MCS) $(MCS) $(MCS_FLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -r:$(abs_top_builddir)/src/tests/efl_mono/libefl_mono_test.dll -out:$@ $(filter %.cs, $(^))
+ $(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -r:$(abs_top_builddir)/src/tests/efl_mono/libefl_mono_test.dll -out:$@ $(filter %.cs, $(^))
# Rule for generating the .cs files
tests/efl_mono/%.eo.cs: tests/efl_mono/%.eo $(_EOLIAN_MONO_DEP)
@@ -409,7 +461,7 @@ tests/efl_mono/%.eo.cs: tests/efl_mono/%.eo $(_EOLIAN_MONO_DEP)
$(MKDIR_P) $(dir $@); \
$(EOLIAN_MONO) $(EOLIAN_FLAGS) $(EOLIAN_MONO_FLAGS) --dllimport "@DLIB_PREFIX_MONO@efl_mono_native_test@DLIB_SUFFIX_MONO@" -o $@ $(ALL_EO_REFS) $<
-CLEANFILES += tests/efl_mono/libefl_mono_test.dll tests/efl_mono/test_testing.eo.cs tests/efl_mono/test_numberwrapper.eo.cs tests/efl_mono/test_testing.eo.c tests/efl_mono/test_numberwrapper.eo.c tests/efl_mono/test_testing.eo.h tests/efl_mono/test_numberwrapper.eo.h
+CLEANFILES += tests/efl_mono/libefl_mono_test.dll tests/efl_mono/test_testing.eo.cs tests/efl_mono/test_child.eo.cs tests/efl_mono/test_numberwrapper.eo.cs tests/efl_mono/test_testing.eo.c tests/efl_mono/test_child.eo.c tests/efl_mono/test_numberwrapper.eo.c tests/efl_mono/test_testing.eo.h tests/efl_mono/test_child.eo.h tests/efl_mono/test_numberwrapper.eo.h tests/efl_mono/efl_mono.config
endif
diff --git a/src/Makefile_Efreet.am b/src/Makefile_Efreet.am
index f955cec33e..8912919892 100644
--- a/src/Makefile_Efreet.am
+++ b/src/Makefile_Efreet.am
@@ -11,6 +11,7 @@ EFREET_COMMON_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/efreet\" \
-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \
+-DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \
-DDATA_DIR=\"$(datadir)\" \
-DLOCALE_DIR=\"@LOCALE_DIR@\" \
@EFREET_CFLAGS@
@@ -43,7 +44,9 @@ lib/efreet/efreet_uri.c \
lib/efreet/efreet_cache.c \
lib/efreet/efreet_private.h \
lib/efreet/efreet_xml.h \
-lib/efreet/efreet_cache_private.h
+lib/efreet/efreet_cache_private.h \
+static_libs/buildsystem/buildsystem.h \
+static_libs/buildsystem/buildsystem_autotools.c
lib_efreet_libefreet_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl $(EFREET_COMMON_CPPFLAGS)
lib_efreet_libefreet_la_LIBADD = @EFREET_LIBS@ @EVIL_LIBS@
diff --git a/src/Makefile_Eina.am b/src/Makefile_Eina.am
index 186bd1e8e1..997c5262dd 100644
--- a/src/Makefile_Eina.am
+++ b/src/Makefile_Eina.am
@@ -107,7 +107,8 @@ lib/eina/eina_slice.h \
lib/eina/eina_inline_slice.x \
lib/eina/eina_inline_modinfo.x \
lib/eina/eina_freeq.h \
-lib/eina/eina_slstr.h
+lib/eina/eina_slstr.h \
+lib/eina/eina_vpath.h
lib_eina_libeina_la_SOURCES = \
@@ -183,7 +184,8 @@ lib/eina/eina_quaternion.c \
lib/eina/eina_bezier.c \
lib/eina/eina_safepointer.c \
lib/eina/eina_freeq.c \
-lib/eina/eina_slstr.c
+lib/eina/eina_slstr.c \
+lib/eina/eina_vpath.c
if HAVE_WIN32
@@ -356,13 +358,15 @@ tests/eina/eina_test_bezier.c \
tests/eina/eina_test_safepointer.c \
tests/eina/eina_test_slice.c \
tests/eina/eina_test_freeq.c \
-tests/eina/eina_test_slstr.c
+tests/eina/eina_test_slstr.c \
+tests/eina/eina_test_vpath.c \
+tests/eina/eina_test_debug.c
tests_eina_eina_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-DTESTS_WD=\"`pwd`\" \
-DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/eina\" \
--DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)/src/tests/eina\" \
--DTESTS_BUILD_DIR=PACKAGE_BUILD_DIR \
+-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)/\" \
+-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/eina\" \
@CHECK_CFLAGS@ \
@EINA_CFLAGS@
tests_eina_eina_suite_LDADD = @CHECK_LIBS@ @USE_EINA_LIBS@
@@ -377,7 +381,7 @@ check_LTLIBRARIES = tests/eina/module_dummy.la
tests_eina_module_dummy_la_SOURCES = tests/eina/eina_test_module_dummy.c
tests_eina_module_dummy_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
--DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)/src/tests/eina\" \
+-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)/\" \
@CHECK_CFLAGS@ \
@EINA_CFLAGS@
tests_eina_module_dummy_la_LIBADD = @USE_EINA_LIBS@
diff --git a/src/Makefile_Eldbus.am b/src/Makefile_Eldbus.am
index 9add4689e4..2fd22ad4f5 100644
--- a/src/Makefile_Eldbus.am
+++ b/src/Makefile_Eldbus.am
@@ -10,7 +10,8 @@ eldbus_eolian_files = \
lib/eldbus/eldbus_model_proxy.eo \
lib/eldbus/eldbus_model_method.eo \
lib/eldbus/eldbus_model_arguments.eo \
- lib/eldbus/eldbus_model_signal.eo
+ lib/eldbus/eldbus_model_signal.eo \
+ lib/eldbus/eldbus_model.eo
eldbus_eolian_c = $(eldbus_eolian_files:%.eo=%.eo.c)
eldbus_eolian_h = $(eldbus_eolian_files:%.eo=%.eo.h) \
@@ -74,6 +75,7 @@ lib/eldbus/eldbus_model_proxy.c \
lib/eldbus/eldbus_model_method.c \
lib/eldbus/eldbus_model_arguments.c \
lib/eldbus/eldbus_model_signal.c \
+lib/eldbus/eldbus_model.c \
lib/eldbus/eldbus_introspection.c
lib_eldbus_libeldbus_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am
index 5b292a5445..b2a356b1f1 100644
--- a/src/Makefile_Elementary.am
+++ b/src/Makefile_Elementary.am
@@ -2,7 +2,7 @@
### Library
elm_public_eolian_files = \
- lib/elementary/elm_widget.eo \
+ lib/elementary/efl_ui_widget.eo \
lib/elementary/efl_ui_bg.eo \
lib/elementary/efl_ui_bg_widget.eo \
lib/elementary/efl_ui_button.eo \
@@ -11,11 +11,15 @@ elm_public_eolian_files = \
lib/elementary/efl_ui_check.eo \
lib/elementary/efl_ui_flip.eo \
lib/elementary/efl_ui_frame.eo \
+ lib/elementary/efl_ui_stack.eo \
lib/elementary/efl_ui_image.eo \
lib/elementary/efl_ui_image_zoomable.eo \
- lib/elementary/efl_ui_layout.eo \
- lib/elementary/efl_ui_multibuttonentry.eo \
+ lib/elementary/efl_ui_layout_object.eo \
lib/elementary/efl_ui_nstate.eo \
+ lib/elementary/efl_ui_navigation_bar.eo \
+ lib/elementary/efl_ui_navigation_bar_part.eo \
+ lib/elementary/efl_ui_navigation_bar_part_back_button.eo \
+ lib/elementary/efl_ui_navigation_layout.eo \
lib/elementary/efl_ui_panes.eo \
lib/elementary/efl_ui_progressbar.eo \
lib/elementary/efl_ui_radio.eo \
@@ -23,6 +27,9 @@ elm_public_eolian_files = \
lib/elementary/efl_ui_slider_interval.eo \
lib/elementary/efl_ui_spin.eo \
lib/elementary/efl_ui_spin_button.eo \
+ lib/elementary/efl_ui_datepicker.eo \
+ lib/elementary/efl_ui_timepicker.eo \
+ lib/elementary/efl_ui_tags.eo \
lib/elementary/efl_ui_video.eo \
lib/elementary/efl_ui_win.eo \
lib/elementary/efl_ui_win_inlined.eo \
@@ -32,7 +39,7 @@ elm_public_eolian_files = \
lib/elementary/efl_ui_box_stack.eo \
lib/elementary/efl_ui_table.eo \
lib/elementary/efl_ui_table_static.eo \
- lib/elementary/efl_ui_text_interactive.eo \
+ lib/elementary/efl_text_interactive.eo \
lib/elementary/efl_ui_text.eo \
lib/elementary/efl_ui_popup.eo \
lib/elementary/efl_ui_popup_part.eo \
@@ -45,6 +52,9 @@ elm_public_eolian_files = \
lib/elementary/efl_ui_popup_anchor.eo \
lib/elementary/efl_ui_text_editable.eo \
lib/elementary/efl_ui_text_async.eo \
+ lib/elementary/efl_ui_text_factory_images.eo \
+ lib/elementary/efl_ui_text_factory_emoticons.eo \
+ lib/elementary/efl_ui_text_factory_fallback.eo \
lib/elementary/efl_ui_textpath.eo \
lib/elementary/efl_ui_translatable.eo \
lib/elementary/efl_ui_clock.eo \
@@ -55,11 +65,9 @@ elm_public_eolian_files = \
lib/elementary/efl_ui_focus_manager_sub.eo \
lib/elementary/efl_ui_focus_manager_root_focus.eo \
lib/elementary/efl_ui_focus_object.eo \
- lib/elementary/efl_ui_focus_user.eo \
lib/elementary/efl_ui_focus_layer.eo \
lib/elementary/efl_ui_focus_composition.eo \
lib/elementary/efl_ui_focus_util.eo \
- lib/elementary/efl_ui_button_part.eo \
lib/elementary/efl_ui_flip_part.eo \
lib/elementary/efl_ui_layout_factory.eo \
lib/elementary/efl_ui_layout_part.eo \
@@ -69,14 +77,22 @@ elm_public_eolian_files = \
lib/elementary/efl_ui_layout_part_table.eo \
lib/elementary/efl_ui_layout_part_bg.eo \
lib/elementary/efl_ui_layout_part_legacy.eo \
+ lib/elementary/efl_ui_view_list.eo \
+ lib/elementary/efl_ui_view_list_model.eo \
+ lib/elementary/efl_ui_view_list_pan.eo \
+ lib/elementary/efl_ui_view_list_segarray.eo \
+ lib/elementary/efl_ui_view_list_relayout.eo \
+ lib/elementary/efl_ui_item.eo \
+ lib/elementary/efl_ui_list_item.eo \
+ lib/elementary/efl_ui_list_default_item_part_icon.eo \
+ lib/elementary/efl_ui_list_default_item_part_end.eo \
+ lib/elementary/efl_ui_list_default_item.eo \
+ lib/elementary/efl_ui_list_empty_item.eo \
lib/elementary/efl_ui_list.eo \
- lib/elementary/efl_ui_list_model.eo \
- lib/elementary/efl_ui_list_pan.eo \
- lib/elementary/efl_ui_list_relayout.eo \
- lib/elementary/efl_ui_multibuttonentry_part.eo \
lib/elementary/efl_ui_panes_part.eo \
lib/elementary/efl_ui_progressbar_part.eo \
- lib/elementary/efl_ui_slider_part_indicator.eo \
+ lib/elementary/elm_slider.eo \
+ lib/elementary/elm_slider_part_indicator.eo \
lib/elementary/efl_ui_textpath_part.eo \
lib/elementary/efl_ui_widget_part.eo \
lib/elementary/efl_ui_widget_part_bg.eo \
@@ -85,11 +101,10 @@ elm_public_eolian_files = \
lib/elementary/efl_ui_scroller.eo \
lib/elementary/efl_ui_scroll_manager.eo \
lib/elementary/efl_ui_pan.eo \
- lib/elementary/efl_access.eo \
+ lib/elementary/efl_access_object.eo \
lib/elementary/efl_access_action.eo \
lib/elementary/efl_access_component.eo \
lib/elementary/efl_access_editable_text.eo \
- lib/elementary/efl_access_image.eo \
lib/elementary/efl_access_selection.eo \
lib/elementary/efl_access_text.eo \
lib/elementary/efl_access_value.eo \
@@ -97,12 +112,33 @@ elm_public_eolian_files = \
lib/elementary/efl_access_window.eo \
lib/elementary/efl_config_global.eo \
lib/elementary/elm_code_widget.eo \
+ lib/elementary/efl_selection.eo \
+ lib/elementary/efl_ui_dnd.eo \
+ lib/elementary/efl_ui_dnd_container.eo \
+ lib/elementary/efl_ui_focus_manager_window_root.eo \
+ lib/elementary/efl_ui_pager.eo \
+ lib/elementary/efl_page_transition.eo \
+ lib/elementary/efl_page_transition_scroll.eo \
+ lib/elementary/efl_page_indicator.eo \
+ lib/elementary/efl_page_indicator_icon.eo \
+ lib/elementary/efl_ui_tab_pager.eo \
+ lib/elementary/efl_ui_tab_bar.eo \
+ lib/elementary/efl_ui_tab_page.eo \
+ lib/elementary/efl_ui_tab_page_part_tab.eo \
+ lib/elementary/efl_ui_widget_focus_manager.eo \
$(NULL)
# More public files -- FIXME
elm_public_eolian_files += \
+ lib/elementary/efl_ui_legacy.eo \
+ lib/elementary/efl_ui_button_legacy_part.eo \
+ lib/elementary/efl_ui_radio_legacy_part.eo \
+ lib/elementary/efl_ui_check_legacy_part.eo \
+ lib/elementary/efl_ui_progressbar_legacy_part.eo \
lib/elementary/elm_spinner.eo \
+ lib/elementary/elm_multibuttonentry.eo \
lib/elementary/elm_multibuttonentry_item.eo \
+ lib/elementary/elm_multibuttonentry_part.eo \
lib/elementary/elm_interface_scrollable.eo \
lib/elementary/elm_atspi_bridge.eo \
lib/elementary/elm_atspi_app_object.eo \
@@ -121,16 +157,35 @@ elm_private_eolian_files = \
lib/elementary/efl_ui_internal_text_interactive.eo \
lib/elementary/efl_ui_focus_composition_adapter.eo \
lib/elementary/efl_ui_win_part.eo \
- lib/elementary/efl_ui_focus_rectangle.eo \
lib/elementary/efl_ui_focus_parent_provider.eo \
lib/elementary/efl_ui_focus_parent_provider_standard.eo \
lib/elementary/efl_ui_focus_parent_provider_gen.eo \
+ lib/elementary/efl_ui_model_state.eo \
tests/elementary/focus_test.eo \
tests/elementary/focus_test_sub_main.eo \
+ lib/elementary/efl_selection_manager.eo \
+ lib/elementary/efl_datetime_manager.eo \
$(NULL)
# Legacy classes - not part of public EO API
elm_legacy_eolian_files = \
+ lib/elementary/efl_ui_button_legacy.eo \
+ lib/elementary/efl_ui_check_legacy.eo \
+ lib/elementary/efl_ui_radio_legacy.eo \
+ lib/elementary/efl_ui_bg_widget_legacy.eo \
+ lib/elementary/efl_ui_video_legacy.eo \
+ lib/elementary/efl_ui_frame_legacy.eo \
+ lib/elementary/efl_ui_panes_legacy.eo \
+ lib/elementary/efl_ui_image_zoomable_legacy.eo \
+ lib/elementary/efl_ui_flip_legacy.eo \
+ lib/elementary/efl_ui_win_legacy.eo \
+ lib/elementary/efl_ui_image_legacy.eo \
+ lib/elementary/efl_ui_progressbar_legacy.eo \
+ lib/elementary/efl_ui_clock_legacy.eo \
+ lib/elementary/efl_ui_layout_legacy.eo \
+ lib/elementary/elm_code_widget_legacy.eo \
+ lib/elementary/efl_ui_win_socket_legacy.eo \
+ lib/elementary/efl_ui_win_inlined_legacy.eo \
lib/elementary/elm_interface_fileselector.eo \
lib/elementary/elm_calendar.eo \
lib/elementary/elm_calendar_item.eo \
@@ -220,13 +275,15 @@ elm_legacy_eolian_files = \
lib/elementary/elm_slideshow_item.eo \
lib/elementary/elm_table.eo \
lib/elementary/elm_thumb.eo \
- lib/elementary/efl_ui_list_precise_layouter.eo \
+ lib/elementary/efl_ui_view_list_precise_layouter.eo \
$(NULL)
elm_eolian_type_files = \
lib/elementary/elm_general.eot \
lib/elementary/efl_ui.eot \
- lib/elementary/efl_ui_list_types.eot
+ lib/elementary/efl_ui_view_list_types.eot \
+ lib/elementary/efl_selection_types.eot \
+ lib/elementary/efl_ui_dnd_types.eot
elm_public_eolian_c = $(elm_public_eolian_files:%.eo=%.eo.c)
elm_public_eolian_h = $(elm_public_eolian_files:%.eo=%.eo.h) \
@@ -267,7 +324,7 @@ includesdir = $(includedir)/elementary-@VMAJ@
includesunstable_HEADERS = \
lib/elementary/elm_gen_common.h \
lib/elementary/elm_atspi_bridge.h \
- lib/elementary/efl_access.h \
+ lib/elementary/efl_access_object.h \
lib/elementary/efl_access_text.h \
lib/elementary/efl_access_widget_action.h \
lib/elementary/efl_access_window.h \
@@ -298,6 +355,7 @@ includesunstable_HEADERS = \
lib/elementary/efl_ui_widget_flip.h \
lib/elementary/elm_widget_flipselector.h \
lib/elementary/efl_ui_widget_frame.h \
+ lib/elementary/efl_ui_stack_private.h \
lib/elementary/elm_widget_gengrid.h \
lib/elementary/elm_widget_genlist.h \
lib/elementary/elm_widget_glview.h \
@@ -319,8 +377,10 @@ includesunstable_HEADERS = \
lib/elementary/elm_widget_map.h \
lib/elementary/elm_widget_mapbuf.h \
lib/elementary/elm_widget_menu.h \
- lib/elementary/efl_ui_multibuttonentry_private.h \
+ lib/elementary/elm_widget_multibuttonentry.h \
lib/elementary/elm_widget_naviframe.h \
+ lib/elementary/efl_ui_navigation_bar_private.h \
+ lib/elementary/efl_ui_navigation_layout_private.h \
lib/elementary/elm_widget_notify.h \
lib/elementary/elm_widget_panel.h \
lib/elementary/efl_ui_panes_private.h \
@@ -336,23 +396,31 @@ includesunstable_HEADERS = \
lib/elementary/elm_widget_scroller.h \
lib/elementary/elm_widget_segment_control.h \
lib/elementary/elm_widget_separator.h \
+ lib/elementary/elm_widget_slider.h \
lib/elementary/efl_ui_slider_private.h \
+ lib/elementary/efl_ui_slider_interval_private.h \
lib/elementary/elm_widget_slideshow.h \
lib/elementary/elm_widget_spinner.h \
lib/elementary/efl_ui_spin_private.h \
lib/elementary/efl_ui_spin_button_private.h \
+ lib/elementary/efl_ui_datepicker_private.h \
+ lib/elementary/efl_ui_timepicker_private.h \
+ lib/elementary/efl_ui_tags_private.h \
lib/elementary/elm_widget_table.h \
lib/elementary/elm_widget_thumb.h \
lib/elementary/elm_widget_toolbar.h \
lib/elementary/efl_ui_video_private.h \
+ lib/elementary/efl_ui_item_private.h \
+ lib/elementary/efl_ui_list_item_private.h \
lib/elementary/efl_ui_list_private.h \
- lib/elementary/efl_ui_list_segarray.h \
+ lib/elementary/efl_ui_view_list_private.h \
+ lib/elementary/efl_ui_view_list_segarray.h \
lib/elementary/elm_widget_web.h \
lib/elementary/efl_ui_clock.h \
lib/elementary/elm_code.h \
lib/elementary/elm_code_widget_legacy.h \
lib/elementary/elm_code_widget_selection.h \
- lib/elementary/elm_code_diff_widget.h \
+ lib/elementary/elm_code_diff_widget.h \
lib/elementary/elm_code_common.h \
lib/elementary/elm_code_line.h \
lib/elementary/elm_code_text.h \
@@ -360,11 +428,19 @@ includesunstable_HEADERS = \
lib/elementary/elm_code_file.h \
lib/elementary/elm_code_parse.h \
lib/elementary/elm_code_syntax.h \
- lib/elementary/efl_ui_multibuttonentry.h \
lib/elementary/efl_ui_widget_scroller.h \
lib/elementary/efl_ui_widget_scroll_manager.h \
lib/elementary/efl_ui_widget_pan.h \
- lib/elementary/Efl_Ui.h
+ lib/elementary/efl_ui_nstate_private.h \
+ lib/elementary/Efl_Ui.h \
+ lib/elementary/efl_ui_widget_pager.h \
+ lib/elementary/efl_page_transition.h \
+ lib/elementary/efl_page_transition_scroll.h \
+ lib/elementary/efl_page_indicator.h \
+ lib/elementary/efl_page_indicator_icon.h \
+ lib/elementary/efl_ui_tab_pager_private.h \
+ lib/elementary/efl_ui_tab_bar_private.h \
+ lib/elementary/efl_ui_tab_page_private.h
includesunstabledir = $(includedir)/elementary-@VMAJ@
nodist_includesunstable_HEADERS = \
@@ -386,7 +462,7 @@ includesub_HEADERS = \
lib/elementary/elc_hoversel.h \
lib/elementary/elc_hoversel_legacy.h \
lib/elementary/elc_multibuttonentry.h \
- lib/elementary/efl_ui_multibuttonentry_eo.h \
+ lib/elementary/elc_multibuttonentry_eo.h \
lib/elementary/elc_multibuttonentry_legacy.h \
lib/elementary/elc_multibuttonentry_common.h \
lib/elementary/elc_naviframe.h \
@@ -541,7 +617,6 @@ includesub_HEADERS = \
lib/elementary/elm_separator_legacy.h \
lib/elementary/elm_slider.h \
lib/elementary/elm_slider_common.h \
- lib/elementary/efl_ui_slider_eo.h \
lib/elementary/elm_slider_legacy.h \
lib/elementary/elm_slideshow.h \
lib/elementary/elm_slideshow_common.h \
@@ -594,8 +669,10 @@ lib_elementary_libelementary_la_SOURCES = \
lib/elementary/elc_fileselector_button.c \
lib/elementary/elc_fileselector_entry.c \
lib/elementary/elc_hoversel.c \
- lib/elementary/efl_ui_multibuttonentry.c \
+ lib/elementary/elc_multibuttonentry.c \
lib/elementary/elc_naviframe.c \
+ lib/elementary/efl_ui_navigation_bar.c \
+ lib/elementary/efl_ui_navigation_layout.c \
lib/elementary/elc_player.c \
lib/elementary/elc_popup.c \
lib/elementary/elc_scrolled_entry.c \
@@ -603,6 +680,7 @@ lib_elementary_libelementary_la_SOURCES = \
lib/elementary/elm_actionslider.c \
lib/elementary/elm_atspi_app_object.c \
lib/elementary/elm_atspi_bridge.c \
+ lib/elementary/efl_ui_legacy.c \
lib/elementary/efl_ui_bg.c \
lib/elementary/efl_ui_bg_widget.c \
lib/elementary/elm_box.c \
@@ -612,7 +690,6 @@ lib_elementary_libelementary_la_SOURCES = \
lib/elementary/efl_ui_calendar.c \
lib/elementary/efl_ui_check.c \
lib/elementary/elm_clock.c \
- lib/elementary/elm_cnp.c \
lib/elementary/elm_code_line.c \
lib/elementary/elm_code_text.c \
lib/elementary/elm_code_indent.c \
@@ -641,6 +718,7 @@ lib_elementary_libelementary_la_SOURCES = \
lib/elementary/elm_flipselector.c \
lib/elementary/elm_font.c \
lib/elementary/efl_ui_frame.c \
+ lib/elementary/efl_ui_stack.c \
lib/elementary/elm_gengrid.c \
lib/elementary/elm_genlist.c \
lib/elementary/elm_gesture_layer.c \
@@ -651,11 +729,10 @@ lib_elementary_libelementary_la_SOURCES = \
lib/elementary/elm_icon.c \
lib/elementary/efl_ui_image.c \
lib/elementary/elm_index.c \
- lib/elementary/efl_access.c \
+ lib/elementary/efl_access_object.c \
lib/elementary/efl_access_action.c \
lib/elementary/efl_access_component.c \
lib/elementary/efl_access_editable_text.c \
- lib/elementary/efl_access_image.c \
lib/elementary/efl_access_selection.c \
lib/elementary/efl_access_text.c \
lib/elementary/efl_access_value.c \
@@ -665,7 +742,7 @@ lib_elementary_libelementary_la_SOURCES = \
lib/elementary/elm_interface_scrollable.c \
lib/elementary/elm_inwin.c \
lib/elementary/elm_label.c \
- lib/elementary/efl_ui_layout.c \
+ lib/elementary/efl_ui_layout_object.c \
lib/elementary/efl_ui_layout_pack.c \
lib/elementary/elm_list.c \
lib/elementary/elm_main.c \
@@ -689,10 +766,14 @@ lib_elementary_libelementary_la_SOURCES = \
lib/elementary/elm_scroller.c \
lib/elementary/elm_segment_control.c \
lib/elementary/elm_separator.c \
+ lib/elementary/elm_slider.c \
lib/elementary/efl_ui_slider.c \
lib/elementary/efl_ui_slider_interval.c \
lib/elementary/efl_ui_spin.c \
lib/elementary/efl_ui_spin_button.c \
+ lib/elementary/efl_ui_datepicker.c \
+ lib/elementary/efl_ui_timepicker.c \
+ lib/elementary/efl_ui_tags.c \
lib/elementary/elm_slideshow.c \
lib/elementary/elm_spinner.c \
lib/elementary/elm_store.c \
@@ -711,7 +792,7 @@ lib_elementary_libelementary_la_SOURCES = \
lib/elementary/elm_view_list.c \
lib/elementary/elm_view_form.c \
lib/elementary/elm_web2.c \
- lib/elementary/elm_widget.c \
+ lib/elementary/efl_ui_widget.c \
lib/elementary/efl_ui_win.c \
lib/elementary/efl_ui_win_inlined.c \
lib/elementary/efl_ui_win_socket.c \
@@ -734,6 +815,9 @@ lib_elementary_libelementary_la_SOURCES = \
lib/elementary/efl_ui_table_static.c \
lib/elementary/efl_ui_table_private.h \
lib/elementary/efl_ui_text.c \
+ lib/elementary/efl_ui_text_factory_images.c \
+ lib/elementary/efl_ui_text_factory_emoticons.c \
+ lib/elementary/efl_ui_text_factory_fallback.c \
lib/elementary/efl_ui_clock.c \
lib/elementary/efl_ui_clock_private.h \
lib/elementary/efl_ui_image_factory.c \
@@ -750,13 +834,37 @@ lib_elementary_libelementary_la_SOURCES = \
lib/elementary/efl_ui_focus_parent_provider_gen.c \
lib/elementary/efl_ui_focus_util.c \
lib/elementary/elm_widget_item_static_focus.c \
+ lib/elementary/efl_ui_item.c \
+ lib/elementary/efl_ui_list_item.c \
+ lib/elementary/efl_ui_list_default_item.c \
+ lib/elementary/efl_ui_list_empty_item.c \
lib/elementary/efl_ui_list.c \
- lib/elementary/efl_ui_list_precise_layouter.c \
- lib/elementary/efl_ui_list_segarray.c \
+ lib/elementary/efl_ui_view_list.c \
+ lib/elementary/efl_ui_view_list_precise_layouter.c \
+ lib/elementary/efl_ui_view_list_segarray.c \
lib/elementary/efl_ui_layout_factory.c \
lib/elementary/efl_ui_scroller.c \
lib/elementary/efl_ui_scroll_manager.c \
lib/elementary/efl_ui_pan.c \
+ lib/elementary/efl_selection_manager.c \
+ lib/elementary/efl_selection_manager_private.h \
+ lib/elementary/efl_selection.c \
+ lib/elementary/efl_datetime_manager.c \
+ lib/elementary/efl_ui_dnd.c \
+ lib/elementary/elm_focus_legacy.c \
+ static_libs/buildsystem/buildsystem.h \
+ static_libs/buildsystem/buildsystem_autotools.c \
+ lib/elementary/efl_ui_pager.c \
+ lib/elementary/efl_page_transition.c \
+ lib/elementary/efl_page_transition_scroll.c \
+ lib/elementary/efl_page_indicator.c \
+ lib/elementary/efl_page_indicator_icon.c \
+ lib/elementary/efl_ui_focus_graph.h \
+ lib/elementary/efl_ui_focus_graph.c \
+ lib/elementary/efl_ui_tab_pager.c \
+ lib/elementary/efl_ui_tab_bar.c \
+ lib/elementary/efl_ui_tab_page.c \
+ lib/elementary/efl_ui_widget_focus_manager.c \
$(NULL)
@@ -780,6 +888,8 @@ lib_elementary_libelementary_la_CPPFLAGS = \
-DPACKAGE_DATA_DIR=\"$(datadir)/elementary\" \
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
+-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \
+-DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \
-DLOCALE_DIR=\"$(localedir)\" \
-DICON_DIR=\"$(datadir)/icons\" \
-DELM_TOP_BUILD_DIR=\"$(top_builddir)\" \
@@ -828,6 +938,7 @@ bin/elementary/test_bg.c \
bin/elementary/test_box.c \
bin/elementary/test_bubble.c \
bin/elementary/test_button.c \
+bin/elementary/test_ui_button.c \
bin/elementary/test_calendar.c \
bin/elementary/test_check.c \
bin/elementary/test_clock.c \
@@ -890,6 +1001,7 @@ bin/elementary/test_glview.c \
bin/elementary/test_glview_manygears.c \
bin/elementary/test_grid.c \
bin/elementary/test_ui_table_static.c \
+bin/elementary/test_ui_stack.c \
bin/elementary/test_hover.c \
bin/elementary/test_hoversel.c \
bin/elementary/test_icon.c \
@@ -921,6 +1033,7 @@ bin/elementary/test_photocam.c \
bin/elementary/test_popup.c \
bin/elementary/test_prefs.c \
bin/elementary/test_progressbar.c \
+bin/elementary/test_ui_progressbar.c \
bin/elementary/test_radio.c \
bin/elementary/test_scaling.c \
bin/elementary/test_scroller.c \
@@ -932,6 +1045,9 @@ bin/elementary/test_ui_slider.c \
bin/elementary/test_ui_slider_interval.c \
bin/elementary/test_ui_spin.c \
bin/elementary/test_ui_spin_button.c \
+bin/elementary/test_ui_datepicker.c \
+bin/elementary/test_ui_timepicker.c \
+bin/elementary/test_ui_tags.c \
bin/elementary/test_slideshow.c \
bin/elementary/test_spinner.c \
bin/elementary/test_store.c \
@@ -963,6 +1079,7 @@ bin/elementary/test_efl_ui_text.c \
bin/elementary/test_win_stack.c \
bin/elementary/test_win_indicator.c \
bin/elementary/test_gesture_framework.c \
+bin/elementary/test_ui_tab_pager.c \
bin/elementary/test.h
bin_elementary_elementary_test_LDADD = @USE_ELEMENTARY_LIBS@
@@ -1358,8 +1475,8 @@ AM_TESTS_ENVIRONMENT += \
ELM_RUN_IN_TREE=1 \
EFL_RUN_IN_TREE=1
-check_PROGRAMS += tests/elementary/elm_suite
-TESTS += tests/elementary/elm_suite
+check_PROGRAMS += tests/elementary/elm_suite tests/elementary/efl_ui_suite
+TESTS += tests/elementary/elm_suite tests/elementary/efl_ui_suite
tests_elementary_elm_suite_SOURCES = \
tests/elementary/elm_suite.c \
@@ -1460,6 +1577,24 @@ tests_elementary_elm_suite_CPPFLAGS = \
tests_elementary_elm_suite_LDADD = @CHECK_LIBS@ @USE_ELEMENTARY_LIBS@
tests_elementary_elm_suite_DEPENDENCIES = @USE_ELEMENTARY_INTERNAL_LIBS@ $(top_builddir)/data/elementary/objects/test.edj
+
+tests_elementary_efl_ui_suite_SOURCES = \
+ tests/elementary/efl_ui_suite.c
+
+tests_elementary_efl_ui_suite_CPPFLAGS = \
+ -DTESTS_BUILD_DIR=\"${top_builddir}/src/tests/elementary\" \
+ -DTESTS_SRC_DIR=\"${top_srcdir}/src/tests/elementary\" \
+ -DELM_IMAGE_DATA_DIR=\"${top_srcdir}/data/elementary\" \
+ -DELM_TEST_DATA_DIR=\"${abs_top_builddir}/data/elementary\" \
+ -DPACKAGE_DATA_DIR=\"${abs_top_builddir}/data/elementary\" \
+ -I$(top_srcdir)/src/lib/elementary \
+ -I$(top_builddir)/src/lib/elementary \
+ -I$(top_builddir)/src/tests/elementary \
+ @CHECK_CFLAGS@ \
+ @ELEMENTARY_CFLAGS@
+
+tests_elementary_efl_ui_suite_LDADD = @CHECK_LIBS@ @USE_ELEMENTARY_LIBS@
+tests_elementary_efl_ui_suite_DEPENDENCIES = @USE_ELEMENTARY_INTERNAL_LIBS@ $(top_builddir)/data/elementary/objects/test.edj
endif
if HAVE_ELUA
diff --git a/src/Makefile_Elua.am b/src/Makefile_Elua.am
index bd1da51f90..bc2513f903 100644
--- a/src/Makefile_Elua.am
+++ b/src/Makefile_Elua.am
@@ -54,41 +54,33 @@ ELUA_APPS_DIR = $(abs_top_srcdir)/src/scripts/elua/apps
### Helper for other modules using Elua
include Makefile_Elua_Helper.am
-eluaappsdir = $(datadir)/elua/apps
-
-eluaapps_DATA = \
+endif
+eluaapps_files = \
scripts/elua/apps/lualian.lua \
scripts/elua/apps/gendoc.lua \
scripts/elua/apps/gendoc.sh \
scripts/elua/apps/README-docgen.md
-EXTRA_DIST2 += $(eluaapps_DATA)
+EXTRA_DIST2 += $(eluaapps_files)
-eluadocgendir = $(datadir)/elua/apps/docgen
-
-eluadocgen_DATA = \
+eluadocgen_files = \
scripts/elua/apps/docgen/doctree.lua \
scripts/elua/apps/docgen/keyref.lua \
scripts/elua/apps/docgen/stats.lua \
scripts/elua/apps/docgen/util.lua \
scripts/elua/apps/docgen/writer.lua
-EXTRA_DIST2 += $(eluadocgen_DATA)
-
-eluamodulesdir = $(datadir)/elua/modules
-
-eluamodules_DATA = \
+EXTRA_DIST2 += $(eluadocgen_files)
+eluamodules_files = \
scripts/elua/modules/benchmark.lua \
scripts/elua/modules/getopt.lua \
scripts/elua/modules/lualian.lua \
bindings/luajit/eo.lua \
bindings/luajit/eolian.lua
-EXTRA_DIST2 += $(eluamodules_DATA)
+EXTRA_DIST2 += $(eluamodules_files)
-eluaeinadir = $(eluamodulesdir)/eina
-
-eluaeina_DATA = \
+eluaeina_files = \
bindings/luajit/eina/accessor.lua \
bindings/luajit/eina/counter.lua \
bindings/luajit/eina/file.lua \
@@ -100,18 +92,27 @@ eluaeina_DATA = \
bindings/luajit/eina/tiler.lua \
bindings/luajit/eina/xattr.lua
-EXTRA_DIST2 += $(eluaeina_DATA)
+EXTRA_DIST2 += $(eluaeina_files)
-eluacoredir = $(datadir)/elua/core
-
-eluacore_DATA = \
+eluacore_files = \
scripts/elua/core/gettext.lua \
scripts/elua/core/module.lua \
scripts/elua/core/serializer.lua \
scripts/elua/core/util.lua
-EXTRA_DIST2 += $(eluacore_DATA)
+EXTRA_DIST2 += $(eluacore_files)
+if HAVE_ELUA
+eluaappsdir = $(datadir)/elua/apps
+eluaapps_DATA = $(eluaapps_files)
+eluamodulesdir = $(datadir)/elua/modules
+eluamodules_DATA = $(eluamodules_files)
+eluadocgendir = $(datadir)/elua/apps/docgen
+eluadocgen_DATA = $(eluadocgen_files)
+eluaeinadir = $(eluamodulesdir)/eina
+eluaeina_DATA = $(eluaeina_files)
+eluacoredir = $(datadir)/elua/core
+eluacore_DATA = $(eluacore_files)
if EFL_ENABLE_TESTS
check_PROGRAMS += tests/elua/elua_suite
@@ -145,6 +146,5 @@ tests_elua_elua_suite_DEPENDENCIES = @USE_ELUA_INTERNAL_LIBS@
endif
-EXTRA_DIST2 += tests/elua/data/apps/test.lua
-
endif
+EXTRA_DIST2 += tests/elua/data/apps/test.lua
diff --git a/src/Makefile_Elua_Helper.am b/src/Makefile_Elua_Helper.am
index a204e259fa..fa8782af4b 100644
--- a/src/Makefile_Elua_Helper.am
+++ b/src/Makefile_Elua_Helper.am
@@ -3,6 +3,7 @@ ELUA_GEN = @elua_bin@ lualian
_ELUA_GEN_DEP = @elua_bin@
else
ELUA_GEN = ELUA_EOLIAN_LIBRARY_PATH=$(top_builddir)/src/lib/eolian/.libs \
+ ELUA_EINA_LIBRARY_PATH=$(top_builddir)/src/lib/eina/.libs \
$(top_builddir)/src/bin/elua/elua${EXEEXT} \
-I$(ELUA_BINDINGS_DIR) -C$(ELUA_CORE_DIR) -M$(ELUA_MODULES_DIR) \
-A$(ELUA_APPS_DIR) lualian
diff --git a/src/Makefile_Embryo.am b/src/Makefile_Embryo.am
index c31fb10f1e..f5e187c8f2 100644
--- a/src/Makefile_Embryo.am
+++ b/src/Makefile_Embryo.am
@@ -44,12 +44,15 @@ bin/embryo/embryo_cc_scexpand.c \
bin/embryo/embryo_cc_sclist.c \
bin/embryo/embryo_cc_scvars.c \
bin/embryo/embryo_cc_prefix.c \
-bin/embryo/embryo_cc_prefix.h
+bin/embryo/embryo_cc_prefix.h \
+static_libs/buildsystem/buildsystem.h \
+static_libs/buildsystem/buildsystem_autotools.c
bin_embryo_embryo_cc_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/embryo\" \
+-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \
-DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \
@EMBRYO_CFLAGS@
diff --git a/src/Makefile_Emotion.am b/src/Makefile_Emotion.am
index 8c31f41c62..c1dcd7beba 100644
--- a/src/Makefile_Emotion.am
+++ b/src/Makefile_Emotion.am
@@ -36,13 +36,16 @@ lib/emotion/emotion_private.h \
lib/emotion/emotion_smart.c \
lib/emotion/emotion_webcam.c \
lib/emotion/emotion_modules.c \
-lib/emotion/emotion_main.c
+lib/emotion/emotion_main.c \
+static_libs/buildsystem/buildsystem.h \
+static_libs/buildsystem/buildsystem_autotools.c
lib_emotion_libemotion_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/emotion\" \
-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \
+-DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \
@EMOTION_CFLAGS@
lib_emotion_libemotion_la_LIBADD = @EMOTION_LIBS@
lib_emotion_libemotion_la_DEPENDENCIES = @EMOTION_INTERNAL_LIBS@
diff --git a/src/Makefile_Eo.am b/src/Makefile_Eo.am
index 438fbf222a..7d318d2a5d 100644
--- a/src/Makefile_Eo.am
+++ b/src/Makefile_Eo.am
@@ -18,7 +18,7 @@ lib_LTLIBRARIES += lib/eo/libeo.la \
lib/eo/libeo_dbg.la
installed_eomainheadersdir = $(includedir)/eo-@VMAJ@
-dist_installed_eomainheaders_DATA = lib/eo/Eo.h lib/eo/efl_future.h
+dist_installed_eomainheaders_DATA = lib/eo/Eo.h
nodist_installed_eomainheaders_DATA = \
$(eo_eolian_h)
@@ -31,8 +31,8 @@ lib/eo/eo_base_class.c \
lib/eo/eo_class_class.c \
lib/eo/eo_add_fallback.c \
lib/eo/eo_add_fallback.h \
-lib/eo/eo_private.h \
-lib/eo/efl_future.c
+lib/eo/eo_internal.h \
+lib/eo/eo_private.h
lib_eo_libeo_la_CPPFLAGS = \
-I$(top_builddir)/src/lib/efl \
@@ -148,12 +148,14 @@ tests/eo/suite/eo_test_general.c \
tests/eo/suite/eo_test_value.c \
tests/eo/suite/eo_test_event.c \
tests/eo/suite/eo_test_threaded_calls.c \
-tests/eo/suite/eo_test_init.c
+tests/eo/suite/eo_test_init.c \
+tests/eo/suite/eo_test_lifecycle.c
tests_eo_eo_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/eo\" \
@CHECK_CFLAGS@ \
-@EO_CFLAGS@
+@EO_CFLAGS@ \
+@VALGRIND_CFLAGS@
tests_eo_eo_suite_LDADD = @CHECK_LIBS@ @USE_EO_LIBS@
tests_eo_eo_suite_DEPENDENCIES = @USE_EO_INTERNAL_LIBS@
diff --git a/src/Makefile_Eolian.am b/src/Makefile_Eolian.am
index cd3f824171..2b84287140 100644
--- a/src/Makefile_Eolian.am
+++ b/src/Makefile_Eolian.am
@@ -35,7 +35,8 @@ lib_eolian_libeolian_la_SOURCES = \
lib/eolian/database_expr_api.c \
lib/eolian/database_var.c \
lib/eolian/database_var_api.c \
- lib/eolian/database_validate.c
+ lib/eolian/database_validate.c \
+ lib/eolian/database_check.c
lib_eolian_libeolian_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @EOLIAN_CFLAGS@ \
-DPACKAGE_DATA_DIR=\"$(datadir)/eolian\"
@@ -113,6 +114,7 @@ tests/eolian/eolian_suite
tests_eolian_eolian_suite_SOURCES = \
tests/eolian/eolian_parsing.c \
+tests/eolian/eolian_static.c \
tests/eolian/eolian_generation.c \
tests/eolian/eolian_generated_future.c \
tests/eolian/eolian_suite.c \
@@ -125,6 +127,7 @@ CLEANFILES += tests/eolian/generated_future.eo.h tests/eolian/generated_future.e
tests_eolian_eolian_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl -I$(top_builddir)/src/tests/eolian \
-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/eolian\" \
-DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/eolian\" \
+-DEO_SRC_DIR=\"$(top_srcdir)/src/lib\" \
-DEOLIAN_GEN="\"$(EOLIAN_GEN)\"" \
@CHECK_CFLAGS@ \
@EOLIAN_CFLAGS@ @EO_CFLAGS@
@@ -139,10 +142,11 @@ endif
EXTRA_DIST2 += \
tests/eolian/data/object_impl_ref.c \
tests/eolian/data/object_impl_add_ref.c \
-tests/eolian/data/typedef_ref.c \
-tests/eolian/data/typedef_ref_stub.c \
-tests/eolian/data/struct_ref.c \
-tests/eolian/data/struct_ref_stub.c \
+tests/eolian/data/typedef_ref.h \
+tests/eolian/data/typedef_ref_stub.h \
+tests/eolian/data/struct_ref.h \
+tests/eolian/data/struct_ref_stub.h \
+tests/eolian/data/owning.eo.c \
tests/eolian/data/class_simple_ref.c \
tests/eolian/data/override_ref.c \
tests/eolian/data/class_simple_ref_eo.h \
diff --git a/src/Makefile_Eolian_Cxx.am b/src/Makefile_Eolian_Cxx.am
index d920936f37..405adb4eaa 100644
--- a/src/Makefile_Eolian_Cxx.am
+++ b/src/Makefile_Eolian_Cxx.am
@@ -13,6 +13,7 @@ lib/eolian_cxx/grammar/attribute_conditional.hpp \
lib/eolian_cxx/grammar/attribute_reorder.hpp \
lib/eolian_cxx/grammar/attribute_replace.hpp \
lib/eolian_cxx/grammar/attributes.hpp \
+lib/eolian_cxx/grammar/blacklist.hpp \
lib/eolian_cxx/grammar/base_class_definition.hpp \
lib/eolian_cxx/grammar/case.hpp \
lib/eolian_cxx/grammar/class_declaration.hpp \
@@ -29,6 +30,7 @@ lib/eolian_cxx/grammar/generator.hpp \
lib/eolian_cxx/grammar/header_guards.hpp \
lib/eolian_cxx/grammar/header.hpp \
lib/eolian_cxx/grammar/header_include_directive.hpp \
+lib/eolian_cxx/grammar/html_escaped_string.hpp \
lib/eolian_cxx/grammar/implementation_include_directive.hpp \
lib/eolian_cxx/grammar/impl_header.hpp \
lib/eolian_cxx/grammar/indentation.hpp \
@@ -187,6 +189,7 @@ endif
EXTRA_DIST2 += \
tests/eolian_cxx/simple.eo \
tests/eolian_cxx/generic.eo \
+tests/eolian_cxx/docs.eo \
tests/eolian_cxx/a.eo \
tests/eolian_cxx/b.eo \
tests/eolian_cxx/c.eo \
diff --git a/src/Makefile_Eolian_Js.am b/src/Makefile_Eolian_Js.am
index b0e64de6da..834ea8fd01 100644
--- a/src/Makefile_Eolian_Js.am
+++ b/src/Makefile_Eolian_Js.am
@@ -21,6 +21,9 @@ bin_eolian_js_eolian_js_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
bin_eolian_js_eolian_js_LDADD = @USE_EO_LIBS@ @USE_EOLIAN_LIBS@
bin_eolian_js_eolian_js_DEPENDENCIES = @USE_EO_INTERNAL_LIBS@ @USE_EOLIAN_INTERNAL_LIBS@
+# generate C++ bindings before compiling C++ files for JS binding
+bin/eolian_js/bin_eolian_js_eolian_js-main.$(OBJEXT): $(efl_eolian_cxx_hh) $(efl_eolian_cxx_impl_hh)
+
include Makefile_Eolian_Js_Helper.am
### Unit tests
diff --git a/src/Makefile_Ethumb.am b/src/Makefile_Ethumb.am
index a73e7a9a0f..7e3897447f 100644
--- a/src/Makefile_Ethumb.am
+++ b/src/Makefile_Ethumb.am
@@ -12,13 +12,16 @@ lib/ethumb/Ethumb_Plugin.h \
lib/ethumb/ethumb_private.h \
lib/ethumb/md5.h \
lib/ethumb/ethumb.c \
-lib/ethumb/md5.c
+lib/ethumb/md5.c \
+static_libs/buildsystem/buildsystem.h \
+static_libs/buildsystem/buildsystem_autotools.c
lib_ethumb_libethumb_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/ethumb\" \
-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \
+-DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \
@ETHUMB_CFLAGS@
lib_ethumb_libethumb_la_LIBADD = @ETHUMB_LIBS@
lib_ethumb_libethumb_la_DEPENDENCIES = @ETHUMB_INTERNAL_LIBS@
diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index cf8a6606a3..deab83005d 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -3,10 +3,11 @@
evas_canvas_eolian_pub_files = \
lib/evas/canvas/efl_canvas_object.eo \
- lib/evas/canvas/efl_canvas_object_event_grabber.eo \
+ lib/evas/canvas/efl_canvas_event_grabber.eo \
lib/evas/canvas/efl_canvas_polygon.eo \
lib/evas/canvas/efl_canvas_rectangle.eo \
lib/evas/canvas/efl_canvas_text.eo \
+ lib/evas/canvas/efl_canvas_text_factory.eo \
lib/evas/canvas/efl_canvas_group.eo \
lib/evas/canvas/efl_canvas_image_internal.eo \
lib/evas/canvas/evas_canvas3d_camera.eo\
@@ -18,13 +19,13 @@ evas_canvas_eolian_pub_files = \
lib/evas/canvas/evas_canvas3d_node.eo\
lib/evas/canvas/evas_canvas3d_scene.eo\
lib/evas/canvas/evas_canvas3d_object.eo \
- lib/evas/canvas/efl_canvas_vg.eo \
- lib/evas/canvas/efl_vg.eo \
- lib/evas/canvas/efl_vg_container.eo \
- lib/evas/canvas/efl_vg_shape.eo \
- lib/evas/canvas/efl_vg_gradient.eo \
- lib/evas/canvas/efl_vg_gradient_radial.eo \
- lib/evas/canvas/efl_vg_gradient_linear.eo \
+ lib/evas/canvas/efl_canvas_vg_object.eo \
+ lib/evas/canvas/efl_canvas_vg_node.eo \
+ lib/evas/canvas/efl_canvas_vg_container.eo \
+ lib/evas/canvas/efl_canvas_vg_shape.eo \
+ lib/evas/canvas/efl_canvas_vg_gradient.eo \
+ lib/evas/canvas/efl_canvas_vg_gradient_radial.eo \
+ lib/evas/canvas/efl_canvas_vg_gradient_linear.eo \
lib/evas/canvas/efl_canvas_image.eo \
lib/evas/canvas/efl_canvas_snapshot.eo \
lib/evas/canvas/efl_canvas_proxy.eo \
@@ -42,31 +43,24 @@ evas_canvas_eolian_pub_files = \
lib/evas/canvas/efl_input_hold.eo \
lib/evas/canvas/efl_input_focus.eo \
lib/evas/canvas/efl_gfx_map.eo \
- lib/evas/canvas/efl_animation.eo \
- lib/evas/canvas/efl_animation_alpha.eo \
- lib/evas/canvas/efl_animation_rotate.eo \
- lib/evas/canvas/efl_animation_scale.eo \
- lib/evas/canvas/efl_animation_translate.eo \
- lib/evas/canvas/efl_animation_group.eo \
- lib/evas/canvas/efl_animation_group_parallel.eo \
- lib/evas/canvas/efl_animation_group_sequential.eo \
- lib/evas/canvas/efl_animation_object.eo \
- lib/evas/canvas/efl_animation_object_alpha.eo \
- lib/evas/canvas/efl_animation_object_rotate.eo \
- lib/evas/canvas/efl_animation_object_scale.eo \
- lib/evas/canvas/efl_animation_object_translate.eo \
- lib/evas/canvas/efl_animation_object_group.eo \
- lib/evas/canvas/efl_animation_object_group_parallel.eo \
- lib/evas/canvas/efl_animation_object_group_sequential.eo \
+ lib/evas/canvas/efl_canvas_animation.eo \
+ lib/evas/canvas/efl_canvas_animation_alpha.eo \
+ lib/evas/canvas/efl_canvas_animation_rotate.eo \
+ lib/evas/canvas/efl_canvas_animation_scale.eo \
+ lib/evas/canvas/efl_canvas_animation_translate.eo \
+ lib/evas/canvas/efl_canvas_animation_group.eo \
+ lib/evas/canvas/efl_canvas_animation_group_parallel.eo \
+ lib/evas/canvas/efl_canvas_animation_group_sequential.eo \
+ lib/evas/canvas/efl_canvas_animation_player.eo \
$(NULL)
evas_gesture_eolian_pub_files = \
- lib/evas/gesture/efl_gesture_touch.eo \
- lib/evas/gesture/efl_gesture.eo \
- lib/evas/gesture/efl_gesture_tap.eo \
- lib/evas/gesture/efl_gesture_long_tap.eo \
- lib/evas/gesture/efl_gesture_recognizer.eo \
- lib/evas/gesture/efl_gesture_manager.eo \
+ lib/evas/gesture/efl_canvas_gesture_touch.eo \
+ lib/evas/gesture/efl_canvas_gesture.eo \
+ lib/evas/gesture/efl_canvas_gesture_tap.eo \
+ lib/evas/gesture/efl_canvas_gesture_long_tap.eo \
+ lib/evas/gesture/efl_canvas_gesture_recognizer.eo \
+ lib/evas/gesture/efl_canvas_gesture_manager.eo \
$(NULL)
evas_eolian_legacy_files = \
@@ -84,15 +78,15 @@ evas_canvas_eolian_priv_files = \
lib/evas/include/evas_ector_buffer.eo
evas_gesture_eolian_priv_files = \
- lib/evas/gesture/efl_gesture_recognizer_tap.eo \
- lib/evas/gesture/efl_gesture_recognizer_long_tap.eo
+ lib/evas/gesture/efl_canvas_gesture_recognizer_tap.eo \
+ lib/evas/gesture/efl_canvas_gesture_recognizer_long_tap.eo
evas_canvas_eolian_type_files = \
lib/evas/canvas/evas_canvas3d_types.eot \
- lib/evas/canvas/efl_animation_types.eot
+ lib/evas/canvas/efl_canvas_animation_types.eot
evas_gesture_eolian_type_files = \
- lib/evas/gesture/efl_gesture_types.eot
+ lib/evas/gesture/efl_canvas_gesture_types.eot
evas_canvas_eolian_priv_c = $(evas_canvas_eolian_priv_files:%.eo=%.eo.c)
evas_canvas_eolian_priv_h = $(evas_canvas_eolian_priv_files:%.eo=%.eo.h) \
@@ -178,23 +172,17 @@ lib/evas/canvas/evas_image_private.h \
lib/evas/canvas/evas_polygon_private.h \
lib/evas/canvas/efl_canvas_surface.h \
lib/evas/common3d/primitives/primitive_common.h \
-lib/evas/canvas/efl_animation_private.h \
-lib/evas/canvas/efl_animation_alpha_private.h \
-lib/evas/canvas/efl_animation_rotate_private.h \
-lib/evas/canvas/efl_animation_scale_private.h \
-lib/evas/canvas/efl_animation_translate_private.h \
-lib/evas/canvas/efl_animation_group_private.h \
-lib/evas/canvas/efl_animation_group_parallel_private.h \
-lib/evas/canvas/efl_animation_group_sequential_private.h \
-lib/evas/canvas/efl_animation_object_private.h \
-lib/evas/canvas/efl_animation_object_alpha_private.h \
-lib/evas/canvas/efl_animation_object_rotate_private.h \
-lib/evas/canvas/efl_animation_object_scale_private.h \
-lib/evas/canvas/efl_animation_object_translate_private.h \
-lib/evas/canvas/efl_animation_object_group_private.h \
-lib/evas/canvas/efl_animation_object_group_parallel_private.h \
-lib/evas/canvas/efl_animation_object_group_sequential_private.h \
-lib/evas/gesture/efl_gesture_private.h
+lib/evas/canvas/efl_canvas_animation_private.h \
+lib/evas/canvas/efl_canvas_animation_alpha_private.h \
+lib/evas/canvas/efl_canvas_animation_rotate_private.h \
+lib/evas/canvas/efl_canvas_animation_scale_private.h \
+lib/evas/canvas/efl_canvas_animation_translate_private.h \
+lib/evas/canvas/efl_canvas_animation_group_private.h \
+lib/evas/canvas/efl_canvas_animation_group_parallel_private.h \
+lib/evas/canvas/efl_canvas_animation_group_sequential_private.h \
+lib/evas/canvas/efl_canvas_animation_player_private.h \
+lib/evas/canvas/evas_stack.x \
+lib/evas/gesture/efl_canvas_gesture_private.h
# Linebreak
@@ -257,7 +245,6 @@ lib/evas/canvas/evas_render.c \
lib/evas/canvas/render2/evas_render2.c \
lib/evas/canvas/render2/evas_render2.h \
lib/evas/canvas/evas_smart.c \
-lib/evas/canvas/evas_stack.c \
lib/evas/canvas/evas_async_events.c \
lib/evas/canvas/evas_stats.c \
lib/evas/canvas/evas_touch_point.c \
@@ -266,7 +253,7 @@ lib/evas/canvas/evas_map.h \
lib/evas/canvas/evas_gl.c \
lib/evas/canvas/evas_out.c \
lib/evas/canvas/efl_canvas_image.c \
-lib/evas/canvas/efl_canvas_object_event_grabber.c \
+lib/evas/canvas/efl_canvas_event_grabber.c \
lib/evas/canvas/efl_canvas_proxy.c \
lib/evas/canvas/efl_canvas_snapshot.c \
lib/evas/canvas/efl_canvas_scene3d.c \
@@ -280,30 +267,23 @@ lib/evas/canvas/efl_input_key.c \
lib/evas/canvas/efl_input_pointer.c \
lib/evas/canvas/efl_input_hold.c \
lib/evas/canvas/efl_input_focus.c \
-lib/evas/canvas/efl_animation.c \
-lib/evas/canvas/efl_animation_alpha.c \
-lib/evas/canvas/efl_animation_rotate.c \
-lib/evas/canvas/efl_animation_scale.c \
-lib/evas/canvas/efl_animation_translate.c \
-lib/evas/canvas/efl_animation_group.c \
-lib/evas/canvas/efl_animation_group_parallel.c \
-lib/evas/canvas/efl_animation_group_sequential.c \
-lib/evas/canvas/efl_animation_object.c \
-lib/evas/canvas/efl_animation_object_alpha.c \
-lib/evas/canvas/efl_animation_object_rotate.c \
-lib/evas/canvas/efl_animation_object_scale.c \
-lib/evas/canvas/efl_animation_object_translate.c \
-lib/evas/canvas/efl_animation_object_group.c \
-lib/evas/canvas/efl_animation_object_group_parallel.c \
-lib/evas/canvas/efl_animation_object_group_sequential.c \
-lib/evas/gesture/efl_gesture_touch.c \
-lib/evas/gesture/efl_gesture.c \
-lib/evas/gesture/efl_gesture_tap.c \
-lib/evas/gesture/efl_gesture_long_tap.c \
-lib/evas/gesture/efl_gesture_recognizer.c \
-lib/evas/gesture/efl_gesture_recognizer_tap.c \
-lib/evas/gesture/efl_gesture_recognizer_long_tap.c \
-lib/evas/gesture/efl_gesture_manager.c \
+lib/evas/canvas/efl_canvas_animation.c \
+lib/evas/canvas/efl_canvas_animation_alpha.c \
+lib/evas/canvas/efl_canvas_animation_rotate.c \
+lib/evas/canvas/efl_canvas_animation_scale.c \
+lib/evas/canvas/efl_canvas_animation_translate.c \
+lib/evas/canvas/efl_canvas_animation_group.c \
+lib/evas/canvas/efl_canvas_animation_group_parallel.c \
+lib/evas/canvas/efl_canvas_animation_group_sequential.c \
+lib/evas/canvas/efl_canvas_animation_player.c \
+lib/evas/gesture/efl_canvas_gesture_touch.c \
+lib/evas/gesture/efl_canvas_gesture.c \
+lib/evas/gesture/efl_canvas_gesture_tap.c \
+lib/evas/gesture/efl_canvas_gesture_long_tap.c \
+lib/evas/gesture/efl_canvas_gesture_recognizer.c \
+lib/evas/gesture/efl_canvas_gesture_recognizer_tap.c \
+lib/evas/gesture/efl_canvas_gesture_recognizer_long_tap.c \
+lib/evas/gesture/efl_canvas_gesture_manager.c \
$(NULL)
EXTRA_DIST2 += \
@@ -345,7 +325,9 @@ lib_evas_file_SOURCES = \
lib/evas/file/evas_module.c \
lib/evas/file/evas_module.h \
lib/evas/file/evas_path.c \
-lib/evas/file/evas_path.h
+lib/evas/file/evas_path.h \
+static_libs/buildsystem/buildsystem.h \
+static_libs/buildsystem/buildsystem_autotools.c
lib_evas_libevas_la_SOURCES += \
$(lib_evas_file_SOURCES)
@@ -395,7 +377,7 @@ lib/evas/common3d/primitives/primitive_common.c
# Evas_VG
lib_evas_libevas_la_SOURCES += \
-lib/evas/canvas/efl_canvas_vg.c \
+lib/evas/canvas/efl_canvas_vg_object.c \
lib/evas/canvas/evas_vg_node.c \
lib/evas/canvas/evas_vg_container.c \
lib/evas/canvas/evas_vg_gradient.c \
@@ -518,6 +500,7 @@ lib_evas_libevas_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/evas\" \
-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \
+-DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \
@EVAS_CFLAGS@ \
@VALGRIND_CFLAGS@ \
@NEON_CFLAGS@ \
@@ -1566,6 +1549,7 @@ bin_evas_evas_cserve2_slave_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/evas\" \
-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \
+-DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \
-DEVAS_MODULE_NO_ENGINES=1 \
-DEVAS_MODULE_NO_IMAGE_SAVERS=1 \
-DEVAS_MODULE_NO_VG_LOADERS=1 \
@@ -2450,6 +2434,7 @@ TESTS += tests/evas/evas_suite
tests_evas_evas_suite_SOURCES = \
tests/evas/evas_suite.c \
tests/evas/evas_test_init.c \
+tests/evas/evas_test_new.c \
tests/evas/evas_test_object.c \
tests/evas/evas_test_object_smart.c \
tests/evas/evas_test_textblock.c \
@@ -2540,7 +2525,9 @@ tests/evas/images/bg_gray.png \
tests/evas/images/flower.jp2 \
tests/evas/images/flower.jp2.png \
tests/evas/images/train.j2k \
-tests/evas/images/train.j2k.png
+tests/evas/images/train.j2k.png \
+tests/evas/dicts/hyph_en_US.dic \
+tests/evas/dicts/hyph_de_DE.dic
if HAVE_ELUA
diff --git a/src/Makefile_Evil.am b/src/Makefile_Evil.am
index 6ec4b5113c..7fbe99c79d 100644
--- a/src/Makefile_Evil.am
+++ b/src/Makefile_Evil.am
@@ -21,7 +21,6 @@ lib/evil/evil_string.h \
lib/evil/evil_time.h \
lib/evil/evil_unistd.h \
lib/evil/evil_util.h \
-lib/evil/dirent.h \
lib/evil/fnmatch.h \
lib/evil/pwd.h
@@ -30,14 +29,12 @@ dist_evilmmanheaders_DATA = \
lib/evil/sys/mman.h
lib_evil_libevil_la_SOURCES = \
-lib/evil/evil_dirent.c \
lib/evil/evil_dlfcn.c \
lib/evil/evil_fcntl.c \
lib/evil/evil_fnmatch.c \
lib/evil/evil_fnmatch_list_of_states.c \
lib/evil/evil_langinfo.c \
lib/evil/evil_locale.c \
-lib/evil/evil_link_xp.cpp \
lib/evil/evil_main.c \
lib/evil/evil_mman.c \
lib/evil/evil_pwd.c \
@@ -52,7 +49,6 @@ lib/evil/evil_fnmatch_private.h
lib_evil_libevil_la_CPPFLAGS = @EVIL_CPPFLAGS@
lib_evil_libevil_la_CFLAGS = @EVIL_CFLAGS@ @EVIL_CFLAGS_WRN@ -D__USE_MINGW_ANSI_STDIO
-lib_evil_libevil_la_CXXFLAGS = @EVIL_CXXFLAGS@ @EVIL_CFLAGS@
lib_evil_libevil_la_LIBADD = @EVIL_LIBS@
lib_evil_libevil_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@
@@ -76,40 +72,6 @@ lib_evil_libevil_la_CPPFLAGS += \
-I$(top_srcdir)/src/lib/evil/regex \
-DPOSIX_MISTAKE
-### Binary
-
-bin_PROGRAMS += bin/evil/evil_suite bin/evil/test_evil
-
-bin_evil_evil_suite_SOURCES = \
-bin/evil/evil_suite.c \
-bin/evil/evil_test_dlfcn.c \
-bin/evil/evil_test_environment.c \
-bin/evil/evil_test_gettimeofday.c \
-bin/evil/evil_test_link.c \
-bin/evil/evil_test_mkstemp.c \
-bin/evil/evil_test_pipe.c \
-bin/evil/evil_test_print.c \
-bin/evil/evil_test_realpath.c \
-bin/evil/evil_test_util.c \
-bin/evil/evil_suite.h \
-bin/evil/evil_test_dlfcn.h \
-bin/evil/evil_test_environment.h \
-bin/evil/evil_test_gettimeofday.h \
-bin/evil/evil_test_link.h \
-bin/evil/evil_test_mkstemp.h \
-bin/evil/evil_test_pipe.h \
-bin/evil/evil_test_print.h \
-bin/evil/evil_test_realpath.h \
-bin/evil/evil_test_util.h
-
-bin_evil_evil_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl @EVIL_CFLAGS@
-bin_evil_evil_suite_LDADD = @USE_EVIL_LIBS@ -lm
-bin_evil_evil_suite_DEPENDENCIES = @USE_EVIL_INTERNAL_LIBS@
-
-bin_evil_test_evil_SOURCES = bin/evil/test_evil.c
-bin_evil_test_evil_LDADD = @USE_EVIL_LIBS@
-bin_evil_test_evil_DEPENDENCIES = @USE_EVIL_INTERNAL_LIBS@
-
### Unit tests
if EFL_ENABLE_TESTS
@@ -124,13 +86,14 @@ tests/evil/evil_test_dlfcn.c \
tests/evil/evil_test_libgen.c \
tests/evil/evil_test_main.c \
tests/evil/evil_test_stdio.c \
-tests/evil/evil_test_stdlib.c
+tests/evil/evil_test_stdlib.c \
+tests/evil/evil_test_unistd.c
tests_evil_evil_suite_CPPFLAGS = \
-I$(top_builddir)/src/lib/efl \
-DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/evil\" \
--DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)/src/tests/evil\" \
--DTESTS_BUILD_DIR=PACKAGE_BUILD_DIR \
+-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)/\" \
+-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/evil\" \
@CHECK_CFLAGS@ \
@EVIL_CFLAGS@
tests_evil_evil_suite_LDADD = @USE_EVIL_LIBS@ @CHECK_LIBS@
diff --git a/src/Makefile_efl_wl.am b/src/Makefile_efl_wl.am
index ac3c00db69..d90002e17b 100644
--- a/src/Makefile_efl_wl.am
+++ b/src/Makefile_efl_wl.am
@@ -14,8 +14,8 @@ lib/efl_wl/dmabuf.h
nodist_lib_efl_wl_libefl_wl_la_SOURCES = \
lib/efl_wl/linux-dmabuf-unstable-v1-protocol.c \
lib/efl_wl/linux-dmabuf-unstable-v1-server-protocol.h \
-lib/efl_wl/xdg-shell-unstable-v6-protocol.c \
-lib/efl_wl/xdg-shell-unstable-v6-server-protocol.h \
+lib/efl_wl/xdg-shell-protocol.c \
+lib/efl_wl/xdg-shell-server-protocol.h \
lib/efl_wl/efl-hints-protocol.c \
lib/efl_wl/efl-hints-server-protocol.h
diff --git a/src/benchmarks/eina/Ecore_Data.h b/src/benchmarks/eina/Ecore_Data.h
index e2ea607d16..6641eff267 100644
--- a/src/benchmarks/eina/Ecore_Data.h
+++ b/src/benchmarks/eina/Ecore_Data.h
@@ -10,15 +10,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ECORE_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ECORE_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -29,7 +29,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
/**
* @file Ecore_Data.h
diff --git a/src/benchmarks/eina/Evas_Data.h b/src/benchmarks/eina/Evas_Data.h
index 97848927b0..2c07402b65 100644
--- a/src/benchmarks/eina/Evas_Data.h
+++ b/src/benchmarks/eina/Evas_Data.h
@@ -6,15 +6,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_EVAS_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EVAS_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -25,7 +25,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
/**
* @file
diff --git a/src/benchmarks/eo/eo_bench_callbacks.c b/src/benchmarks/eo/eo_bench_callbacks.c
index 7fd145c31a..7168dabfe0 100644
--- a/src/benchmarks/eo/eo_bench_callbacks.c
+++ b/src/benchmarks/eo/eo_bench_callbacks.c
@@ -16,7 +16,7 @@ static void
bench_eo_callbacks_add(int request)
{
int i;
- Eo *obj = efl_add(SIMPLE_CLASS, NULL);
+ Eo *obj = efl_add_ref(SIMPLE_CLASS, NULL);
for (i = 0 ; i < request ; i++)
{
@@ -52,7 +52,7 @@ bench_eo_callbacks_call(int request)
Eo *obj[len];
for (i = 0 ; i < len ; i++)
{
- obj[i] = efl_add(SIMPLE_CLASS, NULL);
+ obj[i] = efl_add_ref(SIMPLE_CLASS, NULL);
for (j = 0 ; j < i ; j++)
{
diff --git a/src/benchmarks/eo/eo_bench_eo_add.c b/src/benchmarks/eo/eo_bench_eo_add.c
index 7bd10d8109..963cd3abb9 100644
--- a/src/benchmarks/eo/eo_bench_eo_add.c
+++ b/src/benchmarks/eo/eo_bench_eo_add.c
@@ -12,7 +12,7 @@ bench_efl_add_linear(int request)
int i;
Eo **objs = calloc(request, sizeof(Eo *));
for (i = 0 ; i < request ; i++)
- objs[i] = efl_add(SIMPLE_CLASS, NULL);
+ objs[i] = efl_add_ref(SIMPLE_CLASS, NULL);
for (i = 0 ; i < request ; i++)
efl_unref(objs[i]);
@@ -25,13 +25,13 @@ bench_efl_add_jump_by_2(int request)
int i;
Eo **objs = calloc(request, sizeof(Eo *));
for (i = 0 ; i < request ; i++)
- objs[i] = efl_add(SIMPLE_CLASS, NULL);
+ objs[i] = efl_add_ref(SIMPLE_CLASS, NULL);
for (i = 0 ; i < request ; i += 2)
efl_unref(objs[i]);
for (i = 0 ; i < request ; i += 2)
- objs[i] = efl_add(SIMPLE_CLASS, NULL);
+ objs[i] = efl_add_ref(SIMPLE_CLASS, NULL);
for (i = 0 ; i < request ; i++)
efl_unref(objs[i]);
diff --git a/src/benchmarks/eo/eo_bench_eo_do.c b/src/benchmarks/eo/eo_bench_eo_do.c
index ec69bf3145..2783b91b3c 100644
--- a/src/benchmarks/eo/eo_bench_eo_do.c
+++ b/src/benchmarks/eo/eo_bench_eo_do.c
@@ -10,7 +10,7 @@ static void
bench_eo_do_simple(int request)
{
int i;
- Eo *obj = efl_add(SIMPLE_CLASS, NULL);
+ Eo *obj = efl_add_ref(SIMPLE_CLASS, NULL);
for (i = 0 ; i < request ; i++)
{
simple_a_set(obj, i);
@@ -23,8 +23,8 @@ static void
bench_eo_do_two_objs(int request)
{
int i;
- Eo *obj = efl_add(SIMPLE_CLASS, NULL);
- Eo *obj2 = efl_add(SIMPLE_CLASS, NULL);
+ Eo *obj = efl_add_ref(SIMPLE_CLASS, NULL);
+ Eo *obj2 = efl_add_ref(SIMPLE_CLASS, NULL);
for (i = 0 ; i < request ; i++)
{
simple_a_set(obj, i);
@@ -39,8 +39,8 @@ static void
bench_eo_do_two_objs_growing_stack(int request)
{
int i;
- Eo *obj = efl_add(SIMPLE_CLASS, NULL);
- Eo *obj2 = efl_add(SIMPLE_CLASS, NULL);
+ Eo *obj = efl_add_ref(SIMPLE_CLASS, NULL);
+ Eo *obj2 = efl_add_ref(SIMPLE_CLASS, NULL);
for (i = 0 ; i < request ; i++)
{
simple_other_call(obj, obj2, 20);
@@ -83,7 +83,7 @@ bench_eo_do_super(int request)
cur_klass = efl_class_new(&class_desc, SIMPLE_CLASS, NULL);
int i;
- Eo *obj = efl_add(cur_klass, NULL);
+ Eo *obj = efl_add_ref(cur_klass, NULL);
for (i = 0 ; i < request ; i++)
{
simple_a_set(obj, i);
diff --git a/src/bin/edje/edje_cc.c b/src/bin/edje/edje_cc.c
index 64c1e6df18..1551032bc3 100644
--- a/src/bin/edje/edje_cc.c
+++ b/src/bin/edje/edje_cc.c
@@ -6,12 +6,17 @@
#include <locale.h>
#include <limits.h>
#include <sys/stat.h>
+#include <sys/time.h>
+
+#ifdef HAVE_SYS_RESOURCE_H
+# include <sys/resource.h>
+#endif
#include "edje_cc.h"
int _edje_cc_log_dom = -1;
static void main_help(void);
-Eina_Prefix *pfx = NULL;
+Eina_Prefix *pfx = NULL;
Eina_List *snd_dirs = NULL;
Eina_List *mo_dirs = NULL;
Eina_List *vibration_dirs = NULL;
@@ -20,29 +25,33 @@ Eina_List *model_dirs = NULL;
Eina_List *fnt_dirs = NULL;
Eina_List *data_dirs = NULL;
Eina_List *defines = NULL;
-char *file_in = NULL;
-char *tmp_dir = NULL;
-char *file_out = NULL;
-char *watchfile = NULL;
-char *depfile = NULL;
-char *authors = NULL;
-char *license = NULL;
+char *file_in = NULL;
+char *tmp_dir = NULL;
+char *file_out = NULL;
+char *watchfile = NULL;
+char *depfile = NULL;
+char *authors = NULL;
+char *license = NULL;
Eina_List *licenses = NULL;
+Eina_Array *requires;
static const char *progname = NULL;
-int no_lossy = 0;
-int no_comp = 0;
-int no_raw = 0;
-int no_save = 0;
-int min_quality = 0;
-int max_quality = 100;
-int compress_mode = EET_COMPRESSION_HI;
-int threads = 0;
-int annotate = 0;
-int no_etc1 = 0;
-int no_etc2 = 0;
-int beta = 0;
+int no_lossy = 0;
+int no_comp = 0;
+int no_raw = 0;
+int no_save = 0;
+int min_quality = 0;
+int max_quality = 100;
+int compress_mode = EET_COMPRESSION_HI;
+int threads = 0;
+int annotate = 0;
+int no_etc1 = 0;
+int no_etc2 = 0;
+int beta = 0;
+Eina_Bool namespace_verify;
+
+unsigned int max_open_files;
static void
_edje_cc_log_cb(const Eina_Log_Domain *d,
@@ -63,16 +72,19 @@ _edje_cc_log_cb(const Eina_Log_Domain *d,
switch (level)
{
case EINA_LOG_LEVEL_CRITICAL:
- prefix = "Critical. ";
- break;
+ prefix = "Critical. ";
+ break;
+
case EINA_LOG_LEVEL_ERR:
- prefix = "Error. ";
- break;
+ prefix = "Error. ";
+ break;
+
case EINA_LOG_LEVEL_WARN:
- prefix = "Warning. ";
- break;
+ prefix = "Warning. ";
+ break;
+
default:
- prefix = "";
+ prefix = "";
}
fprintf(stderr, "%s: %s", progname, prefix);
eina_log_console_color_set(stderr, EINA_COLOR_RESET);
@@ -119,8 +131,9 @@ main_help(void)
"-fastdecomp Use a faster decompression algorithm (LZ4HC) (mutually exclusive with -fastcomp)\n"
"-threads Compile the edje file using multiple parallel threads (by default)\n"
"-nothreads Compile the edje file using only the main loop\n"
+ "-N Use the first segment of each group name as a namespace to verify parts/signals\n"
"-V [--version] show program version\n"
- ,progname);
+ , progname);
}
int
@@ -135,16 +148,17 @@ main(int argc, char **argv)
setlocale(LC_NUMERIC, "C");
ecore_app_no_system_modules();
+ efreet_cache_disable();
if (!eina_init())
return -1;
_edje_cc_log_dom = eina_log_domain_register
- ("edje_cc", EDJE_CC_DEFAULT_LOG_COLOR);
+ ("edje_cc", EDJE_CC_DEFAULT_LOG_COLOR);
if (_edje_cc_log_dom < 0)
{
- EINA_LOG_ERR("Enable to create a log domain.");
- exit(-1);
+ EINA_LOG_ERR("Enable to create a log domain.");
+ exit(-1);
}
if (!eina_log_domain_level_check(_edje_cc_log_dom, EINA_LOG_LEVEL_WARN))
eina_log_domain_level_set("edje_cc", EINA_LOG_LEVEL_WARN);
@@ -163,27 +177,27 @@ main(int argc, char **argv)
for (i = 1; i < argc; i++)
{
- if (!strcmp(argv[i], "-h"))
- {
- main_help();
- exit(0);
- }
- else if ((!strcmp(argv[i], "-V")) || (!strcmp(argv[i], "--version")))
- {
- printf("Version: %s\n", PACKAGE_VERSION);
- exit(0);
- }
- else if (!strcmp(argv[i], "-v"))
- {
- eina_log_domain_level_set("edje_cc", EINA_LOG_LEVEL_INFO);
- }
- else if (!strcmp(argv[i], "-no-lossy"))
- {
- no_lossy = 1;
- }
- else if (!strcmp(argv[i], "-no-comp"))
- {
- no_comp = 1;
+ if (!strcmp(argv[i], "-h"))
+ {
+ main_help();
+ exit(0);
+ }
+ else if ((!strcmp(argv[i], "-V")) || (!strcmp(argv[i], "--version")))
+ {
+ printf("Version: %s\n", PACKAGE_VERSION);
+ exit(0);
+ }
+ else if (!strcmp(argv[i], "-v"))
+ {
+ eina_log_domain_level_set("edje_cc", EINA_LOG_LEVEL_INFO);
+ }
+ else if (!strcmp(argv[i], "-no-lossy"))
+ {
+ no_lossy = 1;
+ }
+ else if (!strcmp(argv[i], "-no-comp"))
+ {
+ no_comp = 1;
}
else if (!strcmp(argv[i], "-no-raw"))
{
@@ -197,25 +211,25 @@ main(int argc, char **argv)
{
no_etc2 = 1;
}
- else if (!strcmp(argv[i], "-no-save"))
- {
- no_save = 1;
- }
- else if ((!strcmp(argv[i], "-id") || !strcmp(argv[i], "--image_dir")) && (i < (argc - 1)))
- {
- i++;
- img_dirs = eina_list_append(img_dirs, argv[i]);
- }
- else if ((!strcmp(argv[i], "-mod") || !strcmp(argv[i], "--model_dir")) && (i < (argc - 1)))
- {
- i++;
- model_dirs = eina_list_append(model_dirs, argv[i]);
- }
- else if ((!strcmp(argv[i], "-fd") || !strcmp(argv[i], "--font_dir")) && (i < (argc - 1)))
- {
- i++;
- fnt_dirs = eina_list_append(fnt_dirs, argv[i]);
- }
+ else if (!strcmp(argv[i], "-no-save"))
+ {
+ no_save = 1;
+ }
+ else if ((!strcmp(argv[i], "-id") || !strcmp(argv[i], "--image_dir")) && (i < (argc - 1)))
+ {
+ i++;
+ img_dirs = eina_list_append(img_dirs, argv[i]);
+ }
+ else if ((!strcmp(argv[i], "-mod") || !strcmp(argv[i], "--model_dir")) && (i < (argc - 1)))
+ {
+ i++;
+ model_dirs = eina_list_append(model_dirs, argv[i]);
+ }
+ else if ((!strcmp(argv[i], "-fd") || !strcmp(argv[i], "--font_dir")) && (i < (argc - 1)))
+ {
+ i++;
+ fnt_dirs = eina_list_append(fnt_dirs, argv[i]);
+ }
else if ((!strcmp(argv[i], "-sd") || !strcmp(argv[i], "--sound_dir")) && (i < (argc - 1)))
{
i++;
@@ -236,12 +250,12 @@ main(int argc, char **argv)
i++;
data_dirs = eina_list_append(data_dirs, argv[i]);
}
- else if ((!strcmp(argv[i], "-td") || !strcmp(argv[i], "--tmp_dir")) && (i < (argc - 1)))
- {
- i++;
+ else if ((!strcmp(argv[i], "-td") || !strcmp(argv[i], "--tmp_dir")) && (i < (argc - 1)))
+ {
+ i++;
if (!tmp_dir)
tmp_dir = argv[i];
- }
+ }
else if ((!strcmp(argv[i], "-l") || !strcmp(argv[i], "--license")) && (i < (argc - 1)))
{
i++;
@@ -256,88 +270,92 @@ main(int argc, char **argv)
if (!authors)
authors = argv[i];
}
- else if ((!strcmp(argv[i], "-min-quality")) && (i < (argc - 1)))
- {
- i++;
- min_quality = atoi(argv[i]);
- if (min_quality < 0) min_quality = 0;
- if (min_quality > 100) min_quality = 100;
- }
- else if ((!strcmp(argv[i], "-max-quality")) && (i < (argc - 1)))
- {
- i++;
- max_quality = atoi(argv[i]);
- if (max_quality < 0) max_quality = 0;
- if (max_quality > 100) max_quality = 100;
- }
- else if (!strcmp(argv[i], "-fastcomp"))
- {
+ else if ((!strcmp(argv[i], "-min-quality")) && (i < (argc - 1)))
+ {
+ i++;
+ min_quality = atoi(argv[i]);
+ if (min_quality < 0) min_quality = 0;
+ if (min_quality > 100) min_quality = 100;
+ }
+ else if ((!strcmp(argv[i], "-max-quality")) && (i < (argc - 1)))
+ {
+ i++;
+ max_quality = atoi(argv[i]);
+ if (max_quality < 0) max_quality = 0;
+ if (max_quality > 100) max_quality = 100;
+ }
+ else if (!strcmp(argv[i], "-fastcomp"))
+ {
compress_mode = EET_COMPRESSION_SUPERFAST;
- }
- else if (!strcmp(argv[i], "-fastdecomp"))
- {
+ }
+ else if (!strcmp(argv[i], "-fastdecomp"))
+ {
compress_mode = EET_COMPRESSION_VERYFAST;
- }
- else if (!strcmp(argv[i], "-threads"))
- {
+ }
+ else if (!strcmp(argv[i], "-threads"))
+ {
threads = 1;
- }
- else if (!strcmp(argv[i], "-nothreads"))
- {
+ }
+ else if (!strcmp(argv[i], "-nothreads"))
+ {
threads = 0;
- }
- else if (!strncmp(argv[i], "-D", 2))
- {
- defines = eina_list_append(defines, mem_strdup(argv[i]));
- }
- else if ((!strcmp(argv[i], "-o")) && (i < (argc - 1)))
- {
- i++;
- file_out = argv[i];
- }
- else if ((!strcmp(argv[i], "-w")) && (i < (argc - 1)))
- {
+ }
+ else if (!strncmp(argv[i], "-D", 2))
+ {
+ defines = eina_list_append(defines, mem_strdup(argv[i]));
+ }
+ else if ((!strcmp(argv[i], "-o")) && (i < (argc - 1)))
+ {
+ i++;
+ file_out = argv[i];
+ }
+ else if ((!strcmp(argv[i], "-w")) && (i < (argc - 1)))
+ {
i++;
watchfile = argv[i];
unlink(watchfile);
- }
- else if (!strcmp(argv[i], "-annotate"))
- {
+ }
+ else if (!strcmp(argv[i], "-annotate"))
+ {
annotate = 1;
}
- else if ((!strcmp(argv[i], "-deps")) && (i < (argc - 1)))
- {
- i++;
- depfile = argv[i];
- unlink(depfile);
- }
+ else if ((!strcmp(argv[i], "-deps")) && (i < (argc - 1)))
+ {
+ i++;
+ depfile = argv[i];
+ unlink(depfile);
+ }
else if (!strcmp(argv[i], "-beta"))
{
beta = 1;
}
- else if (!file_in)
- file_in = argv[i];
- else if (!file_out)
- file_out = argv[i];
+ else if (!strcmp(argv[i], "-N"))
+ {
+ namespace_verify = 1;
+ }
+ else if (!file_in)
+ file_in = argv[i];
+ else if (!file_out)
+ file_out = argv[i];
}
if (!file_in)
{
- ERR("no input file specified.");
- main_help();
- exit(-1);
+ ERR("no input file specified.");
+ main_help();
+ exit(-1);
}
- pfx = eina_prefix_new(argv[0], /* argv[0] value (optional) */
- main, /* an optional symbol to check path of */
- "EDJE", /* env var prefix to use (XXX_PREFIX, XXX_BIN_DIR etc. */
- "edje", /* dir to add after "share" (PREFIX/share/DIRNAME) */
+ pfx = eina_prefix_new(argv[0], /* argv[0] value (optional) */
+ main, /* an optional symbol to check path of */
+ "EDJE", /* env var prefix to use (XXX_PREFIX, XXX_BIN_DIR etc. */
+ "edje", /* dir to add after "share" (PREFIX/share/DIRNAME) */
"include/edje.inc", /* a magic file to check for in PREFIX/share/DIRNAME for success */
PACKAGE_BIN_DIR, /* package bin dir @ compile time */
PACKAGE_LIB_DIR, /* package lib dir @ compile time */
PACKAGE_DATA_DIR, /* package data dir @ compile time */
PACKAGE_DATA_DIR /* if locale needed use LOCALE_DIR */
- );
+ );
/* check whether file_in exists */
#ifdef HAVE_REALPATH
@@ -346,41 +364,41 @@ main(int argc, char **argv)
if (stat(file_in, &st) || !S_ISREG(st.st_mode))
#endif
{
- ERR("file not found: %s.", file_in);
- main_help();
- exit(-1);
+ ERR("file not found: %s.", file_in);
+ main_help();
+ exit(-1);
}
if (!file_out)
- {
- char *suffix;
-
- if ((suffix = strstr(file_in,".edc")) && (suffix[4] == 0))
- {
- file_out = strdup(file_in);
- if (file_out)
- {
- suffix = strstr(file_out,".edc");
- strcpy(suffix,".edj");
- }
- }
- }
+ {
+ char *suffix;
+
+ if ((suffix = strstr(file_in, ".edc")) && (suffix[4] == 0))
+ {
+ file_out = strdup(file_in);
+ if (file_out)
+ {
+ suffix = strstr(file_out, ".edc");
+ strcpy(suffix, ".edj");
+ }
+ }
+ }
if (!file_out)
{
- ERR("no output file specified.");
- main_help();
- exit(-1);
+ ERR("no output file specified.");
+ main_help();
+ exit(-1);
}
#ifdef HAVE_REALPATH
- if (realpath(file_out, rpath2) && !strcmp (rpath, rpath2))
+ if (realpath(file_out, rpath2) && !strcmp(rpath, rpath2))
#else
- if (!strcmp (file_in, file_out))
+ if (!strcmp(file_in, file_out))
#endif
{
- ERR("input file equals output file.");
- main_help();
- exit(-1);
+ ERR("input file equals output file.");
+ main_help();
+ exit(-1);
}
using_file(file_in, 'E');
@@ -394,10 +412,10 @@ main(int argc, char **argv)
edje_file->version = EDJE_FILE_VERSION;
edje_file->minor = EDJE_FILE_MINOR;
edje_file->feature_ver = 1; /* increment this every time we add a field
- * or feature to the edje file format that
- * does not load nicely as a NULL or 0 value
- * and needs a special fallback initialization
- */
+ * or feature to the edje file format that
+ * does not load nicely as a NULL or 0 value
+ * and needs a special fallback initialization
+ */
/* efl_version is used for specify efl's version
* which was used for developing a edje file.
* It is useful if Edje(or other EFL libs) need to keep
@@ -408,6 +426,19 @@ main(int argc, char **argv)
edje_file->efl_version.major = 1;
edje_file->efl_version.minor = 18;
edje_file->base_scale = FROM_INT(1);
+ requires = eina_array_new(10);
+
+#ifdef HAVE_SYS_RESOURCE_H
+ {
+ struct rlimit lim;
+ if (getrlimit(RLIMIT_NOFILE, &lim))
+ fprintf(stderr, "error getting max open file limit: %s\n", strerror(errno));
+ max_open_files = lim.rlim_cur;
+ }
+#else
+ max_open_files = 1024;
+#endif
+ ecore_evas_init();
source_edd();
source_fetch();
@@ -422,10 +453,11 @@ main(int argc, char **argv)
eina_prefix_free(pfx);
pfx = NULL;
-
+
edje_shutdown();
eina_log_domain_unregister(_edje_cc_log_dom);
eina_shutdown();
return 0;
}
+
diff --git a/src/bin/edje/edje_cc.h b/src/bin/edje/edje_cc.h
index 55c151b02a..afb7a99c03 100644
--- a/src/bin/edje/edje_cc.h
+++ b/src/bin/edje/edje_cc.h
@@ -167,6 +167,7 @@ struct _Edje_Part_Collection_Parser
Eina_Bool default_mouse_events;
Eina_Bool inherit_only;
Eina_Bool inherit_script : 1;
+ Eina_Bool skip_namespace_validation : 1;
};
typedef enum
@@ -354,4 +355,7 @@ extern int beta;
extern int had_quote;
+extern unsigned int max_open_files;
+extern Eina_Array *requires;
+extern Eina_Bool namespace_verify;
#endif
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index c32609b1df..17b3ce3768 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -7,24 +7,24 @@
this means that missing one or changing the order most certainly cause
formatting errors.
- \@block
+ \@block
block name
- \@context
+ \@context
code sample of the block
- \@description
+ \@description
the block's description
- \@since X.X
- \@endblock
+ \@since X.X
+ \@endblock
- \@property
+ \@property
property name
- \@parameters
+ \@parameters
property's parameter list
- \@effect
+ \@effect
the property description (lol)
- \@since X.X
- \@endproperty
-*/
+ \@since X.X
+ \@endproperty
+ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -174,856 +174,889 @@ Eina_List *po_files;
static Eina_Hash *desc_hash = NULL;
-struct _Edje_Cc_Handlers_Hierarchy_Info
-{ /* Struct that keeps globals value to impl hierarchy */
+struct _Edje_Cc_Handlers_Hierarchy_Info /* Struct that keeps globals value to impl hierarchy */
+{
Edje_Part_Collection_Directory_Entry *current_de;
- Edje_Part *current_part;
- Edje_Pack_Element *current_item;
- Edje_Part_Description_Common *current_desc;
- Edje_Part_Description_Common *parent_desc;
- Edje_Program *current_program;
- Edje_Part *ep;
+ Edje_Part *current_part;
+ Edje_Pack_Element *current_item;
+ Edje_Part_Description_Common *current_desc;
+ Edje_Part_Description_Common *parent_desc;
+ Edje_Program *current_program;
+ Edje_Part *ep;
};
typedef struct _Edje_Cc_Handlers_Hierarchy_Info Edje_Cc_Handlers_Hierarchy_Info;
static Eina_Array *part_hierarchy = NULL; /* stack parts,support nested parts */
-static void edje_cc_handlers_hierarchy_set(Edje_Part *src);
+static void edje_cc_handlers_hierarchy_set(Edje_Part *src);
static Edje_Part *edje_cc_handlers_hierarchy_parent_get(void);
-static void edje_cc_handlers_hierarchy_push(Edje_Part *ep, Edje_Part *cp);
-static void edje_cc_handlers_hierarchy_rename(Edje_Part *old, Edje_Part *new);
-static void edje_cc_handlers_hierarchy_pop(void);
-
-static void _program_target_add(char *name);
-static void _program_after(const char *name);
-static void _program_free(Edje_Program *pr);
-static Eina_Bool _program_remove(const char *name, Edje_Program **pgrms, unsigned int count);
-
-static void * _part_free(Edje_Part_Collection *pc, Edje_Part *ep);
-
-static void check_has_anchors(void);
-
-static void st_efl_version(void);
-static void st_externals_external(void);
-
-static void st_images_image(void);
-static void ob_images_set(void);
-static void st_images_set_name(void);
-static void ob_images_set_image(void);
-static void st_images_set_image_image(void);
-static void st_images_set_image_size(void);
-static void st_images_set_image_border(void);
-static void st_images_set_image_border_scale_by(void);
-
-static void st_models_model(void);
-
-static void st_fonts_font(void);
-
-static void st_data_item(void);
-static void st_data_file(void);
-
-static void ob_styles_style(void);
-static void st_styles_style_name(void);
-static void st_styles_style_base(void);
-static void st_styles_style_tag(void);
-
-static void ob_color_tree(void);
-
-static void ob_color_class(void);
-static void st_color_class_name(void);
-static void st_color_class_color(void);
-static void st_color_class_color2(void);
-static void st_color_class_color3(void);
-static void st_color_class_desc(void);
-
-static void ob_text_class(void);
-static void st_text_class_name(void);
-static void st_text_class_font(void);
-static void st_text_class_size(void);
-
-static void ob_size_class(void);
-static void st_size_class_name(void);
-static void st_size_class_min(void);
-static void st_size_class_max(void);
-
-static void ob_filters_filter(void);
-static void ob_filters_filter_script(void);
-static void st_filters_filter_file(void);
-static void st_filters_filter_name(void);
-
-static void ob_collections(void);
-static void st_collections_base_scale(void);
-
-static void ob_collections_group(void);
-static void st_collections_group_name(void);
-static void st_collections_group_inherit_only(void);
-static void st_collections_group_inherit(void);
-static void st_collections_group_program_source(void);
-static void st_collections_group_part_remove(void);
-static void st_collections_group_program_remove(void);
-static void st_collections_group_lua_script_only(void);
-static void st_collections_group_script_recursion(void);
-static void st_collections_group_alias(void);
-static void st_collections_group_min(void);
-static void st_collections_group_max(void);
-static void st_collections_group_scene_size(void);
-static void st_collections_group_broadcast_signal(void);
-static void st_collections_group_data_item(void);
-static void st_collections_group_orientation(void);
-static void st_collections_group_mouse_events(void);
-static void st_collections_group_use_custom_seat_names(void);
-static void st_collections_group_inherit_script(void);
-
-static void st_collections_group_limits_vertical(void);
-static void st_collections_group_limits_horizontal(void);
-
-static void ob_collections_group_script(void);
-static void ob_collections_group_lua_script(void);
-
-static void st_collections_group_parts_alias(void);
+static void edje_cc_handlers_hierarchy_push(Edje_Part *ep, Edje_Part *cp);
+static void edje_cc_handlers_hierarchy_rename(Edje_Part *old, Edje_Part *new);
+static void edje_cc_handlers_hierarchy_pop(void);
+
+static void _program_target_add(char *name);
+static void _program_after(const char *name);
+static void _program_free(Edje_Program *pr);
+static Eina_Bool _program_remove(const char *name, Edje_Program **pgrms, unsigned int count);
+
+static void *_part_free(Edje_Part_Collection *pc, Edje_Part *ep);
+
+static void check_has_anchors(void);
+
+static void st_id(void);
+static void st_requires(void);
+static void st_efl_version(void);
+static void st_externals_external(void);
+
+static void st_images_image(void);
+static void ob_images_set(void);
+static void st_images_set_name(void);
+static void ob_images_set_image(void);
+static void st_images_set_image_image(void);
+static void st_images_set_image_size(void);
+static void st_images_set_image_border(void);
+static void st_images_set_image_border_scale_by(void);
+
+static void st_models_model(void);
+
+static void st_fonts_font(void);
+
+static void st_data_item(void);
+static void st_data_file(void);
+
+static void ob_styles_style(void);
+static void st_styles_style_name(void);
+static void st_styles_style_base(void);
+static void st_styles_style_tag(void);
+
+static void ob_color_tree(void);
+
+static void ob_color_class(void);
+static void st_color_class_name(void);
+static void st_color_class_color(void);
+static void st_color_class_color2(void);
+static void st_color_class_color3(void);
+static void st_color_class_desc(void);
+
+static void ob_text_class(void);
+static void st_text_class_name(void);
+static void st_text_class_font(void);
+static void st_text_class_size(void);
+
+static void ob_size_class(void);
+static void st_size_class_name(void);
+static void st_size_class_min(void);
+static void st_size_class_max(void);
+
+static void ob_filters_filter(void);
+static void ob_filters_filter_script(void);
+static void st_filters_filter_file(void);
+static void st_filters_filter_name(void);
+
+static void ob_collections(void);
+static void st_collections_base_scale(void);
+
+static void ob_collections_group(void);
+static void st_collections_group_name(void);
+static void st_collections_group_skip_namespace_validation(void);
+static void st_collections_group_inherit_only(void);
+static void st_collections_group_inherit(void);
+static void st_collections_group_program_source(void);
+static void st_collections_group_part_remove(void);
+static void st_collections_group_program_remove(void);
+static void st_collections_group_lua_script_only(void);
+static void st_collections_group_script_recursion(void);
+static void st_collections_group_alias(void);
+static void st_collections_group_min(void);
+static void st_collections_group_max(void);
+static void st_collections_group_scene_size(void);
+static void st_collections_group_broadcast_signal(void);
+static void st_collections_group_data_item(void);
+static void st_collections_group_orientation(void);
+static void st_collections_group_mouse_events(void);
+static void st_collections_group_use_custom_seat_names(void);
+static void st_collections_group_inherit_script(void);
+
+static void st_collections_group_limits_vertical(void);
+static void st_collections_group_limits_horizontal(void);
+
+static void ob_collections_group_script(void);
+static void ob_collections_group_lua_script(void);
+
+static void st_collections_group_parts_alias(void);
static Edje_Part *edje_cc_handlers_part_make(int);
-static void ob_collections_group_parts_part(void);
-static void st_collections_group_parts_part_name(void);
-static void st_collections_group_parts_part_inherit(void);
-static void st_collections_group_parts_part_type(void);
+static void ob_collections_group_parts_part(void);
+static void st_collections_group_parts_part_name(void);
+static void st_collections_group_parts_part_inherit(void);
+static void st_collections_group_parts_part_type(void);
#ifdef HAVE_EPHYSICS
-static void st_collections_group_parts_part_physics_body(void);
+static void st_collections_group_parts_part_physics_body(void);
#endif
-static void st_collections_group_parts_part_insert_before(void);
-static void st_collections_group_parts_part_insert_after(void);
-static void st_collections_group_parts_part_effect(void);
-static void st_collections_group_parts_part_mouse_events(void);
-static void st_collections_group_parts_part_anti_alias(void);
-static void st_collections_group_parts_part_repeat_events(void);
-static void st_collections_group_parts_part_ignore_flags(void);
-static void st_collections_group_parts_part_mask_flags(void);
-static void st_collections_group_parts_part_scale(void);
-static void st_collections_group_parts_part_pointer_mode(void);
-static void st_collections_group_parts_part_precise_is_inside(void);
-static void st_collections_group_parts_part_use_alternate_font_metrics(void);
-static void st_collections_group_parts_part_clip_to_id(void);
-static void st_collections_group_parts_part_render(void);
-static void st_collections_group_parts_part_no_render(void);
-static void st_collections_group_parts_part_required(void);
-static void st_collections_group_parts_part_norequired(void);
-static void st_collections_group_parts_part_source(void);
-static void st_collections_group_parts_part_source2(void);
-static void st_collections_group_parts_part_source3(void);
-static void st_collections_group_parts_part_source4(void);
-static void st_collections_group_parts_part_source5(void);
-static void st_collections_group_parts_part_source6(void);
-static void st_collections_group_parts_part_entry_mode(void);
-static void st_collections_group_parts_part_select_mode(void);
-static void st_collections_group_parts_part_cursor_mode(void);
-static void st_collections_group_parts_part_multiline(void);
-static void st_collections_group_parts_part_access(void);
-static void st_collections_group_parts_part_dragable_x(void);
-static void st_collections_group_parts_part_dragable_y(void);
-static void st_collections_group_parts_part_dragable_confine(void);
-static void st_collections_group_parts_part_dragable_threshold(void);
-static void st_collections_group_parts_part_dragable_events(void);
-static void st_collections_group_parts_part_allowed_seats(void);
+static void st_collections_group_parts_part_insert_before(void);
+static void st_collections_group_parts_part_insert_after(void);
+static void st_collections_group_parts_part_effect(void);
+static void st_collections_group_parts_part_mouse_events(void);
+static void st_collections_group_parts_part_anti_alias(void);
+static void st_collections_group_parts_part_repeat_events(void);
+static void st_collections_group_parts_part_ignore_flags(void);
+static void st_collections_group_parts_part_mask_flags(void);
+static void st_collections_group_parts_part_scale(void);
+static void st_collections_group_parts_part_pointer_mode(void);
+static void st_collections_group_parts_part_precise_is_inside(void);
+static void st_collections_group_parts_part_use_alternate_font_metrics(void);
+static void st_collections_group_parts_part_clip_to_id(void);
+static void st_collections_group_parts_part_render(void);
+static void st_collections_group_parts_part_no_render(void);
+static void st_collections_group_parts_part_required(void);
+static void st_collections_group_parts_part_norequired(void);
+static void st_collections_group_parts_part_source(void);
+static void st_collections_group_parts_part_source2(void);
+static void st_collections_group_parts_part_source3(void);
+static void st_collections_group_parts_part_source4(void);
+static void st_collections_group_parts_part_source5(void);
+static void st_collections_group_parts_part_source6(void);
+static void st_collections_group_parts_part_entry_mode(void);
+static void st_collections_group_parts_part_select_mode(void);
+static void st_collections_group_parts_part_cursor_mode(void);
+static void st_collections_group_parts_part_multiline(void);
+static void st_collections_group_parts_part_access(void);
+static void st_collections_group_parts_part_dragable_x(void);
+static void st_collections_group_parts_part_dragable_y(void);
+static void st_collections_group_parts_part_dragable_confine(void);
+static void st_collections_group_parts_part_dragable_threshold(void);
+static void st_collections_group_parts_part_dragable_events(void);
+static void st_collections_group_parts_part_allowed_seats(void);
/* box and table items share these */
-static void ob_collections_group_parts_part_box_items_item(void);
-static void st_collections_group_parts_part_box_items_item_type(void);
-static void st_collections_group_parts_part_box_items_item_name(void);
-static void st_collections_group_parts_part_box_items_item_source(void);
-static void st_collections_group_parts_part_box_items_item_min(void);
-static void st_collections_group_parts_part_box_items_item_spread(void);
-static void st_collections_group_parts_part_box_items_item_prefer(void);
-static void st_collections_group_parts_part_box_items_item_max(void);
-static void st_collections_group_parts_part_box_items_item_padding(void);
-static void st_collections_group_parts_part_box_items_item_align(void);
-static void st_collections_group_parts_part_box_items_item_weight(void);
-static void st_collections_group_parts_part_box_items_item_aspect(void);
-static void st_collections_group_parts_part_box_items_item_aspect_mode(void);
-static void st_collections_group_parts_part_box_items_item_options(void);
+static void ob_collections_group_parts_part_box_items_item(void);
+static void st_collections_group_parts_part_box_items_item_type(void);
+static void st_collections_group_parts_part_box_items_item_name(void);
+static void st_collections_group_parts_part_box_items_item_source(void);
+static void st_collections_group_parts_part_box_items_item_min(void);
+static void st_collections_group_parts_part_box_items_item_spread(void);
+static void st_collections_group_parts_part_box_items_item_prefer(void);
+static void st_collections_group_parts_part_box_items_item_max(void);
+static void st_collections_group_parts_part_box_items_item_padding(void);
+static void st_collections_group_parts_part_box_items_item_align(void);
+static void st_collections_group_parts_part_box_items_item_weight(void);
+static void st_collections_group_parts_part_box_items_item_aspect(void);
+static void st_collections_group_parts_part_box_items_item_aspect_mode(void);
+static void st_collections_group_parts_part_box_items_item_options(void);
/* but these are only for table */
-static void st_collections_group_parts_part_table_items_item_position(void);
-static void st_collections_group_parts_part_table_items_item_span(void);
-
-static void ob_collections_group_parts_part_description(void);
-static void ob_collections_group_parts_part_desc(void);
-static void st_collections_group_parts_part_description_inherit(void);
-static void ob_collections_group_parts_part_description_link(void);
-static void st_collections_group_parts_part_description_link_base(void);
-static void st_collections_group_parts_part_description_source(void);
-static void st_collections_group_parts_part_description_state(void);
-static void st_collections_group_parts_part_description_visible(void);
-static void st_collections_group_parts_part_description_no_render(void);
-static void st_collections_group_parts_part_description_limit(void);
-static void st_collections_group_parts_part_description_align(void);
-static void st_collections_group_parts_part_description_fixed(void);
-static void st_collections_group_parts_part_description_min(void);
-static void st_collections_group_parts_part_description_minmul(void);
-static void st_collections_group_parts_part_description_max(void);
-static void st_collections_group_parts_part_description_step(void);
-static void st_collections_group_parts_part_description_aspect(void);
-static void st_collections_group_parts_part_description_aspect_preference(void);
-static void st_collections_group_parts_part_description_rel_to(void);
-static void st_collections_group_parts_part_description_rel_to_x(void);
-static void st_collections_group_parts_part_description_rel_to_y(void);
-static void st_collections_group_parts_part_description_rel1_relative(void);
-static void st_collections_group_parts_part_description_rel1_offset(void);
-static void st_collections_group_parts_part_description_rel1_to_set(const char *name);
-static void st_collections_group_parts_part_description_rel1_to(void);
-static void st_collections_group_parts_part_description_rel1_to_x(void);
-static void st_collections_group_parts_part_description_rel1_to_y(void);
-static void st_collections_group_parts_part_description_rel2_relative(void);
-static void st_collections_group_parts_part_description_rel2_offset(void);
-static void st_collections_group_parts_part_description_rel2_to_set(const char *name);
-static void st_collections_group_parts_part_description_rel2_to(void);
-static void st_collections_group_parts_part_description_rel2_to_x(void);
-static void st_collections_group_parts_part_description_rel2_to_y(void);
-static void st_collections_group_parts_part_description_anchors_top(void);
-static void st_collections_group_parts_part_description_anchors_bottom(void);
-static void st_collections_group_parts_part_description_anchors_left(void);
-static void st_collections_group_parts_part_description_anchors_right(void);
-static void st_collections_group_parts_part_description_anchors_vertical_center(void);
-static void st_collections_group_parts_part_description_anchors_horizontal_center(void);
-static void st_collections_group_parts_part_description_anchors_fill(void);
-static void st_collections_group_parts_part_description_anchors_margin(void);
-static void st_collections_group_parts_part_description_clip_to_id(void);
-static void st_collections_group_parts_part_description_size_class(void);
-static void st_collections_group_parts_part_description_image_normal(void);
-static void st_collections_group_parts_part_description_image_tween(void);
-static void st_collections_group_parts_part_description_image_border(void);
-static void st_collections_group_parts_part_description_image_middle(void);
-static void st_collections_group_parts_part_description_image_border_scale(void);
-static void st_collections_group_parts_part_description_image_border_scale_by(void);
-static void st_collections_group_parts_part_description_image_scale_hint(void);
-static void st_collections_group_parts_part_description_fill_smooth(void);
-static void st_collections_group_parts_part_description_fill_origin_relative(void);
-static void st_collections_group_parts_part_description_fill_origin_offset(void);
-static void st_collections_group_parts_part_description_fill_size_relative(void);
-static void st_collections_group_parts_part_description_fill_size_offset(void);
-static void st_collections_group_parts_part_description_fill_type(void);
-static void st_collections_group_parts_part_description_color_class(void);
-static void st_collections_group_parts_part_description_color(void);
-static void st_collections_group_parts_part_description_color2(void);
-static void st_collections_group_parts_part_description_color3(void);
-static void st_collections_group_parts_part_description_text_text(void);
-static void st_collections_group_parts_part_description_text_domain(void);
-static void st_collections_group_parts_part_description_text_text_class(void);
-static void st_collections_group_parts_part_description_text_font(void);
-static void st_collections_group_parts_part_description_text_style(void);
-static void st_collections_group_parts_part_description_text_repch(void);
-static void st_collections_group_parts_part_description_text_size(void);
-static void st_collections_group_parts_part_description_text_size_range(void);
-static void st_collections_group_parts_part_description_text_fit(void);
-static void st_collections_group_parts_part_description_text_min(void);
-static void st_collections_group_parts_part_description_text_max(void);
-static void st_collections_group_parts_part_description_text_align(void);
-static void st_collections_group_parts_part_description_text_source(void);
-static void st_collections_group_parts_part_description_text_text_source(void);
-static void st_collections_group_parts_part_description_text_ellipsis(void);
-static void st_collections_group_parts_part_description_box_layout(void);
-static void st_collections_group_parts_part_description_box_align(void);
-static void st_collections_group_parts_part_description_box_padding(void);
-static void st_collections_group_parts_part_description_box_min(void);
-static void st_collections_group_parts_part_description_table_homogeneous(void);
-static void st_collections_group_parts_part_description_table_align(void);
-static void st_collections_group_parts_part_description_table_padding(void);
-static void st_collections_group_parts_part_description_table_min(void);
-static void st_collections_group_parts_part_description_proxy_source_visible(void);
-static void st_collections_group_parts_part_description_proxy_source_clip(void);
-static void st_collections_group_parts_part_description_position_point(void);
-static void st_collections_group_parts_part_description_position_space(void);
-static void st_collections_group_parts_part_description_camera_properties(void);
-static void st_collections_group_parts_part_description_properties_ambient(void);
-static void st_collections_group_parts_part_description_properties_diffuse(void);
-static void st_collections_group_parts_part_description_properties_specular(void);
-static void st_collections_group_parts_part_description_properties_material(void);
-static void st_collections_group_parts_part_description_properties_normal(void);
-static void st_collections_group_parts_part_description_properties_shininess(void);
-static void st_collections_group_parts_part_description_properties_shade(void);
-static void st_collections_group_parts_part_description_orientation_angle_axis(void);
-static void st_collections_group_parts_part_description_orientation_look1(void);
-static void st_collections_group_parts_part_description_orientation_look2(void);
-static void st_collections_group_parts_part_description_orientation_look_to(void);
-static void st_collections_group_parts_part_description_orientation_angle_axis(void);
-static void st_collections_group_parts_part_description_orientation_quaternion(void);
-static void st_collections_group_parts_part_description_scale(void);
-static void st_collections_group_parts_part_description_offset_scale(void);
-static void st_collections_group_parts_part_description_mesh_primitive(void);
-static void ob_collections_group_parts_part_description_texture(void);
-static void st_collections_group_parts_part_description_texture_image(void);
-static void st_collections_group_parts_part_description_texture_wrap1(void);
-static void st_collections_group_parts_part_description_texture_wrap2(void);
-static void st_collections_group_parts_part_description_texture_filter1(void);
-static void st_collections_group_parts_part_description_texture_filter2(void);
-static void st_collections_group_parts_part_description_mesh_assembly(void);
-static void st_collections_group_parts_part_description_mesh_geometry(void);
-static void st_collections_group_parts_part_description_mesh_frame(void);
-static void st_collections_group_parts_part_description_filter_code(void);
-static void st_collections_group_parts_part_description_filter_source(void);
-static void st_collections_group_parts_part_description_filter_data(void);
+static void st_collections_group_parts_part_table_items_item_position(void);
+static void st_collections_group_parts_part_table_items_item_span(void);
+
+static void ob_collections_group_parts_part_description(void);
+static void ob_collections_group_parts_part_desc(void);
+static void st_collections_group_parts_part_description_inherit(void);
+static void ob_collections_group_parts_part_description_link(void);
+static void st_collections_group_parts_part_description_link_base(void);
+static void st_collections_group_parts_part_description_source(void);
+static void st_collections_group_parts_part_description_state(void);
+static void st_collections_group_parts_part_description_visible(void);
+static void st_collections_group_parts_part_description_no_render(void);
+static void st_collections_group_parts_part_description_limit(void);
+static void st_collections_group_parts_part_description_align(void);
+static void st_collections_group_parts_part_description_fixed(void);
+static void st_collections_group_parts_part_description_min(void);
+static void st_collections_group_parts_part_description_minmul(void);
+static void st_collections_group_parts_part_description_max(void);
+static void st_collections_group_parts_part_description_step(void);
+static void st_collections_group_parts_part_description_aspect(void);
+static void st_collections_group_parts_part_description_aspect_preference(void);
+static void st_collections_group_parts_part_description_rel_to(void);
+static void st_collections_group_parts_part_description_rel_to_x(void);
+static void st_collections_group_parts_part_description_rel_to_y(void);
+static void st_collections_group_parts_part_description_rel1_relative(void);
+static void st_collections_group_parts_part_description_rel1_offset(void);
+static void st_collections_group_parts_part_description_rel1_to_set(const char *name);
+static void st_collections_group_parts_part_description_rel1_to(void);
+static void st_collections_group_parts_part_description_rel1_to_x(void);
+static void st_collections_group_parts_part_description_rel1_to_y(void);
+static void st_collections_group_parts_part_description_rel2_relative(void);
+static void st_collections_group_parts_part_description_rel2_offset(void);
+static void st_collections_group_parts_part_description_rel2_to_set(const char *name);
+static void st_collections_group_parts_part_description_rel2_to(void);
+static void st_collections_group_parts_part_description_rel2_to_x(void);
+static void st_collections_group_parts_part_description_rel2_to_y(void);
+static void st_collections_group_parts_part_description_anchors_top(void);
+static void st_collections_group_parts_part_description_anchors_bottom(void);
+static void st_collections_group_parts_part_description_anchors_left(void);
+static void st_collections_group_parts_part_description_anchors_right(void);
+static void st_collections_group_parts_part_description_anchors_vertical_center(void);
+static void st_collections_group_parts_part_description_anchors_horizontal_center(void);
+static void st_collections_group_parts_part_description_anchors_fill(void);
+static void st_collections_group_parts_part_description_anchors_margin(void);
+static void st_collections_group_parts_part_description_clip_to_id(void);
+static void st_collections_group_parts_part_description_size_class(void);
+static void st_collections_group_parts_part_description_image_normal(void);
+static void st_collections_group_parts_part_description_image_tween(void);
+static void st_collections_group_parts_part_description_image_border(void);
+static void st_collections_group_parts_part_description_image_middle(void);
+static void st_collections_group_parts_part_description_image_border_scale(void);
+static void st_collections_group_parts_part_description_image_border_scale_by(void);
+static void st_collections_group_parts_part_description_image_scale_hint(void);
+static void st_collections_group_parts_part_description_fill_smooth(void);
+static void st_collections_group_parts_part_description_fill_origin_relative(void);
+static void st_collections_group_parts_part_description_fill_origin_offset(void);
+static void st_collections_group_parts_part_description_fill_size_relative(void);
+static void st_collections_group_parts_part_description_fill_size_offset(void);
+static void st_collections_group_parts_part_description_fill_type(void);
+static void st_collections_group_parts_part_description_color_class(void);
+static void st_collections_group_parts_part_description_color(void);
+static void st_collections_group_parts_part_description_color2(void);
+static void st_collections_group_parts_part_description_color3(void);
+static void st_collections_group_parts_part_description_text_text(void);
+static void st_collections_group_parts_part_description_text_domain(void);
+static void st_collections_group_parts_part_description_text_text_class(void);
+static void st_collections_group_parts_part_description_text_font(void);
+static void st_collections_group_parts_part_description_text_style(void);
+static void st_collections_group_parts_part_description_text_repch(void);
+static void st_collections_group_parts_part_description_text_size(void);
+static void st_collections_group_parts_part_description_text_size_range(void);
+static void st_collections_group_parts_part_description_text_fit(void);
+static void st_collections_group_parts_part_description_text_min(void);
+static void st_collections_group_parts_part_description_text_max(void);
+static void st_collections_group_parts_part_description_text_align(void);
+static void st_collections_group_parts_part_description_text_source(void);
+static void st_collections_group_parts_part_description_text_text_source(void);
+static void st_collections_group_parts_part_description_text_ellipsis(void);
+static void st_collections_group_parts_part_description_box_layout(void);
+static void st_collections_group_parts_part_description_box_align(void);
+static void st_collections_group_parts_part_description_box_padding(void);
+static void st_collections_group_parts_part_description_box_min(void);
+static void st_collections_group_parts_part_description_table_homogeneous(void);
+static void st_collections_group_parts_part_description_table_align(void);
+static void st_collections_group_parts_part_description_table_padding(void);
+static void st_collections_group_parts_part_description_table_min(void);
+static void st_collections_group_parts_part_description_proxy_source_visible(void);
+static void st_collections_group_parts_part_description_proxy_source_clip(void);
+static void st_collections_group_parts_part_description_position_point(void);
+static void st_collections_group_parts_part_description_position_space(void);
+static void st_collections_group_parts_part_description_camera_properties(void);
+static void st_collections_group_parts_part_description_properties_ambient(void);
+static void st_collections_group_parts_part_description_properties_diffuse(void);
+static void st_collections_group_parts_part_description_properties_specular(void);
+static void st_collections_group_parts_part_description_properties_material(void);
+static void st_collections_group_parts_part_description_properties_normal(void);
+static void st_collections_group_parts_part_description_properties_shininess(void);
+static void st_collections_group_parts_part_description_properties_shade(void);
+static void st_collections_group_parts_part_description_orientation_angle_axis(void);
+static void st_collections_group_parts_part_description_orientation_look1(void);
+static void st_collections_group_parts_part_description_orientation_look2(void);
+static void st_collections_group_parts_part_description_orientation_look_to(void);
+static void st_collections_group_parts_part_description_orientation_angle_axis(void);
+static void st_collections_group_parts_part_description_orientation_quaternion(void);
+static void st_collections_group_parts_part_description_scale(void);
+static void st_collections_group_parts_part_description_offset_scale(void);
+static void st_collections_group_parts_part_description_mesh_primitive(void);
+static void ob_collections_group_parts_part_description_texture(void);
+static void st_collections_group_parts_part_description_texture_image(void);
+static void st_collections_group_parts_part_description_texture_wrap1(void);
+static void st_collections_group_parts_part_description_texture_wrap2(void);
+static void st_collections_group_parts_part_description_texture_filter1(void);
+static void st_collections_group_parts_part_description_texture_filter2(void);
+static void st_collections_group_parts_part_description_mesh_assembly(void);
+static void st_collections_group_parts_part_description_mesh_geometry(void);
+static void st_collections_group_parts_part_description_mesh_frame(void);
+static void st_collections_group_parts_part_description_filter_code(void);
+static void st_collections_group_parts_part_description_filter_source(void);
+static void st_collections_group_parts_part_description_filter_data(void);
#ifdef HAVE_EPHYSICS
-static void st_collections_group_parts_part_description_physics_mass(void);
-static void st_collections_group_parts_part_description_physics_restitution(void);
-static void st_collections_group_parts_part_description_physics_friction(void);
-static void st_collections_group_parts_part_description_physics_damping(void);
-static void st_collections_group_parts_part_description_physics_sleep(void);
-static void st_collections_group_parts_part_description_physics_material(void);
-static void st_collections_group_parts_part_description_physics_density(void);
-static void st_collections_group_parts_part_description_physics_hardness(void);
-static void st_collections_group_parts_part_description_physics_ignore_part_pos(void);
-static void st_collections_group_parts_part_description_physics_light_on(void);
-static void st_collections_group_parts_part_description_physics_z(void);
-static void st_collections_group_parts_part_description_physics_depth(void);
-static void st_collections_group_parts_part_description_physics_movement_freedom_linear(void);
-static void st_collections_group_parts_part_description_physics_movement_freedom_angular(void);
-static void st_collections_group_parts_part_description_physics_backface_cull(void);
-static void st_collections_group_parts_part_description_physics_face(void);
-static void st_collections_group_parts_part_description_physics_face_type(void);
-static void st_collections_group_parts_part_description_physics_face_source(void);
+static void st_collections_group_parts_part_description_physics_mass(void);
+static void st_collections_group_parts_part_description_physics_restitution(void);
+static void st_collections_group_parts_part_description_physics_friction(void);
+static void st_collections_group_parts_part_description_physics_damping(void);
+static void st_collections_group_parts_part_description_physics_sleep(void);
+static void st_collections_group_parts_part_description_physics_material(void);
+static void st_collections_group_parts_part_description_physics_density(void);
+static void st_collections_group_parts_part_description_physics_hardness(void);
+static void st_collections_group_parts_part_description_physics_ignore_part_pos(void);
+static void st_collections_group_parts_part_description_physics_light_on(void);
+static void st_collections_group_parts_part_description_physics_z(void);
+static void st_collections_group_parts_part_description_physics_depth(void);
+static void st_collections_group_parts_part_description_physics_movement_freedom_linear(void);
+static void st_collections_group_parts_part_description_physics_movement_freedom_angular(void);
+static void st_collections_group_parts_part_description_physics_backface_cull(void);
+static void st_collections_group_parts_part_description_physics_face(void);
+static void st_collections_group_parts_part_description_physics_face_type(void);
+static void st_collections_group_parts_part_description_physics_face_source(void);
#endif
-static void st_collections_group_parts_part_description_map_perspective(void);
-static void st_collections_group_parts_part_description_map_light(void);
-static void st_collections_group_parts_part_description_map_rotation_center(void);
-static void st_collections_group_parts_part_description_map_rotation_x(void);
-static void st_collections_group_parts_part_description_map_rotation_y(void);
-static void st_collections_group_parts_part_description_map_rotation_z(void);
-static void st_collections_group_parts_part_description_map_on(void);
-static void st_collections_group_parts_part_description_map_smooth(void);
-static void st_collections_group_parts_part_description_map_alpha(void);
-static void st_collections_group_parts_part_description_map_backface_cull(void);
-static void st_collections_group_parts_part_description_map_perspective_on(void);
-static void st_collections_group_parts_part_description_map_color(void);
-static void st_collections_group_parts_part_description_map_zoom_x(void);
-static void st_collections_group_parts_part_description_map_zoom_y(void);
-static void st_collections_group_parts_part_description_perspective_zplane(void);
-static void st_collections_group_parts_part_description_perspective_focal(void);
-static void st_collections_group_parts_part_api(void);
+static void st_collections_group_parts_part_description_map_perspective(void);
+static void st_collections_group_parts_part_description_map_light(void);
+static void st_collections_group_parts_part_description_map_rotation_center(void);
+static void st_collections_group_parts_part_description_map_rotation_x(void);
+static void st_collections_group_parts_part_description_map_rotation_y(void);
+static void st_collections_group_parts_part_description_map_rotation_z(void);
+static void st_collections_group_parts_part_description_map_on(void);
+static void st_collections_group_parts_part_description_map_smooth(void);
+static void st_collections_group_parts_part_description_map_alpha(void);
+static void st_collections_group_parts_part_description_map_backface_cull(void);
+static void st_collections_group_parts_part_description_map_perspective_on(void);
+static void st_collections_group_parts_part_description_map_color(void);
+static void st_collections_group_parts_part_description_map_zoom_x(void);
+static void st_collections_group_parts_part_description_map_zoom_y(void);
+static void st_collections_group_parts_part_description_perspective_zplane(void);
+static void st_collections_group_parts_part_description_perspective_focal(void);
+static void st_collections_group_parts_part_api(void);
/* external part parameters */
-static void st_collections_group_parts_part_description_params_int(void);
-static void st_collections_group_parts_part_description_params_double(void);
-static void st_collections_group_parts_part_description_params_string(void);
-static void st_collections_group_parts_part_description_params_bool(void);
-static void st_collections_group_parts_part_description_params_choice(void);
-static void st_collections_group_parts_part_description_params_smart(void);
-
-static void ob_collections_group_programs_program(void);
-static void st_collections_group_programs_program_name(void);
-static void st_collections_group_programs_program_signal(void);
-static void st_collections_group_programs_program_source(void);
-static void st_collections_group_programs_program_filter(void);
-static void st_collections_group_programs_program_in(void);
-static void st_collections_group_programs_program_action(void);
-static void st_collections_group_programs_program_transition(void);
-static void st_collections_group_programs_program_target(void);
-static void st_collections_group_programs_program_targets(void);
-static void st_collections_group_programs_program_target_groups(void);
-static void st_collections_group_programs_program_after(void);
-static void st_collections_group_programs_program_api(void);
-static void st_collections_group_target_group(void);
-
-static void ob_collections_group_programs_program_sequence(void);
-
-static void ob_collections_group_programs_program_script(void);
-static void st_collections_group_sound_sample_name(void);
-static void st_collections_group_sound_sample_source(void);
-static void st_collections_group_sound_tone(void);
-static void st_collections_group_vibration_sample_name(void);
-static void st_collections_group_vibration_sample_source(void);
-
-static void st_collections_group_translation_file_locale(void);
-static void st_collections_group_translation_file_source(void);
+static void st_collections_group_parts_part_description_params_int(void);
+static void st_collections_group_parts_part_description_params_double(void);
+static void st_collections_group_parts_part_description_params_string(void);
+static void st_collections_group_parts_part_description_params_bool(void);
+static void st_collections_group_parts_part_description_params_choice(void);
+static void st_collections_group_parts_part_description_params_smart(void);
+
+static void ob_collections_group_programs_program(void);
+static void st_collections_group_programs_program_name(void);
+static void st_collections_group_programs_program_signal(void);
+static void st_collections_group_programs_program_source(void);
+static void st_collections_group_programs_program_filter(void);
+static void st_collections_group_programs_program_in(void);
+static void st_collections_group_programs_program_action(void);
+static void st_collections_group_programs_program_transition(void);
+static void st_collections_group_programs_program_target(void);
+static void st_collections_group_programs_program_targets(void);
+static void st_collections_group_programs_program_target_groups(void);
+static void st_collections_group_programs_program_after(void);
+static void st_collections_group_programs_program_api(void);
+static void st_collections_group_target_group(void);
+
+static void ob_collections_group_programs_program_sequence(void);
+
+static void ob_collections_group_programs_program_script(void);
+static void st_collections_group_sound_sample_name(void);
+static void st_collections_group_sound_sample_source(void);
+static void st_collections_group_sound_tone(void);
+static void st_collections_group_vibration_sample_name(void);
+static void st_collections_group_vibration_sample_source(void);
+
+static void st_collections_group_translation_file_locale(void);
+static void st_collections_group_translation_file_source(void);
#ifdef HAVE_EPHYSICS
-static void st_collections_group_physics_world_gravity(void);
-static void st_collections_group_physics_world_rate(void);
-static void st_collections_group_physics_world_z(void);
-static void st_collections_group_physics_world_depth(void);
+static void st_collections_group_physics_world_gravity(void);
+static void st_collections_group_physics_world_rate(void);
+static void st_collections_group_physics_world_z(void);
+static void st_collections_group_physics_world_depth(void);
#endif
/* short */
-static void st_collections_group_parts_part_noscale(void);
-static void st_collections_group_parts_part_precise(void);
-static void st_collections_group_parts_part_noprecise(void);
-static void st_collections_group_parts_part_mouse(void);
-static void st_collections_group_parts_part_nomouse(void);
-static void st_collections_group_parts_part_repeat(void);
-static void st_collections_group_parts_part_norepeat(void);
-static void st_collections_group_parts_part_description_vis(void);
-static void st_collections_group_parts_part_description_hid(void);
-static void ob_collections_group_parts_part_short(void);
-
-static void st_collections_group_mouse(void);
-static void st_collections_group_nomouse(void);
-static void st_collections_group_broadcast(void);
-static void st_collections_group_nobroadcast(void);
-static void st_collections_group_noinherit_script(void);
-
-static void st_images_vector(void);
-static void _handle_vector_image(void);
+static void st_collections_group_parts_part_noscale(void);
+static void st_collections_group_parts_part_precise(void);
+static void st_collections_group_parts_part_noprecise(void);
+static void st_collections_group_parts_part_mouse(void);
+static void st_collections_group_parts_part_nomouse(void);
+static void st_collections_group_parts_part_repeat(void);
+static void st_collections_group_parts_part_norepeat(void);
+static void st_collections_group_parts_part_description_vis(void);
+static void st_collections_group_parts_part_description_hid(void);
+static void ob_collections_group_parts_part_short(void);
+
+static void st_collections_group_mouse(void);
+static void st_collections_group_nomouse(void);
+static void st_collections_group_broadcast(void);
+static void st_collections_group_nobroadcast(void);
+static void st_collections_group_noinherit_script(void);
+
+static void st_images_vector(void);
+static void _handle_vector_image(void);
/*****/
#define STRDUP(x) eina_strdup(x)
-#define IMAGE_STATEMENTS(PREFIX) \
- {PREFIX"images.image", st_images_image}, \
- {PREFIX"images.vector", st_images_vector}, \
- {PREFIX"images.set.name", st_images_set_name}, \
- {PREFIX"images.set.image.image", st_images_set_image_image}, \
- {PREFIX"images.set.image.size", st_images_set_image_size}, \
- {PREFIX"images.set.image.border", st_images_set_image_border}, \
- {PREFIX"images.set.image.scale_by", st_images_set_image_border_scale_by},
-
-#define IMAGE_SET_STATEMENTS(PREFIX) \
- {PREFIX".image", st_images_image}, /* dup */ \
- {PREFIX".set.name", st_images_set_name}, /* dup */ \
- {PREFIX".set.image.image", st_images_set_image_image}, /* dup */ \
- {PREFIX".set.image.size", st_images_set_image_size}, /* dup */ \
- {PREFIX".set.image.border", st_images_set_image_border}, /* dup */ \
- {PREFIX".set.image.scale_by", st_images_set_image_border_scale_by}, /* dup */
-
-#define FONT_STYLE_CC_STATEMENTS(PREFIX) \
- {PREFIX"fonts.font", st_fonts_font}, /* dup */ \
- {PREFIX"styles.style.name", st_styles_style_name}, /* dup */ \
- {PREFIX"styles.style.base", st_styles_style_base}, /* dup */ \
- {PREFIX"styles.style.tag", st_styles_style_tag}, /* dup */ \
- {PREFIX"color_classes.color_class.name", st_color_class_name}, /* dup */ \
- {PREFIX"color_classes.color_class.color", st_color_class_color}, /* dup */ \
- {PREFIX"color_classes.color_class.color2", st_color_class_color2}, /* dup */ \
- {PREFIX"color_classes.color_class.color3", st_color_class_color3}, /* dup */ \
- {PREFIX"color_classes.color_class.description", st_color_class_desc}, /* dup */ \
- {PREFIX"color_classes.color_class.desc", st_color_class_desc}, /* dup */
-
-#define TEXT_CLASS_STATEMENTS(PREFIX) \
- {PREFIX"text_classes.text_class.name", st_text_class_name}, /* dup */ \
- {PREFIX"text_classes.text_class.font", st_text_class_font}, /* dup */ \
- {PREFIX"text_classes.text_class.size", st_text_class_size}, /* dup */
-
-#define SIZE_CLASS_STATEMENTS(PREFIX) \
- {PREFIX"size_classes.size_class.name", st_size_class_name}, /* dup */ \
- {PREFIX"size_classes.size_class.min", st_size_class_min}, /* dup */ \
- {PREFIX"size_classes.size_class.max", st_size_class_max}, /* dup */
-
-#define PROGRAM_SEQUENCE(PREFIX, NAME, FN) \
- {PREFIX".program."NAME, FN}, /* dup */ \
- {PREFIX".program.sequence."NAME, FN}, /* dup */
-
-
-#define PROGRAM_BASE(PREFIX) \
- PROGRAM_SEQUENCE(PREFIX, "name", st_collections_group_programs_program_name) \
- PROGRAM_SEQUENCE(PREFIX, "signal", st_collections_group_programs_program_signal) \
- PROGRAM_SEQUENCE(PREFIX, "source", st_collections_group_programs_program_source) \
- PROGRAM_SEQUENCE(PREFIX, "in", st_collections_group_programs_program_in) \
- PROGRAM_SEQUENCE(PREFIX, "action", st_collections_group_programs_program_action) \
- PROGRAM_SEQUENCE(PREFIX, "transition", st_collections_group_programs_program_transition) \
- PROGRAM_SEQUENCE(PREFIX, "target", st_collections_group_programs_program_target) \
- PROGRAM_SEQUENCE(PREFIX, "target_groups", st_collections_group_programs_program_target_groups) \
- PROGRAM_SEQUENCE(PREFIX, "groups", st_collections_group_programs_program_target_groups) \
- PROGRAM_SEQUENCE(PREFIX, "targets", st_collections_group_programs_program_targets) \
- PROGRAM_SEQUENCE(PREFIX, "after", st_collections_group_programs_program_after) \
- PROGRAM_SEQUENCE(PREFIX, "api", st_collections_group_programs_program_api) \
- PROGRAM_SEQUENCE(PREFIX, "filter", st_collections_group_programs_program_filter)
-
-#define PROGRAM_STATEMENTS(PREFIX) \
- IMAGE_SET_STATEMENTS(PREFIX".programs") \
- IMAGE_STATEMENTS(PREFIX".programs.") \
- IMAGE_SET_STATEMENTS(PREFIX".programs") \
- {PREFIX".programs.font", st_fonts_font}, /* dup */ \
- {PREFIX".programs.fonts.font", st_fonts_font}, /* dup */ \
- PROGRAM_BASE(PREFIX) \
- PROGRAM_BASE(PREFIX".programs")
-
-#define SET_LOOK1(Type, type_node) \
- Edje_Part_Description_##Type *ed; \
- ed = (Edje_Part_Description_##Type*) current_desc; \
- \
- if (ed->type_node.orientation.type <= EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_LOOK_AT) \
- { \
- ed->type_node.orientation.data[0] = FROM_DOUBLE(parse_float(0)); \
- ed->type_node.orientation.data[1] = FROM_DOUBLE(parse_float(1)); \
- ed->type_node.orientation.data[2] = FROM_DOUBLE(parse_float(2)); \
- ed->type_node.orientation.type = EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_LOOK_AT; \
- }
-
-#define SET_LOOK2(Type, type_node) \
- Edje_Part_Description_##Type *ed; \
- ed = (Edje_Part_Description_##Type*) current_desc; \
- \
- if (ed->type_node.orientation.type <= EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_LOOK_AT) \
- { \
- ed->type_node.orientation.data[3] = FROM_DOUBLE(parse_float(0)); \
- ed->type_node.orientation.data[4] = FROM_DOUBLE(parse_float(1)); \
- ed->type_node.orientation.data[5] = FROM_DOUBLE(parse_float(2)); \
- ed->type_node.orientation.type = EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_LOOK_AT; \
- }
+#define IMAGE_STATEMENTS(PREFIX) \
+ {PREFIX "images.image", st_images_image}, \
+ {PREFIX "images.vector", st_images_vector}, \
+ {PREFIX "images.set.name", st_images_set_name}, \
+ {PREFIX "images.set.image.image", st_images_set_image_image}, \
+ {PREFIX "images.set.image.size", st_images_set_image_size}, \
+ {PREFIX "images.set.image.border", st_images_set_image_border}, \
+ {PREFIX "images.set.image.scale_by", st_images_set_image_border_scale_by},
+
+#define IMAGE_SET_STATEMENTS(PREFIX) \
+ {PREFIX ".image", st_images_image}, /* dup */ \
+ {PREFIX ".set.name", st_images_set_name}, /* dup */ \
+ {PREFIX ".set.image.image", st_images_set_image_image}, /* dup */ \
+ {PREFIX ".set.image.size", st_images_set_image_size}, /* dup */ \
+ {PREFIX ".set.image.border", st_images_set_image_border}, /* dup */ \
+ {PREFIX ".set.image.scale_by", st_images_set_image_border_scale_by}, /* dup */
+
+#define FONT_STYLE_CC_STATEMENTS(PREFIX) \
+ {PREFIX "fonts.font", st_fonts_font}, /* dup */ \
+ {PREFIX "styles.style.name", st_styles_style_name}, /* dup */ \
+ {PREFIX "styles.style.base", st_styles_style_base}, /* dup */ \
+ {PREFIX "styles.style.tag", st_styles_style_tag}, /* dup */ \
+ {PREFIX "color_classes.color_class.name", st_color_class_name}, /* dup */ \
+ {PREFIX "color_classes.color_class.color", st_color_class_color}, /* dup */ \
+ {PREFIX "color_classes.color_class.color2", st_color_class_color2}, /* dup */ \
+ {PREFIX "color_classes.color_class.color3", st_color_class_color3}, /* dup */ \
+ {PREFIX "color_classes.color_class.description", st_color_class_desc}, /* dup */ \
+ {PREFIX "color_classes.color_class.desc", st_color_class_desc}, /* dup */
+
+#define TEXT_CLASS_STATEMENTS(PREFIX) \
+ {PREFIX "text_classes.text_class.name", st_text_class_name}, /* dup */ \
+ {PREFIX "text_classes.text_class.font", st_text_class_font}, /* dup */ \
+ {PREFIX "text_classes.text_class.size", st_text_class_size}, /* dup */
+
+#define SIZE_CLASS_STATEMENTS(PREFIX) \
+ {PREFIX "size_classes.size_class.name", st_size_class_name}, /* dup */ \
+ {PREFIX "size_classes.size_class.min", st_size_class_min}, /* dup */ \
+ {PREFIX "size_classes.size_class.max", st_size_class_max}, /* dup */
+
+#define PROGRAM_SEQUENCE(PREFIX, NAME, FN) \
+ {PREFIX ".program."NAME, FN}, /* dup */ \
+ {PREFIX ".program.sequence."NAME, FN}, /* dup */
+
+#define PROGRAM_BASE(PREFIX) \
+ PROGRAM_SEQUENCE(PREFIX, "name", st_collections_group_programs_program_name) \
+ PROGRAM_SEQUENCE(PREFIX, "signal", st_collections_group_programs_program_signal) \
+ PROGRAM_SEQUENCE(PREFIX, "source", st_collections_group_programs_program_source) \
+ PROGRAM_SEQUENCE(PREFIX, "in", st_collections_group_programs_program_in) \
+ PROGRAM_SEQUENCE(PREFIX, "action", st_collections_group_programs_program_action) \
+ PROGRAM_SEQUENCE(PREFIX, "transition", st_collections_group_programs_program_transition) \
+ PROGRAM_SEQUENCE(PREFIX, "target", st_collections_group_programs_program_target) \
+ PROGRAM_SEQUENCE(PREFIX, "target_groups", st_collections_group_programs_program_target_groups) \
+ PROGRAM_SEQUENCE(PREFIX, "groups", st_collections_group_programs_program_target_groups) \
+ PROGRAM_SEQUENCE(PREFIX, "targets", st_collections_group_programs_program_targets) \
+ PROGRAM_SEQUENCE(PREFIX, "after", st_collections_group_programs_program_after) \
+ PROGRAM_SEQUENCE(PREFIX, "api", st_collections_group_programs_program_api) \
+ PROGRAM_SEQUENCE(PREFIX, "filter", st_collections_group_programs_program_filter)
+
+#define PROGRAM_STATEMENTS(PREFIX) \
+ IMAGE_SET_STATEMENTS(PREFIX ".programs") \
+ IMAGE_STATEMENTS(PREFIX ".programs.") \
+ IMAGE_SET_STATEMENTS(PREFIX ".programs") \
+ {PREFIX ".programs.font", st_fonts_font}, /* dup */ \
+ {PREFIX ".programs.fonts.font", st_fonts_font}, /* dup */ \
+ PROGRAM_BASE(PREFIX) \
+ PROGRAM_BASE(PREFIX ".programs")
+
+#define SET_LOOK1(Type, type_node) \
+ Edje_Part_Description_##Type * ed; \
+ ed = (Edje_Part_Description_##Type *)current_desc; \
+ \
+ if (ed->type_node.orientation.type <= EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_LOOK_AT) \
+ { \
+ ed->type_node.orientation.data[0] = FROM_DOUBLE(parse_float(0)); \
+ ed->type_node.orientation.data[1] = FROM_DOUBLE(parse_float(1)); \
+ ed->type_node.orientation.data[2] = FROM_DOUBLE(parse_float(2)); \
+ ed->type_node.orientation.type = EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_LOOK_AT; \
+ }
+
+#define SET_LOOK2(Type, type_node) \
+ Edje_Part_Description_##Type * ed; \
+ ed = (Edje_Part_Description_##Type *)current_desc; \
+ \
+ if (ed->type_node.orientation.type <= EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_LOOK_AT) \
+ { \
+ ed->type_node.orientation.data[3] = FROM_DOUBLE(parse_float(0)); \
+ ed->type_node.orientation.data[4] = FROM_DOUBLE(parse_float(1)); \
+ ed->type_node.orientation.data[5] = FROM_DOUBLE(parse_float(2)); \
+ ed->type_node.orientation.type = EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_LOOK_AT; \
+ }
#define SET_LOOK_TO(list, Type, type_node) \
- Edje_Part_Description_##Type *ed; \
- char *name; \
+ Edje_Part_Description_##Type * ed; \
+ char *name; \
\
- ed = (Edje_Part_Description_##Type*) current_desc; \
+ ed = (Edje_Part_Description_##Type *)current_desc; \
\
- if (ed->type_node.orientation.type <= EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_LOOK_TO) \
- { \
- name = parse_str(0); \
- data_queue_part_lookup(list, name, &(ed->type_node.orientation.look_to)); \
- free(name); \
- ed->type_node.orientation.type = EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_LOOK_TO; \
- }
-
-#define SET_ANGLE_AXIS(Type, type_node) \
- Edje_Part_Description_##Type *ed; \
- ed = (Edje_Part_Description_##Type*) current_desc; \
- \
- if (ed->type_node.orientation.type <= EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_ANGLE_AXIS) \
- { \
- ed->type_node.orientation.data[0] = FROM_DOUBLE(parse_float(0)); \
- ed->type_node.orientation.data[1] = FROM_DOUBLE(parse_float(1)); \
- ed->type_node.orientation.data[2] = FROM_DOUBLE(parse_float(2)); \
- ed->type_node.orientation.data[3] = FROM_DOUBLE(parse_float(3)); \
- ed->type_node.orientation.type = EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_ANGLE_AXIS; \
- }
-
-#define SET_QUATERNION(Type, type_node) \
- Edje_Part_Description_##Type *ed; \
- ed = (Edje_Part_Description_##Type*) current_desc; \
- \
- if (ed->type_node.orientation.type <= EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_QUATERNION) \
- { \
- ed->type_node.orientation.data[1] = FROM_DOUBLE(parse_float(0)); \
- ed->type_node.orientation.data[2] = FROM_DOUBLE(parse_float(1)); \
- ed->type_node.orientation.data[3] = FROM_DOUBLE(parse_float(2)); \
- ed->type_node.orientation.data[0] = FROM_DOUBLE(parse_float(3)); \
- ed->type_node.orientation.type = EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_QUATERNION; \
- }
-
-#define FILTERS_STATEMENTS(PREFIX) \
- {PREFIX"filters.filter.file", st_filters_filter_file}, \
- {PREFIX"filters.filter.name", st_filters_filter_name},
+ if (ed->type_node.orientation.type <= EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_LOOK_TO) \
+ { \
+ name = parse_str(0); \
+ data_queue_part_lookup(list, name, &(ed->type_node.orientation.look_to)); \
+ free(name); \
+ ed->type_node.orientation.type = EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_LOOK_TO; \
+ }
+
+#define SET_ANGLE_AXIS(Type, type_node) \
+ Edje_Part_Description_##Type * ed; \
+ ed = (Edje_Part_Description_##Type *)current_desc; \
+ \
+ if (ed->type_node.orientation.type <= EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_ANGLE_AXIS) \
+ { \
+ ed->type_node.orientation.data[0] = FROM_DOUBLE(parse_float(0)); \
+ ed->type_node.orientation.data[1] = FROM_DOUBLE(parse_float(1)); \
+ ed->type_node.orientation.data[2] = FROM_DOUBLE(parse_float(2)); \
+ ed->type_node.orientation.data[3] = FROM_DOUBLE(parse_float(3)); \
+ ed->type_node.orientation.type = EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_ANGLE_AXIS; \
+ }
+
+#define SET_QUATERNION(Type, type_node) \
+ Edje_Part_Description_##Type * ed; \
+ ed = (Edje_Part_Description_##Type *)current_desc; \
+ \
+ if (ed->type_node.orientation.type <= EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_QUATERNION) \
+ { \
+ ed->type_node.orientation.data[1] = FROM_DOUBLE(parse_float(0)); \
+ ed->type_node.orientation.data[2] = FROM_DOUBLE(parse_float(1)); \
+ ed->type_node.orientation.data[3] = FROM_DOUBLE(parse_float(2)); \
+ ed->type_node.orientation.data[0] = FROM_DOUBLE(parse_float(3)); \
+ ed->type_node.orientation.type = EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_QUATERNION; \
+ }
+
+#define FILTERS_STATEMENTS(PREFIX) \
+ {PREFIX "filters.filter.file", st_filters_filter_file}, \
+ {PREFIX "filters.filter.name", st_filters_filter_name},
New_Statement_Handler statement_handlers[] =
{
- {"efl_version", st_efl_version},
- {"externals.external", st_externals_external},
- IMAGE_STATEMENTS("")
- FONT_STYLE_CC_STATEMENTS("")
- TEXT_CLASS_STATEMENTS("")
- SIZE_CLASS_STATEMENTS("")
- {"data.item", st_data_item},
- {"data.file", st_data_file},
- FILTERS_STATEMENTS("")
- {"collections.externals.external", st_externals_external}, /* dup */
- IMAGE_STATEMENTS("collections.")
- IMAGE_SET_STATEMENTS("collections")
- {"collections.font", st_fonts_font}, /* dup */
- FONT_STYLE_CC_STATEMENTS("collections.")
- TEXT_CLASS_STATEMENTS("collections.")
- SIZE_CLASS_STATEMENTS("collections.")
- {"collections.base_scale", st_collections_base_scale},
- {"collections.translation.file.locale", st_collections_group_translation_file_locale},
- {"collections.translation.file.source", st_collections_group_translation_file_source},
- {"collections.group.translation.file.locale", st_collections_group_translation_file_locale},
- {"collections.group.translation.file.source", st_collections_group_translation_file_source},
-
- {"collections.sounds.sample.name", st_collections_group_sound_sample_name},
- {"collections.sounds.sample.source", st_collections_group_sound_sample_source},
- {"collections.group.sounds.sample.name", st_collections_group_sound_sample_name}, /* dup */
- {"collections.group.sounds.sample.source", st_collections_group_sound_sample_source}, /* dup */
- {"collections.sounds.tone", st_collections_group_sound_tone},
- {"collections.group.sounds.tone", st_collections_group_sound_tone}, /* dup */
- {"collections.vibrations.sample.name", st_collections_group_vibration_sample_name},
- {"collections.vibrations.sample.source", st_collections_group_vibration_sample_source},
- FILTERS_STATEMENTS("collections.") /* dup */
- {"collections.group.vibrations.sample.name", st_collections_group_vibration_sample_name}, /* dup */
- {"collections.group.vibrations.sample.source", st_collections_group_vibration_sample_source}, /* dup */
- {"collections.group.name", st_collections_group_name},
- {"collections.group.program_source", st_collections_group_program_source},
- {"collections.group.inherit", st_collections_group_inherit},
- {"collections.group.inherit_only", st_collections_group_inherit_only},
- {"collections.group.use_custom_seat_names", st_collections_group_use_custom_seat_names},
- {"collections.group.target_group", st_collections_group_target_group}, /* dup */
- {"collections.group.part_remove", st_collections_group_part_remove},
- {"collections.group.program_remove", st_collections_group_program_remove},
- {"collections.group.lua_script_only", st_collections_group_lua_script_only},
- {"collections.group.script_recursion", st_collections_group_script_recursion},
- {"collections.group.alias", st_collections_group_alias},
- {"collections.group.min", st_collections_group_min},
- {"collections.group.max", st_collections_group_max},
- {"collections.group.scene_size", st_collections_group_scene_size},
- {"collections.group.broadcast_signal", st_collections_group_broadcast_signal},
- {"collections.group.orientation", st_collections_group_orientation},
- {"collections.group.mouse_events", st_collections_group_mouse_events},
- {"collections.group.inherit_script", st_collections_group_inherit_script},
- {"collections.group.data.item", st_collections_group_data_item},
- {"collections.group.limits.horizontal", st_collections_group_limits_horizontal},
- {"collections.group.limits.vertical", st_collections_group_limits_vertical},
- {"collections.group.externals.external", st_externals_external}, /* dup */
- {"collections.group.programs.target_group", st_collections_group_target_group}, /* dup */
- IMAGE_SET_STATEMENTS("collections.group")
- IMAGE_STATEMENTS("collections.group.")
- {"collections.group.models.model", st_models_model},
- {"collections.group.font", st_fonts_font}, /* dup */
- FONT_STYLE_CC_STATEMENTS("collections.group.")
- TEXT_CLASS_STATEMENTS("collections.group.")
- SIZE_CLASS_STATEMENTS("collections.group.")
- {"collections.group.parts.alias", st_collections_group_parts_alias },
- IMAGE_SET_STATEMENTS("collections.group.parts")
- IMAGE_STATEMENTS("collections.group.parts.")
- {"collections.group.parts.font", st_fonts_font}, /* dup */
- FONT_STYLE_CC_STATEMENTS("collections.group.parts.")
- TEXT_CLASS_STATEMENTS("collections.group.parts.")
- SIZE_CLASS_STATEMENTS("collections.group.parts.")
- {"collections.group.parts.target_group", st_collections_group_target_group}, /* dup */
- {"collections.group.parts.part.name", st_collections_group_parts_part_name},
- {"collections.group.parts.part.target_group", st_collections_group_target_group}, /* dup */
- {"collections.group.parts.part.inherit", st_collections_group_parts_part_inherit},
- {"collections.group.parts.part.api", st_collections_group_parts_part_api},
- {"collections.group.parts.part.type", st_collections_group_parts_part_type},
+ {"id", st_id},
+ {"requires", st_requires},
+ {"efl_version", st_efl_version},
+ {"externals.external", st_externals_external},
+ IMAGE_STATEMENTS("")
+ FONT_STYLE_CC_STATEMENTS("")
+ TEXT_CLASS_STATEMENTS("")
+ SIZE_CLASS_STATEMENTS("")
+ {
+ "data.item", st_data_item
+ },
+ {"data.file", st_data_file},
+ FILTERS_STATEMENTS("")
+ {
+ "collections.externals.external", st_externals_external
+ }, /* dup */
+ IMAGE_STATEMENTS("collections.")
+ IMAGE_SET_STATEMENTS("collections")
+ {
+ "collections.font", st_fonts_font
+ }, /* dup */
+ FONT_STYLE_CC_STATEMENTS("collections.")
+ TEXT_CLASS_STATEMENTS("collections.")
+ SIZE_CLASS_STATEMENTS("collections.")
+ {
+ "collections.base_scale", st_collections_base_scale
+ },
+ {"collections.translation.file.locale", st_collections_group_translation_file_locale},
+ {"collections.translation.file.source", st_collections_group_translation_file_source},
+ {"collections.group.translation.file.locale", st_collections_group_translation_file_locale},
+ {"collections.group.translation.file.source", st_collections_group_translation_file_source},
+
+ {"collections.sounds.sample.name", st_collections_group_sound_sample_name},
+ {"collections.sounds.sample.source", st_collections_group_sound_sample_source},
+ {"collections.group.sounds.sample.name", st_collections_group_sound_sample_name}, /* dup */
+ {"collections.group.sounds.sample.source", st_collections_group_sound_sample_source}, /* dup */
+ {"collections.sounds.tone", st_collections_group_sound_tone},
+ {"collections.group.sounds.tone", st_collections_group_sound_tone}, /* dup */
+ {"collections.vibrations.sample.name", st_collections_group_vibration_sample_name},
+ {"collections.vibrations.sample.source", st_collections_group_vibration_sample_source},
+ FILTERS_STATEMENTS("collections.") /* dup */
+ {
+ "collections.group.vibrations.sample.name", st_collections_group_vibration_sample_name
+ }, /* dup */
+ {"collections.group.vibrations.sample.source", st_collections_group_vibration_sample_source}, /* dup */
+ {"collections.group.name", st_collections_group_name},
+ {"collections.group.skip_namespace_validation", st_collections_group_skip_namespace_validation},
+ {"collections.group.program_source", st_collections_group_program_source},
+ {"collections.group.inherit", st_collections_group_inherit},
+ {"collections.group.inherit_only", st_collections_group_inherit_only},
+ {"collections.group.use_custom_seat_names", st_collections_group_use_custom_seat_names},
+ {"collections.group.target_group", st_collections_group_target_group}, /* dup */
+ {"collections.group.part_remove", st_collections_group_part_remove},
+ {"collections.group.program_remove", st_collections_group_program_remove},
+ {"collections.group.lua_script_only", st_collections_group_lua_script_only},
+ {"collections.group.script_recursion", st_collections_group_script_recursion},
+ {"collections.group.alias", st_collections_group_alias},
+ {"collections.group.min", st_collections_group_min},
+ {"collections.group.max", st_collections_group_max},
+ {"collections.group.scene_size", st_collections_group_scene_size},
+ {"collections.group.broadcast_signal", st_collections_group_broadcast_signal},
+ {"collections.group.orientation", st_collections_group_orientation},
+ {"collections.group.mouse_events", st_collections_group_mouse_events},
+ {"collections.group.inherit_script", st_collections_group_inherit_script},
+ {"collections.group.data.item", st_collections_group_data_item},
+ {"collections.group.limits.horizontal", st_collections_group_limits_horizontal},
+ {"collections.group.limits.vertical", st_collections_group_limits_vertical},
+ {"collections.group.externals.external", st_externals_external}, /* dup */
+ {"collections.group.programs.target_group", st_collections_group_target_group}, /* dup */
+ IMAGE_SET_STATEMENTS("collections.group")
+ IMAGE_STATEMENTS("collections.group.")
+ {
+ "collections.group.models.model", st_models_model
+ },
+ {"collections.group.font", st_fonts_font}, /* dup */
+ FONT_STYLE_CC_STATEMENTS("collections.group.")
+ TEXT_CLASS_STATEMENTS("collections.group.")
+ SIZE_CLASS_STATEMENTS("collections.group.")
+ {
+ "collections.group.parts.alias", st_collections_group_parts_alias
+ },
+ IMAGE_SET_STATEMENTS("collections.group.parts")
+ IMAGE_STATEMENTS("collections.group.parts.")
+ {
+ "collections.group.parts.font", st_fonts_font
+ }, /* dup */
+ FONT_STYLE_CC_STATEMENTS("collections.group.parts.")
+ TEXT_CLASS_STATEMENTS("collections.group.parts.")
+ SIZE_CLASS_STATEMENTS("collections.group.parts.")
+ {
+ "collections.group.parts.target_group", st_collections_group_target_group
+ }, /* dup */
+ {"collections.group.parts.part.name", st_collections_group_parts_part_name},
+ {"collections.group.parts.part.target_group", st_collections_group_target_group}, /* dup */
+ {"collections.group.parts.part.inherit", st_collections_group_parts_part_inherit},
+ {"collections.group.parts.part.api", st_collections_group_parts_part_api},
+ {"collections.group.parts.part.type", st_collections_group_parts_part_type},
#ifdef HAVE_EPHYSICS
- {"collections.group.parts.part.physics_body", st_collections_group_parts_part_physics_body},
+ {"collections.group.parts.part.physics_body", st_collections_group_parts_part_physics_body},
#endif
- {"collections.group.parts.part.insert_before", st_collections_group_parts_part_insert_before},
- {"collections.group.parts.part.insert_after", st_collections_group_parts_part_insert_after},
- {"collections.group.parts.part.effect", st_collections_group_parts_part_effect},
- {"collections.group.parts.part.mouse_events", st_collections_group_parts_part_mouse_events},
- {"collections.group.parts.part.anti_alias", st_collections_group_parts_part_anti_alias},
- {"collections.group.parts.part.repeat_events", st_collections_group_parts_part_repeat_events},
- {"collections.group.parts.part.ignore_flags", st_collections_group_parts_part_ignore_flags},
- {"collections.group.parts.part.mask_flags", st_collections_group_parts_part_mask_flags},
- {"collections.group.parts.part.scale", st_collections_group_parts_part_scale},
- {"collections.group.parts.part.pointer_mode", st_collections_group_parts_part_pointer_mode},
- {"collections.group.parts.part.precise_is_inside", st_collections_group_parts_part_precise_is_inside},
- {"collections.group.parts.part.use_alternate_font_metrics", st_collections_group_parts_part_use_alternate_font_metrics},
- {"collections.group.parts.part.clip_to", st_collections_group_parts_part_clip_to_id},
- {"collections.group.parts.part.no_render", st_collections_group_parts_part_no_render},
- {"collections.group.parts.part.required", st_collections_group_parts_part_required},
- {"collections.group.parts.part.source", st_collections_group_parts_part_source},
- {"collections.group.parts.part.source2", st_collections_group_parts_part_source2},
- {"collections.group.parts.part.source3", st_collections_group_parts_part_source3},
- {"collections.group.parts.part.source4", st_collections_group_parts_part_source4},
- {"collections.group.parts.part.source5", st_collections_group_parts_part_source5},
- {"collections.group.parts.part.source6", st_collections_group_parts_part_source6},
- {"collections.group.parts.part.dragable.x", st_collections_group_parts_part_dragable_x},
- {"collections.group.parts.part.dragable.y", st_collections_group_parts_part_dragable_y},
- {"collections.group.parts.part.dragable.confine", st_collections_group_parts_part_dragable_confine},
- {"collections.group.parts.part.dragable.threshold", st_collections_group_parts_part_dragable_threshold},
- {"collections.group.parts.part.dragable.events", st_collections_group_parts_part_dragable_events},
- {"collections.group.parts.part.entry_mode", st_collections_group_parts_part_entry_mode},
- {"collections.group.parts.part.select_mode", st_collections_group_parts_part_select_mode},
- {"collections.group.parts.part.cursor_mode", st_collections_group_parts_part_cursor_mode},
- {"collections.group.parts.part.multiline", st_collections_group_parts_part_multiline},
- {"collections.group.parts.part.access", st_collections_group_parts_part_access},
- {"collections.group.parts.part.allowed_seats", st_collections_group_parts_part_allowed_seats},
- IMAGE_SET_STATEMENTS("collections.group.parts.part")
- IMAGE_STATEMENTS("collections.group.parts.part.")
- {"collections.group.parts.part.font", st_fonts_font}, /* dup */
- FONT_STYLE_CC_STATEMENTS("collections.group.parts.part.")
- TEXT_CLASS_STATEMENTS("collections.group.parts.part.")
- SIZE_CLASS_STATEMENTS("collections.group.parts.part.")
- {"collections.group.parts.part.box.items.item.type", st_collections_group_parts_part_box_items_item_type},
- {"collections.group.parts.part.box.items.item.name", st_collections_group_parts_part_box_items_item_name},
- {"collections.group.parts.part.box.items.item.source", st_collections_group_parts_part_box_items_item_source},
- {"collections.group.parts.part.box.items.item.min", st_collections_group_parts_part_box_items_item_min},
- {"collections.group.parts.part.box.items.item.spread", st_collections_group_parts_part_box_items_item_spread},
- {"collections.group.parts.part.box.items.item.prefer", st_collections_group_parts_part_box_items_item_prefer},
- {"collections.group.parts.part.box.items.item.max", st_collections_group_parts_part_box_items_item_max},
- {"collections.group.parts.part.box.items.item.padding", st_collections_group_parts_part_box_items_item_padding},
- {"collections.group.parts.part.box.items.item.align", st_collections_group_parts_part_box_items_item_align},
- {"collections.group.parts.part.box.items.item.weight", st_collections_group_parts_part_box_items_item_weight},
- {"collections.group.parts.part.box.items.item.aspect", st_collections_group_parts_part_box_items_item_aspect},
- {"collections.group.parts.part.box.items.item.aspect_mode", st_collections_group_parts_part_box_items_item_aspect_mode},
- {"collections.group.parts.part.box.items.item.options", st_collections_group_parts_part_box_items_item_options},
- {"collections.group.parts.part.table.items.item.type", st_collections_group_parts_part_box_items_item_type}, /* dup */
- {"collections.group.parts.part.table.items.item.name", st_collections_group_parts_part_box_items_item_name}, /* dup */
- {"collections.group.parts.part.table.items.item.source", st_collections_group_parts_part_box_items_item_source}, /* dup */
- {"collections.group.parts.part.table.items.item.min", st_collections_group_parts_part_box_items_item_min}, /* dup */
- {"collections.group.parts.part.table.items.item.spread", st_collections_group_parts_part_box_items_item_spread}, /* dup */
- {"collections.group.parts.part.table.items.item.prefer", st_collections_group_parts_part_box_items_item_prefer}, /* dup */
- {"collections.group.parts.part.table.items.item.max", st_collections_group_parts_part_box_items_item_max}, /* dup */
- {"collections.group.parts.part.table.items.item.padding", st_collections_group_parts_part_box_items_item_padding}, /* dup */
- {"collections.group.parts.part.table.items.item.align", st_collections_group_parts_part_box_items_item_align}, /* dup */
- {"collections.group.parts.part.table.items.item.weight", st_collections_group_parts_part_box_items_item_weight}, /* dup */
- {"collections.group.parts.part.table.items.item.aspect", st_collections_group_parts_part_box_items_item_aspect}, /* dup */
- {"collections.group.parts.part.table.items.item.aspect_mode", st_collections_group_parts_part_box_items_item_aspect_mode}, /* dup */
- {"collections.group.parts.part.table.items.item.options", st_collections_group_parts_part_box_items_item_options}, /* dup */
- {"collections.group.parts.part.table.items.item.position", st_collections_group_parts_part_table_items_item_position},
- {"collections.group.parts.part.table.items.item.span", st_collections_group_parts_part_table_items_item_span},
- {"collections.group.parts.part.description.target_group", st_collections_group_target_group}, /* dup */
- {"collections.group.parts.part.description.inherit", st_collections_group_parts_part_description_inherit},
- {"collections.group.parts.part.description.link.base", st_collections_group_parts_part_description_link_base},
- {"collections.group.parts.part.description.link.transition", st_collections_group_programs_program_transition},
- {"collections.group.parts.part.description.link.after", st_collections_group_programs_program_after},
- {"collections.group.parts.part.description.link.in", st_collections_group_programs_program_in},
- {"collections.group.parts.part.description.source", st_collections_group_parts_part_description_source},
- {"collections.group.parts.part.description.state", st_collections_group_parts_part_description_state},
- {"collections.group.parts.part.description.visible", st_collections_group_parts_part_description_visible},
- {"collections.group.parts.part.description.limit", st_collections_group_parts_part_description_limit},
- {"collections.group.parts.part.description.no_render", st_collections_group_parts_part_description_no_render},
- {"collections.group.parts.part.description.align", st_collections_group_parts_part_description_align},
- {"collections.group.parts.part.description.fixed", st_collections_group_parts_part_description_fixed},
- {"collections.group.parts.part.description.min", st_collections_group_parts_part_description_min},
- {"collections.group.parts.part.description.minmul", st_collections_group_parts_part_description_minmul},
- {"collections.group.parts.part.description.max", st_collections_group_parts_part_description_max},
- {"collections.group.parts.part.description.step", st_collections_group_parts_part_description_step},
- {"collections.group.parts.part.description.aspect", st_collections_group_parts_part_description_aspect},
- {"collections.group.parts.part.description.aspect_preference", st_collections_group_parts_part_description_aspect_preference},
- {"collections.group.parts.part.description.rel.to", st_collections_group_parts_part_description_rel_to},
- {"collections.group.parts.part.description.rel.to_x", st_collections_group_parts_part_description_rel_to_x},
- {"collections.group.parts.part.description.rel.to_y", st_collections_group_parts_part_description_rel_to_y},
- {"collections.group.parts.part.description.rel1.relative", st_collections_group_parts_part_description_rel1_relative},
- {"collections.group.parts.part.description.rel1.offset", st_collections_group_parts_part_description_rel1_offset},
- {"collections.group.parts.part.description.rel1.to", st_collections_group_parts_part_description_rel1_to},
- {"collections.group.parts.part.description.rel1.to_x", st_collections_group_parts_part_description_rel1_to_x},
- {"collections.group.parts.part.description.rel1.to_y", st_collections_group_parts_part_description_rel1_to_y},
- {"collections.group.parts.part.description.rel2.relative", st_collections_group_parts_part_description_rel2_relative},
- {"collections.group.parts.part.description.rel2.offset", st_collections_group_parts_part_description_rel2_offset},
- {"collections.group.parts.part.description.rel2.to", st_collections_group_parts_part_description_rel2_to},
- {"collections.group.parts.part.description.rel2.to_x", st_collections_group_parts_part_description_rel2_to_x},
- {"collections.group.parts.part.description.rel2.to_y", st_collections_group_parts_part_description_rel2_to_y},
- {"collections.group.parts.part.description.offset_scale", st_collections_group_parts_part_description_offset_scale},
- {"collections.group.parts.part.description.anchors.top", st_collections_group_parts_part_description_anchors_top},
- {"collections.group.parts.part.description.anchors.bottom", st_collections_group_parts_part_description_anchors_bottom},
- {"collections.group.parts.part.description.anchors.left", st_collections_group_parts_part_description_anchors_left},
- {"collections.group.parts.part.description.anchors.right", st_collections_group_parts_part_description_anchors_right},
- {"collections.group.parts.part.description.anchors.vertical_center", st_collections_group_parts_part_description_anchors_vertical_center},
- {"collections.group.parts.part.description.anchors.horizontal_center", st_collections_group_parts_part_description_anchors_horizontal_center},
- {"collections.group.parts.part.description.anchors.fill", st_collections_group_parts_part_description_anchors_fill},
- {"collections.group.parts.part.description.anchors.margin", st_collections_group_parts_part_description_anchors_margin},
- {"collections.group.parts.part.description.clip_to", st_collections_group_parts_part_description_clip_to_id},
- {"collections.group.parts.part.description.size_class", st_collections_group_parts_part_description_size_class},
- {"collections.group.parts.part.description.image.normal", st_collections_group_parts_part_description_image_normal},
- {"collections.group.parts.part.description.image.tween", st_collections_group_parts_part_description_image_tween},
- IMAGE_SET_STATEMENTS("collections.group.parts.part.description.image")
- IMAGE_STATEMENTS("collections.group.parts.part.description.image.")
- {"collections.group.parts.part.description.image.border", st_collections_group_parts_part_description_image_border},
- {"collections.group.parts.part.description.image.middle", st_collections_group_parts_part_description_image_middle},
- {"collections.group.parts.part.description.image.border_scale", st_collections_group_parts_part_description_image_border_scale},
- {"collections.group.parts.part.description.image.border_scale_by", st_collections_group_parts_part_description_image_border_scale_by},
- {"collections.group.parts.part.description.image.scale_hint", st_collections_group_parts_part_description_image_scale_hint},
- {"collections.group.parts.part.description.fill.smooth", st_collections_group_parts_part_description_fill_smooth},
- {"collections.group.parts.part.description.fill.origin.relative", st_collections_group_parts_part_description_fill_origin_relative},
- {"collections.group.parts.part.description.fill.origin.offset", st_collections_group_parts_part_description_fill_origin_offset},
- {"collections.group.parts.part.description.fill.size.relative", st_collections_group_parts_part_description_fill_size_relative},
- {"collections.group.parts.part.description.fill.size.offset", st_collections_group_parts_part_description_fill_size_offset},
- {"collections.group.parts.part.description.fill.type", st_collections_group_parts_part_description_fill_type},
- {"collections.group.parts.part.description.color_class", st_collections_group_parts_part_description_color_class},
- {"collections.group.parts.part.description.color", st_collections_group_parts_part_description_color},
- {"collections.group.parts.part.description.color2", st_collections_group_parts_part_description_color2},
- {"collections.group.parts.part.description.color3", st_collections_group_parts_part_description_color3},
- {"collections.group.parts.part.description.text.text", st_collections_group_parts_part_description_text_text},
- {"collections.group.parts.part.description.text.domain", st_collections_group_parts_part_description_text_domain},
- {"collections.group.parts.part.description.text.text_class", st_collections_group_parts_part_description_text_text_class},
- {"collections.group.parts.part.description.text.font", st_collections_group_parts_part_description_text_font},
- {"collections.group.parts.part.description.text.style", st_collections_group_parts_part_description_text_style},
- {"collections.group.parts.part.description.text.repch", st_collections_group_parts_part_description_text_repch},
- {"collections.group.parts.part.description.text.size", st_collections_group_parts_part_description_text_size},
- {"collections.group.parts.part.description.text.size_range", st_collections_group_parts_part_description_text_size_range},
- {"collections.group.parts.part.description.text.fit", st_collections_group_parts_part_description_text_fit},
- {"collections.group.parts.part.description.text.min", st_collections_group_parts_part_description_text_min},
- {"collections.group.parts.part.description.text.max", st_collections_group_parts_part_description_text_max},
- {"collections.group.parts.part.description.text.align", st_collections_group_parts_part_description_text_align},
- {"collections.group.parts.part.description.text.source", st_collections_group_parts_part_description_text_source},
- {"collections.group.parts.part.description.text.text_source", st_collections_group_parts_part_description_text_text_source},
- {"collections.group.parts.part.description.text.font", st_fonts_font}, /* dup */
- {"collections.group.parts.part.description.text.fonts.font", st_fonts_font}, /* dup */
- {"collections.group.parts.part.description.text.elipsis", st_collections_group_parts_part_description_text_ellipsis},
- {"collections.group.parts.part.description.text.ellipsis", st_collections_group_parts_part_description_text_ellipsis},
- {"collections.group.parts.part.description.text.filter", st_collections_group_parts_part_description_filter_code}, /* dup */
- {"collections.group.parts.part.description.box.layout", st_collections_group_parts_part_description_box_layout},
- {"collections.group.parts.part.description.box.align", st_collections_group_parts_part_description_box_align},
- {"collections.group.parts.part.description.box.padding", st_collections_group_parts_part_description_box_padding},
- {"collections.group.parts.part.description.box.min", st_collections_group_parts_part_description_box_min},
- {"collections.group.parts.part.description.table.homogeneous", st_collections_group_parts_part_description_table_homogeneous},
- {"collections.group.parts.part.description.table.align", st_collections_group_parts_part_description_table_align},
- {"collections.group.parts.part.description.table.padding", st_collections_group_parts_part_description_table_padding},
- {"collections.group.parts.part.description.table.min", st_collections_group_parts_part_description_table_min},
- {"collections.group.parts.part.description.proxy.source_visible", st_collections_group_parts_part_description_proxy_source_visible},
- {"collections.group.parts.part.description.proxy.source_clip", st_collections_group_parts_part_description_proxy_source_clip},
- {"collections.group.parts.part.description.position.point", st_collections_group_parts_part_description_position_point},
- {"collections.group.parts.part.description.position.space", st_collections_group_parts_part_description_position_space},
- {"collections.group.parts.part.description.properties.perspective", st_collections_group_parts_part_description_camera_properties},
- {"collections.group.parts.part.description.properties.ambient", st_collections_group_parts_part_description_properties_ambient},
- {"collections.group.parts.part.description.properties.diffuse", st_collections_group_parts_part_description_properties_diffuse},
- {"collections.group.parts.part.description.properties.specular", st_collections_group_parts_part_description_properties_specular},
- {"collections.group.parts.part.description.properties.material", st_collections_group_parts_part_description_properties_material},
- {"collections.group.parts.part.description.properties.normal", st_collections_group_parts_part_description_properties_normal},
- {"collections.group.parts.part.description.properties.shininess", st_collections_group_parts_part_description_properties_shininess},
- {"collections.group.parts.part.description.properties.shade", st_collections_group_parts_part_description_properties_shade},
- {"collections.group.parts.part.description.mesh.primitive", st_collections_group_parts_part_description_mesh_primitive},
- {"collections.group.parts.part.description.orientation.look1", st_collections_group_parts_part_description_orientation_look1},
- {"collections.group.parts.part.description.orientation.look2", st_collections_group_parts_part_description_orientation_look2},
- {"collections.group.parts.part.description.orientation.look_to", st_collections_group_parts_part_description_orientation_look_to},
- {"collections.group.parts.part.description.orientation.angle_axis", st_collections_group_parts_part_description_orientation_angle_axis},
- {"collections.group.parts.part.description.orientation.quaternion", st_collections_group_parts_part_description_orientation_quaternion},
- {"collections.group.parts.part.description.scale", st_collections_group_parts_part_description_scale},
- {"collections.group.parts.part.description.texture.image", st_collections_group_parts_part_description_texture_image},
- {"collections.group.parts.part.description.texture.wrap1", st_collections_group_parts_part_description_texture_wrap1},
- {"collections.group.parts.part.description.texture.wrap2", st_collections_group_parts_part_description_texture_wrap2},
- {"collections.group.parts.part.description.texture.filter1", st_collections_group_parts_part_description_texture_filter1},
- {"collections.group.parts.part.description.texture.filter2", st_collections_group_parts_part_description_texture_filter2},
- {"collections.group.parts.part.description.mesh.assembly", st_collections_group_parts_part_description_mesh_assembly},
- {"collections.group.parts.part.description.mesh.geometry", st_collections_group_parts_part_description_mesh_geometry},
- {"collections.group.parts.part.description.mesh.frame", st_collections_group_parts_part_description_mesh_frame},
- {"collections.group.parts.part.description.filter.code", st_collections_group_parts_part_description_filter_code},
- {"collections.group.parts.part.description.filter.source", st_collections_group_parts_part_description_filter_source},
- {"collections.group.parts.part.description.filter.data", st_collections_group_parts_part_description_filter_data},
+ {"collections.group.parts.part.insert_before", st_collections_group_parts_part_insert_before},
+ {"collections.group.parts.part.insert_after", st_collections_group_parts_part_insert_after},
+ {"collections.group.parts.part.effect", st_collections_group_parts_part_effect},
+ {"collections.group.parts.part.mouse_events", st_collections_group_parts_part_mouse_events},
+ {"collections.group.parts.part.anti_alias", st_collections_group_parts_part_anti_alias},
+ {"collections.group.parts.part.repeat_events", st_collections_group_parts_part_repeat_events},
+ {"collections.group.parts.part.ignore_flags", st_collections_group_parts_part_ignore_flags},
+ {"collections.group.parts.part.mask_flags", st_collections_group_parts_part_mask_flags},
+ {"collections.group.parts.part.scale", st_collections_group_parts_part_scale},
+ {"collections.group.parts.part.pointer_mode", st_collections_group_parts_part_pointer_mode},
+ {"collections.group.parts.part.precise_is_inside", st_collections_group_parts_part_precise_is_inside},
+ {"collections.group.parts.part.use_alternate_font_metrics", st_collections_group_parts_part_use_alternate_font_metrics},
+ {"collections.group.parts.part.clip_to", st_collections_group_parts_part_clip_to_id},
+ {"collections.group.parts.part.no_render", st_collections_group_parts_part_no_render},
+ {"collections.group.parts.part.required", st_collections_group_parts_part_required},
+ {"collections.group.parts.part.source", st_collections_group_parts_part_source},
+ {"collections.group.parts.part.source2", st_collections_group_parts_part_source2},
+ {"collections.group.parts.part.source3", st_collections_group_parts_part_source3},
+ {"collections.group.parts.part.source4", st_collections_group_parts_part_source4},
+ {"collections.group.parts.part.source5", st_collections_group_parts_part_source5},
+ {"collections.group.parts.part.source6", st_collections_group_parts_part_source6},
+ {"collections.group.parts.part.dragable.x", st_collections_group_parts_part_dragable_x},
+ {"collections.group.parts.part.dragable.y", st_collections_group_parts_part_dragable_y},
+ {"collections.group.parts.part.dragable.confine", st_collections_group_parts_part_dragable_confine},
+ {"collections.group.parts.part.dragable.threshold", st_collections_group_parts_part_dragable_threshold},
+ {"collections.group.parts.part.dragable.events", st_collections_group_parts_part_dragable_events},
+ {"collections.group.parts.part.entry_mode", st_collections_group_parts_part_entry_mode},
+ {"collections.group.parts.part.select_mode", st_collections_group_parts_part_select_mode},
+ {"collections.group.parts.part.cursor_mode", st_collections_group_parts_part_cursor_mode},
+ {"collections.group.parts.part.multiline", st_collections_group_parts_part_multiline},
+ {"collections.group.parts.part.access", st_collections_group_parts_part_access},
+ {"collections.group.parts.part.allowed_seats", st_collections_group_parts_part_allowed_seats},
+ IMAGE_SET_STATEMENTS("collections.group.parts.part")
+ IMAGE_STATEMENTS("collections.group.parts.part.")
+ {
+ "collections.group.parts.part.font", st_fonts_font
+ }, /* dup */
+ FONT_STYLE_CC_STATEMENTS("collections.group.parts.part.")
+ TEXT_CLASS_STATEMENTS("collections.group.parts.part.")
+ SIZE_CLASS_STATEMENTS("collections.group.parts.part.")
+ {
+ "collections.group.parts.part.box.items.item.type", st_collections_group_parts_part_box_items_item_type
+ },
+ {"collections.group.parts.part.box.items.item.name", st_collections_group_parts_part_box_items_item_name},
+ {"collections.group.parts.part.box.items.item.source", st_collections_group_parts_part_box_items_item_source},
+ {"collections.group.parts.part.box.items.item.min", st_collections_group_parts_part_box_items_item_min},
+ {"collections.group.parts.part.box.items.item.spread", st_collections_group_parts_part_box_items_item_spread},
+ {"collections.group.parts.part.box.items.item.prefer", st_collections_group_parts_part_box_items_item_prefer},
+ {"collections.group.parts.part.box.items.item.max", st_collections_group_parts_part_box_items_item_max},
+ {"collections.group.parts.part.box.items.item.padding", st_collections_group_parts_part_box_items_item_padding},
+ {"collections.group.parts.part.box.items.item.align", st_collections_group_parts_part_box_items_item_align},
+ {"collections.group.parts.part.box.items.item.weight", st_collections_group_parts_part_box_items_item_weight},
+ {"collections.group.parts.part.box.items.item.aspect", st_collections_group_parts_part_box_items_item_aspect},
+ {"collections.group.parts.part.box.items.item.aspect_mode", st_collections_group_parts_part_box_items_item_aspect_mode},
+ {"collections.group.parts.part.box.items.item.options", st_collections_group_parts_part_box_items_item_options},
+ {"collections.group.parts.part.table.items.item.type", st_collections_group_parts_part_box_items_item_type}, /* dup */
+ {"collections.group.parts.part.table.items.item.name", st_collections_group_parts_part_box_items_item_name}, /* dup */
+ {"collections.group.parts.part.table.items.item.source", st_collections_group_parts_part_box_items_item_source}, /* dup */
+ {"collections.group.parts.part.table.items.item.min", st_collections_group_parts_part_box_items_item_min}, /* dup */
+ {"collections.group.parts.part.table.items.item.spread", st_collections_group_parts_part_box_items_item_spread}, /* dup */
+ {"collections.group.parts.part.table.items.item.prefer", st_collections_group_parts_part_box_items_item_prefer}, /* dup */
+ {"collections.group.parts.part.table.items.item.max", st_collections_group_parts_part_box_items_item_max}, /* dup */
+ {"collections.group.parts.part.table.items.item.padding", st_collections_group_parts_part_box_items_item_padding}, /* dup */
+ {"collections.group.parts.part.table.items.item.align", st_collections_group_parts_part_box_items_item_align}, /* dup */
+ {"collections.group.parts.part.table.items.item.weight", st_collections_group_parts_part_box_items_item_weight}, /* dup */
+ {"collections.group.parts.part.table.items.item.aspect", st_collections_group_parts_part_box_items_item_aspect}, /* dup */
+ {"collections.group.parts.part.table.items.item.aspect_mode", st_collections_group_parts_part_box_items_item_aspect_mode}, /* dup */
+ {"collections.group.parts.part.table.items.item.options", st_collections_group_parts_part_box_items_item_options}, /* dup */
+ {"collections.group.parts.part.table.items.item.position", st_collections_group_parts_part_table_items_item_position},
+ {"collections.group.parts.part.table.items.item.span", st_collections_group_parts_part_table_items_item_span},
+ {"collections.group.parts.part.description.target_group", st_collections_group_target_group}, /* dup */
+ {"collections.group.parts.part.description.inherit", st_collections_group_parts_part_description_inherit},
+ {"collections.group.parts.part.description.link.base", st_collections_group_parts_part_description_link_base},
+ {"collections.group.parts.part.description.link.transition", st_collections_group_programs_program_transition},
+ {"collections.group.parts.part.description.link.after", st_collections_group_programs_program_after},
+ {"collections.group.parts.part.description.link.in", st_collections_group_programs_program_in},
+ {"collections.group.parts.part.description.source", st_collections_group_parts_part_description_source},
+ {"collections.group.parts.part.description.state", st_collections_group_parts_part_description_state},
+ {"collections.group.parts.part.description.visible", st_collections_group_parts_part_description_visible},
+ {"collections.group.parts.part.description.limit", st_collections_group_parts_part_description_limit},
+ {"collections.group.parts.part.description.no_render", st_collections_group_parts_part_description_no_render},
+ {"collections.group.parts.part.description.align", st_collections_group_parts_part_description_align},
+ {"collections.group.parts.part.description.fixed", st_collections_group_parts_part_description_fixed},
+ {"collections.group.parts.part.description.min", st_collections_group_parts_part_description_min},
+ {"collections.group.parts.part.description.minmul", st_collections_group_parts_part_description_minmul},
+ {"collections.group.parts.part.description.max", st_collections_group_parts_part_description_max},
+ {"collections.group.parts.part.description.step", st_collections_group_parts_part_description_step},
+ {"collections.group.parts.part.description.aspect", st_collections_group_parts_part_description_aspect},
+ {"collections.group.parts.part.description.aspect_preference", st_collections_group_parts_part_description_aspect_preference},
+ {"collections.group.parts.part.description.rel.to", st_collections_group_parts_part_description_rel_to},
+ {"collections.group.parts.part.description.rel.to_x", st_collections_group_parts_part_description_rel_to_x},
+ {"collections.group.parts.part.description.rel.to_y", st_collections_group_parts_part_description_rel_to_y},
+ {"collections.group.parts.part.description.rel1.relative", st_collections_group_parts_part_description_rel1_relative},
+ {"collections.group.parts.part.description.rel1.offset", st_collections_group_parts_part_description_rel1_offset},
+ {"collections.group.parts.part.description.rel1.to", st_collections_group_parts_part_description_rel1_to},
+ {"collections.group.parts.part.description.rel1.to_x", st_collections_group_parts_part_description_rel1_to_x},
+ {"collections.group.parts.part.description.rel1.to_y", st_collections_group_parts_part_description_rel1_to_y},
+ {"collections.group.parts.part.description.rel2.relative", st_collections_group_parts_part_description_rel2_relative},
+ {"collections.group.parts.part.description.rel2.offset", st_collections_group_parts_part_description_rel2_offset},
+ {"collections.group.parts.part.description.rel2.to", st_collections_group_parts_part_description_rel2_to},
+ {"collections.group.parts.part.description.rel2.to_x", st_collections_group_parts_part_description_rel2_to_x},
+ {"collections.group.parts.part.description.rel2.to_y", st_collections_group_parts_part_description_rel2_to_y},
+ {"collections.group.parts.part.description.offset_scale", st_collections_group_parts_part_description_offset_scale},
+ {"collections.group.parts.part.description.anchors.top", st_collections_group_parts_part_description_anchors_top},
+ {"collections.group.parts.part.description.anchors.bottom", st_collections_group_parts_part_description_anchors_bottom},
+ {"collections.group.parts.part.description.anchors.left", st_collections_group_parts_part_description_anchors_left},
+ {"collections.group.parts.part.description.anchors.right", st_collections_group_parts_part_description_anchors_right},
+ {"collections.group.parts.part.description.anchors.vertical_center", st_collections_group_parts_part_description_anchors_vertical_center},
+ {"collections.group.parts.part.description.anchors.horizontal_center", st_collections_group_parts_part_description_anchors_horizontal_center},
+ {"collections.group.parts.part.description.anchors.fill", st_collections_group_parts_part_description_anchors_fill},
+ {"collections.group.parts.part.description.anchors.margin", st_collections_group_parts_part_description_anchors_margin},
+ {"collections.group.parts.part.description.clip_to", st_collections_group_parts_part_description_clip_to_id},
+ {"collections.group.parts.part.description.size_class", st_collections_group_parts_part_description_size_class},
+ {"collections.group.parts.part.description.image.normal", st_collections_group_parts_part_description_image_normal},
+ {"collections.group.parts.part.description.image.tween", st_collections_group_parts_part_description_image_tween},
+ IMAGE_SET_STATEMENTS("collections.group.parts.part.description.image")
+ IMAGE_STATEMENTS("collections.group.parts.part.description.image.")
+ {
+ "collections.group.parts.part.description.image.border", st_collections_group_parts_part_description_image_border
+ },
+ {"collections.group.parts.part.description.image.middle", st_collections_group_parts_part_description_image_middle},
+ {"collections.group.parts.part.description.image.border_scale", st_collections_group_parts_part_description_image_border_scale},
+ {"collections.group.parts.part.description.image.border_scale_by", st_collections_group_parts_part_description_image_border_scale_by},
+ {"collections.group.parts.part.description.image.scale_hint", st_collections_group_parts_part_description_image_scale_hint},
+ {"collections.group.parts.part.description.fill.smooth", st_collections_group_parts_part_description_fill_smooth},
+ {"collections.group.parts.part.description.fill.origin.relative", st_collections_group_parts_part_description_fill_origin_relative},
+ {"collections.group.parts.part.description.fill.origin.offset", st_collections_group_parts_part_description_fill_origin_offset},
+ {"collections.group.parts.part.description.fill.size.relative", st_collections_group_parts_part_description_fill_size_relative},
+ {"collections.group.parts.part.description.fill.size.offset", st_collections_group_parts_part_description_fill_size_offset},
+ {"collections.group.parts.part.description.fill.type", st_collections_group_parts_part_description_fill_type},
+ {"collections.group.parts.part.description.color_class", st_collections_group_parts_part_description_color_class},
+ {"collections.group.parts.part.description.color", st_collections_group_parts_part_description_color},
+ {"collections.group.parts.part.description.color2", st_collections_group_parts_part_description_color2},
+ {"collections.group.parts.part.description.color3", st_collections_group_parts_part_description_color3},
+ {"collections.group.parts.part.description.text.text", st_collections_group_parts_part_description_text_text},
+ {"collections.group.parts.part.description.text.domain", st_collections_group_parts_part_description_text_domain},
+ {"collections.group.parts.part.description.text.text_class", st_collections_group_parts_part_description_text_text_class},
+ {"collections.group.parts.part.description.text.font", st_collections_group_parts_part_description_text_font},
+ {"collections.group.parts.part.description.text.style", st_collections_group_parts_part_description_text_style},
+ {"collections.group.parts.part.description.text.repch", st_collections_group_parts_part_description_text_repch},
+ {"collections.group.parts.part.description.text.size", st_collections_group_parts_part_description_text_size},
+ {"collections.group.parts.part.description.text.size_range", st_collections_group_parts_part_description_text_size_range},
+ {"collections.group.parts.part.description.text.fit", st_collections_group_parts_part_description_text_fit},
+ {"collections.group.parts.part.description.text.min", st_collections_group_parts_part_description_text_min},
+ {"collections.group.parts.part.description.text.max", st_collections_group_parts_part_description_text_max},
+ {"collections.group.parts.part.description.text.align", st_collections_group_parts_part_description_text_align},
+ {"collections.group.parts.part.description.text.source", st_collections_group_parts_part_description_text_source},
+ {"collections.group.parts.part.description.text.text_source", st_collections_group_parts_part_description_text_text_source},
+ {"collections.group.parts.part.description.text.font", st_fonts_font}, /* dup */
+ {"collections.group.parts.part.description.text.fonts.font", st_fonts_font}, /* dup */
+ {"collections.group.parts.part.description.text.elipsis", st_collections_group_parts_part_description_text_ellipsis},
+ {"collections.group.parts.part.description.text.ellipsis", st_collections_group_parts_part_description_text_ellipsis},
+ {"collections.group.parts.part.description.text.filter", st_collections_group_parts_part_description_filter_code}, /* dup */
+ {"collections.group.parts.part.description.box.layout", st_collections_group_parts_part_description_box_layout},
+ {"collections.group.parts.part.description.box.align", st_collections_group_parts_part_description_box_align},
+ {"collections.group.parts.part.description.box.padding", st_collections_group_parts_part_description_box_padding},
+ {"collections.group.parts.part.description.box.min", st_collections_group_parts_part_description_box_min},
+ {"collections.group.parts.part.description.table.homogeneous", st_collections_group_parts_part_description_table_homogeneous},
+ {"collections.group.parts.part.description.table.align", st_collections_group_parts_part_description_table_align},
+ {"collections.group.parts.part.description.table.padding", st_collections_group_parts_part_description_table_padding},
+ {"collections.group.parts.part.description.table.min", st_collections_group_parts_part_description_table_min},
+ {"collections.group.parts.part.description.proxy.source_visible", st_collections_group_parts_part_description_proxy_source_visible},
+ {"collections.group.parts.part.description.proxy.source_clip", st_collections_group_parts_part_description_proxy_source_clip},
+ {"collections.group.parts.part.description.position.point", st_collections_group_parts_part_description_position_point},
+ {"collections.group.parts.part.description.position.space", st_collections_group_parts_part_description_position_space},
+ {"collections.group.parts.part.description.properties.perspective", st_collections_group_parts_part_description_camera_properties},
+ {"collections.group.parts.part.description.properties.ambient", st_collections_group_parts_part_description_properties_ambient},
+ {"collections.group.parts.part.description.properties.diffuse", st_collections_group_parts_part_description_properties_diffuse},
+ {"collections.group.parts.part.description.properties.specular", st_collections_group_parts_part_description_properties_specular},
+ {"collections.group.parts.part.description.properties.material", st_collections_group_parts_part_description_properties_material},
+ {"collections.group.parts.part.description.properties.normal", st_collections_group_parts_part_description_properties_normal},
+ {"collections.group.parts.part.description.properties.shininess", st_collections_group_parts_part_description_properties_shininess},
+ {"collections.group.parts.part.description.properties.shade", st_collections_group_parts_part_description_properties_shade},
+ {"collections.group.parts.part.description.mesh.primitive", st_collections_group_parts_part_description_mesh_primitive},
+ {"collections.group.parts.part.description.orientation.look1", st_collections_group_parts_part_description_orientation_look1},
+ {"collections.group.parts.part.description.orientation.look2", st_collections_group_parts_part_description_orientation_look2},
+ {"collections.group.parts.part.description.orientation.look_to", st_collections_group_parts_part_description_orientation_look_to},
+ {"collections.group.parts.part.description.orientation.angle_axis", st_collections_group_parts_part_description_orientation_angle_axis},
+ {"collections.group.parts.part.description.orientation.quaternion", st_collections_group_parts_part_description_orientation_quaternion},
+ {"collections.group.parts.part.description.scale", st_collections_group_parts_part_description_scale},
+ {"collections.group.parts.part.description.texture.image", st_collections_group_parts_part_description_texture_image},
+ {"collections.group.parts.part.description.texture.wrap1", st_collections_group_parts_part_description_texture_wrap1},
+ {"collections.group.parts.part.description.texture.wrap2", st_collections_group_parts_part_description_texture_wrap2},
+ {"collections.group.parts.part.description.texture.filter1", st_collections_group_parts_part_description_texture_filter1},
+ {"collections.group.parts.part.description.texture.filter2", st_collections_group_parts_part_description_texture_filter2},
+ {"collections.group.parts.part.description.mesh.assembly", st_collections_group_parts_part_description_mesh_assembly},
+ {"collections.group.parts.part.description.mesh.geometry", st_collections_group_parts_part_description_mesh_geometry},
+ {"collections.group.parts.part.description.mesh.frame", st_collections_group_parts_part_description_mesh_frame},
+ {"collections.group.parts.part.description.filter.code", st_collections_group_parts_part_description_filter_code},
+ {"collections.group.parts.part.description.filter.source", st_collections_group_parts_part_description_filter_source},
+ {"collections.group.parts.part.description.filter.data", st_collections_group_parts_part_description_filter_data},
#ifdef HAVE_EPHYSICS
- {"collections.group.parts.part.description.physics.mass", st_collections_group_parts_part_description_physics_mass},
- {"collections.group.parts.part.description.physics.restitution", st_collections_group_parts_part_description_physics_restitution},
- {"collections.group.parts.part.description.physics.friction", st_collections_group_parts_part_description_physics_friction},
- {"collections.group.parts.part.description.physics.damping", st_collections_group_parts_part_description_physics_damping},
- {"collections.group.parts.part.description.physics.sleep", st_collections_group_parts_part_description_physics_sleep},
- {"collections.group.parts.part.description.physics.material", st_collections_group_parts_part_description_physics_material},
- {"collections.group.parts.part.description.physics.density", st_collections_group_parts_part_description_physics_density},
- {"collections.group.parts.part.description.physics.hardness", st_collections_group_parts_part_description_physics_hardness},
- {"collections.group.parts.part.description.physics.movement_freedom.linear", st_collections_group_parts_part_description_physics_movement_freedom_linear},
- {"collections.group.parts.part.description.physics.movement_freedom.angular", st_collections_group_parts_part_description_physics_movement_freedom_angular},
- {"collections.group.parts.part.description.physics.ignore_part_pos", st_collections_group_parts_part_description_physics_ignore_part_pos},
- {"collections.group.parts.part.description.physics.light_on", st_collections_group_parts_part_description_physics_light_on},
- {"collections.group.parts.part.description.physics.z", st_collections_group_parts_part_description_physics_z},
- {"collections.group.parts.part.description.physics.depth", st_collections_group_parts_part_description_physics_depth},
- {"collections.group.parts.part.description.physics.backface_cull", st_collections_group_parts_part_description_physics_backface_cull},
- {"collections.group.parts.part.description.physics.faces.face.type", st_collections_group_parts_part_description_physics_face_type},
- {"collections.group.parts.part.description.physics.faces.face.source", st_collections_group_parts_part_description_physics_face_source},
+ {"collections.group.parts.part.description.physics.mass", st_collections_group_parts_part_description_physics_mass},
+ {"collections.group.parts.part.description.physics.restitution", st_collections_group_parts_part_description_physics_restitution},
+ {"collections.group.parts.part.description.physics.friction", st_collections_group_parts_part_description_physics_friction},
+ {"collections.group.parts.part.description.physics.damping", st_collections_group_parts_part_description_physics_damping},
+ {"collections.group.parts.part.description.physics.sleep", st_collections_group_parts_part_description_physics_sleep},
+ {"collections.group.parts.part.description.physics.material", st_collections_group_parts_part_description_physics_material},
+ {"collections.group.parts.part.description.physics.density", st_collections_group_parts_part_description_physics_density},
+ {"collections.group.parts.part.description.physics.hardness", st_collections_group_parts_part_description_physics_hardness},
+ {"collections.group.parts.part.description.physics.movement_freedom.linear", st_collections_group_parts_part_description_physics_movement_freedom_linear},
+ {"collections.group.parts.part.description.physics.movement_freedom.angular", st_collections_group_parts_part_description_physics_movement_freedom_angular},
+ {"collections.group.parts.part.description.physics.ignore_part_pos", st_collections_group_parts_part_description_physics_ignore_part_pos},
+ {"collections.group.parts.part.description.physics.light_on", st_collections_group_parts_part_description_physics_light_on},
+ {"collections.group.parts.part.description.physics.z", st_collections_group_parts_part_description_physics_z},
+ {"collections.group.parts.part.description.physics.depth", st_collections_group_parts_part_description_physics_depth},
+ {"collections.group.parts.part.description.physics.backface_cull", st_collections_group_parts_part_description_physics_backface_cull},
+ {"collections.group.parts.part.description.physics.faces.face.type", st_collections_group_parts_part_description_physics_face_type},
+ {"collections.group.parts.part.description.physics.faces.face.source", st_collections_group_parts_part_description_physics_face_source},
#endif
- {"collections.group.parts.part.description.map.perspective", st_collections_group_parts_part_description_map_perspective},
- {"collections.group.parts.part.description.map.light", st_collections_group_parts_part_description_map_light},
- {"collections.group.parts.part.description.map.rotation.center", st_collections_group_parts_part_description_map_rotation_center},
- {"collections.group.parts.part.description.map.rotation.x", st_collections_group_parts_part_description_map_rotation_x},
- {"collections.group.parts.part.description.map.rotation.y", st_collections_group_parts_part_description_map_rotation_y},
- {"collections.group.parts.part.description.map.rotation.z", st_collections_group_parts_part_description_map_rotation_z},
- {"collections.group.parts.part.description.map.on", st_collections_group_parts_part_description_map_on},
- {"collections.group.parts.part.description.map.smooth", st_collections_group_parts_part_description_map_smooth},
- {"collections.group.parts.part.description.map.alpha", st_collections_group_parts_part_description_map_alpha},
- {"collections.group.parts.part.description.map.backface_cull", st_collections_group_parts_part_description_map_backface_cull},
- {"collections.group.parts.part.description.map.perspective_on", st_collections_group_parts_part_description_map_perspective_on},
- {"collections.group.parts.part.description.map.color", st_collections_group_parts_part_description_map_color},
- {"collections.group.parts.part.description.map.zoom.x", st_collections_group_parts_part_description_map_zoom_x},
- {"collections.group.parts.part.description.map.zoom.y", st_collections_group_parts_part_description_map_zoom_y},
- {"collections.group.parts.part.description.perspective.zplane", st_collections_group_parts_part_description_perspective_zplane},
- {"collections.group.parts.part.description.perspective.focal", st_collections_group_parts_part_description_perspective_focal},
- {"collections.group.parts.part.description.params.int", st_collections_group_parts_part_description_params_int},
- {"collections.group.parts.part.description.params.double", st_collections_group_parts_part_description_params_double},
- {"collections.group.parts.part.description.params.string", st_collections_group_parts_part_description_params_string},
- {"collections.group.parts.part.description.params.bool", st_collections_group_parts_part_description_params_bool},
- {"collections.group.parts.part.description.params.choice", st_collections_group_parts_part_description_params_choice},
- {"collections.group.parts.part.description.params.*", st_collections_group_parts_part_description_params_smart},
- IMAGE_STATEMENTS("collections.group.parts.part.description.")
- {"collections.group.parts.part.description.font", st_fonts_font}, /* dup */
- FONT_STYLE_CC_STATEMENTS("collections.group.parts.part.description.")
- TEXT_CLASS_STATEMENTS("collections.group.parts.part.description.")
- SIZE_CLASS_STATEMENTS("collections.group.parts.part.description.")
+ {"collections.group.parts.part.description.map.perspective", st_collections_group_parts_part_description_map_perspective},
+ {"collections.group.parts.part.description.map.light", st_collections_group_parts_part_description_map_light},
+ {"collections.group.parts.part.description.map.rotation.center", st_collections_group_parts_part_description_map_rotation_center},
+ {"collections.group.parts.part.description.map.rotation.x", st_collections_group_parts_part_description_map_rotation_x},
+ {"collections.group.parts.part.description.map.rotation.y", st_collections_group_parts_part_description_map_rotation_y},
+ {"collections.group.parts.part.description.map.rotation.z", st_collections_group_parts_part_description_map_rotation_z},
+ {"collections.group.parts.part.description.map.on", st_collections_group_parts_part_description_map_on},
+ {"collections.group.parts.part.description.map.smooth", st_collections_group_parts_part_description_map_smooth},
+ {"collections.group.parts.part.description.map.alpha", st_collections_group_parts_part_description_map_alpha},
+ {"collections.group.parts.part.description.map.backface_cull", st_collections_group_parts_part_description_map_backface_cull},
+ {"collections.group.parts.part.description.map.perspective_on", st_collections_group_parts_part_description_map_perspective_on},
+ {"collections.group.parts.part.description.map.color", st_collections_group_parts_part_description_map_color},
+ {"collections.group.parts.part.description.map.zoom.x", st_collections_group_parts_part_description_map_zoom_x},
+ {"collections.group.parts.part.description.map.zoom.y", st_collections_group_parts_part_description_map_zoom_y},
+ {"collections.group.parts.part.description.perspective.zplane", st_collections_group_parts_part_description_perspective_zplane},
+ {"collections.group.parts.part.description.perspective.focal", st_collections_group_parts_part_description_perspective_focal},
+ {"collections.group.parts.part.description.params.int", st_collections_group_parts_part_description_params_int},
+ {"collections.group.parts.part.description.params.double", st_collections_group_parts_part_description_params_double},
+ {"collections.group.parts.part.description.params.string", st_collections_group_parts_part_description_params_string},
+ {"collections.group.parts.part.description.params.bool", st_collections_group_parts_part_description_params_bool},
+ {"collections.group.parts.part.description.params.choice", st_collections_group_parts_part_description_params_choice},
+ {"collections.group.parts.part.description.params.*", st_collections_group_parts_part_description_params_smart},
+ IMAGE_STATEMENTS("collections.group.parts.part.description.")
+ {
+ "collections.group.parts.part.description.font", st_fonts_font
+ }, /* dup */
+ FONT_STYLE_CC_STATEMENTS("collections.group.parts.part.description.")
+ TEXT_CLASS_STATEMENTS("collections.group.parts.part.description.")
+ SIZE_CLASS_STATEMENTS("collections.group.parts.part.description.")
#ifdef HAVE_EPHYSICS
- {"collections.group.physics.world.gravity", st_collections_group_physics_world_gravity},
- {"collections.group.physics.world.rate", st_collections_group_physics_world_rate},
- {"collections.group.physics.world.z", st_collections_group_physics_world_z},
- {"collections.group.physics.world.depth", st_collections_group_physics_world_depth},
+ {
+ "collections.group.physics.world.gravity", st_collections_group_physics_world_gravity
+ },
+ {"collections.group.physics.world.rate", st_collections_group_physics_world_rate},
+ {"collections.group.physics.world.z", st_collections_group_physics_world_z},
+ {"collections.group.physics.world.depth", st_collections_group_physics_world_depth},
#endif
- FILTERS_STATEMENTS("collections.group.") /* dup */
- PROGRAM_STATEMENTS("collections.group.parts.part.description")
- PROGRAM_STATEMENTS("collections.group.parts.part")
- PROGRAM_STATEMENTS("collections.group.parts")
- PROGRAM_STATEMENTS("collections.group")
+ FILTERS_STATEMENTS("collections.group.") /* dup */
+ PROGRAM_STATEMENTS("collections.group.parts.part.description")
+ PROGRAM_STATEMENTS("collections.group.parts.part")
+ PROGRAM_STATEMENTS("collections.group.parts")
+ PROGRAM_STATEMENTS("collections.group")
};
/** @edcsection{lazedc,
@@ -1088,7 +1121,7 @@ New_Statement_Handler statement_handlers[] =
if a block name is the same as an existing EDC keyword.
@since 1.10
@endblock
-*/
+ */
/** @edcsubsection{lazedc_synonyms,
* LazEDC Synonyms} */
@@ -1123,19 +1156,18 @@ New_Statement_Handler statement_handlers[] =
These statements on the left are identical to their original keywords on the right.
@since 1.10
@endblock
-*/
-
+ */
New_Statement_Handler statement_handlers_short[] =
{
- {"collections.group.parts.part.before", st_collections_group_parts_part_insert_before},
- {"collections.group.parts.part.after", st_collections_group_parts_part_insert_after},
- {"collections.group.parts.part.ignore", st_collections_group_parts_part_ignore_flags},
- {"collections.group.parts.part.mask", st_collections_group_parts_part_mask_flags},
- {"collections.group.parts.part.pointer", st_collections_group_parts_part_pointer_mode},
- {"collections.group.parts.part.alt_font", st_collections_group_parts_part_use_alternate_font_metrics},
- {"collections.group.parts.part.clip", st_collections_group_parts_part_clip_to_id},
- {"collections.group.parts.part.description.clip", st_collections_group_parts_part_description_clip_to_id},
+ {"collections.group.parts.part.before", st_collections_group_parts_part_insert_before},
+ {"collections.group.parts.part.after", st_collections_group_parts_part_insert_after},
+ {"collections.group.parts.part.ignore", st_collections_group_parts_part_ignore_flags},
+ {"collections.group.parts.part.mask", st_collections_group_parts_part_mask_flags},
+ {"collections.group.parts.part.pointer", st_collections_group_parts_part_pointer_mode},
+ {"collections.group.parts.part.alt_font", st_collections_group_parts_part_use_alternate_font_metrics},
+ {"collections.group.parts.part.clip", st_collections_group_parts_part_clip_to_id},
+ {"collections.group.parts.part.description.clip", st_collections_group_parts_part_description_clip_to_id},
};
/** @edcsubsection{lazedc_shorthand,
@@ -1181,31 +1213,31 @@ New_Statement_Handler statement_handlers_short[] =
but they are shorter.
@since 1.10
@endblock
-*/
+ */
New_Statement_Handler statement_handlers_short_single[] =
{
- {"collections.group.parts.part.mouse", st_collections_group_parts_part_mouse},
- {"collections.group.parts.part.nomouse", st_collections_group_parts_part_nomouse},
- {"collections.group.parts.part.repeat", st_collections_group_parts_part_repeat},
- {"collections.group.parts.part.norepeat", st_collections_group_parts_part_norepeat},
- {"collections.group.parts.part.precise", st_collections_group_parts_part_precise},
- {"collections.group.parts.part.noprecise", st_collections_group_parts_part_noprecise},
- {"collections.group.parts.part.scale", st_collections_group_parts_part_scale},
- {"collections.group.parts.part.noscale", st_collections_group_parts_part_noscale},
- {"collections.group.parts.part.render", st_collections_group_parts_part_render},
- {"collections.group.parts.part.norender", st_collections_group_parts_part_no_render},
- {"collections.group.parts.part.required", st_collections_group_parts_part_required},
- {"collections.group.parts.part.norequired", st_collections_group_parts_part_norequired},
- {"collections.group.parts.part.description.vis", st_collections_group_parts_part_description_vis},
- {"collections.group.parts.part.description.hid", st_collections_group_parts_part_description_hid},
- {"collections.group.parts.part.description.offscale", st_collections_group_parts_part_description_offset_scale},
- {"collections.group.mouse", st_collections_group_mouse},
- {"collections.group.nomouse", st_collections_group_nomouse},
- {"collections.group.broadcast", st_collections_group_broadcast},
- {"collections.group.nobroadcast", st_collections_group_nobroadcast},
- {"collections.group.inherit_script", st_collections_group_inherit_script},
- {"collections.group.noinherit_script", st_collections_group_noinherit_script},
- {"collections.group.parts.part.description.inherit", st_collections_group_parts_part_description_inherit},
+ {"collections.group.parts.part.mouse", st_collections_group_parts_part_mouse},
+ {"collections.group.parts.part.nomouse", st_collections_group_parts_part_nomouse},
+ {"collections.group.parts.part.repeat", st_collections_group_parts_part_repeat},
+ {"collections.group.parts.part.norepeat", st_collections_group_parts_part_norepeat},
+ {"collections.group.parts.part.precise", st_collections_group_parts_part_precise},
+ {"collections.group.parts.part.noprecise", st_collections_group_parts_part_noprecise},
+ {"collections.group.parts.part.scale", st_collections_group_parts_part_scale},
+ {"collections.group.parts.part.noscale", st_collections_group_parts_part_noscale},
+ {"collections.group.parts.part.render", st_collections_group_parts_part_render},
+ {"collections.group.parts.part.norender", st_collections_group_parts_part_no_render},
+ {"collections.group.parts.part.required", st_collections_group_parts_part_required},
+ {"collections.group.parts.part.norequired", st_collections_group_parts_part_norequired},
+ {"collections.group.parts.part.description.vis", st_collections_group_parts_part_description_vis},
+ {"collections.group.parts.part.description.hid", st_collections_group_parts_part_description_hid},
+ {"collections.group.parts.part.description.offscale", st_collections_group_parts_part_description_offset_scale},
+ {"collections.group.mouse", st_collections_group_mouse},
+ {"collections.group.nomouse", st_collections_group_nomouse},
+ {"collections.group.broadcast", st_collections_group_broadcast},
+ {"collections.group.nobroadcast", st_collections_group_nobroadcast},
+ {"collections.group.inherit_script", st_collections_group_inherit_script},
+ {"collections.group.noinherit_script", st_collections_group_noinherit_script},
+ {"collections.group.parts.part.description.inherit", st_collections_group_parts_part_description_inherit},
};
/** @edcsubsection{lazedc_external_params,
@@ -1241,7 +1273,7 @@ New_Statement_Handler statement_handlers_short_single[] =
String without quotes except for 'true' or 'false' is considered as a choice.
@since 1.18
@endblock
-*/
+ */
static Edje_External_Param_Type
_parse_external_param_type(char *token)
{
@@ -1306,7 +1338,7 @@ st_collections_group_parts_part_description_params_smart(void)
exit(-1);
}
- ed = (Edje_Part_Description_External*) current_desc;
+ ed = (Edje_Part_Description_External *)current_desc;
last = eina_list_last_data_get(stack);
if (!strncmp(last, "params.", strlen("params.")))
@@ -1341,25 +1373,29 @@ st_collections_group_parts_part_description_params_smart(void)
switch (param->type)
{
case EDJE_EXTERNAL_PARAM_TYPE_BOOL:
- if (!strcmp(token, "true"))
- param->i = 1;
- else if (!strcmp(token, "false"))
- param->i = 0;
- break;
+ if (!strcmp(token, "true"))
+ param->i = 1;
+ else if (!strcmp(token, "false"))
+ param->i = 0;
+ break;
+
case EDJE_EXTERNAL_PARAM_TYPE_INT:
- param->i = parse_int(0);
- break;
+ param->i = parse_int(0);
+ break;
+
case EDJE_EXTERNAL_PARAM_TYPE_DOUBLE:
- param->d = parse_float(0);
- break;
+ param->d = parse_float(0);
+ break;
+
case EDJE_EXTERNAL_PARAM_TYPE_CHOICE:
case EDJE_EXTERNAL_PARAM_TYPE_STRING:
- param->s = parse_str(0);
- break;
+ param->s = parse_str(0);
+ break;
+
default:
- ERR("parse error %s:%i. Invalid param type.",
- file_in, line - 1);
- break;
+ ERR("parse error %s:%i. Invalid param type.",
+ file_in, line - 1);
+ break;
}
if (!found)
@@ -1368,196 +1404,196 @@ st_collections_group_parts_part_description_params_smart(void)
free(token);
}
-#define PROGRAM_OBJECTS(PREFIX) \
- {PREFIX".program", ob_collections_group_programs_program}, /* dup */ \
- {PREFIX".program.script", ob_collections_group_programs_program_script}, /* dup */ \
- {PREFIX".program.sequence.script", ob_collections_group_programs_program_script}, /* dup */ \
- {PREFIX".program.sequence", ob_collections_group_programs_program_sequence}, /* dup */ \
- {PREFIX".programs", NULL}, /* dup */ \
- {PREFIX".programs.set", ob_images_set}, /* dup */ \
- {PREFIX".programs.set.image", ob_images_set_image}, /* dup */ \
- {PREFIX".programs.images", NULL}, /* dup */ \
- {PREFIX".programs.images.set", ob_images_set}, /* dup */ \
- {PREFIX".programs.images.set.image", ob_images_set_image}, /* dup */ \
- {PREFIX".programs.fonts", NULL}, /* dup */ \
- {PREFIX".programs.program", ob_collections_group_programs_program}, /* dup */ \
- {PREFIX".programs.program.script", ob_collections_group_programs_program_script}, /* dup */ \
- {PREFIX".programs.program.sequence", ob_collections_group_programs_program_sequence}, /* dup */ \
- {PREFIX".programs.program.sequence.script", ob_collections_group_programs_program_script}, /* dup */ \
- {PREFIX".programs.script", ob_collections_group_script}, /* dup */ \
- {PREFIX".script", ob_collections_group_script}, /* dup */
+#define PROGRAM_OBJECTS(PREFIX) \
+ {PREFIX ".program", ob_collections_group_programs_program}, /* dup */ \
+ {PREFIX ".program.script", ob_collections_group_programs_program_script}, /* dup */ \
+ {PREFIX ".program.sequence.script", ob_collections_group_programs_program_script}, /* dup */ \
+ {PREFIX ".program.sequence", ob_collections_group_programs_program_sequence}, /* dup */ \
+ {PREFIX ".programs", NULL}, /* dup */ \
+ {PREFIX ".programs.set", ob_images_set}, /* dup */ \
+ {PREFIX ".programs.set.image", ob_images_set_image}, /* dup */ \
+ {PREFIX ".programs.images", NULL}, /* dup */ \
+ {PREFIX ".programs.images.set", ob_images_set}, /* dup */ \
+ {PREFIX ".programs.images.set.image", ob_images_set_image}, /* dup */ \
+ {PREFIX ".programs.fonts", NULL}, /* dup */ \
+ {PREFIX ".programs.program", ob_collections_group_programs_program}, /* dup */ \
+ {PREFIX ".programs.program.script", ob_collections_group_programs_program_script}, /* dup */ \
+ {PREFIX ".programs.program.sequence", ob_collections_group_programs_program_sequence}, /* dup */ \
+ {PREFIX ".programs.program.sequence.script", ob_collections_group_programs_program_script}, /* dup */ \
+ {PREFIX ".programs.script", ob_collections_group_script}, /* dup */ \
+ {PREFIX ".script", ob_collections_group_script}, /* dup */
New_Object_Handler object_handlers[] =
{
- {"externals", NULL},
- {"images", NULL},
- {"images.set", ob_images_set},
- {"images.set.image", ob_images_set_image},
- {"fonts", NULL},
- {"data", NULL},
- {"styles", NULL},
- {"styles.style", ob_styles_style},
- {"color_tree", ob_color_tree},
- {"color_classes", NULL},
- {"color_classes.color_class", ob_color_class},
- {"text_classes", NULL},
- {"text_classes.text_class", ob_text_class},
- {"size_classes", NULL},
- {"size_classes.size_class", ob_size_class},
- {"spectra", NULL},
- {"filters", NULL},
- {"filters.filter", ob_filters_filter},
- {"filters.filter.script", ob_filters_filter_script},
- {"collections", ob_collections},
- {"collections.externals", NULL}, /* dup */
- {"collections.set", ob_images_set}, /* dup */
- {"collections.set.image", ob_images_set_image}, /* dup */
- {"collections.images", NULL}, /* dup */
- {"collections.images.set", ob_images_set}, /* dup */
- {"collections.images.set.image", ob_images_set_image}, /* dup */
- {"collections.fonts", NULL}, /* dup */
- {"collections.styles", NULL}, /* dup */
- {"collections.styles.style", ob_styles_style}, /* dup */
- {"collections.color_tree", ob_color_tree}, /* dup */
- {"collections.color_classes", NULL}, /* dup */
- {"collections.color_classes.color_class", ob_color_class}, /* dup */
- {"collections.text_classes", NULL},
- {"collections.text_classes.text_class", ob_text_class}, /* dup */
- {"collections.size_classes", NULL}, /* dup */
- {"collections.size_classes.size_class", ob_size_class}, /* dup */
- {"collections.sounds", NULL},
- {"collections.group.sounds", NULL}, /* dup */
- {"collections.sounds.sample", NULL},
- {"collections.translation", NULL},
- {"collections.translation.file", NULL},
- {"collections.group.translation", NULL},/*dup*/
- {"collections.group.translation.file", NULL},/*dup*/
- {"collections.group.sounds.sample", NULL}, /* dup */
- {"collections.vibrations", NULL},
- {"collections.group.vibrations", NULL}, /* dup */
- {"collections.vibrations.sample", NULL},
- {"collections.filters", NULL},
- {"collections.filters.filter", ob_filters_filter}, /* dup */
- {"collections.filters.filter.script", ob_filters_filter_script}, /* dup */
- {"collections.group.vibrations.sample", NULL}, /* dup */
- {"collections.group", ob_collections_group},
- {"collections.group.data", NULL},
- {"collections.group.limits", NULL},
- {"collections.group.script", ob_collections_group_script},
- {"collections.group.lua_script", ob_collections_group_lua_script},
- {"collections.group.externals", NULL}, /* dup */
- {"collections.group.set", ob_images_set}, /* dup */
- {"collections.group.set.image", ob_images_set_image}, /* dup */
- {"collections.group.images", NULL}, /* dup */
- {"collections.group.models", NULL}, /* dup */
- {"collections.group.images.set", ob_images_set}, /* dup */
- {"collections.group.images.set.image", ob_images_set_image}, /* dup */
- {"collections.group.fonts", NULL}, /* dup */
- {"collections.group.styles", NULL}, /* dup */
- {"collections.group.styles.style", ob_styles_style}, /* dup */
- {"collections.group.color_tree", ob_color_tree}, /* dup */
- {"collections.group.color_classes", NULL}, /* dup */
- {"collections.group.color_classes.color_class", ob_color_class}, /* dup */
- {"collections.group.text_classes", NULL},
- {"collections.group.text_classes.text_class", ob_text_class}, /* dup */
- {"collections.group.size_classes", NULL}, /* dup */
- {"collections.group.size_classes.size_class", ob_size_class}, /* dup */
- {"collections.group.filters", NULL},
- {"collections.group.filters.filter", ob_filters_filter}, /* dup */
- {"collections.group.filters.filter.script", ob_filters_filter_script}, /* dup */
- {"collections.group.parts", NULL},
- {"collections.group.parts.set", ob_images_set}, /* dup */
- {"collections.group.parts.set.image", ob_images_set_image}, /* dup */
- {"collections.group.parts.images", NULL}, /* dup */
- {"collections.group.parts.images.set", ob_images_set}, /* dup */
- {"collections.group.parts.images.set.image", ob_images_set_image}, /* dup */
- {"collections.group.parts.fonts", NULL}, /* dup */
- {"collections.group.parts.styles", NULL}, /* dup */
- {"collections.group.parts.styles.style", ob_styles_style}, /* dup */
- {"collections.group.parts.color_classes", NULL}, /* dup */
- {"collections.group.parts.color_classes.color_class", ob_color_class}, /* dup */
- {"collections.group.parts.text_classes", NULL},
- {"collections.group.parts.text_classes.text_class", ob_text_class}, /* dup */
- {"collections.group.parts.size_classes", NULL}, /* dup */
- {"collections.group.parts.size_classes.size_class", ob_size_class}, /* dup */
- {"collections.group.parts.part", ob_collections_group_parts_part},
- {"collections.group.parts.part.dragable", NULL},
- {"collections.group.parts.part.set", ob_images_set}, /* dup */
- {"collections.group.parts.part.set.image", ob_images_set_image}, /* dup */
- {"collections.group.parts.part.images", NULL}, /* dup */
- {"collections.group.parts.part.images.set", ob_images_set}, /* dup */
- {"collections.group.parts.part.images.set.image", ob_images_set_image}, /* dup */
- {"collections.group.parts.part.fonts", NULL}, /* dup */
- {"collections.group.parts.part.styles", NULL}, /* dup */
- {"collections.group.parts.part.styles.style", ob_styles_style}, /* dup */
- {"collections.group.parts.part.color_classes", NULL}, /* dup */
- {"collections.group.parts.part.color_classes.color_class", ob_color_class}, /* dup */
- {"collections.group.parts.part.text_classes", NULL},
- {"collections.group.parts.part.text_classes.text_class", ob_text_class}, /* dup */
- {"collections.group.parts.part.size_classes", NULL}, /* dup */
- {"collections.group.parts.part.size_classes.size_class", ob_size_class}, /* dup */
- {"collections.group.parts.part.box", NULL},
- {"collections.group.parts.part.box.items", NULL},
- {"collections.group.parts.part.box.items.item", ob_collections_group_parts_part_box_items_item},
- {"collections.group.parts.part.table", NULL},
- {"collections.group.parts.part.table.items", NULL},
- {"collections.group.parts.part.table.items.item", ob_collections_group_parts_part_box_items_item}, /* dup */
- {"collections.group.parts.part.description", ob_collections_group_parts_part_description},
- {"collections.group.parts.part.description.link", ob_collections_group_parts_part_description_link},
- {"collections.group.parts.part.description.rel1", NULL},
- {"collections.group.parts.part.description.rel2", NULL},
- {"collections.group.parts.part.description.anchors", NULL},
- {"collections.group.parts.part.description.image", NULL}, /* dup */
- {"collections.group.parts.part.description.image.set", ob_images_set}, /* dup */
- {"collections.group.parts.part.description.image.set.image", ob_images_set_image}, /* dup */
- {"collections.group.parts.part.description.image.images", NULL}, /* dup */
- {"collections.group.parts.part.description.image.images.set", ob_images_set}, /* dup */
- {"collections.group.parts.part.description.image.images.set.image", ob_images_set_image}, /* dup */
- {"collections.group.parts.part.description.fill", NULL},
- {"collections.group.parts.part.description.fill.origin", NULL},
- {"collections.group.parts.part.description.fill.size", NULL},
- {"collections.group.parts.part.description.text", NULL},
- {"collections.group.parts.part.description.text.fonts", NULL}, /* dup */
- {"collections.group.parts.part.description.images", NULL}, /* dup */
- {"collections.group.parts.part.description.images.set", ob_images_set}, /* dup */
- {"collections.group.parts.part.description.images.set.image", ob_images_set_image}, /* dup */
- {"collections.group.parts.part.description.fonts", NULL}, /* dup */
- {"collections.group.parts.part.description.styles", NULL}, /* dup */
- {"collections.group.parts.part.description.styles.style", ob_styles_style}, /* dup */
- {"collections.group.parts.part.description.box", NULL},
- {"collections.group.parts.part.description.table", NULL},
- {"collections.group.parts.part.description.position", NULL},
- {"collections.group.parts.part.description.properties", NULL},
- {"collections.group.parts.part.description.orientation", NULL},
- {"collections.group.parts.part.description.texture", ob_collections_group_parts_part_description_texture},
- {"collections.group.parts.part.description.mesh", NULL},
- {"collections.group.parts.part.description.filter", NULL},
- {"collections.group.parts.part.description.proxy", NULL},
+ {"externals", NULL},
+ {"images", NULL},
+ {"images.set", ob_images_set},
+ {"images.set.image", ob_images_set_image},
+ {"fonts", NULL},
+ {"data", NULL},
+ {"styles", NULL},
+ {"styles.style", ob_styles_style},
+ {"color_tree", ob_color_tree},
+ {"color_classes", NULL},
+ {"color_classes.color_class", ob_color_class},
+ {"text_classes", NULL},
+ {"text_classes.text_class", ob_text_class},
+ {"size_classes", NULL},
+ {"size_classes.size_class", ob_size_class},
+ {"spectra", NULL},
+ {"filters", NULL},
+ {"filters.filter", ob_filters_filter},
+ {"filters.filter.script", ob_filters_filter_script},
+ {"collections", ob_collections},
+ {"collections.externals", NULL}, /* dup */
+ {"collections.set", ob_images_set}, /* dup */
+ {"collections.set.image", ob_images_set_image}, /* dup */
+ {"collections.images", NULL}, /* dup */
+ {"collections.images.set", ob_images_set}, /* dup */
+ {"collections.images.set.image", ob_images_set_image}, /* dup */
+ {"collections.fonts", NULL}, /* dup */
+ {"collections.styles", NULL}, /* dup */
+ {"collections.styles.style", ob_styles_style}, /* dup */
+ {"collections.color_tree", ob_color_tree}, /* dup */
+ {"collections.color_classes", NULL}, /* dup */
+ {"collections.color_classes.color_class", ob_color_class}, /* dup */
+ {"collections.text_classes", NULL},
+ {"collections.text_classes.text_class", ob_text_class}, /* dup */
+ {"collections.size_classes", NULL}, /* dup */
+ {"collections.size_classes.size_class", ob_size_class}, /* dup */
+ {"collections.sounds", NULL},
+ {"collections.group.sounds", NULL}, /* dup */
+ {"collections.sounds.sample", NULL},
+ {"collections.translation", NULL},
+ {"collections.translation.file", NULL},
+ {"collections.group.translation", NULL}, /*dup*/
+ {"collections.group.translation.file", NULL}, /*dup*/
+ {"collections.group.sounds.sample", NULL}, /* dup */
+ {"collections.vibrations", NULL},
+ {"collections.group.vibrations", NULL}, /* dup */
+ {"collections.vibrations.sample", NULL},
+ {"collections.filters", NULL},
+ {"collections.filters.filter", ob_filters_filter}, /* dup */
+ {"collections.filters.filter.script", ob_filters_filter_script}, /* dup */
+ {"collections.group.vibrations.sample", NULL}, /* dup */
+ {"collections.group", ob_collections_group},
+ {"collections.group.data", NULL},
+ {"collections.group.limits", NULL},
+ {"collections.group.script", ob_collections_group_script},
+ {"collections.group.lua_script", ob_collections_group_lua_script},
+ {"collections.group.externals", NULL}, /* dup */
+ {"collections.group.set", ob_images_set}, /* dup */
+ {"collections.group.set.image", ob_images_set_image}, /* dup */
+ {"collections.group.images", NULL}, /* dup */
+ {"collections.group.models", NULL}, /* dup */
+ {"collections.group.images.set", ob_images_set}, /* dup */
+ {"collections.group.images.set.image", ob_images_set_image}, /* dup */
+ {"collections.group.fonts", NULL}, /* dup */
+ {"collections.group.styles", NULL}, /* dup */
+ {"collections.group.styles.style", ob_styles_style}, /* dup */
+ {"collections.group.color_tree", ob_color_tree}, /* dup */
+ {"collections.group.color_classes", NULL}, /* dup */
+ {"collections.group.color_classes.color_class", ob_color_class}, /* dup */
+ {"collections.group.text_classes", NULL},
+ {"collections.group.text_classes.text_class", ob_text_class}, /* dup */
+ {"collections.group.size_classes", NULL}, /* dup */
+ {"collections.group.size_classes.size_class", ob_size_class}, /* dup */
+ {"collections.group.filters", NULL},
+ {"collections.group.filters.filter", ob_filters_filter}, /* dup */
+ {"collections.group.filters.filter.script", ob_filters_filter_script}, /* dup */
+ {"collections.group.parts", NULL},
+ {"collections.group.parts.set", ob_images_set}, /* dup */
+ {"collections.group.parts.set.image", ob_images_set_image}, /* dup */
+ {"collections.group.parts.images", NULL}, /* dup */
+ {"collections.group.parts.images.set", ob_images_set}, /* dup */
+ {"collections.group.parts.images.set.image", ob_images_set_image}, /* dup */
+ {"collections.group.parts.fonts", NULL}, /* dup */
+ {"collections.group.parts.styles", NULL}, /* dup */
+ {"collections.group.parts.styles.style", ob_styles_style}, /* dup */
+ {"collections.group.parts.color_classes", NULL}, /* dup */
+ {"collections.group.parts.color_classes.color_class", ob_color_class}, /* dup */
+ {"collections.group.parts.text_classes", NULL},
+ {"collections.group.parts.text_classes.text_class", ob_text_class}, /* dup */
+ {"collections.group.parts.size_classes", NULL}, /* dup */
+ {"collections.group.parts.size_classes.size_class", ob_size_class}, /* dup */
+ {"collections.group.parts.part", ob_collections_group_parts_part},
+ {"collections.group.parts.part.dragable", NULL},
+ {"collections.group.parts.part.set", ob_images_set}, /* dup */
+ {"collections.group.parts.part.set.image", ob_images_set_image}, /* dup */
+ {"collections.group.parts.part.images", NULL}, /* dup */
+ {"collections.group.parts.part.images.set", ob_images_set}, /* dup */
+ {"collections.group.parts.part.images.set.image", ob_images_set_image}, /* dup */
+ {"collections.group.parts.part.fonts", NULL}, /* dup */
+ {"collections.group.parts.part.styles", NULL}, /* dup */
+ {"collections.group.parts.part.styles.style", ob_styles_style}, /* dup */
+ {"collections.group.parts.part.color_classes", NULL}, /* dup */
+ {"collections.group.parts.part.color_classes.color_class", ob_color_class}, /* dup */
+ {"collections.group.parts.part.text_classes", NULL},
+ {"collections.group.parts.part.text_classes.text_class", ob_text_class}, /* dup */
+ {"collections.group.parts.part.size_classes", NULL}, /* dup */
+ {"collections.group.parts.part.size_classes.size_class", ob_size_class}, /* dup */
+ {"collections.group.parts.part.box", NULL},
+ {"collections.group.parts.part.box.items", NULL},
+ {"collections.group.parts.part.box.items.item", ob_collections_group_parts_part_box_items_item},
+ {"collections.group.parts.part.table", NULL},
+ {"collections.group.parts.part.table.items", NULL},
+ {"collections.group.parts.part.table.items.item", ob_collections_group_parts_part_box_items_item}, /* dup */
+ {"collections.group.parts.part.description", ob_collections_group_parts_part_description},
+ {"collections.group.parts.part.description.link", ob_collections_group_parts_part_description_link},
+ {"collections.group.parts.part.description.rel1", NULL},
+ {"collections.group.parts.part.description.rel2", NULL},
+ {"collections.group.parts.part.description.anchors", NULL},
+ {"collections.group.parts.part.description.image", NULL}, /* dup */
+ {"collections.group.parts.part.description.image.set", ob_images_set}, /* dup */
+ {"collections.group.parts.part.description.image.set.image", ob_images_set_image}, /* dup */
+ {"collections.group.parts.part.description.image.images", NULL}, /* dup */
+ {"collections.group.parts.part.description.image.images.set", ob_images_set}, /* dup */
+ {"collections.group.parts.part.description.image.images.set.image", ob_images_set_image}, /* dup */
+ {"collections.group.parts.part.description.fill", NULL},
+ {"collections.group.parts.part.description.fill.origin", NULL},
+ {"collections.group.parts.part.description.fill.size", NULL},
+ {"collections.group.parts.part.description.text", NULL},
+ {"collections.group.parts.part.description.text.fonts", NULL}, /* dup */
+ {"collections.group.parts.part.description.images", NULL}, /* dup */
+ {"collections.group.parts.part.description.images.set", ob_images_set}, /* dup */
+ {"collections.group.parts.part.description.images.set.image", ob_images_set_image}, /* dup */
+ {"collections.group.parts.part.description.fonts", NULL}, /* dup */
+ {"collections.group.parts.part.description.styles", NULL}, /* dup */
+ {"collections.group.parts.part.description.styles.style", ob_styles_style}, /* dup */
+ {"collections.group.parts.part.description.box", NULL},
+ {"collections.group.parts.part.description.table", NULL},
+ {"collections.group.parts.part.description.position", NULL},
+ {"collections.group.parts.part.description.properties", NULL},
+ {"collections.group.parts.part.description.orientation", NULL},
+ {"collections.group.parts.part.description.texture", ob_collections_group_parts_part_description_texture},
+ {"collections.group.parts.part.description.mesh", NULL},
+ {"collections.group.parts.part.description.filter", NULL},
+ {"collections.group.parts.part.description.proxy", NULL},
#ifdef HAVE_EPHYSICS
- {"collections.group.parts.part.description.physics", NULL},
- {"collections.group.parts.part.description.physics.movement_freedom", NULL},
- {"collections.group.parts.part.description.physics.faces", NULL},
- {"collections.group.parts.part.description.physics.faces.face", st_collections_group_parts_part_description_physics_face},
+ {"collections.group.parts.part.description.physics", NULL},
+ {"collections.group.parts.part.description.physics.movement_freedom", NULL},
+ {"collections.group.parts.part.description.physics.faces", NULL},
+ {"collections.group.parts.part.description.physics.faces.face", st_collections_group_parts_part_description_physics_face},
#endif
- {"collections.group.parts.part.description.map", NULL},
- {"collections.group.parts.part.description.map.rotation", NULL},
- {"collections.group.parts.part.description.map.zoom", NULL},
- {"collections.group.parts.part.description.perspective", NULL},
- {"collections.group.parts.part.description.params", NULL},
- {"collections.group.parts.part.description.color_classes", NULL}, /* dup */
- {"collections.group.parts.part.description.color_classes.color_class", ob_color_class}, /* dup */
- {"collections.group.parts.part.description.text_classes", NULL}, /* dup */
- {"collections.group.parts.part.description.text_classes.text_class", ob_text_class}, /* dup */
- {"collections.group.parts.part.description.size_classes", NULL}, /* dup */
- {"collections.group.parts.part.description.size_classes.size_class", ob_size_class}, /* dup */
+ {"collections.group.parts.part.description.map", NULL},
+ {"collections.group.parts.part.description.map.rotation", NULL},
+ {"collections.group.parts.part.description.map.zoom", NULL},
+ {"collections.group.parts.part.description.perspective", NULL},
+ {"collections.group.parts.part.description.params", NULL},
+ {"collections.group.parts.part.description.color_classes", NULL}, /* dup */
+ {"collections.group.parts.part.description.color_classes.color_class", ob_color_class}, /* dup */
+ {"collections.group.parts.part.description.text_classes", NULL}, /* dup */
+ {"collections.group.parts.part.description.text_classes.text_class", ob_text_class}, /* dup */
+ {"collections.group.parts.part.description.size_classes", NULL}, /* dup */
+ {"collections.group.parts.part.description.size_classes.size_class", ob_size_class}, /* dup */
#ifdef HAVE_EPHYSICS
- {"collections.group.physics", NULL},
- {"collections.group.physics.world", NULL},
+ {"collections.group.physics", NULL},
+ {"collections.group.physics.world", NULL},
#endif
- PROGRAM_OBJECTS("collections.group.parts.part.description")
- PROGRAM_OBJECTS("collections.group.parts.part")
- PROGRAM_OBJECTS("collections.group.parts")
- PROGRAM_OBJECTS("collections.group")
+ PROGRAM_OBJECTS("collections.group.parts.part.description")
+ PROGRAM_OBJECTS("collections.group.parts.part")
+ PROGRAM_OBJECTS("collections.group.parts")
+ PROGRAM_OBJECTS("collections.group")
};
/** @edcsubsection{lazedc_blocks,
@@ -1591,45 +1627,45 @@ New_Object_Handler object_handlers[] =
@description
Lowercase part types can be specified as blocks with the same effect as part { type: TYPE; }
The "description" block can also be shortened to "desc".
-
+
@since 1.10
@endblock
-*/
+ */
New_Object_Handler object_handlers_short[] =
{
- {"collections.group.parts.rect", ob_collections_group_parts_part_short},
- {"collections.group.parts.text", ob_collections_group_parts_part_short},
- {"collections.group.parts.image", ob_collections_group_parts_part_short},
- {"collections.group.parts.swallow", ob_collections_group_parts_part_short},
- {"collections.group.parts.textblock", ob_collections_group_parts_part_short},
- {"collections.group.parts.group", ob_collections_group_parts_part_short},
- {"collections.group.parts.box", ob_collections_group_parts_part_short},
- {"collections.group.parts.table", ob_collections_group_parts_part_short},
- {"collections.group.parts.external", ob_collections_group_parts_part_short},
- {"collections.group.parts.proxy", ob_collections_group_parts_part_short},
- {"collections.group.parts.spacer", ob_collections_group_parts_part_short},
- {"collections.group.parts.snapshot", ob_collections_group_parts_part_short},
- {"collections.group.parts.part.desc", ob_collections_group_parts_part_desc},
- {"collections.group.parts.vector", ob_collections_group_parts_part_short},
+ {"collections.group.parts.rect", ob_collections_group_parts_part_short},
+ {"collections.group.parts.text", ob_collections_group_parts_part_short},
+ {"collections.group.parts.image", ob_collections_group_parts_part_short},
+ {"collections.group.parts.swallow", ob_collections_group_parts_part_short},
+ {"collections.group.parts.textblock", ob_collections_group_parts_part_short},
+ {"collections.group.parts.group", ob_collections_group_parts_part_short},
+ {"collections.group.parts.box", ob_collections_group_parts_part_short},
+ {"collections.group.parts.table", ob_collections_group_parts_part_short},
+ {"collections.group.parts.external", ob_collections_group_parts_part_short},
+ {"collections.group.parts.proxy", ob_collections_group_parts_part_short},
+ {"collections.group.parts.spacer", ob_collections_group_parts_part_short},
+ {"collections.group.parts.snapshot", ob_collections_group_parts_part_short},
+ {"collections.group.parts.part.desc", ob_collections_group_parts_part_desc},
+ {"collections.group.parts.vector", ob_collections_group_parts_part_short},
};
New_Nested_Handler nested_handlers[] = {
- {"collections.group.parts", "part", NULL, edje_cc_handlers_hierarchy_pop }
+ {"collections.group.parts", "part", NULL, edje_cc_handlers_hierarchy_pop }
};
New_Nested_Handler nested_handlers_short[] = {
- {"collections.group.parts", "rect", NULL, edje_cc_handlers_hierarchy_pop },
- {"collections.group.parts", "text", NULL, edje_cc_handlers_hierarchy_pop },
- {"collections.group.parts", "image", NULL, edje_cc_handlers_hierarchy_pop },
- {"collections.group.parts", "swallow", NULL, edje_cc_handlers_hierarchy_pop },
- {"collections.group.parts", "textblock", NULL, edje_cc_handlers_hierarchy_pop },
- {"collections.group.parts", "group", NULL, edje_cc_handlers_hierarchy_pop },
- {"collections.group.parts", "box", NULL, edje_cc_handlers_hierarchy_pop },
- {"collections.group.parts", "table", NULL, edje_cc_handlers_hierarchy_pop },
- {"collections.group.parts", "external", NULL, edje_cc_handlers_hierarchy_pop },
- {"collections.group.parts", "proxy", NULL, edje_cc_handlers_hierarchy_pop },
- {"collections.group.parts", "spacer", NULL, edje_cc_handlers_hierarchy_pop },
- {"collections.group.parts", "vector", NULL, edje_cc_handlers_hierarchy_pop },
+ {"collections.group.parts", "rect", NULL, edje_cc_handlers_hierarchy_pop },
+ {"collections.group.parts", "text", NULL, edje_cc_handlers_hierarchy_pop },
+ {"collections.group.parts", "image", NULL, edje_cc_handlers_hierarchy_pop },
+ {"collections.group.parts", "swallow", NULL, edje_cc_handlers_hierarchy_pop },
+ {"collections.group.parts", "textblock", NULL, edje_cc_handlers_hierarchy_pop },
+ {"collections.group.parts", "group", NULL, edje_cc_handlers_hierarchy_pop },
+ {"collections.group.parts", "box", NULL, edje_cc_handlers_hierarchy_pop },
+ {"collections.group.parts", "table", NULL, edje_cc_handlers_hierarchy_pop },
+ {"collections.group.parts", "external", NULL, edje_cc_handlers_hierarchy_pop },
+ {"collections.group.parts", "proxy", NULL, edje_cc_handlers_hierarchy_pop },
+ {"collections.group.parts", "spacer", NULL, edje_cc_handlers_hierarchy_pop },
+ {"collections.group.parts", "vector", NULL, edje_cc_handlers_hierarchy_pop },
};
/*****/
@@ -1714,12 +1750,12 @@ part_description_image_cleanup(Edje_Part *ep)
if (ep->type != EDJE_PART_TYPE_IMAGE)
return;
- ed = (Edje_Part_Description_Image*) ep->default_desc;
+ ed = (Edje_Part_Description_Image *)ep->default_desc;
_edje_part_description_image_remove(ed);
for (j = 0; j < ep->other.desc_count; j++)
{
- ed = (Edje_Part_Description_Image*) ep->other.desc[j];
+ ed = (Edje_Part_Description_Image *)ep->other.desc[j];
_edje_part_description_image_remove(ed);
}
}
@@ -1735,265 +1771,276 @@ _edje_part_description_alloc(unsigned char type, const char *collection, const c
case EDJE_PART_TYPE_RECTANGLE:
case EDJE_PART_TYPE_SWALLOW:
case EDJE_PART_TYPE_GROUP:
- result = mem_alloc(SZ(Edje_Part_Description_Common));
- break;
+ result = mem_alloc(SZ(Edje_Part_Description_Common));
+ break;
+
case EDJE_PART_TYPE_TEXT:
case EDJE_PART_TYPE_TEXTBLOCK:
- {
- Edje_Part_Description_Text *ed;
-
- ed = mem_alloc(SZ(Edje_Part_Description_Text));
-
- ed->text.color3.r = 0;
- ed->text.color3.g = 0;
- ed->text.color3.b = 0;
- ed->text.color3.a = 128;
- ed->text.align.x = FROM_DOUBLE(0.5);
- ed->text.align.y = FROM_DOUBLE(0.5);
- ed->text.id_source = -1;
- ed->text.id_text_source = -1;
-
- result = &ed->common;
- break;
- }
+ {
+ Edje_Part_Description_Text *ed;
+
+ ed = mem_alloc(SZ(Edje_Part_Description_Text));
+
+ ed->text.color3.r = 0;
+ ed->text.color3.g = 0;
+ ed->text.color3.b = 0;
+ ed->text.color3.a = 128;
+ ed->text.align.x = FROM_DOUBLE(0.5);
+ ed->text.align.y = FROM_DOUBLE(0.5);
+ ed->text.id_source = -1;
+ ed->text.id_text_source = -1;
+
+ result = &ed->common;
+ break;
+ }
+
case EDJE_PART_TYPE_IMAGE:
- {
- Edje_Part_Description_Image *ed;
+ {
+ Edje_Part_Description_Image *ed;
- ed = mem_alloc(SZ(Edje_Part_Description_Image));
+ ed = mem_alloc(SZ(Edje_Part_Description_Image));
- ed->image.id = -1;
+ ed->image.id = -1;
- _edje_part_description_fill(&ed->image.fill);
+ _edje_part_description_fill(&ed->image.fill);
+
+ result = &ed->common;
+ break;
+ }
- result = &ed->common;
- break;
- }
case EDJE_PART_TYPE_SNAPSHOT:
- {
- Edje_Part_Description_Snapshot *ed;
+ {
+ Edje_Part_Description_Snapshot *ed;
- ed = mem_alloc(SZ(Edje_Part_Description_Snapshot));
+ ed = mem_alloc(SZ(Edje_Part_Description_Snapshot));
+
+ result = &ed->common;
+ break;
+ }
- result = &ed->common;
- break;
- }
case EDJE_PART_TYPE_PROXY:
- {
- Edje_Part_Description_Proxy *ed;
+ {
+ Edje_Part_Description_Proxy *ed;
- ed = mem_alloc(SZ(Edje_Part_Description_Proxy));
+ ed = mem_alloc(SZ(Edje_Part_Description_Proxy));
- ed->proxy.id = -1;
- ed->proxy.source_visible = EINA_TRUE;
- ed->proxy.source_clip = EINA_TRUE;
- _edje_part_description_fill(&ed->proxy.fill);
+ ed->proxy.id = -1;
+ ed->proxy.source_visible = EINA_TRUE;
+ ed->proxy.source_clip = EINA_TRUE;
+ _edje_part_description_fill(&ed->proxy.fill);
+
+ result = &ed->common;
+ break;
+ }
- result = &ed->common;
- break;
- }
case EDJE_PART_TYPE_BOX:
- {
- Edje_Part_Description_Box *ed;
+ {
+ Edje_Part_Description_Box *ed;
- ed = mem_alloc(SZ(Edje_Part_Description_Box));
+ ed = mem_alloc(SZ(Edje_Part_Description_Box));
- ed->box.layout = NULL;
- ed->box.alt_layout = NULL;
- ed->box.align.x = FROM_DOUBLE(0.5);
- ed->box.align.y = FROM_DOUBLE(0.5);
- ed->box.padding.x = 0;
- ed->box.padding.y = 0;
+ ed->box.layout = NULL;
+ ed->box.alt_layout = NULL;
+ ed->box.align.x = FROM_DOUBLE(0.5);
+ ed->box.align.y = FROM_DOUBLE(0.5);
+ ed->box.padding.x = 0;
+ ed->box.padding.y = 0;
+
+ result = &ed->common;
+ break;
+ }
- result = &ed->common;
- break;
- }
case EDJE_PART_TYPE_TABLE:
- {
- Edje_Part_Description_Table *ed;
+ {
+ Edje_Part_Description_Table *ed;
- ed = mem_alloc(SZ(Edje_Part_Description_Table));
+ ed = mem_alloc(SZ(Edje_Part_Description_Table));
- ed->table.homogeneous = EDJE_OBJECT_TABLE_HOMOGENEOUS_NONE;
- ed->table.align.x = FROM_DOUBLE(0.5);
- ed->table.align.y = FROM_DOUBLE(0.5);
- ed->table.padding.x = 0;
- ed->table.padding.y = 0;
+ ed->table.homogeneous = EDJE_OBJECT_TABLE_HOMOGENEOUS_NONE;
+ ed->table.align.x = FROM_DOUBLE(0.5);
+ ed->table.align.y = FROM_DOUBLE(0.5);
+ ed->table.padding.x = 0;
+ ed->table.padding.y = 0;
+
+ result = &ed->common;
+ break;
+ }
- result = &ed->common;
- break;
- }
case EDJE_PART_TYPE_EXTERNAL:
- {
- Edje_Part_Description_External *ed;
+ {
+ Edje_Part_Description_External *ed;
- ed = mem_alloc(SZ(Edje_Part_Description_External));
+ ed = mem_alloc(SZ(Edje_Part_Description_External));
- ed->external_params = NULL;
+ ed->external_params = NULL;
+
+ result = &ed->common;
+ break;
+ }
- result = &ed->common;
- break;
- }
case EDJE_PART_TYPE_MESH_NODE:
- {
- Edje_Part_Description_Mesh_Node *ed;
-
- ed = mem_alloc(SZ(Edje_Part_Description_Mesh_Node));
-
- ed->mesh_node.mesh.id = -1;
- ed->mesh_node.mesh.primitive = 0;
- ed->mesh_node.mesh.assembly = 1;
- ed->mesh_node.mesh.frame = 0;
-
- ed->mesh_node.texture.id = -1;
- ed->mesh_node.texture.wrap1 = 0;
- ed->mesh_node.texture.wrap2 = 0;
- ed->mesh_node.texture.filter1 = 0;
- ed->mesh_node.texture.filter2 = 0;
-
- ed->mesh_node.properties.shade = EVAS_CANVAS3D_SHADER_MODE_VERTEX_COLOR;
- ed->mesh_node.properties.ambient.r = 50;
- ed->mesh_node.properties.ambient.g = 50;
- ed->mesh_node.properties.ambient.b = 50;
- ed->mesh_node.properties.ambient.a = 255;
- ed->mesh_node.properties.diffuse.r = 255;
- ed->mesh_node.properties.diffuse.g = 255;
- ed->mesh_node.properties.diffuse.b = 255;
- ed->mesh_node.properties.diffuse.a = 255;
- ed->mesh_node.properties.specular.r = 255;
- ed->mesh_node.properties.specular.g = 255;
- ed->mesh_node.properties.specular.b = 255;
- ed->mesh_node.properties.specular.a = 255;
-
- ed->mesh_node.properties.material_attrib = 1;
- ed->mesh_node.properties.normal = 1;
- ed->mesh_node.properties.shininess = 50;
-
- ed->mesh_node.aabb1.relative.x = -1.0;
- ed->mesh_node.aabb1.relative.y = -1.0;
- ed->mesh_node.aabb1.relative.z = -1.0;
- ed->mesh_node.aabb1.offset.x = 0;
- ed->mesh_node.aabb1.offset.y = 0;
- ed->mesh_node.aabb1.offset.z = 0;
- ed->mesh_node.aabb1.rel_to = -1;
- ed->mesh_node.aabb2.relative.x = 1.0;
- ed->mesh_node.aabb2.relative.y = 1.0;
- ed->mesh_node.aabb2.relative.z = 1.0;
- ed->mesh_node.aabb2.offset.x = 0;
- ed->mesh_node.aabb2.offset.y = 0;
- ed->mesh_node.aabb2.offset.z = 0;
- ed->mesh_node.aabb2.rel_to = -1;
-
- ed->mesh_node.orientation.type = EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_NONE;
- /* x1 is angle for angle_axis and cosine of half angle for quternion,
- x2, x3, x4 define axis for angle_axis and quaternion,
- x1, x2, x3 are coordinates of point to look at for look_at,
- x4, x5, x6 define a vector that indicates the angle at which
- the subject is looking at the target for look_at and look_to */
- ed->mesh_node.orientation.data[0] = 1.0;
- ed->mesh_node.orientation.data[1] = 0.0;
- ed->mesh_node.orientation.data[2] = 0.0;
- ed->mesh_node.orientation.data[3] = 0.0;
- ed->mesh_node.orientation.data[4] = 1.0;
- ed->mesh_node.orientation.data[5] = 0.0;
- ed->mesh_node.orientation.look_to = -1;
-
- ed->mesh_node.scale_3d.x = 1.0;
- ed->mesh_node.scale_3d.y = 1.0;
- ed->mesh_node.scale_3d.z = 1.0;
-
- ed->mesh_node.position.point.x = 0.0;
- ed->mesh_node.position.point.y = 0.0;
- ed->mesh_node.position.point.z = 0.0;
- ed->mesh_node.position.space = EVAS_CANVAS3D_SPACE_PARENT;
-
- result = &ed->common;
- break;
- }
+ {
+ Edje_Part_Description_Mesh_Node *ed;
+
+ ed = mem_alloc(SZ(Edje_Part_Description_Mesh_Node));
+
+ ed->mesh_node.mesh.id = -1;
+ ed->mesh_node.mesh.primitive = 0;
+ ed->mesh_node.mesh.assembly = 1;
+ ed->mesh_node.mesh.frame = 0;
+
+ ed->mesh_node.texture.id = -1;
+ ed->mesh_node.texture.wrap1 = 0;
+ ed->mesh_node.texture.wrap2 = 0;
+ ed->mesh_node.texture.filter1 = 0;
+ ed->mesh_node.texture.filter2 = 0;
+
+ ed->mesh_node.properties.shade = EVAS_CANVAS3D_SHADER_MODE_VERTEX_COLOR;
+ ed->mesh_node.properties.ambient.r = 50;
+ ed->mesh_node.properties.ambient.g = 50;
+ ed->mesh_node.properties.ambient.b = 50;
+ ed->mesh_node.properties.ambient.a = 255;
+ ed->mesh_node.properties.diffuse.r = 255;
+ ed->mesh_node.properties.diffuse.g = 255;
+ ed->mesh_node.properties.diffuse.b = 255;
+ ed->mesh_node.properties.diffuse.a = 255;
+ ed->mesh_node.properties.specular.r = 255;
+ ed->mesh_node.properties.specular.g = 255;
+ ed->mesh_node.properties.specular.b = 255;
+ ed->mesh_node.properties.specular.a = 255;
+
+ ed->mesh_node.properties.material_attrib = 1;
+ ed->mesh_node.properties.normal = 1;
+ ed->mesh_node.properties.shininess = 50;
+
+ ed->mesh_node.aabb1.relative.x = -1.0;
+ ed->mesh_node.aabb1.relative.y = -1.0;
+ ed->mesh_node.aabb1.relative.z = -1.0;
+ ed->mesh_node.aabb1.offset.x = 0;
+ ed->mesh_node.aabb1.offset.y = 0;
+ ed->mesh_node.aabb1.offset.z = 0;
+ ed->mesh_node.aabb1.rel_to = -1;
+ ed->mesh_node.aabb2.relative.x = 1.0;
+ ed->mesh_node.aabb2.relative.y = 1.0;
+ ed->mesh_node.aabb2.relative.z = 1.0;
+ ed->mesh_node.aabb2.offset.x = 0;
+ ed->mesh_node.aabb2.offset.y = 0;
+ ed->mesh_node.aabb2.offset.z = 0;
+ ed->mesh_node.aabb2.rel_to = -1;
+
+ ed->mesh_node.orientation.type = EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_NONE;
+ /* x1 is angle for angle_axis and cosine of half angle for quternion,
+ x2, x3, x4 define axis for angle_axis and quaternion,
+ x1, x2, x3 are coordinates of point to look at for look_at,
+ x4, x5, x6 define a vector that indicates the angle at which
+ the subject is looking at the target for look_at and look_to */
+ ed->mesh_node.orientation.data[0] = 1.0;
+ ed->mesh_node.orientation.data[1] = 0.0;
+ ed->mesh_node.orientation.data[2] = 0.0;
+ ed->mesh_node.orientation.data[3] = 0.0;
+ ed->mesh_node.orientation.data[4] = 1.0;
+ ed->mesh_node.orientation.data[5] = 0.0;
+ ed->mesh_node.orientation.look_to = -1;
+
+ ed->mesh_node.scale_3d.x = 1.0;
+ ed->mesh_node.scale_3d.y = 1.0;
+ ed->mesh_node.scale_3d.z = 1.0;
+
+ ed->mesh_node.position.point.x = 0.0;
+ ed->mesh_node.position.point.y = 0.0;
+ ed->mesh_node.position.point.z = 0.0;
+ ed->mesh_node.position.space = EVAS_CANVAS3D_SPACE_PARENT;
+
+ result = &ed->common;
+ break;
+ }
+
case EDJE_PART_TYPE_LIGHT:
- {
- Edje_Part_Description_Light *ed;
-
- ed = mem_alloc(SZ(Edje_Part_Description_Light));
-
- ed->light.properties.ambient.r = 50;
- ed->light.properties.ambient.g = 50;
- ed->light.properties.ambient.b = 50;
- ed->light.properties.ambient.a = 255;
- ed->light.properties.diffuse.r = 255;
- ed->light.properties.diffuse.g = 255;
- ed->light.properties.diffuse.b = 255;
- ed->light.properties.diffuse.a = 255;
- ed->light.properties.specular.r = 255;
- ed->light.properties.specular.g = 255;
- ed->light.properties.specular.b = 255;
- ed->light.properties.specular.a = 255;
-
- ed->light.position.point.x = 0.0;
- ed->light.position.point.y = 0.0;
- ed->light.position.point.z = 1.0;
- ed->light.position.space = EVAS_CANVAS3D_SPACE_PARENT;
-
- ed->light.orientation.type = EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_NONE;
- /* x1 is angle for angle_axis and cosine of half angle for quternion,
- x2, x3, x4 define axis for angle_axis and quaternion,
- x1, x2, x3 are coordinates of point to look at for look_at,
- x4, x5, x6 define a vector that indicates the angle at which
- the subject is looking at the target for look_at and look_to */
- ed->light.orientation.data[0] = 1.0;
- ed->light.orientation.data[1] = 0.0;
- ed->light.orientation.data[2] = 0.0;
- ed->light.orientation.data[3] = 0.0;
- ed->light.orientation.data[4] = 1.0;
- ed->light.orientation.data[5] = 0.0;
- ed->light.orientation.look_to = -1;
-
- result = &ed->common;
- break;
- }
+ {
+ Edje_Part_Description_Light *ed;
+
+ ed = mem_alloc(SZ(Edje_Part_Description_Light));
+
+ ed->light.properties.ambient.r = 50;
+ ed->light.properties.ambient.g = 50;
+ ed->light.properties.ambient.b = 50;
+ ed->light.properties.ambient.a = 255;
+ ed->light.properties.diffuse.r = 255;
+ ed->light.properties.diffuse.g = 255;
+ ed->light.properties.diffuse.b = 255;
+ ed->light.properties.diffuse.a = 255;
+ ed->light.properties.specular.r = 255;
+ ed->light.properties.specular.g = 255;
+ ed->light.properties.specular.b = 255;
+ ed->light.properties.specular.a = 255;
+
+ ed->light.position.point.x = 0.0;
+ ed->light.position.point.y = 0.0;
+ ed->light.position.point.z = 1.0;
+ ed->light.position.space = EVAS_CANVAS3D_SPACE_PARENT;
+
+ ed->light.orientation.type = EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_NONE;
+ /* x1 is angle for angle_axis and cosine of half angle for quternion,
+ x2, x3, x4 define axis for angle_axis and quaternion,
+ x1, x2, x3 are coordinates of point to look at for look_at,
+ x4, x5, x6 define a vector that indicates the angle at which
+ the subject is looking at the target for look_at and look_to */
+ ed->light.orientation.data[0] = 1.0;
+ ed->light.orientation.data[1] = 0.0;
+ ed->light.orientation.data[2] = 0.0;
+ ed->light.orientation.data[3] = 0.0;
+ ed->light.orientation.data[4] = 1.0;
+ ed->light.orientation.data[5] = 0.0;
+ ed->light.orientation.look_to = -1;
+
+ result = &ed->common;
+ break;
+ }
+
case EDJE_PART_TYPE_CAMERA:
- {
- Edje_Part_Description_Camera *ed;
-
- ed = mem_alloc(SZ(Edje_Part_Description_Camera));
-
- ed->camera.camera.fovy = 60.0;
- ed->camera.camera.aspect = 1.0;
- ed->camera.camera.frustum_near = 2.0;
- ed->camera.camera.frustum_far = 50.0;
-
- ed->camera.position.point.x = 0.0;
- ed->camera.position.point.y = 0.0;
- ed->camera.position.point.z = 5.0;
-
- ed->camera.position.space = EVAS_CANVAS3D_SPACE_PARENT;
-
- ed->camera.orientation.type = EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_NONE;
- /* x1 is angle for angle_axis and cosine of half angle for quternion,
- x2, x3, x4 define axis for angle_axis and quaternion,
- x1, x2, x3 are coordinates of point to look at for look_at,
- x4, x5, x6 define a vector that indicates the angle at which
- the subject is looking at the target for look_at and look_to */
- ed->camera.orientation.data[0] = 1.0;
- ed->camera.orientation.data[1] = 0.0;
- ed->camera.orientation.data[2] = 0.0;
- ed->camera.orientation.data[3] = 0.0;
- ed->camera.orientation.data[4] = 1.0;
- ed->camera.orientation.data[5] = 0.0;
- ed->camera.orientation.look_to = -1;
-
- result = &ed->common;
- break;
- }
+ {
+ Edje_Part_Description_Camera *ed;
+
+ ed = mem_alloc(SZ(Edje_Part_Description_Camera));
+
+ ed->camera.camera.fovy = 60.0;
+ ed->camera.camera.aspect = 1.0;
+ ed->camera.camera.frustum_near = 2.0;
+ ed->camera.camera.frustum_far = 50.0;
+
+ ed->camera.position.point.x = 0.0;
+ ed->camera.position.point.y = 0.0;
+ ed->camera.position.point.z = 5.0;
+
+ ed->camera.position.space = EVAS_CANVAS3D_SPACE_PARENT;
+
+ ed->camera.orientation.type = EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_NONE;
+ /* x1 is angle for angle_axis and cosine of half angle for quternion,
+ x2, x3, x4 define axis for angle_axis and quaternion,
+ x1, x2, x3 are coordinates of point to look at for look_at,
+ x4, x5, x6 define a vector that indicates the angle at which
+ the subject is looking at the target for look_at and look_to */
+ ed->camera.orientation.data[0] = 1.0;
+ ed->camera.orientation.data[1] = 0.0;
+ ed->camera.orientation.data[2] = 0.0;
+ ed->camera.orientation.data[3] = 0.0;
+ ed->camera.orientation.data[4] = 1.0;
+ ed->camera.orientation.data[5] = 0.0;
+ ed->camera.orientation.look_to = -1;
+
+ result = &ed->common;
+ break;
+ }
+
case EDJE_PART_TYPE_VECTOR:
- {
- Edje_Part_Description_Vector *ed;
+ {
+ Edje_Part_Description_Vector *ed;
- ed = mem_alloc(SZ(Edje_Part_Description_Vector));
+ ed = mem_alloc(SZ(Edje_Part_Description_Vector));
- result = &ed->common;
- break;
- }
+ result = &ed->common;
+ break;
+ }
}
if (!result)
@@ -2033,7 +2080,7 @@ _edje_program_check(const char *name, Edje_Program *me, Edje_Program **pgrms, un
for (i = 0; i < count; ++i)
if (pgrms[i]->name)
if (pgrms[i] != me && (!strcmp(name, pgrms[i]->name)))
- {
+ {
epp = (Edje_Program_Parser *)pgrms[i];
if (!epp->can_override)
{
@@ -2050,7 +2097,7 @@ _edje_program_check(const char *name, Edje_Program *me, Edje_Program **pgrms, un
epp->can_override = EINA_FALSE;
return;
}
- }
+ }
}
static void
@@ -2098,10 +2145,10 @@ _edje_program_copy(Edje_Program *ep, Edje_Program *ep2)
EINA_LIST_FOREACH(ep2->targets, l, et2)
{
- name = (char*) (et2 + 1);
+ name = (char *)(et2 + 1);
et = mem_alloc(SZ(Edje_Program_Target) + strlen(name) + 1);
ep->targets = eina_list_append(ep->targets, et);
- copy = (char*) (et + 1);
+ copy = (char *)(et + 1);
memcpy(copy, name, strlen(name) + 1);
@@ -2119,6 +2166,7 @@ _edje_program_copy(Edje_Program *ep, Edje_Program *ep2)
else
data_queue_copied_part_lookup(pc, &(et2->id), &(et->id));
break;
+
case EDJE_ACTION_TYPE_ACTION_STOP:
case EDJE_ACTION_TYPE_SCRIPT:
if (current_group_inherit)
@@ -2126,6 +2174,7 @@ _edje_program_copy(Edje_Program *ep, Edje_Program *ep2)
else
data_queue_copied_program_lookup(pc, &(et2->id), &(et->id));
break;
+
default:
ERR("parse error %s:%i. target may only be used after action",
file_in, line - 1);
@@ -2135,10 +2184,10 @@ _edje_program_copy(Edje_Program *ep, Edje_Program *ep2)
EINA_LIST_FOREACH(ep2->after, l, pa2)
{
- name = (char*) (pa2 + 1);
+ name = (char *)(pa2 + 1);
pa = mem_alloc(SZ(Edje_Program_After) + strlen(name) + 1);
ep->after = eina_list_append(ep->after, pa);
- copy = (char*) (pa + 1);
+ copy = (char *)(pa + 1);
memcpy(copy, name, strlen(name) + 1);
if (!data_queue_copied_program_lookup(pc, &(pa2->id), &(pa->id)))
data_queue_program_lookup(pc, copy, &(pa->id));
@@ -2180,6 +2229,67 @@ st_efl_version(void)
edje_file->efl_version.minor = parse_int(1);
}
+/** @edcsubsection{toplevel_id,
+ * id} */
+
+/**
+ @page edcref
+
+ @property
+ id
+ @parameters
+ [name]
+ @effect
+ A string which is used to identify the edje file.
+ @since 1.21
+ @endproperty
+ */
+static void
+st_id(void)
+{
+ Eina_Array_Iterator it;
+ unsigned int i;
+ char *str, *id;
+
+ check_arg_count(1);
+ id = parse_str(0);
+
+ EINA_ARRAY_ITER_NEXT(requires, i, str, it)
+ if (eina_streq(str, id))
+ error_and_abort(NULL, "Cannot use same id for file as one of its required files!");
+ free((void*)edje_file->id);
+ edje_file->id = id;
+}
+
+/** @edcsubsection{toplevel_requires,
+ * requires} */
+
+/**
+ @page edcref
+
+ @property
+ requires
+ @parameters
+ [name]
+ @effect
+ Specifying this property informs edje not to close the
+ file with the corresponding id property for as long as this
+ file is open. Multiple requires properties can be individually specified.
+ @since 1.21
+ @endproperty
+ */
+static void
+st_requires(void)
+{
+ char *str;
+ check_arg_count(1);
+
+ str = parse_str(0);
+ if (eina_streq(str, edje_file->id))
+ error_and_abort(NULL, "Cannot require the current file!");
+ eina_array_push(requires, str);
+}
+
/** @edcsubsection{toplevel_externals,
* Externals} */
@@ -2217,39 +2327,39 @@ st_externals_external(void)
ex = mem_alloc(SZ(External));
ex->name = parse_str(0);
- {
- Eina_List *l;
- External *lex;
+ {
+ Eina_List *l;
+ External *lex;
- EINA_LIST_FOREACH(externals, l, lex)
- {
- if (!strcmp(lex->name, ex->name))
- {
- free(ex->name);
- free(ex);
- return;
- }
- }
- }
+ EINA_LIST_FOREACH(externals, l, lex)
+ {
+ if (!strcmp(lex->name, ex->name))
+ {
+ free(ex->name);
+ free(ex);
+ return;
+ }
+ }
+ }
externals = eina_list_append(externals, ex);
if (edje_file->external_dir)
{
Edje_External_Directory_Entry *entries;
-
- edje_file->external_dir->entries_count++;
+
+ edje_file->external_dir->entries_count++;
entries = realloc(edje_file->external_dir->entries,
sizeof (Edje_External_Directory_Entry) * edje_file->external_dir->entries_count);
if (!entries)
{
- ERR("not enough memory");
+ ERR("not enough memory");
exit(-1);
}
- edje_file->external_dir->entries = entries;
- memset(edje_file->external_dir->entries + edje_file->external_dir->entries_count - 1,
- 0, sizeof (Edje_External_Directory_Entry));
+ edje_file->external_dir->entries = entries;
+ memset(edje_file->external_dir->entries + edje_file->external_dir->entries_count - 1,
+ 0, sizeof (Edje_External_Directory_Entry));
- edje_file->external_dir->entries[edje_file->external_dir->entries_count - 1].entry = mem_strdup(ex->name);
+ edje_file->external_dir->entries[edje_file->external_dir->entries_count - 1].entry = mem_strdup(ex->name);
}
}
@@ -2284,7 +2394,7 @@ st_externals_external(void)
@property
image
@parameters
- [image file] [compression method] (compression level)
+ [image file] [compression method] (compression level)(edje file id)
@effect
Used to include each image file. The full path to the directory holding
the images can be defined later with edje_cc's "-id" option.
@@ -2295,6 +2405,7 @@ st_externals_external(void)
@li LOSSY_ETC1 [0-100]: ETC1 lossy texture compression with quality from 0 to 100.
@li LOSSY_ETC2 [0-100]: ETC2 lossy texture compression with quality from 0 to 100 (supports alpha).
@li USER: Do not embed the file, refer to the external file instead.
+ @li EXTERNAL: The file exists in the edje file with the specified id.
Defaults: compression level for lossy methods is 90.
@endproperty
@@ -2321,8 +2432,8 @@ st_images_image(void)
for (i = 0; i < edje_file->image_dir->entries_count; ++i)
if (!strcmp(edje_file->image_dir->entries[i].entry, tmp))
{
- free((char*) tmp);
- return;
+ free((char *)tmp);
+ return;
}
edje_file->image_dir->entries_count++;
@@ -2335,7 +2446,7 @@ st_images_image(void)
}
edje_file->image_dir->entries = img;
memset(edje_file->image_dir->entries + edje_file->image_dir->entries_count - 1,
- 0, sizeof (Edje_Image_Directory_Entry));
+ 0, sizeof (Edje_Image_Directory_Entry));
img = edje_file->image_dir->entries + edje_file->image_dir->entries_count - 1;
@@ -2348,16 +2459,17 @@ st_images_image(void)
"LOSSY_ETC1", 3,
"LOSSY_ETC2", 4,
"USER", 5,
- NULL);
+ "EXTERNAL", 6,
+ NULL);
if (v == 0)
{
- img->source_type = EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT;
- img->source_param = 0;
+ img->source_type = EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT;
+ img->source_param = 0;
}
else if (v == 1)
{
- img->source_type = EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT;
- img->source_param = 1;
+ img->source_type = EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT;
+ img->source_param = 1;
}
else if (v == 2)
{
@@ -2376,22 +2488,34 @@ st_images_image(void)
}
else if (v == 5)
{
- img->source_type = EDJE_IMAGE_SOURCE_TYPE_EXTERNAL;
- img->source_param = 0;
+ img->source_type = EDJE_IMAGE_SOURCE_TYPE_USER;
+ img->source_param = 0;
+ }
+ else if (v == 6)
+ {
+ img->source_type = EDJE_IMAGE_SOURCE_TYPE_EXTERNAL;
+ img->source_param = 0;
+ img->external_id = parse_str(2);
}
if ((img->source_type < EDJE_IMAGE_SOURCE_TYPE_INLINE_LOSSY) ||
- (img->source_type > EDJE_IMAGE_SOURCE_TYPE_INLINE_LOSSY_ETC2))
- check_arg_count(2);
- else
+ (img->source_type == EDJE_IMAGE_SOURCE_TYPE_USER))
+ check_arg_count(2);
+ else if (img->source_type != EDJE_IMAGE_SOURCE_TYPE_EXTERNAL)
{
if (check_range_arg_count(2, 3) > 2)
img->source_param = parse_int_range(2, 0, 100);
else
img->source_param = 90;
}
+ if (!edje_file->image_id_hash)
+ edje_file->image_id_hash = eina_hash_string_superfast_new(free);
+ {
+ Edje_Image_Hash *eih = mem_alloc(SZ(Edje_Image_Hash));
+ eih->id = img->id;
+ eina_hash_add(edje_file->image_id_hash, tmp, eih);
+ }
}
-
static void
_handle_vector_image(void)
{
@@ -2399,7 +2523,7 @@ _handle_vector_image(void)
unsigned int i = 0;
char *name;
- ed = (Edje_Part_Description_Vector*) current_desc;
+ ed = (Edje_Part_Description_Vector *)current_desc;
name = parse_str(0);
@@ -2464,13 +2588,13 @@ st_images_vector(void)
for (i = 0; i < edje_file->image_dir->vectors_count; ++i)
if (!strcmp(edje_file->image_dir->vectors[i].entry, tmp))
{
- free((char*) tmp);
+ free((char *)tmp);
return;
}
edje_file->image_dir->vectors_count++;
vector = realloc(edje_file->image_dir->vectors,
- sizeof (Edje_Vector_Directory_Entry) * edje_file->image_dir->vectors_count);
+ sizeof (Edje_Vector_Directory_Entry) * edje_file->image_dir->vectors_count);
if (!vector)
{
ERR("No enough memory.");
@@ -2478,7 +2602,7 @@ st_images_vector(void)
}
edje_file->image_dir->vectors = vector;
memset(edje_file->image_dir->vectors + edje_file->image_dir->vectors_count - 1,
- 0, sizeof (Edje_Vector_Directory_Entry));
+ 0, sizeof (Edje_Vector_Directory_Entry));
vector = edje_file->image_dir->vectors + edje_file->image_dir->vectors_count - 1;
@@ -2486,7 +2610,6 @@ st_images_vector(void)
vector->id = edje_file->image_dir->vectors_count - 1;
}
-
/**
@edcsubsection{toplevel_models,model}
*/
@@ -2533,7 +2656,7 @@ st_models_model(void)
for (i = 0; i < edje_file->model_dir->entries_count; ++i)
if (!strcmp(edje_file->model_dir->entries[i].entry, tmp))
{
- free((char*) tmp);
+ free((char *)tmp);
return;
}
@@ -2585,7 +2708,7 @@ static void
ob_images_set(void)
{
Edje_Image_Directory_Set *sets;
-
+
if (!edje_file->image_dir)
edje_file->image_dir = mem_alloc(SZ(Edje_Image_Directory));
@@ -2599,8 +2722,8 @@ ob_images_set(void)
}
edje_file->image_dir->sets = sets;
memset(edje_file->image_dir->sets + edje_file->image_dir->sets_count - 1,
- 0, sizeof (Edje_Image_Directory_Set));
-
+ 0, sizeof (Edje_Image_Directory_Set));
+
edje_file->image_dir->sets[edje_file->image_dir->sets_count - 1].id = edje_file->image_dir->sets_count - 1;
}
@@ -2614,7 +2737,7 @@ ob_images_set(void)
@effect
Define the name that refer to this image description.
@endproperty
-*/
+ */
static void
st_images_set_name(void)
{
@@ -2649,7 +2772,7 @@ st_images_set_name(void)
The "image" block inside a "set" block define the characteristic of an image.
Every block will describe one image and the size rule to use it.
@endblock
-**/
+ **/
static void
ob_images_set_image(void)
{
@@ -2669,7 +2792,7 @@ ob_images_set_image(void)
@property
image
@parameters
- [image file] [compression method] (compression level)
+ [image file] [compression method] (compression level)(edje file id)
@effect
Used to include each image file. The full path to the directory holding
the images can be defined later with edje_cc's "-id" option.
@@ -2680,10 +2803,11 @@ ob_images_set_image(void)
@li LOSSY_ETC1 [0-100]: ETC1 lossy texture compression with quality from 0 to 100.
@li LOSSY_ETC2 [0-100]: ETC2 lossy texture compression with quality from 0 to 100 (supports alpha).
@li USER: Do not embed the file, refer to the external file instead.
+ @li EXTERNAL: The file exists in the edje file with the specified id.
Defaults: compression level for lossy methods is 90.
@endproperty
-**/
+ **/
static void
st_images_set_image_image(void)
{
@@ -2702,8 +2826,8 @@ st_images_set_image_image(void)
for (i = 0; i < edje_file->image_dir->entries_count; ++i)
if (!strcmp(edje_file->image_dir->entries[i].entry, entry->name))
{
- entry->id = i;
- return;
+ entry->id = i;
+ return;
}
}
@@ -2719,7 +2843,7 @@ st_images_set_image_image(void)
Defaults: 0 0 0 0
@endproperty
-*/
+ */
static void
st_images_set_image_size(void)
{
@@ -2737,11 +2861,11 @@ st_images_set_image_size(void)
if (entry->size.min.w > entry->size.max.w
|| entry->size.min.h > entry->size.max.h)
{
- ERR("parse error %s:%i. Image min and max size are not in the right order ([%i, %i] < [%i, %i])",
- file_in, line - 1,
- entry->size.min.w, entry->size.min.h,
- entry->size.max.w, entry->size.max.h);
- exit(-1);
+ ERR("parse error %s:%i. Image min and max size are not in the right order ([%i, %i] < [%i, %i])",
+ file_in, line - 1,
+ entry->size.min.w, entry->size.min.h,
+ entry->size.max.w, entry->size.max.h);
+ exit(-1);
}
}
@@ -2759,7 +2883,7 @@ st_images_set_image_size(void)
Defaults: 0 0 0 0
@since 1.8
@endproperty
-*/
+ */
static void
st_images_set_image_border(void)
{
@@ -2796,7 +2920,7 @@ st_images_set_image_border(void)
Defaults: 0.0
@since 1.8
@endproperty
-*/
+ */
static void
st_images_set_image_border_scale_by(void)
{
@@ -2811,7 +2935,7 @@ st_images_set_image_border_scale_by(void)
exit(-1);
}
- ed = (Edje_Part_Description_Image*) current_desc;
+ ed = (Edje_Part_Description_Image *)current_desc;
ed->image.border.scale_by = FROM_DOUBLE(parse_float_range(0, 0.0, 999999999.0));
}
@@ -2861,10 +2985,10 @@ st_fonts_font(void)
if (eina_hash_find(edje_file->fonts, fn->name))
{
- free(fn->file);
- free(fn->name);
- free(fn);
- return;
+ free(fn->file);
+ free(fn->name);
+ free(fn);
+ return;
}
eina_hash_direct_add(edje_file->fonts, fn->name, fn);
@@ -2968,7 +3092,7 @@ st_data_file(void)
snprintf(path, sizeof(path), "%s/%s", dir, filename);
fd = open(path, O_RDONLY | O_BINARY, S_IRUSR | S_IWUSR);
if (fd >= 0)
- break;
+ break;
}
if (fd < 0)
@@ -2982,7 +3106,7 @@ st_data_file(void)
if (fstat(fd, &buf))
{
ERR("%s:%i when stating file \"%s\": \"%s\"",
- file_in, line, filename, strerror(errno));
+ file_in, line, filename, strerror(errno));
exit(-1);
}
@@ -2990,7 +3114,7 @@ st_data_file(void)
if (data == MAP_FAILED)
{
ERR("%s:%i when mapping file \"%s\": \"%s\"",
- file_in, line, filename, strerror(errno));
+ file_in, line, filename, strerror(errno));
exit(-1);
}
@@ -3005,7 +3129,7 @@ st_data_file(void)
value = malloc(sizeof (char) * buf.st_size + 1);
snprintf(value, buf.st_size + 1, "%s", data);
- munmap((void*)data, buf.st_size);
+ munmap((void *)data, buf.st_size);
close(fd);
es->str = value;
@@ -3043,7 +3167,7 @@ st_data_file(void)
Each node block begins with the name of color class and enclosed with braces.
Node block can be placed within another node block.
@endblock
-*/
+ */
static void
ob_color_tree(void)
{
@@ -3084,7 +3208,7 @@ ob_color_tree(void)
group of colors to be used in the theme, the application can use that
name to alter the color values at runtime.
@endblock
-*/
+ */
static void
ob_color_class(void)
{
@@ -3093,18 +3217,18 @@ ob_color_class(void)
cc = mem_alloc(SZ(Edje_Color_Class));
edje_file->color_classes = eina_list_append(edje_file->color_classes, cc);
- cc->r = 255;
- cc->g = 255;
- cc->b = 255;
- cc->a = 255;
- cc->r2 = 255;
- cc->g2 = 255;
- cc->b2 = 255;
- cc->a2 = 255;
- cc->r3 = 255;
- cc->g3 = 255;
- cc->b3 = 255;
- cc->a3 = 255;
+ cc->r = 0;
+ cc->g = 0;
+ cc->b = 0;
+ cc->a = 0;
+ cc->r2 = 0;
+ cc->g2 = 0;
+ cc->b2 = 0;
+ cc->a2 = 0;
+ cc->r3 = 0;
+ cc->g3 = 0;
+ cc->b3 = 0;
+ cc->a3 = 0;
}
static void
@@ -3137,7 +3261,7 @@ _color_class_name(char *name)
Sets the name for the color class, used as reference by both the theme
and the application.
@endproperty
-*/
+ */
static void
st_color_class_name(void)
{
@@ -3148,12 +3272,12 @@ st_color_class_name(void)
cc->name = parse_str(0);
EINA_LIST_FOREACH(edje_file->color_classes, l, tcc)
{
- if ((cc != tcc) && (!strcmp(cc->name, tcc->name)))
- {
- ERR("parse error %s:%i. There is already a color class named \"%s\"",
- file_in, line - 1, cc->name);
- exit(-1);
- }
+ if ((cc != tcc) && (!strcmp(cc->name, tcc->name)))
+ {
+ ERR("parse error %s:%i. There is already a color class named \"%s\"",
+ file_in, line - 1, cc->name);
+ exit(-1);
+ }
}
}
@@ -3167,23 +3291,25 @@ parse_color(unsigned int first_arg, void *base)
switch (get_arg_count() - first_arg)
{
case 1:
- str = parse_str(first_arg);
- convert_color_code(str, &r, &g, &b, &a);
- color->r = r;
- color->g = g;
- color->b = b;
- color->a = a;
- break;
+ str = parse_str(first_arg);
+ convert_color_code(str, &r, &g, &b, &a);
+ color->r = r;
+ color->g = g;
+ color->b = b;
+ color->a = a;
+ break;
+
case 4:
- color->r = parse_int_range(first_arg + 0, 0, 255);
- color->g = parse_int_range(first_arg + 1, 0, 255);
- color->b = parse_int_range(first_arg + 2, 0, 255);
- color->a = parse_int_range(first_arg + 3, 0, 255);
- break;
+ color->r = parse_int_range(first_arg + 0, 0, 255);
+ color->g = parse_int_range(first_arg + 1, 0, 255);
+ color->b = parse_int_range(first_arg + 2, 0, 255);
+ color->a = parse_int_range(first_arg + 3, 0, 255);
+ break;
+
default:
- ERR("%s:%i. color code should be a string or a set of 4 integers.",
- file_in, line - 1);
- exit(-1);
+ ERR("%s:%i. color code should be a string or a set of 4 integers.",
+ file_in, line - 1);
+ exit(-1);
}
}
@@ -3205,9 +3331,9 @@ parse_color(unsigned int first_arg, void *base)
i.e "#F00F" or "#F00".\n
In string format you can omit alpha channel and it will be set to FF.
- Defaults: 255 255 255 255
+ Defaults: 0 0 0 0
@endproperty
-*/
+ */
static void
st_color_class_color(void)
{
@@ -3236,9 +3362,9 @@ st_color_class_color(void)
i.e "#F00F" or "#F00".\n
In string format you can omit alpha channel and it will be set to FF.
- Defaults: 255 255 255 255
+ Defaults: 0 0 0 0
@endproperty
-*/
+ */
static void
st_color_class_color2(void)
{
@@ -3267,9 +3393,9 @@ st_color_class_color2(void)
i.e "#F00F" or "#F00".\n
In string format you can omit alpha channel and it will be set to FF.
- Defaults: 255 255 255 255
+ Defaults: 0 0 0 0
@endproperty
-*/
+ */
static void
st_color_class_color3(void)
{
@@ -3290,7 +3416,7 @@ st_color_class_color3(void)
Provides a descriptive name for the effect of the color class
@since 1.14
@endproperty
-*/
+ */
static void
st_color_class_desc(void)
{
@@ -3325,7 +3451,7 @@ st_color_class_desc(void)
"style" block is used to create style \<tags\> for advanced TEXTBLOCK
formatting.
@endblock
-*/
+ */
static void
ob_styles_style(void)
{
@@ -3349,7 +3475,7 @@ _style_name(char *name)
if (stl->name && tstl->name && (stl != tstl) && (!strcmp(stl->name, tstl->name)))
{
ERR("parse error %s:%i. There is already a style named \"%s\"",
- file_in, line - 1, stl->name);
+ file_in, line - 1, stl->name);
exit(-1);
}
}
@@ -3364,7 +3490,7 @@ _style_name(char *name)
@effect
The name of the style to be used as reference later in the theme.
@endproperty
-*/
+ */
static void
st_styles_style_name(void)
{
@@ -3381,7 +3507,7 @@ st_styles_style_name(void)
The default style properties that will be applied to the complete
text.
@endproperty
-*/
+ */
static void
st_styles_style_base(void)
{
@@ -3413,7 +3539,7 @@ st_styles_style_base(void)
If the second part (\</bold\>) is also defined, a '-' should be prepended to it's style properties.
This only applies to paired tags; Single tags, like \<tab\>, must not include a starting '+'.
@endproperty
-*/
+ */
static void
st_styles_style_tag(void)
{
@@ -3449,7 +3575,7 @@ st_styles_style_tag(void)
group of font and size to be used in the theme, the application can
use that name to alter the font and its size at runtime.
@endblock
-*/
+ */
static void
ob_text_class(void)
{
@@ -3492,7 +3618,7 @@ _text_class_name(char *name)
Sets the name for the text class, used as reference by both the theme
and the application.
@endproperty
-*/
+ */
static void
st_text_class_name(void)
{
@@ -3522,7 +3648,7 @@ st_text_class_name(void)
@effect
Sets the font family for the text class.
@endproperty
-*/
+ */
static void
st_text_class_font(void)
{
@@ -3546,7 +3672,7 @@ st_text_class_font(void)
Defaults: 0
@endproperty
-*/
+ */
static void
st_text_class_size(void)
{
@@ -3580,7 +3706,7 @@ st_text_class_size(void)
group of size to be used in the theme, the application can use that
name to alter the min and max size values at runtime.
@endblock
-*/
+ */
static void
ob_size_class(void)
{
@@ -3625,7 +3751,7 @@ _size_class_name(char *name)
Sets the name for the size class, used as reference by both the theme
and the application.
@endproperty
-*/
+ */
static void
st_size_class_name(void)
{
@@ -3656,7 +3782,7 @@ st_size_class_name(void)
Defaults: 0 0
@endproperty
-*/
+ */
static void
st_size_class_min(void)
{
@@ -3680,7 +3806,7 @@ st_size_class_min(void)
Defaults: -1 -1
@endproperty
-*/
+ */
static void
st_size_class_max(void)
{
@@ -3717,7 +3843,7 @@ st_size_class_max(void)
names. The "sounds" block comprises of all sound definitions. The "vibrations"
block compriese all vibration definitions.
@endblock
-*/
+ */
static void
ob_collections(void)
{
@@ -3745,7 +3871,7 @@ ob_collections(void)
Defaults: 1.0
@since 1.11
@endproperty
-*/
+ */
static void
st_collections_base_scale(void)
{
@@ -3777,7 +3903,7 @@ st_collections_base_scale(void)
@description
The "sounds" block contains a list of one or more sound sample and tones items.
@endblock
-*/
+ */
/**
@page edcref
@@ -3799,14 +3925,14 @@ st_collections_group_sound_tone(void)
int value;
check_arg_count(2);
-
+
if (!edje_file->sound_dir)
edje_file->sound_dir = mem_alloc(SZ(Edje_Sound_Directory));
-
+
tmp = parse_str(0);
/* Audible range 20 to 20KHz */
value = parse_int_range(1, 20, 20000);
-
+
/* Check for Tone duplication */
for (i = 0; i < edje_file->sound_dir->tones_count; i++)
{
@@ -3825,7 +3951,7 @@ st_collections_group_sound_tone(void)
}
edje_file->sound_dir->tones_count++;
tone = realloc(edje_file->sound_dir->tones,
- sizeof (Edje_Sound_Tone) *
+ sizeof (Edje_Sound_Tone) *
edje_file->sound_dir->tones_count);
if (!tone)
{
@@ -3833,10 +3959,10 @@ st_collections_group_sound_tone(void)
exit(-1);
}
edje_file->sound_dir->tones = tone;
-
+
tone = edje_file->sound_dir->tones + edje_file->sound_dir->tones_count - 1;
memset(tone, 0, sizeof (Edje_Sound_Tone));
-
+
tone->name = tmp;
tone->value = value;
tone->id = edje_file->sound_dir->tones_count - 1;
@@ -3886,12 +4012,12 @@ st_collections_group_sound_sample_name(void)
Edje_Sound_Sample *sample;
const char *tmp;
unsigned int i;
-
+
if (!edje_file->sound_dir)
edje_file->sound_dir = mem_alloc(SZ(Edje_Sound_Directory));
-
+
tmp = parse_str(0);
-
+
for (i = 0; i < edje_file->sound_dir->samples_count; i++)
{
if (!strcmp(edje_file->sound_dir->samples[i].name, tmp))
@@ -3900,10 +4026,10 @@ st_collections_group_sound_sample_name(void)
return;
}
}
-
+
edje_file->sound_dir->samples_count++;
sample = realloc(edje_file->sound_dir->samples,
- sizeof(Edje_Sound_Sample) *
+ sizeof(Edje_Sound_Sample) *
edje_file->sound_dir->samples_count);
if (!sample)
{
@@ -3916,7 +4042,7 @@ st_collections_group_sound_sample_name(void)
edje_file->sound_dir->samples +
edje_file->sound_dir->samples_count - 1;
memset(sample, 0, sizeof (Edje_Sound_Sample));
-
+
sample->name = tmp;
sample->id = edje_file->sound_dir->samples_count - 1;
sample->compression = parse_enum(1,
@@ -3925,7 +4051,7 @@ st_collections_group_sound_sample_name(void)
"LOSSY", EDJE_SOUND_SOURCE_TYPE_INLINE_LOSSY,
"AS_IS", EDJE_SOUND_SOURCE_TYPE_INLINE_AS_IS,
NULL);
-
+
if (sample->compression == EDJE_SOUND_SOURCE_TYPE_INLINE_LOSSY)
{
sample->quality = parse_float_range(2, 45.0, 1000.0);
@@ -3933,7 +4059,6 @@ st_collections_group_sound_sample_name(void)
}
else
check_arg_count(2);
-
}
/**
@@ -3958,15 +4083,14 @@ st_collections_group_sound_sample_source(void)
ERR("Invalid sound sample source definition.");
exit(-1);
}
-
- sample =
+
+ sample =
edje_file->sound_dir->samples +
edje_file->sound_dir->samples_count - 1;
sample->snd_src = parse_str(0);
check_arg_count(1);
}
-
/** @edcsubsection{collections_vibrations,
* Vibrations} */
@@ -3985,7 +4109,7 @@ st_collections_group_sound_sample_source(void)
The "vibrations" block contains a list of one or more vibration sample.
@since 1.10
@endblock
-*/
+ */
/** @edcsubsection{collections_vibrations_sample,
* Vibrations.Sample} */
@@ -4112,7 +4236,7 @@ st_collections_group_vibration_sample_source(void)
@property
name
@parameters
- [locale name]
+ [locale name]
@effect
Used to include each po or mo file. The full path to the directory holding
the po or mo file can be defined later with edje_cc's "-md" option.
@@ -4130,7 +4254,7 @@ st_collections_group_translation_file_locale(void)
check_arg_count(1);
if (!edje_file->mo_dir)
- edje_file->mo_dir = mem_alloc(SZ(Edje_Mo_Directory));
+ edje_file->mo_dir = mem_alloc(SZ(Edje_Mo_Directory));
tmp = parse_str(0);
@@ -4223,13 +4347,13 @@ _link_combine(void)
if (fabs(ell->ed->state.value - el->ed->state.value) > DBL_EPSILON) continue;
if ((!!ell->ed->state.name) != (!!el->ed->state.name))
{
- if (((!!ell->ed->state.name) && strcmp(ell->ed->state.name, "default")) ||
- ((!!el->ed->state.name) && strcmp(el->ed->state.name, "default")))
- continue;
+ if (((!!ell->ed->state.name) && strcmp(ell->ed->state.name, "default")) ||
+ ((!!el->ed->state.name) && strcmp(el->ed->state.name, "default")))
+ continue;
}
else if (ell->ed->state.name && strcmp(ell->ed->state.name, el->ed->state.name))
continue;
- eina_list_move_list(&combine, (Eina_List**)&tup->data, l);
+ eina_list_move_list(&combine, (Eina_List **)&tup->data, l);
}
current_program = el->pr;
if (!el->epp->common.name)
@@ -4285,7 +4409,7 @@ _link_combine(void)
A "group" block contains the list of parts and programs that compose a
given Edje Object.
@endblock
-*/
+ */
static void
ob_collections_group(void)
{
@@ -4391,7 +4515,7 @@ double_named_group:
Only a single name statement is valid for group, use alias instead if
you want to give additional names.
@endproperty
-*/
+ */
static void
st_collections_group_name(void)
{
@@ -4399,6 +4523,30 @@ st_collections_group_name(void)
_group_name(parse_str(0));
}
+/**
+ @page edcref
+ @property
+ skip_namespace_validation
+ @parameters
+ [1 or 0]
+ @effect
+ This disables namespace validation for the current group if validation has
+ been enabled with edje_cc's -N option.
+ This property can be inherited.
+ Defaults: 0
+
+ @warning Your edc file should always wrap this keyword with #ifdef HAVE_SKIP_NAMESPACE_VALIDATION
+ @since 1.21
+ @endproperty
+ */
+static void
+st_collections_group_skip_namespace_validation(void)
+{
+ Edje_Part_Collection_Parser *pcp = eina_list_last_data_get(edje_collections);
+ check_arg_count(1);
+ pcp->skip_namespace_validation = parse_bool(0);
+}
+
typedef struct _Edje_List_Foreach_Data Edje_List_Foreach_Data;
struct _Edje_List_Foreach_Data
{
@@ -4452,53 +4600,68 @@ _parts_count_update(unsigned int type, int inc)
switch (type)
{
case EDJE_PART_TYPE_RECTANGLE:
- current_de->count.RECTANGLE += inc;
- break;
+ current_de->count.RECTANGLE += inc;
+ break;
+
case EDJE_PART_TYPE_TEXT:
- current_de->count.TEXT += inc;
- break;
+ current_de->count.TEXT += inc;
+ break;
+
case EDJE_PART_TYPE_IMAGE:
- current_de->count.IMAGE += inc;
- break;
+ current_de->count.IMAGE += inc;
+ break;
+
case EDJE_PART_TYPE_SWALLOW:
- current_de->count.SWALLOW += inc;
- break;
+ current_de->count.SWALLOW += inc;
+ break;
+
case EDJE_PART_TYPE_TEXTBLOCK:
- current_de->count.TEXTBLOCK += inc;
- break;
+ current_de->count.TEXTBLOCK += inc;
+ break;
+
case EDJE_PART_TYPE_GROUP:
- current_de->count.GROUP += inc;
- break;
+ current_de->count.GROUP += inc;
+ break;
+
case EDJE_PART_TYPE_BOX:
- current_de->count.BOX += inc;
- break;
+ current_de->count.BOX += inc;
+ break;
+
case EDJE_PART_TYPE_TABLE:
- current_de->count.TABLE += inc;
- break;
+ current_de->count.TABLE += inc;
+ break;
+
case EDJE_PART_TYPE_EXTERNAL:
- current_de->count.EXTERNAL += inc;
- break;
+ current_de->count.EXTERNAL += inc;
+ break;
+
case EDJE_PART_TYPE_PROXY:
- current_de->count.PROXY += inc;
- break;
+ current_de->count.PROXY += inc;
+ break;
+
case EDJE_PART_TYPE_MESH_NODE:
- current_de->count.MESH_NODE += inc;
- break;
+ current_de->count.MESH_NODE += inc;
+ break;
+
case EDJE_PART_TYPE_LIGHT:
- current_de->count.LIGHT += inc;
- break;
+ current_de->count.LIGHT += inc;
+ break;
+
case EDJE_PART_TYPE_CAMERA:
- current_de->count.CAMERA += inc;
- break;
+ current_de->count.CAMERA += inc;
+ break;
+
case EDJE_PART_TYPE_SPACER:
- current_de->count.SPACER += inc;
- break;
+ current_de->count.SPACER += inc;
+ break;
+
case EDJE_PART_TYPE_SNAPSHOT:
- current_de->count.SNAPSHOT += inc;
- break;
+ current_de->count.SNAPSHOT += inc;
+ break;
+
case EDJE_PART_TYPE_VECTOR:
- current_de->count.VECTOR += inc;
- break;
+ current_de->count.VECTOR += inc;
+ break;
}
current_de->count.part += inc;
}
@@ -4591,7 +4754,7 @@ _part_copy(Edje_Part *ep, Edje_Part *ep2)
epp->reorder.insert_after = STRDUP(epp2->reorder.insert_after);
epp->can_override = EINA_TRUE;
- for (j = 0 ; j < ep2->items_count ; j++)
+ for (j = 0; j < ep2->items_count; j++)
{
ob_collections_group_parts_part_box_items_item();
item = ep->items[j];
@@ -4637,14 +4800,14 @@ _part_copy(Edje_Part *ep, Edje_Part *ep2)
ob_collections_group_parts_part_description();
ed = ep->default_desc;
parent_desc = ed2 = ep2->default_desc;
- free((void*)ed->state.name);
+ free((void *)ed->state.name);
ed->state.name = STRDUP(ed2->state.name);
ed->state.value = ed2->state.value;
st_collections_group_parts_part_description_inherit();
parent_desc = NULL;
// copy other description
- for (j = 0 ; j < ep2->other.desc_count ; j++)
+ for (j = 0; j < ep2->other.desc_count; j++)
{
ob_collections_group_parts_part_description();
ed = ep->other.desc[j];
@@ -4671,7 +4834,7 @@ _part_copy(Edje_Part *ep, Edje_Part *ep2)
Defaults: 0
@since 1.10
@endproperty
-*/
+ */
static void
st_collections_group_inherit_only(void)
{
@@ -4710,7 +4873,7 @@ st_collections_group_inherit_only(void)
Defaults: 0
@since 1.19
@endproperty
-*/
+ */
static void
st_collections_group_use_custom_seat_names(void)
{
@@ -4733,7 +4896,7 @@ st_collections_group_use_custom_seat_names(void)
parts is not allowed.
@since 1.10
@endproperty
-*/
+ */
static void
st_collections_group_part_remove(void)
{
@@ -4805,7 +4968,7 @@ st_collections_group_part_remove(void)
This will break program sequences if a program in the middle of the sequence is removed.
@since 1.10
@endproperty
-*/
+ */
static void
st_collections_group_program_remove(void)
{
@@ -4850,7 +5013,6 @@ st_collections_group_program_remove(void)
}
}
-
/**
@page edcref
@property
@@ -4864,7 +5026,7 @@ st_collections_group_program_remove(void)
group added as targets.
@since 1.10
@endproperty
-*/
+ */
static void
st_collections_group_target_group(void)
{
@@ -4882,14 +5044,14 @@ st_collections_group_target_group(void)
if (!strcmp(tg->name, name))
{
ERR("parse error %s:%i. There is already a target_group with the name '%s'",
- file_in, line - 1, name);
+ file_in, line - 1, name);
exit(-1);
}
tg = malloc(sizeof(Edje_Target_Group));
pc->target_groups = eina_list_append(pc->target_groups, tg);
tg->name = name;
argc = get_arg_count();
- tg->targets = calloc(argc, sizeof(char*));
+ tg->targets = calloc(argc, sizeof(char *));
for (n = 1; n < argc; n++)
tg->targets[n - 1] = parse_str(n);
@@ -4912,7 +5074,7 @@ st_collections_group_target_group(void)
allowed.
@since 1.10
@endproperty
-*/
+ */
static void
st_collections_group_inherit(void)
{
@@ -4975,7 +5137,7 @@ st_collections_group_inherit(void)
memset(&fdata, 0, sizeof(Edje_List_Foreach_Data));
eina_hash_foreach(pc2->data,
- _edje_data_item_list_foreach, &fdata);
+ _edje_data_item_list_foreach, &fdata);
if (!pc->data) pc->data = eina_hash_string_small_new(free);
EINA_LIST_FREE(fdata.list, key)
@@ -4991,7 +5153,7 @@ st_collections_group_inherit(void)
memset(&fdata, 0, sizeof(Edje_List_Foreach_Data));
eina_hash_foreach(pc2->alias,
- _edje_data_item_list_foreach, &fdata);
+ _edje_data_item_list_foreach, &fdata);
if (!pc->alias) pc->alias = eina_hash_string_small_new(free);
EINA_LIST_FREE(fdata.list, key)
{
@@ -5034,6 +5196,7 @@ st_collections_group_inherit(void)
pcp = (Edje_Part_Collection_Parser *)pc;
pcp2 = (Edje_Part_Collection_Parser *)pc2;
pcp->default_mouse_events = pcp2->default_mouse_events;
+ pcp->skip_namespace_validation = pcp2->skip_namespace_validation;
if (pcp2->inherit_script)
pcp->inherit_script = pcp2->inherit_script;
@@ -5117,7 +5280,7 @@ st_collections_group_inherit(void)
}
offset = pc->parts_count;
- for (i = 0 ; i < pc2->parts_count ; i++)
+ for (i = 0; i < pc2->parts_count; i++)
{
// copy the part
edje_cc_handlers_part_make(-1);
@@ -5127,27 +5290,27 @@ st_collections_group_inherit(void)
}
//copy programs
- for (j = 0 ; j < pc2->programs.fnmatch_count ; j++)
+ for (j = 0; j < pc2->programs.fnmatch_count; j++)
{
ob_collections_group_programs_program();
_edje_program_copy(current_program, pc2->programs.fnmatch[j]);
}
- for (j = 0 ; j < pc2->programs.strcmp_count ; j++)
+ for (j = 0; j < pc2->programs.strcmp_count; j++)
{
ob_collections_group_programs_program();
_edje_program_copy(current_program, pc2->programs.strcmp[j]);
}
- for (j = 0 ; j < pc2->programs.strncmp_count ; j++)
+ for (j = 0; j < pc2->programs.strncmp_count; j++)
{
ob_collections_group_programs_program();
_edje_program_copy(current_program, pc2->programs.strncmp[j]);
}
- for (j = 0 ; j < pc2->programs.strrncmp_count ; j++)
+ for (j = 0; j < pc2->programs.strrncmp_count; j++)
{
ob_collections_group_programs_program();
_edje_program_copy(current_program, pc2->programs.strrncmp[j]);
}
- for (j = 0 ; j < pc2->programs.nocmp_count ; j++)
+ for (j = 0; j < pc2->programs.nocmp_count; j++)
{
ob_collections_group_programs_program();
_edje_program_copy(current_program, pc2->programs.nocmp[j]);
@@ -5209,7 +5372,7 @@ st_collections_group_inherit(void)
Defaults: off
@endproperty
-*/
+ */
static void
st_collections_group_lua_script_only(void)
{
@@ -5237,7 +5400,7 @@ st_collections_group_lua_script_only(void)
Defaults: 0
@since 1.10
@endproperty
-*/
+ */
static void
st_collections_group_script_recursion(void)
{
@@ -5259,7 +5422,7 @@ st_collections_group_script_recursion(void)
Additional name to serve as identifier. Defining multiple aliases is
supported.
@endproperty
-*/
+ */
static void
st_collections_group_alias(void)
{
@@ -5303,7 +5466,7 @@ st_collections_group_alias(void)
Defaults: 0 0
@endproperty
-*/
+ */
static void
st_collections_group_min(void)
{
@@ -5328,7 +5491,7 @@ st_collections_group_min(void)
Defaults: 0 0
@endproperty
-*/
+ */
static void
st_collections_group_max(void)
{
@@ -5352,7 +5515,7 @@ st_collections_group_max(void)
Defaults: 0.0 0.0
@endproperty
-*/
+ */
static void
st_collections_group_scene_size(void)
{
@@ -5377,7 +5540,7 @@ st_collections_group_scene_size(void)
Defaults: true
@since 1.1
@endproperty
-*/
+ */
static void
st_collections_group_broadcast_signal(void)
{
@@ -5426,7 +5589,7 @@ st_collections_group_nobroadcast(void)
Defaults: AUTO
@endproperty
-*/
+ */
static void
st_collections_group_orientation(void)
{
@@ -5436,10 +5599,10 @@ st_collections_group_orientation(void)
pc = eina_list_data_get(eina_list_last(edje_collections));
pc->prop.orientation = parse_enum(0,
- "AUTO", EDJE_ORIENTATION_AUTO,
- "LTR", EDJE_ORIENTATION_LTR,
- "RTL", EDJE_ORIENTATION_RTL,
- NULL);
+ "AUTO", EDJE_ORIENTATION_AUTO,
+ "LTR", EDJE_ORIENTATION_LTR,
+ "RTL", EDJE_ORIENTATION_RTL,
+ NULL);
}
/**
@@ -5556,7 +5719,6 @@ _script_flush(void)
eina_list_free(pcp->base_codes);
}
-
/**
@page edcref
@property
@@ -5613,7 +5775,7 @@ st_collections_group_program_source(void)
"description" block, it will be executed once at load time, in the
load order.
@endblock
-*/
+ */
static void
ob_collections_group_script(void)
{
@@ -5624,15 +5786,15 @@ ob_collections_group_script(void)
if (!is_verbatim()) track_verbatim(1);
else
{
- char *s;
+ char *s;
- s = get_verbatim();
- if (s)
- {
- cd->l1 = get_verbatim_line1();
- cd->l2 = get_verbatim_line2();
- if (cd->shared)
- {
+ s = get_verbatim();
+ if (s)
+ {
+ cd->l1 = get_verbatim_line1();
+ cd->l2 = get_verbatim_line2();
+ if (cd->shared)
+ {
if (script_is_replaceable)
{
free(cd->shared);
@@ -5645,12 +5807,12 @@ ob_collections_group_script(void)
file_in, line - 1);
exit(-1);
}
- }
- cd->shared = s;
+ }
+ cd->shared = s;
cd->original = strdup(s);
- cd->is_lua = 0;
- set_verbatim(NULL, 0, 0);
- }
+ cd->is_lua = 0;
+ set_verbatim(NULL, 0, 0);
+ }
}
}
@@ -5664,23 +5826,23 @@ ob_collections_group_lua_script(void)
if (!is_verbatim()) track_verbatim(1);
else
{
- char *s;
+ char *s;
- s = get_verbatim();
- if (s)
- {
- cd->l1 = get_verbatim_line1();
- cd->l2 = get_verbatim_line2();
- if (cd->shared)
- {
- ERR("parse error %s:%i. There is already an existing script section for the group",
- file_in, line - 1);
- exit(-1);
- }
- cd->shared = s;
- cd->is_lua = 1;
- set_verbatim(NULL, 0, 0);
- }
+ s = get_verbatim();
+ if (s)
+ {
+ cd->l1 = get_verbatim_line1();
+ cd->l2 = get_verbatim_line2();
+ if (cd->shared)
+ {
+ ERR("parse error %s:%i. There is already an existing script section for the group",
+ file_in, line - 1);
+ exit(-1);
+ }
+ cd->shared = s;
+ cd->is_lua = 1;
+ set_verbatim(NULL, 0, 0);
+ }
}
}
@@ -5711,7 +5873,7 @@ ob_collections_group_lua_script(void)
Defines a new parameter, the value will be the string specified next to
it.
@endproperty
-*/
+ */
static void
st_collections_group_data_item(void)
@@ -5804,7 +5966,7 @@ st_collections_group_data_item(void)
Includes an external file to define a new Lua script used for filtering.
The file must be in the data path passed to edje_cc (-dd argument).
@endproperty
-*/
+ */
static Edje_Gfx_Filter *current_filter = NULL;
@@ -5982,7 +6144,7 @@ st_filters_filter_file(void)
exit(-1);
}
- current_filter->script = (char*)eina_memdup((unsigned char*)script, sz, 1);
+ current_filter->script = (char *)eina_memdup((unsigned char *)script, sz, 1);
eina_file_map_free(f, script);
eina_file_close(f);
@@ -6044,7 +6206,7 @@ st_filters_filter_name(void)
it pass below that limit.
This limit will be applied on the y absis and is expressed in pixels.
@endproperty
-*/
+ */
static void
st_collections_group_limits_vertical(void)
{
@@ -6056,14 +6218,14 @@ st_collections_group_limits_vertical(void)
pc = eina_list_data_get(eina_list_last(edje_collections));
pc->limits.vertical_count++;
elp = realloc(pc->limits.vertical,
- pc->limits.vertical_count * sizeof (Edje_Limit *));
+ pc->limits.vertical_count * sizeof (Edje_Limit *));
if (!elp)
{
ERR("Not enough memory.");
exit(-1);
}
pc->limits.vertical = elp;
-
+
el = mem_alloc(SZ(Edje_Limit));
if (!el)
{
@@ -6089,7 +6251,7 @@ st_collections_group_limits_vertical(void)
it pass below that limit.
This limit will be applied on the x axis and is expressed in pixels.
@endproperty
-*/
+ */
static void
st_collections_group_limits_horizontal(void)
{
@@ -6146,7 +6308,7 @@ st_collections_group_limits_horizontal(void)
"real_part_path" in the "somegroup" group.
@endproperty
@endblock
-*/
+ */
static void
st_collections_group_parts_alias(void)
{
@@ -6204,68 +6366,68 @@ st_collections_group_parts_alias(void)
theme, for example, a part can represent a line in a border or a label
on a button.
@endblock
-*/
+ */
static Edje_Part *
edje_cc_handlers_part_make(int id)
{ /* Doing ob_collections_group_parts_part() job, without hierarchy */
- Edje_Part_Collection *pc;
- Edje_Part_Collection_Parser *pcp;
- Edje_Part *ep;
- Edje_Part_Parser *epp;
-
- ep = mem_alloc(SZ(Edje_Part_Parser));
-
- pc = eina_list_data_get(eina_list_last(edje_collections));
- if (id < 0)
- {
- pc->parts_count++;
- pc->parts = realloc(pc->parts, pc->parts_count * sizeof (Edje_Part *));
- if (!pc->parts)
- {
- ERR("Not enough memory.");
- exit(-1);
- }
- id = pc->parts_count - 1;
- }
-
- current_part = pc->parts[id] = ep;
- pcp = (Edje_Part_Collection_Parser *)pc;
-
- ep->id = id;
- ep->type = EDJE_PART_TYPE_IMAGE;
- ep->mouse_events = pcp->default_mouse_events;
- ep->anti_alias = 1;
- ep->repeat_events = 0;
- ep->ignore_flags = EVAS_EVENT_FLAG_NONE;
- ep->mask_flags = EVAS_EVENT_FLAG_NONE;
- ep->scale = 0;
- ep->pointer_mode = EVAS_OBJECT_POINTER_MODE_AUTOGRAB;
- ep->precise_is_inside = 0;
- ep->use_alternate_font_metrics = 0;
- ep->access = 0;
- ep->clip_to_id = -1;
- ep->no_render = 0;
- ep->required = 0;
- ep->dragable.confine_id = -1;
- ep->dragable.threshold_id = -1;
- ep->dragable.event_id = -1;
- ep->items = NULL;
- ep->nested_children_count = 0;
-
- ep->allowed_seats = NULL;
- ep->allowed_seats_count = 0;
-
- epp = (Edje_Part_Parser *)ep;
- epp->reorder.insert_before = NULL;
- epp->reorder.insert_after = NULL;
- epp->reorder.before = NULL;
- epp->reorder.after = NULL;
- epp->reorder.linked_prev = 0;
- epp->reorder.linked_next = 0;
- epp->reorder.done = EINA_FALSE;
- epp->can_override = EINA_FALSE;
+ Edje_Part_Collection *pc;
+ Edje_Part_Collection_Parser *pcp;
+ Edje_Part *ep;
+ Edje_Part_Parser *epp;
+
+ ep = mem_alloc(SZ(Edje_Part_Parser));
+
+ pc = eina_list_data_get(eina_list_last(edje_collections));
+ if (id < 0)
+ {
+ pc->parts_count++;
+ pc->parts = realloc(pc->parts, pc->parts_count * sizeof (Edje_Part *));
+ if (!pc->parts)
+ {
+ ERR("Not enough memory.");
+ exit(-1);
+ }
+ id = pc->parts_count - 1;
+ }
- return ep;
+ current_part = pc->parts[id] = ep;
+ pcp = (Edje_Part_Collection_Parser *)pc;
+
+ ep->id = id;
+ ep->type = EDJE_PART_TYPE_IMAGE;
+ ep->mouse_events = pcp->default_mouse_events;
+ ep->anti_alias = 1;
+ ep->repeat_events = 0;
+ ep->ignore_flags = EVAS_EVENT_FLAG_NONE;
+ ep->mask_flags = EVAS_EVENT_FLAG_NONE;
+ ep->scale = 0;
+ ep->pointer_mode = EVAS_OBJECT_POINTER_MODE_AUTOGRAB;
+ ep->precise_is_inside = 0;
+ ep->use_alternate_font_metrics = 0;
+ ep->access = 0;
+ ep->clip_to_id = -1;
+ ep->no_render = 0;
+ ep->required = 0;
+ ep->dragable.confine_id = -1;
+ ep->dragable.threshold_id = -1;
+ ep->dragable.event_id = -1;
+ ep->items = NULL;
+ ep->nested_children_count = 0;
+
+ ep->allowed_seats = NULL;
+ ep->allowed_seats_count = 0;
+
+ epp = (Edje_Part_Parser *)ep;
+ epp->reorder.insert_before = NULL;
+ epp->reorder.insert_after = NULL;
+ epp->reorder.before = NULL;
+ epp->reorder.after = NULL;
+ epp->reorder.linked_prev = 0;
+ epp->reorder.linked_next = 0;
+ epp->reorder.done = EINA_FALSE;
+ epp->can_override = EINA_FALSE;
+
+ return ep;
}
static void *
@@ -6292,34 +6454,37 @@ _part_desc_free(Edje_Part_Collection *pc,
case EDJE_PART_TYPE_RECTANGLE:
case EDJE_PART_TYPE_SWALLOW:
case EDJE_PART_TYPE_GROUP:
- /* Nothing todo, this part only have a common description. */
- break;
+ /* Nothing todo, this part only have a common description. */
+ break;
+
case EDJE_PART_TYPE_BOX:
case EDJE_PART_TYPE_TABLE:
case EDJE_PART_TYPE_IMAGE:
case EDJE_PART_TYPE_SNAPSHOT:
case EDJE_PART_TYPE_VECTOR:
- /* Nothing todo here */
- break;
+ /* Nothing todo here */
+ break;
+
case EDJE_PART_TYPE_TEXT:
case EDJE_PART_TYPE_TEXTBLOCK:
- {
- Edje_Part_Description_Text *ted = (Edje_Part_Description_Text*) ed;
+ {
+ Edje_Part_Description_Text *ted = (Edje_Part_Description_Text *)ed;
+
+ part_lookup_del(pc, &(ted->text.id_source));
+ part_lookup_del(pc, &(ted->text.id_text_source));
+ break;
+ }
- part_lookup_del(pc, &(ted->text.id_source));
- part_lookup_del(pc, &(ted->text.id_text_source));
- break;
- }
case EDJE_PART_TYPE_PROXY:
- {
- Edje_Part_Description_Proxy *ped = (Edje_Part_Description_Proxy*) ed;
+ {
+ Edje_Part_Description_Proxy *ped = (Edje_Part_Description_Proxy *)ed;
- part_lookup_del(pc, &(ped->proxy.id));
- break;
- }
+ part_lookup_del(pc, &(ped->proxy.id));
+ break;
+ }
}
- free((void*)ed->state.name);
+ free((void *)ed->state.name);
free(ed);
return NULL;
}
@@ -6396,7 +6561,7 @@ _part_create(void)
edje_cc_handlers_hierarchy_push(ep, cp);
prnt = edje_cc_handlers_hierarchy_parent_get();
- if (prnt) /* This is the child of parent in stack */
+ if (prnt) /* This is the child of parent in stack */
prnt->nested_children_count++;
}
@@ -6406,21 +6571,21 @@ ob_collections_group_parts_part_short(void)
unsigned int type;
type = parse_enum(-1,
- "none", EDJE_PART_TYPE_NONE,
- "rect", EDJE_PART_TYPE_RECTANGLE,
- "text", EDJE_PART_TYPE_TEXT,
- "image", EDJE_PART_TYPE_IMAGE,
- "swallow", EDJE_PART_TYPE_SWALLOW,
- "textblock", EDJE_PART_TYPE_TEXTBLOCK,
- "group", EDJE_PART_TYPE_GROUP,
- "box", EDJE_PART_TYPE_BOX,
- "table", EDJE_PART_TYPE_TABLE,
- "external", EDJE_PART_TYPE_EXTERNAL,
- "proxy", EDJE_PART_TYPE_PROXY,
- "spacer", EDJE_PART_TYPE_SPACER,
- "snapshot", EDJE_PART_TYPE_SNAPSHOT,
- "vector", EDJE_PART_TYPE_VECTOR,
- NULL);
+ "none", EDJE_PART_TYPE_NONE,
+ "rect", EDJE_PART_TYPE_RECTANGLE,
+ "text", EDJE_PART_TYPE_TEXT,
+ "image", EDJE_PART_TYPE_IMAGE,
+ "swallow", EDJE_PART_TYPE_SWALLOW,
+ "textblock", EDJE_PART_TYPE_TEXTBLOCK,
+ "group", EDJE_PART_TYPE_GROUP,
+ "box", EDJE_PART_TYPE_BOX,
+ "table", EDJE_PART_TYPE_TABLE,
+ "external", EDJE_PART_TYPE_EXTERNAL,
+ "proxy", EDJE_PART_TYPE_PROXY,
+ "spacer", EDJE_PART_TYPE_SPACER,
+ "snapshot", EDJE_PART_TYPE_SNAPSHOT,
+ "vector", EDJE_PART_TYPE_VECTOR,
+ NULL);
stack_replace_quick("part");
_part_create();
@@ -6436,7 +6601,7 @@ ob_collections_group_parts_part(void)
static void *
_part_free(Edje_Part_Collection *pc, Edje_Part *ep)
{
- Edje_Part_Parser *epp = (Edje_Part_Parser*)ep;
+ Edje_Part_Parser *epp = (Edje_Part_Parser *)ep;
unsigned int j;
part_lookup_del(pc, &(ep->clip_to_id));
@@ -6445,33 +6610,33 @@ _part_free(Edje_Part_Collection *pc, Edje_Part *ep)
part_lookup_del(pc, &(ep->dragable.event_id));
_part_desc_free(pc, ep, ep->default_desc);
- for (j = 0 ; j < ep->other.desc_count ; j++)
+ for (j = 0; j < ep->other.desc_count; j++)
_part_desc_free(pc, ep, ep->other.desc[j]);
- for (j = 0 ; j < ep->items_count ; j++)
+ for (j = 0; j < ep->items_count; j++)
free(ep->items[j]);
free(ep->items);
- for (j = 0 ; j < ep->allowed_seats_count; j++)
+ for (j = 0; j < ep->allowed_seats_count; j++)
{
- free((void*)(ep->allowed_seats[j]->name));
+ free((void *)(ep->allowed_seats[j]->name));
free(ep->allowed_seats[j]);
}
free(ep->allowed_seats);
- free((void*)ep->name);
- free((void*)ep->source);
- free((void*)ep->source2);
- free((void*)ep->source3);
- free((void*)ep->source4);
- free((void*)ep->source5);
- free((void*)ep->source6);
+ free((void *)ep->name);
+ free((void *)ep->source);
+ free((void *)ep->source2);
+ free((void *)ep->source3);
+ free((void *)ep->source4);
+ free((void *)ep->source5);
+ free((void *)ep->source6);
- free((void*)epp->reorder.insert_before);
- free((void*)epp->reorder.insert_after);
+ free((void *)epp->reorder.insert_before);
+ free((void *)epp->reorder.insert_after);
- free((void*)ep->api.name);
- free((void*)ep->api.description);
+ free((void *)ep->api.name);
+ free((void *)ep->api.description);
free(ep->other.desc);
free(ep);
@@ -6491,7 +6656,7 @@ _part_free(Edje_Part_Collection *pc, Edje_Part *ep)
allowed.
@since 1.10
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_inherit(void)
{
@@ -6520,7 +6685,7 @@ st_collections_group_parts_part_inherit(void)
current_part = _part_free(pc, current_part);
edje_cc_handlers_part_make(id);
_part_copy(current_part, pc->parts[i]);
- free((void*)current_part->name);
+ free((void *)current_part->name);
current_part->name = pname;
free(name);
return;
@@ -6540,23 +6705,23 @@ _program_free(Edje_Program *pr)
pc = eina_list_last_data_get(edje_collections);
- free((void*)pr->name);
- free((void*)pr->signal);
- free((void*)pr->source);
- free((void*)pr->filter.part);
- free((void*)pr->filter.state);
- free((void*)pr->seat);
- free((void*)pr->state);
- free((void*)pr->state2);
- free((void*)pr->sample_name);
- free((void*)pr->tone_name);
+ free((void *)pr->name);
+ free((void *)pr->signal);
+ free((void *)pr->source);
+ free((void *)pr->filter.part);
+ free((void *)pr->filter.state);
+ free((void *)pr->seat);
+ free((void *)pr->state);
+ free((void *)pr->state2);
+ free((void *)pr->sample_name);
+ free((void *)pr->tone_name);
EINA_LIST_FREE(pr->targets, prt)
{
part_lookup_del(pc, &prt->id);
free(prt);
}
EINA_LIST_FREE(pr->after, pa)
- free(pa);
+ free(pa);
free(pr);
}
@@ -6597,7 +6762,6 @@ _program_remove(const char *name, Edje_Program **pgrms, unsigned int count)
return EINA_FALSE;
}
-
static Eina_Bool
_part_name_check(void)
{
@@ -6611,30 +6775,30 @@ _part_name_check(void)
for (i = 0; i < (pc->parts_count - 1); i++)
{ /* Compare name only if did NOT updated ep from hircy pop */
- if ((ep != pc->parts[i]) &&
- (pc->parts[i]->name &&
- (!strcmp(pc->parts[i]->name, ep->name))))
- {
- Edje_Part_Parser *epp;
+ if ((ep != pc->parts[i]) &&
+ (pc->parts[i]->name &&
+ (!strcmp(pc->parts[i]->name, ep->name))))
+ {
+ Edje_Part_Parser *epp;
- epp = (Edje_Part_Parser *)pc->parts[i];
- if (!epp->can_override)
- {
- ERR("parse error %s:%i. There is already a part of the name %s",
- file_in, line - 1, ep->name);
- exit(-1);
- }
- else
- {
- pc->parts_count--;
- pc->parts = realloc(pc->parts, pc->parts_count * sizeof (Edje_Part *));
- current_part = pc->parts[i];
- edje_cc_handlers_hierarchy_rename(ep, current_part);
- free(ep);
- epp->can_override = EINA_FALSE;
- break;
- }
- }
+ epp = (Edje_Part_Parser *)pc->parts[i];
+ if (!epp->can_override)
+ {
+ ERR("parse error %s:%i. There is already a part of the name %s",
+ file_in, line - 1, ep->name);
+ exit(-1);
+ }
+ else
+ {
+ pc->parts_count--;
+ pc->parts = realloc(pc->parts, pc->parts_count * sizeof (Edje_Part *));
+ current_part = pc->parts[i];
+ edje_cc_handlers_hierarchy_rename(ep, current_part);
+ free(ep);
+ epp->can_override = EINA_FALSE;
+ break;
+ }
+ }
}
return EINA_TRUE;
}
@@ -6650,7 +6814,7 @@ _part_name_check(void)
positioning system, by programs and in some cases by the application.
It must be unique within the group.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_name(void)
{
@@ -6690,7 +6854,7 @@ st_collections_group_parts_part_name(void)
Defaults: IMAGE
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_type(void)
{
@@ -6768,7 +6932,7 @@ st_collections_group_parts_part_type(void)
Defaults: NONE
@since 1.8
@endproperty
-*/
+ */
#ifdef HAVE_EPHYSICS
static void
st_collections_group_parts_part_physics_body(void)
@@ -6803,6 +6967,7 @@ st_collections_group_parts_part_physics_body(void)
pc->physics_enabled = 1;
}
}
+
#endif
/**
@@ -6835,7 +7000,7 @@ st_collections_group_parts_part_physics_body(void)
You must define parent part name before adding nested parts.
@since 1.7
@endproperty
-*/
+ */
/**
@page edcref
@@ -6849,7 +7014,7 @@ st_collections_group_parts_part_physics_body(void)
more than one by insert_before.
@since 1.1
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_insert_before(void)
{
@@ -6873,7 +7038,7 @@ st_collections_group_parts_part_insert_before(void)
more than one by insert_after.
@since 1.1
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_insert_after(void)
{
@@ -6898,7 +7063,7 @@ st_collections_group_parts_part_insert_after(void)
Defaults: group.mouse_events
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_mouse_events(void)
{
@@ -6932,7 +7097,7 @@ st_collections_group_parts_part_nomouse(void)
Defaults: 1
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_anti_alias(void)
{
@@ -6952,7 +7117,7 @@ st_collections_group_parts_part_anti_alias(void)
Defaults: 0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_repeat_events(void)
{
@@ -6994,16 +7159,16 @@ st_collections_group_parts_part_norepeat(void)
Defaults: NONE
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_ignore_flags(void)
{
check_min_arg_count(1);
current_part->ignore_flags = parse_flags(0,
- "NONE", EVAS_EVENT_FLAG_NONE,
- "ON_HOLD", EVAS_EVENT_FLAG_ON_HOLD,
- NULL);
+ "NONE", EVAS_EVENT_FLAG_NONE,
+ "ON_HOLD", EVAS_EVENT_FLAG_ON_HOLD,
+ NULL);
}
/**
@@ -7021,16 +7186,16 @@ st_collections_group_parts_part_ignore_flags(void)
Defaults: NONE
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_mask_flags(void)
{
check_min_arg_count(1);
current_part->mask_flags = parse_flags(0,
- "NONE", EVAS_EVENT_FLAG_NONE,
- "ON_HOLD", EVAS_EVENT_FLAG_ON_HOLD,
- NULL);
+ "NONE", EVAS_EVENT_FLAG_NONE,
+ "ON_HOLD", EVAS_EVENT_FLAG_ON_HOLD,
+ NULL);
}
/**
@@ -7051,7 +7216,7 @@ st_collections_group_parts_part_mask_flags(void)
Defaults: 0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_scale(void)
{
@@ -7084,16 +7249,16 @@ st_collections_group_parts_part_noscale(void)
Defaults: AUTOGRAB
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_pointer_mode(void)
{
check_arg_count(1);
current_part->pointer_mode = parse_enum(0,
- "AUTOGRAB", EVAS_OBJECT_POINTER_MODE_AUTOGRAB,
- "NOGRAB", EVAS_OBJECT_POINTER_MODE_NOGRAB,
- NULL);
+ "AUTOGRAB", EVAS_OBJECT_POINTER_MODE_AUTOGRAB,
+ "NOGRAB", EVAS_OBJECT_POINTER_MODE_NOGRAB,
+ NULL);
}
/**
@@ -7108,7 +7273,7 @@ st_collections_group_parts_part_pointer_mode(void)
Defaults: 0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_precise_is_inside(void)
{
@@ -7146,7 +7311,7 @@ st_collections_group_parts_part_noprecise(void)
Defaults: 0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_use_alternate_font_metrics(void)
{
@@ -7166,7 +7331,7 @@ st_collections_group_parts_part_use_alternate_font_metrics(void)
container. Overflowing content will not be displayed. Note that
the part being clipped to can only be a rectangle part.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_clip_to_id(void)
{
@@ -7175,13 +7340,13 @@ st_collections_group_parts_part_clip_to_id(void)
check_arg_count(1);
pc = eina_list_data_get(eina_list_last(edje_collections));
- {
- char *name;
+ {
+ char *name;
- name = parse_str(0);
- data_queue_part_lookup(pc, name, &(current_part->clip_to_id));
- free(name);
- }
+ name = parse_str(0);
+ data_queue_part_lookup(pc, name, &(current_part->clip_to_id));
+ free(name);
+ }
}
/**
@@ -7200,7 +7365,7 @@ st_collections_group_parts_part_clip_to_id(void)
Defaults: 0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_no_render(void)
{
@@ -7229,7 +7394,7 @@ st_collections_group_parts_part_render(void)
Defaults: 0
@since 1.18
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_required(void)
{
@@ -7252,13 +7417,13 @@ st_collections_group_parts_part_norequired(void)
@parameters
[another group's name]
@effect
- Only available to GROUP or TEXTBLOCK parts. Swallows the specified
+ Only available to GROUP or TEXTBLOCK parts. Swallows the specified
group into the part's container if a GROUP. If TEXTBLOCK it is used
for the group to be loaded and used for selection display UNDER the
selected text. source2 is used for on top of the selected text, if
source2 is specified.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_source(void)
{
@@ -7276,11 +7441,11 @@ st_collections_group_parts_part_source(void)
@parameters
[another group's name]
@effect
- Only available to TEXTBLOCK parts. It is used for the group to be
+ Only available to TEXTBLOCK parts. It is used for the group to be
loaded and used for selection display OVER the selected text. source
is used for under of the selected text, if source is specified.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_source2(void)
{
@@ -7298,11 +7463,11 @@ st_collections_group_parts_part_source2(void)
@parameters
[another group's name]
@effect
- Only available to TEXTBLOCK parts. It is used for the group to be
+ Only available to TEXTBLOCK parts. It is used for the group to be
loaded and used for cursor display UNDER the cursor position. source4
is used for over the cursor text, if source4 is specified.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_source3(void)
{
@@ -7320,11 +7485,11 @@ st_collections_group_parts_part_source3(void)
@parameters
[another group's name]
@effect
- Only available to TEXTBLOCK parts. It is used for the group to be
+ Only available to TEXTBLOCK parts. It is used for the group to be
loaded and used for cursor display OVER the cursor position. source3
is used for under the cursor text, if source4 is specified.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_source4(void)
{
@@ -7342,11 +7507,11 @@ st_collections_group_parts_part_source4(void)
@parameters
[another group's name]
@effect
- Only available to TEXTBLOCK parts. It is used for the group to be
+ Only available to TEXTBLOCK parts. It is used for the group to be
loaded and used for anchors display UNDER the anchor position. source6
is used for over the anchors text, if source6 is specified.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_source5(void)
{
@@ -7364,11 +7529,11 @@ st_collections_group_parts_part_source5(void)
@parameters
[another group's name]
@effect
- Only available to TEXTBLOCK parts. It is used for the group to be
+ Only available to TEXTBLOCK parts. It is used for the group to be
loaded and used for anchor display OVER the anchor position. source5
is used for under the anchor text, if source6 is specified.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_source6(void)
{
@@ -7412,39 +7577,39 @@ st_collections_group_parts_part_source6(void)
Defaults: PLAIN
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_effect(void)
{
check_min_arg_count(1);
current_part->effect = parse_enum(0,
- "NONE", EDJE_TEXT_EFFECT_NONE,
- "PLAIN", EDJE_TEXT_EFFECT_PLAIN,
- "OUTLINE", EDJE_TEXT_EFFECT_OUTLINE,
- "SOFT_OUTLINE", EDJE_TEXT_EFFECT_SOFT_OUTLINE,
- "SHADOW", EDJE_TEXT_EFFECT_SHADOW,
- "SOFT_SHADOW", EDJE_TEXT_EFFECT_SOFT_SHADOW,
- "OUTLINE_SHADOW", EDJE_TEXT_EFFECT_OUTLINE_SHADOW,
- "OUTLINE_SOFT_SHADOW", EDJE_TEXT_EFFECT_OUTLINE_SOFT_SHADOW,
- "FAR_SHADOW", EDJE_TEXT_EFFECT_FAR_SHADOW,
- "FAR_SOFT_SHADOW", EDJE_TEXT_EFFECT_FAR_SOFT_SHADOW,
- "GLOW", EDJE_TEXT_EFFECT_GLOW,
- NULL);
+ "NONE", EDJE_TEXT_EFFECT_NONE,
+ "PLAIN", EDJE_TEXT_EFFECT_PLAIN,
+ "OUTLINE", EDJE_TEXT_EFFECT_OUTLINE,
+ "SOFT_OUTLINE", EDJE_TEXT_EFFECT_SOFT_OUTLINE,
+ "SHADOW", EDJE_TEXT_EFFECT_SHADOW,
+ "SOFT_SHADOW", EDJE_TEXT_EFFECT_SOFT_SHADOW,
+ "OUTLINE_SHADOW", EDJE_TEXT_EFFECT_OUTLINE_SHADOW,
+ "OUTLINE_SOFT_SHADOW", EDJE_TEXT_EFFECT_OUTLINE_SOFT_SHADOW,
+ "FAR_SHADOW", EDJE_TEXT_EFFECT_FAR_SHADOW,
+ "FAR_SOFT_SHADOW", EDJE_TEXT_EFFECT_FAR_SOFT_SHADOW,
+ "GLOW", EDJE_TEXT_EFFECT_GLOW,
+ NULL);
if (get_arg_count() >= 2)
{
unsigned char shadow;
-
+
shadow = parse_enum(1,
- "BOTTOM_RIGHT", EDJE_TEXT_EFFECT_SHADOW_DIRECTION_BOTTOM_RIGHT,
- "BOTTOM", EDJE_TEXT_EFFECT_SHADOW_DIRECTION_BOTTOM,
- "BOTTOM_LEFT", EDJE_TEXT_EFFECT_SHADOW_DIRECTION_BOTTOM_LEFT,
- "LEFT", EDJE_TEXT_EFFECT_SHADOW_DIRECTION_LEFT,
- "TOP_LEFT", EDJE_TEXT_EFFECT_SHADOW_DIRECTION_TOP_LEFT,
- "TOP", EDJE_TEXT_EFFECT_SHADOW_DIRECTION_TOP,
- "TOP_RIGHT", EDJE_TEXT_EFFECT_SHADOW_DIRECTION_TOP_RIGHT,
- "RIGHT", EDJE_TEXT_EFFECT_SHADOW_DIRECTION_RIGHT,
- NULL);
+ "BOTTOM_RIGHT", EDJE_TEXT_EFFECT_SHADOW_DIRECTION_BOTTOM_RIGHT,
+ "BOTTOM", EDJE_TEXT_EFFECT_SHADOW_DIRECTION_BOTTOM,
+ "BOTTOM_LEFT", EDJE_TEXT_EFFECT_SHADOW_DIRECTION_BOTTOM_LEFT,
+ "LEFT", EDJE_TEXT_EFFECT_SHADOW_DIRECTION_LEFT,
+ "TOP_LEFT", EDJE_TEXT_EFFECT_SHADOW_DIRECTION_TOP_LEFT,
+ "TOP", EDJE_TEXT_EFFECT_SHADOW_DIRECTION_TOP,
+ "TOP_RIGHT", EDJE_TEXT_EFFECT_SHADOW_DIRECTION_TOP_RIGHT,
+ "RIGHT", EDJE_TEXT_EFFECT_SHADOW_DIRECTION_RIGHT,
+ NULL);
EDJE_TEXT_EFFECT_SHADOW_DIRECTION_SET(current_part->effect, shadow);
}
}
@@ -7470,18 +7635,18 @@ st_collections_group_parts_part_effect(void)
Defaults: NONE
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_entry_mode(void)
{
check_arg_count(1);
current_part->entry_mode = parse_enum(0,
- "NONE", EDJE_ENTRY_EDIT_MODE_NONE,
- "PLAIN", EDJE_ENTRY_EDIT_MODE_SELECTABLE,
- "EDITABLE", EDJE_ENTRY_EDIT_MODE_EDITABLE,
- "PASSWORD", EDJE_ENTRY_EDIT_MODE_PASSWORD,
- NULL);
+ "NONE", EDJE_ENTRY_EDIT_MODE_NONE,
+ "PLAIN", EDJE_ENTRY_EDIT_MODE_SELECTABLE,
+ "EDITABLE", EDJE_ENTRY_EDIT_MODE_EDITABLE,
+ "PASSWORD", EDJE_ENTRY_EDIT_MODE_PASSWORD,
+ NULL);
}
/**
@@ -7498,16 +7663,16 @@ st_collections_group_parts_part_entry_mode(void)
controlling the edje object has to explicitly begin and end selection
modes, and the selection itself is draggable at both ends.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_select_mode(void)
{
check_arg_count(1);
current_part->select_mode = parse_enum(0,
- "DEFAULT", EDJE_ENTRY_SELECTION_MODE_DEFAULT,
- "EXPLICIT", EDJE_ENTRY_SELECTION_MODE_EXPLICIT,
- NULL);
+ "DEFAULT", EDJE_ENTRY_SELECTION_MODE_DEFAULT,
+ "EXPLICIT", EDJE_ENTRY_SELECTION_MODE_EXPLICIT,
+ NULL);
}
/**
@@ -7524,16 +7689,16 @@ st_collections_group_parts_part_select_mode(void)
Defaults: UNDER
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_cursor_mode(void)
{
check_arg_count(1);
current_part->cursor_mode = parse_enum(0,
- "UNDER", EDJE_ENTRY_CURSOR_MODE_UNDER,
- "BEFORE", EDJE_ENTRY_CURSOR_MODE_BEFORE,
- NULL);
+ "UNDER", EDJE_ENTRY_CURSOR_MODE_UNDER,
+ "BEFORE", EDJE_ENTRY_CURSOR_MODE_BEFORE,
+ NULL);
}
/**
@@ -7548,7 +7713,7 @@ st_collections_group_parts_part_cursor_mode(void)
Defaults: 0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_multiline(void)
{
@@ -7560,7 +7725,7 @@ st_collections_group_parts_part_multiline(void)
/**
@page edcref
@property
- access
+ access
@parameters
[1 or 0]
@effect
@@ -7568,7 +7733,7 @@ st_collections_group_parts_part_multiline(void)
Defaults: 0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_access(void)
{
@@ -7620,7 +7785,7 @@ st_collections_group_parts_part_access(void)
Defaults: 0 0 0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_dragable_x(void)
{
@@ -7648,7 +7813,7 @@ st_collections_group_parts_part_dragable_x(void)
Defaults: 0 0 0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_dragable_y(void)
{
@@ -7670,7 +7835,7 @@ st_collections_group_parts_part_dragable_y(void)
container. When you use confine don't forget to set a min size for the
part, or the draggie will not show up.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_dragable_confine(void)
{
@@ -7679,13 +7844,13 @@ st_collections_group_parts_part_dragable_confine(void)
check_arg_count(1);
pc = eina_list_data_get(eina_list_last(edje_collections));
- {
- char *name;
+ {
+ char *name;
- name = parse_str(0);
- data_queue_part_lookup(pc, name, &(current_part->dragable.confine_id));
- free(name);
- }
+ name = parse_str(0);
+ data_queue_part_lookup(pc, name, &(current_part->dragable.confine_id));
+ free(name);
+ }
}
/**
@@ -7698,7 +7863,7 @@ st_collections_group_parts_part_dragable_confine(void)
When set, the movement of the dragged part can only start when it get
moved enough to be outside of the threshold part.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_dragable_threshold(void)
{
@@ -7707,13 +7872,13 @@ st_collections_group_parts_part_dragable_threshold(void)
check_arg_count(1);
pc = eina_list_data_get(eina_list_last(edje_collections));
- {
- char *name;
+ {
+ char *name;
- name = parse_str(0);
- data_queue_part_lookup(pc, name, &(current_part->dragable.threshold_id));
- free(name);
- }
+ name = parse_str(0);
+ data_queue_part_lookup(pc, name, &(current_part->dragable.threshold_id));
+ free(name);
+ }
}
/**
@@ -7726,7 +7891,7 @@ st_collections_group_parts_part_dragable_threshold(void)
It causes the part to forward the drag events to another part, thus
ignoring them for itself.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_dragable_events(void)
{
@@ -7735,13 +7900,13 @@ st_collections_group_parts_part_dragable_events(void)
check_arg_count(1);
pc = eina_list_data_get(eina_list_last(edje_collections));
- {
- char *name;
+ {
+ char *name;
- name = parse_str(0);
- data_queue_part_lookup(pc, name, &(current_part->dragable.event_id));
- free(name);
- }
+ name = parse_str(0);
+ data_queue_part_lookup(pc, name, &(current_part->dragable.event_id));
+ free(name);
+ }
}
/**
@@ -7761,7 +7926,7 @@ st_collections_group_parts_part_dragable_events(void)
Also it won't be able to focus this part.
@since 1.19
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_allowed_seats(void)
{
@@ -7826,8 +7991,9 @@ st_collections_group_parts_part_allowed_seats(void)
as elements of the box. These can be mixed with external objects set
by the application through the edje_object_part_box_* API.
@endblock
-*/
-static void ob_collections_group_parts_part_box_items_item(void)
+ */
+static void
+ob_collections_group_parts_part_box_items_item(void)
{
Edje_Part *ep;
Edje_Pack_Element *item;
@@ -7843,7 +8009,7 @@ static void ob_collections_group_parts_part_box_items_item(void)
}
ep->items_count++;
- ep->items = realloc(ep->items, sizeof (Edje_Pack_Element*) * ep->items_count);
+ ep->items = realloc(ep->items, sizeof (Edje_Pack_Element *) * ep->items_count);
if (!ep->items)
{
ERR("Not enough memory.");
@@ -7883,12 +8049,12 @@ static void ob_collections_group_parts_part_box_items_item(void)
pitem->can_override = EINA_FALSE;
}
-#define CURRENT_ITEM_CHECK \
- if (!current_item) \
- { \
- ERR("parse error %s:%i. Item not defined at this stage.", \
- file_in, line - 1); \
- exit(-1); \
+#define CURRENT_ITEM_CHECK \
+ if (!current_item) \
+ { \
+ ERR("parse error %s:%i. Item not defined at this stage.", \
+ file_in, line - 1); \
+ exit(-1); \
}
/**
@@ -7902,28 +8068,29 @@ static void ob_collections_group_parts_part_box_items_item(void)
Supported types are:
@li GROUP
@endproperty
-*/
-static void st_collections_group_parts_part_box_items_item_type(void)
+ */
+static void
+st_collections_group_parts_part_box_items_item_type(void)
{
CURRENT_ITEM_CHECK;
check_arg_count(1);
- {
- char *s;
+ {
+ char *s;
- s = parse_str(0);
- if (strcmp(s, "GROUP"))
- {
- ERR("parse error %s:%i. token %s not one of: GROUP.",
- file_in, line - 1, s);
- free(s);
- exit(-1);
- }
- free(s);
- /* FIXME: handle the enum, once everything else is supported */
- current_item->type = EDJE_PART_TYPE_GROUP;
- }
+ s = parse_str(0);
+ if (strcmp(s, "GROUP"))
+ {
+ ERR("parse error %s:%i. token %s not one of: GROUP.",
+ file_in, line - 1, s);
+ free(s);
+ exit(-1);
+ }
+ free(s);
+ /* FIXME: handle the enum, once everything else is supported */
+ current_item->type = EDJE_PART_TYPE_GROUP;
+ }
}
/**
@@ -7935,8 +8102,9 @@ static void st_collections_group_parts_part_box_items_item_type(void)
@effect
Sets the name of the object via evas_object_name_set().
@endproperty
-*/
-static void st_collections_group_parts_part_box_items_item_name(void)
+ */
+static void
+st_collections_group_parts_part_box_items_item_name(void)
{
Edje_Part *ep;
Edje_Pack_Element *item;
@@ -7951,32 +8119,32 @@ static void st_collections_group_parts_part_box_items_item_name(void)
item->name = parse_str(0);
- {
- unsigned int i;
+ {
+ unsigned int i;
- for (i = 0; i < ep->items_count - 1; ++i)
- {
- if (ep->items[i]->name && (!strcmp(ep->items[i]->name, item->name)))
- {
- pitem = (Edje_Pack_Element_Parser *)ep->items[i];
- if (!pitem->can_override)
- {
- ERR("parse error %s:%i. There is already a item of the name %s",
- file_in, line - 1, item->name);
- exit(-1);
- }
- else
- {
- free(item);
- ep->items_count--;
- ep->items = realloc(ep->items, ep->items_count * sizeof (Edje_Pack_Element *));
- current_item = ep->items[i];
- pitem->can_override = EINA_FALSE;
- break;
- }
- }
- }
- }
+ for (i = 0; i < ep->items_count - 1; ++i)
+ {
+ if (ep->items[i]->name && (!strcmp(ep->items[i]->name, item->name)))
+ {
+ pitem = (Edje_Pack_Element_Parser *)ep->items[i];
+ if (!pitem->can_override)
+ {
+ ERR("parse error %s:%i. There is already a item of the name %s",
+ file_in, line - 1, item->name);
+ exit(-1);
+ }
+ else
+ {
+ free(item);
+ ep->items_count--;
+ ep->items = realloc(ep->items, ep->items_count * sizeof (Edje_Pack_Element *));
+ current_item = ep->items[i];
+ pitem->can_override = EINA_FALSE;
+ break;
+ }
+ }
+ }
+ }
}
/**
@@ -7988,8 +8156,9 @@ static void st_collections_group_parts_part_box_items_item_name(void)
@effect
Sets the group this object will be made from.
@endproperty
-*/
-static void st_collections_group_parts_part_box_items_item_source(void)
+ */
+static void
+st_collections_group_parts_part_box_items_item_source(void)
{
CURRENT_ITEM_CHECK;
@@ -8010,8 +8179,9 @@ static void st_collections_group_parts_part_box_items_item_source(void)
Defaults: 0 0
@endproperty
-*/
-static void st_collections_group_parts_part_box_items_item_min(void)
+ */
+static void
+st_collections_group_parts_part_box_items_item_min(void)
{
CURRENT_ITEM_CHECK;
@@ -8033,8 +8203,9 @@ static void st_collections_group_parts_part_box_items_item_min(void)
Defaults: 1 1
@endproperty
-*/
-static void st_collections_group_parts_part_box_items_item_spread(void)
+ */
+static void
+st_collections_group_parts_part_box_items_item_spread(void)
{
CURRENT_ITEM_CHECK;
@@ -8055,8 +8226,9 @@ static void st_collections_group_parts_part_box_items_item_spread(void)
Defaults: 0 0
@endproperty
-*/
-static void st_collections_group_parts_part_box_items_item_prefer(void)
+ */
+static void
+st_collections_group_parts_part_box_items_item_prefer(void)
{
CURRENT_ITEM_CHECK;
@@ -8065,6 +8237,7 @@ static void st_collections_group_parts_part_box_items_item_prefer(void)
current_item->prefer.w = parse_int_range(0, 0, 0x7ffffff);
current_item->prefer.h = parse_int_range(1, 0, 0x7ffffff);
}
+
/**
@page edcref
@property
@@ -8076,8 +8249,9 @@ static void st_collections_group_parts_part_box_items_item_prefer(void)
Defaults: -1 -1
@endproperty
-*/
-static void st_collections_group_parts_part_box_items_item_max(void)
+ */
+static void
+st_collections_group_parts_part_box_items_item_max(void)
{
CURRENT_ITEM_CHECK;
@@ -8098,8 +8272,9 @@ static void st_collections_group_parts_part_box_items_item_max(void)
Defaults: 0 0 0 0
@endproperty
-*/
-static void st_collections_group_parts_part_box_items_item_padding(void)
+ */
+static void
+st_collections_group_parts_part_box_items_item_padding(void)
{
CURRENT_ITEM_CHECK;
@@ -8122,8 +8297,9 @@ static void st_collections_group_parts_part_box_items_item_padding(void)
Defaults: 0.5
@endproperty
-*/
-static void st_collections_group_parts_part_box_items_item_align(void)
+ */
+static void
+st_collections_group_parts_part_box_items_item_align(void)
{
CURRENT_ITEM_CHECK;
@@ -8144,8 +8320,9 @@ static void st_collections_group_parts_part_box_items_item_align(void)
Defaults: 0.0 0.0
@endproperty
-*/
-static void st_collections_group_parts_part_box_items_item_weight(void)
+ */
+static void
+st_collections_group_parts_part_box_items_item_weight(void)
{
CURRENT_ITEM_CHECK;
@@ -8166,8 +8343,9 @@ static void st_collections_group_parts_part_box_items_item_weight(void)
Defaults: 0 0
@endproperty
-*/
-static void st_collections_group_parts_part_box_items_item_aspect(void)
+ */
+static void
+st_collections_group_parts_part_box_items_item_aspect(void)
{
CURRENT_ITEM_CHECK;
@@ -8193,20 +8371,21 @@ static void st_collections_group_parts_part_box_items_item_aspect(void)
Defaults: NONE
@endproperty
-*/
-static void st_collections_group_parts_part_box_items_item_aspect_mode(void)
+ */
+static void
+st_collections_group_parts_part_box_items_item_aspect_mode(void)
{
CURRENT_ITEM_CHECK;
check_arg_count(1);
current_item->aspect.mode = parse_enum(0,
- "NONE", EDJE_ASPECT_CONTROL_NONE,
- "NEITHER", EDJE_ASPECT_CONTROL_NEITHER,
- "HORIZONTAL", EDJE_ASPECT_CONTROL_HORIZONTAL,
- "VERTICAL", EDJE_ASPECT_CONTROL_VERTICAL,
- "BOTH", EDJE_ASPECT_CONTROL_BOTH,
- NULL);
+ "NONE", EDJE_ASPECT_CONTROL_NONE,
+ "NEITHER", EDJE_ASPECT_CONTROL_NEITHER,
+ "HORIZONTAL", EDJE_ASPECT_CONTROL_HORIZONTAL,
+ "VERTICAL", EDJE_ASPECT_CONTROL_VERTICAL,
+ "BOTH", EDJE_ASPECT_CONTROL_BOTH,
+ NULL);
}
/**
@@ -8218,8 +8397,9 @@ static void st_collections_group_parts_part_box_items_item_aspect_mode(void)
@effect
Sets extra options for the object. Unused for now.
@endproperty
-*/
-static void st_collections_group_parts_part_box_items_item_options(void)
+ */
+static void
+st_collections_group_parts_part_box_items_item_options(void)
{
CURRENT_ITEM_CHECK;
@@ -8238,8 +8418,9 @@ static void st_collections_group_parts_part_box_items_item_options(void)
Sets the position this item will have in the table.
This is required for parts of type TABLE.
@endproperty
-*/
-static void st_collections_group_parts_part_table_items_item_position(void)
+ */
+static void
+st_collections_group_parts_part_table_items_item_position(void)
{
CURRENT_ITEM_CHECK;
@@ -8267,8 +8448,9 @@ static void st_collections_group_parts_part_table_items_item_position(void)
Defaults: 1 1
@endproperty
-*/
-static void st_collections_group_parts_part_table_items_item_span(void)
+ */
+static void
+st_collections_group_parts_part_table_items_item_span(void)
{
CURRENT_ITEM_CHECK;
@@ -8347,96 +8529,96 @@ _copied_map_colors_get(Edje_Part_Description_Common *parent)
used to define style and layout properties of a part in a given
"state".
@endblock
-*/
+ */
static void
ob_collections_group_parts_part_description(void)
{ /* Allocate and set desc, set relative part hierarchy if needed */
- Edje_Part_Collection *pc;
- Edje_Part *ep;
- Edje_Part_Description_Common *ed;
-
- pc = eina_list_data_get(eina_list_last(edje_collections));
- ep = current_part;
-
- ed = _edje_part_description_alloc(ep->type, pc->part, ep->name);
- eina_hash_add(desc_hash, &ed, ep);
-
- ed->rel1.id_x = -1;
- ed->rel1.id_y = -1;
- ed->rel2.id_x = -1;
- ed->rel2.id_y = -1;
- ed->clip_to_id = -1;
-
- if (!ep->default_desc)
- {
- current_desc = ep->default_desc = ed;
- ed->state.name = strdup("default");
+ Edje_Part_Collection *pc;
+ Edje_Part *ep;
+ Edje_Part_Description_Common *ed;
+
+ pc = eina_list_data_get(eina_list_last(edje_collections));
+ ep = current_part;
+
+ ed = _edje_part_description_alloc(ep->type, pc->part, ep->name);
+ eina_hash_add(desc_hash, &ed, ep);
+
+ ed->rel1.id_x = -1;
+ ed->rel1.id_y = -1;
+ ed->rel2.id_x = -1;
+ ed->rel2.id_y = -1;
+ ed->clip_to_id = -1;
+
+ if (!ep->default_desc)
+ {
+ current_desc = ep->default_desc = ed;
+ ed->state.name = strdup("default");
+
+ { /* Get the ptr of the part above current part in hierarchy */
+ Edje_Part *node = edje_cc_handlers_hierarchy_parent_get();
+ if (node) /* Make relative according to part hierarchy */
+ edje_cc_handlers_hierarchy_set(node);
+ }
+ }
+ else
+ {
+ ep->other.desc_count++;
+ ep->other.desc = realloc(ep->other.desc,
+ sizeof (Edje_Part_Description_Common *) * ep->other.desc_count);
+ current_desc = ep->other.desc[ep->other.desc_count - 1] = ed;
+ }
- { /* Get the ptr of the part above current part in hierarchy */
- Edje_Part *node = edje_cc_handlers_hierarchy_parent_get();
- if (node) /* Make relative according to part hierarchy */
- edje_cc_handlers_hierarchy_set(node);
- }
- }
- else
- {
- ep->other.desc_count++;
- ep->other.desc = realloc(ep->other.desc,
- sizeof (Edje_Part_Description_Common*) * ep->other.desc_count);
- current_desc = ep->other.desc[ep->other.desc_count - 1] = ed;
- }
-
- ed->visible = 1;
- ed->limit = 0;
- ed->no_render = 0;
- ed->align.x = FROM_DOUBLE(0.5);
- ed->align.y = FROM_DOUBLE(0.5);
- ed->min.w = 0;
- ed->min.h = 0;
- ed->fixed.w = 0;
- ed->fixed.h = 0;
- ed->max.w = -1;
- ed->max.h = -1;
- ed->size_class = NULL;
- ed->rel1.relative_x = FROM_DOUBLE(0.0);
- ed->rel1.relative_y = FROM_DOUBLE(0.0);
- ed->rel1.offset_x = 0;
- ed->rel1.offset_y = 0;
- ed->rel2.relative_x = FROM_DOUBLE(1.0);
- ed->rel2.relative_y = FROM_DOUBLE(1.0);
- ed->rel2.offset_x = -1;
- ed->rel2.offset_y = -1;
- ed->color_class = NULL;
- ed->color.r = 255;
- ed->color.g = 255;
- ed->color.b = 255;
- ed->color.a = 255;
- ed->color2.r = 0;
- ed->color2.g = 0;
- ed->color2.b = 0;
- ed->color2.a = 255;
- ed->map.id_persp = -1;
- ed->map.id_light = -1;
- ed->map.rot.id_center = -1;
- ed->map.rot.x = FROM_DOUBLE(0.0);
- ed->map.rot.y = FROM_DOUBLE(0.0);
- ed->map.rot.z = FROM_DOUBLE(0.0);
- ed->map.on = 0;
- ed->map.smooth = 1;
- ed->map.alpha = 1;
- ed->map.backcull = 0;
- ed->map.persp_on = 0;
- ed->map.colors = NULL;
- ed->map.zoom.x = FROM_DOUBLE(1.0);
- ed->map.zoom.y = FROM_DOUBLE(1.0);
- ed->persp.zplane = 0;
- ed->persp.focal = 1000;
- ed->minmul.have = 1;
- ed->minmul.w = FROM_DOUBLE(1.0);
- ed->minmul.h = FROM_DOUBLE(1.0);
- ed->align_3d.x = FROM_DOUBLE(0.5);
- ed->align_3d.y = FROM_DOUBLE(0.5);
- ed->align_3d.z = FROM_DOUBLE(0.5);
+ ed->visible = 1;
+ ed->limit = 0;
+ ed->no_render = 0;
+ ed->align.x = FROM_DOUBLE(0.5);
+ ed->align.y = FROM_DOUBLE(0.5);
+ ed->min.w = 0;
+ ed->min.h = 0;
+ ed->fixed.w = 0;
+ ed->fixed.h = 0;
+ ed->max.w = -1;
+ ed->max.h = -1;
+ ed->size_class = NULL;
+ ed->rel1.relative_x = FROM_DOUBLE(0.0);
+ ed->rel1.relative_y = FROM_DOUBLE(0.0);
+ ed->rel1.offset_x = 0;
+ ed->rel1.offset_y = 0;
+ ed->rel2.relative_x = FROM_DOUBLE(1.0);
+ ed->rel2.relative_y = FROM_DOUBLE(1.0);
+ ed->rel2.offset_x = -1;
+ ed->rel2.offset_y = -1;
+ ed->color_class = NULL;
+ ed->color.r = 255;
+ ed->color.g = 255;
+ ed->color.b = 255;
+ ed->color.a = 255;
+ ed->color2.r = 0;
+ ed->color2.g = 0;
+ ed->color2.b = 0;
+ ed->color2.a = 255;
+ ed->map.id_persp = -1;
+ ed->map.id_light = -1;
+ ed->map.rot.id_center = -1;
+ ed->map.rot.x = FROM_DOUBLE(0.0);
+ ed->map.rot.y = FROM_DOUBLE(0.0);
+ ed->map.rot.z = FROM_DOUBLE(0.0);
+ ed->map.on = 0;
+ ed->map.smooth = 1;
+ ed->map.alpha = 1;
+ ed->map.backcull = 0;
+ ed->map.persp_on = 0;
+ ed->map.colors = NULL;
+ ed->map.zoom.x = FROM_DOUBLE(1.0);
+ ed->map.zoom.y = FROM_DOUBLE(1.0);
+ ed->persp.zplane = 0;
+ ed->persp.focal = 1000;
+ ed->minmul.have = 1;
+ ed->minmul.w = FROM_DOUBLE(1.0);
+ ed->minmul.h = FROM_DOUBLE(1.0);
+ ed->align_3d.x = FROM_DOUBLE(0.5);
+ ed->align_3d.y = FROM_DOUBLE(0.5);
+ ed->align_3d.z = FROM_DOUBLE(0.5);
}
static void
@@ -8459,7 +8641,7 @@ ob_collections_group_parts_part_desc(void)
simple state changes. Note: inheritance in Edje is single level only.
@since 1.14 omitting both the description name and index will inherit the default 0.0 description.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_inherit(void)
{
@@ -8495,19 +8677,22 @@ st_collections_group_parts_part_description_inherit(void)
case 0:
parent_name = strdup("default");
break;
+
case 2:
parent_val = parse_float_range(1, 0.0, 1.0);
EINA_FALLTHROUGH;
+
case 1:
parent_name = parse_str(0);
break;
+
default:
ERR("parse error %s:%i. too many parameters",
file_in, line - 1);
exit(-1);
}
- if (!strcmp (parent_name, "default") && parent_val == 0.0)
+ if (!strcmp(parent_name, "default") && parent_val == 0.0)
parent = ep->default_desc;
else
{
@@ -8525,9 +8710,8 @@ st_collections_group_parts_part_description_inherit(void)
{
d = ep->other.desc[i];
- if (!strcmp (d->state.name, parent_name))
+ if (!strcmp(d->state.name, parent_name))
{
-
double dst;
dst = ABS(d->state.value - parent_val);
@@ -8539,8 +8723,8 @@ st_collections_group_parts_part_description_inherit(void)
}
}
- if (min_dst)
- {
+ if (min_dst)
+ {
WRN("%s:%i: couldn't find an exact match in part '%s' when looking for '%s' %lf. Falling back to nearest one '%s' %lf.",
file_in, line - 1, ep->name, parent_name, parent_val, parent ? parent->state.name : NULL, parent ? parent->state.value : 0);
}
@@ -8598,162 +8782,173 @@ st_collections_group_parts_part_description_inherit(void)
case EDJE_PART_TYPE_RECTANGLE:
case EDJE_PART_TYPE_SWALLOW:
case EDJE_PART_TYPE_GROUP:
- /* Nothing todo, this part only have a common description. */
- break;
+ /* Nothing todo, this part only have a common description. */
+ break;
+
case EDJE_PART_TYPE_TEXT:
case EDJE_PART_TYPE_TEXTBLOCK:
- {
- Edje_Part_Description_Text *ted = (Edje_Part_Description_Text*) ed;
- Edje_Part_Description_Text *tparent = (Edje_Part_Description_Text*) parent;
+ {
+ Edje_Part_Description_Text *ted = (Edje_Part_Description_Text *)ed;
+ Edje_Part_Description_Text *tparent = (Edje_Part_Description_Text *)parent;
- ted->text = tparent->text;
+ ted->text = tparent->text;
- ted->text.text.str = STRDUP(ted->text.text.str);
- ted->text.domain = STRDUP(ted->text.domain);
- ted->text.text_class = STRDUP(ted->text.text_class);
- ted->text.font.str = STRDUP(ted->text.font.str);
+ ted->text.text.str = STRDUP(ted->text.text.str);
+ ted->text.domain = STRDUP(ted->text.domain);
+ ted->text.text_class = STRDUP(ted->text.text_class);
+ ted->text.font.str = STRDUP(ted->text.font.str);
- _filter_copy(&ted->filter, &tparent->filter);
- data_queue_copied_part_nest_lookup(pc, &(tparent->text.id_source), &(ted->text.id_source), &ted->text.id_source_part);
- data_queue_copied_part_nest_lookup(pc, &(tparent->text.id_text_source), &(ted->text.id_text_source), &ted->text.id_text_source_part);
+ _filter_copy(&ted->filter, &tparent->filter);
+ data_queue_copied_part_nest_lookup(pc, &(tparent->text.id_source), &(ted->text.id_source), &ted->text.id_source_part);
+ data_queue_copied_part_nest_lookup(pc, &(tparent->text.id_text_source), &(ted->text.id_text_source), &ted->text.id_text_source_part);
+
+ break;
+ }
- break;
- }
case EDJE_PART_TYPE_IMAGE:
- {
- Edje_Part_Description_Image *ied = (Edje_Part_Description_Image *) ed;
- Edje_Part_Description_Image *iparent = (Edje_Part_Description_Image *) parent;
- unsigned int i;
+ {
+ Edje_Part_Description_Image *ied = (Edje_Part_Description_Image *)ed;
+ Edje_Part_Description_Image *iparent = (Edje_Part_Description_Image *)parent;
+ unsigned int i;
- ied->image = iparent->image;
+ ied->image = iparent->image;
- data_queue_image_remove(&ied->image.id, &ied->image.set);
- data_queue_copied_image_lookup(&iparent->image.id, &ied->image.id, &ied->image.set);
+ data_queue_image_remove(&ied->image.id, &ied->image.set);
+ data_queue_copied_image_lookup(&iparent->image.id, &ied->image.id, &ied->image.set);
- ied->image.tweens = calloc(iparent->image.tweens_count,
- sizeof (Edje_Part_Image_Id*));
- for (i = 0; i < iparent->image.tweens_count; i++)
- {
- Edje_Part_Image_Id *iid_new;
+ ied->image.tweens = calloc(iparent->image.tweens_count,
+ sizeof (Edje_Part_Image_Id *));
+ for (i = 0; i < iparent->image.tweens_count; i++)
+ {
+ Edje_Part_Image_Id *iid_new;
- iid = iparent->image.tweens[i];
+ iid = iparent->image.tweens[i];
- iid_new = mem_alloc(SZ(Edje_Part_Image_Id));
- data_queue_image_remove(&ied->image.id, &ied->image.set);
- data_queue_copied_image_lookup(&(iid->id), &(iid_new->id), &(iid_new->set));
- ied->image.tweens[i] = iid_new;
- }
+ iid_new = mem_alloc(SZ(Edje_Part_Image_Id));
+ data_queue_image_remove(&ied->image.id, &ied->image.set);
+ data_queue_copied_image_lookup(&(iid->id), &(iid_new->id), &(iid_new->set));
+ ied->image.tweens[i] = iid_new;
+ }
- _filter_copy(&ied->filter, &iparent->filter);
+ _filter_copy(&ied->filter, &iparent->filter);
+
+ break;
+ }
- break;
- }
case EDJE_PART_TYPE_SNAPSHOT:
- {
- Edje_Part_Description_Snapshot *sed = (Edje_Part_Description_Snapshot*) ed;
- Edje_Part_Description_Snapshot *sparent = (Edje_Part_Description_Snapshot*) parent;
+ {
+ Edje_Part_Description_Snapshot *sed = (Edje_Part_Description_Snapshot *)ed;
+ Edje_Part_Description_Snapshot *sparent = (Edje_Part_Description_Snapshot *)parent;
- _filter_copy(&sed->filter, &sparent->filter);
+ _filter_copy(&sed->filter, &sparent->filter);
+
+ break;
+ }
- break;
- }
case EDJE_PART_TYPE_PROXY:
- {
- Edje_Part_Description_Proxy *ped = (Edje_Part_Description_Proxy*) ed;
- Edje_Part_Description_Proxy *pparent = (Edje_Part_Description_Proxy*) parent;
+ {
+ Edje_Part_Description_Proxy *ped = (Edje_Part_Description_Proxy *)ed;
+ Edje_Part_Description_Proxy *pparent = (Edje_Part_Description_Proxy *)parent;
- data_queue_copied_part_lookup(pc, &(pparent->proxy.id), &(ped->proxy.id));
- ped->proxy.source_clip = pparent->proxy.source_clip;
- ped->proxy.source_visible = pparent->proxy.source_visible;
- _filter_copy(&ped->filter, &pparent->filter);
+ data_queue_copied_part_lookup(pc, &(pparent->proxy.id), &(ped->proxy.id));
+ ped->proxy.source_clip = pparent->proxy.source_clip;
+ ped->proxy.source_visible = pparent->proxy.source_visible;
+ _filter_copy(&ped->filter, &pparent->filter);
+
+ break;
+ }
- break;
- }
case EDJE_PART_TYPE_BOX:
- {
- Edje_Part_Description_Box *bed = (Edje_Part_Description_Box *) ed;
- Edje_Part_Description_Box *bparent = (Edje_Part_Description_Box *) parent;
+ {
+ Edje_Part_Description_Box *bed = (Edje_Part_Description_Box *)ed;
+ Edje_Part_Description_Box *bparent = (Edje_Part_Description_Box *)parent;
- bed->box = bparent->box;
+ bed->box = bparent->box;
+
+ break;
+ }
- break;
- }
case EDJE_PART_TYPE_TABLE:
- {
- Edje_Part_Description_Table *ted = (Edje_Part_Description_Table *) ed;
- Edje_Part_Description_Table *tparent = (Edje_Part_Description_Table *) parent;
+ {
+ Edje_Part_Description_Table *ted = (Edje_Part_Description_Table *)ed;
+ Edje_Part_Description_Table *tparent = (Edje_Part_Description_Table *)parent;
- ted->table = tparent->table;
+ ted->table = tparent->table;
+
+ break;
+ }
- break;
- }
case EDJE_PART_TYPE_EXTERNAL:
+ {
+ Edje_Part_Description_External *eed = (Edje_Part_Description_External *)ed;
+ Edje_Part_Description_External *eparent = (Edje_Part_Description_External *)parent;
+
+ if (eparent->external_params)
{
- Edje_Part_Description_External *eed = (Edje_Part_Description_External *) ed;
- Edje_Part_Description_External *eparent = (Edje_Part_Description_External *) parent;
+ Eina_List *l;
+ Edje_External_Param *param, *new_param;
- if (eparent->external_params)
+ eed->external_params = NULL;
+ EINA_LIST_FOREACH(eparent->external_params, l, param)
{
- Eina_List *l;
- Edje_External_Param *param, *new_param;
-
- eed->external_params = NULL;
- EINA_LIST_FOREACH(eparent->external_params, l, param)
- {
- new_param = mem_alloc(SZ(Edje_External_Param));
- *new_param = *param;
- eed->external_params = eina_list_append(eed->external_params, new_param);
- }
+ new_param = mem_alloc(SZ(Edje_External_Param));
+ *new_param = *param;
+ eed->external_params = eina_list_append(eed->external_params, new_param);
}
- break;
}
+ break;
+ }
+
case EDJE_PART_TYPE_CAMERA:
- {
- Edje_Part_Description_Camera *ced = (Edje_Part_Description_Camera *) ed;
- Edje_Part_Description_Camera *cparent = (Edje_Part_Description_Camera *) parent;
+ {
+ Edje_Part_Description_Camera *ced = (Edje_Part_Description_Camera *)ed;
+ Edje_Part_Description_Camera *cparent = (Edje_Part_Description_Camera *)parent;
- ced->camera = cparent->camera;
+ ced->camera = cparent->camera;
- data_queue_copied_part_lookup(pc, &(cparent->camera.orientation.look_to), &(ced->camera.orientation.look_to));
+ data_queue_copied_part_lookup(pc, &(cparent->camera.orientation.look_to), &(ced->camera.orientation.look_to));
+
+ break;
+ }
- break;
- }
case EDJE_PART_TYPE_LIGHT:
- {
- Edje_Part_Description_Light *led = (Edje_Part_Description_Light *) ed;
- Edje_Part_Description_Light *lparent = (Edje_Part_Description_Light *) parent;
+ {
+ Edje_Part_Description_Light *led = (Edje_Part_Description_Light *)ed;
+ Edje_Part_Description_Light *lparent = (Edje_Part_Description_Light *)parent;
- led->light = lparent->light;
+ led->light = lparent->light;
- data_queue_copied_part_lookup(pc, &(lparent->light.orientation.look_to), &(led->light.orientation.look_to));
+ data_queue_copied_part_lookup(pc, &(lparent->light.orientation.look_to), &(led->light.orientation.look_to));
+
+ break;
+ }
- break;
- }
case EDJE_PART_TYPE_MESH_NODE:
- {
- Edje_Part_Description_Mesh_Node *med = (Edje_Part_Description_Mesh_Node *) ed;
- Edje_Part_Description_Mesh_Node *mparent = (Edje_Part_Description_Mesh_Node *) parent;
+ {
+ Edje_Part_Description_Mesh_Node *med = (Edje_Part_Description_Mesh_Node *)ed;
+ Edje_Part_Description_Mesh_Node *mparent = (Edje_Part_Description_Mesh_Node *)parent;
- med->mesh_node = mparent->mesh_node;
+ med->mesh_node = mparent->mesh_node;
- data_queue_model_remove(&med->mesh_node.mesh.id, &med->mesh_node.mesh.set);
- data_queue_copied_model_lookup(&mparent->mesh_node.mesh.id, &med->mesh_node.mesh.id, &med->mesh_node.mesh.set);
+ data_queue_model_remove(&med->mesh_node.mesh.id, &med->mesh_node.mesh.set);
+ data_queue_copied_model_lookup(&mparent->mesh_node.mesh.id, &med->mesh_node.mesh.id, &med->mesh_node.mesh.set);
- data_queue_image_remove(&med->mesh_node.texture.id, &med->mesh_node.texture.set);
- data_queue_copied_model_lookup(&mparent->mesh_node.texture.id, &med->mesh_node.texture.id, &med->mesh_node.texture.set);
+ data_queue_image_remove(&med->mesh_node.texture.id, &med->mesh_node.texture.set);
+ data_queue_copied_model_lookup(&mparent->mesh_node.texture.id, &med->mesh_node.texture.id, &med->mesh_node.texture.set);
- data_queue_copied_part_lookup(pc, &(mparent->mesh_node.orientation.look_to), &(med->mesh_node.orientation.look_to));
+ data_queue_copied_part_lookup(pc, &(mparent->mesh_node.orientation.look_to), &(med->mesh_node.orientation.look_to));
+
+ break;
+ }
- break;
- }
case EDJE_PART_TYPE_VECTOR:
- {
- Edje_Part_Description_Vector *ied = (Edje_Part_Description_Vector *) ed;
- Edje_Part_Description_Vector *iparent = (Edje_Part_Description_Vector *) parent;
- ied->vg.set = iparent->vg.set;
- ied->vg.id = iparent->vg.id;
- break;
- }
+ {
+ Edje_Part_Description_Vector *ied = (Edje_Part_Description_Vector *)ed;
+ Edje_Part_Description_Vector *iparent = (Edje_Part_Description_Vector *)parent;
+ ied->vg.set = iparent->vg.set;
+ ied->vg.id = iparent->vg.id;
+ break;
+ }
}
}
@@ -8768,7 +8963,7 @@ st_collections_group_parts_part_description_inherit(void)
Causes the part to use another part content as the content of this part.
Only work with PROXY part.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_source(void)
{
@@ -8787,7 +8982,7 @@ st_collections_group_parts_part_description_source(void)
exit(-1);
}
- ed = (Edje_Part_Description_Proxy*) current_desc;
+ ed = (Edje_Part_Description_Proxy *)current_desc;
name = parse_str(0);
@@ -8805,12 +9000,12 @@ _part_description_state_update(Edje_Part_Description_Common *ed)
(!ep->default_desc->state.name && !strcmp(ed->state.name, "default") && ed->state.value == ep->default_desc->state.value))
{
if (ep->type == EDJE_PART_TYPE_IMAGE)
- _edje_part_description_image_remove((Edje_Part_Description_Image*) ed);
+ _edje_part_description_image_remove((Edje_Part_Description_Image *)ed);
free(ed);
ep->other.desc_count--;
ep->other.desc = realloc(ep->other.desc,
- sizeof (Edje_Part_Description_Common*) * ep->other.desc_count);
+ sizeof (Edje_Part_Description_Common *) * ep->other.desc_count);
current_desc = ep->default_desc;
}
else if (ep->other.desc_count)
@@ -8821,12 +9016,12 @@ _part_description_state_update(Edje_Part_Description_Common *ed)
if (!strcmp(ed->state.name, ep->other.desc[i]->state.name) && ed->state.value == ep->other.desc[i]->state.value)
{
if (ep->type == EDJE_PART_TYPE_IMAGE)
- _edje_part_description_image_remove((Edje_Part_Description_Image*) ed);
+ _edje_part_description_image_remove((Edje_Part_Description_Image *)ed);
free(ed);
ep->other.desc_count--;
ep->other.desc = realloc(ep->other.desc,
- sizeof (Edje_Part_Description_Common*) * ep->other.desc_count);
+ sizeof (Edje_Part_Description_Common *) * ep->other.desc_count);
current_desc = ep->other.desc[i];
break;
}
@@ -8851,7 +9046,7 @@ _part_description_state_update(Edje_Part_Description_Common *ed)
Defaults: "default" 0.0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_state(void)
{
@@ -8865,7 +9060,7 @@ st_collections_group_parts_part_description_state(void)
ep = current_part;
s = parse_str(0);
- if (!strcmp (s, "custom"))
+ if (!strcmp(s, "custom"))
{
ERR("parse error %s:%i. invalid state name: '%s'.",
file_in, line - 1, s);
@@ -8905,7 +9100,7 @@ st_collections_group_parts_part_description_state(void)
Defaults: 1
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_visible(void)
{
@@ -8913,9 +9108,9 @@ st_collections_group_parts_part_description_visible(void)
if (current_part->type == EDJE_PART_TYPE_SPACER)
{
- ERR("parse error %s:%i. SPACER part can't have a visibility defined",
- file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. SPACER part can't have a visibility defined",
+ file_in, line - 1);
+ exit(-1);
}
current_desc->visible = parse_bool(0);
@@ -8928,9 +9123,9 @@ st_collections_group_parts_part_description_vis(void)
if (current_part->type == EDJE_PART_TYPE_SPACER)
{
- ERR("parse error %s:%i. SPACER part can't have a visibility defined",
- file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. SPACER part can't have a visibility defined",
+ file_in, line - 1);
+ exit(-1);
}
current_desc->visible = 1;
@@ -8943,9 +9138,9 @@ st_collections_group_parts_part_description_hid(void)
if (current_part->type == EDJE_PART_TYPE_SPACER)
{
- ERR("parse error %s:%i. SPACER part can't have a visibility defined",
- file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. SPACER part can't have a visibility defined",
+ file_in, line - 1);
+ exit(-1);
}
current_desc->visible = 0;
@@ -8963,15 +9158,15 @@ st_collections_group_parts_part_description_hid(void)
Defaults: 0
@since 1.19
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_no_render(void)
{
if (current_part->type == EDJE_PART_TYPE_SPACER)
{
- ERR("parse error %s:%i. SPACER part can't be marked as no_render",
- file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. SPACER part can't be marked as no_render",
+ file_in, line - 1);
+ exit(-1);
}
if (check_range_arg_count(0, 1) == 1)
@@ -8998,17 +9193,17 @@ st_collections_group_parts_part_description_no_render(void)
Defaults: NONE
@since 1.7
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_limit(void)
{
check_arg_count(1);
current_desc->limit = parse_enum(0,
- "NONE", 0,
- "WIDTH", 1,
- "HEIGHT", 2,
- "BOTH", 3);
+ "NONE", 0,
+ "WIDTH", 1,
+ "HEIGHT", 2,
+ "BOTH", 3);
if (current_desc->limit)
{
@@ -9017,11 +9212,11 @@ st_collections_group_parts_part_description_limit(void)
pc = eina_list_data_get(eina_list_last(edje_collections));
count = pc->limits.parts_count++;
- pc->limits.parts = realloc(pc->limits.parts,
- pc->limits.parts_count * sizeof (Edje_Part_Limit));
- data_queue_part_reallocated_lookup(pc, current_part->name,
- (unsigned char**) &(pc->limits.parts),
- (unsigned char*) &pc->limits.parts[count].part - (unsigned char*) pc->limits.parts); //fixme
+ pc->limits.parts = realloc(pc->limits.parts,
+ pc->limits.parts_count * sizeof (Edje_Part_Limit));
+ data_queue_part_reallocated_lookup(pc, current_part->name,
+ (unsigned char **)&(pc->limits.parts),
+ (unsigned char *)&pc->limits.parts[count].part - (unsigned char *)pc->limits.parts); //fixme
}
}
@@ -9042,7 +9237,7 @@ st_collections_group_parts_part_description_limit(void)
Defaults: 0.5 0.5 (0.5)
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_align(void)
{
@@ -9076,7 +9271,7 @@ st_collections_group_parts_part_description_align(void)
Defaults: 0 0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_fixed(void)
{
@@ -9102,32 +9297,35 @@ st_collections_group_parts_part_description_fixed(void)
Defaults: 0 0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_min(void)
{
check_min_arg_count(1);
- if (is_param(1)) {
- current_desc->min.w = parse_int_range(0, 0, 0x7fffffff);
- current_desc->min.h = parse_int_range(1, 0, 0x7fffffff);
- } else {
- char *tmp;
+ if (is_param(1))
+ {
+ current_desc->min.w = parse_int_range(0, 0, 0x7fffffff);
+ current_desc->min.h = parse_int_range(1, 0, 0x7fffffff);
+ }
+ else
+ {
+ char *tmp;
- tmp = parse_str(0);
- if ((current_part->type != EDJE_PART_TYPE_IMAGE && current_part->type != EDJE_PART_TYPE_GROUP) ||
- !tmp || strcmp(tmp, "SOURCE") != 0)
- {
- free(tmp);
- ERR("parse error %s:%i. "
- "Only IMAGE and GROUP part can have a min: SOURCE; defined",
- file_in, line - 1);
- exit(-1);
- }
- free(tmp);
+ tmp = parse_str(0);
+ if ((current_part->type != EDJE_PART_TYPE_IMAGE && current_part->type != EDJE_PART_TYPE_GROUP) ||
+ !tmp || strcmp(tmp, "SOURCE") != 0)
+ {
+ free(tmp);
+ ERR("parse error %s:%i. "
+ "Only IMAGE and GROUP part can have a min: SOURCE; defined",
+ file_in, line - 1);
+ exit(-1);
+ }
+ free(tmp);
- current_desc->min.limit = EINA_TRUE;
- }
+ current_desc->min.limit = EINA_TRUE;
+ }
}
/**
@@ -9143,7 +9341,7 @@ st_collections_group_parts_part_description_min(void)
Defaults: 1.0 1.0
@since 1.2
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_minmul(void)
{
@@ -9168,32 +9366,35 @@ st_collections_group_parts_part_description_minmul(void)
Defaults: -1 -1
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_max(void)
{
check_min_arg_count(1);
- if (is_param(1)) {
- current_desc->max.w = parse_int_range(0, -1, 0x7fffffff);
- current_desc->max.h = parse_int_range(1, -1, 0x7fffffff);
- } else {
- char *tmp;
+ if (is_param(1))
+ {
+ current_desc->max.w = parse_int_range(0, -1, 0x7fffffff);
+ current_desc->max.h = parse_int_range(1, -1, 0x7fffffff);
+ }
+ else
+ {
+ char *tmp;
- tmp = parse_str(0);
- if (current_part->type != EDJE_PART_TYPE_IMAGE ||
- !tmp || strcmp(tmp, "SOURCE") != 0)
- {
- free(tmp);
- ERR("parse error %s:%i. "
- "Only IMAGE part can have a max: SOURCE; defined",
- file_in, line - 1);
- exit(-1);
- }
- free(tmp);
+ tmp = parse_str(0);
+ if (current_part->type != EDJE_PART_TYPE_IMAGE ||
+ !tmp || strcmp(tmp, "SOURCE") != 0)
+ {
+ free(tmp);
+ ERR("parse error %s:%i. "
+ "Only IMAGE part can have a max: SOURCE; defined",
+ file_in, line - 1);
+ exit(-1);
+ }
+ free(tmp);
- current_desc->max.limit = EINA_TRUE;
- }
+ current_desc->max.limit = EINA_TRUE;
+ }
}
/**
@@ -9207,7 +9408,7 @@ st_collections_group_parts_part_description_max(void)
"min" and "max" property in description can be overridden by the size class
at runtime.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_size_class(void)
{
@@ -9229,7 +9430,7 @@ st_collections_group_parts_part_description_size_class(void)
Defaults: 0.0 0.0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_step(void)
{
@@ -9254,7 +9455,7 @@ st_collections_group_parts_part_description_step(void)
Defaults: 0.0 0.0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_aspect(void)
{
@@ -9276,19 +9477,19 @@ st_collections_group_parts_part_description_aspect(void)
Defaults: NONE
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_aspect_preference(void)
{
check_arg_count(1);
- current_desc->aspect.prefer = parse_enum(0,
- "NONE", EDJE_ASPECT_PREFER_NONE,
- "VERTICAL", EDJE_ASPECT_PREFER_VERTICAL,
- "HORIZONTAL", EDJE_ASPECT_PREFER_HORIZONTAL,
- "BOTH", EDJE_ASPECT_PREFER_BOTH,
- "SOURCE", EDJE_ASPECT_PREFER_SOURCE,
- NULL);
+ current_desc->aspect.prefer = parse_enum(0,
+ "NONE", EDJE_ASPECT_PREFER_NONE,
+ "VERTICAL", EDJE_ASPECT_PREFER_VERTICAL,
+ "HORIZONTAL", EDJE_ASPECT_PREFER_HORIZONTAL,
+ "BOTH", EDJE_ASPECT_PREFER_BOTH,
+ "SOURCE", EDJE_ASPECT_PREFER_SOURCE,
+ NULL);
}
/**
@@ -9302,7 +9503,7 @@ st_collections_group_parts_part_description_aspect_preference(void)
values can be modified by the "color", "color2" and "color3"
properties set below.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_color_class(void)
{
@@ -9310,9 +9511,9 @@ st_collections_group_parts_part_description_color_class(void)
if (current_part->type == EDJE_PART_TYPE_SPACER)
{
- ERR("parse error %s:%i. SPACER part can't have a color defined",
- file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. SPACER part can't have a color defined",
+ file_in, line - 1);
+ exit(-1);
}
current_desc->color_class = parse_str(0);
@@ -9340,15 +9541,15 @@ st_collections_group_parts_part_description_color_class(void)
Defaults: 255 255 255 255
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_color(void)
{
if (current_part->type == EDJE_PART_TYPE_SPACER)
{
- ERR("parse error %s:%i. SPACER part can't have a color defined",
- file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. SPACER part can't have a color defined",
+ file_in, line - 1);
+ exit(-1);
}
parse_color(0, &(current_desc->color.r));
@@ -9376,15 +9577,15 @@ st_collections_group_parts_part_description_color(void)
Defaults: 0 0 0 255
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_color2(void)
{
if (current_part->type == EDJE_PART_TYPE_SPACER)
{
- ERR("parse error %s:%i. SPACER part can't have a color defined",
- file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. SPACER part can't have a color defined",
+ file_in, line - 1);
+ exit(-1);
}
parse_color(0, &(current_desc->color2.r));
@@ -9412,7 +9613,7 @@ st_collections_group_parts_part_description_color2(void)
Defaults: 0 0 0 128
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_color3(void)
{
@@ -9429,7 +9630,7 @@ st_collections_group_parts_part_description_color3(void)
exit(-1);
}
- ed = (Edje_Part_Description_Text*)current_desc;
+ ed = (Edje_Part_Description_Text *)current_desc;
parse_color(0, &(ed->text.color3.r));
}
@@ -9447,7 +9648,7 @@ st_collections_group_parts_part_description_color3(void)
happen at the end of the animation, when the new state is finally set
(this is similar to the 'visible' flag).
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_clip_to_id(void)
{
@@ -9456,13 +9657,13 @@ st_collections_group_parts_part_description_clip_to_id(void)
check_arg_count(1);
pc = eina_list_data_get(eina_list_last(edje_collections));
- {
- char *name;
+ {
+ char *name;
- name = parse_str(0);
- data_queue_part_lookup(pc, name, &(current_desc->clip_to_id));
- free(name);
- }
+ name = parse_str(0);
+ data_queue_part_lookup(pc, name, &(current_desc->clip_to_id));
+ free(name);
+ }
}
/**
@@ -9481,7 +9682,7 @@ st_collections_group_parts_part_description_clip_to_id(void)
Defaults: 0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_offset_scale(void)
{
@@ -9536,7 +9737,7 @@ st_collections_group_parts_part_description_offset_scale(void)
@li rel1.relative: 0.0 0.0
@li rel2.relative: 1.0 1.0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_rel1_relative(void)
{
@@ -9560,7 +9761,7 @@ st_collections_group_parts_part_description_rel1_relative(void)
@li rel1.offset: 0 0
@li rel2.offset: -1 -1
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_rel1_offset(void)
{
@@ -9582,7 +9783,7 @@ st_collections_group_parts_part_description_rel1_offset(void)
container. Setting to "" will unset this value for inherited
parts.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_rel1_to_set(const char *name)
{
@@ -9632,7 +9833,7 @@ st_collections_group_parts_part_description_rel1_to(void)
part's container. Simply put affects the first parameter of "relative".
Setting to "" will unset this value for inherited parts.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_rel_to_x(void)
{
@@ -9683,7 +9884,7 @@ st_collections_group_parts_part_description_rel1_to_x(void)
part's container. Simply put, affects the second parameter of
"relative". Setting to "" will unset this value for inherited parts.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_rel_to_y(void)
{
@@ -9873,7 +10074,7 @@ st_collections_group_parts_part_description_rel2_to_y(void)
Moves an edge of the part to the position of the edge of given part or
whole edje group. (GROUP means edje group that the part belong to)
@endproperty
-*/
+ */
static void
check_has_anchors(void)
@@ -10084,7 +10285,7 @@ anchor_adjust_relative_horizontal(FLOAT_T *rel, FLOAT_T *relc, Edje_Part_Anchor_
The second parameter of position enumeration can be omitted. (Default
value is BOTTOM, but TOP when the part is anchored to edje group)
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_anchors_top(void)
{
@@ -10119,7 +10320,7 @@ st_collections_group_parts_part_description_anchors_top(void)
The second parameter of position enumeration can be omitted. (Default
value is TOP, but BOTTOM when the part is anchored to edje group)
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_anchors_bottom(void)
{
@@ -10154,7 +10355,7 @@ st_collections_group_parts_part_description_anchors_bottom(void)
The second parameter of position enumeration can be omitted. (Default
value is RIGHT, but LEFT when the part is anchored to edje group)
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_anchors_left(void)
{
@@ -10189,7 +10390,7 @@ st_collections_group_parts_part_description_anchors_left(void)
The second parameter of position enumeration can be omitted. (Default
value is LEFT, but RIGHT when the part is anchored to edje group)
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_anchors_right(void)
{
@@ -10226,7 +10427,7 @@ st_collections_group_parts_part_description_anchors_right(void)
The second parameter of position enumeration can be omitted. (Default
value is VERTICAL_CENTER)
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_anchors_vertical_center(void)
{
@@ -10258,7 +10459,7 @@ st_collections_group_parts_part_description_anchors_vertical_center(void)
The second parameter of position enumeration can be omitted. (Default
value is HORIZONTAL_CENTER)
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_anchors_horizontal_center(void)
{
@@ -10290,7 +10491,7 @@ st_collections_group_parts_part_description_anchors_horizontal_center(void)
The second parameter of direction enumeration can be omitted. (Default
value is BOTH)
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_anchors_fill(void)
{
@@ -10311,36 +10512,38 @@ st_collections_group_parts_part_description_anchors_fill(void)
switch (current_anchors->fill.base.fill)
{
case EDJE_PART_ANCHOR_FILL_BOTH:
- if (strcmp("GROUP", name) || param_had_quote(0))
- {
- data_queue_part_lookup(pc, name, &(current_desc->rel1.id_x));
- data_queue_part_lookup(pc, name, &(current_desc->rel2.id_x));
- data_queue_part_lookup(pc, name, &(current_desc->rel1.id_y));
- data_queue_part_lookup(pc, name, &(current_desc->rel2.id_y));
- }
- current_desc->align.x = 0.5;
- current_desc->align.y = 0.5;
- current_desc->fixed.w = 0;
- current_desc->fixed.h = 0;
- break;
+ if (strcmp("GROUP", name) || param_had_quote(0))
+ {
+ data_queue_part_lookup(pc, name, &(current_desc->rel1.id_x));
+ data_queue_part_lookup(pc, name, &(current_desc->rel2.id_x));
+ data_queue_part_lookup(pc, name, &(current_desc->rel1.id_y));
+ data_queue_part_lookup(pc, name, &(current_desc->rel2.id_y));
+ }
+ current_desc->align.x = 0.5;
+ current_desc->align.y = 0.5;
+ current_desc->fixed.w = 0;
+ current_desc->fixed.h = 0;
+ break;
+
case EDJE_PART_ANCHOR_FILL_HORIZONTAL:
- if (strcmp("GROUP", name) || param_had_quote(0))
- {
- data_queue_part_lookup(pc, name, &(current_desc->rel1.id_x));
- data_queue_part_lookup(pc, name, &(current_desc->rel2.id_x));
- }
- current_desc->align.x = 0.5;
- current_desc->fixed.w = 0;
- break;
+ if (strcmp("GROUP", name) || param_had_quote(0))
+ {
+ data_queue_part_lookup(pc, name, &(current_desc->rel1.id_x));
+ data_queue_part_lookup(pc, name, &(current_desc->rel2.id_x));
+ }
+ current_desc->align.x = 0.5;
+ current_desc->fixed.w = 0;
+ break;
+
case EDJE_PART_ANCHOR_FILL_VERTICAL:
- if (strcmp("GROUP", name) || param_had_quote(0))
- {
- data_queue_part_lookup(pc, name, &(current_desc->rel1.id_y));
- data_queue_part_lookup(pc, name, &(current_desc->rel2.id_y));
- }
- current_desc->align.y = 0.5;
- current_desc->fixed.h = 0;
- break;
+ if (strcmp("GROUP", name) || param_had_quote(0))
+ {
+ data_queue_part_lookup(pc, name, &(current_desc->rel1.id_y));
+ data_queue_part_lookup(pc, name, &(current_desc->rel2.id_y));
+ }
+ current_desc->align.y = 0.5;
+ current_desc->fixed.h = 0;
+ break;
}
free(name);
@@ -10356,7 +10559,7 @@ st_collections_group_parts_part_description_anchors_fill(void)
Affects the edge position a fixed number of pixels along each direction.
Margins will scale its size with an edje scaling factor.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_anchors_margin(void)
{
@@ -10414,7 +10617,7 @@ free_anchors(void)
In an animation, this is the first and last image displayed. It's
required in any image part
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_image_normal(void)
{
@@ -10435,7 +10638,7 @@ st_collections_group_parts_part_description_image_normal(void)
exit(-1);
}
- ed = (Edje_Part_Description_Image*) current_desc;
+ ed = (Edje_Part_Description_Image *)current_desc;
{
char *name;
@@ -10462,7 +10665,7 @@ st_collections_group_parts_part_description_image_normal(void)
the order they are listed, during the transition to the state they are
declared in; the "normal" image is the final state.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_image_tween(void)
{
@@ -10477,7 +10680,7 @@ st_collections_group_parts_part_description_image_tween(void)
exit(-1);
}
- ed = (Edje_Part_Description_Image*) current_desc;
+ ed = (Edje_Part_Description_Image *)current_desc;
{
char *name;
@@ -10486,7 +10689,7 @@ st_collections_group_parts_part_description_image_tween(void)
iid = mem_alloc(SZ(Edje_Part_Image_Id));
ed->image.tweens_count++;
ed->image.tweens = realloc(ed->image.tweens,
- sizeof (Edje_Part_Image_Id*) * ed->image.tweens_count);
+ sizeof (Edje_Part_Image_Id *) * ed->image.tweens_count);
ed->image.tweens[ed->image.tweens_count - 1] = iid;
name = parse_str(0);
data_queue_image_remove(&(iid->id), &(iid->set));
@@ -10508,7 +10711,7 @@ st_collections_group_parts_part_description_image_tween(void)
Defaults: 0 0 0 0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_image_border(void)
{
@@ -10523,7 +10726,7 @@ st_collections_group_parts_part_description_image_border(void)
exit(-1);
}
- ed = (Edje_Part_Description_Image*) current_desc;
+ ed = (Edje_Part_Description_Image *)current_desc;
ed->image.border.l = parse_int_range(0, 0, 0x7fffffff);
ed->image.border.r = parse_int_range(1, 0, 0x7fffffff);
@@ -10546,7 +10749,7 @@ st_collections_group_parts_part_description_image_border(void)
@li 1 or DEFAULT
@li SOLID
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_image_middle(void)
{
@@ -10561,15 +10764,15 @@ st_collections_group_parts_part_description_image_middle(void)
exit(-1);
}
- ed = (Edje_Part_Description_Image*) current_desc;
+ ed = (Edje_Part_Description_Image *)current_desc;
- ed->image.border.no_fill = parse_enum(0,
- "1", 0,
- "DEFAULT", 0,
- "0", 1,
- "NONE", 1,
- "SOLID", 2,
- NULL);
+ ed->image.border.no_fill = parse_enum(0,
+ "1", 0,
+ "DEFAULT", 0,
+ "0", 1,
+ "NONE", 1,
+ "SOLID", 2,
+ NULL);
}
/**
@@ -10592,7 +10795,7 @@ st_collections_group_parts_part_description_image_middle(void)
Defaults: 0.0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_image_border_scale_by(void)
{
@@ -10607,7 +10810,7 @@ st_collections_group_parts_part_description_image_border_scale_by(void)
exit(-1);
}
- ed = (Edje_Part_Description_Image*) current_desc;
+ ed = (Edje_Part_Description_Image *)current_desc;
ed->image.border.scale_by = FROM_DOUBLE(parse_float_range(0, 0.0, 999999999.0));
}
@@ -10624,7 +10827,7 @@ st_collections_group_parts_part_description_image_border_scale_by(void)
Defaults: 0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_image_border_scale(void)
{
@@ -10639,9 +10842,9 @@ st_collections_group_parts_part_description_image_border_scale(void)
exit(-1);
}
- ed = (Edje_Part_Description_Image*) current_desc;
+ ed = (Edje_Part_Description_Image *)current_desc;
- ed->image.border.scale = parse_bool(0);
+ ed->image.border.scale = parse_bool(0);
}
/**
@@ -10660,7 +10863,7 @@ st_collections_group_parts_part_description_image_border_scale(void)
Defaults: NONE
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_image_scale_hint(void)
{
@@ -10675,14 +10878,14 @@ st_collections_group_parts_part_description_image_scale_hint(void)
exit(-1);
}
- ed = (Edje_Part_Description_Image*) current_desc;
+ ed = (Edje_Part_Description_Image *)current_desc;
- ed->image.scale_hint = parse_enum(0,
- "NONE", EVAS_IMAGE_SCALE_HINT_NONE,
- "DYNAMIC", EVAS_IMAGE_SCALE_HINT_DYNAMIC,
- "STATIC", EVAS_IMAGE_SCALE_HINT_STATIC,
- "0", EVAS_IMAGE_SCALE_HINT_NONE,
- NULL);
+ ed->image.scale_hint = parse_enum(0,
+ "NONE", EVAS_IMAGE_SCALE_HINT_NONE,
+ "DYNAMIC", EVAS_IMAGE_SCALE_HINT_DYNAMIC,
+ "STATIC", EVAS_IMAGE_SCALE_HINT_STATIC,
+ "0", EVAS_IMAGE_SCALE_HINT_NONE,
+ NULL);
}
/** @edcsubsection{collections_group_parts_description_fill,
@@ -10724,7 +10927,7 @@ st_collections_group_parts_part_description_image_scale_hint(void)
Defaults: 1
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_fill_smooth(void)
{
@@ -10735,30 +10938,32 @@ st_collections_group_parts_part_description_fill_smooth(void)
switch (current_part->type)
{
case EDJE_PART_TYPE_IMAGE:
- {
- Edje_Part_Description_Image *ed;
+ {
+ Edje_Part_Description_Image *ed;
- ed = (Edje_Part_Description_Image*) current_desc;
+ ed = (Edje_Part_Description_Image *)current_desc;
+
+ fill = &ed->image.fill;
+ break;
+ }
- fill = &ed->image.fill;
- break;
- }
case EDJE_PART_TYPE_PROXY:
- {
- Edje_Part_Description_Proxy *ed;
+ {
+ Edje_Part_Description_Proxy *ed;
- ed = (Edje_Part_Description_Proxy*) current_desc;
+ ed = (Edje_Part_Description_Proxy *)current_desc;
+
+ fill = &ed->proxy.fill;
+ break;
+ }
- fill = &ed->proxy.fill;
- break;
- }
default:
- {
- ERR("parse error %s:%i. "
- "image and proxy attributes in non-IMAGE, non-PROXY `%s` part (%i).",
- file_in, line - 1, current_part->name, current_part->type);
- exit(-1);
- }
+ {
+ ERR("parse error %s:%i. "
+ "image and proxy attributes in non-IMAGE, non-PROXY `%s` part (%i).",
+ file_in, line - 1, current_part->name, current_part->type);
+ exit(-1);
+ }
}
fill->smooth = parse_bool(0);
@@ -10784,7 +10989,7 @@ st_collections_group_parts_part_description_fill_smooth(void)
Defaults: SCALE
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_fill_type(void)
{
@@ -10795,30 +11000,32 @@ st_collections_group_parts_part_description_fill_type(void)
switch (current_part->type)
{
case EDJE_PART_TYPE_IMAGE:
- {
- Edje_Part_Description_Image *ed;
+ {
+ Edje_Part_Description_Image *ed;
- ed = (Edje_Part_Description_Image*) current_desc;
+ ed = (Edje_Part_Description_Image *)current_desc;
+
+ fill = &ed->image.fill;
+ break;
+ }
- fill = &ed->image.fill;
- break;
- }
case EDJE_PART_TYPE_PROXY:
- {
- Edje_Part_Description_Proxy *ed;
+ {
+ Edje_Part_Description_Proxy *ed;
- ed = (Edje_Part_Description_Proxy*) current_desc;
+ ed = (Edje_Part_Description_Proxy *)current_desc;
+
+ fill = &ed->proxy.fill;
+ break;
+ }
- fill = &ed->proxy.fill;
- break;
- }
default:
- {
- ERR("parse error %s:%i. "
- "image and proxy attributes in non-IMAGE, non-PROXY part.",
- file_in, line - 1);
- exit(-1);
- }
+ {
+ ERR("parse error %s:%i. "
+ "image and proxy attributes in non-IMAGE, non-PROXY part.",
+ file_in, line - 1);
+ exit(-1);
+ }
}
fill->type = parse_enum(0,
@@ -10862,7 +11069,7 @@ st_collections_group_parts_part_description_fill_type(void)
Defaults: 0.0 0.0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_fill_origin_relative(void)
{
@@ -10873,30 +11080,32 @@ st_collections_group_parts_part_description_fill_origin_relative(void)
switch (current_part->type)
{
case EDJE_PART_TYPE_IMAGE:
- {
- Edje_Part_Description_Image *ed;
+ {
+ Edje_Part_Description_Image *ed;
- ed = (Edje_Part_Description_Image*) current_desc;
+ ed = (Edje_Part_Description_Image *)current_desc;
+
+ fill = &ed->image.fill;
+ break;
+ }
- fill = &ed->image.fill;
- break;
- }
case EDJE_PART_TYPE_PROXY:
- {
- Edje_Part_Description_Proxy *ed;
+ {
+ Edje_Part_Description_Proxy *ed;
- ed = (Edje_Part_Description_Proxy*) current_desc;
+ ed = (Edje_Part_Description_Proxy *)current_desc;
+
+ fill = &ed->proxy.fill;
+ break;
+ }
- fill = &ed->proxy.fill;
- break;
- }
default:
- {
- ERR("parse error %s:%i. "
- "image and proxy attributes in non-IMAGE, non-PROXY part.",
- file_in, line - 1);
- exit(-1);
- }
+ {
+ ERR("parse error %s:%i. "
+ "image and proxy attributes in non-IMAGE, non-PROXY part.",
+ file_in, line - 1);
+ exit(-1);
+ }
}
fill->pos_rel_x = FROM_DOUBLE(parse_float_range(0, -999999999.0, 999999999.0));
@@ -10914,7 +11123,7 @@ st_collections_group_parts_part_description_fill_origin_relative(void)
Defaults: 0 0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_fill_origin_offset(void)
{
@@ -10925,30 +11134,32 @@ st_collections_group_parts_part_description_fill_origin_offset(void)
switch (current_part->type)
{
case EDJE_PART_TYPE_IMAGE:
- {
- Edje_Part_Description_Image *ed;
+ {
+ Edje_Part_Description_Image *ed;
- ed = (Edje_Part_Description_Image*) current_desc;
+ ed = (Edje_Part_Description_Image *)current_desc;
+
+ fill = &ed->image.fill;
+ break;
+ }
- fill = &ed->image.fill;
- break;
- }
case EDJE_PART_TYPE_PROXY:
- {
- Edje_Part_Description_Proxy *ed;
+ {
+ Edje_Part_Description_Proxy *ed;
- ed = (Edje_Part_Description_Proxy*) current_desc;
+ ed = (Edje_Part_Description_Proxy *)current_desc;
+
+ fill = &ed->proxy.fill;
+ break;
+ }
- fill = &ed->proxy.fill;
- break;
- }
default:
- {
- ERR("parse error %s:%i. "
- "image and proxy attributes in non-IMAGE, non-PROXY part.",
- file_in, line - 1);
- exit(-1);
- }
+ {
+ ERR("parse error %s:%i. "
+ "image and proxy attributes in non-IMAGE, non-PROXY part.",
+ file_in, line - 1);
+ exit(-1);
+ }
}
fill->pos_abs_x = parse_int(0);
@@ -10991,7 +11202,7 @@ st_collections_group_parts_part_description_fill_origin_offset(void)
Defaults: 1.0 1.0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_fill_size_relative(void)
{
@@ -11002,30 +11213,32 @@ st_collections_group_parts_part_description_fill_size_relative(void)
switch (current_part->type)
{
case EDJE_PART_TYPE_IMAGE:
- {
- Edje_Part_Description_Image *ed;
+ {
+ Edje_Part_Description_Image *ed;
- ed = (Edje_Part_Description_Image*) current_desc;
+ ed = (Edje_Part_Description_Image *)current_desc;
+
+ fill = &ed->image.fill;
+ break;
+ }
- fill = &ed->image.fill;
- break;
- }
case EDJE_PART_TYPE_PROXY:
- {
- Edje_Part_Description_Proxy *ed;
+ {
+ Edje_Part_Description_Proxy *ed;
- ed = (Edje_Part_Description_Proxy*) current_desc;
+ ed = (Edje_Part_Description_Proxy *)current_desc;
+
+ fill = &ed->proxy.fill;
+ break;
+ }
- fill = &ed->proxy.fill;
- break;
- }
default:
- {
- ERR("parse error %s:%i. "
- "image and proxy attributes in non-IMAGE, non-PROXY part.",
- file_in, line - 1);
- exit(-1);
- }
+ {
+ ERR("parse error %s:%i. "
+ "image and proxy attributes in non-IMAGE, non-PROXY part.",
+ file_in, line - 1);
+ exit(-1);
+ }
}
fill->rel_x = FROM_DOUBLE(parse_float_range(0, 0.0, 999999999.0));
@@ -11043,7 +11256,7 @@ st_collections_group_parts_part_description_fill_size_relative(void)
Defaults: 0 0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_fill_size_offset(void)
{
@@ -11054,37 +11267,38 @@ st_collections_group_parts_part_description_fill_size_offset(void)
switch (current_part->type)
{
case EDJE_PART_TYPE_IMAGE:
- {
- Edje_Part_Description_Image *ed;
+ {
+ Edje_Part_Description_Image *ed;
- ed = (Edje_Part_Description_Image*) current_desc;
+ ed = (Edje_Part_Description_Image *)current_desc;
+
+ fill = &ed->image.fill;
+ break;
+ }
- fill = &ed->image.fill;
- break;
- }
case EDJE_PART_TYPE_PROXY:
- {
- Edje_Part_Description_Proxy *ed;
+ {
+ Edje_Part_Description_Proxy *ed;
- ed = (Edje_Part_Description_Proxy*) current_desc;
+ ed = (Edje_Part_Description_Proxy *)current_desc;
+
+ fill = &ed->proxy.fill;
+ break;
+ }
- fill = &ed->proxy.fill;
- break;
- }
default:
- {
- ERR("parse error %s:%i. "
- "image and proxy attributes in non-IMAGE, non-PROXY part.",
- file_in, line - 1);
- exit(-1);
- }
+ {
+ ERR("parse error %s:%i. "
+ "image and proxy attributes in non-IMAGE, non-PROXY part.",
+ file_in, line - 1);
+ exit(-1);
+ }
}
fill->abs_x = parse_int(0);
fill->abs_y = parse_int(1);
}
-
/** @edcsubsection{collections_group_parts_description_text,
* Group.Parts.Part.Description.Text} */
@@ -11126,7 +11340,7 @@ st_collections_group_parts_part_description_fill_size_offset(void)
Sets the default content of a text part, normally the application is
the one changing its value.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_text_text(void)
{
@@ -11142,21 +11356,21 @@ st_collections_group_parts_part_description_text_text(void)
exit(-1);
}
- ed = (Edje_Part_Description_Text*) current_desc;
+ ed = (Edje_Part_Description_Text *)current_desc;
- for (i = 0; ;i++)
+ for (i = 0;; i++)
{
- char *s;
+ char *s;
- if (!is_param(i)) break;
- s = parse_str(i);
- if (!str) str = s;
- else
- {
- str = realloc(str, strlen(str) + strlen(s) + 1);
- strcat(str, s);
- free(s);
- }
+ if (!is_param(i)) break;
+ s = parse_str(i);
+ if (!str) str = s;
+ else
+ {
+ str = realloc(str, strlen(str) + strlen(s) + 1);
+ strcat(str, s);
+ free(s);
+ }
}
ed->text.text.str = str;
}
@@ -11172,7 +11386,7 @@ st_collections_group_parts_part_description_text_text(void)
This is the domain name of the .mo file which has to be checked
for translation.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_text_domain(void)
{
@@ -11182,11 +11396,11 @@ st_collections_group_parts_part_description_text_domain(void)
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
ERR("parse error %s:%i. text attributes in non-TEXT part.",
- file_in, line - 1);
+ file_in, line - 1);
exit(-1);
}
- ed = (Edje_Part_Description_Text*) current_desc;
+ ed = (Edje_Part_Description_Text *)current_desc;
ed->text.domain = parse_str(0);
}
@@ -11202,7 +11416,7 @@ st_collections_group_parts_part_description_text_domain(void)
Similar to color_class, this is the name used by the application
to alter the font family and size at runtime.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_text_text_class(void)
{
@@ -11218,7 +11432,7 @@ st_collections_group_parts_part_description_text_text_class(void)
exit(-1);
}
- ed = (Edje_Part_Description_Text*) current_desc;
+ ed = (Edje_Part_Description_Text *)current_desc;
ed->text.text_class = parse_str(0);
}
@@ -11234,7 +11448,7 @@ st_collections_group_parts_part_description_text_text_class(void)
This sets the font family to one of the aliases set up in the "fonts"
block. Can be overridden by the application.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_text_font(void)
{
@@ -11250,7 +11464,7 @@ st_collections_group_parts_part_description_text_font(void)
exit(-1);
}
- ed = (Edje_Part_Description_Text*) current_desc;
+ ed = (Edje_Part_Description_Text *)current_desc;
ed->text.font.str = parse_str(0);
}
@@ -11266,7 +11480,7 @@ st_collections_group_parts_part_description_text_font(void)
Causes the part to use the default style and tags defined in the
"style" block with the specified name.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_text_style(void)
{
@@ -11282,7 +11496,7 @@ st_collections_group_parts_part_description_text_style(void)
exit(-1);
}
- ed = (Edje_Part_Description_Text*) current_desc;
+ ed = (Edje_Part_Description_Text *)current_desc;
ed->text.style.str = parse_str(0);
}
@@ -11299,7 +11513,7 @@ st_collections_group_parts_part_description_text_style(void)
to replace every character to hide the details of the entry. Normally
you would use a "*", but you can use anything you like.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_text_repch(void)
{
@@ -11315,7 +11529,7 @@ st_collections_group_parts_part_description_text_repch(void)
exit(-1);
}
- ed = (Edje_Part_Description_Text*) current_desc;
+ ed = (Edje_Part_Description_Text *)current_desc;
ed->text.repch.str = parse_str(0);
}
@@ -11333,7 +11547,7 @@ st_collections_group_parts_part_description_text_repch(void)
Defaults: 0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_text_size(void)
{
@@ -11349,7 +11563,7 @@ st_collections_group_parts_part_description_text_size(void)
exit(-1);
}
- ed = (Edje_Part_Description_Text*)current_desc;
+ ed = (Edje_Part_Description_Text *)current_desc;
ed->text.size = parse_int_range(0, 0, 255);
}
@@ -11368,7 +11582,7 @@ st_collections_group_parts_part_description_text_size(void)
Defaults: 0 0
@since 1.1
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_text_size_range(void)
{
@@ -11384,7 +11598,7 @@ st_collections_group_parts_part_description_text_size_range(void)
exit(-1);
}
- ed = (Edje_Part_Description_Text*) current_desc;
+ ed = (Edje_Part_Description_Text *)current_desc;
ed->text.size_range_min = parse_int_range(0, 0, 255);
ed->text.size_range_max = parse_int_range(1, 0, 255);
@@ -11409,7 +11623,7 @@ st_collections_group_parts_part_description_text_size_range(void)
Defaults: 0 0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_text_fit(void)
{
@@ -11425,7 +11639,7 @@ st_collections_group_parts_part_description_text_fit(void)
exit(-1);
}
- ed = (Edje_Part_Description_Text*) current_desc;
+ ed = (Edje_Part_Description_Text *)current_desc;
ed->text.fit_x = parse_bool(0);
ed->text.fit_y = parse_bool(1);
@@ -11444,7 +11658,7 @@ st_collections_group_parts_part_description_text_fit(void)
Defaults: 0 0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_text_min(void)
{
@@ -11460,7 +11674,7 @@ st_collections_group_parts_part_description_text_min(void)
exit(-1);
}
- ed = (Edje_Part_Description_Text*)current_desc;
+ ed = (Edje_Part_Description_Text *)current_desc;
ed->text.min_x = parse_bool(0);
ed->text.min_y = parse_bool(1);
@@ -11482,7 +11696,7 @@ st_collections_group_parts_part_description_text_min(void)
Defaults: 0 0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_text_max(void)
{
@@ -11498,7 +11712,7 @@ st_collections_group_parts_part_description_text_max(void)
exit(-1);
}
- ed = (Edje_Part_Description_Text*) current_desc;
+ ed = (Edje_Part_Description_Text *)current_desc;
ed->text.max_x = parse_bool(0);
ed->text.max_y = parse_bool(1);
@@ -11521,7 +11735,7 @@ st_collections_group_parts_part_description_text_max(void)
Defaults: 0.5 0.5
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_text_align(void)
{
@@ -11537,7 +11751,7 @@ st_collections_group_parts_part_description_text_align(void)
exit(-1);
}
- ed = (Edje_Part_Description_Text*) current_desc;
+ ed = (Edje_Part_Description_Text *)current_desc;
ed->text.align.x = FROM_DOUBLE(parse_float_range(0, -1.0, 1.0));
ed->text.align.y = FROM_DOUBLE(parse_float_range(1, 0.0, 1.0));
@@ -11554,7 +11768,7 @@ st_collections_group_parts_part_description_text_align(void)
Causes the part to use the text properties (like font and size) of
another part and update them as they change.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_text_source(void)
{
@@ -11573,7 +11787,7 @@ st_collections_group_parts_part_description_text_source(void)
exit(-1);
}
- ed = (Edje_Part_Description_Text*) current_desc;
+ ed = (Edje_Part_Description_Text *)current_desc;
{
char *name;
@@ -11595,7 +11809,7 @@ st_collections_group_parts_part_description_text_source(void)
Causes the part to display the text content of another part and update
them as they change.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_text_text_source(void)
{
@@ -11614,7 +11828,7 @@ st_collections_group_parts_part_description_text_text_source(void)
exit(-1);
}
- ed = (Edje_Part_Description_Text*) current_desc;
+ ed = (Edje_Part_Description_Text *)current_desc;
{
char *name;
@@ -11640,7 +11854,7 @@ st_collections_group_parts_part_description_text_text_source(void)
Defaults: 0.0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_text_ellipsis(void)
{
@@ -11656,7 +11870,7 @@ st_collections_group_parts_part_description_text_ellipsis(void)
exit(-1);
}
- ed = (Edje_Part_Description_Text*) current_desc;
+ ed = (Edje_Part_Description_Text *)current_desc;
ed->text.ellipsis = parse_float_range(0, -1.0, 1.0);
}
@@ -11710,8 +11924,9 @@ st_collections_group_parts_part_description_text_ellipsis(void)
Defaults: "horizontal"
@endproperty
-*/
-static void st_collections_group_parts_part_description_box_layout(void)
+ */
+static void
+st_collections_group_parts_part_description_box_layout(void)
{
Edje_Part_Description_Box *ed;
@@ -11724,7 +11939,7 @@ static void st_collections_group_parts_part_description_box_layout(void)
exit(-1);
}
- ed = (Edje_Part_Description_Box*) current_desc;
+ ed = (Edje_Part_Description_Box *)current_desc;
ed->box.layout = parse_str(0);
if (is_param(1))
@@ -11742,8 +11957,9 @@ static void st_collections_group_parts_part_description_box_layout(void)
Defaults: 0.5 0.5
@endproperty
-*/
-static void st_collections_group_parts_part_description_box_align(void)
+ */
+static void
+st_collections_group_parts_part_description_box_align(void)
{
Edje_Part_Description_Box *ed;
@@ -11756,7 +11972,7 @@ static void st_collections_group_parts_part_description_box_align(void)
exit(-1);
}
- ed = (Edje_Part_Description_Box*) current_desc;
+ ed = (Edje_Part_Description_Box *)current_desc;
ed->box.align.x = FROM_DOUBLE(parse_float_range(0, -1.0, 1.0));
ed->box.align.y = FROM_DOUBLE(parse_float_range(1, -1.0, 1.0));
@@ -11773,8 +11989,9 @@ static void st_collections_group_parts_part_description_box_align(void)
Defaults: 0 0
@endproperty
-*/
-static void st_collections_group_parts_part_description_box_padding(void)
+ */
+static void
+st_collections_group_parts_part_description_box_padding(void)
{
Edje_Part_Description_Box *ed;
@@ -11787,7 +12004,7 @@ static void st_collections_group_parts_part_description_box_padding(void)
exit(-1);
}
- ed = (Edje_Part_Description_Box*) current_desc;
+ ed = (Edje_Part_Description_Box *)current_desc;
ed->box.padding.x = parse_int_range(0, 0, 0x7fffffff);
ed->box.padding.y = parse_int_range(1, 0, 0x7fffffff);
@@ -11805,7 +12022,7 @@ static void st_collections_group_parts_part_description_box_padding(void)
Defaults: 0 0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_box_min(void)
{
@@ -11820,13 +12037,12 @@ st_collections_group_parts_part_description_box_min(void)
exit(-1);
}
- ed = (Edje_Part_Description_Box*) current_desc;
+ ed = (Edje_Part_Description_Box *)current_desc;
ed->box.min.h = parse_bool(0);
ed->box.min.v = parse_bool(1);
}
-
/** @edcsubsection{collections_group_parts_description_table,
* Group.Parts.Part.Description.Table} */
@@ -11866,8 +12082,9 @@ st_collections_group_parts_part_description_box_min(void)
Defaults: NONE
@endproperty
-*/
-static void st_collections_group_parts_part_description_table_homogeneous(void)
+ */
+static void
+st_collections_group_parts_part_description_table_homogeneous(void)
{
Edje_Part_Description_Table *ed;
@@ -11880,13 +12097,13 @@ static void st_collections_group_parts_part_description_table_homogeneous(void)
exit(-1);
}
- ed = (Edje_Part_Description_Table*) current_desc;
+ ed = (Edje_Part_Description_Table *)current_desc;
ed->table.homogeneous = parse_enum(0,
- "NONE", EDJE_OBJECT_TABLE_HOMOGENEOUS_NONE,
- "TABLE", EDJE_OBJECT_TABLE_HOMOGENEOUS_TABLE,
- "ITEM", EDJE_OBJECT_TABLE_HOMOGENEOUS_ITEM,
- NULL);
+ "NONE", EDJE_OBJECT_TABLE_HOMOGENEOUS_NONE,
+ "TABLE", EDJE_OBJECT_TABLE_HOMOGENEOUS_TABLE,
+ "ITEM", EDJE_OBJECT_TABLE_HOMOGENEOUS_ITEM,
+ NULL);
}
/**
@@ -11900,8 +12117,9 @@ static void st_collections_group_parts_part_description_table_homogeneous(void)
Defaults: 0.5 0.5
@endproperty
-*/
-static void st_collections_group_parts_part_description_table_align(void)
+ */
+static void
+st_collections_group_parts_part_description_table_align(void)
{
Edje_Part_Description_Table *ed;
@@ -11914,7 +12132,7 @@ static void st_collections_group_parts_part_description_table_align(void)
exit(-1);
}
- ed = (Edje_Part_Description_Table*) current_desc;
+ ed = (Edje_Part_Description_Table *)current_desc;
ed->table.align.x = FROM_DOUBLE(parse_float_range(0, -1.0, 1.0));
ed->table.align.y = FROM_DOUBLE(parse_float_range(1, -1.0, 1.0));
@@ -11931,8 +12149,9 @@ static void st_collections_group_parts_part_description_table_align(void)
Defaults: 0 0
@endproperty
-*/
-static void st_collections_group_parts_part_description_table_padding(void)
+ */
+static void
+st_collections_group_parts_part_description_table_padding(void)
{
Edje_Part_Description_Table *ed;
@@ -11945,7 +12164,7 @@ static void st_collections_group_parts_part_description_table_padding(void)
exit(-1);
}
- ed = (Edje_Part_Description_Table*) current_desc;
+ ed = (Edje_Part_Description_Table *)current_desc;
ed->table.padding.x = parse_int_range(0, 0, 0x7fffffff);
ed->table.padding.y = parse_int_range(1, 0, 0x7fffffff);
@@ -11963,7 +12182,7 @@ static void st_collections_group_parts_part_description_table_padding(void)
Defaults: 0 0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_table_min(void)
{
@@ -11978,7 +12197,7 @@ st_collections_group_parts_part_description_table_min(void)
exit(-1);
}
- ed = (Edje_Part_Description_Table*) current_desc;
+ ed = (Edje_Part_Description_Table *)current_desc;
ed->table.min.h = parse_bool(0);
ed->table.min.v = parse_bool(1);
@@ -12033,7 +12252,7 @@ st_collections_group_parts_part_description_table_min(void)
Defaults: 1
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_proxy_source_clip(void)
{
@@ -12048,7 +12267,7 @@ st_collections_group_parts_part_description_proxy_source_clip(void)
exit(-1);
}
- ed = (Edje_Part_Description_Proxy*) current_desc;
+ ed = (Edje_Part_Description_Proxy *)current_desc;
ed->proxy.source_clip = parse_bool(0);
}
@@ -12066,7 +12285,7 @@ st_collections_group_parts_part_description_proxy_source_visible(void)
exit(-1);
}
- ed = (Edje_Part_Description_Proxy*) current_desc;
+ ed = (Edje_Part_Description_Proxy *)current_desc;
ed->proxy.source_visible = parse_bool(0);
}
@@ -12103,7 +12322,7 @@ st_collections_group_parts_part_description_proxy_source_visible(void)
@effect
Sets the point of CAMERA, LIGHT or MESH_NODE centre.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_position_point(void)
{
@@ -12112,44 +12331,47 @@ st_collections_group_parts_part_description_position_point(void)
switch (current_part->type)
{
case EDJE_PART_TYPE_CAMERA:
- {
- Edje_Part_Description_Camera *ed;
+ {
+ Edje_Part_Description_Camera *ed;
- ed = (Edje_Part_Description_Camera*) current_desc;
+ ed = (Edje_Part_Description_Camera *)current_desc;
+
+ ed->camera.position.point.x = FROM_DOUBLE(parse_float(0));
+ ed->camera.position.point.y = FROM_DOUBLE(parse_float(1));
+ ed->camera.position.point.z = FROM_DOUBLE(parse_float(2));
+ break;
+ }
- ed->camera.position.point.x = FROM_DOUBLE(parse_float(0));
- ed->camera.position.point.y = FROM_DOUBLE(parse_float(1));
- ed->camera.position.point.z = FROM_DOUBLE(parse_float(2));
- break;
- }
case EDJE_PART_TYPE_LIGHT:
- {
- Edje_Part_Description_Light *ed;
+ {
+ Edje_Part_Description_Light *ed;
- ed = (Edje_Part_Description_Light*) current_desc;
+ ed = (Edje_Part_Description_Light *)current_desc;
+
+ ed->light.position.point.x = FROM_DOUBLE(parse_float(0));
+ ed->light.position.point.y = FROM_DOUBLE(parse_float(1));
+ ed->light.position.point.z = FROM_DOUBLE(parse_float(2));
+ break;
+ }
- ed->light.position.point.x = FROM_DOUBLE(parse_float(0));
- ed->light.position.point.y = FROM_DOUBLE(parse_float(1));
- ed->light.position.point.z = FROM_DOUBLE(parse_float(2));
- break;
- }
case EDJE_PART_TYPE_MESH_NODE:
- {
- Edje_Part_Description_Mesh_Node *ed;
+ {
+ Edje_Part_Description_Mesh_Node *ed;
- ed = (Edje_Part_Description_Mesh_Node*) current_desc;
+ ed = (Edje_Part_Description_Mesh_Node *)current_desc;
+
+ ed->mesh_node.position.point.x = FROM_DOUBLE(parse_float(0));
+ ed->mesh_node.position.point.y = FROM_DOUBLE(parse_float(1));
+ ed->mesh_node.position.point.z = FROM_DOUBLE(parse_float(2));
+ break;
+ }
- ed->mesh_node.position.point.x = FROM_DOUBLE(parse_float(0));
- ed->mesh_node.position.point.y = FROM_DOUBLE(parse_float(1));
- ed->mesh_node.position.point.z = FROM_DOUBLE(parse_float(2));
- break;
- }
default:
- {
- ERR("parse error %s:%i. camera and light attributes in non-CAMERA, non-LIGHT, and non-MESH_NODE part.",
- file_in, line - 1);
- exit(-1);
- }
+ {
+ ERR("parse error %s:%i. camera and light attributes in non-CAMERA, non-LIGHT, and non-MESH_NODE part.",
+ file_in, line - 1);
+ exit(-1);
+ }
}
}
@@ -12167,7 +12389,7 @@ st_collections_group_parts_part_description_position_point(void)
@li PARENT
@li WORLD
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_position_space(void)
{
@@ -12176,46 +12398,49 @@ st_collections_group_parts_part_description_position_space(void)
check_arg_count(1);
space = parse_enum(0,
- "LOCAL", EVAS_CANVAS3D_SPACE_LOCAL,
- "PARENT", EVAS_CANVAS3D_SPACE_PARENT,
- "WORLD", EVAS_CANVAS3D_SPACE_WORLD,
- NULL);
+ "LOCAL", EVAS_CANVAS3D_SPACE_LOCAL,
+ "PARENT", EVAS_CANVAS3D_SPACE_PARENT,
+ "WORLD", EVAS_CANVAS3D_SPACE_WORLD,
+ NULL);
switch (current_part->type)
{
case EDJE_PART_TYPE_CAMERA:
- {
- Edje_Part_Description_Camera *ed;
+ {
+ Edje_Part_Description_Camera *ed;
- ed = (Edje_Part_Description_Camera*) current_desc;
+ ed = (Edje_Part_Description_Camera *)current_desc;
+
+ ed->camera.position.space = space;
+ break;
+ }
- ed->camera.position.space = space;
- break;
- }
case EDJE_PART_TYPE_LIGHT:
- {
- Edje_Part_Description_Light *ed;
+ {
+ Edje_Part_Description_Light *ed;
- ed = (Edje_Part_Description_Light*) current_desc;
+ ed = (Edje_Part_Description_Light *)current_desc;
+
+ ed->light.position.space = space;
+ break;
+ }
- ed->light.position.space = space;
- break;
- }
case EDJE_PART_TYPE_MESH_NODE:
- {
- Edje_Part_Description_Mesh_Node *ed;
+ {
+ Edje_Part_Description_Mesh_Node *ed;
- ed = (Edje_Part_Description_Mesh_Node*) current_desc;
+ ed = (Edje_Part_Description_Mesh_Node *)current_desc;
+
+ ed->mesh_node.position.space = space;
+ break;
+ }
- ed->mesh_node.position.space = space;
- break;
- }
default:
- {
- ERR("parse error %s:%i. camera and light attributes in non-CAMERA, non-LIGHT, and non-MESH_NODE part.",
- file_in, line - 1);
- exit(-1);
- }
+ {
+ ERR("parse error %s:%i. camera and light attributes in non-CAMERA, non-LIGHT, and non-MESH_NODE part.",
+ file_in, line - 1);
+ exit(-1);
+ }
}
}
@@ -12249,7 +12474,7 @@ st_collections_group_parts_part_description_position_space(void)
@effect
Specifies the basic attributes of the camera.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_camera_properties(void)
{
@@ -12259,7 +12484,7 @@ st_collections_group_parts_part_description_camera_properties(void)
{
Edje_Part_Description_Camera *ed;
- ed = (Edje_Part_Description_Camera*) current_desc;
+ ed = (Edje_Part_Description_Camera *)current_desc;
ed->camera.camera.fovy = FROM_DOUBLE(parse_float(0));
ed->camera.camera.aspect = FROM_DOUBLE(parse_float(1));
@@ -12270,7 +12495,7 @@ st_collections_group_parts_part_description_camera_properties(void)
{
Edje_Part_Description_Light *ed;
- ed = (Edje_Part_Description_Light*) current_desc;
+ ed = (Edje_Part_Description_Light *)current_desc;
ed->light.light.fovy = FROM_DOUBLE(parse_float(0));
ed->light.light.aspect = FROM_DOUBLE(parse_float(1));
@@ -12333,7 +12558,7 @@ st_collections_group_parts_part_description_camera_properties(void)
Defaults: 50 50 50 255
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_properties_ambient(void)
{
@@ -12342,29 +12567,31 @@ st_collections_group_parts_part_description_properties_ambient(void)
switch (current_part->type)
{
case EDJE_PART_TYPE_LIGHT:
- {
- Edje_Part_Description_Light *ed;
+ {
+ Edje_Part_Description_Light *ed;
- ed = (Edje_Part_Description_Light*) current_desc;
+ ed = (Edje_Part_Description_Light *)current_desc;
+
+ parse_color(0, &(ed->light.properties.ambient));
+ break;
+ }
- parse_color(0, &(ed->light.properties.ambient));
- break;
- }
case EDJE_PART_TYPE_MESH_NODE:
- {
- Edje_Part_Description_Mesh_Node *ed;
+ {
+ Edje_Part_Description_Mesh_Node *ed;
- ed = (Edje_Part_Description_Mesh_Node*) current_desc;
+ ed = (Edje_Part_Description_Mesh_Node *)current_desc;
+
+ parse_color(0, &(ed->mesh_node.properties.ambient));
+ break;
+ }
- parse_color(0, &(ed->mesh_node.properties.ambient));
- break;
- }
default:
- {
- ERR("parse error %s:%i. light and mesh_node attributes in non-LIGHT and non-MESH_NODE part.",
- file_in, line - 1);
- exit(-1);
- }
+ {
+ ERR("parse error %s:%i. light and mesh_node attributes in non-LIGHT and non-MESH_NODE part.",
+ file_in, line - 1);
+ exit(-1);
+ }
}
}
@@ -12388,7 +12615,7 @@ st_collections_group_parts_part_description_properties_ambient(void)
Defaults: 255 255 255 255
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_properties_diffuse(void)
{
@@ -12397,29 +12624,31 @@ st_collections_group_parts_part_description_properties_diffuse(void)
switch (current_part->type)
{
case EDJE_PART_TYPE_LIGHT:
- {
- Edje_Part_Description_Light *ed;
+ {
+ Edje_Part_Description_Light *ed;
- ed = (Edje_Part_Description_Light*) current_desc;
+ ed = (Edje_Part_Description_Light *)current_desc;
+
+ parse_color(0, &(ed->light.properties.diffuse));
+ break;
+ }
- parse_color(0, &(ed->light.properties.diffuse));
- break;
- }
case EDJE_PART_TYPE_MESH_NODE:
- {
- Edje_Part_Description_Mesh_Node *ed;
+ {
+ Edje_Part_Description_Mesh_Node *ed;
- ed = (Edje_Part_Description_Mesh_Node*) current_desc;
+ ed = (Edje_Part_Description_Mesh_Node *)current_desc;
+
+ parse_color(0, &(ed->mesh_node.properties.diffuse));
+ break;
+ }
- parse_color(0, &(ed->mesh_node.properties.diffuse));
- break;
- }
default:
- {
- ERR("parse error %s:%i. light and mesh_node attributes in non-LIGHT and non-MESH_NODE part.",
- file_in, line - 1);
- exit(-1);
- }
+ {
+ ERR("parse error %s:%i. light and mesh_node attributes in non-LIGHT and non-MESH_NODE part.",
+ file_in, line - 1);
+ exit(-1);
+ }
}
}
@@ -12443,7 +12672,7 @@ st_collections_group_parts_part_description_properties_diffuse(void)
Defaults: 255 255 255 255
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_properties_specular(void)
{
@@ -12452,29 +12681,31 @@ st_collections_group_parts_part_description_properties_specular(void)
switch (current_part->type)
{
case EDJE_PART_TYPE_LIGHT:
- {
- Edje_Part_Description_Light *ed;
+ {
+ Edje_Part_Description_Light *ed;
- ed = (Edje_Part_Description_Light*) current_desc;
+ ed = (Edje_Part_Description_Light *)current_desc;
+
+ parse_color(0, &(ed->light.properties.specular));
+ break;
+ }
- parse_color(0, &(ed->light.properties.specular));
- break;
- }
case EDJE_PART_TYPE_MESH_NODE:
- {
- Edje_Part_Description_Mesh_Node *ed;
+ {
+ Edje_Part_Description_Mesh_Node *ed;
- ed = (Edje_Part_Description_Mesh_Node*) current_desc;
+ ed = (Edje_Part_Description_Mesh_Node *)current_desc;
+
+ parse_color(0, &(ed->mesh_node.properties.specular));
+ break;
+ }
- parse_color(0, &(ed->mesh_node.properties.specular));
- break;
- }
default:
- {
- ERR("parse error %s:%i. light and mesh_node attributes in non-LIGHT and non-MESH_NODE part.",
- file_in, line - 1);
- exit(-1);
- }
+ {
+ ERR("parse error %s:%i. light and mesh_node attributes in non-LIGHT and non-MESH_NODE part.",
+ file_in, line - 1);
+ exit(-1);
+ }
}
}
@@ -12492,7 +12723,7 @@ st_collections_group_parts_part_description_properties_specular(void)
@li EMISSION
@li NORMAL
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_properties_material(void)
{
@@ -12501,18 +12732,18 @@ st_collections_group_parts_part_description_properties_material(void)
check_arg_count(1);
material_attrib = parse_enum(0,
- "AMBIENT", EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT,
- "DIFFUSE", EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE,
- "SPECULAR", EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR,
- "EMISSION", EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION,
- "NORMAL", EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL,
- NULL);
+ "AMBIENT", EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT,
+ "DIFFUSE", EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE,
+ "SPECULAR", EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR,
+ "EMISSION", EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION,
+ "NORMAL", EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL,
+ NULL);
if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
{
Edje_Part_Description_Mesh_Node *ed;
- ed = (Edje_Part_Description_Mesh_Node*) current_desc;
+ ed = (Edje_Part_Description_Mesh_Node *)current_desc;
ed->mesh_node.properties.material_attrib = material_attrib;
}
@@ -12533,7 +12764,7 @@ st_collections_group_parts_part_description_properties_material(void)
@effect
Sets the material attribute enable flag of the given material.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_properties_normal(void)
{
@@ -12543,7 +12774,7 @@ st_collections_group_parts_part_description_properties_normal(void)
{
Edje_Part_Description_Mesh_Node *ed;
- ed = (Edje_Part_Description_Mesh_Node*) current_desc;
+ ed = (Edje_Part_Description_Mesh_Node *)current_desc;
ed->mesh_node.properties.normal = parse_bool(0);
}
@@ -12564,7 +12795,7 @@ st_collections_group_parts_part_description_properties_normal(void)
@effect
Sets the shininess of the given material.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_properties_shininess(void)
{
@@ -12574,7 +12805,7 @@ st_collections_group_parts_part_description_properties_shininess(void)
{
Edje_Part_Description_Mesh_Node *ed;
- ed = (Edje_Part_Description_Mesh_Node*) current_desc;
+ ed = (Edje_Part_Description_Mesh_Node *)current_desc;
ed->mesh_node.properties.shininess = FROM_DOUBLE(parse_float(0));
}
@@ -12601,7 +12832,7 @@ st_collections_group_parts_part_description_properties_shininess(void)
@li MAP
@li RENDER
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_properties_shade(void)
@@ -12611,19 +12842,19 @@ st_collections_group_parts_part_description_properties_shade(void)
check_arg_count(1);
shade = parse_enum(0,
- "VERTEX_COLOR", EVAS_CANVAS3D_SHADER_MODE_VERTEX_COLOR,
- "PARENT", EVAS_CANVAS3D_SHADER_MODE_DIFFUSE,
- "WORLD", EVAS_CANVAS3D_SHADER_MODE_FLAT,
- "PHONG", EVAS_CANVAS3D_SHADER_MODE_PHONG,
- "NORMAL_MAP", EVAS_CANVAS3D_SHADER_MODE_NORMAL_MAP,
- "RENDER", EVAS_CANVAS3D_SHADER_MODE_SHADOW_MAP_RENDER,
- NULL);
+ "VERTEX_COLOR", EVAS_CANVAS3D_SHADER_MODE_VERTEX_COLOR,
+ "PARENT", EVAS_CANVAS3D_SHADER_MODE_DIFFUSE,
+ "WORLD", EVAS_CANVAS3D_SHADER_MODE_FLAT,
+ "PHONG", EVAS_CANVAS3D_SHADER_MODE_PHONG,
+ "NORMAL_MAP", EVAS_CANVAS3D_SHADER_MODE_NORMAL_MAP,
+ "RENDER", EVAS_CANVAS3D_SHADER_MODE_SHADOW_MAP_RENDER,
+ NULL);
if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
{
Edje_Part_Description_Mesh_Node *ed;
- ed = (Edje_Part_Description_Mesh_Node*) current_desc;
+ ed = (Edje_Part_Description_Mesh_Node *)current_desc;
ed->mesh_node.properties.shade = shade;
}
@@ -12671,7 +12902,7 @@ st_collections_group_parts_part_description_properties_shade(void)
Indicates a target point for CAMERA and MESH_NODE or for LIGHT to see or
to illuminate.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_orientation_look1(void)
{
@@ -12680,26 +12911,29 @@ st_collections_group_parts_part_description_orientation_look1(void)
switch (current_part->type)
{
case EDJE_PART_TYPE_CAMERA:
- {
- SET_LOOK1(Camera, camera);
- break;
- }
+ {
+ SET_LOOK1(Camera, camera);
+ break;
+ }
+
case EDJE_PART_TYPE_LIGHT:
- {
- SET_LOOK1(Light, light);
- break;
- }
+ {
+ SET_LOOK1(Light, light);
+ break;
+ }
+
case EDJE_PART_TYPE_MESH_NODE:
- {
- SET_LOOK1(Mesh_Node, mesh_node);
- break;
- }
+ {
+ SET_LOOK1(Mesh_Node, mesh_node);
+ break;
+ }
+
default:
- {
- ERR("parse error %s:%i. camera, light and mesh_node attributes in non-CAMERA, non-LIGHT and non-MESH_NODE part.",
- file_in, line - 1);
- exit(-1);
- }
+ {
+ ERR("parse error %s:%i. camera, light and mesh_node attributes in non-CAMERA, non-LIGHT and non-MESH_NODE part.",
+ file_in, line - 1);
+ exit(-1);
+ }
}
}
@@ -12712,7 +12946,7 @@ st_collections_group_parts_part_description_orientation_look1(void)
@effect
Specifies the angle at which the target point will be caught.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_orientation_look2(void)
{
@@ -12721,26 +12955,29 @@ st_collections_group_parts_part_description_orientation_look2(void)
switch (current_part->type)
{
case EDJE_PART_TYPE_CAMERA:
- {
- SET_LOOK2(Camera, camera);
- break;
- }
+ {
+ SET_LOOK2(Camera, camera);
+ break;
+ }
+
case EDJE_PART_TYPE_LIGHT:
- {
- SET_LOOK2(Light, light);
- break;
- }
+ {
+ SET_LOOK2(Light, light);
+ break;
+ }
+
case EDJE_PART_TYPE_MESH_NODE:
- {
- SET_LOOK2(Mesh_Node, mesh_node);
- break;
- }
+ {
+ SET_LOOK2(Mesh_Node, mesh_node);
+ break;
+ }
+
default:
- {
- ERR("parse error %s:%i. camera, light and mesh_node attributes in non-CAMERA, non-LIGHT and non-MESH_NODE part.",
- file_in, line - 1);
- exit(-1);
- }
+ {
+ ERR("parse error %s:%i. camera, light and mesh_node attributes in non-CAMERA, non-LIGHT and non-MESH_NODE part.",
+ file_in, line - 1);
+ exit(-1);
+ }
}
}
@@ -12754,7 +12991,7 @@ st_collections_group_parts_part_description_orientation_look2(void)
Indicates another part to make target of CAMERA, LIGHT or MESH_NODE
or LIGHT.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_orientation_look_to(void)
{
@@ -12767,26 +13004,29 @@ st_collections_group_parts_part_description_orientation_look_to(void)
switch (current_part->type)
{
case EDJE_PART_TYPE_CAMERA:
- {
- SET_LOOK_TO(pc, Camera, camera);
- break;
- }
+ {
+ SET_LOOK_TO(pc, Camera, camera);
+ break;
+ }
+
case EDJE_PART_TYPE_LIGHT:
- {
- SET_LOOK_TO(pc, Light, light);
- break;
- }
+ {
+ SET_LOOK_TO(pc, Light, light);
+ break;
+ }
+
case EDJE_PART_TYPE_MESH_NODE:
- {
- SET_LOOK_TO(pc, Mesh_Node, mesh_node);
- break;
- }
+ {
+ SET_LOOK_TO(pc, Mesh_Node, mesh_node);
+ break;
+ }
+
default:
- {
- ERR("parse error %s:%i. camera, light and mesh_node attributes in non-CAMERA, non-LIGHT and non-MESH_NODE part.",
- file_in, line - 1);
- exit(-1);
- }
+ {
+ ERR("parse error %s:%i. camera, light and mesh_node attributes in non-CAMERA, non-LIGHT and non-MESH_NODE part.",
+ file_in, line - 1);
+ exit(-1);
+ }
}
}
@@ -12799,7 +13039,7 @@ st_collections_group_parts_part_description_orientation_look_to(void)
@effect
Specifies the angle and indicates what proportions the MESH_NODE rotates in.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_orientation_angle_axis(void)
{
@@ -12825,7 +13065,6 @@ st_collections_group_parts_part_description_orientation_angle_axis(void)
}
}
-
/**
@page edcref
@property
@@ -12835,7 +13074,7 @@ st_collections_group_parts_part_description_orientation_angle_axis(void)
@effect
Specifies the axis and arccosinus of half angle to rotate on the MESH_NODE, CAMERA or LIGHT.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_orientation_quaternion(void)
{
@@ -12870,7 +13109,7 @@ st_collections_group_parts_part_description_orientation_quaternion(void)
@effect
Specifies the scale parameter for MESH_NODE.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_scale(void)
{
@@ -12878,7 +13117,7 @@ st_collections_group_parts_part_description_scale(void)
{
Edje_Part_Description_Mesh_Node *ed;
- ed = (Edje_Part_Description_Mesh_Node*) current_desc;
+ ed = (Edje_Part_Description_Mesh_Node *)current_desc;
ed->mesh_node.scale_3d.x = FROM_DOUBLE(parse_float_range(0, 0.0, 1000.0));
ed->mesh_node.scale_3d.y = FROM_DOUBLE(parse_float_range(1, 0.0, 1000.0));
@@ -12920,17 +13159,16 @@ st_collections_group_parts_part_description_scale(void)
A texture block is used to set texture, this texture will be imposed on
MESH_NODE model.
@endblock
-*/
+ */
static void
ob_collections_group_parts_part_description_texture(void)
{
Edje_Part_Description_Mesh_Node *ed;
-
if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
{
- ed = (Edje_Part_Description_Mesh_Node*) current_desc;
+ ed = (Edje_Part_Description_Mesh_Node *)current_desc;
ed->mesh_node.texture.need_texture = EINA_TRUE;
}
@@ -12943,25 +13181,25 @@ ob_collections_group_parts_part_description_texture(void)
}
}
- /**
- @page edcref
- @property
- shade
- image
- @parameters
- [SHADE]
- [texture's filename]
- @effect
- Sets the shade mode for MESH_NODE. Valid shade modes:
- @li COLOR
- @li DIFFUSE
- @li FLAT
- @li PHONG
- @li MAP
- @li RENDER
- Name of image to be used as previously declared in the image block.
- It's required in any mesh_node part.
- @endproperty
+/**
+ @page edcref
+ @property
+ shade
+ image
+ @parameters
+ [SHADE]
+ [texture's filename]
+ @effect
+ Sets the shade mode for MESH_NODE. Valid shade modes:
+ @li COLOR
+ @li DIFFUSE
+ @li FLAT
+ @li PHONG
+ @li MAP
+ @li RENDER
+ Name of image to be used as previously declared in the image block.
+ It's required in any mesh_node part.
+ @endproperty
*/
static void
st_collections_group_parts_part_description_texture_image(void)
@@ -12973,7 +13211,7 @@ st_collections_group_parts_part_description_texture_image(void)
if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
{
char *name;
- ed = (Edje_Part_Description_Mesh_Node*) current_desc;
+ ed = (Edje_Part_Description_Mesh_Node *)current_desc;
ed->mesh_node.texture.textured = EINA_TRUE;
@@ -13003,7 +13241,7 @@ st_collections_group_parts_part_description_texture_image(void)
@li REPEAT
@li REFLECT
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_texture_wrap1(void)
{
@@ -13012,16 +13250,16 @@ st_collections_group_parts_part_description_texture_wrap1(void)
check_arg_count(1);
wrap1 = parse_enum(0,
- "CLAMP", EVAS_CANVAS3D_WRAP_MODE_CLAMP,
- "REPEAT", EVAS_CANVAS3D_WRAP_MODE_REPEAT,
- "REFLECT", EVAS_CANVAS3D_WRAP_MODE_REFLECT,
- NULL);
+ "CLAMP", EVAS_CANVAS3D_WRAP_MODE_CLAMP,
+ "REPEAT", EVAS_CANVAS3D_WRAP_MODE_REPEAT,
+ "REFLECT", EVAS_CANVAS3D_WRAP_MODE_REFLECT,
+ NULL);
if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
{
Edje_Part_Description_Mesh_Node *ed;
- ed = (Edje_Part_Description_Mesh_Node*) current_desc;
+ ed = (Edje_Part_Description_Mesh_Node *)current_desc;
ed->mesh_node.texture.wrap1 = wrap1;
}
@@ -13045,7 +13283,7 @@ st_collections_group_parts_part_description_texture_wrap1(void)
@li REPEAT
@li REFLECT
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_texture_wrap2(void)
{
@@ -13054,16 +13292,16 @@ st_collections_group_parts_part_description_texture_wrap2(void)
check_arg_count(1);
wrap2 = parse_enum(0,
- "CLAMP", EVAS_CANVAS3D_WRAP_MODE_CLAMP,
- "REPEAT", EVAS_CANVAS3D_WRAP_MODE_REPEAT,
- "REFLECT", EVAS_CANVAS3D_WRAP_MODE_REFLECT,
- NULL);
+ "CLAMP", EVAS_CANVAS3D_WRAP_MODE_CLAMP,
+ "REPEAT", EVAS_CANVAS3D_WRAP_MODE_REPEAT,
+ "REFLECT", EVAS_CANVAS3D_WRAP_MODE_REFLECT,
+ NULL);
if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
{
Edje_Part_Description_Mesh_Node *ed;
- ed = (Edje_Part_Description_Mesh_Node*) current_desc;
+ ed = (Edje_Part_Description_Mesh_Node *)current_desc;
ed->mesh_node.texture.wrap2 = wrap2;
}
@@ -13089,7 +13327,7 @@ st_collections_group_parts_part_description_texture_wrap2(void)
@li LINEAR_MIPMAP_NEAREST
@li NEAREST_MIPMAP_LINEAR
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_texture_filter1(void)
{
@@ -13098,19 +13336,19 @@ st_collections_group_parts_part_description_texture_filter1(void)
check_arg_count(1);
filter1 = parse_enum(0,
- "NEAREST", EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST,
- "LINEAR", EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR,
- "NEAREST_NEAREST", EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST,
- "LINEAR_NEAREST", EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST,
- "NEAREST_LINEAR", EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR,
- "LINEAR_LINEAR", EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR,
- NULL);
+ "NEAREST", EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST,
+ "LINEAR", EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR,
+ "NEAREST_NEAREST", EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST,
+ "LINEAR_NEAREST", EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST,
+ "NEAREST_LINEAR", EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR,
+ "LINEAR_LINEAR", EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR,
+ NULL);
if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
{
Edje_Part_Description_Mesh_Node *ed;
- ed = (Edje_Part_Description_Mesh_Node*) current_desc;
+ ed = (Edje_Part_Description_Mesh_Node *)current_desc;
ed->mesh_node.texture.filter1 = filter1;
}
@@ -13136,7 +13374,7 @@ st_collections_group_parts_part_description_texture_filter1(void)
@li LINEAR_MIPMAP_NEAREST
@li NEAREST_MIPMAP_LINEAR
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_texture_filter2(void)
{
@@ -13145,19 +13383,19 @@ st_collections_group_parts_part_description_texture_filter2(void)
check_arg_count(1);
filter2 = parse_enum(0,
- "NEAREST", EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST,
- "LINEAR", EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR,
- "NEAREST_NEAREST", EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST,
- "LINEAR_NEAREST", EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST,
- "NEAREST_LINEAR", EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR,
- "LINEAR_LINEAR", EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR,
- NULL);
+ "NEAREST", EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST,
+ "LINEAR", EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR,
+ "NEAREST_NEAREST", EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST,
+ "LINEAR_NEAREST", EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST,
+ "NEAREST_LINEAR", EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR,
+ "LINEAR_LINEAR", EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR,
+ NULL);
if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
{
Edje_Part_Description_Mesh_Node *ed;
- ed = (Edje_Part_Description_Mesh_Node*) current_desc;
+ ed = (Edje_Part_Description_Mesh_Node *)current_desc;
ed->mesh_node.texture.filter2 = filter2;
}
@@ -13204,7 +13442,7 @@ st_collections_group_parts_part_description_texture_filter2(void)
@li CUBE
@li SPHERE
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_mesh_primitive(void)
{
@@ -13213,16 +13451,16 @@ st_collections_group_parts_part_description_mesh_primitive(void)
check_arg_count(1);
primitive = parse_enum(0,
- "NONE", EVAS_CANVAS3D_MESH_PRIMITIVE_NONE,
- "CUBE", EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE,
- "SPHERE", EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE,
- NULL);
+ "NONE", EVAS_CANVAS3D_MESH_PRIMITIVE_NONE,
+ "CUBE", EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE,
+ "SPHERE", EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE,
+ NULL);
if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
{
Edje_Part_Description_Mesh_Node *ed;
- ed = (Edje_Part_Description_Mesh_Node*) current_desc;
+ ed = (Edje_Part_Description_Mesh_Node *)current_desc;
ed->mesh_node.mesh.primitive = primitive;
}
@@ -13250,7 +13488,7 @@ st_collections_group_parts_part_description_mesh_primitive(void)
@li TRIANGLE_STRIP
@li TRIANGLE_FAN
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_mesh_assembly(void)
{
@@ -13259,20 +13497,20 @@ st_collections_group_parts_part_description_mesh_assembly(void)
check_arg_count(1);
assembly = parse_enum(0,
- "POINTS", EVAS_CANVAS3D_VERTEX_ASSEMBLY_POINTS,
- "LINES", EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINES,
- "LINE_STRIP", EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINE_STRIP,
- "LINE_LOOP", EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINE_LOOP,
- "TRIANGLES", EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES,
- "TRIANGLE_STRIP", EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLE_STRIP,
- "TRIANGLE_FAN", EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLE_FAN,
- NULL);
+ "POINTS", EVAS_CANVAS3D_VERTEX_ASSEMBLY_POINTS,
+ "LINES", EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINES,
+ "LINE_STRIP", EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINE_STRIP,
+ "LINE_LOOP", EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINE_LOOP,
+ "TRIANGLES", EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES,
+ "TRIANGLE_STRIP", EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLE_STRIP,
+ "TRIANGLE_FAN", EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLE_FAN,
+ NULL);
if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
{
Edje_Part_Description_Mesh_Node *ed;
- ed = (Edje_Part_Description_Mesh_Node*) current_desc;
+ ed = (Edje_Part_Description_Mesh_Node *)current_desc;
ed->mesh_node.mesh.assembly = assembly;
}
@@ -13294,7 +13532,7 @@ st_collections_group_parts_part_description_mesh_assembly(void)
Name of model to be used as previously declared in the model block.
It's required in any mesh_node part.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_mesh_geometry(void)
{
@@ -13305,7 +13543,7 @@ st_collections_group_parts_part_description_mesh_geometry(void)
if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
{
char *name;
- ed = (Edje_Part_Description_Mesh_Node*) current_desc;
+ ed = (Edje_Part_Description_Mesh_Node *)current_desc;
name = parse_str(0);
if (!ecore_file_exists(name))
@@ -13332,12 +13570,11 @@ st_collections_group_parts_part_description_mesh_frame(void)
{
check_arg_count(1);
-
if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
{
Edje_Part_Description_Mesh_Node *ed;
- ed = (Edje_Part_Description_Mesh_Node*) current_desc;
+ ed = (Edje_Part_Description_Mesh_Node *)current_desc;
ed->mesh_node.mesh.frame = parse_int(0);
}
@@ -13398,7 +13635,7 @@ st_collections_group_parts_part_description_mesh_frame(void)
so it will be immovable, static.
@since 1.8
@endproperty
-*/
+ */
#ifdef HAVE_EPHYSICS
static void
@@ -13408,6 +13645,7 @@ st_collections_group_parts_part_description_physics_mass(void)
current_desc->physics.mass = parse_float(0);
}
+
#endif
/**
@@ -13428,7 +13666,7 @@ st_collections_group_parts_part_description_physics_mass(void)
@since 1.8
@endproperty
-*/
+ */
#ifdef HAVE_EPHYSICS
static void
@@ -13438,6 +13676,7 @@ st_collections_group_parts_part_description_physics_restitution(void)
current_desc->physics.restitution = parse_float(0);
}
+
#endif
/**
@@ -13458,7 +13697,7 @@ st_collections_group_parts_part_description_physics_restitution(void)
@since 1.8
@endproperty
-*/
+ */
#ifdef HAVE_EPHYSICS
static void
@@ -13468,6 +13707,7 @@ st_collections_group_parts_part_description_physics_friction(void)
current_desc->physics.friction = parse_float(0);
}
+
#endif
/**
@@ -13484,7 +13724,7 @@ st_collections_group_parts_part_description_physics_friction(void)
Default is 1 (enabled).
@since 1.8
@endproperty
-*/
+ */
#ifdef HAVE_EPHYSICS
static void
st_collections_group_parts_part_description_physics_ignore_part_pos(void)
@@ -13493,6 +13733,7 @@ st_collections_group_parts_part_description_physics_ignore_part_pos(void)
current_desc->physics.ignore_part_pos = parse_bool(0);
}
+
#endif
/**
@@ -13510,7 +13751,7 @@ st_collections_group_parts_part_description_physics_ignore_part_pos(void)
Values should be between 0.0 and 1.0, and are set to 0 by default.
@since 1.8
@endproperty
-*/
+ */
#ifdef HAVE_EPHYSICS
static void
st_collections_group_parts_part_description_physics_damping(void)
@@ -13520,6 +13761,7 @@ st_collections_group_parts_part_description_physics_damping(void)
current_desc->physics.damping.linear = parse_float_range(0, 0, 1.0);
current_desc->physics.damping.angular = parse_float_range(1, 0, 1.0);
}
+
#endif
/**
@@ -13542,7 +13784,7 @@ st_collections_group_parts_part_description_physics_damping(void)
57.29 degrees / sec (1 rad/sec).
@since 1.8
@endproperty
-*/
+ */
#ifdef HAVE_EPHYSICS
static void
st_collections_group_parts_part_description_physics_sleep(void)
@@ -13552,6 +13794,7 @@ st_collections_group_parts_part_description_physics_sleep(void)
current_desc->physics.sleep.linear = parse_float(0);
current_desc->physics.sleep.angular = parse_float(1);
}
+
#endif
/**
@@ -13578,7 +13821,7 @@ st_collections_group_parts_part_description_physics_sleep(void)
@since 1.8
@endproperty
-*/
+ */
#ifdef HAVE_EPHYSICS
static void
st_collections_group_parts_part_description_physics_material(void)
@@ -13586,15 +13829,16 @@ st_collections_group_parts_part_description_physics_material(void)
check_arg_count(1);
current_desc->physics.material = parse_enum(0,
- "CUSTOM", EPHYSICS_BODY_MATERIAL_CUSTOM,
- "CONCRETE", EPHYSICS_BODY_MATERIAL_CONCRETE,
- "IRON", EPHYSICS_BODY_MATERIAL_IRON,
- "PLASTIC", EPHYSICS_BODY_MATERIAL_PLASTIC,
- "POLYSTYRENE", EPHYSICS_BODY_MATERIAL_POLYSTYRENE,
- "RUBBER", EPHYSICS_BODY_MATERIAL_RUBBER,
- "WOOD", EPHYSICS_BODY_MATERIAL_WOOD,
- NULL);
+ "CUSTOM", EPHYSICS_BODY_MATERIAL_CUSTOM,
+ "CONCRETE", EPHYSICS_BODY_MATERIAL_CONCRETE,
+ "IRON", EPHYSICS_BODY_MATERIAL_IRON,
+ "PLASTIC", EPHYSICS_BODY_MATERIAL_PLASTIC,
+ "POLYSTYRENE", EPHYSICS_BODY_MATERIAL_POLYSTYRENE,
+ "RUBBER", EPHYSICS_BODY_MATERIAL_RUBBER,
+ "WOOD", EPHYSICS_BODY_MATERIAL_WOOD,
+ NULL);
}
+
#endif
/**
@@ -13609,7 +13853,7 @@ st_collections_group_parts_part_description_physics_material(void)
When a mass is explicitely set the density will be unset.
@since 1.8
@endproperty
-*/
+ */
#ifdef HAVE_EPHYSICS
static void
st_collections_group_parts_part_description_physics_density(void)
@@ -13618,6 +13862,7 @@ st_collections_group_parts_part_description_physics_density(void)
current_desc->physics.density = parse_float(0);
}
+
#endif
/**
@@ -13635,7 +13880,7 @@ st_collections_group_parts_part_description_physics_density(void)
Valid values vary from 0.0 to 1.0. Only works on soft bodies and cloths.
@since 1.8
@endproperty
-*/
+ */
#ifdef HAVE_EPHYSICS
static void
st_collections_group_parts_part_description_physics_hardness(void)
@@ -13644,6 +13889,7 @@ st_collections_group_parts_part_description_physics_hardness(void)
current_desc->physics.hardness = parse_float_range(0, 0, 1.0);
}
+
#endif
/**
@@ -13658,7 +13904,7 @@ st_collections_group_parts_part_description_physics_hardness(void)
Disabled by default (0).
@since 1.8
@endproperty
-*/
+ */
#ifdef HAVE_EPHYSICS
static void
st_collections_group_parts_part_description_physics_light_on(void)
@@ -13667,6 +13913,7 @@ st_collections_group_parts_part_description_physics_light_on(void)
current_desc->physics.light_on = parse_bool(0);
}
+
#endif
/**
@@ -13679,7 +13926,7 @@ st_collections_group_parts_part_description_physics_light_on(void)
Defines body position in z axis. It's set to -15 by default.
@since 1.8
@endproperty
-*/
+ */
#ifdef HAVE_EPHYSICS
static void
st_collections_group_parts_part_description_physics_z(void)
@@ -13688,6 +13935,7 @@ st_collections_group_parts_part_description_physics_z(void)
current_desc->physics.z = parse_int(0);
}
+
#endif
/**
@@ -13700,7 +13948,7 @@ st_collections_group_parts_part_description_physics_z(void)
Defines body's depth (z axis). It's set to 30 by default.
@since 1.8
@endproperty
-*/
+ */
#ifdef HAVE_EPHYSICS
static void
st_collections_group_parts_part_description_physics_depth(void)
@@ -13709,6 +13957,7 @@ st_collections_group_parts_part_description_physics_depth(void)
current_desc->physics.depth = parse_int(0);
}
+
#endif
/**
@@ -13723,7 +13972,7 @@ st_collections_group_parts_part_description_physics_depth(void)
This means that the object will be hidden when "backface culled".
@since 1.8
@endproperty
-*/
+ */
#ifdef HAVE_EPHYSICS
static void
st_collections_group_parts_part_description_physics_backface_cull(void)
@@ -13732,6 +13981,7 @@ st_collections_group_parts_part_description_physics_backface_cull(void)
current_desc->physics.backcull = parse_bool(0);
}
+
#endif
/** @edcsubsection{collections_group_parts_description_physics_movement_freedom,
@@ -13767,7 +14017,7 @@ st_collections_group_parts_part_description_physics_backface_cull(void)
Axes x and y are enabled by default.
@since 1.8
@endproperty
-*/
+ */
#ifdef HAVE_EPHYSICS
static void
st_collections_group_parts_part_description_physics_movement_freedom_linear(void)
@@ -13778,6 +14028,7 @@ st_collections_group_parts_part_description_physics_movement_freedom_linear(void
current_desc->physics.mov_freedom.lin.y = parse_bool(1);
current_desc->physics.mov_freedom.lin.z = parse_bool(2);
}
+
#endif
/**
@@ -13792,7 +14043,7 @@ st_collections_group_parts_part_description_physics_movement_freedom_linear(void
Z axis is enabled by default.
@since 1.8
@endproperty
-*/
+ */
#ifdef HAVE_EPHYSICS
static void
st_collections_group_parts_part_description_physics_movement_freedom_angular(void)
@@ -13803,6 +14054,7 @@ st_collections_group_parts_part_description_physics_movement_freedom_angular(voi
current_desc->physics.mov_freedom.ang.y = parse_bool(1);
current_desc->physics.mov_freedom.ang.z = parse_bool(2);
}
+
#endif
/** @edcsubsection{collections_group_parts_description_physics_faces,
@@ -13832,7 +14084,7 @@ st_collections_group_parts_part_description_physics_movement_freedom_angular(voi
Only the "faces" block declared in the "default" description
will be considered.
@endblock
-*/
+ */
#ifdef HAVE_EPHYSICS
static void
st_collections_group_parts_part_description_physics_face(void)
@@ -13845,6 +14097,7 @@ st_collections_group_parts_part_description_physics_face(void)
pface->type = 0;
pface->source = NULL;
}
+
#endif
/**
@@ -13874,7 +14127,7 @@ st_collections_group_parts_part_description_physics_face(void)
@li SPHERE_FRONT
@li SPHERE_BACK
@endproperty
-*/
+ */
#ifdef HAVE_EPHYSICS
static void
st_collections_group_parts_part_description_physics_face_type(void)
@@ -13884,35 +14137,36 @@ st_collections_group_parts_part_description_physics_face_type(void)
pface = eina_list_data_get(eina_list_last(current_desc->physics.faces));
pface->type = parse_enum(0,
- "BOX_MIDDLE_FRONT", EPHYSICS_BODY_BOX_FACE_MIDDLE_FRONT,
- "BOX_MIDDLE_BACK", EPHYSICS_BODY_BOX_FACE_MIDDLE_BACK,
- "BOX_FRONT", EPHYSICS_BODY_BOX_FACE_FRONT,
- "BOX_BACK", EPHYSICS_BODY_BOX_FACE_BACK,
- "BOX_LEFT", EPHYSICS_BODY_BOX_FACE_LEFT,
- "BOX_RIGHT", EPHYSICS_BODY_BOX_FACE_RIGHT,
- "BOX_TOP", EPHYSICS_BODY_BOX_FACE_TOP,
- "BOX_BOTTOM", EPHYSICS_BODY_BOX_FACE_BOTTOM,
- "CLOTH_FRONT", EPHYSICS_BODY_CLOTH_FACE_FRONT,
- "CLOTH_BACK", EPHYSICS_BODY_CLOTH_FACE_BACK,
- "CYLINDER_MIDDLE_FRONT", EPHYSICS_BODY_CYLINDER_FACE_MIDDLE_FRONT,
- "CYLINDER_MIDDLE_BACK", EPHYSICS_BODY_CYLINDER_FACE_MIDDLE_BACK,
- "CYLINDER_FRONT", EPHYSICS_BODY_CYLINDER_FACE_FRONT,
- "CYLINDER_BACK", EPHYSICS_BODY_CYLINDER_FACE_BACK,
- "CYLINDER_CURVED", EPHYSICS_BODY_CYLINDER_FACE_CURVED,
- "SPHERE_FRONT", EPHYSICS_BODY_SPHERE_FACE_FRONT,
- "SPHERE_BACK", EPHYSICS_BODY_SPHERE_FACE_BACK,
- NULL);
+ "BOX_MIDDLE_FRONT", EPHYSICS_BODY_BOX_FACE_MIDDLE_FRONT,
+ "BOX_MIDDLE_BACK", EPHYSICS_BODY_BOX_FACE_MIDDLE_BACK,
+ "BOX_FRONT", EPHYSICS_BODY_BOX_FACE_FRONT,
+ "BOX_BACK", EPHYSICS_BODY_BOX_FACE_BACK,
+ "BOX_LEFT", EPHYSICS_BODY_BOX_FACE_LEFT,
+ "BOX_RIGHT", EPHYSICS_BODY_BOX_FACE_RIGHT,
+ "BOX_TOP", EPHYSICS_BODY_BOX_FACE_TOP,
+ "BOX_BOTTOM", EPHYSICS_BODY_BOX_FACE_BOTTOM,
+ "CLOTH_FRONT", EPHYSICS_BODY_CLOTH_FACE_FRONT,
+ "CLOTH_BACK", EPHYSICS_BODY_CLOTH_FACE_BACK,
+ "CYLINDER_MIDDLE_FRONT", EPHYSICS_BODY_CYLINDER_FACE_MIDDLE_FRONT,
+ "CYLINDER_MIDDLE_BACK", EPHYSICS_BODY_CYLINDER_FACE_MIDDLE_BACK,
+ "CYLINDER_FRONT", EPHYSICS_BODY_CYLINDER_FACE_FRONT,
+ "CYLINDER_BACK", EPHYSICS_BODY_CYLINDER_FACE_BACK,
+ "CYLINDER_CURVED", EPHYSICS_BODY_CYLINDER_FACE_CURVED,
+ "SPHERE_FRONT", EPHYSICS_BODY_SPHERE_FACE_FRONT,
+ "SPHERE_BACK", EPHYSICS_BODY_SPHERE_FACE_BACK,
+ NULL);
EINA_LIST_FOREACH(current_desc->physics.faces, l, pface2)
{
- if ((pface != pface2) && (pface->type == pface2->type))
- {
- ERR("parse error %s:%i. There is already a face of type \"%i\"",
- file_in, line - 1, pface->type);
- exit(-1);
- }
+ if ((pface != pface2) && (pface->type == pface2->type))
+ {
+ ERR("parse error %s:%i. There is already a face of type \"%i\"",
+ file_in, line - 1, pface->type);
+ exit(-1);
+ }
}
}
+
#endif
/**
@@ -13925,7 +14179,7 @@ st_collections_group_parts_part_description_physics_face_type(void)
This sets the group that is used as the object representing the physics
body face.
@endproperty
-*/
+ */
#ifdef HAVE_EPHYSICS
static void
st_collections_group_parts_part_description_physics_face_source(void)
@@ -13938,6 +14192,7 @@ st_collections_group_parts_part_description_physics_face_source(void)
pface->source = parse_str(0);
data_queue_face_group_lookup(pface->source);
}
+
#endif
/** @edcsubsection{collections_group_parts_description_map,
@@ -13982,7 +14237,7 @@ st_collections_group_parts_part_description_physics_face_source(void)
This also implicitly enables perspective transforms (see the on
parameter for the map section).
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_map_perspective(void)
{
@@ -14020,7 +14275,7 @@ st_collections_group_parts_part_description_map_perspective(void)
the ambient lighting when calculating brightness (alpha also not
used).
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_map_light(void)
{
@@ -14050,7 +14305,7 @@ st_collections_group_parts_part_description_map_light(void)
Defaults: 0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_map_on(void)
{
@@ -14073,7 +14328,7 @@ st_collections_group_parts_part_description_map_on(void)
Defaults: 1
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_map_smooth(void)
{
@@ -14093,7 +14348,7 @@ st_collections_group_parts_part_description_map_smooth(void)
Defaults: 1
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_map_alpha(void)
{
@@ -14115,7 +14370,7 @@ st_collections_group_parts_part_description_map_alpha(void)
Defaults: 0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_map_backface_cull(void)
{
@@ -14138,7 +14393,7 @@ st_collections_group_parts_part_description_map_backface_cull(void)
Defaults: 0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_map_perspective_on(void)
{
@@ -14176,7 +14431,7 @@ st_collections_group_parts_part_description_map_perspective_on(void)
Defaults: 255 255 255 255
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_map_color(void)
{
@@ -14209,8 +14464,8 @@ st_collections_group_parts_part_description_map_color(void)
*color = tmp;
current_desc->map.colors_count++;
current_desc->map.colors =
- realloc(current_desc->map.colors,
- sizeof(Edje_Map_Color*) * current_desc->map.colors_count);
+ realloc(current_desc->map.colors,
+ sizeof(Edje_Map_Color *) * current_desc->map.colors_count);
current_desc->map.colors[current_desc->map.colors_count - 1] = color;
}
@@ -14225,7 +14480,7 @@ st_collections_group_parts_part_description_map_color(void)
Defaults: 1.0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_map_zoom_x(void)
{
@@ -14245,7 +14500,7 @@ st_collections_group_parts_part_description_map_zoom_x(void)
Defaults: 1.0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_map_zoom_y(void)
{
@@ -14275,7 +14530,7 @@ st_collections_group_parts_part_description_map_zoom_y(void)
@description
Rotates the part, optionally with the center on another part.
@endblock
-
+
@property
center
@parameters
@@ -14287,7 +14542,7 @@ st_collections_group_parts_part_description_map_zoom_y(void)
x, y and z axes. If no center is given, the parts original center
itself is used for the rotation center.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_map_rotation_center(void)
{
@@ -14318,7 +14573,7 @@ st_collections_group_parts_part_description_map_rotation_center(void)
Defaults: 0.0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_map_rotation_x(void)
{
@@ -14339,7 +14594,7 @@ st_collections_group_parts_part_description_map_rotation_x(void)
Defaults: 0.0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_map_rotation_y(void)
{
@@ -14360,7 +14615,7 @@ st_collections_group_parts_part_description_map_rotation_y(void)
Defaults: 0.0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_map_rotation_z(void)
{
@@ -14389,7 +14644,7 @@ st_collections_group_parts_part_description_map_rotation_z(void)
Adds focal and plane perspective to the part. Active if perspective_on is true.
Must be provided if the part is being used by other part as it's perspective target.
@endblock
-
+
@property
zplane
@parameters
@@ -14400,7 +14655,7 @@ st_collections_group_parts_part_description_map_rotation_z(void)
Defaults: 0
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_perspective_zplane(void)
{
@@ -14409,7 +14664,6 @@ st_collections_group_parts_part_description_perspective_zplane(void)
current_desc->persp.zplane = parse_int(0);
}
-
/**
@page edcref
@property
@@ -14422,7 +14676,7 @@ st_collections_group_parts_part_description_perspective_zplane(void)
Defaults: 1000
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_perspective_focal(void)
{
@@ -14431,7 +14685,6 @@ st_collections_group_parts_part_description_perspective_focal(void)
current_desc->persp.focal = parse_int_range(0, 1, 0x7fffffff);
}
-
/** @edcsubsection{collections_group_parts_description_filter,
* Group.Parts.Part.Description.Filter} */
@@ -14478,7 +14731,7 @@ st_collections_group_parts_part_description_perspective_focal(void)
@ref evasfiltersref "here" or a filter name defined in the
@ref sec_collections_group_filters "Filters" section.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_filter_code(void)
{
@@ -14501,7 +14754,7 @@ st_collections_group_parts_part_description_filter_code(void)
exit(-1);
}
- free((void*) filter->code);
+ free((void *)filter->code);
filter->code = parse_str(0);
}
@@ -14517,7 +14770,7 @@ st_collections_group_parts_part_description_filter_code(void)
text or image filter operation. Optionally, a buffer name may be
specified, so the same filter code can be used with different sources.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_filter_source(void)
{
@@ -14529,7 +14782,7 @@ st_collections_group_parts_part_description_filter_source(void)
int args;
static const char allowed_name_chars[] =
- "abcdefghijklmnopqrstuvwxyzABCDEFGHJIKLMNOPQRSTUVWXYZ0123456789_";
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHJIKLMNOPQRSTUVWXYZ0123456789_";
if (current_part->type == EDJE_PART_TYPE_TEXT)
filter = &(((Edje_Part_Description_Text *)current_desc)->filter);
@@ -14619,7 +14872,7 @@ st_collections_group_parts_part_description_filter_source(void)
mycc = { r = 255, g = 0, b, a, r2, g2, b2, a2, r3, g3, b3, a3 }
@endcode
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_filter_data(void)
{
@@ -14685,7 +14938,7 @@ st_collections_group_parts_part_description_filter_data(void)
Set parameters for EXTERNAL parts. The value overwrites previous
definitions with the same name.
@endblock
-*/
+ */
static void
_st_collections_group_parts_part_description_params(Edje_External_Param_Type type)
{
@@ -14704,25 +14957,25 @@ _st_collections_group_parts_part_description_params(Edje_External_Param_Type typ
exit(-1);
}
- ed = (Edje_Part_Description_External*) current_desc;
+ ed = (Edje_Part_Description_External *)current_desc;
name = parse_str(0);
/* if a param with this name already exists, overwrite it */
EINA_LIST_FOREACH(ed->external_params, l, param)
{
- if (!strcmp(param->name, name))
- {
- found = 1;
+ if (!strcmp(param->name, name))
+ {
+ found = 1;
free(name);
- break;
- }
+ break;
+ }
}
if (!found)
{
- param = mem_alloc(SZ(Edje_External_Param));
- param->name = name;
+ param = mem_alloc(SZ(Edje_External_Param));
+ param->name = name;
}
param->type = type;
@@ -14733,22 +14986,26 @@ _st_collections_group_parts_part_description_params(Edje_External_Param_Type typ
switch (type)
{
case EDJE_EXTERNAL_PARAM_TYPE_BOOL:
- param->i = parse_bool(1);
- break;
+ param->i = parse_bool(1);
+ break;
+
case EDJE_EXTERNAL_PARAM_TYPE_INT:
- param->i = parse_int(1);
- break;
+ param->i = parse_int(1);
+ break;
+
case EDJE_EXTERNAL_PARAM_TYPE_DOUBLE:
- param->d = parse_float(1);
- break;
+ param->d = parse_float(1);
+ break;
+
case EDJE_EXTERNAL_PARAM_TYPE_CHOICE:
case EDJE_EXTERNAL_PARAM_TYPE_STRING:
- param->s = parse_str(1);
- break;
+ param->s = parse_str(1);
+ break;
+
default:
- ERR("parse error %s:%i. Invalid param type.",
- file_in, line - 1);
- break;
+ ERR("parse error %s:%i. Invalid param type.",
+ file_in, line - 1);
+ break;
}
if (!found)
@@ -14764,7 +15021,7 @@ _st_collections_group_parts_part_description_params(Edje_External_Param_Type typ
@effect
Adds an integer parameter for an external object
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_params_int(void)
{
@@ -14780,7 +15037,7 @@ st_collections_group_parts_part_description_params_int(void)
@effect
Adds a double parameter for an external object
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_params_double(void)
{
@@ -14796,7 +15053,7 @@ st_collections_group_parts_part_description_params_double(void)
@effect
Adds a string parameter for an external object
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_params_string(void)
{
@@ -14812,7 +15069,7 @@ st_collections_group_parts_part_description_params_string(void)
@effect
Adds an boolean parameter for an external object.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_params_bool(void)
{
@@ -14830,7 +15087,7 @@ st_collections_group_parts_part_description_params_bool(void)
choice values are defined by external type at their register time
and will be validated at runtime.
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_params_choice(void)
{
@@ -14862,7 +15119,7 @@ st_collections_group_parts_part_description_params_choice(void)
signal: "edje,signal"; source: "edje";
@since 1.10
@endblock
-*/
+ */
static void
ob_collections_group_parts_part_description_link(void)
{
@@ -14872,10 +15129,10 @@ ob_collections_group_parts_part_description_link(void)
const char *nm;
pcp = eina_list_last_data_get(edje_collections);
- epp = (Edje_Part_Parser*)current_part;
+ epp = (Edje_Part_Parser *)current_part;
ob_collections_group_programs_program();
- _edje_program_remove((Edje_Part_Collection*)pcp, current_program);
+ _edje_program_remove((Edje_Part_Collection *)pcp, current_program);
el = mem_alloc(SZ(Edje_Part_Description_Link));
el->pr = current_program;
el->ed = current_desc;
@@ -14899,7 +15156,7 @@ ob_collections_group_parts_part_description_link(void)
default value if it is not provided.
@since 1.10
@endproperty
-*/
+ */
static void
st_collections_group_parts_part_description_link_base(void)
{
@@ -14913,7 +15170,7 @@ st_collections_group_parts_part_description_link_base(void)
el = eina_list_last_data_get(pcp->links);
if ((!el) || (el->pr != current_program) ||
- (el->ed != current_desc) || (el->epp != (Edje_Part_Parser*)current_part) ||
+ (el->ed != current_desc) || (el->epp != (Edje_Part_Parser *)current_part) ||
el->pr->source)
ob_collections_group_parts_part_description_link();
el = eina_list_last_data_get(pcp->links);
@@ -14923,17 +15180,17 @@ st_collections_group_parts_part_description_link_base(void)
if (current_program->signal && pcp->link_hash)
{
snprintf(buf, sizeof(buf), "%s\"\"\"%s", current_program->signal,
- current_program->source ? current_program->source: "");
+ current_program->source ? current_program->source : "");
eina_hash_list_remove(pcp->link_hash, buf, el);
}
if (!pcp->link_hash)
pcp->link_hash = eina_hash_string_superfast_new((Eina_Free_Cb)eina_list_free);
- free((void*)current_program->signal);
+ free((void *)current_program->signal);
current_program->signal = name;
if (get_arg_count() == 2)
{
name = parse_str(1);
- free((void*)current_program->source);
+ free((void *)current_program->source);
current_program->source = name;
}
snprintf(buf, sizeof(buf), "%s\"\"\"%s", current_program->signal,
@@ -14971,13 +15228,13 @@ st_collections_group_parts_part_description_link_base(void)
@description
The programs group contain one ore more program.
@endblock
-*/
+ */
static void
_program_sequence_check(void)
{
if (sequencing != current_program) return;
ERR("parse error %s:%i. cannot set sequence parent program attributes within sequence block",
- file_in, line - 1);
+ file_in, line - 1);
exit(-1);
}
@@ -14997,14 +15254,14 @@ _program_after(const char *name)
EINA_LIST_FOREACH(ep->after, l, pa2)
{
- if (!strcmp(name, (char*) (pa2 + 1)))
+ if (!strcmp(name, (char *)(pa2 + 1)))
return;
}
pa = mem_alloc(SZ(Edje_Program_After) + strlen(name) + 1);
pa->id = -1;
ep->after = eina_list_append(ep->after, pa);
- copy = (char*)(pa + 1);
+ copy = (char *)(pa + 1);
memcpy(copy, name, strlen(name) + 1);
pl = data_queue_program_lookup(pc, name, &(pa->id));
if (pl)
@@ -15054,7 +15311,7 @@ _program_sequence_new(void)
Programs can change the state of parts, react to events or trigger
other events.
@endblock
-*/
+ */
static void
ob_collections_group_programs_program(void)
{
@@ -15120,7 +15377,7 @@ _program_name(char *name)
@effect
Symbolic name of program as a unique identifier.
@endproperty
-*/
+ */
static void
st_collections_group_programs_program_name(void)
{
@@ -15162,7 +15419,7 @@ st_collections_group_programs_program_name(void)
- focus,part,in;
- focus,part,out.
@endproperty
-*/
+ */
static void
st_collections_group_programs_program_signal(void)
{
@@ -15190,7 +15447,7 @@ st_collections_group_programs_program_signal(void)
keyword per program may be used. ex: source: "button-*"; (Signals from
any part or program named "button-*" are accepted).
@endproperty
-*/
+ */
static void
st_collections_group_programs_program_source(void)
{
@@ -15203,7 +15460,7 @@ st_collections_group_programs_program_source(void)
pc = eina_list_data_get(eina_list_last(edje_collections));
_edje_program_remove(pc, current_program);
- free((void*)current_program->source);
+ free((void *)current_program->source);
current_program->source = parse_str(0);
_edje_program_insert(pc, current_program);
}
@@ -15219,7 +15476,7 @@ st_collections_group_programs_program_source(void)
Only one filter per program can be used. If [part] is not given, the source of
the event will be used instead.
@endproperty
-*/
+ */
static void
st_collections_group_programs_program_filter(void)
{
@@ -15227,12 +15484,15 @@ st_collections_group_programs_program_filter(void)
_program_sequence_check();
- if(is_param(1)) {
- current_program->filter.part = parse_str(0);
- current_program->filter.state = parse_str(1);
- } else {
- current_program->filter.state = parse_str(0);
- }
+ if (is_param(1))
+ {
+ current_program->filter.part = parse_str(0);
+ current_program->filter.state = parse_str(1);
+ }
+ else
+ {
+ current_program->filter.state = parse_str(0);
+ }
}
/**
@@ -15247,7 +15507,7 @@ st_collections_group_programs_program_filter(void)
Defaults: 0.0 0.0
@endproperty
-*/
+ */
static void
st_collections_group_programs_program_in(void)
{
@@ -15302,7 +15562,7 @@ st_collections_group_programs_program_in(void)
@li ALERT
@endproperty
-*/
+ */
static void
st_collections_group_programs_program_action(void)
{
@@ -15343,11 +15603,11 @@ st_collections_group_programs_program_action(void)
NULL);
if (ep->action == EDJE_ACTION_TYPE_STATE_SET)
{
- ep->state = parse_str(1);
- if (get_arg_count() == 2)
- ep->value = 0.0;
- else
- ep->value = parse_float_range(2, 0.0, 1.0);
+ ep->state = parse_str(1);
+ if (get_arg_count() == 2)
+ ep->value = 0.0;
+ else
+ ep->value = parse_float_range(2, 0.0, 1.0);
}
else if ((ep->action == EDJE_ACTION_TYPE_FOCUS_SET) ||
(ep->action == EDJE_ACTION_TYPE_FOCUS_OBJECT))
@@ -15359,8 +15619,8 @@ st_collections_group_programs_program_action(void)
}
else if (ep->action == EDJE_ACTION_TYPE_SIGNAL_EMIT)
{
- ep->state = parse_str(1);
- ep->state2 = parse_str(2);
+ ep->state = parse_str(1);
+ ep->state2 = parse_str(2);
}
else if (ep->action == EDJE_ACTION_TYPE_SOUND_SAMPLE)
{
@@ -15431,44 +15691,44 @@ st_collections_group_programs_program_action(void)
}
else if (ep->action == EDJE_ACTION_TYPE_DRAG_VAL_SET)
{
- ep->value = parse_float(1);
- ep->value2 = parse_float(2);
+ ep->value = parse_float(1);
+ ep->value2 = parse_float(2);
}
else if (ep->action == EDJE_ACTION_TYPE_DRAG_VAL_STEP)
{
- ep->value = parse_float(1);
- ep->value2 = parse_float(2);
+ ep->value = parse_float(1);
+ ep->value2 = parse_float(2);
}
else if (ep->action == EDJE_ACTION_TYPE_DRAG_VAL_PAGE)
{
- ep->value = parse_float(1);
- ep->value2 = parse_float(2);
+ ep->value = parse_float(1);
+ ep->value2 = parse_float(2);
}
else if (ep->action == EDJE_ACTION_TYPE_PARAM_COPY)
{
- char *src_part, *dst_part;
-
- src_part = parse_str(1);
- ep->state = parse_str(2);
- dst_part = parse_str(3);
- ep->state2 = parse_str(4);
-
- data_queue_part_lookup(pc, src_part, &(ep->param.src));
- data_queue_part_lookup(pc, dst_part, &(ep->param.dst));
-
- free(src_part);
- free(dst_part);
+ char *src_part, *dst_part;
+
+ src_part = parse_str(1);
+ ep->state = parse_str(2);
+ dst_part = parse_str(3);
+ ep->state2 = parse_str(4);
+
+ data_queue_part_lookup(pc, src_part, &(ep->param.src));
+ data_queue_part_lookup(pc, dst_part, &(ep->param.dst));
+
+ free(src_part);
+ free(dst_part);
}
else if (ep->action == EDJE_ACTION_TYPE_PARAM_SET)
{
- char *part;
-
- part = parse_str(1);
- ep->state = parse_str(2);
- ep->state2 = parse_str(3);
-
- data_queue_part_lookup(pc, part, &(ep->param.dst));
- free(part);
+ char *part;
+
+ part = parse_str(1);
+ ep->state = parse_str(2);
+ ep->state2 = parse_str(3);
+
+ data_queue_part_lookup(pc, part, &(ep->param.dst));
+ free(part);
}
#ifdef HAVE_EPHYSICS
else if ((ep->action == EDJE_ACTION_TYPE_PHYSICS_IMPULSE) ||
@@ -15494,14 +15754,16 @@ st_collections_group_programs_program_action(void)
switch (ep->action)
{
case EDJE_ACTION_TYPE_SCRIPT:
- /* this is implicitly set by script {} so this is here just for
- * completeness */
- break;
+ /* this is implicitly set by script {} so this is here just for
+ * completeness */
+ break;
+
case EDJE_ACTION_TYPE_ACTION_STOP:
case EDJE_ACTION_TYPE_PHYSICS_FORCES_CLEAR:
case EDJE_ACTION_TYPE_PHYSICS_STOP:
check_arg_count(1);
break;
+
case EDJE_ACTION_TYPE_PARAM_SET:
case EDJE_ACTION_TYPE_PHYSICS_IMPULSE:
case EDJE_ACTION_TYPE_PHYSICS_TORQUE_IMPULSE:
@@ -15511,22 +15773,27 @@ st_collections_group_programs_program_action(void)
case EDJE_ACTION_TYPE_PHYSICS_ANG_VEL_SET:
check_arg_count(4);
break;
+
case EDJE_ACTION_TYPE_PARAM_COPY:
case EDJE_ACTION_TYPE_PHYSICS_ROT_SET:
check_arg_count(5);
break;
+
case EDJE_ACTION_TYPE_SOUND_SAMPLE:
case EDJE_ACTION_TYPE_VIBRATION_SAMPLE:
break;
+
case EDJE_ACTION_TYPE_STATE_SET:
check_min_arg_count(2);
break;
+
case EDJE_ACTION_TYPE_FOCUS_SET:
case EDJE_ACTION_TYPE_FOCUS_OBJECT:
check_min_arg_count(1);
break;
+
default:
- check_arg_count(3);
+ check_arg_count(3);
}
}
@@ -15552,23 +15819,23 @@ st_collections_group_programs_program_action(void)
@li BOUNCE
@li SPRING
@li CUBIC_BEZIER
-
+
ACCEL_FAC, DECEL_FAC and SIN_FAC need the extra optional
"interp val 1" to determine the "factor" of curviness. 1.0 is the same
as their non-factor counterparts, where 0.0 is equal to linear.
Numbers higher than one make the curve angles steeper with a more
pronounced curve point.
-
+
DIVIS, BOUNCE and SPRING also require "interp val 2" in addition
to "interp val 1".
-
+
DIVIS uses val 1 as the initial gradient start
(0.0 is horizontal, 1.0 is diagonal (linear), 2.0 is twice the
gradient of linear etc.). val 2 is interpreted as an integer factor
defining how much the value swings "outside" the gradient only to come
back to the final resting spot at the end. 0.0 for val 2 is equivalent
to linear interpolation. Note that DIVIS can exceed 1.0
-
+
BOUNCE uses val 2 as the number of bounces (so its rounded down to
the nearest integer value), with val 1 determining how much the
bounce decays, with 0.0 giving linear decay per bounce, and higher
@@ -15583,7 +15850,7 @@ st_collections_group_programs_program_action(void)
Can be used as the last parameter of any transition type. (since 1.1.0)
@endproperty
-*/
+ */
static void
st_collections_group_programs_program_transition(void)
{
@@ -15595,38 +15862,38 @@ st_collections_group_programs_program_transition(void)
_program_sequence_check();
current_program->tween.v1 = current_program->tween.v2 =
- current_program->tween.v3 = current_program->tween.v4 = 0.0;
+ current_program->tween.v3 = current_program->tween.v4 = 0.0;
current_program->tween.mode = parse_enum(0,
- // short names
- "LIN", EDJE_TWEEN_MODE_LINEAR,
- "SIN", EDJE_TWEEN_MODE_SINUSOIDAL,
- "ACCEL", EDJE_TWEEN_MODE_ACCELERATE,
- "DECEL", EDJE_TWEEN_MODE_DECELERATE,
- "ACCEL_FAC", EDJE_TWEEN_MODE_ACCELERATE_FACTOR,
- "DECEL_FAC", EDJE_TWEEN_MODE_DECELERATE_FACTOR,
- "SIN_FAC", EDJE_TWEEN_MODE_SINUSOIDAL_FACTOR,
- "DIVIS", EDJE_TWEEN_MODE_DIVISOR_INTERP,
-
- // long/full names
- "LINEAR", EDJE_TWEEN_MODE_LINEAR,
- "SINUSOIDAL", EDJE_TWEEN_MODE_SINUSOIDAL,
- "CUBIC_BEZIER", EDJE_TWEEN_MODE_CUBIC_BEZIER,
- "ACCELERATE", EDJE_TWEEN_MODE_ACCELERATE,
- "DECELERATE", EDJE_TWEEN_MODE_DECELERATE,
- "ACCELERATE_FACTOR", EDJE_TWEEN_MODE_ACCELERATE_FACTOR,
- "DECELERATE_FACTOR", EDJE_TWEEN_MODE_DECELERATE_FACTOR,
- "SINUSOIDAL_FACTOR", EDJE_TWEEN_MODE_SINUSOIDAL_FACTOR,
- "DIVISOR_INTERP", EDJE_TWEEN_MODE_DIVISOR_INTERP,
-
- // long/full is short enough
- "BOUNCE", EDJE_TWEEN_MODE_BOUNCE,
- "SPRING", EDJE_TWEEN_MODE_SPRING,
- NULL);
+ // short names
+ "LIN", EDJE_TWEEN_MODE_LINEAR,
+ "SIN", EDJE_TWEEN_MODE_SINUSOIDAL,
+ "ACCEL", EDJE_TWEEN_MODE_ACCELERATE,
+ "DECEL", EDJE_TWEEN_MODE_DECELERATE,
+ "ACCEL_FAC", EDJE_TWEEN_MODE_ACCELERATE_FACTOR,
+ "DECEL_FAC", EDJE_TWEEN_MODE_DECELERATE_FACTOR,
+ "SIN_FAC", EDJE_TWEEN_MODE_SINUSOIDAL_FACTOR,
+ "DIVIS", EDJE_TWEEN_MODE_DIVISOR_INTERP,
+
+ // long/full names
+ "LINEAR", EDJE_TWEEN_MODE_LINEAR,
+ "SINUSOIDAL", EDJE_TWEEN_MODE_SINUSOIDAL,
+ "CUBIC_BEZIER", EDJE_TWEEN_MODE_CUBIC_BEZIER,
+ "ACCELERATE", EDJE_TWEEN_MODE_ACCELERATE,
+ "DECELERATE", EDJE_TWEEN_MODE_DECELERATE,
+ "ACCELERATE_FACTOR", EDJE_TWEEN_MODE_ACCELERATE_FACTOR,
+ "DECELERATE_FACTOR", EDJE_TWEEN_MODE_DECELERATE_FACTOR,
+ "SINUSOIDAL_FACTOR", EDJE_TWEEN_MODE_SINUSOIDAL_FACTOR,
+ "DIVISOR_INTERP", EDJE_TWEEN_MODE_DIVISOR_INTERP,
+
+ // long/full is short enough
+ "BOUNCE", EDJE_TWEEN_MODE_BOUNCE,
+ "SPRING", EDJE_TWEEN_MODE_SPRING,
+ NULL);
current_program->tween.time = FROM_DOUBLE(parse_float_range(1, 0.0, 999999999.0));
- //Check the index of params not related to tweenmode's param
- //This index use for count of the tweenmode's param
+ //Check the index of params not related to tweenmode's param
+ //This index use for count of the tweenmode's param
if ((index = get_param_index("USE_DURATION_FACTOR")) != -1)
{
current_program->tween.use_duration_factor = parse_bool(index + 1);
@@ -15638,87 +15905,89 @@ st_collections_group_programs_program_transition(void)
index = current;
required_args++;
}
- switch(current_program->tween.mode)
- {
- case EDJE_TWEEN_MODE_LINEAR:
- case EDJE_TWEEN_MODE_SINUSOIDAL:
- case EDJE_TWEEN_MODE_ACCELERATE:
- case EDJE_TWEEN_MODE_DECELERATE:
- {
- required_args += 2;
- check_arg_count(required_args);
- }
- break;
-
- // the following need v1
- case EDJE_TWEEN_MODE_ACCELERATE_FACTOR:
- case EDJE_TWEEN_MODE_DECELERATE_FACTOR:
- case EDJE_TWEEN_MODE_SINUSOIDAL_FACTOR:
- {
- required_args += 3;
- check_arg_count(required_args);
- if (index == -1 || index > 2)
- {
- current_program->tween.v1 =
- FROM_DOUBLE(parse_float_range(2, -999999999.0, 999999999.0));
- break;
- }
- else
- {
- ERR("parse error %s:%i. Need 3rd parameter to set factor",
+ switch (current_program->tween.mode)
+ {
+ case EDJE_TWEEN_MODE_LINEAR:
+ case EDJE_TWEEN_MODE_SINUSOIDAL:
+ case EDJE_TWEEN_MODE_ACCELERATE:
+ case EDJE_TWEEN_MODE_DECELERATE:
+ {
+ required_args += 2;
+ check_arg_count(required_args);
+ }
+ break;
+
+ // the following need v1
+ case EDJE_TWEEN_MODE_ACCELERATE_FACTOR:
+ case EDJE_TWEEN_MODE_DECELERATE_FACTOR:
+ case EDJE_TWEEN_MODE_SINUSOIDAL_FACTOR:
+ {
+ required_args += 3;
+ check_arg_count(required_args);
+ if (index == -1 || index > 2)
+ {
+ current_program->tween.v1 =
+ FROM_DOUBLE(parse_float_range(2, -999999999.0, 999999999.0));
+ break;
+ }
+ else
+ {
+ ERR("parse error %s:%i. Need 3rd parameter to set factor",
file_in, line - 1);
- exit(-1);
- }
- }
- case EDJE_TWEEN_MODE_DIVISOR_INTERP:
- case EDJE_TWEEN_MODE_BOUNCE:
- case EDJE_TWEEN_MODE_SPRING:
- {
- required_args += 4;
- check_arg_count(required_args);
- if (index == -1 || index > 3)
- {
- current_program->tween.v1 =
- FROM_DOUBLE(parse_float_range(2, -999999999.0, 999999999.0));
- current_program->tween.v2 =
- FROM_DOUBLE(parse_float_range(3, -999999999.0, 999999999.0));
- break;
- }
- else
- {
- ERR("parse error %s:%i. "
+ exit(-1);
+ }
+ }
+
+ case EDJE_TWEEN_MODE_DIVISOR_INTERP:
+ case EDJE_TWEEN_MODE_BOUNCE:
+ case EDJE_TWEEN_MODE_SPRING:
+ {
+ required_args += 4;
+ check_arg_count(required_args);
+ if (index == -1 || index > 3)
+ {
+ current_program->tween.v1 =
+ FROM_DOUBLE(parse_float_range(2, -999999999.0, 999999999.0));
+ current_program->tween.v2 =
+ FROM_DOUBLE(parse_float_range(3, -999999999.0, 999999999.0));
+ break;
+ }
+ else
+ {
+ ERR("parse error %s:%i. "
"Need 3rd and 4th parameters to set factor and counts",
file_in, line - 1);
- exit(-1);
- }
- }
- case EDJE_TWEEN_MODE_CUBIC_BEZIER:
- {
- required_args += 6;
- check_arg_count(required_args);
- if (index == -1 || index > 5)
- {
- current_program->tween.v1 =
- FROM_DOUBLE(parse_float_range(2, -999999999.0, 999999999.0));
- current_program->tween.v2 =
- FROM_DOUBLE(parse_float_range(3, -999999999.0, 999999999.0));
- current_program->tween.v3 =
- FROM_DOUBLE(parse_float_range(4, -999999999.0, 999999999.0));
- current_program->tween.v4 =
- FROM_DOUBLE(parse_float_range(5, -999999999.0, 999999999.0));
- break;
- }
- else
- {
- ERR("parse error %s:%i. "
+ exit(-1);
+ }
+ }
+
+ case EDJE_TWEEN_MODE_CUBIC_BEZIER:
+ {
+ required_args += 6;
+ check_arg_count(required_args);
+ if (index == -1 || index > 5)
+ {
+ current_program->tween.v1 =
+ FROM_DOUBLE(parse_float_range(2, -999999999.0, 999999999.0));
+ current_program->tween.v2 =
+ FROM_DOUBLE(parse_float_range(3, -999999999.0, 999999999.0));
+ current_program->tween.v3 =
+ FROM_DOUBLE(parse_float_range(4, -999999999.0, 999999999.0));
+ current_program->tween.v4 =
+ FROM_DOUBLE(parse_float_range(5, -999999999.0, 999999999.0));
+ break;
+ }
+ else
+ {
+ ERR("parse error %s:%i. "
"Need 3rd, 4th, 5th and 6th parameters to set x1, y1, x2 and y2",
file_in, line - 1);
- exit(-1);
- }
- }
- }
- if (current > 0)
- current_program->tween.mode |= EDJE_TWEEN_MODE_OPT_FROM_CURRENT;
+ exit(-1);
+ }
+ }
+ }
+ if (current > 0)
+ current_program->tween.mode |= EDJE_TWEEN_MODE_OPT_FROM_CURRENT;
}
static void
@@ -15736,7 +16005,7 @@ _program_target_add(char *name)
EINA_LIST_FOREACH(ep->targets, l, etw)
{
- if (!strcmp(name, (char*) (etw + 1)))
+ if (!strcmp(name, (char *)(etw + 1)))
{
free(name);
return;
@@ -15745,13 +16014,14 @@ _program_target_add(char *name)
et = mem_alloc(SZ(Edje_Program_Target) + strlen(name) + 1);
ep->targets = eina_list_append(ep->targets, et);
- copy = (char*) (et + 1);
+ copy = (char *)(et + 1);
memcpy(copy, name, strlen(name) + 1);
switch (ep->action)
{
case EDJE_ACTION_TYPE_ACTION_STOP:
- data_queue_program_lookup(pc, name, &(et->id));
- break;
+ data_queue_program_lookup(pc, name, &(et->id));
+ break;
+
case EDJE_ACTION_TYPE_STATE_SET:
case EDJE_ACTION_TYPE_SIGNAL_EMIT:
case EDJE_ACTION_TYPE_DRAG_VAL_SET:
@@ -15770,12 +16040,13 @@ _program_target_add(char *name)
case EDJE_ACTION_TYPE_PHYSICS_STOP:
case EDJE_ACTION_TYPE_PHYSICS_ROT_SET:
#endif
- data_queue_part_lookup(pc, name, &(et->id));
- break;
+ data_queue_part_lookup(pc, name, &(et->id));
+ break;
+
default:
- ERR("parse error %s:%i. target may only be used after action",
- file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. target may only be used after action",
+ file_in, line - 1);
+ exit(-1);
}
free(name);
}
@@ -15791,7 +16062,7 @@ _program_target_add(char *name)
keywords may be specified, one per target. SIGNAL_EMITs can have
targets.
@endproperty
-*/
+ */
static void
st_collections_group_programs_program_target(void)
{
@@ -15814,7 +16085,7 @@ st_collections_group_programs_program_target(void)
targets.
@since 1.10
@endproperty
-*/
+ */
static void
st_collections_group_programs_program_targets(void)
{
@@ -15840,7 +16111,7 @@ st_collections_group_programs_program_targets(void)
and 'targets' keywords may be specified. SIGNAL_EMITs can have targets.
@since 1.10
@endproperty
-*/
+ */
static void
st_collections_group_programs_program_target_groups(void)
{
@@ -15873,7 +16144,7 @@ st_collections_group_programs_program_target_groups(void)
continue;
}
ERR("parse error %s:%i. There is no target_group with the name '%s'",
- file_in, line - 1, name);
+ file_in, line - 1, name);
exit(-1);
}
}
@@ -15889,7 +16160,7 @@ st_collections_group_programs_program_target_groups(void)
source and signal parameters of a program run as an "after" are ignored.
Multiple "after" statements can be specified per program.
@endproperty
-*/
+ */
static void
st_collections_group_programs_program_after(void)
{
@@ -15910,11 +16181,11 @@ st_collections_group_programs_program_after(void)
[name] [description]
@effect
Specifies a hint to let applications (or IDE's) know how to bind
- things. The parameter name should contain the name of the function that
- the application should use, and description describes how it should
- be used.
+ things. The parameter name should contain the name of the function that
+ the application should use, and description describes how it should
+ be used.
@endproperty
-*/
+ */
static void
st_collections_group_programs_program_api(void)
{
@@ -15926,8 +16197,8 @@ st_collections_group_programs_program_api(void)
if (is_param(1))
{
- check_arg_count(2);
- current_program->api.description = parse_str(1);
+ check_arg_count(2);
+ current_program->api.description = parse_str(1);
}
}
@@ -15978,14 +16249,14 @@ st_collections_group_programs_program_api(void)
sequenced program.
@since 1.10
@endblock
-*/
+ */
static void
ob_collections_group_programs_program_sequence(void)
{
sequencing = current_program;
sequencing_lookups = current_program_lookups;
current_program_lookups = NULL;
- ((Edje_Program_Parser*)sequencing)->can_override = EINA_FALSE;
+ ((Edje_Program_Parser *)sequencing)->can_override = EINA_FALSE;
}
static void
@@ -15996,8 +16267,8 @@ st_collections_group_parts_part_api(void)
current_part->api.name = parse_str(0);
if (is_param(1))
{
- check_arg_count(2);
- current_part->api.description = parse_str(1);
+ check_arg_count(2);
+ current_part->api.description = parse_str(1);
}
}
@@ -16137,6 +16408,7 @@ st_collections_group_physics_world_gravity(void)
pc->physics.world.gravity.y = parse_int(1);
pc->physics.world.gravity.z = parse_int(2);
}
+
#endif
/**
@@ -16164,6 +16436,7 @@ st_collections_group_physics_world_rate(void)
pc->physics.world.rate = parse_float(0);
}
+
#endif
/**
@@ -16190,6 +16463,7 @@ st_collections_group_physics_world_depth(void)
pc->physics.world.depth = parse_int(0);
}
+
#endif
/**
@@ -16217,13 +16491,13 @@ st_collections_group_physics_world_z(void)
pc->physics.world.z = parse_int(0);
}
+
#endif
/**
@page edcref
</table>
-*/
-
+ */
void
edje_cc_handlers_pop_notify(const char *token)
@@ -16231,7 +16505,7 @@ edje_cc_handlers_pop_notify(const char *token)
if (sequencing && (!strcmp(token, "sequence")))
{
current_program = sequencing;
- ((Edje_Program_Parser*)sequencing)->can_override = EINA_TRUE;
+ ((Edje_Program_Parser *)sequencing)->can_override = EINA_TRUE;
eina_list_free(current_program_lookups);
current_program_lookups = sequencing_lookups;
sequencing_lookups = NULL;
@@ -16251,39 +16525,39 @@ edje_cc_handlers_pop_notify(const char *token)
static void
edje_cc_handlers_hierarchy_set(Edje_Part *src)
{ /* This funcion makes current part rel_1.id, rel_2.id relative to src */
- if (!src->name)
- {
- ERR("parse error %s:%i. You must set parent name before creating nested part",
- file_in, line - 1);
- exit(-1);
- }
- st_collections_group_parts_part_description_rel1_to_set(src->name);
- st_collections_group_parts_part_description_rel2_to_set(src->name);
+ if (!src->name)
+ {
+ ERR("parse error %s:%i. You must set parent name before creating nested part",
+ file_in, line - 1);
+ exit(-1);
+ }
+ st_collections_group_parts_part_description_rel1_to_set(src->name);
+ st_collections_group_parts_part_description_rel2_to_set(src->name);
}
static Edje_Part *
edje_cc_handlers_hierarchy_parent_get(void)
{ /* Return the parent part pointer */
- int idx = eina_array_count(part_hierarchy) - 2;
- Edje_Cc_Handlers_Hierarchy_Info *info = (idx >= 0) ?
- eina_array_data_get(part_hierarchy, idx) : NULL;
+ int idx = eina_array_count(part_hierarchy) - 2;
+ Edje_Cc_Handlers_Hierarchy_Info *info = (idx >= 0) ?
+ eina_array_data_get(part_hierarchy, idx) : NULL;
- return (info) ? info->ep : NULL;
+ return (info) ? info->ep : NULL;
}
static void
edje_cc_handlers_hierarchy_push(Edje_Part *ep, Edje_Part *cp)
{ /* Remove part from hierarchy stack when finished parsing it */
- Edje_Cc_Handlers_Hierarchy_Info *info = malloc(sizeof(*info));
- info->current_de = current_de;
- info->current_part = cp; /* current_part restored on pop */
- info->current_item = current_item;
- info->current_desc = current_desc;
- info->parent_desc = parent_desc;
- info->current_program = current_program;
- info->ep = ep;
+ Edje_Cc_Handlers_Hierarchy_Info *info = malloc(sizeof(*info));
+ info->current_de = current_de;
+ info->current_part = cp; /* current_part restored on pop */
+ info->current_item = current_item;
+ info->current_desc = current_desc;
+ info->parent_desc = parent_desc;
+ info->current_program = current_program;
+ info->ep = ep;
- eina_array_push(part_hierarchy, info);
+ eina_array_push(part_hierarchy, info);
}
static void
@@ -16294,10 +16568,10 @@ edje_cc_handlers_hierarchy_rename(Edje_Part *old, Edje_Part *new)
unsigned int i;
EINA_ARRAY_ITER_NEXT(part_hierarchy, i, item, iterator)
- {
- if (item->ep == old) item->ep = new;
- if (item->current_part == old) item->current_part = new;
- }
+ {
+ if (item->ep == old) item->ep = new;
+ if (item->current_part == old) item->current_part = new;
+ }
}
void
@@ -16316,44 +16590,44 @@ edje_cc_handlers_hierarchy_free(void)
static void
edje_cc_handlers_hierarchy_pop(void)
{ /* Remove part from hierarchy stack when finished parsing it */
- Edje_Cc_Handlers_Hierarchy_Info *info = eina_array_pop(part_hierarchy);
+ Edje_Cc_Handlers_Hierarchy_Info *info = eina_array_pop(part_hierarchy);
- if (current_part)
- {
- unsigned int i;
+ if (current_part)
+ {
+ unsigned int i;
- if (!current_part->name)
- {
- WRN("Parse error near %s:%i. Unnamed part exists in Group \"%s\".",
- file_in, line - 1, current_de->entry);
- }
+ if (!current_part->name)
+ {
+ WRN("Parse error near %s:%i. Unnamed part exists in Group \"%s\".",
+ file_in, line - 1, current_de->entry);
+ }
- for (i = 0; i < current_part->other.desc_count; i++)
- {
- if (!current_part->other.desc[i]->state.name)
- {
- ERR("syntax error near %s:%i. Non-default or inherited parts are required to have state names for all descriptions (Group '%s', part '%s' has missing description state names)",
- file_in, line - 1, current_de->entry, current_part->name);
- exit(-1);
- }
- }
+ for (i = 0; i < current_part->other.desc_count; i++)
+ {
+ if (!current_part->other.desc[i]->state.name)
+ {
+ ERR("syntax error near %s:%i. Non-default or inherited parts are required to have state names for all descriptions (Group '%s', part '%s' has missing description state names)",
+ file_in, line - 1, current_de->entry, current_part->name);
+ exit(-1);
+ }
+ }
- /* auto-add default desc if it was omitted */
- if (!current_part->default_desc)
- ob_collections_group_parts_part_description();
- }
+ /* auto-add default desc if it was omitted */
+ if (!current_part->default_desc)
+ ob_collections_group_parts_part_description();
+ }
- if (info)
- {
- current_de = info->current_de;
- current_part = info->current_part;
- current_item = info->current_item;
- current_desc = info->current_desc;
- parent_desc = info->parent_desc;
- current_program = info->current_program;
+ if (info)
+ {
+ current_de = info->current_de;
+ current_part = info->current_part;
+ current_item = info->current_item;
+ current_desc = info->current_desc;
+ parent_desc = info->parent_desc;
+ current_program = info->current_program;
- free(info);
- }
+ free(info);
+ }
}
Eina_Bool
@@ -16393,12 +16667,12 @@ edje_cc_handlers_wildcard(void)
{
if ((!current_desc->state.name) || strcmp(current_desc->state.name, token))
{
- free((char*)current_desc->state.name);
+ free((char *)current_desc->state.name);
current_desc->state.name = token;
_part_description_state_update(current_desc);
}
- stack_pop_quick(EINA_FALSE, current_desc->state.name != token);
- return EINA_TRUE;
+ stack_pop_quick(EINA_FALSE, current_desc->state.name != token);
+ return EINA_TRUE;
}
if (!isdigit(token[0])) return EINA_FALSE;
@@ -16459,9 +16733,9 @@ edje_cc_handlers_wildcard(void)
if (edje_file->styles && (!strcmp(last, "style")))
{
if (!had_quote) return EINA_FALSE;
- _style_name(token);
- stack_pop_quick(EINA_FALSE, EINA_FALSE);
- return EINA_TRUE;
+ _style_name(token);
+ stack_pop_quick(EINA_FALSE, EINA_FALSE);
+ return EINA_TRUE;
}
if (edje_file->color_classes && (!strcmp(last, "color_class")))
{
@@ -16486,3 +16760,4 @@ edje_cc_handlers_wildcard(void)
}
return EINA_FALSE;
}
+
diff --git a/src/bin/edje/edje_cc_mem.c b/src/bin/edje/edje_cc_mem.c
index e1fa23953a..9057e4588f 100644
--- a/src/bin/edje/edje_cc_mem.c
+++ b/src/bin/edje/edje_cc_mem.c
@@ -32,3 +32,4 @@ mem_strdup(const char *s)
exit(-1);
return NULL;
}
+
diff --git a/src/bin/edje/edje_cc_out.c b/src/bin/edje/edje_cc_out.c
index 63d5a61dd8..d94c4aa25e 100644
--- a/src/bin/edje/edje_cc_out.c
+++ b/src/bin/edje/edje_cc_out.c
@@ -27,13 +27,12 @@
#include <lauxlib.h>
typedef struct _External_Lookup External_Lookup;
-typedef struct _Part_Lookup Part_Lookup;
+typedef struct _Part_Lookup Part_Lookup;
typedef struct _Part_Lookup_Key Part_Lookup_Key;
-typedef struct _Program_Lookup Program_Lookup;
-typedef struct _Group_Lookup Group_Lookup;
-typedef struct _Image_Lookup Image_Lookup;
-typedef struct _Code_Lookup Code_Lookup;
-
+typedef struct _Program_Lookup Program_Lookup;
+typedef struct _Group_Lookup Group_Lookup;
+typedef struct _Image_Lookup Image_Lookup;
+typedef struct _Code_Lookup Code_Lookup;
struct _External_Lookup
{
@@ -43,15 +42,17 @@ struct _External_Lookup
struct _Part_Lookup_Key
{
Edje_Part_Collection *pc;
-
- union {
+
+ union
+ {
int *dest;
- struct {
+ struct
+ {
unsigned char **base;
- int offset;
+ int offset;
} reallocated;
} mem;
- char **dest2;
+ char **dest2;
Eina_Bool stable : 1;
};
@@ -59,7 +60,7 @@ struct _Part_Lookup_Key
struct _Part_Lookup
{
Part_Lookup_Key key;
- char *name;
+ char *name;
};
struct _Program_Lookup
@@ -68,39 +69,39 @@ struct _Program_Lookup
union
{
- char *name;
+ char *name;
Edje_Program *ep;
} u;
- int *dest;
+ int *dest;
- Eina_Bool anonymous : 1;
+ Eina_Bool anonymous : 1;
};
struct _Group_Lookup
{
- char *name;
+ char *name;
Edje_Part *part;
};
struct _String_Lookup
{
char *name;
- int *dest;
+ int *dest;
};
struct _Image_Lookup
{
- char *name;
- int *dest;
+ char *name;
+ int *dest;
Eina_Bool *set;
};
struct _Code_Lookup
{
- char *ptr;
- int len;
- int val;
+ char *ptr;
+ int len;
+ int val;
Eina_Bool set;
};
@@ -109,94 +110,94 @@ typedef struct _Script_Lua_Writer Script_Lua_Writer;
struct _Script_Lua_Writer
{
char *buf;
- int size;
+ int size;
};
-typedef struct _Script_Write Script_Write;
-typedef struct _Head_Write Head_Write;
-typedef struct _Fonts_Write Fonts_Write;
-typedef struct _Image_Write Image_Write;
-typedef struct _Sound_Write Sound_Write;
-typedef struct _Mo_Write Mo_Write;
+typedef struct _Script_Write Script_Write;
+typedef struct _Head_Write Head_Write;
+typedef struct _Fonts_Write Fonts_Write;
+typedef struct _Image_Write Image_Write;
+typedef struct _Sound_Write Sound_Write;
+typedef struct _Mo_Write Mo_Write;
typedef struct _Vibration_Write Vibration_Write;
-typedef struct _Group_Write Group_Write;
-typedef struct _License_Write License_Write;
+typedef struct _Group_Write Group_Write;
+typedef struct _License_Write License_Write;
struct _Script_Write
{
- Eet_File *ef;
- Code *cd;
- int i;
- Ecore_Exe *exe;
- int tmpn_fd, tmpo_fd;
+ Eet_File *ef;
+ Code *cd;
+ int i;
+ Ecore_Exe *exe;
+ int tmpn_fd;
Eina_Tmpstr *tmpn;
Eina_Tmpstr *tmpo;
- char *errstr;
+ char *errstr;
};
struct _Head_Write
{
Eet_File *ef;
- char *errstr;
+ char *errstr;
};
struct _Fonts_Write
{
- Eet_File *ef;
+ Eet_File *ef;
Edje_Font *fn;
- char *errstr;
+ char *errstr;
};
struct _Image_Write
{
- Eet_File *ef;
+ Eet_File *ef;
Edje_Image_Directory_Entry *img;
- Evas_Object *im;
- Emile_Image_Property prop;
- Eina_File *f;
- Emile_Image *emi;
- int w, h;
- int alpha;
- unsigned int *data;
- char *path;
- char *errstr;
+ Evas_Object *im;
+ Emile_Image_Property prop;
+ Eina_File *f;
+ Emile_Image *emi;
+ int w, h;
+ int alpha;
+ unsigned int *data;
+ char *path;
+ char *errstr;
};
struct _Sound_Write
{
- Eet_File *ef;
+ Eet_File *ef;
Edje_Sound_Sample *sample;
- int i;
+ int i;
};
struct _Mo_Write
{
- Eet_File *ef;
- Edje_Mo *mo_entry;
- char *mo_path;
+ Eet_File *ef;
+ Edje_Mo *mo_entry;
+ char *mo_path;
Ecore_Exe *exe;
- char *errstr;
+ char *errstr;
};
struct _Vibration_Write
{
- Eet_File *ef;
+ Eet_File *ef;
Edje_Vibration_Sample *sample;
- int i;
+ int i;
};
struct _Group_Write
{
- Eet_File *ef;
+ Eet_File *ef;
Edje_Part_Collection *pc;
- char *errstr;
+ char *errstr;
};
struct _License_Write
{
- Eet_File *ef;
+ Eet_File *ef;
const char *file;
- Eina_Bool master;
+ Eina_Bool master;
};
struct _Image_Unused_Ids
@@ -208,8 +209,9 @@ struct _Image_Unused_Ids
typedef struct _Image_Unused_Ids Image_Unused_Ids;
static int pending_threads = 0;
+static int pending_image_threads = 0;
-static void data_process_string(Edje_Part_Collection *pc, const char *prefix, char *s, void (*func)(Edje_Part_Collection *pc, char *name, char* ptr, int len));
+static void data_process_string(Edje_Part_Collection *pc, const char *prefix, char *s, void (*func)(Edje_Part_Collection *pc, char *name, char *ptr, int len));
extern Eina_List *po_files;
@@ -234,6 +236,14 @@ static Eina_List *model_lookups = NULL;
static Eina_Hash *part_dest_lookup = NULL;
static Eina_Hash *part_pc_dest_lookup = NULL;
+static Eina_Hash *groups_sourced = NULL;
+
+static Eet_File *cur_ef;
+static int image_num;
+static Ecore_Evas *buffer_ee;
+static int cur_image_entry;
+
+static void data_write_images(void);
void
error_and_abort(Eet_File *ef EINA_UNUSED, const char *fmt, ...)
@@ -249,6 +259,21 @@ error_and_abort(Eet_File *ef EINA_UNUSED, const char *fmt, ...)
exit(-1);
}
+static void
+thread_end(Eina_Bool img)
+{
+ if (img)
+ pending_image_threads--;
+ else
+ pending_threads--;
+ if (threads)
+ {
+ if ((pending_image_threads + pending_threads) < (int)max_open_files - 2)
+ data_write_images();
+ }
+ if (pending_threads + pending_image_threads <= 0) ecore_main_loop_quit();
+}
+
static unsigned int
_part_lookup_key_length(const void *key EINA_UNUSED)
{
@@ -281,23 +306,23 @@ _part_lookup_key_pc_hash(const void *key, int key_length EINA_UNUSED)
if (a->stable)
{
#ifdef EFL64
- return eina_hash_int64((unsigned long long int *) &a->pc, sizeof (void*)) ^
- eina_hash_int64((unsigned long long int *) &a->mem.dest, sizeof (void*));
+ return eina_hash_int64((unsigned long long int *)&a->pc, sizeof (void *)) ^
+ eina_hash_int64((unsigned long long int *)&a->mem.dest, sizeof (void *));
#else
- return eina_hash_int32((uintptr_t *) &a->pc, sizeof (void*)) ^
- eina_hash_int32((uintptr_t *) &a->mem.dest, sizeof (void*));
+ return eina_hash_int32((uintptr_t *)&a->pc, sizeof (void *)) ^
+ eina_hash_int32((uintptr_t *)&a->mem.dest, sizeof (void *));
#endif
}
else
{
#ifdef EFL64
- return eina_hash_int64((unsigned long long int *) &a->pc, sizeof (void*)) ^
- eina_hash_int64((unsigned long long int *) &a->mem.reallocated.base, sizeof (void*)) ^
- eina_hash_int32((unsigned int *) &a->mem.reallocated.offset, sizeof (int));
+ return eina_hash_int64((unsigned long long int *)&a->pc, sizeof (void *)) ^
+ eina_hash_int64((unsigned long long int *)&a->mem.reallocated.base, sizeof (void *)) ^
+ eina_hash_int32((unsigned int *)&a->mem.reallocated.offset, sizeof (int));
#else
- return eina_hash_int32((uintptr_t *) &a->pc, sizeof (void*)) ^
- eina_hash_int32((uintptr_t *) &a->mem.reallocated.base, sizeof (void*)) ^
- eina_hash_int32((unsigned int *) &a->mem.reallocated.offset, sizeof (int));
+ return eina_hash_int32((uintptr_t *)&a->pc, sizeof (void *)) ^
+ eina_hash_int32((uintptr_t *)&a->mem.reallocated.base, sizeof (void *)) ^
+ eina_hash_int32((unsigned int *)&a->mem.reallocated.offset, sizeof (int));
#endif
}
}
@@ -325,19 +350,19 @@ _part_lookup_key_hash(const void *key, int key_length EINA_UNUSED)
if (a->stable)
{
#ifdef EFL64
- return eina_hash_int64((unsigned long long int *) &a->mem.dest, sizeof (void*));
+ return eina_hash_int64((unsigned long long int *)&a->mem.dest, sizeof (void *));
#else
- return eina_hash_int32((uintptr_t *) &a->mem.dest, sizeof (void*));
+ return eina_hash_int32((uintptr_t *)&a->mem.dest, sizeof (void *));
#endif
}
else
{
#ifdef EFL64
- return eina_hash_int64((unsigned long long int *) &a->mem.reallocated.base, sizeof (void*)) ^
- eina_hash_int32((unsigned int *) &a->mem.reallocated.offset, sizeof (int));
+ return eina_hash_int64((unsigned long long int *)&a->mem.reallocated.base, sizeof (void *)) ^
+ eina_hash_int32((unsigned int *)&a->mem.reallocated.offset, sizeof (int));
#else
- return eina_hash_int32((uintptr_t *) &a->mem.reallocated.base, sizeof (void*)) ^
- eina_hash_int32((unsigned int *) &a->mem.reallocated.offset, sizeof (int));
+ return eina_hash_int32((uintptr_t *)&a->mem.reallocated.base, sizeof (void *)) ^
+ eina_hash_int32((unsigned int *)&a->mem.reallocated.offset, sizeof (int));
#endif
}
}
@@ -378,16 +403,16 @@ check_image_part_desc(Edje_Part_Collection *pc, Edje_Part *ep,
if (epd->image.id == -1 && epd->common.visible)
WRN("Collection %s(%i): image attributes missing for "
- "part \"%s\", description \"%s\" %f",
- pc->part, pc->id, ep->name, epd->common.state.name, epd->common.state.value);
+ "part \"%s\", description \"%s\" %f",
+ pc->part, pc->id, ep->name, epd->common.state.name, epd->common.state.value);
for (i = 0; i < epd->image.tweens_count; ++i)
{
- if (epd->image.tweens[i]->id == -1)
- error_and_abort(ef, "Collection %i: tween image id missing for "
- "part \"%s\", description \"%s\" %f",
- pc->id, ep->name, epd->common.state.name, epd->common.state.value);
- }
+ if (epd->image.tweens[i]->id == -1)
+ error_and_abort(ef, "Collection %i: tween image id missing for "
+ "part \"%s\", description \"%s\" %f",
+ pc->id, ep->name, epd->common.state.name, epd->common.state.value);
+ }
}
static Edje_Part_Collection *
@@ -453,7 +478,6 @@ check_text_part_desc(Edje_Part_Collection *pc, Edje_Part *ep,
if (epd->text.id_text_source != -1)
{
-
if ((pc->parts[epd->text.id_text_source]->type == EDJE_PART_TYPE_TEXT) ||
(pc->parts[epd->text.id_text_source]->type == EDJE_PART_TYPE_TEXTBLOCK))
return;
@@ -468,7 +492,7 @@ check_text_part_desc(Edje_Part_Collection *pc, Edje_Part *ep,
error_and_abort(ef, "Collection \"%s\" Part \"%s\" Description \"%s\" [%.3f]: "
"text.text_source point to a non TEXT part \"%s\"!",
- pc->part, ep->name,epd->common.state.name,
+ pc->part, ep->name, epd->common.state.name,
epd->common.state.value, pc->parts[epd->text.id_text_source]->name);
}
}
@@ -503,9 +527,9 @@ check_source_links(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef, Eina_L
{
if (data == pc_source->parts[i]->source)
{
- error_and_abort(ef,"Recursive loop group '%s' "
- "already included inside "
- "part '%s' of group '%s'",
+ error_and_abort(ef, "Recursive loop group '%s' "
+ "already included inside "
+ "part '%s' of group '%s'",
data, pc_source->parts[i]->name,
pc->part);
}
@@ -525,14 +549,14 @@ check_packed_items(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef)
for (i = 0; i < ep->items_count; ++i)
{
- if (ep->items[i]->type == EDJE_PART_TYPE_GROUP && !ep->items[i]->source)
- error_and_abort(ef, "Collection %i: missing source on packed item "
- "of type GROUP in part \"%s\"",
- pc->id, ep->name);
- if (ep->type == EDJE_PART_TYPE_TABLE && (ep->items[i]->col < 0 || ep->items[i]->row < 0))
- error_and_abort(ef, "Collection %i: missing col/row on packed item "
- "for part \"%s\" of type TABLE",
- pc->id, ep->name);
+ if (ep->items[i]->type == EDJE_PART_TYPE_GROUP && !ep->items[i]->source)
+ error_and_abort(ef, "Collection %i: missing source on packed item "
+ "of type GROUP in part \"%s\"",
+ pc->id, ep->name);
+ if (ep->type == EDJE_PART_TYPE_TABLE && (ep->items[i]->col < 0 || ep->items[i]->row < 0))
+ error_and_abort(ef, "Collection %i: missing col/row on packed item "
+ "for part \"%s\" of type TABLE",
+ pc->id, ep->name);
}
}
@@ -565,8 +589,38 @@ check_state(Edje_Part_Collection *pc, Edje_Part *ep, Edje_Part_Description_Commo
}
static void
+_part_namespace_verify(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef, Eina_Bool ns_required)
+{
+ char buf[1024], *p;
+ size_t len;
+ Edje_Part_Collection_Directory_Entry *de;
+
+ if (!namespace_verify) return;
+ /* this is from a group used as a source, either GROUP or TEXTBLOCK
+ * namespacing not required
+ */
+ if (eina_hash_find(groups_sourced, pc->part)) return;
+
+ de = eina_hash_find(edje_collections_lookup, &pc->id);
+
+ p = strchr(de->entry, '/');
+ if (!p) return;
+
+ len = p - de->entry;
+ if (eina_strlcpy(buf, de->entry, len + 1) >= sizeof(buf)) return;
+
+ p = strchr(ep->name, '.');
+ /* ignore part types without required namespacing or without '.' in name */
+ if ((!ns_required) && (!p)) return;
+
+ if (strncmp(ep->name, buf, len))
+ error_and_abort(ef, "Part '%s' from group %s is not properly namespaced (should begin with '%s.')!", ep->name, de->entry, buf);
+}
+
+static void
check_part(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef)
{
+ Edje_Part_Collection_Parser *pcp = (Edje_Part_Collection_Parser*)pc;
unsigned int i;
Eina_List *group_path = NULL;
/* FIXME: check image set and sort them. */
@@ -580,10 +634,10 @@ check_part(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef)
if (ep->type == EDJE_PART_TYPE_IMAGE)
{
- check_image_part_desc(pc, ep, (Edje_Part_Description_Image*) ep->default_desc, ef);
+ check_image_part_desc(pc, ep, (Edje_Part_Description_Image *)ep->default_desc, ef);
for (i = 0; i < ep->other.desc_count; ++i)
- check_image_part_desc(pc, ep, (Edje_Part_Description_Image*) ep->other.desc[i], ef);
+ check_image_part_desc(pc, ep, (Edje_Part_Description_Image *)ep->other.desc[i], ef);
}
else if ((ep->type == EDJE_PART_TYPE_BOX) ||
(ep->type == EDJE_PART_TYPE_TABLE))
@@ -592,12 +646,29 @@ check_part(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef)
check_source_links(pc, ep, ef, group_path);
else if (ep->type == EDJE_PART_TYPE_TEXT)
{
- check_text_part_desc(pc, ep, (Edje_Part_Description_Text*) ep->default_desc, ef);
+ check_text_part_desc(pc, ep, (Edje_Part_Description_Text *)ep->default_desc, ef);
for (i = 0; i < ep->other.desc_count; ++i)
- check_text_part_desc(pc, ep, (Edje_Part_Description_Text*) ep->other.desc[i], ef);
+ check_text_part_desc(pc, ep, (Edje_Part_Description_Text *)ep->other.desc[i], ef);
}
+ if (!pcp->skip_namespace_validation)
+ {
+ switch (ep->type)
+ {
+ case EDJE_PART_TYPE_BOX:
+ case EDJE_PART_TYPE_TABLE:
+ case EDJE_PART_TYPE_SWALLOW:
+ _part_namespace_verify(pc, ep, ef, 1);
+ break;
+ case EDJE_PART_TYPE_TEXT:
+ case EDJE_PART_TYPE_TEXTBLOCK:
+ case EDJE_PART_TYPE_SPACER:
+ _part_namespace_verify(pc, ep, ef, 0);
+ break;
+ default: break;
+ }
+ }
/* FIXME: When smart masks are supported, remove this check */
if (ep->clip_to_id != -1 &&
@@ -609,8 +680,36 @@ check_part(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef)
}
static void
+_program_signal_namespace_verify(Edje_Part_Collection *pc, Eet_File *ef, const char *sig, const char *src)
+{
+ char buf[1024], *p;
+ size_t len;
+ Edje_Part_Collection_Directory_Entry *de;
+
+ if (!namespace_verify) return;
+ /* this is from a group used as a source, either GROUP or TEXTBLOCK
+ * namespacing not required
+ */
+ if (eina_hash_find(groups_sourced, pc->part)) return;
+
+ /* ignore propagation to GROUP parts */
+ if (strchr(sig, ':')) return;
+
+ de = eina_hash_find(edje_collections_lookup, &pc->id);
+
+ p = strchr(de->entry, '/');
+ if (!p) return;
+ len = p - de->entry;
+ if (eina_strlcpy(buf, de->entry, len + 1) >= sizeof(buf)) return;
+
+ if (strncmp(sig, buf, len))
+ error_and_abort(ef, "SIGNAL_EMIT (%s:%s) does not match group namespace (%s)!", sig, src, de->entry);
+}
+
+static void
check_program(Edje_Part_Collection *pc, Edje_Program *ep, Eet_File *ef)
{
+ Edje_Part_Collection_Parser *pcp = (Edje_Part_Collection_Parser*)pc;
switch (ep->action)
{
case EDJE_ACTION_TYPE_STATE_SET:
@@ -618,12 +717,13 @@ check_program(Edje_Part_Collection *pc, Edje_Program *ep, Eet_File *ef)
case EDJE_ACTION_TYPE_DRAG_VAL_SET:
case EDJE_ACTION_TYPE_DRAG_VAL_STEP:
case EDJE_ACTION_TYPE_DRAG_VAL_PAGE:
- if (!ep->targets)
- error_and_abort(ef, "Collection %i: target missing in program "
- "\"%s\"", pc->id, ep->name);
- break;
+ if (!ep->targets)
+ error_and_abort(ef, "Collection %i: target missing in program "
+ "\"%s\"", pc->id, ep->name);
+ break;
+
default:
- break;
+ break;
}
Edje_Program_Target *et;
Eina_List *l;
@@ -636,6 +736,12 @@ check_program(Edje_Part_Collection *pc, Edje_Program *ep, Eet_File *ef)
camera_id = i;
}
+ if ((!ep->targets) && (ep->action == EDJE_ACTION_TYPE_SIGNAL_EMIT))
+ {
+ if (!pcp->skip_namespace_validation)
+ _program_signal_namespace_verify(pc, ef, ep->state, ep->state2);
+ }
+
EINA_LIST_FOREACH(ep->targets, l, et)
{
if (((ep->action == EDJE_ACTION_TYPE_STATE_SET) ||
@@ -660,22 +766,22 @@ _alias_clean(Edje_Part_Collection_Directory_Entry *ce)
{
if (ce)
{
- ce->count.RECTANGLE = 0;
- ce->count.TEXT = 0;
- ce->count.IMAGE = 0;
- ce->count.SWALLOW = 0;
- ce->count.TEXTBLOCK = 0;
- ce->count.GROUP = 0;
- ce->count.BOX = 0;
- ce->count.TABLE = 0;
- ce->count.EXTERNAL = 0;
- ce->count.PROXY = 0;
- ce->count.MESH_NODE = 0;
- ce->count.LIGHT = 0;
- ce->count.CAMERA = 0;
- ce->count.SPACER = 0;
- ce->count.VECTOR = 0;
- ce->count.part = 0;
+ ce->count.RECTANGLE = 0;
+ ce->count.TEXT = 0;
+ ce->count.IMAGE = 0;
+ ce->count.SWALLOW = 0;
+ ce->count.TEXTBLOCK = 0;
+ ce->count.GROUP = 0;
+ ce->count.BOX = 0;
+ ce->count.TABLE = 0;
+ ce->count.EXTERNAL = 0;
+ ce->count.PROXY = 0;
+ ce->count.MESH_NODE = 0;
+ ce->count.LIGHT = 0;
+ ce->count.CAMERA = 0;
+ ce->count.SPACER = 0;
+ ce->count.VECTOR = 0;
+ ce->count.part = 0;
}
}
@@ -688,15 +794,15 @@ data_thread_head(void *data, Ecore_Thread *thread EINA_UNUSED)
if (edje_file)
{
- if (edje_file->collection)
- {
- Edje_Part_Collection_Directory_Entry *ce;
+ if (edje_file->collection)
+ {
+ Edje_Part_Collection_Directory_Entry *ce;
- EINA_LIST_FREE(aliases, ce)
- {
- Edje_Part_Collection_Directory_Entry *sce;
+ EINA_LIST_FREE(aliases, ce)
+ {
+ Edje_Part_Collection_Directory_Entry *sce;
- if (!ce->entry)
+ if (!ce->entry)
{
snprintf(buf, sizeof(buf),
"Collection %i: name missing.", ce->id);
@@ -704,12 +810,12 @@ data_thread_head(void *data, Ecore_Thread *thread EINA_UNUSED)
return;
}
- sce = eina_hash_find(edje_collections_lookup, &ce->id);
- if (sce)
+ sce = eina_hash_find(edje_collections_lookup, &ce->id);
+ if (sce)
{
memcpy(&ce->count, &sce->count, sizeof (ce->count));
}
- else
+ else
{
snprintf(buf, sizeof(buf),
"Collection %s (%i) can't find an correct alias.",
@@ -719,12 +825,12 @@ data_thread_head(void *data, Ecore_Thread *thread EINA_UNUSED)
}
_alias_clean(ce);
- eina_hash_direct_add(edje_file->collection, ce->entry, ce);
- }
- }
- bytes = eet_data_write(hw->ef, edd_edje_file, "edje/file", edje_file,
+ eina_hash_direct_add(edje_file->collection, ce->entry, ce);
+ }
+ }
+ bytes = eet_data_write(hw->ef, edd_edje_file, "edje/file", edje_file,
compress_mode);
- if (bytes <= 0)
+ if (bytes <= 0)
{
snprintf(buf, sizeof(buf),
"Unable to write \"edje_file\" entry to \"%s\"",
@@ -743,20 +849,19 @@ data_thread_head_end(void *data, Ecore_Thread *thread EINA_UNUSED)
{
Head_Write *hw = data;
- pending_threads--;
- if (pending_threads <= 0) ecore_main_loop_quit();
if (hw->errstr)
{
error_and_abort(hw->ef, hw->errstr);
free(hw->errstr);
}
free(hw);
+ thread_end(0);
}
static void
data_write_header(Eet_File *ef)
{
- Head_Write *hw;
+ Head_Write *hw;
hw = calloc(1, sizeof(Head_Write));
hw->ef = ef;
@@ -785,7 +890,7 @@ data_thread_fonts(void *data, Ecore_Thread *thread EINA_UNUSED)
f = eina_file_open(fc->fn->file, 0);
if (f)
{
- using_file(fc->fn->file, 'F');
+ using_file(fc->fn->file, 'F');
m = eina_file_map_all(f, EINA_FILE_SEQUENTIAL);
}
else
@@ -798,7 +903,7 @@ data_thread_fonts(void *data, Ecore_Thread *thread EINA_UNUSED)
f = eina_file_open(buf, 0);
if (f)
{
- using_file(buf, 'F');
+ using_file(buf, 'F');
m = eina_file_map_all(f, EINA_FILE_SEQUENTIAL);
if (m) break;
eina_file_close(f);
@@ -843,14 +948,13 @@ static void
data_thread_fonts_end(void *data, Ecore_Thread *thread EINA_UNUSED)
{
Fonts_Write *fc = data;
- pending_threads--;
- if (pending_threads <= 0) ecore_main_loop_quit();
if (fc->errstr)
{
error_and_abort(fc->ef, fc->errstr);
free(fc->errstr);
}
free(fc);
+ thread_end(0);
}
static void
@@ -891,82 +995,82 @@ error_and_abort_image_load_error(Eet_File *ef, const char *file, int error)
if (error == EVAS_LOAD_ERROR_DOES_NOT_EXIST)
{
- snprintf
- (hint, sizeof(hint),
- " Check if path to file \"%s\" is correct "
- "(both directory and file name).",
- file);
+ snprintf
+ (hint, sizeof(hint),
+ " Check if path to file \"%s\" is correct "
+ "(both directory and file name).",
+ file);
}
else if (error == EVAS_LOAD_ERROR_CORRUPT_FILE)
{
- snprintf
- (hint, sizeof(hint),
- " Check if file \"%s\" is consistent.",
- file);
+ snprintf
+ (hint, sizeof(hint),
+ " Check if file \"%s\" is consistent.",
+ file);
}
else if (error == EVAS_LOAD_ERROR_UNKNOWN_FORMAT)
{
- const char *ext = strrchr(file, '.');
- const char **itr, *known_loaders[] = {
- /* list from evas_image_load.c */
- "png",
- "jpg",
- "jpeg",
- "jfif",
- "eet",
- "edj",
- "eap",
- "edb",
- "xpm",
- "tiff",
- "tif",
- "svg",
- "svgz",
- "gif",
- "pbm",
- "pgm",
- "ppm",
- "pnm",
- "bmp",
- "ico",
- "tga",
- "tgv",
- NULL
- };
-
- if (!ext)
- {
- snprintf
- (hint, sizeof(hint),
- " File \"%s\" does not have an extension, "
- "maybe it should?",
- file);
- goto show_err;
- }
-
- ext++;
- for (itr = known_loaders; *itr; itr++)
- {
- if (strcasecmp(ext, *itr) == 0)
- {
- snprintf
- (hint, sizeof(hint),
- " Check if Evas was compiled with %s module enabled and "
- "all required dependencies exist.",
- ext);
- goto show_err;
- }
- }
-
- snprintf(hint, sizeof(hint),
- " Check if Evas supports loading files of type \"%s\" (%s) "
- "and this module was compiled and all its dependencies exist.",
- ext, file);
- }
- show_err:
+ const char *ext = strrchr(file, '.');
+ const char **itr, *known_loaders[] = {
+ /* list from evas_image_load.c */
+ "png",
+ "jpg",
+ "jpeg",
+ "jfif",
+ "eet",
+ "edj",
+ "eap",
+ "edb",
+ "xpm",
+ "tiff",
+ "tif",
+ "svg",
+ "svgz",
+ "gif",
+ "pbm",
+ "pgm",
+ "ppm",
+ "pnm",
+ "bmp",
+ "ico",
+ "tga",
+ "tgv",
+ NULL
+ };
+
+ if (!ext)
+ {
+ snprintf
+ (hint, sizeof(hint),
+ " File \"%s\" does not have an extension, "
+ "maybe it should?",
+ file);
+ goto show_err;
+ }
+
+ ext++;
+ for (itr = known_loaders; *itr; itr++)
+ {
+ if (strcasecmp(ext, *itr) == 0)
+ {
+ snprintf
+ (hint, sizeof(hint),
+ " Check if Evas was compiled with %s module enabled and "
+ "all required dependencies exist.",
+ ext);
+ goto show_err;
+ }
+ }
+
+ snprintf(hint, sizeof(hint),
+ " Check if Evas supports loading files of type \"%s\" (%s) "
+ "and this module was compiled and all its dependencies exist.",
+ ext, file);
+ }
+show_err:
error_and_abort
(ef, "Unable to load image \"%s\" used by file \"%s\": %s.%s",
- file, file_out, errmsg, hint);
+ file, file_out, errmsg, hint);
}
static void
@@ -987,27 +1091,27 @@ data_thread_image(void *data, Ecore_Thread *thread EINA_UNUSED)
qual = 80;
if ((iw->img->source_type == EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT) &&
(iw->img->source_param == 0))
- mode = 0; /* RAW */
+ mode = 0; /* RAW */
else if ((iw->img->source_type == EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT) &&
(iw->img->source_param == 1))
- mode = 1; /* COMPRESS */
+ mode = 1; /* COMPRESS */
else if (iw->img->source_type == EDJE_IMAGE_SOURCE_TYPE_INLINE_LOSSY_ETC1)
- mode = 3; /* LOSSY_ETC1 */
+ mode = 3; /* LOSSY_ETC1 */
else if (iw->img->source_type == EDJE_IMAGE_SOURCE_TYPE_INLINE_LOSSY_ETC2)
- mode = 4; /* LOSSY_ETC2 */
+ mode = 4; /* LOSSY_ETC2 */
else
- mode = 2; /* LOSSY */
+ mode = 2; /* LOSSY */
if ((mode == 0) && (no_raw))
{
mode = 1; /* promote compression */
iw->img->source_param = 95;
}
- if ((mode == 4) && (no_etc2)) mode = 2; /* demote etc2 to jpeg */
- if ((mode == 3) && (no_etc1)) mode = 2; /* demote etc1 to jpeg */
- if ((mode == 2) && (no_lossy)) mode = 1; /* demote compression */
+ if ((mode == 4) && (no_etc2)) mode = 2; /* demote etc2 to jpeg */
+ if ((mode == 3) && (no_etc1)) mode = 2; /* demote etc1 to jpeg */
+ if ((mode == 2) && (no_lossy)) mode = 1; /* demote compression */
if ((mode == 1) && (no_comp))
{
- if (no_lossy) mode = 0; /* demote compression */
+ if (no_lossy) mode = 0; /* demote compression */
else if (no_raw)
{
iw->img->source_param = 90;
@@ -1023,7 +1127,7 @@ data_thread_image(void *data, Ecore_Thread *thread EINA_UNUSED)
}
if (iw->alpha)
{
- start = (unsigned int *) iw->data;
+ start = (unsigned int *)iw->data;
end = start + (iw->w * iw->h);
while (start < end)
{
@@ -1100,7 +1204,7 @@ data_thread_image(void *data, Ecore_Thread *thread EINA_UNUSED)
bytes, (bytes + 512) / 1024, buf, iw->img->entry,
100 - (100 * (double)bytes) / ((double)(iw->w * iw->h * 4)),
100 - (100 * (double)bytes) / ((double)(st.st_size))
- );
+ );
}
}
}
@@ -1110,8 +1214,6 @@ data_thread_image_end(void *data, Ecore_Thread *thread EINA_UNUSED)
{
Image_Write *iw = data;
- pending_threads--;
- if (pending_threads <= 0) ecore_main_loop_quit();
if (iw->errstr)
{
error_and_abort(iw->ef, iw->errstr);
@@ -1120,6 +1222,7 @@ data_thread_image_end(void *data, Ecore_Thread *thread EINA_UNUSED)
free(iw->path);
evas_object_del(iw->im);
free(iw);
+ thread_end(1);
}
static void
@@ -1157,8 +1260,6 @@ tgv_file_thread_end(void *data, Ecore_Thread *thread EINA_UNUSED)
{
Image_Write *iw = data;
- pending_threads--;
- if (pending_threads <= 0) ecore_main_loop_quit();
if (iw->errstr)
{
error_and_abort(iw->ef, iw->errstr);
@@ -1169,10 +1270,11 @@ tgv_file_thread_end(void *data, Ecore_Thread *thread EINA_UNUSED)
eina_file_map_free(iw->f, iw->data);
eina_file_close(iw->f);
free(iw);
+ thread_end(1);
}
static Eina_Bool
-tgv_file_check_and_add(Eet_File *ef, Edje_Image_Directory_Entry *img, int *image_num)
+tgv_file_check_and_add(Eet_File *ef, Edje_Image_Directory_Entry *img)
{
Emile_Image_Load_Error err;
Emile_Image *emi = NULL;
@@ -1212,7 +1314,7 @@ tgv_file_check_and_add(Eet_File *ef, Edje_Image_Directory_Entry *img, int *image
iw->ef = ef;
iw->img = img;
iw->emi = emi;
- iw->data = (unsigned int *) data;
+ iw->data = (unsigned int *)data;
iw->w = iw->prop.w;
iw->h = iw->prop.h;
@@ -1238,10 +1340,10 @@ tgv_file_check_and_add(Eet_File *ef, Edje_Image_Directory_Entry *img, int *image
goto on_error;
}
- *image_num += 1;
+ image_num += 1;
iw->path = strdup(img->entry);
- pending_threads++;
+ pending_image_threads++;
if (threads)
ecore_thread_run(tgv_file_thread, tgv_file_thread_end, NULL, iw);
else
@@ -1270,17 +1372,16 @@ data_write_vectors(Eet_File *ef, int *vector_num)
Edje_Vector_Directory_Entry *vector;
Eina_Strbuf *buf;
Eina_Bool found = EINA_FALSE;
- Ecore_Evas *ee;
Evas *evas;
Evas_Object *vg;
if (!((edje_file) && (edje_file->image_dir))) return;
- ecore_evas_init();
- ee = ecore_evas_buffer_new(1, 1);
- if (!ee)
+ if (!buffer_ee)
+ buffer_ee = ecore_evas_buffer_new(1, 1);
+ if (!buffer_ee)
error_and_abort(ef, "Cannot create buffer engine canvas for image load.");
- evas = ecore_evas_get(ee);
+ evas = ecore_evas_get(buffer_ee);
vg = evas_object_vg_add(evas);
buf = eina_strbuf_new();
for (i = 0; i < edje_file->image_dir->vectors_count; i++)
@@ -1317,22 +1418,43 @@ data_write_vectors(Eet_File *ef, int *vector_num)
}
static void
-data_write_images(Eet_File *ef, int *image_num)
+data_image_sets_init(void)
{
int i;
- Ecore_Evas *ee;
+
+ if (!((edje_file) && (edje_file->image_dir))) return;
+ for (i = 0; i < (int)edje_file->image_dir->sets_count; i++)
+ {
+ Edje_Image_Directory_Set *set;
+ Edje_Image_Directory_Set_Entry *set_entry;
+ Edje_Image_Directory_Entry *img;
+ Eina_List *ll = NULL;
+
+ set = edje_file->image_dir->sets + i;
+ if (!set->entries) continue;
+ EINA_LIST_FOREACH(set->entries, ll, set_entry)
+ {
+ img = &edje_file->image_dir->entries[set_entry->id];
+ set_entry->name = img->entry;
+ }
+ }
+}
+
+static void
+data_write_images(void)
+{
Evas *evas;
const char *ext = NULL;
if (!((edje_file) && (edje_file->image_dir))) return;
- ecore_evas_init();
- ee = ecore_evas_buffer_new(1, 1);
- if (!ee)
- error_and_abort(ef, "Cannot create buffer engine canvas for image load.");
- evas = ecore_evas_get(ee);
+ if (!buffer_ee)
+ buffer_ee = ecore_evas_buffer_new(1, 1);
+ if (!buffer_ee)
+ error_and_abort(cur_ef, "Cannot create buffer engine canvas for image load.");
+ evas = ecore_evas_get(buffer_ee);
- for (i = 0; i < (int)edje_file->image_dir->entries_count; i++)
+ for (; cur_image_entry < (int)edje_file->image_dir->entries_count; cur_image_entry++)
{
Edje_Image_Directory_Entry *img;
Evas_Object *im;
@@ -1341,8 +1463,8 @@ data_write_images(Eet_File *ef, int *image_num)
int load_err = EVAS_LOAD_ERROR_NONE;
Image_Write *iw;
- img = &edje_file->image_dir->entries[i];
- if ((img->source_type == EDJE_IMAGE_SOURCE_TYPE_EXTERNAL) || !img->entry)
+ img = &edje_file->image_dir->entries[cur_image_entry];
+ if ((img->source_type >= EDJE_IMAGE_SOURCE_TYPE_USER) || !img->entry)
continue;
if (img->source_type == EDJE_IMAGE_SOURCE_TYPE_INLINE_LOSSY_ETC1 ||
@@ -1351,7 +1473,7 @@ data_write_images(Eet_File *ef, int *image_num)
ext = strrchr(img->entry, '.');
if (ext && !strcasecmp(ext, ".tgv"))
{
- if (tgv_file_check_and_add(ef, img, image_num))
+ if (tgv_file_check_and_add(cur_ef, img))
{
DBG("Directly copying data from TGV file into EDJ");
continue;
@@ -1362,7 +1484,7 @@ data_write_images(Eet_File *ef, int *image_num)
}
iw = calloc(1, sizeof(Image_Write));
- iw->ef = ef;
+ iw->ef = cur_ef;
iw->img = img;
iw->im = im = evas_object_image_add(evas);
if (threads)
@@ -1379,9 +1501,9 @@ data_write_images(Eet_File *ef, int *image_num)
load_err = evas_object_image_load_error_get(im);
if (load_err == EVAS_LOAD_ERROR_NONE)
{
- *image_num += 1;
+ image_num += 1;
iw->path = strdup(buf);
- pending_threads++;
+ pending_image_threads++;
if (threads)
evas_object_image_preload(im, 0);
using_file(buf, 'I');
@@ -1396,9 +1518,9 @@ data_write_images(Eet_File *ef, int *image_num)
load_err = evas_object_image_load_error_get(im);
if (load_err == EVAS_LOAD_ERROR_NONE)
{
- *image_num += 1;
+ image_num += 1;
iw->path = strdup(img->entry);
- pending_threads++;
+ pending_image_threads++;
if (threads)
evas_object_image_preload(im, 0);
using_file(img->entry, 'I');
@@ -1408,11 +1530,12 @@ data_write_images(Eet_File *ef, int *image_num)
else
{
free(iw);
- error_and_abort_image_load_error(ef, img->entry, load_err);
+ error_and_abort_image_load_error(cur_ef, img->entry, load_err);
exit(1); // ensure static analysis tools know we exit
}
}
- if (img->source_type != EDJE_IMAGE_SOURCE_TYPE_EXTERNAL)
+
+ if (img->source_type < EDJE_IMAGE_SOURCE_TYPE_USER)
{
ext = strrchr(img->entry, '.');
if (ext && (!strcasecmp(ext, ".svg") || !strcasecmp(ext, ".svgz")))
@@ -1425,21 +1548,9 @@ data_write_images(Eet_File *ef, int *image_num)
img->entry = tmp;
}
}
- }
-
- for (i = 0; i < (int)edje_file->image_dir->sets_count; i++)
- {
- Edje_Image_Directory_Set *set;
- Edje_Image_Directory_Set_Entry *set_entry;
- Edje_Image_Directory_Entry *img;
- Eina_List *ll = NULL;
-
- set = edje_file->image_dir->sets + i;
- if (!set->entries) continue;
- EINA_LIST_FOREACH(set->entries, ll, set_entry)
+ if (threads)
{
- img = &edje_file->image_dir->entries[set_entry->id];
- set_entry->name = img->entry;
+ if (pending_threads + pending_image_threads > (int)max_open_files - 2) break;
}
}
}
@@ -1467,7 +1578,6 @@ data_check_models(Eet_File *ef EINA_UNUSED, int *model_num EINA_UNUSED)
snprintf(buf, sizeof(buf), "%s/%s", s, model->entry);
file_exist = file_exist || ecore_file_exists(buf);
-
}
if (!file_exist)
{
@@ -1564,9 +1674,8 @@ static void
data_thread_sounds_end(void *data, Ecore_Thread *thread EINA_UNUSED)
{
Sound_Write *sw = data;
- pending_threads--;
- if (pending_threads <= 0) ecore_main_loop_quit();
free(sw);
+ thread_end(0);
}
static void
@@ -1629,51 +1738,49 @@ data_thread_mo(void *data, Ecore_Thread *thread EINA_UNUSED)
if (!f)
{
- snprintf(buf, sizeof(buf), "Unable to load mo data of: %s", mo_path);
- ERR("%s", buf);
- mw->errstr = strdup(buf);
- exit(-1);
+ snprintf(buf, sizeof(buf), "Unable to load mo data of: %s", mo_path);
+ ERR("%s", buf);
+ mw->errstr = strdup(buf);
+ exit(-1);
}
snprintf(moid_str, sizeof(moid_str), "edje/mo/%i/%s/LC_MESSAGES", mw->mo_entry->id, mw->mo_entry->locale);
m = eina_file_map_all(f, EINA_FILE_WILLNEED);
if (m)
{
- bytes = eet_write(mw->ef, moid_str, m, eina_file_size_get(f), EET_COMPRESSION_NONE);
- if (eina_file_map_faulted(f, m))
- {
- snprintf(buf, sizeof(buf), "File access error when reading '%s'",
- eina_file_filename_get(f));
- ERR("%s", buf);
- mw->errstr = strdup(buf);
- eina_file_close(f);
- exit(-1);
- }
- eina_file_map_free(f, m);
+ bytes = eet_write(mw->ef, moid_str, m, eina_file_size_get(f), EET_COMPRESSION_NONE);
+ if (eina_file_map_faulted(f, m))
+ {
+ snprintf(buf, sizeof(buf), "File access error when reading '%s'",
+ eina_file_filename_get(f));
+ ERR("%s", buf);
+ mw->errstr = strdup(buf);
+ eina_file_close(f);
+ exit(-1);
+ }
+ eina_file_map_free(f, m);
}
eina_file_close(f);
if (mw->mo_path)
ecore_file_remove(mo_path);
INF("Wrote %9i bytes (%4iKb) for \"%s\" %s mo entry \"%s\"",
- bytes, (bytes + 512) / 1024, moid_str, "RAW PCM", mw->mo_entry->locale);
-
+ bytes, (bytes + 512) / 1024, moid_str, "RAW PCM", mw->mo_entry->locale);
}
static void
data_thread_mo_end(void *data, Ecore_Thread *thread EINA_UNUSED)
{
Mo_Write *mw = data;
- pending_threads--;
- if (pending_threads <= 0) ecore_main_loop_quit();
if (mw->errstr)
{
- error_and_abort(mw->ef, mw->errstr);
- free(mw->errstr);
+ error_and_abort(mw->ef, mw->errstr);
+ free(mw->errstr);
}
if (mw->mo_path)
free(mw->mo_path);
free(mw);
+ thread_end(0);
}
Eina_Bool
@@ -1700,7 +1807,7 @@ _exe_del_cb(void *data EINA_UNUSED, int evtype EINA_UNUSED, void *evinfo)
}
else
return ECORE_CALLBACK_RENEW;
- if (pending_threads <= 0) ecore_main_loop_quit();
+ if (pending_threads + pending_image_threads <= 0) ecore_main_loop_quit();
return ECORE_CALLBACK_CANCEL;
}
@@ -1828,9 +1935,8 @@ static void
data_thread_vibrations_end(void *data, Ecore_Thread *thread EINA_UNUSED)
{
Vibration_Write *sw = data;
- pending_threads--;
- if (pending_threads <= 0) ecore_main_loop_quit();
free(sw);
+ thread_end(0);
}
static void
@@ -1861,6 +1967,7 @@ data_write_vibrations(Eet_File *ef, int *num)
}
}
}
+
static void
check_groups(Eet_File *ef)
{
@@ -1870,20 +1977,20 @@ check_groups(Eet_File *ef)
/* sanity checks for parts and programs */
EINA_LIST_FOREACH(edje_collections, l, pc)
{
- unsigned int i;
+ unsigned int i;
- for (i = 0; i < pc->parts_count; ++i)
- check_part(pc, pc->parts[i], ef);
+ for (i = 0; i < pc->parts_count; ++i)
+ check_part(pc, pc->parts[i], ef);
-#define CHECK_PROGRAM(Type, Pc, It) \
- for (It = 0; It < Pc->programs.Type ## _count; ++It) \
- check_program(Pc, Pc->programs.Type[i], ef); \
+#define CHECK_PROGRAM(Type, Pc, It) \
+ for (It = 0; It < Pc->programs.Type ## _count; ++It) \
+ check_program(Pc, Pc->programs.Type[i], ef); \
- CHECK_PROGRAM(fnmatch, pc, i);
- CHECK_PROGRAM(strcmp, pc, i);
- CHECK_PROGRAM(strncmp, pc, i);
- CHECK_PROGRAM(strrncmp, pc, i);
- CHECK_PROGRAM(nocmp, pc, i);
+ CHECK_PROGRAM(fnmatch, pc, i);
+ CHECK_PROGRAM(strcmp, pc, i);
+ CHECK_PROGRAM(strncmp, pc, i);
+ CHECK_PROGRAM(strrncmp, pc, i);
+ CHECK_PROGRAM(nocmp, pc, i);
}
}
@@ -1903,14 +2010,13 @@ static void
data_thread_group_end(void *data, Ecore_Thread *thread EINA_UNUSED)
{
Group_Write *gw = data;
- pending_threads--;
- if (pending_threads <= 0) ecore_main_loop_quit();
if (gw->errstr)
{
error_and_abort(gw->ef, gw->errstr);
free(gw->errstr);
}
free(gw);
+ thread_end(0);
}
static void
@@ -1949,7 +2055,7 @@ create_script_file(Eet_File *ef, const char *filename, const Code *cd, int fd)
FILE *f = fdopen(fd, "wb");
if (!f)
error_and_abort(ef, "Unable to open temp file \"%s\" for script "
- "compilation.", filename);
+ "compilation.", filename);
Eina_List *ll;
Code_Program *cp;
@@ -1959,63 +2065,65 @@ create_script_file(Eet_File *ef, const char *filename, const Code *cd, int fd)
if (cd->shared)
{
- while (ln < (cd->l1 - 1))
- {
- fprintf(f, " \n");
- ln++;
- }
- {
- char *sp;
- int hash = 0;
- int newlined = 0;
-
- for (sp = cd->shared; *sp; sp++)
- {
- if ((sp[0] == '#') && (newlined))
- {
- hash = 1;
- }
- newlined = 0;
- if (sp[0] == '\n') newlined = 1;
- if (!hash) fputc(sp[0], f);
- else if (sp[0] == '\n') hash = 0;
- }
- fputc('\n', f);
- }
- ln += cd->l2 - cd->l1 + 1;
+ while (ln < (cd->l1 - 1))
+ {
+ fprintf(f, " \n");
+ ln++;
+ }
+ {
+ char *sp;
+ int hash = 0;
+ int newlined = 0;
+
+ for (sp = cd->shared; *sp; sp++)
+ {
+ if ((sp[0] == '#') && (newlined))
+ {
+ hash = 1;
+ }
+ newlined = 0;
+ if (sp[0] == '\n') newlined = 1;
+ if (!hash) fputc(sp[0], f);
+ else if (sp[0] == '\n')
+ hash = 0;
+ }
+ fputc('\n', f);
+ }
+ ln += cd->l2 - cd->l1 + 1;
}
EINA_LIST_FOREACH(cd->programs, ll, cp)
{
- if (cp->script)
- {
- while (ln < (cp->l1 - 1))
- {
- fprintf(f, " \n");
- ln++;
- }
- /* FIXME: this prototype needs to be */
- /* formalised and set in stone */
- fprintf(f, "public _p%i(sig[], src[]) {", cp->id);
- {
- char *sp;
- int hash = 0;
- int newlined = 0;
-
- for (sp = cp->script; *sp; sp++)
- {
- if ((sp[0] == '#') && (newlined))
- {
- hash = 1;
- }
- newlined = 0;
- if (sp[0] == '\n') newlined = 1;
- if (!hash) fputc(sp[0], f);
- else if (sp[0] == '\n') hash = 0;
- }
- }
- fprintf(f, "}\n");
- ln += cp->l2 - cp->l1 + 1;
- }
+ if (cp->script)
+ {
+ while (ln < (cp->l1 - 1))
+ {
+ fprintf(f, " \n");
+ ln++;
+ }
+ /* FIXME: this prototype needs to be */
+ /* formalised and set in stone */
+ fprintf(f, "public _p%i(sig[], src[]) {", cp->id);
+ {
+ char *sp;
+ int hash = 0;
+ int newlined = 0;
+
+ for (sp = cp->script; *sp; sp++)
+ {
+ if ((sp[0] == '#') && (newlined))
+ {
+ hash = 1;
+ }
+ newlined = 0;
+ if (sp[0] == '\n') newlined = 1;
+ if (!hash) fputc(sp[0], f);
+ else if (sp[0] == '\n')
+ hash = 0;
+ }
+ }
+ fprintf(f, "}\n");
+ ln += cp->l2 - cp->l1 + 1;
+ }
}
fclose(f);
@@ -2029,7 +2137,7 @@ data_thread_script(void *data, Ecore_Thread *thread EINA_UNUSED)
int size;
char buf[PATH_MAX];
- f = fdopen(sc->tmpo_fd, "rb");
+ f = fopen(sc->tmpo, "rb");
if (!f)
{
snprintf(buf, sizeof(buf),
@@ -2045,11 +2153,11 @@ data_thread_script(void *data, Ecore_Thread *thread EINA_UNUSED)
if (size > 0)
{
- void *dat = malloc(size);
+ void *dat = malloc(size);
- if (dat)
- {
- if (fread(dat, size, 1, f) != 1)
+ if (dat)
+ {
+ if (fread(dat, size, 1, f) != 1)
{
snprintf(buf, sizeof(buf),
"Unable to read all of script object \"%s\"",
@@ -2059,11 +2167,11 @@ data_thread_script(void *data, Ecore_Thread *thread EINA_UNUSED)
fclose(f);
return;
}
- snprintf(buf, sizeof(buf), "edje/scripts/embryo/compiled/%i",
+ snprintf(buf, sizeof(buf), "edje/scripts/embryo/compiled/%i",
sc->i);
- eet_write(sc->ef, buf, dat, size, compress_mode);
- free(dat);
- }
+ eet_write(sc->ef, buf, dat, size, compress_mode);
+ free(dat);
+ }
else
{
snprintf(buf, sizeof(buf),
@@ -2104,13 +2212,11 @@ data_thread_script(void *data, Ecore_Thread *thread EINA_UNUSED)
eina_tmpstr_del(sc->tmpo);
// closed by fclose(f) in create_script_file()
// close(sc->tmpn_fd);
-// closed by fclose(f) above
-// close(sc->tmpo_fd);
}
typedef struct
{
- char *exe;
+ char *exe;
Script_Write *sc;
} Pending_Script_Write;
@@ -2125,14 +2231,13 @@ static void
data_thread_script_end(void *data, Ecore_Thread *thread EINA_UNUSED)
{
Script_Write *sc = data;
- pending_threads--;
- if (pending_threads <= 0) ecore_main_loop_quit();
if (sc->errstr)
{
error_and_abort(sc->ef, sc->errstr);
free(sc->errstr);
}
free(sc);
+ thread_end(0);
}
static Eina_Bool
@@ -2151,7 +2256,7 @@ data_scripts_exe_del_cb(void *data EINA_UNUSED, int evtype EINA_UNUSED, void *ev
Pending_Script_Write *pend = pending_script_writes->data;
pending_script_writes = eina_list_remove_list
- (pending_script_writes, pending_script_writes);
+ (pending_script_writes, pending_script_writes);
data_write_script_queue(pend->sc, pend->exe);
free(pend->exe);
free(pend);
@@ -2171,7 +2276,7 @@ data_scripts_exe_del_cb(void *data EINA_UNUSED, int evtype EINA_UNUSED, void *ev
data_thread_script(sc, NULL);
data_thread_script_end(sc, NULL);
}
- if (pending_threads <= 0) ecore_main_loop_quit();
+ if (pending_threads + pending_image_threads <= 0) ecore_main_loop_quit();
return ECORE_CALLBACK_CANCEL;
}
@@ -2224,39 +2329,40 @@ data_write_scripts(Eet_File *ef)
# define BIN_EXT
#endif
#ifdef NEED_RUN_IN_TREE
- if (getenv("EFL_RUN_IN_TREE"))
- {
- snprintf(embryo_cc_path, sizeof(embryo_cc_path),
- "%s/src/bin/embryo/embryo_cc" BIN_EXT,
- PACKAGE_BUILD_DIR);
- snprintf(inc_path, sizeof(inc_path),
- "%s/data/edje/include", PACKAGE_SRC_DIR);
- if (!ecore_file_exists(embryo_cc_path))
- embryo_cc_path[0] = '\0';
- }
+ if (getenv("EFL_RUN_IN_TREE"))
+ {
+ snprintf(embryo_cc_path, sizeof(embryo_cc_path),
+ "%s/src/bin/embryo/embryo_cc" BIN_EXT,
+ PACKAGE_BUILD_DIR);
+ snprintf(inc_path, sizeof(inc_path),
+ "%s/data/edje/include", PACKAGE_SRC_DIR);
+ if (!ecore_file_exists(embryo_cc_path))
+ embryo_cc_path[0] = '\0';
+ }
#endif
- if (embryo_cc_path[0] == '\0')
- {
- snprintf(embryo_cc_path, sizeof(embryo_cc_path),
- "%s/embryo_cc" BIN_EXT,
- eina_prefix_bin_get(pfx));
- snprintf(inc_path, sizeof(inc_path),
- "%s/include",
- eina_prefix_data_get(pfx));
- }
+ if (embryo_cc_path[0] == '\0')
+ {
+ snprintf(embryo_cc_path, sizeof(embryo_cc_path),
+ "%s/embryo_cc" BIN_EXT,
+ eina_prefix_bin_get(pfx));
+ snprintf(inc_path, sizeof(inc_path),
+ "%s/include",
+ eina_prefix_data_get(pfx));
+ }
#undef BIN_EXT
for (i = 0, l = codes; l; l = eina_list_next(l), i++)
{
- Code *cd = eina_list_data_get(l);
+ Code *cd = eina_list_data_get(l);
Script_Write *sc;
+ int fd;
char buf[EINA_PATH_MAX];
- if (cd->is_lua)
- continue;
- if ((!cd->shared) && (!cd->programs))
- continue;
+ if (cd->is_lua)
+ continue;
+ if ((!cd->shared) && (!cd->programs))
+ continue;
sc = calloc(1, sizeof(Script_Write));
sc->ef = ef;
sc->cd = cd;
@@ -2264,15 +2370,19 @@ data_write_scripts(Eet_File *ef)
sc->tmpn_fd = eina_file_mkstemp("edje_cc.sma-tmp-XXXXXX", &sc->tmpn);
if (sc->tmpn_fd < 0)
error_and_abort(ef, "Unable to open temp file \"%s\" for script "
- "compilation.", sc->tmpn);
- sc->tmpo_fd = eina_file_mkstemp("edje_cc.amx-tmp-XXXXXX", &sc->tmpo);
- if (sc->tmpo_fd < 0)
+ "compilation.", sc->tmpn);
+ fd = eina_file_mkstemp("edje_cc.amx-tmp-XXXXXX", &sc->tmpo);
+ if (fd < 0)
{
unlink(sc->tmpn);
eina_tmpstr_del(sc->tmpn);
error_and_abort(ef, "Unable to open temp file \"%s\" for script "
- "compilation.", sc->tmpo);
+ "compilation.", sc->tmpo);
}
+ //do not carry the fd over the time
+ //we should not unnesseserrily carry filedescriptors over time as this could excede system limits
+ //which have been fetched earlier
+ close(fd);
create_script_file(ef, sc->tmpn, cd, sc->tmpn_fd);
snprintf(buf, sizeof(buf),
"%s -i %s -o %s %s", embryo_cc_path, inc_path,
@@ -2288,7 +2398,6 @@ _edje_lua_script_writer(lua_State *L EINA_UNUSED, const void *chunk_buf, size_t
Script_Lua_Writer *data;
void *old;
-
data = (Script_Lua_Writer *)_data;
old = data->buf;
data->buf = realloc(data->buf, data->size + chunk_size);
@@ -2297,7 +2406,7 @@ _edje_lua_script_writer(lua_State *L EINA_UNUSED, const void *chunk_buf, size_t
memcpy(&((data->buf)[data->size]), chunk_buf, chunk_size);
data->size += chunk_size;
}
- else
+ else
{
ERR("Failed to copy chunk buffer.\n");
data->buf = old;
@@ -2305,6 +2414,7 @@ _edje_lua_script_writer(lua_State *L EINA_UNUSED, const void *chunk_buf, size_t
return 0;
}
+
#endif
void
@@ -2316,20 +2426,24 @@ _edje_lua_error_and_abort(lua_State *L, int err_code, Script_Write *sc)
switch (err_code)
{
case LUA_ERRRUN:
- err_type = "runtime";
- break;
+ err_type = "runtime";
+ break;
+
case LUA_ERRSYNTAX:
- err_type = "syntax";
- break;
+ err_type = "syntax";
+ break;
+
case LUA_ERRMEM:
- err_type = "memory allocation";
- break;
+ err_type = "memory allocation";
+ break;
+
case LUA_ERRERR:
- err_type = "error handler";
- break;
+ err_type = "error handler";
+ break;
+
default:
- err_type = "unknown";
- break;
+ err_type = "unknown";
+ break;
}
snprintf(buf, sizeof(buf),
"Lua %s error: %s", err_type, lua_tostring(L, -1));
@@ -2395,7 +2509,7 @@ data_thread_lua_script(void *data, Ecore_Thread *thread EINA_UNUSED)
}
luaL_pushresult(&b);
#ifdef LUA_BINARY
- if (err_code = luaL_loadstring(L, lua_tostring (L, -1)))
+ if (err_code = luaL_loadstring(L, lua_tostring(L, -1)))
{
_edje_lua_error_and_abort(L, err_code, sc);
return;
@@ -2412,10 +2526,10 @@ data_thread_lua_script(void *data, Ecore_Thread *thread EINA_UNUSED)
*/
/*
- if (luaL_loadbuffer(L, globbuf, globbufsize, "edje_lua_script"))
- printf("lua load error: %s\n", lua_tostring (L, -1));
- if (lua_pcall(L, 0, 0, 0))
- printf("lua call error: %s\n", lua_tostring (L, -1));
+ if (luaL_loadbuffer(L, globbuf, globbufsize, "edje_lua_script"))
+ printf("lua load error: %s\n", lua_tostring (L, -1));
+ if (lua_pcall(L, 0, 0, 0))
+ printf("lua call error: %s\n", lua_tostring (L, -1));
*/
snprintf(buf, sizeof(buf), "edje/scripts/lua/%i", sc->i);
@@ -2436,14 +2550,13 @@ static void
data_thread_lua_script_end(void *data, Ecore_Thread *thread EINA_UNUSED)
{
Script_Write *sc = data;
- pending_threads--;
- if (pending_threads <= 0) ecore_main_loop_quit();
if (sc->errstr)
{
error_and_abort(sc->ef, sc->errstr);
free(sc->errstr);
}
free(sc);
+ thread_end(0);
}
static void
@@ -2488,8 +2601,7 @@ data_thread_source(void *data, Ecore_Thread *thread EINA_UNUSED)
static void
data_thread_source_end(void *data EINA_UNUSED, Ecore_Thread *thread EINA_UNUSED)
{
- pending_threads--;
- if (pending_threads <= 0) ecore_main_loop_quit();
+ thread_end(0);
}
static void
@@ -2502,7 +2614,7 @@ data_thread_license(void *data, Ecore_Thread *thread EINA_UNUSED)
int bytes;
f = eina_file_open(lw->file, 0);
- if (!f) return ;
+ if (!f) return;
m = eina_file_map_all(f, EINA_FILE_WILLNEED);
if (!m) goto on_error;
@@ -2537,16 +2649,15 @@ data_thread_license(void *data, Ecore_Thread *thread EINA_UNUSED)
eina_file_map_free(f, m);
- on_error:
+on_error:
eina_file_close(f);
}
static void
data_thread_license_end(void *data, Ecore_Thread *thread EINA_UNUSED)
{
- pending_threads--;
- if (pending_threads <= 0) ecore_main_loop_quit();
free(data);
+ thread_end(0);
}
static void
@@ -2556,10 +2667,10 @@ data_write_license(Eet_File *ef)
Eina_List *l;
const char *file;
- if (!license) return ;
+ if (!license) return;
lw = calloc(1, sizeof (License_Write));
- if (!lw) return ;
+ if (!lw) return;
lw->ef = ef;
lw->file = license;
@@ -2577,7 +2688,7 @@ data_write_license(Eet_File *ef)
EINA_LIST_FOREACH(licenses, l, file)
{
lw = calloc(1, sizeof (License_Write));
- if (!lw) return ;
+ if (!lw) return;
lw->ef = ef;
lw->file = file;
@@ -2603,7 +2714,7 @@ data_thread_authors(void *data, Ecore_Thread *thread EINA_UNUSED)
int bytes;
f = eina_file_open(authors, 0);
- if (!f) return ;
+ if (!f) return;
m = eina_file_map_all(f, EINA_FILE_WILLNEED);
if (!m) goto on_error;
@@ -2625,15 +2736,14 @@ data_thread_authors(void *data, Ecore_Thread *thread EINA_UNUSED)
eina_file_map_free(f, m);
- on_error:
+on_error:
eina_file_close(f);
}
static void
data_thread_authors_end(void *data EINA_UNUSED, Ecore_Thread *thread EINA_UNUSED)
{
- pending_threads--;
- if (pending_threads <= 0) ecore_main_loop_quit();
+ thread_end(0);
}
static void
@@ -2646,8 +2756,7 @@ data_thread_fontmap(void *data, Ecore_Thread *thread EINA_UNUSED)
static void
data_thread_fontmap_end(void *data EINA_UNUSED, Ecore_Thread *thread EINA_UNUSED)
{
- pending_threads--;
- if (pending_threads <= 0) ecore_main_loop_quit();
+ thread_end(0);
}
void
@@ -2655,7 +2764,6 @@ data_write(void)
{
Eet_File *ef;
Eet_Error err;
- int image_num = 0;
int model_num = 0;
int sound_num = 0;
int mo_num = 0;
@@ -2667,15 +2775,15 @@ data_write(void)
if (!edje_file)
{
- ERR("No data to put in \"%s\"", file_out);
- exit(-1);
+ ERR("No data to put in \"%s\"", file_out);
+ exit(-1);
}
- ef = eet_open(file_out, EET_FILE_MODE_WRITE);
+ cur_ef = ef = eet_open(file_out, EET_FILE_MODE_WRITE);
if (!ef)
{
- ERR("Unable to open \"%s\" for writing output", file_out);
- exit(-1);
+ ERR("Unable to open \"%s\" for writing output", file_out);
+ exit(-1);
}
if ((edje_file->efl_version.major <= 1) && (edje_file->efl_version.minor <= 18)
@@ -2691,6 +2799,20 @@ data_write(void)
EFL_VERSION_MAJOR, EFL_VERSION_MINOR);
}
+ if (eina_array_count(requires))
+ {
+ int i = 0;
+
+ edje_file->requires_count = eina_array_count(requires);
+ edje_file->requires = mem_alloc(edje_file->requires_count * sizeof(void*));
+ do
+ {
+ edje_file->requires[i] = eina_array_pop(requires);
+ i++;
+ } while (eina_array_count(requires));
+ eina_array_free(requires);
+ }
+
check_groups(ef);
ecore_thread_max_set(ecore_thread_max_get() * 2);
@@ -2727,8 +2849,6 @@ data_write(void)
data_thread_fontmap_end(ef, NULL);
}
INF("fontmap: %3.5f", ecore_time_get() - t); t = ecore_time_get();
- data_write_images(ef, &image_num);
- INF("images: %3.5f", ecore_time_get() - t); t = ecore_time_get();
data_write_vectors(ef, &vector_num);
INF("vectors: %3.5f", ecore_time_get() - t); t = ecore_time_get();
data_check_models(ef, &model_num);
@@ -2754,10 +2874,21 @@ data_write(void)
data_thread_authors_end(ef, NULL);
}
}
+ data_write_images();
+ data_image_sets_init();
+ INF("images: %3.5f", ecore_time_get() - t); t = ecore_time_get();
pending_threads--;
- if (pending_threads > 0) ecore_main_loop_begin();
+ if (pending_threads + pending_image_threads > 0) ecore_main_loop_begin();
INF("THREADS: %3.5f", ecore_time_get() - t);
data_write_header(ef);
+ if (pending_threads + pending_image_threads > 0) ecore_main_loop_begin();
+ INF("THREADS: %3.5f", ecore_time_get() - t);
+
+ if (threads)
+ {
+ /* probably caught signal, exit immediately to avoid crash */
+ if (pending_threads + pending_image_threads > 0) exit(-1);
+ }
err = eet_close(ef);
if (err)
@@ -2793,9 +2924,9 @@ reorder_parts(void)
EINA_LIST_FOREACH(edje_collections, l, pc)
{
unsigned int i, j, k;
- Eina_Bool found = EINA_FALSE;
+ Eina_Bool found = EINA_FALSE;
- for (i = 0; i < pc->parts_count; i++)
+ for (i = 0; i < pc->parts_count; i++)
{
ep = (Edje_Part_Parser *)pc->parts[i];
if (ep->reorder.insert_before && ep->reorder.insert_after)
@@ -2858,7 +2989,7 @@ reorder_parts(void)
}
if (found)
{
- unsigned int amount, linked;
+ unsigned int amount, linked;
if (((i > k) && ((i - ep->reorder.linked_prev) <= k))
|| ((i < k) && ((i + ep->reorder.linked_next) >= k)))
@@ -2867,19 +2998,19 @@ reorder_parts(void)
amount = ep->reorder.linked_prev + ep->reorder.linked_next + 1;
linked = i - ep->reorder.linked_prev;
parts = malloc(amount * sizeof(Edje_Part *));
- for (j = 0 ; j < amount ; j++)
+ for (j = 0; j < amount; j++)
{
parts[j] = pc->parts[linked];
linked++;
}
if (i > k)
{
- for (j = i - ep->reorder.linked_prev ; j > k; j--)
+ for (j = i - ep->reorder.linked_prev; j > k; j--)
{
pc->parts[j + amount - 1] = pc->parts[j - 1];
pc->parts[j + amount - 1]->id = j + amount - 1;
}
- for (j = 0 ; j < amount ; j++)
+ for (j = 0; j < amount; j++)
{
pc->parts[j + k] = parts[j];
pc->parts[j + k]->id = j + k;
@@ -2887,12 +3018,12 @@ reorder_parts(void)
}
else if (i < k)
{
- for (j = i + ep->reorder.linked_next + 1 ; j <= k ; j++)
+ for (j = i + ep->reorder.linked_next + 1; j <= k; j++)
{
pc->parts[j - amount] = pc->parts[j];
pc->parts[j - amount]->id = j - amount;
}
- for (j = 0 ; j < amount ; j++)
+ for (j = 0; j < amount; j++)
{
pc->parts[j + k - amount + 1] = parts[j];
pc->parts[j + k - amount + 1]->id = j + k - amount + 1;
@@ -2992,7 +3123,7 @@ data_queue_part_nest_lookup(Edje_Part_Collection *pc, const char *name, int *des
void
data_queue_part_reallocated_lookup(Edje_Part_Collection *pc, const char *name,
- unsigned char **base, int offset)
+ unsigned char **base, int offset)
{
Part_Lookup_Key key;
Part_Lookup *pl = NULL;
@@ -3054,7 +3185,6 @@ part_lookup_del(Edje_Part_Collection *pc, int *dest)
eina_hash_del(part_pc_dest_lookup, &key, pl);
}
-
void
part_lookup_delete(Edje_Part_Collection *pc, const char *name, int *dest, char **dest2)
{
@@ -3109,7 +3239,7 @@ data_queue_anonymous_lookup(Edje_Part_Collection *pc, Edje_Program *ep, int *des
Eina_List *l, *l1, *l2, *l3;
Program_Lookup *pl;
- if (!ep) return; /* FIXME: should we stop compiling ? */
+ if (!ep) return; /* FIXME: should we stop compiling ? */
EINA_LIST_FOREACH_SAFE(program_lookups, l, l1, pl)
{
@@ -3189,31 +3319,31 @@ data_queue_copied_anonymous_lookup(Edje_Part_Collection *pc, int *src, int *dest
{
if (pl->dest == src && pl->u.ep->name)
{
- for (i = 0 ; i < pc->programs.fnmatch_count ; i++)
+ for (i = 0; i < pc->programs.fnmatch_count; i++)
{
if (pc->programs.fnmatch[i]->name &&
!strcmp(pl->u.ep->name, pc->programs.fnmatch[i]->name))
data_queue_anonymous_lookup(pc, pc->programs.fnmatch[i], dest);
}
- for (i = 0 ; i < pc->programs.strcmp_count ; i++)
+ for (i = 0; i < pc->programs.strcmp_count; i++)
{
if (pc->programs.strcmp[i]->name &&
!strcmp(pl->u.ep->name, pc->programs.strcmp[i]->name))
data_queue_anonymous_lookup(pc, pc->programs.strcmp[i], dest);
}
- for (i = 0 ; i < pc->programs.strncmp_count ; i++)
+ for (i = 0; i < pc->programs.strncmp_count; i++)
{
if (pc->programs.strncmp[i]->name &&
!strcmp(pl->u.ep->name, pc->programs.strncmp[i]->name))
data_queue_anonymous_lookup(pc, pc->programs.strncmp[i], dest);
}
- for (i = 0 ; i < pc->programs.strrncmp_count ; i++)
+ for (i = 0; i < pc->programs.strrncmp_count; i++)
{
if (pc->programs.strrncmp[i]->name &&
!strcmp(pl->u.ep->name, pc->programs.strrncmp[i]->name))
data_queue_anonymous_lookup(pc, pc->programs.strrncmp[i], dest);
}
- for (i = 0 ; i < pc->programs.nocmp_count ; i++)
+ for (i = 0; i < pc->programs.nocmp_count; i++)
{
if (pc->programs.nocmp[i]->name &&
!strcmp(pl->u.ep->name, pc->programs.nocmp[i]->name))
@@ -3231,7 +3361,7 @@ data_queue_program_lookup(Edje_Part_Collection *pc, const char *name, int *dest)
if (pcp->inherit_only && (!current_group_inherit)) return NULL;
- if (!name) return NULL; /* FIXME: should we stop compiling ? */
+ if (!name) return NULL; /* FIXME: should we stop compiling ? */
pl = mem_alloc(SZ(Program_Lookup));
program_lookups = eina_list_append(program_lookups, pl);
@@ -3311,7 +3441,7 @@ data_queue_image_remove(int *dest, Eina_Bool *set)
return;
}
}
- }
+}
void
data_queue_model_lookup(char *name, int *dest, Eina_Bool *set)
@@ -3379,8 +3509,8 @@ data_process_part_set(Part_Lookup *target, int value)
}
else
{
- *((int*)(*target->key.mem.reallocated.base +
- target->key.mem.reallocated.offset)) = value;
+ *((int *)(*target->key.mem.reallocated.base +
+ target->key.mem.reallocated.offset)) = value;
}
return EINA_FALSE;
}
@@ -3413,20 +3543,19 @@ static void
_data_image_sets_size_set()
{
Evas *evas;
- Ecore_Evas *ee;
Edje_Image_Directory_Set *set;
Edje_Image_Directory_Set_Entry *simg, *preimg;
Eina_List *l, *entries;
unsigned int i;
- ecore_evas_init();
- ee = ecore_evas_buffer_new(1, 1);
- if (!ee)
+ if (!buffer_ee)
+ buffer_ee = ecore_evas_buffer_new(1, 1);
+ if (!buffer_ee)
{
ERR("Cannot create buffer engine canvas for image load.");
exit(-1);
}
- evas = ecore_evas_get(ee);
+ evas = ecore_evas_get(buffer_ee);
for (i = 0; i < edje_file->image_dir->sets_count; i++)
{
@@ -3523,40 +3652,40 @@ _data_image_id_update(Eina_List *images_unused_list)
unsigned int i, j, desc_it;
Eina_List *l, *l2, *l3;
-#define PART_DESC_IMAGE_ID_UPDATE \
- EINA_LIST_FOREACH(images_unused_list, l3, iui) \
- { \
- if ((iui) && (part_desc_image->image.id == iui->old_id)) \
- { \
- part_desc_image->image.id = iui->new_id; \
- break; \
- } \
- } \
- for (desc_it = 0; desc_it < part_desc_image->image.tweens_count; desc_it++) \
- { \
- tween_id = part_desc_image->image.tweens[desc_it]; \
- EINA_LIST_FOREACH(images_unused_list, l3, iui) \
- { \
- if ((iui) && (tween_id->id == iui->old_id)) \
- { \
- tween_id->id = iui->new_id; \
- break; \
- } \
- } \
- }
-
-#define PART_DESC_PROXY_ID_UPDATE \
- EINA_LIST_FOREACH(images_unused_list, l3, iui) \
- { \
- if ((iui) && (part_desc_mesh_node->mesh_node.texture.id == iui->old_id)) \
- { \
- part_desc_mesh_node->mesh_node.texture.id = iui->new_id; \
- break; \
- } \
- }
+#define PART_DESC_IMAGE_ID_UPDATE \
+ EINA_LIST_FOREACH(images_unused_list, l3, iui) \
+ { \
+ if ((iui) && (part_desc_image->image.id == iui->old_id)) \
+ { \
+ part_desc_image->image.id = iui->new_id; \
+ break; \
+ } \
+ } \
+ for (desc_it = 0; desc_it < part_desc_image->image.tweens_count; desc_it++) \
+ { \
+ tween_id = part_desc_image->image.tweens[desc_it]; \
+ EINA_LIST_FOREACH(images_unused_list, l3, iui) \
+ { \
+ if ((iui) && (tween_id->id == iui->old_id)) \
+ { \
+ tween_id->id = iui->new_id; \
+ break; \
+ } \
+ } \
+ }
+
+#define PART_DESC_PROXY_ID_UPDATE \
+ EINA_LIST_FOREACH(images_unused_list, l3, iui) \
+ { \
+ if ((iui) && (part_desc_mesh_node->mesh_node.texture.id == iui->old_id)) \
+ { \
+ part_desc_mesh_node->mesh_node.texture.id = iui->new_id; \
+ break; \
+ } \
+ }
EINA_LIST_FOREACH_SAFE(edje_collections, l, l2, pc)
{
- for(i = 0; i < pc->parts_count; i++)
+ for (i = 0; i < pc->parts_count; i++)
{
part = pc->parts[i];
if (part->type == EDJE_PART_TYPE_IMAGE)
@@ -3565,10 +3694,10 @@ _data_image_id_update(Eina_List *images_unused_list)
if (!part_desc_image) continue;
PART_DESC_IMAGE_ID_UPDATE
for (j = 0; j < part->other.desc_count; j++)
- {
- part_desc_image = (Edje_Part_Description_Image *)part->other.desc[j];
- PART_DESC_IMAGE_ID_UPDATE
- }
+ {
+ part_desc_image = (Edje_Part_Description_Image *)part->other.desc[j];
+ PART_DESC_IMAGE_ID_UPDATE
+ }
}
else if (part->type == EDJE_PART_TYPE_MESH_NODE)
{
@@ -3576,10 +3705,10 @@ _data_image_id_update(Eina_List *images_unused_list)
if (!part_desc_mesh_node) continue;
PART_DESC_PROXY_ID_UPDATE
for (j = 0; j < part->other.desc_count; j++)
- {
- part_desc_mesh_node = (Edje_Part_Description_Mesh_Node *)part->other.desc[j];
- PART_DESC_PROXY_ID_UPDATE
- }
+ {
+ part_desc_mesh_node = (Edje_Part_Description_Mesh_Node *)part->other.desc[j];
+ PART_DESC_PROXY_ID_UPDATE
+ }
}
}
}
@@ -3599,7 +3728,6 @@ _data_image_id_update(Eina_List *images_unused_list)
break;
}
}
-
}
}
}
@@ -3614,19 +3742,19 @@ _data_model_id_update(Eina_List *models_unused_list)
unsigned int i, j;
Eina_List *l, *l2, *l3;
-#define PART_DESC_MODEL_ID_UPDATE \
- EINA_LIST_FOREACH(models_unused_list, l3, iui) \
- { \
- if ((iui) && (part_desc_mesh_node->mesh_node.mesh.id == iui->old_id)) \
- { \
- part_desc_mesh_node->mesh_node.mesh.id = iui->new_id; \
- break; \
- } \
- } \
+#define PART_DESC_MODEL_ID_UPDATE \
+ EINA_LIST_FOREACH(models_unused_list, l3, iui) \
+ { \
+ if ((iui) && (part_desc_mesh_node->mesh_node.mesh.id == iui->old_id)) \
+ { \
+ part_desc_mesh_node->mesh_node.mesh.id = iui->new_id; \
+ break; \
+ } \
+ } \
EINA_LIST_FOREACH_SAFE(edje_collections, l, l2, pc)
{
- for(i = 0; i < pc->parts_count; i++)
+ for (i = 0; i < pc->parts_count; i++)
{
part = pc->parts[i];
if (part->type == EDJE_PART_TYPE_MESH_NODE)
@@ -3635,10 +3763,10 @@ _data_model_id_update(Eina_List *models_unused_list)
if (!part_desc_mesh_node) continue;
PART_DESC_MODEL_ID_UPDATE
for (j = 0; j < part->other.desc_count; j++)
- {
- part_desc_mesh_node = (Edje_Part_Description_Mesh_Node *)part->other.desc[j];
- PART_DESC_MODEL_ID_UPDATE
- }
+ {
+ part_desc_mesh_node = (Edje_Part_Description_Mesh_Node *)part->other.desc[j];
+ PART_DESC_MODEL_ID_UPDATE
+ }
}
}
}
@@ -3676,18 +3804,19 @@ data_process_lookups(void)
ERR("A collection without a name was detected, that's not allowed.");
exit(-1);
}
+
find = eina_hash_find(edje_file->collection, pc->part);
if (find && find->id == pc->id)
{
- if ( ((Edje_Part_Collection_Parser*)pc)->inherit_only)
+ if (((Edje_Part_Collection_Parser *)pc)->inherit_only)
eina_hash_del_by_data(edje_file->collection, find);
else
- continue ;
+ continue;
}
EINA_LIST_FOREACH(aliases, l3, alias)
if (alias->id == pc->id)
- continue ;
+ continue;
/* This Edje_Part_Collection is not used at all */
edje_collections = eina_list_remove_list(edje_collections, l);
@@ -3696,23 +3825,27 @@ data_process_lookups(void)
/* Unref all image used by that group */
for (i = 0; i < pc->parts_count; ++i)
- part_description_image_cleanup(pc->parts[i]);
+ part_description_image_cleanup(pc->parts[i]);
/* Correct all id */
EINA_LIST_FOREACH(edje_collections, l3, pc)
{
Eina_List *l4;
+ Edje_Part_Collection_Directory_Entry *de;
/* Some group could be removed from the collection, but still be referenced by alias */
- find = eina_hash_find(edje_file->collection, pc->part);
- if (pc->id != find->id) find = NULL;
-
/* Update all matching alias */
EINA_LIST_FOREACH(aliases, l4, alias)
if (pc->id == alias->id)
alias->id = id;
- pc->id = id++;
+ find = eina_hash_find(edje_file->collection, pc->part);
+ if (pc->id != find->id) find = NULL;
+
+ de = eina_hash_find(edje_collections_lookup, &pc->id);
+ eina_hash_set(edje_collections_lookup, &pc->id, NULL);
+ de->id = pc->id = id++;
+ eina_hash_set(edje_collections_lookup, &pc->id, de);
if (find) find->id = pc->id;
}
}
@@ -3724,11 +3857,11 @@ data_process_lookups(void)
if (pc->lua_script_only)
is_lua = EINA_TRUE;
-#define PROGRAM_ID_SET(Type, Pc, It, Count) \
- for (It = 0; It < Pc->programs.Type ## _count; ++It) \
- { \
- Pc->programs.Type[It]->id = Count++; \
- }
+#define PROGRAM_ID_SET(Type, Pc, It, Count) \
+ for (It = 0; It < Pc->programs.Type ## _count; ++It) \
+ { \
+ Pc->programs.Type[It]->id = Count++; \
+ }
PROGRAM_ID_SET(fnmatch, pc, i, count);
PROGRAM_ID_SET(strcmp, pc, i, count);
@@ -3779,7 +3912,7 @@ data_process_lookups(void)
}
}
- if ((i == part->key.pc->parts_count) && (!((Edje_Part_Collection_Parser*)part->key.pc)->inherit_only))
+ if ((i == part->key.pc->parts_count) && (!((Edje_Part_Collection_Parser *)part->key.pc)->inherit_only))
{
ERR("Unable to find part name \"%s\" needed in group '%s'.",
alias, part->key.pc->part);
@@ -3796,21 +3929,21 @@ data_process_lookups(void)
unsigned int i;
Eina_Bool find = EINA_FALSE;
-#define PROGRAM_MATCH(Type, Pl, It) \
- for (It = 0; It < Pl->pc->programs.Type ## _count; ++It) \
- { \
- Edje_Program *ep; \
- \
- ep = Pl->pc->programs.Type[It]; \
- \
- if ((Pl->anonymous && ep == Pl->u.ep) || \
- ((!Pl->anonymous) && (ep->name) && (!strcmp(ep->name, Pl->u.name)))) \
- { \
- *(Pl->dest) = ep->id; \
- find = EINA_TRUE; \
- break; \
- } \
- }
+#define PROGRAM_MATCH(Type, Pl, It) \
+ for (It = 0; It < Pl->pc->programs.Type ## _count; ++It) \
+ { \
+ Edje_Program *ep; \
+ \
+ ep = Pl->pc->programs.Type[It]; \
+ \
+ if ((Pl->anonymous && ep == Pl->u.ep) || \
+ ((!Pl->anonymous) && (ep->name) && (!strcmp(ep->name, Pl->u.name)))) \
+ { \
+ *(Pl->dest) = ep->id; \
+ find = EINA_TRUE; \
+ break; \
+ } \
+ }
PROGRAM_MATCH(fnmatch, program, i);
PROGRAM_MATCH(strcmp, program, i);
@@ -3835,6 +3968,7 @@ data_process_lookups(void)
free(program);
}
+ groups_sourced = eina_hash_string_superfast_new(NULL);
EINA_LIST_FREE(group_lookups, group)
{
Edje_Part_Collection_Directory_Entry *de;
@@ -3869,6 +4003,7 @@ data_process_lookups(void)
exit(-1);
}
+ eina_hash_add(groups_sourced, group->name, (void*)1);
free_group:
free(group->name);
free(group);
@@ -3919,7 +4054,7 @@ free_group:
if ((de->entry) && (!strcmp(de->entry, image->name)))
{
- if (de->source_type == EDJE_IMAGE_SOURCE_TYPE_EXTERNAL)
+ if (de->source_type >= EDJE_IMAGE_SOURCE_TYPE_USER)
*(image->dest) = -de->id - 1;
else
*(image->dest) = de->id;
@@ -3950,8 +4085,8 @@ free_group:
find = EINA_TRUE;
EINA_LIST_FOREACH(set->entries, lc, child)
- if (!eina_hash_find(images_in_use, child->name))
- eina_hash_direct_add(images_in_use, child->name, child);
+ if (!eina_hash_find(images_in_use, child->name))
+ eina_hash_direct_add(images_in_use, child->name, child);
if (!eina_hash_find(images_in_use, image->name))
eina_hash_direct_add(images_in_use, set->name, set);
@@ -3986,7 +4121,7 @@ free_group:
de = edje_file->image_dir->entries + i;
if (de->entry && eina_hash_find(images_in_use, de->entry))
- continue ;
+ continue;
INF("Image '%s' in resource 'edje/image/%i' will not be included as it is unused.",
de->entry, de->id);
@@ -4014,7 +4149,7 @@ free_group:
set = edje_file->image_dir->sets + i;
if (set->name && eina_hash_find(images_in_use, set->name))
- continue ;
+ continue;
INF("Set '%s' will not be included as it is unused.", set->name);
@@ -4031,7 +4166,7 @@ free_group:
images_unused_list = eina_list_append(images_unused_list, iui);
iui->new_id = i;
set_last->id = i;
- memcpy(set, set_last, sizeof(Edje_Image_Directory_Set));
+ memcpy(set, set_last, sizeof(Edje_Image_Directory_Set));
--i;
edje_file->image_dir->sets_count--;
set_realloc = realloc(edje_file->image_dir->sets,
@@ -4042,7 +4177,7 @@ free_group:
/* update image id in parts */
if (images_unused_list) _data_image_id_update(images_unused_list);
EINA_LIST_FREE(images_unused_list, iui)
- free(iui);
+ free(iui);
_data_image_sets_size_set();
}
@@ -4098,7 +4233,7 @@ free_group:
de = edje_file->model_dir->entries + i;
if (de->entry && eina_hash_find(models_in_use, de->entry))
- continue ;
+ continue;
INF("Model '%s' in resource 'edje/model/%i' will not be included as it is unused.",
de->entry, de->id);
@@ -4124,14 +4259,14 @@ free_group:
/* update model id in parts */
if (models_unused_list) _data_model_id_update(models_unused_list);
EINA_LIST_FREE(models_unused_list, iui)
- free(iui);
+ free(iui);
}
eina_hash_free(models_in_use);
}
static void
-data_process_string(Edje_Part_Collection *pc, const char *prefix, char *s, void (*func)(Edje_Part_Collection *pc, char *name, char* ptr, int len))
+data_process_string(Edje_Part_Collection *pc, const char *prefix, char *s, void (*func)(Edje_Part_Collection *pc, char *name, char *ptr, int len))
{
char *p;
char *key;
@@ -4147,97 +4282,98 @@ data_process_string(Edje_Part_Collection *pc, const char *prefix, char *s, void
escape = 0;
for (p = s; (p) && (*p); p++)
{
- if (!quote)
- {
- if (*p == '\"')
- {
- quote = 1;
- p++;
- }
- }
- if (!quote)
- {
- if (!strncmp(p, key, keyl))
- {
+ if (!quote)
+ {
+ if (*p == '\"')
+ {
+ quote = 1;
+ p++;
+ }
+ }
+ if (!quote)
+ {
+ if (!strncmp(p, key, keyl))
+ {
char *ptr;
int len;
int inesc = 0;
- char *name;
+ char *name;
ptr = p;
p += keyl;
- while ((*p))
- {
- if (!inesc)
- {
- if (*p == '\\') inesc = 1;
- else if (*p == '\"')
- {
- /* string concatenation, see below */
- if (*(p + 1) != '\"')
- break;
- else
- p++;
- }
- }
+ while ((*p))
+ {
+ if (!inesc)
+ {
+ if (*p == '\\') inesc = 1;
+ else if (*p == '\"')
+ {
+ /* string concatenation, see below */
+ if (*(p + 1) != '\"')
+ break;
+ else
+ p++;
+ }
+ }
else
- inesc = 0;
+ inesc = 0;
p++;
- }
- len = p - ptr + 1;
- name = alloca(len);
- if (name)
- {
- char *pp;
- int i;
-
- name[0] = 0;
- pp = ptr + keyl;
- inesc = 0;
- i = 0;
- while (*pp)
- {
- if (!inesc)
- {
- if (*pp == '\\') inesc = 1;
- else if (*pp == '\"')
- {
- /* concat strings like "foo""bar" to "foobar" */
- if (*(pp + 1) == '\"')
- pp++;
- else
- {
- name[i] = 0;
- break;
- }
- }
- else
- {
- name[i] = *pp;
- name[i + 1] = 0;
- i++;
- }
- }
- else
+ }
+ len = p - ptr + 1;
+ name = alloca(len);
+ if (name)
+ {
+ char *pp;
+ int i;
+
+ name[0] = 0;
+ pp = ptr + keyl;
+ inesc = 0;
+ i = 0;
+ while (*pp)
+ {
+ if (!inesc)
+ {
+ if (*pp == '\\') inesc = 1;
+ else if (*pp == '\"')
+ {
+ /* concat strings like "foo""bar" to "foobar" */
+ if (*(pp + 1) == '\"')
+ pp++;
+ else
+ {
+ name[i] = 0;
+ break;
+ }
+ }
+ else
+ {
+ name[i] = *pp;
+ name[i + 1] = 0;
+ i++;
+ }
+ }
+ else
inesc = 0;
- pp++;
- }
- func(pc, name, ptr, len);
- }
- }
- }
- else
- {
- if (!escape)
- {
- if (*p == '\"') quote = 0;
- else if (*p == '\\') escape = 1;
- }
- else if (escape)
- {
- escape = 0;
- }
- }
+ pp++;
+ }
+ func(pc, name, ptr, len);
+ }
+ }
+ }
+ else
+ {
+ if (!escape)
+ {
+ if (*p == '\"') quote = 0;
+ else if (*p == '\\')
+ escape = 1;
+ }
+ else if (escape)
+ {
+ escape = 0;
+ }
+ }
}
}
@@ -4254,6 +4390,7 @@ _data_queue_part_lookup(Edje_Part_Collection *pc, char *name, char *ptr, int len
code_lookups = eina_list_append(code_lookups, cl);
}
+
static void
_data_queue_program_lookup(Edje_Part_Collection *pc, char *name, char *ptr, int len)
{
@@ -4267,11 +4404,13 @@ _data_queue_program_lookup(Edje_Part_Collection *pc, char *name, char *ptr, int
code_lookups = eina_list_append(code_lookups, cl);
}
+
static void
_data_queue_group_lookup(Edje_Part_Collection *pc EINA_UNUSED, char *name, char *ptr EINA_UNUSED, int len EINA_UNUSED)
{
data_queue_group_lookup(name, NULL);
}
+
static void
_data_queue_image_pc_lookup(Edje_Part_Collection *pc EINA_UNUSED, char *name, char *ptr, int len)
{
@@ -4281,7 +4420,7 @@ _data_queue_image_pc_lookup(Edje_Part_Collection *pc EINA_UNUSED, char *name, ch
cl->ptr = ptr;
cl->len = len;
- data_queue_image_lookup(name, &(cl->val), &(cl->set));
+ data_queue_image_lookup(name, &(cl->val), &(cl->set));
code_lookups = eina_list_append(code_lookups, cl);
}
@@ -4293,36 +4432,36 @@ data_process_scripts(void)
for (l = codes, l2 = edje_collections; (l) && (l2); l = eina_list_next(l), l2 = eina_list_next(l2))
{
- Edje_Part_Collection *pc;
- Code *cd;
-
- cd = eina_list_data_get(l);
- pc = eina_list_data_get(l2);
-
- if ((cd->shared) && (!cd->is_lua))
- {
- data_process_string(pc, "PART", cd->shared, _data_queue_part_lookup);
- data_process_string(pc, "PROGRAM", cd->shared, _data_queue_program_lookup);
- data_process_string(pc, "IMAGE", cd->shared, _data_queue_image_pc_lookup);
- data_process_string(pc, "GROUP", cd->shared, _data_queue_group_lookup);
- }
-
- if (cd->programs)
- {
- Code_Program *cp;
- Eina_List *ll;
-
- EINA_LIST_FOREACH(cd->programs, ll, cp)
- {
- if (cp->script)
- {
- data_process_string(pc, "PART", cp->script, _data_queue_part_lookup);
- data_process_string(pc, "PROGRAM", cp->script, _data_queue_program_lookup);
- data_process_string(pc, "IMAGE", cp->script, _data_queue_image_pc_lookup);
- data_process_string(pc, "GROUP", cp->script, _data_queue_group_lookup);
- }
- }
- }
+ Edje_Part_Collection *pc;
+ Code *cd;
+
+ cd = eina_list_data_get(l);
+ pc = eina_list_data_get(l2);
+
+ if ((cd->shared) && (!cd->is_lua))
+ {
+ data_process_string(pc, "PART", cd->shared, _data_queue_part_lookup);
+ data_process_string(pc, "PROGRAM", cd->shared, _data_queue_program_lookup);
+ data_process_string(pc, "IMAGE", cd->shared, _data_queue_image_pc_lookup);
+ data_process_string(pc, "GROUP", cd->shared, _data_queue_group_lookup);
+ }
+
+ if (cd->programs)
+ {
+ Code_Program *cp;
+ Eina_List *ll;
+
+ EINA_LIST_FOREACH(cd->programs, ll, cp)
+ {
+ if (cp->script)
+ {
+ data_process_string(pc, "PART", cp->script, _data_queue_part_lookup);
+ data_process_string(pc, "PROGRAM", cp->script, _data_queue_program_lookup);
+ data_process_string(pc, "IMAGE", cp->script, _data_queue_image_pc_lookup);
+ data_process_string(pc, "GROUP", cp->script, _data_queue_group_lookup);
+ }
+ }
+ }
}
}
@@ -4334,18 +4473,18 @@ data_process_script_lookups(void)
EINA_LIST_FOREACH(code_lookups, l, cl)
{
- char buf[12];
- int n;
+ char buf[12];
+ int n;
- /* FIXME !! Handle set in program */
- n = eina_convert_itoa(cl->val, buf);
- if (n > cl->len)
- {
- ERR("The unexpected happened. A numeric replacement string was larger than the original!");
- exit(-1);
- }
- memset(cl->ptr, ' ', cl->len);
- strncpy(cl->ptr, buf, n);
+ /* FIXME !! Handle set in program */
+ n = eina_convert_itoa(cl->val, buf);
+ if (n > cl->len)
+ {
+ ERR("The unexpected happened. A numeric replacement string was larger than the original!");
+ exit(-1);
+ }
+ memset(cl->ptr, ' ', cl->len);
+ strncpy(cl->ptr, buf, n);
}
}
@@ -4431,10 +4570,10 @@ color_tree_parent_node_get(const char *color_class)
char *name;
EINA_LIST_FOREACH(edje_file->color_tree, l, ctn)
- if (ctn->color_classes)
- EINA_LIST_FOREACH(ctn->color_classes, ll, name)
- if (!strcmp(name, color_class))
- return ctn;
+ if (ctn->color_classes)
+ EINA_LIST_FOREACH(ctn->color_classes, ll, name)
+ if (!strcmp(name, color_class))
+ return ctn;
return NULL;
}
@@ -4490,12 +4629,12 @@ process_color_tree(char *s, const char *f_in, int ln)
if (!strcmp(name, token[id]))
{
error_and_abort(NULL, "parse error %s:%i. The color class \"%s\" already belongs to the root node.",
- f_in, ln -1, token[id]);
+ f_in, ln - 1, token[id]);
}
if ((ctn = color_tree_parent_node_get(token[id])))
error_and_abort(NULL, "parse error %s:%i. The color class \"%s\" already belongs to the \"%s\" node.",
- f_in, ln -1, token[id], ctn->name);
+ f_in, ln - 1, token[id], ctn->name);
ctn = eina_array_data_get(array, eina_array_count(array) - 1);
ctn->color_classes = eina_list_append(ctn->color_classes, strdup(token[id]));
@@ -4504,14 +4643,13 @@ process_color_tree(char *s, const char *f_in, int ln)
{
if ((ctn = color_tree_parent_node_get(token[id])))
error_and_abort(NULL, "parse error %s:%i. The color class \"%s\" already belongs to the \"%s\" node.",
- f_in, ln -1, token[id], ctn->name);
+ f_in, ln - 1, token[id], ctn->name);
color_tree_root = eina_list_append(color_tree_root, strdup(token[id]));
}
}
id = !id;
-
} while (*s);
if (eina_array_count(array))
@@ -4525,7 +4663,7 @@ char
validate_hex_digit(char c)
{
if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'))
- return c;
+ return c;
ERR("%s:%i. invalid character '%c' is used in color code.",
file_in, line - 1, c);
@@ -4619,3 +4757,4 @@ convert_color_code(char *str, int *r, int *g, int *b, int *a)
free(str);
}
+
diff --git a/src/bin/edje/edje_cc_parse.c b/src/bin/edje/edje_cc_parse.c
index d8a7802e87..7a3335c559 100644
--- a/src/bin/edje/edje_cc_parse.c
+++ b/src/bin/edje/edje_cc_parse.c
@@ -2,7 +2,6 @@
# include <config.h>
#endif
-
#include <string.h>
#include <ctype.h>
#include <limits.h>
@@ -23,61 +22,62 @@
# define EPP_EXT
#endif
+#define SKIP_NAMESPACE_VALIDATION_SUPPORTED " -DSKIP_NAMESPACE_VALIDATION=1 "
+
#define EDJE_1_18_SUPPORTED " -DEFL_VERSION_1_18=1 "
#define EDJE_1_19_SUPPORTED " -DEFL_VERSION_1_19=1 "
#define EDJE_1_20_SUPPORTED " -DEFL_VERSION_1_20=1 "
#define EDJE_1_21_SUPPORTED " -DEFL_VERSION_1_21=1 "
#define EDJE_CC_EFL_VERSION_SUPPORTED \
- EDJE_1_18_SUPPORTED \
- EDJE_1_19_SUPPORTED \
- EDJE_1_20_SUPPORTED \
+ EDJE_1_18_SUPPORTED \
+ EDJE_1_19_SUPPORTED \
+ EDJE_1_20_SUPPORTED \
EDJE_1_21_SUPPORTED
-static void new_object(void);
-static void new_statement(void);
-static char *perform_math (char *input);
-static int isdelim(char c);
-static char *next_token(char *p, char *end, char **new_p, int *delim);
+static void new_object(void);
+static void new_statement(void);
+static char *perform_math(char *input);
+static int isdelim(char c);
+static char *next_token(char *p, char *end, char **new_p, int *delim);
static const char *stack_id(void);
-static void parse(char *data, off_t size);
+static void parse(char *data, off_t size);
/* simple expression parsing protos */
-static int my_atoi(const char * s);
-static char * _alphai(char *s, int * val);
-static char * _betai(char *s, int * val);
-static char * _gammai(char *s, int * val);
-static char * _deltai(char *s, int * val);
-static char * _get_numi(char *s, int * val);
-static int _is_numi(char c);
-static int _is_op1i(char c);
-static int _is_op2i(char c);
-static int _calci(char op, int a, int b);
-
-static double my_atof(const char * s);
-static char * _alphaf(char *s, double * val);
-static char * _betaf(char *s, double * val);
-static char * _gammaf(char *s, double * val);
-static char * _deltaf(char *s, double * val);
-static char * _get_numf(char *s, double * val);
-static int _is_numf(char c);
-static int _is_op1f(char c);
-static int _is_op2f(char c);
-static double _calcf(char op, double a, double b);
-static int strstrip(const char *in, char *out, size_t size);
-
-
-int line = 0;
+static int my_atoi(const char *s);
+static char *_alphai(char *s, int *val);
+static char *_betai(char *s, int *val);
+static char *_gammai(char *s, int *val);
+static char *_deltai(char *s, int *val);
+static char *_get_numi(char *s, int *val);
+static int _is_numi(char c);
+static int _is_op1i(char c);
+static int _is_op2i(char c);
+static int _calci(char op, int a, int b);
+
+static double my_atof(const char *s);
+static char *_alphaf(char *s, double *val);
+static char *_betaf(char *s, double *val);
+static char *_gammaf(char *s, double *val);
+static char *_deltaf(char *s, double *val);
+static char *_get_numf(char *s, double *val);
+static int _is_numf(char c);
+static int _is_op1f(char c);
+static int _is_op2f(char c);
+static double _calcf(char op, double a, double b);
+static int strstrip(const char *in, char *out, size_t size);
+
+int line = 0;
Eina_List *stack = NULL;
Eina_Array params;
int had_quote = 0;
int params_quote = 0;
-static char file_buf[4096];
-static int did_wildcard = 0;
-static int verbatim = 0;
-static int verbatim_line1 = 0;
-static int verbatim_line2 = 0;
+static char file_buf[4096];
+static int did_wildcard = 0;
+static int verbatim = 0;
+static int verbatim_line1 = 0;
+static int verbatim_line2 = 0;
static char *verbatim_str = NULL;
static Eina_Strbuf *stack_buf = NULL;
@@ -102,9 +102,9 @@ err_show_params(void)
ERR("PARAMS:");
EINA_ARRAY_ITER_NEXT(&params, i, p, iterator)
- {
- ERR(" %s", p);
- }
+ {
+ ERR(" %s", p);
+ }
}
static void
@@ -117,7 +117,7 @@ err_show(void)
static char *
_parse_param_get(int n)
{
- if (n < (int) eina_array_count(&params))
+ if (n < (int)eina_array_count(&params))
return eina_array_data_get(&params, n);
return NULL;
}
@@ -304,7 +304,7 @@ new_statement_single(void)
}
static char *
-perform_math (char *input)
+perform_math(char *input)
{
char buf[256];
double res;
@@ -344,9 +344,9 @@ next_token(char *p, char *end, char **new_p, int *delim)
int in_tok = 0;
int in_quote = 0;
int in_parens = 0;
- int in_comment_ss = 0;
+ int in_comment_ss = 0;
int in_comment_cpp = 0;
- int in_comment_sa = 0;
+ int in_comment_sa = 0;
int is_escaped = 0;
had_quote = 0;
@@ -377,7 +377,7 @@ next_token(char *p, char *end, char **new_p, int *delim)
{
char *pp, fl[4096];
char *tmpstr = NULL;
- int l, nm;
+ int l, nm;
/* handle cpp comments */
/* their line format is
@@ -470,14 +470,14 @@ next_token(char *p, char *end, char **new_p, int *delim)
/* check for end-of-token */
if (
- (isspace(*p)) ||
- ((*delim) && (!isdelim(*p))) ||
- (isdelim(*p))
- )
- {/*the line below this is never used because it skips to
- * the 'done' label which is after the return call for
- * in_tok being 0. is this intentional?
- */
+ (isspace(*p)) ||
+ ((*delim) && (!isdelim(*p))) ||
+ (isdelim(*p))
+ ) /*the line below this is never used because it skips to
+ * the 'done' label which is after the return call for
+ * in_tok being 0. is this intentional?
+ */
+ {
in_tok = 0;
tok_end = p - 1;
@@ -497,7 +497,7 @@ next_token(char *p, char *end, char **new_p, int *delim)
if (!in_tok) return NULL;
tok_end = p - 1;
- done:
+done:
*new_p = p;
tok = mem_alloc(tok_end - tok_start + 2);
@@ -661,7 +661,7 @@ stack_pop(void)
if (do_remove)
eina_strbuf_remove(stack_buf,
eina_strbuf_length_get(stack_buf) - tmp_length - 1,
- eina_strbuf_length_get(stack_buf)); /* remove: '.tmp' */
+ eina_strbuf_length_get(stack_buf)); /* remove: '.tmp' */
}
else
{
@@ -698,8 +698,8 @@ stack_pop_quick(Eina_Bool check_last, Eina_Bool do_free)
tmp = end + 1;
}
eina_strbuf_remove(stack_buf,
- eina_strbuf_length_get(stack_buf) - strlen(tmp) - 1,
- eina_strbuf_length_get(stack_buf)); /* remove: '.tmp' */
+ eina_strbuf_length_get(stack_buf) - strlen(tmp) - 1,
+ eina_strbuf_length_get(stack_buf)); /* remove: '.tmp' */
stack = eina_list_remove_list(stack, eina_list_last(stack));
if (do_free)
{
@@ -785,7 +785,8 @@ parse(char *data, off_t size)
err_show();
exit(-1);
}
- else if (*token == ',' || *token == ':') do_params = 1;
+ else if (*token == ',' || *token == ':')
+ do_params = 1;
else if (*token == '}')
{
if (do_params)
@@ -921,8 +922,9 @@ parse(char *data, off_t size)
}
else if ((!inquotes) && (!insquotes))
{
- if (p[0] == '{') squigglie++;
- else if (p[0] == '}') squigglie--;
+ if (p[0] == '{') squigglie++;
+ else if (p[0] == '}')
+ squigglie--;
if (squigglie == 0)
{
verbatim_2 = p - 1;
@@ -1046,7 +1048,7 @@ compile(void)
len = 0;
EINA_LIST_FOREACH(defines, l, define)
- len += strlen(define) + 1;
+ len += strlen(define) + 1;
def = mem_alloc(len + 1);
def[0] = 0;
EINA_LIST_FOREACH(defines, l, define)
@@ -1082,25 +1084,25 @@ compile(void)
inc = ecore_file_dir_get(file_in);
if (depfile)
- snprintf(buf, sizeof(buf), "\"%s\" -MMD \"%s\" -MT \"%s\" \"%s\""
- " -I\"%s\" %s -o \"%s\""
- " -DEFL_VERSION_MAJOR=%d -DEFL_VERSION_MINOR=%d"
+ snprintf(buf, sizeof(buf), "\"%s\" "SKIP_NAMESPACE_VALIDATION_SUPPORTED" -MMD \"%s\" -MT \"%s\" \"%s\""
+ " -I\"%s\" %s -o \"%s\""
+ " -DEFL_VERSION_MAJOR=%d -DEFL_VERSION_MINOR=%d"
EDJE_CC_EFL_VERSION_SUPPORTED,
buf2, depfile, file_out, file_in,
inc ? inc : "./", def, clean_file,
EINA_VERSION_MAJOR, EINA_VERSION_MINOR);
else if (annotate)
- snprintf(buf, sizeof(buf), "\"%s\" -annotate -a \"%s\" \"%s\""
- " -I\"%s\" %s -o \"%s\""
- " -DEFL_VERSION_MAJOR=%d -DEFL_VERSION_MINOR=%d"
+ snprintf(buf, sizeof(buf), "\"%s\" "SKIP_NAMESPACE_VALIDATION_SUPPORTED" -annotate -a \"%s\" \"%s\""
+ " -I\"%s\" %s -o \"%s\""
+ " -DEFL_VERSION_MAJOR=%d -DEFL_VERSION_MINOR=%d"
EDJE_CC_EFL_VERSION_SUPPORTED,
buf2, watchfile ? watchfile : "/dev/null", file_in,
inc ? inc : "./", def, clean_file,
EINA_VERSION_MAJOR, EINA_VERSION_MINOR);
else
- snprintf(buf, sizeof(buf), "\"%s\" -a \"%s\" \"%s\" -I\"%s\" %s"
- " -o \"%s\""
- " -DEFL_VERSION_MAJOR=%d -DEFL_VERSION_MINOR=%d"
+ snprintf(buf, sizeof(buf), "\"%s\" "SKIP_NAMESPACE_VALIDATION_SUPPORTED" -a \"%s\" \"%s\" -I\"%s\" %s"
+ " -o \"%s\""
+ " -DEFL_VERSION_MAJOR=%d -DEFL_VERSION_MINOR=%d"
EDJE_CC_EFL_VERSION_SUPPORTED,
buf2, watchfile ? watchfile : "/dev/null", file_in,
inc ? inc : "./", def, clean_file,
@@ -1247,10 +1249,10 @@ _parse_enum(char *str, va_list va)
va_list va2;
va_copy(va2, va); /* iterator for the error message */
- for (;;)
+ for (;; )
{
char *s;
- int v;
+ int v;
s = va_arg(va, char *);
@@ -1328,7 +1330,7 @@ parse_flags(int n, ...)
va_list va;
va_start(va, n);
- while (n < (int) eina_array_count(&params))
+ while (n < (int)eina_array_count(&params))
{
result |= _parse_enum(eina_array_data_get(&params, n), va);
n++;
@@ -1665,7 +1667,7 @@ _get_numi(char *s, int *val)
}
buf[pos] = '\0';
(*val) = atoi(buf);
- return (s + pos);
+ return s + pos;
}
int
@@ -1682,10 +1684,13 @@ _is_op1i(char c)
{
switch (c)
{
- case '*':;
- case '%':;
- case '/': return 1;
- default: break;
+ case '*':;
+
+ case '%':;
+
+ case '/': return 1;
+
+ default: break;
}
return 0;
}
@@ -1695,9 +1700,11 @@ _is_op2i(char c)
{
switch (c)
{
- case '+':;
- case '-': return 1;
- default: break;
+ case '+':;
+
+ case '-': return 1;
+
+ default: break;
}
return 0;
}
@@ -1705,29 +1712,34 @@ _is_op2i(char c)
int
_calci(char op, int a, int b)
{
- switch(op)
+ switch (op)
{
case '+':
- a += b;
- return a;
+ a += b;
+ return a;
+
case '-':
- a -= b;
- return a;
+ a -= b;
+ return a;
+
case '/':
- if (0 != b) a /= b;
- else
- ERR("%s:%i divide by zero", file_in, line - 1);
- return a;
+ if (0 != b) a /= b;
+ else
+ ERR("%s:%i divide by zero", file_in, line - 1);
+ return a;
+
case '*':
- a *= b;
- return a;
+ a *= b;
+ return a;
+
case '%':
- if (0 != b) a = a % b;
- else
- ERR("%s:%i modula by zero", file_in, line - 1);
- return a;
+ if (0 != b) a = a % b;
+ else
+ ERR("%s:%i modula by zero", file_in, line - 1);
+ return a;
+
default:
- ERR("%s:%i unexpected character '%c'", file_in, line - 1, op);
+ ERR("%s:%i unexpected character '%c'", file_in, line - 1, op);
}
return a;
}
@@ -1818,7 +1830,7 @@ _gammaf(char *s, double *val)
static char *
_betaf(char *s, double *val)
{
- double a1=0, a2=0;
+ double a1 = 0, a2 = 0;
char op;
if (!val) return NULL;
@@ -1837,7 +1849,7 @@ _betaf(char *s, double *val)
static char *
_alphaf(char *s, double *val)
{
- double a1=0, a2=0;
+ double a1 = 0, a2 = 0;
char op;
if (!val) return NULL;
@@ -1870,7 +1882,7 @@ _get_numf(char *s, double *val)
}
buf[pos] = '\0';
(*val) = atof(buf);
- return (s+pos);
+ return s + pos;
}
static int
@@ -1887,11 +1899,14 @@ _is_numf(char c)
static int
_is_op1f(char c)
{
- switch(c)
+ switch (c)
{
case '*':;
+
case '%':;
+
case '/': return 1;
+
default: break;
}
return 0;
@@ -1900,10 +1915,12 @@ _is_op1f(char c)
static int
_is_op2f(char c)
{
- switch(c)
+ switch (c)
{
case '+':;
+
case '-': return 1;
+
default: break;
}
return 0;
@@ -1912,29 +1929,34 @@ _is_op2f(char c)
static double
_calcf(char op, double a, double b)
{
- switch(op)
+ switch (op)
{
case '+':
- a += b;
- return a;
+ a += b;
+ return a;
+
case '-':
- a -= b;
- return a;
+ a -= b;
+ return a;
+
case '/':
- if (b != 0) a /= b;
- else
- ERR("%s:%i divide by zero", file_in, line - 1);
- return a;
+ if (b != 0) a /= b;
+ else
+ ERR("%s:%i divide by zero", file_in, line - 1);
+ return a;
+
case '*':
- a *= b;
- return a;
+ a *= b;
+ return a;
+
case '%':
- if (0 != b) a = (double)((int)a % (int)b);
- else
- ERR("%s:%i modula by zero", file_in, line - 1);
- return a;
+ if (0 != b) a = (double)((int)a % (int)b);
+ else
+ ERR("%s:%i modula by zero", file_in, line - 1);
+ return a;
+
default:
- ERR("%s:%i unexpected character '%c'", file_in, line - 1, op);
+ ERR("%s:%i unexpected character '%c'", file_in, line - 1, op);
}
return a;
}
@@ -1942,7 +1964,7 @@ _calcf(char op, double a, double b)
static int
strstrip(const char *in, char *out, size_t size)
{
- if ((size -1 ) < strlen(in))
+ if ((size - 1) < strlen(in))
{
ERR("%s:%i expression is too long", file_in, line - 1);
return 0;
@@ -1967,7 +1989,7 @@ get_param_index(char *str)
int index;
char *p;
- for(index = 0; index < get_arg_count(); index++)
+ for (index = 0; index < get_arg_count(); index++)
{
p = _parse_param_get(index);
if (!p) continue;
@@ -1982,5 +2004,6 @@ get_param_index(char *str)
int
param_had_quote(int n)
{
- return (params_quote & (1 << n));
+ return params_quote & (1 << n);
}
+
diff --git a/src/bin/edje/edje_cc_script.c b/src/bin/edje/edje_cc_script.c
index dca9fef953..2e52ac1c2f 100644
--- a/src/bin/edje/edje_cc_script.c
+++ b/src/bin/edje/edje_cc_script.c
@@ -19,19 +19,19 @@ typedef enum
{
TOKEN_TYPE_INVALID = -1,
TOKEN_TYPE_EOF,
- TOKEN_TYPE_COLON = (1 << 0),
- TOKEN_TYPE_SEMICOLON = (1 << 1),
- TOKEN_TYPE_COMMA = (1 << 2),
- TOKEN_TYPE_PARENS = (1 << 3),
- TOKEN_TYPE_BRACES = (1 << 4),
+ TOKEN_TYPE_COLON = (1 << 0),
+ TOKEN_TYPE_SEMICOLON = (1 << 1),
+ TOKEN_TYPE_COMMA = (1 << 2),
+ TOKEN_TYPE_PARENS = (1 << 3),
+ TOKEN_TYPE_BRACES = (1 << 4),
TOKEN_TYPE_EQUAL_MARK = (1 << 5),
- TOKEN_TYPE_PUBLIC = (1 << 6),
+ TOKEN_TYPE_PUBLIC = (1 << 6),
TOKEN_TYPE_IDENTIFIER = (1 << 7)
} Token_Type;
typedef struct _Token
{
- char *str;
+ char *str;
Token_Type type;
} Token;
@@ -64,7 +64,7 @@ static void
code_parse_internal(Code *code)
{
Code_Symbol *sym = NULL, *func = NULL;
- Token *token, *tmp;
+ Token *token, *tmp = NULL;
char *begin = code->shared;
char *end = begin + strlen(begin);
char *body;
@@ -89,9 +89,16 @@ code_parse_internal(Code *code)
if ((tmp->type == TOKEN_TYPE_COMMA) ||
(tmp->type == TOKEN_TYPE_SEMICOLON))
{
+ if (token->str) free(token->str);
+ free(token);
+
token = tmp;
+ tmp = NULL;
break;
}
+
+ if (tmp->str) free(tmp->str);
+ free(tmp);
}
}
@@ -102,6 +109,7 @@ code_parse_internal(Code *code)
sym = mem_alloc(SZ(Code_Symbol));
sym->tag = eina_array_pop(name_stack);
break;
+
case TOKEN_TYPE_SEMICOLON:
if (eina_array_count(name_stack))
{
@@ -114,6 +122,7 @@ code_parse_internal(Code *code)
}
is_public = EINA_FALSE;
break;
+
case TOKEN_TYPE_COMMA:
if (!sym)
sym = mem_alloc(SZ(Code_Symbol));
@@ -127,6 +136,7 @@ code_parse_internal(Code *code)
}
sym = NULL;
break;
+
case TOKEN_TYPE_PARENS:
is_args = !is_args;
if (is_args)
@@ -152,6 +162,7 @@ code_parse_internal(Code *code)
sym = func;
}
break;
+
case TOKEN_TYPE_BRACES:
depth = 1;
body = begin;
@@ -164,6 +175,7 @@ code_parse_internal(Code *code)
case '{':
depth++;
break;
+
case '}':
depth--;
break;
@@ -171,6 +183,9 @@ code_parse_internal(Code *code)
}
if (!depth)
break;
+
+ if (tmp->str) free(tmp->str);
+ free(tmp);
}
if ((begin - 1) > body)
{
@@ -182,13 +197,16 @@ code_parse_internal(Code *code)
sym = NULL;
is_public = EINA_FALSE;
break;
+
case TOKEN_TYPE_PUBLIC:
is_public = EINA_TRUE;
break;
+
case TOKEN_TYPE_IDENTIFIER:
eina_array_push(name_stack, token->str);
token->str = NULL;
break;
+
default:
break;
}
@@ -196,6 +214,20 @@ code_parse_internal(Code *code)
if (token->str)
free(token->str);
free(token);
+
+ if (tmp)
+ {
+ if (tmp->str) free(tmp->str);
+ free(tmp);
+ tmp = NULL;
+ }
+ }
+
+ if (token)
+ {
+ if (token->str)
+ free(token->str);
+ free(token);
}
eina_array_free(name_stack);
@@ -228,9 +260,10 @@ next_token(char **begin, char *end)
case ' ':
case '\t':
case '\n':
- if (index > 0)
- parsed = EINA_TRUE;
- break;
+ if (index > 0)
+ parsed = EINA_TRUE;
+ break;
+
case ':':
case ';':
case ',':
@@ -239,46 +272,53 @@ next_token(char **begin, char *end)
case '{':
case '}':
case '=':
- if (!index)
- {
- buf[index++] = ch;
- src++;
- }
- goto exit;
+ if (!index)
+ {
+ buf[index++] = ch;
+ src++;
+ }
+ goto exit;
+
default:
- if (parsed)
- goto exit;
- buf[index++] = ch;
- break;
+ if (parsed)
+ goto exit;
+ buf[index++] = ch;
+ break;
}
}
exit:
switch (buf[0])
{
- case ':':
- token->type = TOKEN_TYPE_COLON;
- break;
- case ';':
- token->type = TOKEN_TYPE_SEMICOLON;
- break;
- case ',':
- token->type = TOKEN_TYPE_COMMA;
- break;
- case '(':
- case ')':
- token->type = TOKEN_TYPE_PARENS;
- break;
- case '{':
- case '}':
- token->type = TOKEN_TYPE_BRACES;
- break;
- case '=':
- token->type = TOKEN_TYPE_EQUAL_MARK;
- break;
- case '\0':
- token->type = TOKEN_TYPE_EOF;
- break;
+ case ':':
+ token->type = TOKEN_TYPE_COLON;
+ break;
+
+ case ';':
+ token->type = TOKEN_TYPE_SEMICOLON;
+ break;
+
+ case ',':
+ token->type = TOKEN_TYPE_COMMA;
+ break;
+
+ case '(':
+ case ')':
+ token->type = TOKEN_TYPE_PARENS;
+ break;
+
+ case '{':
+ case '}':
+ token->type = TOKEN_TYPE_BRACES;
+ break;
+
+ case '=':
+ token->type = TOKEN_TYPE_EQUAL_MARK;
+ break;
+
+ case '\0':
+ token->type = TOKEN_TYPE_EOF;
+ break;
}
if (token->type < 0)
@@ -448,3 +488,4 @@ script_rewrite(Code *code)
code->vars = vars;
code->func = func;
}
+
diff --git a/src/bin/edje/edje_cc_sources.c b/src/bin/edje/edje_cc_sources.c
index a2edf4d531..a8bd949576 100644
--- a/src/bin/edje/edje_cc_sources.c
+++ b/src/bin/edje/edje_cc_sources.c
@@ -59,8 +59,8 @@ source_fetch_file(const char *fil, const char *filname)
f = fopen(fil, "rb");
if (!f)
{
- ERR("Cannot open file '%s'", fil);
- exit(-1);
+ ERR("Cannot open file '%s'", fil);
+ exit(-1);
}
fseek(f, 0, SEEK_END);
@@ -71,12 +71,12 @@ source_fetch_file(const char *fil, const char *filname)
sf->file = mem_alloc(sz + 1);
if (sz > 0)
{
- tmp = fread(sf->file, sz, 1, f);
- if (tmp != 1)
- {
- ERR("file length for (%s) doesn't match!", filname);
- exit(-1);
- }
+ tmp = fread(sf->file, sz, 1, f);
+ if (tmp != 1)
+ {
+ ERR("file length for (%s) doesn't match!", filname);
+ exit(-1);
+ }
}
sf->file[sz] = '\0';
@@ -85,14 +85,14 @@ source_fetch_file(const char *fil, const char *filname)
while (fgets(buf, sizeof(buf), f))
{
- char *p, *pp;
- int forgetit = 0;
- int haveinclude = 0;
- char *file = NULL, *fname = NULL;
-
- p = buf;
- while ((!forgetit) && (*p))
- {
+ char *p, *pp;
+ int forgetit = 0;
+ int haveinclude = 0;
+ char *file = NULL, *fname = NULL;
+
+ p = buf;
+ while ((!forgetit) && (*p))
+ {
if (!isspace(*p))
{
if (*p != '#')
@@ -100,87 +100,87 @@ source_fetch_file(const char *fil, const char *filname)
}
p++;
- if (!haveinclude)
- {
- if (!isspace(*p))
- {
- if (!strncmp(p, "include", 7))
- {
- haveinclude = 1;
- p += 7;
- }
- /* HACK! the logic above should be fixed so
- * preprocessor statements don't have to begin
- * in column 0.
- * otoh, edje_cc should print a warning in that case,
- * since according to the standard, preprocessor
- * statements need to be put in column 0.
- */
- else if (!strncmp(p, "#include", 8))
- {
- haveinclude = 1;
- p += 8;
- }
- else
- forgetit = 1;
- }
- }
- else
- {
- if (!isspace(*p))
- {
- char end = '\0';
-
- if (*p == '"') end = '"';
- else if (*p == '<') end = '>';
-
- if (end)
- {
- pp = strchr(p + 1, end);
- if (!pp)
- forgetit = 1;
- else
- {
- ssize_t l = 0;
-
- /* get the directory of the current file
- * if we haven't already done so
- */
- if (!dir)
- {
+ if (!haveinclude)
+ {
+ if (!isspace(*p))
+ {
+ if (!strncmp(p, "include", 7))
+ {
+ haveinclude = 1;
+ p += 7;
+ }
+ /* HACK! the logic above should be fixed so
+ * preprocessor statements don't have to begin
+ * in column 0.
+ * otoh, edje_cc should print a warning in that case,
+ * since according to the standard, preprocessor
+ * statements need to be put in column 0.
+ */
+ else if (!strncmp(p, "#include", 8))
+ {
+ haveinclude = 1;
+ p += 8;
+ }
+ else
+ forgetit = 1;
+ }
+ }
+ else
+ {
+ if (!isspace(*p))
+ {
+ char end = '\0';
+
+ if (*p == '"') end = '"';
+ else if (*p == '<')
+ end = '>';
+
+ if (end)
+ {
+ pp = strchr(p + 1, end);
+ if (!pp)
+ forgetit = 1;
+ else
+ {
+ ssize_t l = 0;
+
+ /* get the directory of the current file
+ * if we haven't already done so
+ */
+ if (!dir)
+ {
dir = ecore_file_dir_get(fil);
- if (dir) dir_len = strlen(dir);
- }
-
- l = pp - p + dir_len + 1;
- file = mem_alloc(l);
-
- if (!dir_len)
- {
- snprintf(file, l - 1, "%s", p + 1);
- file[l - 2] = 0;
- }
- else
- {
- snprintf(file, l, "%s/%s", dir, p + 1);
- file[l - 1] = 0;
- }
-
-
- fname = strdup(p + 1);
- pp = strrchr(fname, end);
- if (pp) *pp = 0;
- forgetit = 1;
- }
- }
- else
- forgetit = 1;
- }
- else
- p++;
+ if (dir) dir_len = strlen(dir);
+ }
+
+ l = pp - p + dir_len + 1;
+ file = mem_alloc(l);
+
+ if (!dir_len)
+ {
+ snprintf(file, l - 1, "%s", p + 1);
+ file[l - 2] = 0;
+ }
+ else
+ {
+ snprintf(file, l, "%s/%s", dir, p + 1);
+ file[l - 1] = 0;
+ }
+
+ fname = strdup(p + 1);
+ pp = strrchr(fname, end);
+ if (pp) *pp = 0;
+ forgetit = 1;
+ }
+ }
+ else
+ forgetit = 1;
+ }
+ else
+ p++;
}
- }
- if ((file) && (fname))
+ }
+ if ((file) && (fname))
source_fetch_file(file, fname);
if (file) free(file);
@@ -230,3 +230,4 @@ source_fontmap_load(Eet_File *ef)
fl = eet_data_read(ef, _font_list_edd, "edje_source_fontmap");
return fl;
}
+
diff --git a/src/bin/edje/edje_codegen.c b/src/bin/edje/edje_codegen.c
index 0b2412fa37..cbca138429 100644
--- a/src/bin/edje/edje_codegen.c
+++ b/src/bin/edje/edje_codegen.c
@@ -19,8 +19,8 @@
#include "Edje_Edit.h"
static int _log_dom;
-#define DBG(...) EINA_LOG_DOM_DBG(_log_dom, __VA_ARGS__)
-#define ERR(...) EINA_LOG_DOM_ERR(_log_dom, __VA_ARGS__)
+#define DBG(...) EINA_LOG_DOM_DBG(_log_dom, __VA_ARGS__)
+#define ERR(...) EINA_LOG_DOM_ERR(_log_dom, __VA_ARGS__)
static Ecore_Evas *ee = NULL;
static char *file = NULL;
@@ -30,31 +30,31 @@ static FILE *source_fd = NULL;
static FILE *header_fd = NULL;
static Eina_List *externals = NULL;
-#define H_HEADER \
- "#ifndef _%s\n" \
- "#define _%s\n\n" \
- "#include <Edje.h>\n" \
- "#include <Evas.h>\n\n" \
+#define H_HEADER \
+ "#ifndef _%s\n" \
+ "#define _%s\n\n" \
+ "#include <Edje.h>\n" \
+ "#include <Evas.h>\n\n" \
"#include <stdlib.h>\n\n"
-#define H_FOOTER \
+#define H_FOOTER \
"\n#endif /* _%s */\n"
-#define C_HEADER \
+#define C_HEADER \
"#include \"%s\"\n\n"
-#define C_CODEGEN_OBJECT_ADD \
- "Evas_Object *\n" \
- "%s_object_add(Evas *e, const char *file)\n" \
- "{\n" \
- " Evas_Object *o;\n\n" \
- " o = edje_object_add(e);\n" \
- " if (!o) return NULL;\n\n" \
- " if (file)\n" \
- " edje_object_file_set(o, file, \"%s\");\n" \
- " else\n" \
- " edje_object_file_set(o, \"%s\", \"%s\");\n\n" \
- " return o;\n" \
+#define C_CODEGEN_OBJECT_ADD \
+ "Evas_Object *\n" \
+ "%s_object_add(Evas *e, const char *file)\n" \
+ "{\n" \
+ " Evas_Object *o;\n\n" \
+ " o = edje_object_add(e);\n" \
+ " if (!o) return NULL;\n\n" \
+ " if (file)\n" \
+ " edje_object_file_set(o, file, \"%s\");\n" \
+ " else\n" \
+ " edje_object_file_set(o, \"%s\", \"%s\");\n\n" \
+ " return o;\n" \
"}\n\n"
#define H_CODEGEN_OBJECT_ADD \
@@ -64,118 +64,118 @@ static Eina_List *externals = NULL;
" * to edje_codegen\n */\n" \
"Evas_Object *%s_object_add(Evas *e, const char *file);\n\n"
-#define C_CODEGEN_DRAG_SET(option) \
- "Eina_Bool\n" \
- "%s_%s_drag_"#option"_set(Evas_Object *o, double dx, double dy)\n" \
- "{\n" \
- " return edje_object_part_drag_"#option"_set(o, \"%s\", dx, dy);\n" \
- "}\n\n"
-
-#define H_CODEGEN_DRAG_SET(option) \
- "Eina_Bool %s_%s_drag_"#option"_set(Evas_Object *o, double dx, double dy);\n"
-
-#define C_CODEGEN_DRAG_GET(option) \
- "Eina_Bool\n" \
- "%s_%s_drag_"#option"_get(Evas_Object *o, double *dx, double *dy)\n" \
- "{\n" \
- " return edje_object_part_drag_"#option"_get(o, \"%s\", dx, dy);\n" \
- "}\n\n"
-
-#define H_CODEGEN_DRAG_GET(option) \
- "Eina_Bool %s_%s_drag_"#option"_get(Evas_Object *o, double *dx" \
- ", double *dy);\n"
-
-#define C_CODEGEN_DRAG_ACTION(option) \
- "Eina_Bool\n" \
- "%s_%s_drag_"#option"(Evas_Object *o, double dx, double dy)\n" \
- "{\n" \
- " return edje_object_part_drag_"#option"(o, \"%s\", dx, dy);\n" \
- "}\n\n"
-
-#define H_CODEGEN_DRAG_ACTION(option) \
- "Eina_Bool %s_%s_drag_"#option"(Evas_Object *o, double dx, double dy);\n"
-
-#define C_CODEGEN_DRAG_DIR_GET \
- "Edje_Drag_Dir\n" \
- "%s_%s_drag_dir_get(Evas_Object *o)\n" \
- "{\n" \
- " return edje_object_part_drag_dir_get(o, \"%s\");\n" \
+#define C_CODEGEN_DRAG_SET(option) \
+ "Eina_Bool\n" \
+ "%s_%s_drag_" #option "_set(Evas_Object *o, double dx, double dy)\n" \
+ "{\n" \
+ " return edje_object_part_drag_" #option "_set(o, \"%s\", dx, dy);\n" \
+ "}\n\n"
+
+#define H_CODEGEN_DRAG_SET(option) \
+ "Eina_Bool %s_%s_drag_" #option "_set(Evas_Object *o, double dx, double dy);\n"
+
+#define C_CODEGEN_DRAG_GET(option) \
+ "Eina_Bool\n" \
+ "%s_%s_drag_" #option "_get(Evas_Object *o, double *dx, double *dy)\n" \
+ "{\n" \
+ " return edje_object_part_drag_" #option "_get(o, \"%s\", dx, dy);\n" \
+ "}\n\n"
+
+#define H_CODEGEN_DRAG_GET(option) \
+ "Eina_Bool %s_%s_drag_" #option "_get(Evas_Object *o, double *dx" \
+ ", double *dy);\n"
+
+#define C_CODEGEN_DRAG_ACTION(option) \
+ "Eina_Bool\n" \
+ "%s_%s_drag_" #option "(Evas_Object *o, double dx, double dy)\n" \
+ "{\n" \
+ " return edje_object_part_drag_" #option "(o, \"%s\", dx, dy);\n" \
+ "}\n\n"
+
+#define H_CODEGEN_DRAG_ACTION(option) \
+ "Eina_Bool %s_%s_drag_" #option "(Evas_Object *o, double dx, double dy);\n"
+
+#define C_CODEGEN_DRAG_DIR_GET \
+ "Edje_Drag_Dir\n" \
+ "%s_%s_drag_dir_get(Evas_Object *o)\n" \
+ "{\n" \
+ " return edje_object_part_drag_dir_get(o, \"%s\");\n" \
"}\n\n"
-#define H_CODEGEN_DRAG_DIR_GET \
+#define H_CODEGEN_DRAG_DIR_GET \
"Edje_Drag_Dir %s_%s_drag_dir_get(Evas_Object *o);\n"
-#define C_CODEGEN_PART_TEXT_SET \
- "void\n" \
- "%s_%s_set(Evas_Object *o, const char *value)\n" \
- "{\n" \
- " edje_object_part_text_set(o, \"%s\", value);\n" \
+#define C_CODEGEN_PART_TEXT_SET \
+ "void\n" \
+ "%s_%s_set(Evas_Object *o, const char *value)\n" \
+ "{\n" \
+ " edje_object_part_text_set(o, \"%s\", value);\n" \
"}\n\n"
-#define H_CODEGEN_PART_TEXT_SET \
+#define H_CODEGEN_PART_TEXT_SET \
"void %s_%s_set(Evas_Object *o, const char *value);\n"
-#define C_CODEGEN_PART_SWALLOW_SET \
- "void\n" \
- "%s_%s_set(Evas_Object *o, Evas_Object *value)\n" \
- "{\n" \
- " edje_object_part_swallow(o, \"%s\", value);\n" \
+#define C_CODEGEN_PART_SWALLOW_SET \
+ "void\n" \
+ "%s_%s_set(Evas_Object *o, Evas_Object *value)\n" \
+ "{\n" \
+ " edje_object_part_swallow(o, \"%s\", value);\n" \
"}\n\n"
-#define H_CODEGEN_PART_SWALLOW_SET \
+#define H_CODEGEN_PART_SWALLOW_SET \
"void %s_%s_set(Evas_Object *o, Evas_Object *value);\n"
-#define C_CODEGEN_PART_TEXT_GET \
- "const char *\n" \
- "%s_%s_get(const Evas_Object *o)\n" \
- "{\n" \
- " return edje_object_part_text_get(o, \"%s\");\n" \
+#define C_CODEGEN_PART_TEXT_GET \
+ "const char *\n" \
+ "%s_%s_get(const Evas_Object *o)\n" \
+ "{\n" \
+ " return edje_object_part_text_get(o, \"%s\");\n" \
"}\n\n"
-#define H_CODEGEN_PART_TEXT_GET \
+#define H_CODEGEN_PART_TEXT_GET \
"const char *%s_%s_get(const Evas_Object *o);\n"
-#define C_CODEGEN_PART_SWALLOW_GET \
- "Evas_Object *\n" \
- "%s_%s_get(const Evas_Object *o)\n" \
- "{\n" \
- " return edje_object_part_swallow_get(o, \"%s\");\n" \
+#define C_CODEGEN_PART_SWALLOW_GET \
+ "Evas_Object *\n" \
+ "%s_%s_get(const Evas_Object *o)\n" \
+ "{\n" \
+ " return edje_object_part_swallow_get(o, \"%s\");\n" \
"}\n\n"
-#define H_CODEGEN_PART_SWALLOW_GET \
+#define H_CODEGEN_PART_SWALLOW_GET \
"Evas_Object *%s_%s_get(const Evas_Object *o);\n"
-#define C_CODEGEN_PART_BOX_APPEND \
- "Eina_Bool\n" \
- "%s_%s_append(Evas_Object *o, Evas_Object *child)\n" \
- "{\n" \
- " return edje_object_part_box_append(o, \"%s\", child);\n" \
+#define C_CODEGEN_PART_BOX_APPEND \
+ "Eina_Bool\n" \
+ "%s_%s_append(Evas_Object *o, Evas_Object *child)\n" \
+ "{\n" \
+ " return edje_object_part_box_append(o, \"%s\", child);\n" \
"}\n\n"
-#define H_CODEGEN_PART_BOX_APPEND \
+#define H_CODEGEN_PART_BOX_APPEND \
"Eina_Bool %s_%s_append(Evas_Object *o, Evas_Object *child);\n"
-#define C_CODEGEN_PART_BOX_PREPEND \
- "Eina_Bool\n" \
- "%s_%s_prepend(Evas_Object *o, Evas_Object *child)\n" \
- "{\n" \
- " return edje_object_part_box_prepend(o, \"%s\", child);\n" \
+#define C_CODEGEN_PART_BOX_PREPEND \
+ "Eina_Bool\n" \
+ "%s_%s_prepend(Evas_Object *o, Evas_Object *child)\n" \
+ "{\n" \
+ " return edje_object_part_box_prepend(o, \"%s\", child);\n" \
"}\n\n"
-#define H_CODEGEN_PART_BOX_PREPEND \
+#define H_CODEGEN_PART_BOX_PREPEND \
"Eina_Bool %s_%s_prepend(Evas_Object *o, Evas_Object *child);\n"
-#define C_CODEGEN_PART_BOX_INSERT_BEFORE \
- "Eina_Bool\n" \
- "%s_%s_insert_before(Evas_Object *o, Evas_Object *child, " \
- "const Evas_Object *reference)\n" \
- "{\n" \
- " return edje_object_part_box_insert_before(o, \"%s\", " \
- "child, reference);\n" \
+#define C_CODEGEN_PART_BOX_INSERT_BEFORE \
+ "Eina_Bool\n" \
+ "%s_%s_insert_before(Evas_Object *o, Evas_Object *child, " \
+ "const Evas_Object *reference)\n" \
+ "{\n" \
+ " return edje_object_part_box_insert_before(o, \"%s\", " \
+ "child, reference);\n" \
"}\n\n"
-#define H_CODEGEN_PART_BOX_INSERT_BEFORE \
- "Eina_Bool %s_%s_insert_before(Evas_Object *o, Evas_Object *child, " \
+#define H_CODEGEN_PART_BOX_INSERT_BEFORE \
+ "Eina_Bool %s_%s_insert_before(Evas_Object *o, Evas_Object *child, " \
"const Evas_Object *reference);\n"
#define C_CODEGEN_PART_BOX_INSERT_AT \
@@ -185,38 +185,38 @@ static Eina_List *externals = NULL;
" return edje_object_part_box_insert_at(o, \"%s\", child, pos);\n" \
"}\n\n"
-#define H_CODEGEN_PART_BOX_INSERT_AT \
- "Eina_Bool %s_%s_insert_at(Evas_Object *o, Evas_Object *child, " \
+#define H_CODEGEN_PART_BOX_INSERT_AT \
+ "Eina_Bool %s_%s_insert_at(Evas_Object *o, Evas_Object *child, " \
"unsigned int pos);\n"
-#define C_CODEGEN_PART_BOX_REMOVE \
- "Evas_Object *\n" \
- "%s_%s_remove(Evas_Object *o, Evas_Object *child)\n" \
- "{\n" \
- " return edje_object_part_box_remove(o, \"%s\", child);\n" \
+#define C_CODEGEN_PART_BOX_REMOVE \
+ "Evas_Object *\n" \
+ "%s_%s_remove(Evas_Object *o, Evas_Object *child)\n" \
+ "{\n" \
+ " return edje_object_part_box_remove(o, \"%s\", child);\n" \
"}\n\n"
-#define H_CODEGEN_PART_BOX_REMOVE \
+#define H_CODEGEN_PART_BOX_REMOVE \
"Evas_Object *%s_%s_remove(Evas_Object *o, Evas_Object *child);\n"
-#define C_CODEGEN_PART_BOX_REMOVE_AT \
- "Evas_Object *\n" \
- "%s_%s_remove_at(Evas_Object *o, unsigned int pos)\n" \
- "{\n" \
- " return edje_object_part_box_remove_at(o, \"%s\", pos);\n" \
+#define C_CODEGEN_PART_BOX_REMOVE_AT \
+ "Evas_Object *\n" \
+ "%s_%s_remove_at(Evas_Object *o, unsigned int pos)\n" \
+ "{\n" \
+ " return edje_object_part_box_remove_at(o, \"%s\", pos);\n" \
"}\n\n"
-#define H_CODEGEN_PART_BOX_REMOVE_AT \
+#define H_CODEGEN_PART_BOX_REMOVE_AT \
"Evas_Object *%s_%s_remove_at(Evas_Object *o, unsigned int pos);\n"
-#define C_CODEGEN_PART_BOX_REMOVE_ALL \
- "Eina_Bool\n" \
- "%s_%s_remove_all(Evas_Object *o, Eina_Bool clear)\n" \
- "{\n" \
- " return edje_object_part_box_remove_all(o, \"%s\", clear);\n" \
+#define C_CODEGEN_PART_BOX_REMOVE_ALL \
+ "Eina_Bool\n" \
+ "%s_%s_remove_all(Evas_Object *o, Eina_Bool clear)\n" \
+ "{\n" \
+ " return edje_object_part_box_remove_all(o, \"%s\", clear);\n" \
"}\n\n"
-#define H_CODEGEN_PART_BOX_REMOVE_ALL \
+#define H_CODEGEN_PART_BOX_REMOVE_ALL \
"Eina_Bool %s_%s_remove_all(Evas_Object *o, Eina_Bool clear);\n"
#define C_CODEGEN_PART_TABLE_CHILD_GET \
@@ -226,8 +226,8 @@ static Eina_List *externals = NULL;
" return edje_object_part_table_child_get(o, \"%s\", col, row);\n" \
"}\n\n"
-#define H_CODEGEN_PART_TABLE_CHILD_GET \
- "Evas_Object * %s_%s_child_get(Evas_Object *o, unsigned int col, " \
+#define H_CODEGEN_PART_TABLE_CHILD_GET \
+ "Evas_Object * %s_%s_child_get(Evas_Object *o, unsigned int col, " \
"unsigned int row);\n"
#define C_CODEGEN_PART_TABLE_PACK \
@@ -239,132 +239,132 @@ static Eina_List *externals = NULL;
"colspan, rowspan);\n" \
"}\n\n"
-#define H_CODEGEN_PART_TABLE_PACK \
- "Eina_Bool %s_%s_pack(Evas_Object *o, Evas_Object *child, " \
- "unsigned short col, unsigned short row, unsigned short " \
+#define H_CODEGEN_PART_TABLE_PACK \
+ "Eina_Bool %s_%s_pack(Evas_Object *o, Evas_Object *child, " \
+ "unsigned short col, unsigned short row, unsigned short " \
"colspan, unsigned short rowspan);\n"
-#define C_CODEGEN_PART_TABLE_UNPACK \
- "Eina_Bool\n" \
- "%s_%s_unpack(Evas_Object *o, Evas_Object *child)\n" \
- "{\n" \
- " return edje_object_part_table_unpack(o, \"%s\", child);\n" \
+#define C_CODEGEN_PART_TABLE_UNPACK \
+ "Eina_Bool\n" \
+ "%s_%s_unpack(Evas_Object *o, Evas_Object *child)\n" \
+ "{\n" \
+ " return edje_object_part_table_unpack(o, \"%s\", child);\n" \
"}\n\n"
-#define H_CODEGEN_PART_TABLE_UNPACK \
+#define H_CODEGEN_PART_TABLE_UNPACK \
"Eina_Bool %s_%s_unpack(Evas_Object *o, Evas_Object *child);\n"
-#define C_CODEGEN_PART_TABLE_CLEAR \
- "Eina_Bool\n" \
- "%s_%s_clear(Evas_Object *o, Eina_Bool clear)\n" \
- "{\n" \
- " return edje_object_part_table_clear(o, \"%s\", clear);\n" \
+#define C_CODEGEN_PART_TABLE_CLEAR \
+ "Eina_Bool\n" \
+ "%s_%s_clear(Evas_Object *o, Eina_Bool clear)\n" \
+ "{\n" \
+ " return edje_object_part_table_clear(o, \"%s\", clear);\n" \
"}\n\n"
-#define H_CODEGEN_PART_TABLE_CLEAR \
+#define H_CODEGEN_PART_TABLE_CLEAR \
"Eina_Bool %s_%s_clear(Evas_Object *o, Eina_Bool clear);\n"
-#define C_CODEGEN_PART_TABLE_COL_ROW_SIZE_GET \
- "Eina_Bool\n" \
- "%s_%s_col_row_size_get(Evas_Object *o, int *cols, int *rows)\n" \
- "{\n" \
- " return edje_object_part_table_col_row_size_get(o, \"%s\", " \
- "cols, rows);\n" \
+#define C_CODEGEN_PART_TABLE_COL_ROW_SIZE_GET \
+ "Eina_Bool\n" \
+ "%s_%s_col_row_size_get(Evas_Object *o, int *cols, int *rows)\n" \
+ "{\n" \
+ " return edje_object_part_table_col_row_size_get(o, \"%s\", " \
+ "cols, rows);\n" \
"}\n\n"
-#define H_CODEGEN_PART_TABLE_COL_ROW_SIZE_GET \
+#define H_CODEGEN_PART_TABLE_COL_ROW_SIZE_GET \
"Eina_Bool %s_%s_col_row_size_get(Evas_Object *o, int *cols, int *rows);\n"
-#define C_CODEGEN_PART_EXTERNAL_PARAM_SET(type, param_type, field) \
- "Eina_Bool\n" \
- "%s_%s_%s_set(Evas_Object *o, "type"value)\n" \
- "{\n" \
- " Edje_External_Param param;\n\n" \
- " param.name = \"%s\";\n" \
- " param.type = "param_type";\n" \
- " param."field" = value;\n" \
- " return edje_object_part_external_param_set(o, \"%s\", &param);\n" \
- "}\n\n"
-
-#define H_CODEGEN_PART_EXTERNAL_PARAM_SET(type) \
- "Eina_Bool %s_%s_%s_set(Evas_Object *o, "type"value);\n"
-
-#define C_CODEGEN_PART_EXTERNAL_PARAM_GET(type, param_type, field) \
- "Eina_Bool\n" \
- "%s_%s_%s_get(Evas_Object *o, "type"*value)\n" \
- "{\n" \
- " if (!value) return EINA_FALSE;\n\n" \
- " Edje_External_Param param;\n\n" \
- " param.name = \"%s\";\n" \
- " param.type = "param_type";\n" \
- " if (!edje_object_part_external_param_get(o, \"%s\", &param))\n" \
- " return EINA_FALSE;\n\n" \
- " *value = param."field";\n" \
- " return EINA_TRUE;\n" \
+#define C_CODEGEN_PART_EXTERNAL_PARAM_SET(type, param_type, field) \
+ "Eina_Bool\n" \
+ "%s_%s_%s_set(Evas_Object *o, "type "value)\n" \
+ "{\n" \
+ " Edje_External_Param param;\n\n" \
+ " param.name = \"%s\";\n" \
+ " param.type = "param_type ";\n" \
+ " param."field " = value;\n" \
+ " return edje_object_part_external_param_set(o, \"%s\", &param);\n" \
+ "}\n\n"
+
+#define H_CODEGEN_PART_EXTERNAL_PARAM_SET(type) \
+ "Eina_Bool %s_%s_%s_set(Evas_Object *o, "type "value);\n"
+
+#define C_CODEGEN_PART_EXTERNAL_PARAM_GET(type, param_type, field) \
+ "Eina_Bool\n" \
+ "%s_%s_%s_get(Evas_Object *o, "type "*value)\n" \
+ "{\n" \
+ " if (!value) return EINA_FALSE;\n\n" \
+ " Edje_External_Param param;\n\n" \
+ " param.name = \"%s\";\n" \
+ " param.type = "param_type ";\n" \
+ " if (!edje_object_part_external_param_get(o, \"%s\", &param))\n" \
+ " return EINA_FALSE;\n\n" \
+ " *value = param."field ";\n" \
+ " return EINA_TRUE;\n" \
+ "}\n\n"
+
+#define H_CODEGEN_PART_EXTERNAL_PARAM_GET(type) \
+ "Eina_Bool %s_%s_%s_get(Evas_Object *o, "type "*value);\n"
+
+#define C_CODEGEN_PROGRAM_EMIT \
+ "void\n" \
+ "%s_%s_emit(Evas_Object *o)\n" \
+ "{\n" \
+ " edje_object_signal_emit(o, \"%s\", \"%s\");\n" \
"}\n\n"
-#define H_CODEGEN_PART_EXTERNAL_PARAM_GET(type) \
- "Eina_Bool %s_%s_%s_get(Evas_Object *o, "type"*value);\n"
-
-#define C_CODEGEN_PROGRAM_EMIT \
- "void\n" \
- "%s_%s_emit(Evas_Object *o)\n" \
- "{\n" \
- " edje_object_signal_emit(o, \"%s\", \"%s\");\n" \
- "}\n\n"
-
-#define H_CODEGEN_PROGRAM_EMIT \
+#define H_CODEGEN_PROGRAM_EMIT \
"void %s_%s_emit(Evas_Object *o);\n"
-#define C_CODEGEN_PROGRAM_CALLBACK_ADD \
- "void\n" \
- "%s_%s_callback_add(Evas_Object *o, Edje_Signal_Cb func, void *data)\n" \
- "{\n" \
- " edje_object_signal_callback_add(o, \"%s\", \"%s\", func, data);\n" \
+#define C_CODEGEN_PROGRAM_CALLBACK_ADD \
+ "void\n" \
+ "%s_%s_callback_add(Evas_Object *o, Edje_Signal_Cb func, void *data)\n" \
+ "{\n" \
+ " edje_object_signal_callback_add(o, \"%s\", \"%s\", func, data);\n" \
"}\n\n"
-#define H_CODEGEN_PROGRAM_CALLBACK_ADD \
- "void %s_%s_callback_add(Evas_Object *o, Edje_Signal_Cb func, " \
+#define H_CODEGEN_PROGRAM_CALLBACK_ADD \
+ "void %s_%s_callback_add(Evas_Object *o, Edje_Signal_Cb func, " \
"void *data);\n"
-#define C_CODEGEN_PROGRAM_CALLBACK_DEL \
- "void\n" \
- "%s_%s_callback_del_full(Evas_Object *o, Edje_Signal_Cb func, void *data)\n" \
- "{\n" \
- " edje_object_signal_callback_del_full(o, \"%s\", \"%s\", func, data);\n" \
+#define C_CODEGEN_PROGRAM_CALLBACK_DEL \
+ "void\n" \
+ "%s_%s_callback_del_full(Evas_Object *o, Edje_Signal_Cb func, void *data)\n" \
+ "{\n" \
+ " edje_object_signal_callback_del_full(o, \"%s\", \"%s\", func, data);\n" \
"}\n\n"
-#define H_CODEGEN_PROGRAM_CALLBACK_DEL \
- "void %s_%s_callback_del_full(Evas_Object *o, Edje_Signal_Cb func, " \
+#define H_CODEGEN_PROGRAM_CALLBACK_DEL \
+ "void %s_%s_callback_del_full(Evas_Object *o, Edje_Signal_Cb func, " \
"void *data);\n"
-
typedef struct _Part_External_Info Part_External_Info;
-struct _Part_External_Info {
- const char *description, *name, *source;
- char *apiname;
- Eina_Bool draggable;
+struct _Part_External_Info
+{
+ const char *description, *name, *source;
+ char *apiname;
+ Eina_Bool draggable;
};
const Ecore_Getopt optdesc = {
- "edje_codegen",
- "%prog [options] <file.edj> <group> <source_file_name> <header_file_name>",
- PACKAGE_VERSION,
- "(C) 2012 - The Enlightenment Project",
- "BSD",
- "Edje generates the boilerplate code to get and set the "
- "parts of a group from a compiled (binary) edje "
- "file avoiding common errors with typos.\n",
- 0,
- {
- ECORE_GETOPT_STORE_STR('p', "prefix", "The prefix for the " \
- "generataed code."),
- ECORE_GETOPT_LICENSE('L', "license"),
- ECORE_GETOPT_COPYRIGHT('C', "copyright"),
- ECORE_GETOPT_VERSION('V', "version"),
- ECORE_GETOPT_HELP('h', "help"),
- ECORE_GETOPT_SENTINEL
- }
+ "edje_codegen",
+ "%prog [options] <file.edj> <group> <source_file_name> <header_file_name>",
+ PACKAGE_VERSION,
+ "(C) 2012 - The Enlightenment Project",
+ "BSD",
+ "Edje generates the boilerplate code to get and set the "
+ "parts of a group from a compiled (binary) edje "
+ "file avoiding common errors with typos.\n",
+ 0,
+ {
+ ECORE_GETOPT_STORE_STR('p', "prefix", "The prefix for the " \
+ "generataed code."),
+ ECORE_GETOPT_LICENSE('L', "license"),
+ ECORE_GETOPT_COPYRIGHT('C', "copyright"),
+ ECORE_GETOPT_VERSION('V', "version"),
+ ECORE_GETOPT_HELP('h', "help"),
+ ECORE_GETOPT_SENTINEL
+ }
};
static char *
@@ -397,7 +397,7 @@ _open_file_descriptors(const char *source, const char *header)
return EINA_TRUE;
- err:
+err:
fclose(header_fd);
return EINA_FALSE;
}
@@ -426,15 +426,15 @@ _write_headers(const char *filename)
snprintf(buf, sizeof(buf), H_HEADER, str, str);
if (fwrite(buf, strlen(buf), 1, header_fd) != 1)
{
- free(str);
- return EINA_FALSE;
+ free(str);
+ return EINA_FALSE;
}
free(str);
snprintf(buf, sizeof(buf), C_HEADER, filename);
if (fwrite(buf, strlen(buf), 1, source_fd) != 1)
- return EINA_FALSE;
+ return EINA_FALSE;
return EINA_TRUE;
}
@@ -449,8 +449,8 @@ _write_footer(const char *filename)
snprintf(buf, sizeof(buf), H_FOOTER, str);
if (fwrite(buf, strlen(buf), 1, header_fd) != 1)
{
- free(str);
- return EINA_FALSE;
+ free(str);
+ return EINA_FALSE;
}
free(str);
@@ -479,20 +479,20 @@ _write_part_draggable(const char *apiname, const char *partname)
{
char buf[1024];
-#define TEMPLATE_DRAGGABLE(sufix, option) \
- do { \
- const char *template; \
- template = C_CODEGEN_DRAG_##sufix(option); \
- snprintf(buf, sizeof(buf), template, prefix, apiname, \
- partname); \
- if (fwrite(buf, strlen(buf), 1, source_fd) != 1) \
- return EINA_FALSE; \
- template = H_CODEGEN_DRAG_##sufix(option); \
- snprintf(buf, sizeof(buf), template, prefix, \
- apiname); \
- if (fwrite(buf, strlen(buf), 1, header_fd) != 1) \
- return EINA_FALSE; \
- } while (0)
+#define TEMPLATE_DRAGGABLE(sufix, option) \
+ do { \
+ const char *template; \
+ template = C_CODEGEN_DRAG_##sufix(option); \
+ snprintf(buf, sizeof(buf), template, prefix, apiname, \
+ partname); \
+ if (fwrite(buf, strlen(buf), 1, source_fd) != 1) \
+ return EINA_FALSE; \
+ template = H_CODEGEN_DRAG_##sufix(option); \
+ snprintf(buf, sizeof(buf), template, prefix, \
+ apiname); \
+ if (fwrite(buf, strlen(buf), 1, header_fd) != 1) \
+ return EINA_FALSE; \
+ } while (0)
TEMPLATE_DRAGGABLE(SET, value);
TEMPLATE_DRAGGABLE(GET, value);
@@ -508,7 +508,7 @@ _write_part_draggable(const char *apiname, const char *partname)
#undef TEMPLATE_DRAGGABLE
snprintf(buf, sizeof(buf), C_CODEGEN_DRAG_DIR_GET, prefix,
- apiname, partname);
+ apiname, partname);
if (fwrite(buf, strlen(buf), 1, source_fd) != 1)
return EINA_FALSE;
snprintf(buf, sizeof(buf), H_CODEGEN_DRAG_DIR_GET, prefix, apiname);
@@ -520,55 +520,60 @@ _write_part_draggable(const char *apiname, const char *partname)
static Eina_Bool
_write_part_external_param(const Part_External_Info *info,
- const Edje_External_Param_Info *param)
+ const Edje_External_Param_Info *param)
{
const char *template;
char buf[1024];
-#define WRITE_TEMPLATE(type, param_type, field) \
- do { \
- template = C_CODEGEN_PART_EXTERNAL_PARAM_SET(type, param_type, field); \
- snprintf(buf, sizeof(buf), template, info->apiname, info->name, \
- param->name, param->name, info->name); \
- if (fwrite(buf, strlen(buf), 1, source_fd) != 1) \
- return EINA_FALSE; \
- template = H_CODEGEN_PART_EXTERNAL_PARAM_SET(type); \
- snprintf(buf, sizeof(buf), template, info->apiname, info->name, \
- param->name); \
- if (fwrite(buf, strlen(buf), 1, header_fd) != 1) \
- return EINA_FALSE; \
- template = \
- C_CODEGEN_PART_EXTERNAL_PARAM_GET(type, param_type, field); \
- snprintf(buf, sizeof(buf), template, info->apiname, info->name, \
- param->name, param->name, info->name); \
- if (fwrite(buf, strlen(buf), 1, source_fd) != 1) \
- return EINA_FALSE; \
- template = H_CODEGEN_PART_EXTERNAL_PARAM_GET(type); \
- snprintf(buf, sizeof(buf), template, info->apiname, info->name, \
- param->name); \
- if (fwrite(buf, strlen(buf), 1, header_fd) != 1) \
- return EINA_FALSE; \
- } while (0)
+#define WRITE_TEMPLATE(type, param_type, field) \
+ do { \
+ template = C_CODEGEN_PART_EXTERNAL_PARAM_SET(type, param_type, field); \
+ snprintf(buf, sizeof(buf), template, info->apiname, info->name, \
+ param->name, param->name, info->name); \
+ if (fwrite(buf, strlen(buf), 1, source_fd) != 1) \
+ return EINA_FALSE; \
+ template = H_CODEGEN_PART_EXTERNAL_PARAM_SET(type); \
+ snprintf(buf, sizeof(buf), template, info->apiname, info->name, \
+ param->name); \
+ if (fwrite(buf, strlen(buf), 1, header_fd) != 1) \
+ return EINA_FALSE; \
+ template = \
+ C_CODEGEN_PART_EXTERNAL_PARAM_GET(type, param_type, field); \
+ snprintf(buf, sizeof(buf), template, info->apiname, info->name, \
+ param->name, param->name, info->name); \
+ if (fwrite(buf, strlen(buf), 1, source_fd) != 1) \
+ return EINA_FALSE; \
+ template = H_CODEGEN_PART_EXTERNAL_PARAM_GET(type); \
+ snprintf(buf, sizeof(buf), template, info->apiname, info->name, \
+ param->name); \
+ if (fwrite(buf, strlen(buf), 1, header_fd) != 1) \
+ return EINA_FALSE; \
+ } while (0)
switch (param->type)
{
case EDJE_EXTERNAL_PARAM_TYPE_INT:
- WRITE_TEMPLATE("int ", "EDJE_EXTERNAL_PARAM_TYPE_INT", "i");
- break;
+ WRITE_TEMPLATE("int ", "EDJE_EXTERNAL_PARAM_TYPE_INT", "i");
+ break;
+
case EDJE_EXTERNAL_PARAM_TYPE_DOUBLE:
- WRITE_TEMPLATE("double ", "EDJE_EXTERNAL_PARAM_TYPE_DOUBLE", "d");
- break;
+ WRITE_TEMPLATE("double ", "EDJE_EXTERNAL_PARAM_TYPE_DOUBLE", "d");
+ break;
+
case EDJE_EXTERNAL_PARAM_TYPE_STRING:
- WRITE_TEMPLATE("const char *", "EDJE_EXTERNAL_PARAM_TYPE_STRING", "s");
- break;
+ WRITE_TEMPLATE("const char *", "EDJE_EXTERNAL_PARAM_TYPE_STRING", "s");
+ break;
+
case EDJE_EXTERNAL_PARAM_TYPE_BOOL:
- WRITE_TEMPLATE("Eina_Bool ", "EDJE_EXTERNAL_PARAM_TYPE_BOOL", "i");
- break;
+ WRITE_TEMPLATE("Eina_Bool ", "EDJE_EXTERNAL_PARAM_TYPE_BOOL", "i");
+ break;
+
case EDJE_EXTERNAL_PARAM_TYPE_CHOICE:
- WRITE_TEMPLATE("const char *", "EDJE_EXTERNAL_PARAM_TYPE_CHOICE", "s");
- break;
+ WRITE_TEMPLATE("const char *", "EDJE_EXTERNAL_PARAM_TYPE_CHOICE", "s");
+ break;
+
default:
- break;
+ break;
}
#undef WRITE_TEMPLATE
@@ -606,49 +611,48 @@ _write_part_external(Eina_List **parts)
continue;
}
- EINA_LIST_FOREACH_SAFE(*parts, l, l_next, ei)
- {
- if (!strcmp(ei->source, name))
- {
- if (ei->description)
- {
- snprintf(buf, sizeof(buf), "\n/**\n * @brief %s\n */\n",
- ei->description);
- if (fwrite(buf, strlen(buf), 1, header_fd) != 1)
- {
- ret = EINA_FALSE;
- goto end;
- }
- }
+ EINA_LIST_FOREACH_SAFE(*parts, l, l_next, ei)
+ {
+ if (!strcmp(ei->source, name))
+ {
+ if (ei->description)
+ {
+ snprintf(buf, sizeof(buf), "\n/**\n * @brief %s\n */\n",
+ ei->description);
+ if (fwrite(buf, strlen(buf), 1, header_fd) != 1)
+ {
+ ret = EINA_FALSE;
+ goto end;
+ }
+ }
if (ei->draggable)
{
- if (!_write_part_draggable(ei->apiname, ei->name))
- {
- ret = EINA_FALSE;
- goto end;
- }
+ if (!_write_part_draggable(ei->apiname, ei->name))
+ {
+ ret = EINA_FALSE;
+ goto end;
+ }
}
- for (param = type->parameters_info; param->name != NULL;
- param++)
- if (!_write_part_external_param(ei, param))
- {
- ret = EINA_FALSE;
- goto end;
- }
+ for (param = type->parameters_info; param->name != NULL;
+ param++)
+ if (!_write_part_external_param(ei, param))
+ {
+ ret = EINA_FALSE;
+ goto end;
+ }
- edje_edit_string_free(ei->description);
- free(ei->apiname);
- free(ei);
+ edje_edit_string_free(ei->description);
+ free(ei->apiname);
+ free(ei);
- *parts = eina_list_remove_list(*parts, l);
-
- }
- }
+ *parts = eina_list_remove_list(*parts, l);
+ }
+ }
}
- end:
+end:
if (eina_list_count(*parts) == 0) *parts = NULL;
eina_iterator_free(itr);
@@ -661,57 +665,57 @@ _write_part(const char *apiname, const char *partname, Edje_Part_Type parttype,
{
char buf[512];
-#define TEMPLATE_NAME(sufix) \
- do { \
- snprintf(buf, sizeof(buf), C_CODEGEN_##sufix, prefix, \
- apiname, partname); \
- if (fwrite(buf, strlen(buf), 1, source_fd) != 1) \
- goto err; \
- snprintf(buf, sizeof(buf), H_CODEGEN_##sufix, prefix, \
- apiname); \
- if (fwrite(buf, strlen(buf), 1, header_fd) != 1) \
- goto err; \
- } while (0)
+#define TEMPLATE_NAME(sufix) \
+ do { \
+ snprintf(buf, sizeof(buf), C_CODEGEN_##sufix, prefix, \
+ apiname, partname); \
+ if (fwrite(buf, strlen(buf), 1, source_fd) != 1) \
+ goto err; \
+ snprintf(buf, sizeof(buf), H_CODEGEN_##sufix, prefix, \
+ apiname); \
+ if (fwrite(buf, strlen(buf), 1, header_fd) != 1) \
+ goto err; \
+ } while (0)
if (description)
{
- snprintf(buf, sizeof(buf), "\n/**\n * @brief %s\n */\n", description);
- if (fwrite(buf, strlen(buf), 1, header_fd) != 1)
- goto err;
+ snprintf(buf, sizeof(buf), "\n/**\n * @brief %s\n */\n", description);
+ if (fwrite(buf, strlen(buf), 1, header_fd) != 1)
+ goto err;
}
switch (parttype)
{
case EDJE_PART_TYPE_BOX:
- TEMPLATE_NAME(PART_BOX_APPEND);
- TEMPLATE_NAME(PART_BOX_PREPEND);
- TEMPLATE_NAME(PART_BOX_INSERT_BEFORE);
- TEMPLATE_NAME(PART_BOX_INSERT_AT);
- TEMPLATE_NAME(PART_BOX_REMOVE);
- TEMPLATE_NAME(PART_BOX_REMOVE_AT);
- TEMPLATE_NAME(PART_BOX_REMOVE_ALL);
- break;
+ TEMPLATE_NAME(PART_BOX_APPEND);
+ TEMPLATE_NAME(PART_BOX_PREPEND);
+ TEMPLATE_NAME(PART_BOX_INSERT_BEFORE);
+ TEMPLATE_NAME(PART_BOX_INSERT_AT);
+ TEMPLATE_NAME(PART_BOX_REMOVE);
+ TEMPLATE_NAME(PART_BOX_REMOVE_AT);
+ TEMPLATE_NAME(PART_BOX_REMOVE_ALL);
+ break;
case EDJE_PART_TYPE_TABLE:
- TEMPLATE_NAME(PART_TABLE_PACK);
- TEMPLATE_NAME(PART_TABLE_UNPACK);
- TEMPLATE_NAME(PART_TABLE_CHILD_GET);
- TEMPLATE_NAME(PART_TABLE_CLEAR);
- TEMPLATE_NAME(PART_TABLE_COL_ROW_SIZE_GET);
- break;
+ TEMPLATE_NAME(PART_TABLE_PACK);
+ TEMPLATE_NAME(PART_TABLE_UNPACK);
+ TEMPLATE_NAME(PART_TABLE_CHILD_GET);
+ TEMPLATE_NAME(PART_TABLE_CLEAR);
+ TEMPLATE_NAME(PART_TABLE_COL_ROW_SIZE_GET);
+ break;
case EDJE_PART_TYPE_TEXT:
- TEMPLATE_NAME(PART_TEXT_SET);
- TEMPLATE_NAME(PART_TEXT_GET);
- break;
+ TEMPLATE_NAME(PART_TEXT_SET);
+ TEMPLATE_NAME(PART_TEXT_GET);
+ break;
case EDJE_PART_TYPE_SWALLOW:
- TEMPLATE_NAME(PART_SWALLOW_SET);
- TEMPLATE_NAME(PART_SWALLOW_GET);
- break;
+ TEMPLATE_NAME(PART_SWALLOW_SET);
+ TEMPLATE_NAME(PART_SWALLOW_GET);
+ break;
default:
- break;
+ break;
}
if (draggable)
@@ -722,7 +726,7 @@ _write_part(const char *apiname, const char *partname, Edje_Part_Type parttype,
return EINA_TRUE;
- err:
+err:
ERR("Could not write the part: %s", partname);
return EINA_FALSE;
}
@@ -783,71 +787,71 @@ _parse_parts(Evas_Object *ed)
parts = edje_edit_parts_list_get(ed);
EINA_LIST_FOREACH(parts, l, name)
{
- if (!(apiname = _part_api_name_get(ed, name)))
- {
- DBG("filter out part '%s': not API.", name);
- continue;
- }
-
- type = edje_edit_part_type_get(ed, name);
- if (!((type == EDJE_PART_TYPE_TEXT) ||
- (type == EDJE_PART_TYPE_SWALLOW) ||
- (type == EDJE_PART_TYPE_BOX) ||
- (type == EDJE_PART_TYPE_EXTERNAL) ||
- (type == EDJE_PART_TYPE_IMAGE) ||
- (type == EDJE_PART_TYPE_TABLE)))
- {
- ERR("Invalid part type %d", type);
- free(apiname);
- continue;
- }
+ if (!(apiname = _part_api_name_get(ed, name)))
+ {
+ DBG("filter out part '%s': not API.", name);
+ continue;
+ }
+
+ type = edje_edit_part_type_get(ed, name);
+ if (!((type == EDJE_PART_TYPE_TEXT) ||
+ (type == EDJE_PART_TYPE_SWALLOW) ||
+ (type == EDJE_PART_TYPE_BOX) ||
+ (type == EDJE_PART_TYPE_EXTERNAL) ||
+ (type == EDJE_PART_TYPE_IMAGE) ||
+ (type == EDJE_PART_TYPE_TABLE)))
+ {
+ ERR("Invalid part type %d", type);
+ free(apiname);
+ continue;
+ }
if (edje_edit_part_drag_x_get(ed, name) ||
edje_edit_part_drag_y_get(ed, name))
- draggable = EINA_TRUE;
+ draggable = EINA_TRUE;
else
- draggable = EINA_FALSE;
+ draggable = EINA_FALSE;
- description = edje_edit_part_api_description_get(ed, name);
- if (type == EDJE_PART_TYPE_EXTERNAL)
- {
- ei = calloc(1, sizeof(Part_External_Info));
- if (!ei)
+ description = edje_edit_part_api_description_get(ed, name);
+ if (type == EDJE_PART_TYPE_EXTERNAL)
+ {
+ ei = calloc(1, sizeof(Part_External_Info));
+ if (!ei)
{
free(apiname);
goto end;
}
- ei->description = description;
- ei->source = edje_edit_part_source_get(ed, name);
- ei->apiname = apiname;
- ei->name = name;
- ei->draggable = draggable;
-
- parts_external = eina_list_append(parts_external, ei);
- }
- else
- {
- if (!_write_part(apiname, name, type, description, draggable))
- {
- ret = EINA_FALSE;
- edje_edit_string_free(description);
- free(apiname);
- goto end;
- }
-
- edje_edit_string_free(description);
- free(apiname);
- }
+ ei->description = description;
+ ei->source = edje_edit_part_source_get(ed, name);
+ ei->apiname = apiname;
+ ei->name = name;
+ ei->draggable = draggable;
+
+ parts_external = eina_list_append(parts_external, ei);
+ }
+ else
+ {
+ if (!_write_part(apiname, name, type, description, draggable))
+ {
+ ret = EINA_FALSE;
+ edje_edit_string_free(description);
+ free(apiname);
+ goto end;
+ }
+
+ edje_edit_string_free(description);
+ free(apiname);
+ }
}
ret = _write_part_external(&parts_external);
- end:
+end:
edje_edit_string_list_free(parts);
EINA_LIST_FREE(parts_external, ei)
{
- edje_edit_string_free(ei->description);
- free(ei->apiname);
- free(ei);
+ edje_edit_string_free(ei->description);
+ free(ei->apiname);
+ free(ei);
}
return ret;
@@ -855,70 +859,70 @@ _parse_parts(Evas_Object *ed)
static Eina_Bool
_write_program_emit(const char *apiname, const char *source, const char *sig,
- const char *description)
+ const char *description)
{
char buf[512];
snprintf(buf, sizeof(buf), C_CODEGEN_PROGRAM_EMIT, prefix,
- apiname, sig, source);
+ apiname, sig, source);
if (fwrite(buf, strlen(buf), 1, source_fd) != 1)
goto err;
if (description)
{
- snprintf(buf, sizeof(buf), "\n/**\n * @brief %s\n */\n", description);
- if (fwrite(buf, strlen(buf), 1, header_fd) != 1)
- goto err;
+ snprintf(buf, sizeof(buf), "\n/**\n * @brief %s\n */\n", description);
+ if (fwrite(buf, strlen(buf), 1, header_fd) != 1)
+ goto err;
}
snprintf(buf, sizeof(buf), H_CODEGEN_PROGRAM_EMIT, prefix,
- apiname);
+ apiname);
if (fwrite(buf, strlen(buf), 1, header_fd) != 1)
goto err;
return EINA_TRUE;
- err:
+err:
ERR("Could not write the program: %s", apiname);
return EINA_FALSE;
}
static Eina_Bool
_write_program_add(const char *apiname, const char *source, const char *sig,
- const char *description)
+ const char *description)
{
- char buf[512];
+ char buf[512];
snprintf(buf, sizeof(buf), C_CODEGEN_PROGRAM_CALLBACK_ADD, prefix,
- apiname, sig, source);
+ apiname, sig, source);
if (fwrite(buf, strlen(buf), 1, source_fd) != 1)
goto err;
snprintf(buf, sizeof(buf), C_CODEGEN_PROGRAM_CALLBACK_DEL, prefix,
- apiname, sig, source);
+ apiname, sig, source);
if (fwrite(buf, strlen(buf), 1, source_fd) != 1)
goto err;
if (description)
{
- snprintf(buf, sizeof(buf), "\n/**\n * @brief %s\n */\n", description);
- if (fwrite(buf, strlen(buf), 1, header_fd) != 1)
- goto err;
+ snprintf(buf, sizeof(buf), "\n/**\n * @brief %s\n */\n", description);
+ if (fwrite(buf, strlen(buf), 1, header_fd) != 1)
+ goto err;
}
snprintf(buf, sizeof(buf), H_CODEGEN_PROGRAM_CALLBACK_ADD, prefix,
- apiname);
+ apiname);
if (fwrite(buf, strlen(buf), 1, header_fd) != 1)
goto err;
snprintf(buf, sizeof(buf), H_CODEGEN_PROGRAM_CALLBACK_DEL, prefix,
- apiname);
+ apiname);
if (fwrite(buf, strlen(buf), 1, header_fd) != 1)
goto err;
return EINA_TRUE;
- err:
+err:
ERR("Could not write the program [action]: %s", apiname);
return EINA_FALSE;
}
@@ -948,68 +952,68 @@ _parse_programs(Evas_Object *ed)
programs = edje_edit_programs_list_get(ed);
EINA_LIST_FOREACH(programs, l, name)
{
- if (!(apiname = _program_api_name_get(ed, name)))
- {
- DBG("filter out program '%s': not API.", name);
- continue;
- }
-
- description = edje_edit_program_api_description_get(ed, name);
- type = edje_edit_program_action_get(ed, name);
- if (type == EDJE_ACTION_TYPE_SIGNAL_EMIT)
- {
- const char *str, *str2;
- str = edje_edit_program_state_get(ed, name);
- str2 = edje_edit_program_state2_get(ed, name);
-
- if (!_write_program_add(apiname, str2, str, description))
- {
- ret = EINA_FALSE;
- edje_edit_string_free(str);
- edje_edit_string_free(str2);
- break;
- }
-
- edje_edit_string_free(str);
- edje_edit_string_free(str2);
- }
-
- sig = edje_edit_program_signal_get(ed, name);
- if (!sig)
- {
- free(apiname);
- edje_edit_string_free(description);
- continue;
- }
-
- source = edje_edit_program_source_get(ed, name);
- if (!source)
- {
- free(apiname);
- edje_edit_string_free(sig);
- edje_edit_string_free(description);
- continue;
- }
-
- if (!_write_program_emit(apiname, source, sig, description))
- {
- ret = EINA_FALSE;
- break;
- }
-
- edje_edit_string_free(description);
- edje_edit_string_free(sig);
- edje_edit_string_free(source);
- free(apiname);
+ if (!(apiname = _program_api_name_get(ed, name)))
+ {
+ DBG("filter out program '%s': not API.", name);
+ continue;
+ }
+
+ description = edje_edit_program_api_description_get(ed, name);
+ type = edje_edit_program_action_get(ed, name);
+ if (type == EDJE_ACTION_TYPE_SIGNAL_EMIT)
+ {
+ const char *str, *str2;
+ str = edje_edit_program_state_get(ed, name);
+ str2 = edje_edit_program_state2_get(ed, name);
+
+ if (!_write_program_add(apiname, str2, str, description))
+ {
+ ret = EINA_FALSE;
+ edje_edit_string_free(str);
+ edje_edit_string_free(str2);
+ break;
+ }
+
+ edje_edit_string_free(str);
+ edje_edit_string_free(str2);
+ }
+
+ sig = edje_edit_program_signal_get(ed, name);
+ if (!sig)
+ {
+ free(apiname);
+ edje_edit_string_free(description);
+ continue;
+ }
+
+ source = edje_edit_program_source_get(ed, name);
+ if (!source)
+ {
+ free(apiname);
+ edje_edit_string_free(sig);
+ edje_edit_string_free(description);
+ continue;
+ }
+
+ if (!_write_program_emit(apiname, source, sig, description))
+ {
+ ret = EINA_FALSE;
+ break;
+ }
+
+ edje_edit_string_free(description);
+ edje_edit_string_free(sig);
+ edje_edit_string_free(source);
+ free(apiname);
}
edje_edit_string_list_free(programs);
if (!ret)
{
- edje_edit_string_free(description);
- edje_edit_string_free(sig);
- edje_edit_string_free(source);
- free(apiname);
+ edje_edit_string_free(description);
+ edje_edit_string_free(sig);
+ edje_edit_string_free(source);
+ free(apiname);
}
return ret;
@@ -1023,8 +1027,8 @@ _module_matches(const char *module)
EINA_LIST_FOREACH(externals, l, name)
{
- if (!strcmp(module, name))
- return EINA_TRUE;
+ if (!strcmp(module, name))
+ return EINA_TRUE;
}
return EINA_FALSE;
@@ -1043,36 +1047,36 @@ _parse(void)
ed = edje_edit_object_add(ecore_evas_get(ee));
if (!edje_object_file_set(ed, file, group))
{
- Edje_Load_Error err = edje_object_load_error_get(ed);
- const char *errmsg = edje_load_error_str(err);
- ERR("could not load group '%s' from file '%s': %s",
- group, file, errmsg);
- evas_object_del(ed);
- return EINA_FALSE;
+ Edje_Load_Error err = edje_object_load_error_get(ed);
+ const char *errmsg = edje_load_error_str(err);
+ ERR("could not load group '%s' from file '%s': %s",
+ group, file, errmsg);
+ evas_object_del(ed);
+ return EINA_FALSE;
}
externals = edje_edit_externals_list_get(ed);
if (externals)
{
- EINA_LIST_FOREACH(modules_available, l, module_name)
- {
- if (_module_matches(module_name))
- {
- if (!edje_module_load(module_name))
- {
- ERR("error loading external '%s'", module_name);
- continue;
- }
- modules_loaded++;
- }
- }
+ EINA_LIST_FOREACH(modules_available, l, module_name)
+ {
+ if (_module_matches(module_name))
+ {
+ if (!edje_module_load(module_name))
+ {
+ ERR("error loading external '%s'", module_name);
+ continue;
+ }
+ modules_loaded++;
+ }
+ }
}
if (eina_list_count(externals) != modules_loaded)
{
- edje_edit_string_list_free(externals);
- evas_object_del(ed);
- return EINA_FALSE;
+ edje_edit_string_list_free(externals);
+ evas_object_del(ed);
+ return EINA_FALSE;
}
ret = _parse_parts(ed) && _parse_programs(ed);
@@ -1088,12 +1092,12 @@ main(int argc, char *argv[])
char *source, *header;
int arg_index, ret = 0;
Ecore_Getopt_Value values[] = {
- ECORE_GETOPT_VALUE_STR(prefix),
- ECORE_GETOPT_VALUE_BOOL(quit_option),
- ECORE_GETOPT_VALUE_BOOL(quit_option),
- ECORE_GETOPT_VALUE_BOOL(quit_option),
- ECORE_GETOPT_VALUE_BOOL(quit_option),
- ECORE_GETOPT_VALUE_NONE
+ ECORE_GETOPT_VALUE_STR(prefix),
+ ECORE_GETOPT_VALUE_BOOL(quit_option),
+ ECORE_GETOPT_VALUE_BOOL(quit_option),
+ ECORE_GETOPT_VALUE_BOOL(quit_option),
+ ECORE_GETOPT_VALUE_BOOL(quit_option),
+ ECORE_GETOPT_VALUE_NONE
};
setlocale(LC_NUMERIC, "C");
@@ -1109,7 +1113,7 @@ main(int argc, char *argv[])
{
fprintf(stderr, "Missing action. See '--help or -h'.\n");
ret = 1;
- goto error_log;
+ goto error_log;
}
_log_dom = eina_log_domain_register("edje_codegen", EINA_COLOR_YELLOW);
@@ -1127,13 +1131,14 @@ main(int argc, char *argv[])
ret = 1;
goto error_getopt;
}
- else if (quit_option) goto error_getopt;
+ else if (quit_option)
+ goto error_getopt;
else if (arg_index != argc - 4)
{
- fprintf(stderr, "Incorrect number of parameters. Requires " \
- "fours arguments, an edje, the group, " \
- "the source output (foo.c) and the header(foo.h).\n" \
- "See %s --help\n", argv[0]);
+ fprintf(stderr, "Incorrect number of parameters. Requires " \
+ "fours arguments, an edje, the group, " \
+ "the source output (foo.c) and the header(foo.h).\n" \
+ "See %s --help\n", argv[0]);
ret = 1;
goto error_getopt;
}
@@ -1155,70 +1160,70 @@ main(int argc, char *argv[])
if (!edje_file_group_exists(file, group))
{
- ERR("The group %s not exists", group);
- ret = 2;
- goto error_getopt;
+ ERR("The group %s not exists", group);
+ ret = 2;
+ goto error_getopt;
}
ee = ecore_evas_buffer_new(1, 1);
if (!ee)
{
- ERR("could not create ecore_evas_buffer");
- ret = 3;
- goto error_getopt;
+ ERR("could not create ecore_evas_buffer");
+ ret = 3;
+ goto error_getopt;
}
if (!_open_file_descriptors(source, header))
{
- ERR("Could not create the source files, error %d (%s)",
- errno, strerror(errno));
- ret = 4;
- goto error_getopt;
+ ERR("Could not create the source files, error %d (%s)",
+ errno, strerror(errno));
+ ret = 4;
+ goto error_getopt;
}
if (!_write_headers(header))
{
- ERR("Could not write the header, error %d (%s)",
- errno, strerror(errno));
- ret = 5;
- goto error_getopt;
+ ERR("Could not write the header, error %d (%s)",
+ errno, strerror(errno));
+ ret = 5;
+ goto error_getopt;
}
if (!_write_object_get())
{
- ERR("Could not write the object get, error %d (%s)",
- errno, strerror(errno));
- ret = 6;
- goto error_getopt;
+ ERR("Could not write the object get, error %d (%s)",
+ errno, strerror(errno));
+ ret = 6;
+ goto error_getopt;
}
if (!_parse())
{
- ERR("Could not parsing the EDJE");
- ret = 7;
- goto error_getopt;
+ ERR("Could not parsing the EDJE");
+ ret = 7;
+ goto error_getopt;
}
if (!_write_footer(header))
{
- ERR("Could not write the footer, error %d (%s)",
- errno, strerror(errno));
- ret = 8;
- goto error_getopt;
+ ERR("Could not write the footer, error %d (%s)",
+ errno, strerror(errno));
+ ret = 8;
+ goto error_getopt;
}
if (!_close_file_descriptors())
{
- ERR("Could not close the source files, error %d (%s)",
- errno, strerror(errno));
- ret = 9;
+ ERR("Could not close the source files, error %d (%s)",
+ errno, strerror(errno));
+ ret = 9;
}
- error_getopt:
+error_getopt:
if (ee)
ecore_evas_free(ee);
- error_log:
+error_log:
edje_shutdown();
ecore_evas_shutdown();
ecore_shutdown();
@@ -1227,9 +1232,10 @@ main(int argc, char *argv[])
if (ret > 4)
{
- unlink(header);
- unlink(source);
+ unlink(header);
+ unlink(source);
}
return ret;
}
+
diff --git a/src/bin/edje/edje_convert.c b/src/bin/edje/edje_convert.c
index eb113a7fee..4e81ff1b28 100644
--- a/src/bin/edje/edje_convert.c
+++ b/src/bin/edje/edje_convert.c
@@ -37,8 +37,8 @@ _edje_file_convert_external(Edje_File *edf, Old_Edje_File *oedf)
EINA_LIST_FREE(oedf->external_dir->entries, ede)
{
- edf->external_dir->entries[i++].entry = ede->entry;
- free(ede);
+ edf->external_dir->entries[i++].entry = ede->entry;
+ free(ede);
}
free(oedf->external_dir);
@@ -72,10 +72,10 @@ _edje_file_convert_images(Edje_File *edf, Old_Edje_File *oedf)
EINA_LIST_FREE(oedf->image_dir->entries, de)
{
- memcpy(edf->image_dir->entries + de->id,
- de,
- sizeof (Edje_Image_Directory_Entry));
- free(de);
+ memcpy(edf->image_dir->entries + de->id,
+ de,
+ sizeof (Edje_Image_Directory_Entry));
+ free(de);
}
max = -1;
@@ -88,17 +88,17 @@ _edje_file_convert_images(Edje_File *edf, Old_Edje_File *oedf)
if (!edf->image_dir->sets && edf->image_dir->sets_count)
{
- free(edf->image_dir->entries);
- edf->image_dir->entries = NULL;
- return EINA_FALSE;
+ free(edf->image_dir->entries);
+ edf->image_dir->entries = NULL;
+ return EINA_FALSE;
}
EINA_LIST_FREE(oedf->image_dir->sets, ds)
{
- memcpy(edf->image_dir->sets + ds->id,
- ds,
- sizeof (Edje_Image_Directory_Set));
- free(ds);
+ memcpy(edf->image_dir->sets + ds->id,
+ ds,
+ sizeof (Edje_Image_Directory_Set));
+ free(ds);
}
return EINA_TRUE;
@@ -129,15 +129,15 @@ _edje_file_convert(Eet_File *ef, Old_Edje_File *oedf)
EINA_LIST_FREE(oedf->data, ed)
{
- Edje_String *es;
+ Edje_String *es;
- es = calloc(1, sizeof (Edje_String));
- if (!es) continue;
+ es = calloc(1, sizeof (Edje_String));
+ if (!es) continue;
- es->str = ed->value;
+ es->str = ed->value;
- eina_hash_direct_add(edf->data, ed->key, es);
- free(ed);
+ eina_hash_direct_add(edf->data, ed->key, es);
+ free(ed);
}
EINA_LIST_FOREACH(oedf->collection_dir->entries, l, ce)
@@ -148,7 +148,7 @@ _edje_file_convert(Eet_File *ef, Old_Edje_File *oedf)
if (oedf->font_dir)
EINA_LIST_FOREACH(oedf->font_dir->entries, l, fnt)
- eina_hash_direct_add(edf->fonts, fnt->entry, fnt);
+ eina_hash_direct_add(edf->fonts, fnt->entry, fnt);
if (!_edje_file_convert_images(edf, oedf))
goto on_error;
@@ -174,7 +174,7 @@ _edje_file_convert(Eet_File *ef, Old_Edje_File *oedf)
return edf;
- on_error:
+on_error:
eina_hash_free(edf->fonts);
eina_hash_free(edf->collection);
eina_hash_free(edf->data);
@@ -186,12 +186,12 @@ _edje_file_convert(Eet_File *ef, Old_Edje_File *oedf)
static void
_edje_collection_program_add(Edje_Program ***array,
- unsigned int *count,
- Edje_Program *add)
+ unsigned int *count,
+ Edje_Program *add)
{
Edje_Program **tmp;
- tmp = realloc(*array, sizeof (Edje_Program*) * (*count + 1));
+ tmp = realloc(*array, sizeof (Edje_Program *) * (*count + 1));
if (!tmp)
{
error_and_abort(ef, "Not enough memory");
@@ -218,40 +218,40 @@ _edje_collection_convert(Eet_File *ef, Edje_Part_Collection_Directory_Entry *ce,
/* Count each type part and their respective state */
EINA_LIST_FOREACH(oedc->parts, l, part)
{
- int *count;
- int dummy = 0;
-
-
- switch (part->type)
- {
-#define CSP(Tp, Ce) \
- case EDJE_PART_TYPE_##Tp : \
- count = &Ce->count.Tp; \
- break;
-
- CSP(RECTANGLE, ce);
- CSP(TEXT, ce);
- CSP(IMAGE, ce);
- CSP(SWALLOW, ce);
- CSP(TEXTBLOCK, ce);
- CSP(GROUP, ce);
- CSP(BOX, ce);
- CSP(TABLE, ce);
- CSP(EXTERNAL, ce);
- CSP(VECTOR, ce);
- default:
- count = &dummy;
- break;
- }
-
- *count += eina_list_count(part->other_desc) + 1;
+ int *count;
+ int dummy = 0;
+
+ switch (part->type)
+ {
+#define CSP(Tp, Ce) \
+case EDJE_PART_TYPE_##Tp: \
+ count = &Ce->count.Tp; \
+ break;
+
+ CSP(RECTANGLE, ce);
+ CSP(TEXT, ce);
+ CSP(IMAGE, ce);
+ CSP(SWALLOW, ce);
+ CSP(TEXTBLOCK, ce);
+ CSP(GROUP, ce);
+ CSP(BOX, ce);
+ CSP(TABLE, ce);
+ CSP(EXTERNAL, ce);
+ CSP(VECTOR, ce);
+
+ default:
+ count = &dummy;
+ break;
+ }
+
+ *count += eina_list_count(part->other_desc) + 1;
}
ce->count.part = eina_list_count(oedc->parts);
-#define CONVERT_EMN(Tp, Sz, Ce) \
- buffer = alloca(strlen(ce->entry) + strlen(#Tp) + 2); \
- sprintf(buffer, "%s/%s", ce->entry, #Tp); \
- Ce->mp.Tp = eina_mempool_add("one_big", buffer, NULL, sizeof (Sz), Ce->count.Tp);
+#define CONVERT_EMN(Tp, Sz, Ce) \
+ buffer = alloca(strlen(ce->entry) + strlen(#Tp) + 2); \
+ sprintf(buffer, "%s/%s", ce->entry, #Tp); \
+ Ce->mp.Tp = eina_mempool_add("one_big", buffer, NULL, sizeof (Sz), Ce->count.Tp);
CONVERT_EMN(RECTANGLE, Edje_Part_Description_Common, ce);
CONVERT_EMN(TEXT, Edje_Part_Description_Text, ce);
@@ -272,43 +272,43 @@ _edje_collection_convert(Eet_File *ef, Edje_Part_Collection_Directory_Entry *ce,
EINA_LIST_FREE(oedc->programs, pg)
{
- if (!pg->signal && !pg->source)
- _edje_collection_program_add(&edc->programs.nocmp,
- &edc->programs.nocmp_count,
- pg);
- else if (pg->signal && !strpbrk(pg->signal, "*?[\\")
- && pg->source && !strpbrk(pg->source, "*?[\\"))
- _edje_collection_program_add(&edc->programs.strcmp,
- &edc->programs.strcmp_count,
- pg);
- else if (pg->signal && edje_program_is_strncmp(pg->signal)
- && pg->source && edje_program_is_strncmp(pg->source))
- _edje_collection_program_add(&edc->programs.strncmp,
- &edc->programs.strncmp_count,
- pg);
- else if (pg->signal && edje_program_is_strrncmp(pg->signal)
- && pg->source && edje_program_is_strrncmp(pg->source))
- _edje_collection_program_add(&edc->programs.strrncmp,
- &edc->programs.strrncmp_count,
- pg);
- else
- _edje_collection_program_add(&edc->programs.fnmatch,
- &edc->programs.fnmatch_count,
- pg);
+ if (!pg->signal && !pg->source)
+ _edje_collection_program_add(&edc->programs.nocmp,
+ &edc->programs.nocmp_count,
+ pg);
+ else if (pg->signal && !strpbrk(pg->signal, "*?[\\")
+ && pg->source && !strpbrk(pg->source, "*?[\\"))
+ _edje_collection_program_add(&edc->programs.strcmp,
+ &edc->programs.strcmp_count,
+ pg);
+ else if (pg->signal && edje_program_is_strncmp(pg->signal)
+ && pg->source && edje_program_is_strncmp(pg->source))
+ _edje_collection_program_add(&edc->programs.strncmp,
+ &edc->programs.strncmp_count,
+ pg);
+ else if (pg->signal && edje_program_is_strrncmp(pg->signal)
+ && pg->source && edje_program_is_strrncmp(pg->source))
+ _edje_collection_program_add(&edc->programs.strrncmp,
+ &edc->programs.strrncmp_count,
+ pg);
+ else
+ _edje_collection_program_add(&edc->programs.fnmatch,
+ &edc->programs.fnmatch_count,
+ pg);
}
edc->data = eina_hash_string_small_new(NULL);
EINA_LIST_FREE(oedc->data, di)
{
- Edje_String *es;
+ Edje_String *es;
- es = calloc(1, sizeof (Edje_String));
- if (!es) continue ;
+ es = calloc(1, sizeof (Edje_String));
+ if (!es) continue;
- es->str = di->value;
+ es->str = di->value;
- eina_hash_direct_add(edc->data, di->key, es);
- free(di);
+ eina_hash_direct_add(edc->data, di->key, es);
+ free(di);
}
edc->parts_count = eina_list_count(oedc->parts);
@@ -319,60 +319,60 @@ _edje_collection_convert(Eet_File *ef, Edje_Part_Collection_Directory_Entry *ce,
EINA_LIST_FREE(oedc->parts, part)
{
- Old_Edje_Part_Description *oepd;
- Edje_Pack_Element *elm;
- Edje_Part *replacement;
- unsigned int i;
-
- replacement = eina_mempool_malloc(ce->mp.part, sizeof (Edje_Part));
- if (!replacement)
- error_and_abort(ef, "Not enough memory");
-
- replacement->name = part->name;
- replacement->default_desc = _edje_description_convert(part->type, ce, part->default_desc);
-
- replacement->other.desc_count = eina_list_count(part->other_desc);
- replacement->other.desc = calloc(replacement->other.desc_count, sizeof (Edje_Part_Description_Common*));
-
- i = 0;
- EINA_LIST_FREE(part->other_desc, oepd)
- replacement->other.desc[i++] = _edje_description_convert(part->type, ce, oepd);
-
- replacement->source = part->source;
- replacement->source2 = part->source2;
- replacement->source3 = part->source3;
- replacement->source4 = part->source4;
- replacement->source5 = part->source5;
- replacement->source6 = part->source6;
- replacement->id = part->id;
- replacement->clip_to_id = part->clip_to_id;
- replacement->dragable = part->dragable;
- replacement->items_count = eina_list_count(part->items);
- replacement->items = calloc(replacement->items_count, sizeof (Edje_Pack_Element*));
-
- i = 0;
- EINA_LIST_FREE(part->items, elm)
- replacement->items[i++] = elm;
-
- replacement->type = part->type;
- replacement->effect = part->effect;
- replacement->mouse_events = part->mouse_events;
- replacement->repeat_events = part->repeat_events;
- replacement->ignore_flags = part->ignore_flags;
- replacement->mask_flags = part->mask_flags;
- replacement->scale = part->scale;
- replacement->precise_is_inside = part->precise_is_inside;
- replacement->use_alternate_font_metrics = part->use_alternate_font_metrics;
- replacement->pointer_mode = part->pointer_mode;
- replacement->entry_mode = part->entry_mode;
- replacement->select_mode = part->select_mode;
- replacement->multiline = part->multiline;
- replacement->api = part->api;
- replacement->required = part->required;
-
- edc->parts[k++] = replacement;
-
- free(part);
+ Old_Edje_Part_Description *oepd;
+ Edje_Pack_Element *elm;
+ Edje_Part *replacement;
+ unsigned int i;
+
+ replacement = eina_mempool_malloc(ce->mp.part, sizeof (Edje_Part));
+ if (!replacement)
+ error_and_abort(ef, "Not enough memory");
+
+ replacement->name = part->name;
+ replacement->default_desc = _edje_description_convert(part->type, ce, part->default_desc);
+
+ replacement->other.desc_count = eina_list_count(part->other_desc);
+ replacement->other.desc = calloc(replacement->other.desc_count, sizeof (Edje_Part_Description_Common *));
+
+ i = 0;
+ EINA_LIST_FREE(part->other_desc, oepd)
+ replacement->other.desc[i++] = _edje_description_convert(part->type, ce, oepd);
+
+ replacement->source = part->source;
+ replacement->source2 = part->source2;
+ replacement->source3 = part->source3;
+ replacement->source4 = part->source4;
+ replacement->source5 = part->source5;
+ replacement->source6 = part->source6;
+ replacement->id = part->id;
+ replacement->clip_to_id = part->clip_to_id;
+ replacement->dragable = part->dragable;
+ replacement->items_count = eina_list_count(part->items);
+ replacement->items = calloc(replacement->items_count, sizeof (Edje_Pack_Element *));
+
+ i = 0;
+ EINA_LIST_FREE(part->items, elm)
+ replacement->items[i++] = elm;
+
+ replacement->type = part->type;
+ replacement->effect = part->effect;
+ replacement->mouse_events = part->mouse_events;
+ replacement->repeat_events = part->repeat_events;
+ replacement->ignore_flags = part->ignore_flags;
+ replacement->mask_flags = part->mask_flags;
+ replacement->scale = part->scale;
+ replacement->precise_is_inside = part->precise_is_inside;
+ replacement->use_alternate_font_metrics = part->use_alternate_font_metrics;
+ replacement->pointer_mode = part->pointer_mode;
+ replacement->entry_mode = part->entry_mode;
+ replacement->select_mode = part->select_mode;
+ replacement->multiline = part->multiline;
+ replacement->api = part->api;
+ replacement->required = part->required;
+
+ edc->parts[k++] = replacement;
+
+ free(part);
}
edc->id = oedc->id;
@@ -389,76 +389,78 @@ _edje_collection_convert(Eet_File *ef, Edje_Part_Collection_Directory_Entry *ce,
return edc;
}
-Edje_Part_Description_Common*
+Edje_Part_Description_Common *
_edje_description_convert(int type,
- Edje_Part_Collection_Directory_Entry *ce,
- Old_Edje_Part_Description *oed)
+ Edje_Part_Collection_Directory_Entry *ce,
+ Old_Edje_Part_Description *oed)
{
Edje_Part_Description_Common *result = NULL;
switch (type)
{
case EDJE_PART_TYPE_RECTANGLE:
- result = eina_mempool_malloc(ce->mp.RECTANGLE,
- sizeof (Edje_Part_Description_Common));
- break;
+ result = eina_mempool_malloc(ce->mp.RECTANGLE,
+ sizeof (Edje_Part_Description_Common));
+ break;
+
case EDJE_PART_TYPE_SWALLOW:
- result = eina_mempool_malloc(ce->mp.SWALLOW,
- sizeof (Edje_Part_Description_Common));
- break;
+ result = eina_mempool_malloc(ce->mp.SWALLOW,
+ sizeof (Edje_Part_Description_Common));
+ break;
+
case EDJE_PART_TYPE_GROUP:
- result = eina_mempool_malloc(ce->mp.GROUP,
- sizeof (Edje_Part_Description_Common));
- break;
+ result = eina_mempool_malloc(ce->mp.GROUP,
+ sizeof (Edje_Part_Description_Common));
+ break;
case EDJE_PART_TYPE_IMAGE:
- {
- Edje_Part_Description_Image *img;
- Edje_Part_Image_Id *id;
- unsigned int i = 0;
-
- img = eina_mempool_malloc(ce->mp.IMAGE, sizeof (Edje_Part_Description_Image));
-
- img->image.tweens_count = eina_list_count(oed->image.tween_list);
- img->image.tweens = calloc(img->image.tweens_count,
- sizeof (Edje_Part_Image_Id*));
- if (img->image.tweens_count > 0 && !img->image.tweens)
- {
- eina_mempool_free(ce->mp.IMAGE, img);
- return NULL;
- }
-
- EINA_LIST_FREE(oed->image.tween_list, id)
- img->image.tweens[i++] = id;
-
- img->image.id = oed->image.id;
- img->image.scale_hint = oed->image.scale_hint;
- img->image.set = oed->image.set;
-
- img->image.border = oed->image.border;
- img->image.fill = oed->image.fill;
-
- result = &img->common;
- break;
- }
-
-#define CONVERT_ALLOC_POOL(Short, Type, Name) \
- case EDJE_PART_TYPE_##Short: \
- { \
- Edje_Part_Description_##Type *Name; \
- \
- Name = eina_mempool_malloc(ce->mp.Short, sizeof (Edje_Part_Description_##Type)); \
- Name->Name = oed->Name; \
- result = &Name->common; \
- break; \
- }
-
- CONVERT_ALLOC_POOL(TEXT, Text, text);
- CONVERT_ALLOC_POOL(TEXTBLOCK, Text, text);
- CONVERT_ALLOC_POOL(BOX, Box, box);
- CONVERT_ALLOC_POOL(TABLE, Table, table);
- CONVERT_ALLOC_POOL(EXTERNAL, External, external_params);
- CONVERT_ALLOC_POOL(VECTOR, Vector, vector);
+ {
+ Edje_Part_Description_Image *img;
+ Edje_Part_Image_Id *id;
+ unsigned int i = 0;
+
+ img = eina_mempool_malloc(ce->mp.IMAGE, sizeof (Edje_Part_Description_Image));
+
+ img->image.tweens_count = eina_list_count(oed->image.tween_list);
+ img->image.tweens = calloc(img->image.tweens_count,
+ sizeof (Edje_Part_Image_Id *));
+ if (img->image.tweens_count > 0 && !img->image.tweens)
+ {
+ eina_mempool_free(ce->mp.IMAGE, img);
+ return NULL;
+ }
+
+ EINA_LIST_FREE(oed->image.tween_list, id)
+ img->image.tweens[i++] = id;
+
+ img->image.id = oed->image.id;
+ img->image.scale_hint = oed->image.scale_hint;
+ img->image.set = oed->image.set;
+
+ img->image.border = oed->image.border;
+ img->image.fill = oed->image.fill;
+
+ result = &img->common;
+ break;
+ }
+
+#define CONVERT_ALLOC_POOL(Short, Type, Name) \
+case EDJE_PART_TYPE_##Short: \
+{ \
+ Edje_Part_Description_##Type * Name; \
+ \
+ Name = eina_mempool_malloc(ce->mp.Short, sizeof (Edje_Part_Description_##Type)); \
+ Name->Name = oed->Name; \
+ result = &Name->common; \
+ break; \
+}
+
+ CONVERT_ALLOC_POOL(TEXT, Text, text);
+ CONVERT_ALLOC_POOL(TEXTBLOCK, Text, text);
+ CONVERT_ALLOC_POOL(BOX, Box, box);
+ CONVERT_ALLOC_POOL(TABLE, Table, table);
+ CONVERT_ALLOC_POOL(EXTERNAL, External, external_params);
+ CONVERT_ALLOC_POOL(VECTOR, Vector, vector);
}
if (result)
@@ -467,3 +469,4 @@ _edje_description_convert(int type,
free(oed);
return result;
}
+
diff --git a/src/bin/edje/edje_convert_main.c b/src/bin/edje/edje_convert_main.c
index 97a96d8763..6cdd5783f9 100644
--- a/src/bin/edje/edje_convert_main.c
+++ b/src/bin/edje/edje_convert_main.c
@@ -39,7 +39,7 @@ main_help(void)
("Usage:\n"
"\t%s file.edj\n"
"\n"
- ,progname);
+ , progname);
}
static void
@@ -57,17 +57,17 @@ _edje_alias_int(const char *target, Eet_File *ef, const char *base, const char *
strcat(buf, "%i");
for (i = 0; i < count && match; ++i)
{
- char name[1024];
- int id;
+ char name[1024];
+ int id;
- if (sscanf(match[i], buf, &id) != 1)
- {
- EINA_LOG_ERR("Wrong fonts section `%s' in `%s'. Discarding it.", match[i], target);
- continue ;
- }
+ if (sscanf(match[i], buf, &id) != 1)
+ {
+ EINA_LOG_ERR("Wrong fonts section `%s' in `%s'. Discarding it.", match[i], target);
+ continue;
+ }
- snprintf(name, sizeof (name), "%s/%i", to, id);
- eet_alias(ef, name, match[i], 1);
+ snprintf(name, sizeof (name), "%s/%i", to, id);
+ eet_alias(ef, name, match[i], 1);
}
free(match);
}
@@ -87,17 +87,17 @@ _edje_alias_string(const char *target, Eet_File *ef, const char *base, const cha
strcat(buf, "%s");
for (i = 0; i < count && match; ++i)
{
- char name[1024];
- char id[1024];
+ char name[1024];
+ char id[1024];
- if (sscanf(match[i], buf, &id) != 1)
- {
- EINA_LOG_ERR("Wrong fonts section `%s' in `%s'. Discarding it.", match[i], target);
- continue ;
- }
+ if (sscanf(match[i], buf, &id) != 1)
+ {
+ EINA_LOG_ERR("Wrong fonts section `%s' in `%s'. Discarding it.", match[i], target);
+ continue;
+ }
- snprintf(name, sizeof (name), "%s/%s", to, id);
- eet_alias(ef, name, match[i], 1);
+ snprintf(name, sizeof (name), "%s/%s", to, id);
+ eet_alias(ef, name, match[i], 1);
}
free(match);
}
@@ -119,11 +119,11 @@ main(int argc, char **argv)
return -1;
_edje_cc_log_dom = eina_log_domain_register
- ("edje_convert", EDJE_CC_DEFAULT_LOG_COLOR);
+ ("edje_convert", EDJE_CC_DEFAULT_LOG_COLOR);
if (_edje_cc_log_dom < 0)
{
- EINA_LOG_ERR("Enable to create a log domain.");
- exit(-1);
+ EINA_LOG_ERR("Enable to create a log domain.");
+ exit(-1);
}
eet_init();
@@ -131,8 +131,8 @@ main(int argc, char **argv)
progname = argv[0];
if (argc > 2 || argc < 2 || !strcmp(argv[1], "-h"))
{
- main_help();
- return 0;
+ main_help();
+ return 0;
}
_edje_edd_old_init();
@@ -141,15 +141,15 @@ main(int argc, char **argv)
ef = eet_open(argv[1], EET_FILE_MODE_READ_WRITE);
if (!ef)
{
- EINA_LOG_ERR("Unable to open `%s'.", argv[1]);
- return -1;
+ EINA_LOG_ERR("Unable to open `%s'.", argv[1]);
+ return -1;
}
oef = eet_data_read(ef, _edje_edd_old_edje_file, "edje_file");
if (!oef)
{
- EINA_LOG_ERR("Unable to get edje_file section from old file format, are you sure it's an old file ?");
- return -1;
+ EINA_LOG_ERR("Unable to get edje_file section from old file format, are you sure it's an old file ?");
+ return -1;
}
nef = _edje_file_convert(ef, oef);
@@ -160,34 +160,34 @@ main(int argc, char **argv)
EINA_ITERATOR_FOREACH(it, ce)
{
- Old_Edje_Part_Collection *opc;
- Edje_Part_Collection *npc;
- char buf[1024];
- int bytes = 0;
-
- snprintf(buf, sizeof (buf), "collections/%i", ce->id);
- opc = eet_data_read(ef, _edje_edd_old_edje_part_collection, buf);
- if (!opc)
- {
- EINA_LOG_ERR("Unable to find collection `%s'[%i] in `%s'.", ce->entry, ce->id, argv[1]);
- return -1;
- }
-
- npc = _edje_collection_convert(ef, ce, opc);
-
- snprintf(buf, sizeof (buf), "edje/collections/%i", ce->id);
- bytes = eet_data_write(ef, _edje_edd_edje_part_collection, buf, npc, 1);
- if (bytes <= 0)
- {
- EINA_LOG_ERR("Unable to save `%s' in section `%s' of `%s'.", ce->entry, buf, argv[1]);
- return -1;
- }
+ Old_Edje_Part_Collection *opc;
+ Edje_Part_Collection *npc;
+ char buf[1024];
+ int bytes = 0;
+
+ snprintf(buf, sizeof (buf), "collections/%i", ce->id);
+ opc = eet_data_read(ef, _edje_edd_old_edje_part_collection, buf);
+ if (!opc)
+ {
+ EINA_LOG_ERR("Unable to find collection `%s'[%i] in `%s'.", ce->entry, ce->id, argv[1]);
+ return -1;
+ }
+
+ npc = _edje_collection_convert(ef, ce, opc);
+
+ snprintf(buf, sizeof (buf), "edje/collections/%i", ce->id);
+ bytes = eet_data_write(ef, _edje_edd_edje_part_collection, buf, npc, 1);
+ if (bytes <= 0)
+ {
+ EINA_LOG_ERR("Unable to save `%s' in section `%s' of `%s'.", ce->entry, buf, argv[1]);
+ return -1;
+ }
}
if (eet_data_write(ef, _edje_edd_edje_file, "edje/file", nef, 1) <= 0)
{
- EINA_LOG_ERR("Unable to save main section of `%s'.", argv[1]);
- return -1;
+ EINA_LOG_ERR("Unable to save main section of `%s'.", argv[1]);
+ return -1;
}
_edje_alias_string(argv[1], ef, "fonts", "edje/fonts");
@@ -205,3 +205,4 @@ main(int argc, char **argv)
return 0;
}
+
diff --git a/src/bin/edje/edje_data_convert.c b/src/bin/edje/edje_data_convert.c
index f35ed94e6a..bdbca1f9e8 100644
--- a/src/bin/edje/edje_data_convert.c
+++ b/src/bin/edje/edje_data_convert.c
@@ -26,12 +26,12 @@ Eet_Data_Descriptor *_edje_edd_old_edje_part_description = NULL;
Eet_Data_Descriptor *_edje_edd_old_edje_part_image_id = NULL;
Eet_Data_Descriptor *_edje_edd_old_edje_external_param = NULL;
-#define FREED(eed) \
- if (eed) \
- { \
- eet_data_descriptor_free((eed)); \
- (eed) = NULL; \
- }
+#define FREED(eed) \
+ if (eed) \
+ { \
+ eet_data_descriptor_free((eed)); \
+ (eed) = NULL; \
+ }
void
_edje_edd_old_shutdown(void)
@@ -74,8 +74,8 @@ _edje_edd_old_init(void)
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_external_directory_entry, Edje_External_Directory_Entry, "entry", entry, EET_T_STRING);
eet_eina_file_data_descriptor_class_set(&eddc, sizeof (eddc),
- "Edje_External_Directory",
- sizeof (Old_Edje_External_Directory));
+ "Edje_External_Directory",
+ sizeof (Old_Edje_External_Directory));
_edje_edd_old_edje_external_directory =
eet_data_descriptor_file_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_external_directory, Edje_External_Directory, "entries", entries, _edje_edd_old_edje_external_directory_entry);
@@ -88,8 +88,8 @@ _edje_edd_old_init(void)
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_font_directory_entry, Edje_Font_Directory_Entry, "file", file, EET_T_STRING);
eet_eina_file_data_descriptor_class_set(&eddc, sizeof (eddc),
- "Edje_Font_Directory",
- sizeof (Old_Edje_Font_Directory));
+ "Edje_Font_Directory",
+ sizeof (Old_Edje_Font_Directory));
_edje_edd_old_edje_font_directory =
eet_data_descriptor_file_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_font_directory, Old_Edje_Font_Directory, "entries", entries, _edje_edd_old_edje_font_directory_entry);
@@ -117,12 +117,12 @@ _edje_edd_old_init(void)
_edje_edd_old_edje_image_directory_set =
eet_data_descriptor_file_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_image_directory_set, Edje_Image_Directory_Set, "name", name, EET_T_STRING);
- EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_image_directory_set, Edje_Image_Directory_Set, "id", id, EET_T_INT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_image_directory_set, Edje_Image_Directory_Set, "id", id, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_image_directory_set, Edje_Image_Directory_Set, "entries", entries, _edje_edd_old_edje_image_directory_set_entry);
eet_eina_file_data_descriptor_class_set(&eddc, sizeof (eddc),
- "Edje_Image_Directory",
- sizeof (Old_Edje_Image_Directory));
+ "Edje_Image_Directory",
+ sizeof (Old_Edje_Image_Directory));
_edje_edd_old_edje_image_directory =
eet_data_descriptor_file_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_image_directory, Old_Edje_Image_Directory, "entries", entries, _edje_edd_old_edje_image_directory_entry);
@@ -136,15 +136,15 @@ _edje_edd_old_init(void)
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "id", id, EET_T_INT);
eet_eina_file_data_descriptor_class_set(&eddc, sizeof (eddc),
- "Edje_Part_Collection_Directory",
- sizeof (Old_Edje_Part_Collection_Directory));
+ "Edje_Part_Collection_Directory",
+ sizeof (Old_Edje_Part_Collection_Directory));
_edje_edd_old_edje_part_collection_directory =
eet_data_descriptor_file_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_part_collection_directory, Old_Edje_Part_Collection_Directory, "entries", entries, _edje_edd_old_edje_part_collection_directory_entry);
/* generic data attachment */
eet_eina_file_data_descriptor_class_set(&eddc, sizeof (eddc),
- "Edje_Data", sizeof (Old_Edje_Data));
+ "Edje_Data", sizeof (Old_Edje_Data));
_edje_edd_old_edje_data =
eet_data_descriptor_file_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_data, Old_Edje_Data, "key", key, EET_T_STRING);
@@ -181,7 +181,7 @@ _edje_edd_old_init(void)
/* the main file directory */
eet_eina_file_data_descriptor_class_set(&eddc, sizeof (eddc),
- "Edje_File", sizeof (Old_Edje_File));
+ "Edje_File", sizeof (Old_Edje_File));
_edje_edd_old_edje_file =
eet_data_descriptor_file_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_file, Old_Edje_File, "compiler", compiler, EET_T_STRING);
@@ -364,7 +364,7 @@ _edje_edd_old_init(void)
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Pack_Element);
_edje_edd_old_edje_pack_element =
- eet_data_descriptor_file_new(&eddc);
+ eet_data_descriptor_file_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_pack_element, Edje_Pack_Element, "type", type, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_pack_element, Edje_Pack_Element, "name", name, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_pack_element, Edje_Pack_Element, "source", source, EET_T_STRING);
@@ -433,7 +433,7 @@ _edje_edd_old_init(void)
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "required", required, EET_T_UCHAR);
eet_eina_file_data_descriptor_class_set(&eddc, sizeof (eddc), "Edje_Part_Collection", sizeof (Old_Edje_Part_Collection));
- _edje_edd_old_edje_part_collection =
+ _edje_edd_old_edje_part_collection =
eet_data_descriptor_file_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_part_collection, Old_Edje_Part_Collection, "programs", programs, _edje_edd_old_edje_program);
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_part_collection, Old_Edje_Part_Collection, "parts", parts, _edje_edd_old_edje_part);
@@ -449,8 +449,9 @@ _edje_edd_old_init(void)
Old_Edje_Part_Collection epc;
eet_data_descriptor_element_add(_edje_edd_old_edje_part_collection,
- "alias", EET_T_STRING, EET_G_HASH,
- (char *)(&(epc.alias)) - (char *)(&(epc)),
- 0, /* 0, */NULL, NULL);
+ "alias", EET_T_STRING, EET_G_HASH,
+ (char *)(&(epc.alias)) - (char *)(&(epc)),
+ 0, /* 0, */ NULL, NULL);
}
}
+
diff --git a/src/bin/edje/edje_decc.c b/src/bin/edje/edje_decc.c
index fdbc903961..dfee86affe 100644
--- a/src/bin/edje/edje_decc.c
+++ b/src/bin/edje/edje_decc.c
@@ -12,7 +12,6 @@
#include <sys/stat.h>
#include <errno.h>
-
#include <Ecore_File.h>
#include <Ecore_Evas.h>
@@ -38,7 +37,6 @@ void output(void);
static int compiler_cmd_is_sane(void);
static int root_filename_is_sane(void);
-
static void
_edje_cc_log_cb(const Eina_Log_Domain *d,
Eina_Log_Level level,
@@ -64,22 +62,27 @@ _edje_cc_log_cb(const Eina_Log_Domain *d,
switch (level)
{
case EINA_LOG_LEVEL_CRITICAL:
- color = FOREGROUND_RED | FOREGROUND_INTENSITY;
- break;
+ color = FOREGROUND_RED | FOREGROUND_INTENSITY;
+ break;
+
case EINA_LOG_LEVEL_ERR:
- color = FOREGROUND_RED;
- break;
+ color = FOREGROUND_RED;
+ break;
+
case EINA_LOG_LEVEL_WARN:
- color = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY;
- break;
+ color = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY;
+ break;
+
case EINA_LOG_LEVEL_INFO:
- color = FOREGROUND_GREEN | FOREGROUND_INTENSITY;
- break;
+ color = FOREGROUND_GREEN | FOREGROUND_INTENSITY;
+ break;
+
case EINA_LOG_LEVEL_DBG:
- color = FOREGROUND_BLUE | FOREGROUND_INTENSITY;
- break;
+ color = FOREGROUND_BLUE | FOREGROUND_INTENSITY;
+ break;
+
default:
- color = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE;
+ color = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE;
}
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color);
#endif
@@ -88,16 +91,19 @@ _edje_cc_log_cb(const Eina_Log_Domain *d,
switch (level)
{
case EINA_LOG_LEVEL_CRITICAL:
- prefix = "Critical. ";
- break;
+ prefix = "Critical. ";
+ break;
+
case EINA_LOG_LEVEL_ERR:
- prefix = "Error. ";
- break;
+ prefix = "Error. ";
+ break;
+
case EINA_LOG_LEVEL_WARN:
- prefix = "Warning. ";
- break;
+ prefix = "Warning. ";
+ break;
+
default:
- prefix = "";
+ prefix = "";
}
fprintf(stderr, "%s: %s", progname, prefix);
@@ -111,7 +117,6 @@ _edje_cc_log_cb(const Eina_Log_Domain *d,
#endif
}
-
vfprintf(stderr, fmt, args);
putc('\n', stderr);
}
@@ -126,13 +131,13 @@ main_help(void)
("Usage:\n"
"\t%s input_file.edj [-main-out file.edc] [-no-build-sh] [-current-dir | -output path_to_dir]\n"
"\n"
- " -main-out\tCreate a symbolic link to the main edc \n"
+ " -main-out\tCreate a symbolic link to the main edc (disabled on Windows) \n"
" -no-build-sh\tDon't output build.sh \n"
" -output, -o\tOutput to specified directory \n"
" -current-dir\tOutput to current directory \n"
" -quiet\t\tProduce less output\n"
"\n"
- ,progname);
+ , progname);
}
Eet_File *ef;
@@ -150,12 +155,12 @@ main(int argc, char **argv)
if (!eina_init())
exit(-1);
_edje_cc_log_dom = eina_log_domain_register
- ("edje_decc", EDJE_CC_DEFAULT_LOG_COLOR);
+ ("edje_decc", EDJE_CC_DEFAULT_LOG_COLOR);
if (_edje_cc_log_dom < 0)
{
- EINA_LOG_ERR("Impossible to create a log domain.");
- eina_shutdown();
- exit(-1);
+ EINA_LOG_ERR("Impossible to create a log domain.");
+ eina_shutdown();
+ exit(-1);
}
progname = ecore_file_file_get(argv[0]);
eina_log_print_cb_set(_edje_cc_log_cb, NULL);
@@ -163,35 +168,37 @@ main(int argc, char **argv)
for (i = 1; i < argc; i++)
{
- if (!strcmp(argv[i], "-h"))
- {
- main_help();
- exit(0);
- }
- if (!file_in)
- file_in = argv[i];
- else if ((!strcmp(argv[i], "-main-out")) && (i < (argc - 1)))
- {
- i++;
- file_out = argv[i];
- }
- else if (!strcmp(argv[i], "-no-build-sh"))
- build_sh = 0;
- else if (!strcmp(argv[i], "-current-dir"))
- new_dir = 0;
+ if (!strcmp(argv[i], "-h"))
+ {
+ main_help();
+ exit(0);
+ }
+ if (!file_in)
+ file_in = argv[i];
+ else if ((!strcmp(argv[i], "-main-out")) && (i < (argc - 1)))
+ {
+ i++;
+#ifndef _WIN32
+ file_out = argv[i];
+#endif
+ }
+ else if (!strcmp(argv[i], "-no-build-sh"))
+ build_sh = 0;
+ else if (!strcmp(argv[i], "-current-dir"))
+ new_dir = 0;
else if (!strcmp(argv[i], "-quiet"))
eina_log_domain_level_set("edje_decc", EINA_LOG_LEVEL_WARN);
else if ((!strcmp(argv[i], "-o") || !strcmp(argv[i], "-output")) && (i < (argc - 1)))
- {
- i++;
- outdir = strdup(argv[i]);
- }
+ {
+ i++;
+ outdir = strdup(argv[i]);
+ }
}
if (!file_in)
{
- ERR("no input file specified.");
- main_help();
- exit(-1);
+ ERR("no input file specified.");
+ main_help();
+ exit(-1);
}
if (!edje_init())
@@ -218,41 +225,41 @@ decomp(void)
ef = eet_open(file_in, EET_FILE_MODE_READ);
if (!ef)
{
- ERR("cannot open %s", file_in);
- return 0;
+ ERR("cannot open %s", file_in);
+ return 0;
}
srcfiles = source_load(ef);
if (!srcfiles || !srcfiles->list)
{
- ERR("%s has no decompile information", file_in);
- eet_close(ef);
- return 0;
+ ERR("%s has no decompile information", file_in);
+ eet_close(ef);
+ return 0;
}
if (!eina_list_data_get(srcfiles->list) || !root_filename_is_sane())
{
- ERR("Invalid root filename: '%s'", (char *) eina_list_data_get(srcfiles->list));
- eet_close(ef);
- return 0;
+ ERR("Invalid root filename: '%s'", (char *)eina_list_data_get(srcfiles->list));
+ eet_close(ef);
+ return 0;
}
edje_file = eet_data_read(ef, _edje_edd_edje_file, "edje/file");
if (!edje_file)
{
ERR("%s does not appear to be an edje file", file_in);
- eet_close(ef);
- return 0;
+ eet_close(ef);
+ return 0;
}
/* force compiler to be edje_cc */
edje_file->compiler = strdup("edje_cc");
if (!edje_file->compiler)
{
- edje_file->compiler = strdup("edje_cc");
+ edje_file->compiler = strdup("edje_cc");
}
else if (!compiler_cmd_is_sane())
{
- ERR("invalid compiler executable: '%s'", edje_file->compiler);
- eet_close(ef);
- return 0;
+ ERR("invalid compiler executable: '%s'", edje_file->compiler);
+ eet_close(ef);
+ return 0;
}
fontlist = source_fontmap_load(ef);
return 1;
@@ -268,122 +275,122 @@ output(void)
if (!outdir)
{
- if (!new_dir)
- outdir = strdup(".");
- else
- {
- p = strrchr(file_in, '/');
- if (p)
- outdir = strdup(p + 1);
- else
- outdir = strdup(file_in);
- p = strrchr(outdir, '.');
- if (p) *p = 0;
- ecore_file_mkpath(outdir);
- }
+ if (!new_dir)
+ outdir = strdup(".");
+ else
+ {
+ p = strrchr(file_in, '/');
+ if (p)
+ outdir = strdup(p + 1);
+ else
+ outdir = strdup(file_in);
+ p = strrchr(outdir, '.');
+ if (p) *p = 0;
+ ecore_file_mkpath(outdir);
+ }
}
-
tef = eet_open(file_in, EET_FILE_MODE_READ);
if (edje_file->image_dir)
{
Edje_Image_Directory_Entry *ei;
- unsigned int i;
-
- for (i = 0; i < edje_file->image_dir->entries_count; ++i)
- {
- ei = &edje_file->image_dir->entries[i];
-
- if ((ei->source_type > EDJE_IMAGE_SOURCE_TYPE_NONE) &&
- (ei->source_type < EDJE_IMAGE_SOURCE_TYPE_LAST) &&
- (ei->source_type != EDJE_IMAGE_SOURCE_TYPE_EXTERNAL) &&
- (ei->entry))
- {
- Ecore_Evas *ee;
- Evas *evas;
- Evas_Object *im;
- char buf[4096];
- char out[4096];
- char *pp;
-
- ecore_init();
- ecore_evas_init();
- ee = ecore_evas_buffer_new(1, 1);
- if (!ee)
- {
- ERR("Cannot create buffer engine canvas for image save.");
- exit(-1);
- }
- evas = ecore_evas_get(ee);
- im = evas_object_image_add(evas);
- if (!im)
- {
- ERR("Cannot create image object for save.");
- exit(-1);
- }
- snprintf(buf, sizeof(buf), "edje/images/%i", ei->id);
- evas_object_image_file_set(im, file_in, buf);
- snprintf(out, sizeof(out), "%s/%s", outdir, ei->entry);
- INF("Output Image: %s", out);
- pp = strdup(out);
- p = strrchr(pp, '/');
- if (p) *p = 0;
- if (strstr(pp, "../"))
- {
- ERR("Potential security violation. attempt to write in parent dir.");
- exit(-1);
- }
- ecore_file_mkpath(pp);
- free(pp);
+ unsigned int i;
+
+ for (i = 0; i < edje_file->image_dir->entries_count; ++i)
+ {
+ ei = &edje_file->image_dir->entries[i];
+
+ if ((ei->source_type > EDJE_IMAGE_SOURCE_TYPE_NONE) &&
+ (ei->source_type < EDJE_IMAGE_SOURCE_TYPE_LAST) &&
+ (ei->source_type != EDJE_IMAGE_SOURCE_TYPE_USER) &&
+ (ei->source_type != EDJE_IMAGE_SOURCE_TYPE_EXTERNAL) &&
+ (ei->entry))
+ {
+ Ecore_Evas *ee;
+ Evas *evas;
+ Evas_Object *im;
+ char buf[4096];
+ char out[4096];
+ char *pp;
+
+ ecore_init();
+ ecore_evas_init();
+ ee = ecore_evas_buffer_new(1, 1);
+ if (!ee)
+ {
+ ERR("Cannot create buffer engine canvas for image save.");
+ exit(-1);
+ }
+ evas = ecore_evas_get(ee);
+ im = evas_object_image_add(evas);
+ if (!im)
+ {
+ ERR("Cannot create image object for save.");
+ exit(-1);
+ }
+ snprintf(buf, sizeof(buf), "edje/images/%i", ei->id);
+ evas_object_image_file_set(im, file_in, buf);
+ snprintf(out, sizeof(out), "%s/%s", outdir, ei->entry);
+ INF("Output Image: %s", out);
+ pp = strdup(out);
+ p = strrchr(pp, '/');
+ if (p) *p = 0;
+ if (strstr(pp, "../"))
+ {
+ ERR("Potential security violation. attempt to write in parent dir.");
+ exit(-1);
+ }
+ ecore_file_mkpath(pp);
+ free(pp);
if (!evas_object_image_save(im, out, NULL, "quality=100 compress=9 encoding=auto"))
- {
- ERR("Cannot write file %s. Perhaps missing JPEG or PNG saver modules for Evas.", out);
- exit(-1);
- }
- evas_object_del(im);
- ecore_evas_free(ee);
- ecore_evas_shutdown();
- ecore_shutdown();
- }
- }
+ {
+ ERR("Cannot write file %s. Perhaps missing JPEG or PNG saver modules for Evas.", out);
+ exit(-1);
+ }
+ evas_object_del(im);
+ ecore_evas_free(ee);
+ ecore_evas_shutdown();
+ ecore_shutdown();
+ }
+ }
}
EINA_LIST_FOREACH(srcfiles->list, l, sf)
{
- char out[4096];
- FILE *f;
- char *pp;
-
- snprintf(out, sizeof(out), "%s/%s", outdir, sf->name);
- INF("Output Source File: %s", out);
- pp = strdup(out);
- p = strrchr(pp, '/');
- if (p) *p = 0;
- if (strstr(pp, "../"))
- {
- ERR("Potential security violation. attempt to write in parent dir.");
- exit (-1);
- }
- ecore_file_mkpath(pp);
- free(pp);
- if (strstr(out, "../"))
- {
- ERR("Potential security violation. attempt to write in parent dir.");
- exit (-1);
- }
- f = fopen(out, "wb");
- if (!f)
- {
- ERR("Unable to write file (%s).", out);
- exit (-1);
- }
-
- /* if the file is empty, sf->file will be NULL.
- * note that that's not an error
- */
- if (sf->file) fputs(sf->file, f);
- fclose(f);
+ char out[4096];
+ FILE *f;
+ char *pp;
+
+ snprintf(out, sizeof(out), "%s/%s", outdir, sf->name);
+ INF("Output Source File: %s", out);
+ pp = strdup(out);
+ p = strrchr(pp, '/');
+ if (p) *p = 0;
+ if (strstr(pp, "../"))
+ {
+ ERR("Potential security violation. attempt to write in parent dir.");
+ exit(-1);
+ }
+ ecore_file_mkpath(pp);
+ free(pp);
+ if (strstr(out, "../"))
+ {
+ ERR("Potential security violation. attempt to write in parent dir.");
+ exit(-1);
+ }
+ f = fopen(out, "wb");
+ if (!f)
+ {
+ ERR("Unable to write file (%s).", out);
+ exit(-1);
+ }
+
+ /* if the file is empty, sf->file will be NULL.
+ * note that that's not an error
+ */
+ if (sf->file) fputs(sf->file, f);
+ fclose(f);
}
if (edje_file->fonts)
{
@@ -391,93 +398,91 @@ output(void)
Eina_Iterator *it;
it = eina_hash_iterator_data_new(edje_file->fonts);
- EINA_ITERATOR_FOREACH(it, fn)
- {
- void *font;
- int fontsize;
- char out[4096];
+ EINA_ITERATOR_FOREACH(it, fn)
+ {
+ void *font;
+ int fontsize;
+ char out[4096];
/* FIXME!!!! */
- /* should be fn->entry -v */
- snprintf(out, sizeof(out), "edje/fonts/%s", fn->file);
- font = eet_read(tef, out, &fontsize);
- if (font)
- {
- FILE *f;
- char *pp;
-
- /* should be fn->file -v */
- snprintf(out, sizeof(out), "%s/%s", outdir, fn->entry);
- INF("Output Font: %s", out);
- pp = strdup(out);
- p = strrchr(pp, '/');
- if (p) *p = 0;
- if (strstr(pp, "../"))
- {
- ERR("Potential security violation. attempt to write in parent dir.");
- exit (-1);
- }
- ecore_file_mkpath(pp);
- free(pp);
- if (strstr(out, "../"))
- {
- ERR("Potential security violation. attempt to write in parent dir.");
- exit (-1);
- }
- if (!(f = fopen(out, "wb")))
+ /* should be fn->entry -v */
+ snprintf(out, sizeof(out), "edje/fonts/%s", fn->file);
+ font = eet_read(tef, out, &fontsize);
+ if (font)
+ {
+ FILE *f;
+ char *pp;
+
+ /* should be fn->file -v */
+ snprintf(out, sizeof(out), "%s/%s", outdir, fn->entry);
+ INF("Output Font: %s", out);
+ pp = strdup(out);
+ p = strrchr(pp, '/');
+ if (p) *p = 0;
+ if (strstr(pp, "../"))
+ {
+ ERR("Potential security violation. attempt to write in parent dir.");
+ exit(-1);
+ }
+ ecore_file_mkpath(pp);
+ free(pp);
+ if (strstr(out, "../"))
+ {
+ ERR("Potential security violation. attempt to write in parent dir.");
+ exit(-1);
+ }
+ if (!(f = fopen(out, "wb")))
{
ERR("Could not open file: %s", out);
- exit (-1);
+ exit(-1);
}
- if (fwrite(font, fontsize, 1, f) != 1)
- ERR("Could not write font: %s", strerror(errno));
- if (f) fclose(f);
- free(font);
- }
- }
- eina_iterator_free(it);
- }
- {
- char out[4096];
- FILE *f;
- sf = eina_list_data_get(srcfiles->list);
-
-
- if (build_sh)
- {
- snprintf(out, sizeof(out), "%s/build.sh", outdir);
- INF("Output Build Script: %s", out);
- if (strstr(out, "../"))
- {
- ERR("potential security violation. attempt to write in parent dir.");
- exit (-1);
- }
- if ((f = fopen(out, "wb")))
- {
- fprintf(f, "#!/bin/sh\n");
- fprintf(f, "%s $@ -id . -fd . %s -o %s.edj\n",
- edje_file->compiler, sf->name, outdir);
- fclose(f);
- if (chmod(out,
- S_IRUSR | S_IWUSR | S_IXUSR |
- S_IRGRP | S_IWGRP | S_IXGRP) < 0)
- ERR("chmod on %s failed", out);
- }
-
- WRN("*** CAUTION ***\n"
- "Please check the build script for anything malicious "
- "before running it!\n\n");
- }
-
- if (file_out)
- {
- snprintf(out, sizeof(out), "%s/%s", outdir, file_out);
- if (ecore_file_symlink(sf->name, out) != EINA_TRUE)
- {
- ERR("symlink %s -> %s failed", sf->name, out);
+ if (fwrite(font, fontsize, 1, f) != 1)
+ ERR("Could not write font: %s", strerror(errno));
+ if (f) fclose(f);
+ free(font);
}
- }
-
+ }
+ eina_iterator_free(it);
}
+ {
+ char out[4096];
+ FILE *f;
+ sf = eina_list_data_get(srcfiles->list);
+
+ if (build_sh)
+ {
+ snprintf(out, sizeof(out), "%s/build.sh", outdir);
+ INF("Output Build Script: %s", out);
+ if (strstr(out, "../"))
+ {
+ ERR("potential security violation. attempt to write in parent dir.");
+ exit(-1);
+ }
+ if ((f = fopen(out, "wb")))
+ {
+ fprintf(f, "#!/bin/sh\n");
+ fprintf(f, "%s $@ -id . -fd . %s -o %s.edj\n",
+ edje_file->compiler, sf->name, outdir);
+ fclose(f);
+ if (chmod(out,
+ S_IRUSR | S_IWUSR | S_IXUSR |
+ S_IRGRP | S_IWGRP | S_IXGRP) < 0)
+ ERR("chmod on %s failed", out);
+ }
+
+ WRN("*** CAUTION ***\n"
+ "Please check the build script for anything malicious "
+ "before running it!\n\n");
+ }
+
+ if (file_out)
+ {
+ snprintf(out, sizeof(out), "%s/%s", outdir, file_out);
+ if (ecore_file_symlink(sf->name, out) != EINA_TRUE)
+ {
+ ERR("symlink %s -> %s failed", sf->name, out);
+ }
+ }
+ }
if (edje_file->sound_dir)
{
@@ -522,9 +527,8 @@ output(void)
fclose(f);
}
else ERR("Could not open for writing sound: %s: %s", out1, strerror(errno));
- }
+ }
}
-
}
if (edje_file->vibration_dir)
{
@@ -569,7 +573,7 @@ output(void)
fclose(f);
}
else ERR("Could not open for writing sound: %s: %s", out1, strerror(errno));
- }
+ }
}
}
@@ -584,16 +588,16 @@ compiler_cmd_is_sane()
if ((!c) || (!*c))
{
- return 0;
+ return 0;
}
for (ptr = c; ptr && *ptr; ptr++)
{
- /* only allow [a-z][A-Z][0-9]_- */
- if ((!isalnum(*ptr)) && (*ptr != '_') && (*ptr != '-'))
- {
- return 0;
- }
+ /* only allow [a-z][A-Z][0-9]_- */
+ if ((!isalnum(*ptr)) && (*ptr != '_') && (*ptr != '-'))
+ {
+ return 0;
+ }
}
return 1;
@@ -607,22 +611,27 @@ root_filename_is_sane()
if (!f || !*f)
{
- return 0;
+ return 0;
}
for (ptr = f; ptr && *ptr; ptr++)
{
- /* only allow [a-z][A-Z][0-9]_-./ */
- switch (*ptr)
- {
- case '_': case '-': case '.': case '/':
- break;
- default:
- if (!isalnum(*ptr))
- {
- return 0;
- }
- }
+ /* only allow [a-z][A-Z][0-9]_-./ */
+ switch (*ptr)
+ {
+ case '_':
+ case '-':
+ case '.':
+ case '/':
+ break;
+
+ default:
+ if (!isalnum(*ptr))
+ {
+ return 0;
+ }
+ }
}
return 1;
}
+
diff --git a/src/bin/edje/edje_external_inspector.c b/src/bin/edje/edje_external_inspector.c
index 5fd8e5e5ee..3a4f937b06 100644
--- a/src/bin/edje/edje_external_inspector.c
+++ b/src/bin/edje/edje_external_inspector.c
@@ -17,7 +17,7 @@ static int _log_dom;
#define ERR(...) EINA_LOG_DOM_ERR(_log_dom, __VA_ARGS__)
#define CRI(...) EINA_LOG_DOM_CRIT(_log_dom, __VA_ARGS__)
-#define INDENT " "
+#define INDENT " "
#define INDENT2 INDENT INDENT
#define INDENT3 INDENT2 INDENT
#define INDENT4 INDENT3 INDENT
@@ -27,15 +27,14 @@ static char *module_patterns_str = NULL;
static int detail = 1;
static Eina_Bool machine = EINA_FALSE;
static char *type_glob = NULL;
-static char * const *module_patterns;
+static char *const *module_patterns;
static const Eina_List *modules;
-
static char *
_module_patterns_str_new(void)
{
Eina_Strbuf *buf;
- char * const *itr;
+ char *const *itr;
char *ret;
if (!module_patterns) return strdup("*");
@@ -53,7 +52,7 @@ _module_patterns_str_new(void)
static Eina_Bool
module_matches(const char *name)
{
- char * const *itr;
+ char *const *itr;
if (!module_patterns) return EINA_TRUE;
for (itr = module_patterns; *itr != NULL; itr++)
@@ -93,13 +92,18 @@ _param_type_str_get(const Edje_External_Param_Info *param)
switch (param->type)
{
case EDJE_EXTERNAL_PARAM_TYPE_INT: return "int";
+
case EDJE_EXTERNAL_PARAM_TYPE_DOUBLE: return "double";
+
case EDJE_EXTERNAL_PARAM_TYPE_STRING: return "string";
+
case EDJE_EXTERNAL_PARAM_TYPE_BOOL: return "bool";
+
case EDJE_EXTERNAL_PARAM_TYPE_CHOICE: return "choice";
+
default:
- ERR("Unknown parameter type %d", param->type);
- return "???";
+ ERR("Unknown parameter type %d", param->type);
+ return "???";
}
}
@@ -109,38 +113,39 @@ _param_value_str_get(const Edje_External_Type *type, const Edje_External_Param_I
switch (param->type)
{
case EDJE_EXTERNAL_PARAM_TYPE_INT:
- if (param->info.i.def == EDJE_EXTERNAL_INT_UNSET) return NULL;
- snprintf(buf, buflen, "%d", param->info.i.def);
- return buf;
+ if (param->info.i.def == EDJE_EXTERNAL_INT_UNSET) return NULL;
+ snprintf(buf, buflen, "%d", param->info.i.def);
+ return buf;
case EDJE_EXTERNAL_PARAM_TYPE_DOUBLE:
- if (EINA_DBL_EQ(param->info.d.def, EDJE_EXTERNAL_DOUBLE_UNSET)) return NULL;
- snprintf(buf, buflen, "%g", param->info.d.def);
- return buf;
+ if (EINA_DBL_EQ(param->info.d.def, EDJE_EXTERNAL_DOUBLE_UNSET)) return NULL;
+ snprintf(buf, buflen, "%g", param->info.d.def);
+ return buf;
case EDJE_EXTERNAL_PARAM_TYPE_STRING:
- return param->info.s.def;
+ return param->info.s.def;
case EDJE_EXTERNAL_PARAM_TYPE_BOOL:
- if (param->info.b.def == 0) return "0";
- else if (param->info.b.def == 1) return "1";
- return NULL;
+ if (param->info.b.def == 0) return "0";
+ else if (param->info.b.def == 1)
+ return "1";
+ return NULL;
case EDJE_EXTERNAL_PARAM_TYPE_CHOICE:
- {
- char *def;
- if (param->info.c.def) return param->info.c.def;
- if (!param->info.c.def_get) return NULL;
- def = param->info.c.def_get(type->data, param);
- if (!def) return NULL;
- eina_strlcpy(buf, def, buflen);
- free(def);
- return buf;
- }
+ {
+ char *def;
+ if (param->info.c.def) return param->info.c.def;
+ if (!param->info.c.def_get) return NULL;
+ def = param->info.c.def_get(type->data, param);
+ if (!def) return NULL;
+ eina_strlcpy(buf, def, buflen);
+ free(def);
+ return buf;
+ }
default:
- ERR("Unknown parameter type %d", param->type);
- return NULL;
+ ERR("Unknown parameter type %d", param->type);
+ return NULL;
}
}
@@ -179,7 +184,7 @@ _param_flags_str_get(const Edje_External_Param_Info *param)
}
static void
-_param_choices_print(const char * const *choices)
+_param_choices_print(const char *const *choices)
{
if (machine) puts("CHOICES-BEGIN");
else fputs(", choices:", stdout);
@@ -201,90 +206,91 @@ _param_extra_details(const Edje_External_Type *type, const Edje_External_Param_I
switch (param->type)
{
case EDJE_EXTERNAL_PARAM_TYPE_INT:
- if (param->info.i.min != EDJE_EXTERNAL_INT_UNSET)
- {
- if (machine) printf("MIN: %d\n", param->info.i.min);
- else printf(", min: %d", param->info.i.min);
- }
- if (param->info.i.max != EDJE_EXTERNAL_INT_UNSET)
- {
- if (machine) printf("MAX: %d\n", param->info.i.max);
- else printf(", max: %d", param->info.i.max);
- }
- if (param->info.i.step != EDJE_EXTERNAL_INT_UNSET)
- {
- if (machine) printf("STEP: %d\n", param->info.i.step);
- else printf(", step: %d", param->info.i.step);
- }
- break;
+ if (param->info.i.min != EDJE_EXTERNAL_INT_UNSET)
+ {
+ if (machine) printf("MIN: %d\n", param->info.i.min);
+ else printf(", min: %d", param->info.i.min);
+ }
+ if (param->info.i.max != EDJE_EXTERNAL_INT_UNSET)
+ {
+ if (machine) printf("MAX: %d\n", param->info.i.max);
+ else printf(", max: %d", param->info.i.max);
+ }
+ if (param->info.i.step != EDJE_EXTERNAL_INT_UNSET)
+ {
+ if (machine) printf("STEP: %d\n", param->info.i.step);
+ else printf(", step: %d", param->info.i.step);
+ }
+ break;
case EDJE_EXTERNAL_PARAM_TYPE_DOUBLE:
- if (EINA_DBL_EQ(param->info.d.min, EDJE_EXTERNAL_DOUBLE_UNSET))
- {
- if (machine) printf("MIN: %g\n", param->info.d.min);
- else printf(", min: %g", param->info.d.min);
- }
- if (EINA_DBL_EQ(param->info.d.max, EDJE_EXTERNAL_DOUBLE_UNSET))
- {
- if (machine) printf("MAX: %g\n", param->info.d.max);
- else printf(", max: %g", param->info.d.max);
- }
- if (EINA_DBL_EQ(param->info.d.step, EDJE_EXTERNAL_DOUBLE_UNSET))
- {
- if (machine) printf("STEP: %g\n", param->info.d.step);
- else printf(", step: %g", param->info.d.step);
- }
- break;
+ if (EINA_DBL_EQ(param->info.d.min, EDJE_EXTERNAL_DOUBLE_UNSET))
+ {
+ if (machine) printf("MIN: %g\n", param->info.d.min);
+ else printf(", min: %g", param->info.d.min);
+ }
+ if (EINA_DBL_EQ(param->info.d.max, EDJE_EXTERNAL_DOUBLE_UNSET))
+ {
+ if (machine) printf("MAX: %g\n", param->info.d.max);
+ else printf(", max: %g", param->info.d.max);
+ }
+ if (EINA_DBL_EQ(param->info.d.step, EDJE_EXTERNAL_DOUBLE_UNSET))
+ {
+ if (machine) printf("STEP: %g\n", param->info.d.step);
+ else printf(", step: %g", param->info.d.step);
+ }
+ break;
case EDJE_EXTERNAL_PARAM_TYPE_STRING:
- if (param->info.s.accept_fmt)
- {
- if (machine) printf("ACCEPT_FMT: %s\n", param->info.s.accept_fmt);
- else printf(", accept_fmt: \"%s\"", param->info.s.accept_fmt);
- }
- if (param->info.s.deny_fmt)
- {
- if (machine) printf("DENY_FMT: %s\n", param->info.s.deny_fmt);
- else printf(", deny_fmt: \"%s\"", param->info.s.deny_fmt);
- }
- break;
+ if (param->info.s.accept_fmt)
+ {
+ if (machine) printf("ACCEPT_FMT: %s\n", param->info.s.accept_fmt);
+ else printf(", accept_fmt: \"%s\"", param->info.s.accept_fmt);
+ }
+ if (param->info.s.deny_fmt)
+ {
+ if (machine) printf("DENY_FMT: %s\n", param->info.s.deny_fmt);
+ else printf(", deny_fmt: \"%s\"", param->info.s.deny_fmt);
+ }
+ break;
case EDJE_EXTERNAL_PARAM_TYPE_BOOL:
- if (param->info.b.false_str)
- {
- if (machine) printf("FALSE_STR: %s\n", param->info.b.false_str);
- else printf(", false_str: \"%s\"", param->info.b.false_str);
- }
- if (param->info.b.true_str)
- {
- if (machine) printf("TRUE_STR: %s\n", param->info.b.true_str);
- else printf(", true_str: \"%s\"", param->info.b.true_str);
- }
- break;
+ if (param->info.b.false_str)
+ {
+ if (machine) printf("FALSE_STR: %s\n", param->info.b.false_str);
+ else printf(", false_str: \"%s\"", param->info.b.false_str);
+ }
+ if (param->info.b.true_str)
+ {
+ if (machine) printf("TRUE_STR: %s\n", param->info.b.true_str);
+ else printf(", true_str: \"%s\"", param->info.b.true_str);
+ }
+ break;
case EDJE_EXTERNAL_PARAM_TYPE_CHOICE:
- {
- if (param->info.c.choices)
- _param_choices_print(param->info.c.choices);
- else if (param->info.c.query)
- {
- char **choices = param->info.c.query(type->data, param);
- if (choices)
- {
- char **itr;
- _param_choices_print((const char * const*)choices);
- for (itr = choices; *itr; itr++) free(*itr);
- free(choices);
- }
- }
- }
- break;
+ {
+ if (param->info.c.choices)
+ _param_choices_print(param->info.c.choices);
+ else if (param->info.c.query)
+ {
+ char **choices = param->info.c.query(type->data, param);
+ if (choices)
+ {
+ char **itr;
+ _param_choices_print((const char *const *)choices);
+ for (itr = choices; *itr; itr++)
+ free(*itr);
+ free(choices);
+ }
+ }
+ }
+ break;
default:
- ERR("Unknown parameter type %d", param->type);
+ ERR("Unknown parameter type %d", param->type);
}
- if (!machine) fputs(" */", stdout); /* \n not desired */
+ if (!machine) fputs(" */", stdout); /* \n not desired */
}
static int
@@ -397,12 +403,14 @@ _info_list(void)
if (!type->label_get) str = NULL;
else str = type->label_get(type->data);
if (machine) printf("LABEL: %s\n", str ? str : "");
- else if (str) printf(INDENT3 "label: \"%s\";\n", str);
+ else if (str)
+ printf(INDENT3 "label: \"%s\";\n", str);
if (!type->description_get) str = NULL;
else str = type->description_get(type->data);
if (machine) printf("DESCRIPTION: %s\n", str ? str : "");
- else if (str) printf(INDENT3 "description: \"%s\";\n", str);
+ else if (str)
+ printf(INDENT3 "description: \"%s\";\n", str);
}
if (machine) puts("PARAMS-BEGIN");
@@ -420,9 +428,10 @@ _info_list(void)
if (detail > 0)
{
const char *str = _param_value_str_get
- (type, param, buf, sizeof(buf));
+ (type, param, buf, sizeof(buf));
if (machine) printf("DEFAULT: %s\n", str ? str : "");
- else if (str) printf(" \"%s\"", str);
+ else if (str)
+ printf(" \"%s\"", str);
if (detail > 1)
{
@@ -432,7 +441,8 @@ _info_list(void)
}
if (machine) puts("PARAM-END");
- else if (detail > 1) putchar('\n');
+ else if (detail > 1)
+ putchar('\n');
else puts(";");
}
@@ -544,40 +554,40 @@ _modules_names_list(void)
}
static const char *mode_choices[] = {
- "info",
- "modules-names",
- "types-names",
- NULL,
+ "info",
+ "modules-names",
+ "types-names",
+ NULL,
};
static const char *detail_choices[] = {
- "none",
- "terse",
- "all",
- NULL
+ "none",
+ "terse",
+ "all",
+ NULL
};
const Ecore_Getopt optdesc = {
- "edje_external_inspector",
- "%prog [options] [module|module-glob] ... [module|module-glob]",
- PACKAGE_VERSION,
- "(C) 2010 - The Enlightenment Project",
- "BSD",
- "Edje external module inspector.",
- 0,
- {
- ECORE_GETOPT_CHOICE('m', "mode", "Choose which mode to operate.",
- mode_choices),
- ECORE_GETOPT_STORE_STR('t', "type", "Limit output to type (or glob)."),
- ECORE_GETOPT_CHOICE('d', "detail", "Choose detail level (default=terse)",
- detail_choices),
- ECORE_GETOPT_STORE_TRUE('M', "machine", "Produce machine readable output."),
- ECORE_GETOPT_LICENSE('L', "license"),
- ECORE_GETOPT_COPYRIGHT('C', "copyright"),
- ECORE_GETOPT_VERSION('V', "version"),
- ECORE_GETOPT_HELP('h', "help"),
- ECORE_GETOPT_SENTINEL
- }
+ "edje_external_inspector",
+ "%prog [options] [module|module-glob] ... [module|module-glob]",
+ PACKAGE_VERSION,
+ "(C) 2010 - The Enlightenment Project",
+ "BSD",
+ "Edje external module inspector.",
+ 0,
+ {
+ ECORE_GETOPT_CHOICE('m', "mode", "Choose which mode to operate.",
+ mode_choices),
+ ECORE_GETOPT_STORE_STR('t', "type", "Limit output to type (or glob)."),
+ ECORE_GETOPT_CHOICE('d', "detail", "Choose detail level (default=terse)",
+ detail_choices),
+ ECORE_GETOPT_STORE_TRUE('M', "machine", "Produce machine readable output."),
+ ECORE_GETOPT_LICENSE('L', "license"),
+ ECORE_GETOPT_COPYRIGHT('C', "copyright"),
+ ECORE_GETOPT_VERSION('V', "version"),
+ ECORE_GETOPT_HELP('h', "help"),
+ ECORE_GETOPT_SENTINEL
+ }
};
int
@@ -589,15 +599,15 @@ main(int argc, char **argv)
int arg_index;
int ret = 0;
Ecore_Getopt_Value values[] = {
- ECORE_GETOPT_VALUE_STR(mode),
- ECORE_GETOPT_VALUE_STR(type_glob),
- ECORE_GETOPT_VALUE_STR(detail_name),
- ECORE_GETOPT_VALUE_BOOL(machine),
- ECORE_GETOPT_VALUE_BOOL(quit_option),
- ECORE_GETOPT_VALUE_BOOL(quit_option),
- ECORE_GETOPT_VALUE_BOOL(quit_option),
- ECORE_GETOPT_VALUE_BOOL(quit_option),
- ECORE_GETOPT_VALUE_NONE
+ ECORE_GETOPT_VALUE_STR(mode),
+ ECORE_GETOPT_VALUE_STR(type_glob),
+ ECORE_GETOPT_VALUE_STR(detail_name),
+ ECORE_GETOPT_VALUE_BOOL(machine),
+ ECORE_GETOPT_VALUE_BOOL(quit_option),
+ ECORE_GETOPT_VALUE_BOOL(quit_option),
+ ECORE_GETOPT_VALUE_BOOL(quit_option),
+ ECORE_GETOPT_VALUE_BOOL(quit_option),
+ ECORE_GETOPT_VALUE_NONE
};
setlocale(LC_NUMERIC, "C");
@@ -609,7 +619,7 @@ main(int argc, char **argv)
edje_init();
_log_dom = eina_log_domain_register
- ("edje_external_inspector", EINA_COLOR_YELLOW);
+ ("edje_external_inspector", EINA_COLOR_YELLOW);
if (_log_dom < 0)
{
EINA_LOG_CRIT
@@ -625,27 +635,32 @@ main(int argc, char **argv)
ret = 1;
goto error_getopt;
}
- else if (quit_option) goto error_getopt;
+ else if (quit_option)
+ goto error_getopt;
if (!mode) mode = (char *)mode_choices[0];
if (detail_name)
{
if (!strcmp(detail_name, "none")) detail = 0;
- else if (!strcmp(detail_name, "terse")) detail = 1;
- else if (!strcmp(detail_name, "all")) detail = 2;
+ else if (!strcmp(detail_name, "terse"))
+ detail = 1;
+ else if (!strcmp(detail_name, "all"))
+ detail = 2;
else ERR("Unknown detail level: '%s'", detail_name);
}
if (arg_index < argc) module_patterns = argv + arg_index;
- else module_patterns = NULL;
+ else module_patterns = NULL;
modules = edje_available_modules_get();
module_patterns_str = _module_patterns_str_new();
if (!strcmp(mode, "info")) ret = _info_list();
- else if (!strcmp(mode, "modules-names")) ret = _modules_names_list();
- else if (!strcmp(mode, "types-names")) ret = _types_names_list();
+ else if (!strcmp(mode, "modules-names"))
+ ret = _modules_names_list();
+ else if (!strcmp(mode, "types-names"))
+ ret = _types_names_list();
else
{
ERR("Unknown mode: %s", mode);
@@ -654,12 +669,13 @@ main(int argc, char **argv)
free(module_patterns_str);
- error_getopt:
+error_getopt:
eina_log_domain_unregister(_log_dom);
- error_log:
+error_log:
edje_shutdown();
ecore_shutdown();
eina_shutdown();
return ret;
}
+
diff --git a/src/bin/edje/edje_inspector.c b/src/bin/edje/edje_inspector.c
index b0710343ca..25024cee73 100644
--- a/src/bin/edje/edje_inspector.c
+++ b/src/bin/edje/edje_inspector.c
@@ -22,13 +22,13 @@ static int _log_dom;
#define ERR(...) EINA_LOG_DOM_ERR(_log_dom, __VA_ARGS__)
#define CRI(...) EINA_LOG_DOM_CRIT(_log_dom, __VA_ARGS__)
-#define INDENT " "
-#define INDENT2 INDENT INDENT
-#define INDENT3 INDENT2 INDENT
-#define INDENT4 INDENT3 INDENT
-#define INDENT5 INDENT4 INDENT
-#define INDENT6 INDENT5 INDENT
-#define INDENT7 INDENT6 INDENT
+#define INDENT " "
+#define INDENT2 INDENT INDENT
+#define INDENT3 INDENT2 INDENT
+#define INDENT4 INDENT3 INDENT
+#define INDENT5 INDENT4 INDENT
+#define INDENT6 INDENT5 INDENT
+#define INDENT7 INDENT6 INDENT
#define FLOAT_PRECISION 0.0001
#define FDIFF(a, b) (fabs((a) - (b)) > FLOAT_PRECISION)
@@ -48,53 +48,53 @@ static Eina_Bool api_fix = EINA_FALSE;
static Eina_Bool machine = EINA_FALSE;
static const char *mode_choices[] = {
- "groups",
- "parts",
- "programs",
- "groups-names",
- "part-names",
- "global-data",
- "images",
- "fonts",
- "externals",
- NULL,
+ "groups",
+ "parts",
+ "programs",
+ "groups-names",
+ "part-names",
+ "global-data",
+ "images",
+ "fonts",
+ "externals",
+ NULL,
};
static const char *detail_choices[] = {
- "none",
- "terse",
- "all",
- NULL
+ "none",
+ "terse",
+ "all",
+ NULL
};
const Ecore_Getopt optdesc = {
- "edje_inspector",
- "%prog [options] <file.edj>",
- PACKAGE_VERSION,
- "(C) 2010 - The Enlightenment Project",
- "BSD",
- "Edje file inspector, let one see groups, parts, programs and other details "
- "of a compiled (binary) edje file.\n",
- 0,
- {
- ECORE_GETOPT_CHOICE('m', "mode", "Choose which mode to operate on file.",
- mode_choices),
- ECORE_GETOPT_CHOICE('d', "detail", "Choose detail level (default=terse)",
- detail_choices),
- ECORE_GETOPT_STORE_STR('g', "group", "Limit output to group (or glob)."),
- ECORE_GETOPT_STORE_STR('p', "part", "Limit output to part (or glob)."),
- ECORE_GETOPT_STORE_STR('r', "program",
- "Limit output to program (or glob)."),
- ECORE_GETOPT_STORE_TRUE('a', "api-only", "Limit to just api parts or "
- "programs."),
- ECORE_GETOPT_STORE_TRUE('A', "api-fix", "Fix API names to be C compliant."),
- ECORE_GETOPT_STORE_TRUE('M', "machine", "Produce machine readable output."),
- ECORE_GETOPT_LICENSE('L', "license"),
- ECORE_GETOPT_COPYRIGHT('C', "copyright"),
- ECORE_GETOPT_VERSION('V', "version"),
- ECORE_GETOPT_HELP('h', "help"),
- ECORE_GETOPT_SENTINEL
- }
+ "edje_inspector",
+ "%prog [options] <file.edj>",
+ PACKAGE_VERSION,
+ "(C) 2010 - The Enlightenment Project",
+ "BSD",
+ "Edje file inspector, let one see groups, parts, programs and other details "
+ "of a compiled (binary) edje file.\n",
+ 0,
+ {
+ ECORE_GETOPT_CHOICE('m', "mode", "Choose which mode to operate on file.",
+ mode_choices),
+ ECORE_GETOPT_CHOICE('d', "detail", "Choose detail level (default=terse)",
+ detail_choices),
+ ECORE_GETOPT_STORE_STR('g', "group", "Limit output to group (or glob)."),
+ ECORE_GETOPT_STORE_STR('p', "part", "Limit output to part (or glob)."),
+ ECORE_GETOPT_STORE_STR('r', "program",
+ "Limit output to program (or glob)."),
+ ECORE_GETOPT_STORE_TRUE('a', "api-only", "Limit to just api parts or "
+ "programs."),
+ ECORE_GETOPT_STORE_TRUE('A', "api-fix", "Fix API names to be C compliant."),
+ ECORE_GETOPT_STORE_TRUE('M', "machine", "Produce machine readable output."),
+ ECORE_GETOPT_LICENSE('L', "license"),
+ ECORE_GETOPT_COPYRIGHT('C', "copyright"),
+ ECORE_GETOPT_VERSION('V', "version"),
+ ECORE_GETOPT_HELP('h', "help"),
+ ECORE_GETOPT_SENTINEL
+ }
};
static inline Eina_Bool
@@ -130,12 +130,14 @@ group_details(Evas_Object *ed)
w = edje_edit_group_min_w_get(ed);
h = edje_edit_group_min_h_get(ed);
if (machine) printf("MIN-W: %d\nMIN-H: %d\n", w, h);
- else if ((w > 0) || (h > 0)) printf(INDENT "min: %d %d;\n", w, h);
+ else if ((w > 0) || (h > 0))
+ printf(INDENT "min: %d %d;\n", w, h);
w = edje_edit_group_max_w_get(ed);
h = edje_edit_group_max_h_get(ed);
if (machine) printf("MAX-W: %d\nMAX-H: %d\n", w, h);
- else if ((w > 0) || (h > 0)) printf(INDENT "max: %d %d;\n", w, h);
+ else if ((w > 0) || (h > 0))
+ printf(INDENT "max: %d %d;\n", w, h);
if (detail > 1)
{
@@ -185,39 +187,52 @@ part_type_name_get(Edje_Part_Type t)
switch (t)
{
case EDJE_PART_TYPE_RECTANGLE:
- return "RECT";
+ return "RECT";
+
case EDJE_PART_TYPE_TEXT:
- return "TEXT";
+ return "TEXT";
+
case EDJE_PART_TYPE_IMAGE:
- return "IMAGE";
+ return "IMAGE";
+
case EDJE_PART_TYPE_PROXY:
- return "PROXY";
+ return "PROXY";
+
case EDJE_PART_TYPE_SWALLOW:
- return "SWALLOW";
+ return "SWALLOW";
+
case EDJE_PART_TYPE_TEXTBLOCK:
- return "TEXTBLOCK";
+ return "TEXTBLOCK";
+
case EDJE_PART_TYPE_GRADIENT:
- return "GRADIENT";
+ return "GRADIENT";
+
case EDJE_PART_TYPE_GROUP:
- return "GROUP";
+ return "GROUP";
+
case EDJE_PART_TYPE_BOX:
- return "BOX";
+ return "BOX";
+
case EDJE_PART_TYPE_TABLE:
- return "TABLE";
+ return "TABLE";
+
case EDJE_PART_TYPE_EXTERNAL:
- return "EXTERNAL";
+ return "EXTERNAL";
+
case EDJE_PART_TYPE_SPACER:
- return "SPACER";
+ return "SPACER";
+
case EDJE_PART_TYPE_VECTOR:
- return "VECTOR";
+ return "VECTOR";
case EDJE_PART_TYPE_NONE:
case EDJE_PART_TYPE_LAST:
- ERR("Invalid part type %d", t);
- return "???";
+ ERR("Invalid part type %d", t);
+ return "???";
+
default:
- ERR("Unknown part type %d", t);
- return "???";
+ ERR("Unknown part type %d", t);
+ return "???";
}
}
@@ -239,12 +254,16 @@ aspect_pref_name_get(int id)
switch (id)
{
case 0: return "NONE";
+
case 1: return "VERTICAL";
+
case 2: return "HORIZONTAL";
+
case 3: return "BOTH";
+
default:
- ERR("Unknown aspect preference %d", id);
- return "???";
+ ERR("Unknown aspect preference %d", id);
+ return "???";
}
}
@@ -254,11 +273,14 @@ border_fill_name_get(int id)
switch (id)
{
case 0: return "NONE";
+
case 1: return "DEFAULT";
+
case 2: return "SOLID";
+
default:
- ERR("Unknown border fill %d", id);
- return "???";
+ ERR("Unknown border fill %d", id);
+ return "???";
}
}
@@ -274,7 +296,8 @@ state_details(Evas_Object *ed, const char *ppart, const char *state, double valu
b = edje_edit_state_visible_get(ed, ppart, state, value);
if (machine) printf("VISIBLE: %d\n", b);
- else if (!b) puts(INDENT4 "visible: 0;");
+ else if (!b)
+ puts(INDENT4 "visible: 0;");
edje_edit_state_color_get(ed, ppart, state, value, &r, &g, &b, &a);
if (machine)
@@ -308,12 +331,14 @@ state_details(Evas_Object *ed, const char *ppart, const char *state, double valu
x = edje_edit_state_min_w_get(ed, ppart, state, value);
y = edje_edit_state_min_h_get(ed, ppart, state, value);
if (machine) printf("MIN-W: %d\nMIN-H: %d\n", x, y);
- else if ((x) || (y)) printf(INDENT4 "min: %d %d;\n", x, y);
+ else if ((x) || (y))
+ printf(INDENT4 "min: %d %d;\n", x, y);
x = edje_edit_state_max_w_get(ed, ppart, state, value);
y = edje_edit_state_max_h_get(ed, ppart, state, value);
if (machine) printf("MAX-W: %d\nMAX-H: %d\n", x, y);
- else if ((x != -1) || (y != -1)) printf(INDENT4 "max: %d %d;\n", x, y);
+ else if ((x != -1) || (y != -1))
+ printf(INDENT4 "max: %d %d;\n", x, y);
//TODO Support fixed
//TODO Support step
@@ -329,12 +354,14 @@ state_details(Evas_Object *ed, const char *ppart, const char *state, double valu
x = edje_edit_state_aspect_pref_get(ed, ppart, state, value);
str = aspect_pref_name_get(x);
if (machine) printf("ASPECT-PREFERENCE: %s\n", str);
- else if (x) printf(INDENT4 "aspect_preference: %s;\n", str);
+ else if (x)
+ printf(INDENT4 "aspect_preference: %s;\n", str);
/* do not free this str! */
str = edje_edit_state_color_class_get(ed, ppart, state, value);
if (machine) printf("COLOR_CLASS: %s\n", str ? str : "");
- else if (str) printf(INDENT4 "color_class: \"%s\";\n", str);
+ else if (str)
+ printf(INDENT4 "color_class: \"%s\";\n", str);
edje_edit_string_free(str);
}
@@ -354,7 +381,8 @@ state_details(Evas_Object *ed, const char *ppart, const char *state, double valu
printf(INDENT5 "relative: %g %g;\n", dx, dy);
if (machine) printf("OFFSET-X: %d\nOFFSET-Y: %d\n", x, y);
- else if ((x) || (y)) printf(INDENT5 "offset: %d %d;\n", x, y);
+ else if ((x) || (y))
+ printf(INDENT5 "offset: %d %d;\n", x, y);
if (machine)
printf("TO-X: %s\nTO-Y: %s\n", str ? str : "", str2 ? str2 : "");
@@ -418,7 +446,8 @@ state_details(Evas_Object *ed, const char *ppart, const char *state, double valu
puts(INDENT4 "image {");
if (str) printf(INDENT5 "normal: \"%s\";\n", str);
}
- else if (str) printf(INDENT4 "image.normal: \"%s\";\n", str);
+ else if (str)
+ printf(INDENT4 "image.normal: \"%s\";\n", str);
edje_edit_string_free(str);
@@ -448,28 +477,29 @@ state_details(Evas_Object *ed, const char *ppart, const char *state, double valu
x = edje_edit_state_image_border_fill_get(ed, ppart, state, value);
str = border_fill_name_get(x);
if (machine) printf("BORDER-FILL: %s\n", str);
- else if (x != 1) printf(INDENT5 "middle: %s;\n", str);
+ else if (x != 1)
+ printf(INDENT5 "middle: %s;\n", str);
/* do not free str! */
// TODO support image.fill.smooth
dx = edje_edit_state_fill_origin_relative_x_get
- (ed, ppart, state, value);
+ (ed, ppart, state, value);
dy = edje_edit_state_fill_origin_relative_y_get
- (ed, ppart, state, value);
+ (ed, ppart, state, value);
x = edje_edit_state_fill_origin_offset_x_get
- (ed, ppart, state, value);
+ (ed, ppart, state, value);
y = edje_edit_state_fill_origin_offset_y_get
- (ed, ppart, state, value);
+ (ed, ppart, state, value);
dx2 = edje_edit_state_fill_size_relative_x_get
- (ed, ppart, state, value);
+ (ed, ppart, state, value);
dy2 = edje_edit_state_fill_size_relative_y_get
- (ed, ppart, state, value);
+ (ed, ppart, state, value);
x2 = edje_edit_state_fill_size_offset_x_get
- (ed, ppart, state, value);
+ (ed, ppart, state, value);
y2 = edje_edit_state_fill_size_offset_y_get
- (ed, ppart, state, value);
+ (ed, ppart, state, value);
has_orgin = (FDIFF(dx, 0.0) || FDIFF(dy, 0.0) || (x) || (y));
has_size = (FDIFF(dx2, 1.0) || FDIFF(dy2, 1.0) || (x2) || (y2));
@@ -517,83 +547,84 @@ state_details(Evas_Object *ed, const char *ppart, const char *state, double valu
}
if (machine) puts("IMAGE-END");
- else if (detail > 1) puts(INDENT4 "}");
+ else if (detail > 1)
+ puts(INDENT4 "}");
}
else if (t == EDJE_PART_TYPE_PROXY)
- {
- int x2, y2;
- double dx2, dy2;
- Eina_Bool has_orgin, has_size;
-
- if (machine) puts("PROXY-BEGIN");
- else puts(INDENT4 "proxy {");
- // TODO Support source
- // TODO support proxy.fill.smooth
-
- dx = edje_edit_state_fill_origin_relative_x_get
- (ed, ppart, state, value);
- dy = edje_edit_state_fill_origin_relative_y_get
- (ed, ppart, state, value);
- x = edje_edit_state_fill_origin_offset_x_get
- (ed, ppart, state, value);
- y = edje_edit_state_fill_origin_offset_y_get
- (ed, ppart, state, value);
-
- dx2 = edje_edit_state_fill_size_relative_x_get
- (ed, ppart, state, value);
- dy2 = edje_edit_state_fill_size_relative_y_get
- (ed, ppart, state, value);
- x2 = edje_edit_state_fill_size_offset_x_get
- (ed, ppart, state, value);
- y2 = edje_edit_state_fill_size_offset_y_get
- (ed, ppart, state, value);
-
- has_orgin = (FDIFF(dx, 0.0) || FDIFF(dy, 0.0) || (x) || (y));
- has_size = (FDIFF(dx2, 1.0) || FDIFF(dy2, 1.0) || (x2) || (y2));
-
- if ((has_orgin) || (has_size))
- {
- if (machine) puts("PROXY-FILL-BEGIN");
- else puts(INDENT5 "fill {");
-
- if (has_orgin)
- {
- if (machine)
- printf("ORIGIN-RELATIVE-X: %g\n"
- "ORIGIN-RELATIVE-Y: %g\n"
- "ORIGIN-OFFSET-X: %d\n"
- "ORIGIN-OFFSET-Y: %d\n",
- dx, dy, x, y);
- else
- printf(INDENT6 "origin {\n"
- INDENT7 "relative: %g %g;\n"
- INDENT7 "offset: %d %d;\n"
- INDENT6 "}\n",
- dx, dy, x, y);
- }
-
- if (has_size)
- {
- if (machine)
- printf("SIZE-RELATIVE-X: %g\n"
- "SIZE-RELATIVE-Y: %g\n"
- "SIZE-OFFSET-X: %d\n"
- "SIZE-OFFSET-Y: %d\n",
- dx2, dy2, x2, y2);
- else
- printf(INDENT6 "size {\n"
- INDENT7 "relative: %g %g;\n"
- INDENT7 "offset: %d %d;\n"
- INDENT6 "}\n",
- dx2, dy2, x2, y2);
- }
-
- if (machine) puts("PROXY-FILL-END");
- else puts(INDENT5 "}");
- }
+ {
+ int x2, y2;
+ double dx2, dy2;
+ Eina_Bool has_orgin, has_size;
+
+ if (machine) puts("PROXY-BEGIN");
+ else puts(INDENT4 "proxy {");
+ // TODO Support source
+ // TODO support proxy.fill.smooth
+
+ dx = edje_edit_state_fill_origin_relative_x_get
+ (ed, ppart, state, value);
+ dy = edje_edit_state_fill_origin_relative_y_get
+ (ed, ppart, state, value);
+ x = edje_edit_state_fill_origin_offset_x_get
+ (ed, ppart, state, value);
+ y = edje_edit_state_fill_origin_offset_y_get
+ (ed, ppart, state, value);
+
+ dx2 = edje_edit_state_fill_size_relative_x_get
+ (ed, ppart, state, value);
+ dy2 = edje_edit_state_fill_size_relative_y_get
+ (ed, ppart, state, value);
+ x2 = edje_edit_state_fill_size_offset_x_get
+ (ed, ppart, state, value);
+ y2 = edje_edit_state_fill_size_offset_y_get
+ (ed, ppart, state, value);
+
+ has_orgin = (FDIFF(dx, 0.0) || FDIFF(dy, 0.0) || (x) || (y));
+ has_size = (FDIFF(dx2, 1.0) || FDIFF(dy2, 1.0) || (x2) || (y2));
+
+ if ((has_orgin) || (has_size))
+ {
+ if (machine) puts("PROXY-FILL-BEGIN");
+ else puts(INDENT5 "fill {");
+
+ if (has_orgin)
+ {
+ if (machine)
+ printf("ORIGIN-RELATIVE-X: %g\n"
+ "ORIGIN-RELATIVE-Y: %g\n"
+ "ORIGIN-OFFSET-X: %d\n"
+ "ORIGIN-OFFSET-Y: %d\n",
+ dx, dy, x, y);
+ else
+ printf(INDENT6 "origin {\n"
+ INDENT7 "relative: %g %g;\n"
+ INDENT7 "offset: %d %d;\n"
+ INDENT6 "}\n",
+ dx, dy, x, y);
+ }
+
+ if (has_size)
+ {
+ if (machine)
+ printf("SIZE-RELATIVE-X: %g\n"
+ "SIZE-RELATIVE-Y: %g\n"
+ "SIZE-OFFSET-X: %d\n"
+ "SIZE-OFFSET-Y: %d\n",
+ dx2, dy2, x2, y2);
+ else
+ printf(INDENT6 "size {\n"
+ INDENT7 "relative: %g %g;\n"
+ INDENT7 "offset: %d %d;\n"
+ INDENT6 "}\n",
+ dx2, dy2, x2, y2);
+ }
+
+ if (machine) puts("PROXY-FILL-END");
+ else puts(INDENT5 "}");
+ }
if (machine) puts("PROXY-END");
- else puts(INDENT4 "}");
+ else puts(INDENT4 "}");
}
else if ((t == EDJE_PART_TYPE_TEXTBLOCK) || (t == EDJE_PART_TYPE_TEXT))
{
@@ -602,17 +633,20 @@ state_details(Evas_Object *ed, const char *ppart, const char *state, double valu
str = edje_edit_state_text_get(ed, ppart, state, value);
if (machine) printf("TEXT: %s\n", str ? str : "");
- else if (str) printf(INDENT5 "text: \"%s\";\n", str);
+ else if (str)
+ printf(INDENT5 "text: \"%s\";\n", str);
edje_edit_string_free(str);
str = edje_edit_state_font_get(ed, ppart, state, value);
if (machine) printf("FONT: %s\n", str ? str : "");
- else if (str) printf(INDENT5 "font: \"%s\";\n", str);
+ else if (str)
+ printf(INDENT5 "font: \"%s\";\n", str);
edje_edit_string_free(str);
x = edje_edit_state_text_size_get(ed, ppart, state, value);
if (machine) printf("SIZE: %d\n", x);
- else if (x > 0) printf(INDENT5 "size: %d;\n", x);
+ else if (x > 0)
+ printf(INDENT5 "size: %d;\n", x);
// TODO text_class
@@ -625,11 +659,13 @@ state_details(Evas_Object *ed, const char *ppart, const char *state, double valu
x = edje_edit_state_text_fit_x_get(ed, ppart, state, value);
y = edje_edit_state_text_fit_y_get(ed, ppart, state, value);
if (machine) printf("TEXT-FIT-X: %d\nTEXT-FIT-Y: %d\n", x, y);
- else if ((x) || (y)) printf(INDENT5 "fit: %d %d;\n", x, y);
+ else if ((x) || (y))
+ printf(INDENT5 "fit: %d %d;\n", x, y);
dx = edje_edit_state_text_elipsis_get(ed, ppart, state, value);
if (machine) printf("TEXT-ELLIPSIS: %g\n", dx);
- else if (FDIFF(dx, 0.5)) printf(INDENT5 "ellipsis: %g;\n", dx);
+ else if (FDIFF(dx, 0.5))
+ printf(INDENT5 "ellipsis: %g;\n", dx);
if (machine) puts("TEXT-END");
else puts(INDENT4 "}");
@@ -640,7 +676,7 @@ state_details(Evas_Object *ed, const char *ppart, const char *state, double valu
const Edje_External_Param *p;
params = edje_edit_state_external_params_list_get
- (ed, ppart, state, value);
+ (ed, ppart, state, value);
if (params)
{
@@ -651,26 +687,31 @@ state_details(Evas_Object *ed, const char *ppart, const char *state, double valu
switch (p->type)
{
case EDJE_EXTERNAL_PARAM_TYPE_INT:
- printf(INDENT5 "int: \"%s\" \"%d\";\n", p->name, p->i);
- break;
+ printf(INDENT5 "int: \"%s\" \"%d\";\n", p->name, p->i);
+ break;
+
case EDJE_EXTERNAL_PARAM_TYPE_DOUBLE:
- printf(INDENT5 "double: \"%s\" \"%g\";\n", p->name, p->d);
- break;
+ printf(INDENT5 "double: \"%s\" \"%g\";\n", p->name, p->d);
+ break;
+
case EDJE_EXTERNAL_PARAM_TYPE_STRING:
- if (p->s)
- printf(INDENT5 "string: \"%s\" \"%s\";\n",
- p->name, p->s);
- break;
+ if (p->s)
+ printf(INDENT5 "string: \"%s\" \"%s\";\n",
+ p->name, p->s);
+ break;
+
case EDJE_EXTERNAL_PARAM_TYPE_BOOL:
- printf(INDENT5 "bool: \"%s\" \"%d\";\n", p->name, p->i);
- break;
+ printf(INDENT5 "bool: \"%s\" \"%d\";\n", p->name, p->i);
+ break;
+
case EDJE_EXTERNAL_PARAM_TYPE_CHOICE:
- if (p->s)
- printf(INDENT5 "choice: \"%s\" \"%s\";\n",
- p->name, p->s);
- break;
+ if (p->s)
+ printf(INDENT5 "choice: \"%s\" \"%s\";\n",
+ p->name, p->s);
+ break;
+
default:
- break;
+ break;
}
if (machine) puts("PARAMS-END");
@@ -683,7 +724,8 @@ static void
state_end(void)
{
if (machine) puts("PART-STATE-END");
- else if (detail > 0) puts(INDENT3 "}");
+ else if (detail > 0)
+ puts(INDENT3 "}");
else puts(" }");
}
@@ -705,34 +747,45 @@ text_effect_name_get(Edje_Text_Effect effect)
switch (effect)
{
case EDJE_TEXT_EFFECT_NONE:
- return "NONE";
+ return "NONE";
+
case EDJE_TEXT_EFFECT_PLAIN:
- return "PLAIN";
+ return "PLAIN";
+
case EDJE_TEXT_EFFECT_OUTLINE:
- return "OUTLINE";
+ return "OUTLINE";
+
case EDJE_TEXT_EFFECT_SOFT_OUTLINE:
- return "SOFT_OUTLINE";
+ return "SOFT_OUTLINE";
+
case EDJE_TEXT_EFFECT_SHADOW:
- return "SHADOW";
+ return "SHADOW";
+
case EDJE_TEXT_EFFECT_SOFT_SHADOW:
- return "SOFT_SHADOW";
+ return "SOFT_SHADOW";
+
case EDJE_TEXT_EFFECT_OUTLINE_SHADOW:
- return "OUTLINE_SHADOW";
+ return "OUTLINE_SHADOW";
+
case EDJE_TEXT_EFFECT_OUTLINE_SOFT_SHADOW:
- return "OUTLINE_SOFT_SHADOW";
+ return "OUTLINE_SOFT_SHADOW";
+
case EDJE_TEXT_EFFECT_FAR_SHADOW:
- return "FAR_SHADOW";
+ return "FAR_SHADOW";
+
case EDJE_TEXT_EFFECT_FAR_SOFT_SHADOW:
- return "FAR_SOFT_SHADOW";
+ return "FAR_SOFT_SHADOW";
+
case EDJE_TEXT_EFFECT_GLOW:
- return "GLOW";
+ return "GLOW";
case EDJE_TEXT_EFFECT_LAST:
- ERR("Invalid part type %d", effect);
- return "???";
+ ERR("Invalid part type %d", effect);
+ return "???";
+
default:
- ERR("Unknown effect type %d", effect);
- return "???";
+ ERR("Unknown effect type %d", effect);
+ return "???";
}
}
@@ -786,7 +839,7 @@ part_details(Evas_Object *ed, const char *ppart)
if (machine) puts("PART-DETAILS-BEGIN");
- str = api =_part_api_name_get(ed, ppart);
+ str = api = _part_api_name_get(ed, ppart);
str2 = edje_edit_part_api_description_get(ed, ppart);
if (machine)
{
@@ -800,27 +853,32 @@ part_details(Evas_Object *ed, const char *ppart)
b = edje_edit_part_mouse_events_get(ed, ppart);
if (machine) printf("MOUSE_EVENTS: %d\n", b);
- else if (!b) puts(INDENT3 "mouse_events: 0;");
+ else if (!b)
+ puts(INDENT3 "mouse_events: 0;");
if (detail > 1)
{
b = edje_edit_part_repeat_events_get(ed, ppart);
if (machine) printf("REPEAT_EVENTS: %d\n", b);
- else if (b) puts(INDENT3 "repeat_events: 1;");
+ else if (b)
+ puts(INDENT3 "repeat_events: 1;");
b = edje_edit_part_scale_get(ed, ppart);
if (machine) printf("SCALE: %d\n", b);
- else if (b) puts(INDENT3 "scale: 1;");
+ else if (b)
+ puts(INDENT3 "scale: 1;");
}
str = edje_edit_part_clip_to_get(ed, ppart);
if (machine) printf("CLIP_TO: %s\n", str ? str : "");
- else if (str) printf(INDENT3 "clip_to: \"%s\";\n", str);
+ else if (str)
+ printf(INDENT3 "clip_to: \"%s\";\n", str);
edje_edit_string_free(str);
str = edje_edit_part_source_get(ed, ppart);
if (machine) printf("SOURCE: %s\n", str ? str : "");
- else if (str) printf(INDENT3 "source: \"%s\";\n", str);
+ else if (str)
+ printf(INDENT3 "source: \"%s\";\n", str);
edje_edit_string_free(str);
if (detail > 1)
@@ -829,7 +887,8 @@ part_details(Evas_Object *ed, const char *ppart)
{
str = text_effect_name_get(edje_edit_part_effect_get(ed, ppart));
if (machine) printf("EFFECT: %s\n", str ? str : "");
- else if (str) printf(INDENT3 "effect: %s;\n", str);
+ else if (str)
+ printf(INDENT3 "effect: %s;\n", str);
/* do not free this str! */
}
@@ -855,12 +914,14 @@ part_details(Evas_Object *ed, const char *ppart)
str = edje_edit_part_drag_confine_get(ed, ppart);
if (machine) printf("DRAG-CONFINE: %s\n", str ? str : "");
- else if (str) printf(INDENT4 "confine: \"%s\";\n", str);
+ else if (str)
+ printf(INDENT4 "confine: \"%s\";\n", str);
edje_edit_string_free(str);
str = edje_edit_part_drag_event_get(ed, ppart);
if (machine) printf("DRAG-EVENTS: %s\n", str ? str : "");
- else if (str) printf(INDENT4 "events: \"%s\";\n", str);
+ else if (str)
+ printf(INDENT4 "events: \"%s\";\n", str);
edje_edit_string_free(str);
if (machine) puts("DRAGABLE-END");
@@ -875,7 +936,7 @@ part_details(Evas_Object *ed, const char *ppart)
double value;
eina_strlcpy(state, str, sizeof(state)); /* bad states_list! :-( */
delim = strchr(state, ' ');
- if (!delim) continue ;
+ if (!delim) continue;
*delim = '\0';
delim++;
value = strtod(delim, NULL);
@@ -892,7 +953,8 @@ static void
part_end(void)
{
if (machine) puts("PART-END");
- else if (detail > 0) puts(INDENT2 "}");
+ else if (detail > 0)
+ puts(INDENT2 "}");
else puts(" }");
}
@@ -1046,7 +1108,6 @@ program_end(void)
else puts(INDENT2 "}");
}
-
static char *
_program_api_name_get(Evas_Object *ed, const char *pprogram)
{
@@ -1062,13 +1123,18 @@ _transition_name_get(Edje_Tween_Mode mode)
switch (mode)
{
case EDJE_TWEEN_MODE_LINEAR: return "LINEAR";
+
case EDJE_TWEEN_MODE_ACCELERATE: return "ACCELERATE";
+
case EDJE_TWEEN_MODE_DECELERATE: return "DECELERATE";
+
case EDJE_TWEEN_MODE_SINUSOIDAL: return "SINUSOIDAL";
+
case EDJE_TWEEN_MODE_CUBIC_BEZIER: return "CUBIC_BEZIER";
+
default:
- ERR("Unknown transition mode %d", mode);
- return "???";
+ ERR("Unknown transition mode %d", mode);
+ return "???";
}
}
@@ -1082,7 +1148,7 @@ program_details(Evas_Object *ed, const char *pprogram)
if (machine) puts("PROGRAM-DETAILS-BEGIN");
- str = api =_program_api_name_get(ed, pprogram);
+ str = api = _program_api_name_get(ed, pprogram);
str2 = edje_edit_program_api_description_get(ed, pprogram);
if (machine)
{
@@ -1096,12 +1162,14 @@ program_details(Evas_Object *ed, const char *pprogram)
str = edje_edit_program_signal_get(ed, pprogram);
if (machine) printf("SIGNAL: %s\n", str ? str : "");
- else if (str) printf(INDENT3 "signal: \"%s\";\n", str);
+ else if (str)
+ printf(INDENT3 "signal: \"%s\";\n", str);
edje_edit_string_free(str);
str = edje_edit_program_source_get(ed, pprogram);
if (machine) printf("SOURCE: %s\n", str ? str : "");
- else if (str) printf(INDENT3 "source: \"%s\";\n", str);
+ else if (str)
+ printf(INDENT3 "source: \"%s\";\n", str);
edje_edit_string_free(str);
if (detail >= 1)
@@ -1111,45 +1179,48 @@ program_details(Evas_Object *ed, const char *pprogram)
switch (type)
{
case EDJE_ACTION_TYPE_ACTION_STOP:
- if (machine) puts("ACTION: ACTION_STOP");
- else puts(INDENT3 "action: ACTION_STOP;");
- break;
+ if (machine) puts("ACTION: ACTION_STOP");
+ else puts(INDENT3 "action: ACTION_STOP;");
+ break;
+
case EDJE_ACTION_TYPE_STATE_SET:
- str = edje_edit_program_state_get(ed, pprogram);
- if (machine)
- printf("ACTION: STATE_SET\nACTION-STATE: %s %g\n",
- str, edje_edit_program_value_get(ed, pprogram));
- else
- printf(INDENT3 "action: STATE_SET \"%s\" %2.1f;\n",
- str, edje_edit_program_value_get(ed, pprogram));
- edje_edit_string_free(str);
- break;
+ str = edje_edit_program_state_get(ed, pprogram);
+ if (machine)
+ printf("ACTION: STATE_SET\nACTION-STATE: %s %g\n",
+ str, edje_edit_program_value_get(ed, pprogram));
+ else
+ printf(INDENT3 "action: STATE_SET \"%s\" %2.1f;\n",
+ str, edje_edit_program_value_get(ed, pprogram));
+ edje_edit_string_free(str);
+ break;
+
case EDJE_ACTION_TYPE_SIGNAL_EMIT:
- str = edje_edit_program_state_get(ed, pprogram);
- str2 = edje_edit_program_state2_get(ed, pprogram);
- if (machine)
- printf("ACTION: SIGNAL_EMIT\nACTION-SIGNAL: %s\n"
- "ACTION-SOURCE: %s\n",
- str ? str : "", str2 ? str2 : "");
- else if ((str) || (str2))
- printf(INDENT3 "action: SIGNAL_EMIT \"%s\" \"%s\";\n",
- str ? str : "", str2 ? str2 : "");
- edje_edit_string_free(str);
- edje_edit_string_free(str2);
- break;
- //TODO Support Drag
- //~ case EDJE_ACTION_TYPE_DRAG_VAL_SET:
- //~ eina_strbuf_append(buf, I4"action: DRAG_VAL_SET TODO;\n");
- //~ break;
- //~ case EDJE_ACTION_TYPE_DRAG_VAL_STEP:
- //~ eina_strbuf_append(buf, I4"action: DRAG_VAL_STEP TODO;\n");
- //~ break;
- //~ case EDJE_ACTION_TYPE_DRAG_VAL_PAGE:
- //~ eina_strbuf_append(buf, I4"action: DRAG_VAL_PAGE TODO;\n");
- //~ break;
+ str = edje_edit_program_state_get(ed, pprogram);
+ str2 = edje_edit_program_state2_get(ed, pprogram);
+ if (machine)
+ printf("ACTION: SIGNAL_EMIT\nACTION-SIGNAL: %s\n"
+ "ACTION-SOURCE: %s\n",
+ str ? str : "", str2 ? str2 : "");
+ else if ((str) || (str2))
+ printf(INDENT3 "action: SIGNAL_EMIT \"%s\" \"%s\";\n",
+ str ? str : "", str2 ? str2 : "");
+ edje_edit_string_free(str);
+ edje_edit_string_free(str2);
+ break;
+
+ //TODO Support Drag
+ //~ case EDJE_ACTION_TYPE_DRAG_VAL_SET:
+ //~ eina_strbuf_append(buf, I4"action: DRAG_VAL_SET TODO;\n");
+ //~ break;
+ //~ case EDJE_ACTION_TYPE_DRAG_VAL_STEP:
+ //~ eina_strbuf_append(buf, I4"action: DRAG_VAL_STEP TODO;\n");
+ //~ break;
+ //~ case EDJE_ACTION_TYPE_DRAG_VAL_PAGE:
+ //~ eina_strbuf_append(buf, I4"action: DRAG_VAL_PAGE TODO;\n");
+ //~ break;
default:
- ERR("Unhandled pprogram action type %d", type);
- break;
+ ERR("Unhandled pprogram action type %d", type);
+ break;
}
if (detail > 1)
@@ -1160,7 +1231,7 @@ program_details(Evas_Object *ed, const char *pprogram)
if (from > 0.0)
{
str = _transition_name_get
- (edje_edit_program_transition_get(ed, pprogram));
+ (edje_edit_program_transition_get(ed, pprogram));
if (machine)
printf("TRANSITION-NAME: %s\nTRANSITION-DURATION: %g\n",
str, from);
@@ -1372,26 +1443,32 @@ _comp_str_get(Evas_Object *ed, const char *img)
switch (type)
{
case EDJE_EDIT_IMAGE_COMP_RAW:
- return "RAW";
+ return "RAW";
+
case EDJE_EDIT_IMAGE_COMP_USER:
- return "USER";
+ return "USER";
+
case EDJE_EDIT_IMAGE_COMP_COMP:
- return "COMP";
+ return "COMP";
+
case EDJE_EDIT_IMAGE_COMP_LOSSY:
- rate = edje_edit_image_compression_rate_get(ed, img);
- snprintf(buf, sizeof(buf), "LOSSY %d", rate);
- return buf;
+ rate = edje_edit_image_compression_rate_get(ed, img);
+ snprintf(buf, sizeof(buf), "LOSSY %d", rate);
+ return buf;
+
case EDJE_EDIT_IMAGE_COMP_LOSSY_ETC1:
rate = edje_edit_image_compression_rate_get(ed, img);
snprintf(buf, sizeof(buf), "LOSSY_ETC1 %d", rate);
return buf;
+
case EDJE_EDIT_IMAGE_COMP_LOSSY_ETC2:
rate = edje_edit_image_compression_rate_get(ed, img);
snprintf(buf, sizeof(buf), "LOSSY_ETC2 %d", rate);
return buf;
+
default:
- ERR("Unknown compression type %d", type);
- return "???";
+ ERR("Unknown compression type %d", type);
+ return "???";
}
}
@@ -1521,7 +1598,6 @@ _externals_list(void)
return EINA_TRUE;
}
-
int
main(int argc, char **argv)
{
@@ -1531,19 +1607,19 @@ main(int argc, char **argv)
int arg_index;
int ret = 0;
Ecore_Getopt_Value values[] = {
- ECORE_GETOPT_VALUE_STR(mode),
- ECORE_GETOPT_VALUE_STR(detail_name),
- ECORE_GETOPT_VALUE_STR(group),
- ECORE_GETOPT_VALUE_STR(part),
- ECORE_GETOPT_VALUE_STR(program),
- ECORE_GETOPT_VALUE_BOOL(api_only),
- ECORE_GETOPT_VALUE_BOOL(api_fix),
- ECORE_GETOPT_VALUE_BOOL(machine),
- ECORE_GETOPT_VALUE_BOOL(quit_option),
- ECORE_GETOPT_VALUE_BOOL(quit_option),
- ECORE_GETOPT_VALUE_BOOL(quit_option),
- ECORE_GETOPT_VALUE_BOOL(quit_option),
- ECORE_GETOPT_VALUE_NONE
+ ECORE_GETOPT_VALUE_STR(mode),
+ ECORE_GETOPT_VALUE_STR(detail_name),
+ ECORE_GETOPT_VALUE_STR(group),
+ ECORE_GETOPT_VALUE_STR(part),
+ ECORE_GETOPT_VALUE_STR(program),
+ ECORE_GETOPT_VALUE_BOOL(api_only),
+ ECORE_GETOPT_VALUE_BOOL(api_fix),
+ ECORE_GETOPT_VALUE_BOOL(machine),
+ ECORE_GETOPT_VALUE_BOOL(quit_option),
+ ECORE_GETOPT_VALUE_BOOL(quit_option),
+ ECORE_GETOPT_VALUE_BOOL(quit_option),
+ ECORE_GETOPT_VALUE_BOOL(quit_option),
+ ECORE_GETOPT_VALUE_NONE
};
setlocale(LC_NUMERIC, "C");
@@ -1570,7 +1646,8 @@ main(int argc, char **argv)
ret = 1;
goto error_getopt;
}
- else if (quit_option) goto error_getopt;
+ else if (quit_option)
+ goto error_getopt;
else if (arg_index != argc - 1)
{
ERR("incorrect number of parameters. Requires one single file.");
@@ -1583,8 +1660,10 @@ main(int argc, char **argv)
if (detail_name)
{
if (!strcmp(detail_name, "none")) detail = 0;
- else if (!strcmp(detail_name, "terse")) detail = 1;
- else if (!strcmp(detail_name, "all")) detail = 2;
+ else if (!strcmp(detail_name, "terse"))
+ detail = 1;
+ else if (!strcmp(detail_name, "all"))
+ detail = 2;
else ERR("Unknown detail level: '%s'", detail_name);
}
@@ -1608,7 +1687,6 @@ main(int argc, char **argv)
program ? program : "",
api_only, api_fix, machine, file);
-
groups = edje_file_collection_list(file);
if (!groups)
{
@@ -1629,19 +1707,23 @@ main(int argc, char **argv)
else
{
if (!strcmp(mode, "parts-names")) ret = _parts_names_list();
- else if (!strcmp(mode, "global-data")) ret = _gdata_list();
- else if (!strcmp(mode, "images")) ret = _images_list();
- else if (!strcmp(mode, "fonts")) ret = _fonts_list();
- else if (!strcmp(mode, "externals")) ret = _externals_list();
+ else if (!strcmp(mode, "global-data"))
+ ret = _gdata_list();
+ else if (!strcmp(mode, "images"))
+ ret = _images_list();
+ else if (!strcmp(mode, "fonts"))
+ ret = _fonts_list();
+ else if (!strcmp(mode, "externals"))
+ ret = _externals_list();
else ret = _list(mode);
ecore_evas_free(ee);
}
}
edje_file_collection_list_free(groups);
- error_getopt:
+error_getopt:
eina_log_domain_unregister(_log_dom);
- error_log:
+error_log:
edje_shutdown();
ecore_evas_shutdown();
ecore_shutdown();
@@ -1649,3 +1731,4 @@ main(int argc, char **argv)
return ret;
}
+
diff --git a/src/bin/edje/edje_multisense_convert.c b/src/bin/edje/edje_multisense_convert.c
index 49e58f7181..50576efab2 100644
--- a/src/bin/edje/edje_multisense_convert.c
+++ b/src/bin/edje/edje_multisense_convert.c
@@ -15,22 +15,22 @@ Edje_Sound_Encode *
_edje_multisense_encode(const char *filename, Edje_Sound_Sample *sample, double quality EINA_UNUSED)
{
SF_INFO sfinfo;
- SNDFILE* sfile;
+ SNDFILE *sfile;
Edje_Sound_Encode *enc_info;
-
+
enc_info = calloc(1, sizeof(Edje_Sound_Encode));
if (!enc_info)
{
ERR("while allocating memory to load file ");
exit(-1);
}
- memset (&sfinfo, 0, sizeof (SF_INFO));
-
+ memset(&sfinfo, 0, sizeof (SF_INFO));
+
enc_info->encoded = EINA_FALSE;
enc_info->comp_type = "RAW PCM";
-
+
// Open wav file using sndfile
- sfile = sf_open (filename, SFM_READ, &sfinfo);
+ sfile = sf_open(filename, SFM_READ, &sfinfo);
if (!sfile)
{
ERR("Unable to open audio file: %s", filename);
@@ -82,7 +82,7 @@ _edje_multisense_encode(const char *filename, Edje_Sound_Sample *sample, double
}
#ifdef HAVE_LIBFLAC
-const char*
+const char *
_edje_multisense_encode_to_flac(char *snd_path, SF_INFO sfinfo)
{
unsigned int total_samples = 0; /* can use a 32-bit number due to WAVE size limitations */
@@ -164,14 +164,14 @@ _edje_multisense_encode_to_flac(char *snd_path, SF_INFO sfinfo)
ok = 0;
}
}
-
+
/* read blocks of samples from WAVE file and feed to encoder */
while (ok)
{
FLAC__int32 readbuffer[READBUF * 2];
sf_count_t count;
int i;
-
+
count = sf_readf_int(sfile, readbuffer, READBUF);
if (count <= 0) break;
for (i = 0; i < (count * sfinfo.channels); i++)
@@ -187,8 +187,9 @@ _edje_multisense_encode_to_flac(char *snd_path, SF_INFO sfinfo)
FLAC__stream_encoder_delete(encoder);
sf_close(sfile);
- return (snd_path);
+ return snd_path;
}
+
#endif
#ifdef HAVE_VORBIS
@@ -233,7 +234,7 @@ _edje_multisense_encode_to_ogg_vorbis(char *snd_path, double quality, SF_INFO sf
/********** Encode setup ************/
vorbis_info_init(&vi);
- ret = vorbis_encode_init(&vi, sfinfo.channels, sfinfo.samplerate,
+ ret = vorbis_encode_init(&vi, sfinfo.channels, sfinfo.samplerate,
-1, (long)(quality * 1000), -1);
if (ret == OV_EFAULT) printf("OV_EFAULT\n");
if (ret == OV_EINVAL) printf("OV_EINVAL\n");
@@ -280,7 +281,7 @@ _edje_multisense_encode_to_ogg_vorbis(char *snd_path, double quality, SF_INFO sf
int i, ch;
float readbuffer[READBUF * 2];
sf_count_t count;
-
+
count = sf_readf_float(sfile, readbuffer, READBUF);
if (!count)
@@ -288,12 +289,12 @@ _edje_multisense_encode_to_ogg_vorbis(char *snd_path, double quality, SF_INFO sf
else
{
float **buffer = vorbis_analysis_buffer(&vd, count);
-
+
/* uninterleave samples */
for (i = 0; i < count; i++)
{
for (ch = 0; ch < sfinfo.channels; ch++)
- buffer[ch][i]= readbuffer[(i * sfinfo.channels) + ch];
+ buffer[ch][i] = readbuffer[(i * sfinfo.channels) + ch];
}
vorbis_analysis_wrote(&vd, i);
}
@@ -322,8 +323,9 @@ _edje_multisense_encode_to_ogg_vorbis(char *snd_path, double quality, SF_INFO sf
vorbis_comment_clear(&vc);
vorbis_info_clear(&vi);
sf_close(sfile);
- fclose (fout);
+ fclose(fout);
return snd_path;
}
+
#endif
#endif
diff --git a/src/bin/edje/edje_pick.c b/src/bin/edje/edje_pick.c
index bc92297675..2079d92cee 100644
--- a/src/bin/edje/edje_pick.c
+++ b/src/bin/edje/edje_pick.c
@@ -19,7 +19,7 @@
#include "edje_private.h"
#define EDJE_PICK_HELP_STRING \
-"\nEdje Pick - the \"edj\" merging tool.\n\
+ "\nEdje Pick - the \"edj\" merging tool.\n\
===================================\n\n\
Use Edje Pick to compose a single edj file \
by selecting groups from edj files.\n\n\
@@ -46,8 +46,8 @@ Replacing the button and check with widgets taken from default theme.\n\
struct _Edje_Pick_Id
{
- int old_id;
- int new_id;
+ int old_id;
+ int new_id;
Eina_Bool used;
};
typedef struct _Edje_Pick_Id Edje_Pick_Id;
@@ -55,30 +55,30 @@ typedef struct _Edje_Pick_Id Edje_Pick_Id;
struct _Edje_Pick_File_Params
{
const char *name;
- Eina_List *groups;
- Edje_File *edf; /* Keeps all file data after reading */
- Eina_Bool append; /* Take everything from this file */
+ Eina_List *groups;
+ Edje_File *edf; /* Keeps all file data after reading */
+ Eina_Bool append; /* Take everything from this file */
/* We hold list of IDs for each file */
- Eina_List *scriptlist;
- Eina_List *luascriptlist;
- Eina_List *imagelist;
- Eina_List *imagesetlist; /* List of IDs (Edje_Pick_Data) for image sets */
- Eina_List *vectorlist;
- Eina_List *samplelist;
- Eina_List *tonelist;
- Eina_List *vibrationlist;
- Eina_List *fontlist;
+ Eina_List *scriptlist;
+ Eina_List *luascriptlist;
+ Eina_List *imagelist;
+ Eina_List *imagesetlist; /* List of IDs (Edje_Pick_Data) for image sets */
+ Eina_List *vectorlist;
+ Eina_List *samplelist;
+ Eina_List *tonelist;
+ Eina_List *vibrationlist;
+ Eina_List *fontlist;
};
typedef struct _Edje_Pick_File_Params Edje_Pick_File_Params;
struct _Edje_Pick_Data
{
- const char *filename; /* Image, Sample File Name */
- void *entry ; /* used to build output file dir FIXME: REMOVE THIS */
- void *data; /* Data as taken from input file */
+ const char *filename; /* Image, Sample File Name */
+ void *entry; /* used to build output file dir FIXME: REMOVE THIS */
+ void *data; /* Data as taken from input file */
- int size;
+ int size;
Edje_Pick_Id id;
};
typedef struct _Edje_Pick_Data Edje_Pick_Data;
@@ -86,7 +86,7 @@ typedef struct _Edje_Pick_Data Edje_Pick_Data;
struct _Edje_Pick_Tone
{
Edje_Sound_Tone *tone;
- Eina_Bool used;
+ Eina_Bool used;
};
typedef struct _Edje_Pick_Tone Edje_Pick_Tone;
@@ -94,15 +94,15 @@ struct _Edje_Pick_Font
{
Edje_Font *f;
- void *data; /* Font data as take from source edj file */
- int size; /* data size */
- Eina_Bool used;
+ void *data; /* Font data as take from source edj file */
+ int size; /* data size */
+ Eina_Bool used;
};
typedef struct _Edje_Pick_Font Edje_Pick_Font;
struct _Edje_Pick
{
- Eina_Bool v; /* Verbose */
+ Eina_Bool v; /* Verbose */
Edje_Pick_File_Params *current_file;
};
typedef struct _Edje_Pick Edje_Pick;
@@ -112,46 +112,46 @@ static Edje_Pick context = { EINA_FALSE, NULL };
#define VERBOSE(COMMAND) if (context.v) { COMMAND; }
enum _Edje_Pick_Status
- {
- EDJE_PICK_NO_ERROR,
- EDJE_PICK_OUT_FILENAME_MISSING,
- EDJE_PICK_FAILED_OPEN_INP,
- EDJE_PICK_FAILED_READ_INP,
- EDJE_PICK_GROUP_NOT_FOUND,
- EDJE_PICK_IMAGE_NOT_FOUND,
- EDJE_PICK_SAMPLE_NOT_FOUND,
- EDJE_PICK_INCLUDE_MISSING,
- EDJE_PICK_GROUP_MISSING,
- EDJE_PICK_PARSE_FAILED,
- EDJE_PICK_HELP_SHOWN,
- EDJE_PICK_DUP_GROUP
- };
+{
+ EDJE_PICK_NO_ERROR,
+ EDJE_PICK_OUT_FILENAME_MISSING,
+ EDJE_PICK_FAILED_OPEN_INP,
+ EDJE_PICK_FAILED_READ_INP,
+ EDJE_PICK_GROUP_NOT_FOUND,
+ EDJE_PICK_IMAGE_NOT_FOUND,
+ EDJE_PICK_SAMPLE_NOT_FOUND,
+ EDJE_PICK_INCLUDE_MISSING,
+ EDJE_PICK_GROUP_MISSING,
+ EDJE_PICK_PARSE_FAILED,
+ EDJE_PICK_HELP_SHOWN,
+ EDJE_PICK_DUP_GROUP
+};
typedef enum _Edje_Pick_Status Edje_Pick_Status;
static void
_edje_pick_args_show(Eina_List *ifs, char *out)
{ /* Print command-line arguments after parsing phase */
- Edje_Pick_File_Params *p;
- Eina_List *l;
- char *g;
-
- EINA_LOG_INFO("Got args for <%d> input files.\n", eina_list_count(ifs));
-
- EINA_LIST_FOREACH(ifs, l, p)
- {
- Eina_List *ll;
-
- if (p->append)
- printf("\nFile name: %s\n\tGroups: ALL (append mode)\n", p->name);
- else
- {
- printf("\nFile name: %s\n\tGroups:\n", p->name);
- EINA_LIST_FOREACH(p->groups, ll, g)
- printf("\t\t%s\n", g);
- }
- }
-
- EINA_LOG_INFO("\nOutput file name was <%s>\n", out);
+ Edje_Pick_File_Params *p;
+ Eina_List *l;
+ char *g;
+
+ EINA_LOG_INFO("Got args for <%d> input files.\n", eina_list_count(ifs));
+
+ EINA_LIST_FOREACH(ifs, l, p)
+ {
+ Eina_List *ll;
+
+ if (p->append)
+ printf("\nFile name: %s\n\tGroups: ALL (append mode)\n", p->name);
+ else
+ {
+ printf("\nFile name: %s\n\tGroups:\n", p->name);
+ EINA_LIST_FOREACH(p->groups, ll, g)
+ printf("\t\t%s\n", g);
+ }
+ }
+
+ EINA_LOG_INFO("\nOutput file name was <%s>\n", out);
}
static void
@@ -273,28 +273,35 @@ _edje_pick_cleanup(Eina_List *ifs, Edje_File *out_file, Edje_Pick_Status s)
switch (s)
{
case EDJE_PICK_OUT_FILENAME_MISSING:
- EINA_LOG_ERR("Output file name missing.\n");
- break;
+ EINA_LOG_ERR("Output file name missing.\n");
+ break;
+
case EDJE_PICK_FAILED_OPEN_INP:
- EINA_LOG_ERR("Failed to open input file.\n");
- break;
+ EINA_LOG_ERR("Failed to open input file.\n");
+ break;
+
case EDJE_PICK_FAILED_READ_INP:
- EINA_LOG_ERR("Failed to read input file.\n");
- break;
+ EINA_LOG_ERR("Failed to read input file.\n");
+ break;
+
case EDJE_PICK_DUP_GROUP:
- EINA_LOG_ERR("Can't fetch groups with identical name from various files.\n");
- break;
+ EINA_LOG_ERR("Can't fetch groups with identical name from various files.\n");
+ break;
+
case EDJE_PICK_INCLUDE_MISSING:
- EINA_LOG_ERR("Cannot select groups when no input file included.\n");
- break;
+ EINA_LOG_ERR("Cannot select groups when no input file included.\n");
+ break;
+
case EDJE_PICK_GROUP_MISSING:
- EINA_LOG_ERR("Group name missing for include file.\n");
- break;
+ EINA_LOG_ERR("Group name missing for include file.\n");
+ break;
+
case EDJE_PICK_PARSE_FAILED:
- EINA_LOG_ERR("Command parsing failed.\n");
- break;
+ EINA_LOG_ERR("Command parsing failed.\n");
+ break;
+
default:
- return s;
+ return s;
}
_edje_edd_shutdown();
@@ -314,7 +321,7 @@ _group_name_in_other_file(Eina_List *inp_files, void *d1, void *d2)
EINA_LIST_FOREACH(inp_files, f, current_file)
if (inp_file != current_file)
if (eina_list_search_unsorted(current_file->groups,
- (Eina_Compare_Cb) strcmp,
+ (Eina_Compare_Cb)strcmp,
group))
return 1;
@@ -323,173 +330,171 @@ _group_name_in_other_file(Eina_List *inp_files, void *d1, void *d2)
static int
_edje_pick_command_line_parse(int argc, char **argv,
- Eina_List **ifs, char **ofn)
+ Eina_List **ifs, char **ofn)
{ /* On return ifs is Input Files List, ofn is Output File Name */
- Eina_List *gpf = NULL; /* List including counters of groups-per-file */
- Eina_List *a_files = NULL;
- Eina_List *i_files = NULL;
- Eina_List *l;
- Eina_List *ll;
- Eina_List *cg;
- Eina_List *groups = NULL;
- char *output_filename = NULL;
- Edje_Pick_File_Params *current_inp = NULL;
- Eina_List *files = NULL; /* List of input files */
- int *c = NULL;
- char *str = NULL;
- int k;
- Eina_Bool show_help = EINA_FALSE;
-
- /* Define args syntax */
-#define IS_GROUP(x) ((!strcmp(x, "-g")) || (!strcmp(x, "--group")))
+ Eina_List *gpf = NULL; /* List including counters of groups-per-file */
+ Eina_List *a_files = NULL;
+ Eina_List *i_files = NULL;
+ Eina_List *l;
+ Eina_List *ll;
+ Eina_List *cg;
+ Eina_List *groups = NULL;
+ char *output_filename = NULL;
+ Edje_Pick_File_Params *current_inp = NULL;
+ Eina_List *files = NULL; /* List of input files */
+ int *c = NULL;
+ char *str = NULL;
+ int k;
+ Eina_Bool show_help = EINA_FALSE;
+
+ /* Define args syntax */
+#define IS_GROUP(x) ((!strcmp(x, "-g")) || (!strcmp(x, "--group")))
#define IS_INCLUDE(x) ((!strcmp(x, "-i")) || (!strcmp(x, "--include")))
-#define IS_HELP(x) ((!strcmp(x, "-h")) || (!strcmp(x, "--help")))
- static const Ecore_Getopt optdesc = {
- "edje_pick",
- NULL,
- "0.0",
- "(C) 2012 Enlightenment",
- "Public domain?",
- "Edje Pick - the \"edj\" merging tool.",
-
- EINA_TRUE,
- {
- ECORE_GETOPT_STORE_TRUE('v', "verbose", "Verbose"),
- ECORE_GETOPT_STORE('o', "output", "Output File",
- ECORE_GETOPT_TYPE_STR),
- ECORE_GETOPT_APPEND_METAVAR('a', "append", "Append File",
- "STRING", ECORE_GETOPT_TYPE_STR),
- ECORE_GETOPT_APPEND_METAVAR('i', "include", "Include File",
- "STRING", ECORE_GETOPT_TYPE_STR),
- ECORE_GETOPT_APPEND_METAVAR('g', "group", "Add Group",
- "STRING", ECORE_GETOPT_TYPE_STR),
- ECORE_GETOPT_HELP('h', "help"),
- ECORE_GETOPT_SENTINEL
- }
- };
-
- Ecore_Getopt_Value values[] = {
- ECORE_GETOPT_VALUE_BOOL(context.v),
- ECORE_GETOPT_VALUE_STR(output_filename),
- ECORE_GETOPT_VALUE_LIST(a_files),
- ECORE_GETOPT_VALUE_LIST(i_files),
- ECORE_GETOPT_VALUE_LIST(groups),
- ECORE_GETOPT_VALUE_NONE
- };
-
- /* START - Read command line args */
- c = NULL;
- for(k = 1; k < argc; k++)
- { /* Run through args, count how many groups per file */
- if(IS_GROUP(argv[k]))
- {
- if (!c)
- return _edje_pick_cleanup(files, NULL,
- EDJE_PICK_INCLUDE_MISSING);
-
- (*c)++;
- continue;
- }
-
- if(IS_INCLUDE(argv[k]))
- {
- c = calloc(1, sizeof(int));
- gpf = eina_list_append(gpf, c);
- continue;
- }
-
- show_help |= IS_HELP(argv[k]);
- }
-
- if (show_help)
- puts(EDJE_PICK_HELP_STRING);
-
- if (ecore_getopt_parse(&optdesc, values, argc, argv) < 0)
- {
- EINA_LIST_FREE(gpf, c)
- free(c);
-
- return _edje_pick_cleanup(files, NULL, EDJE_PICK_PARSE_FAILED);
- }
-
- if (show_help)
+#define IS_HELP(x) ((!strcmp(x, "-h")) || (!strcmp(x, "--help")))
+ static const Ecore_Getopt optdesc = {
+ "edje_pick",
+ NULL,
+ "0.0",
+ "(C) 2012 Enlightenment",
+ "Public domain?",
+ "Edje Pick - the \"edj\" merging tool.",
+
+ EINA_TRUE,
{
- EINA_LIST_FREE(gpf, c)
- free(c);
-
- ecore_getopt_list_free(i_files);
- ecore_getopt_list_free(groups);
- return _edje_pick_cleanup(files, NULL, EDJE_PICK_HELP_SHOWN);
+ ECORE_GETOPT_STORE_TRUE('v', "verbose", "Verbose"),
+ ECORE_GETOPT_STORE('o', "output", "Output File",
+ ECORE_GETOPT_TYPE_STR),
+ ECORE_GETOPT_APPEND_METAVAR('a', "append", "Append File",
+ "STRING", ECORE_GETOPT_TYPE_STR),
+ ECORE_GETOPT_APPEND_METAVAR('i', "include", "Include File",
+ "STRING", ECORE_GETOPT_TYPE_STR),
+ ECORE_GETOPT_APPEND_METAVAR('g', "group", "Add Group",
+ "STRING", ECORE_GETOPT_TYPE_STR),
+ ECORE_GETOPT_HELP('h', "help"),
+ ECORE_GETOPT_SENTINEL
}
+ };
- if (context.v) /* Changed to INFO if verbose */
- eina_log_level_set(EINA_LOG_LEVEL_INFO);
-
- EINA_LIST_FOREACH(a_files, l, str)
- {
- current_inp = calloc(1, sizeof(*current_inp));
- current_inp->append = EINA_TRUE;
- current_inp->name = eina_stringshare_add(str);
- files = eina_list_append(files, current_inp);
- }
- ecore_getopt_list_free(a_files);
-
- ll = gpf;
- cg = groups;
- EINA_LIST_FOREACH(i_files, l, str)
- { /* Now match groups from groups-list with included files */
- current_inp = calloc(1, sizeof(*current_inp));
- current_inp->name = eina_stringshare_add(str);
- files = eina_list_append(files, current_inp);
- c = eina_list_data_get(ll);
- if (c)
- {
- while(*c)
- {
- char *g_name;
- if (!cg)
- {
- EINA_LIST_FREE(gpf, c)
- free(c);
-
- ecore_getopt_list_free(i_files);
- ecore_getopt_list_free(groups);
- return _edje_pick_cleanup(files, NULL,
- EDJE_PICK_GROUP_MISSING);
- }
-
+ Ecore_Getopt_Value values[] = {
+ ECORE_GETOPT_VALUE_BOOL(context.v),
+ ECORE_GETOPT_VALUE_STR(output_filename),
+ ECORE_GETOPT_VALUE_LIST(a_files),
+ ECORE_GETOPT_VALUE_LIST(i_files),
+ ECORE_GETOPT_VALUE_LIST(groups),
+ ECORE_GETOPT_VALUE_NONE
+ };
- g_name = eina_list_data_get(cg);
- if (_group_name_in_other_file(files, current_inp, g_name))
- return _edje_pick_cleanup(files, NULL, EDJE_PICK_DUP_GROUP);
+ /* START - Read command line args */
+ c = NULL;
+ for (k = 1; k < argc; k++)
+ { /* Run through args, count how many groups per file */
+ if (IS_GROUP(argv[k]))
+ {
+ if (!c)
+ return _edje_pick_cleanup(files, NULL,
+ EDJE_PICK_INCLUDE_MISSING);
- if (!eina_list_search_unsorted(current_inp->groups,
- (Eina_Compare_Cb) strcmp, g_name))
- current_inp->groups = eina_list_append(
- current_inp->groups, eina_stringshare_add(g_name));
+ (*c)++;
+ continue;
+ }
- cg = eina_list_next(cg);
- (*c)--;
- }
- }
- ll = eina_list_next(ll);
- }
+ if (IS_INCLUDE(argv[k]))
+ {
+ c = calloc(1, sizeof(int));
+ gpf = eina_list_append(gpf, c);
+ continue;
+ }
- EINA_LIST_FREE(gpf, c)
- free(c);
+ show_help |= IS_HELP(argv[k]);
+ }
+
+ if (show_help)
+ puts(EDJE_PICK_HELP_STRING);
+
+ if (ecore_getopt_parse(&optdesc, values, argc, argv) < 0)
+ {
+ EINA_LIST_FREE(gpf, c)
+ free(c);
+
+ return _edje_pick_cleanup(files, NULL, EDJE_PICK_PARSE_FAILED);
+ }
+
+ if (show_help)
+ {
+ EINA_LIST_FREE(gpf, c)
+ free(c);
+
+ ecore_getopt_list_free(i_files);
+ ecore_getopt_list_free(groups);
+ return _edje_pick_cleanup(files, NULL, EDJE_PICK_HELP_SHOWN);
+ }
+
+ if (context.v) /* Changed to INFO if verbose */
+ eina_log_level_set(EINA_LOG_LEVEL_INFO);
+
+ EINA_LIST_FOREACH(a_files, l, str)
+ {
+ current_inp = calloc(1, sizeof(*current_inp));
+ current_inp->append = EINA_TRUE;
+ current_inp->name = eina_stringshare_add(str);
+ files = eina_list_append(files, current_inp);
+ }
+ ecore_getopt_list_free(a_files);
+
+ ll = gpf;
+ cg = groups;
+ EINA_LIST_FOREACH(i_files, l, str)
+ { /* Now match groups from groups-list with included files */
+ current_inp = calloc(1, sizeof(*current_inp));
+ current_inp->name = eina_stringshare_add(str);
+ files = eina_list_append(files, current_inp);
+ c = eina_list_data_get(ll);
+ if (c)
+ {
+ while (*c)
+ {
+ char *g_name;
+ if (!cg)
+ {
+ EINA_LIST_FREE(gpf, c)
+ free(c);
+
+ ecore_getopt_list_free(i_files);
+ ecore_getopt_list_free(groups);
+ return _edje_pick_cleanup(files, NULL,
+ EDJE_PICK_GROUP_MISSING);
+ }
+
+ g_name = eina_list_data_get(cg);
+ if (_group_name_in_other_file(files, current_inp, g_name))
+ return _edje_pick_cleanup(files, NULL, EDJE_PICK_DUP_GROUP);
+
+ if (!eina_list_search_unsorted(current_inp->groups,
+ (Eina_Compare_Cb)strcmp, g_name))
+ current_inp->groups = eina_list_append(
+ current_inp->groups, eina_stringshare_add(g_name));
+
+ cg = eina_list_next(cg);
+ (*c)--;
+ }
+ }
+ ll = eina_list_next(ll);
+ }
- ecore_getopt_list_free(i_files);
- ecore_getopt_list_free(groups);
+ EINA_LIST_FREE(gpf, c)
+ free(c);
+ ecore_getopt_list_free(i_files);
+ ecore_getopt_list_free(groups);
- if (!output_filename)
- return _edje_pick_cleanup(files, NULL, EDJE_PICK_OUT_FILENAME_MISSING);
- /* END - Read command line args */
+ if (!output_filename)
+ return _edje_pick_cleanup(files, NULL, EDJE_PICK_OUT_FILENAME_MISSING);
+ /* END - Read command line args */
- /* Set output params, return OK */
- *ifs = files;
- *ofn = output_filename;
- return EDJE_PICK_NO_ERROR;
+ /* Set output params, return OK */
+ *ifs = files;
+ *ofn = output_filename;
+ return EDJE_PICK_NO_ERROR;
}
static void
@@ -630,31 +635,31 @@ _edje_pick_header_dependencies_check(Edje_File *out_file, Edje_File *edf, Eina_L
EINA_LOG_ERR("Failed to read group <%s> id <%d>\n", ce->entry, ce->id);
goto exit;
}
-#define GROUP_CHECK_AND_ADD(NAME) \
- if (NAME) \
- { \
- Edje_Part_Collection_Directory_Entry *ce_cor; \
- if (eina_list_search_unsorted(groups, (void *)strcmp, NAME)) goto exit; \
- ce_cor = eina_hash_find(edf->collection, NAME); \
- if (!eina_hash_find(out_file->collection, ce_cor->entry)) \
- { \
- dep_list_inner = _edje_pick_header_dependencies_check(out_file, edf, groups, ce_cor, current_id); \
- dep_list = eina_list_merge(dep_list, dep_list_inner); \
- } \
- if ((ce_cor) && (!eina_hash_find(out_file->collection, NAME))) \
- { \
- Edje_Part_Collection_Directory_Entry *ce_out; \
- ce_out = malloc(sizeof(*ce_out)); \
- memcpy(ce_out, ce_cor, sizeof(*ce_out)); \
- ce_out->id = *current_id; \
- if (ce_out->group_alias) \
- _edje_pick_header_alias_parent_add(out_file, edf, ce, ce_out); \
- EINA_LOG_INFO("Changing ID of group <%d> to <%d>\n", ce->id, ce_out->id); \
- eina_hash_direct_add(out_file->collection, ce_out->entry, ce_out); \
- (*current_id)++; \
- dep_list = eina_list_append(dep_list, eina_stringshare_add(ce_out->entry)); \
- } \
- }
+#define GROUP_CHECK_AND_ADD(NAME) \
+ if (NAME) \
+ { \
+ Edje_Part_Collection_Directory_Entry *ce_cor; \
+ if (eina_list_search_unsorted(groups, (void *)strcmp, NAME)) goto exit; \
+ ce_cor = eina_hash_find(edf->collection, NAME); \
+ if (!eina_hash_find(out_file->collection, ce_cor->entry)) \
+ { \
+ dep_list_inner = _edje_pick_header_dependencies_check(out_file, edf, groups, ce_cor, current_id); \
+ dep_list = eina_list_merge(dep_list, dep_list_inner); \
+ } \
+ if ((ce_cor) && (!eina_hash_find(out_file->collection, NAME))) \
+ { \
+ Edje_Part_Collection_Directory_Entry *ce_out; \
+ ce_out = malloc(sizeof(*ce_out)); \
+ memcpy(ce_out, ce_cor, sizeof(*ce_out)); \
+ ce_out->id = *current_id; \
+ if (ce_out->group_alias) \
+ _edje_pick_header_alias_parent_add(out_file, edf, ce, ce_out); \
+ EINA_LOG_INFO("Changing ID of group <%d> to <%d>\n", ce->id, ce_out->id); \
+ eina_hash_direct_add(out_file->collection, ce_out->entry, ce_out); \
+ (*current_id)++; \
+ dep_list = eina_list_append(dep_list, eina_stringshare_add(ce_out->entry)); \
+ } \
+ }
for (i = 0; i < edc->parts_count; i++)
{
@@ -679,7 +684,7 @@ exit:
}
static int
-_edje_pick_data_update(Edje_File *out_file , Edje_File *edf)
+_edje_pick_data_update(Edje_File *out_file, Edje_File *edf)
{
Eina_Bool status = EDJE_PICK_NO_ERROR;
Eina_Iterator *i;
@@ -697,7 +702,7 @@ _edje_pick_data_update(Edje_File *out_file , Edje_File *edf)
}
static int
-_edje_pick_header_make(Edje_File *out_file , Edje_File *edf, Eina_List *ifs)
+_edje_pick_header_make(Edje_File *out_file, Edje_File *edf, Eina_List *ifs)
{
static int current_group_id = 0;
Edje_Part_Collection_Directory_Entry *ce;
@@ -721,7 +726,7 @@ _edje_pick_header_make(Edje_File *out_file , Edje_File *edf, Eina_List *ifs)
/* We SKIP group of file in append-mode if we got this group */
/* from file in include mode. */
if (_group_name_in_other_file(ifs, context.current_file, name1))
- continue; /* Skip group of file in append mode */
+ continue; /* Skip group of file in append mode */
ce = eina_hash_find(edf->collection, name1);
ce_out = malloc(sizeof(*ce_out));
@@ -736,7 +741,7 @@ _edje_pick_header_make(Edje_File *out_file , Edje_File *edf, Eina_List *ifs)
/* Add this group to groups to handle for this file */
context.current_file->groups = eina_list_append(
- context.current_file->groups, eina_stringshare_add(name1));
+ context.current_file->groups, eina_stringshare_add(name1));
}
eina_iterator_free(i);
@@ -761,7 +766,7 @@ _edje_pick_header_make(Edje_File *out_file , Edje_File *edf, Eina_List *ifs)
}
else
{
- EINA_LIST_FOREACH(context.current_file->groups, l , name1)
+ EINA_LIST_FOREACH(context.current_file->groups, l, name1)
{
/* Verify group found then add to ouput file header */
ce = eina_hash_find(edf->collection, name1);
@@ -786,7 +791,7 @@ _edje_pick_header_make(Edje_File *out_file , Edje_File *edf, Eina_List *ifs)
EINA_LOG_INFO("Changing ID of group <%d> to <%d>\n", ce->id, ce_out->id);
current_group_id++;
- eina_hash_direct_add(out_file->collection,ce_out->entry,
+ eina_hash_direct_add(out_file->collection, ce_out->entry,
ce_out);
dep_list = _edje_pick_header_dependencies_check(out_file, edf, context.current_file->groups, ce, &current_group_id);
if (!deps) deps = dep_list;
@@ -794,7 +799,7 @@ _edje_pick_header_make(Edje_File *out_file , Edje_File *edf, Eina_List *ifs)
}
}
EINA_LIST_FREE(deps, name1)
- context.current_file->groups = eina_list_append(context.current_file->groups, name1);
+ context.current_file->groups = eina_list_append(context.current_file->groups, name1);
}
return status;
@@ -804,14 +809,14 @@ static int
_old_id_cmp(const void *d1, const void *d2)
{
/* Find currect ID struct */
- return (((Edje_Pick_Data *) d1)->id.old_id - ((intptr_t) d2));
+ return ((Edje_Pick_Data *)d1)->id.old_id - ((intptr_t)d2);
}
static int
_new_id_cmp(const void *d1, const void *d2)
{
/* Find currect ID struct */
- return (((Edje_Pick_Data *) d1)->id.new_id - ((intptr_t) d2));
+ return ((Edje_Pick_Data *)d1)->id.new_id - ((intptr_t)d2);
}
static int
@@ -821,8 +826,7 @@ _edje_pick_new_id_get(Eina_List *id_list, int id, Eina_Bool set_used)
{
Edje_Pick_Data *p_id = eina_list_search_unsorted(id_list,
_old_id_cmp,
- (void *) (intptr_t) id);
-
+ (void *)(intptr_t)id);
if (p_id)
{
@@ -843,7 +847,7 @@ _edje_pick_image_new_id_get(Eina_List *id_list, int id)
{
Edje_Pick_Data *p_id = eina_list_search_unsorted(id_list,
_old_id_cmp,
- (void *) (intptr_t) id);
+ (void *)(intptr_t)id);
if (p_id) return p_id->id.new_id;
}
@@ -857,7 +861,7 @@ _edje_pick_image_old_id_get(Eina_List *id_list, int id)
{
Edje_Pick_Data *p_id = eina_list_search_unsorted(id_list,
_new_id_cmp,
- (void *) (intptr_t) id);
+ (void *)(intptr_t)id);
if (p_id) return p_id->id.old_id;
}
@@ -874,8 +878,8 @@ _edje_pick_images_copy(Edje_File *edf, Edje_File *o)
if (edf->image_dir)
{
- if (edf->image_dir->entries)
- { /* Copy image dir entries of current file */
+ if (edf->image_dir->entries) /* Copy image dir entries of current file */
+ {
Edje_Image_Directory_Entry *entries = NULL;
EINA_LIST_FOREACH(context.current_file->imagelist, l, image)
@@ -896,7 +900,7 @@ _edje_pick_images_copy(Edje_File *edf, Edje_File *o)
o->image_dir->entries = entries;
old_id = _edje_pick_image_old_id_get(
- context.current_file->imagelist, o->image_dir->entries_count - 1);
+ context.current_file->imagelist, o->image_dir->entries_count - 1);
/* Concatenate current file entries to re-allocated array */
memcpy(&o->image_dir->entries[o->image_dir->entries_count - 1],
&edf->image_dir->entries[old_id],
@@ -906,8 +910,8 @@ _edje_pick_images_copy(Edje_File *edf, Edje_File *o)
}
}
- if (edf->image_dir->sets)
- { /* Copy image dir sets of current file */
+ if (edf->image_dir->sets) /* Copy image dir sets of current file */
+ {
Edje_Image_Directory_Set *sets;
EINA_LIST_FOREACH(context.current_file->imagesetlist, l, set)
@@ -929,7 +933,7 @@ _edje_pick_images_copy(Edje_File *edf, Edje_File *o)
o->image_dir->sets = sets;
old_id = _edje_pick_image_old_id_get(
- context.current_file->imagesetlist, o->image_dir->sets_count - 1);
+ context.current_file->imagesetlist, o->image_dir->sets_count - 1);
/* Concatenate current file sets to re-allocated array */
memcpy(&o->image_dir->sets[o->image_dir->sets_count - 1],
&edf->image_dir->sets[old_id],
@@ -938,14 +942,14 @@ _edje_pick_images_copy(Edje_File *edf, Edje_File *o)
EINA_LIST_FOREACH(o->image_dir->sets[o->image_dir->sets_count - 1].entries, l1, e)
e->id = _edje_pick_image_new_id_get(
- context.current_file->imagelist,
- e->id);
+ context.current_file->imagelist,
+ e->id);
}
}
}
- if (edf->image_dir->vectors)
- { /* Copy vector dir entries of current file */
+ if (edf->image_dir->vectors) /* Copy vector dir entries of current file */
+ {
Edje_Vector_Directory_Entry *vectors = NULL;
EINA_LIST_FOREACH(context.current_file->vectorlist, l, vector)
@@ -966,7 +970,7 @@ _edje_pick_images_copy(Edje_File *edf, Edje_File *o)
o->image_dir->vectors = vectors;
old_id = _edje_pick_image_old_id_get(
- context.current_file->vectorlist, o->image_dir->vectors_count - 1);
+ context.current_file->vectorlist, o->image_dir->vectors_count - 1);
/* Concatenate current file vectors to re-allocated array */
memcpy(&o->image_dir->vectors[o->image_dir->vectors_count - 1],
&edf->image_dir->vectors[old_id],
@@ -991,7 +995,7 @@ _edje_pick_sounds_add(Edje_File *edf)
if (edf->sound_dir) /* Copy Sounds */
{
- for (k = 0; k < (int) edf->sound_dir->samples_count; k++)
+ for (k = 0; k < (int)edf->sound_dir->samples_count; k++)
{
Edje_Sound_Sample *sample = &edf->sound_dir->samples[k];
@@ -1005,13 +1009,13 @@ _edje_pick_sounds_add(Edje_File *edf)
smpl->filename = eina_stringshare_add(sample->snd_src);
smpl->data = data;
smpl->size = size;
- smpl->entry = (void *) sample; /* for output file sound dir */
+ smpl->entry = (void *)sample; /* for output file sound dir */
smpl->id.old_id = sample->id;
sample->id = smpl->id.new_id = current_sample_id;
smpl->id.used = EINA_FALSE;
VERBOSE(EINA_LOG_INFO("Read <%s> sample data <%p> size <%d>\n",
- buf, smpl->data, smpl->size));
+ buf, smpl->data, smpl->size));
current_sample_id++;
context.current_file->samplelist =
@@ -1020,14 +1024,14 @@ _edje_pick_sounds_add(Edje_File *edf)
else
{
EINA_LOG_ERR("Sample <%s> was not found in <%s> file.\n",
- sample->name, context.current_file->name);
+ sample->name, context.current_file->name);
status = EDJE_PICK_SAMPLE_NOT_FOUND;
/* Should that really be freed? Or is some other handling needed? */
free(data);
}
}
- for (k = 0; k < (int) edf->sound_dir->tones_count; k++)
+ for (k = 0; k < (int)edf->sound_dir->tones_count; k++)
{
/* Save all tones as well */
Edje_Pick_Tone *t = malloc(sizeof(*t));
@@ -1056,7 +1060,7 @@ _edje_pick_vibrations_add(Edje_File *edf)
if (edf->vibration_dir) /* Copy Sounds */
{
- for (k = 0; k < (int) edf->vibration_dir->samples_count; k++)
+ for (k = 0; k < (int)edf->vibration_dir->samples_count; k++)
{
Edje_Vibration_Sample *sample = &edf->vibration_dir->samples[k];
@@ -1070,13 +1074,13 @@ _edje_pick_vibrations_add(Edje_File *edf)
smpl->filename = eina_stringshare_add(sample->name);
smpl->data = data;
smpl->size = size;
- smpl->entry = (void *) sample; /* for output file vibration dir */
+ smpl->entry = (void *)sample; /* for output file vibration dir */
smpl->id.old_id = sample->id;
sample->id = smpl->id.new_id = current_sample_id;
smpl->id.used = EINA_FALSE;
VERBOSE(EINA_LOG_INFO("Read <%s> sample data <%p> size <%d>\n",
- buf, smpl->data, smpl->size));
+ buf, smpl->data, smpl->size));
current_sample_id++;
context.current_file->vibrationlist =
@@ -1085,7 +1089,7 @@ _edje_pick_vibrations_add(Edje_File *edf)
else
{
EINA_LOG_ERR("Sample <%s> was not found in <%s> file.\n",
- sample->name, context.current_file->name);
+ sample->name, context.current_file->name);
status = EDJE_PICK_SAMPLE_NOT_FOUND;
/* Should that really be freed? Or is some other handling needed? */
free(data);
@@ -1103,8 +1107,8 @@ _font_cmp(const void *d1, const void *d2)
const Edje_Font *f2 = d2;
/* Same font if (d1->name == d2->name) AND (d1->file == d2->file) */
- return (strcmp(f1->name, f2->name) |
- strcmp(f1->file, f2->file));
+ return strcmp(f1->name, f2->name) |
+ strcmp(f1->file, f2->file);
}
static int
@@ -1124,12 +1128,12 @@ _Edje_Pick_Fonts_add(Edje_File *out_file, Edje_File *edf)
if (!eina_list_search_unsorted(context.current_file->fontlist, _font_cmp, f))
continue;
/* Add only fonts that are NOT regestered in our list */
- Edje_Pick_Font *ft = malloc(sizeof(*ft));
+ Edje_Pick_Font *ft = malloc(sizeof(*ft));
Edje_Font *st = malloc(sizeof(*st));
ft->size = 0;
- st->name = (char *) eina_stringshare_add(f->name);
- st->file = (char *) eina_stringshare_add(f->file);
+ st->name = (char *)eina_stringshare_add(f->name);
+ st->file = (char *)eina_stringshare_add(f->file);
snprintf(buf, sizeof(buf), "edje/fonts/%s", f->name);
VERBOSE(EINA_LOG_INFO("Trying to read <%s>\n", f->name));
@@ -1148,7 +1152,7 @@ _Edje_Pick_Fonts_add(Edje_File *out_file, Edje_File *edf)
ft->used = EINA_TRUE; /* TODO: Fix this later */
context.current_file->fontlist = eina_list_append(context.current_file->fontlist, ft);
eina_hash_direct_add(out_file->fonts, st->name, st);
- };
+ }
eina_iterator_free(it);
@@ -1176,7 +1180,7 @@ _edje_pick_scripts_add(Edje_File *edf, int id, int new_id)
s->id.used = EINA_TRUE;
VERBOSE(EINA_LOG_INFO("Read embryo script <%s> data <%p> size <%d>\n",
- buf, s->data, s->size));
+ buf, s->data, s->size));
context.current_file->scriptlist = eina_list_append(context.current_file->scriptlist, s);
}
else
@@ -1209,7 +1213,7 @@ _edje_pick_lua_scripts_add(Edje_File *edf, int id, int new_id)
s->id.used = EINA_TRUE;
VERBOSE(EINA_LOG_INFO("Read lua script <%s> data <%p> size <%d>\n",
- buf, s->data, s->size));
+ buf, s->data, s->size));
context.current_file->luascriptlist = eina_list_append(context.current_file->luascriptlist, s);
}
else
@@ -1234,25 +1238,25 @@ _edje_pick_image_entry_add(int id, Edje_File *edf, Edje_File *o)
if (edf->image_dir)
{
- if (!o->image_dir) /* First time only */
+ if (!o->image_dir) /* First time only */
o->image_dir = calloc(1, sizeof(*(o->image_dir)));
- if (edf->image_dir->entries)
- { /* Copy Images */
+ if (edf->image_dir->entries) /* Copy Images */
+ {
Edje_Image_Directory_Entry *img = &edf->image_dir->entries[id];
snprintf(buf, sizeof(buf), "edje/images/%i", img->id);
VERBOSE(EINA_LOG_INFO("Trying to read <%s>\n", img->entry));
data = eet_read(edf->ef, buf, &size);
- if (size)
- { /* Advance image ID and register this in imagelist */
+ if (size) /* Advance image ID and register this in imagelist */
+ {
current_img_id++;
Edje_Pick_Data *image = malloc(sizeof(*image));
image->filename = eina_stringshare_add(img->entry);
image->data = data;
image->size = size;
- image->entry = (void *) img; /* for output file image dir */
+ image->entry = (void *)img; /* for output file image dir */
image->id.old_id = img->id;
img->id = image->id.new_id = current_img_id;
image->id.used = EINA_TRUE;
@@ -1261,18 +1265,18 @@ _edje_pick_image_entry_add(int id, Edje_File *edf, Edje_File *o)
buf, image->data, image->size, image->id.new_id));
context.current_file->imagelist = eina_list_append(
- context.current_file->imagelist, image);
+ context.current_file->imagelist, image);
}
else
{
if (img->entry)
{
EINA_LOG_ERR("Image <%s> was not found in <%s> file.\n",
- img->entry , context.current_file->name);
+ img->entry, context.current_file->name);
}
else
{
- EINA_LOG_ERR("Image entry <%s> was not found in <%s> file.\n", buf , context.current_file->name);
+ EINA_LOG_ERR("Image entry <%s> was not found in <%s> file.\n", buf, context.current_file->name);
}
/* Should that really be freed? Or is some other handling needed? */
free(data);
@@ -1295,11 +1299,11 @@ _edje_pick_image_set_add(int id, Edje_File *edf, Edje_File *o)
if (edf->image_dir)
{
- if (!o->image_dir) /* First time only */
+ if (!o->image_dir) /* First time only */
o->image_dir = calloc(1, sizeof(*(o->image_dir)));
- if (edf->image_dir->sets)
- { /* Fix IDs in sets to new assigned IDs of entries */
+ if (edf->image_dir->sets) /* Fix IDs in sets to new assigned IDs of entries */
+ {
current_set_id++;
Edje_Pick_Data *set = calloc(1, sizeof(*set));
set->id.old_id = edf->image_dir->sets[id].id;
@@ -1308,7 +1312,7 @@ _edje_pick_image_set_add(int id, Edje_File *edf, Edje_File *o)
/* Save IDs in set-list, used in Desc update later */
context.current_file->imagesetlist = eina_list_append(
- context.current_file->imagesetlist, set);
+ context.current_file->imagesetlist, set);
EINA_LIST_FOREACH(edf->image_dir->sets[id].entries, l, ent)
{
_edje_pick_image_entry_add(ent->id, edf, o);
@@ -1332,25 +1336,25 @@ _edje_pick_vector_entry_add(int id, Edje_File *edf, Edje_File *o)
if (edf->image_dir)
{
- if (!o->image_dir) /* First time only */
+ if (!o->image_dir) /* First time only */
o->image_dir = calloc(1, sizeof(*(o->image_dir)));
- if (edf->image_dir->vectors)
- { /* Copy Vectors */
+ if (edf->image_dir->vectors) /* Copy Vectors */
+ {
Edje_Vector_Directory_Entry *vg = &edf->image_dir->vectors[id];
snprintf(buf, sizeof(buf), "edje/vectors/%i", vg->id);
VERBOSE(EINA_LOG_INFO("Trying to read <%s>\n", vg->entry));
data = eet_read(edf->ef, buf, &size);
- if (size)
- { /* Advance vector ID and register this in vectorlist */
+ if (size) /* Advance vector ID and register this in vectorlist */
+ {
current_vg_id++;
Edje_Pick_Data *vector = malloc(sizeof(*vector));
vector->filename = eina_stringshare_add(vg->entry);
vector->data = data;
vector->size = size;
- vector->entry = (void *) vg; /* for output file vector dir */
+ vector->entry = (void *)vg; /* for output file vector dir */
vector->id.old_id = vg->id;
vg->id = vector->id.new_id = current_vg_id;
vector->id.used = EINA_TRUE;
@@ -1359,18 +1363,18 @@ _edje_pick_vector_entry_add(int id, Edje_File *edf, Edje_File *o)
buf, vector->data, vector->size, vector->id.new_id));
context.current_file->vectorlist = eina_list_append(
- context.current_file->vectorlist, vector);
+ context.current_file->vectorlist, vector);
}
else
{
if (vg->entry)
{
EINA_LOG_ERR("Vector <%s> was not found in <%s> file.\n",
- vg->entry , context.current_file->name);
+ vg->entry, context.current_file->name);
}
else
{
- EINA_LOG_ERR("Vector entry <%s> was not found in <%s> file.\n", buf , context.current_file->name);
+ EINA_LOG_ERR("Vector entry <%s> was not found in <%s> file.\n", buf, context.current_file->name);
}
/* Should that really be freed? Or is some other handling needed? */
free(data);
@@ -1470,34 +1474,34 @@ _edje_pick_resources_process(Edje_Part_Collection *edc, Edje_File *edf, Edje_Fil
Edje_Part *part = edc->parts[i];
/* Update all color class in ALL descs of this part */
- _edje_pick_color_class_desc_update((Edje_Part_Description_Common *) part->default_desc, edf, o);
+ _edje_pick_color_class_desc_update((Edje_Part_Description_Common *)part->default_desc, edf, o);
for (k = 0; k < part->other.desc_count; k++)
- _edje_pick_color_class_desc_update((Edje_Part_Description_Common *) part->other.desc[k], edf, o);
+ _edje_pick_color_class_desc_update((Edje_Part_Description_Common *)part->other.desc[k], edf, o);
if (part->type == EDJE_PART_TYPE_IMAGE)
{
/* Update IDs of all images in ALL descs of this part */
- _edje_pick_images_desc_update((Edje_Part_Description_Image *) part->default_desc, edf, o);
+ _edje_pick_images_desc_update((Edje_Part_Description_Image *)part->default_desc, edf, o);
for (k = 0; k < part->other.desc_count; k++)
- _edje_pick_images_desc_update((Edje_Part_Description_Image *) part->other.desc[k], edf, o);
+ _edje_pick_images_desc_update((Edje_Part_Description_Image *)part->other.desc[k], edf, o);
}
else if (part->type == EDJE_PART_TYPE_VECTOR)
{
/* Update IDs of all vectors in ALL descs of this part */
- _edje_pick_vectors_desc_update((Edje_Part_Description_Vector *) part->default_desc, edf, o);
+ _edje_pick_vectors_desc_update((Edje_Part_Description_Vector *)part->default_desc, edf, o);
for (k = 0; k < part->other.desc_count; k++)
- _edje_pick_vectors_desc_update((Edje_Part_Description_Vector *) part->other.desc[k], edf, o);
+ _edje_pick_vectors_desc_update((Edje_Part_Description_Vector *)part->other.desc[k], edf, o);
}
else if (part->type == EDJE_PART_TYPE_TEXT || part->type == EDJE_PART_TYPE_TEXTBLOCK)
{
/* Update all styles in ALL descs of this part */
- _edje_pick_styles_desc_update((Edje_Part_Description_Text *) part->default_desc, edf, o);
+ _edje_pick_styles_desc_update((Edje_Part_Description_Text *)part->default_desc, edf, o);
for (k = 0; k < part->other.desc_count; k++)
- _edje_pick_styles_desc_update((Edje_Part_Description_Text *) part->other.desc[k], edf, o);
+ _edje_pick_styles_desc_update((Edje_Part_Description_Text *)part->other.desc[k], edf, o);
}
}
}
@@ -1508,7 +1512,7 @@ _sample_cmp(const void *d1, const void *d2)
/* Locate sample by name */
if (d2)
{
- Edje_Sound_Sample *sample = ((Edje_Pick_Data *) d1)->entry;
+ Edje_Sound_Sample *sample = ((Edje_Pick_Data *)d1)->entry;
return strcmp(sample->name, d2);
}
@@ -1522,7 +1526,7 @@ _tone_cmp(const void *d1, const void *d2)
/* Locate tone by name */
if (d2)
{
- Edje_Sound_Tone *tone = ((Edje_Pick_Tone *) d1)->tone;
+ Edje_Sound_Tone *tone = ((Edje_Pick_Tone *)d1)->tone;
return strcmp(tone->name, d2);
}
@@ -1538,7 +1542,7 @@ _edje_pick_program_update(Edje_Program *prog)
/* Scan for used samples, update samples IDs */
p = eina_list_search_unsorted(context.current_file->samplelist,
- (Eina_Compare_Cb) _sample_cmp,
+ (Eina_Compare_Cb)_sample_cmp,
prog->sample_name);
/* Sample is used by program, should be saved */
@@ -1547,7 +1551,7 @@ _edje_pick_program_update(Edje_Program *prog)
/* handle tones as well */
t = eina_list_search_unsorted(context.current_file->tonelist,
- (Eina_Compare_Cb) _tone_cmp,
+ (Eina_Compare_Cb)_tone_cmp,
prog->tone_name);
/* Tone is used by program, should be saved */
@@ -1561,19 +1565,19 @@ _edje_pick_programs_process(Edje_Part_Collection *edc)
/* This wil mark which samples are used and should be saved */
unsigned int i;
- for(i = 0; i < edc->programs.fnmatch_count; i++)
+ for (i = 0; i < edc->programs.fnmatch_count; i++)
_edje_pick_program_update(edc->programs.fnmatch[i]);
- for(i = 0; i < edc->programs.strcmp_count; i++)
+ for (i = 0; i < edc->programs.strcmp_count; i++)
_edje_pick_program_update(edc->programs.strcmp[i]);
- for(i = 0; i < edc->programs.strncmp_count; i++)
+ for (i = 0; i < edc->programs.strncmp_count; i++)
_edje_pick_program_update(edc->programs.strncmp[i]);
- for(i = 0; i < edc->programs.strrncmp_count; i++)
+ for (i = 0; i < edc->programs.strrncmp_count; i++)
_edje_pick_program_update(edc->programs.strrncmp[i]);
- for(i = 0; i < edc->programs.nocmp_count; i++)
+ for (i = 0; i < edc->programs.nocmp_count; i++)
_edje_pick_program_update(edc->programs.nocmp[i]);
return EDJE_PICK_NO_ERROR;
@@ -1597,67 +1601,67 @@ _edje_pick_collection_process(Edje_Part_Collection *edc, Edje_File *edf, Edje_Fi
static void
_edje_pick_sound_dir_compose(Eina_List *samples, Eina_List *tones, Edje_File *o)
{ /* Compose sound_dir array from all used samples, tones */
- if (samples)
- {
- Edje_Sound_Sample *sample;
- Edje_Sound_Sample *p;
- Eina_List *l;
-
- o->sound_dir = calloc(1, sizeof(*(o->sound_dir)));
- o->sound_dir->samples = malloc(eina_list_count(samples) *
- sizeof(Edje_Sound_Sample));
-
- p = o->sound_dir->samples;
- EINA_LIST_FOREACH(samples, l, sample)
- {
- memcpy(p, sample, sizeof(Edje_Sound_Sample));
- p++;
- }
-
- o->sound_dir->samples_count = eina_list_count(samples);
-
- if (tones)
- {
- Edje_Sound_Tone *tone;
- Edje_Sound_Tone *t;
-
- o->sound_dir->tones = malloc(eina_list_count(tones) *
- sizeof(Edje_Sound_Tone));
-
- t = o->sound_dir->tones;
- EINA_LIST_FOREACH(tones, l, tone)
- {
- memcpy(t, tone, sizeof(Edje_Sound_Tone));
- t++;
- }
-
- o->sound_dir->tones_count = eina_list_count(tones);
- }
- }
+ if (samples)
+ {
+ Edje_Sound_Sample *sample;
+ Edje_Sound_Sample *p;
+ Eina_List *l;
+
+ o->sound_dir = calloc(1, sizeof(*(o->sound_dir)));
+ o->sound_dir->samples = malloc(eina_list_count(samples) *
+ sizeof(Edje_Sound_Sample));
+
+ p = o->sound_dir->samples;
+ EINA_LIST_FOREACH(samples, l, sample)
+ {
+ memcpy(p, sample, sizeof(Edje_Sound_Sample));
+ p++;
+ }
+
+ o->sound_dir->samples_count = eina_list_count(samples);
+
+ if (tones)
+ {
+ Edje_Sound_Tone *tone;
+ Edje_Sound_Tone *t;
+
+ o->sound_dir->tones = malloc(eina_list_count(tones) *
+ sizeof(Edje_Sound_Tone));
+
+ t = o->sound_dir->tones;
+ EINA_LIST_FOREACH(tones, l, tone)
+ {
+ memcpy(t, tone, sizeof(Edje_Sound_Tone));
+ t++;
+ }
+
+ o->sound_dir->tones_count = eina_list_count(tones);
+ }
+ }
}
static void
_edje_pick_vibration_dir_compose(Eina_List *vibrations, Edje_File *o)
{ /* Compose vibrationdir array from all used vibrations */
- if (vibrations)
- {
- Edje_Vibration_Sample *sample;
- Edje_Vibration_Sample *p;
- Eina_List *l;
-
- o->vibration_dir = calloc(1, sizeof(*(o->vibration_dir)));
- o->vibration_dir->samples = malloc(eina_list_count(vibrations) *
- sizeof(Edje_Vibration_Sample));
-
- p = o->vibration_dir->samples;
- EINA_LIST_FOREACH(vibrations, l, sample)
- {
- memcpy(p, sample, sizeof(Edje_Vibration_Sample));
- p++;
- }
-
- o->vibration_dir->samples_count = eina_list_count(vibrations);
- }
+ if (vibrations)
+ {
+ Edje_Vibration_Sample *sample;
+ Edje_Vibration_Sample *p;
+ Eina_List *l;
+
+ o->vibration_dir = calloc(1, sizeof(*(o->vibration_dir)));
+ o->vibration_dir->samples = malloc(eina_list_count(vibrations) *
+ sizeof(Edje_Vibration_Sample));
+
+ p = o->vibration_dir->samples;
+ EINA_LIST_FOREACH(vibrations, l, sample)
+ {
+ memcpy(p, sample, sizeof(Edje_Vibration_Sample));
+ p++;
+ }
+
+ o->vibration_dir->samples_count = eina_list_count(vibrations);
+ }
}
int
@@ -1701,12 +1705,12 @@ main(int argc, char **argv)
ef = eet_open(context.current_file->name, EET_FILE_MODE_READ);
if (!ef)
return _edje_pick_cleanup(inp_files, out_file,
- EDJE_PICK_FAILED_OPEN_INP);
+ EDJE_PICK_FAILED_OPEN_INP);
edf = eet_data_read(ef, _edje_edd_edje_file, "edje/file");
if (!edf)
return _edje_pick_cleanup(inp_files, out_file,
- EDJE_PICK_FAILED_READ_INP);
+ EDJE_PICK_FAILED_READ_INP);
context.current_file->edf = edf;
edf->ef = ef;
@@ -1734,52 +1738,52 @@ main(int argc, char **argv)
_edje_pick_data_update(out_file, edf);
/* Process Groups */
- EINA_LIST_FOREACH(context.current_file->groups, l , name1)
+ EINA_LIST_FOREACH(context.current_file->groups, l, name1)
{ /* Read group info */
- ce = eina_hash_find(edf->collection, name1);
- if (!ce || (ce->id < 0))
- {
- EINA_LOG_ERR("Failed to find group <%s> id\n", name1);
- _edje_cache_file_unref(edf);
- return _edje_pick_cleanup(inp_files, out_file,
- EDJE_PICK_GROUP_NOT_FOUND);
- }
-
- VERBOSE(EINA_LOG_INFO("Copy group: <%s>\n", name1));
-
- edje_cache_emp_alloc(ce);
-
- snprintf(buf, sizeof(buf), "edje/collections/%i", ce->id);
- EINA_LOG_INFO("Trying to read group <%s>\n", buf);
- edc = eet_data_read(edf->ef, _edje_edd_edje_part_collection, buf);
- if (!edc)
- {
- EINA_LOG_ERR("Failed to read group <%s> id <%d>\n", name1, ce->id);
- _edje_cache_file_unref(edf);
- return _edje_pick_cleanup(inp_files, out_file,
- EDJE_PICK_GROUP_NOT_FOUND);
- }
-
- /* Update IDs */
- _edje_pick_collection_process(edc, edf, out_file);
-
- /* Build lists of all scripts with new IDs */
- _edje_pick_scripts_add(edf, ce->id, edc->id);
- _edje_pick_lua_scripts_add(edf, ce->id, edc->id);
-
- {
- /* Write the group to output file using new id */
- snprintf(buf, sizeof(buf),
- "edje/collections/%i", edc->id);
- bytes = eet_data_write(out_file->ef,
- _edje_edd_edje_part_collection,
- buf, edc, comp_mode);
- EINA_LOG_INFO("Wrote <%d> bytes for group <%s>\n", bytes,buf);
- }
-
- free(edc);
- edje_cache_emp_free(ce);
- eet_close(ef);
+ ce = eina_hash_find(edf->collection, name1);
+ if (!ce || (ce->id < 0))
+ {
+ EINA_LOG_ERR("Failed to find group <%s> id\n", name1);
+ _edje_cache_file_unref(edf);
+ return _edje_pick_cleanup(inp_files, out_file,
+ EDJE_PICK_GROUP_NOT_FOUND);
+ }
+
+ VERBOSE(EINA_LOG_INFO("Copy group: <%s>\n", name1));
+
+ edje_cache_emp_alloc(ce);
+
+ snprintf(buf, sizeof(buf), "edje/collections/%i", ce->id);
+ EINA_LOG_INFO("Trying to read group <%s>\n", buf);
+ edc = eet_data_read(edf->ef, _edje_edd_edje_part_collection, buf);
+ if (!edc)
+ {
+ EINA_LOG_ERR("Failed to read group <%s> id <%d>\n", name1, ce->id);
+ _edje_cache_file_unref(edf);
+ return _edje_pick_cleanup(inp_files, out_file,
+ EDJE_PICK_GROUP_NOT_FOUND);
+ }
+
+ /* Update IDs */
+ _edje_pick_collection_process(edc, edf, out_file);
+
+ /* Build lists of all scripts with new IDs */
+ _edje_pick_scripts_add(edf, ce->id, edc->id);
+ _edje_pick_lua_scripts_add(edf, ce->id, edc->id);
+
+ {
+ /* Write the group to output file using new id */
+ snprintf(buf, sizeof(buf),
+ "edje/collections/%i", edc->id);
+ bytes = eet_data_write(out_file->ef,
+ _edje_edd_edje_part_collection,
+ buf, edc, comp_mode);
+ EINA_LOG_INFO("Wrote <%d> bytes for group <%s>\n", bytes, buf);
+ }
+
+ free(edc);
+ edje_cache_emp_free(ce);
+ eet_close(ef);
}
_edje_pick_images_copy(edf, out_file); /* Add Images to imagelist */
@@ -1806,7 +1810,7 @@ main(int argc, char **argv)
snprintf(buf, sizeof(buf),
"edje/scripts/embryo/compiled/%i", s->id.new_id);
VERBOSE(EINA_LOG_INFO("wrote embryo scr <%s> data <%p> size <%d>\n",
- buf, s->data, s->size));
+ buf, s->data, s->size));
eet_write(out_file->ef, buf, s->data, s->size, comp_mode);
}
@@ -1816,7 +1820,7 @@ main(int argc, char **argv)
snprintf(buf, sizeof(buf),
"edje/scripts/lua/%i", s->id.new_id);
VERBOSE(EINA_LOG_INFO("wrote lua scr <%s> data <%p> size <%d>\n",
- buf, s->data, s->size));
+ buf, s->data, s->size));
eet_write(out_file->ef, buf, s->data, s->size, comp_mode);
}
@@ -1852,8 +1856,8 @@ main(int argc, char **argv)
EINA_LIST_FOREACH(context.current_file->samplelist, l, s)
{
- if (context.current_file->append || s->id.used)
- { /* Write only used samples */
+ if (context.current_file->append || s->id.used) /* Write only used samples */
+ {
samples = eina_list_append(samples, s->entry);
snprintf(buf, sizeof(buf), "edje/sounds/%i",
@@ -1861,7 +1865,7 @@ main(int argc, char **argv)
eet_write(out_file->ef, buf,
s->data, s->size, EET_COMPRESSION_NONE);
VERBOSE(EINA_LOG_INFO("Wrote <%s> sample data <%p> size <%d>\n",
- buf, s->data, s->size));
+ buf, s->data, s->size));
}
}
@@ -1873,16 +1877,16 @@ main(int argc, char **argv)
EINA_LIST_FOREACH(context.current_file->vibrationlist, l, s)
{
- if (context.current_file->append || s->id.used)
- { /* Write only used vibrations */
+ if (context.current_file->append || s->id.used) /* Write only used vibrations */
+ {
vibrations = eina_list_append(vibrations, s->entry);
snprintf(buf, sizeof(buf), "edje/vibrations/%i",
s->id.new_id);
eet_write(out_file->ef, buf,
- s->data, s->size,EINA_TRUE);
+ s->data, s->size, EINA_TRUE);
VERBOSE(EINA_LOG_INFO("Wrote <%s> vibration data <%p> size <%d>\n",
- buf, s->data, s->size));
+ buf, s->data, s->size));
}
}
}
@@ -1907,3 +1911,4 @@ main(int argc, char **argv)
return _edje_pick_cleanup(inp_files, out_file, EDJE_PICK_NO_ERROR);
}
+
diff --git a/src/bin/edje/edje_player.c b/src/bin/edje/edje_player.c
index 768f24e31d..079495a174 100644
--- a/src/bin/edje/edje_player.c
+++ b/src/bin/edje/edje_player.c
@@ -590,6 +590,7 @@ _slave_mode(void *data, Ecore_Fd_Handler *fd_handler)
return ECORE_CALLBACK_RENEW;
}
+
#endif
static void
@@ -1124,9 +1125,9 @@ main(int argc, char **argv)
f = eina_file_open(opts.file, EINA_FALSE);
if (edje_mmap_3d_has(f, group))
{
- Eina_List* engine_list, *n;
+ Eina_List *engine_list, *n;
Eina_Bool opengl_x11_has = EINA_FALSE, wayland_egl_has = EINA_FALSE;
- const char* engine;
+ const char *engine;
engine_list = ecore_evas_engines_get();
EINA_LIST_FOREACH(engine_list, n, engine)
{
diff --git a/src/bin/edje/edje_watch.c b/src/bin/edje/edje_watch.c
index 043d3af295..7c049a609a 100644
--- a/src/bin/edje/edje_watch.c
+++ b/src/bin/edje/edje_watch.c
@@ -43,7 +43,7 @@ read_watch_file(const char *file)
const char *path;
Eina_Bool do_append = EINA_TRUE;
- if (ln->length < 4) continue ;
+ if (ln->length < 4) continue;
if (anotate)
{
path = eina_stringshare_add_length(ln->start + 3, ln->length - 3);
@@ -56,7 +56,7 @@ read_watch_file(const char *file)
path = eina_stringshare_add_length(ln->start, ln->length);
}
if (do_append)
- r = eina_list_append(r, eio_monitor_add(path));
+ r = eina_list_append(r, eio_monitor_add(path));
eina_stringshare_del(path);
}
eina_iterator_free(it);
@@ -65,7 +65,7 @@ read_watch_file(const char *file)
eio_monitor_del(mon);
watching = r;
- err:
+err:
eina_file_close(f);
}
@@ -150,3 +150,4 @@ main(int argc, char **argv)
return 1;
}
+
diff --git a/src/bin/efl/efl_debugd.c b/src/bin/efl/efl_debugd.c
index cd4a819eaf..c7cad1e4ff 100644
--- a/src/bin/efl/efl_debugd.c
+++ b/src/bin/efl/efl_debugd.c
@@ -592,7 +592,6 @@ _local_server_create(void)
#ifdef EFL_NET_SERVER_UNIX_CLASS
{
Eo *inner_server = efl_net_server_simple_inner_server_get(_local_server);
- efl_net_server_unix_unlink_before_bind_set(inner_server, EINA_TRUE);
efl_net_server_unix_leading_directories_create_set(inner_server, EINA_TRUE, 0700);
}
#endif
diff --git a/src/bin/elementary/Makefile.am b/src/bin/elementary/Makefile.am
index 43c72f412d..8828276e26 100644
--- a/src/bin/elementary/Makefile.am
+++ b/src/bin/elementary/Makefile.am
@@ -48,6 +48,7 @@ test_bg.c \
test_box.c \
test_bubble.c \
test_button.c \
+test_ui_button.c \
test_calendar.c \
test_check.c \
test_clock.c \
@@ -132,6 +133,9 @@ test_slideshow.c \
test_spinner.c \
test_ui_spinner.c \
test_ui_buttonspin.c \
+test_ui_datepicker.c \
+test_ui_timepicker.c \
+test_ui_tags.c \
test_store.c \
test_sys_notify.c \
test_systray.c \
@@ -155,6 +159,7 @@ test_win_state.c \
test_win_wm_rotation.c \
test_win_dialog.c \
test_gesture_framework.c \
+test_ui_tab_pager.c \
test.h
elementary_test_LDADD = $(top_builddir)/src/lib/libelementary.la \
diff --git a/src/bin/elementary/config.c b/src/bin/elementary/config.c
index a57410a311..88767b9bc7 100644
--- a/src/bin/elementary/config.c
+++ b/src/bin/elementary/config.c
@@ -1944,6 +1944,25 @@ _status_config_focus(Evas_Object *win,
}
static void
+_web_entry_del(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *info EINA_UNUSED)
+{
+ if (interactive)
+ {
+ const char *web_backend_set = elm_config_web_backend_get();
+
+ web_backend = elm_object_text_get(obj);
+ if ((web_backend_set != web_backend) ||
+ (web_backend && web_backend_set &&
+ (!!strcmp(web_backend, web_backend_set))))
+ {
+ elm_config_web_backend_set(web_backend);
+ fprintf(stderr, "web backend set to : [%s]\n", elm_config_web_backend_get());
+ elm_config_all_flush();
+ }
+ }
+}
+
+static void
_status_config_etc(Evas_Object *win,
Evas_Object *naviframe)
{
@@ -2015,6 +2034,7 @@ _status_config_etc(Evas_Object *win,
evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(en);
elm_box_pack_end(bx3, en);
+ evas_object_event_callback_add(en, EVAS_CALLBACK_DEL, _web_entry_del, NULL);
web_backend_entry = en;
@@ -4203,16 +4223,18 @@ _status_config_full(Evas_Object *win,
tb_it = elm_toolbar_item_append(tb, "preferences-desktop-display",
"Sizing", _cf_sizing, win);
- elm_toolbar_item_append(tb, "preferences-desktop-theme",
- "Theme", _cf_themes, win);
+ if (!eina_streq(getenv("DESKTOP"), "Enlightenment"))
+ elm_toolbar_item_append(tb, "preferences-desktop-theme",
+ "Theme", _cf_themes, win);
elm_toolbar_item_append(tb, "preferences-color",
"Icons", _cf_icons, win);
elm_toolbar_item_append(tb, "preferences-desktop-font",
"Fonts", _cf_fonts, win);
elm_toolbar_item_append(tb, "preferences-desktop-multimedia",
"Audio", _cf_audio, win);
- elm_toolbar_item_append(tb, "preferences-profile",
- "Profiles", _cf_profiles, win);
+ if (!eina_streq(getenv("DESKTOP"), "Enlightenment"))
+ elm_toolbar_item_append(tb, "preferences-profile",
+ "Profiles", _cf_profiles, win);
elm_toolbar_item_append(tb, NULL, "Scrolling", _cf_scrolling, win);
elm_toolbar_item_append(tb, NULL, "Rendering", _cf_rendering, win);
elm_toolbar_item_append(tb, NULL, "Caches", _cf_caches, win);
@@ -4284,19 +4306,6 @@ efl_terminate(void *data EINA_UNUSED,
const Efl_Event *ev EINA_UNUSED)
{
fprintf(stderr, "Terminating.\n");
- if (interactive)
- {
- const char *web_backend_set = elm_config_web_backend_get();
-
- web_backend = elm_object_text_get(web_backend_entry);
- if (web_backend_set != web_backend ||
- (web_backend && web_backend_set && !!strcmp(web_backend, web_backend_set)))
- {
- elm_config_web_backend_set(web_backend);
- fprintf(stderr, "web backend set to : [%s]\n", elm_config_web_backend_get());
- elm_config_all_flush();
- }
- }
}
/* this is your elementary main function - it MUST be called IMMEDIATELY
diff --git a/src/bin/elementary/quicklaunch.c b/src/bin/elementary/quicklaunch.c
index 6370f6d683..eb376ee216 100644
--- a/src/bin/elementary/quicklaunch.c
+++ b/src/bin/elementary/quicklaunch.c
@@ -182,6 +182,7 @@ main(int argc, char **argv)
char buf[PATH_MAX];
struct sigaction action;
const char *domain;
+ char *rundir;
int ret = 0;
if (!eina_init())
@@ -203,7 +204,9 @@ main(int argc, char **argv)
if (!domain) domain = getenv("DISPLAY");
if (!domain) domain = "unknown";
}
- snprintf(buf, sizeof(buf), "/tmp/elm-ql-%i", getuid());
+ rundir = getenv("XDG_RUNTIME_DIR");
+ if (!rundir) rundir = "/tmp";
+ snprintf(buf, sizeof(buf), "%s/elm-ql-%i", rundir, getuid());
if (stat(buf, &st) < 0)
{
ret = mkdir(buf, S_IRUSR | S_IWUSR | S_IXUSR);
@@ -213,7 +216,7 @@ main(int argc, char **argv)
exit(-1);
}
}
- snprintf(buf, sizeof(buf), "/tmp/elm-ql-%i/%s", getuid(), domain);
+ snprintf(buf, sizeof(buf), "%s/elm-ql-%i/%s", rundir, getuid(), domain);
unlink(buf);
sock = socket(AF_UNIX, SOCK_STREAM, 0);
if (sock < 0)
diff --git a/src/bin/elementary/run.c b/src/bin/elementary/run.c
index 6d547ad16a..41f666f373 100644
--- a/src/bin/elementary/run.c
+++ b/src/bin/elementary/run.c
@@ -34,6 +34,7 @@ main(int argc, char **argv)
int we_are_elementary_run = 0;
char *domain;
char *cwd;
+ char *rundir;
int sargc, slen, envnum;
unsigned char *sbuf = NULL, *pos;
@@ -51,7 +52,9 @@ main(int argc, char **argv)
if (!domain) domain = getenv("DISPLAY");
if (!domain) domain = "unknown";
}
- snprintf(buf, sizeof(buf), "/tmp/elm-ql-%i/%s", getuid(), domain);
+ rundir = getenv("XDG_RUNTIME_DIR");
+ if (!rundir) rundir = "/tmp";
+ snprintf(buf, sizeof(buf), "%s/elm-ql-%i/%s", rundir, getuid(), domain);
if ((sock = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
{
perror("elementary_quicklaunch: socket(AF_UNIX, SOCK_STREAM, 0)");
diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c
index 1f75b930cb..8d8d9701d5 100644
--- a/src/bin/elementary/test.c
+++ b/src/bin/elementary/test.c
@@ -31,6 +31,7 @@ void test_box_align(void *data, Evas_Object *obj, void *event_info);
void test_box_stack(void *data, Evas_Object *obj, void *event_info);
void test_ui_box(void *data, Evas_Object *obj, void *event_info);
void test_button(void *data, Evas_Object *obj, void *event_info);
+void test_ui_button(void *data, Evas_Object *obj, void *event_info);
void test_cnp(void *data, Evas_Object *obj, void *event_info);
void test_events(void *data, Evas_Object *obj, void *event_info);
void test_transit(void *data, Evas_Object *obj, void *event_info);
@@ -140,6 +141,7 @@ void test_genlist_filter(void *data, Evas_Object *obj, void *event_info);
void test_genlist_show_bring(void *data, Evas_Object *obj, void *event_info);
void test_genlist_cache(void *data, Evas_Object *obj, void *event_info);
void test_genlist_reusable(void *data, Evas_Object *obj, void *event_info);
+void test_genlist_item_show(void *data, Evas_Object *obj, void *event_info);
void test_gesture_layer(void *data, Evas_Object *obj, void *event_info);
void test_gesture_layer2(void *data, Evas_Object *obj, void *event_info);
void test_gesture_layer3(void *data, Evas_Object *obj, void *event_info);
@@ -169,6 +171,7 @@ void test_win_state2(void *data, Evas_Object *obj, void *event_info);
void test_win_stack(void *data, Evas_Object *obj, void *event_info);
void test_progressbar(void *data, Evas_Object *obj, void *event_info);
void test_progressbar2(void *data, Evas_Object *obj, void *event_info);
+void test_ui_progressbar(void *data, Evas_Object *obj, void *event_info);
void test_fileselector(void *data, Evas_Object *obj, void *event_info);
void test_separator(void *data, Evas_Object *obj, void *event_info);
void test_scroller(void *data, Evas_Object *obj, void *event_info);
@@ -181,6 +184,9 @@ void test_efl_ui_scroller2(void *data, Evas_Object *obj, void *event_info);
void test_spinner(void *data, Evas_Object *obj, void *event_info);
void test_ui_spin(void *data, Evas_Object *obj, void *event_info);
void test_ui_spin_button(void *data, Evas_Object *obj, void *event_info);
+void test_ui_datepicker(void *data, Evas_Object *obj, void *event_info);
+void test_ui_timepicker(void *data, Evas_Object *obj, void *event_info);
+void test_ui_tags(void *data, Evas_Object *obj, void *event_info);
void test_index(void *data, Evas_Object *obj, void *event_info);
void test_index2(void *data, Evas_Object *obj, void *event_info);
void test_index3(void *data, Evas_Object *obj, void *event_info);
@@ -275,6 +281,7 @@ void test_naviframe(void *data, Evas_Object *obj, void *event_info);
void test_naviframe2(void *data, Evas_Object *obj, void *event_info);
void test_naviframe3(void *data, Evas_Object *obj, void *event_info);
void test_naviframe_complex(void *data, Evas_Object *obj, void *event_info);
+void test_ui_stack(void *data, Evas_Object *obj, void *event_info);
//void test_factory(void *data, Evas_Object *obj, void *event_info);
void test_datetime(void *data, Evas_Object *obj, void *event_info);
void test_ui_clock(void *data, Evas_Object *obj, void *event_info);
@@ -325,6 +332,7 @@ void test_colorclass(void *data, Evas_Object *obj, void *event_info);
void test_code_welcome(void *data, Evas_Object *obj, void *event_info);
void test_code_editor(void *data, Evas_Object *obj, void *event_info);
void test_code_syntax(void *data, Evas_Object *obj, void *event_info);
+void test_code_syntax_tabbed(void *data, Evas_Object *obj, void *event_info);
void test_code_mirror(void *data, Evas_Object *obj, void *event_info);
void test_code_log(void *data, Evas_Object *obj, void *event_info);
void test_code_diff(void *data, Evas_Object *obj, void *event_info);
@@ -333,6 +341,7 @@ void test_code_diff_inline(void *data, Evas_Object *obj, void *event_info);
void test_efl_ui_text(void *data, Evas_Object *obj, void *event_info);
void test_efl_ui_text_label(void *data, Evas_Object *obj, void *event_info);
void test_efl_ui_text_async(void *data, Evas_Object *obj, void *event_info);
+void test_ui_text_item_factory(void *data, Evas_Object *obj, void *event_info);
void test_evas_mask(void *data, Edje_Object *obj, void *event_info);
void test_gfx_filters(void *data, Evas_Object *obj, void *event_info);
void test_evas_snapshot(void *data, Evas_Object *obj, void *event_info);
@@ -359,6 +368,8 @@ void test_efl_anim_interpolator(void *data, Evas_Object *obj, void *event_info);
void test_gesture_framework(void *data, Evas_Object *obj, void *event_info);
+void test_ui_tab_pager(void *data, Evas_Object *obj, void *event_info);
+
static void _list_udpate(void);
static Evas_Object *win, *tbx, *entry; // TODO: refactoring
@@ -834,11 +845,14 @@ add_tests:
ADD_TEST_EO(NULL, "Entries", "Efl.Ui.Text", test_efl_ui_text);
ADD_TEST_EO(NULL, "Entries", "Efl.Ui.Text Label", test_efl_ui_text_label);
ADD_TEST_EO(NULL, "Entries", "Efl.Ui.Text.Async", test_efl_ui_text_async);
+ ADD_TEST_EO(NULL, "Entries", "Ui.Text Item Factory", test_ui_text_item_factory);
+ ADD_TEST_EO(NULL, "Entries", "Efl.Ui.Tags", test_ui_tags);
//------------------------------//
+ ADD_TEST(NULL, "Advanced Entries", "Code Entry Markup", test_code_welcome);
+ ADD_TEST(NULL, "Advanced Entries", "Code Editor", test_code_editor);
ADD_TEST(NULL, "Advanced Entries", "Code Syntax", test_code_syntax);
- ADD_TEST(NULL, "Advanced Entries", "Entry Markup", test_code_welcome);
- ADD_TEST(NULL, "Advanced Entries", "Text Editor", test_code_editor);
+ ADD_TEST(NULL, "Advanced Entries", "Code Syntax (Tabbed)", test_code_syntax_tabbed);
ADD_TEST(NULL, "Advanced Entries", "Mirrored Editor", test_code_mirror);
ADD_TEST(NULL, "Advanced Entries", "Logger", test_code_log);
ADD_TEST(NULL, "Advanced Entries", "Diff Comparison", test_code_diff);
@@ -846,6 +860,7 @@ add_tests:
//------------------------------//
ADD_TEST(NULL, "Buttons", "Button", test_button);
+ ADD_TEST_EO(NULL, "Buttons", "Efl.Ui.Button", test_ui_button);
//------------------------------//
ADD_TEST(NULL, "Prefs", "Prefs", test_prefs);
@@ -955,6 +970,7 @@ add_tests:
ADD_TEST(NULL, "Lists - Genlist", "Genlist Show/Bring", test_genlist_show_bring);
ADD_TEST(NULL, "Lists - Genlist", "Genlist Cache", test_genlist_cache);
ADD_TEST(NULL, "Lists - Genlist", "Genlist Reusable Contents", test_genlist_reusable);
+ ADD_TEST(NULL, "Lists - Genlist", "Genlist Item Show", test_genlist_item_show);
//------------------------------//
@@ -1041,15 +1057,19 @@ add_tests:
ADD_TEST(NULL, "Range Values", "Slider", test_slider);
ADD_TEST(NULL, "Range Values", "Progressbar", test_progressbar);
ADD_TEST(NULL, "Range Values", "Progressbar 2", test_progressbar2);
+ ADD_TEST_EO(NULL, "Range Values", "Efl.Ui.Progressbar", test_ui_progressbar);
ADD_TEST_EO(NULL, "Range Values", "Efl.Ui.Nstate", test_nstate);
- ADD_TEST_EO(NULL, "Range Values", "Efl.Ui.Slider_Interval", test_slider_interval);
ADD_TEST_EO(NULL, "Range Values", "Efl.Ui.Slider", test_ui_slider);
+ ADD_TEST_EO(NULL, "Range Values", "Efl.Ui.Slider_Interval", test_slider_interval);
//------------------------------//
ADD_TEST(NULL, "Booleans", "Check", test_check);
ADD_TEST(NULL, "Booleans", "Check Toggle", test_check_toggle);
//------------------------------//
+ ADD_TEST_EO(NULL, "Tab Pager", "Efl.Ui.Tab_Pager", test_ui_tab_pager);
+
+ //------------------------------//
ADD_TEST(NULL, "Popups", "Ctxpopup", test_ctxpopup);
ADD_TEST(NULL, "Popups", "Hover", test_hover);
ADD_TEST(NULL, "Popups", "Hover 2", test_hover2);
@@ -1077,6 +1097,8 @@ add_tests:
ADD_TEST(NULL, "Times & Dates", "Datetime", test_datetime);
ADD_TEST_EO(NULL, "Times & Dates", "Efl.Ui.Calendar", test_efl_ui_calendar);
ADD_TEST_EO(NULL, "Times & Dates", "Efl.Ui.Clock", test_ui_clock);
+ ADD_TEST_EO(NULL, "Times & Dates", "Efl.Ui.Datepicker", test_ui_datepicker);
+ ADD_TEST_EO(NULL, "Times & Dates", "Efl.Ui.Timepicker", test_ui_timepicker);
//------------------------------//
ADD_TEST(NULL, "Text", "Label", test_label);
@@ -1110,6 +1132,7 @@ add_tests:
ADD_TEST(NULL, "Naviframe", "Naviframe 2", test_naviframe2);
ADD_TEST(NULL, "Naviframe", "Naviframe 3", test_naviframe3);
ADD_TEST(NULL, "Naviframe", "Naviframe: Complex", test_naviframe_complex);
+ ADD_TEST_EO(NULL, "Naviframe", "Efl.Ui.Stack", test_ui_stack);
//------------------------------//
ADD_TEST(NULL, "Geographic", "Map", test_map);
@@ -1291,7 +1314,7 @@ efl_main(void *data EINA_UNUSED,
/* if called with a single argument try to autorun a test with
* the same name as the given param
* ex: elementary_test "Box Vert 2" */
- if (eina_array_count(arge->argv) == 1)
+ if (eina_array_count(arge->argv) == 2)
{
if (!strcmp(eina_array_data_get(arge->argv, 0), "--help"))
{
@@ -1306,15 +1329,15 @@ efl_main(void *data EINA_UNUSED,
}
autorun = eina_array_data_get(arge->argv, 0);
}
- else if (eina_array_count(arge->argv) == 2)
+ else if (eina_array_count(arge->argv) == 3)
{
/* Just a workaround to make the shot module more
* useful with elementary test. */
- if ((!strcmp(eina_array_data_get(arge->argv, 0), "--test-win-only")) ||
- (!strcmp(eina_array_data_get(arge->argv, 0), "-to")))
+ if ((!strcmp(eina_array_data_get(arge->argv, 1), "--test-win-only")) ||
+ (!strcmp(eina_array_data_get(arge->argv, 1), "-to")))
{
test_win_only = EINA_TRUE;
- autorun = eina_array_data_get(arge->argv, 1);
+ autorun = eina_array_data_get(arge->argv, 2);
}
}
diff --git a/src/bin/elementary/test_access.c b/src/bin/elementary/test_access.c
index 80b8ea36e6..c3154f695e 100644
--- a/src/bin/elementary/test_access.c
+++ b/src/bin/elementary/test_access.c
@@ -286,7 +286,9 @@ test_access2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i
evas_object_show(ly2);
/* access */
+ edje_object_freeze(elm_layout_edje_get(ly2));
to = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(ly2), "access");
+ edje_object_thaw(elm_layout_edje_get(ly2));
ao = elm_access_object_register(to, ly2);
elm_object_focus_custom_chain_append(ly2, ao, NULL);
}
@@ -371,22 +373,30 @@ test_access3(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i
elm_object_part_content_set(ly, "center", btn);
+ edje_object_freeze(elm_layout_edje_get(ly));
to = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(ly), "red");
+ edje_object_thaw(elm_layout_edje_get(ly));
red_ao = elm_access_object_register(to, ly);
elm_access_info_cb_set(red_ao, ELM_ACCESS_INFO, _access_info_cb, "red");
elm_access_highlight_next_set(btn, ELM_HIGHLIGHT_DIR_NEXT, red_ao);
+ edje_object_freeze(elm_layout_edje_get(ly));
to = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(ly), "green");
+ edje_object_thaw(elm_layout_edje_get(ly));
green_ao = elm_access_object_register(to, ly);
elm_access_info_cb_set(green_ao, ELM_ACCESS_INFO, _access_info_cb, "green");
elm_access_highlight_next_set(red_ao, ELM_HIGHLIGHT_DIR_NEXT, green_ao);
+ edje_object_freeze(elm_layout_edje_get(ly));
to = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(ly), "blue");
+ edje_object_thaw(elm_layout_edje_get(ly));
blue_ao = elm_access_object_register(to, ly);
elm_access_info_cb_set(blue_ao, ELM_ACCESS_INFO, _access_info_cb, "blue");
elm_access_highlight_next_set(green_ao, ELM_HIGHLIGHT_DIR_NEXT, blue_ao);
+ edje_object_freeze(elm_layout_edje_get(ly));
to = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(ly), "black");
+ edje_object_thaw(elm_layout_edje_get(ly));
black_ao = elm_access_object_register(to, ly);
elm_access_info_cb_set(black_ao, ELM_ACCESS_INFO, _access_info_cb, "black");
elm_access_highlight_next_set(blue_ao, ELM_HIGHLIGHT_DIR_NEXT, black_ao);
diff --git a/src/bin/elementary/test_bg.c b/src/bin/elementary/test_bg.c
index d6e8bc3065..59d18821d0 100644
--- a/src/bin/elementary/test_bg.c
+++ b/src/bin/elementary/test_bg.c
@@ -317,7 +317,7 @@ _image_cb(void *data, const Efl_Event *ev)
{
efl_file_get(ev->object, &f, &k);
o = efl_add(EFL_UI_IMAGE_CLASS, win,
- efl_image_scale_type_set(efl_added, EFL_IMAGE_SCALE_TYPE_FIT_OUTSIDE),
+ efl_gfx_image_scale_type_set(efl_added, EFL_GFX_IMAGE_SCALE_TYPE_FIT_OUTSIDE),
efl_file_set(efl_added, f, k)
);
efl_content_set(efl_part(win, "background"), o);
@@ -330,7 +330,7 @@ test_bg_window(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
Evas_Object *win, *box, *cs;
char buf[PATH_MAX];
- win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_text_set(efl_added, "Bg EOAPI (Efl.Ui.Win)"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE),
efl_ui_win_alpha_set(efl_added, 1));
@@ -367,7 +367,7 @@ test_bg_window(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _image_cb, win),
efl_pack(box, efl_added));
- efl_gfx_size_set(win, EINA_SIZE2D(300, 200));
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(300, 200));
}
static void
@@ -375,7 +375,7 @@ _cb_radio_changed_scale_type(void *data, const Efl_Event *ev)
{
Evas_Object *o_bg = data;
- efl_image_scale_type_set(o_bg, efl_ui_nstate_value_get(ev->object));
+ efl_gfx_image_scale_type_set(o_bg, efl_ui_nstate_value_get(ev->object));
}
static void
@@ -403,7 +403,7 @@ test_bg_scale_type(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
Evas_Object *rd, *rdg;
char buf[PATH_MAX];
- win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_text_set(efl_added, "Bg EOAPI (Efl.Ui.Bg)"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE),
efl_ui_win_alpha_set(efl_added, EINA_FALSE));
@@ -432,14 +432,14 @@ test_bg_scale_type(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
efl_pack(box, efl_added));
rdg = rd = efl_add(EFL_UI_RADIO_CLASS, hbox,
- efl_ui_radio_state_value_set(efl_added, EFL_IMAGE_SCALE_TYPE_FILL),
+ efl_ui_radio_state_value_set(efl_added, EFL_GFX_IMAGE_SCALE_TYPE_FILL),
efl_text_set(efl_added, "Fill"),
efl_gfx_size_hint_weight_set(efl_added, EFL_GFX_SIZE_HINT_EXPAND, 0.0),
efl_event_callback_add(efl_added, EFL_UI_RADIO_EVENT_CHANGED, _cb_radio_changed_scale_type, o_bg),
efl_pack(hbox, efl_added));
rd = efl_add(EFL_UI_RADIO_CLASS, hbox,
- efl_ui_radio_state_value_set(efl_added, EFL_IMAGE_SCALE_TYPE_FIT_INSIDE),
+ efl_ui_radio_state_value_set(efl_added, EFL_GFX_IMAGE_SCALE_TYPE_FIT_INSIDE),
efl_ui_radio_group_add(efl_added, rdg),
efl_text_set(efl_added, "Fit Inside"),
efl_gfx_size_hint_weight_set(efl_added, EFL_GFX_SIZE_HINT_EXPAND, 0.0),
@@ -448,7 +448,7 @@ test_bg_scale_type(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
rd = efl_add(EFL_UI_RADIO_CLASS, hbox,
- efl_ui_radio_state_value_set(efl_added, EFL_IMAGE_SCALE_TYPE_FIT_OUTSIDE),
+ efl_ui_radio_state_value_set(efl_added, EFL_GFX_IMAGE_SCALE_TYPE_FIT_OUTSIDE),
efl_ui_radio_group_add(efl_added, rdg),
efl_text_set(efl_added, "Fit Outside"),
efl_gfx_size_hint_weight_set(efl_added, EFL_GFX_SIZE_HINT_EXPAND, 0.0),
@@ -456,7 +456,7 @@ test_bg_scale_type(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
efl_pack(hbox, efl_added));
rd = efl_add(EFL_UI_RADIO_CLASS, hbox,
- efl_ui_radio_state_value_set(efl_added, EFL_IMAGE_SCALE_TYPE_NONE),
+ efl_ui_radio_state_value_set(efl_added, EFL_GFX_IMAGE_SCALE_TYPE_NONE),
efl_ui_radio_group_add(efl_added, rdg),
efl_text_set(efl_added, "None"),
efl_gfx_size_hint_weight_set(efl_added, EFL_GFX_SIZE_HINT_EXPAND, 0.0),
@@ -464,14 +464,14 @@ test_bg_scale_type(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
efl_pack(hbox, efl_added));
rd = efl_add(EFL_UI_RADIO_CLASS, hbox,
- efl_ui_radio_state_value_set(efl_added, EFL_IMAGE_SCALE_TYPE_TILE),
+ efl_ui_radio_state_value_set(efl_added, EFL_GFX_IMAGE_SCALE_TYPE_TILE),
efl_ui_radio_group_add(efl_added, rdg),
efl_text_set(efl_added, "Tile"),
efl_gfx_size_hint_weight_set(efl_added, EFL_GFX_SIZE_HINT_EXPAND, 0.0),
efl_event_callback_add(efl_added, EFL_UI_RADIO_EVENT_CHANGED, _cb_radio_changed_scale_type, o_bg),
efl_pack(hbox, efl_added));
- efl_ui_nstate_value_set(rdg, EFL_IMAGE_SCALE_TYPE_FILL);
+ efl_ui_nstate_value_set(rdg, EFL_GFX_IMAGE_SCALE_TYPE_FILL);
efl_add(EFL_UI_CHECK_CLASS, hbox,
efl_text_set(efl_added, "Bg Color"),
@@ -479,7 +479,7 @@ test_bg_scale_type(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
efl_event_callback_add(efl_added, EFL_UI_CHECK_EVENT_CHANGED, _cb_check_changed_scale_type, o_bg),
efl_pack(hbox, efl_added));
- efl_gfx_size_set(win, EINA_SIZE2D(300, 200));
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(300, 200));
}
diff --git a/src/bin/elementary/test_box.c b/src/bin/elementary/test_box.c
index 5439234056..f50dcb339f 100644
--- a/src/bin/elementary/test_box.c
+++ b/src/bin/elementary/test_box.c
@@ -889,7 +889,7 @@ test_box_stack(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
Evas_Object *win, *bx, *o;
char buf[PATH_MAX];
- win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_text_set(efl_added, "Efl.Ui.Box_Stack"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
@@ -919,5 +919,5 @@ test_box_stack(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
efl_file_set(efl_added, buf, NULL));
efl_pack(bx, o);
- efl_gfx_size_set(win, EINA_SIZE2D(300, 300));
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(300, 300));
}
diff --git a/src/bin/elementary/test_calendar.c b/src/bin/elementary/test_calendar.c
index 34064395ac..ba37407c0f 100644
--- a/src/bin/elementary/test_calendar.c
+++ b/src/bin/elementary/test_calendar.c
@@ -431,7 +431,7 @@ test_efl_ui_calendar(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
current_date = time(NULL) + SEC_PER_YEAR;
localtime_r(&current_date, &max_date);
- win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_text_set(efl_added, "Efl Ui Calendar"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
@@ -454,5 +454,5 @@ test_efl_ui_calendar(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
efl_ui_format_cb_set(efl_added, NULL, _cal_format_cb, NULL),
efl_pack(box, efl_added));
- efl_gfx_size_set(win, EINA_SIZE2D(300, 300));
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(300, 300));
}
diff --git a/src/bin/elementary/test_code.c b/src/bin/elementary/test_code.c
index b6dad3ea2f..bb010ce5e6 100644
--- a/src/bin/elementary/test_code.c
+++ b/src/bin/elementary/test_code.c
@@ -156,6 +156,40 @@ _elm_code_test_syntax_setup(Evas_Object *parent)
}
static Evas_Object *
+_elm_code_test_syntax_tabbed_setup(Evas_Object *parent)
+{
+ Elm_Code *code;
+ Elm_Code_Widget *widget;
+
+ code = elm_code_create();
+ code->config.indent_style_efl = EINA_FALSE;
+ widget = efl_add(ELM_CODE_WIDGET_CLASS, parent, elm_obj_code_widget_code_set(efl_added, code));
+ elm_obj_code_widget_editable_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_show_whitespace_set(widget, EINA_TRUE);
+ elm_obj_code_widget_line_numbers_set(widget, EINA_TRUE);
+ elm_obj_code_widget_tab_inserts_spaces_set(widget, EINA_FALSE);
+
+ _append_line(code->file, "#include <stdio.h>");
+ _append_line(code->file, "int main(int argc, char **argv)");
+ _append_line(code->file, "{");
+ _append_line(code->file, "\t// display a welcome greeting");
+ _append_line(code->file, "\tif (argc > 0)");
+ _append_line(code->file, "\t\tprintf(\"Hello, %s!\\n\", argv[0]);");
+ _append_line(code->file, "\telse");
+ _append_line(code->file, "\t\tprintf(\"Hello, World!\\n\");");
+ _append_line(code->file, "\treturn 0;");
+ _append_line(code->file, "}");
+
+ 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);
+
+ return widget;
+}
+
+static Evas_Object *
_elm_code_test_mirror_setup(Elm_Code *code, char *font_name, Evas_Object *parent)
{
Elm_Code_Widget *widget;
@@ -263,6 +297,22 @@ test_code_syntax(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
}
void
+test_code_syntax_tabbed(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Evas_Object *win, *screen;
+
+ win = _test_code_win_create("code-syntax-tabbed", "Code Syntax (Tabbed)");
+ screen = elm_box_add(win);
+ evas_object_size_hint_weight_set(screen, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_box_pack_end(screen, _elm_code_test_syntax_tabbed_setup(screen));
+ elm_win_resize_object_add(win, screen);
+ evas_object_show(screen);
+
+ evas_object_show(win);
+}
+
+
+void
test_code_log(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
Evas_Object *win, *screen, *o, *code;
diff --git a/src/bin/elementary/test_ctxpopup.c b/src/bin/elementary/test_ctxpopup.c
index b91cd85121..9293647d28 100644
--- a/src/bin/elementary/test_ctxpopup.c
+++ b/src/bin/elementary/test_ctxpopup.c
@@ -56,10 +56,10 @@ _btn_remove_cb(void *data EINA_UNUSED, Evas_Object *obj,
static void
_ctxpopup_item_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info)
{
- printf("Item selected status: %d\n", efl_ui_item_selected_get(event_info));
+ printf("Item selected status: %d\n", elm_ctxpopup_item_selected_get(event_info));
printf("ctxpopup item selected: %s\n",
- elm_object_item_text_get(efl_ui_menu_selected_item_get(obj)));
+ elm_object_item_text_get(elm_ctxpopup_selected_item_get(obj)));
elm_ctxpopup_dismiss(obj);
}
@@ -105,7 +105,7 @@ _list_item_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UN
_ctxpopup_item_new(ctxpopup, "Go to home folder", "home");
_ctxpopup_item_new(ctxpopup, "Save file", "file");
it = _ctxpopup_item_new(ctxpopup, "Delete file", "delete");
- efl_ui_item_selected_set(it, EINA_TRUE);
+ elm_ctxpopup_item_selected_set(it, EINA_TRUE);
it = _ctxpopup_item_new(ctxpopup, "Navigate to folder", "folder");
elm_object_item_disabled_set(it, EINA_TRUE);
_ctxpopup_item_new(ctxpopup, "Edit entry", "edit");
@@ -470,6 +470,31 @@ _list_item_cb10(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_
}
static void
+_list_item_cb11(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
+{
+ Evas_Object *ctxpopup;
+ Evas_Coord x,y;
+ char label[16];
+ int i = 0;
+
+ if (list_mouse_down > 0) return;
+
+ ctxpopup = elm_ctxpopup_add(obj);
+ evas_object_smart_callback_add(ctxpopup, "dismissed", _dismissed, NULL);
+ evas_object_smart_callback_add(ctxpopup, "geometry,update", _geometry_update, NULL);
+
+ while (i++ < 100)
+ {
+ snprintf(label, sizeof(label), "Item %d", i);
+ _ctxpopup_item_new(ctxpopup, label, "clock");
+ }
+
+ evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x, &y);
+ evas_object_move(ctxpopup, x, y);
+ evas_object_show(ctxpopup);
+}
+
+static void
_list_clicked(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
{
elm_list_item_selected_set(event_info, EINA_FALSE);
@@ -532,6 +557,8 @@ test_ctxpopup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
_list_item_cb9, NULL);
elm_list_item_append(list, "Ctxpopup with user content (enable to remove)", NULL, NULL,
_list_item_cb10, NULL);
+ elm_list_item_append(list, "Ctxpopup with more items", NULL, NULL,
+ _list_item_cb11, NULL);
evas_object_show(list);
elm_list_go(list);
diff --git a/src/bin/elementary/test_datetime.c b/src/bin/elementary/test_datetime.c
index 6bc0f8c583..719275baca 100644
--- a/src/bin/elementary/test_datetime.c
+++ b/src/bin/elementary/test_datetime.c
@@ -34,7 +34,6 @@ _bt_clicked(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUS
efl_ui_clock_pause_set(dt1, EINA_TRUE);
elm_datetime_value_set(dt1, &new_time);
elm_object_disabled_set(dt1, EINA_TRUE);
-
elm_object_disabled_set(obj, EINA_TRUE);
evas_object_del(dt2);
evas_object_del(dt3);
diff --git a/src/bin/elementary/test_dnd.c b/src/bin/elementary/test_dnd.c
index 3b44c2bd40..93bed2a397 100644
--- a/src/bin/elementary/test_dnd.c
+++ b/src/bin/elementary/test_dnd.c
@@ -204,11 +204,15 @@ _grid_item_getcb(Evas_Object *obj, Evas_Coord x, Evas_Coord y, int *xposret, int
static inline char *
_strndup(const char *str, size_t len)
{
- size_t slen = strlen(str);
+ const char *p;
char *ret;
+ size_t slen;
- if (slen > len) slen = len;
- ret = malloc (slen + 1);
+ for (slen = 0, p = str;
+ (slen < len) && (*p);
+ p++, slen++);
+
+ ret = malloc(slen + 1);
if (!ret) return NULL;
if (slen > 0) memcpy(ret, str, slen);
@@ -1216,10 +1220,12 @@ _label_drop_cb(void *data EINA_UNUSED, Evas_Object *obj, Elm_Selection_Data *ev)
static Eina_Bool
_image_drop_cb(void *data EINA_UNUSED, Evas_Object *obj, Elm_Selection_Data *ev)
{
- const char *f = ev->data;
+ char *f = (char*)eina_memdup(ev->data, ev->len, 1);
+
printf("%s: obj: %s %p drop data: %s\n", __func__,
evas_object_type_get(obj), obj, f);
elm_image_file_set(obj, f, NULL);
+ free(f);
return EINA_TRUE;
}
diff --git a/src/bin/elementary/test_efl_anim_alpha.c b/src/bin/elementary/test_efl_anim_alpha.c
index e225ae3fbf..0a42b920eb 100644
--- a/src/bin/elementary/test_efl_anim_alpha.c
+++ b/src/bin/elementary/test_efl_anim_alpha.c
@@ -5,9 +5,9 @@
typedef struct _App_Data
{
- Efl_Animation *show_anim;
- Efl_Animation *hide_anim;
- Efl_Animation_Object *anim_obj;
+ Efl_Canvas_Animation *show_anim;
+ Efl_Canvas_Animation *hide_anim;
+ Efl_Canvas_Animation_Player *anim_obj;
Eina_Bool is_btn_visible;
} App_Data;
@@ -19,20 +19,16 @@ _anim_started_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
}
static void
-_anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED)
+_anim_ended_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
{
- App_Data *ad = data;
-
printf("Animation has been ended!\n");
-
- ad->anim_obj = NULL;
}
static void
_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event)
{
- Efl_Animation_Object_Running_Event_Info *event_info = event->info;
- double progress = event_info->progress;
+ Efl_Canvas_Animation_Player_Event_Running *event_running = event->info;
+ double progress = event_running->progress;
printf("Animation is running! Current progress(%lf)\n", progress);
}
@@ -41,35 +37,23 @@ _btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
{
App_Data *ad = data;
- if (ad->anim_obj)
- efl_animation_object_cancel(ad->anim_obj);
-
ad->is_btn_visible = !(ad->is_btn_visible);
if (ad->is_btn_visible)
{
//Create Animation Object from Animation
- ad->anim_obj = efl_animation_object_create(ad->show_anim);
- elm_object_text_set(obj, "Start Alpha Animation from 1.0 to 0.0");
+ efl_animation_player_animation_set(ad->anim_obj, ad->show_anim);
+ efl_text_set(obj, "Start Alpha Animation from 1.0 to 0.0");
}
else
{
//Create Animation Object from Animation
- ad->anim_obj = efl_animation_object_create(ad->hide_anim);
- elm_object_text_set(obj, "Start Alpha Animation from 0.0 to 1.0");
+ efl_animation_player_animation_set(ad->anim_obj, ad->hide_anim);
+ efl_text_set(obj, "Start Alpha Animation from 0.0 to 1.0");
}
- //Register callback called when animation starts
- efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_STARTED, _anim_started_cb, NULL);
-
- //Register callback called when animation ends
- efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_ENDED, _anim_ended_cb, ad);
-
- //Register callback called while animation is executed
- efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_RUNNING, _anim_running_cb, NULL);
-
//Let Animation Object start animation
- efl_animation_object_start(ad->anim_obj);
+ efl_player_start(ad->anim_obj);
}
static void
@@ -99,23 +83,29 @@ test_efl_anim_alpha(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *
evas_object_show(btn);
//Show Animation
- Efl_Animation *show_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL);
+ Efl_Canvas_Animation *show_anim = efl_add(EFL_CANVAS_ANIMATION_ALPHA_CLASS, win);
efl_animation_alpha_set(show_anim, 0.0, 1.0);
efl_animation_duration_set(show_anim, 1.0);
- efl_animation_target_set(show_anim, btn);
efl_animation_final_state_keep_set(show_anim, EINA_TRUE);
//Hide Animation
- Efl_Animation *hide_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL);
+ Efl_Canvas_Animation *hide_anim = efl_add(EFL_CANVAS_ANIMATION_ALPHA_CLASS, win);
efl_animation_alpha_set(hide_anim, 1.0, 0.0);
efl_animation_duration_set(hide_anim, 1.0);
- efl_animation_target_set(hide_anim, btn);
efl_animation_final_state_keep_set(hide_anim, EINA_TRUE);
//Initialize App Data
ad->show_anim = show_anim;
ad->hide_anim = hide_anim;
- ad->anim_obj = NULL;
+ ad->anim_obj = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, win,
+ efl_animation_player_target_set(efl_added, btn));
+
+ //Register callback called when animation starts
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
+ //Register callback called when animation ends
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, ad);
+ //Register callback called while animation is executed
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
ad->is_btn_visible = EINA_TRUE;
//Button to start animation
diff --git a/src/bin/elementary/test_efl_anim_event_anim.c b/src/bin/elementary/test_efl_anim_event_anim.c
index f68ee8ccac..b4c351888c 100644
--- a/src/bin/elementary/test_efl_anim_event_anim.c
+++ b/src/bin/elementary/test_efl_anim_event_anim.c
@@ -5,7 +5,7 @@
typedef struct _App_Data
{
- Efl_Animation_Object *target;
+ Efl_Canvas_Animation_Player *target;
Eina_Bool is_btn_visible;
} App_Data;
@@ -57,21 +57,21 @@ test_efl_anim_event_anim(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, v
evas_object_move(btn, 100, 50);
//Show Animation
- Efl_Animation *show_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL);
+ Efl_Canvas_Animation *show_anim = efl_add(EFL_CANVAS_ANIMATION_ALPHA_CLASS, win);
efl_animation_alpha_set(show_anim, 0.0, 1.0);
efl_animation_duration_set(show_anim, 1.0);
- efl_animation_target_set(show_anim, btn);
- efl_canvas_object_event_animation_set(btn, EFL_GFX_EVENT_SHOW, show_anim);
+ efl_animation_final_state_keep_set(show_anim, EINA_TRUE);
+ efl_canvas_object_event_animation_set(btn, EFL_GFX_ENTITY_EVENT_SHOW, show_anim);
//Show button after setting event animation to show animation for show event
evas_object_show(btn);
//Hide Animation
- Efl_Animation *hide_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL);
+ Efl_Canvas_Animation *hide_anim = efl_add(EFL_CANVAS_ANIMATION_ALPHA_CLASS, win);
efl_animation_alpha_set(hide_anim, 1.0, 0.0);
efl_animation_duration_set(hide_anim, 1.0);
- efl_animation_target_set(hide_anim, btn);
- efl_canvas_object_event_animation_set(btn, EFL_GFX_EVENT_HIDE, hide_anim);
+ efl_animation_final_state_keep_set(hide_anim, EINA_TRUE);
+ efl_canvas_object_event_animation_set(btn, EFL_GFX_ENTITY_EVENT_HIDE, hide_anim);
//Initialize App Data
ad->target = btn;
diff --git a/src/bin/elementary/test_efl_anim_group_parallel.c b/src/bin/elementary/test_efl_anim_group_parallel.c
index a2182bf144..b7128883d0 100644
--- a/src/bin/elementary/test_efl_anim_group_parallel.c
+++ b/src/bin/elementary/test_efl_anim_group_parallel.c
@@ -5,9 +5,9 @@
typedef struct _App_Data
{
- Efl_Animation *parallel_show_anim;
- Efl_Animation *parallel_hide_anim;
- Efl_Animation_Object *anim_obj;
+ Efl_Canvas_Animation *parallel_show_anim;
+ Efl_Canvas_Animation *parallel_hide_anim;
+ Efl_Canvas_Animation_Player *anim_obj;
Eina_Bool is_btn_visible;
} App_Data;
@@ -19,20 +19,17 @@ _anim_started_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
}
static void
-_anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED)
+_anim_ended_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
{
- App_Data *ad = data;
-
printf("Animation has been ended!\n");
- ad->anim_obj = NULL;
}
static void
_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event)
{
- Efl_Animation_Object_Running_Event_Info *event_info = event->info;
- double progress = event_info->progress;
+ Efl_Canvas_Animation_Player_Event_Running *event_running = event->info;
+ double progress = event_running->progress;
printf("Animation is running! Current progress(%lf)\n", progress);
}
@@ -41,35 +38,23 @@ _btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
{
App_Data *ad = data;
- if (ad->anim_obj)
- efl_animation_object_cancel(ad->anim_obj);
-
ad->is_btn_visible = !(ad->is_btn_visible);
if (ad->is_btn_visible)
{
//Create Animation Object from Animation
- ad->anim_obj = efl_animation_object_create(ad->parallel_show_anim);
- elm_object_text_set(obj, "Start Parallel Group Animation to hide button");
+ efl_animation_player_animation_set(ad->anim_obj, ad->parallel_show_anim);
+ efl_text_set(obj, "Start Parallel Group Animation to hide button");
}
else
{
//Create Animation Object from Animation
- ad->anim_obj = efl_animation_object_create(ad->parallel_hide_anim);
- elm_object_text_set(obj, "Start Parallel Group Animation to show button");
+ efl_animation_player_animation_set(ad->anim_obj, ad->parallel_hide_anim);
+ efl_text_set(obj, "Start Parallel Group Animation to show button");
}
- //Register callback called when animation starts
- efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_STARTED, _anim_started_cb, NULL);
-
- //Register callback called when animation ends
- efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_ENDED, _anim_ended_cb, ad);
-
- //Register callback called while animation is executed
- efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_RUNNING, _anim_running_cb, NULL);
-
//Let Animation Object start animation
- efl_animation_object_start(ad->anim_obj);
+ efl_player_start(ad->anim_obj);
}
static void
@@ -100,21 +85,20 @@ test_efl_anim_group_parallel(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE
//Show Animation
- Efl_Animation *show_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL);
+ Efl_Canvas_Animation *show_anim = efl_add(EFL_CANVAS_ANIMATION_ALPHA_CLASS, win);
efl_animation_alpha_set(show_anim, 0.0, 1.0);
//Rotate from 45 to 0 degrees Animation
- Efl_Animation *ccw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL);
+ Efl_Canvas_Animation *ccw_45_degrees_anim = efl_add(EFL_CANVAS_ANIMATION_ROTATE_CLASS, win);
efl_animation_rotate_set(ccw_45_degrees_anim, 45.0, 0.0, NULL, 0.5, 0.5);
//Scale Animation to zoom out
- Efl_Animation *scale_half_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL);
+ Efl_Canvas_Animation *scale_half_anim = efl_add(EFL_CANVAS_ANIMATION_SCALE_CLASS, win);
efl_animation_scale_set(scale_half_anim, 2.0, 2.0, 1.0, 1.0, NULL, 0.5, 0.5);
//Show Parallel Group Animation
- Efl_Animation *parallel_show_anim = efl_add(EFL_ANIMATION_GROUP_PARALLEL_CLASS, NULL);
+ Efl_Canvas_Animation *parallel_show_anim = efl_add(EFL_CANVAS_ANIMATION_GROUP_PARALLEL_CLASS, win);
efl_animation_duration_set(parallel_show_anim, 1.0);
- efl_animation_target_set(parallel_show_anim, btn);
efl_animation_final_state_keep_set(parallel_show_anim, EINA_TRUE);
//Add animations to group animation
@@ -124,21 +108,20 @@ test_efl_anim_group_parallel(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE
//Hide Animation
- Efl_Animation *hide_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL);
+ Efl_Canvas_Animation *hide_anim = efl_add(EFL_CANVAS_ANIMATION_ALPHA_CLASS, win);
efl_animation_alpha_set(hide_anim, 1.0, 0.0);
//Rotate from 0 to 45 degrees Animation
- Efl_Animation *cw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL);
+ Efl_Canvas_Animation *cw_45_degrees_anim = efl_add(EFL_CANVAS_ANIMATION_ROTATE_CLASS, win);
efl_animation_rotate_set(cw_45_degrees_anim, 0.0, 45.0, NULL, 0.5, 0.5);
//Scale Animation to zoom in
- Efl_Animation *scale_double_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL);
+ Efl_Canvas_Animation *scale_double_anim = efl_add(EFL_CANVAS_ANIMATION_SCALE_CLASS, win);
efl_animation_scale_set(scale_double_anim, 1.0, 1.0, 2.0, 2.0, NULL, 0.5, 0.5);
//Hide Parallel Group Animation
- Efl_Animation *parallel_hide_anim = efl_add(EFL_ANIMATION_GROUP_PARALLEL_CLASS, NULL);
+ Efl_Canvas_Animation *parallel_hide_anim = efl_add(EFL_CANVAS_ANIMATION_GROUP_PARALLEL_CLASS, win);
efl_animation_duration_set(parallel_hide_anim, 1.0);
- efl_animation_target_set(parallel_hide_anim, btn);
efl_animation_final_state_keep_set(parallel_hide_anim, EINA_TRUE);
//Add animations to group animation
@@ -150,7 +133,16 @@ test_efl_anim_group_parallel(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE
//Initialize App Data
ad->parallel_show_anim = parallel_show_anim;
ad->parallel_hide_anim = parallel_hide_anim;
- ad->anim_obj = NULL;
+ ad->anim_obj = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, win,
+ efl_animation_player_target_set(efl_added, btn));
+
+ //Register callback called when animation starts
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
+ //Register callback called when animation ends
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, NULL);
+ //Register callback called while animation is executed
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
+
ad->is_btn_visible = EINA_TRUE;
//Button to start animation
diff --git a/src/bin/elementary/test_efl_anim_group_sequential.c b/src/bin/elementary/test_efl_anim_group_sequential.c
index 219cd6df29..655c37c571 100644
--- a/src/bin/elementary/test_efl_anim_group_sequential.c
+++ b/src/bin/elementary/test_efl_anim_group_sequential.c
@@ -5,9 +5,9 @@
typedef struct _App_Data
{
- Efl_Animation *sequential_show_anim;
- Efl_Animation *sequential_hide_anim;
- Efl_Animation_Object *anim_obj;
+ Efl_Canvas_Animation *sequential_show_anim;
+ Efl_Canvas_Animation *sequential_hide_anim;
+ Efl_Canvas_Animation_Player *anim_obj;
Eina_Bool is_btn_visible;
} App_Data;
@@ -19,20 +19,16 @@ _anim_started_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
}
static void
-_anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED)
+_anim_ended_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
{
- App_Data *ad = data;
-
printf("Animation has been ended!\n");
-
- ad->anim_obj = NULL;
}
static void
_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event)
{
- Efl_Animation_Object_Running_Event_Info *event_info = event->info;
- double progress = event_info->progress;
+ Efl_Canvas_Animation_Player_Event_Running *event_running = event->info;
+ double progress = event_running->progress;
printf("Animation is running! Current progress(%lf)\n", progress);
}
@@ -41,35 +37,23 @@ _btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
{
App_Data *ad = data;
- if (ad->anim_obj)
- efl_animation_object_cancel(ad->anim_obj);
-
ad->is_btn_visible = !(ad->is_btn_visible);
if (ad->is_btn_visible)
{
//Create Animation Object from Animation
- ad->anim_obj = efl_animation_object_create(ad->sequential_show_anim);
- elm_object_text_set(obj, "Start Sequential Group Animation to hide button");
+ efl_animation_player_animation_set(ad->anim_obj, ad->sequential_show_anim);
+ efl_text_set(obj, "Start Sequential Group Animation to hide button");
}
else
{
//Create Animation Object from Animation
- ad->anim_obj = efl_animation_object_create(ad->sequential_hide_anim);
- elm_object_text_set(obj, "Start Sequential Group Animation to show button");
+ efl_animation_player_animation_set(ad->anim_obj, ad->sequential_hide_anim);
+ efl_text_set(obj, "Start Sequential Group Animation to show button");
}
- //Register callback called when animation starts
- efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_STARTED, _anim_started_cb, NULL);
-
- //Register callback called when animation ends
- efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_ENDED, _anim_ended_cb, ad);
-
- //Register callback called while animation is executed
- efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_RUNNING, _anim_running_cb, NULL);
-
//Let Animation Object start animation
- efl_animation_object_start(ad->anim_obj);
+ efl_player_start(ad->anim_obj);
}
static void
@@ -101,21 +85,20 @@ test_efl_anim_group_sequential(void *data EINA_UNUSED, Evas_Object *obj EINA_UNU
/* Animations to hide button */
//Rotate from 0 to 45 degrees Animation
- Efl_Animation *cw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL);
+ Efl_Canvas_Animation *cw_45_degrees_anim = efl_add(EFL_CANVAS_ANIMATION_ROTATE_CLASS, win);
efl_animation_rotate_set(cw_45_degrees_anim, 0.0, 45.0, NULL, 0.5, 0.5);
//Scale Animation to zoom in
- Efl_Animation *scale_double_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL);
+ Efl_Canvas_Animation *scale_double_anim = efl_add(EFL_CANVAS_ANIMATION_SCALE_CLASS, win);
efl_animation_scale_set(scale_double_anim, 1.0, 1.0, 2.0, 2.0, NULL, 0.5, 0.5);
//Hide Animation
- Efl_Animation *hide_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL);
+ Efl_Canvas_Animation *hide_anim = efl_add(EFL_CANVAS_ANIMATION_ALPHA_CLASS, win);
efl_animation_alpha_set(hide_anim, 1.0, 0.0);
//Hide Sequential Group Animation
- Efl_Animation *sequential_hide_anim = efl_add(EFL_ANIMATION_GROUP_SEQUENTIAL_CLASS, NULL);
+ Efl_Canvas_Animation *sequential_hide_anim = efl_add(EFL_CANVAS_ANIMATION_GROUP_SEQUENTIAL_CLASS, win);
efl_animation_duration_set(sequential_hide_anim, 1.0);
- efl_animation_target_set(sequential_hide_anim, btn);
efl_animation_final_state_keep_set(sequential_hide_anim, EINA_TRUE);
//Add animations to group animation
@@ -124,51 +107,29 @@ test_efl_anim_group_sequential(void *data EINA_UNUSED, Evas_Object *obj EINA_UNU
efl_animation_group_animation_add(sequential_hide_anim, hide_anim);
- /* Animations of initial state to show button */
- //Rotate from 0 to 45 degrees Animation
- Efl_Animation *cw_45_degrees_anim2 = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL);
- efl_animation_rotate_set(cw_45_degrees_anim2, 0.0, 45.0, NULL, 0.5, 0.5);
-
- //Scale Animation to zoom in
- Efl_Animation *scale_double_anim2 = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL);
- efl_animation_scale_set(scale_double_anim2, 1.0, 1.0, 2.0, 2.0, NULL, 0.5, 0.5);
-
- //Hide Parallel Group Animation
- Efl_Animation *parallel_hide_anim = efl_add(EFL_ANIMATION_GROUP_PARALLEL_CLASS, NULL);
- efl_animation_duration_set(parallel_hide_anim, 0.0);
- efl_animation_target_set(parallel_hide_anim, btn);
- efl_animation_final_state_keep_set(parallel_hide_anim, EINA_TRUE);
-
- //Add animations to group animation
- efl_animation_group_animation_add(parallel_hide_anim, cw_45_degrees_anim2);
- efl_animation_group_animation_add(parallel_hide_anim, scale_double_anim2);
-
-
/* Animations to show button */
//Show Animation
- Efl_Animation *show_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL);
+ Efl_Canvas_Animation *show_anim = efl_add(EFL_CANVAS_ANIMATION_ALPHA_CLASS, win);
efl_animation_alpha_set(show_anim, 0.0, 1.0);
efl_animation_duration_set(show_anim, 1.0);
//Scale Animation to zoom out
- Efl_Animation *scale_half_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL);
- efl_animation_scale_set(scale_half_anim, 1.0, 1.0, 0.5, 0.5, NULL, 0.5, 0.5);
+ Efl_Canvas_Animation *scale_half_anim = efl_add(EFL_CANVAS_ANIMATION_SCALE_CLASS, win);
+ efl_animation_scale_set(scale_half_anim, 2.0, 2.0, 1.0, 1.0, NULL, 0.5, 0.5);
efl_animation_duration_set(scale_half_anim, 1.0);
//Rotate from 45 to 0 degrees Animation
- Efl_Animation *ccw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL);
- efl_animation_rotate_set(ccw_45_degrees_anim, 0.0, -45.0, NULL, 0.5, 0.5);
+ Efl_Canvas_Animation *ccw_45_degrees_anim = efl_add(EFL_CANVAS_ANIMATION_ROTATE_CLASS, win);
+ efl_animation_rotate_set(ccw_45_degrees_anim, 45.0, 0.0, NULL, 0.5, 0.5);
efl_animation_duration_set(ccw_45_degrees_anim, 1.0);
//Show Sequential Group Animation
- Efl_Animation *sequential_show_anim = efl_add(EFL_ANIMATION_GROUP_SEQUENTIAL_CLASS, NULL);
- efl_animation_target_set(sequential_show_anim, btn);
+ Efl_Canvas_Animation *sequential_show_anim = efl_add(EFL_CANVAS_ANIMATION_GROUP_SEQUENTIAL_CLASS, win);
efl_animation_final_state_keep_set(sequential_show_anim, EINA_TRUE);
//efl_animation_duration_set() is called for each animation not to set the same duration
//Add animations to group animation
//First, parallel_hide_anim is added with duration 0 to set the initial state
- efl_animation_group_animation_add(sequential_show_anim, parallel_hide_anim);
efl_animation_group_animation_add(sequential_show_anim, show_anim);
efl_animation_group_animation_add(sequential_show_anim, scale_half_anim);
efl_animation_group_animation_add(sequential_show_anim, ccw_45_degrees_anim);
@@ -177,7 +138,16 @@ test_efl_anim_group_sequential(void *data EINA_UNUSED, Evas_Object *obj EINA_UNU
//Initialize App Data
ad->sequential_show_anim = sequential_show_anim;
ad->sequential_hide_anim = sequential_hide_anim;
- ad->anim_obj = NULL;
+ ad->anim_obj = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, win,
+ efl_animation_player_target_set(efl_added, btn));
+
+ //Register callback called when animation starts
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
+ //Register callback called when animation ends
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, NULL);
+ //Register callback called while animation is executed
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
+
ad->is_btn_visible = EINA_TRUE;
//Button to start animation
diff --git a/src/bin/elementary/test_efl_anim_interpolator.c b/src/bin/elementary/test_efl_anim_interpolator.c
index 732d217e43..66e9004fb7 100644
--- a/src/bin/elementary/test_efl_anim_interpolator.c
+++ b/src/bin/elementary/test_efl_anim_interpolator.c
@@ -12,8 +12,8 @@
typedef struct _App_Data
{
- Efl_Animation *anim[INTERP_NUM];
- Efl_Animation_Object *anim_obj[INTERP_NUM];
+ Efl_Canvas_Animation *anim[INTERP_NUM];
+ Efl_Canvas_Animation_Player *anim_obj[INTERP_NUM];
Evas_Object *btn[INTERP_NUM];
Evas_Object *start_all_btn;
@@ -22,42 +22,42 @@ typedef struct _App_Data
} App_Data;
static Efl_Interpolator *
-_interpolator_create(int index)
+_interpolator_create(int index, Evas_Object *win)
{
Efl_Interpolator *interp = NULL;
if (index == 0)
{
- interp = efl_add(EFL_INTERPOLATOR_LINEAR_CLASS, NULL);
+ interp = efl_add(EFL_INTERPOLATOR_LINEAR_CLASS, win);
}
else if (index == 1)
{
- interp = efl_add(EFL_INTERPOLATOR_SINUSOIDAL_CLASS, NULL);
+ interp = efl_add(EFL_INTERPOLATOR_SINUSOIDAL_CLASS, win);
efl_interpolator_sinusoidal_factor_set(interp, 1.0);
}
else if (index == 2)
{
- interp = efl_add(EFL_INTERPOLATOR_DECELERATE_CLASS, NULL);
+ interp = efl_add(EFL_INTERPOLATOR_DECELERATE_CLASS, win);
efl_interpolator_decelerate_factor_set(interp, 1.0);
}
else if (index == 3)
{
- interp = efl_add(EFL_INTERPOLATOR_ACCELERATE_CLASS, NULL);
+ interp = efl_add(EFL_INTERPOLATOR_ACCELERATE_CLASS, win);
efl_interpolator_accelerate_factor_set(interp, 1.0);
}
else if (index == 4)
{
- interp = efl_add(EFL_INTERPOLATOR_DIVISOR_CLASS, NULL);
+ interp = efl_add(EFL_INTERPOLATOR_DIVISOR_CLASS, win);
efl_interpolator_divisor_factors_set(interp, 1.0, 1.0);
}
else if (index == 5)
{
- interp = efl_add(EFL_INTERPOLATOR_BOUNCE_CLASS, NULL);
+ interp = efl_add(EFL_INTERPOLATOR_BOUNCE_CLASS, win);
efl_interpolator_bounce_factors_set(interp, 1.0, 1.0);
}
else if (index == 6)
{
- interp = efl_add(EFL_INTERPOLATOR_SPRING_CLASS, NULL);
+ interp = efl_add(EFL_INTERPOLATOR_SPRING_CLASS, win);
efl_interpolator_spring_factors_set(interp, 1.0, 1.0);
}
@@ -88,7 +88,6 @@ _anim_ended_cb(void *data, const Efl_Event *event)
{
if (ad->anim_obj[i] == event->object)
{
- ad->anim_obj[i] = NULL;
elm_object_disabled_set(ad->btn[i], EINA_FALSE);
break;
}
@@ -101,8 +100,8 @@ _anim_ended_cb(void *data, const Efl_Event *event)
static void
_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event)
{
- Efl_Animation_Object_Running_Event_Info *event_info = event->info;
- double progress = event_info->progress;
+ Efl_Canvas_Animation_Player_Event_Running *event_running = event->info;
+ double progress = event_running->progress;
printf("Animation is running! Current progress(%lf)\n", progress);
}
@@ -113,21 +112,8 @@ _anim_start(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
int index = (uintptr_t)evas_object_data_get(obj, "index");
- //Create Animation Object from Animation
- Efl_Animation_Object *anim_obj = efl_animation_object_create(ad->anim[index]);
- ad->anim_obj[index] = anim_obj;
-
- //Register callback called when animation starts
- efl_event_callback_add(anim_obj, EFL_ANIMATION_OBJECT_EVENT_STARTED, _anim_started_cb, ad);
-
- //Register callback called when animation ends
- efl_event_callback_add(anim_obj, EFL_ANIMATION_OBJECT_EVENT_ENDED, _anim_ended_cb, ad);
-
- //Register callback called while animation is executed
- efl_event_callback_add(anim_obj, EFL_ANIMATION_OBJECT_EVENT_RUNNING, _anim_running_cb, NULL);
-
//Let Animation Object start animation
- efl_animation_object_start(anim_obj);
+ efl_player_start(ad->anim_obj[index]);
elm_object_disabled_set(obj, EINA_TRUE);
elm_object_disabled_set(ad->start_all_btn, EINA_TRUE);
@@ -141,22 +127,8 @@ _anim_start_all(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
int i;
for (i = 0; i < INTERP_NUM; i++)
{
- //Create Animation Object from Animation
- Efl_Animation_Object *anim_obj = efl_animation_object_create(ad->anim[i]);
- ad->anim_obj[i] = anim_obj;
-
- //Register callback called when animation starts
- efl_event_callback_add(anim_obj, EFL_ANIMATION_OBJECT_EVENT_STARTED, _anim_started_cb, ad);
-
- //Register callback called when animation ends
- efl_event_callback_add(anim_obj, EFL_ANIMATION_OBJECT_EVENT_ENDED, _anim_ended_cb, ad);
-
- //Register callback called while animation is executed
- efl_event_callback_add(anim_obj, EFL_ANIMATION_OBJECT_EVENT_RUNNING, _anim_running_cb, NULL);
-
//Let Animation Object start animation
- efl_animation_object_start(anim_obj);
-
+ efl_player_start(ad->anim_obj[i]);
elm_object_disabled_set(ad->btn[i], EINA_TRUE);
}
@@ -212,14 +184,29 @@ test_efl_anim_interpolator(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
evas_object_smart_callback_add(btn, "clicked", _anim_start, ad);
ad->btn[i] = btn;
- Efl_Animation *anim = efl_add(EFL_ANIMATION_TRANSLATE_CLASS, NULL);
+ Efl_Canvas_Animation *anim = efl_add(EFL_CANVAS_ANIMATION_TRANSLATE_CLASS, win);
efl_animation_translate_set(anim, 0, 0, (WIN_W - BTN_W), 0);
efl_animation_duration_set(anim, 2.0);
- efl_animation_target_set(anim, btn);
+ efl_animation_final_state_keep_set(anim, EINA_FALSE);
- Efl_Interpolator *interp = _interpolator_create(i);
+ Efl_Interpolator *interp = _interpolator_create(i, win);
efl_animation_interpolator_set(anim, interp);
ad->anim[i] = anim;
+
+ //Create Animation Object from Animation
+ Efl_Canvas_Animation_Player *anim_obj = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, win,
+ efl_animation_player_animation_set(efl_added, anim),
+ efl_animation_player_target_set(efl_added, btn));
+ ad->anim_obj[i] = anim_obj;
+
+ //Register callback called when animation starts
+ efl_event_callback_add(anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, ad);
+
+ //Register callback called when animation ends
+ efl_event_callback_add(anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, ad);
+
+ //Register callback called while animation is executed
+ efl_event_callback_add(anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
}
ad->running_anim_cnt = 0;
diff --git a/src/bin/elementary/test_efl_anim_pause.c b/src/bin/elementary/test_efl_anim_pause.c
index 9ca97430d4..c73b7bcf6c 100644
--- a/src/bin/elementary/test_efl_anim_pause.c
+++ b/src/bin/elementary/test_efl_anim_pause.c
@@ -5,9 +5,9 @@
typedef struct _App_Data
{
- Efl_Animation *show_anim;
- Efl_Animation *hide_anim;
- Efl_Animation_Object *anim_obj;
+ Efl_Canvas_Animation *show_anim;
+ Efl_Canvas_Animation *hide_anim;
+ Efl_Canvas_Animation_Player *anim_obj;
Evas_Object *pause_btn;
@@ -33,15 +33,13 @@ _anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED)
printf("Animation has been ended!\n");
elm_object_disabled_set(ad->pause_btn, EINA_TRUE);
-
- ad->anim_obj = NULL;
}
static void
_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event)
{
- Efl_Animation_Object_Running_Event_Info *event_info = event->info;
- double progress = event_info->progress;
+ Efl_Canvas_Animation_Player_Event_Running *event_running = event->info;
+ double progress = event_running->progress;
printf("Animation is running! Current progress(%lf)\n", progress);
}
@@ -54,8 +52,6 @@ _start_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED
{
ad->is_anim_paused = EINA_FALSE;
elm_object_text_set(ad->pause_btn, "Pause Animation");
-
- efl_animation_object_cancel(ad->anim_obj);
}
ad->is_btn_visible = !(ad->is_btn_visible);
@@ -63,27 +59,17 @@ _start_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED
if (ad->is_btn_visible)
{
//Create Animation Object from Animation
- ad->anim_obj = efl_animation_object_create(ad->show_anim);
- elm_object_text_set(obj, "Start Alpha Animation from 1.0 to 0.0");
+ efl_animation_player_animation_set(ad->anim_obj, ad->show_anim);
+ efl_text_set(obj, "Start Alpha Animation from 1.0 to 0.0");
}
else
{
//Create Animation Object from Animation
- ad->anim_obj = efl_animation_object_create(ad->hide_anim);
- elm_object_text_set(obj, "Start Alpha Animation from 0.0 to 1.0");
+ efl_animation_player_animation_set(ad->anim_obj, ad->hide_anim);
+ efl_text_set(obj, "Start Alpha Animation from 0.0 to 1.0");
}
-
- //Register callback called when animation starts
- efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_STARTED, _anim_started_cb, ad);
-
- //Register callback called when animation ends
- efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_ENDED, _anim_ended_cb, ad);
-
- //Register callback called while animation is executed
- efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_RUNNING, _anim_running_cb, NULL);
-
//Let Animation Object start animation
- efl_animation_object_start(ad->anim_obj);
+ efl_player_start(ad->anim_obj);
}
static void
@@ -96,13 +82,13 @@ _pause_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED
if (ad->is_anim_paused)
{
//Pause animation
- efl_animation_object_pause(ad->anim_obj);
+ efl_player_play_set(ad->anim_obj, EINA_FALSE);
elm_object_text_set(obj, "Resume Animation");
}
else
{
//Resume animation
- efl_animation_object_resume(ad->anim_obj);
+ efl_player_play_set(ad->anim_obj, EINA_TRUE);
elm_object_text_set(obj, "Pause Animation");
}
}
@@ -134,17 +120,15 @@ test_efl_anim_pause(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *
evas_object_show(btn);
//Show Animation
- Efl_Animation *show_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL);
+ Efl_Canvas_Animation *show_anim = efl_add(EFL_CANVAS_ANIMATION_ALPHA_CLASS, win);
efl_animation_alpha_set(show_anim, 0.0, 1.0);
efl_animation_duration_set(show_anim, 2.0);
- efl_animation_target_set(show_anim, btn);
efl_animation_final_state_keep_set(show_anim, EINA_TRUE);
//Hide Animation
- Efl_Animation *hide_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL);
+ Efl_Canvas_Animation *hide_anim = efl_add(EFL_CANVAS_ANIMATION_ALPHA_CLASS, win);
efl_animation_alpha_set(hide_anim, 1.0, 0.0);
efl_animation_duration_set(hide_anim, 2.0);
- efl_animation_target_set(hide_anim, btn);
efl_animation_final_state_keep_set(hide_anim, EINA_TRUE);
@@ -172,7 +156,16 @@ test_efl_anim_pause(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *
//Initialize App Data
ad->show_anim = show_anim;
ad->hide_anim = hide_anim;
- ad->anim_obj = NULL;
+ ad->anim_obj = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, win,
+ efl_animation_player_target_set(efl_added, btn));
+
+ //Register callback called when animation starts
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, ad);
+ //Register callback called when animation ends
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, ad);
+ //Register callback called while animation is executed
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
+
ad->pause_btn = pause_btn;
ad->is_btn_visible = EINA_TRUE;
ad->is_anim_paused = EINA_FALSE;
diff --git a/src/bin/elementary/test_efl_anim_repeat.c b/src/bin/elementary/test_efl_anim_repeat.c
index b5f7ac3ce1..50df2035c8 100644
--- a/src/bin/elementary/test_efl_anim_repeat.c
+++ b/src/bin/elementary/test_efl_anim_repeat.c
@@ -5,9 +5,9 @@
typedef struct _App_Data
{
- Efl_Animation *show_anim;
- Efl_Animation *hide_anim;
- Efl_Animation_Object *anim_obj;
+ Efl_Canvas_Animation *show_anim;
+ Efl_Canvas_Animation *hide_anim;
+ Efl_Canvas_Animation_Player *anim_obj;
Evas_Object *start_btn;
Evas_Object *repeat_count_spin;
@@ -16,15 +16,15 @@ typedef struct _App_Data
Eina_Bool is_btn_visible;
} App_Data;
-Efl_Animation_Repeat_Mode
+Efl_Canvas_Animation_Repeat_Mode
_anim_repeat_mode_get(Evas_Object *spinner)
{
int value = elm_spinner_value_get(spinner);
if (value == 0)
- return EFL_ANIMATION_REPEAT_MODE_RESTART;
+ return EFL_CANVAS_ANIMATION_REPEAT_MODE_RESTART;
else
- return EFL_ANIMATION_REPEAT_MODE_REVERSE;
+ return EFL_CANVAS_ANIMATION_REPEAT_MODE_REVERSE;
}
static void
@@ -40,8 +40,8 @@ _anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED)
printf("Animation has been ended!\n");
- Efl_Animation_Repeat_Mode repeat_mode = _anim_repeat_mode_get(ad->repeat_mode_spin);
- if (repeat_mode == EFL_ANIMATION_REPEAT_MODE_REVERSE)
+ Efl_Canvas_Animation_Repeat_Mode repeat_mode = _anim_repeat_mode_get(ad->repeat_mode_spin);
+ if (repeat_mode == EFL_CANVAS_ANIMATION_REPEAT_MODE_REVERSE)
{
int repeat_count = elm_spinner_value_get(ad->repeat_count_spin);
if (repeat_count % 2 == 1)
@@ -57,15 +57,13 @@ _anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED)
elm_object_disabled_set(ad->repeat_count_spin, EINA_FALSE);
elm_object_disabled_set(ad->repeat_mode_spin, EINA_FALSE);
-
- ad->anim_obj = NULL;
}
static void
_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event)
{
- Efl_Animation_Object_Running_Event_Info *event_info = event->info;
- double progress = event_info->progress;
+ Efl_Canvas_Animation_Player_Event_Running *event_running = event->info;
+ double progress = event_running->progress;
printf("Animation is running! Current progress(%lf)\n", progress);
}
@@ -74,15 +72,12 @@ _start_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED
{
App_Data *ad = data;
- if (ad->anim_obj)
- efl_animation_object_cancel(ad->anim_obj);
-
ad->is_btn_visible = !(ad->is_btn_visible);
int repeat_count = elm_spinner_value_get(ad->repeat_count_spin);
elm_object_disabled_set(ad->repeat_count_spin, EINA_TRUE);
- Efl_Animation_Repeat_Mode repeat_mode = _anim_repeat_mode_get(ad->repeat_mode_spin);
+ Efl_Canvas_Animation_Repeat_Mode repeat_mode = _anim_repeat_mode_get(ad->repeat_mode_spin);
elm_object_disabled_set(ad->repeat_mode_spin, EINA_TRUE);
if (ad->is_btn_visible)
@@ -94,8 +89,8 @@ _start_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED
efl_animation_repeat_mode_set(ad->show_anim, repeat_mode);
//Create Animation Object from Animation
- ad->anim_obj = efl_animation_object_create(ad->show_anim);
- elm_object_text_set(obj, "Start Alpha Animation from 1.0 to 0.0");
+ efl_animation_player_animation_set(ad->anim_obj, ad->show_anim);
+ efl_text_set(obj, "Start Alpha Animation from 1.0 to 0.0");
}
else
{
@@ -106,21 +101,12 @@ _start_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED
efl_animation_repeat_mode_set(ad->hide_anim, repeat_mode);
//Create Animation Object from Animation
- ad->anim_obj = efl_animation_object_create(ad->hide_anim);
- elm_object_text_set(obj, "Start Alpha Animation from 0.0 to 1.0");
+ efl_animation_player_animation_set(ad->anim_obj, ad->hide_anim);
+ efl_text_set(obj, "Start Alpha Animation from 0.0 to 1.0");
}
- //Register callback called when animation starts
- efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_STARTED, _anim_started_cb, NULL);
-
- //Register callback called when animation ends
- efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_ENDED, _anim_ended_cb, ad);
-
- //Register callback called while animation is executed
- efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_RUNNING, _anim_running_cb, NULL);
-
//Let Animation Object start animation
- efl_animation_object_start(ad->anim_obj);
+ efl_player_start(ad->anim_obj);
}
static void
@@ -150,17 +136,15 @@ test_efl_anim_repeat(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
evas_object_show(btn);
//Show Animation
- Efl_Animation *show_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL);
+ Efl_Canvas_Animation *show_anim = efl_add(EFL_CANVAS_ANIMATION_ALPHA_CLASS, win);
efl_animation_alpha_set(show_anim, 0.0, 1.0);
efl_animation_duration_set(show_anim, 1.0);
- efl_animation_target_set(show_anim, btn);
efl_animation_final_state_keep_set(show_anim, EINA_TRUE);
//Hide Animation
- Efl_Animation *hide_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL);
+ Efl_Canvas_Animation *hide_anim = efl_add(EFL_CANVAS_ANIMATION_ALPHA_CLASS, win);
efl_animation_alpha_set(hide_anim, 1.0, 0.0);
efl_animation_duration_set(hide_anim, 1.0);
- efl_animation_target_set(hide_anim, btn);
efl_animation_final_state_keep_set(hide_anim, EINA_TRUE);
@@ -199,7 +183,15 @@ test_efl_anim_repeat(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
//Initialize App Data
ad->show_anim = show_anim;
ad->hide_anim = hide_anim;
- ad->anim_obj = NULL;
+ ad->anim_obj = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, win,
+ efl_animation_player_target_set(efl_added, btn));
+ //Register callback called when animation starts
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
+ //Register callback called when animation ends
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, ad);
+ //Register callback called while animation is executed
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
+
ad->start_btn = start_btn;
ad->repeat_count_spin = repeat_count_spin;
ad->repeat_mode_spin = repeat_mode_spin;
diff --git a/src/bin/elementary/test_efl_anim_rotate.c b/src/bin/elementary/test_efl_anim_rotate.c
index 7fda359375..454ca0f262 100644
--- a/src/bin/elementary/test_efl_anim_rotate.c
+++ b/src/bin/elementary/test_efl_anim_rotate.c
@@ -5,9 +5,9 @@
typedef struct _App_Data
{
- Efl_Animation *cw_45_degrees_anim;
- Efl_Animation *ccw_45_degrees_anim;
- Efl_Animation_Object *anim_obj;
+ Efl_Canvas_Animation *cw_45_degrees_anim;
+ Efl_Canvas_Animation *ccw_45_degrees_anim;
+ Efl_Canvas_Animation_Player *anim_obj;
Eina_Bool is_btn_rotated;
} App_Data;
@@ -19,20 +19,16 @@ _anim_started_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
}
static void
-_anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED)
+_anim_ended_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
{
- App_Data *ad = data;
-
printf("Animation has been ended!\n");
-
- ad->anim_obj = NULL;
}
static void
_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event)
{
- Efl_Animation_Object_Running_Event_Info *event_info = event->info;
- double progress = event_info->progress;
+ Efl_Canvas_Animation_Player_Event_Running *event_running = event->info;
+ double progress = event_running->progress;
printf("Animation is running! Current progress(%lf)\n", progress);
}
@@ -41,35 +37,23 @@ _btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
{
App_Data *ad = data;
- if (ad->anim_obj)
- efl_animation_object_cancel(ad->anim_obj);
-
ad->is_btn_rotated = !(ad->is_btn_rotated);
if (ad->is_btn_rotated)
{
//Create Animation Object from Animation
- ad->anim_obj = efl_animation_object_create(ad->cw_45_degrees_anim);
- elm_object_text_set(obj, "Start Rotate Animation from 45 to 0 degrees");
+ efl_animation_player_animation_set(ad->anim_obj, ad->cw_45_degrees_anim);
+ efl_text_set(obj, "Start Rotate Animation from 45 to 0 degrees");
}
else
{
//Create Animation Object from Animation
- ad->anim_obj = efl_animation_object_create(ad->ccw_45_degrees_anim);
- elm_object_text_set(obj, "Start Rotate Animation from 0 to 45 degrees");
+ efl_animation_player_animation_set(ad->anim_obj, ad->ccw_45_degrees_anim);
+ efl_text_set(obj, "Start Rotate Animation from 0 to 45 degrees");
}
- //Register callback called when animation starts
- efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_STARTED, _anim_started_cb, NULL);
-
- //Register callback called when animation ends
- efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_ENDED, _anim_ended_cb, ad);
-
- //Register callback called while animation is executed
- efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_RUNNING, _anim_running_cb, NULL);
-
//Let Animation Object start animation
- efl_animation_object_start(ad->anim_obj);
+ efl_player_start(ad->anim_obj);
}
static void
@@ -99,23 +83,30 @@ test_efl_anim_rotate(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
evas_object_show(btn);
//Rotate from 0 to 45 degrees Animation
- Efl_Animation *cw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL);
- efl_animation_rotate_set(cw_45_degrees_anim, 0.0, 45.0, NULL, 0.5, 0.5);
+ Efl_Canvas_Animation *cw_45_degrees_anim = efl_add(EFL_CANVAS_ANIMATION_ROTATE_CLASS, win);
+ efl_animation_rotate_set(cw_45_degrees_anim, 0.0, 45.0,NULL, 0.5, 0.5);
efl_animation_duration_set(cw_45_degrees_anim, 1.0);
- efl_animation_target_set(cw_45_degrees_anim, btn);
efl_animation_final_state_keep_set(cw_45_degrees_anim, EINA_TRUE);
//Rotate from 45 to 0 degrees Animation
- Efl_Animation *ccw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL);
+ Efl_Canvas_Animation *ccw_45_degrees_anim = efl_add(EFL_CANVAS_ANIMATION_ROTATE_CLASS, win);
efl_animation_rotate_set(ccw_45_degrees_anim, 45.0, 0.0, NULL, 0.5, 0.5);
efl_animation_duration_set(ccw_45_degrees_anim, 1.0);
- efl_animation_target_set(ccw_45_degrees_anim, btn);
efl_animation_final_state_keep_set(ccw_45_degrees_anim, EINA_TRUE);
//Initialize App Data
ad->cw_45_degrees_anim = cw_45_degrees_anim;
ad->ccw_45_degrees_anim = ccw_45_degrees_anim;
- ad->anim_obj = NULL;
+
+ ad->anim_obj = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, win,
+ efl_animation_player_target_set(efl_added, btn));
+ //Register callback called when animation starts
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
+ //Register callback called when animation ends
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, NULL);
+ //Register callback called while animation is executed
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
+
ad->is_btn_rotated = EINA_FALSE;
//Button to start animation
@@ -159,23 +150,31 @@ test_efl_anim_rotate_relative(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUS
evas_object_show(pivot);
//Rotate from 0 to 45 degrees Animation
- Efl_Animation *cw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL);
+ Efl_Canvas_Animation *cw_45_degrees_anim = efl_add(EFL_CANVAS_ANIMATION_ROTATE_CLASS, win);
efl_animation_rotate_set(cw_45_degrees_anim, 0.0, 45.0, pivot, 0.5, 0.5);
efl_animation_duration_set(cw_45_degrees_anim, 1.0);
- efl_animation_target_set(cw_45_degrees_anim, btn);
efl_animation_final_state_keep_set(cw_45_degrees_anim, EINA_TRUE);
//Rotate from 45 to 0 degrees Animation
- Efl_Animation *ccw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL);
+ Efl_Canvas_Animation *ccw_45_degrees_anim = efl_add(EFL_CANVAS_ANIMATION_ROTATE_CLASS, win);
efl_animation_rotate_set(ccw_45_degrees_anim, 45.0, 0.0, pivot, 0.5, 0.5);
efl_animation_duration_set(ccw_45_degrees_anim, 1.0);
- efl_animation_target_set(ccw_45_degrees_anim, btn);
efl_animation_final_state_keep_set(ccw_45_degrees_anim, EINA_TRUE);
//Initialize App Data
ad->cw_45_degrees_anim = cw_45_degrees_anim;
ad->ccw_45_degrees_anim = ccw_45_degrees_anim;
- ad->anim_obj = NULL;
+ ad->anim_obj = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, win,
+ efl_animation_player_target_set(efl_added, btn));
+
+ //Register callback called when animation starts
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
+
+ //Register callback called when animation ends
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, NULL);
+
+ //Register callback called while animation is executed
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
ad->is_btn_rotated = EINA_FALSE;
//Button to start animation
@@ -219,23 +218,30 @@ test_efl_anim_rotate_absolute(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUS
evas_object_show(abs_center);
//Rotate from 0 to 45 degrees Animation
- Efl_Animation *cw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL);
+ Efl_Canvas_Animation *cw_45_degrees_anim = efl_add(EFL_CANVAS_ANIMATION_ROTATE_CLASS, win);
efl_animation_rotate_absolute_set(cw_45_degrees_anim, 0.0, 45.0, 0, 0);
efl_animation_duration_set(cw_45_degrees_anim, 1.0);
- efl_animation_target_set(cw_45_degrees_anim, btn);
efl_animation_final_state_keep_set(cw_45_degrees_anim, EINA_TRUE);
//Rotate from 45 to 0 degrees Animation
- Efl_Animation *ccw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL);
+ Efl_Canvas_Animation *ccw_45_degrees_anim = efl_add(EFL_CANVAS_ANIMATION_ROTATE_CLASS, win);
efl_animation_rotate_absolute_set(ccw_45_degrees_anim, 45.0, 0.0, 0, 0);
efl_animation_duration_set(ccw_45_degrees_anim, 1.0);
- efl_animation_target_set(ccw_45_degrees_anim, btn);
efl_animation_final_state_keep_set(ccw_45_degrees_anim, EINA_TRUE);
//Initialize App Data
ad->cw_45_degrees_anim = cw_45_degrees_anim;
ad->ccw_45_degrees_anim = ccw_45_degrees_anim;
- ad->anim_obj = NULL;
+ ad->anim_obj = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, win,
+ efl_animation_player_target_set(efl_added, btn));
+
+ //Register callback called when animation starts
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
+ //Register callback called when animation ends
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, NULL);
+ //Register callback called while animation is executed
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
+
ad->is_btn_rotated = EINA_FALSE;
//Button to start animation
diff --git a/src/bin/elementary/test_efl_anim_scale.c b/src/bin/elementary/test_efl_anim_scale.c
index 02ba39c922..bd380bd145 100644
--- a/src/bin/elementary/test_efl_anim_scale.c
+++ b/src/bin/elementary/test_efl_anim_scale.c
@@ -5,9 +5,9 @@
typedef struct _App_Data
{
- Efl_Animation *scale_double_anim;
- Efl_Animation *scale_half_anim;
- Efl_Animation_Object *anim_obj;
+ Efl_Canvas_Animation *scale_double_anim;
+ Efl_Canvas_Animation *scale_half_anim;
+ Efl_Canvas_Animation_Player *anim_obj;
Eina_Bool is_btn_scaled;
} App_Data;
@@ -19,20 +19,16 @@ _anim_started_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
}
static void
-_anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED)
+_anim_ended_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
{
- App_Data *ad = data;
-
printf("Animation has been ended!\n");
-
- ad->anim_obj = NULL;
}
static void
_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event)
{
- Efl_Animation_Object_Running_Event_Info *event_info = event->info;
- double progress = event_info->progress;
+ Efl_Canvas_Animation_Player_Event_Running *event_running = event->info;
+ double progress = event_running->progress;
printf("Animation is running! Current progress(%lf)\n", progress);
}
@@ -41,35 +37,23 @@ _btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
{
App_Data *ad = data;
- if (ad->anim_obj)
- efl_animation_object_cancel(ad->anim_obj);
-
ad->is_btn_scaled = !(ad->is_btn_scaled);
if (ad->is_btn_scaled)
{
//Create Animation Object from Animation
- ad->anim_obj = efl_animation_object_create(ad->scale_double_anim);
- elm_object_text_set(obj, "Start Scale Animation to zoom out");
+ efl_animation_player_animation_set(ad->anim_obj, ad->scale_double_anim);
+ efl_text_set(obj, "Start Scale Animation to zoom out");
}
else
{
//Create Animation Object from Animation
- ad->anim_obj = efl_animation_object_create(ad->scale_half_anim);
- elm_object_text_set(obj, "Start Scale Animation to zoom in");
+ efl_animation_player_animation_set(ad->anim_obj, ad->scale_half_anim);
+ efl_text_set(obj, "Start Scale Animation to zoom in");
}
- //Register callback called when animation starts
- efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_STARTED, _anim_started_cb, NULL);
-
- //Register callback called when animation ends
- efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_ENDED, _anim_ended_cb, ad);
-
- //Register callback called while animation is executed
- efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_RUNNING, _anim_running_cb, NULL);
-
//Let Animation Object start animation
- efl_animation_object_start(ad->anim_obj);
+ efl_player_start(ad->anim_obj);
}
static void
@@ -99,23 +83,32 @@ test_efl_anim_scale(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *
evas_object_show(btn);
//Scale Animation to zoom in
- Efl_Animation *scale_double_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL);
+ Efl_Canvas_Animation *scale_double_anim = efl_add(EFL_CANVAS_ANIMATION_SCALE_CLASS, win);
efl_animation_scale_set(scale_double_anim, 1.0, 1.0, 2.0, 2.0, NULL, 0.5, 0.5);
efl_animation_duration_set(scale_double_anim, 1.0);
- efl_animation_target_set(scale_double_anim, btn);
efl_animation_final_state_keep_set(scale_double_anim, EINA_TRUE);
//Scale Animation to zoom out
- Efl_Animation *scale_half_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL);
+ Efl_Canvas_Animation *scale_half_anim = efl_add(EFL_CANVAS_ANIMATION_SCALE_CLASS, win);
efl_animation_scale_set(scale_half_anim, 2.0, 2.0, 1.0, 1.0, NULL, 0.5, 0.5);
efl_animation_duration_set(scale_half_anim, 1.0);
- efl_animation_target_set(scale_half_anim, btn);
efl_animation_final_state_keep_set(scale_half_anim, EINA_TRUE);
//Initialize App Data
ad->scale_double_anim = scale_double_anim;
ad->scale_half_anim = scale_half_anim;
- ad->anim_obj = NULL;
+ ad->anim_obj = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, win,
+ efl_animation_player_target_set(efl_added, btn));
+
+ //Register callback called when animation starts
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
+
+ //Register callback called when animation ends
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, ad);
+
+ //Register callback called while animation is executed
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
+
ad->is_btn_scaled = EINA_FALSE;
//Button to start animation
@@ -159,23 +152,29 @@ test_efl_anim_scale_relative(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE
evas_object_show(pivot);
//Scale Animation to zoom in
- Efl_Animation *scale_double_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL);
+ Efl_Canvas_Animation *scale_double_anim = efl_add(EFL_CANVAS_ANIMATION_SCALE_CLASS, win);
efl_animation_scale_set(scale_double_anim, 1.0, 1.0, 2.0, 2.0, pivot, 0.5, 0.5);
efl_animation_duration_set(scale_double_anim, 1.0);
- efl_animation_target_set(scale_double_anim, btn);
efl_animation_final_state_keep_set(scale_double_anim, EINA_TRUE);
//Scale Animation to zoom out
- Efl_Animation *scale_half_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL);
+ Efl_Canvas_Animation *scale_half_anim = efl_add(EFL_CANVAS_ANIMATION_SCALE_CLASS, win);
efl_animation_scale_set(scale_half_anim, 2.0, 2.0, 1.0, 1.0, pivot, 0.5, 0.5);
efl_animation_duration_set(scale_half_anim, 1.0);
- efl_animation_target_set(scale_half_anim, btn);
efl_animation_final_state_keep_set(scale_half_anim, EINA_TRUE);
//Initialize App Data
ad->scale_double_anim = scale_double_anim;
ad->scale_half_anim = scale_half_anim;
- ad->anim_obj = NULL;
+ ad->anim_obj = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, win,
+ efl_animation_player_target_set(efl_added, btn));
+ //Register callback called when animation starts
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
+ //Register callback called when animation ends
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, ad);
+ //Register callback called while animation is executed
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
+
ad->is_btn_scaled = EINA_FALSE;
//Button to start animation
@@ -219,23 +218,29 @@ test_efl_anim_scale_absolute(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE
evas_object_show(abs_center);
//Scale Animation to zoom in
- Efl_Animation *scale_double_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL);
+ Efl_Canvas_Animation *scale_double_anim = efl_add(EFL_CANVAS_ANIMATION_SCALE_CLASS, win);
efl_animation_scale_absolute_set(scale_double_anim, 1.0, 1.0, 2.0, 2.0, 0, 0);
efl_animation_duration_set(scale_double_anim, 1.0);
- efl_animation_target_set(scale_double_anim, btn);
efl_animation_final_state_keep_set(scale_double_anim, EINA_TRUE);
//Scale Animation to zoom out
- Efl_Animation *scale_half_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL);
+ Efl_Canvas_Animation *scale_half_anim = efl_add(EFL_CANVAS_ANIMATION_SCALE_CLASS, win);
efl_animation_scale_absolute_set(scale_half_anim, 2.0, 2.0, 1.0, 1.0, 0, 0);
efl_animation_duration_set(scale_half_anim, 1.0);
- efl_animation_target_set(scale_half_anim, btn);
efl_animation_final_state_keep_set(scale_half_anim, EINA_TRUE);
//Initialize App Data
ad->scale_double_anim = scale_double_anim;
ad->scale_half_anim = scale_half_anim;
- ad->anim_obj = NULL;
+ ad->anim_obj = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, win,
+ efl_animation_player_target_set(efl_added, btn));
+ //Register callback called when animation starts
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
+ //Register callback called when animation ends
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, ad);
+ //Register callback called while animation is executed
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
+
ad->is_btn_scaled = EINA_FALSE;
//Button to start animation
diff --git a/src/bin/elementary/test_efl_anim_start_delay.c b/src/bin/elementary/test_efl_anim_start_delay.c
index 63cab0f18e..c94b515b62 100644
--- a/src/bin/elementary/test_efl_anim_start_delay.c
+++ b/src/bin/elementary/test_efl_anim_start_delay.c
@@ -5,9 +5,9 @@
typedef struct _App_Data
{
- Efl_Animation *show_anim;
- Efl_Animation *hide_anim;
- Efl_Animation_Object *anim_obj;
+ Efl_Canvas_Animation *show_anim;
+ Efl_Canvas_Animation *hide_anim;
+ Efl_Canvas_Animation_Player *anim_obj;
Evas_Object *start_delay_spin;
@@ -28,15 +28,13 @@ _anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED)
printf("Animation has been ended!\n");
elm_object_disabled_set(ad->start_delay_spin, EINA_FALSE);
-
- ad->anim_obj = NULL;
}
static void
_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event)
{
- Efl_Animation_Object_Running_Event_Info *event_info = event->info;
- double progress = event_info->progress;
+ Efl_Canvas_Animation_Player_Event_Running *event_running = event->info;
+ double progress = event_running->progress;
printf("Animation is running! Current progress(%lf)\n", progress);
}
@@ -45,9 +43,6 @@ _start_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED
{
App_Data *ad = data;
- if (ad->anim_obj)
- efl_animation_object_cancel(ad->anim_obj);
-
ad->is_btn_visible = !(ad->is_btn_visible);
double start_delay = elm_spinner_value_get(ad->start_delay_spin);
@@ -59,8 +54,8 @@ _start_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED
efl_animation_start_delay_set(ad->show_anim, start_delay);
//Create Animation Object from Animation
- ad->anim_obj = efl_animation_object_create(ad->show_anim);
- elm_object_text_set(obj, "Start Alpha Animation from 1.0 to 0.0");
+ efl_animation_player_animation_set(ad->anim_obj, ad->show_anim);
+ efl_text_set(obj, "Start Alpha Animation from 1.0 to 0.0");
}
else
{
@@ -68,21 +63,12 @@ _start_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED
efl_animation_start_delay_set(ad->hide_anim, start_delay);
//Create Animation Object from Animation
- ad->anim_obj = efl_animation_object_create(ad->hide_anim);
- elm_object_text_set(obj, "Start Alpha Animation from 0.0 to 1.0");
+ efl_animation_player_animation_set(ad->anim_obj, ad->hide_anim);
+ efl_text_set(obj, "Start Alpha Animation from 0.0 to 1.0");
}
- //Register callback called when animation starts
- efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_STARTED, _anim_started_cb, NULL);
-
- //Register callback called when animation ends
- efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_ENDED, _anim_ended_cb, ad);
-
- //Register callback called while animation is executed
- efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_RUNNING, _anim_running_cb, NULL);
-
//Let Animation Object start animation
- efl_animation_object_start(ad->anim_obj);
+ efl_player_start(ad->anim_obj);
}
static void
@@ -112,17 +98,15 @@ test_efl_anim_start_delay(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
evas_object_show(btn);
//Show Animation
- Efl_Animation *show_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL);
+ Efl_Canvas_Animation *show_anim = efl_add(EFL_CANVAS_ANIMATION_ALPHA_CLASS, win);
efl_animation_alpha_set(show_anim, 0.0, 1.0);
efl_animation_duration_set(show_anim, 1.0);
- efl_animation_target_set(show_anim, btn);
efl_animation_final_state_keep_set(show_anim, EINA_TRUE);
//Hide Animation
- Efl_Animation *hide_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL);
+ Efl_Canvas_Animation *hide_anim = efl_add(EFL_CANVAS_ANIMATION_ALPHA_CLASS, win);
efl_animation_alpha_set(hide_anim, 1.0, 0.0);
efl_animation_duration_set(hide_anim, 1.0);
- efl_animation_target_set(hide_anim, btn);
efl_animation_final_state_keep_set(hide_anim, EINA_TRUE);
@@ -150,7 +134,16 @@ test_efl_anim_start_delay(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
//Initialize App Data
ad->show_anim = show_anim;
ad->hide_anim = hide_anim;
- ad->anim_obj = NULL;
+ ad->anim_obj = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, win,
+ efl_animation_player_target_set(efl_added, btn));
+
+ //Register callback called when animation starts
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
+ //Register callback called when animation ends
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, ad);
+ //Register callback called while animation is executed
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
+
ad->start_delay_spin = start_delay_spin;
ad->is_btn_visible = EINA_TRUE;
diff --git a/src/bin/elementary/test_efl_anim_translate.c b/src/bin/elementary/test_efl_anim_translate.c
index d76e927f67..a562d17d65 100644
--- a/src/bin/elementary/test_efl_anim_translate.c
+++ b/src/bin/elementary/test_efl_anim_translate.c
@@ -5,9 +5,9 @@
typedef struct _App_Data
{
- Efl_Animation *translate_rb_anim;
- Efl_Animation *translate_lt_anim;
- Efl_Animation_Object *anim_obj;
+ Efl_Canvas_Animation *translate_rb_anim;
+ Efl_Canvas_Animation *translate_lt_anim;
+ Efl_Canvas_Animation_Player *anim_obj;
Eina_Bool is_btn_translated;
} App_Data;
@@ -19,20 +19,16 @@ _anim_started_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
}
static void
-_anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED)
+_anim_ended_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
{
- App_Data *ad = data;
-
printf("Animation has been ended!\n");
-
- ad->anim_obj = NULL;
}
static void
_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event)
{
- Efl_Animation_Object_Running_Event_Info *event_info = event->info;
- double progress = event_info->progress;
+ Efl_Canvas_Animation_Player_Event_Running *event_running = event->info;
+ double progress = event_running->progress;
printf("Animation is running! Current progress(%lf)\n", progress);
}
@@ -41,35 +37,23 @@ _btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
{
App_Data *ad = data;
- if (ad->anim_obj)
- efl_animation_object_cancel(ad->anim_obj);
-
ad->is_btn_translated = !(ad->is_btn_translated);
if (ad->is_btn_translated)
{
//Create Animation Object from Animation
- ad->anim_obj = efl_animation_object_create(ad->translate_rb_anim);
- elm_object_text_set(obj, "Start Translate Animation to left top");
+ efl_animation_player_animation_set(ad->anim_obj, ad->translate_rb_anim);
+ efl_text_set(obj, "Start Translate Animation to left top");
}
else
{
//Create Animation Object from Animation
- ad->anim_obj = efl_animation_object_create(ad->translate_lt_anim);
- elm_object_text_set(obj, "Start Translate Animation to right bottom");
+ efl_animation_player_animation_set(ad->anim_obj, ad->translate_lt_anim);
+ efl_text_set(obj, "Start Translate Animation to right bottom");
}
-
- //Register callback called when animation starts
- efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_STARTED, _anim_started_cb, NULL);
-
- //Register callback called when animation ends
- efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_ENDED, _anim_ended_cb, ad);
-
- //Register callback called while animation is executed
- efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_RUNNING, _anim_running_cb, NULL);
-
+
//Let Animation Object start animation
- efl_animation_object_start(ad->anim_obj);
+ efl_player_start(ad->anim_obj);
}
static void
@@ -99,23 +83,29 @@ test_efl_anim_translate(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, vo
evas_object_show(btn);
//Translate Animation to right bottom relatively
- Efl_Animation *translate_rb_anim = efl_add(EFL_ANIMATION_TRANSLATE_CLASS, NULL);
+ Efl_Canvas_Animation *translate_rb_anim = efl_add(EFL_CANVAS_ANIMATION_TRANSLATE_CLASS, win);
efl_animation_translate_set(translate_rb_anim, 0, 0, 100, 100);
efl_animation_duration_set(translate_rb_anim, 1.0);
- efl_animation_target_set(translate_rb_anim, btn);
efl_animation_final_state_keep_set(translate_rb_anim, EINA_TRUE);
//Translate Animation to left top relatively
- Efl_Animation *translate_lt_anim = efl_add(EFL_ANIMATION_TRANSLATE_CLASS, NULL);
+ Efl_Canvas_Animation *translate_lt_anim = efl_add(EFL_CANVAS_ANIMATION_TRANSLATE_CLASS, win);
efl_animation_translate_set(translate_lt_anim, 100, 100, 0, 0);
efl_animation_duration_set(translate_lt_anim, 1.0);
- efl_animation_target_set(translate_lt_anim, btn);
efl_animation_final_state_keep_set(translate_lt_anim, EINA_TRUE);
//Initialize App Data
ad->translate_rb_anim = translate_rb_anim;
ad->translate_lt_anim = translate_lt_anim;
- ad->anim_obj = NULL;
+ ad->anim_obj = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, win,
+ efl_animation_player_target_set(efl_added, btn));
+ //Register callback called when animation starts
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
+ //Register callback called when animation ends
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, NULL);
+ //Register callback called while animation is executed
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
+
ad->is_btn_translated = EINA_FALSE;
//Button to start animation
@@ -159,24 +149,29 @@ test_efl_anim_translate_absolute(void *data EINA_UNUSED, Evas_Object *obj EINA_U
evas_object_show(abs_center);
//Translate Animation to right bottom absolutely
- Efl_Animation *translate_rb_anim = efl_add(EFL_ANIMATION_TRANSLATE_CLASS, NULL);
+ Efl_Canvas_Animation *translate_rb_anim = efl_add(EFL_CANVAS_ANIMATION_TRANSLATE_CLASS, win);
efl_animation_translate_absolute_set(translate_rb_anim, 0, 0, 100, 100);
efl_animation_duration_set(translate_rb_anim, 1.0);
- efl_animation_target_set(translate_rb_anim, btn);
efl_animation_final_state_keep_set(translate_rb_anim, EINA_TRUE);
//Translate Animation to left top absolutely
- Efl_Animation *translate_lt_anim = efl_add(EFL_ANIMATION_TRANSLATE_CLASS, NULL);
+ Efl_Canvas_Animation *translate_lt_anim = efl_add(EFL_CANVAS_ANIMATION_TRANSLATE_CLASS, win);
efl_animation_translate_absolute_set(translate_lt_anim, 100, 100, 0, 0);
efl_animation_duration_set(translate_lt_anim, 1.0);
- efl_animation_target_set(translate_lt_anim, btn);
efl_animation_final_state_keep_set(translate_lt_anim, EINA_TRUE);
//Initialize App Data
ad->translate_rb_anim = translate_rb_anim;
ad->translate_lt_anim = translate_lt_anim;
- ad->anim_obj = NULL;
ad->is_btn_translated = EINA_FALSE;
+ ad->anim_obj = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, win,
+ efl_animation_player_target_set(efl_added, btn));
+ //Register callback called when animation starts
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
+ //Register callback called when animation ends
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, NULL);
+ //Register callback called while animation is executed
+ efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
//Button to start animation
Evas_Object *btn2 = elm_button_add(win);
diff --git a/src/bin/elementary/test_efl_gfx_map.c b/src/bin/elementary/test_efl_gfx_map.c
index 1f06dafda2..72d7db139d 100644
--- a/src/bin/elementary/test_efl_gfx_map.c
+++ b/src/bin/elementary/test_efl_gfx_map.c
@@ -45,7 +45,7 @@ test_efl_gfx_map(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
Evas_Object *win, *img;
char buf[PATH_MAX];
- win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_text_set(efl_added, "Efl Gfx Map"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
@@ -54,12 +54,12 @@ test_efl_gfx_map(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
img = efl_add(EFL_UI_IMAGE_CLASS, win,
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(64, 64)),
efl_file_set(efl_added, buf, NULL));
- efl_image_scale_type_set(img, EFL_IMAGE_SCALE_TYPE_FILL);
+ efl_gfx_image_scale_type_set(img, EFL_GFX_IMAGE_SCALE_TYPE_FILL);
evas_object_event_callback_add(img, EVAS_CALLBACK_RESIZE,
_image_resize_cb, NULL);
_map_set(img);
efl_content_set(win, img);
- efl_gfx_size_set(win, EINA_SIZE2D(W, H));
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(W, H));
}
diff --git a/src/bin/elementary/test_efl_ui_text.c b/src/bin/elementary/test_efl_ui_text.c
index b53c427b9a..9ad0e9a50a 100644
--- a/src/bin/elementary/test_efl_ui_text.c
+++ b/src/bin/elementary/test_efl_ui_text.c
@@ -29,7 +29,7 @@ _create_label(Eo *win, Eo *bx)
Eo *en;
en = efl_add(EFL_UI_TEXT_CLASS, win);
printf("Added Efl.Ui.Text object\n");
- efl_ui_text_interactive_editable_set(en, EINA_FALSE);
+ efl_text_interactive_editable_set(en, EINA_FALSE);
elm_box_pack_end(bx, en);
return en;
}
@@ -72,7 +72,7 @@ test_efl_ui_text_label(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, voi
en = _create_label(win, bx);
efl_text_set(en, "You can input text here.");
efl_text_font_set(en, "Sans", 14);
- efl_ui_text_interactive_editable_set(en, EINA_TRUE);
+ efl_text_interactive_editable_set(en, EINA_TRUE);
efl_text_wrap_set(en, EFL_TEXT_FORMAT_WRAP_WORD);
efl_ui_text_scrollable_set(en, EINA_TRUE);
evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.5);
@@ -80,7 +80,7 @@ test_efl_ui_text_label(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, voi
en = _create_label(win, bx);
efl_text_set(en, "Input multiline here.");
efl_text_font_set(en, "Sans", 14);
- efl_ui_text_interactive_editable_set(en, EINA_TRUE);
+ efl_text_interactive_editable_set(en, EINA_TRUE);
efl_text_wrap_set(en, EFL_TEXT_FORMAT_WRAP_WORD);
efl_text_multiline_set(en, EINA_TRUE);
efl_ui_text_scrollable_set(en, EINA_TRUE);
@@ -130,7 +130,7 @@ my_efl_ui_text_bt_3(void *data, Evas_Object *obj EINA_UNUSED, void *event_info E
{
Efl_Text_Cursor_Cursor *sel_start, *sel_end;
- efl_ui_text_interactive_selection_cursors_get(data, &sel_start, &sel_end);
+ efl_text_interactive_selection_cursors_get(data, &sel_start, &sel_end);
const char *s = efl_canvas_text_range_text_get(data, sel_start, sel_end);
printf("SELECTION REGION: %d - %d\n",
@@ -144,8 +144,8 @@ static void
my_efl_ui_text_bt_4(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
Evas_Object *en = data;
- efl_text_cursor_object_item_insert(en, efl_text_cursor_get(en, EFL_TEXT_CURSOR_GET_MAIN),
- "size=32x32 href=emoticon/evil-laugh");
+ efl_text_cursor_item_insert(en, efl_text_cursor_get(en, EFL_TEXT_CURSOR_GET_MAIN),
+ "emoticon/evil-laugh", "size=32x32");
}
static void
@@ -187,6 +187,7 @@ test_efl_ui_text(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
{
Evas_Object *win, *bx, *bx2, *bx3, *bt, *en;
Efl_Text_Cursor_Cursor *main_cur, *cur;
+ char buf[128];
win = elm_win_util_standard_add("entry", "Entry");
elm_win_autodel_set(win, EINA_TRUE);
@@ -215,16 +216,17 @@ test_efl_ui_text(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
cur = efl_text_cursor_new(en);
efl_text_cursor_position_set(en, cur, 2);
- efl_text_cursor_object_item_insert(en, cur, "size=32x32 href=emoticon");
+ efl_text_cursor_item_insert(en, cur, "emoticon/happy", "size=32x32");
efl_text_cursor_position_set(en, cur, 50);
- efl_text_cursor_object_item_insert(en, cur, "size=32x32 href=emoticon");
+ sprintf(buf, "file://%s/images/sky_01.jpg", elm_app_data_dir_get());
+ efl_text_cursor_item_insert(en, cur, buf, "size=32x32");
efl_text_cursor_position_set(en, main_cur, 5);
efl_text_cursor_position_set(en, cur, 20);
efl_text_annotation_insert(en, main_cur, cur, "a href=#hello");
- efl_ui_text_interactive_editable_set(en, EINA_TRUE);
+ efl_text_interactive_editable_set(en, EINA_TRUE);
efl_ui_text_scrollable_set(en, EINA_TRUE);
elm_box_pack_end(bx, en);
elm_object_focus_set(en, EINA_TRUE);
@@ -297,7 +299,7 @@ test_efl_ui_text_async(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, voi
elm_win_resize_object_add(win, bx);
evas_object_show(bx);
- en = efl_add(EFL_UI_TEXT_ASYNC_CLASS, win,
+ en = efl_add(EFL_UI_TEXT_CLASS, win,
efl_text_wrap_set(efl_added, EFL_TEXT_FORMAT_WRAP_WORD),
efl_text_multiline_set(efl_added, EINA_TRUE)
);
@@ -332,3 +334,186 @@ test_efl_ui_text_async(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, voi
evas_object_resize(win, 480, 320);
evas_object_show(win);
}
+
+#define IMAGES_SZ 5
+
+static const char *images[IMAGES_SZ] = {
+ "sky", "logo", "dog", "eet_rock", "eet_plant" };
+
+static void
+my_efl_ui_text_item_factory_bt_image(void *data, Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ Evas_Object *en = data;
+ static int image_idx = 0;
+
+ image_idx = (image_idx + 1) % IMAGES_SZ;
+ efl_text_cursor_item_insert(en,
+ efl_text_cursor_get(en, EFL_TEXT_CURSOR_GET_MAIN),
+ images[image_idx], "size=32x32");
+ printf("Inserted image: key = %s\n", images[image_idx]);
+}
+
+static void
+my_efl_ui_text_item_factory_bt_emoticon(void *data, Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ Evas_Object *en = data;
+ efl_text_cursor_item_insert(en, efl_text_cursor_get(en, EFL_TEXT_CURSOR_GET_MAIN),
+ "emoticon/evil-laugh", "size=32x32");
+}
+
+static struct
+{
+ const char *name;
+ Eo *item_factory;
+} factories[3];
+
+static void
+my_efl_ui_text_item_factory_bt_change(void *data, Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ Evas_Object *en = data;
+ static int item_factory_idx = 0;
+
+ item_factory_idx = (item_factory_idx + 1) % 3;
+ efl_ui_text_item_factory_set(en, factories[item_factory_idx].item_factory);
+ printf("Factory set to: %s\n", factories[item_factory_idx].name);
+}
+
+#define FACTORY_NONE 0
+#define FACTORY_IMAGE 1
+#define FACTORY_EMOTICON 2
+
+void
+test_ui_text_item_factory(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Evas_Object *win, *bx, *bx2, *bx3, *bt, *en;
+ Efl_Text_Cursor_Cursor *main_cur, *cur;
+ char buf[128];
+ Eina_File *f;
+
+ win = elm_win_util_standard_add("entry", "Entry");
+ elm_win_autodel_set(win, EINA_TRUE);
+
+ bx = elm_box_add(win);
+ evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(win, bx);
+ evas_object_show(bx);
+
+ en = efl_add(EFL_UI_TEXT_CLASS, win,
+ efl_text_multiline_set(efl_added, EINA_TRUE));
+
+ factories[FACTORY_NONE].name = "None (Fallback)";
+ factories[FACTORY_NONE].item_factory = NULL;
+
+ factories[FACTORY_IMAGE].name = "Image Factory";
+ factories[FACTORY_IMAGE].item_factory =
+ efl_add(EFL_UI_TEXT_FACTORY_IMAGES_CLASS, en);
+
+ factories[FACTORY_EMOTICON].name = "Emoticon Factory";
+ factories[FACTORY_EMOTICON].item_factory =
+ efl_add(EFL_UI_TEXT_FACTORY_EMOTICONS_CLASS, en);
+
+ // Test assigning file path source
+ sprintf(buf, "%s/images/sky_01.jpg", elm_app_data_dir_get());
+ efl_ui_text_factory_images_matches_add(factories[FACTORY_IMAGE].item_factory,
+ images[0], buf, NULL);
+ sprintf(buf, "%s/images/logo.png", elm_app_data_dir_get());
+ efl_ui_text_factory_images_matches_add(factories[FACTORY_IMAGE].item_factory,
+ images[1], buf, NULL);
+ sprintf(buf, "%s/images/mystrale.jpg", elm_app_data_dir_get());
+ efl_ui_text_factory_images_matches_add(factories[FACTORY_IMAGE].item_factory,
+ images[2], buf, NULL);
+
+ // Open EET source w/ key
+ sprintf(buf, "%s/images/image_items.eet", elm_app_data_dir_get());
+ f = eina_file_open(buf, EINA_FALSE);
+ if (f)
+ {
+ efl_ui_text_factory_images_matches_mmap_add(
+ factories[FACTORY_IMAGE].item_factory,
+ "eet_rock", f, "rock");
+ efl_ui_text_factory_images_matches_mmap_add(
+ factories[FACTORY_IMAGE].item_factory,
+ "eet_plant", f, "plant");
+ eina_file_close(f);
+ }
+ else
+ {
+ printf("Error loading test file. Please review test.");
+ }
+
+
+ printf("Added Efl.Ui.Text object\n");
+ efl_text_set(en, "Hello world! Goodbye world! This is a test text for the"
+ " new UI Text widget.\xE2\x80\xA9This is the next paragraph.\nThis"
+ " is the next line.\nThis is Yet another line! Line and paragraph"
+ " separators are actually different!");
+ efl_text_font_set(en, "Sans", 14);
+ efl_text_normal_color_set(en, 255, 255, 255, 255);
+
+ main_cur = efl_text_cursor_get(en, EFL_TEXT_CURSOR_GET_MAIN);
+ cur = efl_text_cursor_new(en);
+
+ efl_text_cursor_position_set(en, cur, 2);
+ efl_text_cursor_item_insert(en, cur, "emoticon/happy", "size=32x32");
+ efl_text_cursor_position_set(en, cur, 50);
+
+ sprintf(buf, "file://%s/images/sky_01.jpg", elm_app_data_dir_get());
+ efl_text_cursor_item_insert(en, cur, buf, "size=32x32");
+ efl_text_cursor_position_set(en, main_cur, 5);
+
+ efl_text_interactive_editable_set(en, EINA_TRUE);
+ efl_ui_text_scrollable_set(en, EINA_TRUE);
+ elm_box_pack_end(bx, en);
+ elm_object_focus_set(en, EINA_TRUE);
+
+ bx2 = elm_box_add(win);
+ elm_box_horizontal_set(bx2, EINA_TRUE);
+ evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ bt = elm_button_add(win);
+ elm_object_text_set(bt, "Image");
+ evas_object_smart_callback_add(bt, "clicked",
+ my_efl_ui_text_item_factory_bt_image, en);
+ evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
+ elm_box_pack_end(bx2, bt);
+ elm_object_focus_allow_set(bt, EINA_FALSE);
+ evas_object_show(bt);
+
+ bt = elm_button_add(win);
+ elm_object_text_set(bt, "Emoticon");
+ evas_object_smart_callback_add(bt, "clicked",
+ my_efl_ui_text_item_factory_bt_emoticon, en);
+ evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
+ elm_box_pack_end(bx2, bt);
+ elm_object_focus_allow_set(bt, EINA_FALSE);
+ evas_object_show(bt);
+
+ bt = elm_button_add(win);
+ elm_object_text_set(bt, "Factory");
+ evas_object_smart_callback_add(bt, "clicked",
+ my_efl_ui_text_item_factory_bt_change, en);
+ evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
+ elm_box_pack_end(bx2, bt);
+ elm_object_focus_allow_set(bt, EINA_FALSE);
+ evas_object_show(bt);
+
+ bx3 = elm_box_add(win);
+ elm_box_horizontal_set(bx3, EINA_TRUE);
+ evas_object_size_hint_weight_set(bx3, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(bx3, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ elm_box_pack_end(bx, bx3);
+ elm_box_pack_end(bx, bx2);
+ evas_object_show(bx3);
+ evas_object_show(bx2);
+
+ evas_object_resize(win, 480, 320);
+ evas_object_show(win);
+}
diff --git a/src/bin/elementary/test_evas_map.c b/src/bin/elementary/test_evas_map.c
index 6f026cb028..7e25aafba7 100644
--- a/src/bin/elementary/test_evas_map.c
+++ b/src/bin/elementary/test_evas_map.c
@@ -41,7 +41,7 @@ _image_resize_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj,
{
Eina_Size2D sz;
- sz = efl_gfx_size_get(obj);
+ sz = efl_gfx_entity_size_get(obj);
_map_set(obj, sz.w, sz.h);
}
@@ -53,7 +53,7 @@ test_evas_map(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
Evas_Object *win, *img;
char buf[PATH_MAX];
- win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_text_set(efl_added, "Evas Map"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
@@ -62,12 +62,12 @@ test_evas_map(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
img = efl_add(EFL_UI_IMAGE_CLASS, win,
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(64, 64)),
efl_file_set(efl_added, buf, NULL));
- efl_image_scale_type_set(img, EFL_IMAGE_SCALE_TYPE_FILL);
+ efl_gfx_image_scale_type_set(img, EFL_GFX_IMAGE_SCALE_TYPE_FILL);
evas_object_event_callback_add(img, EVAS_CALLBACK_RESIZE,
_image_resize_cb, NULL);
_map_set(img, W, H);
efl_content_set(win, img);
- efl_gfx_size_set(win, EINA_SIZE2D(W, H));
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(W, H));
}
diff --git a/src/bin/elementary/test_evas_mask.c b/src/bin/elementary/test_evas_mask.c
index 050158cd86..e322f7ba65 100644
--- a/src/bin/elementary/test_evas_mask.c
+++ b/src/bin/elementary/test_evas_mask.c
@@ -108,7 +108,7 @@ test_evas_mask(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
Elm_Genlist_Item_Class *itc;
char buf[PATH_MAX];
- win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_text_set(efl_added, "Evas masking demo"),
efl_ui_win_autodel_set(efl_added, 1));
@@ -122,7 +122,7 @@ test_evas_mask(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
// FIXME: layout EO API
snprintf(buf, sizeof(buf), "%s/objects/test_masking.edj", elm_app_data_dir_get());
- ly = efl_add(EFL_UI_LAYOUT_CLASS, win,
+ ly = efl_add(EFL_UI_LAYOUT_OBJECT_CLASS, win,
efl_file_set(efl_added, buf, "masking"));
efl_pack(box, ly);
@@ -176,5 +176,5 @@ test_evas_mask(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
efl_gfx_size_hint_weight_set(efl_added, 0.0, 0.0),
efl_pack(box2, efl_added));
- efl_gfx_size_set(win, EINA_SIZE2D(500, 600));
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(500, 600));
}
diff --git a/src/bin/elementary/test_evas_snapshot.c b/src/bin/elementary/test_evas_snapshot.c
index 48cd8a38ea..e288278a4a 100644
--- a/src/bin/elementary/test_evas_snapshot.c
+++ b/src/bin/elementary/test_evas_snapshot.c
@@ -55,7 +55,7 @@ _render_post(void *data, const Efl_Event *ev)
{
Eo *snap = data;
- efl_event_callback_del(ev->object, EFL_CANVAS_EVENT_RENDER_POST, _render_post, data);
+ efl_event_callback_del(ev->object, EFL_CANVAS_SCENE_EVENT_RENDER_POST, _render_post, data);
efl_file_save(snap, eina_slstr_printf("%s/snap-efl.png", eina_environment_tmp_get()), NULL, NULL);
}
@@ -67,7 +67,7 @@ _save_image(void *data, const Efl_Event *ev EINA_UNUSED)
// Save is available only during render_post
snap = efl_key_wref_get(win, "snap");
- efl_event_callback_add(win, EFL_CANVAS_EVENT_RENDER_POST, _render_post, snap);
+ efl_event_callback_add(win, EFL_CANVAS_SCENE_EVENT_RENDER_POST, _render_post, snap);
// Force a render in order to ensure post_render is called. EO API provides
// no way to do manual render, so we add a damage to the snapshot object.
@@ -118,7 +118,7 @@ test_evas_snapshot(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
Eo *win, *table, *o, *snap, *box;
const char *path;
- win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_text_set(efl_added, "Evas Snapshot"),
efl_ui_win_autodel_set(efl_added, 1));
@@ -204,5 +204,5 @@ test_evas_snapshot(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
efl_key_wref_set(win, "snap", snap);
efl_key_wref_set(win, "table", table);
- efl_gfx_size_set(win, EINA_SIZE2D(400, 400));
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(400, 400));
}
diff --git a/src/bin/elementary/test_events.c b/src/bin/elementary/test_events.c
index 38c94418ce..b9fc394980 100644
--- a/src/bin/elementary/test_events.c
+++ b/src/bin/elementary/test_events.c
@@ -120,7 +120,7 @@ _clicked_button2(void *data, const Efl_Event *ev EINA_UNUSED)
if (!td->evkeyup)
{
- r = efl_gfx_geometry_get(bt);
+ r = efl_gfx_entity_geometry_get(bt);
r.x = r.x + r.w / 2;
r.y = r.y + r.h / 2;
diff --git a/src/bin/elementary/test_flip_page_eo.c b/src/bin/elementary/test_flip_page_eo.c
index cf88d0291d..a1ce5f5b66 100644
--- a/src/bin/elementary/test_flip_page_eo.c
+++ b/src/bin/elementary/test_flip_page_eo.c
@@ -134,7 +134,7 @@ _slice_3d(State *st EINA_UNUSED, Slice *sl, Evas_Coord x, Evas_Coord y, Evas_Coo
efl_gfx_map_coord_absolute_get(sl->obj, i, &xx, &yy, NULL);
efl_gfx_map_coord_absolute_set(sl->obj, i, xx, yy, 0);
}
- efl_gfx_visible_set(sl->obj, efl_gfx_map_clockwise_get(sl->obj));
+ efl_gfx_entity_visible_set(sl->obj, efl_gfx_map_clockwise_get(sl->obj));
}
static void
diff --git a/src/bin/elementary/test_focus.c b/src/bin/elementary/test_focus.c
index 3701b4575d..ceb6e5cdd5 100644
--- a/src/bin/elementary/test_focus.c
+++ b/src/bin/elementary/test_focus.c
@@ -563,7 +563,9 @@ _focus_layout_part(void *data, Evas_Object *o EINA_UNUSED, void *event_info EINA
{
Evas_Object *ed = elm_layout_edje_get(data);
+ edje_object_freeze(ed);
Evas_Object *newfocus = (Evas_Object *)edje_object_part_object_get(ed, "sky");
+ edje_object_thaw(ed);
const char *type = evas_object_type_get(newfocus);
printf("evas_object_focus_set(%p, EINA_TRUE) %s\n", newfocus, type);
evas_object_focus_set(newfocus, EINA_TRUE);;
@@ -1000,7 +1002,7 @@ struct _focus5_obj _focus5_layout_data3[] = {
{"top R", 80, 0, 20, 10},
{"bot L", 0, 90, 20, 10},
{"bot R", 80, 90, 20, 10},
- {"center", 40, 40, 20, 10},
+ {"center", 40, 45, 20, 10},
{NULL, 0, 0, 0, 0} /* sentinel */
};
@@ -1087,12 +1089,22 @@ _focus6_gl_text_get(void *data, Evas_Object *obj EINA_UNUSED,
snprintf(buf, sizeof(buf), "Focus item %d", (int)(uintptr_t)data);
return strdup(buf);
}
+
+static void
+_focus6_btn_clicked(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
+{
+ Evas_Object *ly = data;
+ Elm_Focus_Direction dir = (uintptr_t)evas_object_data_get(obj, "direction");
+
+ elm_object_focus_next(ly, dir);
+}
+
void
test_focus6(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
- Evas_Object *win, *ly, *lb, *btn, *gl;
+ Evas_Object *win, *box, *box2, *sep, *ly, *lb, *btn, *gl;
Elm_Genlist_Item_Class *itc;
-// Elm_Object_Item *it;
+ Elm_Object_Item *it;
char buf[PATH_MAX];
int i;
@@ -1100,13 +1112,19 @@ test_focus6(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
elm_win_autodel_set(win, EINA_TRUE);
elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
+ // main vertical box
+ box = elm_box_add(win);
+ evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(win, box);
+ evas_object_show(box);
+
// main layout
ly = elm_layout_add(win);
snprintf(buf, sizeof(buf), "%s/objects/test.edj", elm_app_data_dir_get());
elm_layout_file_set(ly, buf, "focus_test_6");
evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(ly, EVAS_HINT_FILL, EVAS_HINT_FILL);
- elm_win_resize_object_add(win, ly);
+ elm_box_pack_end(box, ly);
evas_object_show(ly);
lb = elm_label_add(ly);
@@ -1126,12 +1144,16 @@ test_focus6(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
itc->func.text_get = _focus6_gl_text_get;
for (i = 0; i < 3; i++)
{
-// it =
- elm_genlist_item_append(gl, itc, (void*)(uintptr_t)i, NULL,
- ELM_GENLIST_ITEM_NONE, NULL, NULL);
- /* This is another bug! This focus item at start do not work */
- // if (i == 1)
- // elm_object_item_focus_set(it, EINA_TRUE);
+ it = elm_genlist_item_append(gl, itc, (void*)(uintptr_t)i, NULL,
+ ELM_GENLIST_ITEM_NONE, NULL, NULL);
+
+ if (i == 1)
+ {
+ elm_genlist_item_selected_set(it, EINA_TRUE);
+
+ /* focus should start from second item */
+ elm_object_item_focus_set(it, EINA_TRUE);
+ }
}
elm_genlist_item_class_free(itc);
@@ -1143,10 +1165,62 @@ test_focus6(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
elm_layout_box_append(ly, "box", btn);
evas_object_show(btn);
/* focus should start from second button */
- if (i == 1)
- elm_object_focus_set(btn, EINA_TRUE);
+ // if (i == 1)
+ // elm_object_focus_set(btn, EINA_TRUE);
}
+ // 4 buttons (not focusable) to test focus move by API
+ sep = elm_separator_add(win);
+ elm_separator_horizontal_set(sep, EINA_TRUE);
+ elm_box_pack_end(box, sep);
+ evas_object_show(sep);
+
+ box2 = elm_box_add(win);
+ elm_box_horizontal_set(box2, EINA_TRUE);
+ evas_object_size_hint_weight_set(box2, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(box2, EVAS_HINT_FILL, 0.0);
+ elm_box_pack_end(box, box2);
+ evas_object_show(box2);
+
+ lb = elm_label_add(ly);
+ evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, 0.0);
+ elm_object_text_set(lb, "Move the focus using elm_object_focus_next()");
+ elm_box_pack_end(box2, lb);
+ evas_object_show(lb);
+
+ btn = elm_button_add(win);
+ elm_object_text_set(btn, "LEFT");
+ elm_object_focus_allow_set(btn, EINA_FALSE);
+ evas_object_data_set(btn, "direction", (void *)(uintptr_t)ELM_FOCUS_LEFT);
+ evas_object_smart_callback_add(btn, "clicked", _focus6_btn_clicked, ly);
+ elm_box_pack_end(box2, btn);
+ evas_object_show(btn);
+
+ btn = elm_button_add(win);
+ elm_object_text_set(btn, "UP");
+ elm_object_focus_allow_set(btn, EINA_FALSE);
+ evas_object_data_set(btn, "direction", (void *)(uintptr_t)ELM_FOCUS_UP);
+ evas_object_smart_callback_add(btn, "clicked", _focus6_btn_clicked, ly);
+ elm_box_pack_end(box2, btn);
+ evas_object_show(btn);
+
+ btn = elm_button_add(win);
+ elm_object_text_set(btn, "DOWN");
+ elm_object_focus_allow_set(btn, EINA_FALSE);
+ evas_object_data_set(btn, "direction", (void *)(uintptr_t)ELM_FOCUS_DOWN);
+ evas_object_smart_callback_add(btn, "clicked", _focus6_btn_clicked, ly);
+ elm_box_pack_end(box2, btn);
+ evas_object_show(btn);
+
+ btn = elm_button_add(win);
+ elm_object_text_set(btn, "RIGHT");
+ elm_object_focus_allow_set(btn, EINA_FALSE);
+ evas_object_data_set(btn, "direction", (void *)(uintptr_t)ELM_FOCUS_RIGHT);
+ evas_object_smart_callback_add(btn, "clicked", _focus6_btn_clicked, ly);
+ elm_box_pack_end(box2, btn);
+ evas_object_show(btn);
+
+ // size and show the window
evas_object_resize(win, 400, 400);
evas_object_show(win);
}
diff --git a/src/bin/elementary/test_genlist.c b/src/bin/elementary/test_genlist.c
index 7db692034a..b4168fd830 100644
--- a/src/bin/elementary/test_genlist.c
+++ b/src/bin/elementary/test_genlist.c
@@ -21,6 +21,9 @@ struct _api_data
void *gl;
void *filter_data; /* The data used for filtering */
+ Elm_Genlist_Item_Scrollto_Type type;
+ Elm_List_Mode mode;
+ int max_items, show_item;
int scrollto;
};
typedef struct _api_data api_data;
@@ -365,11 +368,11 @@ _bounce_cb(void *data)
unsigned long long tll, t0ll, tdll;
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &t);
- t0ll = (t0.tv_sec * 1000000000) + t0.tv_nsec;
- tll = (t.tv_sec * 1000000000) + t.tv_nsec;
+ t0ll = (((unsigned long long)t0.tv_sec) * 1000000000ULL) + t0.tv_nsec;
+ tll = (((unsigned long long)t.tv_sec) * 1000000000ULL) + t.tv_nsec;
tdll = tll - t0ll;
printf("NS since 2 = %llu , %llu frames = %llu / frame\n",
- tdll, frames, tdll / (unsigned long long)frames);
+ tdll, frames, tdll / frames);
#endif
if (getenv("ELM_TEST_AUTOBOUNCE")) elm_exit();
}
@@ -2092,10 +2095,56 @@ gl9_con_req(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
elm_genlist_item_expanded_set(glit, EINA_FALSE);
}
+static void
+gl9_item_next(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ api_data *api = data;
+ Elm_Object_Item *it;
+
+ it = elm_genlist_selected_item_get(api->gl);
+ it = elm_genlist_item_next_get(it);
+ elm_genlist_item_selected_set(it, EINA_TRUE);
+ printf("Next item: #%d\n", (int)(uintptr_t)elm_object_item_data_get(it));
+}
+
+static void
+gl9_item_prev(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ api_data *api = data;
+ Elm_Object_Item *it;
+
+ it = elm_genlist_selected_item_get(api->gl);
+ it = elm_genlist_item_prev_get(it);
+ elm_genlist_item_selected_set(it, EINA_TRUE);
+ printf("Prev item: #%d\n", (int)(uintptr_t)elm_object_item_data_get(it));
+}
+
+static void
+gl9_item_first(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ api_data *api = data;
+ Elm_Object_Item *it;
+
+ it = elm_genlist_first_item_get(api->gl);
+ elm_genlist_item_selected_set(it, EINA_TRUE);
+ printf("First item: #%d\n", (int)(uintptr_t)elm_object_item_data_get(it));
+}
+
+static void
+gl9_item_last(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ api_data *api = data;
+ Elm_Object_Item *it;
+
+ it = elm_genlist_last_item_get(api->gl);
+ elm_genlist_item_selected_set(it, EINA_TRUE);
+ printf("Last item: #%d\n", (int)(uintptr_t)elm_object_item_data_get(it));
+}
+
void
test_genlist9(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
- Evas_Object *win, *gl, *bx;
+ Evas_Object *win, *gl, *bx, *bx2, *bt;
Elm_Object_Item *git;
api_data *api = calloc(1, sizeof(api_data));
@@ -2135,7 +2184,6 @@ test_genlist9(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
git = elm_genlist_item_append(gl, api->itc2,
(void *)0/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_GROUP, gl4_sel/* func */,
NULL/* func data */);
- elm_genlist_item_select_mode_set(git, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
elm_genlist_item_append(gl, api->itc1,
(void *)1/* item data */, git/* parent */, ELM_GENLIST_ITEM_TREE, gl4_sel/* func */,
@@ -2149,7 +2197,6 @@ test_genlist9(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
git = elm_genlist_item_append(gl, api->itc2,
(void *)4/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_GROUP, gl4_sel/* func */,
NULL/* func data */);
- elm_genlist_item_select_mode_set(git, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
elm_genlist_item_append(gl, api->itc1,
(void *)5/* item data */, git/* parent */, ELM_GENLIST_ITEM_TREE, gl4_sel/* func */,
@@ -2168,6 +2215,36 @@ test_genlist9(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
evas_object_smart_callback_add(gl, "expanded", gl9_exp, api);
evas_object_smart_callback_add(gl, "contracted", gl9_con, api);
+ bx2 = elm_box_add(win);
+ elm_box_horizontal_set(bx2, EINA_TRUE);
+ elm_box_pack_end(bx, bx2);
+ evas_object_show(bx2);
+
+ bt = elm_button_add(bx2);
+ elm_object_text_set(bt, "First item");
+ evas_object_smart_callback_add(bt, "clicked", gl9_item_first, api);
+ elm_box_pack_end(bx2, bt);
+ evas_object_show(bt);
+
+ bt = elm_button_add(bx2);
+ elm_object_text_set(bt, "Next item");
+ evas_object_smart_callback_add(bt, "clicked", gl9_item_next, api);
+ elm_box_pack_end(bx2, bt);
+ evas_object_show(bt);
+ bt = elm_button_add(bx2);
+
+ bt = elm_button_add(bx2);
+ elm_object_text_set(bt, "Prev item");
+ evas_object_smart_callback_add(bt, "clicked", gl9_item_prev, api);
+ elm_box_pack_end(bx2, bt);
+ evas_object_show(bt);
+
+ bt = elm_button_add(bx2);
+ elm_object_text_set(bt, "Last item");
+ evas_object_smart_callback_add(bt, "clicked", gl9_item_last, api);
+ elm_box_pack_end(bx2, bt);
+ evas_object_show(bt);
+
evas_object_resize(win, 480, 800);
evas_object_show(win);
}
@@ -5401,6 +5478,283 @@ test_genlist_show_bring(void *data EINA_UNUSED,
evas_object_show(win);
}
+static Eina_Bool
+_late_item_prepender(void *data)
+{
+ api_data *api = (api_data*)data;
+ int i;
+ Elm_Object_Item *it = elm_genlist_nth_item_get(api->gl, api->show_item);
+ for (i = 0; i <= 100; i++)
+ elm_genlist_item_prepend(api->gl, api->itc1, (void*)(uintptr_t)i, it, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ elm_genlist_item_class_free(api->itc1);
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static void
+test_genlist_show_item(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ Evas_Object *win, *gl;
+ Elm_Object_Item *gli = NULL;
+ int i, max;
+ api_data *api = calloc(1, sizeof(api_data));
+ api_data *g_data = (api_data*)data;
+
+ win = elm_win_util_standard_add("genlist", "Genlist Show Last Item");
+ elm_win_autodel_set(win, EINA_TRUE);
+ evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _cleanup_cb, api);
+
+ gl = elm_genlist_add(win);
+ evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(gl);
+ if (g_data)
+ elm_genlist_mode_set(gl, g_data->mode);
+ else
+ elm_genlist_mode_set(gl, ELM_LIST_COMPRESS);
+ api->gl = gl;
+ elm_win_resize_object_add(win, gl);
+
+ api->itc1 = elm_genlist_item_class_new();
+ api->itc1->item_style = "default";
+ api->itc1->func.text_get = gl_text_get1;
+ api->itc1->func.content_get = gl_content_get;
+ api->itc1->func.state_get = NULL;
+ api->itc1->func.del = NULL;
+
+ g_data->gl = gl;
+ g_data->itc1 = api->itc1;
+
+ if (g_data)
+ max = g_data->max_items;
+ else max = 20000;
+ for (i = 0; i <= max; i++)
+ elm_genlist_item_append(gl, api->itc1, (void*)(uintptr_t)i, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+
+ if (g_data)
+ gli = elm_genlist_nth_item_get(gl, g_data->show_item);
+ if (!gli) gli = elm_genlist_last_item_get(gl);
+ elm_genlist_item_show(gli, g_data->type);
+
+ //prepends item while queue processing is happening
+ ecore_timer_add(0.1, _late_item_prepender, g_data);
+
+ evas_object_resize(win, 480, 400);
+ explode_win_enable(win);
+ evas_object_show(win);
+}
+
+static void
+test_genlist_show_tree(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ Evas_Object *win, *gl;
+ Elm_Object_Item *gli = NULL, *show = NULL;
+ int i, max;
+ api_data *api = calloc(1, sizeof(api_data));
+ api_data *g_data = (api_data*)data;
+
+ win = elm_win_util_standard_add("genlist", "Genlist Show Tree");
+ elm_win_autodel_set(win, EINA_TRUE);
+ evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _cleanup_cb, api);
+
+ gl = elm_genlist_add(win);
+ evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(gl);
+ api->gl = gl;
+ elm_win_resize_object_add(win, gl);
+ if (g_data)
+ elm_genlist_mode_set(gl, g_data->mode);
+ else
+ elm_genlist_mode_set(gl, ELM_LIST_COMPRESS);
+
+ api->itc1 = elm_genlist_item_class_new();
+ api->itc1->item_style = "default";
+ api->itc1->func.text_get = gl_text_get1;
+ api->itc1->func.content_get = gl_content_get;
+ api->itc1->func.state_get = NULL;
+ api->itc1->func.del = NULL;
+
+ if (g_data)
+ max = g_data->max_items;
+ else max = 2000;
+ for (i = 0; i <= max; i++)
+ {
+ if (i % (max / 20) == 0)
+ gli = elm_genlist_item_append(gl, api->itc1, (void*)(uintptr_t)i, gli, ELM_GENLIST_ITEM_TREE, NULL, NULL);
+ else
+ elm_genlist_item_append(gl, api->itc1, (void*)(uintptr_t)i, gli, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ }
+
+ if (g_data)
+ show = elm_genlist_nth_item_get(gl, g_data->show_item);
+ else show = gli;
+ elm_genlist_item_class_free(api->itc1);
+ elm_genlist_item_show(show, g_data->type);
+
+ evas_object_resize(win, 480, 400);
+ explode_win_enable(win);
+ evas_object_show(win);
+}
+
+static void
+_entry_changed_cb(void *data,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ int *val = (int*) data;
+ *val = atoi(elm_entry_entry_get(obj));
+}
+
+static void
+_radio_changed_type_cb(void *data,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ int val = elm_radio_state_value_get(obj);
+ api_data *api = (api_data*)data;
+ api->type = val;
+}
+
+static void
+_radio_changed_mode_cb(void *data,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ int val = elm_radio_state_value_get(obj);
+ api_data *api = (api_data*)data;
+ api->mode = val;
+}
+
+void
+test_genlist_item_show(void *data EINA_UNUSED,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+
+ Evas_Object *win, *bt_show, *bt_bring, *bx, *max_items, *show_item, *bxx, *rd1, *rd2, *rd3;
+ static Elm_Entry_Filter_Accept_Set digits_filter_data;
+ api_data *api = calloc(1, sizeof(api_data));
+
+ win = elm_win_util_standard_add("genlist", "Genlist Item Show");
+ elm_win_autodel_set(win, EINA_TRUE);
+ evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _cleanup_cb, api);
+
+ bx = elm_box_add(win);
+ evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(bx);
+ elm_win_resize_object_add(win, bx);
+
+ digits_filter_data.accepted = "0123456789";
+ digits_filter_data.rejected = NULL;
+
+ max_items = elm_entry_add(win);
+ elm_entry_single_line_set(max_items, EINA_TRUE);
+ elm_entry_scrollable_set(max_items, EINA_TRUE);
+ evas_object_size_hint_weight_set(max_items, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(max_items, EVAS_HINT_FILL, 0.5);
+ elm_object_part_text_set(max_items, "guide", "Enter the maximum number of items needed");
+ evas_object_smart_callback_add(max_items, "changed", _entry_changed_cb, (void*)(&(api->max_items)));
+ elm_entry_markup_filter_append(max_items, elm_entry_filter_accept_set, &digits_filter_data);
+ evas_object_show(max_items);
+ elm_box_pack_end(bx, max_items);
+
+ show_item = elm_entry_add(win);
+ elm_entry_single_line_set(show_item, EINA_TRUE);
+ elm_entry_scrollable_set(show_item, EINA_TRUE);
+ evas_object_size_hint_weight_set(show_item, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(show_item, EVAS_HINT_FILL, 0.5);
+ elm_object_part_text_set(show_item, "guide", "Enter the number of item to be shown");
+ evas_object_smart_callback_add(show_item, "changed", _entry_changed_cb, (void*)(&(api->show_item)));
+ elm_entry_markup_filter_append(show_item, elm_entry_filter_accept_set, &digits_filter_data);
+ evas_object_show(show_item);
+ elm_box_pack_end(bx, show_item);
+
+ bxx = elm_box_add(win);
+ elm_box_horizontal_set(bxx, EINA_TRUE);
+ evas_object_size_hint_weight_set(bxx, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(bxx, EVAS_HINT_FILL, 0.5);
+
+ rd1 = elm_radio_add(win);
+ elm_object_text_set(rd1, "Top");
+ elm_radio_state_value_set(rd1, ELM_GENLIST_ITEM_SCROLLTO_TOP);
+ evas_object_smart_callback_add(rd1, "changed", _radio_changed_type_cb, api);
+ evas_object_show(rd1);
+ elm_box_pack_end(bxx, rd1);
+
+ rd2 = elm_radio_add(win);
+ elm_object_text_set(rd2, "Middle");
+ evas_object_smart_callback_add(rd2, "changed", _radio_changed_type_cb, api);
+ elm_radio_state_value_set(rd2, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
+ elm_radio_group_add(rd2, rd1);
+ evas_object_show(rd2);
+ elm_box_pack_end(bxx, rd2);
+
+ rd3 = elm_radio_add(win);
+ elm_object_text_set(rd3, "Bottom");
+ evas_object_smart_callback_add(rd3, "changed", _radio_changed_type_cb, api);
+ elm_radio_state_value_set(rd3, ELM_GENLIST_ITEM_SCROLLTO_BOTTOM);
+ elm_radio_group_add(rd3, rd1);
+ evas_object_show(rd3);
+ elm_box_pack_end(bxx, rd3);
+ evas_object_show(bxx);
+ elm_box_pack_end(bx, bxx);
+ elm_radio_value_set(rd1, ELM_GENLIST_ITEM_SCROLLTO_TOP);
+ api->type = ELM_GENLIST_ITEM_SCROLLTO_TOP;
+
+ bxx = elm_box_add(win);
+ elm_box_horizontal_set(bxx, EINA_TRUE);
+ evas_object_size_hint_weight_set(bxx, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(bxx, EVAS_HINT_FILL, 0.5);
+
+ rd1 = elm_radio_add(win);
+ elm_object_text_set(rd1, "ELM_LIST_SCROLL");
+ elm_radio_state_value_set(rd1, ELM_LIST_SCROLL);
+ evas_object_smart_callback_add(rd1, "changed", _radio_changed_mode_cb, api);
+ evas_object_show(rd1);
+ elm_box_pack_end(bxx, rd1);
+
+ rd2 = elm_radio_add(win);
+ elm_object_text_set(rd2, "ELM_LIST_LIMIT");
+ evas_object_smart_callback_add(rd2, "changed", _radio_changed_mode_cb, api);
+ elm_radio_state_value_set(rd2, ELM_LIST_LIMIT);
+ elm_radio_group_add(rd2, rd1);
+ evas_object_show(rd2);
+ elm_box_pack_end(bxx, rd2);
+
+ rd3 = elm_radio_add(win);
+ elm_object_text_set(rd3, "ELM_LIST_COMPRESS");
+ evas_object_smart_callback_add(rd3, "changed", _radio_changed_mode_cb, api);
+ elm_radio_state_value_set(rd3, ELM_LIST_COMPRESS);
+ elm_radio_group_add(rd3, rd1);
+ evas_object_show(rd3);
+ elm_box_pack_end(bxx, rd3);
+ evas_object_show(bxx);
+ elm_box_pack_end(bx, bxx);
+ elm_radio_value_set(rd1, ELM_LIST_SCROLL);
+ api->mode = ELM_LIST_SCROLL;
+
+ bt_show = elm_button_add(win);
+ elm_object_text_set(bt_show, "Plain Genlist");
+ evas_object_smart_callback_add(bt_show, "clicked", test_genlist_show_item, api);
+ evas_object_show(bt_show);
+ elm_box_pack_end(bx, bt_show);
+
+ bt_bring = elm_button_add(win);
+ elm_object_text_set(bt_bring, "Genlist Tree");
+ evas_object_smart_callback_add(bt_bring, "clicked", test_genlist_show_tree, api);
+ evas_object_show(bt_bring);
+ elm_box_pack_end(bx, bt_bring);
+
+ evas_object_resize(win, 480, 400);
+ explode_win_enable(win);
+ evas_object_show(win);
+}
+
/*** Genlist Cache *********************************************************/
static char *
diff --git a/src/bin/elementary/test_gesture_framework.c b/src/bin/elementary/test_gesture_framework.c
index 169ceef09b..ada28bc50f 100644
--- a/src/bin/elementary/test_gesture_framework.c
+++ b/src/bin/elementary/test_gesture_framework.c
@@ -173,7 +173,7 @@ _color_and_icon_set(infra_data *infra, char *name, int n, int max,
/* START - Callbacks for gestures */
static void
-finger_tap_start(void *data , Efl_Gesture *tap)
+finger_tap_start(void *data , Efl_Canvas_Gesture *tap)
{
Eina_Vector2 pos = efl_gesture_hotspot_get(tap);
@@ -182,13 +182,13 @@ finger_tap_start(void *data , Efl_Gesture *tap)
}
static void
-finger_tap_update(void *data , Efl_Gesture *tap EINA_UNUSED)
+finger_tap_update(void *data , Efl_Canvas_Gesture *tap EINA_UNUSED)
{
_color_and_icon_set(data, TAP_NAME, 1, MAX_TAP, UPDATE_COLOR);
}
static void
-finger_tap_end(void *data , Efl_Gesture *tap)
+finger_tap_end(void *data , Efl_Canvas_Gesture *tap)
{
Eina_Vector2 pos = efl_gesture_hotspot_get(tap);
@@ -197,14 +197,14 @@ finger_tap_end(void *data , Efl_Gesture *tap)
}
static void
-finger_tap_abort(void *data , Efl_Gesture *tap EINA_UNUSED)
+finger_tap_abort(void *data , Efl_Canvas_Gesture *tap EINA_UNUSED)
{
_color_and_icon_set(data, TAP_NAME, 1, MAX_TAP, ABORT_COLOR);
printf("Tap Aborted\n");
}
static void
-finger_long_tap_start(void *data , Efl_Gesture *tap)
+finger_long_tap_start(void *data , Efl_Canvas_Gesture *tap)
{
Eina_Vector2 pos = efl_gesture_hotspot_get(tap);
@@ -213,14 +213,14 @@ finger_long_tap_start(void *data , Efl_Gesture *tap)
}
static void
-finger_long_tap_update(void *data , Efl_Gesture *tap EINA_UNUSED)
+finger_long_tap_update(void *data , Efl_Canvas_Gesture *tap EINA_UNUSED)
{
_color_and_icon_set(data, LONG_TAP_NAME, 1, MAX_TAP, UPDATE_COLOR);
printf("Long Tap Gesture updated\n");
}
static void
-finger_long_tap_end(void *data , Efl_Gesture *tap)
+finger_long_tap_end(void *data , Efl_Canvas_Gesture *tap)
{
Eina_Vector2 pos = efl_gesture_hotspot_get(tap);
@@ -229,7 +229,7 @@ finger_long_tap_end(void *data , Efl_Gesture *tap)
}
static void
-finger_long_tap_abort(void *data , Efl_Gesture *tap EINA_UNUSED)
+finger_long_tap_abort(void *data , Efl_Canvas_Gesture *tap EINA_UNUSED)
{
_color_and_icon_set(data, LONG_TAP_NAME, 1, MAX_TAP, ABORT_COLOR);
printf("Long Tap Aborted\n");
@@ -238,7 +238,7 @@ finger_long_tap_abort(void *data , Efl_Gesture *tap EINA_UNUSED)
static void
tap_gesture_cb(void *data , const Efl_Event *ev)
{
- Efl_Gesture *g = ev->info;
+ Efl_Canvas_Gesture *g = ev->info;
switch(efl_gesture_state_get(g))
{
case EFL_GESTURE_STARTED:
@@ -261,7 +261,7 @@ tap_gesture_cb(void *data , const Efl_Event *ev)
static void
long_tap_gesture_cb(void *data , const Efl_Event *ev)
{
- Efl_Gesture *g = ev->info;
+ Efl_Canvas_Gesture *g = ev->info;
switch(efl_gesture_state_get(g))
{
case EFL_GESTURE_STARTED:
diff --git a/src/bin/elementary/test_gesture_layer.c b/src/bin/elementary/test_gesture_layer.c
index a21fe0846b..28f3582ce7 100644
--- a/src/bin/elementary/test_gesture_layer.c
+++ b/src/bin/elementary/test_gesture_layer.c
@@ -57,6 +57,7 @@ apply_changes(Photo_Object *po)
po->bx + po->bw / 2, po->by + po->bh /2);
evas_object_map_enable_set(po->ic, EINA_TRUE);
evas_object_map_set(po->ic, map);
+ evas_object_anti_alias_set(po->ic, EINA_TRUE);
{
Evas_Map *shadow_map = evas_map_new(4);
diff --git a/src/bin/elementary/test_gfx_filters.c b/src/bin/elementary/test_gfx_filters.c
index 958688f308..72b0ba343e 100644
--- a/src/bin/elementary/test_gfx_filters.c
+++ b/src/bin/elementary/test_gfx_filters.c
@@ -247,7 +247,7 @@ _text_resize(void *data EINA_UNUSED, const Efl_Event *ev)
{
Eina_Size2D sz;
- sz = efl_gfx_size_get(ev->object);
+ sz = efl_gfx_entity_size_get(ev->object);
efl_gfx_size_hint_min_set(ev->object, sz);
}
@@ -296,8 +296,8 @@ _font_size_change(void *data, const Efl_Event *ev)
const char *font;
text = efl_key_wref_get(win, "text");
- efl_text_properties_font_get(text, &font, NULL);
- efl_text_properties_font_set(text, font, elm_spinner_value_get(ev->object));
+ efl_text_font_get(text, &font, NULL);
+ efl_text_font_set(text, font, elm_spinner_value_get(ev->object));
}
static void
@@ -333,7 +333,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
{
Eo *win, *box, *box2, *o, *text = NULL, *spinner, *code, *split, *flip, *tb;
- win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_text_set(efl_added, "Gfx Filter Editor"),
efl_ui_win_autodel_set(efl_added, 1));
@@ -459,11 +459,11 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
// Note: No TEXT object with EO APIs
o = text = evas_object_text_add(evas_object_evas_get(win));
- efl_event_callback_add(o, EFL_GFX_EVENT_RESIZE, _text_resize, NULL);
- efl_text_properties_font_set(o, "Sans:style=Bold", default_font_size);
- efl_gfx_scale_set(text, elm_config_scale_get());
+ efl_event_callback_add(o, EFL_GFX_ENTITY_EVENT_RESIZE, _text_resize, NULL);
+ efl_text_font_set(o, "Sans:style=Bold", default_font_size);
+ efl_gfx_entity_scale_set(text, elm_config_scale_get());
efl_text_set(o, "EFL");
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
efl_pack(box2, o);
o = box2 = efl_add(EFL_UI_BOX_STACK_CLASS, win,
@@ -491,7 +491,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
// Experimental textblock support
o = tb = evas_object_textblock_add(evas_object_evas_get(win));
efl_event_callback_add(o, EFL_CANVAS_TEXT_EVENT_STYLE_INSETS_CHANGED, _textblock_resize, NULL);
- efl_event_callback_add(o, EFL_GFX_EVENT_RESIZE, _textblock_resize, NULL);
+ efl_event_callback_add(o, EFL_GFX_ENTITY_EVENT_RESIZE, _textblock_resize, NULL);
Evas_Textblock_Style *st = evas_textblock_style_new();
evas_textblock_style_set(st, "DEFAULT='font=Sans font_size=20 color=#FFF wrap=word'");
for (size_t k = 0; k < EINA_C_ARRAY_LENGTH(programs); k++)
@@ -500,7 +500,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
efl_gfx_filter_data_set(o, prg_data[k].name, prg_data[k].value, prg_data[k].exec);
evas_object_textblock_style_set(o, st);
evas_object_textblock_text_markup_set(o, tbtxt);
- efl_gfx_scale_set(o, elm_config_scale_get());
+ efl_gfx_entity_scale_set(o, elm_config_scale_get());
efl_pack(box2, o);
evas_object_resize(o, 1, 1);
}
@@ -534,5 +534,5 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
elm_spinner_value_set(spinner, 1.0);
_spinner_cb(win, spinner, NULL);
- efl_gfx_size_set(win, EINA_SIZE2D(500, 600));
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(500, 600));
}
diff --git a/src/bin/elementary/test_glview.c b/src/bin/elementary/test_glview.c
index afd38448e2..6a133e9fd0 100644
--- a/src/bin/elementary/test_glview.c
+++ b/src/bin/elementary/test_glview.c
@@ -644,7 +644,7 @@ _test_glview_do(Evas_GL_Context_Version version)
elm_config_accel_preference_set(accel);
eina_stringshare_del(accel);
#else
- win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_ui_win_name_set(efl_added, "glview"),
efl_text_set(efl_added, "GLView"),
efl_ui_win_accel_preference_set(efl_added, "gl:depth"));
diff --git a/src/bin/elementary/test_icon.c b/src/bin/elementary/test_icon.c
index 9fa7dc7afe..ecd810baa9 100644
--- a/src/bin/elementary/test_icon.c
+++ b/src/bin/elementary/test_icon.c
@@ -626,6 +626,9 @@ _standard_genlist_populate(Evas_Object *gl)
IC("flag-vn")
IC("flag-za")
+ CONTEXT("Mimetypes")
+ IC("inode-directory")
+
#undef CONTEXT
#undef IC
diff --git a/src/bin/elementary/test_image.c b/src/bin/elementary/test_image.c
index 0dbdbef0b0..e118ef885e 100644
--- a/src/bin/elementary/test_image.c
+++ b/src/bin/elementary/test_image.c
@@ -99,14 +99,14 @@ im_align_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUS
}
static const struct {
- Efl_Image_Scale_Type scale_type;
+ Efl_Gfx_Image_Scale_Type scale_type;
const char *name;
} images_scale_type[] = {
- { EFL_IMAGE_SCALE_TYPE_NONE, "None" },
- { EFL_IMAGE_SCALE_TYPE_FILL, "Fill" },
- { EFL_IMAGE_SCALE_TYPE_FIT_INSIDE, "Fit Inside" },
- { EFL_IMAGE_SCALE_TYPE_FIT_OUTSIDE, "Fit Outside" },
- { EFL_IMAGE_SCALE_TYPE_TILE, "Tile" },
+ { EFL_GFX_IMAGE_SCALE_TYPE_NONE, "None" },
+ { EFL_GFX_IMAGE_SCALE_TYPE_FILL, "Fill" },
+ { EFL_GFX_IMAGE_SCALE_TYPE_FIT_INSIDE, "Fit Inside" },
+ { EFL_GFX_IMAGE_SCALE_TYPE_FIT_OUTSIDE, "Fit Outside" },
+ { EFL_GFX_IMAGE_SCALE_TYPE_TILE, "Tile" },
{ 0, NULL }
};
@@ -118,9 +118,9 @@ my_im_scale_ch(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_U
Evas_Object *rdg = evas_object_data_get(win, "rdg");
int v = elm_radio_value_get(rdg);
- efl_image_scale_type_set(im, images_scale_type[v].scale_type);
+ efl_gfx_image_scale_type_set(im, images_scale_type[v].scale_type);
fprintf(stderr, "Set %d[%s] and got %d\n",
- images_scale_type[v].scale_type, images_scale_type[v].name, efl_image_scale_type_get(im));
+ images_scale_type[v].scale_type, images_scale_type[v].name, efl_gfx_image_scale_type_get(im));
}
void
diff --git a/src/bin/elementary/test_multibuttonentry.c b/src/bin/elementary/test_multibuttonentry.c
index 2d371416a1..e4c3370908 100644
--- a/src/bin/elementary/test_multibuttonentry.c
+++ b/src/bin/elementary/test_multibuttonentry.c
@@ -3,7 +3,7 @@
#endif
#include <Elementary.h>
-static Efl_Ui_Multibuttonentry_Format_Cb format_func = NULL;
+static Elm_Multibuttonentry_Format_Cb format_func = NULL;
static char *
_custom_format(int count, void *data EINA_UNUSED)
diff --git a/src/bin/elementary/test_nstate.c b/src/bin/elementary/test_nstate.c
index ebc97d4f3c..4da3b21ac9 100644
--- a/src/bin/elementary/test_nstate.c
+++ b/src/bin/elementary/test_nstate.c
@@ -15,7 +15,7 @@ test_nstate(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
{
Evas_Object *win, *bx, *nstate;
- win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_text_set(efl_added, "N-state widget"),
elm_win_autodel_set(efl_added, EINA_TRUE));
@@ -29,5 +29,5 @@ test_nstate(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
efl_text_set(nstate, "nstate = 0");
efl_pack(bx, nstate);
- efl_gfx_size_set(win, EINA_SIZE2D(120, 80));
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(120, 80));
}
diff --git a/src/bin/elementary/test_panel.c b/src/bin/elementary/test_panel.c
index 41bffedfcc..60ad94edb2 100644
--- a/src/bin/elementary/test_panel.c
+++ b/src/bin/elementary/test_panel.c
@@ -2,7 +2,6 @@
# include "elementary_config.h"
#endif
#include <Elementary.h>
-#include <dirent.h>
#define LIST_ITEM_MAX 20
@@ -87,31 +86,32 @@ _item_del(void *data, Evas_Object *obj EINA_UNUSED)
static void
_fill_list(Evas_Object *obj, Elm_Genlist_Item_Class *itc)
{
- DIR *d;
- struct dirent *de;
Eina_List *l;
char *real;
- const char *home_env = NULL;
unsigned int x = 0;
if (!dirs)
{
- home_env = eina_environment_home_get();
- if (!home_env) return;
- if (!(d = opendir(home_env))) return;
- while ((de = readdir(d)) && (x < LIST_ITEM_MAX))
- {
- char buff[PATH_MAX];
-
- if (de->d_name[0] == '.') continue;
- snprintf(buff, sizeof(buff), "%s/%s", home_env, de->d_name);
+ Eina_Iterator *it;
+ const char *name;
- if (!ecore_file_is_dir(buff)) continue;
- x++;
- real = ecore_file_realpath(buff);
- dirs = eina_list_sorted_insert(dirs, EINA_COMPARE_CB(strcoll), real);
+ it = eina_file_ls(eina_environment_home_get());
+ EINA_ITERATOR_FOREACH(it, name)
+ {
+ if (x >= LIST_ITEM_MAX)
+ break;
+ if ((ecore_file_file_get(name)[0] != '.') &&
+ ecore_file_is_dir(name))
+ {
+ x++;
+ real = ecore_file_realpath(name);
+ dirs = eina_list_sorted_insert(dirs,
+ EINA_COMPARE_CB(strcoll),
+ real);
+ eina_stringshare_del(name);
+ }
}
- closedir(d);
+ eina_iterator_free(it);
}
EINA_LIST_FOREACH(dirs, l, real)
{
@@ -131,25 +131,24 @@ _fill_list(Evas_Object *obj, Elm_Genlist_Item_Class *itc)
static Eina_Bool
_dir_has_subs(const char *path)
{
- DIR *d;
- struct dirent *de;
+ Eina_Iterator *it;
+ const char *name;
Eina_Bool result = EINA_FALSE;
- if (!path) return result;
- if (!(d = opendir(path))) return result;
- while ((de = readdir(d)))
+ it = eina_file_ls(path);
+ EINA_ITERATOR_FOREACH(it, name)
{
- char buff[PATH_MAX];
+ Eina_Bool is_dir;
- if (de->d_name[0] == '.') continue;
- snprintf(buff, sizeof(buff), "%s/%s", path, de->d_name);
- if (ecore_file_is_dir(buff))
+ is_dir = ecore_file_is_dir(name);
+ eina_stringshare_del(name);
+ if (is_dir)
{
result = EINA_TRUE;
break;
}
}
- closedir(d);
+ eina_iterator_free(it);
return result;
}
diff --git a/src/bin/elementary/test_part_bg.c b/src/bin/elementary/test_part_bg.c
index 5a68e33c41..111af88de1 100644
--- a/src/bin/elementary/test_part_bg.c
+++ b/src/bin/elementary/test_part_bg.c
@@ -3,7 +3,7 @@
#endif
#include <Elementary.h>
-#define MAX_NUM_OF_CONTENT 19
+#define MAX_NUM_OF_CONTENT 18
const Efl_Class *content_class[MAX_NUM_OF_CONTENT];
@@ -39,7 +39,7 @@ _scale_type_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
Evas_Object *radio = data;
Evas_Object *target;
- Efl_Image_Scale_Type type;
+ Efl_Gfx_Image_Scale_Type type;
char buf[PATH_MAX];
radio = efl_ui_radio_selected_object_get(radio);
@@ -47,9 +47,9 @@ _scale_type_cb(void *data, const Efl_Event *ev EINA_UNUSED)
snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
efl_file_set(efl_part(target, "background"), buf, NULL);
- type = efl_image_scale_type_get(efl_part(target, "background"));
+ type = efl_gfx_image_scale_type_get(efl_part(target, "background"));
type = (type + 1) % 5;
- efl_image_scale_type_set(efl_part(target, "background"), type);
+ efl_gfx_image_scale_type_set(efl_part(target, "background"), type);
}
static Evas_Object *
@@ -77,7 +77,7 @@ _create_box_contents(Evas_Object *box)
content = efl_add(EFL_UI_TEXT_CLASS, content,
efl_text_set(efl_added, "box"),
- efl_ui_text_interactive_editable_set(efl_added, EINA_FALSE),
+ efl_text_interactive_editable_set(efl_added, EINA_FALSE),
efl_pack_end(content, efl_added));
for (i = 0; i < MAX_NUM_OF_CONTENT; i++)
@@ -126,24 +126,23 @@ test_part_background(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
content_class[0] = EFL_UI_CALENDAR_CLASS;
content_class[1] = EFL_UI_SLIDER_CLASS;
content_class[2] = EFL_UI_SLIDER_INTERVAL_CLASS;
- content_class[3] = EFL_UI_MULTIBUTTONENTRY_CLASS;
- content_class[4] = EFL_UI_PROGRESSBAR_CLASS;
- content_class[5] = EFL_UI_CLOCK_CLASS;
- content_class[6] = EFL_UI_BUTTON_CLASS;
- content_class[7] = EFL_UI_CHECK_CLASS;
- content_class[8] = EFL_UI_RADIO_CLASS;
- content_class[9] = EFL_UI_TEXT_CLASS;
- content_class[10] = EFL_UI_FLIP_CLASS;
- content_class[11] = EFL_UI_PANES_CLASS;
- content_class[12] = EFL_UI_VIDEO_CLASS;
- content_class[13] = EFL_UI_BG_WIDGET_CLASS;
- content_class[14] = EFL_UI_IMAGE_CLASS;
- content_class[15] = EFL_UI_IMAGE_ZOOMABLE_CLASS;
- content_class[16] = EFL_UI_NSTATE_CLASS;
- content_class[17] = EFL_UI_SPIN_CLASS;
- content_class[18] = EFL_UI_SPIN_BUTTON_CLASS;
-
- win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ content_class[3] = EFL_UI_PROGRESSBAR_CLASS;
+ content_class[4] = EFL_UI_CLOCK_CLASS;
+ content_class[5] = EFL_UI_BUTTON_CLASS;
+ content_class[6] = EFL_UI_CHECK_CLASS;
+ content_class[7] = EFL_UI_RADIO_CLASS;
+ content_class[8] = EFL_UI_TEXT_CLASS;
+ content_class[9] = EFL_UI_FLIP_CLASS;
+ content_class[10] = EFL_UI_PANES_CLASS;
+ content_class[11] = EFL_UI_VIDEO_CLASS;
+ content_class[12] = EFL_UI_BG_WIDGET_CLASS;
+ content_class[13] = EFL_UI_IMAGE_CLASS;
+ content_class[14] = EFL_UI_IMAGE_ZOOMABLE_CLASS;
+ content_class[15] = EFL_UI_NSTATE_CLASS;
+ content_class[16] = EFL_UI_SPIN_CLASS;
+ content_class[17] = EFL_UI_SPIN_BUTTON_CLASS;
+
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_text_set(efl_added, "Widget Part Background"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
@@ -182,5 +181,5 @@ test_part_background(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
efl_event_callback_add(color_btn, EFL_UI_EVENT_CLICKED, _color_cb, radio_group);
efl_event_callback_add(scale_btn, EFL_UI_EVENT_CLICKED, _scale_type_cb, radio_group);
- efl_gfx_size_set(win, EINA_SIZE2D(300, 200));
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(300, 200));
}
diff --git a/src/bin/elementary/test_part_shadow.c b/src/bin/elementary/test_part_shadow.c
index a1eee81a4d..2df5f6766b 100644
--- a/src/bin/elementary/test_part_shadow.c
+++ b/src/bin/elementary/test_part_shadow.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define ELM_WIDGET_PROTECTED
+#define EFL_UI_WIDGET_PROTECTED
#include <Elementary.h>
typedef struct Test_Data
@@ -71,7 +71,7 @@ _delete_cb(void *data, const Efl_Event *ev)
Test_Data *td = data;
pulse_stop(td, NULL);
- efl_del(ev->object);
+ efl_unref(ev->object);
free(td);
}
@@ -85,7 +85,7 @@ test_part_shadow(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
td = calloc(1, sizeof(*td));
- win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_ui_win_name_set(efl_added, "shadow"),
efl_text_set(efl_added, "Shadow effects"));
efl_event_callback_add(win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _delete_cb, td);
@@ -190,5 +190,5 @@ test_part_shadow(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
efl_pack(bt_bx, bt);
td->btn_stop = bt;
- efl_gfx_size_set(win, EINA_SIZE2D(240, 320));
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(240, 320));
}
diff --git a/src/bin/elementary/test_photocam.c b/src/bin/elementary/test_photocam.c
index 58e34e1a31..f6c2e9711b 100644
--- a/src/bin/elementary/test_photocam.c
+++ b/src/bin/elementary/test_photocam.c
@@ -765,9 +765,9 @@ _zoomable_move_resize_cb(void *data, const Efl_Event *ev)
{
Eina_Rect r;
- r = efl_gfx_geometry_get(ev->object);
- efl_gfx_size_set(data, EINA_SIZE2D(r.w, r.h));
- efl_gfx_position_set(data, r.pos);
+ r = efl_gfx_entity_geometry_get(ev->object);
+ efl_gfx_entity_size_set(data, EINA_SIZE2D(r.w, r.h));
+ efl_gfx_entity_position_set(data, r.pos);
}
static void
@@ -777,7 +777,7 @@ _zoomable_mouse_wheel_cb(void *data, const Efl_Event *e)
Efl_Input_Pointer *ev = e->info;
int zoom, _zoom, delta, val;
- zoom = efl_ui_zoom_get(zoomable);
+ zoom = efl_ui_zoom_level_get(zoomable);
delta = efl_input_pointer_wheel_delta_get(ev);
if ((delta > 0) && (zoom == 1)) return;
@@ -795,7 +795,7 @@ _zoomable_mouse_wheel_cb(void *data, const Efl_Event *e)
}
efl_ui_zoom_mode_set(zoomable, EFL_UI_ZOOM_MODE_MANUAL);
- if (zoom >= 1) efl_ui_zoom_set(zoomable, zoom);
+ if (zoom >= 1) efl_ui_zoom_level_set(zoomable, zoom);
}
void
@@ -804,7 +804,7 @@ test_image_zoomable_animated(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE
Eo *win, *bx, *zoomable, *rect;
char buf[PATH_MAX];
- win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
efl_text_set(efl_added, "Efl.Ui.Image_Zoomable animation"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
@@ -815,7 +815,7 @@ test_image_zoomable_animated(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE
efl_add(EFL_UI_TEXT_CLASS, bx,
efl_text_set(efl_added, "Clicking the image will play/pause animation."),
- efl_ui_text_interactive_editable_set(efl_added, EINA_FALSE),
+ efl_text_interactive_editable_set(efl_added, EINA_FALSE),
efl_gfx_size_hint_weight_set(efl_added, 1, 0),
efl_canvas_text_style_set(efl_added, NULL, "DEFAULT='align=center font=Sans font_size=10 color=#fff wrap=word'"),
efl_pack(bx, efl_added)
@@ -842,8 +842,8 @@ test_image_zoomable_animated(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE
);
// add move/resize callbacks to resize rect manually
- efl_event_callback_add(zoomable, EFL_GFX_EVENT_RESIZE, _zoomable_move_resize_cb, rect);
- efl_event_callback_add(zoomable, EFL_GFX_EVENT_MOVE, _zoomable_move_resize_cb, rect);
+ efl_event_callback_add(zoomable, EFL_GFX_ENTITY_EVENT_RESIZE, _zoomable_move_resize_cb, rect);
+ efl_event_callback_add(zoomable, EFL_GFX_ENTITY_EVENT_MOVE, _zoomable_move_resize_cb, rect);
- efl_gfx_size_set(win, EINA_SIZE2D(300, 320));
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(300, 320));
}
diff --git a/src/bin/elementary/test_progressbar.c b/src/bin/elementary/test_progressbar.c
index 91282c0cde..9b559e129a 100644
--- a/src/bin/elementary/test_progressbar.c
+++ b/src/bin/elementary/test_progressbar.c
@@ -12,6 +12,7 @@ typedef struct Progressbar_Data
Evas_Object *pb5;
Evas_Object *pb6;
Evas_Object *pb7;
+ Evas_Object *pb8;
Ecore_Timer *timer;
Evas_Object *btn_start;
Evas_Object *btn_stop;
@@ -49,7 +50,9 @@ my_progressbar_test_start(void *data, Evas_Object *obj EINA_UNUSED, void *event_
elm_progressbar_pulse(pd->pb5, EINA_TRUE);
fprintf(stderr, "s3 %p\n", pd->pb7);
elm_progressbar_pulse(pd->pb7, EINA_TRUE);
- fprintf(stderr, "s4\n");
+ fprintf(stderr, "s4 %p\n", pd->pb8);
+ elm_progressbar_pulse(pd->pb8, EINA_TRUE);
+ fprintf(stderr, "s5\n");
elm_object_disabled_set(pd->btn_start, EINA_TRUE);
elm_object_disabled_set(pd->btn_stop, EINA_FALSE);
@@ -67,6 +70,7 @@ my_progressbar_test_stop(void *data, Evas_Object *obj EINA_UNUSED, void *event_i
elm_progressbar_pulse(pd->pb2, EINA_FALSE);
elm_progressbar_pulse(pd->pb5, EINA_FALSE);
elm_progressbar_pulse(pd->pb7, EINA_FALSE);
+ elm_progressbar_pulse(pd->pb8, EINA_FALSE);
elm_object_disabled_set(pd->btn_start, EINA_FALSE);
elm_object_disabled_set(pd->btn_stop, EINA_TRUE);
@@ -105,7 +109,7 @@ void
test_progressbar(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
Evas_Object *win, *pb, *bx, *hbx, *bt, *bt_bx, *ic1, *ic2;
- char buf[PATH_MAX];
+ char buf[PATH_MAX], form[20];
Progressbar_Data *pd;
pd = (Progressbar_Data *)calloc(1, sizeof(Progressbar_Data));
@@ -164,11 +168,15 @@ test_progressbar(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
elm_box_pack_end(bx, hbx);
evas_object_show(hbx);
+ snprintf(form, sizeof(form), "%d percent (%d%%%%)", 50, 50);
+
pb = elm_progressbar_add(win);
elm_progressbar_horizontal_set(pb, EINA_FALSE);
evas_object_size_hint_weight_set(pb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(pb, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(hbx, pb);
+ elm_progressbar_unit_format_set(pb, form);
+ elm_progressbar_value_set(pb, .50);
elm_object_text_set(pb, "percent");
evas_object_show(pb);
pd->pb4 = pb;
@@ -213,6 +221,17 @@ test_progressbar(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
evas_object_show(pb);
pd->pb7 = pb;
+ pb = elm_progressbar_add(win);
+ elm_progressbar_horizontal_set(pb, EINA_FALSE);
+ elm_object_style_set(pb, "wheel");
+ elm_object_text_set(pb, "Style: wheel vert");
+ elm_progressbar_pulse_set(pb, EINA_TRUE);
+ evas_object_size_hint_weight_set(pb, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(pb, EVAS_HINT_FILL, 0.5);
+ elm_box_pack_end(bx, pb);
+ evas_object_show(pb);
+ pd->pb8 = pb;
+
bt_bx = elm_box_add(win);
elm_box_horizontal_set(bt_bx, EINA_TRUE);
evas_object_size_hint_weight_set(bt_bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
diff --git a/src/bin/elementary/test_scroller.c b/src/bin/elementary/test_scroller.c
index ead5bbca34..a6670c6613 100644
--- a/src/bin/elementary/test_scroller.c
+++ b/src/bin/elementary/test_scroller.c
@@ -494,8 +494,8 @@ _bounce_cb(void *data)
if (!bounce->y1)
{
elm_interface_scrollable_bounce_allow_set(bounce->scroller, 0, 1);
- bounce->y1 = efl_gfx_position_get(bounce->it1).y;
- bounce->y2 = efl_gfx_position_get(bounce->it2).y;
+ bounce->y1 = efl_gfx_entity_position_get(bounce->it1).y;
+ bounce->y2 = efl_gfx_entity_position_get(bounce->it2).y;
}
bounce->state++;
@@ -522,8 +522,8 @@ _bounce_cb(void *data)
unsigned long long tll, t0ll, tdll, frames;
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &t);
- t0ll = (t0.tv_sec * 1000000000) + t0.tv_nsec;
- tll = (t.tv_sec * 1000000000) + t.tv_nsec;
+ t0ll = ((unsigned long long) t0.tv_sec * 1000000000ULL) + t0.tv_nsec;
+ tll = ((unsigned long long) t.tv_sec * 1000000000ULL) + t.tv_nsec;
tdll = tll - t0ll;
frames = bounce->frames ?: 1;
printf("NS since frame 2 = %llu , %llu frames = %llu / frame\n",
diff --git a/src/bin/elementary/test_ui_box.c b/src/bin/elementary/test_ui_box.c
index dcaacebb4d..effa539463 100644
--- a/src/bin/elementary/test_ui_box.c
+++ b/src/bin/elementary/test_ui_box.c
@@ -178,7 +178,7 @@ _custom_layout_update(Eo *pack, const void *data EINA_UNUSED)
if (!count) return;
- rp = efl_gfx_geometry_get(pack);
+ rp = efl_gfx_entity_geometry_get(pack);
EINA_ITERATOR_FOREACH(it, sobj)
{
Eina_Rect r;
@@ -186,7 +186,7 @@ _custom_layout_update(Eo *pack, const void *data EINA_UNUSED)
r.x = (rp.w / count) * i;
r.y = (rp.h / count) * i;
r.size = efl_gfx_size_hint_combined_min_get(sobj);
- efl_gfx_geometry_set(sobj, r);
+ efl_gfx_entity_geometry_set(sobj, r);
i++;
}
eina_iterator_free(it);
@@ -219,7 +219,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
win = elm_win_util_standard_add("ui-box", "Efl.Ui.Box");
elm_win_autodel_set(win, EINA_TRUE);
- efl_gfx_size_set(win, EINA_SIZE2D(600, 400));
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(600, 400));
vbox = efl_add(EFL_UI_BOX_CLASS, win,
efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
@@ -234,7 +234,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
efl_gfx_size_hint_align_set(f, -1, -1);
efl_gfx_size_hint_weight_set(f, 1, 0);
efl_pack(vbox, f);
- efl_gfx_visible_set(f, 1);
+ efl_gfx_entity_visible_set(f, 1);
hbox = efl_add(EFL_UI_BOX_CLASS, win,
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
@@ -254,7 +254,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
efl_gfx_size_hint_align_set(o, 0, 0.5);
elm_radio_state_value_set(o, NONE);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_radio_add(win);
elm_object_text_set(o, "No weight + box fill");
@@ -263,7 +263,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
elm_radio_state_value_set(o, NONE_BUT_FILL);
elm_radio_group_add(o, chk);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_radio_add(win);
elm_object_text_set(o, "Equal weights");
@@ -272,7 +272,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
elm_radio_state_value_set(o, EQUAL);
elm_radio_group_add(o, chk);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_radio_add(win);
elm_object_text_set(o, "One weight only");
@@ -281,7 +281,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
elm_radio_state_value_set(o, ONE);
elm_radio_group_add(o, chk);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_radio_add(win);
elm_object_text_set(o, "Two weights");
@@ -290,7 +290,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
elm_radio_state_value_set(o, TWO);
elm_radio_group_add(o, chk);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
elm_radio_value_set(chk, NONE);
@@ -305,7 +305,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
o = elm_label_add(win);
elm_object_text_set(o, "Misc");
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_check_add(win);
elm_check_selected_set(o, 0);
@@ -313,7 +313,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
efl_event_callback_add(o, EFL_UI_CHECK_EVENT_CHANGED, flow_check_cb, win);
efl_gfx_size_hint_align_set(o, 0, 0);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_check_add(win);
elm_check_selected_set(o, 1);
@@ -321,7 +321,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
efl_event_callback_add(o, EFL_UI_CHECK_EVENT_CHANGED, horiz_check_cb, win);
efl_gfx_size_hint_align_set(o, 0, 0);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_check_add(win);
elm_check_selected_set(o, 0);
@@ -329,7 +329,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
efl_event_callback_add(o, EFL_UI_CHECK_EVENT_CHANGED, homo_check_cb, win);
efl_gfx_size_hint_align_set(o, 0, 0);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_check_add(win);
elm_check_selected_set(o, 0);
@@ -337,7 +337,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
efl_event_callback_add(o, EFL_UI_CHECK_EVENT_CHANGED, max_size_check_cb, win);
efl_gfx_size_hint_align_set(o, 0, 0);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_check_add(win);
elm_check_selected_set(o, 0);
@@ -346,7 +346,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
efl_gfx_size_hint_align_set(o, 0, 0);
efl_gfx_size_hint_weight_set(o, 0, 1);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
/* user min size setter */
@@ -359,7 +359,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
o = elm_label_add(win);
elm_object_text_set(o, "User min size");
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_slider_add(win);
elm_slider_indicator_format_set(o, "%.0fpx");
@@ -372,7 +372,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
elm_slider_inverted_set(o, 1);
elm_slider_value_set(o, 0);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
/* inner box padding */
@@ -385,7 +385,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
o = elm_label_add(win);
elm_object_text_set(o, "Padding");
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_slider_add(win);
elm_slider_indicator_format_set(o, "%.0fpx");
@@ -398,7 +398,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
elm_slider_inverted_set(o, 1);
elm_slider_value_set(o, 10);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
/* outer margin */
@@ -411,7 +411,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
o = elm_label_add(win);
elm_object_text_set(o, "Margin");
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_slider_add(win);
elm_slider_indicator_format_set(o, "%.0fpx");
@@ -424,7 +424,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
elm_slider_inverted_set(o, 1);
elm_slider_value_set(o, 10);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
/* Box align */
@@ -437,7 +437,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
o = elm_label_add(win);
elm_object_text_set(o, "Box align");
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_slider_add(win);
elm_slider_indicator_format_set(o, "%.1f");
@@ -450,7 +450,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
elm_slider_step_set(o, 0.1);
elm_slider_value_set(o, 0.5);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_slider_add(win);
elm_slider_indicator_format_set(o, "%.1f");
@@ -464,7 +464,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
elm_slider_step_set(o, 0.1);
elm_slider_value_set(o, 0.5);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
/* contents */
@@ -473,7 +473,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
efl_gfx_size_hint_align_set(f, -1, -1);
efl_gfx_size_hint_weight_set(f, 1, 1);
efl_pack(vbox, f);
- efl_gfx_visible_set(f, 1);
+ efl_gfx_entity_visible_set(f, 1);
bx = efl_add(EFL_UI_BOX_CLASS, win,
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
@@ -486,65 +486,65 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
objects[i++] = o = elm_button_add(win);
elm_object_text_set(o, "Btn1");
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
objects[i++] = o = elm_button_add(win);
elm_object_text_set(o, "Button 2");
efl_gfx_size_hint_align_set(o, -1, -1);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
objects[i++] = o = elm_label_add(win);
elm_label_line_wrap_set(o, ELM_WRAP_WORD);
elm_object_text_set(o, "This label is not marked as fill");
efl_gfx_size_hint_align_set(o, 0.5, 0.5);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
objects[i++] = o = elm_button_add(win);
elm_object_text_set(o, "Min size");
efl_gfx_size_hint_align_set(o, 0.5, 1.0);
efl_gfx_size_hint_aspect_set(o, EFL_GFX_SIZE_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 1));
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
objects[i++] = o = elm_button_add(win);
elm_object_text_set(o, "Quit!");
efl_gfx_size_hint_align_set(o, 0.5, 0.0);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
objects[i++] = o = elm_label_add(win);
elm_label_line_wrap_set(o, ELM_WRAP_WORD);
elm_object_text_set(o, "This label on the other hand<br/>is marked as align=fill.");
efl_gfx_size_hint_align_set(o, -1, -1);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
objects[i++] = o = elm_button_add(win);
elm_object_text_set(o, "Button with a quite long text.");
efl_gfx_size_hint_align_set(o, -1, -1);
efl_gfx_size_hint_max_set(o, EINA_SIZE2D(200, 100));
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
objects[i++] = o = elm_button_add(win);
elm_object_text_set(o, "BtnA");
efl_gfx_size_hint_aspect_set(o, EFL_GFX_SIZE_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 2));
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
objects[i++] = o = elm_button_add(win);
elm_object_text_set(o, "BtnB");
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
objects[i++] = o = elm_button_add(win);
elm_object_text_set(o, "BtnC");
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
assert(i == CNT);
- efl_gfx_visible_set(win, 1);
+ efl_gfx_entity_visible_set(win, 1);
}
diff --git a/src/bin/elementary/test_ui_button.c b/src/bin/elementary/test_ui_button.c
new file mode 100644
index 0000000000..f5aa340ad6
--- /dev/null
+++ b/src/bin/elementary/test_ui_button.c
@@ -0,0 +1,78 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+#include <Elementary.h>
+
+static void
+_clicked(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
+{
+ printf("Button is clicked!!!\n");
+}
+
+static void
+_pressed(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
+{
+ printf("Button is pressed!!!\n");
+}
+
+static void
+_unpressed(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
+{
+ printf("Button is unpressed!!!\n");
+}
+
+void
+test_ui_button(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Eo *win, *bx, *btn;
+ char buf[PATH_MAX];
+
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
+ efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
+ efl_text_set(efl_added, "Efl.Ui.Button"),
+ efl_ui_win_autodel_set(efl_added, EINA_TRUE)
+ );
+
+ bx = efl_add(EFL_UI_BOX_CLASS, win,
+ efl_content_set(win, efl_added),
+ efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
+
+ // Text Only Button
+ efl_add(EFL_UI_BUTTON_CLASS, bx,
+ efl_text_set(efl_added, "Text"),
+ efl_pack(bx, efl_added),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _clicked, NULL),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_PRESSED, _pressed, NULL),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_UNPRESSED, _unpressed, NULL)
+ );
+
+ // Icon Only Button
+ snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
+ btn = efl_add(EFL_UI_BUTTON_CLASS, bx,
+ efl_pack(bx, efl_added),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _clicked, NULL),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_PRESSED, _pressed, NULL),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_UNPRESSED, _unpressed, NULL)
+ );
+ efl_add(EFL_UI_IMAGE_CLASS, btn,
+ efl_file_set(efl_added, buf, NULL),
+ efl_content_set(btn, efl_added)
+ );
+
+ // Text + Icon Button
+ snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
+ btn = efl_add(EFL_UI_BUTTON_CLASS, bx,
+ efl_text_set(efl_added, "Text + Icon"),
+ efl_pack(bx, efl_added),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _clicked, NULL),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_PRESSED, _pressed, NULL),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_UNPRESSED, _unpressed, NULL)
+ );
+ efl_add(EFL_UI_IMAGE_CLASS, btn,
+ efl_file_set(efl_added, buf, NULL),
+ efl_content_set(btn, efl_added)
+ );
+
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(320, 400));
+}
+
diff --git a/src/bin/elementary/test_ui_clock.c b/src/bin/elementary/test_ui_clock.c
index ad401c3bc9..2e667b5026 100644
--- a/src/bin/elementary/test_ui_clock.c
+++ b/src/bin/elementary/test_ui_clock.c
@@ -47,7 +47,7 @@ test_ui_clock(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
{
Evas_Object *win, *bx;
- win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
efl_text_set(efl_added, "Efl.Ui.Clock"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
diff --git a/src/bin/elementary/test_ui_datepicker.c b/src/bin/elementary/test_ui_datepicker.c
new file mode 100644
index 0000000000..1eb04612b1
--- /dev/null
+++ b/src/bin/elementary/test_ui_datepicker.c
@@ -0,0 +1,37 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+#include <Elementary.h>
+
+static void
+_date_changed_cb(void *data EINA_UNUSED, const Efl_Event *ev)
+{
+ int year, month, day;
+
+ efl_ui_datepicker_date_get(ev->object, &year, &month, &day);
+ printf("Current date is %d %d %d\n", year, month, day);
+}
+
+void
+test_ui_datepicker(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Eo *win, *bx;
+
+ win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
+ efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
+ efl_text_set(efl_added, "Efl.Ui.Datepicker"),
+ efl_ui_win_autodel_set(efl_added, EINA_TRUE));
+
+ bx = efl_add(EFL_UI_BOX_CLASS, win,
+ efl_content_set(win, efl_added),
+ efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
+
+ efl_add(EFL_UI_DATEPICKER_CLASS, bx,
+ efl_ui_datepicker_date_set(efl_added, 1987, 9, 17),
+ efl_ui_datepicker_max_set(efl_added, 1990, 9, 17),
+ efl_ui_datepicker_min_set(efl_added, 1980, 9, 17),
+ efl_event_callback_add(efl_added, EFL_UI_DATEPICKER_EVENT_CHANGED,_date_changed_cb, NULL),
+ efl_pack(bx, efl_added));
+
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(150, 170));
+}
diff --git a/src/bin/elementary/test_ui_panes.c b/src/bin/elementary/test_ui_panes.c
index 58a70f3c33..4e6d3373e0 100644
--- a/src/bin/elementary/test_ui_panes.c
+++ b/src/bin/elementary/test_ui_panes.c
@@ -8,7 +8,7 @@ test_panes_minsize(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
{
Eo *win, *panes, *panes_h;
- win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
efl_text_set(efl_added, "Efl.Ui.Panes"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE)
@@ -42,6 +42,6 @@ test_panes_minsize(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
efl_content_set(efl_part(panes_h, "second"), efl_added)
);
- efl_gfx_size_set(win, EINA_SIZE2D(320, 400));
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(320, 400));
}
diff --git a/src/bin/elementary/test_ui_popup.c b/src/bin/elementary/test_ui_popup.c
index e94c1b69ba..3c8ae67239 100644
--- a/src/bin/elementary/test_ui_popup.c
+++ b/src/bin/elementary/test_ui_popup.c
@@ -50,7 +50,7 @@ _create_popup(efl_ui_popup_data *p_data)
if (p_data->efl_ui_popup)
{
printf("Efl.Ui.Popup is already created.\n");
- efl_gfx_visible_set(p_data->efl_ui_popup, EINA_TRUE);
+ efl_gfx_entity_visible_set(p_data->efl_ui_popup, EINA_TRUE);
return p_data->efl_ui_popup;
}
@@ -124,14 +124,14 @@ _dummy_cb(void *data EINA_UNUSED, const Efl_Event *ev)
{
efl_ui_popup_data *p_data = data;
if (!p_data->efl_ui_popup) return;
- if (!efl_gfx_visible_get(p_data->button))
+ if (!efl_gfx_entity_visible_get(p_data->button))
{
- efl_gfx_visible_set(p_data->button, EINA_TRUE);
+ efl_gfx_entity_visible_set(p_data->button, EINA_TRUE);
efl_text_set(ev->object, "Hide Dummy Button");
}
else
{
- efl_gfx_visible_set(p_data->button, EINA_FALSE);
+ efl_gfx_entity_visible_set(p_data->button, EINA_FALSE);
efl_text_set(ev->object, "Show Dummy Button");
}
}
@@ -181,7 +181,7 @@ _position_set_cb(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
{
efl_ui_popup_data *p_data = data;
if (!p_data->efl_ui_popup) return;
- efl_gfx_position_set(p_data->efl_ui_popup, EINA_POSITION2D(0, 0));
+ efl_gfx_entity_position_set(p_data->efl_ui_popup, EINA_POSITION2D(0, 0));
}
static void
@@ -213,7 +213,7 @@ static void
_win_del(void *data, const Efl_Event *ev EINA_UNUSED)
{
efl_ui_popup_data *p_data = data;
- efl_del(p_data->panel_win);
+ efl_unref(p_data->panel_win);
free(p_data);
printf("window is deleted\n");
}
@@ -222,7 +222,7 @@ static void
_panel_win_del(void *data, const Efl_Event *ev EINA_UNUSED)
{
efl_ui_popup_data *p_data = data;
- efl_del(p_data->win);
+ efl_unref(p_data->win);
free(p_data);
printf("window is deleted\n");
}
@@ -232,26 +232,26 @@ test_ui_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
{
efl_ui_popup_data *p_data = (efl_ui_popup_data*)calloc(1, sizeof(efl_ui_popup_data));
- Eo *win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ Eo *win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_text_set(efl_added, "Efl.Ui.Popup"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
efl_event_callback_add(win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _win_del, p_data);
- efl_gfx_size_set(win, EINA_SIZE2D(500, 500));
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(500, 500));
- Eo *panel_win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ Eo *panel_win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_text_set(efl_added, "Efl.Ui.Popup Panel"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
efl_event_callback_add(panel_win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _panel_win_del, p_data);
- efl_gfx_size_set(panel_win, EINA_SIZE2D(300, 500));
+ efl_gfx_entity_size_set(panel_win, EINA_SIZE2D(300, 500));
Eo *repeat_test_btn = efl_add(EFL_UI_BUTTON_CLASS, win);
- efl_gfx_position_set(repeat_test_btn, EINA_POSITION2D(0, 0));
- efl_gfx_size_set(repeat_test_btn, EINA_SIZE2D(100, 100));
+ efl_gfx_entity_position_set(repeat_test_btn, EINA_POSITION2D(0, 0));
+ efl_gfx_entity_size_set(repeat_test_btn, EINA_SIZE2D(100, 100));
efl_text_set(repeat_test_btn, "Repeat Event Test");
efl_event_callback_add(repeat_test_btn, EFL_UI_EVENT_CLICKED, _repeat_test_cb, NULL);
- efl_gfx_visible_set(repeat_test_btn, EINA_FALSE);
+ efl_gfx_entity_visible_set(repeat_test_btn, EINA_FALSE);
p_data->win = win;
p_data->panel_win = panel_win;
@@ -260,74 +260,74 @@ test_ui_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
Eo *create_btn = efl_add(EFL_UI_BUTTON_CLASS, panel_win);
efl_text_set(create_btn, "Create Popup");
- efl_gfx_position_set(create_btn, EINA_POSITION2D(0, 0));
- efl_gfx_size_set(create_btn, EINA_SIZE2D(150, 50));
+ efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 0));
+ efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(150, 50));
efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _create_cb, p_data);
Eo *delete_btn = efl_add(EFL_UI_BUTTON_CLASS, panel_win);
efl_text_set(delete_btn, "Delete Popup");
- efl_gfx_position_set(delete_btn, EINA_POSITION2D(150, 0));
- efl_gfx_size_set(delete_btn, EINA_SIZE2D(150, 50));
+ efl_gfx_entity_position_set(delete_btn, EINA_POSITION2D(150, 0));
+ efl_gfx_entity_size_set(delete_btn, EINA_SIZE2D(150, 50));
efl_event_callback_add(delete_btn, EFL_UI_EVENT_CLICKED, _delete_cb, p_data);
Eo *repeat_event_btn = efl_add(EFL_UI_BUTTON_CLASS, panel_win);
efl_text_set(repeat_event_btn, "Repeat Event Set");
- efl_gfx_position_set(repeat_event_btn, EINA_POSITION2D(0, 50));
- efl_gfx_size_set(repeat_event_btn, EINA_SIZE2D(150, 50));
+ efl_gfx_entity_position_set(repeat_event_btn, EINA_POSITION2D(0, 50));
+ efl_gfx_entity_size_set(repeat_event_btn, EINA_SIZE2D(150, 50));
efl_event_callback_add(repeat_event_btn, EFL_UI_EVENT_CLICKED, _repeat_event_cb, p_data);
Eo *dummy_btn = efl_add(EFL_UI_BUTTON_CLASS, panel_win);
efl_text_set(dummy_btn, "Show Dummy Button");
- efl_gfx_position_set(dummy_btn, EINA_POSITION2D(150, 50));
- efl_gfx_size_set(dummy_btn, EINA_SIZE2D(150, 50));
+ efl_gfx_entity_position_set(dummy_btn, EINA_POSITION2D(150, 50));
+ efl_gfx_entity_size_set(dummy_btn, EINA_SIZE2D(150, 50));
efl_event_callback_add(dummy_btn, EFL_UI_EVENT_CLICKED, _dummy_cb, p_data);
Eo *backwall_btn = efl_add(EFL_UI_BUTTON_CLASS, panel_win);
- efl_gfx_position_set(backwall_btn, EINA_POSITION2D(0, 100));
- efl_gfx_size_set(backwall_btn, EINA_SIZE2D(150, 50));
+ efl_gfx_entity_position_set(backwall_btn, EINA_POSITION2D(0, 100));
+ efl_gfx_entity_size_set(backwall_btn, EINA_SIZE2D(150, 50));
efl_text_set(backwall_btn, "Backwall Set");
efl_event_callback_add(backwall_btn, EFL_UI_EVENT_CLICKED, _backwall_cb, p_data);
Eo *timeout_btn = efl_add(EFL_UI_BUTTON_CLASS, panel_win);
efl_text_set(timeout_btn, "Timeout Set");
- efl_gfx_position_set(timeout_btn, EINA_POSITION2D(150, 100));
- efl_gfx_size_set(timeout_btn, EINA_SIZE2D(150, 50));
+ efl_gfx_entity_position_set(timeout_btn, EINA_POSITION2D(150, 100));
+ efl_gfx_entity_size_set(timeout_btn, EINA_SIZE2D(150, 50));
efl_event_callback_add(timeout_btn, EFL_UI_EVENT_CLICKED, _timeout_set_cb, p_data);
Eo *center_btn = efl_add(EFL_UI_BUTTON_CLASS, panel_win);
efl_text_set(center_btn, "Center Align");
- efl_gfx_position_set(center_btn, EINA_POSITION2D(0, 150));
- efl_gfx_size_set(center_btn, EINA_SIZE2D(150, 50));
+ efl_gfx_entity_position_set(center_btn, EINA_POSITION2D(0, 150));
+ efl_gfx_entity_size_set(center_btn, EINA_SIZE2D(150, 50));
efl_event_callback_add(center_btn, EFL_UI_EVENT_CLICKED, _center_align_cb, p_data);
Eo *top_btn = efl_add(EFL_UI_BUTTON_CLASS, panel_win);
efl_text_set(top_btn, "Top Align");
- efl_gfx_position_set(top_btn, EINA_POSITION2D(150, 150));
- efl_gfx_size_set(top_btn, EINA_SIZE2D(150, 50));
+ efl_gfx_entity_position_set(top_btn, EINA_POSITION2D(150, 150));
+ efl_gfx_entity_size_set(top_btn, EINA_SIZE2D(150, 50));
efl_event_callback_add(top_btn, EFL_UI_EVENT_CLICKED, _top_align_cb, p_data);
Eo *left_btn = efl_add(EFL_UI_BUTTON_CLASS, panel_win);
efl_text_set(left_btn, "Left Align");
- efl_gfx_position_set(left_btn, EINA_POSITION2D(0, 200));
- efl_gfx_size_set(left_btn, EINA_SIZE2D(150, 50));
+ efl_gfx_entity_position_set(left_btn, EINA_POSITION2D(0, 200));
+ efl_gfx_entity_size_set(left_btn, EINA_SIZE2D(150, 50));
efl_event_callback_add(left_btn, EFL_UI_EVENT_CLICKED, _left_align_cb, p_data);
Eo *right_btn = efl_add(EFL_UI_BUTTON_CLASS, panel_win);
efl_text_set(right_btn, "Right Align");
- efl_gfx_position_set(right_btn, EINA_POSITION2D(150, 200));
- efl_gfx_size_set(right_btn, EINA_SIZE2D(150, 50));
+ efl_gfx_entity_position_set(right_btn, EINA_POSITION2D(150, 200));
+ efl_gfx_entity_size_set(right_btn, EINA_SIZE2D(150, 50));
efl_event_callback_add(right_btn, EFL_UI_EVENT_CLICKED, _right_align_cb, p_data);
Eo *bottom_btn = efl_add(EFL_UI_BUTTON_CLASS, panel_win);
efl_text_set(bottom_btn, "Bottom Align");
- efl_gfx_position_set(bottom_btn, EINA_POSITION2D(0, 250));
- efl_gfx_size_set(bottom_btn, EINA_SIZE2D(150, 50));
+ efl_gfx_entity_position_set(bottom_btn, EINA_POSITION2D(0, 250));
+ efl_gfx_entity_size_set(bottom_btn, EINA_SIZE2D(150, 50));
efl_event_callback_add(bottom_btn, EFL_UI_EVENT_CLICKED, _bottom_align_cb, p_data);
Eo *position_btn = efl_add(EFL_UI_BUTTON_CLASS, panel_win);
efl_text_set(position_btn, "Position Set (x:0, y:0)");
- efl_gfx_position_set(position_btn, EINA_POSITION2D(150, 250));
- efl_gfx_size_set(position_btn, EINA_SIZE2D(150, 50));
+ efl_gfx_entity_position_set(position_btn, EINA_POSITION2D(150, 250));
+ efl_gfx_entity_size_set(position_btn, EINA_SIZE2D(150, 50));
efl_event_callback_add(position_btn, EFL_UI_EVENT_CLICKED, _position_set_cb, p_data);
}
@@ -351,19 +351,19 @@ test_ui_popup_alert(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *
{
char buf[PATH_MAX];
- Eo *win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ Eo *win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_text_set(efl_added, "Efl.Ui.Popup.Alert"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
- efl_gfx_size_set(win, EINA_SIZE2D(320, 320));
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(320, 320));
Eo *efl_ui_popup = efl_add(EFL_UI_POPUP_ALERT_CLASS, win);
efl_text_set(efl_part(efl_ui_popup, "title"), "title");
- efl_gfx_size_set(efl_ui_popup, EINA_SIZE2D(160, 160));
+ efl_gfx_entity_size_set(efl_ui_popup, EINA_SIZE2D(160, 160));
- Eo *layout = efl_add(EFL_UI_LAYOUT_CLASS, efl_ui_popup);
+ Eo *layout = efl_add(EFL_UI_LAYOUT_OBJECT_CLASS, efl_ui_popup);
snprintf(buf, sizeof(buf), "%s/objects/test.edj", elm_app_data_dir_get());
efl_file_set(layout, buf, "efl_ui_popup_scroll_content");
@@ -384,7 +384,7 @@ _alert_scroll_case1_cb(void *data, const Efl_Event *ev EINA_UNUSED)
efl_text_set(efl_part(efl_ui_popup, "title"), "title");
- Eo *layout = efl_add(EFL_UI_LAYOUT_CLASS, efl_ui_popup);
+ Eo *layout = efl_add(EFL_UI_LAYOUT_OBJECT_CLASS, efl_ui_popup);
snprintf(buf, sizeof(buf), "%s/objects/test.edj", elm_app_data_dir_get());
efl_file_set(layout, buf, "efl_ui_popup_scroll_content");
@@ -408,7 +408,7 @@ _alert_scroll_case2_cb(void *data, const Efl_Event *ev EINA_UNUSED)
efl_text_set(efl_part(efl_ui_popup, "title"), "title");
- Eo *layout = efl_add(EFL_UI_LAYOUT_CLASS, efl_ui_popup);
+ Eo *layout = efl_add(EFL_UI_LAYOUT_OBJECT_CLASS, efl_ui_popup);
snprintf(buf, sizeof(buf), "%s/objects/test.edj", elm_app_data_dir_get());
efl_file_set(layout, buf, "efl_ui_popup_scroll_content");
@@ -434,7 +434,7 @@ _alert_scroll_case3_cb(void *data, const Efl_Event *ev EINA_UNUSED)
efl_text_set(efl_part(efl_ui_popup, "title"), "title");
- Eo *layout = efl_add(EFL_UI_LAYOUT_CLASS, efl_ui_popup);
+ Eo *layout = efl_add(EFL_UI_LAYOUT_OBJECT_CLASS, efl_ui_popup);
snprintf(buf, sizeof(buf), "%s/objects/test.edj", elm_app_data_dir_get());
efl_file_set(layout, buf, "efl_ui_popup_scroll_content");
@@ -460,7 +460,7 @@ _alert_scroll_case4_cb(void *data, const Efl_Event *ev EINA_UNUSED)
efl_text_set(efl_part(efl_ui_popup, "title"), "title");
- Eo *layout = efl_add(EFL_UI_LAYOUT_CLASS, efl_ui_popup);
+ Eo *layout = efl_add(EFL_UI_LAYOUT_OBJECT_CLASS, efl_ui_popup);
snprintf(buf, sizeof(buf), "%s/objects/test.edj", elm_app_data_dir_get());
efl_file_set(layout, buf, "efl_ui_popup_scroll_content");
@@ -486,7 +486,7 @@ _alert_scroll_case5_cb(void *data, const Efl_Event *ev EINA_UNUSED)
efl_text_set(efl_part(efl_ui_popup, "title"), "title");
- Eo *layout = efl_add(EFL_UI_LAYOUT_CLASS, efl_ui_popup);
+ Eo *layout = efl_add(EFL_UI_LAYOUT_OBJECT_CLASS, efl_ui_popup);
snprintf(buf, sizeof(buf), "%s/objects/test.edj", elm_app_data_dir_get());
efl_file_set(layout, buf, "efl_ui_popup_scroll_content");
@@ -506,40 +506,40 @@ _alert_scroll_case5_cb(void *data, const Efl_Event *ev EINA_UNUSED)
void
test_ui_popup_alert_scroll(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
- Eo *win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ Eo *win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_text_set(efl_added, "Efl.Ui.Popup.Alert.Scroll"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
- efl_gfx_size_set(win, EINA_SIZE2D(500, 500));
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(500, 500));
Eo *create_btn = efl_add(EFL_UI_BUTTON_CLASS, win);
efl_text_set(create_btn, "1. size(160,160), content(200, 200), expand(-1, -1)");
- efl_gfx_position_set(create_btn, EINA_POSITION2D(0, 0));
- efl_gfx_size_set(create_btn, EINA_SIZE2D(500, 50));
+ efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 0));
+ efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50));
efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_scroll_case1_cb, win);
create_btn = efl_add(EFL_UI_BUTTON_CLASS, win);
efl_text_set(create_btn, "2. size(160,160), content(200, 200), expand(320, -1)");
- efl_gfx_position_set(create_btn, EINA_POSITION2D(0, 50));
- efl_gfx_size_set(create_btn, EINA_SIZE2D(500, 50));
+ efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 50));
+ efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50));
efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_scroll_case2_cb, win);
create_btn = efl_add(EFL_UI_BUTTON_CLASS, win);
efl_text_set(create_btn, "3. size(160,160), content(200, 200), expand(-1, 320)");
- efl_gfx_position_set(create_btn, EINA_POSITION2D(0, 100));
- efl_gfx_size_set(create_btn, EINA_SIZE2D(500, 50));
+ efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 100));
+ efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50));
efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_scroll_case3_cb, win);
create_btn = efl_add(EFL_UI_BUTTON_CLASS, win);
efl_text_set(create_btn, "4. size(160,160), content(200, 200), expand(320, 320)");
- efl_gfx_position_set(create_btn, EINA_POSITION2D(0, 150));
- efl_gfx_size_set(create_btn, EINA_SIZE2D(500, 50));
+ efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 150));
+ efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50));
efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_scroll_case4_cb, win);
create_btn = efl_add(EFL_UI_BUTTON_CLASS, win);
efl_text_set(create_btn, "5. size(160,160), content(200, 200), expand(80, 80)");
- efl_gfx_position_set(create_btn, EINA_POSITION2D(0, 200));
- efl_gfx_size_set(create_btn, EINA_SIZE2D(500, 50));
+ efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 200));
+ efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50));
efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_scroll_case5_cb, win);
}
@@ -889,94 +889,94 @@ _alert_text_case14_cb(void *data, const Efl_Event *ev EINA_UNUSED)
void
test_ui_popup_alert_text(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
- Eo *win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ Eo *win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_text_set(efl_added, "Efl.Ui.Popup.Alert.Text"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
- efl_gfx_size_set(win, EINA_SIZE2D(500, 700));
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(500, 700));
Eo *create_btn = efl_add(EFL_UI_BUTTON_CLASS, win);
efl_text_set(create_btn, "1. size(200,200), text(short), expand(-1,-1)");
- efl_gfx_position_set(create_btn, EINA_POSITION2D(0, 0));
- efl_gfx_size_set(create_btn, EINA_SIZE2D(500, 50));
+ efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 0));
+ efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50));
efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_text_case1_cb, win);
create_btn = efl_add(EFL_UI_BUTTON_CLASS, win);
efl_text_set(create_btn, "2. size(200,200), text(long), expand(-1,-1)");
- efl_gfx_position_set(create_btn, EINA_POSITION2D(0, 50));
- efl_gfx_size_set(create_btn, EINA_SIZE2D(500, 50));
+ efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 50));
+ efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50));
efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_text_case2_cb, win);
create_btn = efl_add(EFL_UI_BUTTON_CLASS, win);
efl_text_set(create_btn, "3. size(200,200), text(short), expand(300,300)");
- efl_gfx_position_set(create_btn, EINA_POSITION2D(0, 100));
- efl_gfx_size_set(create_btn, EINA_SIZE2D(500, 50));
+ efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 100));
+ efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50));
efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_text_case3_cb, win);
create_btn = efl_add(EFL_UI_BUTTON_CLASS, win);
efl_text_set(create_btn, "4. size(200,200), text(short), expand(300,-1)");
- efl_gfx_position_set(create_btn, EINA_POSITION2D(0, 150));
- efl_gfx_size_set(create_btn, EINA_SIZE2D(500, 50));
+ efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 150));
+ efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50));
efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_text_case4_cb, win);
create_btn = efl_add(EFL_UI_BUTTON_CLASS, win);
efl_text_set(create_btn, "5. size(200,200), text(short), expand(-1,300)");
- efl_gfx_position_set(create_btn, EINA_POSITION2D(0, 200));
- efl_gfx_size_set(create_btn, EINA_SIZE2D(500, 50));
+ efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 200));
+ efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50));
efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_text_case5_cb, win);
create_btn = efl_add(EFL_UI_BUTTON_CLASS, win);
efl_text_set(create_btn, "6. size(200,200), text(long), expand(300,300)");
- efl_gfx_position_set(create_btn, EINA_POSITION2D(0, 250));
- efl_gfx_size_set(create_btn, EINA_SIZE2D(500, 50));
+ efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 250));
+ efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50));
efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_text_case6_cb, win);
create_btn = efl_add(EFL_UI_BUTTON_CLASS, win);
efl_text_set(create_btn, "7. size(200,200), text(long), expand(300,-1)");
- efl_gfx_position_set(create_btn, EINA_POSITION2D(0, 300));
- efl_gfx_size_set(create_btn, EINA_SIZE2D(500, 50));
+ efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 300));
+ efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50));
efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_text_case7_cb, win);
create_btn = efl_add(EFL_UI_BUTTON_CLASS, win);
efl_text_set(create_btn, "8. size(200,200), text(long), expand(-1,300)");
- efl_gfx_position_set(create_btn, EINA_POSITION2D(0, 350));
- efl_gfx_size_set(create_btn, EINA_SIZE2D(500, 50));
+ efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 350));
+ efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50));
efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_text_case8_cb, win);
create_btn = efl_add(EFL_UI_BUTTON_CLASS, win);
efl_text_set(create_btn, "9. size(200,200), text(long), expand(10, 10)");
- efl_gfx_position_set(create_btn, EINA_POSITION2D(0, 400));
- efl_gfx_size_set(create_btn, EINA_SIZE2D(500, 50));
+ efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 400));
+ efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50));
efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_text_case9_cb, win);
create_btn = efl_add(EFL_UI_BUTTON_CLASS, win);
efl_text_set(create_btn, "10. size(200,200), text(long), expand(150,150)");
- efl_gfx_position_set(create_btn, EINA_POSITION2D(0, 450));
- efl_gfx_size_set(create_btn, EINA_SIZE2D(500, 50));
+ efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 450));
+ efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50));
efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_text_case10_cb, win);
create_btn = efl_add(EFL_UI_BUTTON_CLASS, win);
efl_text_set(create_btn, "11. size(200,200), text(long), expand(150,-1)");
- efl_gfx_position_set(create_btn, EINA_POSITION2D(0, 500));
- efl_gfx_size_set(create_btn, EINA_SIZE2D(500, 50));
+ efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 500));
+ efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50));
efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_text_case11_cb, win);
create_btn = efl_add(EFL_UI_BUTTON_CLASS, win);
efl_text_set(create_btn, "12. size(200,200), text(long), expand(300,-1)");
- efl_gfx_position_set(create_btn, EINA_POSITION2D(0, 550));
- efl_gfx_size_set(create_btn, EINA_SIZE2D(500, 50));
+ efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 550));
+ efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50));
efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_text_case12_cb, win);
create_btn = efl_add(EFL_UI_BUTTON_CLASS, win);
efl_text_set(create_btn, "13. size(200,200), text(long), expand(-1,150)");
- efl_gfx_position_set(create_btn, EINA_POSITION2D(0, 600));
- efl_gfx_size_set(create_btn, EINA_SIZE2D(500, 50));
+ efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 600));
+ efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50));
efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_text_case13_cb, win);
create_btn = efl_add(EFL_UI_BUTTON_CLASS, win);
efl_text_set(create_btn, "14. size(200,200), text(long), expand(-1,300)");
- efl_gfx_position_set(create_btn, EINA_POSITION2D(0, 650));
- efl_gfx_size_set(create_btn, EINA_SIZE2D(500, 50));
+ efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 650));
+ efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50));
efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_text_case14_cb, win);
}
@@ -999,14 +999,14 @@ test_ui_popup_anchor(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
char buf[PATH_MAX];
- Eo *win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ Eo *win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_text_set(efl_added, "Efl.Ui.Popup.Anchor"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
efl_event_callback_add(win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _win_del, p_data);
- efl_gfx_size_set(win, EINA_SIZE2D(500, 500));
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(500, 500));
- Eo *layout = efl_add(EFL_UI_LAYOUT_CLASS, win);
+ Eo *layout = efl_add(EFL_UI_LAYOUT_OBJECT_CLASS, win);
snprintf(buf, sizeof(buf), "%s/objects/test.edj", elm_app_data_dir_get());
efl_file_set(layout, buf, "efl_ui_popup_anchor_layout");
efl_gfx_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -1023,8 +1023,8 @@ test_ui_popup_anchor(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
EFL_UI_POPUP_ALIGN_RIGHT,
EFL_UI_POPUP_ALIGN_CENTER);
- efl_gfx_position_set(efl_ui_popup, EINA_POSITION2D(80, 80));
- efl_gfx_size_set(efl_ui_popup, EINA_SIZE2D(160, 120));
+ efl_gfx_entity_position_set(efl_ui_popup, EINA_POSITION2D(80, 80));
+ efl_gfx_entity_size_set(efl_ui_popup, EINA_SIZE2D(160, 120));
p_data->win = win;
p_data->efl_ui_popup = efl_ui_popup;
diff --git a/src/bin/elementary/test_ui_progressbar.c b/src/bin/elementary/test_ui_progressbar.c
new file mode 100644
index 0000000000..09a0e704c0
--- /dev/null
+++ b/src/bin/elementary/test_ui_progressbar.c
@@ -0,0 +1,178 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+#include <Elementary.h>
+
+typedef struct _pbdata
+{
+ Eo *win;
+ Eo *pb1;
+ Eo *pb2;
+ Eo *btn_start;
+ Eo *btn_stop;
+ Eo *btn_reset;
+ Ecore_Timer *timer;
+} pbdata;
+
+static Eina_Bool
+_set_progress_val(Eo *pb, double inc_value)
+{
+ double progress;
+
+ progress = efl_ui_range_value_get(pb);
+
+ if (progress < 100.0)
+ progress += inc_value;
+ else
+ return EINA_TRUE;
+
+ efl_ui_range_value_set(pb, progress);
+
+ return EINA_FALSE;
+}
+
+static Eina_Bool
+_pb_timer_cb(void *d)
+{
+ pbdata *pd = d;
+ double progress_val;
+
+ if (!pd) return ECORE_CALLBACK_CANCEL;
+
+ progress_val = efl_ui_range_value_get(pd->pb1);
+ if (progress_val < 100.0)
+ {
+ progress_val += 1;
+ efl_ui_range_value_set(pd->pb2, progress_val);
+ }
+
+ if (!_set_progress_val(pd->pb1, 0.5))
+ return ECORE_CALLBACK_RENEW;
+
+ pd->timer = NULL;
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static void
+_start_btn_clicked_cb(void *d, const Efl_Event *ev EINA_UNUSED)
+{
+ pbdata *pd = d;
+
+ if (!pd) return;
+
+ printf("start button is clicked\n");
+
+ efl_ui_widget_disabled_set(pd->btn_start, EINA_TRUE);
+ efl_ui_widget_disabled_set(pd->btn_stop, EINA_FALSE);
+
+ if (!pd->timer) pd->timer = ecore_timer_add(0.1, _pb_timer_cb, pd);
+}
+
+static void
+_stop_btn_clicked_cb(void *d, const Efl_Event *ev EINA_UNUSED)
+{
+ pbdata *pd = d;
+
+ if (!pd) return;
+ printf("stop button is clicked\n");
+
+ efl_ui_widget_disabled_set(pd->btn_start, EINA_FALSE);
+ efl_ui_widget_disabled_set(pd->btn_stop, EINA_TRUE);
+
+ if (pd->timer)
+ {
+ ecore_timer_del(pd->timer);
+ pd->timer = NULL;
+ }
+}
+
+static void
+_reset_btn_clicked_cb(void *d, const Efl_Event *ev EINA_UNUSED)
+{
+ pbdata *pd = d;
+
+ if (!pd) return;
+ printf("reset button is clicked\n");
+
+ efl_ui_range_value_set(pd->pb1, 0.0);
+ efl_ui_range_value_set(pd->pb2, 0.0);
+}
+
+static void
+_win_delete_req_cb(void *d, const Efl_Event *ev EINA_UNUSED)
+{
+ pbdata *pd = d;
+
+ if (pd->timer) ecore_timer_del(pd->timer);
+ efl_unref(pd->win);
+ free(pd);
+}
+
+void
+test_ui_progressbar(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Eo *win, *bx, *btbx;
+ pbdata *pd;
+ char buf[PATH_MAX];
+
+ pd = (pbdata *)calloc(1, sizeof(pbdata));
+
+ pd->win = win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
+ efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
+ efl_text_set(efl_added, "Efl.Ui.Progressbar"),
+ efl_ui_win_autodel_set(efl_added, EINA_TRUE),
+ efl_event_callback_add(efl_added, EFL_UI_WIN_EVENT_DELETE_REQUEST,
+ _win_delete_req_cb, pd)
+ );
+
+ bx = efl_add(EFL_UI_BOX_CLASS, win,
+ efl_content_set(win, efl_added)
+ );
+
+ pd->pb1 = efl_add(EFL_UI_PROGRESSBAR_CLASS, bx,
+ efl_pack(bx, efl_added),
+ efl_text_set(efl_added, "percent"),
+ efl_ui_range_min_max_set(efl_added, 0, 100),
+ efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(250, 20))
+ );
+
+ snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
+ efl_add(EFL_UI_IMAGE_CLASS, pd->pb1,
+ efl_file_set(efl_added, buf, NULL),
+ efl_content_set(pd->pb1, efl_added)
+ );
+
+ pd->pb2 = efl_add(EFL_UI_PROGRESSBAR_CLASS, bx,
+ efl_pack(bx, efl_added),
+ efl_text_set(efl_added, "10-100"),
+ efl_ui_progressbar_pulse_set(efl_added, EINA_TRUE),
+ efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(250, 20)),
+ efl_ui_range_min_max_set(efl_added, 10, 100),
+ efl_ui_range_value_set(efl_added, 10)
+ );
+
+ btbx = efl_add(EFL_UI_BOX_CLASS, bx,
+ efl_pack(bx, efl_added),
+ efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL)
+ );
+
+ pd->btn_start = efl_add(EFL_UI_BUTTON_CLASS, btbx,
+ efl_text_set(efl_added, "start"),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
+ _start_btn_clicked_cb, pd),
+ efl_pack(btbx, efl_added)
+ );
+
+ pd->btn_stop = efl_add(EFL_UI_BUTTON_CLASS, btbx,
+ efl_text_set(efl_added, "stop"),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
+ _stop_btn_clicked_cb, pd),
+ efl_pack(btbx, efl_added)
+ );
+ pd->btn_reset = efl_add(EFL_UI_BUTTON_CLASS, btbx,
+ efl_text_set(efl_added, "reset"),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
+ _reset_btn_clicked_cb, pd),
+ efl_pack(btbx, efl_added)
+ );
+}
diff --git a/src/bin/elementary/test_ui_scroller.c b/src/bin/elementary/test_ui_scroller.c
index 275e9ee045..3edc6868bf 100644
--- a/src/bin/elementary/test_ui_scroller.c
+++ b/src/bin/elementary/test_ui_scroller.c
@@ -28,11 +28,11 @@ test_efl_ui_scroller(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
Eo *win, *sc, *sc2, *sc3, *bx, *bx2, *gd, *gd2;
int i, j;
- win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
efl_text_set(efl_added, "Efl Ui Scroller"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
- efl_gfx_size_set(win, EINA_SIZE2D(320, 400));
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(320, 400));
sc = efl_add(EFL_UI_SCROLLER_CLASS, win,
efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND),
@@ -46,6 +46,9 @@ test_efl_ui_scroller(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
efl_gfx_size_hint_align_set(efl_added, EVAS_HINT_FILL, 0),
efl_content_set(sc, efl_added));
+ efl_add(EFL_UI_SLIDER_CLASS, bx,
+ efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(160, 0)),
+ efl_pack(bx, efl_added));
for (i = 0; i < 3; i++)
{
diff --git a/src/bin/elementary/test_ui_slider.c b/src/bin/elementary/test_ui_slider.c
index 8fe7047778..9f54a9d365 100644
--- a/src/bin/elementary/test_ui_slider.c
+++ b/src/bin/elementary/test_ui_slider.c
@@ -32,7 +32,7 @@ test_ui_slider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
Eo *win, *bx, *hbx;
double step;
- win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
efl_text_set(efl_added, "Efl.Ui.Slider"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
@@ -40,81 +40,93 @@ test_ui_slider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
bx = efl_add(EFL_UI_BOX_CLASS, win,
efl_content_set(win, efl_added));
- efl_add(EFL_UI_SLIDER_CLASS, bx,
+ efl_add(EFL_UI_TEXT_CLASS, bx,
efl_text_set(efl_added, "Horizontal"),
- efl_ui_slider_part_indicator_visible_mode_set(efl_part(efl_added, "indicator"),
- EFL_UI_SLIDER_INDICATOR_VISIBLE_MODE_NONE),
+ efl_text_interactive_editable_set(efl_added, EINA_FALSE),
+ efl_pack(bx, efl_added));
+
+ efl_add(EFL_UI_SLIDER_CLASS, bx,
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(160, 0)),
- efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.5f"),
+ efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0.0),
+ efl_pack(bx, efl_added));
+
+ efl_add(EFL_UI_TEXT_CLASS, bx,
+ efl_text_set(efl_added, "Horizontal Inverted"),
+ efl_text_interactive_editable_set(efl_added, EINA_FALSE),
efl_pack(bx, efl_added));
- step = _step_size_calculate(0, 9);
efl_add(EFL_UI_SLIDER_CLASS, bx,
+ efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(160, 0)),
+ efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0.0),
+ efl_ui_direction_set(efl_added, EFL_UI_DIR_LEFT),
+ efl_pack(bx, efl_added));
+
+ efl_add(EFL_UI_TEXT_CLASS, bx,
efl_text_set(efl_added, "Manual step"),
- efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(120, 0)),
- efl_ui_format_string_set(efl_added, "%1.1f units"),
- efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.1f"),
- efl_ui_slider_step_set(efl_added, step),
+ efl_text_interactive_editable_set(efl_added, EINA_FALSE),
efl_pack(bx, efl_added));
+ step = _step_size_calculate(0, 9);
efl_add(EFL_UI_SLIDER_CLASS, bx,
+ efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(120, 0)),
+ efl_gfx_size_hint_align_set(efl_added, 0.5, 0.5),
+ efl_ui_range_step_set(efl_added, step),
+ efl_pack(bx, efl_added));
+
+ efl_add(EFL_UI_TEXT_CLASS, bx,
efl_text_set(efl_added, "Disabled"),
+ efl_text_interactive_editable_set(efl_added, EINA_FALSE),
+ efl_pack(bx, efl_added));
+
+ efl_add(EFL_UI_SLIDER_CLASS, bx,
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(120, 0)),
- efl_ui_format_string_set(efl_added, "%1.0f units"),
- efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
efl_ui_range_min_max_set(efl_added, 10, 145),
- efl_ui_slider_step_set(efl_added, step),
+ efl_ui_range_step_set(efl_added, step),
elm_object_disabled_set(efl_added, EINA_TRUE),
efl_pack(bx, efl_added));
+ efl_add(EFL_UI_TEXT_CLASS, bx,
+ efl_text_set(efl_added, "Vertical"),
+ efl_text_interactive_editable_set(efl_added, EINA_FALSE),
+ efl_pack(bx, efl_added));
+
hbx = efl_add(EFL_UI_BOX_CLASS, bx,
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
efl_pack(bx, efl_added));
efl_add(EFL_UI_SLIDER_CLASS, hbx,
- efl_text_set(efl_added, "Vertical"),
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(0, 160)),
- efl_ui_format_string_set(efl_added, "%1.0f units"),
- efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
efl_ui_range_min_max_set(efl_added, 10, 145),
- efl_ui_slider_step_set(efl_added, step),
+ efl_ui_range_step_set(efl_added, step),
efl_ui_range_value_set(efl_added, 70),
efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
efl_pack(hbx, efl_added));
efl_add(EFL_UI_SLIDER_CLASS, hbx,
- efl_text_set(efl_added, "Disabled"),
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(0, 160)),
- efl_ui_format_string_set(efl_added, "%1.0f units"),
- efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
efl_ui_range_min_max_set(efl_added, 10, 145),
- efl_ui_slider_step_set(efl_added, step),
+ efl_ui_range_step_set(efl_added, step),
efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
elm_object_disabled_set(efl_added, EINA_TRUE),
efl_pack(hbx, efl_added));
efl_add(EFL_UI_SLIDER_CLASS, hbx,
- efl_text_set(efl_added, "Always Show Indicator:"),
- efl_ui_slider_part_indicator_visible_mode_set(efl_part(efl_added, "indicator"),
- EFL_UI_SLIDER_INDICATOR_VISIBLE_MODE_ALWAYS),
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(0, 160)),
- efl_ui_format_string_set(efl_added, "%1.0f units"),
- efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
efl_ui_range_min_max_set(efl_added, 10, 145),
efl_ui_range_value_set(efl_added, 35),
- efl_ui_slider_step_set(efl_added, step),
- efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
+ efl_ui_range_step_set(efl_added, step),
+ efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN),
efl_pack(hbx, efl_added));
+ efl_add(EFL_UI_TEXT_CLASS, bx,
+ efl_text_set(efl_added, "Limit"),
+ efl_text_interactive_editable_set(efl_added, EINA_FALSE),
+ efl_pack(bx, efl_added));
+
efl_add(EFL_UI_SLIDER_CLASS, bx,
- efl_text_set(efl_added, "Limited (0-100)"),
- efl_ui_slider_part_indicator_visible_mode_set(efl_part(efl_added, "indicator"),
- EFL_UI_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS),
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(260, 0)),
- efl_ui_format_string_set(efl_added, "%1.0f units"),
- efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
efl_ui_range_min_max_set(efl_added, 0, 150),
- efl_ui_slider_step_set(efl_added, step),
+ efl_ui_range_step_set(efl_added, step),
efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED, _slider_changed_cb, NULL),
efl_pack(bx, efl_added));
}
diff --git a/src/bin/elementary/test_ui_slider_interval.c b/src/bin/elementary/test_ui_slider_interval.c
index 1e7f4cf063..3973b3d846 100644
--- a/src/bin/elementary/test_ui_slider_interval.c
+++ b/src/bin/elementary/test_ui_slider_interval.c
@@ -32,7 +32,7 @@ test_slider_interval(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
Eo *win, *bx, *hbx;
double step;
- win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
efl_text_set(efl_added, "Efl.Ui.Slider_Interval"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
@@ -40,84 +40,77 @@ test_slider_interval(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
bx = efl_add(EFL_UI_BOX_CLASS, win,
efl_content_set(win, efl_added));
- efl_add(EFL_UI_SLIDER_INTERVAL_CLASS, bx,
+ efl_add(EFL_UI_TEXT_CLASS, bx,
efl_text_set(efl_added, "Horizontal"),
- efl_ui_slider_part_indicator_visible_mode_set(efl_part(efl_added, "indicator"),
- EFL_UI_SLIDER_INDICATOR_VISIBLE_MODE_NONE),
+ efl_text_interactive_editable_set(efl_added, EINA_FALSE),
+ efl_pack(bx, efl_added));
+
+ efl_add(EFL_UI_SLIDER_INTERVAL_CLASS, bx,
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(160, 0)),
- efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.5f"),
efl_ui_slider_interval_value_set(efl_added, 0.4, 0.9),
efl_pack(bx, efl_added));
+ efl_add(EFL_UI_TEXT_CLASS, bx,
+ efl_text_set(efl_added, "Manual step"),
+ efl_text_interactive_editable_set(efl_added, EINA_FALSE),
+ efl_pack(bx, efl_added));
+
step = _step_size_calculate(0, 9);
efl_add(EFL_UI_SLIDER_INTERVAL_CLASS, bx,
- efl_text_set(efl_added, "Manual step"),
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(120, 0)),
- efl_ui_format_string_set(efl_added, "%1.1f units"),
- efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.1f"),
efl_ui_slider_interval_value_set(efl_added, 0.4, 0.9),
- efl_ui_slider_step_set(efl_added, step),
+ efl_ui_range_step_set(efl_added, step),
efl_pack(bx, efl_added));
- efl_add(EFL_UI_SLIDER_INTERVAL_CLASS, bx,
+ efl_add(EFL_UI_TEXT_CLASS, bx,
efl_text_set(efl_added, "Disabled"),
+ efl_text_interactive_editable_set(efl_added, EINA_FALSE),
+ efl_pack(bx, efl_added));
+
+ efl_add(EFL_UI_SLIDER_INTERVAL_CLASS, bx,
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(120, 0)),
- efl_ui_format_string_set(efl_added, "%1.0f units"),
- efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
efl_ui_range_min_max_set(efl_added, 10, 145),
efl_ui_slider_interval_value_set(efl_added, 50, 100),
- efl_ui_slider_step_set(efl_added, step),
+ efl_ui_range_step_set(efl_added, step),
elm_object_disabled_set(efl_added, EINA_TRUE),
efl_pack(bx, efl_added));
+ efl_add(EFL_UI_TEXT_CLASS, bx,
+ efl_text_set(efl_added, "Vertical"),
+ efl_text_interactive_editable_set(efl_added, EINA_FALSE),
+ efl_pack(bx, efl_added));
+
hbx = efl_add(EFL_UI_BOX_CLASS, bx,
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
efl_pack(bx, efl_added));
efl_add(EFL_UI_SLIDER_INTERVAL_CLASS, hbx,
- efl_text_set(efl_added, "Vertical"),
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(0, 160)),
- efl_ui_format_string_set(efl_added, "%1.0f units"),
- efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
efl_ui_range_min_max_set(efl_added, 10, 145),
efl_ui_slider_interval_value_set(efl_added, 50, 100),
- efl_ui_slider_step_set(efl_added, step),
+ efl_ui_range_step_set(efl_added, step),
efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
efl_pack(hbx, efl_added));
efl_add(EFL_UI_SLIDER_INTERVAL_CLASS, hbx,
- efl_text_set(efl_added, "Disabled"),
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(0, 160)),
- efl_ui_format_string_set(efl_added, "%1.0f units"),
- efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
efl_ui_range_min_max_set(efl_added, 10, 145),
- efl_ui_slider_step_set(efl_added, step),
+ efl_ui_slider_interval_value_set(efl_added, 50, 100),
+ efl_ui_range_step_set(efl_added, step),
efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
elm_object_disabled_set(efl_added, EINA_TRUE),
efl_pack(hbx, efl_added));
- efl_add(EFL_UI_SLIDER_INTERVAL_CLASS, hbx,
- efl_text_set(efl_added, "Always Show Indicator:"),
- efl_ui_slider_part_indicator_visible_mode_set(efl_part(efl_added, "indicator"),
- EFL_UI_SLIDER_INDICATOR_VISIBLE_MODE_ALWAYS),
- efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(0, 160)),
- efl_ui_format_string_set(efl_added, "%1.0f units"),
- efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
- efl_ui_range_min_max_set(efl_added, 10, 145),
- efl_ui_slider_step_set(efl_added, step),
- efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
- efl_pack(hbx, efl_added));
+ efl_add(EFL_UI_TEXT_CLASS, bx,
+ efl_text_set(efl_added, "Limited (100-500)"),
+ efl_text_interactive_editable_set(efl_added, EINA_FALSE),
+ efl_pack(bx, efl_added));
efl_add(EFL_UI_SLIDER_INTERVAL_CLASS, bx,
- efl_text_set(efl_added, "Limited (100-500)"),
- efl_ui_slider_part_indicator_visible_mode_set(efl_part(efl_added, "indicator"),
- EFL_UI_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS),
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(260, 0)),
- efl_ui_format_string_set(efl_added, "%1.0f units"),
- efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
efl_ui_range_min_max_set(efl_added, 0, 600),
efl_ui_slider_interval_value_set(efl_added, 100, 500),
- efl_ui_slider_step_set(efl_added, step),
+ efl_ui_range_step_set(efl_added, step),
efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED, _intv_slider_changed_cb, NULL),
efl_pack(bx, efl_added));
}
diff --git a/src/bin/elementary/test_ui_spin.c b/src/bin/elementary/test_ui_spin.c
index ba0a166adf..85945a3101 100644
--- a/src/bin/elementary/test_ui_spin.c
+++ b/src/bin/elementary/test_ui_spin.c
@@ -36,7 +36,7 @@ test_ui_spin(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i
{
Eo *win, *bx, *sp;
- win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
efl_text_set(efl_added, "Efl.Ui.Spin"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
@@ -65,5 +65,5 @@ test_ui_spin(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _dec_clicked, sp),
efl_pack(bx, efl_added));
- efl_gfx_size_set(win, EINA_SIZE2D(100, 80));
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(100, 120));
}
diff --git a/src/bin/elementary/test_ui_spin_button.c b/src/bin/elementary/test_ui_spin_button.c
index ddb93f302c..095c2a510d 100644
--- a/src/bin/elementary/test_ui_spin_button.c
+++ b/src/bin/elementary/test_ui_spin_button.c
@@ -3,6 +3,8 @@
#endif
#include <Elementary.h>
+#define NUM_OF_VALS 12
+
static void
_spin_delay_changed_cb(void *data EINA_UNUSED, const Efl_Event *ev)
{
@@ -13,8 +15,19 @@ void
test_ui_spin_button(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
Eo *win, *bx;
+ int i;
+ Eina_Array *array;
+ Efl_Ui_Spin_Special_Value values[12] = {
+ {1, "January"}, {2, "February"}, {3, "March"}, {4, "April"},
+ {5, "May"}, {6, "June"}, {7, "July"}, {8, "August"},
+ {9, "September"}, {10, "October"}, {11, "November"}, {12, "December"}
+ };
+
+ array = eina_array_new(sizeof(Efl_Ui_Spin_Special_Value));
+ for (i = 0; i < NUM_OF_VALS; i++)
+ eina_array_push(array, &values[i]);
- win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
efl_text_set(efl_added, "Efl.Ui.Spin_Button"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
@@ -39,5 +52,13 @@ test_ui_spin_button(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *
efl_ui_spin_button_editable_set(efl_added, EINA_FALSE),
efl_pack(bx, efl_added));
- efl_gfx_size_set(win, EINA_SIZE2D(180, 100));
+ efl_add(EFL_UI_SPIN_BUTTON_CLASS, bx,
+ efl_ui_range_min_max_set(efl_added, 1, 12),
+ efl_ui_range_value_set(efl_added, 1),
+ efl_ui_spin_button_editable_set(efl_added, EINA_FALSE),
+ efl_ui_spin_special_value_set(efl_added, array),
+ efl_pack(bx, efl_added));
+ eina_array_free(array);
+
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(180, 140));
}
diff --git a/src/bin/elementary/test_ui_stack.c b/src/bin/elementary/test_ui_stack.c
new file mode 100644
index 0000000000..1cb3041ce9
--- /dev/null
+++ b/src/bin/elementary/test_ui_stack.c
@@ -0,0 +1,228 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <Elementary.h>
+
+static void _third_layout_push(void *data, const Efl_Event *ev EINA_UNUSED);
+static void _fourth_layout_push(void *data, const Efl_Event *ev EINA_UNUSED);
+
+static void
+_stack_remove(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Eo *stack = data;
+ Eo *top_layout = efl_ui_stack_top(stack);
+ efl_ui_stack_remove(stack, top_layout);
+}
+
+static void
+_stack_double_pop(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Eo *stack = data;
+ efl_ui_stack_pop(stack);
+ efl_ui_stack_pop(stack);
+}
+
+static void
+_stack_pop(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Eo *stack = data;
+ efl_ui_stack_pop(stack);
+}
+
+static void
+_stack_double_push(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Eo *stack = data;
+ _third_layout_push(stack, NULL);
+ _fourth_layout_push(stack, NULL);
+}
+
+static void
+_stack_del(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Eo *stack = data;
+ Eo *top_layout = efl_ui_stack_top(stack);
+ efl_del(top_layout);
+}
+
+static void
+_win_del(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Eo *win = data;
+ efl_del(win);
+}
+
+static Eo *
+_navigation_layout_create(Eo *stack, const char *text, Eo *content)
+{
+ Eo *nl = efl_add(EFL_UI_NAVIGATION_LAYOUT_CLASS, stack);
+
+ Eo *bn = efl_add(EFL_UI_NAVIGATION_BAR_CLASS, nl);
+ efl_text_set(bn, text);
+ efl_gfx_entity_visible_set(efl_part(bn, "back_button"), EINA_TRUE);
+ efl_ui_navigation_layout_bar_set(nl, bn);
+
+ efl_content_set(nl, content);
+
+ printf("Create content(%p).\n\n", nl);
+
+ return nl;
+}
+
+static void
+_bar_left_btn_set(Eo *navigation_layout, Efl_Event_Cb clicked_cb, void *data)
+{
+ Eo *bn = efl_ui_navigation_layout_bar_get(navigation_layout);
+
+ Eo *left_btn = efl_add(EFL_UI_BUTTON_CLASS, bn);
+ efl_text_set(left_btn, "Prev");
+ efl_content_set(efl_part(bn, "left_content"), left_btn);
+
+ efl_event_callback_add(left_btn, EFL_UI_EVENT_CLICKED, clicked_cb, data);
+
+ //Positions of "left_content" and "back_button" are the same.
+ efl_gfx_entity_visible_set(efl_part(bn, "back_button"), EINA_FALSE);
+}
+
+static void
+_bar_right_btn_set(Eo *navigation_layout, Efl_Event_Cb clicked_cb, void *data)
+{
+ Eo *bn = efl_ui_navigation_layout_bar_get(navigation_layout);
+
+ Eo *right_btn = efl_add(EFL_UI_BUTTON_CLASS, bn);
+ efl_text_set(right_btn, "Next");
+ efl_content_set(efl_part(bn, "right_content"), right_btn);
+
+ efl_event_callback_add(right_btn, EFL_UI_EVENT_CLICKED, clicked_cb, data);
+}
+
+static void
+_fifth_layout_insert(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Eo *stack = data;
+
+ Eo *top_layout = efl_ui_stack_top(stack);
+
+ Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, stack);
+ efl_text_set(btn, "Press to remove top layout");
+ efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _stack_remove, stack);
+
+ Eo *nl = _navigation_layout_create(stack, "5th layout", btn);
+
+ efl_ui_stack_insert_after(stack, top_layout, nl);
+}
+
+static void
+_fourth_layout_push(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Eo *stack = data;
+
+ Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, stack);
+ efl_text_set(btn, "Press to double pop");
+ efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _stack_double_pop, stack);
+
+ Eo *nl = _navigation_layout_create(stack, "4th layout", btn);
+
+ _bar_right_btn_set(nl, _fifth_layout_insert, stack);
+
+ efl_ui_stack_push(stack, nl);
+}
+
+static void
+_third_layout_push(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Eo *stack = data;
+
+ Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, stack);
+ efl_text_set(btn, "Press to pop");
+ efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _stack_pop, stack);
+
+ Eo *nl = _navigation_layout_create(stack, "3rd layout", btn);
+
+ _bar_right_btn_set(nl, _fourth_layout_push, stack);
+
+ efl_ui_stack_push(stack, nl);
+}
+
+static void
+_second_layout_push(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Eo *stack = data;
+
+ Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, stack);
+ efl_text_set(btn, "Press to double push");
+ efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _stack_double_push, stack);
+
+ Eo *nl = _navigation_layout_create(stack, "2nd layout", btn);
+
+ _bar_right_btn_set(nl, _third_layout_push, stack);
+
+ efl_ui_stack_push(stack, nl);
+}
+
+static void
+_first_layout_push(Eo *win, Eo *stack)
+{
+ Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, stack);
+ efl_text_set(btn, "Press to delete stack");
+ efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _stack_del, stack);
+
+ Eo *nl = _navigation_layout_create(stack, "1st layout", btn);
+
+ _bar_left_btn_set(nl, _win_del, win);
+ _bar_right_btn_set(nl, _second_layout_push, stack);
+
+ efl_ui_stack_push(stack, nl);
+}
+
+static void
+_stack_loaded_cb(void *data EINA_UNUSED, const Efl_Event *event)
+{
+ Efl_Ui_Stack_Event_Loaded *loaded_info = event->info;
+ printf("Content(%p) is loaded to the stack.\n\n", loaded_info->content);
+}
+
+static void
+_stack_unloaded_cb(void *data EINA_UNUSED, const Efl_Event *event)
+{
+ Efl_Ui_Stack_Event_Unloaded *unloaded_info = event->info;
+ printf("Content(%p) is unloaded from the stack.\n\n", unloaded_info->content);
+}
+
+static void
+_stack_activated_cb(void *data EINA_UNUSED, const Efl_Event *event)
+{
+ Efl_Ui_Stack_Event_Activated *activated_info = event->info;
+ printf("Content(%p) is activated in the stack.\n\n", activated_info->content);
+}
+
+static void
+_stack_deactivated_cb(void *data EINA_UNUSED, const Efl_Event *event)
+{
+ Efl_Ui_Stack_Event_Deactivated *deactivated_info = event->info;
+ printf("Content(%p) is deactivated in the stack.\n\n", deactivated_info->content);
+}
+
+void
+test_ui_stack(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Eo *win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
+ efl_text_set(efl_added, "Efl.Ui.Stack"),
+ efl_ui_win_autodel_set(efl_added, EINA_TRUE));
+
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(500, 500));
+
+ Eo *stack = efl_add(EFL_UI_STACK_CLASS, win);
+ efl_event_callback_add(stack, EFL_UI_STACK_EVENT_LOADED,
+ _stack_loaded_cb, NULL);
+ efl_event_callback_add(stack, EFL_UI_STACK_EVENT_UNLOADED,
+ _stack_unloaded_cb, NULL);
+ efl_event_callback_add(stack, EFL_UI_STACK_EVENT_ACTIVATED,
+ _stack_activated_cb, NULL);
+ efl_event_callback_add(stack, EFL_UI_STACK_EVENT_DEACTIVATED,
+ _stack_deactivated_cb, NULL);
+ efl_content_set(win, stack);
+
+ _first_layout_push(win, stack);
+}
diff --git a/src/bin/elementary/test_ui_tab_pager.c b/src/bin/elementary/test_ui_tab_pager.c
new file mode 100644
index 0000000000..1ed8dba8df
--- /dev/null
+++ b/src/bin/elementary/test_ui_tab_pager.c
@@ -0,0 +1,591 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+#include <Elementary.h>
+
+#define TAB_PAGE_NUM 5
+#define TAB_LABEL_COUNT 15
+#define TAB_ICON_COUNT 9
+
+typedef struct _App_Data {
+ Evas_Object *navi;
+ Eo *tab_pager;
+} App_Data;
+
+typedef struct _Tab_Set_Data {
+ Eo *tab_pager;
+ Eo *spinner;
+} Tab_Set_Data;
+
+typedef struct _Tab_Change_Data {
+ Eo *tab_pager;
+ Eo *label_check;
+ Eo *icon_check;
+} Tab_Change_Data;
+
+static void _current_cb(void *data, Evas_Object *obj, void *event_info);
+static void _pack_cb(void *data, Evas_Object *obj, void *event_info);
+static void _unpack_cb(void *data, Evas_Object *obj, void *event_info);
+static void _tab_cb(void *data, Evas_Object *obj, void *event_info);
+static void _transition_cb(void *data, Evas_Object *obj, void *event_info);
+static void _win_del_cb(void *data, const Efl_Event *ev);
+
+static char *tab_labels[] = {
+ "efl", "elementary", "ecore", "evas", "eina",
+ "eo", "eolian", "embryo", "ethumb", "evil",
+ "eet", "edje", "ector", "efreet", "eldbus"
+};
+
+static char *tab_icons[] = {
+ "document-print", "folder-new", "object-rotate-right",
+ "mail-send", "edit-cut", "edit-copy",
+ "edit-paste", "edit-delete", "clock"
+};
+
+static char *tab_label_get()
+{
+ int index = rand() % (TAB_LABEL_COUNT - 1);
+ return tab_labels[index];
+}
+
+static char *tab_icon_get()
+{
+ int index = rand() % (TAB_ICON_COUNT - 1);
+ return tab_icons[index];
+}
+
+static void
+_tab_changed_cb(void *data EINA_UNUSED, const Efl_Event *event)
+{
+ Efl_Ui_Tab_Page_Tab_Changed_Event *ev = event->info;
+
+ switch (ev->changed_info)
+ {
+ case EFL_UI_TAB_PAGE_TAB_CHANGED_LABEL:
+ printf("[%p] tab label changed\n", event->object);
+ break;
+
+ case EFL_UI_TAB_PAGE_TAB_CHANGED_ICON:
+ printf("[%p] tab icon changed\n", event->object);
+ break;
+
+ default:
+ break;
+ }
+}
+
+Eo *
+content_add(Eo *parent, char *text)
+{
+ Eo *page;
+ char buf[PATH_MAX];
+ page = efl_add(EFL_UI_LAYOUT_OBJECT_CLASS, parent);
+
+ snprintf(buf, sizeof(buf), "%s/objects/test_tab_pager.edj", elm_app_data_dir_get());
+
+ page = efl_add(EFL_UI_LAYOUT_OBJECT_CLASS, parent,
+ efl_file_set(efl_added, buf, "page_layout"),
+ efl_text_set(efl_part(efl_added, "text"), text),
+ efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND),
+ efl_gfx_size_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL));
+
+ return page;
+}
+
+Eo *
+tab_page_add(Eo *parent)
+{
+ Eo *tab_page;
+ char *label = tab_label_get();
+ char *icon = tab_icon_get();
+ Eo *content = content_add(parent, label);
+
+ tab_page = efl_add(EFL_UI_TAB_PAGE_CLASS, parent);
+ efl_content_set(tab_page, content);
+ efl_text_set(efl_part(tab_page, "tab"), label);
+ efl_ui_tab_page_part_tab_icon_set(efl_part(tab_page, "tab"), icon);
+
+ efl_event_callback_add(tab_page, EFL_UI_TAB_PAGE_EVENT_TAB_CHANGED, _tab_changed_cb, NULL);
+
+ return tab_page;
+}
+
+void
+test_ui_tab_pager(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Eo *win, *layout, *navi, *list, *tp, *tb, *page;
+ //Efl_Page_Transition *tran;
+ App_Data *ad = NULL;
+ char buf[PATH_MAX];
+ int i;
+
+ win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
+ efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
+ efl_text_set(efl_added, "Efl.Ui.Tab_Pager"),
+ efl_ui_win_autodel_set(efl_added, EINA_TRUE),
+ efl_event_callback_add(efl_added, EFL_EVENT_DEL, _win_del_cb, ad));
+
+ snprintf(buf, sizeof(buf), "%s/objects/test_tab_pager.edj", elm_app_data_dir_get());
+ layout = efl_add(EFL_UI_LAYOUT_OBJECT_CLASS, win,
+ efl_file_set(efl_added, buf, "tab_page_layout"),
+ efl_content_set(win, efl_added));
+
+ navi = elm_naviframe_add(layout);
+ efl_gfx_size_hint_weight_set(navi, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ efl_gfx_size_hint_align_set(navi, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ efl_content_set(efl_part(layout, "menu"), navi);
+
+ list = elm_list_add(navi);
+ efl_gfx_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ efl_gfx_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_list_select_mode_set(list, ELM_OBJECT_SELECT_MODE_ALWAYS);
+ elm_naviframe_item_push(navi, "Properties", NULL, NULL, list, NULL);
+ efl_gfx_entity_visible_set(list, EINA_TRUE);
+
+ tp = efl_add(EFL_UI_TAB_PAGER_CLASS, layout,
+ efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND),
+ efl_gfx_size_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
+ efl_ui_pager_page_size_set(efl_added, EINA_SIZE2D(-1, -1)),
+ efl_ui_pager_padding_set(efl_added, 20),
+ efl_content_set(efl_part(layout, "tab_pager"), efl_added));
+
+ tb = efl_add(EFL_UI_TAB_BAR_CLASS, tp);
+ efl_ui_tab_pager_tab_bar_set(tp, tb);
+
+/*
+ tran = efl_add(EFL_PAGE_TRANSITION_SCROLL_CLASS, tp)
+ efl_ui_pager_transition_set(tp, tran);
+*/
+
+ for (i = 0 ; i < 3 ; i ++)
+ {
+ page = tab_page_add(tp);
+ efl_pack_end(tp, page);
+ }
+
+ efl_ui_pager_current_page_set(tp, 0);
+
+ ad = calloc(1, sizeof(ad));
+ ad->navi = navi;
+ ad->tab_pager = tp;
+
+ elm_list_item_append(list, "Current", NULL, NULL, _current_cb, ad);
+ elm_list_item_append(list, "Pack", NULL, NULL, _pack_cb, ad);
+ elm_list_item_append(list, "Unpack", NULL, NULL, _unpack_cb, ad);
+ elm_list_item_append(list, "Tab", NULL, NULL, _tab_cb, ad);
+ elm_list_item_append(list, "Transition", NULL, NULL, _transition_cb, ad);
+ elm_list_go(list);
+
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(500, 300));
+}
+
+/* Menu Callback */
+
+static void
+_win_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ free(data);
+}
+
+static void
+_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ elm_naviframe_item_pop(data);
+}
+
+static void
+_tab_set_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Tab_Set_Data *tsd = data;
+ efl_ui_pager_current_page_set(tsd->tab_pager, elm_spinner_value_get(tsd->spinner));
+}
+
+static void
+_tab_set_btn_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ free(data);
+}
+
+static void
+_current_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
+{
+ App_Data *ad = (App_Data *) data;
+ Evas_Object *navi = ad->navi;
+ Eo *tab_pager = ad->tab_pager;
+ Eo *btn, *box, *sp;
+ Tab_Set_Data *tsd = calloc(1, sizeof(Tab_Set_Data));
+
+ Elm_List_Item *it = event_info;
+ elm_list_item_selected_set(it, EINA_FALSE);
+
+ btn = efl_add(EFL_UI_BUTTON_CLASS, navi,
+ efl_text_set(efl_added, "Back"),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_cb, navi));
+
+ box = efl_add(EFL_UI_BOX_CLASS, navi,
+ efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ elm_naviframe_item_push(navi, "Current", btn, NULL, efl_added, NULL));
+
+ sp = efl_add(EFL_UI_SPIN_BUTTON_CLASS, box,
+ efl_ui_range_min_max_set(efl_added, 0, efl_content_count(tab_pager) - 1),
+ efl_ui_range_value_set(efl_added, efl_ui_pager_current_page_get(tab_pager)),
+ efl_pack_end(box, efl_added));
+
+ tsd->tab_pager = tab_pager;
+ tsd->spinner = sp;
+
+ btn = efl_add(EFL_UI_BUTTON_CLASS, box,
+ efl_text_set(efl_added, "Current Tab Page Set"),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _tab_set_btn_cb, tsd),
+ efl_event_callback_add(efl_added, EFL_EVENT_DEL, _tab_set_btn_del_cb, tsd),
+ efl_pack_end(box, efl_added));
+}
+
+static void
+_pack_begin_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Eo *tab_pager = data;
+ Eo *tab_page;
+
+ tab_page = tab_page_add(tab_pager);
+
+ efl_pack_begin(tab_pager, tab_page);
+}
+
+static void
+_pack_end_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Eo *tab_pager = data;
+ Eo *tab_page;
+
+ tab_page = tab_page_add(tab_pager);
+
+ efl_pack_end(tab_pager, tab_page);
+}
+
+static void
+_pack_before_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Eo *tab_pager = data;
+ Eo *tab_page, *cur_tab_page;
+ int index;
+
+ index = efl_ui_pager_current_page_get(tab_pager);
+ cur_tab_page = efl_pack_content_get(tab_pager, index);
+
+ tab_page = tab_page_add(tab_pager);
+
+ efl_pack_before(tab_pager, tab_page, cur_tab_page);
+}
+
+static void
+_pack_after_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Eo *tab_pager = data;
+ Eo *tab_page, *cur_tab_page;
+ int index;
+
+ index = efl_ui_pager_current_page_get(tab_pager);
+ cur_tab_page = efl_pack_content_get(tab_pager, index);
+
+ tab_page = tab_page_add(tab_pager);
+
+ efl_pack_after(tab_pager, tab_page, cur_tab_page);
+}
+
+static void
+_pack_at_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Tab_Set_Data *tsd = data;
+ Eo *tab_page;
+
+ tab_page = tab_page_add(tsd->tab_pager);
+
+ efl_pack_at(tsd->tab_pager, tab_page, elm_spinner_value_get(tsd->spinner));
+ efl_ui_range_min_max_set(tsd->spinner, 0, efl_content_count(tsd->tab_pager) - 1);
+}
+
+static void
+_pack_at_btn_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ free(data);
+}
+
+static void
+_pack_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
+{
+ App_Data *ad = (App_Data *) data;
+ Evas_Object *navi = ad->navi;
+ Eo *tab_pager = ad->tab_pager;
+ Eo *btn, *box, *in_box, *sp;
+ Tab_Set_Data *tsd = calloc(1, sizeof(Tab_Set_Data));
+
+ Elm_List_Item *it = event_info;
+ elm_list_item_selected_set(it, EINA_FALSE);
+
+ btn = efl_add(EFL_UI_BUTTON_CLASS, navi,
+ efl_text_set(efl_added, "Back"),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_cb, navi));
+
+ box = efl_add(EFL_UI_BOX_CLASS, navi,
+ efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ elm_naviframe_item_push(navi, "Pack", btn, NULL, efl_added, NULL));
+
+ /* Pack Begin */
+ btn = efl_add(EFL_UI_BUTTON_CLASS, box,
+ efl_text_set(efl_added, "Pack Begin"),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _pack_begin_btn_cb, tab_pager),
+ efl_pack_end(box, efl_added));
+
+ /* Pack End */
+ btn = efl_add(EFL_UI_BUTTON_CLASS, box,
+ efl_text_set(efl_added, "Pack End"),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _pack_end_btn_cb, tab_pager),
+ efl_pack_end(box, efl_added));
+
+ /* Pack Before */
+ btn = efl_add(EFL_UI_BUTTON_CLASS, box,
+ efl_text_set(efl_added, "Pack Before Current Tab Page"),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _pack_before_btn_cb, tab_pager),
+ efl_pack_end(box, efl_added));
+
+ /* Pack After */
+ btn = efl_add(EFL_UI_BUTTON_CLASS, box,
+ efl_text_set(efl_added, "Pack After Current Tab Page"),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _pack_after_btn_cb, tab_pager),
+ efl_pack_end(box, efl_added));
+
+ in_box = efl_add(EFL_UI_BOX_CLASS, box,
+ efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
+ efl_pack_end(box, efl_added));
+
+ sp = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box,
+ efl_ui_range_min_max_set(efl_added, 0, efl_content_count(tab_pager) - 1),
+ efl_ui_range_value_set(efl_added, efl_ui_pager_current_page_get(tab_pager)),
+ efl_pack_end(in_box, efl_added));
+
+ tsd->tab_pager = tab_pager;
+ tsd->spinner = sp;
+
+ /* Pack At */
+ btn = efl_add(EFL_UI_BUTTON_CLASS, in_box,
+ efl_text_set(efl_added, "Pack At"),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _pack_at_btn_cb, tsd),
+ efl_event_callback_add(efl_added, EFL_EVENT_DEL, _pack_at_btn_del_cb, tsd),
+ efl_pack_end(in_box, efl_added));
+}
+
+static void
+_clear_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Eo *tab_pager = data;
+ efl_pack_clear(tab_pager);
+}
+
+static void
+_unpack_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Eo *tab_pager = data;
+ int index = efl_ui_pager_current_page_get(tab_pager);
+ Eo *tab_page = efl_pack_content_get(tab_pager, index);
+ efl_pack_unpack(tab_pager, tab_page);
+}
+
+static void
+_unpack_all_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Eo *tab_pager = data;
+ efl_pack_unpack_all(tab_pager);
+}
+
+static void
+_unpack_at_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Tab_Set_Data *tsd = data;
+
+ efl_pack_unpack_at(tsd->tab_pager, elm_spinner_value_get(tsd->spinner));
+ efl_ui_range_min_max_set(tsd->spinner, 0, efl_content_count(tsd->tab_pager) - 1);
+}
+
+static void
+_unpack_at_btn_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ free(data);
+}
+
+static void
+_unpack_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
+{
+ App_Data *ad = (App_Data *) data;
+ Evas_Object *navi = ad->navi;
+ Eo *tab_pager = ad->tab_pager;
+ Eo *btn, *box, *sp, *in_box;
+ Tab_Set_Data *tsd = calloc(1, sizeof(Tab_Set_Data));
+
+ Elm_List_Item *it = event_info;
+ elm_list_item_selected_set(it, EINA_FALSE);
+
+ btn = efl_add(EFL_UI_BUTTON_CLASS, navi,
+ efl_text_set(efl_added, "Back"),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_cb, navi));
+
+ box = efl_add(EFL_UI_BOX_CLASS, navi,
+ efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ elm_naviframe_item_push(navi, "Unpack", btn, NULL, efl_added, NULL));
+
+ /* Clear */
+ btn = efl_add(EFL_UI_BUTTON_CLASS, box,
+ efl_text_set(efl_added, "Clear"),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _clear_btn_cb, tab_pager),
+ efl_pack_end(box, efl_added));
+
+ /* Unpack */
+ btn = efl_add(EFL_UI_BUTTON_CLASS, box,
+ efl_text_set(efl_added, "Unpack"),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _unpack_btn_cb, tab_pager),
+ efl_pack_end(box, efl_added));
+
+ /* Unpack All */
+ btn = efl_add(EFL_UI_BUTTON_CLASS, box,
+ efl_text_set(efl_added, "Unpack All"),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _unpack_all_btn_cb, tab_pager),
+ efl_pack_end(box, efl_added));
+
+ in_box = efl_add(EFL_UI_BOX_CLASS, box,
+ efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
+ efl_pack_end(box, efl_added));
+
+ sp = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box,
+ efl_ui_range_min_max_set(efl_added, 0, efl_content_count(tab_pager) - 1),
+ efl_ui_range_value_set(efl_added, efl_ui_pager_current_page_get(tab_pager)),
+ efl_pack_end(in_box, efl_added));
+
+ tsd->tab_pager = tab_pager;
+ tsd->spinner = sp;
+
+ /* Unpack At */
+ btn = efl_add(EFL_UI_BUTTON_CLASS, in_box,
+ efl_text_set(efl_added, "Unpack At"),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _unpack_at_btn_cb, tsd),
+ efl_event_callback_add(efl_added, EFL_EVENT_DEL, _unpack_at_btn_del_cb, tsd),
+ efl_pack_end(in_box, efl_added));
+}
+
+static void
+_change_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Tab_Change_Data *tcd = data;
+
+ Eo *tab_page, *content;
+ char *label = NULL;
+ char *icon = NULL;
+ int cur;
+ cur = efl_ui_pager_current_page_get(tcd->tab_pager);
+ tab_page = efl_pack_content_get(tcd->tab_pager, cur);
+
+ if (efl_ui_nstate_value_get(tcd->label_check))
+ {
+ label = tab_label_get();
+ efl_text_set(efl_part(tab_page, "tab"), label);
+ content = content_add(tab_page, label);
+ efl_content_set(tab_page, content);
+ }
+
+ if (efl_ui_nstate_value_get(tcd->icon_check))
+ {
+ icon = tab_icon_get();
+ efl_ui_tab_page_part_tab_icon_set(efl_part(tab_page, "tab"), icon);
+ }
+}
+
+static void
+_change_btn_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ free(data);
+}
+
+static void
+_tab_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
+{
+ App_Data *ad = (App_Data *) data;
+ Evas_Object *navi = ad->navi;
+ Eo *tab_pager = ad->tab_pager;
+ Eo *btn, *box, *label_check, *icon_check;
+ Tab_Change_Data *tcd = calloc(1, sizeof(Tab_Change_Data));
+
+ Elm_List_Item *it = event_info;
+ elm_list_item_selected_set(it, EINA_FALSE);
+
+ btn = efl_add(EFL_UI_BUTTON_CLASS, navi,
+ efl_text_set(efl_added, "Back"),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_cb, navi));
+
+ box = efl_add(EFL_UI_BOX_CLASS, navi,
+ efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ elm_naviframe_item_push(navi, "Tab", btn, NULL, efl_added, NULL));
+
+ label_check = efl_add(EFL_UI_CHECK_CLASS, box,
+ efl_text_set(efl_added, "Tab Label + Page"),
+ efl_ui_nstate_value_set(efl_added, EINA_FALSE),
+ efl_pack_end(box, efl_added));
+
+ icon_check = efl_add(EFL_UI_CHECK_CLASS, box,
+ efl_text_set(efl_added, "Tab Icon"),
+ efl_ui_nstate_value_set(efl_added, EINA_FALSE),
+ efl_pack_end(box, efl_added));
+
+ tcd->tab_pager = tab_pager;
+ tcd->label_check = label_check;
+ tcd->icon_check = icon_check;
+
+ btn = efl_add(EFL_UI_BUTTON_CLASS, box,
+ efl_text_set(efl_added, "Change"),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _change_btn_cb, tcd),
+ efl_event_callback_add(efl_added, EFL_EVENT_DEL, _change_btn_del_cb, tcd),
+ efl_pack_end(box, efl_added));
+}
+
+static void
+_tran_set_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Efl_Page_Transition *tran = efl_add(EFL_PAGE_TRANSITION_SCROLL_CLASS, data);
+ efl_ui_pager_transition_set(data, tran);
+}
+
+static void
+_tran_unset_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ efl_ui_pager_transition_set(data, NULL);
+}
+
+static void
+_transition_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
+{
+ App_Data *ad = (App_Data *) data;
+ Evas_Object *navi = ad->navi;
+ Eo *tab_pager = ad->tab_pager;
+ Eo *btn, *box;
+
+ Elm_List_Item *it = event_info;
+ elm_list_item_selected_set(it, EINA_FALSE);
+
+ btn = efl_add(EFL_UI_BUTTON_CLASS, navi,
+ efl_text_set(efl_added, "Back"),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_cb, navi));
+
+ box = efl_add(EFL_UI_BOX_CLASS, navi,
+ efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ elm_naviframe_item_push(navi, "Transition", btn, NULL, efl_added, NULL));
+
+ btn = efl_add(EFL_UI_BUTTON_CLASS, box,
+ efl_text_set(efl_added, "Set"),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _tran_set_btn_cb, tab_pager),
+ efl_pack_end(box, efl_added));
+
+ btn = efl_add(EFL_UI_BUTTON_CLASS, box,
+ efl_text_set(efl_added, "Unset"),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _tran_unset_btn_cb, tab_pager),
+ efl_pack_end(box, efl_added));
+}
diff --git a/src/bin/elementary/test_ui_table.c b/src/bin/elementary/test_ui_table.c
index d16047577a..26f3f414f9 100644
--- a/src/bin/elementary/test_ui_table.c
+++ b/src/bin/elementary/test_ui_table.c
@@ -113,7 +113,7 @@ static void
child_evt_cb(void *data, const Efl_Event *event)
{
Elm_Label *o = data;
- Efl_Gfx *it = event->info;
+ Efl_Gfx_Entity *it = event->info;
int col, row, colspan, rowspan;
char buf[64];
@@ -139,7 +139,7 @@ _custom_layout_update(Eo *pack, void *_pd EINA_UNUSED)
Eina_Rect g;
Eo *item;
- g = efl_gfx_geometry_get(pack);
+ g = efl_gfx_entity_geometry_get(pack);
efl_pack_table_size_get(pack, &cols, &rows);
if (!cols || !rows) goto end;
@@ -151,10 +151,10 @@ _custom_layout_update(Eo *pack, void *_pd EINA_UNUSED)
{
Eina_Rect m;
- m.x = g.x + c * g.w / cols + (cs * g.w / cols - m.w) / 2;
- m.y = g.y + r * g.h / rows + (rs * g.h / rows - m.h) / 2;
+ m.x = g.x + c * g.w / cols + (cs * g.w / cols - g.x) / 2;
+ m.y = g.y + r * g.h / rows + (rs * g.h / rows - g.y) / 2;
m.size = efl_gfx_size_hint_combined_min_get(item);
- efl_gfx_geometry_set(item, m);
+ efl_gfx_entity_geometry_set(item, m);
gmw = MAX(gmw, m.w);
gmh = MAX(gmh, m.h);
@@ -174,7 +174,7 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
win = elm_win_util_standard_add("ui-table", "Efl.Ui.Table");
elm_win_autodel_set(win, EINA_TRUE);
- efl_gfx_size_set(win, EINA_SIZE2D(600, 400));
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(600, 400));
vbox = efl_add(EFL_UI_BOX_CLASS, win,
efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
@@ -194,7 +194,7 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
efl_gfx_size_hint_align_set(f, -1, -1);
efl_gfx_size_hint_weight_set(f, 1, 0);
efl_pack(vbox, f);
- efl_gfx_visible_set(f, 1);
+ efl_gfx_entity_visible_set(f, 1);
hbox = efl_add(EFL_UI_BOX_CLASS, win,
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
@@ -214,7 +214,7 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
efl_gfx_size_hint_align_set(o, 0, 0.5);
elm_radio_state_value_set(o, NONE);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_radio_add(win);
elm_object_text_set(o, "No weight + table fill");
@@ -223,7 +223,7 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
elm_radio_state_value_set(o, NONE_BUT_FILL);
elm_radio_group_add(o, chk);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_radio_add(win);
elm_object_text_set(o, "Equal weights");
@@ -232,7 +232,7 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
elm_radio_state_value_set(o, EQUAL);
elm_radio_group_add(o, chk);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_radio_add(win);
elm_object_text_set(o, "One weight only");
@@ -241,7 +241,7 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
elm_radio_state_value_set(o, ONE);
elm_radio_group_add(o, chk);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_radio_add(win);
elm_object_text_set(o, "Two weights");
@@ -250,7 +250,7 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
elm_radio_state_value_set(o, TWO);
elm_radio_group_add(o, chk);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_radio_add(win);
elm_object_text_set(o, "Custom layout");
@@ -259,7 +259,7 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
elm_radio_state_value_set(o, CUSTOM);
elm_radio_group_add(o, chk);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
elm_radio_value_set(chk, EQUAL);
@@ -274,7 +274,7 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
o = elm_label_add(win);
elm_object_text_set(o, "User min size");
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_slider_add(win);
elm_slider_indicator_format_set(o, "%.0fpx");
@@ -287,7 +287,7 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
elm_slider_inverted_set(o, 1);
elm_slider_value_set(o, 0);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
/* inner box padding */
@@ -300,7 +300,7 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
o = elm_label_add(win);
elm_object_text_set(o, "Padding");
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_slider_add(win);
elm_slider_indicator_format_set(o, "%.0fpx");
@@ -313,7 +313,7 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
elm_slider_inverted_set(o, 1);
elm_slider_value_set(o, 10);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
/* outer margin */
@@ -326,7 +326,7 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
o = elm_label_add(win);
elm_object_text_set(o, "Margin");
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_slider_add(win);
elm_slider_indicator_format_set(o, "%.0fpx");
@@ -339,7 +339,7 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
elm_slider_inverted_set(o, 1);
elm_slider_value_set(o, 10);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
/* button margins */
@@ -352,7 +352,7 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
o = elm_label_add(win);
elm_object_text_set(o, "Buttons margins");
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_slider_add(win);
elm_slider_indicator_format_set(o, "%.0fpx");
@@ -365,7 +365,7 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
elm_slider_inverted_set(o, 1);
elm_slider_value_set(o, 10);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
/* ro info */
@@ -378,12 +378,12 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
o = elm_label_add(win);
elm_object_text_set(o, "<b>Properties</>");
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_label_add(win);
efl_event_callback_add(table, EFL_PACK_EVENT_LAYOUT_UPDATED, layout_updated_cb, o);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_label_add(win);
efl_event_callback_add(table, EFL_CONTAINER_EVENT_CONTENT_ADDED, child_evt_cb, o);
@@ -391,7 +391,7 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
efl_gfx_size_hint_align_set(o, 0.5, 0);
efl_gfx_size_hint_weight_set(o, 1, 1);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
/* contents */
@@ -400,11 +400,11 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
efl_gfx_size_hint_align_set(f, -1, -1);
efl_gfx_size_hint_weight_set(f, 1, 1);
efl_pack(vbox, f);
- efl_gfx_visible_set(f, 1);
+ efl_gfx_entity_visible_set(f, 1);
efl_gfx_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_object_content_set(f, table);
- efl_gfx_visible_set(table, 1);
+ efl_gfx_entity_visible_set(table, 1);
objects[i++] = o = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win);
efl_gfx_size_hint_min_set(o, EINA_SIZE2D(10, 10));
@@ -416,44 +416,44 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
efl_gfx_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
efl_gfx_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
efl_pack_table(table, o, 0, 0, 1, 1);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
objects[i++] = o = elm_button_add(win);
elm_object_text_set(o, "Button 2");
efl_gfx_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
efl_gfx_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
efl_pack_table(table, o, 1, 0, 1, 1);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
objects[i++] = o = elm_button_add(win);
elm_object_text_set(o, "Button 3");
efl_gfx_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
efl_gfx_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
efl_pack_table(table, o, 2, 0, 1, 1);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
objects[i++] = o = elm_button_add(win);
elm_object_text_set(o, "Button 4");
efl_gfx_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
efl_gfx_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
efl_pack_table(table, o, 0, 1, 2, 1);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
objects[i++] = o = elm_button_add(win);
elm_object_text_set(o, "Button 5");
efl_gfx_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
efl_gfx_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
efl_pack_table(table, o, 2, 1, 1, 2);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
objects[i++] = o = elm_button_add(win);
elm_object_text_set(o, "Button 6");
efl_gfx_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
efl_gfx_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
efl_pack_table(table, o, 0, 2, 2, 1);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
- efl_gfx_visible_set(win, 1);
+ efl_gfx_entity_visible_set(win, 1);
}
static const char *
@@ -480,7 +480,7 @@ append_cb(void *data, const Efl_Event *ev EINA_UNUSED)
efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, remove_cb, NULL);
elm_object_tooltip_text_set(o, "Click to unpack");
efl_pack_end(table, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
}
static void
@@ -498,14 +498,14 @@ test_ui_table_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
win = elm_win_util_standard_add("ui-table-linear", "Efl.Ui.Table Linear APIs");
elm_win_autodel_set(win, EINA_TRUE);
- efl_gfx_size_set(win, EINA_SIZE2D(600, 400));
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(600, 400));
vbox = efl_add(EFL_UI_BOX_CLASS, win,
efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
efl_pack_padding_set(vbox, 10, 10, EINA_TRUE);
efl_gfx_size_hint_margin_set(vbox, 5, 5, 5, 5);
elm_win_resize_object_add(win, vbox);
- efl_gfx_visible_set(vbox, 1);
+ efl_gfx_entity_visible_set(vbox, 1);
// create here to pass in cb
@@ -518,13 +518,13 @@ test_ui_table_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
efl_gfx_size_hint_align_set(f, -1, -1);
efl_gfx_size_hint_weight_set(f, 1, 0);
efl_pack(vbox, f);
- efl_gfx_visible_set(f, 1);
+ efl_gfx_entity_visible_set(f, 1);
hbox = efl_add(EFL_UI_BOX_CLASS, win,
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
elm_object_content_set(f, hbox);
efl_pack_padding_set(hbox, 5, 0, EINA_TRUE);
- efl_gfx_visible_set(hbox, 1);
+ efl_gfx_entity_visible_set(hbox, 1);
ico = elm_icon_add(win);
elm_icon_standard_set(ico, "list-add");
@@ -533,7 +533,7 @@ test_ui_table_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
elm_object_text_set(o, "Append");
efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, append_cb, table);
efl_pack(hbox, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
ico = elm_icon_add(win);
elm_icon_standard_set(ico, "edit-clear-all");
@@ -542,7 +542,7 @@ test_ui_table_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
elm_object_text_set(o, "Clear");
efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, clear_cb, table);
efl_pack(hbox, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
/* ro info */
@@ -551,17 +551,17 @@ test_ui_table_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
efl_gfx_size_hint_align_set(bx, 0, -1);
efl_gfx_size_hint_weight_set(bx, 1, 1);
efl_pack(hbox, bx);
- efl_gfx_visible_set(bx, 1);
+ efl_gfx_entity_visible_set(bx, 1);
o = elm_label_add(win);
elm_object_text_set(o, "<b>Properties</>");
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_label_add(win);
efl_event_callback_add(table, EFL_PACK_EVENT_LAYOUT_UPDATED, layout_updated_cb, o);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_label_add(win);
efl_event_callback_add(table, EFL_CONTAINER_EVENT_CONTENT_ADDED, child_evt_cb, o);
@@ -569,7 +569,7 @@ test_ui_table_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
efl_gfx_size_hint_align_set(o, 0.5, 0);
efl_gfx_size_hint_weight_set(o, 1, 1);
efl_pack(bx, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
/* contents */
@@ -578,31 +578,31 @@ test_ui_table_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
efl_gfx_size_hint_align_set(f, -1, -1);
efl_gfx_size_hint_weight_set(f, 1, 1);
efl_pack(vbox, f);
- efl_gfx_visible_set(f, 1);
+ efl_gfx_entity_visible_set(f, 1);
efl_pack_table_columns_set(table, 4);
efl_pack_table_direction_set(table, EFL_UI_DIR_RIGHT, EFL_UI_DIR_DOWN);
efl_gfx_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_object_content_set(f, table);
- efl_gfx_visible_set(table, 1);
+ efl_gfx_entity_visible_set(table, 1);
o = elm_button_add(win);
elm_object_text_set(o, btn_text(NULL));
efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, remove_cb, NULL);
efl_pack(table, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_button_add(win);
elm_object_text_set(o, btn_text(NULL));
efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, remove_cb, NULL);
efl_pack(table, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = elm_button_add(win);
elm_object_text_set(o, btn_text(NULL));
efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, remove_cb, NULL);
efl_pack(table, o);
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
- efl_gfx_visible_set(win, 1);
+ efl_gfx_entity_visible_set(win, 1);
}
diff --git a/src/bin/elementary/test_ui_table_static.c b/src/bin/elementary/test_ui_table_static.c
index 8681e7ae93..369236fde7 100644
--- a/src/bin/elementary/test_ui_table_static.c
+++ b/src/bin/elementary/test_ui_table_static.c
@@ -104,7 +104,7 @@ test_ui_table_static(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
Eo *win, *table, *bt, *rc, *en;
api_data *api = calloc(1, sizeof(*api));
- win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_ui_win_name_set(efl_added, "table"),
efl_text_set(efl_added, "Table"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE),
@@ -121,48 +121,48 @@ test_ui_table_static(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
elm_object_text_set(en, "Entry text");
elm_entry_single_line_set(en, EINA_TRUE);
efl_pack_table(table, en, 50, 10, 40, 10);
- efl_gfx_visible_set(en, 1);
+ efl_gfx_entity_visible_set(en, 1);
en = elm_entry_add(win);
elm_entry_scrollable_set(en, EINA_TRUE);
elm_object_text_set(en, "Entry text 2");
elm_entry_single_line_set(en, EINA_TRUE);
efl_pack_table(table, en, 60, 20, 30, 10);
- efl_gfx_visible_set(en, 1);
+ efl_gfx_entity_visible_set(en, 1);
bt = elm_button_add(win);
elm_object_text_set(bt, "Next API function");
efl_event_callback_add(bt, EFL_UI_EVENT_CLICKED, _api_bt_clicked, api);
efl_pack_table(table, bt, 30, 0, 40, 10);
elm_object_disabled_set(bt, api->state == API_STATE_LAST);
- efl_gfx_visible_set(bt, 1);
+ efl_gfx_entity_visible_set(bt, 1);
bt = elm_button_add(win);
elm_object_text_set(bt, "Button");
efl_pack_table(table, bt, 0, 0, 20, 20);
- efl_gfx_visible_set(bt, 1);
+ efl_gfx_entity_visible_set(bt, 1);
bt = elm_button_add(win);
elm_object_text_set(bt, "Button");
efl_pack_table(table, bt, 10, 10, 40, 20);
api->data.child = bt;
- efl_gfx_visible_set(bt, 1);
+ efl_gfx_entity_visible_set(bt, 1);
bt = elm_button_add(win);
elm_object_text_set(bt, "Button");
efl_pack_table(table, bt, 10, 30, 20, 50);
- efl_gfx_visible_set(bt, 1);
+ efl_gfx_entity_visible_set(bt, 1);
bt = elm_button_add(win);
elm_object_text_set(bt, "Button");
efl_pack_table(table, bt, 80, 80, 20, 20);
- efl_gfx_visible_set(bt, 1);
+ efl_gfx_entity_visible_set(bt, 1);
bt = elm_button_add(win);
elm_object_text_set(bt, "Change");
efl_pack_table(table, bt, 40, 40, 20, 20);
efl_event_callback_add(bt, EFL_UI_EVENT_CLICKED, _ch_table, table);
- efl_gfx_visible_set(bt, 1);
+ efl_gfx_entity_visible_set(bt, 1);
rc = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win);
efl_gfx_color_set(rc, 128, 0, 0, 128);
@@ -184,5 +184,5 @@ test_ui_table_static(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
efl_gfx_color_set(rc, 128, 64, 0, 128);
efl_pack_table(table, rc, 60, 80, 10, 10);
- efl_gfx_size_set(win, EINA_SIZE2D(480, 480));
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(480, 480));
}
diff --git a/src/bin/elementary/test_ui_tags.c b/src/bin/elementary/test_ui_tags.c
new file mode 100644
index 0000000000..15faebe4af
--- /dev/null
+++ b/src/bin/elementary/test_ui_tags.c
@@ -0,0 +1,89 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+#include <Elementary.h>
+
+static void
+_item_added_cb(void *data, const Efl_Event *ev)
+{
+ Eina_Array *array = data;
+ const char *str = ev->info;
+
+ printf("item added %s\n", str);
+ eina_array_push(array, str);
+}
+
+static void
+_item_deleted_cb(void *data, const Efl_Event *ev)
+{
+ Eina_Array_Iterator iterator;
+ const char *item;
+ unsigned int i;
+ Eina_Array *array = data;
+ const char *str = ev->info;
+
+ printf("item deleted %s\n", str);
+ eina_array_clean(array);
+
+ const Eina_Array *tags_array = efl_ui_tags_items_get(ev->object);
+ EINA_ARRAY_ITER_NEXT(tags_array, i, item, iterator)
+ {
+ eina_array_push(array, item);
+ printf("item #%u: %s\n", i, item);
+ }
+}
+
+static void
+_clicked(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Eo *tags = data;
+
+ if (efl_ui_tags_expanded_get(tags))
+ efl_ui_tags_expanded_set(tags, EINA_FALSE);
+ else
+ efl_ui_tags_expanded_set(tags, EINA_TRUE);
+}
+
+
+void
+test_ui_tags(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Eo *win, *layout, *tags;
+
+ const char* strs[] = {
+ "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"
+ };
+
+ Eina_Array *array;
+ unsigned int i;
+ char buf[PATH_MAX];
+
+ win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
+ efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
+ efl_text_set(efl_added, "Efl.Ui.Tags"),
+ efl_ui_win_autodel_set(efl_added, EINA_TRUE));
+
+ snprintf(buf, sizeof(buf), "%s/objects/multibuttonentry.edj", elm_app_data_dir_get());
+ layout = efl_add(EFL_UI_LAYOUT_OBJECT_CLASS, win,
+ elm_layout_file_set(efl_added, buf, "multibuttonentry_test"),
+ elm_win_resize_object_add(win, efl_added));
+
+ array = eina_array_new(10);
+ for (i = 0; i < 9; i++)
+ eina_array_push(array, strs[i]);
+
+ tags = efl_add(EFL_UI_TAGS_CLASS, layout,
+ efl_ui_tags_items_set(efl_added, array),
+ efl_event_callback_add(efl_added, EFL_UI_TAGS_EVENT_ITEM_ADDED, _item_added_cb, array),
+ efl_event_callback_add(efl_added, EFL_UI_TAGS_EVENT_ITEM_DELETED, _item_deleted_cb, array),
+ efl_text_set(efl_added, "To :"),
+ efl_ui_format_string_set(efl_added, "+ %d items"),
+ elm_object_part_content_set(layout, "multibuttonentry", efl_added));
+
+ efl_add(EFL_UI_BUTTON_CLASS, layout,
+ efl_text_set(efl_added, "Change mode"),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _clicked, tags),
+ elm_object_part_content_set(layout, "box", efl_added));
+
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(320, 480));
+}
diff --git a/src/bin/elementary/test_ui_textpath.c b/src/bin/elementary/test_ui_textpath.c
index 9b27cdb7ac..2192f44709 100644
--- a/src/bin/elementary/test_ui_textpath.c
+++ b/src/bin/elementary/test_ui_textpath.c
@@ -9,17 +9,13 @@
#define CY 150
#define CR 100
+#define TEST_UI_TEXTPATH_LONG_TEXT "This text follows the path which you defined. This is a &lt;long&gt; text designed to make it ellipsis."
+#define TEST_UI_TEXTPATH_SHORT_TEXT "This text is short."
+
static Evas_Object *angle_sld, *slice_sld, *dir_chk;
static int path_type;
static void
-_autofit_changed_cb(void *data, const Efl_Event *event)
-{
- Evas_Object *txtpath = data;
- efl_ui_textpath_autofit_set(txtpath, elm_check_state_get(event->object));
-}
-
-static void
_ellipsis_changed_cb(void *data, const Efl_Event *event)
{
Evas_Object *txtpath = data;
@@ -50,6 +46,18 @@ _angle_changed_cb(void *data, const Efl_Event *event)
}
static void
+_short_text_changed_cb(void *data, const Efl_Event *event)
+{
+ Evas_Object *txtpath = data;
+ Eina_Bool val = elm_check_selected_get(event->object);
+
+ if (val)
+ efl_text_set(txtpath, TEST_UI_TEXTPATH_SHORT_TEXT);
+ else
+ efl_text_set(txtpath, TEST_UI_TEXTPATH_LONG_TEXT);
+}
+
+static void
_change_shape_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
Evas_Object *txtpath = data;
@@ -93,51 +101,49 @@ test_ui_textpath(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
elm_box_horizontal_set(box, EINA_FALSE);
efl_gfx_size_hint_weight_set(box, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND);
efl_gfx_size_hint_align_set(box, EFL_GFX_SIZE_HINT_FILL, EFL_GFX_SIZE_HINT_FILL);
- efl_gfx_visible_set(box, EINA_TRUE);
+ efl_gfx_entity_visible_set(box, EINA_TRUE);
txtpath = efl_add(EFL_UI_TEXTPATH_CLASS, win);
elm_box_pack_end(box, txtpath);
- efl_ui_textpath_autofit_set(txtpath, EINA_TRUE);
- efl_text_set(txtpath, "This text follows the path which you defined. This is a &lt;long&gt; text designed to make it ellipsis.");
+ efl_text_set(txtpath, TEST_UI_TEXTPATH_LONG_TEXT);
efl_ui_textpath_circle_set(txtpath, CX, CY, CR, 0, EFL_UI_TEXTPATH_DIRECTION_CCW);
- efl_gfx_visible_set(txtpath, EINA_TRUE);
+ efl_gfx_entity_visible_set(txtpath, EINA_TRUE);
path_type = 0;
hbox = elm_box_add(win);
elm_box_horizontal_set(hbox, EINA_TRUE);
efl_gfx_size_hint_weight_set(hbox, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND);
efl_gfx_size_hint_align_set(hbox, EFL_GFX_SIZE_HINT_FILL, EFL_GFX_SIZE_HINT_FILL);
- efl_gfx_visible_set(hbox, EINA_TRUE);
+ efl_gfx_entity_visible_set(hbox, EINA_TRUE);
elm_box_pack_end(box, hbox);
chk = elm_check_add(win);
- elm_object_text_set(chk, "Autofit");
- elm_check_state_set(chk, efl_ui_textpath_autofit_get(txtpath));
- efl_event_callback_add(chk, EFL_UI_CHECK_EVENT_CHANGED, _autofit_changed_cb, txtpath);
- elm_box_pack_end(hbox, chk);
- efl_gfx_visible_set(chk, EINA_TRUE);
-
- chk = elm_check_add(win);
elm_object_text_set(chk, "Ellipsis");
elm_check_state_set(chk, efl_ui_textpath_ellipsis_get(txtpath));
efl_event_callback_add(chk, EFL_UI_CHECK_EVENT_CHANGED, _ellipsis_changed_cb, txtpath);
elm_box_pack_end(hbox, chk);
- efl_gfx_visible_set(chk, EINA_TRUE);
+ efl_gfx_entity_visible_set(chk, EINA_TRUE);
chk = elm_check_add(win);
elm_object_text_set(chk, "Clockwise");
efl_event_callback_add(chk, EFL_UI_CHECK_EVENT_CHANGED, _direction_changed_cb, txtpath);
elm_box_pack_end(hbox, chk);
- efl_gfx_visible_set(chk, EINA_TRUE);
+ efl_gfx_entity_visible_set(chk, EINA_TRUE);
dir_chk = chk;
+ chk = elm_check_add(win);
+ elm_object_text_set(chk, "Short text");
+ efl_event_callback_add(chk, EFL_UI_CHECK_EVENT_CHANGED, _short_text_changed_cb, txtpath);
+ elm_box_pack_end(hbox, chk);
+ efl_gfx_entity_visible_set(chk, EINA_TRUE);
+
hbox = elm_box_add(win);
elm_box_horizontal_set(hbox, EINA_TRUE);
efl_gfx_size_hint_weight_set(hbox, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND);
efl_gfx_size_hint_align_set(hbox, EFL_GFX_SIZE_HINT_FILL, EFL_GFX_SIZE_HINT_FILL);
- efl_gfx_visible_set(hbox, EINA_TRUE);
+ efl_gfx_entity_visible_set(hbox, EINA_TRUE);
elm_box_pack_end(box, hbox);
sld = elm_slider_add(win);
@@ -149,7 +155,7 @@ test_ui_textpath(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
efl_gfx_size_hint_min_set(sld, EINA_SIZE2D(150, 0));
efl_event_callback_add(sld, EFL_UI_SLIDER_EVENT_CHANGED, _angle_changed_cb, txtpath);
elm_box_pack_end(hbox, sld);
- efl_gfx_visible_set(sld, EINA_TRUE);
+ efl_gfx_entity_visible_set(sld, EINA_TRUE);
angle_sld = sld;
sld = elm_slider_add(win);
@@ -161,23 +167,23 @@ test_ui_textpath(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
efl_gfx_size_hint_min_set(sld, EINA_SIZE2D(150, 0));
efl_event_callback_add(sld, EFL_UI_SLIDER_EVENT_CHANGED, _slice_no_changed_cb, txtpath);
elm_box_pack_end(hbox, sld);
- efl_gfx_visible_set(sld, EINA_TRUE);
+ efl_gfx_entity_visible_set(sld, EINA_TRUE);
slice_sld = sld;
hbox = elm_box_add(win);
elm_box_horizontal_set(hbox, EINA_TRUE);
efl_gfx_size_hint_weight_set(hbox, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND);
efl_gfx_size_hint_align_set(hbox, EFL_GFX_SIZE_HINT_FILL, EFL_GFX_SIZE_HINT_FILL);
- efl_gfx_visible_set(hbox, EINA_TRUE);
+ efl_gfx_entity_visible_set(hbox, EINA_TRUE);
elm_box_pack_end(box, hbox);
btn = elm_button_add(win);
elm_object_text_set(btn, "Change Path");
evas_object_smart_callback_add(btn, "clicked", _change_shape_cb, txtpath);
elm_box_pack_end(hbox, btn);
- efl_gfx_visible_set(btn, EINA_TRUE);
+ efl_gfx_entity_visible_set(btn, EINA_TRUE);
elm_win_resize_object_add(win, box);
- efl_gfx_size_set(win, EINA_SIZE2D(400, 400));
- efl_gfx_visible_set(win, 1);
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(400, 400));
+ efl_gfx_entity_visible_set(win, 1);
}
diff --git a/src/bin/elementary/test_ui_timepicker.c b/src/bin/elementary/test_ui_timepicker.c
new file mode 100644
index 0000000000..cb88ef508b
--- /dev/null
+++ b/src/bin/elementary/test_ui_timepicker.c
@@ -0,0 +1,36 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+#include <Elementary.h>
+
+static void
+_time_changed_cb(void *data EINA_UNUSED, const Efl_Event *ev)
+{
+ int hour, min;
+
+ efl_ui_timepicker_time_get(ev->object, &hour, &min);
+ printf("Current time is %d %d\n", hour, min);
+}
+
+
+void
+test_ui_timepicker(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Eo *win, *bx;
+
+ win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
+ efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
+ efl_text_set(efl_added, "Efl.Ui.Timepicker"),
+ efl_ui_win_autodel_set(efl_added, EINA_TRUE));
+
+ bx = efl_add(EFL_UI_BOX_CLASS, win,
+ efl_content_set(win, efl_added),
+ efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
+
+ efl_add(EFL_UI_TIMEPICKER_CLASS, bx,
+ efl_ui_timepicker_time_set(efl_added, 11, 35),
+ efl_event_callback_add(efl_added, EFL_UI_TIMEPICKER_EVENT_CHANGED,_time_changed_cb, NULL),
+ efl_pack(bx, efl_added));
+
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(150, 170));
+}
diff --git a/src/bin/elementary/test_win_dialog.c b/src/bin/elementary/test_win_dialog.c
index 7a10c258bf..6858cf85a9 100644
--- a/src/bin/elementary/test_win_dialog.c
+++ b/src/bin/elementary/test_win_dialog.c
@@ -60,7 +60,7 @@ _size_update(void *data, const Efl_Event *ev)
cmin = efl_gfx_size_hint_combined_min_get(dia);
min = efl_gfx_size_hint_min_get(dia);
max = efl_gfx_size_hint_max_get(dia);
- sz = efl_gfx_size_get(dia);
+ sz = efl_gfx_entity_size_get(dia);
sprintf(buf, "This is a dialog with min/max size<br>"
"Min size: %dx%d (requested) %dx%d (effective)<br>"
@@ -83,8 +83,8 @@ _bt3_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_
//lb = efl_add(EFL_UI_TEXT_CLASS, dia);,
lb = elm_label_add(dia);
- efl_event_callback_add(dia, EFL_GFX_EVENT_CHANGE_SIZE_HINTS, _size_update, lb);
- efl_event_callback_add(dia, EFL_GFX_EVENT_RESIZE, _size_update, lb);
+ efl_event_callback_add(dia, EFL_GFX_ENTITY_EVENT_CHANGE_SIZE_HINTS, _size_update, lb);
+ efl_event_callback_add(dia, EFL_GFX_ENTITY_EVENT_RESIZE, _size_update, lb);
elm_object_text_set(lb, "This is a Dialog Window");
efl_gfx_size_hint_weight_set(lb, 1.0, 1.0);
@@ -101,7 +101,7 @@ _bt4_clicked_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *even
{
Efl_Canvas_Object *dia, *lb;
- dia = efl_add(EFL_UI_WIN_CLASS, NULL,
+ dia = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_ui_win_type_set(efl_added, EFL_UI_WIN_DIALOG_BASIC),
efl_ui_win_name_set(efl_added, "window-dia-4"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE),
@@ -110,8 +110,8 @@ _bt4_clicked_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *even
//lb = efl_add(EFL_UI_TEXT_CLASS, dia);,
lb = elm_label_add(dia);
- efl_event_callback_add(dia, EFL_GFX_EVENT_CHANGE_SIZE_HINTS, _size_update, lb);
- efl_event_callback_add(dia, EFL_GFX_EVENT_RESIZE, _size_update, lb);
+ efl_event_callback_add(dia, EFL_GFX_ENTITY_EVENT_CHANGE_SIZE_HINTS, _size_update, lb);
+ efl_event_callback_add(dia, EFL_GFX_ENTITY_EVENT_RESIZE, _size_update, lb);
elm_object_text_set(lb, "This is a Centered Dialog Window");
efl_gfx_size_hint_weight_set(lb, 1.0, 1.0);
diff --git a/src/bin/elementary/test_win_indicator.c b/src/bin/elementary/test_win_indicator.c
index d459a9eeab..99f54c589e 100644
--- a/src/bin/elementary/test_win_indicator.c
+++ b/src/bin/elementary/test_win_indicator.c
@@ -14,7 +14,7 @@ _create_indicator(void)
{
const char *indi_name;
- Eo *win = efl_add(EFL_UI_WIN_SOCKET_CLASS, NULL,
+ Eo *win = efl_add_ref(EFL_UI_WIN_SOCKET_CLASS, NULL,
efl_text_set(efl_added, "indicator"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE),
efl_ui_win_alpha_set(efl_added, EINA_TRUE));
@@ -49,7 +49,7 @@ _create_indicator(void)
efl_event_callback_add(efl_added, EFL_UI_CLOCK_EVENT_CHANGED, _changed_cb, NULL),
efl_pack(bx, efl_added));
- efl_gfx_size_set(win, EINA_SIZE2D(300, 30));
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(300, 30));
return win;
}
@@ -91,13 +91,13 @@ test_win_indicator(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
indicator = _create_indicator();
// FIXME: Resizing window should no cause sizing issues!
- win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
efl_text_set(efl_added, "Efl.Win.Indicator"),
efl_gfx_size_hint_max_set(efl_added, EINA_SIZE2D(300, -1)),
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
efl_event_callback_add(win, EFL_EVENT_DEL, _win_del, indicator);
- efl_gfx_size_set(win, EINA_SIZE2D(300, 360));
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(300, 360));
Eo *bx = efl_add(EFL_UI_BOX_CLASS, win,
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(300, 0)),
diff --git a/src/bin/elementary/test_win_stack.c b/src/bin/elementary/test_win_stack.c
index 18f7c0fa7b..d13072d041 100644
--- a/src/bin/elementary/test_win_stack.c
+++ b/src/bin/elementary/test_win_stack.c
@@ -18,13 +18,13 @@ _win_new(Evas_Object *stack_top, const char *title)
Evas_Object *bg, *bx, *bt, *lb, *win;
if (level >= 3)
- win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_ui_win_name_set(efl_added, "window-stack"),
efl_ui_win_type_set(efl_added, ELM_WIN_NAVIFRAME_BASIC),
efl_text_set(efl_added, title),
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
else
- win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_ui_win_name_set(efl_added, "window-stack"),
efl_ui_win_type_set(efl_added, ELM_WIN_DIALOG_BASIC),
efl_text_set(efl_added, title),
diff --git a/src/bin/embryo/embryo_cc_sc1.c b/src/bin/embryo/embryo_cc_sc1.c
index c3443dbc63..7c8283f0c9 100644
--- a/src/bin/embryo/embryo_cc_sc1.c
+++ b/src/bin/embryo/embryo_cc_sc1.c
@@ -44,6 +44,8 @@
#include "embryo_cc_sc.h"
#include "embryo_cc_prefix.h"
+#include "../../static_libs/buildsystem/buildsystem.h"
+
#define VERSION_STR "2.4"
#define VERSION_INT 240
@@ -568,22 +570,13 @@ static void
parseoptions(int argc, char **argv, char *iname, char *oname,
char *pname EINA_UNUSED, char *rname EINA_UNUSED)
{
- char str[PATH_MAX];
+ char str[PATH_MAX] = "";
int i, stack_size;
size_t len;
-#ifdef NEED_RUN_IN_TREE
- str[0] = '\0';
- if (getenv("EFL_RUN_IN_TREE"))
- {
- struct stat st;
- snprintf(str, sizeof(str), "%s/data/embryo", PACKAGE_SRC_DIR);
- if (stat(str, &st) != 0)
- str[0] = '\0';
- }
+ bs_data_path_get(str, sizeof(str), "embryo", "");
if (str[0] == '\0')
-#endif
snprintf(str, sizeof(str), "%s/include/", e_prefix_data_get());
/* use embryo include dir always */
diff --git a/src/bin/eolian/docs.c b/src/bin/eolian/docs.c
index a38ac19ff7..bd2e0b68d5 100644
--- a/src/bin/eolian/docs.c
+++ b/src/bin/eolian/docs.c
@@ -19,13 +19,13 @@ _indent_line(Eina_Strbuf *buf, int ind)
: DOC_LINE_LIMIT)
static void
-_generate_ref(const Eolian_Unit *src, const char *refn, Eina_Strbuf *wbuf,
+_generate_ref(const Eolian_State *state, const char *refn, Eina_Strbuf *wbuf,
Eina_Bool use_legacy)
{
- const Eolian_Declaration *decl = eolian_declaration_get_by_name(src, refn);
+ const Eolian_Object *decl = eolian_state_object_by_name_get(state, refn);
if (decl)
{
- char *n = strdup(eolian_declaration_name_get(decl));
+ char *n = strdup(eolian_object_name_get(decl));
char *p = n;
while ((p = strchr(p, '.'))) *p = '_';
eina_strbuf_append(wbuf, n);
@@ -39,7 +39,7 @@ _generate_ref(const Eolian_Unit *src, const char *refn, Eina_Strbuf *wbuf,
Eina_Stringshare *bname = eina_stringshare_add_length(refn, sfx - refn);
- const Eolian_Typedecl *tp = eolian_typedecl_struct_get_by_name(src, bname);
+ const Eolian_Typedecl *tp = eolian_state_struct_by_name_get(state, bname);
if (tp)
{
if (!eolian_typedecl_struct_field_get(tp, sfx + 1))
@@ -47,13 +47,13 @@ _generate_ref(const Eolian_Unit *src, const char *refn, Eina_Strbuf *wbuf,
eina_stringshare_del(bname);
goto noref;
}
- _generate_ref(src, bname, wbuf, use_legacy);
+ _generate_ref(state, bname, wbuf, use_legacy);
eina_strbuf_append(wbuf, sfx);
eina_stringshare_del(bname);
return;
}
- tp = eolian_typedecl_enum_get_by_name(src, bname);
+ tp = eolian_state_enum_by_name_get(state, bname);
if (tp)
{
const Eolian_Enum_Type_Field *efl = eolian_typedecl_enum_field_get(tp, sfx + 1);
@@ -68,13 +68,13 @@ _generate_ref(const Eolian_Unit *src, const char *refn, Eina_Strbuf *wbuf,
return;
}
- const Eolian_Class *cl = eolian_class_get_by_name(src, bname);
+ const Eolian_Class *cl = eolian_state_class_by_name_get(state, bname);
const Eolian_Function *fn = NULL;
/* match methods and properties; we're only figuring out existence */
Eolian_Function_Type ftype = EOLIAN_UNRESOLVED;
if (!cl)
{
- const char *mname;
+ const char *mname = NULL;
if (!strcmp(sfx, ".get")) ftype = EOLIAN_PROP_GET;
else if (!strcmp(sfx, ".set")) ftype = EOLIAN_PROP_SET;
if (ftype != EOLIAN_UNRESOLVED)
@@ -84,13 +84,13 @@ _generate_ref(const Eolian_Unit *src, const char *refn, Eina_Strbuf *wbuf,
while ((mname != refn) && (*mname != '.')) --mname;
if (mname == refn) goto noref;
bname = eina_stringshare_add_length(refn, mname - refn);
- cl = eolian_class_get_by_name(src, bname);
+ cl = eolian_state_class_by_name_get(state, bname);
eina_stringshare_del(bname);
}
if (cl)
{
char *meth = strndup(mname + 1, sfx - mname - 1);
- fn = eolian_class_function_get_by_name(cl, meth, ftype);
+ fn = eolian_class_function_by_name_get(cl, meth, ftype);
if (ftype == EOLIAN_UNRESOLVED)
ftype = eolian_function_type_get(fn);
free(meth);
@@ -98,7 +98,7 @@ _generate_ref(const Eolian_Unit *src, const char *refn, Eina_Strbuf *wbuf,
}
else
{
- fn = eolian_class_function_get_by_name(cl, sfx + 1, ftype);
+ fn = eolian_class_function_by_name_get(cl, sfx + 1, ftype);
ftype = eolian_function_type_get(fn);
}
@@ -114,7 +114,7 @@ noref:
}
static int
-_append_section(const Eolian_Unit *src, const char *desc, int ind, int curl,
+_append_section(const Eolian_State *state, const char *desc, int ind, int curl,
Eina_Strbuf *buf, Eina_Strbuf *wbuf, Eina_Bool use_legacy)
{
Eina_Bool try_note = EINA_TRUE;
@@ -166,7 +166,7 @@ _append_section(const Eolian_Unit *src, const char *desc, int ind, int curl,
++desc;
if (*(desc - 1) == '.') --desc;
Eina_Stringshare *refn = eina_stringshare_add_length(ref, desc - ref);
- _generate_ref(src, refn, wbuf, use_legacy);
+ _generate_ref(state, refn, wbuf, use_legacy);
eina_stringshare_del(refn);
}
else
@@ -270,7 +270,7 @@ _append_group(Eina_Strbuf *buf, char *sgrp, int indent)
}
static void
-_gen_doc_brief(const Eolian_Unit *src, const char *summary, const char *since,
+_gen_doc_brief(const Eolian_State *state, const char *summary, const char *since,
const char *group, const char *el, int indent, Eina_Strbuf *buf,
Eina_Bool use_legacy)
{
@@ -280,7 +280,7 @@ _gen_doc_brief(const Eolian_Unit *src, const char *summary, const char *since,
eina_strbuf_append(buf, "/**< ");
else
eina_strbuf_append(buf, "/** ");
- curl = _append_section(src, summary, indent, curl, buf, wbuf, use_legacy);
+ curl = _append_section(state, summary, indent, curl, buf, wbuf, use_legacy);
eina_strbuf_free(wbuf);
curl = _append_extra(el, indent, curl, EINA_FALSE, buf);
curl = _append_since(since, indent, curl, buf);
@@ -301,7 +301,7 @@ _gen_doc_brief(const Eolian_Unit *src, const char *summary, const char *since,
}
static void
-_gen_doc_full(const Eolian_Unit *src, const char *summary,
+_gen_doc_full(const Eolian_State *state, const char *summary,
const char *description, const char *since,
const char *group, const char *el, int indent, Eina_Strbuf *buf,
Eina_Bool use_legacy)
@@ -315,13 +315,13 @@ _gen_doc_full(const Eolian_Unit *src, const char *summary,
curl += _indent_line(buf, indent);
eina_strbuf_append(buf, " * @brief ");
curl += sizeof(" * @brief ") - 1;
- _append_section(src, summary, indent, curl, buf, wbuf, use_legacy);
+ _append_section(state, summary, indent, curl, buf, wbuf, use_legacy);
eina_strbuf_append_char(buf, '\n');
_indent_line(buf, indent);
eina_strbuf_append(buf, " *\n");
curl = _indent_line(buf, indent);
eina_strbuf_append(buf, " * ");
- _append_section(src, description, indent, curl + 3, buf, wbuf, use_legacy);
+ _append_section(state, description, indent, curl + 3, buf, wbuf, use_legacy);
curl = _append_extra(el, indent, curl, EINA_TRUE, buf);
curl = _append_since(since, indent, curl, buf);
eina_strbuf_append_char(buf, '\n');
@@ -338,7 +338,7 @@ _gen_doc_full(const Eolian_Unit *src, const char *summary,
}
static Eina_Strbuf *
-_gen_doc_buf(const Eolian_Unit *src, const Eolian_Documentation *doc,
+_gen_doc_buf(const Eolian_State *state, const Eolian_Documentation *doc,
const char *group, const char *el, int indent,
Eina_Bool use_legacy)
{
@@ -350,21 +350,21 @@ _gen_doc_buf(const Eolian_Unit *src, const Eolian_Documentation *doc,
Eina_Strbuf *buf = eina_strbuf_new();
if (!desc)
- _gen_doc_brief(src, sum, since, group, el, indent, buf, use_legacy);
+ _gen_doc_brief(state, sum, since, group, el, indent, buf, use_legacy);
else
- _gen_doc_full(src, sum, desc, since, group, el, indent, buf, use_legacy);
+ _gen_doc_full(state, sum, desc, since, group, el, indent, buf, use_legacy);
return buf;
}
Eina_Strbuf *
-eo_gen_docs_full_gen(const Eolian_Unit *src, const Eolian_Documentation *doc,
+eo_gen_docs_full_gen(const Eolian_State *state, const Eolian_Documentation *doc,
const char *group, int indent, Eina_Bool use_legacy)
{
- return _gen_doc_buf(src, doc, group, NULL, indent, use_legacy);
+ return _gen_doc_buf(state, doc, group, NULL, indent, use_legacy);
}
Eina_Strbuf *
-eo_gen_docs_event_gen(const Eolian_Unit *src, const Eolian_Event *ev,
+eo_gen_docs_event_gen(const Eolian_State *state, const Eolian_Event *ev,
const char *group)
{
if (!ev) return NULL;
@@ -377,7 +377,7 @@ eo_gen_docs_event_gen(const Eolian_Unit *src, const Eolian_Event *ev,
if (rt)
{
p = buf;
- Eina_Stringshare *rts = eolian_type_c_type_get(src, rt, EOLIAN_C_TYPE_DEFAULT);
+ Eina_Stringshare *rts = eolian_type_c_type_get(rt, EOLIAN_C_TYPE_DEFAULT);
snprintf(buf, sizeof(buf), "@return %s", rts);
eina_stringshare_del(rts);
}
@@ -396,11 +396,11 @@ eo_gen_docs_event_gen(const Eolian_Unit *src, const Eolian_Event *ev,
return bufs;
}
- return _gen_doc_buf(src, doc, group, p, 0, EINA_FALSE);
+ return _gen_doc_buf(state, doc, group, p, 0, EINA_FALSE);
}
Eina_Strbuf *
-eo_gen_docs_func_gen(const Eolian_Unit *src, const Eolian_Function *fid,
+eo_gen_docs_func_gen(const Eolian_State *state, const Eolian_Function *fid,
Eolian_Function_Type ftype, int indent,
Eina_Bool use_legacy)
{
@@ -420,7 +420,7 @@ eo_gen_docs_func_gen(const Eolian_Unit *src, const Eolian_Function *fid,
int curl = 0;
- const char *group = eolian_class_full_name_get(eolian_function_class_get(fid));
+ const char *group = eolian_class_name_get(eolian_function_class_get(fid));
const Eolian_Implement *fimp = eolian_function_implement_get(fid);
@@ -511,7 +511,7 @@ eo_gen_docs_func_gen(const Eolian_Unit *src, const Eolian_Function *fid,
/* only summary, nothing else; generate standard brief doc */
if (!desc && !par && !vpar && !rdoc && (ftype == EOLIAN_METHOD || !pdoc))
{
- _gen_doc_brief(src, sum ? sum : "No description supplied.", since, group,
+ _gen_doc_brief(state, sum ? sum : "No description supplied.", since, group,
NULL, indent, buf, use_legacy);
return buf;
}
@@ -522,7 +522,7 @@ eo_gen_docs_func_gen(const Eolian_Unit *src, const Eolian_Function *fid,
curl += _indent_line(buf, indent);
eina_strbuf_append(buf, " * @brief ");
curl += sizeof(" * @brief ") - 1;
- _append_section(src, sum ? sum : "No description supplied.",
+ _append_section(state, sum ? sum : "No description supplied.",
indent, curl, buf, wbuf, use_legacy);
eina_strbuf_append_char(buf, '\n');
@@ -536,7 +536,7 @@ eo_gen_docs_func_gen(const Eolian_Unit *src, const Eolian_Function *fid,
{
curl = _indent_line(buf, indent);
eina_strbuf_append(buf, " * ");
- _append_section(src, desc, indent, curl + 3, buf, wbuf, use_legacy);
+ _append_section(state, desc, indent, curl + 3, buf, wbuf, use_legacy);
eina_strbuf_append_char(buf, '\n');
if (par || rdoc || pdoc || since)
{
@@ -550,7 +550,7 @@ eo_gen_docs_func_gen(const Eolian_Unit *src, const Eolian_Function *fid,
const char *pdesc = eolian_documentation_description_get(pdoc);
curl = _indent_line(buf, indent);
eina_strbuf_append(buf, " * ");
- _append_section(src, eolian_documentation_summary_get(pdoc), indent,
+ _append_section(state, eolian_documentation_summary_get(pdoc), indent,
curl + 3, buf, wbuf, use_legacy);
eina_strbuf_append_char(buf, '\n');
if (pdesc)
@@ -559,7 +559,7 @@ eo_gen_docs_func_gen(const Eolian_Unit *src, const Eolian_Function *fid,
eina_strbuf_append(buf, " *\n");
curl = _indent_line(buf, indent);
eina_strbuf_append(buf, " * ");
- _append_section(src, pdesc, indent, curl + 3, buf, wbuf, use_legacy);
+ _append_section(state, pdesc, indent, curl + 3, buf, wbuf, use_legacy);
eina_strbuf_append_char(buf, '\n');
}
if (par || rdoc || since)
@@ -613,7 +613,7 @@ eo_gen_docs_func_gen(const Eolian_Unit *src, const Eolian_Function *fid,
{
eina_strbuf_append_char(buf, ' ');
curl += 1;
- _append_section(src, eolian_documentation_summary_get(adoc),
+ _append_section(state, eolian_documentation_summary_get(adoc),
indent, curl, buf, wbuf, use_legacy);
}
@@ -646,7 +646,7 @@ eo_gen_docs_func_gen(const Eolian_Unit *src, const Eolian_Function *fid,
curl = _indent_line(buf, indent);
eina_strbuf_append(buf, " * @return ");
curl += sizeof(" * @return ") - 1;
- _append_section(src, eolian_documentation_summary_get(rdoc), indent,
+ _append_section(state, eolian_documentation_summary_get(rdoc), indent,
curl, buf, wbuf, use_legacy);
eina_strbuf_append_char(buf, '\n');
if (since)
diff --git a/src/bin/eolian/docs.h b/src/bin/eolian/docs.h
index 69dbc3e433..79112f9758 100644
--- a/src/bin/eolian/docs.h
+++ b/src/bin/eolian/docs.h
@@ -14,7 +14,7 @@
* @return A documentation comment
*
*/
-Eina_Strbuf *eo_gen_docs_full_gen(const Eolian_Unit *unit, const Eolian_Documentation *doc, const char *group, int indent, Eina_Bool use_legacy);
+Eina_Strbuf *eo_gen_docs_full_gen(const Eolian_State *state, const Eolian_Documentation *doc, const char *group, int indent, Eina_Bool use_legacy);
/*
* @brief Generate function documentation
@@ -27,7 +27,7 @@ Eina_Strbuf *eo_gen_docs_full_gen(const Eolian_Unit *unit, const Eolian_Document
* @return A documentation comment
*
*/
-Eina_Strbuf *eo_gen_docs_func_gen(const Eolian_Unit *unit, const Eolian_Function *fid, Eolian_Function_Type ftype, int indent, Eina_Bool use_legacy);
+Eina_Strbuf *eo_gen_docs_func_gen(const Eolian_State *state, const Eolian_Function *fid, Eolian_Function_Type ftype, int indent, Eina_Bool use_legacy);
/*
* @brief Generate event documentation
@@ -38,7 +38,7 @@ Eina_Strbuf *eo_gen_docs_func_gen(const Eolian_Unit *unit, const Eolian_Function
* @return A documentation comment
*
*/
-Eina_Strbuf *eo_gen_docs_event_gen(const Eolian_Unit *unit, const Eolian_Event *ev, const char *group);
+Eina_Strbuf *eo_gen_docs_event_gen(const Eolian_State *state, const Eolian_Event *ev, const char *group);
#endif
diff --git a/src/bin/eolian/headers.c b/src/bin/eolian/headers.c
index b2fe73a00c..4ebf9a7fdd 100644
--- a/src/bin/eolian/headers.c
+++ b/src/bin/eolian/headers.c
@@ -12,13 +12,13 @@ _get_add_star(Eolian_Function_Type ftype, Eolian_Parameter_Dir pdir)
}
static int
-_gen_param(const Eolian_Unit *src, Eina_Strbuf *buf,
- Eolian_Function_Parameter *pr, Eolian_Function_Type ftype, int *rpid)
+_gen_param(Eina_Strbuf *buf, Eolian_Function_Parameter *pr,
+ Eolian_Function_Type ftype, int *rpid)
{
const Eolian_Type *prt = eolian_parameter_type_get(pr);
- const Eolian_Typedecl *ptd = eolian_type_typedecl_get(src, prt);
+ const Eolian_Typedecl *ptd = eolian_type_typedecl_get(prt);
const char *prn = eolian_parameter_name_get(pr);
- Eina_Stringshare *prtn = eolian_type_c_type_get(src, prt, EOLIAN_C_TYPE_PARAM);
+ Eina_Stringshare *prtn = eolian_type_c_type_get(prt, EOLIAN_C_TYPE_PARAM);
if (ptd && (eolian_typedecl_type_get(ptd) == EOLIAN_TYPEDECL_FUNCTION_POINTER))
{
@@ -40,7 +40,7 @@ _gen_param(const Eolian_Unit *src, Eina_Strbuf *buf,
}
void
-eo_gen_params(const Eolian_Unit *src, Eina_Iterator *itr, Eina_Strbuf *buf,
+eo_gen_params(Eina_Iterator *itr, Eina_Strbuf *buf,
Eina_Strbuf **flagbuf, int *nidx, Eolian_Function_Type ftype)
{
Eolian_Function_Parameter *pr;
@@ -49,7 +49,7 @@ eo_gen_params(const Eolian_Unit *src, Eina_Iterator *itr, Eina_Strbuf *buf,
int rpid = 0;
if (*nidx)
eina_strbuf_append(buf, ", ");
- *nidx += _gen_param(src, buf, pr, ftype, &rpid);
+ *nidx += _gen_param(buf, pr, ftype, &rpid);
if (!eolian_parameter_is_nonull(pr) || !flagbuf)
continue;
@@ -66,7 +66,7 @@ eo_gen_params(const Eolian_Unit *src, Eina_Iterator *itr, Eina_Strbuf *buf,
}
static void
-_gen_func(const Eolian_Unit *src, const Eolian_Function *fid,
+_gen_func(const Eolian_State *state, const Eolian_Function *fid,
Eolian_Function_Type ftype, Eina_Strbuf *buf, char *cname,
char *cnameu, Eina_Bool legacy)
{
@@ -104,7 +104,7 @@ _gen_func(const Eolian_Unit *src, const Eolian_Function *fid,
hasdoc = !!eolian_implement_documentation_get(fimp, EOLIAN_PROPERTY);
if (hasdoc)
{
- Eina_Strbuf *dbuf = eo_gen_docs_func_gen(src, fid, ftype, 0, legacy);
+ Eina_Strbuf *dbuf = eo_gen_docs_func_gen(state, fid, ftype, 0, legacy);
eina_strbuf_append(buf, eina_strbuf_string_get(dbuf));
eina_strbuf_append_char(buf, '\n');
eina_strbuf_free(dbuf);
@@ -112,7 +112,7 @@ _gen_func(const Eolian_Unit *src, const Eolian_Function *fid,
eina_strbuf_append(buf, legacy ? "EAPI " : "EOAPI ");
if (rtp)
{
- Eina_Stringshare *rtps = eolian_type_c_type_get(src, rtp, EOLIAN_C_TYPE_RETURN);
+ Eina_Stringshare *rtps = eolian_type_c_type_get(rtp, EOLIAN_C_TYPE_RETURN);
eina_strbuf_append(buf, rtps);
if (rtps[strlen(rtps) - 1] != '*')
eina_strbuf_append_char(buf, ' ');
@@ -141,7 +141,7 @@ _gen_func(const Eolian_Unit *src, const Eolian_Function *fid,
eina_strbuf_append(buf, "Eo *obj");
}
- eo_gen_params(src, eolian_property_keys_get(fid, ftype), buf, &flagbuf, &nidx, EOLIAN_PROPERTY);
+ eo_gen_params(eolian_property_keys_get(fid, ftype), buf, &flagbuf, &nidx, EOLIAN_PROPERTY);
if (!var_as_ret)
{
@@ -150,7 +150,7 @@ _gen_func(const Eolian_Unit *src, const Eolian_Function *fid,
itr = eolian_property_values_get(fid, ftype);
else
itr = eolian_function_parameters_get(fid);
- eo_gen_params(src, itr, buf, &flagbuf, &nidx, ftype);
+ eo_gen_params(itr, buf, &flagbuf, &nidx, ftype);
}
if (flagbuf)
@@ -181,7 +181,7 @@ _gen_func(const Eolian_Unit *src, const Eolian_Function *fid,
}
void
-eo_gen_header_gen(const Eolian_Unit *src, const Eolian_Class *cl,
+eo_gen_header_gen(const Eolian_State *state, const Eolian_Class *cl,
Eina_Strbuf *buf, Eina_Bool legacy)
{
if (!cl)
@@ -197,8 +197,8 @@ eo_gen_header_gen(const Eolian_Unit *src, const Eolian_Class *cl,
const Eolian_Documentation *doc = eolian_class_documentation_get(cl);
if (doc)
{
- Eina_Strbuf *cdoc = eo_gen_docs_full_gen(src, doc,
- eolian_class_full_name_get(cl), 0, EINA_FALSE);
+ Eina_Strbuf *cdoc = eo_gen_docs_full_gen(state, doc,
+ eolian_class_name_get(cl), 0, EINA_FALSE);
if (cdoc)
{
eina_strbuf_append(buf, eina_strbuf_string_get(cdoc));
@@ -237,15 +237,15 @@ eo_gen_header_gen(const Eolian_Unit *src, const Eolian_Class *cl,
{
case EOLIAN_PROP_GET:
case EOLIAN_PROP_SET:
- _gen_func(src, fid, ftype, buf, cname, cnameu, legacy);
+ _gen_func(state, fid, ftype, buf, cname, cnameu, legacy);
break;
case EOLIAN_PROPERTY:
- _gen_func(src, fid, EOLIAN_PROP_SET, buf, cname, cnameu, legacy);
+ _gen_func(state, fid, EOLIAN_PROP_SET, buf, cname, cnameu, legacy);
eina_strbuf_append_char(buf, '\n');
- _gen_func(src, fid, EOLIAN_PROP_GET, buf, cname, cnameu, legacy);
+ _gen_func(state, fid, EOLIAN_PROP_GET, buf, cname, cnameu, legacy);
break;
default:
- _gen_func(src, fid, EOLIAN_METHOD, buf, cname, cnameu, legacy);
+ _gen_func(state, fid, EOLIAN_METHOD, buf, cname, cnameu, legacy);
}
}
eina_iterator_free(itr);
@@ -282,8 +282,8 @@ events:
eina_strbuf_append_printf(buf, "EWAPI extern const "
"Efl_Event_Description _%s;\n\n", evn);
- Eina_Strbuf *evdbuf = eo_gen_docs_event_gen(src, ev,
- eolian_class_full_name_get(cl));
+ Eina_Strbuf *evdbuf = eo_gen_docs_event_gen(state, ev,
+ eolian_class_name_get(cl));
eina_strbuf_append(buf, eina_strbuf_string_get(evdbuf));
eina_strbuf_append_char(buf, '\n');
eina_strbuf_free(evdbuf);
diff --git a/src/bin/eolian/headers.h b/src/bin/eolian/headers.h
index 41c7658b96..94fd89b908 100644
--- a/src/bin/eolian/headers.h
+++ b/src/bin/eolian/headers.h
@@ -3,7 +3,7 @@
#include "main.h"
-void eo_gen_params(const Eolian_Unit *src, Eina_Iterator *itr, Eina_Strbuf *buf, Eina_Strbuf **flagbuf, int *nidx, Eolian_Function_Type ftype);
-void eo_gen_header_gen(const Eolian_Unit *src, const Eolian_Class *cl, Eina_Strbuf *buf, Eina_Bool legacy);
+void eo_gen_params(Eina_Iterator *itr, Eina_Strbuf *buf, Eina_Strbuf **flagbuf, int *nidx, Eolian_Function_Type ftype);
+void eo_gen_header_gen(const Eolian_State *state, const Eolian_Class *cl, Eina_Strbuf *buf, Eina_Bool legacy);
#endif
diff --git a/src/bin/eolian/main.c b/src/bin/eolian/main.c
index 4c51e18d17..db8ea371dd 100644
--- a/src/bin/eolian/main.c
+++ b/src/bin/eolian/main.c
@@ -282,7 +282,7 @@ void eo_gen_class_names_get(const Eolian_Class *cl, char **cname,
char **cnameu, char **cnamel)
{
char *cn = NULL, *cnu = NULL, *cnl = NULL;
- cn = eo_gen_c_full_name_get(eolian_class_full_name_get(cl));
+ cn = eo_gen_c_full_name_get(eolian_class_name_get(cl));
if (!cn)
abort();
if (cname)
@@ -318,17 +318,17 @@ void eo_gen_class_names_get(const Eolian_Class *cl, char **cname,
}
static Eina_Bool
-_write_header(const Eolian *eos, const Eolian_Unit *src, const char *ofname,
+_write_header(const Eolian_State *eos, const Eolian_State *state, const char *ofname,
const char *ifname, Eina_Bool legacy)
{
INF("generating header: %s (legacy: %d)", ofname, legacy);
Eina_Strbuf *buf = eina_strbuf_new();
- eo_gen_types_header_gen(src, eolian_declarations_get_by_file(eos, ifname),
+ eo_gen_types_header_gen(state, eolian_state_objects_by_file_get(eos, ifname),
buf, EINA_TRUE, legacy);
buf = _include_guard(ifname, "TYPES", buf);
- Eina_Strbuf *cltd = eo_gen_class_typedef_gen(src, ifname);
+ Eina_Strbuf *cltd = eo_gen_class_typedef_gen(eos, ifname);
if (cltd)
{
cltd = _include_guard(ifname, "CLASS_TYPE", cltd);
@@ -337,8 +337,8 @@ _write_header(const Eolian *eos, const Eolian_Unit *src, const char *ofname,
eina_strbuf_free(cltd);
}
- const Eolian_Class *cl = eolian_class_get_by_file(src, ifname);
- eo_gen_header_gen(src, cl, buf, legacy);
+ const Eolian_Class *cl = eolian_state_class_by_file_get(eos, ifname);
+ eo_gen_header_gen(state, cl, buf, legacy);
if (cl || !legacy)
{
buf = _include_guard(_get_filename(ofname), NULL, buf);
@@ -354,16 +354,16 @@ _write_header(const Eolian *eos, const Eolian_Unit *src, const char *ofname,
}
static Eina_Bool
-_write_stub_header(const Eolian *eos, const Eolian_Unit *src, const char *ofname,
+_write_stub_header(const Eolian_State *eos, const Eolian_State *state, const char *ofname,
const char *ifname)
{
INF("generating stub header: %s", ofname);
Eina_Strbuf *buf = eina_strbuf_new();
- eo_gen_types_header_gen(src, eolian_declarations_get_by_file(eos, ifname),
+ eo_gen_types_header_gen(state, eolian_state_objects_by_file_get(eos, ifname),
buf, EINA_FALSE, EINA_FALSE);
- Eina_Strbuf *cltd = eo_gen_class_typedef_gen(src, ifname);
+ Eina_Strbuf *cltd = eo_gen_class_typedef_gen(eos, ifname);
if (cltd)
{
eina_strbuf_prepend_char(buf, '\n');
@@ -379,15 +379,15 @@ _write_stub_header(const Eolian *eos, const Eolian_Unit *src, const char *ofname
}
static Eina_Bool
-_write_source(const Eolian *eos, const Eolian_Unit *src, const char *ofname,
+_write_source(const Eolian_State *eos, const char *ofname,
const char *ifname, Eina_Bool eot)
{
INF("generating source: %s", ofname);
Eina_Strbuf *buf = eina_strbuf_new();
- const Eolian_Class *cl = eolian_class_get_by_file(src, ifname);
- eo_gen_types_source_gen(src, eolian_declarations_get_by_file(eos, ifname), buf);
- eo_gen_source_gen(src, cl, buf);
+ const Eolian_Class *cl = eolian_state_class_by_file_get(eos, ifname);
+ eo_gen_types_source_gen(eolian_state_objects_by_file_get(eos, ifname), buf);
+ eo_gen_source_gen(cl, buf);
if (cl || (eot && eina_strbuf_length_get(buf)))
{
if (_write_file(ofname, buf))
@@ -402,11 +402,11 @@ _write_source(const Eolian *eos, const Eolian_Unit *src, const char *ofname,
}
static Eina_Bool
-_write_impl(const Eolian_Unit *src, const char *ofname, const char *ifname)
+_write_impl(const Eolian_State *eos, const char *ofname, const char *ifname)
{
INF("generating impl: %s", ofname);
- const Eolian_Class *cl = eolian_class_get_by_file(src, ifname);
+ const Eolian_Class *cl = eolian_state_class_by_file_get(eos, ifname);
if (!cl)
return EINA_FALSE;
@@ -414,7 +414,7 @@ _write_impl(const Eolian_Unit *src, const char *ofname, const char *ifname)
if (!_read_file(ofname, &buf))
return EINA_FALSE;
- eo_gen_impl_gen(src, cl, buf);
+ eo_gen_impl_gen(cl, buf);
Eina_Bool ret = _write_file(ofname, buf);
eina_strbuf_free(buf);
return ret;
@@ -432,7 +432,7 @@ main(int argc, char **argv)
eina_init();
eolian_init();
- Eolian *eos = eolian_new();
+ Eolian_State *eos = eolian_state_new();
const char *dom = "eolian_gen";
_eolian_gen_log_dom = eina_log_domain_register(dom, EINA_COLOR_GREEN);
@@ -534,7 +534,7 @@ main(int argc, char **argv)
if (scan_system)
{
- if (!eolian_system_directory_scan(eos))
+ if (!eolian_state_system_directory_add(eos))
{
fprintf(stderr, "eolian: could not scan system directory\n");
goto end;
@@ -544,15 +544,14 @@ main(int argc, char **argv)
const char *inc;
EINA_LIST_FREE(includes, inc)
{
- if (!eolian_directory_scan(eos, inc))
+ if (!eolian_state_directory_add(eos, inc))
{
fprintf(stderr, "eolian: could not scan '%s'\n", inc);
goto end;
}
}
- const Eolian_Unit *src = eolian_file_parse(eos, input);
- if (!src)
+ if (!eolian_state_file_parse(eos, input))
{
fprintf(stderr, "eolian: could not parse file '%s'\n", input);
goto end;
@@ -567,15 +566,15 @@ main(int argc, char **argv)
Eina_Bool succ = EINA_TRUE;
if (gen_what & GEN_H)
- succ = _write_header(eos, src, outs[_get_bit_pos(GEN_H)], eobn, EINA_FALSE);
+ succ = _write_header(eos, eos, outs[_get_bit_pos(GEN_H)], eobn, EINA_FALSE);
if (succ && (gen_what & GEN_H_LEGACY))
- succ = _write_header(eos, src, outs[_get_bit_pos(GEN_H_LEGACY)], eobn, EINA_TRUE);
+ succ = _write_header(eos, eos, outs[_get_bit_pos(GEN_H_LEGACY)], eobn, EINA_TRUE);
if (succ && (gen_what & GEN_H_STUB))
- succ = _write_stub_header(eos, src, outs[_get_bit_pos(GEN_H_STUB)], eobn);
+ succ = _write_stub_header(eos, eos, outs[_get_bit_pos(GEN_H_STUB)], eobn);
if (succ && (gen_what & GEN_C))
- succ = _write_source(eos, src, outs[_get_bit_pos(GEN_C)], eobn, !strcmp(ext, ".eot"));
+ succ = _write_source(eos, outs[_get_bit_pos(GEN_C)], eobn, !strcmp(ext, ".eot"));
if (succ && (gen_what & GEN_C_IMPL))
- succ = _write_impl(src, outs[_get_bit_pos(GEN_C_IMPL)], eobn);
+ succ = _write_impl(eos, outs[_get_bit_pos(GEN_C_IMPL)], eobn);
if (!succ)
goto end;
@@ -593,7 +592,7 @@ end:
free(outs[i]);
free(basen);
- eolian_free(eos);
+ eolian_state_free(eos);
eolian_shutdown();
eina_shutdown();
diff --git a/src/bin/eolian/sources.c b/src/bin/eolian/sources.c
index a012e8c602..3ac3b48391 100644
--- a/src/bin/eolian/sources.c
+++ b/src/bin/eolian/sources.c
@@ -103,12 +103,11 @@ _gen_func_pointer_param(const char *name, Eina_Stringshare *c_type,
}
static void
-_append_defval(const Eolian_Unit *src, Eina_Strbuf *buf,
- const Eolian_Expression *exp, const Eolian_Type *tp)
+_append_defval(Eina_Strbuf *buf, const Eolian_Expression *exp, const Eolian_Type *tp)
{
if (exp)
{
- Eolian_Value val = eolian_expression_eval_type(src, exp, tp);
+ Eolian_Value val = eolian_expression_eval_type(exp, tp);
Eina_Stringshare *lit = eolian_expression_value_to_literal(&val);
if (lit)
{
@@ -123,16 +122,16 @@ _append_defval(const Eolian_Unit *src, Eina_Strbuf *buf,
else WRN("evaluation of default value failed");
}
/* default value or fallback */
- const Eolian_Type *btp = eolian_type_aliased_base_get(src, tp);
+ const Eolian_Type *btp = eolian_type_aliased_base_get(tp);
if (eolian_type_is_ptr(btp))
{
eina_strbuf_append(buf, "NULL");
return;
}
- const Eolian_Typedecl *tdcl = eolian_type_typedecl_get(src, btp);
+ const Eolian_Typedecl *tdcl = eolian_type_typedecl_get(btp);
if (tdcl && (eolian_typedecl_type_get(tdcl) == EOLIAN_TYPEDECL_STRUCT))
{
- char *sn = eo_gen_c_full_name_get(eolian_typedecl_full_name_get(tdcl));
+ char *sn = eo_gen_c_full_name_get(eolian_typedecl_name_get(tdcl));
if (eina_streq(sn, "Eina_Rect"))
eina_strbuf_append(buf, "(EINA_RECT_EMPTY())");
else
@@ -140,7 +139,7 @@ _append_defval(const Eolian_Unit *src, Eina_Strbuf *buf,
free(sn);
return;
}
- Eina_Stringshare *ctp = eolian_type_c_type_get(src, btp, EOLIAN_C_TYPE_DEFAULT);
+ Eina_Stringshare *ctp = eolian_type_c_type_get(btp, EOLIAN_C_TYPE_DEFAULT);
if (strchr(ctp, '*'))
{
eina_strbuf_append(buf, "NULL");
@@ -157,7 +156,7 @@ _generate_normal_free(Eina_Strbuf **buf, const Eolian_Type *type, const Eina_Str
const char *free_func = eolian_type_free_func_get(type);
if (!free_func)
{
- printf("No free type %s\n", eolian_type_name_get(type));
+ printf("No free type %s\n", eolian_type_short_name_get(type));
return;
}
@@ -182,7 +181,7 @@ _generate_loop_content(Eina_Strbuf **buf, const Eolian_Type *inner_type, const E
}
static void
-_generate_iterative_free(const Eolian_Unit *src, Eina_Strbuf **buf, const Eolian_Type *type, const Eolian_Type *inner_type, Eolian_Function_Parameter *parameter, Eina_Strbuf *param)
+_generate_iterative_free(Eina_Strbuf **buf, const Eolian_Type *type, const Eolian_Type *inner_type, Eolian_Function_Parameter *parameter, Eina_Strbuf *param)
{
Eina_Strbuf *iterator_header, *iter_param;
@@ -194,7 +193,7 @@ _generate_iterative_free(const Eolian_Unit *src, Eina_Strbuf **buf, const Eolian
eina_strbuf_append_printf(iter_param, "%s_iter", eolian_parameter_name_get(parameter));
//generate the field definition
- eina_strbuf_append_printf(*buf, " %s", eolian_type_c_type_get(src, inner_type, EOLIAN_C_TYPE_DEFAULT));
+ eina_strbuf_append_printf(*buf, " %s", eolian_type_c_type_get(inner_type, EOLIAN_C_TYPE_DEFAULT));
if(t == EOLIAN_TYPE_BUILTIN_INARRAY
|| t == EOLIAN_TYPE_BUILTIN_INLIST)
{
@@ -269,9 +268,9 @@ _generate_iterative_free(const Eolian_Unit *src, Eina_Strbuf **buf, const Eolian
}
static void
-_gen_func(const Eolian_Unit *src, const Eolian_Class *cl,
- const Eolian_Function *fid, Eolian_Function_Type ftype,
- Eina_Strbuf *buf, const Eolian_Implement *impl, Eina_Strbuf *lbuf)
+_gen_func(const Eolian_Class *cl, const Eolian_Function *fid,
+ Eolian_Function_Type ftype, Eina_Strbuf *buf,
+ const Eolian_Implement *impl, Eina_Strbuf *lbuf)
{
Eina_Bool is_empty = eolian_implement_is_empty(impl, ftype);
Eina_Bool is_auto = eolian_implement_is_auto(impl, ftype);
@@ -317,9 +316,6 @@ _gen_func(const Eolian_Unit *src, const Eolian_Class *cl,
Eina_Strbuf *params_init = eina_strbuf_new(); /* default value inits */
Eina_Strbuf *fallback_free_ownership = eina_strbuf_new(); /* list of function calls that are freeing the owned parameters, or doing nothing on the normal parameters, NULL if there is nothing owned*/
- Eina_Stringshare *promise_param_name = NULL;
- Eina_Stringshare *promise_param_type = NULL;
-
/* property keys */
{
Eina_Iterator *itr = eolian_property_keys_get(fid, ftype);
@@ -328,7 +324,7 @@ _gen_func(const Eolian_Unit *src, const Eolian_Class *cl,
{
const char *prn = eolian_parameter_name_get(pr);
const Eolian_Type *pt = eolian_parameter_type_get(pr);
- Eina_Stringshare *ptn = eolian_type_c_type_get(src, pt, EOLIAN_C_TYPE_PARAM);
+ Eina_Stringshare *ptn = eolian_type_c_type_get(pt, EOLIAN_C_TYPE_PARAM);
if (eina_strbuf_length_get(params))
eina_strbuf_append(params, ", ");
@@ -400,7 +396,7 @@ _gen_func(const Eolian_Unit *src, const Eolian_Class *cl,
}
else if (inner_type && eolian_type_is_owned(inner_type))
{
- _generate_iterative_free(src, &fallback_free_ownership, type, inner_type, pr, param_call);
+ _generate_iterative_free(&fallback_free_ownership, type, inner_type, pr, param_call);
}
}
eina_iterator_free(itr);
@@ -429,8 +425,8 @@ _gen_func(const Eolian_Unit *src, const Eolian_Class *cl,
const Eolian_Expression *dfv = eolian_parameter_default_value_get(pr);
const char *prn = eolian_parameter_name_get(pr);
const Eolian_Type *pt = eolian_parameter_type_get(pr);
- Eina_Stringshare *ptn = eolian_type_c_type_get(src, pt, EOLIAN_C_TYPE_PARAM);
- const Eolian_Typedecl *ptd = eolian_type_typedecl_get(src, pt);
+ Eina_Stringshare *ptn = eolian_type_c_type_get(pt, EOLIAN_C_TYPE_PARAM);
+ const Eolian_Typedecl *ptd = eolian_type_typedecl_get(pt);
Eina_Bool had_star = ptn[strlen(ptn) - 1] == '*';
const char *add_star = _get_add_star(ftype, pd);
@@ -474,7 +470,7 @@ _gen_func(const Eolian_Unit *src, const Eolian_Class *cl,
}
else if ((ftype != EOLIAN_PROP_SET) && dfv)
{
- Eolian_Value val = eolian_expression_eval(src, dfv, EOLIAN_MASK_ALL);
+ Eolian_Value val = eolian_expression_eval(dfv, EOLIAN_MASK_ALL);
if (val.type)
{
Eina_Stringshare *vals = eolian_expression_value_to_literal(&val);
@@ -501,7 +497,7 @@ _gen_func(const Eolian_Unit *src, const Eolian_Class *cl,
if (impl_same_class && eolian_implement_is_pure_virtual(impl, ftype))
impl_need = EINA_FALSE;
- Eina_Stringshare *rtpn = rtp ? eolian_type_c_type_get(src, rtp, EOLIAN_C_TYPE_RETURN)
+ Eina_Stringshare *rtpn = rtp ? eolian_type_c_type_get(rtp, EOLIAN_C_TYPE_RETURN)
: eina_stringshare_add("void");
char *cname = NULL, *cnamel = NULL, *ocnamel = NULL;
@@ -534,7 +530,7 @@ _gen_func(const Eolian_Unit *src, const Eolian_Class *cl,
eina_strbuf_append(buf, func_suffix);
/* ([const ]Eo *obj, Data_Type *pd, impl_full_params); */
eina_strbuf_append_char(buf, '(');
- if (eolian_function_object_is_const(fid))
+ if ((ftype == EOLIAN_PROP_GET) || eolian_function_object_is_const(fid))
eina_strbuf_append(buf, "const ");
eina_strbuf_append(buf, "Eo *obj, ");
eina_strbuf_append(buf, dt);
@@ -565,7 +561,7 @@ _gen_func(const Eolian_Unit *src, const Eolian_Class *cl,
eina_strbuf_append(buf, eolian_function_name_get(fid));
eina_strbuf_append(buf, func_suffix);
eina_strbuf_append_char(buf, '(');
- if (eolian_function_object_is_const(fid))
+ if ((ftype == EOLIAN_PROP_GET) || eolian_function_object_is_const(fid))
eina_strbuf_append(buf, "const ");
eina_strbuf_append(buf, "Eo *obj");
if (is_empty || is_auto)
@@ -585,7 +581,7 @@ _gen_func(const Eolian_Unit *src, const Eolian_Class *cl,
if (rtp)
{
eina_strbuf_append(buf, " return ");
- _append_defval(src, buf, def_ret, rtp);
+ _append_defval(buf, def_ret, rtp);
eina_strbuf_append(buf, ";\n");
}
eina_strbuf_append(buf, "}\n\n");
@@ -660,7 +656,7 @@ _gen_func(const Eolian_Unit *src, const Eolian_Class *cl,
if (strcmp(rtpn, "void"))
{
eina_strbuf_append_printf(buf, ", %s, ", rtpn);
- _append_defval(src, buf, def_ret, rtp);
+ _append_defval(buf, def_ret, rtp);
}
if (fallback_free_ownership)
@@ -728,9 +724,6 @@ _gen_func(const Eolian_Unit *src, const Eolian_Class *cl,
eina_stringshare_del(rtpn);
- eina_stringshare_del(promise_param_name);
- eina_stringshare_del(promise_param_type);
-
eina_strbuf_free(params);
eina_strbuf_free(params_full);
eina_strbuf_free(params_full_imp);
@@ -872,8 +865,7 @@ _gen_initializer(const Eolian_Class *cl, Eina_Strbuf *buf)
}
void
-eo_gen_source_gen(const Eolian_Unit *src,
- const Eolian_Class *cl, Eina_Strbuf *buf)
+eo_gen_source_gen(const Eolian_Class *cl, Eina_Strbuf *buf)
{
if (!cl)
return;
@@ -918,14 +910,14 @@ eo_gen_source_gen(const Eolian_Unit *src,
{
case EOLIAN_PROP_GET:
case EOLIAN_PROP_SET:
- _gen_func(src, cl, fid, ftype, buf, imp, lbuf);
+ _gen_func(cl, fid, ftype, buf, imp, lbuf);
break;
case EOLIAN_PROPERTY:
- _gen_func(src, cl, fid, EOLIAN_PROP_SET, buf, imp, lbuf);
- _gen_func(src, cl, fid, EOLIAN_PROP_GET, buf, imp, lbuf);
+ _gen_func(cl, fid, EOLIAN_PROP_SET, buf, imp, lbuf);
+ _gen_func(cl, fid, EOLIAN_PROP_GET, buf, imp, lbuf);
break;
default:
- _gen_func(src, cl, fid, EOLIAN_METHOD, buf, imp, lbuf);
+ _gen_func(cl, fid, EOLIAN_METHOD, buf, imp, lbuf);
}
}
eina_iterator_free(itr);
@@ -939,7 +931,7 @@ eo_gen_source_gen(const Eolian_Unit *src,
eina_strbuf_append(buf, cnamel);
eina_strbuf_append(buf, "_class_desc = {\n"
" EO_VERSION,\n");
- eina_strbuf_append_printf(buf, " \"%s\",\n", eolian_class_full_name_get(cl));
+ eina_strbuf_append_printf(buf, " \"%s\",\n", eolian_class_name_get(cl));
switch (eolian_class_type_get(cl))
{
@@ -1018,9 +1010,8 @@ eo_gen_source_gen(const Eolian_Unit *src,
}
static void
-_gen_params(const Eolian_Unit *src, const Eolian_Function *fid,
- Eolian_Function_Type ftype, Eina_Bool var_as_ret,
- Eina_Strbuf *params, Eina_Strbuf *params_full)
+_gen_params(const Eolian_Function *fid, Eolian_Function_Type ftype,
+ Eina_Bool var_as_ret, Eina_Strbuf *params, Eina_Strbuf *params_full)
{
Eina_Bool is_prop = (ftype == EOLIAN_PROP_GET || ftype == EOLIAN_PROP_SET);
@@ -1032,7 +1023,7 @@ _gen_params(const Eolian_Unit *src, const Eolian_Function *fid,
{
const char *prn = eolian_parameter_name_get(pr);
const Eolian_Type *pt = eolian_parameter_type_get(pr);
- Eina_Stringshare *ptn = eolian_type_c_type_get(src, pt, EOLIAN_C_TYPE_PARAM);
+ Eina_Stringshare *ptn = eolian_type_c_type_get(pt, EOLIAN_C_TYPE_PARAM);
eina_strbuf_append(params, ", ");
eina_strbuf_append(params, prn);
@@ -1061,8 +1052,8 @@ _gen_params(const Eolian_Unit *src, const Eolian_Function *fid,
Eolian_Parameter_Dir pd = eolian_parameter_direction_get(pr);
const char *prn = eolian_parameter_name_get(pr);
const Eolian_Type *pt = eolian_parameter_type_get(pr);
- const Eolian_Typedecl *ptd = eolian_type_typedecl_get(src, pt);
- Eina_Stringshare *ptn = eolian_type_c_type_get(src, pt, EOLIAN_C_TYPE_PARAM);
+ const Eolian_Typedecl *ptd = eolian_type_typedecl_get(pt);
+ Eina_Stringshare *ptn = eolian_type_c_type_get(pt, EOLIAN_C_TYPE_PARAM);
if (ptd && eolian_typedecl_type_get(ptd) == EOLIAN_TYPEDECL_FUNCTION_POINTER)
{
@@ -1093,10 +1084,9 @@ _gen_params(const Eolian_Unit *src, const Eolian_Function *fid,
}
static void
-_gen_proto(const Eolian_Unit *src, const Eolian_Class *cl,
- const Eolian_Function *fid, Eolian_Function_Type ftype,
- Eina_Strbuf *buf, const Eolian_Implement *impl, const char *dtype,
- const char *cnamel)
+_gen_proto(const Eolian_Class *cl, const Eolian_Function *fid,
+ Eolian_Function_Type ftype, Eina_Strbuf *buf,
+ const Eolian_Implement *impl, const char *dtype, const char *cnamel)
{
Eina_Bool impl_same_class = (eolian_implement_class_get(impl) == cl);
if (impl_same_class && eolian_implement_is_pure_virtual(impl, ftype))
@@ -1142,7 +1132,7 @@ _gen_proto(const Eolian_Unit *src, const Eolian_Class *cl,
eina_strbuf_append(buf, "EOLIAN static ");
if (rtp)
{
- Eina_Stringshare *rtpn = eolian_type_c_type_get(src, rtp, EOLIAN_C_TYPE_RETURN);
+ Eina_Stringshare *rtpn = eolian_type_c_type_get(rtp, EOLIAN_C_TYPE_RETURN);
eina_strbuf_append(buf, rtpn);
eina_stringshare_del(rtpn);
}
@@ -1151,7 +1141,7 @@ _gen_proto(const Eolian_Unit *src, const Eolian_Class *cl,
eina_strbuf_append_printf(buf, "\n%s(", fname);
- if (eolian_function_object_is_const(fid))
+ if ((ftype == EOLIAN_PROP_GET) || eolian_function_object_is_const(fid))
eina_strbuf_append(buf, "const ");
eina_strbuf_append(buf, "Eo *obj, ");
@@ -1163,7 +1153,7 @@ _gen_proto(const Eolian_Unit *src, const Eolian_Class *cl,
/* gen params here */
Eina_Strbuf *params = eina_strbuf_new();
Eina_Strbuf *params_full = eina_strbuf_new();
- _gen_params(src, fid, ftype, var_as_ret, params, params_full);
+ _gen_params(fid, ftype, var_as_ret, params, params_full);
if (eina_strbuf_length_get(params_full))
eina_strbuf_append(buf, eina_strbuf_string_get(params_full));
@@ -1193,8 +1183,7 @@ _gen_proto(const Eolian_Unit *src, const Eolian_Class *cl,
}
void
-eo_gen_impl_gen(const Eolian_Unit *src,
- const Eolian_Class *cl, Eina_Strbuf *buf)
+eo_gen_impl_gen(const Eolian_Class *cl, Eina_Strbuf *buf)
{
if (!cl)
return;
@@ -1244,14 +1233,14 @@ eo_gen_impl_gen(const Eolian_Unit *src,
{
case EOLIAN_PROP_GET:
case EOLIAN_PROP_SET:
- _gen_proto(src, cl, fid, ftype, buf, imp, dt, cnamel);
+ _gen_proto(cl, fid, ftype, buf, imp, dt, cnamel);
break;
case EOLIAN_PROPERTY:
- _gen_proto(src, cl, fid, EOLIAN_PROP_SET, buf, imp, dt, cnamel);
- _gen_proto(src, cl, fid, EOLIAN_PROP_GET, buf, imp, dt, cnamel);
+ _gen_proto(cl, fid, EOLIAN_PROP_SET, buf, imp, dt, cnamel);
+ _gen_proto(cl, fid, EOLIAN_PROP_GET, buf, imp, dt, cnamel);
break;
default:
- _gen_proto(src, cl, fid, EOLIAN_METHOD, buf, imp, dt, cnamel);
+ _gen_proto(cl, fid, EOLIAN_METHOD, buf, imp, dt, cnamel);
}
}
eina_iterator_free(itr);
diff --git a/src/bin/eolian/sources.h b/src/bin/eolian/sources.h
index 7d2e8d3db0..05d711458b 100644
--- a/src/bin/eolian/sources.h
+++ b/src/bin/eolian/sources.h
@@ -3,7 +3,7 @@
#include "main.h"
-void eo_gen_source_gen(const Eolian_Unit *src, const Eolian_Class *cl, Eina_Strbuf *buf);
-void eo_gen_impl_gen(const Eolian_Unit *src, const Eolian_Class *cl, Eina_Strbuf *buf);
+void eo_gen_source_gen(const Eolian_Class *cl, Eina_Strbuf *buf);
+void eo_gen_impl_gen(const Eolian_Class *cl, Eina_Strbuf *buf);
#endif
diff --git a/src/bin/eolian/types.c b/src/bin/eolian/types.c
index d8285fbeb4..b8f7b98452 100644
--- a/src/bin/eolian/types.c
+++ b/src/bin/eolian/types.c
@@ -3,13 +3,13 @@
#include "docs.h"
static Eina_Strbuf *
-_type_generate(const Eolian_Unit *src, const Eolian_Typedecl *tp,
+_type_generate(const Eolian_State *state, const Eolian_Typedecl *tp,
Eina_Bool full, Eina_Bool legacy)
{
- char *grp = strdup(eolian_typedecl_full_name_get(tp));
+ char *grp = strdup(eolian_typedecl_name_get(tp));
char *p = strrchr(grp, '.');
if (p) *p = '\0';
- Eina_Strbuf *buf = eo_gen_docs_full_gen(src, eolian_typedecl_documentation_get(tp),
+ Eina_Strbuf *buf = eo_gen_docs_full_gen(state, eolian_typedecl_documentation_get(tp),
grp, 0, legacy);
free(grp);
if (!buf) buf = eina_strbuf_new();
@@ -19,7 +19,7 @@ _type_generate(const Eolian_Unit *src, const Eolian_Typedecl *tp,
{
case EOLIAN_TYPEDECL_ALIAS:
{
- Eina_Stringshare *tn = eolian_typedecl_c_type_get(src, tp);
+ Eina_Stringshare *tn = eolian_typedecl_c_type_get(tp);
eina_strbuf_append(buf, tn);
eina_stringshare_del(tn);
break;
@@ -28,7 +28,7 @@ _type_generate(const Eolian_Unit *src, const Eolian_Typedecl *tp,
case EOLIAN_TYPEDECL_STRUCT_OPAQUE:
{
const Eolian_Struct_Type_Field *memb;
- char *fn = eo_gen_c_full_name_get(eolian_typedecl_full_name_get(tp));
+ char *fn = eo_gen_c_full_name_get(eolian_typedecl_name_get(tp));
if (tpt == EOLIAN_TYPEDECL_STRUCT_OPAQUE || !full)
{
eina_strbuf_append_printf(buf, "typedef struct _%s %s", fn, fn);
@@ -41,7 +41,7 @@ _type_generate(const Eolian_Unit *src, const Eolian_Typedecl *tp,
{
const Eolian_Type *mtp = eolian_typedecl_struct_field_type_get(memb);
Eina_Stringshare *ct = NULL;
- ct = eolian_type_c_type_get(src, mtp, EOLIAN_C_TYPE_DEFAULT);
+ ct = eolian_type_c_type_get(mtp, EOLIAN_C_TYPE_DEFAULT);
eina_strbuf_append_printf(buf, " %s%s%s;",
ct, strchr(ct, '*') ? "" : " ",
eolian_typedecl_struct_field_name_get(memb));
@@ -53,7 +53,7 @@ _type_generate(const Eolian_Unit *src, const Eolian_Typedecl *tp,
const char *nl = strrchr(eina_strbuf_string_get(buf), '\n');
if (nl)
{
- Eina_Strbuf *fbuf = eo_gen_docs_full_gen(src, fdoc, NULL,
+ Eina_Strbuf *fbuf = eo_gen_docs_full_gen(state, fdoc, NULL,
strlen(nl), legacy);
if (fbuf)
eina_strbuf_append_printf(buf, " %s",
@@ -87,7 +87,7 @@ _type_generate(const Eolian_Unit *src, const Eolian_Typedecl *tp,
else
{
Eolian_Value val =
- eolian_expression_eval(src, vale, EOLIAN_MASK_INT);
+ eolian_expression_eval(vale, EOLIAN_MASK_INT);
const char *lit = eolian_expression_value_to_literal(&val);
eina_strbuf_append_printf(buf, " %s = %s", membn, lit);
const char *exp = eolian_expression_serialize(vale);
@@ -107,7 +107,7 @@ _type_generate(const Eolian_Unit *src, const Eolian_Typedecl *tp,
const char *nl = strrchr(eina_strbuf_string_get(buf), '\n');
if (nl)
{
- Eina_Strbuf *fbuf = eo_gen_docs_full_gen(src, fdoc, NULL,
+ Eina_Strbuf *fbuf = eo_gen_docs_full_gen(state, fdoc, NULL,
strlen(nl), legacy);
if (fbuf)
eina_strbuf_append_printf(buf, " %s",
@@ -118,7 +118,7 @@ _type_generate(const Eolian_Unit *src, const Eolian_Typedecl *tp,
eina_strbuf_append(buf, "\n");
}
eina_iterator_free(membs);
- char *fn = eo_gen_c_full_name_get(eolian_typedecl_full_name_get(tp));
+ char *fn = eo_gen_c_full_name_get(eolian_typedecl_name_get(tp));
eina_strbuf_append_printf(buf, "} %s", fn);
free(fn);
break;
@@ -135,19 +135,19 @@ _type_generate(const Eolian_Unit *src, const Eolian_Typedecl *tp,
eina_strbuf_append(buf, "void ");
else
{
- Eina_Stringshare *ct = eolian_type_c_type_get(src, rtp, EOLIAN_C_TYPE_RETURN);
+ Eina_Stringshare *ct = eolian_type_c_type_get(rtp, EOLIAN_C_TYPE_RETURN);
eina_strbuf_append_printf(buf, "%s ", ct);
}
/* Function name */
- char *fn = eo_gen_c_full_name_get(eolian_typedecl_full_name_get(tp));
+ char *fn = eo_gen_c_full_name_get(eolian_typedecl_name_get(tp));
eina_strbuf_append_printf(buf, "(*%s)", fn);
free(fn);
/* Parameters */
eina_strbuf_append(buf, "(void *data");
int nidx = 1;
- eo_gen_params(src, eolian_function_parameters_get(fid), buf, NULL, &nidx, EOLIAN_FUNCTION_POINTER);
+ eo_gen_params(eolian_function_parameters_get(fid), buf, NULL, &nidx, EOLIAN_FUNCTION_POINTER);
eina_strbuf_append(buf, ")");
break;
@@ -160,12 +160,12 @@ _type_generate(const Eolian_Unit *src, const Eolian_Typedecl *tp,
}
static Eina_Strbuf *
-_var_generate(const Eolian_Unit *src, const Eolian_Variable *vr, Eina_Bool legacy)
+_var_generate(const Eolian_State *state, const Eolian_Variable *vr, Eina_Bool legacy)
{
- char *fn = strdup(eolian_variable_full_name_get(vr));
+ char *fn = strdup(eolian_variable_name_get(vr));
char *p = strrchr(fn, '.');
if (p) *p = '\0';
- Eina_Strbuf *buf = eo_gen_docs_full_gen(src, eolian_variable_documentation_get(vr),
+ Eina_Strbuf *buf = eo_gen_docs_full_gen(state, eolian_variable_documentation_get(vr),
fn, 0, legacy);
if (p)
{
@@ -183,7 +183,7 @@ _var_generate(const Eolian_Unit *src, const Eolian_Variable *vr, Eina_Bool legac
eina_strbuf_prepend_printf(buf, "#ifndef %s\n", fn);
eina_strbuf_append_printf(buf, "#define %s ", fn);
const Eolian_Expression *vv = eolian_variable_value_get(vr);
- Eolian_Value val = eolian_expression_eval_type(src, vv, vt);
+ Eolian_Value val = eolian_expression_eval_type(vv, vt);
Eina_Stringshare *lit = eolian_expression_value_to_literal(&val);
eina_strbuf_append(buf, lit);
Eina_Stringshare *exp = eolian_expression_serialize(vv);
@@ -195,7 +195,7 @@ _var_generate(const Eolian_Unit *src, const Eolian_Variable *vr, Eina_Bool legac
}
else
{
- Eina_Stringshare *ct = eolian_type_c_type_get(src, vt, EOLIAN_C_TYPE_DEFAULT);
+ Eina_Stringshare *ct = eolian_type_c_type_get(vt, EOLIAN_C_TYPE_DEFAULT);
eina_strbuf_append_printf(buf, "EWAPI extern %s %s;", ct, fn);
eina_stringshare_del(ct);
}
@@ -203,22 +203,22 @@ _var_generate(const Eolian_Unit *src, const Eolian_Variable *vr, Eina_Bool legac
return buf;
}
-void eo_gen_types_header_gen(const Eolian_Unit *src,
+void eo_gen_types_header_gen(const Eolian_State *state,
Eina_Iterator *itr, Eina_Strbuf *buf,
Eina_Bool full, Eina_Bool legacy)
{
- const Eolian_Declaration *decl;
+ const Eolian_Object *decl;
EINA_ITERATOR_FOREACH(itr, decl)
{
- Eolian_Declaration_Type dt = eolian_declaration_type_get(decl);
+ Eolian_Object_Type dt = eolian_object_type_get(decl);
- if (dt == EOLIAN_DECL_VAR)
+ if (dt == EOLIAN_OBJECT_VARIABLE)
{
- const Eolian_Variable *vr = eolian_declaration_variable_get(decl);
+ const Eolian_Variable *vr = (const Eolian_Variable *)decl;
if (!vr || eolian_variable_is_extern(vr))
continue;
- Eina_Strbuf *vbuf = _var_generate(src, vr, legacy);
+ Eina_Strbuf *vbuf = _var_generate(state, vr, legacy);
if (vbuf)
{
eina_strbuf_append(buf, eina_strbuf_string_get(vbuf));
@@ -228,25 +228,27 @@ void eo_gen_types_header_gen(const Eolian_Unit *src,
continue;
}
- if ((dt != EOLIAN_DECL_ALIAS) &&
- (dt != EOLIAN_DECL_STRUCT) &&
- (dt != EOLIAN_DECL_ENUM))
+ if (dt != EOLIAN_OBJECT_TYPEDECL)
continue;
- if (dt == EOLIAN_DECL_ENUM && !full)
+
+ const Eolian_Typedecl *tp = (const Eolian_Typedecl *)decl;
+
+ if (eolian_typedecl_is_extern(tp))
continue;
- const Eolian_Typedecl *tp = eolian_declaration_data_type_get(decl);
- if (!tp || eolian_typedecl_is_extern(tp))
+ Eolian_Typedecl_Type tpt = eolian_typedecl_type_get(tp);
+
+ if (tpt == EOLIAN_TYPEDECL_ENUM && !full)
continue;
- if (eolian_typedecl_type_get(tp) == EOLIAN_TYPEDECL_ALIAS)
+ if (tpt == EOLIAN_TYPEDECL_ALIAS)
{
const Eolian_Type *btp = eolian_typedecl_base_type_get(tp);
if (eolian_type_type_get(btp) == EOLIAN_TYPE_UNDEFINED)
continue;
}
- Eina_Strbuf *tbuf = _type_generate(src, tp, full, legacy);
+ Eina_Strbuf *tbuf = _type_generate(state, tp, full, legacy);
if (tbuf)
{
eina_strbuf_append(buf, eina_strbuf_string_get(tbuf));
@@ -257,19 +259,18 @@ void eo_gen_types_header_gen(const Eolian_Unit *src,
eina_iterator_free(itr);
}
-void eo_gen_types_source_gen(const Eolian_Unit *src,
- Eina_Iterator *itr, Eina_Strbuf *buf)
+void eo_gen_types_source_gen(Eina_Iterator *itr, Eina_Strbuf *buf)
{
- const Eolian_Declaration *decl;
+ const Eolian_Object *decl;
EINA_ITERATOR_FOREACH(itr, decl)
{
- Eolian_Declaration_Type dt = eolian_declaration_type_get(decl);
+ Eolian_Object_Type dt = eolian_object_type_get(decl);
- if (dt != EOLIAN_DECL_VAR)
+ if (dt != EOLIAN_OBJECT_VARIABLE)
continue;
- const Eolian_Variable *vr = eolian_declaration_variable_get(decl);
- if (!vr || eolian_variable_is_extern(vr))
+ const Eolian_Variable *vr = (const Eolian_Variable *)decl;
+ if (eolian_variable_is_extern(vr))
continue;
if (eolian_variable_type_get(vr) == EOLIAN_VAR_CONSTANT)
@@ -279,18 +280,18 @@ void eo_gen_types_source_gen(const Eolian_Unit *src,
if (!vv)
continue;
- char *fn = strdup(eolian_variable_full_name_get(vr));
+ char *fn = strdup(eolian_variable_name_get(vr));
for (char *p = strchr(fn, '.'); p; p = strchr(p, '.'))
*p = '_';
eina_str_toupper(&fn);
const Eolian_Type *vt = eolian_variable_base_type_get(vr);
- Eina_Stringshare *ct = eolian_type_c_type_get(src, vt, EOLIAN_C_TYPE_DEFAULT);
+ Eina_Stringshare *ct = eolian_type_c_type_get(vt, EOLIAN_C_TYPE_DEFAULT);
eina_strbuf_append_printf(buf, "EWAPI %s %s = ", ct, fn);
eina_stringshare_del(ct);
free(fn);
- Eolian_Value val = eolian_expression_eval_type(src, vv, vt);
+ Eolian_Value val = eolian_expression_eval_type(vv, vt);
Eina_Stringshare *lit = eolian_expression_value_to_literal(&val);
eina_strbuf_append(buf, lit);
eina_strbuf_append_char(buf, ';');
@@ -305,12 +306,12 @@ void eo_gen_types_source_gen(const Eolian_Unit *src,
eina_iterator_free(itr);
}
-Eina_Strbuf *eo_gen_class_typedef_gen(const Eolian_Unit *src, const char *eof)
+Eina_Strbuf *eo_gen_class_typedef_gen(const Eolian_State *eos, const char *eof)
{
- const Eolian_Class *cl = eolian_class_get_by_file(src, eof);
+ const Eolian_Class *cl = eolian_state_class_by_file_get(eos, eof);
if (!cl)
return NULL;
- char *clfn = eo_gen_c_full_name_get(eolian_class_full_name_get(cl));
+ char *clfn = eo_gen_c_full_name_get(eolian_class_name_get(cl));
if (!clfn)
return NULL;
Eina_Strbuf *ret = eina_strbuf_new();
diff --git a/src/bin/eolian/types.h b/src/bin/eolian/types.h
index 7ad56673b9..2659b59085 100644
--- a/src/bin/eolian/types.h
+++ b/src/bin/eolian/types.h
@@ -1,8 +1,8 @@
#ifndef EOLIAN_GEN_TYPES_H
#define EOLIAN_GEN_TYPES_H
-void eo_gen_types_header_gen(const Eolian_Unit *src, Eina_Iterator *itr, Eina_Strbuf *buf, Eina_Bool full, Eina_Bool legacy);
-void eo_gen_types_source_gen(const Eolian_Unit *src, Eina_Iterator *itr, Eina_Strbuf *buf);
-Eina_Strbuf *eo_gen_class_typedef_gen(const Eolian_Unit *src, const char *eof);
+void eo_gen_types_header_gen(const Eolian_State *state, Eina_Iterator *itr, Eina_Strbuf *buf, Eina_Bool full, Eina_Bool legacy);
+void eo_gen_types_source_gen(Eina_Iterator *itr, Eina_Strbuf *buf);
+Eina_Strbuf *eo_gen_class_typedef_gen(const Eolian_State *eos, const char *eof);
#endif
diff --git a/src/bin/eolian_cxx/eolian_cxx.cc b/src/bin/eolian_cxx/eolian_cxx.cc
index 67b73b2cc5..70527ddc27 100644
--- a/src/bin/eolian_cxx/eolian_cxx.cc
+++ b/src/bin/eolian_cxx/eolian_cxx.cc
@@ -34,7 +34,7 @@ struct options_type
{
std::vector<std::string> include_dirs;
std::vector<std::string> in_files;
- mutable Eolian* state;
+ mutable Eolian_State* state;
mutable Eolian_Unit const* unit;
std::string out_file;
bool main_header;
@@ -42,7 +42,7 @@ struct options_type
options_type() : main_header(false) {}
~options_type()
{
- eolian_free(state);
+ eolian_state_free(state);
}
};
@@ -68,7 +68,7 @@ generate(const Eolian_Class* klass, eolian_cxx::options_type const& opts,
std::string const& cpp_types_header)
{
std::string header_decl_file_name = opts.out_file.empty()
- ? (::eolian_class_file_get(klass) + std::string(".hh")) : opts.out_file;
+ ? (::eolian_object_file_get((const Eolian_Object *)klass) + std::string(".hh")) : opts.out_file;
std::string header_impl_file_name = header_decl_file_name;
std::size_t dot_pos = header_impl_file_name.rfind(".hh");
@@ -83,7 +83,7 @@ generate(const Eolian_Class* klass, eolian_cxx::options_type const& opts,
std::set<std::string> c_headers;
std::set<std::string> cpp_headers;
- c_headers.insert(eolian_class_file_get(klass) + std::string(".h"));
+ c_headers.insert(eolian_object_file_get((const Eolian_Object *)klass) + std::string(".h"));
std::function<void(efl::eolian::grammar::attributes::type_def const&)>
variant_function;
@@ -92,8 +92,8 @@ generate(const Eolian_Class* klass, eolian_cxx::options_type const& opts,
{
Eolian_Class const* klass2 = get_klass(name, opts.unit);
assert(klass2);
- c_headers.insert(eolian_class_file_get(klass2) + std::string(".h"));
- cpp_headers.insert(eolian_class_file_get(klass2) + std::string(".hh"));
+ c_headers.insert(eolian_object_file_get((const Eolian_Object *)klass2) + std::string(".h"));
+ cpp_headers.insert(eolian_object_file_get((const Eolian_Object *)klass2) + std::string(".hh"));
efl::eolian::grammar::attributes::klass_def cls{klass2, opts.unit};
forward_klasses.insert(cls);
};
@@ -124,8 +124,8 @@ generate(const Eolian_Class* klass, eolian_cxx::options_type const& opts,
, inherit_last; inherit_iterator != inherit_last; ++inherit_iterator)
{
Eolian_Class const* inherit = &*inherit_iterator;
- c_headers.insert(eolian_class_file_get(inherit) + std::string(".h"));
- cpp_headers.insert(eolian_class_file_get(inherit) + std::string(".hh"));
+ c_headers.insert(eolian_object_file_get((const Eolian_Object *)inherit) + std::string(".h"));
+ cpp_headers.insert(eolian_object_file_get((const Eolian_Object *)inherit) + std::string(".hh"));
efl::eolian::grammar::attributes::klass_def klass3{inherit, opts.unit};
forward_klasses.insert(klass3);
@@ -157,7 +157,7 @@ generate(const Eolian_Class* klass, eolian_cxx::options_type const& opts,
forward_klasses.insert(part_klass);
}
- cpp_headers.erase(eolian_class_file_get(klass) + std::string(".hh"));
+ cpp_headers.erase(eolian_object_file_get((const Eolian_Object *)klass) + std::string(".hh"));
std::string guard_name;
as_generator(*(efl::eolian::grammar::string << "_") << efl::eolian::grammar::string << "_EO_HH")
@@ -226,18 +226,19 @@ types_generate(std::string const& fname, options_type const& opts,
using namespace efl::eolian::grammar::attributes;
std::vector<function_def> functions;
- Eina_Iterator *itr = eolian_declarations_get_by_file(opts.state, fname.c_str());
- /* const */ Eolian_Declaration *decl;
+ Eina_Iterator *itr = eolian_state_objects_by_file_get(opts.state, fname.c_str());
+ /* const */ Eolian_Object *decl;
// Build list of functions with their parameters
while(::eina_iterator_next(itr, reinterpret_cast<void**>(&decl)))
{
- Eolian_Declaration_Type dt = eolian_declaration_type_get(decl);
- if (dt != EOLIAN_DECL_ALIAS)
+ Eolian_Object_Type dt = eolian_object_type_get(decl);
+ if (dt != EOLIAN_OBJECT_TYPEDECL)
continue;
- const Eolian_Typedecl *tp = eolian_declaration_data_type_get(decl);
- if (!tp || eolian_typedecl_is_extern(tp))
+ const Eolian_Typedecl *tp = (const Eolian_Typedecl *)decl;
+
+ if (eolian_typedecl_is_extern(tp))
continue;
if (::eolian_typedecl_type_get(tp) != EOLIAN_TYPEDECL_FUNCTION_POINTER)
@@ -246,8 +247,8 @@ types_generate(std::string const& fname, options_type const& opts,
const Eolian_Function *func = eolian_typedecl_function_pointer_get(tp);
if (!func) return false;
- function_def def(func, EOLIAN_FUNCTION_POINTER, opts.unit);
- def.c_name = eolian_typedecl_full_name_get(tp);
+ function_def def(func, EOLIAN_FUNCTION_POINTER, tp, opts.unit);
+ def.c_name = eolian_typedecl_name_get(tp);
std::replace(def.c_name.begin(), def.c_name.end(), '.', '_');
functions.push_back(std::move(def));
}
@@ -279,7 +280,7 @@ run(options_type const& opts)
char* base = basename(dup);
std::string cpp_types_header;
opts.unit = (Eolian_Unit*)opts.state;
- klass = ::eolian_class_get_by_file(opts.unit, base);
+ klass = ::eolian_state_class_by_file_get(opts.state, base);
free(dup);
if (klass)
{
@@ -287,7 +288,7 @@ run(options_type const& opts)
!generate(klass, opts, cpp_types_header))
{
EINA_CXX_DOM_LOG_ERR(eolian_cxx::domain)
- << "Error generating: " << ::eolian_class_name_get(klass)
+ << "Error generating: " << ::eolian_class_short_name_get(klass)
<< std::endl;
assert(false && "error generating class");
}
@@ -304,7 +305,7 @@ run(options_type const& opts)
for(auto&& name : opts.in_files)
{
- Eolian_Unit const* unit = ::eolian_file_parse(opts.state, name.c_str());
+ Eolian_Unit const* unit = ::eolian_state_file_parse(opts.state, name.c_str());
if(!unit)
{
EINA_CXX_DOM_LOG_ERR(eolian_cxx::domain)
@@ -317,11 +318,11 @@ run(options_type const& opts)
}
char* dup = strdup(name.c_str());
char* base = basename(dup);
- Eolian_Class const* klass = ::eolian_class_get_by_file(unit, base);
+ Eolian_Class const* klass = ::eolian_state_class_by_file_get(opts.state, base);
free(dup);
if (klass)
{
- std::string filename = eolian_class_file_get(klass);
+ std::string filename = eolian_object_file_get((const Eolian_Object *)klass);
headers.insert(filename + std::string(".hh"));
eo_files.insert(filename);
}
@@ -354,7 +355,7 @@ run(options_type const& opts)
static void
state_init(options_type const& opts)
{
- Eolian *eos = ::eolian_new();
+ Eolian_State *eos = ::eolian_state_new();
if (!eos)
{
EINA_CXX_DOM_LOG_ERR(eolian_cxx::domain)
@@ -369,13 +370,13 @@ database_load(options_type const& opts)
{
for (auto src : opts.include_dirs)
{
- if (!::eolian_directory_scan(opts.state, src.c_str()))
+ if (!::eolian_state_directory_add(opts.state, src.c_str()))
{
EINA_CXX_DOM_LOG_WARN(eolian_cxx::domain)
<< "Couldn't load eolian from '" << src << "'.";
}
}
- if (!::eolian_all_eot_files_parse(opts.state))
+ if (!::eolian_state_all_eot_files_parse(opts.state))
{
EINA_CXX_DOM_LOG_ERR(eolian_cxx::domain)
<< "Eolian failed parsing eot files";
@@ -387,7 +388,7 @@ database_load(options_type const& opts)
<< "No input file.";
assert(false && "Error parsing input file");
}
- if (!opts.main_header && !::eolian_file_parse(opts.state, opts.in_files[0].c_str()))
+ if (!opts.main_header && !::eolian_state_file_parse(opts.state, opts.in_files[0].c_str()))
{
EINA_CXX_DOM_LOG_ERR(eolian_cxx::domain)
<< "Failed parsing: " << opts.in_files[0] << ".";
diff --git a/src/bin/eolian_js/eolian/class.hh b/src/bin/eolian_js/eolian/class.hh
index c9f027d532..30afc60d81 100644
--- a/src/bin/eolian_js/eolian/class.hh
+++ b/src/bin/eolian_js/eolian/class.hh
@@ -10,12 +10,12 @@
inline std::string name(Eolian_Class const* klass)
{
- return ::eolian_class_name_get(klass);
+ return ::eolian_class_short_name_get(klass);
}
inline std::string full_name(Eolian_Class const* klass)
{
- return ::eolian_class_full_name_get(klass);
+ return ::eolian_class_name_get(klass);
}
inline std::string full_name_transformed(Eolian_Class const* klass)
@@ -44,10 +44,10 @@ inline std::string type_class_name(Eolian_Type const* tp)
tpt = ::eolian_type_type_get(tp);
if (tpt == EOLIAN_TYPE_CLASS)
{
- Eolian_Class const* klass = ::eolian_type_class_get(NULL, tp);
+ Eolian_Class const* klass = ::eolian_type_class_get(tp);
if (klass)
{
- Eina_Stringshare* klass_name = ::eolian_class_full_name_get(klass);
+ Eina_Stringshare* klass_name = ::eolian_class_name_get(klass);
if (!klass_name)
throw std::runtime_error("Could not get Eo class name");
@@ -59,7 +59,7 @@ inline std::string type_class_name(Eolian_Type const* tp)
auto tpd = eolian_type_typedecl_get(tp);
if (tpd && eolian_typedecl_type_get(tpd) == EOLIAN_TYPEDECL_STRUCT)
{
- auto struct_type_full_name = ::eolian_type_full_name_get(tp);
+ auto struct_type_full_name = ::eolian_type_name_get(tp);
if (!struct_type_full_name)
throw std::runtime_error("Could not get struct name");
return struct_type_full_name;
diff --git a/src/bin/eolian_js/main.cc b/src/bin/eolian_js/main.cc
index 796aa8693f..9e303c81bc 100644
--- a/src/bin/eolian_js/main.cc
+++ b/src/bin/eolian_js/main.cc
@@ -73,8 +73,8 @@ _final_type_and_type_type_get(Eolian_Type const* tp_in, Eolian_Type const*& tp_o
!eolian_typedecl_is_extern(tpd))
{
auto btp = eolian_typedecl_aliased_base_get(tpd);
- if (btp && eolian_type_full_name_get(btp) &&
- strcmp(eolian_type_full_name_get(btp), "__undefined_type") != 0)
+ if (btp && eolian_type_name_get(btp) &&
+ strcmp(eolian_type_name_get(btp), "__undefined_type") != 0)
{
_final_type_and_type_type_get(btp, tp_out, tpt_out);
}
@@ -195,12 +195,11 @@ _eolian_type_cpp_type_named_get(const Eolian_Type *tp, std::string const& caller
{"list", "Eina_List"},
{"string", "const char*"},
{"void_ptr", "void *"},
- {"stringshare", "Eina_Stringshare*"},
- {"future", "Efl_Future*"}
+ {"stringshare", "Eina_Stringshare*"}
};
- std::string type_name = eolian_type_name_get(tp);
+ std::string type_name = eolian_type_short_name_get(tp);
auto it = type_map.find(type_name);
if (it != end(type_map))
type_name = it->second;
@@ -325,7 +324,7 @@ bool
_function_belongs_to(const Eolian_Function *function, std::string klass)
{
const Eolian_Class *cl = eolian_function_class_get(function);
- const std::string name = cl ? eolian_class_full_name_get(cl) : "";
+ const std::string name = cl ? eolian_class_name_get(cl) : "";
return name.find(klass) == 0;
}
@@ -489,18 +488,18 @@ int main(int argc, char** argv)
// Add include paths to eolian library
for(auto src : include_paths)
- if (!::eolian_directory_scan(src.c_str()))
+ if (!::eolian_state_directory_add(src.c_str()))
{
EINA_CXX_DOM_LOG_WARN(eolian::js::domain)
<< "Couldn't load eolian from '" << src << "'.";
}
- if (!::eolian_all_eot_files_parse())
+ if (!::eolian_state_all_eot_files_parse())
{
EINA_CXX_DOM_LOG_WARN(eolian::js::domain)
<< "Eolian failed parsing eot files";
assert(false && "Error parsing eot files");
}
- if (!::eolian_file_parse(in_file.c_str()))
+ if (!::eolian_state_file_parse(in_file.c_str()))
{
EINA_CXX_DOM_LOG_WARN(eolian::js::domain)
<< "Failed parsing: " << in_file << ".";
@@ -690,8 +689,8 @@ int main(int argc, char** argv)
if (!tpd || ::eolian_typedecl_type_get(tpd) == EOLIAN_TYPEDECL_STRUCT_OPAQUE)
continue;
- auto struct_name = ::eolian_typedecl_name_get(tpd);
- auto struct_type_full_name = ::eolian_typedecl_full_name_get(tpd);
+ auto struct_name = ::eolian_typedecl_short_name_get(tpd);
+ auto struct_type_full_name = ::eolian_typedecl_name_get(tpd);
if (!struct_name || !struct_type_full_name)
{
EINA_CXX_DOM_LOG_ERR(eolian::js::domain) << "Could not get struct type name";
@@ -1015,7 +1014,7 @@ int main(int argc, char** argv)
else
{
EINA_CXX_DOM_LOG_ERR(eolian::js::domain) << "Duplicate member function found in class: " <<
- eolian_class_full_name_get(klass) << ": '" << member_name << "'";
+ eolian_class_name_get(klass) << ": '" << member_name << "'";
}
}
catch(eolian::js::incomplete_complex_type_error const& e)
@@ -1157,7 +1156,7 @@ int main(int argc, char** argv)
auto tpd = &*first;
if (::eolian_typedecl_is_extern(tpd))
continue;
- std::string enum_name = ::eolian_typedecl_name_get(tpd);
+ std::string enum_name = ::eolian_typedecl_short_name_get(tpd);
os << " {\n";
os << " auto to_export = ::efl::eo::js::get_namespace({";
bool comma = false;
diff --git a/src/bin/eolian_mono/eolian/mono/alias_definition.hh b/src/bin/eolian_mono/eolian/mono/alias_definition.hh
new file mode 100644
index 0000000000..91659fb7bd
--- /dev/null
+++ b/src/bin/eolian_mono/eolian/mono/alias_definition.hh
@@ -0,0 +1,77 @@
+#ifndef EOLIAN_MONO_ALIAS_DEFINITION_HH
+#define EOLIAN_MONO_ALIAS_DEFINITION_HH
+
+#include "grammar/generator.hpp"
+#include "grammar/klass_def.hpp"
+#include "grammar/indentation.hpp"
+
+#include "using_decl.hh"
+#include "name_helpers.hh"
+#include "blacklist.hh"
+#include "documentation.hh"
+#include "generation_contexts.hh"
+
+namespace eolian_mono {
+
+struct alias_definition_generator
+{
+ template<typename OutputIterator, typename Context>
+ bool generate(OutputIterator sink, attributes::alias_def const& alias, Context const& context) const
+ {
+ if (blacklist::is_alias_blacklisted(alias))
+ {
+ EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "Alias " << name_helpers::alias_full_eolian_name(alias) << "is blacklisted. Skipping.";
+ return true;
+ }
+
+ if (alias.is_undefined)
+ {
+ EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "Alias " << name_helpers::alias_full_eolian_name(alias) << "is undefined. Skipping.";
+ return true;
+ }
+
+ if (!name_helpers::open_namespaces(sink, alias.namespaces, context))
+ return false;
+
+ std::string const& alias_name = alias.eolian_name;
+ if (!as_generator(
+ "public struct " << alias_name << " {\n"
+ << scope_tab << "private " << type << " payload;\n"
+ << scope_tab << "public static implicit operator " << alias_name << "(" << type << " x)\n"
+ << scope_tab << "{\n"
+ << scope_tab << scope_tab << "return new " << alias_name << "{payload=x};\n"
+ << scope_tab << "}\n"
+ << scope_tab << "public static implicit operator " << type << "(" << alias_name << " x)\n"
+ << scope_tab << "{\n"
+ << scope_tab << scope_tab << "return x.payload;\n"
+ << scope_tab << "}\n"
+ << "}\n"
+ ).generate(sink, std::make_tuple(alias.base_type, alias.base_type, alias.base_type), context))
+ return false;
+
+ if (!name_helpers::close_namespaces(sink, alias.namespaces, context))
+ return false;
+
+ return true;
+ }
+} const alias_definition {};
+
+}
+
+namespace efl { namespace eolian { namespace grammar {
+
+template<>
+struct is_eager_generator< ::eolian_mono::alias_definition_generator> : std::true_type {};
+template<>
+struct is_generator< ::eolian_mono::alias_definition_generator> : std::true_type {};
+
+namespace type_traits {
+
+template<>
+struct attributes_needed< ::eolian_mono::alias_definition_generator> : std::integral_constant<int, 1> {};
+
+}
+
+} } }
+
+#endif
diff --git a/src/bin/eolian_mono/eolian/mono/async_function_definition.hh b/src/bin/eolian_mono/eolian/mono/async_function_definition.hh
new file mode 100644
index 0000000000..3030c74e1e
--- /dev/null
+++ b/src/bin/eolian_mono/eolian/mono/async_function_definition.hh
@@ -0,0 +1,145 @@
+#ifndef EOLIAN_MONO_ASYNC_FUNCTION_DEFINITION_HH
+#define EOLIAN_MONO_ASYNC_FUNCTION_DEFINITION_HH
+
+#include <Eina.hh>
+
+#include "grammar/generator.hpp"
+#include "grammar/klass_def.hpp"
+
+#include "grammar/indentation.hpp"
+#include "grammar/list.hpp"
+#include "grammar/alternative.hpp"
+#include "grammar/attribute_reorder.hpp"
+#include "logging.hh"
+#include "type.hh"
+#include "name_helpers.hh"
+#include "helpers.hh"
+#include "function_helpers.hh"
+#include "marshall_type.hh"
+#include "parameter.hh"
+#include "documentation.hh"
+#include "using_decl.hh"
+#include "generation_contexts.hh"
+#include "blacklist.hh"
+
+namespace eolian_mono {
+
+struct is_future
+{
+ typedef is_future visitor_type;
+ typedef bool result_type;
+
+ bool operator()(grammar::attributes::complex_type_def const& c) const
+ {
+ return c.outer.base_type == "future";
+ }
+
+ template<typename T>
+ bool operator()(T const&) const
+ {
+ return false;
+ }
+};
+
+struct async_function_declaration_generator
+{
+ template<typename OutputIterator, typename Context>
+ bool generate(OutputIterator sink, attributes::function_def const& f, Context const& context) const
+ {
+ if (f.is_static)
+ return true;
+ if (blacklist::is_function_blacklisted(f.c_name))
+ return true;
+ if (!f.return_type.original_type.visit(is_future{}))
+ return true;
+
+ if (!as_generator(
+ scope_tab << "System.Threading.Tasks.Task<eina.Value> " << name_helpers::managed_async_method_name(f) << "(" << *(parameter << ",") <<
+ " System.Threading.CancellationToken token=default(System.Threading.CancellationToken));\n"
+ ).generate(sink, f.parameters, context))
+ return false;
+
+ return true;
+ }
+} const async_function_declaration {};
+
+struct async_function_definition_generator
+{
+ async_function_definition_generator(bool do_super = false)
+ : do_super(do_super)
+ {}
+
+ template <typename OutputIterator, typename Context>
+ bool generate(OutputIterator sink, attributes::function_def const& f, Context const& context) const
+ {
+ EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "async_function_definition_generator: " << f.c_name;
+
+ if(do_super && f.is_static) // Static methods goes only on Concrete classes.
+ return true;
+ if(blacklist::is_function_blacklisted(f.c_name))
+ return true;
+ if(!f.return_type.original_type.visit(is_future{}))
+ return true;
+
+ auto parameter_forwarding = [](attributes::parameter_def const& param) {
+ return direction_modifier(param) + " " + name_helpers::escape_keyword(param.param_name);
+ };
+ std::vector<std::string> param_forwarding;
+
+ std::transform(f.parameters.begin(), f.parameters.end(), std::back_inserter(param_forwarding), parameter_forwarding);
+
+ if(!as_generator(
+ scope_tab << "public System.Threading.Tasks.Task<eina.Value> " << name_helpers::managed_async_method_name(f) << "(" << *(parameter << ",") << " System.Threading.CancellationToken token)\n"
+ << scope_tab << "{\n"
+ << scope_tab << scope_tab << "eina.Future future = " << name_helpers::managed_method_name(f) << "(" << (string % ",") << ");\n"
+ << scope_tab << scope_tab << "return efl.eo.Globals.WrapAsync(future, token);\n"
+ << scope_tab << "}\n"
+ ).generate(sink, std::make_tuple(f.parameters, param_forwarding), context))
+ return false;
+ return true;
+ }
+
+ bool do_super;
+};
+
+struct async_function_definition_parameterized
+{
+ async_function_definition_generator operator()(bool do_super=false) const
+ {
+ return {do_super};
+ }
+} const async_function_definition;
+async_function_definition_generator as_generator(async_function_definition_parameterized)
+{
+ return {};
+}
+
+}
+
+namespace efl { namespace eolian { namespace grammar {
+
+template <>
+struct is_eager_generator< ::eolian_mono::async_function_declaration_generator> : std::true_type {};
+template <>
+struct is_generator< ::eolian_mono::async_function_declaration_generator> : std::true_type {};
+
+template <>
+struct is_eager_generator< ::eolian_mono::async_function_definition_generator> : std::true_type {};
+template <>
+struct is_generator< ::eolian_mono::async_function_definition_generator> : std::true_type {};
+template <>
+struct is_generator< ::eolian_mono::async_function_definition_parameterized> : std::true_type {};
+
+namespace type_traits {
+template <>
+struct attributes_needed< ::eolian_mono::async_function_declaration_generator> : std::integral_constant<int, 1> {};
+
+template <>
+struct attributes_needed< ::eolian_mono::async_function_definition_generator> : std::integral_constant<int, 1> {};
+template <>
+struct attributes_needed< ::eolian_mono::async_function_definition_parameterized> : std::integral_constant<int, 1> {};
+}
+
+} } }
+
+#endif
diff --git a/src/bin/eolian_mono/eolian/mono/function_blacklist.hh b/src/bin/eolian_mono/eolian/mono/blacklist.hh
index b2d712c6ac..a436bcc203 100644
--- a/src/bin/eolian_mono/eolian/mono/function_blacklist.hh
+++ b/src/bin/eolian_mono/eolian/mono/blacklist.hh
@@ -1,8 +1,15 @@
-#ifndef EOLIAN_MONO_FUNCTION_BLACKLIST_HH
-#define EOLIAN_MONO_FUNCTION_BLACKLIST_HH
+#ifndef EOLIAN_MONO_BLACKLIST_HH
+#define EOLIAN_MONO_BLACKLIST_HH
+
+#include "grammar/klass_def.hpp"
+#include "name_helpers.hh"
namespace eolian_mono {
+namespace blacklist {
+
+namespace attributes = efl::eolian::grammar::attributes;
+
inline bool is_function_blacklisted(std::string const& c_name)
{
return
@@ -27,7 +34,6 @@ inline bool is_function_blacklisted(std::string const& c_name)
|| c_name == "efl_ui_focus_user_parent_get"
|| c_name == "efl_canvas_object_scale_get" // duplicated signature
|| c_name == "efl_canvas_object_scale_set" // duplicated signature
- || c_name == "efl_ui_format_cb_set"
|| c_name == "efl_access_parent_get"
|| c_name == "efl_access_name_get"
|| c_name == "efl_access_name_set"
@@ -47,6 +53,35 @@ inline bool is_function_blacklisted(std::string const& c_name)
;
}
+// Blacklist structs that require some kind of manual binding.
+inline bool is_struct_blacklisted(std::string const& full_name)
+{
+ return full_name == "Efl.Event_Description"
+ || full_name == "Eina.Binbuf"
+ || full_name == "Eina.Strbuf"
+ || full_name == "Eina.Slice"
+ || full_name == "Eina.Rw_Slice"
+ || full_name == "Eina.Promise"
+ || full_name == "Eina.Future";
+}
+
+inline bool is_struct_blacklisted(attributes::struct_def const& struct_)
+{
+ return is_struct_blacklisted(name_helpers::struct_full_eolian_name(struct_));
+}
+
+inline bool is_struct_blacklisted(attributes::regular_type_def const& struct_)
+{
+ return is_struct_blacklisted(name_helpers::type_full_eolian_name(struct_));
+}
+
+inline bool is_alias_blacklisted(attributes::alias_def const& alias)
+{
+ return name_helpers::alias_full_eolian_name(alias) == "Eina.Error";
+}
+
+}
+
}
#endif
diff --git a/src/bin/eolian_mono/eolian/mono/documentation.hh b/src/bin/eolian_mono/eolian/mono/documentation.hh
index 42fe9d24e1..f78c58a9d4 100644
--- a/src/bin/eolian_mono/eolian/mono/documentation.hh
+++ b/src/bin/eolian_mono/eolian/mono/documentation.hh
@@ -5,7 +5,7 @@
#include "grammar/klass_def.hpp"
#include "grammar/html_escaped_string.hpp"
#include "using_decl.hh"
-#include "keyword.hh"
+#include "name_helpers.hh"
#include <Eina.h>
@@ -116,7 +116,7 @@ struct documentation_generator
template<typename OutputIterator, typename Context>
bool generate_parameter(OutputIterator sink, attributes::parameter_def const& param, Context const& context) const
{
- return generate_tag_param(sink, escape_keyword(param.param_name), param.documentation.summary, context);
+ return generate_tag_param(sink, name_helpers::escape_keyword(param.param_name), param.documentation.summary, context);
}
template<typename OutputIterator, typename Context>
diff --git a/src/bin/eolian_mono/eolian/mono/enum_definition.hh b/src/bin/eolian_mono/eolian/mono/enum_definition.hh
index d8bc54c175..9261f5b2e6 100644
--- a/src/bin/eolian_mono/eolian/mono/enum_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/enum_definition.hh
@@ -7,7 +7,7 @@
#include "grammar/list.hpp"
#include "grammar/alternative.hpp"
#include "type.hh"
-#include "keyword.hh"
+#include "name_helpers.hh"
#include "using_decl.hh"
namespace eolian_mono {
@@ -17,10 +17,8 @@ struct enum_definition_generator
template <typename OutputIterator, typename Context>
bool generate(OutputIterator sink, attributes::enum_def const& enum_, Context const& context) const
{
- std::vector<std::string> cpp_namespaces = escape_namespace(attributes::cpp_namespaces(enum_.namespaces));
-
- auto open_namespace = *("namespace " << string << " { ") << "\n";
- if(!as_generator(open_namespace).generate(sink, cpp_namespaces, add_lower_case_context(context))) return false;
+ if(!name_helpers::open_namespaces(sink, enum_.namespaces, context))
+ return false;
if(!as_generator(documentation).generate(sink, enum_, context))
return false;
@@ -29,7 +27,7 @@ struct enum_definition_generator
(
"public enum " << string << "\n{\n"
)
- .generate(sink, enum_.cxx_name, context))
+ .generate(sink, name_helpers::enum_managed_name(enum_), context))
return false;
// iterate enum fiels
@@ -49,9 +47,9 @@ struct enum_definition_generator
if(!as_generator("}\n").generate(sink, attributes::unused, context)) return false;
- auto close_namespace = *(lit("} ")) << "\n";
- if(!as_generator(close_namespace).generate(sink, cpp_namespaces, context)) return false;
-
+ if(!name_helpers::close_namespaces(sink, enum_.namespaces, context))
+ return false;
+
return true;
}
};
diff --git a/src/bin/eolian_mono/eolian/mono/events.hh b/src/bin/eolian_mono/eolian/mono/events.hh
new file mode 100644
index 0000000000..2da287b8e7
--- /dev/null
+++ b/src/bin/eolian_mono/eolian/mono/events.hh
@@ -0,0 +1,308 @@
+#ifndef EOLIAN_MONO_EVENTS_HH
+#define EOLINA_MONO_EVENTS_HH
+
+#include <iterator>
+
+#include "grammar/generator.hpp"
+#include "grammar/klass_def.hpp"
+#include "type_impl.hh" // For call_match
+#include "name_helpers.hh"
+#include "using_decl.hh"
+
+namespace eolian_mono {
+
+template<typename OutputIterator, typename Context>
+struct unpack_event_args_visitor
+{
+ mutable OutputIterator sink;
+ Context const* context;
+ attributes::type_def const& type;
+
+ typedef unpack_event_args_visitor<OutputIterator, Context> visitor_type;
+ typedef bool result_type;
+ bool operator()(grammar::attributes::regular_type_def const& regular) const
+ {
+ std::string const& arg = "evt.Info";
+ std::string arg_type = name_helpers::type_full_managed_name(regular);
+
+ // Structs are usually passed by pointer to events, like having a ptr<> modifier
+ if (type.is_ptr || regular.is_struct())
+ return as_generator("(" + arg_type + ")Marshal.PtrToStructure(" + arg + ", typeof(" + arg_type + "))")
+ .generate(sink, attributes::unused, *context);
+
+ using attributes::regular_type_def;
+ struct match
+ {
+ eina::optional<std::string> name;
+ std::function<std::string()> function;
+ }
+ const match_table [] =
+ {
+ {"bool", [&arg] { return arg + " != IntPtr.Zero"; }}
+ , {"int", [&arg] { return arg + ".ToInt32()"; }}
+ , {"uint", [&arg] { return "(uint)" + arg + ".ToInt32()";}}
+ , {"string", [&arg] { return "eina.StringConversion.NativeUtf8ToManagedString(" + arg + ")"; }}
+ , {"Eina.Error", [&arg] { return "(eina.Error)Marshal.PtrToStructure(" + arg + ", typeof(eina.Error))"; }}
+ };
+
+ std::string full_type_name = name_helpers::type_full_eolian_name(regular);
+ auto filter_func = [&regular, &full_type_name] (match const& m)
+ {
+ return (!m.name || *m.name == regular.base_type || *m.name == full_type_name);
+ };
+
+ auto accept_func = [&](std::string const& conversion)
+ {
+ return as_generator(conversion).generate(sink, attributes::unused, *context);
+ };
+
+ if (eina::optional<bool> b = call_match(match_table, filter_func, accept_func))
+ return *b;
+ else
+ return as_generator("default(" + arg_type + ")").generate(sink, attributes::unused, *context);
+ }
+ bool operator()(grammar::attributes::klass_name const& cls) const
+ {
+ return as_generator("new " + name_helpers::klass_full_concrete_name(cls) + "(evt.Info)").generate(sink, attributes::unused, *context);
+ }
+ bool operator()(attributes::complex_type_def const&) const
+ {
+ return as_generator("UNSUPPORTED").generate(sink, attributes::unused, *context);
+ }
+};
+
+struct event_argument_wrapper_generator
+{
+ template<typename OutputIterator, typename Context>
+ bool generate(OutputIterator sink, attributes::event_def const& evt, Context const& context) const
+ {
+ efl::eina::optional<grammar::attributes::type_def> etype = evt.type;
+ if (!etype.is_engaged())
+ return true;
+
+ std::string evt_name = name_helpers::managed_event_name(evt.name);
+ std::string arg_type;
+ if (!as_generator(type).generate(std::back_inserter(arg_type), *etype, efl::eolian::grammar::context_null()))
+ {
+ EINA_CXX_DOM_LOG_ERR(eolian_mono::domain) << "Failed to get argument type for event " << evt.name;
+ return false;
+ }
+
+ return as_generator("///<summary>Event argument wrapper for event " << evt_name << ".</summary>\n"
+ << "public class " << name_helpers::managed_event_args_short_name(evt) << " : EventArgs {\n"
+ << scope_tab << "///<summary>Actual event payload.</summary>\n"
+ << scope_tab << "public " << arg_type << " arg { get; set; }\n"
+ << "}\n"
+ ).generate(sink, attributes::unused, context);
+ }
+} const event_argument_wrapper {};
+
+struct event_declaration_generator
+{
+ template<typename OutputIterator, typename Context>
+ bool generate(OutputIterator sink, attributes::event_def const& evt, Context const& context) const
+ {
+ std::string wrapper_args_type;
+ std::string evt_name = name_helpers::managed_event_name(evt.name);
+ std::string evt_args_name = name_helpers::managed_event_args_name(evt);
+
+ efl::eina::optional<grammar::attributes::type_def> etype = evt.type;
+ if (etype.is_engaged())
+ wrapper_args_type = "<" + evt_args_name + ">";
+
+ if (!as_generator(
+ documentation(1)
+ << scope_tab << "event EventHandler" << wrapper_args_type << " " << evt_name << ";\n"
+ ).generate(sink, evt, context))
+ return false;
+
+ return true;
+ }
+} const event_declaration {};
+
+struct event_registration_generator
+{
+ attributes::klass_def const* klass;
+ template<typename OutputIterator, typename Context>
+ bool generate(OutputIterator sink, attributes::event_def const& evt, Context const& context) const
+ {
+ std::string wrapper_event_name;
+
+ if (klass)
+ wrapper_event_name = name_helpers::translate_inherited_event_name(evt, *klass);
+ else
+ wrapper_event_name = name_helpers::managed_event_name(evt.name);
+
+ return as_generator(scope_tab << scope_tab << "evt_" << wrapper_event_name << "_delegate = "
+ << "new efl.Event_Cb(on_" << wrapper_event_name << "_NativeCallback);\n"
+ ).generate(sink, attributes::unused, context);
+ }
+};
+
+struct event_registration_parameterized
+{
+ event_registration_generator operator()(attributes::klass_def const* klass=NULL) const
+ {
+ return {klass};
+ }
+} const event_registration;
+
+struct event_definition_generator
+{
+ attributes::klass_def const& klass;
+ bool is_inherited_event;
+
+ template<typename OutputIterator, typename Context>
+ bool generate(OutputIterator sink, attributes::event_def const& evt, Context context) const
+ {
+ std::string managed_evt_name = name_helpers::managed_event_name(evt.name);
+
+ std::string wrapper_evt_name;
+ if (is_inherited_event)
+ wrapper_evt_name = name_helpers::translate_inherited_event_name(evt, klass);
+ else
+ wrapper_evt_name = managed_evt_name;
+
+ std::string klass_name;
+ if (is_inherited_event)
+ klass_name = name_helpers::klass_full_interface_name(klass);
+ else
+ klass_name = name_helpers::klass_interface_name(klass);
+
+
+ std::string upper_c_name = utils::to_uppercase(evt.c_name);
+ std::string wrapper_args_type = "EventArgs";
+ std::string wrapper_args_template = "";
+ std::string event_args = "EventArgs args = EventArgs.Empty;\n";
+ std::string visibility = is_inherit_context(context) ? "protected" : "private";
+
+ efl::eina::optional<grammar::attributes::type_def> etype = evt.type;
+
+ if (etype.is_engaged())
+ {
+ wrapper_args_type = name_helpers::managed_event_args_name(evt);
+ wrapper_args_template = "<" + wrapper_args_type + ">";
+ std::string arg_initializer = wrapper_args_type + " args = new " + wrapper_args_type + "();\n";
+
+ arg_initializer += " args.arg = ";
+
+ auto arg_initializer_sink = std::back_inserter(arg_initializer);
+
+ if (!(*etype).original_type.visit(unpack_event_args_visitor<decltype(arg_initializer_sink), Context>{arg_initializer_sink, &context, *etype}))
+ return false;
+
+ arg_initializer += ";\n";
+
+ event_args = arg_initializer;
+ }
+
+ // Wrapper event declaration
+ if(!as_generator(documentation(1)).generate(sink, evt, context))
+ return false;
+
+ if(!as_generator(
+ scope_tab << visibility << " event EventHandler" << wrapper_args_template << " " << wrapper_evt_name << ";\n"
+ << scope_tab << "///<summary>Method to raise event "<< wrapper_evt_name << ".</summary>\n"
+ << scope_tab << visibility << " void On_" << wrapper_evt_name << "(" << wrapper_args_type << " e)\n"
+ << scope_tab << "{\n"
+ << scope_tab << scope_tab << "EventHandler" << wrapper_args_template << " evt;\n"
+ << scope_tab << scope_tab << "lock (eventLock) {\n"
+ << scope_tab << scope_tab << scope_tab << "evt = " << wrapper_evt_name << ";\n"
+ << scope_tab << scope_tab << "}\n"
+ << scope_tab << scope_tab << "if (evt != null) { evt(this, e); }\n"
+ << scope_tab << "}\n"
+ << scope_tab << "private void on_" << wrapper_evt_name << "_NativeCallback(System.IntPtr data, ref efl.Event evt)\n"
+ << scope_tab << "{\n"
+ << scope_tab << scope_tab << event_args
+ << scope_tab << scope_tab << "try {\n"
+ << scope_tab << scope_tab << scope_tab << "On_" << wrapper_evt_name << "(args);\n"
+ << scope_tab << scope_tab << "} catch (Exception e) {\n"
+ << scope_tab << scope_tab << scope_tab << "eina.Log.Error(e.ToString());\n"
+ << scope_tab << scope_tab << scope_tab << "eina.Error.Set(eina.Error.EFL_ERROR);\n"
+ << scope_tab << scope_tab << "}\n"
+ << scope_tab << "}\n"
+ << scope_tab << "efl.Event_Cb evt_" << wrapper_evt_name << "_delegate;\n"
+ << scope_tab << "event EventHandler" << wrapper_args_template << " " << klass_name << "." << managed_evt_name << "{\n")
+ .generate(sink, NULL, context))
+ return false;
+
+ if (!as_generator(
+ scope_tab << scope_tab << "add {\n"
+ << scope_tab << scope_tab << scope_tab << "lock (eventLock) {\n"
+ << scope_tab << scope_tab << scope_tab << scope_tab << "string key = \"_" << upper_c_name << "\";\n"
+ << scope_tab << scope_tab << scope_tab << scope_tab << "if (add_cpp_event_handler(key, this.evt_" << wrapper_evt_name << "_delegate))\n"
+ << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << wrapper_evt_name << " += value;\n"
+ << scope_tab << scope_tab << scope_tab << scope_tab << "else\n"
+ << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "eina.Log.Error($\"Error adding proxy for event {key}\");\n"
+ << scope_tab << scope_tab << scope_tab << "}\n" // End of lock block
+ << scope_tab << scope_tab << "}\n"
+ << scope_tab << scope_tab << "remove {\n"
+ << scope_tab << scope_tab << scope_tab << "lock (eventLock) {\n"
+ << scope_tab << scope_tab << scope_tab << scope_tab << "string key = \"_" << upper_c_name << "\";\n"
+ << scope_tab << scope_tab << scope_tab << scope_tab << "if (remove_cpp_event_handler(key, this.evt_" << wrapper_evt_name << "_delegate))\n"
+ << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << wrapper_evt_name << " -= value;\n"
+ << scope_tab << scope_tab << scope_tab << scope_tab << "else\n"
+ << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "eina.Log.Error($\"Error removing proxy for event {key}\");\n"
+ << scope_tab << scope_tab << scope_tab << "}\n" // End of lock block
+ << scope_tab << scope_tab << "}\n"
+ << scope_tab << "}\n")
+ .generate(sink, NULL, context))
+ return false;
+
+ return true;
+ }
+};
+
+struct event_definition_parameterized
+{
+ event_definition_generator operator()(attributes::klass_def const& klass, bool is_inherited_event=false) const
+ {
+ return {klass, is_inherited_event};
+ }
+} const event_definition;
+
+}
+
+namespace efl { namespace eolian { namespace grammar {
+
+template <>
+struct is_eager_generator<struct ::eolian_mono::event_argument_wrapper_generator> : std::true_type {};
+template <>
+struct is_generator<struct ::eolian_mono::event_argument_wrapper_generator> : std::true_type {};
+
+template <>
+struct is_eager_generator<struct ::eolian_mono::event_declaration_generator> : std::true_type {};
+template <>
+struct is_generator<struct ::eolian_mono::event_declaration_generator> : std::true_type {};
+
+template <>
+struct is_eager_generator<struct ::eolian_mono::event_registration_generator> : std::true_type {};
+template <>
+struct is_generator<struct ::eolian_mono::event_registration_generator> : std::true_type {};
+template <>
+struct is_generator<struct ::eolian_mono::event_registration_parameterized> : std::true_type {};
+
+template <>
+struct is_eager_generator<struct ::eolian_mono::event_definition_generator> : std::true_type {};
+template <>
+struct is_generator<struct ::eolian_mono::event_definition_generator> : std::true_type {};
+template <>
+struct is_generator<struct ::eolian_mono::event_definition_parameterized> : std::true_type {};
+
+namespace type_traits {
+template <>
+struct attributes_needed<struct ::eolian_mono::event_argument_wrapper_generator> : std::integral_constant<int, 1> {};
+template <>
+struct attributes_needed<struct ::eolian_mono::event_declaration_generator> : std::integral_constant<int, 1> {};
+template <>
+struct attributes_needed<struct ::eolian_mono::event_registration_generator> : std::integral_constant<int, 1> {};
+template <>
+struct attributes_needed<struct ::eolian_mono::event_registration_parameterized> : std::integral_constant<int, 1> {};
+template <>
+struct attributes_needed<struct ::eolian_mono::event_definition_generator> : std::integral_constant<int, 1> {};
+template <>
+struct attributes_needed<struct ::eolian_mono::event_definition_parameterized> : std::integral_constant<int, 1> {};
+}
+} } }
+
+#endif
diff --git a/src/bin/eolian_mono/eolian/mono/function_declaration.hh b/src/bin/eolian_mono/eolian/mono/function_declaration.hh
index 76bbd6103b..8fdb8269e8 100644
--- a/src/bin/eolian_mono/eolian/mono/function_declaration.hh
+++ b/src/bin/eolian_mono/eolian/mono/function_declaration.hh
@@ -9,8 +9,9 @@
#include "grammar/alternative.hpp"
#include "type.hh"
#include "parameter.hh"
-#include "keyword.hh"
+#include "name_helpers.hh"
#include "using_decl.hh"
+#include "blacklist.hh"
namespace eolian_mono {
@@ -19,7 +20,7 @@ struct function_declaration_generator
template <typename OutputIterator, typename Context>
bool generate(OutputIterator sink, attributes::function_def const& f, Context const& context) const
{
- if(is_function_blacklisted(f.c_name))
+ if(blacklist::is_function_blacklisted(f.c_name) || f.is_static)
return true;
if(!as_generator(documentation).generate(sink, f, context))
@@ -27,7 +28,7 @@ struct function_declaration_generator
return as_generator
(eolian_mono::type(true) << " " << string << "(" << (parameter % ", ") << ");\n")
- .generate(sink, std::make_tuple(f.return_type, managed_method_name(f.name), f.parameters), context);
+ .generate(sink, std::make_tuple(f.return_type, name_helpers::managed_method_name(f), f.parameters), context);
}
};
diff --git a/src/bin/eolian_mono/eolian/mono/function_definition.hh b/src/bin/eolian_mono/eolian/mono/function_definition.hh
index 04e8921fad..7e44b2938b 100644
--- a/src/bin/eolian_mono/eolian/mono/function_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/function_definition.hh
@@ -10,14 +10,17 @@
#include "grammar/list.hpp"
#include "grammar/alternative.hpp"
#include "grammar/attribute_reorder.hpp"
+#include "logging.hh"
#include "type.hh"
+#include "name_helpers.hh"
+#include "helpers.hh"
#include "function_helpers.hh"
#include "marshall_type.hh"
#include "parameter.hh"
-#include "keyword.hh"
#include "documentation.hh"
#include "using_decl.hh"
#include "generation_contexts.hh"
+#include "blacklist.hh"
namespace eolian_mono {
@@ -28,7 +31,8 @@ struct native_function_definition_generator
template <typename OutputIterator, typename Context>
bool generate(OutputIterator sink, attributes::function_def const& f, Context const& context) const
{
- if(is_function_blacklisted(f.c_name))
+ EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "native_function_definition_generator: " << f.c_name << std::endl;
+ if(blacklist::is_function_blacklisted(f.c_name) || f.is_static) // Only Concrete classes implement static methods.
return true;
else
{
@@ -67,6 +71,8 @@ struct native_function_definition_generator
if(!as_generator(eolian_mono::type(true)).generate(std::back_inserter(return_type), f.return_type, context))
return false;
+ std::string klass_inherit_name = name_helpers::klass_inherit_name(*klass);
+
if(!as_generator
(scope_tab
<< " private static "
@@ -83,7 +89,7 @@ struct native_function_definition_generator
<< scope_tab << scope_tab << "if(wrapper != null) {\n"
<< scope_tab << scope_tab << scope_tab << eolian_mono::native_function_definition_preamble()
<< scope_tab << scope_tab << scope_tab << "try {\n"
- << scope_tab << scope_tab << scope_tab << scope_tab << (return_type != " void" ? "_ret_var = " : "") << "((" << string << "Inherit)wrapper)." << string
+ << scope_tab << scope_tab << scope_tab << scope_tab << (return_type != " void" ? "_ret_var = " : "") << "((" << klass_inherit_name << ")wrapper)." << string
<< "(" << (native_argument_invocation % ", ") << ");\n"
<< scope_tab << scope_tab << scope_tab << "} catch (Exception e) {\n"
<< scope_tab << scope_tab << scope_tab << scope_tab << "eina.Log.Warning($\"Callback error: {e.ToString()}\");\n"
@@ -92,18 +98,18 @@ struct native_function_definition_generator
<< eolian_mono::native_function_definition_epilogue(*klass)
<< scope_tab << scope_tab << "} else {\n"
<< scope_tab << scope_tab << scope_tab << (return_type != " void" ? "return " : "") << string
- << "(efl.eo.Globals.efl_super(obj, " << string << "Inherit.klass)" << *(", " << argument) << ");\n"
+ << "(efl.eo.Globals.efl_super(obj, " << klass_inherit_name << ".klass)" << *(", " << argument) << ");\n"
<< scope_tab << scope_tab << "}\n"
<< scope_tab << "}\n"
)
.generate(sink, std::make_tuple(f.return_type, escape_keyword(f.name), f.parameters
, /***/f.c_name/***/
, f
- , klass->cxx_name, managed_method_name(f.name)
+ , name_helpers::managed_method_name(f)
, f.parameters
, f
, f.c_name
- , klass->cxx_name, f.parameters
+ , f.parameters
)
, context))
return false;
@@ -112,10 +118,9 @@ struct native_function_definition_generator
(scope_tab << "private static "
<< string
<< "_delegate "
- << string << "_static_delegate = new " << string << "_delegate(" << string << "NativeInherit." << string << ");\n"
+ << string << "_static_delegate = new " << string << "_delegate(" << name_helpers::klass_native_inherit_name(*klass) << "." << string << ");\n"
)
- .generate(sink, std::make_tuple(f.c_name, f.c_name, f.c_name, klass->cxx_name
- , escape_keyword(f.name)), context))
+ .generate(sink, std::make_tuple(f.c_name, f.c_name, f.c_name, escape_keyword(f.name)), context))
return false;
return true;
}
@@ -131,10 +136,12 @@ struct function_definition_generator
template <typename OutputIterator, typename Context>
bool generate(OutputIterator sink, attributes::function_def const& f, Context const& context) const
{
- if(is_function_blacklisted(f.c_name))
+ EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "function_definition_generator: " << f.c_name << std::endl;
+ if(do_super && f.is_static) // Static methods goes only on Concrete classes.
return true;
- else
- {
+ if(blacklist::is_function_blacklisted(f.c_name))
+ return true;
+
if(!as_generator
("\n\n" << scope_tab << "[System.Runtime.InteropServices.DllImport(" << context_find_tag<library_context>(context).actual_library_name(f.filename) << ")]\n"
<< scope_tab << eolian_mono::marshall_annotation(true)
@@ -159,20 +166,19 @@ struct function_definition_generator
return false;
if(!as_generator
- (scope_tab << (do_super ? "virtual " : "") << "public " << return_type << " " << string << "(" << (parameter % ", ")
+ (scope_tab << (do_super ? "virtual " : "") << "public " << (f.is_static ? "static " : "") << return_type << " " << string << "(" << (parameter % ", ")
<< ") {\n "
<< eolian_mono::function_definition_preamble() << string << "("
<< (do_super ? "efl.eo.Globals.efl_super(" : "")
- << "this.raw_handle"
+ << (f.is_static ? name_helpers::klass_get_full_name(f.klass) + "()": "this.raw_handle")
<< (do_super ? ", this.raw_klass)" : "")
<< *(", " << argument_invocation ) << ");\n"
<< eolian_mono::function_definition_epilogue()
<< " }\n")
- .generate(sink, std::make_tuple(managed_method_name(f.name), f.parameters, f, f.c_name, f.parameters, f), context))
+ .generate(sink, std::make_tuple(name_helpers::managed_method_name(f), f.parameters, f, f.c_name, f.parameters, f), context))
return false;
return true;
- }
}
bool do_super;
diff --git a/src/bin/eolian_mono/eolian/mono/function_helpers.hh b/src/bin/eolian_mono/eolian/mono/function_helpers.hh
index e7af6f9dc0..acfe850032 100644
--- a/src/bin/eolian_mono/eolian/mono/function_helpers.hh
+++ b/src/bin/eolian_mono/eolian/mono/function_helpers.hh
@@ -10,13 +10,7 @@
#include "grammar/list.hpp"
#include "grammar/alternative.hpp"
#include "grammar/attribute_reorder.hpp"
-/* #include "type.hh" */
-/* #include "marshall_type.hh" */
#include "parameter.hh"
-#include "function_pointer.hh"
-/* #include "keyword.hh" */
-/* #include "using_decl.hh" */
-/* #include "generation_contexts.hh" */
namespace eolian_mono {
@@ -98,9 +92,11 @@ struct native_function_definition_epilogue_generator
if (!as_generator(
scope_tab << scope_tab << "//Assigning out variables\n"
<< *(scope_tab << scope_tab << native_convert_out_assign(*klass) << "\n")
+ << scope_tab << scope_tab << "//Placeholder in ptr variables that need to be updated\n"
+ << *(scope_tab << scope_tab << native_convert_in_ptr_assign << "\n")
<< scope_tab << scope_tab << "//Converting return variable\n"
<< scope_tab << scope_tab << native_convert_return(*klass)
- ).generate(sink, std::make_tuple(f.parameters, f.return_type), context))
+ ).generate(sink, std::make_tuple(f.parameters, f.parameters, f.return_type), context))
return false;
return true;
@@ -117,9 +113,11 @@ struct function_definition_epilogue_generator
scope_tab << scope_tab << "eina.Error.RaiseIfOccurred();\n"
<< scope_tab << scope_tab << "//Assigning out variables\n"
<< *(scope_tab << scope_tab << convert_out_assign << "\n")
+ << scope_tab << scope_tab << "//Placeholder in ptr variables that need to be updated\n"
+ << *(scope_tab << scope_tab << convert_in_ptr_assign << "\n")
<< scope_tab << scope_tab << "//Converting return variable\n"
<< scope_tab << scope_tab << convert_return
- ).generate(sink, std::make_tuple(f.parameters, f.return_type), context))
+ ).generate(sink, std::make_tuple(f.parameters, f.parameters, f.return_type), context))
return false;
return true;
@@ -160,6 +158,10 @@ struct native_function_definition_epilogue_parameterized
{
return {&klass};
}
+ native_function_definition_epilogue_generator const operator()(attributes::klass_def const* klass=nullptr) const
+ {
+ return {klass};
+ }
} const native_function_definition_epilogue;
struct function_definition_epilogue_terminal
diff --git a/src/bin/eolian_mono/eolian/mono/function_pointer.hh b/src/bin/eolian_mono/eolian/mono/function_pointer.hh
index 0890edcb51..f373a13121 100644
--- a/src/bin/eolian_mono/eolian/mono/function_pointer.hh
+++ b/src/bin/eolian_mono/eolian/mono/function_pointer.hh
@@ -6,50 +6,52 @@
#include <vector>
#include <string>
+#include "function_helpers.hh"
#include "documentation.hh"
+#include "generation_contexts.hh"
namespace eolian_mono {
// Blacklist structs that require some kind of manual binding.
-static bool is_function_ptr_blacklisted(attributes::function_def const& func, std::vector<std::string> const &namesp)
+static bool is_function_ptr_blacklisted(attributes::function_def const& func)
{
- std::stringstream full_name;
+ std::string name = name_helpers::function_ptr_full_eolian_name(func);
- for (auto&& i : namesp)
- full_name << i << ".";
- full_name << func.name;
-
- std::string name = full_name.str();
-
- return name == "Efl.Ui.Format_Func_Cb";
+ return false;
}
struct function_pointer {
template <typename OutputIterator, typename Context>
- bool generate(OutputIterator sink, attributes::function_def const& f, std::vector<std::string> const &namesp, Context const& context) const
+ bool generate(OutputIterator sink, attributes::function_def const& f, Context const& context) const
{
+ EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "function_pointer_generator: " << f.name << std::endl;
// FIXME export Typedecl in eolian_cxx API
- std::vector<std::string> namespaces = escape_namespace(namesp);
+ auto funcptr_ctx = context_add_tag(class_context{class_context::function_ptr}, context);
- if (is_function_ptr_blacklisted(f, namesp))
+ std::string return_type;
+ if(!as_generator(eolian_mono::type(true)).generate(std::back_inserter(return_type), f.return_type, context))
+ return false;
+
+ if (is_function_ptr_blacklisted(f))
return true;
- auto open_namespace = *("namespace " << string << " {") << "\n";
- if(!as_generator(open_namespace).generate(sink, namespaces, add_lower_case_context(context))) return false;
+ if (!name_helpers::open_namespaces(sink, f.namespaces, funcptr_ctx))
+ return false;
// C# visible delegate
if (!as_generator(documentation
<< "public delegate " << type << " " << string
<< "(" << (parameter % ", ") << ");\n")
- .generate(sink, std::make_tuple(f, f.return_type, escape_keyword(f.name), f.parameters), context))
+ .generate(sink, std::make_tuple(f, f.return_type, name_helpers::escape_keyword(f.name), f.parameters), funcptr_ctx))
return false;
// "Internal" delegate, 1-to-1 with the Unamaged function type
- if (!as_generator("internal delegate " << type << " " << string // public?
- << "Internal(IntPtr data, " << (parameter % ", ") << ");\n")
- .generate(sink, std::make_tuple(f.return_type, escape_keyword(f.name), f.parameters), context))
+ if (!as_generator(marshall_native_annotation(true)
+ << "internal delegate " << marshall_type(true) << " " << string // public?
+ << "Internal(IntPtr data" << *grammar::attribute_reorder<-1, -1>((", " << marshall_native_annotation << " " << marshall_parameter)) << ");\n")
+ .generate(sink, std::make_tuple(f.return_type, f.return_type, name_helpers::escape_keyword(f.name), f.parameters), funcptr_ctx))
return false;
- std::string f_name = escape_keyword(f.name);
+ std::string f_name = name_helpers::escape_keyword(f.name);
// Wrapper type, with callback matching the Unamanaged one
if (!as_generator("internal class " << f_name << "Wrapper\n"
<< "{\n\n"
@@ -72,21 +74,31 @@ struct function_pointer {
<< scope_tab << "internal " << type << " ManagedCb(" << (parameter % ",") << ")\n"
<< scope_tab << "{\n"
- << scope_tab << scope_tab << (f.return_type.c_type != "void" ? "return ": "") << "_cb(_cb_data, " << (argument_invocation_no_conversion % ", ") << ");\n"
+ << function_definition_preamble << "_cb(_cb_data, " << (argument_invocation % ", ") << ");\n"
+ << function_definition_epilogue
<< scope_tab << "}\n\n"
- << scope_tab << "internal static " << type << " Cb(IntPtr cb_data, " << (parameter % ", ") << ")\n"
+
+ << scope_tab << marshall_native_annotation(true)
+ << scope_tab << "internal static " << marshall_type(true) << " Cb(IntPtr cb_data" << *grammar::attribute_reorder<-1, -1>((", " << marshall_native_annotation << " " << marshall_parameter)) << ")\n"
<< scope_tab << "{\n"
<< scope_tab << scope_tab << "GCHandle handle = GCHandle.FromIntPtr(cb_data);\n"
<< scope_tab << scope_tab << string << " cb = (" << string << ")handle.Target;\n"
- << scope_tab << scope_tab << (f.return_type.c_type != "void" ? "return " : "") << "cb(" << (argument_invocation_no_conversion % ", ") << ");\n"
+ << native_function_definition_preamble
+ << scope_tab << scope_tab << "try {\n"
+ << scope_tab << scope_tab << scope_tab << (return_type != " void" ? "_ret_var = " : "") << "cb(" << (native_argument_invocation % ", ") << ");\n"
+ << scope_tab << scope_tab << "} catch (Exception e) {\n"
+ << scope_tab << scope_tab << scope_tab << "eina.Log.Warning($\"Callback error: {e.ToString()}\");\n"
+ << scope_tab << scope_tab << scope_tab << "eina.Error.Set(eina.Error.EFL_ERROR);\n"
+ << scope_tab << scope_tab << "}\n"
+ << native_function_definition_epilogue(nullptr)
<< scope_tab << "}\n"
<< "}\n"
- ).generate(sink, std::make_tuple(f.return_type, f.parameters, f.parameters, f.return_type, f.parameters, f_name, f_name, f.parameters), context))
+ ).generate(sink, std::make_tuple(f.return_type, f.parameters, f, f.parameters, f, f.return_type, f.return_type, f.parameters, f_name, f_name, f, f.parameters, f), funcptr_ctx))
return false;
- auto close_namespace = *(lit("} ")) << "\n";
- if(!as_generator(close_namespace).generate(sink, namespaces, context)) return false;
+ if (!name_helpers::close_namespaces(sink, f.namespaces, funcptr_ctx))
+ return false;
return true;
}
diff --git a/src/bin/eolian_mono/eolian/mono/function_registration.hh b/src/bin/eolian_mono/eolian/mono/function_registration.hh
index a88c938924..22fc42599b 100644
--- a/src/bin/eolian_mono/eolian/mono/function_registration.hh
+++ b/src/bin/eolian_mono/eolian/mono/function_registration.hh
@@ -10,12 +10,13 @@
#include "grammar/list.hpp"
#include "grammar/alternative.hpp"
#include "grammar/attribute_reorder.hpp"
+#include "logging.hh"
#include "type.hh"
#include "marshall_type.hh"
#include "parameter.hh"
-#include "keyword.hh"
#include "using_decl.hh"
#include "generation_contexts.hh"
+#include "blacklist.hh"
namespace eolian_mono {
@@ -28,7 +29,8 @@ struct function_registration_generator
template <typename OutputIterator, typename Context>
bool generate(OutputIterator sink, attributes::function_def const& f, Context const& context) const
{
- if(is_function_blacklisted(f.c_name))
+ EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "function_registration_generator: " << f.name << std::endl;
+ if(blacklist::is_function_blacklisted(f.c_name) || f.is_static) // Static methods aren't overrideable
return true;
else
{
@@ -40,9 +42,9 @@ struct function_registration_generator
#else
(scope_tab << scope_tab << "descs[" << index << "].api_func = efl.eo.Globals.dlsym(efl.eo.Globals.RTLD_DEFAULT, \"" << string << "\");\n"
#endif
- << scope_tab << scope_tab << "descs[" << index << "].func = Marshal.GetFunctionPointerForDelegate(" << string << "NativeInherit." << string << "_static_delegate);\n"
+ << scope_tab << scope_tab << "descs[" << index << "].func = Marshal.GetFunctionPointerForDelegate(" << name_helpers::klass_native_inherit_name(*klass) << "." << string << "_static_delegate);\n"
)
- .generate(sink, std::make_tuple(f.c_name, klass->cxx_name, f.c_name), context))
+ .generate(sink, std::make_tuple(f.c_name, f.c_name), context))
return false;
return true;
}
diff --git a/src/bin/eolian_mono/eolian/mono/generation_contexts.hh b/src/bin/eolian_mono/eolian/mono/generation_contexts.hh
index 8563afcb12..7f94de7736 100644
--- a/src/bin/eolian_mono/eolian/mono/generation_contexts.hh
+++ b/src/bin/eolian_mono/eolian/mono/generation_contexts.hh
@@ -11,6 +11,8 @@ struct class_context
inherit,
inherit_native,
structs,
+ function_ptr,
+ alias,
};
wrapper_kind current_wrapper_kind;
};
diff --git a/src/bin/eolian_mono/eolian/mono/helpers.hh b/src/bin/eolian_mono/eolian/mono/helpers.hh
index 7d013bd6f5..40a99915ab 100644
--- a/src/bin/eolian_mono/eolian/mono/helpers.hh
+++ b/src/bin/eolian_mono/eolian/mono/helpers.hh
@@ -2,55 +2,44 @@
#define EOLIAN_MONO_HELPERS_HH
#include "grammar/klass_def.hpp"
+#include "blacklist.hh"
+#include "name_helpers.hh"
namespace eolian_mono {
+namespace helpers {
+
+/* General helpers, not related directly with generating strings (those go in the name_helpers.hh). */
+
namespace attributes = efl::eolian::grammar::attributes;
-inline std::string type_full_name(attributes::regular_type_def const& type)
+inline bool need_struct_conversion(attributes::regular_type_def const* regular)
{
- std::string full_name;
- for (auto& name : type.namespaces)
- {
- full_name += name + ".";
- }
- full_name += type.base_type;
- return full_name;
+ return regular && regular->is_struct() && !blacklist::is_struct_blacklisted(*regular);
}
-inline std::string struct_full_name(attributes::struct_def const& struct_)
+inline bool need_struct_conversion(attributes::parameter_def const& param, attributes::regular_type_def const* regular)
{
- std::string full_name;
- for (auto& name : struct_.namespaces)
- {
- full_name += name + ".";
- }
- full_name += struct_.cxx_name;
- return full_name;
-}
+ if (param.direction == attributes::parameter_direction::in && param.type.has_own)
+ return false;
-// Blacklist structs that require some kind of manual binding.
-inline bool is_struct_blacklisted(std::string const& full_name)
-{
- return full_name == "Efl.Event.Description"
- || full_name == "Eina.Binbuf"
- || full_name == "Eina.Slice"
- || full_name == "Eina.Rw_Slice";
+ return need_struct_conversion(regular);
}
-inline bool is_struct_blacklisted(attributes::struct_def const& struct_)
+inline bool need_struct_conversion_in_return(attributes::type_def const& ret_type, attributes::parameter_direction const& direction)
{
- return is_struct_blacklisted(struct_full_name(struct_));
-}
+ auto regular = efl::eina::get<attributes::regular_type_def>(&ret_type.original_type);
-inline bool is_struct_blacklisted(attributes::regular_type_def const& struct_)
-{
- return is_struct_blacklisted(type_full_name(struct_));
-}
+ if (!regular->is_struct())
+ return false;
-inline bool need_struct_conversion(attributes::regular_type_def const* regular)
-{
- return regular && regular->is_struct() && !is_struct_blacklisted(*regular);
+ if (regular->is_struct() && (direction == attributes::parameter_direction::out || direction == attributes::parameter_direction::unknown))
+ return false;
+
+ if (ret_type.has_own)
+ return false;
+
+ return true;
}
inline bool need_pointer_conversion(attributes::regular_type_def const* regular)
@@ -59,7 +48,7 @@ inline bool need_pointer_conversion(attributes::regular_type_def const* regular)
return false;
if (regular->is_enum()
- || (regular->is_struct() && type_full_name(*regular) != "Eina.Binbuf")
+ || (regular->is_struct() && name_helpers::type_full_eolian_name(*regular) != "Eina.Binbuf")
)
return true;
@@ -76,7 +65,8 @@ inline bool need_pointer_conversion(attributes::regular_type_def const* regular)
return false;
}
+} // namespace helpers
-}
+} // namespace eolian_mono
#endif
diff --git a/src/bin/eolian_mono/eolian/mono/keyword.hh b/src/bin/eolian_mono/eolian/mono/keyword.hh
deleted file mode 100644
index fbe853af5b..0000000000
--- a/src/bin/eolian_mono/eolian/mono/keyword.hh
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef EOLIAN_CXX_KEYWORD_HH
-#define EOLIAN_CXX_KEYWORD_HH
-
-#include <string>
-#include <strings.h>
-#include <vector>
-
-#include "name_helpers.hh"
-
-namespace eolian_mono {
-namespace detail {
-inline bool is_iequal(std::string const& lhs, std::string const& rhs)
-{
- return strcasecmp(lhs.c_str(), rhs.c_str()) == 0;
-}
-}
-
-inline std::string escape_keyword(std::string const& name)
-{
- using detail::is_iequal;
- if(is_iequal(name, "delete")
- || is_iequal(name, "register")
- || is_iequal(name, "do")
- || is_iequal(name, "lock")
- || is_iequal(name, "event")
- || is_iequal(name, "in")
- || is_iequal(name, "object")
- || is_iequal(name, "interface")
- || is_iequal(name, "string")
- || is_iequal(name, "internal")
- || is_iequal(name, "fixed")
- || is_iequal(name, "base"))
- return "kw_" + name;
-
- if (is_iequal(name, "Finalize"))
- return name + "Add"; // Eo's Finalize is actually the end of efl_add.
- return name;
-}
-
-
-std::string managed_method_name(std::string const& underscore_name)
-{
- std::vector<std::string> names = name_helpers::split(underscore_name, '_');
-
- name_helpers::reorder_verb(names);
-
- return escape_keyword(name_helpers::pascal_case(names));
-}
-
-}
-
-#endif
diff --git a/src/bin/eolian_mono/eolian/mono/klass.hh b/src/bin/eolian_mono/eolian/mono/klass.hh
index 119cd73d12..ce90b4a96e 100644
--- a/src/bin/eolian_mono/eolian/mono/klass.hh
+++ b/src/bin/eolian_mono/eolian/mono/klass.hh
@@ -4,17 +4,20 @@
#include "grammar/integral.hpp"
#include "grammar/generator.hpp"
#include "grammar/klass_def.hpp"
-#include "function_blacklist.hh"
+#include "blacklist.hh"
#include "grammar/indentation.hpp"
#include "grammar/list.hpp"
#include "grammar/alternative.hpp"
#include "type.hh"
-#include "namespace.hh"
+#include "name_helpers.hh"
+#include "async_function_definition.hh"
#include "function_definition.hh"
#include "function_registration.hh"
#include "function_declaration.hh"
#include "documentation.hh"
+#include "part_definition.hh"
+#include "events.hh"
#include "grammar/string.hpp"
#include "grammar/attribute_replace.hpp"
#include "grammar/integral.hpp"
@@ -28,15 +31,15 @@
namespace eolian_mono {
template <typename OutputIterator, typename Context>
-static bool generate_static_cast_method(OutputIterator sink, const std::string &class_name, Context const &context)
+static bool generate_static_cast_method(OutputIterator sink, grammar::attributes::klass_def const& cls, Context const &context)
{
return as_generator(
scope_tab << "///<summary>Casts obj into an instance of this type.</summary>\n"
- << scope_tab << "public static " << class_name << " static_cast(efl.Object obj)\n"
+ << scope_tab << "public static " << name_helpers::klass_interface_name(cls) << " static_cast(efl.IObject obj)\n"
<< scope_tab << "{\n"
<< scope_tab << scope_tab << "if (obj == null)\n"
<< scope_tab << scope_tab << scope_tab << "throw new System.ArgumentNullException(\"obj\");\n"
- << scope_tab << scope_tab << "return new " << class_name << "Concrete(obj.raw_handle);\n"
+ << scope_tab << scope_tab << "return new " << name_helpers::klass_concrete_name(cls) << "(obj.raw_handle);\n"
<< scope_tab << "}\n"
).generate(sink, nullptr, context);
}
@@ -48,7 +51,7 @@ static bool generate_equals_method(OutputIterator sink, Context const &context)
scope_tab << "///<summary>Verifies if the given object is equals to this.</summary>\n"
<< scope_tab << "public override bool Equals(object obj)\n"
<< scope_tab << "{\n"
- << scope_tab << scope_tab << "var other = obj as efl.Object;\n"
+ << scope_tab << scope_tab << "var other = obj as efl.IObject;\n"
<< scope_tab << scope_tab << "if (other == null)\n"
<< scope_tab << scope_tab << scope_tab << "return false;\n"
<< scope_tab << scope_tab << "return this.raw_handle == other.raw_handle;\n"
@@ -58,74 +61,38 @@ static bool generate_equals_method(OutputIterator sink, Context const &context)
<< scope_tab << "{\n"
<< scope_tab << scope_tab << "return this.raw_handle.ToInt32();\n"
<< scope_tab << "}\n"
+ << scope_tab << "///<summary>How native pointer in string representation.</summary>\n"
+ << scope_tab << "public override String ToString()\n"
+ << scope_tab << "{\n"
+ << scope_tab << scope_tab << "return $\"{this.GetType().Name}@[{this.raw_handle.ToInt32():x}]\";\n"
+ << scope_tab << "}\n"
).generate(sink, nullptr, context);
}
/* Get the actual number of functions of a class, checking for blacklisted ones */
static std::size_t
-get_function_count(grammar::attributes::klass_def const& cls)
+get_inheritable_function_count(grammar::attributes::klass_def const& cls)
{
auto methods = cls.get_all_methods();
return std::count_if(methods.cbegin(), methods.cend(), [](grammar::attributes::function_def const& func)
{
- return !is_function_blacklisted(func.c_name);
+ return !blacklist::is_function_blacklisted(func.c_name) && !func.is_static;
});
}
-struct get_csharp_type_visitor
-{
- typedef get_csharp_type_visitor visitor_type;
- typedef std::string result_type;
- std::string operator()(grammar::attributes::regular_type_def const& type) const
- {
- std::stringstream csharp_name;
- for (auto&& i : escape_namespace(type.namespaces))
- csharp_name << utils::to_lowercase(i) << ".";
- csharp_name << type.base_type;
-
- return csharp_name.str();
- }
- std::string operator()(grammar::attributes::klass_name const& name) const
- {
- std::stringstream csharp_name;
- for (auto&& i : escape_namespace(name.namespaces))
- csharp_name << utils::to_lowercase(i) << ".";
- csharp_name << name.eolian_name;
-
- return csharp_name.str();
- }
- std::string operator()(attributes::complex_type_def const&) const
- {
- return "UNSUPPORTED";
- }
-};
-
-struct get_event_args_visitor
+template<typename Context>
+static bool
+is_inherit_context(Context const& context)
{
-
- std::string arg_type;
-
- typedef get_event_args_visitor visitor_type;
- typedef std::string result_type;
- std::string operator()(grammar::attributes::regular_type_def const&) const
- {
- return "(" + arg_type + ")Marshal.PtrToStructure(evt.Info, typeof(" + arg_type + "))";
- }
- std::string operator()(grammar::attributes::klass_name const&) const
- {
- return "new " + arg_type + "Concrete(evt.Info)";
- }
- std::string operator()(attributes::complex_type_def const&) const
- {
- return "UNSUPPORTED";
- }
-};
+ return context_find_tag<class_context>(context).current_wrapper_kind == class_context::inherit;
+}
struct klass
{
template <typename OutputIterator, typename Context>
bool generate(OutputIterator sink, attributes::klass_def const& cls, Context const& context) const
{
+ EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "klass_generator: " << cls.eolian_name << std::endl;
std::string suffix, class_type;
switch(cls.type)
{
@@ -144,32 +111,10 @@ struct klass
break;
}
- std::vector<std::string> namespaces = escape_namespace(cls.namespaces);
- auto open_namespace = *("namespace " << string << " { ") << "\n";
- if(!as_generator(open_namespace).generate(sink, namespaces, add_lower_case_context(context))) return false;
- auto methods = cls.get_all_methods();
-
- // FIXME Generate local event argument wrappers
- for (auto&& e : cls.events)
- {
- efl::eina::optional<grammar::attributes::type_def> etype = e.type;
- if (!etype.is_engaged())
- continue;
-
- std::string evt_name = utils::to_uppercase(e.name);
- std::replace(evt_name.begin(), evt_name.end(), ',', '_');
- std::string arg_type = (*etype).original_type.visit(get_csharp_type_visitor{});
-
- if (!as_generator("///<summary>Event argument wrapper for event " << string << ".</summary>\n"
- ).generate(sink, evt_name, context))
- return false;
+ if (!name_helpers::open_namespaces(sink, cls.namespaces, context))
+ return false;
- if (!as_generator("public class " << evt_name << "_Args : EventArgs {\n"
- << scope_tab << "///<summary>Actual event payload.</summary>\n"
- << scope_tab << "public " << arg_type << " arg { get; set; }\n"
- << "}\n").generate(sink, NULL, context))
- return false;
- }
+ auto methods = cls.get_all_methods();
// Interface class
{
@@ -182,60 +127,51 @@ struct klass
(
"public " /*<< class_type*/ "interface" /*<<*/ " " << string << " : "
)
- .generate(sink, cls.cxx_name, iface_cxt))
+ .generate(sink, name_helpers::klass_interface_name(cls), iface_cxt))
return false;
for(auto first = std::begin(cls.immediate_inherits)
, last = std::end(cls.immediate_inherits); first != last; ++first)
{
- if(!as_generator("\n" << scope_tab << *(lower_case[string] << ".") << string << " ,")
- .generate(sink, std::make_tuple(escape_namespace(first->namespaces), first->eolian_name), iface_cxt))
+ if(!as_generator("\n" << scope_tab << string << " ,").generate(sink, name_helpers::klass_full_interface_name(*first), iface_cxt))
return false;
- // if(std::next(first) != last)
- // *sink++ = ',';
}
- // if(cls.immediate_inherits.empty())
- if(!as_generator("\n" << scope_tab << "efl.eo.IWrapper, IDisposable").generate(sink, attributes::unused, iface_cxt)) return false;
- if(!as_generator("\n{\n").generate(sink, attributes::unused, iface_cxt)) return false;
-
- if(!as_generator(*(scope_tab << function_declaration))
- .generate(sink, cls.functions, iface_cxt)) return false;
- // FIXME Move the event generator into another generator like function?
- for (auto &&e : cls.events)
- {
- std::string wrapper_args_type;
- std::string evt_name = utils::to_uppercase(e.name);
- std::replace(evt_name.begin(), evt_name.end(), ',', '_');
+ if(!as_generator("\n" << scope_tab << "efl.eo.IWrapper, IDisposable").generate(sink, attributes::unused, iface_cxt))
+ return false;
- efl::eina::optional<grammar::attributes::type_def> etype = e.type;
- if (etype.is_engaged())
- wrapper_args_type = "<" + evt_name + "_Args>";
+ if(!as_generator("\n{\n").generate(sink, attributes::unused, iface_cxt))
+ return false;
+ if(!as_generator(*(scope_tab << function_declaration)).generate(sink, cls.functions, iface_cxt))
+ return false;
- if (!as_generator(documentation(1)).generate(sink, e, iface_cxt))
- return false;
+ if(!as_generator(*(scope_tab << async_function_declaration)).generate(sink, cls.functions, iface_cxt))
+ return false;
- //FIXME Add a way to generate camelcase names
- if (!as_generator(
- scope_tab << "event EventHandler" << wrapper_args_type << " "
- << evt_name << ";\n"
- ).generate(sink, NULL, iface_cxt))
- return false;
- }
+ if(!as_generator(*(event_declaration)).generate(sink, cls.events, iface_cxt))
+ return false;
+
+ for (auto &&p : cls.parts)
+ if (!as_generator(
+ documentation(1)
+ << name_helpers::klass_full_interface_name(p.klass) << " " << utils::capitalize(p.name) << "{ get;}\n"
+ ).generate(sink, p, iface_cxt))
+ return false;
// End of interface declaration
if(!as_generator("}\n").generate(sink, attributes::unused, iface_cxt)) return false;
}
- auto class_get_name = *(lower_case[string] << "_") << lower_case[string] << "_class_get";
// Concrete class
// if(class_type == "class")
{
auto concrete_cxt = context_add_tag(class_context{class_context::concrete}, context);
+ auto concrete_name = name_helpers::klass_concrete_name(cls);
+ auto interface_name = name_helpers::klass_interface_name(cls);
if(!as_generator
(
documentation
- << "sealed public class " << string << "Concrete : " << string << "\n{\n"
+ << "sealed public class " << concrete_name << " : " << interface_name << "\n{\n"
<< scope_tab << "System.IntPtr handle;\n"
<< scope_tab << "///<summary>Pointer to the native instance.</summary>\n"
<< scope_tab << "public System.IntPtr raw_handle {\n"
@@ -246,42 +182,43 @@ struct klass
<< scope_tab << scope_tab << "get { return efl.eo.Globals.efl_class_get(handle); }\n"
<< scope_tab << "}\n"
<< scope_tab << "///<summary>Delegate for function to be called from inside the native constructor.</summary>\n"
- << scope_tab << "public delegate void ConstructingMethod(" << string << " obj);\n"
+ << scope_tab << "public delegate void ConstructingMethod(" << interface_name << " obj);\n"
+ << scope_tab << "///<summary>Returns the pointer the unerlying Eo class object. Used internally on class methods.</summary>\n"
<< scope_tab << "[System.Runtime.InteropServices.DllImport(" << context_find_tag<library_context>(concrete_cxt).actual_library_name(cls.filename)
- << ")] private static extern System.IntPtr\n"
- << scope_tab << scope_tab << class_get_name << "();\n"
+ << ")] public static extern System.IntPtr\n"
+ << scope_tab << scope_tab << name_helpers::klass_get_name(cls) << "();\n"
<< (class_type == "class" ? "" : "/*")
<< scope_tab << "///<summary>Creates a new instance.</summary>\n"
<< scope_tab << "///<param>Parent instance.</param>\n"
<< scope_tab << "///<param>Delegate to call constructing methods that should be run inside the constructor.</param>\n"
- << scope_tab << "public " << string << "Concrete(efl.Object parent = null, ConstructingMethod init_cb=null)\n"
+ << scope_tab << "public " << concrete_name << "(efl.IObject parent = null, ConstructingMethod init_cb=null)\n"
<< scope_tab << "{\n"
- << scope_tab << scope_tab << "System.IntPtr klass = " << class_get_name << "();\n"
+ << scope_tab << scope_tab << "System.IntPtr klass = " << name_helpers::klass_get_name(cls) << "();\n"
<< scope_tab << scope_tab << "System.IntPtr parent_ptr = System.IntPtr.Zero;\n"
<< scope_tab << scope_tab << "if(parent != null)\n"
<< scope_tab << scope_tab << scope_tab << "parent_ptr = parent.raw_handle;\n"
- << scope_tab << scope_tab << "handle = efl.eo.Globals._efl_add_internal_start(\"file\", 0, klass, parent_ptr, 0, 0);\n"
+ << scope_tab << scope_tab << "handle = efl.eo.Globals._efl_add_internal_start(\"file\", 0, klass, parent_ptr, 1, 0);\n"
<< scope_tab << scope_tab << "if (init_cb != null) {\n"
<< scope_tab << scope_tab << scope_tab << "init_cb(this);\n"
<< scope_tab << scope_tab << "}\n"
- << scope_tab << scope_tab << "handle = efl.eo.Globals._efl_add_end(handle, 0, 0);\n" // replace handle with the actual final handle
+ << scope_tab << scope_tab << "handle = efl.eo.Globals._efl_add_end(handle, 1, 0);\n" // replace handle with the actual final handle
<< scope_tab << scope_tab << "register_event_proxies();\n"
<< scope_tab << scope_tab << "eina.Error.RaiseIfOccurred();\n"
<< scope_tab << "}\n"
<< (class_type == "class" ? "" : "*/")
<< scope_tab << "///<summary>Constructs an instance from a native pointer.</summary>\n"
- << scope_tab << "public " << string << "Concrete(System.IntPtr raw)\n"
+ << scope_tab << "public " << concrete_name << "(System.IntPtr raw)\n"
<< scope_tab << "{\n"
<< scope_tab << scope_tab << "handle = raw;\n"
<< scope_tab << scope_tab << "register_event_proxies();\n"
<< scope_tab << "}\n"
<< scope_tab << "///<summary>Destructor.</summary>\n"
- << scope_tab << "~" << string << "Concrete()\n"
+ << scope_tab << "~" << concrete_name << "()\n"
<< scope_tab << "{\n"
<< scope_tab << scope_tab << "Dispose(false);\n"
<< scope_tab << "}\n"
<< scope_tab << "///<summary>Releases the underlying native instance.</summary>\n"
- << scope_tab << "protected void Dispose(bool disposing)\n"
+ << scope_tab << "internal void Dispose(bool disposing)\n"
<< scope_tab << "{\n"
<< scope_tab << scope_tab << "if (handle != System.IntPtr.Zero) {\n"
<< scope_tab << scope_tab << scope_tab << "efl.eo.Globals.efl_unref(handle);\n"
@@ -295,15 +232,10 @@ struct klass
<< scope_tab << scope_tab << "GC.SuppressFinalize(this);\n"
<< scope_tab << "}\n"
)
- .generate(sink
- , std::make_tuple( cls,
- cls.cxx_name, cls.cxx_name, cls.cxx_name, cls.namespaces, cls.eolian_name
- , cls.cxx_name, cls.namespaces, cls.eolian_name, cls.cxx_name
- , cls.cxx_name)
- , concrete_cxt))
+ .generate(sink, cls, concrete_cxt))
return false;
- if (!generate_static_cast_method(sink, cls.cxx_name, concrete_cxt))
+ if (!generate_static_cast_method(sink, cls, concrete_cxt))
return false;
if (!generate_equals_method(sink, concrete_cxt))
@@ -315,10 +247,21 @@ struct klass
if (!generate_events_registration(sink, cls, concrete_cxt))
return false;
+ // Parts
+ if(!as_generator(*(part_definition))
+ .generate(sink, cls.get_all_parts(), concrete_cxt)) return false;
+
// Concrete function definitions
if(!as_generator(*(function_definition))
.generate(sink, methods, concrete_cxt)) return false;
+ // Async wrappers
+ if(!as_generator(*(async_function_definition)).generate(sink, methods, concrete_cxt))
+ return false;
+
+ if(!as_generator(*(event_argument_wrapper)).generate(sink, cls.events, context))
+ return false;
+
if(!as_generator("}\n").generate(sink, attributes::unused, concrete_cxt)) return false;
}
@@ -329,10 +272,15 @@ struct klass
bool cls_has_string_return = has_string_return(cls);
bool cls_has_stringshare_return = has_stringshare_return(cls);
+ auto interface_name = name_helpers::klass_interface_name(cls);
+ auto inherit_name = name_helpers::klass_inherit_name(cls);
+ auto native_inherit_name = name_helpers::klass_native_inherit_name(cls);
+
+
if(!as_generator
(
documentation
- << "public " << class_type << " " << string << "Inherit : " << string << "\n{\n"
+ << "public " << class_type << " " << inherit_name << " : " << interface_name << "\n{\n"
<< scope_tab << "System.IntPtr handle;\n"
<< scope_tab << "internal static System.IntPtr klass = System.IntPtr.Zero;\n"
<< scope_tab << "private static readonly object klassAllocLock = new object();\n"
@@ -347,20 +295,19 @@ struct klass
<< scope_tab << scope_tab << "get { return klass; }\n"
<< scope_tab << "}\n"
<< scope_tab << "///<summary>Delegate for function to be called from inside the native constructor.</summary>\n"
- << scope_tab << "public delegate void ConstructingMethod(" << string << " obj);\n"
+ << scope_tab << "public delegate void ConstructingMethod(" << interface_name << " obj);\n"
<< scope_tab << "[System.Runtime.InteropServices.DllImport(" << context_find_tag<library_context>(inherit_cxt).actual_library_name(cls.filename)
<< ")] private static extern System.IntPtr\n"
- << scope_tab << scope_tab << class_get_name << "();\n"
+ << scope_tab << scope_tab << name_helpers::klass_get_name(cls) << "();\n"
<< scope_tab << "///<summary>Creates a new instance.</summary>\n"
<< scope_tab << "///<param>Parent instance.</param>\n"
<< scope_tab << "///<param>Delegate to call constructing methods that should be run inside the constructor.</param>\n"
- << scope_tab << "public " << string << "Inherit(efl.Object parent = null, ConstructingMethod init_cb=null)\n"
+ << scope_tab << "public " << inherit_name << "(efl.IObject parent = null, ConstructingMethod init_cb=null)\n"
<< scope_tab << "{\n"
<< scope_tab << scope_tab << "if (klass == System.IntPtr.Zero) {\n"
<< scope_tab << scope_tab << scope_tab << "lock (klassAllocLock) {\n"
<< scope_tab << scope_tab << scope_tab << scope_tab << "if (klass == System.IntPtr.Zero) {\n"
- << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "klass = efl.eo.Globals.register_class(new efl.eo.Globals.class_initializer(" << string << "NativeInherit.class_initializer), " << class_get_name << "());\n"
- //<< scope_tab << scope_tab << "klass = efl.eo.Globals.register_class(null/*new efl.eo.Globals.class_initializer(" << string << "NativeInherit.class_initializer)*/, " << class_get_name << "());\n"
+ << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "klass = efl.eo.Globals.register_class(new efl.eo.Globals.class_initializer(" << native_inherit_name << ".class_initializer), \"" << cls.eolian_name << "\", " << name_helpers::klass_get_name(cls) << "());\n"
<< scope_tab << scope_tab << scope_tab << scope_tab << "}\n"
<< scope_tab << scope_tab << scope_tab << "}\n"
<< scope_tab << scope_tab << "}\n"
@@ -374,7 +321,7 @@ struct klass
<< scope_tab << scope_tab << "eina.Error.RaiseIfOccurred();\n"
<< scope_tab << "}\n"
<< scope_tab << "///<summary>Destructor.</summary>\n"
- << scope_tab << "~" << string << "Inherit()\n"
+ << scope_tab << "~" << inherit_name << "()\n"
<< scope_tab << "{\n"
<< scope_tab << scope_tab << "Dispose(false);\n"
<< scope_tab << "}\n"
@@ -395,15 +342,7 @@ struct klass
<< scope_tab << scope_tab << "GC.SuppressFinalize(this);\n"
<< scope_tab << "}\n"
)
- .generate(sink
- , std::make_tuple(
- cls, cls.cxx_name, cls.cxx_name, cls.cxx_name, cls.namespaces, cls.eolian_name
- , cls.cxx_name, cls.cxx_name, cls.namespaces, cls.eolian_name, cls.cxx_name
- , cls.cxx_name)
- , inherit_cxt))
- return false;
-
- if (!generate_static_cast_method(sink, cls.cxx_name, inherit_cxt))
+ .generate(sink, cls, inherit_cxt))
return false;
if (!generate_equals_method(sink, inherit_cxt))
@@ -415,14 +354,22 @@ struct klass
if (!generate_events_registration(sink, cls, inherit_cxt))
return false;
+ // Parts
+ if(!as_generator(*(part_definition))
+ .generate(sink, cls.get_all_parts(), inherit_cxt)) return false;
+
// Inherit function definitions
if(!as_generator(*(function_definition(true)))
.generate(sink, methods, inherit_cxt)) return false;
+ // Async wrappers
+ if(!as_generator(*(async_function_definition(true))).generate(sink, methods, inherit_cxt))
+ return false;
+
if(!as_generator("}\n").generate(sink, attributes::unused, inherit_cxt)) return false;
}
- std::size_t function_count = get_function_count(cls);
+ std::size_t function_count = get_inheritable_function_count(cls);
int function_registration_index = 0;
auto index_generator = [&function_registration_index]
@@ -434,14 +381,15 @@ struct klass
if(class_type == "class")
{
auto inative_cxt = context_add_tag(class_context{class_context::inherit_native}, context);
+ auto native_inherit_name = name_helpers::klass_native_inherit_name(cls);
if(!as_generator
(
- "internal " << class_type << " " << string << "NativeInherit {\n"
+ "internal " << class_type << " " << native_inherit_name << " {\n"
<< scope_tab << "public static byte class_initializer(IntPtr klass)\n"
<< scope_tab << "{\n"
<< scope_tab << scope_tab << "Efl_Op_Description[] descs = new Efl_Op_Description[" << grammar::int_ << "];\n"
)
- .generate(sink, std::make_tuple(cls.cxx_name, function_count), inative_cxt))
+ .generate(sink, function_count, inative_cxt))
return false;
// Native wrapper registration
@@ -463,22 +411,22 @@ struct klass
<< scope_tab << scope_tab << "Marshal.StructureToPtr(ops, ops_ptr, false);\n"
<< scope_tab << scope_tab << "efl.eo.Globals.efl_class_functions_set(klass, ops_ptr, IntPtr.Zero);\n"
).generate(sink, attributes::unused, inative_cxt)) return false;
-
-
+
+
if(!as_generator(scope_tab << scope_tab << "return 1;\n"
<< scope_tab << "}\n")
.generate(sink, attributes::unused, inative_cxt)) return false;
-
+ //
// Native method definitions
if(!as_generator(*(native_function_definition(cls)))
.generate(sink, methods, inative_cxt)) return false;
if(!as_generator("}\n").generate(sink, attributes::unused, inative_cxt)) return false;
}
-
- auto close_namespace = *(lit("} ")) << "\n";
- if(!as_generator(close_namespace).generate(sink, namespaces, context)) return false;
-
+
+ if(!name_helpers::close_namespaces(sink, cls.namespaces, context))
+ return false;
+
return true;
}
@@ -496,29 +444,16 @@ struct klass
// Generate event registrations here
// Assigning the delegates
- for (auto&& e : cls.events)
- {
- if (!as_generator(scope_tab << scope_tab << "evt_" << grammar::string_replace(',', '_') << "_delegate = "
- << "new efl.Event_Cb(on_" << grammar::string_replace(',', '_') << "_NativeCallback);\n")
- .generate(sink, std::make_tuple(e.name, e.name), context))
- return false;
- }
+ if (!as_generator(*(event_registration())).generate(sink, cls.events, context))
+ return false;
for (auto&& c : cls.inherits)
{
attributes::klass_def klass(get_klass(c, cls.unit), cls.unit);
- for (auto&& e : klass.events)
- {
- std::string wrapper_event_name = translate_inherited_event_name(e, klass);
-
- if (!as_generator(scope_tab << scope_tab << "evt_" << wrapper_event_name << "_delegate = "
- << "new efl.Event_Cb(on_" << wrapper_event_name << "_NativeCallback);\n")
- .generate(sink, NULL, context))
- return false;
- }
+ if (!as_generator(*(event_registration(&klass))).generate(sink, klass.events, context))
+ return false;
}
-
if (!as_generator(
scope_tab << "}\n"
@@ -528,21 +463,6 @@ struct klass
return true;
}
- static std::string translate_inherited_event_name(const attributes::event_def &evt, const attributes::klass_def &klass)
- {
- std::stringstream s;
-
- for (auto&& n : klass.namespaces)
- {
- s << n;
- s << '_';
- }
- std::string evt_name = utils::to_uppercase(evt.name);
- std::replace(evt_name.begin(), evt_name.end(), ',', '_');
- s << klass.cxx_name << '_' << evt_name;
- return s.str();
- }
-
template <typename OutputIterator, typename Context>
bool generate_events(OutputIterator sink, attributes::klass_def const& cls, Context const& context) const
{
@@ -550,6 +470,8 @@ struct klass
if (!has_events(cls))
return true;
+ std::string visibility = is_inherit_context(context) ? "protected" : "private";
+
if (!as_generator(scope_tab << "private readonly object eventLock = new object();\n"
<< scope_tab << "private Dictionary<string, int> event_cb_count = new Dictionary<string, int>();\n")
.generate(sink, NULL, context))
@@ -578,7 +500,7 @@ struct klass
<< scope_tab << scope_tab << "if (!event_cb_count.TryGetValue(key, out event_count))\n"
<< scope_tab << scope_tab << scope_tab << "event_cb_count[key] = event_count;\n"
<< scope_tab << scope_tab << "if (event_count == 1) {\n"
- << scope_tab << scope_tab << scope_tab << "efl.kw_event.Description desc = new efl.kw_event.Description(key);\n"
+ << scope_tab << scope_tab << scope_tab << "efl.Event_Description desc = new efl.Event_Description(key);\n"
<< scope_tab << scope_tab << scope_tab << "bool result = efl.eo.Globals.efl_event_callback_del(handle, desc, evt_delegate, System.IntPtr.Zero);\n"
<< scope_tab << scope_tab << scope_tab << "if (!result) {\n"
<< scope_tab << scope_tab << scope_tab << scope_tab << "eina.Log.Error($\"Failed to remove event proxy for event {key}\");\n"
@@ -597,173 +519,15 @@ struct klass
return false;
// Self events
- for (auto&& e : cls.events)
- {
- std::string upper_name = utils::to_uppercase(e.name);
- std::replace(upper_name.begin(), upper_name.end(), ',', '_');
- std::string upper_c_name = utils::to_uppercase(e.c_name);
- std::string event_name = e.name;
- std::replace(event_name.begin(), event_name.end(), ',', '_');
-
- std::string wrapper_args_type = "EventArgs";
- std::string wrapper_args_template = "";
- std::string event_args = "EventArgs args = EventArgs.Empty;\n";
-
- efl::eina::optional<grammar::attributes::type_def> etype = e.type;
- if (etype.is_engaged())
- {
- wrapper_args_type = upper_name + "_Args";
- wrapper_args_template = "<" + wrapper_args_type + ">";
- std::string arg_type = wrapper_args_type + " args = new " + wrapper_args_type + "();\n"; // = (*etype).original_type.visit(get_csharp_type_visitor{});
- std::string actual_arg_type = (*etype).original_type.visit(get_csharp_type_visitor{});
- arg_type += "args.arg = " + (*etype).original_type.visit(get_event_args_visitor{actual_arg_type}) + ";\n";
-
- event_args = arg_type;
- }
- // Marshal.PtrToStructure for value types
-
- // Wrapper event declaration
- if(!as_generator(documentation(1)).generate(sink, e, context))
- return false;
-
- if(!as_generator(
- scope_tab << "protected event EventHandler" << wrapper_args_template << " " << upper_name << ";\n"
- << scope_tab << "///<summary>Method to raise event "<< event_name << ".</summary>\n"
- << scope_tab << "protected void On_" << event_name << "(" << wrapper_args_type << " e)\n"
- << scope_tab << "{\n"
- << scope_tab << scope_tab << "EventHandler" << wrapper_args_template << " evt;\n"
- << scope_tab << scope_tab << "lock (eventLock) {\n"
- << scope_tab << scope_tab << scope_tab << "evt = " << upper_name << ";\n"
- << scope_tab << scope_tab << "}\n"
- << scope_tab << scope_tab << "if (evt != null) { evt(this, e); }\n"
- << scope_tab << "}\n"
- << scope_tab << "private void on_" << event_name << "_NativeCallback(System.IntPtr data, ref efl.Event evt)\n"
- << scope_tab << "{\n"
- << scope_tab << scope_tab << event_args
- << scope_tab << scope_tab << "try {\n"
- << scope_tab << scope_tab << scope_tab << "On_" << event_name << "(args);\n"
- << scope_tab << scope_tab << "} catch (Exception e) {\n"
- << scope_tab << scope_tab << scope_tab << "eina.Log.Error(e.ToString());\n"
- << scope_tab << scope_tab << scope_tab << "eina.Error.Set(eina.Error.EFL_ERROR);\n"
- << scope_tab << scope_tab << "}\n"
- << scope_tab << "}\n"
- << scope_tab << "efl.Event_Cb evt_" << event_name << "_delegate;\n"
- << scope_tab << "event EventHandler" << wrapper_args_template << " " << cls.cxx_name << "." << upper_name << "{\n")
- .generate(sink, NULL, context))
- return false;
-
- if (!as_generator(
- scope_tab << scope_tab << "add {\n"
- << scope_tab << scope_tab << scope_tab << "lock (eventLock) {\n"
- << scope_tab << scope_tab << scope_tab << scope_tab << "string key = \"_" << upper_c_name << "\";\n"
- << scope_tab << scope_tab << scope_tab << scope_tab << "if (add_cpp_event_handler(key, this.evt_" << event_name << "_delegate))\n"
- << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << upper_name << " += value;\n"
- << scope_tab << scope_tab << scope_tab << scope_tab << "else\n"
- << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "eina.Log.Error($\"Error adding proxy for event {key}\");\n"
- << scope_tab << scope_tab << scope_tab << "}\n" // End of lock block
- << scope_tab << scope_tab << "}\n"
- << scope_tab << scope_tab << "remove {\n"
- << scope_tab << scope_tab << scope_tab << "lock (eventLock) {\n"
- << scope_tab << scope_tab << scope_tab << scope_tab << "string key = \"_" << upper_c_name << "\";\n"
- << scope_tab << scope_tab << scope_tab << scope_tab << "if (remove_cpp_event_handler(key, this.evt_" << event_name << "_delegate))\n"
- << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << upper_name << " -= value;\n"
- << scope_tab << scope_tab << scope_tab << scope_tab << "else\n"
- << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "eina.Log.Error($\"Error removing proxy for event {key}\");\n"
- << scope_tab << scope_tab << scope_tab << "}\n" // End of lock block
- << scope_tab << scope_tab << "}\n"
- << scope_tab << "}\n")
- .generate(sink, NULL, context))
- return false;
- }
+ if (!as_generator(*(event_definition(cls))).generate(sink, cls.events, context))
+ return false;
// Inherited events
for (auto&& c : cls.inherits)
{
attributes::klass_def klass(get_klass(c, cls.unit), cls.unit);
-
- // FIXME Enable inherited events registration. Beware of conflicting events
- for (auto&& e : klass.events)
- {
-
- std::string wrapper_evt_name = translate_inherited_event_name(e, klass);
- std::string upper_name = utils::to_uppercase(e.name);
- std::replace(upper_name.begin(), upper_name.end(), ',', '_');
- std::string upper_c_name = utils::to_uppercase(e.c_name);
-
- std::stringstream wrapper_args_type;
- std::string wrapper_args_template;
- std::string event_args = "EventArgs args = EventArgs.Empty;\n";
-
- efl::eina::optional<grammar::attributes::type_def> etype = e.type;
- if (etype.is_engaged())
- {
- for (auto&& i : klass.namespaces)
- {
- wrapper_args_type << escape_keyword(utils::to_lowercase(i)) << ".";
- }
- wrapper_args_type << upper_name << "_Args";
- wrapper_args_template = "<" + wrapper_args_type.str() + ">";
- std::string arg_type = wrapper_args_type.str() + " args = new " + wrapper_args_type.str() + "();\n"; // = (*etype).original_type.visit(get_csharp_type_visitor{});
- std::string actual_arg_type = (*etype).original_type.visit(get_csharp_type_visitor{});
- arg_type += "args.arg = " + (*etype).original_type.visit(get_event_args_visitor{actual_arg_type}) + ";\n";
- event_args = arg_type;
- }
- else
- {
- wrapper_args_type << "EventArgs";
- }
-
- if (!as_generator(documentation(1)).generate(sink, e, context))
- return false;
-
- if (!as_generator(
- scope_tab << "protected event EventHandler" << wrapper_args_template << " " << wrapper_evt_name << ";\n"
- << scope_tab << "///<summary>Method to raise event "<< wrapper_evt_name << ".</summary>\n"
- << scope_tab << "protected void On_" << wrapper_evt_name << "(" << wrapper_args_type.str() << " e)\n"
- << scope_tab << "{\n"
- << scope_tab << scope_tab << "EventHandler" << wrapper_args_template << " evt;\n"
- << scope_tab << scope_tab << "lock (eventLock) {\n"
- << scope_tab << scope_tab << scope_tab << "evt = " << wrapper_evt_name << ";\n"
- << scope_tab << scope_tab << "}\n"
- << scope_tab << scope_tab << "if (evt != null) { evt(this, e); }\n"
- << scope_tab << "}\n"
- << scope_tab << "efl.Event_Cb evt_" << wrapper_evt_name << "_delegate;\n"
- << scope_tab << "private void on_" << wrapper_evt_name << "_NativeCallback(System.IntPtr data, ref efl.Event evt)"
- << scope_tab << "{\n"
- << scope_tab << scope_tab << event_args
- << scope_tab << scope_tab << "try {\n"
- << scope_tab << scope_tab << scope_tab << "On_" << wrapper_evt_name << "(args);\n"
- << scope_tab << scope_tab << "} catch (Exception e) {\n"
- << scope_tab << scope_tab << scope_tab << "eina.Log.Error(e.ToString());\n"
- << scope_tab << scope_tab << scope_tab << "eina.Error.Set(eina.Error.EFL_ERROR);\n"
- << scope_tab << scope_tab << "}\n"
- << scope_tab << "}\n"
- << scope_tab << "event EventHandler" << wrapper_args_template << " " << *(lower_case[string] << ".") << klass.cxx_name << ".")
- .generate(sink, escape_namespace(klass.namespaces), context))
- return false;
- if (!as_generator(upper_name << " {\n"
- << scope_tab << scope_tab << "add {\n"
- << scope_tab << scope_tab << scope_tab << "lock (eventLock) {\n"
- << scope_tab << scope_tab << scope_tab << scope_tab << "string key = \"_" << upper_c_name << "\";\n"
- << scope_tab << scope_tab << scope_tab << scope_tab << "if (add_cpp_event_handler(key, this.evt_" << wrapper_evt_name << "_delegate))\n"
- << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << wrapper_evt_name << " += value;\n"
- << scope_tab << scope_tab << scope_tab << scope_tab << "else\n"
- << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "eina.Log.Error($\"Error adding proxy for event {key}\");\n"
- << scope_tab << scope_tab << scope_tab << "}\n" // End of lock block
- << scope_tab << scope_tab << "}\n"
- << scope_tab << scope_tab << "remove {\n"
- << scope_tab << scope_tab << scope_tab << "lock (eventLock) {\n"
- << scope_tab << scope_tab << scope_tab << scope_tab << "string key = \"_" << upper_c_name << "\";\n"
- << scope_tab << scope_tab << scope_tab << scope_tab << "if (remove_cpp_event_handler(key, this.evt_" << wrapper_evt_name << "_delegate))\n"
- << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << wrapper_evt_name << " -= value;\n"
- << scope_tab << scope_tab << scope_tab << scope_tab << "else\n"
- << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "eina.Log.Error($\"Error removing proxy for event {key}\");\n"
- << scope_tab << scope_tab << scope_tab << "}\n" // End of lock block
- << scope_tab << scope_tab << "}\n"
- << scope_tab << "}\n")
- .generate(sink, NULL, context))
- return false;
- }
+ if (!as_generator(*(event_definition(klass, true))).generate(sink, klass.events, context))
+ return false;
}
return true;
}
diff --git a/src/bin/eolian_mono/eolian/mono/logging.hh b/src/bin/eolian_mono/eolian/mono/logging.hh
new file mode 100644
index 0000000000..d13c3957ad
--- /dev/null
+++ b/src/bin/eolian_mono/eolian/mono/logging.hh
@@ -0,0 +1,12 @@
+#ifndef EOLIAN_MONO_LOGGING_HH
+#define EOLIAN_MONO_LOGGING_HH
+
+#include <Eina.hh>
+
+namespace eolian_mono {
+
+efl::eina::log_domain domain("eolian_mono");
+
+}
+
+#endif
diff --git a/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh b/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh
index 8774cd855c..a2426569ab 100644
--- a/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh
+++ b/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh
@@ -4,7 +4,7 @@
#include "grammar/generator.hpp"
#include "grammar/klass_def.hpp"
#include "grammar/case.hpp"
-#include "namespace.hh"
+#include "name_helpers.hh"
#include "type_impl.hh"
namespace eolian_mono {
@@ -76,6 +76,12 @@ struct marshall_annotation_visitor_generate
{"any_value_ptr", false, [&] {
return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(eina.ValueMarshaler))]";
}},
+ {"strbuf", true, [&] {
+ return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(efl.eo.StrbufPassOwnershipMarshaler))]";
+ }},
+ {"strbuf", false, [&] {
+ return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(efl.eo.StrbufKeepOwnershipMarshaler))]";
+ }},
};
match const return_match_table[] =
{
@@ -105,6 +111,12 @@ struct marshall_annotation_visitor_generate
{"any_value_ptr", false, [&] {
return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(eina.ValueMarshaler))]";
}},
+ {"strbuf", true, [&] {
+ return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(efl.eo.StrbufPassOwnershipMarshaler))]";
+ }},
+ {"strbuf", false, [&] {
+ return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(efl.eo.StrbufKeepOwnershipMarshaler))]";
+ }},
};
if(eina::optional<bool> b = call_annotation_match
@@ -132,15 +144,18 @@ struct marshall_annotation_visitor_generate
{
const char no_return_prefix[] = "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(efl.eo.MarshalTest<";
const char return_prefix[] = "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(efl.eo.MarshalTest<";
- std::vector<std::string> namespaces = escape_namespace(klass_name.namespaces);
return as_generator
((is_return ? return_prefix : no_return_prefix)
- << *(lower_case[string] << ".") << string
- << "Concrete, efl.eo." << (klass_name.base_qualifier & qualifier_info::is_own ? "OwnTag" : "NonOwnTag") << ">))]"
- ).generate(sink, std::make_tuple(namespaces, klass_name.eolian_name), *context);
+ << string << ", efl.eo." << (klass_name.base_qualifier & qualifier_info::is_own ? "OwnTag" : "NonOwnTag") << ">))]"
+ ).generate(sink, name_helpers::klass_full_concrete_name(klass_name), *context);
}
- bool operator()(attributes::complex_type_def const&) const
+ bool operator()(attributes::complex_type_def const& c) const
{
+ if (c.outer.base_type == "future")
+ {
+ std::string prefix = is_return ? "return: " : "";
+ return as_generator("[" << prefix << "MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(eina.FutureMarshaler))]").generate(sink, nullptr, *context);
+ }
return true;
}
};
@@ -187,6 +202,12 @@ struct marshall_native_annotation_visitor_generate
return "";
return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(efl.eo.StringshareKeepOwnershipMarshaler))]";
}},
+ {"strbuf", true, [&] {
+ return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(efl.eo.StrbufPassOwnershipMarshaler))]";
+ }},
+ {"strbuf", false, [&] {
+ return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(efl.eo.StrbufKeepOwnershipMarshaler))]";
+ }},
};
match const return_match_table[] =
{
@@ -200,6 +221,12 @@ struct marshall_native_annotation_visitor_generate
return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(efl.eo.StringsharePassOwnershipMarshaler))]";
}},
{"stringshare", false, [&] { return ""; }},
+ {"strbuf", true, [&] {
+ return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(efl.eo.StrbufPassOwnershipMarshaler))]";
+ }},
+ {"strbuf", false, [&] {
+ return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(efl.eo.StrbufKeepOwnershipMarshaler))]";
+ }},
};
if(eina::optional<bool> b = call_annotation_match
@@ -227,15 +254,18 @@ struct marshall_native_annotation_visitor_generate
{
const char no_return_prefix[] = "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(efl.eo.MarshalTest<";
const char return_prefix[] = "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(efl.eo.MarshalTest<";
- std::vector<std::string> namespaces = escape_namespace(klass_name.namespaces);
return as_generator
((is_return ? return_prefix : no_return_prefix)
- << *(lower_case[string] << ".") << string
- << "Concrete, efl.eo." << (klass_name.base_qualifier & qualifier_info::is_own ? "OwnTag" : "NonOwnTag") << ">))]"
- ).generate(sink, std::make_tuple(namespaces, klass_name.eolian_name), *context);
+ << string << ", efl.eo." << (klass_name.base_qualifier & qualifier_info::is_own ? "OwnTag" : "NonOwnTag") << ">))]"
+ ).generate(sink, name_helpers::klass_full_concrete_name(klass_name), *context);
}
- bool operator()(attributes::complex_type_def const&) const
+ bool operator()(attributes::complex_type_def const& c) const
{
+ if (c.outer.base_type == "future")
+ {
+ std::string prefix = is_return ? "return: " : "";
+ return as_generator("[" << prefix << "MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(eina.FutureMarshaler))]").generate(sink, nullptr, *context);
+ }
return true;
}
};
diff --git a/src/bin/eolian_mono/eolian/mono/marshall_type.hh b/src/bin/eolian_mono/eolian/mono/marshall_type.hh
index a946e15ea8..79ce8b6380 100644
--- a/src/bin/eolian_mono/eolian/mono/marshall_type.hh
+++ b/src/bin/eolian_mono/eolian/mono/marshall_type.hh
@@ -16,6 +16,16 @@ struct marshall_annotation_visitor_generate;
template <typename OutputIterator, typename Context>
struct marshall_native_annotation_visitor_generate;
}
+
+/*
+ * Converts a given type/parameter to the type used in the DllImport signatures.
+ *
+ * For example, Eina.Value can be marshaled either as an eina.Value instance through
+ * CustomMarshallers if we have a ptr(Eina.Value) or through the intermediate
+ * eina.Value_Native blittable struct if it is passed by value.
+ *
+ * For details, check marshall_type_impl.h with the actual conversion rules.
+ */
struct marshall_type_generator
{
marshall_type_generator(bool is_return = false)
@@ -26,6 +36,7 @@ struct marshall_type_generator
{
return type.original_type.visit(detail::marshall_type_visitor_generate<OutputIterator, Context>{sink, &context, type.c_type, false, is_return, type.is_ptr });
}
+ /* Some types may require a different conversion when they are in @out parameters. */
template <typename OutputIterator, typename Context>
bool generate(OutputIterator sink, attributes::parameter_def const& param, Context const& context) const
{
@@ -36,6 +47,12 @@ struct marshall_type_generator
bool is_return;
};
+/*
+ * Generates the "[MarshalAs(...)]" rules for the given type.
+ *
+ * For example, the CustomMarshallers definitions for String and eina.Values and the
+ * boolean size defintion (Eina_Value is 1 byte, while C# bool has 4 bytes).
+ */
struct marshall_annotation_generator
{
marshall_annotation_generator(bool is_return = false)
diff --git a/src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh b/src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh
index 89efc7f3e2..95970dedd6 100644
--- a/src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh
+++ b/src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh
@@ -5,9 +5,10 @@
#include "grammar/klass_def.hpp"
#include "grammar/case.hpp"
#include "helpers.hh"
-#include "namespace.hh"
+#include "name_helpers.hh"
#include "type_impl.hh"
#include "generation_contexts.hh"
+#include "blacklist.hh"
namespace eolian_mono {
@@ -89,6 +90,12 @@ struct marshall_type_visitor_generate
else
return replace_base_type(r, " System.String");
}}
+ , {"strbuf", nullptr, [&]
+ {
+ regular_type_def r = regular;
+ r.base_qualifier.qualifier ^= qualifier_info::is_ref;
+ return replace_base_type(r, " eina.Strbuf");
+ }}
, {"Binbuf", true, [&]
{
regular_type_def r = regular;
@@ -149,10 +156,12 @@ struct marshall_type_visitor_generate
}}
};
- if (!is_ptr && regular.is_struct() && !is_struct_blacklisted(regular))
+ if (regular.is_struct() && !blacklist::is_struct_blacklisted(regular) && !(bool)(regular.base_qualifier & qualifier_info::is_own))
{
- return as_generator(*(lower_case[string] << ".") << string << "_StructInternal")
- .generate(sink, std::make_tuple(eolian_mono::escape_namespace(regular.namespaces), regular.base_type), *context);
+ if ((is_out || is_return) && is_ptr)
+ return as_generator(" System.IntPtr").generate(sink, attributes::unused, *context);
+ return as_generator(string << "_StructInternal")
+ .generate(sink, name_helpers::type_full_managed_name(regular), *context);
}
else if (eina::optional<bool> b = call_match
(match_table
@@ -169,7 +178,7 @@ struct marshall_type_visitor_generate
{
return *b;
}
- else if (is_ptr && need_pointer_conversion(&regular))
+ else if (is_ptr && helpers::need_pointer_conversion(&regular))
{
regular_type_def r = regular;
r.base_type = " System.IntPtr";
@@ -228,6 +237,11 @@ struct marshall_type_visitor_generate
return regular_type_def{" System.IntPtr", complex.outer.base_qualifier, {}};
}
}
+ ,{"accessor", nullptr, nullptr, [&]
+ {
+ return regular_type_def{" System.IntPtr", complex.outer.base_qualifier, {}};
+ }
+ }
};
auto default_match = [&] (attributes::complex_type_def const& complex)
diff --git a/src/bin/eolian_mono/eolian/mono/name_helpers.hh b/src/bin/eolian_mono/eolian/mono/name_helpers.hh
index 6b40829b20..b1a03056ef 100644
--- a/src/bin/eolian_mono/eolian/mono/name_helpers.hh
+++ b/src/bin/eolian_mono/eolian/mono/name_helpers.hh
@@ -7,11 +7,75 @@
#include <sstream>
#include <string>
#include <vector>
+#include "utils.hh"
+
+#include "grammar/integral.hpp"
+#include "grammar/generator.hpp"
+#include "grammar/klass_def.hpp"
+#include "grammar/list.hpp"
+#include "grammar/string.hpp"
+#include "grammar/integral.hpp"
+
+using efl::eolian::grammar::as_generator;
+using efl::eolian::grammar::string;
+using efl::eolian::grammar::lit;
+using efl::eolian::grammar::operator*;
namespace eolian_mono {
+/* Utility functions for naming things. Compared to the utils.hh, this header has higher level
+ * functions, dealing with the knowledge of how to convert the items to the C# style we are using, for
+ * example, while being too short to be implemented as full-fledged generators.
+ */
namespace name_helpers {
+namespace attributes = efl::eolian::grammar::attributes;
+
+namespace detail {
+inline bool is_iequal(std::string const& lhs, std::string const& rhs)
+{
+ return strcasecmp(lhs.c_str(), rhs.c_str()) == 0;
+}
+}
+
+inline std::string identity(std::string const& str)
+{
+ return str;
+}
+
+inline std::string escape_keyword(std::string const& name)
+{
+ using detail::is_iequal;
+ if(is_iequal(name, "delete")
+ || is_iequal(name, "do")
+ || is_iequal(name, "lock")
+ || is_iequal(name, "event")
+ || is_iequal(name, "in")
+ || is_iequal(name, "object")
+ || is_iequal(name, "interface")
+ || is_iequal(name, "string")
+ || is_iequal(name, "internal")
+ || is_iequal(name, "fixed")
+ || is_iequal(name, "base"))
+ return "kw_" + name;
+
+ if (is_iequal(name, "Finalize"))
+ return name + "Add"; // Eo's Finalize is actually the end of efl_add.
+ return name;
+}
+
+typedef std::function<std::string(std::string const&)> string_transform_func;
+
+inline std::string join_namespaces(std::vector<std::string> const& namespaces, char separator,
+ string_transform_func func=identity)
+{
+ std::stringstream s;
+ for (auto&& n : namespaces)
+ s << func(n) << separator;
+
+ return s.str();
+}
+
static const std::vector<std::string> verbs =
{
"add",
@@ -103,35 +167,153 @@ void reorder_verb(std::vector<std::string> &names)
}
}
-std::vector<std::string> split(std::string const &input, char delim)
+inline std::string managed_namespace(std::string const& ns)
+{
+ return utils::to_lowercase(escape_keyword(ns));
+}
+
+inline std::string managed_method_name(attributes::function_def const& f)
{
- std::stringstream ss(input);
- std::string name;
- std::vector<std::string> names;
+ std::vector<std::string> names = utils::split(f.name, '_');
- while (std::getline(ss, name, delim)) {
- if (!name.empty())
- names.push_back(name);
- }
- return names;
+ name_helpers::reorder_verb(names);
+
+ std::string candidate = escape_keyword(utils::to_pascal_case(names));
+
+ // Some eolian methods have the same name as their parent class
+ if (candidate == f.klass.eolian_name)
+ candidate = "Do" + candidate;
+
+ return candidate;
+}
+
+inline std::string alias_full_eolian_name(attributes::alias_def const& alias)
+{
+ return join_namespaces(alias.namespaces, '.') + alias.eolian_name;
+}
+
+inline std::string managed_async_method_name(attributes::function_def const& f)
+{
+ return managed_method_name(f) + "Async";
+}
+inline std::string function_ptr_full_eolian_name(attributes::function_def const& func)
+{
+ return join_namespaces(func.namespaces, '.') + func.name;
}
-std::string pascal_case(const std::vector<std::string> &names)
+inline std::string type_full_eolian_name(attributes::regular_type_def const& type)
{
- std::vector<std::string> outv(names.size());
- std::stringstream osstream;
+ return join_namespaces(type.namespaces, '.') + type.base_type;
+}
- std::transform(names.begin(), names.end(), outv.begin(),
- [](std::string name) {
- name[0] = std::toupper(name[0]);
- return name;
- });
+inline std::string type_full_managed_name(attributes::regular_type_def const& type)
+{
+ return join_namespaces(type.namespaces, '.', managed_namespace) + type.base_type;
+}
- std::copy(outv.begin(), outv.end(), std::ostream_iterator<std::string>(osstream, ""));
+inline std::string struct_full_eolian_name(attributes::struct_def const& struct_)
+{
+ return join_namespaces(struct_.namespaces, '.') + struct_.cxx_name;
+}
- return osstream.str();
+inline std::string enum_managed_name(attributes::enum_def const& enum_)
+{
+ return enum_.cxx_name;
}
+inline std::string to_field_name(std::string const& in)
+{
+ return utils::capitalize(in);
+}
+
+// Class name translation (interface/concrete/inherit/etc)
+template<typename T>
+inline std::string klass_interface_name(T const& klass)
+{
+ return "I" + klass.eolian_name;
+}
+
+template<typename T>
+inline std::string klass_full_interface_name(T const& klass)
+{
+ return join_namespaces(klass.namespaces, '.', managed_namespace) + klass_interface_name(klass);
+}
+
+template<typename T>
+inline std::string klass_concrete_name(T const& klass)
+{
+ return klass.eolian_name;
+}
+
+template<typename T>
+inline std::string klass_full_concrete_name(T const& klass)
+{
+ return join_namespaces(klass.namespaces, '.', managed_namespace) + klass_concrete_name(klass);
+}
+
+template<typename T>
+inline std::string klass_inherit_name(T const& klass)
+{
+ return klass.eolian_name + "Inherit";
+}
+
+template<typename T>
+inline std::string klass_native_inherit_name(T const& klass)
+{
+ return klass.eolian_name + "NativeInherit";
+}
+
+template<typename T>
+inline std::string klass_get_name(T const& clsname)
+{
+ return utils::to_lowercase(join_namespaces(clsname.namespaces, '_') + clsname.eolian_name + "_class_get");
+}
+
+inline std::string klass_get_full_name(attributes::klass_name const& clsname)
+{
+ return klass_full_concrete_name(clsname) + "." + klass_get_name(clsname);
+}
+
+// Events
+inline std::string managed_event_name(std::string const& name)
+{
+ return utils::to_pascal_case(utils::split(name, ','), "") + "Evt";
+}
+
+inline std::string managed_event_args_short_name(attributes::event_def const& evt)
+{
+ return name_helpers::managed_event_name(evt.name) + "_Args";
+}
+
+inline std::string managed_event_args_name(attributes::event_def evt)
+{
+ return klass_full_concrete_name(evt.klass) + "." + managed_event_args_short_name(evt);
+}
+
+inline std::string translate_inherited_event_name(const attributes::event_def &evt, const attributes::klass_def &klass)
+{
+ return join_namespaces(klass.namespaces, '_') + klass.cxx_name + "_" + managed_event_name(evt.name);
+}
+
+// Open/close namespaces
+template<typename OutputIterator, typename Context>
+bool open_namespaces(OutputIterator sink, std::vector<std::string> namespaces, Context context)
+{
+ std::transform(namespaces.begin(), namespaces.end(), namespaces.begin(), managed_namespace);
+
+ auto open_namespace = *("namespace " << string << " { ") << "\n";
+ return as_generator(open_namespace).generate(sink, namespaces, context);
+}
+
+template<typename OutputIterator, typename Context>
+bool close_namespaces(OutputIterator sink, std::vector<std::string> const& namespaces, Context context)
+{
+ auto close_namespace = *(lit("} ")) << "\n";
+ return as_generator(close_namespace).generate(sink, namespaces, context);
+}
+
+
+
} // namespace name_helpers
} // namespace eolian_mono
diff --git a/src/bin/eolian_mono/eolian/mono/namespace.hh b/src/bin/eolian_mono/eolian/mono/namespace.hh
deleted file mode 100644
index b0f1ddb0b3..0000000000
--- a/src/bin/eolian_mono/eolian/mono/namespace.hh
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef EOLIAN_MONO_NAMESPACE_HH
-#define EOLIAN_MONO_NAMESPACE_HH
-
-#include "grammar/generator.hpp"
-#include "grammar/klass_def.hpp"
-#include "grammar/case.hpp"
-#include "grammar/type.hpp"
-#include "using_decl.hh"
-#include "keyword.hh"
-
-namespace eolian_mono {
-
-std::vector<std::string> escape_namespace(std::vector<std::string> namespaces)
-{
- // if(namespaces.empty())
- // namespaces.push_back("nonamespace");
- // else
- {
- for(auto&& i : namespaces)
- i = escape_keyword(i);
- }
- return namespaces;
-}
-
-}
-
-#endif
diff --git a/src/bin/eolian_mono/eolian/mono/parameter.hh b/src/bin/eolian_mono/eolian/mono/parameter.hh
index 834ca1248d..55ea6f4115 100644
--- a/src/bin/eolian_mono/eolian/mono/parameter.hh
+++ b/src/bin/eolian_mono/eolian/mono/parameter.hh
@@ -8,8 +8,9 @@
#include "marshall_type.hh"
#include "type.hh"
#include "using_decl.hh"
-#include "keyword.hh"
+#include "name_helpers.hh"
+using namespace eolian_mono::name_helpers;
namespace eolian_mono {
struct parameter_generator;
@@ -22,6 +23,8 @@ namespace eolian_mono {
struct native_convert_out_variable_generator;
struct convert_out_variable_generator;
struct convert_out_assign_generator;
+ struct native_convert_in_ptr_assign_generator;
+ struct convert_in_ptr_assign_generator;
struct native_convert_out_assign_parameterized;
struct native_convert_out_assign_generator;
struct convert_return_generator;
@@ -136,6 +139,26 @@ struct attributes_needed< ::eolian_mono::convert_out_assign_generator> : std::in
}
template <>
+struct is_eager_generator< ::eolian_mono::native_convert_in_ptr_assign_generator> : std::true_type {};
+template <>
+struct is_generator< ::eolian_mono::native_convert_in_ptr_assign_generator> : std::true_type {};
+
+namespace type_traits {
+template <>
+struct attributes_needed< ::eolian_mono::native_convert_in_ptr_assign_generator> : std::integral_constant<int, 1> {};
+}
+
+template <>
+struct is_eager_generator< ::eolian_mono::convert_in_ptr_assign_generator> : std::true_type {};
+template <>
+struct is_generator< ::eolian_mono::convert_in_ptr_assign_generator> : std::true_type {};
+
+namespace type_traits {
+template <>
+struct attributes_needed< ::eolian_mono::convert_in_ptr_assign_generator> : std::integral_constant<int, 1> {};
+}
+
+template <>
struct is_eager_generator< ::eolian_mono::convert_return_variable_generator> : std::true_type {};
template <>
struct is_generator< ::eolian_mono::convert_return_variable_generator> : std::true_type {};
@@ -252,6 +275,10 @@ inline bool param_should_use_out_var(attributes::parameter_def const& param, boo
|| param_is_acceptable(param, "Eina_Inlist *", WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "const Eina_Inlist *", !WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "const Eina_Inlist *", WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "Eina_Accessor *", !WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "Eina_Accessor *", WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "const Eina_Accessor *", !WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "const Eina_Accessor *", WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "Eina_Hash *", !WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "Eina_Hash *", WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "const Eina_Hash *", !WANT_OWN, WANT_OUT)
@@ -266,10 +293,10 @@ inline bool param_should_use_out_var(attributes::parameter_def const& param, boo
return true;
auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type);
- if (need_struct_conversion(regular))
+ if (helpers::need_struct_conversion(regular))
return true;
- if (param.type.is_ptr && need_pointer_conversion(regular))
+ if (param.type.is_ptr && helpers::need_pointer_conversion(regular))
return true;
return false;
@@ -298,6 +325,10 @@ inline bool param_should_use_in_var(attributes::parameter_def const& param, bool
|| param_is_acceptable(param, "const Eina_List *", WANT_OWN, !WANT_OUT)
|| param_is_acceptable(param, "Eina_Inlist *", !WANT_OWN, !WANT_OUT)
|| param_is_acceptable(param, "Eina_Inlist *", WANT_OWN, !WANT_OUT)
+ || param_is_acceptable(param, "Eina_Accessor *", !WANT_OWN, !WANT_OUT)
+ || param_is_acceptable(param, "Eina_Accessor *", WANT_OWN, !WANT_OUT)
+ || param_is_acceptable(param, "const Eina_Accessor *", !WANT_OWN, !WANT_OUT)
+ || param_is_acceptable(param, "const Eina_Accessor *", WANT_OWN, !WANT_OUT)
|| param_is_acceptable(param, "const Eina_Inlist *", !WANT_OWN, !WANT_OUT)
|| param_is_acceptable(param, "const Eina_Inlist *", WANT_OWN, !WANT_OUT)
|| param_is_acceptable(param, "Eina_Hash *", !WANT_OWN, !WANT_OUT)
@@ -314,10 +345,10 @@ inline bool param_should_use_in_var(attributes::parameter_def const& param, bool
return true;
auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type);
- if (need_struct_conversion(regular))
+ if (helpers::need_struct_conversion(regular))
return true;
- if (param.type.is_ptr && need_pointer_conversion(regular))
+ if (param.type.is_ptr && helpers::need_pointer_conversion(regular))
return true;
return false;
@@ -341,16 +372,31 @@ inline std::string direction_modifier(attributes::parameter_def const& param)
}
else if (param.direction != attributes::parameter_direction::in)
{
- auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type);
- if (param.type.c_type == "Eina_Slice" || param.type.c_type == "Eina_Rw_Slice"
- || need_struct_conversion(regular))
+ if (param.type.c_type == "Eina_Slice" || param.type.c_type == "Eina_Rw_Slice")
return " ref ";
else
return " out ";
}
+ else if (param.direction == attributes::parameter_direction::in && param.type.is_ptr)
+ {
+ auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type);
+ if (helpers::need_struct_conversion(regular))
+ return " ref "; // Don't add ref on Marshal if it is ptr
+ }
return " ";
}
+std::string marshall_direction_modifier(attributes::parameter_def const& param)
+{
+ if (param.direction == attributes::parameter_direction::in && param.type.is_ptr)
+ {
+ auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type);
+ if (helpers::need_struct_conversion(regular) && param.type.has_own)
+ return " "; // Don't add ref on Marshal if it is ptr
+ }
+ return direction_modifier(param);
+}
+
struct is_fp_visitor
{
typedef is_fp_visitor visitor_type;
@@ -375,11 +421,7 @@ struct type_name_visitor
std::string operator()(grammar::attributes::regular_type_def const &type) const
{
- std::stringstream type_name;
- for (auto&& i : escape_namespace(type.namespaces))
- type_name << i << ".";
- type_name << type.base_type;
- return type_name.str();
+ return name_helpers::type_full_eolian_name(type);
}
template<typename T>
@@ -412,7 +454,7 @@ struct marshall_parameter_generator
if (!param.type.original_type.visit(is_fp_visitor{}))
return as_generator(
- direction_modifier(param) << marshall_type << " " << string
+ marshall_direction_modifier(param) << marshall_type << " " << string
).generate(sink, std::make_tuple(param, param_name), context);
return as_generator(
@@ -421,14 +463,15 @@ struct marshall_parameter_generator
).generate(sink, param, context);
}
} const marshall_parameter {};
-
+
+// FIXME This seems to be used only in the else branch of the native function definition. Is it really needed?
struct argument_generator
{
template <typename OutputIterator, typename Context>
bool generate(OutputIterator sink, attributes::parameter_def const& param, Context const& context) const
{
std::string param_name = escape_keyword(param.param_name);
- std::string direction = direction_modifier(param);
+ std::string direction = marshall_direction_modifier(param);
if (!param.type.original_type.visit(is_fp_visitor{}))
return as_generator(
@@ -475,7 +518,7 @@ struct argument_invocation_generator
template <typename OutputIterator, typename Context>
bool generate(OutputIterator sink, attributes::parameter_def const& param, Context const& context) const
{
- std::string arg = direction_modifier(param);
+ std::string arg = marshall_direction_modifier(param);
if (use_conversion_vars && param_should_use_out_var(param, false))
arg += out_variable_name(param.param_name);
@@ -507,16 +550,16 @@ struct native_convert_in_variable_generator
return true;
auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type);
- if (param.type.is_ptr && need_pointer_conversion(regular))
+ if (param.type.is_ptr && helpers::need_pointer_conversion(regular) && !helpers::need_struct_conversion(param, regular))
{
return as_generator(
"var " << string << " = eina.PrimitiveConversion.PointerToManaged<" << type << ">(" << escape_keyword(param.param_name) << ");\n"
).generate(sink, std::make_tuple(in_variable_name(param.param_name), param.type), context);
}
- else if (need_struct_conversion(regular))
+ else if (helpers::need_struct_conversion(regular))
{
return as_generator(
- "var " << string << " = " << type << "_StructConvertion.ToExternal(" << escape_keyword(param.param_name) << ");\n"
+ "var " << string << " = " << type << "_StructConversion.ToExternal(" << escape_keyword(param.param_name) << ");\n"
).generate(sink, std::make_tuple(in_variable_name(param.param_name), param.type), context);
}
else if (param.type.c_type == "Eina_Binbuf *" || param.type.c_type == "const Eina_Binbuf *")
@@ -543,6 +586,7 @@ struct native_convert_in_variable_generator
|| param.type.c_type == "Eina_List *" || param.type.c_type == "const Eina_List *"
|| param.type.c_type == "Eina_Inlist *" || param.type.c_type == "const Eina_Inlist *"
|| param.type.c_type == "Eina_Iterator *" || param.type.c_type == "const Eina_Iterator *"
+ || param.type.c_type == "Eina_Accessor *" || param.type.c_type == "const Eina_Accessor *"
)
{
attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type);
@@ -575,16 +619,16 @@ struct convert_in_variable_generator
return true;
auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type);
- if (param.type.is_ptr && need_pointer_conversion(regular))
+ if (param.type.is_ptr && helpers::need_pointer_conversion(regular) && !helpers::need_struct_conversion(param, regular))
{
return as_generator(
"var " << string << " = eina.PrimitiveConversion.ManagedToPointerAlloc(" << escape_keyword(param.param_name) << ");\n"
).generate(sink, in_variable_name(param.param_name), context);
}
- else if (need_struct_conversion(regular))
+ else if (helpers::need_struct_conversion(regular))
{
return as_generator(
- "var " << string << " = " << type << "_StructConvertion.ToInternal(" << escape_keyword(param.param_name) << ");\n"
+ "var " << string << " = " << type << "_StructConversion.ToInternal(" << escape_keyword(param.param_name) << ");\n"
).generate(sink, std::make_tuple(in_variable_name(param.param_name), param.type), context);
}
else if (param.type.c_type == "Eina_Binbuf *" || param.type.c_type == "const Eina_Binbuf *")
@@ -630,6 +674,7 @@ struct convert_in_variable_generator
|| param.type.c_type == "Eina_List *" || param.type.c_type == "const Eina_List *"
|| param.type.c_type == "Eina_Inlist *" || param.type.c_type == "const Eina_Inlist *"
|| param.type.c_type == "Eina_Iterator *" || param.type.c_type == "const Eina_Iterator *"
+ || param.type.c_type == "Eina_Accessor *" || param.type.c_type == "const Eina_Accessor *"
)
{
attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type);
@@ -659,7 +704,8 @@ struct convert_in_variable_generator
}
} const convert_in_variable {};
-
+
+/* Some types require an intermediate variable to be filled as out parameter in the marshalled function */
struct convert_out_variable_generator
{
template <typename OutputIterator, typename Context>
@@ -669,17 +715,17 @@ struct convert_out_variable_generator
return true;
auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type);
- if (param.type.is_ptr && need_pointer_conversion(regular))
+ if (param.type.is_ptr && helpers::need_pointer_conversion(regular) && !helpers::need_struct_conversion(regular))
{
return as_generator(
"System.IntPtr " << string << " = System.IntPtr.Zero;\n"
).generate(sink, out_variable_name(param.param_name), context);
}
- else if (need_struct_conversion(regular))
+ else if (helpers::need_struct_conversion(regular))
{
return as_generator(
"var " << string << " = new " << marshall_type << "();\n"
- ).generate(sink, std::make_tuple(out_variable_name(param.param_name), param.type), context);
+ ).generate(sink, std::make_tuple(out_variable_name(param.param_name), param), context);
}
else if (param_is_acceptable(param, "Eina_Binbuf *", WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "Eina_Binbuf *", !WANT_OWN, WANT_OUT)
@@ -707,6 +753,10 @@ struct convert_out_variable_generator
|| param_is_acceptable(param, "Eina_Inlist *", !WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "const Eina_Inlist *", WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "const Eina_Inlist *", !WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "Eina_Accessor *", WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "Eina_Accessor *", !WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "const Eina_Accessor *", WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "const Eina_Accessor *", !WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "Eina_Hash *", WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "Eina_Hash *", !WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "const Eina_Hash *", WANT_OWN, WANT_OUT)
@@ -742,13 +792,13 @@ struct native_convert_out_variable_generator
return true;
auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type);
- if (param.type.is_ptr && need_pointer_conversion(regular))
+ if (param.type.is_ptr && helpers::need_pointer_conversion(regular) && !helpers::need_struct_conversion(regular))
{
return as_generator(
type << " " << string << " = default(" << type << ");\n"
).generate(sink, std::make_tuple(param, out_variable_name(param.param_name), param), context);
}
- else if (need_struct_conversion(regular)
+ else if (helpers::need_struct_conversion(regular)
|| param_is_acceptable(param, "const char *", !WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "Eina_Stringshare *", !WANT_OWN, WANT_OUT))
{
@@ -782,6 +832,10 @@ struct native_convert_out_variable_generator
|| param_is_acceptable(param, "Eina_Inlist *", !WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "const Eina_Inlist *", WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "const Eina_Inlist *", !WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "Eina_Accessor *", WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "Eina_Accessor *", !WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "const Eina_Accessor *", WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "const Eina_Accessor *", !WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "Eina_Hash *", WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "Eina_Hash *", !WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "const Eina_Hash *", WANT_OWN, WANT_OUT)
@@ -819,6 +873,7 @@ struct native_convert_out_variable_generator
} const native_convert_out_variable {};
+/* Assign the Managed out variables from the marshalled intermediate ones if needed. */
struct convert_out_assign_generator
{
template <typename OutputIterator, typename Context>
@@ -828,16 +883,22 @@ struct convert_out_assign_generator
return true;
auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type);
- if (param.type.is_ptr && need_pointer_conversion(regular))
+ if (param.type.is_ptr && helpers::need_pointer_conversion(regular) && !helpers::need_struct_conversion_in_return(param.type, param.direction))
{
- return as_generator(
+ bool ret = as_generator(
string << " = eina.PrimitiveConversion.PointerToManaged<" << type << ">(" << out_variable_name(param.param_name) << ");\n"
).generate(sink, std::make_tuple(escape_keyword(param.param_name), param.type), context);
+
+ if (param.type.has_own)
+ ret = ret && as_generator(scope_tab << scope_tab << "Marshal.FreeHGlobal(" << out_variable_name(param.param_name) << ");\n"
+ ).generate(sink, attributes::unused, context);
+
+ return ret;
}
- else if (need_struct_conversion(regular))
+ else if (helpers::need_struct_conversion(regular))
{
return as_generator(
- string << " = " << type << "_StructConvertion.ToExternal(" << out_variable_name(param.param_name) << ");\n"
+ string << " = " << type << "_StructConversion.ToExternal(" << out_variable_name(param.param_name) << ");\n"
).generate(sink, std::make_tuple(escape_keyword(param.param_name), param.type), context);
}
else if (param_is_acceptable(param, "Eina_Binbuf *", WANT_OWN, WANT_OUT)
@@ -883,6 +944,10 @@ struct convert_out_assign_generator
|| param_is_acceptable(param, "Eina_Inlist *", !WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "const Eina_Inlist *", WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "const Eina_Inlist *", !WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "Eina_Accessor *", WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "Eina_Accessor *", !WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "const Eina_Accessor *", WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "const Eina_Accessor *", !WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "Eina_Iterator *", WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "Eina_Iterator *", !WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "const Eina_Iterator *", WANT_OWN, WANT_OUT)
@@ -911,6 +976,40 @@ struct convert_out_assign_generator
} const convert_out_assign {};
+struct native_convert_in_ptr_assign_generator
+{
+ template <typename OutputIterator, typename Context>
+ bool generate(OutputIterator sink, attributes::parameter_def const& param, Context const& context) const
+ {
+ auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type);
+ if (param_should_use_in_var(param, true) && param.type.is_ptr && !param.type.has_own && helpers::need_struct_conversion(regular))
+ {
+ return as_generator(
+ string << " = " << type << "_StructConversion.ToInternal(" << in_variable_name(param.param_name) << ");\n"
+ ).generate(sink, std::make_tuple(escape_keyword(param.param_name), param.type), context);
+ }
+
+ return true;
+ }
+} const native_convert_in_ptr_assign {};
+
+struct convert_in_ptr_assign_generator
+{
+ template <typename OutputIterator, typename Context>
+ bool generate(OutputIterator sink, attributes::parameter_def const& param, Context const& context) const
+ {
+ auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type);
+ if (param_should_use_in_var(param, true) && param.type.is_ptr && !param.type.has_own && helpers::need_struct_conversion(regular))
+ {
+ return as_generator(
+ string << " = " << type << "_StructConversion.ToExternal(" << in_variable_name(param.param_name) << ");\n"
+ ).generate(sink, std::make_tuple(escape_keyword(param.param_name), param.type), context);
+ }
+
+ return true;
+ }
+} const convert_in_ptr_assign {};
+
struct convert_return_variable_generator
{
template <typename OutputIterator, typename Context>
@@ -923,23 +1022,25 @@ struct convert_return_variable_generator
} const convert_return_variable {};
-
+/* Converts the intermediate return variable to the proper API type */
struct convert_return_generator
{
template <typename OutputIterator, typename Context>
bool generate(OutputIterator sink, attributes::type_def const& ret_type, Context const& context) const
{
auto regular = efl::eina::get<attributes::regular_type_def>(&ret_type.original_type);
- if (ret_type.is_ptr && need_pointer_conversion(regular))
+ if (ret_type.is_ptr && helpers::need_pointer_conversion(regular) && !helpers::need_struct_conversion_in_return(ret_type, attributes::parameter_direction::unknown))
{
return as_generator(
- "return eina.PrimitiveConversion.PointerToManaged<" << type << ">(_ret_var);\n"
+ "var __ret_tmp = eina.PrimitiveConversion.PointerToManaged<" << type << ">(_ret_var);\n"
+ << scope_tab << scope_tab << (ret_type.has_own ? ("Marshal.FreeHGlobal(_ret_var);\n"): "\n")
+ << scope_tab << scope_tab << "return __ret_tmp;\n"
).generate(sink, ret_type, context);
}
- else if (need_struct_conversion(regular))
+ else if (helpers::need_struct_conversion(regular))
{
return as_generator(
- "return " << type << "_StructConvertion.ToExternal(_ret_var);\n"
+ "return " << type << "_StructConversion.ToExternal(_ret_var);\n"
).generate(sink, ret_type, context);
}
else if (ret_type.c_type == "Eina_Binbuf *" || ret_type.c_type == "const Eina_Binbuf *")
@@ -966,6 +1067,7 @@ struct convert_return_generator
|| ret_type.c_type == "Eina_List *" || ret_type.c_type == "const Eina_List *"
|| ret_type.c_type == "Eina_Inlist *" || ret_type.c_type == "const Eina_Inlist *"
|| ret_type.c_type == "Eina_Iterator *" || ret_type.c_type == "const Eina_Iterator *"
+ || ret_type.c_type == "Eina_Accessor *" || ret_type.c_type == "const Eina_Accessor *"
)
{
attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&ret_type.original_type);
@@ -994,33 +1096,44 @@ struct native_convert_out_assign_generator
template <typename OutputIterator, typename Context>
bool generate(OutputIterator sink, attributes::parameter_def const& param, Context const& context) const
{
+ EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "native_convert_out_assign_generator: " << param.param_name << std::endl;
if (param.direction == attributes::parameter_direction::in)
return true;
auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type);
- if (param.type.is_ptr && need_pointer_conversion(regular))
+ if (param.type.is_ptr && helpers::need_pointer_conversion(regular) && !helpers::need_struct_conversion_in_return(param.type, param.direction))
{
return as_generator(
string << " = eina.PrimitiveConversion.ManagedToPointerAlloc(" << string << ");\n"
).generate(sink, std::make_tuple(escape_keyword(param.param_name), out_variable_name(param.param_name)), context);
}
- else if (need_struct_conversion(regular))
+ else if (helpers::need_struct_conversion(regular))
{
return as_generator(
- string << " = " << type << "_StructConvertion.ToInternal(" << string << ");\n"
+ string << " = " << type << "_StructConversion.ToInternal(" << string << ");\n"
).generate(sink, std::make_tuple(escape_keyword(param.param_name), param.type, out_variable_name(param.param_name)), context);
}
else if (param_is_acceptable(param, "Eina_Stringshare *", !WANT_OWN, WANT_OUT))
{
+ if (klass == nullptr)
+ {
+ EINA_CXX_DOM_LOG_ERR(eolian_mono::domain) << "Null class found when trying to assign out stringshare from native wrapper." << std::endl;
+ return false;
+ }
return as_generator(
- string << "= efl.eo.Globals.cached_stringshare_to_intptr(((" << string << "Inherit)wrapper).cached_stringshares, " << string << ");\n"
- ).generate(sink, std::make_tuple(escape_keyword(param.param_name), klass->cxx_name, out_variable_name(param.param_name)), context);
+ string << "= efl.eo.Globals.cached_stringshare_to_intptr(((" << name_helpers::klass_inherit_name(*klass) << ")wrapper).cached_stringshares, " << string << ");\n"
+ ).generate(sink, std::make_tuple(escape_keyword(param.param_name), out_variable_name(param.param_name)), context);
}
else if (param_is_acceptable(param, "const char *", !WANT_OWN, WANT_OUT))
{
+ if (klass == nullptr)
+ {
+ EINA_CXX_DOM_LOG_ERR(eolian_mono::domain) << "Null class found when trying to assign out string from native wrapper." << std::endl;
+ return false;
+ }
return as_generator(
- string << "= efl.eo.Globals.cached_string_to_intptr(((" << string << "Inherit)wrapper).cached_strings, " << string << ");\n"
- ).generate(sink, std::make_tuple(escape_keyword(param.param_name), klass->cxx_name, out_variable_name(param.param_name)), context);
+ string << "= efl.eo.Globals.cached_string_to_intptr(((" << name_helpers::klass_inherit_name(*klass) << ")wrapper).cached_strings, " << string << ");\n"
+ ).generate(sink, std::make_tuple(escape_keyword(param.param_name), out_variable_name(param.param_name)), context);
}
else if (param_is_acceptable(param, "Eina_Binbuf *", WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "Eina_Binbuf *", !WANT_OWN, WANT_OUT)
@@ -1085,6 +1198,10 @@ struct native_convert_out_assign_generator
|| param_is_acceptable(param, "Eina_Iterator *", !WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "const Eina_Iterator *", WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "const Eina_Iterator *", !WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "Eina_Accessor *", WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "Eina_Accessor *", !WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "const Eina_Accessor *", WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "const Eina_Accessor *", !WANT_OWN, WANT_OUT)
)
{
attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type);
@@ -1131,25 +1248,30 @@ struct native_convert_return_generator
bool generate(OutputIterator sink, attributes::type_def const& ret_type, Context const& context) const
{
auto regular = efl::eina::get<attributes::regular_type_def>(&ret_type.original_type);
- if (ret_type.is_ptr && need_pointer_conversion(regular))
+ if (ret_type.is_ptr && helpers::need_pointer_conversion(regular) && !helpers::need_struct_conversion_in_return(ret_type, attributes::parameter_direction::unknown) )
{
return as_generator(
"return eina.PrimitiveConversion.ManagedToPointerAlloc(_ret_var);\n"
).generate(sink, attributes::unused, context);
}
- else if (need_struct_conversion(regular))
+ else if (helpers::need_struct_conversion(regular))
{
return as_generator(
- "return " << type << "_StructConvertion.ToInternal(_ret_var);\n"
+ "return " << type << "_StructConversion.ToInternal(_ret_var);\n"
).generate(sink, ret_type, context);
}
else if (ret_type.c_type == "const char *")
{
if(!ret_type.has_own)
{
+ if (klass == nullptr)
+ {
+ EINA_CXX_DOM_LOG_ERR(eolian_mono::domain) << "Null class found when trying to return string from native wrapper." << std::endl;
+ return false;
+ }
return as_generator(
- "return efl.eo.Globals.cached_string_to_intptr(((" << string << "Inherit)wrapper).cached_strings, _ret_var);\n"
- ).generate(sink, klass->cxx_name, context);
+ "return efl.eo.Globals.cached_string_to_intptr(((" << name_helpers::klass_inherit_name(*klass) << ")wrapper).cached_strings, _ret_var);\n"
+ ).generate(sink, attributes::unused, context);
}
else
{
@@ -1160,9 +1282,14 @@ struct native_convert_return_generator
else if (ret_type.c_type == "Eina_Stringshare *") { // Correct check for string?
if (!ret_type.has_own)
{
+ if (klass == nullptr)
+ {
+ EINA_CXX_DOM_LOG_ERR(eolian_mono::domain) << "Null class found when trying to return stringshare from native wrapper." << std::endl;
+ return false;
+ }
return as_generator(
- "return efl.eo.Globals.cached_stringshare_to_intptr(((" << string << "Inherit)wrapper).cached_stringshares, _ret_var);\n"
- ).generate(sink, klass->cxx_name, context);
+ "return efl.eo.Globals.cached_stringshare_to_intptr(((" << name_helpers::klass_inherit_name(*klass) << ")wrapper).cached_stringshares, _ret_var);\n"
+ ).generate(sink, attributes::unused, context);
}
else
{
@@ -1202,6 +1329,7 @@ struct native_convert_return_generator
|| ret_type.c_type == "Eina_List *" || ret_type.c_type == "const Eina_List *"
|| ret_type.c_type == "Eina_Inlist *" || ret_type.c_type == "const Eina_Inlist *"
|| ret_type.c_type == "Eina_Iterator *" || ret_type.c_type == "const Eina_Iterator *"
+ || ret_type.c_type == "Eina_Accessor *" || ret_type.c_type == "const Eina_Accessor *"
)
{
attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&ret_type.original_type);
@@ -1277,7 +1405,7 @@ struct native_convert_function_pointer_generator
// Getting the type through C api
std::string type_name = param.type.original_type.visit(type_name_visitor{});
- const Eolian_Typedecl *tpd = ::eolian_typedecl_alias_get_by_name(param.unit, type_name.c_str());
+ const Eolian_Typedecl *tpd = ::eolian_unit_alias_by_name_get(param.unit, type_name.c_str());
if (!tpd)
{
EINA_LOG_ERR("Failed to get typedecl for c type [%s]", param.type.c_type.c_str());
@@ -1292,7 +1420,7 @@ struct native_convert_function_pointer_generator
EINA_LOG_ERR("Failed to get function pointer info for c type [%s]", param.type.c_type.c_str());
return false;
}
- attributes::function_def f(fd, EOLIAN_FUNCTION_POINTER, param.unit);
+ attributes::function_def f(fd, EOLIAN_FUNCTION_POINTER, tpd, param.unit);
std::string param_name = escape_keyword(param.param_name);
// Allocate GCHandle in "param_name"_handle for param;
diff --git a/src/bin/eolian_mono/eolian/mono/part_definition.hh b/src/bin/eolian_mono/eolian/mono/part_definition.hh
new file mode 100644
index 0000000000..94fc3cb63c
--- /dev/null
+++ b/src/bin/eolian_mono/eolian/mono/part_definition.hh
@@ -0,0 +1,54 @@
+#ifndef EOLIAN_MONO_PART_DEFINITION_HH
+#define EOLIAN_MONO_PART_DEFINITION_HH
+
+#include <Eina.hh>
+
+#include "grammar/generator.hpp"
+#include "grammar/klass_def.hpp"
+#include "grammar/indentation.hpp"
+
+#include "utils.hh"
+#include "name_helpers.hh"
+#include "documentation.hh"
+
+namespace eolian_mono {
+
+struct part_definition_generator
+{
+ template <typename OutputIterator, typename Context>
+ bool generate(OutputIterator sink, attributes::part_def const& part, Context const& context) const
+ {
+ auto part_interface_name = name_helpers::klass_full_interface_name(part.klass);
+ auto part_klass_name = name_helpers::klass_full_concrete_name(part.klass);
+ return as_generator(scope_tab << documentation
+ << scope_tab << "public " << part_interface_name << " " << utils::capitalize(part.name) << "\n"
+ << scope_tab << "{\n"
+ << scope_tab << scope_tab << "get\n"
+ << scope_tab << scope_tab << "{\n"
+ << scope_tab << scope_tab << scope_tab << "efl.IObject obj = efl_part_get(raw_handle, \"" << part.name << "\");\n"
+ << scope_tab << scope_tab << scope_tab << "return " << part_klass_name << ".static_cast(obj);\n"
+ << scope_tab << scope_tab << "}\n"
+ << scope_tab << "}\n"
+ ).generate(sink, part.documentation, context);
+ }
+
+} const part_definition {};
+
+}
+
+namespace efl { namespace eolian { namespace grammar {
+
+template <>
+struct is_eager_generator< ::eolian_mono::part_definition_generator> : std::true_type {};
+template <>
+struct is_generator< ::eolian_mono::part_definition_generator> : std::true_type {};
+
+namespace type_traits {
+template <>
+struct attributes_needed< ::eolian_mono::part_definition_generator> : std::integral_constant<int, 1> {};
+
+}
+} } }
+
+#endif
+
diff --git a/src/bin/eolian_mono/eolian/mono/struct_definition.hh b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
index 5db84e0a9b..42d2f0d711 100644
--- a/src/bin/eolian_mono/eolian/mono/struct_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
@@ -6,11 +6,13 @@
#include "grammar/indentation.hpp"
#include "grammar/list.hpp"
#include "grammar/alternative.hpp"
+#include "name_helpers.hh"
#include "helpers.hh"
#include "type.hh"
-#include "keyword.hh"
#include "using_decl.hh"
#include "documentation.hh"
+#include "struct_fields.hh"
+#include "blacklist.hh"
namespace eolian_mono {
@@ -24,19 +26,12 @@ inline std::string binding_struct_internal_name(attributes::struct_def const& st
return struct_.cxx_name + "_StructInternal";
}
-inline std::string to_field_name(std::string const& in)
-{
- std::string field_name = in;
- field_name[0] = std::toupper(field_name[0]); // Hack to allow 'static' as a field name
- return field_name;
-}
-
struct struct_definition_generator
{
template <typename OutputIterator, typename Context>
bool generate(OutputIterator sink, attributes::struct_def const& struct_, Context const& context) const
{
-
+ EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "struct_definition_generator: " << struct_.cxx_name << std::endl;
if(!as_generator(documentation).generate(sink, struct_, context))
return false;
if(!as_generator
@@ -57,7 +52,7 @@ struct struct_definition_generator
documentation(1)
<< scope_tab(1) << "public " << type << " " << string << ";\n"
)
- .generate(sink, std::make_tuple(field, field.type, to_field_name(field.name)), context))
+ .generate(sink, std::make_tuple(field, field.type, name_helpers::to_field_name(field.name)), context))
return false;
}
@@ -67,9 +62,24 @@ struct struct_definition_generator
// those 'mini-amd64.c condition fields not met' crashes.
if (struct_.fields.size() == 0)
{
- if (!as_generator("public IntPtr field;\n").generate(sink, nullptr, context))
+ if (!as_generator("///<summary>Placeholder field</summary>\npublic IntPtr field;\n").generate(sink, nullptr, context))
return false;
}
+ else
+ {
+ // Constructor with default parameters for easy struct initialization
+ auto struct_name = binding_struct_name(struct_);
+ if(!as_generator(
+ scope_tab << "///<summary>Constructor for " << string << ".</summary>\n"
+ << scope_tab << "public " << string << "(\n"
+ << ((scope_tab << scope_tab << field_argument_default) % ",\n")
+ << scope_tab << ")\n"
+ << scope_tab << "{\n"
+ << *(scope_tab << scope_tab << field_argument_assignment << ";\n")
+ << scope_tab << "}\n")
+ .generate(sink, std::make_tuple(struct_name, struct_name, struct_.fields, struct_.fields), context))
+ return false;
+ }
if(!as_generator("}\n").generate(sink, attributes::unused, context)) return false;
@@ -85,16 +95,17 @@ struct struct_internal_definition_generator
{
if (!as_generator
(
+ "///<summary>Internal wrapper for struct " << string << ".</summary>\n"
"[StructLayout(LayoutKind.Sequential)]\n"
- "internal struct " << string << "\n{\n"
+ "public struct " << string << "\n{\n"
)
- .generate(sink, binding_struct_internal_name(struct_), context))
+ .generate(sink, std::make_tuple<>(binding_struct_name(struct_), binding_struct_internal_name(struct_)), context))
return false;
// iterate struct fields
for (auto const& field : struct_.fields)
{
- auto field_name = to_field_name(field.name);
+ auto field_name = name_helpers::to_field_name(field.name);
auto klass = efl::eina::get<attributes::klass_name>(&field.type.original_type);
auto regular = efl::eina::get<attributes::regular_type_def>(&field.type.original_type);
@@ -123,6 +134,24 @@ struct struct_internal_definition_generator
return false;
}
+ auto external_name = binding_struct_name(struct_);
+ auto internal_name = binding_struct_internal_name(struct_);
+
+ if(!as_generator(
+ scope_tab << "///<summary>Implicit conversion to the internal/marshalling representation.</summary>\n"
+ << scope_tab << "public static implicit operator " << string << "(" << string << " struct_)\n"
+ << scope_tab << "{\n"
+ << scope_tab << scope_tab << "return " << string << "_StructConversion.ToExternal(struct_);\n"
+ << scope_tab << "}\n"
+ << scope_tab << "///<summary>Implicit conversion to the managed representation.</summary>\n"
+ << scope_tab << "public static implicit operator " << string << "(" << string << " struct_)\n"
+ << scope_tab << "{\n"
+ << scope_tab << scope_tab << "return " << string << "_StructConversion.ToInternal(struct_);\n"
+ << scope_tab << "}\n"
+ ).generate(sink, std::make_tuple(external_name, internal_name, external_name,
+ internal_name, external_name, external_name), context))
+ return false;
+
if(!as_generator("}\n").generate(sink, attributes::unused, context)) return false;
return true;
@@ -137,7 +166,7 @@ struct to_internal_field_convert_generator
template <typename OutputIterator, typename Context>
bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const
{
- auto field_name = to_field_name(field.name);
+ auto field_name = name_helpers::to_field_name(field.name);
auto regular = efl::eina::get<attributes::regular_type_def>(&field.type.original_type);
auto klass = efl::eina::get<attributes::klass_name>(&field.type.original_type);
auto complex = efl::eina::get<attributes::complex_type_def>(&field.type.original_type);
@@ -163,17 +192,17 @@ struct to_internal_field_convert_generator
.generate(sink, std::make_tuple(field_name, field_name), context))
return false;
}
- else if (field.type.is_ptr && need_pointer_conversion(regular))
+ else if (field.type.is_ptr && helpers::need_pointer_conversion(regular) && !helpers::need_struct_conversion(regular))
{
if (!as_generator(
scope_tab << scope_tab << "_internal_struct." << string << " = eina.PrimitiveConversion.ManagedToPointerAlloc(_external_struct." << string << ");\n")
.generate(sink, std::make_tuple(field_name, field_name), context))
return false;
}
- else if (need_struct_conversion(regular))
+ else if (helpers::need_struct_conversion(regular))
{
if (!as_generator(
- scope_tab << scope_tab << "_internal_struct." << string << " = " << type << "_StructConvertion.ToInternal(_external_struct." << string << ");\n")
+ scope_tab << scope_tab << "_internal_struct." << string << " = " << type << "_StructConversion.ToInternal(_external_struct." << string << ");\n")
.generate(sink, std::make_tuple(field_name, field.type, field_name), context))
return false;
}
@@ -211,7 +240,7 @@ struct to_internal_field_convert_generator
else if (field.type.c_type == "Eina_Value *" || field.type.c_type == "const Eina_Value *")
{
if (!as_generator(
- scope_tab << scope_tab << "_internal_struct." << string << " = _external_struct." << string << ".Handle;\n"
+ scope_tab << scope_tab << "_internal_struct." << string << " = _external_struct." << string << ".NativeHandle;\n"
).generate(sink, std::make_tuple(field_name, field_name), context))
return false;
}
@@ -231,20 +260,22 @@ struct to_external_field_convert_generator
template <typename OutputIterator, typename Context>
bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const
{
- auto field_name = to_field_name(field.name);
+ auto field_name = name_helpers::to_field_name(field.name);
auto regular = efl::eina::get<attributes::regular_type_def>(&field.type.original_type);
auto klass = efl::eina::get<attributes::klass_name>(&field.type.original_type);
auto complex = efl::eina::get<attributes::complex_type_def>(&field.type.original_type);
if (klass)
{
+ auto interface_name = name_helpers::klass_full_interface_name(*klass);
+ auto concrete_name = name_helpers::klass_full_concrete_name(*klass);
if (!as_generator(
"\n"
<< scope_tab << scope_tab << "_external_struct." << string
- << " = (" << type << ") System.Activator.CreateInstance(typeof("
- << type << "Concrete), new System.Object[] {_internal_struct." << string << "});\n"
+ << " = (" << interface_name << ") System.Activator.CreateInstance(typeof("
+ << concrete_name << "), new System.Object[] {_internal_struct." << string << "});\n"
<< scope_tab << scope_tab << "efl.eo.Globals.efl_ref(_internal_struct." << string << ");\n\n")
- .generate(sink, std::make_tuple(field_name, field.type, field.type, field_name, field_name), context))
+ .generate(sink, std::make_tuple(field_name, field_name, field_name), context))
return false;
}
else if (field.type.c_type == "Eina_Binbuf *" || field.type.c_type == "const Eina_Binbuf *")
@@ -273,17 +304,17 @@ struct to_external_field_convert_generator
.generate(sink, std::make_tuple(field_name, field.type, field_name), context))
return false;
}
- else if (field.type.is_ptr && need_pointer_conversion(regular))
+ else if (field.type.is_ptr && helpers::need_pointer_conversion(regular) && !helpers::need_struct_conversion(regular))
{
if (!as_generator(
scope_tab << scope_tab << "_external_struct." << string << " = eina.PrimitiveConversion.PointerToManaged<" << type << ">(_internal_struct." << string << ");\n")
.generate(sink, std::make_tuple(field_name, field.type, field_name), context))
return false;
}
- else if (need_struct_conversion(regular))
+ else if (helpers::need_struct_conversion(regular))
{
if (!as_generator(
- scope_tab << scope_tab << "_external_struct." << string << " = " << type << "_StructConvertion.ToExternal(_internal_struct." << string << ");\n")
+ scope_tab << scope_tab << "_external_struct." << string << " = " << type << "_StructConversion.ToExternal(_internal_struct." << string << ");\n")
.generate(sink, std::make_tuple(field_name, field.type, field_name), context))
return false;
}
@@ -314,7 +345,7 @@ struct to_external_field_convert_generator
else if (field.type.c_type == "Eina_Value *" || field.type.c_type == "const Eina_Value *")
{
if (!as_generator(
- scope_tab << scope_tab << "_external_struct." << string << " = new eina.Value(_internal_struct." << string << ", eina.ValueOwnership.Unmanaged);\n"
+ scope_tab << scope_tab << "_external_struct." << string << " = new eina.Value(_internal_struct." << string << ", eina.Ownership.Unmanaged);\n"
).generate(sink, std::make_tuple(field_name, field_name), context))
return false;
}
@@ -337,7 +368,7 @@ struct struct_binding_conversion_functions_generator
// Open conversion class
if (!as_generator
(
- "internal static class " << string << "_StructConvertion\n{\n"
+ "public static class " << string << "_StructConversion\n{\n"
)
.generate(sink, struct_.cxx_name, context))
return false;
@@ -411,13 +442,11 @@ struct struct_entities_generator
template <typename OutputIterator, typename Context>
bool generate(OutputIterator sink, attributes::struct_def const& struct_, Context const& context) const
{
- if (is_struct_blacklisted(struct_))
+ if (blacklist::is_struct_blacklisted(struct_))
return true;
- std::vector<std::string> cpp_namespaces = escape_namespace(attributes::cpp_namespaces(struct_.namespaces));
- auto open_namespace = *("namespace " << string << " { ") << "\n";
- if (!as_generator(open_namespace).generate(sink, cpp_namespaces, add_lower_case_context(context)))
+ if (!name_helpers::open_namespaces(sink, struct_.namespaces, context))
return false;
if (!struct_definition.generate(sink, struct_, context))
@@ -429,10 +458,8 @@ struct struct_entities_generator
if (!struct_binding_conversion_functions.generate(sink, struct_, context))
return false;
- auto close_namespace = *(lit("} ")) << "\n";
- if(!as_generator(close_namespace).generate(sink, cpp_namespaces, context)) return false;
+ return name_helpers::close_namespaces(sink, struct_.namespaces, context);
- return true;
}
} const struct_entities {};
diff --git a/src/bin/eolian_mono/eolian/mono/struct_fields.hh b/src/bin/eolian_mono/eolian/mono/struct_fields.hh
new file mode 100644
index 0000000000..42a20e1aba
--- /dev/null
+++ b/src/bin/eolian_mono/eolian/mono/struct_fields.hh
@@ -0,0 +1,67 @@
+#ifndef EOLIAN_MONO_STRUCT_FIELDS_HH
+#define EOLIAN_MONO_STRUCT_FIELDS_HH
+
+#include "grammar/generator.hpp"
+#include "grammar/klass_def.hpp"
+#include "grammar/indentation.hpp"
+#include "grammar/list.hpp"
+#include "grammar/alternative.hpp"
+#include "name_helpers.hh"
+#include "type.hh"
+#include "using_decl.hh"
+#include "documentation.hh"
+
+namespace eolian_mono {
+
+struct field_argument_default_generator
+{
+ template<typename OutputIterator, typename Context>
+ bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const
+ {
+ if (!as_generator(type << " " << string << "=default(" << type << ")")
+ .generate(sink, std::make_tuple(field.type, name_helpers::to_field_name(field.name), field.type), context))
+ return false;
+ return true;
+ }
+} const field_argument_default {};
+
+struct field_argument_assignment_generator
+{
+ template<typename OutputIterator, typename Context>
+ bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const
+ {
+ if (!as_generator("this." << string << " = " << string)
+ .generate(sink, std::make_tuple(name_helpers::to_field_name(field.name), name_helpers::to_field_name(field.name)), context))
+ return false;
+ return true;
+ }
+} const field_argument_assignment {};
+
+}
+
+namespace efl { namespace eolian { namespace grammar {
+
+template<>
+struct is_eager_generator< ::eolian_mono::field_argument_default_generator> : std::true_type {};
+template<>
+struct is_generator< ::eolian_mono::field_argument_default_generator> : std::true_type {};
+
+template<>
+struct is_eager_generator< ::eolian_mono::field_argument_assignment_generator> : std::true_type {};
+template<>
+struct is_generator< ::eolian_mono::field_argument_assignment_generator> : std::true_type {};
+
+namespace type_traits {
+
+template <>
+struct attributes_needed< ::eolian_mono::field_argument_default_generator> : std::integral_constant<int, 1> {};
+
+template <>
+struct attributes_needed< ::eolian_mono::field_argument_assignment_generator> : std::integral_constant<int, 1> {};
+
+}
+
+} } }
+
+#endif
+
diff --git a/src/bin/eolian_mono/eolian/mono/type_impl.hh b/src/bin/eolian_mono/eolian/mono/type_impl.hh
index 9b56805b99..09c4bc198d 100644
--- a/src/bin/eolian_mono/eolian/mono/type_impl.hh
+++ b/src/bin/eolian_mono/eolian/mono/type_impl.hh
@@ -4,7 +4,7 @@
#include "grammar/generator.hpp"
#include "grammar/klass_def.hpp"
#include "grammar/case.hpp"
-#include "namespace.hh"
+#include "name_helpers.hh"
namespace eolian_mono {
@@ -115,7 +115,7 @@ struct visitor_generate
r.base_type = " void";
return r;
}}
- , {"Error", nullptr, [&] // Eina.Error
+ , {"Eina.Error", nullptr, [&] // Eina.Error
{
return regular_type_def{" eina.Error", regular.base_qualifier, {}};
}} // TODO
@@ -137,6 +137,10 @@ struct visitor_generate
r.base_qualifier.qualifier ^= qualifier_info::is_ref;
return replace_base_type(r, " System.String");
}}
+ , {"strbuf", nullptr, [&]
+ {
+ return regular_type_def{" eina.Strbuf", regular.base_qualifier, {}};
+ }}
, {"any_value", true, [&]
{ return regular_type_def{" eina.Value", regular.base_qualifier, {}};
}}
@@ -147,24 +151,12 @@ struct visitor_generate
{ return regular_type_def{" eina.Value", regular.base_qualifier, {}};
}} // FIXME add proper support for any_value_ptr
};
- // if(regular.base_type == "void_ptr")
- // {
- // if(regular.base_qualifier & qualifier_info::is_ref)
- // throw std::runtime_error("ref of void_ptr is invalid");
- // return as_generator
- // (
- // lit("void") << (regular.base_qualifier & qualifier_info::is_const ? " const" : "")
- // << "*"
- // << (is_out ? "&" : "")
- // )
- // .generate(sink, attributes::unused, *context);
- // }
- // else
+ std::string full_type_name = name_helpers::type_full_eolian_name(regular);
if(eina::optional<bool> b = call_match
(match_table
, [&] (match const& m)
{
- return (!m.name || *m.name == regular.base_type)
+ return (!m.name || *m.name == regular.base_type || *m.name == full_type_name)
&& (!m.has_own || *m.has_own == (bool)(regular.base_qualifier & qualifier_info::is_own))
;
}
@@ -229,7 +221,7 @@ struct visitor_generate
// else
// return false;
// }
- // else if(Eolian_Typedecl const* typedecl = eolian_typedecl_struct_get_by_name(c_type.c_str()))
+ // else if(Eolian_Typedecl const* typedecl = eolian_state_struct_by_name_get(c_type.c_str()))
// {
// return as_generator
// (
@@ -240,40 +232,12 @@ struct visitor_generate
// }
else
{
- // as_generator(" Generating: " << *(lower_case[string] << ".") << string << "\n")
- // .generate(std::ostream_iterator<char>(std::cerr), std::make_tuple(eolian_mono::escape_namespace(regular.namespaces), regular.base_type), *context);
- if(as_generator
- (
- *(lower_case[string] << ".")
- << string
- // << (regular.base_qualifier & qualifier_info::is_const
- // || (regular.base_qualifier & qualifier_info::is_ref
- // && !is_return && !is_out)
- // ? /*" const"*/ "" : "")
- /*<< (regular.base_qualifier & qualifier_info::is_ref? "&" : "")*/
- )
- .generate(sink, std::make_tuple(eolian_mono::escape_namespace(regular.namespaces), regular.base_type), *context))
- return true;
- else
- return false;
+ return as_generator(string).generate(sink, name_helpers::type_full_managed_name(regular), *context);
}
}
bool operator()(attributes::klass_name klass) const
{
- // as_generator(" Generating: " << *(lower_case[string] << ".") << string << "\n")
- // .generate(std::ostream_iterator<char>(std::cerr), std::make_tuple(attributes::cpp_namespaces(klass.namespaces), klass.eolian_name), *context);
- // if(klass.namespaces.size() == 1
- // && klass.namespaces[0] == "Eina"
- // && klass.eolian_name == "Error")
- // return
- // as_generator(" System.IntPtr")
- // .generate(sink, attributes::unused, *context);
- return
- as_generator(*(lower_case[string] << ".") << string)
- .generate(sink, std::make_tuple(eolian_mono::escape_namespace(klass.namespaces), klass.eolian_name), *context)
- // && (!(klass.base_qualifier & qualifier_info::is_ref)
- // || as_generator("&").generate(sink, attributes::unused, *context))
- ;
+ return as_generator(string).generate(sink, name_helpers::klass_full_interface_name(klass), *context);
}
bool operator()(attributes::complex_type_def const& complex) const
{
@@ -318,19 +282,11 @@ struct visitor_generate
complex_type_def c = complex;
c.outer.base_type = "eina.Hash";
return c;
- }}
- , {"promise", nullptr, nullptr, [&]
- {
- return replace_outer
- (complex, regular_type_def{" ::efl::promise", complex.outer.base_qualifier, {}});
- }
- }
+ }}
, {"future", nullptr, nullptr, [&]
{
- (*this)(regular_type_def{" int", complex.outer.base_qualifier, {}});
+ (*this)(regular_type_def{" eina.Future", complex.outer.base_qualifier, {}});
return attributes::type_def::variant_type();
- // return replace_outer
- // (complex, regular_type_def{" ::efl::shared_future", complex.outer.base_qualifier, {}});
}
}
, {"iterator", nullptr, nullptr, [&]
@@ -342,10 +298,9 @@ struct visitor_generate
}
, {"accessor", nullptr, nullptr, [&]
{
- (*this)(regular_type_def{" int", complex.outer.base_qualifier, {}});
- return attributes::type_def::variant_type();
- // return replace_outer
- // (complex, regular_type_def{" ::efl::eina::accessor", complex.outer.base_qualifier, {}});
+ complex_type_def c = complex;
+ c.outer.base_type = "eina.Accessor";
+ return c;
}
}
};
diff --git a/src/bin/eolian_mono/eolian/mono/utils.hh b/src/bin/eolian_mono/eolian/mono/utils.hh
index 3e48e518b5..0e1c2efc29 100644
--- a/src/bin/eolian_mono/eolian/mono/utils.hh
+++ b/src/bin/eolian_mono/eolian/mono/utils.hh
@@ -2,21 +2,67 @@
#define EOLIAN_MONO_UTILS_HPP
#include <string>
+#include <sstream>
+#include <iterator>
#include <algorithm>
+/* Compared to the helpers.hh and name_helpers headers, these functions are
+ * lower level, not dealing with binding-specific structures or knowledge */
+
namespace eolian_mono { namespace utils {
// Helper method to avoid multiple as_generator calls when mixing case strings
- std::string to_uppercase(std::string s)
+ inline std::string to_uppercase(std::string s)
{
std::transform(s.begin(), s.end(), s.begin(), ::toupper);
return s;
}
- std::string to_lowercase(std::string s)
+ inline std::string to_lowercase(std::string s)
{
std::transform(s.begin(), s.end(), s.begin(), ::tolower);
return s;
}
+ inline std::string capitalize(std::string const &s)
+ {
+ std::string ret = s;
+ ret[0] = std::toupper(ret[0]);
+ return ret;
+ }
+
+ std::vector<std::string> split(std::string const &input, char delim)
+ {
+ std::stringstream ss(input);
+ std::string name;
+ std::vector<std::string> names;
+
+ while (std::getline(ss, name, delim))
+ {
+ if (!name.empty())
+ names.push_back(name);
+ }
+ return names;
+ }
+
+ std::string to_pascal_case(const std::vector<std::string> &names, std::string const& delim="")
+ {
+ std::vector<std::string> outv(names.size());
+ std::stringstream osstream;
+
+ std::transform(names.begin(), names.end(), outv.begin(),
+ [](std::string name) {
+ name[0] = std::toupper(name[0]);
+ return name;
+ });
+
+ std::copy(outv.begin(), outv.end(), std::ostream_iterator<std::string>(osstream, delim.c_str()));
+
+ std::string ret = osstream.str();
+
+ if (delim != "")
+ ret.pop_back(); // We could implement an infix_iterator but this pop is enough for now.
+
+ return ret;
+ }
} }
#endif
diff --git a/src/bin/eolian_mono/eolian_mono.cc b/src/bin/eolian_mono/eolian_mono.cc
index db50906318..9bb5263fbf 100644
--- a/src/bin/eolian_mono/eolian_mono.cc
+++ b/src/bin/eolian_mono/eolian_mono.cc
@@ -23,6 +23,8 @@
#include <Eina.hh>
#include <Eolian_Cxx.hh>
+#include <eolian/mono/logging.hh>
+#include <eolian/mono/name_helpers.hh>
#include <eolian/mono/klass.hh>
#include <eolian/mono/enum_definition.hh>
#include <eolian/mono/struct_definition.hh>
@@ -30,6 +32,7 @@
#include <eolian/mono/marshall_type_impl.hh>
#include <eolian/mono/marshall_annotation.hh>
#include <eolian/mono/function_pointer.hh>
+#include <eolian/mono/alias_definition.hh>
namespace eolian_mono {
@@ -40,15 +43,13 @@ struct options_type
std::string in_file;
std::string out_file;
std::string dllimport;
- mutable Eolian* state;
+ mutable Eolian_State* state;
mutable Eolian_Unit const* unit;
int v_major;
int v_minor;
std::map<const std::string, std::string> references_map;
};
-efl::eina::log_domain domain("eolian_mono");
-
// Parses a CSV file in the format 'filename,library' (without trimming spaces around ',')
static std::vector<std::pair<std::string, std::string> >
parse_reference(std::string filename)
@@ -99,8 +100,8 @@ run(options_type const& opts)
const Eolian_Typedecl *tp = NULL;
char* dup = strdup(opts.in_file.c_str());
std::string basename_input = basename(dup);
- klass = ::eolian_class_get_by_file(opts.unit, basename_input.c_str());
- aliases= ::eolian_typedecl_aliases_get_by_file(opts.unit, basename_input.c_str());
+ klass = ::eolian_state_class_by_file_get(opts.state, basename_input.c_str());
+ aliases= ::eolian_state_aliases_by_file_get(opts.state, basename_input.c_str());
free(dup);
std::string class_file_name = opts.out_file;
@@ -137,22 +138,20 @@ run(options_type const& opts)
efl::eolian::grammar::context_null());
EINA_ITERATOR_FOREACH(aliases, tp)
{
- if (eolian_typedecl_type_get(tp) != EOLIAN_TYPEDECL_FUNCTION_POINTER)
- continue;
-
- const Eolian_Function *fp = eolian_typedecl_function_pointer_get(tp);
- efl::eolian::grammar::attributes::function_def function_def(fp, EOLIAN_FUNCTION_POINTER, opts.unit);
- std::vector<std::string> namespaces;
-
- for (efl::eina::iterator<const char> namespace_iterator(::eolian_typedecl_namespaces_get(tp)), namespace_last; namespace_iterator != namespace_last; ++namespace_iterator)
+ if (eolian_typedecl_type_get(tp) == EOLIAN_TYPEDECL_FUNCTION_POINTER)
{
- namespaces.push_back(&*namespace_iterator);
+ const Eolian_Function *fp = eolian_typedecl_function_pointer_get(tp);
+ efl::eolian::grammar::attributes::function_def function_def(fp, EOLIAN_FUNCTION_POINTER, tp, opts.unit);
+ if (!eolian_mono::function_pointer.generate(iterator, function_def, context))
+ throw std::runtime_error("Failed to generate function pointer wrapper");
}
-
- if (!eolian_mono::function_pointer
- .generate(iterator, function_def, escape_namespace(namespaces), context))
+ else // Regular aliases
{
- throw std::runtime_error("Failed to generate function pointer wrapper");
+ efl::eolian::grammar::attributes::alias_def alias(tp, opts.unit);
+ auto alias_cxt = context_add_tag(class_context{class_context::alias}, context);
+
+ if (!eolian_mono::alias_definition.generate(iterator, alias, alias_cxt))
+ throw std::runtime_error("Failed to generate alias.");
}
}
@@ -167,36 +166,35 @@ run(options_type const& opts)
throw std::runtime_error("Failed to generate class");
}
}
- //else
- {
- for (efl::eina::iterator<const Eolian_Typedecl> enum_iterator( ::eolian_typedecl_enums_get_by_file(opts.unit, basename_input.c_str()))
- , enum_last; enum_iterator != enum_last; ++enum_iterator)
- {
- efl::eolian::grammar::attributes::enum_def enum_(&*enum_iterator, opts.unit);
- if (!eolian_mono::enum_definition.generate(iterator, enum_, efl::eolian::grammar::context_null()))
- {
- throw std::runtime_error("Failed to generate enum");
- }
- }
- for (efl::eina::iterator<const Eolian_Typedecl> struct_iterator( ::eolian_typedecl_structs_get_by_file(opts.unit, basename_input.c_str()))
- , struct_last; struct_iterator != struct_last; ++struct_iterator)
- {
- efl::eolian::grammar::attributes::struct_def struct_(&*struct_iterator, opts.unit);
- auto structs_cxt = context_add_tag(class_context{class_context::structs}, context);
- if (!eolian_mono::struct_entities.generate(iterator, struct_, structs_cxt))
- {
- throw std::runtime_error("Failed to generate struct");
- }
- }
+ // Enums
+ for (efl::eina::iterator<const Eolian_Typedecl> enum_iterator( ::eolian_state_enums_by_file_get(opts.state, basename_input.c_str()))
+ , enum_last; enum_iterator != enum_last; ++enum_iterator)
+ {
+ efl::eolian::grammar::attributes::enum_def enum_(&*enum_iterator, opts.unit);
+ if (!eolian_mono::enum_definition.generate(iterator, enum_, efl::eolian::grammar::context_null()))
+ {
+ throw std::runtime_error("Failed to generate enum");
+ }
+ }
- }
+ // Structs
+ for (efl::eina::iterator<const Eolian_Typedecl> struct_iterator( ::eolian_state_structs_by_file_get(opts.state, basename_input.c_str()))
+ , struct_last; struct_iterator != struct_last; ++struct_iterator)
+ {
+ efl::eolian::grammar::attributes::struct_def struct_(&*struct_iterator, opts.unit);
+ auto structs_cxt = context_add_tag(class_context{class_context::structs}, context);
+ if (!eolian_mono::struct_entities.generate(iterator, struct_, structs_cxt))
+ {
+ throw std::runtime_error("Failed to generate struct");
+ }
+ }
}
static void
state_init(options_type const& opts)
{
- Eolian *eos = ::eolian_new();
+ Eolian_State *eos = ::eolian_state_new();
if (!eos)
{
EINA_CXX_DOM_LOG_ERR(eolian_mono::domain)
@@ -212,13 +210,13 @@ database_load(options_type const& opts)
{
for (auto src : opts.include_dirs)
{
- if (!::eolian_directory_scan(opts.state, src.c_str()))
+ if (!::eolian_state_directory_add(opts.state, src.c_str()))
{
EINA_CXX_DOM_LOG_WARN(eolian_mono::domain)
<< "Couldn't load eolian from '" << src << "'.";
}
}
- if (!::eolian_all_eot_files_parse(opts.state))
+ if (!::eolian_state_all_eot_files_parse(opts.state))
{
EINA_CXX_DOM_LOG_ERR(eolian_mono::domain)
<< "Eolian failed parsing eot files";
@@ -230,7 +228,7 @@ database_load(options_type const& opts)
<< "No input file.";
assert(false && "Error parsing input file");
}
- if (!::eolian_file_parse(opts.state, opts.in_file.c_str()))
+ if (!::eolian_state_file_parse(opts.state, opts.in_file.c_str()))
{
EINA_CXX_DOM_LOG_ERR(eolian_mono::domain)
<< "Failed parsing: " << opts.in_file << ".";
diff --git a/src/bin/evas/evas_cserve2.h b/src/bin/evas/evas_cserve2.h
index cc3623e472..1eacb33bd8 100644
--- a/src/bin/evas/evas_cserve2.h
+++ b/src/bin/evas/evas_cserve2.h
@@ -1,6 +1,8 @@
#ifndef _EVAS_CSERVE2_H
#define _EVAS_CSERVE2_H
+#include <sys/types.h>
+
#include <Eina.h>
#include "evas_cs2.h"
diff --git a/src/bin/evil/evil_suite.c b/src/bin/evil/evil_suite.c
deleted file mode 100644
index 07b775875f..0000000000
--- a/src/bin/evil/evil_suite.c
+++ /dev/null
@@ -1,220 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#undef WIN32_LEAN_AND_MEAN
-
-#include "Evil.h"
-#include "evil_suite.h"
-#include "evil_test_dlfcn.h"
-#include "evil_test_environment.h"
-#include "evil_test_gettimeofday.h"
-#include "evil_test_link.h"
-#include "evil_test_mkstemp.h"
-#include "evil_test_pipe.h"
-#include "evil_test_print.h"
-#include "evil_test_realpath.h"
-#include "evil_test_util.h"
-
-
-typedef int(*function)(suite *s);
-
-struct test
-{
- const char *name;
- function fct;
-};
-
-struct list
-{
- void *data;
- int succeed;
- list *next;
-};
-
-struct suite
-{
- LARGE_INTEGER freq;
- LARGE_INTEGER start;
- LARGE_INTEGER end;
-
- list *first;
- list *l;
-
- int tests_count;
- int tests_success;
-};
-
-
-static suite *
-suite_new(void)
-{
- suite *s;
-
- s = (suite *)malloc(sizeof(suite));
- if (!s) return NULL;
-
- if (!QueryPerformanceFrequency(&s->freq))
- {
- free(s);
- return NULL;
- }
-
- s->first = NULL;
- s->l = NULL;
-
- s->tests_count = 0;
- s->tests_success = 0;
-
- return s;
-}
-
-static void
-suite_del(suite *s)
-{
- list *l;
- list *tmp;
-
- if (!s) return;
-
- l = s->first;
- while (l)
- {
- tmp = l->next;
- free(l->data);
- free(l);
- l = tmp;
- }
-
- free(s);
-}
-
-void
-suite_time_start(suite *s)
-{
- QueryPerformanceCounter(&s->start);
-}
-
-void
-suite_time_stop(suite *s)
-{
- QueryPerformanceCounter(&s->end);
-}
-
-double
-suite_time_get(suite *s)
-{
- return (double)(s->end.QuadPart - s->start.QuadPart) / (double)s->freq.QuadPart;
-}
-
-static void
-suite_test_add(suite *s, const char *name, function fct)
-{
- test *t;
- list *l;
-
- t = (test *)malloc(sizeof(test));
- if (!t) return;
-
- l = (list *)malloc(sizeof(list));
- if (!l)
- {
- free(t);
- return;
- }
-
- t->name = name;
- t->fct = fct;
-
- l->data = t;
- l->succeed = 0;
- l->next = NULL;
-
- if (!s->first) s->first = l;
-
- if (!s->l)
- s->l = l;
- else
- {
- s->l->next = l;
- s->l =l;
- }
-}
-
-static void
-suite_run(suite *s)
-{
- list *l;
-
- l = s->first;
- while (l)
- {
- test *t;
-
- t = (test *)l->data;
- l->succeed = t->fct(s);
- printf("%s test: %s\n", t->name, l->succeed ? "success" : "failure");
- s->tests_count++;
- if (l->succeed)
- s->tests_success++;
- l = l->next;
- }
-}
-
-static void
-suite_show(suite *s)
-{
- printf ("\n%d/%d tests passed (%d%%)\n",
- s->tests_success,
- s->tests_count,
- (100 * s->tests_success) / s->tests_count);
-}
-
-int
-main(void)
-{
- test tests[] = {
- { "dlfcn ", test_dlfcn },
- { "environment ", test_environment },
- { "gettimeofday", test_gettimeofday },
- { "link ", test_link },
- { "mkstemp ", test_mkstemp },
- { "pipe ", test_pipe },
- { "print ", test_print },
- { "realpath ", test_realpath },
- { "util ", test_util },
-/* { "memcpy ", test_memcpy }, */
- { NULL, NULL },
- };
- suite *s;
- int i;
-
- if (!evil_init())
- return EXIT_FAILURE;
-
- s = suite_new();
- if (!s)
- {
- evil_shutdown();
- return EXIT_FAILURE;
- }
-
- for (i = 0; tests[i].name; ++i)
- {
- suite_test_add(s, tests[i].name, tests[i].fct);
- }
-
- suite_run(s);
-
- suite_show(s);
-
- suite_del(s);
- evil_shutdown();
-
- return EXIT_SUCCESS;
-}
diff --git a/src/bin/evil/evil_suite.h b/src/bin/evil/evil_suite.h
deleted file mode 100644
index d3284b4fbb..0000000000
--- a/src/bin/evil/evil_suite.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef __EVIL_SUITE_H__
-#define __EVIL_SUITE_H__
-
-
-typedef struct test test;
-typedef struct list list;
-typedef struct suite suite;
-
-void suite_time_start(suite *s);
-void suite_time_stop(suite *s);
-double suite_time_get(suite *s);
-
-
-#endif /* __EVIL_SUITE_H__ */
diff --git a/src/bin/evil/evil_test_dlfcn.c b/src/bin/evil/evil_test_dlfcn.c
deleted file mode 100644
index 605f5c4b68..0000000000
--- a/src/bin/evil/evil_test_dlfcn.c
+++ /dev/null
@@ -1,79 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#include <string.h>
-
-#include <Evil.h>
-
-#include "evil_suite.h"
-#include "evil_test_dlfcn.h"
-
-
-typedef int (*_evil_init)(void);
-typedef int (*_evil_shutdwon)(void);
-
-
-static int
-test_dlfcn_test_dlopen(void)
-{
- void *handle;
-
- handle = dlopen("libevil-1.dll", 0);
- if (!handle)
- return 0;
-
- if (dlclose(handle))
- return 0;
-
- return 1;
-}
-
-static int
-test_dlfcn_test_dlsym(void)
-{
- void *handle;
- _evil_init sym_init;
- _evil_shutdwon sym_shutdown;
-
- handle = dlopen("libevil-1.dll", 0);
- if (!handle)
- return 0;
-
- sym_init = dlsym(handle, "evil_init");
- if (!sym_init)
- {
- dlclose(handle);
- return 0;
- }
-
- sym_shutdown = dlsym(handle, "evil_shutdown");
- if (!sym_shutdown)
- {
- dlclose(handle);
- return 0;
- }
-
- if (dlclose(handle))
- return 0;
-
- return 1;
-}
-
-static int
-test_dlfcn_tests_run(suite *s)
-{
- int res;
-
- res = test_dlfcn_test_dlopen();
- res &= test_dlfcn_test_dlsym();
-
- return res;
-}
-
-int
-test_dlfcn(suite *s)
-{
-
- return test_dlfcn_tests_run(s);
-}
diff --git a/src/bin/evil/evil_test_dlfcn.h b/src/bin/evil/evil_test_dlfcn.h
deleted file mode 100644
index 0c9bce689e..0000000000
--- a/src/bin/evil/evil_test_dlfcn.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __EVIL_TEST_DLFCN_H__
-#define __EVIL_TEST_DLFCN_H__
-
-
-int test_dlfcn(suite *s);
-
-
-#endif /* __EVIL_TEST_DLFCN_H__ */
diff --git a/src/bin/evil/evil_test_environment.c b/src/bin/evil/evil_test_environment.c
deleted file mode 100644
index 0d31b7912a..0000000000
--- a/src/bin/evil/evil_test_environment.c
+++ /dev/null
@@ -1,178 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#include <string.h>
-
-#include <Evil.h>
-
-#include "evil_suite.h"
-#include "evil_test_environment.h"
-
-
-static int
-test_env_test_setenv_NULL(void)
-{
- char *val;
- int res;
-
- res = setenv("EVIL_TEST_ENV", NULL, 1);
- if (res < 0)
- return 0;
-
- val = getenv("EVIL_TEST_ENV");
-
- return val ? 0 : 1;
-}
-
-static int
-test_env_test_setenv_NULL_after_set(void)
-{
- char *val;
- int res;
-
- res = setenv("EVIL_TEST_ENV", "val", 1);
- if (res < 0)
- return 0;
-
- val = getenv("EVIL_TEST_ENV");
- if (!val)
- return 0;
-
- if (strcmp(val, "val"))
- return 0;
-
- res = setenv("EVIL_TEST_ENV", NULL, 1);
- if (res < 0)
- return 0;
-
- val = getenv("EVIL_TEST_ENV");
-
- return val ? 0 : 1;
-}
-
-static int
-test_env_test_getenv_one(void)
-{
- char *val;
- int res;
-
- res = setenv("EVIL_TEST_ENV", "val", 1);
- if (res < 0)
- return 0;
-
- val = getenv("EVIL_TEST_ENV");
- if (!val)
- return 0;
-
- if (strcmp(val, "val"))
- return 0;
-
- return 1;
-}
-
-static int
-test_env_test_getenv_two(void)
-{
- char *val;
- int res;
-
- res = setenv("EVIL_TEST_ENV1", "val1", 1);
- if (res < 0)
- return 0;
-
- res = setenv("EVIL_TEST_ENV2", "val2", 1);
- if (res < 0)
- return 0;
-
- val = getenv("EVIL_TEST_ENV1");
- if (!val)
- return 0;
- if (strcmp(val, "val1"))
- return 0;
-
- val = getenv("EVIL_TEST_ENV2");
- if (!val)
- return 0;
-
- if (strcmp(val, "val2"))
- return 0;
-
- return 1;
-}
-
-static int
-test_env_test_getenv_two_swapped(void)
-{
- char *val;
- int res;
-
- res = setenv("EVIL_TEST_ENV1", "val1", 1);
- if (res < 0)
- return 0;
-
- res = setenv("EVIL_TEST_ENV2", "val2", 1);
- if (res < 0)
- return 0;
-
- val = getenv("EVIL_TEST_ENV2");
- if (!val)
- return 0;
- if (strcmp(val, "val2"))
- return 0;
-
- val = getenv("EVIL_TEST_ENV1");
- if (!val)
- return 0;
-
- if (strcmp(val, "val1"))
- return 0;
-
- return 1;
-}
-
-static int
-test_env_test_unsetenv(void)
-{
- char *val;
- int res;
-
- res = setenv("EVIL_TEST_ENV", "val", 1);
- if (res < 0)
- return 0;
-
- val = getenv("EVIL_TEST_ENV");
- if (!val)
- return 0;
-
- if (unsetenv("EVIL_TEST_ENV") != 0)
- return 0;
-
- val = getenv("EVIL_TEST_ENV");
- if (val)
- return 0;
-
- return 1;
-}
-
-static int
-test_env_tests_run(suite *s)
-{
- int res;
-
- res = test_env_test_setenv_NULL();
- res &= test_env_test_setenv_NULL_after_set();
- res &= test_env_test_getenv_one();
- res &= test_env_test_getenv_two();
- res &= test_env_test_getenv_two_swapped();
- res &= test_env_test_unsetenv();
-
- return res;
-}
-
-int
-test_environment(suite *s)
-{
-
- return test_env_tests_run(s);
-}
diff --git a/src/bin/evil/evil_test_environment.h b/src/bin/evil/evil_test_environment.h
deleted file mode 100644
index 763ee401b1..0000000000
--- a/src/bin/evil/evil_test_environment.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __EVIL_TEST_ENVIRONMENT_H__
-#define __EVIL_TEST_ENVIRONMENT_H__
-
-
-int test_environment(suite *s);
-
-
-#endif /* __EVIL_TEST_ENVIRONMENT_H__ */
diff --git a/src/bin/evil/evil_test_gettimeofday.c b/src/bin/evil/evil_test_gettimeofday.c
deleted file mode 100644
index dc9656e83d..0000000000
--- a/src/bin/evil/evil_test_gettimeofday.c
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#include <string.h>
-#include <math.h>
-#include <sys/time.h>
-
-#include <Evil.h>
-
-#include "evil_suite.h"
-#include "evil_test_gettimeofday.h"
-
-static int
-test_time_test_gettimeofday(void)
-{
- struct timeval tp1;
- struct timeval tp2;
- double delta;
-
- gettimeofday (&tp1, NULL);
-
- Sleep(1000);
-
- gettimeofday (&tp2, NULL);
-
- delta = (double)(tp2.tv_sec - tp1.tv_sec) + (double)(tp2.tv_usec - tp1.tv_usec) / 1000000.0;
- if (fabs(delta - 1) > 0.005)
- {
- return 0;
- }
-
- return 1;
-}
-
-static int
-test_time_tests_run(suite *s)
-{
- int res;
-
- res = test_time_test_gettimeofday();
-
- return res;
-}
-
-int
-test_gettimeofday(suite *s)
-{
-
- return test_time_tests_run(s);
-}
diff --git a/src/bin/evil/evil_test_gettimeofday.h b/src/bin/evil/evil_test_gettimeofday.h
deleted file mode 100644
index ad3155b146..0000000000
--- a/src/bin/evil/evil_test_gettimeofday.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __EVIL_TEST_GETTIMEOFDAY_H__
-#define __EVIL_TEST_GETTIMEOFDAY_H__
-
-
-int test_gettimeofday(suite *s);
-
-
-#endif /* __EVIL_TEST_GETTIMEOFDAY_H__ */
diff --git a/src/bin/evil/evil_test_link.c b/src/bin/evil/evil_test_link.c
deleted file mode 100644
index 0aa4966551..0000000000
--- a/src/bin/evil/evil_test_link.c
+++ /dev/null
@@ -1,159 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#include <stdio.h>
-#include <string.h>
-
-#include <Evil.h>
-
-#include "evil_suite.h"
-#include "evil_test_link.h"
-
-static int
-test_link_test_file_create(const char *name, const char *data)
-{
- FILE *f;
- size_t length;
- size_t res;
-
- f = fopen(name, "wb");
- if (!f)
- return 0;
-
- length = strlen(data) + 1;
- res = fwrite(data, 1, length, f);
- if (res < length)
- {
- fclose(f);
- return 0;
- }
-
- fclose(f);
-
- return 1;
-}
-
-static int
-test_link_test_symlink(void)
-{
-#ifdef _WIN32_WCE
- const char *old_name = "\\efl\\evil_test_link.dat";
- const char *new_name = "\\efl\\evil_test_link.lnk";
-#else
- const char *old_name = "evil_test_link.dat";
- const char *new_name = "evil_test_link.lnk";
-#endif
-
- if (!test_link_test_file_create(old_name,
- "evil_test_link symlink data\n"))
- return 0;
-
- if (symlink(old_name, new_name) < 0)
- {
- unlink(old_name);
- return 0;
- }
-
- if (unlink(new_name) < 0)
- {
- unlink(old_name);
- return 0;
- }
-
- if (unlink(old_name) < 0)
- return 0;
-
- return 1;
-}
-
-static int
-test_link_test_readlink(void)
-{
- char buf[1024];
-#ifdef _WIN32_WCE
- const char *old_name = "\\efl\\evil_test_link.dat";
- const char *new_name = "\\efl\\evil_test_link.lnk";
-#else
- const char *old_name = "evil_test_link.dat";
- const char *new_name = "evil_test_link.lnk";
-#endif
- const char *data = "evil_test_link symlink data\n";
- FILE *f;
- ssize_t s1;
- size_t s2;
- int l;
-
- if (!test_link_test_file_create(old_name, data))
- return 0;
-
- if (symlink(old_name, new_name) < 0)
- return 0;
-
- if ((s1 = readlink(new_name, buf, 1023)) < 0)
- {
- unlink(old_name);
- unlink(new_name);
- return 0;
- }
-
- buf[s1] = '\0';
-
- f = fopen(buf, "rb");
- if (!f)
- {
- unlink(old_name);
- unlink(new_name);
- return 0;
- }
-
- l = strlen(data);
- s2 = fread(buf, 1, l + 1, f);
-
- if ((int)s2 != (l + 1))
- {
- fclose(f);
- unlink(old_name);
- unlink(new_name);
- return 0;
- }
-
- if (strcmp(buf, data))
- {
- fclose(f);
- unlink(old_name);
- unlink(new_name);
- return 0;
- }
-
- fclose(f);
-
- if (unlink(new_name) < 0)
- {
- unlink(old_name);
- return 0;
- }
-
- if (unlink(old_name) < 0)
- return 0;
-
- return 1;
-}
-
-static int
-test_link_tests_run(suite *s)
-{
- int res;
-
- res = test_link_test_symlink();
- res &= test_link_test_readlink();
-
- return res;
-}
-
-int
-test_link(suite *s)
-{
-
- return test_link_tests_run(s);
-}
diff --git a/src/bin/evil/evil_test_link.h b/src/bin/evil/evil_test_link.h
deleted file mode 100644
index 6f8bfa2328..0000000000
--- a/src/bin/evil/evil_test_link.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __EVIL_TEST_LINK_H__
-#define __EVIL_TEST_LINK_H__
-
-
-int test_link(suite *s);
-
-
-#endif /* __EVIL_TEST_LINK_H__ */
diff --git a/src/bin/evil/evil_test_mkstemp.c b/src/bin/evil/evil_test_mkstemp.c
deleted file mode 100644
index 54d9df5d17..0000000000
--- a/src/bin/evil/evil_test_mkstemp.c
+++ /dev/null
@@ -1,95 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#include <stdio.h>
-#include <string.h>
-
-#include <Evil.h>
-
-#include "evil_suite.h"
-#include "evil_test_mkstemp.h"
-
-
-static int
-test_mkstemp_test(void)
-{
- char _template[PATH_MAX];
-#ifdef _WIN32_WCE
- char cwd[PATH_MAX];
-#endif
- int fd;
-
-#ifdef _WIN32_WCE
- if (!getcwd(cwd, PATH_MAX))
- return 0;
- _snprintf(_template, PATH_MAX, "%s\\%s", cwd, "file_XXXXXX");
-#else
- _snprintf(_template, PATH_MAX, "%s", "file_XXXXXX");
-#endif
-
- fd = mkstemp(_template);
-
- if (fd < 0)
- return 0;
-
- return 1;
-}
-
-static int
-test_mkstemps_test(void)
-{
- char _template[PATH_MAX];
-#ifdef _WIN32_WCE
- char cwd[PATH_MAX];
-#endif
- int fd;
-
-#ifdef _WIN32_WCE
- if (!getcwd(cwd, PATH_MAX))
- return 0;
- _snprintf(_template, PATH_MAX, "%s\\%s", cwd, "file_XXXXXX.ext");
-#else
- _snprintf(_template, PATH_MAX, "%s", "file_XXXXXX.ext");
-#endif
-
- fd = mkstemps(_template, 4);
-
- if (fd < 0)
- return 0;
-
- return 1;
-}
-
-static int
-test_mkstemp_run(suite *s)
-{
- int res;
- (void) s;
-
- res = test_mkstemp_test();
-
- return res;
-}
-
-static int
-test_mkstemps_run(suite *s)
-{
- int res;
- (void) s;
-
- res = test_mkstemps_test();
-
- return res;
-}
-
-int
-test_mkstemp(suite *s)
-{
- int res;
-
- res = test_mkstemp_run(s);
- res &= test_mkstemps_run(s);
-
- return res;
-}
diff --git a/src/bin/evil/evil_test_mkstemp.h b/src/bin/evil/evil_test_mkstemp.h
deleted file mode 100644
index f5bb0c4270..0000000000
--- a/src/bin/evil/evil_test_mkstemp.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __EVIL_TEST_MKSTEMP_H__
-#define __EVIL_TEST_MKSTEMP_H__
-
-
-int test_mkstemp(suite *s);
-
-
-#endif /* __EVIL_TEST_MKSTEMP_H__ */
diff --git a/src/bin/evil/evil_test_pipe.c b/src/bin/evil/evil_test_pipe.c
deleted file mode 100644
index e5cfdec4d1..0000000000
--- a/src/bin/evil/evil_test_pipe.c
+++ /dev/null
@@ -1,126 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#include <stdlib.h>
-#include <stdio.h>
-
-# define WIN32_LEAN_AND_MEAN
-# include <winsock2.h>
-# undef WIN32_LEAN_AND_MEAN
-
-#include <Evil.h>
-
-#include "evil_suite.h"
-#include "evil_test_pipe.h"
-
-
-#define FDREAD 0
-#define FDWRITE 1
-
-typedef struct
-{
- int val;
- int fd_write;
-} data;
-
-
-static DWORD WINAPI
-thread (void *param)
-{
- data *d;
- void *buf[1];
-
- Sleep (2 * 1000);
- d = (data *)param;
- buf[0] = d;
- send(d->fd_write, (char *)buf, sizeof(buf), 0);
-
- return 0;
-}
-
-static int
-test_pipe_test(void)
-{
- int sockets[2];
- struct timeval t;
- fd_set rfds;
- int ret = 0;
- data *d;
- DWORD thread_id;
- HANDLE h;
-
- FD_ZERO(&rfds);
-
- t.tv_sec = 5;
- t.tv_usec = 0;
-
- if (pipe(sockets) < 0)
- return 0;
-
- FD_SET(sockets[FDREAD], &rfds);
- fcntl(sockets[FDREAD], F_SETFL, O_NONBLOCK);
-
- d = (data *)malloc(sizeof (data));
- if (!d)
- return 0;
-
- d->val = 14;
- d->fd_write = sockets[FDWRITE];
-
- h = CreateThread(NULL, 0, thread, d, 0, &thread_id);
- if (!h)
-
- ret = select(sockets[FDREAD] + 1, &rfds, NULL, NULL, &t);
-
- if (ret < 0)
- goto free_d;
- else if (ret == 0)
- goto close_h;
- else /* ret > 0 */
- {
- void *buf[1];
- data *d2 = NULL;
- int len;
-
- while ((len = recv(sockets[FDREAD], (char *)buf, sizeof(buf), 0)) > 0)
- {
- if (len == sizeof(buf))
- {
- d2 = (data *)buf[0];
- break;
- }
- }
- if (d2 && (d2->val == d->val))
- ret = 1;
- else
- ret = 0;
- }
-
- CloseHandle(h);
- free(d);
-
- return ret;
-
- close_h:
- CloseHandle(h);
- free_d:
- free(d);
- return 0;
-}
-
-static int
-test_pipe_run(suite *s)
-{
- int res;
-
- res = test_pipe_test();
-
- return res;
-}
-
-int
-test_pipe(suite *s)
-{
- return test_pipe_run(s);
-}
diff --git a/src/bin/evil/evil_test_pipe.h b/src/bin/evil/evil_test_pipe.h
deleted file mode 100644
index ff8041f716..0000000000
--- a/src/bin/evil/evil_test_pipe.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __EVIL_TEST_PIPE_H__
-#define __EVIL_TEST_PIPE_H__
-
-
-int test_pipe(suite *s);
-
-
-#endif /* __EVIL_TEST_PIPE_H__ */
diff --git a/src/bin/evil/evil_test_print.c b/src/bin/evil/evil_test_print.c
deleted file mode 100644
index c775cfbefd..0000000000
--- a/src/bin/evil/evil_test_print.c
+++ /dev/null
@@ -1,46 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include <Evil.h>
-
-#include "evil_suite.h"
-#include "evil_test_print.h"
-
-static int
-test_print_test(void)
-{
- char buf[16];
- int i1 = 1;
- size_t i2 = 123456;
- int res;
-
- res = printf("%02hhd\n", i1);
- if (res != 3)
- return 0;
-
- res = snprintf(buf, sizeof(buf), "%zu", i2);
- if (res != 6)
- return 0;
-
- return 1;
-}
-
-static int
-test_print_run(suite *s)
-{
- int res;
-
- res = test_print_test();
-
- return res;
-}
-
-int
-test_print(suite *s)
-{
- return test_print_run(s);
-}
diff --git a/src/bin/evil/evil_test_print.h b/src/bin/evil/evil_test_print.h
deleted file mode 100644
index 2bbf43904f..0000000000
--- a/src/bin/evil/evil_test_print.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __EVIL_TEST_PRINT_H__
-#define __EVIL_TEST_PRINT_H__
-
-
-int test_print(suite *s);
-
-
-#endif /* __EVIL_TEST_PRINT_H__ */
diff --git a/src/bin/evil/evil_test_realpath.c b/src/bin/evil/evil_test_realpath.c
deleted file mode 100644
index fbc4d1d570..0000000000
--- a/src/bin/evil/evil_test_realpath.c
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#include <stdio.h>
-#include <string.h>
-
-#include <Evil.h>
-
-#include "evil_suite.h"
-#include "evil_test_realpath.h"
-
-
-static int
-test_realpath_test(void)
-{
- char buf[PATH_MAX];
- char *filename;
- char *result;
-
- filename = "evil_suite.exe";
-
- if (!(result = realpath(filename, buf)))
- return 0;
-
- printf ("res : %s\n", buf);
-
- return 1;
-}
-
-static int
-test_realpath_run(suite *s)
-{
- int res;
-
- res = test_realpath_test();
-
- return res;
-}
-
-int
-test_realpath(suite *s)
-{
- return test_realpath_run(s);
-}
diff --git a/src/bin/evil/evil_test_realpath.h b/src/bin/evil/evil_test_realpath.h
deleted file mode 100644
index 0205aad149..0000000000
--- a/src/bin/evil/evil_test_realpath.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __EVIL_TEST_REALPATH_H__
-#define __EVIL_TEST_REALPATH_H__
-
-
-int test_realpath(suite *s);
-
-
-#endif /* __EVIL_TEST_REALPATH_H__ */
diff --git a/src/bin/evil/evil_test_util.c b/src/bin/evil/evil_test_util.c
deleted file mode 100644
index 3763f88b64..0000000000
--- a/src/bin/evil/evil_test_util.c
+++ /dev/null
@@ -1,110 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#include <string.h>
-
-#include <Evil.h>
-
-#include "evil_suite.h"
-#include "evil_test_util.h"
-
-
-static int test_path_absolute_test_1(void)
-{
- char *path;
- int result;
-
- path = NULL;
- result = evil_path_is_absolute(path);
- if (result != 0)
- return 0;
-
- return 1;
-}
-
-static int test_path_absolute_test_2(void)
-{
- char *path;
- int result;
-
- path = "1";
- result = evil_path_is_absolute(path);
- if (result != 0)
- return 0;
-
- return 1;
-}
-
-static int test_path_absolute_test_3(void)
-{
- char *path;
- int result;
-
- path = "1:\\";
- result = evil_path_is_absolute(path);
- if (result != 0)
- return 0;
-
- return 1;
-}
-
-static int test_path_absolute_test_4(void)
-{
- char *path;
- int result;
-
- path = "1/\\";
- result = evil_path_is_absolute(path);
- if (result != 0)
- return 0;
-
- return 1;
-}
-
-static int test_path_absolute_test_5(void)
-{
- char *path;
- int result;
-
- path = "F:/foo";
- result = evil_path_is_absolute(path);
- if (result == 0)
- return 0;
-
- return 1;
-}
-
-static int test_path_absolute_test_6(void)
-{
- char *path;
- int result;
-
- path = "C:\\foo";
- result = evil_path_is_absolute(path);
- if (result == 0)
- return 0;
-
- return 1;
-}
-
-static int
-test_path_absolute_run(suite *s)
-{
- int res;
-
- res = test_path_absolute_test_1();
- res &= test_path_absolute_test_2();
- res &= test_path_absolute_test_3();
- res &= test_path_absolute_test_4();
- res &= test_path_absolute_test_5();
- res &= test_path_absolute_test_6();
-
- return res;
-}
-
-int
-test_util(suite *s)
-{
- return test_path_absolute_run(s);
-}
diff --git a/src/bin/evil/evil_test_util.h b/src/bin/evil/evil_test_util.h
deleted file mode 100644
index bee5c7a164..0000000000
--- a/src/bin/evil/evil_test_util.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __EVIL_TEST_UTIL_H__
-#define __EVIL_TEST_UTIL_H__
-
-
-int test_util(suite *s);
-
-
-#endif /* __EVIL_TEST_UTIL_H__ */
diff --git a/src/bin/evil/test_evil.c b/src/bin/evil/test_evil.c
deleted file mode 100644
index 5b91172cb3..0000000000
--- a/src/bin/evil/test_evil.c
+++ /dev/null
@@ -1,27 +0,0 @@
-#include <stdlib.h>
-#include <stdio.h>
-#include <sys/time.h>
-
-#include <windows.h>
-
-
-
-int
-main()
-{
- struct timeval tv;
- double t1 = 0.0;
- double t2 = 0.0;
-
- if (gettimeofday(&tv, NULL) == 0)
- t1 = tv.tv_sec + tv.tv_usec / 1000000.0;
-
- Sleep(3000);
-
- if (gettimeofday(&tv, NULL) == 0)
- t2 = tv.tv_sec + tv.tv_usec / 1000000.0;
-
- printf ("3 seconds ? %f\n", t2 - t1);
-
- return EXIT_SUCCESS;
-}
diff --git a/src/bindings/cxx/eo_cxx/Eo.hh b/src/bindings/cxx/eo_cxx/Eo.hh
index bd60f69701..4a4da4c6ef 100644
--- a/src/bindings/cxx/eo_cxx/Eo.hh
+++ b/src/bindings/cxx/eo_cxx/Eo.hh
@@ -8,7 +8,6 @@
#include <eo_wref.hh>
//#include <eo_inherit.hh>
//#include <eo_own_ptr.hh>
-#include <eo_promise.hh>
#include <eo_cxx_interop.hh>
#include <eo_event.hh>
diff --git a/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh b/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh
index a83688a3d9..019a417d14 100644
--- a/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh
+++ b/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh
@@ -7,7 +7,6 @@
#include <utility>
#include <type_traits>
#include <initializer_list>
-#include <future>
#include <Eina.hh>
#include <Eo.hh>
@@ -59,8 +58,6 @@ template <typename T>
struct out_traits<eina::optional<T&>> { typedef eina::optional<T&> type; };
template <>
struct out_traits<void*> { typedef void*& type; };
-template <typename T>
-struct out_traits<efl::shared_future<T>> { typedef efl::shared_future<T>& type; };
template <>
struct out_traits<efl::eina::strbuf> { typedef efl::eina::strbuf_wrapper& type; };
@@ -68,8 +65,6 @@ template <typename T>
struct inout_traits { typedef T& type; };
template <>
struct inout_traits<void> { typedef void* type; };
-template <typename T>
-struct inout_traits<efl::shared_future<T>> { typedef efl::shared_future<T>& type; };
template <typename T>
struct return_traits { typedef T type; };
@@ -142,10 +137,6 @@ void assign_out_impl(T& lhs, Eo const* rhs, tag<T&, Eo const*>
{
lhs._reset(const_cast<Eo*>(rhs));
}
-template <typename T>
-void assign_out_impl(efl::shared_future<T>& /*v*/, Efl_Future*, tag<efl::shared_future<T>&, Efl_Future*>)
-{
-}
template <typename Tag>
void assign_out_impl(efl::eina::string_view& view, const char* string, Tag)
{
@@ -277,11 +268,6 @@ Eo const* convert_inout_impl(T v, tag<T, Eo const*>
{
return v._eo_ptr();
}
-template <typename T>
-Efl_Future* convert_inout_impl(efl::shared_future<T>& /*v*/, tag<efl::shared_future<T>, Efl_Future*>)
-{
- return nullptr;
-}
}
template <typename To, typename From, typename V>
@@ -545,11 +531,6 @@ inline const char* convert_to_c_impl(efl::eina::stringshare x, tag<const char*,
{
return eina_stringshare_ref(x.c_str());
}
-template <typename T>
-Efl_Future* convert_to_c_impl(efl::shared_future<T> const&, tag<Efl_Future*, efl::shared_future<T>const&>)
-{
- std::abort();
-}
template <typename T, typename U, typename Deleter>
T* convert_to_c_impl(std::unique_ptr<U, Deleter>& v, tag<T*, std::unique_ptr<U, Deleter>>)
{
@@ -709,12 +690,6 @@ eina::accessor<T> convert_to_return(Eina_Accessor* value, tag<Eina_Accessor*, ei
{
return eina::accessor<T>{ value };
}
-template <typename T>
-efl::shared_future<T> convert_to_return(Efl_Future* /*value*/, tag<Efl_Future*, efl::shared_future<T>>)
-{
- std::abort();
- return {};
-}
// Eina_Value*
inline efl::eina::value convert_to_return(Eina_Value* value, tag<Eina_Value*, efl::eina::value>)
{
@@ -836,7 +811,7 @@ inline void do_eo_add(Eo*& object, P const& parent
, Efl_Class const* klass
, typename std::enable_if< eo::is_eolian_object<P>::value>::type* = 0)
{
- bool is_ref = (parent._eo_ptr() != nullptr);
+ bool const is_ref = true;
object = ::_efl_add_internal_start(__FILE__, __LINE__, klass, parent._eo_ptr(), is_ref, EINA_FALSE);
object = ::_efl_add_end(object, is_ref, EINA_FALSE);
}
@@ -862,7 +837,7 @@ void do_eo_add(Eo*& object, P const& parent, Efl_Class const* klass
, F&& f
, typename std::enable_if< eo::is_eolian_object<P>::value>::type* = 0)
{
- bool is_ref = (parent._eo_ptr() != nullptr);
+ bool const is_ref = true;
object = ::_efl_add_internal_start(__FILE__, __LINE__, klass, parent._eo_ptr(), is_ref, EINA_FALSE);
::efl::eolian::call_lambda(std::forward<F>(f), proxy);
object = ::_efl_add_end(object, is_ref, EINA_FALSE);
diff --git a/src/bindings/cxx/eo_cxx/eo_future.hh b/src/bindings/cxx/eo_cxx/eo_future.hh
deleted file mode 100644
index 7ed77cf016..0000000000
--- a/src/bindings/cxx/eo_cxx/eo_future.hh
+++ /dev/null
@@ -1,505 +0,0 @@
-///
-/// @file eo_future.hh
-///
-
-#ifndef EFL_CXX_EO_FUTURE_HH
-#define EFL_CXX_EO_FUTURE_HH
-
-#include <Efl.h>
-
-#include <Eina.hh>
-#include <Ecore_Manual.hh>
-
-#include <mutex>
-#include <condition_variable>
-
-#include <eina_tuple.hh>
-#include <eo_promise_meta.hh>
-
-namespace efl {
-
-template <typename...Args>
-struct shared_future;
-
-namespace _impl {
-
-template <typename V = char>
-struct wait_state
-{
- bool available = false;
- bool has_failed = false;
- std::mutex mutex;
- std::condition_variable cv;
- typename std::aligned_storage<sizeof(V), alignof(V)>::type storage;
- Eina_Error error;
-};
-
-inline void get_error_cb(void* data, Efl_Event const* event)
-{
- wait_state<>* wait_state_ = static_cast<wait_state<>*>(data);
- Efl_Future_Event_Failure* info = static_cast<Efl_Future_Event_Failure*>(event->info);
- std::unique_lock<std::mutex> l(wait_state_->mutex);
- wait_state_->error = info->error;
- wait_state_->has_failed = true;
- wait_state_->available = true;
- wait_state_->cv.notify_one();
-}
-
-struct shared_future_common
-{
- explicit shared_future_common(Efl_Future* future)
- : _future(future) {}
- shared_future_common()
- : _future(nullptr) {}
- ~shared_future_common()
- {
- if(_future)
- efl_unref(_future);
- }
- shared_future_common(shared_future_common const& future)
- : _future(efl_ref(future._future))
- {
- }
- shared_future_common& operator=(shared_future_common const& other)
- {
- _self_type tmp(other);
- tmp.swap(*this);
- return *this;
- }
- shared_future_common(shared_future_common&& future)
- : _future(future._future)
- {
- future._future = nullptr;
- }
- shared_future_common& operator=(shared_future_common&& other)
- {
- other.swap(*this);
- return *this;
- }
- void swap(shared_future_common& other)
- {
- std::swap(_future, other._future);
- }
- bool valid() const noexcept
- {
- return _future != nullptr;
- }
- void wait() const
- {
- if(eina_main_loop_is())
- throw std::runtime_error("Deadlock");
-
- struct wait_state<> wait_state;
-
- efl::ecore::main_loop_thread_safe_call_async
- ([&]
- {
- efl_future_then(this->_future, &wait_success, &wait_success, nullptr, &wait_state);
- });
-
- std::unique_lock<std::mutex> lock(wait_state.mutex);
- while(!wait_state.available)
- wait_state.cv.wait(lock);
- }
- static void wait_success(void* data, Efl_Event const*)
- {
- wait_state<>* wait_state_ = static_cast<wait_state<>*>(data);
- std::unique_lock<std::mutex> l(wait_state_->mutex);
- wait_state_->available = true;
- wait_state_->cv.notify_one();
- }
-
- typedef Efl_Future* native_handle_type;
- native_handle_type native_handle() const noexcept { return _future; }
-
- typedef shared_future_common _self_type;
- Efl_Future* _future;
-};
-
-template <typename T, typename Progress = void>
-struct shared_future_1_type : shared_future_common
-{
- typedef shared_future_common _base_type;
-
- using _base_type::_base_type;
- shared_future_1_type() = default;
- shared_future_1_type(shared_future_common const& other)
- : _base_type(other) {}
-
- T get() const
- {
- if(eina_main_loop_is())
- throw std::runtime_error("Deadlock");
-
- struct wait_state<T> wait_state;
-
- efl::ecore::main_loop_thread_safe_call_async
- ([&]
- {
- efl_future_then(this->_future, &get_success, &_impl::get_error_cb, nullptr, &wait_state);
- });
-
- {
- std::unique_lock<std::mutex> lock(wait_state.mutex);
- while(!wait_state.available)
- wait_state.cv.wait(lock);
- }
- if(wait_state.has_failed)
- EFL_CXX_THROW(eina::system_error(eina::error_code(wait_state.error, eina::eina_error_category()), "EFL Eina Error"));
- return *static_cast<T*>(static_cast<void*>(&wait_state.storage));
- }
-
- static void get_success(void* data, Efl_Event const* event)
- {
- wait_state<T>* wait_state_ = static_cast<wait_state<T>*>(data);
- Efl_Future_Event_Success* info = static_cast<Efl_Future_Event_Success*>(event->info);
-
- std::unique_lock<std::mutex> l(wait_state_->mutex);
- _impl::future_copy_traits<T>::copy(static_cast<T*>(static_cast<void*>(&wait_state_->storage)), info);
- wait_state_->available = true;
- wait_state_->cv.notify_one();
- }
-
- typedef shared_future_1_type<T, Progress> _self_type;
-};
-
-template <typename T>
-struct shared_race_future_1_type : shared_future_common
-{
- typedef shared_future_common _base_type;
-
- using _base_type::_base_type;
- shared_race_future_1_type(_base_type const& other)
- : _base_type(other) {}
-
- T get() const
- {
- if(eina_main_loop_is())
- throw std::runtime_error("Deadlock");
-
- struct wait_state<T> wait_state;
-
- efl::ecore::main_loop_thread_safe_call_async
- ([&]
- {
- efl_future_then(this->_future, &get_success, &_impl::get_error_cb, nullptr, &wait_state);
- });
-
- {
- std::unique_lock<std::mutex> lock(wait_state.mutex);
- while(!wait_state.available)
- wait_state.cv.wait(lock);
- }
- if(wait_state.has_failed)
- EFL_CXX_THROW(eina::system_error(eina::error_code(wait_state.error, eina::eina_error_category()), "EFL Eina Error"));
- return *static_cast<T*>(static_cast<void*>(&wait_state.storage));
- }
-
- static void get_success(void* data, Efl_Event const* event)
- {
- wait_state<T>* wait_state_ = static_cast<wait_state<T>*>(data);
- Efl_Future_Event_Success* info = static_cast<Efl_Future_Event_Success*>(event->info);
-
- std::unique_lock<std::mutex> l(wait_state_->mutex);
- _impl::future_copy_traits<T>::copy_race(static_cast<T*>(static_cast<void*>(&wait_state_->storage)), info);
- wait_state_->available = true;
- wait_state_->cv.notify_one();
- }
-
- typedef shared_race_future_1_type<T> _self_type;
-};
-
-template <typename...Args>
-struct shared_future_varargs_type : shared_future_common
-{
- typedef shared_future_common _base_type;
-
- using _base_type::_base_type;
- shared_future_varargs_type() = default;
- shared_future_varargs_type(_base_type const& other)
- : _base_type(other) {}
-
- typedef std::tuple<Args...> tuple_type;
-
- std::tuple<Args...> get() const
- {
- if(eina_main_loop_is())
- throw std::runtime_error("Deadlock");
-
- struct wait_state<tuple_type> wait_state;
-
- efl::ecore::main_loop_thread_safe_call_async
- ([&]
- {
- efl_future_then(this->_future, &get_success, &_impl::get_error_cb, nullptr, &wait_state);
- });
-
- {
- std::unique_lock<std::mutex> lock(wait_state.mutex);
- while(!wait_state.available)
- wait_state.cv.wait(lock);
- }
- if(wait_state.has_failed)
- EFL_CXX_THROW(eina::system_error(eina::error_code(wait_state.error, eina::eina_error_category()), "EFL Eina Error"));
- return *static_cast<tuple_type*>(static_cast<void*>(&wait_state.storage));
- }
-
- template <std::size_t N>
- static void read_accessor(Eina_Accessor* accessor
- , std::tuple<typename std::aligned_storage<sizeof(Args), alignof(Args)>::type...>& storage_tuple
- , wait_state<tuple_type>* wait_state
- , std::false_type)
- {
- typedef typename std::tuple_element<N, tuple_type>::type type;
- void* value;
- if(eina_accessor_data_get(accessor, N, &value))
- {
- eina::copy_from_c_traits<type>::copy_to_unitialized
- (static_cast<type*>(static_cast<void*>(&std::get<N>(storage_tuple))), value);
-
- _self_type::read_accessor<N+1>(accessor, storage_tuple, wait_state
- , std::integral_constant<bool, (N+1 == sizeof...(Args))>());
- }
- else
- {
- std::abort();
- // some error
- }
- }
-
- template <std::size_t N, std::size_t...I>
- static void read_accessor_end(std::tuple<typename std::aligned_storage<sizeof(Args), alignof(Args)>::type...>& storage_tuple
- , wait_state<tuple_type>* wait_state
- , eina::index_sequence<I...>)
- {
- std::unique_lock<std::mutex> l(wait_state->mutex);
-
- new (&wait_state->storage) tuple_type{(*static_cast<typename std::tuple_element<I, tuple_type>::type*>
- (static_cast<void*>(&std::get<I>(storage_tuple))))...};
-
- wait_state->available = true;
- wait_state->cv.notify_one();
- }
-
- template <std::size_t N>
- static void read_accessor(Eina_Accessor*
- , std::tuple<typename std::aligned_storage<sizeof(Args), alignof(Args)>::type...>& storage_tuple
- , wait_state<tuple_type>* wait_state
- , std::true_type)
- {
- _self_type::read_accessor_end<N>(storage_tuple, wait_state, eina::make_index_sequence<sizeof...(Args)>{});
- }
-
- static void get_success(void* data, Efl_Event const* event)
- {
- wait_state<tuple_type>* wait_state_ = static_cast<wait_state<tuple_type>*>(data);
- Efl_Future_Event_Success* info = static_cast<Efl_Future_Event_Success*>(event->info);
-
- Eina_Accessor* accessor = static_cast<Eina_Accessor*>(info->value);
- std::tuple<typename std::aligned_storage<sizeof(Args), alignof(Args)>::type...> storage_tuple;
-
- _self_type::read_accessor<0u>(accessor, storage_tuple, wait_state_, std::false_type());
- }
-
- typedef shared_future_varargs_type<Args...> _self_type;
-};
-
-}
-
-template <typename...Args>
-struct shared_future : private
- std::conditional
- <
- sizeof...(Args) == 1
- , _impl::shared_future_1_type<typename std::tuple_element<0u, std::tuple<Args...>>::type>
- , typename std::conditional
- <_impl::is_progress<typename std::tuple_element<sizeof...(Args) - 1, std::tuple<Args...>>::type>::value
- , typename std::conditional
- <sizeof...(Args) == 2
- , _impl::shared_future_1_type<Args...>
- , _impl::shared_future_varargs_type<Args...>
- >::type
- , _impl::shared_future_varargs_type<Args...>
- >::type
- >::type
-{
- typedef typename
- std::conditional
- <
- sizeof...(Args) == 1
- , _impl::shared_future_1_type<Args...>
- , typename std::conditional
- <_impl::is_progress<typename std::tuple_element<sizeof...(Args) - 1, std::tuple<Args...>>::type>::value
- , typename std::conditional
- <sizeof...(Args) == 2
- , _impl::shared_future_1_type<Args...>
- , _impl::shared_future_varargs_type<Args...>
- >::type
- , _impl::shared_future_varargs_type<Args...>
- >::type
- >::type
- _base_type;
- typedef typename _impl::progress_param<Args...>::type progress_param_type;
- typedef typename _impl::progress_type<progress_param_type>::type progress_type;
- typedef typename _base_type::native_handle_type native_handle_type;
- using _base_type::_base_type;
- using _base_type::swap;
- using _base_type::valid;
- using _base_type::get;
- using _base_type::wait;
- using _base_type::native_handle;
-
- shared_future() = default;
- template <typename...OtherArgs>
- shared_future(shared_future<OtherArgs...> const& other
- , typename std::enable_if<_impl::is_progress_param_compatible
- <progress_param_type, typename _impl::progress_param<OtherArgs...>::type>::value>::type* = nullptr)
- : _base_type(static_cast< _impl::shared_future_common const&>(other))
- {
- }
-
- template <typename...OtherArgs>
- friend struct shared_future;
-};
-
-template <typename...Args>
-struct shared_race_future : private std::conditional<sizeof...(Args) == 1, _impl::shared_race_future_1_type<typename std::tuple_element<0u, std::tuple<Args...>>::type>, void>::type
-{
- typedef typename std::conditional<sizeof...(Args) == 1, _impl::shared_race_future_1_type<typename std::tuple_element<0u, std::tuple<Args...>>::type>, void>::type _base_type;
-
- using _base_type::_base_type;
- using _base_type::swap;
- using _base_type::valid;
- using _base_type::get;
- using _base_type::wait;
- using _base_type::native_handle;
- typedef typename _base_type::native_handle_type native_handle_type;
-};
-
-namespace _impl {
-
-template <typename T>
-struct is_race_future : std::false_type {};
-
-template <typename...Args>
-struct is_race_future<shared_race_future<Args...>> : std::true_type {};
-
-}
-
-template <template <typename...> class Future, typename...Args, typename F>
-typename std::enable_if
-<
- !std::is_same<typename Future<Args...>::progress_type, void>::value
->::type on_progress(Future<Args...> future, F function)
-{
- struct private_data
- {
- F progress_cb;
- Future<Args...> future;
- };
- private_data* pdata = new private_data
- {std::move(function), std::move(future)};
-
- typedef typename Future<Args...>::progress_type progress_type;
-
- Efl_Event_Cb raw_progress_cb =
- [] (void* data, Efl_Event const* event)
- {
- private_data* pdata = static_cast<private_data*>(data);
- try
- {
- Efl_Future_Event_Progress const* info = static_cast<Efl_Future_Event_Progress const*>(event->info);
- pdata->progress_cb(*static_cast<progress_type const*>(info->progress));
- }
- catch(...)
- {
- // what should happen if progress_cb fails?
- }
- };
- Efl_Event_Cb raw_delete_cb =
- [] (void* data, Efl_Event const*)
- {
- private_data* pdata = static_cast<private_data*>(data);
- delete pdata;
- };
-
- assert(pdata->future.valid());
- efl_future_then(pdata->future.native_handle(), raw_delete_cb, raw_delete_cb, raw_progress_cb, pdata);
-}
-
-template <template <typename...> class Future, typename...Args, typename Success, typename Error>
-shared_future
-<
- typename std::enable_if
- <
- !std::is_same<void, typename std::tuple_element<0, std::tuple<Args...>>::type>::value
- && !std::is_same<void, typename std::result_of<Success(Args...)>::type>::value
- , typename std::result_of<Success(Args...)>::type
- >::type
-> then(Future<Args...> future, Success success_cb, Error error_cb)
-{
- struct private_data
- {
- Success success_cb;
- Error error_cb;
- Future<Args...> future;
- };
- private_data* pdata = new private_data
- {std::move(success_cb), std::move(error_cb), std::move(future)};
-
- Efl_Event_Cb raw_success_cb =
- [] (void* data, Efl_Event const* event)
- {
- private_data* pdata = static_cast<private_data*>(data);
- try
- {
- _impl::future_invoke<Args...>(pdata->success_cb, event, _impl::is_race_future<Future<Args...>>{});
- // should value_set the next promise
- }
- catch(...)
- {
- // should fail the next promise
- }
- delete pdata;
- };
- Efl_Event_Cb raw_error_cb =
- [] (void* data, Efl_Event const* event)
- {
- private_data* pdata = static_cast<private_data*>(data);
- Efl_Future_Event_Failure* info = static_cast<Efl_Future_Event_Failure*>(event->info);
- pdata->error_cb(eina::error_code(info->error, eina::eina_error_category()));
- // should error the next promise (or should the promise do that for me automatically?)
- delete pdata;
- };
-
- assert(pdata->future.valid());
- Efl_Future* new_future
- = efl_future_then(pdata->future.native_handle(), raw_success_cb, raw_error_cb, nullptr, pdata);
- return shared_future<typename std::result_of<Success(Args...)>::type>{efl_ref(new_future)};
-}
-
-// TODO:
-template <typename...Args, typename F>
-void then(shared_future<Args...> future, F function)
-{
- static_cast<void>(future);
- static_cast<void>(function);
-}
-
-template <typename...Args1, typename...Args2, typename...Futures>
-typename _impl::all_result_type<shared_future<Args1...>, shared_future<Args2...>, Futures...>::type
-all(shared_future<Args1...> future1, shared_future<Args2...> future2, Futures...futures)
-{
- return _impl::all_impl(future1, future2, futures...);
-}
-
-template <typename...Args1, typename...Args2, typename...Futures>
-typename _impl::race_result_type<shared_future<Args1...>, shared_future<Args2...>, Futures...>::type
-race(shared_future<Args1...> future1, shared_future<Args2...> future2, Futures...futures)
-{
- return _impl::race_impl(future1, future2, futures...);
-}
-
-}
-
-#endif
diff --git a/src/bindings/cxx/eo_cxx/eo_promise.hh b/src/bindings/cxx/eo_cxx/eo_promise.hh
deleted file mode 100644
index 5e18e69986..0000000000
--- a/src/bindings/cxx/eo_cxx/eo_promise.hh
+++ /dev/null
@@ -1,148 +0,0 @@
-///
-/// @file eo_promise.hh
-///
-
-#ifndef EFL_CXX_EO_PROMISE_HH
-#define EFL_CXX_EO_PROMISE_HH
-
-#include <Efl.h>
-
-#include <Eina.hh>
-#include <Ecore_Manual.hh>
-
-#include <mutex>
-#include <condition_variable>
-
-#include <eina_tuple.hh>
-#include <eo_promise_meta.hh>
-#include <eo_future.hh>
-
-namespace efl {
-
-template <typename...Args>
-struct shared_future;
-
-namespace _impl {
-
-struct promise_common
-{
- explicit promise_common(Efl_Promise* _promise) : _promise(_promise) {}
- explicit promise_common(std::nullptr_t) : _promise(nullptr) {}
- promise_common()
- {
- _promise = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- }
- ~promise_common()
- {
- if(_promise)
- ::efl_unref(_promise);
- }
- promise_common(promise_common const& other)
- : _promise( ::efl_ref(other._promise))
- {
- }
- promise_common(promise_common&& other)
- : _promise(nullptr)
- {
- std::swap(*this, other);
- }
- promise_common& operator=(promise_common const& other)
- {
- _promise = ::efl_ref(other._promise);
- return *this;
- }
- promise_common& operator=(promise_common&& other)
- {
- std::swap(*this, other);
- return *this;
- }
- bool valid() const
- {
- return _promise != nullptr;
- }
- void swap(promise_common& other)
- {
- std::swap(*this, other);
- }
- void set_exception(std::exception_ptr /*p*/)
- {
- }
-
- Efl_Promise* _promise;
-};
-
-template <typename P>
-struct promise_progress : promise_common
-{
- void set_progress(P const& progress)
- {
- efl_promise_progress_set(this->_promise, &progress);
- }
-};
-
-template <>
-struct promise_progress<void> : promise_common
-{
- void set_progress()
- {
- efl_promise_progress_set(this->_promise, nullptr);
- }
-};
-
-template <typename T, typename Progress>
-struct promise_1_type : promise_progress<Progress>
-{
- void set_value(T const& v)
- {
- typedef typename eina::alloc_to_c_traits<T>::c_type c_type;
- c_type* c_value = eina::alloc_to_c_traits<T>::copy_alloc(v);
- efl_promise_value_set(this->_promise, c_value, & eina::alloc_to_c_traits<T>::free_alloc);
- }
- void set_value(T&& v)
- {
- typedef typename eina::alloc_to_c_traits<T>::c_type c_type;
- c_type* c_value = eina::alloc_to_c_traits<T>::copy_alloc(std::move(v));
- efl_promise_value_set(this->_promise, c_value, & eina::alloc_to_c_traits<T>::free_alloc);
- }
-};
-
-template <typename Progress>
-struct promise_1_type<void, Progress> : promise_progress<Progress>
-{
- void set_value()
- {
- efl_promise_value_set(this->_promise, nullptr, nullptr);
- }
-};
-
-}
-
-template <typename T, typename Progress = void>
-struct promise : private _impl::promise_1_type<T, Progress>
-{
- typedef _impl::promise_1_type<T, Progress> _base_type;
- using _base_type::_base_type;
- using _base_type::set_value;
- using _base_type::set_progress;
- using _base_type::set_exception;
-
- shared_future<T, progress<Progress>> get_future()
- {
- return shared_future<T, progress<Progress>>{ ::efl_ref( ::efl_promise_future_get(this->_promise)) };
- }
-
- void swap(promise<T, progress<Progress>>& other)
- {
- _base_type::swap(other);
- }
-};
-
-template <typename...Args>
-void swap(promise<Args...>& lhs, promise<Args...>& rhs)
-{
- lhs.swap(rhs);
-}
-
-}
-
-#endif
diff --git a/src/bindings/cxx/eo_cxx/eo_promise_meta.hh b/src/bindings/cxx/eo_cxx/eo_promise_meta.hh
deleted file mode 100644
index 4d42c20fec..0000000000
--- a/src/bindings/cxx/eo_cxx/eo_promise_meta.hh
+++ /dev/null
@@ -1,332 +0,0 @@
-///
-/// @file eo_promise_meta.hh
-///
-
-#ifndef EFL_CXX_EO_PROMISE_META_HH
-#define EFL_CXX_EO_PROMISE_META_HH
-
-namespace efl {
-
-template <typename...Args>
-struct shared_future;
-
-template <typename...Args>
-struct shared_race_future;
-
-template <typename T>
-struct progress;
-
-namespace _impl {
-
-template <typename T>
-struct is_progress : std::false_type {};
-
-template <typename T>
-struct is_progress<progress<T>> : std::true_type {};
-
-template <typename L, typename R>
-struct is_progress_param_compatible : std::false_type {};
-
-template <typename T>
-struct is_progress_param_compatible<T, T> : std::true_type {};
-
-template <>
-struct is_progress_param_compatible<void, progress<void>> : std::true_type {};
-
-template <>
-struct is_progress_param_compatible<progress<void>, void> : std::true_type {};
-
-template <typename...Args>
-struct progress_param : std::conditional
- <is_progress<typename std::tuple_element<sizeof...(Args) - 1, std::tuple<Args...>>::type>::value
- , typename std::tuple_element<sizeof...(Args) - 1, std::tuple<Args...>>::type
- , void>
-{
-};
-
-template <typename T>
-struct progress_type;
-
-template <typename T>
-struct progress_type<progress<T>>
-{
- typedef T type;
-};
-
-template <>
-struct progress_type<void>
-{
- typedef void type;
-};
-
-template <typename...Futures>
-struct all_result_type;
-
-template <typename...Args>
-struct all_result_type<shared_future<Args...>>
-{
- typedef shared_future<Args...> type;
-};
-
-template <typename...Args1, typename...Args2>
-struct all_result_type<shared_future<Args1...>, shared_future<Args2...>>
-{
- typedef shared_future<Args1..., Args2...> type;
-};
-
-template <typename...Args1, typename...Args2, typename...OtherFutures>
-struct all_result_type<shared_future<Args1...>, shared_future<Args2...>, OtherFutures...>
-{
- typedef typename all_result_type<shared_future<Args1..., Args2...>, OtherFutures...>::type type;
-};
-
-template <typename...Futures>
-typename all_result_type<Futures...>::type
-all_impl(Futures const& ... futures)
-{
- Efl_Future* future = ::efl_future_all_internal(futures.native_handle()..., NULL);
- return typename all_result_type<Futures...>::type{ ::efl_ref(future)};
-}
-
-template <typename...Futures>
-struct race_result_type;
-
-template <typename...Args>
-struct race_result_type<shared_future<Args...>>
-{
- typedef shared_race_future<Args...> type;
-};
-
-template <typename T, typename...Args>
-struct race_compose_impl;
-
-template <typename T, typename A0, typename...Args>
-struct race_compose_impl<T, A0, Args...>
-{
- typedef typename std::conditional<eina::_mpl::tuple_contains<A0, T>::value
- , typename race_compose_impl<T, Args...>::type
- , typename race_compose_impl<typename eina::_mpl::push_back<T, A0>::type, Args...>::type
- >::type type;
-};
-
-template <typename T>
-struct race_compose_impl<T>
-{
- typedef T type;
-};
-
-template <typename T>
-struct variant_from_tuple;
-
-template <typename...Args>
-struct variant_from_tuple<std::tuple<Args...>>
-{
- typedef eina::variant<Args...> type;
-};
-
-template <typename...Args>
-struct race_variant
-{
- typedef typename variant_from_tuple<typename race_compose_impl<std::tuple<>, Args...>::type>::type type;
-};
-
-template <typename A0>
-struct race_result_type<shared_future<A0>>
-{
- typedef shared_race_future<A0> type;
-};
-
-template <typename A0>
-struct race_result_type<shared_future<eina::variant<A0>>>
-{
- typedef shared_race_future<A0> type;
-};
-
-template <typename...Args1, typename...Args2>
-struct race_result_type<shared_future<Args1...>, shared_future<Args2...>>
-{
- typedef typename race_result_type<shared_future<typename race_variant<Args1..., Args2...>::type>>::type type;
-};
-
-template <typename...Args1, typename...Args2, typename...OtherFutures>
-struct race_result_type<shared_future<Args1...>, shared_future<Args2...>, OtherFutures...>
-{
- typedef typename race_result_type<shared_future<typename race_variant<Args1..., Args2...>::type>
- , OtherFutures...>::type type;
-};
-
-template <typename...Futures>
-typename race_result_type<Futures...>::type
-race_impl(Futures const& ... futures)
-{
- Efl_Future* future = ::efl_future_race_internal(futures.native_handle()..., NULL);
- return typename race_result_type<Futures...>::type{ ::efl_ref(future)};
-}
-
-template <typename T, typename Enabler = void>
-struct future_copy_traits
-{
- static void copy(T* storage, Efl_Future_Event_Success const* info)
- {
- eina::copy_from_c_traits<T>::copy_to_unitialized
- (storage, info->value);
- }
- static void copy_race(T* storage, Efl_Future_Event_Success const* info)
- {
- Efl_Future_Race_Success const* race = static_cast<Efl_Future_Race_Success const*>(info->value);
- eina::copy_from_c_traits<T>::copy_to_unitialized
- (storage, race->value);
- }
-};
-
-template <typename...Args>
-struct future_copy_traits<eina::variant<Args...>>
-{
- template <std::size_t I>
- static void copy_impl(eina::variant<Args...>*, void const*, int, std::integral_constant<std::size_t, I>
- , std::integral_constant<std::size_t, I>)
- {
- std::abort();
- }
-
- template <std::size_t I, std::size_t N>
- static void copy_impl(eina::variant<Args...>* storage, void const* value, int index, std::integral_constant<std::size_t, I>
- , std::integral_constant<std::size_t, N> max
- , typename std::enable_if<I != N>::type* = 0)
- {
- if(I == index)
- {
- eina::copy_from_c_traits<eina::variant<Args...>>::copy_to_unitialized
- (storage, static_cast<typename std::tuple_element<I, std::tuple<Args...>>::type const*>
- (static_cast<void const*>(value)));
- }
- else
- copy_impl(storage, value, index, std::integral_constant<std::size_t, I+1>{}, max);
- }
- static void copy(eina::variant<Args...>*, Efl_Future_Event_Success const*)
- {
- std::abort();
- }
- static void copy_race(eina::variant<Args...>* storage, Efl_Future_Event_Success const* other_info)
- {
- Efl_Future_Race_Success const* info = static_cast<Efl_Future_Race_Success const*>
- (static_cast<void const*>(other_info->value));
- copy_impl(storage, info->value, info->index, std::integral_constant<std::size_t, 0ul>{}
- , std::integral_constant<std::size_t, sizeof...(Args)>{});
- }
-};
-
-template <typename A0, typename F, bool IsRace>
-typename std::enable_if
-<
- !std::is_same<A0, void>::value
- && !std::is_same<typename std::result_of<F(A0)>::type, void>::value
->::type
-future_invoke(F f, Efl_Event const* event, std::integral_constant<bool, IsRace> /* is_race */)
-{
- Efl_Future_Event_Success* info = static_cast<Efl_Future_Event_Success*>(event->info);
- try
- {
- typename std::aligned_storage<sizeof(A0), alignof(A0)>::type storage;
- if(IsRace)
- future_copy_traits<A0>::copy_race(static_cast<A0*>(static_cast<void*>(&storage)), info);
- else
- future_copy_traits<A0>::copy(static_cast<A0*>(static_cast<void*>(&storage)), info);
- auto r = f(*static_cast<A0*>(static_cast<void*>(&storage)));
- typedef decltype(r) result_type;
- typedef typename eina::alloc_to_c_traits<result_type>::c_type c_type;
- c_type* c_value = eina::alloc_to_c_traits<result_type>::copy_alloc(r);
- efl_promise_value_set(info->next, c_value, & eina::alloc_to_c_traits<result_type>::free_alloc);
- }
- catch(...)
- {
- }
-}
-
-template <typename A0, typename F, bool IsRace>
-typename std::enable_if<std::is_same<A0, void>::value>::type
-future_invoke(F f, Efl_Event const* event, std::integral_constant<bool, IsRace>)
-{
- Efl_Future_Event_Success* info = static_cast<Efl_Future_Event_Success*>(event->info);
- static_cast<void>(info);
- try
- {
- f();
- }
- catch(...)
- {
- }
-}
-
-template <std::size_t N, typename...Args, typename...StorageArgs>
-static void future_invoke_impl_read_accessor
- (Eina_Accessor*, std::tuple<StorageArgs...>&, std::tuple<Args...>*, std::true_type)
-{
-}
-
-template <std::size_t N, typename...Args, typename...StorageArgs>
-static void future_invoke_impl_read_accessor
- (Eina_Accessor* accessor
- , std::tuple<StorageArgs...>& storage_tuple
- , std::tuple<Args...>* args
- , std::false_type)
-{
- typedef std::tuple<Args...> tuple_type;
- typedef typename std::tuple_element<N, tuple_type>::type type;
- void* value;
- if(eina_accessor_data_get(accessor, N, &value))
- {
- eina::copy_from_c_traits<type>::copy_to_unitialized
- (static_cast<type*>(static_cast<void*>(&std::get<N>(storage_tuple))), value);
-
- _impl::future_invoke_impl_read_accessor<N+1>
- (accessor, storage_tuple, args
- , std::integral_constant<bool, (N+1 == sizeof...(Args))>());
- }
- else
- {
- std::abort();
- // some error
- }
-}
-
-template <typename F, typename...Args, std::size_t...I, bool IsRace>
-void future_invoke_impl(F f, Efl_Event const* event, std::tuple<Args...>* arguments_dummy, std::integral_constant<bool, IsRace>, eina::index_sequence<I...>)
-{
- Efl_Future_Event_Success* info = static_cast<Efl_Future_Event_Success*>(event->info);
- try
- {
- typedef std::tuple<Args...> arguments;
- typedef std::tuple<typename std::aligned_storage<sizeof(Args), alignof(Args)>::type...>
- storage_tuple_type;
- storage_tuple_type storage_tuple;
-
- future_invoke_impl_read_accessor<0ul>
- (static_cast<Eina_Accessor*>(info->value)
- , storage_tuple
- , arguments_dummy, std::false_type{});
-
- auto r = f(*static_cast<typename std::tuple_element<I, arguments>::type*>
- (static_cast<void*>(&std::get<I>(storage_tuple)))...);
-
- typedef decltype(r) result_type;
- typedef typename eina::alloc_to_c_traits<result_type>::c_type c_type;
- c_type* c_value = eina::alloc_to_c_traits<result_type>::copy_alloc(r);
- efl_promise_value_set(info->next, c_value, & eina::alloc_to_c_traits<result_type>::free_alloc);
- }
- catch(...)
- {
- }
-}
-
-template <typename A0, typename A1, typename...OtherArgs, typename F, bool IsRace>
-void
-future_invoke(F f, Efl_Event const* event, std::integral_constant<bool, IsRace> race)
-{
- std::tuple<A0, A1, OtherArgs...>* p = nullptr;
- _impl::future_invoke_impl(f, event, p, race, eina::make_index_sequence<sizeof...(OtherArgs) + 2>{});
-}
-
-} }
-
-#endif
diff --git a/src/bindings/js/ecore_js/Ecore_Js.hh b/src/bindings/js/ecore_js/Ecore_Js.hh
index 15331aa93e..35b33a71eb 100644
--- a/src/bindings/js/ecore_js/Ecore_Js.hh
+++ b/src/bindings/js/ecore_js/Ecore_Js.hh
@@ -12,15 +12,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ECORE_JS_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ECORE_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -31,7 +31,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
namespace efl { namespace ecore { namespace js {
@@ -55,4 +55,7 @@ EAPI void register_ecore(v8::Isolate *isolate,v8::Handle<v8::Object> exports);
} } }
+#undef EAPI
+#define EAPI
+
#endif
diff --git a/src/bindings/js/eina_js/Eina_Js.hh b/src/bindings/js/eina_js/Eina_Js.hh
index b193b5461c..f65adf82bc 100644
--- a/src/bindings/js/eina_js/Eina_Js.hh
+++ b/src/bindings/js/eina_js/Eina_Js.hh
@@ -10,15 +10,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_EINA_JS_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ECORE_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -29,7 +29,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#include <eina_js_container.hh>
#include <eina_js_accessor.hh>
diff --git a/src/bindings/js/eldbus_js/Eldbus_Js.hh b/src/bindings/js/eldbus_js/Eldbus_Js.hh
index 00da9ca924..3f2e07247b 100644
--- a/src/bindings/js/eldbus_js/Eldbus_Js.hh
+++ b/src/bindings/js/eldbus_js/Eldbus_Js.hh
@@ -12,15 +12,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_EINA_JS_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ECORE_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -31,7 +31,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
namespace efl { namespace eldbus { namespace js {
@@ -40,9 +40,12 @@ EAPI void register_eldbus_core(v8::Isolate* isolate, v8::Handle<v8::Object> expo
EAPI void register_eldbus_message(v8::Isolate* isolate, v8::Handle<v8::Object> exports);
EAPI void register_eldbus_object_mapper(v8::Isolate* isolate, v8::Handle<v8::Object> exports);
EAPI void register_eldbus(v8::Isolate* isolate, v8::Handle<v8::Object> exports);
-
+
} } }
+#undef EAPI
+#define EAPI
+
#include <eldbus_js_util.hh>
#endif
diff --git a/src/bindings/luajit/eolian.lua b/src/bindings/luajit/eolian.lua
index 080e06bde2..78fcfd6b6d 100644
--- a/src/bindings/luajit/eolian.lua
+++ b/src/bindings/luajit/eolian.lua
@@ -13,7 +13,8 @@ ffi.cdef [[
typedef unsigned char Eina_Bool;
typedef struct _Eina_Iterator Eina_Iterator;
- typedef struct _Eolian Eolian;
+ typedef struct _Eolian_State Eolian_State;
+ typedef struct _Eolian_Object Eolian_Object;
typedef struct _Eolian_Class Eolian_Class;
typedef struct _Eolian_Function Eolian_Function;
typedef struct _Eolian_Type Eolian_Type;
@@ -26,11 +27,28 @@ ffi.cdef [[
typedef struct _Eolian_Variable Eolian_Variable;
typedef struct _Eolian_Struct_Type_Field Eolian_Struct_Type_Field;
typedef struct _Eolian_Enum_Type_Field Eolian_Enum_Type_Field;
- typedef struct _Eolian_Declaration Eolian_Declaration;
typedef struct _Eolian_Documentation Eolian_Documentation;
typedef struct _Eolian_Value Eolian_Value;
typedef struct _Eolian_Unit Eolian_Unit;
+ typedef enum {
+ EOLIAN_OBJECT_UNKNOWN = 0,
+ EOLIAN_OBJECT_CLASS,
+ EOLIAN_OBJECT_TYPEDECL,
+ EOLIAN_OBJECT_STRUCT_FIELD,
+ EOLIAN_OBJECT_ENUM_FIELD,
+ EOLIAN_OBJECT_TYPE,
+ EOLIAN_OBJECT_VARIABLE,
+ EOLIAN_OBJECT_EXPRESSION,
+ EOLIAN_OBJECT_FUNCTION,
+ EOLIAN_OBJECT_FUNCTION_PARAMETER,
+ EOLIAN_OBJECT_EVENT,
+ EOLIAN_OBJECT_PART,
+ EOLIAN_OBJECT_IMPLEMENT,
+ EOLIAN_OBJECT_CONSTRUCTOR,
+ EOLIAN_OBJECT_DOCUMENTATION
+ } Eolian_Object_Type;
+
typedef enum
{
EOLIAN_UNRESOLVED = 0,
@@ -248,15 +266,6 @@ ffi.cdef [[
} Eolian_Unary_Operator;
typedef enum {
- EOLIAN_DECL_UNKNOWN = 0,
- EOLIAN_DECL_CLASS,
- EOLIAN_DECL_ALIAS,
- EOLIAN_DECL_STRUCT,
- EOLIAN_DECL_ENUM,
- EOLIAN_DECL_VAR
- } Eolian_Declaration_Type;
-
- typedef enum {
EOLIAN_DOC_TOKEN_UNKNOWN = 0,
EOLIAN_DOC_TOKEN_TEXT,
EOLIAN_DOC_TOKEN_REF,
@@ -267,19 +276,6 @@ ffi.cdef [[
EOLIAN_DOC_TOKEN_MARKUP_MONOSPACE
} Eolian_Doc_Token_Type;
- typedef enum {
- EOLIAN_DOC_REF_INVALID = 0,
- EOLIAN_DOC_REF_CLASS,
- EOLIAN_DOC_REF_FUNC,
- EOLIAN_DOC_REF_EVENT,
- EOLIAN_DOC_REF_ALIAS,
- EOLIAN_DOC_REF_STRUCT,
- EOLIAN_DOC_REF_STRUCT_FIELD,
- EOLIAN_DOC_REF_ENUM,
- EOLIAN_DOC_REF_ENUM_FIELD,
- EOLIAN_DOC_REF_VAR
- } Eolian_Doc_Ref_Type;
-
typedef struct _Eolian_Doc_Token {
Eolian_Doc_Token_Type type;
const char *text, *text_end;
@@ -287,25 +283,53 @@ ffi.cdef [[
int eolian_init(void);
int eolian_shutdown(void);
- Eolian *eolian_new(void);
- void eolian_free(Eolian *state);
- const Eolian_Unit *eolian_file_parse(Eolian *state, const char *filepath);
- Eina_Iterator *eolian_all_eo_file_paths_get(Eolian *state);
- Eina_Iterator *eolian_all_eot_file_paths_get(Eolian *state);
- Eina_Iterator *eolian_all_eo_files_get(Eolian *state);
- Eina_Iterator *eolian_all_eot_files_get(Eolian *state);
- Eina_Bool eolian_directory_scan(Eolian *state, const char *dir);
- Eina_Bool eolian_system_directory_scan(Eolian *state);
- Eina_Bool eolian_all_eo_files_parse(Eolian *state);
- Eina_Bool eolian_all_eot_files_parse(Eolian *state);
- const Eolian_Class *eolian_class_get_by_name(const Eolian_Unit *unit, const char *class_name);
- const Eolian_Class *eolian_class_get_by_file(const Eolian_Unit *unit, const char *file_name);
- const char *eolian_class_file_get(const Eolian_Class *klass);
- const char *eolian_class_full_name_get(const Eolian_Class *klass);
- const char *eolian_class_name_get(const Eolian_Class *klass);
- Eina_Iterator *eolian_class_namespaces_get(const Eolian_Class *klass);
+ Eolian_State *eolian_state_new(void);
+ void eolian_state_free(Eolian_State *state);
+ Eolian_Object_Type eolian_object_type_get(const Eolian_Object *obj);
+ const char *eolian_object_file_get(const Eolian_Object *obj);
+ int eolian_object_line_get(const Eolian_Object *obj);
+ int eolian_object_column_get(const Eolian_Object *obj);
+ const char *eolian_object_name_get(const Eolian_Object *obj);
+ const char *eolian_object_short_name_get(const Eolian_Object *obj);
+ Eina_Iterator *eolian_object_namespaces_get(const Eolian_Object *obj);
+ Eina_Bool eolian_state_directory_add(Eolian_State *state, const char *dir);
+ Eina_Bool eolian_state_system_directory_add(Eolian_State *state);
+ Eina_Iterator *eolian_state_eo_file_paths_get(const Eolian_State *state);
+ Eina_Iterator *eolian_state_eot_file_paths_get(const Eolian_State *state);
+ Eina_Iterator *eolian_state_eo_files_get(const Eolian_State *state);
+ Eina_Iterator *eolian_state_eot_files_get(const Eolian_State *state);
+ const Eolian_Unit *eolian_state_file_parse(Eolian_State *state, const char *filepath);
+ Eina_Bool eolian_state_all_eo_files_parse(Eolian_State *state);
+ Eina_Bool eolian_state_all_eot_files_parse(Eolian_State *state);
+ Eina_Bool eolian_state_check(const Eolian_State *state);
+ const Eolian_Unit *eolian_state_unit_by_file_get(const Eolian_State *state, const char *file_name);
+ Eina_Iterator *eolian_state_units_get(const Eolian_State *state);
+
+ Eina_Iterator *eolian_unit_children_get(const Eolian_Unit *unit);
+ const char *eolian_unit_file_get(const Eolian_Unit *unit);
+ const Eolian_Object *eolian_unit_object_by_name_get(const Eolian_Unit *unit, const char *name);
+ Eina_Iterator *eolian_unit_objects_get(const Eolian_Unit *unit);
+ const Eolian_Class *eolian_unit_class_by_name_get(const Eolian_Unit *unit, const char *class_name);
+ Eina_Iterator *eolian_unit_classes_get(const Eolian_Unit *unit);
+ const Eolian_Variable *eolian_unit_global_by_name_get(const Eolian_Unit *unit, const char *name);
+ const Eolian_Variable *eolian_unit_constant_by_name_get(const Eolian_Unit *unit, const char *name);
+ Eina_Iterator *eolian_unit_constants_get(const Eolian_Unit *unit);
+ Eina_Iterator *eolian_unit_globals_get(const Eolian_Unit *unit);
+ const Eolian_Typedecl *eolian_unit_alias_by_name_get(const Eolian_Unit *unit, const char *name);
+ const Eolian_Typedecl *eolian_unit_struct_by_name_get(const Eolian_Unit *unit, const char *name);
+ const Eolian_Typedecl *eolian_unit_enum_by_name_get(const Eolian_Unit *unit, const char *name);
+ Eina_Iterator *eolian_unit_aliases_get(const Eolian_Unit *unit);
+ Eina_Iterator *eolian_unit_structs_get(const Eolian_Unit *unit);
+ Eina_Iterator *eolian_unit_enums_get(const Eolian_Unit *unit);
+ Eina_Iterator *eolian_state_objects_by_file_get(const Eolian_State *state, const char *file_name);
+ const Eolian_Class *eolian_state_class_by_file_get(const Eolian_State *state, const char *file_name);
+ Eina_Iterator *eolian_state_globals_by_file_get(const Eolian_State *state, const char *file_name);
+ Eina_Iterator *eolian_state_constants_by_file_get(const Eolian_State *state, const char *file_name);
+ Eina_Iterator *eolian_state_aliases_by_file_get(const Eolian_State *state, const char *file_name);
+ Eina_Iterator *eolian_state_structs_by_file_get(const Eolian_State *state, const char *file_name);
+ Eina_Iterator *eolian_state_enums_by_file_get(const Eolian_State *state, const char *file_name);
+
Eolian_Class_Type eolian_class_type_get(const Eolian_Class *klass);
- Eina_Iterator *eolian_all_classes_get(const Eolian_Unit *unit);
const Eolian_Documentation *eolian_class_documentation_get(const Eolian_Class *klass);
const char *eolian_class_legacy_prefix_get(const Eolian_Class *klass);
const char *eolian_class_eo_prefix_get(const Eolian_Class *klass);
@@ -314,9 +338,8 @@ ffi.cdef [[
Eina_Iterator *eolian_class_functions_get(const Eolian_Class *klass, Eolian_Function_Type func_type);
Eolian_Function_Type eolian_function_type_get(const Eolian_Function *function_id);
Eolian_Object_Scope eolian_function_scope_get(const Eolian_Function *function_id, Eolian_Function_Type ftype);
- const char *eolian_function_name_get(const Eolian_Function *function_id);
const char *eolian_function_full_c_name_get(const Eolian_Function *function_id, Eolian_Function_Type ftype, Eina_Bool use_legacy);
- const Eolian_Function *eolian_class_function_get_by_name(const Eolian_Class *klass, const char *func_name, Eolian_Function_Type f_type);
+ const Eolian_Function *eolian_class_function_by_name_get(const Eolian_Class *klass, const char *func_name, Eolian_Function_Type f_type);
const char *eolian_function_legacy_get(const Eolian_Function *function_id, Eolian_Function_Type f_type);
const Eolian_Implement *eolian_function_implement_get(const Eolian_Function *function_id);
Eina_Bool eolian_function_is_legacy_only(const Eolian_Function *function_id, Eolian_Function_Type ftype);
@@ -330,7 +353,6 @@ ffi.cdef [[
Eolian_Parameter_Dir eolian_parameter_direction_get(const Eolian_Function_Parameter *param);
const Eolian_Type *eolian_parameter_type_get(const Eolian_Function_Parameter *param);
const Eolian_Expression *eolian_parameter_default_value_get(const Eolian_Function_Parameter *param);
- const char *eolian_parameter_name_get(const Eolian_Function_Parameter *param);
const Eolian_Documentation *eolian_parameter_documentation_get(const Eolian_Function_Parameter *param);
Eina_Bool eolian_parameter_is_nonull(const Eolian_Function_Parameter *param_desc);
Eina_Bool eolian_parameter_is_nullable(const Eolian_Function_Parameter *param_desc);
@@ -340,7 +362,6 @@ ffi.cdef [[
const Eolian_Documentation *eolian_function_return_documentation_get(const Eolian_Function *foo_id, Eolian_Function_Type ftype);
Eina_Bool eolian_function_return_is_warn_unused(const Eolian_Function *foo_id, Eolian_Function_Type ftype);
Eina_Bool eolian_function_object_is_const(const Eolian_Function *function_id);
- const char *eolian_implement_full_name_get(const Eolian_Implement *impl);
const Eolian_Class *eolian_implement_class_get(const Eolian_Implement *impl);
const Eolian_Function *eolian_implement_function_get(const Eolian_Implement *impl, Eolian_Function_Type *func_type);
const Eolian_Documentation *eolian_implement_documentation_get(const Eolian_Implement *impl, Eolian_Function_Type f_type);
@@ -350,13 +371,11 @@ ffi.cdef [[
Eina_Bool eolian_implement_is_prop_get(const Eolian_Implement *impl);
Eina_Bool eolian_implement_is_prop_set(const Eolian_Implement *impl);
Eina_Iterator *eolian_class_implements_get(const Eolian_Class *klass);
- const char *eolian_constructor_full_name_get(const Eolian_Constructor *ctor);
const Eolian_Class *eolian_constructor_class_get(const Eolian_Constructor *ctor);
const Eolian_Function *eolian_constructor_function_get(const Eolian_Constructor *ctor);
Eina_Bool eolian_constructor_is_optional(const Eolian_Constructor *ctor);
Eina_Iterator *eolian_class_constructors_get(const Eolian_Class *klass);
Eina_Iterator *eolian_class_events_get(const Eolian_Class *klass);
- const char *eolian_event_name_get(const Eolian_Event *event);
const Eolian_Type *eolian_event_type_get(const Eolian_Event *event);
const Eolian_Documentation *eolian_event_documentation_get(const Eolian_Event *event);
Eolian_Object_Scope eolian_event_scope_get(const Eolian_Event *event);
@@ -367,69 +386,47 @@ ffi.cdef [[
Eina_Bool eolian_class_ctor_enable_get(const Eolian_Class *klass);
Eina_Bool eolian_class_dtor_enable_get(const Eolian_Class *klass);
const char *eolian_class_c_get_function_name_get(const Eolian_Class *klass);
- const Eolian_Typedecl *eolian_typedecl_alias_get_by_name(const Eolian_Unit *unit, const char *name);
- const Eolian_Typedecl *eolian_typedecl_struct_get_by_name(const Eolian_Unit *unit, const char *name);
- const Eolian_Typedecl *eolian_typedecl_enum_get_by_name(const Eolian_Unit *unit, const char *name);
- Eina_Iterator *eolian_typedecl_aliases_get_by_file(const Eolian_Unit *unit, const char *fname);
- Eina_Iterator *eolian_typedecl_structs_get_by_file(const Eolian_Unit *unit, const char *fname);
- Eina_Iterator *eolian_typedecl_enums_get_by_file(const Eolian_Unit *unit, const char *fname);
- Eina_Iterator *eolian_typedecl_all_aliases_get(const Eolian_Unit *unit);
- Eina_Iterator *eolian_typedecl_all_structs_get(const Eolian_Unit *unit);
- Eina_Iterator *eolian_typedecl_all_enums_get(const Eolian_Unit *unit);
Eolian_Type_Type eolian_type_type_get(const Eolian_Type *tp);
Eolian_Type_Builtin_Type eolian_type_builtin_type_get(const Eolian_Type *tp);
Eolian_Typedecl_Type eolian_typedecl_type_get(const Eolian_Typedecl *tp);
Eina_Iterator *eolian_typedecl_struct_fields_get(const Eolian_Typedecl *tp);
const Eolian_Struct_Type_Field *eolian_typedecl_struct_field_get(const Eolian_Typedecl *tp, const char *field);
- const char *eolian_typedecl_struct_field_name_get(const Eolian_Struct_Type_Field *fl);
const Eolian_Documentation *eolian_typedecl_struct_field_documentation_get(const Eolian_Struct_Type_Field *fl);
const Eolian_Type *eolian_typedecl_struct_field_type_get(const Eolian_Struct_Type_Field *fl);
Eina_Iterator *eolian_typedecl_enum_fields_get(const Eolian_Typedecl *tp);
const Eolian_Enum_Type_Field *eolian_typedecl_enum_field_get(const Eolian_Typedecl *tp, const char *field);
- const char *eolian_typedecl_enum_field_name_get(const Eolian_Enum_Type_Field *fl);
const char *eolian_typedecl_enum_field_c_name_get(const Eolian_Enum_Type_Field *fl);
const Eolian_Documentation *eolian_typedecl_enum_field_documentation_get(const Eolian_Enum_Type_Field *fl);
const Eolian_Expression *eolian_typedecl_enum_field_value_get(const Eolian_Enum_Type_Field *fl, Eina_Bool force);
const char *eolian_typedecl_enum_legacy_prefix_get(const Eolian_Typedecl *tp);
const Eolian_Documentation *eolian_typedecl_documentation_get(const Eolian_Typedecl *tp);
- const char *eolian_type_file_get(const Eolian_Type *tp);
- const char *eolian_typedecl_file_get(const Eolian_Typedecl *tp);
const Eolian_Type *eolian_type_base_type_get(const Eolian_Type *tp);
const Eolian_Type *eolian_type_next_type_get(const Eolian_Type *tp);
const Eolian_Type *eolian_typedecl_base_type_get(const Eolian_Typedecl *tp);
- const Eolian_Typedecl *eolian_type_typedecl_get(const Eolian_Unit *unit, const Eolian_Type *tp);
+ const Eolian_Typedecl *eolian_type_typedecl_get(const Eolian_Type *tp);
- const Eolian_Type *eolian_type_aliased_base_get(const Eolian_Unit *unit, const Eolian_Type *tp);
- const Eolian_Type *eolian_typedecl_aliased_base_get(const Eolian_Unit *unit, const Eolian_Typedecl *tp);
+ const Eolian_Type *eolian_type_aliased_base_get(const Eolian_Type *tp);
+ const Eolian_Type *eolian_typedecl_aliased_base_get(const Eolian_Typedecl *tp);
- const Eolian_Class *eolian_type_class_get(const Eolian_Unit *unit, const Eolian_Type *tp);
+ const Eolian_Class *eolian_type_class_get(const Eolian_Type *tp);
Eina_Bool eolian_type_is_owned(const Eolian_Type *tp);
Eina_Bool eolian_type_is_const(const Eolian_Type *tp);
Eina_Bool eolian_type_is_ptr(const Eolian_Type *tp);
Eina_Bool eolian_typedecl_is_extern(const Eolian_Typedecl *tp);
- const char *eolian_type_c_type_get(const Eolian_Unit *unit, const Eolian_Type *tp, Eolian_C_Type_Type ctype);
- const char *eolian_typedecl_c_type_get(const Eolian_Unit *unit, const Eolian_Typedecl *tp);
-
- const char *eolian_type_name_get(const Eolian_Type *tp);
- const char *eolian_typedecl_name_get(const Eolian_Typedecl *tp);
-
- const char *eolian_type_full_name_get(const Eolian_Type *tp);
- const char *eolian_typedecl_full_name_get(const Eolian_Typedecl *tp);
-
- Eina_Iterator *eolian_type_namespaces_get(const Eolian_Type *tp);
- Eina_Iterator *eolian_typedecl_namespaces_get(const Eolian_Typedecl *tp);
+ const char *eolian_type_c_type_get(const Eolian_Type *tp, Eolian_C_Type_Type ctype);
+ const char *eolian_typedecl_c_type_get(const Eolian_Typedecl *tp);
const char *eolian_type_free_func_get(const Eolian_Type *tp);
const char *eolian_typedecl_free_func_get(const Eolian_Typedecl *tp);
const Eolian_Function *eolian_typedecl_function_pointer_get(const Eolian_Typedecl *tp);
- Eolian_Value_t eolian_expression_eval(const Eolian_Unit *unit, const Eolian_Expression *expr, Eolian_Expression_Mask m);
- Eolian_Value_t eolian_expression_eval_type(const Eolian_Unit *unit, const Eolian_Expression *expr, const Eolian_Type *type);
+ Eolian_Value_t eolian_expression_eval(const Eolian_Expression *expr, Eolian_Expression_Mask m);
+ Eolian_Value_t eolian_expression_eval_type(const Eolian_Expression *expr, const Eolian_Type *type);
const char *eolian_expression_value_to_literal(const Eolian_Value *v);
const char *eolian_expression_serialize(const Eolian_Expression *expr);
Eolian_Expression_Type eolian_expression_type_get(const Eolian_Expression *expr);
@@ -439,29 +436,11 @@ ffi.cdef [[
Eolian_Unary_Operator eolian_expression_unary_operator_get(const Eolian_Expression *expr);
const Eolian_Expression *eolian_expression_unary_expression_get(const Eolian_Expression *expr);
Eolian_Value_t eolian_expression_value_get(const Eolian_Expression *expr);
- const Eolian_Variable *eolian_variable_global_get_by_name(const Eolian_Unit *unit, const char *name);
- const Eolian_Variable *eolian_variable_constant_get_by_name(const Eolian_Unit *unit, const char *name);
- Eina_Iterator *eolian_variable_globals_get_by_file(const Eolian_Unit *unit, const char *fname);
- Eina_Iterator *eolian_variable_constants_get_by_file(const Eolian_Unit *unit, const char *fname);
- Eina_Iterator *eolian_variable_all_constants_get(const Eolian_Unit *unit);
- Eina_Iterator *eolian_variable_all_globals_get(const Eolian_Unit *unit);
Eolian_Variable_Type eolian_variable_type_get(const Eolian_Variable *var);
const Eolian_Documentation *eolian_variable_documentation_get(const Eolian_Variable *var);
- const char *eolian_variable_file_get(const Eolian_Variable *var);
const Eolian_Type *eolian_variable_base_type_get(const Eolian_Variable *var);
const Eolian_Expression *eolian_variable_value_get(const Eolian_Variable *var);
- const char *eolian_variable_name_get(const Eolian_Variable *var);
- const char *eolian_variable_full_name_get(const Eolian_Variable *var);
- Eina_Iterator *eolian_variable_namespaces_get(const Eolian_Variable *var);
Eina_Bool eolian_variable_is_extern(const Eolian_Variable *var);
- const Eolian_Declaration *eolian_declaration_get_by_name(const Eolian_Unit *unit, const char *name);
- Eina_Iterator *eolian_declarations_get_by_file(const Eolian *state, const char *fname);
- Eina_Iterator *eolian_all_declarations_get(const Eolian_Unit *unit);
- Eolian_Declaration_Type eolian_declaration_type_get(const Eolian_Declaration *decl);
- const char *eolian_declaration_name_get(const Eolian_Declaration *decl);
- const Eolian_Class *eolian_declaration_class_get(const Eolian_Declaration *decl);
- const Eolian_Type *eolian_declaration_data_type_get(const Eolian_Declaration *decl);
- const Eolian_Variable *eolian_declaration_variable_get(const Eolian_Declaration *decl);
const char *eolian_documentation_summary_get(const Eolian_Documentation *doc);
const char *eolian_documentation_description_get(const Eolian_Documentation *doc);
const char *eolian_documentation_since_get(const Eolian_Documentation *doc);
@@ -470,7 +449,7 @@ ffi.cdef [[
void eolian_doc_token_init(Eolian_Doc_Token *tok);
Eolian_Doc_Token_Type eolian_doc_token_type_get(const Eolian_Doc_Token *tok);
char *eolian_doc_token_text_get(const Eolian_Doc_Token *tok);
- Eolian_Doc_Ref_Type eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok, const void **data, const void **data2);
+ Eolian_Object_Type eolian_doc_token_ref_resolve(const Eolian_Doc_Token *tok, const Eolian_State *state, const Eolian_Object **data, const Eolian_Object **data2);
]]
local cutil = require("cutil")
@@ -505,6 +484,24 @@ end
cutil.init_module(init, shutdown)
+M.object_type = {
+ UNKNOWN = 0,
+ CLASS = 1,
+ TYPEDECL = 2,
+ STRUCT_FIELD = 3,
+ ENUM_FIELD = 4,
+ TYPE = 5,
+ VARIABLE = 6,
+ EXPRESSION = 7,
+ FUNCTION = 8,
+ FUNCTION_PARAMETER = 9,
+ EVENT = 10,
+ PART = 11,
+ IMPLEMENT = 12,
+ CONSTRUCTOR = 13,
+ DOCUMENTATION = 14
+}
+
M.object_scope = {
UNKNOWN = 0,
PUBLIC = 1,
@@ -512,18 +509,169 @@ M.object_scope = {
PROTECTED = 3
}
-ffi.metatype("Eolian", {
- __index = {
- directory_scan = function(self, dir)
- return eolian.eolian_directory_scan(self, dir) ~= 0
+local cast_obj = function(self)
+ return ffi.cast("const Eolian_Object *", self)
+end
+
+local cast_unit = function(self)
+ return ffi.cast("const Eolian_Unit *", self)
+end
+
+local gen_wrap = function(t)
+ return t, function(tt)
+ return setmetatable(tt, { __index = t })
+ end
+end
+
+local object_idx, wrap_object = gen_wrap {
+ type_get = function(self)
+ return tonumber(eolian.eolian_object_type_get(cast_obj(self)))
+ end,
+
+ line_get = function(self)
+ return tonumber(eolian.eolian_object_line_get(cast_obj(self)))
+ end,
+
+ column_get = function(self)
+ return tonumber(eolian.eolian_object_column_get(cast_obj(self)))
+ end,
+
+ file_get = function(self)
+ local v = eolian.eolian_object_file_get(cast_obj(self))
+ if v == nil then
+ return nil
+ end
+ return ffi.string(v)
+ end,
+
+ name_get = function(self)
+ local v = eolian.eolian_object_name_get(cast_obj(self))
+ if v == nil then
+ return nil
+ end
+ return ffi.string(v)
+ end,
+
+ short_name_get = function(self)
+ local v = eolian.eolian_object_short_name_get(cast_obj(self))
+ if v == nil then
+ return nil
+ end
+ return ffi.string(v)
+ end,
+
+ namespaces_get = function(self)
+ return iterator.String_Iterator(
+ eolian.eolian_object_namespaces_get(cast_obj(self)))
+ end
+}
+
+ffi.metatype("Eolian_Object", { __index = object_idx })
+
+local unit_idx, wrap_unit = gen_wrap {
+ children_get = function(self)
+ return Ptr_Iterator("const Eolian_Unit*",
+ eolian.eolian_unit_children_get(cast_unit(self)))
+ end,
+
+ file_get = function(self)
+ local v = eolian.eolian_unit_file_get(cast_unit(self))
+ if v == nil then return nil end
+ return ffi.string(v)
+ end,
+
+ object_by_name_get = function(self, name)
+ local v = eolian.eolian_unit_object_by_name_get(cast_unit(self), name)
+ if v == nil then return nil end
+ return v
+ end,
+
+ objects_get = function(self, fname)
+ return Ptr_Iterator("const Eolian_Object *",
+ eolian.eolian_unit_objects_get(cast_unit(self), fname))
+ end,
+
+ class_by_name_get = function(self, cname)
+ local v = eolian.eolian_unit_class_by_name_get(cast_unit(self), cname)
+ if v == nil then return nil end
+ return v
+ end,
+
+ classes_get = function(self)
+ return Ptr_Iterator("const Eolian_Class*",
+ eolian.eolian_unit_classes_get(cast_unit(self)))
+ end,
+
+ global_by_name_get = function(self, name)
+ local v = eolian.eolian_unit_global_by_name_get(cast_unit(self), name)
+ if v == nil then return nil end
+ return v
+ end,
+
+ constant_by_name_get = function(self, name)
+ local v = eolian.eolian_unit_constant_by_name_get(cast_unit(self), name)
+ if v == nil then return nil end
+ return v
+ end,
+
+ constants_get = function(self)
+ return Ptr_Iterator("const Eolian_Variable *",
+ eolian.eolian_unit_constants_get(cast_unit(self)))
+ end,
+
+ globals_get = function(self)
+ return Ptr_Iterator("const Eolian_Variable *",
+ eolian.eolian_unit_globals_get(cast_unit(self)))
+ end,
+
+ alias_by_name_get = function(self, name)
+ local v = eolian.eolian_unit_alias_by_name_get(cast_unit(self), name)
+ if v == nil then return nil end
+ return v
+ end,
+
+ struct_by_name_get = function(self, name)
+ local v = eolian.eolian_unit_struct_by_name_get(cast_unit(self), name)
+ if v == nil then return nil end
+ return v
+ end,
+
+ enum_by_name_get = function(self, name)
+ local v = eolian.eolian_unit_enum_by_name_get(cast_unit(self), name)
+ if v == nil then return nil end
+ return v
+ end,
+
+ aliases_get = function(self)
+ return Ptr_Iterator("const Eolian_Typedecl *",
+ eolian.eolian_unit_aliases_get(cast_unit(self)))
+ end,
+
+ structs_get = function(self)
+ return Ptr_Iterator("const Eolian_Typedecl *",
+ eolian.eolian_unit_structs_get(cast_unit(self)))
+ end,
+
+ enums_get = function(self)
+ return Ptr_Iterator("const Eolian_Typedecl *",
+ eolian.eolian_unit_enums_get(cast_unit(self)))
+ end
+}
+
+ffi.metatype("Eolian_Unit", { __index = unit_idx })
+
+ffi.metatype("Eolian_State", {
+ __index = wrap_unit {
+ directory_add = function(self, dir)
+ return eolian.eolian_state_directory_add(self, dir) ~= 0
end,
- system_directory_scan = function(self)
- return eolian.eolian_system_directory_scan(self) ~= 0
+ system_directory_add = function(self)
+ return eolian.eolian_state_system_directory_add(self) ~= 0
end,
file_parse = function(self, fpath)
- local v = eolian.eolian_file_parse(self, fpath)
+ local v = eolian.eolian_state_file_parse(self, fpath)
if v == nil then
return nil
end
@@ -531,56 +679,95 @@ ffi.metatype("Eolian", {
end,
all_eo_files_parse = function(self)
- return eolian.eolian_all_eo_files_parse(self) ~= 0
+ return eolian.eolian_state_all_eo_files_parse(self) ~= 0
end,
all_eot_files_parse = function(self)
- return eolian.eolian_all_eot_files_parse(self) ~= 0
+ return eolian.eolian_state_all_eot_files_parse(self) ~= 0
end,
- all_eo_file_paths_get = function(self)
- return iterator.String_Iterator(eolian.eolian_all_eo_file_paths_get(self))
+ check = function(self)
+ return eolian.eolian_state_check(self) ~= 0
end,
- all_eot_file_paths_get = function(self)
- return iterator.String_Iterator(eolian.eolian_all_eot_file_paths_get(self))
+ eo_file_paths_get = function(self)
+ return iterator.String_Iterator(eolian.eolian_state_eo_file_paths_get(self))
end,
- all_eo_files_get = function(self)
- return iterator.String_Iterator(eolian.eolian_all_eo_files_get(self))
+ eot_file_paths_get = function(self)
+ return iterator.String_Iterator(eolian.eolian_state_eot_file_paths_get(self))
end,
- all_eot_files_get = function(self)
- return iterator.String_Iterator(eolian.eolian_all_eot_files_get(self))
+ eo_files_get = function(self)
+ return iterator.String_Iterator(eolian.eolian_state_eo_files_get(self))
end,
- declarations_get_by_file = function(self, fname)
- return Ptr_Iterator("const Eolian_Declaration*",
- eolian.eolian_declarations_get_by_file(self, fname))
+ eot_files_get = function(self)
+ return iterator.String_Iterator(eolian.eolian_state_eot_files_get(self))
end,
unit_get = function(self)
return ffi.cast("Eolian_Unit *", self)
+ end,
+
+ unit_by_file_get = function(self, fname)
+ local v = eolian.eolian_state_unit_by_file_get(state, fname)
+ if v == nil then
+ return nil
+ end
+ return v
+ end,
+
+ units_get = function(self)
+ return Ptr_Iterator("const Eolian_Unit*",
+ eolian.eolian_state_units_get(self))
+ end,
+
+ objects_by_file_get = function(self, fname)
+ return Ptr_Iterator("const Eolian_Object *",
+ eolian.eolian_state_objects_by_file_get(self, fname))
+ end,
+
+ class_by_file_get = function(self, fname)
+ local v = eolian.eolian_state_class_by_file_get(self, fname)
+ if v == nil then return nil end
+ return v
+ end,
+
+ globals_by_file_get = function(unit, fname)
+ return Ptr_Iterator("const Eolian_Variable*",
+ eolian.eolian_state_globals_by_file_get(self, fname))
+ end,
+
+ constants_by_file_get = function(unit, fname)
+ return Ptr_Iterator("const Eolian_Variable*",
+ eolian.eolian_state_constants_by_file_get(self, fname))
+ end,
+
+ aliases_by_file_get = function(self, fname)
+ return Ptr_Iterator("const Eolian_Typedecl *",
+ eolian.eolian_state_aliases_by_file_get(self, fname))
+ end,
+
+ structs_by_file_get = function(self, fname)
+ return Ptr_Iterator("const Eolian_Typedecl *",
+ eolian.eolian_state_structs_by_file_get(self, fname))
+ end,
+
+ enums_by_file_get = function(self, fname)
+ return Ptr_Iterator("const Eolian_Typedecl *",
+ eolian.eolian_state_enums_by_file_get(self, fname))
end
},
__gc = function(self)
- eolian.eolian_free(self)
+ eolian.eolian_state_free(self)
end
})
M.new = function()
- return eolian.eolian_new()
+ return eolian.eolian_state_new()
end
-M.declaration_type = {
- UNKNOWN = 0,
- CLASS = 0,
- ALIAS = 1,
- STRUCT = 2,
- ENUM = 3,
- VAR = 4
-}
-
M.type_type = {
UNKNOWN = 0,
VOID = 1,
@@ -665,13 +852,7 @@ M.c_type_type = {
}
ffi.metatype("Eolian_Struct_Type_Field", {
- __index = {
- name_get = function(self)
- local v = eolian.eolian_typedecl_struct_field_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
+ __index = wrap_object {
documentation_get = function(self)
local v = eolian.eolian_typedecl_struct_field_documentation_get(self)
if v == nil then return nil end
@@ -687,13 +868,7 @@ ffi.metatype("Eolian_Struct_Type_Field", {
})
ffi.metatype("Eolian_Enum_Type_Field", {
- __index = {
- name_get = function(self)
- local v = eolian.eolian_typedecl_enum_field_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
+ __index = wrap_object {
c_name_get = function(self)
local v = eolian.eolian_typedecl_enum_field_c_name_get(self)
if v == nil then return nil end
@@ -715,7 +890,7 @@ ffi.metatype("Eolian_Enum_Type_Field", {
})
M.Typedecl = ffi.metatype("Eolian_Typedecl", {
- __index = {
+ __index = wrap_object {
type_get = function(self)
return tonumber(eolian.eolian_typedecl_type_get(self))
end,
@@ -754,20 +929,14 @@ M.Typedecl = ffi.metatype("Eolian_Typedecl", {
return v
end,
- file_get = function(self, name)
- local v = eolian.eolian_typedecl_file_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
base_type_get = function(self)
local v = eolian.eolian_typedecl_base_type_get(self)
if v == nil then return nil end
return v
end,
- aliased_base_get = function(self, unit)
- local v = eolian.eolian_typedecl_aliased_byse_get(unit, self)
+ aliased_base_get = function(self)
+ local v = eolian.eolian_typedecl_aliased_byse_get(self)
if v == nil then return nil end
return v
end,
@@ -776,29 +945,12 @@ M.Typedecl = ffi.metatype("Eolian_Typedecl", {
return eolian.eolian_typedecl_is_extern(self) ~= 0
end,
- c_type_get = function(self, unit)
- local v = eolian.eolian_typedecl_c_type_get(unit, self)
+ c_type_get = function(self)
+ local v = eolian.eolian_typedecl_c_type_get(self)
if v == nil then return nil end
return ffi_stringshare(v)
end,
- name_get = function(self)
- local v = eolian.eolian_typedecl_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
- full_name_get = function(self)
- local v = eolian.eolian_typedecl_full_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
- namespaces_get = function(self)
- return iterator.String_Iterator(
- eolian.eolian_typedecl_namespaces_get(self))
- end,
-
free_func_get = function(self)
local v = eolian.eolian_typedecl_free_func_get(self)
if v == nil then return nil end
@@ -814,7 +966,7 @@ M.Typedecl = ffi.metatype("Eolian_Typedecl", {
})
M.Type = ffi.metatype("Eolian_Type", {
- __index = {
+ __index = wrap_object {
type_get = function(self)
return tonumber(eolian.eolian_type_type_get(self))
end,
@@ -823,12 +975,6 @@ M.Type = ffi.metatype("Eolian_Type", {
return tonumber(eolian.eolian_type_builtin_type_get(self))
end,
- file_get = function(self, name)
- local v = eolian.eolian_type_file_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
base_type_get = function(self)
local v = eolian.eolian_type_base_type_get(self)
if v == nil then return nil end
@@ -841,20 +987,20 @@ M.Type = ffi.metatype("Eolian_Type", {
return v
end,
- typedecl_get = function(self, unit)
- local v = eolian.eolian_type_typedecl_get(unit, self)
+ typedecl_get = function(self)
+ local v = eolian.eolian_type_typedecl_get(self)
if v == nil then return nil end
return v
end,
- aliased_base_get = function(self, unit)
- local v = eolian.eolian_type_aliased_byse_get(unit, self)
+ aliased_base_get = function(self)
+ local v = eolian.eolian_type_aliased_byse_get(self)
if v == nil then return nil end
return v
end,
- class_get = function(self, unit)
- local v = eolian.eolian_type_class_get(unit, self)
+ class_get = function(self)
+ local v = eolian.eolian_type_class_get(self)
if v == nil then return nil end
return v
end,
@@ -871,29 +1017,12 @@ M.Type = ffi.metatype("Eolian_Type", {
return eolian.eolian_type_is_ptr(self) ~= 0
end,
- c_type_get = function(self, unit, ctype)
- local v = eolian.eolian_type_c_type_get(unit, self, ctype)
+ c_type_get = function(self, ctype)
+ local v = eolian.eolian_type_c_type_get(self, ctype)
if v == nil then return nil end
return ffi_stringshare(v)
end,
- name_get = function(self)
- local v = eolian.eolian_type_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
- full_name_get = function(self)
- local v = eolian.eolian_type_full_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
- namespaces_get = function(self)
- return iterator.String_Iterator(
- eolian.eolian_type_namespaces_get(self))
- end,
-
free_func_get = function(self)
local v = eolian.eolian_type_free_func_get(self)
if v == nil then return nil end
@@ -912,7 +1041,7 @@ M.function_type = {
}
M.Function = ffi.metatype("Eolian_Function", {
- __index = {
+ __index = wrap_object {
type_get = function(self)
return tonumber(eolian.eolian_function_type_get(self))
end,
@@ -921,12 +1050,6 @@ M.Function = ffi.metatype("Eolian_Function", {
return tonumber(eolian.eolian_function_scope_get(self, ftype))
end,
- name_get = function(self)
- local v = eolian.eolian_function_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
full_c_name_get = function(self, ftype, use_legacy)
local v = eolian.eolian_function_full_c_name_get(self, ftype, use_legacy or false)
if v == nil then return nil end
@@ -1017,7 +1140,7 @@ M.parameter_dir = {
}
ffi.metatype("Eolian_Function_Parameter", {
- __index = {
+ __index = wrap_object {
direction_get = function(self)
return tonumber(eolian.eolian_parameter_direction_get(self))
end,
@@ -1034,12 +1157,6 @@ ffi.metatype("Eolian_Function_Parameter", {
return v
end,
- name_get = function(self)
- local v = eolian.eolian_parameter_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
documentation_get = function(self)
local v = eolian.eolian_parameter_documentation_get(self)
if v == nil then return nil end
@@ -1061,13 +1178,7 @@ ffi.metatype("Eolian_Function_Parameter", {
})
ffi.metatype("Eolian_Implement", {
- __index = {
- full_name_get = function(self)
- local v = eolian.eolian_implement_full_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
+ __index = wrap_object {
class_get = function(self)
local v = eolian.eolian_implement_class_get(self)
if v == nil then return nil end
@@ -1110,13 +1221,7 @@ ffi.metatype("Eolian_Implement", {
})
ffi.metatype("Eolian_Constructor", {
- __index = {
- full_name_get = function(self)
- local v = eolian.eolian_constructor_full_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
+ __index = wrap_object {
class_get = function(self)
local v = eolian.eolian_constructor_class_get(self)
if v == nil then return nil end
@@ -1136,13 +1241,7 @@ ffi.metatype("Eolian_Constructor", {
})
ffi.metatype("Eolian_Event", {
- __index = {
- name_get = function(self)
- local v = eolian.eolian_event_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
+ __index = wrap_object {
type_get = function(self)
local v = eolian.eolian_event_type_get(self)
if v == nil then return nil end
@@ -1179,23 +1278,6 @@ ffi.metatype("Eolian_Event", {
}
})
-M.class_get_by_name = function(unit, cname)
- local v = eolian.eolian_class_get_by_name(unit, cname)
- if v == nil then return nil end
- return v
-end
-
-M.class_get_by_file = function(unit, fname)
- local v = eolian.eolian_class_get_by_file(unit, fname)
- if v == nil then return nil end
- return v
-end
-
-M.all_classes_get = function(unit)
- return Ptr_Iterator("const Eolian_Class*",
- eolian.eolian_all_classes_get(unit))
-end
-
M.class_type = {
UNKNOWN = 0,
REGULAR = 1,
@@ -1205,30 +1287,7 @@ M.class_type = {
}
M.Class = ffi.metatype("Eolian_Class", {
- __index = {
- file_get = function(self)
- local v = eolian.eolian_class_file_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
- full_name_get = function(self)
- local v = eolian.eolian_class_full_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
- name_get = function(self)
- local v = eolian.eolian_class_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
- namespaces_get = function(self)
- return iterator.String_Iterator(
- eolian.eolian_class_namespaces_get(self))
- end,
-
+ __index = wrap_object {
type_get = function(self)
return tonumber(eolian.eolian_class_type_get(self))
end,
@@ -1249,7 +1308,7 @@ M.Class = ffi.metatype("Eolian_Class", {
local v = eolian.eolian_class_eo_prefix_get(self)
if v == nil then
local buf = self:namespaces_get()
- buf[#buf + 1] = self:name_get()
+ buf[#buf + 1] = self:short_name_get()
return table.concat(buf, "_"):lower()
end
return ffi.string(v)
@@ -1271,8 +1330,8 @@ M.Class = ffi.metatype("Eolian_Class", {
eolian.eolian_class_functions_get(self, func_type))
end,
- function_get_by_name = function(self, fname, ftype)
- local v = eolian.eolian_class_function_get_by_name(self, fname,
+ function_by_name_get = function(self, fname, ftype)
+ local v = eolian.eolian_class_function_by_name_get(self, fname,
ftype)
if v == nil then return nil end
return v
@@ -1309,54 +1368,6 @@ M.Class = ffi.metatype("Eolian_Class", {
}
})
-M.typedecl_alias_get_by_name = function(unit, name)
- local v = eolian.eolian_typedecl_alias_get_by_name(unit, name)
- if v == nil then return nil end
- return v
-end
-
-M.typedecl_struct_get_by_name = function(unit, name)
- local v = eolian.eolian_typedecl_struct_get_by_name(unit, name)
- if v == nil then return nil end
- return v
-end
-
-M.typedecl_enum_get_by_name = function(unit, name)
- local v = eolian.eolian_typedecl_enum_get_by_name(unit, name)
- if v == nil then return nil end
- return v
-end
-
-M.typedecl_aliases_get_by_file = function(unit, fname)
- return Ptr_Iterator("const Eolian_Typedecl *",
- eolian.eolian_type_aliases_get_by_file(unit, self))
-end
-
-M.typedecl_structs_get_by_file = function(unit, fname)
- return Ptr_Iterator("const Eolian_Typedecl *",
- eolian.eolian_type_structs_get_by_file(unit, self))
-end
-
-M.typedecl_enums_get_by_file = function(unit, fname)
- return Ptr_Iterator("const Eolian_Typedecl *",
- eolian.eolian_type_enums_get_by_file(unit, self))
-end
-
-M.typedecl_all_aliases_get = function(unit)
- return Ptr_Iterator("const Eolian_Typedecl *",
- eolian.eolian_typedecl_all_aliases_get(unit))
-end
-
-M.typedecl_all_structs_get = function(unit)
- return Ptr_Iterator("const Eolian_Typedecl *",
- eolian.eolian_typedecl_all_structs_get(unit))
-end
-
-M.typedecl_all_enums_get = function(unit)
- return Ptr_Iterator("const Eolian_Typedecl *",
- eolian.eolian_typedecl_all_enums_get(unit))
-end
-
M.expression_type = {
UNKNOWN = 0,
INT = 1,
@@ -1475,16 +1486,16 @@ M.unary_operator = {
}
M.Expression = ffi.metatype("Eolian_Expression", {
- __index = {
- eval = function(self, unit, mask)
+ __index = wrap_object {
+ eval = function(self, mask)
mask = mask or emask.ALL
- local v = eolian.eolian_expression_eval(unit, self, mask)
+ local v = eolian.eolian_expression_eval(self, mask)
if v == nil then return nil end
return ffi.cast("Eolian_Value*", v)
end,
- eval_type = function(self, unit, tp)
- local v = eolian.eolian_expression_eval_type(unit, self, tp)
+ eval_type = function(self, tp)
+ local v = eolian.eolian_expression_eval_type(self, tp)
if v == nil then return nil end
return ffi.cast("Eolian_Value*", v)
end,
@@ -1533,40 +1544,8 @@ M.Expression = ffi.metatype("Eolian_Expression", {
}
})
-M.variable_global_get_by_name = function(unit, name)
- local v = eolian.eolian_variable_global_get_by_name(unit, name)
- if v == nil then return nil end
- return v
-end
-
-M.variable_constant_get_by_name = function(unit, name)
- local v = eolian.eolian_variable_constant_get_by_name(unit, name)
- if v == nil then return nil end
- return v
-end
-
-M.variable_globals_get_by_file = function(unit, fname)
- return Ptr_Iterator("const Eolian_Variable*",
- eolian.eolian_variable_globals_get_by_file(unit, fname))
-end
-
-M.variable_constants_get_by_file = function(unit, fname)
- return Ptr_Iterator("const Eolian_Variable*",
- eolian.eolian_variable_constants_get_by_file(unit, fname))
-end
-
-M.variable_all_constants_get = function(unit)
- return Ptr_Iterator("const Eolian_Variable *",
- eolian.eolian_variable_all_constants_get(unit))
-end
-
-M.variable_all_globals_get = function(unit)
- return Ptr_Iterator("const Eolian_Variable *",
- eolian.eolian_variable_all_globals_get(unit))
-end
-
M.Variable = ffi.metatype("Eolian_Variable", {
- __index = {
+ __index = wrap_object {
type_get = function(self)
return tonumber(eolian.eolian_variable_type_get(self))
end,
@@ -1577,12 +1556,6 @@ M.Variable = ffi.metatype("Eolian_Variable", {
return v
end,
- file_get = function(self)
- local v = eolian.eolian_variable_file_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
base_type_get = function(self)
local v = eolian.eolian_variable_base_type_get(self)
if v == nil then return nil end
@@ -1595,76 +1568,14 @@ M.Variable = ffi.metatype("Eolian_Variable", {
return v
end,
- name_get = function(self)
- local v = eolian.eolian_variable_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
- full_name_get = function(self)
- local v = eolian.eolian_variable_full_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
- namespaces_get = function(self)
- return iterator.String_Iterator(
- eolian.eolian_variable_namespaces_get(self))
- end,
-
is_extern = function(self)
return eolian.eolian_variable_is_extern(self) ~= 0
end
}
})
-M.declaration_get_by_name = function(unit, name)
- local v = eolian.eolian_declaration_get_by_name(unit, name)
- if v == nil then
- return nil
- end
- return v
-end
-
-M.all_declarations_get = function(unit)
- return Ptr_Iterator("const Eolian_Declaration *",
- eolian.eolian_all_declarations_get(unit))
-end
-
-M.Declaration = ffi.metatype("Eolian_Declaration", {
- __index = {
- type_get = function(self)
- return tonumber(eolian.eolian_declaration_type_get(self))
- end,
-
- name_get = function(self)
- local v = eolian.eolian_declaration_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
- class_get = function(self)
- local v = eolian.eolian_declaration_class_get(self)
- if v == nil then return nil end
- return v
- end,
-
- data_type_get = function(self)
- local v = eolian.eolian_declaration_data_type_get(self)
- if v == nil then return nil end
- return v
- end,
-
- variable_get = function(self)
- local v = eolian.eolian_declaration_variable_get(self)
- if v == nil then return nil end
- return v
- end
- }
-})
-
M.Documentation = ffi.metatype("Eolian_Documentation", {
- __index = {
+ __index = wrap_object {
summary_get = function(self)
local v = eolian.eolian_documentation_summary_get(self)
if v == nil then return nil end
@@ -1696,19 +1607,6 @@ M.doc_token_type = {
MARKUP_MONOSPACE = 7
}
-M.doc_ref_type = {
- INVALID = 0,
- CLASS = 1,
- FUNC = 2,
- EVENT = 3,
- ALIAS = 4,
- STRUCT = 5,
- STRUCT_FIELD = 6,
- ENUM = 7,
- ENUM_FIELD = 8,
- VAR = 9
-}
-
M.documentation_string_split = function(str)
if not str then
return {}
@@ -1759,10 +1657,10 @@ M.Eolian_Doc_Token = ffi.metatype("Eolian_Doc_Token", {
return ret
end,
- ref_get = function(self, unit)
- local stor = ffi.new("const void *[2]")
- local tp = tonumber(eolian.eolian_doc_token_ref_get(unit, self, stor, stor + 1))
- local reft = M.doc_ref_type
+ ref_resolve = function(self, state)
+ local stor = ffi.new("const Eolian_Object *[2]")
+ local tp = tonumber(eolian.eolian_doc_token_ref_resolve(self, state, stor, stor + 1))
+ local reft = M.object_type
if tp == reft.CLASS then
return tp, ffi.cast("const Eolian_Class *", stor[0])
elseif tp == reft.FUNC then
@@ -1786,7 +1684,7 @@ M.Eolian_Doc_Token = ffi.metatype("Eolian_Doc_Token", {
elseif tp == reft.VAR then
return tp, ffi.cast("const Eolian_Variable *", stor[0])
else
- return reft.INVALID
+ return reft.UNKNOWN
end
end
}
diff --git a/src/bindings/mono/ecore_evas_mono/ecore_evas.cs b/src/bindings/mono/ecore_evas_mono/ecore_evas.cs
index 81609f4736..c7a27dde29 100644
--- a/src/bindings/mono/ecore_evas_mono/ecore_evas.cs
+++ b/src/bindings/mono/ecore_evas_mono/ecore_evas.cs
@@ -29,9 +29,9 @@ public class EcoreEvas
ecore_evas_show(handle);
}
- public efl.canvas.Object canvas
+ public efl.canvas.IObject canvas
{
- get { return new efl.canvas.ObjectConcrete(ecore_evas_get(handle)); }
+ get { return new efl.canvas.Object(ecore_evas_get(handle)); }
}
}
diff --git a/src/bindings/mono/efl_mono/efl_all.cs b/src/bindings/mono/efl_mono/efl_all.cs
index 440f44b773..0d5821b0e9 100644
--- a/src/bindings/mono/efl_mono/efl_all.cs
+++ b/src/bindings/mono/efl_mono/efl_all.cs
@@ -65,7 +65,7 @@ public static class Config {
// TODO Support elm command line arguments
#if WIN32 // Not a native define, we define it in our build system
// Ecore_Win32 uses OleInitialize, which requires single thread apartments
- if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA)
+ if (System.Threading.Thread.CurrentThread.GetApartmentState() != ApartmentState.STA)
throw new InvalidOperationException("UI Applications require STAThreadAttribute in Main()");
#endif
elm_init(0, IntPtr.Zero);
diff --git a/src/bindings/mono/eina_mono/eina_accessor.cs b/src/bindings/mono/eina_mono/eina_accessor.cs
new file mode 100644
index 0000000000..b3af7cccde
--- /dev/null
+++ b/src/bindings/mono/eina_mono/eina_accessor.cs
@@ -0,0 +1,126 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+using static eina.TraitFunctions;
+
+using static eina.AccessorNativeFunctions;
+
+namespace eina {
+
+internal class AccessorNativeFunctions
+{
+ [DllImport(efl.Libs.Eina)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool
+ eina_accessor_data_get(IntPtr accessor, uint position, IntPtr data);
+ [DllImport(efl.Libs.Eina)] public static extern void
+ eina_accessor_free(IntPtr accessor);
+}
+
+/// <summary>Accessors provide an uniform way of accessing Eina containers, similar to C++ STL's and C# IEnumerable.</summary>
+public class Accessor<T> : IEnumerable<T>, IDisposable
+{
+ /// <summary>Pointer to the native accessor.</summary>
+ public IntPtr Handle { get; private set; } = IntPtr.Zero;
+
+ /// <summary>Who is in charge of releasing the resources wrapped by this instance.</summary>
+ private Ownership Ownership { get; set; }
+
+ // FIXME Part of the implicit EFL Container interface. Need to make it explicit.
+ public bool Own
+ {
+ get
+ {
+ return Ownership == Ownership.Managed;
+ }
+ set
+ {
+ Ownership = value ? Ownership.Managed : Ownership.Unmanaged;
+ }
+ }
+
+ /// <summary>Create a new accessor wrapping the given pointer.</summary>
+ public Accessor(IntPtr handle, Ownership owner=Ownership.Managed)
+ {
+ Handle = handle;
+ Ownership = owner;
+ }
+
+ public Accessor(IntPtr handle, bool own, bool ownContent=false)
+ : this(handle, own ? Ownership.Managed : Ownership.Unmanaged)
+ {
+ }
+
+ /// <summary>Release the native resources held by this instance.</summary>
+ public void Dispose()
+ {
+ Dispose(true);
+ }
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (Ownership == Ownership.Managed && Handle != IntPtr.Zero)
+ {
+ eina_accessor_free(Handle);
+ Handle = IntPtr.Zero;
+ }
+ }
+
+ ~Accessor()
+ {
+ Dispose(false);
+ }
+
+ public virtual T Convert(IntPtr data)
+ {
+ return NativeToManaged<T>(data);
+ }
+
+ /// <summary>Returns an enumerator that iterates throught this accessor.</summary>
+ public IEnumerator<T> GetEnumerator()
+ {
+ if (Handle == IntPtr.Zero)
+ throw new ObjectDisposedException(base.GetType().Name);
+ IntPtr tmp = MemoryNative.Alloc(Marshal.SizeOf(typeof(IntPtr)));
+ uint position = 0;
+
+ try
+ {
+ while(eina_accessor_data_get(Handle, position, tmp))
+ {
+ IntPtr data = (IntPtr)Marshal.PtrToStructure(tmp, typeof(IntPtr));
+ yield return Convert(data);
+ position += 1;
+ }
+ }
+ finally
+ {
+ MemoryNative.Free(tmp);
+ }
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return this.GetEnumerator();
+ }
+}
+
+public class AccessorInList<T> : Accessor<T>
+{
+ public AccessorInList(IntPtr handle, Ownership own): base(handle, own) {}
+ public override T Convert(IntPtr data)
+ {
+ return NativeToManagedInlistNode<T>(data);
+ }
+}
+
+public class AccessorInArray<T> : Accessor<T>
+{
+ public AccessorInArray(IntPtr handle, Ownership own): base(handle, own) {}
+ public override T Convert(IntPtr data)
+ {
+ return NativeToManagedInplace<T>(data);
+ }
+}
+
+}
diff --git a/src/bindings/mono/eina_mono/eina_array.cs b/src/bindings/mono/eina_mono/eina_array.cs
index 6156c0cbb1..86e69fc407 100644
--- a/src/bindings/mono/eina_mono/eina_array.cs
+++ b/src/bindings/mono/eina_mono/eina_array.cs
@@ -24,6 +24,8 @@ public static class ArrayNativeFunctions
[DllImport(efl.Libs.Eina)] public static extern IntPtr
eina_array_iterator_new(IntPtr array);
+ [DllImport(efl.Libs.Eina)] public static extern IntPtr
+ eina_array_accessor_new(IntPtr array);
[DllImport(efl.Libs.CustomExports)] public static extern void
eina_array_clean_custom_export_mono(IntPtr array);
@@ -288,6 +290,12 @@ public class Array<T> : IEnumerable<T>, IDisposable
{
return this.GetEnumerator();
}
+
+ /// <summary> Gets an Accessor for this Array.</summary>
+ public eina.Accessor<T> GetAccessor()
+ {
+ return new eina.Accessor<T>(eina_array_accessor_new(Handle), Ownership.Managed);
+ }
}
}
diff --git a/src/bindings/mono/eina_mono/eina_common.cs b/src/bindings/mono/eina_mono/eina_common.cs
index 4bd93ce25b..2a9766cd4d 100644
--- a/src/bindings/mono/eina_mono/eina_common.cs
+++ b/src/bindings/mono/eina_mono/eina_common.cs
@@ -23,6 +23,8 @@ internal static class NativeCustomExportFunctions
[DllImport(efl.Libs.CustomExports)] public static extern IntPtr
efl_mono_native_alloc(uint count);
[DllImport(efl.Libs.CustomExports)] public static extern IntPtr
+ efl_mono_native_memset(IntPtr ptr, uint fill, uint count);
+ [DllImport(efl.Libs.CustomExports)] public static extern IntPtr
efl_mono_native_alloc_copy(IntPtr val, uint size);
[DllImport(efl.Libs.CustomExports)] public static extern IntPtr
efl_mono_native_strdup(string str);
@@ -56,6 +58,11 @@ public static class MemoryNative {
return NativeCustomExportFunctions.efl_mono_native_alloc(Convert.ToUInt32(count));
}
+ public static void Memset(IntPtr ptr, int fill, int count)
+ {
+ NativeCustomExportFunctions.efl_mono_native_memset(ptr, Convert.ToUInt32(fill), Convert.ToUInt32(count));
+ }
+
public static IntPtr AllocCopy(IntPtr ptr, int count)
{
return NativeCustomExportFunctions.efl_mono_native_alloc_copy(ptr, Convert.ToUInt32(count));
@@ -110,11 +117,9 @@ public static class PrimitiveConversion
public static IntPtr ManagedToPointerAlloc<T>(T man)
{
- GCHandle pinnedData = GCHandle.Alloc(man, GCHandleType.Pinned);
- IntPtr ptr = pinnedData.AddrOfPinnedObject();
- IntPtr nat = MemoryNative.AllocCopy(ptr, Marshal.SizeOf<T>());
- pinnedData.Free();
- return nat;
+ IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf<T>());
+ Marshal.StructureToPtr(man, ptr, false);
+ return ptr;
}
}
@@ -147,18 +152,12 @@ public static class StringConversion
}
}
-public struct Unicode {
- private uint val;
-
- public static implicit operator Unicode(uint x)
- {
- return new Unicode{val=x};
- }
- public static implicit operator uint(Unicode x)
- {
- return x.val;
- }
+/// <summary>Enum to handle resource ownership between managed and unmanaged code.</summary>
+public enum Ownership {
+ /// <summary> The resource is owned by the managed code. It should free the handle on disposal.</summary>
+ Managed,
+ /// <summary> The resource is owned by the unmanaged code. It won't be freed on disposal.</summary>
+ Unmanaged
}
-
}
diff --git a/src/bindings/mono/eina_mono/eina_container_common.cs b/src/bindings/mono/eina_mono/eina_container_common.cs
index 173f54d905..d40ddd8a23 100644
--- a/src/bindings/mono/eina_mono/eina_container_common.cs
+++ b/src/bindings/mono/eina_mono/eina_container_common.cs
@@ -1,6 +1,7 @@
#pragma warning disable 1591
using System;
+using System.Linq;
using System.Runtime.InteropServices;
using System.Collections.Generic;
@@ -522,19 +523,41 @@ public static class TraitFunctions
private static IDictionary<System.Type, object> register = new Dictionary<System.Type, object>();
+ private static System.Type AsEflInstantiableType(System.Type type)
+ {
+ if (!IsEflObject(type))
+ return null;
+
+ if (type.IsInterface)
+ {
+ string[] names = type.FullName.Split('.');
+ names[names.Count() - 1] = names.Last().Substring(1); // Remove the leading 'I' (What about user-defined interfaces?)
+
+ string fullName = string.Join(".", names);
+ return type.Assembly.GetType(fullName); // That was our best guess...
+ }
+
+
+ System.Type current = type;
+ while (current != null)
+ {
+ if (current.Name.EndsWith("Inherit"))
+ throw new Exception("Inherit-based classes are not currently supported.");
+ current = current.BaseType;
+ }
+
+ return type; // Not inherited neither interface, so it should be a concrete.
+ }
+
public static object RegisterTypeTraits<T>()
{
object traits;
var type = typeof(T);
if (IsEflObject(type))
{
- System.Type concrete = type;
- if (!type.Name.EndsWith("Concrete"))
- {
- var c = type.Assembly.GetType(type.FullName + "Concrete");
- if (c != null && type.IsAssignableFrom(c))
- concrete = c;
- }
+ System.Type concrete = AsEflInstantiableType(type);
+ if (concrete == null || !type.IsAssignableFrom(concrete))
+ throw new Exception("Failed to get a suitable concrete class for this type.");
traits = new EflObjectElementTraits<T>(concrete);
}
else if (IsString(type))
diff --git a/src/bindings/mono/eina_mono/eina_error.cs b/src/bindings/mono/eina_mono/eina_error.cs
index c83728047e..4271df8cea 100644
--- a/src/bindings/mono/eina_mono/eina_error.cs
+++ b/src/bindings/mono/eina_mono/eina_error.cs
@@ -19,6 +19,7 @@ public struct Error : IComparable<Error>
public static Error NO_ERROR = new Error(0);
public static Error EPERM = new Error(1);
public static Error ENOENT = new Error(2);
+ public static Error ECANCELED = new Error(125);
public Error(int value) { code = value; }
static public implicit operator Error(int val)
@@ -38,15 +39,11 @@ public struct Error : IComparable<Error>
return "eina.Error(" + code + ")";
}
- public static void Init()
+ internal static void Init()
{
- if (eina_init() == 0)
- throw (new efl.EflException("Failed to init Eina"));
-
EFL_ERROR = eina_error_msg_register("Managed Code Error");
}
- [DllImport(efl.Libs.Eina)] private static extern int eina_init();
[DllImport(efl.Libs.Eina)] static extern Error eina_error_msg_register(string msg);
[DllImport(efl.Libs.Eina)] static extern Error eina_error_get();
[DllImport(efl.Libs.Eina)] static extern void eina_error_set(Error error);
diff --git a/src/bindings/mono/eina_mono/eina_inarray.cs b/src/bindings/mono/eina_mono/eina_inarray.cs
index e246af83f0..a9d3116a34 100644
--- a/src/bindings/mono/eina_mono/eina_inarray.cs
+++ b/src/bindings/mono/eina_mono/eina_inarray.cs
@@ -321,6 +321,12 @@ public class Inarray<T> : IEnumerable<T>, IDisposable
{
return this.GetEnumerator();
}
+
+ /// <summary> Gets an Accessor for this Array.</summary>
+ public eina.Accessor<T> GetAccessor()
+ {
+ return new eina.AccessorInArray<T>(eina_inarray_accessor_new(Handle), Ownership.Managed);
+ }
}
}
diff --git a/src/bindings/mono/eina_mono/eina_inlist.cs b/src/bindings/mono/eina_mono/eina_inlist.cs
index 7b69924a9a..c3392a2db8 100644
--- a/src/bindings/mono/eina_mono/eina_inlist.cs
+++ b/src/bindings/mono/eina_mono/eina_inlist.cs
@@ -313,6 +313,12 @@ public class Inlist<T> : IEnumerable<T>, IDisposable
{
return this.GetEnumerator();
}
+
+ /// <summary> Gets an Accessor for this List.</summary>
+ public eina.Accessor<T> GetAccessor()
+ {
+ return new eina.AccessorInList<T>(eina_inlist_accessor_new(Handle), Ownership.Managed);
+ }
}
}
diff --git a/src/bindings/mono/eina_mono/eina_list.cs b/src/bindings/mono/eina_mono/eina_list.cs
index cef766f331..e31a8ffed3 100644
--- a/src/bindings/mono/eina_mono/eina_list.cs
+++ b/src/bindings/mono/eina_mono/eina_list.cs
@@ -349,6 +349,12 @@ public class List<T> : IEnumerable<T>, IDisposable
{
return this.GetEnumerator();
}
+
+ /// <summary> Gets an Accessor for this List.</summary>
+ public eina.Accessor<T> GetAccessor()
+ {
+ return new eina.Accessor<T>(eina_list_accessor_new(Handle), Ownership.Managed);
+ }
}
}
diff --git a/src/bindings/mono/eina_mono/eina_log.cs b/src/bindings/mono/eina_mono/eina_log.cs
index 747f8ec58c..c5e456c3a6 100644
--- a/src/bindings/mono/eina_mono/eina_log.cs
+++ b/src/bindings/mono/eina_mono/eina_log.cs
@@ -9,8 +9,6 @@ namespace eina { // Manual wrappers around eina functions
public class Log
{
- [DllImport(efl.Libs.Eina)] private static extern int eina_init();
-
[DllImport(efl.Libs.Eina)] private static extern void eina_log_print(
int domain,
Level level,
@@ -55,16 +53,11 @@ public class Log
private static int domain = -1;
- public static void Init(String name="mono", String color="\033[32;1m")
+ internal static void Init(String name="mono", String color="\033[32;1m")
{
if (domain == -1)
{
// Maybe move this check outside when other eina stuff get support?
- if (eina_init() == 0)
- {
- Console.WriteLine("Error: Can't initialize Eina for logging.");
- return;
- }
domain = eina_log_domain_register(name, color);
if (domain < 0)
Console.WriteLine("Error: Couldn't register Eina log domain for name {0}.", name);
diff --git a/src/bindings/mono/eina_mono/eina_promises.cs b/src/bindings/mono/eina_mono/eina_promises.cs
new file mode 100644
index 0000000000..b617b3a986
--- /dev/null
+++ b/src/bindings/mono/eina_mono/eina_promises.cs
@@ -0,0 +1,356 @@
+using System;
+using System.Runtime.InteropServices;
+using System.Collections.Generic;
+using System.Linq;
+
+
+using static eina.EinaNative.PromiseNativeMethods;
+
+namespace eina {
+
+namespace EinaNative {
+
+static internal class PromiseNativeMethods
+{
+ internal delegate void Promise_Cancel_Cb(IntPtr data, IntPtr dead);
+
+ [DllImport(efl.Libs.Ecore)]
+ internal static extern IntPtr efl_loop_promise_new(IntPtr obj, Promise_Cancel_Cb cancel_cb, IntPtr data);
+
+ [DllImport(efl.Libs.Eina)]
+ internal static extern IntPtr eina_promise_new(IntPtr scheduler, Promise_Cancel_Cb cancel_cb, IntPtr data);
+
+ [DllImport(efl.Libs.Eina)]
+ internal static extern void eina_promise_resolve(IntPtr scheduler, eina.Value_Native value);
+
+ [DllImport(efl.Libs.Eina)]
+ internal static extern void eina_promise_reject(IntPtr scheduler, eina.Error reason);
+
+ [DllImport(efl.Libs.Eina)]
+ internal static extern IntPtr eina_future_new(IntPtr promise);
+
+ [DllImport(efl.Libs.Eina)]
+ internal static extern void eina_future_cancel(IntPtr future);
+
+ [DllImport(efl.Libs.Ecore)]
+ internal static extern IntPtr efl_loop_future_scheduler_get(IntPtr obj);
+
+ [DllImport(efl.Libs.Eina)]
+ internal static extern IntPtr eina_future_then_from_desc(IntPtr prev, FutureDesc desc);
+
+ [DllImport(efl.Libs.Eina)]
+ internal static extern IntPtr eina_future_chain_array(IntPtr prev, FutureDesc[] desc);
+
+ internal delegate eina.Value_Native FutureCb(IntPtr data, eina.Value_Native value, IntPtr dead_future);
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct FutureDesc
+ {
+ internal FutureCb cb;
+ internal IntPtr data;
+ internal IntPtr storage; // Internal use by eina
+
+ public FutureDesc(FutureCb cb, IntPtr data, IntPtr storage)
+ {
+ this.cb = cb;
+ this.data = data;
+ this.storage = storage;
+ }
+ }
+}
+
+} // namespace EinaNative
+
+/// <summary>
+/// Promises act as placeholders for a value that may be available in the future.
+///
+/// With a Promise you can attach futures to it, which will be used to notify of the value being available.
+/// </summary>
+public class Promise : IDisposable
+{
+ internal IntPtr Handle;
+ private GCHandle CleanupHandle;
+
+ /// <summary>Delegate for functions that will be called upon a promise cancellation.</summary>
+ public delegate void CancelCb();
+
+ /// <summary>
+ /// Creates a new Promise with the given callback.
+ ///
+ /// Currently, creating a promise directly uses the Main Loop scheduler the source of notifications (i.e. the
+ /// future callbacks will be called mainly from a loop iteration).
+ /// </summary>
+ public Promise(CancelCb cancelCb=null)
+ {
+ efl.ILoop loop = efl.App.GetLoopMain();
+
+ // Should we be able to pass different schedulers?
+ IntPtr scheduler = efl_loop_future_scheduler_get(loop.raw_handle);
+
+ IntPtr cb_data = IntPtr.Zero;
+
+ // A safety clean callback to mark this wrapper as invalid
+ CancelCb safetyCb = () => {
+ Handle = IntPtr.Zero;
+ if (cancelCb != null)
+ cancelCb();
+ };
+
+ CleanupHandle = GCHandle.Alloc(safetyCb);
+ cb_data = GCHandle.ToIntPtr(CleanupHandle);
+
+ this.Handle = eina_promise_new(scheduler, NativeCancelCb, cb_data);
+ }
+
+ private static void NativeCancelCb(IntPtr data, IntPtr dead)
+ {
+ if (data == IntPtr.Zero)
+ return;
+
+ GCHandle handle = GCHandle.FromIntPtr(data);
+ CancelCb cb = handle.Target as CancelCb;
+ if (cb != null)
+ cb();
+ else
+ eina.Log.Info("Null promise CancelCb found");
+ handle.Free();
+ }
+
+ /// <summary>Dispose this promise, causing its cancellation if it isn't already fulfilled.</summary>
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ /// <summary>Finalizer to be called from the Garbage Collector.</summary>
+ ~Promise()
+ {
+ Dispose(false);
+ }
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (Handle != IntPtr.Zero)
+ {
+ eina_promise_reject(Handle, eina.Error.ECANCELED);
+ Handle = IntPtr.Zero;
+ }
+ }
+
+ private void SanityChecks()
+ {
+ if (this.Handle == IntPtr.Zero)
+ throw new ObjectDisposedException(GetType().Name);
+ }
+
+ /// <summary>
+ /// Fulfills a promise with the given value.
+ ///
+ /// This will make all futures attached to it to be called with the given value as payload.
+ /// </summary>
+ public void Resolve(eina.Value value)
+ {
+ SanityChecks();
+ eina_promise_resolve(this.Handle, value);
+ this.Handle = IntPtr.Zero;
+ // Resolving a cb does *not* call its cancellation callback, so we have to release the
+ // lambda created in the constructor for cleanup.
+ CleanupHandle.Free();
+ }
+
+ /// <summary>
+ /// Rejects a promise.
+ ///
+ /// The future chain attached to this promise will be called with an eina.Value of type
+ /// eina.ValueType.Error and payload eina.Error.ECANCELED.
+ /// </summary>
+ public void Reject(eina.Error reason)
+ {
+ SanityChecks();
+ eina_promise_reject(this.Handle, reason);
+ this.Handle = IntPtr.Zero;
+ }
+}
+
+/// <summary>
+/// Futures are the structures holding the callbacks to be notified of a promise fullfillment
+/// or cancellation.
+/// </summary>
+public class Future
+{
+ /// <summary>
+ /// Callback attached to a future and to be called when resolving/rejecting a promise.
+ ///
+ /// The eina.Value as argument can come with an eina.Error.ECANCELED as payload if the
+ /// promise/future was rejected/cancelled.
+ ///
+ /// The return value usually is same as the argument, forwarded, but can be changed in
+ /// case were the chain act as a transforming pipeline.
+ /// </summary>
+ public delegate eina.Value ResolvedCb(eina.Value value);
+
+ public IntPtr Handle { get; internal set; }
+
+ /// <summary>
+ /// Creates a Future from a native pointer.
+ /// </summary>
+ public Future(IntPtr handle)
+ {
+ Handle = ThenRaw(handle, (eina.Value value) => {
+ Handle = IntPtr.Zero;
+ return value;
+ });
+ }
+
+ /// <summary>
+ /// Creates a Future attached to the given Promise.
+ ///
+ /// Optionally a resolved callback may be provided. If so, it will be chained
+ /// before the returned future.
+ /// </summary>
+ public Future(Promise promise, ResolvedCb cb=null)
+ {
+ IntPtr intermediate = eina_future_new(promise.Handle);
+ Handle = ThenRaw(intermediate, (eina.Value value) => {
+ if (cb != null)
+ value = cb(value);
+ Handle = IntPtr.Zero;
+ return value;
+ });
+ }
+
+ private void SanityChecks()
+ {
+ if (this.Handle == IntPtr.Zero)
+ throw new ObjectDisposedException(GetType().Name);
+ }
+
+ /// <summary>
+ /// Cancels this future and the chain it belongs to, along with the promise linked against it.
+ ///
+ /// The callbacks will still be called with eina.Error.ECANCELED as payload. The promise cancellation
+ /// callback will also be called if present.
+ /// </summary>
+ public void Cancel()
+ {
+ SanityChecks();
+ eina_future_cancel(this.Handle);
+ }
+
+ /// <summary>
+ /// Creates a new future to be called after this one.
+ ///
+ /// Once the promise this future is attached to resolves, the callbacks on the chain
+ /// are called in the order they were chained.
+ ///
+ /// CAUTION: Calling Then() on a future that had it called before will replace the previous chain
+ /// from this point on.
+ /// </summary>
+ public Future Then(ResolvedCb cb)
+ {
+ SanityChecks();
+ return new Future(ThenRaw(Handle, cb));
+ }
+
+ // Helper function to attach a cb to a future without creating a new wrapper directly.
+ // It'll be used in the construtor, to attach the cleaning cb to an intermediate future.
+ private static IntPtr ThenRaw(IntPtr previous, ResolvedCb cb)
+ {
+ FutureDesc desc = new FutureDesc();
+ desc.cb = NativeResolvedCb;
+ GCHandle handle = GCHandle.Alloc(cb);
+ desc.data = GCHandle.ToIntPtr(handle);
+ return eina_future_then_from_desc(previous, desc);
+ }
+ private static eina.Value_Native NativeResolvedCb(IntPtr data, eina.Value_Native value, IntPtr dead_future)
+ {
+ GCHandle handle = GCHandle.FromIntPtr(data);
+ ResolvedCb cb = handle.Target as ResolvedCb;
+ if (cb != null)
+ value = cb(value);
+ else
+ eina.Log.Warning("Failed to get future callback.");
+ handle.Free();
+ return value;
+ }
+
+ /// <summary>
+ /// Helper method for chaining a group of callbacks in a single go.
+ ///
+ /// It is just syntatic sugar for sequential Then() calls, without creating intermediate
+ /// futures explicitly.
+ /// </summary>
+ public Future Chain(IEnumerable<ResolvedCb> cbs)
+ {
+ SanityChecks();
+ System.Collections.Generic.IList<ResolvedCb> cbsList = cbs.ToList();
+ FutureDesc[] descs = new FutureDesc[cbsList.Count() + 1]; // +1 due to the null-cb terminating descriptor.
+ int i = 0;
+ try
+ {
+ for (; i < cbsList.Count(); i++)
+ {
+ ResolvedCb cb = cbsList[i];
+ descs[i].cb = NativeResolvedCb;
+ GCHandle handle = GCHandle.Alloc(cb);
+ descs[i].data = GCHandle.ToIntPtr(handle);
+ }
+
+ descs[i].cb = null;
+ descs[i].data = IntPtr.Zero;
+ }
+ catch (Exception e)
+ {
+ for (int j = 0; j <= i; j++)
+ {
+ if (descs[i].data == IntPtr.Zero)
+ continue;
+
+ GCHandle handle = GCHandle.FromIntPtr(descs[i].data);
+ handle.Free();
+ }
+ eina.Log.Error($"Failed to create native future description for callbacks. Error: {e.ToString()}");
+ return null;
+ }
+ return new Future(eina_future_chain_array(Handle, descs));
+ }
+}
+
+public class FutureMarshaler : ICustomMarshaler
+{
+
+ public object MarshalNativeToManaged(IntPtr pNativeData)
+ {
+ return new Future(pNativeData);
+ }
+
+ public IntPtr MarshalManagedToNative(object managedObj)
+ {
+ Future f = managedObj as Future;
+ if (f == null)
+ return IntPtr.Zero;
+ return f.Handle;
+ }
+
+ public void CleanUpNativeData(IntPtr pNativeData) { }
+
+ public void CleanUpManagedData(object managedObj) { }
+
+ public int GetNativeDataSize()
+ {
+ return -1;
+ }
+
+ public static ICustomMarshaler GetInstance(string cookie) {
+ if (marshaler == null)
+ {
+ marshaler = new FutureMarshaler();
+ }
+ return marshaler;
+ }
+
+ private static FutureMarshaler marshaler;
+}
+
+} // namespace eina
diff --git a/src/bindings/mono/eina_mono/eina_strbuf.cs b/src/bindings/mono/eina_mono/eina_strbuf.cs
new file mode 100644
index 0000000000..310f9a9292
--- /dev/null
+++ b/src/bindings/mono/eina_mono/eina_strbuf.cs
@@ -0,0 +1,156 @@
+using System;
+using System.Runtime.InteropServices;
+
+using static eina.EinaNative.StrbufNativeMethods;
+
+namespace eina
+{
+namespace EinaNative
+{
+static internal class StrbufNativeMethods
+{
+ [DllImport(efl.Libs.Eina)]
+ internal static extern IntPtr eina_strbuf_new();
+
+ [DllImport(efl.Libs.Eina)]
+ internal static extern void eina_strbuf_free(IntPtr buf);
+
+ [DllImport(efl.Libs.Eina)]
+ internal static extern void eina_strbuf_reset(IntPtr buf);
+
+ [DllImport(efl.Libs.Eina)]
+ [return: MarshalAsAttribute(UnmanagedType.U1)]
+ internal static extern bool eina_strbuf_append(IntPtr buf, string str);
+
+ [DllImport(efl.Libs.Eina)]
+ [return: MarshalAsAttribute(UnmanagedType.U1)]
+ internal static extern bool eina_strbuf_append_escaped(IntPtr buf, string str);
+
+ [DllImport(efl.Libs.Eina)]
+ [return: MarshalAsAttribute(UnmanagedType.U1)]
+ internal static extern bool eina_strbuf_append_char(IntPtr buf, char c);
+
+ [DllImport(efl.Libs.Eina)]
+ internal static extern string eina_strbuf_string_steal(IntPtr buf);
+
+ [DllImport(efl.Libs.Eina)]
+ internal static extern IntPtr eina_strbuf_length_get(IntPtr buf); // Uses IntPtr as wrapper for size_t
+}
+
+} // namespace EinaNative
+
+///<summary>Native string buffer, similar to the C# StringBuilder class.</summary>
+public class Strbuf : IDisposable
+{
+ ///<summary>Pointer to the underlying native handle.</summary>
+ public IntPtr Handle { get; protected set; }
+ private Ownership Ownership;
+ private bool Disposed;
+
+ ///<summary>Creates a new Strbuf. By default its lifetime is managed.</summary>
+ public Strbuf(Ownership ownership=Ownership.Managed)
+ {
+ this.Handle = eina_strbuf_new();
+ this.Ownership = ownership;
+ }
+
+ ///<summary>Creates a new Strbuf from an existing IntPtr.</summary>
+ public Strbuf(IntPtr ptr, Ownership ownership)
+ {
+ this.Handle = ptr;
+ this.Ownership = ownership;
+ }
+
+ /// <summary>Releases the ownership of the underlying value to C.</summary>
+ public void ReleaseOwnership()
+ {
+ this.Ownership = Ownership.Unmanaged;
+ }
+
+ /// <summary>Takes the ownership of the underlying value to the Managed runtime.</summary>
+ public void TakeOwnership()
+ {
+ this.Ownership = Ownership.Managed;
+ }
+
+ ///<summary>Public method to explicitly free the wrapped buffer.</summary>
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ ///<summary>Actually free the wrapped buffer. Can be called from Dispose() or through the GC.</summary>
+ protected virtual void Dispose(bool disposing)
+ {
+ if (this.Ownership == Ownership.Unmanaged)
+ {
+ Disposed = true;
+ return;
+ }
+
+ if (!Disposed && (Handle != IntPtr.Zero)) {
+ eina_strbuf_free(Handle);
+ }
+ Disposed = true;
+ }
+
+ ///<summary>Finalizer to be called from the GC.</summary>
+ ~Strbuf()
+ {
+ Dispose(false);
+ }
+
+ ///<summary>Retrieves the length of the buffer contents.</summary>
+ public int Length
+ {
+ get
+ {
+ IntPtr size = eina_strbuf_length_get(Handle);
+ return size.ToInt32();
+ }
+ }
+
+ ///<summary>Resets a string buffer. Its len is set to 0 and the content to '\\0'</summary>
+ public void Reset()
+ {
+ if (Disposed)
+ throw new ObjectDisposedException(base.GetType().Name);
+ eina_strbuf_reset(Handle);
+ }
+
+ ///<summary>Appends a string to a buffer, reallocating as necessary.</summary>
+ public bool Append(string text)
+ {
+ if (Disposed)
+ throw new ObjectDisposedException(base.GetType().Name);
+ return eina_strbuf_append(Handle, text);
+ }
+
+ ///<summary>Appens an escaped string to a buffer, reallocating as necessary.</summary>
+ public bool AppendEscaped(string text)
+ {
+ if (Disposed)
+ throw new ObjectDisposedException(base.GetType().Name);
+ return eina_strbuf_append_escaped(Handle, text);
+ }
+
+ ///<summary>Appends a char to a buffer, reallocating as necessary.</summary>
+ public bool Append(char c)
+ {
+ if (Disposed)
+ throw new ObjectDisposedException(base.GetType().Name);
+ return eina_strbuf_append_char(Handle, c);
+ }
+
+ ///<summary>Steals the content of a buffer.</summary>
+ public string Steal()
+ {
+ if (Disposed)
+ throw new ObjectDisposedException(base.GetType().Name);
+ return eina_strbuf_string_steal(Handle);
+ }
+}
+
+} // namespace eina
+
diff --git a/src/bindings/mono/eina_mono/eina_value.cs b/src/bindings/mono/eina_mono/eina_value.cs
index d4e8dfbf94..578c660b91 100644
--- a/src/bindings/mono/eina_mono/eina_value.cs
+++ b/src/bindings/mono/eina_mono/eina_value.cs
@@ -325,6 +325,10 @@ static internal class UnsafeNativeMethods {
[return: MarshalAsAttribute(UnmanagedType.U1)]
internal static extern bool eina_value_pset_wrapper(IntPtr handle, ref eina.EinaNative.Value_List ptr);
+ [DllImport(efl.Libs.Eina)]
+ [return: MarshalAsAttribute(UnmanagedType.U1)]
+ internal static extern bool eina_value_copy(IntPtr src, IntPtr dest);
+
// Supported types
// 8 bits byte
@@ -375,6 +379,10 @@ static internal class UnsafeNativeMethods {
// Optional
[DllImport(efl.Libs.CustomExports)]
internal static extern IntPtr type_optional();
+
+ // Error
+ [DllImport(efl.Libs.CustomExports)]
+ internal static extern IntPtr type_error();
}
}
@@ -382,8 +390,8 @@ static internal class UnsafeNativeMethods {
[StructLayout(LayoutKind.Sequential)]
public struct Value_Native
{
- IntPtr type;
- IntPtr value; // Atually an Eina_Value_Union, but it is padded to 8 bytes.
+ public IntPtr Type;
+ public IntPtr Value; // Atually an Eina_Value_Union, but it is padded to 8 bytes.
}
@@ -429,13 +437,6 @@ public class InvalidValueTypeException: Exception
protected InvalidValueTypeException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
-/// <summary>Internal enum to handle value ownership between managed and unmanaged code.</summary>
-public enum ValueOwnership {
- /// <summary> The value is owned by the managed code. It'll free the handle on disposal.</summary>
- Managed,
- /// <summary> The value is owned by the unmanaged code. It won't be freed on disposal.</summary>
- Unmanaged
-}
/// <summary>Managed-side Enum to represent Eina_Value_Type constants</summary>
public enum ValueType {
@@ -473,6 +474,10 @@ public enum ValueType {
Hash,
/// <summary>Optional (aka empty) values.</summary>
Optional,
+ /// <summary>Error values.</summary>
+ Error,
+ /// <summary>Empty values.</summary>
+ Empty,
}
static class ValueTypeMethods {
@@ -524,6 +529,11 @@ static class ValueTypeMethods {
return val == ValueType.Optional;
}
+ public static bool IsError(this ValueType val)
+ {
+ return val == ValueType.Error;
+ }
+
/// <summary>Returns the Marshal.SizeOf for the given ValueType native structure.</summary>
public static int MarshalSizeOf(this ValueType val)
{
@@ -611,6 +621,12 @@ static class ValueTypeBridge
ManagedToNative.Add(ValueType.Optional, type_optional());
NativeToManaged.Add(type_optional(), ValueType.Optional);
+ ManagedToNative.Add(ValueType.Error, type_error());
+ NativeToManaged.Add(type_error(), ValueType.Error);
+
+ ManagedToNative.Add(ValueType.Empty, IntPtr.Zero);
+ NativeToManaged.Add(IntPtr.Zero, ValueType.Empty);
+
TypesLoaded = true;
}
}
@@ -650,10 +666,13 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
// EINA_VALUE_TYPE_STRUCT: Eina_Value_Struct -- FIXME
- public IntPtr Handle { get; protected set;}
- public ValueOwnership Ownership { get; protected set;}
+ internal IntPtr Handle { get; set;}
+ /// <summary> Whether this wrapper owns (can free) the native value. </summary>
+ public Ownership Ownership { get; protected set;}
private bool Disposed;
+ /// <summary> Whether this wrapper has already freed the native value. </summary>
public bool Flushed { get; protected set;}
+ /// <summary> Whether this is an Optional value (meaning it can have a value or not). </summary>
public bool Optional {
get {
return GetValueType() == eina.ValueType.Optional;
@@ -666,8 +685,17 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
// }
} */
}
+ /// <summary> Whether this wrapper is actually empty/uninitialized (zeroed). This is different from an empty optional value. </summary>
public bool Empty {
get {
+ SanityChecks();
+ return GetValueType() == eina.ValueType.Empty;
+ }
+ }
+
+ /// <summary> Whether this optional value is empty. </summary>
+ public bool OptionalEmpty {
+ get {
OptionalSanityChecks();
bool empty;
if (!eina_value_optional_empty_is_wrapper(this.Handle, out empty))
@@ -680,10 +708,10 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
// Constructor to be used by the "FromContainerDesc" methods.
private Value() {
this.Handle = MemoryNative.Alloc(eina_value_sizeof());
- this.Ownership = ValueOwnership.Managed;
+ this.Ownership = Ownership.Managed;
}
- public Value(IntPtr handle, ValueOwnership ownership=ValueOwnership.Managed) {
+ public Value(IntPtr handle, Ownership ownership=Ownership.Managed) {
this.Handle = handle;
this.Ownership = ownership;
}
@@ -693,8 +721,15 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
if (type.IsContainer())
throw new ArgumentException("To use container types you must provide a subtype");
+
this.Handle = MemoryNative.Alloc(eina_value_sizeof());
- this.Ownership = ValueOwnership.Managed;
+ if (this.Handle == IntPtr.Zero)
+ throw new OutOfMemoryException("Failed to allocate memory for eina.Value");
+
+ // Initialize to EINA_VALUE_EMPTY before performing any other operation on this value.
+ MemoryNative.Memset(this.Handle, 0, eina_value_sizeof());
+
+ this.Ownership = Ownership.Managed;
Setup(type);
}
@@ -705,7 +740,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
throw new ArgumentException("First type must be a container type.");
this.Handle = MemoryNative.Alloc(eina_value_sizeof());
- this.Ownership = ValueOwnership.Managed;
+ this.Ownership = Ownership.Managed;
Setup(containerType, subtype, step);
}
@@ -713,14 +748,30 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
/// <summary>Constructor to build value from Values_Natives passed by value from C.</summary>
public Value(Value_Native value)
{
- this.Handle = MemoryNative.Alloc(Marshal.SizeOf(typeof(Value_Native)));
+ IntPtr tmp = MemoryNative.Alloc(Marshal.SizeOf(typeof(Value_Native)));
try {
- Marshal.StructureToPtr(value, this.Handle, false);
+ Marshal.StructureToPtr(value, tmp, false); // Can't get the address of a struct directly.
+ if (value.Type == IntPtr.Zero) // Got an EINA_VALUE_EMPTY by value.
+ {
+ this.Handle = tmp;
+ tmp = IntPtr.Zero;
+ }
+ else
+ {
+ this.Handle = MemoryNative.Alloc(Marshal.SizeOf(typeof(Value_Native)));
+
+ // Copy is used to deep copy the pointed payload (e.g. strings) inside this struct, so we can own this value.
+ if (!eina_value_copy(tmp, this.Handle))
+ throw new System.InvalidOperationException("Failed to copy value to managed memory.");
+ }
} catch {
MemoryNative.Free(this.Handle);
throw;
+ } finally {
+ MemoryNative.Free(tmp);
}
- this.Ownership = ValueOwnership.Managed;
+
+ this.Ownership = Ownership.Managed;
}
/// <summary>Implicit conversion from managed value to native struct representation.</summary>
@@ -758,13 +809,13 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
/// <summary>Releases the ownership of the underlying value to C.</summary>
public void ReleaseOwnership()
{
- this.Ownership = ValueOwnership.Unmanaged;
+ this.Ownership = Ownership.Unmanaged;
}
/// <summary>Takes the ownership of the underlying value to the Managed runtime.</summary>
public void TakeOwnership()
{
- this.Ownership = ValueOwnership.Managed;
+ this.Ownership = Ownership.Managed;
}
/// <summary>Public method to explicitly free the wrapped eina value.</summary>
@@ -777,13 +828,13 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
/// <summary>Actually free the wrapped eina value. Can be called from Dispose() or through the GC.</summary>
protected virtual void Dispose(bool disposing)
{
- if (this.Ownership == ValueOwnership.Unmanaged) {
+ if (this.Ownership == Ownership.Unmanaged) {
Disposed = true;
return;
}
if (!Disposed && (Handle != IntPtr.Zero)) {
- if (!Flushed)
+ if (!Flushed && !Empty)
eina_value_flush_wrapper(this.Handle);
MemoryNative.Free(this.Handle);
@@ -798,11 +849,12 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
}
/// <summary>Returns the native handle wrapped by this object.</summary>
- public IntPtr NativeHandle()
- {
- if (Disposed)
- throw new ObjectDisposedException(base.GetType().Name);
- return this.Handle;
+ public IntPtr NativeHandle {
+ get {
+ if (Disposed)
+ throw new ObjectDisposedException(base.GetType().Name);
+ return this.Handle;
+ }
}
/// <summary>Converts this storage to type 'type'</summary>
@@ -811,6 +863,18 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
if (Disposed)
throw new ObjectDisposedException(base.GetType().Name);
+ // Can't call setup with Empty value type (would give an eina error)
+ if (type == eina.ValueType.Empty)
+ {
+ // Need to cleanup as it may point to payload outside the underlying Eina_Value (like arrays and strings).
+ if (!Empty)
+ eina_value_flush_wrapper(this.Handle);
+
+ MemoryNative.Memset(this.Handle, 0, eina_value_sizeof());
+
+ return true;
+ }
+
if (type.IsContainer())
throw new ArgumentException("To setup a container you must provide a subtype.");
@@ -1072,6 +1136,21 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
return eina_value_set_wrapper_string(this.Handle, value);
}
+ /// <summary>Stores the given error value.</summary>
+ public bool Set(eina.Error value)
+ {
+ SanityChecks();
+
+ int error_code = value;
+
+ if (this.Optional)
+ return eina_value_optional_pset(this.Handle,
+ ValueTypeBridge.GetNative(ValueType.Error),
+ ref error_code);
+
+ return eina_value_set_wrapper_int(this.Handle, error_code);
+ }
+
/// <summary>Stores the given value into this value. The target value must be an optional.</summary>
public bool Set(Value value)
{
@@ -1225,6 +1304,22 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
return true;
}
+ /// <summary>Gets the currently stored value as an eina.Error.</summary>
+ public bool Get(out eina.Error value)
+ {
+ SanityChecks();
+ bool ret;
+ int intermediate; // It seems out doesn't play well with implicit operators...
+ if (this.Optional)
+ ret = eina_value_optional_pget(this.Handle, out intermediate);
+ else
+ ret = eina_value_get_wrapper(this.Handle, out intermediate);
+
+ value = intermediate;
+
+ return ret;
+ }
+
/// <summary>Gets the currently stored value as an complex (e.g. container) eina.Value.</summary>
public bool Get(out Value value)
{
@@ -1516,7 +1611,7 @@ public class ValueMarshaler : ICustomMarshaler {
/// <summary>Creates a managed value from a C pointer, whitout taking ownership of it.</summary>
public object MarshalNativeToManaged(IntPtr pNativeData) {
- return new Value(pNativeData, ValueOwnership.Unmanaged);
+ return new Value(pNativeData, Ownership.Unmanaged);
}
/// <summary>Retrieves the C pointer from a given managed value,
@@ -1554,7 +1649,7 @@ public class ValueMarshaler : ICustomMarshaler {
public class ValueMarshalerOwn : ICustomMarshaler {
/// <summary>Creates a managed value from a C pointer, taking the ownership.</summary>
public object MarshalNativeToManaged(IntPtr pNativeData) {
- return new Value(pNativeData, ValueOwnership.Managed);
+ return new Value(pNativeData, Ownership.Managed);
}
/// <summary>Retrieves the C pointer from a given managed value,
diff --git a/src/bindings/mono/eldbus_mono/eldbus_connection.cs b/src/bindings/mono/eldbus_mono/eldbus_connection.cs
index f80a0aba0a..0da670efc1 100644
--- a/src/bindings/mono/eldbus_mono/eldbus_connection.cs
+++ b/src/bindings/mono/eldbus_mono/eldbus_connection.cs
@@ -313,7 +313,7 @@ public class Connection : IDisposable
return new eldbus.Pending(pending_hdl, false);
}
- public eldbus.Pending ActivableList(eldbus.MessageDelegate dlgt = null)
+ public eldbus.Pending ActivatableList(eldbus.MessageDelegate dlgt = null)
{
CheckHandle();
diff --git a/src/bindings/mono/eo_mono/iwrapper.cs b/src/bindings/mono/eo_mono/iwrapper.cs
index 7812e06367..8e15b760cc 100644
--- a/src/bindings/mono/eo_mono/iwrapper.cs
+++ b/src/bindings/mono/eo_mono/iwrapper.cs
@@ -3,6 +3,8 @@
using System;
using System.Runtime.InteropServices;
using System.Collections.Generic;
+using System.Diagnostics;
+using System.Threading;
using static eina.NativeCustomExportFunctions;
@@ -51,16 +53,13 @@ public class Globals {
[DllImport(efl.Libs.Eo)] public static extern bool efl_event_callback_priority_add(
System.IntPtr obj,
- // FIXME commented to allow passing null stuff during test
- //ref efl.kw_event.Description desc,
- //efl.kw_event.Description desc,
IntPtr desc,
short priority,
efl.Event_Cb cb,
System.IntPtr data);
[DllImport(efl.Libs.Eo)] public static extern bool efl_event_callback_del(
System.IntPtr obj,
- efl.kw_event.Description desc,
+ efl.Event_Description desc,
efl.Event_Cb cb,
System.IntPtr data);
[DllImport(efl.Libs.Eo)] public static extern IntPtr
@@ -70,11 +69,11 @@ public class Globals {
public delegate byte class_initializer(IntPtr klass);
- public static IntPtr register_class(class_initializer initializer, IntPtr base_klass)
+ public static IntPtr register_class(class_initializer initializer, String class_name, IntPtr base_klass)
{
ClassDescription description;
description.version = 2; // EO_VERSION
- description.name = "BoxInherit";
+ description.name = class_name;
description.class_type = 0; // REGULAR
description.data_size = (UIntPtr)8;
description.class_initializer = IntPtr.Zero;
@@ -94,20 +93,20 @@ public class Globals {
eina.Log.Debug("Registered?");
return klass;
}
- public static IntPtr instantiate_start(IntPtr klass, efl.Object parent)
+ public static IntPtr instantiate_start(IntPtr klass, efl.IObject parent)
{
eina.Log.Debug("Instantiating");
System.IntPtr parent_ptr = System.IntPtr.Zero;
if(parent != null)
parent_ptr = parent.raw_handle;
- System.IntPtr eo = efl.eo.Globals._efl_add_internal_start("file", 0, klass, parent_ptr, 0, 0);
+ System.IntPtr eo = efl.eo.Globals._efl_add_internal_start("file", 0, klass, parent_ptr, 1, 0);
return eo;
}
public static IntPtr instantiate_end(IntPtr eo) {
eina.Log.Debug("efl_add_internal_start returned");
- eo = efl.eo.Globals._efl_add_end(eo, 0, 0);
+ eo = efl.eo.Globals._efl_add_end(eo, 1, 0);
eina.Log.Debug("efl_add_end returned");
return eo;
}
@@ -178,7 +177,51 @@ public class Globals {
GCHandle handle = GCHandle.FromIntPtr(ptr);
handle.Free();
}
-}
+
+ public static System.Threading.Tasks.Task<eina.Value> WrapAsync(eina.Future future, CancellationToken token)
+ {
+ // Creates a task that will wait for SetResult for completion.
+ // TaskCompletionSource is used to create tasks for 'external' Task sources.
+ var tcs = new System.Threading.Tasks.TaskCompletionSource<eina.Value>();
+
+ // Flag to be passed to the cancell callback
+ bool fulfilled = false;
+
+ future.Then((eina.Value received) => {
+ lock (future)
+ {
+ // Convert an failed Future to a failed Task.
+ if (received.GetValueType() == eina.ValueType.Error)
+ {
+ eina.Error err;
+ received.Get(out err);
+ if (err == eina.Error.ECANCELED)
+ tcs.SetCanceled();
+ else
+ tcs.TrySetException(new efl.FutureException(received));
+ }
+ else
+ {
+ // Will mark the returned task below as completed.
+ tcs.SetResult(received);
+ }
+ fulfilled = true;
+ return received;
+ }
+ });
+ // Callback to be called when the token is cancelled.
+ token.Register(() => {
+ lock (future)
+ {
+ // Will trigger the Then callback above with an eina.Error
+ if (!fulfilled)
+ future.Cancel();
+ }
+ });
+
+ return tcs.Task;
+ }
+} // Globals
public static class Config
{
@@ -383,13 +426,95 @@ public class StringshareKeepOwnershipMarshaler : ICustomMarshaler {
static private StringshareKeepOwnershipMarshaler marshaler;
}
+public class StrbufPassOwnershipMarshaler : ICustomMarshaler {
+ public object MarshalNativeToManaged(IntPtr pNativeData) {
+ return new eina.Strbuf(pNativeData, eina.Ownership.Managed);
+ }
+
+ public IntPtr MarshalManagedToNative(object managedObj) {
+ eina.Strbuf buf = managedObj as eina.Strbuf;
+ buf.ReleaseOwnership();
+ return buf.Handle;
+ }
+
+ public void CleanUpNativeData(IntPtr pNativeData) {
+ // No need to cleanup. C will take care of it.
+ }
+
+ public void CleanUpManagedData(object managedObj) {
+ }
+
+ public int GetNativeDataSize() {
+ return -1;
+ }
+
+ public static ICustomMarshaler GetInstance(string cookie) {
+ if (marshaler == null) {
+ marshaler = new StrbufPassOwnershipMarshaler();
+ }
+ return marshaler;
+ }
+ static private StrbufPassOwnershipMarshaler marshaler;
+}
+
+public class StrbufKeepOwnershipMarshaler: ICustomMarshaler {
+ public object MarshalNativeToManaged(IntPtr pNativeData) {
+ return new eina.Strbuf(pNativeData, eina.Ownership.Unmanaged);
+ }
+
+ public IntPtr MarshalManagedToNative(object managedObj) {
+ eina.Strbuf buf = managedObj as eina.Strbuf;
+ return buf.Handle;
+ }
+
+ public void CleanUpNativeData(IntPtr pNativeData) {
+ // No need to free. The Native side will keep the ownership.
+ }
+
+ public void CleanUpManagedData(object managedObj) {
+ }
+
+ public int GetNativeDataSize() {
+ return -1;
+ }
+
+ public static ICustomMarshaler GetInstance(string cookie) {
+ if (marshaler == null) {
+ marshaler = new StrbufKeepOwnershipMarshaler();
+ }
+ return marshaler;
+ }
+ static private StrbufKeepOwnershipMarshaler marshaler;
+}
+
+
+
} // namespace eo
+/// <summary>General exception for errors inside the binding.</summary>
public class EflException : Exception
{
+ /// <summary>Create a new EflException with the given.
public EflException(string message) : base(message)
{
}
}
+/// <summary>Exception to be raised when a Task fails due to a failed eina.Future.</summary>
+public class FutureException : EflException
+{
+ /// <summary>The error code returned by the failed eina.Future.</summary>
+ public eina.Error Error { get; private set; }
+
+ /// <summary>Construct a new exception from the eina.Error stored in the given eina.Value.</summary>
+ public FutureException(eina.Value value) : base("Future failed.")
+ {
+ if (value.GetValueType() != eina.ValueType.Error)
+ throw new ArgumentException("FutureException must receive an eina.Value with eina.Error.");
+ eina.Error err;
+ value.Get(out err);
+ Error = err;
+ }
+}
+
} // namespace efl
diff --git a/src/bindings/mono/eo_mono/object.cs b/src/bindings/mono/eo_mono/object.cs
deleted file mode 100644
index 08e1e5f0ef..0000000000
--- a/src/bindings/mono/eo_mono/object.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-
-namespace efl {
-
-using System;
-
-// public interface Object : efl.eo.IWrapper
-// {
-// }
-
-}
diff --git a/src/bindings/mono/eo_mono/workaround.cs b/src/bindings/mono/eo_mono/workaround.cs
index ab7d0c8802..207f5cab52 100644
--- a/src/bindings/mono/eo_mono/workaround.cs
+++ b/src/bindings/mono/eo_mono/workaround.cs
@@ -70,10 +70,10 @@ public struct Evas_Object_Box_Option {
};
#pragma warning restore 0169
-namespace efl { namespace kw_event {
+namespace efl {
[StructLayout(LayoutKind.Sequential)]
-public struct Description {
+public struct Event_Description {
public IntPtr Name;
[MarshalAs(UnmanagedType.U1)] public bool Unfreezable;
[MarshalAs(UnmanagedType.U1)] public bool Legacy_is;
@@ -81,7 +81,7 @@ public struct Description {
private static Dictionary<string, IntPtr> descriptions = new Dictionary<string, IntPtr>();
- public Description(string name)
+ public Event_Description(string name)
{
if (!descriptions.ContainsKey(name))
{
@@ -101,39 +101,25 @@ public struct Description {
}
};
-} // namespace kw_event
-
public delegate void Event_Cb(System.IntPtr data, ref Event evt);
#pragma warning disable 0169
-public struct Callback_Array_Item {
- IntPtr desc;
- IntPtr func;
-};
public struct Dbg_Info {
IntPtr name;
IntPtr value;
};
#pragma warning restore 0169
-namespace text {
-
-namespace cursor {
-
[StructLayout(LayoutKind.Sequential)]
-public struct Cursor {
+public struct Text_Cursor_Cursor {
IntPtr obj;
UIntPtr pos; // UIntPtr to automatically change size_t between 32/64
IntPtr node;
[MarshalAsAttribute(UnmanagedType.U1)]bool changed;
}
-} // namespace cursor
-
-namespace annotate {
-
[StructLayout(LayoutKind.Sequential)]
-public struct Annotation {
+public struct Text_Annotate_Annotation {
IntPtr list;
IntPtr obj;
IntPtr start_node;
@@ -141,51 +127,10 @@ public struct Annotation {
[MarshalAsAttribute(UnmanagedType.U1)]bool is_item;
}
-} // namespace annotate
-
-} // namespace text
-
public delegate void Signal_Cb(IntPtr data, IntPtr obj, IntPtr emission, IntPtr source);
-
-namespace gfx {
-
-public interface Buffer {}
-
-namespace buffer {
-public struct Access_Mode {}
-}
-
-} // namespace gfx
-
namespace access {
-public struct State_Set {
- private ulong mask;
-
- public static implicit operator State_Set(ulong x)
- {
- return new State_Set{mask=x};
- }
- public static implicit operator ulong(State_Set x)
- {
- return x.mask;
- }
-}
-
-public struct Relation_Set {
- private IntPtr mask;
-
- public static implicit operator Relation_Set(IntPtr x)
- {
- return new Relation_Set{mask=x};
- }
- public static implicit operator IntPtr(Relation_Set x)
- {
- return x.mask;
- }
-}
-
public struct Action_Data {
public IntPtr name;
public IntPtr action;
@@ -195,23 +140,6 @@ public struct Action_Data {
} // namespace access
-namespace font {
-
-public struct Size {
- private int mask;
-
- public static implicit operator Size(int x)
- {
- return new Size{mask=x};
- }
- public static implicit operator int(Size x)
- {
- return x.mask;
- }
-}
-
-}
-
} // namespace efl
namespace evas { namespace font {
@@ -515,33 +443,6 @@ public delegate void Change_Cb(IntPtr data, IntPtr obj, IntPtr part);
} // namespace edje
-[StructLayout(LayoutKind.Sequential)]
-public struct Elm_Code
-{
- IntPtr file;
- IntPtr widgets;
- IntPtr parsers;
-
- // Below is inside _Elm_Code_Config
- [MarshalAsAttribute(UnmanagedType.U1)]bool config;
-}
-
-[StructLayout(LayoutKind.Sequential)]
-public struct Elm_Code_Line
-{
- IntPtr file;
- IntPtr content;
- uint length;
- uint number;
- IntPtr modified;
-
- Elm_Code_Status_Type status;
- IntPtr tokens;
-
- IntPtr data;
- IntPtr status_text;
-}
-
public enum Elm_Code_Status_Type {
ELM_CODE_STATUS_TYPE_DEFAULT = 0,
ELM_CODE_STATUS_TYPE_CURRENT,
@@ -573,9 +474,6 @@ public struct Elm_Atspi_Action
IntPtr func;
}
-// Some places stil use the non-namespaced Efl_Event_Cb
-public delegate void Efl_Event_Cb(System.IntPtr data, ref efl.Event evt);
-
[StructLayout(LayoutKind.Sequential)]
public struct Tm {
int tm_sec;
diff --git a/src/examples/ecore/ecore_audio_custom.c b/src/examples/ecore/ecore_audio_custom.c
index 9d88c756a6..b0d26a1e75 100644
--- a/src/examples/ecore/ecore_audio_custom.c
+++ b/src/examples/ecore/ecore_audio_custom.c
@@ -56,15 +56,15 @@ main(int argc, const char *argv[])
ecore_app_args_set(argc, argv);
- out = efl_add(ECORE_AUDIO_OBJ_OUT_PULSE_CLASS, NULL);
+ out = efl_add_ref(ECORE_AUDIO_OBJ_OUT_PULSE_CLASS, NULL);
- in = efl_add(ECORE_AUDIO_OBJ_IN_CLASS, NULL);
+ in = efl_add_ref(ECORE_AUDIO_OBJ_IN_CLASS, NULL);
if (!in)
{
printf("error when creating ecore audio source.\n");
goto end;
}
- ecore_audio_obj_name_set(in, "wail");
+ efl_name_set(in, "wail");
ecore_audio_obj_in_samplerate_set(in, 44100);
ecore_audio_obj_in_channels_set(in, 1);
ecore_audio_obj_volume_set(in, 0.7);
diff --git a/src/examples/ecore/ecore_audio_playback.c b/src/examples/ecore/ecore_audio_playback.c
index 5945393e8c..c659f09d55 100644
--- a/src/examples/ecore/ecore_audio_playback.c
+++ b/src/examples/ecore/ecore_audio_playback.c
@@ -201,7 +201,7 @@ static void _play_finished(void *data EINA_UNUSED, const Efl_Event *event)
inputs = eina_list_remove(inputs, event->object);
ret = ecore_audio_obj_out_input_detach(out, event->object);
- efl_del(event->object);
+ efl_unref(event->object);
if (!ret)
printf("Could not detach input %s\n", name);
@@ -252,7 +252,7 @@ main(int argc, const char *argv[])
{
if (!strncmp(argv[i], "tone:", 5))
{
- in = efl_add(ECORE_AUDIO_OBJ_IN_TONE_CLASS, NULL);
+ in = efl_add_ref(ECORE_AUDIO_OBJ_IN_TONE_CLASS, NULL);
if (!in)
{
printf("error when creating ecore audio source.\n");
@@ -272,18 +272,18 @@ main(int argc, const char *argv[])
}
}
free(tmp);
- ecore_audio_obj_name_set(in, argv[i]);
+ efl_name_set(in, argv[i]);
}
else
{
- in = efl_add(ECORE_AUDIO_OBJ_IN_SNDFILE_CLASS, NULL);
+ in = efl_add_ref(ECORE_AUDIO_OBJ_IN_SNDFILE_CLASS, NULL);
if (!in)
{
printf("error when creating ecore audio source.\n");
goto end;
}
tmp = strdup(argv[i]);
- ecore_audio_obj_name_set(in, basename(tmp));
+ efl_name_set(in, basename(tmp));
free(tmp);
ret = ecore_audio_obj_source_set(in, argv[i]);
if (!ret) {
@@ -307,7 +307,7 @@ main(int argc, const char *argv[])
printf("Start: %s (%0.2fs)\n", name, length);
- out = efl_add(ECORE_AUDIO_OBJ_OUT_PULSE_CLASS, NULL);
+ out = efl_add_ref(ECORE_AUDIO_OBJ_OUT_PULSE_CLASS, NULL);
ret = ecore_audio_obj_out_input_attach(out, in);
if (!ret)
printf("Could not attach input %s\n", name);
diff --git a/src/examples/ecore/ecore_audio_to_ogg.c b/src/examples/ecore/ecore_audio_to_ogg.c
index fec1cc587e..756e69a209 100644
--- a/src/examples/ecore/ecore_audio_to_ogg.c
+++ b/src/examples/ecore/ecore_audio_to_ogg.c
@@ -24,8 +24,8 @@ static void _play_finished(void *data EINA_UNUSED, const Efl_Event *event)
printf("Done: %s\n", name);
ecore_audio_obj_in_output_get(event->object, &out);
- efl_del(event->object);
- efl_del(out);
+ efl_unref(event->object);
+ efl_unref(out);
ecore_main_loop_quit();
@@ -49,31 +49,31 @@ main(int argc, char *argv[])
ecore_audio_init();
- in = efl_add(ECORE_AUDIO_OBJ_IN_SNDFILE_CLASS, NULL);
- ecore_audio_obj_name_set(in, basename(argv[1]));
+ in = efl_add_ref(ECORE_AUDIO_OBJ_IN_SNDFILE_CLASS, NULL);
+ efl_name_set(in, basename(argv[1]));
ret = ecore_audio_obj_source_set(in, argv[1]);
if (!ret) {
printf("Could not set %s as input\n", argv[1]);
- efl_del(in);
+ efl_unref(in);
return 1;
}
efl_event_callback_add(in, ECORE_AUDIO_EV_IN_STOPPED, _play_finished, NULL);
- out = efl_add(ECORE_AUDIO_OBJ_OUT_SNDFILE_CLASS, NULL);
+ out = efl_add_ref(ECORE_AUDIO_OBJ_OUT_SNDFILE_CLASS, NULL);
ret = ecore_audio_obj_source_set(out, argv[2]);
if (!ret) {
printf("Could not set %s as output\n", argv[2]);
- efl_del(in);
- efl_del(out);
+ efl_unref(in);
+ efl_unref(out);
return 1;
}
ret = ecore_audio_obj_out_input_attach(out, in);
if (!ret) {
printf("Could not attach input\n");
- efl_del(out);
- efl_del(in);
+ efl_unref(out);
+ efl_unref(in);
return 1;
}
diff --git a/src/examples/ecore/ecore_evas_cursor_example.c b/src/examples/ecore/ecore_evas_cursor_example.c
index a40ad3c0bc..cbf7dfc32d 100644
--- a/src/examples/ecore/ecore_evas_cursor_example.c
+++ b/src/examples/ecore/ecore_evas_cursor_example.c
@@ -202,7 +202,7 @@ main(int argc EINA_UNUSED, char *argv[] EINA_UNUSED)
}
t = ecore_timer_add(TIMEOUT, _mouse_pos_print, ee);
- efl_event_callback_add(e, EFL_CANVAS_EVENT_DEVICE_ADDED,
+ efl_event_callback_add(e, EFL_CANVAS_SCENE_EVENT_DEVICE_ADDED,
_device_added, ee);
ecore_evas_callback_resize_set(ee, _resize_cb);
ecore_evas_callback_delete_request_set(ee, _delete_request_cb);
diff --git a/src/examples/ecore/ecore_evas_vnc_example.c b/src/examples/ecore/ecore_evas_vnc_example.c
index 0f06c62d3e..c3d1ac7cfd 100644
--- a/src/examples/ecore/ecore_evas_vnc_example.c
+++ b/src/examples/ecore/ecore_evas_vnc_example.c
@@ -188,7 +188,7 @@ _dev_added_or_removed(void *data EINA_UNUSED, const Efl_Event *event)
efl_name_get(dev),
_device_type_to_string(efl_input_device_type_get(dev)),
efl_comment_get(dev),
- event->desc == EFL_CANVAS_EVENT_DEVICE_ADDED ? "added" : "removed");
+ event->desc == EFL_CANVAS_SCENE_EVENT_DEVICE_ADDED ? "added" : "removed");
if (efl_input_device_type_get(dev) == EFL_INPUT_DEVICE_TYPE_SEAT)
_seat_children_print(dev);
@@ -301,9 +301,9 @@ main(int argc, char *argv[])
_mouse_wheel, NULL);
_seat_children_print(evas_default_device_get(evas, EFL_INPUT_DEVICE_TYPE_SEAT));
- efl_event_callback_add(evas, EFL_CANVAS_EVENT_DEVICE_ADDED,
+ efl_event_callback_add(evas, EFL_CANVAS_SCENE_EVENT_DEVICE_ADDED,
_dev_added_or_removed, NULL);
- efl_event_callback_add(evas, EFL_CANVAS_EVENT_DEVICE_REMOVED,
+ efl_event_callback_add(evas, EFL_CANVAS_SCENE_EVENT_DEVICE_REMOVED,
_dev_added_or_removed, NULL);
ecore_main_loop_begin();
diff --git a/src/examples/ecore/ecore_evas_wayland_multiseat_example.c b/src/examples/ecore/ecore_evas_wayland_multiseat_example.c
index 5b21a88e39..3aec0fa524 100644
--- a/src/examples/ecore/ecore_evas_wayland_multiseat_example.c
+++ b/src/examples/ecore/ecore_evas_wayland_multiseat_example.c
@@ -106,7 +106,7 @@ _dev_added_or_removed(void *data, const Efl_Event *event)
dev, efl_name_get(dev),
_device_type_to_string(efl_input_device_type_get(dev)),
efl_comment_get(dev),
- event->desc == EFL_CANVAS_EVENT_DEVICE_ADDED ? "added" : "removed",
+ event->desc == EFL_CANVAS_SCENE_EVENT_DEVICE_ADDED ? "added" : "removed",
data);
}
@@ -197,18 +197,18 @@ main(int argc EINA_UNUSED, char *argv[] EINA_UNUSED)
mouse_wheel = ecore_event_handler_add(ECORE_EVENT_MOUSE_WHEEL,
_mouse_wheel, NULL);
- efl_event_callback_add(evas1, EFL_CANVAS_EVENT_DEVICE_ADDED,
+ efl_event_callback_add(evas1, EFL_CANVAS_SCENE_EVENT_DEVICE_ADDED,
_dev_added_or_removed, ee1);
- efl_event_callback_add(evas1, EFL_CANVAS_EVENT_DEVICE_REMOVED,
+ efl_event_callback_add(evas1, EFL_CANVAS_SCENE_EVENT_DEVICE_REMOVED,
_dev_added_or_removed, ee1);
- efl_event_callback_add(evas1, EFL_CANVAS_EVENT_DEVICE_CHANGED,
+ efl_event_callback_add(evas1, EFL_CANVAS_SCENE_EVENT_DEVICE_CHANGED,
_dev_changed, ee1);
- efl_event_callback_add(evas2, EFL_CANVAS_EVENT_DEVICE_ADDED,
+ efl_event_callback_add(evas2, EFL_CANVAS_SCENE_EVENT_DEVICE_ADDED,
_dev_added_or_removed, ee2);
- efl_event_callback_add(evas2, EFL_CANVAS_EVENT_DEVICE_REMOVED,
+ efl_event_callback_add(evas2, EFL_CANVAS_SCENE_EVENT_DEVICE_REMOVED,
_dev_added_or_removed, ee2);
- efl_event_callback_add(evas2, EFL_CANVAS_EVENT_DEVICE_CHANGED,
+ efl_event_callback_add(evas2, EFL_CANVAS_SCENE_EVENT_DEVICE_CHANGED,
_dev_changed, ee2);
ecore_main_loop_begin();
diff --git a/src/examples/ecore/ecore_idler_example.c b/src/examples/ecore/ecore_idler_example.c
index 53e7d6fed4..2185210763 100644
--- a/src/examples/ecore/ecore_idler_example.c
+++ b/src/examples/ecore/ecore_idler_example.c
@@ -110,7 +110,7 @@ main(void)
ctxt.enterer = ecore_idle_enterer_add(_enterer_cb, &ctxt);
ctxt.exiter = ecore_idle_exiter_add(_exiter_cb, &ctxt);
ctxt.idler = ecore_idler_add(_idler_cb, &ctxt);
-// ctxt.idler = efl_add(ECORE_IDLER_CLASS, NULL, ecore_idler_constructor(efl_added, _idler_cb, &ctxt));
+// ctxt.idler = efl_add_ref(ECORE_IDLER_CLASS, NULL, ecore_idler_constructor(efl_added, _idler_cb, &ctxt));
ctxt.handler = ecore_event_handler_add(_event_type,
_event_handler_cb,
&ctxt);
diff --git a/src/examples/ecore/ecore_poller_example.c b/src/examples/ecore/ecore_poller_example.c
index 6c55dbc285..3cbbcc5f2e 100644
--- a/src/examples/ecore/ecore_poller_example.c
+++ b/src/examples/ecore/ecore_poller_example.c
@@ -48,9 +48,9 @@ main(void)
poller2 = ecore_poller_add(ECORE_POLLER_CORE, 8, _poller_print_cb, str2);
poller3 = ecore_poller_add(ECORE_POLLER_CORE, 30, _poller_quit_cb, str3);
-// poller1 = efl_add(ECORE_POLLER_CLASS, NULL, // ecore_poller_constructor(efl_added, ECORE_POLLER_CORE, 4, _poller_print_cb, str1));
-// poller2 = efl_add(ECORE_POLLER_CLASS, NULL, // ecore_poller_constructor(efl_added, ECORE_POLLER_CORE, 8, _poller_print_cb, str2));
-// poller3 = efl_add(ECORE_POLLER_CLASS, NULL, // ecore_poller_constructor(efl_added, ECORE_POLLER_CORE, 20, _poller_quit_cb, str3));
+// poller1 = efl_add_ref(ECORE_POLLER_CLASS, NULL, // ecore_poller_constructor(efl_added, ECORE_POLLER_CORE, 4, _poller_print_cb, str1));
+// poller2 = efl_add_ref(ECORE_POLLER_CLASS, NULL, // ecore_poller_constructor(efl_added, ECORE_POLLER_CORE, 8, _poller_print_cb, str2));
+// poller3 = efl_add_ref(ECORE_POLLER_CLASS, NULL, // ecore_poller_constructor(efl_added, ECORE_POLLER_CORE, 20, _poller_quit_cb, str3));
ecore_main_loop_begin();
diff --git a/src/examples/ecore/ecore_promise2_example.c b/src/examples/ecore/ecore_promise2_example.c
index 4c971c9bef..f99ef7815c 100644
--- a/src/examples/ecore/ecore_promise2_example.c
+++ b/src/examples/ecore/ecore_promise2_example.c
@@ -1,15 +1,11 @@
-#define EFL_EO_API_SUPPORT 1
-#define EFL_BETA_API_SUPPORT 1
-
-#include <Ecore.h>
-#include <Eina.h>
+#include <Efl_Core.h>
#include <stdlib.h>
#include <errno.h>
typedef struct _Ctx {
Eina_Promise *p;
Eina_Bool should_fail;
- Ecore_Timer *timer;
+ Eina_Future *timer;
Eina_Value *value;
} Ctx;
@@ -28,44 +24,39 @@ typedef struct _Inner_Promise_Ctx {
return _v; \
}
-static Eina_Bool
-_timeout(void *data)
+static Eina_Value
+_timeout(void *data, const Eina_Value v, const Eina_Future *dead_future EINA_UNUSED)
{
Ctx *ctx = data;
+ if (v.type == EINA_VALUE_TYPE_ERROR) goto end;
if (ctx->should_fail) eina_promise_reject(ctx->p, ENETDOWN);
else
{
- Eina_Value v;
- eina_value_copy(ctx->value, &v);
- eina_promise_resolve(ctx->p, v);
- eina_value_free(ctx->value);
+ Eina_Value tmp;
+ eina_value_copy(ctx->value, &tmp);
+ eina_promise_resolve(ctx->p, tmp);
}
+ end:
+ if (ctx->value) eina_value_free(ctx->value);
+ ctx->timer = NULL;
free(ctx);
- return EINA_FALSE;
+ return v;
}
static void
_promise_cancel(void *data, const Eina_Promise *dead EINA_UNUSED)
{
Ctx *ctx = data;
- if (ctx->timer) ecore_timer_del(ctx->timer);
- eina_value_free(ctx->value);
- free(ctx);
-}
-
-static Eina_Future_Scheduler *
-_future_scheduler_get(void)
-{
- return efl_loop_future_scheduler_get(efl_main_loop_get());
+ if (ctx->timer) eina_future_cancel(ctx->timer);
}
static Ctx *
-_promise_ctx_new(Eina_Value *v)
+_promise_ctx_new(Efl_Loop *loop, Eina_Value *v)
{
Ctx *ctx;
ctx = calloc(1, sizeof(Ctx));
EINA_SAFETY_ON_NULL_GOTO(ctx, err_ctx);
- ctx->p = eina_promise_new(_future_scheduler_get(), _promise_cancel, ctx);
+ ctx->p = efl_loop_promise_new(loop, _promise_cancel, ctx);
EINA_SAFETY_ON_NULL_GOTO(ctx->p, err_timer);
ctx->value = v;
return ctx;
@@ -77,13 +68,13 @@ _promise_ctx_new(Eina_Value *v)
}
static Eina_Future *
-_future_get(Ctx *ctx)
+_future_get(Ctx *ctx, Efl_Loop *loop)
{
Eina_Future *f;
f = eina_future_new(ctx->p);
EINA_SAFETY_ON_NULL_GOTO(f, err_future);
- ctx->timer = ecore_timer_add(0.1, _timeout, ctx);
+ ctx->timer = eina_future_then(efl_loop_timeout(loop, 0.1), _timeout, ctx);
EINA_SAFETY_ON_NULL_GOTO(ctx->timer, err_timer);
return f;
@@ -94,32 +85,32 @@ _future_get(Ctx *ctx)
}
static Eina_Future *
-_fail_future_get(void)
+_fail_future_get(Efl_Loop *loop)
{
- Ctx *ctx = _promise_ctx_new(NULL);
+ Ctx *ctx = _promise_ctx_new(loop, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, NULL);
ctx->should_fail = EINA_TRUE;
- return _future_get(ctx);
+ return _future_get(ctx, loop);
}
static Eina_Future *
-_str_future_get(void)
+_str_future_get(Efl_Loop *loop)
{
Eina_Value *v = eina_value_util_string_new(DEFAULT_MSG);
EINA_SAFETY_ON_NULL_RETURN_VAL(v, NULL);
- Ctx *ctx = _promise_ctx_new(v);
+ Ctx *ctx = _promise_ctx_new(loop, v);
EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, NULL);
- return _future_get(ctx);
+ return _future_get(ctx, loop);
}
static Eina_Future *
-_int_future_get(void)
+_int_future_get(Efl_Loop *loop, int i)
{
- Eina_Value *v= eina_value_util_int_new(0);
+ Eina_Value *v = eina_value_util_int_new(i);
EINA_SAFETY_ON_NULL_RETURN_VAL(v, NULL);
- Ctx *ctx = _promise_ctx_new(v);
+ Ctx *ctx = _promise_ctx_new(loop, v);
EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, NULL);
- return _future_get(ctx);
+ return _future_get(ctx, loop);
}
static Eina_Value
@@ -155,11 +146,11 @@ _alternate_error_cb(void *data, const Eina_Value v, const Eina_Future *dead_futu
}
static void
-_alternate_error(void)
+_alternate_error(Efl_Loop *loop)
{
static Eina_Bool should_fail = EINA_TRUE;
- eina_future_chain(_str_future_get(),
+ eina_future_chain(_str_future_get(loop),
{.cb = _alternate_error_cb, .data = &should_fail},
{.cb = _alternate_error_cb, .data = &should_fail},
{.cb = _alternate_error_cb, .data = &should_fail},
@@ -175,12 +166,12 @@ _simple_err(void *data EINA_UNUSED, const Eina_Value v, const Eina_Future *dead_
}
static void
-_simple(void)
+_simple(Efl_Loop *loop)
{
- eina_future_chain(_str_future_get(),
+ eina_future_chain(_str_future_get(loop),
eina_future_cb_console("Expecting the following message: "DEFAULT_MSG ". Got: ", NULL),
{ .cb = _simple_ok, .data = NULL });
- eina_future_chain(_fail_future_get(),
+ eina_future_chain(_fail_future_get(loop),
eina_future_cb_console("Expectig network down error. Got: ", NULL),
{ .cb = _simple_err, .data = NULL });
}
@@ -204,9 +195,9 @@ _chain_no_errors_cb(void *data EINA_UNUSED, const Eina_Value v, const Eina_Futur
}
static void
-_chain_no_errors(void)
+_chain_no_errors(Efl_Loop *loop)
{
- eina_future_chain(_int_future_get(),
+ eina_future_chain(_int_future_get(loop, 0),
eina_future_cb_console("Expecting no value. Got: ", NULL),
{.cb = _chain_no_errors_cb, .data = NULL},
eina_future_cb_console("Expecting number 2. Got: ", NULL),
@@ -228,9 +219,9 @@ _chain_with_error_cb(void *data EINA_UNUSED, const Eina_Value v EINA_UNUSED, con
}
static void
-_chain_with_error(void)
+_chain_with_error(Efl_Loop *loop)
{
- eina_future_chain(_int_future_get(),
+ eina_future_chain(_int_future_get(loop, 0),
{ _chain_with_error_cb, NULL },
eina_future_cb_console("Expecting argument list too long. Got: ", NULL),
{ .cb = _simple_err, .data = NULL });
@@ -266,19 +257,22 @@ _inner_promise_cancel(void *data, const Eina_Promise *dead EINA_UNUSED)
}
static Eina_Value
-_chain_inner_cb(void *data, const Eina_Value v EINA_UNUSED, const Eina_Future *dead_future EINA_UNUSED)
+_chain_inner_cb(void *data, const Eina_Value v, const Eina_Future *dead_future)
{
Inner_Promise_Ctx *ctx;
Eina_Value r;
+ int s = 0;
+
+ eina_value_int_get(&v, &s);
ctx = calloc(1, sizeof(Inner_Promise_Ctx));
EINA_SAFETY_ON_NULL_GOTO(ctx, err);
- ctx->promise = eina_promise_new(_future_scheduler_get(), _inner_promise_cancel, ctx);
+ ctx->promise = eina_promise_continue_new(dead_future, _inner_promise_cancel, ctx);
EINA_SAFETY_ON_NULL_GOTO(ctx->promise, err);
printf("Creating a new promise inside the future cb\n");
- ctx->future = eina_future_then(_int_future_get(),
- !data ? _delayed_resolve : _delayed_reject,
+ ctx->future = eina_future_then(_int_future_get(data, 0),
+ !s ? _delayed_resolve : _delayed_reject,
ctx);
return eina_promise_as_value(ctx->promise);
@@ -297,30 +291,30 @@ _chain_inner_last_cb(void *data EINA_UNUSED, const Eina_Value v, const Eina_Futu
}
static void
-_chain_inner_no_errors(void)
+_chain_inner_no_errors(Efl_Loop *loop)
{
- eina_future_chain(_int_future_get(),
- { .cb = _chain_inner_cb, .data = NULL },
+ eina_future_chain(_int_future_get(loop, 0),
+ { .cb = _chain_inner_cb, .data = loop },
eina_future_cb_console("Expecting message: 'Hello from inner future'. Got: ", NULL),
{ .cb = _chain_inner_last_cb, .data = NULL });
}
static Eina_Value
-_err_inner_chain(void *data EINA_UNUSED, const Eina_Value v, const Eina_Future *dead_future EINA_UNUSED)
+_err_inner_chain(void *data, const Eina_Value v, const Eina_Future *dead_future EINA_UNUSED)
{
VALUE_TYPE_CHECK(v, EINA_VALUE_TYPE_ERROR);
- ecore_main_loop_quit();
+ efl_loop_quit(data, EINA_VALUE_EMPTY);
return v;
}
static void
-_chain_inner_errors(void)
+_chain_inner_errors(Efl_Loop *loop)
{
- eina_future_chain(_int_future_get(),
- { .cb = _chain_inner_cb, .data = (void *)1 },
+ eina_future_chain(_int_future_get(loop, 1),
+ { .cb = _chain_inner_cb, .data = loop },
eina_future_cb_console("Expection network down error. Got: ", NULL),
- { .cb = _err_inner_chain, .data = NULL });
+ { .cb = _err_inner_chain, .data = loop });
}
static Eina_Value
@@ -331,11 +325,11 @@ _canceled_cb(void *data EINA_UNUSED, const Eina_Value v, const Eina_Future *dead
}
static void
-_future_cancel(void)
+_future_cancel(Efl_Loop *loop)
{
Eina_Future *f;
- f = eina_future_chain(_int_future_get(),
+ f = eina_future_chain(_int_future_get(loop, 0),
eina_future_cb_console("Expecting cancelled operation error. Got: ", NULL),
{ .cb = _canceled_cb, .data = NULL },
eina_future_cb_console("Expecting cancelled operation error. Got: ", NULL),
@@ -350,36 +344,17 @@ _future_cancel(void)
eina_future_cancel(f);
}
-int
-main(int argc EINA_UNUSED, char *argv[] EINA_UNUSED)
+EAPI_MAIN void
+efl_main(void *data EINA_UNUSED,
+ const Efl_Event *ev)
{
- if (!eina_init())
- {
- fprintf(stderr, "Could not init eina\n");
- return EXIT_FAILURE;
- }
-
- if (!ecore_init())
- {
- fprintf(stderr, "Could not init ecore\n");
- goto err_ecore;
- }
-
- _simple();
- _alternate_error();
- _chain_no_errors();
- _chain_with_error();
- _chain_inner_no_errors();
- _chain_inner_errors();
- _future_cancel();
-
- ecore_main_loop_begin();
-
- eina_shutdown();
- ecore_shutdown();
- return EXIT_SUCCESS;
-
- err_ecore:
- eina_shutdown();
- return EXIT_FAILURE;
+ _simple(ev->object);
+ _alternate_error(ev->object);
+ _chain_no_errors(ev->object);
+ _chain_with_error(ev->object);
+ _chain_inner_no_errors(ev->object);
+ _chain_inner_errors(ev->object);
+ _future_cancel(ev->object);
}
+
+EFL_MAIN();
diff --git a/src/examples/ecore/ecore_thread_example.c b/src/examples/ecore/ecore_thread_example.c
index 0c7f7309e4..aac7643734 100644
--- a/src/examples/ecore/ecore_thread_example.c
+++ b/src/examples/ecore/ecore_thread_example.c
@@ -3,7 +3,6 @@
*/
#include <stdio.h>
#include <stdlib.h>
-#include <dirent.h>
#include <unistd.h>
#include <Ecore.h>
@@ -91,13 +90,9 @@ _feedback_job(void *data EINA_UNUSED, Ecore_Thread *th)
time_t t;
int i, count;
Feedback_Thread_Data *ftd = NULL;
-#ifdef _WIN32
- HANDLE h;
- WIN32_FIND_DATA fd;
-#else
- DIR *dir;
-#endif
+ Eina_Iterator *it;
App_Msg *msg;
+ char *name;
count = (int)(uintptr_t)ecore_thread_global_data_find("count");
for (i = 0; i < count; i++)
@@ -115,45 +110,26 @@ _feedback_job(void *data EINA_UNUSED, Ecore_Thread *th)
if (!ftd)
return;
-#ifdef _WIN32
- h = FindFirstFile(ftd->base, &fd);
- if (h == INVALID_HANDLE_VALUE)
+ it = eina_file_ls(ftd->base);
+ if (!it)
goto the_end;
-#else
- dir = opendir(ftd->base);
- if (!dir)
- goto the_end;
-#endif
msg = calloc(1, sizeof(App_Msg));
t = time(NULL);
- while (time(NULL) < t + 2)
+ EINA_ITERATOR_FOREACH(it, name)
{
-#ifdef _WIN32
- if (strlen(fd.cFileName) >= 10)
- msg->list = eina_list_append(msg->list,
- strdup(fd.cFileName));
- FindNextFile(h, &fd);
-#else
- struct dirent entry, *result;
-
- if (readdir_r(dir, &entry, &result))
- break;
- if (!result)
- break;
-
- if (strlen(result->d_name) >= 10)
- msg->list = eina_list_append(msg->list,
- strdup(result->d_name));
-#endif
+ if (time(NULL) >= (t + 2))
+ {
+ eina_stringshare_del(name);
+ break;
+ }
+ if (eina_stringshare_strlen(name) >= 10)
+ msg->list = eina_list_append(msg->list, strdup(name));
+ eina_stringshare_del(name);
}
-#ifdef _WIN32
- FindClose(h);
-#else
- closedir(dir);
-#endif
+ eina_iterator_free(it);
ecore_thread_feedback(th, msg);
the_end:
@@ -350,17 +326,29 @@ main(int argc, char *argv[])
ecore_thread_global_data_add("count", (void *)3, NULL, EINA_FALSE);
ftd = calloc(1, sizeof(Feedback_Thread_Data));
ftd->name = strdup("data0");
+#ifdef _WIN32
+ ftd->base = strdup("c:/windows/System32");
+#else
ftd->base = strdup("/usr/bin");
+#endif
eina_lock_new(&ftd->mutex);
ecore_thread_global_data_add(ftd->name, ftd, NULL, EINA_TRUE);
ftd = calloc(1, sizeof(Feedback_Thread_Data));
ftd->name = strdup("data1");
+#ifdef _WIN32
+ ftd->base = strdup("c:/windows/Fonts");
+#else
ftd->base = strdup("/usr/lib");
+#endif
eina_lock_new(&ftd->mutex);
ecore_thread_global_data_add(ftd->name, ftd, NULL, EINA_TRUE);
ftd = calloc(1, sizeof(Feedback_Thread_Data));
ftd->name = strdup("data2");
- ftd->base = strdup("/usr/share");
+#ifdef _WIN32
+ ftd->base = strdup("c:/windows/Help");
+#else
+ ftd->base = strdup("/usr/lib");
+#endif
eina_lock_new(&ftd->mutex);
ecore_thread_global_data_add(ftd->name, ftd, NULL, EINA_TRUE);
}
diff --git a/src/examples/ecore/efl_io_buffered_stream_example.c b/src/examples/ecore/efl_io_buffered_stream_example.c
index aaf1a997bf..3338bae396 100644
--- a/src/examples/ecore/efl_io_buffered_stream_example.c
+++ b/src/examples/ecore/efl_io_buffered_stream_example.c
@@ -1,8 +1,5 @@
-#define EFL_BETA_API_SUPPORT 1
-#define EFL_EO_API_SUPPORT 1
-#include <Ecore.h>
+#include <Efl_Net.h>
#include <Ecore_Getopt.h>
-#include <Ecore_Con.h>
static int retval = EXIT_SUCCESS;
static Eina_List *commands = NULL;
@@ -92,14 +89,14 @@ _stream_error(void *data EINA_UNUSED, const Efl_Event *event)
fprintf(stderr, "INFO: %s error: #%d '%s'\n",
efl_name_get(event->object), *perr, eina_error_msg_get(*perr));
retval = EXIT_FAILURE;
- ecore_main_loop_quit();
+ efl_loop_quit(efl_loop_get(event->object), EINA_VALUE_EMPTY);
}
static void
_stream_eos(void *data EINA_UNUSED, const Efl_Event *event)
{
fprintf(stderr, "INFO: %s eos, quit\n", efl_name_get(event->object));
- ecore_main_loop_quit();
+ efl_loop_quit(efl_loop_get(event->object), EINA_VALUE_EMPTY);
}
EFL_CALLBACKS_ARRAY_DEFINE(stream_cbs,
@@ -174,8 +171,9 @@ static const Ecore_Getopt options = {
}
};
-int
-main(int argc, char **argv)
+EAPI_MAIN void
+efl_main(void *data EINA_UNUSED,
+ const Efl_Event *ev)
{
char *address = NULL;
char *line_delimiter_str = NULL;
@@ -200,12 +198,9 @@ main(int argc, char **argv)
};
Eina_Error err;
int args;
- Eo *dialer, *loop;
+ Eo *dialer;
- ecore_init();
- ecore_con_init();
-
- args = ecore_getopt_parse(&options, values, argc, argv);
+ args = ecore_getopt_parse(&options, values, 0, NULL);
if (args < 0)
{
fputs("ERROR: Could not parse command line options.\n", stderr);
@@ -215,7 +210,7 @@ main(int argc, char **argv)
if (quit_option) goto end;
- args = ecore_getopt_parse_positional(&options, values, argc, argv, args);
+ args = ecore_getopt_parse_positional(&options, values, 0, NULL, args);
if (args < 0)
{
fputs("ERROR: Could not parse positional arguments.\n", stderr);
@@ -235,12 +230,10 @@ main(int argc, char **argv)
/*
* some objects such as the Efl.Io.Buffered_Stream and
* Efl.Net.Dialer.Tcp depend on main loop, thus their parent must
- * be a loop provider. We use the loop itself.
+ * be a loop provider. We use the loop itself that come from event.
*/
- loop = efl_main_loop_get();
-
/* The TCP client to use to send/receive network data */
- dialer = efl_add(EFL_NET_DIALER_TCP_CLASS, loop,
+ dialer = efl_add(EFL_NET_DIALER_TCP_CLASS, ev->object,
efl_name_set(efl_added, "dialer"),
efl_event_callback_add(efl_added, EFL_NET_DIALER_EVENT_CONNECTED, _dialer_connected, NULL));
if (!dialer)
@@ -263,7 +256,7 @@ main(int argc, char **argv)
*
* On incoming data we peek at it with slice_get() and then clear().
*/
- stream = efl_add(EFL_IO_BUFFERED_STREAM_CLASS, loop,
+ stream = efl_add(EFL_IO_BUFFERED_STREAM_CLASS, ev->object,
efl_name_set(efl_added, "stream"),
efl_io_buffered_stream_inner_io_set(efl_added, dialer), /* mandatory! */
efl_io_buffered_stream_line_delimiter_set(efl_added, line_delimiter),
@@ -289,7 +282,7 @@ main(int argc, char **argv)
goto error_dialing;
}
- ecore_main_loop_begin();
+ return ;
error_dialing:
efl_io_closer_close(stream);
@@ -303,8 +296,7 @@ main(int argc, char **argv)
free(cmd);
}
- ecore_con_shutdown();
- ecore_shutdown();
-
- return retval;
+ efl_loop_quit(ev->object, eina_value_int_init(retval));
}
+
+EFL_MAIN();
diff --git a/src/examples/ecore/efl_io_copier_example.c b/src/examples/ecore/efl_io_copier_example.c
index 603da4dda0..b7e526bd3c 100644
--- a/src/examples/ecore/efl_io_copier_example.c
+++ b/src/examples/ecore/efl_io_copier_example.c
@@ -1,7 +1,4 @@
-#define EFL_BETA_API_SUPPORT 1
-#define EFL_EO_API_SUPPORT 1
-#include <Ecore.h>
-#include <Ecore_Con.h>
+#include <Efl_Net.h>
#include <Ecore_Getopt.h>
#include <fcntl.h>
@@ -200,7 +197,7 @@ _copier_done(void *data EINA_UNUSED, const Efl_Event *event)
}
fprintf(stderr, "INFO: done\n");
- ecore_main_loop_quit();
+ efl_loop_quit(efl_loop_get(event->object), EINA_VALUE_EMPTY);
}
static void
@@ -209,7 +206,7 @@ _copier_error(void *data EINA_UNUSED, const Efl_Event *event)
const Eina_Error *perr = event->info;
fprintf(stderr, "INFO: error: %d '%s'\n", *perr, eina_error_msg_get(*perr));
retval = EXIT_FAILURE;
- ecore_main_loop_quit();
+ efl_loop_quit(efl_loop_get(event->object), EINA_VALUE_EMPTY);
}
static void
@@ -362,8 +359,38 @@ static const Ecore_Getopt options = {
}
};
-int
-main(int argc, char **argv)
+static Eo *copier = NULL;
+
+EAPI_MAIN void
+efl_pause(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_resume(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_terminate(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+ /* FIXME: For the moment the main loop doesn't get
+ properly destroyed on shutdown which disallow
+ relying on parent destroying their children */
+ if (copier)
+ {
+ efl_io_closer_close(copier);
+ efl_del(copier);
+ }
+ copier = NULL;
+}
+
+EAPI_MAIN void
+efl_main(void *data EINA_UNUSED,
+ const Efl_Event *ev)
{
char *input_fname = NULL;
char *output_fname = NULL;
@@ -394,14 +421,10 @@ main(int argc, char **argv)
ECORE_GETOPT_VALUE_NONE /* sentinel */
};
int args;
- Eo *input, *output, *copier;
+ Eo *input, *output;
Eina_Slice line_delm_slice = EINA_SLICE_STR_LITERAL("");
- ecore_init();
- ecore_con_init();
- ecore_con_url_init();
-
- args = ecore_getopt_parse(&options, values, argc, argv);
+ args = ecore_getopt_parse(&options, values, 0, NULL);
if (args < 0)
{
fputs("ERROR: Could not parse command line options.\n", stderr);
@@ -411,7 +434,7 @@ main(int argc, char **argv)
if (quit_option) goto end;
- args = ecore_getopt_parse_positional(&options, values, argc, argv, args);
+ args = ecore_getopt_parse_positional(&options, values, 0, NULL, args);
if (args < 0)
{
fputs("ERROR: Could not parse positional arguments.\n", stderr);
@@ -429,7 +452,7 @@ main(int argc, char **argv)
if (strcmp(input_fname, ":stdin:") == 0)
{
- input = efl_add(EFL_IO_STDIN_CLASS, NULL,
+ input = efl_add_ref(EFL_IO_STDIN_CLASS, NULL,
efl_event_callback_array_add(efl_added, input_cbs(), NULL));
if (!input)
{
@@ -446,7 +469,7 @@ main(int argc, char **argv)
*/
const char *address = input_fname + strlen("tcp://");
Eina_Error err;
- input = efl_add(EFL_NET_DIALER_TCP_CLASS, efl_main_loop_get(),
+ input = efl_add(EFL_NET_DIALER_TCP_CLASS, ev->object,
efl_event_callback_array_add(efl_added, input_cbs(), NULL), /* optional */
efl_event_callback_array_add(efl_added, dialer_cbs(), NULL) /* optional */
);
@@ -470,7 +493,7 @@ main(int argc, char **argv)
{
Eina_Error err;
- input = efl_add(EFL_NET_DIALER_HTTP_CLASS, efl_main_loop_get(),
+ input = efl_add(EFL_NET_DIALER_HTTP_CLASS, ev->object,
efl_net_dialer_http_method_set(efl_added, "GET"),
efl_event_callback_array_add(efl_added, input_cbs(), NULL), /* optional */
efl_event_callback_array_add(efl_added, dialer_cbs(), NULL), /* optional */
@@ -496,7 +519,7 @@ main(int argc, char **argv)
{
Eina_Error err;
- input = efl_add(EFL_NET_DIALER_WEBSOCKET_CLASS, efl_main_loop_get(),
+ input = efl_add(EFL_NET_DIALER_WEBSOCKET_CLASS, ev->object,
efl_net_dialer_websocket_streaming_mode_set(efl_added, EFL_NET_DIALER_WEBSOCKET_STREAMING_MODE_TEXT),
efl_event_callback_array_add(efl_added, input_cbs(), NULL), /* optional */
efl_event_callback_array_add(efl_added, dialer_cbs(), NULL) /* optional */
@@ -525,7 +548,7 @@ main(int argc, char **argv)
const char *bind_address = input_fname + strlen("udp://");
const char *address;
Eina_Error err;
- input = efl_add(EFL_NET_DIALER_UDP_CLASS, efl_main_loop_get(),
+ input = efl_add(EFL_NET_DIALER_UDP_CLASS, ev->object,
efl_net_socket_udp_bind_set(efl_added, bind_address), /* use the address as the bind, so we can get data at it */
efl_event_callback_array_add(efl_added, input_cbs(), NULL), /* optional */
efl_event_callback_array_add(efl_added, dialer_cbs(), NULL) /* optional */
@@ -557,7 +580,7 @@ main(int argc, char **argv)
*/
const char *address = input_fname + strlen("unix://");
Eina_Error err;
- input = efl_add(EFL_NET_DIALER_UNIX_CLASS, efl_main_loop_get(),
+ input = efl_add(EFL_NET_DIALER_UNIX_CLASS, ev->object,
efl_event_callback_array_add(efl_added, input_cbs(), NULL), /* optional */
efl_event_callback_array_add(efl_added, dialer_cbs(), NULL) /* optional */
);
@@ -586,7 +609,7 @@ main(int argc, char **argv)
*/
const char *address = input_fname + strlen("windows://");
Eina_Error err;
- input = efl_add(EFL_NET_DIALER_WINDOWS_CLASS, efl_main_loop_get(),
+ input = efl_add(EFL_NET_DIALER_WINDOWS_CLASS, ev->object,
efl_event_callback_array_add(efl_added, input_cbs(), NULL), /* optional */
efl_event_callback_array_add(efl_added, dialer_cbs(), NULL) /* optional */
);
@@ -614,7 +637,7 @@ main(int argc, char **argv)
*/
const char *address = input_fname + strlen("ssl://");
Eina_Error err;
- input = efl_add(EFL_NET_DIALER_SSL_CLASS, efl_main_loop_get(),
+ input = efl_add(EFL_NET_DIALER_SSL_CLASS, ev->object,
efl_event_callback_array_add(efl_added, input_cbs(), NULL), /* optional */
efl_event_callback_array_add(efl_added, dialer_cbs(), NULL) /* optional */
);
@@ -639,7 +662,7 @@ main(int argc, char **argv)
else
{
/* regular file, open with flags: read-only and close-on-exec */
- input = efl_add(EFL_IO_FILE_CLASS, NULL,
+ input = efl_add_ref(EFL_IO_FILE_CLASS, NULL,
efl_file_set(efl_added, input_fname, NULL), /* mandatory */
efl_io_file_flags_set(efl_added, O_RDONLY), /* default */
efl_io_closer_close_on_exec_set(efl_added, EINA_TRUE), /* recommended, set *after* flags, or include O_CLOEXEC in flags -- be careful with _WIN32 that doesn't support it. */
@@ -656,7 +679,7 @@ main(int argc, char **argv)
if (strcmp(output_fname, ":stdout:") == 0)
{
- output = efl_add(EFL_IO_STDOUT_CLASS, NULL,
+ output = efl_add_ref(EFL_IO_STDOUT_CLASS, NULL,
efl_event_callback_array_add(efl_added, output_cbs(), NULL) /* optional */
);
if (!output)
@@ -668,7 +691,7 @@ main(int argc, char **argv)
}
else if (strcmp(output_fname, ":stderr:") == 0)
{
- output = efl_add(EFL_IO_STDERR_CLASS, NULL,
+ output = efl_add_ref(EFL_IO_STDERR_CLASS, NULL,
efl_event_callback_array_add(efl_added, output_cbs(), NULL) /* optional */
);
if (!output)
@@ -695,7 +718,7 @@ main(int argc, char **argv)
* When finished get the efl_io_buffer_slice_get(), see
* _copier_done().
*/
- output = efl_add(EFL_IO_BUFFER_CLASS, NULL,
+ output = efl_add_ref(EFL_IO_BUFFER_CLASS, NULL,
efl_event_callback_array_add(efl_added, output_cbs(), NULL), /* optional */
efl_event_callback_array_add(efl_added, output_buffer_cbs(), NULL) /* optional */
);
@@ -725,7 +748,7 @@ main(int argc, char **argv)
*/
const char *address = output_fname + strlen("tcp://");
Eina_Error err;
- output = efl_add(EFL_NET_DIALER_TCP_CLASS, efl_main_loop_get(),
+ output = efl_add(EFL_NET_DIALER_TCP_CLASS, ev->object,
efl_event_callback_array_add(efl_added, output_cbs(), NULL), /* optional */
efl_event_callback_array_add(efl_added, dialer_cbs(), NULL) /* optional */
);
@@ -749,7 +772,7 @@ main(int argc, char **argv)
{
Eina_Error err;
- output = efl_add(EFL_NET_DIALER_HTTP_CLASS, efl_main_loop_get(),
+ output = efl_add(EFL_NET_DIALER_HTTP_CLASS, ev->object,
efl_net_dialer_http_method_set(efl_added, "PUT"),
efl_event_callback_array_add(efl_added, output_cbs(), NULL), /* optional */
efl_event_callback_array_add(efl_added, dialer_cbs(), NULL), /* optional */
@@ -775,7 +798,7 @@ main(int argc, char **argv)
{
Eina_Error err;
- output = efl_add(EFL_NET_DIALER_WEBSOCKET_CLASS, efl_main_loop_get(),
+ output = efl_add(EFL_NET_DIALER_WEBSOCKET_CLASS, ev->object,
efl_net_dialer_websocket_streaming_mode_set(efl_added, EFL_NET_DIALER_WEBSOCKET_STREAMING_MODE_TEXT),
efl_event_callback_array_add(efl_added, output_cbs(), NULL), /* optional */
efl_event_callback_array_add(efl_added, dialer_cbs(), NULL) /* optional */
@@ -803,7 +826,7 @@ main(int argc, char **argv)
*/
const char *address = output_fname + strlen("udp://");
Eina_Error err;
- output = efl_add(EFL_NET_DIALER_UDP_CLASS, efl_main_loop_get(),
+ output = efl_add(EFL_NET_DIALER_UDP_CLASS, ev->object,
efl_event_callback_array_add(efl_added, output_cbs(), NULL), /* optional */
efl_event_callback_array_add(efl_added, dialer_cbs(), NULL) /* optional */
);
@@ -831,7 +854,7 @@ main(int argc, char **argv)
*/
const char *address = output_fname + strlen("unix://");
Eina_Error err;
- output = efl_add(EFL_NET_DIALER_UNIX_CLASS, efl_main_loop_get(),
+ output = efl_add(EFL_NET_DIALER_UNIX_CLASS, ev->object,
efl_event_callback_array_add(efl_added, output_cbs(), NULL), /* optional */
efl_event_callback_array_add(efl_added, dialer_cbs(), NULL) /* optional */
);
@@ -860,7 +883,7 @@ main(int argc, char **argv)
*/
const char *address = output_fname + strlen("windows://");
Eina_Error err;
- output = efl_add(EFL_NET_DIALER_WINDOWS_CLASS, efl_main_loop_get(),
+ output = efl_add(EFL_NET_DIALER_WINDOWS_CLASS, ev->object,
efl_event_callback_array_add(efl_added, output_cbs(), NULL), /* optional */
efl_event_callback_array_add(efl_added, dialer_cbs(), NULL) /* optional */
);
@@ -888,7 +911,7 @@ main(int argc, char **argv)
*/
const char *address = output_fname + strlen("ssl://");
Eina_Error err;
- output = efl_add(EFL_NET_DIALER_SSL_CLASS, efl_main_loop_get(),
+ output = efl_add(EFL_NET_DIALER_SSL_CLASS, ev->object,
efl_event_callback_array_add(efl_added, output_cbs(), NULL), /* optional */
efl_event_callback_array_add(efl_added, dialer_cbs(), NULL) /* optional */
);
@@ -915,7 +938,7 @@ main(int argc, char **argv)
/* regular file, open with flags: write-only, close-on-exec,
* create if did not exist and truncate if exist.
*/
- output = efl_add(EFL_IO_FILE_CLASS, NULL,
+ output = efl_add_ref(EFL_IO_FILE_CLASS, NULL,
efl_file_set(efl_added, output_fname, NULL), /* mandatory */
efl_io_file_flags_set(efl_added, O_WRONLY | O_CREAT | O_TRUNC), /* mandatory for write */
efl_io_closer_close_on_exec_set(efl_added, EINA_TRUE), /* recommended, set *after* flags, or include O_CLOEXEC in flags -- be careful with _WIN32 that doesn't support it. */
@@ -941,7 +964,7 @@ main(int argc, char **argv)
if (line_delimiter)
line_delm_slice = (Eina_Slice)EINA_SLICE_STR(line_delimiter);
- copier = efl_add(EFL_IO_COPIER_CLASS, efl_main_loop_get(),
+ copier = efl_add(EFL_IO_COPIER_CLASS, ev->object,
efl_io_copier_source_set(efl_added, input), /* mandatory */
efl_io_copier_destination_set(efl_added, output), /* optional, see :none: */
efl_io_copier_line_delimiter_set(efl_added, line_delm_slice), /* optional */
@@ -963,10 +986,7 @@ main(int argc, char **argv)
output,
output ? efl_class_name_get(efl_class_get(output)) : ":none:");
- ecore_main_loop_begin();
- efl_io_closer_close(copier);
- efl_del(copier);
- copier = NULL;
+ return ;
end_output:
if (output)
@@ -979,9 +999,8 @@ main(int argc, char **argv)
input = NULL;
end:
- ecore_con_url_shutdown();
- ecore_con_shutdown();
- ecore_shutdown();
- return retval;
+ efl_loop_quit(ev->object, eina_value_int_init(retval));
}
+
+EFL_MAIN_EX();
diff --git a/src/examples/ecore/efl_io_copier_simple_example.c b/src/examples/ecore/efl_io_copier_simple_example.c
index 0b0410401e..ee945cce7b 100644
--- a/src/examples/ecore/efl_io_copier_simple_example.c
+++ b/src/examples/ecore/efl_io_copier_simple_example.c
@@ -1,14 +1,11 @@
-#define EFL_BETA_API_SUPPORT 1
-#define EFL_EO_API_SUPPORT 1
-#include <Ecore.h>
-
-static int retval = EXIT_SUCCESS;
+#include <Efl_Core.h>
static void
_copier_done(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
{
fprintf(stderr, "INFO: done\n");
- ecore_main_loop_quit();
+
+ efl_loop_quit(efl_loop_get(event->object), EINA_VALUE_EMPTY);
}
static void
@@ -16,22 +13,50 @@ _copier_error(void *data EINA_UNUSED, const Efl_Event *event)
{
const Eina_Error *perr = event->info;
fprintf(stderr, "INFO: error: #%d '%s'\n", *perr, eina_error_msg_get(*perr));
- ecore_main_loop_quit();
- retval = EXIT_FAILURE;
+
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
}
EFL_CALLBACKS_ARRAY_DEFINE(copier_cbs,
{ EFL_IO_COPIER_EVENT_DONE, _copier_done },
{ EFL_IO_COPIER_EVENT_ERROR, _copier_error });
-int
-main(int argc EINA_UNUSED, char *argv[] EINA_UNUSED)
+static Eo *copier = NULL;
+
+EAPI_MAIN void
+efl_pause(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_resume(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_terminate(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
{
- Eo *input, *output, *copier, *loop;
+ /* FIXME: For the moment the main loop doesn't get
+ properly destroyed on shutdown which disallow
+ relying on parent destroying their children */
+ if (copier)
+ {
+ efl_io_closer_close(copier);
+ efl_del(copier);
+ }
+ copier = NULL;
+}
- ecore_init();
+EAPI_MAIN void
+efl_main(void *data EINA_UNUSED,
+ const Efl_Event *ev)
+{
+ Eo *input, *output, *loop;
- loop = efl_main_loop_get();
+ loop = ev->object;
input = efl_add(EFL_IO_STDIN_CLASS, loop);
output = efl_add(EFL_IO_STDOUT_CLASS, loop);
copier = efl_add(EFL_IO_COPIER_CLASS, loop,
@@ -39,14 +64,6 @@ main(int argc EINA_UNUSED, char *argv[] EINA_UNUSED)
efl_io_copier_destination_set(efl_added, output), /* optional */
efl_event_callback_array_add(efl_added, copier_cbs(), NULL) /* recommended, at least EFL_IO_COPIER_EVENT_DONE. */
);
-
- ecore_main_loop_begin();
-
- efl_io_closer_close(copier);
- efl_del(copier);
- efl_del(output);
- efl_del(input);
-
- ecore_shutdown();
- return retval;
}
+
+EFL_MAIN_EX();
diff --git a/src/examples/ecore/efl_io_queue_example.c b/src/examples/ecore/efl_io_queue_example.c
index 4f75c47ce7..9367716729 100644
--- a/src/examples/ecore/efl_io_queue_example.c
+++ b/src/examples/ecore/efl_io_queue_example.c
@@ -1,10 +1,6 @@
-#define EFL_BETA_API_SUPPORT 1
-#define EFL_EO_API_SUPPORT 1
-#include <Ecore.h>
+#include <Efl_Net.h>
#include <Ecore_Getopt.h>
-#include <Ecore_Con.h>
-static int retval = EXIT_SUCCESS;
static Eina_List *waiting = NULL;
static Eina_List *commands = NULL;
static Eina_Slice line_delimiter;
@@ -87,7 +83,7 @@ _copier_done(void *data EINA_UNUSED, const Efl_Event *event)
waiting = eina_list_remove(waiting, event->object);
if (!waiting)
- ecore_main_loop_quit();
+ efl_loop_quit(efl_loop_get(event->object), EINA_VALUE_EMPTY);
}
static void
@@ -96,8 +92,8 @@ _copier_error(void *data EINA_UNUSED, const Efl_Event *event)
const Eina_Error *perr = event->info;
fprintf(stderr, "INFO: %s error: #%d '%s'\n",
efl_name_get(event->object), *perr, eina_error_msg_get(*perr));
- retval = EXIT_FAILURE;
- ecore_main_loop_quit();
+
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
}
EFL_CALLBACKS_ARRAY_DEFINE(copier_cbs,
@@ -171,8 +167,34 @@ static const Ecore_Getopt options = {
}
};
-int
-main(int argc, char **argv)
+EAPI_MAIN void
+efl_pause(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_resume(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_terminate(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+ if (waiting)
+ {
+ fprintf(stderr, "ERROR: %d operations were waiting!\n",
+ eina_list_count(waiting));
+ eina_list_free(waiting);
+ waiting = NULL;
+ }
+}
+
+EAPI_MAIN void
+efl_main(void *data EINA_UNUSED,
+ const Efl_Event *ev)
{
char *address = NULL;
char *line_delimiter_str = NULL;
@@ -199,24 +221,19 @@ main(int argc, char **argv)
int args;
Eo *dialer, *sender, *receiver, *loop;
- ecore_init();
- ecore_con_init();
-
- args = ecore_getopt_parse(&options, values, argc, argv);
+ args = ecore_getopt_parse(&options, values, 0, NULL);
if (args < 0)
{
fputs("ERROR: Could not parse command line options.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
if (quit_option) goto end;
- args = ecore_getopt_parse_positional(&options, values, argc, argv, args);
+ args = ecore_getopt_parse_positional(&options, values, 0, NULL, args);
if (args < 0)
{
fputs("ERROR: Could not parse positional arguments.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
@@ -225,7 +242,6 @@ main(int argc, char **argv)
if (!commands)
{
fputs("ERROR: missing commands to send.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
@@ -242,13 +258,12 @@ main(int argc, char **argv)
* the line_delimiter, then wait for a reply from the server, then
* write another.
*/
- send_queue = efl_add(EFL_IO_QUEUE_CLASS, NULL,
+ send_queue = efl_add_ref(EFL_IO_QUEUE_CLASS, NULL,
efl_name_set(efl_added, "send_queue"),
efl_io_queue_limit_set(efl_added, buffer_limit));
if (!send_queue)
{
fprintf(stderr, "ERROR: could not create Efl_Io_Queue (send)\n");
- retval = EXIT_FAILURE;
goto end;
}
@@ -264,14 +279,13 @@ main(int argc, char **argv)
* Our example's usage is to peek its data with slice_get() then
* clear().
*/
- receive_queue = efl_add(EFL_IO_QUEUE_CLASS, NULL,
+ receive_queue = efl_add_ref(EFL_IO_QUEUE_CLASS, NULL,
efl_name_set(efl_added, "receive_queue"),
efl_io_queue_limit_set(efl_added, buffer_limit),
efl_event_callback_add(efl_added, EFL_IO_QUEUE_EVENT_SLICE_CHANGED, _receiver_data, NULL));
if (!receive_queue)
{
fprintf(stderr, "ERROR: could not create Efl_Io_Queue (receive)\n");
- retval = EXIT_FAILURE;
goto error_receive_queue;
}
@@ -285,7 +299,7 @@ main(int argc, char **argv)
* depend on main loop, thus their parent must be a loop
* provider. We use the loop itself.
*/
- loop = efl_main_loop_get();
+ loop = ev->object;
/* The TCP client to use to send/receive network data */
dialer = efl_add(EFL_NET_DIALER_TCP_CLASS, loop,
@@ -294,7 +308,6 @@ main(int argc, char **argv)
if (!dialer)
{
fprintf(stderr, "ERROR: could not create Efl_Net_Dialer_Tcp\n");
- retval = EXIT_FAILURE;
goto error_dialer;
}
@@ -308,7 +321,6 @@ main(int argc, char **argv)
if (!sender)
{
fprintf(stderr, "ERROR: could not create Efl_Io_Copier (sender)\n");
- retval = EXIT_FAILURE;
goto error_sender;
}
@@ -322,7 +334,6 @@ main(int argc, char **argv)
if (!receiver)
{
fprintf(stderr, "ERROR: could not create Efl_Io_Copier (receiver)\n");
- retval = EXIT_FAILURE;
goto error_receiver;
}
@@ -337,15 +348,7 @@ main(int argc, char **argv)
waiting = eina_list_append(waiting, sender);
waiting = eina_list_append(waiting, receiver);
- ecore_main_loop_begin();
-
- if (waiting)
- {
- fprintf(stderr, "ERROR: %d operations were waiting!\n",
- eina_list_count(waiting));
- eina_list_free(waiting);
- waiting = NULL;
- }
+ return ;
error_dialing:
efl_io_closer_close(receiver);
@@ -356,9 +359,9 @@ main(int argc, char **argv)
error_sender:
efl_del(dialer);
error_dialer:
- efl_del(receive_queue);
+ efl_unref(receive_queue);
error_receive_queue:
- efl_del(send_queue);
+ efl_unref(send_queue);
end:
EINA_LIST_FREE(commands, cmd)
{
@@ -366,8 +369,7 @@ main(int argc, char **argv)
free(cmd);
}
- ecore_con_shutdown();
- ecore_shutdown();
-
- return retval;
+ efl_loop_quit(efl_loop_get(ev->object), eina_value_int_init(EXIT_FAILURE));
}
+
+EFL_MAIN_EX();
diff --git a/src/examples/ecore/efl_net_control_example.c b/src/examples/ecore/efl_net_control_example.c
index ac9a4d6f5b..3053c87cad 100644
--- a/src/examples/ecore/efl_net_control_example.c
+++ b/src/examples/ecore/efl_net_control_example.c
@@ -1,14 +1,10 @@
-#define EFL_BETA_API_SUPPORT 1
-#define EFL_EO_API_SUPPORT 1
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
-#include <Ecore.h>
-#include <Ecore_Con.h>
+#include <Efl_Net.h>
#include <Ecore_Getopt.h>
#include <ctype.h>
-static int retval = EXIT_SUCCESS;
static Eina_Bool monitoring = EINA_TRUE;
static const char *
@@ -109,11 +105,11 @@ _access_point_print(Eo *ap)
"INFO: - remembered=%hhu\n"
"INFO: - immutable=%hhu\n"
"INFO: - security=%#x %s\n",
- efl_net_control_access_point_name_get(ap),
+ efl_net_control_access_point_ssid_get(ap),
_access_point_state_to_str(efl_net_control_access_point_state_get(ap)),
_access_point_error_to_str(efl_net_control_access_point_error_get(ap)),
efl_net_control_access_point_priority_get(ap),
- efl_net_control_technology_name_get(efl_net_control_access_point_technology_get(ap)),
+ efl_name_get(efl_net_control_access_point_technology_get(ap)),
efl_net_control_access_point_strength_get(ap),
efl_net_control_access_point_roaming_get(ap),
efl_net_control_access_point_auto_connect_get(ap),
@@ -299,8 +295,8 @@ _ctl_access_point_del(void *data EINA_UNUSED, const Efl_Event *event)
Eo *ap = event->info;
if (!monitoring) return;
printf("INFO: Access Point Removed: %s [%s]\n",
- efl_net_control_access_point_name_get(ap),
- efl_net_control_technology_name_get(efl_net_control_access_point_technology_get(ap)));
+ efl_net_control_access_point_ssid_get(ap),
+ efl_name_get(efl_net_control_access_point_technology_get(ap)));
}
static void
@@ -320,12 +316,12 @@ _access_points_list(Eina_Iterator *it)
printf("INFO: %4u | %-18.18s | %c%c%c | %-13.13s | %s\n",
efl_net_control_access_point_priority_get(ap),
- efl_net_control_access_point_name_get(ap),
+ efl_net_control_access_point_ssid_get(ap),
efl_net_control_access_point_remembered_get(ap) ? 'R' : '.',
efl_net_control_access_point_immutable_get(ap) ? 'I' : '.',
efl_net_control_access_point_auto_connect_get(ap) ? 'A' : '.',
_access_point_state_to_str(efl_net_control_access_point_state_get(ap)),
- efl_net_control_technology_name_get(efl_net_control_access_point_technology_get(ap)));
+ efl_name_get(efl_net_control_access_point_technology_get(ap)));
}
if (!first)
@@ -340,7 +336,7 @@ static void
_ctl_access_points_changed(void *data EINA_UNUSED, const Efl_Event *event)
{
if (!monitoring) return;
- _access_points_list(efl_net_control_access_points_get(event->object));
+ _access_points_list(efl_net_control_manager_access_points_get(event->object));
}
static const char *
@@ -377,7 +373,7 @@ _technology_print(Eo *tech)
"INFO: - connected=%hhu\n"
"INFO: - tethering=%hhu (id='%s', passphrase='%s')\n"
"INFO: - type=%s\n",
- efl_net_control_technology_name_get(tech),
+ efl_name_get(tech),
efl_net_control_technology_powered_get(tech),
efl_net_control_technology_connected_get(tech),
tethering, teth_id, teth_pass,
@@ -409,7 +405,7 @@ _ctl_technology_del(void *data EINA_UNUSED, const Efl_Event *event)
Eo *tech = event->info;
if (!monitoring) return;
printf("INFO: Technology Removed: %s [%s]\n",
- efl_net_control_technology_name_get(tech),
+ efl_name_get(tech),
_technology_type_str(efl_net_control_technology_type_get(tech)));
}
@@ -417,14 +413,14 @@ static void
_ctl_radios_offline_changed(void *data EINA_UNUSED, const Efl_Event *event)
{
if (!monitoring) return;
- printf("INFO: radios_offline=%hhu\n", efl_net_control_radios_offline_get(event->object));
+ printf("INFO: radios_offline=%hhu\n", efl_net_control_manager_radios_offline_get(event->object));
}
static void
_ctl_state_changed(void *data EINA_UNUSED, const Efl_Event *event)
{
const char *str = "???";
- Efl_Net_Control_State state = efl_net_control_state_get(event->object);
+ Efl_Net_Control_State state = efl_net_control_manager_state_get(event->object);
switch (state)
{
case EFL_NET_CONTROL_STATE_OFFLINE: str = "offline"; break;
@@ -448,7 +444,7 @@ _ctl_agent_error(void *data EINA_UNUSED, const Efl_Event *event)
printf("INFO: Agent Error:\n"
"INFO: - Access Point: %s\n"
"INFO: - Message: %s\n",
- efl_net_control_access_point_name_get(e->access_point),
+ efl_net_control_access_point_ssid_get(e->access_point),
e->message);
}
@@ -459,7 +455,7 @@ _ctl_agent_browser_url(void *data EINA_UNUSED, const Efl_Event *event)
printf("INFO: Agent requested to open browser:\n"
"INFO: - Access Point: %s\n"
"INFO: - URL: %s\n",
- efl_net_control_access_point_name_get(e->access_point),
+ efl_net_control_access_point_ssid_get(e->access_point),
e->url);
}
@@ -587,7 +583,7 @@ _ctl_agent_request_input(void *data EINA_UNUSED, const Efl_Event *event)
}
}
- efl_net_control_agent_reply(ctl,
+ efl_net_control_manager_agent_reply(ctl,
name,
ssid ? &ssid_slice : NULL,
username,
@@ -604,7 +600,7 @@ _ctl_agent_request_input(void *data EINA_UNUSED, const Efl_Event *event)
static void
_cmd_technologies_list(Eo *ctl, size_t argc EINA_UNUSED, char **argv EINA_UNUSED)
{
- Eina_Iterator *it = efl_net_control_technologies_get(ctl);
+ Eina_Iterator *it = efl_net_control_manager_technologies_get(ctl);
Eo *tech;
Eina_Bool first = EINA_TRUE;
@@ -618,7 +614,7 @@ _cmd_technologies_list(Eo *ctl, size_t argc EINA_UNUSED, char **argv EINA_UNUSED
}
printf("INFO: %-18.18s | %c | %c | %s\n",
- efl_net_control_technology_name_get(tech),
+ efl_name_get(tech),
efl_net_control_technology_powered_get(tech) ? 'X' : ' ',
efl_net_control_technology_connected_get(tech) ? 'X' : ' ',
_technology_type_str(efl_net_control_technology_type_get(tech)));
@@ -674,10 +670,10 @@ _technology_find(Eo *ctl, const char *name)
return NULL;
}
- it = efl_net_control_technologies_get(ctl);
+ it = efl_net_control_manager_technologies_get(ctl);
EINA_ITERATOR_FOREACH(it, child)
{
- const char *tn = efl_net_control_technology_name_get(child);
+ const char *tn = efl_name_get(child);
if (strcasecmp(name, tn) == 0)
{
eina_iterator_free(it);
@@ -710,13 +706,13 @@ _technology_scan_done(void *data, const Eina_Value v,
eina_value_error_get(&v, &err);
printf("INFO: technology '%s' could not scan: %s\n",
- efl_net_control_technology_name_get(tech),
+ efl_name_get(tech),
eina_error_msg_get(err));
}
else
{
printf("INFO: technology '%s' finished scan.\n",
- efl_net_control_technology_name_get(tech));
+ efl_name_get(tech));
}
return v;
@@ -741,7 +737,7 @@ _cmd_technology_powered(Eo *ctl, size_t argc, char **argv)
if (!tech) return;
- name = efl_net_control_technology_name_get(tech);
+ name = efl_name_get(tech);
if (argc <= 2)
{
printf("INFO: technology '%s' powered %s\n",
@@ -768,7 +764,7 @@ _cmd_technology_tethering(Eo *ctl, size_t argc, char **argv)
if (!tech) return;
- name = efl_net_control_technology_name_get(tech);
+ name = efl_name_get(tech);
if (argc <= 2)
{
efl_net_control_technology_tethering_get(tech, &enabled, &id, &pass);
@@ -793,7 +789,7 @@ _cmd_technology_tethering(Eo *ctl, size_t argc, char **argv)
static void
_cmd_access_points_list(Eo *ctl, size_t argc EINA_UNUSED, char **argv EINA_UNUSED)
{
- _access_points_list(efl_net_control_access_points_get(ctl));
+ _access_points_list(efl_net_control_manager_access_points_get(ctl));
}
static Eo *
@@ -812,12 +808,12 @@ _access_point_find(Eo *ctl, const char *name)
if (name[0] == '#')
prio = strtoul(name + 1, NULL, 10);
- it = efl_net_control_access_points_get(ctl);
+ it = efl_net_control_manager_access_points_get(ctl);
EINA_ITERATOR_FOREACH(it, child)
{
if (prio == UINT32_MAX)
{
- const char *n = efl_net_control_access_point_name_get(child);
+ const char *n = efl_net_control_access_point_ssid_get(child);
if (strcasecmp(name, n) == 0)
{
eina_iterator_free(it);
@@ -864,13 +860,13 @@ _access_point_connect(void *data, const Eina_Value v,
eina_value_error_get(&v, &err);
printf("INFO: access point '%s' could not connect: %s\n",
- efl_net_control_access_point_name_get(ap),
+ efl_net_control_access_point_ssid_get(ap),
eina_error_msg_get(err));
}
else
{
printf("INFO: access point '%s' finished connect.\n",
- efl_net_control_access_point_name_get(ap));
+ efl_net_control_access_point_ssid_get(ap));
}
return v;
@@ -937,7 +933,7 @@ _cmd_access_point_auto_connect(Eo *ctl, size_t argc EINA_UNUSED, char **argv)
if (!ap) return;
- name = efl_net_control_access_point_name_get(ap);
+ name = efl_net_control_access_point_ssid_get(ap);
if (argc <= 2)
{
printf("INFO: access_point '%s' auto connect %s\n",
@@ -1012,14 +1008,14 @@ _cmd_agent_set(Eo *ctl, size_t argc, char **argv)
if (argc == 1)
{
- printf("INFO: agent is %s\n", _fmt_bool(efl_net_control_agent_enabled_get(ctl)));
+ printf("INFO: agent is %s\n", _fmt_bool(efl_net_control_manager_agent_enabled_get(ctl)));
return;
}
if (!_parse_bool(argv[0], argv[1], &enabled))
return;
- efl_net_control_agent_enabled_set(ctl, enabled);
+ efl_net_control_manager_agent_enabled_set(ctl, enabled);
printf("INFO: agent is now %s\n", _fmt_bool(enabled));
}
@@ -1041,7 +1037,7 @@ _cmd_access_point_configure_ipv4(Eo *ctl, size_t argc, char **argv)
return;
}
- name = efl_net_control_access_point_name_get(ap);
+ name = efl_net_control_access_point_ssid_get(ap);
if (strcmp(argv[2], "off") == 0)
ipv4_method = EFL_NET_CONTROL_ACCESS_POINT_IPV4_METHOD_OFF;
@@ -1083,7 +1079,7 @@ _cmd_access_point_configure_ipv6(Eo *ctl, size_t argc, char **argv)
return;
}
- name = efl_net_control_access_point_name_get(ap);
+ name = efl_net_control_access_point_ssid_get(ap);
if (strcmp(argv[2], "off") == 0)
ipv6_method = EFL_NET_CONTROL_ACCESS_POINT_IPV6_METHOD_OFF;
@@ -1138,7 +1134,7 @@ _cmd_access_point_configure_proxy(Eo *ctl, size_t argc, char **argv)
return;
}
- name = efl_net_control_access_point_name_get(ap);
+ name = efl_net_control_access_point_ssid_get(ap);
if (strcmp(argv[2], "off") == 0)
proxy_method = EFL_NET_CONTROL_ACCESS_POINT_PROXY_METHOD_OFF;
@@ -1184,10 +1180,10 @@ _cmd_access_point_configure_proxy(Eo *ctl, size_t argc, char **argv)
}
static void
-_cmd_quit(Eo *ctl EINA_UNUSED, size_t argc EINA_UNUSED, char **argv EINA_UNUSED)
+_cmd_quit(Eo *ctl, size_t argc EINA_UNUSED, char **argv EINA_UNUSED)
{
printf("INFO: bye!\n");
- ecore_main_loop_quit();
+ efl_loop_quit(efl_loop_get(ctl), EINA_VALUE_EMPTY);
}
static void
@@ -1400,40 +1396,59 @@ _cmd_line(void *data, const Efl_Event *event)
}
EFL_CALLBACKS_ARRAY_DEFINE(ctl_events_cbs,
- { EFL_NET_CONTROL_EVENT_ACCESS_POINT_ADD, _ctl_access_point_add },
- { EFL_NET_CONTROL_EVENT_ACCESS_POINT_DEL, _ctl_access_point_del },
- { EFL_NET_CONTROL_EVENT_ACCESS_POINTS_CHANGED, _ctl_access_points_changed },
- { EFL_NET_CONTROL_EVENT_TECHNOLOGY_ADD, _ctl_technology_add },
- { EFL_NET_CONTROL_EVENT_TECHNOLOGY_DEL, _ctl_technology_del },
- { EFL_NET_CONTROL_EVENT_RADIOS_OFFLINE_CHANGED, _ctl_radios_offline_changed },
- { EFL_NET_CONTROL_EVENT_STATE_CHANGED, _ctl_state_changed },
- { EFL_NET_CONTROL_EVENT_AGENT_RELEASED, _ctl_agent_released },
- { EFL_NET_CONTROL_EVENT_AGENT_ERROR, _ctl_agent_error },
- { EFL_NET_CONTROL_EVENT_AGENT_BROWSER_URL, _ctl_agent_browser_url },
- { EFL_NET_CONTROL_EVENT_AGENT_REQUEST_INPUT, _ctl_agent_request_input });
-
-int
-main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
+ { EFL_NET_CONTROL_MANAGER_EVENT_ACCESS_POINT_ADD, _ctl_access_point_add },
+ { EFL_NET_CONTROL_MANAGER_EVENT_ACCESS_POINT_DEL, _ctl_access_point_del },
+ { EFL_NET_CONTROL_MANAGER_EVENT_ACCESS_POINTS_CHANGED, _ctl_access_points_changed },
+ { EFL_NET_CONTROL_MANAGER_EVENT_TECHNOLOGY_ADD, _ctl_technology_add },
+ { EFL_NET_CONTROL_MANAGER_EVENT_TECHNOLOGY_DEL, _ctl_technology_del },
+ { EFL_NET_CONTROL_MANAGER_EVENT_RADIOS_OFFLINE_CHANGED, _ctl_radios_offline_changed },
+ { EFL_NET_CONTROL_MANAGER_EVENT_STATE_CHANGED, _ctl_state_changed },
+ { EFL_NET_CONTROL_MANAGER_EVENT_AGENT_RELEASED, _ctl_agent_released },
+ { EFL_NET_CONTROL_MANAGER_EVENT_AGENT_ERROR, _ctl_agent_error },
+ { EFL_NET_CONTROL_MANAGER_EVENT_AGENT_BROWSER_URL, _ctl_agent_browser_url },
+ { EFL_NET_CONTROL_MANAGER_EVENT_AGENT_REQUEST_INPUT, _ctl_agent_request_input });
+
+static Eo *copier = NULL;
+
+
+EAPI_MAIN void
+efl_pause(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_resume(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_terminate(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+ efl_del(copier);
+ copier = NULL;
+}
+
+EAPI_MAIN void
+efl_main(void *data EINA_UNUSED,
+ const Efl_Event *ev)
{
Eo *ctl;
Eo *input;
- Eo *copier;
Eina_Slice line_delimiter = EINA_SLICE_STR("\n");
- ecore_init();
- ecore_con_init();
-
- ctl = efl_add(EFL_NET_CONTROL_CLASS, efl_main_loop_get(),
+ ctl = efl_add(EFL_NET_CONTROL_MANAGER_CLASS, ev->object,
efl_event_callback_array_add(efl_added, ctl_events_cbs(), NULL));
if (!ctl)
{
fputs("ERROR: Could not create Efl.Net.Control object.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
- input = efl_add(EFL_IO_STDIN_CLASS, efl_main_loop_get());
- copier = efl_add(EFL_IO_COPIER_CLASS, efl_main_loop_get(),
+ input = efl_add(EFL_IO_STDIN_CLASS, ev->object);
+ copier = efl_add(EFL_IO_COPIER_CLASS, ev->object,
efl_io_copier_source_set(efl_added, input),
efl_io_copier_line_delimiter_set(efl_added, line_delimiter),
efl_io_copier_buffer_limit_set(efl_added, 8192),
@@ -1443,15 +1458,10 @@ main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
printf("INFO: monitoring is on, disable with 'monitor off'. See 'help'.\n");
printf("INFO: type commands, if unsure try: 'help'\n");
- ecore_main_loop_begin();
-
- efl_del(copier);
- efl_del(input);
- efl_del(ctl);
+ return ;
end:
- ecore_con_shutdown();
- ecore_shutdown();
-
- return retval;
+ efl_loop_quit(efl_loop_get(ev->object), eina_value_int_init(EXIT_FAILURE));
}
+
+EFL_MAIN_EX();
diff --git a/src/examples/ecore/efl_net_dialer_http_example.c b/src/examples/ecore/efl_net_dialer_http_example.c
index 2eae870a7e..f1a97eefe9 100644
--- a/src/examples/ecore/efl_net_dialer_http_example.c
+++ b/src/examples/ecore/efl_net_dialer_http_example.c
@@ -1,12 +1,8 @@
-#define EFL_BETA_API_SUPPORT 1
-#define EFL_EO_API_SUPPORT 1
-#include <Ecore.h>
-#include <Ecore_Con.h>
+#include <Efl_Net.h>
#include <Ecore_Getopt.h>
#include <fcntl.h>
#include <ctype.h>
-static int retval = EXIT_SUCCESS;
static int waiting;
static void
@@ -43,7 +39,7 @@ _error(void *data EINA_UNUSED, const Efl_Event *event)
{
const Eina_Error *perr = event->info;
fprintf(stderr, "INFO: error: %d '%s'\n", *perr, eina_error_msg_get(*perr));
- retval = EXIT_FAILURE;
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
}
static void
@@ -87,7 +83,7 @@ _done(void *data EINA_UNUSED, const Efl_Event *event)
fprintf(stderr, "INFO: done %s, waiting=%d\n",
efl_name_get(event->object), waiting);
if (waiting == 0)
- ecore_main_loop_quit();
+ efl_loop_quit(efl_loop_get(event->object), EINA_VALUE_EMPTY);
}
EFL_CALLBACKS_ARRAY_DEFINE(copier_cbs,
@@ -199,8 +195,49 @@ static const Ecore_Getopt options = {
}
};
-int
-main(int argc, char **argv)
+static Eo *dialer = NULL;
+static Eo *sender = NULL;
+static Eo *receiver = NULL;
+
+EAPI_MAIN void
+efl_pause(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_resume(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_terminate(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+ /* FIXME: For the moment the main loop doesn't get
+ properly destroyed on shutdown which disallow
+ relying on parent destroying their children */
+ if (sender ||
+ receiver ||
+ dialer)
+ {
+ efl_io_closer_close(sender);
+ efl_del(sender);
+ sender = NULL;
+
+ efl_io_closer_close(receiver);
+ efl_del(receiver);
+ receiver = NULL;
+
+ efl_del(dialer);
+ dialer = NULL;
+ }
+}
+
+EAPI_MAIN void
+efl_main(void *data EINA_UNUSED,
+ const Efl_Event *ev)
{
char *method = "GET";
char *primary_mode_str = "auto";
@@ -246,7 +283,7 @@ main(int argc, char **argv)
ECORE_GETOPT_VALUE_NONE /* sentinel */
};
int args;
- Eo *input, *dialer, *output, *sender, *receiver, *loop;
+ Eo *input, *output, *loop;
Efl_Net_Dialer_Http_Primary_Mode primary_mode;
Efl_Net_Http_Version http_version;
Efl_Net_Http_Authentication_Method authentication_method;
@@ -255,27 +292,21 @@ main(int argc, char **argv)
Eina_Error err;
char *str;
- ecore_init();
- ecore_con_init();
- ecore_con_url_init();
-
- args = ecore_getopt_parse(&options, values, argc, argv);
+ args = ecore_getopt_parse(&options, values, 0, NULL);
if (args < 0)
{
fputs("ERROR: Could not parse command line options.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
if (quit_option) goto end;
- loop = efl_main_loop_get();
+ loop = ev->object;
- args = ecore_getopt_parse_positional(&options, values, argc, argv, args);
+ args = ecore_getopt_parse_positional(&options, values, 0, NULL, args);
if (args < 0)
{
fputs("ERROR: Could not parse positional arguments.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
@@ -371,7 +402,7 @@ main(int argc, char **argv)
{
fprintf(stderr, "ERROR: could not dial '%s': %s",
address, eina_error_msg_get(err));
- goto no_mainloop;
+ goto end;
}
fprintf(stderr,
@@ -398,25 +429,10 @@ main(int argc, char **argv)
fprintf(stderr, "INFO: %s: %s\n", header->key, header->value);
eina_iterator_free(itr);
- ecore_main_loop_begin();
-
- fprintf(stderr, "INFO: main loop finished.\n");
-
- no_mainloop:
- efl_io_closer_close(sender);
- efl_del(sender);
-
- efl_io_closer_close(receiver);
- efl_del(receiver);
-
- efl_del(dialer);
- efl_del(output);
- efl_del(input);
+ return ;
end:
- ecore_con_url_shutdown();
- ecore_con_shutdown();
- ecore_shutdown();
-
- return retval;
+ efl_loop_quit(ev->object, eina_value_int_init(EXIT_FAILURE));
}
+
+EFL_MAIN_EX();
diff --git a/src/examples/ecore/efl_net_dialer_simple_example.c b/src/examples/ecore/efl_net_dialer_simple_example.c
index 0c7ac0fead..219da892f1 100644
--- a/src/examples/ecore/efl_net_dialer_simple_example.c
+++ b/src/examples/ecore/efl_net_dialer_simple_example.c
@@ -1,12 +1,8 @@
-#define EFL_BETA_API_SUPPORT 1
-#define EFL_EO_API_SUPPORT 1
-#include <Ecore.h>
-#include <Ecore_Con.h>
+#include <Efl_Net.h>
#include <Ecore_Getopt.h>
#include <fcntl.h>
#include <ctype.h>
-static int retval = EXIT_SUCCESS;
static Eina_Bool do_read = EINA_FALSE;
static Eina_Bool do_discard = EINA_FALSE;
static Eina_Slice line_delm_slice;
@@ -75,8 +71,7 @@ _can_read(void *data EINA_UNUSED, const Efl_Event *event)
break;
}
fprintf(stderr, "ERROR: could not read: %s\n", eina_error_msg_get(err));
- retval = EXIT_FAILURE;
- ecore_main_loop_quit();
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
return;
}
@@ -153,18 +148,16 @@ _error(void *data EINA_UNUSED, const Efl_Event *event)
fprintf(stderr, "INFO: error: %d '%s'\n", *perr, eina_error_msg_get(*perr));
if (!efl_io_closer_closed_get(event->object))
efl_io_closer_close(event->object);
- retval = EXIT_FAILURE;
+
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
}
static void
-_done_sending(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
+_done_sending(void *data EINA_UNUSED, const Efl_Event *event)
{
fprintf(stderr, "INFO: done sending\n");
if (!do_read)
- {
- ecore_main_loop_quit();
- return;
- }
+ efl_loop_quit(efl_loop_get(event->object), EINA_VALUE_EMPTY);
}
static void
@@ -174,10 +167,11 @@ _done_receiving(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
}
static void
-_done(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
+_done(void *data EINA_UNUSED, const Efl_Event *event)
{
fprintf(stderr, "INFO: done sending and receiving\n");
- ecore_main_loop_quit();
+
+ efl_loop_quit(efl_loop_get(event->object), EINA_VALUE_EMPTY);
}
EFL_CALLBACKS_ARRAY_DEFINE(dialer_cbs,
@@ -272,8 +266,39 @@ static const Ecore_Getopt options = {
}
};
-int
-main(int argc, char **argv)
+static Eo *dialer = NULL;
+
+EAPI_MAIN void
+efl_pause(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_resume(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_terminate(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+ /* FIXME: For the moment the main loop doesn't get
+ properly destroyed on shutdown which disallow
+ relying on parent destroying their children */
+ if (dialer)
+ {
+ efl_del(dialer);
+ dialer = NULL;
+ }
+
+ fprintf(stderr, "INFO: main loop finished.\n");
+}
+
+EAPI_MAIN void
+efl_main(void *data EINA_UNUSED,
+ const Efl_Event *ev)
{
const Efl_Class *cls;
Eina_List *to_send = NULL;
@@ -310,36 +335,30 @@ main(int argc, char **argv)
ECORE_GETOPT_VALUE_NONE /* sentinel */
};
int args;
- Eo *dialer, *loop;
+ Eo *loop;
Eina_Error err;
- ecore_init();
- ecore_con_init();
-
- args = ecore_getopt_parse(&options, values, argc, argv);
+ args = ecore_getopt_parse(&options, values, 0, NULL);
if (args < 0)
{
fputs("ERROR: Could not parse command line options.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
if (quit_option) goto end;
- loop = efl_main_loop_get();
+ loop = ev->object;
- args = ecore_getopt_parse_positional(&options, values, argc, argv, args);
+ args = ecore_getopt_parse_positional(&options, values, 0, NULL, args);
if (args < 0)
{
fputs("ERROR: Could not parse positional arguments.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
if (!protocol)
{
fputs("ERROR: missing protocol.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
@@ -433,17 +452,15 @@ main(int argc, char **argv)
}
efl_io_buffered_stream_eos_mark(dialer); /* we're done sending */
- ecore_main_loop_begin();
-
- fprintf(stderr, "INFO: main loop finished.\n");
+ return ;
no_mainloop:
efl_del(dialer);
end:
EINA_LIST_FREE(to_send, str) free(str);
- ecore_con_shutdown();
- ecore_shutdown();
- return retval;
+ efl_loop_quit(efl_loop_get(ev->object), eina_value_int_init(EXIT_FAILURE));
}
+
+EFL_MAIN_EX();
diff --git a/src/examples/ecore/efl_net_dialer_udp_example.c b/src/examples/ecore/efl_net_dialer_udp_example.c
index 35336235aa..3b13a60ca7 100644
--- a/src/examples/ecore/efl_net_dialer_udp_example.c
+++ b/src/examples/ecore/efl_net_dialer_udp_example.c
@@ -1,12 +1,8 @@
-#define EFL_BETA_API_SUPPORT 1
-#define EFL_EO_API_SUPPORT 1
-#include <Ecore.h>
-#include <Ecore_Con.h>
+#include <Efl_Net.h>
#include <Ecore_Getopt.h>
#include <fcntl.h>
#include <ctype.h>
-static int retval = EXIT_SUCCESS;
static int needed_reads = 0;
static void
@@ -69,8 +65,7 @@ _can_read(void *data EINA_UNUSED, const Efl_Event *event)
if (err == EAGAIN) /* EAGAIN for spurious packets */
return;
fprintf(stderr, "ERROR: could not read: %s\n", eina_error_msg_get(err));
- retval = EXIT_FAILURE;
- ecore_main_loop_quit();
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
return;
}
@@ -78,10 +73,7 @@ _can_read(void *data EINA_UNUSED, const Efl_Event *event)
needed_reads--;
if (!needed_reads)
- {
- retval = EXIT_SUCCESS;
- ecore_main_loop_quit();
- }
+ efl_loop_quit(efl_loop_get(event->object), EINA_VALUE_EMPTY);
free(rw_slice.mem);
}
@@ -108,8 +100,7 @@ _can_write(void *data EINA_UNUSED, const Efl_Event *event)
if (err)
{
fprintf(stderr, "ERROR: could not write: %s\n", eina_error_msg_get(err));
- retval = EXIT_FAILURE;
- ecore_main_loop_quit();
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
return;
}
@@ -122,8 +113,7 @@ _can_write(void *data EINA_UNUSED, const Efl_Event *event)
if (err)
{
fprintf(stderr, "ERROR: could not write: %s\n", eina_error_msg_get(err));
- retval = EXIT_FAILURE;
- ecore_main_loop_quit();
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
return;
}
@@ -139,8 +129,7 @@ _can_write(void *data EINA_UNUSED, const Efl_Event *event)
else
{
fprintf(stderr, "INFO: we're done\n");
- retval = EXIT_SUCCESS;
- ecore_main_loop_quit();
+ efl_loop_quit(efl_loop_get(event->object), EINA_VALUE_EMPTY);
}
return;
}
@@ -161,7 +150,8 @@ _error(void *data EINA_UNUSED, const Efl_Event *event)
{
const Eina_Error *perr = event->info;
fprintf(stderr, "INFO: error: %d '%s'\n", *perr, eina_error_msg_get(*perr));
- retval = EXIT_FAILURE;
+
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
}
EFL_CALLBACKS_ARRAY_DEFINE(dialer_cbs,
@@ -202,8 +192,39 @@ static const Ecore_Getopt options = {
}
};
-int
-main(int argc, char **argv)
+static Eo *dialer = NULL;
+
+EAPI_MAIN void
+efl_pause(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_resume(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_terminate(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+ /* FIXME: For the moment the main loop doesn't get
+ properly destroyed on shutdown which disallow
+ relying on parent destroying their children */
+ if (dialer)
+ {
+ efl_del(dialer);
+ dialer = NULL;
+ }
+
+ fprintf(stderr, "INFO: main loop finished.\n");
+}
+
+EAPI_MAIN void
+efl_main(void *data EINA_UNUSED,
+ const Efl_Event *ev)
{
char *address = NULL;
char *bind_address = NULL;
@@ -238,29 +259,24 @@ main(int argc, char **argv)
ECORE_GETOPT_VALUE_NONE /* sentinel */
};
int args;
- Eo *dialer, *loop;
+ Eo *loop;
Eina_Error err;
- ecore_init();
- ecore_con_init();
-
- args = ecore_getopt_parse(&options, values, argc, argv);
+ args = ecore_getopt_parse(&options, values, 0, NULL);
if (args < 0)
{
fputs("ERROR: Could not parse command line options.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
if (quit_option) goto end;
- loop = efl_main_loop_get();
+ loop = ev->object;
- args = ecore_getopt_parse_positional(&options, values, argc, argv, args);
+ args = ecore_getopt_parse_positional(&options, values, 0, NULL, args);
if (args < 0)
{
fputs("ERROR: Could not parse positional arguments.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
@@ -289,9 +305,7 @@ main(int argc, char **argv)
if (do_read) needed_reads = cork ? 1 : 2;
- ecore_main_loop_begin();
-
- fprintf(stderr, "INFO: main loop finished.\n");
+ return ;
no_mainloop:
efl_del(dialer);
@@ -299,8 +313,8 @@ main(int argc, char **argv)
end:
EINA_LIST_FREE(mcast_groups, str)
free(str);
- ecore_con_shutdown();
- ecore_shutdown();
- return retval;
+ efl_loop_quit(efl_loop_get(ev->object), eina_value_int_init(EXIT_FAILURE));
}
+
+EFL_MAIN_EX();
diff --git a/src/examples/ecore/efl_net_dialer_unix_example.c b/src/examples/ecore/efl_net_dialer_unix_example.c
index e2a9358ca4..b610dd42a6 100644
--- a/src/examples/ecore/efl_net_dialer_unix_example.c
+++ b/src/examples/ecore/efl_net_dialer_unix_example.c
@@ -1,12 +1,8 @@
-#define EFL_BETA_API_SUPPORT 1
-#define EFL_EO_API_SUPPORT 1
-#include <Ecore.h>
-#include <Ecore_Con.h>
+#include <Efl_Net.h>
#include <Ecore_Getopt.h>
#include <fcntl.h>
#include <ctype.h>
-static int retval = EXIT_SUCCESS;
static Eina_Bool do_read = EINA_FALSE;
static void
@@ -23,10 +19,10 @@ _connected(void *data EINA_UNUSED, const Efl_Event *event)
}
static void
-_eos(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
+_eos(void *data EINA_UNUSED, const Efl_Event *event)
{
fprintf(stderr, "INFO: end of stream. \n");
- ecore_main_loop_quit();
+ efl_loop_quit(efl_loop_get(event->object), EINA_VALUE_EMPTY);
}
static void
@@ -53,8 +49,7 @@ _can_read(void *data EINA_UNUSED, const Efl_Event *event)
{
if (err == EAGAIN) return;
fprintf(stderr, "ERROR: could not read: %s\n", eina_error_msg_get(err));
- retval = EXIT_FAILURE;
- ecore_main_loop_quit();
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
return;
}
@@ -84,19 +79,14 @@ _can_write(void *data EINA_UNUSED, const Efl_Event *event)
if (err)
{
fprintf(stderr, "ERROR: could not write: %s\n", eina_error_msg_get(err));
- retval = EXIT_FAILURE;
- ecore_main_loop_quit();
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
return;
}
fprintf(stderr, "INFO: wrote '" EINA_SLICE_STR_FMT "', still pending=%zd bytes\n", EINA_SLICE_STR_PRINT(to_write), slice.len);
if ((!do_read) && (slice.len == 0))
- {
- retval = EXIT_SUCCESS;
- ecore_main_loop_quit();
- return;
- }
+ efl_loop_quit(efl_loop_get(event->object), EINA_VALUE_EMPTY);
}
static void
@@ -112,7 +102,8 @@ _error(void *data EINA_UNUSED, const Efl_Event *event)
{
const Eina_Error *perr = event->info;
fprintf(stderr, "INFO: error: %d '%s'\n", *perr, eina_error_msg_get(*perr));
- retval = EXIT_FAILURE;
+
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
}
EFL_CALLBACKS_ARRAY_DEFINE(dialer_cbs,
@@ -145,8 +136,39 @@ static const Ecore_Getopt options = {
}
};
-int
-main(int argc, char **argv)
+static Eo *dialer = NULL;
+
+EAPI_MAIN void
+efl_pause(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_resume(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_terminate(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+ /* FIXME: For the moment the main loop doesn't get
+ properly destroyed on shutdown which disallow
+ relying on parent destroying their children */
+ if (dialer)
+ {
+ efl_del(dialer);
+ dialer = NULL;
+ }
+
+ fprintf(stderr, "INFO: main loop finished.\n");
+}
+
+EAPI_MAIN void
+efl_main(void *data EINA_UNUSED,
+ const Efl_Event *ev)
{
char *address = NULL;
Eina_Bool quit_option = EINA_FALSE;
@@ -165,29 +187,24 @@ main(int argc, char **argv)
ECORE_GETOPT_VALUE_NONE /* sentinel */
};
int args;
- Eo *dialer, *loop;
+ Eo *loop;
Eina_Error err;
- ecore_init();
- ecore_con_init();
-
- args = ecore_getopt_parse(&options, values, argc, argv);
+ args = ecore_getopt_parse(&options, values, 0, NULL);
if (args < 0)
{
fputs("ERROR: Could not parse command line options.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
if (quit_option) goto end;
- loop = efl_main_loop_get();
+ loop = ev->object;
- args = ecore_getopt_parse_positional(&options, values, argc, argv, args);
+ args = ecore_getopt_parse_positional(&options, values, 0, NULL, args);
if (args < 0)
{
fputs("ERROR: Could not parse positional arguments.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
@@ -203,16 +220,13 @@ main(int argc, char **argv)
goto no_mainloop;
}
- ecore_main_loop_begin();
-
- fprintf(stderr, "INFO: main loop finished.\n");
+ return ;
no_mainloop:
efl_del(dialer);
end:
- ecore_con_shutdown();
- ecore_shutdown();
-
- return retval;
+ efl_loop_quit(efl_loop_get(ev->object), eina_value_int_init(EXIT_FAILURE));
}
+
+EFL_MAIN_EX();
diff --git a/src/examples/ecore/efl_net_dialer_websocket_autobahntestee.c b/src/examples/ecore/efl_net_dialer_websocket_autobahntestee.c
index fa3dc0f6f4..fd0c09818c 100644
--- a/src/examples/ecore/efl_net_dialer_websocket_autobahntestee.c
+++ b/src/examples/ecore/efl_net_dialer_websocket_autobahntestee.c
@@ -1,12 +1,8 @@
-#define EFL_BETA_API_SUPPORT 1
-#define EFL_EO_API_SUPPORT 1
-#include <Ecore.h>
-#include <Ecore_Con.h>
+#include <Efl_Net.h>
#include <Ecore_Getopt.h>
#include <fcntl.h>
#include <ctype.h>
-static int retval = EXIT_SUCCESS;
static char *address = NULL;
static char *agent = "efl_net_dialer_websocket";
static unsigned int start_index = 0;
@@ -234,7 +230,7 @@ _error(void *data EINA_UNUSED, const Efl_Event *event)
const Eina_Error *perr = event->info;
fprintf(stderr, "ERROR: %s error: %d '%s'\n",
efl_name_get(dialer), *perr, eina_error_msg_get(*perr));
- retval = EXIT_FAILURE;
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
}
static void
@@ -257,16 +253,16 @@ EFL_CALLBACKS_ARRAY_DEFINE(dialer_cbs,
{ EFL_EVENT_DEL, _del });
static Eo *
-_websocket_new(const char *name)
+_websocket_new(const char *name, Eo *loop)
{
Eo *dialer;
- dialer = efl_add(EFL_NET_DIALER_WEBSOCKET_CLASS, efl_main_loop_get(),
+ dialer = efl_add(EFL_NET_DIALER_WEBSOCKET_CLASS, loop,
efl_name_set(efl_added, name),
efl_event_callback_array_add(efl_added, dialer_cbs(), NULL));
if (!dialer)
{
- retval = EXIT_FAILURE;
+ efl_loop_quit(loop, eina_value_int_init(EXIT_FAILURE));
fprintf(stderr, "ERROR: could not create WebSockets dialer '%s'\n", name);
return NULL;
}
@@ -285,7 +281,7 @@ _closed_quit(void *data EINA_UNUSED, const Efl_Event *event)
}
static void
-_tests_finished(void)
+_tests_finished(Eo *loop)
{
Eo *dialer;
char url[4096];
@@ -320,7 +316,7 @@ _tests_finished(void)
return;
}
- dialer = _websocket_new("update-reports");
+ dialer = _websocket_new("update-reports", loop);
if (!dialer)
{
ecore_main_loop_quit();
@@ -332,11 +328,10 @@ _tests_finished(void)
err = efl_net_dialer_dial(dialer, url);
if (err != 0)
{
- retval = EXIT_FAILURE;
fprintf(stderr, "ERROR: could not dial '%s': %s",
url, eina_error_msg_get(err));
efl_del(dialer);
- ecore_main_loop_quit();
+ efl_loop_quit(loop, eina_value_int_init(EXIT_FAILURE));
return;
}
@@ -369,7 +364,7 @@ _echo_binary(void *data EINA_UNUSED, const Efl_Event *event)
efl_net_dialer_websocket_binary_send(dialer, *slice);
}
-static Eina_Bool _websocket_test_next_case_tuple(void);
+static Eina_Bool _websocket_test_next_case_tuple(Eo *loop);
static void
_test_next_case_closed(void *data EINA_UNUSED, const Efl_Event *event)
@@ -377,8 +372,8 @@ _test_next_case_closed(void *data EINA_UNUSED, const Efl_Event *event)
Eo *dialer = event->object;
efl_del(dialer);
- if (!_websocket_test_next_case_tuple())
- _tests_finished();
+ if (!_websocket_test_next_case_tuple(efl_loop_get(event->object)))
+ _tests_finished(efl_loop_get(event->object));
}
EFL_CALLBACKS_ARRAY_DEFINE(_test_next_case_tuple_cbs,
@@ -387,7 +382,7 @@ EFL_CALLBACKS_ARRAY_DEFINE(_test_next_case_tuple_cbs,
{ EFL_IO_CLOSER_EVENT_CLOSED, _test_next_case_closed });
static Eina_Bool
-_websocket_test_next_case_tuple(void)
+_websocket_test_next_case_tuple(Eo *loop)
{
Eo *dialer;
char url[4096];
@@ -423,7 +418,7 @@ _websocket_test_next_case_tuple(void)
snprintf(name, sizeof(name), "test_case=%s", str);
free(str);
- dialer = _websocket_new(name);
+ dialer = _websocket_new(name, loop);
if (!dialer) return EINA_FALSE;
efl_event_callback_array_add(dialer, _test_next_case_tuple_cbs(), NULL);
@@ -431,10 +426,10 @@ _websocket_test_next_case_tuple(void)
err = efl_net_dialer_dial(dialer, url);
if (err != 0)
{
- retval = EXIT_FAILURE;
fprintf(stderr, "ERROR: could not dial '%s': %s",
url, eina_error_msg_get(err));
efl_del(dialer);
+ efl_loop_quit(loop, eina_value_int_init(EXIT_FAILURE));
return EINA_FALSE;
}
@@ -443,7 +438,7 @@ _websocket_test_next_case_tuple(void)
return EINA_TRUE;
}
-static Eina_Bool _websocket_test_index(unsigned int idx);
+static Eina_Bool _websocket_test_index(unsigned int idx, Eo *loop);
static void
_test_index_closed(void *data EINA_UNUSED, const Efl_Event *event)
@@ -451,8 +446,8 @@ _test_index_closed(void *data EINA_UNUSED, const Efl_Event *event)
Eo *dialer = event->object;
efl_del(dialer);
- if (!_websocket_test_index(current_index + 1))
- _tests_finished();
+ if (!_websocket_test_index(current_index + 1, efl_loop_get(event->object)))
+ _tests_finished(efl_loop_get(event->object));
}
EFL_CALLBACKS_ARRAY_DEFINE(_test_index_cbs,
@@ -461,7 +456,7 @@ EFL_CALLBACKS_ARRAY_DEFINE(_test_index_cbs,
{ EFL_IO_CLOSER_EVENT_CLOSED, _test_index_closed });
static Eina_Bool
-_websocket_test_index(unsigned int idx)
+_websocket_test_index(unsigned int idx, Eo *loop)
{
Eo *dialer;
char url[4096];
@@ -491,7 +486,7 @@ _websocket_test_index(unsigned int idx)
snprintf(name, sizeof(name), "test_case=%u", idx);
- dialer = _websocket_new(name);
+ dialer = _websocket_new(name, loop);
if (!dialer) return EINA_FALSE;
efl_event_callback_array_add(dialer, _test_index_cbs(), NULL);
@@ -499,10 +494,10 @@ _websocket_test_index(unsigned int idx)
err = efl_net_dialer_dial(dialer, url);
if (err != 0)
{
- retval = EXIT_FAILURE;
fprintf(stderr, "ERROR: could not dial '%s': %s",
url, eina_error_msg_get(err));
efl_del(dialer);
+ efl_loop_quit(loop, eina_value_int_init(EXIT_FAILURE));
return EINA_FALSE;
}
@@ -538,8 +533,8 @@ _load_tests_closed(void *data EINA_UNUSED, const Efl_Event *event)
Eo *dialer = event->object;
efl_del(dialer);
- if (!_websocket_test_index(start_index))
- _tests_finished();
+ if (!_websocket_test_index(start_index, efl_loop_get(event->object)))
+ _tests_finished(efl_loop_get(event->object));
}
EFL_CALLBACKS_ARRAY_DEFINE(_load_tests_cbs,
@@ -547,7 +542,7 @@ EFL_CALLBACKS_ARRAY_DEFINE(_load_tests_cbs,
{ EFL_IO_CLOSER_EVENT_CLOSED, _load_tests_closed });
static Eina_Bool
-_websocket_load_tests(void)
+_websocket_load_tests(Eo *loop)
{
Eo *dialer;
char url[4096];
@@ -568,7 +563,7 @@ _websocket_load_tests(void)
return EINA_FALSE;
}
- dialer = _websocket_new("get-case-count");
+ dialer = _websocket_new("get-case-count", loop);
if (!dialer) return EINA_FALSE;
efl_event_callback_array_add(dialer, _load_tests_cbs(), NULL);
@@ -576,10 +571,10 @@ _websocket_load_tests(void)
err = efl_net_dialer_dial(dialer, url);
if (err != 0)
{
- retval = EXIT_FAILURE;
fprintf(stderr, "ERROR: could not dial '%s': %s",
url, eina_error_msg_get(err));
efl_del(dialer);
+ efl_loop_quit(loop, eina_value_int_init(EXIT_FAILURE));
return EINA_FALSE;
}
@@ -620,8 +615,36 @@ static const Ecore_Getopt options = {
}
};
-int
-main(int argc, char **argv)
+EAPI_MAIN void
+efl_pause(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_resume(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_terminate(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+ /* FIXME: For the moment the main loop doesn't get
+ properly destroyed on shutdown which disallow
+ relying on parent destroying their children */
+ if (pending)
+ {
+ efl_del(pending);
+ pending = NULL;
+ }
+ if (verbose) fprintf(stderr, "INFO: main loop finished.\n");
+}
+
+EAPI_MAIN void
+efl_main(void *data EINA_UNUSED,
+ const Efl_Event *ev)
{
Eina_Bool quit_option = EINA_FALSE;
Ecore_Getopt_Value values[] = {
@@ -646,48 +669,41 @@ main(int argc, char **argv)
int args;
Eina_Bool r;
- ecore_init();
- ecore_con_init();
- ecore_con_url_init();
-
- args = ecore_getopt_parse(&options, values, argc, argv);
+ args = ecore_getopt_parse(&options, values, 0, NULL);
if (args < 0)
{
fputs("ERROR: Could not parse command line options.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
if (quit_option) goto end;
- args = ecore_getopt_parse_positional(&options, values, argc, argv, args);
+ args = ecore_getopt_parse_positional(&options, values, 0, NULL, args);
if (args < 0)
{
fputs("ERROR: Could not parse positional arguments.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
if (case_tuples)
- r = _websocket_test_next_case_tuple();
+ r = _websocket_test_next_case_tuple(ev->object);
else if (start_index == end_index)
- r = _websocket_test_index(start_index);
+ r = _websocket_test_index(start_index, ev->object);
else
- r = _websocket_load_tests();
+ r = _websocket_load_tests(ev->object);
if (r)
{
ecore_main_loop_begin();
- if (verbose) fprintf(stderr, "INFO: main loop finished. retval=%d\n", retval);
}
if (pending)
efl_del(pending);
- end:
- ecore_con_url_shutdown();
- ecore_con_shutdown();
- ecore_shutdown();
+ return ;
- return retval;
+ end:
+ efl_loop_quit(efl_loop_get(ev->object), eina_value_int_init(EXIT_FAILURE));
}
+
+EFL_MAIN_EX();
diff --git a/src/examples/ecore/efl_net_dialer_websocket_example.c b/src/examples/ecore/efl_net_dialer_websocket_example.c
index d051c3941e..e0b72e4991 100644
--- a/src/examples/ecore/efl_net_dialer_websocket_example.c
+++ b/src/examples/ecore/efl_net_dialer_websocket_example.c
@@ -1,13 +1,8 @@
-#define EFL_BETA_API_SUPPORT 1
-#define EFL_EO_API_SUPPORT 1
-#include <Ecore.h>
-#include <Ecore_Con.h>
+#include <Efl_Net.h>
#include <Ecore_Getopt.h>
#include <fcntl.h>
#include <ctype.h>
-static int retval = EXIT_SUCCESS;
-
static int lines_text = 0;
static int lines_binary = 0;
@@ -102,7 +97,7 @@ _closed(void *data EINA_UNUSED, const Efl_Event *event)
{
fprintf(stderr, "INFO: closed %s\n",
efl_name_get(event->object));
- ecore_main_loop_quit();
+ efl_loop_quit(efl_loop_get(event->object), EINA_VALUE_EMPTY);
}
static void
@@ -141,8 +136,7 @@ _error(void *data EINA_UNUSED, const Efl_Event *event)
{
const Eina_Error *perr = event->info;
fprintf(stderr, "INFO: error: %d '%s'\n", *perr, eina_error_msg_get(*perr));
- retval = EXIT_FAILURE;
- ecore_main_loop_quit();
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
}
EFL_CALLBACKS_ARRAY_DEFINE(dialer_cbs,
@@ -226,8 +220,39 @@ static const Ecore_Getopt options = {
}
};
-int
-main(int argc, char **argv)
+static Eo *dialer = NULL;
+
+EAPI_MAIN void
+efl_pause(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_resume(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_terminate(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+ /* FIXME: For the moment the main loop doesn't get
+ properly destroyed on shutdown which disallow
+ relying on parent destroying their children */
+ if (dialer)
+ {
+ efl_del(dialer);
+ dialer = NULL;
+ }
+
+ fprintf(stderr, "INFO: main loop finished.\n");
+}
+
+EAPI_MAIN void
+efl_main(void *data EINA_UNUSED,
+ const Efl_Event *ev)
{
char *address = NULL;
char *username = NULL;
@@ -265,34 +290,28 @@ main(int argc, char **argv)
ECORE_GETOPT_VALUE_NONE /* sentinel */
};
int args;
- Eo *dialer, *loop;
+ Eo *loop;
Efl_Net_Http_Authentication_Method authentication_method;
Efl_Net_Http_Header *header;
Eina_Iterator *itr;
Eina_Error err;
char *str;
- ecore_init();
- ecore_con_init();
- ecore_con_url_init();
-
- args = ecore_getopt_parse(&options, values, argc, argv);
+ args = ecore_getopt_parse(&options, values, 0, NULL);
if (args < 0)
{
fputs("ERROR: Could not parse command line options.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
if (quit_option) goto end;
- loop = efl_main_loop_get();
+ loop = ev->object;
- args = ecore_getopt_parse_positional(&options, values, argc, argv, args);
+ args = ecore_getopt_parse_positional(&options, values, 0, NULL, args);
if (args < 0)
{
fputs("ERROR: Could not parse positional arguments.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
@@ -311,7 +330,6 @@ main(int argc, char **argv)
efl_event_callback_array_add(efl_added, dialer_cbs(), NULL));
if (!dialer)
{
- retval = EXIT_FAILURE;
fprintf(stderr, "ERROR: could not create WebSockets dialer\n");
goto end;
}
@@ -339,7 +357,6 @@ main(int argc, char **argv)
err = efl_net_dialer_dial(dialer, address);
if (err != 0)
{
- retval = EXIT_FAILURE;
fprintf(stderr, "ERROR: could not dial '%s': %s",
address, eina_error_msg_get(err));
goto no_mainloop;
@@ -368,17 +385,13 @@ main(int argc, char **argv)
fprintf(stderr, "INFO: %s\n", str);
eina_iterator_free(itr);
- ecore_main_loop_begin();
-
- fprintf(stderr, "INFO: main loop finished.\n");
+ return ;
no_mainloop:
efl_del(dialer);
end:
- ecore_con_url_shutdown();
- ecore_con_shutdown();
- ecore_shutdown();
-
- return retval;
+ efl_loop_quit(efl_loop_get(ev->object), eina_value_int_init(EXIT_FAILURE));
}
+
+EFL_MAIN_EX();
diff --git a/src/examples/ecore/efl_net_dialer_windows_example.c b/src/examples/ecore/efl_net_dialer_windows_example.c
index 87919227ca..44daab0bfa 100644
--- a/src/examples/ecore/efl_net_dialer_windows_example.c
+++ b/src/examples/ecore/efl_net_dialer_windows_example.c
@@ -1,12 +1,8 @@
-#define EFL_BETA_API_SUPPORT 1
-#define EFL_EO_API_SUPPORT 1
-#include <Ecore.h>
-#include <Ecore_Con.h>
+#include <Efl_Net.h>
#include <Ecore_Getopt.h>
#include <fcntl.h>
#include <ctype.h>
-static int retval = EXIT_SUCCESS;
static Eina_Bool do_read = EINA_FALSE;
static void
@@ -23,10 +19,10 @@ _connected(void *data EINA_UNUSED, const Efl_Event *event)
}
static void
-_eos(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
+_eos(void *data EINA_UNUSED, const Efl_Event *event)
{
fprintf(stderr, "INFO: end of stream. \n");
- ecore_main_loop_quit();
+ efl_loop_quit(efl_loop_get(event->object), EINA_VALUE_EMPTY);
}
static void
@@ -53,8 +49,7 @@ _can_read(void *data EINA_UNUSED, const Efl_Event *event)
{
if (err == EAGAIN) return;
fprintf(stderr, "ERROR: could not read: %s\n", eina_error_msg_get(err));
- retval = EXIT_FAILURE;
- ecore_main_loop_quit();
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
return;
}
@@ -84,19 +79,14 @@ _can_write(void *data EINA_UNUSED, const Efl_Event *event)
if (err)
{
fprintf(stderr, "ERROR: could not write: %s\n", eina_error_msg_get(err));
- retval = EXIT_FAILURE;
- ecore_main_loop_quit();
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
return;
}
fprintf(stderr, "INFO: wrote '" EINA_SLICE_STR_FMT "', still pending=%zd bytes\n", EINA_SLICE_STR_PRINT(to_write), slice.len);
if ((!do_read) && (slice.len == 0))
- {
- retval = EXIT_SUCCESS;
- ecore_main_loop_quit();
- return;
- }
+ efl_loop_quit(efl_loop_get(event->object), EINA_VALUE_EMPTY);
}
static void
@@ -112,7 +102,7 @@ _error(void *data EINA_UNUSED, const Efl_Event *event)
{
const Eina_Error *perr = event->info;
fprintf(stderr, "INFO: error: %d '%s'\n", *perr, eina_error_msg_get(*perr));
- retval = EXIT_FAILURE;
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
}
EFL_CALLBACKS_ARRAY_DEFINE(dialer_cbs,
@@ -145,8 +135,39 @@ static const Ecore_Getopt options = {
}
};
-int
-main(int argc, char **argv)
+static Eo *dialer = NULL;
+
+EAPI_MAIN void
+efl_pause(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_resume(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_terminate(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+ /* FIXME: For the moment the main loop doesn't get
+ properly destroyed on shutdown which disallow
+ relying on parent destroying their children */
+ if (dialer)
+ {
+ efl_del(dialer);
+ dialer = NULL;
+ }
+
+ fprintf(stderr, "INFO: main loop finished.\n");
+}
+
+EAPI_MAIN void
+efl_main(void *data EINA_UNUSED,
+ const Efl_Event *ev)
{
char *address = NULL;
Eina_Bool quit_option = EINA_FALSE;
@@ -165,29 +186,24 @@ main(int argc, char **argv)
ECORE_GETOPT_VALUE_NONE /* sentinel */
};
int args;
- Eo *dialer, *loop;
+ Eo *loop;
Eina_Error err;
- ecore_init();
- ecore_con_init();
-
- args = ecore_getopt_parse(&options, values, argc, argv);
+ args = ecore_getopt_parse(&options, values, 0, NULL);
if (args < 0)
{
fputs("ERROR: Could not parse command line options.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
if (quit_option) goto end;
- loop = efl_main_loop_get();
+ loop = ev->object;
- args = ecore_getopt_parse_positional(&options, values, argc, argv, args);
+ args = ecore_getopt_parse_positional(&options, values, 0, NULL, args);
if (args < 0)
{
fputs("ERROR: Could not parse positional arguments.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
@@ -203,9 +219,7 @@ main(int argc, char **argv)
goto no_mainloop;
}
- ecore_main_loop_begin();
-
- fprintf(stderr, "INFO: main loop finished.\n");
+ return ;
no_mainloop:
efl_del(dialer);
@@ -214,5 +228,7 @@ main(int argc, char **argv)
ecore_con_shutdown();
ecore_shutdown();
- return retval;
+ efl_loop_quit(ev->object, eina_value_int_init(EXIT_FAILURE));
}
+
+EFL_MAIN_EX();
diff --git a/src/examples/ecore/efl_net_ip_address_example.c b/src/examples/ecore/efl_net_ip_address_example.c
index 2392b23c6e..ee1595b6c3 100644
--- a/src/examples/ecore/efl_net_ip_address_example.c
+++ b/src/examples/ecore/efl_net_ip_address_example.c
@@ -12,6 +12,9 @@
#ifdef HAVE_ARPA_INET_H
# include <arpa/inet.h>
#endif
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
static int retval = EXIT_SUCCESS;
static Eina_List *resolving = NULL;
@@ -65,40 +68,48 @@ _print_ip_addr_info(const Eo *o)
printf("INFO: - any: %d\n", efl_net_ip_address_any_check(o));
}
-static void
-_resolved(void *data EINA_UNUSED, const Efl_Event *event)
+static Eina_Value
+_resolved(void *data, const Eina_Value v,
+ const Eina_Future *dead_future)
{
- Efl_Future *future = event->object;
- Efl_Future_Event_Success *f = event->info;
- Efl_Net_Ip_Address_Resolve_Results *r = f->value;
- Eina_Array_Iterator it;
- unsigned int i;
- const Efl_Net_Ip_Address *o;
+ const char *address = data;
+ const char *canonical_name = NULL;
+ const char *request_address = NULL;
+ const Eina_Value_Array desc = { 0 };
+ const Efl_Net_Ip_Address **o = NULL;
+
+ if (eina_value_type_get(&v) == EINA_VALUE_TYPE_ERROR)
+ {
+ Eina_Error err = 0;
+
+ eina_value_error_get(&v, &err);
+
+ fprintf(stderr, "ERROR: Failed to resolve '%s': %s\n",
+ address, eina_error_msg_get(err));
+ retval = EXIT_FAILURE;
+ goto end;
+ }
+
+ eina_value_struct_get(&v, "canonical_name", canonical_name);
+ eina_value_struct_get(&v, "request_address", request_address);
+ eina_value_struct_get(&v, "results", &desc);
printf("INFO: resolved '%s' to canonical name '%s':\n",
- r->request_address, r->canonical_name);
+ request_address, canonical_name);
- EINA_ARRAY_ITER_NEXT(r->results, i, o, it)
- _print_ip_addr_info(o);
+ EINA_INARRAY_FOREACH(desc.array, o)
+ if (o) _print_ip_addr_info(*o);
putchar('\n');
- resolving = eina_list_remove(resolving, future);
- if (!resolving) ecore_main_loop_quit();
-}
-
-static void
-_resolve_failed(void *data, const Efl_Event *event)
-{
- const char *address = data;
- Efl_Future *future = event->object;
- Efl_Future_Event_Failure *f = event->info;
- fprintf(stderr, "ERROR: Failed to resolve '%s': %s\n",
- address, eina_error_msg_get(f->error));
- retval = EXIT_FAILURE;
+ eina_stringshare_del(canonical_name);
+ eina_stringshare_del(request_address);
- resolving = eina_list_remove(resolving, future);
+ end:
+ resolving = eina_list_remove(resolving, dead_future);
if (!resolving) ecore_main_loop_quit();
+
+ return v;
}
int
@@ -120,18 +131,10 @@ main(int argc, char *argv[])
}
else
{
- Efl_Future *f = efl_net_ip_address_resolve(EFL_NET_IP_ADDRESS_CLASS, address, 0, 0);
- if (!f)
- {
- fprintf(stderr, "ERROR: cannot resolve '%s'!\n", address);
- retval = EXIT_FAILURE;
- }
- else
- {
- printf("INFO: %s is not numeric, resolving...\n", address);
- efl_future_then(f, _resolved, _resolve_failed, NULL, address);
- resolving = eina_list_append(resolving, f);
- }
+ Eina_Future *f = efl_net_ip_address_resolve(EFL_NET_IP_ADDRESS_CLASS, address, 0, 0);
+ eina_future_then(f, _resolved, address);
+ printf("INFO: %s is not numeric, resolving...\n", address);
+ resolving = eina_list_append(resolving, f);
}
}
diff --git a/src/examples/ecore/efl_net_server_example.c b/src/examples/ecore/efl_net_server_example.c
index 570123eb46..d98e66bb35 100644
--- a/src/examples/ecore/efl_net_server_example.c
+++ b/src/examples/ecore/efl_net_server_example.c
@@ -1,11 +1,7 @@
-#define EFL_BETA_API_SUPPORT 1
-#define EFL_EO_API_SUPPORT 1
-#include <Ecore.h>
-#include <Ecore_Con.h>
+#include <Efl_Net.h>
#include <Ecore_Getopt.h>
#include <fcntl.h>
-static int retval = EXIT_SUCCESS;
static Eina_Bool echo = EINA_FALSE;
static double timeout = 10.0;
@@ -77,7 +73,7 @@ _echo_copier_error(void *data EINA_UNUSED, const Efl_Event *event)
return;
}
- retval = EXIT_FAILURE;
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
fprintf(stderr, "ERROR: echo copier %p failed %d '%s', close and del.\n",
copier, *perr, eina_error_msg_get(*perr));
@@ -182,7 +178,7 @@ _send_copier_error(void *data, const Efl_Event *event)
return;
}
- retval = EXIT_FAILURE;
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
offset = efl_io_buffer_position_read_get(buffer);
slice = efl_io_buffer_slice_get(buffer);
@@ -263,7 +259,7 @@ _recv_copier_error(void *data, const Efl_Event *event)
return;
}
- retval = EXIT_FAILURE;
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
slice = efl_io_buffer_slice_get(buffer);
fprintf(stderr,
@@ -325,7 +321,7 @@ _server_client_add(void *data EINA_UNUSED, const Efl_Event *event)
efl_io_copier_destination_set(efl_added, client),
efl_io_copier_timeout_inactivity_set(efl_added, timeout),
efl_event_callback_array_add(efl_added, echo_copier_cbs(), client),
- efl_io_closer_close_on_destructor_set(efl_added, EINA_TRUE) /* we want to auto-close as we have a single copier */
+ efl_io_closer_close_on_invalidate_set(efl_added, EINA_TRUE) /* we want to auto-close as we have a single copier */
);
fprintf(stderr, "INFO: using an echo copier=%p for client %s\n",
@@ -354,11 +350,11 @@ _server_client_add(void *data EINA_UNUSED, const Efl_Event *event)
return;
}
- send_buffer = efl_add(EFL_IO_BUFFER_CLASS, NULL,
+ send_buffer = efl_add_ref(EFL_IO_BUFFER_CLASS, NULL,
efl_io_buffer_adopt_readonly(efl_added, hello_world_slice));
/* Unlimited buffer to store the received data. */
- recv_buffer = efl_add(EFL_IO_BUFFER_CLASS, NULL);
+ recv_buffer = efl_add_ref(EFL_IO_BUFFER_CLASS, NULL);
/* an input copier that takes data from send_buffer and pushes to client */
d->send_copier = efl_add(EFL_IO_COPIER_CLASS, efl_parent_get(client),
@@ -366,7 +362,7 @@ _server_client_add(void *data EINA_UNUSED, const Efl_Event *event)
efl_io_copier_destination_set(efl_added, client),
efl_io_copier_timeout_inactivity_set(efl_added, timeout),
efl_event_callback_array_add(efl_added, send_copier_cbs(), d),
- efl_io_closer_close_on_destructor_set(efl_added, EINA_FALSE) /* we must wait both copiers to finish before we close! */
+ efl_io_closer_close_on_invalidate_set(efl_added, EINA_FALSE) /* we must wait both copiers to finish before we close! */
);
fprintf(stderr, "INFO: using sender buffer %p with copier %p for client %s\n",
@@ -383,7 +379,7 @@ _server_client_add(void *data EINA_UNUSED, const Efl_Event *event)
efl_io_copier_destination_set(efl_added, recv_buffer),
efl_io_copier_timeout_inactivity_set(efl_added, 0.0), /* we'll only set an inactivity timeout once the sender is done */
efl_event_callback_array_add(efl_added, recv_copier_cbs(), d),
- efl_io_closer_close_on_destructor_set(efl_added, EINA_FALSE) /* we must wait both copiers to finish before we close! */
+ efl_io_closer_close_on_invalidate_set(efl_added, EINA_FALSE) /* we must wait both copiers to finish before we close! */
);
fprintf(stderr, "INFO: using receiver buffer %p with copier %p for client %s\n",
@@ -410,8 +406,7 @@ _server_error(void *data EINA_UNUSED, const Efl_Event *event)
{
const Eina_Error *perr = event->info;
fprintf(stderr, "ERROR: %d '%s'\n", *perr, eina_error_msg_get(*perr));
- retval = EXIT_FAILURE;
- ecore_main_loop_quit();
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
}
static void
@@ -472,7 +467,6 @@ static const char * protocols[] = {
static const char *ciphers_strs[] = {
"auto",
- "sslv3",
"tlsv1",
"tlsv1.1",
"tlsv1.2",
@@ -536,8 +530,39 @@ static const Ecore_Getopt options = {
}
};
-int
-main(int argc, char **argv)
+static Eo *server = NULL;
+
+EAPI_MAIN void
+efl_pause(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_resume(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_terminate(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+ /* FIXME: For the moment the main loop doesn't get
+ properly destroyed on shutdown which disallow
+ relying on parent destroying their children */
+ if (server)
+ {
+ efl_del(server);
+ server = NULL;
+ }
+
+ fprintf(stderr, "INFO: main loop finished.\n");
+}
+
+EAPI_MAIN void
+efl_main(void *data EINA_UNUSED,
+ const Efl_Event *ev)
{
const Efl_Class *cls;
char *protocol = NULL;
@@ -591,34 +616,27 @@ main(int argc, char **argv)
ECORE_GETOPT_VALUE_NONE /* sentinel */
};
int args;
- Eo *server;
Eina_Error err;
- ecore_init();
- ecore_con_init();
-
- args = ecore_getopt_parse(&options, values, argc, argv);
+ args = ecore_getopt_parse(&options, values, 0, NULL);
if (args < 0)
{
fputs("ERROR: Could not parse command line options.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
if (quit_option) goto end;
- args = ecore_getopt_parse_positional(&options, values, argc, argv, args);
+ args = ecore_getopt_parse_positional(&options, values, 0, NULL, args);
if (args < 0)
{
fputs("ERROR: Could not parse positional arguments.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
if (!protocol)
{
fputs("ERROR: missing protocol.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
@@ -637,7 +655,7 @@ main(int argc, char **argv)
goto end;
}
- server = efl_add(cls, efl_main_loop_get(), /* it's mandatory to use a main loop provider as the server parent */
+ server = efl_add(cls, ev->object, /* it's mandatory to use a main loop provider as the server parent */
efl_net_server_clients_limit_set(efl_added,
clients_limit,
clients_reject_excess), /* optional */
@@ -683,8 +701,6 @@ main(int argc, char **argv)
{
if (strcmp(cipher_choice, "auto") == 0)
cipher = EFL_NET_SSL_CIPHER_AUTO;
- else if (strcmp(cipher_choice, "sslv3") == 0)
- cipher = EFL_NET_SSL_CIPHER_SSLV3;
else if (strcmp(cipher_choice, "tlsv1") == 0)
cipher = EFL_NET_SSL_CIPHER_TLSV1;
else if (strcmp(cipher_choice, "tlsv1.1") == 0)
@@ -693,7 +709,7 @@ main(int argc, char **argv)
cipher = EFL_NET_SSL_CIPHER_TLSV1_2;
}
- ssl_ctx = efl_add(EFL_NET_SSL_CONTEXT_CLASS, NULL,
+ ssl_ctx = efl_add_ref(EFL_NET_SSL_CONTEXT_CLASS, NULL,
efl_net_ssl_context_certificates_set(efl_added, eina_list_iterator_new(certificates)),
efl_net_ssl_context_private_keys_set(efl_added, eina_list_iterator_new(private_keys)),
efl_net_ssl_context_certificate_revocation_lists_set(efl_added, eina_list_iterator_new(crls)),
@@ -733,7 +749,7 @@ main(int argc, char **argv)
}
}
- ecore_main_loop_begin();
+ return ;
end_server:
efl_del(server);
@@ -742,8 +758,8 @@ main(int argc, char **argv)
end:
EINA_LIST_FREE(udp_mcast_groups, str)
free(str);
- ecore_con_shutdown();
- ecore_shutdown();
- return retval;
+ efl_loop_quit(efl_loop_get(ev->object), eina_value_int_init(EXIT_FAILURE));
}
+
+EFL_MAIN_EX();
diff --git a/src/examples/ecore/efl_net_server_simple_example.c b/src/examples/ecore/efl_net_server_simple_example.c
index c5d889e42a..a68e9b9fb9 100644
--- a/src/examples/ecore/efl_net_server_simple_example.c
+++ b/src/examples/ecore/efl_net_server_simple_example.c
@@ -1,11 +1,7 @@
-#define EFL_BETA_API_SUPPORT 1
-#define EFL_EO_API_SUPPORT 1
-#include <Ecore.h>
-#include <Ecore_Con.h>
+#include <Efl_Net.h>
#include <Ecore_Getopt.h>
#include <fcntl.h>
-static int retval = EXIT_SUCCESS;
static Eina_Bool echo = EINA_FALSE;
static double timeout = 10.0;
@@ -124,7 +120,7 @@ _echo_copier_error(void *data EINA_UNUSED, const Efl_Event *event)
return;
}
- retval = EXIT_FAILURE;
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
fprintf(stderr, "ERROR: echo copier %p failed %d '%s', close and del.\n",
copier, *perr, eina_error_msg_get(*perr));
@@ -180,7 +176,7 @@ _server_client_add(void *data EINA_UNUSED, const Efl_Event *event)
efl_io_copier_source_set(efl_added, client),
efl_io_copier_destination_set(efl_added, client),
efl_event_callback_array_add(efl_added, echo_copier_cbs(), client),
- efl_io_closer_close_on_destructor_set(efl_added, EINA_TRUE) /* we want to auto-close as we have a single copier */
+ efl_io_closer_close_on_invalidate_set(efl_added, EINA_TRUE) /* we want to auto-close as we have a single copier */
);
fprintf(stderr, "INFO: using an echo copier=%p for client %s\n",
@@ -214,8 +210,7 @@ _server_error(void *data EINA_UNUSED, const Efl_Event *event)
{
const Eina_Error *perr = event->info;
fprintf(stderr, "ERROR: %d '%s'\n", *perr, eina_error_msg_get(*perr));
- retval = EXIT_FAILURE;
- ecore_main_loop_quit();
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
}
static void
@@ -276,7 +271,6 @@ static const char * protocols[] = {
static const char *ciphers_strs[] = {
"auto",
- "sslv3",
"tlsv1",
"tlsv1.1",
"tlsv1.2",
@@ -340,8 +334,39 @@ static const Ecore_Getopt options = {
}
};
-int
-main(int argc, char **argv)
+static Eo *simple_server = NULL;
+
+EAPI_MAIN void
+efl_pause(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_resume(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_terminate(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+ /* FIXME: For the moment the main loop doesn't get
+ properly destroyed on shutdown which disallow
+ relying on parent destroying their children */
+ if (simple_server)
+ {
+ efl_del(simple_server);
+ simple_server = NULL;
+ }
+
+ fprintf(stderr, "INFO: main loop finished.\n");
+}
+
+EAPI_MAIN void
+efl_main(void *data EINA_UNUSED,
+ const Efl_Event *ev)
{
const Efl_Class *cls;
char *protocol = NULL;
@@ -395,34 +420,28 @@ main(int argc, char **argv)
ECORE_GETOPT_VALUE_NONE /* sentinel */
};
int args;
- Eo *simple_server, *server;
+ Eo *server;
Eina_Error err;
- ecore_init();
- ecore_con_init();
-
- args = ecore_getopt_parse(&options, values, argc, argv);
+ args = ecore_getopt_parse(&options, values, 0, NULL);
if (args < 0)
{
fputs("ERROR: Could not parse command line options.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
if (quit_option) goto end;
- args = ecore_getopt_parse_positional(&options, values, argc, argv, args);
+ args = ecore_getopt_parse_positional(&options, values, 0, NULL, args);
if (args < 0)
{
fputs("ERROR: Could not parse positional arguments.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
if (!protocol)
{
fputs("ERROR: missing protocol.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
@@ -441,7 +460,7 @@ main(int argc, char **argv)
goto end;
}
- simple_server = efl_add(EFL_NET_SERVER_SIMPLE_CLASS, efl_main_loop_get(), /* it's mandatory to use a main loop provider as the server parent */
+ simple_server = efl_add(EFL_NET_SERVER_SIMPLE_CLASS, ev->object, /* it's mandatory to use a main loop provider as the server parent */
efl_net_server_simple_inner_class_set(efl_added, cls), /* alternatively you could create the inner server and set with efl_net_server_simple_inner_server_set() */
efl_net_server_clients_limit_set(efl_added,
clients_limit,
@@ -490,8 +509,6 @@ main(int argc, char **argv)
{
if (strcmp(cipher_choice, "auto") == 0)
cipher = EFL_NET_SSL_CIPHER_AUTO;
- else if (strcmp(cipher_choice, "sslv3") == 0)
- cipher = EFL_NET_SSL_CIPHER_SSLV3;
else if (strcmp(cipher_choice, "tlsv1") == 0)
cipher = EFL_NET_SSL_CIPHER_TLSV1;
else if (strcmp(cipher_choice, "tlsv1.1") == 0)
@@ -500,7 +517,7 @@ main(int argc, char **argv)
cipher = EFL_NET_SSL_CIPHER_TLSV1_2;
}
- ssl_ctx = efl_add(EFL_NET_SSL_CONTEXT_CLASS, NULL,
+ ssl_ctx = efl_add_ref(EFL_NET_SSL_CONTEXT_CLASS, NULL,
efl_net_ssl_context_certificates_set(efl_added, eina_list_iterator_new(certificates)),
efl_net_ssl_context_private_keys_set(efl_added, eina_list_iterator_new(private_keys)),
efl_net_ssl_context_certificate_revocation_lists_set(efl_added, eina_list_iterator_new(crls)),
@@ -540,7 +557,7 @@ main(int argc, char **argv)
}
}
- ecore_main_loop_begin();
+ return ;
end_server:
efl_del(simple_server);
@@ -549,8 +566,8 @@ main(int argc, char **argv)
end:
EINA_LIST_FREE(udp_mcast_groups, str)
free(str);
- ecore_con_shutdown();
- ecore_shutdown();
- return retval;
+ efl_loop_quit(ev->object, eina_value_int_init(EXIT_FAILURE));
}
+
+EFL_MAIN_EX();
diff --git a/src/examples/ecore/efl_net_session_example.c b/src/examples/ecore/efl_net_session_example.c
index dfc827bcfa..683f3414e0 100644
--- a/src/examples/ecore/efl_net_session_example.c
+++ b/src/examples/ecore/efl_net_session_example.c
@@ -1,12 +1,6 @@
-#define EFL_BETA_API_SUPPORT 1
-#define EFL_EO_API_SUPPORT 1
-#include <Ecore.h>
-#include <Ecore_Con.h>
+#include <Efl_Net.h>
#include <Ecore_Getopt.h>
-static int retval = EXIT_SUCCESS;
-
-
static const char *
_state_str(Efl_Net_Session_State state)
{
@@ -51,7 +45,7 @@ _changed(void *data EINA_UNUSED, const Efl_Event *event)
"INFO: - state: %s\n"
"INFO: - technology: %s\n"
"INFO: - interface: '%s'\n",
- efl_net_session_name_get(session),
+ efl_net_session_network_name_get(session),
_state_str(efl_net_session_state_get(session)),
_technology_str(efl_net_session_technology_get(session)),
efl_net_session_interface_get(session));
@@ -96,8 +90,39 @@ static const Ecore_Getopt options = {
}
};
-int
-main(int argc, char **argv)
+static Eo *session = NULL;
+
+EAPI_MAIN void
+efl_pause(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_resume(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_terminate(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+ /* FIXME: For the moment the main loop doesn't get
+ properly destroyed on shutdown which disallow
+ relying on parent destroying their children */
+ if (session)
+ {
+ efl_del(session);
+ session = NULL;
+ }
+
+ fprintf(stderr, "INFO: main loop finished.\n");
+}
+
+EAPI_MAIN void
+efl_main(void *data EINA_UNUSED,
+ const Efl_Event *ev)
{
char *str;
Eina_List *techs = NULL;
@@ -118,16 +143,11 @@ main(int argc, char **argv)
ECORE_GETOPT_VALUE_NONE /* sentinel */
};
int args;
- Eo *session;
- ecore_init();
- ecore_con_init();
-
- args = ecore_getopt_parse(&options, values, argc, argv);
+ args = ecore_getopt_parse(&options, values, 0, NULL);
if (args < 0)
{
fputs("ERROR: Could not parse command line options.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
@@ -152,12 +172,11 @@ main(int argc, char **argv)
}
}
- session = efl_add(EFL_NET_SESSION_CLASS, efl_main_loop_get(),
+ session = efl_add(EFL_NET_SESSION_CLASS, ev->object,
efl_event_callback_array_add(efl_added, session_events_cbs(), NULL));
if (!session)
{
fputs("ERROR: Could not create Efl.Net.Session object.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
@@ -169,13 +188,10 @@ main(int argc, char **argv)
printf("INFO: the session will active while this application runs. Use ^C (Control + C) to close it\n");
- ecore_main_loop_begin();
-
- efl_del(session);
+ return ;
end:
- ecore_con_shutdown();
- ecore_shutdown();
-
- return retval;
+ efl_loop_quit(ev->object, eina_value_int_init(EXIT_FAILURE));
}
+
+EFL_MAIN_EX();
diff --git a/src/examples/ecore/efl_net_socket_ssl_dialer_example.c b/src/examples/ecore/efl_net_socket_ssl_dialer_example.c
index 0aab135ec2..10cec47dda 100644
--- a/src/examples/ecore/efl_net_socket_ssl_dialer_example.c
+++ b/src/examples/ecore/efl_net_socket_ssl_dialer_example.c
@@ -1,15 +1,11 @@
-#define EFL_BETA_API_SUPPORT 1
-#define EFL_EO_API_SUPPORT 1
-#include <Ecore.h>
-#include <Ecore_Con.h>
+#include <Efl_Net.h>
#include <Ecore_Getopt.h>
#include <fcntl.h>
#include <ctype.h>
-static int retval = EXIT_SUCCESS;
static Eina_List *pending_send = NULL;
static size_t pending_send_offset = 0;
-static Eo *ssl_ctx;
+static Eo *ssl_ctx = NULL;
static void
_ssl_ready(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
@@ -22,7 +18,7 @@ _ssl_error(void *data EINA_UNUSED, const Efl_Event *event)
{
const Eina_Error *perr = event->info;
fprintf(stderr, "INFO: SSL error: %d '%s'\n", *perr, eina_error_msg_get(*perr));
- retval = EXIT_FAILURE;
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
}
static void
@@ -51,8 +47,7 @@ _ssl_can_read(void *data EINA_UNUSED, const Efl_Event *event)
{
if (err == EAGAIN) return;
fprintf(stderr, "ERROR: could not read: %s\n", eina_error_msg_get(err));
- retval = EXIT_FAILURE;
- ecore_main_loop_quit();
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
return;
}
@@ -65,7 +60,7 @@ static void
_ssl_eos(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
{
fprintf(stderr, "INFO: SSL eos\n");
- ecore_main_loop_quit();
+ efl_loop_quit(efl_loop_get(event->object), EINA_VALUE_EMPTY);
}
static void
@@ -97,8 +92,7 @@ _ssl_can_write(void *data EINA_UNUSED, const Efl_Event *event)
{
if (err == EAGAIN) return;
fprintf(stderr, "ERROR: could not write: %s\n", eina_error_msg_get(err));
- retval = EXIT_FAILURE;
- ecore_main_loop_quit();
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
return;
}
@@ -149,8 +143,7 @@ _connected(void *data EINA_UNUSED, const Efl_Event *event)
if (!ssl)
{
fprintf(stderr, "ERROR: failed to wrap dialer=%p in SSL\n", event->object);
- retval = EXIT_FAILURE;
- ecore_main_loop_quit();
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
return;
}
@@ -179,7 +172,7 @@ _error(void *data EINA_UNUSED, const Efl_Event *event)
{
const Eina_Error *perr = event->info;
fprintf(stderr, "INFO: error: %d '%s'\n", *perr, eina_error_msg_get(*perr));
- retval = EXIT_FAILURE;
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
}
EFL_CALLBACKS_ARRAY_DEFINE(dialer_cbs,
@@ -238,7 +231,6 @@ static const char *verify_mode_strs[] = {
static const char *ciphers_strs[] = {
"auto",
- "sslv3",
"tlsv1",
"tlsv1.1",
"tlsv1.2",
@@ -283,8 +275,60 @@ static const Ecore_Getopt options = {
}
};
-int
-main(int argc, char **argv)
+static Eo *dialer = NULL;
+
+#ifndef USE_DEFAULT_CONTEXT
+static Eina_List *certificates = NULL;
+static Eina_List *private_keys = NULL;
+static Eina_List *crls = NULL;
+static Eina_List *cas = NULL;
+#endif
+
+EAPI_MAIN void
+efl_pause(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_resume(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_terminate(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+ if (dialer || ssl_ctx)
+ {
+#ifndef USE_DEFAULT_CONTEXT
+ char *str;
+#endif
+
+ efl_io_closer_close(dialer); /* just del won't do as ssl has an extra ref */
+ efl_del(dialer);
+ dialer = NULL;
+
+ efl_unref(ssl_ctx);
+ ssl_ctx = NULL;
+
+ EINA_LIST_FREE(pending_send, str) free(str);
+
+#ifndef USE_DEFAULT_CONTEXT
+ EINA_LIST_FREE(certificates, str) free(str);
+ EINA_LIST_FREE(private_keys, str) free(str);
+ EINA_LIST_FREE(crls, str) free(str);
+ EINA_LIST_FREE(cas, str) free(str);
+#endif
+ }
+
+ fprintf(stderr, "INFO: main loop finished.\n");
+}
+
+EAPI_MAIN void
+efl_main(void *data EINA_UNUSED,
+ const Efl_Event *ev)
{
char *address = NULL;
char *line_delimiter_str = NULL;
@@ -294,10 +338,6 @@ main(int argc, char **argv)
Eina_Iterator *it;
char *verify_mode_choice = "required";
char *cipher_choice = "auto";
- Eina_List *certificates = NULL;
- Eina_List *private_keys = NULL;
- Eina_List *crls = NULL;
- Eina_List *cas = NULL;
Eina_Bool default_paths_load = EINA_TRUE;
Efl_Net_Ssl_Verify_Mode verify_mode = EFL_NET_SSL_VERIFY_MODE_OPTIONAL;
Efl_Net_Ssl_Cipher cipher = EFL_NET_SSL_CIPHER_AUTO;
@@ -336,29 +376,27 @@ main(int argc, char **argv)
ECORE_GETOPT_VALUE_NONE /* sentinel */
};
int args;
- Eo *dialer, *loop;
+ Eo *loop;
Eina_Error err;
ecore_init();
ecore_con_init();
- args = ecore_getopt_parse(&options, values, argc, argv);
+ args = ecore_getopt_parse(&options, values, 0, NULL);
if (args < 0)
{
fputs("ERROR: Could not parse command line options.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
if (quit_option) goto end;
- loop = efl_main_loop_get();
+ loop = ev->object;
- args = ecore_getopt_parse_positional(&options, values, argc, argv, args);
+ args = ecore_getopt_parse_positional(&options, values, 0, NULL, args);
if (args < 0)
{
fputs("ERROR: Could not parse positional arguments.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
@@ -377,8 +415,6 @@ main(int argc, char **argv)
{
if (strcmp(cipher_choice, "auto") == 0)
cipher = EFL_NET_SSL_CIPHER_AUTO;
- else if (strcmp(cipher_choice, "sslv3") == 0)
- cipher = EFL_NET_SSL_CIPHER_SSLV3;
else if (strcmp(cipher_choice, "tlsv1") == 0)
cipher = EFL_NET_SSL_CIPHER_TLSV1;
else if (strcmp(cipher_choice, "tlsv1.1") == 0)
@@ -417,7 +453,7 @@ main(int argc, char **argv)
/* create a new SSL context with command line configurations.
* another option would be to use the default dialer context */
#ifndef USE_DEFAULT_CONTEXT
- ssl_ctx = efl_add(EFL_NET_SSL_CONTEXT_CLASS, NULL,
+ ssl_ctx = efl_add_ref(EFL_NET_SSL_CONTEXT_CLASS, NULL,
efl_net_ssl_context_certificates_set(efl_added, eina_list_iterator_new(certificates)),
efl_net_ssl_context_private_keys_set(efl_added, eina_list_iterator_new(private_keys)),
efl_net_ssl_context_certificate_revocation_lists_set(efl_added, eina_list_iterator_new(crls)),
@@ -435,7 +471,6 @@ main(int argc, char **argv)
if (!ssl_ctx)
{
fprintf(stderr, "ERROR: could not create the SSL context!\n");
- retval = EXIT_FAILURE;
goto no_ssl_ctx;
}
@@ -481,19 +516,16 @@ main(int argc, char **argv)
{
fprintf(stderr, "ERROR: could not dial '%s': %s",
address, eina_error_msg_get(err));
- retval = EXIT_FAILURE;
goto no_mainloop;
}
- ecore_main_loop_begin();
-
- fprintf(stderr, "INFO: main loop finished.\n");
+ return ;
no_mainloop:
efl_io_closer_close(dialer); /* just del won't do as ssl has an extra ref */
efl_del(dialer);
no_ssl_ctx:
- efl_del(ssl_ctx);
+ efl_unref(ssl_ctx);
end:
EINA_LIST_FREE(pending_send, str) free(str);
@@ -505,8 +537,7 @@ main(int argc, char **argv)
EINA_LIST_FREE(cas, str) free(str);
#endif
- ecore_con_shutdown();
- ecore_shutdown();
-
- return retval;
+ efl_loop_quit(ev->object, eina_value_int_init(EXIT_FAILURE));
}
+
+EFL_MAIN_EX();
diff --git a/src/examples/ecore/efl_net_socket_ssl_server_example.c b/src/examples/ecore/efl_net_socket_ssl_server_example.c
index bfd6adc412..2babc8b6a0 100644
--- a/src/examples/ecore/efl_net_socket_ssl_server_example.c
+++ b/src/examples/ecore/efl_net_socket_ssl_server_example.c
@@ -1,11 +1,7 @@
-#define EFL_BETA_API_SUPPORT 1
-#define EFL_EO_API_SUPPORT 1
-#include <Ecore.h>
-#include <Ecore_Con.h>
+#include <Efl_Net.h>
#include <Ecore_Getopt.h>
#include <fcntl.h>
-static int retval = EXIT_SUCCESS;
static double timeout = 30.0;
static Eo *ssl_ctx = NULL;
@@ -77,7 +73,7 @@ _echo_copier_error(void *data EINA_UNUSED, const Efl_Event *event)
return;
}
- retval = EXIT_FAILURE;
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
fprintf(stderr, "ERROR: echo copier %p failed %d '%s', close and del.\n",
copier, *perr, eina_error_msg_get(*perr));
@@ -113,8 +109,7 @@ _server_client_add(void *data EINA_UNUSED, const Efl_Event *event)
if (!ssl)
{
fprintf(stderr, "ERROR: failed to wrap client=%p in SSL\n", client);
- retval = EXIT_FAILURE;
- ecore_main_loop_quit();
+ efl_loop_quit(efl_loop_get(client), eina_value_int_init(EXIT_FAILURE));
return;
}
@@ -133,7 +128,7 @@ _server_client_add(void *data EINA_UNUSED, const Efl_Event *event)
efl_io_copier_destination_set(efl_added, ssl),
efl_io_copier_timeout_inactivity_set(efl_added, timeout),
efl_event_callback_array_add(efl_added, echo_copier_cbs(), ssl),
- efl_io_closer_close_on_destructor_set(efl_added, EINA_TRUE) /* we want to auto-close as we have a single copier */
+ efl_io_closer_close_on_invalidate_set(efl_added, EINA_TRUE) /* we want to auto-close as we have a single copier */
);
fprintf(stderr, "INFO: using an echo copier=%p for ssl %s\n",
@@ -145,8 +140,7 @@ _server_error(void *data EINA_UNUSED, const Efl_Event *event)
{
const Eina_Error *perr = event->info;
fprintf(stderr, "ERROR: %d '%s'\n", *perr, eina_error_msg_get(*perr));
- retval = EXIT_FAILURE;
- ecore_main_loop_quit();
+ efl_loop_quit(efl_loop_get(event->object), eina_value_int_init(EXIT_FAILURE));
}
static void
@@ -163,7 +157,6 @@ EFL_CALLBACKS_ARRAY_DEFINE(server_cbs,
static const char *ciphers_strs[] = {
"auto",
- "sslv3",
"tlsv1",
"tlsv1.1",
"tlsv1.2",
@@ -201,16 +194,57 @@ static const Ecore_Getopt options = {
}
};
-int
-main(int argc, char **argv)
+static Eo *server = NULL;
+static Eina_List *certificates = NULL;
+static Eina_List *private_keys = NULL;
+static Eina_List *crls = NULL;
+static Eina_List *cas = NULL;
+
+EAPI_MAIN void
+efl_pause(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_resume(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+}
+
+EAPI_MAIN void
+efl_terminate(void *data EINA_UNUSED,
+ const Efl_Event *ev EINA_UNUSED)
+{
+ /* FIXME: For the moment the main loop doesn't get
+ properly destroyed on shutdown which disallow
+ relying on parent destroying their children */
+ if (server || ssl_ctx)
+ {
+ char *str;
+
+ efl_del(server);
+ server = NULL;
+
+ efl_unref(ssl_ctx);
+ ssl_ctx = NULL;
+
+ EINA_LIST_FREE(certificates, str) free(str);
+ EINA_LIST_FREE(private_keys, str) free(str);
+ EINA_LIST_FREE(crls, str) free(str);
+ EINA_LIST_FREE(cas, str) free(str);
+ }
+
+ fprintf(stderr, "INFO: main loop finished.\n");
+}
+
+EAPI_MAIN void
+efl_main(void *data EINA_UNUSED,
+ const Efl_Event *ev)
{
char *address = NULL;
char *cipher_choice = "auto";
char *str;
- Eina_List *certificates = NULL;
- Eina_List *private_keys = NULL;
- Eina_List *crls = NULL;
- Eina_List *cas = NULL;
Efl_Net_Ssl_Cipher cipher = EFL_NET_SSL_CIPHER_AUTO;
Eina_Bool quit_option = EINA_FALSE;
Ecore_Getopt_Value values[] = {
@@ -234,27 +268,21 @@ main(int argc, char **argv)
};
int args;
Eina_Iterator *it;
- Eo *server;
Eina_Error err;
- ecore_init();
- ecore_con_init();
-
- args = ecore_getopt_parse(&options, values, argc, argv);
+ args = ecore_getopt_parse(&options, values, 0, NULL);
if (args < 0)
{
fputs("ERROR: Could not parse command line options.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
if (quit_option) goto end;
- args = ecore_getopt_parse_positional(&options, values, argc, argv, args);
+ args = ecore_getopt_parse_positional(&options, values, 0, NULL, args);
if (args < 0)
{
fputs("ERROR: Could not parse positional arguments.\n", stderr);
- retval = EXIT_FAILURE;
goto end;
}
@@ -262,8 +290,6 @@ main(int argc, char **argv)
{
if (strcmp(cipher_choice, "auto") == 0)
cipher = EFL_NET_SSL_CIPHER_AUTO;
- else if (strcmp(cipher_choice, "sslv3") == 0)
- cipher = EFL_NET_SSL_CIPHER_SSLV3;
else if (strcmp(cipher_choice, "tlsv1") == 0)
cipher = EFL_NET_SSL_CIPHER_TLSV1;
else if (strcmp(cipher_choice, "tlsv1.1") == 0)
@@ -272,7 +298,7 @@ main(int argc, char **argv)
cipher = EFL_NET_SSL_CIPHER_TLSV1_2;
}
- ssl_ctx = efl_add(EFL_NET_SSL_CONTEXT_CLASS, NULL,
+ ssl_ctx = efl_add_ref(EFL_NET_SSL_CONTEXT_CLASS, NULL,
efl_net_ssl_context_certificates_set(efl_added, eina_list_iterator_new(certificates)),
efl_net_ssl_context_private_keys_set(efl_added, eina_list_iterator_new(private_keys)),
efl_net_ssl_context_certificate_revocation_lists_set(efl_added, eina_list_iterator_new(crls)),
@@ -282,7 +308,6 @@ main(int argc, char **argv)
if (!ssl_ctx)
{
fprintf(stderr, "ERROR: could not create the SSL context!\n");
- retval = EXIT_FAILURE;
goto end;
}
@@ -310,7 +335,7 @@ main(int argc, char **argv)
fprintf(stderr, "INFO: * %s\n", str);
eina_iterator_free(it);
- server = efl_add(EFL_NET_SERVER_TCP_CLASS, efl_main_loop_get(), /* it's mandatory to use a main loop provider as the server parent */
+ server = efl_add(EFL_NET_SERVER_TCP_CLASS, ev->object, /* it's mandatory to use a main loop provider as the server parent */
efl_net_server_ip_ipv6_only_set(efl_added, EINA_FALSE), /* optional, but helps testing IPv4 on IPv6 servers */
efl_net_server_fd_reuse_address_set(efl_added, EINA_TRUE), /* optional, but nice for testing */
efl_net_server_fd_reuse_port_set(efl_added, EINA_TRUE), /* optional, but nice for testing... not secure unless you know what you're doing */
@@ -329,13 +354,13 @@ main(int argc, char **argv)
goto end_server;
}
- ecore_main_loop_begin();
+ return ;
end_server:
efl_del(server);
server = NULL;
end_ctx:
- efl_del(ssl_ctx);
+ efl_unref(ssl_ctx);
end:
EINA_LIST_FREE(certificates, str) free(str);
@@ -343,8 +368,7 @@ main(int argc, char **argv)
EINA_LIST_FREE(crls, str) free(str);
EINA_LIST_FREE(cas, str) free(str);
- ecore_con_shutdown();
- ecore_shutdown();
-
- return retval;
+ efl_loop_quit(ev->object, eina_value_int_init(EXIT_FAILURE));
}
+
+EFL_MAIN_EX();
diff --git a/src/examples/edje/edje-multiseat-custom-names.c b/src/examples/edje/edje-multiseat-custom-names.c
index ce1342bbb2..9da96b8371 100644
--- a/src/examples/edje/edje-multiseat-custom-names.c
+++ b/src/examples/edje/edje-multiseat-custom-names.c
@@ -123,9 +123,9 @@ main(int argc EINA_UNUSED, char *argv[] EINA_UNUSED)
if (efl_input_device_type_get(dev) == EFL_INPUT_DEVICE_TYPE_SEAT)
_device_rename(dev);
}
- efl_event_callback_add(evas, EFL_CANVAS_EVENT_DEVICE_ADDED,
+ efl_event_callback_add(evas, EFL_CANVAS_SCENE_EVENT_DEVICE_ADDED,
_device_added, NULL);
- efl_event_callback_add(evas, EFL_CANVAS_EVENT_DEVICE_CHANGED,
+ efl_event_callback_add(evas, EFL_CANVAS_SCENE_EVENT_DEVICE_CHANGED,
_device_changed, NULL);
printf("Running example on evas engine %s\n",
diff --git a/src/examples/edje/edje-multiseat-filter.c b/src/examples/edje/edje-multiseat-filter.c
index 5cf59d69b2..92a7e7c7b6 100644
--- a/src/examples/edje/edje-multiseat-filter.c
+++ b/src/examples/edje/edje-multiseat-filter.c
@@ -108,7 +108,7 @@ main(int argc EINA_UNUSED, char *argv[] EINA_UNUSED)
efl_canvas_object_seat_focus_add(edje_obj, dev);
}
- efl_event_callback_add(evas, EFL_CANVAS_EVENT_DEVICE_ADDED,
+ efl_event_callback_add(evas, EFL_CANVAS_SCENE_EVENT_DEVICE_ADDED,
_device_added, edje_obj);
ecore_evas_show(ee);
diff --git a/src/examples/edje/edje-multiseat.c b/src/examples/edje/edje-multiseat.c
index a6cd6c0e72..18abfec743 100644
--- a/src/examples/edje/edje-multiseat.c
+++ b/src/examples/edje/edje-multiseat.c
@@ -255,7 +255,7 @@ main(int argc EINA_UNUSED, char *argv[] EINA_UNUSED)
efl_canvas_object_seat_focus_add(edje_obj, dev);
}
- efl_event_callback_add(evas, EFL_CANVAS_EVENT_DEVICE_ADDED,
+ efl_event_callback_add(evas, EFL_CANVAS_SCENE_EVENT_DEVICE_ADDED,
_device_added, edje_obj);
evas_object_event_callback_add(edje_obj, EVAS_CALLBACK_KEY_DOWN,
_on_key_down, evas);
diff --git a/src/examples/efl_mono/EoInherit01.cs b/src/examples/efl_mono/EoInherit01.cs
index 17ea4df27e..cf35ca5f3e 100644
--- a/src/examples/efl_mono/EoInherit01.cs
+++ b/src/examples/efl_mono/EoInherit01.cs
@@ -2,7 +2,7 @@ using static System.Console;
class PlusTenNumberWrapper : example.NumberwrapperInherit
{
- public PlusTenNumberWrapper(efl.Object parent = null)
+ public PlusTenNumberWrapper(efl.IObject parent = null)
: base(parent)
{}
@@ -52,7 +52,7 @@ public class ExampleEoInherit01
WriteLine("## Using original object ##\n");
// Check original EFL object
- var origObj = new example.NumberwrapperConcrete();
+ var origObj = new example.Numberwrapper();
given = 111;
origObj.SetNumber(given);
stored = origObj.GetNumber();
diff --git a/src/examples/efl_mono/FunctionPointer01.cs b/src/examples/efl_mono/FunctionPointer01.cs
index 2954473a27..c32f53cd51 100644
--- a/src/examples/efl_mono/FunctionPointer01.cs
+++ b/src/examples/efl_mono/FunctionPointer01.cs
@@ -15,7 +15,7 @@ public class ExampleFunctionPointer01
eina.Config.Init();
efl.eo.Config.Init();
- var obj = new example.NumberwrapperConcrete();
+ var obj = new example.Numberwrapper();
// Set internal value
obj.SetNumber(12);
diff --git a/src/examples/efl_mono/Makefile.am b/src/examples/efl_mono/Makefile.am
index fe271e9f10..7d3f02a054 100644
--- a/src/examples/efl_mono/Makefile.am
+++ b/src/examples/efl_mono/Makefile.am
@@ -4,6 +4,11 @@ include $(top_srcdir)/src/Makefile_Eolian_Helper.am
include $(top_srcdir)/src/Makefile_Eolian_Mono_Helper.am
include $(top_srcdir)/src/Makefile_Efl_Mono_MSBuild_Gen_Helper.am
+# Eolian_Files_Helper
+# Thus we need to override it here in order to make its pattern
+# rules work properly.
+_EOLIAN_GEN_DEP = ../../bin/eolian/eolian_gen${EXEEXT}
+
SRCS = example_numberwrapper.c
EXTRA_FILES = example_numberwrapper.eo
EXTRA_PROGRAMS =
@@ -38,13 +43,6 @@ COMMON_FLAGS += \
-fPIC -DPIC
endif
-
-%.eo.c: %.eo
- $(AM_V_EOL)$(EOLIAN_GEN) $(EOLIAN_FLAGS) -gc -o c:$@ $<
-
-%.eo.h: %.eo
- $(AM_V_EOL)$(EOLIAN_GEN) $(EOLIAN_FLAGS) -gh -o h:$@ $<
-
example_numberwrapper.c: example_numberwrapper.eo.h example_numberwrapper.eo.c
noinst_lib_LTLIBRARIES = libexample_numberwrapper.la
@@ -66,11 +64,11 @@ example_numberwrapper.eo.cs: example_numberwrapper.eo
$(AM_V_EOLMONO) \
$(EOLIAN_MONO) $(EOLIAN_FLAGS) $(EOLIAN_MONO_FLAGS) --dllimport example_numberwrapper -o $@ -r $(top_builddir)/src/bindings/mono/efl_mono/efl_libs.csv $<
-EoInherit01_SOURCES = EoInherit01.cs example_numberwrapper.eo.cs
+EoInherit01_SOURCES = EoInherit01.cs
#EoInherit01_files = $(EoInherit01_exe_srcs) example_numberwrapper.eo.cs
-EoInherit01$(EXEEXT): $(EoInherit01_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll libexample_numberwrapper.la EoInherit01$(EXEEXT).config
+EoInherit01$(EXEEXT): $(EoInherit01_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll libexample_numberwrapper.la EoInherit01$(EXEEXT).config example_numberwrapper.eo.cs
@rm -f $@
- $(AM_V_MCS) $(MCS) $(MCS_FLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
+ $(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
EoInherit01.csproj: $(EoInherit01_SOURCES) $(am_dirstamp) libexample_numberwrapper.la
@rm -f $@
@@ -87,10 +85,10 @@ EoInherit01$(EXEEXT).config:
echo " </runtime>" >> $@
echo "</configuration>" >> $@
-FunctionPointer01_SOURCES = FunctionPointer01.cs example_numberwrapper.eo.cs
-FunctionPointer01$(EXEEXT): $(FunctionPointer01_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll libexample_numberwrapper.la
+FunctionPointer01_SOURCES = FunctionPointer01.cs
+FunctionPointer01$(EXEEXT): $(FunctionPointer01_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll libexample_numberwrapper.la example_numberwrapper.eo.cs
@rm -f $@
- $(AM_V_MCS) $(MCS) $(MCS_FLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
+ $(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
FunctionPointer01.csproj: $(FunctionPointer01_SOURCES) $(am_dirstamp) libexample_numberwrapper.la
@rm -f $@
diff --git a/src/examples/efl_mono/example_numberwrapper.c b/src/examples/efl_mono/example_numberwrapper.c
index 4ec0f72df1..52a5af93ef 100644
--- a/src/examples/efl_mono/example_numberwrapper.c
+++ b/src/examples/efl_mono/example_numberwrapper.c
@@ -10,15 +10,15 @@
#define EOAPI EAPI EAPI_WEAK
#ifdef _WIN32
-# ifdef EFL_EO_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EO_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -29,7 +29,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#include "example_numberwrapper.eo.h"
@@ -57,7 +57,7 @@ void _example_numberwrapper_number_set_call(Eo *obj, EINA_UNUSED Example_Numberw
example_numberwrapper_number_set(obj, n);
}
-int _example_numberwrapper_number_get(EINA_UNUSED Eo *obj, Example_Numberwrapper_Data *pd)
+int _example_numberwrapper_number_get(EINA_UNUSED const Eo *obj, Example_Numberwrapper_Data *pd)
{
return pd->number;
}
diff --git a/src/examples/eina/Makefile.am b/src/examples/eina/Makefile.am
index 4ecd814672..652a9e0485 100644
--- a/src/examples/eina/Makefile.am
+++ b/src/examples/eina/Makefile.am
@@ -153,7 +153,7 @@ EinaHash01Mono_SOURCES = EinaHash01.cs
EinaArray01Mono$(EXEEXT): $(EinaArray01Mono_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll
@rm -f $@
- $(AM_V_MCS) $(MCS) $(MCS_FLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
+ $(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
EinaArray01.csproj: $(EinaArray01Mono_SOURCES) $(am_dirstamp)
@rm -f $@
@@ -161,7 +161,7 @@ EinaArray01.csproj: $(EinaArray01Mono_SOURCES) $(am_dirstamp)
EinaBinbuf01Mono$(EXEEXT): $(EinaBinbuf01Mono_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll
@rm -f $@
- $(AM_V_MCS) $(MCS) $(MCS_FLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
+ $(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
EinaBinbuf01.csproj: $(EinaBinbuf01Mono_SOURCES) $(am_dirstamp)
@rm -f $@
@@ -169,7 +169,7 @@ EinaBinbuf01.csproj: $(EinaBinbuf01Mono_SOURCES) $(am_dirstamp)
EinaError01Mono$(EXEEXT): $(EinaError01Mono_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll
@rm -f $@
- $(AM_V_MCS) $(MCS) $(MCS_FLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
+ $(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
EinaError01.csproj: $(EinaError01Mono_SOURCES) $(am_dirstamp)
@rm -f $@
@@ -177,7 +177,7 @@ EinaError01.csproj: $(EinaError01Mono_SOURCES) $(am_dirstamp)
EinaHash01Mono$(EXEEXT): $(EinaHash01Mono_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll
@rm -f $@
- $(AM_V_MCS) $(MCS) $(MCS_FLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
+ $(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
EinaHash01.csproj: $(EinaHash01Mono_SOURCES) $(am_dirstamp)
@rm -f $@
diff --git a/src/examples/eina/eina_simple_xml_parser_01.c b/src/examples/eina/eina_simple_xml_parser_01.c
index a4f6ca4456..0ad4ec3b85 100644
--- a/src/examples/eina/eina_simple_xml_parser_01.c
+++ b/src/examples/eina/eina_simple_xml_parser_01.c
@@ -31,7 +31,10 @@ main(void)
if ((buffer = malloc(size)))
{
- fread(buffer, 1, size, file);
+ if (fread(buffer, 1, size, file) != size)
+ {
+ EINA_LOG_ERR("Can't read chat.xml");
+ }
array = eina_array_new(10);
eina_simple_xml_parse(buffer, size, EINA_TRUE,
diff --git a/src/examples/eio/efl_io_manager_ls.c b/src/examples/eio/efl_io_manager_ls.c
index 65d5511026..fd79032803 100644
--- a/src/examples/eio/efl_io_manager_ls.c
+++ b/src/examples/eio/efl_io_manager_ls.c
@@ -39,12 +39,13 @@ done_cb(void *data EINA_UNUSED,
// Progress used to be the "Eio_Main_Cb" family of callbacks in the legacy API.
static void
-progress_cb(void *data EINA_UNUSED, Eina_Accessor *access)
+progress_cb(void *data EINA_UNUSED, Eina_Array *array)
{
+ Eina_Array_Iterator it;
const char *filename;
unsigned int count;
- EINA_ACCESSOR_FOREACH(access, count, filename)
+ EINA_ARRAY_ITER_NEXT(array, count, filename, it)
printf("%s listing filename: %s\n", __FUNCTION__, filename);
}
diff --git a/src/examples/eio/efl_io_manager_open_multi.c b/src/examples/eio/efl_io_manager_open_multi.c
index 3c39d3fc49..bcee8ca125 100644
--- a/src/examples/eio/efl_io_manager_open_multi.c
+++ b/src/examples/eio/efl_io_manager_open_multi.c
@@ -9,19 +9,7 @@
#include <Eio.h>
#include <Ecore.h>
-void error_cb(void *data, const Efl_Event *ev)
-{
- Efl_Future_Event_Failure *failure = ev->info;
- const char *msg = eina_error_msg_get(failure->error);
- Efl_Io_Manager *job = data;
- (void) job;
-
- EINA_LOG_ERR("error: %s", msg);
-
- ecore_main_loop_quit();
-}
-
-static Eina_Value
+Eina_Value
_close_cb(void *data EINA_UNUSED, const Eina_Value array, const Eina_Future *dead EINA_UNUSED)
{
printf("%s closed all files.\n", __FUNCTION__);
@@ -39,7 +27,7 @@ _open_cb(void *data, const Eina_Value array, const Eina_Future *dead EINA_UNUSED
Eina_Value v = EINA_VALUE_EMPTY;
Eina_Future *futures[eina_value_array_count(&array) + 1];
- EINA_VALUE_ARRAY_FOREACH(&array, len, i, &v)
+ EINA_VALUE_ARRAY_FOREACH(&array, len, i, v)
{
if (v.type == EINA_VALUE_TYPE_ERROR)
{
diff --git a/src/examples/eio/eio_sentry.c b/src/examples/eio/eio_sentry.c
index 342df05ad9..e604e8900d 100644
--- a/src/examples/eio/eio_sentry.c
+++ b/src/examples/eio/eio_sentry.c
@@ -27,7 +27,7 @@ void
monitor_stuff(void *data)
{
const char *path = data;
- Eio_Sentry *sentry = efl_add(EIO_SENTRY_CLASS, NULL);
+ Eio_Sentry *sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
efl_event_callback_add(sentry, EIO_SENTRY_EVENT_FILE_CREATED, (Efl_Event_Cb)&sentry_cb, NULL);
printf("Starting monitoring path %s\n", path);
diff --git a/src/examples/eldbus/dbusmodel.c b/src/examples/eldbus/dbusmodel.c
index a6c2d15e0f..10150c40f2 100644
--- a/src/examples/eldbus/dbusmodel.c
+++ b/src/examples/eldbus/dbusmodel.c
@@ -14,150 +14,126 @@
#define DEFAULT_BUS_NAME "org.freedesktop.DBus"
#define DEFAULT_PATH "/"
-static int prop_count = 0;
static int retval = EXIT_SUCCESS;
static Eina_Bool quit_on_done = EINA_TRUE;
static void
-future_properties_then(void* data, const Efl_Event *event)
+_on_properties_changed(void *data EINA_UNUSED, const Efl_Event *event)
{
- Eo* obj = data;
- Efl_Future_Event_Success *future = event->info;
- Eina_Value * property_value;
- const Eina_Array *properties_list;
- Eina_Array_Iterator a_it;
- char *property, *prop_str;
- const char *name;
- Eina_Iterator* it = future->value;
-
- name = eldbus_model_proxy_name_get(obj);
- properties_list = efl_model_properties_get(obj);
-
- printf(" -> %s\n Properties:\n", name);
- unsigned i = 0;
- EINA_ARRAY_ITER_NEXT(properties_list, i, property, a_it)
+ Efl_Model_Property_Event *ev = event->info;
+ Eina_Array_Iterator it;
+ const char *property;
+ unsigned int i;
+
+ printf("Properties changed:\n");
+ EINA_ARRAY_ITER_NEXT(ev->changed_properties, i, property, it)
{
- if (eina_iterator_next(it, (void **)&property_value) && property_value)
+ Eina_Value *v;
+ char *str;
+
+ v = efl_model_property_get(event->object, property);
+
+ if (!v)
{
- prop_str = eina_value_to_string(property_value);
- printf(" * %s=%s \n", property, prop_str);
- free(prop_str);
+ EINA_LOG_CRIT("Property '%s' returned nothing.", property);
+ abort();
}
- }
- prop_count--;
- if (prop_count == 0)
- {
- if (quit_on_done)
- ecore_main_loop_quit();
- else
- printf("monitoring events...\n");
+ str = eina_value_to_string(v);
+ printf("\t%s: '%s'\n", property, str);
+ free(str);
+
+ eina_value_free(v);
}
+
+ printf("Properties invalidated:\n");
+ EINA_ARRAY_ITER_NEXT(ev->invalidated_properties, i, property, it)
+ printf("\t%s\n", property);
}
static void
-error_cb(void* data EINA_UNUSED, const Efl_Event *event)
+_on_invalidate(void *data EINA_UNUSED, const Efl_Event *event)
{
- Efl_Future_Event_Failure *future = event->info;
- printf(" ERROR: #%d '%s'\n", future->error, eina_error_msg_get(future->error));
- ecore_main_loop_quit();
- retval = EXIT_FAILURE;
+ efl_unref(event->object);
}
+EFL_CALLBACKS_ARRAY_DEFINE(child_cbs,
+ { EFL_MODEL_EVENT_PROPERTIES_CHANGED, _on_properties_changed },
+ { EFL_EVENT_INVALIDATE, _on_invalidate });
+
static void
-loop_children(Eina_Accessor *children)
+process(Eo *child, unsigned int index)
{
- Eo* child;
- int i = 0;
+ Eina_Array *properties = efl_model_properties_get(child);
+ const char *property;
+ Eina_Array_Iterator it;
+ Eina_Strbuf *buf;
+ unsigned int i;
+
+ buf = eina_strbuf_new();
- EINA_ACCESSOR_FOREACH(children, i, child)
+ const char *name = eldbus_model_proxy_name_get(child);
+
+ EINA_ARRAY_ITER_NEXT(properties, i, property, it)
{
- const Eina_Array *properties_list = efl_model_properties_get(child);
- unsigned p_count = eina_array_count(properties_list);
- const char *name = eldbus_model_proxy_name_get(child);
+ Eina_Value *v = efl_model_property_get(child, property);
+ char *str;
- if (p_count)
- {
- Efl_Future **futures = calloc(p_count + 1, sizeof(Efl_Future *));
- Eina_Array_Iterator a_it;
- const char *property;
- unsigned j = 0;
-
- EINA_ARRAY_ITER_NEXT(properties_list, j, property, a_it)
- {
- futures[j] = efl_model_property_get(child, property);
- }
- efl_future_then(efl_future_iterator_all(eina_carray_iterator_new((void **)futures)),
- &future_properties_then, &error_cb, NULL, child);
- prop_count++;
- free(futures);
- printf(" %2d: %s (loading %u properties asynchronously)\n", i, name, j);
- }
- else
+ if (!v)
{
- printf(" %2d: %s (no properties yet)\n", i, name);
+ EINA_LOG_CRIT("Property '%s' returned nothing.", property);
+ abort();
}
- }
- if (prop_count == 0)
- {
- if (quit_on_done)
- ecore_main_loop_quit();
- else
- printf("monitoring events...\n");
+ str = eina_value_to_string(v);
+ eina_strbuf_append_printf(buf, " \t* %s: '%s'\n", property, str);
+ free(str);
+
+ eina_value_free(v);
}
-}
-static void
-future_then(void* obj EINA_UNUSED, const Efl_Event *event)
-{
- Efl_Future_Event_Success *future = event->info;
- Eina_Accessor *values = future->value;
- Eina_Accessor *children;
- unsigned int *count;
+ if (eina_array_count(properties) <= 0)
+ eina_strbuf_append_printf(buf, " %2d: %s (no properties yet)\n", index, name);
+ else
+ eina_strbuf_prepend_printf(buf, " -> %s\n Properties:\n", name);
- if (!eina_accessor_data_get(values, 0, (void**)&children))
- {
- fprintf(stderr, "ERROR: missing future fulfillment value #0\n");
- retval = EXIT_FAILURE;
- ecore_main_loop_quit();
- return;
- }
+ printf("%s", eina_strbuf_string_get(buf));
- if (!eina_accessor_data_get(values, 1, (void**)&count))
- {
- fprintf(stderr, "ERROR: missing future fulfillment value #1\n");
- retval = EXIT_FAILURE;
- ecore_main_loop_quit();
- return;
- }
+ eina_array_free(properties);
+ eina_strbuf_free(buf);
+
+ efl_ref(child);
+
+ efl_event_callback_array_add(child, child_cbs(), NULL);
- printf("efl_model_loaded count %u\n", *count);
- loop_children(children);
+ printf("monitoring events...\n");
}
-static void
-_on_properties_changed(void *data EINA_UNUSED, const Efl_Event *event)
+static Eina_Value
+_slice(void *data, const Eina_Value v,
+ const Eina_Future *dead_future EINA_UNUSED)
{
- Efl_Model_Property_Event *ev = event->info;
- Eina_Array_Iterator it;
- const char *str;
- unsigned int i;
+ unsigned int offset = (unsigned int)(uintptr_t) data;
+ unsigned int i, len;
+ Eo *child;
- printf("Properties changed:\n");
- EINA_ARRAY_ITER_NEXT(ev->changed_properties, i, str, it)
- printf("\t%s\n", str);
+ if (eina_value_type_get(&v) == EINA_VALUE_TYPE_ERROR) return v;
- printf("Properties invalidated:\n");
- EINA_ARRAY_ITER_NEXT(ev->invalidated_properties, i, str, it)
- printf("\t%s\n", str);
+ EINA_VALUE_ARRAY_FOREACH(&v, len, i, child)
+ process(child, offset + i);
+
+ return v;
}
static void
_on_child_added(void *data EINA_UNUSED, const Efl_Event *event)
{
- Eo *child = event->info;
- printf("Children Added: %p\n", child);
+ Efl_Model_Children_Event *ev = event->info;
+
+ printf("Children Added: %i\n", ev->index);
+
+ eina_future_then(efl_model_children_slice_get(event->object, ev->index, 1),
+ _slice, (void*)(uintptr_t) ev->index);
}
static void
@@ -250,12 +226,14 @@ main(int argc, char **argv EINA_UNUSED)
ELDBUS_CONNECTION_TYPE_SESSION);
root = efl_add_ref(ELDBUS_MODEL_OBJECT_CLASS, efl_main_loop_get(),
- eldbus_model_object_constructor(efl_added, conn_type, NULL, EINA_FALSE, bus_name, path),
+ eldbus_model_connect(efl_added, conn_type, NULL, EINA_FALSE),
+ eldbus_model_object_bus_set(efl_added, bus_name),
+ eldbus_model_object_path_set(efl_added, path),
efl_event_callback_array_add(efl_added, event_cbs(), NULL));
- efl_future_then(efl_future_all(efl_model_children_slice_get(root, 0, 0),
- efl_model_children_count_get(root)),
- &future_then, &error_cb, NULL, root);
+ if (efl_model_children_count_get(root))
+ eina_future_then(efl_model_children_slice_get(root, 0, efl_model_children_count_get(root)),
+ _slice, (uintptr_t) 0);
ecore_main_loop_begin();
efl_del(root);
diff --git a/src/examples/elementary/.gitignore b/src/examples/elementary/.gitignore
index 3c3567269f..f59adb353e 100644
--- a/src/examples/elementary/.gitignore
+++ b/src/examples/elementary/.gitignore
@@ -60,6 +60,10 @@
/list_example_01
/list_example_02
/list_example_03
+/efl_ui_list_example_1
+/efl_ui_view_list_example_1
+/efl_ui_view_list_example_2
+/efl_ui_view_list_example_3
/map_example_01
/map_example_02
/map_example_03
@@ -144,8 +148,7 @@
/notify_cxx_example_01
/panel_cxx_example_01
/panes_cxx_example
-/popup_cxx_example_01
-/popup_cxx_example_02
+/popup_cxx_example
/radio_cxx_example_01
/separator_cxx_example_01
/slider_cxx_example
diff --git a/src/examples/elementary/Makefile.am b/src/examples/elementary/Makefile.am
index 35f7377f2c..db16bab824 100644
--- a/src/examples/elementary/Makefile.am
+++ b/src/examples/elementary/Makefile.am
@@ -1,4 +1,9 @@
MAINTAINERCLEANFILES = Makefile.in
+DISTCLEANFILES = \
+codegen_example_generated.c \
+codegen_example_generated.h \
+codegen_example.edj
+
include ../../../Makefile_Elm_Helpers.am
include ../../Makefile_Edje_Helper.am
@@ -54,6 +59,7 @@ LDADD = \
-lm \
$(top_builddir)/src/lib/eina/libeina.la \
$(top_builddir)/src/lib/eo/libeo.la \
+$(top_builddir)/src/lib/efl/libefl.la \
$(top_builddir)/src/lib/eet/libeet.la \
$(top_builddir)/src/lib/evas/libevas.la \
$(top_builddir)/src/lib/ecore/libecore.la \
@@ -177,13 +183,10 @@ efl_thread_3.c \
efl_thread_4.c \
efl_thread_5.c \
efl_thread_6.c \
-efl_thread_win32_1.c \
-efl_thread_win32_2.c \
-efl_thread_win32_3.c \
-efl_thread_win32_4.c \
efl_ui_list_example_1.c \
-efl_ui_list_example_2.c \
-efl_ui_list_example_3.c
+efl_ui_view_list_example_1.c \
+efl_ui_view_list_example_2.c \
+efl_ui_view_list_example_3.c
SRCS += \
bg_cxx_example_01.cc \
@@ -214,7 +217,7 @@ evas3d_map_example.edc \
theme_example.edc \
layout_example.edc \
codegen_example.edc \
-efl_ui_list_example.edc
+efl_ui_view_list_example.edc
EDJS = $(EDCS:%.edc=%.edj)
@@ -237,14 +240,14 @@ files_DATA += \
codegen_example.edj \
evas3d_map_example.edj \
twitter_example_01.edj \
- efl_ui_list_example.edj
+ efl_ui_view_list_example.edj
CLEANFILES = \
theme_example.edj \
layout_example.edj\
evas3d_map_example.edj \
twitter_example_01.edj \
- efl_ui_list_example.edj
+ efl_ui_view_list_example.edj
clean-local:
rm -f *.epb *.cfg *.cfg.bkp
@@ -255,9 +258,7 @@ ELEMENTARY_CODEGEN_FLAGS = --prefix=codegen_example
codegen_example_generated.c codegen_example_generated.h: codegen_example.edj
$(AM_V_CODEGEN)$(ELEMENTARY_CODEGEN) $(ELEMENTARY_CODEGEN_FLAGS) $(<) elm/example/mylayout/default codegen_example_generated.c codegen_example_generated.h
-BUILT_SOURCES = codegen_example_generated.c codegen_example_generated.h
-
-codegen_example.c: codegen_example_generated.h
+codegen_example.$(OBJEXT): codegen_example_generated.h
codegen_example_SOURCES = \
codegen_example.c
@@ -268,24 +269,23 @@ codegen_example_generated.h
if HAVE_CSHARP
if HAVE_WIN32
-MCS_FLAGS := $(MCS_FLAGS)
-MCS_FLAGS += -define:WIN32
+MCSFLAGS ?=
+MCSFLAGS += -define:WIN32
endif
efl_ui_slider_mono_SOURCES = \
efl_ui_slider_mono.cs
-efl_ui_slider_mono(EXEEXT): $(efl_ui_slider_mono_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll$(EXEEXT)
+efl_ui_slider_mono$(EXEEXT): $(efl_ui_slider_mono_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll
@rm -f efl_ui_slider_mono$(EXEEXT)
- $(AM_V_MCS) $(MCS) $(MCS_FLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll$(EXEEXT) -out:$@ $(filter %.cs, $(^))
+ $(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
efl_ui_unit_converter_SOURCES = \
efl_ui_unit_converter.cs
-efl_ui_unit_converter: $(efl_ui_unit_converter_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll
- @rm -f efl_ui_unit_converter
- $(AM_V_MCS) $(MCS) $(MCS_FLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
-
+efl_ui_unit_converter$(EXEEXT): $(efl_ui_unit_converter_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll
+ @rm -f efl_ui_unit_converter$(EXEEXT)
+ $(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
endif
@@ -399,8 +399,9 @@ efl_thread_4 \
efl_thread_5 \
efl_thread_6 \
efl_ui_list_example_1 \
-efl_ui_list_example_2 \
-efl_ui_list_example_3
+efl_ui_view_list_example_1 \
+efl_ui_view_list_example_2 \
+efl_ui_view_list_example_3
#benchmark3d
#sphere-hunter
@@ -454,13 +455,6 @@ endif
if HAVE_CSHARP
-efl_ui_slider_mono_SOURCES = \
- efl_ui_slider_mono.cs
-
-efl_ui_slider_mono$(EXEEXT): $(efl_ui_slider_mono_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll
- @rm -f $@
- $(AM_V_MCS) $(MCS) $(MCS_FLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
-
examples_PROGRAMS += \
efl_ui_slider_mono \
efl_ui_unit_converter
@@ -620,7 +614,7 @@ screenshots: examples
convert $(HTML_SS_DIR)/$${SS_FILE} $(LATEX_SS_DIR)/$${SS_FILE/.png/.eps} ; \
done
-EXTRA_DIST = dict.txt layout_example.edc theme_example.edc codegen_example.edc evas3d_map_example.edc twitter_example_01.edc efl_ui_list_example.edc performance/layout.edc performance/background.png performance/target_texture.png sphere_hunter/sphere_hunter.edc sphere_hunter/score.jpg sphere_hunter/EFL_victory.png sphere_hunter/EFL_defeat.png codegen_example_generated.c codegen_example_generated.h codegen_example.edj prefs_example_01.epc prefs_example_02.epc prefs_example_03.epc prefs_example_03.edc
+EXTRA_DIST = dict.txt layout_example.edc theme_example.edc codegen_example.edc evas3d_map_example.edc twitter_example_01.edc efl_ui_view_list_example.edc performance/layout.edc performance/background.png performance/target_texture.png sphere_hunter/sphere_hunter.edc sphere_hunter/score.jpg sphere_hunter/EFL_victory.png sphere_hunter/EFL_defeat.png prefs_example_01.epc prefs_example_02.epc prefs_example_03.epc prefs_example_03.edc
if HAVE_CSHARP
EXTRA_DIST += $(MONO_SRCS)
diff --git a/src/examples/elementary/bg_cxx_example_01.cc b/src/examples/elementary/bg_cxx_example_01.cc
index c852b07c90..7e0724c3ca 100644
--- a/src/examples/elementary/bg_cxx_example_01.cc
+++ b/src/examples/elementary/bg_cxx_example_01.cc
@@ -1,3 +1,4 @@
+#define EFL_CXXPERIMENTAL // for background part
#include <Elementary.hh>
using efl::eo::instantiate;
@@ -9,12 +10,7 @@ elm_main (int argc EINA_UNUSED, char **argv EINA_UNUSED)
win.text_set("Window Background");
win.autohide_set(true);
win.size_set({320,320});
- try {
- auto bg = efl::eo::downcast<efl::ui::win::Part>(win.part("background"));
- bg.color_set(139, 69, 19, 255);
- } catch (std::exception const&e) {
- std::cerr << "Failed to set bg color: " << e.what() << std::endl;
- }
+ win.background().color_set(139, 69, 19, 255);
// Clean exit
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
diff --git a/src/examples/elementary/bg_cxx_example_02.cc b/src/examples/elementary/bg_cxx_example_02.cc
index 5d07172b77..f5bc52223e 100644
--- a/src/examples/elementary/bg_cxx_example_02.cc
+++ b/src/examples/elementary/bg_cxx_example_02.cc
@@ -30,7 +30,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev)
path = "performance/background.png";
efl::ui::Bg_Widget bg(instantiate, win);
- bg.scale_type_set(EFL_IMAGE_SCALE_TYPE_FILL);
+ bg.scale_type_set(EFL_GFX_IMAGE_SCALE_TYPE_FILL);
bg.file_set(path, nullptr);
win.content_set(bg);
diff --git a/src/examples/elementary/button_cxx_example_01.cc b/src/examples/elementary/button_cxx_example_01.cc
index 7de67d3abb..d7a9c67afd 100644
--- a/src/examples/elementary/button_cxx_example_01.cc
+++ b/src/examples/elementary/button_cxx_example_01.cc
@@ -5,7 +5,7 @@
using efl::eo::instantiate;
-efl::Gfx icon_still(nullptr);
+efl::gfx::Entity icon_still(nullptr);
static void
efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
@@ -117,7 +117,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
if (!icon_still)
{
efl::ui::Image obj(instantiate, cmid);
- efl::eina::optional<efl::Gfx> icon_still_p = cmid.content_unset();
+ efl::eina::optional<efl::gfx::Entity> icon_still_p = cmid.content_unset();
if (icon_still_p)
{
icon_still = *icon_still_p;
diff --git a/src/examples/elementary/calendar_cxx_example_04.cc b/src/examples/elementary/calendar_cxx_example_04.cc
index aec44c1295..df9a5a4f12 100644
--- a/src/examples/elementary/calendar_cxx_example_04.cc
+++ b/src/examples/elementary/calendar_cxx_example_04.cc
@@ -1,6 +1,6 @@
#include <Elementary.hh>
-#warning This example can't be implemented with EO APIs... FIXME
+#warning This example can not be implemented with EO APIs... FIXME
using efl::eo::instantiate;
@@ -9,8 +9,10 @@ using efl::eo::instantiate;
static void
efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
{
+#if 0
struct tm selected_time;
time_t current_time;
+#endif
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
diff --git a/src/examples/elementary/calendar_cxx_example_05.cc b/src/examples/elementary/calendar_cxx_example_05.cc
index 8b54d85654..3e6b9f780c 100644
--- a/src/examples/elementary/calendar_cxx_example_05.cc
+++ b/src/examples/elementary/calendar_cxx_example_05.cc
@@ -1,6 +1,6 @@
#include <Elementary.hh>
-#warning This example can't be implemented with EO APIs... FIXME
+#warning This example can not be implemented with EO APIs... FIXME
EAPI_MAIN int
elm_main (int argc EINA_UNUSED, char **argv EINA_UNUSED)
diff --git a/src/examples/elementary/calendar_example_06.c b/src/examples/elementary/calendar_example_06.c
index 61e46a259c..6e25bb87a8 100644
--- a/src/examples/elementary/calendar_example_06.c
+++ b/src/examples/elementary/calendar_example_06.c
@@ -27,12 +27,21 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
Elm_Calendar_Mark *mark;
struct tm selected_time;
time_t current_time;
- struct tm sunday = { 0, 0, 12, 7, 0, 0, 0, 0, -1, 0, NULL };
- /* tm {sec, min, hour, mday, mon, year, wday, yday, isdst } */
- /* weekdays since Sunday, range 0 to 6 */
+ struct tm sunday;
struct tm christmas;
+
+ /*
+ * At least on Windows, tm has 9 fields.
+ * As a workaround, set sunday to 0 and set
+ * th needed fields to correct value
+ */
+ memset(&sunday, 0, sizeof(struct tm));
+ sunday.tm_hour = 12;
+ sunday.tm_mday = 7;
+ sunday.tm_isdst = -1;
+
+ memset(&christmas, 0, sizeof(struct tm));
christmas.tm_mday = 25;
- /* months since Jan, in the range 0 to 11 */
christmas.tm_mon = 11;
win = elm_win_util_standard_add("calendar", "Calendar Marks Example");
diff --git a/src/examples/elementary/codegen_example.edj b/src/examples/elementary/codegen_example.edj
deleted file mode 100644
index 4f87ec8c82..0000000000
--- a/src/examples/elementary/codegen_example.edj
+++ /dev/null
Binary files differ
diff --git a/src/examples/elementary/efl_ui_list_example_1.c b/src/examples/elementary/efl_ui_list_example_1.c
index 488dca0dfb..432c58621c 100644
--- a/src/examples/elementary/efl_ui_list_example_1.c
+++ b/src/examples/elementary/efl_ui_list_example_1.c
@@ -1,4 +1,5 @@
// gcc -o efl_ui_list_example_1 efl_ui_list_example_1.c `pkg-config --cflags --libs elementary`
+// ./efl_ui_list_example_1 item_style_name
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
@@ -14,98 +15,313 @@
#define NUM_ITEMS 400
-const char *styles[] = {
- "odd",
- "even"
- };
+typedef struct _List_Scroll_Data {
+ Eo *list;
+ Eo *slider;
+ Eina_Bool anim;
+} List_Scroll_Data;
+List_Scroll_Data priv_d;
-char edj_path[PATH_MAX];
static void
-_realized_cb(void *data, const Efl_Event *event)
+_list_selected(void *data, const Efl_Event *ev)
{
- Efl_Ui_List_Item_Event *ie = event->info;
- if (!ie->layout) return;
+ Eo *list = ev->object;
+ Eo *item = ev->info, *tmp;
+ printf("list item [%p:%d] is %s\n", item, efl_ui_item_index_get(item), (efl_ui_item_selected_get(item)? "selected" : "unselected"));
- Efl_Ui_Layout *layout = ie->layout;
- elm_object_focus_allow_set(layout, EINA_TRUE);
+ Eina_Iterator *selects = efl_ui_list_selected_items_get(list);
+
+ EINA_ITERATOR_FOREACH(selects, tmp)
+ printf("selected [%p:%d] ", tmp, efl_ui_item_index_get(tmp));
+ printf("\n");
+ eina_iterator_free(selects);
}
-/*
static void
-_unrealized_cb(void *data EINA_UNUSED, const Efl_Event *event)
+_list_unselected(void *data, const Efl_Event *ev)
{
- Efl_Ui_List_Item_Event *ie = event->info;
+ Eo *item = ev->info;
+ printf("list item [%p : %d] is %s\n", item, efl_ui_item_index_get(item), (efl_ui_item_selected_get(item)? "selected" : "unselected"));
+}
- efl_ui_view_model_set(ie->layout, NULL);
- efl_del(ie->layout);
+static void
+_list_pressed(void *data, const Efl_Event *ev)
+{
+ Eo *item = ev->info;
+ printf("list item [%p : %d] is pressed\n", item, efl_ui_item_index_get(item));
}
-*/
-static Efl_Model*
-_make_model()
+
+static void
+_list_unpressed(void *data, const Efl_Event *ev)
{
- Eina_Value vtext, vstyle;
- Efl_Model_Item *model, *child;
- unsigned int i, s;
- char buf[256];
+ Eo *item = ev->info;
+ printf("list item [%p : %d] is unpressed\n", item, efl_ui_item_index_get(item));
+}
- model = efl_add(EFL_MODEL_ITEM_CLASS, NULL);
- eina_value_setup(&vtext, EINA_VALUE_TYPE_STRING);
+static void
+_list_longpressed(void *data, const Efl_Event *ev)
+{
+ Eo *item = ev->info;
+ printf("list item [%p : %d] is longpressed\n", item, efl_ui_item_index_get(item));
+}
- for (i = 0; i < (NUM_ITEMS); i++)
- {
- s = i%2;
- child = efl_model_child_add(model);
- eina_value_set(&vtext, styles[s]);
- efl_model_property_set(child, "odd_style", &vtext);
-
- snprintf(buf, sizeof(buf), "Item # %i", i);
- eina_value_set(&vtext, buf);
- efl_model_property_set(child, "name", &vtext);
- }
-
- eina_value_flush(&vtext);
- return model;
+static void
+_select_radio_changed(void *data, const Efl_Event *ev)
+{
+ Eo *list = data;
+ efl_ui_select_mode_set(list, efl_ui_radio_state_value_get(ev->object));
+}
+
+static void
+_anim_radio_changed(void *data, const Efl_Event *ev)
+{
+ priv_d.anim = efl_ui_radio_state_value_get(ev->object);
+}
+
+static void
+_scrl_btn_clicked(void *data, const Efl_Event *ev)
+{
+ Efl_Ui_List_Item *item = efl_ui_list_last_selected_item_get(priv_d.list);
+ printf("show [%d:%p] [%d]\n", efl_ui_item_index_get(item), item, priv_d.anim);
+ efl_ui_list_item_scroll(priv_d.list, item, priv_d.anim);
+}
+
+static void
+_scrl_align_btn_clicked(void *data, const Efl_Event *ev)
+{
+ Efl_Ui_List_Item *item = efl_ui_list_last_selected_item_get(priv_d.list);
+ double align = efl_ui_range_value_get(priv_d.slider);
+ printf("show [%d:%p] [%.2lf], [%d]\n", efl_ui_item_index_get(item), item, align, priv_d.anim);
+ efl_ui_list_item_scroll_align(priv_d.list, item, align, priv_d.anim);
}
EAPI_MAIN int
elm_main(int argc, char **argv)
{
- Efl_Ui_Layout_Factory *factory;
- Evas_Object *win, *li, *bx, *vbx;
- Eo *model;
+ Eo *win, *list;
+ Eo *wbox, *ibox, *bbox, *rbox;
+ Eo *item, *check, *txt;
+ Eo *radio, *select_radio, *anim_radio;
+ Eo *slider, *scrl_btn;
+ int i;
+ char buf[256];
+ Eina_Bool emptystyle = EINA_FALSE;
- win = elm_win_util_standard_add("viewlist", "Viewlist");
+ win = elm_win_util_standard_add("list", "list");
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
-
elm_win_autodel_set(win, EINA_TRUE);
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(400, 800));
+
+ wbox = efl_add(EFL_UI_BOX_CLASS, win);
+ efl_ui_direction_set(wbox, EFL_UI_DIR_VERTICAL);
+ efl_gfx_size_hint_weight_set(wbox, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND);
+ efl_gfx_size_hint_align_set(wbox, EFL_GFX_SIZE_HINT_FILL, EFL_GFX_SIZE_HINT_FILL);
+
+ if ((argv[1] != NULL) &&
+ (!strcmp(argv[1], "empty")))
+ emptystyle = EINA_TRUE;
+
+ priv_d.list = list = efl_add(EFL_UI_LIST_CLASS, wbox);
+ efl_gfx_size_hint_weight_set(list, EFL_GFX_SIZE_HINT_EXPAND, 0.9);
+
+ efl_event_callback_add(list, EFL_UI_EVENT_SELECTED, _list_selected, NULL);
+ efl_event_callback_add(list, EFL_UI_EVENT_UNSELECTED, _list_unselected, NULL);
+ efl_event_callback_add(list, EFL_UI_EVENT_PRESSED, _list_pressed, NULL);
+ efl_event_callback_add(list, EFL_UI_EVENT_UNPRESSED, _list_unpressed, NULL);
+ efl_event_callback_add(list, EFL_UI_EVENT_LONGPRESSED, _list_longpressed, NULL);
+
+ for (i = 0; i < NUM_ITEMS; i++)
+ {
+ if (emptystyle) item = efl_add(EFL_UI_LIST_EMPTY_ITEM_CLASS, list);
+ else item = efl_add(EFL_UI_LIST_DEFAULT_ITEM_CLASS, list);
+
+ /* disable case test */
+ if (i == 1) efl_ui_widget_disabled_set(item, EINA_TRUE);
+
+ if (emptystyle)
+ {
+ ibox = efl_add(EFL_UI_BOX_CLASS, item);
+ efl_ui_direction_set(ibox, EFL_UI_DIR_HORIZONTAL);
+
+ txt = efl_add(EFL_UI_TEXT_CLASS, ibox);
+ efl_gfx_size_hint_weight_set(txt, 0.95, EFL_GFX_SIZE_HINT_EXPAND);
+ efl_text_halign_set(txt, 0.2);
+ efl_text_interactive_selection_allowed_set(txt, EINA_FALSE);
+ snprintf(buf, sizeof(buf), "empty style item [%d]", i);
+ efl_text_set(txt, buf);
+ efl_pack_end(ibox, txt);
+
+ check = efl_add(EFL_UI_CHECK_CLASS, ibox);
+ efl_gfx_size_hint_weight_set(check, 0.05, EFL_GFX_SIZE_HINT_EXPAND);
+ efl_pack_end(ibox, check);
+
+ if (i % 2)
+ efl_content_set(item, ibox);
+ else
+ efl_content_set(efl_part(item, "content"), ibox);
+ }
+ else
+ {
+ snprintf(buf, sizeof(buf), "default style item [%d]", i);
+ if (i % 2)
+ efl_text_set(efl_part(item, "text"), buf);
+ else
+ efl_text_set(item, buf);
+
+
+ check = efl_add(EFL_UI_CHECK_CLASS, item);
+ if ((i % 3) == 0)
+ efl_content_set(efl_part(item, "end"), check);
+ else if ((i % 3) == 1)
+ efl_content_set(efl_part(item, "icon"), check);
+ else
+ efl_content_set(item, check);
+ }
+ /* Pack APIs test */
+ switch (i)
+ {
+ case 10:
+ efl_gfx_color_set(efl_part(item, "background"), 255, 0, 0, 255);
+ efl_pack_begin(list, item);
+ break;
+
+ case 20:
+ efl_gfx_color_set(efl_part(item, "background"), 0, 255, 0, 255);
+ efl_pack_before(list, item, efl_pack_content_get(list, 19));
+ break;
+
+ case 30:
+ efl_gfx_color_set(efl_part(item, "background"), 0, 0, 255, 255);
+ efl_pack_after(list, item, efl_pack_content_get(list, 29));
+ break;
+
+ case 40:
+ efl_file_set(efl_part(item, "background"), "./sky_01.jpg", NULL);
+ efl_gfx_image_scale_type_set(efl_part(item, "background"), EFL_GFX_IMAGE_SCALE_TYPE_FIT_OUTSIDE);
+ efl_pack_at(list, item, 39);
+ break;
+
+ case 50:
+ efl_file_set(efl_part(item, "background"), "./sky_01.jpg", NULL);
+ efl_gfx_image_scale_type_set(efl_part(item, "background"), EFL_GFX_IMAGE_SCALE_TYPE_TILE);
+ efl_pack(list, item);
+ break;
+
+ case 60:
+ efl_pack(list, item);
+ efl_pack_unpack(list, item);
+ efl_del(item);
+ break;
+
+ default:
+ efl_pack_end(list, item);
+ }
+ }
+
+ efl_pack_end(wbox, list);
+
+ /*select mode */
+ txt = efl_add(EFL_UI_TEXT_CLASS, wbox);
+ efl_gfx_size_hint_weight_set(txt, EFL_GFX_SIZE_HINT_EXPAND, 0.01);
+ efl_text_halign_set(txt, 0.02);
+ efl_text_interactive_selection_allowed_set(txt, EINA_FALSE);
+ efl_text_set(txt, "Select Mode");
+ efl_pack_end(wbox, txt);
+
+ bbox = efl_add(EFL_UI_BOX_CLASS, wbox);
+ efl_ui_direction_set(bbox, EFL_UI_DIR_HORIZONTAL);
+ efl_gfx_size_hint_weight_set(bbox, EFL_GFX_SIZE_HINT_EXPAND, 0.05);
+
+ select_radio = radio = efl_add(EFL_UI_RADIO_CLASS, wbox);
+ efl_text_set(radio, "SINGLE");
+ efl_ui_radio_state_value_set(radio, EFL_UI_SELECT_SINGLE);
+ efl_event_callback_add(radio, EFL_UI_RADIO_EVENT_CHANGED, _select_radio_changed, list);
+ efl_pack_end(bbox, radio);
+ radio = efl_add(EFL_UI_RADIO_CLASS, wbox);
+ efl_text_set(radio, "SINGLE_ALWAYS");
+ efl_ui_radio_state_value_set(radio, EFL_UI_SELECT_SINGLE_ALWAYS);
+ efl_ui_radio_group_add(radio, select_radio);
+ efl_event_callback_add(radio, EFL_UI_RADIO_EVENT_CHANGED, _select_radio_changed, list);
+ efl_pack_end(bbox, radio);
+ radio = efl_add(EFL_UI_RADIO_CLASS, wbox);
+ efl_text_set(radio, "MULTI");
+ efl_ui_radio_state_value_set(radio, EFL_UI_SELECT_MULTI);
+ efl_ui_radio_group_add(radio, select_radio);
+ efl_event_callback_add(radio, EFL_UI_RADIO_EVENT_CHANGED, _select_radio_changed, list);
+ efl_pack_end(bbox, radio);
+ radio = efl_add(EFL_UI_RADIO_CLASS, wbox);
+ efl_text_set(radio, "NONE");
+ efl_ui_radio_state_value_set(radio, EFL_UI_SELECT_NONE);
+ efl_ui_radio_group_add(radio, select_radio);
+ efl_event_callback_add(radio, EFL_UI_RADIO_EVENT_CHANGED, _select_radio_changed, list);
+ efl_pack_end(bbox, radio);
+ efl_pack_end(wbox, bbox);
+
+ /* scroll mode */
+ txt = efl_add(EFL_UI_TEXT_CLASS, wbox);
+ efl_gfx_size_hint_weight_set(txt, EFL_GFX_SIZE_HINT_EXPAND, 0.01);
+ efl_text_interactive_selection_allowed_set(txt, EINA_FALSE);
+ efl_text_halign_set(txt, 0.02);
+ efl_text_set(txt, "Item Scroll");
+ efl_pack_end(wbox, txt);
+
+ priv_d.slider = slider = efl_add(EFL_UI_SLIDER_CLASS, wbox);
+ efl_ui_direction_set(slider, EFL_UI_DIR_HORIZONTAL);
+ efl_gfx_size_hint_weight_set(slider, 0.0, 0.05);
+ efl_gfx_size_hint_align_set(slider, 0.5, 0.5);
+ efl_gfx_size_hint_min_set(slider, EINA_SIZE2D(380, 20));
+ efl_ui_range_min_max_set(slider, 0.0, 1.0);
+ efl_pack_end(wbox, slider);
+
+ bbox = efl_add(EFL_UI_BOX_CLASS, wbox);
+ efl_ui_direction_set(bbox, EFL_UI_DIR_HORIZONTAL);
+ efl_gfx_size_hint_weight_set(bbox, EFL_GFX_SIZE_HINT_EXPAND, 0.05);
+
+ rbox = efl_add(EFL_UI_BOX_CLASS, bbox);
+ efl_ui_direction_set(rbox, EFL_UI_DIR_VERTICAL);
- model = _make_model();
+ anim_radio = radio = efl_add(EFL_UI_RADIO_CLASS, rbox);
+ efl_gfx_size_hint_align_set(radio, 0.5, 0.5);
+ efl_text_set(radio, "ANIMATION OFF");
+ efl_ui_radio_state_value_set(radio, 0);
+ efl_event_callback_add(radio, EFL_UI_RADIO_EVENT_CHANGED, _anim_radio_changed, NULL);
+ efl_pack_end(rbox, radio);
+ radio = efl_add(EFL_UI_RADIO_CLASS, rbox);
+ efl_gfx_size_hint_align_set(radio, 0.5, 0.5);
+ efl_text_set(radio, "ANIMATION ON");
+ efl_ui_radio_state_value_set(radio, 1);
+ efl_ui_radio_group_add(radio, anim_radio);
+ efl_event_callback_add(radio, EFL_UI_RADIO_EVENT_CHANGED, _anim_radio_changed, NULL);
+ efl_pack_end(rbox, radio);
+ efl_pack_end(bbox, rbox);
- factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win);
- efl_ui_model_connect(factory, "signal/elm,state,%v", "odd_style");
- efl_ui_model_connect(factory, "elm.text", "name");
- efl_ui_layout_factory_theme_config(factory, "list", "item", "default");
+ rbox = efl_add(EFL_UI_BOX_CLASS, bbox);
+ efl_ui_direction_set(rbox, EFL_UI_DIR_VERTICAL);
- li = efl_add(EFL_UI_LIST_CLASS, win);
- efl_ui_list_layout_factory_set(li, factory);
- efl_ui_view_model_set(li, model);
- elm_box_pack_end(bx, li);
+ scrl_btn = efl_add(EFL_UI_BUTTON_CLASS, rbox);
+ efl_text_set(scrl_btn, "Scroll Item");
+ efl_gfx_size_hint_align_set(scrl_btn, 0.5, 0.5);
+ efl_gfx_size_hint_min_set(scrl_btn, EINA_SIZE2D(200, 25));
+ efl_event_callback_add(scrl_btn, EFL_UI_EVENT_CLICKED, _scrl_btn_clicked, NULL);
+ efl_pack_end(rbox, scrl_btn);
- efl_event_callback_add(li, EFL_UI_LIST_EVENT_ITEM_REALIZED, _realized_cb, NULL);
-// efl_event_callback_add(li, EFL_UI_LIST_EVENT_ITEM_UNREALIZED, _unrealized_cb, NULL);
+ scrl_btn = efl_add(EFL_UI_BUTTON_CLASS, rbox);
+ efl_text_set(scrl_btn, "Scroll Item Align");
+ efl_gfx_size_hint_align_set(scrl_btn, 0.5, 0.5);
+ efl_gfx_size_hint_min_set(scrl_btn, EINA_SIZE2D(200, 25));
+ efl_event_callback_add(scrl_btn, EFL_UI_EVENT_CLICKED, _scrl_align_btn_clicked, NULL);
+ efl_pack_end(rbox, scrl_btn);
- elm_win_resize_object_add(win, li);
- evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ efl_pack_end(bbox, rbox);
+ efl_pack_end(wbox, bbox);
- //showall
- evas_object_show(li);
- evas_object_resize(win, 320, 320);
- evas_object_show(win);
+ elm_win_resize_object_add(win, wbox);
+ //window show
+ efl_gfx_entity_visible_set(win, EINA_TRUE);
elm_run();
return 0;
}
-ELM_MAIN()
+ELM_MAIN() \ No newline at end of file
diff --git a/src/examples/elementary/efl_ui_scroller_example.c b/src/examples/elementary/efl_ui_scroller_example.c
index b09756c272..4de4d216a3 100644
--- a/src/examples/elementary/efl_ui_scroller_example.c
+++ b/src/examples/elementary/efl_ui_scroller_example.c
@@ -15,9 +15,9 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev)
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
elm_app_info_set(efl_main, "elementary", "images/plant_01.jpg");
- win = efl_add(EFL_UI_WIN_CLASS, NULL, "TEST", ELM_WIN_BASIC,
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, "TEST", ELM_WIN_BASIC,
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
- efl_gfx_size_set(win, EINA_SIZE2D(300, 400));
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(300, 400));
scroller = efl_add(EFL_UI_SCROLLER_CLASS, win);
efl_content_set(win, scroller);
@@ -25,7 +25,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev)
content = efl_add(EFL_UI_IMAGE_CLASS, scroller);
snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
efl_file_set(content, buf, NULL);
- efl_gfx_size_set(content, EINA_SIZE2D(5000, 5000));
+ efl_gfx_entity_size_set(content, EINA_SIZE2D(5000, 5000));
efl_content_set(scroller, content);
}
EFL_MAIN()
diff --git a/src/examples/elementary/efl_ui_slider_mono.cs b/src/examples/elementary/efl_ui_slider_mono.cs
index a5aff11547..62b3504fcd 100644
--- a/src/examples/elementary/efl_ui_slider_mono.cs
+++ b/src/examples/elementary/efl_ui_slider_mono.cs
@@ -2,57 +2,71 @@ using System;
public class Example
{
- public static efl.ui.Button CreateButton(efl.Object parent,
+ public static efl.ui.IButton CreateButton(efl.IObject parent,
string text,
int w, int h,
EventHandler callback) {
- efl.ui.Button button = new efl.ui.ButtonConcrete(parent);
+ efl.ui.IButton button = new efl.ui.Button(parent);
button.SetText(text);
- button.SetSize(w, h);
+ button.SetSize(new eina.Size2D(w, h));
- button.CLICKED += callback;
+ button.ClickedEvt += callback;
return button;
}
+ public static void Formatter(eina.Strbuf buf, eina.Value val){
+ double ratio;
+ if (val.Get(out ratio)) {
+ buf.Append($"{(int)(ratio*100)}%");
+ } else {
+ buf.Append("Error");
+ }
+ }
+
+
#if WIN32 // Passed to the C# compiler with -define:WIN32
// Mono on Windows by default uses multi-thread apartments for COM stuff while
// OLE - used by ecore win32 DnD requires single threading for COM.
[STAThreadAttribute()]
#endif
public static void Main() {
+ int W = 120;
+ int H = 30;
+
efl.All.Init(efl.Components.Ui);
- efl.ui.Win win = new efl.ui.WinConcrete(null);
+ efl.ui.Win win = new efl.ui.Win(null);
win.SetText("Hello, C#!!");
win.SetAutohide(true);
- efl.ui.Box_Flow box = new efl.ui.Box_FlowConcrete(win);
+ efl.ui.Box_Flow box = new efl.ui.Box_Flow(win);
- efl.ui.Button button = CreateButton(box, "Click to exit", 120, 30,
+ efl.ui.IButton button = CreateButton(box, "Click to exit", 120, 30,
(object sender, EventArgs e) => {
efl.ui.Config.Exit();
});
- box.Pack(button);
+ box.DoPack(button);
- efl.ui.Progressbar bar = new efl.ui.ProgressbarConcrete(box);
- bar.SetSize(120, 30);
+ efl.ui.Progressbar bar = new efl.ui.Progressbar(box);
+ bar.SetSize(new eina.Size2D(W, H));
+ bar.SetFormatCb(Formatter);
- efl.ui.Slider slider = new efl.ui.SliderConcrete(box);
- slider.SetSize(120, 30);
+ efl.ui.ISlider slider = new efl.ui.Slider(box);
+ slider.SetSize(new eina.Size2D(W, H));
- slider.CHANGED += (object sender, EventArgs e) => {
+ slider.ChangedEvt += (object sender, EventArgs e) => {
bar.SetRangeValue(slider.GetRangeValue());
};
- box.Pack(bar);
- box.Pack(slider);
+ box.DoPack(bar);
+ box.DoPack(slider);
button.SetVisible(true);
box.SetVisible(true);
- win.SetSize(120, 90);
+ win.SetSize(new eina.Size2D(W, 3 * H));
win.SetVisible(true);
efl.ui.Config.Run();
diff --git a/src/examples/elementary/efl_ui_unit_converter.cs b/src/examples/elementary/efl_ui_unit_converter.cs
index f167e68ca2..09c9b24d25 100644
--- a/src/examples/elementary/efl_ui_unit_converter.cs
+++ b/src/examples/elementary/efl_ui_unit_converter.cs
@@ -16,16 +16,16 @@ public class Example
private static void ShowErrorPopup(efl.ui.Win win, string message)
{
- efl.ui.Popup_Alert popup = new efl.ui.Popup_AlertConcrete(win);
- efl.ui.Text popup_text = new efl.ui.TextConcrete(popup);
+ efl.ui.IPopup_Alert popup = new efl.ui.Popup_Alert(win);
+ efl.ui.Text popup_text = new efl.ui.Text(popup);
popup_text.SetText($"Error: {message}");
popup.SetContent(popup_text);
popup.SetVisible(true);
- popup.SetButton(efl.ui.popup_alert.Button.Positive, "Ok");
- popup.SetSize(150, 30);
- popup.CLICKED += (object sender, efl.ui.CLICKED_Args e) => {
+ popup.SetButton(efl.ui.Popup_Alert_Button.Positive, "Ok");
+ popup.SetSize(new eina.Size2D(150, 30));
+ popup.ButtonClickedEvt += (object sender, efl.ui.Popup_Alert.ButtonClickedEvt_Args e) => {
popup.SetParent(null);
- popup.Del();
+ popup.Invalidate();
};
}
@@ -35,67 +35,71 @@ public class Example
[STAThreadAttribute()]
#endif
public static void Main() {
+ int W = 120;
+ int H = 30;
+ eina.Size2D size = new eina.Size2D(W, H);
+
efl.All.Init(efl.Components.Ui);
- efl.ui.Win win = new efl.ui.WinConcrete(null);
+ efl.ui.Win win = new efl.ui.Win(null);
win.SetText("C# Unit Converter");
win.SetAutohide(true);
- efl.ui.Box_Flow box = new efl.ui.Box_FlowConcrete(win);
+ efl.ui.Box_Flow box = new efl.ui.Box_Flow(win);
box.SetDirection(efl.ui.Dir.Horizontal);
- efl.ui.Box_Flow miles_box = new efl.ui.Box_FlowConcrete(box);
+ efl.ui.Box_Flow miles_box = new efl.ui.Box_Flow(box);
miles_box.SetDirection(efl.ui.Dir.Down);
- box.Pack(miles_box);
+ box.DoPack(miles_box);
- efl.ui.Text miles_label = new efl.ui.TextConcrete(miles_box);
+ efl.ui.Text miles_label = new efl.ui.Text(miles_box);
miles_label.SetText("Miles:");
- miles_label.SetSize(120, 30);
+ miles_label.SetSize(size);
miles_label.SetVisible(true);
- efl.ui.text.Editable miles_input = new efl.ui.text.EditableConcrete(miles_box);
+ efl.ui.Text_Editable miles_input = new efl.ui.Text_Editable(miles_box);
miles_input.SetText("");
miles_input.SetScrollable(true);
- miles_input.SetSize(120, 30);
+ miles_input.SetSize(size);
miles_input.SetVisible(true);
- efl.ui.Button miles_button = new efl.ui.ButtonConcrete(miles_box);
+ efl.ui.IButton miles_button = new efl.ui.Button(miles_box);
miles_button.SetText("To Km");
- miles_button.SetSize(120, 30);
+ miles_button.SetSize(size);
miles_button.SetVisible(true);
- miles_box.Pack(miles_label);
- miles_box.Pack(miles_input);
- miles_box.Pack(miles_button);
+ miles_box.DoPack(miles_label);
+ miles_box.DoPack(miles_input);
+ miles_box.DoPack(miles_button);
- efl.ui.Box_Flow kms_box = new efl.ui.Box_FlowConcrete(box);
+ efl.ui.Box_Flow kms_box = new efl.ui.Box_Flow(box);
kms_box.SetDirection(efl.ui.Dir.Down);
- box.Pack(kms_box);
+ box.DoPack(kms_box);
- efl.ui.Text kms_label = new efl.ui.TextConcrete(kms_box);
+ efl.ui.Text kms_label = new efl.ui.Text(kms_box);
kms_label.SetText("Kilometers:");
- kms_label.SetSize(120, 30);
+ kms_label.SetSize(size);
kms_label.SetVisible(true);
- efl.ui.text.Editable kms_input = new efl.ui.text.EditableConcrete(kms_box);
+ efl.ui.Text_Editable kms_input = new efl.ui.Text_Editable(kms_box);
kms_input.SetText("");
kms_input.SetScrollable(true);
- kms_input.SetSize(120, 30);
+ kms_input.SetSize(size);
kms_input.SetVisible(true);
- efl.ui.Button kms_button = new efl.ui.ButtonConcrete(kms_box);
+ efl.ui.IButton kms_button = new efl.ui.Button(kms_box);
kms_button.SetText("To Miles");
- kms_button.SetSize(120, 30);
+ kms_button.SetSize(size);
kms_button.SetVisible(true);
- kms_box.Pack(kms_label);
- kms_box.Pack(kms_input);
- kms_box.Pack(kms_button);
+ kms_box.DoPack(kms_label);
+ kms_box.DoPack(kms_input);
+ kms_box.DoPack(kms_button);
- kms_button.CLICKED += (object sender, EventArgs e) => {
+ kms_button.ClickedEvt += (object sender, EventArgs e) => {
try
{
string text = kms_input.GetText();
@@ -111,7 +115,7 @@ public class Example
}
};
- miles_button.CLICKED += (object sender, EventArgs e) => {
+ miles_button.ClickedEvt += (object sender, EventArgs e) => {
try
{
string text = miles_input.GetText();
@@ -130,18 +134,12 @@ public class Example
kms_box.SetVisible(true);
miles_box.SetVisible(true);
- eina.Position2D pos;
-
- pos.X = 20;
- pos.Y = 30;
- box.SetPosition(pos);
+ box.SetPosition(new eina.Position2D(20, 30));
box.SetVisible(true);
- pos.X = 200;
- pos.Y = 200;
- win.SetPosition(pos);
+ win.SetPosition(new eina.Position2D(200, 200));
- win.SetSize(400,120);
+ win.SetSize(new eina.Size2D(400, 120));
win.SetVisible(true);
efl.ui.Config.Run();
diff --git a/src/examples/elementary/efl_ui_list_example.edc b/src/examples/elementary/efl_ui_view_list_example.edc
index 3b46863b71..75bafe1b83 100644
--- a/src/examples/elementary/efl_ui_list_example.edc
+++ b/src/examples/elementary/efl_ui_view_list_example.edc
@@ -9,8 +9,8 @@
collections {
group {
- name: "elm/list/item/custom";
- alias: "elm/list/item/default";
+ name: "efl/list_item:custom";
+ alias: "efl/list_item";
data.item: "selectraise" "on";
data.item: "focusraise" "on";
parts {
@@ -34,12 +34,12 @@ group {
}
}
program {
- signal: "elm,state,odd"; source: "elm";
+ signal: "efl,state,odd"; source: "efl";
action: STATE_SET "odd" 1.0;
target: "base";
}
program {
- signal: "elm,state,even"; source: "elm";
+ signal: "efl,state,even"; source: "efl";
action: STATE_SET "default" 0.0;
target: "base";
}
@@ -74,41 +74,41 @@ group {
}
}
program {
- signal: "elm,state,selected"; source: "elm";
+ signal: "efl,state,selected"; source: "efl";
action: STATE_SET "selected" 0.0;
target: "sel_shadow";
target: "sel_base";
target: "sel_bevel";
}
program {
- signal: "elm,state,unselected"; source: "elm";
+ signal: "efl,state,unselected"; source: "efl";
action: STATE_SET "default" 0.0;
target: "sel_shadow";
target: "sel_base";
target: "sel_bevel";
}
program {
- signal: "elm,state,disabled"; source: "elm";
+ signal: "efl,state,disabled"; source: "efl";
action: STATE_SET "disabled" 0.0;
target: "event";
}
program {
- signal: "elm,state,enabled"; source: "elm";
+ signal: "efl,state,enabled"; source: "efl";
action: STATE_SET "default" 0.0;
target: "event";
}
//##//
- part { name: "elm.text"; type: TEXT; mouse_events: 0;
+ part { name: "efl.text"; type: TEXT; mouse_events: 0;
effect: SHADOW BOTTOM;
scale: 1;
description { state: "default" 0.0;
rel1.offset: 2 3;
rel1.relative: 1.0 0.0;
- rel1.to_x: "elm.swallow.icon";
+ rel1.to_x: "efl.icon";
rel2.offset: -3 -3;
rel2.relative: 0.0 1.0;
- rel2.to_x: "elm.swallow.end";
+ rel2.to_x: "efl.end";
color: FN_COL_DEFAULT;
color_class: "list_item";
text { font: FN; size: 10;
@@ -131,12 +131,12 @@ group {
effect: SHADOW BOTTOM;
scale: 1;
description { state: "default" 0.0;
- rel1.to: "elm.text";
- rel2.to: "elm.text";
+ rel1.to: "efl.text";
+ rel2.to: "efl.text";
color: FN_COL_DISABLE;
color_class: "list_item_disabled";
text { font: FN; size: 10;
- text_source: "elm.text";
+ text_source: "efl.text";
align: 0.0 0.5;
text_class: "list_item";
}
@@ -156,13 +156,13 @@ group {
scale: 1;
description { state: "default" 0.0;
rel1.offset: -2 -3;
- rel1.to: "elm.text";
+ rel1.to: "efl.text";
rel2.offset: 1 1;
- rel2.to: "elm.text";
+ rel2.to: "efl.text";
color: FN_COL_HIGHLIGHT;
color_class: "list_item_selected";
text { font: FN; size: 10;
- text_source: "elm.text";
+ text_source: "efl.text";
align: 0.0 0.5;
text_class: "list_item";
}
@@ -178,35 +178,35 @@ group {
}
}
program {
- signal: "elm,state,selected"; source: "elm";
+ signal: "efl,state,selected"; source: "efl";
action: STATE_SET "selected" 0.0;
- target: "elm.text";
+ target: "efl.text";
target: "label2";
target: "label3";
}
program {
- signal: "elm,state,unselected"; source: "elm";
+ signal: "efl,state,unselected"; source: "efl";
action: STATE_SET "default" 0.0;
- target: "elm.text";
+ target: "efl.text";
target: "label2";
target: "label3";
}
program {
- signal: "elm,state,disabled"; source: "elm";
+ signal: "efl,state,disabled"; source: "efl";
action: STATE_SET "disabled" 0.0;
- target: "elm.text";
+ target: "efl.text";
target: "label2";
target: "label3";
}
program {
- signal: "elm,state,enabled"; source: "elm";
+ signal: "efl,state,enabled"; source: "efl";
action: STATE_SET "default" 0.0;
- target: "elm.text";
+ target: "efl.text";
target: "label2";
target: "label3";
}
//##//
- part { name: "elm.swallow.icon"; type: SWALLOW;
+ part { name: "efl.icon"; type: SWALLOW;
description { state: "default" 0.0;
fixed: 1 0;
align: 0.0 0.5;
@@ -216,7 +216,7 @@ group {
rel2.offset: 2 -3;
}
}
- part { name: "elm.swallow.end"; type: SWALLOW;
+ part { name: "efl.end"; type: SWALLOW;
description { state: "default" 0.0;
fixed: 1 0;
align: 1.0 0.5;
@@ -254,22 +254,22 @@ group {
}
}
program {
- signal: "elm,state,selected"; source: "elm";
+ signal: "efl,state,selected"; source: "efl";
action: STATE_SET "selected" 0.0;
target: "sel_shine";
}
program {
- signal: "elm,state,unselected"; source: "elm";
+ signal: "efl,state,unselected"; source: "efl";
action: STATE_SET "default" 0.0;
target: "sel_shine";
}
program {
- signal: "elm,state,disabled"; source: "elm";
+ signal: "efl,state,disabled"; source: "efl";
action: STATE_SET "disabled" 0.0;
target: "event_block";
}
program {
- signal: "elm,state,enabled"; source: "elm";
+ signal: "efl,state,enabled"; source: "efl";
action: STATE_SET "default" 0.0;
target: "event_block";
}
diff --git a/src/examples/elementary/efl_ui_view_list_example_1.c b/src/examples/elementary/efl_ui_view_list_example_1.c
new file mode 100644
index 0000000000..86b854261b
--- /dev/null
+++ b/src/examples/elementary/efl_ui_view_list_example_1.c
@@ -0,0 +1,111 @@
+// gcc -o efl_ui_view_list_example_1 efl_ui_view_list_example_1.c `pkg-config --cflags --libs elementary`
+
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#else
+# define EFL_BETA_API_SUPPORT 1
+# define EFL_EO_API_SUPPORT 1
+#endif
+
+#include <Elementary.h>
+#include <Efl.h>
+#include <Eio.h>
+#include <stdio.h>
+
+#define NUM_ITEMS 400
+
+const char *styles[] = {
+ "odd",
+ "even"
+ };
+
+char edj_path[PATH_MAX];
+
+static void
+_realized_cb(void *data, const Efl_Event *event)
+{
+ Efl_Ui_View_List_Item_Event *ie = event->info;
+ if (!ie->layout) return;
+
+ Efl_Ui_Layout_Object *layout = ie->layout;
+ elm_object_focus_allow_set(layout, EINA_TRUE);
+}
+
+/*
+static void
+_unrealized_cb(void *data EINA_UNUSED, const Efl_Event *event)
+{
+ Efl_Ui_View_List_Item_Event *ie = event->info;
+
+ efl_ui_view_model_set(ie->layout, NULL);
+ efl_del(ie->layout);
+}
+*/
+static Efl_Model*
+_make_model(Evas_Object *win)
+{
+ Eina_Value vtext;
+ Efl_Model_Item *model, *child;
+ unsigned int i, s;
+ char buf[256];
+
+ model = efl_add(EFL_MODEL_ITEM_CLASS, win);
+ eina_value_setup(&vtext, EINA_VALUE_TYPE_STRING);
+
+ for (i = 0; i < (NUM_ITEMS); i++)
+ {
+ s = i%2;
+ child = efl_model_child_add(model);
+ eina_value_set(&vtext, styles[s]);
+ efl_model_property_set(child, "odd_style", &vtext);
+
+ snprintf(buf, sizeof(buf), "Item # %i", i);
+ eina_value_set(&vtext, buf);
+ efl_model_property_set(child, "name", &vtext);
+ }
+
+ eina_value_flush(&vtext);
+ return model;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+ Efl_Ui_Layout_Factory *factory;
+ Evas_Object *win, *li;
+ Eo *model;
+
+ win = elm_win_util_standard_add("viewlist", "Viewlist");
+ elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
+
+ elm_win_autodel_set(win, EINA_TRUE);
+
+ model = _make_model(win);
+
+ factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win);
+ efl_ui_model_connect(factory, "signal/elm,state,%v", "odd_style");
+ efl_ui_model_connect(factory, "efl.text", "name");
+ efl_ui_layout_factory_theme_config(factory, "list_item", NULL, "default");
+
+ li = efl_add(EFL_UI_VIEW_LIST_CLASS, win);
+ efl_ui_view_list_layout_factory_set(li, factory);
+ efl_ui_view_model_set(li, model);
+
+ efl_event_callback_add(li, EFL_UI_VIEW_LIST_EVENT_ITEM_REALIZED, _realized_cb, NULL);
+// efl_event_callback_add(li, EFL_UI_VIEW_LIST_EVENT_ITEM_UNREALIZED, _unrealized_cb, NULL);
+
+ elm_win_resize_object_add(win, li);
+ evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ //showall
+ evas_object_show(li);
+ evas_object_resize(win, 320, 320);
+ evas_object_show(win);
+
+ elm_run();
+ efl_unref(model);
+
+ return 0;
+}
+ELM_MAIN()
diff --git a/src/examples/elementary/efl_ui_list_example_2.c b/src/examples/elementary/efl_ui_view_list_example_2.c
index 9f37e322e5..de4d259962 100644
--- a/src/examples/elementary/efl_ui_list_example_2.c
+++ b/src/examples/elementary/efl_ui_view_list_example_2.c
@@ -1,4 +1,4 @@
-// gcc -o efl_ui_list_example_2 efl_ui_list_example_2.c `pkg-config --cflags --libs elementary`
+// gcc -o efl_ui_view_list_example_2 efl_ui_view_list_example_2.c `pkg-config --cflags --libs elementary`
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -17,14 +17,14 @@
static void
_realized_cb(void *data, const Efl_Event *event)
{
- Efl_Ui_List_Item_Event *ie = event->info;
+ Efl_Ui_View_List_Item_Event *ie = event->info;
Eo *imf = data;
printf("realize %d\n", ie->index);
evas_object_size_hint_weight_set(ie->layout, EVAS_HINT_EXPAND, 0);
evas_object_size_hint_align_set(ie->layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
- efl_ui_model_factory_connect(ie->layout, "elm.swallow.icon", imf);
+ efl_ui_factory_model_connect(ie->layout, "efl.icon", imf);
}
EAPI_MAIN int
@@ -43,13 +43,13 @@ elm_main(int argc, char **argv)
if (argv[1] != NULL) dirname = argv[1];
else dirname = EFL_MODEL_TEST_FILENAME_PATH;
- model = efl_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(efl_added, dirname));
+ model = efl_add(EIO_MODEL_CLASS, win, eio_model_path_set(efl_added, dirname));
factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win);
- efl_ui_model_connect(factory, "elm.text", "filename");
- efl_ui_layout_factory_theme_config(factory, "list", "item", "default");
+ efl_ui_model_connect(factory, "efl.text", "filename");
+ efl_ui_layout_factory_theme_config(factory, "list_item", NULL, "default");
- li = efl_add(EFL_UI_LIST_CLASS, win);
- efl_ui_list_layout_factory_set(li, factory);
+ li = efl_add(EFL_UI_VIEW_LIST_CLASS, win);
+ efl_ui_view_list_layout_factory_set(li, factory);
efl_ui_view_model_set(li, model);
evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -58,7 +58,7 @@ elm_main(int argc, char **argv)
imf = efl_add(EFL_UI_IMAGE_FACTORY_CLASS, win);
efl_ui_model_connect(imf, "", "path"); //connect to "path" property
- efl_event_callback_add(li, EFL_UI_LIST_EVENT_ITEM_REALIZED, _realized_cb, imf);
+ efl_event_callback_add(li, EFL_UI_VIEW_LIST_EVENT_ITEM_REALIZED, _realized_cb, imf);
elm_win_resize_object_add(win, li);
diff --git a/src/examples/elementary/efl_ui_list_example_3.c b/src/examples/elementary/efl_ui_view_list_example_3.c
index 3b35ec3528..9e7507fc9b 100644
--- a/src/examples/elementary/efl_ui_list_example_3.c
+++ b/src/examples/elementary/efl_ui_view_list_example_3.c
@@ -1,4 +1,4 @@
-// gcc -o efl_ui_list_example_3 efl_ui_list_example_3.c `pkg-config --cflags --libs elementary`
+// gcc -o efl_ui_view_list_example_3 efl_ui_view_list_example_3.c `pkg-config --cflags --libs elementary`
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -59,7 +59,10 @@ static void
_focused(void *data, const Efl_Event *event)
{
Priv_Data *priv = (Priv_Data*)data;
- priv->selected = efl_ui_focus_manager_focus_get(event->object);
+ Evas_Object *focused = efl_ui_focus_manager_focus_get(event->object);
+
+ if (focused)
+ priv->selected = focused;
}
static void
@@ -110,21 +113,21 @@ static void
_bt_none_clicked(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
{
Evas_Object *li = data;
- efl_ui_list_select_mode_set(li, ELM_OBJECT_SELECT_MODE_NONE);
+ efl_ui_view_list_select_mode_set(li, ELM_OBJECT_SELECT_MODE_NONE);
}
static void
_bt_donly_clicked(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
{
Evas_Object *li = data;
- efl_ui_list_select_mode_set(li, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+ efl_ui_view_list_select_mode_set(li, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
}
static void
_bt_default_clicked(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
{
Evas_Object *li = data;
- efl_ui_list_select_mode_set(li, ELM_OBJECT_SELECT_MODE_DEFAULT);
+ efl_ui_view_list_select_mode_set(li, ELM_OBJECT_SELECT_MODE_DEFAULT);
}
static void
@@ -143,24 +146,24 @@ _bt_unset_clicked(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
static void
_realized_1_cb(void *data EINA_UNUSED, const Efl_Event *event)
{
- Efl_Ui_List_Item_Event *ie = event->info;
+ Efl_Ui_View_List_Item_Event *ie = event->info;
evas_object_size_hint_weight_set(ie->layout, EVAS_HINT_EXPAND, 0);
evas_object_size_hint_align_set(ie->layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
- efl_ui_model_connect(ie->layout, "elm.text", "name");
- efl_ui_model_connect(ie->layout, "signal/elm,state,%v", "odd_style");
+ efl_ui_model_connect(ie->layout, "efl.text", "name");
+ efl_ui_model_connect(ie->layout, "signal/efl,state,%v", "odd_style");
}
static void
_realized_2_cb(void *data EINA_UNUSED, const Efl_Event *event)
{
- Efl_Ui_List_Item_Event *ie = event->info;
+ Efl_Ui_View_List_Item_Event *ie = event->info;
printf("relized 2\n");
elm_object_focus_allow_set(ie->layout, EINA_TRUE);
evas_object_size_hint_weight_set(ie->layout, EVAS_HINT_EXPAND, 0);
evas_object_size_hint_align_set(ie->layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
- efl_ui_model_connect(ie->layout, "elm.text", "occupation");
+ efl_ui_model_connect(ie->layout, "efl.text", "occupation");
}
static Efl_Model*
@@ -170,7 +173,7 @@ _make_model()
Efl_Model_Item *model, *child;
unsigned int i, len;
- model = efl_add(EFL_MODEL_ITEM_CLASS, NULL);
+ model = efl_add(EFL_MODEL_ITEM_CLASS, efl_main_loop_get());
eina_value_setup(&vtext, EINA_VALUE_TYPE_STRING);
eina_value_setup(&value, EINA_VALUE_TYPE_UCHAR);
@@ -219,25 +222,25 @@ elm_main(int argc, char **argv)
priv->model = _make_model();
factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win);
- efl_ui_model_connect(factory, "elm.text", "filename");
- efl_ui_layout_factory_theme_config(factory, "list", "item", "default");
+ efl_ui_model_connect(factory, "efl.text", "filename");
+ efl_ui_layout_factory_theme_config(factory, "list_item", NULL, "default");
- priv->list1 = efl_add(EFL_UI_LIST_CLASS, win, efl_ui_view_model_set(efl_added, priv->model));
- efl_event_callback_add(priv->list1, EFL_UI_LIST_EVENT_ITEM_REALIZED, _realized_1_cb, priv);
+ priv->list1 = efl_add(EFL_UI_VIEW_LIST_CLASS, win, efl_ui_view_model_set(efl_added, priv->model));
+ efl_event_callback_add(priv->list1, EFL_UI_VIEW_LIST_EVENT_ITEM_REALIZED, _realized_1_cb, priv);
evas_object_size_hint_weight_set(priv->list1, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(priv->list1, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(bx, priv->list1);
- efl_ui_list_layout_factory_set(priv->list1, factory);
+ efl_ui_view_list_layout_factory_set(priv->list1, factory);
factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win);
- efl_ui_model_connect(factory, "elm.text", "filename");
- efl_ui_model_connect(factory, "signal/elm,state,%v", "selected");
- efl_ui_layout_factory_theme_config(factory, "list", "item", "default");
- priv->list2 = efl_add(EFL_UI_LIST_CLASS, win, efl_ui_view_model_set(efl_added, priv->model));
- efl_event_callback_add(priv->list2, EFL_UI_LIST_EVENT_ITEM_REALIZED, _realized_2_cb, priv->list2);
+ efl_ui_model_connect(factory, "efl.text", "filename");
+ efl_ui_model_connect(factory, "signal/efl,state,%v", "selected");
+ efl_ui_layout_factory_theme_config(factory, "list_item", NULL, "default");
+ priv->list2 = efl_add(EFL_UI_VIEW_LIST_CLASS, win, efl_ui_view_model_set(efl_added, priv->model));
+ efl_event_callback_add(priv->list2, EFL_UI_VIEW_LIST_EVENT_ITEM_REALIZED, _realized_2_cb, priv->list2);
evas_object_size_hint_weight_set(priv->list2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(priv->list2, EVAS_HINT_FILL, EVAS_HINT_FILL);
- efl_ui_list_layout_factory_set(priv->list2, factory);
+ efl_ui_view_list_layout_factory_set(priv->list2, factory);
vbx = elm_box_add(win);
elm_box_pack_end(bx, vbx);
diff --git a/src/examples/elementary/evas3d_map_example.c b/src/examples/elementary/evas3d_map_example.c
index d71017858a..5426d30966 100644
--- a/src/examples/elementary/evas3d_map_example.c
+++ b/src/examples/elementary/evas3d_map_example.c
@@ -881,7 +881,7 @@ skybox_setup(void)
evas_canvas3d_material_color_set(skybox_material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 0.1, 0.1, 0.1, 1.0);
evas_canvas3d_material_shininess_set(skybox_material, 50.0);
- skybox_mesh_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ skybox_mesh_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_member_add(root_node, skybox_mesh_node);
evas_canvas3d_node_mesh_add(skybox_mesh_node, skybox_mesh);
evas_canvas3d_mesh_shader_mode_set(skybox_mesh, EVAS_CANVAS3D_SHADER_MODE_DIFFUSE);
@@ -940,7 +940,7 @@ camera_setup(void)
camera_right_vec.y = 0.0;
camera_right_vec.z = 0.0;
- camera_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
+ camera_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
evas_canvas3d_node_camera_set(camera_node, camera);
evas_canvas3d_node_position_set(camera_node, camera_pos.x, camera_pos.y, camera_pos.z);
evas_canvas3d_node_look_at_set(camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, camera_up_vec.x, camera_up_vec.y, camera_up_vec.z);
@@ -955,7 +955,7 @@ light_setup(void)
evas_canvas3d_light_diffuse_set(light, 1.0, 1.0, 1.0, 1.0);
evas_canvas3d_light_specular_set(light, 0.2, 0.2, 0.2, 1.0);
- light_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
+ light_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
evas_canvas3d_node_light_set(light_node, light);
evas_canvas3d_node_position_set(light_node, 0.0, 0.0, MAX_CAMERA_DISTANCE);
evas_canvas3d_node_look_at_set(light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -1001,7 +1001,7 @@ mesh_setup(void)
evas_canvas3d_material_color_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 0.1, 0.1, 0.1, 1.0);
evas_canvas3d_material_shininess_set(material, 50.0);
- mesh_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ mesh_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_member_add(root_node, mesh_node);
evas_canvas3d_node_mesh_add(mesh_node, mesh);
evas_canvas3d_mesh_shader_mode_set(mesh, EVAS_CANVAS3D_SHADER_MODE_NORMAL_MAP);
@@ -1169,7 +1169,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
scene = efl_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
/* Add a root node for the scene. */
- root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
skybox_setup();
texture_source_setup();
diff --git a/src/examples/elementary/evas3d_object_on_button_example.c b/src/examples/elementary/evas3d_object_on_button_example.c
index c3866b78fe..e77d74be3d 100644
--- a/src/examples/elementary/evas3d_object_on_button_example.c
+++ b/src/examples/elementary/evas3d_object_on_button_example.c
@@ -164,7 +164,7 @@ _camera_setup(Scene_Data *data)
evas_canvas3d_camera_projection_perspective_set(data->camera, 20.0, 1.0, 2.0, 50.0);
data->camera_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
evas_canvas3d_node_camera_set(data->camera_node, data->camera);
evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 15.0);
evas_canvas3d_node_look_at_set(data->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, -1.0, 0.0);
@@ -180,7 +180,7 @@ _light_setup(Scene_Data *data)
evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0);
data->light_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
evas_canvas3d_node_light_set(data->light_node, data->light);
evas_canvas3d_node_position_set(data->light_node, 0.0, 0.0, 10.0);
evas_canvas3d_node_look_at_set(data->light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -220,7 +220,7 @@ _mesh_setup(Scene_Data *data)
evas_canvas3d_mesh_color_pick_enable_set(data->mesh, EINA_TRUE);
data->mesh_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_member_add(data->root_node, data->mesh_node);
evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh);
}
@@ -233,7 +233,7 @@ _scene_setup(Scene_Data *data)
evas_canvas3d_scene_background_color_set(data->scene, 0.0, 0.0, 0.0, 0.0);
data->root_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
_camera_setup(data);
_light_setup(data);
@@ -258,8 +258,8 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
/* Add an image object for 3D scene rendering. */
image = efl_add(EFL_CANVAS_SCENE3D_CLASS, evas);
- efl_gfx_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(image, EINA_TRUE);
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(image, EINA_TRUE);
btn = elm_button_add(win);
evas_object_resize(btn, (WIDTH * 2) / 3, (HEIGHT * 2) / 3);
diff --git a/src/examples/elementary/evas3d_scene_on_button_example.c b/src/examples/elementary/evas3d_scene_on_button_example.c
index f2c64a86df..8f47c7e080 100644
--- a/src/examples/elementary/evas3d_scene_on_button_example.c
+++ b/src/examples/elementary/evas3d_scene_on_button_example.c
@@ -125,7 +125,7 @@ _camera_setup(Scene_Data *data)
evas_canvas3d_camera_projection_perspective_set(data->camera, 60.0, 1.0, 2.0, 50.0);
data->camera_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
evas_canvas3d_node_camera_set(data->camera_node, data->camera);
evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 10.0);
evas_canvas3d_node_look_at_set(data->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -141,7 +141,7 @@ _light_setup(Scene_Data *data)
evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0);
data->light_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
evas_canvas3d_node_light_set(data->light_node, data->light);
evas_canvas3d_node_position_set(data->light_node, 0.0, 0.0, 10.0);
evas_canvas3d_node_look_at_set(data->light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -175,7 +175,7 @@ _mesh_setup(Scene_Data *data)
evas_canvas3d_mesh_frame_material_set(data->mesh, 0, data->material);
data->mesh_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_member_add(data->root_node, data->mesh_node);
evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh);
}
@@ -188,7 +188,7 @@ _scene_setup(Scene_Data *data)
evas_canvas3d_scene_background_color_set(data->scene, 0.0, 0.0, 0.0, 0.0);
data->root_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
_camera_setup(data);
_light_setup(data);
@@ -249,7 +249,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
_scene_setup(&data);
image = efl_add(EFL_CANVAS_SCENE3D_CLASS, evas);
- efl_gfx_visible_set(image, EINA_TRUE);
+ efl_gfx_entity_visible_set(image, EINA_TRUE);
/* Set the image object as render target for 3D scene. */
efl_canvas_scene3d_set(image, data.scene);
diff --git a/src/examples/elementary/filemvc.c b/src/examples/elementary/filemvc.c
index f09657bafc..6935e9387b 100644
--- a/src/examples/elementary/filemvc.c
+++ b/src/examples/elementary/filemvc.c
@@ -35,15 +35,14 @@ _cleanup_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
efl_unref(priv->fileview);
efl_unref(priv->treeview);
efl_unref(priv->formview);
- efl_unref(priv->treemodel);
}
-static Eina_Bool
-_filter_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED, const Eina_File_Direct_Info *info)
+static int
+_filter_cb(void *data EINA_UNUSED, Eio_Model *model, Eina_File_Direct_Info *info)
{
- if (info->type == EINA_FILE_DIR && info->path[info->name_start] != '.') return EINA_TRUE;
+ if (info->type == EINA_FILE_DIR && info->path[info->name_start] != '.') return 1;
- return EINA_FALSE;
+ return 0;
}
static void
@@ -58,39 +57,14 @@ _list_selected_cb(void *data EINA_UNUSED, const Efl_Event *event)
}
static void
-_promise_then(void *data, const Efl_Event *event)
-{
- Efl_Model_Test_Filemvc_Data *priv = data;
- char *path;
- Eo *model;
- Efl_Future_Event_Success* info = event->info;
- Eina_Value* value = info->value;
-
- eina_value_get(value, &path);
- model = efl_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(efl_added, path));
- elm_view_list_model_set(priv->fileview, model);
-}
-
-static void
-_promise_error(void *data EINA_UNUSED, const Efl_Event* err EINA_UNUSED)
-{
- printf("Promise error!\n");
-}
-
-static void
_tree_selected_cb(void *data, const Efl_Event *event)
{
Efl_Model_Test_Filemvc_Data *priv = data;
Eo *child = event->info;
- Efl_Future *f;
printf("TREE selected model\n");
- f = efl_model_property_get(child, "path");
- efl_ref(f);
- efl_future_then(f, &_promise_then, &_promise_error, NULL, priv);
- efl_future_link(event->object, f);
- efl_unref(f);
+ elm_view_list_model_set(priv->fileview, child);
}
static void
@@ -150,12 +124,12 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
else dirname = EFL_MODEL_TEST_FILENAME_PATH;
//treemodel
- priv.treemodel = efl_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(efl_added, dirname));
- eio_model_children_filter_set(priv.treemodel, _filter_cb, NULL);
+ priv.treemodel = efl_add(EIO_MODEL_CLASS, win, eio_model_path_set(efl_added, dirname));
+ eio_model_children_filter_set(priv.treemodel, NULL, _filter_cb, NULL);
//treeview
genlist = elm_genlist_add(win);
- priv.treeview = efl_add(ELM_VIEW_LIST_CLASS, NULL, elm_view_list_genlist_set(efl_added, genlist, ELM_GENLIST_ITEM_TREE, NULL));
+ priv.treeview = efl_add_ref(ELM_VIEW_LIST_CLASS, NULL, elm_view_list_genlist_set(efl_added, genlist, ELM_GENLIST_ITEM_TREE, NULL));
elm_view_list_property_connect(priv.treeview, "filename", "elm.text");
elm_view_list_property_connect(priv.treeview, "icon", "elm.swallow.icon");
elm_view_list_model_set(priv.treeview, priv.treemodel);
@@ -170,7 +144,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
//listview
genlist = elm_genlist_add(win);
- priv.fileview = efl_add(ELM_VIEW_LIST_CLASS, NULL, elm_view_list_genlist_set(efl_added, genlist, ELM_GENLIST_ITEM_NONE, "double_label"));
+ priv.fileview = efl_add_ref(ELM_VIEW_LIST_CLASS, NULL, elm_view_list_genlist_set(efl_added, genlist, ELM_GENLIST_ITEM_NONE, "double_label"));
elm_view_list_property_connect(priv.fileview, "filename", "elm.text");
elm_view_list_property_connect(priv.fileview, "mime_type", "elm.text.sub");
@@ -184,7 +158,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
bxr = elm_box_add(win);
_widget_init(bxr);
elm_object_part_content_set(vpanes, "right", bxr);
- priv.formview = efl_add(ELM_VIEW_FORM_CLASS, NULL);
+ priv.formview = efl_add_ref(ELM_VIEW_FORM_CLASS, NULL);
/*Label widget */
elm_view_form_widget_add(priv.formview, "filename", _label_init(win, bxr, "File Name"));
diff --git a/src/examples/elementary/fileviewlist.c b/src/examples/elementary/fileviewlist.c
index af14785118..716fdb3f79 100644
--- a/src/examples/elementary/fileviewlist.c
+++ b/src/examples/elementary/fileviewlist.c
@@ -54,8 +54,8 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(genlist);
- priv.filemodel = efl_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(efl_added, dirname));
- priv.fileview = efl_add(ELM_VIEW_LIST_CLASS, NULL, elm_view_list_genlist_set(efl_added, genlist, ELM_GENLIST_ITEM_TREE, "double_label"));
+ priv.filemodel = efl_add(EIO_MODEL_CLASS, win, eio_model_path_set(efl_added, dirname));
+ priv.fileview = efl_add(ELM_VIEW_LIST_CLASS, win, elm_view_list_genlist_set(efl_added, genlist, ELM_GENLIST_ITEM_TREE, "double_label"));
elm_view_list_model_set(priv.fileview, priv.filemodel);
evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _cleanup_cb, &priv);
diff --git a/src/examples/elementary/icon_cxx_example_01.cc b/src/examples/elementary/icon_cxx_example_01.cc
index d7171d51a5..88f9f95502 100644
--- a/src/examples/elementary/icon_cxx_example_01.cc
+++ b/src/examples/elementary/icon_cxx_example_01.cc
@@ -20,7 +20,7 @@ elm_main (int argc EINA_UNUSED, char **argv EINA_UNUSED)
std::cout << ", name = " << icon.icon_get() << std::endl;
- icon.scale_type_set(EFL_IMAGE_SCALE_TYPE_NONE);
+ icon.scale_type_set(EFL_GFX_IMAGE_SCALE_TYPE_NONE);
//icon.resizable_set(false, true);
//icon.smooth_set(false);
//icon.fill_outside_set(true);
diff --git a/src/examples/elementary/layout_model_connect.c b/src/examples/elementary/layout_model_connect.c
index aa34478f08..acc74bccb9 100644
--- a/src/examples/elementary/layout_model_connect.c
+++ b/src/examples/elementary/layout_model_connect.c
@@ -111,10 +111,10 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
if (argv[1] != NULL) dirname = argv[1];
else dirname = EFL_MODEL_TEST_FILENAME_PATH;
- priv->model = efl_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(efl_added, dirname));
+ priv->model = efl_add(EIO_MODEL_CLASS, win, eio_model_path_set(efl_added, dirname));
genlist = elm_genlist_add(win);
- priv->fileview = efl_add(ELM_VIEW_LIST_CLASS, NULL, elm_view_list_genlist_set(efl_added, genlist, ELM_GENLIST_ITEM_NONE, NULL));
+ priv->fileview = efl_add(ELM_VIEW_LIST_CLASS, win, elm_view_list_genlist_set(efl_added, genlist, ELM_GENLIST_ITEM_NONE, NULL));
elm_view_list_property_connect(priv->fileview, "filename", "elm.text");
elm_view_list_model_set(priv->fileview, priv->model);
_widget_init(genlist);
@@ -152,7 +152,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
/* Image widget */
img_factory = efl_add(EFL_UI_IMAGE_FACTORY_CLASS, win);
efl_ui_model_connect(img_factory, "", "path"); //connect to "path" property
- efl_ui_model_factory_connect(priv->bt, "icon", img_factory);
+ efl_ui_factory_model_connect(priv->bt, "icon", img_factory);
priv->img = efl_ui_factory_create(img_factory, NULL, win);
elm_box_pack_end(bxr, priv->img);
diff --git a/src/examples/elementary/menu_cxx_example_01.cc b/src/examples/elementary/menu_cxx_example_01.cc
index cf6cb5cedd..04cb3905ad 100644
--- a/src/examples/elementary/menu_cxx_example_01.cc
+++ b/src/examples/elementary/menu_cxx_example_01.cc
@@ -1,6 +1,6 @@
#include <Elementary.hh>
-#warning This example can't be implemented with EO APIs... FIXME
+#warning This example can not be implemented with EO APIs... FIXME
EAPI_MAIN int
elm_main (int argc EINA_UNUSED, char *argv[] EINA_UNUSED)
diff --git a/src/examples/elementary/performance/graphical.c b/src/examples/elementary/performance/graphical.c
index de4acb9473..06959ea2e7 100644
--- a/src/examples/elementary/performance/graphical.c
+++ b/src/examples/elementary/performance/graphical.c
@@ -272,7 +272,7 @@ void _init_bounding()
evas_canvas3d_mesh_frame_material_set(globalGraphical.mesh_box, 0, globalGraphical.material_box);
globalGraphical.mesh_nodebox =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, globalGraphical.evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH), evas_canvas3d_node_position_set(efl_added, 0, -30.0, 0.0));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, globalGraphical.evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH), evas_canvas3d_node_position_set(efl_added, 0, -30.0, 0.0));
evas_canvas3d_node_member_add(globalGraphical.root_node, globalGraphical.mesh_nodebox);
evas_canvas3d_node_mesh_add(globalGraphical.mesh_nodebox, globalGraphical.mesh_box);
}
@@ -359,7 +359,7 @@ _change_scene_setup()
for (i = 0; i < quantity; i++)
{
globalGraphical.mesh_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, globalGraphical.evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH), evas_canvas3d_node_position_set(efl_added, globalGraphical.places[i].position.x * 20, globalGraphical.places[i].position.y * 20, globalGraphical.places[i].position.z * 20));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, globalGraphical.evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH), evas_canvas3d_node_position_set(efl_added, globalGraphical.places[i].position.x * 20, globalGraphical.places[i].position.y * 20, globalGraphical.places[i].position.z * 20));
if (globalGraphical.model_path)
evas_canvas3d_node_scale_set(globalGraphical.mesh_node, 0.2, 0.2, 0.2);
evas_canvas3d_node_member_add(globalGraphical.root_node, globalGraphical.mesh_node);
@@ -397,14 +397,14 @@ _init_scene(Evas_Object *img)
globalGraphical.scene = efl_add(EVAS_CANVAS3D_SCENE_CLASS, globalGraphical.evas);
/* Add the root node for the scene. */
- globalGraphical.root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, globalGraphical.evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ globalGraphical.root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, globalGraphical.evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
/* Add the camera. */
globalGraphical.camera = efl_add(EVAS_CANVAS3D_CAMERA_CLASS, globalGraphical.evas);
evas_canvas3d_camera_projection_perspective_set(globalGraphical.camera, globalGraphical.angle, 1.0, 2.0, 1000.0);
globalGraphical.camera_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, globalGraphical.evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, globalGraphical.evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
evas_canvas3d_node_camera_set(globalGraphical.camera_node, globalGraphical.camera);
evas_canvas3d_node_position_set(globalGraphical.camera_node, 0.0, 0.0, 25.0);
evas_canvas3d_node_look_at_set(globalGraphical.camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -418,7 +418,7 @@ _init_scene(Evas_Object *img)
evas_canvas3d_light_spot_cutoff_set(globalGraphical.light, globalGraphical.angle / 15);
globalGraphical.light_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, globalGraphical.evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, globalGraphical.evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
evas_canvas3d_node_light_set(globalGraphical.light_node, globalGraphical.light);
evas_canvas3d_node_position_set(globalGraphical.light_node, 0.0, 100.0, 1.0);
evas_canvas3d_node_look_at_set(globalGraphical.light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -474,7 +474,7 @@ _init_scene(Evas_Object *img)
for (i = 0; i < quantity; i++)
{
globalGraphical.mesh_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, globalGraphical.evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH), evas_canvas3d_node_position_set(efl_added, globalGraphical.places[i].position.x * 20, globalGraphical.places[i].position.y * 20, globalGraphical.places[i].position.z * 20));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, globalGraphical.evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH), evas_canvas3d_node_position_set(efl_added, globalGraphical.places[i].position.x * 20, globalGraphical.places[i].position.y * 20, globalGraphical.places[i].position.z * 20));
if (globalGraphical.model_path)
evas_canvas3d_node_scale_set(globalGraphical.mesh_node, 0.2, 0.2, 0.2);
evas_canvas3d_node_member_add(globalGraphical.root_node, globalGraphical.mesh_node);
diff --git a/src/examples/elementary/popup_cxx_example.cc b/src/examples/elementary/popup_cxx_example.cc
index 7c6d85ce7a..b6c78322f9 100644
--- a/src/examples/elementary/popup_cxx_example.cc
+++ b/src/examples/elementary/popup_cxx_example.cc
@@ -147,12 +147,12 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
auto repeat_events_btn = lrepeat_events_btn.get();
if (!repeat_events_btn) return;
- if (efl::eo::downcast<efl::canvas::Object>(g_popup.part("backwall")).repeat_events_get()) {
- efl::eo::downcast<efl::canvas::Object>(g_popup.part("backwall")).repeat_events_set(false);
+ if (efl::eo::downcast<efl::canvas::Object>(g_popup.part_get("backwall")).repeat_events_get()) {
+ efl::eo::downcast<efl::canvas::Object>(g_popup.part_get("backwall")).repeat_events_set(false);
repeat_events_btn.text_set("Set Repeat Events");
}
else {
- efl::eo::downcast<efl::canvas::Object>(g_popup.part("backwall")).repeat_events_set(true);
+ efl::eo::downcast<efl::canvas::Object>(g_popup.part_get("backwall")).repeat_events_set(true);
repeat_events_btn.text_set("Unset Repeat Events");
}
}));
@@ -207,11 +207,11 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
backwall_visible = !backwall_visible;
if (backwall_visible) {
- efl::eo::downcast<efl::File>(g_popup.part("backwall")).file_set("./sky_01.jpg", nullptr);
+ efl::eo::downcast<efl::File>(g_popup.part_get("backwall")).file_set("./sky_01.jpg", nullptr);
backwall_btn.text_set("Unset Backwall");
}
else {
- efl::eo::downcast<efl::File>(g_popup.part("backwall")).file_set(nullptr, nullptr);
+ efl::eo::downcast<efl::File>(g_popup.part_get("backwall")).file_set(nullptr, nullptr);
backwall_btn.text_set("Set Backwall");
}
}));
diff --git a/src/examples/elementary/slider_cxx_example.cc b/src/examples/elementary/slider_cxx_example.cc
index 959fe256f0..61358d2c89 100644
--- a/src/examples/elementary/slider_cxx_example.cc
+++ b/src/examples/elementary/slider_cxx_example.cc
@@ -26,7 +26,6 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
bx.pack_end(sl);
efl::ui::Slider sl2(instantiate, win);
- sl2.text_set("Counter");
efl::ui::Image ic(instantiate, win);
ic.icon_set("home");
ic.scalable_set(false, false);
@@ -36,7 +35,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
ic2.icon_set("folder");
ic2.scalable_set(false, false);
// FIXME: C++ part API needs special reference handling! This will show ERR!
- efl::eo::downcast<efl::Content>(sl2.part("elm.swallow.end"))
+ efl::eo::downcast<efl::Content>(sl2.part_get("elm.swallow.end"))
.content_set(ic2);
sl2.hint_align_set(EFL_GFX_SIZE_HINT_FILL, 0.5);
@@ -49,15 +48,13 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
bx.pack_end(sl3);
efl::ui::Slider sl4(instantiate, win);
- sl4.format_string_set("%1.0f units");
sl4.range_min_max_set(0, 100);
sl4.hint_align_set(EFL_GFX_SIZE_HINT_FILL, 0.5);
bx.pack_end(sl4);
efl::ui::Slider sl5(instantiate, win);
- sl5.indicator().format_string_set("%1.0f rabbit(s)");
sl5.range_min_max_set(0, 100);
- sl5.step_set(1);
+ sl5.range_step_set(1);
sl5.direction_set(EFL_UI_DIR_UP);
sl5.hint_align_set(EFL_GFX_SIZE_HINT_FILL, 0.5);
sl5.hint_min_set({0, 120});
@@ -66,25 +63,11 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
efl::ui::Slider sl6(instantiate, win);
sl6.direction_set(EFL_UI_DIR_HORIZONTAL);
sl6.range_min_max_set(0, 10);
- auto format_cb = std::bind([](
- efl::eina::strbuf_wrapper& sb,
- efl::eina::value_view const& value) {
- try {
- int d = int(efl::eina::get<double>(value));
- if (d >= 2) sb.append_printf("%d things", d);
- else if (!d) sb.append("nothing");
- else sb.append("one thing");
- } catch (std::system_error const&) {
- sb.append(value.to_string());
- } }, _1, _2);
- sl6.format_cb_set(format_cb);
sl6.hint_align_set(0.5, EFL_GFX_SIZE_HINT_FILL);
sl6.hint_weight_set(0, EFL_GFX_SIZE_HINT_EXPAND);
bx.pack_end(sl6);
efl::ui::Slider sl7(instantiate, win);
- sl7.format_string_set("%1.3f units");
-// sl7.indicator_format_function_set(indicator_format, indicator_free);
sl7.hint_align_set(EFL_GFX_SIZE_HINT_FILL, 0.5);
bx.pack_end(sl7);
diff --git a/src/examples/elementary/sphere_hunter/evas_3d_sphere_hunter.c b/src/examples/elementary/sphere_hunter/evas_3d_sphere_hunter.c
index 7127919eba..bceb165b83 100644
--- a/src/examples/elementary/sphere_hunter/evas_3d_sphere_hunter.c
+++ b/src/examples/elementary/sphere_hunter/evas_3d_sphere_hunter.c
@@ -437,7 +437,7 @@ _camera_setup(Scene_Data *data)
data->camera = efl_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
evas_canvas3d_camera_projection_perspective_set(data->camera, 50.0, 1.0, 1.0, 1000.0);
- data->camera_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
+ data->camera_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
evas_canvas3d_node_camera_set(data->camera_node, data->camera);
evas_canvas3d_node_position_set(data->camera_node, 0.0, 40, 70);
evas_canvas3d_node_look_at_set(data->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -465,7 +465,7 @@ _light_setup(Scene_Data *data)
evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0);
evas_canvas3d_light_projection_perspective_set(data->light, 100.0, 1.0, 1.0, 1000.0);
- data->light_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
+ data->light_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
evas_canvas3d_node_light_set(data->light_node, data->light);
evas_canvas3d_node_position_set(data->light_node, 0.1, 25.0, 0.1);
evas_canvas3d_node_look_at_set(data->light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -507,7 +507,7 @@ _create_bondar(Scene_Data *data, Evas_Real scale_x, Evas_Real scale_y, Evas_Real
mesh = efl_add(EVAS_CANVAS3D_MESH_CLASS, evas);
material = efl_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
- node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
@@ -555,7 +555,7 @@ _create_cubes(Scene_Data *data, Evas_Real r, int count)
Eo *node = NULL;
alpha = d_alpha * i * M_PI / 180;
- node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_mesh_add(node, data->mesh_cube);
evas_canvas3d_node_position_set(node, r * sin(alpha), 2.0 + (r / 4 * sin(alpha)), r * cos(alpha));
@@ -574,7 +574,7 @@ _mesh_ball_setup(Scene_Data *data)
data->mesh_ball = efl_add(EVAS_CANVAS3D_MESH_CLASS, evas);
data->material_ball = efl_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
- data->mesh_node_ball = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ data->mesh_node_ball = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
/* Setup material for ball. */
evas_canvas3d_material_enable_set(data->material_ball, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
@@ -611,7 +611,7 @@ _scene_setup(Scene_Data *data, Evas_Real r, int count)
data->scene = efl_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
/* Add the root node for the scene. */
- data->root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ data->root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
evas_canvas3d_scene_size_set(data->scene, WIDTH, HEIGHT);
evas_canvas3d_scene_shadows_enable_set(data->scene, EINA_TRUE);
@@ -814,7 +814,7 @@ elm_main(int argc, char **argv)
_scene_setup(&data, 10.0, 10);
image = efl_add(EFL_CANVAS_SCENE3D_CLASS, evas);
- efl_gfx_visible_set(image, EINA_TRUE);
+ efl_gfx_entity_visible_set(image, EINA_TRUE);
efl_canvas_scene3d_set(image, data.scene);
evas_object_size_hint_weight_set(image, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
diff --git a/src/examples/elua/Makefile.am b/src/examples/elua/Makefile.am
index 54b01fff92..031afc3bb3 100644
--- a/src/examples/elua/Makefile.am
+++ b/src/examples/elua/Makefile.am
@@ -5,10 +5,6 @@ MAINTAINERCLEANFILES = Makefile.in
DATA_FILES =
EXTRA_DIST = $(DATA_FILES)
-examples: ;
-
-clean-local: ;
-
install-examples:
$(MKDIR_P) $(DESTDIR)$(datadir)/elua/examples
# cd $(srcdir) && $(install_sh_DATA) -c $(DATA_FILES) $(DESTDIR)$(datadir)/elua/examples
@@ -17,5 +13,11 @@ install-examples:
# for f in $(DATA_FILES); do \
# rm -f $(DESTDIR)$(datadir)/elua/examples/$$f ; \
# done
-
+else
+install-examples:
endif
+
+examples: ;
+
+clean-local: ;
+
diff --git a/src/examples/eolian_cxx/Makefile.am b/src/examples/eolian_cxx/Makefile.am
index 16cddb3410..f9b0ab8271 100644
--- a/src/examples/eolian_cxx/Makefile.am
+++ b/src/examples/eolian_cxx/Makefile.am
@@ -12,6 +12,12 @@ EOLIAN_FLAGS = \
include $(top_srcdir)/src/Makefile_Eolian_Helper.am
include $(top_srcdir)/src/Makefile_Eolian_Cxx_Helper.am
+# Eolian_*_Helper.am has this variable as a relative path to src
+# Thus we need to override it here in order to make its pattern
+# rules work properly.
+_EOLIAN_GEN_DEP = ../../bin/eolian/eolian_gen${EXEEXT}
+_EOLIAN_CXX_DEP = ../../bin/eolian_cxx/eolian_cxx${EXEEXT}
+
AM_CXXFLAGS = \
-I$(srcdir) \
-I$(builddir) \
@@ -125,18 +131,6 @@ EXTRA_DIST = $(DATA_FILES) \
ns_colourable.eo \
ns_colourablesquare.eo
-%.eo.hh: %.eo
- $(AM_V_EOLCXX)$(EOLIAN_CXX) $(EOLIAN_FLAGS) -I${abs_srcdir} -o $@ $<
-
-%.eo.impl.hh: %.eo.hh
- true $<
-
-%.eo.c: %.eo
- $(AM_V_EOL)$(EOLIAN_GEN) $(EOLIAN_FLAGS) $(EOLIAN_GEN_FLAGS) -gc -o c:$@ $<
-
-%.eo.h: %.eo
- $(AM_V_EOL)$(EOLIAN_GEN) $(EOLIAN_FLAGS) $(EOLIAN_GEN_FLAGS) -gh -o h:$@ $<
-
examples: $(ECXX_EXAMPLE_EOS) $(GENERATED) $(EXTRA_PROGRAMS)
clean-local:
diff --git a/src/examples/eolian_cxx/colourable.c b/src/examples/eolian_cxx/colourable.c
index 001665f956..f4f16273ec 100644
--- a/src/examples/eolian_cxx/colourable.c
+++ b/src/examples/eolian_cxx/colourable.c
@@ -83,7 +83,7 @@ _ns_colourable_colour_mask(Eo *obj EINA_UNUSED, Colourable_Data *self, int mask)
}
void
-_ns_colourable_composite_colour_get(Eo *obj EINA_UNUSED, Colourable_Data *self, int* r, int* g, int* b)
+_ns_colourable_composite_colour_get(const Eo *obj EINA_UNUSED, Colourable_Data *self, int* r, int* g, int* b)
{
*r = self->r;
*g = self->g;
@@ -104,7 +104,7 @@ _ns_colourable_composite_colour_set(Eo *obj EINA_UNUSED, Colourable_Data *self,
}
int
-_ns_colourable_colour_get(Eo *obj EINA_UNUSED, Colourable_Data *self)
+_ns_colourable_colour_get(const Eo *obj EINA_UNUSED, Colourable_Data *self)
{
int rgb =
((self->r << 16)& 0x00ff0000) |
diff --git a/src/examples/eolian_cxx/colourablesquare.c b/src/examples/eolian_cxx/colourablesquare.c
index a6ea21359e..6b6d787a9f 100644
--- a/src/examples/eolian_cxx/colourablesquare.c
+++ b/src/examples/eolian_cxx/colourablesquare.c
@@ -38,7 +38,7 @@ _ns_colourablesquare_size_constructor(Eo *obj EINA_UNUSED, ColourableSquare_Data
}
static int
-_ns_colourablesquare_size_get(Eo *obj EINA_UNUSED, ColourableSquare_Data *self)
+_ns_colourablesquare_size_get(const Eo *obj EINA_UNUSED, ColourableSquare_Data *self)
{
DBG("_ns_colourablesquare_size_get() => %d\n", self->size);
return self->size;
diff --git a/src/examples/ethumb_client/ethumb_dbus.c b/src/examples/ethumb_client/ethumb_dbus.c
index aa3b2f59a9..3fe02291ff 100644
--- a/src/examples/ethumb_client/ethumb_dbus.c
+++ b/src/examples/ethumb_client/ethumb_dbus.c
@@ -28,7 +28,6 @@
#include <stdlib.h>
#include <string.h>
#include <limits.h>
-#include <dirent.h>
#include <Ethumb.h>
#include <Ethumb_Client.h>
#include <Eina.h>
diff --git a/src/examples/evas/Makefile.am b/src/examples/evas/Makefile.am
index dd9b7964fe..03414501dd 100644
--- a/src/examples/evas/Makefile.am
+++ b/src/examples/evas/Makefile.am
@@ -383,42 +383,42 @@ evas_mono_box_csharp_SOURCES = \
evas_mono_box_csharp$(EXEEXT): $(evas_mono_box_csharp_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll
@rm -f $@
- $(AM_V_MCS) $(MCS) $(MCS_FLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
+ $(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
evas_mono_image_csharp_SOURCES = \
evas_mono_image.cs
evas_mono_image_csharp$(EXEEXT): $(evas_mono_image_csharp_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll
@rm -f $@
- $(AM_V_MCS) $(MCS) $(MCS_FLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
+ $(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
evas_mono_image2_csharp_SOURCES = \
evas_mono_image2.cs
evas_mono_image2_csharp$(EXEEXT): $(evas_mono_image2_csharp_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll
@rm -f $@
- $(AM_V_MCS) $(MCS) $(MCS_FLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
+ $(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
evas_mono_rectangle_csharp_SOURCES = \
evas_mono_rectangle.cs
evas_mono_rectangle_csharp$(EXEEXT): $(evas_mono_rectangle_csharp_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll
@rm -f $@
- $(AM_V_MCS) $(MCS) $(MCS_FLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
+ $(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
evas_mono_table_csharp_SOURCES = \
evas_mono_table.cs
evas_mono_table_csharp$(EXEEXT): $(evas_mono_table_csharp_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll
@rm -f $@
- $(AM_V_MCS) $(MCS) $(MCS_FLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
+ $(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
evas_mono_text_csharp_SOURCES = \
evas_mono_text.cs
evas_mono_text_csharp$(EXEEXT): $(evas_mono_text_csharp_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll
@rm -f $@
- $(AM_V_MCS) $(MCS) $(MCS_FLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
+ $(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
endif
diff --git a/src/examples/evas/evas-3d-aabb.c b/src/examples/evas/evas-3d-aabb.c
index 8531665a82..dd4c1f0f27 100644
--- a/src/examples/evas/evas-3d-aabb.c
+++ b/src/examples/evas/evas-3d-aabb.c
@@ -110,8 +110,8 @@ _on_canvas_resize(Ecore_Evas *ee)
int w, h;
ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
- efl_gfx_size_set(background, EINA_SIZE2D(w, h));
- efl_gfx_size_set(image, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(w, h));
}
static Eina_Bool
@@ -143,13 +143,13 @@ main(void)
scene = efl_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
- root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
camera = efl_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
evas_canvas3d_camera_projection_perspective_set(camera, 60.0, 1.0, 1.0, 500.0);
camera_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
evas_canvas3d_node_camera_set(camera_node, camera);
evas_canvas3d_node_member_add(root_node, camera_node);
evas_canvas3d_node_position_set(camera_node, 100.0, 50.0, 20.0);
@@ -161,7 +161,7 @@ main(void)
evas_canvas3d_light_directional_set(light, EINA_TRUE);
light_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
evas_canvas3d_node_light_set(light_node, light);
evas_canvas3d_node_position_set(light_node, 1000.0, 0.0, 1000.0);
evas_canvas3d_node_look_at_set(light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -188,8 +188,8 @@ main(void)
evas_canvas3d_material_color_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0);
evas_canvas3d_material_shininess_set(material, 50.0);
- mesh_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
- mesh_box_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ mesh_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ mesh_box_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
material_box = efl_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
evas_canvas3d_material_enable_set(material_box, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
@@ -216,12 +216,12 @@ main(void)
background = efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas);
efl_gfx_color_set(background, 0, 0, 0, 255);
- efl_gfx_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(background, EINA_TRUE);
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(background, EINA_TRUE);
image = efl_add(EFL_CANVAS_SCENE3D_CLASS, evas);
- efl_gfx_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(image, EINA_TRUE);
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(image, EINA_TRUE);
evas_object_focus_set(image, EINA_TRUE);
efl_canvas_scene3d_set(image, scene);
diff --git a/src/examples/evas/evas-3d-blending.c b/src/examples/evas/evas-3d-blending.c
index 84f042ace1..667b671197 100644
--- a/src/examples/evas/evas-3d-blending.c
+++ b/src/examples/evas/evas-3d-blending.c
@@ -126,8 +126,8 @@ _on_canvas_resize(Ecore_Evas *ee)
ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
evas_object_resize(background, w, h);
- efl_gfx_size_set(background, EINA_SIZE2D(w, h));
- efl_gfx_size_set(image, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(w, h));
}
static Eina_Bool
@@ -153,7 +153,7 @@ _camera_setup(Scene_Data *data)
evas_canvas3d_camera_projection_perspective_set(data->camera, 60.0, 1.0, 2.0, 50.0);
data->camera_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
evas_canvas3d_node_camera_set(data->camera_node, data->camera);
evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 10.0);
@@ -171,7 +171,7 @@ _light_setup(Scene_Data *data)
evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0);
data->light_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
evas_canvas3d_node_light_set(data->light_node, data->light);
evas_canvas3d_node_position_set(data->light_node, 0.0, 0.0, 10.0);
evas_canvas3d_node_look_at_set(data->light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -220,13 +220,13 @@ _mesh_setup(Scene_Data *data)
_set_ball(data->mesh1, data->sphere, data->material1);
data->mesh_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_member_add(data->root_node, data->mesh_node);
evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh);
data->mesh_node1 =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_member_add(data->root_node, data->mesh_node1);
evas_canvas3d_node_mesh_add(data->mesh_node1, data->mesh1);
@@ -248,7 +248,7 @@ _scene_setup(Scene_Data *data)
evas_canvas3d_scene_background_color_set(data->scene, 0.5, 0.5, 0.5, 1);
data->root_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
_camera_setup(data);
_light_setup(data);
diff --git a/src/examples/evas/evas-3d-colorpick.c b/src/examples/evas/evas-3d-colorpick.c
index 80c392a5f9..8c9ea3b54f 100644
--- a/src/examples/evas/evas-3d-colorpick.c
+++ b/src/examples/evas/evas-3d-colorpick.c
@@ -120,8 +120,8 @@ _on_canvas_resize(Ecore_Evas *ee)
int w, h;
ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
- efl_gfx_size_set(bg, EINA_SIZE2D(w, h));
- efl_gfx_size_set(image, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(bg, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(w, h));
}
static Eina_Bool
@@ -281,13 +281,13 @@ _init_scene(const char *texture)
globalscene.scene = efl_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
- globalscene.root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ globalscene.root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
globalscene.camera = efl_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
evas_canvas3d_camera_projection_perspective_set(globalscene.camera, 30.0, 1.0, 1.0, 1000.0);
globalscene.camera_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
evas_canvas3d_node_camera_set(globalscene.camera_node, globalscene.camera);
evas_canvas3d_node_member_add(globalscene.root_node, globalscene.camera_node);
evas_canvas3d_node_position_set(globalscene.camera_node, 0.0, 30.0, 800.0);
@@ -299,7 +299,7 @@ _init_scene(const char *texture)
evas_canvas3d_light_directional_set(globalscene.light, EINA_TRUE);
globalscene.light_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
evas_canvas3d_node_light_set(globalscene.light_node, globalscene.light);
evas_canvas3d_node_position_set(globalscene.light_node, 100.0, 50.0, 300.0);
evas_canvas3d_node_look_at_set(globalscene.light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 1.0, 1.0, 1.0);
@@ -321,7 +321,7 @@ _init_scene(const char *texture)
m->material = spheretmp->material;
m->texture = spheretmp->texture;
}
- m->node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ m->node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
m->speed = tmp;
m->sphere_animate = _animate_sphere;
m->animate = ecore_timer_add(m->speed, m->sphere_animate, m);
@@ -392,8 +392,8 @@ int main(int argc, char **argv)
image = efl_add(EFL_CANVAS_SCENE3D_CLASS, evas);
- efl_gfx_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(image, EINA_TRUE);
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(image, EINA_TRUE);
evas_object_focus_set(image, EINA_TRUE);
efl_canvas_scene3d_set(image, globalscene.scene);
diff --git a/src/examples/evas/evas-3d-cube-rotate.c b/src/examples/evas/evas-3d-cube-rotate.c
index 16efb7c548..25889024d1 100644
--- a/src/examples/evas/evas-3d-cube-rotate.c
+++ b/src/examples/evas/evas-3d-cube-rotate.c
@@ -157,7 +157,7 @@ _camera_setup(Scene_Data *data)
data->camera = efl_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
evas_canvas3d_camera_projection_perspective_set(data->camera, 20.0, 1.0, 2.0, 50.0);
- data->camera_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
+ data->camera_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
evas_canvas3d_node_camera_set(data->camera_node, data->camera);
evas_canvas3d_node_position_set(data->camera_node, 3.0, 3.0, 10.0);
evas_canvas3d_node_look_at_set(data->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -174,7 +174,7 @@ _light_setup(Scene_Data *data)
evas_canvas3d_light_diffuse_set(data->light, 1.0, 1.0, 1.0, 1.0);
evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0);
- data->light_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
+ data->light_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
evas_canvas3d_node_light_set(data->light_node, data->light);
evas_canvas3d_node_position_set(data->light_node, 5.0, 5.0, 10.0);
@@ -207,7 +207,7 @@ _mesh_setup(Scene_Data *data)
evas_canvas3d_mesh_shader_mode_set(data->mesh, EVAS_CANVAS3D_SHADER_MODE_PHONG);
evas_canvas3d_mesh_frame_material_set(data->mesh, 0, data->material);
- data->mesh_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ data->mesh_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_member_add(data->root_node, data->mesh_node);
evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh);
}
@@ -216,7 +216,7 @@ static void
_scene_setup(Scene_Data *data)
{
scene = efl_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
- data->root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ data->root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
evas_canvas3d_scene_size_set(scene, WIDTH, HEIGHT);
evas_canvas3d_scene_background_color_set(scene, 0.0, 0.0, 0.0, 0.0);
@@ -262,7 +262,7 @@ main(void)
/* Add an image object for 3D scene rendering. */
image = efl_add(EFL_CANVAS_SCENE3D_CLASS, evas);
- efl_gfx_geometry_set(image, EINA_RECT(0, 0, WIDTH, HEIGHT));
+ efl_gfx_entity_geometry_set(image, EINA_RECT(0, 0, WIDTH, HEIGHT));
evas_object_show(image);
/* Set the image object as render target for 3D scene. */
diff --git a/src/examples/evas/evas-3d-cube.c b/src/examples/evas/evas-3d-cube.c
index 7a2cdcfd18..e8d04d4ea9 100644
--- a/src/examples/evas/evas-3d-cube.c
+++ b/src/examples/evas/evas-3d-cube.c
@@ -114,8 +114,8 @@ _on_canvas_resize(Ecore_Evas *ee)
int w, h;
ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
- efl_gfx_size_set(background, EINA_SIZE2D(w, h));
- efl_gfx_size_set(image, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(w, h));
}
static Eina_Bool
@@ -142,7 +142,7 @@ _camera_setup(Scene_Data *data)
evas_canvas3d_camera_projection_perspective_set(data->camera, 60.0, 1.0, 2.0, 50.0);
data->camera_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
evas_canvas3d_node_camera_set(data->camera_node, data->camera);
evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 10.0);
evas_canvas3d_node_look_at_set(data->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -158,7 +158,7 @@ _light_setup(Scene_Data *data)
evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0);
data->light_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
evas_canvas3d_node_light_set(data->light_node, data->light);
evas_canvas3d_node_position_set(data->light_node, 0.0, 0.0, 10.0);
evas_canvas3d_node_look_at_set(data->light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -192,7 +192,7 @@ _mesh_setup(Scene_Data *data)
evas_canvas3d_mesh_frame_material_set(data->mesh, 0, data->material);
data->mesh_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_member_add(data->root_node, data->mesh_node);
evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh);
}
@@ -205,7 +205,7 @@ _scene_setup(Scene_Data *data)
evas_canvas3d_scene_background_color_set(data->scene, 0.0, 0.0, 0.0, 0.0);
data->root_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
_camera_setup(data);
_light_setup(data);
@@ -239,13 +239,13 @@ main(void)
/* Add a background rectangle object. */
background = efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas);
efl_gfx_color_set(background, 0, 0, 0, 255);
- efl_gfx_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(background, EINA_TRUE);
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(background, EINA_TRUE);
/* Add an image object for 3D scene rendering. */
image = efl_add(EFL_CANVAS_SCENE3D_CLASS, evas);
- efl_gfx_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(image, EINA_TRUE);
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(image, EINA_TRUE);
/* Set the image object as render target for 3D scene. */
efl_canvas_scene3d_set(image, data.scene);
diff --git a/src/examples/evas/evas-3d-cube2.c b/src/examples/evas/evas-3d-cube2.c
index c07e530485..c8558b622b 100644
--- a/src/examples/evas/evas-3d-cube2.c
+++ b/src/examples/evas/evas-3d-cube2.c
@@ -78,8 +78,8 @@ _on_canvas_resize(Ecore_Evas *ee)
int w, h;
ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
- efl_gfx_size_set(background, EINA_SIZE2D(w, h));
- efl_gfx_size_set(image, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(w, h));
}
static Eina_Bool
@@ -114,7 +114,7 @@ _camera_setup(Scene_Data *data)
evas_canvas3d_camera_projection_perspective_set(data->camera, 60.0, 1.0, 2.0, 50.0);
data->camera_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
evas_canvas3d_node_camera_set(data->camera_node, data->camera);
evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 3.0);
evas_canvas3d_node_look_at_set(data->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -130,7 +130,7 @@ _light_setup(Scene_Data *data)
evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0);
data->light_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
evas_canvas3d_node_light_set(data->light_node, data->light);
evas_canvas3d_node_position_set(data->light_node, 0.0, 0.0, 10.0);
evas_canvas3d_node_look_at_set(data->light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -187,7 +187,7 @@ _mesh_setup(Scene_Data *data)
evas_canvas3d_mesh_shader_mode_set(data->mesh, EVAS_CANVAS3D_SHADER_MODE_NORMAL_MAP);
data->mesh_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_member_add(data->root_node, data->mesh_node);
evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh);
}
@@ -200,7 +200,7 @@ _scene_setup(Scene_Data *data)
evas_canvas3d_scene_background_color_set(data->scene, 0.0, 0.0, 0.0, 0.0);
data->root_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
_camera_setup(data);
_light_setup(data);
@@ -235,13 +235,13 @@ main(void)
/* Add a background rectangle object. */
background = efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas);
efl_gfx_color_set(background, 0, 0, 0, 255);
- efl_gfx_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(background, EINA_TRUE);
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(background, EINA_TRUE);
/* Add an image object for 3D scene rendering. */
image = efl_add(EFL_CANVAS_SCENE3D_CLASS, evas);
- efl_gfx_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(image, EINA_TRUE);
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(image, EINA_TRUE);
/* Set the image object as render target for 3D scene. */
efl_canvas_scene3d_set(image, data.scene);
diff --git a/src/examples/evas/evas-3d-eet.c b/src/examples/evas/evas-3d-eet.c
index 01c9c768f5..da94e06d7e 100644
--- a/src/examples/evas/evas-3d-eet.c
+++ b/src/examples/evas/evas-3d-eet.c
@@ -91,8 +91,8 @@ _on_canvas_resize(Ecore_Evas *ee)
int w, h;
ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
- efl_gfx_size_set(background, EINA_SIZE2D(w, h));
- efl_gfx_size_set(image, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(w, h));
}
int
@@ -117,13 +117,13 @@ main(void)
scene = efl_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
/* Add the root node for the scene. */
- root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
/* Add the camera. */
camera = efl_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
evas_canvas3d_camera_projection_perspective_set(camera, 60.0, 1.0, 1.0, 500.0);
- camera_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
+ camera_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
evas_canvas3d_node_camera_set(camera_node, camera);
evas_canvas3d_node_member_add(root_node, camera_node);
evas_canvas3d_node_position_set(camera_node, 200.0, 0.0, 40.0);
@@ -135,7 +135,7 @@ main(void)
evas_canvas3d_light_specular_set(light, 1.0, 1.0, 1.0, 1.0);
evas_canvas3d_light_directional_set(light, EINA_TRUE);
- light_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
+ light_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
evas_canvas3d_node_light_set(light_node, light);
evas_canvas3d_node_position_set(light_node, 1000.0, 0.0, 1000.0);
evas_canvas3d_node_look_at_set(light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -168,13 +168,13 @@ main(void)
efl_file_set(mesh2, output_model_path, NULL);
evas_canvas3d_mesh_shader_mode_set(mesh2, EVAS_CANVAS3D_SHADER_MODE_PHONG);
- mesh_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ mesh_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_member_add(root_node, mesh_node);
evas_canvas3d_node_mesh_add(mesh_node, mesh);
evas_canvas3d_node_position_set(mesh_node, 0.0, -40.0, 0.0);
- mesh_node2 = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ mesh_node2 = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_member_add(root_node, mesh_node2);
evas_canvas3d_node_mesh_add(mesh_node2, mesh2);
evas_canvas3d_node_position_set(mesh_node2, 0.0, 40.0, 0.0);
@@ -187,13 +187,13 @@ main(void)
/* Add a background rectangle object. */
background = efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas);
efl_gfx_color_set(background, 0, 0, 0, 255);
- efl_gfx_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(background, EINA_TRUE);
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(background, EINA_TRUE);
/* Add an image object for 3D scene rendering. */
image = efl_add(EFL_CANVAS_SCENE3D_CLASS, evas);
- efl_gfx_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(image, EINA_TRUE);
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(image, EINA_TRUE);
/* Set the image object as render target for 3D scene. */
efl_canvas_scene3d_set(image, scene);
diff --git a/src/examples/evas/evas-3d-fog.c b/src/examples/evas/evas-3d-fog.c
index 38a3d632da..4c69dcac94 100644
--- a/src/examples/evas/evas-3d-fog.c
+++ b/src/examples/evas/evas-3d-fog.c
@@ -61,8 +61,8 @@ _on_canvas_resize(Ecore_Evas *ee)
ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
evas_object_resize(background, w, h);
- efl_gfx_size_set(background, EINA_SIZE2D(w, h));
- efl_gfx_size_set(image, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(w, h));
}
static Eina_Bool
@@ -88,7 +88,7 @@ _camera_setup(Scene_Data *data)
evas_canvas3d_camera_projection_perspective_set(data->camera, 60.0, 1.0, 2.0, 50.0);
data->camera_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
evas_canvas3d_node_camera_set(data->camera_node, data->camera);
evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 7.0);
@@ -106,7 +106,7 @@ _light_setup(Scene_Data *data)
evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0);
data->light_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
evas_canvas3d_node_light_set(data->light_node, data->light);
evas_canvas3d_node_position_set(data->light_node, 0.0, 0.0, 10.0);
evas_canvas3d_node_look_at_set(data->light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -145,10 +145,10 @@ _mesh_setup(Scene_Data *data)
_set_ball(data->mesh1, data->sphere, data->material);
data->animation_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
data->mesh_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_member_add(data->animation_node, data->mesh_node);
evas_canvas3d_node_member_add(data->root_node, data->animation_node);
@@ -156,7 +156,7 @@ _mesh_setup(Scene_Data *data)
evas_canvas3d_node_position_set(data->mesh_node, 0.0, 0.0, 3.0);
data->mesh_node1 =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_member_add(data->root_node, data->mesh_node1);
evas_canvas3d_node_mesh_add(data->mesh_node1, data->mesh1);
@@ -177,7 +177,7 @@ _scene_setup(Scene_Data *data)
evas_canvas3d_scene_background_color_set(data->scene, FOG_COLOR, 1);
data->root_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
_camera_setup(data);
_light_setup(data);
@@ -212,14 +212,14 @@ main(void)
/* Add a background rectangle object. */
background = efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas);
efl_gfx_color_set(background, 0, 0, 0, 255);
- efl_gfx_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(background, EINA_TRUE);
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(background, EINA_TRUE);
/* Add an image object for 3D scene rendering. */
image = efl_add(EFL_CANVAS_SCENE3D_CLASS, evas);
- efl_gfx_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(image, EINA_TRUE);
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(image, EINA_TRUE);
/* Set the image object as render target for 3D scene. */
efl_canvas_scene3d_set(image, data.scene);
diff --git a/src/examples/evas/evas-3d-frustum.c b/src/examples/evas/evas-3d-frustum.c
index 776e61c364..02f5bba05e 100644
--- a/src/examples/evas/evas-3d-frustum.c
+++ b/src/examples/evas/evas-3d-frustum.c
@@ -281,7 +281,7 @@ static void
_camera_setup(Scene_Data *data)
{
data->camera = efl_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
- data->camera_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
+ data->camera_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
evas_canvas3d_node_camera_set(data->camera_node, data->camera);
evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 300.0);
evas_canvas3d_node_look_at_set(data->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -299,7 +299,7 @@ _light_setup(Scene_Data *data)
evas_canvas3d_light_diffuse_set(data->light, 1.0, 1.0, 1.0, 1.0);
evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0);
- data->light_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
+ data->light_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
evas_canvas3d_node_light_set(data->light_node, data->light);
evas_canvas3d_node_position_set(data->light_node, 0.0, 0.0, 200.0);
evas_canvas3d_node_look_at_set(data->light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 1.0);
@@ -340,7 +340,7 @@ _mesh_setup(Scene_Data *data)
evas_canvas3d_mesh_frame_material_set(data->mesh_sphere, 0, data->material);
data->mesh_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_member_add(data->root_node, data->mesh_node);
evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh_aabb);
}
@@ -377,13 +377,13 @@ _scene_setup(Scene_Data *data)
{
data->scene = efl_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
- data->root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ data->root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
_light_setup(data);
_mesh_setup_model(data);
_camera_setup(data);
- data->mesh_node_model = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ data->mesh_node_model = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_position_set(data->mesh_node_model, obj_x, obj_y, obj_z);
evas_canvas3d_node_orientation_angle_axis_set(data->mesh_node_model, -90, 1.0, 0.0, 0.0);
evas_canvas3d_node_scale_set(data->mesh_node_model, obj_sc_x, obj_sc_y, obj_sc_z);
diff --git a/src/examples/evas/evas-3d-hull.c b/src/examples/evas/evas-3d-hull.c
index 52c121fe9f..0e13705c36 100644
--- a/src/examples/evas/evas-3d-hull.c
+++ b/src/examples/evas/evas-3d-hull.c
@@ -195,8 +195,8 @@ _on_canvas_resize(Ecore_Evas *ee)
int w, h;
ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
- efl_gfx_size_set(background, EINA_SIZE2D(w, h));
- efl_gfx_size_set(image, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(w, h));
}
static Eina_Bool
@@ -262,7 +262,7 @@ _camera_setup(Scene_Data *data)
evas_canvas3d_camera_projection_perspective_set(data->camera, 60.0, 1.0, 2.0, 50.0);
data->camera_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
evas_canvas3d_node_camera_set(data->camera_node, data->camera);
evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 10.0);
evas_canvas3d_node_look_at_set(data->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -278,7 +278,7 @@ _light_setup(Scene_Data *data)
evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0);
data->light_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
evas_canvas3d_node_light_set(data->light_node, data->light);
evas_canvas3d_node_position_set(data->light_node, 0.0, 0.0, 10.0);
evas_canvas3d_node_look_at_set(data->light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -356,7 +356,7 @@ _mesh_setup(Scene_Data *data)
MODEL_MESH_INIT(blender_test_sonic, sonic_test, DIFFUSE)
data->mesh_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_member_add(data->root_node, data->mesh_node);
evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh_sphere);
evas_canvas3d_node_scale_set(data->mesh_node, SCALE_SPHERE, SCALE_SPHERE, SCALE_SPHERE);
@@ -374,14 +374,14 @@ _mesh_setup(Scene_Data *data)
_print_result(data->mesh_sphere_ch, data->mesh_blender_test_sphere);
data->mesh_node_convex_hull =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_member_add(data->root_node, data->mesh_node_convex_hull);
evas_canvas3d_node_position_set(data->mesh_node_convex_hull, 0.0, 0.0, 0.0);
evas_canvas3d_node_scale_set(data->mesh_node_convex_hull, SCALE_SPHERE, SCALE_SPHERE, SCALE_SPHERE);
evas_canvas3d_node_mesh_add(data->mesh_node_convex_hull, data->mesh_sphere_ch);
data->mesh_node_blender =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_member_add(data->root_node, data->mesh_node_blender);
evas_canvas3d_node_position_set(data->mesh_node_blender, -3.0, 0.0, 0.0);
evas_canvas3d_node_scale_set(data->mesh_node_blender, SCALE_SPHERE, SCALE_SPHERE, SCALE_SPHERE);
@@ -396,7 +396,7 @@ _scene_setup(Scene_Data *data)
evas_canvas3d_scene_background_color_set(data->scene, 0.0, 0.0, 0.0, 0.0);
data->root_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
_camera_setup(data);
_light_setup(data);
@@ -433,13 +433,13 @@ main(void)
/* Add a background rectangle object. */
background = efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas);
efl_gfx_color_set(background, 0, 0, 0, 255);
- efl_gfx_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(background, EINA_TRUE);
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(background, EINA_TRUE);
/* Add an image object for 3D scene rendering. */
image = efl_add(EFL_CANVAS_SCENE3D_CLASS, evas);
- efl_gfx_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(image, EINA_TRUE);
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(image, EINA_TRUE);
evas_object_show(image),
evas_object_focus_set(image, EINA_TRUE);
diff --git a/src/examples/evas/evas-3d-md2.c b/src/examples/evas/evas-3d-md2.c
index aed2781b07..adfb6962a0 100644
--- a/src/examples/evas/evas-3d-md2.c
+++ b/src/examples/evas/evas-3d-md2.c
@@ -68,8 +68,8 @@ _on_canvas_resize(Ecore_Evas *ee)
int w, h;
ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
- efl_gfx_size_set(background, EINA_SIZE2D(w, h));
- efl_gfx_size_set(image, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(w, h));
}
int
@@ -94,14 +94,14 @@ main(void)
scene = efl_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
/* Add the root node for the scene. */
- root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
/* Add the camera. */
camera = efl_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
evas_canvas3d_camera_projection_perspective_set(camera, 60.0, 1.0, 1.0, 500.0);
camera_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
evas_canvas3d_node_camera_set(camera_node, camera);
evas_canvas3d_node_member_add(root_node, camera_node);
evas_canvas3d_node_position_set(camera_node, 100.0, 0.0, 20.0);
@@ -114,7 +114,7 @@ main(void)
evas_canvas3d_light_directional_set(light, EINA_TRUE);
light_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
evas_canvas3d_node_light_set(light_node, light);
evas_canvas3d_node_position_set(light_node, 1000.0, 0.0, 1000.0);
evas_canvas3d_node_look_at_set(light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -142,7 +142,7 @@ main(void)
evas_canvas3d_material_color_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0);
evas_canvas3d_material_shininess_set(material, 50.0);
- mesh_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ mesh_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_member_add(root_node, mesh_node);
evas_canvas3d_node_mesh_add(mesh_node, mesh);
@@ -154,13 +154,13 @@ main(void)
/* Add a background rectangle object. */
background = efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas);
efl_gfx_color_set(background, 0, 0, 0, 255);
- efl_gfx_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(background, EINA_TRUE);
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(background, EINA_TRUE);
/* Add an image object for 3D scene rendering. */
image = efl_add(EFL_CANVAS_SCENE3D_CLASS, evas);
- efl_gfx_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(image, EINA_TRUE);
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(image, EINA_TRUE);
/* Set the image object as render target for 3D scene. */
efl_canvas_scene3d_set(image, scene);
diff --git a/src/examples/evas/evas-3d-mmap-set.c b/src/examples/evas/evas-3d-mmap-set.c
index fed41fa7d8..360555501e 100644
--- a/src/examples/evas/evas-3d-mmap-set.c
+++ b/src/examples/evas/evas-3d-mmap-set.c
@@ -36,7 +36,7 @@
efl_file_mmap_set(mesh_##extention, extention##_file, NULL); \
evas_canvas3d_mesh_frame_material_set(mesh_##extention, 0, material); \
evas_canvas3d_mesh_shader_mode_set(mesh_##extention, EVAS_CANVAS3D_SHADER_MODE_PHONG); \
- node_##extention = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH)); \
+ node_##extention = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH)); \
evas_canvas3d_node_member_add(root_node, node_##extention); \
evas_canvas3d_node_mesh_add(node_##extention, mesh_##extention); \
evas_canvas3d_node_position_set(node_##extention, initial_node_data[number * 10], \
@@ -155,8 +155,8 @@ _on_canvas_resize(Ecore_Evas *ee)
int w, h;
ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
- efl_gfx_size_set(background, EINA_SIZE2D(w, h));
- efl_gfx_size_set(image, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(w, h));
}
int
@@ -184,14 +184,14 @@ main(void)
scene = efl_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
/* Add the root node for the scene. */
- root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
/* Add the camera. */
camera = efl_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
evas_canvas3d_camera_projection_perspective_set(camera, 10.0, 1.0, 1.0, 500.0);
camera_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
evas_canvas3d_node_camera_set(camera_node, camera);
evas_canvas3d_node_member_add(root_node, camera_node);
evas_canvas3d_node_position_set(camera_node, 0.0, 0.0, 100.0);
@@ -204,7 +204,7 @@ main(void)
evas_canvas3d_light_directional_set(light, EINA_TRUE);
light_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
evas_canvas3d_node_light_set(light_node, light);
evas_canvas3d_node_position_set(light_node, 1.0, 0.0, 100.0);
evas_canvas3d_node_look_at_set(light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -235,13 +235,13 @@ main(void)
/* Add a background rectangle object. */
background = efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas);
efl_gfx_color_set(background, 20, 20, 200, 255);
- efl_gfx_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(background, EINA_TRUE);
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(background, EINA_TRUE);
/* Add an image object for 3D scene rendering. */
image = efl_add(EFL_CANVAS_SCENE3D_CLASS, evas);
- efl_gfx_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(image, EINA_TRUE);
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(image, EINA_TRUE);
/* Set the image object as render target for 3D scene. */
efl_canvas_scene3d_set(image, scene);
diff --git a/src/examples/evas/evas-3d-obj.c b/src/examples/evas/evas-3d-obj.c
index 5f3454c3ba..e04da98a01 100644
--- a/src/examples/evas/evas-3d-obj.c
+++ b/src/examples/evas/evas-3d-obj.c
@@ -50,7 +50,7 @@
efl_file_set(mesh[num], full_file_path, NULL); \
evas_canvas3d_mesh_frame_material_set(mesh[num], 0, name_of_material); \
evas_canvas3d_mesh_shader_mode_set(mesh[num], shade_mode); \
- mesh_node[num] = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH)); \
+ mesh_node[num] = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH)); \
evas_canvas3d_node_member_add(root_node, mesh_node[num]); \
evas_canvas3d_node_mesh_add(mesh_node[num], mesh[num]); \
evas_canvas3d_node_position_set(mesh_node[num], 0, Y, Z); \
@@ -133,8 +133,8 @@ _on_canvas_resize(Ecore_Evas *ee)
int w, h;
ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
- efl_gfx_size_set(background, EINA_SIZE2D(w, h));
- efl_gfx_size_set(image, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(w, h));
}
int
@@ -162,14 +162,14 @@ main(void)
scene = efl_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
/* Add the root node for the scene. */
- root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
/* Add the camera. */
camera = efl_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
evas_canvas3d_camera_projection_perspective_set(camera, 20.0, 1.0, 1.0, 500.0);
camera_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
evas_canvas3d_node_camera_set(camera_node, camera);
evas_canvas3d_node_member_add(root_node, camera_node);
evas_canvas3d_node_position_set(camera_node, 100.0, 0.0, 0.0);
@@ -182,7 +182,7 @@ main(void)
evas_canvas3d_light_directional_set(light, EINA_TRUE);
light_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
evas_canvas3d_node_light_set(light_node, light);
evas_canvas3d_node_position_set(light_node, 10.0, 0.0, 0.0);
evas_canvas3d_node_look_at_set(light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -216,13 +216,13 @@ main(void)
/* Add a background rectangle MESHES. */
background = efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas);
efl_gfx_color_set(background, 0, 0, 0, 255);
- efl_gfx_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(background, EINA_TRUE);
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(background, EINA_TRUE);
/* Add an image object for 3D scene rendering. */
image = efl_add(EFL_CANVAS_SCENE3D_CLASS, evas);
- efl_gfx_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(image, EINA_TRUE);
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(image, EINA_TRUE);
/* Set the image object as render target for 3D scene. */
efl_canvas_scene3d_set(image, scene);
diff --git a/src/examples/evas/evas-3d-parallax-occlusion.c b/src/examples/evas/evas-3d-parallax-occlusion.c
index ec98f94d39..83188c0538 100644
--- a/src/examples/evas/evas-3d-parallax-occlusion.c
+++ b/src/examples/evas/evas-3d-parallax-occlusion.c
@@ -80,8 +80,8 @@ _on_canvas_resize(Ecore_Evas *ee)
int w, h;
ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
- efl_gfx_size_set(background, EINA_SIZE2D(w, h));
- efl_gfx_size_set(image, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(w, h));
}
static Eina_Bool
@@ -108,7 +108,7 @@ _camera_setup(Scene_Data *data)
evas_canvas3d_camera_projection_perspective_set(data->camera, 30.0, 1.0, 2.0, 50.0);
- data->camera_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
+ data->camera_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
evas_canvas3d_node_camera_set(data->camera_node, data->camera);
evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 10.0);
evas_canvas3d_node_look_at_set(data->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -123,7 +123,7 @@ _light_setup(Scene_Data *data)
evas_canvas3d_light_diffuse_set(data->light, 1.0, 1.0, 1.0, 1.0);
evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0);
- data->light_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
+ data->light_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
evas_canvas3d_node_light_set(data->light_node, data->light);
evas_canvas3d_node_position_set(data->light_node, -20.0, 20.0, 50.0);
evas_canvas3d_node_look_at_set(data->light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -191,7 +191,7 @@ _mesh_setup(Scene_Data *data)
evas_canvas3d_mesh_frame_material_set(data->mesh, 100, data->material_wood);
- data->mesh_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ data->mesh_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_member_add(data->root_node, data->mesh_node);
evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh);
evas_canvas3d_node_scale_set(data->mesh_node, 3, 3, 3);
@@ -204,7 +204,7 @@ _scene_setup(Scene_Data *data)
evas_canvas3d_scene_size_set(data->scene, WIDTH, HEIGHT);
evas_canvas3d_scene_background_color_set(data->scene, 0.0, 0.0, 0.0, 0.0);
- data->root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ data->root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
_camera_setup(data);
_light_setup(data);
@@ -239,13 +239,13 @@ main(void)
/* Add a background rectangle object. */
background = efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas);
efl_gfx_color_set(background, 0, 0, 0, 255);
- efl_gfx_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(background, EINA_TRUE);
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(background, EINA_TRUE);
/* Add an image object for 3D scene rendering. */
image = efl_add(EFL_CANVAS_SCENE3D_CLASS, evas);
- efl_gfx_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(image, EINA_TRUE);
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(image, EINA_TRUE);
evas_object_focus_set(image, EINA_TRUE);
/* Set the image object as render target for 3D scene. */
diff --git a/src/examples/evas/evas-3d-pick.c b/src/examples/evas/evas-3d-pick.c
index 2129722add..1e2f3d6ead 100644
--- a/src/examples/evas/evas-3d-pick.c
+++ b/src/examples/evas/evas-3d-pick.c
@@ -120,14 +120,14 @@ main(void)
scene = efl_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
/* Add the root node for the scene. */
- root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
/* Add the camera. */
camera = efl_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
evas_canvas3d_camera_projection_perspective_set(camera, 30.0, 1.0, 1.0, 100.0);
camera_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
evas_canvas3d_node_camera_set(camera_node, camera);
evas_canvas3d_node_position_set(camera_node, 0.0, 0.0, 2.5);
evas_canvas3d_node_look_at_set(camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -154,7 +154,7 @@ main(void)
evas_canvas3d_material_color_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0);
evas_canvas3d_material_shininess_set(material, 50.0);
- mesh_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ mesh_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_member_add(root_node, mesh_node);
evas_canvas3d_node_mesh_add(mesh_node, mesh);
@@ -169,13 +169,13 @@ main(void)
/* Add evas objects. */
background = efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas);
efl_gfx_color_set(background, 0, 0, 0, 255);
- efl_gfx_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(background, EINA_TRUE);
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(background, EINA_TRUE);
image = efl_add(EFL_CANVAS_SCENE3D_CLASS, evas);
efl_canvas_scene3d_set(image, scene);
- efl_gfx_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(image, EINA_TRUE);
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(image, EINA_TRUE);
evas_object_event_callback_add(image, EVAS_CALLBACK_MOUSE_DOWN,
_on_mouse_down, NULL);
diff --git a/src/examples/evas/evas-3d-ply.c b/src/examples/evas/evas-3d-ply.c
index d0e396c536..821195b30e 100644
--- a/src/examples/evas/evas-3d-ply.c
+++ b/src/examples/evas/evas-3d-ply.c
@@ -98,8 +98,8 @@ _on_canvas_resize(Ecore_Evas *ee)
int w, h;
ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
- efl_gfx_size_set(background, EINA_SIZE2D(w, h));
- efl_gfx_size_set(image, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(w, h));
}
int
@@ -133,13 +133,13 @@ main(void)
scene = efl_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
/* Add the root node for the scene. */
- root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
/* Add the camera. */
camera = efl_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
evas_canvas3d_camera_projection_perspective_set(camera, 60.0, 1.0, 1.0, 500.0);
- camera_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
+ camera_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
evas_canvas3d_node_camera_set(camera_node, camera);
evas_canvas3d_node_member_add(root_node, camera_node);
evas_canvas3d_node_position_set(camera_node, 15.0, 0.0, 0.0);
@@ -151,7 +151,7 @@ main(void)
evas_canvas3d_light_specular_set(light, 1.0, 1.0, 1.0, 1.0);
evas_canvas3d_light_directional_set(light, EINA_TRUE);
- light_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
+ light_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
evas_canvas3d_node_light_set(light_node, light);
evas_canvas3d_node_position_set(light_node, 1000.0, 0.0, 1000.0);
evas_canvas3d_node_look_at_set(light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -196,7 +196,7 @@ main(void)
evas_canvas3d_mesh_shader_mode_set(mesh[i], draw_mode[(i % 8)]);
}
- mesh_node[i] = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ mesh_node[i] = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_member_add(root_node, mesh_node[i]);
evas_canvas3d_node_mesh_add(mesh_node[i], mesh[i]);
evas_canvas3d_node_position_set(mesh_node[i], 0, ((i % 4) * 4) + ((i / 16) * 1) - 6.5, (((i % 16) / 4) * 4) - 6);
@@ -210,13 +210,13 @@ main(void)
/* Add a background rectangle object. */
background = efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas);
efl_gfx_color_set(background, 100, 100, 100, 255);
- efl_gfx_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(background, EINA_TRUE);
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(background, EINA_TRUE);
/* Add an image object for 3D scene rendering. */
image = efl_add(EFL_CANVAS_SCENE3D_CLASS, evas);
- efl_gfx_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(image, EINA_TRUE);
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(image, EINA_TRUE);
/* Set the image object as render target for 3D scene. */
efl_canvas_scene3d_set(image, scene);
diff --git a/src/examples/evas/evas-3d-proxy.c b/src/examples/evas/evas-3d-proxy.c
index 4ee8091a96..6445ee9564 100644
--- a/src/examples/evas/evas-3d-proxy.c
+++ b/src/examples/evas/evas-3d-proxy.c
@@ -63,8 +63,8 @@ _on_canvas_resize(Ecore_Evas *ee)
int w, h;
ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
- efl_gfx_size_set(background, EINA_SIZE2D(w, h));
- efl_gfx_size_set(image, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(w, h));
}
static Eina_Bool
@@ -121,7 +121,7 @@ _camera_setup(Scene_Data *data)
evas_canvas3d_camera_projection_perspective_set(data->camera, 30.0, 1.0, 2.0, 50.0);
data->camera_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
evas_canvas3d_node_camera_set(data->camera_node, data->camera);
evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 5.0);
evas_canvas3d_node_look_at_set(data->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -137,7 +137,7 @@ _light_setup(Scene_Data *data)
evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0);
data->light_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
evas_canvas3d_node_light_set(data->light_node, data->light);
evas_canvas3d_node_position_set(data->light_node, 0.0, 0.0, 10.0);
evas_canvas3d_node_look_at_set(data->light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
@@ -174,7 +174,7 @@ _mesh_setup(Scene_Data *data)
evas_canvas3d_mesh_frame_material_set(data->mesh, 0, data->material);
data->mesh_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_member_add(data->root_node, data->mesh_node);
evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh);
@@ -188,7 +188,7 @@ _scene_setup(Scene_Data *data)
evas_canvas3d_scene_background_color_set(data->scene, 0.0, 0.0, 0.0, 0.0);
data->root_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
_camera_setup(data);
_light_setup(data);
@@ -221,16 +221,16 @@ main(void)
/* Add a background rectangle object. */
background = efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas);
efl_gfx_color_set(background, 0, 0, 0, 255);
- efl_gfx_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(background, EINA_TRUE);
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(background, EINA_TRUE);
/* Add a background image. */
#ifdef USE_EO_IMAGE
source = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
efl_gfx_buffer_copy_set(source, NULL, EINA_SIZE2D(IMG_WIDTH, IMG_HEIGHT), 0, EFL_GFX_COLORSPACE_ARGB8888, 0);
- efl_gfx_position_set(source, EINA_POSITION2D((WIDTH / 2), (HEIGHT / 2)));
- efl_gfx_size_set(source, EINA_SIZE2D((WIDTH / 2), (HEIGHT / 2)));
- efl_gfx_visible_set(source, EINA_TRUE);
+ efl_gfx_entity_position_set(source, EINA_POSITION2D((WIDTH / 2), (HEIGHT / 2)));
+ efl_gfx_entity_size_set(source, EINA_SIZE2D((WIDTH / 2), (HEIGHT / 2)));
+ efl_gfx_entity_visible_set(source, EINA_TRUE);
#else
source = evas_object_image_filled_add(evas);
evas_object_image_size_set(source, IMG_WIDTH, IMG_HEIGHT);
@@ -241,8 +241,8 @@ main(void)
/* Add an image object for 3D scene rendering. */
image = efl_add(EFL_CANVAS_SCENE3D_CLASS, evas);
- efl_gfx_size_set(image, EINA_SIZE2D((WIDTH / 2), (HEIGHT / 2)));
- efl_gfx_visible_set(image, EINA_TRUE);
+ efl_gfx_entity_size_set(image, EINA_SIZE2D((WIDTH / 2), (HEIGHT / 2)));
+ efl_gfx_entity_visible_set(image, EINA_TRUE);
/* Setup scene */
_scene_setup(&data);
diff --git a/src/examples/evas/evas-3d-shadows.c b/src/examples/evas/evas-3d-shadows.c
index 5571384456..ae06a3631a 100644
--- a/src/examples/evas/evas-3d-shadows.c
+++ b/src/examples/evas/evas-3d-shadows.c
@@ -181,8 +181,8 @@ _on_canvas_resize(Ecore_Evas *ee)
int w, h;
ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
- efl_gfx_size_set(background, EINA_SIZE2D(w, h));
- efl_gfx_size_set(image, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(w, h));
}
static void
@@ -214,7 +214,7 @@ _sphere_setup(Body_3D *sphere)
_body_material_set(sphere, 1, 0.0, 0.0);
- sphere->node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH), evas_canvas3d_node_position_set(efl_added, 3.0, 3.0, 0.0));
+ sphere->node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH), evas_canvas3d_node_position_set(efl_added, 3.0, 3.0, 0.0));
evas_canvas3d_node_mesh_add(sphere->node, sphere->mesh);
}
@@ -231,7 +231,7 @@ _cone_setup(Body_3D *cone)
_body_material_set(cone, 0.8, 0.5, 0.5);
cone->node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_mesh_add(cone->node, cone->mesh);
evas_canvas3d_node_orientation_angle_axis_set(cone->node, -90.0, 1.0, 0.0, 0.0);
evas_canvas3d_node_position_set(cone->node, -4.0, 0.0, -3.0);
@@ -250,7 +250,7 @@ _cylinder_setup(Body_3D *cylinder)
_body_material_set(cylinder, 0.0, 0.0, 1.0);
cylinder->node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_mesh_add(cylinder->node, cylinder->mesh);
evas_canvas3d_node_orientation_angle_axis_set(cylinder->node, -90.0, 1.0, 0.0, 0.0);
evas_canvas3d_node_position_set(cylinder->node, -2.0, 3.0, 1.0);
@@ -298,7 +298,7 @@ _fence_setup(Body_3D *fence)
evas_canvas3d_mesh_alpha_test_enable_set(fence->mesh, EINA_TRUE);
evas_canvas3d_mesh_shader_mode_set(fence->mesh, EVAS_CANVAS3D_SHADER_MODE_NORMAL_MAP);
fence->node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_mesh_add(fence->node, fence->mesh);
evas_canvas3d_node_orientation_angle_axis_set(fence->node, -90.0, 1.0, 0.0, 0.0);
evas_canvas3d_node_scale_set(fence->node, 10.0, 10.0, 5.0);
@@ -317,7 +317,7 @@ _square_setup(Body_3D *square)
_body_material_set(square, 0.4, 0.4, 0.4);
square->node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_mesh_add(square->node, square->mesh);
evas_canvas3d_node_position_set(square->node, 0.0, -1.0, 0.0);
evas_canvas3d_node_scale_set(square->node, 30.0, 30.0, 30.0);
@@ -335,7 +335,7 @@ _box_setup(Body_3D *box)
_body_material_set(box, 0, 1, 0);
- box->node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ box->node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_mesh_add(box->node, box->mesh);
evas_canvas3d_node_position_set(box->node, 3.0, 0.0, -3.0);
}
@@ -363,7 +363,7 @@ _model_setup(Body_3D *model)
evas_canvas3d_mesh_shader_mode_set(model->mesh, EVAS_CANVAS3D_SHADER_MODE_PHONG);
model->node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_mesh_add(model->node, model->mesh);
evas_canvas3d_node_scale_set(model->node, 0.1, 0.1, 0.1);
evas_canvas3d_node_orientation_angle_axis_set(model->node, 120.0, -0.577, -0.577, -0.577);
@@ -394,7 +394,7 @@ _billboard_setup(Scene_Data *data)
evas_canvas3d_mesh_blending_enable_set(data->billboard.mesh, EINA_TRUE);
evas_canvas3d_mesh_blending_func_set(data->billboard.mesh, EVAS_CANVAS3D_BLEND_FUNC_SRC_ALPHA, EVAS_CANVAS3D_BLEND_FUNC_ONE_MINUS_SRC_ALPHA);
- data->billboard.node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ data->billboard.node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_mesh_add(data->billboard.node, data->billboard.mesh);
evas_canvas3d_node_position_set(data->billboard.node, 0.0, 2.0, 0.0);
evas_canvas3d_node_scale_set(data->billboard.node, 2.2, 4.6, 4.0);
@@ -406,12 +406,12 @@ static void
_camera_setup(Scene_Data *data)
{
data->camera = efl_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
- data->mediator = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ data->mediator = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
evas_canvas3d_camera_projection_perspective_set(data->camera, 50.0, 1.0, 2.0, 100.0);
data->camera_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
evas_canvas3d_node_camera_set(data->camera_node, data->camera);
@@ -434,7 +434,7 @@ _light_setup(Scene_Data *data)
evas_canvas3d_light_projection_perspective_set(data->light, 40.0, 1.0, 2.0, 1000.0);
data->light_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
evas_canvas3d_node_light_set(data->light_node, data->light);
evas_canvas3d_node_position_set(data->light_node, 50.0, 50.0, 70.0);
evas_canvas3d_node_look_at_set(data->light_node, EVAS_CANVAS3D_SPACE_PARENT, 15.0, 0.0, -5.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 1.0);
@@ -452,7 +452,7 @@ _scene_setup(Scene_Data *data)
evas_canvas3d_scene_background_color_set(data->scene, BG_COLOR, 1);
data->root_node =
- efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
_camera_setup(data);
@@ -644,13 +644,13 @@ main(void)
/* Add a background rectangle object. */
background = efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas);
efl_gfx_color_set(background, 0, 0, 0, 255);
- efl_gfx_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(background, EINA_TRUE);
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(background, EINA_TRUE);
/* Add an image object for 3D scene rendering. */
image = efl_add(EFL_CANVAS_SCENE3D_CLASS, evas);
- efl_gfx_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(image, EINA_TRUE);
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(image, EINA_TRUE);
evas_object_anti_alias_set(image, EINA_TRUE);
evas_object_focus_set(image, EINA_TRUE);
/* Set the image object as render target for 3D scene. */
diff --git a/src/examples/evas/evas-3d-static-lod.c b/src/examples/evas/evas-3d-static-lod.c
index 4e3c3994e0..d7672a48b5 100644
--- a/src/examples/evas/evas-3d-static-lod.c
+++ b/src/examples/evas/evas-3d-static-lod.c
@@ -66,8 +66,8 @@ _on_canvas_resize(Ecore_Evas *ee)
int w, h;
ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
- efl_gfx_size_set(background, EINA_SIZE2D(w, h));
- efl_gfx_size_set(image, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(w, h));
}
static Eina_Bool
@@ -117,7 +117,7 @@ _camera_setup(Scene_Data *data)
data->camera_node =
efl_add(EVAS_CANVAS3D_NODE_CLASS, evas,
- evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
+ evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
evas_canvas3d_node_camera_set(data->camera_node, data->camera);
evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 300.0);
evas_canvas3d_node_look_at_set(data->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
@@ -135,7 +135,7 @@ _light_setup(Scene_Data *data)
data->light_node =
efl_add(EVAS_CANVAS3D_NODE_CLASS, evas,
- evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
+ evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
evas_canvas3d_node_light_set(data->light_node, data->light);
evas_canvas3d_node_position_set(data->light_node, 0.0, 0.0, 300.0);
evas_canvas3d_node_look_at_set(data->light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
@@ -161,16 +161,16 @@ _mesh_setup(Scene_Data *data)
data->lod_mesh_node1 =
efl_add(EVAS_CANVAS3D_NODE_CLASS, evas,
- evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_position_set(data->lod_mesh_node1, 2.0, 0.0, 0.0);
data->lod_mesh_node2 =
efl_add(EVAS_CANVAS3D_NODE_CLASS, evas,
- evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
data->complex_node =
efl_add(EVAS_CANVAS3D_NODE_CLASS, evas,
- evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
evas_canvas3d_node_scale_set(data->complex_node, 30.0, 30.0, 30.0);
/* Setup mesh. One model, two meshes object with different lod distances.*/
@@ -210,7 +210,7 @@ _scene_setup(Scene_Data *data)
data->root_node =
efl_add(EVAS_CANVAS3D_NODE_CLASS, evas,
- evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
_camera_setup(data);
_light_setup(data);
@@ -256,13 +256,13 @@ main(void)
/* Add a background rectangle object. */
background = efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas);
efl_gfx_color_set(background, 0, 0, 0, 255);
- efl_gfx_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(background, EINA_TRUE);
+ efl_gfx_entity_size_set(background, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(background, EINA_TRUE);
/* Add an image object for 3D scene rendering. */
image = efl_add(EFL_CANVAS_SCENE3D_CLASS, evas);
- efl_gfx_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(image, EINA_TRUE);
+ efl_gfx_entity_size_set(image, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(image, EINA_TRUE);
evas_object_focus_set(image, EINA_TRUE);
/* Set the image object as render target for 3D scene. */
efl_canvas_scene3d_set(image, data.scene);
diff --git a/src/examples/evas/evas-event-filter.c b/src/examples/evas/evas-event-filter.c
index 530aba9b5a..dc25750871 100644
--- a/src/examples/evas/evas-event-filter.c
+++ b/src/examples/evas/evas-event-filter.c
@@ -165,7 +165,7 @@ _device_added_removed_cb(void *data, const Efl_Event *event)
if (efl_input_device_type_get(dev) != EFL_INPUT_DEVICE_TYPE_SEAT)
return;
- if (event->desc == EFL_CANVAS_EVENT_DEVICE_ADDED)
+ if (event->desc == EFL_CANVAS_SCENE_EVENT_DEVICE_ADDED)
{
if (ctx->allowed_seat)
efl_input_seat_event_filter_set(ctx->filtered_obj,
@@ -180,8 +180,8 @@ _device_added_removed_cb(void *data, const Efl_Event *event)
}
EFL_CALLBACKS_ARRAY_DEFINE(_device_callbacks,
- { EFL_CANVAS_EVENT_DEVICE_ADDED, _device_added_removed_cb },
- { EFL_CANVAS_EVENT_DEVICE_REMOVED, _device_added_removed_cb });
+ { EFL_CANVAS_SCENE_EVENT_DEVICE_ADDED, _device_added_removed_cb },
+ { EFL_CANVAS_SCENE_EVENT_DEVICE_REMOVED, _device_added_removed_cb });
EFL_CALLBACKS_ARRAY_DEFINE(_obj_callbacks,
{ EFL_EVENT_FOCUS_IN, _obj_events_cb },
diff --git a/src/examples/evas/evas-gl.c b/src/examples/evas/evas-gl.c
index 81601dc0c8..3694d3c9bc 100644
--- a/src/examples/evas/evas-gl.c
+++ b/src/examples/evas/evas-gl.c
@@ -338,6 +338,12 @@ _animator_cb(void *data)
//pixel get callback then.
evas_object_image_pixels_dirty_set(img, EINA_TRUE);
+ //If you know the specific region to be updated, specify here for the patial rendering.
+ //Otherwise, full image region will be redrawn on the canvas.
+ Evas_Coord w, h;
+ evas_object_geometry_get(img, NULL, NULL, &w, &h);
+ evas_object_image_data_update_add(img, 0, 0, w, h);
+
return ECORE_CALLBACK_RENEW;
}
diff --git a/src/examples/evas/evas-images5.c b/src/examples/evas/evas-images5.c
index 951b5b4237..ed8a4e5541 100644
--- a/src/examples/evas/evas-images5.c
+++ b/src/examples/evas/evas-images5.c
@@ -121,13 +121,13 @@ _on_keydown(void *data EINA_UNUSED,
efl_orientation_set(d.img, EFL_ORIENT_270);
break;
case 4:
- efl_flip_set(d.img, EFL_FLIP_HORIZONTAL);
+ efl_orientation_flip_set(d.img, EFL_FLIP_HORIZONTAL);
break;
case 5:
- efl_flip_set(d.img, EFL_FLIP_VERTICAL);
+ efl_orientation_flip_set(d.img, EFL_FLIP_VERTICAL);
break;
case 6:
- efl_flip_set(d.img, EFL_FLIP_NONE);
+ efl_orientation_flip_set(d.img, EFL_FLIP_NONE);
break;
}
}
diff --git a/src/examples/evas/evas-map-utils-eo.c b/src/examples/evas/evas-map-utils-eo.c
index 34fae5e5be..e1767cd1c3 100644
--- a/src/examples/evas/evas-map-utils-eo.c
+++ b/src/examples/evas/evas-map-utils-eo.c
@@ -71,8 +71,9 @@ _anim_cb(void *data)
App_Data *ad = data;
Evas_Object *o;
Eina_Rect rect;
- int r, g, b, a, f, h, w;
+ int r, g, b, a, f;
int win_w, win_h, mx, my;
+ Eina_Size2D size;
f = ad->frame;
r = ad->colors[ad->colors_index].r;
@@ -90,13 +91,13 @@ _anim_cb(void *data)
o = evas_object_name_find(ad->canvas, "obj2");
- h = efl_gfx_size_get(o).h;
+ size = efl_gfx_entity_size_get(o);
efl_gfx_map_reset(o);
efl_gfx_map_smooth_set(o, ad->smooth);
efl_gfx_map_alpha_set(o, ad->alpha);
efl_gfx_map_color_set(o, -1, r, g, b, a);
efl_gfx_map_translate(o, 0, 0, 100);
- efl_gfx_map_rotate_3d(o, f * 6, f * 6, f * 6, NULL, 1./3., 10. / h, 0);
+ efl_gfx_map_rotate_3d(o, f * 6, f * 6, f * 6, NULL, 1./3., 10. / size.h, 0);
if (ad->apply_lighting)
{
efl_gfx_map_lightning_3d(o, ad->canvas, 0.5, 0.5, -100.,
@@ -105,13 +106,13 @@ _anim_cb(void *data)
o = evas_object_name_find(ad->canvas, "obj3");
- EINA_SIZE2D(w, h) = efl_gfx_size_get(o);
+ size = efl_gfx_entity_size_get(o);
efl_gfx_map_reset(o);
efl_gfx_map_smooth_set(o, ad->smooth);
efl_gfx_map_alpha_set(o, ad->alpha);
efl_gfx_map_color_set(o, -1, r, g, b, a);
- efl_gfx_map_translate(o, 0, h/2, -20);
- efl_gfx_map_rotate_3d(o, 20, f * 6, 0, NULL, 0.5, 0.5, w / 2);
+ efl_gfx_map_translate(o, 0, size.h/2, -20);
+ efl_gfx_map_rotate_3d(o, 20, f * 6, 0, NULL, 0.5, 0.5, size.w / 2);
if (ad->apply_perspective)
efl_gfx_map_perspective_3d(o, NULL, 0.5, 0.5, 0, 256);
if (ad->apply_lighting)
@@ -122,13 +123,13 @@ _anim_cb(void *data)
-256, 255, 255, 255, 0, 0, 0);
}
if (ad->backface_culling)
- efl_gfx_visible_set(o, efl_gfx_map_clockwise_get(o));
+ efl_gfx_entity_visible_set(o, efl_gfx_map_clockwise_get(o));
else
- efl_gfx_visible_set(o, 1);
+ efl_gfx_entity_visible_set(o, 1);
o = evas_object_name_find(ad->canvas, "obj4");
- rect = efl_gfx_geometry_get(o);
+ rect = efl_gfx_entity_geometry_get(o);
efl_gfx_map_reset(o);
efl_gfx_map_smooth_set(o, ad->smooth);
efl_gfx_map_alpha_set(o, ad->alpha);
diff --git a/src/examples/evas/evas-multiseat-events.c b/src/examples/evas/evas-multiseat-events.c
index c0659f06ff..bc99bd3246 100644
--- a/src/examples/evas/evas-multiseat-events.c
+++ b/src/examples/evas/evas-multiseat-events.c
@@ -212,15 +212,15 @@ _dev_added_or_removed(void *data EINA_UNUSED, const Efl_Event *event)
printf("The seat '%s' - description: '%s' was '%s'\n",
efl_name_get(dev),
efl_comment_get(dev),
- event->desc == EFL_CANVAS_EVENT_DEVICE_ADDED ? "added" : "removed");
+ event->desc == EFL_CANVAS_SCENE_EVENT_DEVICE_ADDED ? "added" : "removed");
}
EFL_CALLBACKS_ARRAY_DEFINE(canvas_callbacks,
- { EFL_CANVAS_EVENT_OBJECT_FOCUS_IN,
+ { EFL_CANVAS_SCENE_EVENT_OBJECT_FOCUS_IN,
_canvas_focus_in_cb },
- { EFL_CANVAS_EVENT_DEVICE_ADDED,
+ { EFL_CANVAS_SCENE_EVENT_DEVICE_ADDED,
_dev_added_or_removed },
- { EFL_CANVAS_EVENT_DEVICE_REMOVED,
+ { EFL_CANVAS_SCENE_EVENT_DEVICE_REMOVED,
_dev_added_or_removed });
EFL_CALLBACKS_ARRAY_DEFINE(callbacks,
diff --git a/src/examples/evas/evas-object-manipulation-eo.c b/src/examples/evas/evas-object-manipulation-eo.c
index ef61a50aec..551d2873f7 100644
--- a/src/examples/evas/evas-object-manipulation-eo.c
+++ b/src/examples/evas/evas-object-manipulation-eo.c
@@ -55,7 +55,7 @@ _canvas_resize_cb(Ecore_Evas *ee)
int w, h;
ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
- efl_gfx_size_set(d.bg, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(d.bg, EINA_SIZE2D(w, h));
}
static void
@@ -141,8 +141,8 @@ _on_keydown(void *data EINA_UNUSED,
Eina_Bool visibility;
/* Don't use "get"-"set" expressions in one eo_do call,
* if you pass parameter to "set" by value. */
- visibility = efl_gfx_visible_get(d.clipper);
- efl_gfx_visible_set(d.clipper, !visibility);
+ visibility = efl_gfx_entity_visible_get(d.clipper);
+ efl_gfx_entity_visible_set(d.clipper, !visibility);
printf("Clipper is now %s\n", visibility ? "hidden" : "visible");
return;
}
@@ -176,11 +176,11 @@ main(void)
evas_object_name_set(d.bg, "background rectangle");
efl_gfx_color_set(d.bg, 255, 255, 255, 255);
/* white bg */
- efl_gfx_position_set(d.bg, EINA_POSITION2D(0, 0));
+ efl_gfx_entity_position_set(d.bg, EINA_POSITION2D(0, 0));
/* at canvas' origin */
- efl_gfx_size_set(d.bg, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_size_set(d.bg, EINA_SIZE2D(WIDTH, HEIGHT));
/* covers full canvas */
- efl_gfx_visible_set(d.bg, EINA_TRUE);
+ efl_gfx_entity_visible_set(d.bg, EINA_TRUE);
evas_object_focus_set(d.bg, EINA_TRUE);
evas_object_event_callback_add(
@@ -202,9 +202,9 @@ main(void)
}
else
{
- efl_gfx_position_set(d.img, EINA_POSITION2D(0, 0));
- efl_gfx_size_set(d.img, EINA_SIZE2D(WIDTH, HEIGHT));
- efl_gfx_visible_set(d.img, EINA_TRUE);
+ efl_gfx_entity_position_set(d.img, EINA_POSITION2D(0, 0));
+ efl_gfx_entity_size_set(d.img, EINA_SIZE2D(WIDTH, HEIGHT));
+ efl_gfx_entity_visible_set(d.img, EINA_TRUE);
printf("Image object added, class name is: %s\n",
efl_class_name_get(d.img));
}
@@ -220,11 +220,11 @@ main(void)
}
else
{
- efl_image_border_set(d.clipper_border, 3, 3, 3, 3);
- efl_image_border_center_fill_set(d.clipper_border, EFL_GFX_BORDER_FILL_MODE_NONE);
- efl_gfx_position_set(d.clipper_border, EINA_POSITION2D((WIDTH / 4) -3, (HEIGHT / 4) - 3));
- efl_gfx_size_set(d.clipper_border, EINA_SIZE2D((WIDTH / 2) + 6, (HEIGHT / 2) + 6));
- efl_gfx_visible_set(d.clipper_border, EINA_TRUE);
+ efl_gfx_image_border_set(d.clipper_border, 3, 3, 3, 3);
+ efl_gfx_image_border_center_fill_set(d.clipper_border, EFL_GFX_BORDER_FILL_MODE_NONE);
+ efl_gfx_entity_position_set(d.clipper_border, EINA_POSITION2D((WIDTH / 4) -3, (HEIGHT / 4) - 3));
+ efl_gfx_entity_size_set(d.clipper_border, EINA_SIZE2D((WIDTH / 2) + 6, (HEIGHT / 2) + 6));
+ efl_gfx_entity_visible_set(d.clipper_border, EINA_TRUE);
}
/* solid white clipper (note that it's the default color for a
@@ -232,9 +232,9 @@ main(void)
* by 255) */
d.clipper = efl_add(EFL_CANVAS_RECTANGLE_CLASS, d.canvas);
- efl_gfx_position_set(d.clipper, EINA_POSITION2D(WIDTH / 4, HEIGHT / 4));
- efl_gfx_size_set(d.clipper, EINA_SIZE2D(WIDTH / 2, HEIGHT / 2));
- efl_gfx_visible_set(d.clipper, EINA_TRUE);
+ efl_gfx_entity_position_set(d.clipper, EINA_POSITION2D(WIDTH / 4, HEIGHT / 4));
+ efl_gfx_entity_size_set(d.clipper, EINA_SIZE2D(WIDTH / 2, HEIGHT / 2));
+ efl_gfx_entity_visible_set(d.clipper, EINA_TRUE);
efl_canvas_object_clip_set(d.img, d.clipper);
diff --git a/src/examples/evas/evas-vg-batman.c b/src/examples/evas/evas-vg-batman.c
index 6800daf248..650709f250 100644
--- a/src/examples/evas/evas-vg-batman.c
+++ b/src/examples/evas/evas-vg-batman.c
@@ -18,6 +18,14 @@
#define WIDTH 800
#define HEIGHT 600
+#ifndef EFL_BETA_API_SUPPORT
+#define EFL_BETA_API_SUPPORT
+#endif
+
+#ifndef EFL_EO_API_SUPPORT
+#define EFL_EO_API_SUPPORT
+#endif
+
#include <Eo.h>
#include <Efl.h>
#include <Evas.h>
@@ -57,7 +65,6 @@ static const char *batmans_path[] = {
static void
_on_delete(Ecore_Evas *ee EINA_UNUSED)
{
- ecore_animator_del(animation);
ecore_main_loop_quit();
}
@@ -125,24 +132,30 @@ main(void)
for (i = 0; i < sizeof (batmans_path) / sizeof (batmans_path[0]); i++)
{
- batmans_vg[i] = evas_vg_shape_add(NULL);
- evas_vg_node_color_set(batmans_vg[i], 0, 0, 0, 255);
- evas_vg_shape_stroke_color_set(batmans_vg[i], 128, 10,10, 128);
- evas_vg_shape_stroke_width_set(batmans_vg[i], 4.0);
- evas_vg_shape_stroke_join_set(batmans_vg[i], EFL_GFX_JOIN_MITER);
+ batmans_vg[i] = evas_vg_shape_add(vg);
+ evas_vg_node_origin_set(batmans_vg[i], 100, 150);
+
if(i % 2)
- {
- evas_vg_shape_stroke_color_set(batmans_vg[i], 10, 10,128, 128);
- evas_vg_shape_stroke_width_set(batmans_vg[i], 2.0);
- evas_vg_node_color_set(batmans_vg[i], 120, 120, 120, 255);
- evas_vg_shape_stroke_join_set(batmans_vg[i], EFL_GFX_JOIN_ROUND);
- }
- evas_vg_shape_append_svg_path(batmans_vg[i], batmans_path[i]);
+ {
+ evas_vg_node_color_set(batmans_vg[i], 120, 120, 120, 255);
+ evas_vg_shape_stroke_color_set(batmans_vg[i], 10, 10,128, 128);
+ evas_vg_shape_stroke_width_set(batmans_vg[i], 2.0);
+ evas_vg_shape_stroke_join_set(batmans_vg[i], EFL_GFX_JOIN_ROUND);
+ }
+ else
+ {
+ evas_vg_node_color_set(batmans_vg[i], 0, 0, 0, 255);
+ evas_vg_shape_stroke_color_set(batmans_vg[i], 128, 10,10, 128);
+ evas_vg_shape_stroke_width_set(batmans_vg[i], 4.0);
+ evas_vg_shape_stroke_join_set(batmans_vg[i], EFL_GFX_JOIN_MITER);
+ }
+
+ evas_vg_shape_append_svg_path(batmans_vg[i], batmans_path[i]);
}
animation = ecore_animator_timeline_add(1, _animator, NULL);
- root = evas_vg_container_add(NULL);
+ root = evas_vg_container_add(vg);
evas_object_vg_root_node_set(vg, root);
@@ -151,7 +164,6 @@ main(void)
eina_matrix3_scale(&matrix, 1.1, 1.1);
evas_vg_node_transformation_set(root, &matrix);
-
circle = evas_vg_shape_add(root);
evas_vg_shape_append_circle(circle, WIDTH / 2, HEIGHT / 2, 200);
evas_vg_node_color_set(circle, 255, 255, 255, 255);
diff --git a/src/examples/evas/evas-vg-simple.c b/src/examples/evas/evas-vg-simple.c
index 111fc3ef3c..36b8baaf55 100644
--- a/src/examples/evas/evas-vg-simple.c
+++ b/src/examples/evas/evas-vg-simple.c
@@ -309,7 +309,7 @@ _1_basic_shape_test()
evas_object_event_callback_add(d.vg, EVAS_CALLBACK_KEY_DOWN, _basic_shape_key_handle, NULL);
puts(basic_shape_menu);
- container = evas_vg_container_add(NULL);
+ container = evas_vg_container_add(d.vg);
// Line
shape = evas_vg_shape_add(container);
@@ -471,25 +471,26 @@ _2_interpolation_test()
Efl_VG *shape;
reset_test();
+
evas_object_event_callback_add(d.vg, EVAS_CALLBACK_KEY_DOWN, _interpolation_key_handle, NULL);
animator = ecore_animator_timeline_add(1, _interpolation_keyframe, NULL);
puts(interpolation_menu);
- shape = evas_vg_shape_add(NULL);
+ shape = evas_vg_shape_add(d.vg);
evas_vg_shape_append_svg_path(shape, morph1[0]);
evas_vg_shape_stroke_color_set(shape, 255, 0, 0, 255);
evas_vg_shape_stroke_width_set(shape, 5);
evas_vg_node_origin_set(shape, 100, 100);
d.shape_list = eina_list_append(d.shape_list, shape);
- shape = evas_vg_shape_add(NULL);
+ shape = evas_vg_shape_add(d.vg);
evas_vg_shape_append_svg_path(shape, morph1[1]);
evas_vg_shape_stroke_color_set(shape, 0, 0, 255, 255);
evas_vg_shape_stroke_width_set(shape, 10);
evas_vg_node_origin_set(shape, 150, 150);
d.shape_list = eina_list_append(d.shape_list, shape);
- shape = evas_vg_shape_add(NULL);
+ shape = evas_vg_shape_add(d.vg);
evas_vg_node_origin_set(shape, 150, 150);
d.shape_list = eina_list_append(d.shape_list, shape);
@@ -517,13 +518,14 @@ _main_menu()
// create the initial screen
d.vg = evas_object_vg_add(d.evas);
evas_object_show(d.vg);
- shape = evas_vg_shape_add(NULL);
+
+ shape = evas_vg_shape_add(d.vg);
evas_vg_shape_append_svg_path(shape, batman);
evas_vg_node_color_set(shape, 10, 0, 0, 10);
evas_vg_node_origin_set(shape, 0, 100);
evas_object_vg_root_node_set(d.vg, shape);
-
+
_canvas_resize_cb(d.ee);
puts(main_menu);
}
diff --git a/src/examples/evas/evas_mono_box.cs b/src/examples/evas/evas_mono_box.cs
index cdc4b8b150..97c161c536 100644
--- a/src/examples/evas/evas_mono_box.cs
+++ b/src/examples/evas/evas_mono_box.cs
@@ -4,7 +4,7 @@ using System.Runtime.CompilerServices;
public class MyBox : evas.BoxInherit
{
- public MyBox(efl.Object parent) : base(parent) {}
+ public MyBox(efl.IObject parent) : base(parent) {}
[DllImport("evas")] static extern void evas_obj_box_layout_vertical(IntPtr obj, IntPtr data, IntPtr privdata);
[DllImport("evas")] static extern void evas_obj_box_layout_horizontal(IntPtr obj, IntPtr data, IntPtr privdata);
@@ -32,18 +32,18 @@ class TestMain
{
efl.All.Init();
- efl.Loop loop = new efl.LoopConcrete();
+ efl.Loop loop = new efl.Loop();
EcoreEvas ecore_evas = new EcoreEvas();
- efl.canvas.Object canvas = ecore_evas.canvas;
+ efl.canvas.IObject canvas = ecore_evas.canvas;
canvas.SetVisible(true);
- efl.Object parent = canvas.GetParent();
+ efl.IObject parent = canvas.GetParent();
System.Diagnostics.Debug.Assert(parent.raw_handle != IntPtr.Zero);
- evas.Box box = new MyBox(canvas);
+ evas.IBox box = new MyBox(canvas);
eina.Size2D size = new eina.Size2D();
size.W = 320;
@@ -52,7 +52,7 @@ class TestMain
box.SetSize(size);
box.SetVisible(true);
- efl.canvas.Rectangle rect = new efl.canvas.RectangleConcrete(canvas);
+ efl.canvas.Rectangle rect = new efl.canvas.Rectangle(canvas);
rect.SetColor(0, 0, 255, 255);
size.W = 320;
size.H = 120;
@@ -60,7 +60,7 @@ class TestMain
rect.SetVisible(true);
box.Append(rect);
- efl.canvas.Rectangle rect2 = new efl.canvas.RectangleConcrete(canvas);
+ efl.canvas.Rectangle rect2 = new efl.canvas.Rectangle(canvas);
rect2.SetColor(0, 255, 0, 255);
rect2.SetSize(size);
rect2.SetVisible(true);
diff --git a/src/examples/evas/evas_mono_image.cs b/src/examples/evas/evas_mono_image.cs
index ff84db5d9a..47f9b36023 100644
--- a/src/examples/evas/evas_mono_image.cs
+++ b/src/examples/evas/evas_mono_image.cs
@@ -6,7 +6,7 @@ class TestMain
static int WIDTH = 320;
static int HEIGHT = 240;
- evas.Image image;
+ evas.IImage image;
static string ImagePath([CallerFilePath] string folder="")
@@ -14,7 +14,7 @@ class TestMain
return System.IO.Path.GetDirectoryName(folder);
}
- public TestMain(evas.Image image)
+ public TestMain(evas.IImage image)
{
this.image = image;
}
@@ -23,18 +23,18 @@ class TestMain
{
efl.All.Init();
- efl.Loop loop = new efl.LoopConcrete();
+ efl.Loop loop = new efl.Loop();
EcoreEvas ecore_evas = new EcoreEvas();
eina.Size2D size = new eina.Size2D();
- efl.canvas.Object canvas = ecore_evas.canvas;
+ efl.canvas.IObject canvas = ecore_evas.canvas;
canvas.SetVisible(true);
- efl.Object parent = canvas.GetParent();
+ efl.IObject parent = canvas.GetParent();
System.Diagnostics.Debug.Assert(parent.raw_handle != IntPtr.Zero);
- efl.canvas.Rectangle bg = new efl.canvas.RectangleConcrete(canvas);
+ efl.canvas.Rectangle bg = new efl.canvas.Rectangle(canvas);
bg.SetColor(255, 255, 255, 255);
size.W = WIDTH;
size.H = HEIGHT;
@@ -42,7 +42,7 @@ class TestMain
bg.SetVisible(true);
string valid_path = args[0];
- evas.Image image = new evas.ImageConcrete(canvas);
+ evas.Image image = new evas.Image(canvas);
image.SetFile(valid_path, null);
/* FIXME evas-image uses error handling code from
diff --git a/src/examples/evas/evas_mono_image2.cs b/src/examples/evas/evas_mono_image2.cs
index e2ae49f092..1f0e52ac62 100644
--- a/src/examples/evas/evas_mono_image2.cs
+++ b/src/examples/evas/evas_mono_image2.cs
@@ -12,17 +12,17 @@ class TestMain
{
efl.All.Init();
- efl.Loop loop = new efl.LoopConcrete();
+ efl.Loop loop = new efl.Loop();
EcoreEvas ecore_evas = new EcoreEvas();
eina.Size2D size = new eina.Size2D();
eina.Position2D pos = new eina.Position2D();
- efl.canvas.Object canvas = ecore_evas.canvas;
+ efl.canvas.IObject canvas = ecore_evas.canvas;
canvas.SetVisible(true);
- efl.canvas.Rectangle bg = new efl.canvas.RectangleConcrete(canvas);
+ efl.canvas.Rectangle bg = new efl.canvas.Rectangle(canvas);
bg.SetColor(255, 255, 255, 255);
pos.X = 0;
pos.Y = 0;
@@ -33,7 +33,7 @@ class TestMain
bg.SetVisible(true);
string path = args[0];
- evas.Image logo = new evas.ImageConcrete(canvas);
+ evas.Image logo = new evas.Image(canvas);
logo.SetFillAuto(true);
// TODO add preloaded support (depends on events)
@@ -53,7 +53,7 @@ class TestMain
pixels[i] = generator.Next();
}
- evas.Image noise_img = new evas.ImageConcrete(canvas);
+ evas.Image noise_img = new evas.Image(canvas);
size.W = WIDTH / 4;
size.H = HEIGHT / 4;
noise_img.SetSize(size);
@@ -66,7 +66,7 @@ class TestMain
noise_img.SetVisible(true);
Console.WriteLine("Creating noise image with sizez %d, %d", WIDTH/4, HEIGHT/4);
- efl.canvas.Proxy proxy_img = new efl.canvas.ProxyConcrete(canvas);
+ efl.canvas.Proxy proxy_img = new efl.canvas.Proxy(canvas);
proxy_img.SetSource(noise_img);
pos.X = WIDTH / 2;
pos.Y = HEIGHT / 2;
diff --git a/src/examples/evas/evas_mono_rectangle.cs b/src/examples/evas/evas_mono_rectangle.cs
index de686b0609..c31c24785e 100644
--- a/src/examples/evas/evas_mono_rectangle.cs
+++ b/src/examples/evas/evas_mono_rectangle.cs
@@ -14,15 +14,15 @@ class TestMain
efl.All.Init();
- efl.Loop loop = new efl.LoopConcrete();
+ efl.Loop loop = new efl.Loop();
EcoreEvas ecore_evas = new EcoreEvas();
- efl.canvas.Object canvas = ecore_evas.canvas;
+ efl.canvas.IObject canvas = ecore_evas.canvas;
canvas.SetVisible(true);
- efl.Object parent = canvas.GetParent();
+ efl.IObject parent = canvas.GetParent();
System.Diagnostics.Debug.Assert(parent.raw_handle != IntPtr.Zero);
- efl.canvas.Rectangle rect = new efl.canvas.RectangleConcrete(canvas);
+ efl.canvas.Rectangle rect = new efl.canvas.Rectangle(canvas);
rect.SetColor(colors[0, 0], colors[0, 1], colors[0, 2], 255);
eina.Size2D size = new eina.Size2D();
size.W = 640;
@@ -30,7 +30,7 @@ class TestMain
rect.SetSize(size);
rect.SetVisible(true);
- canvas.KEY_DOWN += (object sender, efl.input.KEY_DOWN_Args e) => {
+ canvas.KeyDownEvt += (object sender, efl.input.Interface.KeyDownEvt_Args e) => {
color_index = (color_index + 1) % 3;
Console.WriteLine("Key Down");
Console.WriteLine("Got key obj at {0}", e.arg.raw_handle.ToString("X"));
diff --git a/src/examples/evas/evas_mono_table.cs b/src/examples/evas/evas_mono_table.cs
index e79ad7c956..db329b22cd 100644
--- a/src/examples/evas/evas_mono_table.cs
+++ b/src/examples/evas/evas_mono_table.cs
@@ -11,7 +11,7 @@ class TestMain
{
efl.All.Init();
- efl.Loop loop = new efl.LoopConcrete();
+ efl.Loop loop = new efl.Loop();
EcoreEvas ecore_evas = new EcoreEvas();
@@ -21,25 +21,25 @@ class TestMain
eina.Size2D hint = new eina.Size2D();
- efl.canvas.Object canvas = ecore_evas.canvas;
+ efl.canvas.IObject canvas = ecore_evas.canvas;
canvas.SetVisible(true);
- efl.Object parent = canvas.GetParent();
+ efl.IObject parent = canvas.GetParent();
System.Diagnostics.Debug.Assert(parent.raw_handle != IntPtr.Zero);
- efl.canvas.Rectangle bg = new efl.canvas.RectangleConcrete(canvas);
+ efl.canvas.Rectangle bg = new efl.canvas.Rectangle(canvas);
bg.SetColor(255, 255, 255, 255);
bg.SetSize(size);
bg.SetVisible(true);
- evas.Table table = new evas.TableConcrete(canvas);
+ evas.Table table = new evas.Table(canvas);
table.SetHomogeneous(evas.object_table.Homogeneous_Mode.None);
table.SetPadding(0, 0);
table.SetSize(size);
table.SetVisible(true);
- efl.canvas.Rectangle rect = new efl.canvas.RectangleConcrete(canvas);
+ efl.canvas.Rectangle rect = new efl.canvas.Rectangle(canvas);
rect.SetColor(255, 0, 0, 255);
hint.W = 100;
hint.H = 50;
@@ -47,7 +47,7 @@ class TestMain
rect.SetVisible(true);
table.Pack(rect, 1, 1, 2, 1);
- rect = new efl.canvas.RectangleConcrete(canvas);
+ rect = new efl.canvas.Rectangle(canvas);
rect.SetColor(0, 255, 0, 255);
hint.W = 50;
hint.H = 100;
@@ -55,7 +55,7 @@ class TestMain
rect.SetVisible(true);
table.Pack(rect, 1, 2, 1, 2);
- rect = new efl.canvas.RectangleConcrete(canvas);
+ rect = new efl.canvas.Rectangle(canvas);
rect.SetColor(0, 0, 255, 255);
hint.W = 50;
hint.H = 50;
@@ -63,7 +63,7 @@ class TestMain
rect.SetVisible(true);
table.Pack(rect, 2, 2, 1, 1);
- rect = new efl.canvas.RectangleConcrete(canvas);
+ rect = new efl.canvas.Rectangle(canvas);
rect.SetColor(255, 255, 0, 255);
rect.SetHintMin(hint);
rect.SetVisible(true);
diff --git a/src/examples/evas/evas_mono_text.cs b/src/examples/evas/evas_mono_text.cs
index 071cba218b..a1532a4583 100644
--- a/src/examples/evas/evas_mono_text.cs
+++ b/src/examples/evas/evas_mono_text.cs
@@ -22,8 +22,8 @@ class TestMain
static int HEIGHT = 240;
private EcoreEvas ecore_evas;
- private efl.canvas.Object canvas;
- private efl.canvas.Rectangle bg;
+ private efl.canvas.IObject canvas;
+ private efl.canvas.IRectangle bg;
private evas.Text text;
private evas.Image border;
@@ -34,7 +34,7 @@ class TestMain
canvas = ecore_evas.canvas;
canvas.SetVisible(true);
- bg = new efl.canvas.RectangleConcrete(canvas);
+ bg = new efl.canvas.Rectangle(canvas);
bg.SetColor(255, 255, 255, 255);
position.X = 0;
position.Y = 0;
@@ -45,9 +45,9 @@ class TestMain
bg.SetVisible(true);
bg.SetKeyFocus(true);
- bg.KEY_DOWN += On_KeyDown;
+ bg.KeyDownEvt += On_KeyDown;
- text = new evas.TextConcrete(canvas);
+ text = new evas.Text(canvas);
text.SetStyle(evas.Text_Style_Type.OutlineSoftShadow);
text.SetColor(0, 0, 0, 255);
@@ -71,7 +71,7 @@ class TestMain
Console.WriteLine("Adding text object with font {0} and size {1}", font, size);
// setup border
- border = new evas.ImageConcrete(canvas);
+ border = new evas.Image(canvas);
border.SetFile(border_file, null);
border.SetBorder(3, 3, 3, 3);
border.SetBorderCenterFill(0);
@@ -87,7 +87,7 @@ class TestMain
}
- private void On_KeyDown(object sender, efl.input.KEY_DOWN_Args e)
+ private void On_KeyDown(object sender, efl.input.Interface.KeyDownEvt_Args e)
{
var key = e.arg.GetKey();
@@ -114,7 +114,7 @@ class TestMain
if (args.Length >= 1)
border_path = args[0];
- efl.Loop loop = new efl.LoopConcrete();
+ efl.Loop loop = new efl.Loop();
TestMain t = new TestMain(border_path);
loop.Begin();
diff --git a/src/examples/evas/shooter/evas-3d-shooter-header.c b/src/examples/evas/shooter/evas-3d-shooter-header.c
index 5c3dfaf8de..8053f53cbb 100644
--- a/src/examples/evas/shooter/evas-3d-shooter-header.c
+++ b/src/examples/evas/shooter/evas-3d-shooter-header.c
@@ -29,8 +29,8 @@ _camera_setup(Scene_Data *data)
data->camera = efl_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
evas_canvas3d_camera_projection_perspective_set(data->camera, 65.0, 1.0, 1.0, 300.0);
- data->mediator_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
- data->camera_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
+ data->mediator_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ data->camera_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
evas_canvas3d_node_member_add(data->root_node, data->mediator_node);
evas_canvas3d_node_member_add(data->mediator_node, data->camera_node);
@@ -50,7 +50,7 @@ _light_setup(Scene_Data *data)
evas_canvas3d_light_specular_set(data->light, 0.2, 0.2, 0.2, 1.0);
evas_canvas3d_light_projection_perspective_set(data->light, 100.0, 1.0, 1.0, 200.0);
- data->light_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
+ data->light_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
evas_canvas3d_node_light_set(data->light_node, data->light);
evas_canvas3d_node_position_set(data->light_node, -30.0, 70.0, 0.0);
diff --git a/src/examples/evas/shooter/evas-3d-shooter-macros.h b/src/examples/evas/shooter/evas-3d-shooter-macros.h
index a062e5e4eb..9cb92a6cf8 100644
--- a/src/examples/evas/shooter/evas-3d-shooter-macros.h
+++ b/src/examples/evas/shooter/evas-3d-shooter-macros.h
@@ -144,7 +144,7 @@ typedef struct _vec2
#define SETUP_MESH_NODE(Name) \
- data->mesh_node_##Name = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH)); \
+ data->mesh_node_##Name = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH)); \
\
evas_canvas3d_node_mesh_add(data->mesh_node_##Name, data->mesh_##Name);
diff --git a/src/examples/evas/shooter/evas-3d-shooter.c b/src/examples/evas/shooter/evas-3d-shooter.c
index 74f6584be9..ae6bedee7f 100644
--- a/src/examples/evas/shooter/evas-3d-shooter.c
+++ b/src/examples/evas/shooter/evas-3d-shooter.c
@@ -1004,7 +1004,7 @@ _scene_setup(Scene_Data *data)
evas_canvas3d_scene_size_set(global_scene, WIDTH, HEIGHT);
evas_canvas3d_scene_background_color_set(global_scene, 0.5, 0.5, 0.9, 0.0);
- data->root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ data->root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
_camera_setup(data);
_light_setup(data);
@@ -1069,7 +1069,7 @@ _scene_setup(Scene_Data *data)
}
}
- data->carp_mediator_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ data->carp_mediator_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_member_add(data->carp_mediator_node, data->mesh_node_carpet);
diff --git a/src/lib/ecore/Ecore.h b/src/lib/ecore/Ecore.h
index 7b8d04e311..e31252a380 100644
--- a/src/lib/ecore/Ecore.h
+++ b/src/lib/ecore/Ecore.h
@@ -281,15 +281,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ECORE_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ECORE_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -300,7 +300,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#ifdef _WIN32
# define WIN32_LEAN_AND_MEAN
diff --git a/src/lib/ecore/Ecore_Common.h b/src/lib/ecore/Ecore_Common.h
index 6102341446..c446fb3b05 100644
--- a/src/lib/ecore/Ecore_Common.h
+++ b/src/lib/ecore/Ecore_Common.h
@@ -698,6 +698,19 @@ struct _Ecore_Event_Signal_Realtime
EAPI Ecore_Event_Handler *ecore_event_handler_add(int type, Ecore_Event_Handler_Cb func, const void *data);
/**
+ * @brief Adds an event handler to the beginning of the handler list.
+ * @param type The type of the event this handler will get called for
+ * @param func The function to call when the event is found in the queue
+ * @param data A data pointer to pass to the called function @p func
+ * @return A new Event handler, or @c NULL on failure.
+ *
+ * This function is identical to ecore_event_handler_add() except that it
+ * creates the handler at the start of the list. Do not use this function.
+ * @since 1.21
+ */
+EAPI Ecore_Event_Handler *ecore_event_handler_prepend(int type, Ecore_Event_Handler_Cb func, const void *data);
+
+/**
* @brief Deletes an event handler.
* @param event_handler Event handler handle to delete
* @return Data passed to handler
@@ -1022,9 +1035,6 @@ enum _Ecore_Exe_Win32_Priority
};
typedef enum _Ecore_Exe_Win32_Priority Ecore_Exe_Win32_Priority;
-#ifdef EFL_BETA_API_SUPPORT
-#include "ecore_exe.eo.h"
-#endif
#include "ecore_exe.eo.legacy.h"
#define _ECORE_EXE_EO_CLASS_TYPE
@@ -1597,9 +1607,9 @@ EAPI double ecore_loop_time_get(void);
/**
* Sets the loop time.
- *
+ *
* @param t The new loop time
- *
+ *
* You should never need/call this, unless you are implementing a custom
* tick source for an ecore animator. Only then inside your function that
* calls ecore_animator_custom_tick(), just before it, if you are able to
@@ -1611,7 +1621,7 @@ EAPI double ecore_loop_time_get(void);
* you get from ecore_time_get() and ecore_loop_time_get() (same 0 point).
* What this point is is undefined, sou unless your source uses the same
* 0 time, then you may have to adjust and do some guessing.
- *
+ *
* @see ecore_animator_custom_tick()
* @see ecore_loop_time_get()
* @since 1.11
@@ -2009,13 +2019,13 @@ EAPI int ecore_thread_pending_total_get(void);
*
* This returns the maximum number of Ecore_Thread's that may be running at
* the same time. If this number is reached, new jobs started by either
- *ecore_thread_run() or ecore_thread_feedback_run() will be added to the
+ * ecore_thread_run() or ecore_thread_feedback_run() will be added to the
* respective pending queue until one of the running threads finishes its
* task and becomes available to run a new one.
*
- * By default, this will be the number of available CPUs for the
- * running program (as returned by eina_cpu_count()), or 1 if this value
- * could not be fetched.
+ * By default, this will be the proportional to the number of CPU cores
+ * found, and will be at least 1 so at least 1 worker can run through
+ * the quque of work to do.
*
* @see ecore_thread_max_set()
* @see ecore_thread_max_reset()
@@ -2028,8 +2038,10 @@ EAPI int ecore_thread_max_get(void);
* @param num The new maximum
*
* This sets a new value for the maximum number of concurrently running
- * Ecore_Thread's. It @b must an integer between 1 and (16 * @c x), where @c x
- * is the number for CPUs available.
+ * Ecore_Thread's. It @b must an interger of at least 1 and may be limited
+ * to a reasonable value as to not overload the system too much with
+ * too many workers. This limit may change based on the number of CPU
+ * cores detected.
*
* @see ecore_thread_max_get()
* @see ecore_thread_max_reset()
@@ -2402,14 +2414,14 @@ EAPI Ecore_Pipe *ecore_pipe_add(Ecore_Pipe_Cb handler, const void *data);
/**
* Creates a pipe with more parameters.
- *
+ *
* @param handler Same as ecore_pipe_add()
* @param data Same as ecore_pipe_add()
* @param fd_read An fd to use for reading or @c -1 otherwise
* @param fd_write An fd to use for writing or @c -1 otherwise
* @param read_survive_fork Should read fd survive a fork
* @param write_survive_fork Should write fd survive a fork
- *
+ *
* This is the same as ecore_pipe_add() but with some added parameters.
*
* @return A pointer to the new Ecore_Pipe object on success, else NULL.
@@ -3195,17 +3207,4 @@ typedef struct _Ecore_Job Ecore_Job; /**< A job handle */
* @}
*/
-
-#ifdef EFL_BETA_API_SUPPORT
-
-/*
- * @brief Function callback type for when creating Ecore_Thread that
- * uses Efl_Future for communication.
- */
-typedef void (*Ecore_Thread_Future_Cb)(const void *data, Eo *promise, Ecore_Thread *thread);
-
-EAPI Efl_Future *ecore_thread_future_run(Ecore_Thread_Future_Cb heavy, const void *data, Eina_Free_Cb free_cb);
-
-#endif
-
#endif
diff --git a/src/lib/ecore/Ecore_Eo.h b/src/lib/ecore/Ecore_Eo.h
index d1da269f30..26a5834b6f 100644
--- a/src/lib/ecore/Ecore_Eo.h
+++ b/src/lib/ecore/Ecore_Eo.h
@@ -16,21 +16,6 @@
* @}
*/
-/**
- * @ingroup Ecore_Exe_Group
- *
- * @{
- */
-
-#include "ecore_exe.eo.h"
-
-/**
- * @}
- */
-
-
-#include "ecore_event_message.eo.h"
-#include "ecore_event_message_handler.eo.h"
#include "efl_loop_message_future.eo.h"
#include "efl_loop_message_future_handler.eo.h"
@@ -44,7 +29,14 @@
#include "efl_loop_message.eo.h"
#include "efl_loop_message_handler.eo.h"
+#include "efl_task.eo.h"
+#include "efl_thread.eo.h"
+#include "efl_threadio.eo.h"
+#include "efl_exe.eo.h"
+
#include "efl_loop.eo.h"
+#include "efl_app.eo.h"
+#include "efl_appthread.eo.h"
/**
* @brief Quits the main loop once all the events currently on the queue have
@@ -83,23 +75,9 @@ EAPI Eina_Future_Scheduler *efl_loop_future_scheduler_get(const Eo *obj);
*/
EAPI Eina_Promise *efl_loop_promise_new(const Eo *obj, Eina_Promise_Cancel_Cb cancel_cb, const void *data);
-/**
- * @brief Create a promise attached to the main loop
- *
- * @param cancel_cb A callback used to inform that the promise was canceled. Use
- * this callback to @c free @p data. @p cancel_cb must not be @c NULL !
- * @param data Data to @p cancel_cb.
- * @return A promise or @c NULL on error.
- *
- * @see eina_promise_new()
- */
-EAPI Eina_Promise *efl_loop_main_promise_new(Eina_Promise_Cancel_Cb cancel_cb, const void *data);
-
#include "efl_loop_fd.eo.h"
#include "efl_loop_handler.eo.h"
-#include "efl_promise.eo.h"
-
#include "efl_interpolator.eo.h"
#include "efl_interpolator_linear.eo.h"
#include "efl_interpolator_accelerate.eo.h"
@@ -112,63 +90,7 @@ EAPI Eina_Promise *efl_loop_main_promise_new(Eina_Promise_Cancel_Cb cancel_cb, c
/* We ue the factory pattern here, so you shouldn't call eo_add directly. */
EAPI Eo *efl_main_loop_get(void);
-
-/**
- * Sync with main loop and lock it out and begin a mainloop eo context
- *
- * @result The number of time ecore_thread_main_loop_begin() has been called
- * in this thread. If not, it returns @c -1.
- *
- * This function suspends the main loop in a safe state and then lets
- * use any EFL call you want after it returns as if it were running in the
- * main loop (except it's called from the calling thread). Be careful since
- * the main loop is blocked until you call efl_main_loop_release(). This is
- * the only sane way to achieve pseudo thread safety.
- *
- * Note that until the main loop is blocked, this function stalls until the
- * main loop comes to a safe point to be paused.
- */
-EAPI int efl_main_loop_steal(void);
-
-/* Release a main loop lock taken by efl_main_loop_steal()
- *
- * @result The number of times efl_main_loop_release() needs to be called
- * before the main loop is unlocked again. @c -1 will be returned if you
- * are trying to unlock when no matching call to efl_main_loop_steal() was
- * made by this thread.
- */
-EAPI int efl_main_loop_release(void);
-
-typedef struct _Efl_Future_Composite_Progress Efl_Future_All_Progress;
-
-struct _Efl_Future_Composite_Progress
-{
- Efl_Future *inprogress;
- void *progress;
-
- unsigned int index;
-};
-
-EAPI Efl_Future *efl_future_all_internal(Efl_Future *f1, ...);
-EAPI Efl_Future *efl_future_iterator_all(Eina_Iterator *it);
-
-#define efl_future_all(...) efl_future_all_internal(__VA_ARGS__, NULL)
-
-typedef struct _Efl_Future_Race_Success Efl_Future_Race_Success;
-typedef struct _Efl_Future_Composite_Progress Efl_Future_Race_Progress;
-
-struct _Efl_Future_Race_Success
-{
- Efl_Future *winner;
- void *value;
-
- unsigned int index;
-};
-
-EAPI Efl_Future *efl_future_race_internal(Efl_Future *f1, ...);
-EAPI Efl_Future *efl_future_iterator_race(Eina_Iterator *it);
-
-#define efl_future_race(...) efl_future_race_internal(__VA_ARGS__, NULL)
+EAPI Eo *efl_app_get(void);
/**
* @}
@@ -205,6 +127,7 @@ EAPI Efl_Future *efl_future_iterator_race(Eina_Iterator *it);
#include "efl_model_item.eo.h"
#include "efl_model_container.eo.h"
#include "efl_model_container_item.eo.h"
+#include "efl_model_composite.eo.h"
#include "efl_model_composite_boolean.eo.h"
#include "efl_model_composite_boolean_children.eo.h"
#include "efl_model_composite_selection.eo.h"
diff --git a/src/lib/ecore/Ecore_Getopt.h b/src/lib/ecore/Ecore_Getopt.h
index e09a2bef2d..a4f188c8c2 100644
--- a/src/lib/ecore/Ecore_Getopt.h
+++ b/src/lib/ecore/Ecore_Getopt.h
@@ -9,15 +9,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ECORE_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ECORE_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -28,7 +28,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
/**
* @ingroup Ecore
diff --git a/src/lib/ecore/Efl_Core.h b/src/lib/ecore/Efl_Core.h
index f1fa1a4d0b..92ff448cae 100644
--- a/src/lib/ecore/Efl_Core.h
+++ b/src/lib/ecore/Efl_Core.h
@@ -16,15 +16,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ECORE_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ECORE_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -35,7 +35,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#ifdef _WIN32
# define WIN32_LEAN_AND_MEAN
diff --git a/src/lib/ecore/ecore.c b/src/lib/ecore/ecore.c
index 586f3588a4..d28de1a955 100644
--- a/src/lib/ecore/ecore.c
+++ b/src/lib/ecore/ecore.c
@@ -32,6 +32,7 @@
#include "Ecore.h"
#include "Efl_Core.h"
#include "ecore_private.h"
+#include "../../static_libs/buildsystem/buildsystem.h"
#if defined(HAVE_MALLINFO) || defined(HAVE_MALLOC_INFO)
#include <malloc.h>
@@ -68,6 +69,8 @@ static int _ecore_init_count_threshold = 0;
int _ecore_log_dom = -1;
int _ecore_fps_debug = 0;
+extern void _ecore_thread_join();
+
typedef struct _Ecore_Safe_Call Ecore_Safe_Call;
struct _Ecore_Safe_Call
{
@@ -103,6 +106,8 @@ static Eina_Condition _thread_cond;
static Eina_Lock _thread_feedback_mutex;
static Eina_Condition _thread_feedback_cond;
+Eina_Lock _environ_lock;
+
static Eina_Lock _thread_id_lock;
static int _thread_id = -1;
static int _thread_id_max = 0;
@@ -117,8 +122,6 @@ static void _systemd_watchdog_cb(void *data, const Efl_Event *event);
static Efl_Loop_Timer *_systemd_watchdog = NULL;
#endif
-static Efl_Vpath *vpath = NULL;
-
Eina_Lock _ecore_main_loop_lock;
int _ecore_main_lock_count;
@@ -162,9 +165,7 @@ ecore_system_modules_load(void)
const char **itr;
for (itr = built_modules; *itr != NULL; itr++)
{
- snprintf(buf, sizeof(buf),
- "%s/src/modules/ecore/system/%s/.libs",
- PACKAGE_BUILD_DIR, *itr);
+ bs_mod_get(buf, sizeof(buf), "ecore/system", "system");
module_list = eina_module_list_get(module_list, buf,
EINA_FALSE, NULL, NULL);
}
@@ -214,8 +215,7 @@ _efl_first_loop_iterate(void *data, const Efl_Event *event)
case 'T': fprintf(stderr, "Loop started: '%f' - '%f' = '%f' sec\n", end, _efl_startup_time, end - _efl_startup_time);
break;
}
-
- efl_event_callback_del(event->object, EFL_LOOP_EVENT_RESUME,
+ efl_event_callback_del(event->object, EFL_APP_EVENT_RESUME,
_efl_first_loop_iterate, data);
}
@@ -266,6 +266,8 @@ ecore_init(void)
goto shutdown_log_dom;
}
+ eina_lock_new(&_environ_lock);
+
efl_object_init();
if (getenv("ECORE_FPS_DEBUG")) _ecore_fps_debug = 1;
@@ -274,9 +276,6 @@ ecore_init(void)
_ecore_main_loop_init();
if (!_ecore_event_init()) goto shutdown_event;
- vpath = efl_add(EFL_VPATH_CORE_CLASS, NULL);
- if (vpath) efl_vpath_manager_register(EFL_VPATH_MANAGER_CLASS, 0, vpath);
-
_ecore_signal_init();
#ifndef HAVE_EXOTIC
_ecore_exe_init();
@@ -310,7 +309,7 @@ ecore_init(void)
_ecore_memory_statistic_file = fopen(tmp, "wb");
#endif
_ecore_memory_pid = getpid();
- ecore_animator_add(_ecore_memory_statistic, NULL);
+ ecore_poller_add(ECORE_POLLER_CORE, 1, _ecore_memory_statistic, NULL);
_ecore_memory_statistic(NULL);
}
#endif
@@ -345,13 +344,11 @@ ecore_init(void)
if (!_no_system_modules)
ecore_system_modules_load();
-
if (getenv("EFL_FIRST_LOOP"))
efl_event_callback_add(efl_main_loop_get(),
- EFL_LOOP_EVENT_RESUME,
+ EFL_APP_EVENT_RESUME,
_efl_first_loop_iterate,
getenv("EFL_FIRST_LOOP"));
-
_ecore_init_count_threshold = _ecore_init_count;
eina_log_timing(_ecore_log_dom,
@@ -390,8 +387,7 @@ ecore_shutdown(void)
}
if (_ecore_init_count-- != _ecore_init_count_threshold)
goto end;
-
- efl_event_callback_call(efl_main_loop_get(), EFL_LOOP_EVENT_TERMINATE, NULL);
+ efl_event_callback_call(efl_main_loop_get(), EFL_APP_EVENT_TERMINATE, NULL);
ecore_system_modules_unload();
@@ -428,9 +424,10 @@ ecore_shutdown(void)
* It should be fine now as we do wait for thread to shutdown before
* we try to destroy the pipe.
*/
+ _ecore_pipe_wait(_thread_call, 1, 0);
p = _thread_call;
_thread_call = NULL;
- _ecore_pipe_wait(p, 1, 0.1);
+ _ecore_pipe_wait(p, 1, 0);
_ecore_pipe_del(p);
eina_lock_free(&_thread_safety);
eina_condition_free(&_thread_cond);
@@ -439,7 +436,6 @@ ecore_shutdown(void)
eina_lock_free(&_thread_feedback_mutex);
eina_lock_free(&_thread_id_lock);
-
#ifndef HAVE_EXOTIC
_ecore_exe_shutdown();
#endif
@@ -447,12 +443,6 @@ ecore_shutdown(void)
_ecore_main_shutdown();
_ecore_signal_shutdown();
- if (vpath)
- {
- efl_del(vpath);
- vpath = NULL;
- }
-
_ecore_main_loop_shutdown();
#if defined(HAVE_MALLINFO) || defined(HAVE_MALLOC_INFO)
@@ -481,6 +471,8 @@ ecore_shutdown(void)
efl_object_shutdown();
+ eina_lock_free(&_environ_lock);
+
eina_evlog("<RUN", NULL, 0.0, NULL);
eina_shutdown();
#ifdef _WIN32
@@ -499,8 +491,8 @@ ecore_init_ex(int argc, char **argv)
if (_ecore_init_ex++ != 0) return _ecore_init_ex;
ecore_init();
- ecore_loop_arguments_send(argc - 1,
- (argc > 1) ? ((const char **) argv + 1) : NULL);
+ ecore_loop_arguments_send(argc,
+ (argc > 0) ? ((const char **)argv) : NULL);
ecore_app_args_set(argc, (const char**) argv);
return _ecore_init_ex;
@@ -571,13 +563,27 @@ ecore_fork_reset(void)
Eina_List *l, *ln;
Ecore_Fork_Cb *fcb;
+ eina_debug_fork_reset();
+
eina_main_loop_define();
eina_lock_take(&_thread_safety);
ecore_pipe_del(_thread_call);
_thread_call = ecore_pipe_add(_thread_callback, NULL);
/* If there was something in the pipe, trigger a wakeup again */
- if (_thread_cb) ecore_pipe_write(_thread_call, &wakeup, sizeof (int));
+ if (_thread_cb)
+ {
+ Ecore_Safe_Call *call;
+
+ EINA_LIST_FOREACH_SAFE(_thread_cb, l, ln, call)
+ {
+ if (call->suspend || call->sync) continue;
+ if (call->cb.async != (Ecore_Cb)&_ecore_thread_join) continue;
+ _thread_cb = eina_list_remove_list(_thread_cb, l);
+ free(call);
+ }
+ if (_thread_cb) ecore_pipe_write(_thread_call, &wakeup, sizeof (int));
+ }
eina_lock_release(&_thread_safety);
diff --git a/src/lib/ecore/ecore_anim.c b/src/lib/ecore/ecore_anim.c
index dcc89d05cd..4c614c427d 100644
--- a/src/lib/ecore/ecore_anim.c
+++ b/src/lib/ecore/ecore_anim.c
@@ -86,7 +86,7 @@ static int _ecore_anim_log_dom = -1;
#endif
#define CRI(...) EINA_LOG_DOM_CRIT(_ecore_anim_log_dom, __VA_ARGS__)
-static Eina_Bool _do_tick(void);
+static void _do_tick(void);
static Eina_Bool _ecore_animator_run(void *data);
static int animators_delete_me = 0;
@@ -110,6 +110,10 @@ static Eina_Spinlock tick_queue_lock;
static int tick_queue_count = 0;
static Eina_Bool tick_skip = EINA_FALSE;
+#ifndef _WIN32
+extern volatile int exit_signal_received;
+#endif
+
static void
_tick_send(signed char val)
{
@@ -175,14 +179,14 @@ _timer_tick_core(void *data EINA_UNUSED, Ecore_Thread *thread)
timerfd = timerfd_create(CLOCK_MONOTONIC, 0);
if (timerfd >= 0) eina_file_close_on_exec(timerfd, EINA_TRUE);
}
- if (timerfd < 0)
+ if ((timerfd < 0) && (pollfd >= 0))
{
close(pollfd);
pollfd = -1;
}
-#define INPUT_TIMER_CONTROL ((void *) ((unsigned long) 0x11))
-#define INPUT_TIMER_TIMERFD ((void *) ((unsigned long) 0x22))
+#define INPUT_TIMER_CONTROL (&(pollincoming[0]))
+#define INPUT_TIMER_TIMERFD (&(pollincoming[1]))
if (pollfd >= 0)
{
@@ -367,7 +371,11 @@ _timer_tick_notify(void *data EINA_UNUSED, Ecore_Thread *thread EINA_UNUSED, voi
if ((!tick_skip) || (tick_queued == 1))
{
ecore_loop_time_set(*t);
- _do_tick();
+#ifndef _WIN32
+ if (!exit_signal_received)
+#endif
+ _do_tick();
+ _ecore_animator_flush();
}
pt = *t;
}
@@ -481,7 +489,7 @@ _end_tick(void)
end_tick_cb((void *)end_tick_data);
}
-static Eina_Bool
+static void
_do_tick(void)
{
Ecore_Animator *animator;
@@ -510,9 +518,6 @@ _do_tick(void)
}
else animator->just_added = EINA_FALSE;
}
- if (!_ecore_animator_flush())
- return ECORE_CALLBACK_CANCEL;
- return ECORE_CALLBACK_RENEW;
}
static Ecore_Animator *
@@ -880,6 +885,7 @@ EAPI void
ecore_animator_thaw(Ecore_Animator *animator)
{
EINA_MAIN_LOOP_CHECK_RETURN;
+ if (!animator) return ;
if (animator->delete_me) return;
if (animator->suspended)
{
@@ -935,7 +941,12 @@ EAPI void
ecore_animator_custom_tick(void)
{
EINA_MAIN_LOOP_CHECK_RETURN;
- if (src == ECORE_ANIMATOR_SOURCE_CUSTOM) _do_tick();
+ if (src != ECORE_ANIMATOR_SOURCE_CUSTOM) return;
+#ifndef _WIN32
+ if (!exit_signal_received)
+#endif
+ _do_tick();
+ _ecore_animator_flush();
}
void
@@ -988,7 +999,7 @@ _ecore_animator_run(void *data)
pos = 0.0;
}
run_ret = animator->run_func(animator->run_data, pos);
- if (t >= (animator->start + animator->run) && (pos >= 1.0)) run_ret = EINA_FALSE;
+ if (eina_dbl_exact(pos, 1.0)) run_ret = EINA_FALSE;
return run_ret;
}
diff --git a/src/lib/ecore/ecore_event_message.c b/src/lib/ecore/ecore_event_message.c
index ca072f8524..768e3779b7 100644
--- a/src/lib/ecore/ecore_event_message.c
+++ b/src/lib/ecore/ecore_event_message.c
@@ -32,7 +32,7 @@ _ecore_event_message_data_set(Eo *obj EINA_UNUSED, Ecore_Event_Message_Data *pd,
}
EOLIAN static void
-_ecore_event_message_data_get(Eo *obj EINA_UNUSED, Ecore_Event_Message_Data *pd, int *type, void **data, void **free_func, void **free_data)
+_ecore_event_message_data_get(const Eo *obj EINA_UNUSED, Ecore_Event_Message_Data *pd, int *type, void **data, void **free_func, void **free_data)
{
if (type) *type = pd->type;
if (data) *data = pd->ev;
diff --git a/src/lib/ecore/ecore_event_message.eo b/src/lib/ecore/ecore_event_message.eo
index 002197a122..aae68c16e0 100644
--- a/src/lib/ecore/ecore_event_message.eo
+++ b/src/lib/ecore/ecore_event_message.eo
@@ -1,7 +1,4 @@
-import efl_types;
-import eina_types;
-
-class Ecore.Event.Message (Efl.Loop.Message)
+class Ecore.Event.Message (Efl.Loop_Message)
{
[[ For Legacy API usage Only. Legacy Ecore Events ]]
methods {
diff --git a/src/lib/ecore/ecore_event_message_handler.c b/src/lib/ecore/ecore_event_message_handler.c
index cab87a1743..1b593d0771 100644
--- a/src/lib/ecore/ecore_event_message_handler.c
+++ b/src/lib/ecore/ecore_event_message_handler.c
@@ -21,6 +21,7 @@ struct _Handler
int type;
Eina_Bool delete_me : 1;
Eina_Bool to_add : 1;
+ Eina_Bool prepend : 1;
};
struct _Filter
@@ -161,6 +162,29 @@ _ecore_event_message_handler_handler_add(Eo *obj EINA_UNUSED, Ecore_Event_Messag
}
EOLIAN static void *
+_ecore_event_message_handler_handler_prepend(Eo *obj EINA_UNUSED, Ecore_Event_Message_Handler_Data *pd, int type, void *func, void *data)
+{
+ Handler *h;
+
+ if ((type < 0) || (type > pd->event_type_count) || (!func)) return NULL;
+ h = calloc(1, sizeof(Handler));
+ if (!h) return NULL;
+ h->func = func;
+ h->data = data;
+ h->type = type;
+ if (pd->current_event_type == type)
+ {
+ h->to_add = EINA_TRUE;
+ h->prepend = EINA_TRUE;
+ pd->handlers_add = eina_list_append(pd->handlers_add, h);
+ }
+ else
+ pd->handlers[type] = eina_inlist_prepend(pd->handlers[type],
+ EINA_INLIST_GET(h));
+ return h;
+}
+
+EOLIAN static void *
_ecore_event_message_handler_handler_del(Eo *obj EINA_UNUSED, Ecore_Event_Message_Handler_Data *pd, void *handler)
{
Handler *h = handler;
@@ -344,8 +368,12 @@ _ecore_event_message_handler_efl_loop_message_handler_message_call(Eo *obj, Ecor
h->to_add = EINA_FALSE;
pd->handlers_add =
eina_list_remove_list(pd->handlers_add, l);
- pd->handlers[type] =
- eina_inlist_append(pd->handlers[type], EINA_INLIST_GET(h));
+ if (h->prepend)
+ pd->handlers[type] =
+ eina_inlist_prepend(pd->handlers[type], EINA_INLIST_GET(h));
+ else
+ pd->handlers[type] =
+ eina_inlist_append(pd->handlers[type], EINA_INLIST_GET(h));
}
}
if (pd->handlers_walking == 0)
@@ -385,18 +413,10 @@ _flush_cb(void *data, void *handler EINA_UNUSED, void *message)
{
int *type = data;
int evtype = -1;
- void *evdata = NULL, *free_func = NULL, *free_data = NULL;
- Ecore_End_Cb fn_free = NULL;
if (!efl_isa(message, ECORE_EVENT_MESSAGE_CLASS)) return EINA_TRUE;
- ecore_event_message_data_steal(message, &evtype, &evdata, &free_func, &free_data);
- if (*type != evtype) return EINA_TRUE;
- if (free_func)
- {
- fn_free = free_func;
- fn_free(free_data, evdata);
- }
- return EINA_FALSE;
+ ecore_event_message_data_get(message, &evtype, NULL, NULL, NULL);
+ return *type != evtype;
}
EOLIAN static void
diff --git a/src/lib/ecore/ecore_event_message_handler.eo b/src/lib/ecore/ecore_event_message_handler.eo
index 78047164ca..f6f9c07846 100644
--- a/src/lib/ecore/ecore_event_message_handler.eo
+++ b/src/lib/ecore/ecore_event_message_handler.eo
@@ -1,7 +1,4 @@
-import efl_types;
-import eina_types;
-
-class Ecore.Event.Message.Handler (Efl.Loop.Message.Handler)
+class Ecore.Event.Message.Handler (Efl.Loop_Message_Handler)
{
[[ For Legacy API usage Only
This class is rather hacky/messy as it's really internal glue
@@ -28,6 +25,15 @@ class Ecore.Event.Message.Handler (Efl.Loop.Message.Handler)
}
return: void_ptr; [[ Lazy return handle ]]
}
+ handler_prepend {
+ [[ Legacy list of callback handlers so they can return false ]]
+ params {
+ type: int;
+ func: void_ptr;
+ data: void_ptr;
+ }
+ return: void_ptr; [[ Lazy return handle ]]
+ }
handler_del {
params {
handler: void_ptr; [[ handler returned from handler_add() ]]
@@ -81,6 +87,6 @@ class Ecore.Event.Message.Handler (Efl.Loop.Message.Handler)
implements {
Efl.Object.constructor;
Efl.Object.destructor;
- Efl.Loop.Message.Handler.message_call; [[ Sample - override this ]]
+ Efl.Loop_Message_Handler.message_call; [[ Sample - override this ]]
}
}
diff --git a/src/lib/ecore/ecore_events.c b/src/lib/ecore/ecore_events.c
index 3911abeb67..258e10e663 100644
--- a/src/lib/ecore/ecore_events.c
+++ b/src/lib/ecore/ecore_events.c
@@ -36,6 +36,15 @@ ecore_event_handler_add(int type,
type, func, (void *)data);
}
+EAPI Ecore_Event_Handler *
+ecore_event_handler_prepend(int type,
+ Ecore_Event_Handler_Cb func,
+ const void *data)
+{
+ return ecore_event_message_handler_prepend(_event_msg_handler,
+ type, func, (void *)data);
+}
+
EAPI void *
ecore_event_handler_del(Ecore_Event_Handler *event_handler)
{
@@ -64,10 +73,14 @@ ecore_event_add(int type,
void *data)
{
Ecore_Event_Message *msg;
+ if (type <= ECORE_EVENT_NONE) return NULL;
msg = ecore_event_message_handler_message_type_add(_event_msg_handler);
- ecore_event_message_data_set(msg, type, ev, func_free, data);
- efl_loop_message_handler_message_send(_event_msg_handler, msg);
+ if (msg)
+ {
+ ecore_event_message_data_set(msg, type, ev, func_free, data);
+ efl_loop_message_handler_message_send(_event_msg_handler, msg);
+ }
return (Ecore_Event *)msg;
}
@@ -76,7 +89,7 @@ ecore_event_del(Ecore_Event *event)
{
void *data = NULL;
if (!event) return data;
- ecore_event_message_data_get((Eo *)event, NULL, &data, NULL, NULL);
+ ecore_event_message_data_get((Eo *)event, NULL, NULL, NULL, &data);
_efl_loop_message_unsend((Eo *)event);
return data;
}
diff --git a/src/lib/ecore/ecore_exe.c b/src/lib/ecore/ecore_exe.c
index 908f677539..674ca51dc6 100644
--- a/src/lib/ecore/ecore_exe.c
+++ b/src/lib/ecore/ecore_exe.c
@@ -66,7 +66,7 @@ ecore_exe_pipe_run(const char *exe_cmd,
const void *data)
{
EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
- Ecore_Exe *ret = efl_add(MY_CLASS, efl_loop_main_get(EFL_LOOP_CLASS),
+ Ecore_Exe *ret = efl_add(MY_CLASS, efl_main_loop_get(),
ecore_obj_exe_command_set(efl_added, exe_cmd,
flags));
if (ret)
@@ -86,7 +86,7 @@ _ecore_exe_command_set(Eo *obj EINA_UNUSED, Ecore_Exe_Data *pd, const char *cmd,
}
EOLIAN static void
-_ecore_exe_command_get(Eo *obj EINA_UNUSED, Ecore_Exe_Data *pd, const char **cmd, Ecore_Exe_Flags *flags)
+_ecore_exe_command_get(const Eo *obj EINA_UNUSED, Ecore_Exe_Data *pd, const char **cmd, Ecore_Exe_Flags *flags)
{
if (cmd) *cmd = pd->cmd;
if (flags) *flags = pd->flags;
diff --git a/src/lib/ecore/ecore_glib.c b/src/lib/ecore/ecore_glib.c
index bcc4b30ff9..8fc2c158bf 100644
--- a/src/lib/ecore/ecore_glib.c
+++ b/src/lib/ecore/ecore_glib.c
@@ -4,6 +4,18 @@
#include <stdlib.h>
#include <stdio.h>
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+#ifdef _WIN32
+# include <ws2tcpip.h>
+#endif
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
#include "Ecore.h"
#include "ecore_private.h"
@@ -111,6 +123,7 @@ _ecore_glib_context_poll_to(GPollFD *pfds,
int ready)
{
GPollFD *itr = pfds, *itr_end = pfds + count;
+ struct stat st;
for (; (itr < itr_end) && (ready > 0); itr++)
{
@@ -124,6 +137,19 @@ _ecore_glib_context_poll_to(GPollFD *pfds,
{
itr->revents |= G_IO_OUT;
ready--;
+ if (!fstat(itr->fd, &st))
+ {
+ if (S_ISSOCK(st.st_mode))
+ {
+ struct sockaddr_in peer;
+ socklen_t length = sizeof(peer);
+
+ memset(&peer, 0, sizeof(peer));
+ if (getpeername(itr->fd, (struct sockaddr *)&peer,
+ &length))
+ itr->revents |= G_IO_ERR;
+ }
+ }
}
if (FD_ISSET(itr->fd, efds) && (itr->events & (G_IO_HUP | G_IO_ERR)))
{
diff --git a/src/lib/ecore/ecore_internal.h b/src/lib/ecore/ecore_internal.h
index 3b60063728..8a54487aba 100644
--- a/src/lib/ecore/ecore_internal.h
+++ b/src/lib/ecore/ecore_internal.h
@@ -7,15 +7,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ECORE_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ECORE_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -26,9 +26,38 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
EAPI void ecore_loop_arguments_send(int argc, const char **argv);
+EAPI Eina_Bool efl_loop_message_process(Eo *obj);
+
+static inline Eina_Value
+efl_model_list_value_get(Eina_List *childrens,
+ unsigned int start,
+ unsigned int count)
+{
+ Eina_Value v = EINA_VALUE_EMPTY;
+ Eina_List *l;
+ Eo *child;
+
+ if (eina_list_count(childrens) < start + count)
+ return eina_value_error_init(EFL_MODEL_ERROR_INCORRECT_VALUE);
+
+ eina_value_array_setup(&v, EINA_VALUE_TYPE_OBJECT, 4);
+
+ childrens = eina_list_nth_list(childrens, start);
+
+ EINA_LIST_FOREACH(childrens, l, child)
+ {
+ if (count == 0)
+ break;
+ count--;
+
+ eina_value_array_append(&v, child);
+ }
+
+ return v;
+}
#undef EAPI
#define EAPI
diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c
index 634e87d3f3..4b27e180a2 100644
--- a/src/lib/ecore/ecore_main.c
+++ b/src/lib/ecore/ecore_main.c
@@ -136,6 +136,7 @@ struct _Ecore_Fd_Handler
Eina_Bool error_active : 1;
Eina_Bool delete_me : 1;
Eina_Bool file : 1;
+ Eina_Bool legacy : 1;
};
GENERIC_ALLOC_SIZE_DECLARE(Ecore_Fd_Handler);
@@ -215,7 +216,7 @@ static gboolean ecore_fds_ready;
static inline void
_ecore_fd_valid(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd EINA_UNUSED)
{
-# ifdef HAVE_EPOLL
+# ifdef HAVE_SYS_EPOLL_H
if ((pd->epoll_fd >= 0) &&
(fcntl(pd->epoll_fd, F_GETFD) < 0))
{
@@ -259,7 +260,7 @@ _throttle_do(Efl_Loop_Data *pd)
eina_evlog("-throttle", NULL, 0.0, NULL);
}
-#ifdef HAVE_EPOLL
+#ifdef HAVE_SYS_EPOLL_H
static inline int
_ecore_get_epoll_fd(Eo *obj, Efl_Loop_Data *pd)
{
@@ -289,9 +290,9 @@ static inline int
_ecore_poll_events_from_fdh(Ecore_Fd_Handler *fdh)
{
int events = 0;
- if (fdh->flags & ECORE_FD_READ) events |= EPOLLIN;
- if (fdh->flags & ECORE_FD_WRITE) events |= EPOLLOUT;
- if (fdh->flags & ECORE_FD_ERROR) events |= EPOLLERR | EPOLLPRI;
+ if (fdh->flags & ECORE_FD_READ) events |= EPOLLIN | EPOLLHUP;
+ if (fdh->flags & ECORE_FD_WRITE) events |= EPOLLOUT | EPOLLHUP;
+ if (fdh->flags & ECORE_FD_ERROR) events |= EPOLLERR | EPOLLPRI | EPOLLHUP;
return events;
}
#endif
@@ -301,9 +302,9 @@ static inline int
_gfd_events_from_fdh(Ecore_Fd_Handler *fdh)
{
int events = 0;
- if (fdh->flags & ECORE_FD_READ) events |= G_IO_IN;
- if (fdh->flags & ECORE_FD_WRITE) events |= G_IO_OUT;
- if (fdh->flags & ECORE_FD_ERROR) events |= G_IO_ERR;
+ if (fdh->flags & ECORE_FD_READ) events |= G_IO_IN | G_IO_HUP;
+ if (fdh->flags & ECORE_FD_WRITE) events |= G_IO_OUT | G_IO_HUP;
+ if (fdh->flags & ECORE_FD_ERROR) events |= G_IO_ERR | G_IO_HUP;
return events;
}
#endif
@@ -331,6 +332,12 @@ _ecore_main_uv_poll_cb(uv_poll_t *handle, int status, int events)
if (events & UV_READABLE) fdh->read_active = EINA_TRUE;
if (events & UV_WRITABLE) fdh->write_active = EINA_TRUE;
+ if (events & UV_DISCONNECT)
+ {
+ fdh->read_active = EINA_TRUE;
+ fdh->write_active = EINA_TRUE;
+ fdh->error_active = EINA_TRUE;
+ }
_ecore_try_add_to_call_list(obj, pd, fdh);
_ecore_main_fd_handlers_call(obj, pd);
@@ -358,7 +365,7 @@ _ecore_main_fdh_poll_add(Efl_Loop_Data *pd EINA_UNUSED, Ecore_Fd_Handler *fdh)
DBG("_ecore_main_fdh_poll_add");
int r = 0;
-#ifdef HAVE_EPOLL
+#ifdef HAVE_SYS_EPOLL_H
# ifdef HAVE_LIBUV
if (!_dl_uv_run)
# endif
@@ -413,11 +420,17 @@ _ecore_main_fdh_poll_add(Efl_Loop_Data *pd EINA_UNUSED, Ecore_Fd_Handler *fdh)
static inline void
_ecore_main_fdh_poll_del(Efl_Loop_Data *pd, Ecore_Fd_Handler *fdh)
{
-#ifdef HAVE_EPOLL
+#ifdef HAVE_SYS_EPOLL_H
# ifdef HAVE_LIBUV
if (!_dl_uv_run)
# endif
{
+ if (!pd)
+ {
+ WRN("Efl_Loop_Data is NULL!");
+ return;
+ }
+
if ((!fdh->file) && (pd->epoll_fd >= 0))
{
struct epoll_event ev;
@@ -465,7 +478,7 @@ _ecore_main_fdh_poll_modify(Efl_Loop_Data *pd EINA_UNUSED, Ecore_Fd_Handler *fdh
{
DBG("_ecore_main_fdh_poll_modify %p", fdh);
int r = 0;
-#ifdef HAVE_EPOLL
+#ifdef HAVE_SYS_EPOLL_H
# ifdef HAVE_LIBUV
if (!_dl_uv_run)
# endif
@@ -517,7 +530,7 @@ _ecore_main_idler_all_call(Eo *loop)
eina_freeq_reduce(eina_freeq_main_get(), 84);
}
-#ifdef HAVE_EPOLL
+#ifdef HAVE_SYS_EPOLL_H
static inline int
_ecore_main_fdh_epoll_mark_active(Eo *obj, Efl_Loop_Data *pd)
{
@@ -556,6 +569,13 @@ _ecore_main_fdh_epoll_mark_active(Eo *obj, Efl_Loop_Data *pd)
if (ev[i].events & EPOLLOUT) fdh->write_active = EINA_TRUE;
if (ev[i].events & EPOLLERR) fdh->error_active = EINA_TRUE;
+ if (ev[i].events & EPOLLHUP)
+ {
+ fdh->read_active = EINA_TRUE;
+ fdh->write_active = EINA_TRUE;
+ fdh->error_active = EINA_TRUE;
+ }
+
_ecore_try_add_to_call_list(obj, pd, fdh);
}
return ret;
@@ -578,7 +598,14 @@ _ecore_main_fdh_glib_mark_active(Eo *obj, Efl_Loop_Data *pd)
if (fdh->gfd.revents & G_IO_OUT) fdh->write_active = EINA_TRUE;
if (fdh->gfd.revents & G_IO_ERR) fdh->error_active = EINA_TRUE;
- _ecore_try_add_to_call_list(obj, fdh);
+ if (fdh->gfd.revents & G_IO_HUP)
+ {
+ fdh->read_active = EINA_TRUE;
+ fdh->write_active = EINA_TRUE;
+ fdh->error_active = EINA_TRUE;
+ }
+
+ _ecore_try_add_to_call_list(obj, pd, fdh);
if (fdh->gfd.revents & (G_IO_IN | G_IO_OUT | G_IO_ERR)) ret++;
}
@@ -600,7 +627,7 @@ _ecore_main_gsource_prepare(GSource *source EINA_UNUSED,
if ((!ecore_idling) && (!_ecore_glib_idle_enterer_called))
{
- pd->loop_time = _ecore_time_loop_time = ecore_time_get();
+ pd->loop_time = ecore_time_get();
_efl_loop_timer_expired_timers_call(obj, pd, pd->loop_time);
efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_ENTER, NULL);
@@ -626,7 +653,7 @@ _ecore_main_gsource_prepare(GSource *source EINA_UNUSED,
int r = -1;
double t = _efl_loop_timer_next_get(obj, pd);
- if ((timer_fd >= 0) && (t > 0.0))
+ if ((pd->timer_fd >= 0) && (t > 0.0))
{
struct itimerspec ts;
@@ -638,13 +665,13 @@ _ecore_main_gsource_prepare(GSource *source EINA_UNUSED,
// timerfd cannot sleep for 0 time
if (ts.it_value.tv_sec || ts.it_value.tv_nsec)
{
- r = timerfd_settime(timer_fd, 0, &ts, NULL);
+ r = timerfd_settime(pd->timer_fd, 0, &ts, NULL);
if (r < 0)
{
ERR("timer set returned %d (errno=%d)",
r, errno);
- close(timer_fd);
- timer_fd = -1;
+ close(pd->timer_fd);
+ pd->timer_fd = -1;
}
else INF("sleeping for %ld s %06ldus",
ts.it_value.tv_sec,
@@ -690,10 +717,10 @@ _ecore_main_gsource_check(GSource *source EINA_UNUSED)
if (ecore_idling && (!_ecore_main_idlers_exist(pd)) &&
(!pd->message_queue))
{
- if (timer_fd >= 0)
+ if (pd->timer_fd >= 0)
{
uint64_t count = 0;
- int r = read(timer_fd, &count, sizeof count);
+ int r = read(pd->timer_fd, &count, sizeof count);
if ((r == -1) && (errno == EAGAIN))
{
}
@@ -702,15 +729,15 @@ _ecore_main_gsource_check(GSource *source EINA_UNUSED)
{
// unexpected things happened... fail back to old way
ERR("timer read returned %d (errno=%d)", r, errno);
- close(timer_fd);
- timer_fd = -1;
+ close(pd->timer_fd);
+ pd->timer_fd = -1;
}
}
}
else ret = TRUE;
// check if fds are ready
-#ifdef HAVE_EPOLL
+#ifdef HAVE_SYS_EPOLL_H
if (pd->epoll_fd >= 0)
ecore_fds_ready = (_ecore_main_fdh_epoll_mark_active(obj, pd) > 0);
else
@@ -871,7 +898,7 @@ _ecore_main_loop_setup(Eo *obj, Efl_Loop_Data *pd)
{
// Please note that this function is being also called in case of a bad
// fd to reset the main loop.
-#ifdef HAVE_EPOLL
+#ifdef HAVE_SYS_EPOLL_H
pd->epoll_fd = epoll_create(1);
if (pd->epoll_fd < 0) WRN("Failed to create epoll fd!");
else
@@ -974,7 +1001,7 @@ _ecore_main_loop_setup(Eo *obj, Efl_Loop_Data *pd)
{
g_source_set_priority(ecore_glib_source,
G_PRIORITY_HIGH_IDLE + 20);
-# ifdef HAVE_EPOLL
+# ifdef HAVE_SYS_EPOLL_H
if (pd->epoll_fd >= 0)
{
// epoll multiplexes fds into the g_main_loop
@@ -1030,7 +1057,7 @@ _ecore_main_loop_clear(Eo *obj, Efl_Loop_Data *pd)
}
#endif
}
-# ifdef HAVE_EPOLL
+# ifdef HAVE_SYS_EPOLL_H
if (pd->epoll_fd >= 0)
{
close(pd->epoll_fd);
@@ -1058,7 +1085,8 @@ _ecore_main_loop_shutdown(void)
if (!ML_OBJ) return;
_ecore_main_loop_clear(ML_OBJ, ML_DAT);
// XXX: this seemingly closes fd's it shouldn't.... :( fd 0?
- efl_del(ML_OBJ);
+ efl_replace(&ML_OBJ, NULL);
+ ML_DAT = NULL;
}
void
@@ -1084,8 +1112,12 @@ _ecore_main_loop_iterate(Eo *obj, Efl_Loop_Data *pd)
}
else
{
+#ifndef USE_G_MAIN_LOOP
pd->loop_time = ecore_time_get();
_ecore_main_loop_iterate_internal(obj, pd, 1);
+#else
+ g_main_context_iteration(NULL, 0);
+#endif
}
}
@@ -1118,11 +1150,15 @@ _ecore_main_loop_iterate_may_block(Eo *obj, Efl_Loop_Data *pd, int may_block)
}
else
{
+#ifndef USE_G_MAIN_LOOP
pd->in_loop++;
pd->loop_time = ecore_time_get();
_ecore_main_loop_iterate_internal(obj, pd, !may_block);
pd->in_loop--;
return pd->message_queue ? 1 : 0;
+#else
+ return g_main_context_iteration(NULL, may_block);
+#endif
}
return 0;
}
@@ -1132,11 +1168,6 @@ _ecore_main_loop_begin(Eo *obj, Efl_Loop_Data *pd)
{
if (obj == ML_OBJ)
{
- if (pd->in_loop > 0)
- {
- ERR("Beginning main loop() inside an existing main loop");
- return;
- }
#ifdef HAVE_SYSTEMD
sd_notify(0, "READY=1");
#endif
@@ -1181,12 +1212,22 @@ _ecore_main_loop_begin(Eo *obj, Efl_Loop_Data *pd)
}
else
{
+#ifndef USE_G_MAIN_LOOP
pd->in_loop++;
pd->loop_time = ecore_time_get();
while (!pd->do_quit)
_ecore_main_loop_iterate_internal(obj, pd, 0);
pd->do_quit = 0;
pd->in_loop--;
+#else
+ if (!pd->do_quit)
+ {
+ if (!ecore_main_loop)
+ ecore_main_loop = g_main_loop_new(NULL, 1);
+ g_main_loop_run(ecore_main_loop);
+ }
+ pd->do_quit = 0;
+#endif
}
}
@@ -1230,10 +1271,9 @@ EAPI void
ecore_main_loop_quit(void)
{
Eina_Value v = EINA_VALUE_EMPTY;
- int val = 0;
eina_value_setup(&v, EINA_VALUE_TYPE_INT);
- eina_value_set(&v, &val);
+ eina_value_set(&v, 0);
EINA_MAIN_LOOP_CHECK_RETURN;
efl_loop_quit(ML_OBJ, v);
}
@@ -1280,7 +1320,7 @@ _ecore_main_fd_handler_add(Eo *obj,
DBG("_ecore_main_fd_handler_add");
Ecore_Fd_Handler *fdh = NULL;
- if ((fd < 0) || (!func)) return NULL;
+ if ((fd < 0) || (flags == 0) || (!func)) return NULL;
fdh = ecore_fd_handler_calloc(1);
if (!fdh) return NULL;
@@ -1320,6 +1360,8 @@ _ecore_main_fd_handler_del(Eo *obj EINA_UNUSED,
Efl_Loop_Data *pd,
Ecore_Fd_Handler *fd_handler)
{
+ void *r = fd_handler->data;
+
DBG("_ecore_main_fd_handler_del %p", fd_handler);
if (fd_handler->delete_me)
{
@@ -1329,16 +1371,25 @@ _ecore_main_fd_handler_del(Eo *obj EINA_UNUSED,
fd_handler->handler = NULL;
fd_handler->delete_me = EINA_TRUE;
- _ecore_main_fdh_poll_del(pd, fd_handler);
- pd->fd_handlers_to_delete = eina_list_append
- (pd->fd_handlers_to_delete, fd_handler);
- if (fd_handler->prep_func && pd->fd_handlers_with_prep)
- pd->fd_handlers_with_prep = eina_list_remove
- (pd->fd_handlers_with_prep, fd_handler);
- if (fd_handler->buf_func && pd->fd_handlers_with_buffer)
- pd->fd_handlers_with_buffer = eina_list_remove
- (pd->fd_handlers_with_buffer, fd_handler);
- return fd_handler->data;
+ if (pd)
+ {
+ _ecore_main_fdh_poll_del(pd, fd_handler);
+ pd->fd_handlers_to_delete = eina_list_append
+ (pd->fd_handlers_to_delete, fd_handler);
+ if (fd_handler->prep_func && pd->fd_handlers_with_prep)
+ pd->fd_handlers_with_prep = eina_list_remove
+ (pd->fd_handlers_with_prep, fd_handler);
+ if (fd_handler->buf_func && pd->fd_handlers_with_buffer)
+ pd->fd_handlers_with_buffer = eina_list_remove
+ (pd->fd_handlers_with_buffer, fd_handler);
+ }
+ else
+ {
+ // The main loop is dead by now, so cleanup is required.
+ ECORE_MAGIC_SET(fd_handler, ECORE_MAGIC_NONE);
+ ecore_fd_handler_mp_free(fd_handler);
+ }
+ return r;
}
EAPI Ecore_Fd_Handler *
@@ -1351,9 +1402,10 @@ ecore_main_fd_handler_add(int fd,
{
Ecore_Fd_Handler *fdh = NULL;
EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
- fdh = _ecore_main_fd_handler_add(efl_loop_main_get(EFL_LOOP_CLASS),
+ fdh = _ecore_main_fd_handler_add(efl_main_loop_get(),
ML_DAT, NULL, fd, flags, func, data,
buf_func, buf_data, EINA_FALSE);
+ if (fdh) fdh->legacy = EINA_TRUE;
return fdh;
}
@@ -1366,7 +1418,7 @@ ecore_main_fd_handler_file_add(int fd,
const void *buf_data)
{
EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
- return _ecore_main_fd_handler_add(efl_loop_main_get(EFL_LOOP_CLASS),
+ return _ecore_main_fd_handler_add(efl_main_loop_get(),
ML_DAT, NULL, fd, flags, func, data,
buf_func, buf_data, EINA_TRUE);
}
@@ -1498,6 +1550,7 @@ ecore_main_fd_handler_prepare_callback_set(Ecore_Fd_Handler *fd_handler,
Ecore_Fd_Prep_Cb func,
const void *data)
{
+ if (!fd_handler) return;
Efl_Loop_Data *pd = fd_handler->loop_data;
EINA_MAIN_LOOP_CHECK_RETURN;
@@ -1520,6 +1573,8 @@ ecore_main_fd_handler_prepare_callback_set(Ecore_Fd_Handler *fd_handler,
EAPI int
ecore_main_fd_handler_fd_get(Ecore_Fd_Handler *fd_handler)
{
+ if (!fd_handler) return -1;
+
EINA_MAIN_LOOP_CHECK_RETURN_VAL(-1);
if (!ECORE_MAGIC_CHECK(fd_handler, ECORE_MAGIC_FD_HANDLER))
@@ -1572,20 +1627,9 @@ ecore_main_fd_handler_active_set(Ecore_Fd_Handler *fd_handler,
}
void
-_ecore_main_content_clear(Efl_Loop_Data *pd)
+_ecore_main_content_clear(Eo *obj, Efl_Loop_Data *pd)
{
- Efl_Promise *promise;
- Efl_Future *future;
-
- EINA_LIST_FREE(pd->pending_futures, future)
- efl_del(future);
- Eina_List *tmp = pd->pending_promises;
- pd->pending_promises = NULL;
- EINA_LIST_FREE(tmp, promise)
- ecore_loop_promise_fulfill(promise);
-
- // FIXME
- __eina_promise_cancel_all();
+ __eina_promise_cancel_data(obj);
while (pd->fd_handlers)
{
@@ -1594,7 +1638,7 @@ _ecore_main_content_clear(Efl_Loop_Data *pd)
pd->fd_handlers = (Ecore_Fd_Handler *)
eina_inlist_remove(EINA_INLIST_GET(pd->fd_handlers),
EINA_INLIST_GET(fdh));
- if (fdh->handler) efl_del(fdh->handler);
+ if ((fdh->handler) && (fdh->legacy)) efl_del(fdh->handler);
else
{
// XXX: can't do this because this fd handler is legacy and might
@@ -1725,7 +1769,7 @@ _ecore_main_select(Eo *obj, Efl_Loop_Data *pd, double timeout)
// call the prepare callback for all handlers
if (pd->fd_handlers_with_prep) _ecore_main_prepare_handlers(obj, pd);
-#ifdef HAVE_EPOLL
+#ifdef HAVE_SYS_EPOLL_H
if (pd->epoll_fd < 0)
{
#endif
@@ -1750,8 +1794,8 @@ _ecore_main_select(Eo *obj, Efl_Loop_Data *pd, double timeout)
}
}
}
+#ifdef HAVE_SYS_EPOLL_H
}
-#ifdef HAVE_EPOLL
else
{
// polling on the epoll fd will wake when fd in the epoll set is active
@@ -1805,7 +1849,7 @@ _ecore_main_select(Eo *obj, Efl_Loop_Data *pd, double timeout)
}
if (ret > 0)
{
-#ifdef HAVE_EPOLL
+#ifdef HAVE_SYS_EPOLL_H
if (pd->epoll_fd >= 0)
_ecore_main_fdh_epoll_mark_active(obj, pd);
else
@@ -2002,7 +2046,7 @@ _ecore_main_win32_handlers_cleanup(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd)
#endif
static void
-_ecore_main_fd_handlers_call(Eo *obj, Efl_Loop_Data *pd)
+_ecore_main_fd_handlers_call(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd)
{
// grab a new list
if (!pd->fd_handlers_to_call_current)
@@ -2281,19 +2325,12 @@ static void
_ecore_main_loop_iterate_internal(Eo *obj, Efl_Loop_Data *pd, int once_only)
{
double next_time = -1.0;
- Eo *f, *p;
if (obj == ML_OBJ)
{
in_main_loop++;
pd->in_loop = in_main_loop;
}
- // destroy all optional futures
- EINA_LIST_FREE(pd->pending_futures, f) efl_del(f);
- // and propagate all promise value
- Eina_List *tmp = pd->pending_promises;
- pd->pending_promises = NULL;
- EINA_LIST_FREE(tmp, p) ecore_loop_promise_fulfill(p);
// expire any timers
_efl_loop_timer_expired_timers_call(obj, pd, pd->loop_time);
// process signals into events ....
@@ -2362,14 +2399,6 @@ _ecore_main_loop_iterate_internal(Eo *obj, Efl_Loop_Data *pd, int once_only)
// start of the sleeping or looping section
start_loop: //-*************************************************************
- // We could be looping here without exiting the function and we need to
- // process future and promise before the next waiting period.
- // destroy all optional futures
- EINA_LIST_FREE(pd->pending_futures, f) efl_del(f);
- // and propagate all promise value
- tmp = pd->pending_promises;
- pd->pending_promises = NULL;
- EINA_LIST_FREE(tmp, p) ecore_loop_promise_fulfill(p);
// any timers re-added as a result of these are allowed to go
_efl_loop_timer_enable_new(obj, pd);
// if we have been asked to quit the mainloop then exit at this point
diff --git a/src/lib/ecore/ecore_pipe.c b/src/lib/ecore/ecore_pipe.c
index f26f6bd25d..f9aa62655a 100644
--- a/src/lib/ecore/ecore_pipe.c
+++ b/src/lib/ecore/ecore_pipe.c
@@ -140,6 +140,7 @@ EAPI int
ecore_pipe_read_fd(Ecore_Pipe *p)
{
EINA_MAIN_LOOP_CHECK_RETURN_VAL(PIPE_FD_INVALID);
+ if (!p) return PIPE_FD_INVALID;
return p->fd_read;
}
@@ -201,6 +202,7 @@ EAPI int
ecore_pipe_write_fd(Ecore_Pipe *p)
{
EINA_MAIN_LOOP_CHECK_RETURN_VAL(PIPE_FD_INVALID);
+ if (!p) return PIPE_FD_INVALID;
return p->fd_write;
}
@@ -494,7 +496,7 @@ _ecore_pipe_wait(Ecore_Pipe *p,
int64_t timerfdbuf;
struct epoll_event pollincoming[2];
double timeout;
- int ret;
+ int ret = 0;
int total = 0;
int time_exit = -1;
Eina_Bool fd_read_found;
@@ -531,7 +533,7 @@ _ecore_pipe_wait(Ecore_Pipe *p,
}
}
- while ((ret = epoll_wait(p->pollfd, pollincoming, 2, time_exit)) > 0)
+ while ((p->pollfd != PIPE_FD_INVALID) && (ret = epoll_wait(p->pollfd, pollincoming, 2, time_exit)) > 0)
{
fd_read_found = EINA_FALSE;
fd_timer_found = EINA_FALSE;
@@ -589,6 +591,11 @@ _ecore_pipe_handler_call(Ecore_Pipe *p,
unsigned char *buf,
size_t len)
{
+ // on windows we seem to get a pipe wake with no data. don't pass on
+ // zero data as there is nothing useful to do with it... and it causes
+ // segfaults
+ if ((!buf) || (!len)) return;
+
void *data = (void*) p->data;
// clear all values of pipe first.
diff --git a/src/lib/ecore/ecore_private.h b/src/lib/ecore/ecore_private.h
index 3854a43b1b..8d7a2338a8 100644
--- a/src/lib/ecore/ecore_private.h
+++ b/src/lib/ecore/ecore_private.h
@@ -5,20 +5,24 @@
#include "ecore_internal.h"
+#include "ecore_exe.eo.h"
+#include "ecore_event_message.eo.h"
+#include "ecore_event_message_handler.eo.h"
+
#ifdef EAPI
# undef EAPI
#endif
#ifdef _WIN32
-# ifdef EFL_ECORE_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ECORE_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -29,7 +33,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
extern int _ecore_log_dom;
#ifdef _ECORE_DEFAULT_LOG_DOM
@@ -87,6 +91,9 @@ typedef struct _Efl_Loop_Timer_Data Efl_Loop_Timer_Data;
typedef struct _Efl_Loop_Future_Scheduler Efl_Loop_Future_Scheduler;
typedef struct _Efl_Loop_Data Efl_Loop_Data;
+typedef struct _Efl_Task_Data Efl_Task_Data;
+typedef struct _Efl_Appthread_Data Efl_Appthread_Data;
+
typedef struct _Message_Handler Message_Handler;
typedef struct _Message Message;
@@ -142,9 +149,6 @@ struct _Efl_Loop_Data
Eina_List *win32_handlers_to_delete;
# endif
- Eina_List *pending_futures;
- Eina_List *pending_promises;
-
Eina_Inarray *message_handlers;
Eina_Inlist *message_queue;
unsigned int message_walking;
@@ -172,9 +176,40 @@ struct _Efl_Loop_Data
int low;
} pollers;
+ struct {
+ char **environ_ptr;
+ char **environ_copy;
+ } env;
+
Eina_Bool do_quit;
};
+struct _Efl_Task_Data
+{
+ Eina_Stringshare *command;
+ Eina_Array *args;
+ Eina_Hash *env;
+ Efl_Task_Priority priority;
+ int exit_code;
+ Efl_Task_Flags flags;
+ Eina_Bool command_dirty : 1;
+ Eina_Bool exited : 1;
+};
+
+struct _Efl_Appthread_Data
+{
+ int read_listeners;
+ struct {
+ int in, out;
+ Eo *in_handler, *out_handler;
+ Eina_Bool can_read : 1;
+ Eina_Bool eos_read : 1;
+ Eina_Bool can_write : 1;
+ } fd, ctrl;
+ void *thdat;
+};
+
+
#define EVAS_FRAME_QUEUING 1 /* for test */
#define READBUFSIZ 65536
@@ -306,7 +341,7 @@ _ecore_main_win32_handler_del(Eo *obj,
Efl_Loop_Data *pd,
Ecore_Win32_Handler *win32_handler);
-void _ecore_main_content_clear(Efl_Loop_Data *pd);
+void _ecore_main_content_clear(Eo *obj, Efl_Loop_Data *pd);
void _ecore_main_shutdown(void);
#if defined (_WIN32) || defined (__lv2ppu__) || defined (HAVE_EXOTIC)
@@ -321,11 +356,27 @@ static inline int _ecore_signal_count_get(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd
static inline void _ecore_signal_call(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd EINA_UNUSED) { }
#else
+#define ECORE_SIGNALS 1
+typedef struct _Ecore_Signal_Pid_Info Ecore_Signal_Pid_Info;
+
+struct _Ecore_Signal_Pid_Info
+{
+ pid_t pid;
+ int exit_code;
+ int exit_signal;
+ siginfo_t info;
+};
+
void _ecore_signal_shutdown(void);
void _ecore_signal_init(void);
void _ecore_signal_received_process(Eo *obj, Efl_Loop_Data *pd);
int _ecore_signal_count_get(Eo *obj, Efl_Loop_Data *pd);
void _ecore_signal_call(Eo *obj, Efl_Loop_Data *pd);
+void _ecore_signal_pid_lock(void);
+void _ecore_signal_pid_unlock(void);
+void _ecore_signal_pid_register(pid_t pid, int fd);
+void _ecore_signal_pid_unregister(pid_t pid, int fd);
+
#endif
void _ecore_exe_init(void);
@@ -481,18 +532,10 @@ extern Efl_Loop_Data *_mainloop_singleton_data;
extern Efl_Version _app_efl_version;
-void ecore_loop_future_register(Efl_Loop *l, Efl_Future *f);
-void ecore_loop_future_unregister(Efl_Loop *l, Efl_Future *f);
-void ecore_loop_promise_register(Efl_Loop *l, Efl_Promise *p);
-void ecore_loop_promise_unregister(Efl_Loop *l, Efl_Promise *p);
-void ecore_loop_promise_fulfill(Efl_Promise *p);
-
// access to direct input cb
#define ECORE_EVAS_INTERNAL
-#define EFL_LOOP_DATA efl_data_scope_get(efl_loop_main_get(EFL_LOOP_CLASS), EFL_LOOP_CLASS)
-
-EOAPI Eina_Bool efl_loop_message_process(Eo *obj);
+#define EFL_LOOP_DATA efl_data_scope_get(efl_main_loop_get(), EFL_LOOP_CLASS)
#undef EAPI
#define EAPI
diff --git a/src/lib/ecore/ecore_signal.c b/src/lib/ecore/ecore_signal.c
index 1d9872a459..65b9179393 100644
--- a/src/lib/ecore/ecore_signal.c
+++ b/src/lib/ecore/ecore_signal.c
@@ -11,6 +11,7 @@
#include <unistd.h>
#include <assert.h>
#include <fcntl.h>
+#include <errno.h>
#include <pthread.h>
#include "Ecore.h"
@@ -19,7 +20,13 @@
/* make mono happy - this is evil though... */
#undef SIGPWR
-#define ECORE_SIGNAL_THREAD 1
+typedef struct _Pid_Info Pid_Info;
+
+struct _Pid_Info
+{
+ pid_t pid;
+ int fd;
+};
static void _ecore_signal_exe_exit_delay(void *data, const Efl_Event *event);
static void _ecore_signal_waitpid(Eina_Bool once, siginfo_t info);
@@ -27,12 +34,12 @@ static void _ecore_signal_generic_free(void *data, void *event);
typedef void (*Signal_Handler)(int sig, siginfo_t *si, void *foo);
-#ifdef ECORE_SIGNAL_THREAD
-static Eina_Thread sig_thread;
-static Eina_Bool sig_thread_exists = EINA_FALSE;
-#endif
static int sig_pipe[2] = { -1, -1 }; // [0] == read, [1] == write
static Eo *sig_pipe_handler = NULL;
+static Eina_Spinlock sig_pid_lock;
+static Eina_List *sig_pid_info_list = NULL;
+
+volatile int exit_signal_received = 0;
typedef struct _Signal_Data
{
@@ -73,9 +80,9 @@ _ecore_signal_pipe_read(Eo *obj)
if (loop)
{
if (sdata.sig == SIGUSR1)
- efl_event_callback_call(loop, EFL_LOOP_EVENT_SIGNAL_USR1, NULL);
+ efl_event_callback_call(loop, EFL_APP_EVENT_SIGNAL_USR1, NULL);
else
- efl_event_callback_call(loop, EFL_LOOP_EVENT_SIGNAL_USR2, NULL);
+ efl_event_callback_call(loop, EFL_APP_EVENT_SIGNAL_USR2, NULL);
}
}
break;
@@ -90,7 +97,7 @@ _ecore_signal_pipe_read(Eo *obj)
}
Eo *loop = efl_provider_find(obj, EFL_LOOP_CLASS);
if (loop)
- efl_event_callback_call(loop, EFL_LOOP_EVENT_SIGNAL_HUP, NULL);
+ efl_event_callback_call(loop, EFL_APP_EVENT_SIGNAL_HUP, NULL);
}
break;
case SIGQUIT:
@@ -107,6 +114,9 @@ _ecore_signal_pipe_read(Eo *obj)
ecore_event_add(ECORE_EVENT_SIGNAL_EXIT, e,
_ecore_signal_generic_free, NULL);
}
+ Eo *loop = efl_provider_find(obj, EFL_LOOP_CLASS);
+ if (loop)
+ efl_event_callback_call(loop, EFL_LOOP_EVENT_QUIT, NULL);
}
break;
#ifdef SIGPWR
@@ -149,9 +159,29 @@ _ecore_signal_callback(int sig, siginfo_t *si, void *foo EINA_UNUSED)
{
Signal_Data sdata;
+ memset(&sdata, 0, sizeof(Signal_Data));
sdata.sig = sig;
sdata.info = *si;
- if (sdata.sig >= 0) write(sig_pipe[1], &sdata, sizeof(sdata));
+ if (sdata.sig >= 0)
+ {
+ int err = errno;
+ const ssize_t bytes = write(sig_pipe[1], &sdata, sizeof(sdata));
+ if (EINA_UNLIKELY(bytes != sizeof(sdata)))
+ {
+ err = errno;
+ ERR("write() failed: %s", strerror(err));
+ }
+ errno = err;
+ }
+ switch (sig)
+ {
+ case SIGQUIT:
+ case SIGINT:
+ case SIGTERM:
+ exit_signal_received = 1;
+ break;
+ default: break;
+ }
}
static void
@@ -159,12 +189,6 @@ _ecore_signal_callback_set(int sig, Signal_Handler func)
{
struct sigaction sa;
-#ifdef ECORE_SIGNAL_THREAD
- if (eina_thread_self() != sig_thread)
- {
- fprintf(stderr, "Ecore sig handler NOT called from sigwatcher thread\n");
- }
-#endif
sa.sa_sigaction = func;
sa.sa_flags = SA_RESTART | SA_SIGINFO;
sigemptyset(&sa.sa_mask);
@@ -207,19 +231,10 @@ _signalhandler_setup(void)
#endif
}
-static void *
-_ecore_signal_thread_watcher(void *data EINA_UNUSED, Eina_Thread t)
-{
- eina_thread_cancellable_set(EINA_FALSE, NULL);
- eina_thread_name_set(t, "Esigwatcher");
- _signalhandler_setup();
- for (;;) pause();
- return NULL;
-}
-
static void
_ecore_signal_pipe_init(void)
{
+ eina_spinlock_new(&sig_pid_lock);
if (sig_pipe[0] == -1)
{
if (pipe(sig_pipe) != 0)
@@ -231,23 +246,7 @@ _ecore_signal_pipe_init(void)
eina_file_close_on_exec(sig_pipe[1], EINA_TRUE);
fcntl(sig_pipe[0], F_SETFL, O_NONBLOCK);
}
-#ifdef ECORE_SIGNAL_THREAD
- if (!sig_thread_exists)
- {
- if (!eina_thread_create(&sig_thread, EINA_THREAD_NORMAL,
- -1, _ecore_signal_thread_watcher, NULL))
- {
- close(sig_pipe[0]);
- close(sig_pipe[1]);
- sig_pipe[0] = -1;
- sig_pipe[1] = -1;
- return;
- }
- sig_thread_exists = EINA_TRUE;
- }
-#else
_signalhandler_setup();
-#endif
if (!sig_pipe_handler)
sig_pipe_handler =
efl_add(EFL_LOOP_HANDLER_CLASS, ML_OBJ,
@@ -259,6 +258,11 @@ _ecore_signal_pipe_init(void)
static void
_ecore_signal_pipe_shutdown(void)
{
+ if (sig_pipe_handler)
+ {
+ efl_del(sig_pipe_handler);
+ sig_pipe_handler = NULL;
+ }
if (sig_pipe[0] != -1)
{
close(sig_pipe[0]);
@@ -266,29 +270,34 @@ _ecore_signal_pipe_shutdown(void)
sig_pipe[0] = -1;
sig_pipe[1] = -1;
}
- if (sig_pipe_handler)
- {
- efl_del(sig_pipe_handler);
- sig_pipe_handler = NULL;
- }
+ eina_spinlock_free(&sig_pid_lock);
}
static void
_ecore_signal_cb_fork(void *data EINA_UNUSED)
{
_ecore_signal_pipe_shutdown();
-#ifdef ECORE_SIGNAL_THREAD
- sig_thread_exists = EINA_FALSE;
-#endif
_ecore_signal_pipe_init();
}
void
_ecore_signal_init(void)
{
-#ifndef _WIN32
+ _ecore_signal_pipe_init();
+ ecore_fork_reset_callback_add(_ecore_signal_cb_fork, NULL);
+}
+
+void
+_ecore_signal_shutdown(void)
+{
sigset_t newset;
+ ecore_fork_reset_callback_del(_ecore_signal_cb_fork, NULL);
+ _ecore_signal_pipe_shutdown();
+ // we probably should restore.. but not a good idea
+ // pthread_sigmask(SIG_SETMASK, &sig_oldset, NULL);
+ // at least do not trigger signal callback after shutdown
+#ifndef _WIN32
sigemptyset(&newset);
sigaddset(&newset, SIGPIPE);
sigaddset(&newset, SIGALRM);
@@ -304,17 +313,7 @@ _ecore_signal_init(void)
# endif
pthread_sigmask(SIG_BLOCK, &newset, NULL);
#endif
- _ecore_signal_pipe_init();
- ecore_fork_reset_callback_add(_ecore_signal_cb_fork, NULL);
-}
-
-void
-_ecore_signal_shutdown(void)
-{
- ecore_fork_reset_callback_del(_ecore_signal_cb_fork, NULL);
- _ecore_signal_pipe_shutdown();
- // we probably should restore.. but not a good idea
- // pthread_sigmask(SIG_SETMASK, &sig_oldset, NULL);
+ exit_signal_received = 0;
}
void
@@ -332,6 +331,45 @@ _ecore_signal_count_get(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd EINA_UNUSED)
return 0;
}
+void
+_ecore_signal_pid_lock(void)
+{
+ eina_spinlock_take(&sig_pid_lock);
+}
+
+void
+_ecore_signal_pid_unlock(void)
+{
+ eina_spinlock_release(&sig_pid_lock);
+}
+
+void
+_ecore_signal_pid_register(pid_t pid, int fd)
+{
+ Pid_Info *pi = calloc(1, sizeof(Pid_Info));
+ if (!pi) return;
+ pi->pid = pid;
+ pi->fd = fd;
+ sig_pid_info_list = eina_list_append(sig_pid_info_list, pi);
+}
+
+void
+_ecore_signal_pid_unregister(pid_t pid, int fd)
+{
+ Eina_List *l;
+ Pid_Info *pi;
+
+ EINA_LIST_FOREACH(sig_pid_info_list, l, pi)
+ {
+ if ((pi->pid == pid) && (pi->fd == fd))
+ {
+ sig_pid_info_list = eina_list_remove_list(sig_pid_info_list, l);
+ free(pi);
+ return;
+ }
+ }
+}
+
static void
_ecore_signal_exe_exit_delay(void *data, const Efl_Event *event)
{
@@ -409,6 +447,45 @@ _ecore_signal_waitpid(Eina_Bool once, siginfo_t info)
else ecore_event_add(ECORE_EXE_EVENT_DEL, e,
_ecore_exe_event_del_free, NULL);
}
+
+ // XXX: this is not brilliant. this ends up running from the main loop
+ // reading the signal pipe to handle signals. that means handling
+ // exe exits from children will be bottlenecked by how often
+ // the main loop can wake up (or well latency may not be great).
+ // this should probably have a dedicated thread ythat does a waitpid()
+ // and blocks and waits sending results to the resulting pipe
+ Eina_List *l, *ll;
+ Pid_Info *pi;
+
+ EINA_LIST_FOREACH_SAFE(sig_pid_info_list, l, ll, pi)
+ {
+ if (pi->pid == pid)
+ {
+ Ecore_Signal_Pid_Info pinfo;
+
+ sig_pid_info_list = eina_list_remove_list
+ (sig_pid_info_list, ll);
+ pinfo.pid = pid;
+ pinfo.info = info;
+ if (WIFEXITED(status))
+ {
+ pinfo.exit_code = WEXITSTATUS(status);
+ pinfo.exit_signal = -1;
+ }
+ else if (WIFSIGNALED(status))
+ {
+ pinfo.exit_code = -1;
+ pinfo.exit_signal = WTERMSIG(status);
+ }
+ if (write(pi->fd, &pinfo, sizeof(Ecore_Signal_Pid_Info))
+ != sizeof(Ecore_Signal_Pid_Info))
+ {
+ ERR("Can't write to custom exe exit info pipe");
+ }
+ free(pi);
+ break;
+ }
+ }
if (once) break;
}
}
diff --git a/src/lib/ecore/ecore_thread.c b/src/lib/ecore/ecore_thread.c
index abef08f4ad..8c95dd96da 100644
--- a/src/lib/ecore/ecore_thread.c
+++ b/src/lib/ecore/ecore_thread.c
@@ -15,30 +15,30 @@
#include "Ecore.h"
#include "ecore_private.h"
-# define LK(x) Eina_Lock x
-# define LKI(x) eina_lock_new(&(x))
-# define LKD(x) eina_lock_free(&(x))
-# define LKL(x) eina_lock_take(&(x))
-# define LKU(x) eina_lock_release(&(x))
-
-# define SLK(x) Eina_Spinlock x
-# define SLKI(x) eina_spinlock_new(&(x))
-# define SLKD(x) eina_spinlock_free(&(x))
-# define SLKL(x) eina_spinlock_take(&(x))
-# define SLKU(x) eina_spinlock_release(&(x))
-
-# define CD(x) Eina_Condition x
-# define CDI(x, m) eina_condition_new(&(x), &(m))
-# define CDD(x) eina_condition_free(&(x))
-# define CDB(x) eina_condition_broadcast(&(x))
-# define CDW(x, t) eina_condition_timedwait(&(x), t)
-
-# define LRWK(x) Eina_RWLock x
-# define LRWKI(x) eina_rwlock_new(&(x));
-# define LRWKD(x) eina_rwlock_free(&(x));
-# define LRWKWL(x) eina_rwlock_take_write(&(x));
-# define LRWKRL(x) eina_rwlock_take_read(&(x));
-# define LRWKU(x) eina_rwlock_release(&(x));
+# define LK(x) Eina_Lock x
+# define LKI(x) eina_lock_new(&(x))
+# define LKD(x) eina_lock_free(&(x))
+# define LKL(x) eina_lock_take(&(x))
+# define LKU(x) eina_lock_release(&(x))
+
+# define SLK(x) Eina_Spinlock x
+# define SLKI(x) eina_spinlock_new(&(x))
+# define SLKD(x) eina_spinlock_free(&(x))
+# define SLKL(x) eina_spinlock_take(&(x))
+# define SLKU(x) eina_spinlock_release(&(x))
+
+# define CD(x) Eina_Condition x
+# define CDI(x, m) eina_condition_new(&(x), &(m))
+# define CDD(x) eina_condition_free(&(x))
+# define CDB(x) eina_condition_broadcast(&(x))
+# define CDW(x, t) eina_condition_timedwait(&(x), t)
+
+# define LRWK(x) Eina_RWLock x
+# define LRWKI(x) eina_rwlock_new(&(x));
+# define LRWKD(x) eina_rwlock_free(&(x));
+# define LRWKWL(x) eina_rwlock_take_write(&(x));
+# define LRWKRL(x) eina_rwlock_take_read(&(x));
+# define LRWKU(x) eina_rwlock_release(&(x));
# define PH(x) Eina_Thread x
# define PHE(x, y) eina_thread_equal(x, y)
@@ -49,13 +49,13 @@
typedef struct _Ecore_Pthread_Worker Ecore_Pthread_Worker;
typedef struct _Ecore_Pthread Ecore_Pthread;
typedef struct _Ecore_Thread_Data Ecore_Thread_Data;
-typedef struct _Ecore_Thread_Waiter Ecore_Thread_Waiter;
+typedef struct _Ecore_Thread_Waiter Ecore_Thread_Waiter;
struct _Ecore_Thread_Waiter
{
Ecore_Thread_Cb func_cancel;
Ecore_Thread_Cb func_end;
- Eina_Bool waiting;
+ Eina_Bool waiting;
};
struct _Ecore_Thread_Data
@@ -66,7 +66,8 @@ struct _Ecore_Thread_Data
struct _Ecore_Pthread_Worker
{
- union {
+ union
+ {
struct
{
Ecore_Thread_Cb func_blocking;
@@ -81,14 +82,16 @@ struct _Ecore_Pthread_Worker
int send;
int received;
} feedback_run;
- struct {
- Ecore_Thread_Cb func_main;
+ struct
+ {
+ Ecore_Thread_Cb func_main;
Ecore_Thread_Notify_Cb func_notify;
Ecore_Pipe *send;
Ecore_Pthread_Worker *direct_worker;
- struct {
+ struct
+ {
int send;
int received;
} from, to;
@@ -96,49 +99,50 @@ struct _Ecore_Pthread_Worker
} u;
Ecore_Thread_Waiter *waiter;
- Ecore_Thread_Cb func_cancel;
- Ecore_Thread_Cb func_end;
- PH(self);
- Eina_Hash *hash;
- CD(cond);
- LK(mutex);
+ Ecore_Thread_Cb func_cancel;
+ Ecore_Thread_Cb func_end;
+ PH(self);
+ Eina_Hash *hash;
+ CD(cond);
+ LK(mutex);
- const void *data;
+ const void *data;
- int cancel;
+ int cancel;
SLK(cancel_mutex);
- Eina_Bool message_run : 1;
- Eina_Bool feedback_run : 1;
- Eina_Bool kill : 1;
- Eina_Bool reschedule : 1;
- Eina_Bool no_queue : 1;
+ Eina_Bool message_run : 1;
+ Eina_Bool feedback_run : 1;
+ Eina_Bool kill : 1;
+ Eina_Bool reschedule : 1;
+ Eina_Bool no_queue : 1;
};
typedef struct _Ecore_Pthread_Notify Ecore_Pthread_Notify;
struct _Ecore_Pthread_Notify
{
Ecore_Pthread_Worker *work;
- const void *user_data;
+ const void *user_data;
};
-typedef void *(*Ecore_Thread_Sync_Cb)(void* data, Ecore_Thread *thread);
+typedef void *(*Ecore_Thread_Sync_Cb)(void *data, Ecore_Thread *thread);
typedef struct _Ecore_Pthread_Message Ecore_Pthread_Message;
struct _Ecore_Pthread_Message
{
- union {
- Ecore_Thread_Cb async;
+ union
+ {
+ Ecore_Thread_Cb async;
Ecore_Thread_Sync_Cb sync;
} u;
const void *data;
- int code;
+ int code;
- Eina_Bool callback : 1;
- Eina_Bool sync : 1;
+ Eina_Bool callback : 1;
+ Eina_Bool sync : 1;
};
static int _ecore_thread_count_max = 0;
@@ -146,6 +150,7 @@ static int _ecore_thread_count_max = 0;
static void _ecore_thread_handler(void *data);
static int _ecore_thread_count = 0;
+static int _ecore_thread_count_no_queue = 0;
static Eina_List *_ecore_running_job = NULL;
static Eina_List *_ecore_pending_job_threads = NULL;
@@ -208,7 +213,7 @@ _ecore_thread_data_free(void *data)
free(d);
}
-static void
+void
_ecore_thread_join(PH(thread))
{
DBG("joining thread=%" PRIu64, (uint64_t)thread);
@@ -261,6 +266,7 @@ static void
_ecore_nothing_handler(void *data EINA_UNUSED, void *buffer EINA_UNUSED, unsigned int nbyte EINA_UNUSED)
{
}
+
#endif
static void
@@ -268,7 +274,7 @@ _ecore_notify_handler(void *data)
{
Ecore_Pthread_Notify *notify = data;
Ecore_Pthread_Worker *work = notify->work;
- void *user_data = (void*) notify->user_data;
+ void *user_data = (void *)notify->user_data;
work->u.feedback_run.received++;
@@ -289,7 +295,7 @@ _ecore_message_notify_handler(void *data)
{
Ecore_Pthread_Notify *notify = data;
Ecore_Pthread_Worker *work = notify->work;
- Ecore_Pthread_Message *user_data = (void *) notify->user_data;
+ Ecore_Pthread_Message *user_data = (void *)notify->user_data;
Eina_Bool delete = EINA_TRUE;
work->u.message_run.from.received++;
@@ -297,13 +303,13 @@ _ecore_message_notify_handler(void *data)
if (!user_data->callback)
{
if (work->u.message_run.func_notify)
- work->u.message_run.func_notify((void *) work->data, (Ecore_Thread *) work, (void *) user_data->data);
+ work->u.message_run.func_notify((void *)work->data, (Ecore_Thread *)work, (void *)user_data->data);
}
else
{
if (user_data->sync)
{
- user_data->data = user_data->u.sync((void*) user_data->data, (Ecore_Thread *) work);
+ user_data->data = user_data->u.sync((void *)user_data->data, (Ecore_Thread *)work);
user_data->callback = EINA_FALSE;
user_data->code = INT_MAX;
ecore_pipe_write(work->u.message_run.send, &user_data, sizeof (Ecore_Pthread_Message *));
@@ -312,7 +318,7 @@ _ecore_message_notify_handler(void *data)
}
else
{
- user_data->u.async((void*) user_data->data, (Ecore_Thread *) work);
+ user_data->u.async((void *)user_data->data, (Ecore_Thread *)work);
}
}
@@ -376,7 +382,7 @@ _ecore_short_job(PH(thread))
SLKL(_ecore_running_job_mutex);
_ecore_running_job = eina_list_append(_ecore_running_job, work);
SLKU(_ecore_running_job_mutex);
-
+
SLKL(work->cancel_mutex);
cancel = work->cancel;
SLKU(work->cancel_mutex);
@@ -384,7 +390,7 @@ _ecore_short_job(PH(thread))
EINA_THREAD_CLEANUP_PUSH(_ecore_short_job_cleanup, work);
if (!cancel)
- work->u.short_run.func_blocking((void *) work->data, (Ecore_Thread*) work);
+ work->u.short_run.func_blocking((void *)work->data, (Ecore_Thread *)work);
eina_thread_cancellable_set(EINA_FALSE, NULL);
EINA_THREAD_CLEANUP_POP(EINA_TRUE);
}
@@ -419,15 +425,15 @@ _ecore_feedback_job(PH(thread))
{
Ecore_Pthread_Worker *work;
int cancel;
-
+
SLKL(_ecore_pending_job_threads_mutex);
-
+
if (!_ecore_pending_job_threads_feedback)
{
SLKU(_ecore_pending_job_threads_mutex);
return;
}
-
+
work = eina_list_data_get(_ecore_pending_job_threads_feedback);
_ecore_pending_job_threads_feedback = eina_list_remove_list(_ecore_pending_job_threads_feedback,
_ecore_pending_job_threads_feedback);
@@ -435,7 +441,7 @@ _ecore_feedback_job(PH(thread))
SLKL(_ecore_running_job_mutex);
_ecore_running_job = eina_list_append(_ecore_running_job, work);
SLKU(_ecore_running_job_mutex);
-
+
SLKL(work->cancel_mutex);
cancel = work->cancel;
SLKU(work->cancel_mutex);
@@ -443,7 +449,7 @@ _ecore_feedback_job(PH(thread))
EINA_THREAD_CLEANUP_PUSH(_ecore_feedback_job_cleanup, work);
if (!cancel)
- work->u.feedback_run.func_heavy((void *) work->data, (Ecore_Thread *) work);
+ work->u.feedback_run.func_heavy((void *)work->data, (Ecore_Thread *)work);
eina_thread_cancellable_set(EINA_FALSE, NULL);
EINA_THREAD_CLEANUP_POP(EINA_TRUE);
}
@@ -455,10 +461,13 @@ _ecore_direct_worker_cleanup(void *data)
DBG("cleanup work=%p, thread=%" PRIu64 " (should join)", work, (uint64_t)work->self);
+ SLKL(_ecore_pending_job_threads_mutex);
+ _ecore_thread_count_no_queue--;
ecore_main_loop_thread_safe_call_async(_ecore_thread_handler, work);
- ecore_main_loop_thread_safe_call_async((Ecore_Cb) _ecore_thread_join,
- (void*)(intptr_t)PHS());
+ ecore_main_loop_thread_safe_call_async((Ecore_Cb)_ecore_thread_join,
+ (void *)(intptr_t)PHS());
+ SLKU(_ecore_pending_job_threads_mutex);
}
static void *
@@ -470,9 +479,9 @@ _ecore_direct_worker(Ecore_Pthread_Worker *work)
EINA_THREAD_CLEANUP_PUSH(_ecore_direct_worker_cleanup, work);
if (work->message_run)
- work->u.message_run.func_main((void *) work->data, (Ecore_Thread *) work);
+ work->u.message_run.func_main((void *)work->data, (Ecore_Thread *)work);
else
- work->u.feedback_run.func_heavy((void *) work->data, (Ecore_Thread *) work);
+ work->u.feedback_run.func_heavy((void *)work->data, (Ecore_Thread *)work);
eina_thread_cancellable_set(EINA_FALSE, NULL);
EINA_THREAD_CLEANUP_POP(EINA_TRUE);
@@ -485,9 +494,9 @@ _ecore_thread_worker_cleanup(void *data EINA_UNUSED)
DBG("cleanup thread=%" PRIuPTR " (should join)", PHS());
SLKL(_ecore_pending_job_threads_mutex);
_ecore_thread_count--;
+ ecore_main_loop_thread_safe_call_async((Ecore_Cb)_ecore_thread_join,
+ (void *)(intptr_t)PHS());
SLKU(_ecore_pending_job_threads_mutex);
- ecore_main_loop_thread_safe_call_async((Ecore_Cb) _ecore_thread_join,
- (void*)(intptr_t)PHS());
}
static void *
@@ -541,14 +550,14 @@ _ecore_thread_worker_new(void)
result = eina_trash_pop(&_ecore_thread_worker_trash);
- if (!result)
+ if (!result)
{
- result = calloc(1, sizeof(Ecore_Pthread_Worker));
- _ecore_thread_worker_count++;
+ result = calloc(1, sizeof(Ecore_Pthread_Worker));
+ _ecore_thread_worker_count++;
}
else
{
- memset(result, 0, sizeof(Ecore_Pthread_Worker));
+ memset(result, 0, sizeof(Ecore_Pthread_Worker));
}
SLKI(result->cancel_mutex);
@@ -576,78 +585,81 @@ void
_ecore_thread_shutdown(void)
{
/* FIXME: If function are still running in the background, should we kill them ? */
- Ecore_Pthread_Worker *work;
- Eina_List *l;
- Eina_Bool test;
- int iteration = 0;
+ Ecore_Pthread_Worker *work;
+ Eina_List *l;
+ Eina_Bool test;
+ int iteration = 0;
- SLKL(_ecore_pending_job_threads_mutex);
+ SLKL(_ecore_pending_job_threads_mutex);
- EINA_LIST_FREE(_ecore_pending_job_threads, work)
- {
- if (work->func_cancel)
- work->func_cancel((void *)work->data, (Ecore_Thread *) work);
- free(work);
- }
+ EINA_LIST_FREE(_ecore_pending_job_threads, work)
+ {
+ if (work->func_cancel)
+ work->func_cancel((void *)work->data, (Ecore_Thread *)work);
+ free(work);
+ }
- EINA_LIST_FREE(_ecore_pending_job_threads_feedback, work)
- {
- if (work->func_cancel)
- work->func_cancel((void *)work->data, (Ecore_Thread *) work);
- free(work);
- }
+ EINA_LIST_FREE(_ecore_pending_job_threads_feedback, work)
+ {
+ if (work->func_cancel)
+ work->func_cancel((void *)work->data, (Ecore_Thread *)work);
+ free(work);
+ }
- SLKU(_ecore_pending_job_threads_mutex);
- SLKL(_ecore_running_job_mutex);
+ SLKU(_ecore_pending_job_threads_mutex);
+ SLKL(_ecore_running_job_mutex);
- EINA_LIST_FOREACH(_ecore_running_job, l, work)
- ecore_thread_cancel((Ecore_Thread*) work);
+ EINA_LIST_FOREACH(_ecore_running_job, l, work)
+ ecore_thread_cancel((Ecore_Thread *)work);
- SLKU(_ecore_running_job_mutex);
+ SLKU(_ecore_running_job_mutex);
- do
- {
- SLKL(_ecore_pending_job_threads_mutex);
- if (_ecore_thread_count > 0)
- {
- test = EINA_TRUE;
- }
- else
- {
- test = EINA_FALSE;
- }
- SLKU(_ecore_pending_job_threads_mutex);
- iteration++;
- if (test) usleep(50000);
- }
- while (test == EINA_TRUE && iteration < 20);
-
- if (iteration == 20 && _ecore_thread_count > 0)
- {
- ERR("%i of the child thread are still running after 1s. This can lead to a segv. Sorry.", _ecore_thread_count);
- }
+ do
+ {
+ SLKL(_ecore_pending_job_threads_mutex);
+ if (_ecore_thread_count + _ecore_thread_count_no_queue > 0)
+ {
+ test = EINA_TRUE;
+ }
+ else
+ {
+ test = EINA_FALSE;
+ }
+ SLKU(_ecore_pending_job_threads_mutex);
+ iteration++;
+ if (test)
+ {
+ _ecore_main_call_flush();
+ usleep(1000);
+ }
+ } while (test == EINA_TRUE && iteration < 50);
+
+ if (iteration == 20 && _ecore_thread_count > 0)
+ {
+ ERR("%i of the child thread are still running after 1s. This can lead to a segv. Sorry.", _ecore_thread_count);
+ }
- if (_ecore_thread_global_hash)
- eina_hash_free(_ecore_thread_global_hash);
- have_main_loop_thread = 0;
+ if (_ecore_thread_global_hash)
+ eina_hash_free(_ecore_thread_global_hash);
+ have_main_loop_thread = 0;
- while ((work = eina_trash_pop(&_ecore_thread_worker_trash)))
- {
- free(work);
- }
-
- SLKD(_ecore_pending_job_threads_mutex);
- LRWKD(_ecore_thread_global_hash_lock);
- LKD(_ecore_thread_global_hash_mutex);
- SLKD(_ecore_running_job_mutex);
- CDD(_ecore_thread_global_hash_cond);
+ while ((work = eina_trash_pop(&_ecore_thread_worker_trash)))
+ {
+ free(work);
+ }
+
+ SLKD(_ecore_pending_job_threads_mutex);
+ LRWKD(_ecore_thread_global_hash_lock);
+ LKD(_ecore_thread_global_hash_mutex);
+ SLKD(_ecore_running_job_mutex);
+ CDD(_ecore_thread_global_hash_cond);
}
EAPI Ecore_Thread *
ecore_thread_run(Ecore_Thread_Cb func_blocking,
Ecore_Thread_Cb func_end,
Ecore_Thread_Cb func_cancel,
- const void *data)
+ const void *data)
{
Ecore_Pthread_Worker *work;
Eina_Bool tried = EINA_FALSE;
@@ -695,18 +707,18 @@ ecore_thread_run(Ecore_Thread_Cb func_blocking,
SLKL(_ecore_pending_job_threads_mutex);
- retry:
+retry:
if (PHC(thread, _ecore_thread_worker, NULL))
{
_ecore_thread_count++;
- SLKU(_ecore_pending_job_threads_mutex);
+ SLKU(_ecore_pending_job_threads_mutex);
return (Ecore_Thread *)work;
}
if (!tried)
{
- _ecore_main_call_flush();
- tried = EINA_TRUE;
- goto retry;
+ _ecore_main_call_flush();
+ tried = EINA_TRUE;
+ goto retry;
}
if (_ecore_thread_count == 0)
@@ -714,9 +726,9 @@ ecore_thread_run(Ecore_Thread_Cb func_blocking,
_ecore_pending_job_threads = eina_list_remove(_ecore_pending_job_threads, work);
if (work->func_cancel)
- work->func_cancel((void *) work->data, (Ecore_Thread *) work);
+ work->func_cancel((void *)work->data, (Ecore_Thread *)work);
- _ecore_thread_worker_free(work);
+ _ecore_thread_worker_free(work);
work = NULL;
}
SLKU(_ecore_pending_job_threads_mutex);
@@ -793,7 +805,7 @@ ecore_thread_cancel(Ecore_Thread *thread)
work = (Ecore_Pthread_Worker *)thread;
/* Delay the destruction */
- on_exit:
+on_exit:
eina_thread_cancel(work->self); /* noop unless eina_thread_cancellable_set() was used by user */
SLKL(work->cancel_mutex);
work->cancel = EINA_TRUE;
@@ -802,7 +814,6 @@ ecore_thread_cancel(Ecore_Thread *thread)
return EINA_FALSE;
}
-
static void
_ecore_thread_wait_reset(Ecore_Thread_Waiter *waiter,
Ecore_Pthread_Worker *worker)
@@ -819,7 +830,7 @@ _ecore_thread_wait_reset(Ecore_Thread_Waiter *waiter,
static void
_ecore_thread_wait_cancel(void *data EINA_UNUSED, Ecore_Thread *thread)
{
- Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker*) thread;
+ Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker *)thread;
Ecore_Thread_Waiter *waiter = worker->waiter;
if (waiter->func_cancel) waiter->func_cancel(data, thread);
@@ -829,7 +840,7 @@ _ecore_thread_wait_cancel(void *data EINA_UNUSED, Ecore_Thread *thread)
static void
_ecore_thread_wait_end(void *data EINA_UNUSED, Ecore_Thread *thread)
{
- Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker*) thread;
+ Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker *)thread;
Ecore_Thread_Waiter *waiter = worker->waiter;
if (waiter->func_end) waiter->func_end(data, thread);
@@ -839,7 +850,7 @@ _ecore_thread_wait_end(void *data EINA_UNUSED, Ecore_Thread *thread)
EAPI Eina_Bool
ecore_thread_wait(Ecore_Thread *thread, double wait)
{
- Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker*) thread;
+ Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker *)thread;
Ecore_Thread_Waiter waiter;
if (!thread) return EINA_TRUE;
@@ -858,7 +869,8 @@ ecore_thread_wait(Ecore_Thread *thread, double wait)
double start, end;
start = ecore_time_get();
- ecore_main_loop_thread_safe_call_wait(wait);
+ _ecore_main_call_flush();
+ ecore_main_loop_thread_safe_call_wait(0.0001);
end = ecore_time_get();
wait -= end - start;
@@ -880,7 +892,7 @@ ecore_thread_wait(Ecore_Thread *thread, double wait)
EAPI Eina_Bool
ecore_thread_check(Ecore_Thread *thread)
{
- Ecore_Pthread_Worker *volatile worker = (Ecore_Pthread_Worker *) thread;
+ Ecore_Pthread_Worker *volatile worker = (Ecore_Pthread_Worker *)thread;
int cancel;
if (!worker) return EINA_TRUE;
@@ -888,21 +900,21 @@ ecore_thread_check(Ecore_Thread *thread)
cancel = worker->cancel;
/* FIXME: there is an insane bug driving me nuts here. I don't know if
- it's a race condition, some cache issue or some alien attack on our software.
- But ecore_thread_check will only work correctly with a printf, all the volatile,
- lock and even usleep don't help here... */
+ it's a race condition, some cache issue or some alien attack on our software.
+ But ecore_thread_check will only work correctly with a printf, all the volatile,
+ lock and even usleep don't help here... */
/* fprintf(stderr, "wc: %i\n", cancel); */
SLKU(worker->cancel_mutex);
return cancel;
}
EAPI Ecore_Thread *
-ecore_thread_feedback_run(Ecore_Thread_Cb func_heavy,
+ecore_thread_feedback_run(Ecore_Thread_Cb func_heavy,
Ecore_Thread_Notify_Cb func_notify,
- Ecore_Thread_Cb func_end,
- Ecore_Thread_Cb func_cancel,
- const void *data,
- Eina_Bool try_no_queue)
+ Ecore_Thread_Cb func_end,
+ Ecore_Thread_Cb func_cancel,
+ const void *data,
+ Eina_Bool try_no_queue)
{
Ecore_Pthread_Worker *worker;
Eina_Bool tried = EINA_FALSE;
@@ -942,15 +954,20 @@ ecore_thread_feedback_run(Ecore_Thread_Cb func_heavy,
eina_threads_init();
- retry_direct:
+retry_direct:
if (PHC(t, _ecore_direct_worker, worker))
- return (Ecore_Thread *)worker;
- if (!tried)
- {
- _ecore_main_call_flush();
- tried = EINA_TRUE;
- goto retry_direct;
- }
+ {
+ SLKL(_ecore_pending_job_threads_mutex);
+ _ecore_thread_count_no_queue++;
+ SLKU(_ecore_pending_job_threads_mutex);
+ return (Ecore_Thread *)worker;
+ }
+ if (!tried)
+ {
+ _ecore_main_call_flush();
+ tried = EINA_TRUE;
+ goto retry_direct;
+ }
if (worker->u.feedback_run.direct_worker)
{
@@ -978,18 +995,18 @@ ecore_thread_feedback_run(Ecore_Thread_Cb func_heavy,
eina_threads_init();
SLKL(_ecore_pending_job_threads_mutex);
- retry:
+retry:
if (PHC(thread, _ecore_thread_worker, NULL))
{
_ecore_thread_count++;
- SLKU(_ecore_pending_job_threads_mutex);
+ SLKU(_ecore_pending_job_threads_mutex);
return (Ecore_Thread *)worker;
}
if (!tried)
{
_ecore_main_call_flush();
- tried = EINA_TRUE;
- goto retry;
+ tried = EINA_TRUE;
+ goto retry;
}
SLKU(_ecore_pending_job_threads_mutex);
@@ -1019,7 +1036,7 @@ on_error:
EAPI Eina_Bool
ecore_thread_feedback(Ecore_Thread *thread,
- const void *data)
+ const void *data)
{
Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker *)thread;
@@ -1072,60 +1089,61 @@ ecore_thread_feedback(Ecore_Thread *thread,
#if 0
EAPI Ecore_Thread *
ecore_thread_message_run(Ecore_Thread_Cb func_main,
- Ecore_Thread_Notify_Cb func_notify,
- Ecore_Thread_Cb func_end,
- Ecore_Thread_Cb func_cancel,
- const void *data)
+ Ecore_Thread_Notify_Cb func_notify,
+ Ecore_Thread_Cb func_end,
+ Ecore_Thread_Cb func_cancel,
+ const void *data)
{
- Ecore_Pthread_Worker *worker;
- PH(t);
+ Ecore_Pthread_Worker *worker;
+ PH(t);
- if (!func_main) return NULL;
+ if (!func_main) return NULL;
- worker = _ecore_thread_worker_new();
- if (!worker) return NULL;
+ worker = _ecore_thread_worker_new();
+ if (!worker) return NULL;
- worker->u.message_run.func_main = func_main;
- worker->u.message_run.func_notify = func_notify;
- worker->u.message_run.direct_worker = _ecore_thread_worker_new();
- worker->u.message_run.send = ecore_pipe_add(_ecore_nothing_handler, worker);
- worker->u.message_run.from.send = 0;
- worker->u.message_run.from.received = 0;
- worker->u.message_run.to.send = 0;
- worker->u.message_run.to.received = 0;
+ worker->u.message_run.func_main = func_main;
+ worker->u.message_run.func_notify = func_notify;
+ worker->u.message_run.direct_worker = _ecore_thread_worker_new();
+ worker->u.message_run.send = ecore_pipe_add(_ecore_nothing_handler, worker);
+ worker->u.message_run.from.send = 0;
+ worker->u.message_run.from.received = 0;
+ worker->u.message_run.to.send = 0;
+ worker->u.message_run.to.received = 0;
- ecore_pipe_freeze(worker->u.message_run.send);
+ ecore_pipe_freeze(worker->u.message_run.send);
- worker->func_cancel = func_cancel;
- worker->func_end = func_end;
- worker->hash = NULL;
- worker->data = data;
+ worker->func_cancel = func_cancel;
+ worker->func_end = func_end;
+ worker->hash = NULL;
+ worker->data = data;
- worker->cancel = EINA_FALSE;
- worker->message_run = EINA_TRUE;
- worker->feedback_run = EINA_FALSE;
- worker->kill = EINA_FALSE;
- worker->reschedule = EINA_FALSE;
- worker->no_queue = EINA_FALSE;
- worker->self = 0;
+ worker->cancel = EINA_FALSE;
+ worker->message_run = EINA_TRUE;
+ worker->feedback_run = EINA_FALSE;
+ worker->kill = EINA_FALSE;
+ worker->reschedule = EINA_FALSE;
+ worker->no_queue = EINA_FALSE;
+ worker->self = 0;
- eina_threads_init();
+ eina_threads_init();
- if (PHC(t, _ecore_direct_worker, worker))
- return (Ecore_Thread*) worker;
+ if (PHC(t, _ecore_direct_worker, worker))
+ return (Ecore_Thread *)worker;
- eina_threads_shutdown();
+ eina_threads_shutdown();
- if (worker->u.message_run.direct_worker) _ecore_thread_worker_free(worker->u.message_run.direct_worker);
- if (worker->u.message_run.send) ecore_pipe_del(worker->u.message_run.send);
+ if (worker->u.message_run.direct_worker) _ecore_thread_worker_free(worker->u.message_run.direct_worker);
+ if (worker->u.message_run.send) ecore_pipe_del(worker->u.message_run.send);
- CDD(worker->cond);
- LKD(worker->mutex);
+ CDD(worker->cond);
+ LKD(worker->mutex);
- func_cancel((void *) data, NULL);
+ func_cancel((void *)data, NULL);
- return NULL;
+ return NULL;
}
+
#endif
EAPI Eina_Bool
@@ -1222,10 +1240,10 @@ ecore_thread_available_get(void)
EAPI Eina_Bool
ecore_thread_local_data_add(Ecore_Thread *thread,
- const char *key,
- void *value,
- Eina_Free_Cb cb,
- Eina_Bool direct)
+ const char *key,
+ void *value,
+ Eina_Free_Cb cb,
+ Eina_Bool direct)
{
Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker *)thread;
Ecore_Thread_Data *d;
@@ -1260,9 +1278,9 @@ ecore_thread_local_data_add(Ecore_Thread *thread,
EAPI void *
ecore_thread_local_data_set(Ecore_Thread *thread,
- const char *key,
- void *value,
- Eina_Free_Cb cb)
+ const char *key,
+ void *value,
+ Eina_Free_Cb cb)
{
Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker *)thread;
Ecore_Thread_Data *d, *r;
@@ -1271,7 +1289,6 @@ ecore_thread_local_data_set(Ecore_Thread *thread,
if ((!thread) || (!key) || (!value))
return NULL;
-
LKL(worker->mutex);
if (!worker->hash)
worker->hash = eina_hash_string_small_new(_ecore_thread_data_free);
@@ -1293,16 +1310,16 @@ ecore_thread_local_data_set(Ecore_Thread *thread,
if (r)
{
- ret = r->data;
- free(r);
- return ret;
+ ret = r->data;
+ free(r);
+ return ret;
}
return NULL;
}
EAPI void *
ecore_thread_local_data_find(Ecore_Thread *thread,
- const char *key)
+ const char *key)
{
Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker *)thread;
Ecore_Thread_Data *d;
@@ -1323,7 +1340,7 @@ ecore_thread_local_data_find(Ecore_Thread *thread,
EAPI Eina_Bool
ecore_thread_local_data_del(Ecore_Thread *thread,
- const char *key)
+ const char *key)
{
Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker *)thread;
Eina_Bool r;
@@ -1341,10 +1358,10 @@ ecore_thread_local_data_del(Ecore_Thread *thread,
}
EAPI Eina_Bool
-ecore_thread_global_data_add(const char *key,
- void *value,
+ecore_thread_global_data_add(const char *key,
+ void *value,
Eina_Free_Cb cb,
- Eina_Bool direct)
+ Eina_Bool direct)
{
Ecore_Thread_Data *d;
Eina_Bool ret;
@@ -1380,8 +1397,8 @@ ecore_thread_global_data_add(const char *key,
}
EAPI void *
-ecore_thread_global_data_set(const char *key,
- void *value,
+ecore_thread_global_data_set(const char *key,
+ void *value,
Eina_Free_Cb cb)
{
Ecore_Thread_Data *d, *r;
@@ -1455,7 +1472,7 @@ ecore_thread_global_data_del(const char *key)
EAPI void *
ecore_thread_global_data_wait(const char *key,
- double seconds)
+ double seconds)
{
double tm = 0;
Ecore_Thread_Data *ret = NULL;
@@ -1484,179 +1501,3 @@ ecore_thread_global_data_wait(const char *key,
return NULL;
}
-typedef struct _Ecore_Thread_Set Ecore_Thread_Set;
-struct _Ecore_Thread_Set
-{
- Eo *obj;
-
- union {
- struct {
- void *v;
- Eina_Free_Cb free_cb;
- } value;
- Eina_Error error;
- } u;
-
- Eina_Bool success;
-};
-
-static void
-_ecore_thread_main_loop_set(void *data)
-{
- Ecore_Thread_Set *dt = data;
-
- if (dt->success)
- efl_promise_value_set(efl_super(dt->obj, EFL_OBJECT_OVERRIDE_CLASS),
- dt->u.value.v, dt->u.value.free_cb);
- else
- efl_promise_failed_set(efl_super(dt->obj, EFL_OBJECT_OVERRIDE_CLASS),
- dt->u.error);
-
- efl_unref(dt->obj);
- free(dt);
-}
-
-static Ecore_Thread_Set *
-_ecore_thread_set_new(Eo *obj)
-{
- Ecore_Thread_Set *dt;
-
- dt = calloc(1, sizeof (Ecore_Thread_Set));
- if (!dt) return NULL;
-
- dt->obj = efl_ref(obj);
-
- return dt;
-}
-
-static void
-_ecore_thread_value_set(Eo *obj, const void *data EINA_UNUSED, void *v, Eina_Free_Cb free_cb)
-{
- Ecore_Thread_Set *dt;
-
- dt = _ecore_thread_set_new(obj);
- if (!dt) return ;
-
- dt->success = EINA_TRUE;
- dt->u.value.v = v;
- dt->u.value.free_cb = free_cb;
-
- ecore_main_loop_thread_safe_call_async(_ecore_thread_main_loop_set, dt);
-}
-
-static void
-_ecore_thread_failed_set(Eo *obj, const void *data EINA_UNUSED, Eina_Error err)
-{
- Ecore_Thread_Set *dt;
-
- dt = _ecore_thread_set_new(obj);
- if (!dt) return ;
-
- dt->success = EINA_FALSE;
- dt->u.error = err;
-
- ecore_main_loop_thread_safe_call_async(_ecore_thread_main_loop_set, dt);
-}
-
-typedef struct _Ecore_Thread_Progress Ecore_Thread_Progress;
-struct _Ecore_Thread_Progress
-{
- Eo *obj;
- const void *p;
-};
-
-static void *
-_ecore_thread_progress_sync(void *data)
-{
- Ecore_Thread_Progress *p = data;
-
- efl_promise_progress_set(efl_super(p->obj, EFL_OBJECT_OVERRIDE_CLASS), p->p);
-
- return NULL;
-}
-
-static void
-_ecore_thread_progress_set(Eo *obj, const void *data EINA_UNUSED, const void *p)
-{
- Ecore_Thread_Progress ip = { efl_ref(obj), p };
-
- ecore_main_loop_thread_safe_call_sync(_ecore_thread_progress_sync, &ip);
- efl_unref(obj);
-}
-
-static void
-_ecore_thread_future_heavy(void *dp, Ecore_Thread *thread)
-{
- Ecore_Thread_Future_Cb heavy;
- const void *data;
- Eo *p = dp;
-
- heavy = efl_key_data_get(p, "_ecore_thread.heavy");
- data = efl_key_data_get(p, "_ecore_thread.data");
-
- heavy(data, p, thread);
-}
-
-static void
-_ecore_thread_future_end(void *dp, Ecore_Thread *thread EINA_UNUSED)
-{
- Eina_Free_Cb free_cb;
- void *data;
- Eo *p = dp;
-
- free_cb = efl_key_data_get(p, "_ecore_thread.free_cb");
- data = efl_key_data_get(p, "_ecore_thread.data");
-
- if (free_cb) free_cb(data);
- efl_del(p);
-}
-
-static void
-_ecore_thread_future_none(void *data, const Efl_Event *ev EINA_UNUSED)
-{
- Ecore_Thread *t = data;
-
- // Cancelling thread if there is nobody listening on the promise anymore
- ecore_thread_cancel(t);
-}
-
-EAPI Efl_Future *
-ecore_thread_future_run(Ecore_Thread_Future_Cb heavy, const void *data, Eina_Free_Cb free_cb)
-{
- Ecore_Thread *t;
- Eo *p;
-
- if (!heavy) return NULL;
-
- EFL_OPS_DEFINE(thread_safe_call,
- EFL_OBJECT_OP_FUNC(efl_promise_value_set, _ecore_thread_value_set),
- EFL_OBJECT_OP_FUNC(efl_promise_failed_set, _ecore_thread_failed_set),
- EFL_OBJECT_OP_FUNC(efl_promise_progress_set, _ecore_thread_progress_set));
-
- efl_domain_current_push(EFL_ID_DOMAIN_SHARED);
-
- efl_wref_add(efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()), &p);
- if (!p) goto end;
-
- efl_object_override(p, &thread_safe_call);
-
- efl_key_data_set(p, "_ecore_thread.data", data);
- efl_key_data_set(p, "_ecore_thread.free_cb", free_cb);
- efl_key_data_set(p, "_ecore_thread.heavy", heavy);
-
- t = ecore_thread_run(_ecore_thread_future_heavy,
- _ecore_thread_future_end,
- _ecore_thread_future_end,
- p);
-
- if (p)
- {
- efl_event_callback_add(p, EFL_PROMISE_EVENT_FUTURE_NONE, _ecore_thread_future_none, t);
- efl_wref_del(p, &p);
- }
-
- end:
- efl_domain_current_pop();
-
- return p ? efl_promise_future_get(p) : NULL;
-}
diff --git a/src/lib/ecore/ecore_timer.c b/src/lib/ecore/ecore_timer.c
index c473b3e50d..1ebce1f3df 100644
--- a/src/lib/ecore/ecore_timer.c
+++ b/src/lib/ecore/ecore_timer.c
@@ -74,7 +74,7 @@ static void
_check_timer_event_catcher_add(void *data, const Efl_Event *event)
{
Efl_Loop_Timer_Data *timer = data;
- const Efl_Callback_Array_Item *array = event->info;
+ const Efl_Callback_Array_Item_Full *array = event->info;
int i;
for (i = 0; array[i].desc != NULL; i++)
@@ -94,7 +94,7 @@ static void
_check_timer_event_catcher_del(void *data, const Efl_Event *event)
{
Efl_Loop_Timer_Data *timer = data;
- const Efl_Callback_Array_Item *array = event->info;
+ const Efl_Callback_Array_Item_Full *array = event->info;
int i;
for (i = 0; array[i].desc != NULL; i++)
@@ -174,9 +174,13 @@ ecore_timer_add(double in, Ecore_Task_Cb func, const void *data)
Eo *timer;
EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
+ if (!func)
+ {
+ ERR("Callback function must be set up for the class.");
+ return NULL;
+ }
legacy = calloc(1, sizeof (Ecore_Timer_Legacy));
if (!legacy) return NULL;
-
legacy->func = func;
legacy->data = data;
timer = efl_add(MY_CLASS, efl_main_loop_get(),
@@ -193,9 +197,13 @@ ecore_timer_loop_add(double in, Ecore_Task_Cb func, const void *data)
Eo *timer;
EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
+ if (!func)
+ {
+ ERR("Callback function must be set up for the class.");
+ return NULL;
+ }
legacy = calloc(1, sizeof (Ecore_Timer_Legacy));
if (!legacy) return NULL;
-
legacy->func = func;
legacy->data = data;
timer = efl_add(MY_CLASS, efl_main_loop_get(),
@@ -239,7 +247,7 @@ _efl_loop_timer_interval_set(Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer, do
}
EOLIAN static double
-_efl_loop_timer_interval_get(Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer)
+_efl_loop_timer_interval_get(const Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer)
{
return timer->in;
}
@@ -293,7 +301,7 @@ _efl_loop_timer_loop_reset(Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer)
}
EOLIAN static double
-_efl_loop_timer_pending_get(Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer)
+_efl_loop_timer_pending_get(const Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer)
{
double now, ret = 0.0;
@@ -341,7 +349,7 @@ ecore_timer_freeze_get(Ecore_Timer *timer)
}
EOLIAN static int
-_efl_loop_timer_efl_object_event_freeze_count_get(Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer)
+_efl_loop_timer_efl_object_event_freeze_count_get(const Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer)
{
return timer->frozen;
}
@@ -459,6 +467,8 @@ _efl_loop_timer_efl_object_parent_set(Eo *obj, Efl_Loop_Timer_Data *pd, Efl_Obje
_efl_loop_timer_util_loop_clear(pd);
+ if (efl_invalidated_get(obj)) return;
+
pd->loop = efl_provider_find(obj, EFL_LOOP_CLASS);
if (pd->loop)
pd->loop_data = efl_data_scope_get(pd->loop, EFL_LOOP_CLASS);
@@ -547,7 +557,8 @@ _efl_loop_timer_reschedule(Efl_Loop_Timer_Data *timer, double when)
{
if (timer->frozen) return;
- if (timer->loop_data)
+ if (timer->loop_data &&
+ (EINA_INLIST_GET(timer)->next || EINA_INLIST_GET(timer)->prev))
{
if (timer->loop_data->timers && (!timer->noparent))
timer->loop_data->timers = eina_inlist_remove
diff --git a/src/lib/ecore/efl_app.c b/src/lib/ecore/efl_app.c
new file mode 100644
index 0000000000..ffb256741a
--- /dev/null
+++ b/src/lib/ecore/efl_app.c
@@ -0,0 +1,412 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#define EFL_IO_READER_PROTECTED 1
+#define EFL_IO_WRITER_PROTECTED 1
+#define EFL_IO_CLOSER_PROTECTED 1
+
+#include <Ecore.h>
+
+#include "ecore_private.h"
+
+#ifndef _WIN32
+# include <sys/resource.h>
+#endif
+
+#define MY_CLASS EFL_APP_CLASS
+
+typedef struct _Efl_App_Data Efl_App_Data;
+
+struct _Efl_App_Data
+{
+ struct {
+ int in, out;
+ Eo *in_handler, *out_handler;
+ Eina_Bool can_read : 1;
+ Eina_Bool eos_read : 1;
+ Eina_Bool can_write : 1;
+ } fd;
+ int read_listeners;
+};
+
+Efl_Version _app_efl_version = { 0, 0, 0, 0, NULL, NULL };
+
+//////////////////////////////////////////////////////////////////////////
+
+EAPI Eo *
+efl_app_get(void)
+{
+ return efl_main_loop_get();
+}
+
+//////////////////////////////////////////////////////////////////////////
+
+static void
+_parent_read_listeners_modify(Efl_App_Data *pd, int mod)
+{
+ pd->read_listeners += mod;
+
+ if (pd->fd.out_handler)
+ {
+ if ((pd->read_listeners == 0) && (mod < 0))
+ efl_loop_handler_active_set
+ (pd->fd.out_handler, EFL_LOOP_HANDLER_FLAGS_NONE);
+ else if ((pd->read_listeners == 1) && (mod > 0))
+ efl_loop_handler_active_set
+ (pd->fd.out_handler, EFL_LOOP_HANDLER_FLAGS_READ);
+ }
+}
+
+static void
+_cb_event_callback_add(void *data, const Efl_Event *event)
+{
+ Efl_App_Data *pd = data;
+ const Efl_Callback_Array_Item_Full *array = event->info;
+ int i;
+
+ for (i = 0; array[i].desc != NULL; i++)
+ {
+ if (array[i].desc == EFL_IO_READER_EVENT_CAN_READ_CHANGED)
+ _parent_read_listeners_modify(pd, 1);
+ }
+}
+
+static void
+_cb_event_callback_del(void *data, const Efl_Event *event)
+{
+ Efl_App_Data *pd = data;
+ const Efl_Callback_Array_Item_Full *array = event->info;
+ int i;
+
+ for (i = 0; array[i].desc != NULL; i++)
+ {
+ if (array[i].desc == EFL_IO_READER_EVENT_CAN_READ_CHANGED)
+ _parent_read_listeners_modify(pd, -1);
+ }
+}
+
+static void
+_cb_out(void *data, const Efl_Event *event EINA_UNUSED)
+{
+ Eo *obj = data;
+ efl_io_reader_can_read_set(obj, EINA_TRUE);
+}
+
+static void
+_cb_in(void *data, const Efl_Event *event EINA_UNUSED)
+{
+ Eo *obj = data;
+ efl_io_writer_can_write_set(obj, EINA_TRUE);
+}
+
+
+EFL_CALLBACKS_ARRAY_DEFINE(_event_callback_watch,
+ { EFL_EVENT_CALLBACK_ADD, _cb_event_callback_add },
+ { EFL_EVENT_CALLBACK_DEL, _cb_event_callback_del });
+
+//////////////////////////////////////////////////////////////////////////
+
+EOLIAN static Efl_Loop *
+_efl_app_loop_main_get(const Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
+{
+ if (_mainloop_singleton) return _mainloop_singleton;
+ _mainloop_singleton = efl_add_ref(EFL_APP_CLASS, NULL);
+ _mainloop_singleton_data = efl_data_scope_get(_mainloop_singleton, EFL_LOOP_CLASS);
+ return _mainloop_singleton;
+}
+
+EOLIAN static const Efl_Version *
+_efl_app_build_efl_version_get(const Eo *obj EINA_UNUSED, Efl_App_Data *pd EINA_UNUSED)
+{
+ return &_app_efl_version;
+}
+
+EOLIAN static const Efl_Version *
+_efl_app_efl_version_get(const Eo *obj EINA_UNUSED, Efl_App_Data *pd EINA_UNUSED)
+{
+ /* vanilla EFL: flavor = NULL */
+ static const Efl_Version version = {
+ .major = VMAJ,
+ .minor = VMIN,
+ .micro = VMIC,
+ .revision = VREV,
+ .build_id = EFL_BUILD_ID,
+ .flavor = NULL
+ };
+ return &version;
+}
+
+EOLIAN static Efl_Object *
+_efl_app_efl_object_constructor(Eo *obj, Efl_App_Data *pd)
+{
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+ efl_event_callback_array_add(obj, _event_callback_watch(), pd);
+ pd->fd.in = 1;
+ pd->fd.out = 0;
+ pd->fd.can_write = EINA_TRUE;
+ pd->fd.in_handler =
+ efl_add(EFL_LOOP_HANDLER_CLASS, obj,
+ efl_loop_handler_fd_set(efl_added, pd->fd.in),
+ efl_event_callback_add(efl_added, EFL_LOOP_HANDLER_EVENT_WRITE, _cb_in, obj));
+ pd->fd.out_handler =
+ efl_add(EFL_LOOP_HANDLER_CLASS, obj,
+ efl_loop_handler_fd_set(efl_added, pd->fd.out),
+ efl_event_callback_add(efl_added, EFL_LOOP_HANDLER_EVENT_READ, _cb_out, obj));
+ return obj;
+}
+
+EOLIAN static void
+_efl_app_efl_object_invalidate(Eo *obj, Efl_App_Data *pd)
+{
+ pd->fd.in_handler = NULL;
+ pd->fd.out_handler = NULL;
+ pd->fd.in = -1;
+ pd->fd.out = -1;
+
+ efl_invalidate(efl_super(obj, MY_CLASS));
+}
+
+EOLIAN static Eina_Error
+_efl_app_efl_io_closer_close(Eo *obj, Efl_App_Data *pd)
+{
+ EINA_SAFETY_ON_TRUE_RETURN_VAL(efl_io_closer_closed_get(obj), EBADF);
+ efl_io_writer_can_write_set(obj, EINA_FALSE);
+ efl_io_reader_can_read_set(obj, EINA_FALSE);
+ efl_io_reader_eos_set(obj, EINA_TRUE);
+ if (pd->fd.in_handler) efl_del(pd->fd.in_handler);
+ if (pd->fd.out_handler) efl_del(pd->fd.out_handler);
+ pd->fd.in = -1;
+ pd->fd.out = -1;
+ pd->fd.in_handler = NULL;
+ pd->fd.out_handler = NULL;
+ return 0;
+}
+
+EOLIAN static Eina_Bool
+_efl_app_efl_io_closer_closed_get(const Eo *obj EINA_UNUSED, Efl_App_Data *pd)
+{
+ if ((pd->fd.in == -1) && (pd->fd.out == -1)) return EINA_TRUE;
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Error
+_efl_app_efl_io_reader_read(Eo *obj, Efl_App_Data *pd, Eina_Rw_Slice *rw_slice)
+{
+ ssize_t r;
+
+ errno = 0;
+ if (pd->fd.out == -1) goto err;
+
+ do
+ {
+ errno = 0;
+ r = read(pd->fd.out, rw_slice->mem, rw_slice->len);
+ if (r == -1)
+ {
+ if (errno == EINTR) continue;
+ goto err;
+ }
+ }
+ while (r == -1);
+
+ rw_slice->len = r;
+ if (r == 0)
+ {
+ efl_io_reader_can_read_set(obj, EINA_FALSE);
+ efl_io_reader_eos_set(obj, EINA_TRUE);
+ close(pd->fd.out);
+ pd->fd.out = -1;
+ efl_del(pd->fd.out_handler);
+ pd->fd.out_handler = NULL;
+ return EPIPE;
+ }
+ return 0;
+err:
+ if ((pd->fd.out != -1) && (errno != EAGAIN))
+ {
+ close(pd->fd.out);
+ pd->fd.out = -1;
+ efl_del(pd->fd.out_handler);
+ pd->fd.out_handler = NULL;
+ }
+ rw_slice->len = 0;
+ rw_slice->mem = NULL;
+ efl_io_reader_can_read_set(obj, EINA_FALSE);
+ return EINVAL;
+}
+
+EOLIAN static void
+_efl_app_efl_io_reader_can_read_set(Eo *obj, Efl_App_Data *pd, Eina_Bool can_read)
+{
+ Eina_Bool old = efl_io_reader_can_read_get(obj);
+ if (old == can_read) return;
+ pd->fd.can_read = can_read;
+ if (can_read)
+ efl_loop_handler_active_set(pd->fd.in_handler, 0);
+ else
+ efl_loop_handler_active_set(pd->fd.in_handler,
+ EFL_LOOP_HANDLER_FLAGS_READ);
+ efl_event_callback_call(obj, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL);
+}
+
+EOLIAN static Eina_Bool
+_efl_app_efl_io_reader_can_read_get(const Eo *obj EINA_UNUSED, Efl_App_Data *pd)
+{
+ return pd->fd.can_read;
+}
+
+EOLIAN static void
+_efl_app_efl_io_reader_eos_set(Eo *obj, Efl_App_Data *pd, Eina_Bool is_eos)
+{
+ Eina_Bool old = efl_io_reader_eos_get(obj);
+ if (old == is_eos) return;
+
+ pd->fd.eos_read = is_eos;
+ if (!is_eos) return;
+ if (pd->fd.out_handler)
+ efl_loop_handler_active_set(pd->fd.out_handler, 0);
+ efl_event_callback_call(obj, EFL_IO_READER_EVENT_EOS, NULL);
+}
+
+EOLIAN static Eina_Bool
+_efl_app_efl_io_reader_eos_get(const Eo *obj EINA_UNUSED, Efl_App_Data *pd)
+{
+ return pd->fd.eos_read;
+}
+
+EOLIAN static Eina_Error
+_efl_app_efl_io_writer_write(Eo *obj, Efl_App_Data *pd, Eina_Slice *slice, Eina_Slice *remaining)
+{
+ ssize_t r;
+
+ errno = 0;
+ if (pd->fd.in == -1) goto err;
+
+ do
+ {
+ errno = 0;
+ r = write(pd->fd.in, slice->mem, slice->len);
+ if (r == -1)
+ {
+ if (errno == EINTR) continue;
+ goto err;
+ }
+ }
+ while (r == -1);
+
+ if (remaining)
+ {
+ remaining->len = slice->len - r;
+ remaining->bytes = slice->bytes + r;
+ }
+ slice->len = r;
+
+ if ((slice) && (slice->len > 0))
+ efl_io_writer_can_write_set(obj, EINA_FALSE);
+ if (r == 0)
+ {
+ close(pd->fd.in);
+ pd->fd.in = -1;
+ efl_del(pd->fd.in_handler);
+ pd->fd.in_handler = NULL;
+ return EPIPE;
+ }
+ return 0;
+err:
+ if ((pd->fd.in != -1) && (errno != EAGAIN))
+ {
+ close(pd->fd.in);
+ pd->fd.in = -1;
+ efl_del(pd->fd.in_handler);
+ pd->fd.in_handler = NULL;
+ }
+ if (remaining) *remaining = *slice;
+ slice->len = 0;
+ slice->mem = NULL;
+ efl_io_writer_can_write_set(obj, EINA_FALSE);
+ return EINVAL;
+}
+
+EOLIAN static void
+_efl_app_efl_io_writer_can_write_set(Eo *obj, Efl_App_Data *pd, Eina_Bool can_write)
+{
+ Eina_Bool old = efl_io_writer_can_write_get(obj);
+ if (old == can_write) return;
+ pd->fd.can_write = can_write;
+ if (can_write)
+ efl_loop_handler_active_set(pd->fd.in_handler, 0);
+ else
+ efl_loop_handler_active_set(pd->fd.in_handler,
+ EFL_LOOP_HANDLER_FLAGS_WRITE);
+ efl_event_callback_call(obj, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL);
+}
+
+EOLIAN static Eina_Bool
+_efl_app_efl_io_writer_can_write_get(const Eo *obj EINA_UNUSED, Efl_App_Data *pd)
+{
+ return pd->fd.can_write;
+}
+
+#ifdef _WIN32
+#else
+static const signed char primap[EFL_TASK_PRIORITY_ULTRA + 1] =
+{
+ 10, // EFL_TASK_PRIORITY_NORMAL
+ 19, // EFL_TASK_PRIORITY_BACKGROUND
+ 15, // EFL_TASK_PRIORITY_LOW
+ 5, // EFL_TASK_PRIORITY_HIGH
+ 0 // EFL_TASK_PRIORITY_ULTRA
+};
+#endif
+
+EOLIAN static void
+_efl_app_efl_task_priority_set(Eo *obj, Efl_App_Data *pd EINA_UNUSED, Efl_Task_Priority priority)
+{
+ efl_task_priority_set(efl_super(obj, MY_CLASS), priority);
+#ifdef _WIN32
+#else
+ // -20 (high) -> 19 (low)
+ int p = 0;
+
+ if ((priority >= EFL_TASK_PRIORITY_NORMAL) &&
+ (priority <= EFL_TASK_PRIORITY_ULTRA))
+ p = primap[priority];
+ setpriority(PRIO_PROCESS, 0, p);
+#endif
+}
+
+EOLIAN static Efl_Task_Priority
+_efl_app_efl_task_priority_get(const Eo *obj, Efl_App_Data *pd EINA_UNUSED)
+{
+ Efl_Task_Priority pri = EFL_TASK_PRIORITY_NORMAL;
+#ifdef _WIN32
+#else
+ int p, i, dist = 0x7fffffff, d;
+
+ errno = 0;
+ p = getpriority(PRIO_PROCESS, 0);
+ if (errno != 0)
+ return efl_task_priority_get(efl_super(obj, MY_CLASS));
+
+ // find the closest matching priority in primap
+ for (i = EFL_TASK_PRIORITY_NORMAL; i <= EFL_TASK_PRIORITY_ULTRA; i++)
+ {
+ d = primap[i] - p;
+ if (d < 0) d = -d;
+ if (d < dist)
+ {
+ pri = i;
+ dist = d;
+ }
+ }
+
+ Efl_Task_Data *td = efl_data_scope_get(obj, EFL_TASK_CLASS);
+ if (td) td->priority = pri;
+#endif
+ return pri;
+}
+
+//////////////////////////////////////////////////////////////////////////
+
+#include "efl_app.eo.c"
diff --git a/src/lib/ecore/efl_app.eo b/src/lib/ecore/efl_app.eo
new file mode 100644
index 0000000000..d5ef77d44d
--- /dev/null
+++ b/src/lib/ecore/efl_app.eo
@@ -0,0 +1,56 @@
+import efl_types;
+
+class Efl.App (Efl.Loop)
+{
+ [[ ]]
+ methods {
+ @property loop_main @class {
+ [[ Points to the main loop instance of the application. ]]
+ get {}
+ values {
+ main_loop: Efl.Loop; [[Application main loop]]
+ }
+ }
+ @property build_efl_version {
+ [[ Indicates the version of EFL with which this application was
+ compiled against/for.
+
+ This might differ from @.efl_version.
+ ]]
+ get {}
+ values {
+ @cref version: Efl.Version; [[Efl version]]
+ }
+ }
+ @property efl_version {
+ [[ Indicates the currently running version of EFL.
+
+ This might differ from @.build_efl_version.
+ ]]
+ get {}
+ values {
+ @cref version: Efl.Version; [[Efl version]]
+ }
+ }
+ }
+ events {
+ pause: void; [[Called when the application is not going be displayed or otherwise used by a user for some time]]
+ resume: void; [[Called before a window is rendered after a pause event]]
+ terminate: void; [[Called before starting the shutdown of the application]]
+ signal,usr1: void; [[System specific, but on unix maps to SIGUSR1 signal to the process - only called on main loop object]]
+ signal,usr2: void; [[System specific, but on unix maps to SIGUSR2 signal to the process - only called on main loop object]]
+ signal,hup: void; [[System specific, but on unix maps to SIGHUP signal to the process - only called on main loop object]]
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Object.invalidate;
+ Efl.Io.Closer.close;
+ Efl.Io.Closer.closed { get; }
+ Efl.Io.Reader.read;
+ Efl.Io.Reader.can_read { get; set; }
+ Efl.Io.Reader.eos { get; set; }
+ Efl.Io.Writer.write;
+ Efl.Io.Writer.can_write { get; set; }
+ Efl.Task.priority { get; set; }
+ }
+}
diff --git a/src/lib/ecore/efl_appthread.c b/src/lib/ecore/efl_appthread.c
new file mode 100644
index 0000000000..250d879118
--- /dev/null
+++ b/src/lib/ecore/efl_appthread.c
@@ -0,0 +1,261 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#define EFL_IO_READER_PROTECTED 1
+#define EFL_IO_WRITER_PROTECTED 1
+#define EFL_IO_CLOSER_PROTECTED 1
+
+#include <Ecore.h>
+
+#include "ecore_private.h"
+
+#include <unistd.h>
+#include <fcntl.h>
+#include <string.h>
+
+#define MY_CLASS EFL_APPTHREAD_CLASS
+
+//////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////
+
+EOLIAN static Efl_Object *
+_efl_appthread_efl_object_constructor(Eo *obj, Efl_Appthread_Data *pd)
+{
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+ pd->fd.in = -1;
+ pd->fd.out = -1;
+ pd->fd.can_write = EINA_TRUE;
+ pd->ctrl.in = -1;
+ pd->ctrl.out = -1;
+ return obj;
+}
+
+EOLIAN static void
+_efl_appthread_efl_object_destructor(Eo *obj, Efl_Appthread_Data *pd)
+{
+ if (pd->fd.in >= 0)
+ {
+ efl_del(pd->fd.in_handler);
+ efl_del(pd->fd.out_handler);
+ efl_del(pd->ctrl.in_handler);
+ efl_del(pd->ctrl.out_handler);
+ close(pd->fd.in);
+ close(pd->fd.out);
+ close(pd->ctrl.in);
+ close(pd->ctrl.out);
+ pd->fd.in_handler = NULL;
+ pd->fd.out_handler = NULL;
+ pd->ctrl.in_handler = NULL;
+ pd->ctrl.out_handler = NULL;
+ pd->fd.in = -1;
+ pd->fd.out = -1;
+ pd->ctrl.in = -1;
+ pd->ctrl.out = -1;
+ }
+ efl_destructor(efl_super(obj, MY_CLASS));
+}
+
+EOLIAN static Eina_Error
+_efl_appthread_efl_io_closer_close(Eo *obj, Efl_Appthread_Data *pd)
+{
+ EINA_SAFETY_ON_TRUE_RETURN_VAL(efl_io_closer_closed_get(obj), EBADF);
+ efl_io_writer_can_write_set(obj, EINA_FALSE);
+ efl_io_reader_can_read_set(obj, EINA_FALSE);
+ efl_io_reader_eos_set(obj, EINA_TRUE);
+ if (pd->fd.in >= 0) close(pd->fd.in);
+ if (pd->fd.out >= 0) close(pd->fd.out);
+ if (pd->fd.in_handler) efl_del(pd->fd.in_handler);
+ if (pd->fd.out_handler) efl_del(pd->fd.out_handler);
+ pd->fd.in = -1;
+ pd->fd.out = -1;
+ pd->fd.in_handler = NULL;
+ pd->fd.out_handler = NULL;
+ return 0;
+}
+
+EOLIAN static Eina_Bool
+_efl_appthread_efl_io_closer_closed_get(const Eo *obj EINA_UNUSED, Efl_Appthread_Data *pd)
+{
+ if ((pd->fd.in == -1) && (pd->fd.out == -1)) return EINA_TRUE;
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Error
+_efl_appthread_efl_io_reader_read(Eo *obj, Efl_Appthread_Data *pd, Eina_Rw_Slice *rw_slice)
+{
+ ssize_t r;
+
+ errno = 0;
+ if (pd->fd.out == -1) goto err;
+
+ do
+ {
+ errno = 0;
+ r = read(pd->fd.out, rw_slice->mem, rw_slice->len);
+ if (r == -1)
+ {
+ if (errno == EINTR) continue;
+ goto err;
+ }
+ }
+ while (r == -1);
+
+ rw_slice->len = r;
+ if (r == 0)
+ {
+ efl_io_reader_can_read_set(obj, EINA_FALSE);
+ efl_io_reader_eos_set(obj, EINA_TRUE);
+ close(pd->fd.out);
+ pd->fd.out = -1;
+ efl_del(pd->fd.out_handler);
+ pd->fd.out_handler = NULL;
+ return EPIPE;
+ }
+ return 0;
+err:
+ if ((pd->fd.out != -1) && (errno != EAGAIN))
+ {
+ close(pd->fd.out);
+ pd->fd.out = -1;
+ efl_del(pd->fd.out_handler);
+ pd->fd.out_handler = NULL;
+ }
+ rw_slice->len = 0;
+ rw_slice->mem = NULL;
+ efl_io_reader_can_read_set(obj, EINA_FALSE);
+ return EINVAL;
+}
+
+EOLIAN static void
+_efl_appthread_efl_io_reader_can_read_set(Eo *obj, Efl_Appthread_Data *pd, Eina_Bool can_read)
+{
+ Eina_Bool old = efl_io_reader_can_read_get(obj);
+ if (old == can_read) return;
+ pd->fd.can_read = can_read;
+ if (can_read)
+ efl_loop_handler_active_set(pd->fd.in_handler, 0);
+ else
+ efl_loop_handler_active_set(pd->fd.in_handler,
+ EFL_LOOP_HANDLER_FLAGS_READ);
+ efl_event_callback_call(obj, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL);
+}
+
+EOLIAN static Eina_Bool
+_efl_appthread_efl_io_reader_can_read_get(const Eo *obj EINA_UNUSED, Efl_Appthread_Data *pd)
+{
+ return pd->fd.can_read;
+}
+
+EOLIAN static void
+_efl_appthread_efl_io_reader_eos_set(Eo *obj, Efl_Appthread_Data *pd, Eina_Bool is_eos)
+{
+ Eina_Bool old = efl_io_reader_eos_get(obj);
+ if (old == is_eos) return;
+
+ pd->fd.eos_read = is_eos;
+ if (!is_eos) return;
+ if (pd->fd.out_handler)
+ efl_loop_handler_active_set(pd->fd.out_handler, 0);
+ efl_event_callback_call(obj, EFL_IO_READER_EVENT_EOS, NULL);
+}
+
+EOLIAN static Eina_Bool
+_efl_appthread_efl_io_reader_eos_get(const Eo *obj EINA_UNUSED, Efl_Appthread_Data *pd)
+{
+ return pd->fd.eos_read;
+}
+
+EOLIAN static Eina_Error
+_efl_appthread_efl_io_writer_write(Eo *obj, Efl_Appthread_Data *pd, Eina_Slice *slice, Eina_Slice *remaining)
+{
+ ssize_t r;
+
+ errno = 0;
+ if (pd->fd.in == -1) goto err;
+
+ do
+ {
+ errno = 0;
+ r = write(pd->fd.in, slice->mem, slice->len);
+ if (r == -1)
+ {
+ if (errno == EINTR) continue;
+ goto err;
+ }
+ }
+ while (r == -1);
+
+ if (remaining)
+ {
+ remaining->len = slice->len - r;
+ remaining->bytes = slice->bytes + r;
+ }
+ slice->len = r;
+
+ if ((slice) && (slice->len > 0))
+ efl_io_writer_can_write_set(obj, EINA_FALSE);
+ if (r == 0)
+ {
+ close(pd->fd.in);
+ pd->fd.in = -1;
+ efl_del(pd->fd.in_handler);
+ pd->fd.in_handler = NULL;
+ return EPIPE;
+ }
+ return 0;
+err:
+ if ((pd->fd.in != -1) && (errno != EAGAIN))
+ {
+ close(pd->fd.in);
+ pd->fd.in = -1;
+ efl_del(pd->fd.in_handler);
+ pd->fd.in_handler = NULL;
+ }
+ if (remaining) *remaining = *slice;
+ slice->len = 0;
+ slice->mem = NULL;
+ efl_io_writer_can_write_set(obj, EINA_FALSE);
+ return EINVAL;
+}
+
+EOLIAN static void
+_efl_appthread_efl_io_writer_can_write_set(Eo *obj, Efl_Appthread_Data *pd, Eina_Bool can_write)
+{
+ Eina_Bool old = efl_io_writer_can_write_get(obj);
+ if (old == can_write) return;
+ pd->fd.can_write = can_write;
+ if (can_write)
+ efl_loop_handler_active_set(pd->fd.in_handler, 0);
+ else
+ efl_loop_handler_active_set(pd->fd.in_handler,
+ EFL_LOOP_HANDLER_FLAGS_WRITE);
+ efl_event_callback_call(obj, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL);
+}
+
+EOLIAN static Eina_Bool
+_efl_appthread_efl_io_writer_can_write_get(const Eo *obj EINA_UNUSED, Efl_Appthread_Data *pd)
+{
+ return pd->fd.can_write;
+}
+
+void _appthread_threadio_call(Eo *obj, Efl_Appthread_Data *pd, void *func_data, EFlThreadIOCall func, Eina_Free_Cb func_free_cb);
+
+EOLIAN static void
+_efl_appthread_efl_threadio_call(Eo *obj, Efl_Appthread_Data *pd, void *func_data, EFlThreadIOCall func, Eina_Free_Cb func_free_cb)
+{
+ _appthread_threadio_call(obj, pd, func_data, func, func_free_cb);
+}
+
+void *_appthread_threadio_call_sync(Eo *obj, Efl_Appthread_Data *pd, void *func_data, EFlThreadIOCallSync func, Eina_Free_Cb func_free_cb);
+
+EOLIAN static void *
+_efl_appthread_efl_threadio_call_sync(Eo *obj, Efl_Appthread_Data *pd, void *func_data, EFlThreadIOCallSync func, Eina_Free_Cb func_free_cb)
+{
+ return _appthread_threadio_call_sync(obj, pd, func_data, func, func_free_cb);
+}
+
+//////////////////////////////////////////////////////////////////////////
+
+#include "efl_appthread.eo.c"
diff --git a/src/lib/ecore/efl_appthread.eo b/src/lib/ecore/efl_appthread.eo
new file mode 100644
index 0000000000..436846e0e9
--- /dev/null
+++ b/src/lib/ecore/efl_appthread.eo
@@ -0,0 +1,21 @@
+class Efl.Appthread (Efl.Loop, Efl.ThreadIO)
+{
+ [[ ]]
+ methods {
+ }
+ events {
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Object.destructor;
+ Efl.Io.Closer.close;
+ Efl.Io.Closer.closed { get; }
+ Efl.Io.Reader.read;
+ Efl.Io.Reader.can_read { get; set; }
+ Efl.Io.Reader.eos { get; set; }
+ Efl.Io.Writer.write;
+ Efl.Io.Writer.can_write { get; set; }
+ Efl.ThreadIO.call;
+ Efl.ThreadIO.call_sync;
+ }
+}
diff --git a/src/lib/ecore/efl_exe.c b/src/lib/ecore/efl_exe.c
new file mode 100644
index 0000000000..7e1e3a242a
--- /dev/null
+++ b/src/lib/ecore/efl_exe.c
@@ -0,0 +1,844 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#define EFL_IO_READER_PROTECTED 1
+#define EFL_IO_WRITER_PROTECTED 1
+#define EFL_IO_CLOSER_PROTECTED 1
+
+#include <Ecore.h>
+
+#include "ecore_private.h"
+
+#ifdef _WIN32
+#else
+# include <sys/time.h>
+# include <sys/resource.h>
+# include <stdlib.h>
+# include <stdio.h>
+# include <string.h>
+# include <errno.h>
+# include <sys/types.h>
+# include <unistd.h>
+# include <fcntl.h>
+# include <signal.h>
+# include <sys/socket.h>
+# ifdef HAVE_PRCTL
+# include <sys/prctl.h>
+# endif
+# ifdef HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+# endif
+# ifndef HAVE_CLEARENV
+extern char **environ;
+# endif
+#endif
+
+#define MY_CLASS EFL_EXE_CLASS
+
+typedef struct _Efl_Exe_Data Efl_Exe_Data;
+
+struct _Efl_Exe_Data
+{
+ int exit_signal;
+ Efl_Exe_Flags flags;
+#ifdef _WIN32
+ struct {
+ Eo *in_handler, *out_handler;
+ Eina_Bool can_read : 1;
+ Eina_Bool eos_read : 1;
+ Eina_Bool can_write : 1;
+ } fd;
+#else
+ Eina_Promise *promise;
+ Eo *exit_handler;
+ pid_t pid;
+ struct {
+ int in, out, exited_read, exited_write;
+ Eo *in_handler, *out_handler;
+ Eina_Bool can_read : 1;
+ Eina_Bool eos_read : 1;
+ Eina_Bool can_write : 1;
+ } fd;
+#endif
+ Eina_Bool exit_called : 1;
+ Eina_Bool run : 1;
+};
+
+//////////////////////////////////////////////////////////////////////////
+
+#ifdef _WIN32
+#else
+static const signed char primap[EFL_TASK_PRIORITY_ULTRA + 1] =
+{
+ 10, // EFL_TASK_PRIORITY_NORMAL
+ 19, // EFL_TASK_PRIORITY_BACKGROUND
+ 15, // EFL_TASK_PRIORITY_LOW
+ 5, // EFL_TASK_PRIORITY_HIGH
+ 0 // EFL_TASK_PRIORITY_ULTRA
+};
+
+static void
+_close_fds(Efl_Exe_Data *pd)
+{
+ if (pd->fd.in >= 0) close(pd->fd.in);
+ if (pd->fd.out >= 0) close(pd->fd.out);
+ if (pd->fd.exited_read >= 0) close(pd->fd.exited_read);
+ if (pd->fd.exited_write >= 0) close(pd->fd.exited_write);
+ pd->fd.in = -1;
+ pd->fd.out = -1;
+ pd->fd.exited_read = -1;
+ pd->fd.exited_write = -1;
+}
+
+static void
+_exec(const char *cmd, Efl_Exe_Flags flags)
+{
+ char use_sh = 1, *buf = NULL, **args = NULL;
+
+ // Try to avoid wrapping the exe call with /bin/sh -c.
+ // We conservatively search for certain shell meta characters,
+ // If we don't find them, we can call the exe directly.
+ if (!strpbrk(cmd, "|&;<>()$\\\"'*?#"))
+ {
+ char *token, pre_command = 1;
+ int num_tokens = 0, len;
+
+ len = strlen(cmd);
+ buf = alloca(len + 1);
+ strcpy(buf, cmd);
+ buf[len] = 0;
+
+ token = strtok(buf, " \t\n\v");
+ while (token)
+ {
+ if (token[0] == '~') break;
+ if (pre_command)
+ {
+ if (token[0] == '[') break;
+ if (strchr(token, '=')) break;
+ else pre_command = 0;
+ }
+ num_tokens++;
+ token = strtok(NULL, " \t\n\v");
+ }
+ if ((!token) && (num_tokens))
+ {
+ int i = 0;
+
+ len = strlen(cmd);
+ buf = alloca(len + 1);
+ strcpy(buf, cmd);
+ buf[len] = 0;
+
+ token = strtok(buf, " \t\n\v");
+ use_sh = 0;
+ args = alloca((num_tokens + 1) * sizeof(char *));
+ for (i = 0; i < num_tokens; i++)
+ {
+ if (token) args[i] = token;
+ token = strtok(NULL, " \t\n\v");
+ }
+ args[num_tokens] = NULL;
+ }
+ }
+# ifdef HAVE_PRCTL
+ if (flags & EFL_EXE_FLAGS_EXIT_WITH_PARENT)
+ prctl(PR_SET_PDEATHSIG, SIGTERM);
+# endif
+
+ if (flags & EFL_EXE_FLAGS_GROUP_LEADER) setsid();
+ if (use_sh) // We have to use a shell to run this.
+ {
+ errno = 0;
+ execl("/bin/sh", "/bin/sh", "-c", cmd, NULL);
+ }
+ else
+ { // We can run this directly.
+ if (!args)
+ {
+ ERR("arg[0] is NULL!");
+ return;
+ }
+ errno = 0;
+ if (args[0]) execvp(args[0], args);
+ }
+}
+
+static Eina_Bool
+_foreach_env(const Eina_Hash *hash EINA_UNUSED, const void *key, void *data, void *fdata EINA_UNUSED)
+{
+ int keylen;
+ char *buf, *s;
+
+ if (!data) return EINA_TRUE;
+ keylen = strlen(key);
+ buf = alloca(keylen + 1 + strlen(data) + 1);
+ strcpy(buf, key);
+ buf[keylen] = '=';
+ strcpy(buf + keylen + 1, data);
+ if ((s = strdup(buf))) putenv(s);
+ return EINA_TRUE;
+}
+
+static void
+_exe_exit_eval(Eo *obj, Efl_Exe_Data *pd)
+{
+ if ((pd->fd.out == -1) && /*(pd->fd.in == -1) &&*/
+ (pd->fd.exited_read == -1) && (!pd->exit_called))
+ {
+ pd->exit_called = EINA_TRUE;
+ if (pd->promise)
+ {
+ Eina_Promise *p = pd->promise;
+ int exit_code = efl_task_exit_code_get(obj);
+ pd->promise = NULL;
+ if ((exit_code != 0) && (!(efl_task_flags_get(obj) &
+ EFL_TASK_FLAGS_NO_EXIT_CODE_ERROR)))
+ {
+ Eina_Error err = exit_code + 1000000;
+ // Code Meaning Example Comments
+ // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ // 1 Catchall for general errors let "var1 = 1/0" Miscellaneous errors, such as "divide by zero" and other impermissible operations
+ // 2 Misuse of shell builtins empty_function() {} Missing keyword or command, or permission problem (and diff return code on a failed binary file comparison).
+ // 126 Command invoked cannot execute /dev/null Permission problem or command is not an executable
+ // 127 "command not found" illegal_command Possible problem with $PATH or a typo
+ // 128 Invalid argument to exit exit 3.14159 exit takes only integer args in the range 0 - 255 (see first footnote)
+ // 128+n Fatal error signal "n" kill -9 $PPID $? returns 137 (128 + 9)
+ // 130 Script terminated by Control-C Ctl-C Control-C is fatal error signal 2, (130 = 128 + 2, see above)
+ // 255* Exit status out of range exit -1 exit takes only integer args in the range 0 - 255
+ //
+ // According to the above table, exit codes 1 - 2,
+ // 126 - 165, and 255 [1] have special meanings, and
+ // should therefore be avoided for user-specified exit
+ // parameters. Ending a script with exit 127 would
+ // certainly cause confusion when troubleshooting (is
+ // the error code a "command not found" or a user-defined
+ // one?). However, many scripts use an exit 1 as a general
+ // bailout-upon-error. Since exit code 1 signifies so many
+ // possible errors, it is not particularly useful in
+ // debugging.
+ if (exit_code == 1 ) err = EBADF;
+ else if (exit_code == 2 ) err = EDOM;
+ else if (exit_code == 126) err = ENOEXEC;
+ else if (exit_code == 127) err = ENOENT;
+ else if (exit_code == 128) err = EINVAL;
+ else if (exit_code == 129) err = EFAULT;
+ else if (exit_code == 130) err = EINTR;
+ else if ((exit_code >= 131) && (exit_code <= 165)) err = EFAULT;
+ eina_promise_reject(p, err);
+ }
+ else eina_promise_resolve(p, eina_value_int_init(exit_code));
+ }
+ }
+}
+
+static void
+_cb_exe_exit_read(void *data, const Efl_Event *event EINA_UNUSED)
+{
+ Eo *obj = data;
+ Efl_Exe_Data *pd = efl_data_scope_get(obj, MY_CLASS);
+ Ecore_Signal_Pid_Info pinfo;
+
+ if (!pd) return;
+ if (read(pd->fd.exited_read, &pinfo, sizeof(Ecore_Signal_Pid_Info)) ==
+ sizeof(Ecore_Signal_Pid_Info))
+ {
+ Efl_Task_Data *td = efl_data_scope_get(obj, EFL_TASK_CLASS);
+ if (td)
+ {
+ td->exited = EINA_TRUE;
+ td->exit_code = pinfo.exit_code;
+ pd->exit_signal = pinfo.exit_signal;
+ }
+ }
+ // we don't need this fd and handler anymore now we code exit status
+ close(pd->fd.exited_read);
+ pd->fd.exited_read = -1;
+ efl_del(pd->exit_handler);
+ pd->exit_handler = NULL;
+ _exe_exit_eval(obj, pd);
+ // XXX: autodel of object here is the sensible easy thing to do in C
+ // because then you can just run exe's and not have to listen to them exit
+ // and do your own del every time - they will then not leak and just
+ // self-cleanup without needing a del of the obj on run. but other
+ // languages don't like this, so if you dont care to listen to end/death
+ // and then del/unref the obj there... always del/unref it immediately.
+}
+
+static void
+_cb_exe_out(void *data, const Efl_Event *event EINA_UNUSED)
+{
+ Eo *obj = data;
+ efl_io_reader_can_read_set(obj, EINA_TRUE);
+}
+
+static void
+_cb_exe_in(void *data, const Efl_Event *event EINA_UNUSED)
+{
+ Eo *obj = data;
+ efl_io_writer_can_write_set(obj, EINA_TRUE);
+}
+
+static void
+_run_cancel_cb(void *data, const Eina_Promise *dead_promise EINA_UNUSED)
+{
+ Eo *obj = data;
+ Efl_Exe_Data *pd = efl_data_scope_get(obj, MY_CLASS);
+ pd->promise = NULL;
+ efl_task_end(obj);
+}
+#endif
+
+//////////////////////////////////////////////////////////////////////////
+
+EOLIAN static void
+_efl_exe_signal(Eo *obj EINA_UNUSED, Efl_Exe_Data *pd, Efl_Exe_Signal sig)
+{
+#ifdef _WIN32
+#else
+ int s = 0;
+ if (pd->pid == -1) return;
+
+ switch (sig)
+ {
+ case EFL_EXE_SIGNAL_INT: s = SIGINT; break;
+ case EFL_EXE_SIGNAL_QUIT: s = SIGQUIT; break;
+ case EFL_EXE_SIGNAL_TERM: s = SIGTERM; break;
+ case EFL_EXE_SIGNAL_KILL: s = SIGKILL; break;
+ case EFL_EXE_SIGNAL_CONT: s = SIGCONT; break;
+ case EFL_EXE_SIGNAL_STOP: s = SIGSTOP; break;
+ case EFL_EXE_SIGNAL_HUP: s = SIGHUP; break;
+ case EFL_EXE_SIGNAL_USR1: s = SIGUSR1; break;
+ case EFL_EXE_SIGNAL_USR2: s = SIGUSR2; break;
+ default: return;
+ }
+ kill(pd->pid, s);
+#endif
+}
+
+EOLIAN static void
+_efl_exe_exe_flags_set(Eo *obj EINA_UNUSED, Efl_Exe_Data *pd, Efl_Exe_Flags flags)
+{
+ pd->flags = flags;
+}
+
+EOLIAN static Efl_Exe_Flags
+_efl_exe_exe_flags_get(const Eo *obj EINA_UNUSED, Efl_Exe_Data *pd)
+{
+ return pd->flags;
+}
+
+EOLIAN static void
+_efl_exe_efl_task_priority_set(Eo *obj EINA_UNUSED, Efl_Exe_Data *pd, Efl_Task_Priority priority)
+{
+ efl_task_priority_set(efl_super(obj, MY_CLASS), priority);
+#ifdef _WIN32
+#else
+ int p = 0;
+
+ if (pd->pid != -1)
+ {
+ if ((priority >= EFL_TASK_PRIORITY_NORMAL) &&
+ (priority <= EFL_TASK_PRIORITY_ULTRA))
+ p = primap[priority];
+ }
+ setpriority(PRIO_PROCESS, pd->pid, p);
+#endif
+}
+
+EOLIAN static Efl_Task_Priority
+_efl_exe_efl_task_priority_get(const Eo *obj EINA_UNUSED, Efl_Exe_Data *pd)
+{
+ Efl_Task_Priority pri = EFL_TASK_PRIORITY_NORMAL;
+
+#ifdef _WIN32
+#else
+ int p, i, dist = 0x7fffffff, d;
+
+ if (pd->pid == -1)
+ return efl_task_priority_get(efl_super(obj, MY_CLASS));
+ // p is -20 -> 19
+ errno = 0;
+ p = getpriority(PRIO_PROCESS, pd->pid);
+ if (errno != 0)
+ return efl_task_priority_get(efl_super(obj, MY_CLASS));
+
+ // find the closest matching priority in primap
+ for (i = EFL_TASK_PRIORITY_NORMAL; i <= EFL_TASK_PRIORITY_ULTRA; i++)
+ {
+ d = primap[i] - p;
+ if (d < 0) d = -d;
+ if (d < dist)
+ {
+ pri = i;
+ dist = d;
+ }
+ }
+
+ Efl_Task_Data *td = efl_data_scope_get(obj, EFL_TASK_CLASS);
+ if (td) td->priority = pri;
+#endif
+ return pri;
+}
+
+EOLIAN static Eina_Future *
+_efl_exe_efl_task_run(Eo *obj EINA_UNUSED, Efl_Exe_Data *pd)
+{
+#ifdef _WIN32
+ return EINA_FALSE;
+#else
+ Eo *loop;
+ Efl_Task_Data *tdl, *td = efl_data_scope_get(obj, EFL_TASK_CLASS);
+ const char *cmd;
+ int devnull;
+ int pipe_stdin[2];
+ int pipe_stdout[2];
+ int pipe_exited[2];
+ int ret;
+
+ if (pd->run) return NULL;
+ if (pd->pid != -1) return NULL;
+ if (!td) return NULL;
+
+ // get a cmdline to run
+ cmd = efl_task_command_get(obj);
+ if (!cmd) return NULL;
+
+ ret = pipe(pipe_exited);
+ if (EINA_UNLIKELY(ret != 0))
+ {
+ const int error = errno;
+ ERR("pipe() failed: %s", strerror(error));
+ return NULL;
+ }
+
+ pd->fd.exited_read = pipe_exited[0];
+ eina_file_close_on_exec(pd->fd.exited_write, EINA_TRUE);
+ pd->fd.exited_write = pipe_exited[1];
+ eina_file_close_on_exec(pd->fd.exited_read, EINA_TRUE);
+
+ if (td->flags & EFL_TASK_FLAGS_USE_STDIN)
+ {
+ ret = pipe(pipe_stdin);
+ if (EINA_UNLIKELY(ret != 0))
+ {
+ const int error = errno;
+ ERR("pipe() failed: %s", strerror(error));
+ return NULL;
+ }
+ pd->fd.in = pipe_stdin[1];
+ fcntl(pd->fd.in, F_SETFL, O_NONBLOCK);
+ eina_file_close_on_exec(pd->fd.in, EINA_TRUE);
+ pd->fd.in_handler =
+ efl_add(EFL_LOOP_HANDLER_CLASS, obj,
+ efl_loop_handler_fd_set(efl_added, pd->fd.in),
+ efl_event_callback_add
+ (efl_added, EFL_LOOP_HANDLER_EVENT_WRITE, _cb_exe_in, obj));
+ }
+ if (td->flags & EFL_TASK_FLAGS_USE_STDOUT)
+ {
+ ret = pipe(pipe_stdout);
+ if (EINA_UNLIKELY(ret != 0))
+ {
+ const int error = errno;
+ ERR("pipe() failed: %s", strerror(error));
+ return NULL;
+ }
+ pd->fd.out = pipe_stdout[0];
+ fcntl(pd->fd.out, F_SETFL, O_NONBLOCK);
+ eina_file_close_on_exec(pd->fd.out, EINA_TRUE);
+ pd->fd.out_handler =
+ efl_add(EFL_LOOP_HANDLER_CLASS, obj,
+ efl_loop_handler_fd_set(efl_added, pd->fd.out),
+ efl_event_callback_add
+ (efl_added, EFL_LOOP_HANDLER_EVENT_READ, _cb_exe_out, obj),
+ efl_loop_handler_active_set
+ (efl_added, EFL_LOOP_HANDLER_FLAGS_READ));
+ }
+
+ _ecore_signal_pid_lock();
+ pd->pid = fork();
+ if (pd->pid != 0)
+ {
+ // parent process is here inside this if block
+ if (td->flags & EFL_TASK_FLAGS_USE_STDIN) close(pipe_stdin[0]);
+ if (td->flags & EFL_TASK_FLAGS_USE_STDOUT) close(pipe_stdout[1]);
+ // fork failed... close up and clean and release locks
+ if (pd->pid == -1)
+ {
+ _close_fds(pd);
+ _ecore_signal_pid_unlock();
+ return NULL;
+ }
+ // register this pid in the core sigchild/pid exit code watcher
+ _ecore_signal_pid_register(pd->pid, pd->fd.exited_write);
+ pd->exit_handler =
+ efl_add(EFL_LOOP_HANDLER_CLASS, obj,
+ efl_loop_handler_fd_set(efl_added, pd->fd.exited_read),
+ efl_event_callback_add(efl_added,
+ EFL_LOOP_HANDLER_EVENT_READ,
+ _cb_exe_exit_read, obj),
+ efl_loop_handler_active_set(efl_added,
+ EFL_LOOP_HANDLER_FLAGS_READ));
+ _ecore_signal_pid_unlock();
+ pd->run = EINA_TRUE;
+ pd->promise = efl_loop_promise_new(obj, _run_cancel_cb, obj);
+ Eina_Future *f = eina_future_new(pd->promise);
+ return efl_future_Eina_FutureXXX_then(obj, f);
+ }
+ // this code is in the child here, and is temporary setup until we
+ // exec() the child to replace everything.
+
+ if (td->flags & EFL_TASK_FLAGS_USE_STDIN) close(pipe_stdin[1]);
+ if (td->flags & EFL_TASK_FLAGS_USE_STDOUT) close(pipe_stdout[0]);
+ // set priority of self
+ if ((td->priority >= EFL_TASK_PRIORITY_NORMAL) &&
+ (td->priority <= EFL_TASK_PRIORITY_ULTRA))
+ setpriority(PRIO_PROCESS, 0, primap[td->priority]);
+
+ // if we want to hide or use any of the stdio, close the fd's
+ if ((td->flags & EFL_TASK_FLAGS_USE_STDIN) ||
+ (pd->flags & EFL_EXE_FLAGS_HIDE_IO))
+ close(STDIN_FILENO);
+ if ((td->flags & EFL_TASK_FLAGS_USE_STDOUT) ||
+ (pd->flags & EFL_EXE_FLAGS_HIDE_IO))
+ close(STDOUT_FILENO);
+ if ((pd->flags & EFL_EXE_FLAGS_HIDE_IO))
+ close(STDERR_FILENO);
+
+ if (!(td->flags & EFL_TASK_FLAGS_USE_STDIN) &&
+ (pd->flags & EFL_EXE_FLAGS_HIDE_IO))
+ {
+ // hide stdin
+ devnull = open("/dev/null", O_RDONLY);
+ dup2(devnull, STDIN_FILENO);
+ close(devnull);
+ }
+ else if ((td->flags & EFL_TASK_FLAGS_USE_STDIN))
+ {
+ // hook up stdin to the pipe going to the parent
+ dup2(pipe_stdin[0], STDIN_FILENO);
+ close(pipe_stdin[0]);
+ }
+
+ if (!(td->flags & EFL_TASK_FLAGS_USE_STDOUT) &&
+ (pd->flags & EFL_EXE_FLAGS_HIDE_IO))
+ {
+ // hide stdout
+ devnull = open("/dev/null", O_WRONLY);
+ dup2(devnull, STDOUT_FILENO);
+ close(devnull);
+ }
+ else if ((td->flags & EFL_TASK_FLAGS_USE_STDOUT))
+ {
+ // hook up stdout to the pipe going to the parent
+ dup2(pipe_stdout[1], STDOUT_FILENO);
+ close(pipe_stdout[1]);
+ }
+
+ if ((pd->flags & EFL_EXE_FLAGS_HIDE_IO))
+ {
+ // hide stderr
+ devnull = open("/dev/null", O_WRONLY);
+ dup2(devnull, STDERR_FILENO);
+ close(devnull);
+ }
+
+ if (!(loop = efl_provider_find(obj, EFL_LOOP_CLASS))) exit(1);
+
+ if (!(tdl = efl_data_scope_get(loop, EFL_TASK_CLASS))) exit(1);
+
+ // clear systemd notify socket... only relevant for systemd world,
+ // otherwise shouldn't be trouble
+ putenv("NOTIFY_SOCKET=");
+ // force the env hash to update from env vars
+ efl_task_env_get(loop, "HOME");
+
+ // actually setenv the env hash (clear what was there before so it is
+ // the only env there)
+#ifdef HAVE_CLEARENV
+ clearenv();
+#else
+ environ = NULL;
+#endif
+ eina_hash_foreach(td->env, _foreach_env, NULL);
+
+ // actually execute!
+ _exec(cmd, pd->flags);
+ // we couldn't exec... uh oh. HAAAAAAAALP!
+ if ((errno == EACCES) || (errno == EINVAL) || (errno == ELOOP) ||
+ (errno == ENOEXEC) || (errno == ENOMEM))
+ exit(126);
+ exit(127);
+ return NULL;
+#endif
+}
+
+EOLIAN static void
+_efl_exe_efl_task_end(Eo *obj EINA_UNUSED, Efl_Exe_Data *pd)
+{
+#ifdef _WIN32
+#else
+ if (pd->pid == -1) return;
+ kill(pd->pid, SIGINT);
+#endif
+}
+
+EOLIAN static int
+_efl_exe_exit_signal_get(const Eo *obj EINA_UNUSED, Efl_Exe_Data *pd)
+{
+ return pd->exit_signal;
+}
+
+EOLIAN static Efl_Object *
+_efl_exe_efl_object_constructor(Eo *obj, Efl_Exe_Data *pd)
+{
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+#ifdef _WIN32
+#else
+ pd->pid = -1;
+ pd->fd.in = -1;
+ pd->fd.out = -1;
+ pd->fd.exited_read = -1;
+#endif
+ pd->fd.can_write = EINA_TRUE;
+ pd->flags = EFL_EXE_FLAGS_EXIT_WITH_PARENT;
+ pd->exit_signal = -1;
+ return obj;
+}
+
+EOLIAN static void
+_efl_exe_efl_object_destructor(Eo *obj, Efl_Exe_Data *pd)
+{
+#ifdef _WIN32
+#else
+ if (pd->promise)
+ ERR("Exe being destroyed while child has not exited yet.");
+ if (pd->fd.exited_read >= 0)
+ {
+ _ecore_signal_pid_lock();
+ _ecore_signal_pid_unregister(pd->pid, pd->fd.exited_read);
+ _ecore_signal_pid_unlock();
+ close(pd->fd.exited_read);
+ pd->fd.exited_read = -1;
+ efl_del(pd->exit_handler);
+ pd->exit_handler = NULL;
+ }
+ if (pd->fd.in_handler) efl_del(pd->fd.in_handler);
+ if (pd->fd.out_handler) efl_del(pd->fd.out_handler);
+ pd->fd.in_handler = NULL;
+ pd->fd.out_handler = NULL;
+ _close_fds(pd);
+#endif
+ efl_destructor(efl_super(obj, MY_CLASS));
+}
+
+EOLIAN static Eina_Error
+_efl_exe_efl_io_closer_close(Eo *obj, Efl_Exe_Data *pd)
+{
+ EINA_SAFETY_ON_TRUE_RETURN_VAL(efl_io_closer_closed_get(obj), EBADF);
+ efl_io_writer_can_write_set(obj, EINA_FALSE);
+ efl_io_reader_can_read_set(obj, EINA_FALSE);
+ efl_io_reader_eos_set(obj, EINA_TRUE);
+#ifdef _WIN32
+#else
+ if (pd->fd.in >= 0) close(pd->fd.in);
+ if (pd->fd.out >= 0) close(pd->fd.out);
+ if (pd->fd.exited_read >= 0) close(pd->fd.exited_read);
+ if (pd->fd.in_handler) efl_del(pd->fd.in_handler);
+ if (pd->fd.out_handler) efl_del(pd->fd.out_handler);
+ pd->fd.in = -1;
+ pd->fd.out = -1;
+ pd->fd.exited_read = -1;
+ pd->fd.in_handler = NULL;
+ pd->fd.out_handler = NULL;
+#endif
+ return 0;
+}
+
+EOLIAN static Eina_Bool
+_efl_exe_efl_io_closer_closed_get(const Eo *obj EINA_UNUSED, Efl_Exe_Data *pd)
+{
+#ifdef _WIN32
+ return EINA_FALSE;
+#else
+ if ((pd->fd.in == -1) && (pd->fd.out == -1)) return EINA_TRUE;
+#endif
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Error
+_efl_exe_efl_io_reader_read(Eo *obj, Efl_Exe_Data *pd, Eina_Rw_Slice *rw_slice)
+{
+#ifdef _WIN32
+ return EINVAL;
+#else
+ ssize_t r;
+
+ errno = 0;
+ if (pd->fd.out == -1) goto err;
+
+ do
+ {
+ errno = 0;
+ r = read(pd->fd.out, rw_slice->mem, rw_slice->len);
+ if (r == -1)
+ {
+ if (errno == EINTR) continue;
+ goto err;
+ }
+ }
+ while (r == -1);
+
+ rw_slice->len = r;
+ if (r == 0)
+ {
+ efl_io_reader_can_read_set(obj, EINA_FALSE);
+ efl_io_reader_eos_set(obj, EINA_TRUE);
+ close(pd->fd.out);
+ pd->fd.out = -1;
+ efl_del(pd->fd.out_handler);
+ pd->fd.out_handler = NULL;
+ _exe_exit_eval(obj, pd);
+ return EPIPE;
+ }
+ return 0;
+err:
+ if ((pd->fd.out != -1) && (errno != EAGAIN))
+ {
+ close(pd->fd.out);
+ pd->fd.out = -1;
+ efl_del(pd->fd.out_handler);
+ pd->fd.out_handler = NULL;
+ }
+ rw_slice->len = 0;
+ rw_slice->mem = NULL;
+ efl_io_reader_can_read_set(obj, EINA_FALSE);
+ _exe_exit_eval(obj, pd);
+ return EINVAL;
+#endif
+}
+
+EOLIAN static void
+_efl_exe_efl_io_reader_can_read_set(Eo *obj, Efl_Exe_Data *pd, Eina_Bool can_read)
+{
+ Eina_Bool old = efl_io_reader_can_read_get(obj);
+ if (old == can_read) return;
+ pd->fd.can_read = can_read;
+ if (!pd->fd.out_handler) return;
+ if (can_read)
+ efl_loop_handler_active_set(pd->fd.out_handler, 0);
+ else
+ efl_loop_handler_active_set(pd->fd.out_handler,
+ EFL_LOOP_HANDLER_FLAGS_READ);
+ efl_event_callback_call(obj, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL);
+}
+
+EOLIAN static Eina_Bool
+_efl_exe_efl_io_reader_can_read_get(const Eo *obj EINA_UNUSED, Efl_Exe_Data *pd)
+{
+ return pd->fd.can_read;
+}
+
+EOLIAN static void
+_efl_exe_efl_io_reader_eos_set(Eo *obj, Efl_Exe_Data *pd, Eina_Bool is_eos)
+{
+ Eina_Bool old = efl_io_reader_eos_get(obj);
+ if (old == is_eos) return;
+
+ pd->fd.eos_read = is_eos;
+ if (!is_eos) return;
+ if (pd->fd.out_handler)
+ efl_loop_handler_active_set(pd->fd.out_handler, 0);
+ efl_event_callback_call(obj, EFL_IO_READER_EVENT_EOS, NULL);
+}
+
+EOLIAN static Eina_Bool
+_efl_exe_efl_io_reader_eos_get(const Eo *obj EINA_UNUSED, Efl_Exe_Data *pd)
+{
+ return pd->fd.eos_read;
+}
+
+EOLIAN static Eina_Error
+_efl_exe_efl_io_writer_write(Eo *obj, Efl_Exe_Data *pd, Eina_Slice *slice, Eina_Slice *remaining)
+{
+#ifdef _WIN32
+ return EINVAL;
+#else
+ ssize_t r;
+
+ errno = 0;
+ if (pd->fd.in == -1) goto err;
+
+ do
+ {
+ errno = 0;
+ r = write(pd->fd.in, slice->mem, slice->len);
+ if (r == -1)
+ {
+ if (errno == EINTR) continue;
+ goto err;
+ }
+ }
+ while (r == -1);
+
+ if (remaining)
+ {
+ remaining->len = slice->len - r;
+ remaining->bytes = slice->bytes + r;
+ }
+ slice->len = r;
+
+ if ((slice) && (slice->len > 0))
+ efl_io_writer_can_write_set(obj, EINA_FALSE);
+ if (r == 0)
+ {
+ close(pd->fd.in);
+ pd->fd.in = -1;
+ efl_del(pd->fd.in_handler);
+ pd->fd.in_handler = NULL;
+ _exe_exit_eval(obj, pd);
+ return EPIPE;
+ }
+ return 0;
+err:
+ if ((pd->fd.in != -1) && (errno != EAGAIN))
+ {
+ close(pd->fd.in);
+ pd->fd.in = -1;
+ efl_del(pd->fd.in_handler);
+ pd->fd.in_handler = NULL;
+ }
+ if (remaining) *remaining = *slice;
+ slice->len = 0;
+ slice->mem = NULL;
+ efl_io_writer_can_write_set(obj, EINA_FALSE);
+ _exe_exit_eval(obj, pd);
+ return EINVAL;
+#endif
+}
+
+EOLIAN static void
+_efl_exe_efl_io_writer_can_write_set(Eo *obj, Efl_Exe_Data *pd, Eina_Bool can_write)
+{
+ Eina_Bool old = efl_io_writer_can_write_get(obj);
+ if (old == can_write) return;
+ pd->fd.can_write = can_write;
+ if (can_write)
+ efl_loop_handler_active_set(pd->fd.in_handler, 0);
+ else
+ efl_loop_handler_active_set(pd->fd.in_handler,
+ EFL_LOOP_HANDLER_FLAGS_WRITE);
+ efl_event_callback_call(obj, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL);
+}
+
+EOLIAN static Eina_Bool
+_efl_exe_efl_io_writer_can_write_get(const Eo *obj EINA_UNUSED, Efl_Exe_Data *pd)
+{
+ return pd->fd.can_write;
+}
+
+//////////////////////////////////////////////////////////////////////////
+
+#include "efl_exe.eo.c"
diff --git a/src/lib/ecore/efl_exe.eo b/src/lib/ecore/efl_exe.eo
new file mode 100644
index 0000000000..c58451c3a5
--- /dev/null
+++ b/src/lib/ecore/efl_exe.eo
@@ -0,0 +1,60 @@
+enum Efl.Exe_Signal {
+ [[ ]]
+ int,
+ quit,
+ term,
+ kill,
+ cont,
+ stop,
+ hup,
+ usr1,
+ usr2
+}
+
+enum Efl.Exe_Flags {
+ [[ ]]
+ none = 0,
+ group_leader = 1,
+ exit_with_parent = 2,
+ hide_io = 4
+}
+
+class Efl.Exe (Efl.Task)
+{
+ [[ ]]
+ methods {
+ signal {
+ params {
+ sig: Efl.Exe_Signal; [[ Send this signal to the task ]]
+ }
+ }
+ @property exe_flags {
+ set { }
+ get { }
+ values {
+ flags: Efl.Exe_Flags; [[ ]]
+ }
+ }
+ @property exit_signal {
+ [[ The final exit signal of this task. ]]
+ get { }
+ values {
+ sig: int; [[ The exit signal, or -1 if no exit signal happened ]]
+ }
+ }
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Object.destructor;
+ Efl.Task.priority { get; set; }
+ Efl.Task.run;
+ Efl.Task.end;
+ Efl.Io.Closer.close;
+ Efl.Io.Closer.closed { get; }
+ Efl.Io.Reader.read;
+ Efl.Io.Reader.can_read { get; set; }
+ Efl.Io.Reader.eos { get; set; }
+ Efl.Io.Writer.write;
+ Efl.Io.Writer.can_write { get; set; }
+ }
+}
diff --git a/src/lib/ecore/efl_general.h b/src/lib/ecore/efl_general.h
index 256f1065a4..222c799c2c 100644
--- a/src/lib/ecore/efl_general.h
+++ b/src/lib/ecore/efl_general.h
@@ -107,9 +107,9 @@
#define EFL_MAIN_EX() \
EFL_CALLBACKS_ARRAY_DEFINE(_efl_main_ex, \
{ EFL_LOOP_EVENT_ARGUMENTS, efl_main }, \
- { EFL_LOOP_EVENT_PAUSE, efl_pause }, \
- { EFL_LOOP_EVENT_RESUME, efl_resume }, \
- { EFL_LOOP_EVENT_TERMINATE, efl_terminate }); \
+ { EFL_APP_EVENT_PAUSE, efl_pause }, \
+ { EFL_APP_EVENT_RESUME, efl_resume }, \
+ { EFL_APP_EVENT_TERMINATE, efl_terminate }); \
int main(int argc, char **argv) \
{ \
Eina_Value *ret__; \
diff --git a/src/lib/ecore/efl_interpolator_accelerate.c b/src/lib/ecore/efl_interpolator_accelerate.c
index fe26a5ab09..386e5993ca 100644
--- a/src/lib/ecore/efl_interpolator_accelerate.c
+++ b/src/lib/ecore/efl_interpolator_accelerate.c
@@ -35,7 +35,7 @@ _efl_interpolator_accelerate_factor_set(Eo *eo_obj EINA_UNUSED,
}
EOLIAN static double
-_efl_interpolator_accelerate_factor_get(Eo *eo_obj EINA_UNUSED,
+_efl_interpolator_accelerate_factor_get(const Eo *eo_obj EINA_UNUSED,
Efl_Interpolator_Accelerate_Data *pd EINA_UNUSED)
{
return pd->factor;
diff --git a/src/lib/ecore/efl_interpolator_accelerate.eo b/src/lib/ecore/efl_interpolator_accelerate.eo
index 9aaf70f7ab..dc087a5b67 100644
--- a/src/lib/ecore/efl_interpolator_accelerate.eo
+++ b/src/lib/ecore/efl_interpolator_accelerate.eo
@@ -1,4 +1,4 @@
-class Efl.Interpolator.Accelerate (Efl.Interpolator)
+class Efl.Interpolator_Accelerate (Efl.Interpolator)
{
[[Efl accelerate interpolator class
diff --git a/src/lib/ecore/efl_interpolator_bounce.c b/src/lib/ecore/efl_interpolator_bounce.c
index ac0cf227ae..e6dd96d187 100644
--- a/src/lib/ecore/efl_interpolator_bounce.c
+++ b/src/lib/ecore/efl_interpolator_bounce.c
@@ -36,7 +36,7 @@ _efl_interpolator_bounce_factors_set(Eo *eo_obj EINA_UNUSED,
}
EOLIAN static void
-_efl_interpolator_bounce_factors_get(Eo *eo_obj EINA_UNUSED,
+_efl_interpolator_bounce_factors_get(const Eo *eo_obj EINA_UNUSED,
Efl_Interpolator_Bounce_Data *pd,
double *factor1, double *factor2)
{
diff --git a/src/lib/ecore/efl_interpolator_bounce.eo b/src/lib/ecore/efl_interpolator_bounce.eo
index 87955a4278..8df3807f35 100644
--- a/src/lib/ecore/efl_interpolator_bounce.eo
+++ b/src/lib/ecore/efl_interpolator_bounce.eo
@@ -1,4 +1,4 @@
-class Efl.Interpolator.Bounce (Efl.Interpolator)
+class Efl.Interpolator_Bounce (Efl.Interpolator)
{
[[Efl bounce interpolator class]]
data: Efl_Interpolator_Bounce_Data;
diff --git a/src/lib/ecore/efl_interpolator_cubic_bezier.c b/src/lib/ecore/efl_interpolator_cubic_bezier.c
index a673c673ab..f78322c16b 100644
--- a/src/lib/ecore/efl_interpolator_cubic_bezier.c
+++ b/src/lib/ecore/efl_interpolator_cubic_bezier.c
@@ -39,7 +39,7 @@ _efl_interpolator_cubic_bezier_factors_set(Eo *eo_obj EINA_UNUSED,
}
EOLIAN static void
-_efl_interpolator_cubic_bezier_factors_get(Eo *eo_obj EINA_UNUSED,
+_efl_interpolator_cubic_bezier_factors_get(const Eo *eo_obj EINA_UNUSED,
Efl_Interpolator_Cubic_Bezier_Data *pd,
double *factor1, double *factor2,
double *factor3, double *factor4)
diff --git a/src/lib/ecore/efl_interpolator_cubic_bezier.eo b/src/lib/ecore/efl_interpolator_cubic_bezier.eo
index 6b59226286..3a10fdce81 100644
--- a/src/lib/ecore/efl_interpolator_cubic_bezier.eo
+++ b/src/lib/ecore/efl_interpolator_cubic_bezier.eo
@@ -1,4 +1,4 @@
-class Efl.Interpolator.Cubic_Bezier (Efl.Interpolator)
+class Efl.Interpolator_Cubic_Bezier (Efl.Interpolator)
{
[[Efl cubic_bezier interpolator class]]
data: Efl_Interpolator_Cubic_Bezier_Data;
diff --git a/src/lib/ecore/efl_interpolator_decelerate.c b/src/lib/ecore/efl_interpolator_decelerate.c
index 888ce65e54..adb6e035eb 100644
--- a/src/lib/ecore/efl_interpolator_decelerate.c
+++ b/src/lib/ecore/efl_interpolator_decelerate.c
@@ -35,7 +35,7 @@ _efl_interpolator_decelerate_factor_set(Eo *eo_obj EINA_UNUSED,
}
EOLIAN static double
-_efl_interpolator_decelerate_factor_get(Eo *eo_obj EINA_UNUSED,
+_efl_interpolator_decelerate_factor_get(const Eo *eo_obj EINA_UNUSED,
Efl_Interpolator_Decelerate_Data *pd EINA_UNUSED)
{
return pd->factor;
diff --git a/src/lib/ecore/efl_interpolator_decelerate.eo b/src/lib/ecore/efl_interpolator_decelerate.eo
index 30d02fd582..99d86c7a00 100644
--- a/src/lib/ecore/efl_interpolator_decelerate.eo
+++ b/src/lib/ecore/efl_interpolator_decelerate.eo
@@ -1,4 +1,4 @@
-class Efl.Interpolator.Decelerate (Efl.Interpolator)
+class Efl.Interpolator_Decelerate (Efl.Interpolator)
{
[[Efl decelerate interpolator class
diff --git a/src/lib/ecore/efl_interpolator_divisor.c b/src/lib/ecore/efl_interpolator_divisor.c
index e30d052038..2fcd00ffbb 100644
--- a/src/lib/ecore/efl_interpolator_divisor.c
+++ b/src/lib/ecore/efl_interpolator_divisor.c
@@ -36,7 +36,7 @@ _efl_interpolator_divisor_factors_set(Eo *eo_obj EINA_UNUSED,
}
EOLIAN static void
-_efl_interpolator_divisor_factors_get(Eo *eo_obj EINA_UNUSED,
+_efl_interpolator_divisor_factors_get(const Eo *eo_obj EINA_UNUSED,
Efl_Interpolator_Divisor_Data *pd,
double *factor1, double *factor2)
{
diff --git a/src/lib/ecore/efl_interpolator_divisor.eo b/src/lib/ecore/efl_interpolator_divisor.eo
index bf5918fe4d..63201d51e3 100644
--- a/src/lib/ecore/efl_interpolator_divisor.eo
+++ b/src/lib/ecore/efl_interpolator_divisor.eo
@@ -1,4 +1,4 @@
-class Efl.Interpolator.Divisor (Efl.Interpolator)
+class Efl.Interpolator_Divisor (Efl.Interpolator)
{
[[Efl divisor interpolator class]]
data: Efl_Interpolator_Divisor_Data;
diff --git a/src/lib/ecore/efl_interpolator_linear.eo b/src/lib/ecore/efl_interpolator_linear.eo
index f3eb81ef81..26e054ef0a 100644
--- a/src/lib/ecore/efl_interpolator_linear.eo
+++ b/src/lib/ecore/efl_interpolator_linear.eo
@@ -1,4 +1,4 @@
-class Efl.Interpolator.Linear (Efl.Interpolator)
+class Efl.Interpolator_Linear (Efl.Interpolator)
{
[[Efl linear interpolator class]]
data: Efl_Interpolator_Linear_Data;
diff --git a/src/lib/ecore/efl_interpolator_sinusoidal.c b/src/lib/ecore/efl_interpolator_sinusoidal.c
index 2de91ed2ad..53625b7e74 100644
--- a/src/lib/ecore/efl_interpolator_sinusoidal.c
+++ b/src/lib/ecore/efl_interpolator_sinusoidal.c
@@ -35,7 +35,7 @@ _efl_interpolator_sinusoidal_factor_set(Eo *eo_obj EINA_UNUSED,
}
EOLIAN static double
-_efl_interpolator_sinusoidal_factor_get(Eo *eo_obj EINA_UNUSED,
+_efl_interpolator_sinusoidal_factor_get(const Eo *eo_obj EINA_UNUSED,
Efl_Interpolator_Sinusoidal_Data *pd EINA_UNUSED)
{
return pd->factor;
diff --git a/src/lib/ecore/efl_interpolator_sinusoidal.eo b/src/lib/ecore/efl_interpolator_sinusoidal.eo
index 351dd0d21d..0a1d923fbb 100644
--- a/src/lib/ecore/efl_interpolator_sinusoidal.eo
+++ b/src/lib/ecore/efl_interpolator_sinusoidal.eo
@@ -1,4 +1,4 @@
-class Efl.Interpolator.Sinusoidal (Efl.Interpolator)
+class Efl.Interpolator_Sinusoidal (Efl.Interpolator)
{
[[Efl sinusoidal interpolator class
diff --git a/src/lib/ecore/efl_interpolator_spring.c b/src/lib/ecore/efl_interpolator_spring.c
index adfc107375..ca2de9a319 100644
--- a/src/lib/ecore/efl_interpolator_spring.c
+++ b/src/lib/ecore/efl_interpolator_spring.c
@@ -36,7 +36,7 @@ _efl_interpolator_spring_factors_set(Eo *eo_obj EINA_UNUSED,
}
EOLIAN static void
-_efl_interpolator_spring_factors_get(Eo *eo_obj EINA_UNUSED,
+_efl_interpolator_spring_factors_get(const Eo *eo_obj EINA_UNUSED,
Efl_Interpolator_Spring_Data *pd,
double *factor1, double *factor2)
{
diff --git a/src/lib/ecore/efl_interpolator_spring.eo b/src/lib/ecore/efl_interpolator_spring.eo
index 71a13787d6..2d1047edd5 100644
--- a/src/lib/ecore/efl_interpolator_spring.eo
+++ b/src/lib/ecore/efl_interpolator_spring.eo
@@ -1,4 +1,4 @@
-class Efl.Interpolator.Spring (Efl.Interpolator)
+class Efl.Interpolator_Spring (Efl.Interpolator)
{
[[Efl spring interpolator class]]
data: Efl_Interpolator_Spring_Data;
diff --git a/src/lib/ecore/efl_io_buffered_stream.c b/src/lib/ecore/efl_io_buffered_stream.c
index 20b76da378..a02b6bbb3e 100644
--- a/src/lib/ecore/efl_io_buffered_stream.c
+++ b/src/lib/ecore/efl_io_buffered_stream.c
@@ -16,6 +16,7 @@ typedef struct
Eo *outgoing;
Eo *sender;
Eo *receiver;
+ Eina_Bool is_closing;
Eina_Bool closed;
Eina_Bool eos;
Eina_Bool can_read;
@@ -149,28 +150,10 @@ _efl_io_buffered_stream_efl_object_finalize(Eo *o, Efl_Io_Buffered_Stream_Data *
}
EOLIAN static void
-_efl_io_buffered_stream_efl_object_destructor(Eo *o, Efl_Io_Buffered_Stream_Data *pd)
+_efl_io_buffered_stream_efl_object_invalidate(Eo *o, Efl_Io_Buffered_Stream_Data *pd)
{
- if (pd->incoming)
- {
- efl_del(pd->incoming);
- pd->incoming = NULL;
- }
- if (pd->outgoing)
- {
- efl_del(pd->outgoing);
- pd->outgoing = NULL;
- }
- if (pd->sender)
- {
- efl_del(pd->sender);
- pd->sender = NULL;
- }
- if (pd->receiver)
- {
- efl_del(pd->receiver);
- pd->receiver = NULL;
- }
+ if (!efl_io_closer_closed_get(o))
+ efl_io_closer_close(o);
if (pd->inner_io)
{
@@ -182,7 +165,18 @@ _efl_io_buffered_stream_efl_object_destructor(Eo *o, Efl_Io_Buffered_Stream_Data
pd->inner_io = NULL;
}
- efl_destructor(efl_super(o, MY_CLASS));
+ pd->incoming = NULL;
+ pd->outgoing = NULL;
+ pd->sender = NULL;
+ pd->receiver = NULL;
+
+ if (!pd->is_finished)
+ {
+ pd->is_finished = EINA_TRUE;
+ efl_event_callback_call(o, EFL_IO_BUFFERED_STREAM_EVENT_FINISHED, NULL);
+ }
+
+ efl_invalidate(efl_super(o, MY_CLASS));
}
EOLIAN static Eina_Error
@@ -191,6 +185,8 @@ _efl_io_buffered_stream_efl_io_closer_close(Eo *o, Efl_Io_Buffered_Stream_Data *
Eina_Error err = 0;
EINA_SAFETY_ON_TRUE_RETURN_VAL(pd->closed, EINVAL);
+ if (pd->is_closing) return 0;
+ pd->is_closing = EINA_TRUE;
if (pd->outgoing)
{
@@ -218,13 +214,13 @@ _efl_io_buffered_stream_efl_io_closer_close(Eo *o, Efl_Io_Buffered_Stream_Data *
}
EOLIAN static Eina_Bool
-_efl_io_buffered_stream_efl_io_closer_closed_get(Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
+_efl_io_buffered_stream_efl_io_closer_closed_get(const Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
{
return pd->closed || efl_io_closer_closed_get(pd->inner_io);
}
EOLIAN static Eina_Bool
-_efl_io_buffered_stream_efl_io_closer_close_on_exec_get(Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
+_efl_io_buffered_stream_efl_io_closer_close_on_exec_get(const Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
{
return efl_io_closer_close_on_exec_get(pd->inner_io);
}
@@ -236,15 +232,15 @@ _efl_io_buffered_stream_efl_io_closer_close_on_exec_set(Eo *o EINA_UNUSED, Efl_I
}
EOLIAN static Eina_Bool
-_efl_io_buffered_stream_efl_io_closer_close_on_destructor_get(Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
+_efl_io_buffered_stream_efl_io_closer_close_on_invalidate_get(const Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
{
- return efl_io_closer_close_on_destructor_get(pd->inner_io);
+ return efl_io_closer_close_on_invalidate_get(pd->inner_io);
}
EOLIAN static void
-_efl_io_buffered_stream_efl_io_closer_close_on_destructor_set(Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd, Eina_Bool value)
+_efl_io_buffered_stream_efl_io_closer_close_on_invalidate_set(Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd, Eina_Bool value)
{
- efl_io_closer_close_on_destructor_set(pd->inner_io, value);
+ efl_io_closer_close_on_invalidate_set(pd->inner_io, value);
}
EOLIAN static Eina_Error
@@ -266,7 +262,7 @@ _efl_io_buffered_stream_efl_io_reader_read(Eo *o, Efl_Io_Buffered_Stream_Data *p
}
EOLIAN static Eina_Bool
-_efl_io_buffered_stream_efl_io_reader_can_read_get(Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
+_efl_io_buffered_stream_efl_io_reader_can_read_get(const Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
{
return pd->can_read;
}
@@ -281,7 +277,7 @@ _efl_io_buffered_stream_efl_io_reader_can_read_set(Eo *o, Efl_Io_Buffered_Stream
}
EOLIAN static Eina_Bool
-_efl_io_buffered_stream_efl_io_reader_eos_get(Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
+_efl_io_buffered_stream_efl_io_reader_eos_get(const Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
{
return pd->eos;
}
@@ -332,7 +328,7 @@ _efl_io_buffered_stream_efl_io_writer_write(Eo *o, Efl_Io_Buffered_Stream_Data *
}
EOLIAN static Eina_Bool
-_efl_io_buffered_stream_efl_io_writer_can_write_get(Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
+_efl_io_buffered_stream_efl_io_writer_can_write_get(const Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
{
return pd->can_write;
}
@@ -378,7 +374,7 @@ _efl_io_buffered_stream_inner_io_set(Eo *o, Efl_Io_Buffered_Stream_Data *pd, Efl
efl_io_copier_buffer_limit_set(efl_added, 4096),
efl_io_copier_source_set(efl_added, io),
efl_io_copier_destination_set(efl_added, pd->incoming),
- efl_io_closer_close_on_destructor_set(efl_added, EINA_FALSE),
+ efl_io_closer_close_on_invalidate_set(efl_added, efl_io_closer_close_on_invalidate_get(io)),
efl_event_callback_array_add(efl_added, _efl_io_buffered_stream_receiver_cbs(), o));
EINA_SAFETY_ON_NULL_RETURN(pd->receiver);
}
@@ -403,7 +399,7 @@ _efl_io_buffered_stream_inner_io_set(Eo *o, Efl_Io_Buffered_Stream_Data *pd, Efl
efl_io_copier_buffer_limit_set(efl_added, 4096),
efl_io_copier_source_set(efl_added, pd->outgoing),
efl_io_copier_destination_set(efl_added, io),
- efl_io_closer_close_on_destructor_set(efl_added, EINA_FALSE),
+ efl_io_closer_close_on_invalidate_set(efl_added, efl_io_closer_close_on_invalidate_get(io)),
efl_event_callback_array_add(efl_added, _efl_io_buffered_stream_sender_cbs(), o));
EINA_SAFETY_ON_NULL_RETURN(pd->sender);
}
@@ -412,7 +408,7 @@ _efl_io_buffered_stream_inner_io_set(Eo *o, Efl_Io_Buffered_Stream_Data *pd, Efl
}
EOLIAN static Efl_Object *
-_efl_io_buffered_stream_inner_io_get(Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
+_efl_io_buffered_stream_inner_io_get(const Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
{
return pd->inner_io;
}
@@ -429,7 +425,7 @@ _efl_io_buffered_stream_max_queue_size_input_set(Eo *o EINA_UNUSED, Efl_Io_Buffe
}
EOLIAN static size_t
-_efl_io_buffered_stream_max_queue_size_input_get(Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
+_efl_io_buffered_stream_max_queue_size_input_get(const Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
{
if (!pd->incoming) return 0;
return efl_io_queue_limit_get(pd->incoming);
@@ -447,7 +443,7 @@ _efl_io_buffered_stream_max_queue_size_output_set(Eo *o EINA_UNUSED, Efl_Io_Buff
}
EOLIAN static size_t
-_efl_io_buffered_stream_max_queue_size_output_get(Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
+_efl_io_buffered_stream_max_queue_size_output_get(const Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
{
if (!pd->outgoing) return 0;
return efl_io_queue_limit_get(pd->outgoing);
@@ -465,7 +461,7 @@ _efl_io_buffered_stream_line_delimiter_set(Eo *o EINA_UNUSED, Efl_Io_Buffered_St
}
EOLIAN static Eina_Slice
-_efl_io_buffered_stream_line_delimiter_get(Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
+_efl_io_buffered_stream_line_delimiter_get(const Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
{
if (!pd->receiver) return (Eina_Slice){};
return efl_io_copier_line_delimiter_get(pd->receiver);
@@ -481,7 +477,7 @@ _efl_io_buffered_stream_timeout_inactivity_set(Eo *o EINA_UNUSED, Efl_Io_Buffere
}
EOLIAN static double
-_efl_io_buffered_stream_timeout_inactivity_get(Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
+_efl_io_buffered_stream_timeout_inactivity_get(const Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
{
if (pd->receiver)
return efl_io_copier_timeout_inactivity_get(pd->receiver);
@@ -507,28 +503,28 @@ _efl_io_buffered_stream_read_chunk_size_set(Eo *o EINA_UNUSED, Efl_Io_Buffered_S
}
EOLIAN static size_t
-_efl_io_buffered_stream_read_chunk_size_get(Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
+_efl_io_buffered_stream_read_chunk_size_get(const Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
{
if (!pd->receiver) return 0;
return efl_io_copier_read_chunk_size_get(pd->receiver);
}
EOLIAN static size_t
-_efl_io_buffered_stream_pending_write_get(Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
+_efl_io_buffered_stream_pending_write_get(const Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
{
if (!pd->outgoing) return 0;
return efl_io_queue_usage_get(pd->outgoing);
}
EOLIAN static size_t
-_efl_io_buffered_stream_pending_read_get(Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
+_efl_io_buffered_stream_pending_read_get(const Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
{
if (!pd->incoming) return 0;
return efl_io_queue_usage_get(pd->incoming);
}
EOLIAN static void
-_efl_io_buffered_stream_progress_get(Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd, size_t *pr, size_t *pw)
+_efl_io_buffered_stream_progress_get(const Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd, size_t *pr, size_t *pw)
{
uint64_t r = 0, w = 0;
@@ -540,7 +536,7 @@ _efl_io_buffered_stream_progress_get(Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_D
}
EOLIAN static Eina_Slice
-_efl_io_buffered_stream_slice_get(Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
+_efl_io_buffered_stream_slice_get(const Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
{
Eina_Slice slice = { };
diff --git a/src/lib/ecore/efl_io_buffered_stream.eo b/src/lib/ecore/efl_io_buffered_stream.eo
index b4f1ed951a..2285b37f2c 100644
--- a/src/lib/ecore/efl_io_buffered_stream.eo
+++ b/src/lib/ecore/efl_io_buffered_stream.eo
@@ -1,4 +1,4 @@
-class Efl.Io.Buffered_Stream (Efl.Loop.Consumer, Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer) {
+class Efl.Io.Buffered_Stream (Efl.Loop_Consumer, Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer) {
[[A wrapper object offering easy to use buffered streams over existing I/O class.
The buffered stream encapsulates an actual @Efl.Io.Reader or
@@ -236,22 +236,22 @@ class Efl.Io.Buffered_Stream (Efl.Loop.Consumer, Efl.Io.Reader, Efl.Io.Writer, E
}
events {
- write,finished; [[@.eos_mark was called and all available data was sent to destination]]
- read,finished; [[Same as @Efl.Io.Reader "eos", for consistency.]]
- finished; [[Both read and write are finished.]]
+ write,finished: void; [[@.eos_mark was called and all available data was sent to destination]]
+ read,finished: void; [[Same as @Efl.Io.Reader "eos", for consistency.]]
+ finished: void; [[Both read and write are finished.]]
error: Eina.Error; [[An error has occurred and I/O has stopped]]
- progress; [[Property @.progress changed]]
- slice,changed; [[The read-slice returned by @.slice may have changed.]]
+ progress: void; [[Property @.progress changed]]
+ slice,changed: void; [[The read-slice returned by @.slice may have changed.]]
line: ptr(const(Eina.Slice)); [[If @.line_delimiter is set, will be emitted with current line. The memory is only valid during event callback dispatched and should not be modified. Note that the line slice may not be inside @.slice.]]
}
implements {
Efl.Object.finalize;
- Efl.Object.destructor;
+ Efl.Object.invalidate;
Efl.Io.Closer.close;
Efl.Io.Closer.closed { get; }
Efl.Io.Closer.close_on_exec { get; set; }
- Efl.Io.Closer.close_on_destructor { get; set; }
+ Efl.Io.Closer.close_on_invalidate { get; set; }
Efl.Io.Reader.read;
Efl.Io.Reader.can_read { get; set; }
Efl.Io.Reader.eos { get; set; }
diff --git a/src/lib/ecore/efl_io_closer_fd.c b/src/lib/ecore/efl_io_closer_fd.c
index 3696d176bb..d0ace13bfe 100644
--- a/src/lib/ecore/efl_io_closer_fd.c
+++ b/src/lib/ecore/efl_io_closer_fd.c
@@ -15,7 +15,7 @@ typedef struct _Efl_Io_Closer_Fd_Data
int fd;
Eina_Bool close_on_exec;
- Eina_Bool close_on_destructor;
+ Eina_Bool close_on_invalidate;
} Efl_Io_Closer_Fd_Data;
static Efl_Object *
@@ -33,7 +33,7 @@ _efl_io_closer_fd_closer_fd_set(Eo *o EINA_UNUSED, Efl_Io_Closer_Fd_Data *pd, in
}
EOLIAN static int
-_efl_io_closer_fd_closer_fd_get(Eo *o EINA_UNUSED, Efl_Io_Closer_Fd_Data *pd)
+_efl_io_closer_fd_closer_fd_get(const Eo *o EINA_UNUSED, Efl_Io_Closer_Fd_Data *pd)
{
return pd->fd;
}
@@ -55,7 +55,7 @@ _efl_io_closer_fd_efl_io_closer_close(Eo *o, Efl_Io_Closer_Fd_Data *pd EINA_UNUS
}
EOLIAN static Eina_Bool
-_efl_io_closer_fd_efl_io_closer_closed_get(Eo *o, Efl_Io_Closer_Fd_Data *pd EINA_UNUSED)
+_efl_io_closer_fd_efl_io_closer_closed_get(const Eo *o, Efl_Io_Closer_Fd_Data *pd EINA_UNUSED)
{
return efl_io_closer_fd_get(o) < 0;
}
@@ -92,7 +92,7 @@ _efl_io_closer_fd_efl_io_closer_close_on_exec_set(Eo *o, Efl_Io_Closer_Fd_Data *
}
EOLIAN static Eina_Bool
-_efl_io_closer_fd_efl_io_closer_close_on_exec_get(Eo *o, Efl_Io_Closer_Fd_Data *pd)
+_efl_io_closer_fd_efl_io_closer_close_on_exec_get(const Eo *o, Efl_Io_Closer_Fd_Data *pd)
{
#ifdef _WIN32
return pd->close_on_exec;
@@ -119,15 +119,15 @@ _efl_io_closer_fd_efl_io_closer_close_on_exec_get(Eo *o, Efl_Io_Closer_Fd_Data *
}
EOLIAN static void
-_efl_io_closer_fd_efl_io_closer_close_on_destructor_set(Eo *o EINA_UNUSED, Efl_Io_Closer_Fd_Data *pd, Eina_Bool close_on_destructor)
+_efl_io_closer_fd_efl_io_closer_close_on_invalidate_set(Eo *o EINA_UNUSED, Efl_Io_Closer_Fd_Data *pd, Eina_Bool close_on_invalidate)
{
- pd->close_on_destructor = close_on_destructor;
+ pd->close_on_invalidate = close_on_invalidate;
}
EOLIAN static Eina_Bool
-_efl_io_closer_fd_efl_io_closer_close_on_destructor_get(Eo *o EINA_UNUSED, Efl_Io_Closer_Fd_Data *pd)
+_efl_io_closer_fd_efl_io_closer_close_on_invalidate_get(const Eo *o EINA_UNUSED, Efl_Io_Closer_Fd_Data *pd)
{
- return pd->close_on_destructor;
+ return pd->close_on_invalidate;
}
#include "efl_io_closer_fd.eo.c"
diff --git a/src/lib/ecore/efl_io_closer_fd.eo b/src/lib/ecore/efl_io_closer_fd.eo
index 9a95c3a777..721e449f1d 100644
--- a/src/lib/ecore/efl_io_closer_fd.eo
+++ b/src/lib/ecore/efl_io_closer_fd.eo
@@ -1,4 +1,4 @@
-mixin Efl.Io.Closer.Fd (Efl.Io.Closer, Efl.Object) {
+mixin Efl.Io.Closer_Fd (Efl.Io.Closer, Efl.Object) {
[[Close fd using close(2).
@since 1.19
@@ -20,6 +20,6 @@ mixin Efl.Io.Closer.Fd (Efl.Io.Closer, Efl.Object) {
Efl.Io.Closer.close;
Efl.Io.Closer.closed { get; }
Efl.Io.Closer.close_on_exec { get; set; }
- Efl.Io.Closer.close_on_destructor { get; set; }
+ Efl.Io.Closer.close_on_invalidate { get; set; }
}
}
diff --git a/src/lib/ecore/efl_io_copier.c b/src/lib/ecore/efl_io_copier.c
index a269edf806..fe729fffc2 100644
--- a/src/lib/ecore/efl_io_copier.c
+++ b/src/lib/ecore/efl_io_copier.c
@@ -28,7 +28,7 @@ typedef struct _Efl_Io_Copier_Data
Eina_Bool done;
Eina_Bool force_dispatch;
Eina_Bool close_on_exec;
- Eina_Bool close_on_destructor;
+ Eina_Bool close_on_invalidate;
} Efl_Io_Copier_Data;
static void _efl_io_copier_write(Eo *o, Efl_Io_Copier_Data *pd);
@@ -133,9 +133,20 @@ _efl_io_copier_job_schedule(Eo *o, Efl_Io_Copier_Data *pd)
{
if (pd->job) return;
- efl_future_Eina_FutureXXX_then(o, efl_loop_job(efl_loop_get(o)),
- .success = _efl_io_copier_job,
- .storage = &pd->job);
+ // When invalidated, no need to delay action
+ if (efl_invalidated_get(o))
+ {
+ Eina_Value v = EINA_VALUE_EMPTY;
+
+ v = _efl_io_copier_job(o, v);
+ eina_value_flush(&v);
+ }
+ else
+ {
+ efl_future_Eina_FutureXXX_then(o, efl_loop_job(efl_loop_get(o)),
+ .success = _efl_io_copier_job,
+ .storage = &pd->job);
+ }
}
/* NOTE: the returned slice may be smaller than requested since the
@@ -389,7 +400,7 @@ EFL_CALLBACKS_ARRAY_DEFINE(source_cbs,
{ EFL_IO_READER_EVENT_EOS, _efl_io_copier_source_eos });
EOLIAN static Efl_Io_Reader *
-_efl_io_copier_source_get(Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd)
+_efl_io_copier_source_get(const Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd)
{
return pd->source;
}
@@ -433,7 +444,7 @@ _efl_io_copier_source_set(Eo *o, Efl_Io_Copier_Data *pd, Efl_Io_Reader *source)
if (efl_isa(pd->source, EFL_IO_CLOSER_MIXIN))
{
efl_io_closer_close_on_exec_set(pd->source, efl_io_closer_close_on_exec_get(o));
- efl_io_closer_close_on_destructor_set(pd->source, efl_io_closer_close_on_destructor_get(o));
+ efl_io_closer_close_on_invalidate_set(pd->source, efl_io_closer_close_on_invalidate_get(o));
efl_event_callback_add(pd->source, EFL_IO_CLOSER_EVENT_CLOSED,
_efl_io_copier_source_closed, o);
}
@@ -481,7 +492,7 @@ EFL_CALLBACKS_ARRAY_DEFINE(destination_cbs,
{ EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, _efl_io_copier_destination_can_write_changed });
EOLIAN static Efl_Io_Writer *
-_efl_io_copier_destination_get(Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd)
+_efl_io_copier_destination_get(const Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd)
{
return pd->destination;
}
@@ -512,7 +523,7 @@ _efl_io_copier_destination_set(Eo *o, Efl_Io_Copier_Data *pd, Efl_Io_Writer *des
if (efl_isa(pd->destination, EFL_IO_CLOSER_MIXIN))
{
efl_io_closer_close_on_exec_set(pd->destination, efl_io_closer_close_on_exec_get(o));
- efl_io_closer_close_on_destructor_set(pd->destination, efl_io_closer_close_on_destructor_get(o));
+ efl_io_closer_close_on_invalidate_set(pd->destination, efl_io_closer_close_on_invalidate_get(o));
efl_event_callback_add(pd->destination, EFL_IO_CLOSER_EVENT_CLOSED,
_efl_io_copier_destination_closed, o);
}
@@ -541,7 +552,7 @@ _efl_io_copier_buffer_limit_set(Eo *o, Efl_Io_Copier_Data *pd, size_t size)
}
EOLIAN static size_t
-_efl_io_copier_buffer_limit_get(Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd)
+_efl_io_copier_buffer_limit_get(const Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd)
{
return pd->buffer_limit;
}
@@ -569,7 +580,7 @@ _efl_io_copier_line_delimiter_set(Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd, Ein
}
EOLIAN static Eina_Slice
-_efl_io_copier_line_delimiter_get(Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd)
+_efl_io_copier_line_delimiter_get(const Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd)
{
return pd->line_delimiter;
}
@@ -585,7 +596,7 @@ _efl_io_copier_read_chunk_size_set(Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd, si
}
EOLIAN static size_t
-_efl_io_copier_read_chunk_size_get(Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd)
+_efl_io_copier_read_chunk_size_get(const Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd)
{
return pd->read_chunk_size > 0 ? pd->read_chunk_size : DEF_READ_CHUNK_SIZE;
}
@@ -680,13 +691,13 @@ _efl_io_copier_efl_io_closer_close(Eo *o, Efl_Io_Copier_Data *pd)
}
EOLIAN static Eina_Bool
-_efl_io_copier_efl_io_closer_closed_get(Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd)
+_efl_io_copier_efl_io_closer_closed_get(const Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd)
{
return pd->closed;
}
EOLIAN static void
-_efl_io_copier_progress_get(Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd, uint64_t *read, uint64_t *written, uint64_t *total)
+_efl_io_copier_progress_get(const Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd, uint64_t *read, uint64_t *written, uint64_t *total)
{
if (read) *read = pd->progress.read;
if (written) *written = pd->progress.written;
@@ -709,7 +720,7 @@ _efl_io_copier_timeout_inactivity_set(Eo *o, Efl_Io_Copier_Data *pd, double seco
}
EOLIAN static double
-_efl_io_copier_timeout_inactivity_get(Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd)
+_efl_io_copier_timeout_inactivity_get(const Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd)
{
return pd->timeout_inactivity;
}
@@ -768,13 +779,13 @@ _efl_io_copier_flush(Eo *o, Efl_Io_Copier_Data *pd, Eina_Bool may_block, Eina_Bo
}
EOLIAN static size_t
-_efl_io_copier_pending_size_get(Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd)
+_efl_io_copier_pending_size_get(const Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd)
{
return pd->buf ? eina_binbuf_length_get(pd->buf) : 0;
}
EOLIAN static Eina_Bool
-_efl_io_copier_done_get(Eo *o, Efl_Io_Copier_Data *pd)
+_efl_io_copier_done_get(const Eo *o, Efl_Io_Copier_Data *pd)
{
DBG("%p done=%d pending=%zd source={%p %s, eos=%d, closed=%d}, destination={%p %s, closed=%d}",
o, pd->done,
@@ -806,7 +817,7 @@ _efl_io_copier_efl_object_constructor(Eo *o, Efl_Io_Copier_Data *pd)
{
pd->buf = eina_binbuf_new();
pd->close_on_exec = EINA_TRUE;
- pd->close_on_destructor = EINA_TRUE;
+ pd->close_on_invalidate = EINA_TRUE;
pd->timeout_inactivity = 0.0;
EINA_SAFETY_ON_NULL_RETURN_VAL(pd->buf, NULL);
@@ -836,17 +847,9 @@ _efl_io_copier_efl_object_finalize(Eo *o, Efl_Io_Copier_Data *pd)
}
EOLIAN static void
-_efl_io_copier_efl_object_destructor(Eo *o, Efl_Io_Copier_Data *pd)
+_efl_io_copier_efl_object_invalidate(Eo *o, Efl_Io_Copier_Data *pd EINA_UNUSED)
{
- _COPIER_DBG(o, pd);
-
- if (pd->job)
- eina_future_cancel(pd->job);
-
- if (pd->inactivity_timer)
- eina_future_cancel(pd->inactivity_timer);
-
- if (efl_io_closer_close_on_destructor_get(o) &&
+ if (efl_io_closer_close_on_invalidate_get(o) &&
(!efl_io_closer_closed_get(o)))
{
efl_event_freeze(o);
@@ -857,6 +860,20 @@ _efl_io_copier_efl_object_destructor(Eo *o, Efl_Io_Copier_Data *pd)
efl_io_copier_source_set(o, NULL);
efl_io_copier_destination_set(o, NULL);
+ efl_invalidate(efl_super(o, MY_CLASS));
+}
+
+EOLIAN static void
+_efl_io_copier_efl_object_destructor(Eo *o, Efl_Io_Copier_Data *pd)
+{
+ _COPIER_DBG(o, pd);
+
+ if (pd->job)
+ eina_future_cancel(pd->job);
+
+ if (pd->inactivity_timer)
+ eina_future_cancel(pd->inactivity_timer);
+
efl_destructor(efl_super(o, MY_CLASS));
if (pd->buf)
@@ -889,28 +906,28 @@ _efl_io_copier_efl_io_closer_close_on_exec_set(Eo *o EINA_UNUSED, Efl_Io_Copier_
}
EOLIAN static Eina_Bool
-_efl_io_copier_efl_io_closer_close_on_exec_get(Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd)
+_efl_io_copier_efl_io_closer_close_on_exec_get(const Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd)
{
return pd->close_on_exec;
}
EOLIAN static void
-_efl_io_copier_efl_io_closer_close_on_destructor_set(Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd, Eina_Bool close_on_destructor)
+_efl_io_copier_efl_io_closer_close_on_invalidate_set(Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd, Eina_Bool close_on_invalidate)
{
- if (pd->close_on_destructor == close_on_destructor) return;
- pd->close_on_destructor = close_on_destructor;
+ if (pd->close_on_invalidate == close_on_invalidate) return;
+ pd->close_on_invalidate = close_on_invalidate;
if (pd->source && efl_isa(pd->source, EFL_IO_CLOSER_MIXIN))
- efl_io_closer_close_on_destructor_set(pd->source, close_on_destructor);
+ efl_io_closer_close_on_invalidate_set(pd->source, close_on_invalidate);
if (pd->destination && efl_isa(pd->destination, EFL_IO_CLOSER_MIXIN))
- efl_io_closer_close_on_destructor_set(pd->destination, close_on_destructor);
+ efl_io_closer_close_on_invalidate_set(pd->destination, close_on_invalidate);
}
EOLIAN static Eina_Bool
-_efl_io_copier_efl_io_closer_close_on_destructor_get(Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd)
+_efl_io_copier_efl_io_closer_close_on_invalidate_get(const Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd)
{
- return pd->close_on_destructor;
+ return pd->close_on_invalidate;
}
#include "efl_io_copier.eo.c"
diff --git a/src/lib/ecore/efl_io_copier.eo b/src/lib/ecore/efl_io_copier.eo
index 0ddafcd67e..37918d05c5 100644
--- a/src/lib/ecore/efl_io_copier.eo
+++ b/src/lib/ecore/efl_io_copier.eo
@@ -1,6 +1,6 @@
import eina_types;
-class Efl.Io.Copier (Efl.Loop.Consumer, Efl.Io.Closer) {
+class Efl.Io.Copier (Efl.Loop_Consumer, Efl.Io.Closer) {
[[Copy from an @Efl.Io.Reader source to @Efl.Io.Writer destination.
During usage it will keep reference to @.source and
@@ -57,7 +57,7 @@ class Efl.Io.Copier (Efl.Loop.Consumer, Efl.Io.Closer) {
@.source and @.destination if they implement those interfaces.
@Efl.Io.Closer.close_on_exec and
- @Efl.Io.Closer.close_on_destructor are respected and applied to
+ @Efl.Io.Closer.close_on_invalidate are respected and applied to
both source and destination. Both default to $true.
@since 1.19
@@ -107,7 +107,7 @@ class Efl.Io.Copier (Efl.Loop.Consumer, Efl.Io.Closer) {
If the source object implements @Efl.Io.Closer and it's
not closed, it will be closed when the copier itself
is. This may happen, for example, when the copier is
- deleted and @Efl.Io.Closer.close_on_destructor is $true
+ deleted and @Efl.Io.Closer.close_on_invalidate is $true
(the default).
Common source classes are @Efl.Io.Buffer (if fixed data
@@ -166,7 +166,7 @@ class Efl.Io.Copier (Efl.Loop.Consumer, Efl.Io.Closer) {
If the destination object implements @Efl.Io.Closer and it's
not closed, it will be closed when the copier itself
is. This may happen, for example, when the copier is
- deleted and @Efl.Io.Closer.close_on_destructor is $true
+ deleted and @Efl.Io.Closer.close_on_invalidate is $true
(the default).
Common destination classes are @Efl.Io.Buffer (better to
@@ -361,20 +361,21 @@ class Efl.Io.Copier (Efl.Loop.Consumer, Efl.Io.Closer) {
}
events {
- done; [[All available data was copied from source to destination]]
+ done: void; [[All available data was copied from source to destination]]
error: Eina.Error; [[An error happened and the copy stopped]]
- progress; [[Total size changed or Data was read/written]]
+ progress: void; [[Total size changed or Data was read/written]]
data: ptr(const(Eina.Slice)); [[When data is read to internal buffer, it's emitted in this event. The memory is only valid during event callback dispatched and should not be modified.]]
line: ptr(const(Eina.Slice)); [[If @.line_delimiter is set, will be emitted with current line. The memory is only valid during event callback dispatched and should not be modified.]]
}
implements {
Efl.Object.constructor;
- Efl.Object.destructor;
Efl.Object.finalize;
+ Efl.Object.invalidate;
+ Efl.Object.destructor;
Efl.Io.Closer.close;
Efl.Io.Closer.closed { get; }
Efl.Io.Closer.close_on_exec { get; set; }
- Efl.Io.Closer.close_on_destructor { get; set; }
+ Efl.Io.Closer.close_on_invalidate { get; set; }
}
}
diff --git a/src/lib/ecore/efl_io_file.c b/src/lib/ecore/efl_io_file.c
index ab0e20fbad..c8716d2935 100644
--- a/src/lib/ecore/efl_io_file.c
+++ b/src/lib/ecore/efl_io_file.c
@@ -86,7 +86,7 @@ _efl_io_file_flags_set(Eo *o, Efl_Io_File_Data *pd, uint32_t flags)
}
EOLIAN static uint32_t
-_efl_io_file_flags_get(Eo *o EINA_UNUSED, Efl_Io_File_Data *pd)
+_efl_io_file_flags_get(const Eo *o EINA_UNUSED, Efl_Io_File_Data *pd)
{
return pd->flags; // TODO: query from fd?
}
@@ -99,7 +99,7 @@ _efl_io_file_mode_set(Eo *o, Efl_Io_File_Data *pd, uint32_t mode)
}
EOLIAN static uint32_t
-_efl_io_file_mode_get(Eo *o EINA_UNUSED, Efl_Io_File_Data *pd)
+_efl_io_file_mode_get(const Eo *o EINA_UNUSED, Efl_Io_File_Data *pd)
{
return pd->mode;
}
@@ -112,7 +112,7 @@ _efl_io_file_efl_object_constructor(Eo *o, Efl_Io_File_Data *pd)
o = efl_constructor(efl_super(o, MY_CLASS));
efl_io_closer_close_on_exec_set(o, EINA_TRUE);
- efl_io_closer_close_on_destructor_set(o, EINA_TRUE);
+ efl_io_closer_close_on_invalidate_set(o, EINA_TRUE);
efl_io_positioner_fd_set(o, -1);
efl_io_sizer_fd_set(o, -1);
efl_io_reader_fd_set(o, -1);
@@ -125,7 +125,7 @@ _efl_io_file_efl_object_constructor(Eo *o, Efl_Io_File_Data *pd)
EOLIAN static void
_efl_io_file_efl_object_destructor(Eo *o, Efl_Io_File_Data *pd)
{
- if (efl_io_closer_close_on_destructor_get(o) &&
+ if (efl_io_closer_close_on_invalidate_get(o) &&
(!efl_io_closer_closed_get(o)))
{
efl_event_freeze(o);
@@ -174,7 +174,7 @@ _efl_io_file_efl_file_file_set(Eo *o, Efl_Io_File_Data *pd, const char *file, co
}
EOLIAN static void
-_efl_io_file_efl_file_file_get(Eo *o EINA_UNUSED, Efl_Io_File_Data *pd, const char **file, const char **key)
+_efl_io_file_efl_file_file_get(const Eo *o EINA_UNUSED, Efl_Io_File_Data *pd, const char **file, const char **key)
{
if (file) *file = pd->path;
if (key) *key = NULL;
diff --git a/src/lib/ecore/efl_io_file.eo b/src/lib/ecore/efl_io_file.eo
index f718e371d6..b586a88ca2 100644
--- a/src/lib/ecore/efl_io_file.eo
+++ b/src/lib/ecore/efl_io_file.eo
@@ -1,8 +1,8 @@
-class Efl.Io.File (Efl.Loop.Fd, Efl.File, Efl.Io.Reader.Fd, Efl.Io.Writer.Fd, Efl.Io.Closer.Fd, Efl.Io.Sizer.Fd, Efl.Io.Positioner.Fd) {
+class Efl.Io.File (Efl.Loop_Fd, Efl.File, Efl.Io.Reader_Fd, Efl.Io.Writer_Fd, Efl.Io.Closer_Fd, Efl.Io.Sizer_Fd, Efl.Io.Positioner_Fd) {
[[File access (open, close, read, write, lseek, ftruncate)
@Efl.Io.Closer.close_on_exec and
- @Efl.Io.Closer.close_on_destructor are respected and default to
+ @Efl.Io.Closer.close_on_invalidate are respected and default to
$true. @Efl.Io.Closer.close_on_exec.set sets flag O_CLOEXEC.
@since 1.19
@@ -50,7 +50,7 @@ class Efl.Io.File (Efl.Loop.Fd, Efl.File, Efl.Io.Reader.Fd, Efl.Io.Writer.Fd, Ef
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Object.finalize;
- Efl.Loop.Fd.fd_file { set; }
+ Efl.Loop_Fd.fd_file { set; }
Efl.File.file { get; set; }
Efl.Io.Reader.read;
Efl.Io.Writer.write;
diff --git a/src/lib/ecore/efl_io_positioner_fd.c b/src/lib/ecore/efl_io_positioner_fd.c
index 310078951c..2be78ba643 100644
--- a/src/lib/ecore/efl_io_positioner_fd.c
+++ b/src/lib/ecore/efl_io_positioner_fd.c
@@ -21,7 +21,7 @@ _efl_io_positioner_fd_positioner_fd_set(Eo *o EINA_UNUSED, Efl_Io_Positioner_Fd_
}
EOLIAN static int
-_efl_io_positioner_fd_positioner_fd_get(Eo *o EINA_UNUSED, Efl_Io_Positioner_Fd_Data *pd)
+_efl_io_positioner_fd_positioner_fd_get(const Eo *o EINA_UNUSED, Efl_Io_Positioner_Fd_Data *pd)
{
return pd->fd;
}
@@ -49,7 +49,7 @@ _efl_io_positioner_fd_efl_io_positioner_seek(Eo *o, Efl_Io_Positioner_Fd_Data *p
}
EOLIAN static uint64_t
-_efl_io_positioner_fd_efl_io_positioner_position_get(Eo *o, Efl_Io_Positioner_Fd_Data *pd EINA_UNUSED)
+_efl_io_positioner_fd_efl_io_positioner_position_get(const Eo *o, Efl_Io_Positioner_Fd_Data *pd EINA_UNUSED)
{
int fd = efl_io_positioner_fd_get(o);
off_t offset;
diff --git a/src/lib/ecore/efl_io_positioner_fd.eo b/src/lib/ecore/efl_io_positioner_fd.eo
index f6da1895ad..83ccc4727f 100644
--- a/src/lib/ecore/efl_io_positioner_fd.eo
+++ b/src/lib/ecore/efl_io_positioner_fd.eo
@@ -1,4 +1,4 @@
-mixin Efl.Io.Positioner.Fd (Efl.Io.Positioner) {
+mixin Efl.Io.Positioner_Fd (Efl.Io.Positioner) {
[[Positions fd using lseek(2).
@since 1.19
diff --git a/src/lib/ecore/efl_io_reader_fd.c b/src/lib/ecore/efl_io_reader_fd.c
index e499009600..670a22f20e 100644
--- a/src/lib/ecore/efl_io_reader_fd.c
+++ b/src/lib/ecore/efl_io_reader_fd.c
@@ -24,7 +24,7 @@ _efl_io_reader_fd_reader_fd_set(Eo *o EINA_UNUSED, Efl_Io_Reader_Fd_Data *pd, in
}
EOLIAN static int
-_efl_io_reader_fd_reader_fd_get(Eo *o EINA_UNUSED, Efl_Io_Reader_Fd_Data *pd)
+_efl_io_reader_fd_reader_fd_get(const Eo *o EINA_UNUSED, Efl_Io_Reader_Fd_Data *pd)
{
return pd->fd;
}
@@ -68,7 +68,7 @@ _efl_io_reader_fd_efl_io_reader_read(Eo *o, Efl_Io_Reader_Fd_Data *pd EINA_UNUSE
}
EOLIAN static Eina_Bool
-_efl_io_reader_fd_efl_io_reader_can_read_get(Eo *o EINA_UNUSED, Efl_Io_Reader_Fd_Data *pd)
+_efl_io_reader_fd_efl_io_reader_can_read_get(const Eo *o EINA_UNUSED, Efl_Io_Reader_Fd_Data *pd)
{
return pd->can_read;
}
@@ -83,7 +83,7 @@ _efl_io_reader_fd_efl_io_reader_can_read_set(Eo *o, Efl_Io_Reader_Fd_Data *pd, E
}
EOLIAN static Eina_Bool
-_efl_io_reader_fd_efl_io_reader_eos_get(Eo *o EINA_UNUSED, Efl_Io_Reader_Fd_Data *pd)
+_efl_io_reader_fd_efl_io_reader_eos_get(const Eo *o EINA_UNUSED, Efl_Io_Reader_Fd_Data *pd)
{
return pd->eos;
}
diff --git a/src/lib/ecore/efl_io_reader_fd.eo b/src/lib/ecore/efl_io_reader_fd.eo
index fe0a74c118..1e4d79f2da 100644
--- a/src/lib/ecore/efl_io_reader_fd.eo
+++ b/src/lib/ecore/efl_io_reader_fd.eo
@@ -1,4 +1,4 @@
-mixin Efl.Io.Reader.Fd (Efl.Io.Reader) {
+mixin Efl.Io.Reader_Fd (Efl.Io.Reader) {
[[Reads fd using read(2).
@since 1.19
diff --git a/src/lib/ecore/efl_io_sizer_fd.c b/src/lib/ecore/efl_io_sizer_fd.c
index 8dc6bb47cf..0dc03f5791 100644
--- a/src/lib/ecore/efl_io_sizer_fd.c
+++ b/src/lib/ecore/efl_io_sizer_fd.c
@@ -21,7 +21,7 @@ _efl_io_sizer_fd_sizer_fd_set(Eo *o EINA_UNUSED, Efl_Io_Sizer_Fd_Data *pd, int f
}
EOLIAN static int
-_efl_io_sizer_fd_sizer_fd_get(Eo *o EINA_UNUSED, Efl_Io_Sizer_Fd_Data *pd)
+_efl_io_sizer_fd_sizer_fd_get(const Eo *o EINA_UNUSED, Efl_Io_Sizer_Fd_Data *pd)
{
return pd->fd;
}
@@ -36,7 +36,7 @@ _efl_io_sizer_fd_efl_io_sizer_resize(Eo *o, Efl_Io_Sizer_Fd_Data *pd EINA_UNUSED
}
EOLIAN static uint64_t
-_efl_io_sizer_fd_efl_io_sizer_size_get(Eo *o, Efl_Io_Sizer_Fd_Data *pd EINA_UNUSED)
+_efl_io_sizer_fd_efl_io_sizer_size_get(const Eo *o, Efl_Io_Sizer_Fd_Data *pd EINA_UNUSED)
{
int fd = efl_io_sizer_fd_get(o);
struct stat st;
diff --git a/src/lib/ecore/efl_io_sizer_fd.eo b/src/lib/ecore/efl_io_sizer_fd.eo
index 243d332a19..09edd062c8 100644
--- a/src/lib/ecore/efl_io_sizer_fd.eo
+++ b/src/lib/ecore/efl_io_sizer_fd.eo
@@ -1,4 +1,4 @@
-mixin Efl.Io.Sizer.Fd (Efl.Io.Sizer) {
+mixin Efl.Io.Sizer_Fd (Efl.Io.Sizer) {
[[Resizes fd usign ftruncate(2).
@since 1.19
diff --git a/src/lib/ecore/efl_io_stderr.eo b/src/lib/ecore/efl_io_stderr.eo
index cef416b26a..8b92505596 100644
--- a/src/lib/ecore/efl_io_stderr.eo
+++ b/src/lib/ecore/efl_io_stderr.eo
@@ -1,4 +1,4 @@
-class Efl.Io.Stderr (Efl.Loop.Fd, Efl.Io.Writer.Fd) {
+class Efl.Io.Stderr (Efl.Loop_Fd, Efl.Io.Writer_Fd) {
[[Application's standard error (stderr).
@since 1.19
@@ -8,7 +8,7 @@ class Efl.Io.Stderr (Efl.Loop.Fd, Efl.Io.Writer.Fd) {
implements {
Efl.Object.finalize;
- Efl.Loop.Fd.fd { set; }
+ Efl.Loop_Fd.fd { set; }
Efl.Io.Writer.write;
Efl.Io.Writer.can_write { set; }
}
diff --git a/src/lib/ecore/efl_io_stdin.eo b/src/lib/ecore/efl_io_stdin.eo
index 3a0788a07c..8389ed2954 100644
--- a/src/lib/ecore/efl_io_stdin.eo
+++ b/src/lib/ecore/efl_io_stdin.eo
@@ -1,4 +1,4 @@
-class Efl.Io.Stdin (Efl.Loop.Fd, Efl.Io.Reader.Fd) {
+class Efl.Io.Stdin (Efl.Loop_Fd, Efl.Io.Reader_Fd) {
[[Application's standard input (stdin).
@since 1.19
@@ -8,7 +8,7 @@ class Efl.Io.Stdin (Efl.Loop.Fd, Efl.Io.Reader.Fd) {
implements {
Efl.Object.finalize;
- Efl.Loop.Fd.fd { set; }
+ Efl.Loop_Fd.fd { set; }
Efl.Io.Reader.read;
Efl.Io.Reader.can_read { set; }
}
diff --git a/src/lib/ecore/efl_io_stdout.eo b/src/lib/ecore/efl_io_stdout.eo
index 9dd98d7a6b..d98528179a 100644
--- a/src/lib/ecore/efl_io_stdout.eo
+++ b/src/lib/ecore/efl_io_stdout.eo
@@ -1,4 +1,4 @@
-class Efl.Io.Stdout (Efl.Loop.Fd, Efl.Io.Writer.Fd) {
+class Efl.Io.Stdout (Efl.Loop_Fd, Efl.Io.Writer_Fd) {
[[Application's standard output (stdout).
@since 1.19
@@ -8,7 +8,7 @@ class Efl.Io.Stdout (Efl.Loop.Fd, Efl.Io.Writer.Fd) {
implements {
Efl.Object.finalize;
- Efl.Loop.Fd.fd { set; }
+ Efl.Loop_Fd.fd { set; }
Efl.Io.Writer.write;
Efl.Io.Writer.can_write { set; }
}
diff --git a/src/lib/ecore/efl_io_writer_fd.c b/src/lib/ecore/efl_io_writer_fd.c
index 6540d6564e..091bb1bb9d 100644
--- a/src/lib/ecore/efl_io_writer_fd.c
+++ b/src/lib/ecore/efl_io_writer_fd.c
@@ -23,7 +23,7 @@ _efl_io_writer_fd_writer_fd_set(Eo *o EINA_UNUSED, Efl_Io_Writer_Fd_Data *pd, in
}
EOLIAN static int
-_efl_io_writer_fd_writer_fd_get(Eo *o EINA_UNUSED, Efl_Io_Writer_Fd_Data *pd)
+_efl_io_writer_fd_writer_fd_get(const Eo *o EINA_UNUSED, Efl_Io_Writer_Fd_Data *pd)
{
return pd->fd;
}
@@ -72,7 +72,7 @@ _efl_io_writer_fd_efl_io_writer_write(Eo *o, Efl_Io_Writer_Fd_Data *pd EINA_UNUS
}
EOLIAN static Eina_Bool
-_efl_io_writer_fd_efl_io_writer_can_write_get(Eo *o EINA_UNUSED, Efl_Io_Writer_Fd_Data *pd)
+_efl_io_writer_fd_efl_io_writer_can_write_get(const Eo *o EINA_UNUSED, Efl_Io_Writer_Fd_Data *pd)
{
return pd->can_write;
}
diff --git a/src/lib/ecore/efl_io_writer_fd.eo b/src/lib/ecore/efl_io_writer_fd.eo
index 2e69d532a5..018f286980 100644
--- a/src/lib/ecore/efl_io_writer_fd.eo
+++ b/src/lib/ecore/efl_io_writer_fd.eo
@@ -1,4 +1,4 @@
-mixin Efl.Io.Writer.Fd (Efl.Io.Writer) {
+mixin Efl.Io.Writer_Fd (Efl.Io.Writer) {
[[Writes fd using write(2).
@since 1.19
diff --git a/src/lib/ecore/efl_loop.c b/src/lib/ecore/efl_loop.c
index 9a09a16c1d..3c2ca6b7a4 100644
--- a/src/lib/ecore/efl_loop.c
+++ b/src/lib/ecore/efl_loop.c
@@ -7,12 +7,16 @@
#include <string.h>
#include <unistd.h>
#include <math.h>
+#include <sys/time.h>
+#include <errno.h>
#include "Ecore.h"
#include "ecore_private.h"
#include "ecore_main_common.h"
+extern char **environ;
+
typedef struct _Efl_Loop_Promise_Simple_Data Efl_Loop_Promise_Simple_Data;
typedef struct _Efl_Internal_Promise Efl_Internal_Promise;
@@ -46,36 +50,18 @@ _efl_loop_message_handler_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Efl_Loo
return mh.handler;
}
-Efl_Version _app_efl_version = { 0, 0, 0, 0, NULL, NULL };
-
Eo *_mainloop_singleton = NULL;
Efl_Loop_Data *_mainloop_singleton_data = NULL;
-EOLIAN static Efl_Loop *
-_efl_loop_main_get(Efl_Class *klass EINA_UNUSED, void *_pd EINA_UNUSED)
-{
- if (_mainloop_singleton) return _mainloop_singleton;
- _mainloop_singleton = efl_add(EFL_LOOP_CLASS, NULL);
- _mainloop_singleton_data = efl_data_scope_get(_mainloop_singleton, EFL_LOOP_CLASS);
- return _mainloop_singleton;
-}
+extern Eina_Lock _environ_lock;
+static Eina_List *_environ_strings_set = NULL;
+
+static void _clean_old_environ(void);
EAPI Eo *
efl_main_loop_get(void)
{
- return efl_loop_main_get(EFL_LOOP_CLASS);
-}
-
-EAPI int
-efl_main_loop_steal(void)
-{
- return ecore_thread_main_loop_begin();
-}
-
-EAPI int
-efl_main_loop_release(void)
-{
- return ecore_thread_main_loop_end();
+ return efl_app_loop_main_get(EFL_APP_CLASS);
}
EOLIAN static void
@@ -112,7 +98,7 @@ _efl_loop_time_set(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd, double t)
}
EOLIAN static double
-_efl_loop_time_get(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd)
+_efl_loop_time_get(const Eo *obj EINA_UNUSED, Efl_Loop_Data *pd)
{
return pd->loop_time;
}
@@ -123,7 +109,7 @@ efl_exit(int exit_code)
Eina_Value v = EINA_VALUE_EMPTY;
eina_value_setup(&v, EINA_VALUE_TYPE_INT);
- eina_value_set(&v, &exit_code);
+ eina_value_set(&v, exit_code);
efl_loop_quit(efl_main_loop_get(), v);
}
@@ -143,9 +129,19 @@ _efl_loop_efl_object_provider_find(const Eo *obj, Efl_Loop_Data *pd, const Efl_O
EAPI int
efl_loop_exit_code_process(Eina_Value *value)
{
- const Eina_Value_Type *t = eina_value_type_get(value);
+ Eina_Value def = EINA_VALUE_EMPTY;
+ const Eina_Value_Type *t;
int r = 0;
+ if (value == NULL ||
+ !value->type)
+ {
+ def = eina_value_int_init(0);
+ value = &def;
+ }
+
+ t = eina_value_type_get(value);
+
if (t == EINA_VALUE_TYPE_UCHAR ||
t == EINA_VALUE_TYPE_USHORT ||
t == EINA_VALUE_TYPE_UINT ||
@@ -162,8 +158,8 @@ efl_loop_exit_code_process(Eina_Value *value)
Eina_Value v = EINA_VALUE_EMPTY;
eina_value_setup(&v, EINA_VALUE_TYPE_INT);
- if (!eina_value_convert(&v, value)) r = -1;
- else eina_value_get(&v, &v);
+ if (!eina_value_convert(value, &v)) r = -1;
+ else eina_value_get(&v, &r);
}
else
{
@@ -193,7 +189,7 @@ _poll_trigger(void *data, const Efl_Event *event)
static void
_check_event_catcher_add(void *data, const Efl_Event *event)
{
- const Efl_Callback_Array_Item *array = event->info;
+ const Efl_Callback_Array_Item_Full *array = event->info;
Efl_Loop_Data *pd = data;
int i;
@@ -262,7 +258,7 @@ _check_event_catcher_add(void *data, const Efl_Event *event)
static void
_check_event_catcher_del(void *data, const Efl_Event *event)
{
- const Efl_Callback_Array_Item *array = event->info;
+ const Efl_Callback_Array_Item_Full *array = event->info;
Efl_Loop_Data *pd = data;
int i;
@@ -325,20 +321,18 @@ _efl_loop_efl_object_constructor(Eo *obj, Efl_Loop_Data *pd)
}
EOLIAN static void
-_efl_loop_efl_object_destructor(Eo *obj, Efl_Loop_Data *pd)
+_efl_loop_efl_object_invalidate(Eo *obj, Efl_Loop_Data *pd)
{
- _ecore_main_content_clear(pd);
+ efl_invalidate(efl_super(obj, EFL_LOOP_CLASS));
- pd->future_message_handler = NULL;
+ _ecore_main_content_clear(obj, pd);
+ // Even if we are just refcounting provider, efl_provider_find won't reach them after invalidate
eina_hash_free(pd->providers);
pd->providers = NULL;
- efl_del(pd->poll_low);
pd->poll_low = NULL;
- efl_del(pd->poll_medium);
pd->poll_medium = NULL;
- efl_del(pd->poll_high);
pd->poll_high = NULL;
if (pd->message_handlers)
@@ -347,8 +341,7 @@ _efl_loop_efl_object_destructor(Eo *obj, Efl_Loop_Data *pd)
pd->message_handlers = NULL;
}
- efl_destructor(efl_super(obj, EFL_LOOP_CLASS));
-
+ // After invalidate, it won't be possible to parent to the singleton anymore
if (obj == _mainloop_singleton)
{
_mainloop_singleton = NULL;
@@ -356,6 +349,22 @@ _efl_loop_efl_object_destructor(Eo *obj, Efl_Loop_Data *pd)
}
}
+EOLIAN static void
+_efl_loop_efl_object_destructor(Eo *obj, Efl_Loop_Data *pd)
+{
+ pd->future_message_handler = NULL;
+
+ eina_lock_take(&_environ_lock);
+ _clean_old_environ();
+ _environ_strings_set = eina_list_free(_environ_strings_set);
+ pd->env.environ_ptr = NULL;
+ free(pd->env.environ_copy);
+ pd->env.environ_copy = NULL;
+ eina_lock_release(&_environ_lock);
+
+ efl_destructor(efl_super(obj, EFL_LOOP_CLASS));
+}
+
static void
_efl_loop_arguments_cleanup(Eina_Array *arga)
{
@@ -397,64 +406,19 @@ ecore_loop_arguments_send(int argc, const char **argv)
Eina_Array *arga;
int i = 0;
+ efl_task_arg_reset(efl_main_loop_get());
arga = eina_array_new(argc);
for (i = 0; i < argc; i++)
- eina_array_push(arga, eina_stringshare_add(argv[i]));
+ {
+ eina_array_push(arga, eina_stringshare_add(argv[i]));
+ efl_task_arg_append(efl_main_loop_get(), argv[i]);
+ }
job = eina_future_then(efl_loop_job(efl_main_loop_get()),
_efl_loop_arguments_send, arga);
efl_future_Eina_FutureXXX_then(efl_main_loop_get(), job);
}
-// Only one main loop handle for now
-void
-ecore_loop_future_register(Efl_Loop *l, Efl_Future *f)
-{
- Efl_Loop_Data *pd;
-
- if (l == ML_OBJ) pd = ML_DAT;
- else pd = efl_data_scope_get(l, EFL_LOOP_CLASS);
- if (!pd) return;
-
- pd->pending_futures = eina_list_append(pd->pending_futures, f);
-}
-
-void
-ecore_loop_future_unregister(Efl_Loop *l, Efl_Future *f)
-{
- Efl_Loop_Data *pd;
-
- if (l == ML_OBJ) pd = ML_DAT;
- else pd = efl_data_scope_get(l, EFL_LOOP_CLASS);
- if (!pd) return;
-
- pd->pending_futures = eina_list_remove(pd->pending_futures, f);
-}
-
-void
-ecore_loop_promise_register(Efl_Loop *l, Efl_Promise *p)
-{
- Efl_Loop_Data *pd;
-
- if (l == ML_OBJ) pd = ML_DAT;
- else pd = efl_data_scope_get(l, EFL_LOOP_CLASS);
- if (!pd) return;
-
- pd->pending_promises = eina_list_append(pd->pending_promises, p);
-}
-
-void
-ecore_loop_promise_unregister(Efl_Loop *l, Efl_Promise *p)
-{
- Efl_Loop_Data *pd;
-
- if (l == ML_OBJ) pd = ML_DAT;
- else pd = efl_data_scope_get(l, EFL_LOOP_CLASS);
- if (!pd) return;
-
- pd->pending_promises = eina_list_remove(pd->pending_promises, p);
-}
-
static Eina_Future *
_efl_loop_job(Eo *obj, Efl_Loop_Data *pd EINA_UNUSED)
{
@@ -471,7 +435,7 @@ _efl_loop_throttle_set(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd, double amount)
}
EOLIAN static double
-_efl_loop_throttle_get(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd)
+_efl_loop_throttle_get(const Eo *obj EINA_UNUSED, Efl_Loop_Data *pd)
{
return (double)(pd->throttle) / 1000000.0;
}
@@ -480,7 +444,10 @@ static void
_efl_loop_idle_cancel(void *data, const Eina_Promise *dead_ptr EINA_UNUSED)
{
Efl_Loop_Promise_Simple_Data *d = data;
+
ecore_idler_del(d->idler);
+ d->idler = NULL;
+ d->promise = NULL;
efl_loop_promise_simple_data_mp_free(d);
}
@@ -489,6 +456,8 @@ _efl_loop_idle_done(void *data)
{
Efl_Loop_Promise_Simple_Data *d = data;
eina_promise_resolve(d->promise, EINA_VALUE_EMPTY);
+ d->idler = NULL;
+ d->promise = NULL;
efl_loop_promise_simple_data_mp_free(d);
return EINA_FALSE;
}
@@ -515,6 +484,8 @@ _efl_loop_idle(Eo *obj, Efl_Loop_Data *pd EINA_UNUSED)
return efl_future_Eina_FutureXXX_then(obj, eina_future_new(p));
idler_error:
+ d->idler = NULL;
+ d->promise = NULL;
efl_loop_promise_simple_data_mp_free(d);
return NULL;
}
@@ -523,12 +494,9 @@ static void
_efl_loop_timeout_cancel(void *data, const Eina_Promise *dead_ptr EINA_UNUSED)
{
Efl_Loop_Promise_Simple_Data *d = data;
+
if (d->timer)
- {
- efl_del(d->timer);
- d->timer = NULL;
- }
- efl_loop_promise_simple_data_mp_free(d);
+ efl_del(d->timer);
}
static void
@@ -538,7 +506,6 @@ _efl_loop_timeout_done(void *data, const Efl_Event *event)
eina_promise_resolve(d->promise, EINA_VALUE_EMPTY);
d->timer = NULL;
- efl_loop_promise_simple_data_mp_free(d);
efl_del(event->object);
}
@@ -546,7 +513,10 @@ static void
_efl_loop_timeout_del(void *data, const Efl_Event *event EINA_UNUSED)
{
Efl_Loop_Promise_Simple_Data *d = data;
+
d->timer = NULL;
+ d->promise = NULL;
+ efl_loop_promise_simple_data_mp_free(d);
}
static Eina_Future *
@@ -579,6 +549,8 @@ _efl_loop_timeout(Eo *obj, Efl_Loop_Data *pd EINA_UNUSED, double tim)
return efl_future_Eina_FutureXXX_then(obj, eina_future_new(p));
timer_error:
+ d->timer = NULL;
+ d->promise = NULL;
efl_loop_promise_simple_data_mp_free(d);
return NULL;
}
@@ -705,25 +677,199 @@ efl_build_version_set(int vmaj, int vmin, int vmic, int revision,
_app_efl_version.build_id = build_id ? strdup(build_id) : NULL;
}
-EOLIAN static const Efl_Version *
-_efl_loop_app_efl_version_get(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd EINA_UNUSED)
+static void
+_env_sync(Efl_Loop_Data *pd, Efl_Task_Data *td)
+{
+ Eina_Bool update = EINA_FALSE;
+ unsigned int count = 0, i;
+ char **p;
+
+ // count environs
+ if (environ)
+ {
+ for (p = environ; *p; p++) count++;
+ }
+ // cached env ptr is the same... so look deeper if things changes
+ if (pd->env.environ_ptr == environ)
+ {
+ // if we have no cached copy then update
+ if (!pd->env.environ_copy) update = EINA_TRUE;
+ else
+ {
+ // if any ptr in the cached copy doesnt match environ ptr
+ // then update
+ for (i = 0; i <= count; i++)
+ {
+ if (pd->env.environ_copy[i] != environ[i])
+ {
+ update = EINA_TRUE;
+ break;
+ }
+ }
+ }
+ }
+ // cached env ptr changed so we need to update anyway
+ else update = EINA_TRUE;
+ if (!update) return;
+ // things changed - do the update
+ pd->env.environ_ptr = environ;
+ free(pd->env.environ_copy);
+ pd->env.environ_copy = NULL;
+ if (count > 0)
+ {
+ pd->env.environ_copy = malloc((count + 1) * sizeof(char *));
+ if (pd->env.environ_copy)
+ {
+ for (i = 0; i <= count; i++)
+ pd->env.environ_copy[i] = environ[i];
+ }
+ }
+ // clear previous env hash and rebuild it from environ so it matches
+ if (td->env) eina_hash_free(td->env);
+ td->env = eina_hash_string_superfast_new
+ ((Eina_Free_Cb)eina_stringshare_del);
+ for (i = 0; i < count; i++)
+ {
+ char *var;
+ const char *value;
+
+ if (!environ[i]) continue;
+ if ((value = strchr(environ[i], '=')))
+ {
+ if (*value)
+ {
+ if ((var = malloc(value - environ[i] + 1)))
+ {
+ strncpy(var, environ[i], value - environ[i]);
+ var[value - environ[i]] = 0;
+ value++;
+ eina_hash_add(td->env, var,
+ eina_stringshare_add(value));
+ free(var);
+ }
+ }
+ }
+ }
+}
+
+static void
+_clean_old_environ(void)
{
- return &_app_efl_version;
+ char **p;
+ const char *str;
+ Eina_List *l, *ll;
+ Eina_Bool ok;
+
+ // clean up old strings no longer in environ
+ EINA_LIST_FOREACH_SAFE(_environ_strings_set, l, ll, str)
+ {
+ ok = EINA_FALSE;
+ for (p = environ; *p; p++)
+ {
+ if (*p == str)
+ {
+ ok = EINA_TRUE;
+ break;
+ }
+ }
+ if (!ok)
+ {
+ _environ_strings_set =
+ eina_list_remove_list(_environ_strings_set, l);
+ eina_stringshare_del(str);
+ }
+ }
}
-EOLIAN static const Efl_Version *
-_efl_loop_efl_version_get(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd EINA_UNUSED)
+EOLIAN static void
+_efl_loop_efl_task_env_set(Eo *obj, Efl_Loop_Data *pd EINA_UNUSED, const char *var, const char *value)
{
- /* vanilla EFL: flavor = NULL */
- static const Efl_Version version = {
- .major = VMAJ,
- .minor = VMIN,
- .micro = VMIC,
- .revision = VREV,
- .build_id = EFL_BUILD_ID,
- .flavor = NULL
- };
- return &version;
+ char *str, *str2;
+ size_t varlen, vallen = 0;
+
+ if (!var) return;
+
+ Efl_Task_Data *td = efl_data_scope_get(obj, EFL_TASK_CLASS);
+ if (!td) return;
+
+ varlen = strlen(var);
+ if (value) vallen = strlen(value);
+
+ str = malloc(varlen + 1 + vallen + 1);
+ if (!str) return;
+ strcpy(str, var);
+ str[varlen] = '=';
+ if (value) strcpy(str + varlen + 1, value);
+ else str[varlen + 1] = 0;
+
+ str2 = (char *)eina_stringshare_add(str);
+ free(str);
+ if (!str2) return;
+
+ eina_lock_take(&_environ_lock);
+ if (putenv(str2) != 0)
+ {
+ eina_stringshare_del(str2);
+ eina_lock_release(&_environ_lock);
+ return;
+ }
+ _environ_strings_set = eina_list_append(_environ_strings_set, str2);
+ eina_lock_release(&_environ_lock);
+
+ efl_task_env_set(efl_super(obj, EFL_LOOP_CLASS), var, value);
+
+ eina_lock_take(&_environ_lock);
+ _clean_old_environ();
+ eina_lock_release(&_environ_lock);
+}
+
+EOLIAN static const char *
+_efl_loop_efl_task_env_get(const Eo *obj, Efl_Loop_Data *pd, const char *var)
+{
+ Efl_Task_Data *td = efl_data_scope_get(obj, EFL_TASK_CLASS);
+ if (!td) return NULL;
+ eina_lock_take(&_environ_lock);
+ _env_sync(pd, td);
+ eina_lock_release(&_environ_lock);
+ return efl_task_env_get(efl_super(obj, EFL_LOOP_CLASS), var);
+}
+
+EOLIAN static void
+_efl_loop_efl_task_env_reset(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd)
+{
+ Efl_Task_Data *td = efl_data_scope_get(obj, EFL_TASK_CLASS);
+ if (!td) return;
+ eina_lock_take(&_environ_lock);
+#ifdef HAVE_CLEARENV
+ clearenv();
+#else
+ environ = NULL;
+#endif
+ _env_sync(pd, td);
+ eina_lock_release(&_environ_lock);
+}
+
+EOLIAN static Eina_Future *
+_efl_loop_efl_task_run(Eo *obj, Efl_Loop_Data *pd EINA_UNUSED)
+{
+ Eina_Value *ret;
+ int real;
+
+ ret = efl_loop_begin(obj);
+ real = efl_loop_exit_code_process(ret);
+ if (real == 0)
+ {
+ // we never return a valid future here because there is no loop
+ // any more to process the future callback as we would have quit
+ return NULL;
+ }
+ return NULL;
+}
+
+EOLIAN static void
+_efl_loop_efl_task_end(Eo *obj, Efl_Loop_Data *pd EINA_UNUSED)
+{
+ efl_loop_quit(obj, eina_value_int_init(0));
}
EAPI Eina_Future_Scheduler *
@@ -768,14 +914,4 @@ efl_loop_promise_new(const Eo *obj, Eina_Promise_Cancel_Cb cancel_cb, const void
cancel_cb, data);
}
-EAPI Eina_Promise *
-efl_loop_main_promise_new(Eina_Promise_Cancel_Cb cancel_cb, const void *data)
-{
- Efl_Loop *main_loop;
-
- main_loop = efl_loop_main_get(EFL_LOOP_CLASS);
- return eina_promise_new(efl_loop_future_scheduler_get(main_loop),
- cancel_cb, data);
-}
-
#include "efl_loop.eo.c"
diff --git a/src/lib/ecore/efl_loop.eo b/src/lib/ecore/efl_loop.eo
index 66ff276f0e..ebab35d821 100644
--- a/src/lib/ecore/efl_loop.eo
+++ b/src/lib/ecore/efl_loop.eo
@@ -1,13 +1,10 @@
-import efl_types;
-import eina_types;
-
-struct Efl.Loop.Arguments {
+struct Efl.Loop_Arguments {
[[EFL loop arguments data structure]]
argv: const(array<const(stringshare)>); [[Array with loop arguments]]
initialization: bool; [[Set to $true when the program should initialize its internal state. This happen once per process instance.]]
}
-class Efl.Loop (Efl.Object)
+class Efl.Loop (Efl.Task)
{
[[The Efl Main Loop
@@ -20,33 +17,6 @@ class Efl.Loop (Efl.Object)
you can provide these if you need to.
]]
methods {
- @property main @class {
- [[Points to the main loop instance of the application.]]
- get {}
- values {
- main_loop: Efl.Loop; [[Application main loop]]
- }
- }
- @property app_efl_version {
- [[Indicates the version of EFL with which this application was compiled.
-
- This might differ from @.efl_version.
- ]]
- get {}
- values {
- @cref version: Efl.Version; [[Efl version]]
- }
- }
- @property efl_version {
- [[Indicates the currently running version of EFL.
-
- This might differ from @.app_efl_version.
- ]]
- get {}
- values {
- @cref version: Efl.Version; [[Efl version]]
- }
- }
iterate {
[[Runs a single iteration of the main loop to process everything on the
queue.]]
@@ -77,7 +47,7 @@ class Efl.Loop (Efl.Object)
This has higher priority, for low priority use
@.idle
]]
- return: ptr(Eina.Future) @owned /* TODO: future<void> */; [[The future handle.]]
+ return: future<void> @owned; [[The future handle.]]
}
@property throttle {
[[Slow down the loop execution by forcing sleep for a small
@@ -102,7 +72,7 @@ class Efl.Loop (Efl.Object)
This is a low priority version of @.job
]]
- return: ptr(Eina.Future) @owned /* TODO: future<void> */; [[The future handle.]]
+ return: future<void> @owned; [[The future handle.]]
}
timeout {
[[A future promise that will be resolved from a clean main
@@ -110,7 +80,7 @@ class Efl.Loop (Efl.Object)
params {
@in time: double; [[The time from now in second that the main loop will wait before triggering it.]]
}
- return: ptr(Eina.Future) @owned /* future<void> */; [[The future handle.]]
+ return: future<void> @owned; [[The future handle.]]
}
register {
[[Will register a manager of a specific class to be answered by eo.provider_find.]]
@@ -137,27 +107,27 @@ class Efl.Loop (Efl.Object)
@in loop: Efl.Loop; [[The loop to get the object from.]]
@in klass: const(Efl.Class); [[The class of the message object.]]
}
- return: Efl.Loop.Message.Handler; [[The message handler to use.]]
+ return: Efl.Loop_Message_Handler; [[The message handler to use.]]
}
}
events {
- idle,enter @restart; [[Event occurs once the main loop enters the idle state.]]
- idle,exit @restart; [[Event occurs once the main loop exits the idle state.]]
- idle @restart; [[Event occurs once the main loop is idle. If you keep listening on this event it may increase the burden on your CPU.]]
- arguments: Efl.Loop.Arguments; [[Event happens when args are provided to the loop by args_add().]]
- poll,high; [[Event occurs multiple times per second. The exact tick is undefined and can be adjusted system wide.]]
- poll,medium; [[Event occurs multiple times per minute. The exact tick is undefined and can be adjusted system wide.]]
- poll,low; [[Event occurs multiple times every 15 minutes. The exact tick is undefined and can be adjusted system wide.]]
- pause; [[Called when the window is not going be displayed for some time]]
- resume; [[Called before a window is rendered after a pause event]]
- terminate; [[Called before starting the shutdown of Elementary]]
- signal,usr1; [[System specific, but on unix maps to SIGUSR1 signal to the process - only called on main loop object]]
- signal,usr2; [[System specific, but on unix maps to SIGUSR2 signal to the process - only called on main loop object]]
- signal,hup; [[System specific, but on unix maps to SIGHUP signal to the process - only called on main loop object]]
+ idle,enter @restart: void; [[Event occurs once the main loop enters the idle state.]]
+ idle,exit @restart: void; [[Event occurs once the main loop exits the idle state.]]
+ idle @restart: void; [[Event occurs once the main loop is idle. If you keep listening on this event it may increase the burden on your CPU.]]
+ arguments: Efl.Loop_Arguments; [[Event happens when args are provided to the loop by args_add().]]
+ poll,high: void; [[Event occurs multiple times per second. The exact tick is undefined and can be adjusted system wide.]]
+ poll,medium: void; [[Event occurs multiple times per minute. The exact tick is undefined and can be adjusted system wide.]]
+ poll,low: void; [[Event occurs multiple times every 15 minutes. The exact tick is undefined and can be adjusted system wide.]]
+ quit: void; [[Event occurs when the loop was requested to quit externally e.g. by a ctrl+c signal or a request from a parent loop/thread to have the child exit.]]
}
implements {
Efl.Object.constructor;
+ Efl.Object.invalidate;
Efl.Object.destructor;
Efl.Object.provider_find;
+ Efl.Task.env { set; get; }
+ Efl.Task.env_reset;
+ Efl.Task.run;
+ Efl.Task.end;
}
}
diff --git a/src/lib/ecore/efl_loop_consumer.c b/src/lib/ecore/efl_loop_consumer.c
index 670e91bbc6..795b5fcfd0 100644
--- a/src/lib/ecore/efl_loop_consumer.c
+++ b/src/lib/ecore/efl_loop_consumer.c
@@ -12,7 +12,7 @@ struct _Efl_Loop_Consumer_Data
};
static Efl_Loop *
-_efl_loop_consumer_loop_get(Eo *obj, Efl_Loop_Consumer_Data *pd EINA_UNUSED)
+_efl_loop_consumer_loop_get(const Eo *obj, Efl_Loop_Consumer_Data *pd EINA_UNUSED)
{
Efl_Loop *loop = efl_provider_find(obj, EFL_LOOP_CLASS);
if (!loop && eina_main_loop_is())
diff --git a/src/lib/ecore/efl_loop_consumer.eo b/src/lib/ecore/efl_loop_consumer.eo
index 52aa619bae..e486567ed5 100644
--- a/src/lib/ecore/efl_loop_consumer.eo
+++ b/src/lib/ecore/efl_loop_consumer.eo
@@ -1,6 +1,6 @@
-class Efl.Loop.Consumer (Efl.Object)
+class Efl.Loop_Consumer (Efl.Object)
{
- [[An Efl.Loop.Consumer is a class which requires one of the parents to provide
+ [[An Efl.Loop_Consumer is a class which requires one of the parents to provide
an Efl.Loop interface when performing provider_find. It will enforce this by
only allowing parents which provide such an interface or NULL.]]
eo_prefix: efl_loop;
diff --git a/src/lib/ecore/efl_loop_fd.c b/src/lib/ecore/efl_loop_fd.c
index 87cb58c41a..ab4e184dac 100644
--- a/src/lib/ecore/efl_loop_fd.c
+++ b/src/lib/ecore/efl_loop_fd.c
@@ -89,7 +89,7 @@ _efl_loop_fd_fd_set(Eo *obj, Efl_Loop_Fd_Data *pd, int fd)
}
static int
-_efl_loop_fd_fd_get(Eo *obj EINA_UNUSED, Efl_Loop_Fd_Data *pd)
+_efl_loop_fd_fd_get(const Eo *obj EINA_UNUSED, Efl_Loop_Fd_Data *pd)
{
return pd->file ? -1 : pd->fd;
}
@@ -103,7 +103,7 @@ _efl_loop_fd_fd_file_set(Eo *obj, Efl_Loop_Fd_Data *pd, int fd)
}
static int
-_efl_loop_fd_fd_file_get(Eo *obj EINA_UNUSED, Efl_Loop_Fd_Data *pd)
+_efl_loop_fd_fd_file_get(const Eo *obj EINA_UNUSED, Efl_Loop_Fd_Data *pd)
{
return pd->file ? pd->fd : -1;
}
@@ -111,7 +111,7 @@ _efl_loop_fd_fd_file_get(Eo *obj EINA_UNUSED, Efl_Loop_Fd_Data *pd)
static void
_check_fd_event_catcher_add(void *data, const Efl_Event *event)
{
- const Efl_Callback_Array_Item *array = event->info;
+ const Efl_Callback_Array_Item_Full *array = event->info;
Efl_Loop_Fd_Data *fd = data;
Eina_Bool need_reset = EINA_FALSE;
int i;
@@ -142,7 +142,7 @@ _check_fd_event_catcher_add(void *data, const Efl_Event *event)
static void
_check_fd_event_catcher_del(void *data, const Efl_Event *event)
{
- const Efl_Callback_Array_Item *array = event->info;
+ const Efl_Callback_Array_Item_Full *array = event->info;
Efl_Loop_Fd_Data *fd = data;
Eina_Bool need_reset = EINA_FALSE;
int i;
@@ -200,11 +200,11 @@ _efl_loop_fd_efl_object_parent_set(Eo *obj, Efl_Loop_Fd_Data *pd, Efl_Object *pa
}
static void
-_efl_loop_fd_efl_object_destructor(Eo *obj, Efl_Loop_Fd_Data *pd)
+_efl_loop_fd_efl_object_invalidate(Eo *obj, Efl_Loop_Fd_Data *pd)
{
- efl_destructor(efl_super(obj, MY_CLASS));
-
ecore_main_fd_handler_del(pd->handler);
+
+ efl_invalidate(efl_super(obj, MY_CLASS));
}
#include "efl_loop_fd.eo.c"
diff --git a/src/lib/ecore/efl_loop_fd.eo b/src/lib/ecore/efl_loop_fd.eo
index b817c9ea94..3a40861e6f 100644
--- a/src/lib/ecore/efl_loop_fd.eo
+++ b/src/lib/ecore/efl_loop_fd.eo
@@ -1,6 +1,4 @@
-import eina_types;
-
-class Efl.Loop.Fd (Efl.Loop.Consumer)
+class Efl.Loop_Fd (Efl.Loop_Consumer)
{
[[Fds are objects that watch the activity on a given
file descriptor. This file descriptor can be a
@@ -12,35 +10,35 @@ class Efl.Loop.Fd (Efl.Loop.Consumer)
methods {
@property fd {
[[Defines which file descriptor to watch. If it is a file, use file_fd variant.]]
- set {
- [[Defines the fd to watch.]]
- }
- get {
- }
- values {
- fd: int; [[The file descriptor.]]
- }
+ set {
+ [[Defines the fd to watch.]]
+ }
+ get {
+ }
+ values {
+ fd: int; [[The file descriptor.]]
+ }
}
@property fd_file {
[[Defines which file descriptor to watch when watching a file.]]
- set {
- [[Defines the fd to watch on.]]
- }
- get {
- }
- values {
- fd: int; [[The file descriptor.]]
- }
+ set {
+ [[Defines the fd to watch on.]]
+ }
+ get {
+ }
+ values {
+ fd: int; [[The file descriptor.]]
+ }
}
}
events {
- read; [[Called when a read happened on the file descriptor]]
- write; [[Called when a write happened on the file descriptor]]
- error; [[Called when a error occurred on the file descriptor]]
+ read: void; [[Called when a read happened on the file descriptor]]
+ write: void; [[Called when a write happened on the file descriptor]]
+ error: void; [[Called when a error occurred on the file descriptor]]
}
implements {
Efl.Object.constructor;
- Efl.Object.destructor;
+ Efl.Object.invalidate;
Efl.Object.parent { set; }
}
}
diff --git a/src/lib/ecore/efl_loop_handler.c b/src/lib/ecore/efl_loop_handler.c
index 7615652b61..3bed51396e 100644
--- a/src/lib/ecore/efl_loop_handler.c
+++ b/src/lib/ecore/efl_loop_handler.c
@@ -67,9 +67,12 @@ _handler_clear(Efl_Loop_Handler_Data *pd)
static Ecore_Fd_Handler_Flags
_handler_flags_get(Efl_Loop_Handler_Data *pd)
{
- return ((pd->references.read > 0) ? ECORE_FD_READ : 0) |
- ((pd->references.write > 0) ? ECORE_FD_WRITE : 0) |
- ((pd->references.error > 0) ? ECORE_FD_ERROR : 0);
+ return (((pd->flags & EFL_LOOP_HANDLER_FLAGS_READ) &&
+ (pd->references.read > 0)) ? ECORE_FD_READ : 0) |
+ (((pd->flags & EFL_LOOP_HANDLER_FLAGS_WRITE) &&
+ (pd->references.write > 0)) ? ECORE_FD_WRITE : 0) |
+ (((pd->flags & EFL_LOOP_HANDLER_FLAGS_ERROR) &&
+ (pd->references.error > 0)) ? ECORE_FD_ERROR : 0);
}
static void
@@ -129,7 +132,7 @@ _handler_reset(Eo *obj, Efl_Loop_Handler_Data *pd)
static Eina_Bool
_event_references_update(Efl_Loop_Handler_Data *pd, const Efl_Event *event, int increment)
{
- const Efl_Callback_Array_Item *array = event->info;
+ const Efl_Callback_Array_Item_Full *array = event->info;
int i;
Eina_Bool need_reset = EINA_FALSE;
@@ -157,12 +160,14 @@ _cb_handler_fd(void *data, Ecore_Fd_Handler *fd_handler EINA_UNUSED)
{
Eo *obj = data;
+ efl_ref(obj);
if (ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_READ))
efl_event_callback_call(obj, EFL_LOOP_HANDLER_EVENT_READ, NULL);
if (ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_WRITE))
efl_event_callback_call(obj, EFL_LOOP_HANDLER_EVENT_WRITE, NULL);
if (ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_ERROR))
efl_event_callback_call(obj, EFL_LOOP_HANDLER_EVENT_ERROR, NULL);
+ efl_unref(obj);
return ECORE_CALLBACK_RENEW;
}
@@ -222,7 +227,7 @@ _efl_loop_handler_active_set(Eo *obj, Efl_Loop_Handler_Data *pd, Efl_Loop_Handle
}
static Efl_Loop_Handler_Flags
-_efl_loop_handler_active_get(Eo *obj EINA_UNUSED, Efl_Loop_Handler_Data *pd)
+_efl_loop_handler_active_get(const Eo *obj EINA_UNUSED, Efl_Loop_Handler_Data *pd)
{
return pd->flags;
}
@@ -237,7 +242,7 @@ _efl_loop_handler_fd_set(Eo *obj, Efl_Loop_Handler_Data *pd, int fd)
}
static int
-_efl_loop_handler_fd_get(Eo *obj EINA_UNUSED, Efl_Loop_Handler_Data *pd)
+_efl_loop_handler_fd_get(const Eo *obj EINA_UNUSED, Efl_Loop_Handler_Data *pd)
{
if (pd->win32) return -1;
return pd->file ? -1 : pd->fd;
@@ -253,7 +258,7 @@ _efl_loop_handler_fd_file_set(Eo *obj, Efl_Loop_Handler_Data *pd, int fd)
}
static int
-_efl_loop_handler_fd_file_get(Eo *obj EINA_UNUSED, Efl_Loop_Handler_Data *pd)
+_efl_loop_handler_fd_file_get(const Eo *obj EINA_UNUSED, Efl_Loop_Handler_Data *pd)
{
if (pd->win32) return -1;
return pd->file ? pd->fd : -1;
@@ -269,7 +274,7 @@ _efl_loop_handler_win32_set(Eo *obj, Efl_Loop_Handler_Data *pd, void *handle)
}
static void *
-_efl_loop_handler_win32_get(Eo *obj EINA_UNUSED, Efl_Loop_Handler_Data *pd)
+_efl_loop_handler_win32_get(const Eo *obj EINA_UNUSED, Efl_Loop_Handler_Data *pd)
{
return pd->win32;
}
@@ -326,12 +331,11 @@ _efl_loop_handler_efl_object_finalize(Eo *obj, Efl_Loop_Handler_Data *pd)
static void
_efl_loop_handler_efl_object_destructor(Eo *obj, Efl_Loop_Handler_Data *pd)
{
- efl_destructor(efl_super(obj, MY_CLASS));
-
if (pd->loop_data)
pd->loop_data->fd_handlers_obj =
eina_list_remove(pd->loop_data->fd_handlers_obj, obj);
_handler_clear(pd);
+ efl_destructor(efl_super(obj, MY_CLASS));
}
#include "efl_loop_handler.eo.c"
diff --git a/src/lib/ecore/efl_loop_handler.eo b/src/lib/ecore/efl_loop_handler.eo
index 597f939b61..e33610680f 100644
--- a/src/lib/ecore/efl_loop_handler.eo
+++ b/src/lib/ecore/efl_loop_handler.eo
@@ -1,5 +1,3 @@
-import eina_types;
-
enum Efl.Loop.Handler.Flags {
[[ A set of flags that can be OR'd together to indicate which are
desired ]]
@@ -9,7 +7,7 @@ enum Efl.Loop.Handler.Flags {
error = 4, [[ Error channel input is desired ]]
}
-class Efl.Loop.Handler (Efl.Object)
+class Efl.Loop_Handler (Efl.Object)
{
[[ An object that describes an low-level source of I/O to listen to
for available data to be read or written, depending on the OS and data
@@ -56,11 +54,11 @@ class Efl.Loop.Handler (Efl.Object)
}
}
events {
- read; [[ Called when a read occurs on the descriptor. ]]
- write; [[ Called when a write occurs on the descriptor. ]]
- error; [[ Called when a error occurrs on the descriptor. ]]
- buffer; [[ Called when buffered data already read from the descriptor should be processed. ]]
- prepare; [[ Called when preparing a descriptor for listening. ]]
+ read: void; [[ Called when a read occurs on the descriptor. ]]
+ write: void; [[ Called when a write occurs on the descriptor. ]]
+ error: void; [[ Called when a error occurrs on the descriptor. ]]
+ buffer: void; [[ Called when buffered data already read from the descriptor should be processed. ]]
+ prepare: void; [[ Called when preparing a descriptor for listening. ]]
}
implements {
diff --git a/src/lib/ecore/efl_loop_message.eo b/src/lib/ecore/efl_loop_message.eo
index db873cc46d..2aec142abc 100644
--- a/src/lib/ecore/efl_loop_message.eo
+++ b/src/lib/ecore/efl_loop_message.eo
@@ -1,14 +1,11 @@
-import efl_types;
-import eina_types;
-
-class Efl.Loop.Message (Efl.Object)
+class Efl.Loop_Message (Efl.Object)
{
[[Base message payload object class. Inherit this and extend for
specific message types.]]
methods {
}
events {
- message: Efl.Loop.Message; [[The message payload data]]
+ message: Efl.Loop_Message; [[The message payload data]]
}
implements {
Efl.Object.constructor;
diff --git a/src/lib/ecore/efl_loop_message_future.c b/src/lib/ecore/efl_loop_message_future.c
index 6ce4f3455a..81325e18f1 100644
--- a/src/lib/ecore/efl_loop_message_future.c
+++ b/src/lib/ecore/efl_loop_message_future.c
@@ -26,7 +26,7 @@ _efl_loop_message_future_data_set(Eo *obj EINA_UNUSED, Efl_Loop_Message_Future_D
}
EOLIAN static void *
-_efl_loop_message_future_data_get(Eo *obj EINA_UNUSED, Efl_Loop_Message_Future_Data *pd)
+_efl_loop_message_future_data_get(const Eo *obj EINA_UNUSED, Efl_Loop_Message_Future_Data *pd)
{
return pd->data;
}
diff --git a/src/lib/ecore/efl_loop_message_future.eo b/src/lib/ecore/efl_loop_message_future.eo
index 8cdc928ab2..5a86333f29 100644
--- a/src/lib/ecore/efl_loop_message_future.eo
+++ b/src/lib/ecore/efl_loop_message_future.eo
@@ -1,7 +1,4 @@
-import efl_types;
-import eina_types;
-
-class Efl.Loop.Message.Future (Efl.Loop.Message)
+class Efl.Loop_Message_Future (Efl.Loop_Message)
{
[[ Used internally for futures on the loop ]]
methods {
diff --git a/src/lib/ecore/efl_loop_message_future_handler.eo b/src/lib/ecore/efl_loop_message_future_handler.eo
index e53c054665..0b30847c3a 100644
--- a/src/lib/ecore/efl_loop_message_future_handler.eo
+++ b/src/lib/ecore/efl_loop_message_future_handler.eo
@@ -1,21 +1,18 @@
-import efl_types;
-import eina_types;
-
-class Efl.Loop.Message.Future.Handler (Efl.Loop.Message.Handler)
+class Efl.Loop_Message_Future_Handler (Efl.Loop_Message_Handler)
{
[[ Internal use for future on an efl loop - replacing legacy ecore events ]]
methods {
message_type_add {
[[ ]]
- return: Efl.Loop.Message.Future; [[ ]]
+ return: Efl.Loop_Message_Future; [[ ]]
}
}
events {
- message,future: Efl.Loop.Message.Future; [[ ]]
+ message,future: Efl.Loop_Message_Future; [[ ]]
}
implements {
Efl.Object.constructor;
Efl.Object.destructor;
- Efl.Loop.Message.Handler.message_call; [[ ]]
+ Efl.Loop_Message_Handler.message_call; [[ ]]
}
}
diff --git a/src/lib/ecore/efl_loop_message_handler.eo b/src/lib/ecore/efl_loop_message_handler.eo
index f0be9c4484..bf77810713 100644
--- a/src/lib/ecore/efl_loop_message_handler.eo
+++ b/src/lib/ecore/efl_loop_message_handler.eo
@@ -1,7 +1,4 @@
-import efl_types;
-import eina_types;
-
-class Efl.Loop.Message.Handler (Efl.Object)
+class Efl.Loop_Message_Handler (Efl.Object)
{
[[Message handlers represent a single message type on the Efl.Loop
parent object. These message handlers can be used to listen for
@@ -12,20 +9,20 @@ class Efl.Loop.Message.Handler (Efl.Object)
message_add {
[[Creates a new message object of the correct type for this
message type.]]
- return: Efl.Loop.Message; [[The new message payload object.]]
+ return: Efl.Loop_Message; [[The new message payload object.]]
}
message_send {
[[Place the message on the queue to be called later when
message_process() is called on the loop object.]]
params {
- @in message: Efl.Loop.Message; [[The message to place on the queue.]]
+ @in message: Efl.Loop_Message; [[The message to place on the queue.]]
}
}
message_call {
[[Overide me (implement) then call super after calling the
right callback type if you specialize the message type.]]
params {
- @in message: Efl.Loop.Message; [[ Generic message event type ]]
+ @in message: Efl.Loop_Message; [[ Generic message event type ]]
}
}
message_clear {
@@ -36,7 +33,7 @@ class Efl.Loop.Message.Handler (Efl.Object)
}
}
events {
- message: Efl.Loop.Message; [[The message payload data]]
+ message: Efl.Loop_Message; [[The message payload data]]
}
implements {
Efl.Object.constructor;
diff --git a/src/lib/ecore/efl_loop_timer.eo b/src/lib/ecore/efl_loop_timer.eo
index 7bf2820d2f..2b5ce084f6 100644
--- a/src/lib/ecore/efl_loop_timer.eo
+++ b/src/lib/ecore/efl_loop_timer.eo
@@ -1,4 +1,4 @@
-class Efl.Loop.Timer (Efl.Loop.Consumer)
+class Efl.Loop_Timer (Efl.Loop_Consumer)
{
[[Timers are objects that will call a given callback at some point
in the future and repeat that tick at a given interval.
@@ -42,7 +42,7 @@ class Efl.Loop.Timer (Efl.Loop.Consumer)
loop_reset {
[[This effectively resets a timer but based on the time when this iteration of the main loop started.
@since 1.18
- ]]
+ ]]
}
delay {
[[Adds a delay to the next occurrence of a timer.
@@ -54,7 +54,7 @@ class Efl.Loop.Timer (Efl.Loop.Consumer)
}
}
events {
- tick; [[Event triggered when the specified time as passed.]]
+ tick: void; [[Event triggered when the specified time as passed.]]
}
implements {
Efl.Object.constructor;
diff --git a/src/lib/ecore/efl_model_accessor_view.c b/src/lib/ecore/efl_model_accessor_view.c
index 2afe1dc8f3..a73e9459a5 100644
--- a/src/lib/ecore/efl_model_accessor_view.c
+++ b/src/lib/ecore/efl_model_accessor_view.c
@@ -68,7 +68,7 @@ _efl_model_acessor_free(Efl_Model_Accessor *acc)
EINA_ARRAY_ITER_NEXT(acc->children, i, item, iterator)
{
- efl_del(item);
+ efl_unref(item);
}
eina_array_free(acc->children);
acc->children = NULL;
diff --git a/src/lib/ecore/efl_model_composite.c b/src/lib/ecore/efl_model_composite.c
new file mode 100644
index 0000000000..90cd8adc84
--- /dev/null
+++ b/src/lib/ecore/efl_model_composite.c
@@ -0,0 +1,108 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <Eina.h>
+#include <Efl.h>
+#include <Ecore.h>
+
+#include "ecore_private.h"
+
+#include "efl_model_composite.eo.h"
+
+typedef struct _Efl_Model_Composite_Data Efl_Model_Composite_Data;
+
+struct _Efl_Model_Composite_Data
+{
+ Efl_Model *source;
+};
+
+static void
+_efl_model_composite_efl_object_destructor(Eo *obj, Efl_Model_Composite_Data *pd)
+{
+ efl_unref(pd->source);
+ pd->source = NULL;
+
+ efl_destructor(efl_super(obj, EFL_MODEL_COMPOSITE_CLASS));
+}
+
+static Efl_Object *
+_efl_model_composite_efl_object_finalize(Eo *obj, Efl_Model_Composite_Data *pd)
+{
+ if (pd->source == NULL)
+ {
+ ERR("Source of the composite model wasn't defined at construction time.");
+ return NULL;
+ }
+
+ return obj;
+}
+
+static void
+_efl_model_composite_efl_ui_view_model_set(Eo *obj EINA_UNUSED, Efl_Model_Composite_Data *pd, Efl_Model *model)
+{
+ if (pd->source != NULL)
+ {
+ ERR("Source already set for composite model. It can only be set once.");
+ return ;
+ }
+ pd->source = efl_ref(model);
+}
+
+static Efl_Model *
+_efl_model_composite_efl_ui_view_model_get(const Eo *obj EINA_UNUSED, Efl_Model_Composite_Data *pd)
+{
+ return pd->source;
+}
+
+static Eina_Future *
+_efl_model_composite_efl_model_property_set(Eo *obj EINA_UNUSED, Efl_Model_Composite_Data *pd,
+ const char *property, Eina_Value *value)
+{
+ return efl_model_property_set(pd->source, property, value);
+}
+
+static Eina_Value *
+_efl_model_composite_efl_model_property_get(const Eo *obj EINA_UNUSED, Efl_Model_Composite_Data *pd,
+ const char *property)
+{
+ return efl_model_property_get(pd->source, property);
+}
+
+static Eina_Array *
+_efl_model_composite_efl_model_properties_get(const Eo *obj EINA_UNUSED, Efl_Model_Composite_Data *pd)
+{
+ return efl_model_properties_get(pd->source);
+}
+
+static unsigned int
+_efl_model_composite_efl_model_children_count_get(const Eo *obj EINA_UNUSED, Efl_Model_Composite_Data *pd)
+{
+ return efl_model_children_count_get(pd->source);
+}
+
+static Eina_Future *
+_efl_model_composite_efl_model_children_slice_get(Eo *obj EINA_UNUSED,
+ Efl_Model_Composite_Data *pd,
+ unsigned int start,
+ unsigned int count)
+{
+ return efl_model_children_slice_get(pd->source, start, count);
+}
+
+static Efl_Object *
+_efl_model_composite_efl_model_child_add(Eo *obj EINA_UNUSED,
+ Efl_Model_Composite_Data *pd)
+{
+ return efl_model_child_add(pd->source);
+}
+
+static void
+_efl_model_composite_efl_model_child_del(Eo *obj EINA_UNUSED,
+ Efl_Model_Composite_Data *pd,
+ Efl_Object *child)
+{
+ efl_model_child_del(pd->source, child);
+}
+
+#include "efl_model_composite.eo.c"
diff --git a/src/lib/ecore/efl_model_composite.eo b/src/lib/ecore/efl_model_composite.eo
new file mode 100644
index 0000000000..4c7088e4c0
--- /dev/null
+++ b/src/lib/ecore/efl_model_composite.eo
@@ -0,0 +1,15 @@
+class Efl.Model_Composite (Efl.Loop_Consumer, Efl.Model, Efl.Ui.View)
+{
+ [[Efl model for all composite class which provide a unified API to set source of data]]
+ implements {
+ Efl.Object.destructor;
+ Efl.Object.finalize;
+ Efl.Ui.View.model { set; get; }
+ Efl.Model.property { set; get; }
+ Efl.Model.properties { get; }
+ Efl.Model.children_count { get; }
+ Efl.Model.children_slice_get;
+ Efl.Model.child_add;
+ Efl.Model.child_del;
+ }
+}
diff --git a/src/lib/ecore/efl_model_composite_boolean.c b/src/lib/ecore/efl_model_composite_boolean.c
index d8c8e38376..5fd6924668 100644
--- a/src/lib/ecore/efl_model_composite_boolean.c
+++ b/src/lib/ecore/efl_model_composite_boolean.c
@@ -2,667 +2,303 @@
# include <config.h>
#endif
-#include "Eina.h"
-#include "Efl.h"
-#include <Ecore.h>
+#include <Efl_Core.h>
#include "efl_model_composite_boolean_children.eo.h"
-typedef struct _Efl_Model_Hash_Value
-{
- unsigned char *buffer;
- unsigned int bits_count;
- Eina_Bool default_value : 1;
-} Efl_Model_Hash_Value;
-
-typedef struct _Efl_Model_Composite_Boolean_Data
-{
- Efl_Model *composite_model;
- Eina_Array *empty_properties;
- Eina_Hash *values; // [property_name, Efl_Model_Hash_Value*]
-} Efl_Model_Composite_Boolean_Data;
+typedef struct _Efl_Model_Composite_Boolean_Data Efl_Model_Composite_Boolean_Data;
+typedef struct _Efl_Model_Composite_Boolean_Children_Data Efl_Model_Composite_Boolean_Children_Data;
+typedef struct _Efl_Model_Composite_Boolean_Value Efl_Model_Composite_Boolean_Value;
-typedef struct _Efl_Model_Composite_Boolean_Children_Data
+struct _Efl_Model_Composite_Boolean_Data
{
- Efl_Model_Composite_Boolean_Data *parent_pd;
- Efl_Model *composite_child;
- Eina_Array *properties_names;
- unsigned int index;
-} Efl_Model_Composite_Boolean_Children_Data;
+ Eina_Hash *values;
+};
-typedef struct _Efl_Model_Accessor_Slice
+struct _Efl_Model_Composite_Boolean_Value
{
- Eina_Accessor vtable;
- Eina_Accessor *real_accessor;
- Efl_Model *parent;
- Efl_Model_Composite_Boolean_Data *parent_pd;
- Efl_Promise *promise;
- unsigned int index;
- Eina_Array *bool_children_cache;
-} Efl_Model_Accessor_Slice;
+ Eina_Stringshare *property;
-static void
-efl_model_accessor_slice_setup(Efl_Model_Accessor_Slice *acc,
- Efl_Model *parent, Efl_Model_Composite_Boolean_Data *parent_pd, Efl_Promise *promise, int start);
+ // This is not the best for supporting sparse bitfield with random insertion
+ // but will do for now (Would be best to have a tree of fixed size array
+ // or something along that line).
+ unsigned char *buffer;
+ unsigned int buffer_count;
+ Eina_Bool default_value;
+};
-static Eina_Value *
-_value_clone(const Eina_Value *value)
+struct _Efl_Model_Composite_Boolean_Children_Data
{
- Eina_Value *copy = eina_value_new(eina_value_type_get(value));
- eina_value_copy(value, copy);
- return copy;
-}
+ Efl_Model_Composite_Boolean_Data *parent;
+ unsigned int index;
+};
-static void
-_future_forward_cb(void *data, Efl_Event const *event)
-{
- efl_promise_value_set(
- data, _value_clone(((Efl_Future_Event_Success*)event->info)->value), (Eina_Free_Cb)eina_value_free);
-}
+/**************** efl_mmodel_composite_boolean_children **************/
static void
-_future_error_forward_cb(void *data, Efl_Event const *event)
+_efl_model_composite_boolean_children_index_set(Eo *obj EINA_UNUSED,
+ Efl_Model_Composite_Boolean_Children_Data *pd,
+ unsigned int index)
{
- Eina_Error err = ((Efl_Future_Event_Failure*)event->info)->error;
- efl_promise_failed_set(data, err);
-}
+ if (pd->parent) // This is set during finalize
+ return ;
-static Eina_Bool
-_bit_get(const unsigned char *bitstream, unsigned int idx)
-{
- Eina_Bool b = (bitstream[idx / 8] >> (idx % 8)) & 1u;
- return b;
+ pd->index = index;
}
-static void
-_bit_set(unsigned char *bitstream, unsigned int idx, Eina_Bool v)
+static unsigned int
+_efl_model_composite_boolean_children_index_get(const Eo *obj EINA_UNUSED,
+ Efl_Model_Composite_Boolean_Children_Data *pd)
{
- if (v)
- bitstream[idx / 8] |= 1u << (idx % 8);
- else
- bitstream[idx / 8] &= ~(1u << (idx % 8));
+ return pd->index;
}
-/**************** efl_mmodel_composite_boolean_children **************/
-
-static void
-_properties_names_array_free(Eina_Array *properties_names)
+static Efl_Object *
+_efl_model_composite_boolean_children_efl_object_finalize(Eo *obj,
+ Efl_Model_Composite_Boolean_Children_Data *pd)
{
- Eina_Array_Iterator it;
- void *name;
- unsigned int i;
+ Eo *parent;
- EINA_ARRAY_ITER_NEXT(properties_names, i, name, it)
- free(name);
+ parent = efl_parent_get(obj);
+ if (!parent) return NULL;
+ pd->parent = efl_data_scope_get(parent, EFL_MODEL_COMPOSITE_BOOLEAN_CLASS);
- eina_array_free(properties_names);
+ return obj;
}
-
-static void
-_efl_model_composite_boolean_children_efl_object_destructor(Eo *obj,
- Efl_Model_Composite_Boolean_Children_Data *pd)
+static Eina_Array *
+_efl_model_composite_boolean_children_efl_model_properties_get(const Eo *obj,
+ Efl_Model_Composite_Boolean_Children_Data *pd)
{
- if (pd->properties_names)
- _properties_names_array_free(pd->properties_names);
+ Eina_Iterator *it;
+ Eina_Stringshare *s;
+ Eina_Array *r;
- if (pd->composite_child)
- efl_unref(pd->composite_child);
+ r = efl_model_properties_get(efl_super(obj, EFL_MODEL_COMPOSITE_BOOLEAN_CHILDREN_CLASS));
+ if (!r) r = eina_array_new(1);
- efl_destructor(efl_super(obj, EFL_MODEL_COMPOSITE_BOOLEAN_CHILDREN_CLASS));
-}
+ it = eina_hash_iterator_key_new(pd->parent->values);
+ EINA_ITERATOR_FOREACH(it, s)
+ eina_array_push(r, s);
+ eina_array_push(r, "child.index");
-static Eina_Bool
-_properties_names_push(const Eina_Hash *hash EINA_UNUSED,
- const void *key, void *data EINA_UNUSED, void *fdata)
-{
- eina_array_push(fdata, key);
- return EINA_TRUE;
+ return r;
}
-static const Eina_Array*
-_efl_model_composite_boolean_children_efl_model_properties_get(Eo *obj EINA_UNUSED,
- Efl_Model_Composite_Boolean_Children_Data *pd)
-{
- Eina_Array const *composite_properties;
- unsigned int composite_count, self_count, i;
-
- if (pd->properties_names)
- {
- _properties_names_array_free(pd->properties_names);
- pd->properties_names = NULL;
- }
-
- composite_properties = efl_model_properties_get(pd->composite_child);
- if (!composite_properties)
- return pd->properties_names = eina_array_new(1);
-
- composite_count = eina_array_count_get(composite_properties);
- self_count = eina_hash_population(pd->parent_pd->values);
-
- pd->properties_names = eina_array_new(composite_count + self_count);
- for (i = 0; i != composite_count; ++i)
- {
- const char *name = strdup(eina_array_data_get(composite_properties, i));
- eina_array_push(pd->properties_names, name);
- }
-
- eina_hash_foreach(pd->parent_pd->values, _properties_names_push, pd->properties_names);
-
- return pd->properties_names;
-}
-
-static Efl_Future *
-_efl_model_composite_boolean_children_efl_model_property_get(Eo *obj EINA_UNUSED,
- Efl_Model_Composite_Boolean_Children_Data *pd, const char *property)
-{
- Efl_Model_Hash_Value *hv = eina_hash_find(pd->parent_pd->values, property);
- if (hv)
- {
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- Efl_Future *rfuture = efl_promise_future_get(promise);
-
- Eina_Value *eina_value = eina_value_new(EINA_VALUE_TYPE_UCHAR);
- if (hv->bits_count <= pd->index)
- {
- unsigned char f = hv->default_value;
- eina_value_set(eina_value, f);
- }
- else
- {
- eina_value_set(eina_value, _bit_get(hv->buffer, pd->index));
- }
- efl_promise_value_set(promise, eina_value, (Eina_Free_Cb)eina_value_free);
- return rfuture;
- }
- else if (pd->composite_child)
- return efl_model_property_get(pd->composite_child, property);
- else
- {
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- Efl_Future *rfuture = efl_promise_future_get(promise);
-
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_NOT_FOUND);
- return rfuture;
- }
-}
-
-static Efl_Future *
-_efl_model_composite_boolean_children_efl_model_property_set(Eo *obj EINA_UNUSED,
- Efl_Model_Composite_Boolean_Children_Data *pd, const char *property, const Eina_Value *value)
-{
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- Efl_Future *rfuture = efl_promise_future_get(promise);
-
- Efl_Model_Hash_Value *hv = eina_hash_find(pd->parent_pd->values, property);
- if (hv)
- {
- Eina_Bool flag = EINA_FALSE;
-
- if (eina_value_type_get(value) != EINA_VALUE_TYPE_UCHAR)
- {
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_INCORRECT_VALUE);
- return rfuture;
- }
- if (!eina_value_get(value, &flag))
- {
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_UNKNOWN);
- return rfuture;
- }
-
- if (pd->index >= hv->bits_count)
- {
- unsigned int bytes = (pd->index / 8) + 1;
- unsigned int buff_size = (hv->bits_count / 8) + (hv->bits_count % 8 ? 1 : 0);
- unsigned char *buff = realloc(hv->buffer, bytes);
- if (!buff)
- {
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_UNKNOWN);
- return rfuture;
- }
- memset(
- buff + buff_size,
- hv->default_value ? -1 : 0,
- bytes - buff_size);
-
- hv->buffer = buff;
- hv->bits_count = bytes * 8;
- }
-
- _bit_set(hv->buffer, pd->index, flag);
-
- efl_promise_value_set(
- promise, _value_clone(value), (Eina_Free_Cb)eina_value_free);
- }
- else if (pd->composite_child)
- {
- Efl_Future *f_forward = efl_model_property_set(pd->composite_child, property, value);
- efl_future_then(f_forward, _future_forward_cb, _future_error_forward_cb, NULL, promise);
- }
+static Eina_Value *
+_efl_model_composite_boolean_children_efl_model_property_get(const Eo *obj,
+ Efl_Model_Composite_Boolean_Children_Data *pd,
+ const char *property)
+{
+ Efl_Model_Composite_Boolean_Value *v;
+ Eina_Stringshare *s;
+ Eina_Bool flag;
+
+ if (property == NULL) return NULL;
+ if (strcmp(property, "child.index") == 0)
+ return eina_value_uint_new(pd->index);
+
+ s = eina_stringshare_add(property);
+ v = eina_hash_find(pd->parent->values, s);
+ eina_stringshare_del(s);
+
+ if (!v)
+ return efl_model_property_get(efl_super(obj, EFL_MODEL_COMPOSITE_BOOLEAN_CHILDREN_CLASS),
+ property);
+
+ // As an optimization we do optimistically allocate the boolean array
+ // Better would be to have a sparse boolean array
+ if ((pd->index >> 3) >= v->buffer_count)
+ flag = v->default_value;
else
- {
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_NOT_FOUND);
- }
-
- return rfuture;
-}
+ flag = v->buffer[pd->index >> 3] & (1 << pd->index & 0x7);
-static Efl_Future*
-_efl_model_composite_boolean_children_efl_model_children_slice_get(Eo *obj EINA_UNUSED,
- Efl_Model_Composite_Boolean_Children_Data *pd, unsigned int start, unsigned int count)
-{
- return efl_model_children_slice_get(pd->composite_child, start, count);
+ return eina_value_uchar_new(!!flag);
}
-static Efl_Future*
-_efl_model_composite_boolean_children_efl_model_children_count_get(Eo *obj EINA_UNUSED,
- Efl_Model_Composite_Boolean_Children_Data *pd)
+static Eina_Future *
+_efl_model_composite_boolean_children_efl_model_property_set(Eo *obj,
+ Efl_Model_Composite_Boolean_Children_Data *pd,
+ const char *property, Eina_Value *value)
{
- return efl_model_children_count_get(pd->composite_child);
-}
+ Efl_Model_Composite_Boolean_Value *v;
+ Eina_Stringshare *s;
+ Eina_Value b = EINA_VALUE_EMPTY;
+ Eina_Bool flag;
-static Efl_Object*
-_efl_model_composite_boolean_children_efl_model_child_add(Eo *obj EINA_UNUSED,
- Efl_Model_Composite_Boolean_Children_Data *pd)
-{
- return efl_model_child_add(pd->composite_child);
-}
+ if (!property)
+ return eina_future_rejected(efl_loop_future_scheduler_get(obj),
+ EFL_MODEL_ERROR_UNKNOWN);
+ if (strcmp(property, "child.index") == 0)
+ return eina_future_rejected(efl_loop_future_scheduler_get(obj),
+ EFL_MODEL_ERROR_READ_ONLY);
-static void
-_efl_model_composite_boolean_children_efl_model_child_del(Eo *obj EINA_UNUSED,
- Efl_Model_Composite_Boolean_Children_Data *pd, Efl_Object *child)
-{
- efl_model_child_del(pd->composite_child, child);
-}
+ s = eina_stringshare_add(property);
+ v = eina_hash_find(pd->parent->values, s);
+ eina_stringshare_del(s);
-/**************** efl_model_accessor_slice **************/
+ if (!v)
+ return efl_model_property_set(efl_super(obj, EFL_MODEL_COMPOSITE_BOOLEAN_CHILDREN_CLASS),
+ property, value);
-static void
-_bool_children_cache_array_free(Eina_Array *children_cache)
-{
- int i, count = eina_array_count_get(children_cache);
- for (i = 0; i < count; ++i)
- efl_unref(eina_array_data_get(children_cache, i));
- eina_array_free(children_cache);
-}
+ eina_value_setup(&b, EINA_VALUE_TYPE_UCHAR);
+ if (!eina_value_convert(value, &b))
+ return eina_future_rejected(efl_loop_future_scheduler_get(obj),
+ EFL_MODEL_ERROR_UNKNOWN);
+ if (!eina_value_get(value, &flag))
+ return eina_future_rejected(efl_loop_future_scheduler_get(obj),
+ EFL_MODEL_ERROR_UNKNOWN);
-static Eina_Bool
-efl_model_acessor_slice_get_at(Efl_Model_Accessor_Slice *acc, unsigned int idx, void **data)
-{
- Efl_Model *child_bool;
- Eina_Array *children_cache = acc->bool_children_cache;
+ eina_value_flush(&b);
- /* NOTE: Efl.Model.Composite.Boolean must alloc the cache with the correct size
- and NULL initialized. */
- if (idx >= eina_array_count(children_cache))
+ // We are optimistically allocating the boolean buffer now.
+ // Aligning it on 64bits
+ if (v->buffer_count < (((pd->index) >> 3) | 0x7) + 1)
{
- EINA_LOG_WARN("Index bigger than size");
- return EINA_FALSE;
+ unsigned int rcount = (((pd->index | 0xF) >> 3) | 0x7) + 1;
+ unsigned char *tmp;
+
+ tmp = realloc(v->buffer, rcount);
+ if (!tmp) return eina_future_rejected(efl_loop_future_scheduler_get(obj), ENOMEM);
+ v->buffer = tmp;
+ memset(v->buffer + v->buffer_count, 0, rcount - v->buffer_count);
+ v->buffer_count = rcount;
}
- child_bool = eina_array_data_get(children_cache, acc->index + idx);
-
- if (!child_bool)
- {
- Efl_Model *child = NULL;
-
- if (!eina_accessor_data_get(acc->real_accessor, idx, (void *)&child))
- return EINA_FALSE;
-
- if (child)
- {
- Efl_Model_Composite_Boolean_Children_Data *cpd;
- child_bool = efl_add(EFL_MODEL_COMPOSITE_BOOLEAN_CHILDREN_CLASS, NULL);
- cpd = efl_data_scope_get(child_bool, EFL_MODEL_COMPOSITE_BOOLEAN_CHILDREN_CLASS);
-
- cpd->parent_pd = acc->parent_pd;
- cpd->composite_child = efl_ref(child);
- cpd->index = acc->index + idx;
-
- eina_array_data_set(children_cache, idx, child_bool);
- }
- }
+ // It is assumed that during slice get the buffer is properly sized
+ if (flag)
+ v->buffer[pd->index >> 3] |= 1 << (pd->index & 0x7);
+ else
+ v->buffer[pd->index >> 3] &= ~(1 << (pd->index & 0x7));
- if (data) *data = child_bool;
- return EINA_TRUE;
+ return eina_future_resolved(efl_loop_future_scheduler_get(obj),
+ eina_value_uchar_init(!!flag));
}
-static void *
-efl_model_acessor_slice_get_container(Efl_Model_Accessor_Slice *acc)
+/**************** efl_model_composite_boolean **************/
+typedef struct _Efl_Model_Slice_Request Efl_Model_Slice_Request;
+struct _Efl_Model_Slice_Request
{
- return eina_accessor_container_get(acc->real_accessor);
-}
+ Eo *parent;
+ unsigned int start;
+};
-static void
-efl_model_acessor_slice_free(Efl_Model_Accessor_Slice *acc)
+static Eina_Value
+_efl_model_composite_boolean_then(void *data, const Eina_Value v, const Eina_Future *dead_future EINA_UNUSED)
{
- if (acc->bool_children_cache)
- {
- _bool_children_cache_array_free(acc->bool_children_cache);
- acc->bool_children_cache = NULL;
- }
-
- if (acc->real_accessor)
- {
- /* eina_accessor_free(acc->real_accessor); */
- acc->real_accessor = NULL;
- }
+ Efl_Model_Slice_Request *req = data;
+ unsigned int i, len;
+ Eina_Value r = EINA_VALUE_EMPTY;
+ Eo *target = NULL;
- if (acc->parent)
- {
- efl_unref(acc->parent);
- acc->parent = NULL;
- }
-
- acc->parent_pd = NULL;
- acc->promise = NULL;
+ if (eina_value_type_get(&v) != EINA_VALUE_TYPE_ARRAY)
+ goto on_error;
- free(acc);
-}
+ eina_value_array_setup(&r, EINA_VALUE_TYPE_OBJECT, 4);
-static Eina_Bool
-efl_model_acessor_slice_lock(Efl_Model_Accessor_Slice *acc)
-{
- return eina_accessor_lock(acc->real_accessor);
-}
-
-static Eina_Bool
-efl_model_acessor_slice_unlock(Efl_Model_Accessor_Slice *acc)
-{
- return eina_accessor_unlock(acc->real_accessor);
-}
-
-static Efl_Model_Accessor_Slice *
-efl_model_acessor_slice_clone(Efl_Model_Accessor_Slice *acc EINA_UNUSED)
-{
- Efl_Model_Accessor_Slice* new_accessor = calloc(1, sizeof(Efl_Model_Accessor_Slice));
- Eina_Array* children_cache;
- unsigned i;
- unsigned children_count = eina_array_count(acc->bool_children_cache);
-
- efl_model_accessor_slice_setup(new_accessor, acc->parent, acc->parent_pd, NULL
- , acc->index);
- new_accessor->real_accessor = eina_accessor_clone(acc->real_accessor);
-
- children_cache = eina_array_new(children_count);
- for (i = 0 ; i < children_count; ++i)
+ EINA_VALUE_ARRAY_FOREACH(&v, len, i, target)
{
- // NOTE: eina_array_push do not accept NULL
- eina_array_push(children_cache, (void*)0x01);
- eina_array_data_set(children_cache, i, NULL);
- }
-
- new_accessor->bool_children_cache = children_cache;
-
- return new_accessor;
-}
-
-static void
-efl_model_accessor_slice_setup(Efl_Model_Accessor_Slice *acc,
- Efl_Model *parent, Efl_Model_Composite_Boolean_Data *parent_pd, Efl_Promise *promise, int start)
-{
- acc->vtable.version = EINA_ACCESSOR_VERSION;
- acc->vtable.get_at = FUNC_ACCESSOR_GET_AT(efl_model_acessor_slice_get_at);
- acc->vtable.get_container = FUNC_ACCESSOR_GET_CONTAINER(efl_model_acessor_slice_get_container);
- acc->vtable.free = FUNC_ACCESSOR_FREE(efl_model_acessor_slice_free);
+ Eo *composite;
- acc->vtable.lock = FUNC_ACCESSOR_LOCK(efl_model_acessor_slice_lock);
- acc->vtable.unlock = FUNC_ACCESSOR_LOCK(efl_model_acessor_slice_unlock);
+ // It would have been nice if I could have just overriden the object
+ // function, but this would allow only one composite model
+ composite = efl_add(EFL_MODEL_COMPOSITE_BOOLEAN_CHILDREN_CLASS, req->parent,
+ efl_model_composite_boolean_children_index_set(efl_added, req->start + i),
+ efl_ui_view_model_set(efl_added, target));
- acc->vtable.clone = FUNC_ACCESSOR_CLONE(efl_model_acessor_slice_clone);
+ eina_value_array_append(&r, composite);
+ }
- EINA_MAGIC_SET(&acc->vtable, EINA_MAGIC_ACCESSOR);
+ on_error:
+ efl_unref(req->parent);
+ free(req);
- acc->parent = efl_ref(parent);
- acc->parent_pd = parent_pd;
- acc->promise = promise;
- acc->index = start;
+ return r;
}
static void
-_efl_model_composite_boolean_slice_then_cb(void *data, Efl_Event const *event)
+_boolean_value_free(void *data)
{
- Efl_Model_Accessor_Slice *slice_acc = data;
- Eina_Accessor *value_itt = (Eina_Accessor *)((Efl_Future_Event_Success*)event->info)->value;
- unsigned int *children_count = NULL;
- Eina_Accessor *children_accessor = NULL;
-
- if (!eina_accessor_data_get(value_itt, 0, (void**)&children_count) ||
- !children_count ||
- !eina_accessor_data_get(value_itt, 1, (void**)&children_accessor) ||
- !children_accessor)
- {
- EINA_LOG_WARN("missing Efl.Model information");
- efl_promise_failed_set(slice_acc->promise, EFL_MODEL_ERROR_UNKNOWN);
- efl_model_acessor_slice_free(slice_acc);
- return;
- }
-
- slice_acc->real_accessor = eina_accessor_clone(children_accessor);
- if (slice_acc->real_accessor)
- {
- Eina_Array *children_cache;
- unsigned int i;
+ Efl_Model_Composite_Boolean_Value *value = data;
- if (slice_acc->bool_children_cache)
- _bool_children_cache_array_free(slice_acc->bool_children_cache);
+ eina_stringshare_del(value->property);
+ value->property = NULL;
- children_cache = eina_array_new(*children_count);
- for (i = 0 ; i < *children_count; ++i)
- {
- // NOTE: eina_array_push do not accept NULL
- eina_array_push(children_cache, (void*)0x01);
- eina_array_data_set(children_cache, i, NULL);
- }
-
- slice_acc->bool_children_cache = children_cache;
-
- efl_promise_value_set(slice_acc->promise, slice_acc, (Eina_Free_Cb)&eina_accessor_free);
- }
- else
- {
- efl_promise_failed_set(slice_acc->promise, EFL_MODEL_ERROR_NOT_SUPPORTED);
- efl_model_acessor_slice_free(slice_acc);
- }
+ free(value->buffer);
+ value->buffer = NULL;
+ value->buffer_count = 0;
}
-static void
-_efl_model_composite_boolean_slice_error_cb(void *data, Efl_Event const*event)
+static Eo *
+_efl_model_composite_boolean_efl_object_constructor(Eo *obj, Efl_Model_Composite_Boolean_Data *pd)
{
- Efl_Model_Accessor_Slice *slice_acc = data;
- Eina_Error error = ((Efl_Future_Event_Failure*)event->info)->error;
- efl_promise_failed_set(slice_acc->promise, error);
- efl_model_acessor_slice_free(slice_acc);
-}
+ obj = efl_constructor(efl_super(obj, EFL_MODEL_COMPOSITE_BOOLEAN_CLASS));
-/**************** efl_mmodel_composite_boolean **************/
+ if (!obj) return NULL;
-static void
-efl_model_hash_value_free(void *p)
-{
- Efl_Model_Hash_Value *value = p;
- if (value)
- {
- free(value->buffer);
- free(value);
- }
-}
-
-static void
-_composite_model_data_reset(Efl_Model_Composite_Boolean_Data *pd)
-{
+ pd->values = eina_hash_stringshared_new(_boolean_value_free);
- if (pd->composite_model)
- {
- efl_unref(pd->composite_model);
- pd->composite_model = NULL;
- }
+ return obj;
}
static void
_efl_model_composite_boolean_efl_object_destructor(Eo *obj, Efl_Model_Composite_Boolean_Data *pd)
{
- if (pd->empty_properties)
- {
- eina_array_free(pd->empty_properties);
- pd->empty_properties = NULL;
- }
-
- if (pd->values)
- {
- eina_hash_free(pd->values);
- pd->values = NULL;
- }
-
- _composite_model_data_reset(pd);
+ eina_hash_free(pd->values);
efl_destructor(efl_super(obj, EFL_MODEL_COMPOSITE_BOOLEAN_CLASS));
}
static void
-_efl_model_composite_boolean_efl_ui_view_model_set(Eo *obj EINA_UNUSED,
- Efl_Model_Composite_Boolean_Data *pd, Efl_Model *model)
+_efl_model_composite_boolean_boolean_add(Eo *obj EINA_UNUSED,
+ Efl_Model_Composite_Boolean_Data *pd,
+ const char *name, Eina_Bool default_value)
{
- if (pd->composite_model)
- {
- _composite_model_data_reset(pd);
- }
+ Efl_Model_Composite_Boolean_Value *value;
- pd->composite_model = efl_ref(model);
-}
+ if (!name) return ;
-static Efl_Model *
-_efl_model_composite_boolean_efl_ui_view_model_get(Eo *obj EINA_UNUSED, Efl_Model_Composite_Boolean_Data *pd)
-{
- return pd->composite_model;
-}
+ value = calloc(1, sizeof (Efl_Model_Composite_Boolean_Value));
+ if (!value) return ;
-static void
-_efl_model_composite_boolean_property_add(Eo *obj EINA_UNUSED, Efl_Model_Composite_Boolean_Data *pd,
- const char *name, Eina_Bool initial_value)
-{
- if (!pd->values)
- pd->values = eina_hash_string_small_new(&efl_model_hash_value_free);
- Efl_Model_Hash_Value *value = calloc(1, sizeof(Efl_Model_Hash_Value));
- value->default_value = initial_value;
- eina_hash_add(pd->values, name, value);
-}
+ value->property = eina_stringshare_add(name);
+ value->default_value = default_value;
-static const Eina_Array *
-_efl_model_composite_boolean_efl_model_properties_get(Eo *obj EINA_UNUSED, Efl_Model_Composite_Boolean_Data *pd)
-{
- if (pd->composite_model)
- return efl_model_properties_get(pd->composite_model);
- else if (pd->empty_properties)
- return pd->empty_properties;
- else
- return pd->empty_properties = eina_array_new(1);
-}
-
-Efl_Future *
-_efl_model_composite_boolean_efl_model_property_get(Eo *obj EINA_UNUSED,
- Efl_Model_Composite_Boolean_Data *pd, const char *property)
-{
- if (pd->composite_model)
- return efl_model_property_get(pd->composite_model, property);
-
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- Efl_Future *rfuture = efl_promise_future_get(promise);
-
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_NOT_FOUND);
- return rfuture;
+ eina_hash_direct_add(pd->values, value->property, value);
}
-Efl_Future *
-_efl_model_composite_boolean_efl_model_property_set(Eo *obj EINA_UNUSED, Efl_Model_Composite_Boolean_Data *pd,
- const char *property, const Eina_Value *value)
+static void
+_efl_model_composite_boolean_boolean_del(Eo *obj EINA_UNUSED,
+ Efl_Model_Composite_Boolean_Data *pd,
+ const char *name)
{
+ Eina_Stringshare *s;
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- Efl_Future *rfuture = efl_promise_future_get(promise);
-
- if (pd->composite_model)
- {
- Efl_Future *f_forward = efl_model_property_set(pd->composite_model, property, value);
- efl_future_then(f_forward, _future_forward_cb, _future_error_forward_cb, NULL, promise);
- }
- else
- {
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_NOT_FOUND);
- }
-
- return rfuture;
+ s = eina_stringshare_add(name);
+ eina_hash_del(pd->values, s, NULL);
+ eina_stringshare_del(s);
}
-static Efl_Future *
-_efl_model_composite_boolean_efl_model_children_slice_get(Eo *obj, Efl_Model_Composite_Boolean_Data *pd, unsigned int start, unsigned int count)
+static Eina_Future *
+_efl_model_composite_boolean_efl_model_children_slice_get(Eo *obj,
+ Efl_Model_Composite_Boolean_Data *pd EINA_UNUSED,
+ unsigned int start, unsigned int count)
{
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- Efl_Future *rfuture = efl_promise_future_get(promise);
-
- if (pd->composite_model)
- {
- Efl_Model_Accessor_Slice *accessor;
- Efl_Future *composite_future;
- Efl_Future *futures[2] = {NULL,};
+ Efl_Model_Slice_Request *req;
+ Eina_Future *f;
- futures[0] = efl_model_children_count_get(pd->composite_model);
- futures[1] = efl_model_children_slice_get(pd->composite_model, start, count);
+ f = efl_model_children_slice_get(efl_super(obj, EFL_MODEL_COMPOSITE_BOOLEAN_CLASS),
+ start, count);
- composite_future = efl_future_all(futures[0], futures[1]);
+ req = malloc(sizeof (Efl_Model_Slice_Request));
+ if (!req) return eina_future_rejected(efl_loop_future_scheduler_get(obj),
+ ENOMEM);
+ req->parent = efl_ref(obj);
+ req->start = start;
- accessor = calloc(1, sizeof(Efl_Model_Accessor_Slice));
- efl_model_accessor_slice_setup(accessor, obj, pd, promise, start);
-
- efl_future_then(composite_future, &_efl_model_composite_boolean_slice_then_cb,
- &_efl_model_composite_boolean_slice_error_cb, NULL, accessor);
- }
- else
- {
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_NOT_SUPPORTED);
- }
- return rfuture;
-}
-
-static Efl_Future *
-_efl_model_composite_boolean_efl_model_children_count_get(Eo *obj EINA_UNUSED, Efl_Model_Composite_Boolean_Data *pd)
-{
- if (pd->composite_model)
- return efl_model_children_count_get(pd->composite_model);
- else
- {
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- Efl_Future *rfuture = efl_promise_future_get(promise);
-
- unsigned int *count = malloc(sizeof(unsigned int));
- *count = 0;
- efl_promise_value_set(promise, count, free);
- return rfuture;
- }
-}
-
-static Efl_Object*
-_efl_model_composite_boolean_efl_model_child_add(Eo *obj EINA_UNUSED, Efl_Model_Composite_Boolean_Data *pd)
-{
- if (pd->composite_model)
- return efl_model_child_add(pd->composite_model);
- else
- {
- eina_error_set(EFL_MODEL_ERROR_NOT_SUPPORTED);
- return NULL;
- }
-}
-
-static void
-_efl_model_composite_boolean_efl_model_child_del(Eo *obj EINA_UNUSED, Efl_Model_Composite_Boolean_Data *pd, Efl_Object *child)
-{
- if (pd->composite_model)
- return efl_model_child_del(pd->composite_model, child);
- else
- {
- eina_error_set(EFL_MODEL_ERROR_NOT_SUPPORTED);
- }
+ return efl_future_Eina_FutureXXX_then(obj,
+ eina_future_then(f, _efl_model_composite_boolean_then, req));
}
#include "efl_model_composite_boolean.eo.c"
diff --git a/src/lib/ecore/efl_model_composite_boolean.eo b/src/lib/ecore/efl_model_composite_boolean.eo
index bb7eacbb11..21bf540621 100644
--- a/src/lib/ecore/efl_model_composite_boolean.eo
+++ b/src/lib/ecore/efl_model_composite_boolean.eo
@@ -1,28 +1,24 @@
-class Efl.Model.Composite.Boolean (Efl.Object, Efl.Model, Efl.Ui.View)
+class Efl.Model_Composite_Boolean (Efl.Model_Composite)
{
[[Efl model composite boolean class]]
methods {
- property_add {
- [[Adds property]]
+ boolean_add {
+ [[Add a new named boolean property with a defined default value.]]
params {
- @in name: string; [[Property name]]
- @in initial_value: bool; [[Initial property value $bool]]
- }
+ @in name: string;
+ @in default_value: bool;
+ }
+ }
+ boolean_del {
+ [[Delete an existing named boolean property]]
+ params {
+ @in name: string;
+ }
}
}
implements {
+ Efl.Object.constructor;
Efl.Object.destructor;
- Efl.Model.properties { get; }
- Efl.Model.property_get;
- Efl.Model.property_set;
Efl.Model.children_slice_get;
- Efl.Model.children_count_get;
- Efl.Model.child_add;
- Efl.Model.child_del;
- Efl.Ui.View.model { set; get; }
- }
- constructors {
- Efl.Ui.View.model;
- .property_add @optional;
}
}
diff --git a/src/lib/ecore/efl_model_composite_boolean_children.eo b/src/lib/ecore/efl_model_composite_boolean_children.eo
index 623bd1d4db..45bb2f65a8 100644
--- a/src/lib/ecore/efl_model_composite_boolean_children.eo
+++ b/src/lib/ecore/efl_model_composite_boolean_children.eo
@@ -1,14 +1,23 @@
-class Efl.Model.Composite.Boolean.Children (Efl.Object, Efl.Model)
+class Efl.Model_Composite_Boolean_Children (Efl.Model_Composite)
{
[[Efl model composite boolean children class]]
+ methods {
+ @property index {
+ [[Position of children in the parent model.]]
+ set {
+ [[Set the index. It can only be set before the object is finalized.]]
+ }
+ get {
+ [[Get the index.]]
+ }
+ values {
+ index: uint; [[The index of the child in the parent model.]]
+ }
+ }
+ }
implements {
- Efl.Object.destructor;
Efl.Model.properties { get; }
- Efl.Model.property_get;
- Efl.Model.property_set;
- Efl.Model.children_slice_get;
- Efl.Model.children_count_get;
- Efl.Model.child_add;
- Efl.Model.child_del;
+ Efl.Model.property { get; set; }
+ Efl.Object.finalize;
}
}
diff --git a/src/lib/ecore/efl_model_composite_selection.c b/src/lib/ecore/efl_model_composite_selection.c
index dbbe43fc45..914a45f90a 100644
--- a/src/lib/ecore/efl_model_composite_selection.c
+++ b/src/lib/ecore/efl_model_composite_selection.c
@@ -10,227 +10,447 @@
#include "efl_model_composite_selection.eo.h"
#include "efl_model_accessor_view_private.h"
-typedef struct _Efl_Model_Composite_Selection_Data
+typedef struct _Efl_Model_Composite_Selection_Data Efl_Model_Composite_Selection_Data;
+typedef struct _Efl_Model_Composite_Selection_Children_Data Efl_Model_Composite_Selection_Children_Data;
+
+struct _Efl_Model_Composite_Selection_Data
{
- Efl_Model_Composite_Selection* obj;
- struct {
- Efl_Model* selected_child;
- } exclusive_data;
- Eina_Bool is_exclusive;
-
-} Efl_Model_Composite_Selection_Data;
+ unsigned long last;
+
+ Eina_Bool exclusive : 1;
+ Eina_Bool none : 1;
+};
-typedef struct _Efl_Model_Composite_Selection_Children_Data
+struct _Efl_Model_Composite_Selection_Children_Data
{
- Efl_Model_Composite_Selection_Data* pd;
-} Efl_Model_Composite_Selection_Children_Data;
+};
static Eo*
_efl_model_composite_selection_efl_object_constructor(Eo *obj,
- Efl_Model_Composite_Selection_Data *pd EINA_UNUSED)
+ Efl_Model_Composite_Selection_Data *pd EINA_UNUSED)
{
- efl_constructor(efl_super(obj, EFL_MODEL_COMPOSITE_SELECTION_CLASS));
- efl_model_composite_boolean_property_add(obj, "selected", EINA_FALSE);
- pd->obj = obj;
+ obj = efl_constructor(efl_super(obj, EFL_MODEL_COMPOSITE_SELECTION_CLASS));
+
+ efl_model_composite_boolean_add(obj, "selected", EINA_FALSE);
+
+ pd->last = -1;
+
return obj;
}
-/***************************/
-static void _select_property_failed(void* data, Efl_Event const* event)
+static Eina_Value
+_commit_change(void *data, const Eina_Value v, const Eina_Future *dead_future EINA_UNUSED)
{
- Efl_Promise* promise = data;
- Efl_Future_Event_Failure* fail = event->info;
- efl_promise_failed_set(promise, fail->error);
- efl_unref(promise);
+ Efl_Model_Composite_Selection_Data *pd;
+ Efl_Model *child = data;
+ Eina_Value *vc = NULL;
+ Eina_Value *selected = NULL;
+ Eina_Bool selflag = EINA_FALSE;
+
+ if (v.type == EINA_VALUE_TYPE_ERROR)
+ goto on_error;
+
+ vc = efl_model_property_get(child, "Child.index");
+ selected = efl_model_property_get(child, "selected");
+
+ pd = efl_data_scope_get(efl_parent_get(child), EFL_MODEL_COMPOSITE_SELECTION_CLASS);
+ if (!pd) goto on_error;
+
+ eina_value_bool_get(selected, &selflag);
+ if (selflag)
+ {
+ // select case
+ pd->none = EINA_FALSE;
+ eina_value_ulong_get(vc, &pd->last);
+ efl_event_callback_call(child, EFL_MODEL_COMPOSITE_SELECTION_EVENT_SELECTED, child);
+ }
+ else
+ {
+ // unselect case
+ unsigned long last;
+
+ eina_value_ulong_get(vc, &last);
+ if (pd->last == last)
+ {
+ pd->last = 0;
+ pd->none = EINA_TRUE;
+ }
+ efl_event_callback_call(child, EFL_MODEL_COMPOSITE_SELECTION_EVENT_UNSELECTED, child);
+ }
+
+ on_error:
+ eina_value_free(vc);
+ eina_value_free(selected);
+ return v;
}
-static void _select_property_then(void* data, Efl_Event const* event EINA_UNUSED)
+static Eina_Value
+_clear_child(void *data,
+ const Eina_Value v,
+ const Eina_Future *dead_future EINA_UNUSED)
{
- Efl_Promise* promise = data;
- Eina_Value* v = eina_value_new(EINA_VALUE_TYPE_UCHAR);
- eina_value_set(v, EINA_TRUE);
- efl_promise_value_set(promise, v, (Eina_Free_Cb)&eina_value_free);
- efl_unref(promise);
+ Efl_Model *child = data;
+
+ efl_del(child);
+
+ return v;
}
-static void _select_slice_then(void* data EINA_UNUSED, Efl_Event const* event)
+static Efl_Model *
+_select_child_get(const Eina_Value *array, unsigned int idx)
{
- Efl_Future_Event_Success* success = event->info;
- Eina_Accessor* accessor = eina_accessor_clone(success->value);
- Eina_Value value;
- Efl_Model* child;
+ Efl_Model *ret = NULL;
- if (!eina_accessor_data_get(accessor, 0, (void **)&child)) return;
-
- eina_value_setup(&value, EINA_VALUE_TYPE_UCHAR);
- eina_value_set(&value, EINA_TRUE);
-
- efl_future_then(efl_model_property_set(child, "selected", &value),
- _select_property_then, _select_property_failed, NULL, efl_ref(success->next));
+ if (eina_value_type_get(array) != EINA_VALUE_TYPE_ARRAY)
+ return NULL;
+
+ if (idx >= eina_value_array_count(array))
+ return NULL;
+
+ eina_value_array_get(array, idx, &ret);
+
+ return ret;
}
-static void _select_error(void* data EINA_UNUSED, Efl_Event const* event)
+static Eina_Future *
+_check_child_change(Efl_Model *child, Eina_Bool value)
{
- Efl_Future_Event_Failure* fail = event->info;
- efl_promise_failed_set(fail->next, fail->error);
+ Eina_Future *r = NULL;
+ Eina_Value *prev;
+ Eina_Bool prevflag = EINA_FALSE;
+
+ prev = efl_model_property_get(child, "selected");
+ eina_value_bool_get(prev, &prevflag);
+ eina_value_free(prev);
+
+ if (prevflag & value)
+ {
+ r = eina_future_resolved(efl_loop_future_scheduler_get(child),
+ eina_value_bool_init(value));
+ }
+ else
+ {
+ r = efl_model_property_set(child, "selected", eina_value_bool_new(!!value));
+ r = eina_future_then(r, _commit_change, child);
+ r = eina_future_then(r, _clear_child, child);
+ }
+
+ return r;
}
-/***************************/
+static Eina_Future *
+_select_child(Efl_Model *child)
+{
+ return _check_child_change(child, EINA_TRUE);
+}
-static Efl_Future*
-_efl_model_composite_selection_select(Eo *obj,
- Efl_Model_Composite_Selection_Data *pd, int idx)
+static Eina_Future *
+_unselect_child(Efl_Model *child)
{
- return efl_future_then(efl_model_children_slice_get(obj, idx, 1),
- &_select_slice_then,
- &_select_error,
- NULL, pd);
+ return _check_child_change(child, EINA_FALSE);
}
-static void
-_efl_model_composite_selection_exclusive_selection_set(Eo *obj EINA_UNUSED,
- Efl_Model_Composite_Selection_Data *pd, Eina_Bool exclusive)
+static Eina_Value
+_select_slice_then(void *data EINA_UNUSED,
+ const Eina_Value v,
+ const Eina_Future *dead_future EINA_UNUSED)
{
- pd->is_exclusive = exclusive;
+ Efl_Model *child = NULL;
+ Eina_Future *r;
+
+ child = _select_child_get(&v, 0);
+ if (!child) goto on_error;
+
+ r = _select_child(child);
+ return eina_future_as_value(r);
+
+ on_error:
+ return v;
}
-static Eina_Bool
-_efl_model_composite_selection_exclusive_selection_get(Eo *obj EINA_UNUSED,
- Efl_Model_Composite_Selection_Data *pd)
+static Eina_Value
+_unselect_slice_then(void *data EINA_UNUSED,
+ const Eina_Value v,
+ const Eina_Future *dead_future EINA_UNUSED)
{
- return pd->is_exclusive;
+ Efl_Model *child = NULL;
+ Eina_Future *r;
+
+ child = _select_child_get(&v, 0);
+ if (!child) goto on_error;
+
+ r = _unselect_child(child);
+ return eina_future_as_value(r);
+
+ on_error:
+ return v;
}
-static void
-_exclusive_future_link_then_cb(void* data, Efl_Event const* event)
+static Eina_Future *
+_efl_model_composite_selection_efl_model_property_set(Eo *obj,
+ Efl_Model_Composite_Selection_Data *pd,
+ const char *property, Eina_Value *value)
{
- Efl_Future_Event_Success *success = event->info;
- efl_promise_value_set(data, success->value, NULL); // We would need to move the value
- // Needs to set exclusive_child
- efl_unref(data);
+ Eina_Value vf = EINA_VALUE_EMPTY;
+
+ if (!strcmp("exclusive", property))
+ {
+ Eina_Bool exclusive = pd->exclusive;
+
+ vf = eina_value_bool_init(exclusive);
+ eina_value_convert(value, &vf);
+ eina_value_bool_get(&vf, &exclusive);
+
+ pd->exclusive = !!exclusive;
+
+ return eina_future_resolved(efl_loop_future_scheduler_get(obj), vf);
+ }
+
+ if (!strcmp("selected", property))
+ {
+ Eina_Value vl = EINA_VALUE_EMPTY;
+ unsigned long l = 0;
+ Eina_Bool success = EINA_TRUE;
+
+ vl = eina_value_ulong_init(0);
+ success &= eina_value_convert(value, &vl);
+ success &= eina_value_ulong_get(&vl, &l);
+ if (!success)
+ return eina_future_rejected(efl_loop_future_scheduler_get(obj), EFL_MODEL_ERROR_INCORRECT_VALUE);
+
+ return efl_future_Eina_FutureXXX_then(obj,
+ eina_future_then(efl_model_children_slice_get(obj, l, 1),
+ _select_slice_then, obj));
+ }
+
+ return efl_model_property_set(efl_super(obj, EFL_MODEL_COMPOSITE_SELECTION_CLASS), property, value);
}
-static void
-_exclusive_future_link_failed(void* data, Efl_Event const* event)
+static Eina_Value *
+_efl_model_composite_selection_efl_model_property_get(const Eo *obj, Efl_Model_Composite_Selection_Data *pd, const char *property)
{
- Efl_Future_Event_Failure *failed = event->info;
- efl_promise_failed_set(data, failed->error);
- efl_unref(data);
+ if (!strcmp("exclusive", property))
+ return eina_value_bool_new(pd->exclusive);
+ if (!strcmp("selected", property))
+ {
+ if (pd->none)
+ return eina_value_error_new(EFL_MODEL_ERROR_INCORRECT_VALUE);
+ else
+ return eina_value_ulong_new(pd->last);
+ }
+
+ return efl_model_property_get(efl_super(obj, EFL_MODEL_COMPOSITE_SELECTION_CLASS), property);
}
-static void
-_exclusive_unselected_then_cb(void* data, Efl_Event const* event)
+static Eina_Value
+_regenerate_error(void *data,
+ const Eina_Value v,
+ const Eina_Future *dead_future EINA_UNUSED)
{
- Efl_Future_Event_Success *success = event->info;
- Eina_Value* true_value = eina_value_new(EINA_VALUE_TYPE_UCHAR);
- eina_value_set(true_value, EINA_TRUE);
- efl_future_then(efl_model_property_set(data, "selected", true_value),
- _exclusive_future_link_then_cb, _exclusive_future_link_failed,
- NULL, efl_ref(success->next));
- efl_unref(data);
+ Eina_Error *error = data;
+ Eina_Value r = v;
+
+ if (v.type == EINA_VALUE_TYPE_ERROR)
+ goto cleanup;
+
+ r = eina_value_error_init(*error);
+
+ cleanup:
+ free(error);
+
+ return r;
}
-static void
-_exclusive_unselected_failed(void* data, Efl_Event const* event)
+static Eina_Value
+_untangle_array(void *data,
+ const Eina_Value v,
+ const Eina_Future *dead_future EINA_UNUSED)
{
- Efl_Future_Event_Failure *failed = event->info;
- efl_promise_failed_set(data, failed->error);
- efl_unref(data);
+ Efl_Model *child = data;
+ Eina_Value va = EINA_VALUE_EMPTY;
+ Eina_Future *f;
+
+ if (v.type == EINA_VALUE_TYPE_ERROR)
+ {
+ // We need to roll back the change, which means in this
+ // case to unselect this child as this is the only case
+ // where we could end up here.
+ Eina_Error *error = calloc(1, sizeof (Eina_Error));
+
+ f = efl_model_property_set(efl_super(child, EFL_MODEL_COMPOSITE_SELECTION_CHILDREN_CLASS),
+ "selected", eina_value_bool_new(EINA_FALSE));
+ // Once this is done, we need to repropagate the error
+ eina_value_error_get(&v, error);
+ f = eina_future_then(f, _regenerate_error, error);
+
+ return eina_future_as_value(f);
+ }
+
+ // Only return the commit change, not the result of the unselect
+ eina_value_array_get(&v, 0, &va);
+ return va;
}
-static Efl_Future *
-_efl_model_composite_selection_children_efl_model_property_set(Eo *obj EINA_UNUSED,
- Efl_Model_Composite_Selection_Children_Data *pd, const char *property, const Eina_Value *value)
+static Eina_Future *
+_efl_model_composite_selection_children_efl_model_property_set(Eo *obj,
+ Efl_Model_Composite_Selection_Children_Data *pd EINA_UNUSED,
+ const char *property, Eina_Value *value)
{
- if(!strcmp("selected", property))
+ Eina_Value *ve = NULL;
+ Eina_Value *vb = NULL;
+ Eina_Value lvb = EINA_VALUE_EMPTY;
+ Eina_Bool success = EINA_TRUE;
+ Eina_Bool exclusive = EINA_FALSE;
+ Eina_Bool prevflag = EINA_FALSE, newflag = EINA_FALSE;
+ Eina_Future *chain;
+
+ if (strcmp("selected", property))
+ return efl_model_property_set(efl_super(obj, EFL_MODEL_COMPOSITE_SELECTION_CHILDREN_CLASS),
+ property, value);
+
+ vb = efl_model_property_get(obj, "selected");
+ success &= eina_value_bool_get(vb, &prevflag);
+ eina_value_free(vb);
+
+ lvb = eina_value_bool_init(prevflag);
+ success &= eina_value_convert(value, &lvb);
+ success &= eina_value_bool_get(&lvb, &newflag);
+ eina_value_flush(&lvb);
+
+ if (!success)
+ return eina_future_rejected(efl_loop_future_scheduler_get(obj), EFL_MODEL_ERROR_INCORRECT_VALUE);
+
+ // Nothing changed
+ if (newflag == prevflag)
+ return eina_future_resolved(efl_loop_future_scheduler_get(obj),
+ eina_value_bool_init(newflag));
+
+ ve = efl_model_property_get(efl_parent_get(obj), "exclusive");
+ eina_value_bool_get(ve, &exclusive);
+ eina_value_free(ve);
+
+ // First store the new value in the boolean model we inherit from
+ chain = efl_model_property_set(efl_super(obj, EFL_MODEL_COMPOSITE_SELECTION_CHILDREN_CLASS),
+ "selected", value);
+
+ // Now act !
+ if (exclusive)
{
- unsigned long v = EINA_FALSE;
- if(eina_value_type_get(value) != EINA_VALUE_TYPE_ULONG)
+ // We are here either, because we weren't and are after this call
+ // or because we were selected and are not anymore. In the later case,
+ // there is nothing special to do, just normal commit change will do.
+ if (!newflag)
{
- Eina_Value to;
- eina_value_setup(&to, EINA_VALUE_TYPE_ULONG);
- if(eina_value_convert(value, &to))
- eina_value_get(&to, &v);
- eina_value_flush(&to);
+ Efl_Model_Composite_Selection_Data *ppd;
+ Eina_Value *index;
+ unsigned int i = 0;
+
+ index = efl_model_property_get(obj, "child.index");
+ if (!eina_value_uint_get(index, &i))
+ goto commit_change;
+
+ ppd = efl_data_scope_get(efl_parent_get(obj), EFL_MODEL_COMPOSITE_SELECTION_CLASS);
+ if (ppd->last == i && !newflag)
+ ppd->none = EINA_TRUE;
}
else
- eina_value_get(value, &v);
-
- if(v && pd->pd->is_exclusive)
{
- if(pd->pd->exclusive_data.selected_child)
+ Eina_Value *vs;
+ unsigned long selected = 0;
+ Eina_Bool success;
+
+ // In this case we need to first unselect the previously selected one
+ // and then commit the change to this one.
+
+ // Fetch the one to unselect
+ vs = efl_model_property_get(efl_parent_get(obj), "selected");
+ // Check if there was any selected
+ if (eina_value_type_get(vs) == EINA_VALUE_TYPE_ERROR)
{
- // unset current selected
- // set this child as current
- // bookkeep this child as current selection
- // return with future for this asynchronous task
- Eina_Value* false_value = eina_value_new(EINA_VALUE_TYPE_UCHAR);
- eina_value_set(false_value, EINA_FALSE);
- return
- efl_future_then(efl_model_property_set
- (pd->pd->exclusive_data.selected_child,
- property, false_value),
- _exclusive_unselected_then_cb,
- _exclusive_unselected_failed, NULL,
- efl_ref(obj));
+ eina_value_free(vs);
+ goto commit_change;
}
- else
- {
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- Efl_Future *rfuture = efl_promise_future_get(promise);
- Eina_Value* true_value = eina_value_new(EINA_VALUE_TYPE_UCHAR);
- eina_value_set(true_value, EINA_TRUE);
- efl_future_then(efl_model_property_set
- (efl_super(obj, EFL_MODEL_COMPOSITE_SELECTION_CHILDREN_CLASS),
- "selected", true_value),
- _exclusive_future_link_then_cb, _exclusive_future_link_failed,
- NULL, efl_ref(promise));
- return rfuture;
- }
- }
- else
- {
-
+ success = eina_value_ulong_get(vs, &selected);
+ eina_value_free(vs);
+
+ if (!success)
+ return eina_future_rejected(efl_loop_future_scheduler_get(obj),
+ EFL_MODEL_ERROR_INCORRECT_VALUE);
+
+ // There was, need to unselect the previous one along setting the new value
+ chain = eina_future_all(chain,
+ eina_future_then(efl_model_children_slice_get(efl_parent_get(obj), selected, 1),
+ _unselect_slice_then, NULL));
+
+ chain = eina_future_then(chain, _untangle_array, obj);
}
}
- return efl_model_property_set(efl_super(obj, EFL_MODEL_COMPOSITE_SELECTION_CHILDREN_CLASS),
- property, value);
-}
+ commit_change:
+ chain = eina_future_then(chain, _commit_change, obj);
-static Eo* _construct_children(void* pdata, Eo* child)
-{
- Efl_Model_Composite_Selection_Data* pd = pdata;
- Eo* new_child = efl_add(EFL_MODEL_COMPOSITE_SELECTION_CHILDREN_CLASS, NULL);
- Efl_Model_Composite_Selection_Children_Data* data = efl_data_scope_get
- (new_child, EFL_MODEL_COMPOSITE_SELECTION_CHILDREN_CLASS);
- data->pd = pd;
- efl_composite_attach(new_child, efl_ref(child));
- return new_child;
+ return efl_future_Eina_FutureXXX_then(obj, chain);
}
-static void _composited_children_slice_get_then(void* data, Efl_Event const* event)
+typedef struct _Selection_Children_Request Selection_Children_Request;
+struct _Selection_Children_Request
{
- Efl_Future_Event_Success* success = event->info;
- Eina_Accessor* accessor = success->value;
- efl_promise_value_set(success->next,
- efl_model_accessor_view_new(eina_accessor_clone(accessor), &_construct_children,
- data),
- (Eina_Free_Cb)&eina_accessor_free);
-}
-static void _composited_children_slice_get_fail(void* data EINA_UNUSED, Efl_Event const* event)
+ Efl_Model *parent;
+
+ unsigned int start;
+};
+
+static Eina_Value
+_slice_get(void *data,
+ const Eina_Value v,
+ const Eina_Future *dead_future EINA_UNUSED)
{
- Efl_Future_Event_Failure* failure = event->info;
- efl_promise_failed_set(failure->next, failure->error);
+ Selection_Children_Request *req = data;
+ unsigned int length, it;
+ Eo *composited = NULL;
+ Eina_Value r = EINA_VALUE_EMPTY;
+
+ if (v.type == EINA_VALUE_TYPE_ERROR)
+ goto error;
+
+ eina_value_array_setup(&r, EINA_VALUE_TYPE_OBJECT, 4);
+
+ EINA_VALUE_ARRAY_FOREACH(&v, length, it, composited)
+ {
+ Eo *compositing;
+
+ compositing = efl_add(EFL_MODEL_COMPOSITE_SELECTION_CHILDREN_CLASS, req->parent,
+ efl_model_composite_boolean_children_index_set(efl_added, req->start + it),
+ efl_ui_view_model_set(efl_added, composited));
+ eina_value_array_append(&r, compositing);
+ }
+
+ error:
+ efl_unref(req->parent);
+ free(req);
+
+ return r;
}
-static Efl_Future *
-_efl_model_composite_selection_efl_model_children_slice_get(Eo *obj, Efl_Model_Composite_Selection_Data *pd, unsigned int start, unsigned int count)
+static Eina_Future *
+_efl_model_composite_selection_efl_model_children_slice_get(Eo *obj,
+ Efl_Model_Composite_Selection_Data *pd EINA_UNUSED,
+ unsigned int start, unsigned int count)
{
- Efl_Future* composited_future = efl_model_children_slice_get
- (efl_super(obj, EFL_MODEL_COMPOSITE_SELECTION_CLASS),start, count);
- return efl_future_then(composited_future, &_composited_children_slice_get_then,
- &_composited_children_slice_get_fail, NULL, pd);
+ Selection_Children_Request *req;
+ Eina_Future *f;
+
+ req = calloc(1, sizeof (Selection_Children_Request));
+ if (!req) return eina_future_rejected(efl_loop_future_scheduler_get(obj), ENOMEM);
+ req->parent = efl_ref(obj);
+ req->start = start;
+
+ // NOTE: We do jump on purpose EFL_MODEL_COMPOSITE_BOOLEAN_CLASS here
+ f = efl_model_children_slice_get(efl_super(obj, EFL_MODEL_COMPOSITE_BOOLEAN_CLASS),
+ start, count);
+ f = eina_future_then(f, _slice_get, req);
+
+ return efl_future_Eina_FutureXXX_then(obj, f);
}
#include "efl_model_composite_selection.eo.c"
diff --git a/src/lib/ecore/efl_model_composite_selection.eo b/src/lib/ecore/efl_model_composite_selection.eo
index c122de5d82..782a928a64 100644
--- a/src/lib/ecore/efl_model_composite_selection.eo
+++ b/src/lib/ecore/efl_model_composite_selection.eo
@@ -1,23 +1,15 @@
-class Efl.Model.Composite.Selection (Efl.Model.Composite.Boolean)
+class Efl.Model_Composite_Selection (Efl.Model_Composite_Boolean)
{
[[Efl model composite selection class]]
- methods {
- select {
- [[Select composition]]
- params {
- idx: int; [[Index]]
- }
- return: future<any_value>; [[Future on the selected composition]]
- }
- @property exclusive_selection {
- [[Exclusive Selection property]]
- values {
- exclusive: bool; [[$true is selection is exclusive, $flase otherwise]]
- }
- }
- }
implements {
Efl.Object.constructor;
Efl.Model.children_slice_get;
+ Efl.Model.property { get; set; }
+ }
+ events {
+ /* FIXME: The object is emitted in the event_info. This is redundant. */
+ selected: Efl.Object;
+ /* FIXME: The object is emitted in the event_info. This is redundant. */
+ unselected: Efl.Object;
}
}
diff --git a/src/lib/ecore/efl_model_composite_selection_children.eo b/src/lib/ecore/efl_model_composite_selection_children.eo
index 2ea5c950ef..f3a9bd826e 100644
--- a/src/lib/ecore/efl_model_composite_selection_children.eo
+++ b/src/lib/ecore/efl_model_composite_selection_children.eo
@@ -1,7 +1,7 @@
-class Efl.Model.Composite.Selection.Children (Efl.Object, Efl.Model)
+class Efl.Model_Composite_Selection_Children (Efl.Model_Composite_Boolean_Children)
{
[[Efl model composite selection children class]]
implements {
- Efl.Model.property_set;
+ Efl.Model.property { set; }
}
}
diff --git a/src/lib/ecore/efl_model_container.c b/src/lib/ecore/efl_model_container.c
index 71bb9f192b..0832a2f0dc 100644
--- a/src/lib/ecore/efl_model_container.c
+++ b/src/lib/ecore/efl_model_container.c
@@ -7,6 +7,8 @@
#include <Eo.h>
#include <Ecore.h>
+#include "ecore_internal.h"
+
#include "efl_model_container_private.h"
#define MY_CLASS EFL_MODEL_CONTAINER_CLASS
@@ -54,103 +56,107 @@ _values_free(Eina_Array *values, const Eina_Value_Type *type)
eina_array_free(values);
}
-static Eina_Bool
-_stringshared_keys_free(const Eina_Hash *hash EINA_UNUSED, const void *key, void *data EINA_UNUSED, void *fdata EINA_UNUSED)
-{
- eina_stringshare_del(key);
- return EINA_TRUE;
-}
-
static void
_property_data_free_cb(void *data)
{
Child_Property_Data *cpd = data;
- _values_free(cpd->property_values, cpd->property_type);
+ _values_free(cpd->values, cpd->type);
free(cpd);
}
static Efl_Object *
-_efl_model_container_efl_object_constructor(Eo *obj, Efl_Model_Container_Data *sd)
+_efl_model_container_efl_object_constructor(Eo *obj,
+ Efl_Model_Container_Data *sd)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
if (!obj)
return NULL;
sd->obj = obj;
- sd->property_data = eina_hash_stringshared_new(_property_data_free_cb);
- sd->defined_properties = eina_array_new(8);
+ sd->properties = eina_hash_stringshared_new(_property_data_free_cb);
return obj;
}
static void
-_efl_model_container_efl_object_destructor(Eo *obj, Efl_Model_Container_Data *sd)
+_efl_model_container_efl_object_destructor(Eo *obj,
+ Efl_Model_Container_Data *sd)
{
+ Eina_Stringshare *key;
+ Eina_Iterator *it;
Efl_Model *child;
- EINA_LIST_FREE(sd->children, child)
+ EINA_LIST_FREE(sd->childrens, child)
{
- if (child)
- {
- efl_model_container_item_invalidate(child);
- efl_parent_set(child, NULL);
- }
+ if (child) efl_parent_set(child, NULL);
}
- eina_array_free(sd->defined_properties);
+ it = eina_hash_iterator_key_new(sd->properties);
+ EINA_ITERATOR_FOREACH(it, key)
+ eina_stringshare_del(key);
+ eina_iterator_free(it);
- eina_hash_foreach(sd->property_data, _stringshared_keys_free, NULL);
- eina_hash_free(sd->property_data);
+ eina_hash_free(sd->properties);
efl_destructor(efl_super(obj, MY_CLASS));
}
static const Eina_Value_Type *
-_efl_model_container_child_property_value_type_get(Eo *obj EINA_UNUSED, Efl_Model_Container_Data *sd, const char *property)
+_efl_model_container_child_property_value_type_get(Eo *obj EINA_UNUSED,
+ Efl_Model_Container_Data *sd,
+ const char *property)
{
- Eina_Stringshare *sshared = eina_stringshare_add(property);
- Child_Property_Data *cpd = eina_hash_find(sd->property_data, sshared);
- eina_stringshare_del(sshared);
- if (!cpd)
- return NULL;
+ Child_Property_Data *cpd;
+ Eina_Stringshare *key;
+
+ key = eina_stringshare_add(property);
+ cpd = eina_hash_find(sd->properties, key);
+ eina_stringshare_del(key);
- return cpd->property_type;
+ if (!cpd) return NULL;
+ return cpd->type;
}
static Eina_Iterator *
-_efl_model_container_child_property_values_get(Eo *obj EINA_UNUSED, Efl_Model_Container_Data *sd, const char *property)
+_efl_model_container_child_property_values_get(Eo *obj EINA_UNUSED,
+ Efl_Model_Container_Data *sd,
+ const char *property)
{
- Eina_Stringshare *sshared = eina_stringshare_add(property);
- Child_Property_Data *cpd = eina_hash_find(sd->property_data, sshared);
- eina_stringshare_del(sshared);
- if (!cpd)
- return NULL;
+ Child_Property_Data *cpd;
+ Eina_Stringshare *key;
+
+ key = eina_stringshare_add(property);
+ cpd = eina_hash_find(sd->properties, key);
+ eina_stringshare_del(key);
- return eina_array_iterator_new(cpd->property_values);
+ if (!cpd) return NULL;
+ return eina_array_iterator_new(cpd->values);
}
static Eina_Bool
-_efl_model_container_child_property_add(Eo *obj, Efl_Model_Container_Data *sd, const char *name, const Eina_Value_Type *type, Eina_Iterator *values)
+_efl_model_container_child_property_add(Eo *obj,
+ Efl_Model_Container_Data *sd,
+ const char *name,
+ const Eina_Value_Type *type,
+ Eina_Iterator *values)
{
Eina_Array *arr = NULL;
void *data = NULL;
- Eina_Stringshare *prop_name = NULL;
Child_Property_Data *cpd = NULL;
unsigned int i, in_count, children_count;
+ Eina_Error err = EFL_MODEL_ERROR_INCORRECT_VALUE;
+
+ name = eina_stringshare_add(name);
if (!type || !values)
{
EINA_LOG_WARN("Invalid input data");
- eina_error_set(EFL_MODEL_ERROR_INCORRECT_VALUE);
- return EINA_FALSE;
+ goto on_error;
}
- arr = eina_array_new(32);
- if (!arr)
- {
- eina_error_set(EFL_MODEL_ERROR_UNKNOWN);
- return EINA_FALSE;
- }
+ err = ENOMEM;
+ arr = eina_array_new(4);
+ if (!arr) goto on_error;
EINA_ITERATOR_FOREACH(values, data)
{
@@ -159,42 +165,37 @@ _efl_model_container_child_property_add(Eo *obj, Efl_Model_Container_Data *sd, c
{
if (new_data)
_value_free(new_data, type);
- goto error;
+ goto on_error;
}
}
eina_iterator_free(values);
- prop_name = eina_stringshare_add(name);
- cpd = eina_hash_find(sd->property_data, prop_name);
+ err = EFL_MODEL_ERROR_UNKNOWN;
+
+ cpd = eina_hash_find(sd->properties, name);
if (!cpd)
{
cpd = calloc(1, sizeof(Child_Property_Data));
if (!cpd)
- goto error;
-
- cpd->property_type = type;
- cpd->property_values = arr;
+ goto on_error;
- if (!eina_array_push(sd->defined_properties, prop_name))
- goto error;
+ cpd->type = type;
+ cpd->values = arr;
- if (!eina_hash_direct_add(sd->property_data, prop_name, cpd))
- {
- eina_array_pop(sd->defined_properties);
- goto error;
- }
+ if (!eina_hash_direct_add(sd->properties, name, cpd))
+ goto on_error;
}
else
{
- eina_stringshare_del(prop_name);
- _values_free(cpd->property_values, cpd->property_type);
+ eina_stringshare_del(name);
+ _values_free(cpd->values, cpd->type);
- cpd->property_type = type;
- cpd->property_values = arr;
+ cpd->type = type;
+ cpd->values = arr;
}
in_count = eina_array_count(arr);
- children_count = eina_list_count(sd->children);
+ children_count = eina_list_count(sd->childrens);
for (i = children_count; i < in_count; ++i)
{
@@ -203,80 +204,77 @@ _efl_model_container_child_property_add(Eo *obj, Efl_Model_Container_Data *sd, c
child = efl_add(EFL_MODEL_CONTAINER_ITEM_CLASS, obj,
efl_model_container_item_define(efl_added, sd, i));
- sd->children = eina_list_append(sd->children, child);
+ sd->childrens = eina_list_append(sd->childrens, child);
- cevt.child = child;
cevt.index = i;
+
efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILD_ADDED, &cevt);
}
if (in_count > children_count)
- efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, &in_count);
+ efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, NULL);
return EINA_TRUE;
-error:
- if (prop_name)
- eina_stringshare_del(prop_name);
- if (cpd)
- free(cpd);
+ on_error:
+ eina_stringshare_del(name);
+ if (cpd) free(cpd);
if (arr)
_values_free(arr, type);
- eina_error_set(EFL_MODEL_ERROR_UNKNOWN);
+ eina_error_set(err);
return EINA_FALSE;
}
-static const Eina_Array *
-_efl_model_container_efl_model_properties_get(Eo *obj EINA_UNUSED, Efl_Model_Container_Data *sd EINA_UNUSED)
+static Eina_Array *
+_efl_model_container_efl_model_properties_get(const Eo *obj EINA_UNUSED, Efl_Model_Container_Data *sd)
{
- return sd->defined_properties;
-}
+ Eina_Iterator *it;
+ Eina_Array *r;
+ Eina_Stringshare *s;
+ r = eina_array_new(1);
+ it = eina_hash_iterator_key_new(sd->properties);
+ EINA_ITERATOR_FOREACH(it, s)
+ eina_array_push(r, eina_stringshare_ref(s));
+ eina_iterator_free(it);
-Efl_Future *
-_efl_model_container_efl_model_property_set(Eo *obj EINA_UNUSED, Efl_Model_Container_Data *sd EINA_UNUSED, const char *property EINA_UNUSED, const Eina_Value *value EINA_UNUSED)
-{
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- Efl_Future* future = efl_promise_future_get(promise);
-
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_NOT_FOUND);
- return future;
+ return r;
}
-Efl_Future *
-_efl_model_container_efl_model_property_get(Eo *obj EINA_UNUSED, Efl_Model_Container_Data *sd EINA_UNUSED, const char *property EINA_UNUSED)
+static Eina_Future *
+_efl_model_container_efl_model_property_set(Eo *obj,
+ Efl_Model_Container_Data *pd EINA_UNUSED,
+ const char *property EINA_UNUSED,
+ Eina_Value *value EINA_UNUSED)
{
-
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- Efl_Future* future = efl_promise_future_get(promise);
-
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_NOT_FOUND);
- return future;
+ return eina_future_rejected(efl_loop_future_scheduler_get(obj),
+ EFL_MODEL_ERROR_NOT_FOUND);
}
-static Efl_Future *
-_efl_model_container_efl_model_children_slice_get(Eo *obj EINA_UNUSED, Efl_Model_Container_Data *sd, unsigned int start, unsigned int count)
+static Eina_Value *
+_efl_model_container_efl_model_property_get(const Eo *obj EINA_UNUSED,
+ Efl_Model_Container_Data *pd EINA_UNUSED,
+ const char *property EINA_UNUSED)
{
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- Efl_Future* future = efl_promise_future_get(promise);
-
- Eina_Accessor* accessor = efl_model_list_slice(sd->children, start, count);
- efl_promise_value_set(promise, accessor, (Eina_Free_Cb)&eina_accessor_free);
-
- return future;
+ return eina_value_error_new(EFL_MODEL_ERROR_NOT_FOUND);
}
-static Efl_Future *
-_efl_model_container_efl_model_children_count_get(Eo *obj EINA_UNUSED, Efl_Model_Container_Data *sd)
+static Eina_Future *
+_efl_model_container_efl_model_children_slice_get(Eo *obj,
+ Efl_Model_Container_Data *sd,
+ unsigned int start,
+ unsigned int count)
{
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- Efl_Future* future = efl_promise_future_get(promise);
+ Eina_Value v;
- unsigned int *count = calloc(1, sizeof(unsigned int));
- *count = eina_list_count(sd->children);
- efl_promise_value_set(promise, count, &free);
+ v = efl_model_list_value_get(sd->childrens, start, count);
+ return eina_future_resolved(efl_loop_future_scheduler_get(obj), v);
+}
- return future;
+static unsigned int
+_efl_model_container_efl_model_children_count_get(const Eo *obj EINA_UNUSED, Efl_Model_Container_Data *sd)
+{
+ return eina_list_count(sd->childrens);
}
static Eo *
diff --git a/src/lib/ecore/efl_model_container.eo b/src/lib/ecore/efl_model_container.eo
index 5638512923..8f2dc32493 100644
--- a/src/lib/ecore/efl_model_container.eo
+++ b/src/lib/ecore/efl_model_container.eo
@@ -1,12 +1,12 @@
import eina_types;
-class Efl.Model.Container (Efl.Object, Efl.Model)
+class Efl.Model_Container (Efl.Loop_Consumer, Efl.Model)
{
[[
Class used to create data models from Eina containers.
Each container supplied represents a series of property values, each item
- being the property value for a child object (@Efl.Model.Container.Item).
+ being the property value for a child object (@Efl.Model_Container_Item).
The data in the given containers are copied and stored internally.
@@ -50,11 +50,10 @@ class Efl.Model.Container (Efl.Object, Efl.Model)
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Model.properties { get; }
- Efl.Model.property_set;
- Efl.Model.property_get;
+ Efl.Model.property { set; get; }
Efl.Model.child_add;
Efl.Model.child_del;
Efl.Model.children_slice_get;
- Efl.Model.children_count_get;
+ Efl.Model.children_count { get; }
}
}
diff --git a/src/lib/ecore/efl_model_container_item.c b/src/lib/ecore/efl_model_container_item.c
index cb95c2f4db..b87558a3b3 100644
--- a/src/lib/ecore/efl_model_container_item.c
+++ b/src/lib/ecore/efl_model_container_item.c
@@ -10,12 +10,6 @@
#define MY_CLASS EFL_MODEL_CONTAINER_ITEM_CLASS
static void
-_item_value_free_cb(void *data)
-{
- eina_value_free(data);
-}
-
-EOLIAN static void
_efl_model_container_item_define(Eo *obj EINA_UNUSED, Efl_Model_Container_Item_Data *sd, void *parent_data, unsigned int index)
{
sd->parent_data = parent_data;
@@ -23,158 +17,134 @@ _efl_model_container_item_define(Eo *obj EINA_UNUSED, Efl_Model_Container_Item_D
}
EOLIAN static void
-_efl_model_container_item_invalidate(Eo *obj EINA_UNUSED, Efl_Model_Container_Item_Data *sd)
+_efl_model_container_item_efl_object_invalidate(Eo *obj, Efl_Model_Container_Item_Data *sd)
{
+ efl_invalidate(efl_super(obj, MY_CLASS));
+
sd->parent_data = NULL;
sd->index = 0;
}
-EOLIAN static const Eina_Array *
-_efl_model_container_item_efl_model_properties_get(Eo *obj EINA_UNUSED, Efl_Model_Container_Item_Data *sd)
+static Eina_Array *
+_efl_model_container_item_efl_model_properties_get(const Eo *obj EINA_UNUSED, Efl_Model_Container_Item_Data *sd)
{
- if (!sd->parent_data)
+ // FIXME: Not to sure here, shouldn't we extend a child of the parent actually ?
+ return efl_model_properties_get(sd->parent_data->obj);
+}
+
+static Efl_Object *
+_efl_model_container_item_efl_object_finalize(Eo *obj, Efl_Model_Container_Item_Data *pd)
+{
+ if (!pd->parent_data)
return NULL;
- return sd->parent_data->defined_properties;
+ return obj;
}
-Efl_Future *
-_efl_model_container_item_efl_model_property_set(Eo *obj EINA_UNUSED, Efl_Model_Container_Item_Data *sd, const char *property, const Eina_Value *value)
+static Eina_Future *
+_efl_model_container_item_efl_model_property_set(Eo *obj,
+ Efl_Model_Container_Item_Data *sd,
+ const char *property, Eina_Value *value)
{
- Eina_Stringshare *prop_name;
+ Eina_Stringshare *name;
Child_Property_Data *cpd;
+ Eina_Value v = EINA_VALUE_EMPTY;
void *data, *new_data;
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- Efl_Future* future = efl_promise_future_get(promise);
- if (!sd->parent_data)
- {
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_INVALID_OBJECT);
- return future;
- }
- prop_name = eina_stringshare_add(property);
- cpd = eina_hash_find(sd->parent_data->property_data, prop_name);
- eina_stringshare_del(prop_name);
- if (!cpd || !cpd->property_values ||
- sd->index >= eina_array_count_get(cpd->property_values))
- {
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_NOT_FOUND);
- return future;
- }
+ name = eina_stringshare_add(property);
+ cpd = eina_hash_find(sd->parent_data->properties, name);
+ eina_stringshare_del(name);
- if (cpd->property_type != eina_value_type_get(value))
- {
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_INCORRECT_VALUE);
- return future;
- }
+ if (!cpd || !cpd->values ||
+ sd->index >= eina_array_count_get(cpd->values))
+ return eina_future_rejected(efl_loop_future_scheduler_get(obj),
+ EFL_MODEL_ERROR_NOT_FOUND);
- data = calloc(1, cpd->property_type->value_size);
- if (!data || !eina_value_pget(value, data))
- {
- if (data)
- free(data);
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_UNKNOWN);
- return future;
- }
+ eina_value_setup(&v,cpd->type);
+ if (!eina_value_convert(value, &v))
+ return eina_future_rejected(efl_loop_future_scheduler_get(obj),
+ EFL_MODEL_ERROR_INCORRECT_VALUE);
+
+ // FIXME: This is trying to optimize and avoid the use of Eina_Value,
+ // but this put restriction on the type that can be stored in this container.
+ data = calloc(1, cpd->type->value_size);
+ if (!data || !eina_value_pget(&v, data))
+ goto on_error;
- new_data = _value_copy_alloc(data, cpd->property_type);
+ new_data = _value_copy_alloc(data, cpd->type);
+
+ _value_free(eina_array_data_get(cpd->values, sd->index), cpd->type);
+
+ eina_array_data_set(cpd->values, sd->index, new_data);
+
+ free(data);
+
+ return eina_future_resolved(efl_loop_future_scheduler_get(obj), v);
+
+ on_error:
+ eina_value_flush(&v);
free(data);
- _value_free(eina_array_data_get(cpd->property_values, sd->index), cpd->property_type);
- eina_array_data_set(cpd->property_values, sd->index, new_data);
-
- {
- Eina_Value *v = eina_value_new(cpd->property_type);
- if (v && eina_value_copy(value, v))
- efl_promise_value_set(promise, v, _item_value_free_cb);
- else
- {
- if (v)
- eina_value_free(v);
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_UNKNOWN);
- }
- }
-
- return future;
+ return eina_future_rejected(efl_loop_future_scheduler_get(obj),
+ EFL_MODEL_ERROR_UNKNOWN);
}
-Efl_Future *
-_efl_model_container_item_efl_model_property_get(Eo *obj EINA_UNUSED, Efl_Model_Container_Item_Data *sd, const char *property)
+static Eina_Value *
+_efl_model_container_item_efl_model_property_get(const Eo *obj EINA_UNUSED,
+ Efl_Model_Container_Item_Data *sd,
+ const char *property)
{
- Eina_Stringshare *prop_name;
+ Eina_Stringshare *name;
Child_Property_Data *cpd;
Eina_Value *value;
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- Efl_Future* future = efl_promise_future_get(promise);
+ void *data;
+ Eina_Bool r = EINA_FALSE;
- if (!sd->parent_data)
- {
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_INVALID_OBJECT);
- return future;
- }
+ name = eina_stringshare_add(property);
+ cpd = eina_hash_find(sd->parent_data->properties, name);
+ eina_stringshare_del(name);
- prop_name = eina_stringshare_add(property);
- cpd = eina_hash_find(sd->parent_data->property_data, prop_name);
- eina_stringshare_del(prop_name);
- if (!cpd || !cpd->property_values ||
- sd->index >= eina_array_count_get(cpd->property_values))
- {
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_NOT_FOUND);
- return future;
- }
+ if (!cpd || !cpd->values ||
+ sd->index >= eina_array_count_get(cpd->values))
+ return eina_value_error_new(EFL_MODEL_ERROR_NOT_FOUND);
- value = eina_value_new(cpd->property_type);
- if (!value)
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_UNKNOWN);
+ data = eina_array_data_get(cpd->values, sd->index);
+
+ value = eina_value_new(cpd->type);
+ if (cpd->type == EINA_VALUE_TYPE_STRINGSHARE ||
+ cpd->type == EINA_VALUE_TYPE_STRING)
+ r = eina_value_set(value, data);
else
+ r = eina_value_pset(value, data);
+
+ if (!r)
{
- Eina_Bool r = EINA_FALSE;
- void *data = eina_array_data_get(cpd->property_values, sd->index);
-
- if (cpd->property_type == EINA_VALUE_TYPE_STRINGSHARE ||
- cpd->property_type == EINA_VALUE_TYPE_STRING)
- r = eina_value_set(value, data);
- else
- r = eina_value_pset(value, data);
-
- if (r)
- efl_promise_value_set(promise, value, _item_value_free_cb);
- else
- {
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_UNKNOWN);
- eina_value_free(value);
- }
+ eina_value_free(value);
+ value = eina_value_error_new(EFL_MODEL_ERROR_UNKNOWN);
}
- return future;
+ return value;
}
-EOLIAN static Efl_Future *
-_efl_model_container_item_efl_model_children_slice_get(Eo *obj EINA_UNUSED, Efl_Model_Container_Item_Data *sd EINA_UNUSED, unsigned int start EINA_UNUSED, unsigned int count EINA_UNUSED)
+EOLIAN static Eina_Future *
+_efl_model_container_item_efl_model_children_slice_get(Eo *obj,
+ Efl_Model_Container_Item_Data *sd EINA_UNUSED,
+ unsigned int start EINA_UNUSED,
+ unsigned int count EINA_UNUSED)
{
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- Efl_Future* future = efl_promise_future_get(promise);
-
- efl_promise_value_set(promise, NULL, NULL);
-
- return future;
+ return eina_future_resolved(efl_loop_future_scheduler_get(obj), EINA_VALUE_EMPTY);
}
-EOLIAN static Efl_Future *
-_efl_model_container_item_efl_model_children_count_get(Eo *obj EINA_UNUSED, Efl_Model_Container_Item_Data *sd EINA_UNUSED)
+EOLIAN static unsigned int
+_efl_model_container_item_efl_model_children_count_get(const Eo *obj EINA_UNUSED,
+ Efl_Model_Container_Item_Data *sd EINA_UNUSED)
{
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- Efl_Future* future = efl_promise_future_get(promise);
-
- unsigned int *count = calloc(1, sizeof(unsigned int));
- *count = 0;
- efl_promise_value_set(promise, count, &free);
-
- return future;
+ return 0;
}
EOLIAN static Eo *
-_efl_model_container_item_efl_model_child_add(Eo *obj EINA_UNUSED, Efl_Model_Container_Item_Data *sd EINA_UNUSED)
+_efl_model_container_item_efl_model_child_add(Eo *obj EINA_UNUSED,
+ Efl_Model_Container_Item_Data *sd EINA_UNUSED)
{
EINA_LOG_WARN("child_add not supported by Efl.Model.Container.Item");
eina_error_set(EFL_MODEL_ERROR_NOT_SUPPORTED);
@@ -183,7 +153,9 @@ _efl_model_container_item_efl_model_child_add(Eo *obj EINA_UNUSED, Efl_Model_Con
}
EOLIAN static void
-_efl_model_container_item_efl_model_child_del(Eo *obj EINA_UNUSED, Efl_Model_Container_Item_Data *sd EINA_UNUSED, Eo *child EINA_UNUSED)
+_efl_model_container_item_efl_model_child_del(Eo *obj EINA_UNUSED,
+ Efl_Model_Container_Item_Data *sd EINA_UNUSED,
+ Eo *child EINA_UNUSED)
{
EINA_LOG_WARN("child_del not supported by Efl.Model.Container.Item");
eina_error_set(EFL_MODEL_ERROR_NOT_SUPPORTED);
diff --git a/src/lib/ecore/efl_model_container_item.eo b/src/lib/ecore/efl_model_container_item.eo
index 2b881a3f82..f20ae03694 100644
--- a/src/lib/ecore/efl_model_container_item.eo
+++ b/src/lib/ecore/efl_model_container_item.eo
@@ -1,37 +1,32 @@
-import eina_types;
-
-class Efl.Model.Container.Item (Efl.Object, Efl.Model)
+class Efl.Model_Container_Item (Efl.Object, Efl.Model)
{
[[
- Used as a child of @Efl.Model.Container.
+ Used as a child of @Efl.Model_Container.
- Provides the @Efl.Model API for elements of @Efl.Model.Container.
+ Provides the @Efl.Model API for elements of @Efl.Model_Container.
Should not be used in another context, so do not manually create objects
of this class.
]]
methods {
define {
- [[Defines @Efl.Model.Container.Item internal data.]]
+ [[Defines @Efl.Model_Container_Item internal data.]]
params {
parent_data: void_ptr; [[Pointer to the private data of the
- @Efl.Model.Container parent object.]]
- index: uint; [[Index of this item within the @Efl.Model.Container
+ @Efl.Model_Container parent object.]]
+ index: uint; [[Index of this item within the @Efl.Model_Container
children.]]
}
}
- invalidate {
- [[Invalidates the object preventing it from using the given parent
- data.]]
- }
}
implements {
+ Efl.Object.finalize;
Efl.Model.properties { get; }
- Efl.Model.property_set;
- Efl.Model.property_get;
+ Efl.Model.property { set; get; }
Efl.Model.child_add;
Efl.Model.child_del;
Efl.Model.children_slice_get;
- Efl.Model.children_count_get;
+ Efl.Model.children_count { get; }
+ Efl.Object.invalidate;
}
constructors {
.define;
diff --git a/src/lib/ecore/efl_model_container_private.h b/src/lib/ecore/efl_model_container_private.h
index 0a0aad1be6..993a2ac45a 100644
--- a/src/lib/ecore/efl_model_container_private.h
+++ b/src/lib/ecore/efl_model_container_private.h
@@ -4,17 +4,18 @@
typedef struct _Child_Property_Data Child_Property_Data;
struct _Child_Property_Data
{
- const Eina_Value_Type *property_type;
- Eina_Array *property_values;
+ const Eina_Value_Type *type;
+ Eina_Array *values;
};
typedef struct _Efl_Model_Container_Data Efl_Model_Container_Data;
struct _Efl_Model_Container_Data
{
Eo *obj;
- Eina_Hash *property_data;
- Eina_Array *defined_properties;
- Eina_List *children;
+
+ Eina_Hash *properties;
+
+ Eina_List *childrens;
};
diff --git a/src/lib/ecore/efl_model_item.c b/src/lib/ecore/efl_model_item.c
index 571f3e4131..e5058c10ff 100644
--- a/src/lib/ecore/efl_model_item.c
+++ b/src/lib/ecore/efl_model_item.c
@@ -5,6 +5,8 @@
#include <Efl.h>
#include <Ecore.h>
+#include "ecore_internal.h"
+
#define MY_CLASS EFL_MODEL_ITEM_CLASS
typedef struct _Efl_Model_Item_Data Efl_Model_Item_Data;
@@ -12,7 +14,7 @@ struct _Efl_Model_Item_Data
{
Eina_Hash *properties;
Eina_Array *defined_properties;
- Eina_List *children;
+ Eina_List *childrens;
};
static void
@@ -46,7 +48,7 @@ _efl_model_item_efl_object_destructor(Eo *obj, Efl_Model_Item_Data *sd)
{
Efl_Model *child;
- EINA_LIST_FREE(sd->children, child)
+ EINA_LIST_FREE(sd->childrens, child)
{
if (child)
efl_parent_set(child, NULL);
@@ -60,146 +62,143 @@ _efl_model_item_efl_object_destructor(Eo *obj, Efl_Model_Item_Data *sd)
efl_destructor(efl_super(obj, MY_CLASS));
}
-EOLIAN static const Eina_Array *
-_efl_model_item_efl_model_properties_get(Eo *obj EINA_UNUSED, Efl_Model_Item_Data *sd)
+static Eina_Array *
+_efl_model_item_efl_model_properties_get(const Eo *obj EINA_UNUSED, Efl_Model_Item_Data *pd)
{
- return sd->defined_properties;
+ return pd->defined_properties;
}
-
-static Efl_Future*
-_efl_model_item_efl_model_property_set(Eo *obj EINA_UNUSED, Efl_Model_Item_Data *sd, const char *property, const Eina_Value *value)
+static Eina_Future *
+_efl_model_item_efl_model_property_set(Eo *obj, Efl_Model_Item_Data *pd, const char *property, Eina_Value *value)
{
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- Efl_Future* future = efl_promise_future_get(promise);
+ Eina_Stringshare *prop;
+ Eina_Value *exist;
Efl_Model_Property_Event evt;
- Eina_Stringshare *sshared = eina_stringshare_add(property);
- Eina_Value *p_v = eina_hash_find(sd->properties, sshared);
- if (p_v)
+ prop = eina_stringshare_add(property);
+ exist = eina_hash_find(pd->properties, prop);
+
+ if (!exist)
{
- eina_stringshare_del(sshared);
- if (!eina_value_copy(value, p_v))
- goto err1;
+ exist = eina_value_new(eina_value_type_get(value));
+ if (!exist)
+ goto value_failed;
+
+ if (!eina_hash_direct_add(pd->properties, eina_stringshare_ref(prop), exist))
+ goto hash_failed;
}
- else
- {
- if (!eina_array_push(sd->defined_properties, sshared))
- goto err2;
- p_v = eina_value_new(eina_value_type_get(value));
- if (!p_v)
- goto err3;
+ if (!eina_value_copy(value, exist))
+ goto value_failed;
- if (!eina_value_copy(value, p_v) ||
- !eina_hash_direct_add(sd->properties, sshared, p_v))
- goto err4;
- }
+ {
+ char *v = eina_value_to_string(value);
+ char *e = eina_value_to_string(exist);
+
+ free(v);
+ free(e);
+ }
- efl_promise_value_set(promise, p_v, NULL);
+ eina_stringshare_del(prop);
+
+ evt.changed_properties = eina_array_new(1);
+ eina_array_push(evt.changed_properties, prop);
- evt.changed_properties = eina_array_new(20);
- eina_array_push(evt.changed_properties, property);
efl_event_callback_call(obj, EFL_MODEL_EVENT_PROPERTIES_CHANGED, &evt);
+
eina_array_free(evt.changed_properties);
- return future;
-
-err4:
- eina_value_free(p_v);
-err3:
- eina_array_pop(sd->defined_properties);
-err2:
- eina_stringshare_del(sshared);
-err1:
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_UNKNOWN);
- return future;
-}
+ return eina_future_resolved(efl_loop_future_scheduler_get(obj),
+ eina_value_reference_copy(value));
-static Efl_Future *
-_efl_model_item_efl_model_property_get(Eo *obj EINA_UNUSED, Efl_Model_Item_Data *sd, const char *property)
-{
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- Efl_Future *rfuture = efl_promise_future_get(promise);
-
- Eina_Stringshare *sshare = eina_stringshare_add(property);
- Eina_Value *p_v = eina_hash_find(sd->properties, sshare);
- eina_stringshare_del(sshare);
- if (p_v)
- efl_promise_value_set(promise, p_v, NULL);
- else
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_NOT_FOUND);
-
- return rfuture;
+ hash_failed:
+ eina_value_free(exist);
+ value_failed:
+ eina_stringshare_del(prop);
+
+ return eina_future_rejected(efl_loop_future_scheduler_get(obj),
+ ENOMEM);
}
-static Efl_Future *
-_efl_model_item_efl_model_children_slice_get(Eo *obj EINA_UNUSED, Efl_Model_Item_Data *sd, unsigned int start, unsigned int count)
+static Eina_Value *
+_efl_model_item_efl_model_property_get(const Eo *obj EINA_UNUSED,
+ Efl_Model_Item_Data *pd,
+ const char *property)
{
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- Efl_Future *rfuture = efl_promise_future_get(promise);
+ Eina_Stringshare *prop;
+ Eina_Value *value;
+
+ prop = eina_stringshare_add(property);
+ value = eina_hash_find(pd->properties, prop);
+ eina_stringshare_del(prop);
- Eina_Accessor* accessor = efl_model_list_slice(sd->children, start, count);
- efl_promise_value_set(promise, accessor, (Eina_Free_Cb)&eina_accessor_free);
+ if (!value)
+ return eina_value_error_new(EFL_MODEL_ERROR_NOT_FOUND);
- return rfuture;
+ return eina_value_dup(value);
}
-static Efl_Future *
-_efl_model_item_efl_model_children_count_get(Eo *obj EINA_UNUSED, Efl_Model_Item_Data *sd)
+static Eina_Future *
+_efl_model_item_efl_model_children_slice_get(Eo *obj, Efl_Model_Item_Data *pd, unsigned int start, unsigned int count)
{
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- Efl_Future *rfuture = efl_promise_future_get(promise);
+ Eina_Value v;
- unsigned int *count = calloc(1, sizeof(unsigned int));
- *count = eina_list_count(sd->children);
- efl_promise_value_set(promise, count, &free);
+ v = efl_model_list_value_get(pd->childrens, start, count);
+ return eina_future_resolved(efl_loop_future_scheduler_get(obj), v);
+}
- return rfuture;
+static unsigned int
+_efl_model_item_efl_model_children_count_get(const Eo *obj EINA_UNUSED, Efl_Model_Item_Data *pd)
+{
+ return eina_list_count(pd->childrens);
}
static Eo *
_efl_model_item_efl_model_child_add(Eo *obj, Efl_Model_Item_Data *sd)
{
Efl_Model_Children_Event cevt;
- Efl_Model *child = efl_add(EFL_MODEL_ITEM_CLASS, obj);
+ Efl_Model *child;
+
+ child = efl_add(EFL_MODEL_ITEM_CLASS, obj);
if (!child)
{
EINA_LOG_ERR("Could not allocate Efl.Model.Item");
eina_error_set(EFL_MODEL_ERROR_UNKNOWN);
return NULL;
}
- cevt.index = eina_list_count(sd->children);
- sd->children = eina_list_append(sd->children, child);
- cevt.child = child;
+
+ cevt.index = eina_list_count(sd->childrens);
+ sd->childrens = eina_list_append(sd->childrens, child);
+
efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILD_ADDED, &cevt);
- efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, &cevt.index);
+ efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, NULL);
+
return child;
}
static void
_efl_model_item_efl_model_child_del(Eo *obj, Efl_Model_Item_Data *sd, Eo *child)
{
- Eina_List *l;
Efl_Model *data;
+ Eina_List *l;
unsigned int i = 0;
- EINA_LIST_FOREACH(sd->children, l, data)
+
+ EINA_LIST_FOREACH(sd->childrens, l, data)
{
if (data == child)
{
Efl_Model_Children_Event cevt;
- sd->children = eina_list_remove_list(sd->children, l);
- cevt.child = efl_ref(child);
+ sd->childrens = eina_list_remove_list(sd->childrens, l);
+
cevt.index = i;
+ efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILD_REMOVED, &cevt);
+
efl_parent_set(child, NULL);
- efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILD_REMOVED, &cevt);
- efl_unref(child);
+ efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, NULL);
- i = eina_list_count(sd->children);
- efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, &i);
break;
}
++i;
diff --git a/src/lib/ecore/efl_model_item.eo b/src/lib/ecore/efl_model_item.eo
index 622cd249cb..56f6c89782 100644
--- a/src/lib/ecore/efl_model_item.eo
+++ b/src/lib/ecore/efl_model_item.eo
@@ -1,6 +1,4 @@
-import eina_types;
-
-class Efl.Model.Item (Efl.Object, Efl.Model)
+class Efl.Model_Item (Efl.Object, Efl.Model)
{
[[
Generic model that allows any property to be manually set.
@@ -16,11 +14,10 @@ class Efl.Model.Item (Efl.Object, Efl.Model)
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Model.properties { get; }
- Efl.Model.property_set;
- Efl.Model.property_get;
+ Efl.Model.property { set; get; }
Efl.Model.child_add;
Efl.Model.child_del;
Efl.Model.children_slice_get;
- Efl.Model.children_count_get;
+ Efl.Model.children_count { get; }
}
}
diff --git a/src/lib/ecore/efl_promise.c b/src/lib/ecore/efl_promise.c
deleted file mode 100644
index 3e522b4564..0000000000
--- a/src/lib/ecore/efl_promise.c
+++ /dev/null
@@ -1,1423 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <Ecore.h>
-
-#include "ecore_private.h"
-
-typedef struct _Efl_Promise_Data Efl_Promise_Data;
-typedef struct _Efl_Promise_Msg Efl_Promise_Msg;
-
-struct _Efl_Promise_Msg
-{
- EINA_REFCOUNT;
-
- void *value;
- Eina_Free_Cb free_cb;
-
- Eina_Error error;
-};
-
-struct _Efl_Promise_Data
-{
- Eo *loop;
- Efl_Loop_Data *loop_data;
- Efl_Promise *promise;
- Efl_Promise_Msg *message;
- Eina_List *futures;
-
- unsigned char propagating;
-
- struct {
- Eina_Bool future : 1;
- Eina_Bool future_triggered : 1;
- Eina_Bool progress : 1;
- Eina_Bool progress_triggered : 1;
- } set;
-
- Eina_Bool optional : 1;
- Eina_Bool propagated : 1;
- Eina_Bool nodelay : 1;
-};
-
-static void
-_efl_promise_msg_free(Efl_Promise_Msg *msg)
-{
- if (!msg) return ;
- if (msg->free_cb)
- msg->free_cb(msg->value);
- free(msg);
-}
-
-#define EFL_LOOP_FUTURE_CLASS efl_loop_future_class_get()
-static const Efl_Class *efl_loop_future_class_get(void);
-
-typedef struct _Efl_Loop_Future_Data Efl_Loop_Future_Data;
-typedef struct _Efl_Loop_Future_Callback Efl_Loop_Future_Callback;
-
-struct _Efl_Loop_Future_Callback
-{
- EINA_INLIST;
-
- Efl_Event_Cb success;
- Efl_Event_Cb failure;
- Efl_Event_Cb progress;
-
- Efl_Promise *next;
-
- const void *data;
-};
-
-struct _Efl_Loop_Future_Data
-{
- Eina_Inlist *callbacks;
-
- Efl_Future *self;
- Efl_Loop *loop;
- Efl_Promise_Msg *message;
- Efl_Promise_Data *promise;
-
-#ifndef NDEBUG
- int wref;
-#endif
- unsigned char propagating;
-
- Eina_Bool fulfilled : 1;
- Eina_Bool death : 1;
- Eina_Bool delayed : 1;
- Eina_Bool optional : 1;
-};
-
-static void
-_efl_loop_future_success(Efl_Event *ev, Efl_Loop_Future_Data *pd, void *value)
-{
- Efl_Loop_Future_Callback *cb;
- Efl_Future_Event_Success chain_success;
-
- ev->info = &chain_success;
- ev->desc = EFL_FUTURE_EVENT_SUCCESS;
-
- chain_success.value = value;
-
- pd->propagating++;
- // This is done on purpose, we are using cb as a reminder to the head of the list
- while ((cb = (void*) pd->callbacks))
- {
- // Remove callback early to avoid double execution while
- // doing recursive call
- pd->callbacks = eina_inlist_remove(pd->callbacks, pd->callbacks);
-
- if (cb->next)
- {
- chain_success.next = cb->next;
-
- if (cb->success) cb->success((void*) cb->data, ev);
- }
- else
- {
- chain_success.next = NULL;
- chain_success.value = pd->message;
- if (cb->success) cb->success((void*) cb->data, ev);
- chain_success.value = value;
- }
-
- free(cb);
- }
- pd->propagating--;
-}
-
-static void
-_efl_loop_future_failure(Efl_Event *ev, Efl_Loop_Future_Data *pd, Eina_Error error)
-{
- Efl_Loop_Future_Callback *cb;
- Efl_Future_Event_Failure chain_fail;
-
- ev->info = &chain_fail;
- ev->desc = EFL_FUTURE_EVENT_FAILURE;
-
- chain_fail.error = error;
-
- pd->propagating++;
- // This is done on purpose, we are using cb as a reminder to the head of the list
- while ((cb = (void*) pd->callbacks))
- {
- // Remove callback early to avoid double execution while
- // doing recursive call
- pd->callbacks = eina_inlist_remove(pd->callbacks, pd->callbacks);
-
- chain_fail.next = cb->next;
-
- if (cb->failure) cb->failure((void*) cb->data, ev);
-
- free(cb);
- }
- pd->propagating--;
-}
-
-static void
-_efl_loop_future_propagate_force(Eo *obj, Efl_Loop_Future_Data *pd)
-{
- Efl_Event ev;
-
- ev.object = obj;
-
- if (pd->promise->message->error == 0)
- {
- _efl_loop_future_success(&ev, pd, pd->message->value);
- }
- else
- {
- _efl_loop_future_failure(&ev, pd, pd->message->error);
- }
-}
-
-static void
-_efl_loop_future_propagate(Eo *obj, Efl_Loop_Future_Data *pd)
-{
- Efl_Event ev;
- Eina_Bool cancel;
-
- ev.object = obj;
- cancel = pd->fulfilled && !pd->message;
-
- // This has to be done early on to avoid recursive success/failure to
- // bypass the fulfilled check.
- pd->fulfilled = EINA_TRUE;
-
- if (cancel)
- {
- _efl_loop_future_failure(&ev, pd, EINA_ERROR_FUTURE_CANCEL);
- }
- else if (pd->message->error == 0)
- {
- _efl_loop_future_success(&ev, pd, pd->message->value);
- }
- else
- {
- _efl_loop_future_failure(&ev, pd, pd->message->error);
- }
-
- if (!pd->delayed)
- {
- pd->delayed = EINA_TRUE;
- efl_unref(obj);
- }
-}
-
-static void
-_efl_loop_future_fulfilling(Eo *obj, Efl_Loop_Future_Data *pd)
-{
- if (pd->fulfilled)
- {
- _efl_loop_future_propagate(obj, pd);
- }
-
- if (!pd->death)
- {
- pd->death = EINA_TRUE;
- efl_del(obj);
- }
-}
-
-static void
-_efl_loop_future_prepare_events(Efl_Loop_Future_Data *pd, Eina_Bool progress, Eina_Bool optional)
-{
- if (!pd->promise) return ;
-
- if (pd->optional)
- {
- pd->optional = EINA_FALSE;
- ecore_loop_future_unregister(efl_provider_find(pd->self, EFL_LOOP_CLASS), pd->self);
- }
-
- if (!optional)
- {
- pd->promise->set.future = EINA_TRUE;
- if (progress)
- pd->promise->set.progress = EINA_TRUE;
- }
-}
-
-static Efl_Loop_Future_Callback *
-_efl_loop_future_then_internal(Efl_Loop_Future_Data *pd,
- Efl_Event_Cb success, Efl_Event_Cb failure, Efl_Event_Cb progress, const void *data)
-{
- Efl_Loop_Future_Callback *cb;
-
- cb = calloc(1, sizeof (Efl_Loop_Future_Callback));
- if (!cb) return NULL;
-
- cb->success = success;
- cb->failure = failure;
- cb->progress = progress;
- cb->data = data;
- pd->callbacks = eina_inlist_append(pd->callbacks, EINA_INLIST_GET(cb));
-
- return cb;
-}
-
-static Efl_Future *
-_efl_loop_future_then(Eo *obj, Efl_Loop_Future_Data *pd,
- Efl_Event_Cb success, Efl_Event_Cb failure, Efl_Event_Cb progress, const void *data)
-{
- Efl_Loop_Future_Callback *cb;
- Efl_Promise_Data *epd;
- Efl_Future *f;
-
- cb = _efl_loop_future_then_internal(pd, success, failure, progress, data);
- if (!cb) return NULL;
-
- efl_ref(obj);
-
- cb->next = efl_add(EFL_PROMISE_CLASS, obj);
- epd = efl_data_scope_get(cb->next, EFL_PROMISE_CLASS);
- epd->optional = EINA_TRUE;
-
- f = efl_promise_future_get(cb->next);
-
- _efl_loop_future_prepare_events(pd, !!progress, EINA_FALSE);
- _efl_loop_future_fulfilling(obj, pd);
-
- efl_unref(obj);
-
- return f;
-}
-
-static Eina_Bool
-_efl_loop_future_internal_then(Efl_Future *f,
- Efl_Event_Cb success, Efl_Event_Cb failure, Efl_Event_Cb progress, const void *data)
-{
- Efl_Loop_Future_Data *pd = efl_data_scope_get(f, EFL_LOOP_FUTURE_CLASS);
- Efl_Loop_Future_Callback *cb;
-
- cb = _efl_loop_future_then_internal(pd, success, failure, progress, data);
- if (!cb) return EINA_FALSE;
-
- efl_ref(f);
-
- _efl_loop_future_prepare_events(pd, !!progress, EINA_TRUE);
- _efl_loop_future_fulfilling(f, pd);
-
- efl_unref(f);
-
- return EINA_TRUE;
-}
-
-static void
-_efl_loop_future_disconnect(Eo *obj, Efl_Loop_Future_Data *pd)
-{
- Eo *promise;
-
- if (!pd->promise) return ;
- promise = efl_ref(pd->promise->promise);
-
- // Disconnect from the promise
- pd->promise->futures = eina_list_remove(pd->promise->futures, pd);
-
- // Notify that there is no more future
- if (!pd->promise->futures &&
- !pd->promise->message)
- {
- efl_event_callback_call(pd->promise->promise, EFL_PROMISE_EVENT_FUTURE_NONE, NULL);
- }
-
- // Unreference after propagating the failure
- efl_data_xunref(pd->promise->promise, pd->promise, obj);
- pd->promise = NULL;
-
- efl_unref(promise);
-}
-
-static void
-_efl_loop_future_cancel(Eo *obj, Efl_Loop_Future_Data *pd)
-{
- // We do allow for calling cancel during the propagation phase
- // as the other proper fix is to wype out all future reference before
- // starting propagating things.
- if (pd->propagating ||
- (pd->promise && pd->promise->propagating))
- {
- efl_ref(obj);
-
- _efl_loop_future_propagate_force(obj, pd);
-
- goto disconnect;
- }
-
- // Check state
- if (pd->fulfilled)
- {
- ERR("Triggering cancel on an already fulfilled Efl.Future.");
- return;
- }
-
-#ifndef NDEBUG
- if (!pd->wref)
- {
- WRN("Calling cancel should be only done on a weak reference. Look at efl_future_use.");
- }
-#endif
-
- pd->fulfilled = EINA_TRUE;
-
- // Trigger failure
- efl_ref(obj);
-
- _efl_loop_future_propagate(obj, pd);
-
- _efl_loop_future_disconnect(obj, pd);
-
- disconnect:
- efl_unref(obj);
-}
-
-static void
-_efl_loop_future_intercept(Eo *obj)
-{
- Efl_Loop_Future_Data *pd;
-
- // Just delay object death
- efl_del_intercept_set(obj, NULL);
-
- // Trigger events now
- pd = efl_data_scope_get(obj, EFL_LOOP_FUTURE_CLASS);
-
- if (!pd->promise) return ;
- if (pd->promise->set.future && !pd->promise->set.future_triggered)
- {
- efl_event_callback_call(pd->promise->promise, EFL_PROMISE_EVENT_FUTURE_SET, obj);
- pd->promise->set.future_triggered = EINA_TRUE;
- }
- if (pd->promise->set.progress && !pd->promise->set.progress_triggered)
- {
- efl_event_callback_call(pd->promise->promise, EFL_PROMISE_EVENT_FUTURE_PROGRESS_SET, obj);
- pd->promise->set.progress_triggered = EINA_TRUE;
- }
-}
-
-static Eo *
-_efl_loop_future_efl_object_constructor(Eo *obj, Efl_Loop_Future_Data *pd)
-{
- obj = efl_constructor(efl_super(obj, EFL_LOOP_FUTURE_CLASS));
-
- pd->loop = efl_ref(efl_provider_find(obj, EFL_LOOP_CLASS));
-
- pd->self = obj;
- pd->optional = EINA_TRUE;
-
- ecore_loop_future_register(efl_provider_find(obj, EFL_LOOP_CLASS), obj);
-
- efl_del_intercept_set(obj, _efl_loop_future_intercept);
-
- return obj;
-}
-
-static void
-_efl_loop_future_efl_object_destructor(Eo *obj, Efl_Loop_Future_Data *pd)
-{
- Eo *promise = NULL;
-
- if (!pd->fulfilled)
- {
- ERR("Lost reference to a future without fulfilling it. Forcefully cancelling it.");
- _efl_loop_future_propagate(obj, pd);
- }
-#ifndef NDEBUG
- else if (pd->callbacks)
- {
- ERR("Found referenced callbacks while destroying the future.");
- _efl_loop_future_propagate(obj, pd);
- }
-#endif
-
- // Cleanup message if needed
- if (pd->message)
- {
- EINA_REFCOUNT_UNREF(pd->message)
- _efl_promise_msg_free(pd->message);
- pd->message = NULL;
- }
-
- // Stop the main loop handler that would destroy this optional future
- if (pd->optional)
- {
- pd->optional = EINA_FALSE;
- ecore_loop_future_unregister(efl_provider_find(pd->self, EFL_LOOP_CLASS), pd->self);
- }
-
- if (pd->promise) promise = efl_ref(pd->promise->promise);
-
- efl_destructor(efl_super(obj, EFL_LOOP_FUTURE_CLASS));
-
- // Disconnect from the promise
- _efl_loop_future_disconnect(obj, pd);
-
- efl_unref(promise);
-
- efl_unref(pd->loop);
-}
-
-#ifndef NDEBUG
-static void
-_efl_future_wref_add(Eo *obj, Efl_Loop_Future_Data *pd, Eo **wref)
-{
- efl_wref_add(efl_super(obj, EFL_LOOP_FUTURE_CLASS), wref);
-
- pd->wref++;
-}
-
-static void
-_efl_future_wref_del(Eo *obj, Efl_Loop_Future_Data *pd, Eo **wref)
-{
- efl_wref_del(efl_super(obj, EFL_LOOP_FUTURE_CLASS), wref);
-
- pd->wref--;
-}
-#endif
-
-static Efl_Object *
-_efl_loop_future_efl_object_provider_find(Eo *obj EINA_UNUSED, Efl_Loop_Future_Data *pd, const Efl_Object *klass)
-{
- Efl_Object *r = NULL;
-
- if (pd->loop) r = efl_provider_find(pd->loop, klass);
- if (r) return r;
-
- return efl_provider_find(efl_super(obj, EFL_LOOP_FUTURE_CLASS), klass);
-}
-
-static Eina_Bool
-_efl_loop_future_class_initializer(Efl_Class *klass)
-{
- EFL_OPS_DEFINE(ops,
-#ifndef NDEBUG
- EFL_OBJECT_OP_FUNC(efl_wref_add, _efl_future_wref_add),
- EFL_OBJECT_OP_FUNC(efl_wref_del, _efl_future_wref_del),
-#endif
- EFL_OBJECT_OP_FUNC(efl_provider_find, _efl_loop_future_efl_object_provider_find),
- EFL_OBJECT_OP_FUNC(efl_future_then, _efl_loop_future_then),
- EFL_OBJECT_OP_FUNC(efl_future_cancel, _efl_loop_future_cancel),
- EFL_OBJECT_OP_FUNC(efl_constructor, _efl_loop_future_efl_object_constructor),
- EFL_OBJECT_OP_FUNC(efl_destructor, _efl_loop_future_efl_object_destructor));
-
- return efl_class_functions_set(klass, &ops, NULL);
-};
-
-static const Efl_Class_Description _efl_loop_future_class_desc = {
- EO_VERSION,
- "Efl.Future",
- EFL_CLASS_TYPE_REGULAR,
- sizeof (Efl_Loop_Future_Data),
- _efl_loop_future_class_initializer,
- NULL,
- NULL
-};
-
-EFL_DEFINE_CLASS(efl_loop_future_class_get, &_efl_loop_future_class_desc, EFL_FUTURE_CLASS, NULL);
-
-static Efl_Future *
-_efl_promise_future_get(Eo *obj, Efl_Promise_Data *pd EINA_UNUSED)
-{
- Efl_Future *f;
- Efl_Loop_Future_Data *fd;
-
- // Build a new future, attach it and return it
- f = efl_add(EFL_LOOP_FUTURE_CLASS, obj);
- if (!f) return NULL;
-
- fd = efl_data_scope_get(f, EFL_LOOP_FUTURE_CLASS);
-
- fd->promise = efl_data_xref(obj, EFL_PROMISE_CLASS, f);
- fd->promise->futures = eina_list_append(fd->promise->futures, fd);
-
- // The promise has already been fulfilled, prepare the propagation
- if (fd->promise->message &&
- fd->promise->propagated)
- {
- fd->message = fd->promise->message;
- EINA_REFCOUNT_REF(fd->message);
-
- _efl_loop_future_propagate(f, fd);
- }
-
- return f;
-}
-
-static Efl_Promise_Msg *
-_efl_promise_message_new(Efl_Promise_Data *pd)
-{
- Efl_Promise_Msg *message;
-
- message = calloc(1, sizeof (Efl_Promise_Msg));
- if (!message) return NULL;
-
- EINA_REFCOUNT_INIT(message);
- pd->message = message;
-
- return message;
-}
-
-static void
-_efl_promise_propagate(Eo *obj, Efl_Promise_Data *pd)
-{
- Efl_Loop_Future_Data *f;
- Eina_List *l, *ln;
-
- pd->propagated = EINA_TRUE;
-
- // By triggering this message, we are likely going to kill all future
- // And a user of the promise may want to attach an event handler on the promise
- // and destroy it, so delay that to after the loop is done.
- efl_ref(obj);
-
- // Send it to all futures
- pd->propagating++;
- EINA_LIST_FOREACH_SAFE(pd->futures, l, ln, f)
- {
- EINA_REFCOUNT_REF(pd->message);
- f->message = pd->message;
-
- // Trigger the callback
- _efl_loop_future_propagate(f->self, f);
- }
- pd->propagating--;
-
- // Now, we may die.
- efl_unref(obj);
-}
-
-void
-ecore_loop_promise_fulfill(Eo *obj)
-{
- Efl_Promise_Data *pd = efl_data_scope_get(obj, EFL_PROMISE_CLASS);
- _efl_promise_propagate(obj, pd);
-}
-
-static void
-_efl_promise_value_set(Eo *obj, Efl_Promise_Data *pd, void *v, Eina_Free_Cb free_cb)
-{
- Efl_Promise_Msg *message;
-
- if (pd->message)
- {
- ERR("This promise has already been fulfilled. You can can't set a value twice nor can you set a value after it has been cancelled.");
- return ;
- }
-
- // Create a refcounted structure where refcount == number of future + one
- message = _efl_promise_message_new(pd);
- if (!message) return ;
-
- message->value = v;
- message->free_cb = free_cb;
-
- EINA_REFCOUNT_INIT(message);
- pd->message = message;
-
- if (pd->nodelay)
- _efl_promise_propagate(obj, pd);
- else
- ecore_loop_promise_register(efl_provider_find(obj, EFL_LOOP_CLASS), obj);
-}
-
-static void
-_efl_promise_failed_set(Eo *obj, Efl_Promise_Data *pd, Eina_Error err)
-{
- Efl_Promise_Msg *message;
-
- if (pd->message)
- {
- ERR("This promise has already been fulfilled. You can can't set a value twice nor can you set a value after it has been cancelled.");
- return ;
- }
- // Create a refcounted structure where refcount == number of future + one
- message = _efl_promise_message_new(pd);
- if (!message) return ;
-
- message->error = err;
-
- EINA_REFCOUNT_INIT(message);
- pd->message = message;
-
- if (pd->nodelay)
- _efl_promise_propagate(obj, pd);
- else
- ecore_loop_promise_register(efl_provider_find(obj, EFL_LOOP_CLASS), obj);
-}
-
-static void
-_efl_promise_progress_set(Eo *obj, Efl_Promise_Data *pd, const void *p)
-{
- Efl_Loop_Future_Data *f;
- Eina_List *l, *ln;
- Efl_Future_Event_Progress chain_progress;
- Efl_Event ev;
-
- chain_progress.progress = p;
-
- ev.object = obj;
- ev.info = &chain_progress;
- ev.desc = EFL_FUTURE_EVENT_PROGRESS;
-
- EINA_LIST_FOREACH_SAFE(pd->futures, l, ln, f)
- {
- Efl_Loop_Future_Callback *cb;
-
- EINA_INLIST_FOREACH(f->callbacks, cb)
- {
- if (cb->next)
- {
- chain_progress.next = cb->next;
-
- if (cb->progress) cb->progress((void*) cb->data, &ev);
- }
- }
- }
-}
-
-static void
-_efl_promise_loop_clear(Eo *obj, Efl_Promise_Data *pd)
-{
- pd->nodelay = EINA_TRUE;
-
- // Unref refcounted structure
- if (!pd->message && pd->futures)
- {
- if (!pd->optional) ERR("This promise has not been fulfilled. Forcefully cancelling %p.", obj);
- efl_promise_failed_set(obj, EINA_ERROR_FUTURE_CANCEL);
- }
-
- if (pd->message &&
- !pd->propagated)
- {
- ecore_loop_promise_unregister(pd->loop, obj);
- _efl_promise_propagate(obj, pd);
- }
-
- if (pd->message)
- {
- EINA_REFCOUNT_UNREF(pd->message)
- _efl_promise_msg_free(pd->message);
- pd->message = NULL;
- }
-}
-
-static void
-_efl_promise_efl_object_parent_set(Eo *obj, Efl_Promise_Data *pd, Efl_Object *parent)
-{
- if (!parent) _efl_promise_loop_clear(obj, pd);
- efl_parent_set(efl_super(obj, EFL_PROMISE_CLASS), parent);
- pd->loop = efl_provider_find(obj, EFL_LOOP_CLASS);
- pd->loop_data = efl_data_scope_get(pd->loop, EFL_LOOP_CLASS);
-}
-
-static Efl_Object *
-_efl_promise_efl_object_constructor(Eo *obj, Efl_Promise_Data *pd)
-{
- pd->promise = obj;
- return efl_constructor(efl_super(obj, EFL_PROMISE_CLASS));
-}
-
-static void
-_efl_promise_efl_object_destructor(Eo *obj, Efl_Promise_Data *pd)
-{
- _efl_promise_loop_clear(obj, pd);
- efl_destructor(efl_super(obj, EFL_PROMISE_CLASS));
-}
-
-static void
-_efl_promise_connect_then(void *data, const Efl_Event *ev)
-{
- Efl_Future_Event_Success *success = ev->info;
- Efl_Promise_Data *pd = data;
- // This is a trick due to the fact we are using internal function call to register this functions
- Efl_Promise_Msg *d = success->value;
-
- EINA_REFCOUNT_REF(d);
- pd->message = d;
-
- _efl_promise_propagate(pd->promise, pd);
-
- efl_unref(pd->promise);
-}
-
-static void
-_efl_promise_connect_fail(void *data, const Efl_Event *ev)
-{
- Efl_Future_Event_Failure *fail = ev->info;
- Efl_Promise_Data *pd = data;
-
- efl_promise_failed_set(pd->promise, fail->error);
-
- efl_unref(pd->promise);
-}
-
-static Eina_Bool
-_efl_promise_connect(Eo *obj, Efl_Promise_Data *pd, Efl_Future *f)
-{
- // We have to keep a reference on the promise to avoid it dying before the future
- efl_ref(obj);
-
- return _efl_loop_future_internal_then(f, _efl_promise_connect_then, _efl_promise_connect_fail, NULL, pd);
-}
-
-typedef struct _Efl_Promise_Composite Efl_Promise_All;
-typedef struct _Efl_Future_All Efl_Future_All;
-typedef struct _Efl_Accessor_All Efl_Accessor_All;
-
-typedef struct _Efl_Promise_Composite Efl_Promise_Race;
-
-struct _Efl_Accessor_All
-{
- Eina_Accessor accessor;
-
- Efl_Promise_All *all;
- Efl_Promise *promise;
-};
-
-struct _Efl_Future_All
-{
- Efl_Future *f;
-
- Efl_Promise_Msg *d;
-};
-
-struct _Efl_Promise_Composite
-{
- Eina_Array members;
-
- Efl_Promise *promise;
-
- Efl_Future *(*future_get)(void *item);
-
- Eina_Error error;
-
- Eina_Bool failed : 1;
- Eina_Bool progress_triggered : 1;
- Eina_Bool future_triggered : 1;
- Eina_Bool done : 1;
- Eina_Bool building : 1;
-};
-
-static Efl_Future *
-_efl_promise_all_future_get(void *item)
-{
- Efl_Future_All *fa = item;
-
- return fa->f;
-}
-
-static Efl_Future *
-_efl_promise_race_future_get(void *item)
-{
- return item;
-}
-
-static void
-_efl_promise_all_free(Efl_Promise_All *all)
-{
- Efl_Future_All *fa;
- Eina_Array_Iterator iterator;
- unsigned int i;
-
- EINA_ARRAY_ITER_NEXT(&all->members, i, fa, iterator)
- {
- if (fa->d)
- {
- EINA_REFCOUNT_UNREF(fa->d)
- _efl_promise_msg_free(fa->d);
- fa->d = NULL;
- }
- }
- efl_del(all->promise);
- all->promise = NULL;
-}
-
-static void
-_efl_promise_all_die(void *data, const Efl_Event *ev EINA_UNUSED)
-{
- Efl_Promise_All *all = data;
- Efl_Future_All *fa;
-
- while ((fa = eina_array_pop(&all->members)))
- {
- if (fa->d)
- {
- EINA_REFCOUNT_UNREF(fa->d)
- _efl_promise_msg_free(fa->d);
- }
- assert(fa->f == NULL);
- free(fa);
- }
- eina_array_flush(&all->members);
- free(all);
-}
-
-static void
-_efl_promise_race_die(void *data, const Efl_Event *ev EINA_UNUSED)
-{
- Efl_Promise_All *all = data;
-
- eina_array_flush(&all->members);
- free(all);
-}
-
-static void
-_efl_future_set(void *data, const Efl_Event *ev EINA_UNUSED)
-{
- Efl_Promise_All *all = data;
- void *item;
- Eina_Array_Iterator iterator;
- unsigned int i;
-
- if (all->future_triggered) return ;
- all->future_triggered = EINA_TRUE;
-
- // Propagate set on demand
- EINA_ARRAY_ITER_NEXT(&all->members, i, item, iterator)
- {
- Efl_Future *f = all->future_get(item);
-
- if (f)
- {
- Efl_Loop_Future_Data *pd = efl_data_scope_get(f, EFL_LOOP_FUTURE_CLASS);
-
- if (!pd->promise->set.future && !pd->promise->set.future_triggered)
- {
- efl_event_callback_call(pd->promise->promise, EFL_PROMISE_EVENT_FUTURE_SET, f);
- pd->promise->set.future_triggered = EINA_TRUE;
- pd->promise->set.future = EINA_TRUE;
- }
- }
- }
-}
-
-static void
-_efl_future_progress_set(void *data, const Efl_Event *ev EINA_UNUSED)
-{
- Efl_Promise_All *all = data;
- void *item;
- Eina_Array_Iterator iterator;
- unsigned int i;
-
- if (all->progress_triggered) return ;
- all->progress_triggered = 1;
-
- // Propagate progress set
- EINA_ARRAY_ITER_NEXT(&all->members, i, item, iterator)
- {
- Efl_Future *f = all->future_get(item);
-
- if (f)
- {
- Efl_Loop_Future_Data *pd = efl_data_scope_get(f, EFL_LOOP_FUTURE_CLASS);
-
- if (!pd->promise->set.progress && !pd->promise->set.progress_triggered)
- {
- efl_event_callback_call(pd->promise->promise, EFL_PROMISE_EVENT_FUTURE_PROGRESS_SET, f);
- pd->promise->set.progress_triggered = EINA_TRUE;
- pd->promise->set.progress = EINA_TRUE;
- }
- }
- }
-}
-
-static void
-_efl_all_future_none(void *data, const Efl_Event *ev EINA_UNUSED)
-{
- Efl_Promise_All *all = data;
- Efl_Future_All *fa;
- Eina_Array_Iterator iterator;
- unsigned int i;
-
- if (all->failed) return ;
- all->failed = EINA_TRUE;
-
- // Trigger cancel on all future
- EINA_ARRAY_ITER_NEXT(&all->members, i, fa, iterator)
- {
- if (!fa->d && fa->f) efl_future_cancel(fa->f);
- }
-
- // No one is listening to this promise anyway
- _efl_promise_all_free(all);
-}
-
-static void
-_efl_race_future_none(void *data, const Efl_Event *ev EINA_UNUSED)
-{
- Efl_Promise_Race *all = data;
- Efl_Future *f;
- Eina_Array_Iterator iterator;
- unsigned int i;
-
- if (all->failed) return ;
- all->failed = EINA_TRUE;
-
- // Trigger cancel on all future
- EINA_ARRAY_ITER_NEXT(&all->members, i, f, iterator)
- {
- efl_future_cancel(f);
- }
-
- // No one is listening to this promise anyway
- _efl_promise_all_free(all);
-}
-
-static Eina_Bool
-_efl_accessor_all_get_at(Efl_Accessor_All *ac, unsigned int pos, void **data)
-{
- Efl_Future_All *fa;
-
- if (eina_array_count(&ac->all->members) <= pos)
- return EINA_FALSE;
-
- fa = eina_array_data_get(&ac->all->members, pos);
- if (!fa) return EINA_FALSE;
-
- *data = fa->d->value;
- return EINA_TRUE;
-}
-
-static Efl_Promise *
-_efl_accessor_all_get_container(Efl_Accessor_All *ac)
-{
- return ac->all->promise;
-}
-
-static void
-_efl_accessor_all_free(Efl_Accessor_All *ac)
-{
- _efl_promise_all_free(ac->all);
- efl_unref(ac->promise);
- free(ac);
-}
-
-static void
-_real_then_all(Efl_Promise_All *all)
-{
- Efl_Accessor_All *ac;
-
- ac = calloc(1, sizeof (Efl_Accessor_All));
- if (!ac) return ; // We do now the promise and all here
-
- EINA_MAGIC_SET(&ac->accessor, EINA_MAGIC_ACCESSOR);
-
- ac->accessor.version = EINA_ACCESSOR_VERSION;
- ac->accessor.get_at = FUNC_ACCESSOR_GET_AT(_efl_accessor_all_get_at);
- ac->accessor.get_container = FUNC_ACCESSOR_GET_CONTAINER(_efl_accessor_all_get_container);
- ac->accessor.free = FUNC_ACCESSOR_FREE(_efl_accessor_all_free);
- ac->all = all;
- ac->promise = efl_ref(all->promise);
-
- efl_promise_value_set(all->promise, &ac->accessor, EINA_FREE_CB(eina_accessor_free));
-}
-
-static void
-_then_all(void *data, const Efl_Event *ev)
-{
- Efl_Future_Event_Success *success = ev->info;
- Efl_Promise_All *all = data;
- Efl_Future_All *fa;
- // This is a trick due to the fact we are using internal function call to register this functions
- Efl_Promise_Msg *d = success->value;
- Eina_Array_Iterator iterator;
- unsigned int i;
- Eina_Bool done = EINA_TRUE;
-
- // Only when all value are received can we propagate the success
- EINA_ARRAY_ITER_NEXT(&all->members, i, fa, iterator)
- {
- if (fa->f == ev->object)
- {
- fa->d = d;
- EINA_REFCOUNT_REF(fa->d);
- }
- done &= !!fa->d;
- }
-
- if (all->building) return ;
-
- if (done)
- {
- _real_then_all(all);
- }
-}
-
-static void
-_real_fail_all(Efl_Promise_All *all, Eina_Error error)
-{
- efl_promise_failed_set(all->promise, error);
- _efl_promise_all_free(all);
-}
-
-static void
-_fail_all(void *data, const Efl_Event *ev)
-{
- Efl_Future_Event_Failure *fail = ev->info;
- Efl_Promise_All *all = data;
- Efl_Future_All *fa;
- Eina_Array_Iterator iterator;
- unsigned int i;
-
- if (all->failed) return ;
- all->failed = EINA_TRUE;
-
- if (all->building)
- {
- all->error = fail->error;
- return ;
- }
-
- efl_ref(all->promise);
-
- // In case of one fail, the entire promise will fail and
- // all remaining future will be cancelled
- EINA_ARRAY_ITER_NEXT(&all->members, i, fa, iterator)
- {
- if (fa->d)
- {
- EINA_REFCOUNT_UNREF(fa->d)
- _efl_promise_msg_free(fa->d);
- fa->d = NULL;
- }
- else
- {
- efl_future_cancel(fa->f);
- }
- }
-
- _real_fail_all(all, fail->error);
- efl_unref(all->promise);
-}
-
-static void
-_progress(void *data, const Efl_Event *ev)
-{
- Efl_Promise_All *all = data;
- Efl_Future_Event_Progress *p = ev->info;
- void *item;
- Efl_Future_All_Progress a;
- Eina_Array_Iterator iterator;
- unsigned int i;
-
- a.inprogress = ev->object;
- a.progress = (Efl_Object *) p->progress;
-
- EINA_ARRAY_ITER_NEXT(&all->members, i, item, iterator)
- {
- Efl_Future *f = all->future_get(item);
-
- if (f == a.inprogress) break ;
- }
- a.index = i;
-
- efl_promise_progress_set(all->promise, &a);
-}
-
-EFL_CALLBACKS_ARRAY_DEFINE(efl_all_callbacks,
- { EFL_PROMISE_EVENT_FUTURE_SET, _efl_future_set },
- { EFL_PROMISE_EVENT_FUTURE_PROGRESS_SET, _efl_future_progress_set },
- { EFL_PROMISE_EVENT_FUTURE_NONE, _efl_all_future_none },
- { EFL_EVENT_DEL, _efl_promise_all_die });
-
-static inline Efl_Promise_All *
-_efl_future_all_new(Eo *provider)
-{
- Efl_Promise_All *all;
- Eo *loop;
-
- loop = efl_provider_find(provider, EFL_LOOP_CLASS);
- if (!loop) return NULL;
-
- all = calloc(1, sizeof (Efl_Promise_All));
- if (!all) return NULL;
-
- eina_array_step_set(&all->members, sizeof (Eina_Array), 8);
- all->future_get = _efl_promise_all_future_get;
- all->promise = efl_add(EFL_PROMISE_CLASS, loop);
- if (!all->promise) goto on_error;
-
- all->building = EINA_TRUE;
-
- return all;
-
- on_error:
- free(all);
- return NULL;
-}
-
-static inline Efl_Future *
-_efl_future_all_done(Efl_Promise_All *all)
-{
- Efl_Future *r;
- Efl_Future_All *fa;
- Eina_Array_Iterator iterator;
- unsigned int i;
-
- EINA_ARRAY_ITER_NEXT(&all->members, i, fa, iterator)
- _efl_loop_future_internal_then(fa->f, _then_all, _fail_all, _progress, all);
-
- efl_event_callback_array_add(all->promise, efl_all_callbacks(), all);
-
- r = efl_promise_future_get(all->promise);
-
- all->building = EINA_FALSE;
-
- if (all->failed)
- {
- _real_fail_all(all, all->error);
- }
- else
- {
- Eina_Bool done = EINA_TRUE;
-
- EINA_ARRAY_ITER_NEXT(&all->members, i, fa, iterator)
- done &= !!fa->d;
-
- if (done) _real_then_all(all);
- }
-
- return r;
-}
-
-static Eina_Bool
-_efl_future_all_append(Efl_Promise_All *all, Efl_Future *fn)
-{
- Efl_Future_All *fa;
-
- fa = calloc(1, sizeof (Efl_Future_All));
- if (!fa) return EINA_FALSE;
- efl_future_use(&fa->f, fn);
- eina_array_push(&all->members, fa);
-
- return EINA_TRUE;
-}
-
-EAPI Efl_Future *
-efl_future_all_internal(Efl_Future *f1, ...)
-{
- Efl_Promise_All *all;
- Efl_Future *fn;
- va_list args;
-
- if (!f1) return NULL;
-
- all = _efl_future_all_new(f1);
- if (!all) return NULL;
-
- if (!_efl_future_all_append(all, f1))
- goto on_error;
-
- va_start(args, f1);
- while ((fn = va_arg(args, Efl_Future *)))
- {
- if (!_efl_future_all_append(all, fn))
- {
- va_end(args);
- goto on_error;
- }
- }
- va_end(args);
-
- return _efl_future_all_done(all);
-
- on_error:
- _efl_promise_all_die(all, NULL);
- return NULL;
-}
-
-EAPI Efl_Future *
-efl_future_iterator_all(Eina_Iterator *it)
-{
- Efl_Promise_All *all = NULL;
- Efl_Future *fn;
-
- if (!it) return NULL;
-
- EINA_ITERATOR_FOREACH(it, fn)
- {
- if (!all) all = _efl_future_all_new(fn);
- if (!all) goto on_error;
- if (!_efl_future_all_append(all, fn))
- goto on_error;
- }
- eina_iterator_free(it);
-
- return _efl_future_all_done(all);
-
- on_error:
- eina_iterator_free(it);
- if (all) _efl_promise_all_die(all, NULL);
- return NULL;
-}
-
-static void
-_then_race(void *data, const Efl_Event *ev)
-{
- Efl_Future_Event_Success *ev_success = ev->info;
- Efl_Promise_Race *race = data;
- // This is a trick due to the fact we are using internal function call to register this functions
- Efl_Promise_Msg *d = ev_success->value;
- Efl_Future *f;
- Eina_Array_Iterator iterator;
- unsigned int i;
-
- if (race->done) return ;
- race->done = EINA_TRUE;
-
- efl_ref(race->promise);
-
- EINA_ARRAY_ITER_NEXT(&race->members, i, f, iterator)
- {
- // To avoid double cancel/success
- eina_array_data_set(&race->members, i, NULL);
-
- if (f == ev->object)
- {
- Efl_Future_Race_Success *success = calloc(1, sizeof (Efl_Future_Race_Success));
-
- if (!success) continue ;
- success->winner = f;
- success->value = d->value;
- success->index = i;
-
- efl_promise_value_set(race->promise, success, free);
- }
- else
- {
- efl_future_cancel(f);
- }
- }
-
- _efl_promise_all_free(race);
- efl_unref(race->promise);
-}
-
-static void
-_fail_race(void *data, const Efl_Event *ev)
-{
- Efl_Future_Event_Failure *fail = ev->info;
- Efl_Promise_Race *race = data;
- Efl_Future *f;
- Eina_Array_Iterator iterator;
- unsigned int i;
-
- if (race->done) return ;
- race->done = EINA_TRUE;
-
- efl_ref(race->promise);
-
- EINA_ARRAY_ITER_NEXT(&race->members, i, f, iterator)
- {
- // To avoid double cancel/success
- eina_array_data_set(&race->members, i, NULL);
-
- if (f != ev->object)
- {
- efl_future_cancel(f);
- }
- }
-
- efl_promise_failed_set(race->promise, fail->error);
- _efl_promise_all_free(race);
- efl_unref(race->promise);
-}
-
-EFL_CALLBACKS_ARRAY_DEFINE(efl_race_callbacks,
- { EFL_PROMISE_EVENT_FUTURE_SET, _efl_future_set },
- { EFL_PROMISE_EVENT_FUTURE_PROGRESS_SET, _efl_future_progress_set },
- { EFL_PROMISE_EVENT_FUTURE_NONE, _efl_race_future_none },
- { EFL_EVENT_DEL, _efl_promise_race_die });
-
-static Efl_Promise_Race *
-_efl_future_race_new(Eo *provider)
-{
- Efl_Promise_Race *race;
- Eo *loop;
-
- loop = efl_provider_find(provider, EFL_LOOP_CLASS);
- if (!loop) return NULL;
-
- race = calloc(1, sizeof (Efl_Promise_Race));
- if (!race) return NULL;
-
- eina_array_step_set(&race->members, sizeof (Eina_Array), 8);
- race->future_get = _efl_promise_race_future_get;
- race->promise = efl_add(EFL_PROMISE_CLASS, loop);
- if (!race->promise) goto on_error;
-
- return race;
-
- on_error:
- free(race);
- return NULL;
-}
-
-static inline Efl_Future *
-_efl_future_race_done(Efl_Promise_Race *race)
-{
- Efl_Future *r;
- Efl_Future *fn;
- Eina_Array_Iterator iterator;
- unsigned int i;
-
- r = efl_promise_future_get(race->promise);
-
- EINA_ARRAY_ITER_NEXT(&race->members, i, fn, iterator)
- _efl_loop_future_internal_then(fn, _then_race, _fail_race, _progress, race);
-
- efl_event_callback_array_add(race->promise, efl_race_callbacks(), race);
-
- return r;
-}
-
-EAPI Efl_Future *
-efl_future_race_internal(Efl_Future *f1, ...)
-{
- Efl_Promise_Race *race;
- Efl_Future *fn;
- va_list args;
-
- if (!f1) return NULL;
-
- race = _efl_future_race_new(f1);
- if (!race) return NULL;
-
- eina_array_push(&race->members, f1);
-
- va_start(args, f1);
-
- while ((fn = va_arg(args, Efl_Future *)))
- {
- eina_array_push(&race->members, fn);
- }
-
- return _efl_future_race_done(race);
-}
-
-EAPI Efl_Future *
-efl_future_iterator_race(Eina_Iterator *it)
-{
- Efl_Promise_Race *race = NULL;
- Efl_Future *fn;
-
- if (!it) return NULL;
-
- EINA_ITERATOR_FOREACH(it, fn)
- {
- if (!race) race = _efl_future_race_new(fn);
- if (!race) goto on_error;
- eina_array_push(&race->members, fn);
- }
- eina_iterator_free(it);
-
- return _efl_future_race_done(race);
-
- on_error:
- eina_iterator_free(it);
- return NULL;
-}
-
-#include "efl_promise.eo.c"
diff --git a/src/lib/ecore/efl_promise.eo b/src/lib/ecore/efl_promise.eo
deleted file mode 100644
index bed53b393a..0000000000
--- a/src/lib/ecore/efl_promise.eo
+++ /dev/null
@@ -1,80 +0,0 @@
-import eina_types;
-
-class Efl.Promise (Efl.Loop.Consumer)
-{
- [[Efl promise class]]
- methods {
- progress_set {
- [[Updates progress and sends it immediately to all connected Efl_Future.
-
- The progress is not stored and when the function returns it will not be accessed
- anymore. The pointer is owned by the caller and will remain so after the return
- of the function call.
- ]]
- params {
- @in p: const(void_ptr); [[Progress to be set]]
- }
- }
- @property future {
- [[Requests a new future linked to this promise.
-
- Efl_Future are optional and will be automatically deleted if no callbacks have
- been set before the next iteration of the main loop.
- ]]
- get {
- [[The returned new future.]]
- }
- values {
- f: future<void_ptr, void_ptr>; [[Returns a future where the value will be set by calling value_set whilst the progress is
- updated by progress_set.]]
- }
- }
- @property value {
- [[The value expected by all connected future.]]
- set {
- [[
- This function can be called only once. You cannot call #failed.set after doing so.
- The value will be owned by the promise until it's destroyed. It will be cleaned
- when the promise and all futures depending on it are destroyed.
- ]]
- }
- values {
- v: void_ptr; [[The pointer to the value.]]
- free_cb: __builtin_free_cb; [[The function to call to free the value.]]
- }
- }
- @property failed {
- [[Defines the failure state of this promise.]]
- set {
- [[
- This function can be called only once and you cannot call #value.set after doing so.
- ]]
- }
- values {
- err: Eina.Error; [[The reason for failure of this promise.]]
- }
- }
- connect {
- [[Connects a future output to this promise.
-
- This helper will automatically trigger #value.set or #failed.set when the future
- succeeds or fails respectively, with the value provided by the future.
- ]]
- params {
- @in f: future<void_ptr, void_ptr>; [[The future to connect to this promise.]]
- }
- return: bool; [[Returns $false if unable to set up the connection.]]
- }
- }
- events {
- future,set: future<void_ptr>; [[This event is triggered whenever a future is fully set to receive all events and the user
- holds no more references to it.]]
- future,progress,set: future<void_ptr>; [[This event is triggered whenever a future has a progress callback registered and the user holds no more reference to it.]]
- future,none; [[This event is triggered whenever there are no more futures connected to the promise.]]
- }
- implements {
- Efl.Object.destructor;
- Efl.Object.constructor;
- Efl.Object.parent { set; }
- }
-}
diff --git a/src/lib/ecore/efl_task.c b/src/lib/ecore/efl_task.c
new file mode 100644
index 0000000000..35f1547cb6
--- /dev/null
+++ b/src/lib/ecore/efl_task.c
@@ -0,0 +1,439 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <Ecore.h>
+
+#include "ecore_private.h"
+
+#define MY_CLASS EFL_TASK_CLASS
+
+//////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////
+
+static void
+_clear_args(Efl_Task_Data *pd)
+{
+ unsigned int count, i;
+
+ if (!pd->args) return;
+ count = eina_array_count(pd->args);
+ for (i = 0; i < count; i++)
+ eina_stringshare_del(eina_array_data_get(pd->args, i));
+ eina_array_free(pd->args);
+ pd->args = NULL;
+}
+
+static Eina_Array *
+_unescape(const char *s)
+{
+ Eina_Array *args;
+ const char *p;
+ char *tmp = NULL, *d = NULL;
+ if (!s) return NULL;
+
+ Eina_Bool in_quote_dbl = EINA_FALSE;
+ Eina_Bool in_quote = EINA_FALSE;
+
+ args = eina_array_new(16);
+ if (!args) return NULL;
+ for (p = s; *p; p++)
+ {
+ if (!tmp) tmp = d = strdup(p);
+ if (tmp)
+ {
+ if (in_quote_dbl)
+ {
+ switch (*p)
+ {
+ case '\"':
+ in_quote_dbl = EINA_FALSE;
+ *d = 0;
+ eina_array_push(args, eina_stringshare_add(tmp));
+ free(tmp);
+ tmp = d = NULL;
+ break;
+ case '\\':
+ p++;
+ EINA_FALLTHROUGH
+ default:
+ *d = *p;
+ d++;
+ break;
+ }
+ }
+ else if (in_quote)
+ {
+ switch (*p)
+ {
+ case '\'':
+ in_quote = EINA_FALSE;
+ *d = 0;
+ eina_array_push(args, eina_stringshare_add(tmp));
+ free(tmp);
+ tmp = d = NULL;
+ break;
+ case '\\':
+ p++;
+ EINA_FALLTHROUGH
+ default:
+ *d = *p;
+ d++;
+ break;
+ }
+ }
+ else
+ {
+ switch (*p)
+ {
+ case ' ':
+ case '\t':
+ case '\r':
+ case '\n':
+ *d = 0;
+ eina_array_push(args, eina_stringshare_add(tmp));
+ free(tmp);
+ tmp = d = NULL;
+ break;
+ case '\"':
+ in_quote_dbl = EINA_TRUE;
+ break;
+ case '\'':
+ in_quote = EINA_TRUE;
+ break;
+ case '\\':
+ p++;
+ EINA_FALLTHROUGH
+ default:
+ *d = *p;
+ d++;
+ break;
+ }
+ }
+ }
+ }
+ if (tmp)
+ {
+ *d = 0;
+ eina_array_push(args, eina_stringshare_add(tmp));
+ free(tmp);
+ }
+ return args;
+}
+
+static char *
+_escape(const char *s)
+{
+ Eina_Bool need_quote = EINA_FALSE;
+ const char *p;
+ char *s2 = malloc((strlen(s) * 2) + 1 + 2), *d;
+
+ if (!s2) return NULL;
+
+ for (p = s; *p; p++)
+ {
+ switch (*p)
+ {
+ case '\'':
+ case '\"':
+ case '$':
+ case '#':
+ case ';':
+ case '&':
+ case '`':
+ case '|':
+ case '(':
+ case ')':
+ case '[':
+ case ']':
+ case '{':
+ case '}':
+ case '>':
+ case '<':
+ case '\n':
+ case '\r':
+ case '\t':
+ need_quote = EINA_TRUE;
+ default:
+ break;
+ }
+ }
+
+ d = s2;
+ if (need_quote)
+ {
+ *d = '\"';
+ d++;
+ }
+ for (p = s; *p; p++, d++)
+ {
+ switch (*p)
+ {
+ case ' ':
+ case '\\':
+ case '\'':
+ case '\"':
+ *d = '\\';
+ d++;
+ EINA_FALLTHROUGH
+ default:
+ *d = *p;
+ break;
+ }
+ }
+ if (need_quote)
+ {
+ *d = '\"';
+ d++;
+ }
+ *d = 0;
+ return s2;
+}
+
+static void
+_rebuild_command(Efl_Task_Data *pd)
+{
+ unsigned int count, i;
+ Eina_Strbuf *sb;
+ const char *arg, *cmd;
+ Eina_Bool have_args = EINA_FALSE;
+
+ if (!pd->command_dirty) return;
+ pd->command_dirty = EINA_FALSE;
+ eina_stringshare_del(pd->command);
+ pd->command = NULL;
+ if (!pd->args) return;
+ sb = eina_strbuf_new();
+ if (!sb) return;
+ count = eina_array_count(pd->args);
+ for (i = 0; i < count; i++)
+ {
+ arg = eina_array_data_get(pd->args, i);
+ if (arg)
+ {
+ char *str = _escape(arg);
+ if (str)
+ {
+ if (have_args) eina_strbuf_append(sb, " ");
+ eina_strbuf_append(sb, str);
+ free(str);
+ have_args = EINA_TRUE;
+ }
+ }
+ }
+ cmd = eina_strbuf_string_get(sb);
+ if (cmd) pd->command = eina_stringshare_add(cmd);
+ eina_strbuf_free(sb);
+}
+
+
+static Eina_Bool
+_foreach_env_copy(const Eina_Hash *hash EINA_UNUSED, const void *key, void *data, void *fdata)
+{
+ if (data)
+ {
+ // only copy env vars not already set
+ if (!eina_hash_find(fdata, key))
+ eina_hash_add(fdata, key, eina_stringshare_add(data));
+ }
+ return EINA_TRUE;
+}
+
+//////////////////////////////////////////////////////////////////////////
+
+EOLIAN static void
+_efl_task_command_set(Eo *obj EINA_UNUSED, Efl_Task_Data *pd, const char *command)
+{
+ eina_stringshare_replace(&pd->command, command);
+ _clear_args(pd);
+ pd->args = _unescape(pd->command);
+}
+
+EOLIAN static const char *
+_efl_task_command_get(const Eo *obj EINA_UNUSED, Efl_Task_Data *pd)
+{
+ _rebuild_command(pd);
+ return pd->command;
+}
+
+EOLIAN static unsigned int
+_efl_task_arg_count_get(const Eo *obj EINA_UNUSED, Efl_Task_Data *pd)
+{
+ if (!pd->args) return 0;
+ return eina_array_count(pd->args);
+}
+
+EOLIAN static void
+_efl_task_arg_value_set(Eo *obj EINA_UNUSED, Efl_Task_Data *pd, unsigned int num, const char *arg)
+{
+ const char *parg = NULL;
+ unsigned int count;
+
+ if (!pd->args) pd->args = eina_array_new(16);
+ count = eina_array_count(pd->args);
+ if ((count > 0) && (count > num))
+ parg = eina_array_data_get(pd->args, num);
+ else
+ {
+ unsigned int i;
+
+ for (i = count; i <= num; i++)
+ {
+ eina_array_push(pd->args, "");
+ eina_array_data_set(pd->args, i, NULL);
+ }
+ }
+
+ if (arg)
+ eina_array_data_set(pd->args, num, eina_stringshare_add(arg));
+ else
+ eina_array_data_set(pd->args, num, NULL);
+ if (parg) eina_stringshare_del(parg);
+ pd->command_dirty = EINA_TRUE;
+}
+
+EOLIAN static const char *
+_efl_task_arg_value_get(const Eo *obj EINA_UNUSED, Efl_Task_Data *pd, unsigned int num)
+{
+ unsigned int count;
+
+ if (!pd->args) return NULL;
+ count = eina_array_count(pd->args);
+ if (num >= count) return NULL;
+ return eina_array_data_get(pd->args, num);
+}
+
+EOLIAN static void
+_efl_task_arg_append(Eo *obj EINA_UNUSED, Efl_Task_Data *pd, const char *arg)
+{
+ if (!pd->args) pd->args = eina_array_new(16);
+ if (arg)
+ eina_array_push(pd->args, eina_stringshare_add(arg));
+ else
+ eina_array_push(pd->args, NULL);
+ pd->command_dirty = EINA_TRUE;
+}
+
+EOLIAN static void
+_efl_task_arg_reset(Eo *obj EINA_UNUSED, Efl_Task_Data *pd)
+{
+ _clear_args(pd);
+ pd->command_dirty = EINA_TRUE;
+}
+
+EOLIAN static void
+_efl_task_env_set(Eo *obj EINA_UNUSED, Efl_Task_Data *pd, const char *var, const char *value)
+{
+ if (!var) return;
+ if (!pd->env)
+ pd->env = eina_hash_string_superfast_new
+ ((Eina_Free_Cb)eina_stringshare_del);
+ if (!pd->env) return;
+ if ((value) && (*value))
+ eina_hash_add(pd->env, var, eina_stringshare_add(value));
+ else eina_hash_del(pd->env, var, NULL);
+}
+
+
+EOLIAN static const char *
+_efl_task_env_get(const Eo *obj EINA_UNUSED, Efl_Task_Data *pd, const char *var)
+{
+ if ((!var) || (!pd->env)) return NULL;
+ return eina_hash_find(pd->env, var);
+}
+
+EOLIAN static void
+_efl_task_env_reset(Eo *obj EINA_UNUSED, Efl_Task_Data *pd)
+{
+ if (pd->env) eina_hash_free(pd->env);
+ pd->env = NULL;
+}
+
+EOLIAN static void
+_efl_task_priority_set(Eo *obj EINA_UNUSED, Efl_Task_Data *pd, Efl_Task_Priority priority)
+{
+ pd->priority = priority;
+}
+
+EOLIAN static Efl_Task_Priority
+_efl_task_priority_get(const Eo *obj EINA_UNUSED, Efl_Task_Data *pd)
+{
+ return pd->priority;
+}
+
+EOLIAN static int
+_efl_task_exit_code_get(const Eo *obj EINA_UNUSED, Efl_Task_Data *pd)
+{
+ return pd->exit_code;
+}
+
+EOLIAN static void
+_efl_task_flags_set(Eo *obj EINA_UNUSED, Efl_Task_Data *pd, Efl_Task_Flags flags)
+{
+ pd->flags = flags;
+}
+
+EOLIAN static Efl_Task_Flags
+_efl_task_flags_get(const Eo *obj EINA_UNUSED, Efl_Task_Data *pd)
+{
+ return pd->flags;
+}
+
+EOLIAN static Eina_Future *
+_efl_task_run(Eo *obj EINA_UNUSED, Efl_Task_Data *pd EINA_UNUSED)
+{
+ // NOP
+ return NULL;
+}
+
+EOLIAN static void
+_efl_task_end(Eo *obj EINA_UNUSED, Efl_Task_Data *pd EINA_UNUSED)
+{
+ // NOP
+}
+
+EOLIAN static Efl_Object *
+_efl_task_efl_object_constructor(Eo *obj, Efl_Task_Data *pd EINA_UNUSED)
+{
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+ return obj;
+}
+
+EOLIAN static void
+_efl_task_efl_object_destructor(Eo *obj EINA_UNUSED, Efl_Task_Data *pd)
+{
+ eina_stringshare_del(pd->command);
+ pd->command = NULL;
+ _clear_args(pd);
+ if (pd->env) eina_hash_free(pd->env);
+ pd->env = NULL;
+ efl_destructor(efl_super(obj, MY_CLASS));
+}
+
+EOLIAN static void
+_efl_task_efl_object_parent_set(Eo *obj, Efl_Task_Data *pd, Efl_Object *parent)
+{
+ Eo *loop;
+
+ efl_parent_set(efl_super(obj, MY_CLASS), parent);
+ // copy loop env into exe task env, if not already set in env (overridden)
+ loop = efl_provider_find(parent, EFL_LOOP_CLASS);
+ if (loop)
+ {
+ Efl_Task_Data *tdl = efl_data_scope_get(loop, EFL_TASK_CLASS);
+
+ if (tdl)
+ {
+ if (!pd->env)
+ pd->env = eina_hash_string_superfast_new
+ ((Eina_Free_Cb)eina_stringshare_del);
+ if (tdl->env)
+ eina_hash_foreach(tdl->env, _foreach_env_copy, pd->env);
+ }
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////
+
+#include "efl_task.eo.c"
diff --git a/src/lib/ecore/efl_task.eo b/src/lib/ecore/efl_task.eo
new file mode 100644
index 0000000000..7fdb895f49
--- /dev/null
+++ b/src/lib/ecore/efl_task.eo
@@ -0,0 +1,158 @@
+enum Efl.Task_Priority {
+ [[ ]]
+ normal,
+ background,
+ low,
+ high,
+ ultra
+}
+
+enum Efl.Task_Flags {
+ [[ ]]
+ none = 0,
+ use_stdin = 1,
+ use_stdout = 2,
+ no_exit_code_error = 4,
+}
+
+class Efl.Task (Efl.Object, Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer)
+{
+ [[ ]]
+ methods {
+ @property command {
+ [[ A commandline that encodes arguments in a command string.
+ This command is unix shell-style, thus whitespace separates
+ arguments unless escaped. Also a semi-colon ';', ampersand
+ '&', pipe/bar '|', hash '#', bracket, square brace, brace
+ character ('(', ')', '[', ']', '{', '}'), exclamation
+ mark '!', backquote '`', greator or less than ('>' '<')
+ character unless escaped or in quotes would cause
+ args_count/value to not be generated properly, because
+ it would force complex shell interpretation which
+ will not be supported in evaluating the arg_count/value
+ information, but the final shell may interpret this if this
+ is executed via a command-line shell. To not be a complex
+ shell command, it should be simple with paths, options
+ and variable expansions, but nothing more complex involving
+ the above unescaped characters.
+
+ "cat -option /path/file"
+ "cat 'quoted argument'"
+ "cat ~/path/escaped\ argument"
+ "/bin/cat escaped\ argument $VARIABLE"
+ etc.
+
+ It should not try and use "complex shell features" if you
+ want the arg_count and arg_value set to be correct after
+ setting the command string. For example none of:
+
+ "VAR=x /bin/command && /bin/othercommand >& /dev/null"
+ "VAR=x /bin/command `/bin/othercommand` | /bin/cmd2 && cmd3 &"
+ etc.
+
+ If you set the command the arg_count/value property contents
+ can change and be completely re-evaluated by parsing the
+ command string into an argument array set along with
+ interpreting escapes back into individual argument strings. ]]
+ get { }
+ set { }
+ values {
+ command: string; [[ The command string as described ]]
+ }
+ }
+ @property arg_count {
+ [[ Number of arguments passed in or arguments that are to be
+ passed as sepcified by arg_value ]]
+ get { }
+ values {
+ args: uint; [[ ]]
+ }
+ }
+ @property arg_value {
+ [[ Argument number by index. If the index does not exist when
+ set, it is allocated and created. Getting an argument that
+ Has not been set yet will return $NULL. Empty arguments will
+ Be ignored. Setting an argument will result in the command
+ porperty being re-evaluated and escaped into a single
+ command string if needed. ]]
+ set { }
+ get { }
+ keys {
+ num: uint; [[ ]]
+ }
+ values {
+ arg: string; [[ ]]
+ }
+ }
+ arg_append {
+ [[ Append a new string argument at the end of the arg set.
+ This functions like setting an arg_value at the end of the
+ current set so the set increases by 1 in size. ]]
+ params {
+ arg: string; [[ ]]
+ }
+ }
+ arg_reset {
+ [[ Clear all arguments in arg_value/count set. Will result in the
+ command property also being cleared. ]]
+ }
+ @property env {
+ [[ The environment to be passed in or that was passed to the
+ task. This is a string key, value list which map to environment
+ variables where appropriate. The var string must contain
+ only an underscore ('_'), letters ('a-z', 'A-Z'),
+ numbers ('0-9'), but the first character may not be a number.]]
+ set { }
+ get { }
+ keys {
+ var: string; [[ The variable name as a string ]]
+ }
+ values {
+ value: string; [[ Set var to this value if not $NULL,
+ otherwise clear this env value if value
+ is $NULL or if it is an empty string ]]
+ }
+ }
+ env_reset {
+ [[ Clear all environment variables. ]]
+ }
+ @property priority {
+ [[ The priority of this task. ]]
+ get { }
+ set { }
+ values {
+ priority: Efl.Task_Priority; [[ ]]
+ }
+ }
+ @property exit_code {
+ [[ The final exit code of this task. ]]
+ get { }
+ values {
+ code: int; [[ ]]
+ }
+ }
+ @property flags {
+ set { }
+ get { }
+ values {
+ flags: Efl.Task_Flags; [[ ]]
+ }
+ }
+ run {
+ [[ Actually run the task ]]
+ return: future<void> @owned; [[ A future triggered when task exits and is passed int exit code ]]
+ }
+ end {
+ [[ Request the task end (may send a signal or interrupt
+ signal resulting in a terminate event being tiggered in the
+ target task loop) ]]
+ }
+ }
+ events {
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Object.destructor;
+ Efl.Object.parent { set; }
+ }
+}
diff --git a/src/lib/ecore/efl_thread.c b/src/lib/ecore/efl_thread.c
new file mode 100644
index 0000000000..e39ed50d34
--- /dev/null
+++ b/src/lib/ecore/efl_thread.c
@@ -0,0 +1,1073 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#define EFL_IO_READER_PROTECTED 1
+#define EFL_IO_WRITER_PROTECTED 1
+#define EFL_IO_CLOSER_PROTECTED 1
+
+#include <Ecore.h>
+
+#include "ecore_private.h"
+
+#include <unistd.h>
+#include <fcntl.h>
+#include <string.h>
+
+#define MY_CLASS EFL_THREAD_CLASS
+
+#define APPTHREAD_CLASS EFL_APPTHREAD_CLASS
+
+typedef struct
+{
+ const char *name;
+ struct {
+ int in, out;
+ Eo *in_handler, *out_handler;
+ } fd, ctrl;
+ struct {
+ unsigned int argc;
+ const char **argv;
+ } args;
+ Efl_Callback_Array_Item_Full *event_cb;
+ void *indata, *outdata;
+} Thread_Data;
+
+#define CMD_EXIT 1
+#define CMD_EXITED 2
+#define CMD_CALL 3
+#define CMD_CALL_SYNC 4
+
+typedef struct
+{
+ Eina_Semaphore sem;
+ void *data;
+} Control_Reply;
+
+typedef struct
+{
+ union {
+ struct {
+ int command;
+ int data;
+ void *ptr[4];
+ } d;
+ unsigned char b[64];
+ };
+} Control_Data;
+
+typedef struct _Efl_Thread_Data Efl_Thread_Data;
+
+struct _Efl_Thread_Data
+{
+ struct {
+ int in, out;
+ Eo *in_handler, *out_handler;
+ Eina_Bool can_read : 1;
+ Eina_Bool eos_read : 1;
+ Eina_Bool can_write : 1;
+ } fd, ctrl;
+ int read_listeners;
+ Eina_Promise *promise;
+ Eo *loop;
+ Thread_Data *thdat;
+ Efl_Callback_Array_Item_Full *event_cb;
+ Eina_Thread thread;
+ Eina_Bool end_sent : 1;
+ Eina_Bool exit_read : 1;
+ Eina_Bool exit_called : 1;
+ Eina_Bool run : 1;
+};
+
+//////////////////////////////////////////////////////////////////////////
+
+static void
+_cb_thread_out(void *data, const Efl_Event *event EINA_UNUSED)
+{
+ Eo *obj = data;
+ efl_io_reader_can_read_set(obj, EINA_TRUE);
+}
+
+static void
+_cb_thread_in(void *data, const Efl_Event *event EINA_UNUSED)
+{
+ Eo *obj = data;
+ efl_io_writer_can_write_set(obj, EINA_TRUE);
+}
+
+static void
+_cb_thread_ctrl_out(void *data, const Efl_Event *event EINA_UNUSED)
+{
+ Eo *obj = data;
+ Control_Data cmd;
+ ssize_t ret;
+ Efl_Appthread_Data *ad;
+
+ ad = efl_data_scope_get(obj, APPTHREAD_CLASS);
+ memset(&cmd, 0, sizeof(cmd));
+ ret = read(ad->ctrl.out, &cmd, sizeof(Control_Data));
+ if (ret == sizeof(Control_Data))
+ {
+ if (cmd.d.command == CMD_EXIT)
+ {
+ efl_event_callback_call(obj, EFL_LOOP_EVENT_QUIT, NULL);
+ efl_loop_quit(obj, eina_value_int_init(0));
+ }
+ else if (cmd.d.command == CMD_CALL)
+ {
+ EFlThreadIOCall func = cmd.d.ptr[0];
+ void *data = cmd.d.ptr[1];
+ Eina_Free_Cb free_func = cmd.d.ptr[2];
+ if (func)
+ {
+ Efl_Event event = { obj, NULL, NULL };
+
+ func(data, &event);
+ }
+ if (free_func) free_func(data);
+ }
+ else if (cmd.d.command == CMD_CALL_SYNC)
+ {
+ EFlThreadIOCallSync func = cmd.d.ptr[0];
+ void *data = cmd.d.ptr[1];
+ Eina_Free_Cb free_func = cmd.d.ptr[2];
+ Control_Reply *rep = cmd.d.ptr[3];
+ if (func)
+ {
+ Efl_Event event = { obj, NULL, NULL };
+
+ rep->data = func(data, &event);
+ }
+ if (free_func) free_func(data);
+ eina_semaphore_release(&(rep->sem), 1);
+ }
+ }
+}
+
+static Eina_Value
+_efl_loop_arguments_send(void *data, const Eina_Value v,
+ const Eina_Future *dead EINA_UNUSED)
+
+{
+ Efl_Loop_Arguments arge;
+ Eo *obj = data;
+ Eina_Array *arga;
+ Eina_Stringshare *s;
+ unsigned int argc = efl_task_arg_count_get(obj);
+ unsigned int i;
+
+ arga = eina_array_new(argc);
+ if (v.type == EINA_VALUE_TYPE_ERROR) goto on_error;
+
+ for (i = 0; i < argc; i++)
+ {
+ const char *argv = efl_task_arg_value_get(obj, i);
+ if (argv)
+ eina_array_push(arga, eina_stringshare_add(argv));
+ }
+ arge.argv = arga;
+ arge.initialization = EINA_TRUE;
+ efl_event_callback_call(obj,
+ EFL_LOOP_EVENT_ARGUMENTS, &arge);
+on_error:
+ while ((s = eina_array_pop(arga))) eina_stringshare_del(s);
+ eina_array_free(arga);
+ return v;
+}
+
+static void
+_appthread_parent_read_listeners_modify(Efl_Appthread_Data *ad, int mod)
+{
+ ad->read_listeners += mod;
+
+ if (ad->fd.out_handler)
+ {
+ if ((ad->read_listeners == 0) && (mod < 0))
+ efl_loop_handler_active_set
+ (ad->fd.out_handler, EFL_LOOP_HANDLER_FLAGS_NONE);
+ else if ((ad->read_listeners == 1) && (mod > 0))
+ efl_loop_handler_active_set
+ (ad->fd.out_handler, EFL_LOOP_HANDLER_FLAGS_READ);
+ }
+}
+
+static void
+_cb_appthread_event_callback_add(void *data, const Efl_Event *event)
+{
+ Efl_Appthread_Data *ad = data;
+ const Efl_Callback_Array_Item_Full *array = event->info;
+ int i;
+
+ for (i = 0; array[i].desc != NULL; i++)
+ {
+ if (array[i].desc == EFL_IO_READER_EVENT_CAN_READ_CHANGED)
+ _appthread_parent_read_listeners_modify(ad, 1);
+ }
+}
+
+static void
+_cb_appthread_event_callback_del(void *data, const Efl_Event *event)
+{
+ Efl_Appthread_Data *ad = data;
+ const Efl_Callback_Array_Item_Full *array = event->info;
+ int i;
+
+ for (i = 0; array[i].desc != NULL; i++)
+ {
+ if (array[i].desc == EFL_IO_READER_EVENT_CAN_READ_CHANGED)
+ _appthread_parent_read_listeners_modify(ad, -1);
+ }
+}
+
+EFL_CALLBACKS_ARRAY_DEFINE(_appthread_event_callback_watch,
+ { EFL_EVENT_CALLBACK_ADD, _cb_appthread_event_callback_add },
+ { EFL_EVENT_CALLBACK_DEL, _cb_appthread_event_callback_del });
+
+static void *
+_efl_thread_main(void *data, Eina_Thread t)
+{
+ Efl_Appthread_Data *ad;
+ Thread_Data *thdat = data;
+ Eo *obj;
+ Eina_Value *ret;
+ Control_Data cmd;
+ unsigned int i;
+ int real;
+ Efl_Callback_Array_Item_Full *it;
+ Eina_Future *job;
+
+ if (thdat->name) eina_thread_name_set(t, thdat->name);
+ else eina_thread_name_set(t, "Eflthread");
+
+ obj = efl_add_ref(APPTHREAD_CLASS, NULL);
+ ad = efl_data_scope_get(obj, APPTHREAD_CLASS);
+ efl_threadio_indata_set(obj, thdat->indata);
+ efl_threadio_outdata_set(obj, thdat->outdata);
+ efl_event_callback_array_add(obj, _appthread_event_callback_watch(), ad);
+
+ // add handlers for "stdio"
+ thdat->fd.in_handler =
+ efl_add(EFL_LOOP_HANDLER_CLASS, obj,
+ efl_loop_handler_fd_set(efl_added, thdat->fd.in),
+ efl_event_callback_add
+ (efl_added, EFL_LOOP_HANDLER_EVENT_WRITE, _cb_thread_in, obj));
+ thdat->fd.out_handler =
+ efl_add(EFL_LOOP_HANDLER_CLASS, obj,
+ efl_loop_handler_fd_set(efl_added, thdat->fd.out),
+ efl_event_callback_add
+ (efl_added, EFL_LOOP_HANDLER_EVENT_READ, _cb_thread_out, obj));
+ // add handlers for control pipes
+ thdat->ctrl.in_handler =
+ efl_add(EFL_LOOP_HANDLER_CLASS, obj,
+ efl_loop_handler_fd_set(efl_added, thdat->ctrl.in));
+ thdat->ctrl.out_handler =
+ efl_add(EFL_LOOP_HANDLER_CLASS, obj,
+ efl_loop_handler_fd_set(efl_added, thdat->ctrl.out),
+ efl_event_callback_add
+ (efl_added, EFL_LOOP_HANDLER_EVENT_READ, _cb_thread_ctrl_out, obj),
+ efl_loop_handler_active_set
+ (efl_added, EFL_LOOP_HANDLER_FLAGS_READ));
+ ad->fd.in = thdat->fd.in;
+ ad->fd.out = thdat->fd.out;
+ ad->ctrl.in = thdat->ctrl.in;
+ ad->ctrl.out = thdat->ctrl.out;
+ ad->fd.in_handler = thdat->fd.in_handler;
+ ad->fd.out_handler = thdat->fd.out_handler;
+ ad->ctrl.in_handler = thdat->ctrl.in_handler;
+ ad->ctrl.out_handler = thdat->ctrl.out_handler;
+ ad->thdat = thdat;
+
+ if (thdat->event_cb)
+ {
+ for (it = thdat->event_cb; it->func; it++)
+ efl_event_callback_priority_add(obj, it->desc, it->priority,
+ it->func, it->user_data);
+ }
+ for (i = 0; i < thdat->args.argc; i++)
+ efl_task_arg_append(obj, thdat->args.argv[i]);
+ job = eina_future_then(efl_loop_job(obj), _efl_loop_arguments_send, obj);
+ efl_future_Eina_FutureXXX_then(obj, job);
+
+ for (i = 0; i < thdat->args.argc; i++)
+ eina_stringshare_del(thdat->args.argv[i]);
+ free(thdat->args.argv);
+ free(thdat->event_cb);
+ thdat->args.argv = NULL;
+ thdat->event_cb = NULL;
+
+ ret = efl_loop_begin(obj);
+ real = efl_loop_exit_code_process(ret);
+ thdat->outdata = efl_threadio_outdata_get(obj);
+
+ memset(&cmd, 0, sizeof(cmd));
+ cmd.d.command = CMD_EXITED;
+ cmd.d.data = real;
+ write(thdat->ctrl.in, &cmd, sizeof(Control_Data));
+
+ efl_unref(obj);
+
+ thdat->fd.in_handler = NULL;
+ thdat->fd.out_handler = NULL;
+ thdat->ctrl.in_handler = NULL;
+ thdat->ctrl.out_handler = NULL;
+ thdat->fd.in = -1;
+ thdat->fd.out = -1;
+ thdat->ctrl.in = -1;
+ thdat->ctrl.out = -1;
+
+ return NULL;
+}
+
+//////////////////////////////////////////////////////////////////////////
+
+static void
+_thread_exit_eval(Eo *obj, Efl_Thread_Data *pd)
+{
+ if ((pd->fd.out == -1) && /*(pd->fd.in == -1) &&*/
+ (pd->exit_read) && (!pd->exit_called))
+ {
+ pd->exit_called = EINA_TRUE;
+ if (pd->thdat) efl_threadio_outdata_set(obj, pd->thdat->outdata);
+ if (pd->promise)
+ {
+ Eina_Promise *p = pd->promise;
+ int exit_code = efl_task_exit_code_get(obj);
+ pd->promise = NULL;
+ if ((exit_code != 0) && (!(efl_task_flags_get(obj) &
+ EFL_TASK_FLAGS_NO_EXIT_CODE_ERROR)))
+ eina_promise_reject(p, exit_code + 1000000);
+ else eina_promise_resolve(p, eina_value_int_init(exit_code));
+ }
+ }
+}
+
+static void
+_cb_thread_parent_out(void *data, const Efl_Event *event EINA_UNUSED)
+{
+ Eo *obj = data;
+ efl_io_reader_can_read_set(obj, EINA_TRUE);
+}
+
+static void
+_cb_thread_parent_in(void *data, const Efl_Event *event EINA_UNUSED)
+{
+ Eo *obj = data;
+ efl_io_writer_can_write_set(obj, EINA_TRUE);
+}
+
+static void
+_cb_thread_parent_ctrl_out(void *data, const Efl_Event *event EINA_UNUSED)
+{
+ Eo *obj = data;
+ Control_Data cmd;
+ ssize_t ret;
+ Efl_Thread_Data *pd = efl_data_scope_get(obj, MY_CLASS);
+
+ if (!pd) return;
+
+ memset(&cmd, 0, sizeof(cmd));
+ ret = read(pd->ctrl.out, &cmd, sizeof(Control_Data));
+ if (ret == sizeof(Control_Data))
+ {
+ if (cmd.d.command == CMD_EXITED)
+ {
+ if (!pd->exit_read)
+ {
+ Efl_Task_Data *td = efl_data_scope_get(obj, EFL_TASK_CLASS);
+
+ if (td) td->exit_code = cmd.d.data;
+ pd->exit_read = EINA_TRUE;
+ _thread_exit_eval(obj, pd);
+ }
+ }
+ else if (cmd.d.command == CMD_CALL)
+ {
+ EFlThreadIOCall func = cmd.d.ptr[0];
+ void *data = cmd.d.ptr[1];
+ Eina_Free_Cb free_func = cmd.d.ptr[2];
+ if (func)
+ {
+ Efl_Event event = { obj, NULL, NULL };
+
+ func(data, &event);
+ }
+ if (free_func) free_func(data);
+ }
+ else if (cmd.d.command == CMD_CALL_SYNC)
+ {
+ EFlThreadIOCallSync func = cmd.d.ptr[0];
+ void *data = cmd.d.ptr[1];
+ Eina_Free_Cb free_func = cmd.d.ptr[2];
+ Control_Reply *rep = cmd.d.ptr[3];
+ if (func)
+ {
+ Efl_Event event = { obj, NULL, NULL };
+
+ rep->data = func(data, &event);
+ }
+ if (free_func) free_func(data);
+ eina_semaphore_release(&(rep->sem), 1);
+ }
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////
+
+static void
+_run_cancel_cb(void *data, const Eina_Promise *dead_promise EINA_UNUSED)
+{
+ Eo *obj = data;
+ Efl_Thread_Data *pd = efl_data_scope_get(obj, MY_CLASS);
+ pd->promise = NULL;
+ efl_task_end(obj);
+}
+
+static void
+_thread_parent_read_listeners_modify(Efl_Thread_Data *pd, int mod)
+{
+ pd->read_listeners += mod;
+
+ if (pd->fd.out_handler)
+ {
+ if ((pd->read_listeners == 0) && (mod < 0))
+ efl_loop_handler_active_set
+ (pd->fd.out_handler, EFL_LOOP_HANDLER_FLAGS_NONE);
+ else if ((pd->read_listeners == 1) && (mod > 0))
+ efl_loop_handler_active_set
+ (pd->fd.out_handler, EFL_LOOP_HANDLER_FLAGS_READ);
+ }
+}
+
+static void
+_cb_event_callback_add(void *data, const Efl_Event *event)
+{
+ Efl_Thread_Data *pd = data;
+ const Efl_Callback_Array_Item_Full *array = event->info;
+ int i;
+
+ for (i = 0; array[i].desc != NULL; i++)
+ {
+ if (array[i].desc == EFL_LOOP_EVENT_ARGUMENTS)
+ {
+ Efl_Callback_Array_Item_Full *event_cb, *it;
+ int num;
+
+ num = 0;
+ if (pd->event_cb)
+ {
+ for (it = pd->event_cb; it->func; it++) num++;
+ }
+ num++;
+ event_cb = realloc(pd->event_cb, (num + 1) * sizeof(Efl_Callback_Array_Item_Full));
+ if (event_cb)
+ {
+ pd->event_cb = event_cb;
+ event_cb[num - 1] = array[i];
+ event_cb[num].desc = NULL;
+ event_cb[num].priority = 0;
+ event_cb[num].func = NULL;
+ event_cb[num].user_data = NULL;
+ }
+ }
+ else if (array[i].desc == EFL_IO_READER_EVENT_CAN_READ_CHANGED)
+ _thread_parent_read_listeners_modify(pd, 1);
+ }
+}
+
+static void
+_cb_event_callback_del(void *data, const Efl_Event *event)
+{
+ Efl_Thread_Data *pd = data;
+ const Efl_Callback_Array_Item_Full *array = event->info;
+ int i;
+
+ for (i = 0; array[i].desc != NULL; i++)
+ {
+ if (array[i].desc == EFL_LOOP_EVENT_ARGUMENTS)
+ {
+ Efl_Callback_Array_Item_Full *it;
+
+ if (pd->event_cb)
+ {
+ Eina_Bool shuffle_down = EINA_FALSE;
+
+ for (it = pd->event_cb; it->func; it++)
+ {
+ if ((it->desc == array[i].desc) &&
+ (it->priority == array[i].priority) &&
+ (it->func == array[i].func) &&
+ (it->user_data == array[i].user_data))
+ shuffle_down = EINA_TRUE;
+ if (shuffle_down) it[0] = it[1];
+ }
+ }
+ }
+ else if (array[i].desc == EFL_IO_READER_EVENT_CAN_READ_CHANGED)
+ _thread_parent_read_listeners_modify(pd, -1);
+ }
+}
+
+EFL_CALLBACKS_ARRAY_DEFINE(_event_callback_watch,
+ { EFL_EVENT_CALLBACK_ADD, _cb_event_callback_add },
+ { EFL_EVENT_CALLBACK_DEL, _cb_event_callback_del });
+
+//////////////////////////////////////////////////////////////////////////
+
+EOLIAN static Efl_Object *
+_efl_thread_efl_object_constructor(Eo *obj, Efl_Thread_Data *pd)
+{
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+ efl_event_callback_array_add(obj, _event_callback_watch(), pd);
+ pd->fd.in = -1;
+ pd->fd.out = -1;
+ pd->fd.can_write = EINA_TRUE;
+ pd->ctrl.in = -1;
+ pd->ctrl.out = -1;
+ return obj;
+}
+
+EOLIAN static void
+_efl_thread_efl_object_destructor(Eo *obj, Efl_Thread_Data *pd)
+{
+ if (pd->promise)
+ ERR("Thread being destroyed while real worker has not exited yet.");
+ if (pd->thdat)
+ {
+ eina_thread_join(pd->thread);
+ efl_del(pd->fd.in_handler);
+ efl_del(pd->fd.out_handler);
+ efl_del(pd->ctrl.in_handler);
+ efl_del(pd->ctrl.out_handler);
+ close(pd->fd.in);
+ close(pd->fd.out);
+ close(pd->ctrl.in);
+ close(pd->ctrl.out);
+ pd->fd.in_handler = NULL;
+ pd->fd.out_handler = NULL;
+ pd->ctrl.in_handler = NULL;
+ pd->ctrl.out_handler = NULL;
+ pd->fd.in = -1;
+ pd->fd.out = -1;
+ pd->ctrl.in = -1;
+ pd->ctrl.out = -1;
+ free(pd->thdat);
+ }
+ free(pd->event_cb);
+ pd->event_cb = NULL;
+ efl_destructor(efl_super(obj, MY_CLASS));
+}
+
+EOLIAN static void
+_efl_thread_efl_object_parent_set(Eo *obj, Efl_Thread_Data *pd, Efl_Object *parent)
+{
+ efl_parent_set(efl_super(obj, MY_CLASS), parent);
+ pd->loop = efl_provider_find(parent, EFL_LOOP_CLASS);
+}
+
+EOLIAN static Eina_Future *
+_efl_thread_efl_task_run(Eo *obj, Efl_Thread_Data *pd)
+{
+ Eina_Thread_Priority pri;
+ Thread_Data *thdat;
+ const char *name;
+ int pipe_to_thread[2];
+ int pipe_from_thread[2];
+ unsigned int argc, i, num;
+ Efl_Callback_Array_Item_Full *it;
+ Efl_Task_Data *td = efl_data_scope_get(obj, EFL_TASK_CLASS);
+
+ if (pd->run) return NULL;
+ if (!td) return NULL;
+ thdat = calloc(1, sizeof(Thread_Data));
+ if (!thdat) return NULL;
+ thdat->fd.in = -1;
+ thdat->fd.out = -1;
+ thdat->ctrl.in = -1;
+ thdat->ctrl.out = -1;
+
+ thdat->indata = efl_threadio_indata_get(obj);
+ thdat->outdata = efl_threadio_outdata_get(obj);
+
+ // input/output pipes
+ if (td->flags & EFL_TASK_FLAGS_USE_STDIN)
+ {
+ if (pipe(pipe_to_thread) != 0)
+ {
+ ERR("Can't create to_thread pipe");
+ free(thdat);
+ return NULL;
+ }
+ }
+ if (td->flags & EFL_TASK_FLAGS_USE_STDOUT)
+ {
+ if (pipe(pipe_from_thread) != 0)
+ {
+ ERR("Can't create from_thread pipe");
+ close(pipe_to_thread[0]);
+ close(pipe_to_thread[1]);
+ free(thdat);
+ return NULL;
+ }
+ }
+ if (td->flags & EFL_TASK_FLAGS_USE_STDIN)
+ {
+ thdat->fd.in = pipe_from_thread[1]; // write - input to parent
+ pd->fd.out = pipe_from_thread[0]; // read - output from child
+ eina_file_close_on_exec(thdat->fd.in, EINA_TRUE);
+ eina_file_close_on_exec(pd->fd.out, EINA_TRUE);
+ fcntl(thdat->fd.in, F_SETFL, O_NONBLOCK);
+ fcntl(pd->fd.out, F_SETFL, O_NONBLOCK);
+ pd->fd.out_handler =
+ efl_add(EFL_LOOP_HANDLER_CLASS, obj,
+ efl_loop_handler_fd_set(efl_added, pd->fd.out),
+ efl_event_callback_add
+ (efl_added, EFL_LOOP_HANDLER_EVENT_READ, _cb_thread_parent_out, obj));
+ if (pd->read_listeners > 0)
+ efl_loop_handler_active_set(pd->fd.out_handler, EFL_LOOP_HANDLER_FLAGS_READ);
+ }
+ if (td->flags & EFL_TASK_FLAGS_USE_STDOUT)
+ {
+ pd->fd.in = pipe_to_thread [1]; // write - input to child
+ thdat->fd.out = pipe_to_thread [0]; // read - output from parent
+ eina_file_close_on_exec(pd->fd.in, EINA_TRUE);
+ eina_file_close_on_exec(thdat->fd.out, EINA_TRUE);
+ fcntl(thdat->fd.out, F_SETFL, O_NONBLOCK);
+ fcntl(pd->fd.in, F_SETFL, O_NONBLOCK);
+ pd->fd.in_handler =
+ efl_add(EFL_LOOP_HANDLER_CLASS, obj,
+ efl_loop_handler_fd_set(efl_added, pd->fd.in),
+ efl_event_callback_add
+ (efl_added, EFL_LOOP_HANDLER_EVENT_WRITE, _cb_thread_parent_in, obj));
+ }
+
+ // control pipes
+ if (pipe(pipe_to_thread) != 0)
+ {
+ ERR("Can't create to_thread control pipe");
+ efl_del(pd->fd.in_handler);
+ efl_del(pd->fd.out_handler);
+ close(thdat->fd.in);
+ close(thdat->fd.out);
+ close(pd->fd.in);
+ close(pd->fd.out);
+ pd->fd.in_handler = NULL;
+ pd->fd.out_handler = NULL;
+ pd->fd.in = -1;
+ pd->fd.out = -1;
+ free(thdat);
+ return NULL;
+ }
+ if (pipe(pipe_from_thread) != 0)
+ {
+ ERR("Can't create from_thread control pipe");
+ efl_del(pd->fd.in_handler);
+ efl_del(pd->fd.out_handler);
+ close(pipe_to_thread[0]);
+ close(pipe_to_thread[1]);
+ close(thdat->fd.in);
+ close(thdat->fd.out);
+ close(pd->fd.in);
+ close(pd->fd.out);
+ pd->fd.in_handler = NULL;
+ pd->fd.out_handler = NULL;
+ pd->fd.in = -1;
+ pd->fd.out = -1;
+ free(thdat);
+ return NULL;
+ }
+ thdat->ctrl.in = pipe_from_thread[1]; // write - input to parent
+ thdat->ctrl.out = pipe_to_thread [0]; // read - output from parent
+ pd->ctrl.in = pipe_to_thread [1]; // write - input to child
+ pd->ctrl.out = pipe_from_thread[0]; // read - output from child
+ fcntl(thdat->ctrl.in, F_SETFL, O_NONBLOCK);
+ fcntl(thdat->ctrl.out, F_SETFL, O_NONBLOCK);
+ fcntl(pd->ctrl.in, F_SETFL, O_NONBLOCK);
+ fcntl(pd->ctrl.out, F_SETFL, O_NONBLOCK);
+ eina_file_close_on_exec(pd->ctrl.in, EINA_TRUE);
+ eina_file_close_on_exec(pd->ctrl.out, EINA_TRUE);
+ eina_file_close_on_exec(thdat->ctrl.in, EINA_TRUE);
+ eina_file_close_on_exec(thdat->ctrl.out, EINA_TRUE);
+ pd->ctrl.in_handler =
+ efl_add(EFL_LOOP_HANDLER_CLASS, obj,
+ efl_loop_handler_fd_set(efl_added, pd->ctrl.in));
+ pd->ctrl.out_handler =
+ efl_add(EFL_LOOP_HANDLER_CLASS, obj,
+ efl_loop_handler_fd_set(efl_added, pd->ctrl.out),
+ efl_event_callback_add
+ (efl_added, EFL_LOOP_HANDLER_EVENT_READ, _cb_thread_parent_ctrl_out, obj),
+ efl_loop_handler_active_set
+ (efl_added, EFL_LOOP_HANDLER_FLAGS_READ));
+
+ switch (efl_task_priority_get(obj))
+ {
+ case EFL_TASK_PRIORITY_BACKGROUND:
+ pri = EINA_THREAD_IDLE;
+ break;
+ case EFL_TASK_PRIORITY_HIGH:
+ case EFL_TASK_PRIORITY_ULTRA:
+ pri = EINA_THREAD_URGENT;
+ break;
+ case EFL_TASK_PRIORITY_LOW:
+ pri = EINA_THREAD_BACKGROUND;
+ break;
+ case EFL_TASK_PRIORITY_NORMAL:
+ default:
+ pri = EINA_THREAD_NORMAL;
+ break;
+ }
+ name = efl_name_get(obj);
+ if (name) thdat->name = eina_stringshare_add(name);
+
+ argc = efl_task_arg_count_get(obj);
+ if (argc > 0)
+ {
+ thdat->args.argc = argc;
+ thdat->args.argv = malloc(argc * sizeof(char *));
+ if (thdat->args.argv)
+ {
+ for (i = 0; i < argc; i++)
+ {
+ const char *argv = efl_task_arg_value_get(obj, i);
+ if (argv)
+ thdat->args.argv[i] = eina_stringshare_add(argv);
+ else
+ thdat->args.argv[i] = NULL;
+ }
+ }
+ // XXX: if malloc fails?
+ }
+ if (pd->event_cb)
+ {
+ num = 0;
+ for (it = pd->event_cb; it->func; it++) num++;
+ thdat->event_cb = malloc((num + 1) * sizeof(Efl_Callback_Array_Item_Full));
+ if (thdat->event_cb)
+ memcpy(thdat->event_cb, pd->event_cb,
+ (num + 1) * sizeof(Efl_Callback_Array_Item_Full));
+ // XXX: if malloc fails?
+ }
+
+ // env data - ignore as other end will share same env
+
+ if (!eina_thread_create(&(pd->thread), pri, -1, _efl_thread_main, thdat))
+ {
+ for (i = 0; i < thdat->args.argc; i++)
+ eina_stringshare_del(thdat->args.argv[i]);
+ free(thdat->args.argv);
+ efl_del(pd->fd.in_handler);
+ efl_del(pd->fd.out_handler);
+ efl_del(pd->ctrl.in_handler);
+ efl_del(pd->ctrl.out_handler);
+ close(pd->fd.in);
+ close(pd->fd.out);
+ close(pd->ctrl.in);
+ close(pd->ctrl.out);
+ close(thdat->fd.in);
+ close(thdat->fd.out);
+ close(thdat->ctrl.in);
+ close(thdat->ctrl.out);
+ free(thdat);
+ pd->fd.in_handler = NULL;
+ pd->fd.out_handler = NULL;
+ pd->ctrl.in_handler = NULL;
+ pd->ctrl.out_handler = NULL;
+ pd->fd.in = -1;
+ pd->fd.out = -1;
+ pd->ctrl.in = -1;
+ pd->ctrl.out = -1;
+ return NULL;
+ }
+ pd->thdat = thdat;
+ pd->run = EINA_TRUE;
+ pd->promise = efl_loop_promise_new(obj, _run_cancel_cb, obj);
+ Eina_Future *f = eina_future_new(pd->promise);
+ return efl_future_Eina_FutureXXX_then(obj, f);
+}
+
+EOLIAN static void
+_efl_thread_efl_task_end(Eo *obj EINA_UNUSED, Efl_Thread_Data *pd)
+{
+ if (pd->end_sent) return;
+ if (pd->thdat)
+ {
+ Control_Data cmd;
+
+ pd->end_sent = EINA_TRUE;
+ memset(&cmd, 0, sizeof(cmd));
+ cmd.d.command = CMD_EXIT;
+ write(pd->ctrl.in, &cmd, sizeof(Control_Data));
+ }
+}
+
+EOLIAN static Eina_Error
+_efl_thread_efl_io_closer_close(Eo *obj, Efl_Thread_Data *pd)
+{
+ if (!pd->thdat) return 0;
+ EINA_SAFETY_ON_TRUE_RETURN_VAL(efl_io_closer_closed_get(obj), EBADF);
+ efl_io_writer_can_write_set(obj, EINA_FALSE);
+ efl_io_reader_can_read_set(obj, EINA_FALSE);
+ efl_io_reader_eos_set(obj, EINA_TRUE);
+ if (pd->fd.in >= 0) close(pd->fd.in);
+ if (pd->fd.out >= 0) close(pd->fd.out);
+ if (pd->fd.in_handler) efl_del(pd->fd.in_handler);
+ if (pd->fd.out_handler) efl_del(pd->fd.out_handler);
+ pd->fd.in = -1;
+ pd->fd.out = -1;
+ pd->fd.in_handler = NULL;
+ pd->fd.out_handler = NULL;
+ return 0;
+}
+
+EOLIAN static Eina_Bool
+_efl_thread_efl_io_closer_closed_get(const Eo *obj EINA_UNUSED, Efl_Thread_Data *pd)
+{
+ if ((pd->fd.in == -1) && (pd->fd.out == -1)) return EINA_TRUE;
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Error
+_efl_thread_efl_io_reader_read(Eo *obj, Efl_Thread_Data *pd, Eina_Rw_Slice *rw_slice)
+{
+ ssize_t r;
+
+ errno = 0;
+ if (pd->fd.out == -1) goto err;
+
+ do
+ {
+ errno = 0;
+ r = read(pd->fd.out, rw_slice->mem, rw_slice->len);
+ if (r == -1)
+ {
+ if (errno == EINTR) continue;
+ goto err;
+ }
+ }
+ while (r == -1);
+
+ rw_slice->len = r;
+ if (r == 0)
+ {
+ efl_io_reader_can_read_set(obj, EINA_FALSE);
+ efl_io_reader_eos_set(obj, EINA_TRUE);
+ close(pd->fd.out);
+ pd->fd.out = -1;
+ efl_del(pd->fd.out_handler);
+ pd->fd.out_handler = NULL;
+ _thread_exit_eval(obj, pd);
+ return EPIPE;
+ }
+ return 0;
+err:
+ if ((pd->fd.out != -1) && (errno != EAGAIN))
+ {
+ close(pd->fd.out);
+ pd->fd.out = -1;
+ efl_del(pd->fd.out_handler);
+ pd->fd.out_handler = NULL;
+ }
+ rw_slice->len = 0;
+ rw_slice->mem = NULL;
+ efl_io_reader_can_read_set(obj, EINA_FALSE);
+ _thread_exit_eval(obj, pd);
+ return EINVAL;
+}
+
+EOLIAN static void
+_efl_thread_efl_io_reader_can_read_set(Eo *obj, Efl_Thread_Data *pd, Eina_Bool can_read)
+{
+ Eina_Bool old = efl_io_reader_can_read_get(obj);
+ if (old == can_read) return;
+ pd->fd.can_read = can_read;
+ if (!pd->fd.out_handler) return;
+ if (can_read)
+ efl_loop_handler_active_set(pd->fd.out_handler, 0);
+ else
+ efl_loop_handler_active_set(pd->fd.out_handler,
+ EFL_LOOP_HANDLER_FLAGS_READ);
+ efl_event_callback_call(obj, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL);
+}
+
+EOLIAN static Eina_Bool
+_efl_thread_efl_io_reader_can_read_get(const Eo *obj EINA_UNUSED, Efl_Thread_Data *pd)
+{
+ return pd->fd.can_read;
+}
+
+EOLIAN static void
+_efl_thread_efl_io_reader_eos_set(Eo *obj, Efl_Thread_Data *pd, Eina_Bool is_eos)
+{
+ Eina_Bool old = efl_io_reader_eos_get(obj);
+ if (old == is_eos) return;
+
+ pd->fd.eos_read = is_eos;
+ if (!is_eos) return;
+ if (pd->fd.out_handler)
+ efl_loop_handler_active_set(pd->fd.out_handler, 0);
+ efl_event_callback_call(obj, EFL_IO_READER_EVENT_EOS, NULL);
+}
+
+EOLIAN static Eina_Bool
+_efl_thread_efl_io_reader_eos_get(const Eo *obj EINA_UNUSED, Efl_Thread_Data *pd)
+{
+ return pd->fd.eos_read;
+}
+
+EOLIAN static Eina_Error
+_efl_thread_efl_io_writer_write(Eo *obj, Efl_Thread_Data *pd, Eina_Slice *slice, Eina_Slice *remaining)
+{
+ ssize_t r;
+
+ errno = 0;
+ if (pd->fd.in == -1) goto err;
+
+ do
+ {
+ errno = 0;
+ r = write(pd->fd.in, slice->mem, slice->len);
+ if (r == -1)
+ {
+ if (errno == EINTR) continue;
+ goto err;
+ }
+ }
+ while (r == -1);
+
+ if (remaining)
+ {
+ remaining->len = slice->len - r;
+ remaining->bytes = slice->bytes + r;
+ }
+ slice->len = r;
+
+ if ((slice) && (slice->len > 0))
+ efl_io_writer_can_write_set(obj, EINA_FALSE);
+ if (r == 0)
+ {
+ close(pd->fd.in);
+ pd->fd.in = -1;
+ efl_del(pd->fd.in_handler);
+ pd->fd.in_handler = NULL;
+ _thread_exit_eval(obj, pd);
+ return EPIPE;
+ }
+ return 0;
+err:
+ if ((pd->fd.in != -1) && (errno != EAGAIN))
+ {
+ close(pd->fd.in);
+ pd->fd.in = -1;
+ efl_del(pd->fd.in_handler);
+ pd->fd.in_handler = NULL;
+ }
+ if (remaining) *remaining = *slice;
+ slice->len = 0;
+ slice->mem = NULL;
+ efl_io_writer_can_write_set(obj, EINA_FALSE);
+ _thread_exit_eval(obj, pd);
+ return EINVAL;
+}
+
+EOLIAN static void
+_efl_thread_efl_io_writer_can_write_set(Eo *obj, Efl_Thread_Data *pd, Eina_Bool can_write)
+{
+ Eina_Bool old = efl_io_writer_can_write_get(obj);
+ if (old == can_write) return;
+ pd->fd.can_write = can_write;
+ if (can_write)
+ efl_loop_handler_active_set(pd->fd.in_handler, 0);
+ else
+ efl_loop_handler_active_set(pd->fd.in_handler,
+ EFL_LOOP_HANDLER_FLAGS_WRITE);
+ efl_event_callback_call(obj, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL);
+}
+
+EOLIAN static Eina_Bool
+_efl_thread_efl_io_writer_can_write_get(const Eo *obj EINA_UNUSED, Efl_Thread_Data *pd)
+{
+ return pd->fd.can_write;
+}
+
+void
+_appthread_threadio_call(Eo *obj EINA_UNUSED, Efl_Appthread_Data *pd,
+ void *func_data, EFlThreadIOCall func, Eina_Free_Cb func_free_cb)
+{
+ Thread_Data *thdat = pd->thdat;
+ Control_Data cmd;
+
+ memset(&cmd, 0, sizeof(cmd));
+ cmd.d.command = CMD_CALL;
+ cmd.d.ptr[0] = func;
+ cmd.d.ptr[1] = func_data;
+ cmd.d.ptr[2] = func_free_cb;
+ write(thdat->ctrl.in, &cmd, sizeof(Control_Data));
+}
+
+EOLIAN static void
+_efl_thread_efl_threadio_call(Eo *obj EINA_UNUSED, Efl_Thread_Data *pd,
+ void *func_data, EFlThreadIOCall func, Eina_Free_Cb func_free_cb)
+{
+ Control_Data cmd;
+
+ memset(&cmd, 0, sizeof(cmd));
+ cmd.d.command = CMD_CALL;
+ cmd.d.ptr[0] = func;
+ cmd.d.ptr[1] = func_data;
+ cmd.d.ptr[2] = func_free_cb;
+ write(pd->ctrl.in, &cmd, sizeof(Control_Data));
+}
+
+void *
+_appthread_threadio_call_sync(Eo *obj EINA_UNUSED, Efl_Appthread_Data *pd,
+ void *func_data, EFlThreadIOCallSync func, Eina_Free_Cb func_free_cb)
+{
+ Thread_Data *thdat = pd->thdat;
+ Control_Data cmd;
+ Control_Reply *rep;
+ void *data;
+
+ memset(&cmd, 0, sizeof(cmd));
+ cmd.d.command = CMD_CALL_SYNC;
+ cmd.d.ptr[0] = func;
+ cmd.d.ptr[1] = func_data;
+ cmd.d.ptr[2] = func_free_cb;
+ rep = malloc(sizeof(Control_Reply));
+ if (!rep) return NULL;
+ cmd.d.ptr[3] = rep;
+ rep->data = NULL;
+ eina_semaphore_new(&(rep->sem), 0);
+ write(thdat->ctrl.in, &cmd, sizeof(Control_Data));
+ eina_semaphore_lock(&(rep->sem));
+ data = rep->data;
+ free(rep);
+ return data;
+}
+
+EOLIAN static void *
+_efl_thread_efl_threadio_call_sync(Eo *obj EINA_UNUSED, Efl_Thread_Data *pd,
+ void *func_data, EFlThreadIOCallSync func, Eina_Free_Cb func_free_cb)
+{
+ Control_Data cmd;
+ Control_Reply *rep;
+ void *data;
+
+ memset(&cmd, 0, sizeof(cmd));
+ cmd.d.command = CMD_CALL_SYNC;
+ cmd.d.ptr[0] = func;
+ cmd.d.ptr[1] = func_data;
+ cmd.d.ptr[2] = func_free_cb;
+ rep = malloc(sizeof(Control_Reply));
+ if (!rep) return NULL;
+ cmd.d.ptr[3] = rep;
+ rep->data = NULL;
+ eina_semaphore_new(&(rep->sem), 0);
+ write(pd->ctrl.in, &cmd, sizeof(Control_Data));
+ eina_semaphore_lock(&(rep->sem));
+ data = rep->data;
+ free(rep);
+ return data;
+}
+
+//////////////////////////////////////////////////////////////////////////
+
+#include "efl_thread.eo.c"
diff --git a/src/lib/ecore/efl_thread.eo b/src/lib/ecore/efl_thread.eo
new file mode 100644
index 0000000000..565bca43c7
--- /dev/null
+++ b/src/lib/ecore/efl_thread.eo
@@ -0,0 +1,21 @@
+class Efl.Thread (Efl.Task, Efl.ThreadIO)
+{
+ methods {
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Object.destructor;
+ Efl.Object.parent { set; }
+ Efl.Task.run;
+ Efl.Task.end;
+ Efl.Io.Closer.close;
+ Efl.Io.Closer.closed { get; }
+ Efl.Io.Reader.read;
+ Efl.Io.Reader.can_read { get; set; }
+ Efl.Io.Reader.eos { get; set; }
+ Efl.Io.Writer.write;
+ Efl.Io.Writer.can_write { get; set; }
+ Efl.ThreadIO.call;
+ Efl.ThreadIO.call_sync;
+ }
+}
diff --git a/src/lib/ecore/efl_threadio.c b/src/lib/ecore/efl_threadio.c
new file mode 100644
index 0000000000..9e21f40847
--- /dev/null
+++ b/src/lib/ecore/efl_threadio.c
@@ -0,0 +1,59 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <Ecore.h>
+
+#include "ecore_private.h"
+
+#define MY_CLASS EFL_THREADIO_CLASS
+
+typedef struct _Efl_ThreadIO_Data Efl_ThreadIO_Data;
+
+struct _Efl_ThreadIO_Data
+{
+ void *indata, *outdata;
+};
+
+//////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////
+
+EOLIAN static void
+_efl_threadio_indata_set(Eo *obj EINA_UNUSED, Efl_ThreadIO_Data *pd, void *data)
+{
+ pd->indata = data;
+}
+
+EOLIAN static void *
+_efl_threadio_indata_get(const Eo *obj EINA_UNUSED, Efl_ThreadIO_Data *pd)
+{
+ return pd->indata;
+}
+
+EOLIAN static void
+_efl_threadio_outdata_set(Eo *obj EINA_UNUSED, Efl_ThreadIO_Data *pd, void *data)
+{
+ pd->outdata = data;
+}
+
+EOLIAN static void *
+_efl_threadio_outdata_get(const Eo *obj EINA_UNUSED, Efl_ThreadIO_Data *pd)
+{
+ return pd->outdata;
+}
+
+EOLIAN static void
+_efl_threadio_call(Eo *obj EINA_UNUSED, Efl_ThreadIO_Data *pd EINA_UNUSED, void *func_data EINA_UNUSED, EFlThreadIOCall func EINA_UNUSED, Eina_Free_Cb func_free_cb EINA_UNUSED)
+{
+}
+
+EOLIAN static void *
+_efl_threadio_call_sync(Eo *obj EINA_UNUSED, Efl_ThreadIO_Data *pd EINA_UNUSED, void *func_data EINA_UNUSED, EFlThreadIOCallSync func EINA_UNUSED, Eina_Free_Cb func_free_cb EINA_UNUSED)
+{
+ return NULL;
+}
+
+//////////////////////////////////////////////////////////////////////////
+
+#include "efl_threadio.eo.c"
diff --git a/src/lib/ecore/efl_threadio.eo b/src/lib/ecore/efl_threadio.eo
new file mode 100644
index 0000000000..1d3af45cdc
--- /dev/null
+++ b/src/lib/ecore/efl_threadio.eo
@@ -0,0 +1,52 @@
+import efl_object;
+
+function EFlThreadIOCall {
+ [[ A Function to call on the "other end" of a thread obvject ]]
+ params {
+ @cref event: Efl.Event; [[ ]]
+ }
+};
+
+function EFlThreadIOCallSync {
+ [[ A Function to call on the "other end" of a thread obvject ]]
+ params {
+ @cref event: Efl.Event; [[ ]]
+ }
+ return: void_ptr; [[ ]]
+};
+
+mixin Efl.ThreadIO
+{
+ [[ ]]
+ methods {
+ @property indata {
+ set { }
+ get { }
+ values {
+ data: void_ptr; [[ ]]
+ }
+ }
+ @property outdata {
+ set { }
+ get { }
+ values {
+ data: void_ptr; [[ ]]
+ }
+ }
+ call {
+ params {
+ func: EFlThreadIOCall; [[ ]]
+ }
+ }
+ call_sync {
+ params {
+ func: EFlThreadIOCallSync; [[ ]]
+ }
+ return: void_ptr; [[ ]]
+ }
+ }
+ events {
+ }
+ implements {
+ }
+}
diff --git a/src/lib/ecore_audio/Ecore_Audio.h b/src/lib/ecore_audio/Ecore_Audio.h
index e562205ca1..717c36c3fd 100644
--- a/src/lib/ecore_audio/Ecore_Audio.h
+++ b/src/lib/ecore_audio/Ecore_Audio.h
@@ -9,15 +9,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ECORE_AUDIO_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ECORE_AUDIO_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -28,7 +28,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
/**
* @file Ecore_Audio.h
@@ -192,6 +192,23 @@ EAPI int ecore_audio_init(void);
*/
EAPI int ecore_audio_shutdown(void);
+//Legacy compatibility code
+
+/**
+ * @brief Get the name of the object
+ *
+ * @since 1.8
+ *
+ */
+EAPI const char* ecore_audio_obj_name_get(const Efl_Object* obj);
+/**
+ * @brief Name of the object
+ *
+ * @since 1.8
+ *
+ */
+EAPI void ecore_audio_obj_name_set(Efl_Object* obj, const char *name);
+
#include <ecore_audio_obj.h>
#include <ecore_audio_obj_in.h>
#include <ecore_audio_obj_out.h>
diff --git a/src/lib/ecore_audio/ecore_audio.c b/src/lib/ecore_audio/ecore_audio.c
index f57eca8256..1c0345ed73 100644
--- a/src/lib/ecore_audio/ecore_audio.c
+++ b/src/lib/ecore_audio/ecore_audio.c
@@ -68,10 +68,16 @@ ecore_audio_shutdown(void)
return _ecore_audio_init_count;
#ifdef HAVE_SNDFILE
- ecore_audio_sndfile_lib_unload();
+// explicitly disabled - yes, we know to "fix a leak" you unload here, but
+// objects may still exist at this point and may access functions/symbols
+// from sndfile
+// ecore_audio_sndfile_lib_unload();
#endif /* HAVE_SNDFILE */
#ifdef HAVE_PULSE
- ecore_audio_pulse_lib_unload();
+// explicitly disabled - yes, we know to "fix a leak" you unload here, but
+// objects may still exist at this point and may access functions/symbols
+// from pulseaudio
+// ecore_audio_pulse_lib_unload();
#endif /* HAVE_PULSE */
/* FIXME: Shutdown all the inputs and outputs first */
@@ -97,11 +103,7 @@ ecore_audio_pulse_lib_load(void)
{
if (ecore_audio_pulse_lib)
{
- if (!ecore_audio_pulse_lib->mod)
- {
- ERR("Cannot find libpulse at runtime!");
- return EINA_FALSE;
- }
+ if (!ecore_audio_pulse_lib->mod) return EINA_FALSE;
return EINA_TRUE;
}
@@ -167,6 +169,7 @@ err:
{
eina_module_free(ecore_audio_pulse_lib->mod);
ecore_audio_pulse_lib->mod = NULL;
+ ERR("Cannot find libpulse at runtime!");
}
return EINA_FALSE;
}
@@ -190,11 +193,7 @@ ecore_audio_sndfile_lib_load(void)
{
if (ecore_audio_sndfile_lib)
{
- if (!ecore_audio_sndfile_lib->mod)
- {
- ERR("Cannot find libsndfile at runtime!");
- return EINA_FALSE;
- }
+ if (!ecore_audio_sndfile_lib->mod) return EINA_FALSE;
return EINA_TRUE;
}
@@ -243,6 +242,7 @@ err:
{
eina_module_free(ecore_audio_sndfile_lib->mod);
ecore_audio_sndfile_lib->mod = NULL;
+ ERR("Cannot find libsndfile at runtime!");
}
return EINA_FALSE;
}
@@ -260,6 +260,20 @@ ecore_audio_sndfile_lib_unload(void)
}
#endif /* HAVE_SNDFILE */
+
+EAPI const char*
+ecore_audio_obj_name_get(const Efl_Object* obj)
+{
+ return efl_name_get(obj);
+}
+
+EAPI void
+ecore_audio_obj_name_set(Efl_Object* obj, const char *name)
+{
+ efl_name_set(obj, name);
+}
+
+
/**
* @}
*/
diff --git a/src/lib/ecore_audio/ecore_audio.eo b/src/lib/ecore_audio/ecore_audio.eo
index 230804b560..988ba007be 100644
--- a/src/lib/ecore_audio/ecore_audio.eo
+++ b/src/lib/ecore_audio/ecore_audio.eo
@@ -19,19 +19,6 @@ class Ecore.Audio (Efl.Object)
eo_prefix: ecore_audio_obj;
data: Ecore_Audio_Object;
methods {
- @property name {
- [[Name of the object
-
- @since 1.8
- ]]
- set {
- }
- get {
- }
- values {
- name: string; [[Name]]
- }
- }
@property paused {
[[Pauses state of the object
diff --git a/src/lib/ecore_audio/ecore_audio_in.eo b/src/lib/ecore_audio/ecore_audio_in.eo
index 6e3fbc0527..d46f99d64a 100644
--- a/src/lib/ecore_audio/ecore_audio_in.eo
+++ b/src/lib/ecore_audio/ecore_audio_in.eo
@@ -155,8 +155,8 @@ class Ecore.Audio.In (Ecore.Audio)
Ecore.Audio.vio_set;
}
events {
- in,looped; [[Called when an input has looped.]]
- in,stopped; [[Called when an input has stopped playing.]]
- in,samplerate,changed; [[Called when the input samplerate has changed.]]
+ in,looped: void; [[Called when an input has looped.]]
+ in,stopped: void; [[Called when an input has stopped playing.]]
+ in,samplerate,changed: void; [[Called when the input samplerate has changed.]]
}
}
diff --git a/src/lib/ecore_audio/ecore_audio_obj.c b/src/lib/ecore_audio/ecore_audio_obj.c
index 5c7abe2688..a526706d63 100644
--- a/src/lib/ecore_audio/ecore_audio_obj.c
+++ b/src/lib/ecore_audio/ecore_audio_obj.c
@@ -18,17 +18,6 @@
#define MY_CLASS ECORE_AUDIO_CLASS
#define MY_CLASS_NAME "Ecore_Audio"
-EOLIAN static void
-_ecore_audio_name_set(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Object *obj, const char *name)
-{
- eina_stringshare_replace(&obj->name, name);
-}
-
-EOLIAN static const char*
-_ecore_audio_name_get(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Object *obj)
-{
- return obj->name;
-}
EOLIAN static void
_ecore_audio_paused_set(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Object *obj, Eina_Bool paused)
@@ -37,7 +26,7 @@ _ecore_audio_paused_set(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Object *obj, Eina_Bo
}
EOLIAN static Eina_Bool
-_ecore_audio_paused_get(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Object *obj)
+_ecore_audio_paused_get(const Eo *eo_obj EINA_UNUSED, Ecore_Audio_Object *obj)
{
return obj->paused;
}
@@ -49,7 +38,7 @@ _ecore_audio_volume_set(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Object *obj, double
}
EOLIAN static double
-_ecore_audio_volume_get(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Object *obj)
+_ecore_audio_volume_get(const Eo *eo_obj EINA_UNUSED, Ecore_Audio_Object *obj)
{
return obj->volume;
}
diff --git a/src/lib/ecore_audio/ecore_audio_obj_in.c b/src/lib/ecore_audio/ecore_audio_obj_in.c
index ff8bd5b900..b2a8f912c3 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_in.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_in.c
@@ -31,7 +31,7 @@ _ecore_audio_in_speed_set(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj, double
}
EOLIAN static double
-_ecore_audio_in_speed_get(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj)
+_ecore_audio_in_speed_get(const Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj)
{
return obj->speed;
}
@@ -45,7 +45,7 @@ _ecore_audio_in_samplerate_set(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj, i
}
EOLIAN static int
-_ecore_audio_in_samplerate_get(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj)
+_ecore_audio_in_samplerate_get(const Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj)
{
return obj->samplerate;;
}
@@ -60,7 +60,7 @@ _ecore_audio_in_channels_set(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj, int
}
EOLIAN static int
-_ecore_audio_in_channels_get(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj)
+_ecore_audio_in_channels_get(const Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj)
{
return obj->channels;
}
@@ -72,24 +72,25 @@ _ecore_audio_in_looped_set(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj, Eina_
}
EOLIAN static Eina_Bool
-_ecore_audio_in_looped_get(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj)
+_ecore_audio_in_looped_get(const Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj)
{
return obj->looped;
}
EOLIAN static double
-_ecore_audio_in_length_get(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj)
+_ecore_audio_in_length_get(const Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj)
{
return obj->length;;
}
EOLIAN static double
-_ecore_audio_in_remaining_get(Eo *eo_obj, Ecore_Audio_Input *obj)
+_ecore_audio_in_remaining_get(const Eo *eo_obj, Ecore_Audio_Input *obj)
{
if (!obj->seekable) return -1;
else {
double ret = 0.0;
- ret = ecore_audio_obj_in_seek(eo_obj, 0, SEEK_CUR);
+ /* XXX const */
+ ret = ecore_audio_obj_in_seek((Eo *)eo_obj, 0, SEEK_CUR);
return obj->length - ret;
}
}
@@ -134,7 +135,7 @@ _ecore_audio_in_read_internal(Eo *eo_obj, Ecore_Audio_Input *_pd EINA_UNUSED, vo
}
EOLIAN static Eo*
-_ecore_audio_in_output_get(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj)
+_ecore_audio_in_output_get(const Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj)
{
return obj->output;
}
diff --git a/src/lib/ecore_audio/ecore_audio_obj_in.h b/src/lib/ecore_audio/ecore_audio_obj_in.h
index 9dc0760863..478ddd434a 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_in.h
+++ b/src/lib/ecore_audio/ecore_audio_obj_in.h
@@ -1,6 +1,9 @@
#ifndef ECORE_AUDIO_OBJ_IN_H
#define ECORE_AUDIO_OBJ_IN_H
+/* ssize_t needed in .eo.h */
+#include <sys/types.h>
+
#include <Eina.h>
#include <Eo.h>
diff --git a/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c b/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c
index 22ad63d758..bebfba59d2 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c
@@ -90,7 +90,7 @@ _ecore_audio_in_sndfile_ecore_audio_source_set(Eo *eo_obj, Ecore_Audio_In_Sndfil
}
EOLIAN static const char*
-_ecore_audio_in_sndfile_ecore_audio_source_get(Eo *eo_obj, Ecore_Audio_In_Sndfile_Data *_pd EINA_UNUSED)
+_ecore_audio_in_sndfile_ecore_audio_source_get(const Eo *eo_obj, Ecore_Audio_In_Sndfile_Data *_pd EINA_UNUSED)
{
Ecore_Audio_Object *obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_CLASS);
return obj->source;
@@ -129,7 +129,7 @@ _ecore_audio_in_sndfile_ecore_audio_format_set(Eo *eo_obj, Ecore_Audio_In_Sndfil
}
EOLIAN static Ecore_Audio_Format
-_ecore_audio_in_sndfile_ecore_audio_format_get(Eo *eo_obj, Ecore_Audio_In_Sndfile_Data *_pd EINA_UNUSED)
+_ecore_audio_in_sndfile_ecore_audio_format_get(const Eo *eo_obj, Ecore_Audio_In_Sndfile_Data *_pd EINA_UNUSED)
{
Ecore_Audio_Object *obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_CLASS);
return obj->format;;
@@ -203,7 +203,6 @@ _ecore_audio_in_sndfile_efl_object_destructor(Eo *eo_obj, Ecore_Audio_In_Sndfile
{
Ecore_Audio_Object *ea_obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_CLASS);
- if (!ESF_LOAD()) return;
if (obj->handle)
ESF_CALL(sf_close)(obj->handle);
diff --git a/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c b/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c
index 2916de4acb..5d61e0eb3e 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c
@@ -124,7 +124,7 @@ static Eina_Bool _input_attach_internal(Eo *eo_obj, Eo *in)
ss.rate = ecore_audio_obj_in_samplerate_get(in);
speed = ecore_audio_obj_in_speed_get(in);
ss.channels = ecore_audio_obj_in_channels_get(in);
- name = ecore_audio_obj_name_get(in);
+ name = efl_name_get(in);
ss.rate = ss.rate * speed;
diff --git a/src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c b/src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c
index ab8ad7ba62..2c0b4ba3ee 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c
@@ -116,7 +116,7 @@ _ecore_audio_out_sndfile_ecore_audio_source_set(Eo *eo_obj, Ecore_Audio_Out_Sndf
}
EOLIAN static const char*
-_ecore_audio_out_sndfile_ecore_audio_source_get(Eo *eo_obj, Ecore_Audio_Out_Sndfile_Data *_pd EINA_UNUSED)
+_ecore_audio_out_sndfile_ecore_audio_source_get(const Eo *eo_obj, Ecore_Audio_Out_Sndfile_Data *_pd EINA_UNUSED)
{
Ecore_Audio_Object *obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_CLASS);
return obj->source;
@@ -155,7 +155,7 @@ _ecore_audio_out_sndfile_ecore_audio_format_set(Eo *eo_obj, Ecore_Audio_Out_Sndf
}
EOLIAN static Ecore_Audio_Format
-_ecore_audio_out_sndfile_ecore_audio_format_get(Eo *eo_obj, Ecore_Audio_Out_Sndfile_Data *_pd EINA_UNUSED)
+_ecore_audio_out_sndfile_ecore_audio_format_get(const Eo *eo_obj, Ecore_Audio_Out_Sndfile_Data *_pd EINA_UNUSED)
{
Ecore_Audio_Object *obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_CLASS);
return obj->format;
@@ -180,7 +180,6 @@ _ecore_audio_out_sndfile_efl_object_destructor(Eo *eo_obj, Ecore_Audio_Out_Sndfi
{
Ecore_Audio_Output *out_obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_OUT_CLASS);
- if (!ESF_LOAD()) return;
if (obj->handle)
ESF_CALL(sf_close)(obj->handle);
if (out_obj->write_idler)
diff --git a/src/lib/ecore_audio/ecore_audio_obj_out_wasapi.c b/src/lib/ecore_audio/ecore_audio_obj_out_wasapi.c
index 772a8262f9..c016be9226 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_out_wasapi.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_out_wasapi.c
@@ -57,6 +57,7 @@ struct _Ecore_Audio_Out_Wasapi_Data
IAudioRenderClient *render;
IAudioStreamVolume *volume;
WAVEFORMATEXTENSIBLE *wave_format;
+ Ecore_Win32_Handler *handler;
HANDLE event;
UINT32 NumBufferFrames;
Eina_Bool spec_format;
@@ -97,20 +98,25 @@ _ecore_audio_out_wasapi_ecore_audio_volume_set(Eo *eo_obj EINA_UNUSED, Ecore_Aud
}
}
+static void
+_clear(Ecore_Audio_Out_Wasapi_Data *_pd)
+{
+ if (_pd->event) CloseHandle(_pd->event);
+ if (_pd->handler) ecore_main_win32_handler_del(_pd->handler);
+ if (_pd->render) _pd->render->lpVtbl->Release(_pd->render);
+ if (_pd->client) _pd->client->lpVtbl->Release(_pd->client);
+
+ _pd->event = NULL;
+ _pd->handler = NULL;
+ _pd->render = NULL;
+ _pd->client = NULL;
+ _pd->play = EINA_FALSE;
+}
static void
_close_cb(void *data, const Efl_Event *event EINA_UNUSED)
{
- Ecore_Audio_Out_Wasapi_Data *_pd = data;
-
- if (_pd->event) CloseHandle(_pd->event);
- if (_pd->render) _pd->render->lpVtbl->Release(_pd->render);
- if (_pd->client) _pd->client->lpVtbl->Release(_pd->client);
-
- _pd->event = NULL;
- _pd->render = NULL;
- _pd->client = NULL;
- _pd->play = EINA_FALSE;
+ _clear(data);
}
static void
@@ -224,7 +230,9 @@ _write_cb(void *data, Ecore_Win32_Handler *wh EINA_UNUSED)
if (_pd->client) _pd->client->lpVtbl->Stop(_pd->client);
- ecore_main_win32_handler_del(_pd->event);
+ if (_pd->handler) ecore_main_win32_handler_del(_pd->handler);
+ _pd->handler = NULL;
+
efl_event_callback_call(_pd->out, ECORE_AUDIO_OUT_WASAPI_EVENT_STOP, NULL);
_pd->play = EINA_FALSE;
@@ -589,8 +597,9 @@ _ecore_audio_out_wasapi_efl_object_constructor(Eo *eo_obj, Ecore_Audio_Out_Wasap
}
EOLIAN static void
-_ecore_audio_out_wasapi_efl_object_destructor(Eo *eo_obj, Ecore_Audio_Out_Wasapi_Data *_pd EINA_UNUSED)
+_ecore_audio_out_wasapi_efl_object_destructor(Eo *eo_obj, Ecore_Audio_Out_Wasapi_Data *_pd)
{
+ _clear(_pd);
client_connect_count--;
efl_destructor(efl_super(eo_obj, MY_CLASS));
diff --git a/src/lib/ecore_audio/ecore_audio_out_pulse.eo b/src/lib/ecore_audio/ecore_audio_out_pulse.eo
index d7a478f226..2e97f4ea08 100644
--- a/src/lib/ecore_audio/ecore_audio_out_pulse.eo
+++ b/src/lib/ecore_audio/ecore_audio_out_pulse.eo
@@ -11,7 +11,7 @@ class Ecore.Audio.Out.Pulse (Ecore.Audio.Out)
Ecore.Audio.Out.input_detach;
}
events {
- context,ready; [[Called when the output is ready for playback.]]
- context,fail; [[Called when context fails.]]
+ context,ready: void; [[Called when the output is ready for playback.]]
+ context,fail: void; [[Called when context fails.]]
}
}
diff --git a/src/lib/ecore_audio/ecore_audio_out_wasapi.eo b/src/lib/ecore_audio/ecore_audio_out_wasapi.eo
index fd362f18c0..14c912753b 100644
--- a/src/lib/ecore_audio/ecore_audio_out_wasapi.eo
+++ b/src/lib/ecore_audio/ecore_audio_out_wasapi.eo
@@ -11,8 +11,10 @@ class Ecore.Audio.Out.Wasapi (Ecore.Audio.Out)
Ecore.Audio.Out.input_detach;
}
events {
- context,ready; [[Called when the output is ready for playback.]]
- context,fail; [[Called when context fails.]]
- stop; [[Called when need to stop.]]
+ /* FIXME: Make sure that this event is actually emitted */
+ context,ready: void; [[Called when the output is ready for playback.]]
+ /* FIXME: Make sure that this event is actually emitted */
+ context,fail: void; [[Called when context fails.]]
+ stop: void; [[Called when need to stop.]]
}
}
diff --git a/src/lib/ecore_avahi/Ecore_Avahi.h b/src/lib/ecore_avahi/Ecore_Avahi.h
index 76247dbed7..ed19a12b03 100644
--- a/src/lib/ecore_avahi/Ecore_Avahi.h
+++ b/src/lib/ecore_avahi/Ecore_Avahi.h
@@ -12,15 +12,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ECORE_AVAHI_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ECORE_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -31,7 +31,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#ifdef __cplusplus
extern "C" {
diff --git a/src/lib/ecore_buffer/Ecore_Buffer.h b/src/lib/ecore_buffer/Ecore_Buffer.h
index c8400e619a..4d5c49d93e 100644
--- a/src/lib/ecore_buffer/Ecore_Buffer.h
+++ b/src/lib/ecore_buffer/Ecore_Buffer.h
@@ -6,15 +6,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ECORE_BUFFER_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ECORE_BUFFER_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -25,7 +25,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
/**
* @defgroup Ecore_Buffer_Group Ecore_Buffer - Graphics buffer functions
@@ -626,4 +626,7 @@ EAPI unsigned int ecore_buffer_flags_get(Ecore_Buffer *buf);
}
#endif
+#undef EAPI
+#define EAPI
+
#endif
diff --git a/src/lib/ecore_buffer/Ecore_Buffer_Queue.h b/src/lib/ecore_buffer/Ecore_Buffer_Queue.h
index 5c82ac318a..11abf6a57b 100644
--- a/src/lib/ecore_buffer/Ecore_Buffer_Queue.h
+++ b/src/lib/ecore_buffer/Ecore_Buffer_Queue.h
@@ -6,15 +6,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ECORE_BUFFER_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ECORE_BUFFER_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -25,7 +25,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#ifdef __cplusplus
extern "C" {
@@ -448,4 +448,7 @@ EAPI void ecore_buffer_provider_buffer_released_cb_set(Ecor
}
#endif
+#undef EAPI
+#define EAPI
+
#endif /* _ECORE_BUFFER_QUEUE_H_ */
diff --git a/src/lib/ecore_cocoa/ecore_cocoa.m b/src/lib/ecore_cocoa/ecore_cocoa.m
index 83a7e26876..d8ce7a6cf6 100644
--- a/src/lib/ecore_cocoa/ecore_cocoa.m
+++ b/src/lib/ecore_cocoa/ecore_cocoa.m
@@ -254,30 +254,41 @@ _ecore_cocoa_feed_events(void *anEvent)
case NSEventTypeFlagsChanged:
{
NSUInteger flags = [event modifierFlags];
+ EcoreCocoaWindow *window = (EcoreCocoaWindow *)[event window];
Ecore_Event_Key *evDown = NULL;
Ecore_Event_Key *evUp = NULL;
-
- evDown = calloc(1, sizeof (Ecore_Event_Key));
- if (!evDown) return pass;
+ const char *key = NULL;
+ int keylen;
// Turn special key flags on
if (flags & NSEventModifierFlagShift)
- evDown->key = "Shift_L";
+ key = "Shift_L";
else if (flags & NSEventModifierFlagControl)
- evDown->key = "Control_L";
+ key = "Control_L";
else if (flags & NSEventModifierFlagOption)
- evDown->key = "Alt_L";
+ key = "Alt_L";
else if (flags & NSEventModifierFlagCommand)
- evDown->key = "Super_L";
+ key = "Super_L";
else if (flags & NSEventModifierFlagCapsLock)
- evDown->key = "Caps_Lock";
+ key = "Caps_Lock";
else if (flags & NSEventModifierFlagNumericPad)
- evDown->key = "Num_Lock";
+ key = "Num_Lock";
- if (evDown->key)
+ if (key)
{
- evDown->keyname = evDown->key;
+ keylen = strlen(key);
+ evDown = calloc(1, sizeof (Ecore_Event_Key) + (keylen * 2) + 2);
+ if (!evDown) return pass;
+
+ evDown->keyname = (char *)(evDown + 1);
+ evDown->key = evDown->keyname + keylen + 1;
+
+ strcpy((char *) evDown->keyname, key);
+ strcpy((char *) evDown->key, key);
+
+ evDown->window = (Ecore_Window)window.ecore_window_data;
+ evDown->event_window = evDown->window;
evDown->timestamp = time;
evDown->string = NULL;
ecore_event_add(ECORE_EVENT_KEY_DOWN, evDown, NULL, NULL);
@@ -285,40 +296,44 @@ _ecore_cocoa_feed_events(void *anEvent)
break;
}
- free(evDown);
-
- evUp = calloc(1, sizeof (Ecore_Event_Key));
- if (!evUp)
- {
- return pass;
- }
+ key = NULL;
NSUInteger changed_flags = flags ^ old_flags;
// Turn special key flags off
if (changed_flags & NSEventModifierFlagShift)
- evUp->key = "Shift_L";
+ key = "Shift_L";
else if (changed_flags & NSEventModifierFlagControl)
- evUp->key = "Control_L";
+ key = "Control_L";
else if (changed_flags & NSEventModifierFlagOption)
- evUp->key = "Alt_L";
+ key = "Alt_L";
else if (changed_flags & NSEventModifierFlagCommand)
- evUp->key = "Super_L";
+ key = "Super_L";
else if (changed_flags & NSEventModifierFlagCapsLock)
- evUp->key = "Caps_Lock";
+ key = "Caps_Lock";
else if (changed_flags & NSEventModifierFlagNumericPad)
- evUp->key = "Num_Lock";
+ key = "Num_Lock";
- if (evUp->key)
+ if (key)
{
- evUp->keyname = evUp->key;
+ keylen = strlen(key);
+ evUp = calloc(1, sizeof (Ecore_Event_Key) + (keylen * 2) + 2);
+ if (!evUp) return pass;
+
+ evUp->keyname = (char *)(evUp + 1);
+ evUp->key = evUp->keyname + keylen + 1;
+
+ strcpy((char *) evUp->keyname, key);
+ strcpy((char *) evUp->key, key);
+
+ evUp->window = (Ecore_Window)window.ecore_window_data;
+ evUp->event_window = evUp->window;
evUp->timestamp = time;
evUp->string = NULL;
ecore_event_add(ECORE_EVENT_KEY_UP, evUp, NULL, NULL);
old_flags = flags;
break;
}
- free(evUp);
break;
}
diff --git a/src/lib/ecore_cocoa/ecore_cocoa_cnp.m b/src/lib/ecore_cocoa/ecore_cocoa_cnp.m
index da2db90aa0..03dcb22771 100644
--- a/src/lib/ecore_cocoa/ecore_cocoa_cnp.m
+++ b/src/lib/ecore_cocoa/ecore_cocoa_cnp.m
@@ -24,7 +24,8 @@ ecore_cocoa_clipboard_set(const void *data,
str = [[NSString alloc] initWithBytes: data
length: size
encoding: NSUTF8StringEncoding];
- [objects addObject: str];
+ if (str)
+ [objects addObject: str];
}
if (type & ECORE_COCOA_CNP_TYPE_MARKUP)
{
@@ -35,7 +36,8 @@ ecore_cocoa_clipboard_set(const void *data,
length: strlen(utf8) // XXX strlen() ?
encoding: NSUTF8StringEncoding];
free(utf8);
- [objects addObject: str];
+ if (str)
+ [objects addObject: str];
}
if (type & ECORE_COCOA_CNP_TYPE_IMAGE)
{
diff --git a/src/lib/ecore_con/Ecore_Con.h b/src/lib/ecore_con/Ecore_Con.h
index 5f04e4c39e..d5d6758acb 100644
--- a/src/lib/ecore_con/Ecore_Con.h
+++ b/src/lib/ecore_con/Ecore_Con.h
@@ -20,7 +20,7 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ECORE_CON_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
@@ -2366,6 +2366,23 @@ EAPI void ecore_con_url_timeout_set(Ecore_Con_Url *url_con, double timeout);
* @since 1.2
*/
EAPI int ecore_con_url_status_code_get(Ecore_Con_Url *url_con);
+
+/**
+ * @brief Sets a maximum upload speed.
+ *
+ * @param url_con Connection object
+ * @param max_speed Maximum upload speed, in bytes per second
+ */
+EAPI void ecore_con_url_limit_upload_speed(Ecore_Con_Url *url_obj, off_t max_speed);
+
+/**
+ * @brief Sets a maximum download speed.
+ *
+ * @param url_con Connection object
+ * @param max_speed Maximum download speed, in bytes per second
+ */
+EAPI void ecore_con_url_limit_download_speed(Ecore_Con_Url *url_obj, off_t max_speed);
+
/**
* @}
*/
diff --git a/src/lib/ecore_con/Ecore_Con_Eet.h b/src/lib/ecore_con/Ecore_Con_Eet.h
index a4c99dbf05..4a716752a3 100644
--- a/src/lib/ecore_con/Ecore_Con_Eet.h
+++ b/src/lib/ecore_con/Ecore_Con_Eet.h
@@ -10,7 +10,7 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ECORE_CON_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
@@ -317,5 +317,5 @@ EAPI void ecore_con_eet_raw_send(Ecore_Con_Reply *reply, const char *protocol_na
#undef EAPI
#define EAPI
-
+
#endif
diff --git a/src/lib/ecore_con/Efl_Net.h b/src/lib/ecore_con/Efl_Net.h
index 5d163e7efd..be2147105f 100644
--- a/src/lib/ecore_con/Efl_Net.h
+++ b/src/lib/ecore_con/Efl_Net.h
@@ -18,7 +18,7 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ECORE_CON_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
@@ -131,7 +131,7 @@ EAPI int ecore_con_url_shutdown(void);
#include "efl_net_control_technology.eo.h"
#include "efl_net_control_access_point.eo.h"
-#include "efl_net_control.eo.h"
+#include "efl_net_control_manager.eo.h"
#include "efl_net_session.eo.h"
#ifdef __cplusplus
diff --git a/src/lib/ecore_con/ecore_con.c b/src/lib/ecore_con/ecore_con.c
index a396fa9ae8..d8dbd37a58 100644
--- a/src/lib/ecore_con/ecore_con.c
+++ b/src/lib/ecore_con/ecore_con.c
@@ -73,7 +73,7 @@ static int _ecore_con_init_count = 0;
int _ecore_con_log_dom = -1;
Eina_Bool _efl_net_proxy_helper_can_do (void);
-int _efl_net_proxy_helper_url_req_send(const char *url);
+int _efl_net_proxy_helper_url_req_send(const char *url, Ecore_Thread *eth);
char **_efl_net_proxy_helper_url_wait (int id);
void _efl_net_proxy_helper_init (void);
void _efl_net_proxy_helper_shutdown (void);
@@ -89,14 +89,17 @@ ecore_con_init(void)
return --_ecore_con_init_count;
#endif
- if (!ecore_init())
- goto ecore_err;
+ if (!eina_init())
+ goto eina_err;
_ecore_con_log_dom = eina_log_domain_register
("ecore_con", ECORE_CON_DEFAULT_LOG_COLOR);
if (_ecore_con_log_dom < 0)
goto ecore_con_log_error;
+ if (!ecore_init())
+ goto ecore_err;
+
_efl_net_proxy_helper_init();
ecore_con_mempool_init();
@@ -125,7 +128,9 @@ ecore_con_log_error:
EINA_LOG_ERR("Failed to create a log domain for Ecore Con.");
ecore_shutdown();
-ecore_err:
+ ecore_err:
+ eina_shutdown();
+ eina_err:
#ifdef _WIN32
evil_shutdown();
#endif
@@ -152,14 +157,16 @@ ecore_con_shutdown(void)
ecore_con_legacy_shutdown();
- eina_log_domain_unregister(_ecore_con_log_dom);
- _ecore_con_log_dom = -1;
-
ecore_shutdown();
#ifdef _WIN32
evil_shutdown();
#endif
+ eina_log_domain_unregister(_ecore_con_log_dom);
+ _ecore_con_log_dom = -1;
+
+ eina_shutdown();
+
return _ecore_con_init_count;
}
@@ -2031,7 +2038,7 @@ _efl_net_ip_connect_async_run_socks5h(Efl_Net_Ip_Connect_Async_Data *d, const ch
}
static void
-_efl_net_ip_connect_async_run(void *data, Ecore_Thread *thread EINA_UNUSED)
+_efl_net_ip_connect_async_run(void *data, Ecore_Thread *thread)
{
Efl_Net_Ip_Connect_Async_Data *d = data;
const char *host, *port, *proxy;
@@ -2069,7 +2076,7 @@ _efl_net_ip_connect_async_run(void *data, Ecore_Thread *thread EINA_UNUSED)
}
else
{
- proxies = ecore_con_libproxy_proxies_get(url);
+ proxies = ecore_con_libproxy_proxies_get(url, thread);
eina_stringshare_del(url);
}
}
@@ -2571,9 +2578,9 @@ efl_net_udp_datagram_size_query(SOCKET fd)
}
char **
-ecore_con_libproxy_proxies_get(const char *url)
+ecore_con_libproxy_proxies_get(const char *url, Ecore_Thread *eth)
{
- int id = _efl_net_proxy_helper_url_req_send(url);
+ int id = _efl_net_proxy_helper_url_req_send(url, eth);
if (id < 0) return NULL;
return _efl_net_proxy_helper_url_wait(id);
}
diff --git a/src/lib/ecore_con/ecore_con_eet.c b/src/lib/ecore_con/ecore_con_eet.c
index f724aa8a67..e5d07d5d9d 100644
--- a/src/lib/ecore_con/ecore_con_eet.c
+++ b/src/lib/ecore_con/ecore_con_eet.c
@@ -535,18 +535,26 @@ _ecore_con_eet_base_send(Eo *obj EINA_UNUSED, Ecore_Con_Eet_Base_Data *pd, Ecore
}
EOLIAN static void
-_ecore_con_eet_base_raw_send(Eo *obj EINA_UNUSED, Ecore_Con_Eet_Base_Data *pd, Ecore_Con_Reply *reply, const char *protocol_name, const char *section, void *value, unsigned int length)
+_ecore_con_eet_base_raw_send(Eo *obj EINA_UNUSED, Ecore_Con_Eet_Base_Data *pd, Ecore_Con_Reply *reply, const char *protocol_name, const char *section, Eina_Binbuf *section_data)
{
unsigned int protocol[4];
unsigned int protocol_length;
unsigned int section_length;
unsigned int size;
+ unsigned int length = 0;
+ const void *value = NULL;
char *tmp;
if (!reply) return;
if (!protocol_name) return;
if (!section) return;
+ if (section_data)
+ {
+ length = eina_binbuf_length_get(section_data);
+ value = eina_binbuf_string_get(section_data);
+ }
+
protocol_length = strlen(protocol_name) + 1;
if (protocol_length == 1) return;
section_length = strlen(section) + 1;
@@ -678,18 +686,18 @@ _ecore_con_eet_base_efl_object_constructor(Eo *obj, Ecore_Con_Eet_Base_Data *pd)
EOLIAN static void
_ecore_con_eet_base_efl_object_destructor(Eo *obj, Ecore_Con_Eet_Base_Data *pd)
{
- efl_destructor(efl_super(obj, ECORE_CON_EET_BASE_CLASS));
-
eet_data_descriptor_free(pd->edd);
eet_data_descriptor_free(pd->matching);
eina_hash_free(pd->data_callbacks);
eina_hash_free(pd->raw_data_callbacks);
+
+ efl_destructor(efl_super(obj, ECORE_CON_EET_BASE_CLASS));
}
EOLIAN static Efl_Object *
_ecore_con_eet_base_efl_object_finalize(Eo *obj, Ecore_Con_Eet_Base_Data *pd)
{
- if (pd->server) return obj;
+ if (pd->server) return efl_finalize(efl_super(obj, ECORE_CON_EET_BASE_CLASS));
eet_data_descriptor_free(pd->edd);
eet_data_descriptor_free(pd->matching);
@@ -709,7 +717,7 @@ _ecore_con_eet_base_server_set(Eo *obj EINA_UNUSED, Ecore_Con_Eet_Base_Data *pd,
}
EOLIAN static Ecore_Con_Server *
-_ecore_con_eet_base_server_get(Eo *obj EINA_UNUSED, Ecore_Con_Eet_Base_Data *pd)
+_ecore_con_eet_base_server_get(const Eo *obj EINA_UNUSED, Ecore_Con_Eet_Base_Data *pd)
{
return pd->server;
}
@@ -725,7 +733,7 @@ ecore_con_eet_server_new(Ecore_Con_Server *server)
if (!server) return NULL;
- ece_obj = efl_add(ECORE_CON_EET_SERVER_OBJ_CLASS, NULL, ecore_con_eet_base_server_set(efl_added, server));
+ ece_obj = efl_add_ref(ECORE_CON_EET_SERVER_OBJ_CLASS, NULL, ecore_con_eet_base_server_set(efl_added, server));
return ece_obj;
}
@@ -737,7 +745,7 @@ ecore_con_eet_client_new(Ecore_Con_Server *server)
if (!server) return NULL;
- ece_obj = efl_add(ECORE_CON_EET_CLIENT_OBJ_CLASS, NULL, ecore_con_eet_base_server_set(efl_added, server));
+ ece_obj = efl_add_ref(ECORE_CON_EET_CLIENT_OBJ_CLASS, NULL, ecore_con_eet_base_server_set(efl_added, server));
return ece_obj;
}
@@ -745,7 +753,7 @@ ecore_con_eet_client_new(Ecore_Con_Server *server)
EAPI void
ecore_con_eet_server_free(Ecore_Con_Eet *server)
{
- efl_del(server);
+ efl_unref(server);
}
EAPI void
@@ -946,7 +954,9 @@ ecore_con_eet_send(Ecore_Con_Reply *reply, const char *name, void *value)
EAPI void
ecore_con_eet_raw_send(Ecore_Con_Reply *reply, const char *protocol_name, const char *section, void *value, unsigned int length)
{
- ecore_con_eet_base_raw_send(reply->ece, reply, protocol_name, section, value, length);
+ Eina_Binbuf *buf = eina_binbuf_manage_new(value, length, 1);
+ ecore_con_eet_base_raw_send(reply->ece, reply, protocol_name, section, buf);
+ eina_binbuf_free(buf);
}
#include "ecore_con_eet_base.eo.c"
diff --git a/src/lib/ecore_con/ecore_con_eet_base.eo b/src/lib/ecore_con/ecore_con_eet_base.eo
index 8c5b3a554f..76bdb3aeca 100644
--- a/src/lib/ecore_con/ecore_con_eet_base.eo
+++ b/src/lib/ecore_con/ecore_con_eet_base.eo
@@ -83,8 +83,7 @@ class Ecore.Con.Eet.Base (Efl.Object) {
to which the data has to be sent.]]
protocol_name: string; [[The name of the eet stream.]]
section: string; [[Name of section in the eet descriptor.]]
- value: void_ptr; [[The value of the section.]]
- length: uint; [[The length of the data that is being sent.]]
+ section_data: ptr(Eina.Binbuf);
}
}
}
diff --git a/src/lib/ecore_con/ecore_con_legacy.c b/src/lib/ecore_con/ecore_con_legacy.c
index 2cf721ffea..bd199a8278 100644
--- a/src/lib/ecore_con/ecore_con_legacy.c
+++ b/src/lib/ecore_con/ecore_con_legacy.c
@@ -14,7 +14,12 @@
# include <Evil.h>
#endif
+#define EFL_NET_SOCKET_SSL_PROTECTED
+
#include "Ecore.h"
+
+#include "Efl_Net.h"
+
#include "ecore_private.h"
#include "Ecore_Con.h"
#include "ecore_con_private.h"
@@ -88,15 +93,16 @@ typedef struct _Ecore_Con_Lookup_Ctx {
} Ecore_Con_Lookup_Ctx;
/* allows delete_me to be true */
-#define ECORE_CON_SERVER_CHECK_RELAXED_RETURN(svr, ...) \
- do \
- { \
- if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_CON_SERVER)) \
- { \
+#define ECORE_CON_SERVER_CHECK_RELAXED_RETURN(svr, ...) \
+ do \
+ { \
+ if (!svr) return __VA_ARGS__; \
+ if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_CON_SERVER)) \
+ { \
ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_CON_SERVER, __FUNCTION__); \
- return __VA_ARGS__; \
- } \
- } \
+ return __VA_ARGS__; \
+ } \
+ } \
while (0)
#define ECORE_CON_SERVER_CHECK_RETURN(svr, ...) \
@@ -107,15 +113,16 @@ typedef struct _Ecore_Con_Lookup_Ctx {
} \
while (0)
-#define ECORE_CON_CLIENT_CHECK_RELAXED_RETURN(cl, ...) \
- do \
- { \
- if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_CON_CLIENT)) \
- { \
+#define ECORE_CON_CLIENT_CHECK_RELAXED_RETURN(cl, ...) \
+ do \
+ { \
+ if (!cl) return __VA_ARGS__; \
+ if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_CON_CLIENT)) \
+ { \
ECORE_MAGIC_FAIL(cl, ECORE_MAGIC_CON_CLIENT, __FUNCTION__); \
- return __VA_ARGS__; \
- } \
- } \
+ return __VA_ARGS__; \
+ } \
+ } \
while (0)
#define ECORE_CON_CLIENT_CHECK_RETURN(cl, ...) \
@@ -258,31 +265,35 @@ _ecore_con_client_socket_close(Ecore_Con_Client *cl)
{
if (!cl->socket) return;
- /* socket may remain alive due other references, we don't own it */
- efl_event_callback_array_del(cl->socket, _ecore_con_client_socket_cbs(), cl);
-
if (!efl_io_closer_closed_get(cl->socket))
efl_io_closer_close(cl->socket);
+
+ /* socket may remain alive due other references, we don't own it */
+ efl_event_callback_array_del(cl->socket, _ecore_con_client_socket_cbs(), cl);
}
static void
_ecore_con_client_free(Ecore_Con_Client *cl)
{
+ Ecore_Con_Server *svr = cl->svr;
+
cl->delete_me = EINA_TRUE;
+ cl->svr = NULL;
- if (cl->svr)
- cl->svr->clients = eina_list_remove(cl->svr->clients, cl);
+ if (svr)
+ svr->clients = eina_list_remove(svr->clients, cl);
_ecore_con_client_socket_close(cl);
if (cl->socket)
{
- Eo *inner_socket = efl_io_buffered_stream_inner_io_get(cl->socket);
- efl_event_callback_array_del(cl->socket, _ecore_con_client_socket_cbs(), cl);
+ Eo *parent, *inner_socket = efl_io_buffered_stream_inner_io_get(cl->socket);
+
if (efl_isa(inner_socket, EFL_NET_SOCKET_SSL_CLASS))
efl_event_callback_array_del(inner_socket, _ecore_con_client_socket_ssl_cbs(), cl);
- if (efl_parent_get(cl->socket) != cl->svr->server)
+ parent = efl_parent_get(cl->socket);
+ if (parent && (parent != svr->server))
efl_del(cl->socket); /* we own it */
else
efl_unref(cl->socket);
@@ -299,6 +310,9 @@ _ecore_con_client_free(Ecore_Con_Client *cl)
if (cl->event_count) return;
+ if (svr && (!svr->event_count) && (svr->delete_me))
+ _ecore_con_server_free(svr);
+
cl->data = NULL;
eina_stringshare_replace(&cl->ip, NULL);
@@ -778,9 +792,21 @@ ecore_con_client_fd_get(const Ecore_Con_Client *cl)
ECORE_CON_CLIENT_CHECK_RETURN(cl, SOCKET_TO_LOOP_FD(INVALID_SOCKET));
if (cl->socket)
{
- if (efl_isa(cl->socket, EFL_LOOP_FD_CLASS))
- return efl_loop_fd_get(cl->socket);
- return SOCKET_TO_LOOP_FD(INVALID_SOCKET);
+ Eo *inner_socket = efl_io_buffered_stream_inner_io_get(cl->socket);
+ if (efl_isa(inner_socket, EFL_LOOP_FD_CLASS))
+ {
+ return efl_loop_fd_get(inner_socket);
+ }
+ else
+ {
+ if (efl_isa(inner_socket, EFL_NET_SOCKET_SSL_CLASS))
+ {
+ Eo* adopted_socket = NULL;
+ if (efl_net_socket_ssl_adopted_get(inner_socket, &adopted_socket, NULL))
+ if (efl_isa(adopted_socket, EFL_LOOP_FD_CLASS))
+ return efl_loop_fd_get(adopted_socket);
+ }
+ }
}
return SOCKET_TO_LOOP_FD(INVALID_SOCKET);
}
@@ -842,11 +868,9 @@ _ecore_con_client_ssl_upgrade_job(void *data, const Eina_Value v,
efl_parent_set(inner_socket, socket);
- efl_unref(inner_socket); /* socket keeps it */
-
cl->socket = socket;
efl_io_closer_close_on_exec_set(socket, EINA_TRUE);
- efl_io_closer_close_on_destructor_set(socket, EINA_TRUE);
+ efl_io_closer_close_on_invalidate_set(socket, EINA_TRUE);
efl_event_callback_array_del(tcp_socket, _ecore_con_client_socket_cbs(), cl);
efl_event_callback_array_add(socket, _ecore_con_client_socket_cbs(), cl);
efl_event_callback_array_add(inner_socket, _ecore_con_client_socket_ssl_cbs(), cl);
@@ -940,6 +964,8 @@ ecore_con_server_check(const Ecore_Con_Server *svr)
static Ecore_Con_Server *
_ecore_con_server_new(Eina_Bool is_dialer, Ecore_Con_Type type, const char *name, int port, const void *data)
{
+ EINA_SAFETY_ON_TRUE_RETURN_VAL(!name || (!name[0]), NULL);
+
Ecore_Con_Server *svr = calloc(1, sizeof(Ecore_Con_Server));
EINA_SAFETY_ON_NULL_RETURN_VAL(svr, NULL);
svr->start_time = ecore_time_get();
@@ -957,6 +983,7 @@ _ecore_con_server_new(Eina_Bool is_dialer, Ecore_Con_Type type, const char *name
static void
_ecore_con_server_dialer_close(Ecore_Con_Server *svr)
{
+ svr->connecting = EINA_FALSE;
if (!svr->dialer) return;
if (!efl_io_closer_closed_get(svr->dialer))
@@ -976,6 +1003,14 @@ _ecore_con_server_free(Ecore_Con_Server *svr)
_ecore_con_server_dialer_close(svr);
+ if (svr->ssl.clients_ctx)
+ {
+ // This is always created with efl_add_ref
+ efl_parent_set(svr->ssl.clients_ctx, NULL);
+ efl_unref(svr->ssl.clients_ctx);
+ svr->ssl.clients_ctx = NULL;
+ }
+
if (svr->dialer)
{
efl_del(svr->dialer);
@@ -988,12 +1023,6 @@ _ecore_con_server_free(Ecore_Con_Server *svr)
svr->server = NULL;
}
- if (svr->ssl.clients_ctx)
- {
- efl_unref(svr->ssl.clients_ctx);
- svr->ssl.clients_ctx = NULL;
- }
-
if (svr->ssl.job) eina_future_cancel(svr->ssl.job);
if (svr->ssl.pending_send)
@@ -1317,8 +1346,8 @@ _ecore_con_server_dialer_error(void *data, const Efl_Event *event)
WRN("error reaching server %s: %s", efl_net_dialer_address_dial_get(svr->dialer), eina_error_msg_get(*perr));
- _ecore_con_server_dialer_close(svr);
_ecore_con_post_event_server_error(svr, eina_error_msg_get(*perr));
+ _ecore_con_server_dialer_close(svr);
}
static void
@@ -1581,7 +1610,10 @@ _ecore_con_server_ssl_ctx_create(const Ecore_Con_Server *svr)
else if (ssl_type & ECORE_CON_USE_TLS)
cipher = EFL_NET_SSL_CIPHER_TLSV1;
else if (ssl_type & ECORE_CON_USE_SSL3)
- cipher = EFL_NET_SSL_CIPHER_SSLV3;
+ {
+ ERR("SSLv3 is unsupported!");
+ return NULL;
+ }
else if (ssl_type & ECORE_CON_USE_SSL2)
{
ERR("SSLv2 is unsupported!");
@@ -1590,13 +1622,13 @@ _ecore_con_server_ssl_ctx_create(const Ecore_Con_Server *svr)
/* legacy compatibility: server never verified peer, only dialer did */
- return efl_add(EFL_NET_SSL_CONTEXT_CLASS, NULL,
- efl_net_ssl_context_certificates_set(efl_added, eina_list_iterator_new(svr->ssl.certs)),
- efl_net_ssl_context_private_keys_set(efl_added, eina_list_iterator_new(svr->ssl.privkeys)),
- efl_net_ssl_context_certificate_revocation_lists_set(efl_added, eina_list_iterator_new(svr->ssl.crls)),
- efl_net_ssl_context_certificate_authorities_set(efl_added, eina_list_iterator_new(svr->ssl.cafiles)),
- efl_net_ssl_context_default_paths_load_set(efl_added, EINA_FALSE), /* old API didn't load default paths */
- efl_net_ssl_context_setup(efl_added, cipher, EINA_FALSE));
+ return efl_add_ref(EFL_NET_SSL_CONTEXT_CLASS, efl_main_loop_get(),
+ efl_net_ssl_context_certificates_set(efl_added, eina_list_iterator_new(svr->ssl.certs)),
+ efl_net_ssl_context_private_keys_set(efl_added, eina_list_iterator_new(svr->ssl.privkeys)),
+ efl_net_ssl_context_certificate_revocation_lists_set(efl_added, eina_list_iterator_new(svr->ssl.crls)),
+ efl_net_ssl_context_certificate_authorities_set(efl_added, eina_list_iterator_new(svr->ssl.cafiles)),
+ efl_net_ssl_context_default_paths_load_set(efl_added, EINA_FALSE), /* old API didn't load default paths */
+ efl_net_ssl_context_setup(efl_added, cipher, EINA_FALSE));
}
static Eina_Value
@@ -1625,7 +1657,6 @@ _ecore_con_server_server_ssl_job(void *data, const Eina_Value v,
efl_parent_set(inner_server, server);
efl_unref(ssl_ctx); /* inner_server keeps it */
- efl_unref(inner_server); /* server keeps it */
if (!_ecore_con_server_server_set(svr, server))
goto error_serve;
@@ -1674,6 +1705,15 @@ ecore_con_server_add(Ecore_Con_Type compl_type,
type = compl_type & ECORE_CON_TYPE;
+ /* The allowable port number is an unsigned 16-bit integer for remote connection, so 1-65535, 0 is reserved */
+ if (((type == ECORE_CON_REMOTE_TCP) || (type == ECORE_CON_REMOTE_NODELAY) || (type == ECORE_CON_REMOTE_CORK) ||
+ (type == ECORE_CON_REMOTE_UDP) || (type == ECORE_CON_REMOTE_MCAST)) &&
+ ((port < 0) || (port > 65535)))
+ {
+ ERR("Port %i invalid (0 <= port <= 65535)", port);
+ return NULL;
+ }
+
loop = efl_main_loop_get();
EINA_SAFETY_ON_NULL_RETURN_VAL(loop, NULL);
@@ -1842,7 +1882,7 @@ _ecore_con_server_dialer_set(Ecore_Con_Server *svr, Eo *dialer)
svr->dialer = dialer;
efl_io_closer_close_on_exec_set(dialer, EINA_TRUE);
- efl_io_closer_close_on_destructor_set(dialer, EINA_TRUE);
+ efl_io_closer_close_on_invalidate_set(dialer, EINA_TRUE);
efl_io_buffered_stream_timeout_inactivity_set(dialer, svr->timeout);
efl_event_callback_array_add(dialer, _ecore_con_server_dialer_cbs(), svr);
@@ -1950,7 +1990,10 @@ _ecore_con_server_dialer_ssl_job(void *data, const Eina_Value v,
else if (ssl_type & ECORE_CON_USE_TLS)
cipher = EFL_NET_SSL_CIPHER_TLSV1;
else if (ssl_type & ECORE_CON_USE_SSL3)
- cipher = EFL_NET_SSL_CIPHER_SSLV3;
+ {
+ ERR("SSLv3 is unsupported!");
+ goto error_ssl_ctx;
+ }
else if (ssl_type & ECORE_CON_USE_SSL2)
{
ERR("SSLv2 is unsupported!");
@@ -1960,7 +2003,7 @@ _ecore_con_server_dialer_ssl_job(void *data, const Eina_Value v,
if (svr->ssl.verify)
verify_mode = EFL_NET_SSL_VERIFY_MODE_REQUIRED;
- ssl_ctx = efl_add(EFL_NET_SSL_CONTEXT_CLASS, NULL,
+ ssl_ctx = efl_add(EFL_NET_SSL_CONTEXT_CLASS, efl_main_loop_get(),
efl_net_ssl_context_certificates_set(efl_added, eina_list_iterator_new(svr->ssl.certs)),
efl_net_ssl_context_private_keys_set(efl_added, eina_list_iterator_new(svr->ssl.privkeys)),
efl_net_ssl_context_certificate_revocation_lists_set(efl_added, eina_list_iterator_new(svr->ssl.crls)),
@@ -1981,9 +2024,7 @@ _ecore_con_server_dialer_ssl_job(void *data, const Eina_Value v,
EINA_SAFETY_ON_NULL_GOTO(dialer, error_dialer);
efl_parent_set(inner_dialer, dialer);
-
- efl_unref(ssl_ctx); /* inner_dialer keeps it */
- efl_unref(inner_dialer); /* dialer keeps it */
+ efl_parent_set(ssl_ctx, inner_dialer);
if (!_ecore_con_server_dialer_set(svr, dialer))
goto error_dial;
@@ -2044,7 +2085,10 @@ _ecore_con_server_dialer_ssl_upgrade_job(void *data, const Eina_Value v,
else if (ssl_type & ECORE_CON_USE_TLS)
cipher = EFL_NET_SSL_CIPHER_TLSV1;
else if (ssl_type & ECORE_CON_USE_SSL3)
- cipher = EFL_NET_SSL_CIPHER_SSLV3;
+ {
+ ERR("SSLv3 is unsupported!");
+ goto error_ssl_ctx;
+ }
else if (ssl_type & ECORE_CON_USE_SSL2)
{
ERR("SSLv2 is unsupported!");
@@ -2054,16 +2098,16 @@ _ecore_con_server_dialer_ssl_upgrade_job(void *data, const Eina_Value v,
if (svr->ssl.verify)
verify_mode = EFL_NET_SSL_VERIFY_MODE_REQUIRED;
- ssl_ctx = efl_add(EFL_NET_SSL_CONTEXT_CLASS, NULL,
- efl_net_ssl_context_certificates_set(efl_added, eina_list_iterator_new(svr->ssl.certs)),
- efl_net_ssl_context_private_keys_set(efl_added, eina_list_iterator_new(svr->ssl.privkeys)),
- efl_net_ssl_context_certificate_revocation_lists_set(efl_added, eina_list_iterator_new(svr->ssl.crls)),
- efl_net_ssl_context_certificate_authorities_set(efl_added, eina_list_iterator_new(svr->ssl.cafiles)),
- efl_net_ssl_context_verify_mode_set(efl_added, verify_mode),
- efl_net_ssl_context_hostname_set(efl_added, svr->ssl.verify_name ? svr->ssl.verify_name : svr->name),
- efl_net_ssl_context_hostname_verify_set(efl_added, svr->ssl.verify_basic),
- efl_net_ssl_context_default_paths_load_set(efl_added, EINA_FALSE), /* old API didn't load default paths */
- efl_net_ssl_context_setup(efl_added, cipher, EINA_TRUE));
+ ssl_ctx = efl_add_ref(EFL_NET_SSL_CONTEXT_CLASS, efl_main_loop_get(),
+ efl_net_ssl_context_certificates_set(efl_added, eina_list_iterator_new(svr->ssl.certs)),
+ efl_net_ssl_context_private_keys_set(efl_added, eina_list_iterator_new(svr->ssl.privkeys)),
+ efl_net_ssl_context_certificate_revocation_lists_set(efl_added, eina_list_iterator_new(svr->ssl.crls)),
+ efl_net_ssl_context_certificate_authorities_set(efl_added, eina_list_iterator_new(svr->ssl.cafiles)),
+ efl_net_ssl_context_verify_mode_set(efl_added, verify_mode),
+ efl_net_ssl_context_hostname_set(efl_added, svr->ssl.verify_name ? svr->ssl.verify_name : svr->name),
+ efl_net_ssl_context_hostname_verify_set(efl_added, svr->ssl.verify_basic),
+ efl_net_ssl_context_default_paths_load_set(efl_added, EINA_FALSE), /* old API didn't load default paths */
+ efl_net_ssl_context_setup(efl_added, cipher, EINA_TRUE));
EINA_SAFETY_ON_NULL_GOTO(ssl_ctx, error_ssl_ctx);
tcp_dialer = svr->dialer;
@@ -2082,11 +2126,10 @@ _ecore_con_server_dialer_ssl_upgrade_job(void *data, const Eina_Value v,
efl_parent_set(inner_dialer, dialer);
efl_unref(ssl_ctx); /* inner_dialer keeps it */
- efl_unref(inner_dialer); /* dialer keeps it */
svr->dialer = dialer;
efl_io_closer_close_on_exec_set(dialer, EINA_TRUE);
- efl_io_closer_close_on_destructor_set(dialer, EINA_TRUE);
+ efl_io_closer_close_on_invalidate_set(dialer, EINA_TRUE);
efl_event_callback_array_del(tcp_dialer, _ecore_con_server_dialer_cbs(), svr);
efl_event_callback_array_add(dialer, _ecore_con_server_dialer_cbs(), svr);
@@ -2393,7 +2436,19 @@ ecore_con_server_fd_get(const Ecore_Con_Server *svr)
{
Eo *inner_dialer = efl_io_buffered_stream_inner_io_get(svr->dialer);
if (efl_isa(inner_dialer, EFL_LOOP_FD_CLASS))
- return efl_loop_fd_get(inner_dialer);
+ {
+ return efl_loop_fd_get(inner_dialer);
+ }
+ else
+ {
+ if (efl_isa(inner_dialer, EFL_NET_DIALER_SSL_CLASS))
+ {
+ Eo* adopted_dialer = NULL;
+ if (efl_net_socket_ssl_adopted_get(inner_dialer, &adopted_dialer, NULL))
+ if (efl_isa(adopted_dialer, EFL_LOOP_FD_CLASS))
+ return efl_loop_fd_get(adopted_dialer);
+ }
+ }
return SOCKET_TO_LOOP_FD(INVALID_SOCKET);
}
if (svr->server)
@@ -2625,7 +2680,7 @@ ecore_con_lookup(const char *name, Ecore_Con_Dns_Cb done_cb, const void *data)
.ai_flags = AI_ADDRCONFIG | AI_V4MAPPED | AI_CANONNAME,
};
- EINA_SAFETY_ON_NULL_RETURN_VAL(name, EINA_FALSE);
+ EINA_SAFETY_ON_TRUE_RETURN_VAL(!name || (!name[0]), EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(done_cb, EINA_FALSE);
ctx = malloc(sizeof(Ecore_Con_Lookup_Ctx));
diff --git a/src/lib/ecore_con/ecore_con_local_win32.c b/src/lib/ecore_con/ecore_con_local_win32.c
index 126ccdab65..86593a2ffa 100644
--- a/src/lib/ecore_con/ecore_con_local_win32.c
+++ b/src/lib/ecore_con/ecore_con_local_win32.c
@@ -262,7 +262,7 @@ _ecore_con_local_win32_client_add(void *data, Ecore_Win32_Handler *wh)
(svr->client_count >= (unsigned int)svr->client_limit))
return ECORE_CALLBACK_CANCEL;
- Ecore_Con_Client *cl_obj = efl_add(EFL_NETWORK_CLIENT_CLASS, NULL);
+ Ecore_Con_Client *cl_obj = efl_add(EFL_NETWORK_CLIENT_CLASS, efl_main_loop_get());
Efl_Network_Client_Data *cl = efl_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
if (!cl)
{
diff --git a/src/lib/ecore_con/ecore_con_private.h b/src/lib/ecore_con/ecore_con_private.h
index b1842fc2e9..7f0c95d61d 100644
--- a/src/lib/ecore_con/ecore_con_private.h
+++ b/src/lib/ecore_con/ecore_con_private.h
@@ -95,7 +95,7 @@ extern int sd_fd_max;
/* init must be called from main thread */
void ecore_con_libproxy_proxies_free(char **proxies);
/* BLOCKING! should be called from a worker thread */
-char **ecore_con_libproxy_proxies_get(const char *url);
+char **ecore_con_libproxy_proxies_get(const char *url, Ecore_Thread *eth);
Eina_Bool ecore_con_server_check(const Ecore_Con_Server *svr);
diff --git a/src/lib/ecore_con/ecore_con_proxy_helper.c b/src/lib/ecore_con/ecore_con_proxy_helper.c
index f99c7a225b..1b58ab1952 100644
--- a/src/lib/ecore_con/ecore_con_proxy_helper.c
+++ b/src/lib/ecore_con/ecore_con_proxy_helper.c
@@ -18,6 +18,7 @@
#include "ecore_private.h"
#include "Ecore_Con.h"
#include "ecore_con_private.h"
+#include "../../static_libs/buildsystem/buildsystem.h"
typedef struct {
Eina_Thread_Queue *thq;
@@ -87,9 +88,7 @@ _efl_net_proxy_helper_spawn(void)
}
// find binary location path
if (run_in_tree == 1)
- snprintf
- (buf, sizeof(buf),
- PACKAGE_BUILD_DIR"/src/bin/ecore_con/utils/efl_net_proxy_helper"HELPER_EXT);
+ bs_binary_get(buf, sizeof(buf), "ecore_con", "efl_net_proxy_helper");
else
#endif
snprintf
@@ -322,7 +321,7 @@ _efl_net_proxy_helper_cb_send_do(void *data)
}
int
-_efl_net_proxy_helper_url_req_send(const char *url)
+_efl_net_proxy_helper_url_req_send(const char *url, Ecore_Thread *eth)
{
char *buf;
int id = -1;
@@ -340,6 +339,7 @@ _efl_net_proxy_helper_url_req_send(const char *url)
locks--;
}
eina_spinlock_release(&_efl_net_proxy_helper_queue_lock);
+ if (ecore_thread_check(eth)) return -1;
// create request to quque up to look up responses for
req = calloc(1, sizeof(Efl_Net_Proxy_Helper_Req));
if (!req) return -1;
@@ -353,9 +353,10 @@ _efl_net_proxy_helper_url_req_send(const char *url)
buf = alloca(strlen(url) + 256);
sprintf(buf, "P %i %s\n", req->id, url);
req->str = strdup(buf);
- if (!req->str)
+ if ((!req->str) || ecore_thread_check(eth))
{
eina_thread_queue_free(req->thq);
+ free(req->str);
free(req);
return -1;
}
diff --git a/src/lib/ecore_con/ecore_con_url.c b/src/lib/ecore_con/ecore_con_url.c
index e8ca8c4cdf..3c9faea28c 100644
--- a/src/lib/ecore_con/ecore_con_url.c
+++ b/src/lib/ecore_con/ecore_con_url.c
@@ -922,7 +922,7 @@ ecore_con_url_post(Ecore_Con_Url *url_con,
buffer = efl_add(EFL_IO_BUFFER_CLASS, efl_loop_get(url_con->dialer),
efl_name_set(efl_added, "post-buffer"),
- efl_io_closer_close_on_destructor_set(efl_added, EINA_TRUE),
+ efl_io_closer_close_on_invalidate_set(efl_added, EINA_TRUE),
efl_io_closer_close_on_exec_set(efl_added, EINA_TRUE));
EINA_SAFETY_ON_NULL_GOTO(buffer, error_buffer);
@@ -938,7 +938,7 @@ ecore_con_url_post(Ecore_Con_Url *url_con,
efl_name_set(efl_added, "send-copier"),
efl_io_copier_source_set(efl_added, buffer),
efl_io_copier_destination_set(efl_added, url_con->dialer),
- efl_io_closer_close_on_destructor_set(efl_added, EINA_FALSE),
+ efl_io_closer_close_on_invalidate_set(efl_added, EINA_FALSE),
efl_event_callback_array_add(efl_added, _ecore_con_url_copier_cbs(), url_con));
EINA_SAFETY_ON_NULL_GOTO(copier, error_copier);
@@ -1179,7 +1179,7 @@ ecore_con_url_ftp_upload(Ecore_Con_Url *url_con,
efl_name_set(efl_added, "upload-file"),
efl_file_set(efl_added, filename, NULL),
efl_io_file_flags_set(efl_added, O_RDONLY),
- efl_io_closer_close_on_destructor_set(efl_added, EINA_TRUE),
+ efl_io_closer_close_on_invalidate_set(efl_added, EINA_TRUE),
efl_io_closer_close_on_exec_set(efl_added, EINA_TRUE));
EINA_SAFETY_ON_NULL_GOTO(file, error_file);
@@ -1187,7 +1187,7 @@ ecore_con_url_ftp_upload(Ecore_Con_Url *url_con,
efl_name_set(efl_added, "send-copier"),
efl_io_copier_source_set(efl_added, file),
efl_io_copier_destination_set(efl_added, url_con->dialer),
- efl_io_closer_close_on_destructor_set(efl_added, EINA_FALSE),
+ efl_io_closer_close_on_invalidate_set(efl_added, EINA_FALSE),
efl_event_callback_array_add(efl_added, _ecore_con_url_copier_cbs(), url_con));
EINA_SAFETY_ON_NULL_GOTO(copier, error_copier);
@@ -1221,6 +1221,34 @@ ecore_con_url_ftp_use_epsv_set(Ecore_Con_Url *url_con,
url_con->ftp_use_epsv = use_epsv;
}
+EAPI void
+ecore_con_url_limit_upload_speed(Ecore_Con_Url *url_con, off_t max_speed)
+{
+ CURL *curl_easy;
+
+ ECORE_CON_URL_CHECK_RETURN(url_con);
+ EINA_SAFETY_ON_NULL_RETURN(_c);
+
+ curl_easy = efl_net_dialer_http_curl_get(url_con->dialer);
+ EINA_SAFETY_ON_NULL_RETURN(curl_easy);
+
+ _c->curl_easy_setopt(curl_easy, CURLOPT_MAX_SEND_SPEED_LARGE, max_speed);
+}
+
+EAPI void
+ecore_con_url_limit_download_speed(Ecore_Con_Url *url_con, off_t max_speed)
+{
+ CURL *curl_easy;
+
+ ECORE_CON_URL_CHECK_RETURN(url_con);
+ EINA_SAFETY_ON_NULL_RETURN(_c);
+
+ curl_easy = efl_net_dialer_http_curl_get(url_con->dialer);
+ EINA_SAFETY_ON_NULL_RETURN(curl_easy);
+
+ _c->curl_easy_setopt(curl_easy, CURLOPT_MAX_RECV_SPEED_LARGE, max_speed);
+}
+
/* LEGACY: proxy */
EAPI Eina_Bool
ecore_con_url_proxy_password_set(Ecore_Con_Url *url_con, const char *password)
diff --git a/src/lib/ecore_con/ecore_con_url_curl.h b/src/lib/ecore_con/ecore_con_url_curl.h
index ae79c4c5cb..ed68e5c4f4 100644
--- a/src/lib/ecore_con/ecore_con_url_curl.h
+++ b/src/lib/ecore_con/ecore_con_url_curl.h
@@ -268,6 +268,8 @@ typedef enum
CINIT(INFILESIZE_LARGE, OFF_T, 115),
CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120),
CINIT(COOKIELIST, OBJECTPOINT, 135),
+ CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145),
+ CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146),
CINIT(OPENSOCKETFUNCTION, FUNCTIONPOINT, 163),
CINIT(OPENSOCKETDATA, OBJECTPOINT, 164),
CINIT(CRLFILE, STRINGPOINT, 169),
diff --git a/src/lib/ecore_con/efl_net-connman.h b/src/lib/ecore_con/efl_net-connman.h
index e66c4afd34..9c6b2c637a 100644
--- a/src/lib/ecore_con/efl_net-connman.h
+++ b/src/lib/ecore_con/efl_net-connman.h
@@ -11,7 +11,7 @@
/**
* @file efl_net-connman.h
*
- * Common infrastructure to create Efl_Net_Control and Efl_Net_Session
+ * Common infrastructure to create Efl_Net_Control_Manager and Efl_Net_Session
* based on ConnMan connection manager.
*
* @note Each connection manager that needs shared infra should create
@@ -64,14 +64,14 @@ Eldbus_Proxy *efl_net_connman_manager_get(void);
*
* @internal
*/
-Efl_Net_Control_Technology *efl_net_connman_control_find_technology_by_type(Efl_Net_Control *ctl, const char *tech_type);
+Efl_Net_Control_Technology *efl_net_connman_control_find_technology_by_type(Efl_Net_Control_Manager *ctl, const char *tech_type);
/**
* Ask Efl.Net.Control to reload access point list.
*
* @internal
*/
-void efl_net_connman_control_access_points_reload(Efl_Net_Control *ctl);
+void efl_net_connman_control_access_points_reload(Efl_Net_Control_Manager *ctl);
/**
@@ -80,7 +80,7 @@ void efl_net_connman_control_access_points_reload(Efl_Net_Control *ctl);
*
* @internal
*/
-Efl_Net_Control_Technology *efl_net_connman_technology_new(Efl_Net_Control *parent, const char *path, Eldbus_Message_Iter *properties);
+Efl_Net_Control_Technology *efl_net_connman_technology_new(Efl_Net_Control_Manager *parent, const char *path, Eldbus_Message_Iter *properties);
/**
* Get the path of the given technology.
@@ -102,7 +102,7 @@ Efl_Net_Control_Technology_Type efl_net_connman_technology_type_from_str(const c
*
* @internal
*/
-Efl_Net_Control_Access_Point *efl_net_connman_access_point_new(Efl_Net_Control *parent, const char *path, Eldbus_Message_Iter *properties, unsigned int priority);
+Efl_Net_Control_Access_Point *efl_net_connman_access_point_new(Efl_Net_Control_Manager *parent, const char *path, Eldbus_Message_Iter *properties, unsigned int priority);
/**
* Get the path of the given access_point.
@@ -116,7 +116,7 @@ const char *efl_net_connman_access_point_path_get(Efl_Net_Control_Access_Point *
*
* @internal
*/
-void efl_net_connman_access_point_update(Efl_Net_Control *ap, Eldbus_Message_Iter *properties, unsigned int priority);
+void efl_net_connman_access_point_update(Efl_Net_Control_Manager *ap, Eldbus_Message_Iter *properties, unsigned int priority);
#endif /* _EFL_NET_CONNMAN_H_ */
diff --git a/src/lib/ecore_con/efl_net_control-connman.c b/src/lib/ecore_con/efl_net_control-connman.c
index 63f452520e..d2fb513ac3 100644
--- a/src/lib/ecore_con/efl_net_control-connman.c
+++ b/src/lib/ecore_con/efl_net_control-connman.c
@@ -32,14 +32,14 @@ typedef struct
unsigned char radios_offline; /* 0xff = not requested */
Eldbus_Pending *radios_offline_pending;
} request;
-} Efl_Net_Control_Data;
+} Efl_Net_Control_Manager_Data;
-#define MY_CLASS EFL_NET_CONTROL_CLASS
+#define MY_CLASS EFL_NET_CONTROL_MANAGER_CLASS
-static void _efl_net_control_agent_enabled_set(Eo *o, Efl_Net_Control_Data *pd, Eina_Bool agent_enabled);
+static void _efl_net_control_manager_agent_enabled_set(Eo *o, Efl_Net_Control_Manager_Data *pd, Eina_Bool agent_enabled);
static Eo *
-_efl_net_control_technology_find(const Efl_Net_Control_Data *pd, const char *path)
+_efl_net_control_technology_find(const Efl_Net_Control_Manager_Data *pd, const char *path)
{
const Eina_List *n;
Eo *child;
@@ -56,7 +56,7 @@ _efl_net_control_technology_find(const Efl_Net_Control_Data *pd, const char *pat
}
static Eo *
-_efl_net_control_access_point_find(const Efl_Net_Control_Data *pd, const char *path)
+_efl_net_control_access_point_find(const Efl_Net_Control_Manager_Data *pd, const char *path)
{
const Eina_List *n;
Eo *child;
@@ -76,14 +76,14 @@ static Eldbus_Message *
_efl_net_control_agent_release(const Eldbus_Service_Interface *service, const Eldbus_Message *msg)
{
Eo *o = eldbus_service_object_data_get(service, "efl_net");
- Efl_Net_Control_Data *pd = efl_data_scope_get(o, MY_CLASS);
+ Efl_Net_Control_Manager_Data *pd = efl_data_scope_get(o, MY_CLASS);
DBG("Agent %p is released %s", o, eldbus_message_path_get(msg));
EINA_SAFETY_ON_NULL_GOTO(o, end);
EINA_SAFETY_ON_NULL_GOTO(pd, end);
pd->agent_enabled = EINA_FALSE;
- efl_event_callback_call(o, EFL_NET_CONTROL_EVENT_AGENT_RELEASED, NULL);
+ efl_event_callback_call(o, EFL_NET_CONTROL_MANAGER_EVENT_AGENT_RELEASED, NULL);
end:
return eldbus_message_method_return_new(msg);
@@ -93,7 +93,7 @@ static Eldbus_Message *
_efl_net_control_agent_cancel(const Eldbus_Service_Interface *service, const Eldbus_Message *msg)
{
Eo *o = eldbus_service_object_data_get(service, "efl_net");
- Efl_Net_Control_Data *pd = efl_data_scope_get(o, MY_CLASS);
+ Efl_Net_Control_Manager_Data *pd = efl_data_scope_get(o, MY_CLASS);
Eldbus_Message *reply;
DBG("Agent %p request canceled %s", o, eldbus_message_path_get(msg));
@@ -208,7 +208,7 @@ static Eldbus_Message *
_efl_net_control_agent_request_input(const Eldbus_Service_Interface *service, const Eldbus_Message *msg)
{
Eo *o = eldbus_service_object_data_get(service, "efl_net");
- Efl_Net_Control_Data *pd = efl_data_scope_get(o, MY_CLASS);
+ Efl_Net_Control_Manager_Data *pd = efl_data_scope_get(o, MY_CLASS);
Efl_Net_Control_Agent_Request_Input event = { };
Efl_Net_Control_Agent_Request_Input_Information *info;
Eldbus_Message_Iter *array, *entry;
@@ -268,7 +268,7 @@ _efl_net_control_agent_request_input(const Eldbus_Service_Interface *service, co
}
pd->agent_request_input.msg = eldbus_message_ref((Eldbus_Message *)msg);
- efl_event_callback_call(o, EFL_NET_CONTROL_EVENT_AGENT_REQUEST_INPUT, &event);
+ efl_event_callback_call(o, EFL_NET_CONTROL_MANAGER_EVENT_AGENT_REQUEST_INPUT, &event);
EINA_LIST_FREE(event.informational, info) free(info);
@@ -282,7 +282,7 @@ static Eldbus_Message *
_efl_net_control_agent_report_error(const Eldbus_Service_Interface *service, const Eldbus_Message *msg)
{
Eo *o = eldbus_service_object_data_get(service, "efl_net");
- Efl_Net_Control_Data *pd = efl_data_scope_get(o, MY_CLASS);
+ Efl_Net_Control_Manager_Data *pd = efl_data_scope_get(o, MY_CLASS);
const char *path, *err_msg;
Efl_Net_Control_Agent_Error event = { };
@@ -300,7 +300,7 @@ _efl_net_control_agent_report_error(const Eldbus_Service_Interface *service, con
event.access_point = _efl_net_control_access_point_find(pd, path);
event.message = err_msg;
- efl_event_callback_call(o, EFL_NET_CONTROL_EVENT_AGENT_ERROR, &event);
+ efl_event_callback_call(o, EFL_NET_CONTROL_MANAGER_EVENT_AGENT_ERROR, &event);
end:
return eldbus_message_method_return_new(msg);
@@ -310,7 +310,7 @@ static Eldbus_Message *
_efl_net_control_agent_request_browser(const Eldbus_Service_Interface *service, const Eldbus_Message *msg)
{
Eo *o = eldbus_service_object_data_get(service, "efl_net");
- Efl_Net_Control_Data *pd = efl_data_scope_get(o, MY_CLASS);
+ Efl_Net_Control_Manager_Data *pd = efl_data_scope_get(o, MY_CLASS);
const char *path, *url;
Efl_Net_Control_Agent_Browser_Url event = { };
@@ -328,7 +328,7 @@ _efl_net_control_agent_request_browser(const Eldbus_Service_Interface *service,
event.access_point = _efl_net_control_access_point_find(pd, path);
event.url = url;
- efl_event_callback_call(o, EFL_NET_CONTROL_EVENT_AGENT_BROWSER_URL, &event);
+ efl_event_callback_call(o, EFL_NET_CONTROL_MANAGER_EVENT_AGENT_BROWSER_URL, &event);
end:
return eldbus_message_method_return_new(msg);
@@ -402,7 +402,7 @@ static const Eldbus_Service_Interface_Desc _efl_net_control_agent_desc = {
};
static void
-_efl_net_control_technology_added_internal(Eo *o, Efl_Net_Control_Data *pd, Eldbus_Message_Iter *itr)
+_efl_net_control_technology_added_internal(Eo *o, Efl_Net_Control_Manager_Data *pd, Eldbus_Message_Iter *itr)
{
const char *path;
Eldbus_Message_Iter *array;
@@ -423,14 +423,14 @@ _efl_net_control_technology_added_internal(Eo *o, Efl_Net_Control_Data *pd, Eldb
pd->technologies = eina_list_append(pd->technologies, child);
DBG("Technology Added Path=%s", path);
- efl_event_callback_call(o, EFL_NET_CONTROL_EVENT_TECHNOLOGY_ADD, child);
+ efl_event_callback_call(o, EFL_NET_CONTROL_MANAGER_EVENT_TECHNOLOGY_ADD, child);
}
static void
_efl_net_control_technology_added(void *data, const Eldbus_Message *msg)
{
Eo *o = data;
- Efl_Net_Control_Data *pd = efl_data_scope_get(o, MY_CLASS);
+ Efl_Net_Control_Manager_Data *pd = efl_data_scope_get(o, MY_CLASS);
Eldbus_Message_Iter *itr = eldbus_message_iter_get(msg);
_efl_net_control_technology_added_internal(o, pd, itr);
}
@@ -439,7 +439,7 @@ static void
_efl_net_control_technology_removed(void *data, const Eldbus_Message *msg)
{
Eo *o = data;
- Efl_Net_Control_Data *pd = efl_data_scope_get(o, MY_CLASS);
+ Efl_Net_Control_Manager_Data *pd = efl_data_scope_get(o, MY_CLASS);
Eo *child;
const char *path;
@@ -458,12 +458,12 @@ _efl_net_control_technology_removed(void *data, const Eldbus_Message *msg)
pd->technologies = eina_list_remove(pd->technologies, child);
DBG("Technology Removed Path=%s", path);
- efl_event_callback_call(o, EFL_NET_CONTROL_EVENT_TECHNOLOGY_DEL, child);
+ efl_event_callback_call(o, EFL_NET_CONTROL_MANAGER_EVENT_TECHNOLOGY_DEL, child);
efl_del(child);
}
static void
-_efl_net_control_access_point_added(Eo *o, Efl_Net_Control_Data *pd, const char *path, Eldbus_Message_Iter *properties, unsigned int priority)
+_efl_net_control_access_point_added(Eo *o, Efl_Net_Control_Manager_Data *pd, const char *path, Eldbus_Message_Iter *properties, unsigned int priority)
{
Eo *child;
@@ -476,11 +476,11 @@ _efl_net_control_access_point_added(Eo *o, Efl_Net_Control_Data *pd, const char
pd->access_points = eina_list_append(pd->access_points, child);
DBG("Access Point Added Path=%s", path);
- efl_event_callback_call(o, EFL_NET_CONTROL_EVENT_ACCESS_POINT_ADD, child);
+ efl_event_callback_call(o, EFL_NET_CONTROL_MANAGER_EVENT_ACCESS_POINT_ADD, child);
}
static void
-_efl_net_control_access_point_updated(Eo *o, Efl_Net_Control_Data *pd, const char *path, Eldbus_Message_Iter *properties, unsigned int priority)
+_efl_net_control_access_point_updated(Eo *o, Efl_Net_Control_Manager_Data *pd, const char *path, Eldbus_Message_Iter *properties, unsigned int priority)
{
Eo *child = _efl_net_control_access_point_find(pd, path);
if (!child)
@@ -493,7 +493,7 @@ _efl_net_control_access_point_updated(Eo *o, Efl_Net_Control_Data *pd, const cha
}
static void
-_efl_net_control_access_point_removed(Eo *o, Efl_Net_Control_Data *pd, const char *path)
+_efl_net_control_access_point_removed(Eo *o, Efl_Net_Control_Manager_Data *pd, const char *path)
{
Eo *child = _efl_net_control_access_point_find(pd, path);
if (!child)
@@ -504,7 +504,7 @@ _efl_net_control_access_point_removed(Eo *o, Efl_Net_Control_Data *pd, const cha
pd->access_points = eina_list_remove(pd->access_points, child);
DBG("Access Point Removed Path=%s", path);
- efl_event_callback_call(o, EFL_NET_CONTROL_EVENT_ACCESS_POINT_DEL, child);
+ efl_event_callback_call(o, EFL_NET_CONTROL_MANAGER_EVENT_ACCESS_POINT_DEL, child);
efl_del(child);
}
@@ -524,7 +524,7 @@ static void
_efl_net_control_services_changed(void *data, const Eldbus_Message *msg)
{
Eo *o = data;
- Efl_Net_Control_Data *pd = efl_data_scope_get(o, MY_CLASS);
+ Efl_Net_Control_Manager_Data *pd = efl_data_scope_get(o, MY_CLASS);
Eldbus_Message_Iter *changed, *invalidated, *sub;
const char *path;
unsigned int priority;
@@ -554,7 +554,7 @@ _efl_net_control_services_changed(void *data, const Eldbus_Message *msg)
pd->access_points = eina_list_sort(pd->access_points, 0, _efl_net_control_access_point_sort_cb);
- efl_event_callback_call(o, EFL_NET_CONTROL_EVENT_ACCESS_POINTS_CHANGED, NULL);
+ efl_event_callback_call(o, EFL_NET_CONTROL_MANAGER_EVENT_ACCESS_POINTS_CHANGED, NULL);
efl_unref(o);
}
@@ -579,7 +579,7 @@ _efl_net_control_state_from_str(const char *str)
}
static void
-_efl_net_control_property_state_changed(Eo *o, Efl_Net_Control_Data *pd, Eldbus_Message_Iter *value)
+_efl_net_control_property_state_changed(Eo *o, Efl_Net_Control_Manager_Data *pd, Eldbus_Message_Iter *value)
{
const char *str;
Efl_Net_Control_State state;
@@ -594,11 +594,11 @@ _efl_net_control_property_state_changed(Eo *o, Efl_Net_Control_Data *pd, Eldbus_
if (pd->state == state) return;
pd->state = state;
DBG("state=%d (%s)", state, str);
- efl_event_callback_call(o, EFL_NET_CONTROL_EVENT_STATE_CHANGED, NULL);
+ efl_event_callback_call(o, EFL_NET_CONTROL_MANAGER_EVENT_STATE_CHANGED, NULL);
}
static void
-_efl_net_control_property_radios_offline_changed(Eo *o, Efl_Net_Control_Data *pd, Eldbus_Message_Iter *value)
+_efl_net_control_property_radios_offline_changed(Eo *o, Efl_Net_Control_Manager_Data *pd, Eldbus_Message_Iter *value)
{
Eina_Bool offline;
@@ -611,11 +611,11 @@ _efl_net_control_property_radios_offline_changed(Eo *o, Efl_Net_Control_Data *pd
if (pd->radios_offline == offline) return;
pd->radios_offline = offline;
DBG("radios offline=%hhu", offline);
- efl_event_callback_call(o, EFL_NET_CONTROL_EVENT_RADIOS_OFFLINE_CHANGED, NULL);
+ efl_event_callback_call(o, EFL_NET_CONTROL_MANAGER_EVENT_RADIOS_OFFLINE_CHANGED, NULL);
}
static void
-_efl_net_control_property_changed_internal(Eo *o, Efl_Net_Control_Data *pd, Eldbus_Message_Iter *itr)
+_efl_net_control_property_changed_internal(Eo *o, Efl_Net_Control_Manager_Data *pd, Eldbus_Message_Iter *itr)
{
Eldbus_Message_Iter *value;
const char *name;
@@ -640,7 +640,7 @@ static void
_efl_net_control_property_changed(void *data, const Eldbus_Message *msg)
{
Eo *o = data;
- Efl_Net_Control_Data *pd = efl_data_scope_get(o, MY_CLASS);
+ Efl_Net_Control_Manager_Data *pd = efl_data_scope_get(o, MY_CLASS);
Eldbus_Message_Iter *itr;
itr = eldbus_message_iter_get(msg);
@@ -651,7 +651,7 @@ static void
_efl_net_control_properties_get_cb(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
Eo *o = data;
- Efl_Net_Control_Data *pd = efl_data_scope_get(o, MY_CLASS);
+ Efl_Net_Control_Manager_Data *pd = efl_data_scope_get(o, MY_CLASS);
Eldbus_Message_Iter *array, *entry;
const char *err_name, *err_msg;
@@ -683,7 +683,7 @@ static void
_efl_net_control_technologies_get_cb(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
Eo *o = data;
- Efl_Net_Control_Data *pd = efl_data_scope_get(o, MY_CLASS);
+ Efl_Net_Control_Manager_Data *pd = efl_data_scope_get(o, MY_CLASS);
Eldbus_Message_Iter *array, *entry;
const char *err_name, *err_msg;
@@ -712,7 +712,7 @@ static void
_efl_net_control_services_get_cb(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
Eo *o = data;
- Efl_Net_Control_Data *pd = efl_data_scope_get(o, MY_CLASS);
+ Efl_Net_Control_Manager_Data *pd = efl_data_scope_get(o, MY_CLASS);
Eldbus_Message_Iter *array, *sub;
const char *err_name, *err_msg, *path;
unsigned int priority = 0;
@@ -745,7 +745,7 @@ _efl_net_control_services_get_cb(void *data, const Eldbus_Message *msg, Eldbus_P
pd->access_points = eina_list_sort(pd->access_points, 0, _efl_net_control_access_point_sort_cb);
- efl_event_callback_call(o, EFL_NET_CONTROL_EVENT_ACCESS_POINTS_CHANGED, NULL);
+ efl_event_callback_call(o, EFL_NET_CONTROL_MANAGER_EVENT_ACCESS_POINTS_CHANGED, NULL);
efl_unref(o);
}
@@ -753,7 +753,7 @@ static void
_efl_net_control_radios_offline_cb(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
Eo *o = data;
- Efl_Net_Control_Data *pd = efl_data_scope_get(o, MY_CLASS);
+ Efl_Net_Control_Manager_Data *pd = efl_data_scope_get(o, MY_CLASS);
const char *err_name, *err_msg;
Eina_Bool radios_offline = pd->request.radios_offline;
@@ -774,7 +774,7 @@ _efl_net_control_radios_offline_cb(void *data, const Eldbus_Message *msg, Eldbus
}
static void
-_efl_net_control_radios_offline_apply(Eo *o, Efl_Net_Control_Data *pd)
+_efl_net_control_radios_offline_apply(Eo *o, Efl_Net_Control_Manager_Data *pd)
{
Eldbus_Proxy *mgr = efl_net_connman_manager_get();
Eldbus_Message *msg = eldbus_proxy_method_call_new(mgr, "SetProperty");
@@ -811,34 +811,34 @@ _efl_net_control_radios_offline_apply(Eo *o, Efl_Net_Control_Data *pd)
}
static void
-_efl_net_control_clear(Eo *o, Efl_Net_Control_Data *pd)
+_efl_net_control_clear(Eo *o, Efl_Net_Control_Manager_Data *pd)
{
Eo *child;
EINA_LIST_FREE(pd->access_points, child)
{
- efl_event_callback_call(o, EFL_NET_CONTROL_EVENT_ACCESS_POINT_DEL, child);
+ efl_event_callback_call(o, EFL_NET_CONTROL_MANAGER_EVENT_ACCESS_POINT_DEL, child);
efl_del(child);
}
- efl_event_callback_call(o, EFL_NET_CONTROL_EVENT_ACCESS_POINTS_CHANGED, NULL);
+ efl_event_callback_call(o, EFL_NET_CONTROL_MANAGER_EVENT_ACCESS_POINTS_CHANGED, NULL);
EINA_LIST_FREE(pd->technologies, child)
{
- efl_event_callback_call(o, EFL_NET_CONTROL_EVENT_TECHNOLOGY_DEL, child);
+ efl_event_callback_call(o, EFL_NET_CONTROL_MANAGER_EVENT_TECHNOLOGY_DEL, child);
efl_del(child);
}
pd->state = EFL_NET_CONTROL_STATE_OFFLINE;
- efl_event_callback_call(o, EFL_NET_CONTROL_EVENT_STATE_CHANGED, NULL);
+ efl_event_callback_call(o, EFL_NET_CONTROL_MANAGER_EVENT_STATE_CHANGED, NULL);
pd->radios_offline = EINA_TRUE;
- efl_event_callback_call(o, EFL_NET_CONTROL_EVENT_RADIOS_OFFLINE_CHANGED, NULL);
+ efl_event_callback_call(o, EFL_NET_CONTROL_MANAGER_EVENT_RADIOS_OFFLINE_CHANGED, NULL);
}
static void
_efl_net_control_connman_name_owner_changed(void *data, const char *bus, const char *old_id, const char *new_id)
{
Eo *o = data;
- Efl_Net_Control_Data *pd = efl_data_scope_get(o, MY_CLASS);
+ Efl_Net_Control_Manager_Data *pd = efl_data_scope_get(o, MY_CLASS);
Eldbus_Proxy *mgr;
DBG("Name Owner Changed %s: %s->%s", bus, old_id, new_id);
@@ -849,7 +849,7 @@ _efl_net_control_connman_name_owner_changed(void *data, const char *bus, const c
if (pd->agent_enabled)
{
pd->agent_enabled = EINA_FALSE;
- efl_event_callback_call(o, EFL_NET_CONTROL_EVENT_AGENT_RELEASED, NULL);
+ efl_event_callback_call(o, EFL_NET_CONTROL_MANAGER_EVENT_AGENT_RELEASED, NULL);
}
return;
}
@@ -894,14 +894,14 @@ _efl_net_control_connman_name_owner_changed(void *data, const char *bus, const c
if (pd->agent_enabled)
{
pd->agent_enabled = EINA_FALSE;
- _efl_net_control_agent_enabled_set(o, pd, EINA_TRUE);
+ _efl_net_control_manager_agent_enabled_set(o, pd, EINA_TRUE);
}
}
void
efl_net_connman_control_access_points_reload(Eo *o)
{
- Efl_Net_Control_Data *pd = efl_data_scope_get(o, MY_CLASS);
+ Efl_Net_Control_Manager_Data *pd = efl_data_scope_get(o, MY_CLASS);
Eldbus_Proxy *mgr;
Eldbus_Pending *p;
@@ -915,7 +915,7 @@ efl_net_connman_control_access_points_reload(Eo *o)
}
EOLIAN static Eo *
-_efl_net_control_efl_object_constructor(Eo *o, Efl_Net_Control_Data *pd EINA_UNUSED)
+_efl_net_control_manager_efl_object_constructor(Eo *o, Efl_Net_Control_Manager_Data *pd EINA_UNUSED)
{
pd->radios_offline = EINA_TRUE;
pd->request.radios_offline = 0xff;
@@ -930,7 +930,7 @@ _efl_net_control_efl_object_constructor(Eo *o, Efl_Net_Control_Data *pd EINA_UNU
}
EOLIAN static Eo *
-_efl_net_control_efl_object_finalize(Eo *o, Efl_Net_Control_Data *pd EINA_UNUSED)
+_efl_net_control_manager_efl_object_finalize(Eo *o, Efl_Net_Control_Manager_Data *pd EINA_UNUSED)
{
Eldbus_Connection *conn;
char path[128];
@@ -953,7 +953,7 @@ _efl_net_control_efl_object_finalize(Eo *o, Efl_Net_Control_Data *pd EINA_UNUSED
}
EOLIAN static void
-_efl_net_control_efl_object_destructor(Eo *o, Efl_Net_Control_Data *pd)
+_efl_net_control_manager_efl_object_destructor(Eo *o, Efl_Net_Control_Manager_Data *pd)
{
Eldbus_Pending *p;
Eldbus_Signal_Handler *sh;
@@ -1003,40 +1003,40 @@ _efl_net_control_efl_object_destructor(Eo *o, Efl_Net_Control_Data *pd)
}
EOLIAN static void
-_efl_net_control_radios_offline_set(Eo *o, Efl_Net_Control_Data *pd, Eina_Bool radios_offline)
+_efl_net_control_manager_radios_offline_set(Eo *o, Efl_Net_Control_Manager_Data *pd, Eina_Bool radios_offline)
{
pd->request.radios_offline = radios_offline;
if (pd->operating) _efl_net_control_radios_offline_apply(o, pd);
}
EOLIAN static Eina_Bool
-_efl_net_control_radios_offline_get(Eo *o EINA_UNUSED, Efl_Net_Control_Data *pd)
+_efl_net_control_manager_radios_offline_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Manager_Data *pd)
{
return pd->radios_offline;
}
EOLIAN static Efl_Net_Control_State
-_efl_net_control_state_get(Eo *o EINA_UNUSED, Efl_Net_Control_Data *pd)
+_efl_net_control_manager_state_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Manager_Data *pd)
{
return pd->state;
}
EOLIAN static Eina_Iterator *
-_efl_net_control_access_points_get(Eo *o EINA_UNUSED, Efl_Net_Control_Data *pd)
+_efl_net_control_manager_access_points_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Manager_Data *pd)
{
return eina_list_iterator_new(pd->access_points);
}
EOLIAN static Eina_Iterator *
-_efl_net_control_technologies_get(Eo *o EINA_UNUSED, Efl_Net_Control_Data *pd)
+_efl_net_control_manager_technologies_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Manager_Data *pd)
{
return eina_list_iterator_new(pd->technologies);
}
Efl_Net_Control_Technology *
-efl_net_connman_control_find_technology_by_type(Efl_Net_Control *o, const char *tech_type)
+efl_net_connman_control_find_technology_by_type(Efl_Net_Control_Manager *o, const char *tech_type)
{
- Efl_Net_Control_Data *pd = efl_data_scope_get(o, MY_CLASS);
+ Efl_Net_Control_Manager_Data *pd = efl_data_scope_get(o, MY_CLASS);
Efl_Net_Control_Technology_Type desired = efl_net_connman_technology_type_from_str(tech_type);
const Eina_List *n;
Eo *child;
@@ -1058,7 +1058,7 @@ static void
_efl_net_control_agent_register_cb(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
Eo *o = data;
- Efl_Net_Control_Data *pd = efl_data_scope_get(o, MY_CLASS);
+ Efl_Net_Control_Manager_Data *pd = efl_data_scope_get(o, MY_CLASS);
const char *err_name, *err_msg;
pd->pending = eina_list_remove(pd->pending, pending);
@@ -1078,7 +1078,7 @@ static void
_efl_net_control_agent_unregister_cb(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
Eo *o = data;
- Efl_Net_Control_Data *pd = efl_data_scope_get(o, MY_CLASS);
+ Efl_Net_Control_Manager_Data *pd = efl_data_scope_get(o, MY_CLASS);
const char *err_name, *err_msg;
pd->pending = eina_list_remove(pd->pending, pending);
@@ -1094,7 +1094,7 @@ _efl_net_control_agent_unregister_cb(void *data, const Eldbus_Message *msg, Eldb
}
EOLIAN static void
-_efl_net_control_agent_enabled_set(Eo *o, Efl_Net_Control_Data *pd, Eina_Bool agent_enabled)
+_efl_net_control_manager_agent_enabled_set(Eo *o, Efl_Net_Control_Manager_Data *pd, Eina_Bool agent_enabled)
{
Eldbus_Pending *p;
Eldbus_Proxy *mgr;
@@ -1142,7 +1142,7 @@ _efl_net_control_agent_enabled_set(Eo *o, Efl_Net_Control_Data *pd, Eina_Bool ag
}
EOLIAN static Eina_Bool
-_efl_net_control_agent_enabled_get(Eo *o EINA_UNUSED, Efl_Net_Control_Data *pd)
+_efl_net_control_manager_agent_enabled_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Manager_Data *pd)
{
return pd->agent_enabled;
}
@@ -1193,7 +1193,7 @@ _append_dict_entry_byte_array(Eldbus_Message_Iter *array, const char *name, cons
}
EOLIAN static void
-_efl_net_control_agent_reply(Eo *o EINA_UNUSED, Efl_Net_Control_Data *pd, const char *name, const Eina_Slice *ssid, const char *username, const char *passphrase, const char *wps)
+_efl_net_control_manager_agent_reply(Eo *o EINA_UNUSED, Efl_Net_Control_Manager_Data *pd, const char *name, const Eina_Slice *ssid, const char *username, const char *passphrase, const char *wps)
{
Eldbus_Message *reply;
Eldbus_Message_Iter *msg_itr, *array;
@@ -1230,4 +1230,4 @@ _efl_net_control_agent_reply(Eo *o EINA_UNUSED, Efl_Net_Control_Data *pd, const
eldbus_connection_send(efl_net_connman_connection_get(), reply, NULL, NULL, -1.0);
}
-#include "efl_net_control.eo.c"
+#include "efl_net_control_manager.eo.c"
diff --git a/src/lib/ecore_con/efl_net_control-none.c b/src/lib/ecore_con/efl_net_control-none.c
index bb5f621642..2a84e4b15c 100644
--- a/src/lib/ecore_con/efl_net_control-none.c
+++ b/src/lib/ecore_con/efl_net_control-none.c
@@ -9,72 +9,72 @@
typedef struct
{
-} Efl_Net_Control_Data;
+} Efl_Net_Control_Manager_Data;
EOLIAN static void
-_efl_net_control_efl_object_destructor(Eo *obj, Efl_Net_Control_Data *pd EINA_UNUSED)
+_efl_net_control_manager_efl_object_destructor(Eo *obj, Efl_Net_Control_Manager_Data *pd EINA_UNUSED)
{
- efl_destructor(efl_super(obj, EFL_NET_CONTROL_CLASS));
+ efl_destructor(efl_super(obj, EFL_NET_CONTROL_MANAGER_CLASS));
}
EOLIAN static Efl_Object *
-_efl_net_control_efl_object_constructor(Eo *obj, Efl_Net_Control_Data *pd EINA_UNUSED)
+_efl_net_control_manager_efl_object_constructor(Eo *obj, Efl_Net_Control_Manager_Data *pd EINA_UNUSED)
{
INF("EFL compiled with --with-net-control=none");
- return efl_constructor(efl_super(obj, EFL_NET_CONTROL_CLASS));
+ return efl_constructor(efl_super(obj, EFL_NET_CONTROL_MANAGER_CLASS));
}
EOLIAN static Efl_Object *
-_efl_net_control_efl_object_finalize(Eo *obj, Efl_Net_Control_Data *pd EINA_UNUSED)
+_efl_net_control_manager_efl_object_finalize(Eo *obj, Efl_Net_Control_Manager_Data *pd EINA_UNUSED)
{
- obj = efl_finalize(efl_super(obj, EFL_NET_CONTROL_CLASS));
- efl_event_callback_call(obj, EFL_NET_CONTROL_EVENT_STATE_CHANGED, NULL);
+ obj = efl_finalize(efl_super(obj, EFL_NET_CONTROL_MANAGER_CLASS));
+ efl_event_callback_call(obj, EFL_NET_CONTROL_MANAGER_EVENT_STATE_CHANGED, NULL);
return obj;
}
EOLIAN static void
-_efl_net_control_radios_offline_set(Eo *obj EINA_UNUSED, Efl_Net_Control_Data *pd EINA_UNUSED, Eina_Bool radios_offline EINA_UNUSED)
+_efl_net_control_manager_radios_offline_set(Eo *obj EINA_UNUSED, Efl_Net_Control_Manager_Data *pd EINA_UNUSED, Eina_Bool radios_offline EINA_UNUSED)
{
}
EOLIAN static Eina_Bool
-_efl_net_control_radios_offline_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Data *pd EINA_UNUSED)
+_efl_net_control_manager_radios_offline_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Manager_Data *pd EINA_UNUSED)
{
return EINA_FALSE;
}
EOLIAN static Efl_Net_Control_State
-_efl_net_control_state_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Data *pd EINA_UNUSED)
+_efl_net_control_manager_state_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Manager_Data *pd EINA_UNUSED)
{
return EFL_NET_CONTROL_STATE_ONLINE; /* best default for unsupported, hope we're online */
}
EOLIAN static Eina_Iterator *
-_efl_net_control_access_points_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Data *pd EINA_UNUSED)
+_efl_net_control_manager_access_points_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Manager_Data *pd EINA_UNUSED)
{
return eina_list_iterator_new(NULL);
}
EOLIAN static Eina_Iterator *
-_efl_net_control_technologies_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Data *pd EINA_UNUSED)
+_efl_net_control_manager_technologies_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Manager_Data *pd EINA_UNUSED)
{
return eina_list_iterator_new(NULL);
}
EOLIAN static void
-_efl_net_control_agent_enabled_set(Eo *obj EINA_UNUSED, Efl_Net_Control_Data *pd EINA_UNUSED, Eina_Bool agent_enabled EINA_UNUSED)
+_efl_net_control_manager_agent_enabled_set(Eo *obj EINA_UNUSED, Efl_Net_Control_Manager_Data *pd EINA_UNUSED, Eina_Bool agent_enabled EINA_UNUSED)
{
}
EOLIAN static Eina_Bool
-_efl_net_control_agent_enabled_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Data *pd EINA_UNUSED)
+_efl_net_control_manager_agent_enabled_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Manager_Data *pd EINA_UNUSED)
{
return EINA_FALSE;
}
EOLIAN static void
-_efl_net_control_agent_reply(Eo *obj EINA_UNUSED, Efl_Net_Control_Data *pd EINA_UNUSED, const char *name EINA_UNUSED, const Eina_Slice *ssid EINA_UNUSED, const char *username EINA_UNUSED, const char *passphrase EINA_UNUSED, const char *wps EINA_UNUSED)
+_efl_net_control_manager_agent_reply(Eo *obj EINA_UNUSED, Efl_Net_Control_Manager_Data *pd EINA_UNUSED, const char *name EINA_UNUSED, const Eina_Slice *ssid EINA_UNUSED, const char *username EINA_UNUSED, const char *passphrase EINA_UNUSED, const char *wps EINA_UNUSED)
{
}
-#include "efl_net_control.eo.c"
+#include "efl_net_control_manager.eo.c"
diff --git a/src/lib/ecore_con/efl_net_control_access_point-connman.c b/src/lib/ecore_con/efl_net_control_access_point-connman.c
index bd8e3d4e34..92c491d119 100644
--- a/src/lib/ecore_con/efl_net_control_access_point-connman.c
+++ b/src/lib/ecore_con/efl_net_control_access_point-connman.c
@@ -75,7 +75,7 @@ _efl_net_control_access_point_property_set_cb(void *data, const Eldbus_Message *
}
static void
-_efl_net_control_access_point_property_set_string_array(Eo *o, Efl_Net_Control_Access_Point_Data *pd, const char *name, Eina_Iterator *it)
+_efl_net_control_access_point_property_set_string_array(const Eo *o, Efl_Net_Control_Access_Point_Data *pd, const char *name, Eina_Iterator *it)
{
Eldbus_Message *msg;
Eldbus_Message_Iter *msg_itr, *var, *array;
@@ -112,7 +112,7 @@ _efl_net_control_access_point_property_set_string_array(Eo *o, Efl_Net_Control_A
}
static void
-_efl_net_control_access_point_property_set(Eo *o, Efl_Net_Control_Access_Point_Data *pd, const char *name, const char *signature, ...)
+_efl_net_control_access_point_property_set(const Eo *o, Efl_Net_Control_Access_Point_Data *pd, const char *name, const char *signature, ...)
{
Eldbus_Message *msg;
Eldbus_Message_Iter *msg_itr, *var;
@@ -205,19 +205,19 @@ _efl_net_control_access_point_efl_object_destructor(Eo *o, Efl_Net_Control_Acces
}
EOLIAN static Efl_Net_Control_Access_Point_State
-_efl_net_control_access_point_state_get(Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
+_efl_net_control_access_point_state_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
{
return pd->state;
}
EOLIAN static Efl_Net_Control_Access_Point_Error
-_efl_net_control_access_point_error_get(Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
+_efl_net_control_access_point_error_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
{
return pd->error;
}
EOLIAN static const char *
-_efl_net_control_access_point_name_get(Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
+_efl_net_control_access_point_ssid_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
{
return pd->name;
}
@@ -261,7 +261,7 @@ _efl_net_control_access_point_priority_set(Eo *o, Efl_Net_Control_Access_Point_D
return;
}
- it = efl_net_control_access_points_get(efl_parent_get(o));
+ it = efl_net_control_manager_access_points_get(efl_parent_get(o));
EINA_ITERATOR_FOREACH(it, ap)
{
unsigned other_prio;
@@ -312,25 +312,25 @@ _efl_net_control_access_point_priority_set(Eo *o, Efl_Net_Control_Access_Point_D
}
EOLIAN static unsigned int
-_efl_net_control_access_point_priority_get(Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
+_efl_net_control_access_point_priority_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
{
return pd->priority;
}
EOLIAN static Efl_Net_Control_Technology *
-_efl_net_control_access_point_technology_get(Eo *o, Efl_Net_Control_Access_Point_Data *pd)
+_efl_net_control_access_point_technology_get(const Eo *o, Efl_Net_Control_Access_Point_Data *pd)
{
return efl_net_connman_control_find_technology_by_type(efl_parent_get(o), pd->techname);
}
EOLIAN static uint8_t
-_efl_net_control_access_point_strength_get(Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
+_efl_net_control_access_point_strength_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
{
return pd->strength;
}
EOLIAN static Eina_Bool
-_efl_net_control_access_point_roaming_get(Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
+_efl_net_control_access_point_roaming_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
{
return pd->roaming;
}
@@ -342,49 +342,49 @@ _efl_net_control_access_point_auto_connect_set(Eo *o, Efl_Net_Control_Access_Poi
}
EOLIAN static Eina_Bool
-_efl_net_control_access_point_auto_connect_get(Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
+_efl_net_control_access_point_auto_connect_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
{
return pd->auto_connect;
}
EOLIAN static Eina_Bool
-_efl_net_control_access_point_remembered_get(Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
+_efl_net_control_access_point_remembered_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
{
return pd->remembered;
}
EOLIAN static Eina_Bool
-_efl_net_control_access_point_immutable_get(Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
+_efl_net_control_access_point_immutable_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
{
return pd->immutable;
}
EOLIAN static Efl_Net_Control_Access_Point_Security
-_efl_net_control_access_point_security_get(Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
+_efl_net_control_access_point_security_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
{
return pd->security;
}
EOLIAN static Eina_Iterator *
-_efl_net_control_access_point_name_servers_get(Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
+_efl_net_control_access_point_name_servers_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
{
return eina_list_iterator_new(pd->actual.name_servers);
}
EOLIAN static Eina_Iterator *
-_efl_net_control_access_point_time_servers_get(Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
+_efl_net_control_access_point_time_servers_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
{
return eina_list_iterator_new(pd->actual.time_servers);
}
EOLIAN static Eina_Iterator *
-_efl_net_control_access_point_domains_get(Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
+_efl_net_control_access_point_domains_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
{
return eina_list_iterator_new(pd->actual.domains);
}
EOLIAN static void
-_efl_net_control_access_point_ipv4_get(Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd, Efl_Net_Control_Access_Point_Ipv4_Method *method, const char **address, const char **netmask, const char **gateway)
+_efl_net_control_access_point_ipv4_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd, Efl_Net_Control_Access_Point_Ipv4_Method *method, const char **address, const char **netmask, const char **gateway)
{
if (method) *method = pd->actual.ipv4.method;
if (address) *address = pd->actual.ipv4.address;
@@ -393,7 +393,7 @@ _efl_net_control_access_point_ipv4_get(Eo *o EINA_UNUSED, Efl_Net_Control_Access
}
EOLIAN static void
-_efl_net_control_access_point_ipv6_get(Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd, Efl_Net_Control_Access_Point_Ipv6_Method *method, const char **address, uint8_t *prefix_length, const char **netmask, const char **gateway)
+_efl_net_control_access_point_ipv6_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd, Efl_Net_Control_Access_Point_Ipv6_Method *method, const char **address, uint8_t *prefix_length, const char **netmask, const char **gateway)
{
if (method) *method = pd->actual.ipv6.method;
if (address) *address = pd->actual.ipv6.address;
@@ -403,7 +403,7 @@ _efl_net_control_access_point_ipv6_get(Eo *o EINA_UNUSED, Efl_Net_Control_Access
}
EOLIAN static void
-_efl_net_control_access_point_proxy_get(Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd, Efl_Net_Control_Access_Point_Proxy_Method *method, const char **url, Eina_Iterator **servers, Eina_Iterator **excludes)
+_efl_net_control_access_point_proxy_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd, Efl_Net_Control_Access_Point_Proxy_Method *method, const char **url, Eina_Iterator **servers, Eina_Iterator **excludes)
{
if (method) *method = pd->actual.proxy.method;
if (url) *url = pd->actual.proxy.url;
@@ -418,7 +418,7 @@ _efl_net_control_access_point_configuration_name_servers_set(Eo *o, Efl_Net_Cont
}
EOLIAN static Eina_Iterator *
-_efl_net_control_access_point_configuration_name_servers_get(Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
+_efl_net_control_access_point_configuration_name_servers_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
{
return eina_list_iterator_new(pd->configured.name_servers);
}
@@ -430,7 +430,7 @@ _efl_net_control_access_point_configuration_time_servers_set(Eo *o, Efl_Net_Cont
}
EOLIAN static Eina_Iterator *
-_efl_net_control_access_point_configuration_time_servers_get(Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
+_efl_net_control_access_point_configuration_time_servers_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
{
return eina_list_iterator_new(pd->configured.time_servers);
}
@@ -442,7 +442,7 @@ _efl_net_control_access_point_configuration_domains_set(Eo *o, Efl_Net_Control_A
}
EOLIAN static Eina_Iterator *
-_efl_net_control_access_point_configuration_domains_get(Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
+_efl_net_control_access_point_configuration_domains_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd)
{
return eina_list_iterator_new(pd->configured.domains);
}
@@ -518,7 +518,6 @@ _efl_net_control_access_point_configuration_ipv4_set(Eo *o, Efl_Net_Control_Acce
switch (method)
{
- case EFL_NET_CONTROL_ACCESS_POINT_IPV4_METHOD_UNSET: goto error_send;
case EFL_NET_CONTROL_ACCESS_POINT_IPV4_METHOD_OFF:
_append_dict_entry(array, "Method", "s", "off");
break;
@@ -534,6 +533,8 @@ _efl_net_control_access_point_configuration_ipv4_set(Eo *o, Efl_Net_Control_Acce
if (gateway)
_append_dict_entry(array, "Gateway", "s", gateway);
break;
+ default:
+ break;
}
eldbus_message_iter_container_close(var, array);
@@ -551,7 +552,7 @@ _efl_net_control_access_point_configuration_ipv4_set(Eo *o, Efl_Net_Control_Acce
}
EOLIAN static void
-_efl_net_control_access_point_configuration_ipv4_get(Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd, Efl_Net_Control_Access_Point_Ipv4_Method *method, const char **address, const char **netmask, const char **gateway)
+_efl_net_control_access_point_configuration_ipv4_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd, Efl_Net_Control_Access_Point_Ipv4_Method *method, const char **address, const char **netmask, const char **gateway)
{
if (method) *method = pd->configured.ipv4.method;
if (address) *address = pd->configured.ipv4.address;
@@ -594,9 +595,6 @@ _efl_net_control_access_point_configuration_ipv6_set(Eo *o, Efl_Net_Control_Acce
switch (method)
{
- case EFL_NET_CONTROL_ACCESS_POINT_IPV6_METHOD_UNSET: goto error_send;
- case EFL_NET_CONTROL_ACCESS_POINT_IPV6_METHOD_FIXED: goto error_send;
- case EFL_NET_CONTROL_ACCESS_POINT_IPV6_METHOD_TUNNEL6TO4: goto error_send;
case EFL_NET_CONTROL_ACCESS_POINT_IPV6_METHOD_OFF:
_append_dict_entry(array, "Method", "s", "off");
break;
@@ -623,6 +621,8 @@ _efl_net_control_access_point_configuration_ipv6_set(Eo *o, Efl_Net_Control_Acce
_append_dict_entry(array, "Method", "s", "auto");
_append_dict_entry(array, "Privacy", "s", "preferred");
break;
+ default:
+ break;
}
eldbus_message_iter_container_close(var, array);
@@ -640,7 +640,7 @@ _efl_net_control_access_point_configuration_ipv6_set(Eo *o, Efl_Net_Control_Acce
}
EOLIAN static void
-_efl_net_control_access_point_configuration_ipv6_get(Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd, Efl_Net_Control_Access_Point_Ipv6_Method *method, const char **address, uint8_t *prefix_length, const char **netmask, const char **gateway)
+_efl_net_control_access_point_configuration_ipv6_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd, Efl_Net_Control_Access_Point_Ipv6_Method *method, const char **address, uint8_t *prefix_length, const char **netmask, const char **gateway)
{
if (method) *method = pd->configured.ipv6.method;
if (address) *address = pd->configured.ipv6.address;
@@ -676,7 +676,6 @@ _efl_net_control_access_point_configuration_proxy_set(Eo *o, Efl_Net_Control_Acc
switch (method)
{
- case EFL_NET_CONTROL_ACCESS_POINT_PROXY_METHOD_UNSET: goto error_send;
case EFL_NET_CONTROL_ACCESS_POINT_PROXY_METHOD_OFF:
_append_dict_entry(array, "Method", "s", "direct");
break;
@@ -692,6 +691,8 @@ _efl_net_control_access_point_configuration_proxy_set(Eo *o, Efl_Net_Control_Acc
if (excludes)
_append_dict_entry_string_array(array, "Excludes", excludes);
break;
+ default:
+ break;
}
eldbus_message_iter_container_close(var, array);
@@ -713,7 +714,7 @@ _efl_net_control_access_point_configuration_proxy_set(Eo *o, Efl_Net_Control_Acc
}
EOLIAN static void
-_efl_net_control_access_point_configuration_proxy_get(Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd, Efl_Net_Control_Access_Point_Proxy_Method *method, const char **url, Eina_Iterator **servers, Eina_Iterator **excludes)
+_efl_net_control_access_point_configuration_proxy_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd, Efl_Net_Control_Access_Point_Proxy_Method *method, const char **url, Eina_Iterator **servers, Eina_Iterator **excludes)
{
if (method) *method = pd->configured.proxy.method;
if (url) *url = pd->configured.proxy.url;
@@ -1617,7 +1618,7 @@ _efl_net_control_access_point_property_changed(void *data, const Eldbus_Message
}
Efl_Net_Control_Access_Point *
-efl_net_connman_access_point_new(Efl_Net_Control *ctl, const char *path, Eldbus_Message_Iter *properties, unsigned int priority)
+efl_net_connman_access_point_new(Efl_Net_Control_Manager *ctl, const char *path, Eldbus_Message_Iter *properties, unsigned int priority)
{
Eo *o;
Efl_Net_Control_Access_Point_Data *pd;
@@ -1675,7 +1676,7 @@ efl_net_connman_access_point_path_get(Efl_Net_Control_Access_Point *o)
}
void
-efl_net_connman_access_point_update(Efl_Net_Control *o, Eldbus_Message_Iter *properties, unsigned int priority)
+efl_net_connman_access_point_update(Efl_Net_Control_Manager *o, Eldbus_Message_Iter *properties, unsigned int priority)
{
Eldbus_Message_Iter *entry;
Efl_Net_Control_Access_Point_Data *pd = efl_data_scope_get(o, MY_CLASS);
diff --git a/src/lib/ecore_con/efl_net_control_access_point-none.c b/src/lib/ecore_con/efl_net_control_access_point-none.c
index 26353f4f5f..a32784d2b5 100644
--- a/src/lib/ecore_con/efl_net_control_access_point-none.c
+++ b/src/lib/ecore_con/efl_net_control_access_point-none.c
@@ -18,19 +18,19 @@ _efl_net_control_access_point_efl_object_destructor(Eo *obj, Efl_Net_Control_Acc
}
EOLIAN static Efl_Net_Control_Access_Point_State
-_efl_net_control_access_point_state_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+_efl_net_control_access_point_state_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
{
return 0;
}
EOLIAN static Efl_Net_Control_Access_Point_Error
-_efl_net_control_access_point_error_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+_efl_net_control_access_point_error_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
{
return 0;
}
EOLIAN static const char *
-_efl_net_control_access_point_name_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+_efl_net_control_access_point_ssid_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
{
return NULL;
}
@@ -41,25 +41,25 @@ _efl_net_control_access_point_priority_set(Eo *obj EINA_UNUSED, Efl_Net_Control_
}
EOLIAN static unsigned int
-_efl_net_control_access_point_priority_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+_efl_net_control_access_point_priority_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
{
return 0;
}
EOLIAN static Efl_Net_Control_Technology *
-_efl_net_control_access_point_technology_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+_efl_net_control_access_point_technology_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
{
return NULL;
}
EOLIAN static uint8_t
-_efl_net_control_access_point_strength_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+_efl_net_control_access_point_strength_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
{
return 0;
}
EOLIAN static Eina_Bool
-_efl_net_control_access_point_roaming_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+_efl_net_control_access_point_roaming_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
{
return EINA_FALSE;
}
@@ -70,59 +70,59 @@ _efl_net_control_access_point_auto_connect_set(Eo *obj EINA_UNUSED, Efl_Net_Cont
}
EOLIAN static Eina_Bool
-_efl_net_control_access_point_auto_connect_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+_efl_net_control_access_point_auto_connect_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
{
return EINA_FALSE;
}
EOLIAN static Eina_Bool
-_efl_net_control_access_point_remembered_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+_efl_net_control_access_point_remembered_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
{
return EINA_FALSE;
}
EOLIAN static Eina_Bool
-_efl_net_control_access_point_immutable_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+_efl_net_control_access_point_immutable_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
{
return EINA_FALSE;
}
EOLIAN static Efl_Net_Control_Access_Point_Security
-_efl_net_control_access_point_security_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+_efl_net_control_access_point_security_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
{
return 0;
}
EOLIAN static Eina_Iterator *
-_efl_net_control_access_point_name_servers_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+_efl_net_control_access_point_name_servers_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
{
return NULL;
}
EOLIAN static Eina_Iterator *
-_efl_net_control_access_point_time_servers_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+_efl_net_control_access_point_time_servers_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
{
return NULL;
}
EOLIAN static Eina_Iterator *
-_efl_net_control_access_point_domains_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+_efl_net_control_access_point_domains_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
{
return NULL;
}
EOLIAN static void
-_efl_net_control_access_point_ipv4_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED, Efl_Net_Control_Access_Point_Ipv4_Method *method EINA_UNUSED, const char **address EINA_UNUSED, const char **netmask EINA_UNUSED, const char **gateway EINA_UNUSED)
+_efl_net_control_access_point_ipv4_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED, Efl_Net_Control_Access_Point_Ipv4_Method *method EINA_UNUSED, const char **address EINA_UNUSED, const char **netmask EINA_UNUSED, const char **gateway EINA_UNUSED)
{
}
EOLIAN static void
-_efl_net_control_access_point_ipv6_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED, Efl_Net_Control_Access_Point_Ipv6_Method *method EINA_UNUSED, const char **address EINA_UNUSED, uint8_t *prefix_length EINA_UNUSED, const char **netmask EINA_UNUSED, const char **gateway EINA_UNUSED)
+_efl_net_control_access_point_ipv6_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED, Efl_Net_Control_Access_Point_Ipv6_Method *method EINA_UNUSED, const char **address EINA_UNUSED, uint8_t *prefix_length EINA_UNUSED, const char **netmask EINA_UNUSED, const char **gateway EINA_UNUSED)
{
}
EOLIAN static void
-_efl_net_control_access_point_proxy_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED, Efl_Net_Control_Access_Point_Proxy_Method *method EINA_UNUSED, const char **url EINA_UNUSED, Eina_Iterator **servers EINA_UNUSED, Eina_Iterator **excludes EINA_UNUSED)
+_efl_net_control_access_point_proxy_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED, Efl_Net_Control_Access_Point_Proxy_Method *method EINA_UNUSED, const char **url EINA_UNUSED, Eina_Iterator **servers EINA_UNUSED, Eina_Iterator **excludes EINA_UNUSED)
{
}
@@ -132,7 +132,7 @@ _efl_net_control_access_point_configuration_name_servers_set(Eo *obj EINA_UNUSED
}
EOLIAN static Eina_Iterator *
-_efl_net_control_access_point_configuration_name_servers_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+_efl_net_control_access_point_configuration_name_servers_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
{
return NULL;
}
@@ -143,7 +143,7 @@ _efl_net_control_access_point_configuration_time_servers_set(Eo *obj EINA_UNUSED
}
EOLIAN static Eina_Iterator *
-_efl_net_control_access_point_configuration_time_servers_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+_efl_net_control_access_point_configuration_time_servers_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
{
return NULL;
}
@@ -154,7 +154,7 @@ _efl_net_control_access_point_configuration_domains_set(Eo *obj EINA_UNUSED, Efl
}
EOLIAN static Eina_Iterator *
-_efl_net_control_access_point_configuration_domains_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+_efl_net_control_access_point_configuration_domains_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
{
return NULL;
}
@@ -165,7 +165,7 @@ _efl_net_control_access_point_configuration_ipv4_set(Eo *obj EINA_UNUSED, Efl_Ne
}
EOLIAN static void
-_efl_net_control_access_point_configuration_ipv4_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED, Efl_Net_Control_Access_Point_Ipv4_Method *method EINA_UNUSED, const char **address EINA_UNUSED, const char **netmask EINA_UNUSED, const char **gateway EINA_UNUSED)
+_efl_net_control_access_point_configuration_ipv4_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED, Efl_Net_Control_Access_Point_Ipv4_Method *method EINA_UNUSED, const char **address EINA_UNUSED, const char **netmask EINA_UNUSED, const char **gateway EINA_UNUSED)
{
}
@@ -175,7 +175,7 @@ _efl_net_control_access_point_configuration_ipv6_set(Eo *obj EINA_UNUSED, Efl_Ne
}
EOLIAN static void
-_efl_net_control_access_point_configuration_ipv6_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED, Efl_Net_Control_Access_Point_Ipv6_Method *method EINA_UNUSED, const char **address EINA_UNUSED, uint8_t *prefix_length EINA_UNUSED, const char **netmask EINA_UNUSED, const char **gateway EINA_UNUSED)
+_efl_net_control_access_point_configuration_ipv6_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED, Efl_Net_Control_Access_Point_Ipv6_Method *method EINA_UNUSED, const char **address EINA_UNUSED, uint8_t *prefix_length EINA_UNUSED, const char **netmask EINA_UNUSED, const char **gateway EINA_UNUSED)
{
}
@@ -185,7 +185,7 @@ _efl_net_control_access_point_configuration_proxy_set(Eo *obj EINA_UNUSED, Efl_N
}
EOLIAN static void
-_efl_net_control_access_point_configuration_proxy_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED, Efl_Net_Control_Access_Point_Proxy_Method *method EINA_UNUSED, const char **url EINA_UNUSED, Eina_Iterator **servers EINA_UNUSED, Eina_Iterator **excludes EINA_UNUSED)
+_efl_net_control_access_point_configuration_proxy_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED, Efl_Net_Control_Access_Point_Proxy_Method *method EINA_UNUSED, const char **url EINA_UNUSED, Eina_Iterator **servers EINA_UNUSED, Eina_Iterator **excludes EINA_UNUSED)
{
}
diff --git a/src/lib/ecore_con/efl_net_control_access_point.eo b/src/lib/ecore_con/efl_net_control_access_point.eo
index 948325cab9..ec8cce7a1b 100644
--- a/src/lib/ecore_con/efl_net_control_access_point.eo
+++ b/src/lib/ecore_con/efl_net_control_access_point.eo
@@ -1,4 +1,4 @@
-enum Efl.Net.Control.Access_Point.State {
+enum Efl.Net.Control.Access_Point_State {
[[Provides the access point state.
@since 1.19
@@ -12,7 +12,7 @@ enum Efl.Net.Control.Access_Point.State {
failure, [[The connection attempt failed, @Efl.Net.Control.Access_Point.error will provide more details]]
}
-enum Efl.Net.Control.Access_Point.Error {
+enum Efl.Net.Control.Access_Point_Error {
[[The reason for the connection error.
@since 1.19
@@ -25,7 +25,7 @@ enum Efl.Net.Control.Access_Point.Error {
login_failed, [[Login or authentication information was incorrect, agent_request_input event may be emitted.]]
}
-enum Efl.Net.Control.Access_Point.Security {
+enum Efl.Net.Control.Access_Point_Security {
[[Bitwise-able securities supported by an access point.
@since 1.19
@@ -37,7 +37,7 @@ enum Efl.Net.Control.Access_Point.Security {
ieee802_1x = (1 << 3), [[IEEE 802.1X]]
}
-enum Efl.Net.Control.Access_Point.Ipv4_Method {
+enum Efl.Net.Control.Access_Point_Ipv4_Method {
[[The method used to configure IPv4
@since 1.19
@@ -48,7 +48,7 @@ enum Efl.Net.Control.Access_Point.Ipv4_Method {
unset, [[Only to be used with @Efl.Net.Control.Access_Point.configuration_ipv4]]
}
-enum Efl.Net.Control.Access_Point.Ipv6_Method {
+enum Efl.Net.Control.Access_Point_Ipv6_Method {
[[The method used to configure IPv6
@since 1.19
@@ -63,7 +63,7 @@ enum Efl.Net.Control.Access_Point.Ipv6_Method {
unset, [[Only to be used with @Efl.Net.Control.Access_Point.configuration_ipv6]]
}
-enum Efl.Net.Control.Access_Point.Proxy_Method {
+enum Efl.Net.Control.Access_Point_Proxy_Method {
[[The method used to configure Proxies.
@since 1.19
@@ -74,10 +74,10 @@ enum Efl.Net.Control.Access_Point.Proxy_Method {
unset, [[Only to be used with @Efl.Net.Control.Access_Point.configuration_proxy.]]
}
-class Efl.Net.Control.Access_Point (Efl.Loop.Consumer) {
+class Efl.Net.Control.Access_Point (Efl.Loop_Consumer) {
[[An access point for network connectivity.
- The @Efl.Net.Control is composed of multiple technologies, each
+ The @Efl.Net.Control.Manager is composed of multiple technologies, each
create access points to allow configuration and connection.
An application requiring only a network connection can just
@@ -87,7 +87,7 @@ class Efl.Net.Control.Access_Point (Efl.Loop.Consumer) {
]]
events {
- changed; [[Called when some properties were changed.]]
+ changed: void; [[Called when some properties were changed.]]
}
methods {
@@ -108,7 +108,7 @@ class Efl.Net.Control.Access_Point (Efl.Loop.Consumer) {
EINPROGRESS (the connection was already ongoing) and
EALREADY (the connection was already established).
]]
- return: ptr(Eina.Future) @owned; [[Future for asynchronous connect]] /* NOTE: This should be future<void> */
+ return: future<void> @owned; [[Future for asynchronous connect]]
}
disconnect {
@@ -141,7 +141,7 @@ class Efl.Net.Control.Access_Point (Efl.Loop.Consumer) {
]]
get { }
values {
- state: Efl.Net.Control.Access_Point.State; [[Access point state]]
+ state: Efl.Net.Control.Access_Point_State; [[Access point state]]
}
}
@@ -149,11 +149,11 @@ class Efl.Net.Control.Access_Point (Efl.Loop.Consumer) {
[[If the access point is in error state, this states the error.]]
get { }
values {
- error: Efl.Net.Control.Access_Point.Error; [[Access point error]]
+ error: Efl.Net.Control.Access_Point_Error; [[Access point error]]
}
}
- @property name {
+ @property ssid {
[[The user-friendly access point name.
For hidden WiFi networks, this is empty.
@@ -252,7 +252,7 @@ class Efl.Net.Control.Access_Point (Efl.Loop.Consumer) {
[[Security options such as WEP, WPS, PSK or none (open).]]
get { }
values {
- security: Efl.Net.Control.Access_Point.Security; [[Bitwise OR of security supported by this access point]]
+ security: Efl.Net.Control.Access_Point_Security; [[Bitwise OR of security supported by this access point]]
}
}
@@ -308,7 +308,7 @@ class Efl.Net.Control.Access_Point (Efl.Loop.Consumer) {
]]
get { }
values {
- method: Efl.Net.Control.Access_Point.Ipv4_Method; [[IPv4 method]]
+ method: Efl.Net.Control.Access_Point_Ipv4_Method; [[IPv4 method]]
address: string; [[IPv4 address]]
netmask: string; [[IPv4 netmask]]
gateway: string; [[IPv4 gateway]]
@@ -325,7 +325,7 @@ class Efl.Net.Control.Access_Point (Efl.Loop.Consumer) {
]]
get { }
values {
- method: Efl.Net.Control.Access_Point.Ipv6_Method; [[IPv6 method]]
+ method: Efl.Net.Control.Access_Point_Ipv6_Method; [[IPv6 method]]
address: string; [[IPv6 address]]
prefix_length: uint8; [[IPv6 prefix length]]
netmask: string; [[IPv6 netmask]]
@@ -343,10 +343,10 @@ class Efl.Net.Control.Access_Point (Efl.Loop.Consumer) {
]]
get { }
values {
- method: Efl.Net.Control.Access_Point.Proxy_Method; [[Proxy method]]
- url: string; [[If @Efl.Net.Control.Access_Point.Proxy_Method.auto, then states the URL to use for proxy auto-configuration]]
- servers: iterator<string> @owned; [[If @Efl.Net.Control.Access_Point.Proxy_Method.manual, then states the URI with proxy servers to use, like "http://proxy.domain.com:911"]]
- excludes: iterator<string> @owned; [[If @Efl.Net.Control.Access_Point.Proxy_Method.manual, then states the hosts or patterns to exclude from proxy access, such as "localhost", ".domain.com", or "10.0.0.0..."]]
+ method: Efl.Net.Control.Access_Point_Proxy_Method; [[Proxy method]]
+ url: string; [[If @Efl.Net.Control.Access_Point_Proxy_Method.auto, then states the URL to use for proxy auto-configuration]]
+ servers: iterator<string> @owned; [[If @Efl.Net.Control.Access_Point_Proxy_Method.manual, then states the URI with proxy servers to use, like "http://proxy.domain.com:911"]]
+ excludes: iterator<string> @owned; [[If @Efl.Net.Control.Access_Point_Proxy_Method.manual, then states the hosts or patterns to exclude from proxy access, such as "localhost", ".domain.com", or "10.0.0.0..."]]
}
}
@@ -410,7 +410,7 @@ class Efl.Net.Control.Access_Point (Efl.Loop.Consumer) {
set { }
get { }
values {
- method: Efl.Net.Control.Access_Point.Ipv4_Method; [[IPv4 method]]
+ method: Efl.Net.Control.Access_Point_Ipv4_Method; [[IPv4 method]]
address: string; [[IPv4 address]]
netmask: string; [[IPv4 netmask]]
gateway: string; [[IPv4 gateway]]
@@ -429,7 +429,7 @@ class Efl.Net.Control.Access_Point (Efl.Loop.Consumer) {
set { }
get { }
values {
- method: Efl.Net.Control.Access_Point.Ipv6_Method; [[IPv6 method]]
+ method: Efl.Net.Control.Access_Point_Ipv6_Method; [[IPv6 method]]
address: string; [[IPv6 address]]
prefix_length: uint8; [[IPv6 prefix length]]
netmask: string; [[IPv6 netmask]]
@@ -449,10 +449,10 @@ class Efl.Net.Control.Access_Point (Efl.Loop.Consumer) {
set { }
get { }
values {
- method: Efl.Net.Control.Access_Point.Proxy_Method; [[Proxy method]]
- url: string; [[If @Efl.Net.Control.Access_Point.Proxy_Method.auto, then states the URL to use for proxy auto-configuration]]
- servers: iterator<string> @owned; [[If @Efl.Net.Control.Access_Point.Proxy_Method.manual, then states the URI with proxy servers to use, like "http://proxy.domain.com:911"]]
- excludes: iterator<string> @owned; [[If @Efl.Net.Control.Access_Point.Proxy_Method.manual, then states the hosts or patterns to exclude from proxy access, such as "localhost", ".domain.com", or "10.0.0.0..."]]
+ method: Efl.Net.Control.Access_Point_Proxy_Method; [[Proxy method]]
+ url: string; [[If @Efl.Net.Control.Access_Point_Proxy_Method.auto, then states the URL to use for proxy auto-configuration]]
+ servers: iterator<string> @owned; [[If @Efl.Net.Control.Access_Point_Proxy_Method.manual, then states the URI with proxy servers to use, like "http://proxy.domain.com:911"]]
+ excludes: iterator<string> @owned; [[If @Efl.Net.Control.Access_Point_Proxy_Method.manual, then states the hosts or patterns to exclude from proxy access, such as "localhost", ".domain.com", or "10.0.0.0..."]]
}
}
}
diff --git a/src/lib/ecore_con/efl_net_control.eo b/src/lib/ecore_con/efl_net_control_manager.eo
index ad500615cd..3250c4be32 100644
--- a/src/lib/ecore_con/efl_net_control.eo
+++ b/src/lib/ecore_con/efl_net_control_manager.eo
@@ -5,7 +5,7 @@ import efl_net_control_technology;
enum Efl.Net.Control.State {
[[Provides the global network connectivity state.
- For more details, use @Efl.Net.Control access points and
+ For more details, use @Efl.Net.Control.Manager access points and
their property state.
@since 1.19
@@ -15,7 +15,7 @@ enum Efl.Net.Control.State {
online, [[At least one access point is connected and the internet has been verified]]
}
-enum Efl.Net.Control.Agent_Request_Input.Field {
+enum Efl.Net.Control.Agent_Request_Input_Field {
[[Bitwise-able fields requested to the agent.
@since 1.19
@@ -27,7 +27,7 @@ enum Efl.Net.Control.Agent_Request_Input.Field {
wps = (1 << 4), [[Use WPS authentication. If passphrase is present, this is an alternative to that.]]
}
-struct Efl.Net.Control.Agent_Request_Input.Information {
+struct Efl.Net.Control.Agent_Request_Input_Information {
[[Name-value information pair provided to the agent.
@since 1.19
@@ -42,9 +42,9 @@ struct Efl.Net.Control.Agent_Request_Input {
@since 1.19
]]
access_point: Efl.Net.Control.Access_Point; [[The access point which triggered this request.]]
- fields: Efl.Net.Control.Agent_Request_Input.Field; [[Bitwise OR of fields present in this request.]]
+ fields: Efl.Net.Control.Agent_Request_Input_Field; [[Bitwise OR of fields present in this request.]]
passphrase_type: string; [[Extra detail for the passphrase field, such as wep, psk, response (IEEE802.X GTC/OTP), string...]]
- informational: list<ptr(Efl.Net.Control.Agent_Request_Input.Information)>; [[Such as the previous passphrase, VPN host]]
+ informational: list<ptr(Efl.Net.Control.Agent_Request_Input_Information)>; [[Such as the previous passphrase, VPN host]]
}
struct Efl.Net.Control.Agent_Error {
@@ -65,7 +65,7 @@ struct Efl.Net.Control.Agent_Browser_Url {
url: string; [[The URL to point the browser at.]]
}
-class Efl.Net.Control (Efl.Loop.Consumer) {
+class Efl.Net.Control.Manager (Efl.Loop_Consumer) {
[[Controls network connectivity.
This class and its child objects are only useful to implement
@@ -110,13 +110,13 @@ class Efl.Net.Control (Efl.Loop.Consumer) {
events {
access_point,add: Efl.Net.Control.Access_Point; [[The given access point has been added]]
access_point,del: Efl.Net.Control.Access_Point; [[The given access point will be deleted]]
- access_points,changed; [[Access points were added, deleted or reordered.]]
+ access_points,changed: void; [[Access points were added, deleted or reordered.]]
technology,add: Efl.Net.Control.Technology; [[The given technology has been added]]
technology,del: Efl.Net.Control.Technology; [[The given technology will be deleted]]
- radios_offline,changed; [[Property @.radios_offline changed]]
- state,changed; [[Property @.state changed]]
+ radios_offline,changed: void; [[Property @.radios_offline changed]]
+ state,changed: void; [[Property @.state changed]]
- agent_released; [[Notifies we're not the agent anymore]]
+ agent_released: void; [[Notifies we're not the agent anymore]]
agent_error: Efl.Net.Control.Agent_Error; [[Requires the error to be reported to the user]]
agent_browser_url: Efl.Net.Control.Agent_Browser_Url; [[Requires the user to visit a web page]]
agent_request_input: Efl.Net.Control.Agent_Request_Input; [[Requires the user to enter information in order to proceed, such as hidden SSID, passphrase, etc. After the user enters the information, reply by calling @.agent_reply]]
@@ -208,11 +208,11 @@ class Efl.Net.Control (Efl.Loop.Consumer) {
agent_reply {
[[If event "agent_request_input" was emitted, this will reply with the requested data]]
params {
- name: string @nullable; [[If @Efl.Net.Control.Agent_Request_Input.Field.name was present, this should contain the network name or the 'ssid' parameter should be used.]]
- @cref ssid: Eina.Slice @nullable; [[If @Efl.Net.Control.Agent_Request_Input.Field.ssid was present, this should contain the network SSID or the 'name' parameter should be used.]]
- username: string @nullable; [[If @Efl.Net.Control.Agent_Request_Input.Field.username was present, this should contain the identity or username]]
- passphrase: string @nullable; [[If @Efl.Net.Control.Agent_Request_Input.Field.passphrase was present, this should contain the password or passphrase, more details on how it should be interpreted was given in Efl.Net.Control.Agent_Request_Input.passphrase_type.]]
- wps: string @nullable; [[If @Efl.Net.Control.Agent_Request_Input.Field.wps was present, this should contain the WPS PIN or an empty string "" to use the WPS push button instead.]]
+ name: string @nullable; [[If @Efl.Net.Control.Agent_Request_Input_Field.name was present, this should contain the network name or the 'ssid' parameter should be used.]]
+ @cref ssid: Eina.Slice @nullable; [[If @Efl.Net.Control.Agent_Request_Input_Field.ssid was present, this should contain the network SSID or the 'name' parameter should be used.]]
+ username: string @nullable; [[If @Efl.Net.Control.Agent_Request_Input_Field.username was present, this should contain the identity or username]]
+ passphrase: string @nullable; [[If @Efl.Net.Control.Agent_Request_Input_Field.passphrase was present, this should contain the password or passphrase, more details on how it should be interpreted was given in Efl.Net.Control.Agent_Request_Input.passphrase_type.]]
+ wps: string @nullable; [[If @Efl.Net.Control.Agent_Request_Input_Field.wps was present, this should contain the WPS PIN or an empty string "" to use the WPS push button instead.]]
}
}
}
diff --git a/src/lib/ecore_con/efl_net_control_technology-connman.c b/src/lib/ecore_con/efl_net_control_technology-connman.c
index 704d6afb49..5dfb51f961 100644
--- a/src/lib/ecore_con/efl_net_control_technology-connman.c
+++ b/src/lib/ecore_con/efl_net_control_technology-connman.c
@@ -301,7 +301,7 @@ _efl_net_control_technology_powered_set(Eo *o, Efl_Net_Control_Technology_Data *
}
EOLIAN static Eina_Bool
-_efl_net_control_technology_powered_get(Eo *o EINA_UNUSED, Efl_Net_Control_Technology_Data *pd)
+_efl_net_control_technology_powered_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Technology_Data *pd)
{
return pd->powered;
}
@@ -319,7 +319,7 @@ _efl_net_control_technology_tethering_set(Eo *o, Efl_Net_Control_Technology_Data
}
EOLIAN static void
-_efl_net_control_technology_tethering_get(Eo *o EINA_UNUSED, Efl_Net_Control_Technology_Data *pd, Eina_Bool *enabled, const char **identifier, const char **passphrase)
+_efl_net_control_technology_tethering_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Technology_Data *pd, Eina_Bool *enabled, const char **identifier, const char **passphrase)
{
if (enabled) *enabled = pd->tethering.enabled;
if (identifier) *identifier = pd->tethering.identifier;
@@ -327,19 +327,19 @@ _efl_net_control_technology_tethering_get(Eo *o EINA_UNUSED, Efl_Net_Control_Tec
}
EOLIAN static Eina_Bool
-_efl_net_control_technology_connected_get(Eo *o EINA_UNUSED, Efl_Net_Control_Technology_Data *pd)
+_efl_net_control_technology_connected_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Technology_Data *pd)
{
return pd->connected;
}
EOLIAN static const char *
-_efl_net_control_technology_name_get(Eo *o EINA_UNUSED, Efl_Net_Control_Technology_Data *pd)
+_efl_net_control_technology_efl_object_name_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Technology_Data *pd)
{
return pd->name;
}
EOLIAN static Efl_Net_Control_Technology_Type
-_efl_net_control_technology_type_get(Eo *o EINA_UNUSED, Efl_Net_Control_Technology_Data *pd)
+_efl_net_control_technology_type_get(const Eo *o EINA_UNUSED, Efl_Net_Control_Technology_Data *pd)
{
return pd->type;
}
@@ -429,7 +429,7 @@ efl_net_connman_technology_path_get(Efl_Net_Control_Technology *o)
}
Efl_Net_Control_Technology *
-efl_net_connman_technology_new(Efl_Net_Control *ctl, const char *path, Eldbus_Message_Iter *itr)
+efl_net_connman_technology_new(Efl_Net_Control_Manager *ctl, const char *path, Eldbus_Message_Iter *itr)
{
Eo *o;
Efl_Net_Control_Technology_Data *pd;
diff --git a/src/lib/ecore_con/efl_net_control_technology-none.c b/src/lib/ecore_con/efl_net_control_technology-none.c
index e3fe22df7e..3ef3d4bbaa 100644
--- a/src/lib/ecore_con/efl_net_control_technology-none.c
+++ b/src/lib/ecore_con/efl_net_control_technology-none.c
@@ -23,7 +23,7 @@ _efl_net_control_technology_powered_set(Eo *obj EINA_UNUSED, Efl_Net_Control_Tec
}
EOLIAN static Eina_Bool
-_efl_net_control_technology_powered_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Technology_Data *pd EINA_UNUSED)
+_efl_net_control_technology_powered_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Technology_Data *pd EINA_UNUSED)
{
return EINA_FALSE;
}
@@ -34,24 +34,24 @@ _efl_net_control_technology_tethering_set(Eo *obj EINA_UNUSED, Efl_Net_Control_T
}
EOLIAN static void
-_efl_net_control_technology_tethering_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Technology_Data *pd EINA_UNUSED, Eina_Bool *enabled EINA_UNUSED, const char **identifier EINA_UNUSED, const char **passphrase EINA_UNUSED)
+_efl_net_control_technology_tethering_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Technology_Data *pd EINA_UNUSED, Eina_Bool *enabled EINA_UNUSED, const char **identifier EINA_UNUSED, const char **passphrase EINA_UNUSED)
{
}
EOLIAN static Eina_Bool
-_efl_net_control_technology_connected_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Technology_Data *pd EINA_UNUSED)
+_efl_net_control_technology_connected_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Technology_Data *pd EINA_UNUSED)
{
return EINA_FALSE;
}
EOLIAN static const char *
-_efl_net_control_technology_name_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Technology_Data *pd EINA_UNUSED)
+_efl_net_control_technology_efl_object_name_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Technology_Data *pd EINA_UNUSED)
{
return NULL;
}
EOLIAN static Efl_Net_Control_Technology_Type
-_efl_net_control_technology_type_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Technology_Data *pd EINA_UNUSED)
+_efl_net_control_technology_type_get(const Eo *obj EINA_UNUSED, Efl_Net_Control_Technology_Data *pd EINA_UNUSED)
{
return 0;
}
diff --git a/src/lib/ecore_con/efl_net_control_technology.eo b/src/lib/ecore_con/efl_net_control_technology.eo
index f65d702fc4..04e0a4c783 100644
--- a/src/lib/ecore_con/efl_net_control_technology.eo
+++ b/src/lib/ecore_con/efl_net_control_technology.eo
@@ -1,4 +1,4 @@
-enum Efl.Net.Control.Technology.Type {
+enum Efl.Net.Control.Technology_Type {
[[Technology types
@since 1.19
@@ -15,20 +15,20 @@ enum Efl.Net.Control.Technology.Type {
p2p, [[Type: Peer-2-Peer]]
}
-class Efl.Net.Control.Technology (Efl.Loop.Consumer) {
+class Efl.Net.Control.Technology (Efl.Loop_Consumer) {
[[A technology that allows control of network access points.
- The @Efl.Net.Control is composed of multiple technologies, each
+ The @Efl.Net.Control.Manager is composed of multiple technologies, each
can be disabled/enabled with @.powered property.
When powered, the technology will dynamically create and remove
access points in
- @Efl.Net.Control.access_points.
+ @Efl.Net.Control.Manager.access_points.
@since 1.19
]]
events {
- changed; [[Called when some properties were changed.]]
+ changed: void; [[Called when some properties were changed.]]
}
methods {
@@ -65,19 +65,11 @@ class Efl.Net.Control.Technology (Efl.Loop.Consumer) {
}
}
- @property name {
- [[The user-friendly technology name]]
- get { }
- values {
- name: string; [[Technology name]]
- }
- }
-
@property type {
[[The technology type, such as "ethernet" or "wifi"]]
get { }
values {
- type: Efl.Net.Control.Technology.Type; [[Technology type]]
+ type: Efl.Net.Control.Technology_Type; [[Technology type]]
}
}
@@ -86,7 +78,7 @@ class Efl.Net.Control.Technology (Efl.Loop.Consumer) {
The scan will happen asynchronously in the background,
with the results being delivered by events in the
- technology, @Efl.Net.Control or @Efl.Net.Control.Access_Point
+ technology, @Efl.Net.Control.Manager or @Efl.Net.Control.Access_Point
associated with the technology. For example, a scan on
WiFi will add and remove access points.
@@ -96,11 +88,12 @@ class Efl.Net.Control.Technology (Efl.Loop.Consumer) {
state. Otherwise allow the system to perform
passive scans in a timely manner.
]]
- return: ptr(Eina.Future) @owned; [[Future return for finished background scan]]
+ return: future<void> @owned; [[Future return for finished background scan]]
}
}
implements {
Efl.Object.destructor;
+ Efl.Object.name { get; }
}
}
diff --git a/src/lib/ecore_con/efl_net_dialer.eo b/src/lib/ecore_con/efl_net_dialer.eo
index 08cf8434da..b1f2afe80c 100644
--- a/src/lib/ecore_con/efl_net_dialer.eo
+++ b/src/lib/ecore_con/efl_net_dialer.eo
@@ -1,6 +1,6 @@
-var Efl.Net.Dialer.Error.COULDNT_CONNECT: Eina.Error; [[The dialer could not connect to the remote]]
-var Efl.Net.Dialer.Error.COULDNT_RESOLVE_PROXY: Eina.Error; [[The dialer could not resolve the given proxy server]]
-var Efl.Net.Dialer.Error.PROXY_AUTHENTICATION_FAILED: Eina.Error; [[The dialer failed to authenticate against the proxy server]]
+var Efl.Net.Dialer_Error.COULDNT_CONNECT: Eina.Error; [[The dialer could not connect to the remote]]
+var Efl.Net.Dialer_Error.COULDNT_RESOLVE_PROXY: Eina.Error; [[The dialer could not resolve the given proxy server]]
+var Efl.Net.Dialer_Error.PROXY_AUTHENTICATION_FAILED: Eina.Error; [[The dialer failed to authenticate against the proxy server]]
interface Efl.Net.Dialer (Efl.Net.Socket) {
[[Creates a client socket to reach a remote peer.
@@ -111,6 +111,7 @@ interface Efl.Net.Dialer (Efl.Net.Socket) {
}
events {
+ /* FIXME: Might be NULL, but @nullable does not work on event types */
resolved: string; [[Notifies @.address_dial was resolved to
@Efl.Net.Socket.address_remote.
@@ -126,6 +127,6 @@ interface Efl.Net.Dialer (Efl.Net.Socket) {
error: Eina.Error; [[Some error happened and the socket
stopped working.
]]
- connected; [[Notifies the socket is connected to the remote peer.]]
+ connected: void; [[Notifies the socket is connected to the remote peer.]]
}
}
diff --git a/src/lib/ecore_con/efl_net_dialer_http.c b/src/lib/ecore_con/efl_net_dialer_http.c
index 9feb2c5338..f1f18a0c7a 100644
--- a/src/lib/ecore_con/efl_net_dialer_http.c
+++ b/src/lib/ecore_con/efl_net_dialer_http.c
@@ -218,7 +218,7 @@ typedef struct
Eina_Bool connected;
Eina_Bool closed;
Eina_Bool close_on_exec;
- Eina_Bool close_on_destructor;
+ Eina_Bool close_on_invalidate;
Eina_Bool pending_eos;
Eina_Bool eos;
Eina_Bool can_read;
@@ -1129,7 +1129,7 @@ _efl_net_dialer_http_efl_object_constructor(Eo *o, Efl_Net_Dialer_Http_Data *pd)
}
EOLIAN static void
-_efl_net_dialer_http_efl_object_destructor(Eo *o, Efl_Net_Dialer_Http_Data *pd)
+_efl_net_dialer_http_efl_object_invalidate(Eo *o, Efl_Net_Dialer_Http_Data *pd)
{
if (pd->libproxy_thread)
{
@@ -1149,7 +1149,7 @@ _efl_net_dialer_http_efl_object_destructor(Eo *o, Efl_Net_Dialer_Http_Data *pd)
efl_io_closer_close(o);
efl_event_thaw(o);
}
- else if (efl_io_closer_close_on_destructor_get(o) &&
+ else if (efl_io_closer_close_on_invalidate_get(o) &&
(!efl_io_closer_closed_get(o)))
{
efl_event_freeze(o);
@@ -1157,6 +1157,12 @@ _efl_net_dialer_http_efl_object_destructor(Eo *o, Efl_Net_Dialer_Http_Data *pd)
efl_event_thaw(o);
}
+ efl_invalidate(efl_super(o, MY_CLASS));
+}
+
+EOLIAN static void
+_efl_net_dialer_http_efl_object_destructor(Eo *o, Efl_Net_Dialer_Http_Data *pd)
+{
efl_net_dialer_http_response_headers_clear(o);
if (pd->easy)
@@ -1220,10 +1226,10 @@ typedef struct _Efl_Net_Dialer_Http_Libproxy_Context {
} Efl_Net_Dialer_Http_Libproxy_Context;
static void
-_efl_net_dialer_http_libproxy_run(void *data, Ecore_Thread *thread EINA_UNUSED)
+_efl_net_dialer_http_libproxy_run(void *data, Ecore_Thread *thread)
{
Efl_Net_Dialer_Http_Libproxy_Context *ctx = data;
- char **proxies = ecore_con_libproxy_proxies_get(ctx->url);
+ char **proxies = ecore_con_libproxy_proxies_get(ctx->url, thread);
char **itr;
if (!proxies) return;
@@ -1442,7 +1448,7 @@ _efl_net_dialer_http_efl_net_dialer_address_dial_set(Eo *o, Efl_Net_Dialer_Http_
}
EOLIAN static const char *
-_efl_net_dialer_http_efl_net_dialer_address_dial_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
+_efl_net_dialer_http_efl_net_dialer_address_dial_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
{
return pd->address_dial;
}
@@ -1458,7 +1464,7 @@ _efl_net_dialer_http_efl_net_dialer_connected_set(Eo *o, Efl_Net_Dialer_Http_Dat
}
EOLIAN static Eina_Bool
-_efl_net_dialer_http_efl_net_dialer_connected_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
+_efl_net_dialer_http_efl_net_dialer_connected_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
{
return pd->connected;
}
@@ -1477,7 +1483,7 @@ _efl_net_dialer_http_efl_net_dialer_proxy_set(Eo *o EINA_UNUSED, Efl_Net_Dialer_
}
EOLIAN static const char *
-_efl_net_dialer_http_efl_net_dialer_proxy_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
+_efl_net_dialer_http_efl_net_dialer_proxy_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
{
return pd->proxy;
}
@@ -1497,7 +1503,7 @@ _efl_net_dialer_http_efl_net_dialer_timeout_dial_set(Eo *o, Efl_Net_Dialer_Http_
}
EOLIAN static double
-_efl_net_dialer_http_efl_net_dialer_timeout_dial_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
+_efl_net_dialer_http_efl_net_dialer_timeout_dial_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
{
return pd->timeout_dial;
}
@@ -1509,7 +1515,7 @@ _efl_net_dialer_http_efl_net_socket_address_local_set(Eo *o EINA_UNUSED, Efl_Net
}
EOLIAN static const char *
-_efl_net_dialer_http_efl_net_socket_address_local_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
+_efl_net_dialer_http_efl_net_socket_address_local_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
{
return pd->address_local;
}
@@ -1522,7 +1528,7 @@ _efl_net_dialer_http_efl_net_socket_address_remote_set(Eo *o, Efl_Net_Dialer_Htt
}
EOLIAN static const char *
-_efl_net_dialer_http_efl_net_socket_address_remote_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
+_efl_net_dialer_http_efl_net_socket_address_remote_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
{
return pd->address_remote;
}
@@ -1609,7 +1615,7 @@ _efl_net_dialer_http_efl_io_reader_read(Eo *o, Efl_Net_Dialer_Http_Data *pd, Ein
}
EOLIAN static Eina_Bool
-_efl_net_dialer_http_efl_io_reader_can_read_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
+_efl_net_dialer_http_efl_io_reader_can_read_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
{
return pd->can_read;
}
@@ -1624,7 +1630,7 @@ _efl_net_dialer_http_efl_io_reader_can_read_set(Eo *o, Efl_Net_Dialer_Http_Data
}
EOLIAN static Eina_Bool
-_efl_net_dialer_http_efl_io_reader_eos_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
+_efl_net_dialer_http_efl_io_reader_eos_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
{
return pd->eos;
}
@@ -1697,7 +1703,7 @@ _efl_net_dialer_http_efl_io_writer_write(Eo *o, Efl_Net_Dialer_Http_Data *pd, Ei
}
EOLIAN static Eina_Bool
-_efl_net_dialer_http_efl_io_writer_can_write_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
+_efl_net_dialer_http_efl_io_writer_can_write_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
{
return pd->can_write;
}
@@ -1769,7 +1775,7 @@ _efl_net_dialer_http_pending_close(Eo *o, const Eina_Value value EINA_UNUSED)
}
EOLIAN static Eina_Bool
-_efl_net_dialer_http_efl_io_closer_closed_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
+_efl_net_dialer_http_efl_io_closer_closed_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
{
return pd->closed || (!!pd->pending_close);
}
@@ -1800,21 +1806,21 @@ _efl_net_dialer_http_efl_io_closer_close_on_exec_set(Eo *o EINA_UNUSED, Efl_Net_
}
EOLIAN static Eina_Bool
-_efl_net_dialer_http_efl_io_closer_close_on_exec_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
+_efl_net_dialer_http_efl_io_closer_close_on_exec_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
{
return pd->close_on_exec;
}
EOLIAN static void
-_efl_net_dialer_http_efl_io_closer_close_on_destructor_set(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd, Eina_Bool close_on_destructor)
+_efl_net_dialer_http_efl_io_closer_close_on_invalidate_set(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd, Eina_Bool close_on_invalidate)
{
- pd->close_on_destructor = close_on_destructor;
+ pd->close_on_invalidate = close_on_invalidate;
}
EOLIAN static Eina_Bool
-_efl_net_dialer_http_efl_io_closer_close_on_destructor_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
+_efl_net_dialer_http_efl_io_closer_close_on_invalidate_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
{
- return pd->close_on_destructor;
+ return pd->close_on_invalidate;
}
EOLIAN static Eina_Error
@@ -1839,7 +1845,7 @@ _efl_net_dialer_http_efl_io_sizer_resize(Eo *o, Efl_Net_Dialer_Http_Data *pd, ui
}
EOLIAN static uint64_t
-_efl_net_dialer_http_efl_io_sizer_size_get(Eo *o, Efl_Net_Dialer_Http_Data *pd)
+_efl_net_dialer_http_efl_io_sizer_size_get(const Eo *o, Efl_Net_Dialer_Http_Data *pd)
{
Efl_Net_Dialer_Http_Primary_Mode pm;
int64_t len;
@@ -1920,7 +1926,7 @@ _efl_net_dialer_http_method_set(Eo *o, Efl_Net_Dialer_Http_Data *pd, const char
}
EOLIAN static const char *
-_efl_net_dialer_http_method_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
+_efl_net_dialer_http_method_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
{
return pd->method;
}
@@ -1933,7 +1939,7 @@ _efl_net_dialer_http_primary_mode_set(Eo *o, Efl_Net_Dialer_Http_Data *pd, Efl_N
}
EOLIAN static Efl_Net_Dialer_Http_Primary_Mode
-_efl_net_dialer_http_primary_mode_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
+_efl_net_dialer_http_primary_mode_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
{
return _efl_net_dialer_http_primary_mode_effective_get(pd);
}
@@ -1952,7 +1958,7 @@ _efl_net_dialer_http_user_agent_set(Eo *o, Efl_Net_Dialer_Http_Data *pd, const c
}
EOLIAN static const char *
-_efl_net_dialer_http_user_agent_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
+_efl_net_dialer_http_user_agent_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
{
return pd->user_agent;
}
@@ -1971,7 +1977,7 @@ _efl_net_dialer_http_http_version_set(Eo *o, Efl_Net_Dialer_Http_Data *pd, Efl_N
}
EOLIAN static Efl_Net_Http_Version
-_efl_net_dialer_http_http_version_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
+_efl_net_dialer_http_http_version_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
{
return pd->version;
}
@@ -2009,7 +2015,7 @@ _efl_net_dialer_http_authentication_set(Eo *o, Efl_Net_Dialer_Http_Data *pd, con
}
EOLIAN static void
-_efl_net_dialer_http_authentication_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd, const char **username, const char **password, Efl_Net_Http_Authentication_Method *method, Eina_Bool *restricted)
+_efl_net_dialer_http_authentication_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd, const char **username, const char **password, Efl_Net_Http_Authentication_Method *method, Eina_Bool *restricted)
{
if (username) *username = pd->authentication.username;
if (password) *password = pd->authentication.password;
@@ -2031,13 +2037,13 @@ _efl_net_dialer_http_allow_redirects_set(Eo *o, Efl_Net_Dialer_Http_Data *pd, Ei
}
EOLIAN static Eina_Bool
-_efl_net_dialer_http_allow_redirects_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
+_efl_net_dialer_http_allow_redirects_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
{
return pd->allow_redirects;
}
EOLIAN static Efl_Net_Http_Status
-_efl_net_dialer_http_response_status_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
+_efl_net_dialer_http_response_status_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
{
return pd->response.status;
}
@@ -2167,7 +2173,7 @@ _efl_net_dialer_http_request_content_length_set(Eo *o, Efl_Net_Dialer_Http_Data
}
EOLIAN static int64_t
-_efl_net_dialer_http_request_content_length_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
+_efl_net_dialer_http_request_content_length_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
{
return pd->request.content_length;
}
@@ -2187,7 +2193,7 @@ _efl_net_dialer_http_response_content_length_set(Eo *o, Efl_Net_Dialer_Http_Data
}
EOLIAN static int64_t
-_efl_net_dialer_http_response_content_length_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
+_efl_net_dialer_http_response_content_length_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
{
return pd->response.content_length;
}
@@ -2199,7 +2205,7 @@ _efl_net_dialer_http_response_content_type_set(Eo *o EINA_UNUSED, Efl_Net_Dialer
}
EOLIAN static const char *
-_efl_net_dialer_http_response_content_type_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
+_efl_net_dialer_http_response_content_type_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
{
return pd->response.content_type;
}
@@ -2233,14 +2239,14 @@ _efl_net_dialer_http_response_headers_clear(Eo *o EINA_UNUSED, Efl_Net_Dialer_Ht
}
EOLIAN static void
-_efl_net_dialer_http_progress_download_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd, uint64_t *now, uint64_t *total)
+_efl_net_dialer_http_progress_download_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd, uint64_t *now, uint64_t *total)
{
if (now) *now = pd->progress.download.now;
if (total) *total = pd->progress.download.total;
}
EOLIAN static void
-_efl_net_dialer_http_progress_upload_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd, uint64_t *now, uint64_t *total)
+_efl_net_dialer_http_progress_upload_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd, uint64_t *now, uint64_t *total)
{
if (now) *now = pd->progress.upload.now;
if (total) *total = pd->progress.upload.total;
@@ -2291,7 +2297,7 @@ _efl_net_dialer_http_cookie_jar_set(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data
}
EOLIAN static const char *
-_efl_net_dialer_http_cookie_jar_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
+_efl_net_dialer_http_cookie_jar_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
{
return pd->cookie_jar;
}
@@ -2319,7 +2325,7 @@ _efl_net_dialer_http_ssl_verify_set(Eo *o, Efl_Net_Dialer_Http_Data *pd, Eina_Bo
}
EOLIAN static void
-_efl_net_dialer_http_ssl_verify_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd, Eina_Bool *peer, Eina_Bool *hostname)
+_efl_net_dialer_http_ssl_verify_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd, Eina_Bool *peer, Eina_Bool *hostname)
{
if (peer) *peer = pd->ssl.verify_peer;
if (hostname) *hostname = pd->ssl.verify_hostname;
@@ -2344,7 +2350,7 @@ _efl_net_dialer_http_ssl_certificate_authority_set(Eo *o EINA_UNUSED, Efl_Net_Di
}
EOLIAN static const char *
-_efl_net_dialer_http_ssl_certificate_authority_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
+_efl_net_dialer_http_ssl_certificate_authority_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
{
return pd->ssl.ca;
}
@@ -2363,7 +2369,7 @@ _efl_net_dialer_http_ssl_certificate_revocation_list_set(Eo *o EINA_UNUSED, Efl_
}
EOLIAN static const char *
-_efl_net_dialer_http_ssl_certificate_revocation_list_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
+_efl_net_dialer_http_ssl_certificate_revocation_list_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
{
return pd->ssl.crl;
}
diff --git a/src/lib/ecore_con/efl_net_dialer_http.eo b/src/lib/ecore_con/efl_net_dialer_http.eo
index 4d18fe52f4..7a3f864338 100644
--- a/src/lib/ecore_con/efl_net_dialer_http.eo
+++ b/src/lib/ecore_con/efl_net_dialer_http.eo
@@ -1,13 +1,13 @@
import efl_net_http_types;
-enum Efl.Net.Dialer.Http.Primary_Mode {
+enum Efl.Net.Dialer_Http_Primary_Mode {
[[Primary HTTP mode]]
auto, [[HTTP auto mode]]
download, [[HTTP download mode]]
upload, [[HTTP upload mode]]
}
-class Efl.Net.Dialer.Http (Efl.Loop.Consumer, Efl.Net.Dialer, Efl.Io.Sizer) {
+class Efl.Net.Dialer_Http (Efl.Loop_Consumer, Efl.Net.Dialer, Efl.Io.Sizer) {
[[HTTP Dialer (Client).
The effective URL in use, if @.allow_redirects is $true will be
@@ -71,20 +71,20 @@ class Efl.Net.Dialer.Http (Efl.Loop.Consumer, Efl.Net.Dialer, Efl.Io.Sizer) {
This property will change the behavior of @Efl.Io.Sizer:
- - If @Efl.Net.Dialer.Http.Primary_Mode.auto, then
- @Efl.Net.Dialer.Http.Primary_Mode.download or
- @Efl.Net.Dialer.Http.Primary_Mode.upload will be
+ - If @Efl.Net.Dialer_Http_Primary_Mode.auto, then
+ @Efl.Net.Dialer_Http_Primary_Mode.download or
+ @Efl.Net.Dialer_Http_Primary_Mode.upload will be
choosen based on the @.method: if "PUT", then it's
upload, otherwise it's download.
- - If @Efl.Net.Dialer.Http.Primary_Mode.upload, applying
+ - If @Efl.Net.Dialer_Http_Primary_Mode.upload, applying
a new size with @Efl.Io.Sizer.resize or
@Efl.Io.Sizer.size.set will specify the
"Content-Length" to upload. If no size is previously
set, then the upload will happen in
"Transfer-encoding: chunked".
- - If @Efl.Net.Dialer.Http.Primary_Mode.download, then
+ - If @Efl.Net.Dialer_Http_Primary_Mode.download, then
@Efl.Io.Sizer.size.get will report the
"Content-Length" provided by the server, if any.
@@ -99,15 +99,15 @@ class Efl.Net.Dialer.Http (Efl.Loop.Consumer, Efl.Net.Dialer, Efl.Io.Sizer) {
[[The effective primary mode.
This will return one of
- @Efl.Net.Dialer.Http.Primary_Mode.download or
- @Efl.Net.Dialer.Http.Primary_Mode.upload. If "auto"
+ @Efl.Net.Dialer_Http_Primary_Mode.download or
+ @Efl.Net.Dialer_Http_Primary_Mode.upload. If "auto"
was set (the default), then it will pick the best
based on the @.method in use.
]]
}
set { }
values {
- primary_mode: Efl.Net.Dialer.Http.Primary_Mode; [[Primary HTTP mode]]
+ primary_mode: Efl.Net.Dialer_Http_Primary_Mode; [[Primary HTTP mode]]
}
}
@@ -388,11 +388,12 @@ class Efl.Net.Dialer.Http (Efl.Loop.Consumer, Efl.Net.Dialer, Efl.Io.Sizer) {
}
events {
- headers,done; [[Notifies all headers were parsed and are available.]]
+ headers,done: void; [[Notifies all headers were parsed and are available.]]
}
implements {
Efl.Object.constructor;
+ Efl.Object.invalidate;
Efl.Object.destructor;
Efl.Net.Dialer.dial;
Efl.Net.Dialer.address_dial { get; set; }
@@ -409,7 +410,7 @@ class Efl.Net.Dialer.Http (Efl.Loop.Consumer, Efl.Net.Dialer, Efl.Io.Sizer) {
Efl.Io.Closer.close;
Efl.Io.Closer.closed { get; }
Efl.Io.Closer.close_on_exec { get; set; }
- Efl.Io.Closer.close_on_destructor { get; set; }
+ Efl.Io.Closer.close_on_invalidate { get; set; }
Efl.Io.Sizer.resize;
Efl.Io.Sizer.size { get; }
}
diff --git a/src/lib/ecore_con/efl_net_dialer_simple.c b/src/lib/ecore_con/efl_net_dialer_simple.c
index 2aca537318..8d25c370e2 100644
--- a/src/lib/ecore_con/efl_net_dialer_simple.c
+++ b/src/lib/ecore_con/efl_net_dialer_simple.c
@@ -48,6 +48,7 @@ static void
_efl_net_dialer_simple_inner_io_connected(void *data, const Efl_Event *event)
{
Eo *o = data;
+
efl_event_callback_call(o, EFL_NET_DIALER_EVENT_CONNECTED, event->info);
}
@@ -87,10 +88,24 @@ _efl_net_dialer_simple_efl_object_finalize(Eo *o, Efl_Net_Dialer_Simple_Data *pd
}
EOLIAN static void
-_efl_net_dialer_simple_efl_object_destructor(Eo *o, Efl_Net_Dialer_Simple_Data *pd)
+_efl_net_dialer_simple_efl_object_invalidate(Eo *o, Efl_Net_Dialer_Simple_Data *pd EINA_UNUSED)
{
Eo *inner_io;
+ inner_io = efl_io_buffered_stream_inner_io_get(o);
+ if (inner_io)
+ {
+ efl_event_callback_array_del(inner_io, _efl_net_dialer_simple_inner_io_cbs(), o);
+ if (efl_parent_get(inner_io) == o)
+ efl_parent_set(inner_io, NULL);
+ }
+
+ efl_invalidate(efl_super(o, EFL_NET_DIALER_SIMPLE_CLASS));
+}
+
+EOLIAN static void
+_efl_net_dialer_simple_efl_object_destructor(Eo *o, Efl_Net_Dialer_Simple_Data *pd)
+{
if (pd->inner_class) pd->inner_class = NULL;
eina_stringshare_replace(&pd->proxy_url, NULL);
@@ -100,14 +115,6 @@ _efl_net_dialer_simple_efl_object_destructor(Eo *o, Efl_Net_Dialer_Simple_Data *
pd->line_delimiter.mem = NULL;
}
- inner_io = efl_io_buffered_stream_inner_io_get(o);
- if (inner_io)
- {
- efl_event_callback_array_del(inner_io, _efl_net_dialer_simple_inner_io_cbs(), o);
- if (efl_parent_get(inner_io) == o)
- efl_parent_set(inner_io, NULL);
- }
-
efl_destructor(efl_super(o, EFL_NET_DIALER_SIMPLE_CLASS));
}
@@ -168,13 +175,13 @@ _efl_net_dialer_simple_efl_net_dialer_dial(Eo *o, Efl_Net_Dialer_Simple_Data *pd
}
EOLIAN static const char *
-_efl_net_dialer_simple_efl_net_dialer_address_dial_get(Eo *o, Efl_Net_Dialer_Simple_Data *pd EINA_UNUSED)
+_efl_net_dialer_simple_efl_net_dialer_address_dial_get(const Eo *o, Efl_Net_Dialer_Simple_Data *pd EINA_UNUSED)
{
return efl_net_dialer_address_dial_get(efl_io_buffered_stream_inner_io_get(o));
}
EOLIAN static Eina_Bool
-_efl_net_dialer_simple_efl_net_dialer_connected_get(Eo *o, Efl_Net_Dialer_Simple_Data *pd EINA_UNUSED)
+_efl_net_dialer_simple_efl_net_dialer_connected_get(const Eo *o, Efl_Net_Dialer_Simple_Data *pd EINA_UNUSED)
{
return efl_net_dialer_connected_get(efl_io_buffered_stream_inner_io_get(o));
}
@@ -194,7 +201,7 @@ _efl_net_dialer_simple_efl_net_dialer_proxy_set(Eo *o, Efl_Net_Dialer_Simple_Dat
}
EOLIAN static const char *
-_efl_net_dialer_simple_efl_net_dialer_proxy_get(Eo *o, Efl_Net_Dialer_Simple_Data *pd)
+_efl_net_dialer_simple_efl_net_dialer_proxy_get(const Eo *o, Efl_Net_Dialer_Simple_Data *pd)
{
Eo *inner_io = efl_io_buffered_stream_inner_io_get(o);
if (!inner_io) return pd->proxy_url;
@@ -216,7 +223,7 @@ _efl_net_dialer_simple_efl_net_dialer_timeout_dial_set(Eo *o, Efl_Net_Dialer_Sim
}
EOLIAN static double
-_efl_net_dialer_simple_efl_net_dialer_timeout_dial_get(Eo *o, Efl_Net_Dialer_Simple_Data *pd)
+_efl_net_dialer_simple_efl_net_dialer_timeout_dial_get(const Eo *o, Efl_Net_Dialer_Simple_Data *pd)
{
Eo *inner_io = efl_io_buffered_stream_inner_io_get(o);
if (!inner_io) return pd->dial_timeout;
@@ -238,7 +245,7 @@ _efl_net_dialer_simple_efl_io_buffered_stream_timeout_inactivity_set(Eo *o, Efl_
}
EOLIAN static double
-_efl_net_dialer_simple_efl_io_buffered_stream_timeout_inactivity_get(Eo *o, Efl_Net_Dialer_Simple_Data *pd)
+_efl_net_dialer_simple_efl_io_buffered_stream_timeout_inactivity_get(const Eo *o, Efl_Net_Dialer_Simple_Data *pd)
{
Eo *inner_io = efl_io_buffered_stream_inner_io_get(o);
if (!inner_io) return pd->timeout_inactivity;
@@ -260,7 +267,7 @@ _efl_net_dialer_simple_efl_io_buffered_stream_max_queue_size_input_set(Eo *o, Ef
}
EOLIAN static size_t
-_efl_net_dialer_simple_efl_io_buffered_stream_max_queue_size_input_get(Eo *o, Efl_Net_Dialer_Simple_Data *pd)
+_efl_net_dialer_simple_efl_io_buffered_stream_max_queue_size_input_get(const Eo *o, Efl_Net_Dialer_Simple_Data *pd)
{
Eo *inner_io = efl_io_buffered_stream_inner_io_get(o);
if (!inner_io) return pd->max_queue_size_input;
@@ -282,7 +289,7 @@ _efl_net_dialer_simple_efl_io_buffered_stream_max_queue_size_output_set(Eo *o, E
}
EOLIAN static size_t
-_efl_net_dialer_simple_efl_io_buffered_stream_max_queue_size_output_get(Eo *o, Efl_Net_Dialer_Simple_Data *pd)
+_efl_net_dialer_simple_efl_io_buffered_stream_max_queue_size_output_get(const Eo *o, Efl_Net_Dialer_Simple_Data *pd)
{
Eo *inner_io = efl_io_buffered_stream_inner_io_get(o);
if (!inner_io) return pd->max_queue_size_output;
@@ -304,7 +311,7 @@ _efl_net_dialer_simple_efl_io_buffered_stream_read_chunk_size_set(Eo *o, Efl_Net
}
EOLIAN static size_t
-_efl_net_dialer_simple_efl_io_buffered_stream_read_chunk_size_get(Eo *o, Efl_Net_Dialer_Simple_Data *pd)
+_efl_net_dialer_simple_efl_io_buffered_stream_read_chunk_size_get(const Eo *o, Efl_Net_Dialer_Simple_Data *pd)
{
Eo *inner_io = efl_io_buffered_stream_inner_io_get(o);
if (!inner_io) return pd->read_chunk_size;
@@ -342,7 +349,7 @@ _efl_net_dialer_simple_efl_io_buffered_stream_line_delimiter_set(Eo *o, Efl_Net_
}
EOLIAN static Eina_Slice
-_efl_net_dialer_simple_efl_io_buffered_stream_line_delimiter_get(Eo *o, Efl_Net_Dialer_Simple_Data *pd)
+_efl_net_dialer_simple_efl_io_buffered_stream_line_delimiter_get(const Eo *o, Efl_Net_Dialer_Simple_Data *pd)
{
Eo *inner_io = efl_io_buffered_stream_inner_io_get(o);
if (!inner_io) return pd->line_delimiter;
@@ -359,7 +366,7 @@ _efl_net_dialer_simple_inner_class_set(Eo *o, Efl_Net_Dialer_Simple_Data *pd, co
}
EOLIAN static const Efl_Class *
-_efl_net_dialer_simple_inner_class_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Simple_Data *pd)
+_efl_net_dialer_simple_inner_class_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Simple_Data *pd)
{
return pd->inner_class;
}
diff --git a/src/lib/ecore_con/efl_net_dialer_simple.eo b/src/lib/ecore_con/efl_net_dialer_simple.eo
index ceeca6c64d..38ec878808 100644
--- a/src/lib/ecore_con/efl_net_dialer_simple.eo
+++ b/src/lib/ecore_con/efl_net_dialer_simple.eo
@@ -1,7 +1,7 @@
-class Efl.Net.Dialer.Simple (Efl.Net.Socket.Simple, Efl.Net.Dialer) {
+class Efl.Net.Dialer_Simple (Efl.Net.Socket_Simple, Efl.Net.Dialer) {
[[Connects to a remote server offering an easy to use, buffered I/O.
- The simple dialer is based on @Efl.Net.Socket.Simple, which
+ The simple dialer is based on @Efl.Net.Socket_Simple, which
encapsulates an actual @Efl.Net.Socket and uses it with an
@Efl.Io.Buffered_Stream. This creates an input @Efl.Io.Queue,
an output @Efl.Io.Queue. Both of these are linked using a receiver
@@ -69,6 +69,7 @@ class Efl.Net.Dialer.Simple (Efl.Net.Socket.Simple, Efl.Net.Dialer) {
implements {
Efl.Object.finalize;
+ Efl.Object.invalidate;
Efl.Object.destructor;
Efl.Io.Buffered_Stream.inner_io { set; }
Efl.Net.Dialer.dial;
diff --git a/src/lib/ecore_con/efl_net_dialer_ssl.c b/src/lib/ecore_con/efl_net_dialer_ssl.c
index 93dabfaebb..58189eea6f 100644
--- a/src/lib/ecore_con/efl_net_dialer_ssl.c
+++ b/src/lib/ecore_con/efl_net_dialer_ssl.c
@@ -63,7 +63,7 @@ _efl_net_dialer_ssl_efl_object_constructor(Eo *o, Efl_Net_Dialer_Ssl_Data *pd)
o = efl_constructor(efl_super(o, MY_CLASS));
if (!o) return NULL;
- pd->sock = efl_add(EFL_NET_DIALER_TCP_CLASS, o);
+ pd->sock = efl_add_ref(EFL_NET_DIALER_TCP_CLASS, o);
EINA_SAFETY_ON_NULL_RETURN_VAL(pd->sock, NULL);
efl_event_callback_array_add(o, _efl_net_dialer_ssl_cbs(), o);
@@ -78,9 +78,8 @@ _efl_net_dialer_ssl_efl_object_finalize(Eo *o, Efl_Net_Dialer_Ssl_Data *pd)
if (efl_net_socket_ssl_adopted_get(o, &a_sock, &a_ctx))
{
- efl_del(pd->sock); /* stub TCP we created */
- pd->sock = a_sock;
- pd->ssl_ctx = a_ctx;
+ efl_replace(&pd->sock, a_sock); /* stub TCP we created */
+ efl_replace(&pd->ssl_ctx, a_ctx);
}
else
{
@@ -94,9 +93,11 @@ _efl_net_dialer_ssl_efl_object_finalize(Eo *o, Efl_Net_Dialer_Ssl_Data *pd)
}
EOLIAN static void
-_efl_net_dialer_ssl_efl_object_destructor(Eo *o, Efl_Net_Dialer_Ssl_Data *pd)
+_efl_net_dialer_ssl_efl_object_invalidate(Eo *o, Efl_Net_Dialer_Ssl_Data *pd)
{
- if (efl_io_closer_close_on_destructor_get(o) &&
+ pd->sock = NULL;
+
+ if (efl_io_closer_close_on_invalidate_get(o) &&
(!efl_io_closer_closed_get(o)))
{
efl_event_freeze(o);
@@ -104,19 +105,10 @@ _efl_net_dialer_ssl_efl_object_destructor(Eo *o, Efl_Net_Dialer_Ssl_Data *pd)
efl_event_thaw(o);
}
- if (pd->sock)
- {
- efl_del(pd->sock);
- pd->sock = NULL;
- }
-
- if (pd->ssl_ctx)
- {
- efl_unref(pd->ssl_ctx);
- pd->ssl_ctx = NULL;
- }
+ efl_replace(&pd->ssl_ctx, NULL);
+ efl_replace(&pd->sock, NULL);
- efl_destructor(efl_super(o, MY_CLASS));
+ efl_invalidate(efl_super(o, MY_CLASS));
}
EOLIAN static void
@@ -126,12 +118,11 @@ _efl_net_dialer_ssl_ssl_context_set(Eo *o, Efl_Net_Dialer_Ssl_Data *pd, Eo *ssl_
EINA_SAFETY_ON_FALSE_RETURN(efl_isa(ssl_ctx, EFL_NET_SSL_CONTEXT_CLASS));
if (pd->ssl_ctx == ssl_ctx) return;
- efl_unref(pd->ssl_ctx);
- pd->ssl_ctx = efl_ref(ssl_ctx);
+ efl_replace(&pd->ssl_ctx, ssl_ctx);
}
EOLIAN static Eo *
-_efl_net_dialer_ssl_ssl_context_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Ssl_Data *pd)
+_efl_net_dialer_ssl_ssl_context_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Ssl_Data *pd)
{
return pd->ssl_ctx;
}
@@ -174,7 +165,7 @@ _efl_net_dialer_ssl_efl_net_dialer_dial(Eo *o, Efl_Net_Dialer_Ssl_Data *pd, cons
}
EOLIAN static const char *
-_efl_net_dialer_ssl_efl_net_dialer_address_dial_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Ssl_Data *pd)
+_efl_net_dialer_ssl_efl_net_dialer_address_dial_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Ssl_Data *pd)
{
return efl_net_dialer_address_dial_get(pd->sock);
}
@@ -186,7 +177,7 @@ _efl_net_dialer_ssl_efl_net_dialer_proxy_set(Eo *o EINA_UNUSED, Efl_Net_Dialer_S
}
EOLIAN static const char *
-_efl_net_dialer_ssl_efl_net_dialer_proxy_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Ssl_Data *pd)
+_efl_net_dialer_ssl_efl_net_dialer_proxy_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Ssl_Data *pd)
{
return efl_net_dialer_proxy_get(pd->sock);
}
@@ -202,7 +193,7 @@ _efl_net_dialer_ssl_efl_net_dialer_timeout_dial_set(Eo *o, Efl_Net_Dialer_Ssl_Da
}
EOLIAN static double
-_efl_net_dialer_ssl_efl_net_dialer_timeout_dial_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Ssl_Data *pd)
+_efl_net_dialer_ssl_efl_net_dialer_timeout_dial_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Ssl_Data *pd)
{
return efl_net_dialer_timeout_dial_get(pd->sock);
}
@@ -218,7 +209,7 @@ _efl_net_dialer_ssl_efl_net_dialer_connected_set(Eo *o, Efl_Net_Dialer_Ssl_Data
}
EOLIAN static Eina_Bool
-_efl_net_dialer_ssl_efl_net_dialer_connected_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Ssl_Data *pd)
+_efl_net_dialer_ssl_efl_net_dialer_connected_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Ssl_Data *pd)
{
return pd->connected;
}
@@ -237,7 +228,7 @@ _efl_net_dialer_ssl_keep_alive_set(Eo *o EINA_UNUSED, Efl_Net_Dialer_Ssl_Data *p
}
EOLIAN static Eina_Bool
-_efl_net_dialer_ssl_keep_alive_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Ssl_Data *pd)
+_efl_net_dialer_ssl_keep_alive_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Ssl_Data *pd)
{
return efl_net_socket_tcp_keep_alive_get(pd->sock);
}
@@ -249,7 +240,7 @@ _efl_net_dialer_ssl_no_delay_set(Eo *o EINA_UNUSED, Efl_Net_Dialer_Ssl_Data *pd,
}
EOLIAN static Eina_Bool
-_efl_net_dialer_ssl_no_delay_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Ssl_Data *pd)
+_efl_net_dialer_ssl_no_delay_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Ssl_Data *pd)
{
return efl_net_socket_tcp_no_delay_get(pd->sock);
}
diff --git a/src/lib/ecore_con/efl_net_dialer_ssl.eo b/src/lib/ecore_con/efl_net_dialer_ssl.eo
index c923f2f790..c732e1c621 100644
--- a/src/lib/ecore_con/efl_net_dialer_ssl.eo
+++ b/src/lib/ecore_con/efl_net_dialer_ssl.eo
@@ -1,7 +1,7 @@
-class Efl.Net.Dialer.Ssl (Efl.Net.Socket.Ssl, Efl.Net.Dialer) {
+class Efl.Net.Dialer_Ssl (Efl.Net.Socket_Ssl, Efl.Net.Dialer) {
[[Connects to a remote SSL server using TCP.
- This creates an internal @Efl.Net.Dialer.Tcp and once connected
+ This creates an internal @Efl.Net.Dialer_Tcp and once connected
it will start the SSL handshake.
If the proxy is NULL (default), then the system proxy will be
@@ -66,8 +66,8 @@ class Efl.Net.Dialer.Ssl (Efl.Net.Socket.Ssl, Efl.Net.Dialer) {
implements {
Efl.Object.constructor;
- Efl.Object.destructor;
Efl.Object.finalize;
+ Efl.Object.invalidate;
Efl.Net.Dialer.dial;
Efl.Net.Dialer.address_dial { get; }
Efl.Net.Dialer.connected { get; set; }
diff --git a/src/lib/ecore_con/efl_net_dialer_tcp.c b/src/lib/ecore_con/efl_net_dialer_tcp.c
index 1caf1acad5..12e24b7238 100644
--- a/src/lib/ecore_con/efl_net_dialer_tcp.c
+++ b/src/lib/ecore_con/efl_net_dialer_tcp.c
@@ -53,9 +53,9 @@ _efl_net_dialer_tcp_efl_object_constructor(Eo *o, Efl_Net_Dialer_Tcp_Data *pd EI
}
EOLIAN static void
-_efl_net_dialer_tcp_efl_object_destructor(Eo *o, Efl_Net_Dialer_Tcp_Data *pd)
+_efl_net_dialer_tcp_efl_object_invalidate(Eo *o, Efl_Net_Dialer_Tcp_Data *pd)
{
- if (efl_io_closer_close_on_destructor_get(o) &&
+ if (efl_io_closer_close_on_invalidate_get(o) &&
(!efl_io_closer_closed_get(o)))
{
efl_event_freeze(o);
@@ -69,6 +69,12 @@ _efl_net_dialer_tcp_efl_object_destructor(Eo *o, Efl_Net_Dialer_Tcp_Data *pd)
pd->connect.thread = NULL;
}
+ efl_invalidate(efl_super(o, MY_CLASS));
+}
+
+EOLIAN static void
+_efl_net_dialer_tcp_efl_object_destructor(Eo *o, Efl_Net_Dialer_Tcp_Data *pd)
+{
efl_destructor(efl_super(o, MY_CLASS));
eina_stringshare_replace(&pd->address_dial, NULL);
@@ -200,7 +206,7 @@ _efl_net_dialer_tcp_efl_net_dialer_address_dial_set(Eo *o EINA_UNUSED, Efl_Net_D
}
EOLIAN static const char *
-_efl_net_dialer_tcp_efl_net_dialer_address_dial_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Tcp_Data *pd)
+_efl_net_dialer_tcp_efl_net_dialer_address_dial_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Tcp_Data *pd)
{
return pd->address_dial;
}
@@ -212,7 +218,7 @@ _efl_net_dialer_tcp_efl_net_dialer_proxy_set(Eo *o EINA_UNUSED, Efl_Net_Dialer_T
}
EOLIAN static const char *
-_efl_net_dialer_tcp_efl_net_dialer_proxy_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Tcp_Data *pd)
+_efl_net_dialer_tcp_efl_net_dialer_proxy_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Tcp_Data *pd)
{
return pd->proxy;
}
@@ -226,7 +232,7 @@ _efl_net_dialer_tcp_efl_net_dialer_timeout_dial_set(Eo *o EINA_UNUSED, Efl_Net_D
}
EOLIAN static double
-_efl_net_dialer_tcp_efl_net_dialer_timeout_dial_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Tcp_Data *pd)
+_efl_net_dialer_tcp_efl_net_dialer_timeout_dial_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Tcp_Data *pd)
{
return pd->timeout_dial;
}
@@ -241,7 +247,7 @@ _efl_net_dialer_tcp_efl_net_dialer_connected_set(Eo *o, Efl_Net_Dialer_Tcp_Data
}
EOLIAN static Eina_Bool
-_efl_net_dialer_tcp_efl_net_dialer_connected_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Tcp_Data *pd)
+_efl_net_dialer_tcp_efl_net_dialer_connected_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Tcp_Data *pd)
{
return pd->connected;
}
diff --git a/src/lib/ecore_con/efl_net_dialer_tcp.eo b/src/lib/ecore_con/efl_net_dialer_tcp.eo
index fd504fb2fc..757e926ab5 100644
--- a/src/lib/ecore_con/efl_net_dialer_tcp.eo
+++ b/src/lib/ecore_con/efl_net_dialer_tcp.eo
@@ -1,4 +1,4 @@
-class Efl.Net.Dialer.Tcp (Efl.Net.Socket.Tcp, Efl.Net.Dialer) {
+class Efl.Net.Dialer_Tcp (Efl.Net.Socket_Tcp, Efl.Net.Dialer) {
[[Connects to a remote TCP server.
If the proxy is NULL (default), then the system proxy will be
@@ -24,6 +24,7 @@ class Efl.Net.Dialer.Tcp (Efl.Net.Socket.Tcp, Efl.Net.Dialer) {
implements {
Efl.Object.constructor;
+ Efl.Object.invalidate;
Efl.Object.destructor;
Efl.Net.Dialer.dial;
Efl.Net.Dialer.address_dial { get; set; }
diff --git a/src/lib/ecore_con/efl_net_dialer_udp.c b/src/lib/ecore_con/efl_net_dialer_udp.c
index 6d253b3e75..89a7154710 100644
--- a/src/lib/ecore_con/efl_net_dialer_udp.c
+++ b/src/lib/ecore_con/efl_net_dialer_udp.c
@@ -54,9 +54,9 @@ _efl_net_dialer_udp_efl_object_constructor(Eo *o, Efl_Net_Dialer_Udp_Data *pd EI
}
EOLIAN static void
-_efl_net_dialer_udp_efl_object_destructor(Eo *o, Efl_Net_Dialer_Udp_Data *pd)
+_efl_net_dialer_udp_efl_object_invalidate(Eo *o, Efl_Net_Dialer_Udp_Data *pd)
{
- if (efl_io_closer_close_on_destructor_get(o) &&
+ if (efl_io_closer_close_on_invalidate_get(o) &&
(!efl_io_closer_closed_get(o)))
{
efl_event_freeze(o);
@@ -70,6 +70,12 @@ _efl_net_dialer_udp_efl_object_destructor(Eo *o, Efl_Net_Dialer_Udp_Data *pd)
pd->resolver.thread = NULL;
}
+ efl_invalidate(efl_super(o, MY_CLASS));
+}
+
+EOLIAN static void
+_efl_net_dialer_udp_efl_object_destructor(Eo *o, Efl_Net_Dialer_Udp_Data *pd)
+{
efl_destructor(efl_super(o, MY_CLASS));
eina_stringshare_replace(&pd->address_dial, NULL);
@@ -196,7 +202,7 @@ _efl_net_dialer_udp_resolved(void *data, const char *host EINA_UNUSED, const cha
{
Eo *o = data;
Efl_Net_Dialer_Udp_Data *pd = efl_data_scope_get(o, MY_CLASS);
- Eina_Error err;
+ Eina_Error err = EINA_ERROR_NO_ERROR;
struct addrinfo *addr;
pd->resolver.thread = NULL;
@@ -288,7 +294,7 @@ _efl_net_dialer_udp_efl_net_dialer_address_dial_set(Eo *o EINA_UNUSED, Efl_Net_D
}
EOLIAN static const char *
-_efl_net_dialer_udp_efl_net_dialer_address_dial_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Udp_Data *pd)
+_efl_net_dialer_udp_efl_net_dialer_address_dial_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Udp_Data *pd)
{
return pd->address_dial;
}
@@ -302,7 +308,7 @@ _efl_net_dialer_udp_efl_net_dialer_timeout_dial_set(Eo *o EINA_UNUSED, Efl_Net_D
}
EOLIAN static double
-_efl_net_dialer_udp_efl_net_dialer_timeout_dial_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Udp_Data *pd)
+_efl_net_dialer_udp_efl_net_dialer_timeout_dial_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Udp_Data *pd)
{
return pd->timeout_dial;
}
@@ -317,7 +323,7 @@ _efl_net_dialer_udp_efl_net_dialer_connected_set(Eo *o, Efl_Net_Dialer_Udp_Data
}
EOLIAN static Eina_Bool
-_efl_net_dialer_udp_efl_net_dialer_connected_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Udp_Data *pd)
+_efl_net_dialer_udp_efl_net_dialer_connected_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Udp_Data *pd)
{
return pd->connected;
}
diff --git a/src/lib/ecore_con/efl_net_dialer_udp.eo b/src/lib/ecore_con/efl_net_dialer_udp.eo
index 9faf6b9f8c..4e5a407015 100644
--- a/src/lib/ecore_con/efl_net_dialer_udp.eo
+++ b/src/lib/ecore_con/efl_net_dialer_udp.eo
@@ -1,4 +1,4 @@
-class Efl.Net.Dialer.Udp (Efl.Net.Socket.Udp, Efl.Net.Dialer) {
+class Efl.Net.Dialer_Udp (Efl.Net.Socket_Udp, Efl.Net.Dialer) {
[[Connects to a remote UDP server.
UDP proxies are not supported, not even using SOCKSv5.
@@ -15,10 +15,10 @@ class Efl.Net.Dialer.Udp (Efl.Net.Socket.Udp, Efl.Net.Dialer) {
To allow finer control, see:
- - @Efl.Net.Socket.Udp.bind: choose the local address to bind.
- - @Efl.Net.Socket.Udp.multicast_join: join other multicast groups.
- - @Efl.Net.Socket.Udp.multicast_loopback: if packets should be delivered locally or only to remote peers.
- - @Efl.Net.Socket.Udp.multicast_time_to_live: how far, in number of hops, the packet should go.
+ - @Efl.Net.Socket_Udp.bind: choose the local address to bind.
+ - @Efl.Net.Socket_Udp.multicast_join: join other multicast groups.
+ - @Efl.Net.Socket_Udp.multicast_loopback: if packets should be delivered locally or only to remote peers.
+ - @Efl.Net.Socket_Udp.multicast_time_to_live: how far, in number of hops, the packet should go.
I
@@ -27,6 +27,7 @@ class Efl.Net.Dialer.Udp (Efl.Net.Socket.Udp, Efl.Net.Dialer) {
implements {
Efl.Object.constructor;
+ Efl.Object.invalidate;
Efl.Object.destructor;
Efl.Net.Dialer.dial;
Efl.Net.Dialer.address_dial { get; set; }
diff --git a/src/lib/ecore_con/efl_net_dialer_unix.c b/src/lib/ecore_con/efl_net_dialer_unix.c
index 452794080d..683a37b89f 100644
--- a/src/lib/ecore_con/efl_net_dialer_unix.c
+++ b/src/lib/ecore_con/efl_net_dialer_unix.c
@@ -43,9 +43,9 @@ _efl_net_dialer_unix_efl_object_constructor(Eo *o, Efl_Net_Dialer_Unix_Data *pd
}
EOLIAN static void
-_efl_net_dialer_unix_efl_object_destructor(Eo *o, Efl_Net_Dialer_Unix_Data *pd)
+_efl_net_dialer_unix_efl_object_invalidate(Eo *o, Efl_Net_Dialer_Unix_Data *pd)
{
- if (efl_io_closer_close_on_destructor_get(o) &&
+ if (efl_io_closer_close_on_invalidate_get(o) &&
(!efl_io_closer_closed_get(o)))
{
efl_event_freeze(o);
@@ -59,6 +59,12 @@ _efl_net_dialer_unix_efl_object_destructor(Eo *o, Efl_Net_Dialer_Unix_Data *pd)
pd->connect.thread = NULL;
}
+ efl_invalidate(efl_super(o, MY_CLASS));
+}
+
+EOLIAN static void
+_efl_net_dialer_unix_efl_object_destructor(Eo *o, Efl_Net_Dialer_Unix_Data *pd)
+{
efl_destructor(efl_super(o, MY_CLASS));
eina_stringshare_replace(&pd->address_dial, NULL);
@@ -190,7 +196,7 @@ _efl_net_dialer_unix_efl_net_dialer_address_dial_set(Eo *o EINA_UNUSED, Efl_Net_
}
EOLIAN static const char *
-_efl_net_dialer_unix_efl_net_dialer_address_dial_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Unix_Data *pd)
+_efl_net_dialer_unix_efl_net_dialer_address_dial_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Unix_Data *pd)
{
return pd->address_dial;
}
@@ -205,7 +211,7 @@ _efl_net_dialer_unix_efl_net_dialer_timeout_dial_set(Eo *o, Efl_Net_Dialer_Unix_
}
EOLIAN static double
-_efl_net_dialer_unix_efl_net_dialer_timeout_dial_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Unix_Data *pd)
+_efl_net_dialer_unix_efl_net_dialer_timeout_dial_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Unix_Data *pd)
{
return pd->timeout_dial;
}
@@ -220,7 +226,7 @@ _efl_net_dialer_unix_efl_net_dialer_connected_set(Eo *o, Efl_Net_Dialer_Unix_Dat
}
EOLIAN static Eina_Bool
-_efl_net_dialer_unix_efl_net_dialer_connected_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Unix_Data *pd)
+_efl_net_dialer_unix_efl_net_dialer_connected_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Unix_Data *pd)
{
return pd->connected;
}
diff --git a/src/lib/ecore_con/efl_net_dialer_unix.eo b/src/lib/ecore_con/efl_net_dialer_unix.eo
index 36319d4d61..a45d2be5c7 100644
--- a/src/lib/ecore_con/efl_net_dialer_unix.eo
+++ b/src/lib/ecore_con/efl_net_dialer_unix.eo
@@ -1,4 +1,4 @@
-class Efl.Net.Dialer.Unix (Efl.Net.Socket.Unix, Efl.Net.Dialer) {
+class Efl.Net.Dialer_Unix (Efl.Net.Socket_Unix, Efl.Net.Dialer) {
[[Connects to a local AF_UNIX server.
The dial address is a file system path (portable) or
@@ -12,6 +12,7 @@ class Efl.Net.Dialer.Unix (Efl.Net.Socket.Unix, Efl.Net.Dialer) {
implements {
Efl.Object.constructor;
+ Efl.Object.invalidate;
Efl.Object.destructor;
Efl.Net.Dialer.dial;
Efl.Net.Dialer.address_dial { get; set; }
diff --git a/src/lib/ecore_con/efl_net_dialer_websocket.c b/src/lib/ecore_con/efl_net_dialer_websocket.c
index 982a6e4064..80c598ac4b 100644
--- a/src/lib/ecore_con/efl_net_dialer_websocket.c
+++ b/src/lib/ecore_con/efl_net_dialer_websocket.c
@@ -956,15 +956,20 @@ _efl_net_dialer_websocket_efl_object_constructor(Eo *o, Efl_Net_Dialer_Websocket
}
EOLIAN static void
+_efl_net_dialer_websocket_efl_object_invalidate(Eo *o, Efl_Net_Dialer_Websocket_Data *pd)
+{
+ pd->http = NULL;
+
+ efl_invalidate(efl_super(o, MY_CLASS));
+}
+
+EOLIAN static void
_efl_net_dialer_websocket_efl_object_destructor(Eo *o, Efl_Net_Dialer_Websocket_Data *pd)
{
Eina_Stringshare *str;
efl_event_callback_array_del(pd->http, _efl_net_dialer_websocket_http_cbs(), o);
- efl_del(pd->http);
- pd->http = NULL;
-
efl_destructor(efl_super(o, MY_CLASS));
eina_stringshare_replace(&pd->address_dial, NULL);
@@ -1166,7 +1171,7 @@ _efl_net_dialer_websocket_efl_net_dialer_address_dial_set(Eo *o EINA_UNUSED, Efl
}
EOLIAN static const char *
-_efl_net_dialer_websocket_efl_net_dialer_address_dial_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
+_efl_net_dialer_websocket_efl_net_dialer_address_dial_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
{
return pd->address_dial;
}
@@ -1181,7 +1186,7 @@ _efl_net_dialer_websocket_efl_net_dialer_connected_set(Eo *o, Efl_Net_Dialer_Web
}
EOLIAN static Eina_Bool
-_efl_net_dialer_websocket_efl_net_dialer_connected_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
+_efl_net_dialer_websocket_efl_net_dialer_connected_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
{
return pd->connected;
}
@@ -1193,7 +1198,7 @@ _efl_net_dialer_websocket_efl_net_dialer_proxy_set(Eo *o EINA_UNUSED, Efl_Net_Di
}
EOLIAN static const char *
-_efl_net_dialer_websocket_efl_net_dialer_proxy_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
+_efl_net_dialer_websocket_efl_net_dialer_proxy_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
{
return efl_net_dialer_proxy_get(pd->http);
}
@@ -1205,13 +1210,13 @@ _efl_net_dialer_websocket_efl_net_dialer_timeout_dial_set(Eo *o EINA_UNUSED, Efl
}
EOLIAN static double
-_efl_net_dialer_websocket_efl_net_dialer_timeout_dial_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
+_efl_net_dialer_websocket_efl_net_dialer_timeout_dial_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
{
return efl_net_dialer_timeout_dial_get(pd->http);
}
EOLIAN static const char *
-_efl_net_dialer_websocket_efl_net_socket_address_local_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
+_efl_net_dialer_websocket_efl_net_socket_address_local_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
{
return efl_net_socket_address_local_get(pd->http);
}
@@ -1224,7 +1229,7 @@ _efl_net_dialer_websocket_efl_net_socket_address_remote_set(Eo *o EINA_UNUSED, E
}
EOLIAN static const char *
-_efl_net_dialer_websocket_efl_net_socket_address_remote_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
+_efl_net_dialer_websocket_efl_net_socket_address_remote_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
{
return pd->address_remote;
}
@@ -1281,7 +1286,7 @@ _efl_net_dialer_websocket_efl_io_reader_read(Eo *o, Efl_Net_Dialer_Websocket_Dat
}
EOLIAN static Eina_Bool
-_efl_net_dialer_websocket_efl_io_reader_can_read_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
+_efl_net_dialer_websocket_efl_io_reader_can_read_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
{
return pd->can_read;
}
@@ -1296,7 +1301,7 @@ _efl_net_dialer_websocket_efl_io_reader_can_read_set(Eo *o, Efl_Net_Dialer_Webso
}
EOLIAN static Eina_Bool
-_efl_net_dialer_websocket_efl_io_reader_eos_get(Eo *o, Efl_Net_Dialer_Websocket_Data *pd)
+_efl_net_dialer_websocket_efl_io_reader_eos_get(const Eo *o, Efl_Net_Dialer_Websocket_Data *pd)
{
return !pd->can_read && efl_io_closer_closed_get(o);
}
@@ -1326,7 +1331,7 @@ _efl_net_dialer_websocket_efl_io_writer_write(Eo *o, Efl_Net_Dialer_Websocket_Da
}
EOLIAN static Eina_Bool
-_efl_net_dialer_websocket_efl_io_writer_can_write_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
+_efl_net_dialer_websocket_efl_io_writer_can_write_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
{
return pd->can_write;
}
@@ -1351,7 +1356,7 @@ _efl_net_dialer_websocket_efl_io_closer_close(Eo *o, Efl_Net_Dialer_Websocket_Da
}
EOLIAN static Eina_Bool
-_efl_net_dialer_websocket_efl_io_closer_closed_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
+_efl_net_dialer_websocket_efl_io_closer_closed_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
{
return pd->close_requested || efl_io_closer_closed_get(pd->http);
}
@@ -1363,21 +1368,21 @@ _efl_net_dialer_websocket_efl_io_closer_close_on_exec_set(Eo *o EINA_UNUSED, Efl
}
EOLIAN static Eina_Bool
-_efl_net_dialer_websocket_efl_io_closer_close_on_exec_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
+_efl_net_dialer_websocket_efl_io_closer_close_on_exec_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
{
return efl_io_closer_close_on_exec_get(pd->http);
}
EOLIAN static void
-_efl_net_dialer_websocket_efl_io_closer_close_on_destructor_set(Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd, Eina_Bool close_on_destructor)
+_efl_net_dialer_websocket_efl_io_closer_close_on_invalidate_set(Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd, Eina_Bool close_on_invalidate)
{
- efl_io_closer_close_on_destructor_set(pd->http, close_on_destructor);
+ efl_io_closer_close_on_invalidate_set(pd->http, close_on_invalidate);
}
EOLIAN static Eina_Bool
-_efl_net_dialer_websocket_efl_io_closer_close_on_destructor_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
+_efl_net_dialer_websocket_efl_io_closer_close_on_invalidate_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
{
- return efl_io_closer_close_on_destructor_get(pd->http);
+ return efl_io_closer_close_on_invalidate_get(pd->http);
}
EOLIAN static void
@@ -1393,7 +1398,7 @@ _efl_net_dialer_websocket_streaming_mode_set(Eo *o, Efl_Net_Dialer_Websocket_Dat
}
EOLIAN static Efl_Net_Dialer_Websocket_Streaming_Mode
-_efl_net_dialer_websocket_streaming_mode_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
+_efl_net_dialer_websocket_streaming_mode_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
{
return pd->streaming_mode;
}
@@ -1405,7 +1410,7 @@ _efl_net_dialer_websocket_user_agent_set(Eo *o EINA_UNUSED, Efl_Net_Dialer_Webso
}
EOLIAN static const char *
-_efl_net_dialer_websocket_user_agent_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
+_efl_net_dialer_websocket_user_agent_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
{
return efl_net_dialer_http_user_agent_get(pd->http);
}
@@ -1417,7 +1422,7 @@ _efl_net_dialer_websocket_authentication_set(Eo *o EINA_UNUSED, Efl_Net_Dialer_W
}
EOLIAN static void
-_efl_net_dialer_websocket_authentication_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd, const char **username, const char **password, Efl_Net_Http_Authentication_Method *method, Eina_Bool *restricted)
+_efl_net_dialer_websocket_authentication_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd, const char **username, const char **password, Efl_Net_Http_Authentication_Method *method, Eina_Bool *restricted)
{
efl_net_dialer_http_authentication_get(pd->http, username, password, method, restricted);
}
@@ -1429,7 +1434,7 @@ _efl_net_dialer_websocket_allow_redirects_set(Eo *o EINA_UNUSED, Efl_Net_Dialer_
}
EOLIAN static Eina_Bool
-_efl_net_dialer_websocket_allow_redirects_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
+_efl_net_dialer_websocket_allow_redirects_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
{
return efl_net_dialer_http_allow_redirects_get(pd->http);
}
@@ -1441,7 +1446,7 @@ _efl_net_dialer_websocket_cookie_jar_set(Eo *o EINA_UNUSED, Efl_Net_Dialer_Webso
}
EOLIAN static const char *
-_efl_net_dialer_websocket_cookie_jar_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
+_efl_net_dialer_websocket_cookie_jar_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
{
return efl_net_dialer_http_cookie_jar_get(pd->http);
}
diff --git a/src/lib/ecore_con/efl_net_dialer_websocket.eo b/src/lib/ecore_con/efl_net_dialer_websocket.eo
index d927474031..f22bf54104 100644
--- a/src/lib/ecore_con/efl_net_dialer_websocket.eo
+++ b/src/lib/ecore_con/efl_net_dialer_websocket.eo
@@ -1,17 +1,17 @@
import eina_types;
import efl_net_http_types;
-enum Efl.Net.Dialer.Websocket.Streaming_Mode {
+enum Efl.Net.Dialer_Websocket_Streaming_Mode {
[[How to map WebSocket to EFL I/O Interfaces.
@since 1.19
]]
disabled, [[@Efl.Io.Writer.write and @Efl.Io.Reader.read will fail by returning ENOSTR]]
- binary, [[@Efl.Io.Writer.write will result in @Efl.Net.Dialer.Websocket.binary_send]]
- text, [[@Efl.Io.Writer.write will result in @Efl.Net.Dialer.Websocket.text_send]]
+ binary, [[@Efl.Io.Writer.write will result in @Efl.Net.Dialer_Websocket.binary_send]]
+ text, [[@Efl.Io.Writer.write will result in @Efl.Net.Dialer_Websocket.text_send]]
}
-enum Efl.Net.Dialer.Websocket.Close_Reason {
+enum Efl.Net.Dialer_Websocket_Close_Reason {
[[Registered reasons for the CLOSE (opcode=0x8).
These are the well known reasons, with some ranges being defined
@@ -38,16 +38,16 @@ enum Efl.Net.Dialer.Websocket.Close_Reason {
private_end = 4999, [[Applications can use range 4000-4999]]
}
-struct Efl.Net.Dialer.Websocket.Closed_Reason {
+struct Efl.Net.Dialer_Websocket_Closed_Reason {
[[Close reason event payload.
@since 1.19
]]
- reason: Efl.Net.Dialer.Websocket.Close_Reason; [[Closing reason]]
+ reason: Efl.Net.Dialer_Websocket_Close_Reason; [[Closing reason]]
message: string; [[Textual closing reason message]]
}
-class Efl.Net.Dialer.Websocket (Efl.Loop.Consumer, Efl.Net.Dialer) {
+class Efl.Net.Dialer_Websocket (Efl.Loop_Consumer, Efl.Net.Dialer) {
[[WebSocket Dialer (Client).
The WebSocket Protocol (https://tools.ietf.org/html/rfc6455) is
@@ -135,7 +135,7 @@ class Efl.Net.Dialer.Websocket (Efl.Loop.Consumer, Efl.Net.Dialer) {
close message, which will be reported as "closed,reason".
]]
params {
- reason: Efl.Net.Dialer.Websocket.Close_Reason; [[Reason for closing]]
+ reason: Efl.Net.Dialer_Websocket_Close_Reason; [[Reason for closing]]
message: string @optional; [[Additional closing message]]
}
}
@@ -174,9 +174,9 @@ class Efl.Net.Dialer.Websocket (Efl.Loop.Consumer, Efl.Net.Dialer) {
However this class can operate in streaming mode,
mapping each @Efl.Io.Writer.write to a @.binary_send if
streaming_mode is set to
- @Efl.Net.Dialer.Websocket.Streaming_Mode.binary, of
+ @Efl.Net.Dialer_Websocket_Streaming_Mode.binary, of
@.text_send if
- @Efl.Net.Dialer.Websocket.Streaming_Mode.text
+ @Efl.Net.Dialer_Websocket_Streaming_Mode.text
@Efl.Io.Reader.read may consume less then the whole
received message, in this case the rest of the message
@@ -184,12 +184,12 @@ class Efl.Net.Dialer.Websocket (Efl.Loop.Consumer, Efl.Net.Dialer) {
SOCK_SEQPACKET + read(2)).
By default, streaming is disabled
- (@Efl.Net.Dialer.Websocket.Streaming_Mode.disabled).
+ (@Efl.Net.Dialer_Websocket_Streaming_Mode.disabled).
]]
get { }
set { }
values {
- streaming_mode: Efl.Net.Dialer.Websocket.Streaming_Mode; [[Streaming mode]]
+ streaming_mode: Efl.Net.Dialer_Websocket_Streaming_Mode; [[Streaming mode]]
}
}
@@ -309,11 +309,12 @@ class Efl.Net.Dialer.Websocket (Efl.Loop.Consumer, Efl.Net.Dialer) {
message,text: string; [[Received a text string message (opcode=0x1)]]
message,binary: ptr(const(Eina.Slice)); [[Received a binary message (opcode=0x2)]]
pong: string; [[Received a pong (opcode=0xA) with optional message/reason]]
- closed,reason: Efl.Net.Dialer.Websocket.Closed_Reason; [[Received a request to close the connection. It may be a reply/confirmation from a local request, see @.close_request, or some server-generated reason. After this point, no more messages are allowed to be sent and no more will be received. @Efl.Io.Closer.close will be called.]]
+ closed,reason: Efl.Net.Dialer_Websocket_Closed_Reason; [[Received a request to close the connection. It may be a reply/confirmation from a local request, see @.close_request, or some server-generated reason. After this point, no more messages are allowed to be sent and no more will be received. @Efl.Io.Closer.close will be called.]]
}
implements {
Efl.Object.constructor;
+ Efl.Object.invalidate;
Efl.Object.destructor;
Efl.Net.Dialer.dial;
Efl.Net.Dialer.address_dial { get; set; }
@@ -330,6 +331,6 @@ class Efl.Net.Dialer.Websocket (Efl.Loop.Consumer, Efl.Net.Dialer) {
Efl.Io.Closer.close;
Efl.Io.Closer.closed { get; }
Efl.Io.Closer.close_on_exec { get; set; }
- Efl.Io.Closer.close_on_destructor { get; set; }
+ Efl.Io.Closer.close_on_invalidate { get; set; }
}
}
diff --git a/src/lib/ecore_con/efl_net_dialer_windows.c b/src/lib/ecore_con/efl_net_dialer_windows.c
index f96b73167e..8e78446b6f 100644
--- a/src/lib/ecore_con/efl_net_dialer_windows.c
+++ b/src/lib/ecore_con/efl_net_dialer_windows.c
@@ -115,7 +115,7 @@ _efl_net_dialer_windows_efl_net_dialer_address_dial_set(Eo *o EINA_UNUSED, Efl_N
}
EOLIAN static const char *
-_efl_net_dialer_windows_efl_net_dialer_address_dial_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Windows_Data *pd)
+_efl_net_dialer_windows_efl_net_dialer_address_dial_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Windows_Data *pd)
{
return pd->address_dial + strlen(PIPE_NS);
}
@@ -129,7 +129,7 @@ _efl_net_dialer_windows_efl_net_dialer_connected_set(Eo *o, Efl_Net_Dialer_Windo
}
EOLIAN static Eina_Bool
-_efl_net_dialer_windows_efl_net_dialer_connected_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Windows_Data *pd)
+_efl_net_dialer_windows_efl_net_dialer_connected_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Windows_Data *pd)
{
return pd->connected;
}
@@ -141,7 +141,7 @@ _efl_net_dialer_windows_efl_net_dialer_timeout_dial_set(Eo *o EINA_UNUSED, Efl_N
}
EOLIAN static double
-_efl_net_dialer_windows_efl_net_dialer_timeout_dial_get(Eo *o EINA_UNUSED, Efl_Net_Dialer_Windows_Data *pd)
+_efl_net_dialer_windows_efl_net_dialer_timeout_dial_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Windows_Data *pd)
{
return pd->timeout_dial;
}
diff --git a/src/lib/ecore_con/efl_net_dialer_windows.eo b/src/lib/ecore_con/efl_net_dialer_windows.eo
index 50a38b89b5..882638113c 100644
--- a/src/lib/ecore_con/efl_net_dialer_windows.eo
+++ b/src/lib/ecore_con/efl_net_dialer_windows.eo
@@ -1,4 +1,4 @@
-class Efl.Net.Dialer.Windows (Efl.Net.Socket.Windows, Efl.Net.Dialer) {
+class Efl.Net.Dialer_Windows (Efl.Net.Socket_Windows, Efl.Net.Dialer) {
[[Connects to a Windows NamedPipe server.
The dial address will have "\\\\.\\pipe\\" prepended as required by
diff --git a/src/lib/ecore_con/efl_net_ip_address.c b/src/lib/ecore_con/efl_net_ip_address.c
index 13e14a052d..e2fbb68f06 100644
--- a/src/lib/ecore_con/efl_net_ip_address.c
+++ b/src/lib/ecore_con/efl_net_ip_address.c
@@ -26,6 +26,17 @@ typedef struct _Efl_Net_Ip_Address_Data {
Eina_Slice addr_slice;
} Efl_Net_Ip_Address_Data;
+typedef struct _Efl_Net_Ip_Address_Resolve_Value
+{
+ Eina_Stringshare *request_address; /**< The 'address' argument given to
+ * Efl.Net.Ip_Address.resolve */
+ Eina_Stringshare *canonical_name; /**< The canonical name, if it was requested in
+ * flags */
+ const Eina_Value_Array results; /**< The resolved objects. Do not modify this array but
+ * you can keep reference to elements using efl_ref()
+ * and efl_unref() */
+} Efl_Net_Ip_Address_Resolve_Value;
+
#define MY_CLASS EFL_NET_IP_ADDRESS_CLASS
EOLIAN static Eo *
@@ -60,7 +71,7 @@ _efl_net_ip_address_efl_object_finalize(Eo *o, Efl_Net_Ip_Address_Data *pd)
}
EOLIAN static const char *
-_efl_net_ip_address_string_get(Eo *o EINA_UNUSED, Efl_Net_Ip_Address_Data *pd)
+_efl_net_ip_address_string_get(const Eo *o EINA_UNUSED, Efl_Net_Ip_Address_Data *pd)
{
return pd->string;
}
@@ -85,7 +96,7 @@ _efl_net_ip_address_family_set(Eo *o EINA_UNUSED, Efl_Net_Ip_Address_Data *pd, i
}
EOLIAN static int
-_efl_net_ip_address_family_get(Eo *o EINA_UNUSED, Efl_Net_Ip_Address_Data *pd)
+_efl_net_ip_address_family_get(const Eo *o EINA_UNUSED, Efl_Net_Ip_Address_Data *pd)
{
return pd->addr.sa_family;
}
@@ -112,7 +123,7 @@ _efl_net_ip_address_port_set(Eo *o EINA_UNUSED, Efl_Net_Ip_Address_Data *pd, uin
}
EOLIAN static uint16_t
-_efl_net_ip_address_port_get(Eo *o EINA_UNUSED, Efl_Net_Ip_Address_Data *pd)
+_efl_net_ip_address_port_get(const Eo *o EINA_UNUSED, Efl_Net_Ip_Address_Data *pd)
{
const uint16_t *pport;
@@ -167,7 +178,7 @@ _efl_net_ip_address_address_set(Eo *o EINA_UNUSED, Efl_Net_Ip_Address_Data *pd,
}
EOLIAN static Eina_Slice
-_efl_net_ip_address_address_get(Eo *o EINA_UNUSED, Efl_Net_Ip_Address_Data *pd)
+_efl_net_ip_address_address_get(const Eo *o EINA_UNUSED, Efl_Net_Ip_Address_Data *pd)
{
return pd->addr_slice;
}
@@ -197,7 +208,7 @@ _efl_net_ip_address_sockaddr_set(Eo *o EINA_UNUSED, Efl_Net_Ip_Address_Data *pd,
}
EOLIAN static const void *
-_efl_net_ip_address_sockaddr_get(Eo *o EINA_UNUSED, Efl_Net_Ip_Address_Data *pd)
+_efl_net_ip_address_sockaddr_get(const Eo *o EINA_UNUSED, Efl_Net_Ip_Address_Data *pd)
{
return &pd->addr;
}
@@ -300,7 +311,7 @@ _efl_net_ip_address_create(Eo *cls, void *pd EINA_UNUSED, uint16_t port, const E
else
family = AF_INET;
- return efl_add(cls, NULL,
+ return efl_add_ref(cls, efl_main_loop_get(),
efl_net_ip_address_family_set(efl_added, family),
efl_net_ip_address_port_set(efl_added, port),
efl_net_ip_address_set(efl_added, address));
@@ -314,7 +325,7 @@ _efl_net_ip_address_create_sockaddr(Eo *cls, void *pd EINA_UNUSED, const void *p
EINA_SAFETY_ON_NULL_RETURN_VAL(sockaddr, NULL);
EINA_SAFETY_ON_TRUE_RETURN_VAL((sockaddr->sa_family != AF_INET) && (sockaddr->sa_family != AF_INET6), NULL);
- return efl_add(cls, NULL,
+ return efl_add_ref(cls, efl_main_loop_get(),
efl_net_ip_address_sockaddr_set(efl_added, sockaddr));
}
@@ -357,85 +368,79 @@ _efl_net_ip_address_parse(Eo *cls, void *pd EINA_UNUSED, const char *numeric_add
return NULL;
}
- return efl_add(cls, NULL,
+ return efl_add_ref(cls, efl_main_loop_get(),
efl_net_ip_address_sockaddr_set(efl_added, &ss));
}
typedef struct _Efl_Net_Ip_Address_Resolve_Context {
- Efl_Net_Ip_Address_Resolve_Results *result;
+ Eina_Stringshare *request_address;
Ecore_Thread *thread;
- Efl_Promise *promise;
+ Eina_Promise *promise;
} Efl_Net_Ip_Address_Resolve_Context;
-static void
-_efl_net_ip_address_resolve_results_free(void *data)
+static Eina_Value_Struct_Desc *
+_efl_net_ip_address_resolve_value_desc_get(void)
{
- Efl_Net_Ip_Address_Resolve_Results *r = data;
-
- if (r->results)
- {
- Eina_Array_Iterator it;
- unsigned int i;
- Efl_Net_Ip_Address *o;
-
- EINA_ARRAY_ITER_NEXT(r->results, i, o, it)
- efl_unref(o);
-
- eina_array_free(r->results);
- r->results = NULL;
- }
+ static Eina_Value_Struct_Member struct_members[] = {
+ // no eina_value_type as they are not constant initializers, see below.
+ EINA_VALUE_STRUCT_MEMBER(NULL, Efl_Net_Ip_Address_Resolve_Value, canonical_name),
+ EINA_VALUE_STRUCT_MEMBER(NULL, Efl_Net_Ip_Address_Resolve_Value, request_address),
+ EINA_VALUE_STRUCT_MEMBER(NULL, Efl_Net_Ip_Address_Resolve_Value, results)
+ };
+ static Eina_Value_Struct_Desc struct_desc = {
+ EINA_VALUE_STRUCT_DESC_VERSION,
+ NULL,
+ struct_members,
+ EINA_C_ARRAY_LENGTH(struct_members),
+ sizeof (Efl_Net_Ip_Address_Resolve_Value)
+ };
+ struct_members[0].type = EINA_VALUE_TYPE_STRINGSHARE;
+ struct_members[1].type = EINA_VALUE_TYPE_STRINGSHARE;
+ struct_members[2].type = EINA_VALUE_TYPE_ARRAY;
+ struct_desc.ops = EINA_VALUE_STRUCT_OPERATIONS_BINSEARCH;
- eina_stringshare_replace(&r->canonical_name, NULL);
- eina_stringshare_replace(&r->request_address, NULL);
- free(r);
+ return &struct_desc;
}
static void
-_efl_net_ip_address_resolve_del(void *data, const Efl_Event *event EINA_UNUSED)
+_efl_net_ip_address_resolve_del(void *data,
+ const Eina_Promise *dead_promise EINA_UNUSED)
{
Efl_Net_Ip_Address_Resolve_Context *ctx = data;
ctx->promise = NULL;
+ eina_stringshare_replace(&ctx->request_address, NULL);
+
if (ctx->thread)
{
ecore_thread_cancel(ctx->thread);
ctx->thread = NULL;
}
- if (ctx->result)
- {
- _efl_net_ip_address_resolve_results_free(ctx->result);
- ctx->result = NULL;
- }
-
free(ctx);
}
static inline int
-_efl_net_ip_address_find(const Eina_Array *array, const struct sockaddr *addr)
+_efl_net_ip_address_find(const Eina_Value *array, const struct sockaddr *addr)
{
- Eina_Array_Iterator it;
- unsigned int i;
const Efl_Net_Ip_Address *o;
+ unsigned int i, len;
- if (addr->sa_family == AF_INET6)
+ EINA_VALUE_ARRAY_FOREACH(array, len, i, o)
{
- EINA_ARRAY_ITER_NEXT(array, i, o, it)
+ const struct sockaddr *other = efl_net_ip_address_sockaddr_get(o);
+
+ if (addr->sa_family == AF_INET6)
{
- const struct sockaddr *other = efl_net_ip_address_sockaddr_get(o);
if (other->sa_family == AF_INET6)
{
if (memcmp(other, addr, sizeof(struct sockaddr_in6)) == 0)
return (int)i;
}
}
- }
- else
- {
- EINA_ARRAY_ITER_NEXT(array, i, o, it)
+ else
{
- const struct sockaddr *other = efl_net_ip_address_sockaddr_get(o);
if (other->sa_family == AF_INET)
{
if (memcmp(other, addr, sizeof(struct sockaddr_in)) == 0)
@@ -447,66 +452,89 @@ _efl_net_ip_address_find(const Eina_Array *array, const struct sockaddr *addr)
}
static void
-_efl_net_ip_address_resolve_done(void *data, const char *host, const char *port, const struct addrinfo *hints EINA_UNUSED, struct addrinfo *result, int gai_error)
+_efl_net_ip_address_resolve_done(void *data,
+ const char *host, const char *port,
+ const struct addrinfo *hints EINA_UNUSED,
+ struct addrinfo *result,
+ int gai_error)
{
Efl_Net_Ip_Address_Resolve_Context *ctx = data;
- Efl_Net_Ip_Address_Resolve_Results *r;
+ Eina_Value_Array desc = { 0 };
+ Eina_Value s = EINA_VALUE_EMPTY;
+ Eina_Value r = EINA_VALUE_EMPTY;
+ Eina_Error err = EFL_NET_ERROR_COULDNT_RESOLVE_HOST;
const struct addrinfo *a;
DBG("done resolving '%s' (host='%s', port='%s'): %s",
- ctx->result->request_address, host, port,
+ ctx->request_address, host, port,
gai_error ? gai_strerror(gai_error) : "success");
ctx->thread = NULL;
if (gai_error)
{
- Eina_Error err = EFL_NET_ERROR_COULDNT_RESOLVE_HOST;
-
if (gai_error == EAI_SYSTEM)
err = errno;
- efl_promise_failed_set(ctx->promise, err);
- return;
+ goto on_error;
}
- ctx->result->results = eina_array_new(16);
- if (!ctx->result->results)
- {
- efl_promise_failed_set(ctx->promise, ENOMEM);
- return;
- }
+ err = ENOMEM;
+ if (!eina_value_array_setup(&r, EINA_VALUE_TYPE_OBJECT, 1))
+ goto on_error;
+
+ if (!eina_value_struct_setup(&s, _efl_net_ip_address_resolve_value_desc_get()))
+ goto on_error;
- r = ctx->result;
- ctx->result = NULL; /* steal for efl_promise_value_set() */
+ eina_value_struct_set(&s, "request_address", ctx->request_address);
for (a = result; a != NULL; a = a->ai_next)
{
+ Eina_Stringshare *canonical_name = NULL;
Eo *o;
- if (EINA_UNLIKELY((r->canonical_name == NULL) &&
+ eina_value_struct_get(&s, "canonical_name", &canonical_name);
+ if (EINA_UNLIKELY((canonical_name == NULL) &&
(a->ai_canonname != NULL)))
- r->canonical_name = eina_stringshare_add(a->ai_canonname);
+ {
+ canonical_name = eina_stringshare_add(a->ai_canonname);
+ eina_value_struct_set(&s, "canonical_name", canonical_name);
+ eina_stringshare_del(canonical_name);
+ }
/* some addresses get duplicated with different options that we
* do not care, so check for duplicates.
*/
- if (EINA_UNLIKELY(_efl_net_ip_address_find(r->results, a->ai_addr) >= 0))
+ if (EINA_UNLIKELY(_efl_net_ip_address_find(&r, a->ai_addr) >= 0))
continue;
o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, a->ai_addr);
- if (o)
- {
- if (!eina_array_push(r->results, o))
- efl_del(o);
- }
+ if (!o) continue ;
+
+ eina_value_array_append(&r, o);
+ efl_unref(o);
}
freeaddrinfo(result);
- efl_promise_value_set(ctx->promise, r, _efl_net_ip_address_resolve_results_free);
+ if (!eina_value_pget(&r, &desc)) goto on_error;
+ if (!eina_value_struct_pset(&s, "results", &desc)) goto on_error;
+ eina_value_flush(&r);
+
+ eina_promise_resolve(ctx->promise, s);
+
+ eina_stringshare_replace(&ctx->request_address, NULL);
+ free(ctx);
+
+ return ;
+
+ on_error:
+ eina_promise_reject(ctx->promise, err);
+
+ eina_stringshare_replace(&ctx->request_address, NULL);
+ free(ctx);
}
-EOLIAN static Efl_Future *
+EOLIAN static Eina_Future *
_efl_net_ip_address_resolve(Eo *cls EINA_UNUSED, void *pd EINA_UNUSED, const char *address, int family, int flags)
{
Efl_Net_Ip_Address_Resolve_Context *ctx;
@@ -538,29 +566,23 @@ _efl_net_ip_address_resolve(Eo *cls EINA_UNUSED, void *pd EINA_UNUSED, const cha
ctx = calloc(1, sizeof(Efl_Net_Ip_Address_Resolve_Context));
EINA_SAFETY_ON_NULL_GOTO(ctx, error_ctx);
- ctx->result = calloc(1, sizeof(Efl_Net_Ip_Address_Resolve_Results));
- EINA_SAFETY_ON_NULL_GOTO(ctx->result, error_result);
-
- ctx->result->request_address = eina_stringshare_add(address);
- EINA_SAFETY_ON_NULL_GOTO(ctx->result->request_address, error_result_address);
+ ctx->request_address = eina_stringshare_add(address);
+ EINA_SAFETY_ON_NULL_GOTO(ctx->request_address, error_result_address);
ctx->thread = efl_net_ip_resolve_async_new(host, port, &hints, _efl_net_ip_address_resolve_done, ctx);
EINA_SAFETY_ON_NULL_GOTO(ctx->thread, error_thread);
- ctx->promise = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get(),
- efl_event_callback_add(efl_added, EFL_EVENT_DEL, _efl_net_ip_address_resolve_del, ctx));
+ ctx->promise = eina_promise_new(efl_loop_future_scheduler_get(efl_main_loop_get()), _efl_net_ip_address_resolve_del, ctx);
EINA_SAFETY_ON_NULL_GOTO(ctx->promise, error_promise);
free(str);
- return efl_promise_future_get(ctx->promise);
+ return eina_future_new(ctx->promise);
error_promise:
ecore_thread_cancel(ctx->thread);
error_thread:
- eina_stringshare_del(ctx->result->request_address);
+ eina_stringshare_del(ctx->request_address);
error_result_address:
- free(ctx->result);
- error_result:
free(ctx);
error_ctx:
free(str);
diff --git a/src/lib/ecore_con/efl_net_ip_address.eo b/src/lib/ecore_con/efl_net_ip_address.eo
index e715a0c7bb..eebbb0ac5b 100644
--- a/src/lib/ecore_con/efl_net_ip_address.eo
+++ b/src/lib/ecore_con/efl_net_ip_address.eo
@@ -1,6 +1,6 @@
import eina_types;
-struct Efl.Net.Ip_Address.Resolve_Results {
+struct Efl.Net.Ip_Address_Resolve_Results {
[[The results of @Efl.Net.Ip_Address.resolve call.
This structure is created by @Efl.Net.Ip_Address.resolve.
@@ -112,7 +112,7 @@ class Efl.Net.Ip_Address (Efl.Object) {
family: int @optional; [[Preferred family. AF_UNSPEC or 0 for both, otherwise one of AF_INET or AF_INET6]]
flags: int @optional; [[Flags to use with getaddrinfo(). If 0, default flags are used (AI_V4MAPPED | AI_ADDRCONFIG, if these exist in your system).]]
}
- return: future<const(Efl.Net.Ip_Address.Resolve_Results)>; [[The resolve results. It contains a list of Efl.Net.Ip_Address, they will be automatically deleted unless you keep a reference to it.]]
+ return: future<const(Efl.Net.Ip_Address_Resolve_Results)>; [[The resolve results. It contains a list of Efl.Net.Ip_Address, they will be automatically deleted unless you keep a reference to it.]]
}
@property string {
diff --git a/src/lib/ecore_con/efl_net_server.eo b/src/lib/ecore_con/efl_net_server.eo
index f6d29c4066..8a84fdbaf3 100644
--- a/src/lib/ecore_con/efl_net_server.eo
+++ b/src/lib/ecore_con/efl_net_server.eo
@@ -29,7 +29,7 @@ interface Efl.Net.Server {
error: Eina.Error; [[An error has occurred and the server needs
to be stopped.
]]
- serving; [[Notifies the server is ready to accept clients.
+ serving: void; [[Notifies the server is ready to accept clients.
See property @.serving]]
}
diff --git a/src/lib/ecore_con/efl_net_server_fd.c b/src/lib/ecore_con/efl_net_server_fd.c
index 5fede8d0f7..8a493404a9 100644
--- a/src/lib/ecore_con/efl_net_server_fd.c
+++ b/src/lib/ecore_con/efl_net_server_fd.c
@@ -153,13 +153,13 @@ _efl_net_server_fd_efl_net_server_address_set(Eo *o EINA_UNUSED, Efl_Net_Server_
}
EOLIAN static const char *
-_efl_net_server_fd_efl_net_server_address_get(Eo *o EINA_UNUSED, Efl_Net_Server_Fd_Data *pd)
+_efl_net_server_fd_efl_net_server_address_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Fd_Data *pd)
{
return pd->address;
}
EOLIAN static unsigned int
-_efl_net_server_fd_efl_net_server_clients_count_get(Eo *o EINA_UNUSED, Efl_Net_Server_Fd_Data *pd)
+_efl_net_server_fd_efl_net_server_clients_count_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Fd_Data *pd)
{
return pd->clients_count;
}
@@ -186,7 +186,7 @@ _efl_net_server_fd_efl_net_server_clients_limit_set(Eo *o EINA_UNUSED, Efl_Net_S
}
EOLIAN static void
-_efl_net_server_fd_efl_net_server_clients_limit_get(Eo *o EINA_UNUSED, Efl_Net_Server_Fd_Data *pd, unsigned int *limit, Eina_Bool *reject_excess)
+_efl_net_server_fd_efl_net_server_clients_limit_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Fd_Data *pd, unsigned int *limit, Eina_Bool *reject_excess)
{
if (limit) *limit = pd->clients_limit;
if (reject_excess) *reject_excess = pd->clients_reject_excess;
@@ -209,7 +209,7 @@ _efl_net_server_fd_efl_net_server_serve(Eo *o EINA_UNUSED, Efl_Net_Server_Fd_Dat
}
EOLIAN static Eina_Bool
-_efl_net_server_fd_efl_net_server_serving_get(Eo *o EINA_UNUSED, Efl_Net_Server_Fd_Data *pd)
+_efl_net_server_fd_efl_net_server_serving_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Fd_Data *pd)
{
return pd->serving;
}
@@ -296,7 +296,7 @@ _efl_net_server_fd_close_on_exec_set(Eo *o, Efl_Net_Server_Fd_Data *pd, Eina_Boo
}
EOLIAN static Eina_Bool
-_efl_net_server_fd_close_on_exec_get(Eo *o, Efl_Net_Server_Fd_Data *pd)
+_efl_net_server_fd_close_on_exec_get(const Eo *o, Efl_Net_Server_Fd_Data *pd)
{
#ifdef FD_CLOEXEC
SOCKET fd;
@@ -347,7 +347,7 @@ _efl_net_server_fd_reuse_address_set(Eo *o, Efl_Net_Server_Fd_Data *pd, Eina_Boo
}
EOLIAN static Eina_Bool
-_efl_net_server_fd_reuse_address_get(Eo *o, Efl_Net_Server_Fd_Data *pd)
+_efl_net_server_fd_reuse_address_get(const Eo *o, Efl_Net_Server_Fd_Data *pd)
{
SOCKET fd;
int value = 0;
@@ -402,7 +402,7 @@ _efl_net_server_fd_reuse_port_set(Eo *o, Efl_Net_Server_Fd_Data *pd, Eina_Bool r
}
EOLIAN static Eina_Bool
-_efl_net_server_fd_reuse_port_get(Eo *o, Efl_Net_Server_Fd_Data *pd)
+_efl_net_server_fd_reuse_port_get(const Eo *o, Efl_Net_Server_Fd_Data *pd)
{
#ifdef SO_REUSEPORT
SOCKET fd;
@@ -438,7 +438,7 @@ _efl_net_server_fd_family_set(Eo *o EINA_UNUSED, Efl_Net_Server_Fd_Data *pd, int
}
EOLIAN static int
-_efl_net_server_fd_family_get(Eo *o EINA_UNUSED, Efl_Net_Server_Fd_Data *pd)
+_efl_net_server_fd_family_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Fd_Data *pd)
{
return pd->family;
}
diff --git a/src/lib/ecore_con/efl_net_server_fd.eo b/src/lib/ecore_con/efl_net_server_fd.eo
index db558ec6d7..f02091a1b4 100644
--- a/src/lib/ecore_con/efl_net_server_fd.eo
+++ b/src/lib/ecore_con/efl_net_server_fd.eo
@@ -1,4 +1,4 @@
-class Efl.Net.Server.Fd (Efl.Loop.Fd, Efl.Net.Server) {
+class Efl.Net.Server_Fd (Efl.Loop_Fd, Efl.Net.Server) {
[[A generic server based on file descriptors.
@since 1.19
@@ -58,7 +58,7 @@ class Efl.Net.Server.Fd (Efl.Loop.Fd, Efl.Net.Server) {
It will be one of AF_INET (IPv4), AF_INET6 (IPv6),
AF_UNIX...
- It must be set before the @Efl.Loop.Fd.fd.set is called
+ It must be set before the @Efl.Loop_Fd.fd.set is called
with a valid file descriptor.
]]
get { }
@@ -115,7 +115,7 @@ class Efl.Net.Server.Fd (Efl.Loop.Fd, Efl.Net.Server) {
else, such as in SOCK_DGRAM (UDP) there is no accept(),
only recvfrom().
- It is called straight from @Efl.Loop.Fd "read" event
+ It is called straight from @Efl.Loop_Fd "read" event
handler and is provided as a method to allow easy
extending of the class for various purposes.
]]
@@ -155,7 +155,7 @@ class Efl.Net.Server.Fd (Efl.Loop.Fd, Efl.Net.Server) {
Efl.Object.finalize;
Efl.Object.constructor;
Efl.Object.destructor;
- Efl.Loop.Fd.fd { set; }
+ Efl.Loop_Fd.fd { set; }
Efl.Net.Server.address { get; set; }
Efl.Net.Server.clients_count { get; set; }
Efl.Net.Server.clients_limit { get; set; }
diff --git a/src/lib/ecore_con/efl_net_server_ip.c b/src/lib/ecore_con/efl_net_server_ip.c
index 210af3bc1e..ea7770a695 100644
--- a/src/lib/ecore_con/efl_net_server_ip.c
+++ b/src/lib/ecore_con/efl_net_server_ip.c
@@ -74,7 +74,7 @@ _efl_net_server_ip_ipv6_only_set(Eo *o, Efl_Net_Server_Ip_Data *pd, Eina_Bool ip
}
EOLIAN Eina_Bool
-_efl_net_server_ip_ipv6_only_get(Eo *o EINA_UNUSED, Efl_Net_Server_Ip_Data *pd)
+_efl_net_server_ip_ipv6_only_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Ip_Data *pd)
{
return pd->ipv6_only;
}
diff --git a/src/lib/ecore_con/efl_net_server_ip.eo b/src/lib/ecore_con/efl_net_server_ip.eo
index 466a1c1b1d..2c0a6bcbd3 100644
--- a/src/lib/ecore_con/efl_net_server_ip.eo
+++ b/src/lib/ecore_con/efl_net_server_ip.eo
@@ -1,4 +1,4 @@
-class Efl.Net.Server.Ip (Efl.Net.Server.Fd) {
+class Efl.Net.Server_Ip (Efl.Net.Server_Fd) {
[[An IP server.
@since 1.20
diff --git a/src/lib/ecore_con/efl_net_server_simple.c b/src/lib/ecore_con/efl_net_server_simple.c
index 479948b2e0..8c0c4a6732 100644
--- a/src/lib/ecore_con/efl_net_server_simple.c
+++ b/src/lib/ecore_con/efl_net_server_simple.c
@@ -149,7 +149,6 @@ _efl_net_server_simple_efl_object_finalize(Eo *o, Efl_Net_Server_Simple_Data *pd
DBG("created new inner server %p (%s)", server, efl_class_name_get(efl_class_get(server)));
efl_net_server_simple_inner_server_set(o, server);
- efl_unref(server);
}
end:
@@ -157,18 +156,19 @@ _efl_net_server_simple_efl_object_finalize(Eo *o, Efl_Net_Server_Simple_Data *pd
}
EOLIAN static void
-_efl_net_server_simple_efl_object_destructor(Eo *o, Efl_Net_Server_Simple_Data *pd)
+_efl_net_server_simple_efl_object_invalidate(Eo *o, Efl_Net_Server_Simple_Data *pd)
{
- if (pd->inner_class) pd->inner_class = NULL;
-
if (pd->inner_server)
{
efl_event_callback_array_del(pd->inner_server, _efl_net_server_simple_inner_server_cbs(), o);
- if (efl_parent_get(pd->inner_server) == o)
- efl_parent_set(pd->inner_server, NULL);
+
+ efl_xunref(pd->inner_server, o);
+ pd->inner_server = NULL;
}
- efl_destructor(efl_super(o, MY_CLASS));
+ pd->inner_class = NULL;
+
+ efl_invalidate(efl_super(o, MY_CLASS));
}
EOLIAN static Eina_Error
@@ -178,13 +178,13 @@ _efl_net_server_simple_efl_net_server_serve(Eo *o EINA_UNUSED, Efl_Net_Server_Si
}
EOLIAN static const char *
-_efl_net_server_simple_efl_net_server_address_get(Eo *o EINA_UNUSED, Efl_Net_Server_Simple_Data *pd)
+_efl_net_server_simple_efl_net_server_address_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Simple_Data *pd)
{
return efl_net_server_address_get(pd->inner_server);
}
EOLIAN static unsigned int
-_efl_net_server_simple_efl_net_server_clients_count_get(Eo *o EINA_UNUSED, Efl_Net_Server_Simple_Data *pd)
+_efl_net_server_simple_efl_net_server_clients_count_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Simple_Data *pd)
{
return efl_net_server_clients_count_get(pd->inner_server);
}
@@ -196,13 +196,13 @@ _efl_net_server_simple_efl_net_server_clients_limit_set(Eo *o EINA_UNUSED, Efl_N
}
EOLIAN static void
-_efl_net_server_simple_efl_net_server_clients_limit_get(Eo *o EINA_UNUSED, Efl_Net_Server_Simple_Data *pd, unsigned int *limit, Eina_Bool *reject_excess)
+_efl_net_server_simple_efl_net_server_clients_limit_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Simple_Data *pd, unsigned int *limit, Eina_Bool *reject_excess)
{
efl_net_server_clients_limit_get(pd->inner_server, limit, reject_excess);
}
EOLIAN static Eina_Bool
-_efl_net_server_simple_efl_net_server_serving_get(Eo *o EINA_UNUSED, Efl_Net_Server_Simple_Data *pd)
+_efl_net_server_simple_efl_net_server_serving_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Simple_Data *pd)
{
return efl_net_server_serving_get(pd->inner_server);
}
@@ -217,7 +217,7 @@ _efl_net_server_simple_inner_class_set(Eo *o, Efl_Net_Server_Simple_Data *pd, co
}
EOLIAN static const Efl_Class *
-_efl_net_server_simple_inner_class_get(Eo *o EINA_UNUSED, Efl_Net_Server_Simple_Data *pd)
+_efl_net_server_simple_inner_class_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Simple_Data *pd)
{
return pd->inner_class;
}
@@ -230,13 +230,13 @@ _efl_net_server_simple_inner_server_set(Eo *o, Efl_Net_Server_Simple_Data *pd, E
EINA_SAFETY_ON_TRUE_RETURN(pd->inner_server != NULL);
EINA_SAFETY_ON_FALSE_RETURN(efl_isa(server, EFL_NET_SERVER_INTERFACE));
- pd->inner_server = efl_ref(server);
+ pd->inner_server = efl_xref(server, o);
efl_event_callback_array_add(server, _efl_net_server_simple_inner_server_cbs(), o);
DBG("%p inner_server=%p (%s)", o, server, efl_class_name_get(efl_class_get(server)));
}
EOLIAN static Efl_Object *
-_efl_net_server_simple_inner_server_get(Eo *o EINA_UNUSED, Efl_Net_Server_Simple_Data *pd)
+_efl_net_server_simple_inner_server_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Simple_Data *pd)
{
return pd->inner_server;
}
diff --git a/src/lib/ecore_con/efl_net_server_simple.eo b/src/lib/ecore_con/efl_net_server_simple.eo
index 0b76579348..6e3e5760c9 100644
--- a/src/lib/ecore_con/efl_net_server_simple.eo
+++ b/src/lib/ecore_con/efl_net_server_simple.eo
@@ -1,5 +1,5 @@
-class Efl.Net.Server.Simple (Efl.Loop.Consumer, Efl.Net.Server) {
- [[A network server wrapper that creates clients based on @Efl.Net.Socket.Simple.
+class Efl.Net.Server_Simple (Efl.Loop_Consumer, Efl.Net.Server) {
+ [[A network server wrapper that creates clients based on @Efl.Net.Socket_Simple.
This is just a wrapper server. It takes an actual server
using @.inner_server or creates one using @.inner_class.
@@ -44,7 +44,7 @@ class Efl.Net.Server.Simple (Efl.Loop.Consumer, Efl.Net.Server) {
implements {
Efl.Object.finalize;
- Efl.Object.destructor;
+ Efl.Object.invalidate;
Efl.Net.Server.serve;
Efl.Net.Server.client_announce;
Efl.Net.Server.address { get; }
diff --git a/src/lib/ecore_con/efl_net_server_ssl.c b/src/lib/ecore_con/efl_net_server_ssl.c
index 0cf56cf8e8..1e9a6482ff 100644
--- a/src/lib/ecore_con/efl_net_server_ssl.c
+++ b/src/lib/ecore_con/efl_net_server_ssl.c
@@ -89,7 +89,7 @@ _efl_net_server_ssl_efl_net_server_fd_client_add(Eo *o, Efl_Net_Server_Ssl_Data
client_tcp = efl_add(EFL_NET_SOCKET_TCP_CLASS, o,
efl_io_closer_close_on_exec_set(efl_added, efl_net_server_fd_close_on_exec_get(o)),
- efl_io_closer_close_on_destructor_set(efl_added, EINA_TRUE),
+ efl_io_closer_close_on_invalidate_set(efl_added, EINA_TRUE),
efl_loop_fd_set(efl_added, client_fd));
if (!client_tcp)
{
@@ -149,14 +149,16 @@ _efl_net_server_ssl_ctx_del(void *data, const Efl_Event *event EINA_UNUSED)
}
EOLIAN void
-_efl_net_server_ssl_efl_object_destructor(Eo *o, Efl_Net_Server_Ssl_Data *pd)
+_efl_net_server_ssl_efl_object_invalidate(Eo *o, Efl_Net_Server_Ssl_Data *pd)
{
- if (pd->server)
- {
- efl_del(pd->server);
- pd->server = NULL;
- }
+ pd->server = NULL;
+
+ efl_invalidate(efl_super(o, MY_CLASS));
+}
+EOLIAN void
+_efl_net_server_ssl_efl_object_destructor(Eo *o, Efl_Net_Server_Ssl_Data *pd)
+{
if (pd->ssl_ctx)
{
efl_event_callback_del(pd->ssl_ctx, EFL_EVENT_DEL, _efl_net_server_ssl_ctx_del, o);
@@ -180,7 +182,7 @@ _efl_net_server_ssl_ssl_context_set(Eo *o EINA_UNUSED, Efl_Net_Server_Ssl_Data *
}
EOLIAN static Eo *
-_efl_net_server_ssl_ssl_context_get(Eo *o EINA_UNUSED, Efl_Net_Server_Ssl_Data *pd)
+_efl_net_server_ssl_ssl_context_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Ssl_Data *pd)
{
return pd->ssl_ctx;
}
diff --git a/src/lib/ecore_con/efl_net_server_ssl.eo b/src/lib/ecore_con/efl_net_server_ssl.eo
index b906b042b7..50ec24d80c 100644
--- a/src/lib/ecore_con/efl_net_server_ssl.eo
+++ b/src/lib/ecore_con/efl_net_server_ssl.eo
@@ -1,4 +1,4 @@
-class Efl.Net.Server.Ssl (Efl.Net.Server.Tcp) {
+class Efl.Net.Server_Ssl (Efl.Net.Server_Tcp) {
[[A SSL server over TCP.
@since 1.19
@@ -21,8 +21,9 @@ class Efl.Net.Server.Ssl (Efl.Net.Server.Tcp) {
implements {
Efl.Object.constructor;
+ Efl.Object.invalidate;
Efl.Object.destructor;
Efl.Net.Server.client_announce;
- Efl.Net.Server.Fd.client_add;
+ Efl.Net.Server_Fd.client_add;
}
}
diff --git a/src/lib/ecore_con/efl_net_server_tcp.c b/src/lib/ecore_con/efl_net_server_tcp.c
index a3a8e1fdae..e4e5bcb377 100644
--- a/src/lib/ecore_con/efl_net_server_tcp.c
+++ b/src/lib/ecore_con/efl_net_server_tcp.c
@@ -118,7 +118,7 @@ _efl_net_server_tcp_resolved(void *data, const char *host EINA_UNUSED, const cha
Eo *o = data;
Efl_Net_Server_Tcp_Data *pd = efl_data_scope_get(o, MY_CLASS);
const struct addrinfo *addr;
- Eina_Error err;
+ Eina_Error err = EINA_ERROR_NO_ERROR;
pd->resolver = NULL;
@@ -253,7 +253,7 @@ _efl_net_server_tcp_efl_net_server_fd_client_add(Eo *o, Efl_Net_Server_Tcp_Data
{
Eo *client = efl_add(EFL_NET_SOCKET_TCP_CLASS, o,
efl_io_closer_close_on_exec_set(efl_added, efl_net_server_fd_close_on_exec_get(o)),
- efl_io_closer_close_on_destructor_set(efl_added, EINA_TRUE),
+ efl_io_closer_close_on_invalidate_set(efl_added, EINA_TRUE),
efl_loop_fd_set(efl_added, client_fd));
if (!client)
{
diff --git a/src/lib/ecore_con/efl_net_server_tcp.eo b/src/lib/ecore_con/efl_net_server_tcp.eo
index b80fa100df..b7c63a35aa 100644
--- a/src/lib/ecore_con/efl_net_server_tcp.eo
+++ b/src/lib/ecore_con/efl_net_server_tcp.eo
@@ -1,4 +1,4 @@
-class Efl.Net.Server.Tcp (Efl.Net.Server.Ip) {
+class Efl.Net.Server_Tcp (Efl.Net.Server_Ip) {
[[A TCP server.
@since 1.19
@@ -7,8 +7,8 @@ class Efl.Net.Server.Tcp (Efl.Net.Server.Ip) {
implements {
Efl.Object.destructor;
Efl.Net.Server.serve;
- Efl.Net.Server.Fd.client_add;
- Efl.Net.Server.Fd.client_reject;
- Efl.Net.Server.Fd.socket_activate;
+ Efl.Net.Server_Fd.client_add;
+ Efl.Net.Server_Fd.client_reject;
+ Efl.Net.Server_Fd.socket_activate;
}
}
diff --git a/src/lib/ecore_con/efl_net_server_udp.c b/src/lib/ecore_con/efl_net_server_udp.c
index c3401d8b99..ced3e04662 100644
--- a/src/lib/ecore_con/efl_net_server_udp.c
+++ b/src/lib/ecore_con/efl_net_server_udp.c
@@ -369,7 +369,7 @@ _efl_net_server_udp_efl_net_server_fd_process_incoming_data(Eo *o, Efl_Net_Serve
}
client = efl_add(EFL_NET_SERVER_UDP_CLIENT_CLASS, o,
- efl_io_closer_close_on_destructor_set(efl_added, EINA_TRUE),
+ efl_io_closer_close_on_invalidate_set(efl_added, EINA_TRUE),
efl_net_socket_address_local_set(efl_added, efl_net_server_address_get(o)),
_efl_net_server_udp_client_init(efl_added, fd, (const struct sockaddr *)&addr, addrlen, str),
@@ -425,7 +425,7 @@ _efl_net_server_udp_dont_route_set(Eo *o, Efl_Net_Server_Udp_Data *pd, Eina_Bool
}
EOLIAN static Eina_Bool
-_efl_net_server_udp_dont_route_get(Eo *o, Efl_Net_Server_Udp_Data *pd)
+_efl_net_server_udp_dont_route_get(const Eo *o, Efl_Net_Server_Udp_Data *pd)
{
SOCKET fd = efl_loop_fd_get(o);
#ifdef _WIN32
@@ -545,7 +545,7 @@ _efl_net_server_udp_multicast_time_to_live_set(Eo *o, Efl_Net_Server_Udp_Data *p
}
EOLIAN static uint8_t
-_efl_net_server_udp_multicast_time_to_live_get(Eo *o, Efl_Net_Server_Udp_Data *pd)
+_efl_net_server_udp_multicast_time_to_live_get(const Eo *o, Efl_Net_Server_Udp_Data *pd)
{
SOCKET fd = efl_loop_fd_get(o);
Eina_Error err;
@@ -584,7 +584,7 @@ _efl_net_server_udp_multicast_loopback_set(Eo *o, Efl_Net_Server_Udp_Data *pd, E
}
EOLIAN static Eina_Bool
-_efl_net_server_udp_multicast_loopback_get(Eo *o, Efl_Net_Server_Udp_Data *pd)
+_efl_net_server_udp_multicast_loopback_get(const Eo *o, Efl_Net_Server_Udp_Data *pd)
{
SOCKET fd = efl_loop_fd_get(o);
Eina_Error err;
diff --git a/src/lib/ecore_con/efl_net_server_udp.eo b/src/lib/ecore_con/efl_net_server_udp.eo
index e8ad012cfd..afc5949c4e 100644
--- a/src/lib/ecore_con/efl_net_server_udp.eo
+++ b/src/lib/ecore_con/efl_net_server_udp.eo
@@ -1,4 +1,4 @@
-class Efl.Net.Server.Udp (Efl.Net.Server.Ip) {
+class Efl.Net.Server_Udp (Efl.Net.Server_Ip) {
[[A UDP server.
@since 1.19
@@ -97,7 +97,7 @@ class Efl.Net.Server.Udp (Efl.Net.Server.Ip) {
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Net.Server.serve;
- Efl.Net.Server.Fd.process_incoming_data;
- Efl.Net.Server.Fd.socket_activate;
+ Efl.Net.Server_Fd.process_incoming_data;
+ Efl.Net.Server_Fd.socket_activate;
}
}
diff --git a/src/lib/ecore_con/efl_net_server_udp_client.c b/src/lib/ecore_con/efl_net_server_udp_client.c
index 134a05cb65..52a9d38008 100644
--- a/src/lib/ecore_con/efl_net_server_udp_client.c
+++ b/src/lib/ecore_con/efl_net_server_udp_client.c
@@ -42,7 +42,7 @@ typedef struct _Efl_Net_Server_Udp_Client_Data
struct sockaddr *addr_remote;
socklen_t addr_remote_len;
SOCKET fd;
- Eina_Bool close_on_destructor;
+ Eina_Bool close_on_invalidate;
Eina_Bool eos;
Eina_Bool can_read;
Eina_Bool can_write;
@@ -71,9 +71,9 @@ _efl_net_server_udp_client_cleanup(Efl_Net_Server_Udp_Client_Data *pd)
}
EOLIAN static void
-_efl_net_server_udp_client_efl_object_destructor(Eo *o, Efl_Net_Server_Udp_Client_Data *pd)
+_efl_net_server_udp_client_efl_object_invalidate(Eo *o, Efl_Net_Server_Udp_Client_Data *pd EINA_UNUSED)
{
- if (efl_io_closer_close_on_destructor_get(o) &&
+ if (efl_io_closer_close_on_invalidate_get(o) &&
(!efl_io_closer_closed_get(o)))
{
efl_event_freeze(o);
@@ -81,6 +81,12 @@ _efl_net_server_udp_client_efl_object_destructor(Eo *o, Efl_Net_Server_Udp_Clien
efl_event_thaw(o);
}
+ efl_invalidate(efl_super(o, MY_CLASS));
+}
+
+EOLIAN static void
+_efl_net_server_udp_client_efl_object_destructor(Eo *o, Efl_Net_Server_Udp_Client_Data *pd)
+{
efl_destructor(efl_super(o, MY_CLASS));
_efl_net_server_udp_client_cleanup(pd);
@@ -217,7 +223,7 @@ _efl_net_server_udp_client_efl_io_writer_write(Eo *o, Efl_Net_Server_Udp_Client_
}
EOLIAN static Eina_Bool
-_efl_net_server_udp_client_efl_io_reader_can_read_get(Eo *o EINA_UNUSED, Efl_Net_Server_Udp_Client_Data *pd)
+_efl_net_server_udp_client_efl_io_reader_can_read_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Udp_Client_Data *pd)
{
return pd->can_read;
}
@@ -232,7 +238,7 @@ _efl_net_server_udp_client_efl_io_reader_can_read_set(Eo *o, Efl_Net_Server_Udp_
}
EOLIAN static Eina_Bool
-_efl_net_server_udp_client_efl_io_reader_eos_get(Eo *o EINA_UNUSED, Efl_Net_Server_Udp_Client_Data *pd)
+_efl_net_server_udp_client_efl_io_reader_eos_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Udp_Client_Data *pd)
{
return pd->eos;
}
@@ -248,7 +254,7 @@ _efl_net_server_udp_client_efl_io_reader_eos_set(Eo *o, Efl_Net_Server_Udp_Clien
}
EOLIAN static Eina_Bool
-_efl_net_server_udp_client_efl_io_writer_can_write_get(Eo *o EINA_UNUSED, Efl_Net_Server_Udp_Client_Data *pd)
+_efl_net_server_udp_client_efl_io_writer_can_write_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Udp_Client_Data *pd)
{
return pd->can_write;
}
@@ -263,21 +269,21 @@ _efl_net_server_udp_client_efl_io_writer_can_write_set(Eo *o, Efl_Net_Server_Udp
}
EOLIAN static Eina_Bool
-_efl_net_server_udp_client_efl_io_closer_closed_get(Eo *o EINA_UNUSED, Efl_Net_Server_Udp_Client_Data *pd)
+_efl_net_server_udp_client_efl_io_closer_closed_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Udp_Client_Data *pd)
{
return pd->fd == INVALID_SOCKET;
}
EOLIAN static void
-_efl_net_server_udp_client_efl_io_closer_close_on_destructor_set(Eo *o EINA_UNUSED, Efl_Net_Server_Udp_Client_Data *pd, Eina_Bool close_on_destructor)
+_efl_net_server_udp_client_efl_io_closer_close_on_invalidate_set(Eo *o EINA_UNUSED, Efl_Net_Server_Udp_Client_Data *pd, Eina_Bool close_on_invalidate)
{
- pd->close_on_destructor = close_on_destructor;
+ pd->close_on_invalidate = close_on_invalidate;
}
EOLIAN static Eina_Bool
-_efl_net_server_udp_client_efl_io_closer_close_on_destructor_get(Eo *o EINA_UNUSED, Efl_Net_Server_Udp_Client_Data *pd)
+_efl_net_server_udp_client_efl_io_closer_close_on_invalidate_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Udp_Client_Data *pd)
{
- return pd->close_on_destructor;
+ return pd->close_on_invalidate;
}
EOLIAN static Eina_Bool
@@ -293,7 +299,7 @@ _efl_net_server_udp_client_efl_io_closer_close_on_exec_set(Eo *o, Efl_Net_Server
}
EOLIAN static Eina_Bool
-_efl_net_server_udp_client_efl_io_closer_close_on_exec_get(Eo *o, Efl_Net_Server_Udp_Client_Data *pd EINA_UNUSED)
+_efl_net_server_udp_client_efl_io_closer_close_on_exec_get(const Eo *o, Efl_Net_Server_Udp_Client_Data *pd EINA_UNUSED)
{
return efl_net_server_fd_close_on_exec_get(efl_parent_get(o));
}
@@ -305,7 +311,7 @@ _efl_net_server_udp_client_efl_net_socket_address_local_set(Eo *o EINA_UNUSED, E
}
EOLIAN static const char *
-_efl_net_server_udp_client_efl_net_socket_address_local_get(Eo *o EINA_UNUSED, Efl_Net_Server_Udp_Client_Data *pd)
+_efl_net_server_udp_client_efl_net_socket_address_local_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Udp_Client_Data *pd)
{
return pd->address_local;
}
@@ -317,7 +323,7 @@ _efl_net_server_udp_client_efl_net_socket_address_remote_set(Eo *o EINA_UNUSED,
}
EOLIAN static const char *
-_efl_net_server_udp_client_efl_net_socket_address_remote_get(Eo *o EINA_UNUSED, Efl_Net_Server_Udp_Client_Data *pd)
+_efl_net_server_udp_client_efl_net_socket_address_remote_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Udp_Client_Data *pd)
{
return pd->address_remote;
}
diff --git a/src/lib/ecore_con/efl_net_server_udp_client.eo b/src/lib/ecore_con/efl_net_server_udp_client.eo
index f8ecc8bd0f..6eeeedef31 100644
--- a/src/lib/ecore_con/efl_net_server_udp_client.eo
+++ b/src/lib/ecore_con/efl_net_server_udp_client.eo
@@ -1,5 +1,5 @@
-class Efl.Net.Server.Udp.Client (Efl.Object, Efl.Net.Socket) {
- [[A UDP client child of Efl.Net.Server.Udp
+class Efl.Net.Server_Udp_Client (Efl.Object, Efl.Net.Socket) {
+ [[A UDP client child of Efl.Net.Server_Udp
Unlike connection protocols such as TCP or Local, UDP doesn't
create extra sockets for its "clients". This thin class
@@ -26,10 +26,11 @@ class Efl.Net.Server.Udp.Client (Efl.Object, Efl.Net.Socket) {
implements {
Efl.Object.finalize;
+ Efl.Object.invalidate;
Efl.Object.destructor;
Efl.Io.Closer.close;
Efl.Io.Closer.closed { get; }
- Efl.Io.Closer.close_on_destructor { get; set; }
+ Efl.Io.Closer.close_on_invalidate { get; set; }
Efl.Io.Closer.close_on_exec { get; set; }
Efl.Io.Reader.can_read { get; set; }
Efl.Io.Reader.eos { get; set; }
diff --git a/src/lib/ecore_con/efl_net_server_unix.c b/src/lib/ecore_con/efl_net_server_unix.c
index 65f2b255e1..38280c27c8 100644
--- a/src/lib/ecore_con/efl_net_server_unix.c
+++ b/src/lib/ecore_con/efl_net_server_unix.c
@@ -246,7 +246,7 @@ _efl_net_server_unix_efl_net_server_fd_client_add(Eo *o, Efl_Net_Server_Unix_Dat
{
Eo *client = efl_add(EFL_NET_SOCKET_UNIX_CLASS, o,
efl_io_closer_close_on_exec_set(efl_added, efl_net_server_fd_close_on_exec_get(o)),
- efl_io_closer_close_on_destructor_set(efl_added, EINA_TRUE),
+ efl_io_closer_close_on_invalidate_set(efl_added, EINA_TRUE),
efl_loop_fd_set(efl_added, client_fd));
if (!client)
{
@@ -285,7 +285,7 @@ _efl_net_server_unix_unlink_before_bind_set(Eo *o EINA_UNUSED, Efl_Net_Server_Un
}
static Eina_Bool
-_efl_net_server_unix_unlink_before_bind_get(Eo *o EINA_UNUSED, Efl_Net_Server_Unix_Data *pd)
+_efl_net_server_unix_unlink_before_bind_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Unix_Data *pd)
{
return pd->unlink_before_bind;
}
@@ -299,7 +299,7 @@ _efl_net_server_unix_leading_directories_create_set(Eo *o EINA_UNUSED, Efl_Net_S
}
static void
-_efl_net_server_unix_leading_directories_create_get(Eo *o EINA_UNUSED, Efl_Net_Server_Unix_Data *pd, Eina_Bool *do_it, unsigned int *mode)
+_efl_net_server_unix_leading_directories_create_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Unix_Data *pd, Eina_Bool *do_it, unsigned int *mode)
{
if (do_it) *do_it = pd->leading_directories_create;
if (mode) *mode = pd->leading_directories_create_mode;
diff --git a/src/lib/ecore_con/efl_net_server_unix.eo b/src/lib/ecore_con/efl_net_server_unix.eo
index f521fda3a9..9e82ea6e7f 100644
--- a/src/lib/ecore_con/efl_net_server_unix.eo
+++ b/src/lib/ecore_con/efl_net_server_unix.eo
@@ -1,4 +1,4 @@
-class Efl.Net.Server.Unix (Efl.Net.Server.Fd) {
+class Efl.Net.Server_Unix (Efl.Net.Server_Fd) {
[[An AF_UNIX server.
The @Efl.Net.Server.serve method will call bind(2) directly.
@@ -40,8 +40,8 @@ class Efl.Net.Server.Unix (Efl.Net.Server.Fd) {
implements {
Efl.Object.destructor;
Efl.Net.Server.serve;
- Efl.Net.Server.Fd.client_add;
- Efl.Net.Server.Fd.client_reject;
- Efl.Net.Server.Fd.socket_activate;
+ Efl.Net.Server_Fd.client_add;
+ Efl.Net.Server_Fd.client_reject;
+ Efl.Net.Server_Fd.socket_activate;
}
}
diff --git a/src/lib/ecore_con/efl_net_server_windows.c b/src/lib/ecore_con/efl_net_server_windows.c
index 1fa517c9e1..1e0375ead1 100644
--- a/src/lib/ecore_con/efl_net_server_windows.c
+++ b/src/lib/ecore_con/efl_net_server_windows.c
@@ -231,7 +231,7 @@ _efl_net_server_windows_client_new(Eo *o, Efl_Net_Server_Windows_Data *pd)
}
pd->next_client = efl_add(EFL_NET_SOCKET_WINDOWS_CLASS, o,
- efl_io_closer_close_on_destructor_set(efl_added, EINA_TRUE));
+ efl_io_closer_close_on_invalidate_set(efl_added, EINA_TRUE));
if (!pd->next_client)
{
err = ENOMEM;
@@ -263,7 +263,7 @@ _efl_net_server_windows_allow_remote_set(Eo *o EINA_UNUSED, Efl_Net_Server_Windo
}
EOLIAN static Eina_Bool
-_efl_net_server_windows_allow_remote_get(Eo *o EINA_UNUSED, Efl_Net_Server_Windows_Data *pd)
+_efl_net_server_windows_allow_remote_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Windows_Data *pd)
{
return pd->allow_remote;
}
@@ -277,14 +277,16 @@ _efl_net_server_windows_efl_object_constructor(Eo *o, Efl_Net_Server_Windows_Dat
}
EOLIAN static void
-_efl_net_server_windows_efl_object_destructor(Eo *o, Efl_Net_Server_Windows_Data *pd)
+_efl_net_server_windows_efl_object_invalidate(Eo *o, Efl_Net_Server_Windows_Data *pd)
{
- if (pd->next_client)
- {
- efl_del(pd->next_client);
- pd->next_client = NULL;
- }
+ pd->next_client = NULL;
+
+ efl_invalidate(efl_super(o, MY_CLASS));
+}
+EOLIAN static void
+_efl_net_server_windows_efl_object_destructor(Eo *o, Efl_Net_Server_Windows_Data *pd)
+{
while (pd->pending_clients)
{
Eo *client = pd->pending_clients->data;
@@ -304,7 +306,7 @@ _efl_net_server_windows_efl_net_server_address_set(Eo *o EINA_UNUSED, Efl_Net_Se
}
EOLIAN static const char *
-_efl_net_server_windows_efl_net_server_address_get(Eo *o EINA_UNUSED, Efl_Net_Server_Windows_Data *pd)
+_efl_net_server_windows_efl_net_server_address_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Windows_Data *pd)
{
return pd->address + strlen(PIPE_NS);
}
@@ -353,7 +355,7 @@ _efl_net_server_windows_efl_net_server_clients_count_set(Eo *o, Efl_Net_Server_W
}
EOLIAN static unsigned int
-_efl_net_server_windows_efl_net_server_clients_count_get(Eo *o EINA_UNUSED, Efl_Net_Server_Windows_Data *pd)
+_efl_net_server_windows_efl_net_server_clients_count_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Windows_Data *pd)
{
return pd->clients_count;
}
@@ -379,7 +381,7 @@ _efl_net_server_windows_efl_net_server_clients_limit_set(Eo *o EINA_UNUSED, Efl_
}
EOLIAN static void
-_efl_net_server_windows_efl_net_server_clients_limit_get(Eo *o EINA_UNUSED, Efl_Net_Server_Windows_Data *pd, unsigned int *limit, Eina_Bool *reject_excess)
+_efl_net_server_windows_efl_net_server_clients_limit_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Windows_Data *pd, unsigned int *limit, Eina_Bool *reject_excess)
{
if (limit) *limit = pd->clients_limit;
if (reject_excess) *reject_excess = pd->clients_reject_excess;
@@ -395,7 +397,7 @@ _efl_net_server_windows_efl_net_server_serving_set(Eo *o EINA_UNUSED, Efl_Net_Se
}
EOLIAN static Eina_Bool
-_efl_net_server_windows_efl_net_server_serving_get(Eo *o EINA_UNUSED, Efl_Net_Server_Windows_Data *pd)
+_efl_net_server_windows_efl_net_server_serving_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Windows_Data *pd)
{
return pd->serving;
}
diff --git a/src/lib/ecore_con/efl_net_server_windows.eo b/src/lib/ecore_con/efl_net_server_windows.eo
index 88d034b6cd..955d972430 100644
--- a/src/lib/ecore_con/efl_net_server_windows.eo
+++ b/src/lib/ecore_con/efl_net_server_windows.eo
@@ -1,4 +1,4 @@
-class Efl.Net.Server.Windows (Efl.Loop.Consumer, Efl.Net.Server) {
+class Efl.Net.Server_Windows (Efl.Loop_Consumer, Efl.Net.Server) {
[[A Windows NamedPipe server.
The @Efl.Net.Server.serve method calls CreateNamedPipe()
@@ -25,6 +25,7 @@ class Efl.Net.Server.Windows (Efl.Loop.Consumer, Efl.Net.Server) {
implements {
Efl.Object.constructor;
+ Efl.Object.invalidate;
Efl.Object.destructor;
Efl.Net.Server.address { get; set; }
Efl.Net.Server.clients_count { get; set; }
diff --git a/src/lib/ecore_con/efl_net_session-connman.c b/src/lib/ecore_con/efl_net_session-connman.c
index f414d986dd..bcbc173eaf 100644
--- a/src/lib/ecore_con/efl_net_session-connman.c
+++ b/src/lib/ecore_con/efl_net_session-connman.c
@@ -618,31 +618,31 @@ _efl_net_session_efl_object_destructor(Eo *o, Efl_Net_Session_Data *pd)
}
EOLIAN static const char *
-_efl_net_session_name_get(Eo *o EINA_UNUSED, Efl_Net_Session_Data *pd)
+_efl_net_session_network_name_get(const Eo *o EINA_UNUSED, Efl_Net_Session_Data *pd)
{
return pd->name;
}
EOLIAN static Efl_Net_Session_State
-_efl_net_session_state_get(Eo *o EINA_UNUSED, Efl_Net_Session_Data *pd)
+_efl_net_session_state_get(const Eo *o EINA_UNUSED, Efl_Net_Session_Data *pd)
{
return pd->state;
}
EOLIAN static Efl_Net_Session_Technology
-_efl_net_session_technology_get(Eo *o EINA_UNUSED, Efl_Net_Session_Data *pd)
+_efl_net_session_technology_get(const Eo *o EINA_UNUSED, Efl_Net_Session_Data *pd)
{
return pd->technology;
}
EOLIAN static const char *
-_efl_net_session_interface_get(Eo *o EINA_UNUSED, Efl_Net_Session_Data *pd)
+_efl_net_session_interface_get(const Eo *o EINA_UNUSED, Efl_Net_Session_Data *pd)
{
return pd->interface;
}
EOLIAN static void
-_efl_net_session_ipv4_get(Eo *o EINA_UNUSED, Efl_Net_Session_Data *pd, const char **address, const char **netmask, const char **gateway)
+_efl_net_session_ipv4_get(const Eo *o EINA_UNUSED, Efl_Net_Session_Data *pd, const char **address, const char **netmask, const char **gateway)
{
if (address) *address = pd->ipv4.address;
if (netmask) *netmask = pd->ipv4.netmask;
@@ -650,7 +650,7 @@ _efl_net_session_ipv4_get(Eo *o EINA_UNUSED, Efl_Net_Session_Data *pd, const cha
}
EOLIAN static void
-_efl_net_session_ipv6_get(Eo *o EINA_UNUSED, Efl_Net_Session_Data *pd, const char **address, uint8_t *prefix_length, const char **netmask, const char **gateway)
+_efl_net_session_ipv6_get(const Eo *o EINA_UNUSED, Efl_Net_Session_Data *pd, const char **address, uint8_t *prefix_length, const char **netmask, const char **gateway)
{
if (address) *address = pd->ipv6.address;
if (netmask) *netmask = pd->ipv6.netmask;
diff --git a/src/lib/ecore_con/efl_net_session-none.c b/src/lib/ecore_con/efl_net_session-none.c
index 6545520dda..8f0bac2219 100644
--- a/src/lib/ecore_con/efl_net_session-none.c
+++ b/src/lib/ecore_con/efl_net_session-none.c
@@ -33,31 +33,31 @@ _efl_net_session_efl_object_finalize(Eo *obj, Efl_Net_Session_Data *pd EINA_UNUS
}
EOLIAN static const char *
-_efl_net_session_name_get(Eo *obj EINA_UNUSED, Efl_Net_Session_Data *pd EINA_UNUSED)
+_efl_net_session_network_name_get(const Eo *obj EINA_UNUSED, Efl_Net_Session_Data *pd EINA_UNUSED)
{
return NULL;
}
EOLIAN static Efl_Net_Session_State
-_efl_net_session_state_get(Eo *obj EINA_UNUSED, Efl_Net_Session_Data *pd EINA_UNUSED)
+_efl_net_session_state_get(const Eo *obj EINA_UNUSED, Efl_Net_Session_Data *pd EINA_UNUSED)
{
return EFL_NET_SESSION_STATE_ONLINE; /* best default for unsupported, hope we're online */
}
EOLIAN static Efl_Net_Session_Technology
-_efl_net_session_technology_get(Eo *obj EINA_UNUSED, Efl_Net_Session_Data *pd EINA_UNUSED)
+_efl_net_session_technology_get(const Eo *obj EINA_UNUSED, Efl_Net_Session_Data *pd EINA_UNUSED)
{
return EFL_NET_SESSION_TECHNOLOGY_UNKNOWN;
}
EOLIAN static const char *
-_efl_net_session_interface_get(Eo *obj EINA_UNUSED, Efl_Net_Session_Data *pd EINA_UNUSED)
+_efl_net_session_interface_get(const Eo *obj EINA_UNUSED, Efl_Net_Session_Data *pd EINA_UNUSED)
{
return NULL;
}
EOLIAN static void
-_efl_net_session_ipv4_get(Eo *obj EINA_UNUSED, Efl_Net_Session_Data *pd EINA_UNUSED, const char **address, const char **netmask, const char **gateway)
+_efl_net_session_ipv4_get(const Eo *obj EINA_UNUSED, Efl_Net_Session_Data *pd EINA_UNUSED, const char **address, const char **netmask, const char **gateway)
{
if (address) *address = NULL;
if (netmask) *netmask = NULL;
@@ -65,7 +65,7 @@ _efl_net_session_ipv4_get(Eo *obj EINA_UNUSED, Efl_Net_Session_Data *pd EINA_UNU
}
EOLIAN static void
-_efl_net_session_ipv6_get(Eo *obj EINA_UNUSED, Efl_Net_Session_Data *pd EINA_UNUSED, const char **address, uint8_t *prefix_length, const char **netmask, const char **gateway)
+_efl_net_session_ipv6_get(const Eo *obj EINA_UNUSED, Efl_Net_Session_Data *pd EINA_UNUSED, const char **address, uint8_t *prefix_length, const char **netmask, const char **gateway)
{
if (address) *address = NULL;
if (prefix_length) *prefix_length = 0;
diff --git a/src/lib/ecore_con/efl_net_session.eo b/src/lib/ecore_con/efl_net_session.eo
index 6ae9db299f..87ca0d05fd 100644
--- a/src/lib/ecore_con/efl_net_session.eo
+++ b/src/lib/ecore_con/efl_net_session.eo
@@ -1,4 +1,4 @@
-enum Efl.Net.Session.State {
+enum Efl.Net.Session_State {
[[Provides the session connectivity state.
@since 1.19
@@ -9,7 +9,7 @@ enum Efl.Net.Session.State {
}
/* keep in sync with efl_net_control_technology.eo, comment what doesn't make sense */
-enum Efl.Net.Session.Technology {
+enum Efl.Net.Session_Technology {
[[Bitwise-able technologies to allow for a network session.
@since 1.9
@@ -24,10 +24,10 @@ enum Efl.Net.Session.Technology {
vpn = (1 << 6), [[Type: Virtual Private Network]]
gadget = (1 << 7), [[Type: USB gadget]]
/* p2p = (1 << 8), [[Type: Peer-2-Peer]]*/
- all = (Efl.Net.Session.Technology.ethernet | Efl.Net.Session.Technology.wifi | Efl.Net.Session.Technology.bluetooth | Efl.Net.Session.Technology.cellular | Efl.Net.Session.Technology.vpn | Efl.Net.Session.Technology.gadget), [[All technology types]]
+ all = (Efl.Net.Session_Technology.ethernet | Efl.Net.Session_Technology.wifi | Efl.Net.Session_Technology.bluetooth | Efl.Net.Session_Technology.cellular | Efl.Net.Session_Technology.vpn | Efl.Net.Session_Technology.gadget), [[All technology types]]
}
-class Efl.Net.Session (Efl.Loop.Consumer) {
+class Efl.Net.Session (Efl.Loop_Consumer) {
[[Used by application to request network connectivity.
This API is targeted at applications that need access to the
@@ -37,9 +37,9 @@ class Efl.Net.Session (Efl.Loop.Consumer) {
Some platforms may not implement the backend for this class. In
this cases the system will report always @.state "online"
- (@Efl.Net.Session.State.online) and other properties will be
- NULL, such as @.name, @.interface, @.ipv4 and @.ipv6; as well as
- @.technology is set to @Efl.Net.Session.Technology.unknown. As such
+ (@Efl.Net.Session_State.online) and other properties will be
+ NULL, such as @.network_name, @.interface, @.ipv4 and @.ipv6; as well as
+ @.technology is set to @Efl.Net.Session_Technology.unknown. As such
if you need to detect for an actual backend, check if the
state is online but those properties are NULL or technology is
unknown.
@@ -51,7 +51,7 @@ class Efl.Net.Session (Efl.Loop.Consumer) {
@since 1.19
]]
events {
- changed; [[Called when some properties were changed.]]
+ changed: void; [[Called when some properties were changed.]]
}
methods {
@@ -70,7 +70,7 @@ class Efl.Net.Session (Efl.Loop.Consumer) {
]]
params {
online_required: bool; [[If $false, access points with local state are enough. If $true, the access point must be in online state, with a validated internet connection]]
- technologies_allowed: Efl.Net.Session.Technology; [[Bitwise OR of technologies to allow]]
+ technologies_allowed: Efl.Net.Session_Technology; [[Bitwise OR of technologies to allow]]
}
}
@@ -84,7 +84,7 @@ class Efl.Net.Session (Efl.Loop.Consumer) {
]]
}
- @property name {
+ @property network_name {
[[The user-friendly access point name.]]
get { }
values {
@@ -97,12 +97,12 @@ class Efl.Net.Session (Efl.Loop.Consumer) {
\@note if there is no backend for this class, then state
will be always online, however @.technology will be
- unknown, @.interface, @.name, @.ipv4 and @.ipv6 will be
+ unknown, @.interface, @.network_name, @.ipv4 and @.ipv6 will be
NULL.
]]
get { }
values {
- state: Efl.Net.Session.State; [[Network session state]]
+ state: Efl.Net.Session_State; [[Network session state]]
}
}
@@ -110,7 +110,7 @@ class Efl.Net.Session (Efl.Loop.Consumer) {
[[The access point technology that backs this session]]
get { }
values {
- technology: Efl.Net.Session.Technology; [[Network session technology]]
+ technology: Efl.Net.Session_Technology; [[Network session technology]]
}
}
diff --git a/src/lib/ecore_con/efl_net_socket_fd.c b/src/lib/ecore_con/efl_net_socket_fd.c
index d02e58663c..3ade365fc2 100644
--- a/src/lib/ecore_con/efl_net_socket_fd.c
+++ b/src/lib/ecore_con/efl_net_socket_fd.c
@@ -78,7 +78,7 @@ _efl_net_socket_fd_efl_object_constructor(Eo *o, Efl_Net_Socket_Fd_Data *pd)
o = efl_constructor(efl_super(o, MY_CLASS));
efl_io_closer_close_on_exec_set(o, EINA_TRUE);
- efl_io_closer_close_on_destructor_set(o, EINA_TRUE);
+ efl_io_closer_close_on_invalidate_set(o, EINA_TRUE);
efl_io_reader_fd_set(o, SOCKET_TO_LOOP_FD(INVALID_SOCKET));
efl_io_writer_fd_set(o, SOCKET_TO_LOOP_FD(INVALID_SOCKET));
efl_io_closer_fd_set(o, SOCKET_TO_LOOP_FD(INVALID_SOCKET));
@@ -87,9 +87,9 @@ _efl_net_socket_fd_efl_object_constructor(Eo *o, Efl_Net_Socket_Fd_Data *pd)
}
EOLIAN static void
-_efl_net_socket_fd_efl_object_destructor(Eo *o, Efl_Net_Socket_Fd_Data *pd)
+_efl_net_socket_fd_efl_object_invalidate(Eo *o, Efl_Net_Socket_Fd_Data *pd EINA_UNUSED)
{
- if (efl_io_closer_close_on_destructor_get(o) &&
+ if (efl_io_closer_close_on_invalidate_get(o) &&
(!efl_io_closer_closed_get(o)))
{
efl_event_freeze(o);
@@ -97,6 +97,12 @@ _efl_net_socket_fd_efl_object_destructor(Eo *o, Efl_Net_Socket_Fd_Data *pd)
efl_event_thaw(o);
}
+ efl_invalidate(efl_super(o, MY_CLASS));
+}
+
+EOLIAN static void
+_efl_net_socket_fd_efl_object_destructor(Eo *o, Efl_Net_Socket_Fd_Data *pd)
+{
efl_destructor(efl_super(o, MY_CLASS));
eina_stringshare_replace(&pd->address_local, NULL);
@@ -182,7 +188,7 @@ _efl_net_socket_fd_efl_io_closer_close(Eo *o, Efl_Net_Socket_Fd_Data *pd EINA_UN
}
EOLIAN static Eina_Bool
-_efl_net_socket_fd_efl_io_closer_closed_get(Eo *o, Efl_Net_Socket_Fd_Data *pd)
+_efl_net_socket_fd_efl_io_closer_closed_get(const Eo *o, Efl_Net_Socket_Fd_Data *pd)
{
if (pd->family == AF_UNSPEC) return EINA_FALSE;
return (SOCKET)efl_io_closer_fd_get(o) == INVALID_SOCKET;
@@ -335,7 +341,7 @@ _efl_net_socket_fd_efl_net_socket_address_local_set(Eo *o EINA_UNUSED, Efl_Net_S
}
EOLIAN static const char *
-_efl_net_socket_fd_efl_net_socket_address_local_get(Eo *o EINA_UNUSED, Efl_Net_Socket_Fd_Data *pd)
+_efl_net_socket_fd_efl_net_socket_address_local_get(const Eo *o EINA_UNUSED, Efl_Net_Socket_Fd_Data *pd)
{
return pd->address_local;
}
@@ -347,7 +353,7 @@ _efl_net_socket_fd_efl_net_socket_address_remote_set(Eo *o EINA_UNUSED, Efl_Net_
}
EOLIAN static const char *
-_efl_net_socket_fd_efl_net_socket_address_remote_get(Eo *o EINA_UNUSED, Efl_Net_Socket_Fd_Data *pd)
+_efl_net_socket_fd_efl_net_socket_address_remote_get(const Eo *o EINA_UNUSED, Efl_Net_Socket_Fd_Data *pd)
{
return pd->address_remote;
}
@@ -359,7 +365,7 @@ _efl_net_socket_fd_family_set(Eo *o EINA_UNUSED, Efl_Net_Socket_Fd_Data *pd, int
}
EOLIAN static int
-_efl_net_socket_fd_family_get(Eo *o EINA_UNUSED, Efl_Net_Socket_Fd_Data *pd)
+_efl_net_socket_fd_family_get(const Eo *o EINA_UNUSED, Efl_Net_Socket_Fd_Data *pd)
{
return pd->family;
}
diff --git a/src/lib/ecore_con/efl_net_socket_fd.eo b/src/lib/ecore_con/efl_net_socket_fd.eo
index 9149464a75..951fe7f8cc 100644
--- a/src/lib/ecore_con/efl_net_socket_fd.eo
+++ b/src/lib/ecore_con/efl_net_socket_fd.eo
@@ -1,11 +1,11 @@
-class Efl.Net.Socket.Fd (Efl.Loop.Fd, Efl.Io.Reader.Fd, Efl.Io.Writer.Fd, Efl.Io.Closer.Fd, Efl.Net.Socket) {
+class Efl.Net.Socket_Fd (Efl.Loop_Fd, Efl.Io.Reader_Fd, Efl.Io.Writer_Fd, Efl.Io.Closer_Fd, Efl.Net.Socket) {
[[A base implementation for sockets over filedescriptors (fd)
This is the common class and takes an existing FD, usually
created by an dialer or server.
@Efl.Io.Closer.close_on_exec and
- @Efl.Io.Closer.close_on_destructor are respected and default to
+ @Efl.Io.Closer.close_on_invalidate are respected and default to
$true.
@since 1.19
@@ -18,7 +18,7 @@ class Efl.Net.Socket.Fd (Efl.Loop.Fd, Efl.Io.Reader.Fd, Efl.Io.Writer.Fd, Efl.Io
It will be one of AF_INET (IPv4), AF_INET6 (IPv6),
AF_UNIX...
- It must be set before the @Efl.Loop.Fd.fd.set is called
+ It must be set before the @Efl.Loop_Fd.fd.set is called
with a valid file descriptor.
]]
get { }
@@ -32,8 +32,9 @@ class Efl.Net.Socket.Fd (Efl.Loop.Fd, Efl.Io.Reader.Fd, Efl.Io.Writer.Fd, Efl.Io
implements {
Efl.Object.finalize;
Efl.Object.constructor;
+ Efl.Object.invalidate;
Efl.Object.destructor;
- Efl.Loop.Fd.fd { set; }
+ Efl.Loop_Fd.fd { set; }
Efl.Io.Closer.close;
Efl.Io.Closer.closed { get; }
Efl.Io.Reader.read;
diff --git a/src/lib/ecore_con/efl_net_socket_simple.c b/src/lib/ecore_con/efl_net_socket_simple.c
index c5490509fe..e053e87822 100644
--- a/src/lib/ecore_con/efl_net_socket_simple.c
+++ b/src/lib/ecore_con/efl_net_socket_simple.c
@@ -21,13 +21,13 @@ _efl_net_socket_simple_efl_io_buffered_stream_inner_io_set(Eo *o, Efl_Net_Socket
}
EOLIAN static const char *
-_efl_net_socket_simple_efl_net_socket_address_local_get(Eo *o, Efl_Net_Socket_Simple_Data *pd EINA_UNUSED)
+_efl_net_socket_simple_efl_net_socket_address_local_get(const Eo *o, Efl_Net_Socket_Simple_Data *pd EINA_UNUSED)
{
return efl_net_socket_address_local_get(efl_io_buffered_stream_inner_io_get(o));
}
EOLIAN static const char *
-_efl_net_socket_simple_efl_net_socket_address_remote_get(Eo *o, Efl_Net_Socket_Simple_Data *pd EINA_UNUSED)
+_efl_net_socket_simple_efl_net_socket_address_remote_get(const Eo *o, Efl_Net_Socket_Simple_Data *pd EINA_UNUSED)
{
return efl_net_socket_address_remote_get(efl_io_buffered_stream_inner_io_get(o));
}
diff --git a/src/lib/ecore_con/efl_net_socket_simple.eo b/src/lib/ecore_con/efl_net_socket_simple.eo
index d233096ad8..b20425945d 100644
--- a/src/lib/ecore_con/efl_net_socket_simple.eo
+++ b/src/lib/ecore_con/efl_net_socket_simple.eo
@@ -1,4 +1,4 @@
-class Efl.Net.Socket.Simple (Efl.Io.Buffered_Stream, Efl.Net.Socket) {
+class Efl.Net.Socket_Simple (Efl.Io.Buffered_Stream, Efl.Net.Socket) {
[[A wrapper socket offering an easy to use, buffered I/O.
The simple socket encapsulates an actual @Efl.Net.Socket and
diff --git a/src/lib/ecore_con/efl_net_socket_ssl.c b/src/lib/ecore_con/efl_net_socket_ssl.c
index 9b4a51298f..3f9e6cebf4 100644
--- a/src/lib/ecore_con/efl_net_socket_ssl.c
+++ b/src/lib/ecore_con/efl_net_socket_ssl.c
@@ -244,7 +244,6 @@ efl_net_socket_ssl_sock_connected(void *data, const Efl_Event *event EINA_UNUSED
{
WRN("SSL=%p failed handshake: %s", o, eina_error_msg_get(err));
efl_io_closer_close(o);
- return;
}
efl_unref(o);
@@ -329,7 +328,7 @@ _efl_net_socket_ssl_adopt(Eo *o, Efl_Net_Socket_Ssl_Data *pd, Efl_Net_Socket *so
}
EOLIAN static Eina_Bool
-_efl_net_socket_ssl_adopted_get(Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd, Efl_Net_Socket **sock, Efl_Net_Ssl_Context **context)
+_efl_net_socket_ssl_adopted_get(const Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd, Efl_Net_Socket **sock, Efl_Net_Ssl_Context **context)
{
if (sock) *sock = pd->sock;
if (context) *context = pd->context;
@@ -337,7 +336,7 @@ _efl_net_socket_ssl_adopted_get(Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd,
}
static Efl_Net_Ssl_Verify_Mode
-_efl_net_socket_ssl_verify_mode_get(Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd)
+_efl_net_socket_ssl_verify_mode_get(const Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd)
{
return pd->verify_mode;
}
@@ -353,7 +352,7 @@ _efl_net_socket_ssl_verify_mode_set(Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *
}
static Eina_Bool
-_efl_net_socket_ssl_hostname_verify_get(Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd)
+_efl_net_socket_ssl_hostname_verify_get(const Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd)
{
return pd->hostname_verify;
}
@@ -369,7 +368,7 @@ _efl_net_socket_ssl_hostname_verify_set(Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Da
}
static const char *
-_efl_net_socket_ssl_hostname_override_get(Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd)
+_efl_net_socket_ssl_hostname_override_get(const Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd)
{
return pd->hostname_override;
}
@@ -445,9 +444,9 @@ _efl_net_socket_ssl_efl_object_constructor(Eo *o, Efl_Net_Socket_Ssl_Data *pd)
}
EOLIAN static void
-_efl_net_socket_ssl_efl_object_destructor(Eo *o, Efl_Net_Socket_Ssl_Data *pd)
+_efl_net_socket_ssl_efl_object_invalidate(Eo *o, Efl_Net_Socket_Ssl_Data *pd EINA_UNUSED)
{
- if (efl_io_closer_close_on_destructor_get(o) &&
+ if (efl_io_closer_close_on_invalidate_get(o) &&
(!efl_io_closer_closed_get(o)))
{
efl_event_freeze(o);
@@ -455,8 +454,6 @@ _efl_net_socket_ssl_efl_object_destructor(Eo *o, Efl_Net_Socket_Ssl_Data *pd)
efl_event_thaw(o);
}
- efl_destructor(efl_super(o, MY_CLASS));
-
pd->torndown = EINA_TRUE;
efl_net_ssl_conn_teardown(&pd->ssl_conn);
if (pd->sock)
@@ -475,7 +472,15 @@ _efl_net_socket_ssl_efl_object_destructor(Eo *o, Efl_Net_Socket_Ssl_Data *pd)
pd->context = NULL;
}
+ efl_invalidate(efl_super(o, MY_CLASS));
+}
+
+EOLIAN static void
+_efl_net_socket_ssl_efl_object_destructor(Eo *o, Efl_Net_Socket_Ssl_Data *pd)
+{
eina_stringshare_replace(&pd->hostname_override, NULL);
+
+ efl_destructor(efl_super(o, MY_CLASS));
}
EOLIAN static Eina_Error
@@ -493,7 +498,7 @@ _efl_net_socket_ssl_efl_io_closer_close(Eo *o, Efl_Net_Socket_Ssl_Data *pd)
}
EOLIAN static Eina_Bool
-_efl_net_socket_ssl_efl_io_closer_closed_get(Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd)
+_efl_net_socket_ssl_efl_io_closer_closed_get(const Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd)
{
return (!pd->sock) || efl_io_closer_closed_get(pd->sock);
}
@@ -535,13 +540,13 @@ _efl_net_socket_ssl_efl_io_reader_can_read_set(Eo *o, Efl_Net_Socket_Ssl_Data *p
}
EOLIAN static Eina_Bool
-_efl_net_socket_ssl_efl_io_reader_can_read_get(Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd)
+_efl_net_socket_ssl_efl_io_reader_can_read_get(const Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd)
{
return pd->can_read;
}
EOLIAN static Eina_Bool
-_efl_net_socket_ssl_efl_io_reader_eos_get(Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd)
+_efl_net_socket_ssl_efl_io_reader_eos_get(const Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd)
{
return pd->eos;
}
@@ -598,7 +603,7 @@ _efl_net_socket_ssl_efl_io_writer_can_write_set(Eo *o, Efl_Net_Socket_Ssl_Data *
}
EOLIAN static Eina_Bool
-_efl_net_socket_ssl_efl_io_writer_can_write_get(Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd)
+_efl_net_socket_ssl_efl_io_writer_can_write_get(const Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd)
{
return pd->can_write;
}
@@ -611,32 +616,32 @@ _efl_net_socket_ssl_efl_io_closer_close_on_exec_set(Eo *o EINA_UNUSED, Efl_Net_S
}
EOLIAN static Eina_Bool
-_efl_net_socket_ssl_efl_io_closer_close_on_exec_get(Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd)
+_efl_net_socket_ssl_efl_io_closer_close_on_exec_get(const Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd)
{
return pd->sock && efl_io_closer_close_on_exec_get(pd->sock);
}
EOLIAN static void
-_efl_net_socket_ssl_efl_io_closer_close_on_destructor_set(Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd, Eina_Bool close_on_destructor)
+_efl_net_socket_ssl_efl_io_closer_close_on_invalidate_set(Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd, Eina_Bool close_on_invalidate)
{
- if (pd->sock) efl_io_closer_close_on_destructor_set(pd->sock, close_on_destructor);
+ if (pd->sock) efl_io_closer_close_on_invalidate_set(pd->sock, close_on_invalidate);
}
EOLIAN static Eina_Bool
-_efl_net_socket_ssl_efl_io_closer_close_on_destructor_get(Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd)
+_efl_net_socket_ssl_efl_io_closer_close_on_invalidate_get(const Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd)
{
- return pd->sock && efl_io_closer_close_on_destructor_get(pd->sock);
+ return pd->sock && efl_io_closer_close_on_invalidate_get(pd->sock);
}
EOLIAN static const char *
-_efl_net_socket_ssl_efl_net_socket_address_local_get(Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd)
+_efl_net_socket_ssl_efl_net_socket_address_local_get(const Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd)
{
if (!pd->sock) return "unbound";
return efl_net_socket_address_local_get(pd->sock);
}
EOLIAN static const char *
-_efl_net_socket_ssl_efl_net_socket_address_remote_get(Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd)
+_efl_net_socket_ssl_efl_net_socket_address_remote_get(const Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd)
{
if (!pd->sock) return "unbound";
return efl_net_socket_address_remote_get(pd->sock);
diff --git a/src/lib/ecore_con/efl_net_socket_ssl.eo b/src/lib/ecore_con/efl_net_socket_ssl.eo
index ddab2f45a2..c8e306630f 100644
--- a/src/lib/ecore_con/efl_net_socket_ssl.eo
+++ b/src/lib/ecore_con/efl_net_socket_ssl.eo
@@ -1,20 +1,20 @@
-var Efl.Net.Socket.Ssl.Error.HANDSHAKE: Eina.Error; [[Failed SSL handshake]]
-var Efl.Net.Socket.Ssl.Error.CERTIFICATE_VERIFY_FAILED: Eina.Error; [[Failed to verify peer's certificate]]
+var Efl.Net.Socket_Ssl_Error.HANDSHAKE: Eina.Error; [[Failed SSL handshake]]
+var Efl.Net.Socket_Ssl_Error.CERTIFICATE_VERIFY_FAILED: Eina.Error; [[Failed to verify peer's certificate]]
-class Efl.Net.Socket.Ssl (Efl.Loop.Consumer, Efl.Net.Socket) {
+class Efl.Net.Socket_Ssl (Efl.Loop_Consumer, Efl.Net.Socket) {
[[A wrapper socket doing SSL (Secure Sockets Layer).
Use this wrapper around an existing socket for secure
communication. One common use is to apply it to TCP sockets
- created with @Efl.Net.Dialer.Tcp or @Efl.Net.Server.Tcp created
+ created with @Efl.Net.Dialer_Tcp or @Efl.Net.Server_Tcp created
with "client,add" event.
@since 1.19
]]
events {
- ssl,ready; [[Notifies the SSL handshake has been performed and the socket is now able to communicate]]
- ssl,error: Eina.Error; [[An error such as @Efl.Net.Socket.Ssl.Error.HANDSHAKE]]
+ ssl,ready: void; [[Notifies the SSL handshake has been performed and the socket is now able to communicate]]
+ ssl,error: Eina.Error; [[An error such as @Efl.Net.Socket_Ssl_Error.HANDSHAKE]]
}
methods {
@@ -84,12 +84,13 @@ class Efl.Net.Socket.Ssl (Efl.Loop.Consumer, Efl.Net.Socket) {
implements {
Efl.Object.constructor;
- Efl.Object.destructor;
Efl.Object.finalize;
+ Efl.Object.invalidate;
+ Efl.Object.destructor;
Efl.Io.Closer.close;
Efl.Io.Closer.closed { get; }
Efl.Io.Closer.close_on_exec { get; set; }
- Efl.Io.Closer.close_on_destructor { get; set; }
+ Efl.Io.Closer.close_on_invalidate { get; set; }
Efl.Io.Reader.read;
Efl.Io.Reader.can_read { get; set; }
Efl.Io.Reader.eos { get; set; }
diff --git a/src/lib/ecore_con/efl_net_socket_tcp.c b/src/lib/ecore_con/efl_net_socket_tcp.c
index a6179bea8c..cec971237a 100644
--- a/src/lib/ecore_con/efl_net_socket_tcp.c
+++ b/src/lib/ecore_con/efl_net_socket_tcp.c
@@ -114,7 +114,7 @@ _efl_net_socket_tcp_keep_alive_set(Eo *o, Efl_Net_Socket_Tcp_Data *pd, Eina_Bool
}
EOLIAN static Eina_Bool
-_efl_net_socket_tcp_keep_alive_get(Eo *o, Efl_Net_Socket_Tcp_Data *pd)
+_efl_net_socket_tcp_keep_alive_get(const Eo *o, Efl_Net_Socket_Tcp_Data *pd)
{
SOCKET fd;
#ifdef _WIN32
@@ -172,7 +172,7 @@ _efl_net_socket_tcp_no_delay_set(Eo *o, Efl_Net_Socket_Tcp_Data *pd, Eina_Bool n
}
EOLIAN static Eina_Bool
-_efl_net_socket_tcp_no_delay_get(Eo *o, Efl_Net_Socket_Tcp_Data *pd)
+_efl_net_socket_tcp_no_delay_get(const Eo *o, Efl_Net_Socket_Tcp_Data *pd)
{
SOCKET fd;
#ifdef _WIN32
@@ -246,7 +246,7 @@ _efl_net_socket_tcp_cork_set(Eo *o, Efl_Net_Socket_Tcp_Data *pd, Eina_Bool cork)
}
EOLIAN static Eina_Bool
-_efl_net_socket_tcp_cork_get(Eo *o, Efl_Net_Socket_Tcp_Data *pd)
+_efl_net_socket_tcp_cork_get(const Eo *o, Efl_Net_Socket_Tcp_Data *pd)
{
SOCKET fd;
int value = 0;
diff --git a/src/lib/ecore_con/efl_net_socket_tcp.eo b/src/lib/ecore_con/efl_net_socket_tcp.eo
index 7509f7b69a..de40b1da45 100644
--- a/src/lib/ecore_con/efl_net_socket_tcp.eo
+++ b/src/lib/ecore_con/efl_net_socket_tcp.eo
@@ -1,4 +1,4 @@
-class Efl.Net.Socket.Tcp (Efl.Net.Socket.Fd) {
+class Efl.Net.Socket_Tcp (Efl.Net.Socket_Fd) {
[[A base TCP socket.
This is the common class and takes an existing FD, usually
@@ -43,6 +43,6 @@ class Efl.Net.Socket.Tcp (Efl.Net.Socket.Fd) {
}
implements {
- Efl.Loop.Fd.fd { set; }
+ Efl.Loop_Fd.fd { set; }
}
}
diff --git a/src/lib/ecore_con/efl_net_socket_udp.c b/src/lib/ecore_con/efl_net_socket_udp.c
index c887a964a5..487fb7a4e9 100644
--- a/src/lib/ecore_con/efl_net_socket_udp.c
+++ b/src/lib/ecore_con/efl_net_socket_udp.c
@@ -263,7 +263,7 @@ _efl_net_socket_udp_cork_set(Eo *o, Efl_Net_Socket_Udp_Data *pd, Eina_Bool cork)
}
EOLIAN static Eina_Bool
-_efl_net_socket_udp_cork_get(Eo *o, Efl_Net_Socket_Udp_Data *pd)
+_efl_net_socket_udp_cork_get(const Eo *o, Efl_Net_Socket_Udp_Data *pd)
{
SOCKET fd;
int value = 0;
@@ -322,7 +322,7 @@ _efl_net_socket_udp_dont_route_set(Eo *o, Efl_Net_Socket_Udp_Data *pd, Eina_Bool
}
EOLIAN static Eina_Bool
-_efl_net_socket_udp_dont_route_get(Eo *o, Efl_Net_Socket_Udp_Data *pd)
+_efl_net_socket_udp_dont_route_get(const Eo *o, Efl_Net_Socket_Udp_Data *pd)
{
SOCKET fd = efl_loop_fd_get(o);
#ifdef _WIN32
@@ -375,7 +375,7 @@ _efl_net_socket_udp_reuse_address_set(Eo *o, Efl_Net_Socket_Udp_Data *pd, Eina_B
}
EOLIAN static Eina_Bool
-_efl_net_socket_udp_reuse_address_get(Eo *o, Efl_Net_Socket_Udp_Data *pd)
+_efl_net_socket_udp_reuse_address_get(const Eo *o, Efl_Net_Socket_Udp_Data *pd)
{
SOCKET fd;
int value = 0;
@@ -430,7 +430,7 @@ _efl_net_socket_udp_reuse_port_set(Eo *o, Efl_Net_Socket_Udp_Data *pd, Eina_Bool
}
EOLIAN static Eina_Bool
-_efl_net_socket_udp_reuse_port_get(Eo *o, Efl_Net_Socket_Udp_Data *pd)
+_efl_net_socket_udp_reuse_port_get(const Eo *o, Efl_Net_Socket_Udp_Data *pd)
{
#ifdef SO_REUSEPORT
SOCKET fd;
@@ -471,7 +471,7 @@ _efl_net_socket_udp_bind_set(Eo *o, Efl_Net_Socket_Udp_Data *pd, const char *add
}
EOLIAN static const char *
-_efl_net_socket_udp_bind_get(Eo *o EINA_UNUSED, Efl_Net_Socket_Udp_Data *pd)
+_efl_net_socket_udp_bind_get(const Eo *o EINA_UNUSED, Efl_Net_Socket_Udp_Data *pd)
{
return pd->address_bind;
}
@@ -728,7 +728,7 @@ _efl_net_socket_udp_multicast_time_to_live_set(Eo *o, Efl_Net_Socket_Udp_Data *p
}
EOLIAN static uint8_t
-_efl_net_socket_udp_multicast_time_to_live_get(Eo *o, Efl_Net_Socket_Udp_Data *pd)
+_efl_net_socket_udp_multicast_time_to_live_get(const Eo *o, Efl_Net_Socket_Udp_Data *pd)
{
SOCKET fd = efl_loop_fd_get(o);
Eina_Error err;
@@ -767,7 +767,7 @@ _efl_net_socket_udp_multicast_loopback_set(Eo *o, Efl_Net_Socket_Udp_Data *pd, E
}
EOLIAN static Eina_Bool
-_efl_net_socket_udp_multicast_loopback_get(Eo *o, Efl_Net_Socket_Udp_Data *pd)
+_efl_net_socket_udp_multicast_loopback_get(const Eo *o, Efl_Net_Socket_Udp_Data *pd)
{
SOCKET fd = efl_loop_fd_get(o);
Eina_Error err;
diff --git a/src/lib/ecore_con/efl_net_socket_udp.eo b/src/lib/ecore_con/efl_net_socket_udp.eo
index 539dfd29ea..9c22a0c0f3 100644
--- a/src/lib/ecore_con/efl_net_socket_udp.eo
+++ b/src/lib/ecore_con/efl_net_socket_udp.eo
@@ -1,6 +1,6 @@
import efl_net_ip_address;
-class Efl.Net.Socket.Udp (Efl.Net.Socket.Fd) {
+class Efl.Net.Socket_Udp (Efl.Net.Socket_Fd) {
[[A base UDP socket.
This is the common class and takes an existing FD, usually
@@ -8,7 +8,7 @@ class Efl.Net.Socket.Udp (Efl.Net.Socket.Fd) {
Since for the server 'clients' there is no accepted connection
it will reuse the same file decriptor. To avoid it being
- closed, another class Efl.Net.Server.Udp.Client is used instead.
+ closed, another class Efl.Net.Server_Udp_Client is used instead.
@since 1.19
]]
@@ -176,7 +176,7 @@ class Efl.Net.Socket.Udp (Efl.Net.Socket.Fd) {
implements {
Efl.Object.constructor;
Efl.Object.destructor;
- Efl.Loop.Fd.fd { set; }
+ Efl.Loop_Fd.fd { set; }
Efl.Io.Reader.read;
Efl.Io.Writer.write;
}
diff --git a/src/lib/ecore_con/efl_net_socket_unix.eo b/src/lib/ecore_con/efl_net_socket_unix.eo
index bd9ca70e20..9befbeaf0e 100644
--- a/src/lib/ecore_con/efl_net_socket_unix.eo
+++ b/src/lib/ecore_con/efl_net_socket_unix.eo
@@ -1,4 +1,4 @@
-class Efl.Net.Socket.Unix (Efl.Net.Socket.Fd) {
+class Efl.Net.Socket_Unix (Efl.Net.Socket_Fd) {
[[A base UNIX socket.
This is the common class and takes an existing FD, usually
@@ -8,6 +8,6 @@ class Efl.Net.Socket.Unix (Efl.Net.Socket.Fd) {
]]
implements {
- Efl.Loop.Fd.fd { set; }
+ Efl.Loop_Fd.fd { set; }
}
}
diff --git a/src/lib/ecore_con/efl_net_socket_windows.c b/src/lib/ecore_con/efl_net_socket_windows.c
index 02c4b05c90..c69d0a8b6d 100644
--- a/src/lib/ecore_con/efl_net_socket_windows.c
+++ b/src/lib/ecore_con/efl_net_socket_windows.c
@@ -47,7 +47,7 @@ typedef struct _Efl_Net_Socket_Windows_Data
Eina_Bool can_write;
Eina_Bool io_started;
Eina_Bool close_on_exec;
- Eina_Bool close_on_destructor;
+ Eina_Bool close_on_invalidate;
} Efl_Net_Socket_Windows_Data;
struct _Efl_Net_Socket_Windows_Operation
@@ -634,9 +634,9 @@ _efl_net_socket_windows_efl_object_constructor(Eo *o, Efl_Net_Socket_Windows_Dat
}
EOLIAN static void
-_efl_net_socket_windows_efl_object_destructor(Eo *o, Efl_Net_Socket_Windows_Data *pd)
+_efl_net_socket_windows_efl_object_invalidate(Eo *o, Efl_Net_Socket_Windows_Data *pd)
{
- if (efl_io_closer_close_on_destructor_get(o) &&
+ if (efl_io_closer_close_on_invalidate_get(o) &&
(!efl_io_closer_closed_get(o)))
{
efl_event_freeze(o);
@@ -644,6 +644,12 @@ _efl_net_socket_windows_efl_object_destructor(Eo *o, Efl_Net_Socket_Windows_Data
efl_event_thaw(o);
}
+ efl_invalidate(efl_super(o, MY_CLASS));
+}
+
+EOLIAN static void
+_efl_net_socket_windows_efl_object_destructor(Eo *o, Efl_Net_Socket_Windows_Data *pd)
+{
efl_destructor(efl_super(o, MY_CLASS));
eina_stringshare_replace(&pd->address_local, NULL);
@@ -728,7 +734,7 @@ _efl_net_socket_windows_efl_io_closer_close(Eo *o, Efl_Net_Socket_Windows_Data *
}
EOLIAN static Eina_Bool
-_efl_net_socket_windows_efl_io_closer_closed_get(Eo *o EINA_UNUSED, Efl_Net_Socket_Windows_Data *pd)
+_efl_net_socket_windows_efl_io_closer_closed_get(const Eo *o EINA_UNUSED, Efl_Net_Socket_Windows_Data *pd)
{
return pd->handle == INVALID_HANDLE_VALUE;
}
@@ -742,21 +748,21 @@ _efl_net_socket_windows_efl_io_closer_close_on_exec_set(Eo *o EINA_UNUSED, Efl_N
}
EOLIAN static Eina_Bool
-_efl_net_socket_windows_efl_io_closer_close_on_exec_get(Eo *o EINA_UNUSED, Efl_Net_Socket_Windows_Data *pd)
+_efl_net_socket_windows_efl_io_closer_close_on_exec_get(const Eo *o EINA_UNUSED, Efl_Net_Socket_Windows_Data *pd)
{
return pd->close_on_exec;
}
EOLIAN static void
-_efl_net_socket_windows_efl_io_closer_close_on_destructor_set(Eo *o EINA_UNUSED, Efl_Net_Socket_Windows_Data *pd, Eina_Bool close_on_destructor)
+_efl_net_socket_windows_efl_io_closer_close_on_invalidate_set(Eo *o EINA_UNUSED, Efl_Net_Socket_Windows_Data *pd, Eina_Bool close_on_invalidate)
{
- pd->close_on_destructor = close_on_destructor;
+ pd->close_on_invalidate = close_on_invalidate;
}
EOLIAN static Eina_Bool
-_efl_net_socket_windows_efl_io_closer_close_on_destructor_get(Eo *o EINA_UNUSED, Efl_Net_Socket_Windows_Data *pd)
+_efl_net_socket_windows_efl_io_closer_close_on_invalidate_get(const Eo *o EINA_UNUSED, Efl_Net_Socket_Windows_Data *pd)
{
- return pd->close_on_destructor;
+ return pd->close_on_invalidate;
}
EOLIAN static Eina_Error
@@ -814,7 +820,7 @@ _efl_net_socket_windows_efl_io_reader_can_read_set(Eo *o, Efl_Net_Socket_Windows
}
EOLIAN static Eina_Bool
-_efl_net_socket_windows_efl_io_reader_can_read_get(Eo *o EINA_UNUSED, Efl_Net_Socket_Windows_Data *pd)
+_efl_net_socket_windows_efl_io_reader_can_read_get(const Eo *o EINA_UNUSED, Efl_Net_Socket_Windows_Data *pd)
{
return pd->can_read;
}
@@ -829,7 +835,7 @@ _efl_net_socket_windows_efl_io_reader_eos_set(Eo *o, Efl_Net_Socket_Windows_Data
}
EOLIAN static Eina_Bool
-_efl_net_socket_windows_efl_io_reader_eos_get(Eo *o EINA_UNUSED, Efl_Net_Socket_Windows_Data *pd)
+_efl_net_socket_windows_efl_io_reader_eos_get(const Eo *o EINA_UNUSED, Efl_Net_Socket_Windows_Data *pd)
{
return pd->eos;
}
@@ -897,7 +903,7 @@ _efl_net_socket_windows_efl_io_writer_can_write_set(Eo *o, Efl_Net_Socket_Window
}
EOLIAN static Eina_Bool
-_efl_net_socket_windows_efl_io_writer_can_write_get(Eo *o EINA_UNUSED, Efl_Net_Socket_Windows_Data *pd)
+_efl_net_socket_windows_efl_io_writer_can_write_get(const Eo *o EINA_UNUSED, Efl_Net_Socket_Windows_Data *pd)
{
return pd->can_write;
}
@@ -909,7 +915,7 @@ _efl_net_socket_windows_efl_net_socket_address_local_set(Eo *o EINA_UNUSED, Efl_
}
EOLIAN static const char *
-_efl_net_socket_windows_efl_net_socket_address_local_get(Eo *o EINA_UNUSED, Efl_Net_Socket_Windows_Data *pd)
+_efl_net_socket_windows_efl_net_socket_address_local_get(const Eo *o EINA_UNUSED, Efl_Net_Socket_Windows_Data *pd)
{
return pd->address_local;
}
@@ -921,7 +927,7 @@ _efl_net_socket_windows_efl_net_socket_address_remote_set(Eo *o EINA_UNUSED, Efl
}
EOLIAN static const char *
-_efl_net_socket_windows_efl_net_socket_address_remote_get(Eo *o EINA_UNUSED, Efl_Net_Socket_Windows_Data *pd)
+_efl_net_socket_windows_efl_net_socket_address_remote_get(const Eo *o EINA_UNUSED, Efl_Net_Socket_Windows_Data *pd)
{
return pd->address_remote;
}
diff --git a/src/lib/ecore_con/efl_net_socket_windows.eo b/src/lib/ecore_con/efl_net_socket_windows.eo
index 6e4d2c4382..95cdea693c 100644
--- a/src/lib/ecore_con/efl_net_socket_windows.eo
+++ b/src/lib/ecore_con/efl_net_socket_windows.eo
@@ -1,4 +1,4 @@
-class Efl.Net.Socket.Windows (Efl.Loop.Consumer, Efl.Net.Socket) {
+class Efl.Net.Socket_Windows (Efl.Loop_Consumer, Efl.Net.Socket) {
[[A base Windows NamedPipe socket.
This is the common class and takes an existing file HANDLE,
@@ -14,7 +14,7 @@ class Efl.Net.Socket.Windows (Efl.Loop.Consumer, Efl.Net.Socket) {
Efl.Io.Closer.close;
Efl.Io.Closer.closed { get; }
Efl.Io.Closer.close_on_exec { get; set; }
- Efl.Io.Closer.close_on_destructor { get; set; }
+ Efl.Io.Closer.close_on_invalidate { get; set; }
Efl.Io.Reader.read;
Efl.Io.Reader.can_read { get; set; }
Efl.Io.Reader.eos { get; set; }
diff --git a/src/lib/ecore_con/efl_net_ssl_conn-openssl.c b/src/lib/ecore_con/efl_net_ssl_conn-openssl.c
index 37457e96b3..c2a7dc8331 100644
--- a/src/lib/ecore_con/efl_net_ssl_conn-openssl.c
+++ b/src/lib/ecore_con/efl_net_ssl_conn-openssl.c
@@ -29,6 +29,8 @@
# include <Exotic.h>
#endif
+#include "ecore_con_private.h"
+
/* OpenSSL's BIO is the abstraction for I/O, provide one for Efl.Io.* */
static int
efl_net_socket_bio_create(BIO *b)
diff --git a/src/lib/ecore_con/efl_net_ssl_context.c b/src/lib/ecore_con/efl_net_ssl_context.c
index df20f472a6..271cd8afc2 100644
--- a/src/lib/ecore_con/efl_net_ssl_context.c
+++ b/src/lib/ecore_con/efl_net_ssl_context.c
@@ -151,7 +151,7 @@ _efl_net_ssl_context_string_list_free(Eina_List **p_lst)
}
static Eina_Iterator *
-_efl_net_ssl_context_certificates_get(Eo *o EINA_UNUSED, Efl_Net_Ssl_Context_Data *pd)
+_efl_net_ssl_context_certificates_get(const Eo *o EINA_UNUSED, Efl_Net_Ssl_Context_Data *pd)
{
return eina_list_iterator_new(pd->certificates);
}
@@ -165,7 +165,7 @@ _efl_net_ssl_context_certificates_set(Eo *o EINA_UNUSED, Efl_Net_Ssl_Context_Dat
}
static Eina_Iterator *
-_efl_net_ssl_context_private_keys_get(Eo *o EINA_UNUSED, Efl_Net_Ssl_Context_Data *pd)
+_efl_net_ssl_context_private_keys_get(const Eo *o EINA_UNUSED, Efl_Net_Ssl_Context_Data *pd)
{
return eina_list_iterator_new(pd->private_keys);
}
@@ -179,7 +179,7 @@ _efl_net_ssl_context_private_keys_set(Eo *o EINA_UNUSED, Efl_Net_Ssl_Context_Dat
}
static Eina_Iterator *
-_efl_net_ssl_context_certificate_revocation_lists_get(Eo *o EINA_UNUSED, Efl_Net_Ssl_Context_Data *pd)
+_efl_net_ssl_context_certificate_revocation_lists_get(const Eo *o EINA_UNUSED, Efl_Net_Ssl_Context_Data *pd)
{
return eina_list_iterator_new(pd->certificate_revocation_lists);
}
@@ -193,7 +193,7 @@ _efl_net_ssl_context_certificate_revocation_lists_set(Eo *o EINA_UNUSED, Efl_Net
}
static Eina_Iterator *
-_efl_net_ssl_context_certificate_authorities_get(Eo *o EINA_UNUSED, Efl_Net_Ssl_Context_Data *pd)
+_efl_net_ssl_context_certificate_authorities_get(const Eo *o EINA_UNUSED, Efl_Net_Ssl_Context_Data *pd)
{
return eina_list_iterator_new(pd->certificate_authorities);
}
@@ -207,7 +207,7 @@ _efl_net_ssl_context_certificate_authorities_set(Eo *o EINA_UNUSED, Efl_Net_Ssl_
}
static Eina_Bool
-_efl_net_ssl_context_default_paths_load_get(Eo *o EINA_UNUSED, Efl_Net_Ssl_Context_Data *pd)
+_efl_net_ssl_context_default_paths_load_get(const Eo *o EINA_UNUSED, Efl_Net_Ssl_Context_Data *pd)
{
return pd->load_defaults;
}
@@ -220,7 +220,7 @@ _efl_net_ssl_context_default_paths_load_set(Eo *o EINA_UNUSED, Efl_Net_Ssl_Conte
}
static Efl_Net_Ssl_Verify_Mode
-_efl_net_ssl_context_verify_mode_get(Eo *o EINA_UNUSED, Efl_Net_Ssl_Context_Data *pd)
+_efl_net_ssl_context_verify_mode_get(const Eo *o EINA_UNUSED, Efl_Net_Ssl_Context_Data *pd)
{
return pd->verify_mode;
}
@@ -235,7 +235,7 @@ _efl_net_ssl_context_verify_mode_set(Eo *o, Efl_Net_Ssl_Context_Data *pd, Efl_Ne
}
static Eina_Bool
-_efl_net_ssl_context_hostname_verify_get(Eo *o EINA_UNUSED, Efl_Net_Ssl_Context_Data *pd)
+_efl_net_ssl_context_hostname_verify_get(const Eo *o EINA_UNUSED, Efl_Net_Ssl_Context_Data *pd)
{
return pd->hostname_verify;
}
@@ -250,7 +250,7 @@ _efl_net_ssl_context_hostname_verify_set(Eo *o EINA_UNUSED, Efl_Net_Ssl_Context_
}
static const char *
-_efl_net_ssl_context_hostname_get(Eo *o EINA_UNUSED, Efl_Net_Ssl_Context_Data *pd)
+_efl_net_ssl_context_hostname_get(const Eo *o EINA_UNUSED, Efl_Net_Ssl_Context_Data *pd)
{
return pd->hostname;
}
@@ -336,8 +336,6 @@ _efl_net_ssl_context_efl_object_constructor(Eo *o, Efl_Net_Ssl_Context_Data *pd)
EOLIAN static void
_efl_net_ssl_context_efl_object_destructor(Eo *o, Efl_Net_Ssl_Context_Data *pd)
{
- efl_destructor(efl_super(o, MY_CLASS));
-
efl_net_ssl_ctx_teardown(&pd->ssl_ctx);
_efl_net_ssl_context_string_list_free(&pd->certificates);
@@ -346,6 +344,8 @@ _efl_net_ssl_context_efl_object_destructor(Eo *o, Efl_Net_Ssl_Context_Data *pd)
_efl_net_ssl_context_string_list_free(&pd->certificate_authorities);
eina_stringshare_replace(&pd->hostname, NULL);
+
+ efl_destructor(efl_super(o, MY_CLASS));
}
static Efl_Net_Ssl_Context *_efl_net_ssl_context_default_dialer = NULL;
@@ -357,11 +357,11 @@ _efl_net_ssl_context_default_dialer_del(void *data EINA_UNUSED, const Efl_Event
}
EOLIAN static Efl_Net_Ssl_Context *
-_efl_net_ssl_context_default_dialer_get(Efl_Class *klass, void *pd EINA_UNUSED)
+_efl_net_ssl_context_default_dialer_get(const Efl_Class *klass, void *pd EINA_UNUSED)
{
if (!_efl_net_ssl_context_default_dialer)
{
- _efl_net_ssl_context_default_dialer = efl_add(klass, NULL,
+ _efl_net_ssl_context_default_dialer = efl_add(klass, efl_main_loop_get(),
efl_net_ssl_context_verify_mode_set(efl_added, EFL_NET_SSL_VERIFY_MODE_REQUIRED),
efl_net_ssl_context_hostname_verify_set(efl_added, EINA_TRUE),
efl_net_ssl_context_default_paths_load_set(efl_added, EINA_TRUE),
diff --git a/src/lib/ecore_con/efl_net_ssl_ctx-gnutls.c b/src/lib/ecore_con/efl_net_ssl_ctx-gnutls.c
index 67b7c25c53..7a92a821e9 100644
--- a/src/lib/ecore_con/efl_net_ssl_ctx-gnutls.c
+++ b/src/lib/ecore_con/efl_net_ssl_ctx-gnutls.c
@@ -215,9 +215,6 @@ efl_net_ssl_ctx_setup(Efl_Net_Ssl_Ctx *ctx, Efl_Net_Ssl_Ctx_Config cfg)
case EFL_NET_SSL_CIPHER_AUTO:
priority = NULL;
break;
- case EFL_NET_SSL_CIPHER_SSLV3:
- priority = "NORMAL:%VERIFY_ALLOW_X509_V1_CA_CRT:!VERS-TLS1.0:!VERS-TLS1.1:!VERS-TLS1.2";
- break;
case EFL_NET_SSL_CIPHER_TLSV1:
priority = "NORMAL:%VERIFY_ALLOW_X509_V1_CA_CRT:!VERS-SSL3.0!VERS-TLS1.1:!VERS-TLS1.2";
break;
diff --git a/src/lib/ecore_con/efl_net_ssl_ctx-openssl.c b/src/lib/ecore_con/efl_net_ssl_ctx-openssl.c
index 0fef44e3bf..6efba8476f 100644
--- a/src/lib/ecore_con/efl_net_ssl_ctx-openssl.c
+++ b/src/lib/ecore_con/efl_net_ssl_ctx-openssl.c
@@ -9,6 +9,11 @@ struct _Efl_Net_Ssl_Ctx
Eina_Bool is_dialer;
};
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+# define TLS_server_method TLSv1_2_server_method
+# define TLS_client_method TLSv1_2_client_method
+#endif
+
#define EFL_NET_SSL_CONTEXT_CIPHERS "aRSA+HIGH:+kEDH:+kRSA:!kSRP:!kPSK:+3DES:!MD5"
#define _efl_net_ssl_ctx_check_errors() \
@@ -263,14 +268,7 @@ efl_net_ssl_ctx_setup(Efl_Net_Ssl_Ctx *ctx, Efl_Net_Ssl_Ctx_Config cfg)
switch (cfg.cipher)
{
case EFL_NET_SSL_CIPHER_AUTO:
- ctx->ssl_ctx = SSL_CTX_new(SSLv23_client_method());
- break;
- case EFL_NET_SSL_CIPHER_SSLV3:
-#ifndef OPENSSL_NO_SSL3_METHOD
- ctx->ssl_ctx = SSL_CTX_new(SSLv3_client_method());
-#else
- ctx->ssl_ctx = SSL_CTX_new(SSLv23_client_method());
-#endif
+ ctx->ssl_ctx = SSL_CTX_new(TLS_client_method());
break;
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
case EFL_NET_SSL_CIPHER_TLSV1:
@@ -301,14 +299,7 @@ efl_net_ssl_ctx_setup(Efl_Net_Ssl_Ctx *ctx, Efl_Net_Ssl_Ctx_Config cfg)
switch (cfg.cipher)
{
case EFL_NET_SSL_CIPHER_AUTO:
- ctx->ssl_ctx = SSL_CTX_new(SSLv23_server_method());
- break;
- case EFL_NET_SSL_CIPHER_SSLV3:
-#ifndef OPENSSL_NO_SSL3_METHOD
- ctx->ssl_ctx = SSL_CTX_new(SSLv3_server_method());
-#else
- ctx->ssl_ctx = SSL_CTX_new(SSLv23_server_method());
-#endif
+ ctx->ssl_ctx = SSL_CTX_new(TLS_server_method());
break;
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
case EFL_NET_SSL_CIPHER_TLSV1:
@@ -338,9 +329,7 @@ efl_net_ssl_ctx_setup(Efl_Net_Ssl_Ctx *ctx, Efl_Net_Ssl_Ctx_Config cfg)
options = SSL_CTX_get_options(ctx->ssl_ctx);
options |= SSL_OP_NO_SSLv2;
options |= SSL_OP_SINGLE_DH_USE;
-
- if (cfg.cipher != EFL_NET_SSL_CIPHER_SSLV3)
- options |= SSL_OP_NO_SSLv3;
+ options |= SSL_OP_NO_SSLv3;
SSL_CTX_set_options(ctx->ssl_ctx, options);
diff --git a/src/lib/ecore_con/efl_net_ssl_types.eot b/src/lib/ecore_con/efl_net_ssl_types.eot
index 6556f7cfa7..5c41b921c5 100644
--- a/src/lib/ecore_con/efl_net_ssl_types.eot
+++ b/src/lib/ecore_con/efl_net_ssl_types.eot
@@ -19,7 +19,6 @@ enum Efl.Net.Ssl.Cipher {
@since 1.19
]]
auto, [[The default. Use the best your system supports, disables dangerous ciphers]]
- sslv3, [[SSLv3, insecure and unsupported - DANGEROUS]]
tlsv1, [[TLSv1, secure and widely available]]
tlsv1_1, [[TLSv1.1, secure]]
tlsv1_2, [[TLSv1.2, secure]]
diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h
index bede4e5406..fb1884be2d 100644
--- a/src/lib/ecore_drm2/Ecore_Drm2.h
+++ b/src/lib/ecore_drm2/Ecore_Drm2.h
@@ -39,6 +39,17 @@ typedef enum _Ecore_Drm2_Fb_Status
ECORE_DRM2_FB_STATUS_PLANE_RELEASE = 32,
} Ecore_Drm2_Fb_Status;
+typedef enum _Ecore_Drm2_Relative_Mode
+{
+ ECORE_DRM2_RELATIVE_MODE_UNKNOWN,
+ ECORE_DRM2_RELATIVE_MODE_NONE,
+ ECORE_DRM2_RELATIVE_MODE_CLONE,
+ ECORE_DRM2_RELATIVE_MODE_TO_LEFT,
+ ECORE_DRM2_RELATIVE_MODE_TO_RIGHT,
+ ECORE_DRM2_RELATIVE_MODE_TO_ABOVE,
+ ECORE_DRM2_RELATIVE_MODE_TO_BELOW
+} Ecore_Drm2_Relative_Mode;
+
/* opaque structure to represent a drm device */
typedef struct _Ecore_Drm2_Device Ecore_Drm2_Device;
@@ -782,6 +793,18 @@ EAPI Eina_Bool ecore_drm2_output_rotation_set(Ecore_Drm2_Output *output, int rot
EAPI void ecore_drm2_output_user_data_set(Ecore_Drm2_Output *o, void *data);
/**
+ * Get the user data for a given output
+ *
+ * @param output The output to get user data for
+ *
+ * @return The user data associated with given output
+ *
+ * @ingroup Ecore_Drm2_Output_Group
+ * @since 1.21
+ */
+EAPI void *ecore_drm2_output_user_data_get(Ecore_Drm2_Output *output);
+
+/**
* Get the subpixel state of the output
* @param output the output
* @return The state value
@@ -791,6 +814,52 @@ EAPI void ecore_drm2_output_user_data_set(Ecore_Drm2_Output *o, void *data);
EAPI unsigned int ecore_drm2_output_subpixel_get(const Ecore_Drm2_Output *output);
/**
+ * Set the relative mode for an output
+ *
+ * @param output The output to set relative mode
+ * @param relative The relative mode to set
+ *
+ * @ingroup Ecore_Drm2_Output_Group
+ * @since 1.21
+ */
+EAPI void ecore_drm2_output_relative_mode_set(Ecore_Drm2_Output *output, Ecore_Drm2_Relative_Mode mode);
+
+/**
+ * Get the relative mode of an output
+ *
+ * @param output The output to retrieve relative mode for
+ *
+ * @return The relative mode of a given output
+ *
+ * @ingroup Ecore_Drm2_Output_Group
+ * @since 1.21
+ */
+EAPI Ecore_Drm2_Relative_Mode ecore_drm2_output_relative_mode_get(Ecore_Drm2_Output *output);
+
+/**
+ * Set which output a given output is relative to
+ *
+ * @param output The output for which to set relative
+ * @param relative The output for which the first output is relative to
+ *
+ * @ingroup Ecore_Drm2_Output_Group
+ * @since 1.21
+ */
+EAPI void ecore_drm2_output_relative_to_set(Ecore_Drm2_Output *output, const char *relative);
+
+/**
+ * Get which output is relative to a given output
+ *
+ * @param output The output for which to retrieve relative
+ *
+ * @return The name of the output which is relative to the given output or NULL
+ *
+ * @ingroup Ecore_Drm2_Output_Group
+ * @since 1.21
+ */
+EAPI const char *ecore_drm2_output_relative_to_get(Ecore_Drm2_Output *output);
+
+/**
* @defgroup Ecore_Drm2_Fb_Group Drm framebuffer functions
*
* Functions that deal with setup of framebuffers
diff --git a/src/lib/ecore_drm2/ecore_drm2_device.c b/src/lib/ecore_drm2/ecore_drm2_device.c
index da35231ba2..f5059f5e68 100644
--- a/src/lib/ecore_drm2/ecore_drm2_device.c
+++ b/src/lib/ecore_drm2/ecore_drm2_device.c
@@ -97,10 +97,11 @@ _drm2_device_find(Elput_Manager *em, const char *seat)
Eina_List *devs, *l;
const char *dev, *ret = NULL, *chosen_dev = NULL;
Eina_Bool found = EINA_FALSE;
- Eina_Bool platform = EINA_FALSE;
Eina_Bool modeset;
int fd;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(seat, NULL);
+
devs = eeze_udev_find_by_subsystem_sysname("drm", "card[0-9]*");
if (!devs) return NULL;
@@ -114,9 +115,7 @@ _drm2_device_find(Elput_Manager *em, const char *seat)
dseat = eeze_udev_syspath_get_property(dev, "ID_SEAT");
if (!dseat) dseat = eina_stringshare_add("seat0");
- if ((seat) && (strcmp(seat, dseat)))
- goto cont;
- else if (strcmp(dseat, "seat0"))
+ if (strcmp(seat, dseat))
goto cont;
fd = elput_manager_open(em, dpath, -1);
@@ -127,30 +126,19 @@ _drm2_device_find(Elput_Manager *em, const char *seat)
if (!modeset)
goto cont;
- dparent = eeze_udev_syspath_get_parent_filtered(dev, "pci", NULL);
- if (!dparent)
- {
- dparent =
- eeze_udev_syspath_get_parent_filtered(dev, "platform", NULL);
- platform = EINA_TRUE;
- }
+ chosen_dev = dev;
+ dparent = eeze_udev_syspath_get_parent_filtered(dev, "pci", NULL);
if (dparent)
{
- if (!platform)
- {
- const char *id;
+ const char *id;
- chosen_dev = dev;
- id = eeze_udev_syspath_get_sysattr(dparent, "boot_vga");
- if (id)
- {
- if (!strcmp(id, "1")) found = EINA_TRUE;
- eina_stringshare_del(id);
- }
+ id = eeze_udev_syspath_get_sysattr(dparent, "boot_vga");
+ if (id)
+ {
+ if (!strcmp(id, "1")) found = EINA_TRUE;
+ eina_stringshare_del(id);
}
- else
- found = EINA_TRUE;
eina_stringshare_del(dparent);
}
diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c
index b160d0795a..e39f26a6da 100644
--- a/src/lib/ecore_drm2/ecore_drm2_outputs.c
+++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c
@@ -87,8 +87,6 @@ _output_event_send(Ecore_Drm2_Output *output)
{
Ecore_Drm2_Event_Output_Changed *ev;
- if ((!output->enabled) && (!output->connected)) return;
-
ev = calloc(1, sizeof(Ecore_Drm2_Event_Output_Changed));
if (!ev) return;
@@ -919,6 +917,7 @@ _output_destroy(Ecore_Drm2_Device *dev EINA_UNUSED, Ecore_Drm2_Output *output)
eina_stringshare_del(output->make);
eina_stringshare_del(output->model);
eina_stringshare_del(output->serial);
+ eina_stringshare_del(output->relative.to);
sym_drmModeFreeProperty(output->dpms);
free(output->edid.blob);
@@ -1175,7 +1174,7 @@ ecore_drm2_output_enabled_set(Ecore_Drm2_Output *output, Eina_Bool enabled)
if (!output->connected) return;
if (output->enabled == enabled) return;
- if (output->enabled)
+ if (enabled)
{
output->enabled = enabled;
ecore_drm2_output_dpms_set(output, DRM_MODE_DPMS_ON);
@@ -1383,7 +1382,8 @@ EAPI Eina_Bool
ecore_drm2_output_cloned_get(Ecore_Drm2_Output *output)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE);
- return output->cloned;
+ return (output->cloned ||
+ output->relative.mode == ECORE_DRM2_RELATIVE_MODE_CLONE);
}
EAPI unsigned int
@@ -1456,6 +1456,13 @@ ecore_drm2_output_user_data_set(Ecore_Drm2_Output *o, void *data)
o->user_data = data;
}
+EAPI void *
+ecore_drm2_output_user_data_get(Ecore_Drm2_Output *output)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(output, NULL);
+ return output->user_data;
+}
+
EAPI void
ecore_drm2_output_gamma_set(Ecore_Drm2_Output *output, uint16_t size, uint16_t *red, uint16_t *green, uint16_t *blue)
{
@@ -1473,17 +1480,24 @@ EAPI int
ecore_drm2_output_supported_rotations_get(Ecore_Drm2_Output *output)
{
int ret = -1;
- Eina_List *l;
- Ecore_Drm2_Plane_State *pstate;
EINA_SAFETY_ON_NULL_RETURN_VAL(output, -1);
- EINA_LIST_FOREACH(output->plane_states, l, pstate)
+ if (_ecore_drm2_use_atomic)
{
- if (pstate->type.value != DRM_PLANE_TYPE_PRIMARY) continue;
- ret = pstate->supported_rotations;
- break;
+ Ecore_Drm2_Plane_State *pstate;
+ Eina_List *l;
+
+ EINA_LIST_FOREACH(output->plane_states, l, pstate)
+ {
+ if (pstate->type.value != DRM_PLANE_TYPE_PRIMARY) continue;
+ ret = pstate->supported_rotations;
+ break;
+ }
}
+ else
+ return (ECORE_DRM2_ROTATION_NORMAL | ECORE_DRM2_ROTATION_90 |
+ ECORE_DRM2_ROTATION_180 | ECORE_DRM2_ROTATION_270);
return ret;
}
@@ -1648,3 +1662,31 @@ ecore_drm2_output_pending_get(Ecore_Drm2_Output *output)
return EINA_FALSE;
}
+
+EAPI void
+ecore_drm2_output_relative_mode_set(Ecore_Drm2_Output *output, Ecore_Drm2_Relative_Mode mode)
+{
+ EINA_SAFETY_ON_NULL_RETURN(output);
+ output->relative.mode = mode;
+}
+
+EAPI Ecore_Drm2_Relative_Mode
+ecore_drm2_output_relative_mode_get(Ecore_Drm2_Output *output)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(output, ECORE_DRM2_RELATIVE_MODE_UNKNOWN);
+ return output->relative.mode;
+}
+
+EAPI void
+ecore_drm2_output_relative_to_set(Ecore_Drm2_Output *output, const char *relative)
+{
+ EINA_SAFETY_ON_NULL_RETURN(output);
+ eina_stringshare_replace(&output->relative.to, relative);
+}
+
+EAPI const char *
+ecore_drm2_output_relative_to_get(Ecore_Drm2_Output *output)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(output, NULL);
+ return output->relative.to;
+}
diff --git a/src/lib/ecore_drm2/ecore_drm2_plane.c b/src/lib/ecore_drm2/ecore_drm2_plane.c
index 796302dc1f..b9601cc347 100644
--- a/src/lib/ecore_drm2/ecore_drm2_plane.c
+++ b/src/lib/ecore_drm2/ecore_drm2_plane.c
@@ -112,8 +112,11 @@ out:
plane->type = pstate->type.value;
plane->output = output;
+ output->planes = eina_list_append(output->planes, plane);
+
if (!_fb_atomic_flip_test(output))
{
+ output->planes = eina_list_remove(output->planes, plane);
plane->state->in_use = EINA_FALSE;
free(plane);
@@ -122,7 +125,6 @@ out:
_ecore_drm2_fb_ref(fb);
DBG("FB %d assigned to Plane %d", fb->id, pstate->obj_id);
- output->planes = eina_list_append(output->planes, plane);
if (fb->status_handler)
fb->status_handler(fb,
diff --git a/src/lib/ecore_drm2/ecore_drm2_private.h b/src/lib/ecore_drm2/ecore_drm2_private.h
index 3c1040d57b..490f1665e4 100644
--- a/src/lib/ecore_drm2/ecore_drm2_private.h
+++ b/src/lib/ecore_drm2/ecore_drm2_private.h
@@ -232,6 +232,12 @@ struct _Ecore_Drm2_Output
Ecore_Drm2_Backlight_Type type;
} backlight;
+ struct
+ {
+ const char *to;
+ Ecore_Drm2_Relative_Mode mode;
+ } relative;
+
drmModeCrtcPtr ocrtc;
/* prep is for state we're preparing and have never
diff --git a/src/lib/ecore_evas/Ecore_Evas.h b/src/lib/ecore_evas/Ecore_Evas.h
index 4063b7655e..e6cc85f5a6 100644
--- a/src/lib/ecore_evas/Ecore_Evas.h
+++ b/src/lib/ecore_evas/Ecore_Evas.h
@@ -9,15 +9,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ECORE_EVAS_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ECORE_EVAS_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -28,7 +28,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
/**
* @file Ecore_Evas.h
@@ -2093,7 +2093,7 @@ EAPI void *ecore_evas_data_get(const Ecore_Evas *ee, const char *key);
*/
EAPI void ecore_evas_data_set(Ecore_Evas *ee, const char *key, const void *data);
-/**
+ /**
* @brief Sets a callback for Ecore_Evas resize events.
*
* @param ee The Ecore_Evas to set callbacks on
@@ -3185,6 +3185,20 @@ EAPI Evas_Object *ecore_evas_vnc_start(Ecore_Evas *ee, const char *addr, int por
#endif
/**
+ * @brief Sets a callback for building new Evas.
+ *
+ * @param ee The Ecore_Evas to set callbacks on
+ * @param func The function to call
+ *
+ * A call to this function will set a callback on an Ecore_Evas, causing
+ * @p func to be called whenever a new Ecore_Evas is created.
+ *
+ * @warning If and when this function is called depends on the underlying
+ * windowing system.
+ */
+EAPI void ecore_evas_callback_new_set(Evas *(*func)(int w, int h));
+
+/**
* @defgroup Ecore_Evas_Ews Ecore_Evas Single Process Windowing System.
* @ingroup Ecore_Evas_Group
*
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index 4c3b13f0e4..904dfda0c7 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -59,8 +59,6 @@
EAPI Eina_Bool _ecore_evas_app_comp_sync = EINA_FALSE;
EAPI int _ecore_evas_log_dom = -1;
static int _ecore_evas_init_count = 0;
-static Ecore_Fd_Handler *_ecore_evas_async_events_fd = NULL;
-static Eina_Bool _ecore_evas_async_events_fd_handler(void *data, Ecore_Fd_Handler *fd_handler);
static Ecore_Idle_Exiter *ecore_evas_idle_exiter = NULL;
static Ecore_Idle_Enterer *ecore_evas_idle_enterer = NULL;
@@ -151,6 +149,8 @@ ecore_evas_render(Ecore_Evas *ee)
{
Eina_Bool rend = EINA_FALSE;
+ if (!ee->evas) return EINA_FALSE;
+
if (ee->in_async_render)
{
DBG("ee=%p is rendering, skip.", ee);
@@ -163,15 +163,14 @@ ecore_evas_render(Ecore_Evas *ee)
ecore_evas_render_prepare(ee);
- ee->in_async_render = 1;
-
- if (!ee->visible)
+ if (!ee->visible || ee->draw_block)
{
evas_norender(ee->evas);
}
else if (ee->can_async_render && !ee->manual_render)
{
rend |= !!evas_render_async(ee->evas);
+ if (rend) ee->in_async_render = 1;
}
else
{
@@ -215,6 +214,8 @@ _ecore_evas_idle_enter(void *data EINA_UNUSED)
}
EINA_INLIST_FOREACH(ecore_evases, ee)
{
+ if (ee->draw_block) continue;
+
if (ee->manual_render)
{
if (ee->engine.func->fn_evas_changed)
@@ -373,7 +374,7 @@ _ecore_evas_dev_added_or_removed(void *data, const Efl_Event *event)
{
Ecore_Evas *ee = data;
- if (event->desc == EFL_CANVAS_EVENT_DEVICE_ADDED)
+ if (event->desc == EFL_CANVAS_SCENE_EVENT_DEVICE_ADDED)
{
if (_is_pointer(event->info))
_ecore_evas_cursor_add(ee, event->info);
@@ -403,8 +404,8 @@ _ecore_evas_dev_added_or_removed(void *data, const Efl_Event *event)
}
EFL_CALLBACKS_ARRAY_DEFINE(_ecore_evas_device_cbs,
- { EFL_CANVAS_EVENT_DEVICE_ADDED, _ecore_evas_dev_added_or_removed },
- { EFL_CANVAS_EVENT_DEVICE_REMOVED, _ecore_evas_dev_added_or_removed });
+ { EFL_CANVAS_SCENE_EVENT_DEVICE_ADDED, _ecore_evas_dev_added_or_removed },
+ { EFL_CANVAS_SCENE_EVENT_DEVICE_REMOVED, _ecore_evas_dev_added_or_removed });
Eina_Bool
_ecore_evas_cursors_init(Ecore_Evas *ee)
{
@@ -583,26 +584,9 @@ ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine)
};
}
-static void
-_ecore_evas_fork_cb(void *data EINA_UNUSED)
-{
- int fd;
-
- if (_ecore_evas_async_events_fd)
- ecore_main_fd_handler_del(_ecore_evas_async_events_fd);
- fd = evas_async_events_fd_get();
- if (fd >= 0)
- _ecore_evas_async_events_fd =
- ecore_main_fd_handler_add(fd, ECORE_FD_READ,
- _ecore_evas_async_events_fd_handler, NULL,
- NULL, NULL);
-}
-
EAPI int
ecore_evas_init(void)
{
- int fd;
-
if (++_ecore_evas_init_count != 1)
return _ecore_evas_init_count;
@@ -620,14 +604,6 @@ ecore_evas_init(void)
goto shutdown_ecore;
}
- ecore_fork_reset_callback_add(_ecore_evas_fork_cb, NULL);
- fd = evas_async_events_fd_get();
- if (fd >= 0)
- _ecore_evas_async_events_fd =
- ecore_main_fd_handler_add(fd, ECORE_FD_READ,
- _ecore_evas_async_events_fd_handler, NULL,
- NULL, NULL);
-
ecore_evas_idle_enterer =
ecore_idle_enterer_add(_ecore_evas_idle_enter, NULL);
ecore_evas_idle_exiter =
@@ -690,15 +666,11 @@ ecore_evas_shutdown(void)
while (_ecore_evas_ews_shutdown());
#endif
_ecore_evas_engine_shutdown();
- if (_ecore_evas_async_events_fd)
- ecore_main_fd_handler_del(_ecore_evas_async_events_fd);
-
- ecore_fork_reset_callback_del(_ecore_evas_fork_cb, NULL);
eina_log_domain_unregister(_ecore_evas_log_dom);
_ecore_evas_log_dom = -1;
- evas_shutdown();
ecore_shutdown();
+ evas_shutdown();
return _ecore_evas_init_count;
}
@@ -1832,6 +1804,9 @@ ecore_evas_cursor_set(Ecore_Evas *ee, const char *file,
int layer, int hot_x, int hot_y)
{
Evas_Object *obj = NULL;
+
+ ECORE_EVAS_CHECK(ee);
+
if (file)
{
int x, y;
@@ -3075,7 +3050,8 @@ ecore_evas_animator_tick(Ecore_Evas *ee, Eina_Rectangle *viewport, double loop_t
// FIXME: We do not support partial animator in the subcanvas
EINA_LIST_FOREACH(ee->sub_ecore_evas, l, subee)
{
- ecore_evas_animator_tick(subee, NULL, loop_time);
+ if (subee->evas)
+ ecore_evas_animator_tick(subee, NULL, loop_time);
}
// We are a source of sync for general animator.
@@ -3144,16 +3120,26 @@ _ecore_evas_tick_source_find(void)
{
Ecore_Evas *ee;
Eina_Bool source = EINA_FALSE;
+ Eina_Bool have_x = EINA_FALSE;
// Check if we do have a potential tick source for legacy
EINA_INLIST_FOREACH(ecore_evases, ee)
- if (!ee->deleted &&
- ee->engine.func->fn_animator_register &&
- ee->engine.func->fn_animator_unregister)
- {
- source = EINA_TRUE;
- break;
- }
+ {
+ if (!ee->deleted)
+ {
+ if ((ee->engine.func->fn_animator_register) &&
+ (ee->engine.func->fn_animator_unregister))
+ {
+ source = EINA_TRUE;
+ }
+ if (ee->driver)
+ {
+ if ((!strcmp(ee->driver, "software_x11")) ||
+ (!strcmp(ee->driver, "opengl_x11")))
+ have_x = EINA_TRUE;
+ }
+ }
+ }
// If just one source require fallback, we can't be sure that
// we are not running enlightenment and that this source might
@@ -3170,16 +3156,21 @@ _ecore_evas_tick_source_find(void)
if (!source)
{
- ecore_animator_source_set(ECORE_ANIMATOR_SOURCE_TIMER);
+ if (!have_x)
+ {
+ ecore_animator_custom_source_tick_begin_callback_set(NULL, NULL);
+ ecore_animator_custom_source_tick_end_callback_set(NULL, NULL);
+ ecore_animator_source_set(ECORE_ANIMATOR_SOURCE_TIMER);
+ }
}
else
{
// Source set will trigger the previous tick end registered and then the new begin.
// As we don't what was in behind, better first begin and end after source is set.
ecore_animator_custom_source_tick_begin_callback_set(_ecore_evas_custom_tick_begin, NULL);
- ecore_animator_source_set(ECORE_ANIMATOR_SOURCE_CUSTOM);
ecore_animator_custom_source_tick_end_callback_set(_ecore_evas_custom_tick_end, NULL);
- }
+ ecore_animator_source_set(ECORE_ANIMATOR_SOURCE_CUSTOM);
+ }
}
static Eina_Bool
@@ -3192,7 +3183,7 @@ _ecore_evas_animator_fallback(void *data)
static void
_check_animator_event_catcher_add(void *data, const Efl_Event *event)
{
- const Efl_Callback_Array_Item *array = event->info;
+ const Efl_Callback_Array_Item_Full *array = event->info;
Ecore_Evas *ee = data;
int i;
@@ -3226,7 +3217,7 @@ _check_animator_event_catcher_add(void *data, const Efl_Event *event)
static void
_check_animator_event_catcher_del(void *data, const Efl_Event *event)
{
- const Efl_Callback_Array_Item *array = event->info;
+ const Efl_Callback_Array_Item_Full *array = event->info;
Ecore_Evas *ee = data;
int i;
@@ -3268,6 +3259,8 @@ _ecore_evas_register_animators(Ecore_Evas *ee)
EAPI void
_ecore_evas_register(Ecore_Evas *ee)
{
+ if (ee->registered) return;
+
ee->registered = 1;
ecore_evases = (Ecore_Evas *)eina_inlist_prepend
(EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
@@ -3284,10 +3277,12 @@ _ecore_evas_register(Ecore_Evas *ee)
EAPI void
_ecore_evas_subregister(Ecore_Evas *ee_target, Ecore_Evas *ee)
{
- _ecore_evas_register_animators(ee);
-
ee_target->sub_ecore_evas = eina_list_append(ee_target->sub_ecore_evas, ee);
+ if (!ee->evas) return;
+
+ _ecore_evas_register_animators(ee);
+
if (!ee->engine.func->fn_render)
evas_event_callback_priority_add(ee->evas, EVAS_CALLBACK_RENDER_POST, EVAS_CALLBACK_PRIORITY_AFTER,
_evas_evas_buffer_rendered, ee);
@@ -3418,14 +3413,6 @@ _ecore_evas_cb_idle_flush(void *data)
return ECORE_CALLBACK_CANCEL;
}
-static Eina_Bool
-_ecore_evas_async_events_fd_handler(void *data EINA_UNUSED, Ecore_Fd_Handler *fd_handler EINA_UNUSED)
-{
- evas_async_events_process();
-
- return ECORE_CALLBACK_RENEW;
-}
-
EAPI void
_ecore_evas_idle_timeout_update(Ecore_Evas *ee)
{
@@ -3531,7 +3518,7 @@ _ecore_evas_mouse_move_process_internal(Ecore_Evas *ee,
efl_event_callback_legacy_call(ee->evas,
_event_description_get(ev->action), evt);
- efl_del(evt);
+ efl_unref(evt);
}
EAPI void
@@ -3744,12 +3731,7 @@ ecore_evas_sub_ecore_evas_list_get(const Ecore_Evas *ee)
EAPI void
ecore_evas_input_event_register(Ecore_Evas *ee)
{
- ecore_event_window_register(ee->prop.window, ee, ee->evas,
- (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
- (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
- (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
- (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
- _ecore_event_window_direct_cb_set((Ecore_Window)ee, _ecore_evas_input_direct_cb);
+ ecore_evas_done(ee, EINA_FALSE);
}
EAPI void
@@ -4692,7 +4674,7 @@ _direct_mouse_updown(Ecore_Evas *ee, const Ecore_Event_Mouse_Button *info, Efl_P
efl_event_callback_legacy_call(e, _event_description_get(ev->action), evt);
processed = ev->evas_done;
- efl_del(evt);
+ efl_unref(evt);
return processed;
}
@@ -4754,7 +4736,7 @@ _direct_mouse_move_cb(Ecore_Evas *ee, const Ecore_Event_Mouse_Move *info)
efl_event_callback_legacy_call(e, _event_description_get(ev->action), evt);
processed = ev->evas_done;
- efl_del(evt);
+ efl_unref(evt);
return processed;
}
@@ -4789,7 +4771,7 @@ _direct_mouse_wheel_cb(Ecore_Evas *ee, const Ecore_Event_Mouse_Wheel *info)
efl_event_callback_legacy_call(e, _event_description_get(ev->action), evt);
processed = ev->evas_done;
- efl_del(evt);
+ efl_unref(evt);
return processed;
}
@@ -4819,7 +4801,7 @@ _direct_mouse_inout(Ecore_Evas *ee, const Ecore_Event_Mouse_IO *info, Efl_Pointe
efl_event_callback_legacy_call(e, _event_description_get(ev->action), evt);
processed = ev->evas_done;
- efl_del(evt);
+ efl_unref(evt);
return processed;
}
@@ -4949,7 +4931,7 @@ _direct_axis_update_cb(Ecore_Evas *ee, const Ecore_Event_Axis_Update *info)
efl_event_callback_legacy_call(e, _event_description_get(ev->action), evt);
processed = ev->evas_done;
- efl_del(evt);
+ efl_unref(evt);
return processed;
}
@@ -4991,7 +4973,7 @@ _direct_key_updown_cb(Ecore_Evas *ee, const Ecore_Event_Key *info, Eina_Bool dow
efl_event_callback_legacy_call(e, EFL_EVENT_KEY_UP, evt);
processed = ev->evas_done;
- efl_del(evt);
+ efl_unref(evt);
return processed;
}
@@ -5087,3 +5069,54 @@ ecore_evas_callback_device_mouse_in_set(Ecore_Evas *ee,
IFE;
ee->func.fn_device_mouse_in = func;
}
+
+static Evas *(*replacement_new)(int w, int h) = NULL;
+
+EAPI void
+ecore_evas_callback_new_set(Evas *(*func)(int w, int h))
+{
+ replacement_new = func;
+}
+
+EAPI Evas *
+ecore_evas_evas_new(Ecore_Evas *ee, int w, int h)
+{
+ Evas *e;
+
+ if (ee->evas) return ee->evas;
+
+ if (replacement_new) e = replacement_new(w, h);
+ else e = evas_new();
+ if (!e) return NULL;
+
+ ee->evas = e;
+ evas_data_attach_set(e, ee);
+
+ if (ECORE_EVAS_PORTRAIT(ee))
+ {
+ evas_output_size_set(e, w, h);
+ evas_output_viewport_set(e, 0, 0, w, h);
+ }
+ else
+ {
+ evas_output_size_set(e, h, w);
+ evas_output_viewport_set(e, 0, 0, h, w);
+ }
+
+ return e;
+}
+
+EAPI void
+ecore_evas_done(Ecore_Evas *ee, Eina_Bool single_window)
+{
+ _ecore_evas_register(ee);
+ ecore_event_window_register(ee->prop.window, ee, ee->evas,
+ (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
+ (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
+ (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
+ (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
+ _ecore_event_window_direct_cb_set(ee->prop.window, _ecore_evas_input_direct_cb);
+
+ if (single_window)
+ evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
+}
diff --git a/src/lib/ecore_evas/ecore_evas_buffer.c b/src/lib/ecore_evas/ecore_evas_buffer.c
index dcb9fa13f1..cad4999337 100644
--- a/src/lib/ecore_evas/ecore_evas_buffer.c
+++ b/src/lib/ecore_evas/ecore_evas_buffer.c
@@ -38,6 +38,16 @@ _ecore_evas_buffer_free(Ecore_Evas *ee)
}
static void
+_ecore_evas_move(Ecore_Evas *ee, int x, int y)
+{
+ Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
+
+ if (bdata->image) return;
+ ee->x = ee->req.x = x;
+ ee->y = ee->req.y = y;
+}
+
+static void
_ecore_evas_resize(Ecore_Evas *ee, int w, int h)
{
Evas_Engine_Info_Buffer *einfo;
@@ -90,7 +100,8 @@ _ecore_evas_resize(Ecore_Evas *ee, int w, int h)
}
if (bdata->image)
evas_object_image_data_set(bdata->image, bdata->pixels);
- if (ee->func.fn_resize) ee->func.fn_resize(ee);
+ else
+ bdata->resized = 1;
}
static void
@@ -153,6 +164,11 @@ _ecore_evas_buffer_prepare(Ecore_Evas *ee)
_ecore_evas_resize(ee, w, h);
bdata->pixels = evas_object_image_data_get(bdata->image, 1);
}
+ else if (bdata->resized)
+ {
+ if (ee->func.fn_resize) ee->func.fn_resize(ee);
+ bdata->resized = 0;
+ }
return EINA_TRUE;
}
@@ -493,7 +509,8 @@ _ecore_evas_buffer_alpha_set(Ecore_Evas *ee, int alpha)
einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_ARGB32;
else
einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB32;
- evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
+ if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
+ ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
}
}
}
@@ -637,7 +654,7 @@ static Ecore_Evas_Engine_Func _ecore_buffer_engine_func =
NULL,
NULL,
NULL,
- NULL,
+ _ecore_evas_move,
NULL,
_ecore_evas_resize,
_ecore_evas_move_resize,
@@ -783,11 +800,14 @@ ecore_evas_buffer_allocfunc_new(int w, int h,
ee->prop.sticky = EINA_FALSE;
/* init evas here */
- ee->evas = evas_new();
- evas_data_attach_set(ee->evas, ee);
+ if (!ecore_evas_evas_new(ee, w, h))
+ {
+ ERR("Can not create a Canvas.");
+ ecore_evas_free(ee);
+ return NULL;
+ }
+
evas_output_method_set(ee->evas, rmethod);
- evas_output_size_set(ee->evas, w, h);
- evas_output_viewport_set(ee->evas, 0, 0, w, h);
bdata->pixels = bdata->alloc_func(bdata->data, w * h * sizeof(int));
diff --git a/src/lib/ecore_evas/ecore_evas_buffer.h b/src/lib/ecore_evas/ecore_evas_buffer.h
index e29dee335b..1249c380f4 100644
--- a/src/lib/ecore_evas/ecore_evas_buffer.h
+++ b/src/lib/ecore_evas/ecore_evas_buffer.h
@@ -10,6 +10,7 @@ struct _Ecore_Evas_Engine_Buffer_Data {
void *(*alloc_func) (void *data, int size);
void *data;
Eina_Bool in_render : 1;
+ Eina_Bool resized : 1;
};
#endif /* _ECORE_EVAS_BUFFER_PRIVATE_H_ */
diff --git a/src/lib/ecore_evas/ecore_evas_drm.h b/src/lib/ecore_evas/ecore_evas_drm.h
index 0b20e82c87..401fb1e8f7 100644
--- a/src/lib/ecore_evas/ecore_evas_drm.h
+++ b/src/lib/ecore_evas/ecore_evas_drm.h
@@ -1,6 +1,8 @@
#ifndef ECORE_EVAS_DRM_H_
# define ECORE_EVAS_DRM_H_
+# include "Evas_Internal.h"
+
typedef struct _Ecore_Evas_Interface_Drm Ecore_Evas_Interface_Drm;
struct _Ecore_Evas_Interface_Drm
diff --git a/src/lib/ecore_evas/ecore_evas_module.c b/src/lib/ecore_evas/ecore_evas_module.c
index 9d5e6ad075..a6ce6bec51 100644
--- a/src/lib/ecore_evas/ecore_evas_module.c
+++ b/src/lib/ecore_evas/ecore_evas_module.c
@@ -9,6 +9,8 @@
#include "ecore_evas_private.h"
#include <unistd.h>
+#include "../../static_libs/buildsystem/buildsystem.h"
+
static Eina_Hash *_registered_engines = NULL;
static Eina_List *_engines_paths = NULL;
static Eina_List *_engines_available = NULL;
@@ -63,26 +65,23 @@ Eina_Module *
_ecore_evas_vnc_server_module_load(void)
{
char *prefix;
+ char buf[PATH_MAX];
if (_ecore_evas_vnc)
return _ecore_evas_vnc;
-#ifdef NEED_RUN_IN_TREE
+ if (bs_mod_get(buf, sizeof(buf), "ecore_evas", "vnc_server"))
+ {
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
- if (getuid() == geteuid())
+ if (getuid() == geteuid())
#endif
- {
- if (getenv("EFL_RUN_IN_TREE"))
{
- _ecore_evas_vnc = _ecore_evas_vnc_server_module_try_load(PACKAGE_BUILD_DIR
- "/src/modules/ecore_evas/vnc_server/.libs/"
- ECORE_EVAS_ENGINE_NAME,
+ _ecore_evas_vnc = _ecore_evas_vnc_server_module_try_load(buf,
EINA_TRUE);
if (_ecore_evas_vnc)
return _ecore_evas_vnc;
}
}
-#endif
prefix = eina_module_symbol_path_get(_ecore_evas_vnc_server_module_load,
"/ecore_evas");
@@ -105,41 +104,31 @@ _ecore_evas_engine_load(const char *engine)
const char *path;
Eina_List *l;
Eina_Module *em = NULL;
-#ifdef NEED_RUN_IN_TREE
- Eina_Bool run_in_tree;
-#endif
+ char tmp[PATH_MAX] = "";
EINA_SAFETY_ON_NULL_RETURN_VAL(engine, NULL);
em = (Eina_Module *)eina_hash_find(_registered_engines, engine);
if (em) return em;
-#ifdef NEED_RUN_IN_TREE
- run_in_tree = !!getenv("EFL_RUN_IN_TREE");
-#endif
-
- EINA_LIST_FOREACH(_engines_paths, l, path)
+ if (bs_mod_get(tmp, sizeof(tmp), "ecore_evas/engines", engine))
{
- char tmp[PATH_MAX] = "";
+ em = eina_module_new(tmp);
+ if (!em) return NULL;
-#ifdef NEED_RUN_IN_TREE
-#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
- if (getuid() == geteuid())
-#endif
+ if (!eina_module_load(em))
{
- if (run_in_tree)
- {
- snprintf(tmp, sizeof(tmp), "%s/%s/.libs/%s",
- path, engine, ECORE_EVAS_ENGINE_NAME);
- if (!_file_exists(tmp))
- tmp[0] = '\0';
- }
+ eina_module_free(em);
+ return NULL;
}
-#endif
+ if (eina_hash_add(_registered_engines, engine, em))
+ return em;
+ }
- if (tmp[0] == '\0')
- snprintf(tmp, sizeof(tmp), "%s/%s/%s/%s",
- path, engine, MODULE_ARCH, ECORE_EVAS_ENGINE_NAME);
+ EINA_LIST_FOREACH(_engines_paths, l, path)
+ {
+ snprintf(tmp, sizeof(tmp), "%s/%s/%s/%s",
+ path, engine, MODULE_ARCH, ECORE_EVAS_ENGINE_NAME);
em = eina_module_new(tmp);
if (!em) continue;
@@ -167,23 +156,6 @@ _ecore_evas_engine_init(void)
// _registered_engines = eina_hash_string_small_new(EINA_FREE_CB(eina_module_free));
_registered_engines = eina_hash_string_small_new(NULL);
-#ifdef NEED_RUN_IN_TREE
-#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
- if (getuid() == geteuid())
-#endif
- {
- if (getenv("EFL_RUN_IN_TREE"))
- {
- const char mp[] = PACKAGE_BUILD_DIR"/src/modules/ecore_evas/engines/";
- if (_file_exists(mp))
- {
- _engines_paths = eina_list_append(_engines_paths, strdup(mp));
- return;
- }
- }
- }
-#endif
-
/* 1. libecore_evas.so/../ecore_evas/engines/ */
paths[0] = eina_module_symbol_path_get(_ecore_evas_engine_init, "/ecore_evas/engines");
#ifndef _WIN32
@@ -218,7 +190,7 @@ _ecore_evas_engine_shutdown(void)
_registered_engines = NULL;
}
*/
-
+
EINA_LIST_FREE(_engines_paths, path)
free(path);
diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h
index 7b83589347..c419699296 100644
--- a/src/lib/ecore_evas/ecore_evas_private.h
+++ b/src/lib/ecore_evas/ecore_evas_private.h
@@ -6,15 +6,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ECORE_EVAS_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ECORE_EVAS_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -25,7 +25,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#define ECORE_MAGIC_EVAS 0x76543211
@@ -213,7 +213,7 @@ struct _Ecore_Evas
short rotation;
Eina_Bool shaped : 1;
Eina_Bool visible : 1;
- Eina_Bool draw_ok : 1;
+ Eina_Bool draw_block : 1;
Eina_Bool should_be_visible : 1;
Eina_Bool alpha : 1;
Eina_Bool transparent : 1;
@@ -347,7 +347,7 @@ struct _Ecore_Evas
} delayed;
int refcount;
-#define ECORE_EVAS_ASYNC_RENDER_DEBUG 1 /* TODO: remove me */
+//#define ECORE_EVAS_ASYNC_RENDER_DEBUG 1 /* TODO: remove me */
#ifdef ECORE_EVAS_ASYNC_RENDER_DEBUG
double async_render_start;
#endif
@@ -487,6 +487,9 @@ Eina_Bool _ecore_evas_cursors_init(Ecore_Evas *ee);
EAPI void ecore_evas_render_wait(Ecore_Evas *ee);
EAPI Eina_Bool ecore_evas_render(Ecore_Evas *ee);
+EAPI Evas *ecore_evas_evas_new(Ecore_Evas *ee, int w, int h);
+EAPI void ecore_evas_done(Ecore_Evas *ee, Eina_Bool single_window);
+
static inline Eina_Bool
ecore_evas_render_prepare(Ecore_Evas *ee)
{
diff --git a/src/lib/ecore_fb/ecore_fb_li.c b/src/lib/ecore_fb/ecore_fb_li.c
index 453817bf97..38500798b2 100644
--- a/src/lib/ecore_fb/ecore_fb_li.c
+++ b/src/lib/ecore_fb/ecore_fb_li.c
@@ -634,7 +634,7 @@ EAPI void
ecore_fb_input_device_axis_size_set(Ecore_Fb_Input_Device *dev, int w, int h)
{
if (!dev) return;
- if ((w < 0) || (h < 0)) return;
+ if ((w <= 0) || (h <= 0)) return;
/* FIXME
* this code is for a touchscreen device,
* make it configurable (ABSOLUTE | RELATIVE)
diff --git a/src/lib/ecore_file/Ecore_File.h b/src/lib/ecore_file/Ecore_File.h
index 57cb550e30..50c85eaa7e 100644
--- a/src/lib/ecore_file/Ecore_File.h
+++ b/src/lib/ecore_file/Ecore_File.h
@@ -13,15 +13,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ECORE_FILE_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ECORE_FILE_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -32,7 +32,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
/**
* @file Ecore_File.h
@@ -319,9 +319,10 @@ EAPI Eina_Bool ecore_file_mv (const char *src, const char *dst);
* @param dest The name of link.
* @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
*
- * This function create the symbolic link @p dest of @p src. This
- * function does not work on Windows. It returns @c EINA_TRUE on success,
- * @c EINA_FALSE otherwise.
+ * This function creates the symbolic link @p dest of @p src. It returns
+ * @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ *
+ * @note On windows, this function always returns @c EINA_FALSE.
*/
EAPI Eina_Bool ecore_file_symlink (const char *src, const char *dest);
@@ -426,9 +427,10 @@ EAPI Eina_Bool ecore_file_can_exec (const char *file);
* @return The path pointed by link or NULL.
*
* This function returns the path pointed by @p link as a newly
- * allocated string. This function does not work on Windows. On
- * failure, the function returns @c NULL. When not needed anymore, the
- * returned value must be freed.
+ * allocated string. On failure, the function returns @c NULL. When not
+ * needed anymore, the returned value must be freed.
+ *
+ * @note On windows, this function always returns @c NULL.
*/
EAPI char *ecore_file_readlink (const char *link);
diff --git a/src/lib/ecore_file/ecore_file.c b/src/lib/ecore_file/ecore_file.c
index 15d96edb6e..4780350de0 100644
--- a/src/lib/ecore_file/ecore_file.c
+++ b/src/lib/ecore_file/ecore_file.c
@@ -320,11 +320,6 @@ ecore_file_recursive_rm(const char *dir)
Eina_Bool is_dir;
#ifdef _WIN32
- char buf[PATH_MAX];
-
- if (readlink(dir, buf, sizeof(buf) - 1) > 0)
- return ecore_file_unlink(dir);
-
if (!_ecore_file_stat(dir, NULL, NULL, NULL, &is_dir, NULL))
return EINA_FALSE;
#else
@@ -492,7 +487,7 @@ ecore_file_mv(const char *src, const char *dst)
}
// Set file permissions of temp file to match src
- if (chmod(buf, mode) == -1)
+ if (chmod(tmpstr, mode) == -1)
{
eina_tmpstr_del(tmpstr);
goto FAIL;
@@ -545,9 +540,13 @@ FAIL:
EAPI Eina_Bool
ecore_file_symlink(const char *src, const char *dest)
{
- if (!symlink(src, dest)) return EINA_TRUE;
-
+#ifndef _WIN32
+ return !symlink(src, dest);
+#else
return EINA_FALSE;
+ (void)src;
+ (void)dest;
+#endif
}
EAPI char *
@@ -630,12 +629,17 @@ ecore_file_can_exec(const char *file)
EAPI char *
ecore_file_readlink(const char *link)
{
+#ifndef _WIN32
char buf[PATH_MAX];
int count;
if ((count = readlink(link, buf, sizeof(buf) - 1)) < 0) return NULL;
buf[count] = 0;
return strdup(buf);
+#else
+ return NULL;
+ (void)link;
+#endif
}
EAPI Eina_List *
diff --git a/src/lib/ecore_file/ecore_file_download.c b/src/lib/ecore_file/ecore_file_download.c
index 1323dbc8e6..54666693d2 100644
--- a/src/lib/ecore_file/ecore_file_download.c
+++ b/src/lib/ecore_file/ecore_file_download.c
@@ -230,14 +230,14 @@ ecore_file_download_full(const char *url,
efl_file_set(efl_added, dst, NULL),
efl_io_file_flags_set(efl_added, O_WRONLY | O_CREAT),
efl_io_closer_close_on_exec_set(efl_added, EINA_TRUE),
- efl_io_closer_close_on_destructor_set(efl_added, EINA_TRUE),
+ efl_io_closer_close_on_invalidate_set(efl_added, EINA_TRUE),
efl_io_file_mode_set(efl_added, 0644));
EINA_SAFETY_ON_NULL_GOTO(job->output, error_output);
job->copier = efl_add(EFL_IO_COPIER_CLASS, loop,
efl_io_copier_source_set(efl_added, job->input),
efl_io_copier_destination_set(efl_added, job->output),
- efl_io_closer_close_on_destructor_set(efl_added, EINA_TRUE),
+ efl_io_closer_close_on_invalidate_set(efl_added, EINA_TRUE),
efl_event_callback_array_add(efl_added, ecore_file_download_copier_cbs(), job));
EINA_SAFETY_ON_NULL_GOTO(job->copier, error_copier);
diff --git a/src/lib/ecore_file/ecore_file_monitor_inotify.c b/src/lib/ecore_file/ecore_file_monitor_inotify.c
index 7c8d5c9e79..988893de4f 100644
--- a/src/lib/ecore_file/ecore_file_monitor_inotify.c
+++ b/src/lib/ecore_file/ecore_file_monitor_inotify.c
@@ -47,8 +47,27 @@ static int _ecore_file_monitor_inotify_monitor(Ecore_File_Monito
static void _ecore_file_monitor_inotify_print(char *file, int mask);
#endif
+static Eina_Bool reseting;
static Eina_Hash *monitor_hash;
+static void
+_ecore_file_monitor_inotify_reset()
+{
+ Eina_Iterator *it;
+ Ecore_File_Monitor *em;
+ Eina_Hash *h = monitor_hash;
+ monitor_hash = NULL;
+ reseting = 1;
+ ecore_file_monitor_backend_shutdown();
+ ecore_file_monitor_backend_init();
+ it = eina_hash_iterator_data_new(h);
+ EINA_ITERATOR_FOREACH(it, em)
+ _ecore_file_monitor_inotify_monitor(em, em->path);
+ eina_iterator_free(it);
+ eina_hash_free(h);
+ reseting = 0;
+}
+
int
ecore_file_monitor_backend_init(void)
{
@@ -68,6 +87,8 @@ ecore_file_monitor_backend_init(void)
return 0;
}
+ if (!reseting)
+ ecore_fork_reset_callback_add(_ecore_file_monitor_inotify_reset, NULL);
_inotify_fd_pid = getpid();
monitor_hash = eina_hash_int32_new(NULL);
return 1;
@@ -87,10 +108,13 @@ ecore_file_monitor_backend_shutdown(void)
ecore_main_fd_handler_del(_fdh);
if (fd > -1)
close(fd);
+ _fdh = NULL;
}
eina_hash_free(monitor_hash);
monitor_hash = NULL;
_inotify_fd_pid = -1;
+ if (!reseting)
+ ecore_fork_reset_callback_del(_ecore_file_monitor_inotify_reset, NULL);
return 1;
}
@@ -108,10 +132,7 @@ ecore_file_monitor_backend_add(const char *path,
if (_inotify_fd_pid == -1) return NULL;
if (_inotify_fd_pid != getpid())
- {
- ecore_file_monitor_backend_shutdown();
- ecore_file_monitor_backend_init();
- }
+ _ecore_file_monitor_inotify_reset();
em = (Ecore_File_Monitor *)calloc(1, sizeof(Ecore_File_Monitor_Inotify));
if (!em) return NULL;
@@ -144,7 +165,7 @@ ecore_file_monitor_backend_del(Ecore_File_Monitor *em)
eina_hash_list_remove(monitor_hash, &ECORE_FILE_MONITOR_INOTIFY(em)->wd, em);
fd = ecore_main_fd_handler_fd_get(_fdh);
- if (ECORE_FILE_MONITOR_INOTIFY(em)->wd)
+ if (ECORE_FILE_MONITOR_INOTIFY(em)->wd >= 0)
inotify_rm_watch(fd, ECORE_FILE_MONITOR_INOTIFY(em)->wd);
eina_stringshare_del(em->path);
free(em);
@@ -153,7 +174,7 @@ ecore_file_monitor_backend_del(Ecore_File_Monitor *em)
static Eina_Bool
_ecore_file_monitor_inotify_handler(void *data EINA_UNUSED, Ecore_Fd_Handler *fdh)
{
- Eina_List *l, *ll;
+ Eina_List *l, *ll, *ll2;
Ecore_File_Monitor *em;
char buffer[16384];
struct inotify_event *event;
@@ -173,7 +194,7 @@ _ecore_file_monitor_inotify_handler(void *data EINA_UNUSED, Ecore_Fd_Handler *fd
i += event_size;
l = _ecore_file_monitor_inotify_monitor_find(event->wd);
- EINA_LIST_FOREACH(l, ll, em)
+ EINA_LIST_FOREACH_SAFE(l, ll, ll2, em)
_ecore_file_monitor_inotify_events(em, (event->len ? event->name : NULL), event->mask);
}
diff --git a/src/lib/ecore_imf/Ecore_IMF.h b/src/lib/ecore_imf/Ecore_IMF.h
index 0fc821da2f..d9ba33bd0f 100644
--- a/src/lib/ecore_imf/Ecore_IMF.h
+++ b/src/lib/ecore_imf/Ecore_IMF.h
@@ -8,15 +8,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ECORE_IMF_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ECORE_IMF_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -27,7 +27,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#ifdef __cplusplus
extern "C" {
@@ -195,7 +195,9 @@ typedef enum
ECORE_IMF_CALLBACK_DELETE_SURROUNDING, /**< "DELETE_SURROUNDING" is called when the input method needs to delete all or part of the context surrounding the cursor @since 1.2 */
ECORE_IMF_CALLBACK_SELECTION_SET, /**< "SELECTION_SET" is called when the input method needs to set the selection @since 1.9 */
ECORE_IMF_CALLBACK_PRIVATE_COMMAND_SEND, /**< "PRIVATE_COMMAND_SEND" is called when the input method sends a private command @since 1.12 */
- ECORE_IMF_CALLBACK_COMMIT_CONTENT /**< "COMMIT_CONTENT" is called when the input method commits content such as an image @since 1.20 */
+ ECORE_IMF_CALLBACK_COMMIT_CONTENT, /**< "COMMIT_CONTENT" is called when the input method commits content such as an image @since 1.20 */
+ ECORE_IMF_CALLBACK_TRANSACTION_START, /**< "TRANSACTION_START" is called when a new transaction sequence starts. @since 1.21 */
+ ECORE_IMF_CALLBACK_TRANSACTION_END /**< "TRANSACTION_END" is called when a new transaction sequence starts. @since 1.21 */
} Ecore_IMF_Callback_Type;
/**
@@ -378,13 +380,12 @@ typedef enum
ECORE_IMF_INPUT_HINT_AUTOFILL_CREDIT_CARD_EXPIRATION_MONTH = 0x300, /**< Autofill hint for a credit card expiration month @since 1.21 */
ECORE_IMF_INPUT_HINT_AUTOFILL_CREDIT_CARD_EXPIRATION_YEAR = 0x400, /**< Autofill hint for a credit card expiration year @since 1.21 */
ECORE_IMF_INPUT_HINT_AUTOFILL_CREDIT_CARD_NUMBER = 0x500, /**< Autofill hint for a credit card number @since 1.21 */
- ECORE_IMF_INPUT_HINT_AUTOFILL_CREDIT_CARD_SECURITY_CODE = 0x600, /**< Autofill hint for a credit card security code @since 1.21 */
- ECORE_IMF_INPUT_HINT_AUTOFILL_EMAIL_ADDRESS = 0x700, /**< Autofill hint for an email address @since 1.21 */
- ECORE_IMF_INPUT_HINT_AUTOFILL_NAME = 0x800, /**< Autofill hint for a user's real name @since 1.21 */
- ECORE_IMF_INPUT_HINT_AUTOFILL_PHONE = 0x900, /**< Autofill hint for a phone number @since 1.21 */
- ECORE_IMF_INPUT_HINT_AUTOFILL_POSTAL_ADDRESS = 0xA00, /**< Autofill hint for a postal address @since 1.21 */
- ECORE_IMF_INPUT_HINT_AUTOFILL_POSTAL_CODE = 0xB00, /**< Autofill hint for a postal code @since 1.21 */
- ECORE_IMF_INPUT_HINT_AUTOFILL_ID = 0xC00 /**< Autofill hint for a user's ID @since 1.21 */
+ ECORE_IMF_INPUT_HINT_AUTOFILL_EMAIL_ADDRESS = 0x600, /**< Autofill hint for an email address @since 1.21 */
+ ECORE_IMF_INPUT_HINT_AUTOFILL_NAME = 0x700, /**< Autofill hint for a user's real name @since 1.21 */
+ ECORE_IMF_INPUT_HINT_AUTOFILL_PHONE = 0x800, /**< Autofill hint for a phone number @since 1.21 */
+ ECORE_IMF_INPUT_HINT_AUTOFILL_POSTAL_ADDRESS = 0x900, /**< Autofill hint for a postal address @since 1.21 */
+ ECORE_IMF_INPUT_HINT_AUTOFILL_POSTAL_CODE = 0xA00, /**< Autofill hint for a postal code @since 1.21 */
+ ECORE_IMF_INPUT_HINT_AUTOFILL_ID = 0xB00 /**< Autofill hint for a user's ID @since 1.21 */
} Ecore_IMF_Input_Hints;
/**
diff --git a/src/lib/ecore_imf/ecore_imf_context.c b/src/lib/ecore_imf/ecore_imf_context.c
index a04708fa8d..270004e81b 100644
--- a/src/lib/ecore_imf/ecore_imf_context.c
+++ b/src/lib/ecore_imf/ecore_imf_context.c
@@ -210,7 +210,7 @@ ecore_imf_context_del(Ecore_IMF_Context *ctx)
if (show_req_ctx == ctx)
show_req_ctx = NULL;
- if (ctx->klass->del) ctx->klass->del(ctx);
+ if (ctx->klass && ctx->klass->del) ctx->klass->del(ctx);
if (ctx->callbacks)
{
@@ -240,7 +240,8 @@ ecore_imf_context_client_window_set(Ecore_IMF_Context *ctx, void *window)
"ecore_imf_context_client_window_set");
return;
}
- if (ctx->klass->client_window_set) ctx->klass->client_window_set(ctx, window);
+
+ if (ctx->klass && ctx->klass->client_window_set) ctx->klass->client_window_set(ctx, window);
ctx->window = window;
}
@@ -265,7 +266,8 @@ ecore_imf_context_client_canvas_set(Ecore_IMF_Context *ctx, void *canvas)
"ecore_imf_context_client_canvas_set");
return;
}
- if (ctx->klass->client_canvas_set) ctx->klass->client_canvas_set(ctx, canvas);
+
+ if (ctx->klass && ctx->klass->client_canvas_set) ctx->klass->client_canvas_set(ctx, canvas);
ctx->client_canvas = canvas;
}
@@ -292,7 +294,7 @@ ecore_imf_context_show(Ecore_IMF_Context *ctx)
}
show_req_ctx = ctx;
- if (ctx->klass->show) ctx->klass->show(ctx);
+ if (ctx->klass && ctx->klass->show) ctx->klass->show(ctx);
}
EAPI void
@@ -305,7 +307,7 @@ ecore_imf_context_hide(Ecore_IMF_Context *ctx)
return;
}
- if (ctx->klass->hide) ctx->klass->hide(ctx);
+ if (ctx->klass && ctx->klass->hide) ctx->klass->hide(ctx);
}
EAPI void
@@ -317,7 +319,8 @@ ecore_imf_context_preedit_string_get(Ecore_IMF_Context *ctx, char **str, int *cu
"ecore_imf_context_preedit_string_get");
return;
}
- if (ctx->klass->preedit_string_get)
+
+ if (ctx->klass && ctx->klass->preedit_string_get)
ctx->klass->preedit_string_get(ctx, str, cursor_pos);
else
{
@@ -335,7 +338,7 @@ ecore_imf_context_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx, cha
"ecore_imf_context_preedit_string_with_attributes_get");
return;
}
- if (ctx->klass->preedit_string_with_attributes_get)
+ if (ctx->klass && ctx->klass->preedit_string_with_attributes_get)
ctx->klass->preedit_string_with_attributes_get(ctx, str, attrs, cursor_pos);
else
{
@@ -354,7 +357,8 @@ ecore_imf_context_focus_in(Ecore_IMF_Context *ctx)
"ecore_imf_context_focus_in");
return;
}
- if (ctx->klass->focus_in) ctx->klass->focus_in(ctx);
+
+ if (ctx->klass && ctx->klass->focus_in) ctx->klass->focus_in(ctx);
}
EAPI void
@@ -366,7 +370,8 @@ ecore_imf_context_focus_out(Ecore_IMF_Context *ctx)
"ecore_imf_context_focus_out");
return;
}
- if (ctx->klass->focus_out) ctx->klass->focus_out(ctx);
+
+ if (ctx->klass && ctx->klass->focus_out) ctx->klass->focus_out(ctx);
}
EAPI void
@@ -378,7 +383,8 @@ ecore_imf_context_reset(Ecore_IMF_Context *ctx)
"ecore_imf_context_reset");
return;
}
- if (ctx->klass->reset) ctx->klass->reset(ctx);
+
+ if (ctx->klass && ctx->klass->reset) ctx->klass->reset(ctx);
}
EAPI void
@@ -390,7 +396,8 @@ ecore_imf_context_cursor_position_set(Ecore_IMF_Context *ctx, int cursor_pos)
"ecore_imf_context_cursor_position_set");
return;
}
- if (ctx->klass->cursor_position_set) ctx->klass->cursor_position_set(ctx, cursor_pos);
+
+ if (ctx->klass && ctx->klass->cursor_position_set) ctx->klass->cursor_position_set(ctx, cursor_pos);
}
EAPI void
@@ -402,7 +409,7 @@ ecore_imf_context_cursor_location_set(Ecore_IMF_Context *ctx, int x, int y, int
"ecore_imf_context_cursor_location_set");
return;
}
- if (ctx->klass->cursor_location_set) ctx->klass->cursor_location_set(ctx, x, y, w, h);
+ if (ctx->klass && ctx->klass->cursor_location_set) ctx->klass->cursor_location_set(ctx, x, y, w, h);
}
EAPI void
@@ -414,7 +421,7 @@ ecore_imf_context_use_preedit_set(Ecore_IMF_Context *ctx, Eina_Bool use_preedit)
"ecore_imf_context_use_preedit_set");
return;
}
- if (ctx->klass->use_preedit_set) ctx->klass->use_preedit_set(ctx, use_preedit);
+ if (ctx->klass && ctx->klass->use_preedit_set) ctx->klass->use_preedit_set(ctx, use_preedit);
}
EAPI void
@@ -431,7 +438,7 @@ ecore_imf_context_prediction_allow_set(Ecore_IMF_Context *ctx, Eina_Bool predict
{
ctx->allow_prediction = prediction;
- if (ctx->klass->prediction_allow_set)
+ if (ctx->klass && ctx->klass->prediction_allow_set)
ctx->klass->prediction_allow_set(ctx, prediction);
}
}
@@ -463,7 +470,7 @@ ecore_imf_context_autocapital_type_set(Ecore_IMF_Context *ctx, Ecore_IMF_Autocap
{
ctx->autocapital_type = autocapital_type;
- if (ctx->klass->autocapital_type_set) ctx->klass->autocapital_type_set(ctx, autocapital_type);
+ if (ctx->klass && ctx->klass->autocapital_type_set) ctx->klass->autocapital_type_set(ctx, autocapital_type);
}
}
@@ -517,7 +524,7 @@ ecore_imf_context_input_mode_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode in
"ecore_imf_context_input_mode_set");
return;
}
- if (ctx->klass->input_mode_set) ctx->klass->input_mode_set(ctx, input_mode);
+ if (ctx->klass && ctx->klass->input_mode_set) ctx->klass->input_mode_set(ctx, input_mode);
ctx->input_mode = input_mode;
}
@@ -542,7 +549,7 @@ ecore_imf_context_filter_event(Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type
"ecore_imf_context_filter_event");
return EINA_FALSE;
}
- if (ctx->klass->filter_event) return ctx->klass->filter_event(ctx, type, event);
+ if (ctx->klass && ctx->klass->filter_event) return ctx->klass->filter_event(ctx, type, event);
return EINA_FALSE;
}
@@ -840,7 +847,7 @@ ecore_imf_context_control_panel_show(Ecore_IMF_Context *ctx)
return;
}
- if (ctx->klass->control_panel_show) ctx->klass->control_panel_show(ctx);
+ if (ctx->klass && ctx->klass->control_panel_show) ctx->klass->control_panel_show(ctx);
}
EAPI void
@@ -853,7 +860,7 @@ ecore_imf_context_control_panel_hide(Ecore_IMF_Context *ctx)
return;
}
- if (ctx->klass->control_panel_hide) ctx->klass->control_panel_hide(ctx);
+ if (ctx->klass && ctx->klass->control_panel_hide) ctx->klass->control_panel_hide(ctx);
}
EAPI void
@@ -868,7 +875,7 @@ ecore_imf_context_input_hint_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Hints i
if (ctx->input_hints != input_hints)
{
- if (ctx->klass->input_hint_set)
+ if (ctx->klass && ctx->klass->input_hint_set)
ctx->klass->input_hint_set(ctx, input_hints);
ctx->input_hints = input_hints;
@@ -902,7 +909,7 @@ ecore_imf_context_input_panel_show(Ecore_IMF_Context *ctx)
if ((ctx->input_panel_enabled) ||
(getenv("ECORE_IMF_INPUT_PANEL_ENABLED")))
{
- if (ctx->klass->show) ctx->klass->show(ctx);
+ if (ctx->klass && ctx->klass->show) ctx->klass->show(ctx);
}
}
@@ -919,7 +926,7 @@ ecore_imf_context_input_panel_hide(Ecore_IMF_Context *ctx)
if ((ctx->input_panel_enabled) ||
(getenv("ECORE_IMF_INPUT_PANEL_ENABLED")))
{
- if (ctx->klass->hide) ctx->klass->hide(ctx);
+ if (ctx->klass && ctx->klass->hide) ctx->klass->hide(ctx);
}
}
@@ -935,10 +942,13 @@ ecore_imf_context_input_panel_layout_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input
if (ctx->input_panel_layout != layout)
{
- if (ctx->klass->input_panel_layout_set)
+ if (ctx->klass && ctx->klass->input_panel_layout_set)
ctx->klass->input_panel_layout_set(ctx, layout);
ctx->input_panel_layout = layout;
+
+ if (layout == ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD)
+ ecore_imf_context_autocapital_type_set(ctx, ECORE_IMF_AUTOCAPITAL_TYPE_NONE);
}
}
@@ -952,7 +962,7 @@ ecore_imf_context_input_panel_layout_get(Ecore_IMF_Context *ctx)
return ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID;
}
- if (ctx->klass->input_panel_layout_get)
+ if (ctx->klass && ctx->klass->input_panel_layout_get)
return ctx->input_panel_layout;
else
return ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID;
@@ -996,7 +1006,7 @@ ecore_imf_context_input_panel_language_set(Ecore_IMF_Context *ctx, Ecore_IMF_Inp
if (ctx->input_panel_lang != lang)
{
- if (ctx->klass->input_panel_language_set)
+ if (ctx->klass && ctx->klass->input_panel_language_set)
ctx->klass->input_panel_language_set(ctx, lang);
ctx->input_panel_lang = lang;
@@ -1055,7 +1065,7 @@ ecore_imf_context_input_panel_imdata_set(Ecore_IMF_Context *ctx, const void *dat
if (!data) return;
- if (ctx->klass->input_panel_imdata_set)
+ if (ctx->klass && ctx->klass->input_panel_imdata_set)
ctx->klass->input_panel_imdata_set(ctx, data, len);
}
@@ -1071,7 +1081,7 @@ ecore_imf_context_input_panel_imdata_get(Ecore_IMF_Context *ctx, void *data, int
if (!data) return;
- if (ctx->klass->input_panel_imdata_get)
+ if (ctx->klass && ctx->klass->input_panel_imdata_get)
ctx->klass->input_panel_imdata_get(ctx, data, len);
}
@@ -1088,7 +1098,7 @@ ecore_imf_context_input_panel_return_key_type_set(Ecore_IMF_Context *ctx, Ecore_
if (ctx->input_panel_return_key_type != return_key_type)
{
ctx->input_panel_return_key_type = return_key_type;
- if (ctx->klass->input_panel_return_key_type_set)
+ if (ctx->klass && ctx->klass->input_panel_return_key_type_set)
ctx->klass->input_panel_return_key_type_set(ctx, return_key_type);
}
}
@@ -1119,7 +1129,7 @@ ecore_imf_context_input_panel_return_key_disabled_set(Ecore_IMF_Context *ctx, Ei
if (ctx->input_panel_return_key_disabled != disabled)
{
ctx->input_panel_return_key_disabled = disabled;
- if (ctx->klass->input_panel_return_key_disabled_set)
+ if (ctx->klass && ctx->klass->input_panel_return_key_disabled_set)
ctx->klass->input_panel_return_key_disabled_set(ctx, disabled);
}
}
@@ -1149,7 +1159,7 @@ ecore_imf_context_input_panel_caps_lock_mode_set(Ecore_IMF_Context *ctx, Eina_Bo
if (ctx->input_panel_caps_lock_mode != mode)
{
- if (ctx->klass->input_panel_caps_lock_mode_set)
+ if (ctx->klass && ctx->klass->input_panel_caps_lock_mode_set)
ctx->klass->input_panel_caps_lock_mode_set(ctx, mode);
ctx->input_panel_caps_lock_mode = mode;
@@ -1179,7 +1189,7 @@ ecore_imf_context_input_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *
return;
}
- if (ctx->klass->input_panel_geometry_get)
+ if (ctx->klass && ctx->klass->input_panel_geometry_get)
ctx->klass->input_panel_geometry_get(ctx, x, y, w, h);
}
@@ -1194,7 +1204,7 @@ ecore_imf_context_input_panel_state_get(Ecore_IMF_Context *ctx)
return ECORE_IMF_INPUT_PANEL_STATE_HIDE;
}
- if (ctx->klass->input_panel_state_get)
+ if (ctx->klass && ctx->klass->input_panel_state_get)
state = ctx->klass->input_panel_state_get(ctx);
return state;
@@ -1322,7 +1332,7 @@ ecore_imf_context_input_panel_language_locale_get(Ecore_IMF_Context *ctx, char *
return;
}
- if (ctx->klass->input_panel_language_locale_get)
+ if (ctx->klass && ctx->klass->input_panel_language_locale_get)
ctx->klass->input_panel_language_locale_get(ctx, lang);
else
{
@@ -1340,7 +1350,7 @@ ecore_imf_context_candidate_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, i
return;
}
- if (ctx->klass->candidate_panel_geometry_get)
+ if (ctx->klass && ctx->klass->candidate_panel_geometry_get)
ctx->klass->candidate_panel_geometry_get(ctx, x, y, w, h);
}
@@ -1382,7 +1392,7 @@ ecore_imf_context_bidi_direction_set(Ecore_IMF_Context *ctx, Ecore_IMF_BiDi_Dire
if (ctx->bidi_direction != direction)
{
- if (ctx->klass->bidi_direction_set)
+ if (ctx->klass && ctx->klass->bidi_direction_set)
ctx->klass->bidi_direction_set(ctx, direction);
ctx->bidi_direction = direction;
@@ -1413,7 +1423,7 @@ ecore_imf_context_keyboard_mode_get(Ecore_IMF_Context *ctx)
return ECORE_IMF_INPUT_PANEL_SW_KEYBOARD_MODE;
}
- if (ctx->klass->keyboard_mode_get)
+ if (ctx->klass && ctx->klass->keyboard_mode_get)
mode = ctx->klass->keyboard_mode_get(ctx);
return mode;
@@ -1429,7 +1439,7 @@ ecore_imf_context_prediction_hint_set(Ecore_IMF_Context *ctx, const char *predic
return;
}
- if (ctx->klass->prediction_hint_set)
+ if (ctx->klass && ctx->klass->prediction_hint_set)
ctx->klass->prediction_hint_set(ctx, prediction_hint);
}
@@ -1445,7 +1455,7 @@ ecore_imf_context_mime_type_accept_set(Ecore_IMF_Context *ctx, const char *mime_
if (!mime_type) return;
- if (ctx->klass->mime_type_accept_set)
+ if (ctx->klass && ctx->klass->mime_type_accept_set)
ctx->klass->mime_type_accept_set(ctx, mime_type);
}
@@ -1461,7 +1471,7 @@ ecore_imf_context_input_panel_position_set(Ecore_IMF_Context *ctx, int x, int y)
if (x < 0 || y < 0) return;
- if (ctx->klass->input_panel_position_set)
+ if (ctx->klass && ctx->klass->input_panel_position_set)
ctx->klass->input_panel_position_set(ctx, x, y);
}
diff --git a/src/lib/ecore_imf/ecore_imf_module.c b/src/lib/ecore_imf/ecore_imf_module.c
index 814152f79b..6232f85614 100644
--- a/src/lib/ecore_imf/ecore_imf_module.c
+++ b/src/lib/ecore_imf/ecore_imf_module.c
@@ -14,6 +14,8 @@
#include "Ecore_IMF.h"
#include "ecore_imf_private.h"
+#include "../../static_libs/buildsystem/buildsystem.h"
+
static void _ecore_imf_module_free(Ecore_IMF_Module *module);
static int _ecore_imf_modules_exists(const char *ctx_id);
@@ -77,9 +79,7 @@ ecore_imf_module_init(void)
}
for (itr = modules_load; *itr != NULL; itr++)
{
- snprintf(buf, sizeof(buf),
- "%s/src/modules/ecore_imf/%s/.libs",
- PACKAGE_BUILD_DIR, *itr);
+ bs_mod_dir_get(buf, sizeof(buf), "ecore_imf", *itr);
module_list = eina_module_list_get
(module_list, buf, EINA_FALSE, NULL, NULL);
}
diff --git a/src/lib/ecore_imf_evas/Ecore_IMF_Evas.h b/src/lib/ecore_imf_evas/Ecore_IMF_Evas.h
index f38e31f714..87431fce9f 100644
--- a/src/lib/ecore_imf_evas/Ecore_IMF_Evas.h
+++ b/src/lib/ecore_imf_evas/Ecore_IMF_Evas.h
@@ -9,15 +9,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ECORE_IMF_EVAS_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ECORE_IMF_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -28,7 +28,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
/**
* @defgroup Ecore_IMF_Evas_Group Ecore Input Method Context Evas Helper Functions
diff --git a/src/lib/ecore_input/Ecore_Input.h b/src/lib/ecore_input/Ecore_Input.h
index 6853e764b5..0e28909729 100644
--- a/src/lib/ecore_input/Ecore_Input.h
+++ b/src/lib/ecore_input/Ecore_Input.h
@@ -16,15 +16,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ECORE_INPUT_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ECORE_INPUT_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
diff --git a/src/lib/ecore_input_evas/Ecore_Input_Evas.h b/src/lib/ecore_input_evas/Ecore_Input_Evas.h
index e126e45805..1ec065613f 100644
--- a/src/lib/ecore_input_evas/Ecore_Input_Evas.h
+++ b/src/lib/ecore_input_evas/Ecore_Input_Evas.h
@@ -8,15 +8,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ECORE_INPUT_EVAS_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ECORE_INPUT_EVAS_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
diff --git a/src/lib/ecore_input_evas/ecore_input_evas.c b/src/lib/ecore_input_evas/ecore_input_evas.c
index 7866bd5d9a..bd2f0d1868 100644
--- a/src/lib/ecore_input_evas/ecore_input_evas.c
+++ b/src/lib/ecore_input_evas/ecore_input_evas.c
@@ -417,12 +417,12 @@ static Eina_Bool
_ecore_event_evas_key(Ecore_Event_Key *e, Ecore_Event_Press press)
{
Ecore_Input_Window *lookup;
+ Eo *seat;
lookup = _ecore_event_window_match(e->event_window);
if (!lookup) return ECORE_CALLBACK_PASS_ON;
- ecore_event_evas_seat_modifier_lock_update(lookup->evas,
- e->modifiers,
- efl_input_device_seat_get(e->dev));
+ seat = e->dev ? efl_input_device_seat_get(e->dev) : NULL;
+ ecore_event_evas_seat_modifier_lock_update(lookup->evas, e->modifiers, seat);
if (press == ECORE_DOWN)
{
if (!lookup->direct ||
@@ -531,9 +531,8 @@ _ecore_event_evas_mouse_button(Ecore_Event_Mouse_Button *e, Ecore_Event_Press pr
if (e->multi.device == 0)
{
- ecore_event_evas_seat_modifier_lock_update(lookup->evas,
- e->modifiers,
- efl_input_device_seat_get(e->dev));
+ Eo *seat = e->dev ? efl_input_device_seat_get(e->dev) : NULL;
+ ecore_event_evas_seat_modifier_lock_update(lookup->evas, e->modifiers, seat);
if (press == ECORE_DOWN)
{
if (!lookup->direct ||
@@ -612,10 +611,9 @@ ecore_event_evas_mouse_move(void *data EINA_UNUSED, int type EINA_UNUSED, void *
if (!lookup) return ECORE_CALLBACK_PASS_ON;
if (e->multi.device == 0)
{
+ Eo *seat = e->dev ? efl_input_device_seat_get(e->dev) : NULL;
_ecore_event_evas_push_mouse_move(e);
- ecore_event_evas_seat_modifier_lock_update(lookup->evas,
- e->modifiers,
- efl_input_device_seat_get(e->dev));
+ ecore_event_evas_seat_modifier_lock_update(lookup->evas, e->modifiers, seat);
if (!lookup->direct ||
!lookup->direct(lookup->window, ECORE_EVENT_MOUSE_MOVE, e))
{
@@ -671,12 +669,13 @@ static Eina_Bool
_ecore_event_evas_mouse_io(Ecore_Event_Mouse_IO *e, Ecore_Event_IO io)
{
Ecore_Input_Window *lookup;
+ Eo *seat;
lookup = _ecore_event_window_match(e->event_window);
if (!lookup) return ECORE_CALLBACK_PASS_ON;
- ecore_event_evas_seat_modifier_lock_update(lookup->evas,
- e->modifiers,
- efl_input_device_seat_get(e->dev));
+ seat = e->dev ? efl_input_device_seat_get(e->dev) : NULL;
+ ecore_event_evas_seat_modifier_lock_update(lookup->evas, e->modifiers, seat);
+
switch (io)
{
case ECORE_IN:
@@ -718,12 +717,13 @@ ecore_event_evas_mouse_wheel(void *data EINA_UNUSED, int type EINA_UNUSED, void
{
Ecore_Event_Mouse_Wheel *e;
Ecore_Input_Window *lookup;
+ Eo *seat;
e = event;
lookup = _ecore_event_window_match(e->event_window);
if (!lookup) return ECORE_CALLBACK_PASS_ON;
- ecore_event_evas_seat_modifier_lock_update(lookup->evas, e->modifiers,
- efl_input_device_seat_get(e->dev));
+ seat = e->dev ? efl_input_device_seat_get(e->dev) : NULL;
+ ecore_event_evas_seat_modifier_lock_update(lookup->evas, e->modifiers, seat);
if (!lookup->direct ||
!lookup->direct(lookup->window, ECORE_EVENT_MOUSE_WHEEL, e))
{
diff --git a/src/lib/ecore_ipc/Ecore_Ipc.h b/src/lib/ecore_ipc/Ecore_Ipc.h
index 47e3c174d8..5da43c7639 100644
--- a/src/lib/ecore_ipc/Ecore_Ipc.h
+++ b/src/lib/ecore_ipc/Ecore_Ipc.h
@@ -8,7 +8,7 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ECORE_IPC_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
diff --git a/src/lib/ecore_ipc/ecore_ipc.c b/src/lib/ecore_ipc/ecore_ipc.c
index c0fcd8be63..babf033a17 100644
--- a/src/lib/ecore_ipc/ecore_ipc.c
+++ b/src/lib/ecore_ipc/ecore_ipc.c
@@ -745,21 +745,21 @@ ecore_ipc_server_connect(Ecore_Ipc_Type type, char *name, int port, const void *
goto error_dialer;
}
- efl_io_closer_close_on_destructor_set(svr->dialer.dialer, EINA_TRUE);
+ efl_io_closer_close_on_invalidate_set(svr->dialer.dialer, EINA_TRUE);
efl_event_callback_array_add(svr->dialer.dialer, _ecore_ipc_dialer_cbs(), svr);
svr->dialer.input = efl_add(EFL_IO_QUEUE_CLASS, loop);
EINA_SAFETY_ON_NULL_GOTO(svr->dialer.input, error);
svr->dialer.send_copier = efl_add(EFL_IO_COPIER_CLASS, loop,
- efl_io_closer_close_on_destructor_set(efl_added, EINA_FALSE),
+ efl_io_closer_close_on_invalidate_set(efl_added, EINA_FALSE),
efl_io_copier_source_set(efl_added, svr->dialer.input),
efl_io_copier_destination_set(efl_added, svr->dialer.dialer),
efl_event_callback_array_add(efl_added, _ecore_ipc_dialer_copier_cbs(), svr));
EINA_SAFETY_ON_NULL_GOTO(svr->dialer.send_copier, error);
svr->dialer.recv_copier = efl_add(EFL_IO_COPIER_CLASS, loop,
- efl_io_closer_close_on_destructor_set(efl_added, EINA_FALSE),
+ efl_io_closer_close_on_invalidate_set(efl_added, EINA_FALSE),
efl_io_copier_source_set(efl_added, svr->dialer.dialer),
efl_event_callback_array_add(efl_added, _ecore_ipc_dialer_copier_cbs(), svr),
efl_event_callback_add(efl_added, EFL_IO_COPIER_EVENT_DATA, _ecore_ipc_dialer_copier_data, svr));
@@ -969,20 +969,23 @@ ecore_ipc_server_send(Ecore_Ipc_Server *svr, int major, int minor, int ref, int
return 0;
}
- slice.mem = data;
- slice.len = size;
- err = efl_io_writer_write(svr->dialer.input, &slice, NULL);
- if (err)
- {
- ERR("could not write queue=%p %zd bytes: %s",
- svr->dialer.input, slice.len, eina_error_msg_get(err));
- return 0;
- }
- if (slice.len < (size_t)size)
+ if ((data) && (size > 0))
{
- ERR("only wrote %zd of %d bytes to queue %p",
- slice.len, size, svr->dialer.input);
- return 0;
+ slice.mem = data;
+ slice.len = size;
+ err = efl_io_writer_write(svr->dialer.input, &slice, NULL);
+ if (err)
+ {
+ ERR("could not write queue=%p %zd bytes: %s",
+ svr->dialer.input, slice.len, eina_error_msg_get(err));
+ return 0;
+ }
+ if (slice.len < (size_t)size)
+ {
+ ERR("only wrote %zd of %d bytes to queue %p",
+ slice.len, size, svr->dialer.input);
+ return 0;
+ }
}
return s + size;
@@ -1078,7 +1081,8 @@ ecore_ipc_server_flush(Ecore_Ipc_Server *svr)
while (!efl_io_closer_closed_get(svr->dialer.dialer) &&
!efl_net_dialer_connected_get(svr->dialer.dialer))
ecore_main_loop_iterate();
- while (efl_io_queue_usage_get(svr->dialer.input) > 0)
+ while ((efl_io_queue_usage_get(svr->dialer.input) > 0) ||
+ (efl_io_copier_pending_size_get(svr->dialer.send_copier) > 0))
efl_io_copier_flush(svr->dialer.send_copier, EINA_TRUE, EINA_TRUE);
return;
}
@@ -1187,21 +1191,23 @@ ecore_ipc_client_send(Ecore_Ipc_Client *cl, int major, int minor, int ref, int r
slice.len, s, cl->socket.input);
return 0;
}
-
- slice.mem = data;
- slice.len = size;
- err = efl_io_writer_write(cl->socket.input, &slice, NULL);
- if (err)
- {
- ERR("could not write queue=%p %zd bytes: %s",
- cl->socket.input, slice.len, eina_error_msg_get(err));
- return 0;
- }
- if (slice.len < (size_t)size)
+ if ((data) && (size > 0))
{
- ERR("only wrote %zd of %d bytes to queue %p",
- slice.len, size, cl->socket.input);
- return 0;
+ slice.mem = data;
+ slice.len = size;
+ err = efl_io_writer_write(cl->socket.input, &slice, NULL);
+ if (err)
+ {
+ ERR("could not write queue=%p %zd bytes: %s",
+ cl->socket.input, slice.len, eina_error_msg_get(err));
+ return 0;
+ }
+ if (slice.len < (size_t)size)
+ {
+ ERR("only wrote %zd of %d bytes to queue %p",
+ slice.len, size, cl->socket.input);
+ return 0;
+ }
}
return s + size;
@@ -1337,14 +1343,14 @@ _ecore_ipc_server_client_add(void *data, const Efl_Event *event)
EINA_SAFETY_ON_NULL_GOTO(cl->socket.input, error);
cl->socket.send_copier = efl_add(EFL_IO_COPIER_CLASS, loop,
- efl_io_closer_close_on_destructor_set(efl_added, EINA_FALSE),
+ efl_io_closer_close_on_invalidate_set(efl_added, EINA_FALSE),
efl_io_copier_source_set(efl_added, cl->socket.input),
efl_io_copier_destination_set(efl_added, cl->socket.socket),
efl_event_callback_array_add(efl_added, _ecore_ipc_client_socket_copier_cbs(), cl));
EINA_SAFETY_ON_NULL_GOTO(cl->socket.send_copier, error);
cl->socket.recv_copier = efl_add(EFL_IO_COPIER_CLASS, loop,
- efl_io_closer_close_on_destructor_set(efl_added, EINA_FALSE),
+ efl_io_closer_close_on_invalidate_set(efl_added, EINA_FALSE),
efl_io_copier_source_set(efl_added, cl->socket.socket),
efl_event_callback_array_add(efl_added, _ecore_ipc_client_socket_copier_cbs(), cl),
efl_event_callback_add(efl_added, EFL_IO_COPIER_EVENT_DATA, _ecore_ipc_client_socket_copier_data, cl));
diff --git a/src/lib/ecore_sdl/Ecore_Sdl.h b/src/lib/ecore_sdl/Ecore_Sdl.h
index 36b69a4d4b..50b87069ad 100644
--- a/src/lib/ecore_sdl/Ecore_Sdl.h
+++ b/src/lib/ecore_sdl/Ecore_Sdl.h
@@ -6,15 +6,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ECORE_SDL_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ECORE_SDL_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -25,7 +25,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
/**
* @file
diff --git a/src/lib/ecore_wayland/ecore_wl_dnd.c b/src/lib/ecore_wayland/ecore_wl_dnd.c
index a7694c1587..35760f849d 100644
--- a/src/lib/ecore_wayland/ecore_wl_dnd.c
+++ b/src/lib/ecore_wayland/ecore_wl_dnd.c
@@ -170,8 +170,11 @@ ecore_wl_dnd_selection_set(Ecore_Wl_Input *input, const char **types_offered)
for (type = types_offered; *type; type++)
{
t = wl_array_add(&input->data_types, sizeof(*t));
- if (t) *t = strdup(*type);
- wl_data_source_offer(input->data_source, *t);
+ if (t)
+ {
+ *t = strdup(*type);
+ wl_data_source_offer(input->data_source, *t);
+ }
}
/* add a listener for data source events */
@@ -650,7 +653,7 @@ _ecore_wl_dnd_selection_data_receive(Ecore_Wl_Dnd_Source *source, const char *ty
read_source = calloc(1, sizeof(struct _dnd_source));
if (!read_source) goto err;
- read_source = source;
+ read_source->source = source;
read_source->read_fd = p[0];
task->data = read_source;
task->cb = _ecore_wl_dnd_selection_data_read;
diff --git a/src/lib/ecore_wayland/ecore_wl_input.c b/src/lib/ecore_wayland/ecore_wl_input.c
index e36f47d1cb..e3fb6f487d 100644
--- a/src/lib/ecore_wayland/ecore_wl_input.c
+++ b/src/lib/ecore_wayland/ecore_wl_input.c
@@ -1034,7 +1034,6 @@ _ecore_wl_input_cb_pointer_leave(void *data, struct wl_pointer *pointer EINA_UNU
* here for any corner-cases */
/* _ecore_wl_input_cursor_update(input); */
- if (!surface) return;
if (!(win = ecore_wl_window_surface_find(surface))) return;
win->pointer_device = NULL;
@@ -1108,7 +1107,6 @@ _ecore_wl_input_cb_keyboard_leave(void *data, struct wl_keyboard *keyboard EINA_
input->display->serial = serial;
- if (!surface) return;
if (!(win = ecore_wl_window_surface_find(surface))) return;
win->keyboard_device = NULL;
diff --git a/src/lib/ecore_win32/Ecore_Win32.h b/src/lib/ecore_win32/Ecore_Win32.h
index 356200ff4a..cfa7f5adc1 100644
--- a/src/lib/ecore_win32/Ecore_Win32.h
+++ b/src/lib/ecore_win32/Ecore_Win32.h
@@ -23,15 +23,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ECORE_WIN32_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ECORE_WIN32_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -42,7 +42,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#ifdef __cplusplus
diff --git a/src/lib/ecore_win32/ecore_win32.c b/src/lib/ecore_win32/ecore_win32.c
index ec9738ee1b..f217b22475 100644
--- a/src/lib/ecore_win32/ecore_win32.c
+++ b/src/lib/ecore_win32/ecore_win32.c
@@ -253,7 +253,7 @@ _ecore_win32_window_procedure(HWND window,
return TRUE;
case WM_MOVING:
INF("moving window message");
- _ecore_win32_event_handle_configure_notify(data);
+ _ecore_win32_event_handle_configure_notify(data, EINA_FALSE);
return TRUE;
case WM_MOVE:
INF("move window message");
@@ -261,10 +261,11 @@ _ecore_win32_window_procedure(HWND window,
case WM_SIZING:
INF("sizing window message");
_ecore_win32_event_handle_resize(data);
- _ecore_win32_event_handle_configure_notify(data);
+ _ecore_win32_event_handle_configure_notify(data, EINA_FALSE);
return TRUE;
case WM_SIZE:
INF("size window message");
+ _ecore_win32_event_handle_configure_notify(data, EINA_TRUE);
return 0;
/* case WM_WINDOWPOSCHANGING: */
/* { */
@@ -273,11 +274,11 @@ _ecore_win32_window_procedure(HWND window,
/* printf (" *** ecore message : WINDOWPOSCHANGING %ld %ld\n", */
/* rect.right - rect.left, rect.bottom - rect.top); */
/* } */
-/* _ecore_win32_event_handle_configure_notify(data); */
+/* _ecore_win32_event_handle_configure_notify(data, EINA_FALSE); */
/* return 0; */
case WM_WINDOWPOSCHANGED:
INF("position changed window message");
- _ecore_win32_event_handle_configure_notify(data);
+ _ecore_win32_event_handle_configure_notify(data, EINA_FALSE);
_ecore_win32_event_handle_property_notify(data);
_ecore_win32_event_handle_expose(data);
return 0;
@@ -527,6 +528,8 @@ ecore_win32_init()
goto shutdown_ecore_event;
}
+ ecore_win32_monitor_init();
+
icon = LoadImage(_ecore_win32_instance,
MAKEINTRESOURCE(IDI_ICON),
IMAGE_ICON,
@@ -589,8 +592,6 @@ ecore_win32_init()
for (i = 0; i < 77; i++)
_ecore_win32_cursor_x[i] = _ecore_win32_cursor_x11_shaped_new(i);
- ecore_win32_monitor_init();
-
return _ecore_win32_init_count;
unregister_class:
@@ -625,8 +626,6 @@ ecore_win32_shutdown()
if (--_ecore_win32_init_count != 0)
return _ecore_win32_init_count;
- ecore_win32_monitor_shutdown();
-
for (i = 0; i < 77; i++)
ecore_win32_cursor_free(_ecore_win32_cursor_x[i]);
@@ -651,6 +650,8 @@ ecore_win32_shutdown()
if (!UnregisterClass(ECORE_WIN32_WINDOW_CLASS, _ecore_win32_instance))
INF("UnregisterClass() failed");
+ ecore_win32_monitor_shutdown();
+
if (!FreeLibrary(_ecore_win32_instance))
INF("FreeLibrary() failed");
diff --git a/src/lib/ecore_win32/ecore_win32_event.c b/src/lib/ecore_win32/ecore_win32_event.c
index a22fbed992..cf6b4492cc 100644
--- a/src/lib/ecore_win32/ecore_win32_event.c
+++ b/src/lib/ecore_win32/ecore_win32_event.c
@@ -1776,6 +1776,9 @@ _ecore_win32_event_handle_create_notify(Ecore_Win32_Callback_Data *msg)
{
Ecore_Win32_Event_Window_Create *e;
+ if (msg->window == ecore_win32_monitor_window)
+ return;
+
INF("window create notify");
e = calloc(1, sizeof(Ecore_Win32_Event_Window_Create));
@@ -1793,6 +1796,9 @@ _ecore_win32_event_handle_destroy_notify(Ecore_Win32_Callback_Data *msg)
{
Ecore_Win32_Event_Window_Destroy *e;
+ if (msg->window == ecore_win32_monitor_window)
+ return;
+
INF("window destroy notify");
e = calloc(1, sizeof(Ecore_Win32_Event_Window_Destroy));
@@ -1841,7 +1847,7 @@ _ecore_win32_event_handle_unmap_notify(Ecore_Win32_Callback_Data *msg)
}
void
-_ecore_win32_event_handle_configure_notify(Ecore_Win32_Callback_Data *msg)
+_ecore_win32_event_handle_configure_notify(Ecore_Win32_Callback_Data *msg, Eina_Bool wmsize)
{
WINDOWINFO wi;
Ecore_Win32_Event_Window_Configure *e;
@@ -1854,14 +1860,15 @@ _ecore_win32_event_handle_configure_notify(Ecore_Win32_Callback_Data *msg)
window_pos = (WINDOWPOS *)msg->data_param;
wi.cbSize = sizeof(WINDOWINFO);
- if (!GetWindowInfo(window_pos->hwnd, &wi))
+ if (!GetWindowInfo(msg->window, &wi))
{
free(e);
return;
}
e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
- e->abovewin = (void *)GetWindowLongPtr(window_pos->hwndInsertAfter, GWLP_USERDATA);
+ if (!wmsize)
+ e->abovewin = (void *)GetWindowLongPtr(window_pos->hwndInsertAfter, GWLP_USERDATA);
e->x = wi.rcClient.left;
e->y = wi.rcClient.top;
e->width = wi.rcClient.right - wi.rcClient.left;
diff --git a/src/lib/ecore_win32/ecore_win32_private.h b/src/lib/ecore_win32/ecore_win32_private.h
index 1956f8bf6b..88d0e12afb 100644
--- a/src/lib/ecore_win32/ecore_win32_private.h
+++ b/src/lib/ecore_win32/ecore_win32_private.h
@@ -156,7 +156,7 @@ void _ecore_win32_event_handle_create_notify(Ecore_Win32_Callback_Data *msg);
void _ecore_win32_event_handle_destroy_notify(Ecore_Win32_Callback_Data *msg);
void _ecore_win32_event_handle_map_notify(Ecore_Win32_Callback_Data *msg);
void _ecore_win32_event_handle_unmap_notify(Ecore_Win32_Callback_Data *msg);
-void _ecore_win32_event_handle_configure_notify(Ecore_Win32_Callback_Data *msg);
+void _ecore_win32_event_handle_configure_notify(Ecore_Win32_Callback_Data *msg, Eina_Bool wmsize);
void _ecore_win32_event_handle_resize(Ecore_Win32_Callback_Data *msg);
void _ecore_win32_event_handle_property_notify(Ecore_Win32_Callback_Data *msg);
void _ecore_win32_event_handle_delete_request(Ecore_Win32_Callback_Data *msg);
diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h
index 97f53d5ab8..bbc7e1ccac 100644
--- a/src/lib/ecore_wl2/Ecore_Wl2.h
+++ b/src/lib/ecore_wl2/Ecore_Wl2.h
@@ -30,6 +30,8 @@
# ifdef EFL_BETA_API_SUPPORT
+#define ECORE_WL2_SURFACE_INTERFACE_VERSION 1
+
typedef struct _Ecore_Wl2_Subsurface Ecore_Wl2_Subsurface;
# ifndef _ECORE_WL2_WINDOW_PREDEF
@@ -88,7 +90,7 @@ typedef struct _Ecore_Wl2_Event_Global
typedef struct _Ecore_Wl2_Event_Focus_In
{
- unsigned int window;
+ Ecore_Wl2_Window *window;
unsigned int timestamp;
Eo *dev; //The seat device
Ecore_Wl2_Display *display;
@@ -96,7 +98,7 @@ typedef struct _Ecore_Wl2_Event_Focus_In
typedef struct _Ecore_Wl2_Event_Focus_Out
{
- unsigned int window;
+ Ecore_Wl2_Window *window;
unsigned int timestamp;
Eo *dev; //The seat device
Ecore_Wl2_Display *display;
@@ -104,7 +106,7 @@ typedef struct _Ecore_Wl2_Event_Focus_Out
typedef struct _Ecore_Wl2_Event_Dnd_Enter
{
- unsigned int win, source;
+ Ecore_Wl2_Window *win, *source;
Ecore_Wl2_Offer *offer;
int x, y;
unsigned int seat;
@@ -113,7 +115,7 @@ typedef struct _Ecore_Wl2_Event_Dnd_Enter
typedef struct _Ecore_Wl2_Event_Dnd_Leave
{
- unsigned int win, source;
+ Ecore_Wl2_Window *win, *source;
Ecore_Wl2_Offer *offer;
unsigned int seat;
Ecore_Wl2_Display *display;
@@ -121,7 +123,7 @@ typedef struct _Ecore_Wl2_Event_Dnd_Leave
typedef struct _Ecore_Wl2_Event_Dnd_Motion
{
- unsigned int win, source;
+ Ecore_Wl2_Window *win, *source;
Ecore_Wl2_Offer *offer;
int x, y;
unsigned int seat;
@@ -130,7 +132,7 @@ typedef struct _Ecore_Wl2_Event_Dnd_Motion
typedef struct _Ecore_Wl2_Event_Dnd_Drop
{
- unsigned int win, source;
+ Ecore_Wl2_Window *win, *source;
int x, y;
Ecore_Wl2_Offer *offer;
unsigned int seat;
@@ -139,14 +141,14 @@ typedef struct _Ecore_Wl2_Event_Dnd_Drop
typedef struct _Ecore_Wl2_Event_Dnd_End
{
- unsigned int win, source;
+ Ecore_Wl2_Window *win, *source;
unsigned int seat;
Ecore_Wl2_Display *display;
} Ecore_Wl2_Event_Dnd_End;
struct _Ecore_Wl2_Event_Data_Source_Event
{
- unsigned int win, source;
+ Ecore_Wl2_Window *win, *source;
Ecore_Wl2_Drag_Action action;
unsigned int seat;
uint32_t serial;
@@ -155,7 +157,7 @@ struct _Ecore_Wl2_Event_Data_Source_Event
typedef struct Ecore_Wl2_Event_Data_Source_End
{
- unsigned int win, source;
+ Ecore_Wl2_Window *win, *source;
Ecore_Wl2_Drag_Action action;
unsigned int seat;
uint32_t serial;
@@ -214,7 +216,7 @@ typedef enum
typedef struct _Ecore_Wl2_Event_Device
{
Eo *dev;
- int window_id;
+ Ecore_Wl2_Window *window;
unsigned int seat_id;
Ecore_Wl2_Device_Type type;
} Ecore_Wl2_Event_Device;
@@ -234,14 +236,15 @@ typedef enum
typedef struct _Ecore_Wl2_Event_Window_Configure
{
- unsigned int win, event_win, edges;
+ Ecore_Wl2_Window *win, *event_win;
+ unsigned int edges;
unsigned int w, h;
unsigned int states;
} Ecore_Wl2_Event_Window_Configure;
typedef struct _Ecore_Wl2_Event_Window_Configure_Complete
{
- unsigned int win;
+ Ecore_Wl2_Window *win;
} Ecore_Wl2_Event_Window_Configure_Complete;
typedef struct _Ecore_Wl2_Event_Input_Keymap_Changed
@@ -279,7 +282,7 @@ typedef struct _Ecore_Wl2_Event_Output_Transform
typedef struct _Ecore_Wl2_Event_Window_Rotation
{
- unsigned int win;
+ Ecore_Wl2_Window *win;
int rotation, w, h, angle;
Eina_Bool resize : 1;
} Ecore_Wl2_Event_Window_Rotation;
@@ -290,35 +293,35 @@ typedef struct _Ecore_Wl2_Event_Window_Rotation Ecore_Wl2_Event_Window_Rotation_
typedef struct _Ecore_Wl2_Event_Window_Show
{
- unsigned int win;
- unsigned int parent_win;
- unsigned int event_win;
+ Ecore_Wl2_Window *win;
+ Ecore_Wl2_Window *parent_win;
+ Ecore_Wl2_Window *event_win;
} Ecore_Wl2_Event_Window_Show;
typedef struct _Ecore_Wl2_Event_Window_Hide
{
- unsigned int win;
- unsigned int parent_win;
- unsigned int event_win;
+ Ecore_Wl2_Window *win;
+ Ecore_Wl2_Window *parent_win;
+ Ecore_Wl2_Window *event_win;
} Ecore_Wl2_Event_Window_Hide;
typedef struct _Ecore_Wl2_Event_Window_Activate
{
- unsigned int win;
- unsigned int parent_win;
- unsigned int event_win;
+ Ecore_Wl2_Window *win;
+ Ecore_Wl2_Window *parent_win;
+ Ecore_Wl2_Window *event_win;
} Ecore_Wl2_Event_Window_Activate;
typedef struct _Ecore_Wl2_Event_Window_Deactivate
{
- unsigned int win;
- unsigned int parent_win;
- unsigned int event_win;
+ Ecore_Wl2_Window *win;
+ Ecore_Wl2_Window *parent_win;
+ Ecore_Wl2_Window *event_win;
} Ecore_Wl2_Event_Window_Deactivate;
typedef struct _Ecore_Wl2_Event_Window_Iconify_State_Change
{
- unsigned int win;
+ Ecore_Wl2_Window *win;
unsigned int iconified;
unsigned int force;
} Ecore_Wl2_Event_Window_Iconify_State_Change;
@@ -340,26 +343,31 @@ typedef enum _Ecore_Wl2_Window_Type
typedef struct _Ecore_Wl2_Event_Aux_Hint_Allowed
{
- unsigned int win;
+ Ecore_Wl2_Window *win;
int id;
Ecore_Wl2_Display *display;
} Ecore_Wl2_Event_Aux_Hint_Allowed;
typedef struct _Ecore_Wl2_Event_Aux_Hint_Supported
{
- unsigned int win;
+ Ecore_Wl2_Window *win;
Ecore_Wl2_Display *display;
} Ecore_Wl2_Event_Aux_Hint_Supported;
typedef struct Ecore_Wl2_Event_Aux_Message
{
- unsigned int win;
+ Ecore_Wl2_Window *win;
Eina_Stringshare *key;
Eina_Stringshare *val;
Eina_List *options;
Ecore_Wl2_Display *display;
} Ecore_Wl2_Event_Aux_Message;
+typedef struct Ecore_Wl2_Event_Window_Offscreen
+{
+ Ecore_Wl2_Window *win;
+} Ecore_Wl2_Event_Window_Offscreen;
+
typedef struct _Ecore_Wl2_Buffer Ecore_Wl2_Buffer;
typedef enum _Ecore_Wl2_Buffer_Type Ecore_Wl2_Buffer_Type;
@@ -416,6 +424,21 @@ EAPI extern int ECORE_WL2_EVENT_WINDOW_HIDE; /** @since 1.20 */
EAPI extern int ECORE_WL2_EVENT_WINDOW_ACTIVATE; /** @since 1.20 */
EAPI extern int ECORE_WL2_EVENT_WINDOW_DEACTIVATE; /** @since 1.20 */
EAPI extern int ECORE_WL2_EVENT_WINDOW_ICONIFY_STATE_CHANGE; /** @since 1.21 */
+EAPI extern int ECORE_WL2_EVENT_WINDOW_OFFSCREEN; /** @since 1.21 */
+
+typedef struct _Ecore_Wl2_Surface_Interface
+{
+ int id;
+ int version;
+
+ void *(*setup)(Ecore_Wl2_Window *win);
+ void (*destroy)(Ecore_Wl2_Surface *surface, void *priv_data);
+ void (*reconfigure)(Ecore_Wl2_Surface *surface, void *priv_data, int w, int h, uint32_t flags, Eina_Bool alpha);
+ void *(*data_get)(Ecore_Wl2_Surface *surface, void *priv_data, int *w, int *h);
+ int (*assign)(Ecore_Wl2_Surface *surface, void *priv_data);
+ void (*post)(Ecore_Wl2_Surface *surface, void *priv_data, Eina_Rectangle *rects, unsigned int count);
+ void (*flush)(Ecore_Wl2_Surface *surface, void *priv_data, Eina_Bool purge);
+} Ecore_Wl2_Surface_Interface;
/**
* @file
@@ -649,19 +672,6 @@ EAPI Ecore_Wl2_Input *ecore_wl2_display_input_find(const Ecore_Wl2_Display *disp
EAPI Ecore_Wl2_Input *ecore_wl2_display_input_find_by_name(const Ecore_Wl2_Display *display, const char *name);
/**
- * Find an Ecore_Wl2_Window based on id
- *
- * @param display The display to search for the window
- * @param id The id of the window to find
- *
- * @return The Ecore_Wl2_Window if found, or NULL if no such window exists
- *
- * @ingroup Ecore_Wl2_Display_Group
- * @since 1.17
- */
-EAPI Ecore_Wl2_Window *ecore_wl2_display_window_find(Ecore_Wl2_Display *display, unsigned int id);
-
-/**
* Retrieves the Wayland Registry used for the current Wayland display.
*
* @param display The display to get the registry of
@@ -722,18 +732,6 @@ EAPI const char *ecore_wl2_display_name_get(const Ecore_Wl2_Display *display);
EAPI Ecore_Wl2_Window *ecore_wl2_window_new(Ecore_Wl2_Display *display, Ecore_Wl2_Window *parent, int x, int y, int w, int h);
/**
- * Get the window id associated with an Ecore_Wl2_Window
- *
- * @param window The Ecore_Wl2_Window of which to retrieve the window id
- *
- * @return The id associated with this window
- *
- * @ingroup Ecore_Wl2_Window_Group
- * @since 1.17
- */
-EAPI int ecore_wl2_window_id_get(Ecore_Wl2_Window *window);
-
-/**
* Get the wl_surface which belongs to this window
*
* @param window The Ecore_Wl2_Window to get the surface of
@@ -818,16 +816,6 @@ EAPI void ecore_wl2_window_move(Ecore_Wl2_Window *window, Ecore_Wl2_Input *input
EAPI void ecore_wl2_window_resize(Ecore_Wl2_Window *window, Ecore_Wl2_Input *input, int location);
/**
- * Raise a given Ecore_Wl2_Window
- *
- * @param window The Ecore_Wl2_Window which to raise
- *
- * @ingroup Ecore_Wl2_Window_Group
- * @since 1.17
- */
-EAPI void ecore_wl2_window_raise(Ecore_Wl2_Window *window);
-
-/**
* Get if a given window is alpha
*
* @param window The window to get if is alpha
@@ -851,18 +839,6 @@ EAPI Eina_Bool ecore_wl2_window_alpha_get(Ecore_Wl2_Window *window);
EAPI void ecore_wl2_window_alpha_set(Ecore_Wl2_Window *window, Eina_Bool alpha);
/**
- * Set a given window's transparent property
- *
- * @param window The window on which to set the transparent property
- * @param transparent EINA_TRUE to set window as transparent,
- * EINA_FALSE otherwise
- *
- * @ingroup Ecore_Wl2_Window_Group
- * @since 1.17
- */
-EAPI void ecore_wl2_window_transparent_set(Ecore_Wl2_Window *window, Eina_Bool transparent);
-
-/**
* Set the opaque region of the Ecore_Wl2_Window
*
* @param win The window
@@ -1022,18 +998,6 @@ EAPI void ecore_wl2_window_geometry_get(Ecore_Wl2_Window *window, int *x, int *y
EAPI void ecore_wl2_window_geometry_set(Ecore_Wl2_Window *window, int x, int y, int w, int h);
/**
- * Get the iconified state of a given window
- *
- * @param window The window to get the iconified state of
- *
- * @return EINA_TRUE if window is iconified, EINA_FALSE otherwise
- *
- * @ingroup Ecore_Wl2_Window_Group
- * @since 1.17
- */
-EAPI Eina_Bool ecore_wl2_window_iconified_get(Ecore_Wl2_Window *window);
-
-/**
* Iconify a window
*
* @param win The window to iconifiy
@@ -1331,14 +1295,6 @@ EAPI Eina_Bool ecore_wl2_window_floating_mode_get(Ecore_Wl2_Window *window);
/* TODO: doxy */
/** @since 1.17 */
-EAPI void ecore_wl2_input_grab(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window, unsigned int button);
-
-/* TODO: doxy */
-/** @since 1.17 */
-EAPI void ecore_wl2_input_ungrab(Ecore_Wl2_Input *input);
-
-/* TODO: doxy */
-/** @since 1.17 */
EAPI struct wl_seat *ecore_wl2_input_seat_get(Ecore_Wl2_Input *input);
/**
@@ -1358,7 +1314,7 @@ EAPI Ecore_Wl2_Seat_Capabilities ecore_wl2_input_seat_capabilities_get(Ecore_Wl2
* @ingroup Ecore_Wl2_Input_Group
* @since 1.19
*/
-EAPI unsigned int ecore_wl2_input_seat_id_get(Ecore_Wl2_Input *input);
+EAPI unsigned int ecore_wl2_input_seat_id_get(Ecore_Wl2_Input *input) EINA_WARN_UNUSED_RESULT;
/**
* Get the display object of an input
@@ -1990,21 +1946,33 @@ EAPI void ecore_wl2_window_damage(Ecore_Wl2_Window *window, Eina_Rectangle *rect
EAPI Eina_Bool ecore_wl2_buffer_init(Ecore_Wl2_Display *ewd, Ecore_Wl2_Buffer_Type types);
EAPI Ecore_Wl2_Buffer *ecore_wl2_buffer_create(Ecore_Wl2_Display *ewd, int w, int h, Eina_Bool alpha);
EAPI void ecore_wl2_buffer_destroy(Ecore_Wl2_Buffer *b);
-EAPI struct wl_buffer *ecore_wl2_buffer_wl_buffer_get(Ecore_Wl2_Display *ewd, Ecore_Wl2_Buffer *buf);
-EAPI void *ecore_wl2_buffer_map(Ecore_Wl2_Buffer *buf);
+EAPI struct wl_buffer *ecore_wl2_buffer_wl_buffer_get(Ecore_Wl2_Buffer *buf);
+EAPI void *ecore_wl2_buffer_map(Ecore_Wl2_Buffer *buf, int *w, int *h, int *stride);
EAPI void ecore_wl2_buffer_unmap(Ecore_Wl2_Buffer *buf);
EAPI void ecore_wl2_buffer_discard(Ecore_Wl2_Buffer *buf);
+EAPI void ecore_wl2_buffer_lock(Ecore_Wl2_Buffer *b);
EAPI void ecore_wl2_buffer_unlock(Ecore_Wl2_Buffer *b);
EAPI void ecore_wl2_buffer_destroy(Ecore_Wl2_Buffer *b);
+EAPI Eina_Bool ecore_wl2_buffer_busy_get(Ecore_Wl2_Buffer *buffer);
+EAPI void ecore_wl2_buffer_busy_set(Ecore_Wl2_Buffer *buffer);
+EAPI int ecore_wl2_buffer_age_get(Ecore_Wl2_Buffer *buffer);
+EAPI void ecore_wl2_buffer_age_set(Ecore_Wl2_Buffer *buffer, int age);
+EAPI void ecore_wl2_buffer_age_inc(Ecore_Wl2_Buffer *buffer);
+EAPI Eina_Bool ecore_wl2_buffer_fit(Ecore_Wl2_Buffer *b, int w, int h);
EAPI Ecore_Wl2_Surface *ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha);
EAPI void ecore_wl2_surface_destroy(Ecore_Wl2_Surface *surface);
-EAPI void ecore_wl2_surface_reconfigure(Ecore_Wl2_Surface *surface, int w, int h, uint32_t flags, Eina_Bool force);
+EAPI void ecore_wl2_surface_reconfigure(Ecore_Wl2_Surface *surface, int w, int h, uint32_t flags, Eina_Bool alpha);
EAPI void *ecore_wl2_surface_data_get(Ecore_Wl2_Surface *surface, int *w, int *h);
EAPI int ecore_wl2_surface_assign(Ecore_Wl2_Surface *surface);
EAPI void ecore_wl2_surface_post(Ecore_Wl2_Surface *surface, Eina_Rectangle *rects, unsigned int count);
-EAPI void ecore_wl2_surface_flush(Ecore_Wl2_Surface *surface);
-EAPI void ecore_wl2_window_surface_flush(Ecore_Wl2_Window *window);
+EAPI void ecore_wl2_surface_flush(Ecore_Wl2_Surface *surface, Eina_Bool purge);
+EAPI void ecore_wl2_window_surface_flush(Ecore_Wl2_Window *window, Eina_Bool purge);
+EAPI Ecore_Wl2_Buffer *ecore_wl2_surface_buffer_create(Ecore_Wl2_Surface *surface);
+EAPI int ecore_wl2_surface_manager_add(Ecore_Wl2_Surface_Interface *intf);
+EAPI void ecore_wl2_surface_manager_del(Ecore_Wl2_Surface_Interface *intf);
+EAPI Ecore_Wl2_Window *ecore_wl2_surface_window_get(Ecore_Wl2_Surface *surface);
+EAPI Eina_Bool ecore_wl2_surface_alpha_get(Ecore_Wl2_Surface *surface);
# endif
diff --git a/src/lib/ecore_wl2/ecore_wl2.c b/src/lib/ecore_wl2/ecore_wl2.c
index c309a92b37..78ac85b6ac 100644
--- a/src/lib/ecore_wl2/ecore_wl2.c
+++ b/src/lib/ecore_wl2/ecore_wl2.c
@@ -53,10 +53,45 @@ EAPI int ECORE_WL2_EVENT_WINDOW_HIDE = 0;
EAPI int ECORE_WL2_EVENT_WINDOW_ACTIVATE = 0;
EAPI int ECORE_WL2_EVENT_WINDOW_DEACTIVATE = 0;
EAPI int ECORE_WL2_EVENT_WINDOW_ICONIFY_STATE_CHANGE = 0;
+EAPI int ECORE_WL2_EVENT_WINDOW_OFFSCREEN = 0;
EAPI int _ecore_wl2_event_window_www = -1;
EAPI int _ecore_wl2_event_window_www_drag = -1;
+static Eina_Array *supplied_modules = NULL;
+static Eina_Array *local_modules = NULL;
+
+static Eina_Bool
+_ecore_wl2_surface_modules_init(void)
+{
+ const char *mod_dir;
+
+ supplied_modules = eina_module_arch_list_get(NULL,
+ PACKAGE_LIB_DIR"/ecore_wl2/engines",
+ MODULE_ARCH);
+ eina_module_list_load(supplied_modules);
+
+ mod_dir = getenv("ECORE_WL2_SURFACE_MODULE_DIR");
+ if (mod_dir)
+ {
+ local_modules = eina_module_list_get(NULL, mod_dir,
+ EINA_TRUE, NULL, NULL);
+ eina_module_list_load(local_modules);
+ }
+
+ if (!supplied_modules && !local_modules)
+ return EINA_FALSE;
+
+ return EINA_TRUE;
+}
+
+static void
+_ecore_wl2_surface_modules_unload(void)
+{
+ eina_module_list_unload(supplied_modules);
+ eina_module_list_unload(local_modules);
+}
+
/* public API functions */
EAPI int
ecore_wl2_init(void)
@@ -89,6 +124,12 @@ ecore_wl2_init(void)
goto ecore_event_err;
}
+ if (!_ecore_wl2_surface_modules_init())
+ {
+ ERR("Could not load surface modules");
+ goto module_load_err;
+ }
+
/* handle creating new Ecore_Wl2 event types */
ECORE_WL2_EVENT_CONNECT = ecore_event_type_new();
ECORE_WL2_EVENT_DISCONNECT = ecore_event_type_new();
@@ -133,12 +174,16 @@ ecore_wl2_init(void)
ECORE_WL2_EVENT_WINDOW_ACTIVATE = ecore_event_type_new();
ECORE_WL2_EVENT_WINDOW_DEACTIVATE = ecore_event_type_new();
ECORE_WL2_EVENT_WINDOW_ICONIFY_STATE_CHANGE = ecore_event_type_new();
+ ECORE_WL2_EVENT_WINDOW_OFFSCREEN = ecore_event_type_new();
if (!no_session_recovery)
no_session_recovery = !!getenv("EFL_NO_WAYLAND_SESSION_RECOVERY");
return _ecore_wl2_init_count;
+module_load_err:
+ ecore_event_shutdown();
+
ecore_event_err:
ecore_shutdown();
@@ -203,7 +248,8 @@ ecore_wl2_shutdown(void)
ECORE_WL2_EVENT_WINDOW_HIDE,
ECORE_WL2_EVENT_WINDOW_ACTIVATE,
ECORE_WL2_EVENT_WINDOW_DEACTIVATE,
- ECORE_WL2_EVENT_WINDOW_ICONIFY_STATE_CHANGE);
+ ECORE_WL2_EVENT_WINDOW_ICONIFY_STATE_CHANGE,
+ ECORE_WL2_EVENT_WINDOW_OFFSCREEN);
/* shutdown Ecore_Event */
ecore_event_shutdown();
@@ -215,6 +261,8 @@ ecore_wl2_shutdown(void)
eina_log_domain_unregister(_ecore_wl2_log_dom);
_ecore_wl2_log_dom = -1;
+ _ecore_wl2_surface_modules_unload();
+
/* shutdown eina */
eina_shutdown();
diff --git a/src/lib/ecore_wl2/ecore_wl2_buffer.c b/src/lib/ecore_wl2/ecore_wl2_buffer.c
index bf2fe5f8ec..8e2e164546 100644
--- a/src/lib/ecore_wl2/ecore_wl2_buffer.c
+++ b/src/lib/ecore_wl2/ecore_wl2_buffer.c
@@ -17,6 +17,7 @@
#include <sys/mman.h>
#include <sys/ioctl.h>
+#include <linux/dma-buf.h>
#include "linux-dmabuf-unstable-v1-client-protocol.h"
#define SYM(lib, xx) \
@@ -39,6 +40,8 @@ struct _Buffer_Manager
void *(*map)(Ecore_Wl2_Buffer *buf);
void (*unmap)(Ecore_Wl2_Buffer *buf);
void (*discard)(Ecore_Wl2_Buffer *buf);
+ void (*lock)(Ecore_Wl2_Buffer *buf);
+ void (*unlock)(Ecore_Wl2_Buffer *buf);
void (*manager_destroy)(void);
void *priv;
void *dl_handle;
@@ -101,6 +104,36 @@ _evas_dmabuf_wl_buffer_from_dmabuf(Ecore_Wl2_Display *ewd, Ecore_Wl2_Buffer *db)
return buf;
}
+static void
+_dmabuf_lock(Ecore_Wl2_Buffer *b)
+{
+ int ret;
+ struct dma_buf_sync s;
+
+ s.flags = DMA_BUF_SYNC_START | DMA_BUF_SYNC_RW;
+ do
+ {
+ ret = ioctl(b->fd, DMA_BUF_IOCTL_SYNC, &s);
+ } while (ret && ((errno == EAGAIN) || (errno == EINTR)));
+
+ if (ret) WRN("Failed to lock dmabuf");
+}
+
+static void
+_dmabuf_unlock(Ecore_Wl2_Buffer *b)
+{
+ int ret;
+ struct dma_buf_sync s;
+
+ s.flags = DMA_BUF_SYNC_END | DMA_BUF_SYNC_RW;
+ do
+ {
+ ret = ioctl(b->fd, DMA_BUF_IOCTL_SYNC, &s);
+ } while (ret && ((errno == EAGAIN) || (errno == EINTR)));
+
+ if (ret) WRN("Failed to unlock dmabuf");
+}
+
static Buffer_Handle *
_intel_alloc(Buffer_Manager *self, const char *name, int w, int h, unsigned long *stride, int32_t *fd)
{
@@ -192,6 +225,8 @@ _intel_buffer_manager_setup(int fd)
buffer_manager->map = _intel_map;
buffer_manager->unmap = _intel_unmap;
buffer_manager->discard = _intel_discard;
+ buffer_manager->lock = _dmabuf_lock;
+ buffer_manager->unlock = _dmabuf_unlock;
buffer_manager->manager_destroy = _intel_manager_destroy;
buffer_manager->dl_handle = drm_intel_lib;
@@ -298,6 +333,8 @@ _exynos_buffer_manager_setup(int fd)
buffer_manager->map = _exynos_map;
buffer_manager->unmap = _exynos_unmap;
buffer_manager->discard = _exynos_discard;
+ buffer_manager->lock = _dmabuf_lock;
+ buffer_manager->unlock = _dmabuf_unlock;
buffer_manager->manager_destroy = _exynos_manager_destroy;
buffer_manager->dl_handle = drm_exynos_lib;
return EINA_TRUE;
@@ -310,15 +347,15 @@ err:
static Buffer_Handle *
_wl_shm_alloc(Buffer_Manager *self EINA_UNUSED, const char *name EINA_UNUSED, int w, int h, unsigned long *stride, int32_t *fd)
{
- Efl_Vpath_File *file_obj;
Eina_Tmpstr *fullname;
size_t size = w * h * 4;
void *out = NULL;
+ char *tmp;
+
+ tmp = eina_vpath_resolve("(:usr.run:)/evas-wayland_shm-XXXXXX");
+ *fd = eina_file_mkstemp(tmp, &fullname);
+ free(tmp);
- file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS,
- "(:run:)/evas-wayland_shm-XXXXXX");
- *fd = eina_file_mkstemp(efl_vpath_file_result_get(file_obj), &fullname);
- efl_del(file_obj);
if (*fd < 0) return NULL;
unlink(fullname);
@@ -528,6 +565,8 @@ _vc4_buffer_manager_setup(int fd)
buffer_manager->map = _vc4_map;
buffer_manager->unmap = _vc4_unmap;
buffer_manager->discard = _vc4_discard;
+ buffer_manager->lock = _dmabuf_lock;
+ buffer_manager->unlock = _dmabuf_unlock;
buffer_manager->manager_destroy = NULL;
buffer_manager->dl_handle = drm_lib;
return EINA_TRUE;
@@ -616,19 +655,40 @@ _buffer_manager_alloc(const char *name, int w, int h, unsigned long *stride, int
}
EAPI struct wl_buffer *
-ecore_wl2_buffer_wl_buffer_get(Ecore_Wl2_Display *ewd, Ecore_Wl2_Buffer *buf)
+ecore_wl2_buffer_wl_buffer_get(Ecore_Wl2_Buffer *buf)
{
- return buffer_manager->to_buffer(ewd, buf);
+ return buf->wl_buffer;
}
EAPI void *
-ecore_wl2_buffer_map(Ecore_Wl2_Buffer *buf)
+ecore_wl2_buffer_map(Ecore_Wl2_Buffer *buf, int *w, int *h, int *stride)
{
void *out;
- _buffer_manager_ref();
- out = buffer_manager->map(buf);
- if (!out) _buffer_manager_deref();
+ EINA_SAFETY_ON_NULL_RETURN_VAL(buf, NULL);
+
+ if (buf->mapping)
+ {
+ out = buf->mapping;
+ }
+ else
+ {
+ _buffer_manager_ref();
+ out = buffer_manager->map(buf);
+ if (!out)
+ {
+ _buffer_manager_deref();
+ return NULL;
+ }
+ buf->locked = EINA_TRUE;
+ buf->mapping = out;
+ }
+ if (w) *w = buf->w;
+ if (h) *h = buf->h;
+ if (stride) *stride = (int)buf->stride;
+
+ if (!buf->locked) ecore_wl2_buffer_lock(buf);
+
return out;
}
@@ -647,10 +707,18 @@ ecore_wl2_buffer_discard(Ecore_Wl2_Buffer *buf)
}
EAPI void
+ecore_wl2_buffer_lock(Ecore_Wl2_Buffer *b)
+{
+ if (b->locked) ERR("Buffer already locked\n");
+ if (buffer_manager->lock) buffer_manager->lock(b);
+ b->locked = EINA_TRUE;
+}
+
+EAPI void
ecore_wl2_buffer_unlock(Ecore_Wl2_Buffer *b)
{
- ecore_wl2_buffer_unmap(b);
- b->mapping = NULL;
+ if (!b->locked) ERR("Buffer already unlocked\n");
+ if (buffer_manager->unlock) buffer_manager->unlock(b);
b->locked = EINA_FALSE;
}
@@ -672,6 +740,73 @@ ecore_wl2_buffer_destroy(Ecore_Wl2_Buffer *b)
free(b);
}
+EAPI Eina_Bool
+ecore_wl2_buffer_busy_get(Ecore_Wl2_Buffer *buffer)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(buffer, EINA_FALSE);
+
+ return (buffer->locked) || (buffer->busy);
+}
+
+EAPI void
+ecore_wl2_buffer_busy_set(Ecore_Wl2_Buffer *buffer)
+{
+ EINA_SAFETY_ON_NULL_RETURN(buffer);
+
+ buffer->busy = EINA_TRUE;
+}
+
+EAPI int
+ecore_wl2_buffer_age_get(Ecore_Wl2_Buffer *buffer)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(buffer, 0);
+
+ return buffer->age;
+}
+
+EAPI void ecore_wl2_buffer_age_set(Ecore_Wl2_Buffer *buffer, int age)
+{
+ EINA_SAFETY_ON_NULL_RETURN(buffer);
+
+ buffer->age = age;
+}
+
+EAPI void
+ecore_wl2_buffer_age_inc(Ecore_Wl2_Buffer *buffer)
+{
+ EINA_SAFETY_ON_NULL_RETURN(buffer);
+
+ buffer->age++;
+}
+
+/* The only user of this function has been removed, but it
+ * will likely come back later. The problem is that
+ * a dmabuf buffer needs to be resized on the compositor
+ * even if the allocation still fits. Doing the resize
+ * properly isn't something that will be fixed in the 1.21
+ * timeframe, so the optimization has been (temporarily)
+ * removed.
+ *
+ * This is currently beta api - don't move it out of beta
+ * with no users...
+ */
+EAPI Eina_Bool
+ecore_wl2_buffer_fit(Ecore_Wl2_Buffer *b, int w, int h)
+{
+ int stride;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(b, EINA_FALSE);
+
+ stride = b->stride;
+ if ((w >= b->w) && (w <= stride / 4) && (h == b->h))
+ {
+ b->w = w;
+ return EINA_TRUE;
+ }
+
+ return EINA_FALSE;
+}
+
static Ecore_Wl2_Buffer *
_ecore_wl2_buffer_partial_create(int w, int h, Eina_Bool alpha)
{
@@ -703,7 +838,7 @@ ecore_wl2_buffer_create(Ecore_Wl2_Display *ewd, int w, int h, Eina_Bool alpha)
out = _ecore_wl2_buffer_partial_create(w, h, alpha);
if (!out) return NULL;
- out->wl_buffer = ecore_wl2_buffer_wl_buffer_get(ewd, out);
+ out->wl_buffer = buffer_manager->to_buffer(ewd, out);
return out;
}
@@ -749,7 +884,6 @@ _ecore_wl2_buffer_test(Ecore_Wl2_Display *ewd)
zwp_linux_buffer_params_v1_add_listener(dp, &params_listener, ewd);
zwp_linux_buffer_params_v1_create(dp, buf->w, buf->h,
DRM_FORMAT_ARGB8888, 0);
- ecore_wl2_display_flush(ewd);
ecore_wl2_buffer_destroy(buf);
diff --git a/src/lib/ecore_wl2/ecore_wl2_display.c b/src/lib/ecore_wl2/ecore_wl2_display.c
index 9785406d97..54af642d8d 100644
--- a/src/lib/ecore_wl2/ecore_wl2_display.c
+++ b/src/lib/ecore_wl2/ecore_wl2_display.c
@@ -59,9 +59,22 @@ static const struct zwp_linux_dmabuf_v1_listener _dmabuf_listener =
};
static void
-_zxdg_shell_cb_ping(void *data EINA_UNUSED, struct zxdg_shell_v6 *shell, uint32_t serial)
+_xdg_shell_cb_ping(void *data, struct xdg_wm_base *shell, uint32_t serial)
+{
+ xdg_wm_base_pong(shell, serial);
+ ecore_wl2_display_flush(data);
+}
+
+static const struct xdg_wm_base_listener _xdg_shell_listener =
+{
+ _xdg_shell_cb_ping,
+};
+
+static void
+_zxdg_shell_cb_ping(void *data, struct zxdg_shell_v6 *shell, uint32_t serial)
{
zxdg_shell_v6_pong(shell, serial);
+ ecore_wl2_display_flush(data);
}
static const struct zxdg_shell_v6_listener _zxdg_shell_listener =
@@ -132,7 +145,7 @@ _aux_hints_supported_aux_hints(void *data, struct efl_aux_hints *aux_hints EINA_
}
if (!(ev = calloc(1, sizeof(Ecore_Wl2_Event_Aux_Hint_Supported)))) return;
- ev->win = win->id;
+ ev->win = win;
ev->display = ewd;
ewd->refs++;
ecore_event_add(ECORE_WL2_EVENT_AUX_HINT_SUPPORTED, ev, _display_event_free, ewd);
@@ -151,7 +164,7 @@ _aux_hints_allowed_aux_hint(void *data, struct efl_aux_hints *aux_hints EINA_UN
if (!win) return;
if (!(ev = calloc(1, sizeof(Ecore_Wl2_Event_Aux_Hint_Allowed)))) return;
- ev->win = win->id;
+ ev->win = win;
ev->id = id;
ev->display = ewd;
ewd->refs++;
@@ -199,7 +212,7 @@ _aux_hints_aux_message(void *data, struct efl_aux_hints *aux_hints EINA_UNUSED,
}
}
- ev->win = win->id;
+ ev->win = win;
ev->key = eina_stringshare_add(key);
ev->val = eina_stringshare_add(val);
ev->options = opt_list;
@@ -337,13 +350,13 @@ _cb_global_add(void *data, struct wl_registry *registry, unsigned int id, const
ewd->wl.efl_hints = wl_registry_bind(registry, id, &efl_hints_interface, MIN(version, 2));
EINA_INLIST_FOREACH(ewd->windows, window)
{
- if (!window->zxdg_surface) continue;
+ if (!window->xdg_surface) continue;
if (window->aspect.set)
- efl_hints_set_aspect(window->display->wl.efl_hints, window->zxdg_surface,
+ efl_hints_set_aspect(window->display->wl.efl_hints, window->xdg_surface,
window->aspect.w, window->aspect.h, window->aspect.aspect);
if (window->weight.set)
efl_hints_set_weight(window->display->wl.efl_hints,
- window->zxdg_surface, window->weight.w, window->weight.h);
+ window->xdg_surface, window->weight.w, window->weight.h);
}
}
@@ -438,6 +451,7 @@ _ecore_wl2_display_globals_cleanup(Ecore_Wl2_Display *ewd)
if (ewd->wl.session_recovery)
zwp_e_session_recovery_destroy(ewd->wl.session_recovery);
if (ewd->wl.www) www_destroy(ewd->wl.www);
+ if (ewd->wl.xdg_wm_base) xdg_wm_base_destroy(ewd->wl.xdg_wm_base);
if (ewd->wl.zxdg_shell) zxdg_shell_v6_destroy(ewd->wl.zxdg_shell);
if (ewd->wl.shm) wl_shm_destroy(ewd->wl.shm);
if (ewd->wl.data_device_manager)
@@ -488,6 +502,9 @@ _recovery_timer_add(Ecore_Wl2_Display *ewd)
_ecore_wl2_window_semi_free(window);
window->set_config.serial = 0;
window->req_config.serial = 0;
+ window->xdg_configure_ack = NULL;
+ window->xdg_set_min_size = NULL;
+ window->xdg_set_max_size = NULL;
window->zxdg_configure_ack = NULL;
window->zxdg_set_min_size = NULL;
window->zxdg_set_max_size = NULL;
@@ -611,6 +628,7 @@ _ecore_wl2_shell_bind(Ecore_Wl2_Display *ewd)
const char **itr;
const char *shells[] =
{
+ "xdg_wm_base",
"zxdg_shell_v6",
NULL
};
@@ -626,13 +644,22 @@ _ecore_wl2_shell_bind(Ecore_Wl2_Display *ewd)
if (!global) return;
- if (!strcmp(global->interface, "zxdg_shell_v6"))
+ if (!strcmp(global->interface, "xdg_wm_base"))
+ {
+ ewd->wl.xdg_wm_base =
+ wl_registry_bind(ewd->wl.registry, global->id,
+ &xdg_wm_base_interface, 1);
+ xdg_wm_base_add_listener(ewd->wl.xdg_wm_base,
+ &_xdg_shell_listener, ewd);
+ ewd->shell_done = EINA_TRUE;
+ }
+ else if (!strcmp(global->interface, "zxdg_shell_v6"))
{
ewd->wl.zxdg_shell =
wl_registry_bind(ewd->wl.registry, global->id,
&zxdg_shell_v6_interface, 1);
zxdg_shell_v6_add_listener(ewd->wl.zxdg_shell,
- &_zxdg_shell_listener, NULL);
+ &_zxdg_shell_listener, ewd);
ewd->shell_done = EINA_TRUE;
}
}
@@ -652,6 +679,7 @@ _cb_sync_done(void *data, struct wl_callback *cb, uint32_t serial EINA_UNUSED)
_ecore_wl2_shell_bind(ewd);
wl_callback_destroy(cb);
+ ecore_wl2_display_flush(ewd);
ev = calloc(1, sizeof(Ecore_Wl2_Event_Sync_Done));
if (!ev) return;
@@ -719,7 +747,6 @@ _ecore_wl2_display_connect(Ecore_Wl2_Display *ewd, Eina_Bool sync)
ewd->idle_enterer = ecore_idle_enterer_add(_cb_connect_idle, ewd);
_ecore_wl2_display_event(ewd, ECORE_WL2_EVENT_CONNECT);
- ecore_wl2_display_flush(ewd);
return EINA_TRUE;
}
@@ -1056,19 +1083,6 @@ ecore_wl2_display_screen_size_get(Ecore_Wl2_Display *display, int *w, int *h)
if (h) *h = oh;
}
-EAPI Ecore_Wl2_Window *
-ecore_wl2_display_window_find(Ecore_Wl2_Display *display, unsigned int id)
-{
- Ecore_Wl2_Window *window;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(display, NULL);
-
- EINA_INLIST_FOREACH(display->windows, window)
- if (window->id == (int)id) return window;
-
- return NULL;
-}
-
EAPI struct wl_registry *
ecore_wl2_display_registry_get(Ecore_Wl2_Display *display)
{
diff --git a/src/lib/ecore_wl2/ecore_wl2_dnd.c b/src/lib/ecore_wl2/ecore_wl2_dnd.c
index b3fcb458e6..b39ecc2b84 100644
--- a/src/lib/ecore_wl2/ecore_wl2_dnd.c
+++ b/src/lib/ecore_wl2/ecore_wl2_dnd.c
@@ -53,21 +53,21 @@ struct _Ecore_Wl2_Offer
uint32_t serial;
Eina_List *reads;
int ref;
- unsigned int window_id;
+ Ecore_Wl2_Window *window;
Eina_Bool proxied : 1;
};
-static int
+Ecore_Wl2_Window *
_win_id_get(Ecore_Wl2_Input *input)
{
- int win = 0;
+ Ecore_Wl2_Window *win = NULL;
if (input->focus.pointer)
- win = input->focus.pointer->id;
+ win = input->focus.pointer;
else if (input->focus.prev_pointer)
- win = input->focus.prev_pointer->id;
+ win = input->focus.prev_pointer;
else if (input->focus.keyboard)
- win = input->focus.keyboard->id;
+ win = input->focus.keyboard;
return win;
}
@@ -149,7 +149,7 @@ static void
event_fill(struct _Ecore_Wl2_Event_Data_Source_Event *ev, Ecore_Wl2_Input *input)
{
if (input->focus.keyboard)
- ev->source = input->focus.keyboard->id;
+ ev->source = input->focus.keyboard;
ev->win = _win_id_get(input);
ev->action = input->data.drag.action;
@@ -256,7 +256,7 @@ _ecore_wl2_dnd_enter(Ecore_Wl2_Input *input, struct wl_data_offer *offer, struct
if (input->drag.offer)
{
input->drag.offer->serial = serial;
- input->drag.offer->window_id = window->id;
+ input->drag.offer->window = window;
if (input->display->wl.data_device_manager_version >=
WL_DATA_OFFER_SET_ACTIONS_SINCE_VERSION)
@@ -269,14 +269,14 @@ _ecore_wl2_dnd_enter(Ecore_Wl2_Input *input, struct wl_data_offer *offer, struct
else input->drag.offer = NULL;
input->drag.enter_serial = serial;
- input->drag.window_id = window->id;
+ input->drag.window = window;
ev = calloc(1, sizeof(Ecore_Wl2_Event_Dnd_Enter));
if (!ev) return;
if (input->focus.keyboard)
- ev->source = input->focus.keyboard->id;
- ev->win = input->drag.window_id;
+ ev->source = input->focus.keyboard;
+ ev->win = input->drag.window;
ev->x = x;
ev->y = y;
@@ -311,9 +311,9 @@ _ecore_wl2_dnd_leave(Ecore_Wl2_Input *input)
if (!ev) return;
if (input->focus.keyboard)
- ev->source = input->focus.keyboard->id;
+ ev->source = input->focus.keyboard;
- ev->win = input->drag.window_id;
+ ev->win = input->drag.window;
ev->offer = input->drag.offer;
if (ev->offer)
ev->offer->ref++;
@@ -321,7 +321,7 @@ _ecore_wl2_dnd_leave(Ecore_Wl2_Input *input)
ev->display = input->display;
ev->display->refs++;
- input->drag.window_id = 0;
+ input->drag.window = NULL;
input->drag.enter_serial = 0;
input->drag.offer = NULL;
ecore_event_add(ECORE_WL2_EVENT_DND_LEAVE, ev, _delay_offer_destroy, ev->offer);
@@ -342,9 +342,9 @@ _ecore_wl2_dnd_motion(Ecore_Wl2_Input *input, int x, int y, uint32_t serial)
input->drag.offer->serial = serial;
if (input->focus.keyboard)
- ev->source = input->focus.keyboard->id;
+ ev->source = input->focus.keyboard;
- ev->win = input->drag.window_id;
+ ev->win = input->drag.window;
ev->x = x;
ev->y = y;
ev->offer = input->drag.offer;
@@ -364,9 +364,9 @@ _ecore_wl2_dnd_drop(Ecore_Wl2_Input *input)
if (!ev) return;
if (input->focus.keyboard)
- ev->source = input->focus.keyboard->id;
+ ev->source = input->focus.keyboard;
- ev->win = input->drag.window_id;
+ ev->win = input->drag.window;
ev->x = input->pointer.sx;
ev->y = input->pointer.sy;
ev->offer = input->drag.offer;
@@ -524,7 +524,7 @@ ecore_wl2_dnd_drag_end(Ecore_Wl2_Input *input)
if (!ev) return;
if (input->focus.keyboard)
- ev->source = input->focus.keyboard->id;
+ ev->source = input->focus.keyboard;
ev->win = _win_id_get(input);
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c
index 6f751fb9b2..ade74de234 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -47,10 +47,10 @@ typedef struct _Ecore_Wl2_Mouse_Down_Info
{
EINA_INLIST;
int device, sx, sy;
- int last_win;
- int last_last_win;
- int last_event_win;
- int last_last_event_win;
+ Ecore_Wl2_Window *last_win;
+ Ecore_Wl2_Window *last_last_win;
+ Ecore_Wl2_Window *last_event_win;
+ Ecore_Wl2_Window *last_last_event_win;
unsigned int last_time;
unsigned int last_last_time;
Eina_Bool double_click : 1;
@@ -82,14 +82,14 @@ _ecore_wl2_input_mouse_down_info_get(int device)
}
static Ecore_Wl2_Input_Devices *
-_ecore_wl2_devices_get(const Ecore_Wl2_Input *input, int window_id)
+_ecore_wl2_devices_get(const Ecore_Wl2_Input *input, const Ecore_Wl2_Window *window)
{
Ecore_Wl2_Input_Devices *devices;
Eina_List *l;
EINA_LIST_FOREACH(input->devices_list, l, devices)
{
- if (devices->window_id == window_id)
+ if (devices->window == window)
return devices;
}
@@ -97,11 +97,11 @@ _ecore_wl2_devices_get(const Ecore_Wl2_Input *input, int window_id)
}
static Eo *
-_ecore_wl2_mouse_dev_get(Ecore_Wl2_Input *input, int window_id)
+_ecore_wl2_mouse_dev_get(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window)
{
Ecore_Wl2_Input_Devices *devices;
- devices = _ecore_wl2_devices_get(input, window_id);
+ devices = _ecore_wl2_devices_get(input, window);
if (devices && devices->pointer_dev)
return efl_ref(devices->pointer_dev);
@@ -109,11 +109,11 @@ _ecore_wl2_mouse_dev_get(Ecore_Wl2_Input *input, int window_id)
}
static Eo *
-_ecore_wl2_touch_dev_get(Ecore_Wl2_Input *input, int window_id)
+_ecore_wl2_touch_dev_get(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window)
{
Ecore_Wl2_Input_Devices *devices;
- devices = _ecore_wl2_devices_get(input, window_id);
+ devices = _ecore_wl2_devices_get(input, window);
if (devices && devices->touch_dev)
return efl_ref(devices->touch_dev);
@@ -121,11 +121,11 @@ _ecore_wl2_touch_dev_get(Ecore_Wl2_Input *input, int window_id)
}
static Eo *
-_ecore_wl2_seat_dev_get(Ecore_Wl2_Input *input, int window_id)
+_ecore_wl2_seat_dev_get(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window)
{
Ecore_Wl2_Input_Devices *devices;
- devices = _ecore_wl2_devices_get(input, window_id);
+ devices = _ecore_wl2_devices_get(input, window);
if (devices)
return efl_ref(devices->seat_dev);
@@ -150,11 +150,11 @@ _ecore_wl2_input_mouse_in_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window)
ev->x = input->pointer.sx;
ev->y = input->pointer.sy;
- ev->window = window->id;
- ev->event_window = window->id;
+ ev->window = (Ecore_Window)window;
+ ev->event_window = (Ecore_Window)window;
ev->timestamp = input->timestamp;
ev->modifiers = input->keyboard.modifiers;
- ev->dev = _ecore_wl2_mouse_dev_get(input, window->id);
+ ev->dev = _ecore_wl2_mouse_dev_get(input, window);
ecore_event_add(ECORE_EVENT_MOUSE_IN, ev, _input_event_cb_free, ev->dev);
}
@@ -169,11 +169,11 @@ _ecore_wl2_input_mouse_out_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window
ev->x = input->pointer.sx;
ev->y = input->pointer.sy;
- ev->window = window->id;
- ev->event_window = window->id;
+ ev->window = (Ecore_Window)window;
+ ev->event_window = (Ecore_Window)window;
ev->timestamp = input->timestamp;
ev->modifiers = input->keyboard.modifiers;
- ev->dev = _ecore_wl2_mouse_dev_get(input, window->id);
+ ev->dev = _ecore_wl2_mouse_dev_get(input, window);
ecore_event_add(ECORE_EVENT_MOUSE_OUT, ev, _input_event_cb_free, ev->dev);
}
@@ -187,8 +187,8 @@ _ecore_wl2_input_mouse_move_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *windo
ev = calloc(1, sizeof(Ecore_Event_Mouse_Move));
if (!ev) return;
- ev->window = window->id;
- ev->event_window = window->id;
+ ev->window = (Ecore_Window)window;
+ ev->event_window = (Ecore_Window)window;
ev->timestamp = input->timestamp;
ev->x = input->pointer.sx;
ev->y = input->pointer.sy;
@@ -207,9 +207,9 @@ _ecore_wl2_input_mouse_move_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *windo
ev->multi.root.y = input->pointer.sy;
if ((input->focus.touch) && (input->focus.touch == window))
- ev->dev = _ecore_wl2_touch_dev_get(input, window->id);
+ ev->dev = _ecore_wl2_touch_dev_get(input, window);
else if ((input->focus.pointer) && (input->focus.pointer == window))
- ev->dev = _ecore_wl2_mouse_dev_get(input, window->id);
+ ev->dev = _ecore_wl2_mouse_dev_get(input, window);
info = _ecore_wl2_input_mouse_down_info_get(device);
if (info)
@@ -248,27 +248,27 @@ _ecore_wl2_input_mouse_wheel_send(Ecore_Wl2_Input *input, unsigned int axis, int
if (input->grab.window)
{
- ev->window = input->grab.window->id;
- ev->event_window = input->grab.window->id;
+ ev->window = (Ecore_Window)input->grab.window;
+ ev->event_window = (Ecore_Window)input->grab.window;
}
else if (input->focus.pointer)
{
- ev->window = input->focus.pointer->id;
- ev->event_window = input->focus.pointer->id;
- ev->dev = _ecore_wl2_mouse_dev_get(input, input->focus.pointer->id);
+ ev->window = (Ecore_Window)input->focus.pointer;
+ ev->event_window = (Ecore_Window)input->focus.pointer;
+ ev->dev = _ecore_wl2_mouse_dev_get(input, input->focus.pointer);
}
else if (input->focus.touch)
{
- ev->window = input->focus.touch->id;
- ev->event_window = input->focus.touch->id;
- ev->dev = _ecore_wl2_touch_dev_get(input, input->focus.touch->id);
+ ev->window = (Ecore_Window)input->focus.touch;
+ ev->event_window = (Ecore_Window)input->focus.touch;
+ ev->dev = _ecore_wl2_touch_dev_get(input, input->focus.touch);
}
if (!ev->dev)
{
- ev->dev = _ecore_wl2_mouse_dev_get(input, ev->window);
+ ev->dev = _ecore_wl2_mouse_dev_get(input, (Ecore_Wl2_Window *)ev->window);
if (!ev->dev)
- ev->dev = _ecore_wl2_touch_dev_get(input, ev->window);
+ ev->dev = _ecore_wl2_touch_dev_get(input, (Ecore_Wl2_Window *)ev->window);
}
ecore_event_add(ECORE_EVENT_MOUSE_WHEEL, ev, _input_event_cb_free, ev->dev);
@@ -318,8 +318,8 @@ _ecore_wl2_input_mouse_down_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *windo
}
if (((int)(timestamp - info->last_time) <= (int)(1000 * 0.25)) &&
- ((window) && (window->id == info->last_win) &&
- (window->id == info->last_event_win)))
+ ((window) && (window == info->last_win) &&
+ (window == info->last_event_win)))
{
ev->double_click = 1;
info->double_click = EINA_TRUE;
@@ -332,10 +332,10 @@ _ecore_wl2_input_mouse_down_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *windo
if (((int)(timestamp - info->last_last_time) <=
(int)(2 * 1000 * 0.25)) &&
- ((window) && (window->id == info->last_win) &&
- (window->id == info->last_last_win) &&
- (window->id == info->last_event_win) &&
- (window->id == info->last_last_event_win)))
+ ((window) && (window == info->last_win) &&
+ (window == info->last_last_win) &&
+ (window == info->last_event_win) &&
+ (window == info->last_last_event_win)))
{
ev->triple_click = 1;
info->triple_click = EINA_TRUE;
@@ -357,13 +357,13 @@ _ecore_wl2_input_mouse_down_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *windo
if (window)
{
- ev->window = window->id;
- ev->event_window = window->id;
+ ev->window = (Ecore_Window)window;
+ ev->event_window = (Ecore_Window)window;
if ((input->focus.touch) && (input->focus.touch == window))
- ev->dev = _ecore_wl2_touch_dev_get(input, window->id);
+ ev->dev = _ecore_wl2_touch_dev_get(input, window);
else if ((input->focus.pointer) && (input->focus.pointer == window))
- ev->dev = _ecore_wl2_mouse_dev_get(input, window->id);
+ ev->dev = _ecore_wl2_mouse_dev_get(input, window);
}
ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, ev,
@@ -372,9 +372,9 @@ _ecore_wl2_input_mouse_down_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *windo
if ((info) && (!info->triple_click))
{
info->last_last_win = info->last_win;
- info->last_win = ev->window;
+ info->last_win = (Ecore_Wl2_Window *)ev->window;
info->last_last_event_win = info->last_event_win;
- info->last_event_win = ev->window;
+ info->last_event_win = (Ecore_Wl2_Window *)ev->window;
info->last_last_time = info->last_time;
info->last_time = timestamp;
}
@@ -433,13 +433,13 @@ _ecore_wl2_input_mouse_up_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window,
ev->multi.root.x = input->pointer.sx;
ev->multi.root.y = input->pointer.sy;
- ev->window = window->id;
- ev->event_window = window->id;
+ ev->window = (Ecore_Window)window;
+ ev->event_window = (Ecore_Window)window;
if ((input->focus.touch) && (input->focus.touch == window))
- ev->dev = _ecore_wl2_touch_dev_get(input, window->id);
+ ev->dev = _ecore_wl2_touch_dev_get(input, window);
else if ((input->focus.pointer) && (input->focus.pointer == window))
- ev->dev = _ecore_wl2_mouse_dev_get(input, window->id);
+ ev->dev = _ecore_wl2_mouse_dev_get(input, window);
ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev,
_input_event_cb_free, ev->dev);
@@ -464,8 +464,8 @@ _ecore_wl2_input_focus_in_send(Ecore_Wl2_Window *window, Ecore_Wl2_Input *input)
if (!ev) return;
ev->timestamp = input->timestamp;
- ev->window = window->id;
- ev->dev = _ecore_wl2_seat_dev_get(input, window->id);
+ ev->window = window;
+ ev->dev = _ecore_wl2_seat_dev_get(input, window);
ev->display = input->display;
ev->display->refs++;
ecore_event_add(ECORE_WL2_EVENT_FOCUS_IN, ev, _input_event_focus_cb_free,
@@ -481,8 +481,8 @@ _ecore_wl2_input_focus_out_send(Ecore_Wl2_Window *window, Ecore_Wl2_Input *input
if (!ev) return;
ev->timestamp = input->timestamp;
- ev->window = window->id;
- ev->dev = _ecore_wl2_seat_dev_get(input, window->id);
+ ev->window = window;
+ ev->dev = _ecore_wl2_seat_dev_get(input, window);
ev->display = input->display;
ev->display->refs++;
ecore_event_add(ECORE_WL2_EVENT_FOCUS_OUT, ev, _input_event_focus_cb_free,
@@ -592,16 +592,6 @@ in this Software without prior written authorization from The Open Group.
static void
_ecore_wl2_input_symbol_rep_find(xkb_keysym_t keysym, char *buffer, int size, unsigned int code)
{
- int n = 0;
-
- n = xkb_keysym_to_utf8(keysym, buffer, size);
-
- /* check if we are a control code */
- if (n > 0 && !(
- (buffer[0] > 0x0 && buffer[0] < 0x20) || /* others 0x0 to 0x1F control codes */
- buffer[0] == 0x7F)) /*delete control code */
- return;
-
if (xkb_keysym_get_name(keysym, buffer, size) != 0)
return;
@@ -609,11 +599,11 @@ _ecore_wl2_input_symbol_rep_find(xkb_keysym_t keysym, char *buffer, int size, un
}
static Eo *
-_ecore_wl2_keyboard_dev_get(Ecore_Wl2_Input *input, int window_id)
+_ecore_wl2_keyboard_dev_get(Ecore_Wl2_Input *input, Ecore_Wl2_Window * window)
{
Ecore_Wl2_Input_Devices *devices;
- devices = _ecore_wl2_devices_get(input, window_id);
+ devices = _ecore_wl2_devices_get(input, window);
if (devices && devices->keyboard_dev)
return efl_ref(devices->keyboard_dev);
@@ -624,11 +614,8 @@ static void
_ecore_wl2_input_key_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window, xkb_keysym_t sym, xkb_keysym_t sym_name, unsigned int code, unsigned int state, unsigned int timestamp)
{
Ecore_Event_Key *ev;
- char key[256], keyname[256], compose[256];
-
- memset(key, 0, sizeof(key));
- memset(keyname, 0, sizeof(keyname));
- memset(compose, 0, sizeof(compose));
+ char key[256] = "", keyname[256] = "", compose[256] = "";
+ int name_len, key_len, comp_len;
/*try to get a name or utf char of the given symbol */
_ecore_wl2_input_symbol_rep_find(sym, key, sizeof(key), code);
@@ -636,25 +623,28 @@ _ecore_wl2_input_key_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window, xkb_
_ecore_wl2_input_key_translate(sym, input->keyboard.modifiers,
compose, sizeof(compose));
- ev = calloc(1, sizeof(Ecore_Event_Key) + strlen(key) + strlen(keyname) +
- ((compose[0] != '\0') ? strlen(compose) : 0) + 3);
+ name_len = strlen(keyname);
+ key_len = strlen(key);
+ comp_len = strlen(compose);
+
+ ev = calloc(1, sizeof(Ecore_Event_Key) + key_len + name_len + comp_len + 3);
if (!ev) return;
ev->keyname = (char *)(ev + 1);
- ev->key = ev->keyname + strlen(keyname) + 1;
- ev->compose = strlen(compose) ? ev->key + strlen(key) + 1 : NULL;
+ ev->key = ev->keyname + name_len + 1;
+ ev->compose = comp_len ? ev->key + key_len + 1 : NULL;
ev->string = ev->compose;
strcpy((char *)ev->keyname, keyname);
strcpy((char *)ev->key, key);
- if (strlen(compose)) strcpy((char *)ev->compose, compose);
+ if (comp_len) strcpy((char *)ev->compose, compose);
- ev->window = window->id;
- ev->event_window = window->id;
+ ev->window = (Ecore_Window)window;
+ ev->event_window = (Ecore_Window)window;
ev->timestamp = timestamp;
ev->modifiers = input->keyboard.modifiers;
ev->keycode = code;
- ev->dev = _ecore_wl2_keyboard_dev_get(input, window->id);
+ ev->dev = _ecore_wl2_keyboard_dev_get(input, window);
/* DBG("Emitting Key event (%s,%s,%s,%s)\n", ev->keyname, ev->key, ev->compose, ev->string); */
@@ -716,13 +706,6 @@ _pointer_cb_enter(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned i
input->focus.pointer = window;
_ecore_wl2_input_mouse_in_send(input, window);
-
- if ((window->moving) && (input->grab.window == window))
- {
- _ecore_wl2_input_mouse_up_send(input, window, 0, input->grab.button,
- input->grab.timestamp);
- window->moving = EINA_FALSE;
- }
}
static void
@@ -745,9 +728,6 @@ _pointer_cb_leave(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned i
window = _ecore_wl2_display_window_surface_find(input->display, surface);
if (!window) return;
- /* NB: Don't send a mouse out if we grabbed this window for moving */
- if ((window->moving) && (input->grab.window == window)) return;
-
_ecore_wl2_input_mouse_out_send(input, window);
}
@@ -1433,6 +1413,7 @@ _seat_cb_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability
wl_touch_destroy(input->wl.touch);
input->wl.touch = NULL;
}
+ ecore_wl2_display_flush(input->display);
ev = calloc(1, sizeof(Ecore_Wl2_Event_Seat_Capabilities));
EINA_SAFETY_ON_NULL_RETURN(ev);
@@ -1511,6 +1492,7 @@ _ecore_wl2_input_cursor_update(void *data)
wl_pointer_set_cursor(input->wl.pointer, input->pointer.enter_serial,
input->cursor.surface,
input->cursor.hot_x, input->cursor.hot_y);
+ ecore_wl2_display_flush(input->display);
return ECORE_CALLBACK_RENEW;
}
@@ -1543,7 +1525,7 @@ _ecore_wl2_cb_device_event(void *data, int type, void *event)
EINA_LIST_FOREACH(input->devices_list, l, devs)
{
- if (devs->window_id == ev->window_id)
+ if (devs->window == ev->window)
{
devices = devs;
break;
@@ -1558,7 +1540,7 @@ _ecore_wl2_cb_device_event(void *data, int type, void *event)
EINA_SAFETY_ON_NULL_RETURN_VAL(devices, ECORE_CALLBACK_PASS_ON);
input->devices_list =
eina_list_append(input->devices_list, devices);
- devices->window_id = ev->window_id;
+ devices->window = ev->window;
}
if (ev->type == ECORE_WL2_DEVICE_TYPE_POINTER)
@@ -1755,29 +1737,13 @@ _ecore_wl2_input_window_remove(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window)
}
EINA_LIST_FOREACH_SAFE(input->devices_list, l, l_next, devices)
- if (devices->window_id == window->id)
+ if (devices->window == window)
{
_ecore_wl2_devices_free(devices);
input->devices_list = eina_list_remove_list(input->devices_list, l);
}
}
-EAPI void
-ecore_wl2_input_grab(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window, unsigned int button)
-{
- EINA_SAFETY_ON_NULL_RETURN(input);
- EINA_SAFETY_ON_NULL_RETURN(input->display);
- _ecore_wl2_input_grab(input, window, button);
-}
-
-EAPI void
-ecore_wl2_input_ungrab(Ecore_Wl2_Input *input)
-{
- EINA_SAFETY_ON_NULL_RETURN(input);
- EINA_SAFETY_ON_NULL_RETURN(input->display);
- _ecore_wl2_input_ungrab(input);
-}
-
EAPI struct wl_seat *
ecore_wl2_input_seat_get(Ecore_Wl2_Input *input)
{
@@ -1852,7 +1818,7 @@ ecore_wl2_input_seat_device_get(const Ecore_Wl2_Input *input, const Ecore_Wl2_Wi
EINA_SAFETY_ON_NULL_RETURN_VAL(input, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(window, NULL);
- devices = _ecore_wl2_devices_get(input, window->id);
+ devices = _ecore_wl2_devices_get(input, window);
return devices ? devices->seat_dev : NULL;
}
diff --git a/src/lib/ecore_wl2/ecore_wl2_output.c b/src/lib/ecore_wl2/ecore_wl2_output.c
index ba1d7cea8f..0aa8791c12 100644
--- a/src/lib/ecore_wl2/ecore_wl2_output.c
+++ b/src/lib/ecore_wl2/ecore_wl2_output.c
@@ -117,6 +117,17 @@ _ecore_wl2_output_del(Ecore_Wl2_Output *output)
free(output);
}
+Ecore_Wl2_Output *
+_ecore_wl2_output_find(Ecore_Wl2_Display *display, struct wl_output *op)
+{
+ Ecore_Wl2_Output *wl2op;
+
+ EINA_INLIST_FOREACH(display->outputs, wl2op)
+ if (wl2op->wl_output == op) return wl2op;
+
+ return NULL;
+}
+
EAPI int
ecore_wl2_output_dpi_get(Ecore_Wl2_Output *output)
{
diff --git a/src/lib/ecore_wl2/ecore_wl2_private.h b/src/lib/ecore_wl2/ecore_wl2_private.h
index 0648bfcb30..1ac9b44808 100644
--- a/src/lib/ecore_wl2/ecore_wl2_private.h
+++ b/src/lib/ecore_wl2/ecore_wl2_private.h
@@ -12,6 +12,7 @@
# include "session-recovery-client-protocol.h"
+# include "xdg-shell-client-protocol.h"
# include "xdg-shell-unstable-v6-client-protocol.h"
# include "efl-aux-hints-client-protocol.h"
@@ -68,7 +69,7 @@ typedef struct _Ecore_Wl2_Input_Devices
Eo *keyboard_dev;
Eo *touch_dev;
Eo *seat_dev;
- int window_id;
+ Ecore_Wl2_Window *window;
} Ecore_Wl2_Input_Devices;
struct _Ecore_Wl2_Display
@@ -88,6 +89,7 @@ struct _Ecore_Wl2_Display
struct wl_shm *shm;
struct zwp_linux_dmabuf_v1 *dmabuf;
struct zxdg_shell_v6 *zxdg_shell;
+ struct xdg_wm_base *xdg_wm_base;
struct www *www;
struct zwp_e_session_recovery *session_recovery;
struct efl_aux_hints *efl_aux_hints;
@@ -154,7 +156,6 @@ typedef struct _Ecore_Wl2_Window_Configure_State
{
uint32_t serial;
Eina_Rectangle geometry;
- Eina_Bool minimized : 1;
Eina_Bool maximized : 1;
Eina_Bool fullscreen : 1;
Eina_Bool focused : 1;
@@ -172,7 +173,7 @@ struct _Ecore_Wl2_Window
Ecore_Wl2_Surface *wl2_surface;
- int id, rotation, surface_id;
+ int rotation, surface_id;
const char *title;
const char *class;
const char *role;
@@ -181,12 +182,20 @@ struct _Ecore_Wl2_Window
void *buffer;
struct wl_callback *callback;
struct www_surface *www_surface;
+ struct xdg_surface *xdg_surface;
+ struct xdg_toplevel *xdg_toplevel;
+ struct xdg_popup *xdg_popup;
+
struct zxdg_surface_v6 *zxdg_surface;
struct zxdg_toplevel_v6 *zxdg_toplevel;
struct zxdg_popup_v6 *zxdg_popup;
Eina_Stringshare *uuid;
+ void (*xdg_configure_ack)(struct xdg_surface *surface, uint32_t serial);
+ void (*xdg_set_min_size)(struct xdg_toplevel *toplevel, int32_t w, int32_t h);
+ void (*xdg_set_max_size)(struct xdg_toplevel *toplevel, int32_t w, int32_t h);
+
void (*zxdg_configure_ack)(struct zxdg_surface_v6 *surface, uint32_t serial);
void (*zxdg_set_min_size)(struct zxdg_toplevel_v6 *toplevel, int32_t w, int32_t h);
void (*zxdg_set_max_size)(struct zxdg_toplevel_v6 *toplevel, int32_t w, int32_t h);
@@ -214,13 +223,13 @@ struct _Ecore_Wl2_Window
Eina_List *supported_aux_hints;
Eina_List *frame_callbacks;
+ Eina_List *outputs;
+
Ecore_Wl2_Window_Configure_State set_config;
Ecore_Wl2_Window_Configure_State req_config;
Ecore_Wl2_Window_Configure_State def_config;
- Eina_Bool moving : 1;
Eina_Bool alpha : 1;
- Eina_Bool transparent : 1;
Eina_Bool input_set : 1;
Eina_Bool opaque_set : 1;
@@ -252,6 +261,7 @@ struct _Ecore_Wl2_Window
} wm_rot;
Eina_Bool has_buffer : 1;
Eina_Bool updating : 1;
+ Eina_Bool deferred_minimize : 1;
};
struct _Ecore_Wl2_Output
@@ -499,7 +509,7 @@ struct _Ecore_Wl2_Input
{
Ecore_Wl2_Offer *offer;
uint32_t enter_serial;
- Ecore_Window window_id;
+ Ecore_Wl2_Window *window;
} drag, selection;
unsigned int seat_version;
@@ -513,7 +523,7 @@ struct _Ecore_Wl2_Input
typedef struct Ecore_Wl2_Event_Window_WWW
{
- unsigned int window;
+ Ecore_Wl2_Window *window;
int x_rel;
int y_rel;
uint32_t timestamp;
@@ -521,7 +531,7 @@ typedef struct Ecore_Wl2_Event_Window_WWW
typedef struct Ecore_Wl2_Event_Window_WWW_Drag
{
- unsigned int window;
+ Ecore_Wl2_Window *window;
Eina_Bool dragging;
} Ecore_Wl2_Event_Window_WWW_Drag;
@@ -546,21 +556,13 @@ typedef struct _Ecore_Wl2_Buffer
typedef struct _Ecore_Wl2_Surface
{
+ void *private_data;
Ecore_Wl2_Window *wl2_win;
- Ecore_Wl2_Buffer *current;
- Eina_List *buffers;
int w, h;
+ Ecore_Wl2_Surface_Interface *funcs;
+ Ecore_Event_Handler *offscreen_handler;
Eina_Bool alpha : 1;
- struct
- {
- void (*destroy)(Ecore_Wl2_Surface *surface);
- void (*reconfigure)(Ecore_Wl2_Surface *surface, int w, int h, uint32_t flags, Eina_Bool force);
- void *(*data_get)(Ecore_Wl2_Surface *surface, int *w, int *h);
- int (*assign)(Ecore_Wl2_Surface *surface);
- void (*post)(Ecore_Wl2_Surface *surface, Eina_Rectangle *rects, unsigned int count);
- void (*flush)(Ecore_Wl2_Surface *surface);
- } funcs;
} Ecore_Wl2_Surface;
Ecore_Wl2_Window *_ecore_wl2_display_window_surface_find(Ecore_Wl2_Display *display, struct wl_surface *wl_surface);
@@ -605,4 +607,6 @@ EAPI void ecore_wl2_window_weight_set(Ecore_Wl2_Window *window, double w, double
EAPI extern int _ecore_wl2_event_window_www;
EAPI extern int _ecore_wl2_event_window_www_drag;
+Ecore_Wl2_Output *_ecore_wl2_output_find(Ecore_Wl2_Display *dsp, struct wl_output *op);
+
#endif
diff --git a/src/lib/ecore_wl2/ecore_wl2_surface.c b/src/lib/ecore_wl2/ecore_wl2_surface.c
index cd810d21b5..b2029d11f6 100644
--- a/src/lib/ecore_wl2/ecore_wl2_surface.c
+++ b/src/lib/ecore_wl2/ecore_wl2_surface.c
@@ -7,176 +7,35 @@
#include <sys/types.h>
#include <sys/stat.h>
-#include "linux-dmabuf-unstable-v1-client-protocol.h"
-
-#define MAX_BUFFERS 4
-
-static void
-_evas_dmabuf_surface_reconfigure(Ecore_Wl2_Surface *s, int w, int h, uint32_t flags EINA_UNUSED, Eina_Bool force)
-{
- Ecore_Wl2_Buffer *b;
- Eina_List *l, *tmp;
-
- if ((!w) || (!h)) return;
- EINA_LIST_FOREACH_SAFE(s->buffers, l, tmp, b)
- {
- int stride = b->stride;
-
- /* If stride is a little bigger than width we still fit */
- if (!force && (w >= b->w) && (w <= stride / 4) && (h == b->h))
- {
- b->w = w;
- continue;
- }
- ecore_wl2_buffer_destroy(b);
- s->buffers = eina_list_remove_list(s->buffers, l);
- }
- s->w = w;
- s->h = h;
-}
-
-static void *
-_evas_dmabuf_surface_data_get(Ecore_Wl2_Surface *s, int *w, int *h)
-{
- Ecore_Wl2_Buffer *b;
- void *ptr;
-
- b = s->current;
- if (!b) return NULL;
-
- /* We return stride/bpp because it may not match the allocated
- * width. evas will figure out the clipping
- */
- if (w) *w = b->stride / 4;
- if (h) *h = b->h;
- if (b->locked) return b->mapping;
-
- ptr = ecore_wl2_buffer_map(b);
- if (!ptr)
- return NULL;
-
- b->mapping = ptr;
- b->locked = EINA_TRUE;
- return b->mapping;
-}
-
-static Ecore_Wl2_Buffer *
-_evas_dmabuf_surface_wait(Ecore_Wl2_Surface *s)
-{
- Ecore_Wl2_Buffer *b, *best = NULL;
- Eina_List *l;
- int best_age = -1;
-
- EINA_LIST_FOREACH(s->buffers, l, b)
- {
- if (b->locked || b->busy) continue;
- if (b->age > best_age)
- {
- best = b;
- best_age = b->age;
- }
- }
-
- if (!best && (eina_list_count(s->buffers) < MAX_BUFFERS))
- {
- Ecore_Wl2_Display *ewd;
-
- ewd = ecore_wl2_window_display_get(s->wl2_win);
- EINA_SAFETY_ON_NULL_RETURN_VAL(ewd, NULL);
-
- best = ecore_wl2_buffer_create(ewd, s->w, s->h, s->alpha);
- /* Start at -1 so it's age is incremented to 0 for first draw */
- best->age = -1;
- s->buffers = eina_list_append(s->buffers, best);
- }
- return best;
-}
-
-static int
-_evas_dmabuf_surface_assign(Ecore_Wl2_Surface *s)
-{
- Ecore_Wl2_Buffer *b;
- Eina_List *l;
-
- s->current = _evas_dmabuf_surface_wait(s);
- if (!s->current)
- {
- /* Should be unreachable and will result in graphical
- * anomalies - we should probably blow away all the
- * existing buffers and start over if we actually
- * see this happen...
- */
- WRN("No free DMAbuf buffers, dropping a frame");
- EINA_LIST_FOREACH(s->buffers, l, b)
- b->age = 0;
- return 0;
- }
- EINA_LIST_FOREACH(s->buffers, l, b)
- b->age++;
-
- return s->current->age;
-}
-
-static void
-_evas_dmabuf_surface_post(Ecore_Wl2_Surface *s, Eina_Rectangle *rects, unsigned int count)
-{
- Ecore_Wl2_Buffer *b;
-
- b = s->current;
- if (!b) return;
-
- ecore_wl2_buffer_unlock(b);
-
- s->current = NULL;
- b->busy = EINA_TRUE;
- b->age = 0;
-
- ecore_wl2_window_buffer_attach(s->wl2_win, b->wl_buffer, 0, 0, EINA_FALSE);
- ecore_wl2_window_damage(s->wl2_win, rects, count);
-
- ecore_wl2_window_commit(s->wl2_win, EINA_TRUE);
-}
-
-static void
-_evas_dmabuf_surface_destroy(Ecore_Wl2_Surface *s)
-{
- Ecore_Wl2_Buffer *b;
-
- if (!s) return;
-
- EINA_LIST_FREE(s->buffers, b)
- ecore_wl2_buffer_destroy(b);
-}
-
-static void
-_surface_flush(Ecore_Wl2_Surface *surface)
-{
- Ecore_Wl2_Buffer *b;
-
- EINA_SAFETY_ON_NULL_RETURN(surface);
-
- EINA_LIST_FREE(surface->buffers, b)
- ecore_wl2_buffer_destroy(b);
-}
-
+static Eina_List *_smanagers = NULL;
+static int _smanager_count = 0;
EAPI void
ecore_wl2_surface_destroy(Ecore_Wl2_Surface *surface)
{
EINA_SAFETY_ON_NULL_RETURN(surface);
- surface->funcs.destroy(surface);
+ ecore_event_handler_del(surface->offscreen_handler);
+ surface->funcs->destroy(surface, surface->private_data);
+ surface->wl2_win->wl2_surface = NULL;
surface->wl2_win = NULL;
free(surface);
+ /* We took a reference to ecore_wl2 in surface create to prevent
+ * modules unloading with surfaces in flight. Release that now.
+ */
+ ecore_wl2_shutdown();
}
EAPI void
-ecore_wl2_surface_reconfigure(Ecore_Wl2_Surface *surface, int w, int h, uint32_t flags, Eina_Bool force)
+ecore_wl2_surface_reconfigure(Ecore_Wl2_Surface *surface, int w, int h, uint32_t flags, Eina_Bool alpha)
{
EINA_SAFETY_ON_NULL_RETURN(surface);
- surface->funcs.reconfigure(surface, w, h, flags, force);
+ surface->funcs->reconfigure(surface, surface->private_data, w, h, flags, alpha);
+ surface->w = w;
+ surface->h = h;
+ surface->alpha = alpha;
}
EAPI void *
@@ -184,7 +43,7 @@ ecore_wl2_surface_data_get(Ecore_Wl2_Surface *surface, int *w, int *h)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(surface, NULL);
- return surface->funcs.data_get(surface, w, h);
+ return surface->funcs->data_get(surface, surface->private_data, w, h);
}
EAPI int
@@ -192,7 +51,7 @@ ecore_wl2_surface_assign(Ecore_Wl2_Surface *surface)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(surface, 0);
- return surface->funcs.assign(surface);
+ return surface->funcs->assign(surface, surface->private_data);
}
EAPI void
@@ -200,55 +59,115 @@ ecore_wl2_surface_post(Ecore_Wl2_Surface *surface, Eina_Rectangle *rects, unsign
{
EINA_SAFETY_ON_NULL_RETURN(surface);
- surface->funcs.post(surface, rects, count);
+ surface->funcs->post(surface, surface->private_data, rects, count);
}
EAPI void
-ecore_wl2_surface_flush(Ecore_Wl2_Surface *surface)
+ecore_wl2_surface_flush(Ecore_Wl2_Surface *surface, Eina_Bool purge)
{
EINA_SAFETY_ON_NULL_RETURN(surface);
- surface->funcs.flush(surface);
+ surface->funcs->flush(surface, surface->private_data, purge);
+}
+
+static Eina_Bool
+_ecore_wl2_surface_cb_offscreen(void *data, int type EINA_UNUSED, void *event)
+{
+ Ecore_Wl2_Event_Window_Offscreen *ev = event;
+ Ecore_Wl2_Surface *surf = data;
+
+ if (surf->wl2_win == ev->win)
+ ecore_wl2_surface_flush(surf, EINA_FALSE);
+
+ return ECORE_CALLBACK_RENEW;
}
EAPI Ecore_Wl2_Surface *
ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha)
{
Ecore_Wl2_Surface *out;
- Ecore_Wl2_Display *ewd;
- Ecore_Wl2_Buffer_Type types = 0;
+ Eina_List *l;
+ Ecore_Wl2_Surface_Interface *intf;
EINA_SAFETY_ON_NULL_RETURN_VAL(win, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(_smanagers, NULL);
if (win->wl2_surface) return win->wl2_surface;
out = calloc(1, sizeof(*out));
if (!out) return NULL;
- out->wl2_win = win;
-
- ewd = ecore_wl2_window_display_get(win);
- if (ecore_wl2_display_shm_get(ewd))
- types |= ECORE_WL2_BUFFER_SHM;
- if (ecore_wl2_display_dmabuf_get(ewd))
- types |= ECORE_WL2_BUFFER_DMABUF;
+ out->wl2_win = win;
out->alpha = alpha;
out->w = 0;
out->h = 0;
- /* create surface buffers */
- if (!ecore_wl2_buffer_init(ewd, types)) goto err;
-
- out->funcs.destroy = _evas_dmabuf_surface_destroy;
- out->funcs.reconfigure = _evas_dmabuf_surface_reconfigure;
- out->funcs.data_get = _evas_dmabuf_surface_data_get;
- out->funcs.assign = _evas_dmabuf_surface_assign;
- out->funcs.post = _evas_dmabuf_surface_post;
- out->funcs.flush = _surface_flush;
- win->wl2_surface = out;
- return out;
+ EINA_LIST_FOREACH(_smanagers, l, intf)
+ {
+ out->private_data = intf->setup(win);
+ if (out->private_data)
+ {
+ out->funcs = intf;
+ win->wl2_surface = out;
+ out->offscreen_handler =
+ ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_OFFSCREEN,
+ _ecore_wl2_surface_cb_offscreen,
+ out);
+ /* Since we have loadable modules, we need to make sure this
+ * surface keeps ecore_wl2 from de-initting and dlclose()ing
+ * things until after it's destroyed
+ */
+ ecore_wl2_init();
+ return out;
+ }
+ }
-err:
free(out);
return NULL;
}
+
+EAPI Ecore_Wl2_Buffer *
+ecore_wl2_surface_buffer_create(Ecore_Wl2_Surface *surface)
+{
+ Ecore_Wl2_Display *ewd;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(surface, NULL);
+
+ ewd = ecore_wl2_window_display_get(surface->wl2_win);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ewd, NULL);
+
+ return ecore_wl2_buffer_create(ewd, surface->w, surface->h, surface->alpha);
+}
+
+EAPI int
+ecore_wl2_surface_manager_add(Ecore_Wl2_Surface_Interface *intf)
+{
+ if (intf->version < ECORE_WL2_SURFACE_INTERFACE_VERSION)
+ return 0;
+
+ _smanagers = eina_list_prepend(_smanagers, intf);
+ intf->id = ++_smanager_count;
+ return intf->id;
+}
+
+EAPI void
+ecore_wl2_surface_manager_del(Ecore_Wl2_Surface_Interface *intf)
+{
+ _smanagers = eina_list_remove(_smanagers, intf);
+}
+
+EAPI Ecore_Wl2_Window *
+ecore_wl2_surface_window_get(Ecore_Wl2_Surface *surface)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(surface, NULL);
+
+ return surface->wl2_win;
+}
+
+EAPI Eina_Bool
+ecore_wl2_surface_alpha_get(Ecore_Wl2_Surface *surface)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(surface, EINA_FALSE);
+
+ return surface->alpha;
+}
diff --git a/src/lib/ecore_wl2/ecore_wl2_surface_module_dmabuf.c b/src/lib/ecore_wl2/ecore_wl2_surface_module_dmabuf.c
new file mode 100644
index 0000000000..02e77f97c5
--- /dev/null
+++ b/src/lib/ecore_wl2/ecore_wl2_surface_module_dmabuf.c
@@ -0,0 +1,269 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "Ecore_Wl2.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "linux-dmabuf-unstable-v1-client-protocol.h"
+
+#define MAX_BUFFERS 4
+#define QUEUE_TRIM_DURATION 100
+
+int ECORE_WL2_SURFACE_DMABUF = 0;
+
+typedef struct _Ecore_Wl2_Dmabuf_Private
+{
+ Ecore_Wl2_Buffer *current;
+ Eina_List *buffers;
+ int unused_duration;
+} Ecore_Wl2_Dmabuf_Private;
+
+static void *
+_evas_dmabuf_surface_setup(Ecore_Wl2_Window *win)
+{
+ Ecore_Wl2_Dmabuf_Private *priv;
+ Ecore_Wl2_Display *ewd;
+ Ecore_Wl2_Buffer_Type types = 0;
+
+ priv = calloc(1, sizeof(*priv));
+ if (!priv) return NULL;
+
+ ewd = ecore_wl2_window_display_get(win);
+ if (ecore_wl2_display_shm_get(ewd))
+ types |= ECORE_WL2_BUFFER_SHM;
+ if (ecore_wl2_display_dmabuf_get(ewd))
+ types |= ECORE_WL2_BUFFER_DMABUF;
+
+ if (!ecore_wl2_buffer_init(ewd, types))
+ {
+ free(priv);
+ return NULL;
+ }
+
+ return priv;
+}
+
+static void
+_evas_dmabuf_surface_reconfigure(Ecore_Wl2_Surface *s EINA_UNUSED, void *priv_data, int w, int h, uint32_t flags EINA_UNUSED, Eina_Bool alpha EINA_UNUSED)
+{
+ Ecore_Wl2_Dmabuf_Private *p;
+ Ecore_Wl2_Buffer *b;
+ Eina_List *l, *tmp;
+// Eina_Bool alpha_change;
+
+ p = priv_data;
+
+ if ((!w) || (!h)) return;
+// alpha_change = ecore_wl2_surface_alpha_get(s) != alpha;
+ EINA_LIST_FOREACH_SAFE(p->buffers, l, tmp, b)
+ {
+/* This would be nice, but requires a partial create to follow,
+ and that partial create is buffer type specific.
+
+ if (!alpha_change && ecore_wl2_buffer_fit(b, w, h))
+ continue;
+*/
+ ecore_wl2_buffer_destroy(b);
+ p->buffers = eina_list_remove_list(p->buffers, l);
+ }
+}
+
+static void *
+_evas_dmabuf_surface_data_get(Ecore_Wl2_Surface *s EINA_UNUSED, void *priv_data, int *w, int *h)
+{
+ Ecore_Wl2_Dmabuf_Private *p;
+ Ecore_Wl2_Buffer *b;
+ void *ptr;
+ int stride;
+
+ p = priv_data;
+
+ b = p->current;
+ if (!b) return NULL;
+
+ ptr = ecore_wl2_buffer_map(b, NULL, h, &stride);
+ if (!ptr) return NULL;
+
+ /* We return stride/bpp because it may not match the allocated
+ * width. evas will figure out the clipping
+ */
+ if (w) *w = stride / 4;
+
+ return ptr;
+}
+
+static Ecore_Wl2_Buffer *
+_evas_dmabuf_surface_wait(Ecore_Wl2_Surface *s, Ecore_Wl2_Dmabuf_Private *p)
+{
+ Ecore_Wl2_Buffer *b, *best = NULL;
+ Eina_List *l;
+ int best_age = -1;
+ int age;
+ int num_required = 1, num_allocated = 0;
+
+ EINA_LIST_FOREACH(p->buffers, l, b)
+ {
+ num_allocated++;
+ if (ecore_wl2_buffer_busy_get(b))
+ {
+ num_required++;
+ continue;
+ }
+ age = ecore_wl2_buffer_age_get(b);
+ if (age > best_age)
+ {
+ best = b;
+ best_age = age;
+ }
+ }
+
+ if (num_required < num_allocated)
+ p->unused_duration++;
+ else
+ p->unused_duration = 0;
+
+ /* If we've had unused buffers for longer than QUEUE_TRIM_DURATION, then
+ * destroy the oldest buffer (currently in best) and recursively call
+ * ourself to get the next oldest.
+ */
+ if (best && (p->unused_duration > QUEUE_TRIM_DURATION))
+ {
+ p->unused_duration = 0;
+ p->buffers = eina_list_remove(p->buffers, best);
+ ecore_wl2_buffer_destroy(best);
+ best = _evas_dmabuf_surface_wait(s, p);
+ }
+
+ if (!best && (eina_list_count(p->buffers) < MAX_BUFFERS))
+ {
+ best = ecore_wl2_surface_buffer_create(s);
+ /* Start at -1 so it's age is incremented to 0 for first draw */
+ ecore_wl2_buffer_age_set(best, -1);
+ p->buffers = eina_list_append(p->buffers, best);
+ }
+ return best;
+}
+
+static int
+_evas_dmabuf_surface_assign(Ecore_Wl2_Surface *s, void *priv_data)
+{
+ Ecore_Wl2_Dmabuf_Private *p;
+ Ecore_Wl2_Buffer *b;
+ Eina_List *l;
+
+ p = priv_data;
+ p->current = _evas_dmabuf_surface_wait(s, p);
+ if (!p->current)
+ {
+ /* Should be unreachable and will result in graphical
+ * anomalies - we should probably blow away all the
+ * existing buffers and start over if we actually
+ * see this happen...
+ */
+// WRN("No free DMAbuf buffers, dropping a frame");
+ EINA_LIST_FOREACH(p->buffers, l, b)
+ ecore_wl2_buffer_age_set(b, 0);
+ return 0;
+ }
+ EINA_LIST_FOREACH(p->buffers, l, b)
+ ecore_wl2_buffer_age_inc(b);
+
+ return ecore_wl2_buffer_age_get(p->current);
+}
+
+static void
+_evas_dmabuf_surface_post(Ecore_Wl2_Surface *s, void *priv_data, Eina_Rectangle *rects, unsigned int count)
+{
+ Ecore_Wl2_Dmabuf_Private *p;
+ Ecore_Wl2_Buffer *b;
+ Ecore_Wl2_Window *win;
+ struct wl_buffer *wlb;
+
+ p = priv_data;
+
+ b = p->current;
+ if (!b) return;
+
+ ecore_wl2_buffer_unlock(b);
+
+ p->current = NULL;
+ ecore_wl2_buffer_busy_set(b);
+ ecore_wl2_buffer_age_set(b, 0);
+
+ win = ecore_wl2_surface_window_get(s);
+
+ wlb = ecore_wl2_buffer_wl_buffer_get(b);
+ ecore_wl2_window_buffer_attach(win, wlb, 0, 0, EINA_FALSE);
+ ecore_wl2_window_damage(win, rects, count);
+
+ ecore_wl2_window_commit(win, EINA_TRUE);
+}
+
+static void
+_evas_dmabuf_surface_destroy(Ecore_Wl2_Surface *s EINA_UNUSED, void *priv_data)
+{
+ Ecore_Wl2_Dmabuf_Private *p;
+ Ecore_Wl2_Buffer *b;
+
+ p = priv_data;
+
+ EINA_LIST_FREE(p->buffers, b)
+ ecore_wl2_buffer_destroy(b);
+
+ free(p);
+}
+
+static void
+_evas_dmabuf_surface_flush(Ecore_Wl2_Surface *surface EINA_UNUSED, void *priv_data, Eina_Bool purge)
+{
+ Ecore_Wl2_Dmabuf_Private *p;
+ Ecore_Wl2_Buffer *b;
+
+ p = priv_data;
+
+ EINA_LIST_FREE(p->buffers, b)
+ {
+ if (purge || !ecore_wl2_buffer_busy_get(b))
+ {
+ if (p->current == b)
+ p->current = NULL;
+ ecore_wl2_buffer_destroy(b);
+ }
+ }
+}
+
+static Ecore_Wl2_Surface_Interface dmabuf_smanager =
+{
+ .version = 1,
+ .setup = _evas_dmabuf_surface_setup,
+ .destroy = _evas_dmabuf_surface_destroy,
+ .reconfigure = _evas_dmabuf_surface_reconfigure,
+ .data_get = _evas_dmabuf_surface_data_get,
+ .assign = _evas_dmabuf_surface_assign,
+ .post = _evas_dmabuf_surface_post,
+ .flush = _evas_dmabuf_surface_flush
+};
+
+Eina_Bool
+ecore_wl2_surface_module_dmabuf_init(void)
+{
+ ECORE_WL2_SURFACE_DMABUF = ecore_wl2_surface_manager_add(&dmabuf_smanager);
+
+ if (ECORE_WL2_SURFACE_DMABUF < 1)
+ return EINA_FALSE;
+
+ return EINA_TRUE;
+}
+
+void
+ecore_wl2_surface_module_dmabuf_shutdown(void)
+{
+ ecore_wl2_surface_manager_del(&dmabuf_smanager);
+}
+
+EINA_MODULE_INIT(ecore_wl2_surface_module_dmabuf_init);
+EINA_MODULE_SHUTDOWN(ecore_wl2_surface_module_dmabuf_shutdown);
+
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c
index 231e48f6cb..b1366291bc 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -5,9 +5,20 @@
#include "ecore_wl2_private.h"
#include "efl-hints-client-protocol.h"
+static void _ecore_wl2_window_hide_send(Ecore_Wl2_Window *window);
+
void
_ecore_wl2_window_semi_free(Ecore_Wl2_Window *window)
{
+ if (window->xdg_popup) xdg_popup_destroy(window->xdg_popup);
+ window->xdg_popup = NULL;
+
+ if (window->xdg_toplevel) xdg_toplevel_destroy(window->xdg_toplevel);
+ window->xdg_toplevel = NULL;
+
+ if (window->xdg_surface) xdg_surface_destroy(window->xdg_surface);
+ window->xdg_surface = NULL;
+
if (window->zxdg_popup) zxdg_popup_v6_destroy(window->zxdg_popup);
window->zxdg_popup = NULL;
@@ -24,6 +35,15 @@ _ecore_wl2_window_semi_free(Ecore_Wl2_Window *window)
if (window->surface) wl_surface_destroy(window->surface);
window->surface = NULL;
window->surface_id = -1;
+
+ if (window->callback) wl_callback_destroy(window->callback);
+ window->callback = NULL;
+
+ window->outputs = eina_list_free(window->outputs);
+
+ ecore_wl2_window_surface_flush(window, EINA_TRUE);
+
+ window->commit_pending = EINA_FALSE;
}
static void
@@ -34,10 +54,10 @@ _ecore_wl2_window_activate_send(Ecore_Wl2_Window *window)
ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Activate));
if (!ev) return;
- ev->win = window->id;
+ ev->win = window;
if (window->parent)
- ev->parent_win = window->parent->id;
- ev->event_win = window->id;
+ ev->parent_win = window->parent;
+ ev->event_win = window;
ecore_event_add(ECORE_WL2_EVENT_WINDOW_ACTIVATE, ev, NULL, NULL);
}
@@ -49,10 +69,10 @@ _ecore_wl2_window_deactivate_send(Ecore_Wl2_Window *window)
ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Deactivate));
if (!ev) return;
- ev->win = window->id;
+ ev->win = window;
if (window->parent)
- ev->parent_win = window->parent->id;
- ev->event_win = window->id;
+ ev->parent_win = window->parent;
+ ev->event_win = window;
ecore_event_add(ECORE_WL2_EVENT_WINDOW_DEACTIVATE, ev, NULL, NULL);
}
@@ -64,8 +84,8 @@ _ecore_wl2_window_configure_send(Ecore_Wl2_Window *win)
ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Configure));
if (!ev) return;
- ev->win = win->id;
- ev->event_win = win->id;
+ ev->win = win;
+ ev->event_win = win;
if ((win->set_config.geometry.w == win->def_config.geometry.w) &&
(win->set_config.geometry.h == win->def_config.geometry.h))
@@ -104,13 +124,79 @@ _configure_complete(Ecore_Wl2_Window *window)
ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Configure_Complete));
if (!ev) return;
- ev->win = window->id;
+ ev->win = window;
ecore_event_add(ECORE_WL2_EVENT_WINDOW_CONFIGURE_COMPLETE, ev, NULL, NULL);
}
+#include "window_v6.x"
+
+static void
+_www_surface_end_drag(void *data, struct www_surface *www_surface EINA_UNUSED)
+{
+ Ecore_Wl2_Window *window = data;
+ Ecore_Wl2_Event_Window_WWW_Drag *ev;
+
+ ev = malloc(sizeof(Ecore_Wl2_Event_Window_WWW_Drag));
+ EINA_SAFETY_ON_NULL_RETURN(ev);
+ ev->window = window;
+ ev->dragging = 0;
+
+ ecore_event_add(_ecore_wl2_event_window_www_drag, ev, NULL, NULL);
+}
+
+static void
+_www_surface_start_drag(void *data, struct www_surface *www_surface EINA_UNUSED)
+{
+ Ecore_Wl2_Window *window = data;
+ Ecore_Wl2_Event_Window_WWW_Drag *ev;
+
+ ev = malloc(sizeof(Ecore_Wl2_Event_Window_WWW_Drag));
+ EINA_SAFETY_ON_NULL_RETURN(ev);
+ ev->window = window;
+ ev->dragging = 1;
+
+ ecore_event_add(_ecore_wl2_event_window_www_drag, ev, NULL, NULL);
+}
+
+static void
+_www_surface_status(void *data, struct www_surface *www_surface EINA_UNUSED, int32_t x_rel, int32_t y_rel, uint32_t timestamp)
+{
+ Ecore_Wl2_Window *window = data;
+ Ecore_Wl2_Event_Window_WWW *ev;
+
+ ev = malloc(sizeof(Ecore_Wl2_Event_Window_WWW));
+ EINA_SAFETY_ON_NULL_RETURN(ev);
+ ev->window = window;
+ ev->x_rel = x_rel;
+ ev->y_rel = y_rel;
+ ev->timestamp = timestamp;
+
+ ecore_event_add(_ecore_wl2_event_window_www, ev, NULL, NULL);
+}
+
+static struct www_surface_listener _www_surface_listener =
+{
+ .status = _www_surface_status,
+ .start_drag = _www_surface_start_drag,
+ .end_drag = _www_surface_end_drag,
+};
+
+void
+_ecore_wl2_window_www_surface_init(Ecore_Wl2_Window *window)
+{
+ if (!window->surface) return;
+ if (!window->display->wl.www) return;
+ if (window->www_surface) return;
+ window->www_surface = www_create(window->display->wl.www, window->surface);
+ www_surface_set_user_data(window->www_surface, window);
+ www_surface_add_listener(window->www_surface, &_www_surface_listener,
+ window);
+}
+
+
static void
-_zxdg_surface_cb_configure(void *data, struct zxdg_surface_v6 *zxdg_surface EINA_UNUSED, uint32_t serial)
+_xdg_surface_cb_configure(void *data, struct xdg_surface *xdg_surface EINA_UNUSED, uint32_t serial)
{
Ecore_Wl2_Window *window;
@@ -121,27 +207,28 @@ _zxdg_surface_cb_configure(void *data, struct zxdg_surface_v6 *zxdg_surface EINA
{
window->saved.w = window->set_config.geometry.w;
window->saved.h = window->set_config.geometry.h;
- _configure_complete(window);
}
if (window->pending.configure && window->updating)
ERR("Window shouldn't be rendering before initial configure");
if (!window->updating)
_ecore_wl2_window_configure_send(window);
+
+ if (window->pending.configure)
+ _configure_complete(window);
}
-static const struct zxdg_surface_v6_listener _zxdg_surface_listener =
+static const struct xdg_surface_listener _xdg_surface_listener =
{
- _zxdg_surface_cb_configure,
+ _xdg_surface_cb_configure,
};
static void
-_zxdg_toplevel_cb_configure(void *data, struct zxdg_toplevel_v6 *zxdg_toplevel EINA_UNUSED, int32_t width, int32_t height, struct wl_array *states)
+_xdg_toplevel_cb_configure(void *data, struct xdg_toplevel *xdg_toplevel EINA_UNUSED, int32_t width, int32_t height, struct wl_array *states)
{
Ecore_Wl2_Window *win = data;
uint32_t *s;
- win->def_config.minimized = EINA_FALSE;
win->def_config.maximized = EINA_FALSE;
win->def_config.fullscreen = EINA_FALSE;
win->def_config.focused = EINA_FALSE;
@@ -164,7 +251,6 @@ _zxdg_toplevel_cb_configure(void *data, struct zxdg_toplevel_v6 *zxdg_toplevel E
break;
case ZXDG_TOPLEVEL_V6_STATE_ACTIVATED:
win->def_config.focused = EINA_TRUE;
- win->def_config.minimized = EINA_FALSE;
default:
break;
}
@@ -172,7 +258,7 @@ _zxdg_toplevel_cb_configure(void *data, struct zxdg_toplevel_v6 *zxdg_toplevel E
}
static void
-_zxdg_toplevel_cb_close(void *data, struct zxdg_toplevel_v6 *zxdg_toplevel EINA_UNUSED)
+_xdg_toplevel_cb_close(void *data, struct xdg_toplevel *xdg_toplevel EINA_UNUSED)
{
Ecore_Wl2_Window *win;
@@ -182,14 +268,14 @@ _zxdg_toplevel_cb_close(void *data, struct zxdg_toplevel_v6 *zxdg_toplevel EINA_
ecore_wl2_window_free(win);
}
-static const struct zxdg_toplevel_v6_listener _zxdg_toplevel_listener =
+static const struct xdg_toplevel_listener _xdg_toplevel_listener =
{
- _zxdg_toplevel_cb_configure,
- _zxdg_toplevel_cb_close,
+ _xdg_toplevel_cb_configure,
+ _xdg_toplevel_cb_close,
};
static void
-_zxdg_popup_cb_configure(void *data, struct zxdg_popup_v6 *zxdg_popup EINA_UNUSED, int32_t x EINA_UNUSED, int32_t y EINA_UNUSED, int32_t width, int32_t height)
+_xdg_popup_cb_configure(void *data, struct xdg_popup *xdg_popup EINA_UNUSED, int32_t x EINA_UNUSED, int32_t y EINA_UNUSED, int32_t width, int32_t height)
{
Ecore_Wl2_Window *win = data;
win->def_config.geometry.w = width;
@@ -197,7 +283,7 @@ _zxdg_popup_cb_configure(void *data, struct zxdg_popup_v6 *zxdg_popup EINA_UNUSE
}
static void
-_zxdg_popup_cb_done(void *data, struct zxdg_popup_v6 *zxdg_popup EINA_UNUSED)
+_xdg_popup_cb_done(void *data, struct xdg_popup *xdg_popup EINA_UNUSED)
{
Ecore_Wl2_Window *win;
@@ -205,42 +291,43 @@ _zxdg_popup_cb_done(void *data, struct zxdg_popup_v6 *zxdg_popup EINA_UNUSED)
if (!win) return;
if (win->grab) _ecore_wl2_input_ungrab(win->grab);
+
+ _ecore_wl2_window_hide_send(win);
}
-static const struct zxdg_popup_v6_listener _zxdg_popup_listener =
+static const struct xdg_popup_listener _xdg_popup_listener =
{
- _zxdg_popup_cb_configure,
- _zxdg_popup_cb_done,
+ _xdg_popup_cb_configure,
+ _xdg_popup_cb_done,
};
static void
-_ecore_wl2_window_zxdg_popup_create(Ecore_Wl2_Window *win)
+_ecore_wl2_window_xdg_popup_create(Ecore_Wl2_Window *win)
{
- struct zxdg_positioner_v6 *pos;
+ struct xdg_positioner *pos;
EINA_SAFETY_ON_NULL_RETURN(win->parent);
- pos = zxdg_shell_v6_create_positioner(win->display->wl.zxdg_shell);
+ pos = xdg_wm_base_create_positioner(win->display->wl.xdg_wm_base);
if (!pos) return;
- zxdg_positioner_v6_set_anchor_rect(pos, win->set_config.geometry.x,
+ xdg_positioner_set_anchor_rect(pos, win->set_config.geometry.x,
win->set_config.geometry.y,
1, 1);
- zxdg_positioner_v6_set_size(pos, win->set_config.geometry.w,
+ xdg_positioner_set_size(pos, win->set_config.geometry.w,
win->set_config.geometry.h);
- zxdg_positioner_v6_set_anchor(pos, ZXDG_POSITIONER_V6_ANCHOR_TOP |
- ZXDG_POSITIONER_V6_ANCHOR_LEFT);
- zxdg_positioner_v6_set_gravity(pos, ZXDG_POSITIONER_V6_ANCHOR_BOTTOM |
+ xdg_positioner_set_anchor(pos, XDG_POSITIONER_ANCHOR_TOP_LEFT);
+ xdg_positioner_set_gravity(pos, ZXDG_POSITIONER_V6_ANCHOR_BOTTOM |
ZXDG_POSITIONER_V6_ANCHOR_RIGHT);
- win->zxdg_popup = zxdg_surface_v6_get_popup(win->zxdg_surface,
- win->parent->zxdg_surface, pos);
+ win->xdg_popup = xdg_surface_get_popup(win->xdg_surface,
+ win->parent->xdg_surface, pos);
- zxdg_positioner_v6_destroy(pos);
+ xdg_positioner_destroy(pos);
if (win->grab)
- zxdg_popup_v6_grab(win->zxdg_popup, win->grab->wl.seat,
+ xdg_popup_grab(win->xdg_popup, win->grab->wl.seat,
wl_display_get_serial(win->display->wl.display));
- zxdg_popup_v6_set_user_data(win->zxdg_popup, win);
- zxdg_popup_v6_add_listener(win->zxdg_popup, &_zxdg_popup_listener, win);
+ xdg_popup_set_user_data(win->xdg_popup, win);
+ xdg_popup_add_listener(win->xdg_popup, &_xdg_popup_listener, win);
win->pending.configure = EINA_TRUE;
@@ -248,128 +335,74 @@ _ecore_wl2_window_zxdg_popup_create(Ecore_Wl2_Window *win)
}
static void
-_www_surface_end_drag(void *data, struct www_surface *www_surface EINA_UNUSED)
-{
- Ecore_Wl2_Window *window = data;
- Ecore_Wl2_Event_Window_WWW_Drag *ev;
+_window_shell_surface_create(Ecore_Wl2_Window *window)
+{
+ if (window->xdg_surface) return;
+ window->xdg_surface =
+ xdg_wm_base_get_xdg_surface(window->display->wl.xdg_wm_base,
+ window->surface);
+ xdg_surface_set_user_data(window->xdg_surface, window);
+ xdg_surface_add_listener(window->xdg_surface,
+ &_xdg_surface_listener, window);
+
+ window->xdg_configure_ack = xdg_surface_ack_configure;
+ window->pending.configure = EINA_TRUE;
+ if (window->display->wl.efl_hints)
+ {
+ if (window->aspect.set)
+ efl_hints_set_aspect(window->display->wl.efl_hints, window->xdg_surface,
+ window->aspect.w, window->aspect.h, window->aspect.aspect);
+ if (window->weight.set)
+ efl_hints_set_weight(window->display->wl.efl_hints, window->xdg_surface,
+ window->weight.w, window->weight.h);
+ }
- ev = malloc(sizeof(Ecore_Wl2_Event_Window_WWW_Drag));
- EINA_SAFETY_ON_NULL_RETURN(ev);
- ev->window = window->id;
- ev->dragging = 0;
+ if (window->type == ECORE_WL2_WINDOW_TYPE_MENU)
+ _ecore_wl2_window_xdg_popup_create(window);
+ else
+ {
+ struct xdg_toplevel *ptop = NULL;
- ecore_event_add(_ecore_wl2_event_window_www_drag, ev, NULL, NULL);
-}
+ window->xdg_toplevel =
+ xdg_surface_get_toplevel(window->xdg_surface);
+ xdg_toplevel_set_user_data(window->xdg_toplevel, window);
+ xdg_toplevel_add_listener(window->xdg_toplevel,
+ &_xdg_toplevel_listener, window);
-static void
-_www_surface_start_drag(void *data, struct www_surface *www_surface EINA_UNUSED)
-{
- Ecore_Wl2_Window *window = data;
- Ecore_Wl2_Event_Window_WWW_Drag *ev;
+ if (window->deferred_minimize)
+ xdg_toplevel_set_minimized(window->xdg_toplevel);
+ window->deferred_minimize = EINA_FALSE;
- ev = malloc(sizeof(Ecore_Wl2_Event_Window_WWW_Drag));
- EINA_SAFETY_ON_NULL_RETURN(ev);
- ev->window = window->id;
- ev->dragging = 1;
+ if (window->title)
+ xdg_toplevel_set_title(window->xdg_toplevel, window->title);
+ if (window->class)
+ xdg_toplevel_set_app_id(window->xdg_toplevel, window->class);
- ecore_event_add(_ecore_wl2_event_window_www_drag, ev, NULL, NULL);
-}
+ window->xdg_set_min_size = xdg_toplevel_set_min_size;
+ window->xdg_set_max_size = xdg_toplevel_set_max_size;
-static void
-_www_surface_status(void *data, struct www_surface *www_surface EINA_UNUSED, int32_t x_rel, int32_t y_rel, uint32_t timestamp)
-{
- Ecore_Wl2_Window *window = data;
- Ecore_Wl2_Event_Window_WWW *ev;
+ if (window->parent)
+ ptop = window->parent->xdg_toplevel;
- ev = malloc(sizeof(Ecore_Wl2_Event_Window_WWW));
- EINA_SAFETY_ON_NULL_RETURN(ev);
- ev->window = window->id;
- ev->x_rel = x_rel;
- ev->y_rel = y_rel;
- ev->timestamp = timestamp;
+ if (ptop)
+ xdg_toplevel_set_parent(window->xdg_toplevel, ptop);
- ecore_event_add(_ecore_wl2_event_window_www, ev, NULL, NULL);
-}
+ if (window->set_config.maximized)
+ xdg_toplevel_set_maximized(window->xdg_toplevel);
-static struct www_surface_listener _www_surface_listener =
-{
- .status = _www_surface_status,
- .start_drag = _www_surface_start_drag,
- .end_drag = _www_surface_end_drag,
-};
+ if (window->set_config.fullscreen)
+ xdg_toplevel_set_fullscreen(window->xdg_toplevel, NULL);
+ }
-void
-_ecore_wl2_window_www_surface_init(Ecore_Wl2_Window *window)
-{
- if (!window->surface) return;
- if (!window->display->wl.www) return;
- if (window->www_surface) return;
- window->www_surface = www_create(window->display->wl.www, window->surface);
- www_surface_set_user_data(window->www_surface, window);
- www_surface_add_listener(window->www_surface, &_www_surface_listener,
- window);
+ ecore_wl2_window_commit(window, EINA_TRUE);
}
void
_ecore_wl2_window_shell_surface_init(Ecore_Wl2_Window *window)
{
if (!window->surface) return;
- if ((window->display->wl.zxdg_shell) && (!window->zxdg_surface))
- {
- window->zxdg_surface =
- zxdg_shell_v6_get_xdg_surface(window->display->wl.zxdg_shell,
- window->surface);
- zxdg_surface_v6_set_user_data(window->zxdg_surface, window);
- zxdg_surface_v6_add_listener(window->zxdg_surface,
- &_zxdg_surface_listener, window);
-
- window->zxdg_configure_ack = zxdg_surface_v6_ack_configure;
- window->pending.configure = EINA_TRUE;
- if (window->display->wl.efl_hints)
- {
- if (window->aspect.set)
- efl_hints_set_aspect(window->display->wl.efl_hints, window->zxdg_surface,
- window->aspect.w, window->aspect.h, window->aspect.aspect);
- if (window->weight.set)
- efl_hints_set_weight(window->display->wl.efl_hints, window->zxdg_surface,
- window->weight.w, window->weight.h);
- }
-
- if (window->type == ECORE_WL2_WINDOW_TYPE_MENU)
- _ecore_wl2_window_zxdg_popup_create(window);
- else
- {
- struct zxdg_toplevel_v6 *ptop = NULL;
-
- window->zxdg_toplevel =
- zxdg_surface_v6_get_toplevel(window->zxdg_surface);
- zxdg_toplevel_v6_set_user_data(window->zxdg_toplevel, window);
- zxdg_toplevel_v6_add_listener(window->zxdg_toplevel,
- &_zxdg_toplevel_listener, window);
-
- if (window->title)
- zxdg_toplevel_v6_set_title(window->zxdg_toplevel, window->title);
- if (window->class)
- zxdg_toplevel_v6_set_app_id(window->zxdg_toplevel, window->class);
-
- window->zxdg_set_min_size = zxdg_toplevel_v6_set_min_size;
- window->zxdg_set_max_size = zxdg_toplevel_v6_set_max_size;
-
- if (window->parent)
- ptop = window->parent->zxdg_toplevel;
-
- if (ptop)
- zxdg_toplevel_v6_set_parent(window->zxdg_toplevel, ptop);
-
- if (window->set_config.maximized)
- zxdg_toplevel_v6_set_maximized(window->zxdg_toplevel);
-
- if (window->set_config.fullscreen)
- zxdg_toplevel_v6_set_fullscreen(window->zxdg_toplevel, NULL);
- }
-
- ecore_wl2_window_commit(window, EINA_TRUE);
- }
+ if (window->display->wl.xdg_wm_base) _window_shell_surface_create(window);
+ if (window->display->wl.zxdg_shell) _window_v6_shell_surface_create(window);
if (window->display->wl.session_recovery)
{
@@ -377,6 +410,12 @@ _ecore_wl2_window_shell_surface_init(Ecore_Wl2_Window *window)
{
zwp_e_session_recovery_set_uuid(window->display->wl.session_recovery,
window->surface, window->uuid);
+ if (window->xdg_surface)
+ xdg_surface_set_window_geometry(window->xdg_surface,
+ window->set_config.geometry.x,
+ window->set_config.geometry.y,
+ window->set_config.geometry.w,
+ window->set_config.geometry.h);
if (window->zxdg_surface)
zxdg_surface_v6_set_window_geometry(window->zxdg_surface,
window->set_config.geometry.x,
@@ -395,6 +434,49 @@ _ecore_wl2_window_shell_surface_init(Ecore_Wl2_Window *window)
}
}
+static void
+_surface_enter(void *data, struct wl_surface *surf EINA_UNUSED, struct wl_output *op)
+{
+ Ecore_Wl2_Window *win;
+ Ecore_Wl2_Output *output;
+
+ win = data;
+
+ output = _ecore_wl2_output_find(win->display, op);
+ EINA_SAFETY_ON_NULL_RETURN(output);
+
+ win->outputs = eina_list_append(win->outputs, output);
+}
+
+static void
+_surface_leave(void *data, struct wl_surface *surf EINA_UNUSED, struct wl_output *op)
+{
+ Ecore_Wl2_Window *win;
+ Ecore_Wl2_Output *output;
+
+ win = data;
+ output = _ecore_wl2_output_find(win->display, op);
+ EINA_SAFETY_ON_NULL_RETURN(output);
+
+ win->outputs = eina_list_remove(win->outputs, output);
+ if (!win->outputs)
+ {
+ Ecore_Wl2_Event_Window_Offscreen *ev;
+ ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Offscreen));
+ if (ev)
+ {
+ ev->win = win;
+ ecore_event_add(ECORE_WL2_EVENT_WINDOW_OFFSCREEN, ev, NULL, NULL);
+ }
+ }
+}
+
+static const struct wl_surface_listener _surface_listener =
+{
+ _surface_enter,
+ _surface_leave,
+};
+
void
_ecore_wl2_window_surface_create(Ecore_Wl2_Window *window)
{
@@ -413,6 +495,8 @@ _ecore_wl2_window_surface_create(Ecore_Wl2_Window *window)
window->surface_id =
wl_proxy_get_id((struct wl_proxy *)window->surface);
+
+ wl_surface_add_listener(window->surface, &_surface_listener, window);
if (window->display->wl.efl_aux_hints)
{
efl_aux_hints_get_supported_aux_hints(window->display->wl.efl_aux_hints, window->surface);
@@ -430,10 +514,10 @@ _ecore_wl2_window_show_send(Ecore_Wl2_Window *window)
ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Show));
if (!ev) return;
- ev->win = window->id;
+ ev->win = window;
if (window->parent)
- ev->parent_win = window->parent->id;
- ev->event_win = window->id;
+ ev->parent_win = window->parent;
+ ev->event_win = window;
ecore_event_add(ECORE_WL2_EVENT_WINDOW_SHOW, ev, NULL, NULL);
}
@@ -445,10 +529,10 @@ _ecore_wl2_window_hide_send(Ecore_Wl2_Window *window)
ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Hide));
if (!ev) return;
- ev->win = window->id;
+ ev->win = window;
if (window->parent)
- ev->parent_win = window->parent->id;
- ev->event_win = window->id;
+ ev->parent_win = window->parent;
+ ev->event_win = window;
ecore_event_add(ECORE_WL2_EVENT_WINDOW_HIDE, ev, NULL, NULL);
}
@@ -456,7 +540,6 @@ EAPI Ecore_Wl2_Window *
ecore_wl2_window_new(Ecore_Wl2_Display *display, Ecore_Wl2_Window *parent, int x, int y, int w, int h)
{
Ecore_Wl2_Window *win;
- static int _win_id = 1;
EINA_SAFETY_ON_NULL_RETURN_VAL(display, NULL);
if (display->pid) CRI("CANNOT CREATE WINDOW WITH SERVER DISPLAY");
@@ -468,7 +551,6 @@ ecore_wl2_window_new(Ecore_Wl2_Display *display, Ecore_Wl2_Window *parent, int x
win->display = display;
win->parent = parent;
- win->id = _win_id++;
win->set_config.geometry.x = x;
win->set_config.geometry.y = y;
@@ -489,13 +571,6 @@ ecore_wl2_window_new(Ecore_Wl2_Display *display, Ecore_Wl2_Window *parent, int x
return win;
}
-EAPI int
-ecore_wl2_window_id_get(Ecore_Wl2_Window *window)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(window, -1);
- return window->id;
-}
-
EAPI struct wl_surface *
ecore_wl2_window_surface_get(Ecore_Wl2_Window *window)
{
@@ -554,6 +629,19 @@ ecore_wl2_window_hide(Ecore_Wl2_Window *window)
EINA_INLIST_FOREACH_SAFE(window->subsurfs, tmp, subsurf)
_ecore_wl2_subsurf_unmap(subsurf);
+ if (window->commit_pending)
+ {
+ /* We've probably been hidden while an animator
+ * is ticking. Cancel the callback.
+ */
+ window->commit_pending = EINA_FALSE;
+ if (window->callback)
+ {
+ wl_callback_destroy(window->callback);
+ window->callback = NULL;
+ }
+ }
+
if (window->surface)
{
wl_surface_attach(window->surface, NULL, 0, 0);
@@ -561,6 +649,7 @@ ecore_wl2_window_hide(Ecore_Wl2_Window *window)
window->commit_pending = EINA_FALSE;
}
+ /* The commit added a callback, disconnect it */
if (window->callback)
{
wl_callback_destroy(window->callback);
@@ -571,6 +660,9 @@ ecore_wl2_window_hide(Ecore_Wl2_Window *window)
window->req_config.serial = 0;
window->def_config.serial = 0;
window->zxdg_configure_ack = NULL;
+ window->xdg_configure_ack = NULL;
+ window->xdg_set_min_size = NULL;
+ window->xdg_set_max_size = NULL;
window->zxdg_set_min_size = NULL;
window->zxdg_set_max_size = NULL;
}
@@ -633,13 +725,19 @@ ecore_wl2_window_move(Ecore_Wl2_Window *window, Ecore_Wl2_Input *input)
EINA_SAFETY_ON_NULL_RETURN(window->display->inputs);
if (!input)
- input = EINA_INLIST_CONTAINER_GET(window->display->inputs, Ecore_Wl2_Input);
-
- window->moving = EINA_TRUE;
-
+ {
+ ERR("NULL input parameter is deprecated");
+ input = EINA_INLIST_CONTAINER_GET(window->display->inputs, Ecore_Wl2_Input);
+ }
+ if (window->xdg_toplevel)
+ xdg_toplevel_move(window->xdg_toplevel, input->wl.seat,
+ window->display->serial);
if (window->zxdg_toplevel)
zxdg_toplevel_v6_move(window->zxdg_toplevel, input->wl.seat,
window->display->serial);
+ ecore_wl2_display_flush(window->display);
+
+ _ecore_wl2_input_ungrab(input);
}
EAPI void
@@ -649,31 +747,20 @@ ecore_wl2_window_resize(Ecore_Wl2_Window *window, Ecore_Wl2_Input *input, int lo
EINA_SAFETY_ON_NULL_RETURN(window->display->inputs);
if (!input)
- input = EINA_INLIST_CONTAINER_GET(window->display->inputs, Ecore_Wl2_Input);
+ {
+ ERR("NULL input parameter is deprecated");
+ input = EINA_INLIST_CONTAINER_GET(window->display->inputs, Ecore_Wl2_Input);
+ }
+ if (window->xdg_toplevel)
+ xdg_toplevel_resize(window->xdg_toplevel, input->wl.seat,
+ window->display->serial, location);
if (window->zxdg_toplevel)
zxdg_toplevel_v6_resize(window->zxdg_toplevel, input->wl.seat,
window->display->serial, location);
-}
-
-EAPI void
-ecore_wl2_window_raise(Ecore_Wl2_Window *window)
-{
- EINA_SAFETY_ON_NULL_RETURN(window);
+ ecore_wl2_display_flush(window->display);
- if (window->zxdg_toplevel)
- {
- struct wl_array states;
- uint32_t *s;
-
- wl_array_init(&states);
- s = wl_array_add(&states, sizeof(*s));
- *s = ZXDG_TOPLEVEL_V6_STATE_ACTIVATED;
- _zxdg_toplevel_cb_configure(window, window->zxdg_toplevel,
- window->set_config.geometry.w,
- window->set_config.geometry.h, &states);
- wl_array_release(&states);
- }
+ _ecore_wl2_input_ungrab(input);
}
EAPI Eina_Bool
@@ -687,35 +774,16 @@ ecore_wl2_window_alpha_get(Ecore_Wl2_Window *window)
EAPI void
ecore_wl2_window_alpha_set(Ecore_Wl2_Window *window, Eina_Bool alpha)
{
+ Ecore_Wl2_Surface *surf;
+
EINA_SAFETY_ON_NULL_RETURN(window);
if (window->alpha == alpha) return;
window->alpha = alpha;
-
- if (!window->alpha)
- ecore_wl2_window_opaque_region_set(window, window->opaque.x,
- window->opaque.y, window->opaque.w,
- window->opaque.h);
- else
- ecore_wl2_window_opaque_region_set(window, 0, 0, 0, 0);
-}
-
-EAPI void
-ecore_wl2_window_transparent_set(Ecore_Wl2_Window *window, Eina_Bool transparent)
-{
- EINA_SAFETY_ON_NULL_RETURN(window);
-
- if (window->transparent == transparent) return;
-
- window->transparent = transparent;
-
- if (!window->transparent)
- ecore_wl2_window_opaque_region_set(window, window->opaque.x,
- window->opaque.y, window->opaque.w,
- window->opaque.h);
- else
- ecore_wl2_window_opaque_region_set(window, 0, 0, 0, 0);
+ surf = window->wl2_surface;
+ if (surf)
+ ecore_wl2_surface_reconfigure(surf, surf->w, surf->h, 0, alpha);
}
EAPI void
@@ -847,11 +915,15 @@ ecore_wl2_window_maximized_set(Ecore_Wl2_Window *window, Eina_Bool maximized)
if (!window->set_config.fullscreen)
window->saved = window->set_config.geometry;
+ if (window->xdg_toplevel)
+ xdg_toplevel_set_maximized(window->xdg_toplevel);
if (window->zxdg_toplevel)
zxdg_toplevel_v6_set_maximized(window->zxdg_toplevel);
}
else
{
+ if (window->xdg_toplevel)
+ xdg_toplevel_unset_maximized(window->xdg_toplevel);
if (window->zxdg_toplevel)
zxdg_toplevel_v6_unset_maximized(window->zxdg_toplevel);
}
@@ -889,11 +961,15 @@ ecore_wl2_window_fullscreen_set(Ecore_Wl2_Window *window, Eina_Bool fullscreen)
if (!window->set_config.maximized)
window->saved = window->set_config.geometry;
+ if (window->xdg_toplevel)
+ xdg_toplevel_set_fullscreen(window->xdg_toplevel, NULL);
if (window->zxdg_toplevel)
zxdg_toplevel_v6_set_fullscreen(window->zxdg_toplevel, NULL);
}
else
{
+ if (window->xdg_toplevel)
+ xdg_toplevel_unset_fullscreen(window->xdg_toplevel);
if (window->zxdg_toplevel)
zxdg_toplevel_v6_unset_fullscreen(window->zxdg_toplevel);
}
@@ -923,9 +999,13 @@ ecore_wl2_window_title_set(Ecore_Wl2_Window *window, const char *title)
eina_stringshare_replace(&window->title, title);
if (!window->title) return;
+ if (!window->xdg_toplevel && !window->xdg_toplevel) return;
+ if (window->xdg_toplevel)
+ xdg_toplevel_set_title(window->xdg_toplevel, window->title);
if (window->zxdg_toplevel)
zxdg_toplevel_v6_set_title(window->zxdg_toplevel, window->title);
+ ecore_wl2_display_flush(window->display);
}
EAPI void
@@ -935,9 +1015,13 @@ ecore_wl2_window_class_set(Ecore_Wl2_Window *window, const char *clas)
eina_stringshare_replace(&window->class, clas);
if (!window->class) return;
+ if (!window->xdg_toplevel && !window->xdg_toplevel) return;
+ if (window->xdg_toplevel)
+ xdg_toplevel_set_app_id(window->xdg_toplevel, window->class);
if (window->zxdg_toplevel)
zxdg_toplevel_v6_set_app_id(window->zxdg_toplevel, window->class);
+ ecore_wl2_display_flush(window->display);
}
EAPI void
@@ -969,34 +1053,42 @@ ecore_wl2_window_geometry_set(Ecore_Wl2_Window *window, int x, int y, int w, int
window->pending.geom = EINA_TRUE;
}
-EAPI Eina_Bool
-ecore_wl2_window_iconified_get(Ecore_Wl2_Window *window)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(window, EINA_FALSE);
-
- return window->set_config.minimized;
-}
-
EAPI void
ecore_wl2_window_iconified_set(Ecore_Wl2_Window *window, Eina_Bool iconified)
{
- Eina_Bool prev;
-
EINA_SAFETY_ON_NULL_RETURN(window);
- prev = window->set_config.minimized;
iconified = !!iconified;
- if (prev == iconified) return;
- window->set_config.minimized = iconified;
+ if (!window->xdg_toplevel && !window->zxdg_toplevel)
+ {
+ window->deferred_minimize = iconified;
+ return;
+ }
if (iconified)
{
+ if (window->xdg_toplevel)
+ xdg_toplevel_set_minimized(window->xdg_toplevel);
if (window->zxdg_toplevel)
zxdg_toplevel_v6_set_minimized(window->zxdg_toplevel);
+ ecore_wl2_display_flush(window->display);
}
else
{
+ if (window->xdg_toplevel)
+ {
+ struct wl_array states;
+ uint32_t *s;
+
+ wl_array_init(&states);
+ s = wl_array_add(&states, sizeof(*s));
+ *s = XDG_TOPLEVEL_STATE_ACTIVATED;
+ _xdg_toplevel_cb_configure(window, window->xdg_toplevel,
+ window->set_config.geometry.w,
+ window->set_config.geometry.h, &states);
+ wl_array_release(&states);
+ }
if (window->zxdg_toplevel)
{
struct wl_array states;
@@ -1044,7 +1136,7 @@ EAPI Eina_Bool
ecore_wl2_window_shell_surface_exists(Ecore_Wl2_Window *window)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(window, EINA_FALSE);
- return !!window->zxdg_surface;
+ return !!window->zxdg_surface || !!window->xdg_surface;
}
EAPI Eina_Bool
@@ -1057,42 +1149,9 @@ ecore_wl2_window_activated_get(const Ecore_Wl2_Window *window)
EAPI Ecore_Wl2_Output *
ecore_wl2_window_output_find(Ecore_Wl2_Window *window)
{
- Ecore_Wl2_Output *out;
- Eina_Inlist *tmp;
- int x = 0, y = 0;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(window, NULL);
- x = window->set_config.geometry.x;
- y = window->set_config.geometry.y;
-
- EINA_INLIST_FOREACH_SAFE(window->display->outputs, tmp, out)
- {
- int ox, oy, ow, oh;
-
- ox = out->geometry.x;
- oy = out->geometry.y;
-
- switch (out->transform)
- {
- case WL_OUTPUT_TRANSFORM_90:
- case WL_OUTPUT_TRANSFORM_270:
- case WL_OUTPUT_TRANSFORM_FLIPPED_90:
- case WL_OUTPUT_TRANSFORM_FLIPPED_270:
- ow = out->geometry.h;
- oh = out->geometry.w;
- break;
- default:
- ow = out->geometry.w;
- oh = out->geometry.h;
- break;
- }
-
- if (((x >= ox) && (x < ow)) && ((y >= oy) && (y < oh)))
- return out;
- }
-
- return NULL;
+ return eina_list_data_get(window->outputs);
}
EAPI void
@@ -1189,7 +1248,7 @@ ecore_wl2_window_rotation_change_prepare_send(Ecore_Wl2_Window *window, int rot,
ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Rotation_Change_Prepare));
if (!ev) return;
- ev->win = window->id;
+ ev->win = window;
ev->rotation = rot;
ev->w = w;
ev->h = h;
@@ -1208,7 +1267,7 @@ ecore_wl2_window_rotation_change_prepare_done_send(Ecore_Wl2_Window *window, int
ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Rotation_Change_Prepare_Done));
if (!ev) return;
- ev->win = window->id;
+ ev->win = window;
ev->rotation = rot;
ev->w = 0;
ev->h = 0;
@@ -1228,7 +1287,7 @@ ecore_wl2_window_rotation_change_request_send(Ecore_Wl2_Window *window, int rot)
ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Rotation_Change_Request));
if (!ev) return;
- ev->win = window->id;
+ ev->win = window;
ev->rotation = rot;
ev->w = 0;
ev->h = 0;
@@ -1248,7 +1307,7 @@ ecore_wl2_window_rotation_change_done_send(Ecore_Wl2_Window *window, int rot, in
ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Rotation_Change_Done));
if (!ev) return;
- ev->win = window->id;
+ ev->win = window;
ev->rotation = rot;
ev->w = w;
ev->h = h;
@@ -1281,24 +1340,30 @@ EAPI void
ecore_wl2_window_aux_hint_add(Ecore_Wl2_Window *win, int id, const char *hint, const char *val)
{
if (!win) return;
- if ((win->surface) && (win->display->wl.efl_aux_hints))
- efl_aux_hints_add_aux_hint(win->display->wl.efl_aux_hints, win->surface, id, hint, val);
+ if ((!win->surface) || (!win->display->wl.efl_aux_hints)) return;
+
+ efl_aux_hints_add_aux_hint(win->display->wl.efl_aux_hints, win->surface, id, hint, val);
+ ecore_wl2_display_flush(win->display);
}
EAPI void
ecore_wl2_window_aux_hint_change(Ecore_Wl2_Window *win, int id, const char *val)
{
if (!win) return;
- if ((win->surface) && (win->display->wl.efl_aux_hints))
- efl_aux_hints_change_aux_hint(win->display->wl.efl_aux_hints, win->surface, id, val);
+ if ((!win->surface) && (!win->display->wl.efl_aux_hints)) return;
+
+ efl_aux_hints_change_aux_hint(win->display->wl.efl_aux_hints, win->surface, id, val);
+ ecore_wl2_display_flush(win->display);
}
EAPI void
ecore_wl2_window_aux_hint_del(Ecore_Wl2_Window *win, int id)
{
if (!win) return;
- if ((win->surface) && (win->display->wl.efl_aux_hints))
- efl_aux_hints_del_aux_hint(win->display->wl.efl_aux_hints, win->surface, id);
+ if ((!win->surface) || (!win->display->wl.efl_aux_hints)) return;
+
+ efl_aux_hints_del_aux_hint(win->display->wl.efl_aux_hints, win->surface, id);
+ ecore_wl2_display_flush(win->display);
}
EAPI void
@@ -1352,9 +1417,10 @@ ecore_wl2_window_aspect_set(Ecore_Wl2_Window *window, int w, int h, unsigned int
window->aspect.aspect = aspect;
window->aspect.set = 1;
if (!window->display->wl.efl_hints) return;
- if (window->zxdg_surface)
+ if (window->xdg_surface)
efl_hints_set_aspect(window->display->wl.efl_hints,
- window->zxdg_surface, w, h, aspect);
+ window->xdg_surface, w, h, aspect);
+ ecore_wl2_display_flush(window->display);
}
EAPI void
@@ -1373,9 +1439,10 @@ ecore_wl2_window_weight_set(Ecore_Wl2_Window *window, double w, double h)
window->weight.h = hh;
window->weight.set = 1;
if (!window->display->wl.efl_hints) return;
- if (window->zxdg_surface)
+ if (window->xdg_surface)
efl_hints_set_weight(window->display->wl.efl_hints,
- window->zxdg_surface, ww, hh);
+ window->xdg_surface, ww, hh);
+ ecore_wl2_display_flush(window->display);
}
static void
@@ -1401,79 +1468,108 @@ static struct wl_callback_listener _frame_listener =
static void
_maximized_set(Ecore_Wl2_Window *window)
{
- EINA_SAFETY_ON_NULL_RETURN(window->zxdg_toplevel);
+ EINA_SAFETY_ON_FALSE_RETURN(window->zxdg_toplevel || window->xdg_toplevel);
if (window->set_config.maximized)
{
window->saved = window->set_config.geometry;
- zxdg_toplevel_v6_set_maximized(window->zxdg_toplevel);
+ if (window->xdg_toplevel)
+ xdg_toplevel_set_maximized(window->xdg_toplevel);
+ if (window->zxdg_toplevel)
+ zxdg_toplevel_v6_set_maximized(window->zxdg_toplevel);
}
else
- zxdg_toplevel_v6_unset_maximized(window->zxdg_toplevel);
+ {
+ if (window->xdg_toplevel)
+ xdg_toplevel_unset_maximized(window->xdg_toplevel);
+ if (window->zxdg_toplevel)
+ zxdg_toplevel_v6_unset_maximized(window->zxdg_toplevel);
+ }
}
static void
_fullscreen_set(Ecore_Wl2_Window *window)
{
- EINA_SAFETY_ON_NULL_RETURN(window->zxdg_toplevel);
+ EINA_SAFETY_ON_FALSE_RETURN(window->zxdg_toplevel || window->xdg_toplevel);
if (window->set_config.fullscreen)
{
window->saved = window->set_config.geometry;
- zxdg_toplevel_v6_set_fullscreen(window->zxdg_toplevel, NULL);
+ if (window->xdg_toplevel)
+ xdg_toplevel_set_fullscreen(window->xdg_toplevel, NULL);
+ if (window->zxdg_toplevel)
+ zxdg_toplevel_v6_set_fullscreen(window->zxdg_toplevel, NULL);
}
else
- zxdg_toplevel_v6_unset_fullscreen(window->zxdg_toplevel);
+ {
+ if (window->xdg_toplevel)
+ xdg_toplevel_unset_fullscreen(window->xdg_toplevel);
+ if (window->zxdg_toplevel)
+ zxdg_toplevel_v6_unset_fullscreen(window->zxdg_toplevel);
+ }
}
-static void
-_input_set(Ecore_Wl2_Window *window)
+static struct wl_region *
+_region_create(struct wl_compositor *comp, int x, int y, int w, int h)
{
- struct wl_region *region;
-
- if (window->type == ECORE_WL2_WINDOW_TYPE_DND) return;
+ struct wl_region *out;
- if (!window->input_set)
+ out = wl_compositor_create_region(comp);
+ if (!out)
{
- wl_surface_set_input_region(window->surface, NULL);
- return;
+ ERR("Failed to create region");
+ return NULL;
}
- region = wl_compositor_create_region(window->display->wl.compositor);
- if (!region)
- {
- ERR("Failed to create input region");
- return;
- }
+ wl_region_add(out, x, y, w, h);
- wl_region_add(region, window->input_rect.x, window->input_rect.y,
- window->input_rect.w, window->input_rect.h);
- wl_surface_set_input_region(window->surface, region);
- wl_region_destroy(region);
+ return out;
}
static void
-_opaque_set(Ecore_Wl2_Window *window)
+_regions_set(Ecore_Wl2_Window *window)
{
- struct wl_region *region;
+ struct wl_region *region = NULL;
- if (!window->opaque_set)
+ if (window->pending.opaque)
{
- wl_surface_set_opaque_region(window->surface, NULL);
- return;
+ if (window->opaque_set)
+ {
+ region = _region_create(window->display->wl.compositor,
+ window->opaque.x, window->opaque.y,
+ window->opaque.w, window->opaque.h);
+ if (!region) return;
+ }
+ wl_surface_set_opaque_region(window->surface, region);
+ }
+
+ if (!window->pending.input) goto out;
+ if (window->type == ECORE_WL2_WINDOW_TYPE_DND) goto out;
+
+ if (!window->input_set)
+ {
+ wl_surface_set_input_region(window->surface, NULL);
+ goto out;
}
- region = wl_compositor_create_region(window->display->wl.compositor);
- if (!region)
+ if (region && (window->opaque.x == window->input_rect.x) &&
+ (window->opaque.y == window->input_rect.y) &&
+ (window->opaque.w == window->input_rect.w) &&
+ (window->opaque.h == window->input_rect.h))
{
- ERR("Failed to create opaque region");
- return;
+ wl_surface_set_input_region(window->surface, region);
+ goto out;
}
+ if (region) wl_region_destroy(region);
- wl_region_add(region, window->opaque.x, window->opaque.y,
- window->opaque.w, window->opaque.h);
- wl_surface_set_opaque_region(window->surface, region);
- wl_region_destroy(region);
+ region = _region_create(window->display->wl.compositor,
+ window->input_rect.x, window->input_rect.y,
+ window->input_rect.w, window->input_rect.h);
+ if (!region) return;
+ wl_surface_set_input_region(window->surface, region);
+
+out:
+ if (region) wl_region_destroy(region);
}
EAPI void
@@ -1484,26 +1580,38 @@ ecore_wl2_window_commit(Ecore_Wl2_Window *window, Eina_Bool flush)
if (window->commit_pending)
{
- wl_callback_destroy(window->callback);
- ERR("Commit before previous commit processed");
+ if (window->callback)
+ wl_callback_destroy(window->callback);
+ window->callback = NULL;
+ /* The elm mouse cursor bits do some harmless but weird stuff that
+ * can hit this, silence the warning for that case only. */
+ if (window->type != ECORE_WL2_WINDOW_TYPE_NONE)
+ ERR("Commit before previous commit processed");
}
if (!window->pending.configure)
{
- window->commit_pending = EINA_TRUE;
+ if (window->has_buffer)
+ window->commit_pending = EINA_TRUE;
window->callback = wl_surface_frame(window->surface);
wl_callback_add_listener(window->callback, &_frame_listener, window);
/* Dispatch any state we've been saving along the way */
- if (window->pending.geom && window->zxdg_toplevel)
- zxdg_surface_v6_set_window_geometry(window->zxdg_surface,
- window->set_config.geometry.x,
- window->set_config.geometry.y,
- window->set_config.geometry.w,
- window->set_config.geometry.h);
- if (window->pending.opaque)
- _opaque_set(window);
-
- if (window->pending.input)
- _input_set(window);
+ if (window->pending.geom)
+ {
+ if (window->xdg_toplevel)
+ xdg_surface_set_window_geometry(window->xdg_surface,
+ window->set_config.geometry.x,
+ window->set_config.geometry.y,
+ window->set_config.geometry.w,
+ window->set_config.geometry.h);
+ if (window->zxdg_surface)
+ zxdg_surface_v6_set_window_geometry(window->zxdg_surface,
+ window->set_config.geometry.x,
+ window->set_config.geometry.y,
+ window->set_config.geometry.w,
+ window->set_config.geometry.h);
+ }
+ if (window->pending.opaque || window->pending.input)
+ _regions_set(window);
if (window->pending.maximized)
_maximized_set(window);
@@ -1520,6 +1628,9 @@ ecore_wl2_window_commit(Ecore_Wl2_Window *window, Eina_Bool flush)
if (window->req_config.serial != window->set_config.serial)
{
+ if (window->xdg_configure_ack)
+ window->xdg_configure_ack(window->xdg_surface,
+ window->req_config.serial);
if (window->zxdg_configure_ack)
window->zxdg_configure_ack(window->zxdg_surface,
window->req_config.serial);
@@ -1544,15 +1655,14 @@ ecore_wl2_window_false_commit(Ecore_Wl2_Window *window)
EINA_SAFETY_ON_NULL_RETURN(window);
EINA_SAFETY_ON_NULL_RETURN(window->surface);
EINA_SAFETY_ON_TRUE_RETURN(window->pending.configure);
-
- if (window->commit_pending)
- ERR("Commit before previous commit processed");
+ EINA_SAFETY_ON_TRUE_RETURN(window->commit_pending);
window->callback = wl_surface_frame(window->surface);
wl_callback_add_listener(window->callback, &_frame_listener, window);
wl_surface_commit(window->surface);
ecore_wl2_display_flush(window->display);
- window->commit_pending = EINA_TRUE;
+ if (window->has_buffer)
+ window->commit_pending = EINA_TRUE;
}
EAPI Eina_Bool
@@ -1647,10 +1757,10 @@ ecore_wl2_window_damage(Ecore_Wl2_Window *window, Eina_Rectangle *rects, unsigne
}
EAPI void
-ecore_wl2_window_surface_flush(Ecore_Wl2_Window *window)
+ecore_wl2_window_surface_flush(Ecore_Wl2_Window *window, Eina_Bool purge)
{
EINA_SAFETY_ON_NULL_RETURN(window);
if (!window->wl2_surface) return;
- ecore_wl2_surface_flush(window->wl2_surface);
+ ecore_wl2_surface_flush(window->wl2_surface, purge);
}
diff --git a/src/lib/ecore_wl2/window_v6.x b/src/lib/ecore_wl2/window_v6.x
new file mode 100644
index 0000000000..333586a2ac
--- /dev/null
+++ b/src/lib/ecore_wl2/window_v6.x
@@ -0,0 +1,192 @@
+
+static void
+_zxdg_surface_cb_configure(void *data, struct zxdg_surface_v6 *zxdg_surface EINA_UNUSED, uint32_t serial)
+{
+ Ecore_Wl2_Window *window;
+
+ window = data;
+ window->def_config.serial = serial;
+
+ if (window->pending.configure)
+ {
+ window->saved.w = window->set_config.geometry.w;
+ window->saved.h = window->set_config.geometry.h;
+ }
+ if (window->pending.configure && window->updating)
+ ERR("Window shouldn't be rendering before initial configure");
+
+ if (!window->updating)
+ _ecore_wl2_window_configure_send(window);
+
+ if (window->pending.configure)
+ _configure_complete(window);
+}
+
+static const struct zxdg_surface_v6_listener _zxdg_surface_listener =
+{
+ _zxdg_surface_cb_configure,
+};
+
+static void
+_zxdg_toplevel_cb_configure(void *data, struct zxdg_toplevel_v6 *zxdg_toplevel EINA_UNUSED, int32_t width, int32_t height, struct wl_array *states)
+{
+ Ecore_Wl2_Window *win = data;
+ uint32_t *s;
+
+ win->def_config.maximized = EINA_FALSE;
+ win->def_config.fullscreen = EINA_FALSE;
+ win->def_config.focused = EINA_FALSE;
+ win->def_config.resizing = EINA_FALSE;
+ win->def_config.geometry.w = width;
+ win->def_config.geometry.h = height;
+
+ wl_array_for_each(s, states)
+ {
+ switch (*s)
+ {
+ case ZXDG_TOPLEVEL_V6_STATE_MAXIMIZED:
+ win->def_config.maximized = EINA_TRUE;
+ break;
+ case ZXDG_TOPLEVEL_V6_STATE_FULLSCREEN:
+ win->def_config.fullscreen = EINA_TRUE;
+ break;
+ case ZXDG_TOPLEVEL_V6_STATE_RESIZING:
+ win->def_config.resizing = EINA_TRUE;
+ break;
+ case ZXDG_TOPLEVEL_V6_STATE_ACTIVATED:
+ win->def_config.focused = EINA_TRUE;
+ default:
+ break;
+ }
+ }
+}
+
+static void
+_zxdg_toplevel_cb_close(void *data, struct zxdg_toplevel_v6 *zxdg_toplevel EINA_UNUSED)
+{
+ Ecore_Wl2_Window *win;
+
+ win = data;
+ if (!win) return;
+
+ ecore_wl2_window_free(win);
+}
+
+static const struct zxdg_toplevel_v6_listener _zxdg_toplevel_listener =
+{
+ _zxdg_toplevel_cb_configure,
+ _zxdg_toplevel_cb_close,
+};
+
+static void
+_zxdg_popup_cb_configure(void *data, struct zxdg_popup_v6 *zxdg_popup EINA_UNUSED, int32_t x EINA_UNUSED, int32_t y EINA_UNUSED, int32_t width, int32_t height)
+{
+ Ecore_Wl2_Window *win = data;
+ win->def_config.geometry.w = width;
+ win->def_config.geometry.h = height;
+}
+
+static void
+_zxdg_popup_cb_done(void *data, struct zxdg_popup_v6 *zxdg_popup EINA_UNUSED)
+{
+ Ecore_Wl2_Window *win;
+
+ win = data;
+ if (!win) return;
+
+ if (win->grab) _ecore_wl2_input_ungrab(win->grab);
+}
+
+static const struct zxdg_popup_v6_listener _zxdg_popup_listener =
+{
+ _zxdg_popup_cb_configure,
+ _zxdg_popup_cb_done,
+};
+
+static void
+_window_v6_popup_create(Ecore_Wl2_Window *win)
+{
+ struct zxdg_positioner_v6 *pos;
+
+ EINA_SAFETY_ON_NULL_RETURN(win->parent);
+ pos = zxdg_shell_v6_create_positioner(win->display->wl.zxdg_shell);
+ if (!pos) return;
+
+ zxdg_positioner_v6_set_anchor_rect(pos, win->set_config.geometry.x,
+ win->set_config.geometry.y,
+ 1, 1);
+ zxdg_positioner_v6_set_size(pos, win->set_config.geometry.w,
+ win->set_config.geometry.h);
+ zxdg_positioner_v6_set_anchor(pos, ZXDG_POSITIONER_V6_ANCHOR_TOP |
+ ZXDG_POSITIONER_V6_ANCHOR_LEFT);
+ zxdg_positioner_v6_set_gravity(pos, ZXDG_POSITIONER_V6_ANCHOR_BOTTOM |
+ ZXDG_POSITIONER_V6_ANCHOR_RIGHT);
+
+ win->zxdg_popup = zxdg_surface_v6_get_popup(win->zxdg_surface,
+ win->parent->zxdg_surface, pos);
+
+ zxdg_positioner_v6_destroy(pos);
+ if (win->grab)
+ zxdg_popup_v6_grab(win->zxdg_popup, win->grab->wl.seat,
+ wl_display_get_serial(win->display->wl.display));
+ zxdg_popup_v6_set_user_data(win->zxdg_popup, win);
+ zxdg_popup_v6_add_listener(win->zxdg_popup, &_zxdg_popup_listener, win);
+
+ win->pending.configure = EINA_TRUE;
+
+ ecore_wl2_window_commit(win, EINA_TRUE);
+}
+
+static void
+_window_v6_shell_surface_create(Ecore_Wl2_Window *window)
+{
+ if (window->zxdg_surface) return;
+ window->zxdg_surface =
+ zxdg_shell_v6_get_xdg_surface(window->display->wl.zxdg_shell,
+ window->surface);
+ zxdg_surface_v6_set_user_data(window->zxdg_surface, window);
+ zxdg_surface_v6_add_listener(window->zxdg_surface,
+ &_zxdg_surface_listener, window);
+
+ window->zxdg_configure_ack = zxdg_surface_v6_ack_configure;
+ window->pending.configure = EINA_TRUE;
+
+ if (window->type == ECORE_WL2_WINDOW_TYPE_MENU)
+ _window_v6_popup_create(window);
+ else
+ {
+ struct zxdg_toplevel_v6 *ptop = NULL;
+
+ window->zxdg_toplevel =
+ zxdg_surface_v6_get_toplevel(window->zxdg_surface);
+ zxdg_toplevel_v6_set_user_data(window->zxdg_toplevel, window);
+ zxdg_toplevel_v6_add_listener(window->zxdg_toplevel,
+ &_zxdg_toplevel_listener, window);
+
+ if (window->deferred_minimize)
+ zxdg_toplevel_v6_set_minimized(window->zxdg_toplevel);
+ window->deferred_minimize = EINA_FALSE;
+
+ if (window->title)
+ zxdg_toplevel_v6_set_title(window->zxdg_toplevel, window->title);
+ if (window->class)
+ zxdg_toplevel_v6_set_app_id(window->zxdg_toplevel, window->class);
+
+ window->zxdg_set_min_size = zxdg_toplevel_v6_set_min_size;
+ window->zxdg_set_max_size = zxdg_toplevel_v6_set_max_size;
+
+ if (window->parent)
+ ptop = window->parent->zxdg_toplevel;
+
+ if (ptop)
+ zxdg_toplevel_v6_set_parent(window->zxdg_toplevel, ptop);
+
+ if (window->set_config.maximized)
+ zxdg_toplevel_v6_set_maximized(window->zxdg_toplevel);
+
+ if (window->set_config.fullscreen)
+ zxdg_toplevel_v6_set_fullscreen(window->zxdg_toplevel, NULL);
+ }
+
+ ecore_wl2_window_commit(window, EINA_TRUE);
+}
diff --git a/src/lib/ecore_x/Ecore_X.h b/src/lib/ecore_x/Ecore_X.h
index 3a6afa19fc..cb55dfa3ee 100644
--- a/src/lib/ecore_x/Ecore_X.h
+++ b/src/lib/ecore_x/Ecore_X.h
@@ -2494,8 +2494,16 @@ typedef struct _Ecore_X_Event_Damage Ecore_X_Event_Damage;
struct _Ecore_X_Event_Xkb
{
int group;
+ int base_group; /** @since 1.21 */
+ int latched_group; /** @since 1.21 */
+ int locked_group; /** @since 1.21 */
+ unsigned int mods; /** @since 1.21 */
+ unsigned int base_mods; /** @since 1.21 */
+ unsigned int latched_mods; /** @since 1.21 */
+ unsigned int locked_mods; /** @since 1.21 */
};
typedef struct _Ecore_X_Event_Xkb Ecore_X_Event_Xkb; /** @since 1.7 */
+typedef struct _Ecore_X_Event_Xkb Ecore_X_Xkb_State; /** @since 1.21 */
EAPI Eina_Bool ecore_x_damage_query(void);
EAPI Ecore_X_Damage ecore_x_damage_new(Ecore_X_Drawable d, Ecore_X_Damage_Report_Level level);
@@ -2721,6 +2729,8 @@ EAPI Ecore_X_Illume_Window_State ecore_x_e_illume_window_state_get(Eco
EAPI void ecore_x_e_illume_window_state_send(Ecore_X_Window win, Ecore_X_Illume_Window_State state); /**< @since 1.9 */
EAPI void ecore_x_xkb_select_group(int group); /* @since 1.7 */
+EAPI Eina_Bool ecore_x_xkb_track_state(void); /** @since 1.21 */
+EAPI Eina_Bool ecore_x_xkb_state_get(Ecore_X_Xkb_State *state); /** @since 1.21 */
EAPI void ecore_x_e_window_rotation_supported_set(Ecore_X_Window root, Eina_Bool enabled); /**< @since 1.9 */
EAPI Eina_Bool ecore_x_e_window_rotation_supported_get(Ecore_X_Window root); /**< @since 1.9 */
diff --git a/src/lib/ecore_x/ecore_x.c b/src/lib/ecore_x/ecore_x.c
index ff213a7784..bab8a41f6d 100644
--- a/src/lib/ecore_x/ecore_x.c
+++ b/src/lib/ecore_x/ecore_x.c
@@ -780,14 +780,11 @@ ecore_x_init_from_display(Ecore_X_Display *display)
return --_ecore_x_init_count;
}
-static int
-_ecore_x_shutdown(int close_display)
+int
+_ecore_x_shutdown(void)
{
- if (--_ecore_x_init_count != 0)
- return _ecore_x_init_count;
-
if (!_ecore_x_disp)
- return _ecore_x_init_count;
+ return 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -854,19 +851,9 @@ _ecore_x_shutdown(int close_display)
ECORE_X_EVENT_PRESENT_COMPLETE,
ECORE_X_EVENT_PRESENT_IDLE);
ecore_main_fd_handler_del(_ecore_x_fd_handler_handle);
- if (close_display)
- XCloseDisplay(_ecore_x_disp);
- else
- {
- close(ConnectionNumber(_ecore_x_disp));
- // FIXME: may have to clean up x display internal here
-// getting segv here? hmmm. odd. disable
-// XFree(_ecore_x_disp);
- }
free(_ecore_x_event_handlers);
_ecore_x_fd_handler_handle = NULL;
- _ecore_x_disp = NULL;
_ecore_x_event_handlers = NULL;
_ecore_x_events_shutdown();
_ecore_x_input_shutdown();
@@ -874,6 +861,12 @@ _ecore_x_shutdown(int close_display)
_ecore_x_dnd_shutdown();
ecore_x_netwm_shutdown();
+ return 0;
+}
+
+static void
+_ecore_x_shutdown2(void)
+{
ecore_event_shutdown();
ecore_shutdown();
@@ -881,8 +874,6 @@ _ecore_x_shutdown(int close_display)
_ecore_xlib_log_dom = -1;
eina_shutdown();
_ecore_xlib_sync = EINA_FALSE;
-
- return _ecore_x_init_count;
}
/**
@@ -898,7 +889,14 @@ _ecore_x_shutdown(int close_display)
EAPI int
ecore_x_shutdown(void)
{
- return _ecore_x_shutdown(1);
+ if (--_ecore_x_init_count != 0)
+ return _ecore_x_init_count;
+ if (_ecore_x_shutdown()) return _ecore_x_init_count;
+ if (_ecore_x_disp)
+ XCloseDisplay(_ecore_x_disp);
+ _ecore_x_disp = NULL;
+ _ecore_x_shutdown2();
+ return 0;
}
/**
@@ -911,7 +909,16 @@ ecore_x_shutdown(void)
EAPI int
ecore_x_disconnect(void)
{
- return _ecore_x_shutdown(0);
+ if (--_ecore_x_init_count != 0)
+ return _ecore_x_init_count;
+ if (_ecore_x_shutdown()) return _ecore_x_init_count;
+ close(ConnectionNumber(_ecore_x_disp));
+ // FIXME: may have to clean up x display internal here
+// getting segv here? hmmm. odd. disable
+// XFree(_ecore_x_disp);
+ _ecore_x_disp = NULL;
+ _ecore_x_shutdown2();
+ return 0;
}
/**
@@ -976,7 +983,7 @@ ecore_x_screen_size_get(const Ecore_X_Screen *screen,
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (w) *w = 0;
if (h) *h = 0;
- if (!s) return;
+ EINA_SAFETY_ON_NULL_RETURN(screen);
if (w) *w = s->width;
if (h) *h = s->height;
}
@@ -1009,6 +1016,7 @@ ecore_x_screen_count_get(void)
EAPI int
ecore_x_screen_index_get(const Ecore_X_Screen *screen)
{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(screen, -1);
return XScreenNumberOfScreen((Screen *)screen);
}
@@ -1863,6 +1871,7 @@ ecore_x_window_button_ungrab(Ecore_X_Window win,
int mod,
int any_mod)
{
+ EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
_ecore_x_window_button_ungrab_internal(win, button, mod, any_mod);
_ecore_x_sync_magic_send(1, win, button, mod, any_mod);
// _ecore_x_window_grab_remove(win, button, mod, any_mod);
@@ -1967,6 +1976,7 @@ ecore_x_window_key_grab(Ecore_X_Window win,
{
Keygrab *t;
+ EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
_ecore_x_window_key_grab_internal(win, key, mod, any_mod);
_ecore_key_grabs_num++;
t = realloc(_ecore_key_grabs,
@@ -2073,6 +2083,7 @@ ecore_x_window_key_ungrab(Ecore_X_Window win,
int mod,
int any_mod)
{
+ EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
_ecore_x_window_key_ungrab_internal(win, key, mod, any_mod);
_ecore_x_sync_magic_send(2, win, XStringToKeysym(key), mod, any_mod);
// _ecore_x_key_grab_remove(win, key, mod, any_mod);
@@ -2508,6 +2519,13 @@ ecore_x_default_depth_get(Ecore_X_Display *disp,
return depth;
}
+EAPI Ecore_X_Connection *
+ecore_x_connection_get(void)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(_ecore_x_disp, NULL);
+ return XGetXCBConnection(_ecore_x_disp);
+}
+
EAPI void
ecore_x_xkb_select_group(int group)
{
@@ -2518,6 +2536,42 @@ ecore_x_xkb_select_group(int group)
#endif
}
+EAPI Eina_Bool
+ecore_x_xkb_track_state(void)
+{
+ Eina_Bool ret = EINA_FALSE;
+#ifdef ECORE_XKB
+ EINA_SAFETY_ON_NULL_RETURN_VAL(_ecore_x_disp, EINA_FALSE);
+ ret = XkbSelectEvents(_ecore_x_disp, XkbUseCoreKbd, XkbStateNotifyMask, XkbStateNotifyMask);
+ if (_ecore_xlib_sync) ecore_x_sync();
+#endif
+ return ret;
+}
+
+EAPI Eina_Bool
+ecore_x_xkb_state_get(Ecore_X_Xkb_State *state)
+{
+ Eina_Bool ret = EINA_FALSE;
+#ifdef ECORE_XKB
+ XkbStateRec xkbstate;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(_ecore_x_disp, EINA_FALSE);
+ ret = XkbGetState(_ecore_x_disp, XkbUseCoreKbd, &xkbstate);
+ if (!ret) return ret;
+
+ state->group = xkbstate.group;
+ state->base_group = xkbstate.base_group;
+ state->latched_group = xkbstate.latched_group;
+ state->locked_group = xkbstate.locked_group;
+
+ state->mods = xkbstate.mods;
+ state->base_mods = xkbstate.base_mods;
+ state->latched_mods = xkbstate.latched_mods;
+ state->locked_mods = xkbstate.locked_mods;
+#endif
+ return ret;
+}
+
/*****************************************************************************/
/*****************************************************************************/
/*****************************************************************************/
diff --git a/src/lib/ecore_x/ecore_x_error.c b/src/lib/ecore_x/ecore_x_error.c
index ad3d32257a..9facf0733b 100644
--- a/src/lib/ecore_x/ecore_x_error.c
+++ b/src/lib/ecore_x/ecore_x_error.c
@@ -172,7 +172,11 @@ _ecore_x_io_error_handle(Display *d)
if (d == _ecore_x_disp)
{
if (_io_error_func)
- _io_error_func(_io_error_data);
+ {
+ _ecore_x_disp = NULL;
+ _ecore_x_shutdown();
+ _io_error_func(_io_error_data);
+ }
else
exit(-1);
}
diff --git a/src/lib/ecore_x/ecore_x_events.c b/src/lib/ecore_x/ecore_x_events.c
index 11d098826e..61528cd5d1 100644
--- a/src/lib/ecore_x/ecore_x_events.c
+++ b/src/lib/ecore_x/ecore_x_events.c
@@ -2656,6 +2656,14 @@ _ecore_x_event_handle_xkb(XEvent *xevent)
return;
e->group = xkbev->state.group;
+ e->base_group = xkbev->state.base_group;
+ e->latched_group = xkbev->state.latched_group;
+ e->locked_group = xkbev->state.locked_group;
+
+ e->mods = xkbev->state.mods;
+ e->base_mods = xkbev->state.base_mods;
+ e->latched_mods = xkbev->state.latched_mods;
+ e->locked_mods = xkbev->state.locked_mods;
ecore_event_add(ECORE_X_EVENT_XKB_STATE_NOTIFY, e, free_hash, NULL);
eina_hash_add(emitted_events, &xkbev->state.serial, (void*) 1);
}
@@ -2671,6 +2679,11 @@ _ecore_x_event_handle_xkb(XEvent *xevent)
xkbmapping = (XkbMapNotifyEvent *)xkbev;
XkbRefreshKeyboardMapping(xkbmapping);
}
+ else
+ {
+ XkbNewKeyboardNotifyEvent *xkbnkn = (void*)xkbev;
+ if (!(xkbnkn->changed & XkbNKN_KeycodesMask)) return;
+ }
ecore_event_add(ECORE_X_EVENT_XKB_NEWKBD_NOTIFY, NULL, free_hash, NULL);
eina_hash_add(emitted_events, &xkbev->new_kbd.serial, (void*) 1);
}
diff --git a/src/lib/ecore_x/ecore_x_private.h b/src/lib/ecore_x/ecore_x_private.h
index 07c09fb16f..7374a0d9ee 100644
--- a/src/lib/ecore_x/ecore_x_private.h
+++ b/src/lib/ecore_x/ecore_x_private.h
@@ -7,6 +7,7 @@
#endif /* ifndef MAXHOSTNAMELEN */
#include <X11/Xlib.h>
+#include <X11/Xlib-xcb.h>
#include <X11/Xproto.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
@@ -395,6 +396,7 @@ Ecore_Event_Mouse_Button *_ecore_mouse_button(int event,
void _ecore_x_modifiers_get(void);
KeySym _ecore_x_XKeycodeToKeysym(Display *display, KeyCode keycode, int index);
+int _ecore_x_shutdown(void);
//#define LOGFNS 1
#ifdef LOGFNS
diff --git a/src/lib/ector/Ector.h b/src/lib/ector/Ector.h
index b9a2ffd416..e2268f3ad8 100644
--- a/src/lib/ector/Ector.h
+++ b/src/lib/ector/Ector.h
@@ -10,15 +10,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ECTOR_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EO_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -29,7 +29,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#ifdef __cplusplus
extern "C" {
diff --git a/src/lib/ector/cairo/Ector_Cairo.h b/src/lib/ector/cairo/Ector_Cairo.h
index b0f0f95a4a..99eeafac9a 100644
--- a/src/lib/ector/cairo/Ector_Cairo.h
+++ b/src/lib/ector/cairo/Ector_Cairo.h
@@ -8,15 +8,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ECTOR_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EO_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -27,7 +27,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#ifdef EFL_BETA_API_SUPPORT
diff --git a/src/lib/ector/cairo/ector_cairo_software_surface.c b/src/lib/ector/cairo/ector_cairo_software_surface.c
index 98dd8e0a4f..96bf1c1081 100644
--- a/src/lib/ector/cairo/ector_cairo_software_surface.c
+++ b/src/lib/ector/cairo/ector_cairo_software_surface.c
@@ -51,7 +51,7 @@ struct _Ector_Cairo_Software_Surface_Data
EOLIAN static Eina_Bool
_ector_cairo_software_surface_ector_buffer_pixels_set(Eo *obj, Ector_Cairo_Software_Surface_Data *pd,
- void *pixels, int width, int height,
+ void *pixels, int width, int height, int stride,
Efl_Gfx_Colorspace cspace, Eina_Bool writable)
{
cairo_t *ctx = NULL;
@@ -72,7 +72,7 @@ _ector_cairo_software_surface_ector_buffer_pixels_set(Eo *obj, Ector_Cairo_Softw
cairo_surface_destroy(pd->surface);
pd->surface = NULL;
- ok = ector_buffer_pixels_set(efl_super(obj, MY_CLASS), pixels, width, height, cspace, writable);
+ ok = ector_buffer_pixels_set(efl_super(obj, MY_CLASS), pixels, width, height, stride, cspace, writable);
if (ok && pixels)
{
diff --git a/src/lib/ector/cairo/ector_cairo_surface.c b/src/lib/ector/cairo/ector_cairo_surface.c
index b21f7ab817..28d904499e 100644
--- a/src/lib/ector/cairo/ector_cairo_surface.c
+++ b/src/lib/ector/cairo/ector_cairo_surface.c
@@ -63,11 +63,11 @@ _ector_cairo_surface_ector_surface_renderer_factory_new(Eo *obj,
const Efl_Class *type)
{
if (type == ECTOR_RENDERER_SHAPE_MIXIN)
- return efl_add(ECTOR_RENDERER_CAIRO_SHAPE_CLASS, NULL, ector_renderer_surface_set(efl_added, obj));
+ return efl_add_ref(ECTOR_RENDERER_CAIRO_SHAPE_CLASS, NULL, ector_renderer_surface_set(efl_added, obj));
else if (type == ECTOR_RENDERER_GRADIENT_LINEAR_MIXIN)
- return efl_add(ECTOR_RENDERER_CAIRO_GRADIENT_LINEAR_CLASS, NULL, ector_renderer_surface_set(efl_added, obj));
+ return efl_add_ref(ECTOR_RENDERER_CAIRO_GRADIENT_LINEAR_CLASS, NULL, ector_renderer_surface_set(efl_added, obj));
else if (type == ECTOR_RENDERER_GRADIENT_RADIAL_MIXIN)
- return efl_add(ECTOR_RENDERER_CAIRO_GRADIENT_RADIAL_CLASS, NULL, ector_renderer_surface_set(efl_added, obj));
+ return efl_add_ref(ECTOR_RENDERER_CAIRO_GRADIENT_RADIAL_CLASS, NULL, ector_renderer_surface_set(efl_added, obj));
ERR("Couldn't find class for type: %s\n", efl_class_name_get(type));
return NULL;
@@ -99,7 +99,7 @@ _ector_cairo_surface_context_set(Eo *obj EINA_UNUSED,
}
static cairo_t *
-_ector_cairo_surface_context_get(Eo *obj EINA_UNUSED,
+_ector_cairo_surface_context_get(const Eo *obj EINA_UNUSED,
Ector_Cairo_Surface_Data *pd)
{
return pd->cairo;
diff --git a/src/lib/ector/cairo/ector_cairo_surface.eo b/src/lib/ector/cairo/ector_cairo_surface.eo
index 7967c4d348..76f2c82e62 100644
--- a/src/lib/ector/cairo/ector_cairo_surface.eo
+++ b/src/lib/ector/cairo/ector_cairo_surface.eo
@@ -11,15 +11,15 @@ class Ector.Cairo.Surface (Efl.Object, Ector.Surface)
@property context {
[[Cairo context]]
set {
- }
- get {
- }
- values {
- ctx: ptr(cairo_t); [[Cairo context]]
- }
+ }
+ get {
+ }
+ values {
+ ctx: ptr(cairo_t); [[Cairo context]]
+ }
}
symbol_get {
- [[Lookup symbal name in cairo lib]]
+ [[Lookup symbal name in cairo lib]]
return: void_ptr @warn_unused; [[Pointer to cairo lib with this symbol]]
params {
@in name: string; [[Symbol name]]
diff --git a/src/lib/ector/cairo/ector_renderer_cairo.c b/src/lib/ector/cairo/ector_renderer_cairo.c
index 8657b5ccbc..ddcca419d8 100644
--- a/src/lib/ector/cairo/ector_renderer_cairo.c
+++ b/src/lib/ector/cairo/ector_renderer_cairo.c
@@ -84,7 +84,7 @@ _ector_renderer_cairo_ector_renderer_color_set(Eo *obj EINA_UNUSED,
}
void
-_ector_renderer_cairo_ector_renderer_color_get(Eo *obj EINA_UNUSED,
+_ector_renderer_cairo_ector_renderer_color_get(const Eo *obj EINA_UNUSED,
Ector_Renderer_Cairo_Data *pd,
int *r, int *g, int *b, int *a)
{
diff --git a/src/lib/ector/cairo/ector_renderer_cairo.eo b/src/lib/ector/cairo/ector_renderer_cairo.eo
index 75d4757464..02431e0b25 100644
--- a/src/lib/ector/cairo/ector_renderer_cairo.eo
+++ b/src/lib/ector/cairo/ector_renderer_cairo.eo
@@ -2,8 +2,8 @@ abstract Ector.Renderer.Cairo (Ector.Renderer)
{
[[Ector cairo renderer abstract class]]
methods {
- fill @pure_virtual {
- [[Fill operation]]
+ op_fill @pure_virtual {
+ [[Fill operation]]
return: bool; [[$true on success, $false otherwise]]
params {
@in mul_col: uint; [[Premultiplied color]]
diff --git a/src/lib/ector/cairo/ector_renderer_cairo_gradient_linear.c b/src/lib/ector/cairo/ector_renderer_cairo_gradient_linear.c
index 95b42432c2..598e625a8c 100644
--- a/src/lib/ector/cairo/ector_renderer_cairo_gradient_linear.c
+++ b/src/lib/ector/cairo/ector_renderer_cairo_gradient_linear.c
@@ -91,7 +91,7 @@ _ector_renderer_cairo_gradient_linear_ector_renderer_draw(Eo *obj,
}
static Eina_Bool
-_ector_renderer_cairo_gradient_linear_ector_renderer_cairo_fill(Eo *obj,
+_ector_renderer_cairo_gradient_linear_ector_renderer_cairo_op_fill(Eo *obj,
Ector_Renderer_Cairo_Gradient_Linear_Data *pd,
unsigned int mul_col)
{
@@ -113,7 +113,7 @@ _ector_renderer_cairo_gradient_linear_ector_renderer_cairo_fill(Eo *obj,
}
static void
-_ector_renderer_cairo_gradient_linear_ector_renderer_bounds_get(Eo *obj,
+_ector_renderer_cairo_gradient_linear_efl_gfx_path_bounds_get(const Eo *obj,
Ector_Renderer_Cairo_Gradient_Linear_Data *pd EINA_UNUSED,
Eina_Rect *r)
{
@@ -174,7 +174,7 @@ _ector_renderer_cairo_gradient_linear_efl_gfx_gradient_stop_set(Eo *obj,
}
static unsigned int
-_ector_renderer_cairo_gradient_linear_ector_renderer_crc_get(Eo *obj, Ector_Renderer_Cairo_Gradient_Linear_Data *pd EINA_UNUSED)
+_ector_renderer_cairo_gradient_linear_ector_renderer_crc_get(const Eo *obj, Ector_Renderer_Cairo_Gradient_Linear_Data *pd EINA_UNUSED)
{
Ector_Renderer_Gradient_Linear_Data *gld;
Ector_Renderer_Gradient_Data *gd;
diff --git a/src/lib/ector/cairo/ector_renderer_cairo_gradient_linear.eo b/src/lib/ector/cairo/ector_renderer_cairo_gradient_linear.eo
index 670371c7c6..948792a9c0 100644
--- a/src/lib/ector/cairo/ector_renderer_cairo_gradient_linear.eo
+++ b/src/lib/ector/cairo/ector_renderer_cairo_gradient_linear.eo
@@ -1,13 +1,13 @@
-class Ector.Renderer.Cairo.Gradient.Linear (Ector.Renderer.Cairo, Ector.Renderer.Gradient, Ector.Renderer.Gradient.Linear)
+class Ector.Renderer.Cairo.Gradient.Linear (Ector.Renderer.Cairo, Ector.Renderer.Gradient, Ector.Renderer.Gradient.Linear, Efl.Gfx.Path)
{
[[Ector cairo renderer gradient linear]]
eo_prefix: ector_renderer_cairo_gradient_linear;
implements {
Ector.Renderer.prepare;
Ector.Renderer.draw;
- Ector.Renderer.bounds_get;
+ Efl.Gfx.Path.bounds_get;
Ector.Renderer.crc { get; }
- Ector.Renderer.Cairo.fill;
+ Ector.Renderer.Cairo.op_fill;
Efl.Object.finalize;
Efl.Object.destructor;
Efl.Gfx.Gradient.stop { set; }
diff --git a/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c b/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c
index 30149e78a8..bb5add0373 100644
--- a/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c
+++ b/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c
@@ -60,7 +60,7 @@ _ector_renderer_cairo_gradient_radial_prepare(Eo *obj,
{
Ector_Renderer_Data *pd = efl_data_scope_get(obj, ECTOR_RENDERER_CLASS);
cairo_pattern_t *pat;
- cairo_matrix_t *pd_m;
+ cairo_matrix_t pd_m;
pat = cairo_pattern_create_radial(grd->focal.x, grd->focal.y, 0,
grd->radial.x, grd->radial.y, grd->radius);
@@ -70,14 +70,13 @@ _ector_renderer_cairo_gradient_radial_prepare(Eo *obj,
cairo_pattern_set_extend(pat, _ector_cairo_extent_get(gd->s));
- pd_m = malloc(sizeof (cairo_matrix_t));
if (pd->m)
{
- cairo_matrix_init(pd_m,
+ cairo_matrix_init(&pd_m,
pd->m->xx, pd->m->yx,
pd->m->xy, pd->m->yy,
pd->m->xz, pd->m->yz);
- cairo_pattern_set_matrix(pat, pd_m);
+ cairo_pattern_set_matrix(pat, &pd_m);
}
return pat;
@@ -114,7 +113,7 @@ _ector_renderer_cairo_gradient_radial_ector_renderer_draw(Eo *obj, Ector_Rendere
// Clearly duplicated and should be in a common place...
static Eina_Bool
-_ector_renderer_cairo_gradient_radial_ector_renderer_cairo_fill(Eo *obj,
+_ector_renderer_cairo_gradient_radial_ector_renderer_cairo_op_fill(Eo *obj,
Ector_Renderer_Cairo_Gradient_Radial_Data *pd,
unsigned int mul_col)
{
@@ -136,7 +135,7 @@ _ector_renderer_cairo_gradient_radial_ector_renderer_cairo_fill(Eo *obj,
}
static void
-_ector_renderer_cairo_gradient_radial_ector_renderer_bounds_get(Eo *obj EINA_UNUSED,
+_ector_renderer_cairo_gradient_radial_efl_gfx_path_bounds_get(const Eo *obj EINA_UNUSED,
Ector_Renderer_Cairo_Gradient_Radial_Data *pd EINA_UNUSED,
Eina_Rect *r)
{
@@ -198,7 +197,7 @@ _ector_renderer_cairo_gradient_radial_efl_gfx_gradient_stop_set(Eo *obj,
}
static unsigned int
-_ector_renderer_cairo_gradient_radial_ector_renderer_crc_get(Eo *obj, Ector_Renderer_Cairo_Gradient_Radial_Data *pd EINA_UNUSED)
+_ector_renderer_cairo_gradient_radial_ector_renderer_crc_get(const Eo *obj, Ector_Renderer_Cairo_Gradient_Radial_Data *pd EINA_UNUSED)
{
Ector_Renderer_Gradient_Radial_Data *grd;
Ector_Renderer_Gradient_Data *gd;
diff --git a/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.eo b/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.eo
index adb1219f98..afcd44182c 100644
--- a/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.eo
+++ b/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.eo
@@ -1,13 +1,13 @@
-class Ector.Renderer.Cairo.Gradient.Radial (Ector.Renderer.Cairo, Ector.Renderer.Gradient, Ector.Renderer.Gradient.Radial)
+class Ector.Renderer.Cairo.Gradient.Radial (Ector.Renderer.Cairo, Ector.Renderer.Gradient, Ector.Renderer.Gradient.Radial, Efl.Gfx.Path)
{
[[Ector cairo renderer gradient radial]]
eo_prefix: ector_renderer_cairo_gradient_radial;
implements {
Ector.Renderer.prepare;
Ector.Renderer.draw;
- Ector.Renderer.bounds_get;
+ Efl.Gfx.Path.bounds_get;
Ector.Renderer.crc { get; }
- Ector.Renderer.Cairo.fill;
+ Ector.Renderer.Cairo.op_fill;
Efl.Object.destructor;
Efl.Object.finalize;
Efl.Gfx.Gradient.stop { set; }
diff --git a/src/lib/ector/cairo/ector_renderer_cairo_shape.c b/src/lib/ector/cairo/ector_renderer_cairo_shape.c
index 7012491341..1a20e1fa4a 100644
--- a/src/lib/ector/cairo/ector_renderer_cairo_shape.c
+++ b/src/lib/ector/cairo/ector_renderer_cairo_shape.c
@@ -179,14 +179,14 @@ _ector_renderer_cairo_shape_ector_renderer_draw(Eo *obj, Ector_Renderer_Cairo_Sh
cairo_set_fill_rule(pd->parent->cairo, CAIRO_FILL_RULE_WINDING);
if (pd->shape->fill)
- ector_renderer_cairo_fill(pd->shape->fill, mul_col);
+ ector_renderer_cairo_op_fill(pd->shape->fill, mul_col);
if (pd->shape->stroke.fill || pd->public_shape->stroke.color.a > 0)
{
cairo_fill_preserve(pd->parent->cairo);
if (pd->shape->stroke.fill)
- ector_renderer_cairo_fill(pd->shape->stroke.fill, mul_col);
+ ector_renderer_cairo_op_fill(pd->shape->stroke.fill, mul_col);
else
{
r = (((pd->public_shape->stroke.color.r * R_VAL(&mul_col)) + 0xff) >> 8);
@@ -226,7 +226,7 @@ _ector_renderer_cairo_shape_ector_renderer_draw(Eo *obj, Ector_Renderer_Cairo_Sh
}
static Eina_Bool
-_ector_renderer_cairo_shape_ector_renderer_cairo_fill(Eo *obj EINA_UNUSED,
+_ector_renderer_cairo_shape_ector_renderer_cairo_op_fill(Eo *obj EINA_UNUSED,
Ector_Renderer_Cairo_Shape_Data *pd EINA_UNUSED,
unsigned int mul_col EINA_UNUSED)
{
@@ -237,7 +237,7 @@ _ector_renderer_cairo_shape_ector_renderer_cairo_fill(Eo *obj EINA_UNUSED,
}
static void
-_ector_renderer_cairo_shape_ector_renderer_bounds_get(Eo *obj,
+_ector_renderer_cairo_shape_efl_gfx_path_bounds_get(const Eo *obj,
Ector_Renderer_Cairo_Shape_Data *pd EINA_UNUSED,
Eina_Rect *r)
{
@@ -317,7 +317,7 @@ _ector_renderer_cairo_shape_efl_object_destructor(Eo *obj, Ector_Renderer_Cairo_
}
unsigned int
-_ector_renderer_cairo_shape_ector_renderer_crc_get(Eo *obj,
+_ector_renderer_cairo_shape_ector_renderer_crc_get(const Eo *obj,
Ector_Renderer_Cairo_Shape_Data *pd)
{
unsigned int crc;
diff --git a/src/lib/ector/cairo/ector_renderer_cairo_shape.eo b/src/lib/ector/cairo/ector_renderer_cairo_shape.eo
index dc65a407e2..b76dd29879 100644
--- a/src/lib/ector/cairo/ector_renderer_cairo_shape.eo
+++ b/src/lib/ector/cairo/ector_renderer_cairo_shape.eo
@@ -1,13 +1,13 @@
-class Ector.Renderer.Cairo.Shape (Ector.Renderer.Cairo, Ector.Renderer.Shape)
+class Ector.Renderer.Cairo.Shape (Ector.Renderer.Cairo, Ector.Renderer.Shape, Efl.Gfx.Path)
{
[[Ector cairo renderer shape class]]
eo_prefix: ector_renderer_cairo_shape;
implements {
Ector.Renderer.prepare;
Ector.Renderer.draw;
- Ector.Renderer.bounds_get;
+ Efl.Gfx.Path.bounds_get;
Ector.Renderer.crc { get; }
- Ector.Renderer.Cairo.fill;
+ Ector.Renderer.Cairo.op_fill;
Efl.Object.constructor;
Efl.Object.finalize;
Efl.Object.destructor;
diff --git a/src/lib/ector/ector_buffer.c b/src/lib/ector/ector_buffer.c
index 51dbd1496a..7afa5fe899 100644
--- a/src/lib/ector/ector_buffer.c
+++ b/src/lib/ector/ector_buffer.c
@@ -9,20 +9,20 @@
#include "ector_buffer.eo.h"
EOLIAN static Efl_Gfx_Colorspace
-_ector_buffer_cspace_get(Eo *obj EINA_UNUSED, Ector_Buffer_Data *pd)
+_ector_buffer_cspace_get(const Eo *obj EINA_UNUSED, Ector_Buffer_Data *pd)
{
return pd->cspace;
}
EOLIAN static void
-_ector_buffer_size_get(Eo *obj EINA_UNUSED, Ector_Buffer_Data *pd, int *w, int *h)
+_ector_buffer_size_get(const Eo *obj EINA_UNUSED, Ector_Buffer_Data *pd, int *w, int *h)
{
if (w) *w = pd->w;
if (h) *h = pd->h;
}
EOLIAN static Ector_Buffer_Flag
-_ector_buffer_flags_get(Eo *obj EINA_UNUSED, Ector_Buffer_Data *pd EINA_UNUSED)
+_ector_buffer_flags_get(const Eo *obj EINA_UNUSED, Ector_Buffer_Data *pd EINA_UNUSED)
{
return ECTOR_BUFFER_FLAG_NONE;
}
diff --git a/src/lib/ector/ector_buffer.eo b/src/lib/ector/ector_buffer.eo
index 143dcbb846..9d0aaf4040 100644
--- a/src/lib/ector/ector_buffer.eo
+++ b/src/lib/ector/ector_buffer.eo
@@ -77,6 +77,7 @@ mixin Ector.Buffer
@in pixels: void_ptr; [[If $null, allocates an empty buffer]]
@in width: int; [[Buffer width]]
@in height: int; [[Buffer height]]
+ @in stride: int; [[Buffer stride (in bytes). If 0 then calculated based on $cspace and $width]]
@in cspace: Efl.Gfx.Colorspace; [[Buffer colorspace]]
@in writable: bool; [[Buffer is writable]]
}
@@ -91,6 +92,6 @@ mixin Ector.Buffer
}
}
events {
- detached; [[Emitted whenever the previously attached pixels are detached during pixels_set]]
+ detached: ptr(ubyte); [[Emitted whenever the previously attached pixels are detached during pixels_set]]
}
}
diff --git a/src/lib/ector/ector_renderer.c b/src/lib/ector/ector_renderer.c
index f3b6c9499b..1c1b4ac5d1 100644
--- a/src/lib/ector/ector_renderer.c
+++ b/src/lib/ector/ector_renderer.c
@@ -31,7 +31,7 @@ _ector_renderer_efl_object_finalize(Eo *obj, Ector_Renderer_Data *pd)
}
static Ector_Surface *
-_ector_renderer_surface_get(Eo *obj EINA_UNUSED, Ector_Renderer_Data *pd)
+_ector_renderer_surface_get(const Eo *obj EINA_UNUSED, Ector_Renderer_Data *pd)
{
return pd->surface;
}
@@ -67,7 +67,7 @@ _ector_renderer_transformation_set(Eo *obj EINA_UNUSED,
}
static const Eina_Matrix3 *
-_ector_renderer_transformation_get(Eo *obj EINA_UNUSED,
+_ector_renderer_transformation_get(const Eo *obj EINA_UNUSED,
Ector_Renderer_Data *pd)
{
return pd->m;
@@ -83,7 +83,7 @@ _ector_renderer_origin_set(Eo *obj EINA_UNUSED,
}
static void
-_ector_renderer_origin_get(Eo *obj EINA_UNUSED,
+_ector_renderer_origin_get(const Eo *obj EINA_UNUSED,
Ector_Renderer_Data *pd,
double *x, double *y)
{
@@ -100,7 +100,7 @@ _ector_renderer_visibility_set(Eo *obj EINA_UNUSED,
}
static Eina_Bool
-_ector_renderer_visibility_get(Eo *obj EINA_UNUSED,
+_ector_renderer_visibility_get(const Eo *obj EINA_UNUSED,
Ector_Renderer_Data *pd)
{
return pd->visibility;
@@ -118,7 +118,7 @@ _ector_renderer_color_set(Eo *obj EINA_UNUSED,
}
static void
-_ector_renderer_color_get(Eo *obj EINA_UNUSED,
+_ector_renderer_color_get(const Eo *obj EINA_UNUSED,
Ector_Renderer_Data *pd,
int *r, int *g, int *b, int *a)
{
@@ -137,7 +137,7 @@ _ector_renderer_mask_set(Eo *obj EINA_UNUSED,
}
static Ector_Renderer *
-_ector_renderer_mask_get(Eo *obj EINA_UNUSED,
+_ector_renderer_mask_get(const Eo *obj EINA_UNUSED,
Ector_Renderer_Data *pd)
{
return pd->mask;
@@ -152,7 +152,7 @@ _ector_renderer_quality_set(Eo *obj EINA_UNUSED,
}
static Ector_Quality
-_ector_renderer_quality_get(Eo *obj EINA_UNUSED,
+_ector_renderer_quality_get(const Eo *obj EINA_UNUSED,
Ector_Renderer_Data *pd)
{
return pd->q;
@@ -169,7 +169,7 @@ _ector_renderer_prepare(Eo *obj EINA_UNUSED,
}
static unsigned int
-_ector_renderer_crc_get(Eo *obj EINA_UNUSED,
+_ector_renderer_crc_get(const Eo *obj EINA_UNUSED,
Ector_Renderer_Data *pd)
{
unsigned int crc;
diff --git a/src/lib/ector/ector_renderer.eo b/src/lib/ector/ector_renderer.eo
index 451c77c6c6..eaddc64fb0 100644
--- a/src/lib/ector/ector_renderer.eo
+++ b/src/lib/ector/ector_renderer.eo
@@ -18,45 +18,45 @@ abstract Ector.Renderer (Efl.Object)
@property surface {
[[Surface associated with this renderer]]
set {
- [[Do not use.]]
- }
- get {
- [[Gets the surface associated with this renderer. Can not be set.]]
- }
- values {
- s: Ector.Surface; [[Associated surface]]
- }
+ [[Do not use.]]
+ }
+ get {
+ [[Gets the surface associated with this renderer. Can not be set.]]
+ }
+ values {
+ s: Ector.Surface; [[Associated surface]]
+ }
}
@property transformation {
- [[Transformation property]]
+ [[Transformation property]]
set {
- }
- get {
- }
- values {
- @cref m: Eina.Matrix3; [[Transformation matrix]]
- }
+ }
+ get {
+ }
+ values {
+ @cref m: Eina.Matrix3; [[Transformation matrix]]
+ }
}
@property origin {
- [[Renderer origin]]
+ [[Renderer origin]]
set {
- }
- get {
- }
- values {
- x: double; [[X coordinate]]
- y: double; [[Y coordinate]]
- }
+ }
+ get {
+ }
+ values {
+ x: double; [[X coordinate]]
+ y: double; [[Y coordinate]]
+ }
}
@property visibility {
[[The given Ector renderer can be visible or invisible.]]
set {
- }
- get {
- }
- values {
- v: bool; [[$true to make the object visible, $false otherwise]]
- }
+ }
+ get {
+ }
+ values {
+ v: bool; [[$true to make the object visible, $false otherwise]]
+ }
}
@property color {
[[Retrieves the general/main color of the given Ector renderer.
@@ -73,61 +73,55 @@ abstract Ector.Renderer (Efl.Object)
set {
}
get {
- }
- values {
+ }
+ values {
r: int; [[The red component of the given color.]]
g: int; [[The green component of the given color.]]
b: int; [[The blue component of the given color.]]
a: int; [[The alpha component of the given color.]]
- }
+ }
}
@property mask {
- [[Rendering mask]]
+ [[Rendering mask]]
set {
- }
- get {
- }
- values {
- r: Ector.Renderer; [[Rendering mask]]
- }
+ }
+ get {
+ }
+ values {
+ r: Ector.Renderer; [[Rendering mask]]
+ }
}
@property quality {
[[Quality of the renderer]]
set {
- }
- get {
- }
- values {
- q: Ector.Quality; [[Quality of the renderer]]
- }
+ }
+ get {
+ }
+ values {
+ q: Ector.Quality; [[Quality of the renderer]]
+ }
}
@property crc {
[[Cyclic redundancy check]]
get {
return: uint; [[CRC value]]
- }
- }
- bounds_get @pure_virtual {
- [[Retrieves the bounds of the renderer]]
- params {
- @out r: Eina.Rect; [[Bounds as @Eina.Rect]]
- }
+ }
}
draw @pure_virtual {
- [[Actual draw operation]]
+ [[Actual draw operation]]
return: bool; [[$true on success, $false otherwise]]
- params {
- @in op: Efl.Gfx.Render_Op; [[Renderer operation]]
- @in clips: array<ptr(Eina.Rect)>; [[Array of @Eina.Rect clip]]
- @in mul_col: uint; [[Premultiplied color]]
- }
+ params {
+ @in op: Efl.Gfx.Render_Op; [[Renderer operation]]
+ @in clips: array<ptr(Eina.Rect)>; [[Array of @Eina.Rect clip]]
+ @in mul_col: uint; [[Premultiplied color]]
+ }
}
prepare {
- [[Prepare for rendering]]
+ [[Prepare for rendering]]
return: bool; [[$true on success, $false otherwise]]
}
done @pure_virtual {
- [[Done with rendering]]
+ [[Done with rendering]]
return: bool; [[$true on success, $false otherwise]]
}
}
diff --git a/src/lib/ector/ector_renderer_gradient.c b/src/lib/ector/ector_renderer_gradient.c
index aa1101be9d..a3e393a7d3 100644
--- a/src/lib/ector/ector_renderer_gradient.c
+++ b/src/lib/ector/ector_renderer_gradient.c
@@ -25,7 +25,7 @@ _ector_renderer_gradient_efl_gfx_gradient_stop_set(Eo *obj EINA_UNUSED,
}
static void
-_ector_renderer_gradient_efl_gfx_gradient_stop_get(Eo *obj EINA_UNUSED,
+_ector_renderer_gradient_efl_gfx_gradient_stop_get(const Eo *obj EINA_UNUSED,
Ector_Renderer_Gradient_Data *pd,
const Efl_Gfx_Gradient_Stop **colors,
unsigned int *length)
@@ -43,7 +43,7 @@ _ector_renderer_gradient_efl_gfx_gradient_spread_set(Eo *obj EINA_UNUSED,
}
static Efl_Gfx_Gradient_Spread
-_ector_renderer_gradient_efl_gfx_gradient_spread_get(Eo *obj EINA_UNUSED,
+_ector_renderer_gradient_efl_gfx_gradient_spread_get(const Eo *obj EINA_UNUSED,
Ector_Renderer_Gradient_Data *pd)
{
return pd->s;
diff --git a/src/lib/ector/ector_renderer_gradient_linear.c b/src/lib/ector/ector_renderer_gradient_linear.c
index 05c46d6a5a..8b6a69182f 100644
--- a/src/lib/ector/ector_renderer_gradient_linear.c
+++ b/src/lib/ector/ector_renderer_gradient_linear.c
@@ -17,7 +17,7 @@ _ector_renderer_gradient_linear_efl_gfx_gradient_linear_start_set(Eo *obj EINA_U
}
static void
-_ector_renderer_gradient_linear_efl_gfx_gradient_linear_start_get(Eo *obj EINA_UNUSED,
+_ector_renderer_gradient_linear_efl_gfx_gradient_linear_start_get(const Eo *obj EINA_UNUSED,
Ector_Renderer_Gradient_Linear_Data *pd,
double *x, double *y)
{
@@ -35,7 +35,7 @@ _ector_renderer_gradient_linear_efl_gfx_gradient_linear_end_set(Eo *obj EINA_UNU
}
static void
-_ector_renderer_gradient_linear_efl_gfx_gradient_linear_end_get(Eo *obj EINA_UNUSED,
+_ector_renderer_gradient_linear_efl_gfx_gradient_linear_end_get(const Eo *obj EINA_UNUSED,
Ector_Renderer_Gradient_Linear_Data *pd,
double *x, double *y)
{
diff --git a/src/lib/ector/ector_renderer_gradient_linear.eo b/src/lib/ector/ector_renderer_gradient_linear.eo
index bf26dce9db..d147faec2b 100644
--- a/src/lib/ector/ector_renderer_gradient_linear.eo
+++ b/src/lib/ector/ector_renderer_gradient_linear.eo
@@ -1,9 +1,9 @@
-mixin Ector.Renderer.Gradient.Linear (Efl.Gfx.Gradient.Linear)
+mixin Ector.Renderer.Gradient.Linear (Efl.Gfx.Gradient_Linear)
{
[[Ector gradient linear renderer mixin]]
eo_prefix: ector_renderer_gradient_linear;
implements {
- Efl.Gfx.Gradient.Linear.start { get; set; }
- Efl.Gfx.Gradient.Linear.end { get; set; }
+ Efl.Gfx.Gradient_Linear.start { get; set; }
+ Efl.Gfx.Gradient_Linear.end { get; set; }
}
}
diff --git a/src/lib/ector/ector_renderer_gradient_radial.c b/src/lib/ector/ector_renderer_gradient_radial.c
index 83d4aea624..231a2c5266 100644
--- a/src/lib/ector/ector_renderer_gradient_radial.c
+++ b/src/lib/ector/ector_renderer_gradient_radial.c
@@ -17,7 +17,7 @@ _ector_renderer_gradient_radial_efl_gfx_gradient_radial_center_set(Eo *obj EINA_
}
static void
-_ector_renderer_gradient_radial_efl_gfx_gradient_radial_center_get(Eo *obj EINA_UNUSED,
+_ector_renderer_gradient_radial_efl_gfx_gradient_radial_center_get(const Eo *obj EINA_UNUSED,
Ector_Renderer_Gradient_Radial_Data *pd,
double *x, double *y)
{
@@ -34,7 +34,7 @@ _ector_renderer_gradient_radial_efl_gfx_gradient_radial_radius_set(Eo *obj EINA_
}
static double
-_ector_renderer_gradient_radial_efl_gfx_gradient_radial_radius_get(Eo *obj EINA_UNUSED,
+_ector_renderer_gradient_radial_efl_gfx_gradient_radial_radius_get(const Eo *obj EINA_UNUSED,
Ector_Renderer_Gradient_Radial_Data *pd)
{
return pd->radius;
@@ -51,7 +51,7 @@ _ector_renderer_gradient_radial_efl_gfx_gradient_radial_focal_set(Eo *obj EINA_U
}
static void
-_ector_renderer_gradient_radial_efl_gfx_gradient_radial_focal_get(Eo *obj EINA_UNUSED,
+_ector_renderer_gradient_radial_efl_gfx_gradient_radial_focal_get(const Eo *obj EINA_UNUSED,
Ector_Renderer_Gradient_Radial_Data *pd,
double *x, double *y)
{
diff --git a/src/lib/ector/ector_renderer_gradient_radial.eo b/src/lib/ector/ector_renderer_gradient_radial.eo
index ae6ffe05fb..c2c8542871 100644
--- a/src/lib/ector/ector_renderer_gradient_radial.eo
+++ b/src/lib/ector/ector_renderer_gradient_radial.eo
@@ -1,10 +1,10 @@
-mixin Ector.Renderer.Gradient.Radial (Efl.Gfx.Gradient.Radial)
+mixin Ector.Renderer.Gradient.Radial (Efl.Gfx.Gradient_Radial)
{
[[Ector gradient radial renderer mixin]]
eo_prefix: ector_renderer_gradient_radial;
implements {
- Efl.Gfx.Gradient.Radial.center { get; set; }
- Efl.Gfx.Gradient.Radial.radius { get; set; }
- Efl.Gfx.Gradient.Radial.focal { get; set; }
+ Efl.Gfx.Gradient_Radial.center { get; set; }
+ Efl.Gfx.Gradient_Radial.radius { get; set; }
+ Efl.Gfx.Gradient_Radial.focal { get; set; }
}
}
diff --git a/src/lib/ector/ector_renderer_shape.c b/src/lib/ector/ector_renderer_shape.c
index 3af47297f6..162add2613 100644
--- a/src/lib/ector/ector_renderer_shape.c
+++ b/src/lib/ector/ector_renderer_shape.c
@@ -16,7 +16,7 @@ _ector_renderer_shape_fill_set(Eo *obj EINA_UNUSED,
}
static const Ector_Renderer *
-_ector_renderer_shape_fill_get(Eo *obj EINA_UNUSED,
+_ector_renderer_shape_fill_get(const Eo *obj EINA_UNUSED,
Ector_Renderer_Shape_Data *pd)
{
return pd->fill;
@@ -31,7 +31,7 @@ _ector_renderer_shape_stroke_fill_set(Eo *obj EINA_UNUSED,
}
static const Ector_Renderer *
-_ector_renderer_shape_stroke_fill_get(Eo *obj EINA_UNUSED,
+_ector_renderer_shape_stroke_fill_get(const Eo *obj EINA_UNUSED,
Ector_Renderer_Shape_Data *pd)
{
return pd->stroke.fill;
@@ -46,7 +46,7 @@ _ector_renderer_shape_stroke_marker_set(Eo *obj EINA_UNUSED,
}
static const Ector_Renderer *
-_ector_renderer_shape_stroke_marker_get(Eo *obj EINA_UNUSED,
+_ector_renderer_shape_stroke_marker_get(const Eo *obj EINA_UNUSED,
Ector_Renderer_Shape_Data *pd)
{
return pd->stroke.marker;
diff --git a/src/lib/ector/ector_renderer_shape.eo b/src/lib/ector/ector_renderer_shape.eo
index 73d1676c9c..1a1a9ae240 100644
--- a/src/lib/ector/ector_renderer_shape.eo
+++ b/src/lib/ector/ector_renderer_shape.eo
@@ -6,34 +6,34 @@ mixin Ector.Renderer.Shape (Efl.Gfx.Shape)
eo_prefix: ector_renderer_shape;
methods {
@property fill {
- [[Fill property]]
+ [[Fill property]]
set {
- }
- get {
- }
- values {
- r: const(Ector.Renderer); [[Ector fill renderer]]
- }
+ }
+ get {
+ }
+ values {
+ r: const(Ector.Renderer); [[Ector fill renderer]]
+ }
}
@property stroke_fill {
- [[Stroke fill property]]
+ [[Stroke fill property]]
set {
- }
- get {
- }
- values {
- r: const(Ector.Renderer); [[Ector stroke fill renderer]]
- }
+ }
+ get {
+ }
+ values {
+ r: const(Ector.Renderer); [[Ector stroke fill renderer]]
+ }
}
@property stroke_marker {
- [[Stroke marker property]]
+ [[Stroke marker property]]
set {
- }
- get {
- }
- values {
- r: const(Ector.Renderer); [[Ector stroke marker renderer]]
- }
+ }
+ get {
+ }
+ values {
+ r: const(Ector.Renderer); [[Ector stroke marker renderer]]
+ }
}
}
}
diff --git a/src/lib/ector/gl/Ector_GL.h b/src/lib/ector/gl/Ector_GL.h
index d382ac25c3..131288a180 100644
--- a/src/lib/ector/gl/Ector_GL.h
+++ b/src/lib/ector/gl/Ector_GL.h
@@ -8,15 +8,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ECTOR_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EO_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -27,7 +27,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#ifdef EFL_BETA_API_SUPPORT
diff --git a/src/lib/ector/gl/ector_gl_surface.c b/src/lib/ector/gl/ector_gl_surface.c
index 60fba18fed..2f144e8612 100644
--- a/src/lib/ector/gl/ector_gl_surface.c
+++ b/src/lib/ector/gl/ector_gl_surface.c
@@ -45,11 +45,11 @@ _ector_gl_surface_ector_surface_renderer_factory_new(Eo *obj,
const Efl_Class *type)
{
if (type == ECTOR_RENDERER_SHAPE_MIXIN)
- return efl_add(ECTOR_RENDERER_GL_SHAPE_CLASS, NULL, ector_renderer_surface_set(efl_added, obj));
+ return efl_add_ref(ECTOR_RENDERER_GL_SHAPE_CLASS, NULL, ector_renderer_surface_set(efl_added, obj));
else if (type == ECTOR_RENDERER_GRADIENT_LINEAR_MIXIN)
- return efl_add(ECTOR_RENDERER_GL_GRADIENT_LINEAR_CLASS, NULL, ector_renderer_surface_set(efl_added, obj));
+ return efl_add_ref(ECTOR_RENDERER_GL_GRADIENT_LINEAR_CLASS, NULL, ector_renderer_surface_set(efl_added, obj));
else if (type == ECTOR_RENDERER_GRADIENT_RADIAL_MIXIN)
- return efl_add(ECTOR_RENDERER_GL_GRADIENT_RADIAL_CLASS, NULL, ector_renderer_surface_set(efl_added, obj));
+ return efl_add_ref(ECTOR_RENDERER_GL_GRADIENT_RADIAL_CLASS, NULL, ector_renderer_surface_set(efl_added, obj));
ERR("Couldn't find class for type: %s\n", efl_class_name_get(type));
return NULL;
diff --git a/src/lib/ector/gl/ector_gl_surface.eo b/src/lib/ector/gl/ector_gl_surface.eo
index 798befa70d..034a27a635 100644
--- a/src/lib/ector/gl/ector_gl_surface.eo
+++ b/src/lib/ector/gl/ector_gl_surface.eo
@@ -13,22 +13,22 @@ class Ector.GL.Surface (Ector.GL.Buffer, Ector.Surface)
}
}
push {
- [[Push surface to GPU]]
+ [[Push surface to GPU]]
return: bool; [[$true on success, $false otherwise]]
- params {
- @in flags: uint64; [[GL flags]]
- @in vertex: ptr(GLshort); [[GL vertex]]
- @in vertex_count: uint; [[GL vertex count]]
- @in mul_col: uint; [[Premultiplied color]]
- }
+ params {
+ @in flags: uint64; [[GL flags]]
+ @in vertex: ptr(GLshort); [[GL vertex]]
+ @in vertex_count: uint; [[GL vertex count]]
+ @in mul_col: uint; [[Premultiplied color]]
+ }
}
state_define {
- [[Define state]]
+ [[Define state]]
return: bool; [[$true on success, $false otherwise]]
- params {
+ params {
@in op: Efl.Gfx.Render_Op; [[Render operation]]
- @in clips: array<ptr(Eina.Rect)>; [[Array of @Eina.Rect clip]]
- }
+ @in clips: array<ptr(Eina.Rect)>; [[Array of @Eina.Rect clip]]
+ }
}
}
implements {
diff --git a/src/lib/ector/gl/ector_renderer_gl.eo b/src/lib/ector/gl/ector_renderer_gl.eo
index 592b5952fc..97941d28c2 100644
--- a/src/lib/ector/gl/ector_renderer_gl.eo
+++ b/src/lib/ector/gl/ector_renderer_gl.eo
@@ -4,15 +4,15 @@ abstract Ector.Renderer.GL (Ector.Renderer)
{
[[Ector GL renderer abstract class]]
methods {
- fill @pure_virtual {
- [[Fill operation]]
+ op_fill @pure_virtual {
+ [[Fill operation]]
return: bool; [[$true on success, $false otherwise]]
- params {
- @in flags: uint64; [[GL flags]]
- @in vertex: ptr(GLshort); [[GL vertex]]
- @in vertex_count: uint; [[GL vertex count]]
- @in mul_col: uint; [[Premultiplied color]]
- }
+ params {
+ @in flags: uint64; [[GL flags]]
+ @in vertex: ptr(GLshort); [[GL vertex]]
+ @in vertex_count: uint; [[GL vertex count]]
+ @in mul_col: uint; [[Premultiplied color]]
+ }
}
}
implements {
diff --git a/src/lib/ector/gl/ector_renderer_gl_gradient_linear.c b/src/lib/ector/gl/ector_renderer_gl_gradient_linear.c
index 87c5594b88..7557aab3a8 100644
--- a/src/lib/ector/gl/ector_renderer_gl_gradient_linear.c
+++ b/src/lib/ector/gl/ector_renderer_gl_gradient_linear.c
@@ -40,7 +40,7 @@ _ector_renderer_gl_gradient_linear_ector_renderer_draw(Eo *obj, Ector_Renderer_G
}
static void
-_ector_renderer_gl_gradient_linear_ector_renderer_bounds_get(Eo *obj EINA_UNUSED,
+_ector_renderer_gl_gradient_linear_efl_gfx_path_bounds_get(const Eo *obj EINA_UNUSED,
Ector_Renderer_GL_Gradient_Linear_Data *pd,
Eina_Rect *r)
{
@@ -52,7 +52,7 @@ _ector_renderer_gl_gradient_linear_ector_renderer_bounds_get(Eo *obj EINA_UNUSED
}
static Eina_Bool
-_ector_renderer_gl_gradient_linear_ector_renderer_gl_fill(Eo *obj, Ector_Renderer_GL_Gradient_Linear_Data *pd, uint64_t flags, GLshort *vertex, unsigned int vertex_count, unsigned int mul_col)
+_ector_renderer_gl_gradient_linear_ector_renderer_gl_op_fill(Eo *obj, Ector_Renderer_GL_Gradient_Linear_Data *pd, uint64_t flags, GLshort *vertex, unsigned int vertex_count, unsigned int mul_col)
{
// FIXME: The idea here is to select the right shader and push the needed parameter for it
// along with the other value
@@ -95,7 +95,7 @@ _ector_renderer_gl_gradient_linear_efl_gfx_gradient_stop_set(Eo *obj, Ector_Rend
}
static unsigned int
-_ector_renderer_gl_gradient_linear_ector_renderer_crc_get(Eo *obj, Ector_Renderer_GL_Gradient_Linear_Data *pd)
+_ector_renderer_gl_gradient_linear_ector_renderer_crc_get(const Eo *obj, Ector_Renderer_GL_Gradient_Linear_Data *pd)
{
unsigned int crc;
diff --git a/src/lib/ector/gl/ector_renderer_gl_gradient_linear.eo b/src/lib/ector/gl/ector_renderer_gl_gradient_linear.eo
index 33b1389b40..0623a8ebb9 100644
--- a/src/lib/ector/gl/ector_renderer_gl_gradient_linear.eo
+++ b/src/lib/ector/gl/ector_renderer_gl_gradient_linear.eo
@@ -1,13 +1,13 @@
-class Ector.Renderer.GL.Gradient.Linear (Ector.Renderer.GL, Ector.Renderer.Gradient, Ector.Renderer.Gradient.Linear)
+class Ector.Renderer.GL.Gradient.Linear (Ector.Renderer.GL, Ector.Renderer.Gradient, Ector.Renderer.Gradient.Linear, Efl.Gfx.Path)
{
[[Ector GL renderer gradient linear]]
eo_prefix: ector_renderer_gl_gradient_linear;
implements {
Ector.Renderer.prepare;
Ector.Renderer.draw;
- Ector.Renderer.bounds_get;
+ Efl.Gfx.Path.bounds_get;
Ector.Renderer.crc { get; }
- Ector.Renderer.GL.fill;
+ Ector.Renderer.GL.op_fill;
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Gfx.Gradient.stop { set; }
diff --git a/src/lib/ector/gl/ector_renderer_gl_gradient_radial.c b/src/lib/ector/gl/ector_renderer_gl_gradient_radial.c
index 827b120600..6a1b41e2bf 100644
--- a/src/lib/ector/gl/ector_renderer_gl_gradient_radial.c
+++ b/src/lib/ector/gl/ector_renderer_gl_gradient_radial.c
@@ -39,7 +39,7 @@ _ector_renderer_gl_gradient_radial_ector_renderer_draw(Eo *obj, Ector_Renderer_G
}
static Eina_Bool
-_ector_renderer_gl_gradient_radial_ector_renderer_gl_fill(Eo *obj, Ector_Renderer_GL_Gradient_Radial_Data *pd, uint64_t flags, GLshort *vertex, unsigned int vertex_count, unsigned int mul_col)
+_ector_renderer_gl_gradient_radial_ector_renderer_gl_op_fill(Eo *obj, Ector_Renderer_GL_Gradient_Radial_Data *pd, uint64_t flags, GLshort *vertex, unsigned int vertex_count, unsigned int mul_col)
{
// FIXME: The idea here is to select the right shader and push the needed parameter for it
// along with the other value
@@ -54,7 +54,7 @@ _ector_renderer_gl_gradient_radial_ector_renderer_gl_fill(Eo *obj, Ector_Rendere
}
static void
-_ector_renderer_gl_gradient_radial_ector_renderer_bounds_get(Eo *obj EINA_UNUSED,
+_ector_renderer_gl_gradient_radial_efl_gfx_path_bounds_get(const Eo *obj EINA_UNUSED,
Ector_Renderer_GL_Gradient_Radial_Data *pd,
Eina_Rect *r)
{
@@ -65,7 +65,7 @@ _ector_renderer_gl_gradient_radial_ector_renderer_bounds_get(Eo *obj EINA_UNUSED
}
static unsigned int
-_ector_renderer_gl_gradient_radial_ector_renderer_crc_get(Eo *obj, Ector_Renderer_GL_Gradient_Radial_Data *pd)
+_ector_renderer_gl_gradient_radial_ector_renderer_crc_get(const Eo *obj, Ector_Renderer_GL_Gradient_Radial_Data *pd)
{
unsigned int crc;
diff --git a/src/lib/ector/gl/ector_renderer_gl_gradient_radial.eo b/src/lib/ector/gl/ector_renderer_gl_gradient_radial.eo
index 47bfb400eb..954ecbc079 100644
--- a/src/lib/ector/gl/ector_renderer_gl_gradient_radial.eo
+++ b/src/lib/ector/gl/ector_renderer_gl_gradient_radial.eo
@@ -1,13 +1,13 @@
-class Ector.Renderer.GL.Gradient.Radial (Ector.Renderer.GL, Ector.Renderer.Gradient, Ector.Renderer.Gradient.Radial)
+class Ector.Renderer.GL.Gradient.Radial (Ector.Renderer.GL, Ector.Renderer.Gradient, Ector.Renderer.Gradient.Radial, Efl.Gfx.Path)
{
[[Ector GL renderer gradient radial]]
eo_prefix: ector_renderer_gl_gradient_radial;
implements {
Ector.Renderer.prepare;
Ector.Renderer.draw;
- Ector.Renderer.bounds_get;
+ Efl.Gfx.Path.bounds_get;
Ector.Renderer.crc { get; }
- Ector.Renderer.GL.fill;
+ Ector.Renderer.GL.op_fill;
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Gfx.Gradient.stop { set; }
diff --git a/src/lib/ector/gl/ector_renderer_gl_shape.c b/src/lib/ector/gl/ector_renderer_gl_shape.c
index ecf78faec1..79e029d1fd 100644
--- a/src/lib/ector/gl/ector_renderer_gl_shape.c
+++ b/src/lib/ector/gl/ector_renderer_gl_shape.c
@@ -44,7 +44,7 @@ _ector_renderer_gl_shape_ector_renderer_prepare(Eo *obj, Ector_Renderer_GL_Shape
r = ector_renderer_prepare(efl_super(obj, ECTOR_RENDERER_GL_SHAPE_CLASS));
- ector_renderer_bounds_get(obj, &bounding_box);
+ efl_gfx_path_bounds_get(obj, &bounding_box);
pd->vertex = malloc(sizeof (GLshort) * 6 * 3);
@@ -85,7 +85,7 @@ _ector_renderer_gl_shape_ector_renderer_draw(Eo *obj, Ector_Renderer_GL_Shape_Da
if (pd->shape->fill)
{
- ector_renderer_gl_fill(pd->shape->fill, flags, pd->vertex, 6, mul_col);
+ ector_renderer_gl_op_fill(pd->shape->fill, flags, pd->vertex, 6, mul_col);
}
else
{
@@ -96,7 +96,7 @@ _ector_renderer_gl_shape_ector_renderer_draw(Eo *obj, Ector_Renderer_GL_Shape_Da
}
static Eina_Bool
-_ector_renderer_gl_shape_ector_renderer_gl_fill(Eo *obj EINA_UNUSED,
+_ector_renderer_gl_shape_ector_renderer_gl_op_fill(Eo *obj EINA_UNUSED,
Ector_Renderer_GL_Shape_Data *pd EINA_UNUSED,
uint64_t flags EINA_UNUSED,
GLshort *vertex EINA_UNUSED,
@@ -110,7 +110,7 @@ _ector_renderer_gl_shape_ector_renderer_gl_fill(Eo *obj EINA_UNUSED,
}
static void
-_ector_renderer_gl_shape_ector_renderer_bounds_get(Eo *obj, Ector_Renderer_GL_Shape_Data *pd, Eina_Rect *r)
+_ector_renderer_gl_shape_efl_gfx_path_bounds_get(const Eo *obj, Ector_Renderer_GL_Shape_Data *pd, Eina_Rect *r)
{
efl_gfx_path_bounds_get(obj, r);
@@ -119,7 +119,7 @@ _ector_renderer_gl_shape_ector_renderer_bounds_get(Eo *obj, Ector_Renderer_GL_Sh
}
static unsigned int
-_ector_renderer_gl_shape_ector_renderer_crc_get(Eo *obj, Ector_Renderer_GL_Shape_Data *pd)
+_ector_renderer_gl_shape_ector_renderer_crc_get(const Eo *obj, Ector_Renderer_GL_Shape_Data *pd)
{
unsigned int crc;
diff --git a/src/lib/ector/gl/ector_renderer_gl_shape.eo b/src/lib/ector/gl/ector_renderer_gl_shape.eo
index f3882e1315..21ef655d7c 100644
--- a/src/lib/ector/gl/ector_renderer_gl_shape.eo
+++ b/src/lib/ector/gl/ector_renderer_gl_shape.eo
@@ -1,13 +1,13 @@
-class Ector.Renderer.GL.Shape (Ector.Renderer.GL, Ector.Renderer.Shape)
+class Ector.Renderer.GL.Shape (Ector.Renderer.GL, Ector.Renderer.Shape, Efl.Gfx.Path)
{
[[Ector GL renderer shape class]]
eo_prefix: ector_renderer_gl_shape;
implements {
Ector.Renderer.prepare;
Ector.Renderer.draw;
- Ector.Renderer.bounds_get;
Ector.Renderer.crc { get; }
- Ector.Renderer.GL.fill;
+ Ector.Renderer.GL.op_fill;
+ Efl.Gfx.Path.bounds_get;
Efl.Object.constructor;
Efl.Object.destructor;
}
diff --git a/src/lib/ector/software/Ector_Software.h b/src/lib/ector/software/Ector_Software.h
index 1a43a2955f..2f9192ff30 100644
--- a/src/lib/ector/software/Ector_Software.h
+++ b/src/lib/ector/software/Ector_Software.h
@@ -8,15 +8,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ECTOR_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EO_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -27,7 +27,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#ifdef EFL_BETA_API_SUPPORT
diff --git a/src/lib/ector/software/ector_renderer_software.eo b/src/lib/ector/software/ector_renderer_software.eo
index 16772100a2..46251e3a4b 100644
--- a/src/lib/ector/software/ector_renderer_software.eo
+++ b/src/lib/ector/software/ector_renderer_software.eo
@@ -3,8 +3,8 @@ class Ector.Renderer.Software (Ector.Renderer)
[[Ector software renderer class]]
data: null;
methods {
- fill @pure_virtual {
- [[Renderer fill operation]]
+ op_fill @pure_virtual {
+ [[Renderer fill operation]]
return: bool; [[$true on success, $false otherwise]]
}
}
diff --git a/src/lib/ector/software/ector_renderer_software_gradient_linear.c b/src/lib/ector/software/ector_renderer_software_gradient_linear.c
index f024594ea2..999feedc42 100644
--- a/src/lib/ector/software/ector_renderer_software_gradient_linear.c
+++ b/src/lib/ector/software/ector_renderer_software_gradient_linear.c
@@ -54,7 +54,7 @@ _ector_renderer_software_gradient_linear_ector_renderer_draw(Eo *obj EINA_UNUSED
}
static Eina_Bool
-_ector_renderer_software_gradient_linear_ector_renderer_software_fill(Eo *obj EINA_UNUSED,
+_ector_renderer_software_gradient_linear_ector_renderer_software_op_fill(Eo *obj EINA_UNUSED,
Ector_Renderer_Software_Gradient_Data *pd)
{
ector_software_rasterizer_linear_gradient_set(pd->surface->rasterizer, pd);
@@ -102,7 +102,7 @@ _ector_renderer_software_gradient_linear_efl_gfx_gradient_stop_set(Eo *obj, Ecto
}
static unsigned int
-_ector_renderer_software_gradient_linear_ector_renderer_crc_get(Eo *obj, Ector_Renderer_Software_Gradient_Data *pd)
+_ector_renderer_software_gradient_linear_ector_renderer_crc_get(const Eo *obj, Ector_Renderer_Software_Gradient_Data *pd)
{
unsigned int crc;
diff --git a/src/lib/ector/software/ector_renderer_software_gradient_linear.eo b/src/lib/ector/software/ector_renderer_software_gradient_linear.eo
index 666ff7a05f..5cc4bdf7f2 100644
--- a/src/lib/ector/software/ector_renderer_software_gradient_linear.eo
+++ b/src/lib/ector/software/ector_renderer_software_gradient_linear.eo
@@ -7,7 +7,7 @@ class Ector.Renderer.Software.Gradient.Linear (Ector.Renderer.Software, Ector.Re
Ector.Renderer.prepare;
Ector.Renderer.draw;
Ector.Renderer.crc { get; }
- Ector.Renderer.Software.fill;
+ Ector.Renderer.Software.op_fill;
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Gfx.Gradient.stop { set; }
diff --git a/src/lib/ector/software/ector_renderer_software_gradient_radial.c b/src/lib/ector/software/ector_renderer_software_gradient_radial.c
index d28ed0ce74..989bcaadbe 100644
--- a/src/lib/ector/software/ector_renderer_software_gradient_radial.c
+++ b/src/lib/ector/software/ector_renderer_software_gradient_radial.c
@@ -66,7 +66,7 @@ _ector_renderer_software_gradient_radial_ector_renderer_draw(Eo *obj EINA_UNUSED
// Clearly duplicated and should be in a common place...
static Eina_Bool
-_ector_renderer_software_gradient_radial_ector_renderer_software_fill(Eo *obj EINA_UNUSED, Ector_Renderer_Software_Gradient_Data *pd)
+_ector_renderer_software_gradient_radial_ector_renderer_software_op_fill(Eo *obj EINA_UNUSED, Ector_Renderer_Software_Gradient_Data *pd)
{
ector_software_rasterizer_radial_gradient_set(pd->surface->rasterizer, pd);
ector_software_gradient_color_update(pd);
@@ -111,7 +111,7 @@ _ector_renderer_software_gradient_radial_efl_gfx_gradient_stop_set(Eo *obj, Ecto
}
static unsigned int
-_ector_renderer_software_gradient_radial_ector_renderer_crc_get(Eo *obj, Ector_Renderer_Software_Gradient_Data *pd)
+_ector_renderer_software_gradient_radial_ector_renderer_crc_get(const Eo *obj, Ector_Renderer_Software_Gradient_Data *pd)
{
unsigned int crc;
diff --git a/src/lib/ector/software/ector_renderer_software_gradient_radial.eo b/src/lib/ector/software/ector_renderer_software_gradient_radial.eo
index 6de4786c8b..f05ea41a67 100644
--- a/src/lib/ector/software/ector_renderer_software_gradient_radial.eo
+++ b/src/lib/ector/software/ector_renderer_software_gradient_radial.eo
@@ -7,7 +7,7 @@ class Ector.Renderer.Software.Gradient.Radial (Ector.Renderer.Software, Ector.Re
Ector.Renderer.prepare;
Ector.Renderer.draw;
Ector.Renderer.crc { get; }
- Ector.Renderer.Software.fill;
+ Ector.Renderer.Software.op_fill;
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Gfx.Gradient.stop { set; }
diff --git a/src/lib/ector/software/ector_renderer_software_shape.c b/src/lib/ector/software/ector_renderer_software_shape.c
index e60e1d6e95..d762c0e325 100644
--- a/src/lib/ector/software/ector_renderer_software_shape.c
+++ b/src/lib/ector/software/ector_renderer_software_shape.c
@@ -673,7 +673,7 @@ _ector_renderer_software_shape_ector_renderer_draw(Eo *obj,
if (pd->shape->fill)
{
- ector_renderer_software_fill(pd->shape->fill);
+ ector_renderer_software_op_fill(pd->shape->fill);
ector_software_rasterizer_draw_rle_data(pd->surface->rasterizer,
x, y, mul_col, op,
pd->shape_data);
@@ -695,7 +695,7 @@ _ector_renderer_software_shape_ector_renderer_draw(Eo *obj,
if (pd->shape->stroke.fill)
{
- ector_renderer_software_fill(pd->shape->stroke.fill);
+ ector_renderer_software_op_fill(pd->shape->stroke.fill);
ector_software_rasterizer_draw_rle_data(pd->surface->rasterizer,
x, y, mul_col, op,
pd->outline_data);
@@ -719,7 +719,7 @@ _ector_renderer_software_shape_ector_renderer_draw(Eo *obj,
}
static Eina_Bool
-_ector_renderer_software_shape_ector_renderer_software_fill(Eo *obj EINA_UNUSED,
+_ector_renderer_software_shape_ector_renderer_software_op_fill(Eo *obj EINA_UNUSED,
Ector_Renderer_Software_Shape_Data *pd EINA_UNUSED)
{
// FIXME: let's find out how to fill a shape with a shape later.
@@ -797,7 +797,7 @@ _ector_renderer_software_shape_efl_object_destructor(Eo *obj, Ector_Renderer_Sof
unsigned int
-_ector_renderer_software_shape_ector_renderer_crc_get(Eo *obj,
+_ector_renderer_software_shape_ector_renderer_crc_get(const Eo *obj,
Ector_Renderer_Software_Shape_Data *pd)
{
unsigned int crc;
diff --git a/src/lib/ector/software/ector_renderer_software_shape.eo b/src/lib/ector/software/ector_renderer_software_shape.eo
index 1382c6adf7..97b15ca153 100644
--- a/src/lib/ector/software/ector_renderer_software_shape.eo
+++ b/src/lib/ector/software/ector_renderer_software_shape.eo
@@ -5,7 +5,7 @@ class Ector.Renderer.Software.Shape (Ector.Renderer.Software, Ector.Renderer.Sha
implements {
Ector.Renderer.prepare;
Ector.Renderer.draw;
- Ector.Renderer.Software.fill;
+ Ector.Renderer.Software.op_fill;
Ector.Renderer.crc { get; }
Efl.Gfx.Path.path { set; }
Efl.Object.constructor;
diff --git a/src/lib/ector/software/ector_software_buffer.c b/src/lib/ector/software/ector_software_buffer.c
index d44962bbec..e8981281f5 100644
--- a/src/lib/ector/software/ector_software_buffer.c
+++ b/src/lib/ector/software/ector_software_buffer.c
@@ -71,10 +71,10 @@ on_fail:
EOLIAN static Eina_Bool
_ector_software_buffer_base_ector_buffer_pixels_set(Eo *obj, Ector_Software_Buffer_Base_Data *pd,
- void *pixels, int width, int height,
+ void *pixels, int width, int height, int stride,
Efl_Gfx_Colorspace cspace, Eina_Bool writable)
{
- unsigned pxs, stride;
+ unsigned pxs;
if (pd->generic->immutable)
fail("This buffer is immutable.");
@@ -92,7 +92,11 @@ _ector_software_buffer_base_ector_buffer_pixels_set(Eo *obj, Ector_Software_Buff
if (((unsigned long long)(uintptr_t)pixels) & (pxs - 1))
fail ("Pixel data is not aligned to %u bytes!", pxs);
- stride = width * pxs;
+ if (stride == 0)
+ stride = width * pxs;
+ else if (stride < (int)(width * pxs))
+ fail ("Stride is less than minimum stride: provided %u bytes, minimum %u bytes!", stride, (width * pxs));
+
if (pd->pixels.u8 && (pd->pixels.u8 != pixels))
_ector_software_buffer_base_pixels_clear(obj, pd);
@@ -277,7 +281,7 @@ _ector_software_buffer_base_ector_buffer_unmap(Eo *obj EINA_UNUSED, Ector_Softwa
}
EOLIAN static Ector_Buffer_Flag
-_ector_software_buffer_base_ector_buffer_flags_get(Eo *obj EINA_UNUSED, Ector_Software_Buffer_Base_Data *pd)
+_ector_software_buffer_base_ector_buffer_flags_get(const Eo *obj EINA_UNUSED, Ector_Software_Buffer_Base_Data *pd)
{
return ECTOR_BUFFER_FLAG_CPU_READABLE |
ECTOR_BUFFER_FLAG_DRAWABLE |
diff --git a/src/lib/ector/software/ector_software_surface.c b/src/lib/ector/software/ector_software_surface.c
index e3e72fbd2d..2907272f40 100644
--- a/src/lib/ector/software/ector_software_surface.c
+++ b/src/lib/ector/software/ector_software_surface.c
@@ -201,11 +201,11 @@ _ector_software_surface_ector_surface_renderer_factory_new(Eo *obj,
const Efl_Class *type)
{
if (type == ECTOR_RENDERER_SHAPE_MIXIN)
- return efl_add(ECTOR_RENDERER_SOFTWARE_SHAPE_CLASS, NULL, ector_renderer_surface_set(efl_added, obj));
+ return efl_add_ref(ECTOR_RENDERER_SOFTWARE_SHAPE_CLASS, NULL, ector_renderer_surface_set(efl_added, obj));
else if (type == ECTOR_RENDERER_GRADIENT_LINEAR_MIXIN)
- return efl_add(ECTOR_RENDERER_SOFTWARE_GRADIENT_LINEAR_CLASS, NULL, ector_renderer_surface_set(efl_added, obj));
+ return efl_add_ref(ECTOR_RENDERER_SOFTWARE_GRADIENT_LINEAR_CLASS, NULL, ector_renderer_surface_set(efl_added, obj));
else if (type == ECTOR_RENDERER_GRADIENT_RADIAL_MIXIN)
- return efl_add(ECTOR_RENDERER_SOFTWARE_GRADIENT_RADIAL_CLASS, NULL, ector_renderer_surface_set(efl_added, obj));
+ return efl_add_ref(ECTOR_RENDERER_SOFTWARE_GRADIENT_RADIAL_CLASS, NULL, ector_renderer_surface_set(efl_added, obj));
ERR("Couldn't find class for type: %s", efl_class_name_get(type));
return NULL;
diff --git a/src/lib/edje/Edje.h b/src/lib/edje/Edje.h
index 82f3cbac2d..6f64c64293 100644
--- a/src/lib/edje/Edje.h
+++ b/src/lib/edje/Edje.h
@@ -221,15 +221,15 @@ param in edje programs
#endif
#ifdef _WIN32
-# ifdef EFL_EDJE_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EDJE_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
diff --git a/src/lib/edje/Edje_Common.h b/src/lib/edje/Edje_Common.h
index b86ed7e851..60ec169708 100644
--- a/src/lib/edje/Edje_Common.h
+++ b/src/lib/edje/Edje_Common.h
@@ -2110,6 +2110,24 @@ EAPI const char *edje_object_part_object_name_get(const Evas_Object *obj);
*/
EAPI Eina_Bool edje_3d_object_add(Evas_Object *obj, Eo **root_node, Eo *scene);
+/**
+ * @brief Gets seat data passed to callbacks.
+ *
+ * @return The seat data for that callback.
+ *
+ * When a callback is initiated by an input event from a seat, we try to
+ * provide seat information with it.
+ *
+ * Signals fired as programmed responses to these signals will also try
+ * to carry the seat data along.
+ *
+ * This returns an opaque pointer to the seat data.
+ *
+ * @see edje_object_signal_callback_add() for more on Edje signals.
+ * @since 1.21
+ */
+EAPI void *edje_object_signal_callback_seat_data_get(void);
+
#endif
/**
diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h
index 7bb5a07c1f..d30b28e063 100644
--- a/src/lib/edje/Edje_Edit.h
+++ b/src/lib/edje/Edje_Edit.h
@@ -12,15 +12,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_EDJE_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EDJE_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
diff --git a/src/lib/edje/Edje_Legacy.h b/src/lib/edje/Edje_Legacy.h
index b7350114d4..581e2f9eb9 100644
--- a/src/lib/edje/Edje_Legacy.h
+++ b/src/lib/edje/Edje_Legacy.h
@@ -2733,6 +2733,35 @@ EAPI Eina_Bool edje_object_part_text_input_panel_show_on_demand_get(const Evas_O
EAPI void edje_object_part_text_prediction_hint_set(Evas_Object *obj, const char *part, const char *prediction_hint);
/**
+ * @brief Sets the prediction hint data at the specified key.
+ *
+ * @param[in] part The part name
+ * @param[in] key The key of the prediction hint
+ * @param[in] value The data to replace
+ *
+ * @return @c true on success, @c false otherwise
+ *
+ * @since 1.21.0
+ *
+ * @ingroup Edje_Object
+ */
+EAPI Eina_Bool edje_object_part_text_prediction_hint_hash_set(Evas_Object *obj, const char *part, const char *key, const char *value);
+
+/**
+ * @brief Removes the prediction hint data identified by a key
+ *
+ * @param[in] part The part name
+ * @param[in] key The key of the prediction hint
+ *
+ * @return @c true on success, @c false otherwise
+ *
+ * @since 1.21.0
+ *
+ * @ingroup Edje_Object
+ */
+EAPI Eina_Bool edje_object_part_text_prediction_hint_hash_del(Evas_Object *obj, const char *part, const char *key);
+
+/**
* @brief Starts selecting at current cursor position
*
* @param[in] part The part name
@@ -3085,6 +3114,22 @@ EAPI const Edje_Perspective *edje_object_perspective_get(const Evas_Object *obj)
*/
+/**
+ * @brief Sets the function that provides item objects for named items in an
+ * edje entry text
+ *
+ * Item objects may be deleted any time by Edje, and will be deleted when the
+ * Edje object is deleted (or file is set to a new file).
+ *
+ * @param[in] obj The object.
+ * @param[in] func The function to call (or @c null to disable) to get item
+ * objects
+ * @param[in] data The data pointer to pass to the func callback
+ *
+ * @ingroup Edje_Object
+ */
+EAPI void edje_object_item_provider_set(Edje_Object *obj, Edje_Item_Provider_Cb func, void *data);
+
typedef Efl_Canvas_Layout_Part_Type Edje_Part_Type;
#define EDJE_PART_TYPE_NONE EFL_CANVAS_LAYOUT_PART_TYPE_NONE
#define EDJE_PART_TYPE_RECTANGLE EFL_CANVAS_LAYOUT_PART_TYPE_RECTANGLE
diff --git a/src/lib/edje/edje_cache.c b/src/lib/edje/edje_cache.c
index 22414df4e9..23ced3c684 100644
--- a/src/lib/edje/edje_cache.c
+++ b/src/lib/edje/edje_cache.c
@@ -1,7 +1,9 @@
#include "edje_private.h"
Eina_Hash *_edje_file_hash = NULL;
+Eina_Hash *_edje_id_hash = NULL;
+static Eina_Hash *_edje_requires_pending;
static int _edje_file_cache_size = 16;
static Eina_List *_edje_file_cache = NULL;
@@ -387,6 +389,46 @@ _edje_file_open(const Eina_File *f, int *error_ret, time_t mtime, Eina_Bool coll
if (sc->name)
eina_hash_direct_add(edf->size_hash, sc->name, sc);
+ if (edf->requires_count)
+ {
+ unsigned int i;
+ Edje_File *required_edf;
+ char **requires = (char**)edf->requires;
+
+ /* EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY_STRING returns an mmapped blob, not stringshares */
+ edf->requires = malloc(edf->requires_count * sizeof(char*));
+ for (i = 0; i < edf->requires_count; i++)
+ {
+ char *str = (char*)requires[i];
+
+ edf->requires[i] = eina_stringshare_add(str);
+ required_edf = eina_hash_find(_edje_id_hash, edf->requires[i]);
+ if (required_edf)
+ {
+ required_edf->references++;
+ continue;
+ }
+ ERR("edje file '%s' REQUIRES file '%s' which is not loaded", edf->path, edf->requires[i]);
+ if (!_edje_requires_pending)
+ _edje_requires_pending = eina_hash_stringshared_new(NULL);
+ eina_hash_list_append(_edje_requires_pending, edf->requires[i], edf);
+ }
+ free(requires);
+ }
+ if (_edje_requires_pending && edf->id)
+ {
+ l = eina_hash_set(_edje_requires_pending, edf->id, NULL);
+
+ edf->references += eina_list_count(l);
+ eina_list_free(l);
+
+ if (!eina_hash_population(_edje_requires_pending))
+ {
+ eina_hash_free(_edje_requires_pending);
+ _edje_requires_pending = NULL;
+ }
+ }
+
return edf;
}
@@ -416,6 +458,8 @@ _edje_cache_file_coll_open(const Eina_File *file, const char *coll, int *error_r
Edje_Part_Collection *edc;
Edje_Part *ep;
+ if (!_edje_id_hash)
+ _edje_id_hash = eina_hash_stringshared_new(NULL);
if (!_edje_file_hash)
{
_edje_file_hash = eina_hash_pointer_new(NULL);
@@ -445,6 +489,8 @@ find_list:
if (!edf) return NULL;
eina_hash_direct_add(_edje_file_hash, &edf->f, edf);
+ if (edf->id)
+ eina_hash_list_append(_edje_id_hash, edf->id, edf);
/* return edf; */
open:
@@ -648,12 +694,41 @@ _edje_cache_file_unref(Edje_File *edf)
edf->references--;
if (edf->references != 0) return;
+ if (edf->requires_count)
+ {
+ unsigned int i;
+
+ for (i = 0; i < edf->requires_count; i++)
+ {
+ Edje_File *required_edf = eina_hash_find(_edje_id_hash, edf->requires[i]);
+
+ if (required_edf)
+ _edje_cache_file_unref(edf);
+ else if (_edje_requires_pending)
+ {
+ eina_hash_list_remove(_edje_requires_pending, edf->requires[i], edf);
+ if (!eina_hash_population(_edje_requires_pending))
+ {
+ eina_hash_free(_edje_requires_pending);
+ _edje_requires_pending = NULL;
+ }
+ }
+ }
+ }
+
if (edf->dangling)
{
_edje_file_free(edf);
return;
}
+ if (edf->id)
+ eina_hash_list_remove(_edje_id_hash, edf->id, edf);
+ if (!eina_hash_population(_edje_id_hash))
+ {
+ eina_hash_free(_edje_id_hash);
+ _edje_id_hash = NULL;
+ }
eina_hash_del(_edje_file_hash, &edf->f, edf);
if (!eina_hash_population(_edje_file_hash))
{
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c
index 64b95ed72e..40bdbd54f3 100644
--- a/src/lib/edje/edje_calc.c
+++ b/src/lib/edje/edje_calc.c
@@ -597,6 +597,100 @@ _edje_image_find(Evas_Object *obj, Edje *ed, Edje_Real_Part_Set **eps,
}
static void
+_edje_real_part_image_error_check(Edje_Real_Part *ep)
+{
+ switch (evas_object_image_load_error_get(ep->object))
+ {
+ case EVAS_LOAD_ERROR_GENERIC:
+ ERR("Error type: EVAS_LOAD_ERROR_GENERIC");
+ break;
+
+ case EVAS_LOAD_ERROR_DOES_NOT_EXIST:
+ ERR("Error type: EVAS_LOAD_ERROR_DOES_NOT_EXIST");
+ break;
+
+ case EVAS_LOAD_ERROR_PERMISSION_DENIED:
+ ERR("Error type: EVAS_LOAD_ERROR_PERMISSION_DENIED");
+ break;
+
+ case EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED:
+ ERR("Error type: EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED");
+ break;
+
+ case EVAS_LOAD_ERROR_CORRUPT_FILE:
+ ERR("Error type: EVAS_LOAD_ERROR_CORRUPT_FILE");
+ break;
+
+ case EVAS_LOAD_ERROR_UNKNOWN_FORMAT:
+ ERR("Error type: EVAS_LOAD_ERROR_UNKNOWN_FORMAT");
+ break;
+
+ default:
+ ERR("Error type: ???");
+ break;
+ }
+}
+
+static Eina_Bool
+_edje_real_part_image_internal_set(Edje_File *edf, Edje_Real_Part *ep, int image_id)
+{
+ char buf[1024] = "edje/images/";
+
+ /* Replace snprint("edje/images/%i") == memcpy + itoa */
+ eina_convert_itoa(image_id, buf + 12); /* No need to check length as 2³² need only 10 characteres. */
+
+ evas_object_image_mmap_set(ep->object, edf->f, buf);
+ if (evas_object_image_load_error_get(ep->object) != EVAS_LOAD_ERROR_NONE)
+ {
+ ERR("Error loading image collection \"%s\" from "
+ "file \"%s\". Missing EET Evas loader module?",
+ buf, edf->path);
+ _edje_real_part_image_error_check(ep);
+ return EINA_FALSE;
+ }
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_edje_real_part_image_external_set(Edje_File *edf, Edje_Real_Part *ep, int image_id)
+{
+ Edje_Image_Directory_Entry *ie;
+
+ if (!edf->image_dir) return EINA_FALSE;
+ ie = edf->image_dir->entries + (-image_id) - 1;
+ if ((ie) &&
+ (ie->source_type == EDJE_IMAGE_SOURCE_TYPE_USER) &&
+ (ie->entry))
+ {
+ evas_object_image_file_set(ep->object, ie->entry, NULL);
+ _edje_real_part_image_error_check(ep);
+ return EINA_TRUE;
+ }
+ else if ((ie) &&
+ (ie->source_type == EDJE_IMAGE_SOURCE_TYPE_EXTERNAL) &&
+ (ie->entry))
+ {
+ Edje_File *edff;
+ Eina_List *l, *ll;
+
+ l = eina_hash_find(_edje_id_hash, ie->external_id);
+ EINA_LIST_FOREACH(l, ll, edff)
+ {
+ Edje_Image_Hash *eih = eina_hash_find(edff->image_id_hash, ie->entry);
+
+ if (!eih) continue;
+ if (eih->id < 0)
+ return _edje_real_part_image_external_set(edff, ep, eih->id);
+ else
+ _edje_real_part_image_internal_set(edff, ep, eih->id);
+ return EINA_TRUE;
+ }
+ return EINA_FALSE;
+ }
+ return EINA_FALSE;
+}
+
+static void
_edje_real_part_image_set(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part_Set **set, FLOAT_T pos)
{
int image_id;
@@ -609,16 +703,7 @@ _edje_real_part_image_set(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part_Set **set
if (set) *set = ep->param1.set;
if (image_id < 0)
{
- Edje_Image_Directory_Entry *ie;
-
- if (!ed->file->image_dir) ie = NULL;
- else ie = ed->file->image_dir->entries + (-image_id) - 1;
- if ((ie) &&
- (ie->source_type == EDJE_IMAGE_SOURCE_TYPE_EXTERNAL) &&
- (ie->entry))
- {
- evas_object_image_file_set(ep->object, ie->entry, NULL);
- }
+ _edje_real_part_image_external_set(ed->file, ep, image_id);
}
else
{
@@ -659,58 +744,18 @@ _edje_real_part_image_set(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part_Set **set
}
if (image_id < 0)
{
- ERR("Part \"%s\" description, "
- "\"%s\" %3.3f with image %i index has a missing image id in a set of %i !!!",
- ep->part->name,
- ep->param1.description->state.name,
- ep->param1.description->state.value,
- image_num,
- image_count);
+ if (!_edje_real_part_image_external_set(ed->file, ep, image_id))
+ ERR("Part \"%s\" description, "
+ "\"%s\" %3.3f with image %i index has a missing image id in a set of %i !!!",
+ ep->part->name,
+ ep->param1.description->state.name,
+ ep->param1.description->state.value,
+ image_num,
+ image_count);
}
else
{
- char buf[1024] = "edje/images/";
-
- /* Replace snprint("edje/images/%i") == memcpy + itoa */
- eina_convert_itoa(image_id, buf + 12); /* No need to check length as 2³² need only 10 characteres. */
-
- evas_object_image_mmap_set(ep->object, ed->file->f, buf);
- if (evas_object_image_load_error_get(ep->object) != EVAS_LOAD_ERROR_NONE)
- {
- ERR("Error loading image collection \"%s\" from "
- "file \"%s\". Missing EET Evas loader module?",
- buf, ed->file->path);
- switch (evas_object_image_load_error_get(ep->object))
- {
- case EVAS_LOAD_ERROR_GENERIC:
- ERR("Error type: EVAS_LOAD_ERROR_GENERIC");
- break;
-
- case EVAS_LOAD_ERROR_DOES_NOT_EXIST:
- ERR("Error type: EVAS_LOAD_ERROR_DOES_NOT_EXIST");
- break;
-
- case EVAS_LOAD_ERROR_PERMISSION_DENIED:
- ERR("Error type: EVAS_LOAD_ERROR_PERMISSION_DENIED");
- break;
-
- case EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED:
- ERR("Error type: EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED");
- break;
-
- case EVAS_LOAD_ERROR_CORRUPT_FILE:
- ERR("Error type: EVAS_LOAD_ERROR_CORRUPT_FILE");
- break;
-
- case EVAS_LOAD_ERROR_UNKNOWN_FORMAT:
- ERR("Error type: EVAS_LOAD_ERROR_UNKNOWN_FORMAT");
- break;
-
- default:
- ERR("Error type: ???");
- break;
- }
- }
+ _edje_real_part_image_internal_set(ed->file, ep, image_id);
}
}
}
@@ -1083,7 +1128,8 @@ _edje_dragable_pos_set(Edje *ed, Edje_Real_Part *ep, FLOAT_T x, FLOAT_T y)
* value we would set foo to, because it would depend on the
* size of the dragable...
*/
- evas_object_geometry_get(ep->object, &ex, &ey, NULL, NULL);
+ if (ep->object)
+ evas_object_geometry_get(ep->object, &ex, &ey, NULL, NULL);
if (NEQ(ep->drag->x, x) || ep->drag->tmp.x)
{
@@ -1502,7 +1548,7 @@ _edje_part_recalc_single_text(FLOAT_T sc EINA_UNUSED,
return;
// Note: No need to add padding to that, it's already in the geometry
- sz = efl_gfx_size_get(ep->object);
+ sz = efl_gfx_entity_size_get(ep->object);
mw = sz.w;
mh = sz.h;
@@ -1670,7 +1716,7 @@ _edje_part_recalc_single_text(FLOAT_T sc EINA_UNUSED,
evas_obj_text_style_set(ep->object, style);
evas_obj_text_set(ep->object, text);
- ts = efl_gfx_size_get(ep->object);
+ ts = efl_gfx_entity_size_get(ep->object);
if (chosen_desc->text.max_x)
{
int l, r;
@@ -3044,7 +3090,7 @@ _edje_proxy_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj
}
efl_gfx_fill_set(ep->object, (Eina_Rect) p3->type.common->fill);
- efl_image_smooth_scale_set(ep->object, p3->smooth);
+ efl_gfx_image_smooth_scale_set(ep->object, p3->smooth);
evas_object_image_source_visible_set(ep->object, chosen_desc->proxy.source_visible);
evas_object_image_source_clip_set(ep->object, chosen_desc->proxy.source_clip);
}
@@ -3084,7 +3130,7 @@ _edje_image_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj
}
efl_gfx_fill_set(ep->object, (Eina_Rect) p3->type.common->fill);
- efl_image_smooth_scale_set(ep->object, p3->smooth);
+ efl_gfx_image_smooth_scale_set(ep->object, p3->smooth);
if (chosen_desc->image.border.scale)
{
if (p3->type.common->spec.image.border_scale_by > FROM_DOUBLE(0.0))
@@ -3144,20 +3190,20 @@ _edje_svg_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3 EINA_U
snprintf(dest_key, sizeof(dest_key), "edje/vectors/%i", new_svg);
efl_file_set(ep->object, ed->file->path, src_key);
- src_root = efl_canvas_vg_root_node_get(ep->object);
+ src_root = efl_canvas_vg_object_root_node_get(ep->object);
efl_ref(src_root);
efl_file_set(ep->object, ed->file->path, dest_key);
- dest_root = efl_canvas_vg_root_node_get(ep->object);
+ dest_root = efl_canvas_vg_object_root_node_get(ep->object);
efl_ref(dest_root);
root = efl_duplicate(src_root);
- if (!evas_vg_node_interpolate(root, src_root, dest_root, pos))
+ if (!efl_gfx_path_interpolate(root, src_root, dest_root, pos))
{
ERR("Can't interpolate check the svg file");
}
- efl_canvas_vg_root_node_set(ep->object, root);
+ efl_canvas_vg_object_root_node_set(ep->object, root);
efl_unref(src_root);
efl_unref(dest_root);
}
@@ -4656,7 +4702,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
case EDJE_PART_TYPE_EXTERNAL:
/* visibility and color have no meaning on SWALLOW and GROUP part. */
#ifdef HAVE_EPHYSICS
- efl_gfx_size_set(ep->object, EINA_SIZE2D(pf->final.w, pf->final.h));
+ efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(pf->final.w, pf->final.h));
if ((ep->part->physics_body) && (!ep->body))
{
if (_edje_physics_world_geometry_check(ed->world))
@@ -4676,16 +4722,16 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
}
}
else
- efl_gfx_position_set(ep->object, EINA_POSITION2D(ed->x + pf->final.x, ed->y + pf->final.y));
+ efl_gfx_entity_position_set(ep->object, EINA_POSITION2D(ed->x + pf->final.x, ed->y + pf->final.y));
#else
- efl_gfx_position_set(ep->object, EINA_POSITION2D(ed->x + pf->final.x, ed->y + pf->final.y));
- efl_gfx_size_set(ep->object, EINA_SIZE2D(pf->final.w, pf->final.h));
+ efl_gfx_entity_position_set(ep->object, EINA_POSITION2D(ed->x + pf->final.x, ed->y + pf->final.y));
+ efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(pf->final.w, pf->final.h));
#endif
if (ep->nested_smart) /* Move, Resize all nested parts */
{ /* Not really needed but will improve the bounding box evaluation done by Evas */
- efl_gfx_position_set(ep->nested_smart, EINA_POSITION2D(ed->x + pf->final.x, ed->y + pf->final.y));
- efl_gfx_size_set(ep->nested_smart, EINA_SIZE2D(pf->final.w, pf->final.h));
+ efl_gfx_entity_position_set(ep->nested_smart, EINA_POSITION2D(ed->x + pf->final.x, ed->y + pf->final.y));
+ efl_gfx_entity_size_set(ep->nested_smart, EINA_SIZE2D(pf->final.w, pf->final.h));
}
if (ep->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
_edje_entry_real_part_configure(ed, ep);
@@ -4720,16 +4766,16 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
Evas_Canvas3D_Camera *camera = NULL;
Edje_Part_Description_Camera *pd_camera;
- efl_gfx_size_set(ep->object, EINA_SIZE2D(pf->req.w, pf->req.h));
+ efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(pf->req.w, pf->req.h));
pd_camera = (Edje_Part_Description_Camera*) ep->chosen_description;
- efl_gfx_position_set(ep->object, EINA_POSITION2D(ed->x + pf->final.x, ed->y + pf->final.y)),
- efl_gfx_size_set(ep->object, EINA_SIZE2D(pf->final.w, pf->final.h));
+ efl_gfx_entity_position_set(ep->object, EINA_POSITION2D(ed->x + pf->final.x, ed->y + pf->final.y)),
+ efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(pf->final.w, pf->final.h));
viewport = evas_object_image_source_get(ep->object);
- efl_gfx_size_set(viewport, EINA_SIZE2D(pf->req.w, pf->req.h));
+ efl_gfx_entity_size_set(viewport, EINA_SIZE2D(pf->req.w, pf->req.h));
evas_object_image_source_visible_set(ep->object, EINA_FALSE);
evas_object_image_source_events_set(ep->object, EINA_TRUE);
@@ -4975,9 +5021,9 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
if (ep->part->type == EDJE_PART_TYPE_GROUP)
vis = evas_object_visible_get(ed->obj);
- efl_gfx_position_set(ep->typedata.swallow->swallowed_object, EINA_POSITION2D(ed->x + pf->final.x, ed->y + pf->final.y));
- efl_gfx_size_set(ep->typedata.swallow->swallowed_object, EINA_SIZE2D(pf->final.w, pf->final.h));
- efl_gfx_visible_set(ep->typedata.swallow->swallowed_object, vis);
+ efl_gfx_entity_position_set(ep->typedata.swallow->swallowed_object, EINA_POSITION2D(ed->x + pf->final.x, ed->y + pf->final.y));
+ efl_gfx_entity_size_set(ep->typedata.swallow->swallowed_object, EINA_SIZE2D(pf->final.w, pf->final.h));
+ efl_gfx_entity_visible_set(ep->typedata.swallow->swallowed_object, vis);
}
else evas_object_hide(ep->typedata.swallow->swallowed_object);
mo = ep->typedata.swallow->swallowed_object;
diff --git a/src/lib/edje/edje_callbacks.c b/src/lib/edje/edje_callbacks.c
index c64df5c4a9..11fce6ef24 100644
--- a/src/lib/edje/edje_callbacks.c
+++ b/src/lib/edje/edje_callbacks.c
@@ -452,7 +452,7 @@ _edje_pending_timer_cb(void *data)
pp = data;
pp->edje->pending_actions = eina_list_remove(pp->edje->pending_actions, pp);
- _edje_program_run(pp->edje, pp->program, 1, "", "");
+ _edje_program_run(pp->edje, pp->program, 1, "", "", NULL);
pp->timer = NULL;
free(pp);
return ECORE_CALLBACK_CANCEL;
diff --git a/src/lib/edje/edje_data.c b/src/lib/edje/edje_data.c
index 13f94fc51d..941a614313 100644
--- a/src/lib/edje/edje_data.c
+++ b/src/lib/edje/edje_data.c
@@ -13,6 +13,7 @@ Eet_Data_Descriptor *_edje_edd_edje_size_class = NULL;
Eet_Data_Descriptor *_edje_edd_edje_external_directory = NULL;
Eet_Data_Descriptor *_edje_edd_edje_external_directory_entry = NULL;
Eet_Data_Descriptor *_edje_edd_edje_font_directory_entry = NULL;
+Eet_Data_Descriptor *_edje_edd_edje_image_id_hash = NULL;
Eet_Data_Descriptor *_edje_edd_edje_image_directory = NULL;
Eet_Data_Descriptor *_edje_edd_edje_image_directory_entry = NULL;
Eet_Data_Descriptor *_edje_edd_edje_image_directory_set = NULL;
@@ -253,6 +254,7 @@ _edje_edd_shutdown(void)
FREED(_edje_edd_edje_external_directory);
FREED(_edje_edd_edje_external_directory_entry);
FREED(_edje_edd_edje_font_directory_entry);
+ FREED(_edje_edd_edje_image_id_hash);
FREED(_edje_edd_edje_image_directory);
FREED(_edje_edd_edje_image_directory_entry);
FREED(_edje_edd_edje_image_directory_set);
@@ -374,6 +376,11 @@ _edje_edd_init(void)
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_font_directory_entry, Edje_Font_Directory_Entry, "entry", entry, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_font_directory_entry, Edje_Font_Directory_Entry, "file", file, EET_T_STRING);
+ /* image hash */
+ EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Image_Hash);
+ _edje_edd_edje_image_id_hash = eet_data_descriptor_file_new(&eddc);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_image_id_hash, Edje_Image_Hash, "id", id, EET_T_INT);
+
/* image directory */
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Image_Directory_Entry);
_edje_edd_edje_image_directory_entry =
@@ -382,6 +389,7 @@ _edje_edd_init(void)
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_image_directory_entry, Edje_Image_Directory_Entry, "source_type", source_type, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_image_directory_entry, Edje_Image_Directory_Entry, "source_param", source_param, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_image_directory_entry, Edje_Image_Directory_Entry, "id", id, EET_T_INT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_image_directory_entry, Edje_Image_Directory_Entry, "external_id", external_id, EET_T_STRING);
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Image_Directory_Set_Entry);
_edje_edd_edje_image_directory_set_entry =
@@ -613,6 +621,8 @@ _edje_edd_init(void)
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Edje_File, "efl_version.major", efl_version.major, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Edje_File, "efl_version.minor", efl_version.minor, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Edje_File, "base_scale", base_scale, EDJE_T_FLOAT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Edje_File, "id", id, EET_T_STRING);
+ EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY_STRING(_edje_edd_edje_file, Edje_File, "requires", requires);
EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Edje_File, "external_dir", external_dir, _edje_edd_edje_external_directory);
EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Edje_File, "image_dir", image_dir, _edje_edd_edje_image_directory);
EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Edje_File, "model_dir", model_dir, _edje_edd_edje_model_directory);
@@ -629,6 +639,7 @@ _edje_edd_init(void)
EET_DATA_DESCRIPTOR_ADD_HASH(_edje_edd_edje_file, Edje_File, "data", data, _edje_edd_edje_string);
EET_DATA_DESCRIPTOR_ADD_HASH(_edje_edd_edje_file, Edje_File, "fonts", fonts, _edje_edd_edje_font_directory_entry);
EET_DATA_DESCRIPTOR_ADD_HASH(_edje_edd_edje_file, Edje_File, "collection", collection, _edje_edd_edje_part_collection_directory_entry);
+ EET_DATA_DESCRIPTOR_ADD_HASH(_edje_edd_edje_file, Edje_File, "image_id_hash", image_id_hash, _edje_edd_edje_image_id_hash);
/* parts & limit & programs - loaded induvidually */
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Limit);
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index 0d39dc0274..2527598c69 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -18,6 +18,8 @@
#include <Eo.h>
+#include "../../static_libs/buildsystem/buildsystem.h"
+
#ifdef MY_CLASS
# undef MY_CLASS
#endif
@@ -254,16 +256,11 @@ _edje_edit_efl_file_file_set(Eo *obj, Edje_Edit *eed, const char *file, const ch
* groups).
* P.S. don't forget about mmap version below
*/
- Efl_Vpath_File *file_obj =
- efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, file);
- efl_vpath_file_do(file_obj);
- // XXX:FIXME: allow this to be async
- efl_vpath_file_wait(file_obj);
- file = efl_vpath_file_result_get(file_obj);
+ file = eina_vpath_resolve(file);
Eina_Bool int_ret;
int_ret = efl_file_set(efl_super(obj, MY_CLASS), file, group);
- efl_del(file_obj);
+
if (!int_ret)
return EINA_FALSE;
@@ -292,7 +289,7 @@ _edje_edit_efl_file_mmap_set(Eo *obj, Edje_Edit *eed, const Eina_File *mmap, con
EAPI Evas_Object *
edje_edit_object_add(Evas *evas)
{
- return efl_add(MY_CLASS, evas, efl_canvas_object_legacy_ctor(efl_added));
+ return efl_add(MY_CLASS, evas_find(evas), efl_canvas_object_legacy_ctor(efl_added));
}
EOLIAN static Eo *
@@ -10419,7 +10416,7 @@ edje_edit_image_compression_type_get(Evas_Object *obj, const char *image)
case EDJE_IMAGE_SOURCE_TYPE_INLINE_LOSSY_ETC2: // LOSSY_ETC2
return EDJE_EDIT_IMAGE_COMP_LOSSY_ETC2;
- case EDJE_IMAGE_SOURCE_TYPE_EXTERNAL: // USER
+ case EDJE_IMAGE_SOURCE_TYPE_USER: // USER
return EDJE_EDIT_IMAGE_COMP_USER;
}
@@ -10486,7 +10483,7 @@ edje_edit_image_compression_type_set(Evas_Object *obj, const char *image, Edje_E
case EDJE_EDIT_IMAGE_COMP_USER: // USER
{
- de->source_type = EDJE_IMAGE_SOURCE_TYPE_EXTERNAL;
+ de->source_type = EDJE_IMAGE_SOURCE_TYPE_USER;
return EINA_TRUE;
}
}
@@ -11208,7 +11205,7 @@ edje_edit_program_run(Evas_Object *obj, const char *prog)
GET_ED_OR_RETURN(EINA_FALSE);
GET_EPR_OR_RETURN(EINA_FALSE);
- _edje_program_run(ed, epr, 0, "", "");
+ _edje_program_run(ed, epr, 0, "", "", NULL);
return EINA_TRUE;
}
@@ -12470,23 +12467,11 @@ _edje_edit_embryo_rebuild(Edje_Edit *eed)
#else
# define BIN_EXT
#endif
-#ifdef NEED_RUN_IN_TREE
-#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
- if (getuid() == geteuid())
-#endif
- {
- if (getenv("EFL_RUN_IN_TREE"))
- {
- snprintf(embryo_cc_path, sizeof(embryo_cc_path),
- "%s/src/bin/embryo/embryo_cc" BIN_EXT,
- PACKAGE_BUILD_DIR);
- snprintf(inc_path, sizeof(inc_path),
- "%s/data/edje/include", PACKAGE_BUILD_DIR);
- if (!ecore_file_exists(embryo_cc_path))
- embryo_cc_path[0] = '\0';
- }
- }
-#endif
+
+ bs_binary_get(embryo_cc_path, sizeof(embryo_cc_path), "embryo", "embryo_cc");
+
+ bs_data_path_get(inc_path, sizeof(inc_path), "edje", "include");
+
if (embryo_cc_path[0] == '\0')
{
diff --git a/src/lib/edje/edje_embryo.c b/src/lib/edje/edje_embryo.c
index f72899153a..b5b3b6663f 100644
--- a/src/lib/edje/edje_embryo.c
+++ b/src/lib/edje/edje_embryo.c
@@ -1416,7 +1416,7 @@ _edje_embryo_fn_run_program(Embryo_Program *ep, Embryo_Cell *params)
pr = ed->collection->patterns.table_programs[program_id % ed->collection->patterns.table_programs_size];
if (pr)
{
- _edje_program_run(ed, pr, 0, "", "");
+ _edje_program_run(ed, pr, 0, "", "", NULL);
}
return 0;
}
diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c
index 3fa1299abb..6c1f8960ff 100644
--- a/src/lib/edje/edje_entry.c
+++ b/src/lib/edje/edje_entry.c
@@ -1036,7 +1036,7 @@ _item_obj_get(Anchor *an, Evas_Object *o, Evas_Object *smart, Evas_Object *clip)
EINA_INLIST_FOREACH(en->item_objs, io)
{
- if (!io->an && io->name && !strcmp(an->name, io->name))
+ if (!io->an && io->name && !strcmp(an->name ? an->name : "", io->name))
{
io->an = an;
return io->obj;
@@ -1060,7 +1060,7 @@ _item_obj_get(Anchor *an, Evas_Object *o, Evas_Object *smart, Evas_Object *clip)
evas_object_pass_events_set(obj, EINA_TRUE);
io->an = an;
- io->name = strdup(an->name);
+ io->name = strdup(an->name ? an->name : "");
io->obj = obj;
en->item_objs = (Item_Obj *)eina_inlist_append(EINA_INLIST_GET(en->item_objs),
EINA_INLIST_GET(io));
@@ -1493,7 +1493,7 @@ _anchors_get(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en)
}
else if (!evas_textblock_cursor_compare(an->start, an->end))
{
- if (an->name) free(an->name);
+ free(an->name);
evas_textblock_cursor_free(an->start);
evas_textblock_cursor_free(an->end);
en->anchors = eina_list_remove(en->anchors, an);
@@ -2875,9 +2875,9 @@ _edje_entry_init(Edje *ed)
_edje_key_down_cb, ed);
evas_object_event_callback_add(ed->obj, EVAS_CALLBACK_KEY_UP,
_edje_key_up_cb, ed);
- efl_event_callback_add(ed->base.evas, EFL_CANVAS_EVENT_FOCUS_IN,
+ efl_event_callback_add(ed->base.evas, EFL_CANVAS_SCENE_EVENT_FOCUS_IN,
_evas_focus_in_cb, ed);
- efl_event_callback_add(ed->base.evas, EFL_CANVAS_EVENT_FOCUS_OUT,
+ efl_event_callback_add(ed->base.evas, EFL_CANVAS_SCENE_EVENT_FOCUS_OUT,
_evas_focus_out_cb, ed);
}
@@ -2896,9 +2896,9 @@ _edje_entry_shutdown(Edje *ed)
_edje_key_down_cb);
evas_object_event_callback_del(ed->obj, EVAS_CALLBACK_KEY_UP,
_edje_key_up_cb);
- efl_event_callback_del(ed->base.evas, EFL_CANVAS_EVENT_FOCUS_IN,
+ efl_event_callback_del(ed->base.evas, EFL_CANVAS_SCENE_EVENT_FOCUS_IN,
_evas_focus_in_cb, ed);
- efl_event_callback_del(ed->base.evas, EFL_CANVAS_EVENT_FOCUS_OUT,
+ efl_event_callback_del(ed->base.evas, EFL_CANVAS_SCENE_EVENT_FOCUS_OUT,
_evas_focus_out_cb, ed);
}
@@ -4584,6 +4584,45 @@ _edje_entry_prediction_hint_set(Edje_Real_Part *rp, const char *prediction_hint)
#endif
}
+Eina_Bool
+_edje_entry_prediction_hint_hash_set(Edje_Real_Part *rp, const char *key, const char *value)
+{
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return EINA_FALSE;
+ en = rp->typedata.text->entry_data;
+ if (!en) return EINA_FALSE;
+#ifdef HAVE_ECORE_IMF
+ if (en->imf_context)
+ return ecore_imf_context_prediction_hint_hash_set(en->imf_context, key, value);
+#else
+ (void)key;
+ (void)value;
+#endif
+
+ return EINA_FALSE;
+}
+
+Eina_Bool
+_edje_entry_prediction_hint_hash_del(Edje_Real_Part *rp, const char *key)
+{
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return EINA_FALSE;
+ en = rp->typedata.text->entry_data;
+ if (!en) return EINA_FALSE;
+#ifdef HAVE_ECORE_IMF
+ if (en->imf_context)
+ return ecore_imf_context_prediction_hint_hash_del(en->imf_context, key);
+#else
+ (void)key;
+#endif
+
+ return EINA_FALSE;
+}
+
#ifdef HAVE_ECORE_IMF
static Edje_Real_Part *
diff --git a/src/lib/edje/edje_legacy.c b/src/lib/edje/edje_legacy.c
index 6638270d57..a0c51749ad 100644
--- a/src/lib/edje/edje_legacy.c
+++ b/src/lib/edje/edje_legacy.c
@@ -5,10 +5,10 @@
EAPI Edje_Load_Error
edje_object_load_error_get(const Eo *obj)
{
- Efl_Image_Load_Error p = efl_file_load_error_get(obj);
+ Efl_Gfx_Image_Load_Error p = efl_file_load_error_get(obj);
Edje *ed;
- if (p != EFL_IMAGE_LOAD_ERROR_NONE) return EDJE_LOAD_ERROR_DOES_NOT_EXIST;
+ if (p != EFL_GFX_IMAGE_LOAD_ERROR_NONE) return EDJE_LOAD_ERROR_DOES_NOT_EXIST;
ed = _edje_fetch(obj);
if (!ed) return EDJE_LOAD_ERROR_GENERIC;
@@ -195,13 +195,13 @@ EAPI const char *edje_object_language_get(const Edje_Object *obj)
EAPI Eina_Bool edje_object_scale_set(Edje_Object *obj, double scale)
{
- efl_gfx_scale_set(obj, scale);
+ efl_gfx_entity_scale_set(obj, scale);
return EINA_TRUE;
}
EAPI double edje_object_scale_get(const Edje_Object *obj)
{
- return efl_gfx_scale_get(obj);
+ return efl_gfx_entity_scale_get(obj);
}
/* Legacy part drag APIs */
@@ -325,33 +325,73 @@ edje_object_part_text_cursor_line_end_set(Edje_Object *obj, const char *part, Ed
EAPI Eina_Bool
edje_object_part_text_cursor_prev(Edje_Object *obj, const char *part, Edje_Cursor cur)
{
- efl_text_cursor_char_prev(efl_part(obj, part),
- efl_text_cursor_get(efl_part(obj, part), (int) cur));
- return EINA_TRUE;
+ Efl_Text_Cursor_Cursor *c;
+ int old_pos, new_pos;
+
+ c = efl_text_cursor_get(efl_part(obj, part), (int) cur);
+
+ old_pos = efl_text_cursor_position_get(efl_part(obj, part), c);
+ efl_text_cursor_char_prev(efl_part(obj, part), c);
+ new_pos = efl_text_cursor_position_get(efl_part(obj, part), c);
+
+ if (old_pos != new_pos)
+ return EINA_TRUE;
+
+ return EINA_FALSE;
}
EAPI Eina_Bool
edje_object_part_text_cursor_next(Edje_Object *obj, const char *part, Edje_Cursor cur)
{
- efl_text_cursor_char_next(efl_part(obj, part),
- efl_text_cursor_get(efl_part(obj, part), (int) cur));
- return EINA_TRUE;
+ Efl_Text_Cursor_Cursor *c;
+ int old_pos, new_pos;
+
+ c = efl_text_cursor_get(efl_part(obj, part), (int) cur);
+
+ old_pos = efl_text_cursor_position_get(efl_part(obj, part), c);
+ efl_text_cursor_char_next(efl_part(obj, part), c);
+ new_pos = efl_text_cursor_position_get(efl_part(obj, part), c);
+
+ if (old_pos != new_pos)
+ return EINA_TRUE;
+
+ return EINA_FALSE;
}
EAPI Eina_Bool
edje_object_part_text_cursor_down(Edje_Object *obj, const char *part, Edje_Cursor cur)
{
- efl_text_cursor_line_jump_by(efl_part(obj, part),
- efl_text_cursor_get(efl_part(obj, part), (int) cur), 1);
- return EINA_TRUE;
+ Efl_Text_Cursor_Cursor *c;
+ int old_pos, new_pos;
+
+ c = efl_text_cursor_get(efl_part(obj, part), (int) cur);
+
+ old_pos = efl_text_cursor_position_get(efl_part(obj, part), c);
+ efl_text_cursor_line_jump_by(efl_part(obj, part), c, 1);
+ new_pos = efl_text_cursor_position_get(efl_part(obj, part), c);
+
+ if (old_pos != new_pos)
+ return EINA_TRUE;
+
+ return EINA_FALSE;
}
EAPI Eina_Bool
edje_object_part_text_cursor_up(Edje_Object *obj, const char *part, Edje_Cursor cur)
{
- efl_text_cursor_line_jump_by(efl_part(obj, part),
- efl_text_cursor_get(efl_part(obj, part), (int) cur), -1);
- return EINA_TRUE;
+ Efl_Text_Cursor_Cursor *c;
+ int old_pos, new_pos;
+
+ c = efl_text_cursor_get(efl_part(obj, part), (int) cur);
+
+ old_pos = efl_text_cursor_position_get(efl_part(obj, part), c);
+ efl_text_cursor_line_jump_by(efl_part(obj, part), c, -1);
+ new_pos = efl_text_cursor_position_get(efl_part(obj, part), c);
+
+ if (old_pos != new_pos)
+ return EINA_TRUE;
+
+ return EINA_FALSE;
}
EAPI void
@@ -1205,14 +1245,5 @@ edje_object_size_max_get(const Edje_Object *obj, int *maxw, int *maxh)
EAPI Eina_Bool
edje_object_part_exists(const Eo *obj, const char *part)
{
- Edje_Real_Part *rp;
- Edje *ed;
-
- if (!part) return EINA_FALSE;
- ed = _edje_fetch(obj);
- if (!ed) return EINA_FALSE;
- rp = _edje_real_part_recursive_get(&ed, part);
- if (!rp) return EINA_FALSE;
-
- return EINA_TRUE;
+ return efl_layout_group_part_exist_get(obj, part);
}
diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c
index 34492c847b..c974342fc7 100644
--- a/src/lib/edje/edje_load.c
+++ b/src/lib/edje/edje_load.c
@@ -166,25 +166,25 @@ _efl_canvas_layout_efl_file_file_get(Eo *obj EINA_UNUSED, Edje *ed, const char *
if (group) *group = ed->group;
}
-EOLIAN Efl_Image_Load_Error
-_efl_canvas_layout_efl_file_load_error_get(Eo *obj, Edje *ed)
+EOLIAN Efl_Gfx_Image_Load_Error
+_efl_canvas_layout_efl_file_load_error_get(const Eo *obj, Edje *ed)
{
- Efl_Image_Load_Error p = efl_file_load_error_get(efl_super(obj, EFL_CANVAS_LAYOUT_CLASS));
+ Efl_Gfx_Image_Load_Error p = efl_file_load_error_get(efl_super(obj, EFL_CANVAS_LAYOUT_CLASS));
- if (p != EFL_IMAGE_LOAD_ERROR_NONE) return p;
+ if (p != EFL_GFX_IMAGE_LOAD_ERROR_NONE) return p;
switch (ed->load_error)
{
- case EDJE_LOAD_ERROR_NONE: return EFL_IMAGE_LOAD_ERROR_NONE;
- case EDJE_LOAD_ERROR_GENERIC: return EFL_IMAGE_LOAD_ERROR_GENERIC;
- case EDJE_LOAD_ERROR_DOES_NOT_EXIST: return EFL_IMAGE_LOAD_ERROR_DOES_NOT_EXIST;
- case EDJE_LOAD_ERROR_PERMISSION_DENIED: return EFL_IMAGE_LOAD_ERROR_PERMISSION_DENIED;
- case EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED: return EFL_IMAGE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
- case EDJE_LOAD_ERROR_CORRUPT_FILE: return EFL_IMAGE_LOAD_ERROR_CORRUPT_FILE;
- case EDJE_LOAD_ERROR_UNKNOWN_FORMAT: return EFL_IMAGE_LOAD_ERROR_UNKNOWN_FORMAT;
- case EDJE_LOAD_ERROR_INCOMPATIBLE_FILE: return EFL_IMAGE_LOAD_ERROR_INCOMPATIBLE_FILE;
- case EDJE_LOAD_ERROR_UNKNOWN_COLLECTION: return EFL_IMAGE_LOAD_ERROR_UNKNOWN_COLLECTION;
- case EDJE_LOAD_ERROR_RECURSIVE_REFERENCE: return EFL_IMAGE_LOAD_ERROR_RECURSIVE_REFERENCE;
- default: return EFL_IMAGE_LOAD_ERROR_GENERIC;
+ case EDJE_LOAD_ERROR_NONE: return EFL_GFX_IMAGE_LOAD_ERROR_NONE;
+ case EDJE_LOAD_ERROR_GENERIC: return EFL_GFX_IMAGE_LOAD_ERROR_GENERIC;
+ case EDJE_LOAD_ERROR_DOES_NOT_EXIST: return EFL_GFX_IMAGE_LOAD_ERROR_DOES_NOT_EXIST;
+ case EDJE_LOAD_ERROR_PERMISSION_DENIED: return EFL_GFX_IMAGE_LOAD_ERROR_PERMISSION_DENIED;
+ case EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED: return EFL_GFX_IMAGE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
+ case EDJE_LOAD_ERROR_CORRUPT_FILE: return EFL_GFX_IMAGE_LOAD_ERROR_CORRUPT_FILE;
+ case EDJE_LOAD_ERROR_UNKNOWN_FORMAT: return EFL_GFX_IMAGE_LOAD_ERROR_UNKNOWN_FORMAT;
+ case EDJE_LOAD_ERROR_INCOMPATIBLE_FILE: return EFL_GFX_IMAGE_LOAD_ERROR_INCOMPATIBLE_FILE;
+ case EDJE_LOAD_ERROR_UNKNOWN_COLLECTION: return EFL_GFX_IMAGE_LOAD_ERROR_UNKNOWN_COLLECTION;
+ case EDJE_LOAD_ERROR_RECURSIVE_REFERENCE: return EFL_GFX_IMAGE_LOAD_ERROR_RECURSIVE_REFERENCE;
+ default: return EFL_GFX_IMAGE_LOAD_ERROR_GENERIC;
}
}
@@ -260,20 +260,16 @@ edje_file_collection_list(const char *file)
{
Eina_File *f;
Eina_List *lst;
+ char *tmp;
if ((!file) || (!*file)) return NULL;
- Efl_Vpath_File *file_obj =
- efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, file);
- efl_vpath_file_do(file_obj);
- // XXX:FIXME: allow this to be async
- efl_vpath_file_wait(file_obj);
- file = efl_vpath_file_result_get(file_obj);
- f = eina_file_open(file, EINA_FALSE);
+ tmp = eina_vpath_resolve(file);
+ f = eina_file_open(tmp, EINA_FALSE);
lst = edje_mmap_collection_list(f);
eina_file_close(f);
- efl_del(file_obj);
+ free(tmp);
return lst;
}
@@ -728,6 +724,20 @@ _edje_device_changed_cb(void *data, const Efl_Event *event)
}
static void
+_edje_device_canvas_del(void *data, const Efl_Event *event)
+{
+ Edje *ed = data;
+ efl_event_callback_del(event->object, EFL_CANVAS_SCENE_EVENT_DEVICE_ADDED,
+ _edje_device_added_cb, ed);
+ efl_event_callback_del(event->object, EFL_CANVAS_SCENE_EVENT_DEVICE_REMOVED,
+ _edje_device_removed_cb, ed);
+
+ if (ed->collection && ed->collection->use_custom_seat_names)
+ efl_event_callback_del(event->object, EFL_CANVAS_SCENE_EVENT_DEVICE_CHANGED,
+ _edje_device_changed_cb, ed);
+}
+
+static void
_edje_devices_add(Edje *ed, Evas *tev)
{
const Eina_List *devices, *l;
@@ -739,14 +749,15 @@ _edje_devices_add(Edje *ed, Evas *tev)
if (efl_input_device_type_get(dev) == EFL_INPUT_DEVICE_TYPE_SEAT)
_edje_device_add(ed, dev);
}
+ efl_event_callback_add(tev, EFL_EVENT_DEL, _edje_device_canvas_del, ed);
- efl_event_callback_add(tev, EFL_CANVAS_EVENT_DEVICE_ADDED,
+ efl_event_callback_add(tev, EFL_CANVAS_SCENE_EVENT_DEVICE_ADDED,
_edje_device_added_cb, ed);
- efl_event_callback_add(tev, EFL_CANVAS_EVENT_DEVICE_REMOVED,
+ efl_event_callback_add(tev, EFL_CANVAS_SCENE_EVENT_DEVICE_REMOVED,
_edje_device_removed_cb, ed);
if (ed->collection && ed->collection->use_custom_seat_names)
- efl_event_callback_add(tev, EFL_CANVAS_EVENT_DEVICE_CHANGED,
+ efl_event_callback_add(tev, EFL_CANVAS_SCENE_EVENT_DEVICE_CHANGED,
_edje_device_changed_cb, ed);
}
@@ -1086,7 +1097,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch
Evas_Canvas3D_Material *material = NULL;
Edje_Part_Description_Mesh_Node *pd_mesh_node;
- rp->node = efl_add(EVAS_CANVAS3D_NODE_CLASS, ed->base.evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ rp->node = efl_add(EVAS_CANVAS3D_NODE_CLASS, ed->base.evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
mesh = efl_add(EVAS_CANVAS3D_MESH_CLASS, ed->base.evas);
evas_canvas3d_node_mesh_add(rp->node, mesh);
@@ -1119,7 +1130,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch
{
Evas_Canvas3D_Light *light = NULL;
- rp->node = efl_add(EVAS_CANVAS3D_NODE_CLASS, ed->base.evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
+ rp->node = efl_add(EVAS_CANVAS3D_NODE_CLASS, ed->base.evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
light = efl_add(EVAS_CANVAS3D_LIGHT_CLASS, ed->base.evas);
evas_canvas3d_node_light_set(rp->node, light);
@@ -1131,7 +1142,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch
{
Evas_Canvas3D_Camera *camera = NULL;
- rp->node = efl_add(EVAS_CANVAS3D_NODE_CLASS, ed->base.evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
+ rp->node = efl_add(EVAS_CANVAS3D_NODE_CLASS, ed->base.evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
camera = efl_add(EVAS_CANVAS3D_CAMERA_CLASS, ed->base.evas);
evas_canvas3d_node_camera_set(rp->node, camera);
@@ -1317,7 +1328,8 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch
}
}
- if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
+ if ((rp->part->type == EDJE_PART_TYPE_TEXTBLOCK) &&
+ rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
{
_edje_entry_real_part_init(ed, rp);
if (!ed->has_entries)
@@ -1840,25 +1852,35 @@ _edje_object_collect(Edje *ed)
}
void
+_edje_file_callbacks_del(Edje *ed, Evas *e)
+{
+ Evas *tev = e;
+
+ if (!tev) tev = evas_object_evas_get(ed->obj);
+ efl_event_callback_del(tev, EFL_EVENT_DEL, _edje_device_canvas_del, ed);
+ efl_event_callback_del(tev, EFL_CANVAS_SCENE_EVENT_DEVICE_ADDED,
+ _edje_device_added_cb, ed);
+ efl_event_callback_del(tev, EFL_CANVAS_SCENE_EVENT_DEVICE_REMOVED,
+ _edje_device_removed_cb, ed);
+ if (ed->collection && ed->collection->use_custom_seat_names)
+ efl_event_callback_del(tev, EFL_CANVAS_SCENE_EVENT_DEVICE_CHANGED,
+ _edje_device_changed_cb, ed);
+}
+
+void
_edje_file_del(Edje *ed)
{
Edje_User_Defined *eud;
Evas *tev = NULL;
- if (ed->obj) tev = evas_object_evas_get(ed->obj);
+ if (ed->obj && (!efl_invalidated_get(ed->obj)))
+ tev = evas_object_evas_get(ed->obj);
ed->groups = eina_list_free(ed->groups);
if (tev)
{
- efl_event_callback_del(tev, EFL_CANVAS_EVENT_DEVICE_ADDED,
- _edje_device_added_cb, ed);
- efl_event_callback_del(tev, EFL_CANVAS_EVENT_DEVICE_REMOVED,
- _edje_device_removed_cb, ed);
- if (ed->collection && ed->collection->use_custom_seat_names)
- efl_event_callback_del(tev, EFL_CANVAS_EVENT_DEVICE_CHANGED,
- _edje_device_changed_cb, ed);
-
+ _edje_file_callbacks_del(ed, tev);
evas_event_freeze(tev);
}
@@ -2115,6 +2137,16 @@ _edje_file_free(Edje_File *edf)
HASH_FREE(edf->fonts);
HASH_FREE(edf->collection);
HASH_FREE(edf->data);
+ HASH_FREE(edf->image_id_hash);
+
+ if (edf->requires_count)
+ {
+ unsigned int i;
+
+ for (i = 0; i < edf->requires_count; i++)
+ eina_stringshare_del(edf->requires[i]);
+ free(edf->requires);
+ }
if (edf->image_dir)
{
@@ -2233,6 +2265,7 @@ _edje_file_free(Edje_File *edf)
if (edf->collection_patterns) edje_match_patterns_free(edf->collection_patterns);
if (edf->path) eina_stringshare_del(edf->path);
if (edf->free_strings && edf->compiler) eina_stringshare_del(edf->compiler);
+ if (edf->free_strings) eina_stringshare_del(edf->id);
_edje_textblock_style_cleanup(edf);
if (edf->ef) eet_close(edf->ef);
if (edf->f) eina_file_close(edf->f);
@@ -2670,7 +2703,7 @@ edje_3d_object_add(Evas_Object *obj, Eo **root_node, Eo *scene)
if (*root_node == NULL)
*root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, ed->base.evas,
- evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
if (scene == NULL)
scene = efl_add(EVAS_CANVAS3D_SCENE_CLASS, ed->base.evas);
diff --git a/src/lib/edje/edje_lua.c b/src/lib/edje/edje_lua.c
index 9af93cc3ea..f31c3172fe 100644
--- a/src/lib/edje/edje_lua.c
+++ b/src/lib/edje/edje_lua.c
@@ -4136,7 +4136,9 @@ _edje_lua_group_mt_index(lua_State *L)
if (rp)
{
// check if lua userdata exists
+ edje_object_freeze(obj->eo);
Evas_Object *part = (Evas_Object *)edje_object_part_object_get(obj->eo, key);
+ edje_object_thaw(obj->eo);
_edje_lua_get_reg(L, part);
if (lua_isnil(L, -1))
{
diff --git a/src/lib/edje/edje_lua2.c b/src/lib/edje/edje_lua2.c
index b8a66c67c7..b204736439 100644
--- a/src/lib/edje/edje_lua2.c
+++ b/src/lib/edje/edje_lua2.c
@@ -3964,6 +3964,11 @@ _edje_lua2_script_init(Edje *ed) // Stack usage [-63, +99, em]
_elua_init(); // This is actually truly pointless, even if raster remembers.
#endif
L = ed->L = luaL_newstate();
+ if (!L)
+ {
+ ERR("Lua state assign failed");
+ return;
+ }
al = lua_newuserdata(L, sizeof(Edje_Lua_Allocator));
al->ref = luaL_ref(L, LUA_REGISTRYINDEX);
al->func = lua_getallocf(L, &(al->ud));
diff --git a/src/lib/edje/edje_main.c b/src/lib/edje/edje_main.c
index 551b4f2e6e..bd49820179 100644
--- a/src/lib/edje/edje_main.c
+++ b/src/lib/edje/edje_main.c
@@ -83,7 +83,7 @@ edje_init(void)
}
_edje_scale = FROM_DOUBLE(1.0);
- _edje_global_obj = efl_add(EDJE_GLOBAL_CLASS, NULL);
+ _edje_global_obj = efl_add(EDJE_GLOBAL_CLASS, efl_main_loop_get());
if (!_edje_global_obj ||
!efl_loop_register(efl_main_loop_get(), EFL_GFX_COLOR_CLASS_INTERFACE, _edje_global_obj) ||
!efl_loop_register(efl_main_loop_get(), EFL_GFX_TEXT_CLASS_INTERFACE, _edje_global_obj) ||
@@ -274,11 +274,11 @@ void
_edje_class_init(void)
{
if (!_edje_color_class_member)
- _edje_color_class_member = efl_add(EFL_OBSERVABLE_CLASS, NULL);
+ _edje_color_class_member = efl_add(EFL_OBSERVABLE_CLASS, efl_main_loop_get());
if (!_edje_text_class_member)
- _edje_text_class_member = efl_add(EFL_OBSERVABLE_CLASS, NULL);
+ _edje_text_class_member = efl_add(EFL_OBSERVABLE_CLASS, efl_main_loop_get());
if (!_edje_size_class_member)
- _edje_size_class_member = efl_add(EFL_OBSERVABLE_CLASS, NULL);
+ _edje_size_class_member = efl_add(EFL_OBSERVABLE_CLASS, efl_main_loop_get());
}
void
diff --git a/src/lib/edje/edje_message_queue.c b/src/lib/edje/edje_message_queue.c
index 4d8cbc754d..b7ecdf3e95 100644
--- a/src/lib/edje/edje_message_queue.c
+++ b/src/lib/edje/edje_message_queue.c
@@ -426,14 +426,7 @@ _edje_message_free(Edje_Message *em)
emsg = (Edje_Message_Signal *)em->msg;
if (emsg->sig) eina_stringshare_del(emsg->sig);
if (emsg->src) eina_stringshare_del(emsg->src);
- if (emsg->data && (--(emsg->data->ref) == 0))
- {
- if (emsg->data->free_func)
- {
- emsg->data->free_func(emsg->data->data);
- }
- free(emsg->data);
- }
+ _edje_signal_data_free(emsg->data);
free(emsg);
}
break;
@@ -506,7 +499,7 @@ _edje_message_propagate_send(Edje *ed, Edje_Queue queue, Edje_Message_Type type,
if (emsg2->data)
{
emsg3->data = emsg2->data;
- emsg3->data->ref++;
+ _edje_signal_data_ref(emsg3->data);
}
msg = (unsigned char *)emsg3;
}
diff --git a/src/lib/edje/edje_multisense.c b/src/lib/edje/edje_multisense.c
index e8c0081d2f..0d99826d22 100644
--- a/src/lib/edje/edje_multisense.c
+++ b/src/lib/edje/edje_multisense.c
@@ -10,14 +10,14 @@ static Eina_Bool outfail = EINA_FALSE;
static void
_play_finished(void *data EINA_UNUSED, const Efl_Event *event)
{
- efl_del(event->object);
+ efl_unref(event->object);
}
static void
_out_fail(void *data EINA_UNUSED, const Efl_Event *event)
{
outfail = EINA_TRUE;
- efl_del(event->object);
+ efl_unref(event->object);
out = NULL;
}
@@ -199,36 +199,48 @@ _edje_multisense_internal_sound_sample_play(Edje *ed, const char *sample_name, c
eet_data->vio.tell = eet_snd_file_tell;
eet_data->offset = 0;
- in = efl_add(ECORE_AUDIO_IN_SNDFILE_CLASS, NULL, ecore_audio_obj_name_set(efl_added, snd_id_str), ecore_audio_obj_in_speed_set(efl_added, speed), ecore_audio_obj_vio_set(efl_added, &eet_data->vio, eet_data, _free), efl_event_callback_add(efl_added, ECORE_AUDIO_IN_EVENT_IN_STOPPED, _play_finished, NULL));
+ in = efl_add_ref(ECORE_AUDIO_IN_SNDFILE_CLASS, NULL, efl_name_set(efl_added, snd_id_str), ecore_audio_obj_in_speed_set(efl_added, speed), ecore_audio_obj_vio_set(efl_added, &eet_data->vio, eet_data, _free), efl_event_callback_add(efl_added, ECORE_AUDIO_IN_EVENT_IN_STOPPED, _play_finished, NULL));
if (!out)
{
-#ifdef _WIN32
- out = efl_add(ECORE_AUDIO_OUT_WASAPI_CLASS, NULL, efl_event_callback_add(efl_added, ECORE_AUDIO_OUT_WASAPI_EVENT_CONTEXT_FAIL, _out_fail, NULL));
-#else
-#if HAVE_PULSE
- out = efl_add(ECORE_AUDIO_OUT_PULSE_CLASS, NULL, efl_event_callback_add(efl_added, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_FAIL, _out_fail, NULL));
-#endif
-#endif
+# ifdef _WIN32
+ out = efl_add_ref(ECORE_AUDIO_OUT_WASAPI_CLASS, NULL, efl_event_callback_add(efl_added, ECORE_AUDIO_OUT_WASAPI_EVENT_CONTEXT_FAIL, _out_fail, NULL));
+# else
+# ifdef HAVE_PULSE
+ out = efl_add_ref(ECORE_AUDIO_OUT_PULSE_CLASS, NULL, efl_event_callback_add(efl_added, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_FAIL, _out_fail, NULL));
+# endif
+# endif
if (out) outs++;
}
if (!out)
{
-#ifdef _WIN32
- ERR("Could not create multisense audio out (wasapi)");
-#else
-#if HAVE_PULSE
- ERR("Could not create multisense audio out (pulse)");
-#endif
-#endif
- efl_del(in);
+ static Eina_Bool complained = EINA_FALSE;
+
+ if (!complained)
+ {
+ complained = EINA_TRUE;
+# ifdef _WIN32
+ ERR("Could not create multisense audio out (wasapi)");
+# else
+# ifdef HAVE_PULSE
+ ERR("Could not create multisense audio out (pulse)");
+# endif
+# endif
+ }
+ efl_unref(in);
return EINA_FALSE;
}
ret = ecore_audio_obj_out_input_attach(out, in);
if (!ret)
{
- ERR("Could not attach input");
- efl_del(in);
+ static Eina_Bool complained = EINA_FALSE;
+
+ if (!complained)
+ {
+ complained = EINA_TRUE;
+ ERR("Could not attach input");
+ }
+ efl_unref(in);
return EINA_FALSE;
}
}
@@ -271,21 +283,21 @@ _edje_multisense_internal_sound_tone_play(Edje *ed, const char *tone_name, const
tone = &ed->file->sound_dir->tones[i];
if (!strcmp(tone->name, tone_name))
{
- in = efl_add(ECORE_AUDIO_IN_TONE_CLASS, NULL);
- ecore_audio_obj_name_set(in, "tone");
+ in = efl_add_ref(ECORE_AUDIO_IN_TONE_CLASS, NULL);
+ efl_name_set(in, "tone");
efl_key_data_set(in, ECORE_AUDIO_ATTR_TONE_FREQ, &tone->value);
ecore_audio_obj_in_length_set(in, duration);
efl_event_callback_add(in, ECORE_AUDIO_IN_EVENT_IN_STOPPED, _play_finished, NULL);
if (!out)
{
-#ifdef _WIN32
- out = efl_add(ECORE_AUDIO_OUT_WASAPI_CLASS, NULL, efl_event_callback_add(efl_added, ECORE_AUDIO_OUT_WASAPI_EVENT_CONTEXT_FAIL, _out_fail, NULL));
-#else
-#if HAVE_PULSE
- out = efl_add(ECORE_AUDIO_OUT_PULSE_CLASS, NULL, efl_event_callback_add(efl_added, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_FAIL, _out_fail, NULL));
-#endif
-#endif
+# ifdef _WIN32
+ out = efl_add_ref(ECORE_AUDIO_OUT_WASAPI_CLASS, NULL, efl_event_callback_add(efl_added, ECORE_AUDIO_OUT_WASAPI_EVENT_CONTEXT_FAIL, _out_fail, NULL));
+# else
+# ifdef HAVE_PULSE
+ out = efl_add_ref(ECORE_AUDIO_OUT_PULSE_CLASS, NULL, efl_event_callback_add(efl_added, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_FAIL, _out_fail, NULL));
+# endif
+# endif
if (out) outs++;
}
@@ -293,7 +305,7 @@ _edje_multisense_internal_sound_tone_play(Edje *ed, const char *tone_name, const
if (!ret)
{
ERR("Could not attach input");
- efl_del(in);
+ efl_unref(in);
return EINA_FALSE;
}
}
@@ -341,7 +353,7 @@ _edje_multisense_shutdown(void)
if (out)
{
// XXX: this causes an abort inside of pa!!!!!
- //efl_del(out);
+ //efl_unref(out);
out = NULL;
outs = 0;
}
diff --git a/src/lib/edje/edje_part.c b/src/lib/edje/edje_part.c
index 98e9f20e82..978b488934 100644
--- a/src/lib/edje/edje_part.c
+++ b/src/lib/edje/edje_part.c
@@ -64,6 +64,7 @@ PROXY_INIT(swallow)
PROXY_INIT(external)
PROXY_INIT(text)
PROXY_INIT(other)
+PROXY_INIT(invalid)
void
_edje_internal_proxy_shutdown(void)
@@ -73,6 +74,7 @@ _edje_internal_proxy_shutdown(void)
_swallow_shutdown();
_external_shutdown();
_text_shutdown();
+ _invalid_shutdown();
_other_shutdown();
}
@@ -93,12 +95,11 @@ EOLIAN static Efl_Object *
_efl_canvas_layout_part_efl_object_finalize(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd)
{
EINA_SAFETY_ON_FALSE_RETURN_VAL(pd->rp && pd->ed && pd->part, NULL);
- // Do not use return here!
return efl_finalize(efl_super(obj, MY_CLASS));
}
EOLIAN Eina_Rect
-_efl_canvas_layout_part_efl_gfx_geometry_get(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd)
+_efl_canvas_layout_part_efl_gfx_entity_geometry_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd)
{
Edje_Real_Part *rp = pd->rp;
Eina_Rect r = EINA_RECT_ZERO();
@@ -110,7 +111,7 @@ _efl_canvas_layout_part_efl_gfx_geometry_get(Eo *obj EINA_UNUSED, Efl_Canvas_Lay
}
EOLIAN static void
-_efl_canvas_layout_part_state_get(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd, const char **name, double *val)
+_efl_canvas_layout_part_state_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd, const char **name, double *val)
{
const char *str;
@@ -120,7 +121,7 @@ _efl_canvas_layout_part_state_get(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Da
}
EOLIAN static Efl_Canvas_Layout_Part_Type
-_efl_canvas_layout_part_part_type_get(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd)
+_efl_canvas_layout_part_part_type_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd)
{
Edje_Real_Part *rp;
@@ -137,7 +138,7 @@ _efl_canvas_layout_part_efl_ui_drag_drag_value_set(Eo *obj EINA_UNUSED, Efl_Canv
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_efl_ui_drag_drag_value_get(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd, double *dx, double *dy)
+_efl_canvas_layout_part_efl_ui_drag_drag_value_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd, double *dx, double *dy)
{
return _edje_object_part_drag_value_get(pd->ed, pd->part, dx, dy);
}
@@ -149,13 +150,13 @@ _efl_canvas_layout_part_efl_ui_drag_drag_size_set(Eo *obj EINA_UNUSED, Efl_Canva
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_efl_ui_drag_drag_size_get(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd, double *dw, double *dh)
+_efl_canvas_layout_part_efl_ui_drag_drag_size_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd, double *dw, double *dh)
{
return _edje_object_part_drag_size_get(pd->ed, pd->part, dw, dh);
}
EOLIAN static Efl_Ui_Drag_Dir
-_efl_canvas_layout_part_efl_ui_drag_drag_dir_get(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd)
+_efl_canvas_layout_part_efl_ui_drag_drag_dir_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd)
{
return _edje_object_part_drag_dir_get(pd->ed, pd->part);
}
@@ -167,7 +168,7 @@ _efl_canvas_layout_part_efl_ui_drag_drag_step_set(Eo *obj EINA_UNUSED, Efl_Canva
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_efl_ui_drag_drag_step_get(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd, double *dx, double *dy)
+_efl_canvas_layout_part_efl_ui_drag_drag_step_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd, double *dx, double *dy)
{
return _edje_object_part_drag_step_get(pd->ed, pd->part, dx, dy);
}
@@ -185,7 +186,7 @@ _efl_canvas_layout_part_efl_ui_drag_drag_page_set(Eo *obj EINA_UNUSED, Efl_Canva
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_efl_ui_drag_drag_page_get(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd, double *dx, double *dy)
+_efl_canvas_layout_part_efl_ui_drag_drag_page_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Part_Data *pd, double *dx, double *dy)
{
return _edje_object_part_drag_page_get(pd->ed, pd->part, dx, dy);
}
diff --git a/src/lib/edje/edje_part_box.c b/src/lib/edje/edje_part_box.c
index e01cfe1453..f737159c6e 100644
--- a/src/lib/edje/edje_part_box.c
+++ b/src/lib/edje/edje_part_box.c
@@ -8,8 +8,6 @@
PROXY_IMPLEMENTATION(box, MY_CLASS, EINA_FALSE)
#undef PROXY_IMPLEMENTATION
-typedef struct _Part_Item_Iterator Part_Item_Iterator;
-
/* Legacy features */
EOLIAN static Eina_Bool
@@ -27,7 +25,7 @@ _efl_canvas_layout_part_box_efl_pack_unpack_all(Eo *obj, void *_pd EINA_UNUSED)
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_box_efl_pack_unpack(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *subobj)
+_efl_canvas_layout_part_box_efl_pack_unpack(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx_Entity *subobj)
{
Evas_Object *removed;
PROXY_DATA_GET(obj, pd);
@@ -36,42 +34,42 @@ _efl_canvas_layout_part_box_efl_pack_unpack(Eo *obj, void *_pd EINA_UNUSED, Efl_
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_box_efl_pack_pack(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *subobj)
+_efl_canvas_layout_part_box_efl_pack_pack(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx_Entity *subobj)
{
PROXY_DATA_GET(obj, pd);
return _edje_part_box_append(pd->ed, pd->part, subobj);
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_box_efl_pack_linear_pack_begin(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *subobj)
+_efl_canvas_layout_part_box_efl_pack_linear_pack_begin(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx_Entity *subobj)
{
PROXY_DATA_GET(obj, pd);
return _edje_part_box_prepend(pd->ed, pd->part, subobj);
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_box_efl_pack_linear_pack_end(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *subobj)
+_efl_canvas_layout_part_box_efl_pack_linear_pack_end(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx_Entity *subobj)
{
PROXY_DATA_GET(obj, pd);
return _edje_part_box_append(pd->ed, pd->part, subobj);
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_box_efl_pack_linear_pack_before(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *subobj, const Efl_Gfx *existing)
+_efl_canvas_layout_part_box_efl_pack_linear_pack_before(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing)
{
PROXY_DATA_GET(obj, pd);
return _edje_part_box_insert_before(pd->ed, pd->part, subobj, existing);
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_box_efl_pack_linear_pack_after(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *subobj, const Efl_Gfx *existing)
+_efl_canvas_layout_part_box_efl_pack_linear_pack_after(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing)
{
PROXY_DATA_GET(obj, pd);
return _edje_part_box_insert_after(pd->ed, pd->part, subobj, existing);
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_box_efl_pack_linear_pack_at(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *subobj, int index)
+_efl_canvas_layout_part_box_efl_pack_linear_pack_at(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx_Entity *subobj, int index)
{
PROXY_DATA_GET(obj, pd);
int cnt = efl_content_count(obj);
@@ -83,7 +81,7 @@ _efl_canvas_layout_part_box_efl_pack_linear_pack_at(Eo *obj, void *_pd EINA_UNUS
return _edje_part_box_append(pd->ed, pd->part, subobj);
}
-EOLIAN static Efl_Gfx *
+EOLIAN static Efl_Gfx_Entity *
_efl_canvas_layout_part_box_efl_pack_linear_pack_unpack_at(Eo *obj, void *_pd EINA_UNUSED, int index)
{
PROXY_DATA_GET(obj, pd);
@@ -93,7 +91,7 @@ _efl_canvas_layout_part_box_efl_pack_linear_pack_unpack_at(Eo *obj, void *_pd EI
/* New APIs with Eo */
-EOLIAN static Efl_Gfx *
+EOLIAN static Efl_Gfx_Entity *
_efl_canvas_layout_part_box_efl_pack_linear_pack_content_get(Eo *obj, void *_pd EINA_UNUSED, int index)
{
PROXY_DATA_GET(obj, pd);
@@ -102,13 +100,13 @@ _efl_canvas_layout_part_box_efl_pack_linear_pack_content_get(Eo *obj, void *_pd
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_box_efl_container_content_remove(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *subobj)
+_efl_canvas_layout_part_box_efl_container_content_remove(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx_Entity *subobj)
{
return efl_pack_unpack(obj, subobj);
}
EOLIAN static int
-_efl_canvas_layout_part_box_efl_pack_linear_pack_index_get(Eo *obj, void *_pd EINA_UNUSED, const Efl_Gfx * subobj)
+_efl_canvas_layout_part_box_efl_pack_linear_pack_index_get(Eo *obj, void *_pd EINA_UNUSED, const Efl_Gfx_Entity * subobj)
{
Evas_Object_Box_Option *opt;
Evas_Object_Box_Data *priv;
@@ -127,53 +125,6 @@ _efl_canvas_layout_part_box_efl_pack_linear_pack_index_get(Eo *obj, void *_pd EI
return -1;
}
-/* this iterator is the same as efl_ui_box */
-static Eina_Bool
-_part_item_iterator_next(Part_Item_Iterator *it, void **data)
-{
- Efl_Gfx *sub;
-
- if (!it->object) return EINA_FALSE;
- if (!eina_iterator_next(it->real_iterator, (void **) &sub))
- return EINA_FALSE;
-
- if (data) *data = sub;
- return EINA_TRUE;
-}
-
-static Eo *
-_part_item_iterator_get_container(Part_Item_Iterator *it)
-{
- return it->object;
-}
-
-static void
-_part_item_iterator_free(Part_Item_Iterator *it)
-{
- eina_iterator_free(it->real_iterator);
- efl_wref_del(it->object, &it->object);
- free(it);
-}
-
-static Eina_Iterator *
-_part_item_iterator_create(Eo *obj, Eina_Iterator *real_iterator)
-{
- Part_Item_Iterator *it;
-
- it = calloc(1, sizeof(*it));
- if (!it) return NULL;
-
- EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
-
- it->real_iterator = real_iterator;
- it->iterator.version = EINA_ITERATOR_VERSION;
- it->iterator.next = FUNC_ITERATOR_NEXT(_part_item_iterator_next);
- it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_part_item_iterator_get_container);
- it->iterator.free = FUNC_ITERATOR_FREE(_part_item_iterator_free);
- efl_wref_add(obj, &it->object);
-
- return &it->iterator;
-}
EOLIAN static Eina_Iterator *
_efl_canvas_layout_part_box_efl_container_content_iterate(Eo *obj, void *_pd EINA_UNUSED)
@@ -184,7 +135,7 @@ _efl_canvas_layout_part_box_efl_container_content_iterate(Eo *obj, void *_pd EIN
if (!pd->rp->typedata.container) return NULL;
it = evas_object_box_iterator_new(pd->rp->object);
- return _part_item_iterator_create(pd->rp->object, it);
+ return efl_canvas_iterator_create(pd->rp->object, it, NULL);
}
EOLIAN static int
@@ -195,7 +146,7 @@ _efl_canvas_layout_part_box_efl_container_content_count(Eo *obj, void *_pd EINA_
}
EOLIAN static Efl_Ui_Dir
-_efl_canvas_layout_part_box_efl_ui_direction_direction_get(Eo *obj, void *_pd EINA_UNUSED)
+_efl_canvas_layout_part_box_efl_ui_direction_direction_get(const Eo *obj, void *_pd EINA_UNUSED)
{
PROXY_DATA_GET(obj, pd);
const Edje_Part_Description_Box *desc =
diff --git a/src/lib/edje/edje_part_external.c b/src/lib/edje/edje_part_external.c
index 6750704e3d..bbc82791b7 100644
--- a/src/lib/edje/edje_part_external.c
+++ b/src/lib/edje/edje_part_external.c
@@ -15,8 +15,8 @@ _external_compose(Eo *obj, Edje *ed, const char *part)
efl_composite_attach(obj, ext_obj);
}
-EOLIAN static Efl_Gfx *
-_efl_canvas_layout_part_external_efl_content_content_get(Eo *obj, void *_pd EINA_UNUSED)
+EOLIAN static Efl_Gfx_Entity *
+_efl_canvas_layout_part_external_efl_content_content_get(const Eo *obj, void *_pd EINA_UNUSED)
{
PROXY_DATA_GET(obj, pd);
return _edje_object_part_external_object_get(pd->ed, pd->part);
diff --git a/src/lib/edje/edje_part_helper.h b/src/lib/edje/edje_part_helper.h
index 671bf657ae..a1c5596c6f 100644
--- a/src/lib/edje/edje_part_helper.h
+++ b/src/lib/edje/edje_part_helper.h
@@ -1,5 +1,4 @@
#include "edje_private.h"
-#include "efl_canvas_layout_part.eo.h"
typedef struct _Efl_Canvas_Layout_Part_Data Efl_Canvas_Layout_Part_Data;
@@ -36,12 +35,10 @@ _part_proxy_del_cb(Eo *proxy, Eo **static_var)
if (*static_var)
{
if (*static_var != proxy)
- efl_del_intercept_set(*static_var, NULL);
- }
- if (efl_parent_get(proxy))
- {
- efl_ref(proxy);
- efl_parent_set(proxy, NULL);
+ {
+ efl_del_intercept_set(*static_var, NULL);
+ efl_unref(*static_var);
+ }
}
efl_reuse(proxy);
*static_var = proxy;
@@ -53,7 +50,7 @@ _part_proxy_del_cb(Eo *proxy, Eo **static_var)
do { if (PROXY_STATIC_VAR(type)) \
{ \
efl_del_intercept_set(PROXY_STATIC_VAR(type), NULL); \
- efl_del(PROXY_STATIC_VAR(type)); \
+ efl_unref(PROXY_STATIC_VAR(type)); \
PROXY_STATIC_VAR(type) = NULL; \
} } while (0)
@@ -80,28 +77,26 @@ _ ## type ## _shutdown(void) \
} \
\
Eo * \
-_edje_ ## type ## _internal_proxy_get(Edje_Object *obj EINA_UNUSED, Edje *ed, Edje_Real_Part *rp) \
+_edje_ ## type ## _internal_proxy_get(Edje_Object *obj EINA_UNUSED, Edje *ed, Edje_Real_Part *rp, const char *part) \
{ \
Efl_Canvas_Layout_Part_Data *pd; \
Eo *proxy = PROXY_STATIC_VAR(type); \
- \
pd = proxy ? efl_data_scope_get(proxy, EFL_CANVAS_LAYOUT_PART_CLASS) : NULL; \
if (!pd) \
{ \
- if (EINA_UNLIKELY(PROXY_STATIC_VAR(type) != NULL)) \
+ if (EINA_UNLIKELY(proxy != NULL)) \
ERR("Found invalid handle for efl_part. Reset."); \
- proxy = efl_add(KLASS, ed->obj, _edje_real_part_set(efl_added, ed, rp, rp->part->name)); \
- goto end ; \
+ proxy = efl_add(KLASS, ed->obj, _edje_real_part_set(efl_added, ed, rp, part)); \
+ } \
+ else \
+ { \
+ PROXY_STATIC_VAR(type) = NULL; \
+ efl_parent_set(proxy, ed->obj); \
+ efl_unref(proxy); /* efl_reuse gives us one additional reference, give this one up as we gave ownerwhip back to ed->obj */\
+ _edje_real_part_set(proxy, ed, rp, part); \
} \
- else PROXY_STATIC_VAR(type) = NULL; \
- \
- _edje_real_part_set(proxy, ed, rp, rp->part->name); \
- \
-end: \
__VA_ARGS__; \
if (!no_del_cb) efl_del_intercept_set(proxy, _ ## type ## _del_cb); \
- efl_allow_parent_unref_set(proxy, 1); \
- ___efl_auto_unref_set(proxy, 1); \
return proxy; \
}
diff --git a/src/lib/edje/edje_part_invalid.c b/src/lib/edje/edje_part_invalid.c
new file mode 100644
index 0000000000..469de82fd4
--- /dev/null
+++ b/src/lib/edje/edje_part_invalid.c
@@ -0,0 +1,101 @@
+#include "edje_private.h"
+#include "edje_part_helper.h"
+#define MY_CLASS EFL_CANVAS_LAYOUT_PART_INVALID_CLASS
+
+PROXY_IMPLEMENTATION(invalid, MY_CLASS, EINA_FALSE)
+#undef PROXY_IMPLEMENTATION
+
+static void
+_edje_part_invalid_call(const Eo *proxy, const char *function)
+{
+ PROXY_DATA_GET(proxy, pd);
+
+ WRN("No such part '%s' in group '%s' in call to %s(). Ignored.",
+ pd->part, pd->ed ? pd->ed->group : NULL, function);
+ efl_event_callback_call(pd->obj, EFL_LAYOUT_EVENT_PART_INVALID, (void *) pd->part);
+}
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-parameter"
+
+#define EDJE_PART_INVALID_VOID(api, impl, ...) \
+ EOLIAN static void impl(Eo *proxy, void *_pd EINA_UNUSED, ## __VA_ARGS__) { _edje_part_invalid_call(proxy, #api); }
+
+#define EDJE_PART_INVALID_VOID_CONST(api, impl, ...) \
+ EOLIAN static void impl(const Eo *proxy, void *_pd EINA_UNUSED, ## __VA_ARGS__) { _edje_part_invalid_call(proxy, #api); }
+
+#define EDJE_PART_INVALID(type, ret, api, impl, ...) \
+ EOLIAN static type impl(Eo *proxy, void *_pd EINA_UNUSED, ## __VA_ARGS__) { _edje_part_invalid_call(proxy, #api); return (type)ret; }
+
+#define EDJE_PART_INVALID_CONST(type, ret, api, impl, ...) \
+ EOLIAN static type impl(const Eo *proxy, void *_pd EINA_UNUSED, ## __VA_ARGS__) { _edje_part_invalid_call(proxy, #api); return (type)ret; }
+
+EOLIAN static void
+_efl_canvas_layout_part_invalid_efl_canvas_layout_part_state_get(const Eo *proxy, void *_pd EINA_UNUSED, const char **state, double *val)
+{
+ if (state) *state = "";
+ if (val) *val = 0.0;
+}
+
+EDJE_PART_INVALID_CONST(Efl_Canvas_Layout_Part_Type, 0, efl_canvas_layout_part_type_get, _efl_canvas_layout_part_invalid_efl_canvas_layout_part_part_type_get)
+EDJE_PART_INVALID_CONST(Eina_Rect, EINA_RECT_ZERO(), efl_gfx_entity_geometry_get, _efl_canvas_layout_part_invalid_efl_gfx_entity_geometry_get)
+EDJE_PART_INVALID(Eina_Bool, 0, efl_ui_drag_value_set, _efl_canvas_layout_part_invalid_efl_ui_drag_drag_value_set, double dx, double dy)
+EDJE_PART_INVALID_CONST(Eina_Bool, 0, efl_ui_drag_value_get, _efl_canvas_layout_part_invalid_efl_ui_drag_drag_value_get, double *dx, double *dy)
+EDJE_PART_INVALID(Eina_Bool, 0, efl_ui_drag_size_set, _efl_canvas_layout_part_invalid_efl_ui_drag_drag_size_set, double dw, double dh)
+EDJE_PART_INVALID_CONST(Eina_Bool, 0, efl_ui_drag_size_get, _efl_canvas_layout_part_invalid_efl_ui_drag_drag_size_get, double *dw, double *dh)
+EDJE_PART_INVALID_CONST(Efl_Ui_Drag_Dir, 0, efl_ui_drag_dir_get, _efl_canvas_layout_part_invalid_efl_ui_drag_drag_dir_get)
+EDJE_PART_INVALID(Eina_Bool, 0, efl_ui_drag_step_set, _efl_canvas_layout_part_invalid_efl_ui_drag_drag_step_set, double dx, double dy)
+EDJE_PART_INVALID_CONST(Eina_Bool, 0, efl_ui_drag_step_get, _efl_canvas_layout_part_invalid_efl_ui_drag_drag_step_get, double *dx, double *dy)
+EDJE_PART_INVALID(Eina_Bool, 0, efl_ui_drag_step_move, _efl_canvas_layout_part_invalid_efl_ui_drag_drag_step_move, double dx, double dy)
+EDJE_PART_INVALID(Eina_Bool, 0, efl_ui_drag_page_set, _efl_canvas_layout_part_invalid_efl_ui_drag_drag_page_set, double dx, double dy)
+EDJE_PART_INVALID_CONST(Eina_Bool, 0, efl_ui_drag_page_get, _efl_canvas_layout_part_invalid_efl_ui_drag_drag_page_get, double *dx, double *dy)
+EDJE_PART_INVALID(Eina_Bool, 0, efl_ui_drag_page_move, _efl_canvas_layout_part_invalid_efl_ui_drag_drag_page_move, double dx, double dy)
+EDJE_PART_INVALID(Eina_Bool, 0, efl_content_set, _efl_canvas_layout_part_invalid_efl_content_content_set, Efl_Gfx_Entity *content)
+EDJE_PART_INVALID_CONST(Eo *, 0, efl_content_get, _efl_canvas_layout_part_invalid_efl_content_content_get)
+EDJE_PART_INVALID(Eo *, 0, efl_content_unset, _efl_canvas_layout_part_invalid_efl_content_content_unset)
+EDJE_PART_INVALID_VOID(efl_text_set, _efl_canvas_layout_part_invalid_efl_text_text_set, const char *text)
+EDJE_PART_INVALID_CONST(const char *, 0, efl_text_get, _efl_canvas_layout_part_invalid_efl_text_text_get)
+EDJE_PART_INVALID_VOID(efl_text_markup_set, _efl_canvas_layout_part_invalid_efl_text_markup_markup_set, const char *text)
+EDJE_PART_INVALID_CONST(const char *, 0, efl_text_markup_get, _efl_canvas_layout_part_invalid_efl_text_markup_markup_get)
+EDJE_PART_INVALID_CONST(Efl_Text_Cursor_Cursor *, 0, efl_text_cursor_get, _efl_canvas_layout_part_invalid_efl_text_cursor_text_cursor_get, Efl_Text_Cursor_Get_Type get_type)
+EDJE_PART_INVALID_VOID(efl_text_cursor_paragraph_first, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_paragraph_first, Efl_Text_Cursor_Cursor *cur)
+EDJE_PART_INVALID_VOID(efl_text_cursor_paragraph_last, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_paragraph_last, Efl_Text_Cursor_Cursor *cur)
+EDJE_PART_INVALID_VOID(efl_text_cursor_position_set, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_position_set, Efl_Text_Cursor_Cursor *cur, int position)
+EDJE_PART_INVALID_CONST(int, 0, efl_text_cursor_position_get, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_position_get, Efl_Text_Cursor_Cursor *cur)
+EDJE_PART_INVALID_VOID(efl_text_cursor_coord_set, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_coord_set, Efl_Text_Cursor_Cursor *cur, int x, int y)
+EDJE_PART_INVALID_VOID(efl_text_cursor_line_char_first, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_line_char_first, Efl_Text_Cursor_Cursor *cur)
+EDJE_PART_INVALID_VOID(efl_text_cursor_line_char_last, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_line_char_last, Efl_Text_Cursor_Cursor *cur)
+EDJE_PART_INVALID_VOID(efl_text_cursor_char_next, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_char_next, Efl_Text_Cursor_Cursor *cur)
+EDJE_PART_INVALID_VOID(efl_text_cursor_char_prev, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_char_prev, Efl_Text_Cursor_Cursor *cur)
+EDJE_PART_INVALID_VOID(efl_text_cursor_line_jump_by, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_line_jump_by, Efl_Text_Cursor_Cursor *cur, int by)
+EDJE_PART_INVALID_VOID(efl_text_cursor_copy, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_copy, Efl_Text_Cursor_Cursor *dst, const Efl_Text_Cursor_Cursor *src)
+EDJE_PART_INVALID_CONST(Eina_Unicode, 0, efl_text_cursor_content_get, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_content_get, const Efl_Text_Cursor_Cursor *cur)
+EDJE_PART_INVALID_CONST(Eina_Bool, 0, efl_text_cursor_geometry_get, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_geometry_get, const Efl_Text_Cursor_Cursor *cur, Efl_Text_Cursor_Type ctype, int *cx, int *cy, int *cw, int *ch, int *cx2, int *cy2, int *cw2, int *ch2)
+EDJE_PART_INVALID_VOID(efl_text_markup_cursor_markup_insert, _efl_canvas_layout_part_invalid_efl_text_markup_cursor_markup_insert, Efl_Text_Cursor_Cursor *cur, const char *markup)
+EDJE_PART_INVALID(Eina_Iterator *, 0, efl_content_iterate, _efl_canvas_layout_part_invalid_efl_container_content_iterate)
+EDJE_PART_INVALID(int, 0, efl_content_count, _efl_canvas_layout_part_invalid_efl_container_content_count)
+EDJE_PART_INVALID(Eina_Bool, 0, efl_content_remove, _efl_canvas_layout_part_invalid_efl_container_content_remove, Efl_Gfx_Entity *content)
+EDJE_PART_INVALID(Eina_Bool, 0, efl_pack_clear, _efl_canvas_layout_part_invalid_efl_pack_pack_clear)
+EDJE_PART_INVALID(Eina_Bool, 0, efl_pack_unpack_all, _efl_canvas_layout_part_invalid_efl_pack_unpack_all)
+EDJE_PART_INVALID(Eina_Bool, 0, efl_pack_unpack, _efl_canvas_layout_part_invalid_efl_pack_unpack, Efl_Gfx_Entity *subobj)
+EDJE_PART_INVALID(Eina_Bool, 0, efl_pack, _efl_canvas_layout_part_invalid_efl_pack_pack, Efl_Gfx_Entity *subobj)
+EDJE_PART_INVALID(Eina_Bool, 0, efl_pack_begin, _efl_canvas_layout_part_invalid_efl_pack_linear_pack_begin, Efl_Gfx_Entity *subobj)
+EDJE_PART_INVALID(Eina_Bool, 0, efl_pack_end, _efl_canvas_layout_part_invalid_efl_pack_linear_pack_end, Efl_Gfx_Entity *subobj)
+EDJE_PART_INVALID(Eina_Bool, 0, efl_pack_before, _efl_canvas_layout_part_invalid_efl_pack_linear_pack_before, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing)
+EDJE_PART_INVALID(Eina_Bool, 0, efl_pack_after, _efl_canvas_layout_part_invalid_efl_pack_linear_pack_after, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing)
+EDJE_PART_INVALID(Eina_Bool, 0, efl_pack_at, _efl_canvas_layout_part_invalid_efl_pack_linear_pack_at, Efl_Gfx_Entity *subobj, int index)
+EDJE_PART_INVALID(Efl_Gfx_Entity *, 0, efl_pack_content_get, _efl_canvas_layout_part_invalid_efl_pack_linear_pack_content_get, int index)
+EDJE_PART_INVALID(Efl_Gfx_Entity *, 0, efl_pack_unpack_at, _efl_canvas_layout_part_invalid_efl_pack_linear_pack_unpack_at, int index)
+EDJE_PART_INVALID(int, 0, efl_pack_index_get, _efl_canvas_layout_part_invalid_efl_pack_linear_pack_index_get, const Efl_Gfx_Entity *subobj)
+EDJE_PART_INVALID_CONST(Efl_Ui_Dir, 0, efl_ui_direction_get, _efl_canvas_layout_part_invalid_efl_ui_direction_direction_get)
+EDJE_PART_INVALID(Eina_Bool, 0, efl_pack_table, _efl_canvas_layout_part_invalid_efl_pack_table_pack_table, Efl_Gfx_Entity *subobj, int col, int row, int colspan, int rowspan)
+EDJE_PART_INVALID(Efl_Gfx_Entity *, 0, efl_pack_table_content_get, _efl_canvas_layout_part_invalid_efl_pack_table_table_content_get, int col, int row)
+EDJE_PART_INVALID(Eina_Iterator *, 0, efl_pack_table_contents_get, _efl_canvas_layout_part_invalid_efl_pack_table_table_contents_get, int col, int row, Eina_Bool below)
+EDJE_PART_INVALID_CONST(Eina_Bool, 0, efl_pack_table_position_get, _efl_canvas_layout_part_invalid_efl_pack_table_table_position_get, Efl_Gfx_Entity *subobj, int *col, int *row, int *colspan, int *rowspan)
+EDJE_PART_INVALID_VOID_CONST(efl_pack_table_size_get, _efl_canvas_layout_part_invalid_efl_pack_table_table_size_get, int *cols, int *rows)
+EDJE_PART_INVALID_CONST(int, 0, efl_pack_table_columns_get, _efl_canvas_layout_part_invalid_efl_pack_table_table_columns_get)
+EDJE_PART_INVALID_CONST(int, 0, efl_pack_table_rows_get, _efl_canvas_layout_part_invalid_efl_pack_table_table_rows_get)
+
+#pragma GCC diagnostic pop
+
+#include "efl_canvas_layout_part_invalid.eo.c"
diff --git a/src/lib/edje/edje_part_swallow.c b/src/lib/edje/edje_part_swallow.c
index 0ff632a20f..bf4c2b59cb 100644
--- a/src/lib/edje/edje_part_swallow.c
+++ b/src/lib/edje/edje_part_swallow.c
@@ -7,25 +7,25 @@ PROXY_IMPLEMENTATION(swallow, MY_CLASS, EINA_FALSE)
#undef PROXY_IMPLEMENTATION
/* Swallow parts */
-EOLIAN static Efl_Gfx *
-_efl_canvas_layout_part_swallow_efl_content_content_get(Eo *obj, void *_pd EINA_UNUSED)
+EOLIAN static Efl_Gfx_Entity *
+_efl_canvas_layout_part_swallow_efl_content_content_get(const Eo *obj, void *_pd EINA_UNUSED)
{
PROXY_DATA_GET(obj, pd);
return _edje_efl_content_content_get(pd->ed, pd->part);
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_swallow_efl_content_content_set(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *content)
+_efl_canvas_layout_part_swallow_efl_content_content_set(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx_Entity *content)
{
PROXY_DATA_GET(obj, pd);
return _edje_efl_content_content_set(pd->ed, pd->part, content);
}
-EOLIAN static Efl_Gfx *
+EOLIAN static Efl_Gfx_Entity *
_efl_canvas_layout_part_swallow_efl_content_content_unset(Eo *obj, void *_pd EINA_UNUSED)
{
PROXY_DATA_GET(obj, pd);
- Efl_Gfx *content = _edje_efl_content_content_get(pd->ed, pd->part);
+ Efl_Gfx_Entity *content = _edje_efl_content_content_get(pd->ed, pd->part);
if (!content) return NULL;
efl_content_remove(obj, content);
return content;
diff --git a/src/lib/edje/edje_part_table.c b/src/lib/edje/edje_part_table.c
index 87c694f2bf..cc2439dd89 100644
--- a/src/lib/edje/edje_part_table.c
+++ b/src/lib/edje/edje_part_table.c
@@ -10,54 +10,6 @@ PROXY_IMPLEMENTATION(table, MY_CLASS, EINA_FALSE)
typedef struct _Part_Item_Iterator Part_Item_Iterator;
-/* this iterator is the same as efl_ui_box */
-static Eina_Bool
-_part_item_iterator_next(Part_Item_Iterator *it, void **data)
-{
- Efl_Gfx *sub;
-
- if (!it->object) return EINA_FALSE;
- if (!eina_iterator_next(it->real_iterator, (void **) &sub))
- return EINA_FALSE;
-
- if (data) *data = sub;
- return EINA_TRUE;
-}
-
-static Eo *
-_part_item_iterator_get_container(Part_Item_Iterator *it)
-{
- return it->object;
-}
-
-static void
-_part_item_iterator_free(Part_Item_Iterator *it)
-{
- eina_iterator_free(it->real_iterator);
- efl_wref_del(it->object, &it->object);
- free(it);
-}
-
-static Eina_Iterator *
-_part_item_iterator_create(Eo *obj, Eina_Iterator *real_iterator)
-{
- Part_Item_Iterator *it;
-
- it = calloc(1, sizeof(*it));
- if (!it) return NULL;
-
- EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
-
- it->real_iterator = real_iterator;
- it->iterator.version = EINA_ITERATOR_VERSION;
- it->iterator.next = FUNC_ITERATOR_NEXT(_part_item_iterator_next);
- it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_part_item_iterator_get_container);
- it->iterator.free = FUNC_ITERATOR_FREE(_part_item_iterator_free);
- efl_wref_add(obj, &it->object);
-
- return &it->iterator;
-}
-
EOLIAN static Eina_Iterator *
_efl_canvas_layout_part_table_efl_container_content_iterate(Eo *obj, void *_pd EINA_UNUSED)
{
@@ -67,7 +19,7 @@ _efl_canvas_layout_part_table_efl_container_content_iterate(Eo *obj, void *_pd E
if (!pd->rp->typedata.container) return NULL;
it = evas_object_table_iterator_new(pd->rp->object);
- return _part_item_iterator_create(pd->rp->object, it);
+ return efl_canvas_iterator_create(pd->rp->object, it, NULL);
}
EOLIAN static int
@@ -78,7 +30,7 @@ _efl_canvas_layout_part_table_efl_container_content_count(Eo *obj, void *_pd EIN
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_table_efl_container_content_remove(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED EINA_UNUSED, Efl_Gfx *content)
+_efl_canvas_layout_part_table_efl_container_content_remove(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED EINA_UNUSED, Efl_Gfx_Entity *content)
{
return efl_pack_unpack(obj, content);
}
@@ -98,20 +50,20 @@ _efl_canvas_layout_part_table_efl_pack_unpack_all(Eo *obj, void *_pd EINA_UNUSED
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_table_efl_pack_unpack(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, Efl_Gfx *subobj)
+_efl_canvas_layout_part_table_efl_pack_unpack(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, Efl_Gfx_Entity *subobj)
{
PROXY_DATA_GET(obj, pd);
return _edje_part_table_unpack(pd->ed, pd->part, subobj);
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_table_efl_pack_table_pack_table(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *subobj, int col, int row, int colspan, int rowspan)
+_efl_canvas_layout_part_table_efl_pack_table_pack_table(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx_Entity *subobj, int col, int row, int colspan, int rowspan)
{
PROXY_DATA_GET(obj, pd);
return _edje_part_table_pack(pd->ed, pd->part, subobj, col, row, colspan, rowspan);
}
-EOLIAN static Efl_Gfx *
+EOLIAN static Efl_Gfx_Entity *
_efl_canvas_layout_part_table_efl_pack_table_table_content_get(Eo *obj, void *_pd EINA_UNUSED, int col, int row)
{
PROXY_DATA_GET(obj, pd);
@@ -119,14 +71,14 @@ _efl_canvas_layout_part_table_efl_pack_table_table_content_get(Eo *obj, void *_p
}
EOLIAN static void
-_efl_canvas_layout_part_table_efl_pack_table_table_size_get(Eo *obj, void *_pd EINA_UNUSED, int *cols, int *rows)
+_efl_canvas_layout_part_table_efl_pack_table_table_size_get(const Eo *obj, void *_pd EINA_UNUSED, int *cols, int *rows)
{
PROXY_DATA_GET(obj, pd);
_edje_part_table_col_row_size_get(pd->ed, pd->part, cols, rows);
}
EOLIAN static int
-_efl_canvas_layout_part_table_efl_pack_table_table_columns_get(Eo *obj, void *_pd EINA_UNUSED)
+_efl_canvas_layout_part_table_efl_pack_table_table_columns_get(const Eo *obj, void *_pd EINA_UNUSED)
{
PROXY_DATA_GET(obj, pd);
int cols = 0, rows = 0;
@@ -135,7 +87,7 @@ _efl_canvas_layout_part_table_efl_pack_table_table_columns_get(Eo *obj, void *_p
}
EOLIAN static int
-_efl_canvas_layout_part_table_efl_pack_table_table_rows_get(Eo *obj, void *_pd EINA_UNUSED)
+_efl_canvas_layout_part_table_efl_pack_table_table_rows_get(const Eo *obj, void *_pd EINA_UNUSED)
{
PROXY_DATA_GET(obj, pd);
int cols = 0, rows = 0;
@@ -148,7 +100,7 @@ _efl_canvas_layout_part_table_efl_pack_table_table_rows_get(Eo *obj, void *_pd E
static Eina_Bool
_table_item_iterator_next(Part_Item_Iterator *it, void **data)
{
- Efl_Gfx *sub;
+ Efl_Gfx_Entity *sub;
if (!it->object) return EINA_FALSE;
if (!eina_iterator_next(it->real_iterator, (void **) &sub))
@@ -217,7 +169,7 @@ _efl_canvas_layout_part_table_efl_pack_table_table_contents_get(Eo *obj, void *_
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_table_efl_pack_table_table_position_get(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx * subobj, int *col, int *row, int *colspan, int *rowspan)
+_efl_canvas_layout_part_table_efl_pack_table_table_position_get(const Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx_Entity * subobj, int *col, int *row, int *colspan, int *rowspan)
{
unsigned short c, r, cs, rs;
Eina_Bool ret;
diff --git a/src/lib/edje/edje_part_text.c b/src/lib/edje/edje_part_text.c
index f196c2d8a8..6e8e231ae2 100644
--- a/src/lib/edje/edje_part_text.c
+++ b/src/lib/edje/edje_part_text.c
@@ -11,23 +11,23 @@ _efl_canvas_layout_part_text_efl_text_text_set(Eo *obj,
void *_pd EINA_UNUSED, const char *text)
{
PROXY_DATA_GET(obj, pd);
- _edje_efl_text_set(obj, pd->ed, pd->part, text, EINA_FALSE, EINA_FALSE);
+ _edje_efl_text_text_set(obj, pd->ed, pd->part, text, EINA_FALSE, EINA_FALSE);
}
EOLIAN static const char *
-_efl_canvas_layout_part_text_efl_text_text_get(Eo *obj,
+_efl_canvas_layout_part_text_efl_text_text_get(const Eo *obj,
void *_pd EINA_UNUSED)
{
PROXY_DATA_GET(obj, pd);
- return _edje_efl_text_get(obj, pd->ed, pd->part, EINA_FALSE, EINA_FALSE);
+ return _edje_efl_text_text_get(obj, pd->ed, pd->part, EINA_FALSE, EINA_FALSE);
}
EOLIAN static const char *
-_efl_canvas_layout_part_text_efl_text_markup_markup_get(Eo *obj,
+_efl_canvas_layout_part_text_efl_text_markup_markup_get(const Eo *obj,
void *_pd EINA_UNUSED)
{
PROXY_DATA_GET(obj, pd);
- return _edje_efl_text_get(obj, pd->ed, pd->part, EINA_FALSE, EINA_TRUE);
+ return _edje_efl_text_text_get(obj, pd->ed, pd->part, EINA_FALSE, EINA_TRUE);
}
EOLIAN static void
@@ -35,13 +35,13 @@ _efl_canvas_layout_part_text_efl_text_markup_markup_set(Eo *obj,
void *_pd EINA_UNUSED, const char *text)
{
PROXY_DATA_GET(obj, pd);
- _edje_efl_text_set(obj, pd->ed, pd->part, text, EINA_FALSE, EINA_TRUE);
+ _edje_efl_text_text_set(obj, pd->ed, pd->part, text, EINA_FALSE, EINA_TRUE);
}
EOLIAN static Efl_Text_Cursor_Cursor *
-_efl_canvas_layout_part_text_efl_text_cursor_cursor_get(Eo *obj,
- void *_pd EINA_UNUSED, Efl_Text_Cursor_Cursor_Get_Type get_type)
+_efl_canvas_layout_part_text_efl_text_cursor_text_cursor_get(const Eo *obj,
+ void *_pd EINA_UNUSED, Efl_Text_Cursor_Get_Type get_type)
{
PROXY_DATA_GET(obj, pd);
return _edje_text_cursor_get(pd->rp, (int) get_type);
@@ -72,7 +72,7 @@ _efl_canvas_layout_part_text_efl_text_cursor_cursor_position_set(Eo *obj,
}
EOLIAN static int
-_efl_canvas_layout_part_text_efl_text_cursor_cursor_position_get(Eo *obj,
+_efl_canvas_layout_part_text_efl_text_cursor_cursor_position_get(const Eo *obj,
void *_pd EINA_UNUSED, Efl_Text_Cursor_Cursor *cur)
{
PROXY_DATA_GET(obj, pd);
@@ -146,7 +146,7 @@ _efl_canvas_layout_part_text_efl_text_cursor_cursor_copy(Eo *obj,
}
EOLIAN static Eina_Unicode
-_efl_canvas_layout_part_text_efl_text_cursor_cursor_content_get(Eo *obj,
+_efl_canvas_layout_part_text_efl_text_cursor_cursor_content_get(const Eo *obj,
void *_pd EINA_UNUSED,
const Efl_Text_Cursor_Cursor *cur)
{
@@ -168,10 +168,10 @@ _efl_canvas_layout_part_text_efl_text_cursor_cursor_content_get(Eo *obj,
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_text_efl_text_cursor_cursor_geometry_get(Eo *obj,
+_efl_canvas_layout_part_text_efl_text_cursor_cursor_geometry_get(const Eo *obj,
void *_pd EINA_UNUSED,
const Efl_Text_Cursor_Cursor *cur EINA_UNUSED,
- Efl_Text_Cursor_Cursor_Type ctype EINA_UNUSED,
+ Efl_Text_Cursor_Type ctype EINA_UNUSED,
Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch,
Evas_Coord *cx2 EINA_UNUSED, Evas_Coord *cy2 EINA_UNUSED,
Evas_Coord *cw2 EINA_UNUSED, Evas_Coord *ch2 EINA_UNUSED)
diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index 79737c12a7..2c12ea6a51 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -75,15 +75,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_EDJE_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EDJE_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -429,8 +429,9 @@ typedef struct _Edje_Signal_Callback_Custom Edje_Signal_Callback_Custom;
#define EDJE_IMAGE_SOURCE_TYPE_INLINE_LOSSY 2
#define EDJE_IMAGE_SOURCE_TYPE_INLINE_LOSSY_ETC1 3
#define EDJE_IMAGE_SOURCE_TYPE_INLINE_LOSSY_ETC2 4
-#define EDJE_IMAGE_SOURCE_TYPE_EXTERNAL 5
-#define EDJE_IMAGE_SOURCE_TYPE_LAST 6
+#define EDJE_IMAGE_SOURCE_TYPE_USER 5
+#define EDJE_IMAGE_SOURCE_TYPE_EXTERNAL 6
+#define EDJE_IMAGE_SOURCE_TYPE_LAST 7
#define EDJE_SOUND_SOURCE_TYPE_NONE 0
#define EDJE_SOUND_SOURCE_TYPE_INLINE_RAW 1
@@ -551,6 +552,11 @@ struct _AABB {
int rel_to;
};
+typedef struct Edje_Image_Hash
+{
+ int id;
+} Edje_Image_Hash;
+
struct _Edje_File
{
const char *path;
@@ -563,6 +569,10 @@ struct _Edje_File
Edje_Mo_Directory *mo_dir;
Edje_Gfx_Filter_Directory *filter_dir;
+ Eina_Hash *image_id_hash;
+ Eina_Stringshare **requires;
+ unsigned int requires_count;
+
Eina_List *styles;
Eina_List *color_tree;
@@ -600,6 +610,7 @@ struct _Edje_File
int major;
int minor;
} efl_version;
+ Eina_Stringshare *id;
FLOAT_T base_scale;
@@ -681,6 +692,7 @@ struct _Edje_Image_Directory_Entry
const char *entry; /* the nominal name of the image - if any */
int source_type; /* alternate source mode. 0 = none */
int source_param; /* extra params on encoding */
+ Eina_Stringshare *external_id;
int id; /* the id no. of the image */
};
@@ -2189,6 +2201,8 @@ struct _Edje_Message_Signal_Data
int ref;
void *data;
void (*free_func)(void *);
+ void *seat_data;
+ void (*seat_free_func)(void *);
};
struct _Edje_Message_Signal
@@ -2376,6 +2390,7 @@ extern Eina_Cow *_edje_calc_params_map_cow;
extern Eina_Cow *_edje_calc_params_physics_cow;
extern Eina_Hash *_edje_file_hash;
+extern Eina_Hash *_edje_id_hash;
extern const char *_edje_language;
extern const char *_edje_cache_path;
@@ -2484,6 +2499,7 @@ EAPI void _edje_edd_shutdown(void);
int _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const char *group, const char *parent, Eina_List *group_path, Eina_Array *nested);
+void _edje_file_callbacks_del(Edje *ed, Evas *e);
void _edje_file_del(Edje *ed);
void _edje_file_free(Edje_File *edf);
void _edje_file_cache_shutdown(void);
@@ -2507,16 +2523,20 @@ void _edje_unref(Edje *ed);
void _edje_program_run_cleanup(Edje *ed, Edje_Running_Program *runp);
Eina_Bool _edje_program_run_iterate(Edje_Running_Program *runp, double tim);
void _edje_program_end(Edje *ed, Edje_Running_Program *runp);
-void _edje_program_run(Edje *ed, Edje_Program *pr, Eina_Bool force, const char *ssig, const char *ssrc);
+void _edje_program_run(Edje *ed, Edje_Program *pr, Eina_Bool force, const char *ssig, const char *ssrc, Edje_Message_Signal_Data *mdata);
void _edje_programs_patterns_clean(Edje_Part_Collection *ed);
void _edje_programs_patterns_init(Edje_Part_Collection *ed);
void _edje_emit(Edje *ed, const char *sig, const char *src);
void _edje_seat_emit(Edje *ed, Efl_Input_Device *dev, const char *sig, const char *src);
void _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*free_func)(void *));
+void _edje_emit_full_data(Edje *ed, const char *sig, const char *src, Edje_Message_Signal_Data *mdata);
void _edje_emit_handle(Edje *ed, const char *sig, const char *src, Edje_Message_Signal_Data *data, Eina_Bool prop);
void _edje_signals_sources_patterns_clean(Edje_Signals_Sources_Patterns *ssp);
const char * _edje_object_part_state_get(Edje *ed, const char *part, double *val_ret);
+void _edje_signal_data_free(Edje_Message_Signal_Data *mdata);
+void _edje_signal_data_ref(Edje_Message_Signal_Data *mdata);
+
void _edje_focused_part_set(Edje *ed, const char *seat_name, Edje_Real_Part *rp);
Edje_Real_Part *_edje_focused_part_get(Edje *ed, const char *seat_name);
void _edje_part_focus_set(Edje *ed, const char *seat_name, Edje_Real_Part *rp);
@@ -2531,6 +2551,7 @@ void _edje_signal_callback_reset(Edje_Signal_Callback_Flags *flags, unsigned int
void _edje_signal_callback_free(const Edje_Signal_Callback_Group *gp);
+const char * _set_translated_string(Edje *ed, Edje_Real_Part *ep);
void _edje_text_init(void);
void _edje_text_part_on_add(Edje *ed, Edje_Real_Part *ep);
void _edje_text_part_on_del(Edje *ed, Edje_Part *ep);
@@ -2861,6 +2882,8 @@ Eina_Bool _edje_entry_input_panel_return_key_disabled_get(Edje_Real_Part *rp);
void _edje_entry_input_panel_show_on_demand_set(Edje_Real_Part *rp, Eina_Bool ondemand);
Eina_Bool _edje_entry_input_panel_show_on_demand_get(Edje_Real_Part *rp);
void _edje_entry_prediction_hint_set(Edje_Real_Part *rp, const char *prediction_hint);
+Eina_Bool _edje_entry_prediction_hint_hash_set(Edje_Real_Part *rp, const char *key, const char *value);
+Eina_Bool _edje_entry_prediction_hint_hash_del(Edje_Real_Part *rp, const char *key);
Eina_Bool _edje_entry_hide_visible_password(Edje *edje, Edje_Real_Part *rp);
void _edje_external_init(void);
@@ -3134,10 +3157,11 @@ Eina_Bool _edje_object_part_drag_step(Edje *ed, const char *part, double dx, dou
Eina_Bool _edje_object_part_drag_page(Edje *ed, const char *part, double dx, double dy);
/* part proxy */
-Eo *_edje_other_internal_proxy_get(Edje_Object *obj, Edje *ed, Edje_Real_Part *rp);
+Eo *_edje_other_internal_proxy_get(Edje_Object *obj, Edje *ed, Edje_Real_Part *rp, const char *part);
+Eo *_edje_invalid_internal_proxy_get(Edje_Object *obj, Edje *ed, Edje_Real_Part *rp, const char *part);
/* part containers: box */
-Eo *_edje_box_internal_proxy_get(Edje_Object *obj, Edje *ed, Edje_Real_Part *rp);
+Eo *_edje_box_internal_proxy_get(Edje_Object *obj, Edje *ed, Edje_Real_Part *rp, const char *part);
Eina_Bool _edje_part_box_append(Edje *ed, const char *part, Evas_Object *child);
Eina_Bool _edje_part_box_prepend(Edje *ed, const char *part, Evas_Object *child);
Eina_Bool _edje_part_box_insert_before(Edje *ed, const char *part, Evas_Object *child, const Evas_Object *reference);
@@ -3149,7 +3173,7 @@ Evas_Object *_edje_part_box_remove_at(Edje *ed, const char *part, unsigned int p
Eina_Bool _edje_part_box_remove_all(Edje *ed, const char *part, Eina_Bool clear);
/* part containers: table */
-Eo *_edje_table_internal_proxy_get(Edje_Object *obj, Edje *ed, Edje_Real_Part *rp);
+Eo *_edje_table_internal_proxy_get(Edje_Object *obj, Edje *ed, Edje_Real_Part *rp, const char *part);
Evas_Object *_edje_part_table_child_get(Edje *ed, const char *part, unsigned int col, unsigned int row);
Eina_Bool _edje_part_table_pack(Edje *ed, const char *part, Evas_Object *child_obj, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan);
Eina_Bool _edje_part_table_unpack(Edje *ed, const char *part, Evas_Object *child_obj);
@@ -3157,12 +3181,12 @@ Eina_Bool _edje_part_table_col_row_size_get(Edje *ed, const char *part, int *col
Eina_Bool _edje_part_table_clear(Edje *ed, const char *part, Eina_Bool clear);
/* part containers: swallow */
-Eo *_edje_swallow_internal_proxy_get(Edje_Object *obj, Edje *ed, Edje_Real_Part *rp);
-Efl_Gfx *_edje_efl_content_content_get(Edje *ed, const char *part);
-Eina_Bool _edje_efl_content_content_set(Edje *ed, const char *part, Efl_Gfx *obj_swallow);
+Eo *_edje_swallow_internal_proxy_get(Edje_Object *obj, Edje *ed, Edje_Real_Part *rp, const char *part);
+Efl_Gfx_Entity *_edje_efl_content_content_get(Edje *ed, const char *part);
+Eina_Bool _edje_efl_content_content_set(Edje *ed, const char *part, Efl_Gfx_Entity *obj_swallow);
/* part containers: external */
-Eo *_edje_external_internal_proxy_get(Edje_Object *obj, Edje *ed, Edje_Real_Part *rp);
+Eo *_edje_external_internal_proxy_get(Edje_Object *obj, Edje *ed, Edje_Real_Part *rp, const char *part);
Eina_Bool _edje_object_part_external_param_set(Edje *ed, const char *part, const Edje_External_Param *param);
Eina_Bool _edje_object_part_external_param_get(Edje *ed, const char *part, Edje_External_Param *param);
Edje_External_Param_Type _edje_object_part_external_param_type_get(Edje *ed, const char *part, const char *param);
@@ -3170,9 +3194,9 @@ Evas_Object *_edje_object_part_external_object_get(Edje *ed, const char *part);
Evas_Object *_edje_object_part_external_content_get(Edje *ed, const char *part, const char *content);
/* part text */
-Eo *_edje_text_internal_proxy_get(Edje_Object *obj, Edje *ed, Edje_Real_Part *rp);
-Eina_Bool _edje_efl_text_set(Eo *obj, Edje *ed, const char *part, const char *text, Eina_Bool legacy, Eina_Bool set_markup);
-const char *_edje_efl_text_get(Eo *obj, Edje *ed, const char *part, Eina_Bool legacy, Eina_Bool get_markup);
+Eo *_edje_text_internal_proxy_get(Edje_Object *obj, Edje *ed, Edje_Real_Part *rp, const char *part);
+Eina_Bool _edje_efl_text_text_set(Eo *obj, Edje *ed, const char *part, const char *text, Eina_Bool legacy, Eina_Bool set_markup);
+const char *_edje_efl_text_text_get(const Eo *obj, Edje *ed, const char *part, Eina_Bool legacy, Eina_Bool get_markup);
Eina_Bool _edje_efl_text_markup_set(Eo *obj, Edje *ed, const char *part, const char *markup);
const char *_edje_efl_text_markup_get(Eo *obj, Edje *ed, const char *part);
Evas_Textblock_Cursor *_edje_text_cursor_get(Edje_Real_Part *rp, Edje_Cursor cur);
@@ -3270,12 +3294,9 @@ extern Edje_Ephysics *_edje_ephysics;
#endif
-
-
#ifdef HAVE_LIBREMIX
#include <remix/remix.h>
#endif
-#include <Eina.h>
typedef struct _Edje_Multisense_Env Edje_Multisense_Env;
@@ -3291,6 +3312,8 @@ typedef Eina_Bool (*MULTISENSE_FACTORY_INIT_FUNC) (Edje_Multisense_Env *);
typedef RemixBase* (*MULTISENSE_SOUND_PLAYER_GET_FUNC) (Edje_Multisense_Env *);
#endif
+#include "efl_canvas_layout_part_invalid.eo.h"
+
#undef EAPI
#define EAPI
diff --git a/src/lib/edje/edje_program.c b/src/lib/edje/edje_program.c
index 1746c7f560..562c3964dd 100644
--- a/src/lib/edje/edje_program.c
+++ b/src/lib/edje/edje_program.c
@@ -128,24 +128,56 @@ _edje_emit_child(Edje *ed, Edje_Real_Part *rp, const char *part, const char *sig
return ed->collection->broadcast_signal;
}
-static void
-_edje_emit_send(Edje *ed, Eina_Bool broadcast, const char *sig, const char *src, void *data, Ecore_Cb free_func)
+static Edje_Message_Signal_Data *
+_edje_signal_data_setup(void *data, Ecore_Cb free_func, void *seat_data, Ecore_Cb seat_free_func)
{
- Edje_Message_Signal emsg;
+ Edje_Message_Signal_Data *out = NULL;
- emsg.sig = sig;
- emsg.src = src;
- if (data)
+ if (data || seat_data)
{
- emsg.data = calloc(1, sizeof(*(emsg.data)));
- emsg.data->ref = 1;
- emsg.data->data = data;
- emsg.data->free_func = free_func;
+ out = calloc(1, sizeof(*out));
+ if (!out) return NULL;
+
+ out->ref = 1;
+ out->data = data;
+ out->free_func = free_func;
+ out->seat_data = seat_data;
+ out->seat_free_func = seat_free_func;
}
- else
+ return out;
+}
+
+void
+_edje_signal_data_free(Edje_Message_Signal_Data *mdata)
+{
+ if (!mdata) return;
+ if (--(mdata->ref)) return;
+
+ if (mdata->free_func)
+ {
+ mdata->free_func(mdata->data);
+ }
+ if (mdata->seat_free_func)
{
- emsg.data = NULL;
+ mdata->seat_free_func(mdata->seat_data);
}
+ free(mdata);
+}
+
+void
+_edje_signal_data_ref(Edje_Message_Signal_Data *mdata)
+{
+ if (mdata) mdata->ref++;
+}
+
+static void
+_edje_emit_send(Edje *ed, Eina_Bool broadcast, const char *sig, const char *src, Edje_Message_Signal_Data *mdata)
+{
+ Edje_Message_Signal emsg;
+
+ emsg.sig = sig;
+ emsg.src = src;
+ emsg.data = mdata;
/* new sends code */
if (broadcast)
edje_object_message_send(ed->obj, EDJE_MESSAGE_SIGNAL, 0, &emsg);
@@ -163,14 +195,6 @@ _edje_emit_send(Edje *ed, Eina_Bool broadcast, const char *sig, const char *src,
_edje_util_message_send(ed2, EDJE_QUEUE_SCRIPT, EDJE_MESSAGE_SIGNAL, 0, &emsg);
}
*/
- if (emsg.data && (--(emsg.data->ref) == 0))
- {
- if (emsg.data->free_func)
- {
- emsg.data->free_func(emsg.data->data);
- }
- free(emsg.data);
- }
}
/*============================================================================*
@@ -178,13 +202,13 @@ _edje_emit_send(Edje *ed, Eina_Bool broadcast, const char *sig, const char *src,
*============================================================================*/
EOLIAN Eina_Stringshare*
-_efl_canvas_layout_seat_name_get(Eo *obj EINA_UNUSED, Edje *ed, Efl_Input_Device *device)
+_efl_canvas_layout_seat_name_get(const Eo *obj EINA_UNUSED, Edje *ed, Efl_Input_Device *device)
{
return _edje_seat_name_get(ed, device);
}
EOLIAN Efl_Input_Device *
-_efl_canvas_layout_seat_get(Eo *obj EINA_UNUSED, Edje *ed, Eina_Stringshare *name)
+_efl_canvas_layout_seat_get(const Eo *obj EINA_UNUSED, Edje *ed, Eina_Stringshare *name)
{
return _edje_seat_get(ed, name);
}
@@ -356,7 +380,7 @@ break_prog:
}
EOLIAN Eina_Bool
-_efl_canvas_layout_animation_get(Eo *obj EINA_UNUSED, Edje *ed)
+_efl_canvas_layout_animation_get(const Eo *obj EINA_UNUSED, Edje *ed)
{
if (!ed) return EINA_FALSE;
if (ed->delete_me) return EINA_FALSE;
@@ -463,7 +487,7 @@ _edje_program_run_iterate(Edje_Running_Program *runp, double tim)
if (pa->id >= 0)
{
pr = ed->collection->patterns.table_programs[pa->id % ed->collection->patterns.table_programs_size];
- if (pr) _edje_program_run(ed, pr, 0, "", "");
+ if (pr) _edje_program_run(ed, pr, 0, "", "", NULL);
if (_edje_block_break(ed))
{
if ((!ed->walking_actions) && (runp->ref == 0))
@@ -620,7 +644,7 @@ not_allowed:
}
void
-_edje_program_run(Edje *ed, Edje_Program *pr, Eina_Bool force, const char *ssig, const char *ssrc)
+_edje_program_run(Edje *ed, Edje_Program *pr, Eina_Bool force, const char *ssig, const char *ssrc, Edje_Message_Signal_Data *mdata)
{
Eina_List *l;
Edje_Real_Part *rp;
@@ -780,7 +804,7 @@ low_mem_current:
if (pa->id >= 0)
{
pr2 = ed->collection->patterns.table_programs[pa->id % ed->collection->patterns.table_programs_size];
- if (pr2) _edje_program_run(ed, pr2, 0, "", "");
+ if (pr2) _edje_program_run(ed, pr2, 0, "", "", mdata);
if (_edje_block_break(ed)) goto break_prog;
}
}
@@ -841,12 +865,12 @@ low_mem_current:
Eina_Bool broadcast;
broadcast = _edje_emit_child(ed, rp, rp->part->name, pr->state, pr->state2);
- _edje_emit_send(ed, broadcast, pr->state, pr->state2, NULL, NULL);
+ _edje_emit_send(ed, broadcast, pr->state, pr->state2, mdata);
}
}
}
else
- _edje_emit(ed, pr->state, pr->state2);
+ _edje_emit_full_data(ed, pr->state, pr->state2, mdata);
if (_edje_block_break(ed)) goto break_prog;
// _edje_emit(ed, "program,stop", pr->name);
if (_edje_block_break(ed)) goto break_prog;
@@ -1202,7 +1226,7 @@ low_mem_current:
if (pa->id >= 0)
{
pr2 = ed->collection->patterns.table_programs[pa->id % ed->collection->patterns.table_programs_size];
- if (pr2) _edje_program_run(ed, pr2, 0, "", "");
+ if (pr2) _edje_program_run(ed, pr2, 0, "", "", mdata);
if (_edje_block_break(ed)) goto break_prog;
}
}
@@ -1224,33 +1248,52 @@ _edje_emit(Edje *ed, const char *sig, const char *src)
void
_edje_seat_emit(Edje *ed, Efl_Input_Device *dev, const char *sig, const char *src)
{
- Efl_Input_Device *seat;
+ Edje_Message_Signal_Data *mdata = NULL;
+ Efl_Input_Device *seat = NULL;
char buf[128];
+ char *sname;
- /* keep sending signals without seat information for legacy compatibility */
- _edje_emit_full(ed, sig, src, NULL, NULL);
+ if (dev) seat = efl_input_device_seat_get(dev);
+ if (seat)
+ {
+ sname = strdup(efl_name_get(seat));
+ mdata = _edje_signal_data_setup(NULL, NULL, sname, free);
+ }
+ /* keep sending old style signals for legacy compatibility, but provide */
+ /* queryable seat data for callers that can make use of it. */
+ _edje_emit_full_data(ed, sig, src, mdata);
/* send extra signal with ",$SEAT" suffix if the input device originating
* the signal belongs to a seat */
- if (!dev) return;
-
- seat = efl_input_device_seat_get(dev);
if (!seat) return;
snprintf(buf, sizeof(buf), "seat,%s,%s", _edje_seat_name_get(ed, seat), sig);
- _edje_emit_full(ed, buf, src, NULL, NULL);
+ _edje_emit_full_data(ed, buf, src, mdata);
+ _edje_signal_data_free(mdata);
}
/* data should either be NULL or a malloc allocated data */
void
_edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*free_func)(void *))
{
+ Edje_Message_Signal_Data *mdata;
+
+ mdata = _edje_signal_data_setup(data, free_func, NULL, NULL);
+ _edje_emit_full_data(ed, sig, src, mdata);
+ _edje_signal_data_free(mdata);
+}
+
+void
+_edje_emit_full_data(Edje *ed, const char *sig, const char *src, Edje_Message_Signal_Data *mdata)
+{
const char *sep;
Eina_Bool broadcast;
if (!ed->collection) return;
if (ed->delete_me) return;
+ _edje_signal_data_ref(mdata);
+
sep = strchr(sig, EDJE_PART_PATH_SEPARATOR);
/* If we are not sending the signal to a part of the child, the
* signal if for ourself
@@ -1269,14 +1312,16 @@ _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*f
newsig = sep + 1;
- if (_edje_emit_aliased(ed, part, newsig, src)) return;
+ if (_edje_emit_aliased(ed, part, newsig, src)) goto out;
broadcast = _edje_emit_child(ed, NULL, part, newsig, src);
}
else
broadcast = ed->collection->broadcast_signal;
- _edje_emit_send(ed, broadcast, sig, src, data, free_func);
+ _edje_emit_send(ed, broadcast, sig, src, mdata);
+out:
+ _edje_signal_data_free(mdata);
}
void
@@ -1457,7 +1502,7 @@ _edje_emit_handle(Edje *ed, const char *sig, const char *src,
EINA_LIST_FOREACH(matches, l, pr)
if (pr->exec)
{
- _edje_program_run(ed, pr, 0, sig, src);
+ _edje_program_run(ed, pr, 0, sig, src, sdata);
if (_edje_block_break(ed))
{
goto break_prog;
@@ -1512,7 +1557,7 @@ _edje_emit_handle(Edje *ed, const char *sig, const char *src,
#endif
{
if (pr->exec)
- _edje_program_run(ed, pr, 0, sig, src);
+ _edje_program_run(ed, pr, 0, sig, src, sdata);
if (_edje_block_break(ed))
{
@@ -1555,6 +1600,7 @@ break_prog:
/* Extra data for callbacks */
static void *callback_extra_data = NULL;
+static void *callback_seat_data = NULL;
EAPI void *
edje_object_signal_callback_extra_data_get(void)
@@ -1562,6 +1608,14 @@ edje_object_signal_callback_extra_data_get(void)
return callback_extra_data;
}
+#ifdef EFL_BETA_API_SUPPORT
+EAPI void *
+edje_object_signal_callback_seat_data_get(void)
+{
+ return callback_seat_data;
+}
+#endif
+
/* FIXME: what if we delete the evas object??? */
static void
_edje_emit_cb(Edje *ed, const char *sig, const char *src, Edje_Message_Signal_Data *data, Eina_Bool prop)
@@ -1587,6 +1641,7 @@ _edje_emit_cb(Edje *ed, const char *sig, const char *src, Edje_Message_Signal_Da
EINA_REFCOUNT_REF(m);
callback_extra_data = (data) ? data->data : NULL;
+ callback_seat_data = (data) ? data->seat_data : NULL;
if (eina_inarray_count(&ssp->u.callbacks.globing))
r = edje_match_callback_exec(ssp,
diff --git a/src/lib/edje/edje_smart.c b/src/lib/edje/edje_smart.c
index ae038fb10e..29d042c40d 100644
--- a/src/lib/edje/edje_smart.c
+++ b/src/lib/edje/edje_smart.c
@@ -1,5 +1,6 @@
#define EFL_CANVAS_GROUP_PROTECTED
#define EFL_CANVAS_GROUP_BETA
+#define EFL_PART_PROTECTED
#include "edje_private.h"
@@ -20,7 +21,7 @@ EAPI Evas_Object *
edje_object_add(Evas *evas)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(evas, NULL);
- return efl_add(MY_CLASS, evas, efl_canvas_object_legacy_ctor(efl_added));
+ return efl_add(MY_CLASS, evas_find(evas), efl_canvas_object_legacy_ctor(efl_added));
}
EOLIAN static Eo *
@@ -47,6 +48,34 @@ _efl_canvas_layout_efl_object_constructor(Eo *obj, Edje *ed)
return obj;
}
+
+EOLIAN static void
+_efl_canvas_layout_efl_object_invalidate(Eo *obj, Edje *ed)
+{
+ _edje_file_callbacks_del(ed, NULL);
+
+ efl_invalidate(efl_super(obj, MY_CLASS));
+
+ //invalidate is done, this means the legacy evas deletion event is called.
+ for (int i = 0; i < ed->table_parts_size; ++i)
+ {
+ Edje_Real_Part *rp = ed->table_parts[i];
+ switch(rp->type)
+ {
+ case EDJE_RP_TYPE_SWALLOW:
+ _edje_real_part_swallow_clear(ed, rp);
+ break;
+
+ case EDJE_RP_TYPE_CONTAINER:
+ if (rp->part->type == EDJE_PART_TYPE_BOX)
+ _edje_real_part_box_remove_all(ed, rp, 0);
+ else if (rp->part->type == EDJE_PART_TYPE_TABLE)
+ _edje_real_part_table_clear(ed, rp, 0);
+ break;
+ }
+ }
+}
+
EOLIAN static void
_efl_canvas_layout_efl_object_debug_name_override(Eo *obj, Edje *ed, Eina_Strbuf *sb)
{
@@ -155,14 +184,14 @@ _efl_canvas_layout_efl_canvas_group_group_del(Eo *obj, Edje *ed)
}
EOLIAN static void
-_efl_canvas_layout_efl_gfx_position_set(Eo *obj, Edje *ed, Eina_Position2D pos)
+_efl_canvas_layout_efl_gfx_entity_position_set(Eo *obj, Edje *ed, Eina_Position2D pos)
{
unsigned short i;
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
- efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
if ((ed->x == pos.x) && (ed->y == pos.y)) return;
ed->x = pos.x;
@@ -182,13 +211,21 @@ _efl_canvas_layout_efl_gfx_position_set(Eo *obj, Edje *ed, Eina_Position2D pos)
ep = ed->table_parts[i];
if ((ep->type == EDJE_RP_TYPE_TEXT) && (ep->typedata.text))
{
- evas_object_move(ep->object,
- ed->x + ep->x + ep->typedata.text->offset.x,
- ed->y + ep->y + ep->typedata.text->offset.y);
+ if (ep->object)
+ evas_object_move(ep->object,
+ ed->x + ep->x + ep->typedata.text->offset.x,
+ ed->y + ep->y + ep->typedata.text->offset.y);
+ else if (ep->type != EFL_CANVAS_LAYOUT_PART_TYPE_NONE)
+ WRN("No object for part '%s' in group '%s'",
+ ep->part ? ep->part->name : "<invalid>", ed->group);
}
else
{
- evas_object_move(ep->object, ed->x + ep->x, ed->y + ep->y);
+ if (ep->object)
+ evas_object_move(ep->object, ed->x + ep->x, ed->y + ep->y);
+ else if (ep->type != EFL_CANVAS_LAYOUT_PART_TYPE_NONE)
+ WRN("No object for part '%s' in group '%s'",
+ ep->part ? ep->part->name : "<invalid>", ed->group);
if ((ep->type == EDJE_RP_TYPE_SWALLOW) &&
(ep->typedata.swallow))
{
@@ -250,7 +287,7 @@ _edje_limit_get(Edje *ed, Edje_Limit **limits, unsigned int length, Evas_Coord s
}
EOLIAN static void
-_efl_canvas_layout_efl_gfx_size_set(Eo *obj, Edje *ed, Eina_Size2D sz)
+_efl_canvas_layout_efl_gfx_entity_size_set(Eo *obj, Edje *ed, Eina_Size2D sz)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
@@ -286,7 +323,7 @@ _efl_canvas_layout_efl_gfx_size_set(Eo *obj, Edje *ed, Eina_Size2D sz)
_edje_emit(ed, "resize", NULL);
super:
- efl_gfx_size_set(efl_super(obj, MY_CLASS), sz);
+ efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
}
static void
@@ -295,7 +332,7 @@ _edje_object_show(Eo *obj, Edje *ed)
Eina_List *l;
Edje *edg;
- efl_gfx_visible_set(efl_super(obj, MY_CLASS), EINA_TRUE);
+ efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), EINA_TRUE);
if (_edje_lua_script_only(ed))
{
_edje_lua_script_only_show(ed);
@@ -322,7 +359,7 @@ _edje_object_hide(Eo *obj, Edje *ed)
Eina_List *l;
Edje *edg;
- efl_gfx_visible_set(efl_super(obj, MY_CLASS), EINA_FALSE);
+ efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), EINA_FALSE);
if (_edje_lua_script_only(ed))
{
_edje_lua_script_only_hide(ed);
@@ -334,7 +371,7 @@ _edje_object_hide(Eo *obj, Edje *ed)
}
EOLIAN static void
-_efl_canvas_layout_efl_gfx_visible_set(Eo *obj, Edje *ed, Eina_Bool vis)
+_efl_canvas_layout_efl_gfx_entity_visible_set(Eo *obj, Edje *ed, Eina_Bool vis)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 0, vis))
return;
@@ -384,7 +421,7 @@ _efl_canvas_layout_efl_file_mmap_set(Eo *obj, Edje *pd EINA_UNUSED,
}
EOLIAN static void
-_efl_canvas_layout_efl_file_mmap_get(Eo *obj EINA_UNUSED, Edje *pd,
+_efl_canvas_layout_efl_file_mmap_get(const Eo *obj EINA_UNUSED, Edje *pd,
const Eina_File **f, const char **key)
{
if (f) *f = pd->file ? pd->file->f : NULL;
@@ -471,7 +508,7 @@ _efl_canvas_layout_efl_observer_update(Eo *obj EINA_UNUSED, Edje *ed, Efl_Object
}
EOLIAN Eina_Bool
-_efl_canvas_layout_efl_player_playable_get(Eo *obj EINA_UNUSED, Edje *pd EINA_UNUSED)
+_efl_canvas_layout_efl_player_playable_get(const Eo *obj EINA_UNUSED, Edje *pd EINA_UNUSED)
{
return EINA_TRUE;
}
@@ -514,7 +551,7 @@ _efl_canvas_layout_efl_player_play_set(Eo *obj EINA_UNUSED, Edje *ed, Eina_Bool
}
EOLIAN Eina_Bool
-_efl_canvas_layout_efl_player_play_get(Eo *obj EINA_UNUSED, Edje *ed)
+_efl_canvas_layout_efl_player_play_get(const Eo *obj EINA_UNUSED, Edje *ed)
{
if (!ed) return EINA_FALSE;
if (ed->delete_me) return EINA_FALSE;
@@ -531,7 +568,7 @@ _efl_canvas_layout_efl_player_play_speed_set(Eo *obj EINA_UNUSED, Edje *pd , dou
}
EOLIAN double
-_efl_canvas_layout_efl_player_play_speed_get(Eo *obj EINA_UNUSED, Edje *pd)
+_efl_canvas_layout_efl_player_play_speed_get(const Eo *obj EINA_UNUSED, Edje *pd)
{
return 1.0/pd->duration_scale;
}
diff --git a/src/lib/edje/edje_text.c b/src/lib/edje/edje_text.c
index 8f88f490e0..40e783a235 100644
--- a/src/lib/edje/edje_text.c
+++ b/src/lib/edje/edje_text.c
@@ -22,7 +22,7 @@ part_get_geometry(Edje_Real_Part *rp, Evas_Coord *w, Evas_Coord *h)
{
if (!rp->part->use_alternate_font_metrics)
{
- Eina_Size2D sz = efl_gfx_size_get(rp->object);
+ Eina_Size2D sz = efl_gfx_entity_size_get(rp->object);
if (w) *w = sz.w;
if (h) *h = sz.h;
}
@@ -141,9 +141,9 @@ _edje_text_fit_x(Edje *ed, Edje_Real_Part *ep,
if (ep->part->scale) evas_object_scale_set(ep->object, TO_DOUBLE(sc));
evas_obj_text_ellipsis_set(ep->object, params->type.text->ellipsis);
- efl_text_properties_font_set(ep->object, font, size);
+ efl_text_font_set(ep->object, font, size);
efl_text_set(ep->object, text);
- efl_gfx_size_set(ep->object, EINA_SIZE2D(sw, sh));
+ efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(sw, sh));
return text;
}
@@ -333,25 +333,25 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
ep->typedata.text->cache.in_size = size;
if (chosen_desc->text.fit_x && (ep->typedata.text->cache.in_str && eina_stringshare_strlen(ep->typedata.text->cache.in_str) > 0))
{
- if (inlined_font) efl_text_properties_font_source_set(ep->object, ed->path);
- else efl_text_properties_font_source_set(ep->object, NULL);
+ if (inlined_font) efl_text_font_source_set(ep->object, ed->path);
+ else efl_text_font_source_set(ep->object, NULL);
- if (ep->part->scale) efl_gfx_scale_set(ep->object, TO_DOUBLE(sc));
+ if (ep->part->scale) efl_gfx_entity_scale_set(ep->object, TO_DOUBLE(sc));
efl_text_set(ep->object, text);
/* the fit shoult not depend on font size, because it give the differet
* size calculation. As base font size for calculate fit size I take
* 10 (ten), because this value used for calculate fit by Y below */
- efl_text_properties_font_set(ep->object, font, 10);
+ efl_text_font_set(ep->object, font, 10);
part_get_geometry(ep, &tw, &th);
size = (10 * sw) / tw;
- efl_text_properties_font_set(ep->object, font, size);
+ efl_text_font_set(ep->object, font, size);
part_get_geometry(ep, &tw, &th);
while ((tw > sw) && (size > 1))
{
size--;
- efl_text_properties_font_set(ep->object, font, size);
+ efl_text_font_set(ep->object, font, size);
part_get_geometry(ep, &tw, &th);
}
}
@@ -363,12 +363,12 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
*/
if (!chosen_desc->text.fit_x) size = sh;
- if (inlined_font) efl_text_properties_font_source_set(ep->object, ed->path);
- else efl_text_properties_font_source_set(ep->object, NULL);
+ if (inlined_font) efl_text_font_source_set(ep->object, ed->path);
+ else efl_text_font_source_set(ep->object, NULL);
- if (ep->part->scale) efl_gfx_scale_set(ep->object, TO_DOUBLE(sc));
+ if (ep->part->scale) efl_gfx_entity_scale_set(ep->object, TO_DOUBLE(sc));
- efl_text_properties_font_set(ep->object, font, size);
+ efl_text_font_set(ep->object, font, size);
efl_text_set(ep->object, text);
part_get_geometry(ep, &tw, &th);
@@ -386,11 +386,11 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
size += dif;
if (size <= 0) break;
- if (inlined_font) efl_text_properties_font_source_set(ep->object, ed->path);
- else efl_text_properties_font_source_set(ep->object, NULL);
+ if (inlined_font) efl_text_font_source_set(ep->object, ed->path);
+ else efl_text_font_source_set(ep->object, NULL);
- if (ep->part->scale) efl_gfx_scale_set(ep->object, TO_DOUBLE(sc));
- efl_text_properties_font_set(ep->object, font, size);
+ if (ep->part->scale) efl_gfx_entity_scale_set(ep->object, TO_DOUBLE(sc));
+ efl_text_font_set(ep->object, font, size);
part_get_geometry(ep, &tw, &th);
if ((size > 0) && (th == 0)) break;
@@ -401,8 +401,8 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
{
int current;
- if (ep->part->scale) efl_gfx_scale_set(ep->object, TO_DOUBLE(sc));
- efl_text_properties_font_set(ep->object, font, 10);
+ if (ep->part->scale) efl_gfx_entity_scale_set(ep->object, TO_DOUBLE(sc));
+ efl_text_font_set(ep->object, font, 10);
part_get_geometry(ep, &tw, &th);
@@ -423,8 +423,8 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
{
current = (top + bottom) / 2;
- if (ep->part->scale) efl_gfx_scale_set(ep->object, TO_DOUBLE(sc));
- efl_text_properties_font_set(ep->object, font, current);
+ if (ep->part->scale) efl_gfx_entity_scale_set(ep->object, TO_DOUBLE(sc));
+ efl_text_font_set(ep->object, font, current);
part_get_geometry(ep, &tw, &th);
@@ -439,8 +439,8 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
{
current++;
- if (ep->part->scale) efl_gfx_scale_set(ep->object, TO_DOUBLE(sc));
- efl_text_properties_font_set(ep->object, font, current);
+ if (ep->part->scale) efl_gfx_entity_scale_set(ep->object, TO_DOUBLE(sc));
+ efl_text_font_set(ep->object, font, current);
part_get_geometry(ep, &tw, &th);
} while (th <= sh);
@@ -460,8 +460,8 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
/* Handle ellipsis */
if (!chosen_desc->text.min_x)
{
- if (inlined_font) efl_text_properties_font_source_set(ep->object, ed->path);
- else efl_text_properties_font_source_set(ep->object, NULL);
+ if (inlined_font) efl_text_font_source_set(ep->object, ed->path);
+ else efl_text_font_source_set(ep->object, NULL);
text = _edje_text_fit_x(ed, ep, params, chosen_desc,
text, font, size,
@@ -485,12 +485,12 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
ep->typedata.text->cache.fit_y = chosen_desc->text.fit_y;
arrange_text:
- if (inlined_font) efl_text_properties_font_source_set(ep->object, ed->path);
- else efl_text_properties_font_source_set(ep->object, NULL);
+ if (inlined_font) efl_text_font_source_set(ep->object, ed->path);
+ else efl_text_font_source_set(ep->object, NULL);
- if (ep->part->scale) efl_gfx_scale_set(ep->object, TO_DOUBLE(sc));
+ if (ep->part->scale) efl_gfx_entity_scale_set(ep->object, TO_DOUBLE(sc));
- efl_text_properties_font_set(ep->object, font, size);
+ efl_text_font_set(ep->object, font, size);
efl_text_set(ep->object, text);
part_get_geometry(ep, &tw, &th);
@@ -522,8 +522,8 @@ arrange_text:
Eina_Position2D pos;
pos.x = ed->x + TO_INT(params->eval.x) + ep->typedata.text->offset.x;
pos.y = ed->y + TO_INT(params->eval.y) + ep->typedata.text->offset.y;
- efl_gfx_position_set(ep->object, pos);
- efl_gfx_visible_set(ep->object, params->visible);
+ efl_gfx_entity_position_set(ep->object, pos);
+ efl_gfx_entity_visible_set(ep->object, params->visible);
}
{
diff --git a/src/lib/edje/edje_textblock.c b/src/lib/edje/edje_textblock.c
index d331d69b1c..312238735c 100644
--- a/src/lib/edje/edje_textblock.c
+++ b/src/lib/edje/edje_textblock.c
@@ -44,7 +44,7 @@ _edje_part_recalc_single_textblock_min_max_calc_legacy(Edje_Real_Part *ep,
tw = th = 0;
if (!chosen_desc->text.min_x)
{
- efl_gfx_size_set(ep->object, EINA_SIZE2D(TO_INT(params->eval.w), TO_INT(params->eval.h)));
+ efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(TO_INT(params->eval.w), TO_INT(params->eval.h)));
efl_canvas_text_size_formatted_get(ep->object, &tw, &th);
}
else
@@ -70,7 +70,7 @@ _edje_part_recalc_single_textblock_min_max_calc_legacy(Edje_Real_Part *ep,
tw = th = 0;
if (!chosen_desc->text.max_x)
{
- efl_gfx_size_set(ep->object, EINA_SIZE2D(TO_INT(params->eval.w), TO_INT(params->eval.h)));
+ efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(TO_INT(params->eval.w), TO_INT(params->eval.h)));
efl_canvas_text_size_formatted_get(ep->object, &tw, &th);
}
else
@@ -144,7 +144,7 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
* don't get meaningless height for multiline */
if (temp_w > 0)
{
- efl_gfx_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h));
+ efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h));
efl_canvas_text_size_formatted_get(ep->object, &tw, &th);
tw += ins_l + ins_r;
@@ -182,7 +182,7 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
temp_h = *maxh;
}
- efl_gfx_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h));
+ efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h));
efl_canvas_text_size_formatted_get(ep->object, &tw, &th);
tw += ins_l + ins_r;
@@ -267,7 +267,7 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
* don't get meaningless height for multiline */
if (temp_w > 0)
{
- efl_gfx_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h));
+ efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h));
efl_canvas_text_size_formatted_get(ep->object, &tw, &th);
tw += ins_l + ins_r;
@@ -325,7 +325,7 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
/* text.min: 0 0
* text.max: 1 1 */
- efl_gfx_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h));
+ efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h));
efl_canvas_text_size_formatted_get(ep->object, &tw, &th);
tw += ins_l + ins_r;
@@ -351,8 +351,8 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
if (min_calc_w > temp_w)
temp_w = min_calc_w;
- temp_h = efl_gfx_size_get(ep->object).h;
- efl_gfx_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h));
+ temp_h = efl_gfx_entity_size_get(ep->object).h;
+ efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h));
efl_canvas_text_size_formatted_get(ep->object, &tw, &th);
tw += ins_l + ins_r;
@@ -438,7 +438,16 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
else
{
ep->typedata.text->text_source = NULL;
- text = edje_string_get(&chosen_desc->text.text);
+ text = NULL;
+ if (chosen_desc->text.domain)
+ {
+ if (!chosen_desc->text.text.translated)
+ chosen_desc->text.text.translated = _set_translated_string(ed, ep);
+ if (chosen_desc->text.text.translated)
+ text = chosen_desc->text.text.translated;
+ }
+ if (!text)
+ text = edje_string_get(&chosen_desc->text.text);
if (ep->typedata.text->text) text = ep->typedata.text->text;
}
@@ -458,7 +467,7 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
double s = base_s;
if (ep->part->scale) base_s = TO_DOUBLE(sc);
- efl_gfx_scale_set(ep->object, base_s);
+ efl_gfx_entity_scale_set(ep->object, base_s);
efl_canvas_text_size_native_get(ep->object, &tw, &th);
orig_s = base_s;
@@ -467,7 +476,7 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
{
orig_s = _edje_part_recalc_single_textblock_scale_range_adjust(chosen_desc, base_s,
orig_s * TO_INT(params->eval.w) / tw);
- efl_gfx_scale_set(ep->object, orig_s);
+ efl_gfx_entity_scale_set(ep->object, orig_s);
efl_canvas_text_size_native_get(ep->object, &tw, &th);
}
if (chosen_desc->text.fit_x)
@@ -476,7 +485,7 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
{
s = _edje_part_recalc_single_textblock_scale_range_adjust(chosen_desc, base_s,
orig_s * TO_INT(params->eval.w) / tw);
- efl_gfx_scale_set(ep->object, s);
+ efl_gfx_entity_scale_set(ep->object, s);
efl_canvas_text_size_native_get(ep->object, NULL, NULL);
}
}
@@ -493,7 +502,7 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
s = tmp_s;
}
- efl_gfx_scale_set(ep->object, s);
+ efl_gfx_entity_scale_set(ep->object, s);
efl_canvas_text_size_native_get(ep->object, NULL, NULL);
}
}
@@ -518,7 +527,7 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
break;
s = tmp_s;
- efl_gfx_scale_set(ep->object, s);
+ efl_gfx_entity_scale_set(ep->object, s);
efl_canvas_text_size_native_get(ep->object, &fw, &fh);
i--;
}
diff --git a/src/lib/edje/edje_textblock_styles.c b/src/lib/edje/edje_textblock_styles.c
index 24cf2e1f0f..6585034292 100644
--- a/src/lib/edje/edje_textblock_styles.c
+++ b/src/lib/edje/edje_textblock_styles.c
@@ -191,7 +191,8 @@ _edje_textblock_style_update(Edje *ed, Edje_Style *stl, Eina_Bool force)
if (_edje_fontset_append)
fontset = eina_str_escape(_edje_fontset_append);
- fontsource = eina_str_escape(ed->file->path);
+ if (ed->file->fonts)
+ fontsource = eina_str_escape(ed->file->path);
/* Build the style from each tag */
EINA_LIST_FOREACH(stl->tags, l, tag)
@@ -216,9 +217,12 @@ _edje_textblock_style_update(Edje *ed, Edje_Style *stl, Eina_Bool force)
eina_strbuf_append(txt, "font_fallbacks=");
eina_strbuf_append(txt, fontset);
}
- eina_strbuf_append(txt, " ");
- eina_strbuf_append(txt, "font_source=");
- eina_strbuf_append(txt, fontsource);
+ if (fontsource)
+ {
+ eina_strbuf_append(txt, " ");
+ eina_strbuf_append(txt, "font_source=");
+ eina_strbuf_append(txt, fontsource);
+ }
}
if (!EINA_DBL_EQ(tag->font_size, 0))
{
@@ -466,7 +470,8 @@ _edje_textblock_style_parse_and_fix(Edje_File *edf)
if (_edje_fontset_append)
fontset = eina_str_escape(_edje_fontset_append);
- fontsource = eina_str_escape(edf->path);
+ if (edf->fonts)
+ fontsource = eina_str_escape(edf->path);
/* Build the style from each tag */
EINA_LIST_FOREACH(stl->tags, ll, tag)
@@ -498,9 +503,12 @@ _edje_textblock_style_parse_and_fix(Edje_File *edf)
eina_strbuf_append(txt, "font_fallbacks=");
eina_strbuf_append(txt, fontset);
}
- eina_strbuf_append(txt, " ");
- eina_strbuf_append(txt, "font_source=");
- eina_strbuf_append(txt, fontsource);
+ if (fontsource)
+ {
+ eina_strbuf_append(txt, " ");
+ eina_strbuf_append(txt, "font_source=");
+ eina_strbuf_append(txt, fontsource);
+ }
}
if (tag->font_size > 0)
{
diff --git a/src/lib/edje/edje_types.eot b/src/lib/edje/edje_types.eot
index 885798ac41..e2b07c5ae3 100644
--- a/src/lib/edje/edje_types.eot
+++ b/src/lib/edje/edje_types.eot
@@ -1,4 +1,4 @@
-enum Efl.Canvas.Layout.Part_Type
+enum Efl.Canvas.Layout_Part_Type
{
[[Type of a part in an Efl.Canvas.Layout object (edje object).]]
none = 0, [[None type value, indicates invalid parts.]]
diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
index 258a7499b0..a4d7276f1d 100644
--- a/src/lib/edje/edje_util.c
+++ b/src/lib/edje/edje_util.c
@@ -260,7 +260,7 @@ _efl_canvas_layout_efl_ui_base_language_set(Eo *obj, Edje *ed, const char *local
}
EOLIAN const char *
-_efl_canvas_layout_efl_ui_base_language_get(Eo *obj EINA_UNUSED, Edje *ed)
+_efl_canvas_layout_efl_ui_base_language_get(const Eo *obj EINA_UNUSED, Edje *ed)
{
if (!ed->language)
return _edje_language;
@@ -364,7 +364,7 @@ edje_password_show_last_timeout_set(double password_show_last_timeout)
}
EOLIAN void
-_efl_canvas_layout_efl_gfx_scale_set(Eo *obj EINA_UNUSED, Edje *ed, double scale)
+_efl_canvas_layout_efl_gfx_entity_scale_set(Eo *obj EINA_UNUSED, Edje *ed, double scale)
{
Edje *ged;
Evas_Object *o;
@@ -390,7 +390,7 @@ _efl_canvas_layout_efl_gfx_scale_set(Eo *obj EINA_UNUSED, Edje *ed, double scale
}
EOLIAN double
-_efl_canvas_layout_efl_gfx_scale_get(Eo *obj EINA_UNUSED, Edje *ed)
+_efl_canvas_layout_efl_gfx_entity_scale_get(const Eo *obj EINA_UNUSED, Edje *ed)
{
return TO_DOUBLE(ed->scale);
}
@@ -406,7 +406,7 @@ edje_object_base_scale_get(const Evas_Object *obj)
}
EOLIAN Eina_Bool
-_efl_canvas_layout_efl_ui_base_mirrored_get(Eo *obj EINA_UNUSED, Edje *ed)
+_efl_canvas_layout_efl_ui_base_mirrored_get(const Eo *obj EINA_UNUSED, Edje *ed)
{
return ed->is_rtl;
}
@@ -442,7 +442,7 @@ _efl_canvas_layout_efl_ui_base_mirrored_set(Eo *obj, Edje *ed, Eina_Bool rtl)
_edje_part_description_apply(ed, ep, s, v, NULL, 0.0);
ep->chosen_description = ep->param1.description;
}
- _edje_recalc_do(ed);
+ if (!ed->freeze) _edje_recalc_do(ed);
_edje_object_orientation_inform(obj);
@@ -450,7 +450,7 @@ _efl_canvas_layout_efl_ui_base_mirrored_set(Eo *obj, Edje *ed, Eina_Bool rtl)
}
EOLIAN const char *
-_efl_canvas_layout_efl_layout_group_group_data_get(Eo *obj EINA_UNUSED, Edje *ed, const char *key)
+_efl_canvas_layout_efl_layout_group_group_data_get(const Eo *obj EINA_UNUSED, Edje *ed, const char *key)
{
if (!key) return NULL;
if (!ed->collection) return NULL;
@@ -681,7 +681,7 @@ edje_color_class_get(const char *color_class, int *r, int *g, int *b, int *a, in
}
EOLIAN Eina_Bool
-_edje_global_efl_gfx_color_class_color_class_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED,
+_edje_global_efl_gfx_color_class_color_class_get(const Eo *obj EINA_UNUSED, void *pd EINA_UNUSED,
const char *color_class, Efl_Gfx_Color_Class_Layer layer, int *r, int *g, int *b, int *a)
{
Edje_Color_Class *cc;
@@ -887,7 +887,7 @@ edje_object_color_class_get(const Evas_Object *obj, const char *color_class, int
}
EOLIAN Eina_Bool
-_efl_canvas_layout_efl_gfx_color_class_color_class_get(Eo *obj EINA_UNUSED, Edje *ed, const char *color_class, Efl_Gfx_Color_Class_Layer layer, int *r, int *g, int *b, int *a)
+_efl_canvas_layout_efl_gfx_color_class_color_class_get(const Eo *obj EINA_UNUSED, Edje *ed, const char *color_class, Efl_Gfx_Color_Class_Layer layer, int *r, int *g, int *b, int *a)
{
Edje_Color_Class *cc;
@@ -900,13 +900,13 @@ _efl_canvas_layout_efl_gfx_color_class_color_class_get(Eo *obj EINA_UNUSED, Edje
}
EAPI const char *
-edje_objcet_color_class_description_get(const Evas_Object *obj, const char *color_class)
+edje_object_color_class_description_get(const Evas_Object *obj, const char *color_class)
{
return efl_gfx_color_class_description_get(obj, color_class);
}
EOLIAN const char *
-_efl_canvas_layout_efl_gfx_color_class_color_class_description_get(Eo *obj EINA_UNUSED, Edje *ed, const char *color_class)
+_efl_canvas_layout_efl_gfx_color_class_color_class_description_get(const Eo *obj EINA_UNUSED, Edje *ed, const char *color_class)
{
Edje_Color_Class *cc = _edje_color_class_find(ed, color_class);
return cc ? cc->desc : NULL;
@@ -1130,7 +1130,7 @@ edje_text_class_get(const char *text_class, const char **font, Evas_Font_Size *s
}
EOLIAN Eina_Bool
-_edje_global_efl_gfx_text_class_text_class_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED,
+_edje_global_efl_gfx_text_class_text_class_get(const Eo *obj EINA_UNUSED, void *pd EINA_UNUSED,
const char *text_class, const char **font, Efl_Font_Size *size)
{
Edje_Text_Class *tc;
@@ -1352,7 +1352,7 @@ edje_object_text_class_get(const Evas_Object *obj, const char *text_class, const
}
EOLIAN Eina_Bool
-_efl_canvas_layout_efl_gfx_text_class_text_class_get(Eo *obj EINA_UNUSED, Edje *ed, const char *text_class, const char **font, Efl_Font_Size *size)
+_efl_canvas_layout_efl_gfx_text_class_text_class_get(const Eo *obj EINA_UNUSED, Edje *ed, const char *text_class, const char **font, Efl_Font_Size *size)
{
Edje_Text_Class *tc = _edje_text_class_find(ed, text_class);
@@ -1537,7 +1537,7 @@ edje_size_class_get(const char *size_class, Evas_Coord *minw, Evas_Coord *minh,
}
EOLIAN Eina_Bool
-_edje_global_efl_gfx_size_class_size_class_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, const char *size_class,
+_edje_global_efl_gfx_size_class_size_class_get(const Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, const char *size_class,
Evas_Coord *minw, Evas_Coord *minh, Evas_Coord *maxw, Evas_Coord *maxh)
{
Edje_Size_Class *sc;
@@ -1760,7 +1760,7 @@ edje_object_size_class_get(const Evas_Object *obj, const char *size_class, Evas_
}
EOLIAN Eina_Bool
-_efl_canvas_layout_efl_gfx_size_class_size_class_get(Eo *obj EINA_UNUSED, Edje *ed, const char *size_class, Evas_Coord *minw, Evas_Coord *minh, Evas_Coord *maxw, Evas_Coord *maxh)
+_efl_canvas_layout_efl_gfx_size_class_size_class_get(const Eo *obj EINA_UNUSED, Edje *ed, const char *size_class, Evas_Coord *minw, Evas_Coord *minh, Evas_Coord *maxw, Evas_Coord *maxh)
{
Edje_Size_Class *sc = _edje_size_class_find(ed, size_class);
@@ -1898,7 +1898,7 @@ edje_object_part_object_get(const Eo *obj, const char *part)
if ((!ed) || (!part)) return NULL;
/* Need to recalc before providing the object. */
- _edje_recalc_do(ed);
+ if (!ed->freeze) _edje_recalc_do(ed);
rp = _edje_real_part_recursive_get(&ed, part);
if (!rp) return NULL;
@@ -1906,9 +1906,11 @@ edje_object_part_object_get(const Eo *obj, const char *part)
return rp->object;
}
-EOLIAN void
-_efl_canvas_layout_item_provider_set(Eo *obj EINA_UNUSED, Edje *ed, Edje_Item_Provider_Cb func, void *data)
+EAPI void
+edje_object_item_provider_set(Edje_Object *obj, Edje_Item_Provider_Cb func, void *data)
{
+ Edje *ed = _edje_fetch(obj);
+ if (!ed) return;
ed->item_provider.func = func;
ed->item_provider.data = data;
}
@@ -2020,7 +2022,7 @@ _edje_user_define_string(Edje *ed, const char *part, const char *raw_text, Edje_
}
Eina_Bool
-_edje_efl_text_set(Eo *obj, Edje *ed, const char *part, const char *text,
+_edje_efl_text_text_set(Eo *obj, Edje *ed, const char *part, const char *text,
Eina_Bool legacy, Eina_Bool set_markup)
{
Edje_Real_Part *rp;
@@ -2043,16 +2045,13 @@ _edje_efl_text_set(Eo *obj, Edje *ed, const char *part, const char *text,
}
const char *
-_edje_efl_text_get(Eo *obj EINA_UNUSED, Edje *ed, const char *part,
+_edje_efl_text_text_get(const Eo *obj EINA_UNUSED, Edje *ed, const char *part,
Eina_Bool legacy, Eina_Bool get_markup)
{
Edje_Real_Part *rp;
if ((!ed) || (!part)) return NULL;
- /* Need to recalc before providing the object. */
- _edje_recalc_do(ed);
-
rp = _edje_real_part_recursive_get(&ed, part);
if (!rp) return NULL;
if ((rp->type != EDJE_RP_TYPE_TEXT) ||
@@ -2081,18 +2080,22 @@ _edje_efl_text_get(Eo *obj EINA_UNUSED, Edje *ed, const char *part,
{
const char *entry;
if (legacy)
- {
- entry = evas_object_textblock_text_markup_get(rp->object);
- }
+ entry = rp->typedata.text->text;
else
{
if (get_markup)
{
+#ifdef EDJE_CALC_CACHE
+ if (rp->invalidate)
+#else
+ if (ed->dirty)
+#endif
+ _edje_recalc_do(ed);
entry = efl_text_markup_get(rp->object);
}
else
{
- entry = efl_text_get(rp->object);
+ entry = rp->typedata.text->text;
}
}
@@ -2906,7 +2909,7 @@ edje_object_part_text_prediction_hint_set(Eo *obj, const char *part, const char
}
Eina_Bool
-_edje_efl_content_content_set(Edje *ed, const char *part, Efl_Gfx *obj_swallow)
+_edje_efl_content_content_set(Edje *ed, const char *part, Efl_Gfx_Entity *obj_swallow)
{
Edje_Real_Part *rp, *rpcur;
Edje_User_Defined *eud = NULL;
@@ -3086,6 +3089,44 @@ _edje_box_layout_part_external_find(const char *name)
NULL);
}
+EAPI Eina_Bool
+edje_object_part_text_prediction_hint_hash_set(Eo *obj, const char *part, const char *key, const char *value)
+{
+ Edje_Real_Part *rp;
+ Edje *ed;
+
+ ed = _edje_fetch(obj);
+
+ if ((!ed) || (!part)) return EINA_FALSE;
+ rp = _edje_real_part_recursive_get(&ed, part);
+ if (!rp) return EINA_FALSE;
+ if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
+ {
+ return _edje_entry_prediction_hint_hash_set(rp, key, value);
+ }
+ else
+ return EINA_FALSE;
+}
+
+EAPI Eina_Bool
+edje_object_part_text_prediction_hint_hash_del(Eo *obj, const char *part, const char *key)
+{
+ Edje_Real_Part *rp;
+ Edje *ed;
+
+ ed = _edje_fetch(obj);
+
+ if ((!ed) || (!part)) return EINA_FALSE;
+ rp = _edje_real_part_recursive_get(&ed, part);
+ if (!rp) return EINA_FALSE;
+ if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
+ {
+ return _edje_entry_prediction_hint_hash_del(rp, key);
+ }
+ else
+ return EINA_FALSE;
+}
+
Eina_Bool
_edje_box_layout_find(const char *name, Evas_Object_Box_Layout *cb, void **data, void(**free_data) (void *data))
{
@@ -3265,16 +3306,13 @@ _efl_canvas_layout_efl_container_content_remove(Eo *obj EINA_UNUSED, Edje *ed, E
return EINA_TRUE;
}
-Efl_Gfx *
+Efl_Gfx_Entity *
_edje_efl_content_content_get(Edje *ed, const char *part)
{
Edje_Real_Part *rp;
if ((!ed) || (!part)) return NULL;
- /* Need to recalc before providing the object. */
- _edje_recalc_do(ed);
-
rp = _edje_real_part_recursive_get(&ed, part);
if (!rp) return NULL;
@@ -3290,33 +3328,39 @@ _edje_efl_content_content_get(Edje *ed, const char *part)
}
EOLIAN Eo *
-_efl_canvas_layout_efl_part_part(Eo *obj, Edje *ed, const char *part)
+_efl_canvas_layout_efl_part_part_get(Eo *obj, Edje *ed, const char *part)
{
Edje_Real_Part *rp;
if ((!ed) || (!part)) return NULL;
rp = _edje_real_part_recursive_get(&ed, part);
- if (!rp) return NULL;
+ if (!rp)
+ {
+ // Note: This could be disabled if debug is not required.
+ static const Edje_Real_Part _invalid_part = {};
+ rp = (Edje_Real_Part *) &_invalid_part;
+ return _edje_invalid_internal_proxy_get(obj, ed, rp, part);
+ }
if (rp->part->type == EDJE_PART_TYPE_BOX)
- return _edje_box_internal_proxy_get(obj, ed, rp);
+ return _edje_box_internal_proxy_get(obj, ed, rp, rp->part->name);
else if (rp->part->type == EDJE_PART_TYPE_TABLE)
- return _edje_table_internal_proxy_get(obj, ed, rp);
+ return _edje_table_internal_proxy_get(obj, ed, rp, rp->part->name);
else if (rp->part->type == EDJE_PART_TYPE_SWALLOW)
- return _edje_swallow_internal_proxy_get(obj, ed, rp);
+ return _edje_swallow_internal_proxy_get(obj, ed, rp, rp->part->name);
else if (rp->part->type == EDJE_PART_TYPE_EXTERNAL)
- return _edje_external_internal_proxy_get(obj, ed, rp);
+ return _edje_external_internal_proxy_get(obj, ed, rp, rp->part->name);
else if (rp->part->type == EDJE_PART_TYPE_TEXT)
- return _edje_text_internal_proxy_get(obj, ed, rp);
+ return _edje_text_internal_proxy_get(obj, ed, rp, rp->part->name);
else if (rp->part->type == EDJE_PART_TYPE_TEXTBLOCK)
- return _edje_text_internal_proxy_get(obj, ed, rp);
+ return _edje_text_internal_proxy_get(obj, ed, rp, rp->part->name);
else
- return _edje_other_internal_proxy_get(obj, ed, rp);
+ return _edje_other_internal_proxy_get(obj, ed, rp, rp->part->name);
}
EOLIAN Eina_Size2D
-_efl_canvas_layout_efl_layout_group_group_size_min_get(Eo *obj EINA_UNUSED, Edje *ed)
+_efl_canvas_layout_efl_layout_group_group_size_min_get(const Eo *obj EINA_UNUSED, Edje *ed)
{
if ((!ed) || (!ed->collection))
return EINA_SIZE2D(0, 0);
@@ -3325,7 +3369,7 @@ _efl_canvas_layout_efl_layout_group_group_size_min_get(Eo *obj EINA_UNUSED, Edje
}
EOLIAN Eina_Size2D
-_efl_canvas_layout_efl_layout_group_group_size_max_get(Eo *obj EINA_UNUSED, Edje *ed EINA_UNUSED)
+_efl_canvas_layout_efl_layout_group_group_size_max_get(const Eo *obj EINA_UNUSED, Edje *ed)
{
Eina_Size2D sz;
@@ -3333,7 +3377,7 @@ _efl_canvas_layout_efl_layout_group_group_size_max_get(Eo *obj EINA_UNUSED, Edje
return EINA_SIZE2D(0, 0);
/* Need to recalc before providing the object. */
- _edje_recalc_do(ed);
+ if (!ed->freeze) _edje_recalc_do(ed);
sz = ed->collection->prop.max;
@@ -3343,6 +3387,19 @@ _efl_canvas_layout_efl_layout_group_group_size_max_get(Eo *obj EINA_UNUSED, Edje
return sz;
}
+EOLIAN Eina_Bool
+_efl_canvas_layout_efl_layout_group_part_exist_get(const Eo *obj EINA_UNUSED, Edje *ed, const char *part)
+{
+ Edje_Real_Part *rp;
+
+ if (!part) return EINA_FALSE;
+ if (ed->delete_me) return EINA_FALSE;
+ rp = _edje_real_part_recursive_get(&ed, part);
+ if (!rp) return EINA_FALSE;
+
+ return EINA_TRUE;
+}
+
EOLIAN void
_efl_canvas_layout_efl_layout_calc_calc_force(Eo *obj EINA_UNUSED, Edje *ed)
{
@@ -4487,9 +4544,19 @@ _edje_child_add(Edje *ed, Edje_Real_Part *rp, Evas_Object *child)
static void
_eo_unparent_helper(Eo *child, Eo *parent)
{
+ if (efl_invalidated_get(child)) return ;
if (efl_parent_get(child) == parent)
{
- efl_parent_set(child, evas_object_evas_get(parent));
+ if (efl_invalidated_get(evas_object_evas_get(parent)))
+ // Temporary reparenting children to the main loop.
+ // They are about to die, but shouldn't just yet.
+ {
+ efl_parent_set(child, efl_main_loop_get());
+ }
+ else
+ {
+ efl_parent_set(child, evas_object_evas_get(parent));
+ }
}
}
@@ -5054,7 +5121,7 @@ _efl_canvas_layout_efl_layout_calc_calc_auto_update_hints_set(Eo *obj EINA_UNUSE
}
EOLIAN Eina_Bool
-_efl_canvas_layout_efl_layout_calc_calc_auto_update_hints_get(Eo *obj EINA_UNUSED, Edje *ed)
+_efl_canvas_layout_efl_layout_calc_calc_auto_update_hints_get(const Eo *obj EINA_UNUSED, Edje *ed)
{
return ed->update_hints;
}
@@ -6260,8 +6327,7 @@ edje_object_part_text_set(const Edje_Object *obj, const char *part, const char *
ed = _edje_fetch(obj);
- _edje_efl_text_set((Eo *) obj, ed, part, text, EINA_TRUE, EINA_FALSE);
- return EINA_TRUE;
+ return _edje_efl_text_text_set((Eo *) obj, ed, part, text, EINA_TRUE, EINA_FALSE);
}
EAPI const char *
@@ -6278,7 +6344,15 @@ edje_object_part_text_get(const Edje_Object *obj, const char *part)
ERR("Invalid call on a non-text or non-textblock part: '%s' in group '%s'", part, ed->group);
return NULL;
}
- return _edje_efl_text_get((Eo *)obj, ed, part, EINA_TRUE, EINA_FALSE);
+
+ ed = _edje_fetch(obj);
+ if (!ed)
+ {
+ ERR("Failed to get Edje data from object: '%p'", obj);
+ return NULL;
+ }
+
+ return _edje_efl_text_text_get(obj, ed, part, EINA_TRUE, EINA_FALSE);
}
/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
diff --git a/src/lib/edje/efl_canvas_layout.eo b/src/lib/edje/efl_canvas_layout.eo
index d50960a350..ad51c5b38a 100644
--- a/src/lib/edje/efl_canvas_layout.eo
+++ b/src/lib/edje/efl_canvas_layout.eo
@@ -1,5 +1,3 @@
-import edje_types;
-
// FIXME: This EO doc needs a direct link to the "edcref" doc
class Efl.Canvas.Layout (Efl.Canvas.Group, Efl.File, Efl.Container, Efl.Part,
@@ -10,6 +8,7 @@ class Efl.Canvas.Layout (Efl.Canvas.Group, Efl.File, Efl.Container, Efl.Part,
{
[[Edje object class]]
legacy_prefix: edje_object;
+ event_prefix: efl_layout;
data: Edje;
methods {
@property animation {
@@ -39,22 +38,6 @@ class Efl.Canvas.Layout (Efl.Canvas.Group, Efl.File, Efl.Container, Efl.Part,
legacy: null;
return: iterator<string> @owned; [[Part name iterator]]
}
-
- /* TEXT PART APIS BEGIN ---------------------------------------------- */
- @property item_provider {
- set {
- [[Sets the function that provides item objects for named items in an edje entry text
-
- Item objects may be deleted any time by Edje, and will be deleted when the
- Edje object is deleted (or file is set to a new file).]]
- }
- values {
- func: Edje.Item_Provider_Cb; [[The function to call (or $null to disable) to get item objects]]
- data: void_ptr; [[The data pointer to pass to the func callback]]
- }
- }
- /* TEXT PART APIS END ------------------------------------------------ */
-
@property seat {
get {
[[Returns the seat device given its Edje's name.
@@ -90,11 +73,16 @@ class Efl.Canvas.Layout (Efl.Canvas.Group, Efl.File, Efl.Container, Efl.Part,
}
}
}
+ events {
+ part,invalid @beta: string; [[Emitted when trying to use an invalid part.
+ The value passed is the part name.]]
+ }
implements {
- Efl.Gfx.visible { set; }
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set; }
+ Efl.Gfx.Entity.visible { set; }
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
Efl.Object.constructor;
+ Efl.Object.invalidate;
Efl.Object.debug_name_override;
Efl.Canvas.Object.no_render { set; }
Efl.Canvas.Object.paragraph_direction { set; }
@@ -116,6 +104,7 @@ class Efl.Canvas.Layout (Efl.Canvas.Group, Efl.File, Efl.Container, Efl.Part,
Efl.Layout.Group.group_size_min { get; }
Efl.Layout.Group.group_size_max { get; }
Efl.Layout.Group.group_data { get; }
+ Efl.Layout.Group.part_exist { get; }
Efl.Layout.Signal.message_send;
Efl.Layout.Signal.signal_callback_add;
Efl.Layout.Signal.signal_callback_del;
@@ -123,11 +112,11 @@ class Efl.Canvas.Layout (Efl.Canvas.Group, Efl.File, Efl.Container, Efl.Part,
Efl.Layout.Signal.signal_process;
Efl.Ui.Base.mirrored { set; get; }
Efl.Ui.Base.language { set; get; }
- Efl.Gfx.scale { set; get; }
+ Efl.Gfx.Entity.scale { set; get; }
Efl.File.load_error { get; }
Efl.File.mmap { get; set; }
Efl.Container.content_remove;
- Efl.Part.part; [[Returns @Efl.Canvas.Layout.Part.]]
+ Efl.Part.part_get; [[Returns @Efl.Canvas.Layout_Part]]
Efl.Observer.update;
Efl.Player.playable { get; }
Efl.Player.play { get; set; }
diff --git a/src/lib/edje/efl_canvas_layout_part.eo b/src/lib/edje/efl_canvas_layout_part.eo
index 37e5ae5f9f..c96e9a7788 100644
--- a/src/lib/edje/efl_canvas_layout_part.eo
+++ b/src/lib/edje/efl_canvas_layout_part.eo
@@ -1,6 +1,6 @@
import edje_types;
-class Efl.Canvas.Layout.Part (Efl.Object, Efl.Gfx, Efl.Ui.Drag)
+class Efl.Canvas.Layout_Part (Efl.Object, Efl.Gfx.Entity, Efl.Ui.Drag)
{
[[Common class for part proxy objects for @Efl.Canvas.Layout.
@@ -17,12 +17,13 @@ class Efl.Canvas.Layout.Part (Efl.Object, Efl.Gfx, Efl.Ui.Drag)
This is the state name as it appears in EDC description blocks. A
state has both a name and a value (double). The default state is
- "default" 0.0.
+ "default" 0.0, but this function will return "" if the part is
+ invalid.
]]
get {}
values {
- state: string("default"); [[The name of the state.]]
- val: double; [[The value of the state.]]
+ state: string(""); [[The name of the state.]]
+ val: double(0.0); [[The value of the state.]]
}
}
@property part_type {
@@ -31,14 +32,14 @@ class Efl.Canvas.Layout.Part (Efl.Object, Efl.Gfx, Efl.Ui.Drag)
[[Returns the type of the part.]]
}
values {
- type: Efl.Canvas.Layout.Part_Type(Efl.Canvas.Layout.Part_Type.none);
+ type: Efl.Canvas.Layout_Part_Type(Efl.Canvas.Layout_Part_Type.none);
[[One of the types or $none if not an existing part.]]
}
}
}
implements {
Efl.Object.finalize;
- Efl.Gfx.geometry { get; }
+ Efl.Gfx.Entity.geometry { get; }
Efl.Ui.Drag.drag_value { set; get; }
Efl.Ui.Drag.drag_size { set; get; }
Efl.Ui.Drag.drag_dir { get; }
diff --git a/src/lib/edje/efl_canvas_layout_part_box.eo b/src/lib/edje/efl_canvas_layout_part_box.eo
index 7a189ae5a3..02be0707c8 100644
--- a/src/lib/edje/efl_canvas_layout_part_box.eo
+++ b/src/lib/edje/efl_canvas_layout_part_box.eo
@@ -1,4 +1,4 @@
-class Efl.Canvas.Layout.Part_Box (Efl.Canvas.Layout.Part, Efl.Pack.Linear,
+class Efl.Canvas.Layout_Part_Box (Efl.Canvas.Layout_Part, Efl.Pack_Linear,
Efl.Ui.Direction)
{
[[Represents a Box created as part of a layout.
@@ -15,14 +15,14 @@ class Efl.Canvas.Layout.Part_Box (Efl.Canvas.Layout.Part, Efl.Pack.Linear,
Efl.Pack.unpack_all;
Efl.Pack.unpack;
Efl.Pack.pack;
- Efl.Pack.Linear.pack_begin;
- Efl.Pack.Linear.pack_end;
- Efl.Pack.Linear.pack_before;
- Efl.Pack.Linear.pack_after;
- Efl.Pack.Linear.pack_at;
- Efl.Pack.Linear.pack_content_get;
- Efl.Pack.Linear.pack_unpack_at;
- Efl.Pack.Linear.pack_index_get;
+ Efl.Pack_Linear.pack_begin;
+ Efl.Pack_Linear.pack_end;
+ Efl.Pack_Linear.pack_before;
+ Efl.Pack_Linear.pack_after;
+ Efl.Pack_Linear.pack_at;
+ Efl.Pack_Linear.pack_content_get;
+ Efl.Pack_Linear.pack_unpack_at;
+ Efl.Pack_Linear.pack_index_get;
Efl.Ui.Direction.direction { get; [[Returns $default if unknown.]] }
}
}
diff --git a/src/lib/edje/efl_canvas_layout_part_external.eo b/src/lib/edje/efl_canvas_layout_part_external.eo
index cb485e41db..e3d3b48a32 100644
--- a/src/lib/edje/efl_canvas_layout_part_external.eo
+++ b/src/lib/edje/efl_canvas_layout_part_external.eo
@@ -1,6 +1,4 @@
-import edje_types;
-
-class Efl.Canvas.Layout.Part_External (Efl.Canvas.Layout.Part, Efl.Content,
+class Efl.Canvas.Layout_Part_External (Efl.Canvas.Layout_Part, Efl.Content,
Efl.Canvas.Object)
{
[[Class representing an external part in Edje layouts.
diff --git a/src/lib/edje/efl_canvas_layout_part_invalid.eo b/src/lib/edje/efl_canvas_layout_part_invalid.eo
new file mode 100644
index 0000000000..058220d00a
--- /dev/null
+++ b/src/lib/edje/efl_canvas_layout_part_invalid.eo
@@ -0,0 +1,74 @@
+class Efl.Canvas.Layout_Part_Invalid (Efl.Canvas.Layout_Part, Efl.Content,
+ Efl.Pack_Linear, Efl.Ui.Direction,
+ Efl.Pack_Table, Efl.Text,
+ Efl.Text_Markup, Efl.Text_Cursor)
+{
+ [[Common class for part proxy objects for @Efl.Canvas.Layout.
+
+ As an @Efl.Part implementation class, all objects of this class are meant
+ to be used for one and only one function call. In pseudo-code, the use
+ of object of this type looks like the following:
+ rect = layout.part("somepart").geometry_get();
+
+ @since 1.20
+ ]]
+ data: null;
+ implements {
+ // Efl.Canvas.Layout.Part
+ Efl.Canvas.Layout_Part.state { get; }
+ Efl.Canvas.Layout_Part.part_type { get; }
+ Efl.Gfx.Entity.geometry { get; }
+ Efl.Ui.Drag.drag_value { set; get; }
+ Efl.Ui.Drag.drag_size { set; get; }
+ Efl.Ui.Drag.drag_dir { get; }
+ Efl.Ui.Drag.drag_step { set; get; }
+ Efl.Ui.Drag.drag_step_move;
+ Efl.Ui.Drag.drag_page { set; get; }
+ Efl.Ui.Drag.drag_page_move;
+ // Efl.Canvas.Layout_Part_Swallow & External
+ Efl.Content.content { get; set; }
+ Efl.Content.content_unset;
+ // Efl.Canvas.Layout_Part_Text
+ Efl.Text.text { set; get; }
+ Efl.Text_Markup.markup { get; set; }
+ Efl.Text_Cursor.text_cursor { get; }
+ Efl.Text_Cursor.cursor_paragraph_first;
+ Efl.Text_Cursor.cursor_paragraph_last;
+ Efl.Text_Cursor.cursor_position { set; get; }
+ Efl.Text_Cursor.cursor_coord_set;
+ Efl.Text_Cursor.cursor_line_char_first;
+ Efl.Text_Cursor.cursor_line_char_last;
+ Efl.Text_Cursor.cursor_char_next;
+ Efl.Text_Cursor.cursor_char_prev;
+ Efl.Text_Cursor.cursor_line_jump_by;
+ Efl.Text_Cursor.cursor_copy;
+ Efl.Text_Cursor.cursor_content { get; }
+ Efl.Text_Cursor.cursor_geometry { get; }
+ Efl.Text_Markup.cursor_markup_insert;
+ // Efl.Canvas.Layout_Part_Box
+ Efl.Container.content_iterate;
+ Efl.Container.content_count;
+ Efl.Container.content_remove;
+ Efl.Pack.pack_clear;
+ Efl.Pack.unpack_all;
+ Efl.Pack.unpack;
+ Efl.Pack.pack;
+ Efl.Pack_Linear.pack_begin;
+ Efl.Pack_Linear.pack_end;
+ Efl.Pack_Linear.pack_before;
+ Efl.Pack_Linear.pack_after;
+ Efl.Pack_Linear.pack_at;
+ Efl.Pack_Linear.pack_content_get;
+ Efl.Pack_Linear.pack_unpack_at;
+ Efl.Pack_Linear.pack_index_get;
+ Efl.Ui.Direction.direction { get; [[Returns $default if unknown.]] }
+ // Efl.Canvas.Layout_Part_Table
+ Efl.Pack_Table.pack_table;
+ Efl.Pack_Table.table_content_get;
+ Efl.Pack_Table.table_contents_get;
+ Efl.Pack_Table.table_position { get; }
+ Efl.Pack_Table.table_size { get; }
+ Efl.Pack_Table.table_columns { get; }
+ Efl.Pack_Table.table_rows { get; }
+ }
+}
diff --git a/src/lib/edje/efl_canvas_layout_part_swallow.eo b/src/lib/edje/efl_canvas_layout_part_swallow.eo
index 93e997243c..32634e8137 100644
--- a/src/lib/edje/efl_canvas_layout_part_swallow.eo
+++ b/src/lib/edje/efl_canvas_layout_part_swallow.eo
@@ -1,4 +1,4 @@
-class Efl.Canvas.Layout.Part_Swallow (Efl.Canvas.Layout.Part, Efl.Content)
+class Efl.Canvas.Layout_Part_Swallow (Efl.Canvas.Layout_Part, Efl.Content)
{
[[Represents a SWALLOW part of an Edje object.
diff --git a/src/lib/edje/efl_canvas_layout_part_table.eo b/src/lib/edje/efl_canvas_layout_part_table.eo
index 67fd559938..877438527e 100644
--- a/src/lib/edje/efl_canvas_layout_part_table.eo
+++ b/src/lib/edje/efl_canvas_layout_part_table.eo
@@ -1,4 +1,4 @@
-class Efl.Canvas.Layout.Part_Table (Efl.Canvas.Layout.Part, Efl.Pack.Table)
+class Efl.Canvas.Layout_Part_Table (Efl.Canvas.Layout_Part, Efl.Pack_Table)
{
[[Represents a Table created as part of a layout.
@@ -13,12 +13,12 @@ class Efl.Canvas.Layout.Part_Table (Efl.Canvas.Layout.Part, Efl.Pack.Table)
Efl.Pack.pack_clear;
Efl.Pack.unpack_all;
Efl.Pack.unpack;
- Efl.Pack.Table.pack_table;
- Efl.Pack.Table.table_content_get;
- Efl.Pack.Table.table_contents_get;
- Efl.Pack.Table.table_position { get; }
- Efl.Pack.Table.table_size { get; }
- Efl.Pack.Table.table_columns { get; }
- Efl.Pack.Table.table_rows { get; }
+ Efl.Pack_Table.pack_table;
+ Efl.Pack_Table.table_content_get;
+ Efl.Pack_Table.table_contents_get;
+ Efl.Pack_Table.table_position { get; }
+ Efl.Pack_Table.table_size { get; }
+ Efl.Pack_Table.table_columns { get; }
+ Efl.Pack_Table.table_rows { get; }
}
}
diff --git a/src/lib/edje/efl_canvas_layout_part_text.eo b/src/lib/edje/efl_canvas_layout_part_text.eo
index 0ba5bb22c5..b59f470a5b 100644
--- a/src/lib/edje/efl_canvas_layout_part_text.eo
+++ b/src/lib/edje/efl_canvas_layout_part_text.eo
@@ -1,5 +1,5 @@
-class Efl.Canvas.Layout.Part_Text (Efl.Canvas.Layout.Part, Efl.Text,
-Efl.Text.Markup, Efl.Text.Cursor)
+class Efl.Canvas.Layout_Part_Text (Efl.Canvas.Layout_Part, Efl.Text,
+Efl.Text_Markup, Efl.Text_Cursor)
{
[[Represents a TEXT part of a layout
@@ -9,20 +9,20 @@ Efl.Text.Markup, Efl.Text.Cursor)
data: null;
implements {
Efl.Text.text { set; get; }
- Efl.Text.Markup.markup { get; set; }
- Efl.Text.Cursor.cursor { get; }
- Efl.Text.Cursor.cursor_paragraph_first;
- Efl.Text.Cursor.cursor_paragraph_last;
- Efl.Text.Cursor.cursor_position { set; get; }
- Efl.Text.Cursor.cursor_coord_set;
- Efl.Text.Cursor.cursor_line_char_first;
- Efl.Text.Cursor.cursor_line_char_last;
- Efl.Text.Cursor.cursor_char_next;
- Efl.Text.Cursor.cursor_char_prev;
- Efl.Text.Cursor.cursor_line_jump_by;
- Efl.Text.Cursor.cursor_copy;
- Efl.Text.Cursor.cursor_content { get; }
- Efl.Text.Cursor.cursor_geometry { get; }
- Efl.Text.Markup.cursor_markup_insert;
+ Efl.Text_Markup.markup { get; set; }
+ Efl.Text_Cursor.text_cursor { get; }
+ Efl.Text_Cursor.cursor_paragraph_first;
+ Efl.Text_Cursor.cursor_paragraph_last;
+ Efl.Text_Cursor.cursor_position { set; get; }
+ Efl.Text_Cursor.cursor_coord_set;
+ Efl.Text_Cursor.cursor_line_char_first;
+ Efl.Text_Cursor.cursor_line_char_last;
+ Efl.Text_Cursor.cursor_char_next;
+ Efl.Text_Cursor.cursor_char_prev;
+ Efl.Text_Cursor.cursor_line_jump_by;
+ Efl.Text_Cursor.cursor_copy;
+ Efl.Text_Cursor.cursor_content { get; }
+ Efl.Text_Cursor.cursor_geometry { get; }
+ Efl.Text_Markup.cursor_markup_insert;
}
}
diff --git a/src/lib/edje/efl_layout_calc.eo b/src/lib/edje/efl_layout_calc.eo
index 77852fefff..018cd7e197 100644
--- a/src/lib/edje/efl_layout_calc.eo
+++ b/src/lib/edje/efl_layout_calc.eo
@@ -108,8 +108,9 @@ interface Efl.Layout.Calc
}
}
events {
- recalc; [[The layout was recalculated.]]
- circular,dependency; [[A circular dependency between parts of the
+ recalc: void; [[The layout was recalculated.]]
+ /* FIXME: The actual type is list<string> but the C# bindings do not support that yet */
+ circular,dependency: void; [[A circular dependency between parts of the
object was found.]]
}
}
diff --git a/src/lib/edje/efl_layout_group.eo b/src/lib/edje/efl_layout_group.eo
index bd711e97ab..864a3a86c9 100644
--- a/src/lib/edje/efl_layout_group.eo
+++ b/src/lib/edje/efl_layout_group.eo
@@ -98,6 +98,28 @@ interface Efl.Layout.Group
val: string; [[The data's value string.]]
}
}
+ @property part_exist {
+ [[Whether the given part exists in this group.
+
+ This is mostly equivalent to verifying the part type on the object
+ as would be done in C as follows:
+ (efl_canvas_layout_part_type_get(efl_part(obj, "partname")) !=
+ EFL_CANVAS_LAYOUT_PART_TYPE_NONE)
+
+ The differences are that will silently return $false if the part
+ does not exist, and this will return $true if the part is of type
+ $SPACER in the EDC file ($SPACER parts have type $NONE).
+
+ See also @Efl.Canvas.Layout_Part.part_type.
+ ]]
+ get { [[Returns $true if the part exists in the EDC group.]] }
+ keys {
+ part: string @nonull; [[The part name to check.]]
+ }
+ values {
+ exists: bool; [[$true if the part exists, $false otherwise.]]
+ }
+ }
}
}
diff --git a/src/lib/eet/Eet.h b/src/lib/eet/Eet.h
index 60547bbd4a..3031c36023 100644
--- a/src/lib/eet/Eet.h
+++ b/src/lib/eet/Eet.h
@@ -102,29 +102,29 @@
#ifdef EAPI
# undef EAPI
-#endif /* ifdef EAPI */
+#endif
#ifdef _WIN32
-# ifdef EFL_EET_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
-# else /* ifdef DLL_EXPORT */
+# else
# define EAPI
-# endif /* ! DLL_EXPORT */
-# else /* ifdef EFL_EET_BUILD */
+# endif
+# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EET_BUILD */
-#else /* ifdef _WIN32 */
+# endif
+#else
# ifdef __GNUC__
# if __GNUC__ >= 4
# define EAPI __attribute__ ((visibility("default")))
-# else /* if __GNUC__ >= 4 */
+# else
# define EAPI
-# endif /* if __GNUC__ >= 4 */
-# else /* ifdef __GNUC__ */
+# endif
+# else
# define EAPI
-# endif /* ifdef __GNUC__ */
-#endif /* ! _WIN32 */
+# endif
+#endif
#ifdef __cplusplus
extern "C" {
@@ -3749,6 +3749,8 @@ eet_data_descriptor_encode(Eet_Data_Descriptor *edd,
* This macro lets you easily add a variable size array of strings. All
* the parameters are the same as for EET_DATA_DESCRIPTOR_ADD_BASIC().
*
+ * @note The strings in this array will be loaded as a single blob of memory.
+ *
* @since 1.4.0
*/
#define EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY_STRING(edd, struct_type, name, member) \
diff --git a/src/lib/eet/Eet_private.h b/src/lib/eet/Eet_private.h
index c2e6702cac..ca552277c1 100644
--- a/src/lib/eet/Eet_private.h
+++ b/src/lib/eet/Eet_private.h
@@ -110,6 +110,7 @@ struct _Eet_File_Directory
{
int size;
Eet_File_Node **nodes;
+ unsigned int free_count;
};
struct _Eet_File_Node
diff --git a/src/lib/eet/eet_data.c b/src/lib/eet/eet_data.c
index bef8d7c071..6cf19f211a 100644
--- a/src/lib/eet/eet_data.c
+++ b/src/lib/eet/eet_data.c
@@ -626,7 +626,7 @@ static int _eet_data_words_bigendian = -1;
Size, \
SubSize > 0 ? Data_Ret : NULL, \
SubSize); \
- if (!Data_Ret) { goto Label; } \
+ EINA_SAFETY_ON_NULL_GOTO(Data_Ret, Label); \
} while (0)
#define EET_I_STRING 1 << 4
@@ -1727,8 +1727,7 @@ case EET_T_ ## Type: type += EET_I_ ## Type; break;
size = eet_data_put_int(ed, &s, &size_ret);
/* FIXME: If something goes wrong the resulting file will be corrupted. */
- if (!size)
- goto on_error;
+ EINA_SAFETY_ON_TRUE_GOTO(!size, on_error);
eet_data_stream_write(ds, buf, 4);
@@ -2279,6 +2278,7 @@ eet_data_read_cipher(Eet_File *ef,
int required_free = 0;
int size;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(edd, NULL);
ed = eet_dictionary_get(ef);
if (!cipher_key)
@@ -2317,6 +2317,7 @@ eet_data_read_cipher_buffer(Eet_File *ef,
int required_free = 0;
int size;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(edd, NULL);
ed = eet_dictionary_get(ef);
if (!cipher_key)
@@ -2555,7 +2556,9 @@ _eet_free_unref(Eet_Free *ef)
}
#define _eet_freelist_add(Ctx, Data) _eet_free_add(&Ctx->freelist, Data);
+#if 0
#define _eet_freelist_del(Ctx, Data) _eet_free_del(&Ctx->freelist, Data);
+#endif
#define _eet_freelist_reset(Ctx) _eet_free_reset(&Ctx->freelist);
#define _eet_freelist_ref(Ctx) _eet_free_ref(&Ctx->freelist);
#define _eet_freelist_unref(Ctx) _eet_free_unref(&Ctx->freelist);
@@ -3606,12 +3609,12 @@ _eet_data_descriptor_decode(Eet_Free_Context *context,
memset(&chnk, 0, sizeof(Eet_Data_Chunk));
eet_data_chunk_get(ed, &chnk, data_in, size_in);
- if (!chnk.name)
- goto error;
+ EINA_SAFETY_ON_NULL_GOTO(chnk.name, error);
if (edd)
- if (strcmp(chnk.name, edd->name))
- goto error;
+ {
+ EINA_SAFETY_ON_TRUE_GOTO(strcmp(chnk.name, edd->name), error);
+ }
p = chnk.data;
if (ed)
@@ -3655,6 +3658,7 @@ _eet_data_descriptor_decode(Eet_Free_Context *context,
case EET_G_UNION:
case EET_G_VARIANT:
default:
+ ERR("Decoding error!");
goto error;
}
}
@@ -3670,8 +3674,7 @@ _eet_data_descriptor_decode(Eet_Free_Context *context,
/* get next data chunk */
memset(&echnk, 0, sizeof(Eet_Data_Chunk));
eet_data_chunk_get(ed, &echnk, p, size);
- if (!echnk.name)
- goto error; /* FIXME: don't REPLY on edd - work without */
+ EINA_SAFETY_ON_NULL_GOTO(echnk.name, error); /* FIXME: don't REPLY on edd - work without */
if (edd)
{
@@ -3719,8 +3722,7 @@ _eet_data_descriptor_decode(Eet_Free_Context *context,
echnk.data,
((char *)echnk.data) + echnk.size,
dd);
- if (ret <= 0)
- goto error;
+ EINA_SAFETY_ON_TRUE_GOTO(ret <= 0, error);
child = eet_data_node_simple_type(type, echnk.name, dd);
@@ -3740,8 +3742,7 @@ _eet_data_descriptor_decode(Eet_Free_Context *context,
&p,
&size);
- if (ret <= 0)
- goto error;
+ EINA_SAFETY_ON_TRUE_GOTO(ret <= 0, error);
}
/* advance to next chunk */
@@ -3884,11 +3885,9 @@ eet_data_get_hash(Eet_Free_Context *context,
echnk->data,
((char *)echnk->data) + echnk->size,
&key);
- if (ret <= 0)
- goto on_error;
+ EINA_SAFETY_ON_TRUE_GOTO(ret <= 0, on_error);
- if (!key)
- goto on_error;
+ EINA_SAFETY_ON_NULL_GOTO(key, on_error);
/* Advance to next chunk */
NEXT_CHUNK((*p), (*size), (*echnk), ed);
@@ -3896,13 +3895,15 @@ eet_data_get_hash(Eet_Free_Context *context,
/* Read value */
eet_data_chunk_get(ed, echnk, *p, *size);
- if (!echnk->name)
- goto on_error;
+ EINA_SAFETY_ON_NULL_GOTO(echnk->name, on_error);
if (ede)
if ((ede->group_type != echnk->group_type)
|| (ede->type != echnk->type))
- goto on_error;
+ {
+ ERR("ERROR!");
+ goto on_error;
+ }
if (IS_POINTER_TYPE(echnk->type))
POINTER_TYPE_DECODE(context,
@@ -4023,17 +4024,26 @@ eet_data_get_array(Eet_Free_Context *context,
eet_data_chunk_get(ed, echnk, *p, *size);
if (!echnk->name || strcmp(echnk->name, name) != 0)
- goto on_error; /* get the data */
+ {
+ ERR("ERROR!");
+ goto on_error;
+ }
if ((echnk->group_type != group_type)
|| ((echnk->type != type) && (echnk->type != EET_T_NULL)))
- goto on_error;
+ {
+ ERR("ERROR!");
+ goto on_error;
+ }
if (ede)
if ((ede->group_type != echnk->group_type)
|| ((echnk->type != ede->type) && (echnk->type != EET_T_NULL)))
- goto on_error;
-
+ {
+ ERR("ERROR!");
+ goto on_error;
+ }
+ /* get the data */
/* get the destination pointer */
if (ede)
{
@@ -4089,8 +4099,7 @@ eet_data_get_array(Eet_Free_Context *context,
else
array = eet_node_var_array_new(name, childs);
- if (!array)
- goto on_error;
+ EINA_SAFETY_ON_NULL_GOTO(array, on_error);
eet_node_struct_append(parent, name, array);
}
@@ -4189,8 +4198,7 @@ eet_data_get_union(Eet_Free_Context *context,
echnk->data,
((char *)echnk->data) + echnk->size,
&union_type);
- if (ret <= 0)
- goto on_error;
+ EINA_SAFETY_ON_TRUE_GOTO(ret <= 0, on_error);
/* Advance to next chunk */
NEXT_CHUNK((*p), (*size), (*echnk), ed);
@@ -4198,13 +4206,12 @@ eet_data_get_union(Eet_Free_Context *context,
/* Read value */
eet_data_chunk_get(ed, echnk, *p, *size);
- if (!echnk->name)
- goto on_error;
+ EINA_SAFETY_ON_NULL_GOTO(echnk->name, on_error);
if (ede)
{
EET_ASSERT(!(ede->group_type != group_type || ede->type != type),
- goto on_error);
+ ERR("ERROR!"); goto on_error);
/* Search the structure of the union to decode */
for (i = 0; i < ede->subtype->elements.num; ++i)
@@ -4229,7 +4236,7 @@ eet_data_get_union(Eet_Free_Context *context,
}
else
{
- EET_ASSERT(sede->subtype, goto on_error);
+ EET_ASSERT(sede->subtype, ERR("ERROR!"); goto on_error);
data_ret = _eet_data_descriptor_decode(context,
ed,
sede->subtype,
@@ -4237,8 +4244,7 @@ eet_data_get_union(Eet_Free_Context *context,
echnk->size,
data,
sede->subtype->size);
- if (!data_ret)
- goto on_error;
+ EINA_SAFETY_ON_NULL_GOTO(data_ret, on_error);
}
/* Set union type. */
@@ -4269,6 +4275,7 @@ eet_data_get_union(Eet_Free_Context *context,
ed, NULL,
echnk->data, echnk->size,
NULL, 0);
+ ERR("ERROR!");
goto on_error;
}
@@ -4418,8 +4425,7 @@ eet_data_get_variant(Eet_Free_Context *context,
echnk->data,
((char *)echnk->data) + echnk->size,
&union_type);
- if (ret <= 0)
- goto on_error;
+ EINA_SAFETY_ON_TRUE_GOTO(ret <= 0, on_error);
/* Advance to next chunk */
NEXT_CHUNK((*p), (*size), (*echnk), ed);
@@ -4427,14 +4433,13 @@ eet_data_get_variant(Eet_Free_Context *context,
/* Read value */
eet_data_chunk_get(ed, echnk, *p, *size);
- if (!echnk->name)
- goto on_error;
+ EINA_SAFETY_ON_NULL_GOTO(echnk->name, on_error);
if (ede)
{
char *ut;
- EET_ASSERT(ede->subtype, goto on_error);
+ EET_ASSERT(ede->subtype, ERR("ERROR!"); goto on_error);
if ((!ed) || (!ede->subtype->func.str_direct_alloc))
{
@@ -4472,15 +4477,13 @@ eet_data_get_variant(Eet_Free_Context *context,
memset(&chnk, 0, sizeof(Eet_Data_Chunk));
eet_data_chunk_get(ed, &chnk, p2, size2);
- if (!chnk.name)
- goto on_error;
+ EINA_SAFETY_ON_NULL_GOTO(chnk.name, on_error);
ret = eet_group_codec[sede->group_type - 100].get
(context, ed, sede->subtype, sede, &chnk, sede->type,
sede->group_type, data, &p2, &size2);
- if (ret <= 0)
- goto on_error;
+ EINA_SAFETY_ON_TRUE_GOTO(ret <= 0, on_error);
/* advance to next chunk */
NEXT_CHUNK(p2, size2, chnk, ed);
@@ -4502,8 +4505,7 @@ eet_data_get_variant(Eet_Free_Context *context,
echnk->data,
echnk->size,
NULL, 0);
- if (!data_ret)
- break;
+ EINA_SAFETY_ON_TRUE_GOTO(!data_ret, on_error);
/* And point to the variant data. */
*(void **)data = data_ret;
@@ -4519,8 +4521,7 @@ eet_data_get_variant(Eet_Free_Context *context,
Eet_Variant_Unknow *evu;
evu = calloc(1, sizeof (Eet_Variant_Unknow) + echnk->size - 1);
- if (!evu)
- goto on_error;
+ EINA_SAFETY_ON_NULL_GOTO(evu, on_error);
evu->size = echnk->size;
memcpy(evu->data, echnk->data, evu->size);
@@ -4541,6 +4542,7 @@ eet_data_get_variant(Eet_Free_Context *context,
ed, NULL,
echnk->data, echnk->size,
NULL, 0);
+ ERR("ERROR!");
goto on_error;
}
diff --git a/src/lib/eet/eet_lib.c b/src/lib/eet/eet_lib.c
index 58841e56f7..e53d1ed89a 100644
--- a/src/lib/eet/eet_lib.c
+++ b/src/lib/eet/eet_lib.c
@@ -93,8 +93,7 @@ read_binbuf_from_disk(Eet_File *ef,
Eet_File_Node *efn);
static Eet_Error
-eet_internal_close(Eet_File *ef,
- Eina_Bool locked);
+eet_internal_close(Eet_File *ef, Eina_Bool locked, Eina_Bool shutdown);
static Eina_Lock eet_cache_lock;
@@ -147,7 +146,7 @@ eet_test_close(int test,
if (test)
{
ef->delete_me_now = 1;
- eet_internal_close(ef, EINA_TRUE);
+ eet_internal_close(ef, EINA_TRUE, EINA_FALSE);
}
return test;
@@ -205,7 +204,7 @@ eet_cache_add(Eet_File *ef,
if (del_ef)
{
del_ef->delete_me_now = 1;
- eet_internal_close(del_ef, EINA_TRUE);
+ eet_internal_close(del_ef, EINA_TRUE, EINA_FALSE);
}
}
@@ -643,7 +642,7 @@ eet_shutdown(void)
for (i = 0; i < num; i++)
{
ERR("File '%s' is still open %i times !", closelist[i]->path, closelist[i]->references);
- eet_internal_close(closelist[i], EINA_TRUE);
+ eet_internal_close(closelist[i], EINA_TRUE, EINA_TRUE);
}
}
eet_node_shutdown();
@@ -734,7 +733,7 @@ eet_clearcache(void)
for (i = 0; i < num; i++)
{
- eet_internal_close(closelist[i], EINA_TRUE);
+ eet_internal_close(closelist[i], EINA_TRUE, EINA_FALSE);
}
}
@@ -886,7 +885,10 @@ eet_internal_read2(Eet_File *ef)
{
efn->data = malloc(efn->size);
if (efn->data)
- memcpy(efn->data, ef->data + efn->offset, efn->size);
+ {
+ memcpy(efn->data, ef->data + efn->offset, efn->size);
+ ef->header->directory->free_count++;
+ }
}
/* compute the possible position of a signature */
@@ -1190,6 +1192,7 @@ eet_internal_read1(Eet_File *ef)
strncpy(efn->name, (char *)p + HEADER_SIZE, name_size);
efn->name[name_size] = 0;
+ ef->header->directory->free_count++;
WRN(
"File: %s is not up to date for key \"%s\" - needs rebuilding sometime",
@@ -1212,7 +1215,10 @@ eet_internal_read1(Eet_File *ef)
{
data = malloc(efn->size);
if (data)
- memcpy(data, ef->data + efn->offset, efn->size);
+ {
+ memcpy(data, ef->data + efn->offset, efn->size);
+ ef->header->directory->free_count++;
+ }
efn->data = data;
}
@@ -1254,7 +1260,7 @@ eet_internal_read(Eet_File *ef)
default:
ef->delete_me_now = 1;
- eet_internal_close(ef, EINA_TRUE);
+ eet_internal_close(ef, EINA_TRUE, EINA_FALSE);
break;
}
@@ -1263,7 +1269,7 @@ eet_internal_read(Eet_File *ef)
static Eet_Error
eet_internal_close(Eet_File *ef,
- Eina_Bool locked)
+ Eina_Bool locked, Eina_Bool shutdown)
{
Eet_Error err = EET_ERROR_NONE;
@@ -1321,30 +1327,43 @@ eet_internal_close(Eet_File *ef,
int i, num;
num = (1 << ef->header->directory->size);
- for (i = 0; i < num; i++)
+ for (i = 0; i < num && ef->header->directory->free_count; i++)
{
Eet_File_Node *efn;
while ((efn = ef->header->directory->nodes[i]))
{
if (efn->data)
- free(efn->data);
+ {
+ free(efn->data);
+ ef->header->directory->free_count--;
+ }
ef->header->directory->nodes[i] = efn->next;
if (efn->free_name)
- free(efn->name);
-
- eet_file_node_mp_free(efn);
+ {
+ free(efn->name);
+ ef->header->directory->free_count--;
+ }
+
+ if (shutdown)
+ {
+ if (!ef->header->directory->free_count) break;
+ }
+ else
+ eet_file_node_mp_free(efn);
}
}
free(ef->header->directory->nodes);
}
- eet_file_directory_mp_free(ef->header->directory);
+ if (!shutdown)
+ eet_file_directory_mp_free(ef->header->directory);
}
- eet_file_header_mp_free(ef->header);
+ if (!shutdown)
+ eet_file_header_mp_free(ef->header);
}
eet_dictionary_free(ef->ed);
@@ -1365,7 +1384,8 @@ eet_internal_close(Eet_File *ef,
/* free it */
eina_stringshare_del(ef->path);
- eet_file_mp_free(ef);
+ if (!shutdown)
+ eet_file_mp_free(ef);
return err;
on_error:
@@ -1434,7 +1454,7 @@ eet_mmap(const Eina_File *file)
eet_sync(ef);
ef->references++;
ef->delete_me_now = 1;
- eet_internal_close(ef, EINA_TRUE);
+ eet_internal_close(ef, EINA_TRUE, EINA_FALSE);
}
ef = eet_cache_find(path, eet_readers, eet_readers_num);
@@ -1510,7 +1530,7 @@ eet_open(const char *file,
eet_sync(ef);
ef->references++;
ef->delete_me_now = 1;
- eet_internal_close(ef, EINA_TRUE);
+ eet_internal_close(ef, EINA_TRUE, EINA_FALSE);
}
ef = eet_cache_find((char *)file, eet_readers, eet_readers_num);
@@ -1523,7 +1543,7 @@ eet_open(const char *file,
{
ef->delete_me_now = 1;
ef->references++;
- eet_internal_close(ef, EINA_TRUE);
+ eet_internal_close(ef, EINA_TRUE, EINA_FALSE);
}
ef = eet_cache_find((char *)file, eet_writers, eet_writers_num);
@@ -1574,7 +1594,7 @@ open_error:
{
ef->delete_me_now = 1;
ef->references++;
- eet_internal_close(ef, EINA_TRUE);
+ eet_internal_close(ef, EINA_TRUE, EINA_FALSE);
ef = NULL;
}
@@ -1890,7 +1910,7 @@ eet_identity_set(Eet_File *ef,
EAPI Eet_Error
eet_close(Eet_File *ef)
{
- return eet_internal_close(ef, EINA_FALSE);
+ return eet_internal_close(ef, EINA_FALSE, EINA_FALSE);
}
EAPI void *
@@ -2307,12 +2327,14 @@ eet_alias(Eet_File *ef,
efn->name = strdup(name);
efn->name_size = strlen(efn->name) + 1;
efn->free_name = 1;
+ ef->header->directory->free_count++;
efn->data = NULL;
efn->next = ef->header->directory->nodes[hash];
ef->header->directory->nodes[hash] = efn;
eet_define_data(ef, efn, in, strlen(destination) + 1, comp, 0);
+ ef->header->directory->free_count++;
}
efn->alias = 1;
@@ -2455,12 +2477,14 @@ eet_write_cipher(Eet_File *ef,
efn->name = strdup(name);
efn->name_size = strlen(efn->name) + 1;
efn->free_name = 1;
+ ef->header->directory->free_count++;
efn->data = NULL;
efn->next = ef->header->directory->nodes[hash];
ef->header->directory->nodes[hash] = efn;
eet_define_data(ef, efn, in, size, comp, !!cipher_key);
+ ef->header->directory->free_count++;
}
/* flags that writes are pending */
diff --git a/src/lib/eet/eet_node.c b/src/lib/eet/eet_node.c
index 76c705a299..fa203f2ea8 100644
--- a/src/lib/eet/eet_node.c
+++ b/src/lib/eet/eet_node.c
@@ -275,6 +275,7 @@ eet_node_list_append(Eet_Node *parent,
}
child->next = NULL;
+ child->parent = parent;
eina_stringshare_del(tmp);
@@ -287,6 +288,7 @@ eet_node_list_append(Eet_Node *parent,
/* And add it to the parent. */
nn->next = parent->values;
parent->values = nn;
+ child->parent = parent;
eina_stringshare_del(tmp);
}
@@ -336,6 +338,7 @@ eet_node_struct_append(Eet_Node *parent,
child->next = NULL;
parent->values = child;
}
+ child->parent = parent;
eina_stringshare_del(tmp);
}
@@ -356,6 +359,7 @@ eet_node_hash_add(Eet_Node *parent,
/* And add it to the parent. */
nn->next = parent->values;
parent->values = nn;
+ child->parent = parent;
}
int
diff --git a/src/lib/eeze/eeze_sensor.c b/src/lib/eeze/eeze_sensor.c
index 9705cfb4f1..df8a14af36 100644
--- a/src/lib/eeze/eeze_sensor.c
+++ b/src/lib/eeze/eeze_sensor.c
@@ -9,6 +9,7 @@
#include <Ecore.h>
#include <Eeze_Sensor.h>
#include "eeze_sensor_private.h"
+#include "../../static_libs/buildsystem/buildsystem.h"
EAPI int EEZE_SENSOR_EVENT_ACCELEROMETER;
EAPI int EEZE_SENSOR_EVENT_GRAVITY;
@@ -115,9 +116,7 @@ eeze_sensor_modules_load(void)
for (itr = _module_priority; *itr != NULL; itr++)
{
- snprintf(buf, sizeof(buf),
- PACKAGE_BUILD_DIR "/src/modules/eeze/sensor/%s/.libs",
- *itr);
+ bs_mod_dir_get(buf, sizeof(buf), "eeze/sensor", *itr);
g_handle->modules_array = eina_module_list_get(
g_handle->modules_array, buf, EINA_FALSE, NULL, NULL);
}
diff --git a/src/lib/eeze/eeze_udev_watch.c b/src/lib/eeze/eeze_udev_watch.c
index eccd61c3d1..7245f9d0a6 100644
--- a/src/lib/eeze/eeze_udev_watch.c
+++ b/src/lib/eeze/eeze_udev_watch.c
@@ -11,22 +11,14 @@
#include <Eeze.h>
#include "eeze_udev_private.h"
+static Eina_Inlist *watches;
+
/* opaque */
struct Eeze_Udev_Watch
{
- _udev_monitor *mon;
+ EINA_INLIST;
Ecore_Fd_Handler *handler;
- Eeze_Udev_Type type;
- void *data;
-};
-
-/* private */
-struct _store_data
-{
- void (*func)(const char *,
- Eeze_Udev_Event,
- void *,
- Eeze_Udev_Watch *);
+ Eeze_Udev_Watch_Cb func;
void *data;
Eeze_Udev_Event event;
_udev_monitor *mon;
@@ -42,18 +34,17 @@ static Eina_Bool
_get_syspath_from_watch(void *data,
Ecore_Fd_Handler *fd_handler)
{
- struct _store_data *store = data;
+ Eeze_Udev_Watch *watch = data;
_udev_device *device = NULL, *parent, *tmpdev;
const char *ret, *test;
- Eeze_Udev_Watch_Cb func = store->func;
- void *sdata = store->data;
- Eeze_Udev_Watch *watch = store->watch;
+ Eeze_Udev_Watch_Cb func = watch->func;
+ void *sdata = watch->data;
int event = 0;
if (!ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_READ))
return EINA_TRUE;
- device = udev_monitor_receive_device(store->mon);
+ device = udev_monitor_receive_device(watch->mon);
if (!device)
return EINA_TRUE;
@@ -62,44 +53,44 @@ _get_syspath_from_watch(void *data,
|| (!(ret = udev_device_get_syspath(device))))
goto error;
- if (store->event)
+ if (watch->event)
{
if (!strcmp(test, "add"))
{
- if ((store->event != EEZE_UDEV_EVENT_NONE) &&
- ((store->event & EEZE_UDEV_EVENT_ADD) != EEZE_UDEV_EVENT_ADD))
+ if ((watch->event != EEZE_UDEV_EVENT_NONE) &&
+ ((watch->event & EEZE_UDEV_EVENT_ADD) != EEZE_UDEV_EVENT_ADD))
goto error;
event |= EEZE_UDEV_EVENT_ADD;
}
else if (!strcmp(test, "remove"))
{
- if ((store->event != EEZE_UDEV_EVENT_NONE) &&
- ((store->event & EEZE_UDEV_EVENT_REMOVE) != EEZE_UDEV_EVENT_REMOVE))
+ if ((watch->event != EEZE_UDEV_EVENT_NONE) &&
+ ((watch->event & EEZE_UDEV_EVENT_REMOVE) != EEZE_UDEV_EVENT_REMOVE))
goto error;
event |= EEZE_UDEV_EVENT_REMOVE;
}
else if (!strcmp(test, "change"))
{
- if ((store->event != EEZE_UDEV_EVENT_NONE) &&
- ((store->event & EEZE_UDEV_EVENT_CHANGE) != EEZE_UDEV_EVENT_CHANGE))
+ if ((watch->event != EEZE_UDEV_EVENT_NONE) &&
+ ((watch->event & EEZE_UDEV_EVENT_CHANGE) != EEZE_UDEV_EVENT_CHANGE))
goto error;
event |= EEZE_UDEV_EVENT_CHANGE;
}
else if (!strcmp(test, "online"))
{
- if ((store->event != EEZE_UDEV_EVENT_NONE) &&
- ((store->event & EEZE_UDEV_EVENT_ONLINE) != EEZE_UDEV_EVENT_ONLINE))
+ if ((watch->event != EEZE_UDEV_EVENT_NONE) &&
+ ((watch->event & EEZE_UDEV_EVENT_ONLINE) != EEZE_UDEV_EVENT_ONLINE))
goto error;
event |= EEZE_UDEV_EVENT_ONLINE;
}
else
{
- if ((store->event != EEZE_UDEV_EVENT_NONE) &&
- ((store->event & EEZE_UDEV_EVENT_OFFLINE) != EEZE_UDEV_EVENT_OFFLINE))
+ if ((watch->event != EEZE_UDEV_EVENT_NONE) &&
+ ((watch->event & EEZE_UDEV_EVENT_OFFLINE) != EEZE_UDEV_EVENT_OFFLINE))
goto error;
event |= EEZE_UDEV_EVENT_OFFLINE;
@@ -108,7 +99,7 @@ _get_syspath_from_watch(void *data,
if ((event & EEZE_UDEV_EVENT_OFFLINE) || (event & EEZE_UDEV_EVENT_REMOVE))
goto out;
- switch (store->type)
+ switch (watch->type)
{
case EEZE_UDEV_TYPE_KEYBOARD:
if ((!udev_device_get_property_value(device, "ID_INPUT_KEYBOARD")) &&
@@ -279,28 +270,16 @@ error:
return EINA_TRUE;
}
-EAPI Eeze_Udev_Watch *
-eeze_udev_watch_add(Eeze_Udev_Type type,
- int event,
- Eeze_Udev_Watch_Cb cb,
- void *user_data)
+static Eina_Bool
+_watch_init(Eeze_Udev_Watch *watch)
{
_udev_monitor *mon = NULL;
int fd;
Ecore_Fd_Handler *handler;
- Eeze_Udev_Watch *watch = NULL;
- struct _store_data *store = NULL;
-
- if (!(store = calloc(1, sizeof(struct _store_data))))
- return NULL;
-
- if (!(watch = malloc(sizeof(Eeze_Udev_Watch))))
- goto error;
-
if (!(mon = udev_monitor_new_from_netlink(udev, "udev")))
goto error;
- switch (type)
+ switch (watch->type)
{
case EEZE_UDEV_TYPE_JOYSTICK:
case EEZE_UDEV_TYPE_KEYBOARD:
@@ -367,49 +346,77 @@ eeze_udev_watch_add(Eeze_Udev_Type type,
goto error;
fd = udev_monitor_get_fd(mon);
- store->func = cb;
- store->data = user_data;
- store->mon = mon;
- store->type = type;
- store->watch = watch;
- store->event = event;
+ watch->mon = mon;
if (!(handler = ecore_main_fd_handler_add(fd, ECORE_FD_READ,
- _get_syspath_from_watch, store, NULL, NULL)))
+ _get_syspath_from_watch, watch, NULL, NULL)))
goto error;
- watch->mon = mon;
watch->handler = handler;
- return watch;
+ return EINA_TRUE;
error:
- if (store)
- free(store);
- if (watch)
- free(watch);
if (mon)
udev_monitor_unref(mon);
ERR("Could not create watch!");
+ return EINA_FALSE;
+}
+
+static void
+_eeze_udev_watch_reset()
+{
+ Eeze_Udev_Watch *watch;
+
+ EINA_INLIST_FOREACH(watches, watch)
+ {
+ ecore_main_fd_handler_del(watch->handler);
+ udev_monitor_unref(watch->mon);
+ watch->handler = NULL;
+ watch->mon = NULL;
+ _watch_init(watch);
+ }
+}
+
+EAPI Eeze_Udev_Watch *
+eeze_udev_watch_add(Eeze_Udev_Type type,
+ int event,
+ Eeze_Udev_Watch_Cb cb,
+ void *user_data)
+{
+ Eeze_Udev_Watch *watch = NULL;
+
+ watch = calloc(1, sizeof(Eeze_Udev_Watch));
+ EINA_SAFETY_ON_NULL_RETURN_VAL(watch, NULL);
+
+ watch->func = cb;
+ watch->data = user_data;
+ watch->type = type;
+ watch->watch = watch;
+ watch->event = event;
+ if (!_watch_init(watch)) goto error;
+ if (!watches)
+ ecore_fork_reset_callback_add(_eeze_udev_watch_reset, NULL);
+ watches = eina_inlist_append(watches, EINA_INLIST_GET(watch));
+ return watch;
+error:
+ free(watch);
return NULL;
}
EAPI void *
eeze_udev_watch_del(Eeze_Udev_Watch *watch)
{
- struct _store_data *sdata;
void *ret = NULL;
- if ((!watch) || (!watch->mon) || (!watch->handler))
+ if (!watch)
return NULL;
- sdata = ecore_main_fd_handler_del(watch->handler);
+ ecore_main_fd_handler_del(watch->handler);
udev_monitor_unref(watch->mon);
- if (sdata)
- {
- ret = sdata->data;
- free(sdata);
- }
-
+ ret = watch->data;
+ watches = eina_inlist_remove(watches, EINA_INLIST_GET(watch));
+ if (!watches)
+ ecore_fork_reset_callback_del(_eeze_udev_watch_reset, NULL);
free(watch);
return ret;
}
diff --git a/src/lib/efl/CMakeLists.txt b/src/lib/efl/CMakeLists.txt
index 6ed0752ebd..0c03b5c672 100644
--- a/src/lib/efl/CMakeLists.txt
+++ b/src/lib/efl/CMakeLists.txt
@@ -11,7 +11,6 @@ set(PUBLIC_EO_FILES
interfaces/efl_content.eo
interfaces/efl_control.eo
interfaces/efl_file.eo
- interfaces/efl_flipable.eo
interfaces/efl_gfx.eo
interfaces/efl_gfx_buffer.eo
interfaces/efl_gfx_fill.eo
@@ -49,11 +48,8 @@ set(PUBLIC_EO_FILES
interfaces/efl_player.eo
interfaces/efl_screen.eo
interfaces/efl_text.eo
- interfaces/efl_text_properties.eo
interfaces/efl_text_types.eot
interfaces/efl_types.eot
- interfaces/efl_ui_item.eo
- interfaces/efl_ui_menu.eo
interfaces/efl_ui_range.eo
interfaces/efl_ui_autorepeat.eo
interfaces/efl_vpath.eo
diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h
index 8505afa176..6cebb21dae 100644
--- a/src/lib/efl/Efl.h
+++ b/src/lib/efl/Efl.h
@@ -10,28 +10,41 @@ extern "C" {
#ifdef EAPI
# undef EAPI
#endif
+#ifdef EWAPI
+# undef EWAPI
+#endif
+#ifdef EOAPI
+# undef EOAPI
+#endif
#ifdef _WIN32
-# ifdef EFL_EFL_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EFL_BUILD */
+# endif
+# define EAPI_WEAK
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
# define EAPI __attribute__ ((visibility("default")))
+# define EAPI_WEAK __attribute__ ((weak))
# else
# define EAPI
+# define EAPI_WEAK
# endif
# else
# define EAPI
+# define EAPI_WEAK
# endif
-#endif /* ! _WIN32 */
+#endif
+
+#define EWAPI EAPI EAPI_WEAK
+#define EOAPI EAPI EAPI_WEAK
#define EFL_VERSION_1_18 1
#define EFL_VERSION_1_19 1
@@ -39,7 +52,7 @@ extern "C" {
#define EFL_VERSION_1_21 1
/* Add here all the required ifdef for any @protected method */
-#ifdef EFL_EFL_BUILD
+#ifdef EFL_BUILD
# define EFL_PACK_LAYOUT_PROTECTED
# define EFL_GFX_SIZE_HINT_PROTECTED
#endif
@@ -62,12 +75,6 @@ typedef struct _Efl_Text_Annotate_Annotation Efl_Text_Annotate_Annotation;
#include <Efl_Model_Common.h>
-#include "interfaces/efl_vpath_file.eo.h"
-#include "interfaces/efl_vpath.eo.h"
-#include "interfaces/efl_vpath_core.eo.h"
-#include "interfaces/efl_vpath_manager.eo.h"
-#include "interfaces/efl_vpath_file_core.eo.h"
-
/* Data types */
#include "interfaces/efl_gfx_types.eot.h"
#include "interfaces/efl_ui_types.eot.h"
@@ -78,22 +85,19 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
#include "interfaces/efl_control.eo.h"
#include "interfaces/efl_duplicate.eo.h"
#include "interfaces/efl_file.eo.h"
-#include "interfaces/efl_image.eo.h"
-#include "interfaces/efl_image_animated.eo.h"
-#include "interfaces/efl_image_load.eo.h"
+#include "interfaces/efl_gfx_image.eo.h"
+#include "interfaces/efl_gfx_image_animation_controller.eo.h"
+#include "interfaces/efl_gfx_image_load_controller.eo.h"
#include "interfaces/efl_part.eo.h"
+#include "interfaces/efl_playable.eo.h"
#include "interfaces/efl_player.eo.h"
#include "interfaces/efl_text.eo.h"
#include "interfaces/efl_text_types.eot.h"
-#include "interfaces/efl_text_properties.eo.h"
#include "interfaces/efl_orientation.eo.h"
-#include "interfaces/efl_flipable.eo.h"
#include "interfaces/efl_ui_base.eo.h"
#include "interfaces/efl_ui_direction.eo.h"
#include "interfaces/efl_ui_drag.eo.h"
#include "interfaces/efl_ui_range.eo.h"
-#include "interfaces/efl_ui_item.eo.h"
-#include "interfaces/efl_ui_menu.eo.h"
#include "interfaces/efl_ui_autorepeat.eo.h"
#include "interfaces/efl_ui_draggable.eo.h"
#include "interfaces/efl_ui_clickable.eo.h"
@@ -101,6 +105,7 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
#include "interfaces/efl_ui_scrollbar.eo.h"
#include "interfaces/efl_ui_scrollable_interactive.eo.h"
#include "interfaces/efl_ui_selectable.eo.h"
+#include "interfaces/efl_ui_multi_selectable.eo.h"
#include "interfaces/efl_ui_zoom.eo.h"
#include "interfaces/efl_screen.eo.h"
@@ -114,7 +119,7 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
#include "interfaces/efl_animator.eo.h"
/* Graphics */
-#include "interfaces/efl_gfx.eo.h"
+#include "interfaces/efl_gfx_entity.eo.h"
#include "interfaces/efl_gfx_color.eo.h"
#include "interfaces/efl_gfx_buffer.eo.h"
#include "interfaces/efl_gfx_stack.eo.h"
@@ -137,12 +142,11 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
#include "interfaces/efl_input_device.eo.h"
/* Canvas & UI */
-#include "interfaces/efl_canvas.eo.h"
+#include "interfaces/efl_canvas_scene.eo.h"
#include "interfaces/efl_canvas_pointer.eo.h"
#include "interfaces/efl_ui_view.eo.h"
#include "interfaces/efl_ui_model_connect.eo.h"
#include "interfaces/efl_ui_factory.eo.h"
-#include "interfaces/efl_ui_model_factory_connect.eo.h"
#include "interfaces/efl_ui_format.eo.h"
/* Observable interface */
@@ -176,6 +180,22 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
#include "interfaces/efl_text_markup.eo.h"
#include "interfaces/efl_text_markup_util.eo.h"
+/**
+ * @brief Get a proxy object referring to a part of an object.
+ *
+ * The returned object is valid for only a single function call.
+ * Of course, if the first call is @ref efl_ref, it will last
+ * until @ref efl_unref.
+ *
+ * @param[in] obj The object.
+ * @param[in] name The part name.
+ *
+ * @return A (proxy) object, valid for a single call.
+ *
+ * @since 1.21
+ */
+EAPI Efl_Object *efl_part(const Eo *obj, const char *name);
+
#else
#ifndef EFL_NOLEGACY_API_SUPPORT
@@ -183,9 +203,9 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
#include "interfaces/efl_ui_types.eot.h"
#include "interfaces/efl_input_types.eot.h"
#include "interfaces/efl_gfx_fill.eo.legacy.h"
-#include "interfaces/efl_gfx.eo.legacy.h"
-#include "interfaces/efl_image.eo.legacy.h"
-#include "interfaces/efl_image_animated.eo.legacy.h"
+#include "interfaces/efl_gfx_entity.eo.legacy.h"
+#include "interfaces/efl_gfx_image.eo.legacy.h"
+#include "interfaces/efl_gfx_image_animation_controller.eo.legacy.h"
#include "interfaces/efl_input_device.eo.legacy.h"
#include "interfaces/efl_text_types.eot.h"
#endif
diff --git a/src/lib/efl/Efl.hh b/src/lib/efl/Efl.hh
index e6473eafce..19cfb37c60 100644
--- a/src/lib/efl/Efl.hh
+++ b/src/lib/efl/Efl.hh
@@ -1,6 +1,8 @@
#ifndef EFL_EFL_HH
#define EFL_EFL_HH
+#define EFL_PART_PROTECTED
+
#include "cxx/efl_part_impl.hh"
#include <Eo.hh>
diff --git a/src/lib/efl/Efl_Model_Common.h b/src/lib/efl/Efl_Model_Common.h
index 5c565c64ab..8ed3858bbb 100644
--- a/src/lib/efl/Efl_Model_Common.h
+++ b/src/lib/efl/Efl_Model_Common.h
@@ -13,27 +13,6 @@ EAPI extern Eina_Error EFL_MODEL_ERROR_PERMISSION_DENIED;
EAPI extern Eina_Error EFL_MODEL_ERROR_INVALID_OBJECT; /**< @since 1.19 */
/**
- * @struct _Efl_Model_Children_Event
- * Every time a child id added the event
- * EFL_MODEL_EVENT_CHILD_ADDED is dispatched
- * passing along this structure.
- */
-struct _Efl_Model_Children_Event
-{
- Eo *child; /**< child, for child_add */
- /**
- * index is a hint and is intended
- * to provide a way for applications
- * to control/know children relative
- * positions through listings.
- *
- * NOTE: If listing is performed asynchronously
- * exact order may not be guaranteed.
- */
- unsigned int index;
-};
-
-/**
* @struct Efl_Model_Children_Event
*/
typedef struct _Efl_Model_Children_Event Efl_Model_Children_Event;
@@ -42,20 +21,6 @@ typedef struct _Efl_Model_Children_Event Efl_Model_Children_Event;
EAPI int efl_model_init(void);
-/**
- * @brief Slices a list
- *
- * If the @p start and @p count are 0, a new accessor of the entire list is returned
- *
- * @param list The list to get the slice
- * @param start The nth element to start the slice
- * @param count The number of elements
- * @return The accessor to the sliced elements or @c NULL if error
- *
- * @since 1.17
- */
-EAPI Eina_Accessor *efl_model_list_slice(Eina_List *list, unsigned start, unsigned count) EINA_ARG_NONNULL(1);
-
/**
* @brief Notifies a property changed event with an @c EFL_MODEL_EVENT_PROPERTIES_CHANGED
@@ -65,7 +30,9 @@ EAPI Eina_Accessor *efl_model_list_slice(Eina_List *list, unsigned start, unsign
*
* @since 1.17
*/
-EAPI void efl_model_property_changed_notify(Efl_Model *model, const char *property);
+EAPI void _efl_model_properties_changed_internal(const Efl_Model *model, ...);
+
+#define efl_model_properties_changed(Model, ...) _efl_model_properties_changed_internal(Model, ##__VA_ARGS__, NULL)
/**
* @brief Notifies a property invalidated event with an @c EFL_MODEL_EVENT_PROPERTIES_CHANGED
diff --git a/src/lib/efl/cxx/efl_part_impl.hh b/src/lib/efl/cxx/efl_part_impl.hh
index b97dda1457..6a0b9ead60 100644
--- a/src/lib/efl/cxx/efl_part_impl.hh
+++ b/src/lib/efl/cxx/efl_part_impl.hh
@@ -7,8 +7,7 @@
#define EOLIAN_CXX_EFL_PART_IMPLEMENTATION \
inline ::efl::Object Part::part(::efl::eina::string_view const& name) const \
{ \
- ::Eo *handle = ::efl_part(_eo_ptr(), name.c_str()); \
- ::___efl_auto_unref_set(handle, false); \
+ ::Eo *handle = ::efl_part_get(_eo_ptr(), name.c_str()); \
return ::efl::Object{handle}; \
}
diff --git a/src/lib/efl/interfaces/efl_animator.eo b/src/lib/efl/interfaces/efl_animator.eo
index ac7e86ba28..ca969d99fe 100644
--- a/src/lib/efl/interfaces/efl_animator.eo
+++ b/src/lib/efl/interfaces/efl_animator.eo
@@ -1,6 +1,6 @@
import eina_types;
-struct Efl.Event.Animator_Tick {
+struct Efl.Event_Animator_Tick {
[[EFL event animator tick data structure]]
update_area: Eina.Rect; [[Area of the canvas that will be pushed to screen.]]
}
@@ -10,6 +10,6 @@ interface Efl.Animator {
eo_prefix: efl_animator;
event_prefix: efl;
events {
- animator,tick: Efl.Event.Animator_Tick; [[Animator tick synchronized with screen vsync if possible.]]
+ animator,tick: Efl.Event_Animator_Tick; [[Animator tick synchronized with screen vsync if possible.]]
}
}
diff --git a/src/lib/efl/interfaces/efl_canvas.eo b/src/lib/efl/interfaces/efl_canvas_scene.eo
index 7403ca4fea..1e8703a3a8 100644
--- a/src/lib/efl/interfaces/efl_canvas.eo
+++ b/src/lib/efl/interfaces/efl_canvas_scene.eo
@@ -1,6 +1,7 @@
import efl_input_device;
+import efl_gfx_types;
-interface Efl.Canvas ()
+interface Efl.Canvas.Scene ()
{
[[Common interface for window and some internal classes in EFL.]]
methods {
@@ -28,7 +29,15 @@ interface Efl.Canvas ()
all smart objects in the canvas.
]]
}
- objects_at_xy_get @const {
+ @property smart_objects_calculating {
+ get {
+ [[Get if the canvas is currently calculating smart objects.]]
+ }
+ values {
+ calculating: bool; [[$true if currently calculating smart objects.]]
+ }
+ }
+ objects_at_xy_get {
[[Retrieve a list of objects lying over a given position in
a canvas.
@@ -41,7 +50,7 @@ interface Efl.Canvas ()
objects, acting only on the ones at the "top level", with
regard to object parenting.
]]
- return: iterator<Efl.Gfx> @owned @warn_unused; [[
+ return: iterator<Efl.Gfx.Entity> @owned @warn_unused; [[
The list of objects that are over the given position in $e.
]]
params {
@@ -69,7 +78,7 @@ interface Efl.Canvas ()
objects, acting only on the ones at the "top level", with
regard to object parenting.
]]
- return: Efl.Gfx @warn_unused; [[The Evas object that is over all other objects at the given position.]]
+ return: Efl.Gfx.Entity @warn_unused; [[The Evas object that is over all other objects at the given position.]]
params {
@in pos: Eina.Position2D; [[The pixel position.]]
@in include_pass_events_objects: bool; [[
@@ -82,7 +91,7 @@ interface Efl.Canvas ()
]]
}
}
- objects_in_rectangle_get @const {
+ objects_in_rectangle_get {
[[Retrieve a list of objects lying over a given
rectangular region in a canvas.
@@ -96,7 +105,7 @@ interface Efl.Canvas ()
objects, acting only on the ones at the "top level", with
regard to object parenting.
]]
- return: iterator<Efl.Gfx> @owned @warn_unused; [[Iterator to objects]]
+ return: iterator<Efl.Gfx.Entity> @owned @warn_unused; [[Iterator to objects]]
params {
@in rect: Eina.Rect; [[The rectangular region.]]
@in include_pass_events_objects: bool; [[
@@ -123,7 +132,7 @@ interface Efl.Canvas ()
objects, acting only on the ones at the "top level", with
regard to object parenting.
]]
- return: Efl.Gfx @warn_unused; [[
+ return: Efl.Gfx.Entity @warn_unused; [[
The object that is over all other objects at the given
rectangular region.
]]
@@ -223,8 +232,9 @@ interface Efl.Canvas ()
focus,out: Efl.Input.Focus; [[Called when canvas lost focus]]
object,focus,in: Efl.Input.Focus; [[Called when object got focus]]
object,focus,out: Efl.Input.Focus; [[Called when object lost focus]]
- render,pre; [[Called when pre render happens]]
- render,post; [[Called when post render happens]]
+ render,pre: void; [[Called when pre render happens]]
+ /* FIXME: event_info can be NULL, but @nullable tag does not work on events yet */
+ render,post: Efl.Gfx.Event.Render_Post; [[Called when post render happens]]
device,changed: Efl.Input.Device; [[Called when input device changed]]
device,added: Efl.Input.Device; [[Called when input device was added]]
device,removed: Efl.Input.Device; [[Called when input device was removed]]
diff --git a/src/lib/efl/interfaces/efl_common_internal.h b/src/lib/efl/interfaces/efl_common_internal.h
index a83edf1aa2..f0ca171a7d 100644
--- a/src/lib/efl/interfaces/efl_common_internal.h
+++ b/src/lib/efl/interfaces/efl_common_internal.h
@@ -43,7 +43,7 @@ struct _Efl_Input_Pointer_Data
int z;
Eina_Bool horizontal;
} wheel;
- Efl_Gfx *source; /* could it be ecore? */
+ Efl_Gfx_Entity *source; /* could it be ecore? */
Efl_Input_Device *device;
Efl_Pointer_Action action;
Efl_Pointer_Flags button_flags;
diff --git a/src/lib/efl/interfaces/efl_container.eo b/src/lib/efl/interfaces/efl_container.eo
index 1de3e864dd..e7157ee0a7 100644
--- a/src/lib/efl/interfaces/efl_container.eo
+++ b/src/lib/efl/interfaces/efl_container.eo
@@ -11,13 +11,13 @@ interface Efl.Container
content_remove {
[[Unswallow an object from this container.]]
params {
- @in content: Efl.Gfx; [[To be removed content]]
+ @in content: Efl.Gfx.Entity; [[To be removed content]]
}
return: bool; [[$false if $content was not a child or can not be removed.]]
}
content_iterate {
[[Begin iterating over this object's contents.]]
- return: iterator<Efl.Gfx> @owned @warn_unused; [[Iterator to object content]]
+ return: iterator<Efl.Gfx.Entity> @owned @warn_unused; [[Iterator to object content]]
}
content_count {
[[Returns the number of UI elements packed in this container.]]
@@ -25,7 +25,7 @@ interface Efl.Container
}
}
events {
- content,added: Efl.Gfx; [[Sent after a new item was added.]]
- content,removed: Efl.Gfx; [[Sent after an item was removed, before unref.]]
+ content,added: Efl.Gfx.Entity; [[Sent after a new item was added.]]
+ content,removed: Efl.Gfx.Entity; [[Sent after an item was removed, before unref.]]
}
}
diff --git a/src/lib/efl/interfaces/efl_content.eo b/src/lib/efl/interfaces/efl_content.eo
index 198b6c0482..da2088d834 100644
--- a/src/lib/efl/interfaces/efl_content.eo
+++ b/src/lib/efl/interfaces/efl_content.eo
@@ -13,12 +13,12 @@ interface Efl.Content
}
get {}
values {
- content: Efl.Gfx; [[The object to swallow.]]
+ content: Efl.Gfx.Entity; [[The object to swallow.]]
}
}
content_unset {
[[Unswallow the object in the current container and return it.]]
- return: Efl.Gfx; [[Unswallowed object]]
+ return: Efl.Gfx.Entity; [[Unswallowed object]]
}
}
}
diff --git a/src/lib/efl/interfaces/efl_file.c b/src/lib/efl/interfaces/efl_file.c
index 562a06b059..8edbbfb463 100644
--- a/src/lib/efl/interfaces/efl_file.c
+++ b/src/lib/efl/interfaces/efl_file.c
@@ -7,61 +7,54 @@
typedef struct _Efl_File_Data Efl_File_Data;
struct _Efl_File_Data
{
- Eo *vo;
-
- Efl_Image_Load_Error error;
+ Efl_Gfx_Image_Load_Error error;
};
static Eina_Bool
_efl_file_file_set(Eo *obj, Efl_File_Data *pd, const char *file, const char *key)
{
+ char *tmp = NULL;
Eina_File *f = NULL;
Eina_Bool r = EINA_FALSE;
- pd->error = EFL_IMAGE_LOAD_ERROR_DOES_NOT_EXIST;
+ pd->error = EFL_GFX_IMAGE_LOAD_ERROR_DOES_NOT_EXIST;
- if (file)
+ tmp = (char*)(file);
+ if (tmp)
{
- pd->vo = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, file);
- efl_vpath_file_do(pd->vo);
- // XXX:FIXME: allow this to be async
- efl_vpath_file_wait(pd->vo);
- file = efl_vpath_file_result_get(pd->vo);
+ tmp = eina_vpath_resolve(tmp);
}
- if (file)
+ if (tmp)
{
- f = eina_file_open(file, EINA_FALSE);
+ f = eina_file_open(tmp, EINA_FALSE);
if (!f) goto on_error;
}
- pd->error = EFL_IMAGE_LOAD_ERROR_NONE;
+ pd->error = EFL_GFX_IMAGE_LOAD_ERROR_NONE;
r = efl_file_mmap_set(obj, f, key);
if (f) eina_file_close(f);
on_error:
- if (pd->vo && (!efl_vpath_file_keep_get(pd->vo)))
- {
- efl_del(pd->vo);
- pd->vo = NULL;
- }
+ free(tmp);
return r;
}
static void
-_efl_file_file_get(Eo *obj, Efl_File_Data *pd EINA_UNUSED, const char **file, const char **key)
+_efl_file_file_get(const Eo *obj, Efl_File_Data *pd EINA_UNUSED, const char **file, const char **key)
{
const Eina_File *f = NULL;
efl_file_mmap_get(obj, &f, key);
if (f && file) *file = eina_file_filename_get(f);
+ else if (file) *file = NULL;
}
-static Efl_Image_Load_Error
-_efl_file_load_error_get(Eo *obj EINA_UNUSED, Efl_File_Data *pd)
+static Efl_Gfx_Image_Load_Error
+_efl_file_load_error_get(const Eo *obj EINA_UNUSED, Efl_File_Data *pd)
{
return pd->error;
}
diff --git a/src/lib/efl/interfaces/efl_file.eo b/src/lib/efl/interfaces/efl_file.eo
index e351a5eaa3..9260c16bf1 100644
--- a/src/lib/efl/interfaces/efl_file.eo
+++ b/src/lib/efl/interfaces/efl_file.eo
@@ -9,7 +9,7 @@ mixin Efl.File {
[[Gets the (last) file loading error for a given object.]]
}
values {
- error: Efl.Image.Load.Error(Efl.Image.Load.Error.none); [[The load error code.]]
+ error: Efl.Gfx.Image_Load_Error(Efl.Gfx.Image_Load_Error.none); [[The load error code.]]
}
}
@property mmap {
diff --git a/src/lib/efl/interfaces/efl_flipable.eo b/src/lib/efl/interfaces/efl_flipable.eo
deleted file mode 100644
index c915127060..0000000000
--- a/src/lib/efl/interfaces/efl_flipable.eo
+++ /dev/null
@@ -1,29 +0,0 @@
-enum Efl.Flip
-{
- [[Flip, See also @Efl.Flipable]]
- none = 0, [[No flip]]
- horizontal = 1, [[Flip image horizontally]]
- vertical = 2 [[Flip image vertically]]
-}
-
-interface Efl.Flipable
-{
- [[Efl flipable interface]]
- eo_prefix: efl_flip;
- methods {
- @property flip {
- [[Control the flip of the given image
-
- Use this function to change how your image is to be
- flipped: vertically or horizontally or transpose
- or traverse]]
- set {
- }
- get {
- }
- values {
- flip: Efl.Flip; [[Flip method]]
- }
- }
- }
-}
diff --git a/src/lib/efl/interfaces/efl_gfx_buffer.eo b/src/lib/efl/interfaces/efl_gfx_buffer.eo
index 5df340ba1c..09fd93de5a 100644
--- a/src/lib/efl/interfaces/efl_gfx_buffer.eo
+++ b/src/lib/efl/interfaces/efl_gfx_buffer.eo
@@ -2,7 +2,7 @@ import efl_gfx_types;
import eina_types;
/* FIXME: this is very very low level. expose to apps? */
-enum Efl.Gfx.Buffer.Access_Mode {
+enum Efl.Gfx.Buffer_Access_Mode {
[[Graphics buffer access mode]]
none = 0x0, [[No buffer access]]
read = 0x1, [[Read access to buffer]]
@@ -110,10 +110,10 @@ interface Efl.Gfx.Buffer ()
]]
get {}
values {
- l: uint(0); [[Left border pixels, usually 0 or 1]]
- r: uint(0); [[Right border pixels, usually 0 or 1]]
- t: uint(0); [[Top border pixels, usually 0 or 1]]
- b: uint(0); [[Bottom border pixels, usually 0 or 1]]
+ l: uint(0U); [[Left border pixels, usually 0 or 1]]
+ r: uint(0U); [[Right border pixels, usually 0 or 1]]
+ t: uint(0U); [[Top border pixels, usually 0 or 1]]
+ b: uint(0U); [[Bottom border pixels, usually 0 or 1]]
}
}
@@ -129,7 +129,7 @@ interface Efl.Gfx.Buffer ()
be negative.
]]
params {
- @in mode: Efl.Gfx.Buffer.Access_Mode; [[Specifies whether to map for read-only,
+ @in mode: Efl.Gfx.Buffer_Access_Mode; [[Specifies whether to map for read-only,
write-only or read-write access (OR combination of flags).]]
@cref region: Eina.Rect @optional; [[The region to map.]]
@in cspace: Efl.Gfx.Colorspace @optional; [[Requested colorspace. If different from the internal cspace,
diff --git a/src/lib/efl/interfaces/efl_gfx_color.c b/src/lib/efl/interfaces/efl_gfx_color.c
index 91f8a4fd32..54c4df868f 100644
--- a/src/lib/efl/interfaces/efl_gfx_color.c
+++ b/src/lib/efl/interfaces/efl_gfx_color.c
@@ -109,7 +109,7 @@ _efl_gfx_color_color_code_set(Eo *obj, void *_pd EINA_UNUSED, const char *colorc
}
EOLIAN static const char *
-_efl_gfx_color_color_code_get(Eo *obj, void *_pd EINA_UNUSED)
+_efl_gfx_color_color_code_get(const Eo *obj, void *_pd EINA_UNUSED)
{
int r, g, b, a;
@@ -131,7 +131,7 @@ _efl_gfx_color_color_class_code_set(Eo *obj, void *_pd EINA_UNUSED, const char *
}
EOLIAN static const char *
-_efl_gfx_color_color_class_code_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED,
+_efl_gfx_color_color_class_code_get(const Eo *obj EINA_UNUSED, void *pd EINA_UNUSED,
const char *color_class, Efl_Gfx_Color_Class_Layer layer)
{
int r, g, b, a;
diff --git a/src/lib/efl/interfaces/efl_gfx_color.eo b/src/lib/efl/interfaces/efl_gfx_color.eo
index 61f5e76f1e..21f18d144e 100644
--- a/src/lib/efl/interfaces/efl_gfx_color.eo
+++ b/src/lib/efl/interfaces/efl_gfx_color.eo
@@ -73,7 +73,7 @@ mixin Efl.Gfx.Color
}
keys {
color_class: string; [[The name of color class]]
- layer: Efl.Gfx.Color_Class.Layer @optional; [[The layer to set the color]]
+ layer: Efl.Gfx.Color_Class_Layer @optional; [[The layer to set the color]]
}
values {
colorcode: string; [[the hex color code.]]
diff --git a/src/lib/efl/interfaces/efl_gfx_color_class.eo b/src/lib/efl/interfaces/efl_gfx_color_class.eo
index 23df735233..116e2c9964 100644
--- a/src/lib/efl/interfaces/efl_gfx_color_class.eo
+++ b/src/lib/efl/interfaces/efl_gfx_color_class.eo
@@ -37,7 +37,7 @@ interface Efl.Gfx.Color_Class
}
keys {
color_class: string; [[The name of color class]]
- layer: Efl.Gfx.Color_Class.Layer @optional; [[The layer to set the color]]
+ layer: Efl.Gfx.Color_Class_Layer @optional; [[The layer to set the color]]
}
values {
r: int; [[The intensity of the red color]]
diff --git a/src/lib/efl/interfaces/efl_gfx.eo b/src/lib/efl/interfaces/efl_gfx_entity.eo
index c0ab8b325e..30131d6ba3 100644
--- a/src/lib/efl/interfaces/efl_gfx.eo
+++ b/src/lib/efl/interfaces/efl_gfx_entity.eo
@@ -1,9 +1,8 @@
import eina_types;
-import efl_gfx_types;
-interface Efl.Gfx {
+interface Efl.Gfx.Entity {
[[Efl graphics interface]]
- eo_prefix: efl_gfx;
+ eo_prefix: efl_gfx_entity;
methods {
@property position {
[[The 2D position of a canvas object.
@@ -32,7 +31,7 @@ interface Efl.Gfx {
Note that setting the actual size of an object might be the job
of its container, so this function might have no effect.
- Look at @Efl.Gfx.Size.Hint instead, when manipulating
+ Look at @Efl.Gfx.Size_Hint instead, when manipulating
widgets.
]]
}
@@ -102,9 +101,9 @@ interface Efl.Gfx {
}
}
events {
- show; [[Object just became visible.]]
- hide; [[Object just became invisible.]]
- move; [[Object was moved, its position during the event is the new one.]]
- resize; [[Object was resized, its size during the event is the new one.]]
+ show: void; [[Object just became visible.]]
+ hide: void; [[Object just became invisible.]]
+ move: void; [[Object was moved, its position during the event is the new one.]]
+ resize: void; [[Object was resized, its size during the event is the new one.]]
}
}
diff --git a/src/lib/efl/interfaces/efl_gfx_filter.eo b/src/lib/efl/interfaces/efl_gfx_filter.eo
index 3577a1936d..499a29c8de 100644
--- a/src/lib/efl/interfaces/efl_gfx_filter.eo
+++ b/src/lib/efl/interfaces/efl_gfx_filter.eo
@@ -85,7 +85,7 @@ interface Efl.Gfx.Filter
name: string; [[Buffer name as used in the program.]]
}
values {
- source: Efl.Gfx; [[Object to use as a source of pixels.]]
+ source: Efl.Gfx.Entity; [[Object to use as a source of pixels.]]
}
}
@property filter_data {
diff --git a/src/lib/efl/interfaces/efl_gfx_gradient.eo b/src/lib/efl/interfaces/efl_gfx_gradient.eo
index c8d4b3c880..311e873698 100644
--- a/src/lib/efl/interfaces/efl_gfx_gradient.eo
+++ b/src/lib/efl/interfaces/efl_gfx_gradient.eo
@@ -13,7 +13,7 @@ interface Efl.Gfx.Gradient
[[Get the list of color stops.]]
}
values {
- colors: ptr(const(Efl.Gfx.Gradient.Stop)); [[Color stops list]]
+ colors: ptr(const(Efl.Gfx.Gradient_Stop)); [[Color stops list]]
length: uint; [[Length of the list]]
}
}
@@ -27,7 +27,7 @@ interface Efl.Gfx.Gradient
]]
}
values {
- s: Efl.Gfx.Gradient.Spread; [[Spread type to be used]]
+ s: Efl.Gfx.Gradient_Spread; [[Spread type to be used]]
}
}
}
diff --git a/src/lib/efl/interfaces/efl_gfx_gradient_linear.eo b/src/lib/efl/interfaces/efl_gfx_gradient_linear.eo
index b416929e76..b0e7936d1f 100644
--- a/src/lib/efl/interfaces/efl_gfx_gradient_linear.eo
+++ b/src/lib/efl/interfaces/efl_gfx_gradient_linear.eo
@@ -1,4 +1,4 @@
-interface Efl.Gfx.Gradient.Linear (Efl.Gfx.Gradient)
+interface Efl.Gfx.Gradient_Linear (Efl.Gfx.Gradient)
{
[[Efl graphics gradient linear interface]]
methods {
diff --git a/src/lib/efl/interfaces/efl_gfx_gradient_radial.eo b/src/lib/efl/interfaces/efl_gfx_gradient_radial.eo
index 40a0bf273e..dbf38c6a37 100644
--- a/src/lib/efl/interfaces/efl_gfx_gradient_radial.eo
+++ b/src/lib/efl/interfaces/efl_gfx_gradient_radial.eo
@@ -1,4 +1,4 @@
-interface Efl.Gfx.Gradient.Radial (Efl.Gfx.Gradient)
+interface Efl.Gfx.Gradient_Radial (Efl.Gfx.Gradient)
{
[[Efl graphics gradient radial interface]]
methods {
diff --git a/src/lib/efl/interfaces/efl_image.eo b/src/lib/efl/interfaces/efl_gfx_image.eo
index 1e46b70769..1dd77f3058 100644
--- a/src/lib/efl/interfaces/efl_image.eo
+++ b/src/lib/efl/interfaces/efl_gfx_image.eo
@@ -1,7 +1,6 @@
import efl_gfx_types;
-import efl_gfx_fill;
-enum Efl.Image.Content_Hint
+enum Efl.Gfx.Image_Content_Hint
{
[[How an image's data is to be treated by EFL, for optimization.]]
none = 0, [[No hint on the content (default).]]
@@ -9,7 +8,7 @@ enum Efl.Image.Content_Hint
static = 2 [[The content won't change over time.]]
}
-enum Efl.Image.Scale_Hint
+enum Efl.Gfx.Image_Scale_Hint
{
/* FIXME: Legacy is in Emile, where it does not belong. */
[[How an image's data is to be treated by EFL, with regard to scaling cache.]]
@@ -18,7 +17,7 @@ enum Efl.Image.Scale_Hint
static = 2 [[Image will not be re-scaled over time, thus turning scaling cache ON for its data.]]
}
-enum Efl.Image.Scale_Type
+enum Efl.Gfx.Image_Scale_Type
{
[[Enumeration that defines scale types of an image.]]
fill, [[Scale the image so that it matches
@@ -40,7 +39,7 @@ enum Efl.Image.Scale_Type
none [[Not scale the image]]
}
-interface Efl.Image ()
+interface Efl.Gfx.Image ()
{
[[Common APIs for all 2D images that can be rendered on the canvas.]]
@@ -64,7 +63,7 @@ interface Efl.Image ()
@property scale_type {
[[Control how the image is scaled.]]
values {
- scale_type: Efl.Image.Scale_Type; [[Image scale type]]
+ scale_type: Efl.Gfx.Image_Scale_Type; [[Image scale type]]
}
}
@property ratio {
@@ -157,7 +156,7 @@ interface Efl.Image ()
}
}
- /* Note: those are obscure features of evas image. Expose in Efl.Image? */
+ /* Note: those are obscure features of evas image. Expose in Efl.Gfx.Image? */
@property content_hint {
set {
[[Set the content hint setting of a given image object of the
@@ -178,8 +177,8 @@ interface Efl.Image ()
]]
}
values {
- hint: Efl.Image.Content_Hint; [[Dynamic or static content hint,
- see @Efl.Image.Content_Hint]]
+ hint: Efl.Gfx.Image_Content_Hint; [[Dynamic or static content hint,
+ see @Efl.Gfx.Image_Content_Hint]]
}
}
@property scale_hint {
@@ -199,15 +198,15 @@ interface Efl.Image ()
]]
}
values {
- hint: Efl.Image.Scale_Hint; [[Scalable or static size hint,
- see @Efl.Image.Scale_Hint]]
+ hint: Efl.Gfx.Image_Scale_Hint; [[Scalable or static size hint,
+ see @Efl.Gfx.Image_Scale_Hint]]
}
}
}
events {
- preload; [[Image data has been preloaded.]]
- resize; [[Image was resized (its pixel data).]]
- unload; [[Image data has been unloaded (by some mechanism in
- EFL that threw out the original image data).]]
+ preload: void; [[Image data has been preloaded.]]
+ resize: void; [[Image was resized (its pixel data).]]
+ unload: void; [[Image data has been unloaded (by some mechanism in
+ EFL that threw out the original image data).]]
}
}
diff --git a/src/lib/efl/interfaces/efl_image_animated.eo b/src/lib/efl/interfaces/efl_gfx_image_animation_controller.eo
index 6d2bc37996..54560e6d7e 100644
--- a/src/lib/efl/interfaces/efl_image_animated.eo
+++ b/src/lib/efl/interfaces/efl_gfx_image_animation_controller.eo
@@ -1,19 +1,19 @@
/* FIXME: invalid type from evas/emile! */
/* type @extern Evas.Animated_Loop_Hint: int; */
-enum Efl.Image.Animated.Loop_Hint {
+enum Efl.Gfx.Image_Animation_Controller_Loop_Hint {
[[Image animation loop modes]]
none = 0, [[No looping order specified.]]
loop = 1, [[Standard loop: 1->2->3->1->2->3->1]]
pingpong = 2 [[Ping-pong bouncing loop: 1->2->3->2->1->2->3->1]]
}
-/* FIXME: rename to Efl.Image.Animated when eo/eolian are fixed */
+/* FIXME: rename to Efl.Gfx.Image_Animation_Controller when eo/eolian are fixed */
-interface Efl.Image.Animated ()
+interface Efl.Gfx.Image_Animation_Controller ()
{
[[Efl animated image interface]]
- eo_prefix: efl_image;
+ eo_prefix: efl_gfx_image;
methods {
@property animated {
@@ -65,18 +65,18 @@ interface Efl.Image.Animated ()
This returns the kind of looping the image object wants to do.
- If it returns @Efl.Image.Animated.Loop_Hint.loop, you should
+ If it returns @Efl.Gfx.Image_Animation_Controller_Loop_Hint.loop, you should
display frames in a sequence like: 1->2->3->1->2->3->1...
- If it returns @Efl.Image.Animated.Loop_Hint.pingpong, it is
+ If it returns @Efl.Gfx.Image_Animation_Controller_Loop_Hint.pingpong, it is
better to display frames in a sequence like:
1->2->3->2->1->2->3->1...
- The default type is @Efl.Image.Animated.Loop_Hint.loop.
+ The default type is @Efl.Gfx.Image_Animation_Controller_Loop_Hint.loop.
@since 1.1
]]
- return: Efl.Image.Animated.Loop_Hint; [[Loop type of the image object.]]
+ return: Efl.Gfx.Image_Animation_Controller_Loop_Hint; [[Loop type of the image object.]]
}
}
@property animated_loop_count {
diff --git a/src/lib/efl/interfaces/efl_image_load.eo b/src/lib/efl/interfaces/efl_gfx_image_load_controller.eo
index 1f2f8d247d..89a065b442 100644
--- a/src/lib/efl/interfaces/efl_image_load.eo
+++ b/src/lib/efl/interfaces/efl_gfx_image_load_controller.eo
@@ -1,18 +1,19 @@
+import eina_types;
import efl_gfx_types;
/*
-enum Efl.Image.Load.State
+enum Efl.Gfx.Image_Load_Controller_State
{
none = 0, [[Not loading any image.]]
loaded = 1, [[Image data is loaded, nothing is pending.]]
pending = 2, [[The image has been queued for load, but actual loading may not have started yet.]]
loading = 3, [[The image is currently loading.]]
- error = 4, [[Image load has failed. Call @Efl.Image.Load.load_error.get to know why.]]
+ error = 4, [[Image load has failed. Call @Efl.Gfx.Image_Load_Controller.load_error.get to know why.]]
cancelled = 5 [[Image load has been cancelled.]]
}
*/
-interface Efl.Image.Load ()
+interface Efl.Gfx.Image_Load_Controller ()
{
[[Common APIs for all loadable 2D images.]]
@@ -27,10 +28,8 @@ interface Efl.Image.Load ()
load_async_cancel {
[[Cancel preloading an image object's image data in the background.
- The event $load,cancelled should be triggered soon after
- cancellation occurs and the object should be left in a state
- where it has no image data. If cancel is called too late, the image
- will be kept in memory.
+ The object should be left in a state where it has no image data.
+ If cancel is called too late, the image will be kept in memory.
]]
}
/*
@@ -43,7 +42,7 @@ interface Efl.Image.Load ()
]]
}
values {
- state: Efl.Image.Load.State; [[Image loading status]]
+ state: Efl.Gfx.Image_Load_Controller_State; [[Image loading status]]
}
}
*/
@@ -180,8 +179,7 @@ interface Efl.Image.Load ()
}
}
events {
- load,done; [[Called when he image was loaded]]
- load,error: Efl.Image.Load.Error; [[Called when an error happened during image loading]]
- load,cancelled; [[Called when the image loading was cancelled]]
+ load,done: void; [[Called when he image was loaded]]
+ load,error: Efl.Gfx.Image_Load_Error; [[Called when an error happened during image loading]]
}
}
diff --git a/src/lib/efl/interfaces/efl_gfx_path.c b/src/lib/efl/interfaces/efl_gfx_path.c
index 2901373ddc..036c35e6a6 100644
--- a/src/lib/efl/interfaces/efl_gfx_path.c
+++ b/src/lib/efl/interfaces/efl_gfx_path.c
@@ -5,6 +5,7 @@
#include <math.h>
#include <float.h>
#include <ctype.h>
+#include <locale.h>
#include <Efl.h>
@@ -21,6 +22,7 @@ struct _Efl_Gfx_Path_Data
unsigned int commands_count;
unsigned int points_count;
+ char *path_data;
Eina_Bool convex;
};
@@ -191,7 +193,7 @@ _efl_gfx_path_path_set(Eo *obj, Efl_Gfx_Path_Data *pd,
}
EOLIAN static void
-_efl_gfx_path_path_get(Eo *obj EINA_UNUSED, Efl_Gfx_Path_Data *pd,
+_efl_gfx_path_path_get(const Eo *obj EINA_UNUSED, Efl_Gfx_Path_Data *pd,
const Efl_Gfx_Path_Command **commands,
const double **points)
{
@@ -200,7 +202,7 @@ _efl_gfx_path_path_get(Eo *obj EINA_UNUSED, Efl_Gfx_Path_Data *pd,
}
EOLIAN static void
-_efl_gfx_path_length_get(Eo *obj EINA_UNUSED, Efl_Gfx_Path_Data *pd,
+_efl_gfx_path_length_get(const Eo *obj EINA_UNUSED, Efl_Gfx_Path_Data *pd,
unsigned int *commands, unsigned int *points)
{
if (commands) *commands = pd->commands_count;
@@ -208,7 +210,7 @@ _efl_gfx_path_length_get(Eo *obj EINA_UNUSED, Efl_Gfx_Path_Data *pd,
}
EOLIAN static void
-_efl_gfx_path_bounds_get(Eo *obj EINA_UNUSED, Efl_Gfx_Path_Data *pd, Eina_Rect *r)
+_efl_gfx_path_bounds_get(const Eo *obj EINA_UNUSED, Efl_Gfx_Path_Data *pd, Eina_Rect *r)
{
double minx, miny, maxx, maxy;
unsigned int i;
@@ -234,7 +236,7 @@ _efl_gfx_path_bounds_get(Eo *obj EINA_UNUSED, Efl_Gfx_Path_Data *pd, Eina_Rect *
}
EOLIAN static void
-_efl_gfx_path_current_get(Eo *obj EINA_UNUSED, Efl_Gfx_Path_Data *pd,
+_efl_gfx_path_current_get(const Eo *obj EINA_UNUSED, Efl_Gfx_Path_Data *pd,
double *x, double *y)
{
if (x) *x = pd->current.x;
@@ -242,7 +244,7 @@ _efl_gfx_path_current_get(Eo *obj EINA_UNUSED, Efl_Gfx_Path_Data *pd,
}
EOLIAN static void
-_efl_gfx_path_current_ctrl_get(Eo *obj EINA_UNUSED, Efl_Gfx_Path_Data *pd,
+_efl_gfx_path_current_ctrl_get(const Eo *obj EINA_UNUSED, Efl_Gfx_Path_Data *pd,
double *x, double *y)
{
if (x) *x = pd->current_ctrl.x;
@@ -273,73 +275,91 @@ interpolate(double from, double to, double pos_map)
return (from * (1.0 - pos_map)) + (to * pos_map);
}
+static void _path_interpolation(Eo *obj, Efl_Gfx_Path_Data *pd, char *from, char *to, double pos);
+static void _efl_gfx_path_reset(Eo *obj, Efl_Gfx_Path_Data *pd);
+
EOLIAN static Eina_Bool
_efl_gfx_path_interpolate(Eo *obj, Efl_Gfx_Path_Data *pd,
- const Eo *from, const Eo *to, double pos_map)
+ const Eo *from, const Eo *to, double pos_map)
{
Efl_Gfx_Path_Change_Event ev = { EFL_GFX_CHANGE_FLAG_PATH };
Efl_Gfx_Path_Data *from_pd, *to_pd;
Efl_Gfx_Path_Command *cmds;
+ double interv; //interpolated value
double *pts;
- unsigned int i, j;
-
- from_pd = efl_data_scope_get(from, EFL_GFX_PATH_MIXIN);
- to_pd = efl_data_scope_get(to, EFL_GFX_PATH_MIXIN);
if (!efl_isa(from, EFL_GFX_PATH_MIXIN) || !efl_isa(to, EFL_GFX_PATH_MIXIN))
return EINA_FALSE;
- if (pd == from_pd || pd == to_pd) return EINA_FALSE;
-
- if (!_efl_gfx_path_equal_commands_internal(from_pd, to_pd))
- return EINA_FALSE;
+ from_pd = efl_data_scope_get(from, EFL_GFX_PATH_MIXIN);
+ to_pd = efl_data_scope_get(to, EFL_GFX_PATH_MIXIN);
- cmds = realloc(pd->commands,
- sizeof (Efl_Gfx_Path_Command) * from_pd->commands_count);
- if (!cmds && from_pd->commands_count) return EINA_FALSE;
+ //just in case
+ if (pd == from_pd || pd == to_pd) return EINA_FALSE;
- pts = realloc(pd->points, sizeof (double) * from_pd->points_count);
- if (!pts && from_pd->points_count)
+ if (from_pd->path_data && to_pd->path_data)
{
- free(cmds);
- return EINA_FALSE;
+ _efl_gfx_path_reset(obj, pd);
+ _path_interpolation(obj, pd,
+ from_pd->path_data, to_pd->path_data, pos_map);
}
+ else
+ {
+ if (!_efl_gfx_path_equal_commands_internal(from_pd, to_pd))
+ return EINA_FALSE;
- pd->commands = cmds;
- pd->points = pts;
+ cmds = realloc(pd->commands,
+ sizeof(Efl_Gfx_Path_Command) * from_pd->commands_count);
+ if (!cmds && (from_pd->commands_count > 0)) return EINA_FALSE;
- if (cmds)
- {
- memcpy(cmds, from_pd->commands,
- sizeof (Efl_Gfx_Path_Command) * from_pd->commands_count);
+ pd->commands = cmds;
+
+ pts = realloc(pd->points,
+ sizeof(double) * from_pd->points_count);
+ if (!pts && (from_pd->points_count > 0)) return EINA_FALSE;
+
+ pd->points = pts;
- if (pts)
+ if (cmds)
{
- double *to_pts = to_pd->points;
- double *from_pts = from_pd->points;
+ memcpy(cmds, from_pd->commands,
+ sizeof (Efl_Gfx_Path_Command) * from_pd->commands_count);
- for (i = 0; cmds[i] != EFL_GFX_PATH_COMMAND_TYPE_END; i++)
+ if (pts)
{
- for (j = 0; j < _efl_gfx_path_command_length(cmds[i]); j++)
- {
- *pts = interpolate(*from_pts, *to_pts, pos_map);
- pts++;
- from_pts++;
- to_pts++;
- }
+ double *to_pts = to_pd->points;
+ double *from_pts = from_pd->points;
+ unsigned int i, j;
+
+ for (i = 0; cmds[i] != EFL_GFX_PATH_COMMAND_TYPE_END; i++)
+ for (j = 0; j < _efl_gfx_path_command_length(cmds[i]); j++)
+ {
+ *pts = interpolate(*from_pts, *to_pts, pos_map);
+ pts++;
+ from_pts++;
+ to_pts++;
+ }
}
}
- }
- pd->points_count = from_pd->points_count;
- pd->commands_count = from_pd->commands_count;
+ pd->points_count = from_pd->points_count;
+ pd->commands_count = from_pd->commands_count;
+
+ interv = interpolate(from_pd->current.x, to_pd->current.x, pos_map);
+ pd->current.x = interv;
+
+ interv = interpolate(from_pd->current.y, to_pd->current.y, pos_map);
+ pd->current.y = interv;
+
+ interv = interpolate(from_pd->current_ctrl.x, to_pd->current_ctrl.x,
+ pos_map);
+ pd->current_ctrl.x = interv;
- pd->current.x = interpolate(from_pd->current.x, to_pd->current.x, pos_map);
- pd->current.y = interpolate(from_pd->current.y, to_pd->current.y, pos_map);
- pd->current_ctrl.x = interpolate(from_pd->current_ctrl.x,
- to_pd->current_ctrl.x, pos_map);
- pd->current_ctrl.y = interpolate(from_pd->current_ctrl.y,
- to_pd->current_ctrl.y, pos_map);
+ interv = interpolate(from_pd->current_ctrl.y, to_pd->current_ctrl.y,
+ pos_map);
+ pd->current_ctrl.y = interv;
+
+ }
efl_event_callback_legacy_call(obj, EFL_GFX_PATH_EVENT_CHANGED, &ev);
@@ -371,6 +391,8 @@ _efl_gfx_path_reset(Eo *obj, Efl_Gfx_Path_Data *pd)
free(pd->points);
pd->points = NULL;
pd->points_count = 0;
+ free(pd->path_data);
+ pd->path_data = NULL;
pd->current.x = 0;
pd->current.y = 0;
@@ -1114,6 +1136,7 @@ _skipcomma(const char *content)
return (char*) content;
}
+#if 0
static inline Eina_Bool
_next_isnumber(const char *content)
{
@@ -1122,459 +1145,360 @@ _next_isnumber(const char *content)
(void) strtod(content, &tmp);
return content != tmp;
}
+#endif
static inline Eina_Bool
_parse_number(char **content, double *number)
{
char *end = NULL;
*number = strtod(*content, &end);
- // if the start of string is not number
+ // if the start of string is not number
if ((*content) == end) return EINA_FALSE;
//skip comma if any
*content = _skipcomma(end);
return EINA_TRUE;
}
-static Eina_Bool
-_efl_gfx_path_parse_pair(const char *content, char **end, double *x, double *y)
+static inline Eina_Bool
+_parse_long(char **content, int *number)
{
- char *str = (char *) content;
-
- if (_parse_number(&str, x))
- if (_parse_number(&str, y))
- {
- *end = str;
- return EINA_TRUE;
- }
- return EINA_FALSE;
+ char *end = NULL;
+ *number = strtol(*content, &end, 10) ? 1 : 0;
+ // if the start of string is not number
+ if ((*content) == end) return EINA_FALSE;
+ *content = _skipcomma(end);
+ return EINA_TRUE;
}
-static Eina_Bool
-_efl_gfx_path_parse_pair_to(const char *content, char **end,
- Eo *obj, Efl_Gfx_Path_Data *pd,
- double *current_x, double *current_y,
- void (*func)(Eo *obj, Efl_Gfx_Path_Data *pd,
- double x, double y),
- Eina_Bool rel)
+static int
+_number_count(char cmd)
{
- double x, y;
-
- *end = (char*) content;
-
- do
+ int count = 0;
+ switch (cmd)
{
- if (!_efl_gfx_path_parse_pair(content, end, &x, &y))
- return EINA_FALSE;
-
- if (rel)
- {
- x += *current_x;
- y += *current_y;
- }
- func(obj, pd, x, y);
- content = *end;
-
- *current_x = x;
- *current_y = y;
- }
- while (_next_isnumber(content));
-
- return EINA_TRUE;
+ case 'M':
+ case 'm':
+ case 'L':
+ case 'l':
+ {
+ count = 2;
+ break;
+ }
+ case 'C':
+ case 'c':
+ case 'E':
+ case 'e':
+ {
+ count = 6;
+ break;
+ }
+ case 'H':
+ case 'h':
+ case 'V':
+ case 'v':
+ {
+ count = 1;
+ break;
+ }
+ case 'S':
+ case 's':
+ case 'Q':
+ case 'q':
+ case 'T':
+ case 't':
+ {
+ count = 4;
+ break;
+ }
+ case 'A':
+ case 'a':
+ {
+ count = 7;
+ break;
+ }
+ default:
+ break;
+ }
+ return count;
}
-static Eina_Bool
-_efl_gfx_path_parse_double_to(const char *content, char **end,
- Eo *obj, Efl_Gfx_Path_Data *pd,
- double *current, double current_x,
- double current_y,
- void (*func)(Eo *obj, Efl_Gfx_Path_Data *pd,
- double d, double current_x,
- double current_y),
- Eina_Bool rel)
+static void
+process_command(Eo *obj, Efl_Gfx_Path_Data *pd, char cmd, double *arr, int count, double *cur_x, double *cur_y)
{
- double d;
- Eina_Bool first = EINA_FALSE;
-
- *end = (char*) content;
- do
+ int i;
+ switch (cmd)
{
- d = strtod(content, end);
- if (content == *end) return first;
- first = EINA_TRUE;
-
- if (rel) d += *current;
-
- func(obj, pd, d, current_x, current_y);
- content = *end;
-
- *current = d;
- }
- while (1); // This is an optimisation as we have only one parameter.
-
- return EINA_TRUE;
+ case 'm':
+ case 'l':
+ case 'c':
+ case 's':
+ case 'q':
+ case 't':
+ {
+ for(i=0; i<count; i += 2)
+ {
+ arr[i] = arr[i] + *cur_x;
+ arr[i+1] = arr[i+1] + *cur_y;
+ }
+ break;
+ }
+ case 'h':
+ {
+ arr[0] = arr[0] + *cur_x;
+ break;
+ }
+ case 'v':
+ {
+ arr[0] = arr[0] + *cur_y;
+ break;
+ }
+ case 'a':
+ {
+ arr[5] = arr[5] + *cur_x;
+ arr[6] = arr[6] + *cur_y;
+ break;
+ }
+ default:
+ break;
+ }
+
+ switch (cmd)
+ {
+ case 'm':
+ case 'M':
+ {
+ _efl_gfx_path_append_move_to(obj, pd, arr[0], arr[1]);
+ *cur_x = arr[0];
+ *cur_y = arr[1];
+ break;
+ }
+ case 'l':
+ case 'L':
+ {
+ _efl_gfx_path_append_line_to(obj, pd, arr[0], arr[1]);
+ *cur_x = arr[0];
+ *cur_y = arr[1];
+ break;
+ }
+ case 'c':
+ case 'C':
+ {
+ _efl_gfx_path_append_cubic_to(obj, pd, arr[0], arr[1], arr[2], arr[3], arr[4], arr[5]);
+ *cur_x = arr[4];
+ *cur_y = arr[5];
+ break;
+ }
+ case 's':
+ case 'S':
+ {
+ _efl_gfx_path_append_scubic_to(obj, pd, arr[2], arr[3], arr[0], arr[1]);
+ *cur_x = arr[2];
+ *cur_y = arr[3];
+ break;
+ }
+ case 'q':
+ case 'Q':
+ {
+ _efl_gfx_path_append_quadratic_to(obj, pd, arr[2], arr[3], arr[0], arr[1]);
+ *cur_x = arr[2];
+ *cur_y = arr[3];
+ break;
+ }
+ case 't':
+ case 'T':
+ {
+ _efl_gfx_path_append_move_to(obj, pd, arr[0], arr[1]);
+ *cur_x = arr[0];
+ *cur_y = arr[1];
+ break;
+ }
+ case 'h':
+ case 'H':
+ {
+ _efl_gfx_path_append_horizontal_to(obj, pd, arr[0], *cur_x, *cur_y);
+ *cur_x = arr[0];
+ break;
+ }
+ case 'v':
+ case 'V':
+ {
+ _efl_gfx_path_append_vertical_to(obj, pd, arr[0], *cur_x, *cur_y);
+ *cur_y = arr[0];
+ break;
+ }
+ case 'z':
+ case 'Z':
+ {
+ _efl_gfx_path_append_close(obj, pd);
+ break;
+ }
+ case 'a':
+ case 'A':
+ {
+ _efl_gfx_path_append_arc_to(obj, pd, arr[5], arr[6], arr[0], arr[1], arr[2], arr[3], arr[4]);
+ *cur_x = arr[5];
+ *cur_y = arr[6];
+ break;
+ }
+ case 'E':
+ case 'e':
+ {
+ _efl_gfx_path_append_arc(obj, pd, arr[0], arr[1], arr[2], arr[3], arr[4], arr[5]);
+ break;
+ }
+ default:
+ break;
+ }
}
-static Eina_Bool
-_efl_gfx_path_parse_six(const char *content, char **end,
- double *x, double *y,
- double *ctrl_x0, double *ctrl_y0,
- double *ctrl_x1, double *ctrl_y1)
+static char *
+_next_command(char *path, char *cmd, double *arr, int *count)
{
- char *str = (char *) content;
+ int i=0, large, sweep;
- if (_parse_number(&str, ctrl_x0))
+ path = _skipcomma(path);
+ if (isalpha(*path))
{
- if (_parse_number(&str, ctrl_y0))
- {
- if (_parse_number(&str, ctrl_x1))
- {
- if (_parse_number(&str, ctrl_y1))
- {
- if (_parse_number(&str, x))
- {
- if (_parse_number(&str, y))
- {
- *end = str;
- return EINA_TRUE;
- }
- }
- }
- }
- }
+ *cmd = *path;
+ path++;
+ *count = _number_count(*cmd);
}
-
- return EINA_FALSE;
-}
-
-static Eina_Bool
-_efl_gfx_path_parse_six_to(const char *content, char **end,
- Eo *obj, Efl_Gfx_Path_Data *pd,
- double *current_x, double *current_y,
- void (*func)(Eo *obj, Efl_Gfx_Path_Data *pd,
- double ctrl_x0, double ctrl_y0,
- double ctrl_x1, double ctrl_y1,
- double x, double y),
- Eina_Bool rel)
-{
- double x, y, ctrl_x0, ctrl_y0, ctrl_x1, ctrl_y1;
-
- *end = (char*) content;
-
- do
+ if ( *count == 7)
{
- if (!_efl_gfx_path_parse_six(content, end, &x, &y, &ctrl_x0, &ctrl_y0,
- &ctrl_x1, &ctrl_y1))
- return EINA_FALSE;
-
- if (rel)
- {
- x += *current_x;
- y += *current_y;
- ctrl_x0 += *current_x;
- ctrl_y0 += *current_y;
- ctrl_x1 += *current_x;
- ctrl_y1 += *current_y;
- }
- func(obj, pd, ctrl_x0, ctrl_y0, ctrl_x1, ctrl_y1, x, y);
- content = *end;
-
- *current_x = x;
- *current_y = y;
+ // special case for arc command
+ if(_parse_number(&path, &arr[0]))
+ if(_parse_number(&path, &arr[1]))
+ if(_parse_number(&path, &arr[2]))
+ if(_parse_long(&path, &large))
+ if(_parse_long(&path, &sweep))
+ if(_parse_number(&path, &arr[5]))
+ if(_parse_number(&path, &arr[6]))
+ {
+ arr[3] = large;
+ arr[4] = sweep;
+ return path;
+ }
+ *count = 0;
+ return NULL;
}
- while (_next_isnumber(content));
-
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_efl_gfx_path_parse_quad(const char *content, char **end,
- double *x, double *y,
- double *ctrl_x0, double *ctrl_y0)
-{
- char *str = (char *) content;
-
- if (_parse_number(&str, ctrl_x0))
- if (_parse_number(&str, ctrl_y0))
- if (_parse_number(&str, x))
- if (_parse_number(&str, y))
- {
- *end = str;
- return EINA_TRUE;
- }
- return EINA_FALSE;
-}
-
-static Eina_Bool
-_efl_gfx_path_parse_quad_to(const char *content, char **end,
- Eo *obj, Efl_Gfx_Path_Data *pd,
- double *current_x, double *current_y,
- void (*func)(Eo *obj, Efl_Gfx_Path_Data *pd,
- double x, double y, double ctrl_x0, double ctrl_y0),
- Eina_Bool rel)
-{
- double x, y, ctrl_x0, ctrl_y0;
-
- *end = (char*) content;
-
- do
+ for (i = 0; i < *count; i++)
{
- Eina_Bool r;
-
- r = _efl_gfx_path_parse_quad(content, end, &x, &y, &ctrl_x0, &ctrl_y0);
- if (!r) return EINA_FALSE;
-
- if (rel)
+ if (!_parse_number(&path, &arr[i]))
{
- x += *current_x;
- y += *current_y;
- ctrl_x0 += *current_x;
- ctrl_y0 += *current_y;
+ *count = 0;
+ return NULL;
}
- func(obj, pd, x, y, ctrl_x0, ctrl_y0);
- content = *end;
-
- *current_x = x;
- *current_y = y;
+ path = _skipcomma(path);
}
- while (_next_isnumber(content));
-
- return EINA_TRUE;
+ return path;
}
-static Eina_Bool
-_efl_gfx_path_parse_arc(const char *content, char **end,
- double *x, double *y,
- double *rx, double *ry,
- double *radius,
- Eina_Bool *large_arc, Eina_Bool *sweep)
+static void
+_path_interpolation(Eo *obj, Efl_Gfx_Path_Data *pd,
+ char *from, char *to, double pos)
{
- char *str = (char *) content;
- char *end1 = NULL;
- char *end2 = NULL;
+ int i;
+ double from_arr[7], to_arr[7];
+ int from_count=0, to_count=0;
+ double cur_x=0, cur_y=0;
+ char from_cmd= 0, to_cmd = 0;
+ char *cur_locale;
+
+ if (!from || !to)
+ return;
+
+ cur_locale = setlocale(LC_NUMERIC, NULL);
+ if (cur_locale)
+ cur_locale = strdup(cur_locale);
+ setlocale(LC_NUMERIC, "POSIX");
- if (_parse_number(&str, rx))
+ while ((from[0] != '\0') && (to[0] != '\0'))
{
- if (_parse_number(&str, ry))
+ from = _next_command(from, &from_cmd, from_arr, &from_count);
+ to = _next_command(to, &to_cmd, to_arr, &to_count);
+ if (from_cmd == to_cmd)
{
- if (_parse_number(&str, radius))
+ if (from_count == 7)
{
- // large_arc
- *large_arc = strtol(str, &end1, 10) ? EINA_TRUE : EINA_FALSE;
- if (!end1 || (str == end1)) return EINA_FALSE;
- end1 = _skipcomma(end1);
-
- // sweep
- *sweep = strtol(end1, &end2, 10) ? EINA_TRUE : EINA_FALSE;
- if (!end2 || (end1 == end2)) return EINA_FALSE;
- str = _skipcomma(end2);
-
- if (_parse_number(&str, x))
- if (_parse_number(&str, y))
- {
- *end = str;
- return EINA_TRUE;
- }
+ //special case for arc command
+ i=0;
+ from_arr[i] = interpolate(from_arr[i], to_arr[i], pos);
+ i=1;
+ from_arr[i] = interpolate(from_arr[i], to_arr[i], pos);
+ i=2;
+ from_arr[i] = interpolate(from_arr[i], to_arr[i], pos);
+ i=5;
+ from_arr[i] = interpolate(from_arr[i], to_arr[i], pos);
+ i=6;
+ from_arr[i] = interpolate(from_arr[i], to_arr[i], pos);
}
+ else
+ {
+ for(i=0; i < from_count; i++)
+ {
+ from_arr[i] = interpolate(from_arr[i], to_arr[i], pos);
+ }
+ }
+ process_command(obj, pd, from_cmd, from_arr, from_count, &cur_x, &cur_y);
}
- }
- return EINA_FALSE;
-}
-
-static Eina_Bool
-_efl_gfx_path_parse_arc_to(const char *content, char **end,
- Eo *obj, Efl_Gfx_Path_Data *pd,
- double *current_x, double *current_y,
- void (*func)(Eo *obj, Efl_Gfx_Path_Data *pd,
- double x, double y, double rx, double ry,
- double angle, Eina_Bool large_arc, Eina_Bool sweep),
- Eina_Bool rel)
-{
- double x, y, rx, ry, angle;
- Eina_Bool large_arc, sweep; // FIXME: handle those flag
-
- *end = (char*) content;
-
- do
- {
- Eina_Bool r;
-
- r = _efl_gfx_path_parse_arc(content, end, &x, &y, &rx, &ry, &angle,
- &large_arc, &sweep);
- if (!r) return EINA_FALSE;
-
- if (rel)
+ else
{
- x += *current_x;
- y += *current_y;
+ goto error;
}
-
- func(obj, pd, x, y, rx, ry, angle, large_arc, sweep);
- content = *end;
-
- *current_x = x;
- *current_y = y;
}
- while (_next_isnumber(content));
- return EINA_TRUE;
+error:
+ setlocale(LC_NUMERIC, cur_locale);
+ if (cur_locale)
+ free(cur_locale);
}
EOLIAN static void
_efl_gfx_path_append_svg_path(Eo *obj, Efl_Gfx_Path_Data *pd,
- const char *svg_path_data)
+ const char *svg_path_data)
{
- double current_x = 0, current_y = 0;
-
- //FIXME: const char *svg_path_data ???
- char *content = (char*) svg_path_data;
+ double number_array[7];
+ int number_count = 0;
+ double cur_x=0, cur_y=0;
+ char cmd= 0;
+ char *path = (char *) svg_path_data;
+ Eina_Bool arc = EINA_FALSE;
+ char *cur_locale;
+
+ if (!path)
+ return;
- if (!content) return;
+ cur_locale = setlocale(LC_NUMERIC, NULL);
+ if (cur_locale)
+ cur_locale = strdup(cur_locale);
+ setlocale(LC_NUMERIC, "POSIX");
- while (content[0] != '\0')
+ while ((path[0] != '\0'))
{
- while (isspace(content[0])) content++;
-
- switch (content[0])
+ path = _next_command(path, &cmd, number_array, &number_count);
+ if (!path)
{
- case 'M':
- if (!_efl_gfx_path_parse_pair_to(&content[1], &content, obj, pd,
- &current_x, &current_y,
- _efl_gfx_path_append_move_to,
- EINA_FALSE))
- return;
- break;
- case 'm':
- if (!_efl_gfx_path_parse_pair_to(&content[1], &content, obj, pd,
- &current_x, &current_y,
- _efl_gfx_path_append_move_to,
- EINA_TRUE))
- return;
- break;
- case 'z':
- case 'Z':
- _efl_gfx_path_append_close(obj, pd);
- content++;
- break;
- case 'L':
- if (!_efl_gfx_path_parse_pair_to(&content[1], &content, obj, pd,
- &current_x, &current_y,
- _efl_gfx_path_append_line_to,
- EINA_FALSE))
- return;
- break;
- case 'l':
- if (!_efl_gfx_path_parse_pair_to(&content[1], &content, obj, pd,
- &current_x, &current_y,
- _efl_gfx_path_append_line_to,
- EINA_TRUE))
- return;
- break;
- case 'H':
- if (!_efl_gfx_path_parse_double_to(&content[1], &content, obj, pd,
- &current_x, current_x,
- current_y,
- _efl_gfx_path_append_horizontal_to,
- EINA_FALSE))
- return;
- break;
- case 'h':
- if (!_efl_gfx_path_parse_double_to(&content[1], &content, obj, pd,
- &current_x, current_x,
- current_y,
- _efl_gfx_path_append_horizontal_to,
- EINA_TRUE))
- return;
- break;
- case 'V':
- if (!_efl_gfx_path_parse_double_to(&content[1], &content, obj, pd,
- &current_y, current_x,
- current_y,
- _efl_gfx_path_append_vertical_to,
- EINA_FALSE))
- return;
- break;
- case 'v':
- if (!_efl_gfx_path_parse_double_to(&content[1], &content, obj, pd,
- &current_y, current_x,
- current_y,
- _efl_gfx_path_append_vertical_to,
- EINA_TRUE))
- return;
- break;
- case 'C':
- if (!_efl_gfx_path_parse_six_to(&content[1], &content, obj, pd,
- &current_x, &current_y,
- _efl_gfx_path_append_cubic_to,
- EINA_FALSE))
- return;
- break;
- case 'c':
- if (!_efl_gfx_path_parse_six_to(&content[1], &content, obj, pd,
- &current_x, &current_y,
- _efl_gfx_path_append_cubic_to,
- EINA_TRUE))
- return;
- break;
- case 'S':
- if (!_efl_gfx_path_parse_quad_to(&content[1], &content, obj, pd,
- &current_x, &current_y,
- _efl_gfx_path_append_scubic_to,
- EINA_FALSE))
- return;
- break;
- case 's':
- if (!_efl_gfx_path_parse_quad_to(&content[1], &content,
- obj, pd, &current_x, &current_y,
- _efl_gfx_path_append_scubic_to,
- EINA_TRUE))
- return;
- break;
- case 'Q':
- if (!_efl_gfx_path_parse_quad_to(&content[1], &content,
- obj, pd, &current_x, &current_y,
- _efl_gfx_path_append_quadratic_to,
- EINA_FALSE))
- return;
- break;
- case 'q':
- if (!_efl_gfx_path_parse_quad_to(&content[1], &content,
- obj, pd, &current_x, &current_y,
- _efl_gfx_path_append_quadratic_to,
- EINA_TRUE))
- return;
- break;
- case 'T':
- if (!_efl_gfx_path_parse_pair_to(&content[1], &content,
- obj, pd, &current_x, &current_y,
- _efl_gfx_path_append_squadratic_to,
- EINA_FALSE))
- return;
- break;
- case 't':
- if (!_efl_gfx_path_parse_pair_to(&content[1], &content,
- obj, pd, &current_x, &current_y,
- _efl_gfx_path_append_squadratic_to,
- EINA_TRUE))
- return;
- break;
- case 'A':
- if (!_efl_gfx_path_parse_arc_to(&content[1], &content,
- obj, pd, &current_x, &current_y,
- _efl_gfx_path_append_arc_to,
- EINA_FALSE))
- return;
- break;
- case 'a':
- if (!_efl_gfx_path_parse_arc_to(&content[1], &content,
- obj, pd, &current_x, &current_y,
- _efl_gfx_path_append_arc_to,
- EINA_TRUE))
- return;
- break;
- default:
- return;
+ //printf("Error parsing command\n");
+ goto error;
}
+ process_command(obj, pd, cmd, number_array, number_count, &cur_x, &cur_y);
+ if ((!arc) && ((cmd == 'a') || (cmd == 'A') ||
+ (cmd == 'e') || (cmd == 'E')))
+ arc = EINA_TRUE;
+ }
+ if (arc)
+ {
+ // need to keep the path for interpolation
+ if (pd->path_data)
+ free(pd->path_data);
+ pd->path_data = malloc(strlen(svg_path_data) + 1);
+ strcpy(pd->path_data, svg_path_data);
}
+
+error:
+ setlocale(LC_NUMERIC, cur_locale);
+ if (cur_locale)
+ free(cur_locale);
}
EOLIAN static void
diff --git a/src/lib/efl/interfaces/efl_gfx_path.eo b/src/lib/efl/interfaces/efl_gfx_path.eo
index b36bf090dd..730ec8ba91 100644
--- a/src/lib/efl/interfaces/efl_gfx_path.eo
+++ b/src/lib/efl/interfaces/efl_gfx_path.eo
@@ -18,7 +18,7 @@ mixin Efl.Gfx.Path
get {
}
values {
- op: ptr(const(Efl.Gfx.Path.Command_Type)); [[Command list]]
+ op: ptr(const(Efl.Gfx.Path_Command_Type)); [[Command list]]
points: ptr(const(double)); [[Point list]]
}
}
@@ -59,7 +59,7 @@ mixin Efl.Gfx.Path
@in dup_from: const(Efl.Object); [[Shape object from where data will be copied.]]
}
}
- bounds_get {
+ bounds_get @const {
[[Compute and return the bounding box of the currently set path
@since 1.18
@@ -284,6 +284,6 @@ mixin Efl.Gfx.Path
}
}
events {
- changed: Efl.Gfx.Path.Change_Event; [[Graphics path was changed.]]
+ changed: Efl.Gfx.Path_Change_Event; [[Graphics path was changed.]]
}
}
diff --git a/src/lib/efl/interfaces/efl_gfx_shape.c b/src/lib/efl/interfaces/efl_gfx_shape.c
index 3e88e8603f..a9327c354c 100644
--- a/src/lib/efl/interfaces/efl_gfx_shape.c
+++ b/src/lib/efl/interfaces/efl_gfx_shape.c
@@ -42,7 +42,6 @@ struct _Efl_Gfx_Property
unsigned int dash_length;
int r, g, b, a;
- int fr, fg, fb, fa;
};
static inline void
@@ -51,8 +50,6 @@ _efl_gfx_property_get(const Eo *obj, Efl_Gfx_Property *property)
property->scale = efl_gfx_shape_stroke_scale_get(obj);
efl_gfx_shape_stroke_color_get(obj, &property->r, &property->g,
&property->b, &property->a);
- efl_gfx_color_get(obj, &property->fr, &property->fg,
- &property->fb, &property->fa);
property->w = efl_gfx_shape_stroke_width_get(obj);
property->centered = efl_gfx_shape_stroke_location_get(obj);
efl_gfx_shape_stroke_dash_get(obj, &property->dash, &property->dash_length);
@@ -62,23 +59,29 @@ _efl_gfx_property_get(const Eo *obj, Efl_Gfx_Property *property)
EOLIAN static Eina_Bool
_efl_gfx_shape_efl_gfx_path_interpolate(Eo *obj, Efl_Gfx_Shape_Data *pd,
- const Eo *from, const Eo *to, double pos_map)
+ const Eo *from, const Eo *to,
+ double pos_map)
{
Efl_Gfx_Shape_Data *from_pd, *to_pd;
Efl_Gfx_Property property_from, property_to;
Efl_Gfx_Dash *dash = NULL;
+ double interv; //interpolated value
unsigned int i;
- from_pd = efl_data_scope_get(from, EFL_GFX_SHAPE_MIXIN);
- to_pd = efl_data_scope_get(to, EFL_GFX_SHAPE_MIXIN);
if (!efl_isa(from, EFL_GFX_SHAPE_MIXIN) || !efl_isa(to, EFL_GFX_SHAPE_MIXIN))
return EINA_FALSE;
+
+ from_pd = efl_data_scope_get(from, EFL_GFX_SHAPE_MIXIN);
+ to_pd = efl_data_scope_get(to, EFL_GFX_SHAPE_MIXIN);
+
if ((pd == from_pd) || (pd == to_pd)) return EINA_FALSE;
_efl_gfx_property_get(from, &property_from);
_efl_gfx_property_get(to, &property_to);
- if (property_from.dash_length != property_to.dash_length) return EINA_FALSE;
+ //Can be interpolated!
+ if (property_from.dash_length != property_to.dash_length)
+ return EINA_FALSE;
if (property_to.dash_length)
{
@@ -94,35 +97,32 @@ _efl_gfx_shape_efl_gfx_path_interpolate(Eo *obj, Efl_Gfx_Shape_Data *pd,
}
}
- efl_gfx_shape_stroke_scale_set(obj, interpolate(property_from.scale,
- property_to.scale, pos_map));
+ interv = interpolate(property_from.scale, property_to.scale, pos_map);
+ efl_gfx_shape_stroke_scale_set(obj, interv);
+
efl_gfx_shape_stroke_color_set(obj,
- interpolatei(property_from.r,
- property_to.r, pos_map),
- interpolatei(property_from.g,
- property_to.g, pos_map),
- interpolatei(property_from.b,
- property_to.b, pos_map),
- interpolatei(property_from.a,
- property_to.a, pos_map));
- efl_gfx_color_set(obj,
- interpolatei(property_from.fr, property_to.fr, pos_map),
- interpolatei(property_from.fg, property_to.fg, pos_map),
- interpolatei(property_from.fb, property_to.fb, pos_map),
- interpolatei(property_from.fa, property_to.fa, pos_map));
-
- efl_gfx_shape_stroke_width_set(obj, interpolate(property_from.w,
- property_to.w, pos_map));
- efl_gfx_shape_stroke_location_set(obj, interpolate(property_from.centered,
- property_to.centered,
- pos_map));
+ interpolatei(property_from.r, property_to.r,
+ pos_map),
+ interpolatei(property_from.g, property_to.g,
+ pos_map),
+ interpolatei(property_from.b, property_to.b,
+ pos_map),
+ interpolatei(property_from.a, property_to.a,
+ pos_map));
+ interv = interpolate(property_from.w, property_to.w, pos_map);
+ efl_gfx_shape_stroke_width_set(obj, interv);
+
+ interv = interpolate(property_from.centered, property_to.centered, pos_map);
+ efl_gfx_shape_stroke_location_set(obj, interv);
+
efl_gfx_shape_stroke_dash_set(obj, dash, property_to.dash_length);
efl_gfx_shape_stroke_cap_set(obj, (pos_map < 0.5) ?
property_from.c : property_to.c);
efl_gfx_shape_stroke_join_set(obj, (pos_map < 0.5) ?
property_from.j : property_to.j);
- return efl_gfx_path_interpolate(efl_super(obj, MY_CLASS), from, to, pos_map);
+ return efl_gfx_path_interpolate(efl_cast(obj, EFL_GFX_PATH_MIXIN),
+ from, to, pos_map);
}
EOLIAN static void
@@ -133,7 +133,7 @@ _efl_gfx_shape_stroke_scale_set(Eo *obj EINA_UNUSED, Efl_Gfx_Shape_Data *pd,
}
EOLIAN static double
-_efl_gfx_shape_stroke_scale_get(Eo *obj EINA_UNUSED, Efl_Gfx_Shape_Data *pd)
+_efl_gfx_shape_stroke_scale_get(const Eo *obj EINA_UNUSED, Efl_Gfx_Shape_Data *pd)
{
return pd->public.stroke.scale;
}
@@ -149,7 +149,7 @@ _efl_gfx_shape_stroke_color_set(Eo *obj EINA_UNUSED, Efl_Gfx_Shape_Data *pd,
}
EOLIAN static void
-_efl_gfx_shape_stroke_color_get(Eo *obj EINA_UNUSED, Efl_Gfx_Shape_Data *pd,
+_efl_gfx_shape_stroke_color_get(const Eo *obj EINA_UNUSED, Efl_Gfx_Shape_Data *pd,
int *r, int *g, int *b, int *a)
{
if (r) *r = pd->public.stroke.color.r;
@@ -168,7 +168,7 @@ _efl_gfx_shape_stroke_width_set(Eo *obj, Efl_Gfx_Shape_Data *pd, double w)
}
EOLIAN static double
-_efl_gfx_shape_stroke_width_get(Eo *obj EINA_UNUSED,
+_efl_gfx_shape_stroke_width_get(const Eo *obj EINA_UNUSED,
Efl_Gfx_Shape_Data *pd)
{
return pd->public.stroke.width;
@@ -182,7 +182,7 @@ _efl_gfx_shape_stroke_location_set(Eo *obj EINA_UNUSED, Efl_Gfx_Shape_Data *pd,
}
EOLIAN static double
-_efl_gfx_shape_stroke_location_get(Eo *obj EINA_UNUSED, Efl_Gfx_Shape_Data *pd)
+_efl_gfx_shape_stroke_location_get(const Eo *obj EINA_UNUSED, Efl_Gfx_Shape_Data *pd)
{
return pd->public.stroke.centered;
}
@@ -210,7 +210,7 @@ _efl_gfx_shape_stroke_dash_set(Eo *obj EINA_UNUSED, Efl_Gfx_Shape_Data *pd,
}
EOLIAN static void
-_efl_gfx_shape_stroke_dash_get(Eo *obj EINA_UNUSED,
+_efl_gfx_shape_stroke_dash_get(const Eo *obj EINA_UNUSED,
Efl_Gfx_Shape_Data *pd,
const Efl_Gfx_Dash **dash, unsigned int *length)
{
@@ -227,7 +227,7 @@ _efl_gfx_shape_stroke_cap_set(Eo *obj EINA_UNUSED,
}
EOLIAN static Efl_Gfx_Cap
-_efl_gfx_shape_stroke_cap_get(Eo *obj EINA_UNUSED,
+_efl_gfx_shape_stroke_cap_get(const Eo *obj EINA_UNUSED,
Efl_Gfx_Shape_Data *pd)
{
return pd->public.stroke.cap;
@@ -242,7 +242,7 @@ _efl_gfx_shape_stroke_join_set(Eo *obj EINA_UNUSED,
}
EOLIAN static Efl_Gfx_Join
-_efl_gfx_shape_stroke_join_get(Eo *obj EINA_UNUSED,
+_efl_gfx_shape_stroke_join_get(const Eo *obj EINA_UNUSED,
Efl_Gfx_Shape_Data *pd)
{
return pd->public.stroke.join;
@@ -257,7 +257,7 @@ _efl_gfx_shape_fill_rule_set(Eo *obj EINA_UNUSED,
}
EOLIAN static Efl_Gfx_Fill_Rule
-_efl_gfx_shape_fill_rule_get(Eo *obj EINA_UNUSED,
+_efl_gfx_shape_fill_rule_get(const Eo *obj EINA_UNUSED,
Efl_Gfx_Shape_Data *pd)
{
return pd->fill_rule;
diff --git a/src/lib/efl/interfaces/efl_gfx_shape.eo b/src/lib/efl/interfaces/efl_gfx_shape.eo
index bd3c769422..6ad491763c 100644
--- a/src/lib/efl/interfaces/efl_gfx_shape.eo
+++ b/src/lib/efl/interfaces/efl_gfx_shape.eo
@@ -113,7 +113,7 @@ mixin Efl.Gfx.Shape (Efl.Gfx.Path)
get {
}
values {
- fill_rule: Efl.Gfx.Fill.Rule; [[The current fill rule of the shape object.
+ fill_rule: Efl.Gfx.Fill_Rule; [[The current fill rule of the shape object.
One of $EFL_GFX_FILL_RULE_WINDING, $EFL_GFX_FILL_RULE_ODD_EVEN]]
}
}
diff --git a/src/lib/efl/interfaces/efl_gfx_size_hint.eo b/src/lib/efl/interfaces/efl_gfx_size_hint.eo
index 7b344d8693..3186d7b9ed 100644
--- a/src/lib/efl/interfaces/efl_gfx_size_hint.eo
+++ b/src/lib/efl/interfaces/efl_gfx_size_hint.eo
@@ -1,14 +1,15 @@
+import eina_types;
import efl_gfx_types;
-const Efl.Gfx.Size.Hint.Expand: double = 1.0;
- [[Use with @Efl.Gfx.Size.Hint.hint_weight.]]
-const Efl.Gfx.Size.Hint.Fill: double = -1.0;
- [[Special value for @Efl.Gfx.Size.Hint.hint_align.]]
+const Efl.Gfx.Size_Hint_Expand: double = 1.0;
+ [[Use with @Efl.Gfx.Size_Hint.hint_weight.]]
+const Efl.Gfx.Size_Hint_Fill: double = -1.0;
+ [[Special value for @Efl.Gfx.Size_Hint.hint_align.]]
-interface Efl.Gfx.Size.Hint
+interface Efl.Gfx.Size_Hint
{
[[Efl graphics size hint interface]]
- event_prefix: efl_gfx;
+ event_prefix: efl_gfx_entity;
methods {
@property hint_base {
[[Base size for objects with sizing restrictions.
@@ -58,7 +59,7 @@ interface Efl.Gfx.Size.Hint
@image html aspect-control-horizontal.png
*/
values {
- mode: Efl.Gfx.Size.Hint.Aspect; [[Mode of interpretation.]]
+ mode: Efl.Gfx.Size_Hint_Aspect; [[Mode of interpretation.]]
sz: Eina.Size2D; [[Base size to use for aspecting.]]
/* FIXME: do we want min/max like Edje instead??
@@ -177,7 +178,7 @@ interface Efl.Gfx.Size.Hint
This is a hint on how a container object should resize a given
child within its area. Containers may adhere to the simpler
logic of just expanding the child object's dimensions to fit
- its own (see the @Efl.Gfx.Size.Hint.Expand helper weight macro) or
+ its own (see the @Efl.Gfx.Size_Hint_Expand helper weight macro) or
the complete one of taking each child's weight hint as real
weights to how much of its size to allocate for them in each
axis. A container is supposed to, after normalizing the
@@ -202,7 +203,7 @@ interface Efl.Gfx.Size.Hint
These are hints on how to align an object inside the
boundaries of a container/manager. Accepted values are in
- the 0.0 to 1.0 range, with the special value @Efl.Gfx.Size.Hint.Fill
+ the 0.0 to 1.0 range, with the special value @Efl.Gfx.Size_Hint_Fill
used to specify "justify" or "fill" by some users. In this
case, maximum size hints should be enforced with higher
priority, if they are set. Also, any padding hint set on
@@ -227,13 +228,13 @@ interface Efl.Gfx.Size.Hint
*/
values {
x: double; [[Double, ranging from 0.0 to 1.0 or with the special value
- @Efl.Gfx.Size.Hint.Fill, to use as horizontal alignment hint.]]
+ @Efl.Gfx.Size_Hint_Fill, to use as horizontal alignment hint.]]
y: double; [[Double, ranging from 0.0 to 1.0 or with the special value
- @Efl.Gfx.Size.Hint.Fill, to use as vertical alignment hint.]]
+ @Efl.Gfx.Size_Hint_Fill, to use as vertical alignment hint.]]
}
}
}
events {
- change,size,hints; [[Object size hints changed.]]
+ change,size,hints: void; [[Object size hints changed.]]
}
}
diff --git a/src/lib/efl/interfaces/efl_gfx_stack.eo b/src/lib/efl/interfaces/efl_gfx_stack.eo
index 744ed78a59..c122b48260 100644
--- a/src/lib/efl/interfaces/efl_gfx_stack.eo
+++ b/src/lib/efl/interfaces/efl_gfx_stack.eo
@@ -1,10 +1,10 @@
-const Efl.Gfx.Stack.Layer.Min: short = -32768; [[bottom-most layer number]]
-const Efl.Gfx.Stack.Layer.Max: short = 32767; [[top-most layer number]]
+const Efl.Gfx.Stack_Layer_Min: short = -32768; [[bottom-most layer number]]
+const Efl.Gfx.Stack_Layer_Max: short = 32767; [[top-most layer number]]
interface Efl.Gfx.Stack
{
[[Efl graphics stack interface]]
- event_prefix: efl_gfx;
+ event_prefix: efl_gfx_entity;
methods {
@property layer {
set {
@@ -129,6 +129,6 @@ interface Efl.Gfx.Stack
}
}
events {
- restack; [[Object stacking was changed.]]
+ restack: void; [[Object stacking was changed.]]
}
}
diff --git a/src/lib/efl/interfaces/efl_gfx_types.eot b/src/lib/efl/interfaces/efl_gfx_types.eot
index 1b3598a3cf..8f8292c992 100644
--- a/src/lib/efl/interfaces/efl_gfx_types.eot
+++ b/src/lib/efl/interfaces/efl_gfx_types.eot
@@ -1,3 +1,5 @@
+import eina_types;
+
enum Efl.Gfx.Colorspace {
[[Graphics colorspace type]]
argb8888, [[ARGB 32 bits per pixel, high-byte is Alpha, accessed one 32bit word at a time.]]
@@ -28,7 +30,7 @@ enum Efl.Gfx.Render_Op {
last [[Sentinel value to indicate last enum field during iteration]]
}
-enum Efl.Gfx.Path.Command_Type {
+enum Efl.Gfx.Path_Command_Type {
[[These values determine how the points are interpreted in a stream of points.
@since 1.14
]]
@@ -64,7 +66,7 @@ enum Efl.Gfx.Join
last [[Sentinel value to indicate last enum field during iteration]]
}
-enum Efl.Gfx.Gradient.Spread
+enum Efl.Gfx.Gradient_Spread
{
[[Specifies how the area outside the gradient area should be filled.
$ref efl_gfx_gradient_spread_set()
@@ -76,7 +78,7 @@ enum Efl.Gfx.Gradient.Spread
last [[Sentinel value to indicate last enum field during iteration]]
}
-enum Efl.Gfx.Fill.Rule
+enum Efl.Gfx.Fill_Rule
{
[[Type defining how an image content get filled.
@since 1.14
@@ -94,7 +96,7 @@ struct Efl.Gfx.Dash {
gap: double; [[Distance between two dashes.]]
}
-struct Efl.Gfx.Gradient.Stop
+struct Efl.Gfx.Gradient_Stop
{
[[Type defining gradient stops.
Describes the location and color of a transition point in a gradient.
@@ -107,7 +109,7 @@ struct Efl.Gfx.Gradient.Stop
a: int; [[The component A color of the gradient stop]]
}
-struct Efl.Gfx.Stroke.Color
+struct Efl.Gfx.Stroke_Color
{
[[Internal structure for @Efl.Gfx.Stroke.]]
r: int; [[The component R color of the stroke]]
@@ -125,14 +127,14 @@ struct Efl.Gfx.Stroke
scale: double; [[Stroke scale]]
width: double; [[Stroke width]]
centered: double; [[Stroke centered]]
- color: Efl.Gfx.Stroke.Color; [[Stroke color]]
+ color: Efl.Gfx.Stroke_Color; [[Stroke color]]
dash: ptr(Efl.Gfx.Dash); [[Stroke dash]]
dash_length: uint; [[Stroke dash length]]
cap: Efl.Gfx.Cap; [[Stroke cap]]
join: Efl.Gfx.Join; [[Stroke join]]
}
-struct Efl.Gfx.Shape.Public
+struct Efl.Gfx.Shape_Public
{
[[Public shape]]
stroke: Efl.Gfx.Stroke; [[Internal representation as stroke]]
@@ -156,7 +158,7 @@ enum Efl.Gfx.Change_Flag
all = 0xffff [[all properties got changed]]
}
-struct Efl.Gfx.Path.Change_Event {
+struct Efl.Gfx.Path_Change_Event {
what: Efl.Gfx.Change_Flag; [[Indicates what changed.]]
}
@@ -167,11 +169,11 @@ struct Efl.Gfx.Event.Render_Post
updated in the canvas.]]
}
-enum Efl.Gfx.Size.Hint.Aspect
+enum Efl.Gfx.Size_Hint_Aspect
{
[[Aspect types/policies for scaling size hints.
- See also @Efl.Gfx.Size.Hint.hint_aspect.
+ See also @Efl.Gfx.Size_Hint.hint_aspect.
]]
none = 0, [[No preference on either direction of the container
@@ -186,7 +188,7 @@ enum Efl.Gfx.Size.Hint.Aspect
aspect.]]
}
-enum Efl.Image.Load.Error
+enum Efl.Gfx.Image_Load_Error
{
[[Image or Edje load error type]]
none = 0, [[No error on load]]
@@ -202,7 +204,7 @@ enum Efl.Image.Load.Error
recursive_reference = 10 [[(Edje only) The group/collection set to load from had recursive references on its components]]
}
-enum Efl.Gfx.Color_Class.Layer {
+enum Efl.Gfx.Color_Class_Layer {
[[Efl Gfx Color Class layer enum]]
normal = 0, [[Default color]]
outline, [[Outline color]]
diff --git a/src/lib/efl/interfaces/efl_input_device.c b/src/lib/efl/interfaces/efl_input_device.c
index 667a13fe2d..4924f1f9d0 100644
--- a/src/lib/efl/interfaces/efl_input_device.c
+++ b/src/lib/efl/interfaces/efl_input_device.c
@@ -80,7 +80,7 @@ _efl_input_device_efl_object_parent_set(Eo *obj, Efl_Input_Device_Data *pd EINA_
_seat_pointers_update(p, pd);
}
}
- else if(!efl_isa(parent, EFL_CANVAS_INTERFACE))
+ else if(!efl_isa(parent, EFL_CANVAS_SCENE_INTERFACE))
{
EINA_SAFETY_ERROR("The parent of a device must be a seat or the canvas");
return;
@@ -114,7 +114,7 @@ _efl_input_device_device_type_set(Eo *obj, Efl_Input_Device_Data *pd, Efl_Input_
}
EOLIAN static Efl_Input_Device_Type
-_efl_input_device_device_type_get(Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd)
+_efl_input_device_device_type_get(const Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd)
{
return pd->klass;
}
@@ -128,7 +128,7 @@ _efl_input_device_source_set(Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd, Efl
}
EOLIAN static Efl_Input_Device *
-_efl_input_device_source_get(Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd)
+_efl_input_device_source_get(const Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd)
{
return pd->source;
}
@@ -141,7 +141,7 @@ _efl_input_device_seat_id_set(Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd, un
}
EOLIAN static unsigned int
-_efl_input_device_seat_id_get(Eo *obj, Efl_Input_Device_Data *pd)
+_efl_input_device_seat_id_get(const Eo *obj, Efl_Input_Device_Data *pd)
{
if (pd->klass == EFL_INPUT_DEVICE_TYPE_SEAT)
return pd->id;
@@ -149,15 +149,19 @@ _efl_input_device_seat_id_get(Eo *obj, Efl_Input_Device_Data *pd)
}
EOLIAN static Efl_Input_Device *
-_efl_input_device_seat_get(Eo *obj, Efl_Input_Device_Data *pd)
+_efl_input_device_seat_get(const Eo *obj, Efl_Input_Device_Data *pd)
{
- for (; obj; obj = efl_parent_get(obj))
- {
- if (pd->klass == EFL_INPUT_DEVICE_TYPE_SEAT)
- return pd->eo;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
+
+ if (pd->klass == EFL_INPUT_DEVICE_TYPE_SEAT)
+ return pd->eo;
+ while ((obj = efl_parent_get(obj)))
+ {
if (!efl_isa(obj, MY_CLASS)) break;
pd = efl_data_scope_get(obj, MY_CLASS);
+ if (pd->klass == EFL_INPUT_DEVICE_TYPE_SEAT)
+ return pd->eo;
}
return NULL;
diff --git a/src/lib/efl/interfaces/efl_input_device.eo b/src/lib/efl/interfaces/efl_input_device.eo
index 22d50b3dec..e6c989871d 100644
--- a/src/lib/efl/interfaces/efl_input_device.eo
+++ b/src/lib/efl/interfaces/efl_input_device.eo
@@ -1,4 +1,4 @@
-enum Efl.Input.Device.Type
+enum Efl.Input.Device_Type
{
[[General type of input device.
@@ -27,13 +27,13 @@ class Efl.Input.Device (Efl.Object)
]]
methods {
@property device_type {
- [[Device type property]]
+ [[Device type property]]
values {
- klass: Efl.Input.Device.Type; [[Input device class]]
+ klass: Efl.Input.Device_Type; [[Input device class]]
}
}
@property source {
- [[Device source property]]
+ [[Device source property]]
values {
src: Efl.Input.Device; [[Input device]]
}
@@ -44,7 +44,7 @@ class Efl.Input.Device (Efl.Object)
This method will find the seat the device belongs to.
For this, it walk through device's parents looking for a device
- with @Efl.Input.Device.Type.seat. It may be
+ with @Efl.Input.Device_Type.seat. It may be
the device itself.
In case no seat is found, $null is returned.
diff --git a/src/lib/efl/interfaces/efl_interfaces_main.c b/src/lib/efl/interfaces/efl_interfaces_main.c
index af61237416..f5b8634d68 100644
--- a/src/lib/efl/interfaces/efl_interfaces_main.c
+++ b/src/lib/efl/interfaces/efl_interfaces_main.c
@@ -2,22 +2,25 @@
# include <config.h>
#endif
-#define EFL_CANVAS_BETA
+#define EFL_CANVAS_SCENE_BETA
#define EFL_UI_SCROLLBAR_PROTECTED
#define EFL_UI_SCROLLBAR_BETA
+#define EFL_PART_PROTECTED
+
+#include "eo_internal.h"
#include <Efl.h>
#include "interfaces/efl_config.eo.c"
#include "interfaces/efl_control.eo.c"
#include "interfaces/efl_duplicate.eo.c"
-#include "interfaces/efl_image.eo.c"
-#include "interfaces/efl_image_animated.eo.c"
-#include "interfaces/efl_image_load.eo.c"
+#include "interfaces/efl_gfx_image.eo.c"
+#include "interfaces/efl_gfx_image_animation_controller.eo.c"
+#include "interfaces/efl_gfx_image_load_controller.eo.c"
#include "interfaces/efl_part.eo.c"
+#include "interfaces/efl_playable.eo.c"
#include "interfaces/efl_player.eo.c"
#include "interfaces/efl_text.eo.c"
-#include "interfaces/efl_text_properties.eo.c"
#include "interfaces/efl_text_font.eo.c"
#include "interfaces/efl_text_style.eo.c"
#include "interfaces/efl_text_format.eo.c"
@@ -25,7 +28,7 @@
#include "interfaces/efl_text_annotate.eo.c"
#include "interfaces/efl_text_markup.eo.c"
-#include "interfaces/efl_gfx.eo.c"
+#include "interfaces/efl_gfx_entity.eo.c"
#include "interfaces/efl_gfx_buffer.eo.c"
#include "interfaces/efl_gfx_stack.eo.c"
#include "interfaces/efl_gfx_fill.eo.c"
@@ -43,11 +46,9 @@
#include "interfaces/efl_gfx_blur.eo.c"
#include "interfaces/efl_gfx_size_hint.eo.c"
-#include "interfaces/efl_canvas.eo.c"
+#include "interfaces/efl_canvas_scene.eo.c"
#include "interfaces/efl_canvas_pointer.eo.c"
-#include "interfaces/efl_vpath.eo.c"
-
#include "interfaces/efl_screen.eo.c"
/* Packing & containers */
@@ -61,18 +62,14 @@
#include "interfaces/efl_model.eo.c"
#include "interfaces/efl_animator.eo.c"
#include "interfaces/efl_orientation.eo.c"
-#include "interfaces/efl_flipable.eo.c"
#include "interfaces/efl_ui_base.eo.c"
#include "interfaces/efl_ui_direction.eo.c"
#include "interfaces/efl_ui_drag.eo.c"
#include "interfaces/efl_ui_range.eo.c"
-#include "interfaces/efl_ui_menu.eo.c"
#include "interfaces/efl_ui_autorepeat.eo.c"
-#include "interfaces/efl_ui_item.eo.c"
#include "interfaces/efl_ui_view.eo.c"
#include "interfaces/efl_ui_model_connect.eo.c"
#include "interfaces/efl_ui_factory.eo.c"
-#include "interfaces/efl_ui_model_factory_connect.eo.c"
#include "interfaces/efl_ui_draggable.eo.c"
#include "interfaces/efl_ui_clickable.eo.c"
@@ -80,8 +77,36 @@
#include "interfaces/efl_ui_scrollable_interactive.eo.c"
#include "interfaces/efl_ui_scrollbar.eo.c"
#include "interfaces/efl_ui_selectable.eo.c"
+#include "interfaces/efl_ui_multi_selectable.eo.c"
#include "interfaces/efl_ui_zoom.eo.c"
+static void
+_noref_death(void *data EINA_UNUSED, const Efl_Event *event)
+{
+ efl_event_callback_del(event->object, EFL_EVENT_NOREF, _noref_death, NULL);
+ efl_del(event->object);
+}
+
+EAPI Efl_Object *
+efl_part(const Eo *obj, const char *name)
+{
+ Efl_Object *r;
+
+ r = efl_part_get(obj, name);
+ if (!r) return NULL;
+
+ efl_event_callback_add(r, EFL_EVENT_NOREF, _noref_death, NULL);
+
+ //ensure that the parts that we have here are never leaked
+ //by checking theire references and ownership details
+ EINA_SAFETY_ON_NULL_RETURN_VAL(efl_parent_get(r), r);
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_ref_count(r) == 1, r);
+
+ ___efl_auto_unref_set(r, EINA_TRUE);
+
+ return efl_ref(r);
+}
+
EAPI void
__efl_internal_init(void)
{
diff --git a/src/lib/efl/interfaces/efl_io_buffer.c b/src/lib/efl/interfaces/efl_io_buffer.c
index 1cfeeddba3..c0c505e6b8 100644
--- a/src/lib/efl/interfaces/efl_io_buffer.c
+++ b/src/lib/efl/interfaces/efl_io_buffer.c
@@ -107,13 +107,13 @@ _efl_io_buffer_limit_set(Eo *o, Efl_Io_Buffer_Data *pd, size_t limit)
}
EOLIAN static size_t
-_efl_io_buffer_limit_get(Eo *o EINA_UNUSED, Efl_Io_Buffer_Data *pd)
+_efl_io_buffer_limit_get(const Eo *o EINA_UNUSED, Efl_Io_Buffer_Data *pd)
{
return pd->limit;
}
EOLIAN static Eina_Slice
-_efl_io_buffer_slice_get(Eo *o, Efl_Io_Buffer_Data *pd)
+_efl_io_buffer_slice_get(const Eo *o, Efl_Io_Buffer_Data *pd)
{
Eina_Slice slice = { };
@@ -221,7 +221,7 @@ _efl_io_buffer_efl_io_reader_read(Eo *o, Efl_Io_Buffer_Data *pd, Eina_Rw_Slice *
}
EOLIAN static Eina_Bool
-_efl_io_buffer_efl_io_reader_can_read_get(Eo *o EINA_UNUSED, Efl_Io_Buffer_Data *pd)
+_efl_io_buffer_efl_io_reader_can_read_get(const Eo *o EINA_UNUSED, Efl_Io_Buffer_Data *pd)
{
return pd->can_read;
}
@@ -236,7 +236,7 @@ _efl_io_buffer_efl_io_reader_can_read_set(Eo *o, Efl_Io_Buffer_Data *pd, Eina_Bo
}
EOLIAN static Eina_Bool
-_efl_io_buffer_efl_io_reader_eos_get(Eo *o, Efl_Io_Buffer_Data *pd EINA_UNUSED)
+_efl_io_buffer_efl_io_reader_eos_get(const Eo *o, Efl_Io_Buffer_Data *pd EINA_UNUSED)
{
return efl_io_closer_closed_get(o) ||
efl_io_buffer_position_read_get(o) >= efl_io_sizer_size_get(o);
@@ -311,7 +311,7 @@ _efl_io_buffer_efl_io_writer_write(Eo *o, Efl_Io_Buffer_Data *pd, Eina_Slice *sl
}
EOLIAN static Eina_Bool
-_efl_io_buffer_efl_io_writer_can_write_get(Eo *o EINA_UNUSED, Efl_Io_Buffer_Data *pd)
+_efl_io_buffer_efl_io_writer_can_write_get(const Eo *o EINA_UNUSED, Efl_Io_Buffer_Data *pd)
{
return pd->can_write;
}
@@ -336,7 +336,7 @@ _efl_io_buffer_efl_io_closer_close(Eo *o, Efl_Io_Buffer_Data *pd)
}
EOLIAN static Eina_Bool
-_efl_io_buffer_efl_io_closer_closed_get(Eo *o EINA_UNUSED, Efl_Io_Buffer_Data *pd)
+_efl_io_buffer_efl_io_closer_closed_get(const Eo *o EINA_UNUSED, Efl_Io_Buffer_Data *pd)
{
return pd->closed;
}
@@ -350,18 +350,18 @@ _efl_io_buffer_efl_io_closer_close_on_exec_set(Eo *o EINA_UNUSED, Efl_Io_Buffer_
}
EOLIAN static Eina_Bool
-_efl_io_buffer_efl_io_closer_close_on_exec_get(Eo *o EINA_UNUSED, Efl_Io_Buffer_Data *pd EINA_UNUSED)
+_efl_io_buffer_efl_io_closer_close_on_exec_get(const Eo *o EINA_UNUSED, Efl_Io_Buffer_Data *pd EINA_UNUSED)
{
return EINA_TRUE;
}
EOLIAN static void
-_efl_io_buffer_efl_io_closer_close_on_destructor_set(Eo *o EINA_UNUSED, Efl_Io_Buffer_Data *pd EINA_UNUSED, Eina_Bool close_on_destructor EINA_UNUSED)
+_efl_io_buffer_efl_io_closer_close_on_invalidate_set(Eo *o EINA_UNUSED, Efl_Io_Buffer_Data *pd EINA_UNUSED, Eina_Bool close_on_invalidate EINA_UNUSED)
{
}
EOLIAN static Eina_Bool
-_efl_io_buffer_efl_io_closer_close_on_destructor_get(Eo *o EINA_UNUSED, Efl_Io_Buffer_Data *pd EINA_UNUSED)
+_efl_io_buffer_efl_io_closer_close_on_invalidate_get(const Eo *o EINA_UNUSED, Efl_Io_Buffer_Data *pd EINA_UNUSED)
{
return EINA_TRUE;
}
@@ -427,7 +427,7 @@ _efl_io_buffer_efl_io_sizer_resize(Eo *o, Efl_Io_Buffer_Data *pd, uint64_t size)
}
EOLIAN static uint64_t
-_efl_io_buffer_efl_io_sizer_size_get(Eo *o EINA_UNUSED, Efl_Io_Buffer_Data *pd)
+_efl_io_buffer_efl_io_sizer_size_get(const Eo *o EINA_UNUSED, Efl_Io_Buffer_Data *pd)
{
return pd->used;
}
@@ -463,7 +463,7 @@ _efl_io_buffer_efl_io_positioner_seek(Eo *o, Efl_Io_Buffer_Data *pd EINA_UNUSED,
}
EOLIAN static uint64_t
-_efl_io_buffer_efl_io_positioner_position_get(Eo *o, Efl_Io_Buffer_Data *pd EINA_UNUSED)
+_efl_io_buffer_efl_io_positioner_position_get(const Eo *o, Efl_Io_Buffer_Data *pd EINA_UNUSED)
{
uint64_t r = efl_io_buffer_position_read_get(o);
uint64_t w = efl_io_buffer_position_write_get(o);
@@ -508,7 +508,7 @@ _efl_io_buffer_position_read_set(Eo *o, Efl_Io_Buffer_Data *pd, uint64_t positio
}
EOLIAN static uint64_t
-_efl_io_buffer_position_read_get(Eo *o EINA_UNUSED, Efl_Io_Buffer_Data *pd)
+_efl_io_buffer_position_read_get(const Eo *o EINA_UNUSED, Efl_Io_Buffer_Data *pd)
{
return pd->position_read;
}
@@ -544,7 +544,7 @@ _efl_io_buffer_position_write_set(Eo *o, Efl_Io_Buffer_Data *pd, uint64_t positi
}
EOLIAN static uint64_t
-_efl_io_buffer_position_write_get(Eo *o EINA_UNUSED, Efl_Io_Buffer_Data *pd)
+_efl_io_buffer_position_write_get(const Eo *o EINA_UNUSED, Efl_Io_Buffer_Data *pd)
{
return pd->position_write;
}
diff --git a/src/lib/efl/interfaces/efl_io_buffer.eo b/src/lib/efl/interfaces/efl_io_buffer.eo
index 75358d7bb3..b7d90d6418 100644
--- a/src/lib/efl/interfaces/efl_io_buffer.eo
+++ b/src/lib/efl/interfaces/efl_io_buffer.eo
@@ -137,9 +137,9 @@ class Efl.Io.Buffer (Efl.Object, Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer, Ef
}
events {
- position_read,changed; [[Notifies @.position_read changed]]
- position_write,changed; [[Notifies @.position_write changed]]
- reallocated; [[Notifies the internal buffer was reallocated, thus whatever was returned by @.slice becomes invalid]]
+ position_read,changed: void; [[Notifies @.position_read changed]]
+ position_write,changed: void; [[Notifies @.position_write changed]]
+ reallocated: void; [[Notifies the internal buffer was reallocated, thus whatever was returned by @.slice becomes invalid]]
}
implements {
@@ -153,7 +153,7 @@ class Efl.Io.Buffer (Efl.Object, Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer, Ef
Efl.Io.Closer.close;
Efl.Io.Closer.closed { get; }
Efl.Io.Closer.close_on_exec { get; set; }
- Efl.Io.Closer.close_on_destructor { get; set; }
+ Efl.Io.Closer.close_on_invalidate { get; set; }
Efl.Io.Sizer.resize;
Efl.Io.Sizer.size { get; }
Efl.Io.Positioner.seek;
diff --git a/src/lib/efl/interfaces/efl_io_closer.eo b/src/lib/efl/interfaces/efl_io_closer.eo
index f14c94401f..b7a6684fb6 100644
--- a/src/lib/efl/interfaces/efl_io_closer.eo
+++ b/src/lib/efl/interfaces/efl_io_closer.eo
@@ -59,21 +59,21 @@ mixin Efl.Io.Closer {
}
}
- @property close_on_destructor {
- [[If true will automatically close() on object destructor.
+ @property close_on_invalidate {
+ [[If true will automatically close() on object invalidate.
- If the object was deleted without close, this property
- will state whenever it should be closed or not.
+ If the object was disconnected from its parent (including the main loop) without close,
+ this property will state whenever it should be closed or not.
]]
get @pure_virtual { }
set @pure_virtual { }
values {
- close_on_destructor: bool; [[$true if close on destructor, $false otherwise]]
+ close_on_invalidate: bool; [[$true if close on invalidate, $false otherwise]]
}
}
}
events {
- closed; [[Notifies closed, when property is marked as true]]
+ closed: void; [[Notifies closed, when property is marked as true]]
}
}
diff --git a/src/lib/efl/interfaces/efl_io_positioner.eo b/src/lib/efl/interfaces/efl_io_positioner.eo
index b344d784de..4b4033c670 100644
--- a/src/lib/efl/interfaces/efl_io_positioner.eo
+++ b/src/lib/efl/interfaces/efl_io_positioner.eo
@@ -1,6 +1,6 @@
import eina_types;
-enum Efl.Io.Positioner.Whence {
+enum Efl.Io.Positioner_Whence {
[[Seek position modes]]
start, [[Seek from start of the stream/file]]
current, [[Seek from current position]]
@@ -20,7 +20,7 @@ mixin Efl.Io.Positioner {
[[Seek in data]]
params {
@in offset: int64; [[Offset in byte relative to whence]]
- @in whence: Efl.Io.Positioner.Whence; [[Whence]]
+ @in whence: Efl.Io.Positioner_Whence; [[Whence]]
}
return: Eina.Error; [[0 on succeed, a mapping of errno otherwise]]
}
@@ -39,6 +39,6 @@ mixin Efl.Io.Positioner {
}
events {
- position,changed; [[Notifies position changed]]
+ position,changed: void; [[Notifies position changed]]
}
}
diff --git a/src/lib/efl/interfaces/efl_io_queue.c b/src/lib/efl/interfaces/efl_io_queue.c
index 80bc0636fe..20f3e951ef 100644
--- a/src/lib/efl/interfaces/efl_io_queue.c
+++ b/src/lib/efl/interfaces/efl_io_queue.c
@@ -189,19 +189,19 @@ _efl_io_queue_limit_set(Eo *o, Efl_Io_Queue_Data *pd, size_t limit)
}
EOLIAN static size_t
-_efl_io_queue_limit_get(Eo *o EINA_UNUSED, Efl_Io_Queue_Data *pd)
+_efl_io_queue_limit_get(const Eo *o EINA_UNUSED, Efl_Io_Queue_Data *pd)
{
return pd->limit;
}
EOLIAN static size_t
-_efl_io_queue_usage_get(Eo *o EINA_UNUSED, Efl_Io_Queue_Data *pd)
+_efl_io_queue_usage_get(const Eo *o EINA_UNUSED, Efl_Io_Queue_Data *pd)
{
return pd->position_write - pd->position_read;
}
EOLIAN static Eina_Slice
-_efl_io_queue_slice_get(Eo *o, Efl_Io_Queue_Data *pd)
+_efl_io_queue_slice_get(const Eo *o, Efl_Io_Queue_Data *pd)
{
Eina_Slice slice = { };
@@ -335,7 +335,7 @@ _efl_io_queue_discard(Eo *o, Efl_Io_Queue_Data *pd, size_t amount)
}
EOLIAN static Eina_Bool
-_efl_io_queue_efl_io_reader_can_read_get(Eo *o EINA_UNUSED, Efl_Io_Queue_Data *pd)
+_efl_io_queue_efl_io_reader_can_read_get(const Eo *o EINA_UNUSED, Efl_Io_Queue_Data *pd)
{
return pd->can_read;
}
@@ -350,7 +350,7 @@ _efl_io_queue_efl_io_reader_can_read_set(Eo *o, Efl_Io_Queue_Data *pd, Eina_Bool
}
EOLIAN static Eina_Bool
-_efl_io_queue_efl_io_reader_eos_get(Eo *o EINA_UNUSED, Efl_Io_Queue_Data *pd EINA_UNUSED)
+_efl_io_queue_efl_io_reader_eos_get(const Eo *o EINA_UNUSED, Efl_Io_Queue_Data *pd EINA_UNUSED)
{
return pd->eos;
}
@@ -375,6 +375,7 @@ _efl_io_queue_efl_io_writer_write(Eo *o, Efl_Io_Queue_Data *pd, Eina_Slice *slic
int err = EINVAL;
EINA_SAFETY_ON_NULL_RETURN_VAL(slice, EINVAL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(slice->mem, EINVAL);
EINA_SAFETY_ON_TRUE_GOTO(efl_io_closer_closed_get(o), error);
err = EBADF;
@@ -436,7 +437,7 @@ _efl_io_queue_efl_io_writer_write(Eo *o, Efl_Io_Queue_Data *pd, Eina_Slice *slic
}
EOLIAN static Eina_Bool
-_efl_io_queue_efl_io_writer_can_write_get(Eo *o EINA_UNUSED, Efl_Io_Queue_Data *pd)
+_efl_io_queue_efl_io_writer_can_write_get(const Eo *o EINA_UNUSED, Efl_Io_Queue_Data *pd)
{
return pd->can_write;
}
@@ -462,7 +463,7 @@ _efl_io_queue_efl_io_closer_close(Eo *o, Efl_Io_Queue_Data *pd)
}
EOLIAN static Eina_Bool
-_efl_io_queue_efl_io_closer_closed_get(Eo *o EINA_UNUSED, Efl_Io_Queue_Data *pd)
+_efl_io_queue_efl_io_closer_closed_get(const Eo *o EINA_UNUSED, Efl_Io_Queue_Data *pd)
{
return pd->closed;
}
@@ -476,18 +477,18 @@ _efl_io_queue_efl_io_closer_close_on_exec_set(Eo *o EINA_UNUSED, Efl_Io_Queue_Da
}
EOLIAN static Eina_Bool
-_efl_io_queue_efl_io_closer_close_on_exec_get(Eo *o EINA_UNUSED, Efl_Io_Queue_Data *pd EINA_UNUSED)
+_efl_io_queue_efl_io_closer_close_on_exec_get(const Eo *o EINA_UNUSED, Efl_Io_Queue_Data *pd EINA_UNUSED)
{
return EINA_TRUE;
}
EOLIAN static void
-_efl_io_queue_efl_io_closer_close_on_destructor_set(Eo *o EINA_UNUSED, Efl_Io_Queue_Data *pd EINA_UNUSED, Eina_Bool close_on_destructor EINA_UNUSED)
+_efl_io_queue_efl_io_closer_close_on_invalidate_set(Eo *o EINA_UNUSED, Efl_Io_Queue_Data *pd EINA_UNUSED, Eina_Bool close_on_invalidate EINA_UNUSED)
{
}
EOLIAN static Eina_Bool
-_efl_io_queue_efl_io_closer_close_on_destructor_get(Eo *o EINA_UNUSED, Efl_Io_Queue_Data *pd EINA_UNUSED)
+_efl_io_queue_efl_io_closer_close_on_invalidate_get(const Eo *o EINA_UNUSED, Efl_Io_Queue_Data *pd EINA_UNUSED)
{
return EINA_TRUE;
}
diff --git a/src/lib/efl/interfaces/efl_io_queue.eo b/src/lib/efl/interfaces/efl_io_queue.eo
index 46bcde493f..ae298273bd 100644
--- a/src/lib/efl/interfaces/efl_io_queue.eo
+++ b/src/lib/efl/interfaces/efl_io_queue.eo
@@ -102,7 +102,7 @@ class Efl.Io.Queue (Efl.Object, Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer) {
}
events {
- slice,changed; [[The read-slice returned by @.slice may have changed.]]
+ slice,changed: void; [[The read-slice returned by @.slice may have changed.]]
}
implements {
@@ -116,6 +116,6 @@ class Efl.Io.Queue (Efl.Object, Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer) {
Efl.Io.Closer.close;
Efl.Io.Closer.closed { get; }
Efl.Io.Closer.close_on_exec { get; set; }
- Efl.Io.Closer.close_on_destructor { get; set; }
+ Efl.Io.Closer.close_on_invalidate { get; set; }
}
}
diff --git a/src/lib/efl/interfaces/efl_io_reader.eo b/src/lib/efl/interfaces/efl_io_reader.eo
index 1b3cc6d7fe..ccb3efe90f 100644
--- a/src/lib/efl/interfaces/efl_io_reader.eo
+++ b/src/lib/efl/interfaces/efl_io_reader.eo
@@ -40,7 +40,7 @@ interface Efl.Io.Reader {
set @protected { }
values {
can_read: bool; [[$true if it can be read without blocking or failing, $false
- otherwise]]
+ otherwise]]
}
}
@@ -55,7 +55,7 @@ interface Efl.Io.Reader {
}
events {
- can_read,changed; [[Notifies can_read property changed.
+ can_read,changed: void; [[Notifies can_read property changed.
If @.can_read is $true there is data to
@.read without blocking/error. If
@@ -66,7 +66,7 @@ interface Efl.Io.Reader {
from inside @Efl.Io.Reader.read, thus
before it returns.
]]
- eos; [[Notifies end of stream, when property is marked as true.
+ eos: void; [[Notifies end of stream, when property is marked as true.
If this is used alongside with an @Efl.Io.Closer, then
it should be emitted before that call.
diff --git a/src/lib/efl/interfaces/efl_io_sizer.eo b/src/lib/efl/interfaces/efl_io_sizer.eo
index 64a14f99ec..a91cf665a1 100644
--- a/src/lib/efl/interfaces/efl_io_sizer.eo
+++ b/src/lib/efl/interfaces/efl_io_sizer.eo
@@ -34,6 +34,6 @@ mixin Efl.Io.Sizer {
}
events {
- size,changed; [[Notifies size changed]]
+ size,changed: void; [[Notifies size changed]]
}
}
diff --git a/src/lib/efl/interfaces/efl_io_writer.eo b/src/lib/efl/interfaces/efl_io_writer.eo
index cba6ff3be7..7e109cf372 100644
--- a/src/lib/efl/interfaces/efl_io_writer.eo
+++ b/src/lib/efl/interfaces/efl_io_writer.eo
@@ -41,13 +41,13 @@ interface Efl.Io.Writer {
set @protected { }
values {
can_write: bool; [[$true if it can be written without blocking or failure, $false
- otherwise]]
+ otherwise]]
}
}
}
events {
- can_write,changed; [[Notifies can_write property changed.
+ can_write,changed: void; [[Notifies can_write property changed.
If @.can_write is $true there is data to
@.write without blocking/error. If
diff --git a/src/lib/efl/interfaces/efl_model.eo b/src/lib/efl/interfaces/efl_model.eo
index d615c4472b..88260db317 100644
--- a/src/lib/efl/interfaces/efl_model.eo
+++ b/src/lib/efl/interfaces/efl_model.eo
@@ -1,9 +1,18 @@
-struct Efl.Model.Property_Event {
+struct Efl.Model_Property_Event {
[[EFL model property event data structure]]
changed_properties: array<string>; [[List of changed properties]]
invalidated_properties: array<string>; [[Removed properties identified by name]]
}
+struct Efl.Model_Children_Event {
+ [[Every time a child is added the event EFL_MODEL_EVENT_CHILD_ADDED is dispatched
+ passing along this structure.]]
+ index: uint; [[index is a hint and is intended to provide a way for applications
+ to control/know children relative positions through listings.]]
+ child: Efl.Object; [[If an object has been built for this index and it is currently tracked by
+ the parent, it will be available here.]]
+}
+
interface Efl.Model ()
{
[[Efl model interface]]
@@ -22,50 +31,50 @@ interface Efl.Model ()
@since 1.14
]]
- }
- values {
- properties: const(array<string>); [[Array of current properties]]
+ }
+ values {
+ properties: array<string>; [[Array of current properties]]
}
}
- property_set {
- [[Set a property value of a given property name.
-
- The caller must ensure to call at least efl_model_prop_list
- before being able to see/set properties. This function sets
- a new property value into given property name. Once the
- operation is completed the concrete implementation should
- raise EFL_MODEL_EVENT_PROPERTIES_CHANGED event in order to
- notify listeners of the new value of the property.
-
- If the model doesn't have the property then there are two
- possibilities, either raise an error or create the new
- property in model
-
- See @.property_get, \@ref EFL_MODEL_EVENT_PROPERTIES_CHANGED
-
- @since 1.14
- ]]
- params {
- @in property: string; [[Property name]]
- @in value: const(any_value_ptr); [[New value]]
+ @property property {
+ set {
+ [[Set a property value of a given property name.
+
+ The caller must ensure to call at least efl_model_prop_list
+ before being able to see/set properties. This function sets
+ a new property value into given property name. Once the
+ operation is completed the concrete implementation should
+ raise EFL_MODEL_EVENT_PROPERTIES_CHANGED event in order to
+ notify listeners of the new value of the property.
+
+ If the model doesn't have the property then there are two
+ possibilities, either raise an error or create the new
+ property in model
+
+ See @.property.get, \@ref EFL_MODEL_EVENT_PROPERTIES_CHANGED
+
+ @since 1.14
+ ]]
+ return: future<any_value_ptr>; [[Return an error in case the property could not be set, the value that was set otherwise.]]
}
- return: future<any_value>; [[Future returning the recorded value or error]]
- }
- property_get {
- [[Retrieve the value of a given property name.
+ get {
+ [[Retrieve the value of a given property name.
- At this point the caller is free to get values from properties.
- The event EFL_MODEL_EVENT_PROPERTIES_CHANGED may be raised to
- notify listeners of the property/value.
+ At this point the caller is free to get values from properties.
+ The event EFL_MODEL_EVENT_PROPERTIES_CHANGED may be raised to
+ notify listeners of the property/value.
- See @.properties.get, \@ref EFL_MODEL_EVENT_PROPERTIES_CHANGED
+ See @.properties.get, \@ref EFL_MODEL_EVENT_PROPERTIES_CHANGED
- @since 1.14
- ]]
- params {
- @in property: string; [[Property name]]
+ @since 1.14
+ ]]
+ }
+ keys {
+ property: string; [[Property name]]
+ }
+ values {
+ value: any_value_ptr; [[Property value]]
}
- return: future<any_value>; [[Future of the value that was got]]
}
children_slice_get {
[[Get children slice OR full range.
@@ -89,7 +98,7 @@ interface Efl.Model ()
Optionally the user can call children_count_get to know the
number of children so a valid range can be known in advance.
- See @.children_count_get
+ See @.children_count.get
@since 1.14
]]
@@ -98,10 +107,12 @@ interface Efl.Model ()
@in count: uint; [[Range size. If count is 0, start is
ignored.]]
}
- return: future<accessor<Efl.Object> >; [[Future of the children]]
+ /* XXX: is this right? */
+ return: future<accessor<Efl.Object>>; [[Array of childrens]]
}
- children_count_get {
- [[Get children count.
+ @property children_count {
+ get {
+ [[Get children count.
When efl_model_load is completed efl_model_coildren_count_get
can be used to get the number of children. children_count_get
@@ -112,8 +123,11 @@ interface Efl.Model ()
See also @.children_slice_get.
@since 1.14
- ]]
- return: future<uint>; [[Future of the children count]]
+ ]]
+ }
+ values {
+ count: uint; [[Current known children count]]
+ }
}
child_add {
[[Add a new child.
@@ -144,11 +158,11 @@ interface Efl.Model ()
}
events {
- properties,changed: Efl.Model.Property_Event; [[Event dispatched when
+ properties,changed: Efl.Model_Property_Event; [[Event dispatched when
properties list is
available.]]
- child,added: Efl.Object; [[Event dispatched when new child is added.]]
- child,removed: Efl.Object; [[Event dispatched when child is removed.]]
- children,count,changed; [[Event dispatched when children count is finished.]]
+ child,added: Efl.Model_Children_Event; [[Event dispatched when new child is added.]]
+ child,removed: Efl.Model_Children_Event; [[Event dispatched when child is removed.]]
+ children,count,changed: void; [[Event dispatched when children count is finished.]]
}
}
diff --git a/src/lib/efl/interfaces/efl_model_common.c b/src/lib/efl/interfaces/efl_model_common.c
index 6bf825819f..ecbbb59ecb 100644
--- a/src/lib/efl/interfaces/efl_model_common.c
+++ b/src/lib/efl/interfaces/efl_model_common.c
@@ -23,87 +23,47 @@ static const char EFL_MODEL_ERROR_PERMISSION_DENIED_STR[] = "Permission denied";
static const char EFL_MODEL_ERROR_INCORRECT_VALUE_STR[] = "Incorrect value";
static const char EFL_MODEL_ERROR_INVALID_OBJECT_STR[] = "Object is invalid";
+#define _ERROR(Name) EFL_MODEL_ERROR_##Name = eina_error_msg_static_register(EFL_MODEL_ERROR_##Name##_STR);
EAPI int
efl_model_init(void)
{
- EFL_MODEL_ERROR_INCORRECT_VALUE = eina_error_msg_static_register(
- EFL_MODEL_ERROR_INCORRECT_VALUE_STR);
-
- EFL_MODEL_ERROR_UNKNOWN = eina_error_msg_static_register(
- EFL_MODEL_ERROR_UNKNOWN_STR);
-
- EFL_MODEL_ERROR_NOT_SUPPORTED = eina_error_msg_static_register(
- EFL_MODEL_ERROR_NOT_SUPPORTED_STR);
-
- EFL_MODEL_ERROR_NOT_FOUND = eina_error_msg_static_register(
- EFL_MODEL_ERROR_NOT_FOUND_STR);
-
- EFL_MODEL_ERROR_READ_ONLY = eina_error_msg_static_register(
- EFL_MODEL_ERROR_READ_ONLY_STR);
-
- EFL_MODEL_ERROR_INIT_FAILED = eina_error_msg_static_register(
- EFL_MODEL_ERROR_INIT_FAILED_STR);
-
- EFL_MODEL_ERROR_PERMISSION_DENIED = eina_error_msg_static_register(
- EFL_MODEL_ERROR_PERMISSION_DENIED_STR);
-
- EFL_MODEL_ERROR_INVALID_OBJECT = eina_error_msg_static_register(
- EFL_MODEL_ERROR_INVALID_OBJECT_STR);
+ _ERROR(INCORRECT_VALUE);
+ _ERROR(UNKNOWN);
+ _ERROR(NOT_SUPPORTED);
+ _ERROR(NOT_FOUND);
+ _ERROR(READ_ONLY);
+ _ERROR(INIT_FAILED);
+ _ERROR(PERMISSION_DENIED);
+ _ERROR(INVALID_OBJECT);
return EINA_TRUE;
}
-EAPI Eina_Accessor*
-efl_model_list_slice(Eina_List *list, unsigned start, unsigned count)
-{
- if (!list) return NULL;
+#undef _ERROR
- if ((start == 0) && (count == 0)) /* this is full data */
- {
- /*
- * children_accessor will be set to NULL by
- * eina_list_accessor_new if the later fails.
- */
- return eina_list_accessor_new(list);
- }
+EAPI void
+_efl_model_properties_changed_internal(const Efl_Model *model, ...)
+{
+ Efl_Model_Property_Event ev = { 0 };
+ Eina_Array *properties = eina_array_new(1);
+ const char *property;
+ va_list args;
- Eo *child;
- Eina_List *l, *ln, *lr = NULL;
- ln = eina_list_nth_list(list, (start));
- if (!ln)
- {
- return NULL;
- }
+ va_start(args, model);
- EINA_LIST_FOREACH(ln, l, child)
+ while ((property = (const char*) va_arg(args, const char*)))
{
- efl_ref(child);
- lr = eina_list_append(lr, child);
- if (eina_list_count(lr) == count)
- break;
+ eina_array_push(properties, property);
}
- if (!lr) return NULL;
+ va_end(args);
- // This may leak the children Eina_List.
- return eina_list_accessor_new(lr);
-}
+ ev.changed_properties = properties;
-EAPI void
-efl_model_property_changed_notify(Efl_Model *model, const char *property)
-{
- Eina_Array *changed_properties = eina_array_new(1);
- EINA_SAFETY_ON_NULL_RETURN(changed_properties);
+ efl_event_callback_call((Efl_Model *) model, EFL_MODEL_EVENT_PROPERTIES_CHANGED, &ev);
- Eina_Bool ret = eina_array_push(changed_properties, property);
- EINA_SAFETY_ON_FALSE_GOTO(ret, on_error);
-
- Efl_Model_Property_Event evt = {.changed_properties = changed_properties};
- efl_event_callback_call(model, EFL_MODEL_EVENT_PROPERTIES_CHANGED, &evt);
-
-on_error:
- eina_array_free(changed_properties);
+ eina_array_free(properties);
}
EAPI void
diff --git a/src/lib/efl/interfaces/efl_observable.eo b/src/lib/efl/interfaces/efl_observable.eo
index 8aa7bba6c1..f39d3dc8bb 100644
--- a/src/lib/efl/interfaces/efl_observable.eo
+++ b/src/lib/efl/interfaces/efl_observable.eo
@@ -56,7 +56,7 @@ class Efl.Observable (Efl.Object) {
[[Return a new iterator associated to this observable.
@since 1.19]]
- return: iterator<ptr(Efl.Observable.Tuple)> @owned; [[Iterator for observer]]
+ return: iterator<ptr(Efl.Observable_Tuple)> @owned; [[Iterator for observer]]
}
}
implements {
diff --git a/src/lib/efl/interfaces/efl_orientation.eo b/src/lib/efl/interfaces/efl_orientation.eo
index 1b42b320e6..4f83c25c97 100644
--- a/src/lib/efl/interfaces/efl_orientation.eo
+++ b/src/lib/efl/interfaces/efl_orientation.eo
@@ -1,4 +1,4 @@
-import efl_ui_direction; // For documentation references
+parse efl_ui_direction;
enum Efl.Orient
{
@@ -17,6 +17,17 @@ enum Efl.Orient
left = 270, [[Orient left, rotate 90 degrees clock-wise.]]
}
+enum Efl.Flip
+{
+ [[A flip type, to flip visual objects.
+
+ See also @Efl.Orientation.
+ ]]
+ none = 0, [[No flip]]
+ horizontal = 1, [[Flip image horizontally]]
+ vertical = 2 [[Flip image vertically]]
+}
+
interface Efl.Orientation
{
[[Efl orientation interface]]
@@ -31,5 +42,16 @@ interface Efl.Orientation
dir: Efl.Orient(Efl.Orient.none); [[The rotation angle (CCW), see @Efl.Orient.]]
}
}
+ @property flip {
+ [[Control the flip of the given image
+
+ Use this function to change how your image is to be
+ flipped: vertically or horizontally or transpose
+ or traverse.
+ ]]
+ values {
+ flip: Efl.Flip; [[Flip method]]
+ }
+ }
}
}
diff --git a/src/lib/efl/interfaces/efl_pack.eo b/src/lib/efl/interfaces/efl_pack.eo
index 98a7371323..6da85cb8fd 100644
--- a/src/lib/efl/interfaces/efl_pack.eo
+++ b/src/lib/efl/interfaces/efl_pack.eo
@@ -1,5 +1,3 @@
-import eina_types;
-
interface Efl.Pack (Efl.Container)
{
[[API common to all UI container objects.]]
@@ -19,7 +17,7 @@ interface Efl.Pack (Efl.Container)
unpack {
[[Removes an existing item from the container, without deleting it.]]
params {
- subobj: Efl.Gfx; [[The unpacked object.]]
+ subobj: Efl.Gfx.Entity; [[The unpacked object.]]
}
return: bool; [[$false if $subobj wasn't a child or can't be removed]]
}
@@ -35,7 +33,7 @@ interface Efl.Pack (Efl.Container)
without deleting it.
]]
params {
- subobj: Efl.Gfx; [[An object to pack.]]
+ subobj: Efl.Gfx.Entity; [[An object to pack.]]
}
return: bool; [[$false if $subobj could not be packed.]]
}
@@ -60,6 +58,6 @@ interface Efl.Pack (Efl.Container)
}
}
events {
- layout,updated; [[Sent after the layout was updated.]]
+ layout,updated: void; [[Sent after the layout was updated.]]
}
}
diff --git a/src/lib/efl/interfaces/efl_pack_layout.eo b/src/lib/efl/interfaces/efl_pack_layout.eo
index 5cb35d851b..caf5548efd 100644
--- a/src/lib/efl/interfaces/efl_pack_layout.eo
+++ b/src/lib/efl/interfaces/efl_pack_layout.eo
@@ -1,4 +1,4 @@
-interface Efl.Pack.Layout ()
+interface Efl.Pack_Layout ()
{
[[Low-level APIs for object that can lay their children out.
diff --git a/src/lib/efl/interfaces/efl_pack_linear.eo b/src/lib/efl/interfaces/efl_pack_linear.eo
index d1e740603b..d9bb90234c 100644
--- a/src/lib/efl/interfaces/efl_pack_linear.eo
+++ b/src/lib/efl/interfaces/efl_pack_linear.eo
@@ -1,4 +1,4 @@
-interface Efl.Pack.Linear (Efl.Pack)
+interface Efl.Pack_Linear (Efl.Pack)
{
[[API for containers ]]
eo_prefix: efl_pack;
@@ -13,7 +13,7 @@ interface Efl.Pack.Linear (Efl.Pack)
container without deleting it.
]]
params {
- @in subobj: Efl.Gfx; [[Item to pack.]]
+ @in subobj: Efl.Gfx.Entity; [[Item to pack.]]
}
return: bool; [[$false if $subobj could not be packed]]
}
@@ -27,7 +27,7 @@ interface Efl.Pack.Linear (Efl.Pack)
container without deleting it.
]]
params {
- @in subobj: Efl.Gfx; [[Item to pack at the end.]]
+ @in subobj: Efl.Gfx.Entity; [[Item to pack at the end.]]
}
return: bool; [[$false if $subobj could not be packed]]
}
@@ -39,8 +39,8 @@ interface Efl.Pack.Linear (Efl.Pack)
container without deleting it.
]]
params {
- @in subobj: Efl.Gfx; [[Item to pack before $existing.]]
- @in existing: const(Efl.Gfx); [[Item to refer to.]]
+ @in subobj: Efl.Gfx.Entity; [[Item to pack before $existing.]]
+ @in existing: const(Efl.Gfx.Entity); [[Item to refer to.]]
}
return: bool; [[$false if $existing could not be found or $subobj
could not be packed.]]
@@ -53,8 +53,8 @@ interface Efl.Pack.Linear (Efl.Pack)
container without deleting it.
]]
params {
- @in subobj: Efl.Gfx; [[Item to pack after $existing.]]
- @in existing: const(Efl.Gfx); [[Item to refer to.]]
+ @in subobj: Efl.Gfx.Entity; [[Item to pack after $existing.]]
+ @in existing: const(Efl.Gfx.Entity); [[Item to refer to.]]
}
return: bool; [[$false if $existing could not be found or $subobj
could not be packed.]]
@@ -70,7 +70,7 @@ interface Efl.Pack.Linear (Efl.Pack)
container without deleting it.
]]
params {
- @in subobj: Efl.Gfx; [[Item to pack at given index.]]
+ @in subobj: Efl.Gfx.Entity; [[Item to pack at given index.]]
@in index: int; [[A position.]]
}
return: bool; [[$false if $subobj could not be packed.]]
@@ -84,12 +84,12 @@ interface Efl.Pack.Linear (Efl.Pack)
params {
index: int; [[Index number]]
}
- return: Efl.Gfx; [[The object contained at the given $index.]]
+ return: Efl.Gfx.Entity; [[The object contained at the given $index.]]
}
pack_index_get {
[[Get the index of a child in this container.]]
params {
- subobj: const(Efl.Gfx); [[An object contained in this pack.]]
+ subobj: const(Efl.Gfx.Entity); [[An object contained in this pack.]]
}
return: int(-1); [[-1 in case of failure, or the index of this item.]]
}
@@ -101,7 +101,7 @@ interface Efl.Pack.Linear (Efl.Pack)
params {
index: int; [[Index number]]
}
- return: Efl.Gfx; [[The child item if it could be removed.]]
+ return: Efl.Gfx.Entity; [[The child item if it could be removed.]]
}
}
}
diff --git a/src/lib/efl/interfaces/efl_pack_table.eo b/src/lib/efl/interfaces/efl_pack_table.eo
index c79bd82b7a..33323ac5ae 100644
--- a/src/lib/efl/interfaces/efl_pack_table.eo
+++ b/src/lib/efl/interfaces/efl_pack_table.eo
@@ -1,6 +1,6 @@
-import efl_gfx_types;
+import efl_ui_direction;
-interface Efl.Pack.Table (Efl.Pack.Linear)
+interface Efl.Pack_Table (Efl.Pack_Linear)
{
[[2D containers aligned on a table with rows and columns]]
eo_prefix: efl_pack;
@@ -13,7 +13,7 @@ interface Efl.Pack.Table (Efl.Pack.Linear)
container without deleting it.
]]
params {
- subobj: Efl.Gfx; [[A child object to pack in this table.]]
+ subobj: Efl.Gfx.Entity; [[A child object to pack in this table.]]
col: int; [[Column number]]
row: int; [[Row number]]
colspan: int @optional; [[0 means 1, -1 means @.table_columns]]
@@ -23,7 +23,7 @@ interface Efl.Pack.Table (Efl.Pack.Linear)
}
table_contents_get {
[[Returns all objects at a given position in this table.]]
- return: iterator<Efl.Gfx> @owned; [[Iterator to table contents]]
+ return: iterator<Efl.Gfx.Entity> @owned; [[Iterator to table contents]]
params {
@in col: int; [[Column number]]
@in row: int; [[Row number]]
@@ -32,7 +32,7 @@ interface Efl.Pack.Table (Efl.Pack.Linear)
}
table_content_get {
[[Returns a child at a given position, see @.table_contents_get.]]
- return: Efl.Gfx; [[Child object]]
+ return: Efl.Gfx.Entity; [[Child object]]
params {
@in col: int; [[Column number]]
@in row: int; [[Row number]]
@@ -42,7 +42,7 @@ interface Efl.Pack.Table (Efl.Pack.Linear)
[[Position and span of the $subobj in this container, may be modified to move the $subobj]]
get { return: bool; [[Returns false if item is not a child]] }
keys {
- subobj: Efl.Gfx; [[Child object]]
+ subobj: Efl.Gfx.Entity; [[Child object]]
}
values {
col: int; [[Column number]]
@@ -61,7 +61,7 @@ interface Efl.Pack.Table (Efl.Pack.Linear)
}
}
@property table_columns {
- [[Gird columns property]]
+ [[Gird columns property]]
set { [[Specifies limit for linear adds - if direction is horizontal]] }
get {}
values {
@@ -69,7 +69,7 @@ interface Efl.Pack.Table (Efl.Pack.Linear)
}
}
@property table_rows {
- [[Table rows property]]
+ [[Table rows property]]
set { [[Specifies limit for linear adds - if direction is vertical]] }
get {}
values {
diff --git a/src/lib/efl/interfaces/efl_part.eo b/src/lib/efl/interfaces/efl_part.eo
index 124dad121e..1f37e7e4ab 100644
--- a/src/lib/efl/interfaces/efl_part.eo
+++ b/src/lib/efl/interfaces/efl_part.eo
@@ -10,7 +10,10 @@ interface Efl.Part
theme.
Part proxy objects have a special lifetime that
- is limited to one and only one function call.
+ is limited to one and only one function call. This
+ behavior is implemented in efl_part() which call
+ Efl.Part.part_get(). Calling Efl.Part.part_get() directly
+ should be avoided.
In other words, the caller does not hold a reference
to this proxy object. It may be possible, in languages
@@ -32,10 +35,8 @@ interface Efl.Part
unref(part)
]]
methods {
- part @const {
+ part_get @protected @const {
[[Get a proxy object referring to a part of an object.
-
- The returned object is valid for only a single function call.
]]
params {
name: string; [[The part name.]]
diff --git a/src/lib/efl/interfaces/efl_playable.eo b/src/lib/efl/interfaces/efl_playable.eo
new file mode 100644
index 0000000000..56dbc9e51b
--- /dev/null
+++ b/src/lib/efl/interfaces/efl_playable.eo
@@ -0,0 +1,29 @@
+interface Efl.Playable
+{
+ [[Efl media playable interface]]
+ methods {
+ @property length {
+ [[Get the length of play for the media file.]]
+ get {
+ }
+ values {
+ length: double; [[The length of the stream in seconds.]]
+ }
+ }
+ @property playable {
+ get {
+ }
+ values {
+ playable: bool;
+ }
+ }
+ @property seekable {
+ [[Get whether the media file is seekable.]]
+ get {
+ }
+ values {
+ seekable: bool; [[$true if seekable.]]
+ }
+ }
+ }
+}
diff --git a/src/lib/efl/interfaces/efl_player.eo b/src/lib/efl/interfaces/efl_player.eo
index 86c2c5296c..0353b36752 100644
--- a/src/lib/efl/interfaces/efl_player.eo
+++ b/src/lib/efl/interfaces/efl_player.eo
@@ -2,8 +2,14 @@ interface Efl.Player
{
[[Efl media player interface]]
methods {
+ start {
+ [[Start a playing playable object.]]
+ }
+ stop {
+ [[Stop playable object.]]
+ }
@property playable {
- [[Whether or not the object data can be played.]]
+ [[Whether or not the playable can be played.]]
get {
}
values {
@@ -26,7 +32,7 @@ interface Efl.Player
play: bool; [[$true if playing, $false otherwise.]]
}
}
- @property position {
+ @property pos {
set {
[[Set the position in the media file.
diff --git a/src/lib/efl/interfaces/efl_text_annotate.eo b/src/lib/efl/interfaces/efl_text_annotate.eo
index 002505356c..f22209ec39 100644
--- a/src/lib/efl/interfaces/efl_text_annotate.eo
+++ b/src/lib/efl/interfaces/efl_text_annotate.eo
@@ -1,7 +1,6 @@
-import eina_types;
import efl_text_types;
-interface Efl.Text.Annotate {
+interface Efl.Text_Annotate {
[[Cursor API
@since 1.20
@@ -27,23 +26,23 @@ interface Efl.Text.Annotate {
legacy: null;
}
keys {
- annotation: ptr(Efl.Text.Annotate.Annotation); [[Given annotation]]
+ annotation: ptr(Efl.Text_Annotate_Annotation); [[Given annotation]]
}
values {
format: string; [[The new format for the given annotation]]
}
}
- range_annotations_get {
+ range_annotations_get @const {
[[Returns an iterator of all the handles in a range.
@since 1.18
]]
legacy: null;
params {
- @in start: ptr(const(Efl.Text.Cursor.Cursor)); [[Start of range]]
- @in end: ptr(const(Efl.Text.Cursor.Cursor)); [[End of range]]
+ @in start: ptr(const(Efl.Text_Cursor_Cursor)); [[Start of range]]
+ @in end: ptr(const(Efl.Text_Cursor_Cursor)); [[End of range]]
}
- return: iterator<ptr(Efl.Text.Annotate.Annotation)> @owned; [[Handle of the Annotation]]
+ return: iterator<ptr(Efl.Text_Annotate_Annotation)> @owned; [[Handle of the Annotation]]
}
annotation_insert {
[[Inserts an annotation format in a specified range [$start, $end - 1].
@@ -55,11 +54,11 @@ interface Efl.Text.Annotate {
]]
legacy: null;
params {
- @in start: ptr(Efl.Text.Cursor.Cursor); [[Start of range]]
- @in end: ptr(Efl.Text.Cursor.Cursor); [[End of range]]
+ @in start: ptr(Efl.Text_Cursor_Cursor); [[Start of range]]
+ @in end: ptr(Efl.Text_Cursor_Cursor); [[End of range]]
@in format: string; [[Annotation format]]
}
- return: ptr(Efl.Text.Annotate.Annotation); [[Handle of inserted annotation]]
+ return: ptr(Efl.Text_Annotate_Annotation); [[Handle of inserted annotation]]
}
annotation_del {
[[Deletes given annotation.
@@ -71,60 +70,76 @@ interface Efl.Text.Annotate {
]]
legacy: null;
params {
- @in annotation: ptr(Efl.Text.Annotate.Annotation); [[Annotation to be
+ @in annotation: ptr(Efl.Text_Annotate_Annotation); [[Annotation to be
removed]]
}
return: bool; [[$true on success, $false otherwise.]]
}
- object_item_geometry_get {
- [[Queries a given object item for its geometry.
+ annotation_positions_get {
+ [[Sets given cursors to the start and end positions of the annotation.
- Note that the provided annotation should be an object item type.
+ The cursors $start and $end will be set to the start and end
+ positions of the given annotation $annotation.
@since 1.18
]]
legacy: null;
params {
- @in an: ptr(const(Efl.Text.Annotate.Annotation)); [[Given annotation to query]]
- @out x: int; [[X coordinate of the annotation]]
- @out y: int; [[Y coordinate of the annotation]]
- @out w: int; [[Width of the annotation]]
- @out h: int; [[Height of the annotation]]
+ @in annotation: ptr(const(Efl.Text_Annotate_Annotation)); [[Annotation
+ handle to query]]
+ @in start: ptr(Efl.Text_Cursor_Cursor); [[Cursor to be set to the start
+ position of the annotation in the text]]
+ @in end: ptr(Efl.Text_Cursor_Cursor); [[Cursor to be set to the end
+ position of the annotation in the text]]
+ }
+ }
+ annotation_is_item {
+ [[Whether this is an "item" type of annotation. Should be used before
+ querying the annotation's geometry, as only "item" annotations have
+ a geometry.
+
+ see @.cursor_item_insert
+ see @.item_geometry_get
+
+ @since 1.21
+ ]]
+ legacy: null;
+ params {
+ annotation: ptr(Efl.Text_Annotate_Annotation); [[Given annotation]]
}
return: bool; [[$true if given annotation is an object item, $false otherwise]]
}
- annotation_positions_get {
- [[Sets given cursors to the start and end positions of the annotation.
+ item_geometry_get {
+ [[Queries a given object item for its geometry.
- The cursors $start and $end will be set to the start and end
- positions of the given annotation $annotation.
+ Note that the provided annotation should be an object item type.
@since 1.18
]]
legacy: null;
params {
- @in annotation: ptr(const(Efl.Text.Annotate.Annotation)); [[Annotation
- handle to query]]
- @in start: ptr(Efl.Text.Cursor.Cursor); [[Cursor to be set to the start
- position of the annotation in the text]]
- @in end: ptr(Efl.Text.Cursor.Cursor); [[Cursor to be set to the end
- position of the annotation in the text]]
+ @in an: ptr(const(Efl.Text_Annotate_Annotation)); [[Given annotation to query]]
+ @out x: int; [[X coordinate of the annotation]]
+ @out y: int; [[Y coordinate of the annotation]]
+ @out w: int; [[Width of the annotation]]
+ @out h: int; [[Height of the annotation]]
}
+ return: bool; [[$true if given annotation is an object item, $false otherwise]]
}
// Cursor
- @property cursor_object_item_annotation {
+ @property cursor_item_annotation {
[[The object-item annotation at the cursor's position.]]
get {
legacy: null;
}
values {
- annotation: ptr(Efl.Text.Annotate.Annotation); [[Annotation]]
+ annotation: ptr(Efl.Text_Annotate_Annotation); [[Annotation]]
}
keys {
- cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
+ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
}
}
- cursor_object_item_insert {
+ cursor_item_insert {
[[Inserts a object item at specified position.
This adds a placeholder to be queried by higher-level code,
@@ -133,11 +148,14 @@ interface Efl.Text.Annotate {
]]
legacy: null;
params {
- cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
- @in format: string; [[Format of the inserted item.
- See Format styles.]]
+ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
+ @in item: string; [[Item key to be used in higher-up
+ code to query and decided what image, emoticon
+ etc. to embed.]]
+ @in format: string; [[Size format of the inserted item.
+ This hints how to size the item in the text.]]
}
- return: ptr(Efl.Text.Annotate.Annotation); [[The annotation handle of the
+ return: ptr(Efl.Text_Annotate_Annotation); [[The annotation handle of the
inserted item.]]
}
}
diff --git a/src/lib/efl/interfaces/efl_text_cursor.eo b/src/lib/efl/interfaces/efl_text_cursor.eo
index 448028b1b9..973c7d85bd 100644
--- a/src/lib/efl/interfaces/efl_text_cursor.eo
+++ b/src/lib/efl/interfaces/efl_text_cursor.eo
@@ -1,7 +1,7 @@
import eina_types;
import efl_text_types;
-enum Efl.Text.Cursor.Cursor_Get_Type {
+enum Efl.Text_Cursor_Get_Type {
[[All available cursor states]]
legacy: efl_text_cursor_get;
default = 0, [[Main cursor state (alias to "main")]]
@@ -14,7 +14,7 @@ enum Efl.Text.Cursor.Cursor_Get_Type {
user_extra [[User extra cursor state]]
}
-enum Efl.Text.Cursor.Cursor_Type
+enum Efl.Text_Cursor_Type
{
[[Text cursor types]]
legacy: efl_text_cursor_type;
@@ -22,24 +22,24 @@ enum Efl.Text.Cursor.Cursor_Type
under [[Cursor type under]]
}
-interface Efl.Text.Cursor {
+interface Efl.Text_Cursor {
[[Cursor API
@since 1.20
]]
methods {
// Cursor
- @property cursor {
+ @property text_cursor {
[[The object's main cursor.
@since 1.18
]]
get {
legacy: null;
- return: ptr(Efl.Text.Cursor.Cursor); [[Text cursor object]]
+ return: ptr(Efl.Text_Cursor_Cursor); [[Text cursor object]]
}
keys {
- get_type: Efl.Text.Cursor.Cursor_Get_Type; [[Cursor type]]
+ get_type: Efl.Text_Cursor_Get_Type; [[Cursor type]]
}
}
@property cursor_position {
@@ -50,7 +50,7 @@ interface Efl.Text.Cursor {
position: int; [[Cursor position]]
}
keys {
- cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
+ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
}
}
@property cursor_content {
@@ -62,7 +62,7 @@ interface Efl.Text.Cursor {
content: Eina.Unicode; [[The unicode codepoint of the character]]
}
keys {
- @cref cur: Efl.Text.Cursor.Cursor; [[Cursor object]]
+ @cref cur: Efl.Text_Cursor_Cursor; [[Cursor object]]
}
}
@property cursor_geometry {
@@ -79,8 +79,8 @@ interface Efl.Text.Cursor {
return: bool; [[ $true if split cursor, $false otherwise.]]
}
keys {
- @cref cur: Efl.Text.Cursor.Cursor; [[Cursor object]]
- ctype: Efl.Text.Cursor.Cursor_Type; [[The type of the cursor.]]
+ @cref cur: Efl.Text_Cursor_Cursor; [[Cursor object]]
+ ctype: Efl.Text_Cursor_Type; [[The type of the cursor.]]
}
values {
cx: int; [[The x of the cursor (or upper cursor)]]
@@ -96,21 +96,21 @@ interface Efl.Text.Cursor {
cursor_new {
[[Create new cursor]]
legacy: null;
- return: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
+ return: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
}
cursor_free {
[[Free existing cursor]]
legacy: null;
params {
- cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
+ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
}
}
cursor_equal {
[[Check if two cursors are equal]]
legacy: null;
params {
- @cref cur1: Efl.Text.Cursor.Cursor; [[Cursor 1 object]]
- @cref cur2: Efl.Text.Cursor.Cursor; [[Cursor 2 object]]
+ @cref cur1: Efl.Text_Cursor_Cursor; [[Cursor 1 object]]
+ @cref cur2: Efl.Text_Cursor_Cursor; [[Cursor 2 object]]
}
return: bool; [[$true if cursors are equal, $false otherwise]]
}
@@ -118,8 +118,8 @@ interface Efl.Text.Cursor {
[[Compare two cursors]]
legacy: null;
params {
- @cref cur1: Efl.Text.Cursor.Cursor; [[Cursor 1 object]]
- @cref cur2: Efl.Text.Cursor.Cursor; [[Cursor 2 object]]
+ @cref cur1: Efl.Text_Cursor_Cursor; [[Cursor 1 object]]
+ @cref cur2: Efl.Text_Cursor_Cursor; [[Cursor 2 object]]
}
return: int; [[Difference between cursors]]
}
@@ -127,99 +127,99 @@ interface Efl.Text.Cursor {
[[Copy existing cursor]]
legacy: null;
params {
- /* @out */ dst: ptr(Efl.Text.Cursor.Cursor); [[Destination cursor]]
- @cref src: Efl.Text.Cursor.Cursor; [[Source cursor]]
+ /* @out */ dst: ptr(Efl.Text_Cursor_Cursor); [[Destination cursor]]
+ @cref src: Efl.Text_Cursor_Cursor; [[Source cursor]]
}
}
cursor_char_next {
[[Advances to the next character]]
legacy: null;
params {
- /* @inout */ cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
+ /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
}
}
cursor_char_prev {
[[Advances to the previous character]]
legacy: null;
params {
- /* @inout */ cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
+ /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
}
}
cursor_paragraph_char_first {
[[Advances to the first character in this paragraph]]
legacy: null;
params {
- /* @inout */ cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
+ /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
}
}
cursor_paragraph_char_last {
[[Advances to the last character in this paragraph]]
legacy: null;
params {
- /* @inout */ cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
+ /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
}
}
cursor_word_start {
[[Advance to current word start]]
legacy: null;
params {
- /* @inout */ cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
+ /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
}
}
cursor_word_end {
[[Advance to current word end]]
legacy: null;
params {
- /* @inout */ cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
+ /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
}
}
cursor_line_char_first {
[[Advance to current line first character]]
legacy: null;
params {
- /* @inout */ cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
+ /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
}
}
cursor_line_char_last {
[[Advance to current line last character]]
legacy: null;
params {
- /* @inout */ cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
+ /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
}
}
cursor_paragraph_first {
[[Advance to current paragraph first character]]
legacy: null;
params {
- /* @inout */ cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
+ /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
}
}
cursor_paragraph_last {
[[Advance to current paragraph last character]]
legacy: null;
params {
- /* @inout */ cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
+ /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
}
}
cursor_paragraph_next {
[[Advances to the start of the next text node]]
legacy: null;
params {
- /* @inout */ cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
+ /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
}
}
cursor_paragraph_prev {
[[Advances to the end of the previous text node]]
legacy: null;
params {
- /* @inout */ cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
+ /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
}
}
cursor_line_jump_by {
[[Jump the cursor by the given number of lines]]
legacy: null;
params {
- /* @inout */ cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
+ /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
by: int; [[Number of lines]]
}
}
@@ -227,7 +227,7 @@ interface Efl.Text.Cursor {
[[Set cursor coordinates]]
legacy: null;
params {
- /* @inout */ cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
+ /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
@in x: int; [[X coord to set by.]]
@in y: int; [[Y coord to set by.]]
}
@@ -238,7 +238,7 @@ interface Efl.Text.Cursor {
]]
legacy: null;
params {
- /* @inout */ cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
+ /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
@in text: string; [[Text to append (UTF-8 format).]]
}
return: int; [[Length of the appended text.]]
@@ -247,7 +247,7 @@ interface Efl.Text.Cursor {
[[Deletes a single character from position pointed by given cursor.]]
legacy: null;
params {
- /* @inout */ cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
+ /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
}
}
}
diff --git a/src/lib/efl/interfaces/efl_text_font.eo b/src/lib/efl/interfaces/efl_text_font.eo
index f349fbae8c..34e5dab22a 100644
--- a/src/lib/efl/interfaces/efl_text_font.eo
+++ b/src/lib/efl/interfaces/efl_text_font.eo
@@ -1,6 +1,6 @@
// src/lib/efl/interfaces/efl_text_font.eo
-
-enum Efl.Text.Font.Weight {
+import efl_gfx_types;
+enum Efl.Text_Font_Weight {
[[Type of font weight]]
normal, [[Normal font weight]]
thin, [[Thin font weight]]
@@ -17,7 +17,7 @@ enum Efl.Text.Font.Weight {
extrablack, [[Extrablack font weight]]
}
-enum Efl.Text.Font.Width {
+enum Efl.Text_Font_Width {
[[Type of font width]]
normal, [[Normal font width]]
ultracondensed, [[Ultracondensed font width]]
@@ -30,7 +30,7 @@ enum Efl.Text.Font.Width {
ultraexpanded, [[Ultraexpanded font width]]
}
-enum Efl.Text.Font.Slant {
+enum Efl.Text_Font_Slant {
[[Type of font slant]]
normal, [[Normal font slant]]
oblique, [[Oblique font slant]]
@@ -40,7 +40,7 @@ enum Efl.Text.Font.Slant {
/* FIXME: It needs to support "normal" option for non-color bitmap font.
For supporting "normal" option, S/W glyph drawing engine should be updated.
*/
-enum Efl.Text.Font.Bitmap_Scalable {
+enum Efl.Text_Font_Bitmap_Scalable {
[[Scalable of bitmap fonts
@since 1.21
@@ -49,7 +49,7 @@ enum Efl.Text.Font.Bitmap_Scalable {
color = (1 << 0), [[Enable scalable feature for color bitmap fonts.]]
}
-interface Efl.Text.Font {
+interface Efl.Text_Font {
[[Font settings of the text
@since 1.20
@@ -57,20 +57,55 @@ interface Efl.Text.Font {
eo_prefix: efl_text;
methods {
@property font {
- [[The font name and size that is used for the displayed text]]
+ set {
+ [[Set the font family, filename and size for a given text object.
+
+ This function allows the font name and size of a text object to
+ be set. The font string has to follow fontconfig's convention for
+ naming fonts, as it's the underlying library used to query system
+ fonts by Evas (see the fc-list command's output, on your system,
+ to get an idea). Alternatively, youe can use the full path to a font
+ file.
+
+ See also @.font.get, @.font_source.get.
+ ]]
+ }
+ get {
+ [[Retrieve the font family and size in use on a given text object.
+
+ This function allows the font name and size of a text object to
+ be queried. Remember that the font name string is still owned by
+ Evas and should not have free() called on it by the caller of the
+ function.
+
+ See also @.font.set.
+ ]]
+ }
values {
- font: string; [[Font name]]
- size: int; [[Font size]]
+ font: string; [[The font family name or filename.]]
+ size: Efl.Font.Size; [[The font size, in points.]]
}
}
@property font_source {
- [[The source that will be used to lookup the font of the text
+ set {
+ [[Set the font (source) file to be used on a given text object.
- The source can be either a path to a font file e.g.
- "/path/to/font.ttf", or an eet file e.g. "/path/to/font.eet".
- ]]
+ This function allows the font file to be explicitly set for a
+ given text object, overriding system lookup, which will first
+ occur in the given file's contents.
+
+ See also @.font.set.
+ ]]
+ }
+ get {
+ [[Get the font file's path which is being used on a given text
+ object.
+
+ See @.font.get for more details.
+ ]]
+ }
values {
- font_source: string; [[Path to font source]]
+ font_source: string; [[The font file's path.]]
}
}
@@ -87,30 +122,30 @@ interface Efl.Text.Font {
@property font_weight {
[[Type of weight of the displayed font
- Default is @Efl.Text.Font.Weight.normal\.
+ Default is @Efl.Text_Font_Weight.normal\.
]]
values {
- font_weight: Efl.Text.Font.Weight; [[Font weight]]
+ font_weight: Efl.Text_Font_Weight; [[Font weight]]
}
}
@property font_slant {
[[Type of slant of the displayed font
- Default is @Efl.Text.Font.Slant.normal\.
+ Default is @Efl.Text_Font_Slant.normal\.
]]
values {
- style: Efl.Text.Font.Slant; [[Font slant]]
+ style: Efl.Text_Font_Slant; [[Font slant]]
}
}
@property font_width {
[[Type of width of the displayed font
- Default is @Efl.Text.Font.Width.normal\.
+ Default is @Efl.Text_Font_Width.normal\.
]]
values {
- width: Efl.Text.Font.Width; [[Font width]]
+ width: Efl.Text_Font_Width; [[Font width]]
}
}
@@ -132,10 +167,10 @@ interface Efl.Text.Font {
Basically, it is not scalable. But, it needs to be scalable for some use cases.
(ex. colorful emoji fonts)
- Default is @Efl.Text.Font.Bitmap_Scalable.none\.
+ Default is @Efl.Text_Font_Bitmap_Scalable.none\.
]]
values {
- scalable: Efl.Text.Font.Bitmap_Scalable; [[Scalable]]
+ scalable: Efl.Text_Font_Bitmap_Scalable; [[Scalable]]
}
}
}
diff --git a/src/lib/efl/interfaces/efl_text_format.eo b/src/lib/efl/interfaces/efl_text_format.eo
index 0155625d78..0ec9c98240 100644
--- a/src/lib/efl/interfaces/efl_text_format.eo
+++ b/src/lib/efl/interfaces/efl_text_format.eo
@@ -1,4 +1,4 @@
-enum Efl.Text.Format.Wrap {
+enum Efl.Text_Format_Wrap {
[[Wrap mode of the text (not in effect if not multiline)]]
none, [[No wrapping]]
char, [[Wrap mode character]]
@@ -7,7 +7,7 @@ enum Efl.Text.Format.Wrap {
hyphenation [[Wrap mode hyphenation]]
}
-enum Efl.Text.Format.Horizontal_Alignment_Auto_Type {
+enum Efl.Text_Format_Horizontal_Alignment_Auto_Type {
[[Auto-horizontal alignment of the text]]
legacy: efl_text_horizontal_alignment_auto;
none, [[No auto-alignment rule]]
@@ -16,7 +16,7 @@ enum Efl.Text.Format.Horizontal_Alignment_Auto_Type {
end [[Text is places at opposite side of LTR/RTL (bidirectional) settings]]
}
-interface Efl.Text.Format {
+interface Efl.Text_Format {
[[The look and layout of the text
The text format can affect the geometry of the text object, as well as
@@ -37,7 +37,7 @@ interface Efl.Text.Format {
@property wrap {
[[Wrap mode for use in the text]]
values {
- wrap: Efl.Text.Format.Wrap; [[Wrap mode]]
+ wrap: Efl.Text_Format_Wrap; [[Wrap mode]]
}
}
@@ -51,7 +51,7 @@ interface Efl.Text.Format {
@property halign_auto_type {
[[Horizontal alignment of text]]
values {
- value: Efl.Text.Format.Horizontal_Alignment_Auto_Type; [[Alignment type]]
+ value: Efl.Text_Format_Horizontal_Alignment_Auto_Type; [[Alignment type]]
}
}
diff --git a/src/lib/efl/interfaces/efl_text_markup.eo b/src/lib/efl/interfaces/efl_text_markup.eo
index 5f1782703b..7e2bbaaaee 100644
--- a/src/lib/efl/interfaces/efl_text_markup.eo
+++ b/src/lib/efl/interfaces/efl_text_markup.eo
@@ -1,4 +1,4 @@
-interface Efl.Text.Markup(Efl.Text.Cursor) {
+interface Efl.Text_Markup(Efl.Text_Cursor) {
[[Markup data that populates the text object's style and format
@since 1.21
@@ -13,7 +13,7 @@ interface Efl.Text.Markup(Efl.Text.Cursor) {
cursor_markup_insert {
[[Inserts a markup text to the text object in a given cursor position]]
params {
- cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor position to insert markup]]
+ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor position to insert markup]]
@in markup: string; [[The markup text to insert]]
}
}
diff --git a/src/lib/efl/interfaces/efl_text_markup_util.eo b/src/lib/efl/interfaces/efl_text_markup_util.eo
index 304b2cacf9..eb64791b67 100644
--- a/src/lib/efl/interfaces/efl_text_markup_util.eo
+++ b/src/lib/efl/interfaces/efl_text_markup_util.eo
@@ -1,4 +1,4 @@
-class Efl.Text.Markup_Util () {
+class Efl.Text_Markup_Util () {
[[Utility class for markup, such as conversions
@since 1.21.
diff --git a/src/lib/efl/interfaces/efl_text_properties.eo b/src/lib/efl/interfaces/efl_text_properties.eo
deleted file mode 100644
index 8552fae4dd..0000000000
--- a/src/lib/efl/interfaces/efl_text_properties.eo
+++ /dev/null
@@ -1,60 +0,0 @@
-import efl_gfx_types;
-
-interface Efl.Text.Properties
-{
- [[Efl text properties interface]]
- methods {
- @property font {
- set {
- [[Set the font family, filename and size for a given text object.
-
- This function allows the font name and size of a text object to
- be set. The font string has to follow fontconfig's convention for
- naming fonts, as it's the underlying library used to query system
- fonts by Evas (see the fc-list command's output, on your system,
- to get an idea). Alternatively, youe can use the full path to a font
- file.
-
- See also @.font.get, @.font_source.get.
- ]]
- }
- get {
- [[Retrieve the font family and size in use on a given text object.
-
- This function allows the font name and size of a text object to
- be queried. Remember that the font name string is still owned by
- Evas and should not have free() called on it by the caller of the
- function.
-
- See also @.font.set.
- ]]
- }
- values {
- font: string; [[The font family name or filename.]]
- size: Efl.Font.Size; [[The font size, in points.]]
- }
- }
- @property font_source {
- set {
- [[Set the font (source) file to be used on a given text object.
-
- This function allows the font file to be explicitly set for a
- given text object, overriding system lookup, which will first
- occur in the given file's contents.
-
- See also @.font.set.
- ]]
- }
- get {
- [[Get the font file's path which is being used on a given text
- object.
-
- See @.font.get for more details.
- ]]
- }
- values {
- font_source: string; [[The font file's path.]]
- }
- }
- }
-}
diff --git a/src/lib/efl/interfaces/efl_text_style.eo b/src/lib/efl/interfaces/efl_text_style.eo
index 91e33725ed..395609626c 100644
--- a/src/lib/efl/interfaces/efl_text_style.eo
+++ b/src/lib/efl/interfaces/efl_text_style.eo
@@ -1,18 +1,18 @@
-enum Efl.Text.Style.Backing_Type
+enum Efl.Text_Style_Backing_Type
{
[[Whether to apply backing style to the displayed text or not]]
disabled = 0, [[Do not use backing]]
enabled, [[Use backing style]]
}
-enum Efl.Text.Style.Strikethrough_Type
+enum Efl.Text_Style_Strikethrough_Type
{
[[Whether to apply strikethrough style to the displayed text or not]]
disabled = 0, [[Do not use strikethrough]]
enabled, [[Use strikethrough style]]
}
-enum Efl.Text.Style.Effect_Type
+enum Efl.Text_Style_Effect_Type
{
[[Effect to apply to the displayed text]]
none = 0, [[No effect]]
@@ -32,7 +32,7 @@ enum Efl.Text.Style.Effect_Type
outline_soft_shadow, [[Outline soft shadow effect]]
}
-enum Efl.Text.Style.Shadow_Direction
+enum Efl.Text_Style_Shadow_Direction
{
[[Direction of the shadow style, if used]]
bottom_right = 0, [[Shadow towards bottom right]]
@@ -45,7 +45,7 @@ enum Efl.Text.Style.Shadow_Direction
right, [[Shadow towards right]]
}
-enum Efl.Text.Style.Underline_Type
+enum Efl.Text_Style_Underline_Type
{
[[Underline type of the displayed text]]
off = 0, [[Text without underline]]
@@ -55,7 +55,7 @@ enum Efl.Text.Style.Underline_Type
dashed, [[Underlined with a dashed line]]
}
-interface Efl.Text.Style {
+interface Efl.Text_Style {
[[Style to apply to the text
A style can be coloring, effects, underline, strikethrough etc.
@@ -76,15 +76,15 @@ interface Efl.Text.Style {
}
@property backing_type {
- [[Enable or disable backing type]]
+ [[Enable or disable backing type]]
values
{
- type: Efl.Text.Style.Backing_Type; [[Backing type]]
+ type: Efl.Text_Style_Backing_Type; [[Backing type]]
}
}
@property backing_color {
- [[Backing color]]
+ [[Backing color]]
values
{
r: ubyte; [[Red component]]
@@ -98,7 +98,7 @@ interface Efl.Text.Style {
[[Sets an underline style on the text]]
values
{
- type: Efl.Text.Style.Underline_Type; [[Underline type]]
+ type: Efl.Text_Style_Underline_Type; [[Underline type]]
}
}
@@ -158,7 +158,7 @@ interface Efl.Text.Style {
[[Type of underline2 style]]
values
{
- type: Efl.Text.Style.Underline_Type; [[Underline type]]
+ type: Efl.Text_Style_Underline_Type; [[Underline type]]
}
}
@@ -178,7 +178,7 @@ interface Efl.Text.Style {
[[Type of strikethrough style]]
values
{
- type: Efl.Text.Style.Strikethrough_Type; [[Strikethrough type]]
+ type: Efl.Text_Style_Strikethrough_Type; [[Strikethrough type]]
}
}
@@ -197,7 +197,7 @@ interface Efl.Text.Style {
@property effect_type {
[[Type of effect used for the displayed text]]
values {
- type: Efl.Text.Style.Effect_Type; [[Effect type]]
+ type: Efl.Text_Style_Effect_Type; [[Effect type]]
}
}
@property outline_color
@@ -217,7 +217,7 @@ interface Efl.Text.Style {
[[Direction of shadow effect]]
values
{
- type: Efl.Text.Style.Shadow_Direction; [[Shadow direction]]
+ type: Efl.Text_Style_Shadow_Direction; [[Shadow direction]]
}
}
diff --git a/src/lib/efl/interfaces/efl_text_types.eot b/src/lib/efl/interfaces/efl_text_types.eot
index d3f7d204f2..61003586b9 100644
--- a/src/lib/efl/interfaces/efl_text_types.eot
+++ b/src/lib/efl/interfaces/efl_text_types.eot
@@ -1,4 +1,4 @@
-enum Efl.Text.Bidirectional_Type {
+enum Efl.Text_Bidirectional_Type {
[[Bidirectionaltext type]]
natural = 0, [[Natural text type, same as neutral]]
neutral = 0, [[Neutral text type, same as natural]]
@@ -7,7 +7,7 @@ enum Efl.Text.Bidirectional_Type {
inherit [[Inherit text type]]
}
-struct Efl.Ui.Text.Change_Info {
+struct Efl.Ui.Text_Change_Info {
[[This structure includes all the information about content changes.
It's meant to be used to implement undo/redo.
@@ -19,7 +19,7 @@ struct Efl.Ui.Text.Change_Info {
merge: bool; [[$true if can be merged with the previous one. Used for example with insertion when something is already selected]]
}
-type @extern Efl.Text.Annotate.Annotation: __undefined_type; [[EFL text annotations data structure]]
+type @extern Efl.Text_Annotate_Annotation: __undefined_type; [[EFL text annotations data structure]]
-type @extern Efl.Text.Cursor.Cursor: __undefined_type; [[Text cursor data structure]]
+type @extern Efl.Text_Cursor_Cursor: __undefined_type; [[Text cursor data structure]]
diff --git a/src/lib/efl/interfaces/efl_types.eot b/src/lib/efl/interfaces/efl_types.eot
index f515a92ddb..06a9426ee8 100644
--- a/src/lib/efl/interfaces/efl_types.eot
+++ b/src/lib/efl/interfaces/efl_types.eot
@@ -39,7 +39,7 @@ struct Efl.Version
build_id: string; [[Contains $EFL_BUILD_ID.]]
}
-struct Efl.Observable.Tuple
+struct Efl.Observable_Tuple
{
[[This type describes an observable touple]]
key: string; [[Touple key]]
diff --git a/src/lib/efl/interfaces/efl_ui_base.eo b/src/lib/efl/interfaces/efl_ui_base.eo
index 7ce917d660..646b31be99 100644
--- a/src/lib/efl/interfaces/efl_ui_base.eo
+++ b/src/lib/efl/interfaces/efl_ui_base.eo
@@ -21,7 +21,7 @@ interface Efl.Ui.Base
to set the value of @.mirrored.
This property may be implemented by high-level widgets (in Efl.Ui)
- but not by low-level widgets (in @Efl.Canvas) as the configuration
+ but not by low-level widgets (in @Efl.Canvas.Scene) as the configuration
should affect only high-level widgets.
]]
values {
diff --git a/src/lib/efl/interfaces/efl_ui_clickable.eo b/src/lib/efl/interfaces/efl_ui_clickable.eo
index 6706630302..15c7e27a27 100644
--- a/src/lib/efl/interfaces/efl_ui_clickable.eo
+++ b/src/lib/efl/interfaces/efl_ui_clickable.eo
@@ -3,13 +3,17 @@ interface Efl.Ui.Clickable ()
[[Efl UI clickable interface]]
event_prefix: efl_ui;
events {
- clicked; [[Called when object iss clicked]]
- clicked,double; [[Called when object receives a double click]]
- clicked,triple; [[Called when object receives a triple click]]
- clicked,right; [[Called when object receives a right click]]
- pressed; [[Called when the object is pressed]]
- unpressed; [[Called when the object is no longer pressed]]
- longpressed; [[Called when the object receives a long press]]
- repeated; [[Called when the object receives repeated presses/clicks]]
+ /* FIXME: Explain what are the objects passed through the event_infos */
+ clicked: void; [[Called when object is clicked]]
+ clicked,double: void; [[Called when object receives a double click]]
+ clicked,triple: void; [[Called when object receives a triple click]]
+ clicked,right: Efl.Object; [[Called when object receives a right click]]
+ /* FIXME: Might be NULL */
+ pressed: Efl.Object; [[Called when the object is pressed]]
+ /* FIXME: Might be NULL */
+ unpressed: Efl.Object; [[Called when the object is no longer pressed]]
+ /* FIXME: Might be NULL */
+ longpressed: Efl.Object; [[Called when the object receives a long press]]
+ repeated: void; [[Called when the object receives repeated presses/clicks]]
}
}
diff --git a/src/lib/efl/interfaces/efl_ui_direction.eo b/src/lib/efl/interfaces/efl_ui_direction.eo
index daf4e0cf6d..78bf2cdeda 100644
--- a/src/lib/efl/interfaces/efl_ui_direction.eo
+++ b/src/lib/efl/interfaces/efl_ui_direction.eo
@@ -1,6 +1,8 @@
// FIXME: Documentation lacks proper references due to cyclic imports.
// FIXME: What about AnyRTL? And other strange directions?
+parse efl_orientation;
+
enum Efl.Ui.Dir
{
[[Direction for UI objects and layouts.
diff --git a/src/lib/efl/interfaces/efl_ui_drag.eo b/src/lib/efl/interfaces/efl_ui_drag.eo
index 227015f2b0..dedcb348f1 100644
--- a/src/lib/efl/interfaces/efl_ui_drag.eo
+++ b/src/lib/efl/interfaces/efl_ui_drag.eo
@@ -73,7 +73,7 @@ interface Efl.Ui.Drag
]]
get {
[[Gets the draggable direction.]]
- return: Efl.Ui.Drag.Dir; [[The direction(s) premitted for drag.]]
+ return: Efl.Ui.Drag_Dir; [[The direction(s) premitted for drag.]]
}
}
@property drag_step {
diff --git a/src/lib/efl/interfaces/efl_ui_draggable.eo b/src/lib/efl/interfaces/efl_ui_draggable.eo
index 750bf46a57..e38e7f4416 100644
--- a/src/lib/efl/interfaces/efl_ui_draggable.eo
+++ b/src/lib/efl/interfaces/efl_ui_draggable.eo
@@ -24,13 +24,14 @@ interface Efl.Ui.Draggable ()
}
events {
- drag; [[Called when drag operation starts]]
- drag,start; [[Called when drag started]]
- drag,stop; [[Called when drag stopped]]
- drag,end; [[Called when drag operation ends]]
- drag,start,up; [[Called when drag starts into up direction]]
- drag,start,down; [[Called when drag starts into down direction]]
- drag,start,right; [[Called when drag starts into right direction]]
- drag,start,left; [[Called when drag starts into left direction]]
+ /* FIXME: Explain what is the object passed through the event_infos */
+ drag: Efl.Object; [[Called when drag operation starts]]
+ drag,start: void; [[Called when drag started]]
+ drag,stop: Efl.Object; [[Called when drag stopped]]
+ drag,end: void; [[Called when drag operation ends]]
+ drag,start,up: Efl.Object; [[Called when drag starts into up direction]]
+ drag,start,down: Efl.Object; [[Called when drag starts into down direction]]
+ drag,start,right: Efl.Object; [[Called when drag starts into right direction]]
+ drag,start,left: Efl.Object; [[Called when drag starts into left direction]]
}
}
diff --git a/src/lib/efl/interfaces/efl_ui_factory.eo b/src/lib/efl/interfaces/efl_ui_factory.eo
index ac01c5845b..4765f3beca 100644
--- a/src/lib/efl/interfaces/efl_ui_factory.eo
+++ b/src/lib/efl/interfaces/efl_ui_factory.eo
@@ -6,14 +6,21 @@ interface Efl.Ui.Factory (Efl.Ui.Model.Connect)
[[Create a UI object from the necessary properties in the specified model.]]
params {
model: Efl.Model; [[Efl model]]
- parent: Efl.Gfx; [[Efl canvas]]
+ parent: Efl.Gfx.Entity; [[Efl canvas]]
}
- return: Efl.Gfx; [[Created UI object]]
+ return: Efl.Gfx.Entity; [[Created UI object]]
}
release {
[[Release a UI object and disconnect from models.]]
params {
- ui_view: Efl.Gfx; [[Efl canvas]]
+ ui_view: Efl.Gfx.Entity; [[Efl canvas]]
+ }
+ }
+ model_connect {
+ [[Connect factory to a model]]
+ params {
+ name: string; [[Model name]]
+ factory: Efl.Ui.Factory; [[Efl factory]]
}
}
}
diff --git a/src/lib/efl/interfaces/efl_ui_format.c b/src/lib/efl/interfaces/efl_ui_format.c
index bb40c340a8..b4c24f2018 100644
--- a/src/lib/efl/interfaces/efl_ui_format.c
+++ b/src/lib/efl/interfaces/efl_ui_format.c
@@ -10,6 +10,7 @@ typedef enum _Format_Type
FORMAT_TYPE_DOUBLE,
FORMAT_TYPE_INT,
FORMAT_TYPE_STRING,
+ FORMAT_TYPE_STATIC
} Format_Type;
typedef struct
@@ -27,26 +28,23 @@ _is_valid_digit(char x)
static Format_Type
_format_string_check(const char *fmt)
{
- const char *itr = NULL;
- const char *start = NULL;
+ const char *itr;
Eina_Bool found = EINA_FALSE;
- Format_Type ret_type = FORMAT_TYPE_INVALID;
+ Format_Type ret_type = FORMAT_TYPE_STATIC;
- start = strchr(fmt, '%');
- if (!start) return 0;
-
- while (start)
+ for (itr = fmt; *itr; itr++)
{
- if (found && start[1] != '%')
+ if (itr[0] != '%') continue;
+ if (itr[1] == '%')
{
- ret_type = FORMAT_TYPE_INVALID;
- break;
+ itr++;
+ continue;
}
- if (start[1] != '%' && !found)
+ if (!found)
{
found = EINA_TRUE;
- for (itr = start + 1; *itr != '\0'; itr++)
+ for (itr++; *itr; itr++)
{
// FIXME: This does not properly support int64 or unsigned.
if ((*itr == 'd') || (*itr == 'u') || (*itr == 'i') ||
@@ -75,10 +73,19 @@ _format_string_check(const char *fmt)
break;
}
}
+ if (!(*itr)) break;
+ }
+ else
+ {
+ ret_type = FORMAT_TYPE_INVALID;
+ break;
}
- start = strchr(start + 2, '%');
}
+ if (ret_type == FORMAT_TYPE_INVALID)
+ {
+ ERR("Format string '%s' is invalid. It must have one and only one format element of type 's', 'f', 'F', 'd', 'u', 'i', 'o', 'x' or 'X'", fmt);
+ }
return ret_type;
}
@@ -121,6 +128,10 @@ _default_format_cb(void *data, Eina_Strbuf *str, const Eina_Value value)
eina_strbuf_append_printf(str, sd->template, v);
free(v);
}
+ else if (sd->format_type == FORMAT_TYPE_STATIC)
+ {
+ eina_strbuf_append(str, sd->template);
+ }
else
{
// Error: Discard format string and just print value.
@@ -155,7 +166,7 @@ _efl_ui_format_format_string_set(Eo *obj, Efl_Ui_Format_Data *sd, const char *te
}
EOLIAN static const char *
-_efl_ui_format_format_string_get(Eo *obj EINA_UNUSED, Efl_Ui_Format_Data *sd)
+_efl_ui_format_format_string_get(const Eo *obj EINA_UNUSED, Efl_Ui_Format_Data *sd)
{
return sd->template;
}
diff --git a/src/lib/efl/interfaces/efl_ui_format.eo b/src/lib/efl/interfaces/efl_ui_format.eo
index 88f3962e8e..e78478e8bd 100644
--- a/src/lib/efl/interfaces/efl_ui_format.eo
+++ b/src/lib/efl/interfaces/efl_ui_format.eo
@@ -1,5 +1,3 @@
-import eina_types;
-
function Efl.Ui.Format_Func_Cb {
[[Function pointer for format function hook]]
params {
diff --git a/src/lib/efl/interfaces/efl_ui_item.eo b/src/lib/efl/interfaces/efl_ui_item.eo
deleted file mode 100644
index 49ef31b6d5..0000000000
--- a/src/lib/efl/interfaces/efl_ui_item.eo
+++ /dev/null
@@ -1,54 +0,0 @@
-interface Efl.Ui.Item {
- [[Efl UI item interface]]
- legacy_prefix: null;
- methods {
- @property prev {
- get {
- [[Get the item before this one in the widget's list of items.
-
- See also @.next.
- ]]
- }
- values {
- item: Efl.Ui.Item; [[The item before the object in its parent's
- list. If there is no previous item or in case
- of error, $null is returned.]]
- }
- }
- @property next {
- get {
- [[Get the item after this one in the widget's list of items.
-
- See also @.prev.
- ]]
- }
- values {
- item: Efl.Ui.Item; [[The item after the object in its parent's
- list. If there is no next item or in case
- of error, $null is returned.]]
- }
- }
- @property selected {
- [[Indicates whether this item is currently selected.]]
- get {
- [[Get the selected state of this item.]]
- }
- set {
- [[Set the selected state of $item.
-
- This sets the selected state of the given item $it.
- $true for selected, $false for not selected.
-
- If a new item is selected the previously selected will
- be unselected. Previously selected item can be retrieved
- with @Efl.Ui.Menu.selected_item.get.
-
- Selected items will be highlighted.
- ]]
- }
- values {
- selected: bool; [[The selection state.]]
- }
- }
- }
-}
diff --git a/src/lib/efl/interfaces/efl_ui_model_factory_connect.eo b/src/lib/efl/interfaces/efl_ui_model_factory_connect.eo
deleted file mode 100644
index f192211f89..0000000000
--- a/src/lib/efl/interfaces/efl_ui_model_factory_connect.eo
+++ /dev/null
@@ -1,13 +0,0 @@
-interface Efl.Ui.Model.Factory.Connect
-{
- [[Efl UI model factory interface]]
- methods {
- connect {
- [[Connect factory]]
- params {
- name: string; [[Model name]]
- factory: Efl.Ui.Factory; [[Efl factory]]
- }
- }
- }
-}
diff --git a/src/lib/efl/interfaces/efl_ui_multi_selectable.eo b/src/lib/efl/interfaces/efl_ui_multi_selectable.eo
new file mode 100644
index 0000000000..8e82750441
--- /dev/null
+++ b/src/lib/efl/interfaces/efl_ui_multi_selectable.eo
@@ -0,0 +1,28 @@
+enum Efl.Ui.Select_Mode {
+ [[Type of multi selectable object.]]
+ legacy: efl_ui_select;
+ single, [[Only single child is selected. if the child is selected,
+ previous selected child will be unselected.]]
+ single_always, [[Same as single select except, this will be selected
+ in every select calls though child is already been selected.]]
+ multi, [[allow multiple selection of children.]]
+ none [[Last value of select mode. child cannot be selected at all.]]
+}
+
+interface Efl.Ui.Multi_Selectable ()
+{
+ [[Efl UI Multi selectable interface.
+ The container have to control select property of multiple chidren.]]
+ eo_prefix: efl_ui;
+ methods
+ {
+ @property select_mode {
+ [[The mode type for children selection.]]
+ set {}
+ get {}
+ values {
+ mode: Efl.Ui.Select_Mode; [[Type of selection of children]]
+ }
+ }
+ }
+}
diff --git a/src/lib/efl/interfaces/efl_ui_scrollable.eo b/src/lib/efl/interfaces/efl_ui_scrollable.eo
index 34b440d9af..2f6d0a1053 100644
--- a/src/lib/efl/interfaces/efl_ui_scrollable.eo
+++ b/src/lib/efl/interfaces/efl_ui_scrollable.eo
@@ -17,20 +17,20 @@ interface Efl.Ui.Scrollable ()
[[Efl UI scrollable interface]]
event_prefix: efl_ui;
events {
- scroll,start; [[Called when scroll operation starts]]
- scroll; [[Called when scrolling]]
- scroll,stop; [[Called when scroll operation stops]]
- scroll,up; [[Called when scrolling upwards]]
- scroll,down; [[Called when scrolling downwards]]
- scroll,left; [[Called when scrolling left]]
- scroll,right; [[Called when scrolling right]]
- edge,up; [[Called when hitting the top edge]]
- edge,down; [[Called when hitting the bottom edge]]
- edge,left; [[Called when hitting the left edge]]
- edge,right; [[Called when hitting the right edge]]
- scroll,anim,start; [[Called when scroll animation starts]]
- scroll,anim,stop; [[Called when scroll animation stopps]]
- scroll,drag,start; [[Called when scroll drag starts]]
- scroll,drag,stop; [[Called when scroll drag stops]]
+ scroll,start: void; [[Called when scroll operation starts]]
+ scroll: void; [[Called when scrolling]]
+ scroll,stop: void; [[Called when scroll operation stops]]
+ scroll,up: void; [[Called when scrolling upwards]]
+ scroll,down: void; [[Called when scrolling downwards]]
+ scroll,left: void; [[Called when scrolling left]]
+ scroll,right: void; [[Called when scrolling right]]
+ edge,up: void; [[Called when hitting the top edge]]
+ edge,down: void; [[Called when hitting the bottom edge]]
+ edge,left: void; [[Called when hitting the left edge]]
+ edge,right: void; [[Called when hitting the right edge]]
+ scroll,anim,start: void; [[Called when scroll animation starts]]
+ scroll,anim,stop: void; [[Called when scroll animation stopps]]
+ scroll,drag,start: void; [[Called when scroll drag starts]]
+ scroll,drag,stop: void; [[Called when scroll drag stops]]
}
}
diff --git a/src/lib/efl/interfaces/efl_ui_scrollable_interactive.eo b/src/lib/efl/interfaces/efl_ui_scrollable_interactive.eo
index d3139c8225..5595374775 100644
--- a/src/lib/efl/interfaces/efl_ui_scrollable_interactive.eo
+++ b/src/lib/efl/interfaces/efl_ui_scrollable_interactive.eo
@@ -1,6 +1,6 @@
import eina_types;
-interface Efl.Ui.Scrollable.Interactive (Efl.Ui.Scrollable)
+interface Efl.Ui.Scrollable_Interactive (Efl.Ui.Scrollable)
{
eo_prefix: efl_ui_scrollable;
methods {
diff --git a/src/lib/efl/interfaces/efl_ui_scrollbar.eo b/src/lib/efl/interfaces/efl_ui_scrollbar.eo
index a539e82d24..2e2f0d08df 100644
--- a/src/lib/efl/interfaces/efl_ui_scrollbar.eo
+++ b/src/lib/efl/interfaces/efl_ui_scrollbar.eo
@@ -59,12 +59,12 @@ interface Efl.Ui.Scrollbar ()
}
}
events {
- bar,press; [[Called when bar is pressed]]
- bar,unpress; [[Called when bar is unpressed]]
- bar,drag; [[Called when bar is dragged]]
- bar,size,changed; [[Called when bar size is changed]]
- bar,pos,changed; [[Called when bar position is changed]]
- bar,show; [[Callend when bar is shown]]
- bar,hide; [[Called when bar is hidden]]
+ bar,press: Efl.Ui.Scrollbar_Direction; [[Called when bar is pressed]]
+ bar,unpress: Efl.Ui.Scrollbar_Direction; [[Called when bar is unpressed]]
+ bar,drag: Efl.Ui.Scrollbar_Direction; [[Called when bar is dragged]]
+ bar,size,changed: void; [[Called when bar size is changed]]
+ bar,pos,changed: void; [[Called when bar position is changed]]
+ bar,show: Efl.Ui.Scrollbar_Direction; [[Callend when bar is shown]]
+ bar,hide: Efl.Ui.Scrollbar_Direction; [[Called when bar is hidden]]
}
}
diff --git a/src/lib/efl/interfaces/efl_ui_selectable.eo b/src/lib/efl/interfaces/efl_ui_selectable.eo
index f7cf257a5e..3f98ddf4f9 100644
--- a/src/lib/efl/interfaces/efl_ui_selectable.eo
+++ b/src/lib/efl/interfaces/efl_ui_selectable.eo
@@ -3,13 +3,15 @@ interface Efl.Ui.Selectable ()
[[Efl UI selectable interface]]
event_prefix: efl_ui;
events {
- selected; [[Called when selected]]
- unselected; [[Called when no longer selected]]
- selection,paste; [[Called when selection is pasted]]
- selection,copy; [[Called when selection is copied]]
- selection,cut; [[Called when selection is cut]]
- selection,start; [[Called at selection start]]
- selection,changed; [[Called when selection is changed]]
- selection,cleared; [[Called when selection is cleared]]
+ /* FIXME: Called with multiple types of event_info! */
+ selected: void; [[Called when selected]]
+ /* FIXME: Called with multiple types of event_info! */
+ unselected: void; [[Called when no longer selected]]
+ selection,paste: void; [[Called when selection is pasted]]
+ selection,copy: void; [[Called when selection is copied]]
+ selection,cut: void; [[Called when selection is cut]]
+ selection,start: void; [[Called at selection start]]
+ selection,changed: void; [[Called when selection is changed]]
+ selection,cleared: void; [[Called when selection is cleared]]
}
}
diff --git a/src/lib/efl/interfaces/efl_ui_types.eot b/src/lib/efl/interfaces/efl_ui_types.eot
index 275d82fbd5..59cf1abf7f 100644
--- a/src/lib/efl/interfaces/efl_ui_types.eot
+++ b/src/lib/efl/interfaces/efl_ui_types.eot
@@ -1,4 +1,4 @@
-enum Efl.Ui.Drag.Dir {
+enum Efl.Ui.Drag_Dir {
[[Permitted directions for dragging objects.]]
none = 0, [[Not draggable in any direction.]]
x = 1, [[Draggable horizontally.]]
diff --git a/src/lib/efl/interfaces/efl_ui_zoom.eo b/src/lib/efl/interfaces/efl_ui_zoom.eo
index 327c34d5e6..bc37073a53 100644
--- a/src/lib/efl/interfaces/efl_ui_zoom.eo
+++ b/src/lib/efl/interfaces/efl_ui_zoom.eo
@@ -1,4 +1,4 @@
-enum Efl.Ui.Zoom.Mode
+enum Efl.Ui.Zoom_Mode
{
[[Types of zoom available.]]
legacy: efl_ui_zoom_mode;
@@ -36,7 +36,7 @@ interface Efl.Ui.Zoom ()
paused: bool; [[The pause state.]]
}
}
- @property zoom {
+ @property zoom_level {
set {
[[Set the zoom level of the photo
@@ -70,7 +70,7 @@ interface Efl.Ui.Zoom ()
This sets the zoom mode to manual or one of several automatic
levels. Manual (EFL_UI_ZOOM_MODE_MANUAL) means that zoom
- is set manually by @.zoom.set and will stay at that level until
+ is set manually by @.zoom_level.set and will stay at that level until
changed by code or until zoom mode is changed. This is the
default mode. The Automatic modes will allow the zoomable object
to automatically adjust zoom mode based on properties.
@@ -88,13 +88,13 @@ interface Efl.Ui.Zoom ()
]]
}
values {
- mode: Efl.Ui.Zoom.Mode; [[The zoom mode.]]
+ mode: Efl.Ui.Zoom_Mode; [[The zoom mode.]]
}
}
}
events {
- zoom,start; [[Called when zooming started]]
- zoom,stop; [[Called when zooming stopped]]
- zoom,change; [[Called when zooming changed]]
+ zoom,start: void; [[Called when zooming started]]
+ zoom,stop: void; [[Called when zooming stopped]]
+ zoom,change: void; [[Called when zooming changed]]
}
}
diff --git a/src/lib/efl/interfaces/efl_vpath.eo b/src/lib/efl/interfaces/efl_vpath.eo
deleted file mode 100644
index ca97f1b090..0000000000
--- a/src/lib/efl/interfaces/efl_vpath.eo
+++ /dev/null
@@ -1,31 +0,0 @@
-interface Efl.Vpath
-{
- [[ VPath is the EFL "Virtual Path" system that maps paths and downloads
-
- You can provide virtual paths common in unix shells like:
- "~/file.jpg"
- "~username/file.png"
- And also other extended paths like:
- "(:cache:)/file.png"
- "(:videos:)/file.mp4"
- ...
- And in future:
- "file:///blah.jpg"
- "http://blah.com/file.jpg"
- "https://blahblah.com/file.jpg"
- "ssh://blahblah.com:~/file.jpg"
- ...
-
- @since 1.18
- ]]
- eo_prefix: efl_vpath;
- methods {
- fetch {
- [[ Fetch a new Vpath File object from the Vpath system ]]
- params {
- path: string; [[ The input virtual file path to fetch ]]
- }
- return: Efl.Vpath.File @owned; [[ An object representing the file ]]
- }
- }
-}
diff --git a/src/lib/efl/interfaces/efl_vpath_core.c b/src/lib/efl/interfaces/efl_vpath_core.c
deleted file mode 100644
index d6b136374d..0000000000
--- a/src/lib/efl/interfaces/efl_vpath_core.c
+++ /dev/null
@@ -1,436 +0,0 @@
-#include "config.h"
-#include "Efl.h"
-
-#ifdef HAVE_GETPWENT
-# include <sys/types.h>
-# include <pwd.h>
-#endif
-
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#define MY_CLASS EFL_VPATH_CORE_CLASS
-
-typedef struct _Efl_Vpath_Core_Data Efl_Vpath_Core_Data;
-
-struct _Efl_Vpath_Core_Data
-{
- Eina_Spinlock lock;
- Eina_Hash *meta;
-};
-
-static Efl_Vpath_Core *vpath_core = NULL;
-
-EOLIAN static Efl_Object *
-_efl_vpath_core_efl_object_constructor(Eo *obj, Efl_Vpath_Core_Data *pd)
-{
- char buf[PATH_MAX], bufhome[PATH_MAX];
- const char *home, *s;
-
- if (vpath_core) return NULL;
- obj = efl_constructor(efl_super(obj, MY_CLASS));
- pd->meta = eina_hash_string_superfast_new
- ((Eina_Free_Cb)eina_stringshare_del);
- eina_spinlock_new(&(pd->lock));
-
- vpath_core = obj;
-
- // $HOME / ~/ etc.
- home = eina_environment_home_get();
- if (!home)
- {
- /* Windows does not have getuid(), but home can't be NULL */
-#ifdef HAVE_GETEUID
- uid_t uid = geteuid();
- struct stat st;
-
- snprintf(bufhome, sizeof(bufhome), "/tmp/%i", (int)uid);
- if (mkdir(bufhome, S_IRUSR | S_IWUSR | S_IXUSR) < 0)
- {
- if (errno != EEXIST)
- {
- if (stat("/tmp", &st) == 0) home = "/tmp";
- else home = "/";
- }
- }
- if (stat(bufhome, &st) == 0) home = bufhome;
- else
- {
- if (stat("/tmp", &st) == 0) home = "/tmp";
- else home = "/";
- }
-#else
- home = "/";
-#endif
- }
- efl_vpath_core_meta_set(obj, "home", home);
- // tmp dir - system wide
- s = eina_environment_tmp_get();
- efl_vpath_core_meta_set(obj, "tmp", s);
-
-# if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
-# define ENV_HOME_SET(_env, _dir, _meta) \
- if ((getuid() != geteuid()) || (!(s = getenv(_env)))) { \
- snprintf(buf, sizeof(buf), "%s/"_dir, home); s = buf; \
- } efl_vpath_core_meta_set(obj, _meta, s);
-#else
-# define ENV_HOME_SET(_env, _dir, _meta) \
- if (!(s = getenv(_env))) { \
- snprintf(buf, sizeof(buf), "%s/"_dir, home); s = buf; \
- } efl_vpath_core_meta_set(obj, _meta, s);
-#endif
- // $XDG_DATA_HOME defines the base directory relative to which user
- // specific data files should be stored. If $XDG_DATA_HOME is either
- // not set or empty, a default equal to $HOME/.local/share should be
- // used.
- ENV_HOME_SET("XDG_DATA_HOME", ".local/share", "data");
- // $XDG_CONFIG_HOME defines the base directory relative to which user
- // specific configuration files should be stored. If $XDG_CONFIG_HOME
- // is either not set or empty, a default equal to $HOME/.config should
- // be used.
- ENV_HOME_SET("XDG_CONFIG_HOME", ".config", "config");
- // $XDG_CACHE_HOME defines the base directory relative to which
- // user specific non-essential data files should be stored. If
- // $XDG_CACHE_HOME is either not set or empty, a default equal to
- // $HOME/.cache should be used.
- ENV_HOME_SET("XDG_CACHE_HOME", ".cache", "cache");
- // $XDG_RUNTIME_DIR defines the base directory relative to which
- // user-specific non-essential runtime files and other file objects
- // (such as sockets, named pipes, ...) should be stored. The
- // directory MUST be owned by the user, and he MUST be the only one
- // having read and write access to it. Its Unix access mode MUST
- // be 0700.
-#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
- if ((getuid() != geteuid()) || (!(s = getenv("XDG_RUNTIME_DIR"))))
-#else
- if (!(s = getenv("XDG_RUNTIME_DIR")))
-#endif
- {
- struct stat st;
- uid_t uid;
-
-#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
- uid = getuid();
- if (setuid(geteuid()) != 0)
- {
- fprintf(stderr,
- "FATAL: Cannot setuid - errno=%i\n",
- errno);
- abort();
- }
-#endif
- // fallback - make ~/.run
- snprintf(buf, sizeof(buf), "%s/.run", home);
- if (mkdir(buf, S_IRUSR | S_IWUSR | S_IXUSR) == 0) s = buf;
- else
- {
- if (errno == EEXIST)
- {
- if (stat(buf, &st) == 0)
- {
- // some sanity checks - but not for security
- if (!(st.st_mode & S_IFDIR))
- {
- // fatal - exists but is not a dir
- fprintf(stderr,
- "FATAL: run dir '%s' exists but not a dir\n",
- buf);
- abort();
- }
-#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
- if (st.st_uid != geteuid())
- {
- // fatal - run dir doesn't belong to user
- fprintf(stderr,
- "FATAL: run dir '%s' not owned by uid %i\n",
- buf, (int)geteuid());
- abort();
- }
-#endif
- // we're ok
- s = buf;
- }
- else
- {
- // fatal - we cant create our run dir in ~/
- fprintf(stderr,
- "FATAL: Cannot verify run dir '%s' errno=%i\n",
- buf, errno);
- abort();
- }
- }
- else
- {
- // fatal - we cant create our run dir in ~/
- fprintf(stderr,
- "FATAL: Cannot create run dir '%s' - errno=%i\n",
- buf, errno);
- abort();
- }
- }
-#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
- if (setreuid(uid, geteuid()) != 0)
- {
- fprintf(stderr,
- "FATAL: Cannot setreuid - errno=%i\n",
- errno);
- abort();
- };
-#endif
- }
- if (!s) s = (char *)efl_vpath_core_meta_get(obj, "tmp");
- efl_vpath_core_meta_set(obj, "run", s);
- // https://www.freedesktop.org/wiki/Software/xdg-user-dirs/
- // https://wiki.archlinux.org/index.php/Xdg_user_directories
- // ^^^^ we don't handle:
- // /etc/xdg/user-dirs.conf
- // /etc/xdg/user-dirs.defaults
- // (:config:)/user-dirs.conf
- // (:config:)/user-dirs.defaults
-
- // $XDG_DESKTOP_DIR="$HOME/Desktop"
- ENV_HOME_SET("XDG_DESKTOP_DIR", "Desktop", "desktop");
- // $XDG_DOCUMENTS_DIR="$HOME/Documents"
- ENV_HOME_SET("XDG_DOCUMENTS_DIR", "Documents", "documents");
- // $XDG_DOWNLOAD_DIR="$HOME/Downloads"
- ENV_HOME_SET("XDG_DOWNLOAD_DIR", "Downloads", "downloads");
- // $XDG_MUSIC_DIR="$HOME/Music"
- ENV_HOME_SET("XDG_MUSIC_DIR", "Music", "music");
- // $XDG_PICTURES_DIR="$HOME/Pictures"
- ENV_HOME_SET("XDG_PICTURES_DIR", "Pictures", "pictures");
- // $XDG_PUBLICSHARE_DIR="$HOME/Public"
- ENV_HOME_SET("XDG_PUBLIC_DIR", "Public", "public");
- // $XDG_TEMPLATES_DIR="$HOME/.Templates"
- ENV_HOME_SET("XDG_TEMPLATES_DIR", ".Templates", "templates");
- // $XDG_VIDEOS_DIR="$HOME/Videos"
- ENV_HOME_SET("XDG_VIDEOS_DIR", "Videos", "videos");
-
- // Add ~/Applications for user-installed apps
- ENV_HOME_SET("E_APPS_DIR", "Applications", "apps");
-
- // XXX: do the below ... later
- //
- // FHS FOR APP:
- // app.dir = PREFIX
- // app.bin = PREFIX/bin
- // app.lib = PREFIX/lib
- // app.data = PREFIX/share/APPNAME
- // app.locale = PREFIX/share/locale
- //
- // XXX: figure out how to merge these with XDG/FHS?
- // Tizen:
- // App Dir Structure:
- // bin Executable binary pathOwner: Read
- // lib Library pathOwner: Read
- // data Used to store private data of an application.
- // res Used to read resource files that are delivered with the application package.
- // shared Parent directory of the data, res, and trusted sub-directories. Files in this directory cannot be delivered with the application package.Owner: Read
- // shared/data Used to share data with other applications.
- // shared/res Used to share resources with other applications. The resource files are delivered with the application package.
- // shared/trusted Used to share data with family of trusted applications. The family applications signed with the same certificate can access data in the shared/trusted directory.
- //
- // XXX: figure out how to merge these with XDG?
- // Media/...vvv
- // Images Used for Image data.Read and Write
- // Sounds Used for Sound data.
- // Videos Used for Video data.
- // Cameras Used for Camera pictures.
- // Downloads Used for Downloaded data.
- // Music Used for Music data.
- // Documents Used for Documents.
- // Others Used for other types.
- // System Ringtones Used for System default ringtones.Read
- //
- // $TZ_SYS_HOME=/home
- // $TZ_SYS_DB=/var/db
- // $TZ_SYS_CONFIG=/var/kdb
- // $TZ_SYS_CONFIG_VOLATILE=/run/kdb
- // $TZ_SYS_APP=/usr/apps
- // $TZ_SYS_DESKTOP_APP=/usr/share/applications
- //
- // $TS_USER_DB=<user_homeid>/.tizen/db
- // $TZ_USER_CONFIG=<user_home_dir>/.tizen/kdb
- // $TZ_USER_APP=<user_home_dir>/.tizen/apps
- // $TZ_USER_DESKTOP_APP=<user_home_dir>/.tizen/desktop
- // $TZ_USER_DOCUMENTS=<user_home_dir>/Documents
- // $TZ_USER_PICTURES=<user_home_dir>/Pictures
- // $TZ_USER_VIDEOS=<user_home_dir>/Videos
- // $TZ_USER_MUSIC=<user_home_dir>/Music
- // $TZ_USER_DOWNLOADS=<user_home_dir>/Downloads
- // $TZ_USER_PUBLIC=<user_home_dir>/Public
- return obj;
-}
-
-EOLIAN static void
-_efl_vpath_core_efl_object_destructor(Eo *obj, Efl_Vpath_Core_Data *pd)
-{
- eina_hash_free(pd->meta);
- pd->meta = NULL;
- eina_spinlock_free(&(pd->lock));
- if (vpath_core == obj) vpath_core = NULL;
- efl_destructor(efl_super(obj, MY_CLASS));
-}
-
-EOLIAN static Efl_Vpath_Core *
-_efl_vpath_core_core_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
-{
- // no locks here as we expect efl to init this early in main "thread"
- if (!vpath_core) vpath_core = efl_add(EFL_VPATH_CORE_CLASS, NULL);
- return vpath_core;
-}
-
-EOLIAN static const char *
-_efl_vpath_core_meta_get(Eo *obj EINA_UNUSED, Efl_Vpath_Core_Data *pd, const char *key)
-{
- const char *meta;
-
- if (!key) return NULL;
- eina_spinlock_take(&(pd->lock));
- meta = eina_hash_find(pd->meta, key);
- eina_spinlock_release(&(pd->lock));
- return meta;
-}
-
-EOLIAN static void
-_efl_vpath_core_meta_set(Eo *obj EINA_UNUSED, Efl_Vpath_Core_Data *pd, const char *key, const char *path)
-{
- if (!key) return;
- eina_spinlock_take(&(pd->lock));
- if (path) eina_hash_add(pd->meta, key, eina_stringshare_add(path));
- else eina_hash_del(pd->meta, key, NULL);
- eina_spinlock_release(&(pd->lock));
-}
-
-EOLIAN static Efl_Vpath_File *
-_efl_vpath_core_efl_vpath_fetch(Eo *obj, Efl_Vpath_Core_Data *pd EINA_UNUSED, const char *path)
-{
- Efl_Vpath_File_Core *file;
-
- file = efl_add(EFL_VPATH_FILE_CORE_CLASS, obj);
- efl_vpath_file_path_set(file, path);
- // XXX: implement parse of path then look up in hash if not just create
- // object where path and result are the same and return that with
- // path set and result set to resolved path - return obj handler calls
- // "do" on object to get the result inside fetched or failed callback.
- // if it's a url then we need a new classs that overrides the do and
- // begins a fetch and on finish calls the event cb or when wait is called
- if (path)
- {
- /* FIXME: not working for WIndows */
- // /* <- full path
- if (path[0] == '/')
- {
- efl_vpath_file_result_set(file, path);
- return file;
- }
- // .*
- if (path[0] == '.')
- {
- // .[/]* <- current dir relative
- if ((path[1] == '/') || (path[1] == 0))
- {
- efl_vpath_file_result_set(file, path);
- return file;
- }
- // ..[/]* <- parent dir relative
- if ((path[1] == '.') && ((path[2] == '/') || (path[2] == 0)))
- {
- efl_vpath_file_result_set(file, path);
- return file;
- }
- }
- // ~* ...
- if (path[0] == '~')
- {
- // ~/ <- home directory
- if (path[1] == '/')
- {
- char buf[PATH_MAX];
- const char *home = efl_vpath_core_meta_get(obj, "home");
-
- if (home)
- {
- snprintf(buf, sizeof(buf), "%s%s", home, path + 1);
- efl_vpath_file_result_set(file, buf);
- return file;
- }
- }
-#ifdef HAVE_GETPWENT
- // ~username/ <- homedir of user "username"
- else
- {
- const char *p;
- struct passwd pwent, *pwent2 = NULL;
- char *name, buf[PATH_MAX], pwbuf[8129];
-
- for (p = path + 1; *p; p++)
- {
- if (*p =='/') break;
- }
- name = alloca(p - path);
- strncpy(name, path + 1, p - path - 1);
- name[p - path - 1] = 0;
- if (!getpwnam_r(name, &pwent, pwbuf, sizeof(pwbuf), &pwent2))
- {
- if ((pwent2) && (pwent.pw_dir))
- {
- snprintf(buf, sizeof(buf), "%s%s", pwent.pw_dir, p);
- efl_vpath_file_result_set(file, buf);
- return file;
- }
- }
- }
-#endif /* HAVE_GETPWENT */
- }
- // (:xxx:)/* ... <- meta hash table
- if ((path[0] == '(') && (path[1] == ':'))
- {
- const char *p, *meta;
- char *name, buf[PATH_MAX];
- Eina_Bool found = EINA_FALSE;
-
- for (p = path + 2; *p; p++)
- {
- if ((p[0] ==':') && (p[1] == ')') && (p[2] == '/'))
- {
- found = EINA_TRUE;
- break;
- }
- }
- if (found)
- {
- name = alloca(p - path);
- strncpy(name, path + 2, p - path - 2);
- name[p - path - 2] = 0;
- eina_spinlock_take(&(pd->lock));
- meta = eina_hash_find(pd->meta, name);
- eina_spinlock_release(&(pd->lock));
- if (meta)
- {
- snprintf(buf, sizeof(buf), "%s%s", meta, p + 2);
- efl_vpath_file_result_set(file, buf);
- return file;
- }
- }
- }
- // XXX: handle file:// urls locally...
- // XXX: if its a remote url or zip file etc. where we need to
- // keep tmp file around then we need to set keep to true
- // efl_vpath_file_keept_set(file, EINA_TRUE);
-
- // file:/// <- local file path uri
- // file://localhost/ <- local file path uri
- // file://hostname/ <- remove file path uri
- // XXX: %c4,%17,%fe etc. are bytes escaped
- // http://www.ietf.org/rfc/rfc2396.txt
- // http://www.ietf.org/rfc/rfc1738.txt
- // http://equinox-project.org/spec/file-uri-spec.txt
- // http://en.wikipedia.org/wiki/File_URI_scheme
- }
- return file;
-}
-
-#include "interfaces/efl_vpath_core.eo.c"
diff --git a/src/lib/efl/interfaces/efl_vpath_core.eo b/src/lib/efl/interfaces/efl_vpath_core.eo
deleted file mode 100644
index 0e238a02a9..0000000000
--- a/src/lib/efl/interfaces/efl_vpath_core.eo
+++ /dev/null
@@ -1,33 +0,0 @@
-class Efl.Vpath.Core (Efl.Object, Efl.Vpath)
-{
- [[ Core EFL implementation of a Vpath system
-
- @since 1.18
- ]]
- eo_prefix: efl_vpath_core;
- methods {
- core_get @class {
- [[ This gets the global EFL Core Vpath class - only 1 - singleton ]]
- return: Efl.Vpath.Core; [[ Get the singleton core vpath ]]
- }
- meta_set {
- [[ A Meta key is a mapping from a virtual path to a real one ]]
- params {
- key: string; [[ The magic path key being looked up ]]
- path: string; [[ The real path the key maps to ]]
- }
- }
- meta_get {
- [[ This returns the real path set for a Meta key, or NULL if not ]]
- params {
- key: string; [[ The magic path key being looked up ]]
- }
- return: string; [[Real file path]]
- }
- }
- implements {
- Efl.Object.constructor;
- Efl.Object.destructor;
- Efl.Vpath.fetch;
- }
-}
diff --git a/src/lib/efl/interfaces/efl_vpath_file.c b/src/lib/efl/interfaces/efl_vpath_file.c
deleted file mode 100644
index 3e098828ed..0000000000
--- a/src/lib/efl/interfaces/efl_vpath_file.c
+++ /dev/null
@@ -1,74 +0,0 @@
-#include "config.h"
-#include "Efl.h"
-
-#define MY_CLASS EFL_VPATH_FILE_CLASS
-
-typedef struct _Efl_Vpath_File_Data Efl_Vpath_File_Data;
-
-struct _Efl_Vpath_File_Data
-{
- const char *path;
- const char *result;
- Eina_Bool called : 1;
- Eina_Bool keep : 1;
-};
-
-EOLIAN static void
-_efl_vpath_file_path_set(Eo *obj EINA_UNUSED, Efl_Vpath_File_Data *pd, const char *path)
-{
- eina_stringshare_replace(&(pd->path), path);
-}
-
-EOLIAN static const char *
-_efl_vpath_file_path_get(Eo *obj EINA_UNUSED, Efl_Vpath_File_Data *pd)
-{
- return pd->path;
-}
-
-EOLIAN static void
-_efl_vpath_file_result_set(Eo *obj EINA_UNUSED, Efl_Vpath_File_Data *pd, const char *path)
-{
- eina_stringshare_replace(&(pd->result), path);
-}
-
-EOLIAN static const char *
-_efl_vpath_file_result_get(Eo *obj EINA_UNUSED, Efl_Vpath_File_Data *pd)
-{
- return pd->result;
-}
-
-EOLIAN static void
-_efl_vpath_file_keep_set(Eo *obj EINA_UNUSED, Efl_Vpath_File_Data *pd, Eina_Bool keep)
-{
- pd->keep = keep;
-}
-
-EOLIAN static Eina_Bool
-_efl_vpath_file_keep_get(Eo *obj EINA_UNUSED, Efl_Vpath_File_Data *pd)
-{
- return pd->keep;
-}
-
-EOLIAN static Eina_Bool
-_efl_vpath_file_do(Eo *obj EINA_UNUSED, Efl_Vpath_File_Data *pd)
-{
- if (pd->called) return EINA_FALSE;
- pd->called = EINA_TRUE;
- efl_event_callback_call(obj, EFL_VPATH_FILE_EVENT_FETCHED, NULL);
- return EINA_TRUE;
-}
-
-EOLIAN static void
-_efl_vpath_file_wait(Eo *obj EINA_UNUSED, Efl_Vpath_File_Data *pd EINA_UNUSED)
-{
- if (!pd->called)
- {
- pd->called = EINA_TRUE;
- if (pd->result)
- efl_event_callback_call(obj, EFL_VPATH_FILE_EVENT_FETCHED, NULL);
- else
- efl_event_callback_call(obj, EFL_VPATH_FILE_EVENT_FAILED, NULL);
- }
-}
-
-#include "interfaces/efl_vpath_file.eo.c"
diff --git a/src/lib/efl/interfaces/efl_vpath_file.eo b/src/lib/efl/interfaces/efl_vpath_file.eo
deleted file mode 100644
index 1568a3ea9c..0000000000
--- a/src/lib/efl/interfaces/efl_vpath_file.eo
+++ /dev/null
@@ -1,55 +0,0 @@
-class Efl.Vpath.File (Efl.Object)
-{
- [[ VPath File is an actual representation of a downloaded/mapped vpath file
-
- Keep this object around for as long as you need to use the file as it
- may have been downloaded and kept as a local temporary file and
- deletion may remove it.
-
- When you have a Vpath File object for the first time, call the do()
- method on it to actually begin/do the mapping. From here the
- fetched or failed event callbacks will be called, inside of which or
- afterwards you can fetch the resulting local file path by getting the
- result property.
-
- @since 1.18
- ]]
- eo_prefix: efl_vpath_file;
- methods {
- @property path {
- [[ The original source path provided to lookup/fetch from ]]
- set {}
- get {}
- values {
- path: string; [[ The input virtual path to a file ]]
- }
- }
- @property result {
- [[ The resulting real local file path to open/read ]]
- set {}
- get {}
- values {
- path: string; [[ The resulting destination file ]]
- }
- }
- @property keep {
- [[ If this object has to be kept for the usage of the result ]]
- set {}
- get {}
- values {
- keep: bool; [[ If the object neerds tobe kept around ]]
- }
- }
- do {
- [[ Actually begin the resolving here - emit event now or do later ]]
- return: bool; [[ Result callback already called ]]
- }
- wait {
- [[ If not fetched yet, wait until it is and call result cb ]]
- }
- }
- events {
- fetched; [[ File successfully mapped/fetched ]]
- failed; [[ File fetch or mapping failed ]]
- }
-}
diff --git a/src/lib/efl/interfaces/efl_vpath_file_core.c b/src/lib/efl/interfaces/efl_vpath_file_core.c
deleted file mode 100644
index e0328e7fb9..0000000000
--- a/src/lib/efl/interfaces/efl_vpath_file_core.c
+++ /dev/null
@@ -1,66 +0,0 @@
-#include "config.h"
-#include "Efl.h"
-
-#define MY_CLASS EFL_VPATH_FILE_CORE_CLASS
-
-typedef struct _Efl_Vpath_File_Core_Data Efl_Vpath_File_Core_Data;
-
-struct _Efl_Vpath_File_Core_Data
-{
- int dummy;
-};
-
-EOLIAN static Efl_Object *
-_efl_vpath_file_core_efl_object_constructor(Eo *obj, Efl_Vpath_File_Core_Data *pd)
-{
- obj = efl_constructor(efl_super(obj, MY_CLASS));
- pd->dummy = 0;
- return obj;
-}
-
-EOLIAN static void
-_efl_vpath_file_core_efl_object_destructor(Eo *obj, Efl_Vpath_File_Core_Data *pd)
-{
- pd->dummy = 0;
- efl_destructor(efl_super(obj, MY_CLASS));
-}
-
-EOLIAN static Eina_Bool
-_efl_vpath_file_core_efl_vpath_file_do(Eo *obj, Efl_Vpath_File_Core_Data *pd)
-{
- const char *path;
-
- if (efl_vpath_file_result_get(obj))
- return efl_vpath_file_do(efl_super(obj, MY_CLASS));
- // vpath core didn't find a match, so it'ss likely a protocol like
- // http:// etc. etc. so deal with that here
- path = efl_vpath_file_path_get(obj);
- if (path)
- {
- if ((!strncasecmp(path, "http://", 7)) ||
- (!strncasecmp(path, "https://", 8)))
- {
- // XXX: handle urls --- need a loop object
- }
- }
- // ...
- pd->dummy = 0;
-
- // not a magic path - just set result to path
- efl_vpath_file_result_set(obj, efl_vpath_file_path_get(obj));
- return efl_vpath_file_do(efl_super(obj, MY_CLASS));
-}
-
-EOLIAN static void
-_efl_vpath_file_core_efl_vpath_file_wait(Eo *obj, Efl_Vpath_File_Core_Data *pd)
-{
- if (efl_vpath_file_result_get(obj))
- {
- efl_vpath_file_do(efl_super(obj, MY_CLASS));
- return;
- }
- pd->dummy = 0;
- // XXX: not found yet, so do what is necessary
-}
-
-#include "interfaces/efl_vpath_file_core.eo.c"
diff --git a/src/lib/efl/interfaces/efl_vpath_file_core.eo b/src/lib/efl/interfaces/efl_vpath_file_core.eo
deleted file mode 100644
index 6a627f032e..0000000000
--- a/src/lib/efl/interfaces/efl_vpath_file_core.eo
+++ /dev/null
@@ -1,14 +0,0 @@
-class Efl.Vpath.File.Core (Efl.Vpath.File)
-{
- [[ Core EFL implementation of a Vpath File
-
- @since 1.18
- ]]
- eo_prefix: efl_vpath_file_core;
- implements {
- Efl.Object.constructor;
- Efl.Object.destructor;
- Efl.Vpath.File.do;
- Efl.Vpath.File.wait;
- }
-}
diff --git a/src/lib/efl/interfaces/efl_vpath_manager.c b/src/lib/efl/interfaces/efl_vpath_manager.c
deleted file mode 100644
index cae265c187..0000000000
--- a/src/lib/efl/interfaces/efl_vpath_manager.c
+++ /dev/null
@@ -1,88 +0,0 @@
-#include "config.h"
-#include "Efl.h"
-
-#define MY_CLASS EFL_VPATH_MANAGER_CLASS
-
-typedef struct _Efl_Vpath_Manager_Data Efl_Vpath_Manager_Data;
-typedef struct _Efl_Vpath_Manager_Entry Efl_Vpath_Manager_Entry;
-
-struct _Efl_Vpath_Manager_Data
-{
- Eina_List *list;
-};
-
-struct _Efl_Vpath_Manager_Entry
-{
- Efl_Vpath *vpath;
- int priority;
-};
-
-static Efl_Vpath_Manager_Data vpath_manager =
-{
- NULL
-};
-
-EOLIAN static Efl_Vpath_File *
-_efl_vpath_manager_fetch(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, const char *path)
-{
- Efl_Vpath_Manager_Entry *entry;
- Eina_List *l;
- Efl_Vpath_File *file;
-
- EINA_LIST_FOREACH(vpath_manager.list, l, entry)
- {
- file = efl_vpath_fetch(entry->vpath, path);
- if (file) return file;
- }
- file = efl_add(EFL_VPATH_FILE_CLASS, NULL);
- if (file)
- {
- efl_vpath_file_path_set(file, path);
- efl_vpath_file_result_set(file, path);
- }
- return file;
-}
-
-static int
-_register_sort_cb(Efl_Vpath_Manager_Entry *e1, Efl_Vpath_Manager_Entry *e2)
-{
- // sort higher numbers first in list
- return (e2->priority - e1->priority);
-}
-
-static void
-_cb_vpath_del(void *data, const Efl_Event *event)
-{
- efl_vpath_manager_unregister(EFL_VPATH_MANAGER_CLASS, event->object);
- efl_event_callback_del(event->object, EFL_EVENT_DEL, _cb_vpath_del, data);
-}
-
-EOLIAN static void
-_efl_vpath_manager_register(Eo *obj, void *pd EINA_UNUSED, int priority, Efl_Vpath *vpath)
-{
- Efl_Vpath_Manager_Entry *entry = malloc(sizeof(Efl_Vpath_Manager_Entry));
- entry->vpath = vpath;
- entry->priority = priority;
- efl_event_callback_add(vpath, EFL_EVENT_DEL, _cb_vpath_del, obj);
- vpath_manager.list = eina_list_sorted_insert
- (vpath_manager.list, EINA_COMPARE_CB(_register_sort_cb), entry);
-}
-
-EOLIAN static void
-_efl_vpath_manager_unregister(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Efl_Vpath *vpath)
-{
- Efl_Vpath_Manager_Entry *entry;
- Eina_List *l;
-
- EINA_LIST_FOREACH(vpath_manager.list, l, entry)
- {
- if (entry->vpath == vpath)
- {
- vpath_manager.list = eina_list_remove_list(vpath_manager.list, l);
- free(entry);
- return;
- }
- }
-}
-
-#include "interfaces/efl_vpath_manager.eo.c"
diff --git a/src/lib/efl/interfaces/efl_vpath_manager.eo b/src/lib/efl/interfaces/efl_vpath_manager.eo
deleted file mode 100644
index e2d301634b..0000000000
--- a/src/lib/efl/interfaces/efl_vpath_manager.eo
+++ /dev/null
@@ -1,30 +0,0 @@
-class Efl.Vpath.Manager (Efl.Object)
-{
- [[ Vpath Manager manages multiple VPath objects that remap/download
-
- @since 1.18
- ]]
- eo_prefix: efl_vpath_manager;
- methods {
- fetch @class {
- [[ This class function fetches a Vpath File given an input path ]]
- params {
- path: string; [[ The input virtual file path to fetch ]]
- }
- return: Efl.Vpath.File @owned; [[ An object representing the file ]]
- }
- register @class {
- [[Register a vpath with the manager ]]
- params {
- priority: int; [[ Search order - higher values tried first ]]
- vpath: Efl.Vpath @nonull; [[ A Vpath implementation object ]]
- }
- }
- unregister @class {
- [[ Unregister a vpath from the manager ]]
- params {
- vpath: Efl.Vpath @nonull; [[ A Vpath implementation object ]]
- }
- }
- }
-}
diff --git a/src/lib/efl_mono/efl_custom_exports_mono.c b/src/lib/efl_mono/efl_custom_exports_mono.c
index ac38ac7fa9..246a7bcf71 100644
--- a/src/lib/efl_mono/efl_custom_exports_mono.c
+++ b/src/lib/efl_mono/efl_custom_exports_mono.c
@@ -27,6 +27,11 @@ EAPI void *efl_mono_native_alloc(unsigned int size)
return malloc(size);
}
+EAPI void efl_mono_native_memset(void *ptr, unsigned int fill, unsigned int count)
+{
+ memset(ptr, fill, count);
+}
+
EAPI void efl_mono_native_free(void *ptr)
{
free(ptr);
@@ -313,6 +318,9 @@ EAPI const Eina_Value_Type *type_array() {
EAPI const Eina_Value_Type *type_list() {
return EINA_VALUE_TYPE_LIST;
}
+EAPI const Eina_Value_Type *type_error() {
+ return EINA_VALUE_TYPE_ERROR;
+}
EAPI const Eina_Value_Type *type_optional() {
return EINA_VALUE_TYPE_OPTIONAL;
@@ -354,6 +362,11 @@ EAPI void eina_value_flush_wrapper(Eina_Value *value)
EAPI const Eina_Value_Type *eina_value_type_get_wrapper(const Eina_Value *value)
{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(value, NULL);
+
+ // Can't pass null value type (for Empty values) to value_type_get.
+ if (value->type == NULL)
+ return NULL;
return eina_value_type_get(value);
}
diff --git a/src/lib/efl_wl/Efl_Wl.h b/src/lib/efl_wl/Efl_Wl.h
index c6af024105..9124926373 100644
--- a/src/lib/efl_wl/Efl_Wl.h
+++ b/src/lib/efl_wl/Efl_Wl.h
@@ -9,32 +9,20 @@
# undef EAPI
#endif
-#ifdef _WIN32
-# ifdef EFL_EINA_BUILD
-# ifdef DLL_EXPORT
-# define EAPI __declspec(dllexport)
-# else
-# define EAPI
-# endif /* ! DLL_EXPORT */
-# else
-# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EINA_BUILD */
-#else
-# ifdef __GNUC__
-# if __GNUC__ >= 4
-# define EAPI __attribute__ ((visibility("default")))
-# else
-# define EAPI
-# endif
+#ifdef __GNUC__
+# if __GNUC__ >= 4
+# define EAPI __attribute__ ((visibility("default")))
# else
# define EAPI
# endif
+#else
+# define EAPI
#endif
/**
* @defgroup Efl_Wl_Group EFL Wayland
*
- * A multiseat Wayland compositor in an Evas object.
+ * A multiseat xdg-shell compliant Wayland compositor in an Evas object.
* All toplevel windows will be sized to the size of the compositor object.
* @since 1.20
* @{
@@ -55,6 +43,11 @@ typedef enum
/**
* Add a compositor widget to the given canvas.
*
+ * The following smart callbacks will trigger on the compositor object:
+ * "child_added" - A toplevel surface with a parent has been added; event info is Evas_Object *surface
+ * "popup_added" - A popup surface has been added; event info is Evas_Object *surface
+ * "seat_added" - A compositor seat has been added; event info is Eo *dev
+ *
* @param e The canvas
* @return The compositor object, @c NULL on failure
*/
@@ -73,6 +66,37 @@ EAPI Evas_Object *efl_wl_add(Evas *e);
EAPI Ecore_Exe *efl_wl_run(Evas_Object *obj, const char *cmd);
/**
+ * Run a command in the compositor widget with specified flags.
+ *
+ * @note If GL is available, the ELM_ACCEL environment variable will be
+ * set to "gl" while executing the command.
+ *
+ * @param obj The compositor widget
+ * @param cmd The command to run
+ * @param flags The flags to use
+ * @return The Ecore_Exe from the executed process, @c NULL on failure
+ */
+Ecore_Exe *efl_wl_flags_run(Evas_Object *obj, const char *cmd, Ecore_Exe_Flags flags);
+
+/**
+ * Add a process to the list of allowed clients for the compositor widget
+ *
+ * @param obj The compositor widget
+ * @param pid The process to allow
+ * @since 1.21
+ */
+EAPI void efl_wl_pid_add(Evas_Object *obj, int32_t pid);
+
+/**
+ * Remove a process from the list of allowed clients for the compositor widget
+ *
+ * @param obj The compositor widget
+ * @param pid The process to deny
+ * @since 1.21
+ */
+EAPI void efl_wl_pid_del(Evas_Object *obj, int32_t pid);
+
+/**
* Put the bottom-most toplevel window on top and apply focus to it
*
* @param obj The compositor widget
@@ -158,7 +182,7 @@ EAPI Eina_Bool efl_wl_surface_extract(Evas_Object *surface);
EAPI Evas_Object *efl_wl_extracted_surface_object_find(void *surface_resource);
/**
- * Get the Evas_Object for an extracted surface's parent
+ * Get the Evas_Object for an extracted surface's parent, or NULL if the parent is not extracted
*
* @note Passing anything other than a valid, extracted surface guarantees a crash.
*
@@ -167,6 +191,33 @@ EAPI Evas_Object *efl_wl_extracted_surface_object_find(void *surface_resource);
* @since 1.21
*/
EAPI Evas_Object *efl_wl_extracted_surface_extracted_parent_get(Evas_Object *surface);
+
+/**
+ * Set external xkbcommon resources to be used read-only by the compositor object
+ *
+ * Use this function if you have available the necessary xkbcommon objects which are used
+ * to handle keyboard states in a compositor. The passed objects will not be modified or copied,
+ * so this function must be called again in the case that the compositor widget outlives the
+ * lifetime of any of the passed pointers.
+ *
+ * @param obj The compositor widget
+ * @param seat The seat to set the keymap for, NULL to set the keymap for all seats
+ * @param keymap The xkb_keymap object to use
+ * @param state The xkb_state object to use
+ * @param fd The fd created from a mmapped xkb_keymap
+ * @param size The size of the xkb_keymap memory
+ * @param wl_key_array A pointer to the wl_array in which keys are stored
+ * @since 1.21
+ */
+EAPI void efl_wl_seat_keymap_set(Evas_Object *obj, Eo *seat, void *state, int fd, size_t size, void *wl_key_array);
+
+/**
+ * Set the key repeat rate for a seat in the compositor
+ *
+ * @param obj The compositor widget
+ * @since 1.21
+ */
+EAPI void efl_wl_seat_key_repeat_set(Evas_Object *obj, Eo *seat, int repeat_rate, int repeat_delay);
#endif
#endif
diff --git a/src/lib/efl_wl/copiedfromweston.x b/src/lib/efl_wl/copiedfromweston.x
index 0b1388b064..d5c35eee75 100644
--- a/src/lib/efl_wl/copiedfromweston.x
+++ b/src/lib/efl_wl/copiedfromweston.x
@@ -318,6 +318,7 @@ drag_grab_button(Comp_Seat *s,
{
Comp_Data_Device_Source *data_source = s->drag.source;
enum wl_pointer_button_state state = state_w;
+ struct wl_resource *res;
if (data_source &&
s->drag.id == button &&
@@ -328,8 +329,12 @@ drag_grab_button(Comp_Seat *s,
data_source->current_dnd_action)
{
if (s->drag.enter)
- wl_data_device_send_drop(data_device_find(s, s->drag.enter->res));
+ {
+ res = data_device_find(s, s->drag.enter->res);
+ if (!res) return;
+ wl_data_device_send_drop(res);
+ }
if (wl_resource_get_version(data_source->res) >=
WL_DATA_SOURCE_DND_DROP_PERFORMED_SINCE_VERSION)
wl_data_source_send_dnd_drop_performed(data_source->res);
@@ -356,3 +361,53 @@ drag_grab_button(Comp_Seat *s,
#endif
}
}
+
+#ifdef HAVE_ECORE_X
+static xkb_mod_index_t x11_kbd_shift_mod;
+static xkb_mod_index_t x11_kbd_caps_mod;
+static xkb_mod_index_t x11_kbd_ctrl_mod;
+static xkb_mod_index_t x11_kbd_alt_mod;
+static xkb_mod_index_t x11_kbd_mod2_mod;
+static xkb_mod_index_t x11_kbd_mod3_mod;
+static xkb_mod_index_t x11_kbd_super_mod;
+static xkb_mod_index_t x11_kbd_mod5_mod;
+
+static void
+keymap_mods_init(struct xkb_keymap *keymap)
+{
+ x11_kbd_shift_mod = xkb_keymap_mod_get_index(keymap, XKB_MOD_NAME_SHIFT);
+ x11_kbd_caps_mod = xkb_keymap_mod_get_index(keymap, XKB_MOD_NAME_CAPS);
+ x11_kbd_ctrl_mod = xkb_keymap_mod_get_index(keymap, XKB_MOD_NAME_CTRL);
+ x11_kbd_alt_mod = xkb_keymap_mod_get_index(keymap, XKB_MOD_NAME_ALT);
+ x11_kbd_mod2_mod = xkb_keymap_mod_get_index(keymap, "Mod2");
+ x11_kbd_mod3_mod = xkb_keymap_mod_get_index(keymap, "Mod3");
+ x11_kbd_super_mod = xkb_keymap_mod_get_index(keymap, XKB_MOD_NAME_LOGO);
+ x11_kbd_mod5_mod = xkb_keymap_mod_get_index(keymap, "Mod5");
+}
+
+static uint32_t
+get_xkb_mod_mask(uint32_t in)
+{
+ uint32_t ret = 0;
+
+ if ((in & ECORE_X_MODIFIER_SHIFT) && x11_kbd_shift_mod != XKB_MOD_INVALID)
+ ret |= (1 << x11_kbd_shift_mod);
+ if ((in & ECORE_X_LOCK_CAPS) && x11_kbd_caps_mod != XKB_MOD_INVALID)
+ ret |= (1 << x11_kbd_caps_mod);
+ if ((in & ECORE_X_MODIFIER_CTRL) && x11_kbd_ctrl_mod != XKB_MOD_INVALID)
+ ret |= (1 << x11_kbd_ctrl_mod);
+ if ((in & ECORE_X_MODIFIER_ALT) && x11_kbd_alt_mod != XKB_MOD_INVALID)
+ ret |= (1 << x11_kbd_alt_mod);
+ if ((in & ECORE_X_LOCK_NUM) && x11_kbd_mod2_mod != XKB_MOD_INVALID)
+ ret |= (1 << x11_kbd_mod2_mod);
+ if ((in & ECORE_X_LOCK_SCROLL) && x11_kbd_mod3_mod != XKB_MOD_INVALID)
+ ret |= (1 << x11_kbd_mod3_mod);
+ if ((in & ECORE_X_MODIFIER_WIN) && x11_kbd_super_mod != XKB_MOD_INVALID)
+ ret |= (1 << x11_kbd_super_mod);
+ if ((in & ECORE_X_MODIFIER_ALTGR) && x11_kbd_mod5_mod != XKB_MOD_INVALID)
+ ret |= (1 << x11_kbd_mod5_mod);
+
+ return ret;
+}
+
+#endif
diff --git a/src/lib/efl_wl/efl_wl.c b/src/lib/efl_wl/efl_wl.c
index 0943dbe3f8..0da7d8c374 100644
--- a/src/lib/efl_wl/efl_wl.c
+++ b/src/lib/efl_wl/efl_wl.c
@@ -26,7 +26,7 @@
* the opaque struct client side.
*/
#include <wayland-server.h>
-#include "xdg-shell-unstable-v6-server-protocol.h"
+#include "xdg-shell-server-protocol.h"
#include "efl-hints-server-protocol.h"
#include "dmabuf.h"
@@ -193,6 +193,7 @@ typedef struct Comp_Seat
struct
{
struct wl_array keys;
+ struct wl_array *keys_external;
struct
{
xkb_mod_mask_t depressed;
@@ -211,6 +212,7 @@ typedef struct Comp_Seat
int repeat_delay;
Eina_Hash *resources;
Comp_Surface *enter;
+ Eina_Bool external : 1;
} kbd;
struct
@@ -249,6 +251,7 @@ typedef struct Comp_Seat
Eina_Bool focused : 1;
Eina_Bool selection_changed : 1;
Eina_Bool selection_exists : 1;
+ Eina_Bool event_propagate : 1;
} Comp_Seat;
typedef struct Comp_Buffer_State
@@ -281,9 +284,9 @@ typedef struct Shell_Positioner
struct wl_resource *res;
Evas_Coord_Size size;
Eina_Rectangle anchor_rect;
- enum zxdg_positioner_v6_anchor anchor;
- enum zxdg_positioner_v6_gravity gravity;
- enum zxdg_positioner_v6_constraint_adjustment constrain;
+ enum xdg_positioner_anchor anchor;
+ enum xdg_positioner_gravity gravity;
+ enum xdg_positioner_constraint_adjustment constrain;
Evas_Coord_Point offset;
} Shell_Positioner;
@@ -631,6 +634,7 @@ static void
comp_surface_proxy_win_del(Ecore_Evas *ee)
{
Comp_Seat *s = ecore_evas_data_get(ee, "comp_seat");
+ if (!s) return;
s->drag.proxy_win = NULL;
//fprintf(stderr, "PROXY WIN DEL\n");
@@ -734,19 +738,19 @@ resource_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resou
static int
_apply_positioner_x(int x, Shell_Positioner *sp, Eina_Bool invert)
{
- enum zxdg_positioner_v6_anchor an = ZXDG_POSITIONER_V6_ANCHOR_NONE;
- enum zxdg_positioner_v6_gravity grav = ZXDG_POSITIONER_V6_GRAVITY_NONE;
+ enum xdg_positioner_anchor an = XDG_POSITIONER_ANCHOR_NONE;
+ enum xdg_positioner_gravity grav = XDG_POSITIONER_GRAVITY_NONE;
if (invert)
{
- if (sp->anchor & ZXDG_POSITIONER_V6_ANCHOR_LEFT)
- an |= ZXDG_POSITIONER_V6_ANCHOR_RIGHT;
- else if (sp->anchor & ZXDG_POSITIONER_V6_ANCHOR_RIGHT)
- an |= ZXDG_POSITIONER_V6_ANCHOR_LEFT;
- if (sp->gravity & ZXDG_POSITIONER_V6_GRAVITY_LEFT)
- grav |= ZXDG_POSITIONER_V6_GRAVITY_RIGHT;
- else if (sp->gravity & ZXDG_POSITIONER_V6_GRAVITY_RIGHT)
- grav |= ZXDG_POSITIONER_V6_GRAVITY_LEFT;
+ if (sp->anchor == XDG_POSITIONER_ANCHOR_LEFT)
+ an = XDG_POSITIONER_ANCHOR_RIGHT;
+ else if (sp->anchor == XDG_POSITIONER_ANCHOR_RIGHT)
+ an = XDG_POSITIONER_ANCHOR_LEFT;
+ if (sp->gravity & XDG_POSITIONER_GRAVITY_LEFT)
+ grav |= XDG_POSITIONER_GRAVITY_RIGHT;
+ else if (sp->gravity & XDG_POSITIONER_GRAVITY_RIGHT)
+ grav |= XDG_POSITIONER_GRAVITY_LEFT;
}
else
{
@@ -755,20 +759,20 @@ _apply_positioner_x(int x, Shell_Positioner *sp, Eina_Bool invert)
}
/* left edge */
- if (an & ZXDG_POSITIONER_V6_ANCHOR_LEFT)
+ if (an == XDG_POSITIONER_ANCHOR_LEFT)
x += sp->anchor_rect.x;
/* right edge */
- else if (an & ZXDG_POSITIONER_V6_ANCHOR_RIGHT)
+ else if (an == XDG_POSITIONER_ANCHOR_RIGHT)
x += sp->anchor_rect.x + sp->anchor_rect.w;
/* center */
else
x += sp->anchor_rect.x + (sp->anchor_rect.w / 2);
/* flip left over anchor */
- if (grav & ZXDG_POSITIONER_V6_GRAVITY_LEFT)
+ if (grav & XDG_POSITIONER_GRAVITY_LEFT)
x -= sp->size.w;
/* center on anchor */
- else if (!(grav & ZXDG_POSITIONER_V6_GRAVITY_RIGHT))
+ else if (!(grav & XDG_POSITIONER_GRAVITY_RIGHT))
x -= sp->size.w / 2;
return x;
}
@@ -776,19 +780,19 @@ _apply_positioner_x(int x, Shell_Positioner *sp, Eina_Bool invert)
static int
_apply_positioner_y(int y, Shell_Positioner *sp, Eina_Bool invert)
{
- enum zxdg_positioner_v6_anchor an = ZXDG_POSITIONER_V6_ANCHOR_NONE;
- enum zxdg_positioner_v6_gravity grav = ZXDG_POSITIONER_V6_GRAVITY_NONE;
+ enum xdg_positioner_anchor an = XDG_POSITIONER_ANCHOR_NONE;
+ enum xdg_positioner_gravity grav = XDG_POSITIONER_GRAVITY_NONE;
if (invert)
{
- if (sp->anchor & ZXDG_POSITIONER_V6_ANCHOR_TOP)
- an |= ZXDG_POSITIONER_V6_ANCHOR_BOTTOM;
- else if (sp->anchor & ZXDG_POSITIONER_V6_ANCHOR_BOTTOM)
- an |= ZXDG_POSITIONER_V6_ANCHOR_TOP;
- if (sp->gravity & ZXDG_POSITIONER_V6_GRAVITY_TOP)
- grav |= ZXDG_POSITIONER_V6_GRAVITY_BOTTOM;
- else if (sp->gravity & ZXDG_POSITIONER_V6_GRAVITY_BOTTOM)
- grav |= ZXDG_POSITIONER_V6_GRAVITY_TOP;
+ if (sp->anchor == XDG_POSITIONER_ANCHOR_TOP)
+ an = XDG_POSITIONER_ANCHOR_BOTTOM;
+ else if (sp->anchor == XDG_POSITIONER_ANCHOR_BOTTOM)
+ an = XDG_POSITIONER_ANCHOR_TOP;
+ if (sp->gravity & XDG_POSITIONER_GRAVITY_TOP)
+ grav |= XDG_POSITIONER_GRAVITY_BOTTOM;
+ else if (sp->gravity & XDG_POSITIONER_GRAVITY_BOTTOM)
+ grav |= XDG_POSITIONER_GRAVITY_TOP;
}
else
{
@@ -797,20 +801,20 @@ _apply_positioner_y(int y, Shell_Positioner *sp, Eina_Bool invert)
}
/* up edge */
- if (an & ZXDG_POSITIONER_V6_ANCHOR_TOP)
+ if (an == XDG_POSITIONER_ANCHOR_TOP)
y += sp->anchor_rect.y;
/* bottom edge */
- else if (an & ZXDG_POSITIONER_V6_ANCHOR_BOTTOM)
+ else if (an == XDG_POSITIONER_ANCHOR_BOTTOM)
y += sp->anchor_rect.y + sp->anchor_rect.h;
/* center */
else
y += sp->anchor_rect.y + (sp->anchor_rect.h / 2);
/* flip up over anchor */
- if (grav & ZXDG_POSITIONER_V6_GRAVITY_TOP)
+ if (grav & XDG_POSITIONER_GRAVITY_TOP)
y -= sp->size.h;
/* center on anchor */
- else if (!(grav & ZXDG_POSITIONER_V6_GRAVITY_BOTTOM))
+ else if (!(grav & XDG_POSITIONER_GRAVITY_BOTTOM))
y -= sp->size.h / 2;
return y;
}
@@ -823,19 +827,19 @@ _apply_positioner_slide(Comp_Surface *cs, Shell_Positioner *sp, int *x, int *y,
evas_object_geometry_get(cs->parent->obj, &px, &py, NULL, NULL);
evas_object_geometry_get(cs->c->obj, &cx, &cy, NULL, NULL);
px -= cx, py -= cy;
- if ((sp->constrain & ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_X) &&
+ if ((sp->constrain & XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_X) &&
(!CONTAINS(zx, zy, zw, zh, *x, zy, *w, 1)))
{
int sx = *x;
- if (sp->gravity & ZXDG_POSITIONER_V6_GRAVITY_LEFT)
+ if (sp->gravity & XDG_POSITIONER_GRAVITY_LEFT)
{
if (*x + *w > zx + zw)
sx = MAX(zx + zw - *w, px + sp->anchor_rect.x - *w);
else if (*x < zx)
sx = MIN(zx, px + sp->anchor_rect.x + sp->anchor_rect.w);
}
- else if (sp->gravity & ZXDG_POSITIONER_V6_GRAVITY_RIGHT)
+ else if (sp->gravity & XDG_POSITIONER_GRAVITY_RIGHT)
{
if (*x < zx)
sx = MIN(zx, *x + sp->anchor_rect.x + sp->anchor_rect.w);
@@ -846,19 +850,19 @@ _apply_positioner_slide(Comp_Surface *cs, Shell_Positioner *sp, int *x, int *y,
*x = sx;
}
if (!CONSTRAINED(*w, *h, *x, *y)) return EINA_TRUE;
- if ((sp->constrain & ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_Y) &&
+ if ((sp->constrain & XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_Y) &&
(!CONTAINS(zx, zy, zw, zh, zx, *y, 1, *h)))
{
int sy = *y;
- if (sp->gravity & ZXDG_POSITIONER_V6_GRAVITY_TOP)
+ if (sp->gravity & XDG_POSITIONER_GRAVITY_TOP)
{
if (*y + *h > zy + zh)
sy = MAX(zy + zh - *h, py + sp->anchor_rect.y - *h);
else if (*y < zy)
sy = MIN(zy, py + sp->anchor_rect.y + sp->anchor_rect.h);
}
- else if (sp->gravity & ZXDG_POSITIONER_V6_GRAVITY_BOTTOM)
+ else if (sp->gravity & XDG_POSITIONER_GRAVITY_BOTTOM)
{
if (*y < zy)
sy = MIN(zy, py + sp->anchor_rect.y + sp->anchor_rect.h);
@@ -913,7 +917,7 @@ _apply_positioner(Comp_Surface *cs, Shell_Positioner *sp)
- slide
- resize
*/
- if ((sp->constrain & ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_FLIP_X) &&
+ if ((sp->constrain & XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_X) &&
(!CONTAINS(zx, zy, zw, zh, x, zy, w, 1)))
{
int fx;
@@ -928,7 +932,7 @@ _apply_positioner(Comp_Surface *cs, Shell_Positioner *sp)
if (w > 0) evas_object_resize(cs->obj, w, h);
return;
}
- if ((sp->constrain & ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_FLIP_Y) &&
+ if ((sp->constrain & XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_Y) &&
(!CONTAINS(zx, zy, zw, zh, zx, y, 1, h)))
{
int fy;
@@ -957,7 +961,7 @@ _apply_positioner(Comp_Surface *cs, Shell_Positioner *sp)
return;
}
- if ((sp->constrain & ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_X) &&
+ if ((sp->constrain & XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_RESIZE_X) &&
(!CONTAINS(zx, zy, zw, zh, x, zy, w, 1)))
{
w = zx + zw - x;
@@ -968,7 +972,7 @@ _apply_positioner(Comp_Surface *cs, Shell_Positioner *sp)
return;
}
}
- if ((sp->constrain & ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_Y) &&
+ if ((sp->constrain & XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_RESIZE_Y) &&
(!CONTAINS(zx, zy, zw, zh, zx, y, 1, h)))
{
h = zy + zh - y;
@@ -1030,7 +1034,7 @@ comp_seat_send_modifiers(Comp_Seat *s, struct wl_resource *res, uint32_t serial)
s->kbd.mods.latched,
s->kbd.mods.locked,
s->kbd.mods.group);
- s->kbd.mods.changed = 1;
+ s->kbd.mods.changed = 0;
}
static Eina_Bool
@@ -1104,11 +1108,13 @@ comp_seats_redo_enter(Comp *c, Comp_Surface *cs)
{
Eina_List *l, *ll;
struct wl_resource *res;
- if (c->active_surface && (cs != c->active_surface))
+ Eina_Bool same = s->kbd.enter == cs;
+
+ if (c->active_surface && s->kbd.enter && (!same))
{
l = seat_kbd_active_resources_get(s);
EINA_LIST_FOREACH(l, ll, res)
- wl_keyboard_send_leave(res, serial, c->active_surface->res);
+ wl_keyboard_send_leave(res, serial, s->kbd.enter->res);
}
s->active_client = client;
if (cs)
@@ -1116,12 +1122,13 @@ comp_seats_redo_enter(Comp *c, Comp_Surface *cs)
l = seat_kbd_active_resources_get(s);
EINA_LIST_FOREACH(l, ll, res)
{
- wl_keyboard_send_enter(res, serial, cs->res, &s->kbd.keys);
+ if (!same)
+ wl_keyboard_send_enter(res, serial, cs->res, &s->kbd.keys);
comp_seat_send_modifiers(s, res, serial);
}
}
s->kbd.enter = cs;
- if (s->kbd.enter && s->selection_source)
+ if (s->kbd.enter && s->selection_source && (!same))
comp_seat_kbd_data_device_enter(s);
}
c->active_surface = cs;
@@ -1146,12 +1153,12 @@ static void
shell_surface_activate_recurse(Comp_Surface *cs)
{
Comp_Surface *lcs, *parent = cs->parent;
- Eina_List *l, *parents = NULL;
+ Eina_List *parents = NULL;
Eina_Inlist *i;
if (parent)
{
- /* apply focus to toplevel in case where focus is reverted */
+ /* remove focus from parents */
while (parent)
{
parents = eina_list_append(parents, parent);
@@ -1169,14 +1176,6 @@ shell_surface_activate_recurse(Comp_Surface *cs)
cs->c->surfaces = eina_inlist_promote(cs->c->surfaces, EINA_INLIST_GET(lcs));
}
}
- /* last item is the toplevel */
- EINA_LIST_REVERSE_FOREACH(parents, l, lcs)
- {
- if (lcs->shell.activated) continue;
- lcs->shell.activated = 1;
- if (!lcs->shell.popup)
- shell_surface_send_configure(lcs);
- }
eina_list_free(parents);
}
@@ -1225,17 +1224,17 @@ shell_surface_send_configure(Comp_Surface *cs)
evas_object_geometry_get(cs->obj, &x, &y, &w, &h);
evas_object_geometry_get(cs->parent->obj, &px, &py, NULL, NULL);
serial = wl_display_next_serial(cs->c->display);
- zxdg_popup_v6_send_configure(cs->role, x - px, y - py, w, h);
- zxdg_surface_v6_send_configure(cs->shell.surface, serial);
+ xdg_popup_send_configure(cs->role, x - px, y - py, w, h);
+ xdg_surface_send_configure(cs->shell.surface, serial);
return;
}
wl_array_init(&states);
s = wl_array_add(&states, sizeof(uint32_t));
- *s = ZXDG_TOPLEVEL_V6_STATE_FULLSCREEN;
+ *s = XDG_TOPLEVEL_STATE_FULLSCREEN;
if (cs->shell.activated)
{
s = wl_array_add(&states, sizeof(uint32_t));
- *s = ZXDG_TOPLEVEL_V6_STATE_ACTIVATED;
+ *s = XDG_TOPLEVEL_STATE_ACTIVATED;
if (!cs->extracted)
evas_object_raise(cs->obj);
if (cs->parent)
@@ -1249,19 +1248,23 @@ shell_surface_send_configure(Comp_Surface *cs)
evas_object_geometry_get(cs->obj, NULL, NULL, &w, &h);
else
evas_object_geometry_get(cs->c->clip, NULL, NULL, &w, &h);
- zxdg_toplevel_v6_send_configure(cs->role, w, h, &states);
- zxdg_surface_v6_send_configure(cs->shell.surface, serial);
+ xdg_toplevel_send_configure(cs->role, w, h, &states);
+ xdg_surface_send_configure(cs->shell.surface, serial);
wl_array_release(&states);
if (cs->shell.activated)
{
Comp_Surface *ccs;
- comp_seats_redo_enter(cs->c, cs);
+ /* apply activation to already-mapped surface */
+ if (cs->mapped)
+ {
+ comp_seats_redo_enter(cs->c, cs);
+ shell_surface_aspect_update(cs);
+ shell_surface_minmax_update(cs);
+ }
EINA_INLIST_FOREACH(cs->children, ccs)
if (ccs->shell.surface && ccs->role && ccs->shell.popup)
ccs->shell.activated = cs->shell.activated;
- shell_surface_aspect_update(cs);
- shell_surface_minmax_update(cs);
}
else
shell_surface_deactivate_recurse(cs);
@@ -1285,6 +1288,17 @@ shell_surface_init(Comp_Surface *cs)
}
static void
+comp_surface_output_leave(Comp_Surface *cs)
+{
+ Eina_List *l;
+ struct wl_resource *res;
+
+ EINA_LIST_FOREACH(cs->c->output_resources, l, res)
+ if (wl_resource_get_client(res) == wl_resource_get_client(cs->res))
+ wl_surface_send_leave(cs->res, res);
+}
+
+static void
comp_surface_output_enter(Comp_Surface *cs)
{
Eina_List *l;
@@ -1369,6 +1383,8 @@ comp_surface_commit_image_state(Comp_Surface *cs, Comp_Buffer *buffer, Evas_Obje
ns.data.wl_dmabuf.attr = &buffer->dmabuf_buffer->attributes;
ns.data.wl_dmabuf.resource = buffer->res;
+ ns.data.wl_dmabuf.scanout.handler = NULL;
+ ns.data.wl_dmabuf.scanout.data = NULL;
}
else
{
@@ -1381,12 +1397,22 @@ comp_surface_commit_image_state(Comp_Surface *cs, Comp_Buffer *buffer, Evas_Obje
}
static void
+shell_surface_reset(Comp_Surface *cs)
+{
+ EINA_RECTANGLE_SET(&cs->shell.geom, 0, 0, 0, 0);
+ eina_stringshare_replace(&cs->shell.title, NULL);
+ eina_stringshare_replace(&cs->shell.app_id, NULL);
+ cs->shell.activated = 0;
+}
+
+static void
comp_surface_commit_state(Comp_Surface *cs, Comp_Buffer_State *state)
{
int x, y;
Eina_List *l;
Evas_Object *o;
Comp_Buffer *buffer = NULL;
+ Eina_Bool newly_new = EINA_FALSE;
if (state->attach)
{
@@ -1403,17 +1429,31 @@ comp_surface_commit_state(Comp_Surface *cs, Comp_Buffer_State *state)
}
else
{
- evas_object_hide(cs->obj);
+ if (!cs->extracted)
+ evas_object_hide(cs->obj);
EINA_LIST_FOREACH(cs->proxies, l, o)
evas_object_hide(o);
+ if (cs->shell.surface)
+ {
+ cs->shell.new = 1;
+ newly_new = EINA_TRUE;
+ shell_surface_reset(cs);
+ }
}
}
evas_object_geometry_get(cs->obj, &x, &y, NULL, NULL);
if (buffer && (!cs->mapped))
{
- if (cs->role)
+ if (cs->role && (!cs->extracted))
evas_object_show(cs->obj);
+ /* apply activation to activated surface on map */
+ if (cs->role && cs->shell.surface && cs->shell.activated && (!cs->shell.popup))
+ {
+ comp_seats_redo_enter(cs->c, cs);
+ shell_surface_aspect_update(cs);
+ shell_surface_minmax_update(cs);
+ }
}
if (state->attach && state->buffer)
@@ -1421,7 +1461,7 @@ comp_surface_commit_state(Comp_Surface *cs, Comp_Buffer_State *state)
evas_object_move(cs->img, x + buffer->x, y + buffer->y);
evas_object_resize(cs->obj, buffer->w, buffer->h);
}
- else if (cs->shell.new)
+ else if (cs->shell.new && (!newly_new))
shell_surface_init(cs);
state->attach = 0;
@@ -1468,13 +1508,8 @@ comp_surface_commit_state(Comp_Surface *cs, Comp_Buffer_State *state)
if (state->set_opaque && (!eina_tiler_equal(cs->opaque, state->opaque)))
{
array_clear(&cs->opaque_rects);
- if (eina_tiler_empty(state->opaque))
- {
- evas_object_image_border_set(cs->img, 0, 0, 0, 0);
- EINA_LIST_FOREACH(cs->proxies, l, o)
- evas_object_image_border_set(o, 0, 0, 0, 0);
- }
- else /* FIXME: proxied opaque regions */
+ if (!eina_tiler_empty(state->opaque))
+ /* FIXME: proxied opaque regions */
{
Eina_Iterator *it;
Eina_Rectangle *rect;
@@ -1606,6 +1641,13 @@ comp_surface_attach(struct wl_client *client EINA_UNUSED, struct wl_resource *re
struct wl_shm_buffer *shmbuff;
struct linux_dmabuf_buffer *dmabuf;
+ if (cs->shell.new)
+ {
+ wl_resource_post_error(cs->shell.surface, XDG_SURFACE_ERROR_UNCONFIGURED_BUFFER,
+ "buffer attached/committed before configure");
+ return;
+ }
+
comp_surface_buffer_detach(&cs->pending.buffer);
cs->pending.attach = 1;
if (!buffer_resource) return;
@@ -1752,6 +1794,13 @@ comp_surface_commit(struct wl_client *client, struct wl_resource *resource)
Eina_List *l;
Comp_Buffer_State *cbs = &cs->pending;
+ if (cs->shell.popup && (!cs->parent))
+ {
+ wl_resource_post_error(cs->shell.surface, XDG_WM_BASE_ERROR_INVALID_POPUP_PARENT,
+ "popup surface has no parent");
+ return;
+ }
+
cs->commit = 1;
if (cs->subsurface)
{
@@ -1826,7 +1875,19 @@ comp_surface_impl_destroy(struct wl_resource *resource)
{
if (s->kbd.enter == cs) s->kbd.enter = NULL;
if (s->ptr.enter == cs) s->ptr.enter = NULL;
- if (s->ptr.cursor.surface == cs) s->ptr.cursor.surface = NULL;
+ if (s->ptr.cursor.surface == cs)
+ {
+ if (s->ptr.in)
+ {
+ const Eina_List *l;
+ Eo *dev;
+ Ecore_Evas *ee = ecore_evas_ecore_evas_get(s->c->evas);
+ EINA_LIST_FOREACH(evas_device_list(s->c->evas, s->dev), l, dev)
+ if (evas_device_class_get(dev) == EVAS_DEVICE_CLASS_MOUSE)
+ ecore_evas_cursor_device_unset(ee, dev);
+ }
+ s->ptr.cursor.surface = NULL;
+ }
if (s->drag.surface == cs) s->drag.surface = NULL;
}
eina_hash_list_remove(cs->c->client_surfaces, &client, cs);
@@ -1927,7 +1988,7 @@ comp_surface_send_data_device_enter(Comp_Surface *cs, Comp_Seat *s)
wl_fixed_from_int(cx - x), wl_fixed_from_int(cy - y), offer);
}
-static void
+static Eina_Bool
comp_surface_send_pointer_enter(Comp_Surface *cs, Comp_Seat *s, int cx, int cy)
{
Eina_List *l, *ll;
@@ -1935,32 +1996,39 @@ comp_surface_send_pointer_enter(Comp_Surface *cs, Comp_Seat *s, int cx, int cy)
uint32_t serial;
int x, y;
- if (s->ptr.enter && (cs != s->grab)) return;
- if (!comp_surface_check_grab(cs, s)) return;
+ if (s->ptr.enter && (cs != s->grab)) return EINA_FALSE;
+ if (!comp_surface_check_grab(cs, s)) return EINA_FALSE;
s->ptr.enter = cs;
- if (cs->dead) return;
+ if (cs->dead) return EINA_FALSE;
if (s->drag.res && (!s->drag.tch))
{
comp_surface_send_data_device_enter(cs, s);
- return;
+ return EINA_TRUE;
}
l = seat_ptr_resources_get(s, wl_resource_get_client(cs->res));
- if (!l) return;
+ if (!l) return EINA_FALSE;
s->ptr.enter_serial = serial = wl_display_next_serial(cs->c->display);
//fprintf(stderr, "ENTER %s\n", cs->shell.popup ? "POPUP" : "TOPLEVEL");
evas_object_geometry_get(cs->obj, &x, &y, NULL, NULL);
EINA_LIST_FOREACH(l, ll, res)
wl_pointer_send_enter(res, serial, cs->res,
wl_fixed_from_int(cx - x), wl_fixed_from_int(cy - y));
+ return EINA_TRUE;
}
static void
comp_surface_mouse_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
{
Evas_Event_Mouse_In *ev = event_info;
+ Comp_Seat *s;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
- comp_surface_send_pointer_enter(data, seat_find(data, ev->dev), ev->canvas.x, ev->canvas.y);
+ s = seat_find(data, ev->dev);
+ if (comp_surface_send_pointer_enter(data, s, ev->canvas.x, ev->canvas.y))
+ {
+ s->event_propagate = 1;
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ }
}
static void
@@ -1977,40 +2045,47 @@ comp_surface_send_data_device_leave(Comp_Surface *cs, Comp_Seat *s)
wl_data_device_send_leave(res);
}
-static void
+static Eina_Bool
comp_surface_send_pointer_leave(Comp_Surface *cs, Comp_Seat *s)
{
Eina_List *l, *ll;
struct wl_resource *res;
uint32_t serial;
- if (s->ptr.enter != cs) return;
- if (!comp_surface_check_grab(cs, s)) return;
+ if (s->ptr.enter != cs) return EINA_FALSE;
+ if (!comp_surface_check_grab(cs, s)) return EINA_FALSE;
s->ptr.enter = NULL;
- if (cs->dead) return;
+ if (cs->dead) return EINA_FALSE;
if (s->drag.res)
{
comp_surface_send_data_device_leave(cs, s);
- return;
+ return EINA_TRUE;
}
l = seat_ptr_resources_get(s, wl_resource_get_client(cs->res));
- if (!l) return;
+ if (!l) return EINA_FALSE;
serial = wl_display_next_serial(cs->c->display);
//fprintf(stderr, "LEAVE %s\n", cs->shell.popup ? "POPUP" : "TOPLEVEL");
EINA_LIST_FOREACH(l, ll, res)
wl_pointer_send_leave(res, serial, cs->res);
+ return EINA_TRUE;
}
static void
comp_surface_mouse_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
{
Evas_Event_Mouse_Out *ev = event_info;
+ Comp_Seat *s;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
- comp_surface_send_pointer_leave(data, seat_find(data, ev->dev));
+ s = seat_find(data, ev->dev);
+ if (comp_surface_send_pointer_leave(data, s))
+ {
+ s->event_propagate = 1;
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ }
}
-static void
+static Eina_Bool
comp_surface_mouse_button(Comp_Surface *cs, Comp_Seat *s, uint32_t timestamp, uint32_t button_id, uint32_t state)
{
uint32_t serial, btn;
@@ -2029,22 +2104,28 @@ comp_surface_mouse_button(Comp_Surface *cs, Comp_Seat *s, uint32_t timestamp, ui
btn = BTN_RIGHT;
break;
case 4:
+ btn = BTN_SIDE;
+ break;
case 5:
+ btn = BTN_EXTRA;
+ break;
case 6:
+ btn = BTN_FORWARD;
+ break;
case 7:
- /* these are supposedly axis events */
- return;
+ btn = BTN_BACK;
+ break;
default:
btn = button_id + BTN_SIDE - 8;
break;
}
- if (s->ptr.enter != cs) return;
- if (!comp_surface_check_grab(cs, s)) return;
+ if (s->ptr.enter != cs) return EINA_FALSE;
+ if (!comp_surface_check_grab(cs, s)) return EINA_FALSE;
if (state == WL_POINTER_BUTTON_STATE_PRESSED)
s->ptr.button_mask |= 1 << button_id;
else
{
- if (!(s->ptr.button_mask & (1 << button_id))) return;
+ if (!(s->ptr.button_mask & (1 << button_id))) return EINA_FALSE;
s->ptr.button_mask &= ~(1 << button_id);
if (s->drag.res && (!s->drag.tch))
{
@@ -2052,41 +2133,54 @@ comp_surface_mouse_button(Comp_Surface *cs, Comp_Seat *s, uint32_t timestamp, ui
comp_surface_input_event(&s->ptr.events, button_id, 0, timestamp, state == WL_POINTER_BUTTON_STATE_RELEASED);
s->ptr.enter = NULL;
comp_surface_send_pointer_enter(cs, s, s->ptr.pos.x, s->ptr.pos.y);
- return;
+ return EINA_TRUE;
}
}
if (cs->dead)
{
comp_surface_input_event(&s->ptr.events, button_id, 0, timestamp, state == WL_POINTER_BUTTON_STATE_RELEASED);
- return;
+ return EINA_TRUE;
}
l = seat_ptr_resources_get(s, wl_resource_get_client(cs->res));
- if (!l) return;
+ if (!l) return EINA_FALSE;
serial = wl_display_next_serial(s->c->display);
comp_surface_input_event(&s->ptr.events, button_id, serial, timestamp, state == WL_POINTER_BUTTON_STATE_RELEASED);
EINA_LIST_FOREACH(l, ll, res)
wl_pointer_send_button(res, serial, timestamp, btn, state);
+ return EINA_TRUE;
}
static void
comp_surface_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
{
Evas_Event_Mouse_Down *ev = event_info;
+ Comp_Seat *s;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
- comp_surface_mouse_button(data, seat_find(data, ev->dev), ev->timestamp, ev->button, WL_POINTER_BUTTON_STATE_PRESSED);
+ s = seat_find(data, ev->dev);
+ if (comp_surface_mouse_button(data, s, ev->timestamp, ev->button, WL_POINTER_BUTTON_STATE_PRESSED))
+ {
+ s->event_propagate = 1;
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ }
}
static void
comp_surface_mouse_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
{
Evas_Event_Mouse_Down *ev = event_info;
+ Comp_Seat *s;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
- comp_surface_mouse_button(data, seat_find(data, ev->dev), ev->timestamp, ev->button, WL_POINTER_BUTTON_STATE_RELEASED);
+ s = seat_find(data, ev->dev);
+ if (comp_surface_mouse_button(data, s, ev->timestamp, ev->button, WL_POINTER_BUTTON_STATE_RELEASED))
+ {
+ s->event_propagate = 1;
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ }
}
static void
@@ -2130,6 +2224,8 @@ comp_surface_mouse_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_U
wl_fixed_from_int(ev->cur.canvas.x - x), wl_fixed_from_int(ev->cur.canvas.y - y));
}
}
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ s->event_propagate = 1;
}
static void
@@ -2149,9 +2245,9 @@ comp_surface_mouse_wheel(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EI
axis = WL_POINTER_AXIS_HORIZONTAL_SCROLL;
if (ev->z < 0)
- dir = -wl_fixed_from_int(abs(ev->z));
+ dir = -wl_fixed_from_int(abs(10 * ev->z));
else
- dir = wl_fixed_from_int(ev->z);
+ dir = wl_fixed_from_int(10 * ev->z);
if (cs->dead) return;
s = seat_find(data, ev->dev);
@@ -2161,6 +2257,8 @@ comp_surface_mouse_wheel(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EI
if (!l) return;
EINA_LIST_FOREACH(l, ll, res)
wl_pointer_send_axis(res, ev->timestamp, axis, dir);
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ s->event_propagate = 1;
}
static void
@@ -2183,6 +2281,8 @@ comp_surface_multi_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_U
if (!l)
{
comp_surface_input_event(&s->tch.events, ev->device, 0, ev->timestamp, 0);
+ s->event_propagate = 1;
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
return;
}
evas_object_geometry_get(cs->obj, &x, &y, NULL, NULL);
@@ -2191,6 +2291,8 @@ comp_surface_multi_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_U
EINA_LIST_FOREACH(l, ll, res)
wl_touch_send_down(res, serial, ev->timestamp, cs->res, ev->device,
wl_fixed_from_int(ev->canvas.x - x), wl_fixed_from_int(ev->canvas.y - y));
+ s->event_propagate = 1;
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
}
static void
@@ -2213,14 +2315,23 @@ comp_surface_multi_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNU
if ((!l) || (s->drag.tch && ((uint32_t)ev->device == s->drag.id)))
{
if (s->drag.tch)
- wl_data_device_send_drop(data_device_find(s, cs->res));
+ {
+ res = data_device_find(s, cs->res);
+ if (!res) return;
+
+ wl_data_device_send_drop(res);
+ }
comp_surface_input_event(&s->tch.events, ev->device, 0, ev->timestamp, 1);
+ s->event_propagate = 1;
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
return;
}
serial = wl_display_next_serial(cs->c->display);
comp_surface_input_event(&s->tch.events, ev->device, serial, ev->timestamp, 1);
EINA_LIST_FOREACH(l, ll, res)
wl_touch_send_up(res, serial, ev->timestamp, ev->device);
+ s->event_propagate = 1;
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
}
static void
@@ -2242,8 +2353,12 @@ comp_surface_multi_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_U
if (s->drag.enter != cs) return;
res = data_device_find(s, cs->res);
if (res)
- wl_data_device_send_motion(res, ev->timestamp,
- wl_fixed_from_int(ev->cur.canvas.x - x), wl_fixed_from_int(ev->cur.canvas.y - y));
+ {
+ wl_data_device_send_motion(res, ev->timestamp,
+ wl_fixed_from_int(ev->cur.canvas.x - x), wl_fixed_from_int(ev->cur.canvas.y - y));
+ s->event_propagate = 1;
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ }
return;
}
else
@@ -2255,6 +2370,8 @@ comp_surface_multi_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_U
EINA_LIST_FOREACH(l, ll, res)
wl_touch_send_motion(res, ev->timestamp, ev->device,
wl_fixed_from_int(ev->cur.canvas.x - x), wl_fixed_from_int(ev->cur.canvas.y - y));
+ s->event_propagate = 1;
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
}
}
@@ -2360,7 +2477,7 @@ comp_surface_smart_show(Evas_Object *obj)
static void
comp_surface_smart_hide(Evas_Object *obj)
{
- Comp_Surface *lcs, *cs = evas_object_smart_data_get(obj);
+ Comp_Surface *pcs = NULL, *lcs, *cs = evas_object_smart_data_get(obj);
evas_object_hide(cs->clip);
cs->mapped = 0;
@@ -2368,7 +2485,7 @@ comp_surface_smart_hide(Evas_Object *obj)
if (!cs->shell.activated) return;
cs->shell.activated = 0;
if (cs->shell.popup && cs->role)
- zxdg_popup_v6_send_popup_done(cs->role);
+ xdg_popup_send_popup_done(cs->role);
if (cs->parent && cs->shell.popup) return;
/* attempt to revert focus based on stacking order */
if (cs->parent)
@@ -2379,15 +2496,23 @@ comp_surface_smart_hide(Evas_Object *obj)
if (!evas_object_visible_get(lcs->obj)) continue;
if ((!lcs->shell.surface) || (!lcs->role)) continue;
lcs->shell.activated = 1;
- if (lcs->shell.popup && (!lcs->extracted))
- evas_object_raise(lcs->obj);
+ if (lcs->shell.popup)
+ {
+ if (!lcs->extracted)
+ evas_object_raise(lcs->obj);
+ }
else
shell_surface_send_configure(lcs);
return;
}
+ if (!cs->parent->shell.popup)
+ {
+ pcs = cs->parent;
+ if (!pcs->mapped) pcs = NULL;
+ }
}
if (cs->c->seats)
- comp_seats_redo_enter(cs->c, NULL);
+ comp_seats_redo_enter(cs->c, pcs);
}
static void
@@ -2471,7 +2596,10 @@ comp_surface_create(struct wl_client *client, struct wl_resource *resource, uint
c->surfaces = eina_inlist_prepend(c->surfaces, EINA_INLIST_GET(cs));
c->surfaces_count++;
eina_hash_list_append(c->client_surfaces, &client, cs);
- comp_surface_output_enter(cs);
+ if (evas_object_visible_get(cs->c->clip))
+ comp_surface_output_enter(cs);
+ else
+ comp_surface_output_leave(cs);
cs->opaque = tiler_new();
cs->input = tiler_new();
@@ -3080,7 +3208,12 @@ output_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id)
output_resize(c, res);
EINA_INLIST_FOREACH(c->surfaces, cs)
if (wl_resource_get_client(cs->res) == client)
- comp_surface_output_enter(cs);
+ {
+ if (evas_object_visible_get(c->clip))
+ comp_surface_output_enter(cs);
+ else
+ comp_surface_output_leave(cs);
+ }
}
/////////////////////////////////////////////////////////////////
@@ -3092,6 +3225,7 @@ shell_surface_toplevel_impl_destroy(struct wl_resource *resource)
cs->role = NULL;
evas_object_hide(cs->obj);
+ shell_surface_reset(cs);
if (!cs->parent) return;
comp_surface_reparent(cs, NULL);
}
@@ -3160,7 +3294,7 @@ shell_surface_toplevel_unset_fullscreen(){}
static void
shell_surface_toplevel_set_minimized(){}
-static const struct zxdg_toplevel_v6_interface shell_surface_toplevel_interface =
+static const struct xdg_toplevel_interface shell_surface_toplevel_interface =
{
resource_destroy,
shell_surface_toplevel_set_parent,
@@ -3185,18 +3319,18 @@ shell_surface_toplevel_create(struct wl_client *client EINA_UNUSED, struct wl_re
if (cs->buffer[0] || cs->pending.buffer)
{
- wl_resource_post_error(resource, ZXDG_SURFACE_V6_ERROR_UNCONFIGURED_BUFFER,
+ wl_resource_post_error(resource, XDG_SURFACE_ERROR_UNCONFIGURED_BUFFER,
"buffer attached/committed before configure");
return;
}
if (cs->role)
{
- wl_resource_post_error(resource, ZXDG_SHELL_V6_ERROR_ROLE,
+ wl_resource_post_error(resource, XDG_WM_BASE_ERROR_ROLE,
"surface already has assigned role");
return;
}
- cs->role = wl_resource_create(client, &zxdg_toplevel_v6_interface, 1, id);
+ cs->role = wl_resource_create(client, &xdg_toplevel_interface, 1, id);
wl_resource_set_implementation(cs->role, &shell_surface_toplevel_interface, cs, shell_surface_toplevel_impl_destroy);
cs->shell.new = 1;
}
@@ -3214,14 +3348,14 @@ shell_surface_popup_grab(struct wl_client *client EINA_UNUSED, struct wl_resourc
}
if (cs->mapped)
{
- wl_resource_post_error(resource, ZXDG_POPUP_V6_ERROR_INVALID_GRAB,
+ wl_resource_post_error(resource, XDG_POPUP_ERROR_INVALID_GRAB,
"grab requested on mapped popup");
return;
}
if (cs->parent->shell.popup && (s->grab != cs->parent))
{
- wl_resource_post_error(resource, ZXDG_POPUP_V6_ERROR_INVALID_GRAB,
+ wl_resource_post_error(resource, XDG_POPUP_ERROR_INVALID_GRAB,
"grab requested on ungrabbed nested popup");
return;
}
@@ -3229,7 +3363,7 @@ shell_surface_popup_grab(struct wl_client *client EINA_UNUSED, struct wl_resourc
cs->shell.grabs = eina_list_append(cs->shell.grabs, s);
}
-static const struct zxdg_popup_v6_interface shell_surface_popup_interface =
+static const struct xdg_popup_interface shell_surface_popup_interface =
{
resource_destroy,
shell_surface_popup_grab,
@@ -3244,6 +3378,7 @@ shell_surface_popup_impl_destroy(struct wl_resource *resource)
cs->role = NULL;
evas_object_hide(cs->obj);
cs->shell.popup = 0;
+ shell_surface_reset(cs);
EINA_LIST_FREE(cs->shell.grabs, s)
if (s->grab == cs)
{
@@ -3254,7 +3389,7 @@ shell_surface_popup_impl_destroy(struct wl_resource *resource)
s->grab = NULL;
}
if (cs->children)
- wl_resource_post_error(cs->shell.surface, ZXDG_SHELL_V6_ERROR_DEFUNCT_SURFACES,
+ wl_resource_post_error(cs->shell.surface, XDG_WM_BASE_ERROR_DEFUNCT_SURFACES,
"popups dismissed out of order");
if (cs->parent)
comp_surface_reparent(cs, NULL);
@@ -3267,28 +3402,23 @@ shell_surface_popup_create(struct wl_client *client, struct wl_resource *resourc
if (cs->buffer[0] || cs->pending.buffer)
{
- wl_resource_post_error(resource, ZXDG_SURFACE_V6_ERROR_UNCONFIGURED_BUFFER,
+ wl_resource_post_error(resource, XDG_SURFACE_ERROR_UNCONFIGURED_BUFFER,
"buffer attached/committed before configure");
return;
}
if (cs->role)
{
- wl_resource_post_error(resource, ZXDG_SHELL_V6_ERROR_ROLE,
+ wl_resource_post_error(resource, XDG_WM_BASE_ERROR_ROLE,
"surface already has assigned role");
return;
}
- if (!parent_resource)
- {
- wl_resource_post_error(resource, ZXDG_SHELL_V6_ERROR_INVALID_POPUP_PARENT,
- "popup surface has no parent");
- return;
- }
- cs->role = wl_resource_create(client, &zxdg_popup_v6_interface, 1, id);
+ cs->role = wl_resource_create(client, &xdg_popup_interface, 1, id);
wl_resource_set_implementation(cs->role, &shell_surface_popup_interface, cs, shell_surface_popup_impl_destroy);
cs->shell.new = 1;
cs->shell.popup = 1;
- comp_surface_reparent(cs, wl_resource_get_user_data(parent_resource));
+ if(parent_resource)
+ comp_surface_reparent(cs, wl_resource_get_user_data(parent_resource));
cs->shell.positioner = wl_resource_get_user_data(positioner_resource);
_apply_positioner(cs, cs->shell.positioner);
evas_object_smart_callback_call(cs->c->obj, "popup_added", cs->obj);
@@ -3298,7 +3428,14 @@ static void
_validate_size(struct wl_resource *resource, int32_t value)
{
if (value <= 0)
- wl_resource_post_error(resource, ZXDG_POSITIONER_V6_ERROR_INVALID_INPUT, "Invalid size passed");
+ wl_resource_post_error(resource, XDG_POSITIONER_ERROR_INVALID_INPUT, "Invalid size passed");
+}
+
+static void
+_validate_size_negative(struct wl_resource *resource, int32_t value)
+{
+ if (value < 0)
+ wl_resource_post_error(resource, XDG_POSITIONER_ERROR_INVALID_INPUT, "Invalid size passed");
}
static void
@@ -3318,44 +3455,37 @@ shell_positioner_set_anchor_rect(struct wl_client *wl_client EINA_UNUSED, struct
{
Shell_Positioner *p = wl_resource_get_user_data(resource);
- _validate_size(resource, w);
- _validate_size(resource, h);
+ _validate_size_negative(resource, w);
+ _validate_size_negative(resource, h);
EINA_RECTANGLE_SET(&p->anchor_rect, x, y, w, h);
}
static void
-shell_positioner_set_anchor(struct wl_client *wl_client EINA_UNUSED, struct wl_resource *resource, enum zxdg_positioner_v6_anchor anchor)
+shell_positioner_set_anchor(struct wl_client *wl_client EINA_UNUSED, struct wl_resource *resource, enum xdg_positioner_anchor anchor)
{
Shell_Positioner *p = wl_resource_get_user_data(resource);
- if ((anchor & (ZXDG_POSITIONER_V6_ANCHOR_TOP | ZXDG_POSITIONER_V6_ANCHOR_BOTTOM)) ==
- (ZXDG_POSITIONER_V6_ANCHOR_TOP | ZXDG_POSITIONER_V6_ANCHOR_BOTTOM))
- wl_resource_post_error(resource, ZXDG_POSITIONER_V6_ERROR_INVALID_INPUT, "Invalid anchor values passed");
- else if ((anchor & (ZXDG_POSITIONER_V6_ANCHOR_LEFT | ZXDG_POSITIONER_V6_ANCHOR_RIGHT)) ==
- (ZXDG_POSITIONER_V6_ANCHOR_LEFT | ZXDG_POSITIONER_V6_ANCHOR_RIGHT))
- wl_resource_post_error(resource, ZXDG_POSITIONER_V6_ERROR_INVALID_INPUT, "Invalid anchor values passed");
- else
- p->anchor = anchor;
+ p->anchor = anchor;
}
static void
-shell_positioner_set_gravity(struct wl_client *wl_client EINA_UNUSED, struct wl_resource *resource, enum zxdg_positioner_v6_gravity gravity)
+shell_positioner_set_gravity(struct wl_client *wl_client EINA_UNUSED, struct wl_resource *resource, enum xdg_positioner_gravity gravity)
{
Shell_Positioner *p = wl_resource_get_user_data(resource);
- if ((gravity & (ZXDG_POSITIONER_V6_GRAVITY_TOP | ZXDG_POSITIONER_V6_GRAVITY_BOTTOM)) ==
- (ZXDG_POSITIONER_V6_GRAVITY_TOP | ZXDG_POSITIONER_V6_GRAVITY_BOTTOM))
- wl_resource_post_error(resource, ZXDG_POSITIONER_V6_ERROR_INVALID_INPUT, "Invalid gravity values passed");
- else if ((gravity & (ZXDG_POSITIONER_V6_GRAVITY_LEFT | ZXDG_POSITIONER_V6_GRAVITY_RIGHT)) ==
- (ZXDG_POSITIONER_V6_GRAVITY_LEFT | ZXDG_POSITIONER_V6_GRAVITY_RIGHT))
- wl_resource_post_error(resource, ZXDG_POSITIONER_V6_ERROR_INVALID_INPUT, "Invalid gravity values passed");
+ if ((gravity & (XDG_POSITIONER_GRAVITY_TOP | XDG_POSITIONER_GRAVITY_BOTTOM)) ==
+ (XDG_POSITIONER_GRAVITY_TOP | XDG_POSITIONER_GRAVITY_BOTTOM))
+ wl_resource_post_error(resource, XDG_POSITIONER_ERROR_INVALID_INPUT, "Invalid gravity values passed");
+ else if ((gravity & (XDG_POSITIONER_GRAVITY_LEFT | XDG_POSITIONER_GRAVITY_RIGHT)) ==
+ (XDG_POSITIONER_GRAVITY_LEFT | XDG_POSITIONER_GRAVITY_RIGHT))
+ wl_resource_post_error(resource, XDG_POSITIONER_ERROR_INVALID_INPUT, "Invalid gravity values passed");
else
p->gravity = gravity;
}
static void
-shell_positioner_set_constraint_adjustment(struct wl_client *wl_client EINA_UNUSED, struct wl_resource *resource, enum zxdg_positioner_v6_constraint_adjustment constraint_adjustment)
+shell_positioner_set_constraint_adjustment(struct wl_client *wl_client EINA_UNUSED, struct wl_resource *resource, enum xdg_positioner_constraint_adjustment constraint_adjustment)
{
Shell_Positioner *p = wl_resource_get_user_data(resource);
@@ -3371,7 +3501,7 @@ shell_positioner_set_offset(struct wl_client *client EINA_UNUSED, struct wl_reso
p->offset.y = y;
}
-static const struct zxdg_positioner_v6_interface shell_positioner_interface =
+static const struct xdg_positioner_interface shell_positioner_interface =
{
resource_destroy,
shell_positioner_set_size,
@@ -3401,8 +3531,9 @@ shell_positioner_create(struct wl_client *client, struct wl_resource *resource,
Shell_Positioner *sp;
sd = wl_resource_get_user_data(resource);
- res = wl_resource_create(client, &zxdg_positioner_v6_interface, 1, id);
+ res = wl_resource_create(client, &xdg_positioner_interface, 1, id);
sp = calloc(1, sizeof(Shell_Positioner));
+ sp->anchor_rect.w = sp->anchor_rect.h = -1;
sp->sd = sd;
sp->res = res;
sd->positioners = eina_inlist_append(sd->positioners, EINA_INLIST_GET(sp));
@@ -3422,7 +3553,7 @@ shell_surface_ack_configure(struct wl_client *client EINA_UNUSED, struct wl_reso
{
}
-static const struct zxdg_surface_v6_interface shell_surface_interface =
+static const struct xdg_surface_interface shell_surface_interface =
{
resource_destroy,
shell_surface_toplevel_create,
@@ -3438,12 +3569,13 @@ shell_surface_impl_destroy(struct wl_resource *resource)
if (cs->role)
{
- wl_resource_post_error(resource, ZXDG_SHELL_V6_ERROR_DEFUNCT_SURFACES, "shell surface destroyed before role surfaces");
+ wl_resource_post_error(resource, XDG_WM_BASE_ERROR_DEFUNCT_SURFACES, "shell surface destroyed before role surfaces");
wl_resource_destroy(cs->role);
}
cs->shell.surface = NULL;
cs->shell.data->surfaces = eina_list_remove(cs->shell.data->surfaces, cs);
cs->shell.data = NULL;
+ shell_surface_reset(cs);
while (cs->children)
{
ccs = EINA_INLIST_CONTAINER_GET(cs->children, Comp_Surface);
@@ -3464,7 +3596,7 @@ shell_surface_create(struct wl_client *client, struct wl_resource *resource, uin
return;
}
- cs->shell.surface = wl_resource_create(client, &zxdg_surface_v6_interface, 1, id);
+ cs->shell.surface = wl_resource_create(client, &xdg_surface_interface, 1, id);
cs->shell.data = sd;
wl_resource_set_implementation(cs->shell.surface, &shell_surface_interface, cs, shell_surface_impl_destroy);
sd->surfaces = eina_list_append(sd->surfaces, cs);
@@ -3478,7 +3610,7 @@ shell_pong(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, u
sd->ping = 0;
}
-static const struct zxdg_shell_v6_interface shell_interface =
+static const struct xdg_wm_base_interface shell_interface =
{
resource_destroy,
shell_positioner_create,
@@ -3517,7 +3649,7 @@ shell_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id)
sd->c = c;
c->shells = eina_inlist_append(c->shells, EINA_INLIST_GET(sd));
- res = wl_resource_create(client, &zxdg_shell_v6_interface, version, id);
+ res = wl_resource_create(client, &xdg_wm_base_interface, version, id);
sd->res = res;
wl_resource_set_implementation(res, &shell_interface, sd, shell_unbind);
}
@@ -3546,34 +3678,91 @@ seat_update_caps(Comp_Seat *s, struct wl_resource *res)
}
static void
+seat_keymap_send(Comp_Seat *s)
+{
+ Eina_List *l;
+ Eina_Iterator *it;
+ it = eina_hash_iterator_data_new(s->kbd.resources);
+ EINA_ITERATOR_FOREACH(it, l)
+ {
+ Eina_List *ll;
+ struct wl_resource *res;
+ EINA_LIST_FOREACH(l, ll, res)
+ wl_keyboard_send_keymap(res, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1, s->kbd.keymap_fd, s->kbd.keymap_mem_size);
+ }
+ eina_iterator_free(it);
+}
+
+static Eina_Bool
+seat_kbd_mods_update(Comp_Seat *s)
+{
+ xkb_mod_mask_t mod;
+ xkb_layout_index_t grp;
+
+ mod = xkb_state_serialize_mods(s->kbd.state, XKB_STATE_DEPRESSED);
+ s->kbd.mods.changed |= mod != s->kbd.mods.depressed;
+ s->kbd.mods.depressed = mod;
+ mod = xkb_state_serialize_mods(s->kbd.state, XKB_STATE_MODS_LATCHED);
+ s->kbd.mods.changed |= mod != s->kbd.mods.latched;
+ s->kbd.mods.latched = mod;
+ mod = xkb_state_serialize_mods(s->kbd.state, XKB_STATE_MODS_LOCKED);
+ s->kbd.mods.changed |= mod != s->kbd.mods.locked;
+ s->kbd.mods.locked = mod;
+ grp = xkb_state_serialize_layout(s->kbd.state, XKB_STATE_LAYOUT_EFFECTIVE);
+ s->kbd.mods.changed |= grp != s->kbd.mods.group;
+ s->kbd.mods.group = grp;
+ return s->kbd.mods.changed;
+}
+
+static void
+seat_kbd_external_init(Comp_Seat *s)
+{
+ Eina_List *l, *ll;
+ uint32_t serial;
+ struct wl_resource *res;
+
+ seat_keymap_send(s);
+ if (!seat_kbd_mods_update(s)) return;
+ l = seat_kbd_active_resources_get(s);
+ if (!l) return;
+ serial = wl_display_next_serial(s->c->display);
+ EINA_LIST_FOREACH(l, ll, res)
+ comp_seat_send_modifiers(s, res, serial);
+}
+
+static void
seat_keymap_update(Comp_Seat *s)
{
char *str;
Eina_Tmpstr *file;
- Eina_List *l;
- Eina_Iterator *it;
xkb_mod_mask_t latched = 0, locked = 0;
if (s->kbd.keymap_mem) munmap(s->kbd.keymap_mem, s->kbd.keymap_mem_size);
if (s->kbd.keymap_fd > -1) close(s->kbd.keymap_fd);
- if (s->kbd.state)
- {
- latched = xkb_state_serialize_mods(s->kbd.state, XKB_STATE_MODS_LATCHED);
- locked = xkb_state_serialize_mods(s->kbd.state, XKB_STATE_MODS_LOCKED);
- xkb_state_unref(s->kbd.state);
- }
- if (!s->kbd.keymap)
+#ifdef HAVE_ECORE_X
+ if (!x11_kbd_keymap)
{
- s->kbd.state = NULL;
- s->kbd.keymap_fd = -1;
- s->kbd.keymap_mem = NULL;
- return;
- }
-
- s->kbd.state = xkb_state_new(s->kbd.keymap);
- xkb_state_update_mask(s->kbd.state, 0, latched, locked, 0, 0, 0);
+#endif
+ if (s->kbd.state)
+ {
+ latched = xkb_state_serialize_mods(s->kbd.state, XKB_STATE_MODS_LATCHED);
+ locked = xkb_state_serialize_mods(s->kbd.state, XKB_STATE_MODS_LOCKED);
+ xkb_state_unref(s->kbd.state);
+ }
+ if (!s->kbd.keymap)
+ {
+ s->kbd.state = NULL;
+ s->kbd.keymap_fd = -1;
+ s->kbd.keymap_mem = NULL;
+ return;
+ }
+ s->kbd.state = xkb_state_new(s->kbd.keymap);
+ xkb_state_update_mask(s->kbd.state, 0, latched, locked, 0, 0, 0);
+#ifdef HAVE_ECORE_X
+ }
+#endif
str = xkb_map_get_as_string(s->kbd.keymap);
s->kbd.keymap_mem_size = strlen(str) + 1;
s->kbd.keymap_fd = eina_file_mkstemp("comp-keymapXXXXXX", &file);
@@ -3605,15 +3794,7 @@ seat_keymap_update(Comp_Seat *s)
s->kbd.keymap_mem[s->kbd.keymap_mem_size] = 0;
free(str);
- it = eina_hash_iterator_data_new(s->kbd.resources);
- EINA_ITERATOR_FOREACH(it, l)
- {
- Eina_List *ll;
- struct wl_resource *res;
- EINA_LIST_FOREACH(l, ll, res)
- wl_keyboard_send_keymap(res, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1, s->kbd.keymap_fd, s->kbd.keymap_mem_size);
- }
- eina_iterator_free(it);
+ seat_keymap_send(s);
}
static inline void
@@ -3651,27 +3832,6 @@ seat_keymap_create(Comp_Seat *s)
s->kbd.keymap = xkb_map_new_from_names(s->kbd.context, &names, 0);
}
-static Eina_Bool
-seat_mods_update(Comp_Seat *s)
-{
- xkb_mod_mask_t mod;
- xkb_layout_index_t grp;
-
- mod = xkb_state_serialize_mods(s->kbd.state, XKB_STATE_DEPRESSED);
- s->kbd.mods.changed |= mod != s->kbd.mods.depressed;
- s->kbd.mods.depressed = mod;
- mod = xkb_state_serialize_mods(s->kbd.state, XKB_STATE_MODS_LATCHED);
- s->kbd.mods.changed |= mod != s->kbd.mods.latched;
- s->kbd.mods.latched = mod;
- mod = xkb_state_serialize_mods(s->kbd.state, XKB_STATE_MODS_LOCKED);
- s->kbd.mods.changed |= mod != s->kbd.mods.locked;
- s->kbd.mods.locked = mod;
- grp = xkb_state_serialize_layout(s->kbd.state, XKB_STATE_LAYOUT_EFFECTIVE);
- s->kbd.mods.changed |= grp != s->kbd.mods.group;
- s->kbd.mods.group = grp;
- return s->kbd.mods.changed;
-}
-
static const struct wl_keyboard_interface seat_kbd_interface =
{
resource_destroy
@@ -3759,7 +3919,11 @@ seat_ptr_set_cursor(struct wl_client *client, struct wl_resource *resource, uint
eina_tiler_clear(cs->pending.input);
evas_object_pass_events_set(cs->obj, 1);
}
- if (s->ptr.cursor.surface) s->ptr.cursor.surface->cursor = 0;
+ if (s->ptr.cursor.surface)
+ {
+ s->ptr.cursor.surface->cursor = 0;
+ s->ptr.cursor.surface->role = NULL;
+ }
if (s->ptr.in)
{
@@ -3842,7 +4006,7 @@ seat_tch_create(struct wl_client *client, struct wl_resource *resource, uint32_t
Comp_Seat *s = wl_resource_get_user_data(resource);
struct wl_resource *res;
- res = wl_resource_create(client, &wl_pointer_interface, wl_resource_get_version(resource), id);
+ res = wl_resource_create(client, &wl_touch_interface, wl_resource_get_version(resource), id);
wl_resource_set_implementation(res, &seat_tch_interface, s, seat_tch_unbind);
if (!s->tch.resources) s->tch.resources = eina_hash_pointer_new(NULL);
eina_hash_list_append(s->tch.resources, &client, res);
@@ -3909,6 +4073,25 @@ seat_resource_hash_free(Eina_Hash *h)
}
static void
+seat_kbd_destroy(Comp_Seat *s)
+{
+ if (s->kbd.external) return;
+#ifdef HAVE_ECORE_X
+ if (!x11_kbd_keymap)
+ {
+#endif
+ if (s->kbd.state) xkb_state_unref(s->kbd.state);
+ if (s->kbd.keymap) xkb_keymap_unref(s->kbd.keymap);
+ if (s->kbd.context) xkb_context_unref(s->kbd.context);
+#ifdef HAVE_ECORE_X
+ }
+#endif
+ if (s->kbd.keymap_mem) munmap(s->kbd.keymap_mem, s->kbd.keymap_mem_size);
+ if (s->kbd.keymap_fd > -1) close(s->kbd.keymap_fd);
+ wl_array_release(&s->kbd.keys);
+}
+
+static void
seat_destroy(Comp_Seat *s)
{
Eina_Stringshare *type;
@@ -3918,12 +4101,7 @@ seat_destroy(Comp_Seat *s)
while (s->resources)
wl_resource_destroy(eina_list_data_get(s->resources));
eina_stringshare_del(s->name);
- if (s->kbd.state) xkb_state_unref(s->kbd.state);
- if (s->kbd.keymap) xkb_keymap_unref(s->kbd.keymap);
- if (s->kbd.context) xkb_context_unref(s->kbd.context);
- if (s->kbd.keymap_mem) munmap(s->kbd.keymap_mem, s->kbd.keymap_mem_size);
- if (s->kbd.keymap_fd > -1) close(s->kbd.keymap_fd);
- wl_array_release(&s->kbd.keys);
+ seat_kbd_destroy(s);
efl_unref(s->dev);
s->c->seats = eina_inlist_remove(s->c->seats, EINA_INLIST_GET(s));
eina_hash_free(s->data_devices);
@@ -3950,10 +4128,12 @@ seat_destroy(Comp_Seat *s)
static void
comp_gl_shutdown(Comp *c)
{
- if (c->glapi->evasglUnbindWaylandDisplay)
+ if (c->glapi && c->glapi->evasglUnbindWaylandDisplay)
c->glapi->evasglUnbindWaylandDisplay(c->gl, c->display);
- evas_gl_surface_destroy(c->gl, c->glsfc);
- evas_gl_context_destroy(c->gl, c->glctx);
+ if (c->glsfc)
+ evas_gl_surface_destroy(c->gl, c->glsfc);
+ if (c->glctx)
+ evas_gl_context_destroy(c->gl, c->glctx);
evas_gl_free(c->gl);
evas_gl_config_free(c->glcfg);
c->glsfc = NULL;
@@ -3966,13 +4146,18 @@ static void
comp_gl_init(Comp *c)
{
c->glctx = evas_gl_context_create(c->gl, NULL);
+ if (!c->glctx) goto end;
c->glcfg = evas_gl_config_new();
+ if (!c->glcfg) goto end;
c->glsfc = evas_gl_surface_create(c->gl, c->glcfg, 1, 1);
- evas_gl_make_current(c->gl, c->glsfc, c->glctx);
+ if (!c->glsfc) goto end;
+ if (!evas_gl_make_current(c->gl, c->glsfc, c->glctx)) goto end;
c->glapi = evas_gl_context_api_get(c->gl, c->glctx);
- if ((!c->glapi->evasglBindWaylandDisplay) ||
- (!c->glapi->evasglBindWaylandDisplay(c->gl, c->display)))
- comp_gl_shutdown(c);
+ if (c->glapi->evasglBindWaylandDisplay &&
+ c->glapi->evasglBindWaylandDisplay(c->gl, c->display))
+ return;
+end:
+ comp_gl_shutdown(c);
}
static void
@@ -4002,6 +4187,21 @@ comp_render_pre(Comp *c, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED)
//if (cs->proxies) fprintf(stderr, "RENDER %d\n", wl_resource_get_id(buffer->res));
cs->post_render_queue = 1;
+ if (cs->opaque_rects && (eina_array_count(cs->opaque_rects) == 1))
+ {
+ Evas_Object *r = eina_array_data_get(cs->opaque_rects, 0);
+ int x, y, w, h, ox, oy, ow, oh;
+
+ evas_object_geometry_get(cs->img, &x, &y, &w, &h);
+ evas_object_geometry_get(r, &ox, &oy, &ow, &oh);
+ evas_object_image_border_set(cs->img, ox - x, ox + ow, oy - y, oy + oh);
+ evas_object_image_border_center_fill_set(cs->img, EVAS_BORDER_FILL_SOLID);
+ }
+ else
+ {
+ evas_object_image_border_set(cs->img, 0, 0, 0, 0);
+ evas_object_image_border_center_fill_set(cs->img, EVAS_BORDER_FILL_DEFAULT);
+ }
evas_object_image_alpha_set(cs->img, comp_surface_is_alpha(cs, buffer));
evas_object_resize(cs->img, buffer->w, buffer->h);
evas_object_image_size_set(cs->img, buffer->w, buffer->h);
@@ -4229,18 +4429,28 @@ comp_device_caps_update(Comp_Seat *s)
}
if (s->keyboard != kbd)
{
- if (s->keyboard)
- {
- seat_keymap_create(s);
- seat_kbd_repeat_rate_update(s);
- }
+ if (s->kbd.external)
+ seat_kbd_external_init(s);
else
{
- xkb_keymap_unref(s->kbd.keymap);
- s->kbd.keymap = NULL;
+ if (s->keyboard)
+ {
+#ifdef HAVE_ECORE_X
+ if ((!s->c->parent_disp) && ecore_x_display_get())
+ x11_kbd_apply(s);
+ else
+#endif
+ seat_keymap_create(s);
+ seat_kbd_repeat_rate_update(s);
+ }
+ else
+ {
+ xkb_keymap_unref(s->kbd.keymap);
+ s->kbd.keymap = NULL;
+ }
+ seat_keymap_update(s);
+ s->keyboard = !!s->kbd.state;
}
- seat_keymap_update(s);
- s->keyboard = !!s->kbd.state;
}
seat_update_caps(s, NULL);
}
@@ -4287,22 +4497,35 @@ comp_seats_proxy(Comp *c)
s->touch = !!(caps & ECORE_WL2_SEAT_CAPABILITIES_TOUCH);
if (s->keyboard)
{
- if (s->seat)
+ if (s->kbd.external)
+ seat_kbd_external_init(s);
+ else
{
- s->kbd.keymap = ecore_wl2_input_keymap_get(s->seat);
- if (s->kbd.keymap) xkb_keymap_ref(s->kbd.keymap);
+ if (s->seat)
+ {
+ s->kbd.keymap = ecore_wl2_input_keymap_get(s->seat);
+ if (s->kbd.keymap) xkb_keymap_ref(s->kbd.keymap);
+ }
+ else
+ {
+#ifdef HAVE_ECORE_X
+ if ((!s->c->parent_disp) && ecore_x_display_get())
+ x11_kbd_apply(s);
+ else
+#endif
+ seat_keymap_create(s);
+ }
+ seat_keymap_update(s);
+ seat_kbd_repeat_rate_update(s);
+ s->keyboard = !!s->kbd.state;
}
- else
- seat_keymap_create(s);
- seat_kbd_repeat_rate_update(s);
- seat_keymap_update(s);
- s->keyboard = !!s->kbd.state;
}
}
else if (!c->parent_disp)
comp_device_caps_update(s);
s->global = wl_global_create(c->display, &wl_seat_interface, 4, s, seat_bind);
+ evas_object_smart_callback_call(s->c->obj, "seat_added", dev);
if (ecore_wl2_display_sync_is_done(c->client_disp))
seat_proxy_update(s);
}
@@ -4392,18 +4615,23 @@ comp_seat_caps_handler(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Wl2_Event_S
s->pointer = ev->pointer_enabled;
if (s->keyboard != ev->keyboard_enabled)
{
- if (ev->keyboard_enabled)
- {
- s->kbd.keymap = ecore_wl2_input_keymap_get(s->seat);
- if (s->kbd.keymap) xkb_keymap_ref(s->kbd.keymap);
- seat_kbd_repeat_rate_update(s);
- }
+ if (s->kbd.external)
+ seat_kbd_external_init(s);
else
{
- xkb_keymap_unref(s->kbd.keymap);
- s->kbd.keymap = NULL;
+ if (ev->keyboard_enabled)
+ {
+ s->kbd.keymap = ecore_wl2_input_keymap_get(s->seat);
+ if (s->kbd.keymap) xkb_keymap_ref(s->kbd.keymap);
+ seat_kbd_repeat_rate_update(s);
+ }
+ else
+ {
+ xkb_keymap_unref(s->kbd.keymap);
+ s->kbd.keymap = NULL;
+ }
+ seat_keymap_update(s);
}
- seat_keymap_update(s);
}
s->keyboard = !!ev->keyboard_enabled && !!s->kbd.state;
s->touch = ev->touch_enabled;
@@ -4453,6 +4681,7 @@ comp_seat_keymap_changed(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Wl2_Event
{
struct xkb_keymap *keymap;
+ if (s->kbd.external) continue;
if (ecore_wl2_input_seat_id_get(s->seat) != ev->id) continue;
if (s->kbd.keymap) xkb_map_unref(s->kbd.keymap);
@@ -4469,6 +4698,21 @@ comp_seat_keymap_changed(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Wl2_Event
return ECORE_CALLBACK_RENEW;
}
+static void
+seat_kbd_repeat_rate_send(Comp_Seat *s)
+{
+ Eina_List *ll, *lll;
+ struct wl_resource *res;
+ Eina_Iterator *it;
+
+ it = eina_hash_iterator_data_new(s->kbd.resources);
+ EINA_ITERATOR_FOREACH(it, ll)
+ EINA_LIST_FOREACH(ll, lll, res)
+ if (wl_resource_get_version(res) >= WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION)
+ wl_keyboard_send_repeat_info(res, s->kbd.repeat_rate, s->kbd.repeat_delay);
+ eina_iterator_free(it);
+}
+
static Eina_Bool
comp_seat_keyboard_repeat_changed(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Wl2_Event_Seat_Keyboard_Repeat_Changed *ev)
{
@@ -4480,36 +4724,23 @@ comp_seat_keyboard_repeat_changed(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_
if (c->parent_disp == ev->display)
EINA_INLIST_FOREACH(c->seats, s)
{
- Eina_List *ll, *lll;
- struct wl_resource *res;
- Eina_Iterator *it;
-
if (ecore_wl2_input_seat_id_get(s->seat) != ev->id) continue;
+ if (s->kbd.external) continue;
seat_kbd_repeat_rate_update(s);
- it = eina_hash_iterator_data_new(s->kbd.resources);
- EINA_ITERATOR_FOREACH(it, ll)
- EINA_LIST_FOREACH(ll, lll, res)
- if (wl_resource_get_version(res) >= WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION)
- wl_keyboard_send_repeat_info(res, s->kbd.repeat_rate, s->kbd.repeat_delay);
- eina_iterator_free(it);
+ seat_kbd_repeat_rate_send(s);
}
return ECORE_CALLBACK_RENEW;
}
static void
-comp_seat_key_update(Comp_Seat *s, xkb_keycode_t key, int dir, unsigned int timestamp)
+comp_seat_key_send(Comp_Seat *s, xkb_keycode_t key, int dir, unsigned int timestamp, Eina_Bool mods)
{
Eina_List *l, *ll;
struct wl_resource *res;
uint32_t serial = wl_display_next_serial(s->c->display);
- uint32_t xkb[] = { XKB_KEY_DOWN, XKB_KEY_UP };
uint32_t wl[] = { WL_KEYBOARD_KEY_STATE_PRESSED, WL_KEYBOARD_KEY_STATE_RELEASED };
- Eina_Bool mods = EINA_FALSE;
- if (xkb_state_update_key(s->kbd.state, key + 8, xkb[dir]))
- mods = seat_mods_update(s);
- if (!s->focused) return;
l = seat_kbd_active_resources_get(s);
EINA_LIST_FOREACH(l, ll, res)
@@ -4519,6 +4750,18 @@ comp_seat_key_update(Comp_Seat *s, xkb_keycode_t key, int dir, unsigned int time
}
}
+static void
+comp_seat_key_update(Comp_Seat *s, xkb_keycode_t key, int dir, unsigned int timestamp)
+{
+ uint32_t xkb[] = { XKB_KEY_DOWN, XKB_KEY_UP };
+ Eina_Bool mods = EINA_FALSE;
+
+ if (s->kbd.external || xkb_state_update_key(s->kbd.state, key + 8, xkb[dir]))
+ mods = seat_kbd_mods_update(s);
+ if (s->focused)
+ comp_seat_key_send(s, key, dir, timestamp, mods);
+}
+
static Eina_Bool
comp_key_down(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Key *ev)
{
@@ -4532,17 +4775,25 @@ comp_key_down(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Key *ev)
EINA_LIST_FOREACH(comps, l, c)
EINA_INLIST_FOREACH(c->seats, s)
{
- uint32_t *end, *k;
-
if (c->parent_disp && (dev != s->dev)) continue;
- end = (uint32_t*)s->kbd.keys.data + (s->kbd.keys.size / sizeof(uint32_t));
- for (k = s->kbd.keys.data; k < end; k++)
- if (*k == keycode) return ECORE_CALLBACK_RENEW;
+ if (s->kbd.external)
+ {
+ /* only doing passthrough in external mode */
+ if (!s->focused) return ECORE_CALLBACK_RENEW;
+ }
+ else
+ {
+ uint32_t *end, *k;
+
+ end = (uint32_t*)s->kbd.keys.data + (s->kbd.keys.size / sizeof(uint32_t));
+ for (k = s->kbd.keys.data; k < end; k++)
+ if (*k == keycode) return ECORE_CALLBACK_RENEW;
- s->kbd.keys.size = (char*)end - (char*)s->kbd.keys.data;
- k = wl_array_add(&s->kbd.keys, sizeof(uint32_t));
- *k = keycode;
+ s->kbd.keys.size = (char*)end - (char*)s->kbd.keys.data;
+ k = wl_array_add(&s->kbd.keys, sizeof(uint32_t));
+ *k = keycode;
+ }
comp_seat_key_update(s, keycode, 0, ev->timestamp);
}
return ECORE_CALLBACK_RENEW;
@@ -4561,19 +4812,27 @@ comp_key_up(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Key *ev)
EINA_LIST_FOREACH(comps, l, c)
EINA_INLIST_FOREACH(c->seats, s)
{
- uint32_t *end, *k;
-
if (c->parent_disp && (dev != s->dev)) continue;
- end = (uint32_t*)s->kbd.keys.data + (s->kbd.keys.size / sizeof(uint32_t));
- for (k = s->kbd.keys.data; k < end; k++)
- if (*k == keycode)
- {
- *k = end[-1];
- s->kbd.keys.size = (char*)end - (char*)s->kbd.keys.data - 1;
- break;
- }
+ if (s->kbd.external)
+ {
+ /* only doing passthrough in external mode */
+ if (!s->focused) return ECORE_CALLBACK_RENEW;
+ }
+ else
+ {
+ uint32_t *end, *k;
+
+ end = (uint32_t*)s->kbd.keys.data + (s->kbd.keys.size / sizeof(uint32_t));
+ for (k = s->kbd.keys.data; k < end; k++)
+ if (*k == keycode)
+ {
+ *k = end[-1];
+ s->kbd.keys.size = (char*)end - (char*)s->kbd.keys.data - 1;
+ break;
+ }
+ }
comp_seat_key_update(s, keycode, 1, ev->timestamp);
}
return ECORE_CALLBACK_RENEW;
@@ -4823,8 +5082,27 @@ comp_focus_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, voi
s->focused = 1;
if (s->selection_changed)
comp_seat_selection_update(s);
- if (!s->kbd.keymap) continue;
- if (!seat_mods_update(s)) continue;
+ if ((!s->kbd.keymap) && (!s->kbd.state)) continue;
+ if (s->kbd.external)
+ {
+ Eina_Bool mods = seat_kbd_mods_update(s);
+ if (!s->focused) return;
+ l = seat_kbd_active_resources_get(s);
+
+ EINA_LIST_FOREACH(l, ll, res)
+ {
+ uint32_t *end, *k;
+ serial = wl_display_next_serial(s->c->display);
+
+ end = (uint32_t*)s->kbd.keys_external->data + (s->kbd.keys_external->size / sizeof(uint32_t));
+ if (mods) comp_seat_send_modifiers(s, res, serial);
+
+ for (k = s->kbd.keys_external->data; k < end; k++)
+ comp_seat_key_send(s, *k, 0, 0, mods);
+ }
+ return;
+ }
+ if (!seat_kbd_mods_update(s)) continue;
l = seat_kbd_active_resources_get(s);
if (!l) continue;
serial = wl_display_next_serial(s->c->display);
@@ -4854,9 +5132,13 @@ comp_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info)
Comp *c = data;
Evas_Event_Mouse_In *ev = event_info;
Comp_Seat *s;
-
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
s = comp_seat_find(c, ev->dev);
+
+ if (!s->event_propagate)
+ {
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
+ }
+ s->event_propagate = 0;
if (s->drag.proxy_win)
{
ecore_evas_free(s->drag.proxy_win);
@@ -4890,8 +5172,12 @@ comp_multi_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, v
Comp_Seat *s;
int w, h;
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
s = comp_seat_find(c, ev->dev);
+ if (!s->event_propagate)
+ {
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
+ }
+ s->event_propagate = 0;
s->tch.pos.x = ev->cur.canvas.x;
s->tch.pos.y = ev->cur.canvas.y;
if ((!s->drag.tch) || (!s->drag.surface)) return;
@@ -4907,8 +5193,12 @@ comp_mouse_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, v
Comp_Seat *s;
int w, h;
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
s = comp_seat_find(c, ev->dev);
+ if (!s->event_propagate)
+ {
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
+ }
+ s->event_propagate = 0;
s->ptr.pos.x = ev->cur.canvas.x;
s->ptr.pos.y = ev->cur.canvas.y;
if (s->drag.tch || (!s->drag.surface)) return;
@@ -4926,8 +5216,13 @@ comp_mouse_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_in
const char **types, *type;
unsigned int i = 0;
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
s = comp_seat_find(c, ev->dev);
+ if (!s->event_propagate)
+ {
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
+ }
+ s->event_propagate = 0;
+ if (!s->ptr.in) return;
s->ptr.in = 0;
ecore_evas_cursor_device_unset(ecore_evas_ecore_evas_get(e), ev->dev);
if (s->ptr.efl.obj)
@@ -4990,8 +5285,8 @@ comp_mouse_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_in
}
EFL_CALLBACKS_ARRAY_DEFINE(comp_device_cbs,
- { EFL_CANVAS_EVENT_DEVICE_ADDED, comp_device_add },
- { EFL_CANVAS_EVENT_DEVICE_REMOVED, comp_device_del });
+ { EFL_CANVAS_SCENE_EVENT_DEVICE_ADDED, comp_device_add },
+ { EFL_CANVAS_SCENE_EVENT_DEVICE_REMOVED, comp_device_del });
static void
hints_set_aspect(struct wl_client *client, struct wl_resource *resource, struct wl_resource *surface, uint32_t width, uint32_t height, uint32_t aspect)
@@ -5074,7 +5369,7 @@ comp_smart_add(Evas_Object *obj)
wl_global_create(c->display, &wl_compositor_interface, 4, c, comp_bind);
wl_global_create(c->display, &wl_subcompositor_interface, 1, c, subcomp_bind);
wl_global_create(c->display, &wl_output_interface, 2, c, output_bind);
- wl_global_create(c->display, &zxdg_shell_v6_interface, 1, c, shell_bind);
+ wl_global_create(c->display, &xdg_wm_base_interface, 1, c, shell_bind);
wl_global_create(c->display, &wl_data_device_manager_interface, 3, c, data_device_manager_bind);
wl_global_create(c->display, &efl_hints_interface, 1, c, efl_hints_bind);
wl_display_init_shm(c->display);
@@ -5096,6 +5391,7 @@ comp_smart_add(Evas_Object *obj)
#ifdef HAVE_ECORE_X
if (ecore_x_display_get())
{
+ ecore_x_xkb_track_state();
// if proxiedallowed
ecore_x_dnd_aware_set(ecore_evas_window_get(ecore_evas_ecore_evas_get(c->evas)), EINA_TRUE);
if (!comps) x11_init();
@@ -5206,14 +5502,22 @@ static void
comp_smart_show(Evas_Object *obj)
{
Comp *c = evas_object_smart_data_get(obj);
+ Comp_Surface *cs;
+
evas_object_show(c->clip);
+ EINA_INLIST_FOREACH(c->surfaces, cs)
+ comp_surface_output_leave(cs);
}
static void
comp_smart_hide(Evas_Object *obj)
{
Comp *c = evas_object_smart_data_get(obj);
+ Comp_Surface *cs;
+
evas_object_hide(c->clip);
+ EINA_INLIST_FOREACH(c->surfaces, cs)
+ comp_surface_output_leave(cs);
}
static void
@@ -5288,8 +5592,6 @@ exe_event_del(void *data, int t EINA_UNUSED, Ecore_Exe_Event_Del *ev)
Comp *c = data;
int32_t pid = ev->pid;
- if (!eina_streq(ecore_exe_tag_get(ev->exe), "__efl_wl")) return ECORE_CALLBACK_RENEW;
-
eina_hash_del_by_key(c->exes, &pid);
return ECORE_CALLBACK_RENEW;
}
@@ -5315,6 +5617,8 @@ comp_dmabuf_test(struct linux_dmabuf_buffer *dmabuf)
ns.version = EVAS_NATIVE_SURFACE_VERSION;
ns.data.wl_dmabuf.attr = &dmabuf->attributes;
ns.data.wl_dmabuf.resource = NULL;
+ ns.data.wl_dmabuf.scanout.handler = NULL;
+ ns.data.wl_dmabuf.scanout.data = NULL;
test = evas_object_image_add(c->evas);
evas_object_image_native_surface_set(test, &ns);
ret = evas_object_image_load_error_get(test) == EVAS_LOAD_ERROR_NONE;
@@ -5358,7 +5662,7 @@ efl_wl_add(Evas *e)
}
Ecore_Exe *
-efl_wl_run(Evas_Object *obj, const char *cmd)
+comp_run(Evas_Object *obj, const char *cmd, Ecore_Exe_Flags flags)
{
char *env, *disp, *gl = NULL;
Comp *c;
@@ -5383,7 +5687,7 @@ efl_wl_run(Evas_Object *obj, const char *cmd)
if (gl) gl = strdup(gl);
setenv("ELM_ACCEL", "gl", 1);
}
- exe = ecore_exe_pipe_run(cmd, ECORE_EXE_TERM_WITH_PARENT, c);
+ exe = ecore_exe_pipe_run(cmd, flags, c);
if (disp) setenv("DISPLAY", disp, 1);
if (env) setenv("WAYLAND_DISPLAY", env, 1);
else unsetenv("WAYLAND_DISPLAY");
@@ -5398,12 +5702,46 @@ efl_wl_run(Evas_Object *obj, const char *cmd)
if (exe)
{
int32_t pid = ecore_exe_pid_get(exe);
- ecore_exe_tag_set(exe, "__efl_wl");
- eina_hash_add(c->exes, &pid, exe);
+ eina_hash_add(c->exes, &pid, (void*)1);
}
return exe;
}
+Ecore_Exe *
+efl_wl_run(Evas_Object *obj, const char *cmd)
+{
+ return comp_run(obj, cmd, ECORE_EXE_TERM_WITH_PARENT);
+}
+
+Ecore_Exe *
+efl_wl_flags_run(Evas_Object *obj, const char *cmd, Ecore_Exe_Flags flags)
+{
+ return comp_run(obj, cmd, flags);
+}
+
+void
+efl_wl_pid_add(Evas_Object *obj, int32_t pid)
+{
+ Comp *c;
+
+ if (!eina_streq(evas_object_type_get(obj), "comp")) abort();
+ c = evas_object_smart_data_get(obj);
+ if (!c->exes)
+ c->exes = eina_hash_int32_new(NULL);
+ eina_hash_add(c->exes, &pid, (void*)1);
+}
+
+void
+efl_wl_pid_del(Evas_Object *obj, int32_t pid)
+{
+ Comp *c;
+
+ if (!eina_streq(evas_object_type_get(obj), "comp")) abort();
+ c = evas_object_smart_data_get(obj);
+ if (!c->exes) return;
+ eina_hash_del_by_key(c->exes, &pid);
+}
+
Eina_Bool
efl_wl_next(Evas_Object *obj)
{
@@ -5600,8 +5938,56 @@ efl_wl_extracted_surface_extracted_parent_get(Evas_Object *surface)
if (cs->parent)
{
- EINA_SAFETY_ON_FALSE_RETURN_VAL(!cs->parent->extracted, NULL);
+ if (!cs->parent->extracted) return NULL;
return cs->parent->obj;
}
return NULL;
}
+
+void
+efl_wl_seat_keymap_set(Evas_Object *obj, Eo *seat, void *state, int fd, size_t size, void *key_array)
+{
+ Comp *c;
+ Comp_Seat *s;
+
+ if (!eina_streq(evas_object_type_get(obj), "comp")) abort();
+ c = evas_object_smart_data_get(obj);
+ EINA_INLIST_FOREACH(c->seats, s)
+ {
+ if (!seat) efl_wl_seat_keymap_set(obj, s->dev, state, fd, size, key_array);
+ else if (s->dev == seat) break;
+ }
+ if (!seat) return;
+ EINA_SAFETY_ON_NULL_RETURN(s);
+ seat_kbd_destroy(s);
+ s->kbd.external = 1;
+ s->kbd.keys_external = key_array;
+ s->kbd.state = state;
+ s->kbd.keymap_fd = fd;
+ s->kbd.keymap_mem_size = size;
+ s->kbd.context = NULL;
+ s->kbd.keymap = NULL;
+ s->kbd.keymap_mem = NULL;
+ if (s->keyboard)
+ seat_kbd_external_init(s);
+}
+
+void
+efl_wl_seat_key_repeat_set(Evas_Object *obj, Eo *seat, int repeat_rate, int repeat_delay)
+{
+ Comp *c;
+ Comp_Seat *s;
+
+ if (!eina_streq(evas_object_type_get(obj), "comp")) abort();
+ c = evas_object_smart_data_get(obj);
+ EINA_INLIST_FOREACH(c->seats, s)
+ {
+ if (!seat) efl_wl_seat_key_repeat_set(obj, s->dev, repeat_rate, repeat_delay);
+ else if (s->dev == seat) break;
+ }
+ if (!seat) return;
+ EINA_SAFETY_ON_NULL_RETURN(s);
+ s->kbd.repeat_rate = repeat_rate;
+ s->kbd.repeat_delay = repeat_delay;
+ seat_kbd_repeat_rate_send(s);
+}
diff --git a/src/lib/efl_wl/x11.x b/src/lib/efl_wl/x11.x
index bebd017519..2d7a88352f 100644
--- a/src/lib/efl_wl/x11.x
+++ b/src/lib/efl_wl/x11.x
@@ -1,3 +1,5 @@
+#include "xkbcommon/xkbcommon-x11.h"
+
#define WL_TEXT_STR "text/plain;charset=utf-8"
#define INCR_CHUNK_SIZE 1 << 17
@@ -562,6 +564,99 @@ x11_dnd_move(void *data, Ecore_X_Xdnd_Position *pos)
evas_object_move(data, pos->position.x, pos->position.y);
}
+static int32_t x11_core_device = -1;
+static struct xkb_context *x11_kbd_context;
+static struct xkb_keymap *x11_kbd_keymap;
+static struct xkb_state *x11_kbd_state;
+
+static Eina_Bool seat_kbd_mods_update(Comp_Seat *s);
+static void comp_seat_send_modifiers(Comp_Seat *s, struct wl_resource *res, uint32_t serial);
+
+static Eina_Bool
+x11_xkb_state(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_X_Event_Xkb *ev)
+{
+ Comp *c;
+ Eina_List *l;
+ Comp_Seat *s;
+
+ if (!xkb_state_update_mask(x11_kbd_state,
+ get_xkb_mod_mask(ev->base_mods),
+ get_xkb_mod_mask(ev->latched_mods),
+ get_xkb_mod_mask(ev->locked_mods),
+ 0,
+ 0,
+ ev->group)) return ECORE_CALLBACK_RENEW;
+ EINA_LIST_FOREACH(comps, l, c)
+ EINA_INLIST_FOREACH(c->seats, s)
+ {
+ Eina_List *ll, *lll;
+ uint32_t serial;
+ struct wl_resource *res;
+
+ seat_kbd_mods_update(s);
+ ll = seat_kbd_active_resources_get(s);
+ if (!ll) continue;
+ serial = wl_display_next_serial(s->c->display);
+ EINA_LIST_FOREACH(ll, lll, res)
+ comp_seat_send_modifiers(s, res, serial);
+ }
+ return ECORE_CALLBACK_RENEW;
+}
+
+static void
+x11_kbd_destroy(void)
+{
+ if (x11_kbd_state) xkb_state_unref(x11_kbd_state);
+ x11_kbd_state = NULL;
+ if (x11_kbd_keymap) xkb_keymap_unref(x11_kbd_keymap);
+ x11_kbd_keymap = NULL;
+ if (x11_kbd_context) xkb_context_unref(x11_kbd_context);
+ x11_kbd_context = NULL;
+}
+
+static void
+x11_kbd_create(void)
+{
+ Ecore_X_Connection *conn = ecore_x_connection_get();
+
+ x11_kbd_destroy();
+
+ x11_kbd_context = xkb_context_new(0);
+ x11_core_device = xkb_x11_get_core_keyboard_device_id(conn);
+ x11_kbd_keymap = xkb_x11_keymap_new_from_device(x11_kbd_context, conn, x11_core_device, 0);
+ x11_kbd_state = xkb_x11_state_new_from_device(x11_kbd_keymap, conn, x11_core_device);
+ keymap_mods_init(x11_kbd_keymap);
+}
+
+static void
+x11_kbd_apply(Comp_Seat *s)
+{
+ if (!x11_kbd_state) x11_kbd_create();
+ s->kbd.context = x11_kbd_context;
+ s->kbd.keymap = x11_kbd_keymap;
+ s->kbd.state = x11_kbd_state;
+}
+
+static void seat_keymap_update(Comp_Seat *s);
+
+static Eina_Bool
+x11_xkb_refresh()
+{
+ Eina_List *l;
+ Comp *c;
+ Comp_Seat *s;
+
+ x11_kbd_create();
+ EINA_LIST_FOREACH(comps, l, c)
+ EINA_INLIST_FOREACH(c->seats, s)
+ {
+ if (!s->keyboard) continue;
+ x11_kbd_apply(s);
+ seat_keymap_update(s);
+ }
+ return ECORE_CALLBACK_RENEW;
+}
+
static void
x11_init(void)
{
@@ -589,18 +684,29 @@ x11_init(void)
handlers = eina_list_append(handlers, h);
h = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP, (Ecore_Event_Handler_Cb)x11_dnd_mouse_up, NULL);
handlers = eina_list_append(handlers, h);
- xconvertselection = dlsym(NULL, "XConvertSelection");
- string_atom = ecore_x_atom_get("UTF8_STRING");
- timestamp_atom = ecore_x_atom_get("TIMESTAMP");
- int_atom = ecore_x_atom_get("INTEGER");
- incr_atom = ecore_x_atom_get("TIMESTAMP");
- comp_dnd_atom = ecore_x_atom_get("SIRCMPWIDG_ATOM");
+ h = ecore_event_handler_add(ECORE_X_EVENT_XKB_STATE_NOTIFY, (Ecore_Event_Handler_Cb)x11_xkb_state, NULL);
+ handlers = eina_list_append(handlers, h);
+ h = ecore_event_handler_add(ECORE_X_EVENT_XKB_NEWKBD_NOTIFY, (Ecore_Event_Handler_Cb)x11_xkb_refresh, NULL);
+ handlers = eina_list_append(handlers, h);
+ if (!xconvertselection)
+ {
+ xconvertselection = dlsym(NULL, "XConvertSelection");
+ string_atom = ecore_x_atom_get("UTF8_STRING");
+ timestamp_atom = ecore_x_atom_get("TIMESTAMP");
+ int_atom = ecore_x_atom_get("INTEGER");
+ incr_atom = ecore_x_atom_get("TIMESTAMP");
+ comp_dnd_atom = ecore_x_atom_get("SIRCMPWIDG_ATOM");
+ ecore_x_xkb_track_state();
+ }
+
pipes = eina_hash_int32_new((Eina_Free_Cb)_pipe_free);
}
static void
x11_shutdown(void)
{
+ x11_core_device = -1;
+ x11_kbd_destroy();
eina_hash_free(pipes);
pipes = NULL;
}
diff --git a/src/lib/efreet/Efreet.h b/src/lib/efreet/Efreet.h
index e83784da1d..22d2291f44 100644
--- a/src/lib/efreet/Efreet.h
+++ b/src/lib/efreet/Efreet.h
@@ -78,16 +78,22 @@
# undef EAPI
#endif
+#ifdef EFL_BUILD
+# define EFREET_DEPRECATED_API
+#else
+# define EFREET_DEPRECATED_API EINA_DEPRECATED
+#endif
+
#ifdef _WIN32
-# ifdef EFL_EFREET_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EFREET_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -149,6 +155,18 @@ EAPI int efreet_shutdown(void);
*/
EAPI void efreet_lang_reset(void);
+/**
+ * @brief Disables connecting to efreet cache for this process.
+ * @since 1.21
+ */
+EAPI void efreet_cache_disable(void);
+
+/**
+ * @brief Enables connecting to efreet cache for this process.
+ * @since 1.21
+ */
+EAPI void efreet_cache_enable(void);
+
#undef EAPI
#define EAPI
diff --git a/src/lib/efreet/Efreet_Mime.h b/src/lib/efreet/Efreet_Mime.h
index 1e1bc2b22b..29d65e516c 100644
--- a/src/lib/efreet/Efreet_Mime.h
+++ b/src/lib/efreet/Efreet_Mime.h
@@ -19,15 +19,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_EFREET_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EFREET_MIME_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -127,4 +127,7 @@ EAPI void efreet_mime_type_cache_flush(void);
}
#endif
+#undef EAPI
+#define EAPI
+
#endif
diff --git a/src/lib/efreet/Efreet_Trash.h b/src/lib/efreet/Efreet_Trash.h
index 64af9ea74c..5ecf41d9be 100644
--- a/src/lib/efreet/Efreet_Trash.h
+++ b/src/lib/efreet/Efreet_Trash.h
@@ -6,15 +6,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_EFREET_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EFREET_TRASH_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -101,4 +101,7 @@ EAPI int efreet_trash_empty_trash(void);
}
#endif
+#undef EAPI
+#define EAPI
+
#endif
diff --git a/src/lib/efreet/efreet.c b/src/lib/efreet/efreet.c
index 091899f2b2..d17e1dabaf 100644
--- a/src/lib/efreet/efreet.c
+++ b/src/lib/efreet/efreet.c
@@ -10,6 +10,8 @@
#include <Ecore.h>
#include <Ecore_File.h>
+#include "eina_internal.h"
+
/* define macros and variable for using the eina logging system */
#define EFREET_MODULE_LOG_DOM /* no logging in this file */
@@ -36,6 +38,79 @@ static uid_t ruid;
static uid_t rgid;
#endif
+static void
+_efreet_efreet_app_interface_set(void)
+{
+ char buf[PATH_MAX];
+ char *s;
+ const char *home;
+ Eina_Vpath_Interface_User user;
+
+ home = eina_vpath_resolve("(:home:)/");
+
+ memset(&user, 0, sizeof(Eina_Vpath_Interface_User));
+
+# if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
+# define ENV_HOME_SET(_env, _dir, _meta) \
+ if ((getuid() != geteuid()) || (!(s = getenv(_env)))) { \
+ snprintf(buf, sizeof(buf), "%s/"_dir, home); \
+ s = buf; \
+ } \
+ (&user)->_meta = s;
+#else
+# define ENV_HOME_SET(_env, _dir, _meta) \
+ if (!(s = getenv(_env))) { \
+ snprintf(buf, sizeof(buf), "%s/"_dir, home); \
+ s = buf; \
+ } \
+ (&user)->_meta = s;
+#endif
+ // $XDG_DESKTOP_DIR="$HOME/Desktop"
+ ENV_HOME_SET("XDG_DESKTOP_DIR", "Desktop", desktop);
+ // $XDG_DOCUMENTS_DIR="$HOME/Documents"
+ ENV_HOME_SET("XDG_DOCUMENTS_DIR", "Documents", documents);
+ // $XDG_DOWNLOAD_DIR="$HOME/Downloads"
+ ENV_HOME_SET("XDG_DOWNLOAD_DIR", "Downloads", downloads);
+ // $XDG_MUSIC_DIR="$HOME/Music"
+ ENV_HOME_SET("XDG_MUSIC_DIR", "Music", music);
+ // $XDG_PICTURES_DIR="$HOME/Pictures"
+ ENV_HOME_SET("XDG_PICTURES_DIR", "Pictures", pictures);
+ // $XDG_PUBLICSHARE_DIR="$HOME/Public"
+ ENV_HOME_SET("XDG_PUBLIC_DIR", "Public", pub);
+ // $XDG_TEMPLATES_DIR="$HOME/.Templates"
+ ENV_HOME_SET("XDG_TEMPLATES_DIR", ".Templates", templates);
+ // $XDG_VIDEOS_DIR="$HOME/Videos"
+ ENV_HOME_SET("XDG_VIDEOS_DIR", "Videos", videos);
+ // $XDG_DATA_HOME defines the base directory relative to which user
+ // specific data files should be stored. If $XDG_DATA_HOME is either
+ // not set or empty, a default equal to $HOME/.local/share should be
+ // used.
+ ENV_HOME_SET("XDG_DATA_HOME", ".local/share", data);
+ ENV_HOME_SET("XDG_TMP_HOME", ".local/tmp", tmp);
+ // $XDG_CONFIG_HOME defines the base directory relative to which user
+ // specific configuration files should be stored. If $XDG_CONFIG_HOME
+ // is either not set or empty, a default equal to $HOME/.config should
+ // be used.
+ ENV_HOME_SET("XDG_CONFIG_HOME", ".config", config);
+ // $XDG_CACHE_HOME defines the base directory relative to which
+ // user specific non-essential data files should be stored. If
+ // $XDG_CACHE_HOME is either not set or empty, a default equal to
+ // $HOME/.cache should be used.
+ ENV_HOME_SET("XDG_CACHE_HOME", ".cache", cache);
+
+#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
+ if ((getuid() != geteuid()) || (!(s = getenv("XDG_RUNTIME_DIR"))))
+#else
+ if (!(s = getenv("XDG_RUNTIME_DIR")))
+#endif
+ user.run = NULL;
+ else
+ user.run = s;
+
+ eina_vpath_interface_user_set(&user);
+}
+
+
EAPI int
efreet_init(void)
{
@@ -70,6 +145,9 @@ efreet_init(void)
if (!ecore_file_init())
goto shutdown_ecore;
+ //this needs to be early initializied efreet itself is using vpaths
+ _efreet_efreet_app_interface_set();
+
if (!efreet_base_init())
goto shutdown_ecore_file;
diff --git a/src/lib/efreet/efreet_base.c b/src/lib/efreet/efreet_base.c
index 63810318f8..8b35285148 100644
--- a/src/lib/efreet/efreet_base.c
+++ b/src/lib/efreet/efreet_base.c
@@ -279,7 +279,6 @@ efreet_dirs_reset(void)
static void
efreet_dirs_init(void)
{
- Efl_Vpath_File *file_obj;
char buf[PATH_MAX];
/* efreet_home_dir */
@@ -309,10 +308,9 @@ efreet_dirs_init(void)
#endif
/* xdg_runtime_dir */
- file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS,
- "(:run:)/");
- xdg_runtime_dir = eina_stringshare_add(efl_vpath_file_result_get(file_obj));
- efl_del(file_obj);
+ char *tmp = eina_vpath_resolve("(:usr.run:)/");
+ xdg_runtime_dir = eina_stringshare_add(tmp);
+ free(tmp);
/* hostname */
if (gethostname(buf, sizeof(buf)) < 0)
diff --git a/src/lib/efreet/efreet_cache.c b/src/lib/efreet/efreet_cache.c
index 0df7a7b887..bdbd07b5b2 100644
--- a/src/lib/efreet/efreet_cache.c
+++ b/src/lib/efreet/efreet_cache.c
@@ -16,6 +16,7 @@
#include <Ecore.h>
#include <Ecore_File.h>
#include <Ecore_Ipc.h>
+#include <Ecore_Con.h>
/* define macros and variable for using the eina logging system */
#define EFREET_MODULE_LOG_DOM _efreet_cache_log_dom
@@ -24,7 +25,7 @@ static int _efreet_cache_log_dom = -1;
#include "Efreet.h"
#include "efreet_private.h"
#include "efreet_cache_private.h"
-
+#include "../../static_libs/buildsystem/buildsystem.h"
#define NON_EXISTING (void *)-1
typedef struct _Efreet_Old_Cache Efreet_Old_Cache;
@@ -36,7 +37,6 @@ struct _Efreet_Old_Cache
};
static Ecore_Ipc_Server *ipc = NULL;
-static Eina_Prefix *pfx = NULL;
static Ecore_Event_Handler *hnd_add = NULL;
static Ecore_Event_Handler *hnd_del = NULL;
static Ecore_Event_Handler *hnd_data = NULL;
@@ -99,6 +99,9 @@ static void icon_cache_update_free(void *data, void *ev);
static void *hash_array_string_add(void *hash, const char *key, void *data);
+static Eina_Bool disable_cache;
+static Eina_Bool run_in_tree;
+
EAPI int EFREET_EVENT_ICON_CACHE_UPDATE = 0;
EAPI int EFREET_EVENT_DESKTOP_CACHE_UPDATE = 0;
EAPI int EFREET_EVENT_DESKTOP_CACHE_BUILD = 0;
@@ -114,8 +117,10 @@ _ipc_launch(void)
char buf[PATH_MAX];
int num = 0;
- if (!pfx) snprintf(buf, sizeof(buf), "efreetd");
- else snprintf(buf, sizeof(buf), "%s/efreetd", eina_prefix_bin_get(pfx));
+ if (run_in_tree)
+ bs_binary_get(buf, sizeof(buf), "efreet", "efreetd");
+ else
+ snprintf(buf, sizeof(buf), PACKAGE_BIN_DIR "/efreetd");
ecore_exe_run(buf, NULL);
while ((!ipc) && (num < 500))
{
@@ -162,11 +167,14 @@ _cb_server_del(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
double t;
IPC_HEAD(Del);
ipc = NULL;
+
+ if (disable_cache) return ECORE_CALLBACK_RENEW;
if (reconnect_count > 10)
{
+ char *address = ecore_con_local_path_new(EINA_FALSE, "efreetd", 0);
reconnect_timer = NULL;
- ERR("efreetd connection failed 10 times! check for stale socket files in %s/.ecore/efreetd",
- efreet_runtime_dir_get());
+ ERR("efreetd connection failed 10 times! check for stale socket file at %s", address);
+ free(address);
return EINA_FALSE;
}
t = ecore_time_get();
@@ -182,6 +190,24 @@ _cb_server_del(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
}
static void
+_efreet_cache_reset()
+{
+ const char *s;
+ int len = 0;
+
+ if (ipc) ecore_ipc_server_del(ipc);
+ ipc = NULL;
+ if (!disable_cache)
+ ipc = ecore_ipc_server_connect(ECORE_IPC_LOCAL_USER, "efreetd", 0, NULL);
+ if (!ipc) return;
+
+ s = efreet_language_get();
+ if (s) len = strlen(s);
+ ecore_ipc_server_send(ipc, 1, 0, 0, 0, 0, s, len);
+ efreet_icon_extensions_refresh();
+}
+
+static void
_icon_desktop_cache_update_event_add(int event_type)
{
Efreet_Event_Cache_Update *ev;
@@ -283,6 +309,8 @@ efreet_cache_init(void)
ERR("Failed to create directory '%s'", buf);
}
+ run_in_tree = !!getenv("EFL_RUN_IN_TREE");
+
EFREET_EVENT_ICON_CACHE_UPDATE = ecore_event_type_new();
EFREET_EVENT_DESKTOP_CACHE_UPDATE = ecore_event_type_new();
EFREET_EVENT_DESKTOP_CACHE_BUILD = ecore_event_type_new();
@@ -297,11 +325,13 @@ efreet_cache_init(void)
if (efreet_cache_update)
{
- pfx = eina_prefix_new
- (NULL, efreet_icon_cache_file, "EFREET", "efreet", "checkme",
- PACKAGE_BIN_DIR, PACKAGE_LIB_DIR, PACKAGE_DATA_DIR, PACKAGE_DATA_DIR);
- ipc = ecore_ipc_server_connect(ECORE_IPC_LOCAL_USER, "efreetd", 0, NULL);
- if (!ipc) _ipc_launch();
+ if (disable_cache)
+ ipc = NULL;
+ else
+ {
+ ipc = ecore_ipc_server_connect(ECORE_IPC_LOCAL_USER, "efreetd", 0, NULL);
+ if (!ipc) _ipc_launch();
+ }
if (ipc)
{
const char *s;
@@ -321,7 +351,8 @@ efreet_cache_init(void)
{
Efreet_Event_Cache_Update *ev;
- WRN("Can't contact efreetd daemon for desktop/icon etc. changes");
+ if (!disable_cache)
+ WRN("Can't contact efreetd daemon for desktop/icon etc. changes");
ev = NEW(Efreet_Event_Cache_Update, 1);
if (ev)
{
@@ -330,6 +361,7 @@ efreet_cache_init(void)
}
}
}
+ ecore_fork_reset_callback_add(_efreet_cache_reset, NULL);
return 1;
error:
@@ -354,7 +386,7 @@ efreet_cache_shutdown(void)
ecore_event_type_flush(EFREET_EVENT_ICON_CACHE_UPDATE,
EFREET_EVENT_DESKTOP_CACHE_UPDATE,
EFREET_EVENT_DESKTOP_CACHE_BUILD);
-
+ ecore_fork_reset_callback_del(_efreet_cache_reset, NULL);
IF_RELEASE(theme_name);
icon_cache = efreet_cache_close(icon_cache);
@@ -397,7 +429,6 @@ efreet_cache_shutdown(void)
IF_RELEASE(util_cache_file);
if (ipc) ecore_ipc_server_del(ipc);
- if (pfx) eina_prefix_free(pfx);
if (hnd_add) ecore_event_handler_del(hnd_add);
if (hnd_del) ecore_event_handler_del(hnd_del);
if (hnd_data) ecore_event_handler_del(hnd_data);
@@ -405,7 +436,6 @@ efreet_cache_shutdown(void)
ecore_ipc_shutdown();
ipc = NULL;
- pfx = NULL;
hnd_add = NULL;
hnd_del = NULL;
hnd_data = NULL;
@@ -1323,3 +1353,31 @@ hash_array_string_add(void *hash, const char *key, void *data)
eina_hash_add(hash, key, data);
return hash;
}
+
+EAPI void
+efreet_cache_disable(void)
+{
+ Eina_Bool prev = disable_cache;
+
+ disable_cache = EINA_TRUE;
+
+ if (_efreet_cache_log_dom < 0) return; // not yet initialized
+ if (prev == disable_cache) return; // same value
+ if (ipc)
+ {
+ ecore_ipc_server_del(ipc);
+ ipc = NULL;
+ }
+}
+
+EAPI void
+efreet_cache_enable(void)
+{
+ Eina_Bool prev = disable_cache;
+
+ disable_cache = EINA_FALSE;
+
+ if (_efreet_cache_log_dom < 0) return; // not yet initialized
+ if (prev == disable_cache) return; // same value
+ if (!ipc) _ipc_launch();
+}
diff --git a/src/lib/efreet/efreet_cache_private.h b/src/lib/efreet/efreet_cache_private.h
index 79dbfa0c24..97dbd45a1e 100644
--- a/src/lib/efreet/efreet_cache_private.h
+++ b/src/lib/efreet/efreet_cache_private.h
@@ -17,15 +17,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_EFREET_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EFREET_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
diff --git a/src/lib/efreet/efreet_menu.c b/src/lib/efreet/efreet_menu.c
index b774460c98..f48f13c07e 100644
--- a/src/lib/efreet/efreet_menu.c
+++ b/src/lib/efreet/efreet_menu.c
@@ -528,13 +528,19 @@ efreet_menu_file_set(const char *file)
if (file) efreet_menu_file = eina_stringshare_add(file);
}
-EAPI void
+/* deprecated */
+EFREET_DEPRECATED_API EAPI void
efreet_menu_async_get(Efreet_Menu_Cb func, const void *data)
{
char menu[PATH_MAX];
const char *dir;
Eina_List *config_dirs, *l;
+ ERR("%s is deprecated and shouldn't be called", __FUNCTION__);
+
+ return;
+
+
if (!func) return;
#ifndef STRICT_SPEC
@@ -598,11 +604,15 @@ efreet_menu_get(void)
return NULL;
}
-EAPI void
+/* deprecated */
+EFREET_DEPRECATED_API EAPI void
efreet_menu_async_parse(const char *path, Efreet_Menu_Cb func, const void *data)
{
Efreet_Menu_Async *async;
+ ERR("%s is deprecated and shouldn't be called", __FUNCTION__);
+
+ return;
async = NEW(Efreet_Menu_Async, 1);
async->func = func;
async->data = (void*)data;
diff --git a/src/lib/efreet/efreet_menu.h b/src/lib/efreet/efreet_menu.h
index b7f123ac82..16d8de210d 100644
--- a/src/lib/efreet/efreet_menu.h
+++ b/src/lib/efreet/efreet_menu.h
@@ -82,9 +82,9 @@ EAPI void efreet_menu_file_set(const char *file);
* @param func function to call when menu is created
* @param data user data to return in callback
*
- * @since 1.8
+ * @deprecated
*/
-EAPI void efreet_menu_async_get(Efreet_Menu_Cb func, const void *data);
+EFREET_DEPRECATED_API EAPI void efreet_menu_async_get(Efreet_Menu_Cb func, const void *data);
/**
* @return Returns the Efreet_Menu representation of the default menu or
@@ -100,9 +100,9 @@ EAPI Efreet_Menu *efreet_menu_get(void);
* @param func function to call when menu is created
* @param data user data to return in callback
*
- * @since 1.8
+ * @deprecated
*/
-EAPI void efreet_menu_async_parse(const char *path, Efreet_Menu_Cb func, const void *data);
+EFREET_DEPRECATED_API EAPI void efreet_menu_async_parse(const char *path, Efreet_Menu_Cb func, const void *data);
/**
* @param path The path of the menu to load
diff --git a/src/lib/efreet/efreet_mime.c b/src/lib/efreet/efreet_mime.c
index 7096ed346d..68767dcec0 100644
--- a/src/lib/efreet/efreet_mime.c
+++ b/src/lib/efreet/efreet_mime.c
@@ -746,7 +746,7 @@ efreet_mime_special_check(const char *file)
struct stat s;
int path_len = 0;
- /* no link on Windows < Vista */
+ /* no symlink on Windows */
#ifdef _WIN32
if (!stat(file, &s))
#else
diff --git a/src/lib/efreet/efreet_private.h b/src/lib/efreet/efreet_private.h
index 47d6deae12..eb42c28f74 100644
--- a/src/lib/efreet/efreet_private.h
+++ b/src/lib/efreet/efreet_private.h
@@ -6,15 +6,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_EFREET_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EFREET_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
diff --git a/src/lib/efreet/efreet_xml.c b/src/lib/efreet/efreet_xml.c
index 05261b2a4a..4f4cd2fea8 100644
--- a/src/lib/efreet/efreet_xml.c
+++ b/src/lib/efreet/efreet_xml.c
@@ -86,7 +86,7 @@ efreet_xml_new(const char *file)
{
Efreet_Xml *xml = NULL;
int size, fd = -1;
- char *data = MAP_FAILED;
+ char *tmp, *data = MAP_FAILED;
struct stat st;
int error = 0;
@@ -109,11 +109,12 @@ efreet_xml_new(const char *file)
data = mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
if (data == MAP_FAILED) goto efreet_error;
+ tmp = data;
+
error = 0;
size = st.st_size;
- xml = efreet_xml_parse(&data, &size, &error);
+ xml = efreet_xml_parse(&tmp, &size, &error);
if (!xml || error) goto efreet_error;
-
munmap(data, st.st_size);
close(fd);
return xml;
diff --git a/src/lib/eina/Eina.h b/src/lib/eina/Eina.h
index 256de025bc..b403d308f8 100644
--- a/src/lib/eina/Eina.h
+++ b/src/lib/eina/Eina.h
@@ -274,6 +274,7 @@ extern "C" {
#include <eina_slstr.h>
#include <eina_debug.h>
#include <eina_promise.h>
+#include <eina_vpath.h>
#undef EAPI
#define EAPI
diff --git a/src/lib/eina/eina_alloca.h b/src/lib/eina/eina_alloca.h
index db6a3945a6..5950e2386a 100644
--- a/src/lib/eina/eina_alloca.h
+++ b/src/lib/eina/eina_alloca.h
@@ -42,11 +42,12 @@
# ifdef __cplusplus
extern "C"
# endif
+
/**
* @brief Allocates memory in the stack frame of the caller, so that it
* is automatically freed when the caller returns.
*
- * @param size Number of bytes of space to allocate.
+ * @param[in] size Number of bytes of space to allocate.
* @return Pointer to beginning of the allocated space.
*
* @see alloca(3) for more details.
diff --git a/src/lib/eina/eina_array.h b/src/lib/eina/eina_array.h
index 823f824958..09d8290352 100644
--- a/src/lib/eina/eina_array.h
+++ b/src/lib/eina/eina_array.h
@@ -49,7 +49,7 @@
* Before we can start using any array function we need to initialize eina:
* @until eina_init
*
- * So now to actually create our array. The only interesting thing here is the
+ * So now to actually create our array. The interesting thing here is the
* argument given to the eina_array_new() function. This argument sets how fast
* the array grows.
* @until array_new
@@ -101,8 +101,8 @@
* @skip #include
* @until Eina.h
*
- * This the callback we are going to use to decide which strings stay on the
- * array and which will be removed. We use something simple, but this can be as
+ * This is the callback we are going to use to decide which strings stay on the
+ * array and which will be removed. We use something simple, but this can be as
* complex as you like:
* @until }
*
@@ -144,10 +144,10 @@
* @brief These functions provide array management.
*
* The Array data type in Eina is designed to have very fast access to
- * its data (compared to the Eina @ref Eina_List_Group). On the other hand,
- * data can be added or removed only at the end of the array. To insert
- * data at any position, the Eina @ref Eina_List_Group is the correct container
- * to use.
+ * its data (compared to the Eina @ref Eina_List_Group). On the other
+ * hand, data can be added or removed only at the end of the array. To
+ * insert data at arbitrary positions, the Eina @ref Eina_List_Group is
+ * the correct container to use.
*
* To use the array data type, eina_init() must be called before any
* other array functions. When no more eina array functions are used,
@@ -156,9 +156,9 @@
* An array must be created with eina_array_new(). It allocates all
* the necessary data for an array. When not needed anymore, an array
* is freed with eina_array_free(). This frees the memory used by the Eina_Array
- * itself, but does not free any memory used to store the data of each element.
+ * itself, but does not free any memory used to store the data of each element.
* To free that memory you must iterate over the array and free each data element
- * individually. A convenient way to do that is by using #EINA_ARRAY_ITER_NEXT.
+ * individually. A convenient way to do that is by using #EINA_ARRAY_ITER_NEXT.
* An example of that pattern is given in the description of @ref EINA_ARRAY_ITER_NEXT.
*
* @warning Functions do not check if the used array is valid or not. It's up to
@@ -171,15 +171,12 @@
* eina_array_data_get(). The number of elements can be retrieved with
* eina_array_count().
*
- * Eina_Array is different from a conventional C array in a number of ways, most
- * importantly they grow and shrink dynamically, this means that if you add an
- * element to a full array it grows and that when you remove an element from an
- * array it @b may shrink.
- *
- * Allocating memory is expensive, so when the array needs to grow it allocates
- * enough memory to hold @p step additional elements, not just the element
- * currently being added. Similarly if you remove elements, it won't free space
- * until you have removed @p step elements.
+ * An Eina_Array differs most notably from a conventional C array in that it can
+ * grow and shrink dynamically as elements are added and removed.
+ * Since allocating memory is expensive, when the array needs to grow it adds
+ * enough memory to hold @p step additional elements, not just the element
+ * currently being added. Similarly when elements are removed, it won't deallocate
+ * until @p step elements are removed.
*
* The following image illustrates how an Eina_Array grows:
*
@@ -214,7 +211,7 @@
/**
* @typedef Eina_Array
- * Type for a generic vector.
+ * Type for a generic one-dimensional linear data structure.
*/
typedef struct _Eina_Array Eina_Array;
@@ -233,10 +230,10 @@ struct _Eina_Array
#define EINA_ARRAY_VERSION 1
int version; /**< Should match EINA_ARRAY_VERSION used when compiled your apps, provided for ABI compatibility */
- void **data; /**< Pointer to a vector of pointer to payload */
- unsigned int total; /**< Number of allocated slots in the vector */
- unsigned int count; /**< Number of slots in the vector that actually point to data */
- unsigned int step; /**< Number of slots to grow or shrink the vector */
+ void **data; /**< Pointer to a C array of pointers to payloads */
+ unsigned int total; /**< Number of allocated slots in @p data */
+ unsigned int count; /**< Number of used slots in @p data that point to valid payloads */
+ unsigned int step; /**< Number of slots to grow or shrink @p data */
EINA_MAGIC
};
@@ -244,11 +241,11 @@ struct _Eina_Array
/**
* @brief Creates a new array.
*
- * @param step The count of pointers to add when increasing the array size.
+ * @param[in] step The count of pointers to add when increasing the array size.
* @return @c NULL on failure, non @c NULL otherwise.
*
* This function creates a new array. When adding an element, the array
- * allocates @p step elements. When that buffer is full, then adding
+ * allocates @p step elements. When that buffer is full, adding
* another element will increase the buffer by @p step elements again.
*
* This function return a valid array on success, or @c NULL if memory
@@ -259,21 +256,21 @@ EAPI Eina_Array *eina_array_new(unsigned int step) EINA_WARN_UNUSED_RESULT EINA_
/**
* @brief Frees an array.
*
- * @param array The array to free.
+ * @param[in] array The array to free.
*
- * This function frees @p array. It calls first eina_array_flush() then
- * frees the memory of the pointer. It does not free the memory
- * allocated for the elements of @p array. To free them, walk the array with
- * #EINA_ARRAY_ITER_NEXT.
+ * This function finalizes @p array by flushing (see
+ * eina_array_flush()), and then freeing the memory of the pointer. It
+ * does not free the memory allocated for the elements of @p array. To
+ * free them, walk the array with #EINA_ARRAY_ITER_NEXT.
*/
-EAPI void eina_array_free(Eina_Array *array);
+EAPI void eina_array_free(Eina_Array *array);
/**
* @brief Sets the step of an array.
*
- * @param array The array.
- * @param sizeof_eina_array Should be the value returned by sizeof(Eina_Array).
- * @param step The count of pointers to add when increasing the array size.
+ * @param[in,out] array The array.
+ * @param[in] sizeof_eina_array Should be the value returned by sizeof(Eina_Array).
+ * @param[in] step The count of pointers to add when increasing the array size.
*
* This function sets the step of @p array to @p step. For performance
* reasons, there is no check of @p array. If it is @c NULL or
@@ -285,24 +282,24 @@ EAPI void eina_array_step_set(Eina_Array *array,
unsigned int sizeof_eina_array,
unsigned int step) EINA_ARG_NONNULL(1);
/**
- * @brief Cleans an array.
+ * @brief Clears an array of its elements, without deallocating memory.
*
- * @param array The array to clean.
+ * @param[in,out] array The array to clean.
*
- * This function sets the count member of @p array to 0, however it doesn't free
- * any space. This is particularly useful if you need to empty the array and
- * add lots of elements quickly. For performance reasons, there is no check of
- * @p array. If it is @c NULL or invalid, the program may crash.
+ * This function sets the @p array's member count to 0 without freeing
+ * memory. This facilitates emptying an array and quickly refilling it
+ * with new elements. For performance reasons, there is no check of @p
+ * array. If it is @c NULL or invalid, the program may crash.
*/
static inline void eina_array_clean(Eina_Array *array) EINA_ARG_NONNULL(1);
/**
- * @brief Flushes an array.
+ * @brief Clears an array's elements and deallocates the memory.
*
- * @param array The array to flush.
+ * @param[in,out] array The array to flush.
*
- * This function sets the count and total members of @p array to 0,
- * frees and set to NULL its data member. For performance reasons,
+ * This function sets the count and total members of @p array to 0, and
+ * frees its data member and sets it to NULL. For performance reasons,
* there is no check of @p array. If it is @c NULL or invalid, the
* program may crash.
*/
@@ -311,9 +308,9 @@ EAPI void eina_array_flush(Eina_Array *array) EINA_ARG_NONNULL(1);
/**
* @brief Rebuilds an array by specifying the data to keep.
*
- * @param array The array.
- * @param keep The functions which selects the data to keep.
- * @param gdata The data to pass to the function keep.
+ * @param[in,out] array The array.
+ * @param[in] keep The functions which selects the data to keep.
+ * @param[in] gdata The data to pass to the function keep.
* @return #EINA_TRUE on success, #EINA_FALSE otherwise.
*
* This function rebuilds @p array by specifying the elements to keep with the
@@ -329,73 +326,74 @@ EAPI Eina_Bool eina_array_remove(Eina_Array * array,
void *gdata) EINA_ARG_NONNULL(1, 2);
/**
- * @brief Appends a data to an array.
+ * @brief Appends a data item to an array.
*
- * @param array The array.
- * @param data The data to add.
- * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
+ * @param[in,out] array The array.
+ * @param[in] data The data to add.
+ * @return #EINA_TRUE on success, #EINA_FALSE if allocation is necessary
+ * and fails or if @p data is @c NULL.
*
* This function appends @p data to @p array. For performance
* reasons, there is no check of @p array. If it is @c NULL or
- * invalid, the program may crash. If @p data is @c NULL, or if an
- * allocation is necessary and fails, #EINA_FALSE is returned
- * Otherwise, #EINA_TRUE is returned.
+ * invalid, the program may crash.
*/
static inline Eina_Bool eina_array_push(Eina_Array *array,
const void *data) EINA_ARG_NONNULL(1, 2);
/**
- * @brief Removes the last data of an array.
+ * @brief Removes the last data item in an array.
*
- * @param array The array.
- * @return The retrieved data.
+ * @param[in,out] array The array.
+ * @return The retrieved data, or @c NULL if there are no remaining items.
*
- * This function removes the last data of @p array, decreases the count
- * of @p array and returns the data. For performance reasons, there
- * is no check of @p array. If it is @c NULL or invalid, the program
- * may crash. If the count member is less or equal than 0, @c NULL is
- * returned.
+ * This function removes the last data item from @p array, decreases the
+ * length of @p array and returns the data item. For performance reasons,
+ * there is no check of @p array, so if it is @c NULL or invalid, the
+ * program may crash.
*/
static inline void *eina_array_pop(Eina_Array *array) EINA_ARG_NONNULL(1);
/**
* @brief Returns the data at a given position in an array.
*
- * @param array The array.
- * @param idx The position of the data to retrieve.
+ * @param[in] array The array.
+ * @param[in] idx The position of the data to retrieve.
* @return The retrieved data.
*
* This function returns the data at the position @p idx in @p
* array. For performance reasons, there is no check of @p array or @p
- * idx. If it is @c NULL or invalid, the program may crash.
+ * idx. If @p array is @c NULL or invalid, or if @p idx is larger than
+ * the array's size, the program may crash.
*/
static inline void *eina_array_data_get(const Eina_Array *array,
unsigned int idx) EINA_ARG_NONNULL(1);
/**
* @brief Sets the data at a given position in an array.
*
- * @param array The array.
- * @param idx The position of the data to set.
- * @param data The data to set.
+ * @param[in] array The array.
+ * @param[in] idx The position of the data to set.
+ * @param[in] data The data to set.
*
- * This function sets the data at the position @p idx in @p
- * array to @p data, this effectively replaces the previously held data, you
- * must therefore get a pointer to it first if you need to free it. For
- * performance reasons, there is no check of @p array or @p idx. If it is @c
- * NULL or invalid, the program may crash.
+ * This function sets the data at the position @p idx in @p array to @p
+ * data, this effectively replaces the previously held data, you must
+ * therefore get a pointer to it first if you need to free it. For
+ * performance reasons, there is no check of @p array or @p idx. If @p
+ * array is @c NULL or invalid, or if @p idx is larger than the array's
+ * size, the program may crash.
*/
static inline void eina_array_data_set(const Eina_Array *array,
unsigned int idx,
const void *data) EINA_ARG_NONNULL(1);
+
/**
* @deprecated use eina_array_count()
* @brief Returns the number of elements in an array.
*
- * @param array The array.
+ * @param[in] array The array.
* @return The number of elements.
*
* This function returns the number of elements in @p array (array->count). For
- * performance reasons, there is no check of @p array. If it is
+ * performance reasons, there is no check of @p array, so if it is
* @c NULL or invalid, the program may crash.
*
*/
@@ -404,11 +402,11 @@ static inline unsigned int eina_array_count_get(const Eina_Array *array) EINA_AR
/**
* @brief Returns the number of elements in an array.
*
- * @param array The array.
+ * @param[in] array The array.
* @return The number of elements.
*
* This function returns the number of elements in @p array (array->count). For
- * performance reasons, there is no check of @p array. If it is
+ * performance reasons, there is no check of @p array, so if it is
* @c NULL or invalid, the program may crash.
*/
static inline unsigned int eina_array_count(const Eina_Array *array) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
@@ -416,40 +414,44 @@ static inline unsigned int eina_array_count(const Eina_Array *array) EINA_ARG_NO
/**
* @brief Gets a new iterator associated with an array.
*
- * @param array The array.
- * @return A new iterator.
+ * @param[in] array The array.
+ * @return A new iterator, or @c NULL if @p array is @c NULL or has no
+ * items, or if memory could not be allocated.
+ *
+ * This function allocates a new iterator associated with @p array.
+ * Use EINA_ARRAY_ITER_NEXT() to iterate through the array's data items
+ * in order of entry.
*
- * This function returns a newly allocated iterator associated to
- * @p array. If @p array is @c NULL or the count member of @p array is
- * less or equal than 0, this function returns @c NULL. If the memory can
- * not be allocated, @c NULL is returned. Otherwise, a valid iterator is returned.
+ * @see Eina_Iterator_Group
*/
EAPI Eina_Iterator *eina_array_iterator_new(const Eina_Array *array) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
/**
* @brief Gets a new accessor associated with an array.
*
- * @param array The array.
- * @return A new accessor.
+ * @param[in] array The array.
+ * @return A new accessor, or @c NULL if @p array is @c NULL or has no
+ * items, or if memory could not be allocated.
*
- * This function returns a newly allocated accessor associated to
- * @p array. If @p array is @c NULL or the count member of @p array is
- * less or equal than 0, this function returns @c NULL. If the memory can
- * not be allocated, @c NULL is returned. Otherwise, a valid accessor is
- * returned.
+ * This function returns a newly allocated accessor associated with
+ * @p array. Accessors differ from iterators in that they permit
+ * random access.
+ *
+ * @see Eina_Accessor_Group
*/
EAPI Eina_Accessor *eina_array_accessor_new(const Eina_Array *array) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+
/**
- * @brief Provides a safe way to iterate over an array.
+ * @brief Iterates over an array using a callback function.
*
- * @param array The array to iterate over.
- * @param cb The callback to call for each item.
- * @param fdata The user data to pass to the callback.
+ * @param[in] array The array to iterate over.
+ * @param[in] cb The callback to invoke for each item.
+ * @param[in] fdata The user data to pass to the callback.
* @return #EINA_TRUE if it successfully iterated all items of the array.
*
- * This function provides a safe way to iterate over an array. @p cb should
- * return #EINA_TRUE as long as you want the function to continue iterating.
- * If @p cb returns #EINA_FALSE, iterations will stop and the function will also
+ * This function iterates over an array in order, calling @p cb for each
+ * item. @p cb should return #EINA_TRUE if the loop should continue, or
+ * #EINA_FALSE to exit the loop, in which case eina_array_foreach() will
* return #EINA_FALSE.
*/
static inline Eina_Bool eina_array_foreach(Eina_Array *array,
@@ -457,20 +459,18 @@ static inline Eina_Bool eina_array_foreach(Eina_Array *array,
void *fdata);
/**
* @def EINA_ARRAY_ITER_NEXT
- * @brief Definition for the macro to iterate over an array easily.
+ * @brief Iterates through an array's elements.
*
- * @param array The array to iterate over.
- * @param index The integer number that is increased while iterating.
- * @param item The data
- * @param iterator The iterator
+ * @param[in] array The array to iterate over.
+ * @param[out] index The integer number that is increased while iterating.
+ * @param[out] item The data
+ * @param[in,out] iterator The #Eina_Array_Iterator.
*
- * This macro allows the iteration over @p array in an easy way. It
- * iterates from the first element to the last one. @p index is an
- * integer that increases from 0 to the number of elements. @p item is
- * the data of each element of @p array, so it is a pointer to a type
- * chosen by the user. @p iterator is of type #Eina_Array_Iterator.
+ * This macro iterates over @p array in order, increasing @p index from
+ * the first to last element and setting @p item to each element's data
+ * item in turn.
*
- * This macro can be used for freeing the data of an array, like in
+ * This macro can be used for freeing the data of an array, such as
* the following example:
*
* @code
diff --git a/src/lib/eina/eina_benchmark.h b/src/lib/eina/eina_benchmark.h
index 695ad5673a..38959a1306 100644
--- a/src/lib/eina/eina_benchmark.h
+++ b/src/lib/eina/eina_benchmark.h
@@ -289,8 +289,7 @@
* program, or integrate the Eina benchmark framework in an autotooled
* project. See that
* <a href="http://trac.enlightenment.org/e/wiki/AutotoolsIntegration#Benchmark">page</a>
- * for more informations.
- *
+ * for more information.
*/
@@ -347,7 +346,7 @@ typedef void (*Eina_Benchmark_Specimens)(int request);
* @def EINA_BENCHMARK
* @brief Definition for the cast to an #Eina_Benchmark_Specimens.
*
- * @param function The function to cast.
+ * @param[in] function The function to cast.
*
* This macro casts @p function to Eina_Benchmark_Specimens.
*/
@@ -357,16 +356,14 @@ typedef void (*Eina_Benchmark_Specimens)(int request);
/**
* @brief Creates a new array.
*
- * @param name The name of the benchmark.
- * @param run The name of the run.
- * @return @c NULL on failure, non @c NULL otherwise.
+ * @param[in] name The name of the benchmark.
+ * @param[in] run The name of the run.
+ * @return A valid benchmark on success, or @c NULL on memory allocation
+ * failure.
*
* This function creates a new benchmark. @p name and @p run are used
* to name the gnuplot file that eina_benchmark_run() will create.
*
- * This function returns a valid benchmark on success, or @c NULL if
- * memory allocation fails.
- *
* When the new module is not needed anymore, use
* eina_benchmark_free() to free the allocated memory.
*/
@@ -376,7 +373,7 @@ EAPI Eina_Benchmark *eina_benchmark_new(const char *name,
/**
* @brief Frees a benchmark object.
*
- * @param bench The benchmark to free.
+ * @param[in,out] bench The benchmark to free.
*
* This function removes all the benchmark tests that have been
* registered and frees @p bench. If @p bench is @c NULL, this
@@ -387,23 +384,22 @@ EAPI void eina_benchmark_free(Eina_Benchmark *bench);
/**
* @brief Adds a test to a benchmark.
*
- * @param bench The benchmark.
- * @param name The name of the test.
- * @param bench_cb The test function to be called.
- * @param count_start The start data to be passed to @p bench_cb.
- * @param count_end The end data to be passed to @p bench_cb.
- * @param count_step The step data to be passed to @p bench_cb.
+ * @param[in,out] bench The benchmark.
+ * @param[in] name The name of the test.
+ * @param[in] bench_cb The test function to be called.
+ * @param[in] count_start The start data to be passed to @p bench_cb.
+ * @param[in] count_end The end data to be passed to @p bench_cb.
+ * @param[in] count_step The step data to be passed to @p bench_cb.
* @return #EINA_FALSE on failure, #EINA_TRUE otherwise.
*
* This function adds the test named @p name to @p benchmark. @p
* bench_cb is the function called when the test is executed. That
- * test can be executed a certain amount of time. @p count_start, @p count_end and
- * @p count_step define a loop with a step increment. The integer that is
- * increasing by @p count_step from @p count_start to @p count_end is passed to @p
- * bench_cb when eina_benchmark_run() is called.
+ * test can be executed a certain number of times, from @p count_start
+ * to @p count_end, with a step increment of @p count_step. This counter
+ * is passed to @p bench_cb when eina_benchmark_run() is called.
*
- * If @p bench is @c NULL, this function returns immediately.
- * This function returns #EINA_FALSE on failure, #EINA_TRUE otherwise.
+ * If @p bench is @c NULL or @p count_step is 0, this function returns
+ * immediately and does not add any tests to the benchmark.
*/
EAPI Eina_Bool eina_benchmark_register(Eina_Benchmark *bench,
const char *name,
@@ -413,29 +409,26 @@ EAPI Eina_Bool eina_benchmark_register(Eina_Benchmark *bench,
int count_step);
/**
- * @brief Runs the benchmark tests that have been registered.
+ * @brief Runs the benchmark's registered tests.
*
- * @param bench The benchmark.
- * @return The list of names of the test files.
+ * @param[in,out] bench The benchmark.
+ * @return A list of gnuplot filenames for the test results, or @c NULL
+ * on failure.
*
* This function runs all the tests that have been registered with
- * eina_benchmark_register() and saves the result in a gnuplot
- * file. The name of the file has the following format:
+ * eina_benchmark_register() and saves the result in gnuplot
+ * input files. The filenames have the following format:
*
* @code
* bench_[name]_[run]%s.gnuplot
* @endcode
*
* Where [name] and [run] are the values passed to
- * eina_benchmark_new().
+ * eina_benchmark_new() when registering the test.
*
* Each registered test is executed and timed. The time is written to
* the gnuplot file. The number of times each test is executed is
* controlled by the parameters passed to eina_benchmark_register().
- *
- * If @p bench is @c NULL, this functions returns @c NULL
- * immediately. Otherwise, it returns the list of the names of each
- * test.
*/
EAPI Eina_Array *eina_benchmark_run(Eina_Benchmark *bench);
diff --git a/src/lib/eina/eina_bezier.c b/src/lib/eina/eina_bezier.c
index b179ceb59e..b3b093c790 100644
--- a/src/lib/eina/eina_bezier.c
+++ b/src/lib/eina/eina_bezier.c
@@ -17,6 +17,7 @@
*/
#include <math.h>
#include <float.h>
+#include <stdio.h>
#include "eina_private.h"
#include "eina_bezier.h"
@@ -40,9 +41,9 @@ _eina_bezier_1st_derivative(const Eina_Bezier *bz,
*py = 3 * ( a * bz->start.y + b * bz->ctrl_start.y + c * bz->ctrl_end.y + d * bz->end.y);
}
-// approximate sqrt(x*x + y*y) using alpha max plus beta min algorithm.
-// With alpha = 1, beta = 3/8, giving results with a largest error less
-// than 7% compared to the exact value.
+// Approximate sqrt(x*x + y*y) using the alpha max plus beta min algorithm.
+// This uses alpha = 1, beta = 3/8, which results in a maximum error of less
+// than 7% compared to the correct value.
static double
_line_length(double x1, double y1, double x2, double y2)
{
@@ -79,8 +80,6 @@ _eina_bezier_split(const Eina_Bezier *b,
first->end.y = second->start.y = (first->ctrl_end.y + second->ctrl_start.y) * 0.5;
}
-#include <stdio.h>
-
static float
_eina_bezier_length_helper(const Eina_Bezier *b)
{
@@ -95,10 +94,10 @@ _eina_bezier_length_helper(const Eina_Bezier *b)
chord = _line_length(b->start.x, b->start.y, b->end.x, b->end.y);
- if (fabsf(len - chord) > FLT_MIN) {
- _eina_bezier_split(b, &left, &right); /* split in two */
+ if (!EINA_FLT_EQ(len, chord)) {
+ _eina_bezier_split(b, &left, &right); /* split in two */
length =
- _eina_bezier_length_helper(&left) + /* try left side */
+ _eina_bezier_length_helper(&left) + /* try left side */
_eina_bezier_length_helper(&right); /* try right side */
return length;
diff --git a/src/lib/eina/eina_bezier.h b/src/lib/eina/eina_bezier.h
index ab9b8e1b8f..bf309643fa 100644
--- a/src/lib/eina/eina_bezier.h
+++ b/src/lib/eina/eina_bezier.h
@@ -51,15 +51,15 @@ struct _Eina_Bezier
* @brief Sets the values of the points of the given floating
* point cubic bezier curve.
*
- * @param b The floating point bezier.
- * @param start_x x coordinate of start point.
- * @param start_y y coordinate of start point.
- * @param ctrl_start_x x coordinate of 1st control point.
- * @param ctrl_start_y y coordinate of 1st control point.
- * @param ctrl_end_x x coordinate of 2nd control point.
- * @param ctrl_end_y y coordinate of 2nd control point.
- * @param end_x x coordinate of end point.
- * @param end_y y coordinate of end point.
+ * @param[out] b The floating point bezier.
+ * @param[in] start_x The x coordinate of the start point.
+ * @param[in] start_y The y coordinate of the start point.
+ * @param[in] ctrl_start_x The x coordinate of the 1st control point.
+ * @param[in] ctrl_start_y The y coordinate of the 1st control point.
+ * @param[in] ctrl_end_x The X coordinate of the 2nd control point.
+ * @param[in] ctrl_end_y The Y coordinate of the 2nd control point.
+ * @param[in] end_x The X coordinate of the end point.
+ * @param[in] end_y The Y coordinate of the end point.
*
* @p b. No check is done on @p b.
* @since 1.16
@@ -70,15 +70,15 @@ EAPI void eina_bezier_values_set(Eina_Bezier *b, double start_x, double start_y,
* @brief Gets the values of the points of the given floating
* point cubic bezier curve.
*
- * @param b The floating point bezier.
- * @param start_x x coordinate of start point.
- * @param start_y y coordinate of start point.
- * @param ctrl_start_x x coordinate of 1st control point.
- * @param ctrl_start_y y coordinate of 1st control point.
- * @param ctrl_end_x x coordinate of 2nd control point.
- * @param ctrl_end_y y coordinate of 2nd control point.
- * @param end_x x coordinate of end point.
- * @param end_y y coordinate of end point.
+ * @param[in] b The floating point bezier.
+ * @param[out] start_x x coordinate of start point.
+ * @param[out] start_y y coordinate of start point.
+ * @param[out] ctrl_start_x x coordinate of 1st control point.
+ * @param[out] ctrl_start_y y coordinate of 1st control point.
+ * @param[out] ctrl_end_x x coordinate of 2nd control point.
+ * @param[out] ctrl_end_y y coordinate of 2nd control point.
+ * @param[out] end_x x coordinate of end point.
+ * @param[out] end_y y coordinate of end point.
*
* @p b. No check is done on @p b.
* @since 1.16
@@ -86,86 +86,98 @@ EAPI void eina_bezier_values_set(Eina_Bezier *b, double start_x, double start_y,
EAPI void eina_bezier_values_get(const Eina_Bezier *b, double *start_x, double *start_y, double *ctrl_start_x, double *ctrl_start_y, double *ctrl_end_x, double *ctrl_end_y, double *end_x, double *end_y) EINA_ARG_NONNULL(1);
/**
- * @brief Returns the length of the given floating
- * point cubic bezier curve.
+ * @brief Calculates the approximate length of the given floating point
+ * cubic bezier curve.
*
- * @param b The floating point bezier.
+ * @param[in] b The floating point bezier.
+ * @return The bezier's length.
*
- * @p b. No check is done on @p b.
+ * The curve length is approximated using the Alpha max plus beta min algorithm,
+ * which is designed to give fast results with a maximum error of less than 7%
+ * compared with the correct value.
+ *
+ * No check is done on @p b.
* @since 1.16
*/
EAPI double eina_bezier_length_get(const Eina_Bezier *b) EINA_ARG_NONNULL(1);
/**
- * @brief Returns the position of the given bezier
- * at given length.
+ * @brief Returns the relative position on a bezier at a given length.
*
- * @param b The floating point bezier.
- * @param len The given length.
+ * @param[in] b The floating point bezier.
+ * @param[in] len The length along the bezier curve.
+ * @return The relative position from 0.0 to 1.0.
+ *
+ * Calculates the proportional location on @p b as a number from 0.0 to
+ * 1.0 that corresponds to a distance @p len along it. Returns 1.0 if
+ * @p len is equal or greater than the bezier's length.
+ *
+ * No check is done on @p b.
*
- * @p b. No check is done on @p b.
* @since 1.16
*/
EAPI double eina_bezier_t_at(const Eina_Bezier *b, double len) EINA_ARG_NONNULL(1);
/**
- * @brief Gets the point on the bezier curve at
- * position t.
+ * @brief Gets the point on the bezier curve at position t.
*
- * @param b The floating point bezier.
- * @param t The floating point position.
+ * @param[in] b The floating point bezier.
+ * @param[in] t The floating point position between 0.0 and 1.0.
+ * @param[out] px The corresponding point's X coordinate.
+ * @param[out] py The corresponding point's Y coordinate.
*
- * @p b. No check is done on @p b.
+ * No check is done on @p b.
* @since 1.16
*/
EAPI void eina_bezier_point_at(const Eina_Bezier *b, double t, double *px, double *py) EINA_ARG_NONNULL(1);
/**
- * @brief Returns the slope of the bezier
- * at given length.
+ * @brief Determines the slope of the bezier at a given position.
*
- * @param b The floating point bezier.
- * @param len The given length.
+ * @param[in] b The floating point bezier.
+ * @param[out] t The position along the bezier between 0.0 and 1.0.
*
- * @p b. No check is done on @p b.
+ * No check is done on @p b.
* @since 1.16
*/
EAPI double eina_bezier_angle_at(const Eina_Bezier *b, double t) EINA_ARG_NONNULL(1);
/**
- * @brief Splits the bezier at given length.
+ * @brief Splits the bezier at a given length.
*
- * @param b The floating point bezier.
- * @param len The given length.
+ * @param[in] b The floating point bezier.
+ * @param[in] len The length along the bezier to make the split.
+ * @param[out] left The resultant split's left portion of the bezier.
+ * @param[out] right The resultant split's right portion of the bezier.
*
- * @p b. No check is done on @p b.
+ * No check is done on @p b.
* @since 1.16
*/
EAPI void eina_bezier_split_at_length(const Eina_Bezier *b, double len, Eina_Bezier *left, Eina_Bezier *right) EINA_ARG_NONNULL(1);
/**
- * @brief Gets the bounds of the bezier.
+ * @brief Calculates the bounding box for the bezier.
*
- * @param b The floating point bezier.
- * @param x x coordinate of bounding box.
- * @param y y coordinate of bounding box.
- * @param w width of bounding box.
- * @param h height of bounding box.
+ * @param[in] b The floating point bezier.
+ * @param[out] x The X coordinate of the bounding box.
+ * @param[out] y The Y coordinate of the bounding box.
+ * @param[out] w The width of the bounding box.
+ * @param[out] h The height of the bounding box.
*
- * @p b. No check is done on @p b.
+ * No check is done on @p b.
* @since 1.17
*/
EAPI void eina_bezier_bounds_get(const Eina_Bezier *b, double *x, double *y, double *w, double *h) EINA_ARG_NONNULL(1);
/**
- * @brief Finds the bezier at the given interval.
+ * @brief Finds the bezier between the given interval.
*
- * @param b The floating point bezier.
- * @param t0 The start interval.
- * @param t1 The end interval.
- * @param result The result bezier.
+ * @param[in] b The floating point bezier.
+ * @param[in] t0 The start of the interval.
+ * @param[in] t1 The end of the interval.
+ * @param[out] result The resulting bezier.
*
- * @p b. No check is done on @p b.
+ * No check is done on @p b.
* @since 1.17
*/
EAPI void eina_bezier_on_interval(Eina_Bezier *b, double t0, double t1, Eina_Bezier *result);
diff --git a/src/lib/eina/eina_binbuf.h b/src/lib/eina/eina_binbuf.h
index cea0c93f38..6b1ed48ffe 100644
--- a/src/lib/eina/eina_binbuf.h
+++ b/src/lib/eina/eina_binbuf.h
@@ -13,7 +13,8 @@
* @brief These functions provide string buffer management.
*
* The Binary Buffer data type is designed to be a mutable string,
- * allowing to append, prepend or insert a string to a buffer.
+ * allowing the appending, prepending or insertion of a string to a
+ * buffer.
*/
/**
@@ -30,17 +31,17 @@
/**
* @typedef Eina_Binbuf
- * Type for a string buffer.
+ * Type for a binary string buffer.
*/
typedef struct _Eina_Strbuf Eina_Binbuf;
/**
- * @brief Creates a new string buffer.
+ * @brief Creates a new binary string buffer.
*
- * @return Newly allocated string buffer instance.
+ * @return Newly allocated string buffer instance, or @c NULL on error.
*
- * This function creates a new string buffer. On error, @c NULL is
- * returned. To free the resources, use eina_binbuf_free().
+ * This function creates a new string buffer. To free the resources, use
+ * eina_binbuf_free().
*
* @see eina_binbuf_free()
* @see eina_binbuf_append()
@@ -49,38 +50,22 @@ typedef struct _Eina_Strbuf Eina_Binbuf;
EAPI Eina_Binbuf *eina_binbuf_new(void) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
/**
- * @brief Creates a new string buffer using the passed string. The passed
- * string is used directly as the buffer, it's somehow the opposite function of
- * @ref eina_binbuf_string_steal . The passed string must be malloced.
+ * @brief Creates a new string buffer using the passed string.
*
- * @param str The string to manage.
- * @param length The length of the string.
- * @return Newly allocated string buffer instance.
+ * @param[in] str The string to manage.
+ * @param[in] length The length of the string.
+ * @param[in] ro The passed string will not be touched if set to #EINA_TRUE.
+ * @return Newly allocated string buffer instance, or @c NULL on error.
*
- * This function creates a new string buffer. On error, @c NULL is
- * returned. To free the resources, use eina_binbuf_free().
+ * This function creates a new binary string buffer. The passed string
+ * is used directly as the buffer, it's effectively the inverse of
+ * eina_binbuf_string_steal(). To free the resources, use
+ * eina_binbuf_free().
*
- * @see eina_binbuf_manage_new()
- * @since 1.2.0
- */
-EAPI Eina_Binbuf *eina_binbuf_manage_new_length(unsigned char *str, size_t length) EINA_MALLOC EINA_WARN_UNUSED_RESULT EINA_DEPRECATED;
-
-/**
- * @brief Creates a new string buffer using the passed string. The passed
- * string is used directly as the buffer, it's somehow the opposite function of
- * @ref eina_binbuf_string_steal .
- *
- * @param str The string to start from.
- * @param length The length of the string.
- * @param ro The passed string will not be touched if set to EINA_TRUE.
- * @return Newly allocated string buffer instance.
- *
- * This function creates a new string buffer. On error, @c NULL is
- * returned. To free the resources, use eina_binbuf_free(). It will
- * not touch the buffer if ro is set to @c EINA_TRUE, but it will also not
- * copy it. If ro is set to @c EINA_TRUE any change operation will
- * create a fresh new memory, copy old data there and starting modifying
- * that one.
+ * This routine will not touch the buffer if @p ro is set to
+ * #EINA_TRUE, but it will also not copy it. If @p ro is set to
+ * #EINA_TRUE any change operation will create a fresh new memory
+ * buffer, copy the old data there and modify that one instead.
*
* @see eina_binbuf_manage_new()
* @see eina_binbuf_manage_new_length()
@@ -91,21 +76,37 @@ EAPI Eina_Binbuf *eina_binbuf_manage_new_length(unsigned char *str, size_t lengt
EAPI Eina_Binbuf *eina_binbuf_manage_new(const unsigned char *str, size_t length, Eina_Bool ro) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
/**
- * @brief Creates a new string buffer using the passed string. The passed
- * string is used directly as the buffer, it's somehow the opposite function of
- * @ref eina_binbuf_string_steal . The passed string will not be touched.
+ * @brief Creates a new string buffer using the passed string.
+ *
+ * @param[in] str The string to manage.
+ * @param[in] length The length of the string.
+ * @return Newly allocated string buffer instance, or @c NULL on error.
+ *
+ * This function creates a new string buffer. To free the resources, use
+ * eina_binbuf_free().
*
- * @param str The string to start from.
- * @param length The length of the string.
- * @return Newly allocated string buffer instance.
+ * @see eina_binbuf_manage_new()
*
- * This function creates a new string buffer. On error, @c NULL is
- * returned. To free the resources, use eina_binbuf_free(). It will
- * not touch the internal buffer. Any changing operation will
+ * @since 1.2.0
+ */
+EAPI Eina_Binbuf *eina_binbuf_manage_new_length(unsigned char *str, size_t length) EINA_MALLOC EINA_WARN_UNUSED_RESULT EINA_DEPRECATED;
+
+/**
+ * @brief Creates a new string buffer using the passed string.
+ *
+ * @param[in] str The string to start from.
+ * @param[in] length The length of the string.
+ * @return Newly allocated string buffer instance, or @c NULL on error.
+ *
+ * This function creates a new string buffer. The passed string is used
+ * directly as the buffer, it's effectively the inverse of
+ * eina_binbuf_string_steal(). The passed string will not be touched.
+ * It will not touch the internal buffer. Any changing operation will
* create a fresh new memory, copy old data there and starting modifying
- * that one.
+ * that one. To free the resources, use eina_binbuf_free().
*
* @see eina_binbuf_manage_new()
+ *
* @since 1.9.0
*/
EAPI Eina_Binbuf *eina_binbuf_manage_read_only_new_length(const unsigned char *str, size_t length) EINA_MALLOC EINA_WARN_UNUSED_RESULT EINA_DEPRECATED;
@@ -113,7 +114,7 @@ EAPI Eina_Binbuf *eina_binbuf_manage_read_only_new_length(const unsigned char *s
/**
* @brief Frees a string buffer.
*
- * @param buf The string buffer to free.
+ * @param[in,out] buf The string buffer.
*
* This function frees the memory of @p buf. @p buf must have been
* created by eina_binbuf_new().
@@ -123,7 +124,7 @@ EAPI void eina_binbuf_free(Eina_Binbuf *buf) EINA_ARG_NONNULL(1);
/**
* @brief Resets a string buffer.
*
- * @param buf The string buffer to reset.
+ * @param[in,out] buf The string buffer.
*
* This function resets @p buf: the buffer len is set to 0, and the
* string is set to '\\0'. No memory is freed.
@@ -131,28 +132,27 @@ EAPI void eina_binbuf_free(Eina_Binbuf *buf) EINA_ARG_NONNULL(1);
EAPI void eina_binbuf_reset(Eina_Binbuf *buf) EINA_ARG_NONNULL(1);
/**
- * @brief Expands a buffer, making room for at least @a minimum_unused_space.
+ * @brief Expands a buffer, making room for at least @p minimum_unused_space.
+ *
+ * @param[in,out] buf The Buffer to expand.
+ * @param[in] minimum_unused_space The minimum unused allocated space, in
+ * bytes, at the end of the buffer. Zero can be used to query
+ * the available slice of unused bytes.
+ * @return The slice of unused bytes. The slice length may be zero if
+ * @p minimum_unused_space couldn't be allocated, otherwise it will
+ * be at least @p minimum_unused_space. After bytes are used, mark
+ * them as such using eina_binbuf_use().
*
* One of the properties of the buffer is that it may overallocate
* space, thus it may have more than eina_binbuf_length_get() bytes
- * allocated. How much depends on buffer growing logic, but this
- * function allows one to request a minimum amount of bytes to be
- * allocated at the end of the buffer.
+ * allocated. How much depends on the buffer growth logic, but this
+ * function allows requesting a minimum amount of bytes to be allocated
+ * at the end of the buffer.
*
* This is particularly useful to write directly to buffer's memory
- * (ie: a call to read(2)). After the bytes are used call
+ * (i.e.: a call to read(2)). After the bytes are used call
* eina_binbuf_use() to mark them as such, so eina_binbuf_length_get()
- * will consider the new bytes.
- *
- * @param buf The Buffer to expand.
- * @param minimum_unused_space The minimum unused allocated space, in
- * bytes, at the end of the buffer. Zero can be used to query
- * the available slice of unused bytes.
- *
- * @return The slice of unused bytes. The slice length may be zero if
- * @a minimum_unused_space couldn't be allocated, otherwise it
- * will be at least @a minimum_unused_space. After bytes are used,
- * mark them as such using eina_binbuf_use().
+ * will account for the new bytes.
*
* @see eina_binbuf_rw_slice_get()
* @see eina_binbuf_use()
@@ -164,17 +164,16 @@ EAPI Eina_Rw_Slice eina_binbuf_expand(Eina_Binbuf *buf, size_t minimum_unused_sp
/**
* @brief Marks more bytes as used.
*
- * This function should be used after eina_binbuf_expand(), marking
- * the extra bytes returned there as used, then they will be
- * considered in all other functions, such as eina_binbuf_length_get().
- *
- * @param buf The buffer to mark extra bytes as used.
- * @param extra_bytes the number of bytes to be considered used, must
+ * @param[in,out] buf The string buffer.
+ * @param[in] extra_bytes the number of bytes to be considered used, must
* be between zero and the length of the slice returned by
* eina_binbuf_expand().
+ * @return #EINA_TRUE on success, #EINA_FALSE on failure, such as
+ * @p extra_bytes is too big or @a buf is NULL.
*
- * @return #EINA_TRUE on success, #EINA_FALSE on failure, such as @a
- * extra_bytes is too big or @a buf is NULL.
+ * This function should be used after eina_binbuf_expand(), marking
+ * the extra bytes returned there as used, then they will be
+ * taken into account by other functions, such as eina_binbuf_length_get().
*
* @see eina_binbuf_expand()
*
@@ -183,19 +182,18 @@ EAPI Eina_Rw_Slice eina_binbuf_expand(Eina_Binbuf *buf, size_t minimum_unused_sp
EAPI Eina_Bool eina_binbuf_use(Eina_Binbuf *buf, size_t extra_bytes) EINA_ARG_NONNULL(1);
/**
- * @brief Appends a string of exact length to a buffer, reallocating as necessary.
+ * @brief Appends a string of exact length to a buffer, reallocating as
+ * necessary.
*
- * @param buf The string buffer to append to.
- * @param str The string to append.
- * @param length The exact length to use.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The string to append.
+ * @param[in] length The exact length to use.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p str could not be appended.
*
* This function appends @p str to @p buf. @p str must be of size at
* most @p length. It is slightly faster than eina_binbuf_append() as
* it does not compute the size of @p str. It is useful when dealing
- * with strings of known size, such as eina_stringshare. If @p buf
- * can't append it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
- * returned.
+ * with strings of known size, such as eina_stringshare.
*
* @see eina_stringshare_length()
* @see eina_binbuf_append()
@@ -206,12 +204,11 @@ EAPI Eina_Bool eina_binbuf_append_length(Eina_Binbuf *buf, const unsigned char *
/**
* @brief Appends a slice to a buffer, reallocating as necessary.
*
- * @param buf The string buffer to append to.
- * @param slice The slice to append.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] slice The slice to append.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p slice could not be appended.
*
- * This function appends @p slice to @p buf. If @p buf can't append
- * it, #EINA_FALSE is returned, otherwise #EINA_TRUE is returned.
+ * This function appends @p slice to @p buf.
*
* @since 1.19
*/
@@ -220,18 +217,18 @@ EAPI Eina_Bool eina_binbuf_append_slice(Eina_Binbuf *buf, const Eina_Slice slice
/**
* @brief Appends an Eina_Binbuf to a buffer, reallocating as necessary.
*
- * @param buf The string buffer to append to.
- * @param data The string buffer to append.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] data The string buffer to append.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p data could not be appended.
*
* This function appends @p data to @p buf. @p data must be allocated and
* different from @c NULL. It is slightly faster than eina_binbuf_append() as
- * it does not compute the size of @p str. If @p buf can't append it,
- * #EINA_FALSE is returned, otherwise #EINA_TRUE is returned.
+ * it does not compute the size of @p data.
*
* @see eina_binbuf_append()
* @see eina_binbuf_append_n()
* @see eina_binbuf_append_length()
+ *
* @since 1.9.0
*/
EAPI Eina_Bool eina_binbuf_append_buffer(Eina_Binbuf *buf, const Eina_Binbuf *data) EINA_ARG_NONNULL(1, 2);
@@ -240,30 +237,27 @@ EAPI Eina_Bool eina_binbuf_append_buffer(Eina_Binbuf *buf, const Eina_Binbuf *da
* @brief Appends a character to a string buffer, reallocating as
* necessary.
*
- * @param buf The string buffer to append to.
- * @param c The char to append.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] c The char to append.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p c could not be inserted.
*
- * This function inserts @p c to @p buf. If it can not insert it, #EINA_FALSE
- * is returned, otherwise #EINA_TRUE is returned.
+ * This function appends @p c to @p buf.
*/
EAPI Eina_Bool eina_binbuf_append_char(Eina_Binbuf *buf, unsigned char c) EINA_ARG_NONNULL(1);
/**
- * @brief Inserts a string of exact length to a buffer, reallocating as necessary.
+ * @brief Inserts a string of exact length into a buffer, reallocating as necessary.
*
- * @param buf The string buffer to insert to.
- * @param str The string to insert.
- * @param length The exact length to use.
- * @param pos The position to insert the string.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The string to insert.
+ * @param[in] length The exact length to use.
+ * @param[in] pos The position to insert the string.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p str could not be inserted.
*
- * This function inserts @p str to @p buf. @p str must be of size at
- * most @p length. It is slightly faster than eina_binbuf_insert() as
+ * This function inserts @p str into @p buf. @p str must be no longer
+ * than @p length. It is slightly faster than eina_binbuf_insert() as
* it does not compute the size of @p str. It is useful when dealing
- * with strings of known size, such as eina_stringshare. If @p buf
- * can't insert it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
- * returned.
+ * with strings of known size, such as eina_stringshare.
*
* @see eina_stringshare_length()
* @see eina_binbuf_insert()
@@ -272,63 +266,58 @@ EAPI Eina_Bool eina_binbuf_append_char(Eina_Binbuf *buf, unsigned char c) EINA_A
EAPI Eina_Bool eina_binbuf_insert_length(Eina_Binbuf *buf, const unsigned char *str, size_t length, size_t pos) EINA_ARG_NONNULL(1, 2);
/**
- * @brief Inserts a slice to a buffer, reallocating as necessary.
+ * @brief Inserts a slice into a buffer, reallocating as necessary.
*
- * @param buf The string buffer to insert to.
- * @param slice The slice to insert.
- * @param pos The position to insert the string.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] slice The slice to insert.
+ * @param[in] pos The position to insert the string.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p slice could not be inserted.
*
- * This function inserts @p slice to @p buf at position @p pos. If @p
- * buf can't insert it, #EINA_FALSE is returned, otherwise #EINA_TRUE
- * is returned.
+ * This function inserts @p slice into @p buf at position @p pos.
*
* @since 1.19.0
*/
EAPI Eina_Bool eina_binbuf_insert_slice(Eina_Binbuf *buf, const Eina_Slice slice, size_t pos) EINA_ARG_NONNULL(1);
/**
- * @brief Inserts a character to a string buffer, reallocating as
+ * @brief Inserts a character into a string buffer, reallocating as
* necessary.
*
- * @param buf The string buffer to insert to.
- * @param c The char to insert.
- * @param pos The position to insert the char.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] c The char to insert.
+ * @param[in] pos The position to insert the char.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p c could not be inserted.
*
- * This function inserts @p c to @p buf at position @p pos. If @p buf
- * can't append it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
- * returned.
+ * This function inserts @p c to @p buf at position @p pos.
*/
EAPI Eina_Bool eina_binbuf_insert_char(Eina_Binbuf *buf, unsigned char c, size_t pos) EINA_ARG_NONNULL(1);
/**
* @brief Removes a slice of the given string buffer.
*
- * @param buf The string buffer to remove a slice.
- * @param start The initial (inclusive) slice position to start
+ * @param[in,out] buf The string buffer.
+ * @param[in] start The initial (inclusive) slice position to start
* removing, in bytes.
- * @param end The final (non-inclusive) slice position to finish
+ * @param[in] end The final (non-inclusive) slice position to finish
* removing, in bytes.
* @return #EINA_TRUE on success, #EINA_FALSE on failure.
*
* This function removes a slice of @p buf, starting at @p start
* (inclusive) and ending at @p end (non-inclusive). Both values are
- * in bytes. It returns #EINA_FALSE on failure, #EINA_TRUE otherwise.
+ * in bytes.
*/
-
EAPI Eina_Bool eina_binbuf_remove(Eina_Binbuf *buf, size_t start, size_t end) EINA_ARG_NONNULL(1);
/**
* @brief Retrieves a pointer to the contents of a string buffer.
*
- * @param buf The string buffer.
- * @return The current string in the string buffer.
+ * @param[in] buf The string buffer.
+ * @return The string that is contained in @p buf.
*
* This function returns the string contained in @p buf. The returned
* value must not be modified and will no longer be valid if @p buf is
- * modified. In other words, any eina_binbuf_append() or similar will
- * make that pointer invalid.
+ * modified. In other words, calling eina_binbuf_append() or similar
+ * functions will make the pointer invalid.
*
* @see eina_binbuf_string_steal()
*/
@@ -337,8 +326,8 @@ EAPI const unsigned char *eina_binbuf_string_get(const Eina_Binbuf *buf) EINA_AR
/**
* @brief Steals the contents of a string buffer.
*
- * @param buf The string buffer to steal.
- * @return The current string in the string buffer.
+ * @param[in,out] buf The string buffer.
+ * @return The string that was contained in @p buf.
*
* This function returns the string contained in @p buf. @p buf is
* then initialized and does not own the returned string anymore. The
@@ -352,7 +341,7 @@ EAPI unsigned char *eina_binbuf_string_steal(Eina_Binbuf *buf) EINA_MALLOC EINA_
/**
* @brief Frees the contents of a string buffer but not the buffer.
*
- * @param buf The string buffer to free the string of.
+ * @param[in,out] buf The string buffer.
*
* This function frees the string contained in @p buf without freeing
* @p buf.
@@ -360,46 +349,46 @@ EAPI unsigned char *eina_binbuf_string_steal(Eina_Binbuf *buf) EINA_MALLOC EINA_
EAPI void eina_binbuf_string_free(Eina_Binbuf *buf) EINA_ARG_NONNULL(1);
/**
- * @brief Retrieves the length of the string buffer content.
+ * @brief Retrieves the length of the string buffer's content.
*
- * @param buf The string buffer.
+ * @param[in] buf The string buffer.
* @return The current length of the string, in bytes.
*
* This function returns the length of @p buf.
*/
-EAPI size_t eina_binbuf_length_get(const Eina_Binbuf *buf) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+EAPI size_t eina_binbuf_length_get(const Eina_Binbuf *buf) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
/**
- * @brief Gets a read-only slice representing the current binbuf contents.
+ * @brief Gets a read-only slice of the buffer contents.
*
- * @param buf the src buffer.
- * @return a read-only slice for the current contents. It may become
- * invalid as soon as the @a buf is changed.
+ * @param[in] buf The string buffer.
+ * @return A read-only slice of the current contents. It may become
+ * invalid as soon as @p buf is changed.
*
* @since 1.19
*/
EAPI Eina_Slice eina_binbuf_slice_get(const Eina_Binbuf *buf) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
/**
- * @brief Gets a read-write slice representing the current binbuf contents.
+ * @brief Gets a read-write slice of the buffer contents.
*
- * @param buf the src buffer.
- * @return a read-write slice for the current contents. It may become
- * invalid as soon as the @a buf is changed with calls such as
- * eina_binbuf_append(), eina_binbuf_remove()
+ * @param[in,out] buf The string buffer.
+ * @return A read-write slice for the current contents. It may become
+ * invalid as soon as @p buf is changed, such as through calls like
+ * eina_binbuf_append() or eina_binbuf_remove().
*
* @see eina_binbuf_expand()
*
* @since 1.19
*/
EAPI Eina_Rw_Slice eina_binbuf_rw_slice_get(const Eina_Binbuf *buf) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
+
/**
- * @brief Gets the content of the buffer and free the buffer.
+ * @brief Frees the buffer, returning its old contents.
*
- * @param buf the buffer to get the content from and which will be freed
- *
- * @return The content contained by buf. The caller must release the memory of the returned content by calling
- * free().
+ * @param[in,out] buf The string buffer.
+ * @return The content contained by buf. The caller must release the
+ * memory of the returned string by calling free().
*
* @since 1.19
*/
diff --git a/src/lib/eina/eina_binshare.h b/src/lib/eina/eina_binshare.h
index af9781dbf4..6caee100b1 100644
--- a/src/lib/eina/eina_binshare.h
+++ b/src/lib/eina/eina_binshare.h
@@ -76,8 +76,8 @@
/**
* @brief Retrieves an instance of an object for use in a program.
*
- * @param [in] obj The binary object to retrieve an instance of
- * @param [in] olen The byte size
+ * @param[in] obj The binary object to retrieve an instance of
+ * @param[in] olen The byte size
* @return A pointer to an instance of the object on success,
* otherwise @c NULL on failure
*
@@ -155,7 +155,7 @@ EAPI void eina_binshare_dump(void);
* is just returned and its reference counter is increased. Otherwise
* it is added to the blobs to be searched and a duplicated blob
* of @p obj is returned.
- * @param ptr The binary blob to retrieve an instance of
+ * @param[in] ptr The binary blob to retrieve an instance of
* @return A pointer to an instance of the string on success,
* otherwise @c NULL on failure
*
diff --git a/src/lib/eina/eina_clist.h b/src/lib/eina/eina_clist.h
index e927a9bc25..8f78a1e83c 100644
--- a/src/lib/eina/eina_clist.h
+++ b/src/lib/eina/eina_clist.h
@@ -114,7 +114,7 @@ struct _Eina_Clist
/**
* @brief Adds an element after the specified one.
*
- * @param[in] elem An element in the list
+ * @param[in,out] elem An element in the list
* @param[in] to_add The element to add to the list
* @pre The list head must be initialized once before adding anything.
* @pre The element is not in any list.
@@ -128,7 +128,7 @@ static inline void eina_clist_add_after(Eina_Clist *elem, Eina_Clist *to_add);
/**
* @brief Adds an element before the specified one.
*
- * @param[in] elem An element in the list
+ * @param[in,out] elem An element in the list
* @param[in] to_add The element to add to the list
* @pre The list head must be initialized once before adding anything.
* @pre The element is not in any list.
@@ -142,7 +142,7 @@ static inline void eina_clist_add_before(Eina_Clist *elem, Eina_Clist *to_add);
/**
* @brief Adds an element to the head of the list.
*
- * @param[in] list The list
+ * @param[in,out] list The list
* @param[in] elem An element
* @pre The list head must be initialized once before adding anything.
* @pre The element is not in any list.
@@ -156,7 +156,7 @@ static inline void eina_clist_add_head(Eina_Clist *list, Eina_Clist *elem);
/**
* @brief Adds an element at the tail of the list.
*
- * @param[in] list The list
+ * @param[in,out] list The list
* @param[in] elem An element
* @pre The list head must be initialized once before adding anything.
* @pre The element is not in any list.
@@ -172,7 +172,7 @@ static inline void eina_clist_add_tail(Eina_Clist *list, Eina_Clist *elem);
* @details This function is called on elements that have not been added to the list
* so that eina_clist_element_init() works correctly.
*
- * @param[in] elem An element
+ * @param[in,out] elem An element
* @pre The element is not in any list.
* @post The element is marked as not being in any list.
*
@@ -197,7 +197,7 @@ static inline int eina_clist_element_is_linked(Eina_Clist *elem);
/**
* @brief Removes an element from its list.
*
- * @param[in] elem An element
+ * @param[in,out] elem An element
* @pre The element is already in a list.
* @post The element is marked as not being in any list.
*
@@ -262,7 +262,7 @@ static inline int eina_clist_empty(const Eina_Clist *list);
/**
* @brief Initializes a list.
*
- * @param[in] list The list
+ * @param[in,out] list The list
* @pre The list is uninitialized
* @post The list contains no items
*
@@ -287,7 +287,7 @@ static inline unsigned int eina_clist_count(const Eina_Clist *list);
/**
* @brief Moves all elements from @p src to the tail of @p dst.
*
- * @param[in] dst The list to be appended to
+ * @param[in,out] dst The list to be appended to
* @param[in] src The list to append
*
* @post @p src is initialized, but is empty after this operation.
@@ -299,7 +299,7 @@ static inline void eina_clist_move_tail(Eina_Clist *dst, Eina_Clist *src);
/**
* @brief Moves all elements from @p src to the head of @p dst.
*
- * @param[in] dst The list to be prepended to
+ * @param[in,out] dst The list to be prepended to
* @param[in] src The list to prepend
*
* @post @p src is initialized, but is empty after this operation.
@@ -312,8 +312,8 @@ static inline void eina_clist_move_head(Eina_Clist *dst, Eina_Clist *src);
* @def EINA_CLIST_FOR_EACH
* @brief Iterates through the list.
*
- * @param cursor The pointer to be used during the interaction
- * @param list The list to be interacted with
+ * @param[out] cursor The pointer to be used during the interaction
+ * @param[in] list The list to be interacted with
*/
#define EINA_CLIST_FOR_EACH(cursor,list) \
for ((cursor) = (list)->next; (cursor) != (list); (cursor) = (cursor)->next)
@@ -322,9 +322,9 @@ static inline void eina_clist_move_head(Eina_Clist *dst, Eina_Clist *src);
* @def EINA_CLIST_FOR_EACH_SAFE
* @brief Iterates through the list, with safety against removal.
*
- * @param cursor The pointer to be used during the interaction
- * @param cursor2 The auxiliary pointer to be used during the interaction
- * @param list The list to be interacted with
+ * @param[out] cursor The pointer to be used during the interaction
+ * @param[out] cursor2 The auxiliary pointer to be used during the interaction
+ * @param[in] list The list to be interacted with
*/
#define EINA_CLIST_FOR_EACH_SAFE(cursor, cursor2, list) \
for ((cursor) = (list)->next, (cursor2) = (cursor)->next; \
@@ -335,10 +335,10 @@ static inline void eina_clist_move_head(Eina_Clist *dst, Eina_Clist *src);
* @def EINA_CLIST_FOR_EACH_ENTRY
* @brief Iterates through the list using a list entry.
*
- * @param elem The element to be used
- * @param list The list to be iterated
- * @param type The type of the list
- * @param field The field of the element
+ * @param[out] elem The element to be used
+ * @param[in] list The list to be iterated
+ * @param[in] type The type of the list
+ * @param[in] field The field of the element
*/
#define EINA_CLIST_FOR_EACH_ENTRY(elem, list, type, field) \
for ((elem) = EINA_CLIST_ENTRY((list)->next, type, field); \
@@ -349,11 +349,11 @@ static inline void eina_clist_move_head(Eina_Clist *dst, Eina_Clist *src);
* @def EINA_CLIST_FOR_EACH_ENTRY_SAFE
* @brief Iterates through the list using a list entry, with safety against removal.
*
- * @param cursor The pointer to be used during the interaction
- * @param cursor2 The auxiliary pointer to be used during the interaction
- * @param list The list to be interacted with
- * @param type The type of the list
- * @param field The field of the element
+ * @param[out] cursor The pointer to be used during the interaction
+ * @param[out] cursor2 The auxiliary pointer to be used during the interaction
+ * @param[in] list The list to be interacted with
+ * @param[in] type The type of the list
+ * @param[in] field The field of the element
*/
#define EINA_CLIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field) \
for ((cursor) = EINA_CLIST_ENTRY((list)->next, type, field), \
@@ -366,8 +366,8 @@ static inline void eina_clist_move_head(Eina_Clist *dst, Eina_Clist *src);
* @def EINA_CLIST_FOR_EACH_REV
* @brief Iterates through the list in the reverse order.
*
- * @param cursor The pointer to be used during the interaction
- * @param list The list to be interacted with
+ * @param[out] cursor The pointer to be used during the interaction
+ * @param[in] list The list to be interacted with
*/
#define EINA_CLIST_FOR_EACH_REV(cursor,list) \
for ((cursor) = (list)->prev; (cursor) != (list); (cursor) = (cursor)->prev)
@@ -376,9 +376,9 @@ static inline void eina_clist_move_head(Eina_Clist *dst, Eina_Clist *src);
* @def EINA_CLIST_FOR_EACH_SAFE_REV
* @brief Iterates through the list in the reverse order, with safety against removal.
*
- * @param cursor The pointer to be used during the interaction
- * @param cursor2 The auxiliary pointer to be used during the interaction
- * @param list The list to be interacted with
+ * @param[out] cursor The pointer to be used during the interaction
+ * @param[out] cursor2 The auxiliary pointer to be used during the interaction
+ * @param[in] list The list to be interacted with
*/
#define EINA_CLIST_FOR_EACH_SAFE_REV(cursor, cursor2, list) \
for ((cursor) = (list)->prev, (cursor2) = (cursor)->prev; \
@@ -389,10 +389,10 @@ static inline void eina_clist_move_head(Eina_Clist *dst, Eina_Clist *src);
* @def EINA_CLIST_FOR_EACH_ENTRY_REV
* @brief Iterates through the list in the reverse order using a list entry.
*
- * @param elem The element to be used
- * @param list The list to be iterated
- * @param type The type of the list
- * @param field The field of the element
+ * @param[out] elem The element to be used
+ * @param[in] list The list to be iterated
+ * @param[in] type The type of the list
+ * @param[in] field The field of the element
*/
#define EINA_CLIST_FOR_EACH_ENTRY_REV(elem, list, type, field) \
for ((elem) = EINA_CLIST_ENTRY((list)->prev, type, field); \
@@ -404,11 +404,11 @@ static inline void eina_clist_move_head(Eina_Clist *dst, Eina_Clist *src);
* @brief Iterates through the list in the reverse order using a list entry, with safety against
* removal.
*
- * @param cursor The pointer to be used during the interaction
- * @param cursor2 The auxiliary pointer to be used during the interaction
- * @param list The list to be interacted with
- * @param type The type of the list
- * @param field The field of the element
+ * @param[out] cursor The pointer to be used during the interaction
+ * @param[out] cursor2 The auxiliary pointer to be used during the interaction
+ * @param[in] list The list to be interacted with
+ * @param[in] type The type of the list
+ * @param[in] field The field of the element
*/
#define EINA_CLIST_FOR_EACH_ENTRY_SAFE_REV(cursor, cursor2, list, type, field) \
for ((cursor) = EINA_CLIST_ENTRY((list)->prev, type, field), \
@@ -421,7 +421,7 @@ static inline void eina_clist_move_head(Eina_Clist *dst, Eina_Clist *src);
* @def EINA_CLIST_INIT
* @brief Macros for statically initialized lists.
*
- * @param list The list to be used
+ * @param[in,out] list The list to be used
*/
#undef EINA_CLIST_INIT
#define EINA_CLIST_INIT(list) { &(list), &(list) }
@@ -430,9 +430,9 @@ static inline void eina_clist_move_head(Eina_Clist *dst, Eina_Clist *src);
* @def EINA_CLIST_ENTRY
* @brief Gets a pointer to the object containing the list element.
*
- * @param elem The element to be used
- * @param type The type of the element
- * @param field The field of the element
+ * @param[out] elem The element to be used
+ * @param[in] type The type of the element
+ * @param[in] field The field of the element
*/
#undef EINA_CLIST_ENTRY
#define EINA_CLIST_ENTRY(elem, type, field) \
diff --git a/src/lib/eina/eina_convert.h b/src/lib/eina/eina_convert.h
index 5d74bafd78..026fc6c8f6 100644
--- a/src/lib/eina/eina_convert.h
+++ b/src/lib/eina/eina_convert.h
@@ -34,7 +34,7 @@
* To use these functions, you have to call eina_init()
* first, and eina_shutdown() when eina is not used anymore.
*
- * @section Eina_Convert_From_Integer_To_Sring Conversion from integer to string
+ * @section Eina_Convert_From_Integer_To_String Conversion from integer to string
*
* To convert an integer to a string in the decimal base,
* eina_convert_itoa() should be used. If the hexadecimal base is
@@ -95,7 +95,7 @@
* has the following mantissas and exponent:
*
* @code
- * mantiss : [-]hhhhhh
+ * mantissa : [-]hhhhhh
* exponent : 2^([+-]e - 4 * n)
* @endcode
*
@@ -165,8 +165,8 @@ EAPI extern Eina_Error EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH; /**< Not used, p
/**
* @brief Converts an integer number to a string in decimal base.
*
- * @param n The integer to convert.
- * @param s The buffer to store the converted integer.
+ * @param[in] n The integer to convert.
+ * @param[out] s The buffer to store the converted integer.
* @return The length of the string, including the null terminated
* character.
*
@@ -182,8 +182,8 @@ EAPI int eina_convert_itoa(int n, char *s) EINA_ARG_NONNULL(2);
/**
* @brief Converts an integer number to a string in hexadecimal base.
*
- * @param n The integer to convert.
- * @param s The buffer to store the converted integer.
+ * @param[in] n The integer to convert.
+ * @param[out] s The buffer to store the converted integer.
* @return The length of the string, including the null terminated
* character.
*
@@ -201,8 +201,8 @@ EAPI int eina_convert_xtoa(unsigned int n, char *s) EINA_ARG_NONNULL(2);
/**
* @brief Converts a double to a string.
*
- * @param d The double to convert.
- * @param des The destination buffer to store the converted double.
+ * @param[in] d The double to convert.
+ * @param[out] des The destination buffer to store the converted double.
* @return #EINA_TRUE on success, #EINA_FALSE otherwise.
*
* This function converts the double @p d to a string. The string is
@@ -225,10 +225,10 @@ EAPI int eina_convert_dtoa(double d, char *des) EINA_ARG_NONNULL(2);
/**
* @brief Converts a string to a double.
*
- * @param src The string to convert.
- * @param length The length of the string.
- * @param m The mantissa.
- * @param e The exponent.
+ * @param[in] src The string to convert.
+ * @param[in] length The length of the string.
+ * @param[out] m The mantissa.
+ * @param[out] e The exponent.
* @return #EINA_TRUE on success, #EINA_FALSE otherwise.
*
* This function converts the string @p s of length @p length that
@@ -247,7 +247,7 @@ EAPI int eina_convert_dtoa(double d, char *des) EINA_ARG_NONNULL(2);
* point, the returned mantissas and exponents are:
*
* @code
- * mantiss : [-]hhhhhh
+ * mantissa : [-]hhhhhh
* exponent : 2^([+-]e - 4 * n)
* @endcode
*
@@ -262,12 +262,11 @@ EAPI Eina_Bool eina_convert_atod(const char *src,
long long *m,
long *e) EINA_ARG_NONNULL(1, 3, 4);
-
/**
* @brief Converts a 32.32 fixed point number to a string.
*
- * @param fp The fixed point number to convert.
- * @param des The destination buffer to store the converted fixed point number.
+ * @param[in] fp The fixed point number to convert.
+ * @param[out] des The destination buffer to store the converted fixed point number.
* @return #EINA_TRUE on success, #EINA_FALSE otherwise.
*
* This function converts the 32.32 fixed point number @p fp to a
@@ -288,7 +287,7 @@ EAPI Eina_Bool eina_convert_atod(const char *src,
*
* @note The code is the same than eina_convert_dtoa() except that it
* implements the frexp() function for fixed point numbers and does
- * some optimisations.
+ * some optimization.
*/
EAPI int eina_convert_fptoa(Eina_F32p32 fp,
char *des) EINA_ARG_NONNULL(2);
@@ -296,9 +295,9 @@ EAPI int eina_convert_fptoa(Eina_F32p32 fp,
/**
* @brief Converts a string to a 32.32 fixed point number.
*
- * @param src The string to convert.
- * @param length The length of the string.
- * @param fp The fixed point number.
+ * @param[in] src The string to convert.
+ * @param[in] length The length of the string.
+ * @param[out] fp The fixed point number.
* @return #EINA_TRUE on success, #EINA_FALSE otherwise.
*
* This function converts the string @p src of length @p length that
@@ -317,7 +316,7 @@ EAPI int eina_convert_fptoa(Eina_F32p32 fp,
* point, the returned mantissas and exponents are:
*
* @code
- * mantiss : [-]hhhhhh
+ * mantissa : [-]hhhhhh
* exponent : 2^([+-]e - 4 * n)
* @endcode
*
diff --git a/src/lib/eina/eina_counter.h b/src/lib/eina/eina_counter.h
index ca56ba5024..603190ee2b 100644
--- a/src/lib/eina/eina_counter.h
+++ b/src/lib/eina/eina_counter.h
@@ -170,7 +170,7 @@ EAPI void eina_counter_stop(Eina_Counter *counter,
/**
* @brief Dumps the result of all the clocks of a counter to a stream.
- * @details This function returns an malloc'd string containing the dump of
+ * @details This function returns a malloc'd string containing the dump of
* all the valid clocks of @p counter.
* If @p counter is @c NULL, the functions exits
* immediately. Otherwise, the output is formatted like this:
diff --git a/src/lib/eina/eina_cow.c b/src/lib/eina/eina_cow.c
index 73a65e5f30..8737ff8e49 100644
--- a/src/lib/eina/eina_cow.c
+++ b/src/lib/eina/eina_cow.c
@@ -64,11 +64,12 @@ struct _Eina_Cow_Ptr
#endif
int refcount;
- Eina_Bool hashed : 1;
- Eina_Bool togc : 1;
#ifdef EINA_COW_MAGIC_ON
- Eina_Bool writing : 1;
+ unsigned int writing;
#endif
+
+ Eina_Bool hashed : 1;
+ Eina_Bool togc : 1;
};
struct _Eina_Cow_GC
@@ -320,6 +321,7 @@ eina_cow_init(void)
Eina_Bool
eina_cow_shutdown(void)
{
+ eina_log_domain_unregister(_eina_cow_log_dom);
eina_mempool_del(gc_pool);
return EINA_TRUE;
}
@@ -474,9 +476,9 @@ eina_cow_write(Eina_Cow *cow,
#ifdef EINA_COW_MAGIC_ON
EINA_COW_PTR_MAGIC_CHECK(ref);
- if (ref->writing)
+ if (ref->writing && ref->togc && ref->hashed)
{
- ERR("Request writing on an pointer that is already in a writing process %p\n", data);
+ ERR("Request writing on a GC-ed pointer that is already in a writing process %p\n", data);
#ifdef HAVE_BACKTRACE
backtrace_symbols_fd((void **) ref->writer_bt,
ref->writer_bt_num, 1);
@@ -498,6 +500,9 @@ eina_cow_write(Eina_Cow *cow,
allocate:
ref = eina_mempool_malloc(cow->pool, cow->total_size);
ref->refcount = 1;
+#ifdef EINA_COW_MAGIC_ON
+ ref->writing = 0;
+#endif
ref->hashed = EINA_FALSE;
ref->togc = EINA_FALSE;
#ifdef EINA_COW_MAGIC_ON
@@ -521,7 +526,7 @@ eina_cow_write(Eina_Cow *cow,
ref->writer_bt_num = backtrace((void **)(ref->writer_bt),
EINA_DEBUG_BT_NUM);
# endif
- ref->writing = EINA_TRUE;
+ ref->writing++;
#endif
#ifndef NVALGRIND
VALGRIND_MAKE_MEM_NOACCESS(ref, sizeof (*ref));
@@ -549,7 +554,7 @@ eina_cow_done(Eina_Cow *cow,
if (!ref->writing)
ERR("Pointer %p is not in a writable state !", dst);
- ref->writing = EINA_FALSE;
+ ref->writing--;
#endif
#ifndef NVALGRIND
VALGRIND_MAKE_MEM_NOACCESS(ref, sizeof (*ref));
diff --git a/src/lib/eina/eina_cow.h b/src/lib/eina/eina_cow.h
index 347a8c5c62..db2acd5fc0 100644
--- a/src/lib/eina/eina_cow.h
+++ b/src/lib/eina/eina_cow.h
@@ -54,11 +54,11 @@ typedef void Eina_Cow_Data;
/**
* @brief Instantiates a new Eina_Cow pool.
*
- * @param name The name of this pool, used for debugging.
- * @param struct_size The size of the object from this pool.
- * @param step How many objects to allocate when the pool gets empty.
- * @param default_value The default value returned by this pool.
- * @param gc Is it possible to run garbage collection on this pool.
+ * @param[in] name The name of this pool, used for debugging.
+ * @param[in] struct_size The size of the object from this pool.
+ * @param[in] step How many objects to allocate when the pool gets empty.
+ * @param[in] default_value The default value returned by this pool.
+ * @param[in] gc Is it possible to run garbage collection on this pool.
* @return A valid new Eina_Cow, or @c NULL on error.
*/
EAPI Eina_Cow *eina_cow_add(const char *name, unsigned int struct_size, unsigned int step, const void *default_value, Eina_Bool gc) EINA_WARN_UNUSED_RESULT;
@@ -66,21 +66,23 @@ EAPI Eina_Cow *eina_cow_add(const char *name, unsigned int struct_size, unsigned
/**
* @brief Destroys an Eina_Cow pool and all the allocated memory.
*
- * @param cow The pool to destroy
+ * @param[in] cow The pool to destroy
*/
EAPI void eina_cow_del(Eina_Cow *cow);
/**
* @brief Returns an initialized pointer from the pool.
- * @param cow The pool to take things from.
+ *
+ * @param[in] cow The pool to take things from.
* @return A pointer to the new pool instance
*/
EAPI const Eina_Cow_Data *eina_cow_alloc(Eina_Cow *cow) EINA_WARN_UNUSED_RESULT;
/**
* @brief Frees a pointer from the pool.
- * @param cow The pool to gave back memory to.
- * @param data The data to give back.
+ *
+ * @param[in,out] cow The pool to gave back memory to.
+ * @param[in] data The data to give back.
*
* @note To simplify the caller code *data will point to the default
* read only state after the call to this function.
@@ -89,19 +91,22 @@ EAPI void eina_cow_free(Eina_Cow *cow, const Eina_Cow_Data **data);
/**
* @brief Gets a writeable pointer from a const pointer.
- * @param cow The pool the pointer came from.
- * @param src The pointer you want to write to.
+ *
+ * @param[in,out] cow The pool the pointer came from.
+ * @param[in] src The pointer you want to write to.
*
* NOTE: this function is not thread safe, be careful.
*/
EAPI void *eina_cow_write(Eina_Cow *cow,
const Eina_Cow_Data * const *src) EINA_WARN_UNUSED_RESULT;
+
/**
* @brief Sets back a pointer into read only.
- * @param cow The pool the pointer came from.
- * @param dst The read only version of the pointer.
- * @param data The pointer to which data was written to.
- * @param needed_gc Does this pool need to be garbage collected?
+ *
+ * @param[in,out] cow The pool the pointer came from.
+ * @param[in] dst The read only version of the pointer.
+ * @param[in] data The pointer to which data was written to.
+ * @param[in] needed_gc Does this pool need to be garbage collected?
*
* NOTE: this function is not thread safe, be careful.
*/
@@ -111,9 +116,10 @@ EAPI void eina_cow_done(Eina_Cow *cow,
Eina_Bool needed_gc);
/**
* @brief Makes the destination contain the same thing as the source pointer.
- * @param cow The pool the pointers came from.
- * @param dst The destination to update.
- * @param src The source of information to copy.
+ *
+ * @param[in,out] cow The pool the pointers came from.
+ * @param[in] dst The destination to update.
+ * @param[in] src The source of information to copy.
*/
EAPI void eina_cow_memcpy(Eina_Cow *cow,
const Eina_Cow_Data * const *dst,
@@ -121,7 +127,8 @@ EAPI void eina_cow_memcpy(Eina_Cow *cow,
/**
* @brief Tries to find entries that have the same content and update them.
- * @param cow The cow to try to compact.
+ *
+ * @param[in,out] cow The cow to try to compact.
* @return EINA_TRUE if something was compacted, EINA_FALSE if nothing was.
*
* There is no guaranty in the time it will require, but should remain low.
@@ -133,10 +140,11 @@ EAPI Eina_Bool eina_cow_gc(Eina_Cow *cow);
/**
* @def EINA_COW_WRITE_BEGIN
* @brief Definition for the macro to setup a writeable pointer from a const one.
- * @param Cow The Eina_Cow where the const pointer came from.
- * @param Read The const pointer to get a writable handler from.
- * @param Write_Type The type of the pointer you want to write to.
- * @param Write The name of the variable where to put the writeable pointer to.
+ *
+ * @param[in,out] Cow The Eina_Cow where the const pointer came from.
+ * @param[in] Read The const pointer to get a writable handler from.
+ * @param[in] Write_Type The type of the pointer you want to write to.
+ * @param[in] Write The name of the variable where to put the writeable pointer to.
* @since 1.8.0
*
* Be careful: this macro opens a C scope that is expected to be closed by
@@ -152,9 +160,9 @@ EAPI Eina_Bool eina_cow_gc(Eina_Cow *cow);
/**
* @def EINA_COW_WRITE_END
* @brief Definition for the macro to close the writeable pointer.
- * @param Cow The Eina_Cow where the const pointer came from.
- * @param Read The const pointer to get a writable handler from.
- * @param Write The name of the variable where to put the writeable pointer to.
+ * @param[in,out] Cow The Eina_Cow where the const pointer came from.
+ * @param[in] Read The const pointer to get a writable handler from.
+ * @param[in] Write The name of the variable where to put the writeable pointer to.
* @since 1.8.0
*
* Be careful: this macro close the scope opened by EINA_COW_WRITE_BEGIN().
diff --git a/src/lib/eina/eina_cpu.h b/src/lib/eina/eina_cpu.h
index 05de0fa8f5..6235b7b939 100644
--- a/src/lib/eina/eina_cpu.h
+++ b/src/lib/eina/eina_cpu.h
@@ -92,7 +92,7 @@ EAPI int eina_cpu_page_size(void);
/**
* @brief Reverses the byte order of a 16-bit (destination) register.
*
- * @param x The binary word to swap
+ * @param[in] x The binary word to swap
* @return A byte order swapped 16-bit integer.
*
* On big endian systems, the number is converted to little endian byte order.
@@ -103,7 +103,7 @@ static inline unsigned short eina_swap16(unsigned short x);
/**
* @brief Reverses the byte order of a 32-bit (destination) register.
*
- * @param x The binary word to swap
+ * @param[in] x The binary word to swap
* @return A byte order swapped 32-bit integer.
*
* On big endian systems, the number is converted to little endian byte order.
@@ -114,7 +114,7 @@ static inline unsigned int eina_swap32(unsigned int x);
/**
* @brief Reverses the byte order of a 64-bit (destination) register.
*
- * @param x The binary word to swap
+ * @param[in] x The binary word to swap
* @return A byte order swapped 64-bit integer.
*
* On big endian systems, the number is converted to little endian byte order.
diff --git a/src/lib/eina/eina_debug.c b/src/lib/eina/eina_debug.c
index 9dd1a092d5..4d70454d0a 100644
--- a/src/lib/eina/eina_debug.c
+++ b/src/lib/eina/eina_debug.c
@@ -98,9 +98,6 @@
// and if that day comes
Eina_Spinlock _eina_debug_lock;
-// only init once
-static Eina_Bool _inited = EINA_FALSE;
-
#ifdef __linux__
extern char *__progname;
#endif
@@ -110,6 +107,7 @@ extern Eina_Bool eina_mempool_init(void);
extern Eina_Bool eina_list_init(void);
extern Eina_Spinlock _eina_debug_thread_lock;
+static Eina_List *sessions;
static Eina_Bool _debug_disabled = EINA_FALSE;
@@ -133,6 +131,8 @@ struct _Eina_Debug_Session
void *data; /* User data */
int cbs_length; /* cbs table size */
int fd; /* File descriptor */
+ Eina_Lock lock; /* deletion lock */
+ Eina_Bool deleted : 1; /* set if session is dead */
};
#ifndef _WIN32
@@ -208,9 +208,8 @@ _packet_receive(Eina_Debug_Session *session, unsigned char **buffer)
int rret = -1;
unsigned int size = 0;
- if (!session) goto end;
-
- if ((rret = read(session->fd, &size, 4)) == 4)
+ rret = read(session->fd, &size, 4);
+ if (rret == 4)
{
size = SWAP_32(size);
if (size > EINA_DEBUG_MAX_PACKET_SIZE)
@@ -273,6 +272,17 @@ eina_debug_session_terminate(Eina_Debug_Session *session)
/* Close fd here so the thread terminates its own session by itself */
if (!session) return;
close(session->fd);
+ eina_lock_take(&session->lock);
+ if (session->deleted)
+ {
+ eina_lock_release(&session->lock);
+ free(session);
+ }
+ else
+ {
+ session->deleted = 1;
+ eina_lock_release(&session->lock);
+ }
}
EAPI void
@@ -453,6 +463,8 @@ _session_create(int fd)
if (!session) return NULL;
session->dispatch_cb = eina_debug_dispatch;
session->fd = fd;
+ eina_lock_new(&session->lock);
+ sessions = eina_list_append(sessions, session);
// start the monitor thread
_thread_start(session);
return session;
@@ -562,7 +574,7 @@ _monitor(void *_data)
// sit forever processing commands or timeouts in the debug monitor
// thread - this is separate to the rest of the app so it shouldn't
// impact the application specifically
- for (;session;)
+ while (1)
{
unsigned char *buffer = NULL;
int size;
@@ -585,10 +597,9 @@ _monitor(void *_data)
}
else
{
- close(session->fd);
_opcodes_unregister_all(session);
- free(session);
- session = NULL;
+ eina_debug_session_terminate(session);
+ break;
}
}
return NULL;
@@ -702,18 +713,7 @@ eina_debug_init(void)
{
pthread_t self;
- // if already inbitted simply release our lock that we may have locked on
- // shutdown if we are re-initted again in the same process
- if (_inited)
- {
- eina_spinlock_release(&_eina_debug_thread_lock);
- return EINA_TRUE;
- }
- // mark as initted
- _inited = EINA_TRUE;
- eina_module_init();
- eina_mempool_init();
- eina_list_init();
+ eina_threads_init();
// For Windows support GetModuleFileName can be used
// set up thread things
eina_spinlock_new(&_eina_debug_lock);
@@ -721,6 +721,9 @@ eina_debug_init(void)
self = pthread_self();
_eina_debug_thread_mainloop_set(&self);
_eina_debug_thread_add(&self);
+ _eina_debug_cpu_init();
+ _eina_debug_bt_init();
+ _eina_debug_timer_init();
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
// if we are setuid - don't debug!
if (getuid() != geteuid()) return EINA_TRUE;
@@ -732,21 +735,35 @@ eina_debug_init(void)
{
eina_debug_local_connect(EINA_FALSE);
}
- _eina_debug_cpu_init();
- _eina_debug_bt_init();
- _eina_debug_timer_init();
return EINA_TRUE;
}
Eina_Bool
eina_debug_shutdown(void)
{
+ Eina_Debug_Session *session;
+ pthread_t self = pthread_self();
+
+ EINA_LIST_FREE(sessions, session)
+ eina_debug_session_terminate(session);
+
_eina_debug_timer_shutdown();
_eina_debug_bt_shutdown();
_eina_debug_cpu_shutdown();
- eina_spinlock_take(&_eina_debug_thread_lock);
- // yes - we never free on shutdown - this is because the monitor thread
- // never exits. this is not a leak - we intend to never free up any
- // resources here because they are allocated once only ever.
+ _eina_debug_thread_del(&self);
+ eina_spinlock_free(&_eina_debug_lock);
+ eina_spinlock_free(&_eina_debug_thread_lock);
+ eina_threads_shutdown();
return EINA_TRUE;
}
+
+EAPI void
+eina_debug_fork_reset(void)
+{
+ extern Eina_Bool fork_resetting;
+
+ fork_resetting = EINA_TRUE;
+ eina_debug_shutdown();
+ eina_debug_init();
+ fork_resetting = EINA_FALSE;
+}
diff --git a/src/lib/eina/eina_debug.h b/src/lib/eina/eina_debug.h
index a5ef86b0f3..77e8165eab 100644
--- a/src/lib/eina/eina_debug.h
+++ b/src/lib/eina/eina_debug.h
@@ -56,10 +56,10 @@ typedef struct _Eina_Debug_Session Eina_Debug_Session;
*
* A callback invoked when a specific packet is received.
*
- * @param session the session
- * @param srcid the source id
- * @param buffer the packet payload data. It doesn't contain any transport information.
- * @param size the packet payload size
+ * @param[in,out] session the session
+ * @param[in] srcid the source id
+ * @param[in] buffer the packet payload data. It doesn't contain any transport information.
+ * @param[in] size the packet payload size
*
* return true on success, false if the connection seems compromised
*/
@@ -75,8 +75,8 @@ typedef Eina_Bool (*Eina_Debug_Cb)(Eina_Debug_Session *session, int srcid, void
* layer should not try to send more requests until a new connection is
* established.
*
- * @param data data pointer given when registering opcodes
- * @param status EINA_TRUE if opcodes have been received from the daemon, EINA_FALSE otherwise.
+ * @param[in,out] data data pointer given when registering opcodes
+ * @param[in] status EINA_TRUE if opcodes have been received from the daemon, EINA_FALSE otherwise.
*/
typedef void (*Eina_Debug_Opcode_Status_Cb)(void *data, Eina_Bool status);
@@ -86,8 +86,8 @@ typedef void (*Eina_Debug_Opcode_Status_Cb)(void *data, Eina_Bool status);
* Dispatcher callback prototype used to override the default dispatcher of a
* session.
*
- * @param session the session
- * @param buffer the packet received
+ * @param[in,out] session the session
+ * @param[in] buffer the packet received
*
* The given packet is the entire data received, including the header.
*
@@ -167,7 +167,7 @@ EAPI void eina_debug_disable(void);
/**
* @brief Connect to the local daemon
*
- * @param is_master true if the application is a debugger. EINA_FALSE otherwise.
+ * @param[in] is_master true if the application is a debugger. EINA_FALSE otherwise.
*
* @return the session on success or NULL otherwise
*/
@@ -178,7 +178,7 @@ EAPI Eina_Debug_Session *eina_debug_local_connect(Eina_Bool is_master);
*
* This function connects to localhost:port.
*
- * @param port the port to connect to
+ * @param[in] port the port to connect to
*
* @return the session on success or NULL otherwise
*/
@@ -187,8 +187,7 @@ EAPI Eina_Debug_Session *eina_debug_remote_connect(int port);
/**
* @brief Terminate the session
*
- * @param session the session to terminate
- *
+ * @param[in,out] session the session to terminate
*/
EAPI void eina_debug_session_terminate(Eina_Debug_Session *session);
@@ -199,15 +198,15 @@ EAPI void eina_debug_session_terminate(Eina_Debug_Session *session);
* use the default dispatcher there.
* All the packets received in this session will use this dispatcher.
*
- * @param session the session
- * @disp_cb the new dispatcher for the given session
+ * @param[in,out] session the session
+ * @param[in] disp_cb the new dispatcher for the given session
*/
EAPI void eina_debug_session_dispatch_override(Eina_Debug_Session *session, Eina_Debug_Dispatch_Cb disp_cb);
/**
* @brief Get the dispatcher of a specific session
*
- * @param session the session
+ * @param[in,out] session the session
*
* @return the session dispatcher
*/
@@ -220,8 +219,8 @@ EAPI Eina_Debug_Dispatch_Cb eina_debug_session_dispatch_get(Eina_Debug_Session *
* the correct callback according to the opcode.
* This is the default dispatcher.
*
- * @param session the session
- * @param buffer the packet
+ * @param[in,out] session the session
+ * @param[in] buffer the packet
*
* return true on success, false if the connection seems compromised
*/
@@ -230,16 +229,15 @@ EAPI Eina_Bool eina_debug_dispatch(Eina_Debug_Session *session, void *buffer);
/**
* @brief Set data to a session
*
- * @param session the session
- * @param data the data to set
- *
+ * @param[in,out] session the session
+ * @param[in] data the data to set
*/
EAPI void eina_debug_session_data_set(Eina_Debug_Session *session, void *data);
/**
* @brief Get the data attached to a session
*
- * @param session the session
+ * @param[in,out] session the session
*
* @return the data of the session
*/
@@ -254,10 +252,10 @@ EAPI void *eina_debug_session_data_get(Eina_Debug_Session *session);
* On the reception from the daemon, status_cb function is invoked to inform
* the requester that the opcodes can now be used.
*
- * @param session the session
- * @param ops the operations to register
- * @param status_cb a function to call when the opcodes are received
- * @param status_data the data to give to status_cb
+ * @param[in,out] session the session
+ * @param[in] ops the operations to register
+ * @param[in] status_cb a function to call when the opcodes are received
+ * @param[in] status_data the data to give to status_cb
*/
EAPI void eina_debug_opcodes_register(Eina_Debug_Session *session,
const Eina_Debug_Opcode ops[],
@@ -268,11 +266,11 @@ EAPI void eina_debug_opcodes_register(Eina_Debug_Session *session,
*
* The packet will be treated by the debug thread itself.
*
- * @param session the session to use to send the packet
- * @param dest_id the destination id to send the packet to
- * @param op the opcode for this packet
- * @param data payload to send
- * @param size payload size
+ * @param[in,out] session the session to use to send the packet
+ * @param[in] dest_id the destination id to send the packet to
+ * @param[in] op the opcode for this packet
+ * @param[in] data payload to send
+ * @param[in] size payload size
*
* @return the number of sent bytes
*/
@@ -281,9 +279,9 @@ EAPI int eina_debug_session_send(Eina_Debug_Session *session, int dest_id, int o
/**
* @brief Add a timer
*
- * @param timeout_ms timeout in ms
- * @param cb callback to call when the timeout is reached
- * @param data user data
+ * @param[in] timeout_ms timeout in ms
+ * @param[in] cb callback to call when the timeout is reached
+ * @param[in] data user data
*
* @return the timer handle, NULL on error
*/
@@ -292,7 +290,7 @@ EAPI Eina_Debug_Timer *eina_debug_timer_add(unsigned int timeout_ms, Eina_Debug_
/**
* @brief Delete a timer
*
- * @param timer the timer to delete
+ * @param[in,out] timer the timer to delete
*
* If the timer reaches the end and has not be renewed, trying to delete it will lead to a crash, as
* it has already been deleted internally.
@@ -300,6 +298,13 @@ EAPI Eina_Debug_Timer *eina_debug_timer_add(unsigned int timeout_ms, Eina_Debug_
EAPI void eina_debug_timer_del(Eina_Debug_Timer *timer);
/**
+ * @brief Reset the eina debug system after forking
+ *
+ * Call this any time the application forks
+ * @since 1.21
+ * */
+EAPI void eina_debug_fork_reset(void);
+/**
* @}
*/
diff --git a/src/lib/eina/eina_debug_bt.c b/src/lib/eina/eina_debug_bt.c
index 21b067c395..f38dcd481a 100644
--- a/src/lib/eina/eina_debug_bt.c
+++ b/src/lib/eina/eina_debug_bt.c
@@ -37,7 +37,65 @@
#ifndef _WIN32
# include <signal.h>
-# define SIG SIGPROF
+// realtime signals guarantee a minimum of 8, so SIGRTMIN + 7 would be valid
+// at a minimum, so let's choose + 6 ... second last of the minimum set.
+// SIGRTMAX of course is defined too... note the manual pages for sigation say
+// that it calls rt_sigaction transparently for us so... no need for anything
+// else special
+# ifdef SIGRTMIN
+# define SIG (SIGRTMIN + 6)
+# else
+// OSX seems to not support posix RT signals... too old a kernel. so be partly
+// broken on OSX in that a HUP signal will maybe cause a crash... but compiling
+// with -pg would have guaranteed always caused a crash before anyway.
+// given OSX only supports "old-style" signals like:
+//
+// #define SIGHUP 1 /* hangup */
+// #define SIGINT 2 /* interrupt */
+// #define SIGQUIT 3 /* quit */
+// #define SIGILL 4 /* illegal instruction (not reset when caught) */
+// #define SIGTRAP 5 /* trace trap (not reset when caught) */
+// #define SIGABRT 6 /* abort() */
+// #if (defined(_POSIX_C_SOURCE) && !defined(_DARWIN_C_SOURCE))
+// # define SIGPOLL 7 /* pollable event ([XSR] generated, not supported) */
+// #else /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
+// # define SIGIOT SIGABRT /* compatibility */
+// # define SIGEMT 7 /* EMT instruction */
+// #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
+// #define SIGFPE 8 /* floating point exception */
+// #define SIGKILL 9 /* kill (cannot be caught or ignored) */
+// #define SIGBUS 10 /* bus error */
+// #define SIGSEGV 11 /* segmentation violation */
+// #define SIGSYS 12 /* bad argument to system call */
+// #define SIGPIPE 13 /* write on a pipe with no one to read it */
+// #define SIGALRM 14 /* alarm clock */
+// #define SIGTERM 15 /* software termination signal from kill */
+// #define SIGURG 16 /* urgent condition on IO channel */
+// #define SIGSTOP 17 /* sendable stop signal not from tty */
+// #define SIGTSTP 18 /* stop signal from tty */
+// #define SIGCONT 19 /* continue a stopped process */
+// #define SIGCHLD 20 /* to parent on child stop or exit */
+// #define SIGTTIN 21 /* to readers pgrp upon background tty read */
+// #define SIGTTOU 22 /* like TTIN for output if (tp->t_local&LTOSTOP) */
+// #if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
+// # define SIGIO 23 /* input/output possible signal */
+// #endif
+// #define SIGXCPU 24 /* exceeded CPU time limit */
+// #define SIGXFSZ 25 /* exceeded file size limit */
+// #define SIGVTALRM 26 /* virtual time alarm */
+// #define SIGPROF 27 /* profiling time alarm */
+// #if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
+// # define SIGWINCH 28 /* window size changes */
+// # define SIGINFO 29 /* information request */
+// #endif
+// #define SIGUSR1 30 /* user defined signal 1 */
+// #define SIGUSR2 31 /* user defined signal 2 */
+//
+// (excerpt from OSX's signal.h - found at:
+// http://github.com/st3fan/osx-10.9/blob/master/xnu-2422.1.72/bsd/sys/signal.h
+// pasting here due to how difficult it was to find a signal list for OSX)
+# define SIG SIGHUP
+# endif
#endif
static Eina_Semaphore _wait_for_bts_sem;
@@ -52,6 +110,10 @@ static int *_bt_cpu;
static double _trace_t0 = 0.0;
static Eina_Debug_Timer *_timer = NULL;
+#ifndef _WIN32
+static struct sigaction old_sigprof_action;
+#endif
+
void
_eina_debug_dump_fhandle_bt(FILE *f, void **bt, int btlen)
{
@@ -196,6 +258,15 @@ _signal_init(void)
#ifndef _WIN32
struct sigaction sa;
+ memset(&sa, 0, sizeof(struct sigaction));
+
+ sa.sa_handler = SIG_DFL;
+ sa.sa_sigaction = NULL;
+ sa.sa_flags = SA_RESTART | SA_SIGINFO;
+ sigemptyset(&sa.sa_mask);
+ sigaction(SIG, &sa, &old_sigprof_action);
+
+ memset(&sa, 0, sizeof(struct sigaction));
// set up signal handler for our profiling signal - eevery thread should
// obey this (this is the case on linux - other OSs may vary)
sa.sa_sigaction = _signal_handler;
@@ -213,6 +284,14 @@ _signal_init(void)
}
static void
+_signal_shutdown(void)
+{
+#ifndef _WIN32
+ sigaction(SIG, &old_sigprof_action, NULL);
+#endif
+}
+
+static void
_collect_bt(pthread_t pth)
{
// this async signals the thread to switch to the deebug signal handler
@@ -290,6 +369,8 @@ static Eina_Bool
_prof_on_cb(Eina_Debug_Session *session, int cid EINA_UNUSED, void *buffer, int size)
{
unsigned int time;
+
+ _signal_init();
if (size >= 4)
{
memcpy(&time, buffer, 4);
@@ -305,6 +386,7 @@ _prof_off_cb(Eina_Debug_Session *session EINA_UNUSED, int cid EINA_UNUSED, void
{
eina_debug_timer_del(_timer);
_timer = NULL;
+ _signal_shutdown();
return EINA_TRUE;
}
@@ -317,7 +399,6 @@ EINA_DEBUG_OPCODES_ARRAY_DEFINE(_OPS,
Eina_Bool
_eina_debug_bt_init(void)
{
- _signal_init();
eina_semaphore_new(&_wait_for_bts_sem, 0);
eina_debug_opcodes_register(NULL, _OPS(), NULL, NULL);
return EINA_TRUE;
diff --git a/src/lib/eina/eina_debug_chunk.c b/src/lib/eina/eina_debug_chunk.c
index 36629198a0..4ee9655140 100644
--- a/src/lib/eina/eina_debug_chunk.c
+++ b/src/lib/eina/eina_debug_chunk.c
@@ -24,6 +24,11 @@
# include "config.h"
# endif
+#ifdef HAVE_VALGRIND
+# include <valgrind.h>
+# include <memcheck.h>
+#endif
+
#ifdef HAVE_MMAP
# include <sys/mman.h>
@@ -50,9 +55,15 @@ _eina_debug_chunk_need(int size)
{
void *ptr;
- ptr = mmap(NULL, size, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_ANON, -1, 0);
- if (ptr == MAP_FAILED) return NULL;
+#ifdef HAVE_VALGRIND
+ if (RUNNING_ON_VALGRIND) ptr = malloc(size);
+ else
+#endif
+ {
+ ptr = mmap(NULL, size, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANON, -1, 0);
+ if (ptr == MAP_FAILED) return NULL;
+ }
return ptr;
}
@@ -60,7 +71,11 @@ _eina_debug_chunk_need(int size)
static void
_eina_debug_chunk_noneed(void *ptr, int size)
{
- munmap(ptr, size);
+#ifdef HAVE_VALGRIND
+ if (RUNNING_ON_VALGRIND) free(ptr);
+ else
+#endif
+ munmap(ptr, size);
}
// push a new bit of mem on our growing stack of mem - given our workload,
diff --git a/src/lib/eina/eina_debug_cpu.c b/src/lib/eina/eina_debug_cpu.c
index 20f83b7cea..b4c3cf49c4 100644
--- a/src/lib/eina/eina_debug_cpu.c
+++ b/src/lib/eina/eina_debug_cpu.c
@@ -25,20 +25,15 @@
#include "eina_evlog.h"
#include "eina_debug_private.h"
-#ifdef EINA_HAVE_PTHREAD_SETNAME
-# ifndef __linux__
-# include <pthread_np.h>
-# endif
-#endif
-
+#ifndef _WIN32
volatile int _eina_debug_sysmon_reset = 0;
volatile int _eina_debug_sysmon_active = 0;
volatile int _eina_debug_evlog_active = 0;
+volatile int _eina_debug_cpu_active = 0;
-static Eina_Lock _sysmon_lock;
+Eina_Lock _sysmon_lock;
-static Eina_Bool _sysmon_thread_runs = EINA_FALSE;
-static pthread_t _sysmon_thread;
+static Eina_Thread _sysmon_thread;
// this is a DEDICATED thread tojust collect system info and to have the
// least impact it can on a cpu core or system. all this does right now
@@ -46,7 +41,7 @@ static pthread_t _sysmon_thread;
// right now that means iterating through cpu's and getting their cpu
// frequency to match up with event logs.
static void *
-_sysmon(void *_data EINA_UNUSED)
+_sysmon(void *data EINA_UNUSED, Eina_Thread thr EINA_UNUSED)
{
static int cpufreqs[64] = { 0 };
int i, fd, freq;
@@ -64,19 +59,13 @@ _sysmon(void *_data EINA_UNUSED)
#endif
// set a name for this thread for system debugging
-#ifdef EINA_HAVE_PTHREAD_SETNAME
-# ifndef __linux__
- pthread_set_name_np
-# else
- pthread_setname_np
-# endif
- (pthread_self(), "Edbg-sys");
-#endif
+ eina_thread_name_set(eina_thread_self(), "Edbg-sys");
for (;;)
{
// wait on a mutex that will be locked for as long as this
// threead is not meant to go running
eina_lock_take(&_sysmon_lock);
+ if (!_eina_debug_cpu_active) break;
// if we need to reset as we just started polling system stats...
if (_eina_debug_sysmon_reset)
{
@@ -135,7 +124,7 @@ _sysmon(void *_data EINA_UNUSED)
}
for (i = 0; i < _eina_debug_thread_active_num; i++)
{
- pthread_t thread = _eina_debug_thread_active[i].thread;
+ Eina_Thread thread = _eina_debug_thread_active[i].thread;
// get the clock for the thread and its cpu time usage
pthread_getcpuclockid(thread, &cid);
clock_gettime(cid, &t);
@@ -247,36 +236,63 @@ _sysmon(void *_data EINA_UNUSED)
}
usleep(1000); // 1ms sleep
}
+ _eina_debug_cpu_active = -1;
+ eina_lock_release(&_sysmon_lock);
return NULL;
}
static Eina_Bool
_cpufreq_on_cb(Eina_Debug_Session *session EINA_UNUSED, int cid EINA_UNUSED, void *buffer EINA_UNUSED, int size EINA_UNUSED)
{
+ Eina_Bool err;
if (!_eina_debug_evlog_active)
{
_eina_debug_evlog_active = 1;
eina_evlog_start();
}
- if (!_eina_debug_sysmon_active)
+ if (_eina_debug_sysmon_active) return EINA_TRUE;
+
+ eina_lock_take(&_sysmon_lock);
+
+ err = eina_thread_create(&_sysmon_thread, EINA_THREAD_NORMAL, -1, _sysmon, NULL);
+
+ if (!err)
{
- _eina_debug_sysmon_reset = 1;
- _eina_debug_sysmon_active = 1;
- // this is intended. taking this lock allows sysmon to run
+ e_debug("EINA DEBUG ERROR: Can't create debug sysmon thread!");
eina_lock_release(&_sysmon_lock);
+ return EINA_FALSE;
}
+ _eina_debug_cpu_active = 1;
+ _eina_debug_sysmon_reset = 1;
+ _eina_debug_sysmon_active = 1;
+ eina_lock_release(&_sysmon_lock);
return EINA_TRUE;
}
-static Eina_Bool
-_cpufreq_off_cb(Eina_Debug_Session *session EINA_UNUSED, int cid EINA_UNUSED, void *buffer EINA_UNUSED, int size EINA_UNUSED)
+static void
+_stop_cpu_thread(void)
{
- if (_eina_debug_sysmon_active)
+ extern Eina_Bool fork_resetting;
+ eina_lock_take(&_sysmon_lock);
+ _eina_debug_cpu_active = 0;
+ eina_lock_release(&_sysmon_lock);
+ /* wait for thread to exit */
+ while (!fork_resetting)
{
- // this is intended. taking this lock blocks sysmod from running
+ usleep(1000);
eina_lock_take(&_sysmon_lock);
- _eina_debug_sysmon_active = 0;
+ if (_eina_debug_cpu_active == -1) break;
+ eina_lock_release(&_sysmon_lock);
}
+ _eina_debug_cpu_active = 0;
+ eina_lock_release(&_sysmon_lock);
+}
+
+static Eina_Bool
+_cpufreq_off_cb(Eina_Debug_Session *session EINA_UNUSED, int cid EINA_UNUSED, void *buffer EINA_UNUSED, int size EINA_UNUSED)
+{
+ if (!_eina_debug_sysmon_active) return EINA_TRUE;
+ _stop_cpu_thread();
if (_eina_debug_evlog_active)
{
eina_evlog_stop();
@@ -290,44 +306,13 @@ EINA_DEBUG_OPCODES_ARRAY_DEFINE(_OPS,
{"CPU/Freq/off", NULL, &_cpufreq_off_cb},
{NULL, NULL, NULL}
);
+#endif
Eina_Bool
_eina_debug_cpu_init(void)
{
- // if it's already running - we're good.
#ifndef _WIN32
- if (!_sysmon_thread_runs)
- {
- int err;
- sigset_t oldset, newset;
-
- eina_lock_new(&_sysmon_lock);
- eina_lock_take(&_sysmon_lock);
- sigemptyset(&newset);
- sigaddset(&newset, SIGPIPE);
- sigaddset(&newset, SIGALRM);
- sigaddset(&newset, SIGCHLD);
- sigaddset(&newset, SIGUSR1);
- sigaddset(&newset, SIGUSR2);
- sigaddset(&newset, SIGHUP);
- sigaddset(&newset, SIGQUIT);
- sigaddset(&newset, SIGINT);
- sigaddset(&newset, SIGTERM);
-#ifdef SIGPWR
- sigaddset(&newset, SIGPWR);
-#endif
- pthread_sigmask(SIG_BLOCK, &newset, &oldset);
-
- err = pthread_create(&_sysmon_thread, NULL, _sysmon, NULL);
-
- pthread_sigmask(SIG_SETMASK, &oldset, NULL);
- if (err != 0)
- {
- e_debug("EINA DEBUG ERROR: Can't create debug sysmon thread!");
- abort();
- }
- _sysmon_thread_runs = EINA_TRUE;
- }
+ eina_lock_new(&_sysmon_lock);
eina_debug_opcodes_register(NULL, _OPS(), NULL, NULL);
#endif
return EINA_TRUE;
@@ -336,6 +321,11 @@ _eina_debug_cpu_init(void)
Eina_Bool
_eina_debug_cpu_shutdown(void)
{
+#ifndef _WIN32
+ if (_eina_debug_sysmon_active)
+ _stop_cpu_thread();
+ eina_lock_free(&_sysmon_lock);
+ _eina_debug_sysmon_reset = _eina_debug_sysmon_active = _eina_debug_evlog_active = 0;
+#endif
return EINA_TRUE;
}
-
diff --git a/src/lib/eina/eina_debug_private.h b/src/lib/eina/eina_debug_private.h
index 448f7909c4..a635c2072d 100644
--- a/src/lib/eina/eina_debug_private.h
+++ b/src/lib/eina/eina_debug_private.h
@@ -32,7 +32,7 @@ typedef struct _Eina_Debug_Thread Eina_Debug_Thread;
struct _Eina_Debug_Thread
{
- pthread_t thread;
+ Eina_Thread thread;
Eina_Debug_Session *cmd_session;
void *cmd_buffer;
@@ -47,7 +47,7 @@ struct _Eina_Debug_Thread
extern Eina_Spinlock _eina_debug_lock;
extern Eina_Spinlock _eina_debug_thread_lock;
-extern pthread_t _eina_debug_thread_mainloop;
+extern Eina_Thread _eina_debug_thread_mainloop;
extern Eina_Debug_Thread *_eina_debug_thread_active;
extern int _eina_debug_thread_active_num;
diff --git a/src/lib/eina/eina_debug_thread.c b/src/lib/eina/eina_debug_thread.c
index d6535f56e7..ce940e76e4 100644
--- a/src/lib/eina/eina_debug_thread.c
+++ b/src/lib/eina/eina_debug_thread.c
@@ -26,7 +26,7 @@
// like get them to stop and dump a backtrace for us
Eina_Spinlock _eina_debug_thread_lock;
-pthread_t _eina_debug_thread_mainloop = 0;
+Eina_Thread _eina_debug_thread_mainloop = 0;
Eina_Debug_Thread *_eina_debug_thread_active = NULL;
int _eina_debug_thread_active_num = 0;
@@ -39,7 +39,7 @@ static int _thread_id_counter = 1;
void
_eina_debug_thread_add(void *th)
{
- pthread_t *pth = th;
+ Eina_Thread *pth = th;
// take thread tracking lock
eina_spinlock_take(&_eina_debug_thread_lock);
// if we don't have enough space to store thread id's - make some more
@@ -74,7 +74,7 @@ _eina_debug_thread_add(void *th)
void
_eina_debug_thread_del(void *th)
{
- pthread_t *pth = th;
+ Eina_Thread *pth = th;
int i;
// take a thread tracking lock
eina_spinlock_take(&_eina_debug_thread_lock);
@@ -99,7 +99,7 @@ _eina_debug_thread_del(void *th)
void
_eina_debug_thread_mainloop_set(void *th)
{
- pthread_t *pth = th;
+ Eina_Thread *pth = th;
_eina_debug_thread_mainloop = *pth;
}
diff --git a/src/lib/eina/eina_debug_timer.c b/src/lib/eina/eina_debug_timer.c
index 610869c2dc..8d03c0e57b 100644
--- a/src/lib/eina/eina_debug_timer.c
+++ b/src/lib/eina/eina_debug_timer.c
@@ -56,7 +56,6 @@ struct _Eina_Debug_Timer
static Eina_List *_timers = NULL;
static Eina_Bool _thread_runs = EINA_FALSE;
-static Eina_Bool _exit_required = EINA_FALSE;
static pthread_t _thread;
static int pipeToThread[2];
@@ -103,9 +102,10 @@ _monitor(void *_data EINA_UNUSED)
# endif
(pthread_self(), "Edbg-tim");
#endif
- for (;!_exit_required;)
+ while (1)
{
int timeout = -1; //in milliseconds
+ pthread_testcancel();
eina_spinlock_take(&_lock);
if (_timers)
{
@@ -115,13 +115,13 @@ _monitor(void *_data EINA_UNUSED)
eina_spinlock_release(&_lock);
ret = epoll_wait(epfd, events, MAX_EVENTS, timeout);
- if (_exit_required) continue;
+ pthread_testcancel();
/* Some timer has been add/removed or we need to exit */
if (ret)
{
char c;
- if (read(pipeToThread[0], &c, 1) != 1) _exit_required = EINA_TRUE;
+ if (read(pipeToThread[0], &c, 1) != 1) break;
}
else
{
@@ -220,11 +220,19 @@ _eina_debug_timer_init(void)
Eina_Bool
_eina_debug_timer_shutdown(void)
{
- char c = '\0';
- _exit_required = EINA_TRUE;
- if (write(pipeToThread[1], &c, 1) != 1)
- e_debug("Eina debug timer shutdown write failed!");
+ Eina_Debug_Timer *t;
+
+ eina_spinlock_take(&_lock);
+ EINA_LIST_FREE(_timers, t)
+ free(t);
+ close(pipeToThread[0]);
+ close(pipeToThread[1]);
+ if (_thread_runs)
+ pthread_cancel(_thread);
+ _thread_runs = 0;
+ eina_spinlock_release(&_lock);
eina_spinlock_free(&_lock);
+
return EINA_TRUE;
}
diff --git a/src/lib/eina/eina_evlog.c b/src/lib/eina/eina_evlog.c
index 9c9cbccdaf..3e5f3c55f2 100644
--- a/src/lib/eina/eina_evlog.c
+++ b/src/lib/eina/eina_evlog.c
@@ -20,6 +20,11 @@
# include "config.h"
#endif
+#ifdef HAVE_VALGRIND
+# include <valgrind.h>
+# include <memcheck.h>
+#endif
+
#include "Eina.h"
#include "eina_evlog.h"
#include "eina_debug.h"
@@ -97,13 +102,19 @@ alloc_buf(Eina_Evlog_Buf *b, unsigned int size)
if (b->buf) return;
b->size = size;
b->top = 0;
-# ifdef HAVE_MMAP
- b->buf = mmap(NULL, size, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_ANON, -1, 0);
- if (b->buf == MAP_FAILED) b->buf = NULL;
-# else
- b->buf = malloc(size);
+#ifdef HAVE_MMAP
+# ifdef HAVE_VALGRIND
+ if (RUNNING_ON_VALGRIND) b->buf = malloc(size);
+ else
# endif
+ {
+ b->buf = mmap(NULL, size, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANON, -1, 0);
+ if (b->buf == MAP_FAILED) b->buf = NULL;
+ }
+#else
+ b->buf = malloc(size);
+#endif
b->overflow = 0;
}
@@ -111,11 +122,15 @@ static void
free_buf(Eina_Evlog_Buf *b)
{
if (!b->buf) return;
-# ifdef HAVE_MMAP
+#ifdef HAVE_MMAP
+# ifdef HAVE_VALGRIND
+ if (RUNNING_ON_VALGRIND) free(b->buf);
+ else
+# endif
munmap(b->buf, b->size);
-# else
+#else
free(b->buf);
-# endif
+#endif
b->buf = NULL;
b->size = 0;
b->top = 0;
diff --git a/src/lib/eina/eina_evlog.h b/src/lib/eina/eina_evlog.h
index 4369ace253..ecd8fa0e05 100644
--- a/src/lib/eina/eina_evlog.h
+++ b/src/lib/eina/eina_evlog.h
@@ -58,7 +58,7 @@ struct _Eina_Evlog_Buf
/**
* @brief Logs an event in our event log for profiling data.
*
- * Log some interesting event inside of EFL, eg a wakeup (and why etc.).
+ * Log some interesting event inside of EFL, e.g. a wakeup (and why etc.).
* The @p event string must always be provided and be of the form:
*
* "+eventname"
diff --git a/src/lib/eina/eina_file.h b/src/lib/eina/eina_file.h
index bccadeb734..77770e26ef 100644
--- a/src/lib/eina/eina_file.h
+++ b/src/lib/eina/eina_file.h
@@ -123,7 +123,7 @@ typedef enum {
EINA_FILE_DIR, /**< Directory type */
EINA_FILE_BLK, /**< Block device type (unused on Windows) */
EINA_FILE_REG, /**< Regular file type */
- EINA_FILE_LNK, /**< Symbolic link type */
+ EINA_FILE_LNK, /**< Symbolic link type (unused on Windows) */
EINA_FILE_SOCK, /**< UNIX domain socket type (unused on Windows) */
EINA_FILE_WHT /**< Whiteout file type (unused on Windows) */
} Eina_File_Type;
@@ -145,7 +145,7 @@ typedef enum {
EINA_FILE_WILLNEED, /**< Advise need for all the mapped memory */
EINA_FILE_POPULATE, /**< Request for all the mapped memory */
EINA_FILE_DONTNEED, /**< Indicate that the memory is no longer needed. This may result in the memory being removed from any caches if applicable. @since 1.8 */
- EINA_FILE_REMOVE /**< This memory is to be released and any content will be lost. Subsequent accesses will succeed but return fresh memory as if accessed for the first time. This may not suceed if the filesystem does not support it. @since 1.8 */
+ EINA_FILE_REMOVE /**< This memory is to be released and any content will be lost. Subsequent accesses will succeed but return fresh memory as if accessed for the first time. This may not succeed if the filesystem does not support it. @since 1.8 */
} Eina_File_Populate;
/* Why do this? Well PATH_MAX may vary from when eina itself is compiled
@@ -747,7 +747,7 @@ static inline size_t eina_file_path_join(char *dst,
* a file.
*
* @param pathname File name to unlink.
- * @return #EINA_TRUE if the unlink was successfull, #EINA_FALSE otherwise..
+ * @return #EINA_TRUE if the unlink was successful, #EINA_FALSE otherwise..
*
* @since 1.19
*/
diff --git a/src/lib/eina/eina_file_common.c b/src/lib/eina/eina_file_common.c
index 1c53226a35..3de42523ca 100644
--- a/src/lib/eina/eina_file_common.c
+++ b/src/lib/eina/eina_file_common.c
@@ -23,9 +23,6 @@
#include <string.h>
#include <stdint.h>
#include <stdio.h>
-#ifdef HAVE_DIRENT_H
-# include <dirent.h>
-#endif
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
diff --git a/src/lib/eina/eina_file_common.h b/src/lib/eina/eina_file_common.h
index cc041f64b2..2fc87001e5 100644
--- a/src/lib/eina/eina_file_common.h
+++ b/src/lib/eina/eina_file_common.h
@@ -176,7 +176,7 @@ struct _Eina_Lines_Iterator
/**
* @brief Determines if a path is relative or absolute.
- * The implementation simply chekcs if the first char in the path is '/'. If it
+ * The implementation simply checks if the first char in the path is '/'. If it
* is not, the path is considered relative.
*
* @param path The path to check.
@@ -267,7 +267,7 @@ extern int _eina_file_log_dom;
// Common function to handle virtual file
/**
- * @brief Map the entire contents fo a virtual file to a buffer.
+ * @brief Map the entire contents of a virtual file to a buffer.
*
* @param file The virtual file to map in memory
*
@@ -297,7 +297,7 @@ void eina_file_virtual_map_free(Eina_File *file, void *map);
// Common hash function
/**
* @brief Get the length of a map key.
- * @warning This function is not yet implemented. At present it ony returns
+ * @warning This function is not yet implemented. At present it only returns
* @code sizeof (unsigned long int) * 2 @endcode
*
* @param key The key for which length will be calculated.
diff --git a/src/lib/eina/eina_file_win32.c b/src/lib/eina/eina_file_win32.c
index 4cb0a22ac9..537723e01b 100644
--- a/src/lib/eina/eina_file_win32.c
+++ b/src/lib/eina/eina_file_win32.c
@@ -330,14 +330,13 @@ _eina_file_win32_direct_ls_iterator_next(Eina_File_Direct_Iterator *it, void **d
if (attr & FILE_ATTRIBUTE_DIRECTORY)
it->info.type = EINA_FILE_DIR;
- else if (attr & FILE_ATTRIBUTE_REPARSE_POINT)
- it->info.type = EINA_FILE_LNK;
else if (attr & (FILE_ATTRIBUTE_ARCHIVE |
FILE_ATTRIBUTE_COMPRESSED |
FILE_ATTRIBUTE_HIDDEN |
FILE_ATTRIBUTE_NORMAL |
FILE_ATTRIBUTE_SPARSE_FILE |
- FILE_ATTRIBUTE_TEMPORARY))
+ FILE_ATTRIBUTE_TEMPORARY |
+ FILE_ATTRIBUTE_REPARSE_POINT))
it->info.type = EINA_FILE_REG;
else
it->info.type = EINA_FILE_UNKNOWN;
@@ -1061,8 +1060,7 @@ eina_file_statat(void *container EINA_UNUSED, Eina_File_Direct_Info *info, Eina_
if (stat64(info->path, &buf))
{
- if (info->type != EINA_FILE_LNK)
- info->type = EINA_FILE_UNKNOWN;
+ info->type = EINA_FILE_UNKNOWN;
return -1;
}
diff --git a/src/lib/eina/eina_freeq.h b/src/lib/eina/eina_freeq.h
index 2fef71d7ce..b37da39517 100644
--- a/src/lib/eina/eina_freeq.h
+++ b/src/lib/eina/eina_freeq.h
@@ -71,7 +71,7 @@
*
* A queue of pointers to free in the future. You may create custom free
* queues of your own to defer freeing, use the main free queue where the
- * mainloop will free thnigs as it iterates, or eina will free everything
+ * mainloop will free things as it iterates, or eina will free everything
* on shut down.
*
*/
@@ -90,7 +90,7 @@ typedef enum _Eina_FreeQ_Type
* safety purposes only.
*
* As this type of free queue is thread-safe, the free functions used must
- * also be thread-safe (eg. libc free()).
+ * also be thread-safe (e.g.. libc free()).
*
* @since 1.19
*/
@@ -173,7 +173,7 @@ eina_freeq_main_get(void);
* called.
*
* @note Setting a maximum count on a postponed free queue leads to undefined
- * behaviour.
+ * behavior.
*
* @since 1.19
*/
@@ -206,7 +206,7 @@ eina_freeq_count_max_get(Eina_FreeQ *fq);
* memory used by items in the queue is below or at the limit.
*
* @note Setting a memory limit on a postponed free queue leads to undefined
- * behaviour.
+ * behavior.
*
* @since 1.19
*/
diff --git a/src/lib/eina/eina_hash.h b/src/lib/eina/eina_hash.h
index 40b0c227f6..6efdfce34b 100644
--- a/src/lib/eina/eina_hash.h
+++ b/src/lib/eina/eina_hash.h
@@ -158,19 +158,19 @@
/**
* @addtogroup Eina_Hash_Group Hash Table
*
- * @brief Hash table management. Useful for mapping keys to values.
+ * @brief Hash table management. Maps keys to values.
*
- * The hash table is useful for when one wants to implement a table that maps
- * keys (usually strings) to data, and have relatively fast access time. The
- * performance is proportional to the load factor of the table (number of
- * elements / number of buckets). See @ref hashtable_algo for implementation
- * details.
+ * The hash table associates keys (e.g. strings) to data, with
+ * relatively fast access time. The performance is proportional to the
+ * load factor of the table (number of elements / number of
+ * buckets). See @ref hashtable_algo for implementation details.
*
- * Different implementations exists depending on what kind of key will be used
- * to access the data: strings, integers, pointers, stringshared or your own.
+ * There are optimized implementations for some common key types, such
+ * as strings, integers, pointers, and stringshared; custom optimizations
+ * are also permitted.
*
- * Eina hash tables can copy the keys when using eina_hash_add() or not when
- * using eina_hash_direct_add().
+ * The hash table keys can be either copied or non-copied, using
+ * eina_hash_add() or eina_hash_direct_add(), respectively.
*
* @section hashtable_algo Algorithm
*
@@ -178,7 +178,7 @@
* bucket is a pointer to a structure that is the head of a <a
* href="http://en.wikipedia.org/wiki/Red-black_tree">red-black tree</a>. The
* array can then be indexed by the [hash_of_element mod N]. The
- * hash_of_element is calculated using the hashing function, passed as
+ * hash_of_element is calculated using the hashing function, passed as a
* parameter to the @ref eina_hash_new function. N is the number of buckets
* (array positions), and is calculated based on the buckets_power_size
* (argument of @ref eina_hash_new too). The following picture illustrates the
@@ -189,29 +189,28 @@
* @endhtmlonly
* @image latex 01_hash-table.eps
*
- * Adding an element to the hash table is made of:
- * @li calculating the hash for that key (using the specified hash function);
+ * Adding an element to the hash table involves the following steps:
+ * @li calculate the hash for that key (using the specified hash function);
* @li calculate the array position [hash mod N];
* @li add the element to the rbtree on that position.
*
- * The two first steps have constant time, proportional to the hash function
- * being used. Adding the key to the rbtree will be proportional on the number
- * of keys on that bucket.
+ * The first two steps have constant time, proportional to the hash function
+ * being used. Adding the key to the rbtree will be proportional to the number
+ * of keys in that bucket.
*
- * The average cost of lookup depends on the number of keys per
- * bucket (load factor) of the table, if the distribution of keys is
+ * The average lookup cost depends on the number of keys per bucket
+ * (load factor) of the table, assuming the distribution of keys is
* sufficiently uniform.
*
* @section hashtable_perf Performance
*
- * As said before, the performance depends on the load factor. So trying to keep
- * the load factor as small as possible will improve the hash table performance. But
+ * Keeping the load factor small will improve the hash table performance. But
* increasing the buckets_power_size will also increase the memory consumption.
- * The default hash table creation functions already have a good number of
- * buckets, enough for most cases. Particularly for strings, if just a few keys
+ * The default hash table creation functions provides enough
+ * buckets for most cases. If just a few string keys
* (less than 30) will be added to the hash table, @ref
- * eina_hash_string_small_new should be used, since it will reduce the memory
- * consumption for the buckets, and you still won't have many collisions.
+ * eina_hash_string_small_new should be used, since it reduces the memory
+ * consumption for the buckets without causing too many collisions.
* However, @ref eina_hash_string_small_new still uses the same hash calculation
* function that @ref eina_hash_string_superfast_new, which is more complex than
* @ref eina_hash_string_djb2_new. The latter has a faster hash computation
@@ -240,8 +239,8 @@
*
* When adding a new key to a hash table, use @ref eina_hash_add or @ref
* eina_hash_direct_add (the latter if this key is already stored elsewhere). If
- * the key may be already inside the hash table, instead of checking with
- * @ref eina_hash_find and then doing @ref eina_hash_add, one can use just @ref
+ * the key may be already inside the hash table, rather than checking with
+ * @ref eina_hash_find followed by @ref eina_hash_add, one can use just @ref
* eina_hash_set (this will change the data pointed by this key if it was
* already present in the table).
*
@@ -352,20 +351,20 @@ typedef Eina_Bool (*Eina_Hash_Foreach)(const Eina_Hash *hash, const void *key
* @param key_cmp_cb The function called when comparing the keys.
* @param key_hash_cb The function called when getting the values.
* @param data_free_cb The function called on each value when the hash table is
- * freed, or when an item is deleted from it. @c NULL can be passed as
+ * freed, or when an item is deleted from it. @c NULL can be passed as a
* callback.
* @param buckets_power_size The size of the buckets.
- * @return The new hash table.
+ * @return The new hash table, or @c NULL on failure.
*
* This function creates a new hash table using user-defined callbacks
- * to manage the hash table. On failure, @c NULL is returned.
+ * to manage the hash table.
* If @p key_cmp_cb or @p key_hash_cb
* are @c NULL, @c NULL is returned. If @p buckets_power_size is
* smaller or equal than 2, or if it is greater or equal than 17,
* @c NULL is returned.
*
* The number of buckets created will be 2 ^ @p buckets_power_size. This means
- * that if @p buckets_power_size is 5, there will be created 32 buckets. for a
+ * that if @p buckets_power_size is 5, there will be created 32 buckets, whereas for a
* @p buckets_power_size of 8, there will be 256 buckets.
*
* Pre-defined functions are available to create a hash table. See
@@ -381,14 +380,14 @@ EAPI Eina_Hash *eina_hash_new(Eina_Key_Length key_length_cb,
int buckets_power_size) EINA_MALLOC EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(2, 3);
/**
- * @brief Redefines the callback that cleans the data of a hash.
+ * @brief Sets the data cleanup callback for a hash.
*
- * @param hash The given hash table
+ * @param hash The given hash table.
* @param data_free_cb The function called on each value when the hash
* table is freed, or when an item is deleted from it. @c NULL can be passed as
* callback to remove an existing callback.
*
- * The argument received by @p data_free_cb will be that data of the item being
+ * The argument received by @p data_free_cb will be the data of the item being
* removed.
*
* @since 1.1
@@ -402,12 +401,12 @@ EAPI void eina_hash_free_cb_set(Eina_Hash *hash, Eina_Free_Cb data_free_cb) EINA
* @param data_free_cb The function called on each value when the hash table
* is freed, or when an item is deleted from it. @c NULL can be passed as
* callback.
- * @return The new hash table.
+ * @return The new hash table, or @c NULL on failure.
*
* This function creates a new hash table using the djb2 algorithm for
* table management and strcmp() to compare the keys. Values can then
* be looked up with pointers other than the original key pointer that
- * was used to add values. On failure, this function returns @c NULL.
+ * was used to add values.
*/
EAPI Eina_Hash *eina_hash_string_djb2_new(Eina_Free_Cb data_free_cb);
@@ -417,16 +416,16 @@ EAPI Eina_Hash *eina_hash_string_djb2_new(Eina_Free_Cb data_free_cb);
* @param data_free_cb The function called on each value when the hash table
* is freed, or when an item is deleted from it. @c NULL can be passed as
* callback.
- * @return The new hash table.
+ * @return The new hash table, or @c NULL on failure.
*
* This function creates a new hash table using the superfast algorithm
* for table management and strcmp() to compare the keys. Values can
* then be looked up with pointers other than the original key pointer
- * that was used to add values. On failure, this function returns
- * @c NULL.
+ * that was used to add values.
*
- * NOTE: don't use this kind of hash when their is a possibility to remotely
- * request and push data in it. This hash is subject to denial of service.
+ * @warning Don't use this kind of hash when there is a possibility to
+ * remotely request and push data in it. This hash is subject to denial
+ * of service.
*/
EAPI Eina_Hash *eina_hash_string_superfast_new(Eina_Free_Cb data_free_cb);
@@ -436,15 +435,14 @@ EAPI Eina_Hash *eina_hash_string_superfast_new(Eina_Free_Cb data_free_cb);
* @param data_free_cb The function called on each value when the hash table
* is freed, or when an item is deleted from it. @c NULL can be passed as
* callback.
- * @return The new hash table.
+ * @return The new hash table, or @c NULL on failure.
*
* This function creates a new hash table using the superfast algorithm
* for table management and strcmp() to compare the keys, but with a
* smaller bucket size (compared to eina_hash_string_superfast_new())
* which will minimize the memory used by the returned hash
* table. Values can then be looked up with pointers other than the
- * original key pointer that was used to add values. On failure, this
- * function returns @c NULL.
+ * original key pointer that was used to add values.
*/
EAPI Eina_Hash *eina_hash_string_small_new(Eina_Free_Cb data_free_cb);
@@ -454,7 +452,7 @@ EAPI Eina_Hash *eina_hash_string_small_new(Eina_Free_Cb data_free_cb);
* @param data_free_cb The function called on each value when the hash table
* is freed, or when an item is deleted from it. @c NULL can be passed as
* callback.
- * @return The new hash table.
+ * @return The new hash table, or @c NULL on failure.
*
* This function creates a new hash table where keys are 32bit integers.
* When adding or looking up in the hash table, pointers to 32bit integers
@@ -463,7 +461,6 @@ EAPI Eina_Hash *eina_hash_string_small_new(Eina_Free_Cb data_free_cb);
* be looked up with pointers other than the original key pointer that was
* used to add values. This method is not suitable to match string keys as
* it would only match the first character.
- * On failure, this function returns @c NULL.
*/
EAPI Eina_Hash *eina_hash_int32_new(Eina_Free_Cb data_free_cb);
@@ -473,7 +470,7 @@ EAPI Eina_Hash *eina_hash_int32_new(Eina_Free_Cb data_free_cb);
* @param data_free_cb The function called on each value when the hash table
* is freed, or when an item is deleted from it. @c NULL can be passed as
* callback.
- * @return The new hash table.
+ * @return The new hash table, or @c NULL on failure.
*
* This function creates a new hash table where keys are 64bit integers.
* When adding or looking up in the hash table, pointers to 64bit integers
@@ -481,7 +478,6 @@ EAPI Eina_Hash *eina_hash_int32_new(Eina_Free_Cb data_free_cb);
* be looked up with pointers other than the original key pointer that was
* used to add values. This method is not suitable to match string keys as
* it would only match the first character.
- * On failure, this function returns @c NULL.
*/
EAPI Eina_Hash *eina_hash_int64_new(Eina_Free_Cb data_free_cb);
@@ -491,14 +487,14 @@ EAPI Eina_Hash *eina_hash_int64_new(Eina_Free_Cb data_free_cb);
* @param data_free_cb The function called on each value when the hash table
* is freed, or when an item is deleted from it. @c NULL can be passed as
* callback.
- * @return The new hash table.
+ * @return The new hash table, or @c NULL on failure.
*
* This function creates a new hash table using the int64/int32 algorithm for
* table management and dereferenced pointers to compare the
* keys. Values can then be looked up with pointers other than the
* original key pointer that was used to add values. This method may
- * appear to be able to match string keys, actually it only matches
- * the first character. On failure, this function returns @c NULL.
+ * appear to be able to match string keys, but actually it only matches
+ * the first character.
*
* @code
* // For a hash that will have only one pointer to each structure
@@ -517,12 +513,11 @@ EAPI Eina_Hash *eina_hash_pointer_new(Eina_Free_Cb data_free_cb);
* @param data_free_cb The function called on each value when the hash table
* is freed, or when an item is deleted from it. @c NULL can be passed as
* callback.
- * @return The new hash table.
+ * @return The new hash table, or @c NULL on failure.
*
* This function creates a new hash table optimized for stringshared
* values. Values CANNOT be looked up with pointers not
- * equal to the original key pointer that was used to add a value. On failure,
- * this function returns @c NULL.
+ * equal to the original key pointer that was used to add a value.
*
* Excerpt of code that will NOT work with this type of hash:
*
@@ -542,21 +537,23 @@ EAPI Eina_Hash *eina_hash_stringshared_new(Eina_Free_Cb data_free_cb);
*
* @param hash The given hash table. Cannot be @c NULL.
* @param key A unique key. Cannot be @c NULL.
- * @param data Data to associate with the string given by @p key. Cannot be @c
+ * @param data The data to associate with the string given by @p key. Cannot be @c
* NULL.
* @return #EINA_FALSE if an error occurred, #EINA_TRUE otherwise.
*
- * This function adds @p key to @p hash. @p key is
- * expected to be unique within the hash table. Key uniqueness varies
- * depending on the type of @p hash: a stringshared @ref Eina_Hash
- * need to have unique pointers (which implies unique strings).
- * All other string hash types require the strings
- * themselves to be unique. Pointer, int32 and int64 hashes need to have these
- * values as unique. Failure to use sufficient uniqueness will
+ * This function adds @p key to @p hash. @p key must be unique within
+ * the hash table so that @ref eina_hash_find() and @ref eina_hash_del()
+ * operate on the correct data item.
+ *
+ * Key uniqueness varies depending on the type of @p hash: a
+ * stringshared @ref Eina_Hash needs unique pointers (which implies
+ * unique strings). All other string hash types require that the
+ * strings themselves are unique. Pointer, int32 and int64 hashes need
+ * to have unique values. Failure to use sufficient uniqueness will
* result in unexpected results when inserting data pointers accessed
- * with eina_hash_find(), and removed with eina_hash_del(). Key
- * strings are case sensitive. This function returns #EINA_FALSE if an error
- * occurred, #EINA_TRUE otherwise.
+ * with @ref eina_hash_find(), and removed with @ref eina_hash_del().
+ *
+ * Key strings are case sensitive.
*/
EAPI Eina_Bool eina_hash_add(Eina_Hash *hash,
const void *key,
@@ -567,23 +564,25 @@ EAPI Eina_Bool eina_hash_add(Eina_Hash *hash,
*
* @param hash The given hash table. Cannot be @c NULL.
* @param key A unique key. Cannot be @c NULL.
- * @param data Data to associate with the string given by @p key. Cannot be @c
- * NULL
+ * @param data The data to associate with the string given by @p
+ * key. Cannot be @c NULL
* @return #EINA_FALSE if an error occurred, #EINA_TRUE otherwise.
*
- * This function adds @p key to @p hash. @p key is
- * expected to be unique within the hash table. Key uniqueness varies
- * depending on the type of @p hash: a stringshared @ref Eina_Hash
- * need have unique pointers (which implies unique strings).
- * All other string hash types require the strings
- * themselves to be unique. Pointer, int32 and int64 hashes need to have these
- * values as unique. Failure to use sufficient uniqueness will
+ * This function adds @p key to @p hash. @p key must be unique within
+ * the hash table so that @ref eina_hash_find() and @ref eina_hash_del()
+ * operate on the correct data item.
+ *
+ * Key uniqueness varies depending on the type of @p hash: a
+ * stringshared @ref Eina_Hash needs unique pointers (which implies
+ * unique strings). All other string hash types require that the
+ * strings themselves are unique. Pointer, int32 and int64 hashes need
+ * to have unique values. Failure to use sufficient uniqueness will
* result in unexpected results when inserting data pointers accessed
- * with eina_hash_find(), and removed with eina_hash_del(). This
- * function does not make a copy of @p key, so it must be a string
- * constant or stored elsewhere ( in the object being added). Key
- * strings are case sensitive. This function returns #EINA_FALSE if an error
- * occurred, #EINA_TRUE otherwise.
+ * with @ref eina_hash_find(), and removed with @ref eina_hash_del().
+ *
+ * Unlike @ref eina_hash_add(), this function does not make a copy of
+ * @p key, so it must be a string constant or stored elsewhere (such as
+ * in the object being added). Key strings are case sensitive.
*/
EAPI Eina_Bool eina_hash_direct_add(Eina_Hash *hash,
const void *key,
@@ -604,13 +603,11 @@ EAPI Eina_Bool eina_hash_direct_add(Eina_Hash *hash,
* deleted. If @p hash is @c NULL, the function returns immediately #EINA_FALSE.
* If @p key is @c NULL, then @p data is used to find the a
* match to remove, otherwise @p key is used and @p data is not
- * required and can be @c NULL. This function returns #EINA_FALSE if
- * an error occurred, #EINA_TRUE otherwise.
+ * required and can be @c NULL.
*
- * @note if you know you already have the key, use
- * eina_hash_del_by_key() or eina_hash_del_by_key_hash(). If you
- * know you don't have the key, use eina_hash_del_by_data()
- * directly.
+ * @note If you already have the key, use eina_hash_del_by_key() or
+ * eina_hash_del_by_key_hash(). If you don't have the key, use
+ * eina_hash_del_by_data() directly.
*/
EAPI Eina_Bool eina_hash_del(Eina_Hash *hash,
const void *key,
@@ -621,63 +618,59 @@ EAPI Eina_Bool eina_hash_del(Eina_Hash *hash,
*
* @param hash The given hash table.
* @param key The key of the entry to find.
- * @return The data pointer for the stored entry on success, @c NULL
+ * @return The data pointer for the stored entry on success, or @c NULL
* otherwise.
*
- * This function retrieves the entry associated to @p key in
- * @p hash. If @p hash is @c NULL, this function returns immediately
- * @c NULL. This function returns the data pointer on success, @c NULL
- * otherwise.
+ * This function retrieves the entry associated with @p key in
+ * @p hash. If @p hash is @c NULL, this function returns @c NULL.
*/
EAPI void *eina_hash_find(const Eina_Hash *hash,
const void *key) EINA_ARG_NONNULL(2);
/**
- * @brief Modifies the entry pointer at the specified key and return the old
- * entry.
+ * @brief Modifies the entry pointer at the specified key and returns
+ * the previous entry.
* @param hash The given hash table.
* @param key The key of the entry to modify.
- * @param data The data to replace the old entry.
- * @return The data pointer for the old stored entry on success, or
- * @c NULL otherwise.
+ * @param data The new data.
+ * @return The data pointer for the previously stored entry on success,
+ * or @c NULL otherwise.
*
* This function modifies the data of @p key with @p data in @p
- * hash. If no entry is found, nothing is added to @p hash. On success
- * this function returns the old entry, otherwise it returns @c NULL.
+ * hash. If no entry is found, nothing is added to @p hash.
*/
EAPI void *eina_hash_modify(Eina_Hash *hash,
const void *key,
const void *data) EINA_ARG_NONNULL(1, 2, 3);
/**
- * @brief Modifies the entry pointer at the specified key and return the
- * old entry or add the entry if not found.
+ * @brief Modifies the entry pointer at the specified key and returns the
+ * previous entry or adds the entry if not found.
*
* @param hash The given hash table.
* @param key The key of the entry to modify.
- * @param data The data to replace the old entry
- * @return The data pointer for the old stored entry, or @c NULL
+ * @param data The data to replace the previous entry.
+ * @return The data pointer for the previous stored entry, or @c NULL
* otherwise.
*
- * This function modifies the data of @p key with @p data in @p
+ * This function modifies the value of @p key to @p data in @p
* hash. If no entry is found, @p data is added to @p hash with the
- * key @p key. On success this function returns the old entry,
- * otherwise it returns @c NULL.
+ * key @p key.
*/
EAPI void *eina_hash_set(Eina_Hash *hash,
const void *key,
const void *data) EINA_ARG_NONNULL(1, 2);
/**
- * @brief Changes the key associated with a data without triggering the
+ * @brief Changes the key of an entry in a hash without triggering the
* free callback.
*
* @param hash The given hash table.
- * @param old_key The current key associated with the data
- * @param new_key The new key to associate data with
+ * @param old_key The current key associated with the data.
+ * @param new_key The new key to associate data with.
* @return #EINA_FALSE in any case but success, #EINA_TRUE on success.
*
- * This function allows for the move of data from one key to another,
+ * This function moves data from one key to another,
* but does not call the Eina_Free_Cb associated with the hash table
* when destroying the old key.
*/
@@ -686,18 +679,19 @@ EAPI Eina_Bool eina_hash_move(Eina_Hash *hash,
const void *new_key) EINA_ARG_NONNULL(1, 2, 3);
/**
- * @brief Frees the given hash table resources.
+ * @brief Frees the given hash table's resources.
*
* @param hash The hash table to be freed.
*
- * This function frees up all the memory allocated to storing @p hash,
- * and calls the free callback if it has been passed to the hash table
- * at creation time. If no free callback has been passed, any entries
- * in the table that the program has no more pointers for elsewhere
- * may now be lost, so this should only be called if the program has
- * already freed any allocated data in the hash table or has the
- * pointers for data in the table stored elsewhere as well. If @p hash
- * is @c NULL, the function returns immediately.
+ * This function frees memory allocated for the @p hash and to its
+ * internal buckets.
+ *
+ * If @p data_free_cb was specified at creation time in
+ * @ref eina_hash_new, it will be called for each element as it gets
+ * freed. If the callback was not specified, then any data in these
+ * elements may now be lost, if not stored or freed elsewhere.
+ *
+ * If @p hash is @c NULL, the function returns immediately.
*
* Example:
* @code
@@ -714,12 +708,14 @@ EAPI void eina_hash_free(Eina_Hash *hash) EINA_ARG_NONNULL(1);
*
* @param hash The hash table whose buckets have to be freed.
*
- * This function frees up all the memory allocated to storing the
- * buckets of @p hash, and calls the free callback on all hash table
- * buckets if it has been passed to the hash table at creation time,
- * then frees the buckets. If no free callback has been passed, no
- * buckets value will be freed. If @p hash is @c NULL, the function
- * returns immediately.
+ * This function frees memory allocated to internal buckets for @p hash.
+ *
+ * If @p data_free_cb was specified at creation time in
+ * @ref eina_hash_new(), it will be called for each element as it gets
+ * freed. If the callback was not specified, then any data in these
+ * elements may now be lost, if not stored or freed elsewhere.
+ *
+ * If @p hash is @c NULL, the function returns immediately.
*/
EAPI void eina_hash_free_buckets(Eina_Hash *hash) EINA_ARG_NONNULL(1);
@@ -727,34 +723,29 @@ EAPI void eina_hash_free_buckets(Eina_Hash *hash) EINA_ARG_NONNULL(1);
* @brief Returns the number of entries in the given hash table.
*
* @param hash The given hash table.
- * @return The number of entries in the hash table.
- *
- * This function returns the number of entries in @p hash, or 0 on
- * error. If @p hash is @c NULL, @c 0 is returned.
+ * @return The number of entries in the hash table, or @c 0 on error or
+ * if @p hash is @c NULL.
*/
EAPI int eina_hash_population(const Eina_Hash *hash) EINA_ARG_NONNULL(1);
/**
- * @brief Adds an entry to the given hash table.
+ * @brief Adds an entry to the given hash table by its key hash.
*
* @param hash The given hash table. Cannot be @c NULL.
* @param key A unique key. Cannot be @c NULL.
- * @param key_length The length of the key.
- * @param key_hash The hash that will always match key.
+ * @param key_length The length of @p key (including terminating '\\0').
+ * @param key_hash The hash of @p key.
* @param data The data to associate with the string given by the key. Cannot be
* @c NULL.
* @return #EINA_FALSE if an error occurred, #EINA_TRUE otherwise.
*
- * This function adds @p key to @p hash. @p hash, @p key and @p data
- * cannot be @c NULL, in that case #EINA_FALSE is returned. @p key is
- * expected to be a unique within the hash table. Otherwise,
- * one cannot be sure which inserted data pointer will be accessed
- * with @ref eina_hash_find, and removed with @ref eina_hash_del. Do
- * not forget to count '\\0' for string when setting the value of
- * @p key_length. @p key_hash is expected to always match
- * @p key. Otherwise, one cannot be sure to find it again with @ref
- * eina_hash_find_by_hash. Key strings are case sensitive. This function
- * returns #EINA_FALSE if an error occurred, #EINA_TRUE otherwise.
+ * This function adds @p key to @p hash.
+ *
+ * @p key must be unique within the hash table so that
+ * @ref eina_hash_find() and @ref eina_hash_del() operate on the correct
+ * data item. @p key_hash must match @p key so that the correct item can
+ * be found by @ref eina_hash_find_by_hash(). Key strings are case
+ * sensitive.
*
* @see eina_hash_add()
*/
@@ -765,30 +756,27 @@ EAPI Eina_Bool eina_hash_add_by_hash(Eina_Hash *hash,
const void *data) EINA_ARG_NONNULL(1, 2, 5);
/**
- * @brief Adds an entry to the given hash table and do not duplicate the string
- * key.
+ * @brief Adds an entry to a hash table by its key hash without duplicating the string key.
*
* @param hash The given hash table. Cannot be @c NULL.
* @param key A unique key. Cannot be @c NULL.
- * @param key_length Should be the length of @p key (don't forget to count
- * '\\0' for string).
- * @param key_hash The hash that will always match key.
- * @param data Data to associate with the string given by @p key. Cannot be @c
+ * @param key_length The length of @p key (including terminating '\\0').
+ * @param key_hash The hash of @p key.
+ * @param data The data to associate with the string given by @p key. Cannot be @c
* NULL.
* @return #EINA_FALSE if an error occurred, #EINA_TRUE otherwise.
*
- * This function adds @p key to @p hash. @p hash, @p key and @p data
- * can be @c NULL, in that case #EINA_FALSE is returned. @p key is
- * expected to be unique within the hash table. Otherwise,
- * one cannot be sure which inserted data pointer will be accessed
- * with @ref eina_hash_find, and removed with @ref eina_hash_del. This
- * function does not make a copy of @p key so it must be a string
- * constant or stored elsewhere (in the object being added). Do
- * not forget to count '\\0' for string when setting the value of
- * @p key_length. @p key_hash is expected to always match
- * @p key. Otherwise, one cannot be sure to find it again with @ref
- * eina_hash_find_by_hash. Key strings are case sensitive. This function
- * returns #EINA_FALSE if an error occurred, #EINA_TRUE otherwise.
+ * This function adds @p key to @p hash.
+ *
+ * @p key must be unique within the hash table so that
+ * @ref eina_hash_find() and @ref eina_hash_del() operate on the correct
+ * data item. @p key_hash must match @p key so that the correct item can
+ * be found by @ref eina_hash_find_by_hash(). Key strings are case
+ * sensitive.
+ *
+ * Unlike @ref eina_hash_add_by_hash(), this function does not make a
+ * copy of @p key, so it must be a string constant or stored elsewhere
+ * (such as inside the object being added).
*
* @see eina_hash_direct_add()
*/
@@ -804,20 +792,18 @@ EAPI Eina_Bool eina_hash_direct_add_by_hash(Eina_Hash *hash,
*
* @param hash The given hash table. Cannot be @c NULL.
* @param key The key. Cannot be @c NULL.
- * @param key_length The length of the key.
+ * @param key_length The length of the key (including terminating '\\0').
* @param key_hash The hash that always matches the key.
* @return #EINA_FALSE if an error occurred, #EINA_TRUE otherwise.
*
* This function removes the entry identified by @p key and
* @p key_hash from @p hash. If a free function was given to the
* callback on creation, it will be called for the data being
- * deleted. Do not forget to count '\\0' for string when setting the
- * value of @p key_length. If @p hash or @p key are @c NULL, the
- * function returns immediately #EINA_FALSE. This function
- * returns #EINA_FALSE if an error occurred, #EINA_TRUE otherwise.
+ * deleted. If @p hash or @p key are @c NULL, the
+ * function returns #EINA_FALSE immediately.
*
- * @note If you don't have the key_hash, use eina_hash_del_by_key() instead.
- * @note If you don't have the key, use eina_hash_del_by_data() instead.
+ * @note If you don't have the key_hash, use eina_hash_del_by_key()
+ * instead. If you don't have the key, use eina_hash_del_by_data().
*/
EAPI Eina_Bool eina_hash_del_by_key_hash(Eina_Hash *hash,
const void *key,
@@ -828,53 +814,50 @@ EAPI Eina_Bool eina_hash_del_by_key_hash(Eina_Hash *hash,
* @brief Removes the entry identified by a key from the given hash table.
*
* This version will calculate key length and hash by using functions
- * provided to hash creation function.
+ * provided to the hash creation function.
*
* @param hash The given hash table. Cannot be @c NULL.
* @param key The key. Cannot be @c NULL.
* @return #EINA_FALSE if an error occurred, #EINA_TRUE otherwise.
*
* This function removes the entry identified by @p key from @p
- * hash. The key length and hash will be calculated automatically by
- * using function provided to hash creation function. If a free
+ * hash. The key length and hash will be calculated automatically via
+ * a function provided to the hash creation function. If a free
* function was given to the callback on creation, it will be called
* for the data being deleted. If @p hash or @p key are @c NULL, the
- * function returns immediately #EINA_FALSE. This function
- * returns #EINA_FALSE if an error occurred, #EINA_TRUE otherwise.
+ * function returns #EINA_FALSE immediately.
*
- * @note If you already have the key_hash, use eina_hash_del_by_key_hash()
- * instead.
- * @note If you don't have the key, use eina_hash_del_by_data() instead.
+ * @note If you already have the key_hash, use eina_hash_del_by_key_hash().
+ * If you don't have the key, use eina_hash_del_by_data() instead.
*/
EAPI Eina_Bool eina_hash_del_by_key(Eina_Hash *hash,
const void *key) EINA_ARG_NONNULL(1, 2);
/**
- * @brief Removes the entry identified by a data from the given hash table.
- *
- * This version is slow since there is no quick access to nodes based on data.
+ * @brief Removes an entry from a hash table identified by its data value.
*
* @param hash The given hash table. Cannot be @c NULL.
* @param data The data value to search and remove. Cannot be @c NULL.
- * @return #EINA_FALSE if an error occurred, #EINA_TRUE otherwise.
+ * @return #EINA_FALSE if an error occurred or if @p hash or @p data are
+ * @c NULL, #EINA_TRUE otherwise.
* thing goes fine.
*
* This function removes the entry identified by @p data from @p
* hash. If a free function was given to the callback on creation, it
- * will be called for the data being deleted. If @p hash or @p data
- * are @c NULL, the function returns immediately #EINA_FALSE. This
- * function returns #EINA_FALSE if an error occurred, #EINA_TRUE
- * otherwise.
+ * will be called for the data being deleted.
*
- * @note If you already have the key, use eina_hash_del_by_key() or
- * eina_hash_del_by_key_hash() instead.
+ * @note This version is slow since there is no quick access to nodes
+ * based on data.
+ *
+ * @note If you already have the key, use eina_hash_del_by_key()
+ * or eina_hash_del_by_key_hash() instead.
*/
EAPI Eina_Bool eina_hash_del_by_data(Eina_Hash *hash,
const void *data) EINA_ARG_NONNULL(1, 2);
/**
- * @brief Removes the entry identified by a key and a key hash or a
- * data from the given hash table.
+ * @brief Removes the entry identified by a key and a key hash, or a
+ * data value from the given hash table.
*
* If @p key is @c NULL, then @p data is used to find a match to
* remove.
@@ -886,20 +869,18 @@ EAPI Eina_Bool eina_hash_del_by_data(Eina_Hash *hash,
* @param data The data pointer to remove if the key is @c NULL.
* @return #EINA_FALSE if an error occurred, #EINA_TRUE otherwise.
*
- * This function removes the entry identified by @p key and
- * @p key_hash, or @p data, from @p hash. If a free function was given to
- * the callback on creation, it will be called for the data being
- * deleted. If @p hash is @c NULL, the function returns immediately #EINA_FALSE.
- * If @p key is @c NULL, then @p key_length and @p key_hash
- * are ignored and @p data is used to find a match to remove,
- * otherwise @p key and @p key_hash are used and @p data is not
- * required and can be @c NULL. Do not forget to count '\\0' for
- * string when setting the value of @p key_length. This function
- * returns #EINA_FALSE if an error occurred, #EINA_TRUE otherwise.
+ * This function removes the entry identified by @p key and @p key_hash,
+ * or @p data, from @p hash. If a free function was given to the
+ * callback on creation, it will be called for the data being
+ * deleted. If @p hash is @c NULL, the function returns #EINA_FALSE
+ * immediately. If @p key is @c NULL, then @p key_length and @p
+ * key_hash are ignored and @p data is used to find a match to remove,
+ * otherwise @p key and @p key_hash are used and @p data is not required
+ * and can be @c NULL. Do not forget to count '\\0' for string when
+ * setting the value of @p key_length.
*
- * @note If you know you already have the key, use eina_hash_del_by_key_hash(),
- * If you know you don't have the key, use eina_hash_del_by_data()
- * directly.
+ * @note If you already have the key, use eina_hash_del_by_key_hash().
+ * If you don't have the key, use eina_hash_del_by_data() directly.
*/
EAPI Eina_Bool eina_hash_del_by_hash(Eina_Hash *hash,
const void *key,
@@ -908,21 +889,19 @@ EAPI Eina_Bool eina_hash_del_by_hash(Eina_Hash *hash,
const void *data) EINA_ARG_NONNULL(1);
/**
- * @brief Retrieves a specific entry in the given hash table.
+ * @brief Retrieves a specific entry from the given hash table.
*
* @param hash The given hash table. Cannot be @c NULL.
* @param key The key of the entry to find.
* @param key_length The length of the key.
- * @param key_hash The hash that always match the key
- * @return The data pointer for the stored entry on success, @c NULL
- * otherwise.
+ * @param key_hash The hash that always matches the key
+ * @return The data pointer for the stored entry on success, or @c NULL
+ * if @p hash is @c NULL or if the data pointer could not be retrieved.
*
- * This function retrieves the entry associated to @p key of length
- * @p key_length in @p hash. @p key_hash is the hash that always match
+ * This function retrieves the entry associated with @p key of length
+ * @p key_length in @p hash. @p key_hash is the hash that always matches
* @p key. It is ignored if @p key is @c NULL. Do not forget to count
- * '\\0' for string when setting the value of @p key_length. If
- * @p hash is @c NULL, this function returns immediately @c NULL. This
- * function returns the data pointer on success, @c NULL otherwise.
+ * '\\0' for string when setting the value of @p key_length.
*/
EAPI void *eina_hash_find_by_hash(const Eina_Hash *hash,
const void *key,
@@ -931,18 +910,18 @@ EAPI void *eina_hash_find_by_hash(const Eina_Hash *hash,
/**
* @brief Modifies the entry pointer at the specified key and returns
- * the old entry.
+ * the previous entry.
*
* @param hash The given hash table.
* @param key The key of the entry to modify.
* @param key_length Should be the length of @p key (don't forget to count
* '\\0' for string).
- * @param key_hash The hash that always match the key. Ignored if @p key is
- * @c NULL.
- * @param data The data to replace the old entry, if it exists.
- * @return The data pointer for the old stored entry, or @c NULL if not
- * found. If an existing entry is not found, nothing is added to the
- * hash.
+ * @param key_hash The hash that always matches the key. Ignored if @p
+ * key is @c NULL.
+ * @param data The data to replace the current entry, if it exists.
+ * @return The data pointer for the previously stored entry, or @c NULL
+ * if not found. If an existing entry is not found, nothing is added to
+ * the hash.
*/
EAPI void *eina_hash_modify_by_hash(Eina_Hash *hash,
const void *key,
@@ -951,80 +930,68 @@ EAPI void *eina_hash_modify_by_hash(Eina_Hash *hash,
const void *data) EINA_ARG_NONNULL(1, 2, 5);
/**
- * @brief Returns a new iterator associated to hash keys.
+ * @brief Returns a new iterator associated with hash keys.
*
* @param hash The hash.
- * @return A new iterator.
+ * @return A new iterator, or @c NULL if memory could not be allocated.
*
- * This function returns a newly allocated iterator associated to @p
+ * This function returns a newly allocated iterator associated with @p
* hash. If @p hash is not populated, this function still returns a
* valid iterator that will always return false on
- * eina_iterator_next(), thus keeping API sane.
- *
- * If the memory can not be allocated, NULL is returned.
- * Otherwise, a valid iterator is returned.
+ * eina_iterator_next().
*
- * @warning if the hash structure changes then the iterator becomes
- * invalid! That is, if you add or remove items this iterator
- * behavior is undefined and your program may crash!
+ * @warning If the hash structure changes then the iterator becomes
+ * invalid; adding or removing items may lead to program crash.
*/
EAPI Eina_Iterator *eina_hash_iterator_key_new(const Eina_Hash *hash) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
/**
- * @brief Returns a new iterator associated to hash data.
+ * @brief Returns a new iterator associated with a hash.
*
* @param hash The hash.
- * @return A new iterator.
+ * @return A new iterator, or @c NULL if memory could not be allocated.
*
- * This function returns a newly allocated iterator associated to
+ * This function returns a newly allocated iterator associated with
* @p hash. If @p hash is not populated, this function still returns a
* valid iterator that will always return false on
- * eina_iterator_next(), thus keeping API sane.
+ * eina_iterator_next().
*
- * If the memory cannot be allocated, @c NULL is returned.
- * Otherwise, a valid iterator is returned.
- *
- * @warning if the hash structure changes then the iterator becomes
- * invalid. That is, if you add or remove items this iterator behavior
- * is undefined and your program may crash.
+ * @warning If the hash structure changes then the iterator becomes
+ * invalid; adding or removing items may lead to program crash.
*/
EAPI Eina_Iterator *eina_hash_iterator_data_new(const Eina_Hash *hash) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
/**
- * @brief Returned a new iterator associated to hash keys and data.
+ * @brief Returned a new iterator associated with hash keys and data.
*
* @param hash The hash.
- * @return A new iterator.
+ * @return A new iterator, or @c NULL if memory could not be allocated.
*
- * This function returns a newly allocated iterator associated to @p
+ * This function returns a newly allocated iterator associated with @p
* hash. If @p hash is not populated, this function still returns a
* valid iterator that will always return false on
- * eina_iterator_next(), thus keeping API sane.
- *
- * If the memory can not be allocated, @c NULL is returned.
- * Otherwise, a valid iterator is returned.
+ * eina_iterator_next().
*
- * @note Iterator data will provide values as Eina_Hash_Tuple that should not
- * be modified!
+ * @note Iterator data will provide values as Eina_Hash_Tuple that
+ * should not be modified!
*
- * @warning if the hash structure changes then the iterator becomes
- * invalid! That is, if you add or remove items this iterator
- * behavior is undefined and your program may crash!
+ * @warning If the hash structure changes then the iterator becomes
+ * invalid; adding or removing items may lead to program crash.
*/
EAPI Eina_Iterator *eina_hash_iterator_tuple_new(const Eina_Hash *hash) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
/**
* @brief Calls a function on every member stored in the hash table.
*
- * @param hash The hash table whose members will be walked
- * @param func The function to call on each parameter
- * @param fdata The data pointer to pass to the function being called
+ * @param hash The hash table whose members will be walked.
+ * @param func The function to call on each parameter.
+ * @param fdata The data pointer to pass to the function being called.
*
- * This function goes through every entry in the hash table @p hash and calls
- * the function @p func on each member. The function should @b not modify the
- * hash table contents if it returns @c 1. @b If the hash table contents are
- * modified by this function or the function wishes to stop processing it must
- * return @c 0, otherwise return @c 1 to keep processing.
+ * This function iterates over the hash table @p hash, calling the
+ * function @p func on each member. If @p func modifies the contents
+ * of the hash table, or wishes to stop processing it should return
+ * #EINA_FALSE. If @p func returns #EINA_TRUE the foreach loop will
+ * keep processing.
*
* Example:
* @code
@@ -1035,7 +1002,7 @@ EAPI Eina_Iterator *eina_hash_iterator_tuple_new(const Eina_Hash *hash) EINA_MAL
* {
* printf("Func data: %s, Hash entry: %s / %p\n",
* fdata, (const char *)key, data);
- * return 1;
+ * return EINA_TRUE;
* }
*
* int main(int argc, char **argv)
@@ -1059,9 +1026,9 @@ EAPI void eina_hash_foreach(const Eina_Hash *hash,
* This function is identical to the sequence of calling
* eina_hash_find(), eina_list_append(), eina_hash_set(),
* but with one fewer required hash lookup.
- * @param hash The hash table
- * @param key The key associated with the data
- * @param data The data to append to the list
+ * @param hash The hash table.
+ * @param key The key associated with the data.
+ * @param data The data to append to the list.
* @since 1.10
*/
EAPI void eina_hash_list_append(Eina_Hash *hash, const void *key, const void *data) EINA_ARG_NONNULL(1, 2, 3);
@@ -1071,9 +1038,9 @@ EAPI void eina_hash_list_append(Eina_Hash *hash, const void *key, const void *da
* This function is identical to the sequence of calling
* eina_hash_find(), eina_list_prepend(), eina_hash_set(),
* but with one fewer required hash lookup.
- * @param hash The hash table
- * @param key The key associated with the data
- * @param data The data to prepend to the list
+ * @param hash The hash table.
+ * @param key The key associated with the data.
+ * @param data The data to prepend to the list.
* @since 1.10
*/
EAPI void eina_hash_list_prepend(Eina_Hash *hash, const void *key, const void *data) EINA_ARG_NONNULL(1, 2, 3);
@@ -1083,9 +1050,9 @@ EAPI void eina_hash_list_prepend(Eina_Hash *hash, const void *key, const void *d
* This function is identical to the sequence of calling
* eina_hash_find(), eina_list_remove(), eina_hash_set(),
* but with one fewer required hash lookup.
- * @param hash The hash table
- * @param key The key associated with the data
- * @param data The data to remove from the list
+ * @param hash The hash table.
+ * @param key The key associated with the data.
+ * @param data The data to remove from the list.
* @since 1.10
*/
EAPI void eina_hash_list_remove(Eina_Hash *hash, const void *key, const void *data) EINA_ARG_NONNULL(1, 2, 3);
@@ -1094,9 +1061,9 @@ EAPI void eina_hash_list_remove(Eina_Hash *hash, const void *key, const void *da
* @brief
* Paul Hsieh (http://www.azillionmonkeys.com/qed/hash.html) hash function used by WebCore (http://webkit.org/blog/8/hashtables-part-2/)
*
- * @param key The key to hash
- * @param len The length of the key
- * @return The hash value
+ * @param key The key to hash.
+ * @param len The length of the key.
+ * @return The hash value.
*/
EAPI int eina_hash_superfast(const char *key,
int len) EINA_ARG_NONNULL(1);
@@ -1105,9 +1072,9 @@ EAPI int eina_hash_superfast(const char *key,
* @brief
* Hash function first reported by Dan Bernstein many years ago in comp.lang.c
*
- * @param key The key to hash
- * @param len The length of the key
- * @return The hash value
+ * @param key The key to hash.
+ * @param len The length of the key.
+ * @return The hash value.
*/
static inline int eina_hash_djb2(const char *key,
int len) EINA_ARG_NONNULL(1);
@@ -1116,9 +1083,9 @@ static inline int eina_hash_djb2(const char *key,
* @brief
* Hash function first reported by Dan Bernstein many years ago in comp.lang.c
*
- * @param key The key to hash
- * @param plen The length of the key
- * @return The hash value
+ * @param key The key to hash.
+ * @param plen The length of the key.
+ * @return The hash value.
*/
static inline int eina_hash_djb2_len(const char *key,
int *plen) EINA_ARG_NONNULL(1, 2);
@@ -1127,9 +1094,9 @@ static inline int eina_hash_djb2_len(const char *key,
* @brief
* Hash function from http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
*
- * @param pkey The key to hash
- * @param len The length of the key
- * @return The hash value
+ * @param pkey The key to hash.
+ * @param len The length of the key.
+ * @return The hash value.
*/
static inline int eina_hash_int32(const unsigned int *pkey,
int len) EINA_ARG_NONNULL(1);
@@ -1138,9 +1105,9 @@ static inline int eina_hash_int32(const unsigned int *pkey,
* @brief
* Hash function from http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
*
- * @param pkey The key to hash
- * @param len The length of the key
- * @return The hash value
+ * @param pkey The key to hash.
+ * @param len The length of the key.
+ * @return The hash value.
*/
static inline int eina_hash_int64(const unsigned long long int *pkey,
int len) EINA_ARG_NONNULL(1);
@@ -1149,9 +1116,9 @@ static inline int eina_hash_int64(const unsigned long long int *pkey,
* @brief
* Hash function from http://sites.google.com/site/murmurhash/
*
- * @param key The key to hash
- * @param len The length of the key
- * @return The hash value
+ * @param key The key to hash.
+ * @param len The length of the key.
+ * @return The hash value.
*/
static inline int eina_hash_murmur3(const char *key,
int len) EINA_ARG_NONNULL(1);
@@ -1160,9 +1127,9 @@ static inline int eina_hash_murmur3(const char *key,
* @brief
* Hash function using crc-32 algorithm and and 0xEDB88320 polynomial
*
- * @param key The key to hash
- * @param len The length of the key
- * @return The hash value
+ * @param key The key to hash.
+ * @param len The length of the key.
+ * @return The hash value.
*/
static inline int eina_hash_crc(const char *key,
int len) EINA_ARG_NONNULL(1);
diff --git a/src/lib/eina/eina_inarray.h b/src/lib/eina/eina_inarray.h
index 2ac314fb1d..306d8498ae 100644
--- a/src/lib/eina/eina_inarray.h
+++ b/src/lib/eina/eina_inarray.h
@@ -401,7 +401,7 @@ EAPI int eina_inarray_remove(Eina_Inarray *array,
* @brief Removes the last member of the array.
*
* @param[in] array The array object
- * @return The data poped out of the array
+ * @return The data popped out of the array
*
* @note The data could be considered valid only until any other operation touched the Inarray.
*
diff --git a/src/lib/eina/eina_inline_lock_posix.x b/src/lib/eina/eina_inline_lock_posix.x
index 6f15631558..911b5c1f3b 100644
--- a/src/lib/eina/eina_inline_lock_posix.x
+++ b/src/lib/eina/eina_inline_lock_posix.x
@@ -108,6 +108,7 @@ struct _Eina_Lock
Eina_Lock_Bt_Func lock_bt[EINA_LOCK_DEBUG_BT_NUM]; /**< The function that will produce a backtrace on the thread that has the lock */
int lock_bt_num; /**< Number of addresses in the backtrace */
Eina_Bool locked : 1; /**< Indicates locked or not locked */
+ Eina_Bool recursive : 1; /**< Indicates recursive lock */
#endif
};
@@ -158,23 +159,46 @@ EAPI Eina_Lock_Result _eina_spinlock_macos_release(Eina_Spinlock *spinlock);
static inline Eina_Bool
eina_lock_new(Eina_Lock *mutex)
{
- return _eina_lock_new(mutex, EINA_FALSE);
+ Eina_Bool ret = _eina_lock_new(mutex, EINA_FALSE);
+#ifdef EINA_HAVE_DEBUG_THREADS
+ mutex->recursive = EINA_FALSE;
+ mutex->lock_thread_id = 0;
+ mutex->lock_bt_num = 0;
+ mutex->locked = 0;
+#endif
+ return ret;
}
static inline Eina_Bool
eina_lock_recursive_new(Eina_Lock *mutex)
{
- return _eina_lock_new(mutex, EINA_TRUE);
+ Eina_Bool ret = _eina_lock_new(mutex, EINA_TRUE);
+#ifdef EINA_HAVE_DEBUG_THREADS
+ mutex->recursive = EINA_TRUE;
+ mutex->lock_thread_id = 0;
+ mutex->lock_bt_num = 0;
+ mutex->locked = 0;
+#endif
+ return ret;
}
static inline void
eina_lock_free(Eina_Lock *mutex)
{
+#ifdef EINA_HAVE_DEBUG_THREADS
+ if (mutex->locked)
+ {
+ pthread_mutex_lock(&_eina_tracking_lock);
+ _eina_tracking = eina_inlist_remove(_eina_tracking,
+ EINA_INLIST_GET(mutex));
+ pthread_mutex_unlock(&_eina_tracking_lock);
+ }
+#endif
_eina_lock_free(mutex);
}
static inline Eina_Lock_Result
-eina_lock_take(Eina_Lock *mutex)
+eina_lock_take_try(Eina_Lock *mutex)
{
Eina_Lock_Result ret = EINA_LOCK_FAIL;
int ok;
@@ -182,15 +206,58 @@ eina_lock_take(Eina_Lock *mutex)
#ifdef EINA_HAVE_ON_OFF_THREADS
if (!_eina_threads_activated)
{
+ return EINA_LOCK_SUCCEED;
+ }
+#endif
+
+ ok = pthread_mutex_trylock(&(mutex->mutex));
+ if (ok == 0) ret = EINA_LOCK_SUCCEED;
+ else if (ok == EDEADLK)
+ {
+ eina_lock_debug(mutex);
+ ret = EINA_LOCK_DEADLOCK;
+ }
+ else if (ok != EBUSY) EINA_LOCK_ABORT_DEBUG(ok, trylock, mutex);
#ifdef EINA_HAVE_DEBUG_THREADS
- assert(pthread_equal(_eina_main_loop, pthread_self()));
+ if (ret == EINA_LOCK_SUCCEED)
+ {
+ /* recursive locks can't make use of any of this */
+ if (mutex->recursive) return ret;
+ mutex->locked = 1;
+ mutex->lock_thread_id = pthread_self();
+ /* backtrace() can somehow generate EINVAL even though this is not documented anywhere? */
+ int err = errno;
+ mutex->lock_bt_num = backtrace((void **)(mutex->lock_bt), EINA_LOCK_DEBUG_BT_NUM);
+ errno = err;
+
+ pthread_mutex_lock(&_eina_tracking_lock);
+ _eina_tracking = eina_inlist_append(_eina_tracking,
+ EINA_INLIST_GET(mutex));
+ pthread_mutex_unlock(&_eina_tracking_lock);
+ }
#endif
+ return ret;
+}
+
+static inline Eina_Lock_Result
+eina_lock_take(Eina_Lock *mutex)
+{
+ Eina_Lock_Result ret = EINA_LOCK_FAIL;
+ int ok;
+
+#ifdef EINA_HAVE_ON_OFF_THREADS
+ if (!_eina_threads_activated)
+ {
return EINA_LOCK_SUCCEED;
}
#endif
#ifdef EINA_HAVE_DEBUG_THREADS
- if (_eina_threads_debug)
+ if (eina_lock_take_try(mutex) == EINA_LOCK_SUCCEED) return EINA_LOCK_SUCCEED;
+#endif
+
+#ifdef EINA_HAVE_DEBUG_THREADS
+ if (_eina_threads_debug >= 100)
{
struct timeval t0, t1;
int dt;
@@ -204,7 +271,6 @@ eina_lock_take(Eina_Lock *mutex)
dt += (t1.tv_usec - t0.tv_usec);
else
dt -= t0.tv_usec - t1.tv_usec;
- dt /= 1000;
if (dt > _eina_threads_debug) abort();
}
@@ -228,9 +294,14 @@ eina_lock_take(Eina_Lock *mutex)
else EINA_LOCK_ABORT_DEBUG(ok, lock, mutex);
#ifdef EINA_HAVE_DEBUG_THREADS
+ /* recursive locks can't make use of any of this */
+ if (mutex->recursive) return ret;
mutex->locked = 1;
mutex->lock_thread_id = pthread_self();
+ /* backtrace() can somehow generate EINVAL even though this is not documented anywhere? */
+ int err = errno;
mutex->lock_bt_num = backtrace((void **)(mutex->lock_bt), EINA_LOCK_DEBUG_BT_NUM);
+ errno = err;
pthread_mutex_lock(&_eina_tracking_lock);
_eina_tracking = eina_inlist_append(_eina_tracking,
@@ -242,7 +313,7 @@ eina_lock_take(Eina_Lock *mutex)
}
static inline Eina_Lock_Result
-eina_lock_take_try(Eina_Lock *mutex)
+eina_lock_release(Eina_Lock *mutex)
{
Eina_Lock_Result ret = EINA_LOCK_FAIL;
int ok;
@@ -250,69 +321,24 @@ eina_lock_take_try(Eina_Lock *mutex)
#ifdef EINA_HAVE_ON_OFF_THREADS
if (!_eina_threads_activated)
{
-#ifdef EINA_HAVE_DEBUG_THREADS
- assert(pthread_equal(_eina_main_loop, pthread_self()));
-#endif
return EINA_LOCK_SUCCEED;
}
#endif
#ifdef EINA_HAVE_DEBUG_THREADS
- if (!_eina_threads_activated)
- assert(pthread_equal(_eina_main_loop, pthread_self()));
-#endif
-
- ok = pthread_mutex_trylock(&(mutex->mutex));
- if (ok == 0) ret = EINA_LOCK_SUCCEED;
- else if (ok == EDEADLK)
- {
- eina_lock_debug(mutex);
- ret = EINA_LOCK_DEADLOCK;
- }
- else if (ok != EBUSY) EINA_LOCK_ABORT_DEBUG(ok, trylock, mutex);
-#ifdef EINA_HAVE_DEBUG_THREADS
- if (ret == EINA_LOCK_SUCCEED)
+/* recursive locks can't make use of any of this */
+ if (!mutex->recursive)
{
- mutex->locked = 1;
- mutex->lock_thread_id = pthread_self();
- mutex->lock_bt_num = backtrace((void **)(mutex->lock_bt), EINA_LOCK_DEBUG_BT_NUM);
-
+ mutex->locked = 0;
+ mutex->lock_thread_id = 0;
+ memset(mutex->lock_bt, 0, EINA_LOCK_DEBUG_BT_NUM * sizeof(Eina_Lock_Bt_Func));
+ mutex->lock_bt_num = 0;
pthread_mutex_lock(&_eina_tracking_lock);
- _eina_tracking = eina_inlist_append(_eina_tracking,
+ _eina_tracking = eina_inlist_remove(_eina_tracking,
EINA_INLIST_GET(mutex));
pthread_mutex_unlock(&_eina_tracking_lock);
}
#endif
- return ret;
-}
-
-static inline Eina_Lock_Result
-eina_lock_release(Eina_Lock *mutex)
-{
- Eina_Lock_Result ret = EINA_LOCK_FAIL;
- int ok;
-
-#ifdef EINA_HAVE_ON_OFF_THREADS
- if (!_eina_threads_activated)
- {
-#ifdef EINA_HAVE_DEBUG_THREADS
- assert(pthread_equal(_eina_main_loop, pthread_self()));
-#endif
- return EINA_LOCK_SUCCEED;
- }
-#endif
-
-#ifdef EINA_HAVE_DEBUG_THREADS
- pthread_mutex_lock(&_eina_tracking_lock);
- _eina_tracking = eina_inlist_remove(_eina_tracking,
- EINA_INLIST_GET(mutex));
- pthread_mutex_unlock(&_eina_tracking_lock);
-
- mutex->locked = 0;
- mutex->lock_thread_id = 0;
- memset(mutex->lock_bt, 0, EINA_LOCK_DEBUG_BT_NUM * sizeof(Eina_Lock_Bt_Func));
- mutex->lock_bt_num = 0;
-#endif
ok = pthread_mutex_unlock(&(mutex->mutex));
if (ok == 0) ret = EINA_LOCK_SUCCEED;
else if (ok == EPERM) ret = EINA_LOCK_FAIL;
@@ -481,9 +507,6 @@ eina_rwlock_take_read(Eina_RWLock *mutex)
#ifdef EINA_HAVE_ON_OFF_THREADS
if (!_eina_threads_activated)
{
-#ifdef EINA_HAVE_DEBUG_THREADS
- assert(pthread_equal(_eina_main_loop, pthread_self()));
-#endif
return EINA_LOCK_SUCCEED;
}
#endif
@@ -504,9 +527,6 @@ eina_rwlock_take_write(Eina_RWLock *mutex)
#ifdef EINA_HAVE_ON_OFF_THREADS
if (!_eina_threads_activated)
{
-#ifdef EINA_HAVE_DEBUG_THREADS
- assert(pthread_equal(_eina_main_loop, pthread_self()));
-#endif
return EINA_LOCK_SUCCEED;
}
#endif
@@ -527,9 +547,6 @@ eina_rwlock_release(Eina_RWLock *mutex)
#ifdef EINA_HAVE_ON_OFF_THREADS
if (!_eina_threads_activated)
{
-#ifdef EINA_HAVE_DEBUG_THREADS
- assert(pthread_equal(_eina_main_loop, pthread_self()));
-#endif
return EINA_LOCK_SUCCEED;
}
#endif
@@ -587,6 +604,7 @@ eina_barrier_wait(Eina_Barrier *barrier)
{
int ok = pthread_barrier_wait(&(barrier->barrier));
if (ok == 0) return EINA_TRUE;
+ else if (ok == PTHREAD_BARRIER_SERIAL_THREAD) return EINA_TRUE;
else EINA_LOCK_ABORT_DEBUG(ok, barrier_wait, barrier);
return EINA_TRUE;
}
@@ -624,11 +642,31 @@ eina_spinlock_free(Eina_Spinlock *spinlock)
}
static inline Eina_Lock_Result
+eina_spinlock_take_try(Eina_Spinlock *spinlock)
+{
+#if defined(EINA_HAVE_POSIX_SPINLOCK)
+ int t = pthread_spin_trylock(spinlock);
+ if (t == 0) return EINA_LOCK_SUCCEED;
+ else if (t == EBUSY) return EINA_LOCK_FAIL;
+ else EINA_LOCK_ABORT_DEBUG(t, spin_trylock, spinlock);
+ return EINA_LOCK_FAIL;
+#elif defined(EINA_HAVE_OSX_SPINLOCK)
+ return _eina_spinlock_macos_take_try(spinlock);
+#else
+ return eina_lock_take_try(spinlock);
+#endif
+}
+
+static inline Eina_Lock_Result
eina_spinlock_take(Eina_Spinlock *spinlock)
{
#if defined(EINA_HAVE_POSIX_SPINLOCK)
int t;
+#ifdef EINA_HAVE_DEBUG_THREADS
+ if (eina_spinlock_take_try(spinlock) == EINA_LOCK_SUCCEED) return EINA_LOCK_SUCCEED;
+#endif
+
for (;;)
{
t = pthread_spin_lock(spinlock);
@@ -645,22 +683,6 @@ eina_spinlock_take(Eina_Spinlock *spinlock)
}
static inline Eina_Lock_Result
-eina_spinlock_take_try(Eina_Spinlock *spinlock)
-{
-#if defined(EINA_HAVE_POSIX_SPINLOCK)
- int t = pthread_spin_trylock(spinlock);
- if (t == 0) return EINA_LOCK_SUCCEED;
- else if (t == EBUSY) return EINA_LOCK_FAIL;
- else EINA_LOCK_ABORT_DEBUG(t, spin_trylock, spinlock);
- return EINA_LOCK_FAIL;
-#elif defined(EINA_HAVE_OSX_SPINLOCK)
- return _eina_spinlock_macos_take_try(spinlock);
-#else
- return eina_lock_take_try(spinlock);
-#endif
-}
-
-static inline Eina_Lock_Result
eina_spinlock_release(Eina_Spinlock *spinlock)
{
#if defined(EINA_HAVE_POSIX_SPINLOCK)
diff --git a/src/lib/eina/eina_inline_value.x b/src/lib/eina/eina_inline_value.x
index 17f9cc4b5b..a1a63143bf 100644
--- a/src/lib/eina/eina_inline_value.x
+++ b/src/lib/eina/eina_inline_value.x
@@ -538,7 +538,11 @@ eina_value_pget(const Eina_Value *value, void *ptr)
static inline const Eina_Value_Type *
eina_value_type_get(const Eina_Value *value)
{
- EINA_VALUE_TYPE_CHECK_RETURN_VAL(value, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(value, NULL);
+ // Trigger warning if the type is NULL, but the value is != EINA_VALUE_EMTPY.
+ if (!value->type &&
+ value->value._guarantee)
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(value->type), NULL);
return value->type;
}
@@ -617,6 +621,9 @@ eina_value_array_vget(const Eina_Value *value, unsigned int position, va_list ar
if (!eina_value_pget(value, &desc))
return EINA_FALSE;
+ if (position >= eina_inarray_count(desc.array))
+ return EINA_FALSE;
+
mem = eina_inarray_nth(desc.array, position);
if (!mem)
return EINA_FALSE;
diff --git a/src/lib/eina/eina_inline_value_util.x b/src/lib/eina/eina_inline_value_util.x
index c2d293e1e1..f755b4bf1c 100644
--- a/src/lib/eina/eina_inline_value_util.x
+++ b/src/lib/eina/eina_inline_value_util.x
@@ -330,7 +330,7 @@ eina_value_bool_new(Eina_Bool b)
{
Eina_Value *v;
- v = eina_value_new(EINA_VALUE_TYPE_UCHAR);
+ v = eina_value_new(EINA_VALUE_TYPE_BOOL);
if (v) eina_value_set(v, b);
return v;
}
@@ -602,7 +602,7 @@ eina_value_bool_init(Eina_Bool b)
{
Eina_Value v = EINA_VALUE_EMPTY;
- if (eina_value_setup(&v, EINA_VALUE_TYPE_UCHAR))
+ if (eina_value_setup(&v, EINA_VALUE_TYPE_BOOL))
eina_value_set(&v, b);
return v;
}
@@ -900,7 +900,7 @@ eina_value_bool_get(const Eina_Value *v, Eina_Bool *b)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(b, EINA_FALSE);
*b = EINA_FALSE;
- if (v && v->type == EINA_VALUE_TYPE_UCHAR)
+ if (v && v->type == EINA_VALUE_TYPE_BOOL)
return eina_value_get(v, b);
return EINA_FALSE;
}
diff --git a/src/lib/eina/eina_internal.h b/src/lib/eina/eina_internal.h
index acf55fe347..9fea25b1f0 100644
--- a/src/lib/eina/eina_internal.h
+++ b/src/lib/eina/eina_internal.h
@@ -13,15 +13,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_EINA_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EINA_BUILD */
+# endif
# define EAPI_WEAK
#else
# ifdef __GNUC__
@@ -41,6 +41,27 @@
# endif
#endif
+#include "eina_prefix.h"
+
+typedef struct _Eina_Vpath_Interface_User Eina_Vpath_Interface_User;
+
+struct _Eina_Vpath_Interface_User
+{
+ const char *desktop;
+ const char *documents;
+ const char *downloads;
+ const char *music;
+ const char *pictures;
+ const char *pub;
+ const char *templates;
+ const char *videos;
+ const char *data;
+ const char *config;
+ const char *cache;
+ const char *run;
+ const char *tmp;
+};
+
/**
* @brief Cancels all pending promise/futures.
*
@@ -50,6 +71,34 @@
*/
EAPI void __eina_promise_cancel_all(void);
+EAPI void __eina_promise_cancel_data(void *data);
+
+/**
+ * Make the app specific paths accessible as virtual path
+ *
+ * This will create :
+ * - app.dir
+ * - app.bin
+ * - app.lib
+ * - app.data
+ * - app.locale
+ * - app.config
+ * - app.cache
+ * - app.local
+ *
+ * If you do NOT call this api the virtual paths for app.* will be unset
+ */
+EAPI void eina_vpath_interface_app_set(const char *app_name, Eina_Prefix *p);
+
+/**
+ * Create the desktop specific vpaths
+ *
+ * The virtual paths will be named usr.<field-name-of-struct>
+ *
+ * If you do NOT call this api the virtual paths for usr.* will be unset.
+ */
+EAPI void eina_vpath_interface_user_set(Eina_Vpath_Interface_User *user);
+
#undef EAPI
#define EAPI
diff --git a/src/lib/eina/eina_iterator.h b/src/lib/eina/eina_iterator.h
index 20bc2ecc23..d26b2cc9dc 100644
--- a/src/lib/eina/eina_iterator.h
+++ b/src/lib/eina/eina_iterator.h
@@ -356,7 +356,7 @@ EAPI Eina_Iterator* eina_iterator_filter_new(Eina_Iterator *original, Eina_Each_
* @warning unless explicitly stated in functions returning iterators,
* do not modify the iterated object while you walk it, in this
* example using lists, do not remove list nodes or you might
- * crash! This is not a limitiation of iterators themselves,
+ * crash! This is not a limitation of iterators themselves,
* rather in the iterators implementations to keep them as simple
* and fast as possible.
*/
diff --git a/src/lib/eina/eina_lalloc.h b/src/lib/eina/eina_lalloc.h
index 974e435d61..087cdaeffe 100644
--- a/src/lib/eina/eina_lalloc.h
+++ b/src/lib/eina/eina_lalloc.h
@@ -91,7 +91,7 @@ EAPI void eina_lalloc_free(Eina_Lalloc *a) EINA_ARG_NONNULL(1);
/**
* @brief Adds several elements to a lazy allocator.
*
- * @param a The lazy allocater to add items to.
+ * @param a The lazy allocator to add items to.
* @param num The number of elements to add.
*
* @return #EINA_TRUE on success, else #EINA_FALSE.
diff --git a/src/lib/eina/eina_list.h b/src/lib/eina/eina_list.h
index 155cd4e8da..985dfc1bc4 100644
--- a/src/lib/eina/eina_list.h
+++ b/src/lib/eina/eina_list.h
@@ -265,7 +265,7 @@
* any future references to the list.
*
* Most functions have two versions that have the same effect but operate on
- * different arguments, the @a plain functions operate over data(eg.:
+ * different arguments, the @a plain functions operate over data(e.g..:
* @ref eina_list_append_relative, @ref eina_list_remove,
* @ref eina_list_data_find), the @a list versions of these functions operate
* on @ref Eina_List nodes.
@@ -330,7 +330,7 @@ struct _Eina_List
/**
* @struct _Eina_List_Accounting
* Cache used to store the last element of a list and the number of
- * elements, for fast access. It is for private used and must not be
+ * elements, for fast access. It is for private use and must not be
* touched.
*/
struct _Eina_List_Accounting
@@ -346,7 +346,7 @@ struct _Eina_List_Accounting
*
* @param list The given list.
* @param data The data to append.
- * @return A list pointer.
+ * @return A list pointer, or @c NULL on error.
*
* This function appends @p data to @p list. If @p list is @c NULL, a
* new list is returned. On success, a new list pointer that should be
@@ -373,7 +373,7 @@ EAPI Eina_List *eina_list_append(Eina_List *list, const void *data) E
*
* @param list The given list.
* @param data The data to prepend.
- * @return A list pointer.
+ * @return A list pointer, or @c NULL on error.
*
* This function prepends @p data to @p list. If @p list is @c NULL, a
* new list is returned. On success, a new list pointer that should be
@@ -402,11 +402,11 @@ EAPI Eina_List *eina_list_prepend(Eina_List *list, const void *data)
* @param list The given linked list.
* @param data The data to insert.
* @param relative The data to insert after.
- * @return A list pointer.
+ * @return A list pointer, or @c NULL on error.
*
- * This function inserts @p data to @p list after @p relative. If
- * @p relative is not in the list, @p data is appended to the end of
- * the list. If @p list is @c NULL, a new list is returned. If there
+ * This function inserts @p data into @p list after @p relative. If
+ * @p relative is not in the list, @p data is appended to
+ * the list. If @p list is @c NULL, a new list is returned. If there
* are multiple instances of @p relative in the list, @p data is
* inserted after the first instance. On success, a new list pointer
* that should be used in place of the one given to this function is
@@ -435,9 +435,9 @@ EAPI Eina_List *eina_list_append_relative(Eina_List *list, const void
* @param list The given linked list.
* @param data The data to insert.
* @param relative The list node to insert after.
- * @return A list pointer.
+ * @return A list pointer, or @c NULL on error.
*
- * This function inserts @p data to @p list after the list node
+ * This function inserts @p data into @p list after the list node
* @p relative. If @p list or @p relative are @c NULL, @p data is just
* appended to @p list using eina_list_append(). If @p list is
* @c NULL, a new list is returned. If there are multiple instances
@@ -456,12 +456,12 @@ EAPI Eina_List *eina_list_append_relative_list(Eina_List *list, const
*
* @param list The given linked list.
* @param data The data to insert.
- * @param relative The data to insert before.
- * @return A list pointer.
+ * @param relative The member that data will be inserted before.
+ * @return A list pointer, or @c NULL on error.
*
* This function inserts @p data to @p list before @p relative. If
* @p relative is not in the list, @p data is prepended to the list
- * with eina_list_prepend(). If @p list is @c NULL, a new list is
+ * with eina_list_prepend(). If @p list is @c NULL, a new list is
* returned. If there are multiple instances of @p relative in the
* list, @p data is inserted before the first instance. On success, a
* new list pointer that should be used in place of the one given to
@@ -490,12 +490,12 @@ EAPI Eina_List *eina_list_prepend_relative(Eina_List *list, const voi
* @param list The given linked list.
* @param data The data to insert.
* @param relative The list node to insert before.
- * @return A list pointer.
+ * @return A list pointer, or @c NULL on error.
*
* This function inserts @p data to @p list before the list node
* @p relative. If @p list or @p relative are @c NULL, @p data is just
* prepended to @p list using eina_list_prepend(). If @p list is
- * @c NULL, a new list is returned. If there are multiple instances
+ * @c NULL, a new list is returned. If there are multiple instances
* of @p relative in the list, @p data is inserted before the first
* instance. On success, a new list pointer that should be used in
* place of the one given to this function is returned. Otherwise, the
@@ -511,14 +511,14 @@ EAPI Eina_List *eina_list_prepend_relative_list(Eina_List *list, cons
*
* @param list The given linked list, @b must be sorted.
* @param func The function called for the sort.
- * @param data The data to insert sorted.
- * @return A list pointer.
+ * @param data The data to be inserted in sorted order.
+ * @return A list pointer, or @c NULL on error.
*
* This function inserts values into a linked list assuming it was
* sorted and the result will be sorted. If @p list is @c NULL, a new
- * list is returned. On success, a new list pointer that should be
- * used in place of the one given to this function is
- * returned. Otherwise, the old pointer is returned.
+ * list is returned. On success, a new list pointer that should be used
+ * in place of the one given to this function is returned. Otherwise,
+ * the old pointer is returned.
*
* @note O(log2(n)) comparisons (calls to @p func) average/worst case
* performance as it uses eina_list_search_sorted_near_list() and thus
@@ -537,14 +537,13 @@ EAPI Eina_List *eina_list_sorted_insert(Eina_List *list, Eina_Compare
*
* @param list The given list.
* @param data The specified data.
- * @return A list pointer.
+ * @return A list pointer, or @c NULL on error.
*
- * This function removes the first instance of @p data from
- * @p list. If the specified data is not in the given list (this
- * includes the case where @p data is @c NULL), nothing is done and the
- * specified @p list returned. If @p list is @c NULL, @c NULL is returned,
- * otherwise a new list pointer that should be used in place of the one
- * passed to this function.
+ * This function removes the first instance of @p data from @p list. If
+ * @p data is not in the given list or is @c NULL, nothing is done and
+ * the specified @p list returned. If @p list is @c NULL, @c NULL is
+ * returned, otherwise a new list pointer that should be used in place
+ * of the one passed to this function is returned.
*
* @warning @p list must be a pointer to the first element of the list.
*/
@@ -556,17 +555,17 @@ EAPI Eina_List *eina_list_remove(Eina_List *list, const void *data) E
*
* @param list The given linked list.
* @param remove_list The list node which is to be removed.
- * @return A list pointer.
+ * @return A list pointer, or @c NULL on error.
*
* This function removes the list node @p remove_list from @p list and
* frees the list node structure @p remove_list. If @p list is
* @c NULL, this function returns @c NULL. If @p remove_list is
- * @c NULL, it returns @p list, otherwise, a new list pointer that
+ * @c NULL, it returns @p list; otherwise, a new list pointer that
* should be used in place of the one passed to this function.
*
- * The following code gives an example (notice we use EINA_LIST_FOREACH
- * instead of EINA_LIST_FOREACH_SAFE because we stop the loop after
- * removing the current node).
+ * The following code gives an example. (Notice we use
+ * EINA_LIST_FOREACH rather than EINA_LIST_FOREACH_SAFE because we stop
+ * the loop after removing the current node.)
*
* @code
* extern Eina_List *list;
@@ -592,14 +591,14 @@ EAPI Eina_List *eina_list_remove_list(Eina_List *list, Eina_List *rem
/**
* @brief Moves the specified data to the head of the list.
*
- * @param list The list handle to move the data.
+ * @param list The given linked list.
* @param move_list The list node to move.
- * @return A new list handle to replace the old one
+ * @return A new list handle to replace the old one, or @c NULL on error.
*
- * This function move @p move_list to the front of @p list. If list is
- * @c NULL, @c NULL is returned. If @p move_list is @c NULL,
- * @p list is returned. Otherwise, a new list pointer that should be
- * used in place of the one passed to this function.
+ * This function moves @p move_list to the front of @p list. If list is
+ * @c NULL, @c NULL is returned. If @p move_list is @c NULL, @p list is
+ * returned. Otherwise, a new list pointer that should be used in place
+ * of the one passed to this function is returned.
*
* Example:
* @code
@@ -626,14 +625,14 @@ EAPI Eina_List *eina_list_promote_list(Eina_List *list, Eina_List *mo
/**
* @brief Moves the specified data to the tail of the list.
*
- * @param list The list handle to move the data.
+ * @param list The given linked list.
* @param move_list The list node to move.
- * @return A new list handle to replace the old one
+ * @return A new list handle to replace the old one, or @c NULL on error.
*
- * This function move @p move_list to the back of @p list. If list is
- * @c NULL, @c NULL is returned. If @p move_list is @c NULL,
- * @p list is returned. Otherwise, a new list pointer that should be
- * used in place of the one passed to this function.
+ * This function move @p move_list to the end of @p list. If list is @c
+ * NULL, @c NULL is returned. If @p move_list is @c NULL, @p list is
+ * returned. Otherwise, a new list pointer that should be used in place
+ * of the one passed to this function is returned.
*
* Example:
* @code
@@ -658,11 +657,11 @@ EAPI Eina_List *eina_list_demote_list(Eina_List *list, Eina_List *mov
/**
- * @brief Finds a member of a list and return the member.
+ * @brief Finds a member of a list and returns it.
*
- * @param list The list to search for a data.
- * @param data The data pointer to find in the list.
- * @return The found member data pointer if found, @c NULL otherwise.
+ * @param list The linked list to search.
+ * @param data The data member to find in the list.
+ * @return The data member pointer if found, or @c NULL otherwise.
*
* This function searches in @p list from beginning to end for the
* first member whose data pointer is @p data. If it is found, @p data
@@ -683,14 +682,16 @@ EAPI Eina_List *eina_list_demote_list(Eina_List *list, Eina_List *mov
*/
EAPI void *eina_list_data_find(const Eina_List *list, const void *data) EINA_PURE EINA_ARG_NONNULL(2) EINA_WARN_UNUSED_RESULT;
+
/**
- * @brief Finds a member of a list and return the list node containing that member.
+ * @brief Finds a member of a list and returns it as a list node.
*
* @param list The list to search for data.
* @param data The data pointer to find in the list.
- * @return The found members list node on success, @c NULL otherwise.
+ * @return A list node containing the data member on success, @c NULL
+ * otherwise.
*
- * This function searches in @p list from beginning to end for the
+ * This function searches @p list from beginning to end for the
* first member whose data pointer is @p data. If it is found, the
* list node containing the specified member is returned, otherwise
* @c NULL is returned.
@@ -703,10 +704,10 @@ EAPI Eina_List *eina_list_data_find_list(const Eina_List *list, const
/**
* @brief Moves a data pointer from one list to another.
*
- * @param to The list to move the data to
- * @param from The list to move from
- * @param data The data to move
- * @return #EINA_TRUE on success, else #EINA_FALSE
+ * @param to The list to move the data to.
+ * @param from The list to move from.
+ * @param data The data member to move.
+ * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
*
* This function is a shortcut for doing the following:
* to = eina_list_append(to, data);
@@ -716,13 +717,14 @@ EAPI Eina_List *eina_list_data_find_list(const Eina_List *list, const
*/
EAPI Eina_Bool eina_list_move(Eina_List **to, Eina_List **from, void *data);
+
/**
* @brief Moves a list node from one list to another.
*
- * @param to The list to move the data to
- * @param from The list to move from
- * @param data The list node containing the data to move
- * @return #EINA_TRUE on success, else #EINA_FALSE
+ * @param to The list to move the data to.
+ * @param from The list to move from.
+ * @param data The list node containing the data to move.
+ * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
*
* This function is a shortcut for doing the following:
* to = eina_list_append(to, data->data);
@@ -736,17 +738,17 @@ EAPI Eina_Bool eina_list_move_list(Eina_List **to, Eina_List **from,
/**
* @brief Frees an entire list and all the nodes, ignoring the data contained.
- * @param list The list to free
- * @return A @c NULL pointer
+ * @param list The list to free.
+ * @return A @c NULL pointer.
*
* This function frees all the nodes of @p list. It does not free the
* data of the nodes. To free them, use #EINA_LIST_FREE.
*/
EAPI Eina_List *eina_list_free(Eina_List *list);
-
/**
- * @brief Gets the nth member's data pointer in a list.
+ * @brief Gets the nth member's data pointer in a list, or @c NULL on
+ * error.
*
* @param list The list to get the specified member number from.
* @param n The number of the element (0 being the first).
@@ -763,13 +765,13 @@ EAPI Eina_List *eina_list_free(Eina_List *list);
*/
EAPI void *eina_list_nth(const Eina_List *list, unsigned int n) EINA_PURE EINA_WARN_UNUSED_RESULT;
-
/**
* @brief Gets the nth member's list node in a list.
*
* @param list The list to get the specified member number from.
* @param n The number of the element (0 being the first).
- * @return The list node stored in the numbered element.
+ * @return The list node stored in the numbered element, or @c NULL on
+ * error.
*
* This function returns the list node of element number @p n, in
* @p list. The first element in the array is element number 0. If the
@@ -789,7 +791,8 @@ EAPI Eina_List *eina_list_nth_list(const Eina_List *list, unsigned in
* @brief Reverses all the elements in the list.
*
* @param list The list to reverse.
- * @return The list head after it has been reversed.
+ * @return The list head after it has been reversed, or @c NULL on
+ * error.
*
* This function reverses the order of all elements in @p list, so the
* last member is now first, and so on. If @p list is @c NULL, this
@@ -810,7 +813,7 @@ EAPI Eina_List *eina_list_reverse(Eina_List *list) EINA_WARN_UNUSED_R
* @brief Clones (copies) all the elements in the list in reverse order.
*
* @param list The list to reverse.
- * @return The new list that has been reversed.
+ * @return The new list that has been reversed, or @c NULL on error.
*
* This function reverses the order of all elements in @p list, so the
* last member is now first, and so on. If @p list is @c NULL, this
@@ -831,7 +834,7 @@ EAPI Eina_List *eina_list_reverse_clone(const Eina_List *list) EINA_W
* @brief Clones (copies) all the elements in the list in exactly same order.
*
* @param list The list to clone.
- * @return The new list that has been cloned.
+ * @return The new list that has been cloned, or @c NULL on error.
*
* This function clone in order of all elements in @p list. If @p list
* is @c NULL, this function returns @c NULL. This returns a copy of
@@ -1009,7 +1012,7 @@ EAPI Eina_List *eina_list_split_list(Eina_List *list, Eina_List *rela
* the data of no node in @p list is equal to @p data, the node with the nearest
* value to that will be returned and @p result_cmp will be the return value of
* @p func with @p data and the returned node's data as arguments.
- *
+ *
* This function is useful for inserting an element in the list only in case it
* isn't already present in the list, the naive way of doing this would be:
* @code
@@ -1017,7 +1020,7 @@ EAPI Eina_List *eina_list_split_list(Eina_List *list, Eina_List *rela
* if (!ptr)
* eina_list_sorted_insert(list, "my data");
* @endcode
- *
+ *
* However this has the downside of walking through the list twice, once to
* check if the data is already present and another to insert the element in the
* correct position. This can be done more efficiently:
@@ -1030,7 +1033,7 @@ EAPI Eina_List *eina_list_split_list(Eina_List *list, Eina_List *rela
* else if (cmp_result < 0)
* list = eina_list_append_relative_list(list, "my data", l);
* @endcode
- *
+ *
* If @a cmp_result is 0 the element is already in the list and we need not
* insert it, if @a cmp_result is greater than zero @a "my @a data" needs to
* come after @a l (the nearest node present), if less than zero before.
@@ -1167,7 +1170,7 @@ EAPI Eina_List *eina_list_search_unsorted_list(const Eina_List *list,
* before duplicating its contents.
*
* @note this is expensive and may walk the whole list, it's order-N,
- * that is for 1,000,000 elements list it may walk and compare
+ * that is, for 1,000,000 elements list it may walk and compare
* 1,000,000 nodes.
*
* @warning @p list must be a pointer to the first element of the list.
@@ -1177,6 +1180,7 @@ EAPI Eina_List *eina_list_search_unsorted_list(const Eina_List *list,
*/
EAPI void *eina_list_search_unsorted(const Eina_List *list, Eina_Compare_Cb func, const void *data);
+
/**
* @brief Gets the last list node in the list.
*
@@ -1193,6 +1197,7 @@ EAPI void *eina_list_search_unsorted(const Eina_List *list, Eina
*/
static inline Eina_List *eina_list_last(const Eina_List *list) EINA_PURE EINA_WARN_UNUSED_RESULT;
+
/**
* @brief Gets the next list node after the specified list node.
*
@@ -1207,12 +1212,12 @@ static inline Eina_List *eina_list_last(const Eina_List *list) EINA_PURE EINA_
*/
static inline Eina_List *eina_list_next(const Eina_List *list) EINA_PURE EINA_WARN_UNUSED_RESULT;
+
/**
- * @brief Gets the previous list node before the specified list node.
+ * @brief Gets the list node prior to the specified list node.
*
* @param list The list node to get the previous list node from.
* @return The previous list node on success, @c NULL otherwise.
- * if no previous list node exists
*
* This function returns the previous list node before the current one
* in @p list. It is equivalent to list->prev. If @p list is @c NULL or
@@ -1222,6 +1227,7 @@ static inline Eina_List *eina_list_next(const Eina_List *list) EINA_PURE EINA_
*/
static inline Eina_List *eina_list_prev(const Eina_List *list) EINA_PURE EINA_WARN_UNUSED_RESULT;
+
/**
* @brief Gets the list node data member.
*
@@ -1236,11 +1242,12 @@ static inline Eina_List *eina_list_prev(const Eina_List *list) EINA_PURE EINA_
*/
static inline void *eina_list_data_get(const Eina_List *list) EINA_PURE EINA_WARN_UNUSED_RESULT;
+
/**
* @brief Sets the list node data member.
*
- * @param list The list node to get the data member of.
- * @param data The data member to the list node.
+ * @param list The list node to set the data member of.
+ * @param data The data to be set.
* @return The previous data value.
*
* This function sets the data member @p data of the specified list node
@@ -1251,14 +1258,15 @@ static inline void *eina_list_data_get(const Eina_List *list) EINA_PURE E
*/
static inline void *eina_list_data_set(Eina_List *list, const void *data);
+
/**
* @brief Gets the count of the number of items in a list.
*
* @param list The list whose count to return.
* @return The number of members in the list.
*
- * This function returns how many members @p list contains. If the
- * list is @c NULL, @c 0 is returned.
+ * This function returns the quantity of members that @p list
+ * contains. If the list is @c NULL, @c 0 is returned.
*
* NB: This is an order-1 operation and takes the same time regardless
* of the length of the list.
@@ -1267,10 +1275,11 @@ static inline void *eina_list_data_set(Eina_List *list, const void *data)
*/
static inline unsigned int eina_list_count(const Eina_List *list) EINA_PURE;
+
/**
* @brief Returns the last list node's data.
*
- * @param list The list
+ * @param list The list.
* @return The node's data, or @c NULL on being passed a @c NULL pointer
*
* This function is a shortcut for typing eina_list_data_get(eina_list_last())
@@ -1278,21 +1287,19 @@ static inline unsigned int eina_list_count(const Eina_List *list) EINA_PURE;
*/
static inline void *eina_list_last_data_get(const Eina_List *list);
+
/**
- * @brief Returns a new iterator associated to a list.
+ * @brief Returns a new iterator associated with a list.
*
* @param list The list.
- * @return A new iterator.
+ * @return A new iterator, or @c NULL on memory allocation failure.
*
- * This function returns a newly allocated iterator associated to @p
- * list. If @p list is @c NULL or the count member of @p list is less
- * or equal than 0, this function still returns a valid iterator that
+ * This function returns a newly allocated iterator associated with @p
+ * list. If @p list is @c NULL or the count member of @p list is less than
+ * or equal to 0, this function still returns a valid iterator that
* will always return false on eina_iterator_next(), thus keeping API
* sane.
*
- * If the memory can not be allocated, NULL is returned.
- * Otherwise, a valid iterator is returned.
- *
* @warning @p list must be a pointer to the first element of the list.
*
* @warning if the list structure changes then the iterator becomes
@@ -1303,22 +1310,19 @@ EAPI Eina_Iterator *eina_list_iterator_new(const Eina_List *list) EINA_MA
/**
- * @brief Returns a new reversed iterator associated to a list.
+ * @brief Returns a new reversed iterator associated with a list.
*
* @param list The list.
- * @return A new iterator.
+ * @return A new iterator, or @c NULL on memory allocation failure.
*
- * This function returns a newly allocated iterator associated to @p
- * list. If @p list is @c NULL or the count member of @p list is less
- * or equal than 0, this function still returns a valid iterator that
+ * This function returns a newly allocated iterator associated with @p
+ * list. If @p list is @c NULL or the count member of @p list is less than
+ * or equal to 0, this function still returns a valid iterator that
* will always return false on eina_iterator_next(), thus keeping API
* sane.
*
* Unlike eina_list_iterator_new(), this will walk the list backwards.
*
- * If the memory can not be allocated, NULL is returned.
- * Otherwise, a valid iterator is returned.
- *
* @warning @p list must be a pointer to the first element of the list.
*
* @warning if the list structure changes then the iterator becomes
@@ -1329,12 +1333,12 @@ EAPI Eina_Iterator *eina_list_iterator_reversed_new(const Eina_List *list
/**
- * @brief Returns a new accessor associated to a list.
+ * @brief Returns a new accessor associated with a list.
*
* @param list The list.
- * @return A new accessor.
+ * @return A new accessor, or @c NULL on error.
*
- * This function returns a newly allocated accessor associated to
+ * This function returns a newly allocated accessor associated with
* @p list. If @p list is @c NULL or the count member of @p list is
* less or equal than 0, this function returns @c NULL. If the memory can
* not be allocated, @c NULL is returned; otherwise, a valid accessor is
@@ -1344,6 +1348,7 @@ EAPI Eina_Iterator *eina_list_iterator_reversed_new(const Eina_List *list
*/
EAPI Eina_Accessor *eina_list_accessor_new(const Eina_List *list) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
+
/**
* @brief Finds the member of the list and returns the index.
*
@@ -1361,6 +1366,7 @@ EAPI Eina_Accessor *eina_list_accessor_new(const Eina_List *list) EINA_MA
*/
EAPI int eina_list_data_idx(const Eina_List *list, void *data);
+
/**
* @def EINA_LIST_FOREACH
* @brief Definition for the macro to iterate over a list.
diff --git a/src/lib/eina/eina_lock.c b/src/lib/eina/eina_lock.c
index 76819367b4..aa085cd15a 100644
--- a/src/lib/eina/eina_lock.c
+++ b/src/lib/eina/eina_lock.c
@@ -52,9 +52,12 @@ _eina_spinlock_macos_release(Eina_Spinlock *spinlock)
#endif /* EINA_HAVE_OSX_SPINLOCK */
+Eina_Bool fork_resetting;
+
EAPI void
_eina_lock_debug_abort(int err, const char *fn, const volatile void *ptr)
{
+ if (fork_resetting) return;
fprintf(stderr, "EINA ERROR: '%s' on %s %p\n", strerror(err), fn, ptr);
#ifdef EINA_HAVE_DEBUG_THREADS
abort();
@@ -88,19 +91,13 @@ _eina_lock_new(Eina_Lock *mutex, Eina_Bool recursive)
pthread_mutexattr_t attr;
Eina_Bool ok = EINA_FALSE;
-#ifdef EINA_HAVE_DEBUG_THREADS
- if (!_eina_threads_activated)
- assert(pthread_equal(_eina_main_loop, pthread_self()));
-#endif
-
if (pthread_mutexattr_init(&attr) != 0) return EINA_FALSE;
if (recursive)
{
if (pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE) != 0) goto fail_release;
}
#ifdef EINA_HAVE_DEBUG_THREADS
- if (pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK) != 0) goto fail_release;
- memset(mutex, 0, sizeof(Eina_Lock));
+ else if (pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK) != 0) goto fail_release;
#endif
if (pthread_mutex_init(&(mutex->mutex), &attr) != 0) goto fail_release;
ok = EINA_TRUE;
@@ -114,16 +111,8 @@ _eina_lock_free(Eina_Lock *mutex)
{
int ok;
-#ifdef EINA_HAVE_DEBUG_THREADS
- if (!_eina_threads_activated)
- assert(pthread_equal(_eina_main_loop, pthread_self()));
-#endif
-
ok = pthread_mutex_destroy(&(mutex->mutex));
if (ok != 0) EINA_LOCK_ABORT_DEBUG(ok, mutex_destroy, mutex);
-#ifdef EINA_HAVE_DEBUG_THREADS
- memset(mutex, 0, sizeof(Eina_Lock));
-#endif
}
EAPI Eina_Bool
@@ -134,9 +123,6 @@ _eina_condition_new(Eina_Condition *cond, Eina_Lock *mutex)
#ifdef EINA_HAVE_DEBUG_THREADS
assert(mutex != NULL);
- if (!_eina_threads_activated)
- assert(pthread_equal(_eina_main_loop, pthread_self()));
- memset(cond, 0, sizeof (Eina_Condition));
#endif
cond->lock = mutex;
@@ -178,15 +164,7 @@ _eina_condition_new(Eina_Condition *cond, Eina_Lock *mutex)
EAPI void
_eina_condition_free(Eina_Condition *cond)
{
-#ifdef EINA_HAVE_DEBUG_THREADS
- if (!_eina_threads_activated)
- assert(pthread_equal(_eina_main_loop, pthread_self()));
-#endif
-
pthread_cond_destroy(&(cond->condition));
-#ifdef EINA_HAVE_DEBUG_THREADS
- memset(cond, 0, sizeof (Eina_Condition));
-#endif
}
EAPI Eina_Bool
@@ -194,11 +172,6 @@ _eina_rwlock_new(Eina_RWLock *mutex)
{
int ok;
-#ifdef EINA_HAVE_DEBUG_THREADS
- if (!_eina_threads_activated)
- assert(pthread_equal(_eina_main_loop, pthread_self()));
-#endif
-
ok = pthread_rwlock_init(&(mutex->mutex), NULL);
if (ok == 0) return EINA_TRUE;
else if ((ok == EAGAIN) || (ok == ENOMEM)) return EINA_FALSE;
@@ -209,10 +182,6 @@ _eina_rwlock_new(Eina_RWLock *mutex)
EAPI void
_eina_rwlock_free(Eina_RWLock *mutex)
{
-#ifdef EINA_HAVE_DEBUG_THREADS
- if (!_eina_threads_activated)
- assert(pthread_equal(_eina_main_loop, pthread_self()));
-#endif
pthread_rwlock_destroy(&(mutex->mutex));
}
diff --git a/src/lib/eina/eina_lock.h b/src/lib/eina/eina_lock.h
index ea0d6e7f2c..80c2aa0667 100644
--- a/src/lib/eina/eina_lock.h
+++ b/src/lib/eina/eina_lock.h
@@ -199,7 +199,7 @@ static inline Eina_Lock_Result eina_lock_release(Eina_Lock *mutex);
/**
* @brief Prints debug information about a lock.
* @details This function prints debug information for @p mutex. The information is
- * platform dependant. On POSIX systems it prints the address of @p mutex,
+ * platform dependent. On POSIX systems it prints the address of @p mutex,
* lock state, thread number and a backtrace.
*
* @param[in] mutex The #Eina_Lock to print debug info for.
@@ -221,7 +221,7 @@ EAPI void eina_lock_debug(const Eina_Lock *mutex);
* @return #EINA_TRUE on success, #EINA_FALSE otherwise.
*
* Condition variables are used to coordinate actions between threads. See
- * <a href="https://computing.llnl.gov/tutorials/pthreads/#ConVarOverview"> Condition Varable Overview </a>
+ * <a href="https://computing.llnl.gov/tutorials/pthreads/#ConVarOverview"> Condition Variable Overview </a>
* for an introduction to condition variables and their use.
*
* @see eina_condition_free()
@@ -252,7 +252,7 @@ static inline void eina_condition_free(Eina_Condition *cond);
static inline Eina_Bool eina_condition_wait(Eina_Condition *cond);
/**
- * @brief Causes a thread to wait until signalled by the condition or a
+ * @brief Causes a thread to wait until signaled by the condition or a
* timeout is reached.
* @details This function makes a thread block until either a signal is sent to it via
* @p cond or @p t seconds have passed.
@@ -292,7 +292,7 @@ static inline Eina_Bool eina_condition_broadcast(Eina_Condition *cond);
* @return #EINA_TRUE on success, #EINA_FALSE otherwise.
*
* @note If there is more than one thread waiting on this condition, one of them is
- * signalled, but which one is undefined.
+ * signaled, but which one is undefined.
*
* @see eina_condition_broadcast()
*/
diff --git a/src/lib/eina/eina_log.h b/src/lib/eina/eina_log.h
index 5f855ddeb0..83e7cb312d 100644
--- a/src/lib/eina/eina_log.h
+++ b/src/lib/eina/eina_log.h
@@ -838,7 +838,7 @@ EAPI void eina_log_vprint(int domain,
* @param file The file which is logged.
* @param fnc The function which is logged.
* @param line The line which is logged.
- * @param fmt The ouptut format to use.
+ * @param fmt The output format to use.
* @param data Not used.
* @param args The arguments needed by the format.
*
@@ -873,7 +873,7 @@ EAPI void eina_log_print_cb_stdout(const Eina_Log_Domain *d,
* @param file The file which is logged.
* @param fnc The function which is logged.
* @param line The line which is logged.
- * @param fmt The ouptut format to use.
+ * @param fmt The output format to use.
* @param data Not used.
* @param args The arguments needed by the format.
*
@@ -915,7 +915,7 @@ EAPI void eina_log_print_cb_stderr(const Eina_Log_Domain *d,
* @param file The file which is logged.
* @param fnc The function which is logged.
* @param line The line which is logged.
- * @param fmt The ouptut format to use.
+ * @param fmt The output format to use.
* @param data The file which will store the output (as a FILE *).
* @param args The arguments needed by the format.
*
@@ -943,7 +943,7 @@ EAPI void eina_log_print_cb_file(const Eina_Log_Domain *d,
* @param file The file which is logged.
* @param fnc The function which is logged.
* @param line The line which is logged.
- * @param fmt The ouptut format to use.
+ * @param fmt The output format to use.
* @param data The file which will store the output (as a FILE *).
* @param args The arguments needed by the format.
*
diff --git a/src/lib/eina/eina_main.c b/src/lib/eina/eina_main.c
index 1a152d0da7..b3790f14d7 100644
--- a/src/lib/eina/eina_main.c
+++ b/src/lib/eina/eina_main.c
@@ -68,6 +68,7 @@
#include "eina_evlog.h"
#include "eina_freeq.h"
#include "eina_slstr.h"
+#include "eina_vpath.h"
/*============================================================================*
* Local *
@@ -112,6 +113,7 @@ static int _mt_enabled = 0;
EAPI int _eina_threads_debug = 0;
EAPI pthread_mutex_t _eina_tracking_lock;
EAPI Eina_Inlist *_eina_tracking = NULL;
+extern Eina_Lock _sysmon_lock;
#endif
/* place module init/shutdown functions here to avoid other modules
@@ -155,6 +157,7 @@ EAPI Eina_Inlist *_eina_tracking = NULL;
S(safepointer);
S(slstr);
S(promise);
+ S(vpath);
#undef S
struct eina_desc_setup
@@ -167,6 +170,9 @@ struct eina_desc_setup
static const struct eina_desc_setup _eina_desc_setup[] = {
#define S(x) {# x, eina_ ## x ## _init, eina_ ## x ## _shutdown}
/* log is a special case as it needs printf */
+ S(module),
+ S(mempool),
+ S(list),
S(debug),
S(evlog),
S(stringshare),
@@ -177,9 +183,6 @@ static const struct eina_desc_setup _eina_desc_setup[] = {
S(accessor),
S(inarray),
S(array),
- S(module),
- S(mempool),
- S(list),
S(binshare),
S(ustringshare),
S(matrixsparse),
@@ -202,6 +205,7 @@ static const struct eina_desc_setup _eina_desc_setup[] = {
S(safepointer),
S(slstr),
S(promise),
+ S(vpath),
#undef S
};
static const size_t _eina_desc_setup_len = sizeof(_eina_desc_setup) /
@@ -221,6 +225,39 @@ _eina_shutdown_from_desc(const struct eina_desc_setup *itr)
eina_log_shutdown();
}
+static void
+_eina_threads_do_shutdown(void)
+{
+#ifdef EINA_HAVE_DEBUG_THREADS
+ const Eina_Lock *lk;
+
+ pthread_mutex_lock(&_eina_tracking_lock);
+ if (_eina_tracking)
+ {
+ if (((Eina_Lock*)_eina_tracking != (&_sysmon_lock)) || (_eina_tracking->next))
+ {
+ fprintf(stderr, "*************************\n");
+ fprintf(stderr, "* The IMPOSSIBLE HAPPEN *\n");
+ fprintf(stderr, "* LOCK STILL TAKEN : *\n");
+ fprintf(stderr, "*************************\n");
+ EINA_INLIST_FOREACH(_eina_tracking, lk)
+ {
+ fprintf(stderr, "=======\n");
+ eina_lock_debug(lk);
+ }
+ fprintf(stderr, "*************************\n");
+ abort();
+ }
+ }
+ pthread_mutex_unlock(&_eina_tracking_lock);
+#endif
+
+ eina_share_common_threads_shutdown();
+ eina_log_threads_shutdown();
+
+ _eina_threads_activated = EINA_FALSE;
+}
+
/**
* @endcond
*/
@@ -328,6 +365,8 @@ eina_shutdown(void)
_eina_shutdown_from_desc(_eina_desc_setup + _eina_desc_setup_len);
+ if (_eina_threads_activated && (!_eina_main_thread_count))
+ _eina_threads_do_shutdown();
#ifdef EINA_HAVE_DEBUG_THREADS
pthread_mutex_destroy(&_eina_tracking_lock);
#endif
@@ -378,8 +417,6 @@ eina_threads_shutdown(void)
int ret;
#ifdef EINA_HAVE_DEBUG_THREADS
- const Eina_Lock *lk;
-
assert(pthread_equal(_eina_main_loop, pthread_self()));
assert(_eina_main_thread_count > 0);
#endif
@@ -388,29 +425,8 @@ eina_threads_shutdown(void)
if(_eina_main_thread_count > 0)
return ret;
-#ifdef EINA_HAVE_DEBUG_THREADS
- pthread_mutex_lock(&_eina_tracking_lock);
- if (_eina_tracking)
- {
- fprintf(stderr, "*************************\n");
- fprintf(stderr, "* The IMPOSSIBLE HAPPEN *\n");
- fprintf(stderr, "* LOCK STILL TAKEN : *\n");
- fprintf(stderr, "*************************\n");
- EINA_INLIST_FOREACH(_eina_tracking, lk)
- {
- fprintf(stderr, "=======\n");
- eina_lock_debug(lk);
- }
- fprintf(stderr, "*************************\n");
- abort();
- }
- pthread_mutex_unlock(&_eina_tracking_lock);
-#endif
-
- eina_share_common_threads_shutdown();
- eina_log_threads_shutdown();
-
- _eina_threads_activated = EINA_FALSE;
+ if (!_eina_main_count)
+ _eina_threads_do_shutdown();
return ret;
#else
diff --git a/src/lib/eina/eina_main.h b/src/lib/eina/eina_main.h
index 26391779be..4b4acfc5d8 100644
--- a/src/lib/eina/eina_main.h
+++ b/src/lib/eina/eina_main.h
@@ -94,13 +94,13 @@ EAPI extern Eina_Error EINA_ERROR_NOT_IMPLEMENTED;
*
* @li @c EINA_LOG_ABORT_LEVEL=LEVEL, where level is an integer such
* as 0 (critical) to 4 (debug). This will cause any messages at
- * that level or less (ie: if 4, then messages at level 0 also
+ * that level or less (i.e.: if 4, then messages at level 0 also
* apply) to abort(3) the application if @c EINA_LOG_ABORT=1 was
* defined.
*
* @li @c EINA_LOG_BACKTRACE=LEVEL, where level is an integer such as
* 0 (critical) to 4 (debug). This will cause any messages at
- * that level or less (ie: if 4, then messages at level 0 also
+ * that level or less (i.e.: if 4, then messages at level 0 also
* apply) to dump a backtrace. Note that if systemd-journal is
* used, it's going to the journal as well.
*
diff --git a/src/lib/eina/eina_matrix.c b/src/lib/eina/eina_matrix.c
index e60989f971..1c848f3e98 100644
--- a/src/lib/eina/eina_matrix.c
+++ b/src/lib/eina/eina_matrix.c
@@ -1119,17 +1119,7 @@ eina_matrix3_multiply(Eina_Matrix3 *out, const Eina_Matrix3 *mat_a, const Eina_M
return;
}
- MATRIX_XX(out) = MATRIX_XX(mat_b) * MATRIX_XX(mat_a) + MATRIX_YX(mat_b) * MATRIX_XY(mat_a) + MATRIX_ZX(mat_b) * MATRIX_XZ(mat_a);
- MATRIX_XY(out) = MATRIX_XY(mat_b) * MATRIX_XX(mat_a) + MATRIX_YY(mat_b) * MATRIX_XY(mat_a) + MATRIX_ZY(mat_b) * MATRIX_XZ(mat_a);
- MATRIX_XZ(out) = MATRIX_XZ(mat_b) * MATRIX_XX(mat_a) + MATRIX_YZ(mat_b) * MATRIX_XY(mat_a) + MATRIX_ZZ(mat_b) * MATRIX_XZ(mat_a);
-
- MATRIX_YX(out) = MATRIX_XX(mat_b) * MATRIX_YX(mat_a) + MATRIX_YX(mat_b) * MATRIX_YY(mat_a) + MATRIX_ZX(mat_b) * MATRIX_YZ(mat_a);
- MATRIX_YY(out) = MATRIX_XY(mat_b) * MATRIX_YX(mat_a) + MATRIX_YY(mat_b) * MATRIX_YY(mat_a) + MATRIX_ZY(mat_b) * MATRIX_YZ(mat_a);
- MATRIX_YZ(out) = MATRIX_XZ(mat_b) * MATRIX_YX(mat_a) + MATRIX_YZ(mat_b) * MATRIX_YY(mat_a) + MATRIX_ZZ(mat_b) * MATRIX_YZ(mat_a);
-
- MATRIX_ZX(out) = MATRIX_XX(mat_b) * MATRIX_ZX(mat_a) + MATRIX_YX(mat_b) * MATRIX_ZY(mat_a) + MATRIX_ZX(mat_b) * MATRIX_ZZ(mat_a);
- MATRIX_ZY(out) = MATRIX_XY(mat_b) * MATRIX_ZX(mat_a) + MATRIX_YY(mat_b) * MATRIX_ZY(mat_a) + MATRIX_ZY(mat_b) * MATRIX_ZZ(mat_a);
- MATRIX_ZZ(out) = MATRIX_XZ(mat_b) * MATRIX_ZX(mat_a) + MATRIX_YZ(mat_b) * MATRIX_ZY(mat_a) + MATRIX_ZZ(mat_b) * MATRIX_ZZ(mat_a);
+ eina_matrix3_compose(mat_a, mat_b, out);
}
EAPI void
diff --git a/src/lib/eina/eina_matrix.h b/src/lib/eina/eina_matrix.h
index 4aa61edc20..ade4249b04 100644
--- a/src/lib/eina/eina_matrix.h
+++ b/src/lib/eina/eina_matrix.h
@@ -36,38 +36,43 @@
/**
* @defgroup Eina_Matrix_Group Matrix
*
+ * Eina includes a family of matrix types of different dimension sizes
+ * and underlying data types. Dimensions supported include 2x2, 3x3,
+ * and 4x4. A fixed point variation of the 3x3 matrix is also
+ * supported, which uses the Eina_F16p16 (Q16.16) data type.
+ *
* @{
*/
/**
* @typedef Eina_Matrix_Type
- * Matrix3 types
+ * Matrix types
*/
typedef enum _Eina_Matrix_Type
{
- EINA_MATRIX_TYPE_IDENTITY, /**< Identity matrix3 type */
- EINA_MATRIX_TYPE_AFFINE, /**< Affine matrix3 type */
- EINA_MATRIX_TYPE_PROJECTIVE, /**< Projective matrix3 type */
- EINA_MATRIX_TYPE_LAST /**< The total number of matrix3 types */
+ EINA_MATRIX_TYPE_IDENTITY, /**< Identity matrix type */
+ EINA_MATRIX_TYPE_AFFINE, /**< Affine matrix type */
+ EINA_MATRIX_TYPE_PROJECTIVE, /**< Projective matrix type */
+ EINA_MATRIX_TYPE_LAST /**< The total number of matrix types */
} Eina_Matrix_Type;
/**
- * @defgroup Eina_Matrix3_Group 3x3 Matrices in floating point
+ * @defgroup Eina_Matrix3_Group 3x3 floating point matrices
*
- * @brief Matrix definition and operations.
+ * @brief Definition and operations for 3x3 matrices.
*
* @{
*/
/**
* @typedef Eina_Matrix3
- * Floating point matrix3 handler
+ * A 3x3 floating point matrix.
*/
typedef struct _Eina_Matrix3 Eina_Matrix3;
/**
* @struct _Eina_Matrix3
- * Floating point matrix3 handler
+ * A 3x3 floating point matrix.
*/
struct _Eina_Matrix3
{
@@ -91,20 +96,20 @@ struct _Eina_Matrix3
/**
* @defgroup Eina_Matrix4_Group 4x4 Matrices in floating point
*
- * @brief Matrix definition and operations.
+ * @brief Definition and operations for 4x4 matrices.
*
* @{
*/
/**
* @typedef Eina_Matrix4
- * Floating point matrix4 handler
+ * A 4x4 floating point matrix.
*/
typedef struct _Eina_Matrix4 Eina_Matrix4;
/**
* @struct Eina_Matrix4
- * Floating point matrix4 handler
+ * A 4x4 floating point matrix.
*/
struct _Eina_Matrix4
{
@@ -136,19 +141,19 @@ struct _Eina_Matrix4
/**
* @defgroup Eina_Matrix3_F16p16_Group 3x3 Matrices in fixed point
*
- * @brief Fixed point matrix operations.
+ * @brief Definition and operations for 3x3 fixed point matrices.
* @{
*/
/**
* @typedef Eina_Matrix3_F16p16
- * Fixed point matrix3 handler
+ * A 3x3 fixed point (Q16.16) matrix.
*/
typedef struct _Eina_Matrix3_F16p16 Eina_Matrix3_F16p16;
/**
* @struct Eina_Matrix3_F16p16
- * Fixed point matrix3 handler
+ * A 3x3 fixed point (Q16.16) matrix.
*/
struct _Eina_Matrix3_F16p16
{
@@ -168,7 +173,7 @@ struct _Eina_Matrix3_F16p16
/**
* @brief Sets the given fixed point matrix to the identity matrix.
*
- * @param[in] m The fixed point matrix to set
+ * @param[in] m The fixed point matrix to set.
*
* This function sets @p m to the identity matrix. No check is done on
* @p m.
@@ -181,15 +186,15 @@ EAPI void eina_matrix3_f16p16_identity(Eina_Matrix3_F16p16 *m);
* @brief Sets dst as the matrix multiplication (composition) of two
* Eina_F16p16 matrices.
*
+ * @param[in] m1 The first matrix. Must be non-NULL.
+ * @param[in] m2 The second matrix. Must be non-NULL.
+ * @param[out] dst The results matrix.
+ *
* In matrix multiplication, AB, the resultant matrix is created from
* the rows of A multiplied against the columns of B and summed. This
- * is not a cummutative; i.e. AB != BA, so the ordering of arguments
+ * is not a commutative; i.e. AB != BA, so the ordering of arguments
* @p m1 and @p m2 matters.
*
- * @param[in] m1 The first matrix. Must be non-NULL.
- * @param[in] m2 The second matrix. Must be non-NULL.
- * @param[out] dst The matrix for the results to be placed.
- *
* @since 1.14
*/
EAPI void eina_matrix3_f16p16_compose(const Eina_Matrix3_F16p16 *m1,
@@ -254,7 +259,7 @@ EAPI Eina_Matrix_Type eina_matrix3_type_get(const Eina_Matrix3 *m);
* @param[in] yz The sixth coefficient value.
* @param[in] zx The seventh coefficient value.
* @param[in] zy The eighth coefficient value.
- * @param[in] zz The nineth coefficient value.
+ * @param[in] zz The ninth coefficient value.
*
* This function sets the values of the coefficients of the matrix
* @p m. No check is done on @p m.
@@ -281,7 +286,7 @@ EAPI void eina_matrix3_values_set(Eina_Matrix3 *m,
* @param[out] yz The sixth coefficient value.
* @param[out] zx The seventh coefficient value.
* @param[out] zy The eighth coefficient value.
- * @param[out] zz The nineth coefficient value.
+ * @param[out] zz The ninth coefficient value.
*
* This function gets the values of the coefficients of the matrix
* @p m. No check is done on @p m.
@@ -308,7 +313,7 @@ EAPI void eina_matrix3_values_get(const Eina_Matrix3 *m,
* @param[out] yz The sixth coefficient value.
* @param[out] zx The seventh coefficient value.
* @param[out] zy The eighth coefficient value.
- * @param[out] zz The nineth coefficient value.
+ * @param[out] zz The nine-th coefficient value.
*
* This function gets the values of the coefficients of the matrix
* @p m. No check is done on @p m.
@@ -330,7 +335,7 @@ EAPI void eina_matrix3_fixed_values_get(const Eina_Matrix3 *m,
* @param[out] fm The fixed point matrix.
*
* This function transforms the floating point matrix @p m to a fixed
- * point matrix and store the coefficients into the fixed point matrix
+ * point matrix and stores the coefficients into the fixed point matrix
* @p fm.
*
* @since 1.14
@@ -339,14 +344,14 @@ EAPI void eina_matrix3_matrix3_f16p16_to(const Eina_Matrix3 *m,
Eina_Matrix3_F16p16 *fm);
/**
- * @brief Checks whether the two given matrices are equal or not.
+ * @brief Checks whether the two matrices are equivalent.
*
* @param[in] m1 The first matrix.
* @param[in] m2 The second matrix.
- * @return EINA_TRUE if the two matrices are equal, @c 0 otherwise.
+ * @return @c EINA_TRUE if the two matrices are equal, @c EINA_FALSE otherwise.
*
- * This function return EINA_TRUE if the matrices @p m1 and @p m2 are
- * equal, EINA_FALSE otherwise. No check is done on the matrices.
+ * This function returns @c EINA_TRUE if the matrices @p m1 and @p m2
+ * are equal, @c EINA_FALSE otherwise. No check is done on the matrices.
*
* @since 1.14
*/
@@ -355,15 +360,15 @@ EAPI Eina_Bool eina_matrix3_equal(const Eina_Matrix3 *m1, const Eina_Matrix3 *m2
/**
* @brief Sets dst as the matrix multiplication (composition) of two matrices.
*
+ * @param[in] m1 The first matrix. Must be non-NULL.
+ * @param[in] m2 The second matrix. Must be non-NULL.
+ * @param[out] dst The results matrix.
+ *
* In matrix multiplication, AB, the resultant matrix is created from
* the rows of A multiplied against the columns of B and summed. This
- * is not a cummutative; i.e. AB != BA, so the ordering of arguments
+ * is not commutative; i.e. AB != BA, so the ordering of arguments
* @p m1 and @p m2 matters.
*
- * @param[in] m1 The first matrix. Must be non-NULL.
- * @param[in] m2 The second matrix. Must be non-NULL.
- * @param[out] dst The matrix for the results to be placed.
- *
* @since 1.14
*/
EAPI void eina_matrix3_compose(const Eina_Matrix3 *m1,
@@ -371,29 +376,31 @@ EAPI void eina_matrix3_compose(const Eina_Matrix3 *m1,
Eina_Matrix3 *dst);
/**
- * @brief Sets the matrix values for a translation.
- * @param[out] m The matrix to set the translation values
- * @param[in] tx The X coordinate translate
- * @param[in] ty The Y coordinate translate
+ * @brief Sets the matrix values for a translation operation.
+ *
+ * @param[out] m The matrix.
+ * @param[in] tx The X coordinate translation.
+ * @param[in] ty The Y coordinate translation.
*
* @since 1.14
*/
EAPI void eina_matrix3_translate(Eina_Matrix3 *t, double tx, double ty);
/**
- * @brief Sets the matrix values for a scale.
- * @param[out] m The matrix to set the scale values
- * @param[in] sx The X coordinate scale
- * @param[in] sy The Y coordinate scale
+ * @brief Sets the matrix values for a scaling operation.
+ *
+ * @param[out] m The matrix.
+ * @param[in] sx The X coordinate scaling factor.
+ * @param[in] sy The Y coordinate scaling factor.
*
* @since 1.14
*/
EAPI void eina_matrix3_scale(Eina_Matrix3 *t, double sx, double sy);
/**
- * @brief Sets the matrix values for a rotation.
- * @param[out] t The matrix to set the rotation values
- * @param[in] rad The radius to rotate the matrix
+ * @brief Sets the matrix values for a rotation operation.
+ * @param[out] t The matrix.
+ * @param[in] rad The number of radians to rotate.
*
* @since 1.14
*/
@@ -402,7 +409,7 @@ EAPI void eina_matrix3_rotate(Eina_Matrix3 *t, double rad);
/**
* @brief Sets the given floating point matrix to the identity matrix.
*
- * @param[out] m The floating point matrix to set
+ * @param[out] m The matrix to set to identity.
*
* This function sets @p m to the identity matrix. No check is done on
* @p m.
@@ -412,7 +419,7 @@ EAPI void eina_matrix3_rotate(Eina_Matrix3 *t, double rad);
EAPI void eina_matrix3_identity(Eina_Matrix3 *t);
/**
- * @brief Returns the determinant of the given matrix.
+ * @brief Calculates the determinant of the given matrix.
*
* @param m[in] The matrix.
* @return The determinant.
@@ -425,7 +432,7 @@ EAPI void eina_matrix3_identity(Eina_Matrix3 *t);
EAPI double eina_matrix3_determinant(const Eina_Matrix3 *m);
/**
- * @brief Divides the given matrix by the given scalar.
+ * @brief Divides the given matrix by a scalar number.
*
* @param[in,out] m The matrix.
* @param[in] scalar The scalar number.
@@ -444,8 +451,8 @@ EAPI void eina_matrix3_divide(Eina_Matrix3 *m, double scalar);
* @param[out] m2 The inverse matrix.
*
* This function inverts the matrix @p m and stores the result in
- * @p m2. No check is done on @p m or @p m2. If @p m can not be
- * invertible, then @p m2 is set to the identity matrix.
+ * @p m2. No check is done on @p m or @p m2. If @p m cannot be
+ * inverted, then @p m2 is set to the identity matrix.
*
* @since 1.14
*/
@@ -517,9 +524,9 @@ EAPI void eina_matrix3_point_transform(const Eina_Matrix3 *m,
/**
* @brief Computes the transformation of a rectangle using the given matrix.
*
- * @param m[in] The transformation matrix to apply.
- * @param r[in] The rectangle to be transformed.
- * @param q[out] The resultant transformed points.
+ * @param[in] m The transformation matrix to apply.
+ * @param[in] r The rectangle to be transformed.
+ * @param[out] q The resultant transformed points.
*
* Performs a point transformation of each corner of the rectangle @p r,
* and stores the result in the quadrangle @p q. No checks are done on the
@@ -582,22 +589,24 @@ EAPI Eina_Bool eina_matrix3_quad_square_map(Eina_Matrix3 *m,
const Eina_Quad *q);
/**
- * @brief Sets array to matrix.
+ * @brief Sets matrix values using an array.
*
- * @param[out] m The result matrix
- * @param[in] v The the array[9] for set
+ * @param[out] m The result matrix.
+ * @param[in] v The array[9] of values.
*
- * Set to matrix first 9 elements from array
+ * Uses the first 9 elements in the given C array @p v to set the
+ * values in the matrix @p m. The values will be set in the order
+ * of the elements in the Eina_Matrix3 structure.
*
* @since 1.17
*/
EAPI void eina_matrix3_array_set(Eina_Matrix3 *m, const double *v);
/**
- * @brief Copies matrix.
+ * @brief Copies a matrix.
*
- * @param[out] dst The matrix copy
- * @param[in] src The matrix for copy.
+ * @param[out] dst Copy of the matrix.
+ * @param[in] src The matrix to copy.
*
* @since 1.16
*/
@@ -606,9 +615,13 @@ EAPI void eina_matrix3_copy(Eina_Matrix3 *dst, const Eina_Matrix3 *src);
/**
* @brief Multiplies two matrices.
*
- * @param[out] out The resulting matrix
- * @param[in] mat_a The first member of the multiplication
- * @param[in] mat_b The second member of the multiplication
+ * @param[out] out The resulting matrix.
+ * @param[in] mat_a The first member of the multiplication.
+ * @param[in] mat_b The second member of the multiplication.
+ *
+ * @p out must not point to the same structure as @p mat_a or @p mat_b,
+ * else the calculation results will be incorrect. Use
+ * eina_matrix3_multiply_copy() instead in this case.
*
* @since 1.17
*/
@@ -616,11 +629,15 @@ EAPI void eina_matrix3_multiply(Eina_Matrix3 *out, const Eina_Matrix3 *mat_a,
const Eina_Matrix3 *mat_b);
/**
- * @brief Multiplies two matrices.
+ * @brief Multiplies two matrices without overwriting them.
*
- * @param[out] out The resulting matrix
- * @param[in] mat_a The first member of the multiplication
- * @param[in] mat_b The second member of the multiplication
+ * @param[out] out The resulting matrix.
+ * @param[in] mat_a The first member of the multiplication.
+ * @param[in] mat_b The second member of the multiplication.
+ *
+ * Safely multiplies @p mat_a and @p mat_b by checking if the @p out
+ * parameter points to either of them, and if so uses a temporary matrix
+ * for the intermediary calculations.
*
* @since 1.17
*/
@@ -628,23 +645,29 @@ EAPI void eina_matrix3_multiply_copy(Eina_Matrix3 *out, const Eina_Matrix3 *mat_
const Eina_Matrix3 *mat_b);
/**
- * @brief Transforms scale of matrix.
+ * @brief Sets the scale parameters (XX, YY) of a matrix.
+ *
+ * @param[out] out The resulting matrix.
+ * @param[in] s_x The scale value for x.
+ * @param[in] s_y The scale value for y.
*
- * @param[out] out The resulting matrix
- * @param[in] s_x The scale value for x
- * @param[in] s_y The scale value for y
+ * Sets only the XX and YY components of the matrix, leaving the rest of
+ * the matrix as it was.
*
* @since 1.17
*/
EAPI void eina_matrix3_scale_transform_set(Eina_Matrix3 *out, double s_x, double s_y);
/**
- * @brief Transforms position of matrix.
+ * @brief Sets the positional parameters (XZ, YZ) of a matrix.
*
- * @param[out] out The resulting matrix
- * @param[in] p_x The position value for x
- * @param[in] p_y The position value for y
+ * @param[out] out The resulting matrix.
+ * @param[in] p_x The position value for x.
+ * @param[in] p_y The position value for y.
*
+ * Sets only the XZ and YZ components of the matrix, leaving the rest of
+ * the matrix as it was.
+
* @since 1.17
*/
EAPI void eina_matrix3_position_transform_set(Eina_Matrix3 *out, const double p_x,
@@ -653,8 +676,8 @@ EAPI void eina_matrix3_position_transform_set(Eina_Matrix3 *out, const double p_
/**
* @brief Sets normal of the given matrix.
*
- * @param[out] out The result mtrix of normal
- * @param[in] m The matrix
+ * @param[out] out The resulting matrix.
+ * @param[in] m The matrix.
*
* @since 1.17
*/
@@ -706,14 +729,14 @@ EAPI Eina_Matrix_Type eina_matrix4_type_get(const Eina_Matrix4 *m);
* @param[in] yy The sixth coefficient value.
* @param[in] yz The seventh coefficient value.
* @param[in] yw The eighth coefficient value.
- * @param[in] zx The nineth coefficient value.
+ * @param[in] zx The ninth coefficient value.
* @param[in] zy The tenth coefficient value.
* @param[in] zz The eleventh coefficient value.
* @param[in] zw The twelfth coefficient value.
* @param[in] wx The thirteenth coefficient value.
* @param[in] wy The fourteenth coefficient value.
* @param[in] wz The fifteenth coefficient value.
- * @param[in] ww The sizteenth coefficient value.
+ * @param[in] ww The sixteenth coefficient value.
*
* This function sets the values of the coefficients of the matrix
* @p m. No check is done on @p m.
@@ -741,14 +764,14 @@ EAPI void eina_matrix4_values_set(Eina_Matrix4 *m,
* @param[out] yy The sixth coefficient value.
* @param[out] yz The seventh coefficient value.
* @param[out] yw The eighth coefficient value.
- * @param[out] zx The nineth coefficient value.
+ * @param[out] zx The ninth coefficient value.
* @param[out] zy The tenth coefficient value.
* @param[out] zz The eleventh coefficient value.
* @param[out] zw The twelfth coefficient value.
* @param[out] wx The thirteenth coefficient value.
* @param[out] wy The fourteenth coefficient value.
* @param[out] wz The fifteenth coefficient value.
- * @param[out] ww The sizteenth coefficient value.
+ * @param[out] ww The sixteenth coefficient value.
*
* This function gets the values of the coefficients of the matrix
* @p m. No check is done on @p m.
@@ -764,7 +787,7 @@ EAPI void eina_matrix4_values_get(const Eina_Matrix4 *m,
double *wx, double *wy, double *wz, double *ww);
/**
- * @brief Returns the determinant of the given matrix.
+ * @brief Calculates the determinant of the given matrix.
*
* @param[in] m The matrix.
* @return The determinant.
@@ -777,11 +800,12 @@ EAPI void eina_matrix4_values_get(const Eina_Matrix4 *m,
EAPI double eina_matrix4_determinant(const Eina_Matrix4 *m);
/**
- * @brief Returns the determinant of the given matrix.
+ * @brief Normalizes the given matrix.
*
- * @param[out] out The normalized matrix
+ * @param[out] out The normalized matrix.
* @param[in] in The matrix.
- * @return The determinant.
+ * @return @c EINA_FALSE if matrix could not be normalized, @c EINA_TRUE
+ * otherwise.
*
* This function returns the determinant of the matrix @p in. No check
* is done on @p in.
@@ -792,23 +816,29 @@ EAPI Eina_Bool eina_matrix4_normalized(Eina_Matrix4 *out,
const Eina_Matrix4 *in);
/**
- * @brief Returns the inverse of the given matrix.
+ * @brief Computes the inverse of the given matrix.
*
- * @param[out] out The inverse matrix
+ * @param[out] out The inverse matrix.
* @param[in] in The matrix.
* @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
*
+ * This function inverts the matrix @p in and stores the result in
+ * @p out. No check is done on @p in or @p out. If @p in cannot be
+ * inverted, then @c EINA_FALSE is returned.
+ *
* @since 1.16
*/
EAPI Eina_Bool eina_matrix4_inverse(Eina_Matrix4 *out, const Eina_Matrix4 *in);
/**
- * @brief Returns the transpose of the given matrix.
+ * @brief Computes the transpose of the given matrix.
*
- * @param[out] out The transpose matrix
- * @param[in] in The matrix.
+ * @param[out] out The transposed matrix.
+ * @param[in] in The source matrix.
*
- * Just going to swap row and column.
+ * This function transposes the matrix @p in and stores the result in
+ * @p out. No check is done on @p in or @p out. The transpose of a matrix
+ * essentially flips a matrix over its diagonal.
*
* @since 1.16
*/
@@ -825,9 +855,9 @@ EAPI void eina_matrix4_transpose(Eina_Matrix4 *out, const Eina_Matrix4 *in);
EAPI void eina_matrix4_matrix3_to(Eina_Matrix3 *m3, const Eina_Matrix4 *m4);
/**
- * @brief Sets an identity matrix
+ * @brief Sets the given matrix to identity.
*
- * @param[out] out The matrix to set
+ * @param[out] out The matrix to set.
*
* @since 1.16
*/
@@ -836,9 +866,13 @@ EAPI void eina_matrix4_identity(Eina_Matrix4 *out);
/**
* @brief Multiplies two matrix.
*
- * @param[out] out The resulting matrix
- * @param[in] mat_a The first member of the multiplication
- * @param[in] mat_b The second member of the multiplication
+ * @param[out] out The resulting matrix.
+ * @param[in] mat_a The first member of the multiplication.
+ * @param[in] mat_b The second member of the multiplication.
+ *
+ * Safely multiplies @p mat_a and @p mat_b by checking if the @p out
+ * parameter points to either of them, and if so uses a temporary matrix
+ * for the intermediary calculations.
*
* @since 1.17
*/
@@ -846,12 +880,14 @@ EAPI void eina_matrix4_multiply_copy(Eina_Matrix4 *out,
const Eina_Matrix4 *mat_a, const Eina_Matrix4 *mat_b);
/**
- * @brief Sets array to matrix.
+ * @brief Sets matrix values using an array.
*
- * @param[out] m The result matrix
- * @param[in] v The the array[16] for set
+ * @param[out] m The result matrix.
+ * @param[in] v The the array[16] of values.
*
- * Set to matrix first 16 elements from array
+ * Uses the first 16 elements in the given C array @p v to set the
+ * values in the matrix @p m. The values will be set in the order
+ * of the elements in the Eina_Matrix4 structure.
*
* @since 1.17
*/
@@ -860,8 +896,8 @@ EAPI void eina_matrix4_array_set(Eina_Matrix4 *m, const double *v);
/**
* @brief Copies matrix.
*
- * @param[out] dst The matrix copy
- * @param[in] src The matrix for copy.
+ * @param[out] dst The matrix copy.
+ * @param[in] src The matrix to copy.
*
* @since 1.17
*/
@@ -870,9 +906,9 @@ EAPI void eina_matrix4_copy(Eina_Matrix4 *dst, const Eina_Matrix4 *src);
/**
* @brief Multiplies two matrices with check.
*
- * @param[out] out The resulting matrix
- * @param[in] mat_a The first member of the multiplication
- * @param[in] mat_b The second member of the multiplication
+ * @param[out] out The resulting matrix.
+ * @param[in] mat_a The first member of the multiplication.
+ * @param[in] mat_b The second member of the multiplication.
*
* @since 1.17
*/
@@ -882,13 +918,13 @@ EAPI void eina_matrix4_multiply(Eina_Matrix4 *out, const Eina_Matrix4 *mat_a,
/**
* @brief Sets orthogonality matrix.
*
- * @param[out] m The resulting matrix
- * @param[in] right The right value
- * @param[in] left The left value
- * @param[in] bottom The bottom value
- * @param[in] top The top value
- * @param[in] dnear The dnear value
- * @param[in] dfar The dfar value
+ * @param[out] m The resulting matrix.
+ * @param[in] right The right value.
+ * @param[in] left The left value.
+ * @param[in] bottom The bottom value.
+ * @param[in] top The top value.
+ * @param[in] dnear The dnear value.
+ * @param[in] dfar The dfar value.
*
* @since 1.17
*/
@@ -904,19 +940,19 @@ EAPI void eina_matrix4_ortho_set(Eina_Matrix4 *m,
/**
* @defgroup Eina_Matrix2_Group 2x2 Matrices in floating point
*
- * @brief Matrix definition and operations
+ * @brief Definition and operations for 2x3 matrices.
* @{
*/
/**
* @typedef Eina_Matrix2
- * Floating point matrix2 handler
+ * A 2x2 floating point matrix.
*/
typedef struct _Eina_Matrix2 Eina_Matrix2;
/**
* @struct Eina_Matrix2
- * Floating point matrix2 handler
+ * A 2x2 floating point matrix.
*/
struct _Eina_Matrix2
{
@@ -984,7 +1020,7 @@ EAPI void eina_matrix2_inverse(Eina_Matrix2 *out, const Eina_Matrix2 *mat);
/**
* @brief Sets the given floating point matrix to the identity matrix.
*
- * @param[out] m The floating point matrix to set
+ * @param[out] m The floating point matrix to set.
*
* This function sets @p m to the identity matrix. No check is done on
* @p m.
@@ -996,8 +1032,8 @@ EAPI void eina_matrix2_identity(Eina_Matrix2 *m);
/**
* @brief Sets array to matrix.
*
- * @param[out] m The result matrix
- * @param[in] v The the array[4] for set
+ * @param[out] m The result matrix.
+ * @param[in] v The the array[4] for set.
*
* Set to matrix first 4 elements from array
*
@@ -1008,8 +1044,8 @@ EAPI void eina_matrix2_array_set(Eina_Matrix2 *m, const double *v);
/**
* @brief Copies matrix.
*
- * @param[out] dst The matrix copy
- * @param[in] src The matrix for copy.
+ * @param[out] dst The matrix copy.
+ * @param[in] src The matrix to copy.
*
* @since 1.17
*/
@@ -1018,9 +1054,9 @@ EAPI void eina_matrix2_copy(Eina_Matrix2 *dst, const Eina_Matrix2 *src);
/**
* @brief Multiplies two matrices.
*
- * @param[out] out The resulting matrix
- * @param[in] mat_a The first member of the multiplication
- * @param[in] mat_b The second member of the multiplication
+ * @param[out] out The resulting matrix.
+ * @param[in] mat_a The first member of the multiplication.
+ * @param[in] mat_b The second member of the multiplication.
*
* @since 1.17
*/
@@ -1030,9 +1066,9 @@ EAPI void eina_matrix2_multiply(Eina_Matrix2 *out, const Eina_Matrix2 *mat_a,
/**
* @brief Multiplies two matrices with check.
*
- * @param[out] out The resulting matrix
- * @param[in] mat_a The first member of the multiplication
- * @param[in] mat_b The second member of the multiplication
+ * @param[out] out The resulting matrix.
+ * @param[in] mat_a The first member of the multiplication.
+ * @param[in] mat_b The second member of the multiplication.
*
* @since 1.17
*/
diff --git a/src/lib/eina/eina_matrixsparse.h b/src/lib/eina/eina_matrixsparse.h
index 6d1b98c9e9..e6988c5ab2 100644
--- a/src/lib/eina/eina_matrixsparse.h
+++ b/src/lib/eina/eina_matrixsparse.h
@@ -30,7 +30,13 @@
/**
* @addtogroup Eina_Matrixsparse_Group Sparse Matrix
*
- * @brief These functions provide matrix sparse management.
+ * @brief These functions manage sparse matrices.
+ *
+ * A sparse matrix stores data objects in cells within a row / column
+ * tabular structure, where the majority of cells will be empty. The
+ * sparse matrix takes advantage of this emptiness by allocating memory
+ * only for non-empty cells and, in this implementation, storing them
+ * internally in linked lists.
*
* For more information, you can look at the @ref tutorial_matrixsparse_page.
*/
@@ -76,16 +82,16 @@ typedef struct _Eina_Matrixsparse_Cell Eina_Matrixsparse_Cell;
/**
* @brief Creates a new Sparse Matrix.
*
- * @param rows Number of rows in matrix. Operations with rows greater than this
- * value will fail.
- * @param cols Number of columns in matrix. Operations with columns greater
- * than this value will fail.
- * @param free_func Used to delete cell data contents, used by
+ * @param[in] rows Number of rows in matrix. Operations with rows
+ * greater than this value will fail.
+ * @param[in] cols Number of columns in matrix. Operations with columns
+ * greater than this value will fail.
+ * @param[in] free_func Used to delete cell data contents, used by
* eina_matrixsparse_free(), eina_matrixsparse_size_set(),
* eina_matrixsparse_row_idx_clear(),
* eina_matrixsparse_column_idx_clear(),
* eina_matrixsparse_cell_idx_clear() and possible others.
- * @param user_data Given to @a free_func as first parameter.
+ * @param[in] user_data Given to @a free_func as first parameter.
*
* @return Newly allocated matrix, or @c NULL if allocation failed.
*/
@@ -96,24 +102,25 @@ EAPI Eina_Matrixsparse *eina_matrixsparse_new(unsigned long rows,
const void *user_data);
/**
- * @brief Frees resources allocated for Sparse Matrix.
+ * @brief Frees resources allocated for a Sparse Matrix.
*
- * @param m The Sparse Matrix instance to free, must @b not be @c NULL.
+ * @param[in] m The Sparse Matrix instance to free; must @b not be @c NULL.
*/
EAPI void eina_matrixsparse_free(Eina_Matrixsparse *m);
/* size manipulation */
/**
- * @brief Gets the current size of Sparse Matrix.
+ * @brief Gets the current size of a Sparse Matrix.
*
* The given parameters are guaranteed to be set if they're not @c NULL,
- * even if this function fails (ie: @a m is not a valid matrix instance).
+ * even if this function fails (i.e.: @a m is not a valid matrix instance).
*
- * @param m The sparse matrix to operate on.
- * @param rows Returns the number of rows, may be @c NULL. If @a m is invalid,
- * returned value is zero, otherwise it's a positive integer.
- * @param cols Returns the number of columns, may be @c NULL. If @a m is
+ * @param[in] m The sparse matrix to operate on.
+ * @param[out] rows Returns the number of rows; may be @c NULL. If @a m
+ * is invalid, returned value is zero, otherwise it's a positive
+ * integer.
+ * @param[out] cols Returns the number of columns; may be @c NULL. If @a m is
* invalid, returned value is zero, otherwise it's a positive integer.
*/
EAPI void eina_matrixsparse_size_get(const Eina_Matrixsparse *m,
@@ -123,31 +130,30 @@ EAPI void eina_matrixsparse_size_get(const Eina_Matrixsparse *m,
/**
* @brief Resizes the Sparse Matrix.
*
- * This will resize the sparse matrix, possibly freeing cells on rows
- * and columns that will cease to exist.
+ * This will resize the sparse matrix, potentially freeing cells on rows
+ * and columns that will no longer exist.
*
- * @param m The sparse matrix to operate on.
- * @param rows The new number of rows, must be greater than zero.
- * @param cols The new number of columns, must be greater than zero.
+ * @param[in,out] m The sparse matrix to operate on.
+ * @param[in] rows The new number of rows; must be greater than zero.
+ * @param[in] cols The new number of columns; must be greater than zero.
* @return #EINA_TRUE on success, #EINA_FALSE on failure.
*
* @warning Cells, rows or columns are not reference counted and thus
- * after this call any reference might be invalid if instance were
- * freed.
+ * references to freed instances may become invalid.
*/
EAPI Eina_Bool eina_matrixsparse_size_set(Eina_Matrixsparse *m,
unsigned long rows,
unsigned long cols);
-/* data getting */
+/* Data getting */
/**
- * @brief Gets the cell reference inside Sparse Matrix.
+ * @brief Gets the cell reference inside the Sparse Matrix.
*
- * @param m The sparse matrix to operate on.
- * @param row The new number of row to clear.
- * @param col The new number of column to clear.
- * @param cell Pointer to return cell reference, if any exists.
+ * @param[in] m The sparse matrix.
+ * @param[in] row The new number of row to clear.
+ * @param[in] col The new number of column to clear.
+ * @param[out] cell Pointer to return cell reference, if any exists.
*
* @return @c 1 on success, @c 0 on failure. It is considered successful if did not
* exist but index is inside matrix size, in this case @c *cell == NULL
@@ -160,7 +166,7 @@ EAPI Eina_Bool eina_matrixsparse_cell_idx_get(const Eina_Matrixsparse *m, unsign
/**
* @brief Gets data associated with given cell reference.
*
- * @param cell Given cell reference, must @b not be @c NULL.
+ * @param[in] cell Given cell reference, must @b not be @c NULL.
*
* @return Data associated with given cell.
*
@@ -172,9 +178,9 @@ EAPI void *eina_matrixsparse_cell_data_get(const Eina_Matrixsparse_Cell *cel
/**
* @brief Gets data associated with given cell given its indexes.
*
- * @param m The sparse matrix to operate on.
- * @param row The new number of row to clear.
- * @param col The new number of column to clear.
+ * @param[in] m The sparse matrix to operate on.
+ * @param[in] row The row number.
+ * @param[in] col The column number.
*
* @return Data associated with given cell or @c NULL if nothing is associated.
*
@@ -184,24 +190,25 @@ EAPI void *eina_matrixsparse_cell_data_get(const Eina_Matrixsparse_Cell *cel
EAPI void *eina_matrixsparse_data_idx_get(const Eina_Matrixsparse *m, unsigned long row, unsigned long col);
/**
- * @brief Gets position (indexes) of the given cell.
+ * @brief Gets the row and column position of the given cell.
*
- * @param cell The cell reference, must @b not be @c NULL.
- * @param row Where to store cell row number, may be @c NULL.
- * @param col Where to store cell column number, may be @c NULL.
+ * @param[in] cell The cell reference; must @b not be @c NULL.
+ * @param[out] row The returned row number; may be @c NULL.
+ * @param[out] col The returned column number; may be @c NULL.
*
* @return #EINA_TRUE on success, #EINA_FALSE otherwise (@c cell is @c NULL).
*/
EAPI Eina_Bool eina_matrixsparse_cell_position_get(const Eina_Matrixsparse_Cell *cell, unsigned long *row, unsigned long *col);
-/* data setting */
+
+/* Data setting */
/**
* @brief Changes cell reference value without freeing the possibly existing old value.
*
- * @param cell The cell reference, must @b not be @c NULL.
- * @param data New data to set.
- * @param p_old Returns the old value intact (not freed).
+ * @param[in,out] cell The cell reference; must @b not be @c NULL.
+ * @param[in] data New data to set.
+ * @param[out] p_old Returns the old value intact (not freed).
*
* @return #EINA_TRUE on success, #EINA_FALSE otherwise (@a cell is @c NULL).
*
@@ -211,13 +218,13 @@ EAPI Eina_Bool eina_matrixsparse_cell_position_get(const Eina_Matrixsparse_Cell
EAPI Eina_Bool eina_matrixsparse_cell_data_replace(Eina_Matrixsparse_Cell *cell, const void *data, void **p_old);
/**
- * @brief Changes cell value freeing the possibly existing old value.
+ * @brief Changes cell value, freeing any previously existing value.
*
- * In contrast to eina_matrixsparse_cell_data_replace(), this function will
- * call @c free_func() on existing value.
+ * @param[in,out] cell The cell reference; must @b not be @c NULL.
+ * @param[in] data New data to set.
*
- * @param cell The cell reference, must @b not be @c NULL.
- * @param data New data to set.
+ * In contrast to eina_matrixsparse_cell_data_replace(), this function will
+ * call @c free_func() on the existing value, if one exists.
*
* @return #EINA_TRUE on success, #EINA_FALSE otherwise (@a cell is @c NULL).
*
@@ -227,16 +234,17 @@ EAPI Eina_Bool eina_matrixsparse_cell_data_replace(Eina_Matrixsparse_Cell *cell,
EAPI Eina_Bool eina_matrixsparse_cell_data_set(Eina_Matrixsparse_Cell *cell, const void *data);
/**
- * @brief Changes cell value without freeing the possibly existing old value, using
- * indexes.
+ * @brief Changes cell value at a given row and column position, without
+ * freeing previously existing values.
*
- * @param m The sparse matrix, must @b not be @c NULL.
- * @param row The row number to set the value.
- * @param col The column number to set the value.
- * @param data New data to set.
- * @param p_old returns the old value intact (not freed).
+ * @param[in,out] m The sparse matrix; must @b not be @c NULL.
+ * @param[in] row The row number.
+ * @param[in] col The column number.
+ * @param[in] data New data to set.
+ * @param[out] p_old The previous value, returned intact (not freed).
*
- * @return #EINA_TRUE on success, #EINA_FALSE otherwise (@a m is @c NULL, indexes are not valid).
+ * @return #EINA_TRUE on success, #EINA_FALSE otherwise (@a m is @c NULL,
+ * or row, column indexes are not valid).
*
* @see eina_matrixsparse_cell_data_replace()
* @see eina_matrixsparse_data_idx_set()
@@ -244,16 +252,16 @@ EAPI Eina_Bool eina_matrixsparse_cell_data_set(Eina_Matrixsparse_Cell *cell, con
EAPI Eina_Bool eina_matrixsparse_data_idx_replace(Eina_Matrixsparse *m, unsigned long row, unsigned long col, const void *data, void **p_old);
/**
- * @brief Changes cell value freeing the possibly existing old value, using
- * indexes.
+ * @brief Changes cell value at a given row and column position, freeing
+ * any previously existing value.
*
- * In contrast to eina_matrixsparse_data_idx_replace(), this function will
- * call @c free_func() on existing value.
+ * @param[in,out] m The sparse matrix, must @b not be @c NULL.
+ * @param[in] row The row number to set the value.
+ * @param[in] col The column number to set the value.
+ * @param[in] data New data to set.
*
- * @param m The sparse matrix, must @b not be @c NULL.
- * @param row The row number to set the value.
- * @param col The column number to set the value.
- * @param data New data to set.
+ * In contrast to eina_matrixsparse_data_idx_replace(), this function will
+ * call @c free_func() on the existing value, if one exists.
*
* @return #EINA_TRUE on success, #EINA_FALSE otherwise (@a m is @c NULL, indexes are not valid).
*
@@ -264,21 +272,20 @@ EAPI Eina_Bool eina_matrixsparse_data_idx_set(Eina_Matrixsparse *m, unsigned lon
/* data deleting */
/**
- * @brief Clears (erases all cells) of row given its index.
+ * @brief Clears (erases all cells) of a given row number.
+ *
+ * @param[in,out] m The sparse matrix to operate on.
+ * @param[in] row The row number to clear.
*
* Existing cells will be cleared with @c free_func() given to
* eina_matrixsparse_new().
*
- * @param m The sparse matrix to operate on.
- * @param row The new number of row to clear.
- *
- * @return #EINA_TRUE on success, #EINA_FALSE on failure. It is considered successful if row
- * had no cells filled. Failure is asking for clear row outside
- * matrix size.
+ * @return #EINA_TRUE on success, #EINA_FALSE on failure (such as
+ * requesting a row outside the matrix's defined size). It is
+ * considered successful if the row had no cells filled.
*
* @warning Cells, rows or columns are not reference counted and thus
- * after this call any reference might be invalid if instance were
- * freed.
+ * references to freed instances may become invalid.
*/
EAPI Eina_Bool eina_matrixsparse_row_idx_clear(Eina_Matrixsparse *m, unsigned long row);
@@ -288,71 +295,71 @@ EAPI Eina_Bool eina_matrixsparse_row_idx_clear(Eina_Matrixsparse *m, unsigned lo
* Existing cells will be cleared with @c free_func() given to
* eina_matrixsparse_new().
*
- * @param m The sparse matrix to operate on.
- * @param col The new number of column to clear.
+ * @param[in,out] m The sparse matrix to operate on.
+ * @param[in] col The column number to clear.
*
- * @return #EINA_TRUE on success, #EINA_FALSE on failure. It is considered successful if column
- * had no cells filled. Failure is asking for clear column outside
- * matrix size.
+ * @return #EINA_TRUE on success, #EINA_FALSE on failure (such as
+ * requesting a column outside the matrix's defined size). It is
+ * considered successful if the column had no cells filled.
*
* @warning Cells, rows or columns are not reference counted and thus
- * after this call any reference might be invalid if instance were
- * freed.
+ * references to freed instances may become invalid.
*/
EAPI Eina_Bool eina_matrixsparse_column_idx_clear(Eina_Matrixsparse *m, unsigned long col);
/**
- * @brief Clears (erases) cell given its indexes.
+ * @brief Clears (erases) cell at a given row, column position.
*
- * Existing cell will be cleared with @c free_func() given to
+ * Existing cell will be cleared with the @c free_func() given to
* eina_matrixsparse_new().
*
- * @param m The sparse matrix to operate on.
- * @param row The new number of row to clear.
- * @param col The new number of column to clear.
+ * @param[in,out] m The sparse matrix to operate on.
+ * @param[in] row The row number.
+ * @param[in] col The column number.
*
- * @return #EINA_TRUE on success, #EINA_FALSE on failure. It is considered successful if did not
- * exist but index is inside matrix size.
+ * @return #EINA_TRUE on success, #EINA_FALSE on failure (such as
+ * requesting a row or column outside the matrix's defined size). It
+ * is considered successful if no cell existed at the otherwise
+ * valid position.
*
* @warning Cells, rows or columns are not reference counted and thus
- * after this call any reference might be invalid if instance were
- * freed.
+ * references to freed instances may become invalid.
*
- * @note This call might delete container column and row if this cell was the
- * last remainder.
+ * @note This call might also free the column and/or row if this was the
+ * last remaining cell contained.
*/
EAPI Eina_Bool eina_matrixsparse_cell_idx_clear(Eina_Matrixsparse *m, unsigned long row, unsigned long col);
/**
* @brief Clears (erases) cell given its reference.
*
- * @param cell The cell reference, must @b not be @c NULL.
+ * @param[in,out] cell The cell reference; must @b not be @c NULL.
*
* @return #EINA_TRUE on success, #EINA_FALSE on failure.
*
* @warning Cells, rows or columns are not reference counted and thus
- * after this call any reference might be invalid if instance were
- * freed.
+ * references to freed instances may become invalid.
*
- * @note This call might delete container column and row if this cell was the
- * last remainder.
+ * @note This call might also free the column and/or row if this was the
+ * last remaining cell contained.
*/
EAPI Eina_Bool eina_matrixsparse_cell_clear(Eina_Matrixsparse_Cell *cell);
-/* iterators */
+/* Iterators */
/**
- * @brief Creates a new iterator over existing matrix cells.
+ * @brief Creates a new iterator over only the existing matrix cells.
*
- * This is a cheap walk, it will just report existing cells and holes
- * in the sparse matrix will be ignored. That means the reported
- * indexes will not be sequential.
+ * This is a quick walk over the defined cells; the holes in the Sparse
+ * Matrix are skipped over, thus the returned entries will not have
+ * consecutive index numbers.
*
- * The iterator data will be the cell reference, one may query current
- * position with eina_matrixsparse_cell_position_get() and cell value
- * with eina_matrixsparse_cell_data_get().
+ * The iterator's data element will be the current cell reference. This
+ * cell's position and value can be retrieved with
+ * eina_matrixsparse_cell_position_get() and
+ * eina_matrixsparse_cell_data_get().
*
- * @param m The Sparse Matrix reference, must @b not be @c NULL.
+ * @param[in] m The Sparse Matrix reference; must @b not be @c NULL.
* @return A new iterator.
*
* @warning If the matrix structure changes then the iterator becomes
@@ -364,21 +371,23 @@ EAPI Eina_Iterator *eina_matrixsparse_iterator_new(const Eina_Matrixsparse *m);
/**
* @brief Creates a new iterator over all matrix cells.
*
- * Unlike eina_matrixsparse_iterator_new() this one will report all
- * matrix cells, even those that are still empty (holes). These will
- * be reported as dummy cells that contains no data.
+ * In contrast to eina_matrixsparse_iterator_new(), this routine iterates
+ * across all row and column positions in the matrix, returning dummy cells
+ * with no data where there are empty holes.
*
- * Be aware that iterating a big matrix (1000x1000) will call your
- * function that number of times (1000000 times in that case) even if
- * your matrix have no elements at all!
+ * Be aware that since this iterates over all potential elements of a
+ * Sparse Matrix, not just the elements with actual data, this can result
+ * in a very large number of function calls.
*
- * The iterator data will be the cell reference, one may query current
- * position with eina_matrixsparse_cell_position_get() and cell value
- * with eina_matrixsparse_cell_data_get(). If cell is empty then the
+ * The iterator's data element will be the current cell reference. This
+ * cell's position and value can be retrieved with
+ * eina_matrixsparse_cell_position_get() and
+ * eina_matrixsparse_cell_data_get(). If the cell is empty then the
* reference will be a dummy/placeholder, thus setting value with
- * eina_matrixsparse_cell_data_set() will leave pointer unreferenced.
+ * eina_matrixsparse_cell_data_set() will leave the pointer
+ * unreferenced.
*
- * @param m The Sparse Matrix reference, must @b not be @c NULL.
+ * @param[in] m The Sparse Matrix reference; must @b not be @c NULL.
* @return A new iterator.
*
* @warning If the matrix structure changes then the iterator becomes
diff --git a/src/lib/eina/eina_module.c b/src/lib/eina/eina_module.c
index 493e1a59ff..58f79b5fb6 100644
--- a/src/lib/eina/eina_module.c
+++ b/src/lib/eina/eina_module.c
@@ -565,7 +565,7 @@ EAPI void eina_module_list_load(Eina_Array *array)
Eina_Module *m;
unsigned int i;
- EINA_SAFETY_ON_NULL_RETURN(array);
+ if (!array) return;
DBG("array %p, count %u", array, array->count);
EINA_ARRAY_ITER_NEXT(array, i, m, iterator)
{
@@ -580,7 +580,7 @@ EAPI void eina_module_list_unload(Eina_Array *array)
Eina_Module *m;
unsigned int i;
- EINA_SAFETY_ON_NULL_RETURN(array);
+ if (!array) return;
DBG("array %p, count %u", array, array->count);
EINA_ARRAY_ITER_NEXT(array, i, m, iterator)
eina_module_unload(m);
diff --git a/src/lib/eina/eina_module.h b/src/lib/eina/eina_module.h
index dafdb203ec..773c29cdc9 100644
--- a/src/lib/eina/eina_module.h
+++ b/src/lib/eina/eina_module.h
@@ -210,7 +210,7 @@ EAPI const char *
* @brief Defines if on module load we should expose all symbol
*
* @param module The module to turn off/on symbol to be exposed
- * @param global @c ture to turn on symbol to be exposed, @c false otherwise
+ * @param global @c true to turn on symbol to be exposed, @c false otherwise
* @since 1.11
*/
EAPI void eina_module_symbol_global_set(Eina_Module *module, Eina_Bool global) EINA_ARG_NONNULL(1);
@@ -230,7 +230,7 @@ EAPI void eina_module_symbol_global_set(Eina_Module *module, Eina_Bool global) E
* or allocation fails, this function returns @c NULL.
*/
EAPI char *
- eina_module_symbol_path_get(const void *symbol, const char *sub_dir) EINA_PURE EINA_MALLOC EINA_ARG_NONNULL(1, 2);
+ eina_module_symbol_path_get(const void *symbol, const char *sub_dir) EINA_MALLOC EINA_ARG_NONNULL(1, 2);
/**
* @brief Returns the path built from the value of an environment variable and a
@@ -247,7 +247,7 @@ EAPI char *
* allocation fails, this function returns @c NULL.
*/
EAPI char *
- eina_module_environment_path_get(const char *env, const char *sub_dir) EINA_PURE EINA_MALLOC EINA_ARG_NONNULL(1, 2);
+ eina_module_environment_path_get(const char *env, const char *sub_dir) EINA_MALLOC EINA_ARG_NONNULL(1, 2);
/**
diff --git a/src/lib/eina/eina_prefix.h b/src/lib/eina/eina_prefix.h
index e0f76d7388..549f4620dc 100644
--- a/src/lib/eina/eina_prefix.h
+++ b/src/lib/eina/eina_prefix.h
@@ -44,14 +44,14 @@ typedef struct _Eina_Prefix Eina_Prefix;
* single shared library binaries, but also come with extra modules that they
* have to load, extra binary utilities they need to run, or have data files
* that they need to load. A very primitive application ASSUMES a fixed install
- * location at compile-time, but this disallows the ability to re-locate
+ * location at compile-time, but this disallows the ability to relocate
* the application (or library) somewhere else after compilation (if you run
* out of space on a given disk, partition, etc. for example), or necessitate
* the need for having to maintain environment variables for every piece of
* software to let it know its location, or have to use large sets of
* symlinks pointing from the compiled location to the new one.
*
- * Being re-locatable at runtime allows much easier distribution and
+ * Being relocatable at runtime allows much easier distribution and
* installation into places like the users own home directory, instead of
* on a system partition, if the developer wishes for easier distribution
* of pre-compiled binaries.
@@ -121,7 +121,7 @@ typedef struct _Eina_Prefix Eina_Prefix;
* locale dir. Also note that the magicsharefile is optional for testing and
* ensuring that the prefix check is correct. This file must be installed
* in the application data dir (e.g. /usr/local/share/appname) and be referred
- * to using a unix-style relative path from that dir, eg directory/filename.png)
+ * to using a unix-style relative path from that dir, e.g. directory/filename.png)
*
* @code
* #include <Eina.h>
@@ -173,7 +173,7 @@ EAPI void eina_prefix_free(Eina_Prefix *pfx) EINA_ARG_NONNULL(1);
* @brief Gets the prefix base directory.
*
* @param[in] pfx The prefix object
- * @return The base prefix (eg "/usr/local", "/usr", "/opt/appname" or
+ * @return The base prefix (e.g. "/usr/local", "/usr", "/opt/appname" or
* "/home/user/myapps/appname", etc.) that the software resides in at runtime
*
* @since 1.1.0
@@ -184,7 +184,7 @@ EAPI const char *eina_prefix_get(Eina_Prefix *pfx) EINA_ARG_NONNULL(1) EINA_WARN
* @brief Gets the binary installation directory.
*
* @param[in] pfx The prefix object
- * @return The location of installed binaries (eg "/usr/local/bin",
+ * @return The location of installed binaries (e.g. "/usr/local/bin",
* "/usr/bin", "/opt/appname/bin", "/home/user/myapps/appname/bin" etc.)
*
* @since 1.1.0
@@ -195,7 +195,7 @@ EAPI const char *eina_prefix_bin_get(Eina_Prefix *pfx) EINA_ARG_NONNULL(1) EINA_
* @brief Gets the library installation directory.
*
* @param[in] pfx The prefix object
- * @return The location of installed binaries (eg "/usr/local/lib",
+ * @return The location of installed binaries (e.g. "/usr/local/lib",
* "/usr/lib32", "/opt/appname/lib64", "/home/user/myapps/appname/lib" etc.)
*
* @since 1.1.0
@@ -206,7 +206,7 @@ EAPI const char *eina_prefix_lib_get(Eina_Prefix *pfx) EINA_ARG_NONNULL(1) EINA_
* @brief Gets the data installation directory.
*
* @param[in] pfx The prefix object
- * @return The location of installed binaries (eg "/usr/local/share/appname",
+ * @return The location of installed binaries (e.g. "/usr/local/share/appname",
* "/usr/share/appname", "/opt/appname/share/appname", "/home/user/myapps/appname/share/appname" etc.)
*
* @since 1.1.0
@@ -217,7 +217,7 @@ EAPI const char *eina_prefix_data_get(Eina_Prefix *pfx) EINA_ARG_NONNULL(1) EINA
* @brief Gets the locale installation directory.
*
* @param[in] pfx The prefix object
- * @return The location of installed binaries (eg "/usr/local/share/locale",
+ * @return The location of installed binaries (e.g. "/usr/local/share/locale",
* "/usr/share/locale", "/opt/appname/share/locale", "/home/user/myapps/appname/share/locale" etc.)
*
* @since 1.1.0
diff --git a/src/lib/eina/eina_private.h b/src/lib/eina/eina_private.h
index 402eca3c04..eab59586c1 100644
--- a/src/lib/eina/eina_private.h
+++ b/src/lib/eina/eina_private.h
@@ -96,7 +96,7 @@
#define EINA_MAGIC_CLASS 0x9877CB30
-/* undef the following, we want out version */
+/* undef the following, we want our version */
#undef FREE
#define FREE(ptr) \
do { \
diff --git a/src/lib/eina/eina_promise.c b/src/lib/eina/eina_promise.c
index fbb878447d..516ef5c6b2 100644
--- a/src/lib/eina/eina_promise.c
+++ b/src/lib/eina/eina_promise.c
@@ -315,11 +315,15 @@ _eina_promise_cancel(Eina_Promise *p)
}
static void
-_eina_promise_value_steal_and_link(Eina_Value value, Eina_Future *f)
+_eina_promise_value_steal_and_link(Eina_Future_Scheduler *scheduler,
+ Eina_Value value,
+ Eina_Future *f)
{
Eina_Promise *p = _eina_value_promise_steal(&value);
DBG("Promise %p stolen from value", p);
eina_value_flush(&value);
+ // In the case of continue promise, define a scheduler when steal&link
+ if (!p->scheduler) p->scheduler = scheduler;
if (f) _eina_promise_link(p, f);
else _eina_promise_unlink(p);
}
@@ -377,7 +381,7 @@ _eina_value_is(const Eina_Value v1, const Eina_Value v2)
}
static void
-_eina_future_dispatch(Eina_Future *f, Eina_Value value)
+_eina_future_dispatch(Eina_Future_Scheduler *scheduler, Eina_Future *f, Eina_Value value)
{
Eina_Value next_value = _eina_future_dispatch_internal(&f, value);
if (!_eina_value_is(next_value, value)) eina_value_flush(&value);
@@ -386,7 +390,7 @@ _eina_future_dispatch(Eina_Future *f, Eina_Value value)
if (next_value.type == &EINA_VALUE_TYPE_PROMISE)
{
DBG("There are no more futures, but next_value is a promise setting p->future to NULL.");
- _eina_promise_value_steal_and_link(next_value, NULL);
+ _eina_promise_value_steal_and_link(scheduler, next_value, NULL);
}
else eina_value_flush(&next_value);
return;
@@ -401,19 +405,22 @@ _eina_future_dispatch(Eina_Future *f, Eina_Value value)
eina_value_pget(&next_value, &p);
DBG("Future %p will wait for a new promise %p", f, p);
}
- _eina_promise_value_steal_and_link(next_value, f);
+ _eina_promise_value_steal_and_link(scheduler, next_value, f);
}
- else _eina_future_dispatch(f, next_value);
+ else _eina_future_dispatch(scheduler, f, next_value);
}
static void
_scheduled_entry_cb(Eina_Future *f, Eina_Value value)
{
+ // This function is called by the scheduler, so it has to be defined
+ Eina_Future_Scheduler *scheduler = f->scheduled_entry->scheduler;
+
eina_lock_take(&_pending_futures_lock);
_pending_futures = eina_list_remove(_pending_futures, f);
eina_lock_release(&_pending_futures_lock);
f->scheduled_entry = NULL;
- _eina_future_dispatch(f, value);
+ _eina_future_dispatch(scheduler, f, value);
}
void
@@ -471,6 +478,11 @@ _eina_future_schedule(Eina_Promise *p,
Eina_Future *f,
Eina_Value value)
{
+ if (!p->scheduler)
+ {
+ ERR("Trying to resolve a continue promise during a future callback. Directly return Eina_Value instead.");
+ goto err;
+ }
f->scheduled_entry = p->scheduler->schedule(p->scheduler,
_scheduled_entry_cb,
f, value);
@@ -495,7 +507,8 @@ _eina_promise_deliver(Eina_Promise *p,
{
Eina_Future *f = p->future;
_eina_promise_unlink(p);
- if (value.type == &EINA_VALUE_TYPE_PROMISE) _eina_promise_value_steal_and_link(value, f);
+ if (value.type == &EINA_VALUE_TYPE_PROMISE)
+ _eina_promise_value_steal_and_link(p->scheduler, value, f);
else _eina_future_schedule(p, f, value);
}
else
@@ -553,6 +566,27 @@ __eina_promise_cancel_all(void)
eina_lock_release(&_pending_futures_lock);
}
+EAPI void
+__eina_promise_cancel_data(void *data)
+{
+ Eina_List *del = NULL, *l;
+ Eina_Future *f;
+
+ eina_lock_take(&_pending_futures_lock);
+ EINA_LIST_FOREACH(_pending_futures, l, f)
+ {
+ if (f->data == data)
+ {
+ del = eina_list_append(del, f);
+ }
+ }
+ EINA_LIST_FREE(del, f)
+ {
+ _eina_future_cancel(f, ECANCELED);
+ }
+ eina_lock_release(&_pending_futures_lock);
+}
+
Eina_Bool
eina_promise_shutdown(void)
{
@@ -598,7 +632,8 @@ _eina_promise_clean_dispatch(Eina_Promise *p, Eina_Value v)
{
_eina_promise_value_dbg("Clean contenxt - Resolving promise", p, v);
_eina_promise_unlink(p);
- _eina_future_dispatch(f, v);
+ // This function is called on a promise created with a scheduler, not a continue one.
+ _eina_future_dispatch(p->scheduler, f, v);
}
eina_mempool_free(_promise_mp, p);
}
@@ -607,9 +642,11 @@ static Eina_Value
_future_proxy(void *data, const Eina_Value v,
const Eina_Future *dead_future EINA_UNUSED)
{
- Eina_Value copy;
+ Eina_Value copy = EINA_VALUE_EMPTY;
+
+ if (eina_value_type_get(&v) == EINA_VALUE_TYPE_ERROR) return v;
//We're in a safe context (from mainloop), so we can avoid scheduling a new dispatch
- if (!v.type) copy = v;
+ if (!v.type || !memcmp(&v, &copy, sizeof (Eina_Value))) copy = v;
else if (!eina_value_copy(&v, &copy))
{
ERR("Value cannot be copied - unusable with Eina_Future: %p (%s)", v.type, v.type->name);
@@ -628,9 +665,15 @@ _dummy_cancel(void *data EINA_UNUSED, const Eina_Promise *dead_ptr EINA_UNUSED)
static Eina_Future_Scheduler *
_scheduler_get(Eina_Future *f)
{
- for (; f->prev != NULL; f = f->prev);
- assert(f->promise != NULL);
- return f->promise->scheduler;
+ do
+ {
+ if (f->promise) return f->promise->scheduler;
+ else if (f->scheduled_entry) return f->scheduled_entry->scheduler;
+ f = f->prev;
+ }
+ while (f);
+ assert(EINA_FALSE && "no scheduler for future!");
+ return NULL;
}
EAPI Eina_Value
@@ -693,6 +736,25 @@ eina_promise_new(Eina_Future_Scheduler *scheduler,
return p;
}
+EAPI Eina_Promise *
+eina_promise_continue_new(const Eina_Future *dead_future,
+ Eina_Promise_Cancel_Cb cancel_cb, const void *data)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(cancel_cb, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(dead_future, NULL);
+ EINA_SAFETY_ON_TRUE_RETURN_VAL(dead_future->scheduled_entry != NULL, NULL);
+ EINA_SAFETY_ON_TRUE_RETURN_VAL(dead_future->promise != NULL, NULL);
+
+ Eina_Promise *p = eina_mempool_calloc(_promise_mp, sizeof(Eina_Promise));
+ EINA_SAFETY_ON_NULL_RETURN_VAL(p, NULL);
+ p->cancel = cancel_cb;
+ p->data = data;
+ p->scheduler = NULL;
+ DBG("Creating continuing new promise - Promise:%p, cb: %p, data:%p", p,
+ p->cancel, p->data);
+ return p;
+}
+
EAPI void
eina_future_cancel(Eina_Future *f)
{
diff --git a/src/lib/eina/eina_promise.h b/src/lib/eina/eina_promise.h
index cb5c796317..436856cc1b 100644
--- a/src/lib/eina/eina_promise.h
+++ b/src/lib/eina/eina_promise.h
@@ -465,14 +465,14 @@ struct _Eina_Future_Desc {
*
* A promise may be canceled directly by calling
* @c eina_future_cancel(eina_future_new(eina_promise_new(...)))
- * that is, cancelling any future that is chained to receive the results.
+ * that is, canceling any future that is chained to receive the results.
*
* However promises can be canceled indirectly by other entities.
* These other entities will call `eina_future_cancel()` themselves,
* however you may not be aware of that. Some common sources
* of indirect cancellations:
*
- * @li A subsystem was shutdown, cancelling all pending futures (ie: ecore_shutdown())
+ * @li A subsystem was shutdown, canceling all pending futures (i.e.: ecore_shutdown())
*
* @li An EO object was linked to the promise or future, then if the object dies (last reference
* is gone), then the pending promises and futures will be canceled.
@@ -480,7 +480,7 @@ struct _Eina_Future_Desc {
* @li Some other entity (library provider or library user) chained and canceled his future,
* which will result in your future being canceled.
*
- * Since a promise may be canceled indirectaly (by code sections that goes beyond your scope)
+ * Since a promise may be canceled indirectly (by code sections that goes beyond your scope)
* you should always provide a cancel callback, even if you think you'll not need it.
*
* Here's a typical example:
@@ -531,6 +531,7 @@ struct _Eina_Future_Desc {
* @return A promise or @c NULL on error.
* @see eina_future_cancel()
* @see eina_future_new()
+ * @see eina_promise_continue_new()
* @see eina_promise_resolve()
* @see eina_promise_reject()
* @see eina_promise_data_get()
@@ -543,6 +544,72 @@ struct _Eina_Future_Desc {
EAPI Eina_Promise *eina_promise_new(Eina_Future_Scheduler *scheduler, Eina_Promise_Cancel_Cb cancel_cb, const void *data) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
/**
+ * Creates a new promise from a dead_future.
+ *
+ * This function creates a new promise from a future currently being resolved which can be
+ * used to create a #Eina_Value with eina_promise_as_value(). Every time a promise is
+ * created a #Eina_Promise_Cancel_Cb must be provided which is used to free resources
+ * that were created.
+ *
+ * A promise may be canceled directly by calling
+ * @c eina_future_cancel(eina_future_new(eina_promise_new(...)))
+ * that is, canceling any future that is chained to receive the results.
+ *
+ * However promises can be canceled indirectly by other entities.
+ * These other entities will call `eina_future_cancel()` themselves,
+ * however you may not be aware of that. Some common sources
+ * of indirect cancellations:
+ *
+ * @li A subsystem was shutdown, canceling all pending futures (i.e.: ecore_shutdown())
+ *
+ * @li An EO object was linked to the promise or future, then if the object dies (last reference
+ * is gone), then the pending promises and futures will be canceled.
+ *
+ * @li Some other entity (library provider or library user) chained and canceled his future,
+ * which will result in your future being canceled.
+ *
+ * Since a promise may be canceled indirectly (by code sections that goes beyond your scope)
+ * you should always provide a cancel callback, even if you think you'll not need it.
+ *
+ * Here's a typical example:
+ *
+ * @code
+ *
+ * Eina_Value
+ * _future_resolve(void *data, const Eina_Value v, const Eina_Future *dead_future)
+ * {
+ * Eina_Promise *p;
+ * p = eina_promise_continue_new(dead_future, _promise_cancel, NULL);
+ * return eina_promise_as_value(p);
+ * }
+ * @endcode
+ *
+ * If you already have a value and want to create a future that will
+ * resolve to it directly use the eina_future_resolved(), it has the
+ * same effect as creating a promise and immediately resolving it.
+ *
+ * @note This function is to be used solely inside of a future resolve callback with
+ * the Eina_Value being returned from it.
+ *
+ * @param dead_future The future being resolved to get a scheduler from.
+ * @param cancel_cb A callback used to inform that the promise was canceled. Use
+ * this callback to @c free @p data. @p cancel_cb must not be @c NULL !
+ * @param data Data to @p cancel_cb.
+ * @return A promise or @c NULL on error.
+ * @see eina_future_cancel()
+ * @see eina_future_new()
+ * @see eina_promise_new()
+ * @see eina_promise_resolve()
+ * @see eina_promise_reject()
+ * @see eina_promise_data_get()
+ * @see eina_promise_as_value()
+ * @see #Eina_Future_Scheduler
+ * @see #Eina_Future_Scheduler_Entry
+ * @see #Eina_Future_Scheduler_Cb
+ */
+EAPI Eina_Promise *eina_promise_continue_new(const Eina_Future *dead_future, Eina_Promise_Cancel_Cb cancel_cb, const void *data) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
+
+/**
* Gets the data attached to the promise.
*
* @return The data passed to eina_promise_new() or @c NULL on error.
@@ -733,7 +800,7 @@ EAPI Eina_Value eina_future_as_value(Eina_Future *f)EINA_ARG_NONNULL(1) EINA_WAR
* Creates a new future.
*
* This function creates a new future and can be used to report
- * that an operation has succeded or failed using
+ * that an operation has succeeded or failed using
* eina_promise_resolve() or eina_promise_reject().
*
* Futures can also be canceled using eina_future_cancel(), which
@@ -922,7 +989,7 @@ EAPI Eina_Future *eina_future_rejected(Eina_Future_Scheduler *scheduler, Eina_Er
* // This function is called if future result type does not match or another error occurred
* Eina_Value new_v;
* eina_value_setup(&new_v, EINA_VALUE_TYPE_ERROR);
- * eina_valuse_set(&new_v, err);
+ * eina_value_set(&new_v, err);
* fprintf(stderr, "Error during future process. Reason: %s\n", eina_error_msg_get(err));
* // Pass the error to the next future in the chain..
* return new_v;
@@ -976,7 +1043,7 @@ EAPI Eina_Future *eina_future_then_from_desc(Eina_Future *prev, const Eina_Futur
* is returning. The returned value will be passed to the next future in the chain without
* modifications.
*
- * There're some helper macros like eina_future_cb_log_dbg() which will automatically
+ * There are some helper macros like eina_future_cb_log_dbg() which will automatically
* fill the following fields:
*
* @li #Eina_Future_Cb_Log_Desc::file: The __FILE__ function will be used.
@@ -1054,7 +1121,7 @@ EAPI Eina_Future *eina_future_chain_array(Eina_Future *prev, const Eina_Future_D
/**
- * Wrappper around eina_future_chain_array() and eina_future_cb_easy_from_desc()
+ * Wrapper around eina_future_chain_array() and eina_future_cb_easy_from_desc()
*
* This functions makes it easier to use eina_future_chain_array() with eina_future_cb_easy_from_desc(),
* check the macro eina_future_chain_easy() for a syntax sugar.
@@ -1081,7 +1148,7 @@ EAPI Eina_Future *eina_future_chain_easy_array(Eina_Future *prev, const Eina_Fut
* modifications.
*
* There's also a helper macro called eina_future_cb_console() which makes this
- * fuction easier to use.
+ * function easier to use.
*
* Example:
*
@@ -1143,7 +1210,7 @@ EAPI Eina_Future_Desc eina_future_cb_convert_to(const Eina_Value_Type *type);
/**
* Creates an #Eina_Future_Desc based on a #Eina_Future_Cb_Easy_Desc
*
- * This function aims to be used in conjuction with eina_future_chain(),
+ * This function aims to be used in conjunction with eina_future_chain(),
* eina_future_then_from_desc() and friends and its main objective is to simplify
* error handling and Eina_Value type checks.
* It uses three callbacks to inform the user about the future's
@@ -1529,7 +1596,7 @@ eina_future_race_array(Eina_Future *array[])
#define EINA_FUTURE_SENTINEL ((void *)(unsigned long)-1)
/**
- * A syntatic sugar over eina_promise_race_array().
+ * A syntactic sugar over eina_promise_race_array().
* Usage:
* @code
* promise = eina_promise_race(future1, future2, future3, future4);
@@ -1538,16 +1605,16 @@ eina_future_race_array(Eina_Future *array[])
*/
#define eina_promise_race(...) eina_promise_race_array((Eina_Future *[]){__VA_ARGS__, EINA_FUTURE_SENTINEL})
/**
- * A syntatic sugar over eina_future_race_array().
+ * A syntactic sugar over eina_future_race_array().
* Usage:
* @code
* future = eina_future_race(future1, future2, future3, future4);
* @endcode
- * @see eina_future_racec_array()
+ * @see eina_future_race_array()
*/
#define eina_future_race(...) eina_future_race_array((Eina_Future *[]){__VA_ARGS__, EINA_FUTURE_SENTINEL})
/**
- * A syntatic sugar over eina_future_all_array().
+ * A syntactic sugar over eina_future_all_array().
* Usage:
* @code
* future = eina_future_all(future1, future2, future3, future4);
@@ -1556,7 +1623,7 @@ eina_future_race_array(Eina_Future *array[])
*/
#define eina_future_all(...) eina_future_all_array((Eina_Future *[]){__VA_ARGS__, EINA_FUTURE_SENTINEL})
/**
- * A syntatic sugar over eina_promise_all_array().
+ * A syntactic sugar over eina_promise_all_array().
* Usage:
* @code
* promise = eina_promise_all(future1, future2, future3, future4);
@@ -1565,7 +1632,7 @@ eina_future_race_array(Eina_Future *array[])
*/
#define eina_promise_all(...) eina_promise_all_array((Eina_Future *[]){__VA_ARGS__, EINA_FUTURE_SENTINEL})
/**
- * A syntatic sugar over eina_future_cb_easy_from_desc().
+ * A syntactic sugar over eina_future_cb_easy_from_desc().
* Usage:
* @code
* future_desc = eina_future_cb_easy(_success_cb, _error_cb, _free_cb, EINA_VALUE_TYPE_INT, my_data);
@@ -1574,7 +1641,7 @@ eina_future_race_array(Eina_Future *array[])
*/
#define eina_future_cb_easy(...) eina_future_cb_easy_from_desc((Eina_Future_Cb_Easy_Desc){__VA_ARGS__})
/**
- * A syntatic sugar over eina_future_chain_array().
+ * A syntactic sugar over eina_future_chain_array().
* Usage:
* @code
* future = eina_future_chain(future, {.cb = _my_cb, .data = my_data}, {.cb = _my_another_cb, .data = NULL});
@@ -1583,7 +1650,7 @@ eina_future_race_array(Eina_Future *array[])
*/
#define eina_future_chain(_prev, ...) eina_future_chain_array(_prev, (Eina_Future_Desc[]){__VA_ARGS__, {.cb = NULL, .data = NULL}})
/**
- * A syntatic sugar over eina_future_then_from_desc().
+ * A syntactic sugar over eina_future_then_from_desc().
* Usage:
* @code
* future = eina_future_then(future, _my_cb, my_data);
@@ -1593,7 +1660,7 @@ eina_future_race_array(Eina_Future *array[])
*/
#define eina_future_then(_prev, ...) eina_future_then_from_desc(_prev, (Eina_Future_Desc){__VA_ARGS__})
/**
- * A syntatic sugar over eina_future_cb_console_from_desc().
+ * A syntactic sugar over eina_future_cb_console_from_desc().
* Usage:
* @code
* desc = eina_future_cb_console(.prefix = "prefix", .suffix = "suffix");
@@ -1603,7 +1670,7 @@ eina_future_race_array(Eina_Future *array[])
#define eina_future_cb_console(...) eina_future_cb_console_from_desc((Eina_Future_Cb_Console_Desc){__VA_ARGS__})
/**
- * A syntatic sugar over eina_future_cb_log_from_desc().
+ * A syntactic sugar over eina_future_cb_log_from_desc().
*
* This macro will set the following fields of the #Eina_Future_Cb_Log_Desc:
*
@@ -1624,7 +1691,7 @@ eina_future_race_array(Eina_Future *array[])
__FUNCTION__, EINA_LOG_LEVEL_DBG, EINA_LOG_DOMAIN_DEFAULT, __LINE__})
/**
- * A syntatic sugar over eina_future_cb_log_from_desc().
+ * A syntactic sugar over eina_future_cb_log_from_desc().
*
* This macro will set the following fields of the #Eina_Future_Cb_Log_Desc:
*
@@ -1645,7 +1712,7 @@ eina_future_race_array(Eina_Future *array[])
__FUNCTION__, EINA_LOG_LEVEL_CRITICAL, EINA_LOG_DOMAIN_DEFAULT, __LINE__})
/**
- * A syntatic sugar over eina_future_cb_log_from_desc().
+ * A syntactic sugar over eina_future_cb_log_from_desc().
*
* This macro will set the following fields of the #Eina_Future_Cb_Log_Desc:
*
@@ -1666,7 +1733,7 @@ eina_future_race_array(Eina_Future *array[])
__FUNCTION__, EINA_LOG_LEVEL_ERR, EINA_LOG_DOMAIN_DEFAULT, __LINE__})
/**
- * A syntatic sugar over eina_future_cb_log_from_desc().
+ * A syntactic sugar over eina_future_cb_log_from_desc().
*
* This macro will set the following fields of the #Eina_Future_Cb_Log_Desc:
*
@@ -1687,7 +1754,7 @@ eina_future_race_array(Eina_Future *array[])
__FUNCTION__, EINA_LOG_LEVEL_INFO, EINA_LOG_DOMAIN_DEFAULT, __LINE__})
/**
- * A syntatic sugar over eina_future_cb_log_from_desc().
+ * A syntactic sugar over eina_future_cb_log_from_desc().
*
* This macro will set the following fields of the #Eina_Future_Cb_Log_Desc:
*
@@ -1708,7 +1775,7 @@ eina_future_race_array(Eina_Future *array[])
__FUNCTION__, EINA_LOG_LEVEL_WARN, EINA_LOG_DOMAIN_DEFAULT, __LINE__})
/**
- * A syntatic sugar over eina_future_then() and eina_future_cb_easy().
+ * A syntactic sugar over eina_future_then() and eina_future_cb_easy().
*
* Usage:
* @code
@@ -1722,7 +1789,7 @@ eina_future_race_array(Eina_Future *array[])
#define eina_future_then_easy(_prev, ...) eina_future_then_from_desc(_prev, eina_future_cb_easy(__VA_ARGS__))
/**
- * A syntatic sugar over eina_future_chain() and eina_future_cb_easy().
+ * A syntactic sugar over eina_future_chain() and eina_future_cb_easy().
*
* Usage:
* @code
diff --git a/src/lib/eina/eina_quad.h b/src/lib/eina/eina_quad.h
index 2a8b058bf4..c4cdc9fc90 100644
--- a/src/lib/eina/eina_quad.h
+++ b/src/lib/eina/eina_quad.h
@@ -57,8 +57,8 @@ typedef struct _Eina_Quad
/**
* @brief Transform the given quadrangle to the given rectangle.
*
- * @param q The quadrangle to get coordinates.
- * @param r The rectangle.
+ * @param[in] q The quadrangle to get coordinates.
+ * @param[out] r The rectangle.
*
* @since 1.14
* */
@@ -67,8 +67,8 @@ EAPI void eina_quad_rectangle_to(const Eina_Quad *q,
/**
* @brief Transform the given rectangle to the given quadrangle.
*
- * @param q The quadrangle.
- * @param r The rectangle to get coordinates.
+ * @param[in] q The quadrangle.
+ * @param[out] r The rectangle to get coordinates.
*
* @since 1.14
* */
@@ -77,15 +77,15 @@ EAPI void eina_quad_rectangle_from(Eina_Quad *q,
/**
* @brief Sets the values of the coordinates of the given quadrangle.
*
- * @param q The quadrangle to set coordinates.
- * @param x0 Top left x coordinate.
- * @param y0 Top left y coordinate.
- * @param x1 Top right x coordinate.
- * @param y1 Top right y coordinate.
- * @param x2 Bottom right x coordinate.
- * @param y2 Bottom right y coordinate.
- * @param x3 Bottom left x coordinate.
- * @param y3 Bottom left y coordinate.
+ * @param[out] q The quadrangle to set coordinates.
+ * @param[in] x0 Top left x coordinate.
+ * @param[in] y0 Top left y coordinate.
+ * @param[in] x1 Top right x coordinate.
+ * @param[in] y1 Top right y coordinate.
+ * @param[in] x2 Bottom right x coordinate.
+ * @param[in] y2 Bottom right y coordinate.
+ * @param[in] x3 Bottom left x coordinate.
+ * @param[in] y3 Bottom left y coordinate.
*
* @since 1.14
* */
@@ -98,15 +98,15 @@ EAPI void eina_quad_coords_set(Eina_Quad *q,
/**
* @brief Gets the values of the coordinates of the given quadrangle.
*
- * @param q The quadrangle to get coordinates.
- * @param x0 Top left x coordinate.
- * @param y0 Top left y coordinate.
- * @param x1 Top right x coordinate.
- * @param y1 Top right y coordinate.
- * @param x2 Bottom right x coordinate.
- * @param y2 Bottom right y coordinate.
- * @param x3 Bottom left x coordinate.
- * @param y3 Bottom left y coordinate.
+ * @param[in] q The quadrangle to get coordinates.
+ * @param[out] x0 Top left x coordinate.
+ * @param[out] y0 Top left y coordinate.
+ * @param[out] x1 Top right x coordinate.
+ * @param[out] y1 Top right y coordinate.
+ * @param[out] x2 Bottom right x coordinate.
+ * @param[out] y2 Bottom right y coordinate.
+ * @param[out] x3 Bottom left x coordinate.
+ * @param[out] y3 Bottom left y coordinate.
*
* @since 1.14
* */
diff --git a/src/lib/eina/eina_quadtree.h b/src/lib/eina/eina_quadtree.h
index 2638d8ba59..ad23bc3343 100644
--- a/src/lib/eina/eina_quadtree.h
+++ b/src/lib/eina/eina_quadtree.h
@@ -23,31 +23,179 @@
#include "eina_inlist.h"
-typedef struct _Eina_QuadTree Eina_QuadTree;
+/**
+ * @addtogroup Eina_Data_Types_Group Data Types
+ *
+ * @{
+ */
+
+/**
+ * @typedef Eina_QuadTree
+ *
+ * A quadtree is a data structure where each node contains four child
+ * nodes. It can be used to partition 2D spaces through subdivision
+ * into quadrants.
+ */
+typedef struct _Eina_QuadTree Eina_QuadTree;
+
+/**
+ * @typedef Eina_QuadTree_Item
+ *
+ * A quadtree item is a holder for (void *) data items inside a
+ * quadtree, that includes some state tracking for lifecycle management
+ * and optimization purposes.
+ */
typedef struct _Eina_QuadTree_Item Eina_QuadTree_Item;
+/**
+ * @typedef Eina_Quad_Direction
+ */
typedef enum {
EINA_QUAD_LEFT,
EINA_QUAD_RIGHT,
EINA_QUAD_BOTH
} Eina_Quad_Direction;
+/**
+ * @typedef Eina_Quad_Callback
+ *
+ * Signature for a callback routine used to determine the location of an
+ * object within a quadtree. These are used in sorting by determining
+ * where in the tree the given data @p object belongs, using @p middle
+ * as the division line for the two halves of the space.
+ */
typedef Eina_Quad_Direction (*Eina_Quad_Callback)(const void *object, size_t middle);
-EAPI Eina_QuadTree *eina_quadtree_new(size_t w, size_t h, Eina_Quad_Callback vertical, Eina_Quad_Callback horizontal);
-EAPI void eina_quadtree_free(Eina_QuadTree *q);
-EAPI void eina_quadtree_resize(Eina_QuadTree *q, size_t w, size_t h);
+/**
+ * @brief Constructs a quadtree object.
+ *
+ * @param[in] w The geometric width of the quadtree.
+ * @param[in] h The geometric height of the quadtree.
+ * @param[in] vertical The callback for vertical direction determination.
+ * @param[in] horizontal The callback for horizontal direction determination.
+ * @return The newly allocated and initialized quadtree, or @c NULL on error.
+ *
+ * The vertical and horizontal callbacks are used to assist in
+ * determining which quadrant a given data item belongs to.
+ */
+EAPI Eina_QuadTree *eina_quadtree_new(size_t w, size_t h, Eina_Quad_Callback vertical, Eina_Quad_Callback horizontal);
+
+/**
+ * @brief Destructs quadtree and its data.
+ *
+ * @param[in] q The quadtree to be freed.
+ *
+ * Frees the memory for the Eina_QuadTree object, and any memory used by
+ * its change tracking and garbage collection internals.
+ */
+EAPI void eina_quadtree_free(Eina_QuadTree *q);
-EAPI void eina_quadtree_cycle(Eina_QuadTree *q);
-EAPI void eina_quadtree_increase(Eina_QuadTree_Item *object);
+/**
+ * @brief Changes the width and height of the quadtree.
+ *
+ * @param[in,out] q The quadtree to resize.
+ * @param[in] w The new geometric width for the quadtree.
+ * @param[in] h The new geometric height for the quadtree.
+ *
+ * Sets the width and height of the quadtree, but the actual update is
+ * done lazily.
+ */
+EAPI void eina_quadtree_resize(Eina_QuadTree *q, size_t w, size_t h);
+
+/**
+ * @brief Sets the quadtree's index to 0.
+ *
+ * @param[in,out] q The quadtree to cycle.
+ */
+EAPI void eina_quadtree_cycle(Eina_QuadTree *q);
+
+/**
+ * @brief Increases the index of the quadtree item by one.
+ *
+ * @param[in,out] object The quadtree item to increase.
+ *
+ * If necessary, records that the root is no longer sorted.
+ */
+EAPI void eina_quadtree_increase(Eina_QuadTree_Item *object);
+/**
+ * @brief Inserts a data object into the quadtree.
+ *
+ * @param[in,out] q The quadtree to add @p object to.
+ * @param[in] object A data object to store in the quadtree.
+ * @return Pointer to the stored quadtree item.
+ *
+ * Creates an Eina_QuadTree_Item (or recycles one from the quadtree's
+ * trash) and stores the data @p object in it, then arranges to lazily
+ * insert the item into the quadtree (i.e. insertion is delayed until
+ * it needs to be used.)
+ */
EAPI Eina_QuadTree_Item *eina_quadtree_add(Eina_QuadTree *q, const void *object);
-EAPI Eina_Bool eina_quadtree_del(Eina_QuadTree_Item *object);
-EAPI Eina_Bool eina_quadtree_change(Eina_QuadTree_Item *object);
-EAPI Eina_Bool eina_quadtree_hide(Eina_QuadTree_Item *object);
-EAPI Eina_Bool eina_quadtree_show(Eina_QuadTree_Item *object);
-EAPI Eina_Inlist *eina_quadtree_collide(Eina_QuadTree *q, int x, int y, int w, int h);
-EAPI void *eina_quadtree_object(Eina_Inlist *list);
+/**
+ * @brief Deletes a given quadtree item from the quadtree.
+ *
+ * @param[in] object The quadtree item to be deleted.
+ * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
+ *
+ * Moves the item to the quadtree's internal garbage heap for later
+ * reclamation.
+ */
+EAPI Eina_Bool eina_quadtree_del(Eina_QuadTree_Item *object);
+
+/**
+ * @brief Marks an object within the quadtree as needing changed.
+ *
+ * @param[in,out] object The object that has changed.
+ * @return #EINA_TRUE if change successfully noted, or #EINA_FALSE otherwise.
+ */
+EAPI Eina_Bool eina_quadtree_change(Eina_QuadTree_Item *object);
+
+/**
+ * @brief Sets @p object invisible.
+ *
+ * @param[in,out] object The item within the quadtree to hide.
+ * @return #EINA_TRUE if @p object was successfully hidden, or
+ * #EINA_FALSE if it wasn't in the quadtree.
+ */
+EAPI Eina_Bool eina_quadtree_hide(Eina_QuadTree_Item *object);
+
+/**
+ * @brief Sets @p object to visible.
+ *
+ * @param[in,out] object The item within the quadtree to show.
+ * @return #EINA_TRUE if @p object was successfully shown, or
+ * #EINA_FALSE if it wasn't in the quadtree.
+ */
+EAPI Eina_Bool eina_quadtree_show(Eina_QuadTree_Item *object);
+
+/**
+ * @brief Retrieves items in quadtree inside the target geometry.
+ *
+ * @param[in,out] q The quadtree to recompute.
+ * @param[in] x New target X coordinate.
+ * @param[in] y New target Y coordinate.
+ * @param[in] w New target width.
+ * @param[in] h New target height.
+ * @return The list of collided items or @c NULL on error.
+ *
+ * Forces a rebuild and resort of the quadtree if needed due to pending
+ * changes, then performs a collision detection to find items whose
+ * geometry is contained within or intersects the given target geometry.
+ */
+EAPI Eina_Inlist *eina_quadtree_collide(Eina_QuadTree *q, int x, int y, int w, int h);
+
+/**
+ * @brief Retrieves the quadtree item's data for the given inline list.
+ *
+ * @param[in] list The inline list item to lookup
+ * @return The contained data object in the Eina_QuadTree_Item, or @c
+ * NULL if none could be found.
+ */
+EAPI void *eina_quadtree_object(Eina_Inlist *list);
+
+/**
+ * @}
+ */
#endif
diff --git a/src/lib/eina/eina_quaternion.h b/src/lib/eina/eina_quaternion.h
index 156d12b213..dc08acf997 100644
--- a/src/lib/eina/eina_quaternion.h
+++ b/src/lib/eina/eina_quaternion.h
@@ -167,7 +167,7 @@ EAPI void eina_quaternion_inverse(Eina_Quaternion *out, const Eina_Quaternion *q
EAPI void eina_quaternion_array_set(Eina_Quaternion *dst, const double *v);
/**
- * @brief Copy quternion.
+ * @brief Copy quaternion.
*
* @param dst The quaternion copy
* @param src The quaternion for copy.
diff --git a/src/lib/eina/eina_rectangle.c b/src/lib/eina/eina_rectangle.c
index b6eadeb2f4..c7b89b524a 100644
--- a/src/lib/eina/eina_rectangle.c
+++ b/src/lib/eina/eina_rectangle.c
@@ -598,20 +598,21 @@ eina_rectangle_shutdown(void)
EAPI Eina_Rectangle *
eina_rectangle_new(int x, int y, int w, int h)
{
- Eina_Rectangle *rect;
+ Eina_Rectangle *rect = NULL;
if (_eina_rectangles)
{
eina_spinlock_take(&_eina_spinlock);
rect = eina_trash_pop(&_eina_rectangles);
- eina_spinlock_release(&_eina_spinlock);
_eina_rectangles_count--;
+ eina_spinlock_release(&_eina_spinlock);
}
- else
- rect = eina_mempool_malloc(_eina_rectangle_mp, sizeof (Eina_Rectangle));
if (!rect)
- return NULL;
+ rect = eina_mempool_malloc(_eina_rectangle_mp, sizeof (Eina_Rectangle));
+
+ if (!rect)
+ return NULL;
EINA_RECTANGLE_SET(rect, x, y, w, h);
@@ -629,8 +630,8 @@ eina_rectangle_free(Eina_Rectangle *rect)
{
eina_spinlock_take(&_eina_spinlock);
eina_trash_push(&_eina_rectangles, rect);
- eina_spinlock_release(&_eina_spinlock);
_eina_rectangles_count++;
+ eina_spinlock_release(&_eina_spinlock);
}
}
diff --git a/src/lib/eina/eina_rectangle.h b/src/lib/eina/eina_rectangle.h
index 24a03e7dc5..10ff050efc 100644
--- a/src/lib/eina/eina_rectangle.h
+++ b/src/lib/eina/eina_rectangle.h
@@ -50,13 +50,13 @@
#define EINA_POSITION2D(x, y) ((Eina_Position2D) { (x), (y) })
#define EINA_SIZE2D(x, y) ((Eina_Size2D) { (x), (y) })
-/** @brief A 2D position in pixels coordinates */
+/** @brief A 2D position in pixel coordinates */
typedef struct _Eina_Position2D
{
int x, y;
} Eina_Position2D;
-/** @brief A 2D size in pixels coordinates */
+/** @brief A 2D size in pixel coordinates */
typedef struct _Eina_Size2D
{
int w, h;
@@ -88,13 +88,13 @@ typedef union _Eina_Rect
/**
* @typedef Eina_Rectangle_Pool
- * Type for an opaque pool of rectangle.
+ * Type for an opaque pool of rectangles.
*/
typedef struct _Eina_Rectangle_Pool Eina_Rectangle_Pool;
/**
* @typedef Eina_Rectangle_Packing
- * Type for an Eina Pool based on packing algorithm.
+ * Type for an Eina Pool based on a packing algorithm.
* @since 1.11
*/
typedef enum {
@@ -107,7 +107,7 @@ typedef enum {
/**
* @typedef Eina_Rectangle_Outside
- * Enumeration gives the positions where a rectangle can be outside another rectangle
+ * Enumeration of the positions around a rectangle.
* @since 1.19
*/
typedef enum {
@@ -125,92 +125,86 @@ typedef enum {
* @param l1 The length of the first span.
* @param c2 The column of the second span.
* @param l2 The length of the second span.
- * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
- *
- * This function returns #EINA_TRUE if the given spans intersect, #EINA_FALSE
- * otherwise.
+ * @return #EINA_TRUE if the given spans intersect, #EINA_FALSE otherwise.
*/
static inline int eina_spans_intersect(int c1, int l1, int c2, int l2) EINA_WARN_UNUSED_RESULT;
/**
* @brief Checks if the given rectangle is empty.
*
- * @param r The rectangle to check.
- * @return #EINA_TRUE if the rectangle is empty, #EINA_FALSE otherwise.
+ * @param rect The rectangle to check.
+ * @return #EINA_TRUE if the rectangle @p r is empty, #EINA_FALSE
+ * otherwise.
*
- * This function returns #EINA_TRUE if @p r is empty, #EINA_FALSE
- * otherwise. No check is done on @p r, so it must be a valid
- * rectangle.
+ * No check is done on @p r, so it must be a valid rectangle.
*/
-static inline Eina_Bool eina_rectangle_is_empty(const Eina_Rectangle *r) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+static inline Eina_Bool eina_rectangle_is_empty(const Eina_Rectangle *rect) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
/**
- * @brief Sets the coordinates and size of the given rectangle.
+ * @brief Sets the coordinates and size of a rectangle.
*
- * @param r The rectangle.
- * @param x The top-left x coordinate of the rectangle.
- * @param y The top-left y coordinate of the rectangle.
+ * @param rect The rectangle.
+ * @param x The X coordinate of the rectangle's top-left corner.
+ * @param y The Y coordinate of the rectangle's top-left corner.
* @param w The width of the rectangle.
* @param h The height of the rectangle.
*
- * This function sets its top-left x coordinate to @p x, its top-left
- * y coordinate to @p y, its width to @p w and its height to @p h. No
- * check is done on @p r, so it must be a valid rectangle.
+ * This function sets its top-left X coordinate to @p x, its top-left
+ * Y coordinate to @p y, its width to @p w and its height to @p h.
+ *
+ * No check is done on @p r, so it must be a valid rectangle.
*/
-static inline void eina_rectangle_coords_from(Eina_Rectangle *r, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
+static inline void eina_rectangle_coords_from(Eina_Rectangle *rect, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
/**
- * @brief Checks if the given rectangles intersect.
+ * @brief Checks if two rectangles intersect.
*
- * @param r1 The first rectangle.
- * @param r2 The second rectangle.
- * @return #EINA_TRUE if the rectangles intersect, #EINA_FALSE otherwise.
+ * @param rect1 The first rectangle.
+ * @param rect2 The second rectangle.
+ * @return #EINA_TRUE if the rectangles @p rect1 and @p rect2 intersect,
+ * #EINA_FALSE otherwise.
*
- * This function returns #EINA_TRUE if @p r1 and @p r2 intersect, #EINA_FALSE
- * otherwise. No check is done on @p r1 and @p r2, so they must be valid
+ * No check is done on @p rect1 and @p rect2, so they must be valid
* rectangles.
*/
-static inline Eina_Bool eina_rectangles_intersect(const Eina_Rectangle *r1, const Eina_Rectangle *r2) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
+static inline Eina_Bool eina_rectangles_intersect(const Eina_Rectangle *rect1, const Eina_Rectangle *rect2) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
/**
- * @brief Checks if the given x-coordinate is in the rectangle.
+ * @brief Checks if the given X-coordinate is in the rectangle.
*
- * @param r The rectangle.
- * @param x The x coordinate.
- * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
+ * @param rect The rectangle.
+ * @param x The X coordinate.
+ * @return #EINA_TRUE if @p x is between the rectangle's left and right
+ * edges, #EINA_FALSE otherwise.
*
- * This function returns #EINA_TRUE if @p x is in @p r with respect to
- * the horizontal direction, #EINA_FALSE otherwise. No check is done
- * on @p r, so it must be a valid rectangle.
+ * No check is done on @p r, so it must be a valid rectangle.
*/
-static inline Eina_Bool eina_rectangle_xcoord_inside(const Eina_Rectangle *r, int x) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+static inline Eina_Bool eina_rectangle_xcoord_inside(const Eina_Rectangle *rect, int x) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
/**
- * @brief Checks if the given y-coordinate is in the rectangle.
+ * @brief Checks if the given Y-coordinate is in the rectangle.
*
- * @param r The rectangle.
- * @param y The y coordinate.
- * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
+ * @param rect The rectangle.
+ * @param y The Y coordinate.
+ * @return #EINA_TRUE if @p y is between the rectangle's top and bottom
+ * edges, #EINA_FALSE otherwise.
*
- * This function returns #EINA_TRUE if @p y is in @p r with respect to
- * the vertical direction, #EINA_FALSE otherwise. No check is done
- * on @p r, so it must be a valid rectangle.
+ * No check is done on @p r, so it must be a valid rectangle.
*/
-static inline Eina_Bool eina_rectangle_ycoord_inside(const Eina_Rectangle *r, int y) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+static inline Eina_Bool eina_rectangle_ycoord_inside(const Eina_Rectangle *rect, int y) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
/**
- * @brief Checks if the given point is in the rectangle.
+ * @brief Checks if the given point is inside the rectangle.
*
- * @param r The rectangle.
+ * @param rect The rectangle.
* @param x The x coordinate of the point.
* @param y The y coordinate of the point.
- * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
+ * @return #EINA_TRUE if the point (@p x, @p y) is within the edges of
+ * @p r, #EINA_FALSE otherwise.
*
- * This function returns #EINA_TRUE if the point of coordinate (@p x,
- * @p y) is in @p r, #EINA_FALSE otherwise. No check is done on @p r,
- * so it must be a valid rectangle.
+ * No check is done on @p r, so it must be a valid rectangle.
*/
-static inline Eina_Bool eina_rectangle_coords_inside(const Eina_Rectangle *r, int x, int y) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+static inline Eina_Bool eina_rectangle_coords_inside(const Eina_Rectangle *rect, int x, int y) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
/**
* @brief Gets the union of two rectangles.
@@ -218,9 +212,11 @@ static inline Eina_Bool eina_rectangle_coords_inside(const Eina_Rectangle *r,
* @param dst The first rectangle.
* @param src The second rectangle.
*
- * This function gets the union of the rectangles @p dst and @p src. The
- * result is stored in @p dst. No check is done on @p dst or @p src,
- * so they must be valid rectangles.
+ * Changes @p dst to be the bounding box of both rectangles @p dst and
+ * @p src.
+ *
+ * No check is done on @p dst or @p src, so they must be valid
+ * rectangles.
*/
static inline void eina_rectangle_union(Eina_Rectangle *dst, const Eina_Rectangle *src) EINA_ARG_NONNULL(1, 2);
@@ -232,9 +228,12 @@ static inline void eina_rectangle_union(Eina_Rectangle *dst, const Eina_R
* @return #EINA_TRUE if the rectangles intersect, #EINA_FALSE
* otherwise.
*
- * This function gets the intersection of the rectangles @p dst and
- * @p src. The result is stored in @p dst. No check is done on @p dst
- * or @p src, so they must be valid rectangles.
+ * Changes @p dst to be the rectangle represented by the intersection of
+ * @p dst and @p src. @p dst is unchanged if the two rectangles do not
+ * intersect.
+ *
+ * No check is done on @p dst or @p src, so they must be valid
+ * rectangles.
*/
static inline Eina_Bool eina_rectangle_intersection(Eina_Rectangle *dst, const Eina_Rectangle *src) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
@@ -259,123 +258,112 @@ static inline void eina_rectangle_rescale_in(const Eina_Rectangle *out, c
static inline void eina_rectangle_rescale_out(const Eina_Rectangle *out, const Eina_Rectangle *in, Eina_Rectangle *res) EINA_ARG_NONNULL(1, 2, 3);
/**
- * @brief Tells whether a rectangle is valid or not.
+ * @brief Tells whether a rectangle is valid.
*
- * @param r The rectangle
+ * @param rect The rectangle.
* @return #EINA_TRUE if the rectangle is valid, #EINA_FALSE otherwise.
*
* This function checks if both width and height attributes of the rectangle are
* positive integers. If so, the rectangle is considered valid, else the
* rectangle is invalid.
*/
-static inline Eina_Bool eina_rectangle_is_valid(const Eina_Rectangle *r) EINA_ARG_NONNULL(1);
+static inline Eina_Bool eina_rectangle_is_valid(const Eina_Rectangle *rect) EINA_ARG_NONNULL(1);
/**
- * @brief Gives the rectangle maximum x coordinate.
+ * @brief Gets the rectangle's maximum X coordinate.
*
- * @param thiz The rectangle
- * @return The maximum x coordinate
+ * @param rect The rectangle.
+ * @return The maximum X coordinate.
*
- * This function calculates the maximum x coordinate of the rectangle by summing
+ * This function calculates the maximum X coordinate of the rectangle by summing
* the @p width with the current @p x coordinate of the rectangle.
*/
-static inline int eina_rectangle_max_x(Eina_Rectangle *thiz) EINA_ARG_NONNULL(1);
+static inline int eina_rectangle_max_x(Eina_Rectangle *rect) EINA_ARG_NONNULL(1);
/**
- * @brief Gives the rectangle maximum y coordinate.
+ * @brief Gets the rectangle maximum Y coordinate.
*
- * @param thiz The rectangle
- * @return The maximum y coordinate
+ * @param rect The rectangle.
+ * @return The maximum Y coordinate.
*
- * This function calculates the maximum y coordinate of the rectangle by summing
- * the @p height with the current @p y coodinate of the rectangle.
+ * This function calculates the maximum Y coordinate of the rectangle by summing
+ * the @p height with the current @p y coordinate of the rectangle.
*/
-static inline int eina_rectangle_max_y(Eina_Rectangle *thiz) EINA_ARG_NONNULL(1);
+static inline int eina_rectangle_max_y(Eina_Rectangle *rect) EINA_ARG_NONNULL(1);
/**
- * @brief Slices a rectangle vertically into two subrectangles starting from left edge.
+ * @brief Slices a rectangle vertically into two subrectangles.
*
- * @param thiz The rectangle to slice
- * @param slice The sliced part of the rectangle
- * @param remainder The left over part of the original rectangle after slice
- * @param amount The x inner coordinate of the rectangle where to perform the
- * slicing.
- * @return #EINA_TRUE if the cut succeeds, #EINA_FALSE otherwise
+ * @param rect The rectangle to slice.
+ * @param slice The sliced part of the rectangle.
+ * @param remainder The left over part of the rectangle after slicing.
+ * @param amount The slice location's horizontal distance from the left.
+ * @return #EINA_TRUE if the cut succeeds, #EINA_FALSE otherwise.
*
- * Use this function if we must cut a rectangle vertically. The @p amount
- * parameter defines the x inner coordinate where to do the cut, starting from
- * the left edge of the rectangle. If the @p amount value is greater than the
- * rectangle width, there will be no cut possible and #EINA_FALSE will be
- * returned.
+ * Cut a rectangle vertically at a distance @p amount from the
+ * rectangle's left edge. If the @p amount value is greater than the
+ * rectangle's width, no cut is performed and #EINA_FALSE is returned.
*/
-static inline Eina_Bool eina_rectangle_x_cut(Eina_Rectangle *thiz, Eina_Rectangle *slice, Eina_Rectangle *remainder, int amount) EINA_ARG_NONNULL(1);
+static inline Eina_Bool eina_rectangle_x_cut(Eina_Rectangle *rect, Eina_Rectangle *slice, Eina_Rectangle *remainder, int amount) EINA_ARG_NONNULL(1);
/**
- * @brief Slices a rectangle horizontally into two subrectangles starting from bottom edge
+ * @brief Slices a rectangle horizontally into two subrectangles.
*
- * @param thiz The rectangle to slice
- * @param slice The sliced part of the rectangle
- * @param remainder The left over part of the original rectangle after slice
- * @param amount The y inner coordinate of the rectangle where to perform the
- * slicing.
+ * @param rect The rectangle to slice.
+ * @param slice The sliced part of the rectangle.
+ * @param remainder The left over part of the rectangle after slicing.
+ * @param amount The slice location's vertical distance from the bottom.
* @return #EINA_TRUE if the cut succeeds, #EINA_FALSE otherwise
*
- * Use this function if we must cut a rectangle horizontally. The @p amount
- * parameter defines the y inner coordinate where to do the cut, starting from
- * the bottom edge of the rectangle. If the @p amount value is greater than the
- * rectangle width, there will be no cut possible and #EINA_FALSE will be
- * returned.
+ * Cut a rectangle horizontally at a distance @p amount from the
+ * rectangle's bottom edge. If the @p amount value is greater than the
+ * rectangle's height, no cut is performed and #EINA_FALSE is returned.
*/
-static inline Eina_Bool eina_rectangle_y_cut(Eina_Rectangle *thiz, Eina_Rectangle *slice, Eina_Rectangle *remainder, int amount) EINA_ARG_NONNULL(1);
+static inline Eina_Bool eina_rectangle_y_cut(Eina_Rectangle *rect, Eina_Rectangle *slice, Eina_Rectangle *remainder, int amount) EINA_ARG_NONNULL(1);
/**
- * @brief Slices a rectangle vertically starting from right edge
+ * @brief Slices a rectangle vertically starting from right edge.
*
- * @param thiz The rectangle to slice
- * @param slice The sliced part of the rectangle
- * @param remainder The left over part of the original rectangle after slice
- * @param amount The amount to cut off the rectangle starting from the right
- * edge
+ * @param rect The rectangle to slice.
+ * @param slice The sliced part of the rectangle.
+ * @param remainder The left over part of the rectangle after slicing.
+ * @param amount The slice location's horizontal distance from the right.
* @return #EINA_TRUE if the cut succeeds, #EINA_FALSE otherwise
*
- * Use this function if we must cut a rectangle vertically. The @p amount
- * parameter defines the inner x coordinate where to do the cut, starting from
- * the right edge of the rectangle. If the @p amount value is greater than the
- * rectangle width, there will be no cut possible and #EINA_FALSE will be
- * returned.
+ * Cut a rectangle vertically at a distance @p amount from the
+ * rectangle's right edge. If the @p amount value is greater than the
+ * rectangle's width, no cut is performed and #EINA_FALSE is returned.
*/
-static inline Eina_Bool eina_rectangle_width_cut(Eina_Rectangle *thiz, Eina_Rectangle *slice, Eina_Rectangle *remainder, int amount) EINA_ARG_NONNULL(1);
+static inline Eina_Bool eina_rectangle_width_cut(Eina_Rectangle *rect, Eina_Rectangle *slice, Eina_Rectangle *remainder, int amount) EINA_ARG_NONNULL(1);
/**
- * @brief Slices a rectangle horizontally starting from top edge
+ * @brief Slices a rectangle horizontally starting from top edge.
*
- * @param thiz The rectangle to slice
- * @param slice The sliced part of the rectangle
- * @param remainder The left over part of the original rectangle after slice
- * @param amount The amount to cut off the rectangle starting from the top edge
- * @return #EINA_TRUE if the cut succeeds, #EINA_FALSE otherwise
+ * @param rect The rectangle to slice.
+ * @param slice The sliced part of the rectangle.
+ * @param remainder The left over part of the rectangle after slicing.
+ * @param amount The slice location's vertical distance from the top.
+ * @return #EINA_TRUE if the cut succeeds, #EINA_FALSE otherwise.
*
- * Use this function if we must cut a rectangle horizontally. The @p amount
- * parameter defines the inner y coordinate where to do the cut, starting from
- * the top edge of the rectangle. If the @p amount value is greater than the
- * rectangle width, there will be no cut possible and #EINA_FALSE will be
- * returned.
+ * Cut a rectangle horizontally at a distance @p amount from the
+ * rectangle's top edge. If the @p amount value is greater than the
+ * rectangle width, no cut is performed and #EINA_FALSE is returned.
*/
-static inline Eina_Bool eina_rectangle_height_cut(Eina_Rectangle *thiz, Eina_Rectangle *slice, Eina_Rectangle *remainder, int amount) EINA_ARG_NONNULL(1);
+static inline Eina_Bool eina_rectangle_height_cut(Eina_Rectangle *rect, Eina_Rectangle *slice, Eina_Rectangle *remainder, int amount) EINA_ARG_NONNULL(1);
/**
- * @brief Subtracts two rectangles.
+ * @brief Subtracts two rectangles and returns the differences.
*
- * @param thiz The minuend rectangle.
+ * @param rect The minuend rectangle.
* @param other The subtrahend rectangle.
- * @param out Stored the difference between two rectangles.
+ * @param out An array of differences between the two rectangles.
* @return #EINA_TRUE on success, #EINA_FALSE otherwise.
*
- * This function subtract two rectangles. The difference is stored on @p out
- * There will be at most four differences, use eina_rectangle_is_valid to
- * confirm the number of differences.
+ * This function subtracts two rectangles and stores the resulting
+ * differences into the @p out array. There will be at most four
+ * differences; use eina_rectangle_is_valid to confirm the exact number.
*/
-static inline Eina_Bool eina_rectangle_subtract(Eina_Rectangle *thiz, Eina_Rectangle *other, Eina_Rectangle out[4]) EINA_ARG_NONNULL(1);
+static inline Eina_Bool eina_rectangle_subtract(Eina_Rectangle *rect, Eina_Rectangle *other, Eina_Rectangle out[4]) EINA_ARG_NONNULL(1);
/**
* @brief Adds a rectangle in a new pool.
@@ -491,13 +479,13 @@ EAPI void eina_rectangle_pool_release(Eina_Rectangle *rect) EINA
* @def EINA_RECTANGLE_SET
* @brief Definition for the macro to set the values of a #Eina_Rectangle.
*
- * @param Rectangle The rectangle to set the values.
+ * @param Rectangle The rectangle.
* @param X The X coordinate of the top left corner of the rectangle.
* @param Y The Y coordinate of the top left corner of the rectangle.
* @param W The width of the rectangle.
* @param H The height of the rectangle.
*
- * This macro set the values of @p Rectangle. (@p X, @p Y) is the
+ * This macro set the values of @p Rectangle. @p X and @p Y are the
* coordinates of the top left corner of @p Rectangle, @p W is its
* width and @p H is its height.
*/
@@ -509,7 +497,7 @@ EAPI void eina_rectangle_pool_release(Eina_Rectangle *rect) EINA
(Rectangle)->h = H; \
}
-#define EINA_RECT_SET(r, x, y, w, h) do { EINA_RECTANGLE_SET((&r), x, y, w, h) } while (0)
+#define EINA_RECT_SET(rect, x, y, w, h) do { EINA_RECTANGLE_SET((&rect), x, y, w, h) } while (0)
/**
@@ -523,8 +511,9 @@ EAPI void eina_rectangle_pool_release(Eina_Rectangle *rect) EINA
*
* This function creates a rectangle whose top left corner has the
* coordinates (@p x, @p y), with height @p w and height @p h and adds
- * it to the rectangles pool. No check is done on @p w and @p h. This
- * function returns a new rectangle on success, @c NULL otherwise.
+ * it to the rectangles pool.
+ *
+ * No check is done on @p w and @p h.
*/
EAPI Eina_Rectangle *eina_rectangle_new(int x, int y, int w, int h) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
@@ -565,9 +554,9 @@ EAPI Eina_Rectangle_Outside eina_rectangle_outside_position(Eina_Rectangle *rect
*
* @param rect1 First rectangle. Must not be NULL.
* @param rect2 Second rectangle. Must not be NULL.
- *
* @return EINA_TRUE if the rectangles are equal (x, y, w and h are all equal).
- * No safety check is made on the rectangles, so they should be valid and non
+ *
+ * No check is made on the rectangles, so they should be valid and non
* NULL for this function to be meaningful.
*
* @since 1.21
diff --git a/src/lib/eina/eina_safepointer.c b/src/lib/eina/eina_safepointer.c
index 94ec1ab557..8f9d4b62a9 100644
--- a/src/lib/eina/eina_safepointer.c
+++ b/src/lib/eina/eina_safepointer.c
@@ -2,6 +2,11 @@
# include "config.h"
#endif
+#ifdef HAVE_VALGRIND
+# include <valgrind.h>
+# include <memcheck.h>
+#endif
+
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
@@ -66,26 +71,32 @@ static void *
_eina_safepointer_calloc(int number, size_t size)
{
#ifdef HAVE_MMAP
- Eina_Memory_Header *header;
- size_t newsize;
+# ifdef HAVE_VALGRIND
+ if (RUNNING_ON_VALGRIND) return calloc(number, size);
+ else
+# endif
+ {
+ Eina_Memory_Header *header;
+ size_t newsize;
- size = size * number + sizeof (Eina_Memory_Header);
- newsize = ((size / MEM_PAGE_SIZE) +
- (size % MEM_PAGE_SIZE ? 1 : 0))
- * MEM_PAGE_SIZE;
+ size = size * number + sizeof (Eina_Memory_Header);
+ newsize = ((size / MEM_PAGE_SIZE) +
+ (size % MEM_PAGE_SIZE ? 1 : 0))
+ * MEM_PAGE_SIZE;
- header = mmap(NULL, newsize, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_ANON, -1, 0);
- if (header == MAP_FAILED)
- {
- ERR("mmap of Eina_Safepointer table region failed.");
- return NULL;
- }
+ header = mmap(NULL, newsize, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANON, -1, 0);
+ if (header == MAP_FAILED)
+ {
+ ERR("mmap of Eina_Safepointer table region failed.");
+ return NULL;
+ }
- header->size = newsize;
- EINA_MAGIC_SET(header, SAFEPOINTER_MAGIC);
+ header->size = newsize;
+ EINA_MAGIC_SET(header, SAFEPOINTER_MAGIC);
- return (void*)(header + 1);
+ return (void *)(header + 1);
+ }
#else
return calloc(number, size);
#endif
@@ -95,18 +106,24 @@ static void
_eina_safepointer_free(void *pointer)
{
#ifdef HAVE_MMAP
- Eina_Memory_Header *header;
+# ifdef HAVE_VALGRIND
+ if (RUNNING_ON_VALGRIND) free((void *)((uintptr_t) pointer & ~0x3));
+ else
+# endif
+ {
+ Eina_Memory_Header *header;
- if (!pointer) return ;
+ if (!pointer) return;
- header = (Eina_Memory_Header*)(pointer) - 1;
- if (!EINA_MAGIC_CHECK(header, SAFEPOINTER_MAGIC))
- EINA_MAGIC_FAIL(header, SAFEPOINTER_MAGIC);
+ header = (Eina_Memory_Header*)(pointer) - 1;
+ if (!EINA_MAGIC_CHECK(header, SAFEPOINTER_MAGIC))
+ EINA_MAGIC_FAIL(header, SAFEPOINTER_MAGIC);
- EINA_MAGIC_SET(header, 0);
- munmap(header, header->size);
+ EINA_MAGIC_SET(header, 0);
+ munmap(header, header->size);
+ }
#else
- free((void*) ((uintptr_t) pointer & ~0x3));
+ free((void *)((uintptr_t) pointer & ~0x3));
#endif
}
@@ -115,15 +132,21 @@ static void
_eina_safepointer_protect(void *pointer, Eina_Bool may_not_write)
{
#ifdef HAVE_MMAP
- Eina_Memory_Header *header;
+# ifdef HAVE_VALGRIND
+ if (RUNNING_ON_VALGRIND) { (void) pointer; }
+ else
+# endif
+ {
+ Eina_Memory_Header *header;
- if (!pointer) return ;
+ if (!pointer) return;
- header = (Eina_Memory_Header*)(pointer) - 1;
- if (!EINA_MAGIC_CHECK(header, SAFEPOINTER_MAGIC))
- EINA_MAGIC_FAIL(header, SAFEPOINTER_MAGIC);
+ header = (Eina_Memory_Header*)(pointer) - 1;
+ if (!EINA_MAGIC_CHECK(header, SAFEPOINTER_MAGIC))
+ EINA_MAGIC_FAIL(header, SAFEPOINTER_MAGIC);
- mprotect(header, header->size, PROT_READ | ( may_not_write ? 0 : PROT_WRITE));
+ mprotect(header, header->size, PROT_READ | ( may_not_write ? 0 : PROT_WRITE));
+ }
#else
(void) pointer;
#endif
@@ -347,7 +370,7 @@ eina_safepointer_init(void)
DBG("entry[Size, Align] = { %zu, %u }",
sizeof (Eina_Memory_Entry), eina_mempool_alignof(sizeof (Eina_Memory_Entry)));
- DBG("table[Size, Align] = { %zu, %u }\n",
+ DBG("table[Size, Align] = { %zu, %u }",
sizeof (Eina_Memory_Table), eina_mempool_alignof(sizeof (Eina_Memory_Table)));
return EINA_TRUE;
diff --git a/src/lib/eina/eina_safepointer.h b/src/lib/eina/eina_safepointer.h
index 72bade407a..d6e5ce52b5 100644
--- a/src/lib/eina/eina_safepointer.h
+++ b/src/lib/eina/eina_safepointer.h
@@ -31,7 +31,7 @@
* index is always correct. Also once a pointer is unregistered the index
* won't be served back for 2^8 on 32 bits system and 2^28 on 64 bits system
* for that specific slot. Finally we guarantee that the lower 2 bits of the
- * returned index are actually never used and completly ignored by our API.
+ * returned index are actually never used and completely ignored by our API.
* So you can safely store whatever information you want in it, we will ignore
* it and treat as if it wasn't there.
*
diff --git a/src/lib/eina/eina_share_common.c b/src/lib/eina/eina_share_common.c
index e7ba2a72d2..7dfb4460a0 100644
--- a/src/lib/eina/eina_share_common.c
+++ b/src/lib/eina/eina_share_common.c
@@ -85,6 +85,14 @@
* @cond LOCAL
*/
+/** The global Eina stringshare log domain */
+extern int _eina_share_stringshare_log_dom;
+
+#ifdef DBG_STRINGSHARE
+#undef DBG_STRINGSHARE
+#endif
+#define DBG_STRINGSHARE(...) EINA_LOG_DOM_DBG(_eina_share_stringshare_log_dom, __VA_ARGS__)
+
#define EINA_SHARE_COMMON_BUCKETS 256
#define EINA_SHARE_COMMON_MASK 0xFF
#define EINA_SHARE_COMMON_BUCKET_IDX(h) ((h >> 8) & EINA_SHARE_COMMON_MASK)
@@ -216,23 +224,19 @@ _eina_share_common_population_stats(Eina_Share *share)
{
unsigned int i;
- fprintf(stderr, "eina share_common statistic:\n");
- fprintf(stderr,
- " * maximum shared strings : %i\n",
- share->population.max);
- fprintf(stderr,
- " * maximum shared strings per node : %i\n",
- share->max_node_population);
+ DBG_STRINGSHARE("eina share_common statistic:");
+ DBG_STRINGSHARE(" * maximum shared strings : %i",
+ share->population.max);
+ DBG_STRINGSHARE(" * maximum shared strings per node : %i",
+ share->max_node_population);
for (i = 0;
i < sizeof (share->population_group) /
sizeof (share->population_group[0]);
++i)
- fprintf(stderr,
- "DDD: %i strings of length %u, max strings: %i\n",
- share->population_group[i].count,
- i,
- share->population_group[i].max);
+ DBG_STRINGSHARE("DDD: %i strings of length %u, max strings: %i",
+ share->population_group[i].count, i,
+ share->population_group[i].max);
}
static void
@@ -568,8 +572,8 @@ eina_iterator_array_check(const Eina_Rbtree *rbtree EINA_UNUSED,
fdata->used += sizeof(Eina_Share_Common_Head);
for (node = head->head; node; node = node->next)
{
- printf("DDD: %5i %5i ", node->length, node->references);
- printf("'%.*s'\n", node->length, ((char *)node) + sizeof(Eina_Share_Common_Node));
+ EINA_LOG_DBG("DDD: %5i %5i ", node->length, node->references);
+ EINA_LOG_DBG("'%.*s'", node->length, ((char *)node) + sizeof(Eina_Share_Common_Node));
fdata->used += sizeof(Eina_Share_Common_Node);
fdata->used += node->length;
fdata->saved += (node->references - 1) * node->length;
@@ -903,19 +907,15 @@ eina_share_common_dump(Eina_Share *share, void (*additional_dump)(
di.saved = 0;
di.dups = 0;
di.unique = 0;
- printf("DDD: len ref string\n");
- printf("DDD:-------------------\n");
eina_spinlock_take(&_mutex_big);
for (i = 0; i < EINA_SHARE_COMMON_BUCKETS; i++)
{
if (!share->share->buckets[i])
{
- continue; // printf("DDD: BUCKET # %i (HEAD=%i, NODE=%i)\n", i,
-
+ continue;
}
-// sizeof(Eina_Share_Common_Head), sizeof(Eina_Share_Common_Node));
it = eina_rbtree_iterator_prefix(
(Eina_Rbtree *)share->share->buckets[i]);
eina_iterator_foreach(it, EINA_EACH_CB(eina_iterator_array_check), &di);
@@ -929,26 +929,24 @@ eina_share_common_dump(Eina_Share *share, void (*additional_dump)(
di.saved += share->population_group[0].count * sizeof(char);
di.saved += share->population_group[1].count * sizeof(char) * 2;
#endif
- printf("DDD:-------------------\n");
- printf("DDD: usage (bytes) = %i, saved = %i (%3.0f%%)\n",
- di.used, di.saved, di.used ? (di.saved * 100.0 / di.used) : 0.0);
- printf("DDD: unique: %d, duplicates: %d (%3.0f%%)\n",
- di.unique, di.dups, di.unique ? (di.dups * 100.0 / di.unique) : 0.0);
+ EINA_LOG_DBG("DDD:-------------------");
+ EINA_LOG_DBG("DDD: usage (bytes) = %i, saved = %i (%3.0f%%)",
+ di.used, di.saved, di.used ? (di.saved * 100.0 / di.used) : 0.0);
+ EINA_LOG_DBG("DDD: unique: %d, duplicates: %d (%3.0f%%)",
+ di.unique, di.dups, di.unique ? (di.dups * 100.0 / di.unique) : 0.0);
#ifdef EINA_STRINGSHARE_USAGE
- printf("DDD: Allocated strings: %i\n", share->population.count);
- printf("DDD: Max allocated strings: %i\n", share->population.max);
- printf("DDD: Max shared strings per node : %i\n", share->max_node_population);
+ DBG_STRINGSHARE("DDD: Allocated strings: %i", share->population.count);
+ DBG_STRINGSHARE("DDD: Max allocated strings: %i", share->population.max);
+ DBG_STRINGSHARE("DDD: Max shared strings per node : %i", share->max_node_population);
for (i = 0;
i < sizeof (share->population_group) /
sizeof (share->population_group[0]);
++i)
- fprintf(stderr,
- "DDD: %i strings of length %u, max strings: %i\n",
- share->population_group[i].count,
- i,
- share->population_group[i].max);
+ DBG_STRINGSHARE("DDD: %i strings of length %u, max strings: %i",
+ share->population_group[i].count, i,
+ share->population_group[i].max);
#endif
eina_spinlock_release(&_mutex_big);
diff --git a/src/lib/eina/eina_slice.h b/src/lib/eina/eina_slice.h
index 8ac4351d93..4c2efffd48 100644
--- a/src/lib/eina/eina_slice.h
+++ b/src/lib/eina/eina_slice.h
@@ -20,11 +20,14 @@
#define _EINA_SLICE_H
#include "eina_types.h"
+
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
+#include <sys/types.h>
+
/**
* @addtogroup Eina_Slice_Group Memory Slices
*
@@ -408,7 +411,7 @@ static inline char *eina_rw_slice_strdup(const Eina_Rw_Slice rw_slice);
* @def EINA_SLICE_STR_LITERAL(buf)
*
* Initializer for string literals (those declared as
- * double-quoted). The size will @b NOT include the trainling
+ * double-quoted). The size will @b NOT include the trailing
* null-terminator.
*
* It is often useful for globals.
@@ -455,7 +458,7 @@ static inline char *eina_rw_slice_strdup(const Eina_Rw_Slice rw_slice);
* @def EINA_SLICE_STR_FMT
*
* To be used in printf()-like statements, prints the slice as a
- * string, its @c len is to be used, then it doesn need the null
+ * string, its @c len is to be used, then it doesn't need the null
* terminator.
*
* Use with EINA_SLICE_STR_PRINT()
diff --git a/src/lib/eina/eina_slstr.h b/src/lib/eina/eina_slstr.h
index aa735c2d1e..881276f615 100644
--- a/src/lib/eina/eina_slstr.h
+++ b/src/lib/eina/eina_slstr.h
@@ -105,7 +105,7 @@ eina_slstr_tmpstr_new(Eina_Tmpstr *string);
/**
* @brief Create a new short lived string by taking ownership of a strbuf.
*
- * @param string An existing strbuf, that will be released (ie. steal + free).
+ * @param string An existing strbuf, that will be released (i.e.. steal + free).
* @return A new Eina_Slstr or NULL if out of memory.
*
* Usage example:
diff --git a/src/lib/eina/eina_str.h b/src/lib/eina/eina_str.h
index 94e986de2c..742c02be55 100644
--- a/src/lib/eina/eina_str.h
+++ b/src/lib/eina/eina_str.h
@@ -172,7 +172,7 @@ EAPI Eina_Bool eina_str_has_extension(const char *str, const char *ext) EI
* This function splits @p string into a maximum of @p max_tokens pieces,
* using the given delimiter @p delimiter. @p delimiter is not included in any
* of the resulting strings, unless @p max_tokens is reached. If
- * @p max_tokens is less than @c 1, the string is splitted as many times as possible. If
+ * @p max_tokens is less than @c 1, the string is split as many times as possible. If
* @p max_tokens is reached, the last string in the returned string
* array contains the remainder of string. The returned value is a
* newly allocated NULL-terminated array of strings or @c NULL if it fails to
diff --git a/src/lib/eina/eina_strbuf.h b/src/lib/eina/eina_strbuf.h
index a0b77af8fe..73d166433d 100644
--- a/src/lib/eina/eina_strbuf.h
+++ b/src/lib/eina/eina_strbuf.h
@@ -25,7 +25,7 @@
* @until strbuf_reset
* @until strbuf_reset
*
- * Next we use the printf family of functions to create a formated string,
+ * Next we use the printf family of functions to create a formatted string,
* add, remove and replace some content:
* @until strbuf_string_get
* @until strbuf_string_get
@@ -36,13 +36,15 @@
*
* @example eina_strbuf_01.c
*/
+
/**
* @addtogroup Eina_String_Buffer_Group String Buffer
*
- * @brief These functions provide string buffers management.
+ * @brief These functions provide string buffer management.
*
* The String Buffer data type is designed to be a mutable string,
- * allowing to append, prepend or insert a string to a buffer.
+ * allowing the appending, prepending or insertion of a string to a
+ * buffer.
*
* For more information see @ref tutorial_strbuf "this example".
*/
@@ -68,10 +70,10 @@ typedef struct _Eina_Strbuf Eina_Strbuf;
/**
* @brief Creates a new string buffer.
*
- * @return Newly allocated string buffer instance.
+ * @return Newly allocated string buffer instance, or @c NULL on error.
*
- * This function creates a new string buffer. On error, @c NULL is
- * returned. To free the resources, use eina_strbuf_free().
+ * This function creates a new string buffer. To free the resources, use
+ * eina_strbuf_free().
*
* @see eina_strbuf_free()
* @see eina_strbuf_append()
@@ -80,56 +82,59 @@ typedef struct _Eina_Strbuf Eina_Strbuf;
EAPI Eina_Strbuf *eina_strbuf_new(void) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
/**
- * @brief Creates a new string buffer using the passed string. The passed
- * string is used directly as the buffer, it's somehow the opposite function of
- * @ref eina_strbuf_string_steal . The passed string must be malloc'd.
+ * @brief Creates a new string buffer using the passed string.
*
- * @param str The string to manage
- * @return Newly allocated string buffer instance.
+ * @param[in] str The string to manage.
+ * @return Newly allocated string buffer instance, or @c NULL on error.
*
- * This function creates a new string buffer. On error, @c NULL is
- * returned. To free the resources, use eina_strbuf_free().
+ * This function creates a new string buffer. The passed string is used
+ * directly as the buffer, it's effectively the inverse of
+ * eina_strbuf_string_steal(). The passed string must be malloc'd.
+ * To free the resources, use eina_strbuf_free().
*
* @see eina_strbuf_free()
* @see eina_strbuf_append()
* @see eina_strbuf_string_get()
+ *
* @since 1.1.0
*/
EAPI Eina_Strbuf *eina_strbuf_manage_new(char *str) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
/**
- * @brief Creates a new string buffer using the passed string. The passed
- * string is used directly as the buffer, it's somehow the opposite function of
- * @ref eina_strbuf_string_steal . The passed string must be malloc'd.
+ * @brief Creates a new string buffer using the passed string.
*
- * @param str The string to manage
- * @param length The length of the string.
- * @return Newly allocated string buffer instance.
+ * @param[in] str The string to manage.
+ * @param[in] length The length of the string.
+ * @return Newly allocated string buffer instance, or @c NULL on error.
*
- * This function creates a new string buffer. On error, @c NULL is
- * returned. To free the resources, use eina_strbuf_free().
+ * This function creates a new string buffer. The passed string is used
+ * directly as the buffer, it's effectively the inverse of
+ * eina_strbuf_string_steal(). The passed string must be malloc'd. To
+ * free the resources, use eina_strbuf_free().
*
* @see eina_strbuf_manage_new()
+ *
* @since 1.2.0
*/
EAPI Eina_Strbuf *eina_strbuf_manage_new_length(char *str, size_t length) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
/**
- * @brief Creates a new string buffer using the passed string. The passed
- * string is used directly as the buffer, it's somehow the opposite function of
- * @ref eina_strbuf_string_steal . The passed string is expected to be static or
- * otherwise on the stack rather than the malloc'd string required by
- * @ref eina_strbuf_manage_new_length .
+ * @brief Creates a new string buffer using the passed string.
*
- * @param str The string to manage
- * @param length The length of the string.
- * @return Newly allocated string buffer instance.
+ * @param[in] str The string to manage.
+ * @param[in] length The length of the string.
+ * @return Newly allocated string buffer instance, or @c NULL on error.
*
- * This function creates a new string buffer. On error, @c NULL is
- * returned. To free the resources, use eina_strbuf_free().
+ * This function creates a new string buffer. The passed string is used
+ * directly as the buffer, it's effectively the inverse of
+ * eina_strbuf_string_steal(). The passed string is expected to be static
+ * or otherwise on the stack rather than the malloc'd string required by
+ * eina_strbuf_manage_new_length(). To free the resources, use
+ * eina_strbuf_free().
*
* @see eina_strbuf_manage_new()
* @see eina_strbuf_manage_new_length()
+ *
* @since 1.9.0
*/
EAPI Eina_Strbuf *eina_strbuf_manage_read_only_new_length(const char *str, size_t length) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
@@ -137,7 +142,7 @@ EAPI Eina_Strbuf *eina_strbuf_manage_read_only_new_length(const char *str, size_
/**
* @brief Frees a string buffer.
*
- * @param buf The string buffer to free.
+ * @param[in,out] buf The string buffer to free.
*
* This function frees the memory of @p buf. @p buf must have been
* created by eina_strbuf_new().
@@ -147,25 +152,24 @@ EAPI void eina_strbuf_free(Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
/**
* @brief Resets a string buffer.
*
- * @param buf The string buffer to reset.
+ * @param[in,out] buf The string buffer.
*
- * This function reset @p buf: the buffer len is set to 0, and the
- * string is set to '\\0'. No memory is free'd.
+ * This function resets @p buf: the buffer len is set to 0, and the
+ * string data is set to '\\0'. No memory is freed.
*/
EAPI void eina_strbuf_reset(Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
/**
* @brief Appends a string to a buffer, reallocating as necessary.
*
- * @param buf The string buffer to append to.
- * @param str The string to append.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The string to append.
+ * @return #EINA_TRUE on success, #EINA_FALSE on failure such as if
+ * @p str could not be appended.
*
* This function appends @p str to @p buf. It computes the length of
* @p str, so is slightly slower than eina_strbuf_append_length(). If
- * the length is known beforehand, consider using that variant. If
- * @p buf can't append it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
- * returned.
+ * the length is known beforehand, consider using that variant.
*
* @see eina_strbuf_append()
* @see eina_strbuf_append_length()
@@ -175,13 +179,11 @@ EAPI Eina_Bool eina_strbuf_append(Eina_Strbuf *buf, const char *str) EINA_ARG_NO
/**
* @brief Appends an escaped string to a buffer, reallocating as necessary.
*
- * @param buf The string buffer to append to.
- * @param str The string to append.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The string to append.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p str could not be appended.
*
- * This function escapes and then appends the string @p str to @p buf. If @p str
- * can not be appended, #EINA_FALSE is returned, otherwise, #EINA_TRUE is
- * returned.
+ * This function escapes and then appends the string @p str to @p buf.
*/
EAPI Eina_Bool eina_strbuf_append_escaped(Eina_Strbuf *buf, const char *str) EINA_ARG_NONNULL(1, 2);
@@ -189,19 +191,17 @@ EAPI Eina_Bool eina_strbuf_append_escaped(Eina_Strbuf *buf, const char *str) EIN
* @brief Appends a string to a buffer, reallocating as necessary,
* limited by the given length.
*
- * @param buf The string buffer to append to.
- * @param str The string to append.
- * @param maxlen The maximum number of characters to append.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The string to append.
+ * @param[in] maxlen The maximum number of characters to append.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p str could not be appended.
*
* This function appends at most @p maxlen characters of @p str to
* @p buf. It can't append more than the length of @p str. It
* computes the length of @p str, so it is slightly slower than
* eina_strbuf_append_length(). If the length is known beforehand,
* consider using that variant (@p maxlen should then be checked so
- * that it is greater than the size of @p str). If @p str can not be
- * appended, #EINA_FALSE is returned, otherwise, #EINA_TRUE is
- * returned.
+ * that it is greater than the size of @p str).
*
* @see eina_strbuf_append()
* @see eina_strbuf_append_length()
@@ -209,19 +209,18 @@ EAPI Eina_Bool eina_strbuf_append_escaped(Eina_Strbuf *buf, const char *str) EIN
EAPI Eina_Bool eina_strbuf_append_n(Eina_Strbuf *buf, const char *str, size_t maxlen) EINA_ARG_NONNULL(1, 2);
/**
- * @brief Appends a string of exact length to a buffer, reallocating as necessary.
+ * @brief Appends a string of exact length to a buffer, reallocating as
+ * necessary.
*
- * @param buf The string buffer to append to.
- * @param str The string to append.
- * @param length The exact length to use.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The string to append.
+ * @param[in] length The exact length to use.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p str could not be appended.
*
* This function appends @p str to @p buf. @p str must be of size at
* most @p length. It is slightly faster than eina_strbuf_append() as
* it does not compute the size of @p str. It is useful when dealing
- * with strings of known size, such as eina_stringshare. If @p buf
- * can't append it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
- * returned.
+ * with strings of known size, such as eina_stringshare.
*
* @see eina_stringshare_length()
* @see eina_strbuf_append()
@@ -232,12 +231,11 @@ EAPI Eina_Bool eina_strbuf_append_length(Eina_Strbuf *buf, const char *str, size
/**
* @brief Append a slice to a buffer, reallocating as necessary.
*
- * @param buf The string buffer to append to.
- * @param slice The slice to append.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] slice The slice to append.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p slice could not be appended.
*
- * This function appends @p slice to @p buf. If @p buf can't append
- * it, #EINA_FALSE is returned, otherwise #EINA_TRUE is returned.
+ * This function appends @p slice to @p buf.
*
* @since 1.19.0
*/
@@ -246,18 +244,18 @@ EAPI Eina_Bool eina_strbuf_append_slice(Eina_Strbuf *buf, const Eina_Slice slice
/**
* @brief Appends an Eina_Strbuf to a buffer, reallocating as necessary.
*
- * @param buf The string buffer to append to.
- * @param data The string buffer to append.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] data The string buffer to append.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p data could not be appended.
*
* This function appends @p data to @p buf. @p data must be allocated and
* different from @c NULL. It is slightly faster than eina_strbuf_append() as
- * it does not compute the size of @p str. If @p buf can't append it,
- * #EINA_FALSE is returned, otherwise #EINA_TRUE is returned.
+ * it does not compute the size of @p str.
*
* @see eina_strbuf_append()
* @see eina_strbuf_append_n()
* @see eina_strbuf_append_length()
+ *
* @since 1.9.0
*/
EAPI Eina_Bool eina_strbuf_append_buffer(Eina_Strbuf *buf, const Eina_Strbuf *data) EINA_ARG_NONNULL(1, 2);
@@ -266,36 +264,37 @@ EAPI Eina_Bool eina_strbuf_append_buffer(Eina_Strbuf *buf, const Eina_Strbuf *da
* @brief Appends a character to a string buffer, reallocating as
* necessary.
*
- * @param buf The string buffer to append to.
- * @param c The char to append.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] c The character to append.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p c could not be appended.
*
- * This function inserts @p c to @p buf. If it can not insert it, #EINA_FALSE
- * is returned, otherwise #EINA_TRUE is returned.
+ * This function appends @p c to @p buf.
*/
EAPI Eina_Bool eina_strbuf_append_char(Eina_Strbuf *buf, char c) EINA_ARG_NONNULL(1);
/**
- * @brief Appends a string to a buffer, reallocating as necessary.
+ * @brief Appends data elements to a buffer using printf-style formatting.
*
- * @param buf The string buffer to append to.
- * @param fmt The string to append.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] fmt A formatting string.
+ * @param[in] ... Variable list of data parameters to be appended.
+ * @return #EINA_TRUE on success, #EINA_FALSE if formatted string could
+ * not be appended.
*
- * This function appends the string defined by the format @p fmt to @p buf. @p
- * fmt must be of a valid format for printf family of functions. If it can't
- * insert it, #EINA_FALSE is returned, otherwise #EINA_TRUE is returned.
+ * This function appends the string defined by the format @p fmt to @p
+ * buf, reallocating as necessary. @p fmt must be of a valid format for
+ * the printf family of functions.
*
* @see eina_strbuf_append()
*/
EAPI Eina_Bool eina_strbuf_append_printf(Eina_Strbuf *buf, const char *fmt, ...) EINA_ARG_NONNULL(1, 2) EINA_PRINTF(2, 3);
/**
- * @brief Appends a string to a buffer, reallocating as necessary.
+ * @brief Appends data elements to a string buffer using a va_list.
*
- * @param buf The string buffer to append to.
- * @param fmt The string to append.
- * @param args The variable arguments.
+ * @param[in,out] buf The string buffer.
+ * @param[in] fmt A formatting string.
+ * @param[in] args The variable arguments.
* @return #EINA_TRUE on success, #EINA_FALSE on failure.
*
* @see eina_strbuf_append_printf()
@@ -303,71 +302,66 @@ EAPI Eina_Bool eina_strbuf_append_printf(Eina_Strbuf *buf, const char *fmt, ...)
EAPI Eina_Bool eina_strbuf_append_vprintf(Eina_Strbuf *buf, const char *fmt, va_list args) EINA_ARG_NONNULL(1, 2);
/**
- * @brief Inserts a string to a buffer, reallocating as necessary.
+ * @brief Inserts a string into a buffer, reallocating as necessary.
*
- * @param buf The string buffer to insert.
- * @param str The string to insert.
- * @param pos The position to insert the string.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The string to insert.
+ * @param[in] pos The position to insert the string.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p str could not be inserted.
*
- * This function inserts @p str to @p buf at position @p pos. It
+ * This function inserts @p str into @p buf at position @p pos. It
* computes the length of @p str, so is slightly slower than
- * eina_strbuf_insert_length(). If the length is known beforehand,
- * consider using that variant. If @p buf can't insert it, #EINA_FALSE
- * is returned, otherwise #EINA_TRUE is returned.
+ * eina_strbuf_insert_length(). If the length is known beforehand,
+ * consider using that variant.
*/
EAPI Eina_Bool eina_strbuf_insert(Eina_Strbuf *buf, const char *str, size_t pos) EINA_ARG_NONNULL(1, 2);
/**
- * @brief Inserts an escaped string to a buffer, reallocating as
+ * @brief Inserts an escaped string into a buffer, reallocating as
* necessary.
*
- * @param buf The string buffer to insert to.
- * @param str The string to insert.
- * @param pos The position to insert the string.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The string to insert.
+ * @param[in] pos The position to insert the string.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p str could not be inserted.
*
- * This function escapes and inserts the string @p str to @p buf at
- * position @p pos. If @p buf can't insert @p str, #EINA_FALSE is
- * returned, otherwise #EINA_TRUE is returned.
+ * This function escapes and inserts the string @p str into @p buf at
+ * position @p pos.
*/
EAPI Eina_Bool eina_strbuf_insert_escaped(Eina_Strbuf *buf, const char *str, size_t pos) EINA_ARG_NONNULL(1, 2);
/**
- * @brief Inserts a string to a buffer, reallocating as necessary. Limited by maxlen.
+ * @brief Inserts a string of a maximum length into a buffer, reallocating as necessary.
*
- * @param buf The string buffer to insert to.
- * @param str The string to insert.
- * @param maxlen The maximum number of chars to insert.
- * @param pos The position to insert the string.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The string to insert.
+ * @param[in] maxlen The maximum number of chars to insert.
+ * @param[in] pos The position to insert the string.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p str could not be inserted.
*
- * This function inserts @p str to @p buf at position @p pos, with at
- * most @p maxlen bytes. The number of inserted characters can not be
+ * This function inserts @p str into @p buf at position @p pos, with at
+ * most @p maxlen bytes. The number of inserted characters cannot be
* greater than the length of @p str. It computes the length of
* @p str, so is slightly slower than eina_strbuf_insert_length(). If the
* length is known beforehand, consider using that variant (@p maxlen
* should then be checked so that it is greater than the size of
- * @p str). If @p str can not be inserted, #EINA_FALSE is returned,
- * otherwise, #EINA_TRUE is returned.
+ * @p str).
*/
EAPI Eina_Bool eina_strbuf_insert_n(Eina_Strbuf *buf, const char *str, size_t maxlen, size_t pos) EINA_ARG_NONNULL(1, 2);
/**
- * @brief Inserts a string of exact length to a buffer, reallocating as necessary.
+ * @brief Inserts a string of an exact length into a buffer, reallocating as necessary.
*
- * @param buf The string buffer to insert to.
- * @param str The string to insert.
- * @param length The exact length to use.
- * @param pos The position to insert the string.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The string to insert.
+ * @param[in] length The exact length to use.
+ * @param[in] pos The position to insert the string.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p string could not be inserted.
*
- * This function inserts @p str to @p buf. @p str must be of size at
- * most @p length. It is slightly faster than eina_strbuf_insert() as
+ * This function inserts @p str into @p buf. @p str must be no longer
+ * than @p length. It is slightly faster than eina_strbuf_insert() as
* it does not compute the size of @p str. It is useful when dealing
- * with strings of known size, such as eina_strngshare. If @p buf
- * can't insert it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
- * returned.
+ * with strings of known size, such as eina_stringshare.
*
* @see eina_stringshare_length()
* @see eina_strbuf_insert()
@@ -376,58 +370,54 @@ EAPI Eina_Bool eina_strbuf_insert_n(Eina_Strbuf *buf, const char *str, size_t ma
EAPI Eina_Bool eina_strbuf_insert_length(Eina_Strbuf *buf, const char *str, size_t length, size_t pos) EINA_ARG_NONNULL(1, 2);
/**
- * @brief Insert a slice to a buffer, reallocating as necessary.
+ * @brief Insert a slice into a buffer, reallocating as necessary.
*
- * @param buf The string buffer to insert to.
- * @param slice The slice to insert.
- * @param pos The position to insert the string.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] slice The slice to insert.
+ * @param[in] pos The position to insert the string.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p slice could not be inserted.
*
- * This function inserts @p slice to @p buf at position @p pos. If @p
- * buf can't insert it, #EINA_FALSE is returned, otherwise #EINA_TRUE
- * is returned.
+ * This function inserts @p slice into @p buf at position @p pos.
*
* @since 1.19.0
*/
EAPI Eina_Bool eina_strbuf_insert_slice(Eina_Strbuf *buf, const Eina_Slice slice, size_t pos) EINA_ARG_NONNULL(1);
/**
- * @brief Inserts a character to a string buffer, reallocating as
+ * @brief Inserts a character into a string buffer, reallocating as
* necessary.
*
- * @param buf The string buffer to insert to.
- * @param c The char to insert.
- * @param pos The position to insert the char.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] c The character to insert.
+ * @param[in] pos The position to insert the character.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p c could not be inserted.
*
- * This function inserts @p c to @p buf at position @p pos. If @p buf
- * can't append it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
- * returned.
+ * This function inserts @p c into @p buf at position @p pos.
*/
EAPI Eina_Bool eina_strbuf_insert_char(Eina_Strbuf *buf, char c, size_t pos) EINA_ARG_NONNULL(1);
/**
- * @brief Inserts a string to a buffer, reallocating as necessary.
+ * @brief Inserts data elements into a buffer using printf-style formatting.
*
- * @param buf The string buffer to insert.
- * @param fmt The string to insert.
- * @param pos The position to insert the string.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] fmt The string to insert.
+ * @param[in] pos The position to insert the string.
+ * @param[in] ... Variable list of data parameters to be inserted.
+ * @return #EINA_TRUE on success, #EINA_FALSE if the string could not be inserted.
*
- * This function inserts a string as described by the format @p fmt to @p buf at
+ * This function inserts a string as described by the format @p fmt into @p buf at
* the position @p pos. @p fmt must be of a valid format for printf family of
- * functions. If it can't insert it, #EINA_FALSE is returned,
- * otherwise #EINA_TRUE is returned.
+ * functions.
*/
EAPI Eina_Bool eina_strbuf_insert_printf(Eina_Strbuf *buf, const char *fmt, size_t pos, ...) EINA_ARG_NONNULL(1, 2) EINA_PRINTF(2, 4);
/**
- * @brief Inserts a string to a buffer, reallocating as necessary.
+ * @brief Inserts data elements into a buffer using a va_list.
*
- * @param buf The string buffer to insert.
- * @param fmt The string to insert.
- * @param pos The position to insert the string.
- * @param args The variable arguments.
+ * @param[in,out] buf The string buffer.
+ * @param[in] fmt The string to insert.
+ * @param[in] pos The position to insert the string.
+ * @param[in] args The variable arguments.
* @return #EINA_TRUE on success, #EINA_FALSE on failure.
*
* @see eina_strbuf_insert_printf
@@ -436,118 +426,103 @@ EAPI Eina_Bool eina_strbuf_insert_vprintf(Eina_Strbuf *buf, const char *fmt, siz
/**
* @def eina_strbuf_prepend(buf, str)
- * @brief Prepends the given string to the given buffer.
+ * @brief Prepends a string to the given buffer.
*
- * @param buf The string buffer to prepend to.
- * @param str The string to prepend.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The string to prepend.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p str could not be prepended.
*
- * This macro is calling eina_strbuf_insert() at position 0. If @p buf
- * can't prepend it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
- * returned.
+ * This macro simply calls eina_strbuf_insert() with position 0.
*/
-#define eina_strbuf_prepend(buf, str) eina_strbuf_insert(buf, str, 0)
+#define eina_strbuf_prepend(buf, str) eina_strbuf_insert(buf, str, 0)
/**
* @def eina_strbuf_prepend_escaped(buf, str)
- * @brief Prepends the given escaped string to the given buffer.
+ * @brief Prepends an escaped string to the given buffer.
*
- * @param buf The string buffer to prepend to.
- * @param str The string to prepend.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The string to prepend.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p str could not be prepended.
*
- * This macro is calling eina_strbuf_insert_escaped() at position 0. If
- * @p buf can't prepend it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
- * returned.
+ * This macro simply calls eina_strbuf_insert_escaped() with position 0.
*/
-#define eina_strbuf_prepend_escaped(buf, str) eina_strbuf_insert_escaped(buf, str, 0)
+#define eina_strbuf_prepend_escaped(buf, str) eina_strbuf_insert_escaped(buf, str, 0)
/**
* @def eina_strbuf_prepend_n(buf, str)
- * @brief Prepends the given escaped string to the given buffer.
+ * @brief Prepends an escaped string to the given buffer.
*
- * @param buf The string buffer to prepend to.
- * @param str The string to prepend.
- * @param maxlen The maximum number of chars to prepend.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The string to prepend.
+ * @param[in] maxlen The maximum number of chars to prepend.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p str could not be prepended.
*
- * This macro is calling eina_strbuf_insert_n() at position 0. If
- * @p buf can't prepend it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
- * returned.
+ * This macro simply calls eina_strbuf_insert_n() with position 0.
*/
-#define eina_strbuf_prepend_n(buf, str, maxlen) eina_strbuf_insert_n(buf, str, maxlen, 0)
+#define eina_strbuf_prepend_n(buf, str, maxlen) eina_strbuf_insert_n(buf, str, maxlen, 0)
/**
* @def eina_strbuf_prepend_length(buf, str)
- * @brief Prepends the given escaped string to the given buffer.
+ * @brief Prepends an escaped string to the given buffer.
*
- * @param buf The string buffer to prepend to.
- * @param str The string to prepend.
- * @param length The exact length to use.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The string to prepend.
+ * @param[in] length The exact length to use.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p str could not be prepended.
*
- * This macro is calling eina_strbuf_insert_length() at position 0. If
- * @p buf can't prepend it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
- * returned.
+ * This macro simply calls eina_strbuf_insert_length() with position 0.
*/
#define eina_strbuf_prepend_length(buf, str, length) eina_strbuf_insert_length(buf, str, length, 0)
/**
* @def eina_strbuf_prepend_char(buf, str)
- * @brief Prepends the given character to the given buffer.
+ * @brief Prepends a character to the given buffer.
*
- * @param buf The string buffer to prepend to.
- * @param c The character to prepend.
+ * @param[in,out] buf The string buffer.
+ * @param[in] c The character to prepend.
* @return #EINA_TRUE on success, #EINA_FALSE on failure.
*
- * This macro is calling eina_strbuf_insert_char() at position 0. If
- * @p buf can't prepend it, #EINA_FALSE is returned, otherwise #EINA_TRUE
- * is returned.
+ * This macro simply calls eina_strbuf_insert_char() with position 0.
*/
-#define eina_strbuf_prepend_char(buf, c) eina_strbuf_insert_char(buf, c, 0)
+#define eina_strbuf_prepend_char(buf, c) eina_strbuf_insert_char(buf, c, 0)
/**
* @def eina_strbuf_prepend_printf(buf, fmt, ...)
- * @brief Prepends the given string to the given buffer.
+ * @brief Prepends data elements to the given buffer using printf-style formatting.
*
- * @param buf The string buffer to prepend to.
- * @param fmt The string to prepend.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] fmt The string to prepend.
+ * @param[in] ... Variable list of data elements to prepend.
+ * @return #EINA_TRUE on success, #EINA_FALSE if data could not be prepended.
*
- * This macro is calling eina_strbuf_insert_printf() at position 0. If @p buf
- * can't prepend it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
- * returned.
+ * This macro simply calls eina_strbuf_insert_printf() with position 0.
*/
-#define eina_strbuf_prepend_printf(buf, fmt, ...) eina_strbuf_insert_printf(buf, fmt, 0, ## __VA_ARGS__)
+#define eina_strbuf_prepend_printf(buf, fmt, ...) eina_strbuf_insert_printf(buf, fmt, 0, ## __VA_ARGS__)
/**
* @def eina_strbuf_prepend_vprintf(buf, fmt, args)
* @brief Prepends the given string to the given buffer.
*
- * @param buf The string buffer to prepend to.
- * @param fmt The string to prepend.
- * @param args The variable arguments.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] fmt The string to prepend.
+ * @param[in] args The variable arguments.
+ * @return #EINA_TRUE on success, #EINA_FALSE if data could not be prepended.
*
- * This macro is calling eina_strbuf_insert_vprintf() at position 0.If @p buf
- * can't prepend it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
- * returned.
+ * This macro simply calls eina_strbuf_insert_vprintf() with position 0.
*/
#define eina_strbuf_prepend_vprintf(buf, fmt, args) eina_strbuf_insert_vprintf(buf, fmt, 0, args)
/**
- * @brief Removes a slice of the given string buffer.
+ * @brief Removes a section from the given string buffer.
*
- * @param buf The string buffer to remove a slice.
- * @param start The initial (inclusive) slice position to start
- * removing, in bytes.
- * @param end The final (non-inclusive) slice position to finish
- * removing, in bytes.
+ * @param[in,out] buf The string buffer.
+ * @param[in] start The initial (inclusive) byte position to start removal.
+ * @param[in] end The final (non-inclusive) byte position to end removal.
* @return #EINA_TRUE on success, #EINA_FALSE on failure.
*
* This function removes a slice of @p buf, starting at @p start
* (inclusive) and ending at @p end (non-inclusive). Both values are
- * in bytes. It returns #EINA_FALSE on failure, #EINA_TRUE otherwise.
+ * in bytes.
*/
EAPI Eina_Bool eina_strbuf_remove(Eina_Strbuf *buf, size_t start, size_t end) EINA_ARG_NONNULL(1);
@@ -555,14 +530,14 @@ EAPI Eina_Bool eina_strbuf_remove(Eina_Strbuf *buf, size_t start, size_t end) EI
/**
* @brief Retrieves a pointer to the contents of a string buffer.
*
- * @param buf The string buffer.
+ * @param[in] buf The string buffer.
* @return The current string in the string buffer.
*
* This function returns the string contained in @p buf. The returned
* value must not be modified and will no longer be valid if @p buf is
- * modified. In other words, any eina_strbuf_append() or similar will
- * make that pointer invalid. The pointer returned by this function <b>must
- * not</b> be freed.
+ * modified. In other words, calling eina_strbuf_append() or similar
+ * functions will make this pointer invalid. The pointer returned by
+ * this function <b>must not</b> be freed.
*
* @see eina_strbuf_string_steal()
*/
@@ -571,8 +546,8 @@ EAPI const char *eina_strbuf_string_get(const Eina_Strbuf *buf) EINA_ARG_NONNULL
/**
* @brief Steals the contents of a string buffer.
*
- * @param buf The string buffer to steal.
- * @return The current string in the string buffer.
+ * @param[in,out] buf The string buffer.
+ * @return The string that was contained in @p buf.
*
* This function returns the string contained in @p buf. @p buf is
* then initialized and does not own the returned string anymore. The
@@ -586,7 +561,7 @@ EAPI char *eina_strbuf_string_steal(Eina_Strbuf *buf) EINA_MALLOC EINA_WARN_UNUS
/**
* @brief Frees the contents of a string buffer but not the buffer.
*
- * @param buf The string buffer to free the string of.
+ * @param[in,out] buf The string buffer.
*
* This function frees the string contained in @p buf without freeing
* @p buf.
@@ -594,160 +569,160 @@ EAPI char *eina_strbuf_string_steal(Eina_Strbuf *buf) EINA_MALLOC EINA_WARN_UNUS
EAPI void eina_strbuf_string_free(Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
/**
- * @brief Retrieves the length of the string buffer content.
+ * @brief Retrieves the length of the string buffer's content.
*
- * @param buf The string buffer.
+ * @param[in,out] buf The string buffer.
* @return The current length of the string, in bytes.
*
* This function returns the length of @p buf.
*/
-EAPI size_t eina_strbuf_length_get(const Eina_Strbuf *buf) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
-
+EAPI size_t eina_strbuf_length_get(const Eina_Strbuf *buf) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
/**
- * @brief Replaces the n-th string with an other string.
+ * @brief Replaces a substring in the buffer with another string.
*
- * @param buf The string buffer to work with.
- * @param str The string to replace.
- * @param with The replacing string.
- * @param n The number of the fitting string.
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The text to match.
+ * @param[in] with The replacement string.
+ * @param[in] n The indexed occurrence to be replaced.
* @return #EINA_TRUE on success, #EINA_FALSE on failure.
*
* This function replaces the n-th occurrence of @p str in @p buf with
- * @p with. It returns #EINA_FALSE on failure, #EINA_TRUE otherwise.
+ * @p with.
*/
EAPI Eina_Bool eina_strbuf_replace(Eina_Strbuf *buf, const char *str, const char *with, unsigned int n) EINA_ARG_NONNULL(1, 2, 3);
/**
* @def eina_strbuf_replace_first(buf, str, with)
- * @brief Prepends the given character to the given buffer.
+ * @brief Replaces the first occurrence of a substring with another string.
*
- * @param buf The string buffer to work with.
- * @param str The string to replace.
- * @param with The replaceing string.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The text to match.
+ * @param[in] with The replacement string.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p str could not be
+ * replaced in @p buf.
*
- * This macro is calling eina_strbuf_replace() with the n-th occurrence
- * equal to @c 1. If @p buf can't replace it, #EINA_FALSE is returned,
- * otherwise #EINA_TRUE is returned.
+ * This macro simply calls eina_strbuf_replace() with @p n
+ * equal to @c 1.
*/
#define eina_strbuf_replace_first(buf, str, with) eina_strbuf_replace(buf, str, with, 1)
-
/**
- * @brief Replaces all strings with another string.
-
- * @param buf The string buffer to work with.
- * @param str The string to replace.
- * @param with The replacement string.
- * @return How often the string was replaced.
+ * @brief Replaces all matching substrings with another string.
+ *
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The text to match.
+ * @param[in] with The replacement string.
+ * @return Number of replacements made, or @c 0 on failure.
*
* This function replaces all the occurrences of @p str in @p buf with
- * the string @p with. This function returns the number of times @p str
- * has been replaced. On failure, it returns @c 0.
+ * the string @p with.
*/
EAPI int eina_strbuf_replace_all(Eina_Strbuf *buf, const char *str, const char *with) EINA_ARG_NONNULL(1, 2, 3);
/**
* @brief Trims the string buffer.
-
- * @param buf The string buffer to work with.
*
- * This function skips whitespaces at the beginning and the end of the buffer.
+ * @param[in,out] buf The string buffer.
+ *
+ * This function removes whitespace at the beginning and end of the
+ * buffer's string.
*/
EAPI void eina_strbuf_trim(Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
/**
* @brief Left trims the string buffer.
-
- * @param buf The string buffer to work with.
*
- * This function skips whitespaces in the beginning of the buffer.
+ * @param[in,out] buf The string buffer.
+ *
+ * This function removes whitespace at the beginning of the buffer's
+ * string.
*/
EAPI void eina_strbuf_ltrim(Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
/**
* @brief Right trims the string buffer.
-
- * @param buf The string buffer to work with.
*
- * This function skips whitespaces in the end of the buffer.
+ * @param[in,out] buf The string buffer.
+ *
+ * This function removes whitespace at the end of the buffer's string.
*/
EAPI void eina_strbuf_rtrim(Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
/**
* @brief Converts the string to lower case.
*
- * @param buf The string buffer to work with.
+ * @param[in,out] buf The string buffer.
*
- * This function converts all the characters in the strbuf to lower case.
+ * This function converts all the characters in the buffer's string to
+ * lower case.
*
* @since 1.17
*/
EAPI void eina_strbuf_tolower(Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
/**
- * @brief Obtains substring from the src.
+ * @brief Obtains substring from a source string buffer.
*
- * @param buf The src string.
- * @param pos The position in the source string from which the substring
- * should be created. The first character is denoted by a
- * value of 0 (not 1).
- * @param len The length from pos that should be copied to substring.
+ * @param[in] buf The string buffer.
+ * @param[in] pos The (0-based) position where the substring starts.
+ * @param[in] len The length from @p pos that should be copied.
+ * @return A string buffer containing the substring, or @c NULL if
+ * invalid parameters were specified.
*
- * This function creates a Eina_Strbuf which is a substring of buf which
- * is passed from pos position with len length.
- * If buf is NULL then returns NULL.
- * If len is 0, then an empty strbuf is returned.
+ * This function creates a Eina_Strbuf containing a copy of a substring
+ * of buf starting at @p pos with @p len length. If len is 0, then an
+ * empty strbuf will be returned.
*
* @since 1.17
*/
EAPI Eina_Strbuf * eina_strbuf_substr_get(Eina_Strbuf *buf, size_t pos, size_t len) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
/**
- * @brief Gets a read-only slice representing the current strbuf contents.
+ * @brief Gets a read-only slice of the buffer contents.
*
- * @param buf The source string.
- * @return A read-only slice for the current contents. It may become
- * invalid as soon as the @a buf is changed.
+ * @param[in] buf The string buffer.
+ * @return A read-only slice of the current contents. It may become
+ * invalid as soon as @p buf is changed.
*
* @since 1.19
*/
EAPI Eina_Slice eina_strbuf_slice_get(const Eina_Strbuf *buf) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
/**
- * @brief Gets a read-write slice representing the current strbuf contents.
+ * @brief Gets a read-write slice of the buffer contents.
*
- * @param buf The source string.
+ * @param[in] buf The string buffer.
* @return A read-write slice for the current contents. It may become
- * invalid as soon as the @a buf is changed with calls such as
- * eina_strbuf_append(), eina_strbuf_remove()
+ * invalid as soon as the @p buf is changed, such as through calls like
+ * eina_strbuf_append() or eina_strbuf_remove().
*
* @since 1.19.0
*/
EAPI Eina_Rw_Slice eina_strbuf_rw_slice_get(const Eina_Strbuf *buf) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
-
/**
- * @brief Gets the string of the buffer and free the buffer
- *
- * @param buf The buffer to get the string from and which will be freed
+ * @brief Frees the buffer, returning its old contents.
*
- * @return The string contained by buf. The caller must release the memory of the returned string by calling
- * free().
+ * @param[in,out] buf The string buffer.
+ * @return The string contained by buf. The caller must release the
+ * memory of the returned string by calling free().
*
* @since 1.19
*/
EAPI char* eina_strbuf_release(Eina_Strbuf *buf) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
/**
- * @brief append the given buffer based on strftime output.
+ * @brief Appends a strftime-style timestamp to the buffer.
*
- * @param tm Pointer to a tm structure needed by strftime.
- * @param fmt String containing format specifiers needed by strftime.
+ * @param[in,out] buf The string buffer.
+ * @param[in] fmt The formatting string.
+ * @param[in] tm The time value.
* @return #EINA_TRUE on success, #EINA_FALSE on failure.
*
- * This will add append buffer of exact required size based on strftime output
+ * This function appends a timestamp to the buffer, formatted using
+ * strftime. A string of the exact size required by strftime's output
+ * is added to the end.
*
* Example usage:
* @code
@@ -759,21 +734,24 @@ EAPI char* eina_strbuf_release(Eina_Strbuf *buf) EINA_WARN_UNUSED_RESULT EINA_AR
* eina_strbuf_append_strftime(buf, "%I:%M%p", info);
* //after use
* eina_strbuf_free(buf);
- * @endcode #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @endcode
*
* @since 1.21
*/
EAPI Eina_Bool eina_strbuf_append_strftime(Eina_Strbuf *buf, const char *fmt, const struct tm *tm);
/**
- * @brief insert the given buffer based on strftime output at given position
+ * @brief Inserts a strftime-style timestamp into the buffer.
*
- * @param buf The string buffer to prepend to.
- * @param fmt String containing format specifiers needed by strftime.
- * @param tm Pointer to a tm structure needed by strftime.
+ * @param[in,out] buf The string buffer.
+ * @param[in] fmt The formatting string.
+ * @param[in] tm The time value.
+ * @param[in] pos The position in the buffer to insert the timestamp.
* @return #EINA_TRUE on success, #EINA_FALSE on failure.
*
- * This will add append buffer of exact required size based on strftime output
+ * This function inserts a timestamp into the buffer, formatted using
+ * strftime. The buffer's length will be increased by the exact amount
+ * required by strftime's output.
*
* Example usage:
* @code
@@ -793,20 +771,18 @@ EAPI Eina_Bool eina_strbuf_insert_strftime(Eina_Strbuf *buf, const char *fmt, co
/**
* @def eina_strbuf_prepend_strftime(buf, fmt, tm)
- * @brief Prepends the given string to the given buffer.
+ * @brief Prepends a strftime-style timestamp to the buffer.
*
- * @param buf The string buffer to prepend to.
- * @param fmt The string to prepend.
- * @param tm The variable arguments.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] fmt The formatting string.
+ * @param[in] tm The time value.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p tm could not be prepended.
*
- * This macro is calling eina_strbuf_insert_strftime() at position 0. If @p buf
- * can't prepend it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
- * returned.
+ * This macro simply calls eina_strbuf_insert_strftime() with position 0.
*
* @since 1.21
*/
-#define eina_strbuf_prepend_strftime(buf, fmt, tm) eina_strbuf_insert_strftime(buf, fmt, tm, 0)
+#define eina_strbuf_prepend_strftime(buf, fmt, tm) eina_strbuf_insert_strftime(buf, fmt, tm, 0)
/**
* @}
diff --git a/src/lib/eina/eina_strbuf_common.h b/src/lib/eina/eina_strbuf_common.h
index 931cae456d..447cb47a74 100644
--- a/src/lib/eina/eina_strbuf_common.h
+++ b/src/lib/eina/eina_strbuf_common.h
@@ -25,6 +25,7 @@ struct _Eina_Strbuf
#define EINA_MAGIC_CHECK_STRBUF(d, ...) \
do { \
+ if (!(d)) return __VA_ARGS__; \
if (!EINA_MAGIC_CHECK((d), _STRBUF_MAGIC)) \
{ \
EINA_MAGIC_FAIL((d), _STRBUF_MAGIC); \
diff --git a/src/lib/eina/eina_stringshare.c b/src/lib/eina/eina_stringshare.c
index f8510de725..c5ee200880 100644
--- a/src/lib/eina/eina_stringshare.c
+++ b/src/lib/eina/eina_stringshare.c
@@ -61,7 +61,7 @@
#endif
#define DBG(...) EINA_LOG_DOM_DBG(_eina_share_stringshare_log_dom, __VA_ARGS__)
-static int _eina_share_stringshare_log_dom = -1;
+int _eina_share_stringshare_log_dom = -1;
/* The actual share */
static Eina_Share *stringshare_share;
@@ -679,6 +679,8 @@ eina_stringshare_nprintf(unsigned int len, const char *fmt, ...)
if (size < 1)
return "";
+ if ((unsigned int)size > len)
+ size = len;
return eina_stringshare_add_length(tmp, size);
}
diff --git a/src/lib/eina/eina_stringshare.h b/src/lib/eina/eina_stringshare.h
index 8e8f76adba..3c4b836486 100644
--- a/src/lib/eina/eina_stringshare.h
+++ b/src/lib/eina/eina_stringshare.h
@@ -29,9 +29,9 @@
*
* The above copyright notice and this permission notice shall be included in
* all copies of the Software and its Copyright notices. In addition publicly
- * documented acknowledgement must be given that this software has been used if no
+ * documented acknowledgment must be given that this software has been used if no
* source code of this software is made available publicly. This includes
- * acknowledgements in either Copyright notices, Manuals, Publicity and Marketing
+ * acknowledgments in either Copyright notices, Manuals, Publicity and Marketing
* documents or any documentation provided with any product containing this
* software. This License does not apply to any software that links to the
* libraries provided by this software (statically or dynamically), but only to
diff --git a/src/lib/eina/eina_thread.c b/src/lib/eina/eina_thread.c
index a9f39dd2f7..c1a1ef0d22 100644
--- a/src/lib/eina/eina_thread.c
+++ b/src/lib/eina/eina_thread.c
@@ -136,6 +136,9 @@ _eina_internal_call(void *context)
void *r;
pthread_t self;
+ // Default this thread to not cancellable as per Eina documentation
+ eina_thread_cancellable_set(EINA_FALSE, NULL);
+
EINA_THREAD_CLEANUP_PUSH(free, c);
if (c->prio == EINA_THREAD_BACKGROUND ||
diff --git a/src/lib/eina/eina_thread.h b/src/lib/eina/eina_thread.h
index 6ac5968749..076a36d247 100644
--- a/src/lib/eina/eina_thread.h
+++ b/src/lib/eina/eina_thread.h
@@ -34,7 +34,7 @@
/**
* @defgroup Eina_Thread_Group Thread
*
- * Abstracts platform threads, providing a uniform API. It's modelled
+ * Abstracts platform threads, providing a uniform API. It's modeled
* after POSIX THREADS (pthreads), on Linux they are almost 1:1
* mapping.
*
@@ -152,7 +152,7 @@ EAPI Eina_Bool eina_thread_name_set(Eina_Thread t, const char *name);
*
* This function sends a cancellation request to the thread, however
* that request is only fulfilled if the thread is cancellable
- * (eina_thread_cancellable_set() with EINA_TRUE as first paramter)
+ * (eina_thread_cancellable_set() with EINA_TRUE as first parameter)
* and it will wait for a cancellation point, be
* eina_thread_cancel_checkpoint() or some syscall as defined in
* man:pthreads(7).
diff --git a/src/lib/eina/eina_thread_queue.c b/src/lib/eina/eina_thread_queue.c
index d5bee95c44..d6ba62df26 100644
--- a/src/lib/eina/eina_thread_queue.c
+++ b/src/lib/eina/eina_thread_queue.c
@@ -57,6 +57,7 @@ struct _Eina_Thread_Queue_Msg_Block
Eina_Lock lock_non_0_ref; // block non-0 ref state
#ifndef ATOMIC
Eina_Spinlock lock_ref; // lock for ref field
+ Eina_Spinlock lock_first; // lock for first field
#endif
int ref; // the number of open reads/writes
int size; // the total allocated bytes of data[]
@@ -73,9 +74,7 @@ struct _Eina_Thread_Queue_Msg_Block
// avoid reallocation via malloc/free etc. to avoid free memory pages and
// pressure on the malloc subsystem
static int _eina_thread_queue_log_dom = -1;
-static int _eina_thread_queue_block_pool_count = 0;
static Eina_Spinlock _eina_thread_queue_block_pool_lock;
-static Eina_Thread_Queue_Msg_Block *_eina_thread_queue_block_pool = NULL;
#ifdef ERR
# undef ERR
@@ -87,87 +86,63 @@ static Eina_Thread_Queue_Msg_Block *_eina_thread_queue_block_pool = NULL;
#endif
#define DBG(...) EINA_LOG_DOM_DBG(_eina_thread_queue_log_dom, __VA_ARGS__)
+static Eina_Hash *mempools;
+
// api's to get message blocks from the pool or put them back in
static Eina_Thread_Queue_Msg_Block *
_eina_thread_queue_msg_block_new(int size)
{
Eina_Thread_Queue_Msg_Block *blk;
+ Eina_Mempool *mp;
+ size_t mp_size = sizeof(Eina_Thread_Queue_Msg_Block) - sizeof(Eina_Thread_Queue_Msg) + size;
eina_spinlock_take(&(_eina_thread_queue_block_pool_lock));
- if (_eina_thread_queue_block_pool)
+ mp = eina_hash_find(mempools, &size);
+ if (!mp)
{
- blk = _eina_thread_queue_block_pool;
- if (blk->size >= size)
- {
- blk->first = 0;
- blk->last = 0;
- blk->ref = 0;
- blk->full = 0;
- _eina_thread_queue_block_pool = blk->next;
- blk->next = NULL;
- _eina_thread_queue_block_pool_count--;
- eina_spinlock_release(&(_eina_thread_queue_block_pool_lock));
- return blk;
- }
- blk = NULL;
+ const char *choice = getenv("EINA_MEMPOOL");
+ if ((!choice) || (!choice[0]))
+ choice = "chained_mempool";
+ mp = eina_mempool_add(choice, "Eina_Thread_Queue_Msg_Block", NULL, mp_size, 16);
+ eina_hash_add(mempools, &size, mp);
}
eina_spinlock_release(&(_eina_thread_queue_block_pool_lock));
- blk = malloc(sizeof(Eina_Thread_Queue_Msg_Block) -
- sizeof(Eina_Thread_Queue_Msg) +
- size);
+ blk = eina_mempool_calloc(mp, mp_size);
if (!blk)
{
ERR("Thread queue block buffer of size %i allocation failed", size);
return NULL;
}
- blk->next = NULL;
#ifndef ATOMIC
eina_spinlock_new(&(blk->lock_ref));
+ eina_spinlock_new(&(blk->lock_first));
#endif
eina_lock_new(&(blk->lock_non_0_ref));
blk->size = size;
- blk->first = 0;
- blk->last = 0;
- blk->ref = 0;
- blk->full = 0;
return blk;
}
static void
-_eina_thread_queue_msg_block_real_free(Eina_Thread_Queue_Msg_Block *blk)
+_eina_thread_queue_msg_block_free(Eina_Thread_Queue_Msg_Block *blk)
{
+ Eina_Mempool *mp;
+
+ eina_spinlock_take(&(_eina_thread_queue_block_pool_lock));
+ mp = eina_hash_find(mempools, &blk->size);
+ eina_spinlock_release(&(_eina_thread_queue_block_pool_lock));
eina_lock_take(&(blk->lock_non_0_ref));
eina_lock_release(&(blk->lock_non_0_ref));
eina_lock_free(&(blk->lock_non_0_ref));
#ifndef ATOMIC
- eina_lock_take(&(blk->lock_ref));
- eina_lock_release(&(blk->lock_ref));
+ eina_spinlock_take(&(blk->lock_ref));
+ eina_spinlock_release(&(blk->lock_ref));
eina_spinlock_free(&(blk->lock_ref));
+ eina_spinlock_take(&(blk->lock_first));
+ eina_spinlock_release(&(blk->lock_first));
+ eina_spinlock_free(&(blk->lock_first));
#endif
- free(blk);
-}
-
-static void
-_eina_thread_queue_msg_block_free(Eina_Thread_Queue_Msg_Block *blk)
-{
- if (blk->size == MIN_SIZE)
- {
- eina_spinlock_take(&(_eina_thread_queue_block_pool_lock));
- if (_eina_thread_queue_block_pool_count < 20)
- {
- _eina_thread_queue_block_pool_count++;
- blk->next = _eina_thread_queue_block_pool;
- _eina_thread_queue_block_pool = blk;
- eina_spinlock_release(&(_eina_thread_queue_block_pool_lock));
- }
- else
- {
- eina_spinlock_release(&(_eina_thread_queue_block_pool_lock));
- _eina_thread_queue_msg_block_real_free(blk);
- }
- }
- else _eina_thread_queue_msg_block_real_free(blk);
+ eina_mempool_free(mp, blk);
}
static Eina_Bool
@@ -179,21 +154,6 @@ _eina_thread_queue_msg_block_pool_init(void)
static void
_eina_thread_queue_msg_block_pool_shutdown(void)
{
- eina_spinlock_take(&(_eina_thread_queue_block_pool_lock));
- while (_eina_thread_queue_block_pool)
- {
- Eina_Thread_Queue_Msg_Block *blk, *blknext;
-
- for (;;)
- {
- blk = _eina_thread_queue_block_pool;
- if (!blk) break;
- blknext = blk->next;
- _eina_thread_queue_msg_block_real_free(blk);
- _eina_thread_queue_block_pool = blknext;
- }
- }
- eina_spinlock_release(&(_eina_thread_queue_block_pool_lock));
eina_spinlock_free(&_eina_thread_queue_block_pool_lock);
}
@@ -220,24 +180,21 @@ _eina_thread_queue_msg_alloc(Eina_Thread_Queue *thq, int size, Eina_Thread_Queue
{
Eina_Thread_Queue_Msg_Block *blk;
Eina_Thread_Queue_Msg *msg = NULL;
+ int ref;
// round up to nearest 8
size = ((size + 7) >> 3) << 3;
if (!thq->data)
{
- if (size < MIN_SIZE)
- thq->data = _eina_thread_queue_msg_block_new(MIN_SIZE);
- else
- thq->data = _eina_thread_queue_msg_block_new(size);
+ size = MAX(size, MIN_SIZE);
+ thq->data = _eina_thread_queue_msg_block_new(size);
thq->last = thq->data;
}
blk = thq->last;
if (blk->full)
{
- if (size < MIN_SIZE)
- blk->next = _eina_thread_queue_msg_block_new(MIN_SIZE);
- else
- blk->next = _eina_thread_queue_msg_block_new(size);
+ size = MAX(size, MIN_SIZE);
+ blk->next = _eina_thread_queue_msg_block_new(size);
blk = blk->next;
thq->last = blk;
}
@@ -249,10 +206,8 @@ _eina_thread_queue_msg_alloc(Eina_Thread_Queue *thq, int size, Eina_Thread_Queue
}
else
{
- if (size < MIN_SIZE)
- blk->next = _eina_thread_queue_msg_block_new(MIN_SIZE);
- else
- blk->next = _eina_thread_queue_msg_block_new(size);
+ size = MAX(size, MIN_SIZE);
+ blk->next = _eina_thread_queue_msg_block_new(size);
blk = blk->next;
thq->last = blk;
blk->last += size;
@@ -261,16 +216,14 @@ _eina_thread_queue_msg_alloc(Eina_Thread_Queue *thq, int size, Eina_Thread_Queue
}
msg->size = size;
#ifdef ATOMIC
- {
- int ref = __atomic_add_fetch(&(blk->ref), 1, __ATOMIC_RELAXED);
- if (ref == 1) eina_lock_take(&(blk->lock_non_0_ref));
- }
+ ref = __atomic_add_fetch(&(blk->ref), 1, __ATOMIC_RELAXED);
#else
eina_spinlock_take(&(blk->lock_ref));
blk->ref++;
- if (blk->ref == 1) eina_lock_take(&(blk->lock_non_0_ref));
+ ref = blk->ref;
eina_spinlock_release(&(blk->lock_ref));
#endif
+ if (ref == 1) eina_lock_take(&(blk->lock_non_0_ref));
*blkret = blk;
return msg;
}
@@ -278,17 +231,16 @@ _eina_thread_queue_msg_alloc(Eina_Thread_Queue *thq, int size, Eina_Thread_Queue
static void
_eina_thread_queue_msg_alloc_done(Eina_Thread_Queue_Msg_Block *blk)
{
+ int ref;
#ifdef ATOMIC
- {
- int ref = __atomic_sub_fetch(&(blk->ref), 1, __ATOMIC_RELAXED);
- if (ref == 0) eina_lock_release(&(blk->lock_non_0_ref));
- }
+ ref = __atomic_sub_fetch(&(blk->ref), 1, __ATOMIC_RELAXED);
#else
eina_spinlock_take(&(blk->lock_ref));
blk->ref--;
- if (blk->ref == 0) eina_lock_release(&(blk->lock_non_0_ref));
+ ref = blk->ref;
eina_spinlock_release(&(blk->lock_ref));
#endif
+ if (ref == 0) eina_lock_release(&(blk->lock_non_0_ref));
}
static Eina_Thread_Queue_Msg *
@@ -296,7 +248,7 @@ _eina_thread_queue_msg_fetch(Eina_Thread_Queue *thq, Eina_Thread_Queue_Msg_Block
{
Eina_Thread_Queue_Msg_Block *blk;
Eina_Thread_Queue_Msg *msg;
- int ref;
+ int ref, first;
if (!thq->read)
{
@@ -323,9 +275,17 @@ _eina_thread_queue_msg_fetch(Eina_Thread_Queue *thq, Eina_Thread_Queue_Msg_Block
RWLOCK_UNLOCK(&(thq->lock_write));
}
blk = thq->read;
+#ifdef ATOMIC
+ __atomic_load(&blk->first, &first, __ATOMIC_RELAXED);
+ msg = (Eina_Thread_Queue_Msg *)((char *)(&(blk->data[0])) + first);
+ first = __atomic_add_fetch(&(blk->first), msg->size, __ATOMIC_RELAXED);
+#else
+ eina_spinlock_take(&blk->lock_first);
msg = (Eina_Thread_Queue_Msg *)((char *)(&(blk->data[0])) + blk->first);
- blk->first += msg->size;
- if (blk->first >= blk->last) thq->read = NULL;
+ first = blk->first += msg->size;
+ eina_spinlock_release(&blk->lock_first);
+#endif
+ if (first >= blk->last) thq->read = NULL;
*blkret = blk;
#ifdef ATOMIC
__atomic_add_fetch(&(blk->ref), 1, __ATOMIC_RELAXED);
@@ -340,17 +300,21 @@ _eina_thread_queue_msg_fetch(Eina_Thread_Queue *thq, Eina_Thread_Queue_Msg_Block
static void
_eina_thread_queue_msg_fetch_done(Eina_Thread_Queue_Msg_Block *blk)
{
- int ref;
+ int ref, first;
#ifdef ATOMIC
ref = __atomic_sub_fetch(&(blk->ref), 1, __ATOMIC_RELAXED);
+ __atomic_load(&blk->first, &first, __ATOMIC_RELAXED);
#else
eina_spinlock_take(&(blk->lock_ref));
blk->ref--;
ref = blk->ref;
eina_spinlock_release(&(blk->lock_ref));
+ eina_spinlock_take(&blk->lock_first);
+ first = blk->first;
+ eina_spinlock_release(&blk->lock_first);
#endif
- if ((blk->first >= blk->last) && (ref == 0))
+ if ((first >= blk->last) && (ref == 0))
_eina_thread_queue_msg_block_free(blk);
}
@@ -371,6 +335,7 @@ eina_thread_queue_init(void)
ERR("Cannot init thread queue block pool spinlock");
return EINA_FALSE;
}
+ mempools = eina_hash_int32_new((Eina_Free_Cb)eina_mempool_del);
return EINA_TRUE;
}
@@ -379,6 +344,7 @@ eina_thread_queue_shutdown(void)
{
_eina_thread_queue_msg_block_pool_shutdown();
eina_log_domain_unregister(_eina_thread_queue_log_dom);
+ eina_hash_free(mempools);
return EINA_TRUE;
}
diff --git a/src/lib/eina/eina_tiler.c b/src/lib/eina/eina_tiler.c
index 7597d1e286..c4c04d8641 100644
--- a/src/lib/eina/eina_tiler.c
+++ b/src/lib/eina/eina_tiler.c
@@ -1216,7 +1216,7 @@ _rect_same(Eina_Rectangle *rec1, Eina_Rectangle *rec2)
// this is ok because all the rects being compared will be aligned to 8bytes
Rectangle_Same *same1 = (Rectangle_Same *)rec1;
Rectangle_Same *same2 = (Rectangle_Same *)rec2;
- return ((same1->x == same2->y) && (same1->y == same2->y));
+ return ((same1->x == same2->x) && (same1->y == same2->y));
}
EAPI Eina_Bool eina_tiler_rect_add(Eina_Tiler *t, const Eina_Rectangle *r)
@@ -1237,7 +1237,7 @@ EAPI Eina_Bool eina_tiler_rect_add(Eina_Tiler *t, const Eina_Rectangle *r)
return EINA_FALSE;
if (_rect_same(&tmp, &t->last.add))
- return EINA_FALSE;
+ return EINA_TRUE;
t->last.add = tmp;
t->last.del.w = t->last.del.h = -1;
diff --git a/src/lib/eina/eina_tiler.h b/src/lib/eina/eina_tiler.h
index 12ca23bc33..c6dd492d2f 100644
--- a/src/lib/eina/eina_tiler.h
+++ b/src/lib/eina/eina_tiler.h
@@ -358,7 +358,7 @@ EAPI Eina_Tiler *eina_tiler_intersection(Eina_Tiler *t1, Eina_Tiler *t2);
*
* @param t1 The first tiler.
* @param t2 The second tiler.
- * @return #EINA_TRUE is equal, #EINA_FALSE is inequal.
+ * @return #EINA_TRUE if equal, #EINA_FALSE if unequal.
*
* This function gets result of comparison for @p t1 and @p t2.
* It returns #EINA_TRUE if tilers are equal.
diff --git a/src/lib/eina/eina_tmpstr.h b/src/lib/eina/eina_tmpstr.h
index f4df1984c7..f300be13c3 100644
--- a/src/lib/eina/eina_tmpstr.h
+++ b/src/lib/eina/eina_tmpstr.h
@@ -135,7 +135,7 @@ typedef const char Eina_Tmpstr;
*
* If @p str is NULL, or no memory space exists to store the tmpstr, then
* NULL will be returned, otherwise a valid string pointer will be returned
- * that you can treat as any other C string (eg strdup(tmpstr) or
+ * that you can treat as any other C string (e.g. strdup(tmpstr) or
* printf("%s\n", tmpstr) etc.). This string should be considered read-only
* and immutable, and when you are done with the string you should delete it
* with eina_tmpstr_del().
@@ -180,7 +180,7 @@ EAPI Eina_Tmpstr *eina_tmpstr_add(const char *str) EINA_WARN_UNUSED_RESULT;
*
* If @p str is NULL, or no memory space exists to store the tmpstr, then
* NULL will be returned, otherwise a valid string pointer will be returned
- * that you can treat as any other C string (eg strdup(tmpstr) or
+ * that you can treat as any other C string (e.g. strdup(tmpstr) or
* printf("%s\n", tmpstr) etc.). This string should be considered read-only
* and immutable, and when you are done with the string you should delete it
* with eina_tmpstr_del().
diff --git a/src/lib/eina/eina_types.h b/src/lib/eina/eina_types.h
index 94e6ebc6f3..84979022c9 100644
--- a/src/lib/eina/eina_types.h
+++ b/src/lib/eina/eina_types.h
@@ -36,15 +36,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_EINA_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EINA_BUILD */
+# endif
# define EAPI_WEAK
#else
# ifdef __GNUC__
@@ -184,6 +184,14 @@
# define EINA_PURE
# endif
+# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
+# define EINA_HOT __attribute__ ((hot))
+# define EINA_COLD __attribute__ ((cold))
+# else
+# define EINA_HOT
+# define EINA_COLD
+# endif
+
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 3)
# define EINA_PRINTF(fmt, arg) __attribute__((__format__ (__gnu_printf__, fmt, arg)))
diff --git a/src/lib/eina/eina_unicode.h b/src/lib/eina/eina_unicode.h
index f33c171890..e32d0591f3 100644
--- a/src/lib/eina/eina_unicode.h
+++ b/src/lib/eina/eina_unicode.h
@@ -68,7 +68,7 @@ EAPI Eina_Unicode *eina_unicode_strdup(const Eina_Unicode *text) EINA_WARN_UNUSE
* @param n The maximum size of the text to duplicate.
* @return The duplicated string.
*
- * This function duplicates @p text. The resuting string is cut on @p
+ * This function duplicates @p text. The resulting string is cut on @p
* n. @p n is assumed to be lesser (<) than the length of @p
* text. When not needed anymore, the returned string must be freed.
*
diff --git a/src/lib/eina/eina_ustrbuf.h b/src/lib/eina/eina_ustrbuf.h
index f3ea97d931..0030735a5d 100644
--- a/src/lib/eina/eina_ustrbuf.h
+++ b/src/lib/eina/eina_ustrbuf.h
@@ -9,10 +9,11 @@
/**
* @addtogroup Eina_Unicode_String_Buffer_Group Unicode String Buffer
*
- * @brief These functions provide unicode string buffers management.
+ * @brief These functions provide unicode string buffer management.
*
- * The Unicode String Buffer data type is designed to be a mutable string,
- * allowing to append, prepend or insert a string to a buffer.
+ * The Unicode String Buffer data type is designed to be a mutable
+ * string, allowing the appending, prepending or insertion of a string
+ * to a buffer.
*/
/**
@@ -29,17 +30,17 @@
/**
* @typedef Eina_UStrbuf
- * Type for a string buffer.
+ * Type for a unicode string buffer.
*/
typedef struct _Eina_Strbuf Eina_UStrbuf;
/**
- * @brief Creates a new string buffer.
+ * @brief Creates a new unicode string buffer.
*
- * @return Newly allocated string buffer instance.
+ * @return Newly allocated string buffer instance, or @c NULL on error.
*
- * This function creates a new string buffer. On error, @c NULL is
- * returned. To free the resources, use eina_ustrbuf_free().
+ * This function creates a new string buffer. To free the resources, use
+ * eina_ustrbuf_free().
*
* @see eina_ustrbuf_free()
* @see eina_ustrbuf_append()
@@ -48,36 +49,38 @@ typedef struct _Eina_Strbuf Eina_UStrbuf;
EAPI Eina_UStrbuf *eina_ustrbuf_new(void) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
/**
- * @brief Creates a new string buffer using the passed string. The passed
- * string is used directly as the buffer, it's somehow the opposite function of
- * @ref eina_ustrbuf_string_steal . The passed string must be malloc'd.
+ * @brief Creates a new string buffer using the passed string.
*
- * @param str The string to manage
- * @return Newly allocated string buffer instance
+ * @param[in] str The string to manage.
+ * @return Newly allocated string buffer instance, or @c NULL on error.
*
- * This function creates a new string buffer. On error, @c NULL is
- * returned. To free the resources, use eina_strbuf_free().
+ * This function creates a new unicode string buffer. The passed string
+ * is used directly as the buffer, it's effectively the inverse of
+ * eina_ustrbuf_string_steal(). The passed string must be malloc'd.
+ * To free the resources, use eina_ustrbuf_free().
*
* @see eina_ustrbuf_free()
* @see eina_ustrbuf_append()
* @see eina_ustrbuf_string_get()
+ *
* @since 1.1.0
*/
EAPI Eina_UStrbuf *eina_ustrbuf_manage_new(Eina_Unicode *str) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
/**
- * @brief Creates a new string buffer using the passed string. The passed
- * string is used directly as the buffer, it's somehow the opposite function of
- * @ref eina_ustrbuf_string_steal . The passed string must be malloc'd.
+ * @brief Creates a new string buffer using the passed string.
*
- * @param str The string to manage
- * @param length The length of the string.
- * @return Newly allocated string buffer instance.
+ * @param[in] str The string to manage.
+ * @param[in] length The length of the string.
+ * @return Newly allocated string buffer instance, or @c NULL on error.
*
- * This function creates a new string buffer. On error, @c NULL is
- * returned. To free the resources, use eina_ustrbuf_free().
+ * This function creates a new string buffer. The passed string is used
+ * directly as the buffer, it's effectively the inverse of
+ * eina_ustrbuf_string_steal(). The passed string must be malloc'd. To
+ * free the resources, use eina_ustrbuf_free().
*
* @see eina_ustrbuf_manage_new()
+ *
* @since 1.2.0
*/
EAPI Eina_UStrbuf *eina_ustrbuf_manage_new_length(Eina_Unicode *str, size_t length) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
@@ -85,7 +88,7 @@ EAPI Eina_UStrbuf *eina_ustrbuf_manage_new_length(Eina_Unicode *str, size_t leng
/**
* @brief Frees a string buffer.
*
- * @param buf The string buffer to free.
+ * @param[in,out] buf The string buffer to free.
*
* This function frees the memory of @p buf. @p buf must have been
* created by eina_ustrbuf_new().
@@ -95,25 +98,24 @@ EAPI void eina_ustrbuf_free(Eina_UStrbuf *buf) EINA_ARG_NONNULL(1);
/**
* @brief Resets a string buffer.
*
- * @param buf The string buffer to reset.
+ * @param[in,out] buf The string buffer.
*
- * This function reset @p buf: the buffer len is set to 0, and the
- * string is set to '\\0'. No memory is free'd.
+ * This function resets @p buf: the buffer len is set to 0, and the
+ * string data is set to '\\0'. No memory is freed.
*/
EAPI void eina_ustrbuf_reset(Eina_UStrbuf *buf) EINA_ARG_NONNULL(1);
/**
* @brief Appends a string to a buffer, reallocating as necessary.
*
- * @param buf The string buffer to append to.
- * @param str The string to append.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The string to append.
+ * @return #EINA_TRUE on success, #EINA_FALSE on failure such as if
+ * @p str could not be appended.
*
* This function appends @p str to @p buf. It computes the length of
* @p str, so is slightly slower than eina_ustrbuf_append_length(). If
- * the length is known beforehand, consider using that variant. If
- * @p buf can't append it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
- * returned.
+ * the length is known beforehand, consider using that variant.
*
* @see eina_ustrbuf_append()
* @see eina_ustrbuf_append_length()
@@ -123,13 +125,11 @@ EAPI Eina_Bool eina_ustrbuf_append(Eina_UStrbuf *buf, const Eina_Unicode *str) E
/**
* @brief Appends an escaped string to a buffer, reallocating as necessary.
*
- * @param buf The string buffer to append to.
- * @param str The string to append.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The string to append.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p str could not be appended.
*
- * This function appends the escaped string @p str to @p buf. If @p
- * str can not be appended, #EINA_FALSE is returned, otherwise, #EINA_TRUE is
- * returned.
+ * This function appends the escaped string @p str to @p buf.
*/
EAPI Eina_Bool eina_ustrbuf_append_escaped(Eina_UStrbuf *buf, const Eina_Unicode *str) EINA_ARG_NONNULL(1, 2);
@@ -137,19 +137,17 @@ EAPI Eina_Bool eina_ustrbuf_append_escaped(Eina_UStrbuf *buf, const Eina_Unicode
* @brief Appends a string to a buffer, reallocating as necessary,
* limited by the given length.
*
- * @param buf The string buffer to append to.
- * @param str The string to append.
- * @param maxlen The maximum number of characters to append.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The string to append.
+ * @param[in] maxlen The maximum number of characters to append.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p str could not be appended.
*
* This function appends at most @p maxlen characters of @p str to
* @p buf. It can't append more than the length of @p str. It
* computes the length of @p str, so is slightly slower than
* eina_ustrbuf_append_length(). If the length is known beforehand,
* consider using that variant (@p maxlen should then be checked so
- * that it is greater than the size of @p str). If @p str can not be
- * appended, #EINA_FALSE is returned, otherwise, #EINA_TRUE is
- * returned.
+ * that it is greater than the size of @p str).
*
* @see eina_ustrbuf_append()
* @see eina_ustrbuf_append_length()
@@ -157,19 +155,18 @@ EAPI Eina_Bool eina_ustrbuf_append_escaped(Eina_UStrbuf *buf, const Eina_Unicode
EAPI Eina_Bool eina_ustrbuf_append_n(Eina_UStrbuf *buf, const Eina_Unicode *str, size_t maxlen) EINA_ARG_NONNULL(1, 2);
/**
- * @brief Appends a string of exact length to a buffer, reallocating as necessary.
+ * @brief Appends a string of exact length to a buffer, reallocating as
+ * necessary.
*
- * @param buf The string buffer to append to.
- * @param str The string to append.
- * @param length The exact length to use.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The string to append.
+ * @param[in] length The exact length to use.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p str could not be appended.
*
* This function appends @p str to @p buf. @p str must be of size at
* most @p length. It is slightly faster than eina_ustrbuf_append() as
* it does not compute the size of @p str. It is useful when dealing
- * with strings of known size, such as eina_strngshare. If @p buf
- * can't append it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
- * returned.
+ * with strings of known size, such as eina_stringshare.
*
* @see eina_stringshare_length()
* @see eina_ustrbuf_append()
@@ -180,12 +177,11 @@ EAPI Eina_Bool eina_ustrbuf_append_length(Eina_UStrbuf *buf, const Eina_Unicode
/**
* @brief Appends a slice to a buffer, reallocating as necessary.
*
- * @param buf The string buffer to append to.
- * @param slice The slice to append.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] slice The slice to append.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p slice could not be appended.
*
- * This function appends @p slice to @p buf. If @p buf can't append
- * it, #EINA_FALSE is returned, otherwise #EINA_TRUE is returned.
+ * This function appends @p slice to @p buf.
*
* @since 1.19.0
*/
@@ -195,28 +191,26 @@ EAPI Eina_Bool eina_ustrbuf_append_slice(Eina_UStrbuf *buf, const Eina_Slice sli
* @brief Appends a character to a string buffer, reallocating as
* necessary.
*
- * @param buf The string buffer to append to.
- * @param c The char to append.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] c The char to append.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p c could not be appended.
*
- * This function inserts @p c to @p buf. If it can not insert it, #EINA_FALSE
- * is returned, otherwise #EINA_TRUE is returned.
+ * This function appends @p c to @p buf.
*/
EAPI Eina_Bool eina_ustrbuf_append_char(Eina_UStrbuf *buf, Eina_Unicode c) EINA_ARG_NONNULL(1);
/**
* @brief Inserts a string to a buffer, reallocating as necessary.
*
- * @param buf The string buffer to insert.
- * @param str The string to insert.
- * @param pos The position to insert the string.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The string to insert.
+ * @param[in] pos The position to insert the string.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p str could not be inserted.
*
* This function inserts @p str to @p buf at position @p pos. It
* computes the length of @p str, so is slightly slower than
* eina_ustrbuf_insert_length(). If the length is known beforehand,
- * consider using that variant. If @p buf can't insert it, #EINA_FALSE
- * is returned, otherwise #EINA_TRUE is returned.
+ * consider using that variant.
*/
EAPI Eina_Bool eina_ustrbuf_insert(Eina_UStrbuf *buf, const Eina_Unicode *str, size_t pos) EINA_ARG_NONNULL(1, 2);
@@ -224,52 +218,48 @@ EAPI Eina_Bool eina_ustrbuf_insert(Eina_UStrbuf *buf, const Eina_Unicode *str, s
* @brief Inserts an escaped string to a buffer, reallocating as
* necessary.
*
- * @param buf The string buffer to insert to.
- * @param str The string to insert.
- * @param pos The position to insert the string.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The string to insert.
+ * @param[in] pos The position to insert the string.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p str could not be inserted.
*
* This function inserts the escaped string @p str to @p buf at
- * position @p pos. If @p buf can't insert @p str, #EINA_FALSE is
- * returned, otherwise #EINA_TRUE is returned.
+ * position @p pos.
*/
EAPI Eina_Bool eina_ustrbuf_insert_escaped(Eina_UStrbuf *buf, const Eina_Unicode *str, size_t pos) EINA_ARG_NONNULL(1, 2);
/**
* @brief Inserts a string to a buffer, reallocating as necessary. Limited by maxlen.
*
- * @param buf The string buffer to insert to.
- * @param str The string to insert.
- * @param maxlen The maximum number of chars to insert.
- * @param pos The position to insert the string.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The string to insert.
+ * @param[in] maxlen The maximum number of chars to insert.
+ * @param[in] pos The position to insert the string.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p str could not be inserted.
*
- * This function inserts @p str ot @p buf at position @p pos, with at
- * most @p maxlen bytes. The number of inserted characters can not be
+ * This function inserts @p str into @p buf at position @p pos, with at
+ * most @p maxlen bytes. The number of inserted characters cannot be
* greater than the length of @p str. It computes the length of
* @p str, so is slightly slower than eina_ustrbuf_insert_length(). If the
* length is known beforehand, consider using that variant (@p maxlen
* should then be checked so that it is greater than the size of
- * @p str). If @p str can not be inserted, #EINA_FALSE is returned,
- * otherwise, #EINA_TRUE is returned.
+ * @p str).
*/
EAPI Eina_Bool eina_ustrbuf_insert_n(Eina_UStrbuf *buf, const Eina_Unicode *str, size_t maxlen, size_t pos) EINA_ARG_NONNULL(1, 2);
/**
* @brief Inserts a string of exact length to a buffer, reallocating as necessary.
*
- * @param buf The string buffer to insert to.
- * @param str The string to insert.
- * @param length The exact length to use.
- * @param pos The position to insert the string.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The string to insert.
+ * @param[in] length The exact length to use.
+ * @param[in] pos The position to insert the string.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p str could not be inserted.
*
- * This function inserts @p str to @p buf. @p str must be of size at
- * most @p length. It is slightly faster than eina_ustrbuf_insert() as
+ * This function inserts @p str into @p buf. @p str must be no longer
+ * than @p length. It is slightly faster than eina_ustrbuf_insert() as
* it does not compute the size of @p str. It is useful when dealing
- * with strings of known size, such as eina_strngshare. If @p buf
- * can't insert it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
- * returned.
+ * with strings of known size, such as eina_stringshare.
*
* @see eina_stringshare_length()
* @see eina_ustrbuf_insert()
@@ -280,14 +270,12 @@ EAPI Eina_Bool eina_ustrbuf_insert_length(Eina_UStrbuf *buf, const Eina_Unicode
/**
* @brief Inserts a slice to a buffer, reallocating as necessary.
*
- * @param buf The string buffer to insert to.
- * @param slice The slice to insert.
- * @param pos The position to insert the string.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] slice The slice to insert.
+ * @param[in] pos The position to insert the string.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p slice could not be inserted.
*
- * This function inserts @p slice to @p buf at position @p pos. If @p
- * buf can't insert it, #EINA_FALSE is returned, otherwise #EINA_TRUE
- * is returned.
+ * This function inserts @p slice to @p buf at position @p pos.
*
* @since 1.19.0
*/
@@ -297,102 +285,90 @@ EAPI Eina_Bool eina_ustrbuf_insert_slice(Eina_UStrbuf *buf, const Eina_Slice sli
* @brief Inserts a character to a string buffer, reallocating as
* necessary.
*
- * @param buf The string buffer to insert to.
- * @param c The char to insert.
- * @param pos The position to insert the char.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] c The char to insert.
+ * @param[in] pos The position to insert the char.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p c could not be inserted.
*
- * This function inserts @p c to @p buf at position @p pos. If @p buf
- * can't append it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
- * returned.
+ * This function inserts @p c to @p buf at position @p pos.
*/
EAPI Eina_Bool eina_ustrbuf_insert_char(Eina_UStrbuf *buf, Eina_Unicode c, size_t pos) EINA_ARG_NONNULL(1);
/**
* @def eina_ustrbuf_prepend(buf, str)
- * @brief Prepends the given string to the given buffer.
+ * @brief Prepends a string to the given buffer.
*
- * @param buf The string buffer to prepend to.
- * @param str The string to prepend.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The string to prepend.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p str could not be prepended.
*
- * This macro is calling eina_ustrbuf_insert() at position 0. If @p buf
- * can't prepend it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
- * returned.
+ * This macro simply calls eina_ustrbuf_insert() with position 0.
*/
-#define eina_ustrbuf_prepend(buf, str) eina_ustrbuf_insert(buf, str, 0)
+#define eina_ustrbuf_prepend(buf, str) eina_ustrbuf_insert(buf, str, 0)
/**
* @def eina_ustrbuf_prepend_escaped(buf, str)
- * @brief Prepends the given escaped string to the given buffer.
+ * @brief Prepends an escaped string to the given buffer.
*
- * @param buf The string buffer to prepend to.
- * @param str The string to prepend.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The string to prepend.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p str could not be prepended.
*
- * This macro is calling eina_ustrbuf_insert_escaped() at position 0. If
- * @p buf can't prepend it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
- * returned.
+ * This macro simply calls eina_ustrbuf_insert_escaped() with position 0.
*/
-#define eina_ustrbuf_prepend_escaped(buf, str) eina_ustrbuf_insert_escaped(buf, str, 0)
+#define eina_ustrbuf_prepend_escaped(buf, str) eina_ustrbuf_insert_escaped(buf, str, 0)
/**
* @def eina_ustrbuf_prepend_n(buf, str)
- * @brief Prepends the given escaped string to the given buffer.
+ * @brief Prepends an escaped string to the given buffer.
*
- * @param buf The string buffer to prepend to.
- * @param str The string to prepend.
- * @param maxlen The maximum number of Eina_Unicode *s to prepend.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The string to prepend.
+ * @param[in] maxlen The maximum number of Eina_Unicode *s to prepend.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @str could not be prepended.
*
- * This macro is calling eina_ustrbuf_insert_n() at position 0. If
- * @p buf can't prepend it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
- * returned.
+ * This macro simply calls eina_ustrbuf_insert_n() with position 0.
*/
-#define eina_ustrbuf_prepend_n(buf, str, maxlen) eina_ustrbuf_insert_n(buf, str, maxlen, 0)
+#define eina_ustrbuf_prepend_n(buf, str, maxlen) eina_ustrbuf_insert_n(buf, str, maxlen, 0)
/**
* @def eina_ustrbuf_prepend_length(buf, str)
- * @brief Prepends the given escaped string to the given buffer.
+ * @brief Prepends an escaped string to the given buffer.
*
- * @param buf The string buffer to prepend to.
- * @param str The string to prepend.
- * @param length The exact length to use.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The string to prepend.
+ * @param[in] length The exact length to use.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p str could not be prepended.
*
- * This macro is calling eina_ustrbuf_insert_length() at position 0. If
- * @p buf can't prepend it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
- * returned.
+ * This macro simply calls eina_ustrbuf_insert_length() with position 0.
*/
#define eina_ustrbuf_prepend_length(buf, str, length) eina_ustrbuf_insert_length(buf, str, length, 0)
/**
* @def eina_ustrbuf_prepend_char(buf, c)
- * @brief Prepends the given unicode character to the given buffer.
+ * @brief Prepends a unicode character to the given buffer.
*
- * @param buf The string buffer to prepend to.
- * @param c The Eina_Unicode character to prepend.
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ * @param[in,out] buf The string buffer.
+ * @param[in] c The Eina_Unicode character to prepend.
+ * @return #EINA_TRUE on success, #EINA_FALSE if @p c could not be prepended.
*
- * This macro is calling eina_ustrbuf_insert_Eina_Unicode *() at position 0. If
- * @p buf can't prepend it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
- * returned.
+ * This macro is calling eina_ustrbuf_insert_Eina_Unicode() at position 0.
*/
#define eina_ustrbuf_prepend_char(buf, c) eina_ustrbuf_insert_char(buf, c, 0)
/**
- * @brief Removes a slice of the given string buffer.
+ * @brief Removes a section of the given string buffer.
*
- * @param buf The string buffer to remove a slice.
- * @param start The initial (inclusive) slice position to start
+ * @param[in,out] buf The string buffer to remove a slice.
+ * @param[in] start The initial (inclusive) slice position to start
* removing, in bytes.
- * @param end The final (non-inclusive) slice position to finish
+ * @param[in] end The final (non-inclusive) slice position to finish
* removing, in bytes.
* @return #EINA_TRUE on success, #EINA_FALSE on failure.
*
* This function removes a slice of @p buf, starting at @p start
* (inclusive) and ending at @p end (non-inclusive). Both values are
- * in bytes. It returns #EINA_FALSE on failure, #EINA_TRUE otherwise.
+ * in bytes.
*/
EAPI Eina_Bool
eina_ustrbuf_remove(Eina_UStrbuf *buf, size_t start, size_t end) EINA_ARG_NONNULL(1);
@@ -400,13 +376,13 @@ eina_ustrbuf_remove(Eina_UStrbuf *buf, size_t start, size_t end) EINA_ARG_NONNUL
/**
* @brief Retrieves a pointer to the contents of a string buffer.
*
- * @param buf The string buffer.
+ * @param[in] buf The string buffer.
* @return The current string in the string buffer.
*
* This function returns the string contained in @p buf. The returned
* value must not be modified and will no longer be valid if @p buf is
- * modified. In other words, any eina_ustrbuf_append() or similar will
- * make that pointer invalid.
+ * modified. In other words, calling eina_ustrbuf_append() or similar
+ * functions will make this pointer invalid.
*
* @see eina_ustrbuf_string_steal()
*/
@@ -416,8 +392,8 @@ eina_ustrbuf_string_get(const Eina_UStrbuf *buf) EINA_ARG_NONNULL(1) EINA_WARN_U
/**
* @brief Steals the contents of a string buffer.
*
- * @param buf The string buffer to steal.
- * @return The current string in the string buffer.
+ * @param[in] buf The string buffer.
+ * @return The string that was contained in @p buf.
*
* This function returns the string contained in @p buf. @p buf is
* then initialized and does not own the returned string anymore. The
@@ -432,7 +408,7 @@ eina_ustrbuf_string_steal(Eina_UStrbuf *buf) EINA_MALLOC EINA_WARN_UNUSED_RESULT
/**
* @brief Frees the contents of a string buffer but not the buffer.
*
- * @param buf The string buffer to free the string of.
+ * @param[in,out] buf The string buffer.
*
* This function frees the string contained in @p buf without freeing
* @p buf.
@@ -441,9 +417,9 @@ EAPI void
eina_ustrbuf_string_free(Eina_UStrbuf *buf) EINA_ARG_NONNULL(1);
/**
- * @brief Retrieves the length of the string buffer content.
+ * @brief Retrieves the length of the string buffer's content.
*
- * @param buf The string buffer.
+ * @param[in] buf The string buffer.
* @return The current length of the string, in bytes.
*
* This function returns the length of @p buf.
@@ -452,35 +428,34 @@ EAPI size_t
eina_ustrbuf_length_get(const Eina_UStrbuf *buf) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
/**
- * @brief Gets a read-only slice representing the current ustrbuf contents.
+ * @brief Gets a read-only slice of the buffer contents.
*
- * @param buf The source string.
+ * @param[in] buf The string buffer.
* @return A read-only slice for the current contents. It may become
- * invalid as soon as the @a buf is changed.
+ * invalid as soon as @a buf is changed.
*
* @since 1.19
*/
EAPI Eina_Slice eina_ustrbuf_slice_get(const Eina_UStrbuf *buf) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
/**
- * @brief Gets a read-write slice representing the current ustrbuf contents.
+ * @brief Gets a read-write slice of the buffer contents.
*
- * @param buf The source string.
+ * @param[in] buf The string buffer.
* @return A read-write slice for the current contents. It may become
- * invalid as soon as the @a buf is changed with calls such as
- * eina_ustrbuf_append(), eina_ustrbuf_remove()
+ * invalid as soon as the @p buf is changed, such as through calls like
+ * eina_ustrbuf_append() or eina_ustrbuf_remove().
*
* @since 1.19.0
*/
EAPI Eina_Rw_Slice eina_ustrbuf_rw_slice_get(const Eina_UStrbuf *buf) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
/**
- * @brief Gets the string of the buffer and free the buffer
+ * @brief Frees the buffer, returning its old contents.
*
- * @param buf The buffer to get the string from and which will be freed
- *
- * @return The string contained by buf. The caller must release the memory of the returned string by calling
- * free().
+ * @param[in,out] buf The string buffer.
+ * @return The string contained by buf. The caller must release the
+ * memory of the returned string by calling free().
*
* @since 1.19
*/
diff --git a/src/lib/eina/eina_ustringshare.h b/src/lib/eina/eina_ustringshare.h
index 073b74cd4b..7e74076611 100644
--- a/src/lib/eina/eina_ustringshare.h
+++ b/src/lib/eina/eina_ustringshare.h
@@ -29,9 +29,9 @@
*
* The above copyright notice and this permission notice shall be included in
* all copies of the Software and its Copyright notices. In addition publicly
- * documented acknowledgement must be given that this software has been used if no
+ * documented acknowledgment must be given that this software has been used if no
* source code of this software is made available publicly. This includes
- * acknowledgements in either Copyright notices, Manuals, Publicity and Marketing
+ * acknowledgments in either Copyright notices, Manuals, Publicity and Marketing
* documents or any documentation provided with any product containing this
* software. This License does not apply to any software that links to the
* libraries provided by this software (statically or dynamically), but only to
diff --git a/src/lib/eina/eina_util.c b/src/lib/eina/eina_util.c
index 1d329d2d2a..ae2cebe3f1 100644
--- a/src/lib/eina/eina_util.c
+++ b/src/lib/eina/eina_util.c
@@ -48,10 +48,6 @@
* API *
*============================================================================*/
-#ifdef _WIN32
-static char home_storage[8];
-#endif
-
EAPI const char *
eina_environment_home_get(void)
{
@@ -64,13 +60,14 @@ eina_environment_home_get(void)
if (!home &&
(getenv("HOMEDRIVE") && getenv("HOMEPATH")))
{
- memcpy(home_storage, getenv("HOMEDRIVE"), strlen(getenv("HOMEDRIVE")));
- memcpy(home_storage + strlen(getenv("HOMEDRIVE")),
- getenv("HOMEPATH"), strlen(getenv("HOMEPATH")) + 1);
- home = home_storage;
+ char buf[PATH_MAX];
+
+ snprintf(buf, sizeof(buf), "%s%s",
+ getenv("HOMEDRIVE"), getenv("HOMEPATH"));
+ home = strdup(buf);
+ return home;
}
if (!home) home = "C:\\";
-
#else
# if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
if (getuid() == geteuid()) home = getenv("HOME");
diff --git a/src/lib/eina/eina_util.h b/src/lib/eina/eina_util.h
index e3c09f7196..dacd9cdd65 100644
--- a/src/lib/eina/eina_util.h
+++ b/src/lib/eina/eina_util.h
@@ -30,7 +30,7 @@
/**
* @brief Returns the content of the environment referred by HOME on this system.
- * @return A temporary string to the content refered by HOME on this system.
+ * @return A temporary string to the content referred by HOME on this system.
*
* @note The result of this call is highly system dependent and you better use
* it instead of the naive getenv("HOME").
@@ -41,7 +41,7 @@ EAPI const char *eina_environment_home_get(void);
/**
* @brief Returns the content of the environment referred as TMPDIR on this system.
- * @return A temporary string to the content refered by TMPDIR on this system.
+ * @return A temporary string to the content referred by TMPDIR on this system.
*
* @note The result of this call is highly system dependent and you better use
* it instead of the naive getenv("TMPDIR").
@@ -72,8 +72,8 @@ static inline Eina_Bool eina_flt_exact(float a, float b);
/**
* @brief Safe comparison of float
- * @param a First member to compar
- * @param b Second member to compar
+ * @param a First member to compare
+ * @param b Second member to compare
* @since 1.19
*
* @return @c true if two floats match
@@ -91,8 +91,8 @@ static inline Eina_Bool eina_flt_exact(float a, float b);
/**
* @brief Safe comparison of double
- * @param a First member to compar
- * @param b Second member to compar
+ * @param a First member to compare
+ * @param b Second member to compare
* @since 1.19
*
* @return @c true if two double match
diff --git a/src/lib/eina/eina_value.c b/src/lib/eina/eina_value.c
index db581aec1a..dbf6f48d9c 100644
--- a/src/lib/eina/eina_value.c
+++ b/src/lib/eina/eina_value.c
@@ -2225,6 +2225,16 @@ _eina_value_type_stringshare_pset(const Eina_Value_Type *type EINA_UNUSED, void
}
static Eina_Bool
+_eina_value_type_stringshare_pget(const Eina_Value_Type *type EINA_UNUSED, const void *mem, void *ptr)
+{
+ const Eina_Stringshare * const *src = mem;
+ Eina_Stringshare **dst = ptr;
+
+ *dst = eina_stringshare_ref(*src);
+ return EINA_TRUE;
+}
+
+static Eina_Bool
_eina_value_type_string_flush(const Eina_Value_Type *type EINA_UNUSED, void *mem)
{
char **tmem = mem;
@@ -5197,7 +5207,7 @@ static const Eina_Value_Type _EINA_VALUE_TYPE_BASICS[] = {
NULL, /* no convert from */
_eina_value_type_stringshare_vset,
_eina_value_type_stringshare_pset,
- _eina_value_type_string_common_pget
+ _eina_value_type_stringshare_pget
},
{
EINA_VALUE_TYPE_VERSION,
@@ -5433,6 +5443,7 @@ eina_value_init(void)
}
EINA_VALUE_TYPE_UCHAR = _EINA_VALUE_TYPE_BASICS + 0;
+ EINA_VALUE_TYPE_BOOL = EINA_VALUE_TYPE_UCHAR;
EINA_VALUE_TYPE_USHORT = _EINA_VALUE_TYPE_BASICS + 1;
EINA_VALUE_TYPE_UINT = _EINA_VALUE_TYPE_BASICS + 2;
EINA_VALUE_TYPE_ULONG = _EINA_VALUE_TYPE_BASICS + 3;
@@ -5534,6 +5545,7 @@ EAPI const Eina_Value_Type *_EINA_VALUE_TYPE_BASICS_END = NULL;
EAPI const Eina_Value_Type *EINA_VALUE_TYPE_VALUE = NULL;
EAPI const Eina_Value_Type *EINA_VALUE_TYPE_ERROR = NULL;
EAPI const Eina_Value_Type *EINA_VALUE_TYPE_UCHAR = NULL;
+EAPI const Eina_Value_Type *EINA_VALUE_TYPE_BOOL = NULL;
EAPI const Eina_Value_Type *EINA_VALUE_TYPE_USHORT = NULL;
EAPI const Eina_Value_Type *EINA_VALUE_TYPE_UINT = NULL;
EAPI const Eina_Value_Type *EINA_VALUE_TYPE_ULONG = NULL;
@@ -5577,6 +5589,13 @@ eina_value_new(const Eina_Value_Type *type)
{
Eina_Value *value = eina_mempool_malloc(_eina_value_mp, sizeof(Eina_Value));
if (!value) return NULL;
+ if (!type)
+ {
+ const Eina_Value empty = EINA_VALUE_EMPTY;
+
+ memcpy(value, &empty, sizeof (empty));
+ return value;
+ }
if (!eina_value_setup(value, type))
{
eina_mempool_free(_eina_value_mp, value);
diff --git a/src/lib/eina/eina_value.h b/src/lib/eina/eina_value.h
index 032ac0bbb8..729a674408 100644
--- a/src/lib/eina/eina_value.h
+++ b/src/lib/eina/eina_value.h
@@ -367,7 +367,7 @@ EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_ERROR;
* @var EINA_VALUE_TYPE_VALUE
* manages Eina_Value values.
* This value will hold an Eina_Value,
- * which can be usefull for storing data
+ * which can be useful for storing data
* inside an #Eina_Value_Array.
*
* @since 1.21
@@ -383,6 +383,14 @@ EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_VALUE;
EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_UCHAR;
/**
+ * @var EINA_VALUE_TYPE_UCHAR
+ * manages unsigned char type.
+ *
+ * @since 1.21
+ */
+EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_BOOL;
+
+/**
* @var EINA_VALUE_TYPE_USHORT
* manages unsigned short type.
*
@@ -665,7 +673,7 @@ struct _Eina_Value
* the description specified by @a type.
*
* Some types may specify more operations:
- * eg. #EINA_VALUE_TYPE_ARRAY uses eina_value_array_set(),
+ * e.g.. #EINA_VALUE_TYPE_ARRAY uses eina_value_array_set(),
* eina_value_array_get() and so on.
*
* On failure, @c NULL is returned.
@@ -1828,6 +1836,7 @@ static inline Eina_Bool eina_value_array_value_get(const Eina_Value *src,
/**
* @def EINA_VALUE_ARRAY_FOREACH
* @brief Definition for the macro to iterate over an array contained in an Eina_Value.
+ * @since 1.21
*
* @param array The list to iterate over.
* @param length Contain the length of the array
@@ -1843,21 +1852,16 @@ static inline Eina_Bool eina_value_array_value_get(const Eina_Value *src,
* Eina_Value array;
* Eina_Error err;
* unsigned int i, len;
- * Eina_Value v = EINA_VALUE_EMPTY;
*
- * // array is already filled,
+ * // array is already filled with EINA_VALUE_TYPE_ERROR,
* // its elements are unknown,
* // EINA_VALUE_ARRAY_FOREACH will be used to check if there is no error
*
*
- * EINA_VALUE_ARRAY_FOREACH(&array, len, i, &v)
+ * EINA_VALUE_ARRAY_FOREACH(&array, len, i, err)
* {
- * if (v.type == EINA_VALUE_TYPE_ERROR)
- * {
- * eina_value_get(&v, &err);
- * fprintf(stderr, "Something has gone wrong: %s at index: %i\n", eina_error_msg_get(err), i);
- * abort();
- * }
+ * eina_value_get(&v, &err);
+ * fprintf(stderr, "Something has gone wrong: %s at index: %i\n", eina_error_msg_get(err), i);
* }
* @endcode
*
@@ -1866,10 +1870,10 @@ static inline Eina_Bool eina_value_array_value_get(const Eina_Value *src,
#define EINA_VALUE_ARRAY_FOREACH(Array, Length, It, Value) \
for (Length = eina_value_array_count(Array), \
It = 0, \
- eina_value_array_get(Array, It, Value); \
+ eina_value_array_get(Array, It, &Value); \
It < Length; \
It++, \
- eina_value_array_get(Array, It, Value))
+ eina_value_array_get(Array, It, &Value))
/**
* @}
@@ -3167,7 +3171,7 @@ struct _Eina_Value_Struct
};
#define EINA_VALUE_STRUCT_DESC_DEFINE(Name, Ops, Size, ...) \
- static Eina_Value_Struct_Desc * \
+ static inline Eina_Value_Struct_Desc * \
Name(void) \
{ \
Eina_Value_Struct_Member tmp[] = { __VA_ARGS__ }; \
diff --git a/src/lib/eina/eina_vector.h b/src/lib/eina/eina_vector.h
index 5653e0a792..039114b8f1 100644
--- a/src/lib/eina/eina_vector.h
+++ b/src/lib/eina/eina_vector.h
@@ -141,7 +141,7 @@ static inline void eina_vector2_scale(Eina_Vector2 *out, const Eina_Vector2 *v,
* @brief Return the dot product of the two vectors.
*
* @param a The first member.
- * @param b The secondt member.
+ * @param b The second member.
* @return The dot product.
*
* @since 1.17
@@ -328,7 +328,7 @@ static inline void eina_vector3_multiply(Eina_Vector3 *out, const Eina_Vector3 *
* @brief Return the dot product of the two vectors.
*
* @param a The first member.
- * @param b The secondt member.
+ * @param b The second member.
* @return The dot product.
*
* @since 1.18
@@ -340,7 +340,7 @@ static inline double eina_vector3_dot_product(const Eina_Vector3 *a, const Eina_
*
* @param out The resulting vector.
* @param a The first member.
- * @param b The secondt member.
+ * @param b The second member.
*
* @since 1.18
*/
diff --git a/src/lib/eina/eina_vpath.c b/src/lib/eina/eina_vpath.c
new file mode 100644
index 0000000000..f49a9e1f13
--- /dev/null
+++ b/src/lib/eina/eina_vpath.c
@@ -0,0 +1,363 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <sys/types.h>
+#include <pwd.h>
+
+#include <Eina.h>
+
+#include "eina_internal.h"
+#include "eina_private.h"
+
+static Eina_Hash *vpath_data = NULL;
+
+#ifdef CRI
+#undef CRI
+#endif
+#define CRI(...) EINA_LOG_DOM_CRIT(_eina_vpath_log_dom, __VA_ARGS__)
+
+#ifdef ERR
+#undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_eina_vpath_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+#undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_eina_vpath_log_dom, __VA_ARGS__)
+
+static int _eina_vpath_log_dom = -1;
+
+static inline void
+_eina_vpath_data_add(const char *key, const char *value)
+{
+ eina_hash_add(vpath_data, key, eina_stringshare_add(value));
+}
+
+static inline Eina_Stringshare*
+_eina_vpath_data_get(const char *key)
+{
+ return eina_hash_find(vpath_data, key);
+}
+
+
+static char *
+_fallback_runtime_dir(const char *home)
+{
+ char buf[PATH_MAX];
+#if defined(HAVE_GETUID)
+ uid_t uid = getuid();
+#endif
+ struct stat st;
+
+#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
+ if (setuid(geteuid()) != 0)
+ {
+ fprintf(stderr,
+ "FATAL: Cannot setuid - errno=%i\n",
+ errno);
+ abort();
+ }
+#endif
+ // fallback - make ~/.run
+ snprintf(buf, sizeof(buf), "%s/.run", home);
+ if (!!mkdir(buf, S_IRUSR | S_IWUSR | S_IXUSR))
+ {
+ if (errno == EEXIST)
+ {
+ if (stat(buf, &st) == 0)
+ {
+ // some sanity checks - but not for security
+ if (!(st.st_mode & S_IFDIR))
+ {
+ // fatal - exists but is not a dir
+ fprintf(stderr,
+ "FATAL: run dir '%s' exists but not a dir\n",
+ buf);
+ abort();
+ }
+#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
+ if (st.st_uid != geteuid())
+ {
+ // fatal - run dir doesn't belong to user
+ fprintf(stderr,
+ "FATAL: run dir '%s' not owned by uid %i\n",
+ buf, (int)geteuid());
+ abort();
+ }
+#endif
+ }
+ else
+ {
+ // fatal - we cant create our run dir in ~/
+ fprintf(stderr,
+ "FATAL: Cannot verify run dir '%s' errno=%i\n",
+ buf, errno);
+ abort();
+ }
+ }
+ else
+ {
+ // fatal - we cant create our run dir in ~/
+ fprintf(stderr,
+ "FATAL: Cannot create run dir '%s' - errno=%i\n",
+ buf, errno);
+ abort();
+ }
+ }
+#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
+ if (setreuid(uid, geteuid()) != 0)
+ {
+ fprintf(stderr,
+ "FATAL: Cannot setreuid - errno=%i\n",
+ errno);
+ abort();
+ }
+#endif
+
+ return strdup(buf);
+}
+
+static char *
+_fallback_home_dir()
+{
+ char buf[PATH_MAX];
+ /* Windows does not have getuid(), but home can't be NULL */
+#ifdef HAVE_GETEUID
+ uid_t uid = geteuid();
+ struct stat st;
+
+ snprintf(buf, sizeof(buf), "/tmp/%i", (int)uid);
+ if (mkdir(buf, S_IRUSR | S_IWUSR | S_IXUSR) < 0)
+ {
+ if (errno != EEXIST)
+ {
+ if (stat("/tmp", &st) == 0)
+ snprintf(buf, sizeof(buf), "/tmp");
+ else
+ snprintf(buf, sizeof(buf), "/");
+ }
+ }
+ if (stat(buf, &st) != 0)
+ {
+ if (stat("/tmp", &st) == 0)
+ snprintf(buf, sizeof(buf), "/tmp");
+ else
+ snprintf(buf, sizeof(buf), "/");
+ }
+#else
+ snprintf(buf, sizeof(buf), "/");
+#endif
+ return strdup(buf);
+}
+
+static void
+_eina_vpath_interface_sys_init(void)
+{
+ const char *home, *tmp;
+
+ // $HOME / ~/ etc.
+ home = eina_environment_home_get();
+ if (!home)
+ home = _fallback_home_dir();
+
+ // tmp dir - system wide
+ tmp = eina_environment_tmp_get();
+
+ _eina_vpath_data_add("home", home);
+ _eina_vpath_data_add("tmp", tmp);
+}
+
+Eina_Bool
+eina_vpath_init(void)
+{
+ vpath_data = eina_hash_string_superfast_new((Eina_Free_Cb)eina_stringshare_del);
+
+ _eina_vpath_interface_sys_init();
+
+ _eina_vpath_log_dom = eina_log_domain_register("vpath", "cyan");
+ return EINA_TRUE;
+}
+
+Eina_Bool
+eina_vpath_shutdown(void)
+{
+ eina_log_domain_unregister(_eina_vpath_log_dom);
+ _eina_vpath_log_dom = -1;
+ return EINA_TRUE;
+}
+
+EAPI char *
+eina_vpath_resolve(const char* path)
+{
+ // XXX: implement parse of path then look up in hash if not just create
+ // object where path and result are the same and return that with
+ // path set and result set to resolved path - return obj handler calls
+ // "do" on object to get the result inside fetched or failed callback.
+ // if it's a url then we need a new classs that overrides the do and
+ // begins a fetch and on finish calls the event cb or when wait is called
+ /* FIXME: not working for WIndows */
+ // /* <- full path
+
+ if (!path) return NULL;
+
+ if (path[0] == '~')
+ {
+ // ~/ <- home directory
+ if (path[1] == '/')
+ {
+ char buf[PATH_MAX];
+ const char *home = eina_hash_find(vpath_data, "home");
+
+ if (home)
+ {
+ snprintf(buf, sizeof(buf), "%s%s", home, path + 1);
+ return strdup(buf);
+ }
+ }
+#ifdef HAVE_GETPWENT
+ // ~username/ <- homedir of user "username"
+ else
+ {
+ const char *p;
+ struct passwd pwent, *pwent2 = NULL;
+ char *name, buf[PATH_MAX], pwbuf[8129];
+
+ for (p = path + 1; *p; p++)
+ {
+ if (*p =='/') break;
+ }
+ name = alloca(p - path);
+ strncpy(name, path + 1, p - path - 1);
+ name[p - path - 1] = 0;
+ if (!getpwnam_r(name, &pwent, pwbuf, sizeof(pwbuf), &pwent2))
+ {
+ if ((pwent2) && (pwent.pw_dir))
+ {
+ return strdup(buf);
+ }
+ }
+ }
+#endif /* HAVE_GETPWENT */
+ return NULL;
+ }
+ // (:xxx:)/* ... <- meta hash table
+ else if ((path[0] == '(') && (path[1] == ':'))
+ {
+ const char *p, *end, *meta;
+ char *name, buf[PATH_MAX];
+ int max_len = strlen(path);
+ Eina_Bool found = EINA_FALSE;
+
+ for (p = path + 2; p <= path + max_len - 2; p++)
+ {
+ if ((p[0] ==':') && (p[1] == ')'))
+ {
+ end = p;
+ found = EINA_TRUE;
+ break;
+ }
+ }
+ p += 2;
+
+ if (!found)
+ {
+ ERR("(: Needs to have a matching ':)'\nThe string was: %s", path);
+ return NULL;
+ }
+
+ if (*p != '/')
+ {
+ ERR("A / is expected after :)\nThe string was: %s", path);
+ return NULL;
+ }
+
+ if (found)
+ {
+ name = alloca(end - path);
+ strncpy(name, path + 2, end - path - 2);
+ name[end - path - 2] = 0;
+ meta = _eina_vpath_data_get(name);
+ if (meta)
+ {
+ snprintf(buf, sizeof(buf), "%s%s", meta, end + 2);
+ return strdup(buf);
+ }
+ else
+ {
+ ERR("Meta key '%s' was not registered!\nThe string was: %s", name, path);
+ return NULL;
+ }
+ }
+ }
+ //just return the path, since we assume that this is a normal path
+ else
+ {
+ return strdup(path);
+ }
+
+ ERR("The path has to start with either '~/' or '(:NAME:)/' or be a normal path \nThe string was: %s", path);
+
+ return NULL;
+}
+
+EAPI void
+eina_vpath_interface_app_set(const char *app_domain, Eina_Prefix *app_pfx)
+{
+ char buf[PATH_MAX];
+
+ EINA_SAFETY_ON_NULL_RETURN(app_domain);
+ EINA_SAFETY_ON_NULL_RETURN(app_pfx);
+
+ _eina_vpath_data_add("app.dir", eina_prefix_get(app_pfx));
+ _eina_vpath_data_add("app.bin", eina_prefix_bin_get(app_pfx));
+ _eina_vpath_data_add("app.lib", eina_prefix_lib_get(app_pfx));
+ _eina_vpath_data_add("app.data", eina_prefix_data_get(app_pfx));
+ _eina_vpath_data_add("app.locale", eina_prefix_locale_get(app_pfx));
+ snprintf(buf, sizeof(buf), "%s/%s",
+ _eina_vpath_data_get("usr.config"), app_domain);
+ _eina_vpath_data_add("app.config", buf);
+ snprintf(buf, sizeof(buf), "%s/%s",
+ _eina_vpath_data_get("usr.cache"), app_domain);
+ _eina_vpath_data_add("app.cache", buf);
+ snprintf(buf, sizeof(buf), "%s/%s",
+ _eina_vpath_data_get("usr.data"), app_domain);
+ _eina_vpath_data_add("app.local", buf);
+ snprintf(buf, sizeof(buf), "%s/%s",
+ _eina_vpath_data_get("usr.tmp"), app_domain);
+ _eina_vpath_data_add("app.tmp", buf);
+}
+
+EAPI void
+eina_vpath_interface_user_set(Eina_Vpath_Interface_User *user)
+{
+ Eina_Bool free_run = EINA_FALSE;
+
+ EINA_SAFETY_ON_NULL_RETURN(user);
+
+ if (!user->run)
+ {
+ user->run = _fallback_runtime_dir(_eina_vpath_data_get("home"));
+ free_run = EINA_TRUE;
+ }
+
+#define ADD(a) _eina_vpath_data_add("usr." #a , user->a)
+ ADD(desktop);
+ ADD(documents);
+ ADD(downloads);
+ ADD(music);
+ ADD(pictures);
+ ADD(pub);
+ ADD(templates);
+ ADD(videos);
+ ADD(data);
+ ADD(config);
+ ADD(cache);
+ ADD(run);
+ ADD(tmp);
+#undef ADD
+
+ if (free_run)
+ free((char *)user->run);
+}
diff --git a/src/lib/eina/eina_vpath.h b/src/lib/eina/eina_vpath.h
new file mode 100644
index 0000000000..757b6ed683
--- /dev/null
+++ b/src/lib/eina/eina_vpath.h
@@ -0,0 +1,91 @@
+#ifndef EINA_VPATH_H
+#define EINA_VPATH_H
+
+#include "eina_prefix.h"
+
+/**
+ * Eina vpath is a path that can be prefixed with a virtual path.
+ *
+ * A virtual path can either start with (:XXXXXXXX:) that indicates a virtual
+ * path with XXXXXXXX as the location, OR a normal path with / or a relative
+ * path like ./ or ../ or even shell common locators like ~/ or ~username/
+ *
+ * The string between (: and :) is used as key to lookup the real value.
+ * The key has to be set by an interface before, otherwise you will get an
+ * error.
+ *
+ * Sample paths:
+ *
+ * ~/myfiles/file.png
+ * ~bob/dir/file.txt
+ * /path/to/file.cfg
+ * ./file/relative/path.txt
+ * file/relative/path.txt
+ * (:tmp:)/some-temp-file/file.txt
+ * (:home:)/myfiles/file.png
+ *
+ * (:app.dir:)/bin/app-executable
+ * (:app.bin:)/app-executable-file
+ * (:app.lib:)/app-library.so
+ * (:app.data:)/application/datafile.png
+ * (:app.locale:)/en_US/LC_MESSAGES/app.mo
+ * (:app.config:)/application-config.xml
+ * (:app.local:)/application-data-file.jpg
+ * (:app.tmp:)/some-temp-file/path/file.txt
+ *
+ * (:usr.desktop:)/file-in-users-desktop-directory.txt
+ * (:usr.documents:)/letter-to-gradma.doc
+ * (:usr.downloads:)/file-downloaded-here.zip
+ * (:usr.music:)/fave-song.mp3
+ * (:usr.pictures:)/a-photo.,jpg
+ * (:usr.public:)/some-publicly-shared-file
+ * (:usr.templates:)/some-template-document.txt
+ * (:usr.videos:)/some-video-file.mp4
+ * (:usr.data:)/file-in-user-data-dir
+ * (:usr.config:)/file-in-user-conifg-dir
+ * (:usr.cache:)/file-in-user-cache-dir
+ * (:usr.run:)/file-in-xdg-runtime-dir
+ * (:usr.tmp:)/some-temp-file/path/file.txt
+ *
+ * Commonly mapped to real path (but may vary):
+ *
+ * (:tmp:) - /tmp
+ * (:home:) - ~/
+ *
+ * (:app.dir:) - /usr - (assuming app install PREFIX of /usr. may be /usr/local or others too)
+ * (:app.bin:) - /usr/bin - (almost always PREFIX/bin)
+ * (:app.lib:) - /usr/lib - (almost always PREFIX/lib)
+ * (:app.data:) - /usr/share/appname - (almost always PREFIX/share/appname)
+ * (:app.locale:) - /usr/share/locale - (almost always PREFIX/locale)
+ * (:app.config:) - ~/.config/appname
+ * (:app.local:) - ~/.local/share/appname
+ * (:app.tmp:) - ~/.local/tmp/appname
+ *
+ * (:usr.desktop:) - ~/Desktop
+ * (:usr.documents:) - ~/Documents
+ * (:usr.downloads:) - ~/Downloads
+ * (:usr.music:) - ~/Music
+ * (:usr.pictures:) - ~/Pictures
+ * (:usr.public:) - ~/Public
+ * (:usr.templates:) - ~/Templates
+ * (:usr.videos:) - ~/Videos
+ * (:usr.data:) - ~/.local/share
+ * (:usr.config:) - ~/.config
+ * (:usr.cache:) - ~/.cache
+ * (:usr.run:) - /var/run/user/1000
+ * (:usr.tmp:) - ~/.local/tmp
+ *
+ * Additional info: https://phab.enlightenment.org/w/eina_vpath/
+ *
+ */
+typedef const char * Eina_Vpath;
+
+/*
+ * Translate a virtual path into a normal path.
+ *
+ * @return NULL if failed, or a full normal string file path that is resolved
+ *
+ */
+EAPI char *eina_vpath_resolve(Eina_Vpath path);
+
+#endif
diff --git a/src/lib/eina/eina_xattr.h b/src/lib/eina/eina_xattr.h
index febd4a7d43..a31fcfae8e 100644
--- a/src/lib/eina/eina_xattr.h
+++ b/src/lib/eina/eina_xattr.h
@@ -21,6 +21,8 @@
#include "eina_types.h"
+#include <sys/types.h>
+
/**
* @addtogroup Eina_Tools_Group Tools
*
@@ -34,7 +36,7 @@
* @since 1.1
*/
typedef enum {
- EINA_XATTR_INSERT, /**< This is the default behaviour, it will either create or replace the extended attribute */
+ EINA_XATTR_INSERT, /**< This is the default behavior, it will either create or replace the extended attribute */
EINA_XATTR_REPLACE, /**< This will only succeed if the extended attribute previously existed */
EINA_XATTR_CREATED /**< This will only succeed if the extended attribute wasn't previously set */
} Eina_Xattr_Flags;
@@ -42,10 +44,10 @@ typedef enum {
typedef struct _Eina_Xattr Eina_Xattr;
struct _Eina_Xattr
{
- const char *name; /**< The eXtended attribute name @since 1.2 */
- const char *value; /**< The eXtended attribute value @since 1.2 */
+ const char *name; /**< The extended attribute name @since 1.2 */
+ const char *value; /**< The extended attribute value @since 1.2 */
- size_t length; /**< The length of the eXtended attribute value @since 1.2 */
+ size_t length; /**< The length of the extended attribute value @since 1.2 */
};
/**
diff --git a/src/lib/eio/Eio.h b/src/lib/eio/Eio.h
index d2c36b1ae8..cc986938dd 100644
--- a/src/lib/eio/Eio.h
+++ b/src/lib/eio/Eio.h
@@ -37,15 +37,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_EIO_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EIO_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -56,13 +56,23 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#ifdef __cplusplus
extern "C" {
#endif
+
+/**
+ * @typedef Eio_File
+ * Generic asynchronous I/O reference.
+ * @ingroup Eio
+ */
+typedef struct _Eio_File Eio_File;
+
+typedef Eina_Bool (*Eio_Filter_Direct_Cb)(void *data, Eio_File *handler, const Eina_File_Direct_Info *info);
+
#ifndef EFL_NOLEGACY_API_SUPPORT
#include "Eio_Legacy.h"
#endif
@@ -110,6 +120,15 @@ static inline Eina_Bool eio_file_is_dir(const Eina_Stat *stat);
*/
static inline Eina_Bool eio_file_is_lnk(const Eina_Stat *stat);
+/**
+ * @ingroup Eio
+ *
+ * @brief Set the polling interval to control the fallback monitor behavior
+ * @param interval The interval (in seconds) to poll
+ * @since 1.21
+ */
+EAPI void eio_monitoring_interval_set(double interval);
+
#include "eio_inline_helper.x"
#define EIO_VERSION_MAJOR EFL_VERSION_MAJOR
diff --git a/src/lib/eio/Eio_Legacy.h b/src/lib/eio/Eio_Legacy.h
index 571549b0bd..adb78b6389 100644
--- a/src/lib/eio/Eio_Legacy.h
+++ b/src/lib/eio/Eio_Legacy.h
@@ -134,12 +134,6 @@ typedef enum _Eio_File_Op Eio_File_Op;
*/
/**
- * @typedef Eio_File
- * Generic asynchronous I/O reference.
- */
-typedef struct _Eio_File Eio_File;
-
-/**
* @typedef Eio_Progress
* Progress information on a specific operation.
*/
@@ -148,7 +142,6 @@ typedef struct _Eio_Progress Eio_Progress;
typedef Eina_Bool (*Eio_Filter_Cb)(void *data, Eio_File *handler, const char *file);
typedef void (*Eio_Main_Cb)(void *data, Eio_File *handler, const char *file);
-typedef Eina_Bool (*Eio_Filter_Direct_Cb)(void *data, Eio_File *handler, const Eina_File_Direct_Info *info);
typedef Eina_Bool (*Eio_Filter_Dir_Cb)(void *data, Eio_File *handler, Eina_File_Direct_Info *info);
typedef void (*Eio_Main_Direct_Cb)(void *data, Eio_File *handler, const Eina_File_Direct_Info *info);
@@ -1181,12 +1174,12 @@ EAPI Eio_File *eio_eet_write_cipher(Eet_File *ef,
EAPI extern int EIO_MONITOR_FILE_CREATED; /**< A new file was created in a watched directory */
EAPI extern int EIO_MONITOR_FILE_DELETED; /**< A watched file was deleted, or a file in a watched directory was deleted */
EAPI extern int EIO_MONITOR_FILE_MODIFIED; /**< A file was modified in a watched directory */
-EAPI extern int EIO_MONITOR_FILE_CLOSED; /**< A file was closed in a watched directory. This event is never sent on Windows and OSX */
+EAPI extern int EIO_MONITOR_FILE_CLOSED; /**< A file was closed in a watched directory. This event is never sent on Windows and OSX, or for non-fallback monitors */
EAPI extern int EIO_MONITOR_DIRECTORY_CREATED; /**< A new directory was created in a watched directory */
EAPI extern int EIO_MONITOR_DIRECTORY_DELETED; /**< A directory has been deleted: this can be either a watched directory or one of its subdirectories */
EAPI extern int EIO_MONITOR_DIRECTORY_MODIFIED; /**< A directory has been modified in a watched directory */
-EAPI extern int EIO_MONITOR_DIRECTORY_CLOSED; /**< A directory has been closed in a watched directory. This event is never sent on Windows and OSX */
-EAPI extern int EIO_MONITOR_SELF_RENAME; /**< The monitored path has been renamed, an error could happen just after if the renamed path doesn't exist. This event is never sent on OSX */
+EAPI extern int EIO_MONITOR_DIRECTORY_CLOSED; /**< A directory has been closed in a watched directory. This event is never sent on Windows and OSX, or for non-fallback monitors */
+EAPI extern int EIO_MONITOR_SELF_RENAME; /**< The monitored path has been renamed, an error could happen just after if the renamed path doesn't exist. This event is never sent on OSX, or for non-fallback monitors */
EAPI extern int EIO_MONITOR_SELF_DELETED; /**< The monitored path has been removed. This event is never sent on OSX */
EAPI extern int EIO_MONITOR_ERROR; /**< During operation the monitor failed and will no longer work. eio_monitor_del must be called on it. */
@@ -1248,6 +1241,20 @@ EAPI void eio_monitor_del(Eio_Monitor *monitor);
*/
EAPI const char *eio_monitor_path_get(Eio_Monitor *monitor);
+#ifdef EFL_BETA_API_SUPPORT
+/**
+ * @brief Check whether a monitor is using the fallback backend
+ * @param monitor The Eio_Monitor to check
+ * @return EINA_TRUE only if the monitor is valid and is using the fallback monitoring mechanism
+ *
+ * Fallback monitors are unable to provide the CLOSED or RENAME events. It's important
+ * to check whether a monitor is a fallback monitor before relying on these events.
+ *
+ * @since 1.21
+ * @beta
+ */
+EAPI Eina_Bool eio_monitor_fallback_check(const Eio_Monitor *monitor);
+#endif
/**
* @}
*/
diff --git a/src/lib/eio/efl_io_manager.c b/src/lib/eio/efl_io_manager.c
index f4c56dc0ac..c4cdfe4e58 100644
--- a/src/lib/eio/efl_io_manager.c
+++ b/src/lib/eio/efl_io_manager.c
@@ -43,7 +43,6 @@ struct _Job_Closure
{
Eo *object;
Efl_Io_Manager_Data *pdata;
- Efl_Promise *promise;
Eio_File *file;
Eina_Bool delete_me;
void *delayed_arg;
@@ -52,12 +51,6 @@ struct _Job_Closure
/* Helper functions */
static void
-_efl_io_manager_future_cancel(void *data, const Eina_Promise *dead_ptr EINA_UNUSED)
-{
- eio_file_cancel(data);
-}
-
-static void
_future_file_done_cb(void *data, Eio_File *handler)
{
Eina_Promise *p = data;
@@ -72,242 +65,137 @@ _future_file_error_cb(void *data,
{
Eina_Promise *p = data;
- eina_promise_reject(p, error);
-}
-
-static void
-_no_future(void *data, const Efl_Event *ev EINA_UNUSED)
-{
- Eio_File *h = data;
-
- eio_file_cancel(h);
-}
-
-static void
-_forced_shutdown(void *data, const Efl_Event *ev EINA_UNUSED)
-{
- Eio_File *h = data;
-
- eio_file_cancel(h);
- // FIXME: handle memory lock here !
- // Acceptable strategy will be to unlock all thread as
- // if we were freeing some memory
- // FIXME: Handle long to finish thread
- ecore_thread_wait(h->thread, 1.0);
-}
-
-static void
-_progress(void *data EINA_UNUSED, const Efl_Event *ev)
-{
- efl_key_data_set(ev->object, "_eio.progress", (void*) EINA_TRUE);
-}
-
-EFL_CALLBACKS_ARRAY_DEFINE(promise_progress_handling,
- { EFL_PROMISE_EVENT_FUTURE_PROGRESS_SET, _progress },
- { EFL_PROMISE_EVENT_FUTURE_NONE, _no_future },
- { EFL_EVENT_DEL, _forced_shutdown });
-
-EFL_CALLBACKS_ARRAY_DEFINE(promise_handling,
- { EFL_PROMISE_EVENT_FUTURE_NONE, _no_future },
- { EFL_EVENT_DEL, _forced_shutdown });
-
-static void
-_file_error_cb(void *data, Eio_File *handler, int error)
-{
- Efl_Promise *p = data;
-
- efl_event_callback_array_del(p, promise_handling(), handler);
-
- efl_promise_failed_set(p, error);
-
- efl_del(p);
-}
-
-static void
-_file_done_cb(void *data, Eio_File *handler)
-{
- Efl_Promise *p = data;
- uint64_t *v = calloc(1, sizeof (uint64_t));
-
- efl_event_callback_array_del(p, promise_handling(), handler);
-
- if (!v)
- {
- efl_promise_failed_set(p, ENOMEM);
- goto end;
- }
-
- *v = handler->length;
- efl_promise_value_set(p, v, free);
-
- end:
- efl_del(p);
+ // error == 0 -> promise was cancelled, no need to reject it anymore
+ if (error != 0) eina_promise_reject(p, error);
}
/* Basic listing callbacks */
static void
-_cleanup_info_progress(void *data)
-{
- Eina_Array *existing = data;
- Eio_File_Direct_Info *d; // This is a trick because we use the head of the structure
- Eina_Array_Iterator it;
- unsigned int i;
-
- EINA_ARRAY_ITER_NEXT(existing, i, d, it)
- eio_direct_info_free(d);
- eina_array_free(existing);
-}
-
-static void
_future_string_cb(void *data EINA_UNUSED, Eio_File *handler, Eina_Array *gather)
{
EflIoPath paths = ecore_thread_local_data_find(handler->thread, ".paths");
void *paths_data = ecore_thread_local_data_find(handler->thread, ".paths_data");
- Eina_Accessor *access;
- unsigned int count;
Eina_Stringshare *s;
- if (!paths)
- {
- eina_array_free(gather);
- return ;
- }
+ if (!paths) goto end;
- access = eina_array_accessor_new(gather);
- paths(paths_data, access);
+ paths(paths_data, gather);
// Cleanup strings, accessor and array
- EINA_ACCESSOR_FOREACH(access, count, s)
+ end:
+ while ((s = eina_array_pop(gather)))
eina_stringshare_del(s);
- eina_accessor_free(access);
eina_array_free(gather);
}
/* Direct listing callbacks */
static void
-_file_info_cb(void *data, Eio_File *handler, Eina_Array *gather)
+_future_file_info_cb(void *data EINA_UNUSED, Eio_File *handler, Eina_Array *gather)
{
- Efl_Promise *p = data;
- Eina_Array *existing = efl_key_data_get(p, "_eio.stored");
- void **tmp;
+ EflIoDirectInfo info = ecore_thread_local_data_find(handler->thread, ".info");
+ void *info_data = ecore_thread_local_data_find(handler->thread, ".info_data");
+ Eio_File_Direct_Info *d;
- // If a future is set, but without progress, we should assume
- // that we should discard all future progress. [[FIXME]]
- if (existing)
- {
- tmp = realloc(existing->data, sizeof (void*) * (existing->count + gather->count));
- if (!tmp)
- {
- eina_array_free(gather);
- eina_array_free(existing);
- efl_key_data_set(p, "_eio.stored", NULL);
- handler->error = ENOMEM;
- eio_file_cancel(handler);
- return ;
- }
- existing->data = tmp;
- memcpy(existing->data + existing->count, gather->data, gather->count * sizeof (void*));
- existing->count += gather->count;
- existing->total = existing->count;
- eina_array_free(gather);
- }
- else
- {
- existing = gather;
- }
- if (!efl_key_data_get(p, "_eio.progress"))
- {
- efl_key_data_set(p, "_eio.stored", existing);
- return ;
- }
- efl_promise_progress_set(p, existing);
- efl_key_data_set(p, "_eio.stored", NULL);
- _cleanup_info_progress(existing);
+ if (!info) goto end;
+ if (ecore_thread_check(handler->thread)) goto end;
+
+ info(info_data, gather);
+
+ end:
+ while ((d = eina_array_pop(gather)))
+ eio_direct_info_free(d);
+ eina_array_free(gather);
}
/* Method implementations */
-static Efl_Future *
-_efl_io_manager_direct_ls(Eo *obj,
+static Eina_Future *
+_efl_io_manager_direct_ls(const Eo *obj,
Efl_Io_Manager_Data *pd EINA_UNUSED,
const char *path,
- Eina_Bool recursive)
+ Eina_Bool recursive,
+ void *info_data, EflIoDirectInfo info, Eina_Free_Cb info_free_cb)
{
- Efl_Promise *p;
+ Eina_Promise *p;
+ Eina_Future *future;
Eio_File *h;
- Eo *loop = efl_loop_get(obj);
- p = efl_add(EFL_PROMISE_CLASS, loop);
+ p = efl_loop_promise_new(obj, _efl_io_manager_future_cancel, NULL);
if (!p) return NULL;
+ future = eina_future_new(p);
if (!recursive)
{
h = _eio_file_direct_ls(path,
- _file_info_cb,
- _file_done_cb,
- _file_error_cb,
+ _future_file_info_cb,
+ _future_file_done_cb,
+ _future_file_error_cb,
p);
}
else
{
h = _eio_dir_direct_ls(path,
- _file_info_cb,
- _file_done_cb,
- _file_error_cb,
+ _future_file_info_cb,
+ _future_file_done_cb,
+ _future_file_error_cb,
p);
}
-
if (!h) goto end;
- efl_event_callback_array_add(p, promise_progress_handling(), h);
- return efl_promise_future_get(p);
+ ecore_thread_local_data_add(h->thread, ".info", info, NULL, EINA_TRUE);
+ ecore_thread_local_data_add(h->thread, ".info_data", info_data, info_free_cb, EINA_TRUE);
+ eina_promise_data_set(p, h);
+
+ return efl_future_Eina_FutureXXX_then(obj, future);
end:
- efl_del(p);
- return NULL;
+ return future;
}
-static Efl_Future *
-_efl_io_manager_stat_ls(Eo *obj,
+static Eina_Future *
+_efl_io_manager_stat_ls(const Eo *obj,
Efl_Io_Manager_Data *pd EINA_UNUSED,
const char *path,
- Eina_Bool recursive)
+ Eina_Bool recursive,
+ void *info_data, EflIoDirectInfo info, Eina_Free_Cb info_free_cb)
{
- Efl_Promise *p;
+ Eina_Promise *p;
+ Eina_Future *future;
Eio_File *h;
- Eo *loop = efl_loop_get(obj);
- p = efl_add(EFL_PROMISE_CLASS, loop);
+ p = efl_loop_promise_new(obj, _efl_io_manager_future_cancel, NULL);
if (!p) return NULL;
+ future = eina_future_new(p);
if (!recursive)
{
h = _eio_file_stat_ls(path,
- _file_info_cb,
- _file_done_cb,
- _file_error_cb,
+ _future_file_info_cb,
+ _future_file_done_cb,
+ _future_file_error_cb,
p);
}
else
{
h = _eio_dir_stat_ls(path,
- _file_info_cb,
- _file_done_cb,
- _file_error_cb,
+ _future_file_info_cb,
+ _future_file_done_cb,
+ _future_file_error_cb,
p);
}
-
if (!h) goto end;
- efl_event_callback_array_add(p, promise_progress_handling(), h);
- return efl_promise_future_get(p);
+ ecore_thread_local_data_add(h->thread, ".info", info, NULL, EINA_TRUE);
+ ecore_thread_local_data_add(h->thread, ".info_data", info_data, info_free_cb, EINA_TRUE);
+ eina_promise_data_set(p, h);
+
+ return efl_future_Eina_FutureXXX_then(obj, future);
end:
- efl_del(p);
- return NULL;
+ return future;
}
static Eina_Future *
-_efl_io_manager_ls(Eo *obj,
+_efl_io_manager_ls(const Eo *obj,
Efl_Io_Manager_Data *pd EINA_UNUSED,
const char *path,
void *paths_data, EflIoPath paths, Eina_Free_Cb paths_free_cb)
@@ -338,26 +226,6 @@ _efl_io_manager_ls(Eo *obj,
}
/* Stat function */
-EINA_VALUE_STRUCT_DESC_DEFINE(_eina_stat_desc,
- NULL,
- sizeof (Eina_Stat),
- EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_ULONG, Eina_Stat, dev),
- EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_ULONG, Eina_Stat, ino),
- EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_UINT, Eina_Stat, mode),
- EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_UINT, Eina_Stat, nlink),
- EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_UINT, Eina_Stat, uid),
- EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_UINT, Eina_Stat, gid),
- EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_ULONG, Eina_Stat, rdev),
- EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_ULONG, Eina_Stat, size),
- EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_ULONG, Eina_Stat, blksize),
- EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_ULONG, Eina_Stat, blocks),
- EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_TIMESTAMP, Eina_Stat, atime),
- EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_ULONG, Eina_Stat, atimensec),
- EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_TIMESTAMP, Eina_Stat, mtime),
- EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_ULONG, Eina_Stat, mtimensec),
- EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_TIMESTAMP, Eina_Stat, ctime),
- EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_ULONG, Eina_Stat, ctimensec));
-
static void
_file_stat_done_cb(void *data, Eio_File *handle EINA_UNUSED, const Eina_Stat *st)
{
@@ -380,7 +248,7 @@ _file_stat_done_cb(void *data, Eio_File *handle EINA_UNUSED, const Eina_Stat *st
}
static Eina_Future *
-_efl_io_manager_stat(Eo *obj,
+_efl_io_manager_stat(const Eo *obj,
Efl_Io_Manager_Data *pd EINA_UNUSED,
const char *path)
{
@@ -394,7 +262,7 @@ _efl_io_manager_stat(Eo *obj,
h = eio_file_direct_stat(path,
_file_stat_done_cb,
- _file_error_cb,
+ _future_file_error_cb,
p);
if (!h) goto end;
eina_promise_data_set(p, h);
@@ -408,7 +276,7 @@ _efl_io_manager_stat(Eo *obj,
/* eXtended attribute manipulation */
static Eina_Future *
-_efl_io_manager_xattr_ls(Eo *obj,
+_efl_io_manager_xattr_ls(const Eo *obj,
Efl_Io_Manager_Data *pd EINA_UNUSED,
const char *path,
void *paths_data, EflIoPath paths, Eina_Free_Cb paths_free_cb)
@@ -489,7 +357,7 @@ _efl_io_manager_xattr_set(Eo *obj,
}
static Eina_Future *
-_efl_io_manager_xattr_get(Eo *obj,
+_efl_io_manager_xattr_get(const Eo *obj,
Efl_Io_Manager_Data *pd EINA_UNUSED,
const char *path,
const char *attribute)
@@ -509,7 +377,8 @@ _efl_io_manager_xattr_get(Eo *obj,
if (!h) goto end;
eina_promise_data_set(p, h);
- return efl_future_Eina_FutureXXX_then(obj, future);
+ /* XXX const */
+ return efl_future_Eina_FutureXXX_then((Eo *)obj, future);
end:
return future;
@@ -527,7 +396,7 @@ _future_file_open_cb(void *data, Eio_File *handler EINA_UNUSED, Eina_File *file)
}
static Eina_Future *
-_efl_io_manager_open(Eo *obj,
+_efl_io_manager_open(const Eo *obj,
Efl_Io_Manager_Data *pd EINA_UNUSED,
const char *path,
Eina_Bool shared)
@@ -554,7 +423,7 @@ _efl_io_manager_open(Eo *obj,
}
static Eina_Future *
-_efl_io_manager_close(Eo *obj,
+_efl_io_manager_close(const Eo *obj,
Efl_Io_Manager_Data *pd EINA_UNUSED,
Eina_File *file)
{
diff --git a/src/lib/eio/efl_io_manager.eo b/src/lib/eio/efl_io_manager.eo
index 371d71f7cd..75a20946ee 100644
--- a/src/lib/eio/efl_io_manager.eo
+++ b/src/lib/eio/efl_io_manager.eo
@@ -10,67 +10,69 @@ struct Eio.Data
function EflIoPath {
[[EflIoPath function]]
params {
- @in paths: accessor<string>; [[Accessor to an array of path.]]
+ @in paths: array<string>; [[Accessor to an array of path.]]
}
};
function EflIoDirectInfo {
[[EflIoDirectInfo function]]
params {
- @in entries: accessor<Eina.File.Direct.Info>; [[Accessor to an array of info.]]
+ @in entries: array<ptr(Eina.File.Direct.Info)>; [[Accessor to an array of info.]]
}
};
-class Efl.Io.Manager (Efl.Loop.Consumer)
+class Efl.Io.Manager (Efl.Loop_Consumer)
{
[[Class representing an asynchronous file operation.]]
methods {
- ls {
+ ls @const {
[[Lists entries in a given path.
See \@ref eina_file_ls().
]]
params {
@in path: string; [[Path we want to list entries for]]
- paths: EflIoPath; [[Callback called for each packet of files found]]
+ paths: EflIoPath; [[Callback called for each packet of files found]]
}
- return: ptr(Eina.Future) @owned; [[Amount of files found during the listing of the directory]]
+ return: future<uint64> @owned; [[Amount of files found during the listing of the directory]]
}
- direct_ls {
+ direct_ls @const {
[[Lists entries in a given path with more information.]]
params {
@in path: string;[[Path we want to list entries for]]
@in recursive: bool; [[If $true, list entries recursively, $false otherwise]]
+ info: EflIoDirectInfo; [[Callback called for each packet of @Eina.File.Direct.Info]]
}
- return: future<uint64, const(array<ptr(Eina.File.Direct.Info)>)>; [[List of entries in path]]
+ return: future<uint64> @owned; [[Amount of files found during the listing of the directory]]
}
- stat_ls {
+ stat_ls @const {
[[Lists entries in a given path with stat information.]]
params {
@in path: string;[[Path we want to list entries for]]
@in recursive: bool; [[If $true, list entries recursively, $false otherwise]]
+ info: EflIoDirectInfo; [[Callback called for each packet of @Eina.File.Direct.Info]]
}
- return: future<uint64, const(array<ptr(Eina.File.Direct.Info)>)>; [[List of entries in path]]
+ return: future<uint64> @owned; [[Amount of files found during the listing of the directory]]
}
// Extended attributes
- xattr_ls {
+ xattr_ls @const {
[[Lists all extended attributes asynchronously.]]
params {
@in path: string; [[Path we want to list entries for]]
- paths: EflIoPath; [[Callback called for each packet of extended attributes found.]]
+ paths: EflIoPath; [[Callback called for each packet of extended attributes found.]]
}
- return: ptr(Eina.Future) @owned; [[Amount of extended attributes found]]
+ return: future<uint64> @owned; [[Amount of extended attributes found]]
}
- stat {
+ stat @const {
[[Get stat info on a given file/directory.]]
params {
@in path: string; [[Path we want to get stat information for]]
}
- return: ptr(Eina.Future); [[Stat information]]
+ return: future<Eina.Stat>; [[Stat information]]
}
// FIXME: Add helper for Eina.Value to Xattr
@@ -81,10 +83,10 @@ class Efl.Io.Manager (Efl.Loop.Consumer)
data: ptr(Eina.Binbuf); [[Data to set as information]]
flags: Eina.Xattr.Flags; [[Extended attributes flags]]
}
- return: ptr(Eina.Future) @owned; [[Future for asynchronous set operation]]
+ return: future<uint64> @owned; [[Future for asynchronous set operation]]
}
get {
- return: ptr(Eina.Future) @owned; [[Information]]
+ return: future<Eina.Binbuf> @owned; [[Information]]
}
keys {
path: string; [[File path]]
@@ -93,7 +95,7 @@ class Efl.Io.Manager (Efl.Loop.Consumer)
}
// helper api
- open {
+ open @const {
[[Opens a file.
The fulfilled value in the promise will be the Eina.File*.]]
@@ -101,15 +103,15 @@ class Efl.Io.Manager (Efl.Loop.Consumer)
@in path: string; [[Path to file]]
@in shared: bool; [[$true if the file can be accessed by others, $false otherwise]]
}
- return: ptr(Eina.Future) @owned; [[Eina file handle]]
+ return: future<Eina.File> @owned; [[Eina file handle]]
}
- close {
+ close @const {
[[Closes an open Eina.File.]]
params {
@in file: ptr(Eina.File); [[Eina file handle]]
// Here we're just interested whether the promise was fullfilled or not. No value needed.
}
- return: ptr(Eina.Future) @owned; [[Close return code]]
+ return: future<int> @owned; [[Close return code]]
}
}
}
diff --git a/src/lib/eio/eio_dir.c b/src/lib/eio/eio_dir.c
index 74237747a4..84c7769103 100644
--- a/src/lib/eio/eio_dir.c
+++ b/src/lib/eio/eio_dir.c
@@ -238,6 +238,8 @@ _eio_dir_mkdir(Ecore_Thread *thread, Eio_Dir_Copy *order,
return EINA_TRUE;
}
+/* no symbolic link on Windows */
+#ifndef _WIN32
static Eina_Bool
_eio_dir_link(Ecore_Thread *thread, Eio_Dir_Copy *order,
long long *step, long long count,
@@ -298,6 +300,7 @@ _eio_dir_link(Ecore_Thread *thread, Eio_Dir_Copy *order,
eio_file_thread_error(&order->progress.common, thread);
return EINA_FALSE;
}
+#endif
static Eina_Bool
_eio_dir_chmod(Ecore_Thread *thread, Eio_Dir_Copy *order,
@@ -416,8 +419,11 @@ _eio_dir_copy_heavy(void *data, Ecore_Thread *thread)
file = NULL;
/* recreate link */
+ /* no symbolic link on Windows */
+#ifndef _WIN32
if (!_eio_dir_link(thread, copy, &step, count, length_source, length_dest))
goto on_error;
+#endif
/* set directory right back */
if (!_eio_dir_chmod(thread, copy, &step, count, length_source, length_dest, EINA_FALSE))
@@ -562,8 +568,11 @@ _eio_dir_move_heavy(void *data, Ecore_Thread *thread)
file = NULL;
/* recreate link */
+/* no symbolic link on Windows */
+#ifndef _WIN32
if (!_eio_dir_link(thread, move, &step, count, length_source, length_dest))
goto on_error;
+#endif
/* set directory right back */
if (!_eio_dir_chmod(thread, move, &step, count, length_source, length_dest, EINA_TRUE))
diff --git a/src/lib/eio/eio_file.c b/src/lib/eio/eio_file.c
index 1afa4ab165..7a46e9b865 100644
--- a/src/lib/eio/eio_file.c
+++ b/src/lib/eio/eio_file.c
@@ -42,8 +42,8 @@ _eio_file_heavy(void *data, Ecore_Thread *thread)
ls = eina_file_ls(async->ls.directory);
if (!ls)
{
- eio_file_thread_error(&async->ls.common, thread);
- return;
+ eio_file_thread_error(&async->ls.common, thread);
+ return;
}
eio_file_container_set(&async->ls.common, eina_iterator_container_get(ls));
@@ -52,14 +52,14 @@ _eio_file_heavy(void *data, Ecore_Thread *thread)
EINA_ITERATOR_FOREACH(ls, file)
{
- Eina_Bool filter = EINA_TRUE;
+ Eina_Bool filter = EINA_TRUE;
- if (async->filter_cb)
- {
- filter = async->filter_cb((void*) async->ls.common.data, &async->ls.common, file);
- }
+ if (async->filter_cb)
+ {
+ filter = async->filter_cb((void*) async->ls.common.data, &async->ls.common, file);
+ }
- if (filter)
+ if (filter)
{
Eio_File_Char *send_fc;
@@ -67,14 +67,14 @@ _eio_file_heavy(void *data, Ecore_Thread *thread)
if (!send_fc) goto on_error;
send_fc->filename = file;
- send_fc->associated = async->ls.common.worker.associated;
- async->ls.common.worker.associated = NULL;
+ send_fc->associated = async->ls.common.worker.associated;
+ async->ls.common.worker.associated = NULL;
- pack = eina_list_append(pack, send_fc);
+ pack = eina_list_append(pack, send_fc);
}
- else
+ else
{
- on_error:
+on_error:
eina_stringshare_del(file);
if (async->ls.common.worker.associated)
@@ -86,8 +86,8 @@ _eio_file_heavy(void *data, Ecore_Thread *thread)
pack = eio_pack_send(thread, pack, &start);
- if (ecore_thread_check(thread))
- break;
+ if (ecore_thread_check(thread))
+ break;
}
if (pack) ecore_thread_feedback(thread, pack);
@@ -155,8 +155,8 @@ _eio_file_eina_ls_heavy(Ecore_Thread *thread, Eio_File_Direct_Ls *async, Eina_It
if (!ls)
{
- eio_file_thread_error(&async->ls.common, thread);
- return;
+ eio_file_thread_error(&async->ls.common, thread);
+ return;
}
eio_file_container_set(&async->ls.common, eina_iterator_container_get(ls));
@@ -165,36 +165,36 @@ _eio_file_eina_ls_heavy(Ecore_Thread *thread, Eio_File_Direct_Ls *async, Eina_It
EINA_ITERATOR_FOREACH(ls, info)
{
- Eina_Bool filter = EINA_TRUE;
+ Eina_Bool filter = EINA_TRUE;
- if (async->filter_cb)
- {
- filter = async->filter_cb((void*) async->ls.common.data, &async->ls.common, info);
- }
+ if (async->filter_cb)
+ {
+ filter = async->filter_cb((void*) async->ls.common.data, &async->ls.common, info);
+ }
- if (filter)
- {
- Eio_File_Direct_Info *send_di;
+ if (filter)
+ {
+ Eio_File_Direct_Info *send_di;
- send_di = eio_direct_info_malloc();
- if (!send_di) continue;
+ send_di = eio_direct_info_malloc();
+ if (!send_di) continue;
- memcpy(&send_di->info, info, sizeof (Eina_File_Direct_Info));
- send_di->associated = async->ls.common.worker.associated;
- async->ls.common.worker.associated = NULL;
+ memcpy(&send_di->info, info, sizeof (Eina_File_Direct_Info));
+ send_di->associated = async->ls.common.worker.associated;
+ async->ls.common.worker.associated = NULL;
pack = eina_list_append(pack, send_di);
- }
- else if (async->ls.common.worker.associated)
- {
+ }
+ else if (async->ls.common.worker.associated)
+ {
eina_hash_free(async->ls.common.worker.associated);
async->ls.common.worker.associated = NULL;
- }
+ }
pack = eio_pack_send(thread, pack, &start);
- if (ecore_thread_check(thread))
- break;
+ if (ecore_thread_check(thread))
+ break;
}
if (pack) ecore_thread_feedback(thread, pack);
@@ -415,24 +415,23 @@ _eio_file_move_error(void *data, Ecore_Thread *thread EINA_UNUSED)
if (move->copy)
{
- eio_file_cancel(move->copy);
- return;
+ eio_file_cancel(move->copy);
+ return;
}
if (move->progress.common.error == EXDEV)
{
- Eio_File *eio_cp;
+ Eio_File *eio_cp;
- eio_cp = eio_file_copy(move->progress.source, move->progress.dest,
- move->progress.progress_cb ? _eio_file_move_copy_progress : NULL,
- _eio_file_move_copy_done,
- _eio_file_move_copy_error,
- move);
+ eio_cp = eio_file_copy(move->progress.source, move->progress.dest,
+ move->progress.progress_cb ? _eio_file_move_copy_progress : NULL,
+ _eio_file_move_copy_done,
+ _eio_file_move_copy_error,
+ move);
- if (eio_cp)
+ if (eio_cp)
{
move->copy = eio_cp;
-
move->progress.common.thread = ((Eio_File_Progress*)move->copy)->common.thread;
return;
}
diff --git a/src/lib/eio/eio_model.c b/src/lib/eio/eio_model.c
index ec2672d7f1..3b3c2bea3d 100644
--- a/src/lib/eio/eio_model.c
+++ b/src/lib/eio/eio_model.c
@@ -20,118 +20,41 @@
#define MY_CLASS EIO_MODEL_CLASS
#define MY_CLASS_NAME "Eio_Model"
-static void _eio_prop_set_error_cb(void *, Eio_File *, int);
-static void _eio_stat_done_cb(void *, Eio_File *, const Eina_Stat *);
-static void _eio_error_cb(void *, Eio_File *, int error);
-static void _eio_done_children_load_cb(void *, Eio_File *);
-static void _eio_error_children_load_cb(void *, Eio_File *, int);
-static void _eio_main_children_load_cb(void *, Eio_File *, const Eina_File_Direct_Info *);
-static Eina_Bool _eio_filter_children_load_cb(void *, Eio_File *, const Eina_File_Direct_Info *);
-
-static void
-_eio_stat_do(Eio_Model_Data *priv)
-{
- priv->stat_file = eio_file_direct_stat(priv->path, _eio_stat_done_cb, _eio_error_cb, priv);
-}
-
+static void _eio_model_info_free(Eio_Model_Info *info, Eina_Bool model);
+static void _eio_model_efl_model_monitor_add(Eio_Model_Data *priv);
+
+EINA_VALUE_STRUCT_DESC_DEFINE(_eina_file_direct_info_desc,
+ NULL,
+ sizeof (Eio_Model_Info),
+ EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_ULONG, Eio_Model_Info, path_length),
+ EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_ULONG, Eio_Model_Info, name_length),
+ EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_ULONG, Eio_Model_Info, name_start),
+ EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_UINT, Eio_Model_Info, type),
+ EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_STRINGSHARE, Eio_Model_Info, path));
/**
* Callbacks
* Property
*/
static void
-_eio_stat_done_cb(void *data, Eio_File *handler EINA_UNUSED, const Eina_Stat *stat)
+_eio_move_done_cb(void *data, Eio_File *handler)
{
- _Eio_Model_Data *priv = data;
- _Eio_Property_Promise* p;
- Eina_List *l;
- EINA_LIST_FOREACH(priv->property_promises, l, p)
- {
- Eina_Value* v = eina_value_new(EINA_VALUE_TYPE_CHAR);
- switch(p->property)
- {
- case EIO_MODEL_PROP_IS_DIR:
- eina_value_setup(v, EINA_VALUE_TYPE_CHAR);
- eina_value_set(v, eio_file_is_dir(stat) ? EINA_TRUE : EINA_FALSE);
- break;
- case EIO_MODEL_PROP_IS_LNK:
- eina_value_setup(v, EINA_VALUE_TYPE_CHAR);
- eina_value_set(v, eio_file_is_lnk(stat) ? EINA_TRUE : EINA_FALSE);
- break;
- case EIO_MODEL_PROP_MTIME:
- eina_value_setup(v, EINA_VALUE_TYPE_DOUBLE);
- eina_value_set(v, eio_file_mtime(stat));
- break;
- case EIO_MODEL_PROP_SIZE:
- eina_value_setup(v, EINA_VALUE_TYPE_INT64);
- eina_value_set(v, eio_file_size(stat));
- break;
- default:
- break;
- };
-
- efl_promise_value_set(p->promise, v, (Eina_Free_Cb)&eina_value_free);
- free(p);
- }
- eina_list_free(priv->property_promises);
- priv->property_promises = NULL;
+ Eio_Model_Data *pd = ecore_thread_local_data_find(handler->thread, ".pd");
+ Eina_Promise *p = data;
- priv->stat_file = NULL;
-}
+ // FIXME: generate events
-static void
-_eio_progress_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED, const Eio_Progress *info EINA_UNUSED)
-{
- //TODO: implement
+ eina_promise_resolve(p, eina_value_string_init(pd->path));
+ pd->request.move = NULL;
}
static void
-_eio_move_done_cb(void *data, Eio_File *handler EINA_UNUSED)
+_eio_file_error_cb(void *data, Eio_File *handler, int error)
{
- Efl_Model_Property_Event evt;
- Eio_Model_Data *priv = data;
- Eina_Array *properties;
-
- EINA_SAFETY_ON_FALSE_RETURN(efl_ref_count(priv->obj));
- properties = eina_array_new(20);
-
- memset(&evt, 0, sizeof(Efl_Model_Property_Event));
- eina_array_push(properties, _eio_model_prop_names[EIO_MODEL_PROP_PATH]);
- eina_array_push(properties, _eio_model_prop_names[EIO_MODEL_PROP_FILENAME]);
- evt.changed_properties = properties;
+ Eio_Model_Data *pd = ecore_thread_local_data_find(handler->thread, ".pd");
+ Eina_Promise *p = data;
- efl_event_callback_call(priv->obj, EFL_MODEL_EVENT_PROPERTIES_CHANGED, &evt);
- eina_array_free(properties);
-}
-
-static void
-_eio_error_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED, int error)
-{
- if (error != 0)
- {
- _Eio_Model_Data *priv = data;
- _Eio_Property_Promise* p;
- Eina_List *l;
- WRN("%d: %s.", error, strerror(error));
-
- EINA_LIST_FOREACH(priv->property_promises, l, p)
- {
- efl_promise_failed_set(p->promise, EFL_MODEL_ERROR_UNKNOWN);
- }
- eina_list_free(priv->property_promises);
- priv->property_promises = NULL;
-
- eio_file_cancel(priv->stat_file);
- priv->stat_file = NULL;
- }
-}
-
-static void
-_eio_prop_set_error_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED, int error)
-{
- if (error != 0)
- {
- WRN("%d: %s.", error, strerror(error));
- }
+ eina_promise_reject(p, error);
+ pd->request.move = NULL;
}
/**
@@ -141,50 +64,73 @@ _eio_prop_set_error_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED, in
static Eina_Bool
_efl_model_evt_added_ecore_cb(void *data, int type, void *event)
{
- Eio_Monitor_Event *evt = event;
- Eio_Model_Data *priv = data;
+ Eio_Monitor_Event *ev = event;
+ Eio_Model *obj;
+ Eio_Model_Data *pd = data;
Efl_Model_Children_Event cevt;
- Eina_Value path;
+ Eio_Model_Info *mi;
+ Eina_List *l;
+ Eina_Stringshare *spath = NULL;
+ char *path = NULL;
if (type != EIO_MONITOR_DIRECTORY_CREATED && type != EIO_MONITOR_FILE_CREATED)
return EINA_TRUE;
- char *dir = ecore_file_dir_get(evt->filename);
- if (strcmp(priv->path, dir) != 0)
+ if (ev->monitor != pd->monitor) return EINA_TRUE;
+
+ obj = pd->self;
+
+ path = ecore_file_dir_get(ev->filename);
+ if (strcmp(pd->path, path) != 0)
+ goto end;
+
+ spath = eina_stringshare_add(ev->filename);
+
+ EINA_LIST_FOREACH(pd->files, l, mi)
{
- free(dir);
- return EINA_TRUE;
+ if (mi->path == spath)
+ goto end;
}
- free(dir);
- if (priv->children_list)
+ mi = calloc(1, sizeof (Eio_Model_Info));
+ if (!mi) goto end;
+
+ mi->path_length = eina_stringshare_strlen(spath);
+ mi->path = eina_stringshare_ref(spath);
+ mi->name_start = eina_stringshare_strlen(pd->path) + 1;
+ mi->name_length = mi->path_length - mi->name_start;
+ mi->type = EINA_FILE_UNKNOWN;
+ mi->parent_ref = EINA_TRUE;
+
+ // Honor filter on new added file too
+ if (pd->filter.cb)
{
- Eina_List* cur = priv->children_list;
- Eina_Stringshare *spath = eina_stringshare_add(evt->filename);
- int i;
+ Eina_File_Direct_Info info = { 0 };
+
+ info.path_length = mi->path_length;
+ info.name_start = mi->name_start;
+ info.name_length = mi->name_length;
+ info.type = EINA_FILE_UNKNOWN;
+ strcpy(info.path, mi->path);
- for (i = 0; cur; ++i, cur = cur->next)
+ if (!pd->filter.cb(pd->filter.data, obj, &info))
{
- Eio_Model_Data *cur_priv = efl_data_scope_get(cur->data, MY_CLASS);
- if(cur_priv->path == spath)
- {
- eina_stringshare_del(spath);
- return EINA_TRUE;
- }
+ eina_stringshare_del(mi->path);
+ free(mi);
+ goto end;
}
- eina_stringshare_del(spath);
}
- cevt.child = efl_add_ref(EIO_MODEL_CLASS, priv->obj, eio_model_path_set(efl_added, evt->filename));
- priv->children_list = eina_list_append(priv->children_list, cevt.child);
- cevt.index = eina_list_count(priv->children_list);
+ cevt.index = eina_list_count(pd->files);
+ pd->files = eina_list_append(pd->files, mi);
- eina_value_setup(&path, EINA_VALUE_TYPE_STRING);
- eina_value_set(&path, evt->filename);
- eio_model_children_filter_set(cevt.child, priv->filter_cb, priv->filter_userdata);
- eina_value_flush(&path);
+ // Notify of the new child being added
+ efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILD_ADDED, &cevt);
+ efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, NULL);
- efl_event_callback_call(priv->obj, EFL_MODEL_EVENT_CHILD_ADDED, &cevt);
+ end:
+ eina_stringshare_del(spath);
+ free(path);
return EINA_TRUE;
}
@@ -192,311 +138,681 @@ _efl_model_evt_added_ecore_cb(void *data, int type, void *event)
static Eina_Bool
_efl_model_evt_deleted_ecore_cb(void *data, int type, void *event)
{
- Eio_Monitor_Event *evt = event;
- Eio_Model_Data *priv = data;
+ Eio_Model_Info *mi;
+ Eina_List *l;
+ Eio_Monitor_Event *ev = event;
+ Eio_Model *obj;
+ Eio_Model_Data *pd = data;
+ Eina_Stringshare *spath = NULL;
+ Efl_Model_Children_Event cevt = { 0 };
+ unsigned int i = 0;
if (type != EIO_MONITOR_DIRECTORY_DELETED && type != EIO_MONITOR_FILE_DELETED)
return EINA_TRUE;
- if (priv->children_list)
+ if (ev->monitor != pd->monitor) return EINA_TRUE;
+
+ obj = pd->self;
+
+ spath = eina_stringshare_add(ev->filename);
+
+ // FIXME: Linear search is pretty slow
+ EINA_LIST_FOREACH(pd->files, l, mi)
{
- Eina_List* cur = priv->children_list;
- Eina_Stringshare *spath = eina_stringshare_add(evt->filename);
- int i;
+ if (mi->path == spath)
+ break ;
+ ++i;
+ }
- for (i = 0; cur; ++i, cur = cur->next)
- {
- Eio_Model_Data *cur_priv = efl_data_scope_get(cur->data, MY_CLASS);
- if(cur_priv->path == spath)
- break;
- }
+ if (i >= eina_list_count(pd->files))
+ goto end;
- if (cur)
- {
- Efl_Model_Children_Event cevt;
- cevt.index = i;
- cevt.child = cur->data;
+ cevt.index = i;
+ cevt.child = mi->object;
- efl_event_callback_call(priv->obj, EFL_MODEL_EVENT_CHILD_REMOVED, &cevt);
+ efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILD_REMOVED, &cevt);
+ efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, NULL);
- priv->children_list = eina_list_remove_list(priv->children_list, cur);
- efl_unref(cevt.child);
- }
+ // Remove the entry from the files list
+ pd->files = eina_list_remove_list(pd->files, l);
- eina_stringshare_del(spath);
- }
+ // This should trigger the object child destruction if it exist
+ // resulting in the potential destruction of the child, after
+ // this point mi and info might be freed.
+ _eio_model_info_free(mi, EINA_FALSE);
- return EINA_TRUE;
-}
+ end:
+ eina_stringshare_del(spath);
-static void
-_eio_monitors_list_load(Eio_Model_Data *priv)
-{
- priv->mon.mon_event_child_add[0] = EIO_MONITOR_DIRECTORY_CREATED;
- priv->mon.mon_event_child_add[1] = EIO_MONITOR_FILE_CREATED;
- priv->mon.mon_event_child_add[2] = EIO_MONITOR_ERROR;
- priv->mon.mon_event_child_del[0] = EIO_MONITOR_DIRECTORY_DELETED;
- priv->mon.mon_event_child_del[1] = EIO_MONITOR_FILE_DELETED;
- priv->mon.mon_event_child_del[2] = EIO_MONITOR_ERROR;
+ return EINA_TRUE;
}
/**
* Callbacks
* Child Del
*/
-static Eina_Bool
-_eio_filter_child_del_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED, const Eina_File_Direct_Info *info EINA_UNUSED)
+static void
+_eio_del_cleanup(Eio_Model *obj)
{
- return EINA_TRUE;
+ Eio_Model_Data *pd = efl_data_scope_get(obj, EIO_MODEL_CLASS);
+
+ pd->request.del = NULL;
+ efl_unref(obj);
}
static void
-_eio_progress_child_del_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED, const Eio_Progress *info EINA_UNUSED)
-{}
+_eio_done_unlink_cb(void *data, Eio_File *handler EINA_UNUSED)
+{
+ Eio_Model *child = data;
+
+ _eio_del_cleanup(child);
+}
static void
-_eio_done_unlink_cb(void *data, Eio_File *handler EINA_UNUSED)
+_eio_error_unlink_cb(void *data, Eio_File *handler EINA_UNUSED, int error)
{
- Eio_Model_Data *priv = data;
+ Eio_Model *child = data;
- EINA_SAFETY_ON_NULL_RETURN(priv);
- EINA_SAFETY_ON_NULL_RETURN(priv->obj);
+ ERR("%d: %s.", error, strerror(error));
- efl_unref(priv->obj);
+ _eio_del_cleanup(child);
}
static void
-_eio_error_unlink_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED, int error)
+_eio_model_info_free(Eio_Model_Info *info, Eina_Bool model)
{
- Eio_Model_Data *priv = data;
+ if (!info) return ;
- ERR("%d: %s.", error, strerror(error));
+ if (!model)
+ {
+ if (!info->object)
+ {
+ efl_del(info->object);
+ info->object = NULL;
+ }
+ info->child_ref = EINA_FALSE;
+ }
+ else
+ {
+ info->parent_ref = EINA_FALSE;
+ }
- efl_unref(priv->obj);
+ if (info->child_ref ||
+ info->parent_ref)
+ return ;
+
+ eina_stringshare_del(info->path);
+ free(info);
}
+static Eina_File_Type
+_eio_model_info_type_get(const Eina_File_Direct_Info *info, const Eina_Stat *st)
+{
+ if (info && info->type != EINA_FILE_UNKNOWN)
+ return info->type;
+ if (st)
+ {
+ if (S_ISREG(st->mode))
+ return EINA_FILE_REG;
+ else if (S_ISDIR(st->mode))
+ return EINA_FILE_DIR;
+ else if (S_ISCHR(st->mode))
+ return EINA_FILE_CHR;
+ else if (S_ISBLK(st->mode))
+ return EINA_FILE_BLK;
+ else if (S_ISFIFO(st->mode))
+ return EINA_FILE_FIFO;
+ else if (S_ISLNK(st->mode))
+ return EINA_FILE_LNK;
+#ifdef S_ISSOCK
+ else if (S_ISSOCK(st->mode))
+ return EINA_FILE_SOCK;
+#endif
+ }
+ return EINA_FILE_UNKNOWN;
+}
-/**
- * Interfaces impl.
- */
-static Eina_Array const *
-_eio_model_efl_model_properties_get(Eo *obj EINA_UNUSED, Eio_Model_Data *_pd)
+static void
+_eio_model_info_build(const Eio_Model *model, Eio_Model_Data *pd)
{
- Eio_Model_Data *priv = _pd;
+ char *path;
+
+ if (pd->info) goto end;
+
+ pd->info = calloc(1, sizeof (Eio_Model_Info));
+ if (!pd->info) return ;
+
+ pd->info->path_length = eina_stringshare_strlen(pd->path);
+ pd->info->path = eina_stringshare_ref(pd->path);
+
+ path = strdup(pd->path);
+ pd->info->name_start = basename(path) - path;
+ pd->info->name_length = pd->info->path_length - pd->info->name_start;
+ free(path);
+
+ pd->info->type = _eio_model_info_type_get(NULL, pd->st);
- EINA_SAFETY_ON_NULL_RETURN_VAL(priv, NULL);
- EINA_SAFETY_ON_NULL_RETURN_VAL(priv->obj, NULL);
+ efl_model_properties_changed(model, "direct_info");
- return priv->properties_name;
+ end:
+ pd->info->parent_ref = EINA_TRUE;
}
-/**
- * Property Get
- */
static void
-_on_idle_mime(void *data, const Efl_Event *ev)
+_eio_build_st_done(void *data, Eio_File *handler EINA_UNUSED, const Eina_Stat *stat)
{
- Eio_Model_Data *priv = data;
- Efl_Promise *p;
- const char *value;
+ Eio_Model *model = data;
+ Eio_Model_Data *pd = efl_data_scope_get(model, EIO_MODEL_CLASS);
- // Make sure that we are not over consuming time in the main loop
- if (ecore_time_get() - ecore_loop_time_get() > 0.004) return ;
+ if (!pd) return ;
+ pd->request.stat = NULL;
- // Are we done yet ?
- efl_event_callback_del(ev->object, EFL_LOOP_EVENT_IDLE_ENTER, _on_idle_mime, priv);
- if (!priv->fetching_mime) return ;
+ pd->st = malloc(sizeof (Eina_Stat));
+ if (!pd->st) return ;
- value = efreet_mime_type_get(priv->path);
+ memcpy(pd->st, stat, sizeof (Eina_Stat));
- EINA_LIST_FREE(priv->fetching_mime, p)
+ if (!pd->info) _eio_model_info_build(model, pd);
+ if (pd->info->type == EINA_FILE_UNKNOWN)
+ pd->info->type = _eio_model_info_type_get(NULL, stat);
+
+ efl_model_properties_changed(model, "mtime", "atime", "ctime", "is_dir", "is_lnk", "size", "stat");
+
+ if (eio_file_is_dir(pd->st))
{
- Eina_Value *v;
+ // Now that we know we are a directory, we should whatch it
+ _eio_model_efl_model_monitor_add(pd);
- v = eina_value_new(EINA_VALUE_TYPE_STRING);
- eina_value_set(v, value);
- efl_promise_value_set(p, v, (Eina_Free_Cb)&eina_value_free);
+ // And start listing its child
+ efl_model_children_count_get(model);
}
+
+ efl_unref(model);
}
-static Efl_Future*
-_eio_model_efl_model_property_get(Eo *obj, Eio_Model_Data *priv, const char *property)
+static void
+_eio_build_st_done_clobber(void *data, Eio_File *handler, const Eina_Stat *stat)
{
- _Eio_Property_Name property_name;
- const char* value = NULL;
- Efl_Promise *promise;
- Efl_Future *future;
+ Eio_Model *model = data;
+ Eio_Model *parent;
+
+ efl_ref(model);
+ _eio_build_st_done(data, handler, stat);
+ parent = efl_parent_get(model);
+ efl_model_child_del(parent, model);
+ efl_unref(model);
+}
- promise = efl_add(EFL_PROMISE_CLASS, obj);
- future = efl_promise_future_get(promise);
+static void
+_eio_build_st_error(void *data, Eio_File *handler EINA_UNUSED, int error)
+{
+ Eio_Model *model = data;
+ Eio_Model_Data *pd = efl_data_scope_get(model, EIO_MODEL_CLASS);
- EINA_SAFETY_ON_NULL_RETURN_VAL(priv, future);
+ pd->request.stat = NULL;
+ pd->error = error;
- if (property == NULL)
- {
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_NOT_FOUND);
- return future;
- }
+ efl_model_properties_changed(model, "direct_info", "mtime", "atime", "ctime", "is_dir", "is_lnk", "size", "stat");
- if(strcmp(_eio_model_prop_names[EIO_MODEL_PROP_FILENAME], property) == 0)
- {
- char* tmp = strdup(priv->path);
- char* basename_ = basename(tmp);
- value = strdup(basename_);
- property_name = EIO_MODEL_PROP_FILENAME;
- free(tmp);
- }
- else if(strcmp(_eio_model_prop_names[EIO_MODEL_PROP_PATH], property) == 0)
+ efl_unref(model);
+}
+
+static void
+_eio_build_st_error_clobber(void *data, Eio_File *handler, int error)
+{
+ Eio_Model *model = data;
+ Eio_Model *parent;
+
+ efl_ref(model);
+ _eio_build_st_error(data, handler, error);
+ parent = efl_parent_get(model);
+ efl_model_child_del(parent, model);
+ efl_unref(model);
+}
+
+static void
+_eio_build_st(const Eio_Model *model, Eio_Model_Data *pd)
+{
+ if (pd->st) return ;
+ if (pd->request.stat) return ;
+ if (pd->error) return ;
+
+ pd->request.stat = eio_file_direct_stat(pd->path, _eio_build_st_done, _eio_build_st_error, efl_ref(model));
+}
+
+static void
+_eio_build_st_then_clobber(const Eio_Model *model, Eio_Model_Data *pd)
+{
+ if (pd->st) return ;
+ if (pd->request.stat) return ;
+ if (pd->error) return ;
+
+ pd->request.stat = eio_file_direct_stat(pd->path,
+ _eio_build_st_done_clobber,
+ _eio_build_st_error_clobber,
+ efl_ref(model));
+}
+
+static Eina_List *delayed_queue = NULL;
+
+static void
+_delayed_flush(void *data EINA_UNUSED, const Efl_Event *ev)
+{
+ Eina_Promise *p;
+
+ EINA_LIST_FREE(delayed_queue, p)
+ eina_promise_resolve(p, EINA_VALUE_EMPTY);
+
+ efl_event_callback_del(ev->object, EFL_LOOP_EVENT_IDLE, _delayed_flush, NULL);
+}
+
+static void
+_cancel_request(void *data, const Eina_Promise *dead_ptr EINA_UNUSED)
+{
+ delayed_queue = eina_list_remove_list(delayed_queue, data);
+}
+
+static Eina_Future *
+_build_delay(Efl_Loop *loop)
+{
+ Eina_Promise *p;
+
+ p = eina_promise_new(efl_loop_future_scheduler_get(loop),
+ _cancel_request, NULL);
+
+ if (!delayed_queue)
{
- value = priv->path;
- property_name = EIO_MODEL_PROP_PATH;
+ // Remove callback, just in case it is still there.
+ efl_event_callback_del(loop, EFL_LOOP_EVENT_IDLE, _delayed_flush, NULL);
+ efl_event_callback_add(loop, EFL_LOOP_EVENT_IDLE, _delayed_flush, NULL);
+ // FIXME: It would be nice to be able to build a future directly to be triggered on one event
}
- else if(strcmp(_eio_model_prop_names[EIO_MODEL_PROP_MIME_TYPE], property) == 0)
+
+ delayed_queue = eina_list_append(delayed_queue, p);
+ eina_promise_data_set(p, eina_list_last(delayed_queue));
+
+ return eina_future_new(p);
+}
+
+static void
+_eio_build_mime_clean(Eio_Model_Data *pd)
+{
+ efl_wref_del(pd->loop, &pd->loop);
+ pd->loop = NULL;
+ pd->request.mime = NULL;
+}
+
+static Eina_Value
+_eio_build_mime_now(void *data, const Eina_Value v, const Eina_Future *dead_future EINA_UNUSED)
+{
+ Eio_Model *model = data;
+ Eio_Model_Data *pd = efl_data_scope_get(model, EIO_MODEL_CLASS);
+
+ if (v.type == EINA_VALUE_TYPE_ERROR) goto on_error;
+ if (!pd->loop) goto on_error;
+
+ // Make sure that we are not over consuming time in the main loop
+ if (delayed_queue || ecore_time_get() - ecore_loop_time_get() > 0.004)
{
- property_name = EIO_MODEL_PROP_MIME_TYPE;
+ Eina_Future *f = eina_future_then(_build_delay(pd->loop),
+ _eio_build_mime_now, model);
+ return eina_future_as_value(efl_future_Eina_FutureXXX_then(model, f));
}
- else if(strcmp(_eio_model_prop_names[EIO_MODEL_PROP_MTIME], property) == 0)
- property_name = EIO_MODEL_PROP_MTIME;
- else if(strcmp(_eio_model_prop_names[EIO_MODEL_PROP_IS_DIR], property) == 0)
- property_name = EIO_MODEL_PROP_IS_DIR;
- else if(strcmp(_eio_model_prop_names[EIO_MODEL_PROP_IS_LNK], property) == 0)
- property_name = EIO_MODEL_PROP_IS_LNK;
- else if(strcmp(_eio_model_prop_names[EIO_MODEL_PROP_SIZE], property) == 0)
- property_name = EIO_MODEL_PROP_SIZE;
- else
+
+ pd->mime_type = efreet_mime_type_get(pd->path);
+
+ _eio_build_mime_clean(pd);
+
+ efl_model_properties_changed(model, "mime_type");
+
+ return v;
+
+ on_error:
+ _eio_build_mime_clean(pd);
+
+ return v;
+}
+
+static void
+_eio_build_mime(const Efl_Object *model, Eio_Model_Data *pd)
+{
+ Eina_Future *f;
+
+ if (pd->mime_type) return ;
+ if (pd->request.mime) return ;
+
+ efl_wref_add(efl_provider_find(model, EFL_LOOP_CLASS), &pd->loop);
+
+ f = efl_loop_job(pd->loop);
+ f = eina_future_then(f, _eio_build_mime_now, model);
+ pd->request.mime = efl_future_Eina_FutureXXX_then(model, f);
+}
+
+static Eina_Value *
+_property_filename_cb(const Eo *obj, Eio_Model_Data *pd)
+{
+ _eio_model_info_build(obj, pd);
+ if (pd->info)
+ return eina_value_string_new(pd->info->path + pd->info->name_start);
+ return eina_value_error_new(EAGAIN);
+}
+
+static Eina_Value *
+_property_path_cb(const Eo *obj EINA_UNUSED, Eio_Model_Data *pd)
+{
+ return eina_value_string_new(pd->path);
+}
+
+static Eina_Value *
+_property_direct_info_cb(const Eo *obj, Eio_Model_Data *pd)
+{
+ _eio_model_info_build(obj, pd);
+
+ if (pd->info)
{
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_NOT_FOUND);
- return future;
+ Eina_Value *r;
+
+ r = eina_value_struct_new(_eina_file_direct_info_desc());
+ if (!r) return NULL;
+ if (!eina_value_pset(r, pd->info))
+ {
+ eina_value_free(r);
+ return NULL;
+ }
+
+ return r;
}
+ if (pd->error)
+ return eina_value_error_new(pd->error);
+ return eina_value_error_new(EAGAIN);
+}
- switch(property_name)
+#define TIMECB(Prop) \
+ static Eina_Value * \
+ _property_##Prop##_cb(const Eo *obj, Eio_Model_Data *pd) \
+ { \
+ if (pd->st) \
+ return eina_value_time_new(pd->st->Prop); \
+ if (pd->error) \
+ return eina_value_error_new(pd->error); \
+ \
+ _eio_build_st(obj, pd); \
+ return eina_value_error_new(EAGAIN); \
+ }
+
+TIMECB(mtime);
+TIMECB(atime);
+TIMECB(ctime);
+
+static Eina_Value *
+_property_is_dir_cb(const Eo *obj, Eio_Model_Data *pd)
+{
+ if (pd->st)
+ return eina_value_bool_new(eio_file_is_dir(pd->st));
+ if (pd->error)
+ return eina_value_error_new(pd->error);
+
+ _eio_build_st(obj, pd);
+ return eina_value_error_new(EAGAIN);
+}
+
+static Eina_Value *
+_property_is_lnk_cb(const Eo *obj, Eio_Model_Data *pd)
+{
+ if (pd->st)
+ return eina_value_bool_new(eio_file_is_lnk(pd->st));
+ if (pd->error)
+ return eina_value_error_new(pd->error);
+
+ _eio_build_st(obj, pd);
+ return eina_value_error_new(EAGAIN);
+}
+
+static Eina_Value *
+_property_size_cb(const Eo *obj, Eio_Model_Data *pd)
+{
+ if (pd->st)
+ return eina_value_ulong_new(pd->st->size);
+ if (pd->error)
+ return eina_value_error_new(pd->error);
+
+ _eio_build_st(obj, pd);
+ return eina_value_ulong_new(EAGAIN);
+}
+
+static Eina_Value *
+_property_stat_cb(const Eo *obj, Eio_Model_Data *pd)
+{
+ if (pd->st)
{
- case EIO_MODEL_PROP_MIME_TYPE:
- {
- if (!priv->fetching_mime)
- efl_event_callback_add(efl_provider_find(obj, EFL_LOOP_CLASS),
- EFL_LOOP_EVENT_IDLE_ENTER, _on_idle_mime, priv);
- priv->fetching_mime = eina_list_append(priv->fetching_mime, promise);
- break;
- }
- case EIO_MODEL_PROP_FILENAME:
- case EIO_MODEL_PROP_PATH:
- {
- Eina_Value* v = eina_value_new(EINA_VALUE_TYPE_STRING);
- eina_value_set(v, value);
- efl_promise_value_set(promise, v, (Eina_Free_Cb)&eina_value_free);
-
- break;
- }
- default:
- {
- _Eio_Property_Promise* p = calloc(1, sizeof(_Eio_Property_Promise));
- p->promise = promise;
- p->property = property_name;;
- priv->property_promises = eina_list_prepend(priv->property_promises, p);
-
- if (!priv->stat_file)
- _eio_stat_do(priv);
- break;
- }
+ Eina_Value *r;
+
+ r = eina_value_struct_new(_eina_stat_desc());
+ if (!r) return NULL;
+ if (!eina_value_pset(r, pd->info))
+ {
+ eina_value_free(r);
+ return NULL;
+ }
+
+ return r;
}
- return future;
+ if (pd->error)
+ return eina_value_error_new(pd->error);
+
+ _eio_build_st(obj, pd);
+ return eina_value_error_new(EAGAIN);
+}
+
+static Eina_Value *
+_property_mime_type_cb(const Eo *obj, Eio_Model_Data *pd)
+{
+ if (pd->mime_type)
+ return eina_value_string_new(pd->mime_type);
+
+ _eio_build_mime(obj, pd);
+ return eina_value_error_new(EAGAIN);
}
+#define PP(Name) \
+ { #Name, _property_##Name##_cb }
+
+static struct {
+ const char *name;
+ Eina_Value *(*cb)(const Eo *obj, Eio_Model_Data *pd);
+} properties[] = {
+ PP(filename), PP(path),
+ PP(direct_info),
+ PP(mtime), PP(atime), PP(ctime), PP(is_dir), PP(is_lnk), PP(size),
+ PP(stat),
+ PP(mime_type)
+};
+
/**
- * Property Set
+ * Interfaces impl.
*/
-static Efl_Future*
-_eio_model_efl_model_property_set(Eo *obj EINA_UNUSED,
- Eio_Model_Data *priv,
- const char * property,
- const Eina_Value *value)
+static Eina_Array *
+_eio_model_efl_model_properties_get(const Eo *obj EINA_UNUSED,
+ Eio_Model_Data *pd EINA_UNUSED)
+{
+ Eina_Array *r;
+ unsigned int i;
+
+ r = eina_array_new(4);
+ for (i = 0; i < EINA_C_ARRAY_LENGTH(properties); ++i)
+ eina_array_push(r, properties[i].name);
+
+ return r;
+}
+
+static Eina_Value *
+_eio_model_efl_model_property_get(const Eo *obj, Eio_Model_Data *pd, const char *property)
+{
+ unsigned int i;
+
+ if (!property) return NULL;
+ if (pd->error) return eina_value_error_new(pd->error);
+
+ for (i = 0; i < EINA_C_ARRAY_LENGTH(properties); ++i)
+ if (property == properties[i].name ||
+ !strcmp(property, properties[i].name))
+ return properties[i].cb(obj, pd);
+
+ ERR("Could not find property '%s'.", property);
+ // Unknow value request
+ return efl_model_property_get(efl_super(obj, EIO_MODEL_CLASS), property);
+}
+
+static Eina_Future *
+_eio_model_efl_model_property_set(Eo *obj,
+ Eio_Model_Data *pd,
+ const char *property, Eina_Value *value)
{
Eo *loop = efl_provider_find(obj, EFL_LOOP_CLASS);
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, loop);
- Efl_Future* future = efl_promise_future_get(promise);
- char *dest;
+ const char *path;
+ Eina_Future *f;
+ Eina_Value s = EINA_VALUE_EMPTY;
+ Eina_Error err = EFL_MODEL_ERROR_NOT_FOUND;
+ Eina_Bool finalized = !!pd->path;
- EINA_SAFETY_ON_NULL_RETURN_VAL(property, future);
+ if (!property) goto on_error;
- if (strcmp(property, "path") != 0)
+ err = EFL_MODEL_ERROR_NOT_SUPPORTED;
+ if (strcmp(property, "path") != 0) goto on_error;
+
+ if (finalized && pd->request.move) goto on_error;
+
+ err = EFL_MODEL_ERROR_UNKNOWN;
+ if (!eina_value_setup(&s, EINA_VALUE_TYPE_STRING)) goto on_error;
+ if (!eina_value_convert(value, &s)) goto on_error;
+ if (!eina_value_string_get(&s, &path)) goto on_error;
+
+ eina_stringshare_replace(&pd->path, path);
+
+ if (finalized)
{
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_NOT_SUPPORTED);
- return future;
- }
+ Eina_Promise *p = eina_promise_new(efl_loop_future_scheduler_get(loop),
+ _efl_io_manager_future_cancel, NULL);
+ f = eina_future_new(p);
- if (!eina_value_get(value, &dest))
+ pd->request.move = eio_file_move(pd->path, path,
+ NULL, /* FIXME: have a move progress property */
+ _eio_move_done_cb, _eio_file_error_cb, p);
+
+ ecore_thread_local_data_add(pd->request.move->thread, ".pd", pd, NULL, EINA_TRUE);
+ eina_promise_data_set(p, pd->request.move);
+
+ // FIXME: turn on monitor in the finalize stage or after move
+ }
+ else
{
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_UNKNOWN);
- return future;
+ f = eina_future_resolved(efl_loop_future_scheduler_get(loop),
+ eina_value_string_init(pd->path));
}
- if (priv->path == NULL || !ecore_file_exists(priv->path))
+ return efl_future_Eina_FutureXXX_then(obj, f);
+
+ on_error:
+ return eina_future_rejected(efl_loop_future_scheduler_get(loop), err);
+}
+
+static void
+_eio_model_children_list(void *data, Eina_Array *entries)
+{
+ Eina_File_Direct_Info *info;
+ Efl_Model *obj = data;
+ Eio_Model_Data *pd;
+ Efl_Model_Children_Event cevt = { 0 };
+ Eina_Array_Iterator iterator;
+ unsigned int i;
+
+ pd = efl_data_scope_get(obj, EIO_MODEL_CLASS);
+ if (!pd) return ;
+
+ EINA_ARRAY_ITER_NEXT(entries, i, info, iterator)
{
- eina_stringshare_replace(&priv->path, dest);
+ Eio_Model_Info *mi;
- if (!ecore_file_exists(priv->path))
+ if (pd->filter.cb)
{
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_NOT_FOUND);
- return future;
+ if (!pd->filter.cb(pd->filter.data, obj, info))
+ continue ;
}
- char* tmp = strdup(priv->path);
- char* basename_ = basename(tmp);
- INF("path '%s' with filename '%s'.", priv->path, basename_);
- free(tmp);
- (void)basename_;
+ mi = calloc(1, sizeof (Eio_Model_Info));
+ if (!mi) continue ;
- _eio_monitors_list_load(priv);
+ mi->path_length = info->path_length;
+ mi->path = eina_stringshare_add(info->path);
- _eio_move_done_cb(priv, NULL);
- }
- else
- {
- priv->move_file = eio_file_move(priv->path, dest, _eio_progress_cb, _eio_move_done_cb, _eio_prop_set_error_cb, priv);
- eina_stringshare_replace(&priv->path, dest);
+ mi->name_start = info->name_start;
+ mi->name_length = info->name_length;
+ mi->type = _eio_model_info_type_get(info, NULL);
+ mi->parent_ref = EINA_TRUE;
+
+ cevt.index = eina_list_count(pd->files);
+ cevt.child = NULL;
+
+ pd->files = eina_list_append(pd->files, mi);
+
+ efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILD_ADDED, &cevt);
}
- efl_promise_value_set(promise, &value, NULL);
- return future;
+ efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, NULL);
+}
+
+static Eina_Value
+_eio_model_children_list_on(void *data, const Eina_Value v,
+ const Eina_Future *dead EINA_UNUSED)
+{
+ Eio_Model_Data *pd = data;
+
+ pd->request.listing = NULL;
+ pd->listed = EINA_TRUE;
+
+ // Now that we have listed the content of the directory,
+ // we can whatch over it
+ _eio_model_efl_model_monitor_add(pd);
+
+ return v;
}
/**
* Children Count Get
*/
-static Efl_Future*
-_eio_model_efl_model_children_count_get(Eo *obj EINA_UNUSED, Eio_Model_Data *priv)
+static unsigned int
+_eio_model_efl_model_children_count_get(const Eo *obj, Eio_Model_Data *pd)
{
- Eo *loop = efl_provider_find(obj, EFL_LOOP_CLASS);
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, loop);
- Efl_Future* future = efl_promise_future_get(promise);
-
- if (!priv->path)
+ // If we have no information on the object, let's build it.
+ if (efl_invalidated_get(obj))
{
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_INIT_FAILED);
- return future;
+ return 0;
}
-
- if (!(priv->is_listed))
+ else if (!pd->info)
{
- priv->count_promises = eina_list_prepend(priv->count_promises, promise);
+ _eio_build_st(obj, pd);
+ }
+ else if (!pd->listed &&
+ !pd->request.listing &&
+ pd->info->type == EINA_FILE_DIR)
+ {
+ Efl_Io_Manager *iom;
+ Eina_Future *f;
- if (priv->is_listing == EINA_FALSE)
+ iom = efl_provider_find(obj, EFL_IO_MANAGER_CLASS);
+ if (!iom)
{
- priv->is_listing = EINA_TRUE;
- eio_file_direct_ls(priv->path, _eio_filter_children_load_cb,
- _eio_main_children_load_cb, _eio_done_children_load_cb,
- _eio_error_children_load_cb, priv);
+ ERR("Could not find an Efl.Io.Manager on %p.", obj);
+ return 0;
}
- }
- else
- {
- unsigned int *c = calloc(1, sizeof(unsigned int));
- *c = eina_list_count(priv->children_list);
- efl_promise_value_set(promise, c, free);
+
+ f = efl_io_manager_direct_ls(iom, pd->path, EINA_FALSE,
+ (void*) obj, _eio_model_children_list, NULL);
+ f = eina_future_then(f, _eio_model_children_list_on, pd);
+ pd->request.listing = efl_future_Eina_FutureXXX_then(obj, f);
}
- return future;
+ return eina_list_count(pd->files);
}
static void
@@ -504,9 +820,10 @@ _eio_model_efl_model_monitor_add(Eio_Model_Data *priv)
{
if (!priv->monitor)
{
- priv->monitor = eio_monitor_add(priv->path);
int i = 0;
+ priv->monitor = eio_monitor_add(priv->path);
+
for (i = 0; priv->mon.mon_event_child_add[i] != EIO_MONITOR_ERROR ; ++i)
priv->mon.ecore_child_add_handler[i] =
ecore_event_handler_add(priv->mon.mon_event_child_add[i], _efl_model_evt_added_ecore_cb, priv);
@@ -538,224 +855,152 @@ _eio_model_efl_model_monitor_del(Eio_Model_Data *priv)
* Callbacks
* Children Load
*/
-static Eina_Bool
-_eio_filter_children_load_cb(void *data, Eio_File *handler, const Eina_File_Direct_Info *info)
+static void
+_eio_model_children_filter_set(Eo *obj EINA_UNUSED, Eio_Model_Data *pd,
+ void *filter_data, EflIoFilter filter, Eina_Free_Cb filter_free_cb)
{
- Eio_Model_Data *priv = data;
- EINA_SAFETY_ON_NULL_RETURN_VAL(priv, EINA_FALSE);
-
- eina_spinlock_take(&priv->filter_lock);
- if (priv->filter_cb)
- {
- Eina_Bool r = priv->filter_cb(priv->filter_userdata, handler, info);
- eina_spinlock_release(&priv->filter_lock);
- return r;
- }
- else
- eina_spinlock_release(&priv->filter_lock);
-
- return EINA_TRUE;
+ pd->filter.data = filter_data;
+ pd->filter.cb = filter;
+ pd->filter.free = filter_free_cb;
}
-static void
-_eio_main_children_load_cb(void *data, Eio_File *handler EINA_UNUSED, const Eina_File_Direct_Info *info)
+/**
+ * Child Add
+ */
+static Eo *
+_eio_model_efl_model_child_add(Eo *obj EINA_UNUSED, Eio_Model_Data *priv EINA_UNUSED)
{
- Eo *child;
- Eio_Model_Data *priv = data;
- EINA_SAFETY_ON_NULL_RETURN(priv);
-
- child = efl_add_ref(MY_CLASS, priv->obj, eio_model_path_set(efl_added, info->path));
- eina_spinlock_take(&priv->filter_lock);
- if (priv->filter_cb)
- eio_model_children_filter_set(child, priv->filter_cb, priv->filter_userdata);
- eina_spinlock_release(&priv->filter_lock);
-
- priv->children_list = eina_list_append(priv->children_list, child);
+ return NULL;
}
+/**
+ * Child Remove
+ */
static void
-_eio_done_children_load_cb(void *data, Eio_File *handler EINA_UNUSED)
+_eio_model_efl_model_child_del(Eo *obj EINA_UNUSED,
+ Eio_Model_Data *priv EINA_UNUSED,
+ Eo *child)
{
- Eio_Model_Data *priv = data;
- _Eio_Children_Slice_Promise* p;
- Efl_Promise *promise;
- Eina_List* li;
-
- EINA_SAFETY_ON_NULL_RETURN(priv);
+ Eio_Model_Data *child_pd;
+ Eina_File_Type type;
- eio_file_cancel(priv->listing_file);
- priv->listing_file = NULL;
- priv->is_listed = EINA_TRUE;
- priv->is_listing = EINA_FALSE;
+ child_pd = efl_data_scope_get(child, MY_CLASS);
+ if (!child_pd->info) goto on_error;
+ if (child_pd->error) goto on_error;
- _eio_model_efl_model_monitor_add(priv);
+ type = child_pd->info->type;
- EINA_LIST_FOREACH(priv->count_promises, li, promise)
+ if (type == EINA_FILE_UNKNOWN)
{
- unsigned int *c = calloc(1, sizeof(unsigned int));
- *c = eina_list_count(priv->children_list);
- efl_promise_value_set(promise, c, free);
+ _eio_build_st_then_clobber(child, child_pd);
+ return ;
}
- eina_list_free(priv->count_promises);
- priv->count_promises = NULL;
- EINA_LIST_FOREACH(priv->children_promises, li, p)
+ efl_ref(child);
+ if (type == EINA_FILE_DIR)
{
- Eina_Accessor* accessor = efl_model_list_slice(priv->children_list, p->start, p->count);
- efl_promise_value_set(p->promise, accessor, (Eina_Free_Cb)&eina_accessor_free);
- free(p);
+ child_pd->request.del = eio_dir_unlink(child_pd->path,
+ NULL,
+ NULL,
+ _eio_done_unlink_cb,
+ _eio_error_unlink_cb,
+ child);
}
-
- eina_list_free(priv->children_promises);
- priv->children_promises = NULL;
-}
-
-static void
-_eio_error_children_load_cb(void *data, Eio_File *handler EINA_UNUSED, int error)
-{
- Eio_Model_Data *priv = data;
- _Eio_Children_Slice_Promise* p;
- Efl_Promise *promise;
- Eo *child;
-
- WRN("%d: %s.", error, strerror(error));
-
- EINA_LIST_FREE(priv->children_list, child)
- efl_unref(child);
- priv->children_list = NULL;
-
- EINA_LIST_FREE(priv->count_promises, promise)
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_UNKNOWN);
- priv->count_promises = NULL;
-
- EINA_LIST_FREE(priv->children_promises, p)
+ else
{
- efl_promise_failed_set(p->promise, EFL_MODEL_ERROR_UNKNOWN);
- free(p);
+ child_pd->request.del = eio_file_unlink(child_pd->path,
+ _eio_done_unlink_cb,
+ _eio_error_unlink_cb,
+ child);
}
- priv->children_promises = NULL;
-}
-static void
-_eio_model_children_filter_set(Eo *obj EINA_UNUSED, Eio_Model_Data *priv, Eio_Filter_Direct_Cb filter_cb, void *data)
-{
- eina_spinlock_take(&priv->filter_lock);
+ return ;
- priv->filter_cb = filter_cb;
- priv->filter_userdata = data;
-
- eina_spinlock_release(&priv->filter_lock);
+ on_error:
+ efl_del(child);
}
/**
- * Child Add
+ * Children Slice Get
*/
-static Eo *
-_eio_model_efl_model_child_add(Eo *obj EINA_UNUSED, Eio_Model_Data *priv EINA_UNUSED)
+static Eina_Future *
+_eio_model_efl_model_children_slice_get(Eo *obj, Eio_Model_Data *pd,
+ unsigned int start, unsigned int count)
{
- return efl_add(EIO_MODEL_CLASS, obj);
-}
+ Eina_Future_Scheduler *scheduler = NULL;
+ Eina_Value array = EINA_VALUE_EMPTY;
+ Eina_List *ls = NULL;
-static void
-_eio_model_efl_model_child_del_stat(void* data, Eio_File* handler EINA_UNUSED, const Eina_Stat* stat)
-{
- Eo* child = data;
- Eio_Model_Data *child_priv = efl_data_scope_get(child, MY_CLASS);
-
- if(eio_file_is_dir(stat))
- eio_dir_unlink(child_priv->path,
- _eio_filter_child_del_cb,
- _eio_progress_child_del_cb,
- _eio_done_unlink_cb,
- _eio_error_unlink_cb,
- child_priv);
- else
- eio_file_unlink(child_priv->path, _eio_done_unlink_cb, _eio_error_unlink_cb, child_priv);
-}
+ // If called on an invalidated model, we won't have a scheduler
+ scheduler = efl_loop_future_scheduler_get(obj);
+ if (!scheduler) return NULL;
-/**
- * Child Remove
- */
-static void
-_eio_model_efl_model_child_del(Eo *obj EINA_UNUSED, Eio_Model_Data *priv, Eo *child)
-{
- Eio_Model_Data *child_priv;
- EINA_SAFETY_ON_NULL_RETURN(child);
+ if (count == 0)
+ {
+ count = eina_list_count(pd->files);
+ start = 0;
+ }
- child_priv = efl_data_scope_get(child, MY_CLASS);
- EINA_SAFETY_ON_NULL_RETURN(child_priv);
+ // Children must have been listed first
+ if (count == 0 || (start + count > eina_list_count(pd->files)))
+ return eina_future_rejected(scheduler, EFL_MODEL_ERROR_INCORRECT_VALUE);
- priv->del_file = eio_file_direct_stat(child_priv->path,
- &_eio_model_efl_model_child_del_stat,
- &_eio_error_unlink_cb,
- child);
- efl_ref(child);
-}
+ eina_value_array_setup(&array, EINA_VALUE_TYPE_OBJECT, count % 8);
-/**
- * Children Slice Get
- */
-static Efl_Future*
-_eio_model_efl_model_children_slice_get(Eo *obj EINA_UNUSED, Eio_Model_Data *priv,
- unsigned int start, unsigned int count)
-{
- Eo *loop = efl_provider_find(obj, EFL_LOOP_CLASS);
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, loop);
- Efl_Future* future = efl_promise_future_get(promise);
- /**
- * children must be already loaded otherwise we do nothing
- * and parameter is set to NULL.
- */
- if (!priv->path)
- {
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_INIT_FAILED);
- return future;
- }
+ ls = eina_list_nth_list(pd->files, start);
- if (!(priv->is_listed))
+ while (count > 0)
{
- _Eio_Children_Slice_Promise* p = calloc(1, sizeof(struct _Eio_Children_Slice_Promise));
- p->promise = promise;
- p->start = start;
- p->count = count;
-
- priv->children_promises = eina_list_prepend(priv->children_promises, p);
-
-
- if (priv->is_listing == EINA_FALSE)
- {
- priv->is_listing = EINA_TRUE;
- eio_file_direct_ls(priv->path, _eio_filter_children_load_cb,
- _eio_main_children_load_cb, _eio_done_children_load_cb,
- _eio_error_children_load_cb, priv);
- }
- return future;
+ Eio_Model_Info *info = eina_list_data_get(ls);
+ Eio_Model_Data *child_data = NULL;
+
+ info->child_ref = EINA_TRUE;
+
+ if (info->object == NULL)
+ // Little trick here, setting internal data before finalize
+ info->object = efl_add(EIO_MODEL_CLASS, obj,
+ child_data = efl_data_scope_get(efl_added, EIO_MODEL_CLASS),
+ child_data->info = info,
+ child_data->path = eina_stringshare_ref(info->path),
+ child_data->parent = ls,
+ // NOTE: We are assuming here that the parent model will outlive all its children
+ child_data->filter.cb = pd->filter.cb,
+ child_data->filter.data = pd->filter.data);
+ eina_value_array_append(&array, info->object);
+
+ count--;
+ ls = eina_list_next(ls);
}
- Eina_Accessor* accessor = efl_model_list_slice(priv->children_list, start, count);
- efl_promise_value_set(promise, accessor, (Eina_Free_Cb)&eina_accessor_free);
- return future;
+ return eina_future_resolved(scheduler, array);
}
/**
* Class definitions
*/
-static Eo *
-_eio_model_efl_object_constructor(Eo *obj, Eio_Model_Data *priv)
+static Efl_Object *
+_eio_model_efl_object_finalize(Eo *obj, Eio_Model_Data *pd)
{
- obj = efl_constructor(efl_super(obj, MY_CLASS));
- unsigned int i;
- priv->obj = obj;
- priv->is_listed = priv->is_listing = EINA_FALSE;
+ if (!pd->path) return NULL;
+ if (!efl_provider_find(obj, EFL_LOOP_CLASS))
+ {
+ ERR("Eio.Model require a parent that provide access to the main loop.");
+ return NULL;
+ }
- priv->properties_name = eina_array_new(EIO_MODEL_PROP_LAST);
- EINA_SAFETY_ON_NULL_RETURN_VAL(priv->properties_name, NULL);
- for (i = 0; i < EIO_MODEL_PROP_LAST; ++i)
- eina_array_push(priv->properties_name, _eio_model_prop_names[i]);
+ // If we have no info at all, let's check this path first
+ if (!pd->info) _eio_build_st(obj, pd);
- priv->monitor = NULL;
- eina_spinlock_new(&priv->filter_lock);
+ // Setup monitor
+ pd->mon.mon_event_child_add[0] = EIO_MONITOR_DIRECTORY_CREATED;
+ pd->mon.mon_event_child_add[1] = EIO_MONITOR_FILE_CREATED;
+ pd->mon.mon_event_child_add[2] = EIO_MONITOR_ERROR;
+ pd->mon.mon_event_child_del[0] = EIO_MONITOR_DIRECTORY_DELETED;
+ pd->mon.mon_event_child_del[1] = EIO_MONITOR_FILE_DELETED;
+ pd->mon.mon_event_child_del[2] = EIO_MONITOR_ERROR;
+
+ pd->self = obj;
return obj;
}
@@ -763,70 +1008,66 @@ _eio_model_efl_object_constructor(Eo *obj, Eio_Model_Data *priv)
static void
_eio_model_path_set(Eo *obj EINA_UNUSED, Eio_Model_Data *priv, const char *path)
{
- priv->path = eina_stringshare_add(path);
- _eio_monitors_list_load(priv);
+ char *sanitized = eina_file_path_sanitize(path);
+ priv->path = eina_stringshare_add(sanitized);
+ free(sanitized);
+}
+
+static const char *
+_eio_model_path_get(const Eo *obj EINA_UNUSED, Eio_Model_Data *priv)
+{
+ return priv->path;
}
static void
_eio_model_efl_object_destructor(Eo *obj , Eio_Model_Data *priv)
{
- Efl_Promise *p;
- Eo *child;
-
- if (priv->fetching_mime)
- efl_event_callback_del(efl_provider_find(obj, EFL_LOOP_CLASS),
- EFL_LOOP_EVENT_IDLE_ENTER, _on_idle_mime, priv);
-
- EINA_LIST_FREE(priv->fetching_mime, p)
- {
- efl_promise_failed_set(p, EINA_ERROR_FUTURE_CANCEL);
- efl_del(p);
- }
-
- _eio_model_efl_model_monitor_del(priv);
+ Eio_Model_Info *info;
- eina_spinlock_free(&priv->filter_lock);
+ _eio_model_info_free(priv->info, EINA_TRUE);
+ priv->info = NULL;
- if (priv->properties_name)
- eina_array_free(priv->properties_name);
-
- EINA_LIST_FREE(priv->children_list, child)
- efl_unref(child);
+ EINA_LIST_FREE(priv->files, info)
+ _eio_model_info_free(info, EINA_FALSE);
eina_stringshare_del(priv->path);
+
efl_destructor(efl_super(obj, MY_CLASS));
}
-static Eo *
-_eio_model_efl_object_parent_get(Eo *obj , Eio_Model_Data *priv)
+static void
+_eio_model_efl_object_invalidate(Eo *obj , Eio_Model_Data *priv)
{
- Eo *model = efl_parent_get(efl_super(obj, MY_CLASS));
+ _eio_model_efl_model_monitor_del(priv);
- if (model == NULL || !efl_isa(model, EFL_MODEL_INTERFACE))
+ // Unlink the object from the parent
+ if (priv->info) priv->info->object = NULL;
+ if (priv->request.del)
{
- char *path = ecore_file_dir_get(priv->path);
- if (path != NULL && strcmp(priv->path, "/") != 0)
+ if (!ecore_thread_wait(priv->request.del->thread, 0.1))
{
- model = efl_add(MY_CLASS, NULL, eio_model_path_set(efl_added, path));
+ ecore_thread_cancel(priv->request.del->thread);
+ ecore_thread_wait(priv->request.del->thread, 0.1);
+ }
+ }
+ if (priv->request.move)
+ {
+ if (!ecore_thread_wait(priv->request.move->thread, 0.1))
+ {
+ ecore_thread_cancel(priv->request.move->thread);
+ ecore_thread_wait(priv->request.move->thread, 0.1);
+ }
+ }
+ if (priv->request.stat)
+ {
+ if (!ecore_thread_wait(priv->request.stat->thread, 0.1))
+ {
+ ecore_thread_cancel(priv->request.stat->thread);
+ ecore_thread_wait(priv->request.stat->thread, 0.1);
}
- else
- model = NULL;
-
- free(path);
}
- return model;
-}
-
-EOLIAN static Eo *
-_eio_model_efl_object_provider_find(const Eo *obj, Eio_Model_Data *priv EINA_UNUSED, const Efl_Class *klass)
-{
- Eo *provider = efl_provider_find(efl_super(obj, MY_CLASS), klass);
-
- // Provide main loop even if we don't have a loop user parent
- if (!provider && (klass == EFL_LOOP_CLASS) && eina_main_loop_is())
- return efl_main_loop_get();
- return provider;
+ efl_invalidate(efl_super(obj, EIO_MODEL_CLASS));
}
#include "eio_model.eo.c"
diff --git a/src/lib/eio/eio_model.eo b/src/lib/eio/eio_model.eo
index 89ec40c6b9..390c6212e9 100644
--- a/src/lib/eio/eio_model.eo
+++ b/src/lib/eio/eio_model.eo
@@ -1,4 +1,13 @@
-type @extern Eio_Filter_Direct_Cb: __undefined_type; [[Eio filter direct callback type]]
+import eina_types;
+
+function EflIoFilter {
+ [[EflIoFilter function]]
+ params {
+ @in model: Eio.Model;
+ @in entry: ptr(Eina.File.Direct.Info);
+ }
+ return: int;
+};
class Eio.Model (Efl.Object, Efl.Model)
{
@@ -19,31 +28,30 @@ class Eio.Model (Efl.Object, Efl.Model)
@since 1.11
]]
params {
- filter_cb: Eio_Filter_Direct_Cb; [[Filter callback]]
- userdata: void_ptr; [[User's private data]]
+ filter: EflIoFilter; [[Filter callback]]
}
}
- path_set {
- [[Custom Eio_Model constructor.
+ @property path {
+ [[ Define the root path of a model.
@since 1.11
]]
- params {
- @in path: string; [[Root path provided by caller]]
+ set { [[ Only possible during construction. ]] }
+ get { }
+ values {
+ path: string; [[ Root path of the model. ]]
}
}
}
implements {
- Efl.Object.constructor;
+ Efl.Object.finalize;
+ Efl.Object.invalidate;
Efl.Object.destructor;
- Efl.Object.parent { get; }
- Efl.Object.provider_find;
Efl.Model.properties { get; }
- Efl.Model.property_set;
- Efl.Model.property_get;
+ Efl.Model.property { set; get; }
Efl.Model.child_add;
Efl.Model.child_del;
Efl.Model.children_slice_get;
- Efl.Model.children_count_get;
+ Efl.Model.children_count { get; }
}
}
diff --git a/src/lib/eio/eio_model_private.h b/src/lib/eio/eio_model_private.h
index 762d3e6cf7..bf1344a4c6 100644
--- a/src/lib/eio/eio_model_private.h
+++ b/src/lib/eio/eio_model_private.h
@@ -4,8 +4,9 @@
#define PROP_LIST_SIZE 8
typedef struct _Eio_Model_Data Eio_Model_Data;
-typedef struct _Eio_Model_Monitor_Data Eio_Model_Monitor_Data;
+typedef struct _Eio_Model_Info Eio_Model_Info;
+typedef struct _Eio_Model_Monitor_Data Eio_Model_Monitor_Data;
struct _Eio_Model_Monitor_Data
{
Ecore_Event_Handler *ecore_child_add_handler[3];
@@ -14,70 +15,59 @@ struct _Eio_Model_Monitor_Data
int mon_event_child_del[3]; /**< plus EIO_MONITOR_ERROR */
};
-typedef enum _Eio_Property_Name {
- EIO_MODEL_PROP_FILENAME = 0,
- EIO_MODEL_PROP_PATH,
- EIO_MODEL_PROP_MTIME,
- EIO_MODEL_PROP_IS_DIR,
- EIO_MODEL_PROP_IS_LNK,
- EIO_MODEL_PROP_SIZE,
- EIO_MODEL_PROP_MIME_TYPE,
- EIO_MODEL_PROP_LAST
-} _Eio_Property_Name;
-
-static const char* _eio_model_prop_names[] =
-{
- [EIO_MODEL_PROP_FILENAME] = "filename",
- [EIO_MODEL_PROP_PATH] = "path",
- [EIO_MODEL_PROP_MTIME] = "mtime",
- [EIO_MODEL_PROP_IS_DIR] = "is_dir",
- [EIO_MODEL_PROP_IS_LNK] = "is_lnk",
- [EIO_MODEL_PROP_SIZE] = "size",
- [EIO_MODEL_PROP_MIME_TYPE] = "mime_type"
-};
+// FIXME: Would be more efficient to introduce an Eina_Path that assemble
+// an array of stringshare instead of using one mega stringshare directly.
-typedef struct _Eio_Property_Promise _Eio_Property_Promise;
-struct _Eio_Property_Promise
+struct _Eio_Model_Info
{
- _Eio_Property_Name property;
- Efl_Promise* promise;
-};
+ Eina_Stringshare *path;
+ Eo *object;
-typedef struct _Eio_Children_Slice_Promise _Eio_Children_Slice_Promise;
-struct _Eio_Children_Slice_Promise
-{
- unsigned start;
- unsigned count;
- Efl_Promise* promise;
+ size_t path_length;
+ size_t name_length;
+ size_t name_start;
+
+ Eina_File_Type type;
+
+ Eina_Bool parent_ref : 1;
+ Eina_Bool child_ref : 1;
};
-typedef struct _Eio_Model_Data _Eio_Model_Data;
struct _Eio_Model_Data
{
- Eo *obj;
+ Efl_Loop *loop;
+ Eio_Model *self;
+
Eina_Stringshare *path;
- Eina_Array *properties_name;
- Eina_Bool is_listed : 1;
- Eina_Bool is_listing : 1;
- Eina_List *children_list;
- Eina_List *property_promises;
- Eina_List *children_promises;
- Eina_List *count_promises;
- /**< EIO data */
- Eio_File *stat_file;
- Eio_File *listing_file;
- Eio_File *move_file;
- Eio_File *del_file;
- Eio_Monitor *monitor;
+
+ Eio_Model_Info *info;
+ Eina_Stat *st;
+ const char *mime_type;
+
+ struct {
+ Eio_File *stat; // Move to use efl.io.manager.stat
+ Eina_Future *listing; // Move to use efl.io.manager.direct_ls
+ Eio_File *move;
+ Eio_File *del;
+ Eina_Future *mime;
+ } request;
+
+ struct {
+ EflIoFilter cb;
+ Eina_Free_Cb free;
+ void *data;
+ } filter;
+
Eio_Model_Monitor_Data mon;
- int cb_count_child_add; /**< monitor reference counter for child add event */
- int cb_count_child_del; /**< monitor reference counter for child del event*/
- unsigned int count;
- Eio_Filter_Direct_Cb filter_cb;
- void *filter_userdata;
- Eina_Spinlock filter_lock; /**< filter callback is called from another thread */
-
- Eina_List *fetching_mime;
+
+ Eio_Monitor *monitor; // Notification stuff
+ // FIXME: would be interesting to figure a more efficient structure for holding files
+ Eina_List *parent;
+ Eina_List *files; // Eio_Model_Info
+
+ Eina_Error error;
+
+ Eina_Bool listed : 1;
};
#endif
diff --git a/src/lib/eio/eio_monitor.c b/src/lib/eio/eio_monitor.c
index 66519ff2ce..84262bb329 100644
--- a/src/lib/eio/eio_monitor.c
+++ b/src/lib/eio/eio_monitor.c
@@ -29,7 +29,6 @@
*/
static Eina_Hash *_eio_monitors = NULL;
-static pid_t _monitor_pid = -1;
static void
_eio_monitor_free(Eio_Monitor *monitor)
@@ -158,8 +157,6 @@ eio_monitor_init(void)
_eio_monitors = eina_hash_stringshared_new(NULL);
/* FIXME: this check is optional, but if it is kept then failure should be handled more gracefully */
if (!_eio_monitors) abort();
-
- _monitor_pid = getpid();
}
void
@@ -192,11 +189,10 @@ eio_monitor_shutdown(void)
}
eina_iterator_free(it);
eina_hash_free(_eio_monitors);
+ _eio_monitors = NULL;
eio_monitor_backend_shutdown();
eio_monitor_fallback_shutdown();
-
- _monitor_pid = -1;
}
static const char *
@@ -338,13 +334,7 @@ eio_monitor_stringshared_add(const char *path)
struct stat st;
EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
- if (_monitor_pid == -1) return NULL;
-
- if (_monitor_pid != getpid())
- {
- eio_monitor_shutdown();
- eio_monitor_init();
- }
+ EINA_SAFETY_ON_NULL_RETURN_VAL(_eio_monitors, NULL);
if (stat(path, &st) != 0)
{
diff --git a/src/lib/eio/eio_monitor_inotify.c b/src/lib/eio/eio_monitor_inotify.c
index 5ff54d5066..f3a83be5b7 100644
--- a/src/lib/eio/eio_monitor_inotify.c
+++ b/src/lib/eio/eio_monitor_inotify.c
@@ -157,8 +157,25 @@ _eio_inotify_handler(void *data EINA_UNUSED, Ecore_Fd_Handler *fdh)
/**
* @endcond
*/
+static Eina_Bool reseting;
+static void
+_eio_monitor_reset()
+{
+ Eina_Hash *h = _inotify_monitors;
+ Eina_Iterator *it;
+ Eio_Monitor_Backend *backend;
-
+ _inotify_monitors = NULL;
+ reseting = 1;
+ eio_monitor_backend_shutdown();
+ eio_monitor_backend_init();
+ it = eina_hash_iterator_data_new(h);
+ EINA_ITERATOR_FOREACH(it, backend)
+ eio_monitor_backend_add(backend->parent);
+ reseting = 0;
+ eina_iterator_free(it);
+ eina_hash_free(h);
+}
/*============================================================================*
* Global *
*============================================================================*/
@@ -189,6 +206,8 @@ void eio_monitor_backend_init(void)
}
_inotify_monitors = eina_hash_int32_new(_eio_inotify_del);
+ if (!reseting)
+ ecore_fork_reset_callback_add(_eio_monitor_reset, NULL);
}
void eio_monitor_backend_shutdown(void)
@@ -207,6 +226,8 @@ void eio_monitor_backend_shutdown(void)
return;
close(fd);
+ if (!reseting)
+ ecore_fork_reset_callback_del(_eio_monitor_reset, NULL);
}
void eio_monitor_backend_add(Eio_Monitor *monitor)
diff --git a/src/lib/eio/eio_monitor_poll.c b/src/lib/eio/eio_monitor_poll.c
index fc4b70e8c5..c7f208092c 100644
--- a/src/lib/eio/eio_monitor_poll.c
+++ b/src/lib/eio/eio_monitor_poll.c
@@ -44,7 +44,6 @@ struct _Eio_Monitor_Backend
Eina_Hash *children;
Ecore_Timer *timer;
- Ecore_Idler *idler;
Ecore_Thread *work;
int version;
@@ -54,6 +53,9 @@ struct _Eio_Monitor_Backend
Eina_Bool destroyed : 1;
};
+static double fallback_interval = 60.0;
+static Eina_Hash *timer_hash;
+
static Eina_Bool _eio_monitor_fallback_timer_cb(void *data);
static void
@@ -64,6 +66,7 @@ _eio_monitor_fallback_heavy_cb(void *data, Ecore_Thread *thread)
Eina_Stat *est;
Eina_File_Direct_Info *info;
_eio_stat_t st;
+ Eina_Bool deleted = EINA_FALSE;
/* FIXME : copy ecore_file_monitor_poll here */
if (!backend->initialised)
@@ -79,7 +82,9 @@ _eio_monitor_fallback_heavy_cb(void *data, Ecore_Thread *thread)
if (backend->initialised && !backend->destroyed)
{
ecore_thread_main_loop_begin();
- _eio_monitor_send(backend->parent, backend->parent->path, EIO_MONITOR_SELF_DELETED);
+ deleted = backend->delete_me;
+ if (!deleted)
+ _eio_monitor_send(backend->parent, backend->parent->path, EIO_MONITOR_SELF_DELETED);
ecore_thread_main_loop_end();
backend->destroyed = EINA_TRUE;
}
@@ -124,9 +129,17 @@ _eio_monitor_fallback_heavy_cb(void *data, Ecore_Thread *thread)
if (memcmp(est, &backend->self, sizeof (Eina_Stat)) != 0)
{
+ int event = EIO_MONITOR_DIRECTORY_MODIFIED;
+
+ if (!S_ISDIR(est->mode))
+ /* regular file: eina_file_direct_ls will return NULL */
+ event = EIO_MONITOR_FILE_MODIFIED;
ecore_thread_main_loop_begin();
- _eio_monitor_send(backend->parent, backend->parent->path, EIO_MONITOR_SELF_DELETED);
+ deleted = backend->delete_me;
+ if (!deleted)
+ _eio_monitor_send(backend->parent, backend->parent->path, event);
ecore_thread_main_loop_end();
+ if (deleted) return;
}
it = eina_file_direct_ls(backend->parent->path);
@@ -157,10 +170,12 @@ _eio_monitor_fallback_heavy_cb(void *data, Ecore_Thread *thread)
{
/* New file or new directory added */
ecore_thread_main_loop_begin();
- _eio_monitor_send(backend->parent, info->path,
- info->type != EINA_FILE_DIR ? EIO_MONITOR_FILE_CREATED : EIO_MONITOR_DIRECTORY_CREATED);
+ deleted = backend->delete_me;
+ if (!deleted)
+ _eio_monitor_send(backend->parent, info->path,
+ info->type != EINA_FILE_DIR ? EIO_MONITOR_FILE_CREATED : EIO_MONITOR_DIRECTORY_CREATED);
ecore_thread_main_loop_end();
-
+ if (deleted) break;
cmp = malloc(sizeof (Eio_Monitor_Stat));
memcpy(cmp, &buffer, sizeof (Eina_Stat));
@@ -170,25 +185,29 @@ _eio_monitor_fallback_heavy_cb(void *data, Ecore_Thread *thread)
{
/* file has been modified */
ecore_thread_main_loop_begin();
- _eio_monitor_send(backend->parent, info->path,
- info->type != EINA_FILE_DIR ? EIO_MONITOR_FILE_MODIFIED : EIO_MONITOR_DIRECTORY_MODIFIED);
+ deleted = backend->delete_me;
+ if (!deleted)
+ _eio_monitor_send(backend->parent, info->path,
+ info->type != EINA_FILE_DIR ? EIO_MONITOR_FILE_MODIFIED : EIO_MONITOR_DIRECTORY_MODIFIED);
ecore_thread_main_loop_end();
-
+ if (deleted) break;
memcpy(cmp, &buffer, sizeof (Eina_Stat));
}
}
cmp->version = backend->version;
- if (ecore_thread_check(thread)) goto out;
+ if (ecore_thread_check(thread)) break;
}
- out:
+
if (it) eina_iterator_free(it);
if (backend->initialised && !ecore_thread_check(thread))
{
Eina_Hash_Tuple *tuple;
+ Eina_Array *arr;
it = eina_hash_iterator_tuple_new(backend->children);
+ arr = eina_array_new(1);
ecore_thread_main_loop_begin();
EINA_ITERATOR_FOREACH(it, tuple)
@@ -197,13 +216,18 @@ _eio_monitor_fallback_heavy_cb(void *data, Ecore_Thread *thread)
if (cmp->version != backend->version)
{
+ deleted = backend->delete_me;
+ if (deleted) break;
_eio_monitor_send(backend->parent, tuple->key,
eio_file_is_dir(&cmp->buffer) ? EIO_MONITOR_DIRECTORY_DELETED : EIO_MONITOR_FILE_DELETED);
- eina_hash_del(backend->children, tuple->key, tuple->data);
+ eina_array_push(arr, tuple->key);
}
}
ecore_thread_main_loop_end();
+ while (eina_array_count(arr))
+ eina_hash_del_by_key(backend->children, eina_array_pop);
+ eina_array_free(arr);
eina_iterator_free(it);
}
@@ -217,7 +241,16 @@ _eio_monitor_fallback_end_cb(void *data, Ecore_Thread *thread EINA_UNUSED)
Eio_Monitor_Backend *backend = data;
backend->work = NULL;
- backend->timer = ecore_timer_add(60.0, _eio_monitor_fallback_timer_cb, backend);
+ if (backend->delete_me)
+ {
+ eina_hash_free(backend->children);
+ free(backend);
+ return;
+ }
+ /* indicates eio shutdown is in progress */
+ if (!timer_hash) return;
+ backend->timer = ecore_timer_add(fallback_interval, _eio_monitor_fallback_timer_cb, backend);
+ eina_hash_set(timer_hash, &backend, backend->timer);
}
static void
@@ -228,32 +261,27 @@ _eio_monitor_fallback_cancel_cb(void *data, Ecore_Thread *thread EINA_UNUSED)
backend->work = NULL;
if (backend->delete_me)
{
+ eina_hash_free(backend->children);
free(backend);
return;
}
- backend->timer = ecore_timer_add(60.0, _eio_monitor_fallback_timer_cb, backend);
+ /* indicates eio shutdown is in progress */
+ if (!timer_hash) return;
+ backend->timer = ecore_timer_add(fallback_interval, _eio_monitor_fallback_timer_cb, backend);
+ eina_hash_set(timer_hash, &backend, backend->timer);
}
static Eina_Bool
-_eio_monitor_fallback_idler_cb(void *data)
+_eio_monitor_fallback_timer_cb(void *data)
{
Eio_Monitor_Backend *backend = data;
- backend->idler = NULL;
+ backend->timer = NULL;
+ eina_hash_set(timer_hash, &backend, NULL);
backend->work = ecore_thread_run(_eio_monitor_fallback_heavy_cb,
_eio_monitor_fallback_end_cb,
_eio_monitor_fallback_cancel_cb,
backend);
- return EINA_FALSE;
-}
-
-static Eina_Bool
-_eio_monitor_fallback_timer_cb(void *data)
-{
- Eio_Monitor_Backend *backend = data;
-
- backend->timer = NULL;
- backend->idler = ecore_idler_add(_eio_monitor_fallback_idler_cb, backend);
return EINA_FALSE;
}
@@ -294,11 +322,14 @@ void eio_monitor_backend_del(Eio_Monitor *monitor)
void
eio_monitor_fallback_init(void)
{
+ timer_hash = eina_hash_pointer_new(NULL);
}
void
eio_monitor_fallback_shutdown(void)
{
+ eina_hash_free(timer_hash);
+ timer_hash = NULL;
}
void
@@ -314,6 +345,7 @@ eio_monitor_fallback_add(Eio_Monitor *monitor)
backend->children = eina_hash_string_superfast_new(free);
backend->parent = monitor;
monitor->backend = backend;
+ monitor->fallback = EINA_TRUE;
backend->work = ecore_thread_run(_eio_monitor_fallback_heavy_cb,
_eio_monitor_fallback_end_cb,
_eio_monitor_fallback_cancel_cb,
@@ -329,17 +361,16 @@ eio_monitor_fallback_del(Eio_Monitor *monitor)
monitor->backend = NULL;
if (!backend) return;
+ backend->delete_me = EINA_TRUE;
- if (backend->work) ecore_thread_cancel(backend->work);
if (backend->timer) ecore_timer_del(backend->timer);
+ eina_hash_set(timer_hash, &backend, NULL);
backend->timer = NULL;
- if (backend->idler) ecore_idler_del(backend->idler);
- backend->idler = NULL;
- if (backend->work && !ecore_thread_wait(backend->work, 0.3))
+ if (backend->work)
{
- backend->delete_me = EINA_TRUE;
+ ecore_thread_cancel(backend->work);
return;
}
@@ -356,3 +387,26 @@ eio_monitor_fallback_del(Eio_Monitor *monitor)
/*============================================================================*
* API *
*============================================================================*/
+
+
+EAPI void
+eio_monitoring_interval_set(double interval)
+{
+ Eina_Iterator *it;
+ Ecore_Timer *timer;
+
+ EINA_SAFETY_ON_TRUE_RETURN(interval < 0.0);
+ fallback_interval = interval;
+ if (!timer_hash) return;
+ it = eina_hash_iterator_data_new(timer_hash);
+ EINA_ITERATOR_FOREACH(it, timer)
+ ecore_timer_interval_set(timer, fallback_interval);
+ eina_iterator_free(it);
+}
+
+EAPI Eina_Bool
+eio_monitor_fallback_check(const Eio_Monitor *monitor)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(monitor, EINA_FALSE);
+ return monitor->fallback;
+}
diff --git a/src/lib/eio/eio_monitor_win32.c b/src/lib/eio/eio_monitor_win32.c
index bfbb0ec546..6755e9f531 100644
--- a/src/lib/eio/eio_monitor_win32.c
+++ b/src/lib/eio/eio_monitor_win32.c
@@ -403,7 +403,6 @@ void eio_monitor_backend_add(Eio_Monitor *monitor)
free(backend);
fallback:
INF("falling back to poll monitoring");
- monitor->fallback = EINA_TRUE;
eio_monitor_fallback_add(monitor);
}
diff --git a/src/lib/eio/eio_private.h b/src/lib/eio/eio_private.h
index 62c3fc8550..7e8656609a 100644
--- a/src/lib/eio/eio_private.h
+++ b/src/lib/eio/eio_private.h
@@ -15,22 +15,6 @@
#endif
#include <sys/types.h>
-#ifdef HAVE_DIRENT_H
-# include <dirent.h>
-# define NAMLEN(dirent) strlen ((dirent)->d_name)
-#else
-# define dirent direct
-# define NAMLEN(dirent) ((dirent)->d_namlen)
-# ifdef HAVE_SYS_NDIR_H
-# include <sys/ndir.h>
-# endif
-# ifdef HAVE_SYS_DIR_H
-# include <sys/dir.h>
-# endif
-# ifdef HAVE_NDIR_H
-# include <ndir.h>
-# endif
-#endif
#include <libgen.h>
#include <stdio.h>
@@ -561,5 +545,30 @@ Eio_File * _eio_file_xattr(const char *path,
void _eio_string_notify(void *data, Ecore_Thread *thread EINA_UNUSED, void *msg_data);
void _eio_direct_notify(void *data, Ecore_Thread *thread EINA_UNUSED, void *msg_data);
+static inline void
+_efl_io_manager_future_cancel(void *data, const Eina_Promise *dead_ptr EINA_UNUSED)
+{
+ eio_file_cancel(data);
+}
+
+EINA_VALUE_STRUCT_DESC_DEFINE(_eina_stat_desc,
+ NULL,
+ sizeof (Eina_Stat),
+ EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_ULONG, Eina_Stat, dev),
+ EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_ULONG, Eina_Stat, ino),
+ EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_UINT, Eina_Stat, mode),
+ EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_UINT, Eina_Stat, nlink),
+ EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_UINT, Eina_Stat, uid),
+ EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_UINT, Eina_Stat, gid),
+ EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_ULONG, Eina_Stat, rdev),
+ EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_ULONG, Eina_Stat, size),
+ EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_ULONG, Eina_Stat, blksize),
+ EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_ULONG, Eina_Stat, blocks),
+ EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_TIMESTAMP, Eina_Stat, atime),
+ EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_ULONG, Eina_Stat, atimensec),
+ EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_TIMESTAMP, Eina_Stat, mtime),
+ EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_ULONG, Eina_Stat, mtimensec),
+ EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_TIMESTAMP, Eina_Stat, ctime),
+ EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_ULONG, Eina_Stat, ctimensec));
#endif
diff --git a/src/lib/eio/eio_sentry.c b/src/lib/eio/eio_sentry.c
index c21b0c2052..cf2b166d4b 100644
--- a/src/lib/eio/eio_sentry.c
+++ b/src/lib/eio/eio_sentry.c
@@ -21,6 +21,7 @@
# include <config.h>
#endif
+#define EIO_SENTRY_BETA 1
#include <Eo.h>
#include "Ecore.h"
@@ -137,7 +138,7 @@ _eio_sentry_add(Eo *obj EINA_UNUSED, Eio_Sentry_Data *pd, const char *path)
}
void
-_eio_sentry_del(Eo *obj EINA_UNUSED, Eio_Sentry_Data *pd, const char *path)
+_eio_sentry_remove(Eo *obj EINA_UNUSED, Eio_Sentry_Data *pd, const char *path)
{
EINA_SAFETY_ON_NULL_RETURN(path);
EINA_SAFETY_ON_NULL_RETURN(pd);
@@ -145,6 +146,19 @@ _eio_sentry_del(Eo *obj EINA_UNUSED, Eio_Sentry_Data *pd, const char *path)
eina_hash_del(pd->targets, path, NULL);
}
+Eina_Bool
+_eio_sentry_fallback_check(const Eo *obj EINA_UNUSED, Eio_Sentry_Data *pd, const char *path)
+{
+ Eio_Monitor *monitor;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(path, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(pd, EINA_FALSE);
+
+ monitor = eina_hash_find(pd->targets, path);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(monitor, EINA_FALSE);
+ return eio_monitor_fallback_check(monitor);
+}
+
Efl_Object * _eio_sentry_efl_object_constructor(Eo *obj, Eio_Sentry_Data *pd)
{
obj = efl_constructor(efl_super(obj, EIO_SENTRY_CLASS));
diff --git a/src/lib/eio/eio_sentry.eo b/src/lib/eio/eio_sentry.eo
index 9f2add7dec..7dbebbc76b 100644
--- a/src/lib/eio/eio_sentry.eo
+++ b/src/lib/eio/eio_sentry.eo
@@ -1,5 +1,3 @@
-import eina_types;
-
struct Eio.Sentry.Event
{
[[Wraps the data about a monitor event on a file.]]
@@ -19,23 +17,33 @@ class Eio.Sentry (Efl.Object)
}
return : bool; [[$true on success, $false otherwise]]
}
- del {
+ remove {
[[Removes the given path from the monitored list.]]
params {
@in path: string; [[Path to remove from monitoring]]
}
}
+ fallback_check @const @beta {
+ [[Return if the sentry is using the fallback monitoring method
+
+ The fallback method of monitoring cannot provide certain events.
+ ]]
+ params {
+ @in path: string; [[Path to check for fallback monitoring]]
+ }
+ return : bool; [[$true only if the sentry is using the fallback mechanism]]
+ }
}
events {
file,created: Eio.Sentry.Event; [[Called when a file was created]]
file,deleted: Eio.Sentry.Event; [[Called when a file was deleted]]
file,modified: Eio.Sentry.Event; [[Called when a file was modified]]
- file,closed: Eio.Sentry.Event; [[Called when a file was closed]]
+ file,closed: Eio.Sentry.Event; [[Called for non-fallback sentries when a file was closed]]
directory,created: Eio.Sentry.Event; [[Called when a directory was created]]
directory,deleted: Eio.Sentry.Event; [[Called when a directory was deleted]]
directory,modified: Eio.Sentry.Event; [[called when a directory was modified]]
- directory,closed: Eio.Sentry.Event; [[Called when a directory was closed]]
- self,rename: Eio.Sentry.Event; [[Called when the object was renamed]]
+ directory,closed: Eio.Sentry.Event; [[Called for non-fallback sentries when a directory was closed]]
+ self,rename: Eio.Sentry.Event; [[Called for non-fallback sentries when the object was renamed]]
self,deleted: Eio.Sentry.Event; [[Called when the object was deleted]]
error: Eio.Sentry.Event; [[Called in case of an error]]
}
diff --git a/src/lib/eldbus/Eldbus.h b/src/lib/eldbus/Eldbus.h
index db61f21ac2..ac88fd51cf 100644
--- a/src/lib/eldbus/Eldbus.h
+++ b/src/lib/eldbus/Eldbus.h
@@ -87,15 +87,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ELDBUS_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ELDBUS_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -225,6 +225,7 @@ typedef void (*Eldbus_Signal_Cb)(void *data, const Eldbus_Message *msg);
#ifdef EFL_BETA_API_SUPPORT
+#include "eldbus_model.eo.h"
#include "eldbus_model_arguments.eo.h"
#include "eldbus_model_connection.eo.h"
#include "eldbus_model_method.eo.h"
diff --git a/src/lib/eldbus/eldbus_core.c b/src/lib/eldbus/eldbus_core.c
index 91a4021010..7e79be5ddf 100644
--- a/src/lib/eldbus/eldbus_core.c
+++ b/src/lib/eldbus/eldbus_core.c
@@ -85,6 +85,45 @@ static void _eldbus_connection_context_event_cb_del(Eldbus_Connection_Context_Ev
static void eldbus_dispatch_name_owner_change(Eldbus_Connection_Name *cn, const char *old_id);
static void _eldbus_connection_free(Eldbus_Connection *conn);
+static void
+eldbus_fd_handler_del(Eldbus_Handler_Data *hd)
+{
+ if (!hd->fd_handler) return;
+
+ DBG("free Eldbus_Handler_Data %d", hd->fd);
+ hd->conn->fd_handlers = eina_inlist_remove(hd->conn->fd_handlers,
+ EINA_INLIST_GET(hd));
+ if (hd->fd_handler)
+ {
+ ecore_main_fd_handler_del(hd->fd_handler);
+ hd->fd_handler = NULL;
+ }
+
+ free(hd);
+}
+
+static void
+_eldbus_fork_reset()
+{
+ int i;
+
+ for (i =0; i < ELDBUS_CONNECTION_TYPE_LAST - 1; i++)
+ {
+ Eldbus_Connection *conn = shared_connections[i];
+ if (conn)
+ {
+ Eina_Inlist *list;
+ Eldbus_Handler_Data *fd_handler;
+
+ EINA_INLIST_FOREACH_SAFE(conn->fd_handlers, list, fd_handler)
+ dbus_watch_set_data(fd_handler->watch, NULL, NULL);
+ }
+ shared_connections[i] = NULL;
+ }
+ if (address_connections) eina_hash_free(address_connections);
+ address_connections = NULL;
+}
+
EAPI int
eldbus_init(void)
{
@@ -97,10 +136,18 @@ eldbus_init(void)
return 0;
}
+ if (!ecore_init())
+ {
+ fputs("Eldbus: Unable to initialize ecore\n", stderr);
+ eina_shutdown();
+ return 0;
+ }
+
_eldbus_log_dom = eina_log_domain_register("eldbus", EINA_COLOR_BLUE);
if (_eldbus_log_dom < 0)
{
EINA_LOG_ERR("Unable to create an 'eldbus' log domain");
+ ecore_shutdown();
eina_shutdown();
return 0;
}
@@ -111,6 +158,7 @@ eldbus_init(void)
EINA_LOG_ERR("Unable to create an 'eldbus_model' log domain");
eina_log_domain_unregister(_eldbus_log_dom);
_eldbus_log_dom = -1;
+ ecore_shutdown();
eina_shutdown();
return 0;
}
@@ -131,7 +179,7 @@ eldbus_init(void)
if (!eldbus_object_init()) goto object_failed;
if (!eldbus_proxy_init()) goto proxy_failed;
if (!eldbus_service_init()) goto service_failed;
-
+ ecore_fork_reset_callback_add(_eldbus_fork_reset, NULL);
return _eldbus_init_count;
service_failed:
@@ -149,6 +197,7 @@ message_failed:
eldbus_model_log_dom = -1;
eina_log_domain_unregister(_eldbus_log_dom);
_eldbus_log_dom = -1;
+ ecore_shutdown();
eina_shutdown();
return 0;
@@ -205,6 +254,7 @@ eldbus_shutdown(void)
if (--_eldbus_init_count)
return _eldbus_init_count;
+ ecore_fork_reset_callback_del(_eldbus_fork_reset, NULL);
if (shared_connections[ELDBUS_CONNECTION_TYPE_SESSION - 1])
{
CRI("Alive TYPE_SESSION connection");
@@ -247,10 +297,13 @@ eldbus_shutdown(void)
eldbus_signal_handler_shutdown();
eldbus_message_shutdown();
+ ecore_shutdown();
+
eina_log_domain_unregister(eldbus_model_log_dom);
eldbus_model_log_dom = -1;
eina_log_domain_unregister(_eldbus_log_dom);
_eldbus_log_dom = -1;
+
eina_shutdown();
return 0;
@@ -548,24 +601,6 @@ eldbus_connection_name_object_get(Eldbus_Connection *conn, const char *name, con
return eina_hash_find(cn->objects, path);
}
-
-static void
-eldbus_fd_handler_del(Eldbus_Handler_Data *hd)
-{
- if (!hd->fd_handler) return;
-
- DBG("free Eldbus_Handler_Data %d", hd->fd);
- hd->conn->fd_handlers = eina_inlist_remove(hd->conn->fd_handlers,
- EINA_INLIST_GET(hd));
- if (hd->fd_handler)
- {
- ecore_main_fd_handler_del(hd->fd_handler);
- hd->fd_handler = NULL;
- }
-
- free(hd);
-}
-
static Eina_Bool
eldbus_fd_handler(void *data, Ecore_Fd_Handler *fd_handler)
{
@@ -1256,7 +1291,10 @@ _eldbus_connection_free(Eldbus_Connection *conn)
if (conn->type && conn->shared)
{
if (conn->type == ELDBUS_CONNECTION_TYPE_ADDRESS)
- eina_hash_del_by_data(address_connections, conn);
+ {
+ if (address_connections)
+ eina_hash_del_by_data(address_connections, conn);
+ }
else if (shared_connections[conn->type - 1] == (void *) conn)
shared_connections[conn->type - 1] = NULL;
}
diff --git a/src/lib/eldbus/eldbus_model.c b/src/lib/eldbus/eldbus_model.c
new file mode 100644
index 0000000000..28faa0fb24
--- /dev/null
+++ b/src/lib/eldbus/eldbus_model.c
@@ -0,0 +1,198 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "eldbus_model_private.h"
+
+#include <Ecore.h>
+#include <Eina.h>
+#include <Eldbus.h>
+
+#define MY_CLASS ELDBUS_MODEL_CLASS
+#define MY_CLASS_NAME "Eldbus_Model"
+
+static void
+eldbus_model_connect_do(Eldbus_Model_Data *pd)
+{
+ if (pd->type == ELDBUS_CONNECTION_TYPE_ADDRESS)
+ {
+ if (pd->private)
+ pd->connection = eldbus_address_connection_get(pd->address);
+ else
+ pd->connection = eldbus_private_address_connection_get(pd->address);
+ }
+ else
+ {
+ if (pd->private)
+ pd->connection = eldbus_private_connection_get(pd->type);
+ else
+ pd->connection = eldbus_connection_get(pd->type);
+ }
+
+ // TODO: Register for disconnection event
+ if (!pd->connection)
+ {
+ DBG("Unable to setup a connection [%i - %s] %i",
+ pd->type, pd->address, pd->private);
+ }
+}
+
+static void
+_eldbus_model_connect(Eo *obj EINA_UNUSED,
+ Eldbus_Model_Data *pd,
+ Eldbus_Connection_Type type,
+ const char *address,
+ Eina_Bool priv)
+{
+ pd->type = type;
+ pd->address = eina_stringshare_add(address);
+ pd->private = priv;
+}
+
+static void
+_eldbus_model_connection_set(Eo *obj EINA_UNUSED,
+ Eldbus_Model_Data *pd,
+ Eldbus_Connection *dbus)
+{
+ eldbus_connection_ref(dbus);
+ if (pd->connection) eldbus_connection_unref(pd->connection);
+ pd->connection = dbus;
+}
+
+static Eldbus_Connection *
+_eldbus_model_connection_get(const Eo *obj EINA_UNUSED, Eldbus_Model_Data *pd)
+{
+ return pd->connection;
+}
+
+static Efl_Object *
+_eldbus_model_efl_object_finalize(Eo *obj, Eldbus_Model_Data *pd)
+{
+ if (!pd->connection) eldbus_model_connect_do(pd);
+ if (!pd->connection) return NULL;
+
+ return efl_finalize(efl_super(obj, ELDBUS_MODEL_CLASS));
+}
+
+static void
+_eldbus_model_efl_object_invalidate(Eo *obj, Eldbus_Model_Data *pd)
+{
+ if (pd->connection) eldbus_connection_unref(pd->connection);
+ pd->connection = NULL;
+
+ efl_invalidate(efl_super(obj, MY_CLASS));
+}
+
+static void
+_eldbus_model_efl_object_destructor(Eo *obj, Eldbus_Model_Data *pd)
+{
+ eina_stringshare_del(pd->unique_name);
+ pd->unique_name = NULL;
+
+ eina_stringshare_del(pd->address);
+ pd->address = NULL;
+
+ efl_destructor(efl_super(obj, MY_CLASS));
+}
+
+static const char *
+_eldbus_model_address_get(const Eo *obj EINA_UNUSED, Eldbus_Model_Data *pd)
+{
+ return pd->address;
+}
+
+static Eina_Bool
+_eldbus_model_private_get(const Eo *obj EINA_UNUSED, Eldbus_Model_Data *pd)
+{
+ return pd->private;
+}
+
+static Eldbus_Connection_Type
+_eldbus_model_type_get(const Eo *obj EINA_UNUSED, Eldbus_Model_Data *pd)
+{
+ return pd->type;
+}
+
+static Eina_Future *
+_eldbus_model_efl_model_property_set(Eo *obj,
+ Eldbus_Model_Data *pd EINA_UNUSED,
+ const char *property,
+ Eina_Value *value EINA_UNUSED)
+{
+ Eina_Error err = EFL_MODEL_ERROR_READ_ONLY;
+
+ if (strcmp(property, UNIQUE_NAME_PROPERTY))
+ err = EFL_MODEL_ERROR_NOT_FOUND;
+ return eina_future_rejected(efl_loop_future_scheduler_get(obj), err);
+}
+
+static Eina_Value *
+_eldbus_model_efl_model_property_get(const Eo *obj,
+ Eldbus_Model_Data *pd,
+ const char *property)
+{
+ DBG("(%p): property=%s", obj, property);
+
+ if (strcmp(property, UNIQUE_NAME_PROPERTY) != 0) goto on_error;
+
+ if (!pd->connection) eldbus_model_connect_do(pd);
+
+ if (pd->unique_name == NULL)
+ {
+ const char *unique_name;
+
+ unique_name = eldbus_connection_unique_name_get(pd->connection);
+ if (!unique_name) goto on_error;
+ pd->unique_name = eina_stringshare_add(unique_name);
+ }
+
+ return eina_value_string_new(pd->unique_name);
+
+ on_error:
+ return eina_value_error_new(EFL_MODEL_ERROR_NOT_FOUND);
+}
+
+static Eina_Array *
+_eldbus_model_efl_model_properties_get(const Eo *obj EINA_UNUSED,
+ Eldbus_Model_Data *pd EINA_UNUSED)
+{
+ Eina_Array *r;
+
+ r = eina_array_new(1);
+ eina_array_push(r, eina_stringshare_add(UNIQUE_NAME_PROPERTY));
+
+ return r;
+}
+
+static Efl_Object *
+_eldbus_model_efl_model_child_add(Eo *obj EINA_UNUSED,
+ Eldbus_Model_Data *pd EINA_UNUSED)
+{
+ return NULL;
+}
+
+static void
+_eldbus_model_efl_model_child_del(Eo *obj EINA_UNUSED,
+ Eldbus_Model_Data *pd EINA_UNUSED,
+ Efl_Object *child EINA_UNUSED)
+{
+}
+
+static Eina_Future *
+_eldbus_model_efl_model_children_slice_get(Eo *obj EINA_UNUSED,
+ Eldbus_Model_Data *pd EINA_UNUSED,
+ unsigned int start EINA_UNUSED,
+ unsigned int count EINA_UNUSED)
+{
+ return eina_future_rejected(efl_loop_future_scheduler_get(obj),
+ EFL_MODEL_ERROR_NOT_SUPPORTED);
+}
+
+static unsigned int
+_eldbus_model_efl_model_children_count_get(const Eo *obj EINA_UNUSED,
+ Eldbus_Model_Data *pd EINA_UNUSED)
+{
+ return 0;
+}
+
+#include "eldbus_model.eo.c"
diff --git a/src/lib/eldbus/eldbus_model.eo b/src/lib/eldbus/eldbus_model.eo
new file mode 100644
index 0000000000..e470144622
--- /dev/null
+++ b/src/lib/eldbus/eldbus_model.eo
@@ -0,0 +1,62 @@
+import eldbus_types;
+
+class Eldbus.Model (Efl.Object, Efl.Model) {
+ methods {
+ connect {
+ [[Define connection parameters.
+
+ @since 1.21]]
+ params {
+ @in type: Eldbus.Connection.Type; [[The connection type]]
+ @in address: string; [[Remote address of DBus]]
+ @in priv: bool; [[Non shared dbus connection]]
+ }
+ }
+ @property connection {
+ [[Define the connection.
+
+ @since 1.21]]
+ get { }
+ set { }
+ values {
+ dbus: ptr(Eldbus.Connection); [[The connection]]
+ }
+ }
+ @property type {
+ [[Connection type]]
+ get { }
+ values {
+ type: Eldbus.Connection.Type; [[Connection type]]
+ }
+ }
+ @property address {
+ [[Remote DBus address]]
+ get { }
+ values {
+ address: string; [[Address]]
+ }
+ }
+ @property private {
+ [[Indicate if the DBus connection is shared or private]]
+ get { }
+ values {
+ private_: bool; [[Private DBus connection]]
+ }
+ }
+ }
+ implements {
+ Efl.Object.finalize;
+ Efl.Object.invalidate;
+ Efl.Object.destructor;
+ Efl.Model.property { get; set; }
+ Efl.Model.properties { get; }
+ Efl.Model.child_add;
+ Efl.Model.child_del;
+ Efl.Model.children_slice_get;
+ Efl.Model.children_count { get; }
+ }
+ constructors {
+ .connect;
+ .connection;
+ }
+} \ No newline at end of file
diff --git a/src/lib/eldbus/eldbus_model_arguments.c b/src/lib/eldbus/eldbus_model_arguments.c
index 6e89db1096..1d22903668 100644
--- a/src/lib/eldbus/eldbus_model_arguments.c
+++ b/src/lib/eldbus/eldbus_model_arguments.c
@@ -30,8 +30,6 @@ _eldbus_model_arguments_hash_free(Eina_Value *value)
static Efl_Object*
_eldbus_model_arguments_efl_object_constructor(Eo *obj, Eldbus_Model_Arguments_Data *pd)
{
- obj = efl_constructor(efl_super(obj, MY_CLASS));
-
pd->obj = obj;
pd->properties_array = NULL;
pd->properties_hash = eina_hash_string_superfast_new(EINA_FREE_CB(_eldbus_model_arguments_hash_free));
@@ -39,11 +37,23 @@ _eldbus_model_arguments_efl_object_constructor(Eo *obj, Eldbus_Model_Arguments_D
pd->proxy = NULL;
pd->arguments = NULL;
pd->name = NULL;
- return obj;
+
+ return efl_constructor(efl_super(obj, MY_CLASS));
+}
+
+static Efl_Object *
+_eldbus_model_arguments_efl_object_finalize(Eo *obj, Eldbus_Model_Arguments_Data *pd)
+{
+ if (!pd->proxy) return NULL;
+ if (!eldbus_model_connection_get(obj))
+ eldbus_model_connection_set(obj,
+ eldbus_object_connection_get(eldbus_proxy_object_get(pd->proxy)));
+
+ return efl_finalize(efl_super(obj, MY_CLASS));
}
static void
-_eldbus_model_arguments_constructor(Eo *obj EINA_UNUSED,
+_eldbus_model_arguments_custom_constructor(Eo *obj EINA_UNUSED,
Eldbus_Model_Arguments_Data *pd,
Eldbus_Proxy *proxy,
const char *name,
@@ -70,9 +80,9 @@ _eldbus_model_arguments_efl_object_destructor(Eo *obj, Eldbus_Model_Arguments_Da
efl_destructor(efl_super(obj, MY_CLASS));
}
-static Eina_Array const *
-_eldbus_model_arguments_efl_model_properties_get(Eo *obj EINA_UNUSED,
- Eldbus_Model_Arguments_Data *pd)
+static Eina_Array *
+_eldbus_model_arguments_efl_model_properties_get(const Eo *obj EINA_UNUSED,
+ Eldbus_Model_Arguments_Data *pd)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(pd, NULL);
@@ -113,102 +123,62 @@ _eldbus_model_arguments_properties_load(Eldbus_Model_Arguments_Data *pd)
}
}
-static Efl_Future*
-_eldbus_model_arguments_efl_model_property_set(Eo *obj EINA_UNUSED,
- Eldbus_Model_Arguments_Data *pd,
- const char *property,
- Eina_Value const* value)
+static Eina_Future *
+_eldbus_model_arguments_efl_model_property_set(Eo *obj,
+ Eldbus_Model_Arguments_Data *pd,
+ const char *property, Eina_Value *value)
{
Eina_Value *prop_value;
- Eina_Value *promise_value;
- Efl_Promise* promise = efl_add(EFL_PROMISE_CLASS, obj);
- Efl_Future* future = efl_promise_future_get(promise);
+ Eina_Error err = 0;
+ Eina_Bool ret;
- ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(property, promise, EFL_MODEL_ERROR_INCORRECT_VALUE, future);
- ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(value, promise, EFL_MODEL_ERROR_INCORRECT_VALUE, future);
DBG("(%p): property=%s", obj, property);
+ err = EFL_MODEL_ERROR_NOT_FOUND;
+ if (!property || !value) goto on_error;
+
_eldbus_model_arguments_properties_load(pd);
- Eina_Bool ret = _eldbus_model_arguments_is_input_argument(pd, property);
- ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(ret, promise, EFL_MODEL_ERROR_READ_ONLY, future);
+ err = EFL_MODEL_ERROR_READ_ONLY;
+ ret = _eldbus_model_arguments_is_input_argument(pd, property);
+ if (!ret) goto on_error;
+ err = EFL_MODEL_ERROR_NOT_FOUND;
prop_value = eina_hash_find(pd->properties_hash, property);
- ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(prop_value, promise, EFL_MODEL_ERROR_NOT_FOUND, future);
+ if (!prop_value) goto on_error;
eina_value_flush(prop_value);
eina_value_copy(value, prop_value);
- promise_value = eina_value_new(eina_value_type_get(value));
- eina_value_copy(value, promise_value);
- efl_promise_value_set(promise, promise_value, (Eina_Free_Cb)&eina_value_free);
- return future;
+ return eina_future_resolved(efl_loop_future_scheduler_get(obj),
+ eina_value_reference_copy(value));
+
+ on_error:
+ return eina_future_rejected(efl_loop_future_scheduler_get(obj), err);
}
-static Efl_Future*
-_eldbus_model_arguments_efl_model_property_get(Eo *obj EINA_UNUSED,
- Eldbus_Model_Arguments_Data *pd,
- const char *property)
+static Eina_Value *
+_eldbus_model_arguments_efl_model_property_get(const Eo *obj, Eldbus_Model_Arguments_Data *pd, const char *property)
{
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, obj);
- Efl_Future *future = efl_promise_future_get(promise);
- Eina_Value *promise_value;
+ Eina_Value *value;
+ Eina_Bool ret;
- ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(property, promise, EFL_MODEL_ERROR_INCORRECT_VALUE, future);
DBG("(%p): property=%s", obj, property);
+ if (!property) return eina_value_error_new(EFL_MODEL_ERROR_INCORRECT_VALUE);
_eldbus_model_arguments_properties_load(pd);
- Eina_Value* value = eina_hash_find(pd->properties_hash, property);
- ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(value, promise, EFL_MODEL_ERROR_NOT_FOUND, future);
-
- Eina_Bool ret = _eldbus_model_arguments_is_output_argument(pd, property);
- ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(ret, promise, EFL_MODEL_ERROR_PERMISSION_DENIED, future);
+ value = eina_hash_find(pd->properties_hash, property);
+ if (!value) return eina_value_error_new(EFL_MODEL_ERROR_NOT_FOUND);
- promise_value = eina_value_new(eina_value_type_get(value));
- eina_value_copy(value, promise_value);
- efl_promise_value_set(promise, promise_value, (Eina_Free_Cb)&eina_value_free);
- return future;
-}
+ ret = _eldbus_model_arguments_is_output_argument(pd, property);
+ if (!ret) return eina_value_error_new(EFL_MODEL_ERROR_PERMISSION_DENIED);
-static Eo *
-_eldbus_model_arguments_efl_model_child_add(Eo *obj EINA_UNUSED, Eldbus_Model_Arguments_Data *pd EINA_UNUSED)
-{
- return NULL;
-}
-
-static void
-_eldbus_model_arguments_efl_model_child_del(Eo *obj EINA_UNUSED,
- Eldbus_Model_Arguments_Data *pd EINA_UNUSED,
- Eo *child EINA_UNUSED)
-{
-}
-
-static Efl_Future*
-_eldbus_model_arguments_efl_model_children_slice_get(Eo *obj EINA_UNUSED,
- Eldbus_Model_Arguments_Data *pd EINA_UNUSED,
- unsigned start EINA_UNUSED,
- unsigned count EINA_UNUSED)
-{
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, obj);
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_NOT_SUPPORTED);
- return efl_promise_future_get(promise);
-}
-
-static Efl_Future*
-_eldbus_model_arguments_efl_model_children_count_get(Eo *obj EINA_UNUSED,
- Eldbus_Model_Arguments_Data *pd EINA_UNUSED)
-{
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, obj);
- Efl_Future* future = efl_promise_future_get(promise);
- unsigned *count = malloc(sizeof(unsigned));
- *count = 0;
- efl_promise_value_set(promise, count, free);
- return future;
+ return eina_value_dup(value);
}
static const char *
-_eldbus_model_arguments_name_get(Eo *obj EINA_UNUSED, Eldbus_Model_Arguments_Data *pd)
+_eldbus_model_arguments_arg_name_get(const Eo *obj EINA_UNUSED, Eldbus_Model_Arguments_Data *pd)
{
return pd->name;
}
diff --git a/src/lib/eldbus/eldbus_model_arguments.eo b/src/lib/eldbus/eldbus_model_arguments.eo
index 1487e2319c..262d782eee 100644
--- a/src/lib/eldbus/eldbus_model_arguments.eo
+++ b/src/lib/eldbus/eldbus_model_arguments.eo
@@ -1,10 +1,10 @@
import eldbus_types;
-class Eldbus.Model.Arguments (Efl.Object, Efl.Model) {
+class Eldbus.Model.Arguments (Eldbus.Model) {
[[Eldbus model arguments class]]
methods {
- constructor {
+ custom_constructor {
[[Custom Eldbus_Model_Arguments constructor.
@since 1.16]]
@@ -14,7 +14,7 @@ class Eldbus.Model.Arguments (Efl.Object, Efl.Model) {
@in arguments: const(list<ptr(Eldbus.Introspection.Argument)>); [[The introspected arguments]]
}
}
- @property name {
+ @property arg_name {
[[Name of the argument]]
get {}
values {
@@ -24,16 +24,12 @@ class Eldbus.Model.Arguments (Efl.Object, Efl.Model) {
}
implements {
Efl.Object.constructor;
+ Efl.Object.finalize;
Efl.Object.destructor;
Efl.Model.properties { get; }
- Efl.Model.property_set;
- Efl.Model.property_get;
- Efl.Model.child_add;
- Efl.Model.child_del;
- Efl.Model.children_slice_get;
- Efl.Model.children_count_get;
+ Efl.Model.property { set; get; }
}
constructors {
- .constructor;
+ .custom_constructor;
}
}
diff --git a/src/lib/eldbus/eldbus_model_connection.c b/src/lib/eldbus/eldbus_model_connection.c
index e311c9824c..2af0affb06 100644
--- a/src/lib/eldbus/eldbus_model_connection.c
+++ b/src/lib/eldbus/eldbus_model_connection.c
@@ -9,13 +9,7 @@
#define MY_CLASS ELDBUS_MODEL_CONNECTION_CLASS
#define MY_CLASS_NAME "Eldbus_Model_Connection"
-#define UNIQUE_NAME_PROPERTY "unique_name"
-
-
static void _eldbus_model_connection_names_list_cb(void *, const Eldbus_Message *, Eldbus_Pending *);
-static void _eldbus_model_connection_connect(Eldbus_Model_Connection_Data *);
-static void _eldbus_model_connection_disconnect(Eldbus_Model_Connection_Data *);
-static void _eldbus_model_connection_clear(Eldbus_Model_Connection_Data *);
static Efl_Object*
_eldbus_model_connection_efl_object_constructor(Eo *obj, Eldbus_Model_Connection_Data *pd)
@@ -23,288 +17,98 @@ _eldbus_model_connection_efl_object_constructor(Eo *obj, Eldbus_Model_Connection
obj = efl_constructor(efl_super(obj, MY_CLASS));
pd->obj = obj;
- pd->is_listed = EINA_FALSE;
- pd->connection = NULL;
- pd->properties_array = NULL;
- pd->children_list = NULL;
- pd->type = ELDBUS_CONNECTION_TYPE_UNKNOWN;
- pd->address = NULL;
- pd->private = false;
- pd->unique_name = NULL;
- pd->pending_list = NULL;
return obj;
}
static void
-_eldbus_model_connection_constructor(Eo *obj EINA_UNUSED,
- Eldbus_Model_Connection_Data *pd,
- Eldbus_Connection_Type type,
- const char* address,
- Eina_Bool private)
-{
- pd->type = type;
- pd->address = eina_stringshare_add(address);
- pd->private = private;
-}
-
-static void
-_eldbus_model_connection_efl_object_destructor(Eo *obj, Eldbus_Model_Connection_Data *pd)
+_eldbus_model_connection_efl_object_invalidate(Eo *obj, Eldbus_Model_Connection_Data *pd)
{
- eina_stringshare_del(pd->address);
+ Eldbus_Children_Slice_Promise *slice;
- _eldbus_model_connection_clear(pd);
+ if (pd->pending) eldbus_pending_cancel(pd->pending);
- efl_destructor(efl_super(obj, MY_CLASS));
-}
-
-static Eina_Array const *
-_eldbus_model_connection_efl_model_properties_get(Eo *obj EINA_UNUSED,
- Eldbus_Model_Connection_Data *pd)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(pd, NULL);
- EINA_SAFETY_ON_NULL_RETURN_VAL(pd->obj, NULL);
-
- if (pd->properties_array == NULL)
+ EINA_LIST_FREE(pd->requests, slice)
{
- Eina_Bool ret;
-
- pd->properties_array = eina_array_new(1);
- EINA_SAFETY_ON_NULL_RETURN_VAL(pd->properties_array, NULL);
-
- ret = eina_array_push(pd->properties_array, UNIQUE_NAME_PROPERTY);
- EINA_SAFETY_ON_FALSE_RETURN_VAL(ret, NULL);
+ eina_promise_reject(slice->p, EFL_MODEL_ERROR_UNKNOWN);
+ free(slice);
}
- return pd->properties_array;
-}
-
+ pd->childrens = eina_list_free(pd->childrens);
-static Efl_Future*
-_eldbus_model_connection_efl_model_property_set(Eo *obj EINA_UNUSED,
- Eldbus_Model_Connection_Data *pd EINA_UNUSED,
- const char *property,
- Eina_Value const* value EINA_UNUSED)
-{
- Efl_Promise* promise = efl_add(EFL_PROMISE_CLASS, obj);
- Efl_Future* future = efl_promise_future_get(promise);
- ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET((strcmp(property, UNIQUE_NAME_PROPERTY) == 0), promise,
- EFL_MODEL_ERROR_NOT_FOUND, future);
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_READ_ONLY);
- return future;
-}
-
-static Efl_Future*
-_eldbus_model_connection_efl_model_property_get(Eo *obj EINA_UNUSED,
- Eldbus_Model_Connection_Data *pd,
- const char *property)
-{
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, obj);
- Efl_Future *future = efl_promise_future_get(promise);
-
- DBG("(%p): property=%s", obj, property);
-
- if (!pd->connection)
- _eldbus_model_connection_connect(pd);
-
- ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET((strcmp(property, UNIQUE_NAME_PROPERTY) == 0), promise,
- EFL_MODEL_ERROR_NOT_FOUND, future);
-
- if (pd->unique_name == NULL)
- {
- const char *unique_name;
-
- unique_name = eldbus_connection_unique_name_get(pd->connection);
- ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(unique_name, promise, EFL_MODEL_ERROR_NOT_FOUND, future);
- pd->unique_name = strdup(unique_name);
- }
-
- Eina_Value* v = eina_value_new(EINA_VALUE_TYPE_STRING);
- eina_value_set(v, pd->unique_name);
- efl_promise_value_set(promise, v, (Eina_Free_Cb)&eina_value_free);
- return future;
-}
-
-static Eo *
-_eldbus_model_connection_efl_model_child_add(Eo *obj EINA_UNUSED, Eldbus_Model_Connection_Data *pd EINA_UNUSED)
-{
- return NULL;
+ efl_invalidate(efl_super(obj, ELDBUS_MODEL_CONNECTION_CLASS));
}
static void
-_eldbus_model_connection_efl_model_child_del(Eo *obj EINA_UNUSED,
- Eldbus_Model_Connection_Data *pd EINA_UNUSED,
- Eo *child EINA_UNUSED)
-{
-}
-
-static Efl_Promise*
-_eldbus_model_connection_efl_model_children_slice_get(Eo *obj EINA_UNUSED,
- Eldbus_Model_Connection_Data *pd,
- unsigned int start,
- unsigned int count)
+_eldbus_model_children_list(const Eo *obj, Eldbus_Model_Connection_Data *pd)
{
- Efl_Promise *promise;
- Efl_Future *future;
- _Eldbus_Children_Slice_Promise* data;
- Eldbus_Pending *pending;
-
- promise = efl_add(EFL_PROMISE_CLASS, obj);
- future = efl_promise_future_get(promise);
-
- if (!pd->connection)
- _eldbus_model_connection_connect(pd);
-
- if (pd->is_listed)
- {
- Eina_Accessor *ac = efl_model_list_slice(pd->children_list, start, count);
- efl_promise_value_set(promise, ac, (Eina_Free_Cb)&eina_accessor_free);
- return future;
- }
+ Eldbus_Model_Data *sd;
- data = calloc(1, sizeof(struct _Eldbus_Children_Slice_Promise));
- EINA_SAFETY_ON_NULL_RETURN_VAL(data, future);
- data->promise = promise;
- data->start = start;
- data->count = count;
+ if (pd->pending || pd->is_listed) return ;
- pd->children_promises = eina_list_prepend(pd->children_promises, data);
+ sd = efl_data_scope_get(obj, ELDBUS_MODEL_CLASS);
- if (pd->pending_list == NULL)
- {
- pending = eldbus_names_list(pd->connection, &_eldbus_model_connection_names_list_cb, pd);
- pd->pending_list = eina_list_append(pd->pending_list, pending);
- }
- return future;
+ pd->pending = eldbus_names_list(sd->connection,
+ &_eldbus_model_connection_names_list_cb,
+ pd);
}
-static Efl_Future*
-_eldbus_model_connection_efl_model_children_count_get(Eo *obj EINA_UNUSED,
- Eldbus_Model_Connection_Data *pd)
+static Eina_Future *
+_eldbus_model_connection_efl_model_children_slice_get(Eo *obj,
+ Eldbus_Model_Connection_Data *pd,
+ unsigned int start,
+ unsigned int count)
{
- Efl_Promise *promise;
- Eldbus_Pending *pending;
-
- promise = efl_add(EFL_PROMISE_CLASS, obj);
- if (!pd->connection)
- _eldbus_model_connection_connect(pd);
+ Eldbus_Children_Slice_Promise* slice;
+ Eina_Promise *p;
if (pd->is_listed)
{
- unsigned int *c = calloc(sizeof(unsigned int), 1);
- *c = eina_list_count(pd->children_list);
- efl_promise_value_set(promise, c, free);
- return efl_promise_future_get(promise);
- }
+ Eina_Value v;
- pd->count_promises = eina_list_prepend(pd->count_promises, promise);
- if (pd->pending_list == NULL)
- {
- pending = eldbus_names_list(pd->connection, &_eldbus_model_connection_names_list_cb, pd);
- pd->pending_list = eina_list_append(pd->pending_list, pending);
+ v = efl_model_list_value_get(pd->childrens, start, count);
+ return eina_future_resolved(efl_loop_future_scheduler_get(obj), v);
}
- return efl_promise_future_get(promise);
-}
-static const char *
-_eldbus_model_connection_address_get(Eo *obj EINA_UNUSED, Eldbus_Model_Connection_Data *pd)
-{
- return pd->address;
-}
+ p = eina_promise_new(efl_loop_future_scheduler_get(obj),
+ _eldbus_eina_promise_cancel, NULL);
-static Eina_Bool
-_eldbus_model_connection_private_get(Eo *obj EINA_UNUSED, Eldbus_Model_Connection_Data *pd)
-{
- return pd->private;
-}
+ slice = calloc(1, sizeof (Eldbus_Children_Slice_Promise));
+ slice->p = p;
+ slice->start = start;
+ slice->count = count;
-static Eldbus_Connection_Type
-_eldbus_model_connection_type_get(Eo *obj EINA_UNUSED, Eldbus_Model_Connection_Data *pd)
-{
- return pd->type;
-}
+ pd->requests = eina_list_prepend(pd->requests, slice);
-static void
-_eldbus_model_connection_connect(Eldbus_Model_Connection_Data *pd)
-{
- EINA_SAFETY_ON_NULL_RETURN(pd);
-
- if (ELDBUS_CONNECTION_TYPE_ADDRESS == pd->type)
- {
- if (pd->private)
- pd->connection = eldbus_address_connection_get(pd->address);
- else
- pd->connection = eldbus_private_address_connection_get(pd->address);
- }
- else
- {
- if (pd->private)
- pd->connection = eldbus_private_connection_get(pd->type);
- else
- pd->connection = eldbus_connection_get(pd->type);
- }
-
- // TODO: Register for disconnection event
-
- EINA_SAFETY_ON_FALSE_RETURN(pd->connection != NULL);
+ _eldbus_model_children_list(obj, pd);
+ return efl_future_Eina_FutureXXX_then(obj, eina_future_new(p));;
}
-static void
-_eldbus_model_connection_disconnect(Eldbus_Model_Connection_Data *pd)
+static unsigned int
+_eldbus_model_connection_efl_model_children_count_get(const Eo *obj,
+ Eldbus_Model_Connection_Data *pd)
{
- EINA_SAFETY_ON_NULL_RETURN(pd);
- eldbus_connection_unref(pd->connection);
- pd->connection = NULL;
-}
-
-static void
-_eldbus_model_connection_clear(Eldbus_Model_Connection_Data *pd)
-{
- Eldbus_Pending *pending;
- Eo *child;
-
- EINA_SAFETY_ON_NULL_RETURN(pd);
-
- if (!pd->connection)
- return;
-
- free(pd->unique_name);
- pd->unique_name = NULL;
-
- EINA_LIST_FREE(pd->children_list, child)
- efl_unref(child);
-
- EINA_LIST_FREE(pd->pending_list, pending)
- eldbus_pending_cancel(pending);
-
- if (pd->properties_array)
- {
- eina_array_free(pd->properties_array);
- pd->properties_array = NULL;
- }
-
- _eldbus_model_connection_disconnect(pd);
+ _eldbus_model_children_list(obj, pd);
+ return eina_list_count(pd->childrens);
}
static void
_eldbus_model_connection_names_list_cb(void *data,
const Eldbus_Message *msg,
- Eldbus_Pending *pending)
+ Eldbus_Pending *pending EINA_UNUSED)
{
- Eldbus_Model_Connection_Data *pd = (Eldbus_Model_Connection_Data*)data;
- _Eldbus_Children_Slice_Promise * p;
+ Eldbus_Model_Connection_Data *pd = (Eldbus_Model_Connection_Data*) data;
+ Eldbus_Model_Data *sd;
+ Eldbus_Children_Slice_Promise *slice;
const char *error_name, *error_text;
Eldbus_Message_Iter *array = NULL;
const char *bus;
- unsigned int count;
- Eina_List* i;
- pd->pending_list = eina_list_remove(pd->pending_list, pending);
+ pd->pending = NULL;
if (eldbus_message_error_get(msg, &error_name, &error_text))
{
ERR("%s: %s", error_name, error_text);
- //efl_model_error_notify(pd->obj);
return;
}
@@ -314,39 +118,36 @@ _eldbus_model_connection_names_list_cb(void *data,
return;
}
+ sd = efl_data_scope_get(pd->obj, ELDBUS_MODEL_CLASS);
+
while (eldbus_message_iter_get_and_next(array, 's', &bus))
{
+ Eo *child;
+
DBG("(%p): bus = %s", pd->obj, bus);
- Eo *child = efl_add(ELDBUS_MODEL_OBJECT_CLASS, pd->obj, eldbus_model_object_connection_constructor(efl_added, pd->connection, bus, "/"));
+ child = efl_add(ELDBUS_MODEL_OBJECT_CLASS, pd->obj,
+ eldbus_model_connection_set(efl_added, sd->connection),
+ eldbus_model_object_bus_set(efl_added, bus),
+ eldbus_model_object_path_set(efl_added, "/"));
- pd->children_list = eina_list_append(pd->children_list, child);
+ pd->childrens = eina_list_append(pd->childrens, child);
}
- count = eina_list_count(pd->children_list);
-
- if (count)
- efl_event_callback_call(pd->obj, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, &count);
-
pd->is_listed = EINA_TRUE;
- EINA_LIST_FOREACH(pd->children_promises, i, p)
- {
- Eina_Accessor *ac = efl_model_list_slice(pd->children_list, p->start, p->count);
- efl_promise_value_set(p->promise, ac, (Eina_Free_Cb)&eina_accessor_free);
- free(p);
- }
- eina_list_free(pd->children_promises);
+ efl_event_callback_call(pd->obj, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, NULL);
- Efl_Promise *ep;
- EINA_LIST_FOREACH(pd->count_promises, i, ep)
+ EINA_LIST_FREE(pd->requests, slice)
{
- unsigned *c = calloc(sizeof(unsigned), 1);
- *c = eina_list_count(pd->children_list);
- efl_promise_value_set(ep, c, free);
+ Eina_Value v;
+
+ v = efl_model_list_value_get(pd->childrens,
+ slice->start, slice->count);
+ eina_promise_resolve(slice->p, v);
+
+ free(slice);
}
- eina_list_free(pd->count_promises);
}
-
#include "eldbus_model_connection.eo.c"
diff --git a/src/lib/eldbus/eldbus_model_connection.eo b/src/lib/eldbus/eldbus_model_connection.eo
index 8db09682af..d064027f17 100644
--- a/src/lib/eldbus/eldbus_model_connection.eo
+++ b/src/lib/eldbus/eldbus_model_connection.eo
@@ -1,53 +1,10 @@
-import eldbus_types;
-
-class Eldbus.Model.Connection (Efl.Object, Efl.Model) {
+class Eldbus.Model.Connection (Eldbus.Model) {
[[Eldbus model connection class]]
- methods {
- constructor {
- [[Custom Eldbus_Model_Connection constructor.
-
- @since 1.16]]
- params {
- @in type: Eldbus.Connection.Type; [[The connection type]]
- @in address: string; [[Remote address of DBus]]
- @in private_: bool; [[Non shared dbus connection]]
- }
- }
- @property type {
- [[Connection type]]
- get { }
- values {
- type: Eldbus.Connection.Type; [[Connection type]]
- }
- }
- @property address {
- [[Remote DBus address]]
- get { }
- values {
- address: string; [[Address]]
- }
- }
- @property private {
- [[Indicate if the DBus connection is shared or private]]
- get { }
- values {
- private_: bool; [[Private DBus connection]]
- }
- }
- }
implements {
Efl.Object.constructor;
- Efl.Object.destructor;
- Efl.Model.properties { get; }
- Efl.Model.property_set;
- Efl.Model.property_get;
- Efl.Model.child_add;
- Efl.Model.child_del;
+ Efl.Object.invalidate;
Efl.Model.children_slice_get;
- Efl.Model.children_count_get;
- }
- constructors {
- .constructor;
+ Efl.Model.children_count { get; }
}
}
diff --git a/src/lib/eldbus/eldbus_model_connection_private.h b/src/lib/eldbus/eldbus_model_connection_private.h
index a1636b94be..829ddd9142 100644
--- a/src/lib/eldbus/eldbus_model_connection_private.h
+++ b/src/lib/eldbus/eldbus_model_connection_private.h
@@ -13,18 +13,20 @@ typedef struct _Eldbus_Model_Connection_Data Eldbus_Model_Connection_Data;
struct _Eldbus_Model_Connection_Data
{
Eo *obj;
- Eina_Bool is_listed : 1;
+
Eldbus_Connection *connection;
- Eina_Array *properties_array;
- Eina_List *children_list;
- Eina_List *children_promises;
- Eina_List *count_promises;
+ Eldbus_Pending *pending;
Eldbus_Connection_Type type;
+
+ Eina_List *childrens;
+ Eina_List *requests;
+
Eina_Stringshare *address;
- bool private;
char *unique_name;
- Eina_List *pending_list;
+
+ bool private;
+
+ Eina_Bool is_listed : 1;
};
#endif
-
diff --git a/src/lib/eldbus/eldbus_model_method.c b/src/lib/eldbus/eldbus_model_method.c
index e36f941a0d..8e7e87bf27 100644
--- a/src/lib/eldbus/eldbus_model_method.c
+++ b/src/lib/eldbus/eldbus_model_method.c
@@ -26,17 +26,33 @@ _eldbus_model_method_efl_object_constructor(Eo *obj, Eldbus_Model_Method_Data *p
return obj;
}
-static void
-_eldbus_model_method_constructor(Eo *obj EINA_UNUSED,
- Eldbus_Model_Method_Data *pd,
- Eldbus_Proxy *proxy,
- const Eldbus_Introspection_Method *method)
+static Efl_Object*
+_eldbus_model_method_efl_object_finalize(Eo *obj, Eldbus_Model_Method_Data *pd)
{
- EINA_SAFETY_ON_NULL_RETURN(proxy);
- EINA_SAFETY_ON_NULL_RETURN(method);
+ if (!pd->proxy ||
+ !pd->method)
+ return NULL;
+
+ eldbus_model_arguments_custom_constructor(obj,
+ pd->proxy,
+ pd->method->name, pd->method->arguments);
- eldbus_model_arguments_constructor(efl_super(obj, MY_CLASS), proxy, method->name, method->arguments);
+ return obj;
+}
+static void
+_eldbus_model_method_proxy_set(Eo *obj EINA_UNUSED,
+ Eldbus_Model_Method_Data *pd,
+ Eldbus_Proxy *proxy)
+{
+ pd->proxy = proxy;
+}
+
+static void
+_eldbus_model_method_method_set(Eo *obj EINA_UNUSED,
+ Eldbus_Model_Method_Data *pd,
+ const Eldbus_Introspection_Method *method)
+{
pd->method = method;
}
diff --git a/src/lib/eldbus/eldbus_model_method.eo b/src/lib/eldbus/eldbus_model_method.eo
index 61e309ab8a..ae74f80295 100644
--- a/src/lib/eldbus/eldbus_model_method.eo
+++ b/src/lib/eldbus/eldbus_model_method.eo
@@ -3,13 +3,20 @@ import eldbus_types;
class Eldbus.Model.Method (Eldbus.Model.Arguments) {
[[Eldbus model method class]]
methods {
- constructor {
+ @property proxy {
[[Custom Eldbus_Model_Method constructor.
- @since 1.16]]
- params {
- @in proxy: ptr(Eldbus.Proxy); [[Eldbus proxy]]
- @cref method: Eldbus.Introspection.Method; [[The introspected method]]
+ @since 1.21]]
+ set {}
+ values {
+ proxy: ptr(Eldbus.Proxy); [[Eldbus proxy]]
+ }
+ }
+ @property method {
+ [[Object]]
+ set {}
+ values {
+ @cref method: Eldbus.Introspection.Method; [[The introspected interface]]
}
}
call {
@@ -24,12 +31,14 @@ class Eldbus.Model.Method (Eldbus.Model.Arguments) {
}
implements {
Efl.Object.constructor;
+ Efl.Object.finalize;
}
constructors {
- .constructor;
+ .proxy;
+ .method;
}
events {
- successful,call; [[Event dispatched for a successful method call.]]
+ successful,call: void; [[Event dispatched for a successful method call.]]
}
}
diff --git a/src/lib/eldbus/eldbus_model_method_private.h b/src/lib/eldbus/eldbus_model_method_private.h
index 5092b50b53..d3813f6b77 100644
--- a/src/lib/eldbus/eldbus_model_method_private.h
+++ b/src/lib/eldbus/eldbus_model_method_private.h
@@ -11,8 +11,10 @@ typedef struct _Eldbus_Model_Method_Data Eldbus_Model_Method_Data;
struct _Eldbus_Model_Method_Data
{
Eo *obj;
+
const Eldbus_Introspection_Method *method;
+
+ Eldbus_Proxy *proxy;
};
#endif
-
diff --git a/src/lib/eldbus/eldbus_model_object.c b/src/lib/eldbus/eldbus_model_object.c
index b359eaf5e3..02bfc9778c 100644
--- a/src/lib/eldbus/eldbus_model_object.c
+++ b/src/lib/eldbus/eldbus_model_object.c
@@ -11,15 +11,7 @@
#define MY_CLASS ELDBUS_MODEL_OBJECT_CLASS
#define MY_CLASS_NAME "Eldbus_Model_Object"
-#define UNIQUE_NAME_PROPERTY "unique_name"
-
-static bool _eldbus_model_object_introspect(Eldbus_Model_Object_Data *, const char *, const char *);
static void _eldbus_model_object_introspect_cb(void *, const Eldbus_Message *, Eldbus_Pending *);
-static void _eldbus_model_object_connect(Eldbus_Model_Object_Data *);
-static void _eldbus_model_object_disconnect(Eldbus_Model_Object_Data *);
-static void _eldbus_model_object_clear(Eldbus_Model_Object_Data *);
-static void _eldbus_model_object_introspect_nodes(Eldbus_Model_Object_Data *, const char *, Eina_List *);
-static char *_eldbus_model_object_concatenate_path(const char *, const char *);
static void _eldbus_model_object_create_children(Eldbus_Model_Object_Data *, Eldbus_Object *, Eina_List *);
static Efl_Object*
@@ -28,332 +20,214 @@ _eldbus_model_object_efl_object_constructor(Eo *obj, Eldbus_Model_Object_Data *p
obj = efl_constructor(efl_super(obj, MY_CLASS));
pd->obj = obj;
- pd->is_listed = EINA_FALSE;
- pd->connection = NULL;
- pd->object_list = NULL;
- pd->properties_array = NULL;
- pd->children_list = NULL;
- pd->type = ELDBUS_CONNECTION_TYPE_UNKNOWN;
- pd->address = NULL;
- pd->private = false;
- pd->bus = NULL;
- pd->path = NULL;
- pd->unique_name = NULL;
- pd->pending_list = NULL;
- pd->introspection = NULL;
return obj;
}
static void
-_eldbus_model_object_constructor(Eo *obj EINA_UNUSED,
- Eldbus_Model_Object_Data *pd,
- Eldbus_Connection_Type type,
- const char* address,
- Eina_Bool private,
- const char* bus,
- const char* path)
+_eldbus_model_object_bus_set(Eo *obj EINA_UNUSED,
+ Eldbus_Model_Object_Data *pd,
+ const char *bus)
{
- EINA_SAFETY_ON_NULL_RETURN(bus);
- EINA_SAFETY_ON_NULL_RETURN(path);
-
- pd->type = type;
- pd->address = eina_stringshare_add(address);
- pd->private = private;
pd->bus = eina_stringshare_add(bus);
- pd->path = eina_stringshare_add(path);
}
static void
-_eldbus_model_object_connection_constructor(Eo *obj EINA_UNUSED,
- Eldbus_Model_Object_Data *pd,
- Eldbus_Connection *connection,
- const char* bus,
- const char* path)
+_eldbus_model_object_path_set(Eo *obj EINA_UNUSED,
+ Eldbus_Model_Object_Data *pd,
+ const char *path)
{
- EINA_SAFETY_ON_NULL_RETURN(connection);
- EINA_SAFETY_ON_NULL_RETURN(bus);
- EINA_SAFETY_ON_NULL_RETURN(path);
-
- pd->connection = eldbus_connection_ref(connection);
- pd->bus = eina_stringshare_add(bus);
pd->path = eina_stringshare_add(path);
}
-static void
-_eldbus_model_object_efl_object_destructor(Eo *obj, Eldbus_Model_Object_Data *pd)
-{
- eina_stringshare_del(pd->address);
- eina_stringshare_del(pd->bus);
- eina_stringshare_del(pd->path);
-
- _eldbus_model_object_clear(pd);
-
- efl_destructor(efl_super(obj, MY_CLASS));
-}
-
-static Eina_Array const *
-_eldbus_model_object_efl_model_properties_get(Eo *obj EINA_UNUSED,
- Eldbus_Model_Object_Data *pd)
+static Efl_Object*
+_eldbus_model_object_efl_object_finalize(Eo *obj, Eldbus_Model_Object_Data *pd)
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(pd, NULL);
- EINA_SAFETY_ON_NULL_RETURN_VAL(pd->obj, NULL);
-
- if (pd->properties_array == NULL)
- {
- Eina_Bool ret;
+ if (!pd->bus || !pd->path)
+ return NULL;
- pd->properties_array = eina_array_new(1);
- EINA_SAFETY_ON_NULL_RETURN_VAL(pd->properties_array, NULL);
-
- ret = eina_array_push(pd->properties_array, UNIQUE_NAME_PROPERTY);
- EINA_SAFETY_ON_FALSE_RETURN_VAL(ret, NULL);
- }
-
- return pd->properties_array;
-}
-
-static Efl_Future*
-_eldbus_model_object_efl_model_property_set(Eo *obj EINA_UNUSED,
- Eldbus_Model_Object_Data *pd EINA_UNUSED,
- const char *property,
- const Eina_Value *value EINA_UNUSED)
-{
- Efl_Promise* promise = efl_add(EFL_PROMISE_CLASS, obj);
- ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET((strcmp(property, UNIQUE_NAME_PROPERTY) == 0), promise,
- EFL_MODEL_ERROR_NOT_FOUND, efl_promise_future_get(promise));
- efl_promise_failed_set(promise, EFL_MODEL_ERROR_READ_ONLY);
- return efl_promise_future_get(promise);
+ return efl_finalize(efl_super(obj, MY_CLASS));
}
-static Efl_Future*
-_eldbus_model_object_efl_model_property_get(Eo *obj EINA_UNUSED,
- Eldbus_Model_Object_Data *pd,
- const char *property)
+static void
+_eldbus_model_object_efl_object_invalidate(Eo *obj, Eldbus_Model_Object_Data *pd)
{
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, obj);
- Efl_Future *future = efl_promise_future_get(promise);
+ Eldbus_Pending *pending;
+ Eldbus_Object *object;
+ Eo *child;
- ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(property, promise, EFL_MODEL_ERROR_INCORRECT_VALUE, future);
- DBG("(%p): property=%s", obj, property);
+ EINA_LIST_FREE(pd->childrens, child)
+ efl_unref(child);
- if (!pd->connection)
- _eldbus_model_object_connect(pd);
+ EINA_LIST_FREE(pd->pendings, pending)
+ eldbus_pending_cancel(pending);
- ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET((strcmp(property, UNIQUE_NAME_PROPERTY) == 0), promise,
- EFL_MODEL_ERROR_NOT_FOUND, future);
+ EINA_LIST_FREE(pd->objects, object)
+ eldbus_object_unref(object);
- if (pd->unique_name == NULL)
+ if (pd->introspection)
{
- const char *unique_name;
-
- unique_name = eldbus_connection_unique_name_get(pd->connection);
- ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(unique_name, promise, EFL_MODEL_ERROR_NOT_FOUND, future);
- pd->unique_name = strdup(unique_name);
+ eldbus_introspection_node_free(pd->introspection);
+ pd->introspection = NULL;
}
- Eina_Value* v = eina_value_new(EINA_VALUE_TYPE_STRING);
- eina_value_set(v, pd->unique_name);
- efl_promise_value_set(promise, v, (Eina_Free_Cb)&eina_value_free);
- return future;
-}
-
-static Eo *
-_eldbus_model_object_efl_model_child_add(Eo *obj EINA_UNUSED, Eldbus_Model_Object_Data *pd EINA_UNUSED)
-{
- return NULL;
+ efl_invalidate(efl_super(obj, MY_CLASS));
}
static void
-_eldbus_model_object_efl_model_child_del(Eo *obj EINA_UNUSED,
- Eldbus_Model_Object_Data *pd EINA_UNUSED,
- Eo *child EINA_UNUSED)
+_eldbus_model_object_efl_object_destructor(Eo *obj, Eldbus_Model_Object_Data *pd)
{
+ eina_stringshare_del(pd->bus);
+ eina_stringshare_del(pd->path);
+
+ efl_destructor(efl_super(obj, MY_CLASS));
}
-static Efl_Future*
-_eldbus_model_object_efl_model_children_slice_get(Eo *obj EINA_UNUSED,
- Eldbus_Model_Object_Data *pd,
- unsigned start,
- unsigned count)
+static Eina_Bool
+_eldbus_model_object_introspect(const Eo *obj,
+ Eldbus_Model_Object_Data *pd,
+ const char *bus,
+ const char *path)
{
- _Eldbus_Children_Slice_Promise* p;
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, obj);
- Efl_Future *future = efl_promise_future_get(promise);
+ Eldbus_Pending *pending;
+ Eldbus_Object *object;
- if (!pd->connection)
- _eldbus_model_object_connect(pd);
+ DBG("(%p) Introspecting: bus = %s, path = %s", pd->obj, bus, path);
- if (pd->is_listed)
+ object = eldbus_object_get(eldbus_model_connection_get(obj),
+ bus, path);
+ if (!object)
{
- Eina_Accessor* ac = efl_model_list_slice(pd->children_list, start, count);
- efl_promise_value_set(promise, ac, (Eina_Free_Cb)&eina_accessor_free);
- return future;
+ ERR("(%p): Cannot get object: bus=%s, path=%s", pd->obj, bus, path);
+ return EINA_FALSE;
}
+ pd->objects = eina_list_append(pd->objects, object);
- p = calloc(1, sizeof(struct _Eldbus_Children_Slice_Promise));
- EINA_SAFETY_ON_NULL_RETURN_VAL(p, future);
- p->promise = promise;
- p->start = start;
- p->count = count;
-
- pd->children_promises = eina_list_prepend(pd->children_promises, p);
- if (pd->pending_list == NULL)
- _eldbus_model_object_introspect(pd, pd->bus, pd->path);
- return future;
+ // TODO: Register for interface added/removed event
+ pending = eldbus_object_introspect(object, &_eldbus_model_object_introspect_cb, pd);
+ eldbus_pending_data_set(pending, "object", object);
+ pd->pendings = eina_list_append(pd->pendings, pending);
+ return EINA_TRUE;
}
-static Efl_Future*
-_eldbus_model_object_efl_model_children_count_get(Eo *obj EINA_UNUSED,
- Eldbus_Model_Object_Data *pd)
+static Eina_Future *
+_eldbus_model_object_efl_model_children_slice_get(Eo *obj EINA_UNUSED,
+ Eldbus_Model_Object_Data *pd,
+ unsigned start,
+ unsigned count)
{
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, obj);
- if (!pd->connection)
- _eldbus_model_object_connect(pd);
+ Eldbus_Children_Slice_Promise *slice;
+ Eina_Promise *p;
if (pd->is_listed)
{
- unsigned int *c = calloc(sizeof(unsigned int), 1);
- *c = eina_list_count(pd->children_list);
- efl_promise_value_set(promise, c, free);
- return efl_promise_future_get(promise);
+ Eina_Value v;
+
+ v = efl_model_list_value_get(pd->childrens, start, count);
+ return eina_future_resolved(efl_loop_future_scheduler_get(obj), v);
}
- pd->count_promises = eina_list_prepend(pd->count_promises, promise);
- if (pd->pending_list == NULL)
- _eldbus_model_object_introspect(pd, pd->bus, pd->path);
- return efl_promise_future_get(promise);
-}
+ p = eina_promise_new(efl_loop_future_scheduler_get(obj),
+ _eldbus_eina_promise_cancel, NULL);
-static const char *
-_eldbus_model_object_address_get(Eo *obj EINA_UNUSED, Eldbus_Model_Object_Data *pd)
-{
- return pd->address;
-}
+ slice = calloc(1, sizeof(struct _Eldbus_Children_Slice_Promise));
+ slice->p = p;
+ slice->start = start;
+ slice->count = count;
-static Eina_Bool
-_eldbus_model_object_private_get(Eo *obj EINA_UNUSED, Eldbus_Model_Object_Data *pd)
-{
- return pd->private;
+ pd->requests = eina_list_prepend(pd->requests, slice);
+
+ if (!pd->pendings)
+ _eldbus_model_object_introspect(obj, pd, pd->bus, pd->path);
+ return efl_future_Eina_FutureXXX_then(obj, eina_future_new(p));;
}
-static Eldbus_Connection_Type
-_eldbus_model_object_type_get(Eo *obj EINA_UNUSED, Eldbus_Model_Object_Data *pd)
+static unsigned int
+_eldbus_model_object_efl_model_children_count_get(const Eo *obj EINA_UNUSED,
+ Eldbus_Model_Object_Data *pd)
{
- return pd->type;
+ if (!pd->is_listed && !pd->pendings)
+ _eldbus_model_object_introspect(obj, pd, pd->bus, pd->path);
+ return eina_list_count(pd->childrens);
}
static const char *
-_eldbus_model_object_bus_get(Eo *obj EINA_UNUSED, Eldbus_Model_Object_Data *pd)
+_eldbus_model_object_bus_get(const Eo *obj EINA_UNUSED, Eldbus_Model_Object_Data *pd)
{
return pd->bus;
}
static const char *
-_eldbus_model_object_path_get(Eo *obj EINA_UNUSED, Eldbus_Model_Object_Data *pd)
+_eldbus_model_object_path_get(const Eo *obj EINA_UNUSED, Eldbus_Model_Object_Data *pd)
{
return pd->path;
}
-static void
-_eldbus_model_object_connect(Eldbus_Model_Object_Data *pd)
+static char *
+_eldbus_model_object_concatenate_path(const char *root_path,
+ const char *relative_path)
{
- EINA_SAFETY_ON_NULL_RETURN(pd);
-
- if (ELDBUS_CONNECTION_TYPE_ADDRESS == pd->type)
- {
- if (pd->private)
- pd->connection = eldbus_address_connection_get(pd->address);
- else
- pd->connection = eldbus_private_address_connection_get(pd->address);
- }
- else
- {
- if (pd->private)
- pd->connection = eldbus_private_connection_get(pd->type);
- else
- pd->connection = eldbus_connection_get(pd->type);
- }
-
- // TODO: Register for disconnection event
+ Eina_Strbuf *buffer;
+ const char *format = (strcmp(root_path, "/") != 0) ? "%s/%s" : "%s%s";
+ char *absolute_path = NULL;
- EINA_SAFETY_ON_FALSE_RETURN(NULL != pd->connection);
-}
+ buffer = eina_strbuf_new();
+ eina_strbuf_append_printf(buffer, format, root_path, relative_path);
+ absolute_path = eina_strbuf_string_steal(buffer);
-static void
-_eldbus_model_object_disconnect(Eldbus_Model_Object_Data *pd)
-{
- EINA_SAFETY_ON_NULL_RETURN(pd);
- eldbus_connection_unref(pd->connection);
- pd->connection = NULL;
+ eina_strbuf_free(buffer);
+ return absolute_path;
}
static void
-_eldbus_model_object_clear(Eldbus_Model_Object_Data *pd)
+_eldbus_model_object_introspect_nodes(Eldbus_Model_Object_Data *pd,
+ const char *current_path,
+ Eina_List *nodes)
{
- Eldbus_Pending *pending;
- Eldbus_Object *object;
- Eo *child;
-
- EINA_SAFETY_ON_NULL_RETURN(pd);
- if (!pd->connection)
- return;
-
- free(pd->unique_name);
- pd->unique_name = NULL;
+ Eldbus_Introspection_Node *node;
+ Eina_List *it;
- EINA_LIST_FREE(pd->children_list, child)
- efl_unref(child);
+ EINA_LIST_FOREACH(nodes, it, node)
+ {
+ const char *relative_path;
+ char *absolute_path;
- EINA_LIST_FREE(pd->pending_list, pending)
- eldbus_pending_cancel(pending);
+ relative_path = node->name;
+ if (!relative_path) continue;
- if (pd->properties_array)
- {
- eina_array_free(pd->properties_array);
- pd->properties_array = NULL;
- }
+ absolute_path = _eldbus_model_object_concatenate_path(current_path, relative_path);
+ if (!absolute_path) continue;
- EINA_LIST_FREE(pd->object_list, object)
- eldbus_object_unref(object);
+ _eldbus_model_object_introspect(pd->obj, pd, pd->bus, absolute_path);
- if (pd->introspection)
- {
- eldbus_introspection_node_free(pd->introspection);
- pd->introspection = NULL;
+ free(absolute_path);
}
-
- _eldbus_model_object_disconnect(pd);
}
-
-static bool
-_eldbus_model_object_introspect(Eldbus_Model_Object_Data *pd,
- const char *bus,
- const char *path)
+static void
+_eldbus_model_object_create_children(Eldbus_Model_Object_Data *pd, Eldbus_Object *object, Eina_List *interfaces)
{
- Eldbus_Object *object;
- Eldbus_Pending *pending;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(bus, false);
- EINA_SAFETY_ON_NULL_RETURN_VAL(path, false);
+ Eldbus_Introspection_Interface *interface;
+ const char *current_path;
+ Eina_List *l;
- DBG("(%p) Introspecting: bus = %s, path = %s", pd->obj, bus, path);
+ current_path = eldbus_object_path_get(object);
+ if (!current_path) return ;
- object = eldbus_object_get(pd->connection, bus, path);
- if (!object)
+ EINA_LIST_FOREACH(interfaces, l, interface)
{
- ERR("(%p): Cannot get object: bus=%s, path=%s", pd->obj, bus, path);
- return false;
- }
- pd->object_list = eina_list_append(pd->object_list, object);
+ Eo *child;
- // TODO: Register for interface added/removed event
+ DBG("(%p) Creating child: bus = %s, path = %s, interface = %s",
+ pd->obj, pd->bus, current_path, interface->name);
- pending = eldbus_object_introspect(object, &_eldbus_model_object_introspect_cb, pd);
- eldbus_pending_data_set(pending, "object", object);
- pd->pending_list = eina_list_append(pd->pending_list, pending);
- return true;
+ // TODO: increment reference to keep 'interface' in memory
+ child = efl_add_ref(ELDBUS_MODEL_PROXY_CLASS, pd->obj,
+ eldbus_model_proxy_object_set(efl_added, object),
+ eldbus_model_proxy_interface_set(efl_added, interface));
+
+ if (child) pd->childrens = eina_list_append(pd->childrens, child);
+ }
}
static void
@@ -362,12 +236,14 @@ _eldbus_model_object_introspect_cb(void *data,
Eldbus_Pending *pending)
{
Eldbus_Model_Object_Data *pd = (Eldbus_Model_Object_Data*)data;
+ Eldbus_Children_Slice_Promise* slice;
Eldbus_Object *object;
- const char *error_name, *error_text;
+ const char *error_name;
+ const char *error_text;
const char *xml = NULL;
const char *current_path;
- pd->pending_list = eina_list_remove(pd->pending_list, pending);
+ pd->pendings = eina_list_remove(pd->pendings, pending);
object = eldbus_pending_data_get(pending, "object");
if (eldbus_message_error_get(msg, &error_name, &error_text))
@@ -382,114 +258,35 @@ _eldbus_model_object_introspect_cb(void *data,
ERR("Error getting arguments.");
return;
}
- EINA_SAFETY_ON_NULL_RETURN(xml);
+
+ if (!xml)
+ {
+ ERR("No XML.");
+ return ;
+ }
current_path = eldbus_object_path_get(object);
- EINA_SAFETY_ON_NULL_RETURN(current_path);
+ pd->introspection = eldbus_introspection_parse(xml);
DBG("(%p): introspect of bus = %s, path = %s =>\n%s", pd->obj, pd->bus, current_path, xml);
- pd->introspection = eldbus_introspection_parse(xml);
- EINA_SAFETY_ON_NULL_RETURN(pd->introspection);
-
_eldbus_model_object_introspect_nodes(pd, current_path, pd->introspection->nodes);
_eldbus_model_object_create_children(pd, object, pd->introspection->interfaces);
- if (eina_list_count(pd->pending_list) == 0)
- {
- Eina_List* i;
-
- pd->is_listed = EINA_TRUE;
- _Eldbus_Children_Slice_Promise* p;
- EINA_LIST_FOREACH(pd->children_promises, i, p)
- {
- Eina_Accessor* ac = efl_model_list_slice(pd->children_list, p->start, p->count);
- efl_promise_value_set(p->promise, ac, (Eina_Free_Cb)&eina_accessor_free);
- free(p);
- }
- pd->children_promises = eina_list_free(pd->children_promises);
-
- Efl_Promise *ep;
- EINA_LIST_FOREACH(pd->count_promises, i, ep)
- {
- unsigned *c = calloc(sizeof(unsigned), 1);
- *c = eina_list_count(pd->children_list);
- efl_promise_value_set(ep, c, free);
- }
- pd->count_promises = eina_list_free(pd->count_promises);
+ if (eina_list_count(pd->pendings) != 0) return ;
- }
-}
+ efl_event_callback_call(pd->obj, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, NULL);
-static void
-_eldbus_model_object_introspect_nodes(Eldbus_Model_Object_Data *pd, const char *current_path, Eina_List *nodes)
-{
- Eina_List *it;
- Eldbus_Introspection_Node *node;
-
- EINA_SAFETY_ON_NULL_RETURN(pd);
- EINA_SAFETY_ON_NULL_RETURN(current_path);
-
- EINA_LIST_FOREACH(nodes, it, node)
- {
- const char *relative_path;
- char *absolute_path;
-
- relative_path = node->name;
- if (!relative_path) continue;
-
- absolute_path = _eldbus_model_object_concatenate_path(current_path, relative_path);
- if (!absolute_path) continue;
-
- _eldbus_model_object_introspect(pd, pd->bus, absolute_path);
-
- free(absolute_path);
- }
-}
-
-static char *
-_eldbus_model_object_concatenate_path(const char *root_path, const char *relative_path)
-{
- Eina_Strbuf *buffer;
- char *absolute_path = NULL;
- Eina_Bool ret;
-
- buffer = eina_strbuf_new();
- EINA_SAFETY_ON_NULL_RETURN_VAL(buffer, NULL);
-
- ret = eina_strbuf_append(buffer, root_path);
- if (strcmp(root_path, "/") != 0)
- ret = ret && eina_strbuf_append_char(buffer, '/');
- ret = ret && eina_strbuf_append(buffer, relative_path);
- EINA_SAFETY_ON_FALSE_GOTO(ret, free_buffer);
-
- absolute_path = eina_strbuf_string_steal(buffer);
-
-free_buffer:
- eina_strbuf_free(buffer);
- return absolute_path;
-}
+ pd->is_listed = EINA_TRUE;
-static void
-_eldbus_model_object_create_children(Eldbus_Model_Object_Data *pd, Eldbus_Object *object, Eina_List *interfaces)
-{
- Eldbus_Introspection_Interface *interface;
- Eina_List *it;
- const char *current_path;
-
- current_path = eldbus_object_path_get(object);
- EINA_SAFETY_ON_NULL_RETURN(current_path);
-
- EINA_LIST_FOREACH(interfaces, it, interface)
+ EINA_LIST_FREE(pd->requests, slice)
{
- Eo *child;
+ Eina_Value v;
- DBG("(%p) Creating child: bus = %s, path = %s, interface = %s", pd->obj, pd->bus, current_path, interface->name);
-
- // TODO: increment reference to keep 'interface' in memory
- child = efl_add_ref(ELDBUS_MODEL_PROXY_CLASS, pd->obj, eldbus_model_proxy_constructor(efl_added, object, interface));
+ v = efl_model_list_value_get(pd->childrens, slice->start, slice->count);
+ eina_promise_resolve(slice->p, v);
- pd->children_list = eina_list_append(pd->children_list, child);
+ free(slice);
}
}
diff --git a/src/lib/eldbus/eldbus_model_object.eo b/src/lib/eldbus/eldbus_model_object.eo
index e3fea3f38e..2931621d62 100644
--- a/src/lib/eldbus/eldbus_model_object.eo
+++ b/src/lib/eldbus/eldbus_model_object.eo
@@ -1,63 +1,20 @@
-import eldbus_types;
-
-class Eldbus.Model.Object (Efl.Object, Efl.Model) {
+class Eldbus.Model.Object (Eldbus.Model) {
[[Eldbus model object class]]
data: Eldbus_Model_Object_Data;
methods {
- constructor {
- [[Custom Eldbus_Model_Object constructor.
-
- @since 1.16]]
- params {
- @in type: Eldbus.Connection.Type; [[The connection type]]
- @in address: string; [[Remote address of DBus]]
- @in private_: bool; [[Non shared DBus connection]]
- @in bus: string; [[DBus Name or unique-id]]
- @in path: string; [[DBus path]]
- }
- }
- connection_constructor {
- [[Custom Eldbus_Model_Object connection_constructor.
-
- @since 1.16]]
- params {
- @in connection: ptr(Eldbus.Connection); [[Eldbus connection]]
- @in bus: string; [[DBus Name or unique-id]]
- @in path: string; [[DBus path]]
- }
- }
- @property type {
- [[Connection type]]
- get { }
- values {
- type: Eldbus.Connection.Type; [[Connection type]]
- }
- }
- @property address {
- [[Remote address of DBus]]
- get { }
- values {
- address: string; [[Address]]
- }
- }
- @property private {
- [[Indicate if the DBus connection is shared or private]]
- get { }
- values {
- private_: bool; [[Private DBus connection]]
- }
- }
- @property bus {
+ @property bus {
[[DBus Name or unique-id]]
get { }
+ set { }
values {
bus: string; [[DBus name]]
}
}
- @property path {
+ @property path {
[[DBus path]]
get { }
+ set { }
values {
path: string; [[DBus path]]
}
@@ -65,17 +22,10 @@ class Eldbus.Model.Object (Efl.Object, Efl.Model) {
}
implements {
Efl.Object.constructor;
+ Efl.Object.finalize;
+ Efl.Object.invalidate;
Efl.Object.destructor;
- Efl.Model.properties { get; }
- Efl.Model.property_set;
- Efl.Model.property_get;
- Efl.Model.child_add;
- Efl.Model.child_del;
Efl.Model.children_slice_get;
- Efl.Model.children_count_get;
- }
- constructors {
- .constructor;
- .connection_constructor;
+ Efl.Model.children_count { get; }
}
}
diff --git a/src/lib/eldbus/eldbus_model_object_private.h b/src/lib/eldbus/eldbus_model_object_private.h
index 4330a2ffb9..6ea2877b37 100644
--- a/src/lib/eldbus/eldbus_model_object_private.h
+++ b/src/lib/eldbus/eldbus_model_object_private.h
@@ -12,22 +12,18 @@ typedef struct _Eldbus_Model_Object_Data Eldbus_Model_Object_Data;
struct _Eldbus_Model_Object_Data
{
Eo *obj;
- Eina_Bool is_listed : 1;
- Eldbus_Connection *connection;
- Eina_List *object_list;
- Eina_Array *properties_array;
- Eina_List *children_list;
- Eina_List *children_promises;
- Eina_List *count_promises;
- Eldbus_Connection_Type type;
- Eina_Stringshare *address;
- bool private;
+
+ Eina_List *objects;
+ Eina_List *childrens;
+ Eina_List *requests;
+ Eina_List *pendings;
+
Eina_Stringshare *bus;
Eina_Stringshare *path;
- char *unique_name;
- Eina_List *pending_list;
+
Eldbus_Introspection_Node *introspection;
+
+ Eina_Bool is_listed : 1;
};
#endif
-
diff --git a/src/lib/eldbus/eldbus_model_private.h b/src/lib/eldbus/eldbus_model_private.h
index 0487b3e341..3f6685921b 100644
--- a/src/lib/eldbus/eldbus_model_private.h
+++ b/src/lib/eldbus/eldbus_model_private.h
@@ -8,24 +8,43 @@
#include <Eo.h>
#include <Efl.h>
-typedef struct _Eldbus_Children_Slice_Promise _Eldbus_Children_Slice_Promise;
+#include "ecore_internal.h"
+
+typedef struct _Eldbus_Children_Slice_Promise Eldbus_Children_Slice_Promise;
+typedef struct _Eldbus_Model_Data Eldbus_Model_Data;
+
struct _Eldbus_Children_Slice_Promise
{
- unsigned start;
- unsigned count;
- Efl_Promise* promise;
+ Eina_Promise *p;
+
+ unsigned int start;
+ unsigned int count;
};
-typedef struct _Eldbus_Property_Promise _Eldbus_Property_Promise;
-struct _Eldbus_Property_Promise
+struct _Eldbus_Model_Data
{
- char *property;
- Efl_Promise* promise;
+ Eldbus_Connection *connection;
+ Eldbus_Connection_Type type;
+
+ Eina_Stringshare *address;
+ Eina_Stringshare *unique_name;
+
+ Eina_Bool private : 1;
+
+ Eina_Bool is_listed : 1;
};
+#define UNIQUE_NAME_PROPERTY "unique_name"
+
/* logging support */
extern int eldbus_model_log_dom;
+static inline void
+_eldbus_eina_promise_cancel(void *data EINA_UNUSED,
+ const Eina_Promise *dead_ptr EINA_UNUSED)
+{
+}
+
#define ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(exp, promise, err, v) \
do \
{ \
diff --git a/src/lib/eldbus/eldbus_model_proxy.c b/src/lib/eldbus/eldbus_model_proxy.c
index 9b5fa888c3..c1ab3b2565 100644
--- a/src/lib/eldbus/eldbus_model_proxy.c
+++ b/src/lib/eldbus/eldbus_model_proxy.c
@@ -10,40 +10,96 @@
#define MY_CLASS ELDBUS_MODEL_PROXY_CLASS
#define MY_CLASS_NAME "Eldbus_Model_Proxy"
-static Eina_Bool _eldbus_model_proxy_load(Eldbus_Model_Proxy_Data *);
-static void _eldbus_model_proxy_unload(Eldbus_Model_Proxy_Data *);
static void _eldbus_model_proxy_property_get_all_cb(void *, const Eldbus_Message *, Eldbus_Pending *);
static void _eldbus_model_proxy_property_set_cb(void *, const Eldbus_Message *, Eldbus_Pending *);
static void _eldbus_model_proxy_property_set_load_cb(void *, const Eldbus_Message *, Eldbus_Pending *);
static void _eldbus_model_proxy_start_monitor(Eldbus_Model_Proxy_Data *);
-static void _eldbus_model_proxy_stop_monitor(Eldbus_Model_Proxy_Data *);
static void _eldbus_model_proxy_property_changed_cb(void *, Eldbus_Proxy *, void *);
static void _eldbus_model_proxy_property_invalidated_cb(void *, Eldbus_Proxy *, void *);
-static bool _eldbus_model_proxy_is_property_writeable(Eldbus_Model_Proxy_Data *, const char *);
-static bool _eldbus_model_proxy_has_property(Eldbus_Model_Proxy_Data *, const char *);
-static bool _eldbus_model_proxy_is_property_readable(Eldbus_Model_Proxy_Data *, const char *);
static const char *_eldbus_model_proxy_property_type_get(Eldbus_Model_Proxy_Data *, const char *);
static void _eldbus_model_proxy_create_methods_children(Eldbus_Model_Proxy_Data *);
static void _eldbus_model_proxy_create_signals_children(Eldbus_Model_Proxy_Data *);
typedef struct _Eldbus_Model_Proxy_Property_Set_Data Eldbus_Model_Proxy_Property_Set_Data;
+typedef struct _Eldbus_Property_Promise Eldbus_Property_Promise;
struct _Eldbus_Model_Proxy_Property_Set_Data
{
Eldbus_Model_Proxy_Data *pd;
+
Eina_Stringshare *property;
- Eina_Value value;
- Efl_Promise *promise;
+ Eina_Promise *promise;
+ Eina_Value *value;
+};
+
+struct _Eldbus_Property_Promise
+{
+ Eina_Promise *promise;
+ Eina_Stringshare *property;
};
-static Eldbus_Model_Proxy_Property_Set_Data * _eldbus_model_proxy_property_set_data_new(Eldbus_Model_Proxy_Data *, const char *, const Eina_Value *, Efl_Promise *promise);
static void _eldbus_model_proxy_property_set_data_free(Eldbus_Model_Proxy_Property_Set_Data *);
+static Eina_Bool
+_eldbus_model_proxy_load(Eldbus_Model_Proxy_Data *pd)
+{
+ Eldbus_Introspection_Property *property;
+ Eina_List *it;
+
+ if (pd->proxy)
+ return EINA_TRUE;
+
+ pd->proxy = eldbus_proxy_get(pd->object, pd->name);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(pd->proxy, EINA_FALSE);
+
+ EINA_LIST_FOREACH(pd->interface->properties, it, property)
+ {
+ const Eina_Value_Type *type;
+ Eina_Stringshare *name;
+ Eina_Value *value;
+
+ type = _dbus_type_to_eina_value_type(property->type[0]);
+ name = eina_stringshare_add(property->name);
+ value = eina_value_new(type);
+
+ eina_hash_direct_add(pd->properties, name, value);
+ }
+
+ return EINA_TRUE;
+}
+
static void
-_eldbus_model_proxy_hash_free(Eina_Value *value)
+_eldbus_model_proxy_unload(Eldbus_Model_Proxy_Data *pd)
{
- eina_value_free(value);
+ Eldbus_Pending *pending;
+
+ EINA_LIST_FREE(pd->pendings, pending)
+ eldbus_pending_cancel(pending);
+
+ if (pd->monitoring)
+ {
+ eldbus_proxy_event_callback_del(pd->proxy,
+ ELDBUS_PROXY_EVENT_PROPERTY_CHANGED,
+ _eldbus_model_proxy_property_changed_cb,
+ pd);
+ eldbus_proxy_event_callback_del(pd->proxy,
+ ELDBUS_PROXY_EVENT_PROPERTY_REMOVED,
+ _eldbus_model_proxy_property_invalidated_cb,
+ pd);
+ }
+ pd->monitoring = EINA_FALSE;
+
+ if (pd->proxy) eldbus_proxy_unref(pd->proxy);
+ pd->proxy = NULL;
+}
+
+static void
+_eldbus_model_proxy_object_del(void *data, Eldbus_Object *object EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Eldbus_Model_Proxy_Data *pd = data;
+
+ pd->object = NULL;
}
static Efl_Object*
@@ -52,228 +108,306 @@ _eldbus_model_proxy_efl_object_constructor(Eo *obj, Eldbus_Model_Proxy_Data *pd)
obj = efl_constructor(efl_super(obj, MY_CLASS));
pd->obj = obj;
- pd->object = NULL;
- pd->proxy = NULL;
- pd->is_listed = pd->is_loaded = EINA_FALSE;
- pd->properties_array = NULL;
- pd->properties_hash = eina_hash_string_superfast_new(EINA_FREE_CB(_eldbus_model_proxy_hash_free));
- pd->children_list = NULL;
- pd->name = NULL;
- pd->pending_list = NULL;
- pd->promise_list = NULL;
- pd->monitoring = false;
- pd->interface = NULL;
+ pd->properties = eina_hash_stringshared_new(NULL);
return obj;
}
-static void
-_eldbus_model_proxy_constructor(Eo *obj EINA_UNUSED,
- Eldbus_Model_Proxy_Data *pd,
- Eldbus_Object *object,
- const Eldbus_Introspection_Interface *interface)
+static Efl_Object*
+_eldbus_model_proxy_efl_object_finalize(Eo *obj, Eldbus_Model_Proxy_Data *pd)
{
- EINA_SAFETY_ON_NULL_RETURN(object);
- EINA_SAFETY_ON_NULL_RETURN(interface);
+ if (!pd->object ||
+ !pd->name ||
+ !pd->interface)
+ return NULL;
+
+ if (!_eldbus_model_proxy_load(pd)) return NULL;
+
+ if (!eldbus_model_connection_get(obj))
+ eldbus_model_connection_set(obj, eldbus_object_connection_get(pd->object));
+ eldbus_object_event_callback_add(pd->object, ELDBUS_OBJECT_EVENT_DEL, _eldbus_model_proxy_object_del, pd);
+
+ return efl_finalize(efl_super(obj, MY_CLASS));
+}
+
+static void
+_eldbus_model_proxy_object_set(Eo *obj EINA_UNUSED,
+ Eldbus_Model_Proxy_Data *pd,
+ Eldbus_Object *object)
+{
pd->object = eldbus_object_ref(object);
+}
+
+static void
+_eldbus_model_proxy_interface_set(Eo *obj EINA_UNUSED,
+ Eldbus_Model_Proxy_Data *pd,
+ const Eldbus_Introspection_Interface *interface)
+{
pd->name = eina_stringshare_add(interface->name);
pd->interface = interface;
}
static void
-_eldbus_model_proxy_efl_object_destructor(Eo *obj, Eldbus_Model_Proxy_Data *pd)
+_eldbus_model_proxy_efl_object_invalidate(Eo *obj, Eldbus_Model_Proxy_Data *pd)
{
+ Eo *child;
+
+ EINA_LIST_FREE(pd->childrens, child)
+ efl_unref(child);
+
_eldbus_model_proxy_unload(pd);
- eina_hash_free(pd->properties_hash);
+ if (pd->object)
+ {
+ eldbus_object_event_callback_del(pd->object, ELDBUS_OBJECT_EVENT_DEL, _eldbus_model_proxy_object_del, pd);
+ eldbus_object_unref(pd->object);
+ }
+
+ efl_invalidate(efl_super(obj, MY_CLASS));
+}
+
+static void
+_eldbus_model_proxy_efl_object_destructor(Eo *obj, Eldbus_Model_Proxy_Data *pd)
+{
+ Eina_Hash_Tuple *tuple;
+ Eina_Iterator *it;
+
+ it = eina_hash_iterator_tuple_new(pd->properties);
+ EINA_ITERATOR_FOREACH(it, tuple)
+ {
+ Eina_Stringshare *property = tuple->key;
+ Eina_Value *value = tuple->data;
+
+ eina_stringshare_del(property);
+ eina_value_free(value);
+ }
+ eina_iterator_free(it);
+ eina_hash_free(pd->properties);
eina_stringshare_del(pd->name);
- eldbus_object_unref(pd->object);
efl_destructor(efl_super(obj, MY_CLASS));
}
-static Eina_Array const *
-_eldbus_model_proxy_efl_model_properties_get(Eo *obj EINA_UNUSED,
- Eldbus_Model_Proxy_Data *pd)
+static Eina_Array *
+_eldbus_model_proxy_efl_model_properties_get(const Eo *obj EINA_UNUSED,
+ Eldbus_Model_Proxy_Data *pd)
{
- Eina_Bool ret;
+ Eina_Iterator *it;
+ Eina_Array *r;
+ Eina_Stringshare *property;
+
+ r = eina_array_new(4);
+
+ it = eina_hash_iterator_key_new(pd->properties);
+ EINA_ITERATOR_FOREACH(it, property)
+ eina_array_push(r, property);
+ eina_iterator_free(it);
+
+ return r;
+}
+
+#define PROPERTY_EXIST 1
+#define PROPERTY_READ 2
+#define PROPERTY_WRITE 4
- EINA_SAFETY_ON_NULL_RETURN_VAL(pd, NULL);
+static unsigned char
+eldbus_model_proxy_property_check(Eldbus_Model_Proxy_Data *pd,
+ const char *property)
+{
+ Eldbus_Introspection_Property *property_introspection =
+ eldbus_introspection_property_find(pd->interface->properties, property);
+ unsigned char r = 0;
+
+ if (property_introspection == NULL)
+ {
+ WRN("Property not found: %s", property);
+ return 0;
+ }
+
+ r = PROPERTY_EXIST;
+ // Check read access
+ if (property_introspection->access == ELDBUS_INTROSPECTION_PROPERTY_ACCESS_READ ||
+ property_introspection->access == ELDBUS_INTROSPECTION_PROPERTY_ACCESS_READWRITE)
+ r |= PROPERTY_READ;
+ // Check write access
+ if (property_introspection->access == ELDBUS_INTROSPECTION_PROPERTY_ACCESS_WRITE ||
+ property_introspection->access == ELDBUS_INTROSPECTION_PROPERTY_ACCESS_READWRITE)
+ r |= PROPERTY_WRITE;
+
+ return r;
+}
- ret = _eldbus_model_proxy_load(pd);
- if (!ret) return NULL;
+static void
+_eldbus_model_proxy_cancel_cb(void *data,
+ const Eina_Promise *dead_promise EINA_UNUSED)
+{
+ Eldbus_Model_Proxy_Property_Set_Data *sd = data;
- return pd->properties_array;
+ sd->promise = NULL;
}
-static Efl_Future*
+static Eldbus_Pending *
+_eldbus_model_proxy_load_all(Eldbus_Model_Proxy_Data *pd,
+ Eina_Promise *promise, const char *property,
+ Eldbus_Message_Cb callback,
+ void *data)
+{
+ Eldbus_Property_Promise *p;
+ Eldbus_Pending *pending = NULL;
+
+ p = calloc(1, sizeof(Eldbus_Property_Promise));
+ if (!p)
+ {
+ if (promise) eina_promise_reject(promise, ENOMEM);
+ return NULL;
+ }
+
+ p->promise = promise;
+ p->property = eina_stringshare_add(property);
+ pd->promises = eina_list_append(pd->promises, p);
+
+ if (!pd->pendings)
+ {
+ pending = eldbus_proxy_property_get_all(pd->proxy, callback, data);
+ }
+ return pending;
+}
+
+static Eina_Future *
_eldbus_model_proxy_efl_model_property_set(Eo *obj EINA_UNUSED,
- Eldbus_Model_Proxy_Data *pd,
- const char *property,
- Eina_Value const* value)
+ Eldbus_Model_Proxy_Data *pd,
+ const char *property,
+ Eina_Value *value)
{
Eldbus_Model_Proxy_Property_Set_Data *data;
const char *signature;
Eldbus_Pending *pending;
- Eina_Bool ret;
- Efl_Promise* promise = efl_add(EFL_PROMISE_CLASS, obj);
- Efl_Future* future = efl_promise_future_get(promise);
-
- ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(property, promise, EFL_MODEL_ERROR_INCORRECT_VALUE, future);
+ unsigned char access;
+ Eina_Error err = 0;
DBG("(%p): property=%s", obj, property);
- ret = _eldbus_model_proxy_load(pd);
- ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(ret, promise, EFL_MODEL_ERROR_INIT_FAILED, future);
- ret = _eldbus_model_proxy_has_property(pd, property);
- ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(ret, promise, EFL_MODEL_ERROR_NOT_FOUND, future);
-
- ret = _eldbus_model_proxy_is_property_writeable(pd, property);
- ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(ret, promise, EFL_MODEL_ERROR_READ_ONLY, future);
+ access = eldbus_model_proxy_property_check(pd, property);
+ err = EFL_MODEL_ERROR_NOT_FOUND;
+ if (!access) goto on_error;
+ err = EFL_MODEL_ERROR_READ_ONLY;
+ if (!(access & PROPERTY_WRITE)) goto on_error;
+ err = EFL_MODEL_ERROR_UNKNOWN;
signature = _eldbus_model_proxy_property_type_get(pd, property);
- ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(signature, promise, EFL_MODEL_ERROR_UNKNOWN, future);
+ if (!signature) goto on_error;
- data = _eldbus_model_proxy_property_set_data_new(pd, property, value, promise);
- ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(data, promise, EFL_MODEL_ERROR_UNKNOWN, future);
+ err = ENOMEM;
+ data = calloc(1, sizeof (Eldbus_Model_Proxy_Property_Set_Data));
+ if (!data) goto on_error;
+
+ data->pd = pd;
+ data->promise = eina_promise_new(efl_loop_future_scheduler_get(obj),
+ _eldbus_model_proxy_cancel_cb, data);
+ data->property = eina_stringshare_add(property);
+ if (!(data->value = eina_value_dup(value))) goto on_error;
if (!pd->is_loaded)
{
- _Eldbus_Property_Promise *p = calloc(1, sizeof(_Eldbus_Property_Promise));
- EINA_SAFETY_ON_NULL_RETURN_VAL(p, future);
-
- p->promise = promise;
- p->property = strdup(property);
- pd->promise_list = eina_list_append(pd->promise_list, p);
-
- if (!pd->pending_list)
- {
- pending = eldbus_proxy_property_get_all(pd->proxy, _eldbus_model_proxy_property_set_load_cb, data);
- pd->pending_list = eina_list_append(pd->pending_list, pending);
- }
- return future;
+ pending = _eldbus_model_proxy_load_all(pd, data->promise, property,
+ _eldbus_model_proxy_property_set_load_cb, data);
+ }
+ else
+ {
+ pending = eldbus_proxy_property_value_set(pd->proxy, property, signature, (Eina_Value*)value,
+ _eldbus_model_proxy_property_set_cb, data);
}
- pending = eldbus_proxy_property_value_set
- (pd->proxy, property, signature, (Eina_Value*)value, _eldbus_model_proxy_property_set_cb, data);
- pd->pending_list = eina_list_append(pd->pending_list, pending);
- return future;
+ if (pending) pd->pendings = eina_list_append(pd->pendings, pending);
+ return efl_future_Eina_FutureXXX_then(obj, eina_future_new(data->promise));
+
+ on_error:
+ return eina_future_rejected(efl_loop_future_scheduler_get(obj), err);
}
-static Efl_Future*
-_eldbus_model_proxy_efl_model_property_get(Eo *obj EINA_UNUSED,
- Eldbus_Model_Proxy_Data *pd,
- const char *property)
+static Eina_Value *
+_eldbus_model_proxy_efl_model_property_get(const Eo *obj EINA_UNUSED,
+ Eldbus_Model_Proxy_Data *pd,
+ const char *property)
{
- Eina_Bool ret;
- Eina_Value *promise_value;
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, obj);
- Efl_Future *future = efl_promise_future_get(promise);
+ Eldbus_Pending *pending;
+ unsigned char access;
+ Eina_Error err = 0;
- ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(property, promise, EFL_MODEL_ERROR_INCORRECT_VALUE, future);
+ access = eldbus_model_proxy_property_check(pd, property);
+ err = EFL_MODEL_ERROR_NOT_FOUND;
+ if (!access) goto on_error;
+ if (!(access & PROPERTY_READ)) goto on_error;
- ret = _eldbus_model_proxy_load(pd);
- ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(ret, promise, EFL_MODEL_ERROR_INIT_FAILED, future);
+ if (pd->is_loaded)
+ {
+ Eina_Stringshare *tmp;
+ Eina_Value *value;
- ret = _eldbus_model_proxy_has_property(pd, property);
- ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(ret, promise, EFL_MODEL_ERROR_NOT_FOUND, future);
+ err = EFL_MODEL_ERROR_NOT_FOUND;
+ tmp = eina_stringshare_add(property);
+ value = eina_hash_find(pd->properties, tmp);
+ eina_stringshare_del(tmp);
+ if (!value) goto on_error;
- if (!pd->is_loaded)
- {
- Eldbus_Pending *pending;
- _Eldbus_Property_Promise *p = calloc(1, sizeof(_Eldbus_Property_Promise));
- EINA_SAFETY_ON_NULL_RETURN_VAL(p, future);
-
- p->promise = promise;
- p->property = strdup(property);
- pd->promise_list = eina_list_append(pd->promise_list, p);
-
- if (!pd->pending_list)
- {
- pending = eldbus_proxy_property_get_all(pd->proxy, _eldbus_model_proxy_property_get_all_cb, pd);
- pd->pending_list = eina_list_append(pd->pending_list, pending);
- }
- return future;
+ return eina_value_dup(value);
}
- Eina_Value* value = eina_hash_find(pd->properties_hash, property);
- ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(value, promise, EFL_MODEL_ERROR_NOT_FOUND, future);
+ err = ENOMEM;
- ret = _eldbus_model_proxy_is_property_writeable(pd, property);
- ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(ret, promise, EFL_MODEL_ERROR_READ_ONLY, future);
+ pending = _eldbus_model_proxy_load_all(pd, NULL, property,
+ _eldbus_model_proxy_property_get_all_cb, pd);
+ if (pending) pd->pendings = eina_list_append(pd->pendings, pending);
+ else goto on_error;
- promise_value = eina_value_new(eina_value_type_get(value));
- eina_value_copy(value, promise_value);
- efl_promise_value_set(promise, promise_value, (Eina_Free_Cb)&eina_value_free);
- return future;
-}
+ return eina_value_error_new(EAGAIN);
-static Eo *
-_eldbus_model_proxy_efl_model_child_add(Eo *obj EINA_UNUSED,
- Eldbus_Model_Proxy_Data *pd EINA_UNUSED)
-{
- return NULL;
+ on_error:
+ return eina_value_error_new(err);
}
static void
-_eldbus_model_proxy_efl_model_child_del(Eo *obj EINA_UNUSED,
- Eldbus_Model_Proxy_Data *pd EINA_UNUSED,
- Eo *child EINA_UNUSED)
+_eldbus_model_proxy_listed(Eldbus_Model_Proxy_Data *pd)
{
-}
-
-static Efl_Future*
-_eldbus_model_proxy_efl_model_children_slice_get(Eo *obj EINA_UNUSED,
- Eldbus_Model_Proxy_Data *pd,
- unsigned start,
- unsigned count)
-{
- Eina_Bool ret = _eldbus_model_proxy_load(pd);
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, obj);
- Efl_Future *future = efl_promise_future_get(promise);
- ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(ret, promise, EFL_MODEL_ERROR_INIT_FAILED, future);
-
if (!pd->is_listed)
{
_eldbus_model_proxy_create_methods_children(pd);
_eldbus_model_proxy_create_signals_children(pd);
+
+ efl_event_callback_call(pd->obj, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, NULL);
pd->is_listed = EINA_TRUE;
}
-
- Eina_Accessor *ac = efl_model_list_slice(pd->children_list, start, count);
- efl_promise_value_set(promise, ac, (Eina_Free_Cb)&eina_accessor_free);
- return future;
}
-static Efl_Future*
-_eldbus_model_proxy_efl_model_children_count_get(Eo *obj EINA_UNUSED,
- Eldbus_Model_Proxy_Data *pd)
+static Eina_Future*
+_eldbus_model_proxy_efl_model_children_slice_get(Eo *obj EINA_UNUSED,
+ Eldbus_Model_Proxy_Data *pd,
+ unsigned start,
+ unsigned count)
{
- Eina_Bool ret = _eldbus_model_proxy_load(pd);
- Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, obj);
- Efl_Future *future = efl_promise_future_get(promise);
- ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(ret, promise, EFL_MODEL_ERROR_INIT_FAILED, future);
+ Eina_Value v;
- if (!pd->is_listed)
- {
- _eldbus_model_proxy_create_methods_children(pd);
- _eldbus_model_proxy_create_signals_children(pd);
- pd->is_listed = EINA_TRUE;
- }
+ _eldbus_model_proxy_listed(pd);
- unsigned int *c = calloc(sizeof(unsigned int), 1);
- *c = eina_list_count(pd->children_list);
- efl_promise_value_set(promise, c, free);
- return future;
+ v = efl_model_list_value_get(pd->childrens, start, count);
+ return eina_future_resolved(efl_loop_future_scheduler_get(obj), v);
+}
+
+static unsigned int
+_eldbus_model_proxy_efl_model_children_count_get(const Eo *obj EINA_UNUSED,
+ Eldbus_Model_Proxy_Data *pd)
+{
+ _eldbus_model_proxy_listed(pd);
+ return eina_list_count(pd->childrens);
}
static void
_eldbus_model_proxy_create_methods_children(Eldbus_Model_Proxy_Data *pd)
{
- Eina_List *it;
Eldbus_Introspection_Method *method;
+ Eina_List *it;
EINA_LIST_FOREACH(pd->interface->methods, it, method)
{
@@ -298,9 +432,13 @@ _eldbus_model_proxy_create_methods_children(Eldbus_Model_Proxy_Data *pd)
INF("(%p) Creating method child: bus = %s, path = %s, method = %s::%s",
pd->obj, bus, path, interface_name, method_name);
- child = efl_add(ELDBUS_MODEL_METHOD_CLASS, pd->obj, eldbus_model_method_constructor(efl_added, pd->proxy, method));
+ child = efl_add_ref(ELDBUS_MODEL_METHOD_CLASS, pd->obj,
+ eldbus_model_method_proxy_set(efl_added, pd->proxy),
+ eldbus_model_method_set(efl_added, method));
- pd->children_list = eina_list_append(pd->children_list, child);
+ if (child) pd->childrens = eina_list_append(pd->childrens, child);
+ else ERR("Could not create method child: bus = %s, path = %s method = %s::%s.",
+ bus, path, interface_name, method_name);
}
}
@@ -333,102 +471,27 @@ _eldbus_model_proxy_create_signals_children(Eldbus_Model_Proxy_Data *pd)
DBG("(%p) Creating signal child: bus = %s, path = %s, signal = %s::%s",
pd->obj, bus, path, interface_name, signal_name);
- child = efl_add(ELDBUS_MODEL_SIGNAL_CLASS, pd->obj, eldbus_model_signal_constructor(efl_added, pd->proxy, signal));
+ child = efl_add_ref(ELDBUS_MODEL_SIGNAL_CLASS, pd->obj, eldbus_model_signal_constructor(efl_added, pd->proxy, signal));
- pd->children_list = eina_list_append(pd->children_list, child);
+ if (child) pd->childrens = eina_list_append(pd->childrens, child);
+ else ERR("Could not create signal child: bus = %s, path = %s signal = %s::%s.",
+ bus, path, interface_name, signal_name);
}
}
static const char *
-_eldbus_model_proxy_name_get(Eo *obj EINA_UNUSED, Eldbus_Model_Proxy_Data *pd)
+_eldbus_model_proxy_proxy_name_get(const Eo *obj EINA_UNUSED, Eldbus_Model_Proxy_Data *pd)
{
return pd->name;
}
-static Eina_Bool
-_eldbus_model_proxy_load(Eldbus_Model_Proxy_Data *pd)
-{
- Eldbus_Introspection_Property *property;
- Eina_List *it;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(pd, EINA_FALSE);
-
- if (pd->proxy)
- return EINA_TRUE;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(pd->object, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(pd->name, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(pd->interface, EINA_FALSE);
-
- pd->proxy = eldbus_proxy_get(pd->object, pd->name);
- EINA_SAFETY_ON_NULL_RETURN_VAL(pd->proxy, EINA_FALSE);
-
- const unsigned int properties_count = eina_list_count(pd->interface->properties);
-
- pd->properties_array = eina_array_new(properties_count);
- EINA_SAFETY_ON_NULL_RETURN_VAL(pd->properties_array, EINA_FALSE);
-
- if (!properties_count) return EINA_TRUE;
-
- EINA_LIST_FOREACH(pd->interface->properties, it, property)
- {
- Eina_Stringshare *name;
- Eina_Bool ret;
-
- name = eina_stringshare_add(property->name);
- ret = eina_array_push(pd->properties_array, name);
- EINA_SAFETY_ON_FALSE_RETURN_VAL(ret, EINA_FALSE);
- }
-
- return EINA_TRUE;
-}
-
-static void
-_eldbus_model_proxy_unload(Eldbus_Model_Proxy_Data *pd)
-{
- Eldbus_Pending *pending;
- Eo *child;
-
- EINA_SAFETY_ON_NULL_RETURN(pd);
-
- EINA_LIST_FREE(pd->children_list, child)
- efl_unref(child);
-
- EINA_LIST_FREE(pd->pending_list, pending)
- {
- eldbus_pending_cancel(pending);
- }
-
- if (pd->properties_array)
- {
- unsigned int i;
- Eina_Stringshare *property;
- Eina_Array_Iterator it;
-
- EINA_ARRAY_ITER_NEXT(pd->properties_array, i, property, it)
- eina_stringshare_del(property);
- eina_array_free(pd->properties_array);
- pd->properties_array = NULL;
- }
-
- eina_hash_free_buckets(pd->properties_hash);
-
- _eldbus_model_proxy_stop_monitor(pd);
-
- if (pd->proxy)
- {
- eldbus_proxy_unref(pd->proxy);
- pd->proxy = NULL;
- }
-}
-
static void
_eldbus_model_proxy_start_monitor(Eldbus_Model_Proxy_Data *pd)
{
if (pd->monitoring)
return;
- pd->monitoring = true;
+ pd->monitoring = EINA_TRUE;
eldbus_proxy_event_callback_add(pd->proxy,
ELDBUS_PROXY_EVENT_PROPERTY_CHANGED,
@@ -442,25 +505,6 @@ _eldbus_model_proxy_start_monitor(Eldbus_Model_Proxy_Data *pd)
}
static void
-_eldbus_model_proxy_stop_monitor(Eldbus_Model_Proxy_Data *pd)
-{
- if (!pd->monitoring)
- return;
-
- pd->monitoring = false;
-
- eldbus_proxy_event_callback_del(pd->proxy,
- ELDBUS_PROXY_EVENT_PROPERTY_CHANGED,
- _eldbus_model_proxy_property_changed_cb,
- pd);
-
- eldbus_proxy_event_callback_del(pd->proxy,
- ELDBUS_PROXY_EVENT_PROPERTY_REMOVED,
- _eldbus_model_proxy_property_invalidated_cb,
- pd);
-}
-
-static void
_eldbus_model_proxy_property_changed_cb(void *data,
Eldbus_Proxy *proxy EINA_UNUSED,
void *event_info)
@@ -470,13 +514,13 @@ _eldbus_model_proxy_property_changed_cb(void *data,
Eina_Value *prop_value;
Eina_Bool ret;
- prop_value = eina_hash_find(pd->properties_hash, event->name);
+ prop_value = eina_hash_find(pd->properties, event->name);
if (!prop_value) return ;
ret = eina_value_copy(event->value, prop_value);
if (!ret) return ;
- efl_model_property_changed_notify(pd->obj, event->name);
+ efl_model_properties_changed(pd->obj, event->name);
}
static void
@@ -493,11 +537,9 @@ _eldbus_model_proxy_property_invalidated_cb(void *data,
static Eina_Array *
_eldbus_model_proxy_property_get_all_load(const Eldbus_Message *msg, Eldbus_Model_Proxy_Data *pd)
{
- Eldbus_Introspection_Property *prop;
Eldbus_Message_Iter *values = NULL;
Eldbus_Message_Iter *entry;
Eina_Array *changed_properties;
- Eina_List *it;
const char *error_name, *error_text;
if (eldbus_message_error_get(msg, &error_name, &error_text))
@@ -512,20 +554,10 @@ _eldbus_model_proxy_property_get_all_load(const Eldbus_Message *msg, Eldbus_Mode
return NULL;
}
- EINA_LIST_FOREACH(pd->interface->properties, it, prop)
- {
- const Eina_Value_Type *type;
- Eina_Value *value;
-
- type = _dbus_type_to_eina_value_type(prop->type[0]);
- value = eina_value_new(type);
-
- eina_hash_add(pd->properties_hash, prop->name, value);
- }
-
changed_properties = eina_array_new(1);
while (eldbus_message_iter_get_and_next(values, 'e', &entry))
{
+ Eina_Stringshare *tmp;
const char *property;
Eldbus_Message_Iter *variant;
Eina_Value *struct_value;
@@ -537,22 +569,24 @@ _eldbus_model_proxy_property_get_all_load(const Eldbus_Message *msg, Eldbus_Mode
continue;
struct_value = eldbus_message_iter_struct_like_to_eina_value(variant);
- EINA_SAFETY_ON_NULL_GOTO(struct_value, on_error);
+ if (!struct_value) goto on_error;
ret = eina_value_struct_value_get(struct_value, "arg0", &arg0);
eina_value_free(struct_value);
- EINA_SAFETY_ON_FALSE_GOTO(ret, on_error);
+ if (!ret) goto on_error;
- prop_value = eina_hash_find(pd->properties_hash, property);
- EINA_SAFETY_ON_NULL_GOTO(prop_value, on_error);
+ tmp = eina_stringshare_add(property);
+ prop_value = eina_hash_find(pd->properties, tmp);
+ eina_stringshare_del(tmp);
+ if (!prop_value) goto on_error;
ret = eina_value_copy(&arg0, prop_value);
- EINA_SAFETY_ON_FALSE_GOTO(ret, on_error);
+ if (!ret) goto on_error;
eina_value_flush(&arg0);
ret = eina_array_push(changed_properties, property);
- EINA_SAFETY_ON_FALSE_GOTO(ret, on_error);
+ if (!ret) goto on_error;
}
pd->is_loaded = EINA_TRUE;
@@ -564,97 +598,73 @@ _eldbus_model_proxy_property_get_all_load(const Eldbus_Message *msg, Eldbus_Mode
}
static void
+_eldbus_model_proxy_promise_clean(Eldbus_Property_Promise* p,
+ Eina_Error err)
+{
+ if (p->promise) eina_promise_reject(p->promise, err);
+ eina_stringshare_del(p->property);
+ free(p);
+}
+
+static void
_eldbus_model_proxy_property_get_all_cb(void *data,
const Eldbus_Message *msg,
Eldbus_Pending *pending)
{
- Eina_Value *promise_value;
Eldbus_Model_Proxy_Data *pd = (Eldbus_Model_Proxy_Data*)data;
+ Eldbus_Property_Promise* p;
+ Eina_Array *properties;
+ Efl_Model_Property_Event evt;
- pd->pending_list = eina_list_remove(pd->pending_list, pending);
- Eina_Array *changed_properties = _eldbus_model_proxy_property_get_all_load(msg, pd);
- if (changed_properties == NULL)
- {
- Eina_List* i;
- _Eldbus_Property_Promise* p;
- EINA_LIST_FOREACH(pd->promise_list, i, p)
- {
- efl_promise_failed_set(p->promise, EFL_MODEL_ERROR_NOT_FOUND);
- free(p->property);
- }
- eina_list_free(pd->promise_list);
- return;
- }
+ pd->pendings = eina_list_remove(pd->pendings, pending);
- Eina_List* i;
- _Eldbus_Property_Promise* p;
- EINA_LIST_FOREACH(pd->promise_list, i, p)
+ properties = _eldbus_model_proxy_property_get_all_load(msg, pd);
+ if (!properties)
{
- Eina_Value* value = eina_hash_find(pd->properties_hash, p->property);
- if (!value)
- {
- efl_promise_failed_set(p->promise, EFL_MODEL_ERROR_NOT_FOUND);
- free(p->property);
- continue;
- }
-
- if (!_eldbus_model_proxy_is_property_readable(pd, p->property))
- {
- efl_promise_failed_set(p->promise, EFL_MODEL_ERROR_READ_ONLY);
- free(p->property);
- continue;
- }
-
- free(p->property);
-
- promise_value = eina_value_new(eina_value_type_get(value));
- eina_value_copy(value, promise_value);
- efl_promise_value_set(p->promise, promise_value, (Eina_Free_Cb)&eina_value_free);
+ EINA_LIST_FREE(pd->promises, p)
+ _eldbus_model_proxy_promise_clean(p, EFL_MODEL_ERROR_NOT_FOUND);
+ return ;
}
- eina_list_free(pd->promise_list);
+ EINA_LIST_FREE(pd->promises, p)
+ _eldbus_model_proxy_promise_clean(p, EFL_MODEL_ERROR_READ_ONLY);
_eldbus_model_proxy_start_monitor(pd);
- if (eina_array_count(changed_properties))
- {
- Efl_Model_Property_Event evt = {
- .changed_properties = changed_properties
- };
-
- efl_event_callback_call(pd->obj, EFL_MODEL_EVENT_PROPERTIES_CHANGED, &evt);
- }
-
- eina_array_free(changed_properties);
+ evt.changed_properties = properties;
+ efl_event_callback_call(pd->obj, EFL_MODEL_EVENT_PROPERTIES_CHANGED, &evt);
+ eina_array_free(properties);
}
static void
_eldbus_model_proxy_property_set_load_cb(void *data,
- const Eldbus_Message *msg,
- Eldbus_Pending *pending)
+ const Eldbus_Message *msg,
+ Eldbus_Pending *pending)
{
Eldbus_Model_Proxy_Property_Set_Data *set_data = (Eldbus_Model_Proxy_Property_Set_Data *)data;
Eldbus_Model_Proxy_Data *pd = set_data->pd;
+ Eina_Array *properties;
const char *signature;
- pd->pending_list = eina_list_remove(pd->pending_list, pending);
+ pd->pendings = eina_list_remove(pd->pendings, pending);
+
signature = _eldbus_model_proxy_property_type_get(pd, set_data->property);
- Eina_Array *changed_properties = _eldbus_model_proxy_property_get_all_load(msg, pd);
- if (signature == NULL || changed_properties == NULL)
+ properties = _eldbus_model_proxy_property_get_all_load(msg, pd);
+ if (!signature || !properties)
{
- efl_promise_failed_set(set_data->promise, EFL_MODEL_ERROR_UNKNOWN);
-
- eina_array_free(changed_properties);
- _eldbus_model_proxy_property_set_data_free(set_data);
+ eina_promise_reject(set_data->promise, EFL_MODEL_ERROR_UNKNOWN);
+ eina_array_free(properties);
+ _eldbus_model_proxy_property_set_data_free(set_data);
return;
}
- eina_array_free(changed_properties);
- pending = eldbus_proxy_property_value_set
- (pd->proxy, set_data->property, signature, &set_data->value, _eldbus_model_proxy_property_set_cb, set_data);
- pd->pending_list = eina_list_append(pd->pending_list, pending);
+ eina_array_free(properties);
+ pending = eldbus_proxy_property_value_set(pd->proxy, set_data->property,
+ signature, set_data->value,
+ _eldbus_model_proxy_property_set_cb, set_data);
+ pd->pendings = eina_list_append(pd->pendings, pending);
}
@@ -663,95 +673,42 @@ _eldbus_model_proxy_property_set_cb(void *data,
const Eldbus_Message *msg,
Eldbus_Pending *pending)
{
- Eldbus_Model_Proxy_Property_Set_Data *property_set_data = (Eldbus_Model_Proxy_Property_Set_Data *)data;
- Eldbus_Model_Proxy_Data *pd = property_set_data->pd;
+ Eldbus_Model_Proxy_Property_Set_Data *sd = (Eldbus_Model_Proxy_Property_Set_Data *)data;
+ Eldbus_Model_Proxy_Data *pd = sd->pd;
const char *error_name, *error_text;
- Eina_Value *prop_value;
- Eina_Value *promise_value;
+ Eina_Value *value;
- pd->pending_list = eina_list_remove(pd->pending_list, pending);
+ pd->pendings = eina_list_remove(pd->pendings, pending);
if (eldbus_message_error_get(msg, &error_name, &error_text))
{
ERR("%s: %s", error_name, error_text);
- efl_promise_failed_set(property_set_data->promise, EFL_MODEL_ERROR_UNKNOWN);
- _eldbus_model_proxy_property_set_data_free(property_set_data);
- return;
+ eina_promise_reject(sd->promise, EFL_MODEL_ERROR_UNKNOWN);
+ goto end;
}
- prop_value = eina_hash_find(pd->properties_hash, property_set_data->property);
- if (prop_value != NULL)
+ value = eina_hash_find(pd->properties, sd->property);
+ if (value)
{
- if (eina_value_copy(&property_set_data->value, prop_value))
- {
- Efl_Model_Property_Event evt = {
- .changed_properties = pd->properties_array
- };
-
- efl_event_callback_call(pd->obj, EFL_MODEL_EVENT_PROPERTIES_CHANGED, &evt);
- efl_model_property_changed_notify(pd->obj, property_set_data->property);
-
- }
- promise_value = eina_value_new(eina_value_type_get(prop_value));
- eina_value_copy(prop_value, promise_value);
- efl_promise_value_set(property_set_data->promise, promise_value, (Eina_Free_Cb)&eina_value_free);
+ efl_model_properties_changed(pd->obj, sd->property);
+ if (sd->promise)
+ eina_promise_resolve(sd->promise,
+ eina_value_reference_copy(value));
}
else
{
- efl_promise_failed_set(property_set_data->promise, EFL_MODEL_ERROR_NOT_FOUND);
- }
-
- _eldbus_model_proxy_property_set_data_free(property_set_data);
-}
-
-static bool
-_eldbus_model_proxy_has_property(Eldbus_Model_Proxy_Data *pd, const char *property)
-{
- Eldbus_Introspection_Property *property_introspection =
- eldbus_introspection_property_find(pd->interface->properties, property);
-
- if (property_introspection == NULL)
- {
- return false;
- }
-
- return true;
-}
-
-static bool
-_eldbus_model_proxy_is_property_writeable(Eldbus_Model_Proxy_Data *pd, const char *property)
-{
- Eldbus_Introspection_Property *property_introspection =
- eldbus_introspection_property_find(pd->interface->properties, property);
-
- if (property_introspection == NULL)
- {
- WRN("Property not found: %s", property);
- return false;
- }
-
- return ELDBUS_INTROSPECTION_PROPERTY_ACCESS_WRITE == property_introspection->access
- || ELDBUS_INTROSPECTION_PROPERTY_ACCESS_READWRITE == property_introspection->access;
-}
-
-static bool
-_eldbus_model_proxy_is_property_readable(Eldbus_Model_Proxy_Data *pd, const char *property)
-{
- Eldbus_Introspection_Property *property_introspection =
- eldbus_introspection_property_find(pd->interface->properties, property);
-
- if (property_introspection == NULL)
- {
- WRN("Property not found: %s", property);
- return false;
+ if (sd->promise)
+ eina_promise_reject(sd->promise,
+ EFL_MODEL_ERROR_NOT_FOUND);
}
- return ELDBUS_INTROSPECTION_PROPERTY_ACCESS_READ == property_introspection->access
- || ELDBUS_INTROSPECTION_PROPERTY_ACCESS_READWRITE == property_introspection->access;
+ end:
+ _eldbus_model_proxy_property_set_data_free(sd);
}
static const char *
-_eldbus_model_proxy_property_type_get(Eldbus_Model_Proxy_Data *pd, const char *property)
+_eldbus_model_proxy_property_type_get(Eldbus_Model_Proxy_Data *pd,
+ const char *property)
{
Eldbus_Introspection_Property *property_introspection =
eldbus_introspection_property_find(pd->interface->properties, property);
@@ -765,35 +722,12 @@ _eldbus_model_proxy_property_type_get(Eldbus_Model_Proxy_Data *pd, const char *p
return property_introspection->type;
}
-static Eldbus_Model_Proxy_Property_Set_Data *
-_eldbus_model_proxy_property_set_data_new(Eldbus_Model_Proxy_Data *pd,
- const char *property,
- const Eina_Value *value,
- Efl_Promise *promise)
-{
- Eldbus_Model_Proxy_Property_Set_Data *data = calloc(1, sizeof(Eldbus_Model_Proxy_Property_Set_Data));
- EINA_SAFETY_ON_NULL_RETURN_VAL(data, NULL);
-
- data->pd = pd;
- data->promise = promise;
- data->property = eina_stringshare_add(property);
- if (!eina_value_copy(value, &data->value))
- goto error;
-
- return data;
-
- error:
- eina_stringshare_del(data->property);
- free(data);
- return NULL;
-}
-
static void
_eldbus_model_proxy_property_set_data_free(Eldbus_Model_Proxy_Property_Set_Data *data)
{
EINA_SAFETY_ON_NULL_RETURN(data);
eina_stringshare_del(data->property);
- eina_value_flush(&data->value);
+ eina_value_free(data->value);
free(data);
}
diff --git a/src/lib/eldbus/eldbus_model_proxy.eo b/src/lib/eldbus/eldbus_model_proxy.eo
index 31221ca742..0bb8b3ee1c 100644
--- a/src/lib/eldbus/eldbus_model_proxy.eo
+++ b/src/lib/eldbus/eldbus_model_proxy.eo
@@ -1,19 +1,24 @@
import eldbus_types;
-class Eldbus.Model.Proxy (Efl.Object, Efl.Model) {
+class Eldbus.Model.Proxy (Eldbus.Model) {
[[Eldbus model proxy class]]
methods {
- constructor {
- [[Custom Eldbus_Model_Proxy constructor.
-
- @since 1.16]]
- params {
- @in object: ptr(Eldbus.Object); [[Eldbus object]]
+ @property object {
+ [[Object]]
+ set {}
+ values {
+ object: ptr(Eldbus.Object); [[Eldbus object]]
+ }
+ }
+ @property interface {
+ [[Object]]
+ set {}
+ values {
@cref interface: Eldbus.Introspection.Interface; [[The introspected interface]]
}
}
- @property name {
+ @property proxy_name {
[[Proxy name]]
get {}
values {
@@ -23,16 +28,15 @@ class Eldbus.Model.Proxy (Efl.Object, Efl.Model) {
}
implements {
Efl.Object.constructor;
+ Efl.Object.finalize;
+ Efl.Object.invalidate;
Efl.Object.destructor;
Efl.Model.properties { get; }
- Efl.Model.property_set;
- Efl.Model.property_get;
- Efl.Model.child_add;
- Efl.Model.child_del;
+ Efl.Model.property { set; get; }
Efl.Model.children_slice_get;
- Efl.Model.children_count_get;
+ Efl.Model.children_count { get; }
}
constructors {
- .constructor;
+ .interface;
}
}
diff --git a/src/lib/eldbus/eldbus_model_proxy_private.h b/src/lib/eldbus/eldbus_model_proxy_private.h
index 293a1f5bac..940f778311 100644
--- a/src/lib/eldbus/eldbus_model_proxy_private.h
+++ b/src/lib/eldbus/eldbus_model_proxy_private.h
@@ -13,20 +13,21 @@ typedef struct _Eldbus_Model_Proxy_Data Eldbus_Model_Proxy_Data;
struct _Eldbus_Model_Proxy_Data
{
Eo *obj;
- Eina_Bool is_listed : 1;
- Eina_Bool is_loaded : 1;
+
+ const Eldbus_Introspection_Interface *interface;
+
Eldbus_Object *object;
Eldbus_Proxy *proxy;
- Eina_Array *properties_array;
- Eina_Hash *properties_hash;
- Eina_List *children_list;
+ Eina_Hash *properties;
+ Eina_List *childrens;
+ Eina_List *pendings;
+ Eina_List *promises;
+
Eina_Stringshare *name;
- Eina_List *pending_list;
- Eina_List *promise_list;
- bool monitoring;
- const Eldbus_Introspection_Interface *interface;
- Eina_Value tmp_value;
+
+ Eina_Bool monitoring : 1;
+ Eina_Bool is_listed : 1;
+ Eina_Bool is_loaded : 1;
};
#endif
-
diff --git a/src/lib/eldbus/eldbus_model_signal.c b/src/lib/eldbus/eldbus_model_signal.c
index 12681cd3b7..d1bb490195 100644
--- a/src/lib/eldbus/eldbus_model_signal.c
+++ b/src/lib/eldbus/eldbus_model_signal.c
@@ -28,7 +28,7 @@ _eldbus_model_signal_efl_object_constructor(Eo *obj, Eldbus_Model_Signal_Data *p
}
static void
-_eldbus_model_signal_constructor(Eo *obj EINA_UNUSED,
+_eldbus_model_signal_signal_constructor(Eo *obj EINA_UNUSED,
Eldbus_Model_Signal_Data *pd,
Eldbus_Proxy *proxy,
const Eldbus_Introspection_Signal *signal)
@@ -36,7 +36,7 @@ _eldbus_model_signal_constructor(Eo *obj EINA_UNUSED,
EINA_SAFETY_ON_NULL_RETURN(proxy);
EINA_SAFETY_ON_NULL_RETURN(signal);
- eldbus_model_arguments_constructor(efl_super(obj, MY_CLASS), proxy, signal->name, signal->arguments);
+ eldbus_model_arguments_custom_constructor(efl_super(obj, MY_CLASS), proxy, signal->name, signal->arguments);
pd->signal = signal;
_eldbus_model_signal_callback_add(pd);
diff --git a/src/lib/eldbus/eldbus_model_signal.eo b/src/lib/eldbus/eldbus_model_signal.eo
index 2a27fde209..4aa547cb21 100644
--- a/src/lib/eldbus/eldbus_model_signal.eo
+++ b/src/lib/eldbus/eldbus_model_signal.eo
@@ -2,7 +2,7 @@ class Eldbus.Model.Signal (Eldbus.Model.Arguments) {
[[Eldbus model signal class]]
methods {
- constructor {
+ signal_constructor {
[[Custom Eldbus_Model_Signal constructor.
@since 1.16]]
@@ -17,6 +17,6 @@ class Eldbus.Model.Signal (Eldbus.Model.Arguments) {
Efl.Object.destructor;
}
constructors {
- .constructor;
+ .signal_constructor;
}
}
diff --git a/src/lib/eldbus/eldbus_signal_handler.c b/src/lib/eldbus/eldbus_signal_handler.c
index 164bf5eb7c..e577ddc1bb 100644
--- a/src/lib/eldbus/eldbus_signal_handler.c
+++ b/src/lib/eldbus/eldbus_signal_handler.c
@@ -78,10 +78,7 @@ eldbus_signal_handler_match_extra_vset(Eldbus_Signal_Handler *sh, va_list ap)
dbus_error_init(&err);
dbus_bus_remove_match(sh->conn->dbus_conn,
- eina_strbuf_string_get(sh->match), &err);
- if (dbus_error_is_set(&err))
- ERR("handler(%p): %s - %s", sh, err.name, err.message);
- EINA_SAFETY_ON_TRUE_RETURN_VAL(dbus_error_is_set(&err), EINA_FALSE);
+ eina_strbuf_string_get(sh->match), NULL);
for (read = va_arg(ap, char *); read; read = va_arg(ap, char *))
{
@@ -113,23 +110,16 @@ eldbus_signal_handler_match_extra_vset(Eldbus_Signal_Handler *sh, va_list ap)
key = NULL;
}
- dbus_error_init(&err);
dbus_bus_add_match(sh->conn->dbus_conn,
- eina_strbuf_string_get(sh->match), &err);
- if (dbus_error_is_set(&err))
- ERR("handler(%p): %s - %s", sh, err.name, err.message);
- if (!dbus_error_is_set(&err))
- return EINA_TRUE;
+ eina_strbuf_string_get(sh->match), NULL);
+ return EINA_TRUE;
ERR("Error setting new match.");
return EINA_FALSE;
error:
- dbus_error_init(&err);
dbus_bus_add_match(sh->conn->dbus_conn,
- eina_strbuf_string_get(sh->match), &err);
- if (dbus_error_is_set(&err))
- ERR("handler(%p): %s - %s", sh, err.name, err.message);
+ eina_strbuf_string_get(sh->match), NULL);
return EINA_FALSE;
}
@@ -178,7 +168,6 @@ _eldbus_signal_handler_add(Eldbus_Connection *conn, const char *sender, const ch
{
Eldbus_Signal_Handler *sh;
Eina_Strbuf *match;
- DBusError err;
EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(cb, NULL);
@@ -196,11 +185,7 @@ _eldbus_signal_handler_add(Eldbus_Connection *conn, const char *sender, const ch
_match_append(match, "interface", interface);
_match_append(match, "member", member);
- dbus_error_init(&err);
- dbus_bus_add_match(conn->dbus_conn, eina_strbuf_string_get(match), &err);
- if (dbus_error_is_set(&err))
- ERR("handler(%p): %s - %s", sh, err.name, err.message);
- if (dbus_error_is_set(&err)) goto cleanup;
+ dbus_bus_add_match(conn->dbus_conn, eina_strbuf_string_get(match), NULL);
if (sender)
{
@@ -242,9 +227,7 @@ _eldbus_signal_handler_clean(Eldbus_Signal_Handler *handler)
DBG("clean handler=%p path=%p cb=%p", handler, handler->path, handler->cb);
dbus_error_init(&err);
dbus_bus_remove_match(handler->conn->dbus_conn,
- eina_strbuf_string_get(handler->match), &err);
- if (dbus_error_is_set(&err))
- ERR("error removing handler(%p): %s - %s", handler, err.name, err.message);
+ eina_strbuf_string_get(handler->match), NULL);
handler->dangling = EINA_TRUE;
}
@@ -366,4 +349,3 @@ eldbus_signal_handler_connection_get(const Eldbus_Signal_Handler *handler)
ELDBUS_SIGNAL_HANDLER_CHECK_RETVAL(handler, NULL);
return handler->conn;
}
-
diff --git a/src/lib/eldbus/eldbus_types.eot b/src/lib/eldbus/eldbus_types.eot
index f68868c88a..ebd3130a43 100644
--- a/src/lib/eldbus/eldbus_types.eot
+++ b/src/lib/eldbus/eldbus_types.eot
@@ -1,5 +1,3 @@
-import eina_types;
-
struct Eldbus.Proxy; [[Represents a client object bound to an interface]]
struct Eldbus.Connection; [[Represents a connection of one the type of connection with the DBus daemon.]]
struct Eldbus.Object; [[Represents an object path already attached with bus name or unique id]]
diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h
index f605fc3f0c..042a100b7b 100644
--- a/src/lib/elementary/Efl_Ui.h
+++ b/src/lib/elementary/Efl_Ui.h
@@ -4,6 +4,14 @@
#include <Efl_Config.h>
#include <Elementary_Options.h>
+#ifndef EFL_EO_API_SUPPORT
+# define EFL_EO_API_SUPPORT
+#endif
+
+#ifndef EFL_BETA_API_SUPPORT
+# define EFL_BETA_API_SUPPORT
+#endif
+
/* Standard headers for standard system calls etc. */
#include <stdio.h>
#include <stdlib.h>
@@ -57,15 +65,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ELEMENTARY_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ECORE_BUILD */
+# endif
# define EAPI_WEAK
#else
# ifdef __GNUC__
@@ -80,7 +88,7 @@
# define EAPI
# define EAPI_WEAK
# endif
-#endif /* ! _WIN32 */
+#endif
#define EWAPI EAPI EAPI_WEAK
@@ -110,7 +118,9 @@
#include <Efl_Net.h>
#include <Evas.h>
-#include <Evas_GL.h>
+#ifndef EFL_NOLEGACY_API_SUPPORT
+# include <Evas_GL.h>
+#endif
#include <Eio.h>
#include <Edje.h>
#include <Eldbus.h>
@@ -135,25 +145,29 @@ extern EAPI double _efl_startup_time;
// EO types. Defined for legacy-only builds as legacy uses typedef of EO types.
#include "efl_ui.eot.h"
+#include "efl_selection_types.eot.h"
+
+//define focus manager earlier since focus object and manager is circular
+typedef Eo Efl_Ui_Focus_Manager;
+#define _EFL_UI_FOCUS_MANAGER_EO_CLASS_TYPE
# include <efl_ui_focus_object.eo.h>
# include <efl_ui_focus_manager.eo.h>
# include <efl_ui_focus_manager_calc.eo.h>
# include <efl_ui_focus_manager_sub.eo.h>
# include <efl_ui_focus_manager_root_focus.eo.h>
-# include <efl_ui_focus_user.eo.h>
+# include <efl_ui_focus_util.eo.h>
# include <efl_ui_textpath.eo.h>
# include <efl_ui_translatable.eo.h>
# include <efl_ui_focus_composition.eo.h>
# include <efl_ui_focus_layer.eo.h>
-# include <efl_access.h>
+# include <efl_access_object.h>
# include <efl_access_text.h>
# include <efl_access_window.h>
# include <efl_access_action.eo.h>
# include <efl_access_component.eo.h>
# include <efl_access_editable_text.eo.h>
-# include <efl_access_image.eo.h>
# include <efl_access_selection.eo.h>
# include <efl_access_value.eo.h>
@@ -176,18 +190,29 @@ extern EAPI double _efl_startup_time;
# include <efl_ui_win.eo.h>
# include <efl_ui_win_inlined.eo.h>
# include <efl_ui_win_socket.eo.h>
+
+/* FIXME: Efl.Ui.Text must not use elm_general.h */
+# warning Efl.Ui.Text is not available yet without Elementary.h
+# if 0
# include <efl_ui_text_interactive.eo.h>
# include <efl_ui_text.eo.h>
# include <efl_ui_text_editable.eo.h>
# include <efl_ui_text_async.eo.h>
+# endif
+
# include <efl_ui_clock.h>
# include <efl_ui_image_factory.eo.h>
# include <efl_ui_video.h>
# include <efl_ui_nstate.h>
# include <efl_ui_calendar.h>
# include <efl_ui_button_eo.h>
+
+/* FIXME: Multibuttonentry must not use elm_widget_item */
+# warning Efl.Ui.Multibutton is not available yet without Elementary.h
+# if 0
# include <efl_ui_multibuttonentry.h>
-# include <efl_ui_slider_eo.h>
+# endif
+
# include <efl_ui_flip_eo.h>
# include <efl_ui_frame_eo.h>
# include <efl_ui_check_eo.h>
diff --git a/src/lib/elementary/Elementary.h b/src/lib/elementary/Elementary.h
index 57192ae4b1..250cb05d14 100644
--- a/src/lib/elementary/Elementary.h
+++ b/src/lib/elementary/Elementary.h
@@ -93,10 +93,10 @@
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EVAS_BUILD */
+# endif
# define EAPI_WEAK
#else
# ifdef __GNUC__
@@ -111,7 +111,7 @@
# define EAPI
# define EAPI_WEAK
# endif
-#endif /* ! _WIN32 */
+#endif
#define EWAPI EAPI EAPI_WEAK
@@ -148,12 +148,17 @@ EAPI extern Elm_Version *elm_version;
#include <elm_focus.h>
#if defined (EFL_EO_API_SUPPORT) && defined (EFL_BETA_API_SUPPORT)
+
+//define focus manager earlier since focus object and manager is circular
+typedef Eo Efl_Ui_Focus_Manager;
+#define _EFL_UI_FOCUS_MANAGER_EO_CLASS_TYPE
+
# include <efl_ui_focus_object.eo.h>
# include <efl_ui_focus_manager.eo.h>
+# include <efl_ui_focus_manager_window_root.eo.h>
# include <efl_ui_focus_manager_calc.eo.h>
# include <efl_ui_focus_manager_sub.eo.h>
# include <efl_ui_focus_manager_root_focus.eo.h>
-# include <efl_ui_focus_user.eo.h>
# include <efl_ui_focus_util.eo.h>
# include <efl_ui_textpath.eo.h>
# include <efl_ui_translatable.eo.h>
@@ -275,9 +280,9 @@ EAPI extern Elm_Version *elm_version;
#include <elm_win.h>
#ifdef EFL_EO_API_SUPPORT
-# include <efl_ui_list_segarray.h>
+# include <efl_selection_types.eot.h>
# include <efl_config_global.eo.h>
-# include <elm_widget.eo.h>
+# include <efl_ui_widget.eo.h>
# include <efl_ui_widget_part.eo.h>
# include <efl_ui_widget_part_bg.eo.h>
# include <efl_ui_widget_part_shadow.eo.h>
@@ -299,29 +304,70 @@ EAPI extern Elm_Version *elm_version;
# include <efl_ui_win.eo.h>
# include <efl_ui_win_inlined.eo.h>
# include <efl_ui_win_socket.eo.h>
-# include <efl_ui_text_interactive.eo.h>
+# include <efl_text_interactive.eo.h>
# include <efl_ui_text.eo.h>
# include <efl_ui_popup.eo.h>
# include <efl_ui_popup_alert.eo.h>
# include <efl_ui_popup_alert_scroll.eo.h>
# include <efl_ui_popup_alert_text.eo.h>
# include <efl_ui_popup_anchor.eo.h>
+# include <efl_ui_text_factory_images.eo.h>
+# include <efl_ui_text_factory_emoticons.eo.h>
+# include <efl_ui_text_factory_fallback.eo.h>
# include <efl_ui_text_editable.eo.h>
# include <efl_ui_text_async.eo.h>
# include <efl_ui_clock.eo.h>
# include <efl_ui_spin.eo.h>
# include <efl_ui_spin_button.eo.h>
+# include <efl_ui_datepicker.eo.h>
+# include <efl_ui_timepicker.eo.h>
+# include <efl_ui_tags.eo.h>
# include <efl_ui_image_factory.eo.h>
+# include <efl_ui_slider.eo.h>
# include <efl_ui_slider_interval.eo.h>
# include <efl_ui_layout_factory.eo.h>
-# include <efl_ui_list_types.eot.h>
-# include <efl_ui_list_model.eo.h>
-# include <efl_ui_list_relayout.eo.h>
+# include <efl_ui_item.eo.h>
+# include <efl_ui_list_item.eo.h>
+# include <efl_ui_list_default_item_part_icon.eo.h>
+# include <efl_ui_list_default_item_part_end.eo.h>
+# include <efl_ui_list_default_item.eo.h>
+# include <efl_ui_list_empty_item.eo.h>
# include <efl_ui_list.eo.h>
-# include <efl_ui_list_pan.eo.h>
+# include <efl_ui_view_list_types.eot.h>
+# include <efl_ui_view_list_segarray.h>
+# include <efl_ui_view_list_segarray.eo.h>
+# include <efl_ui_view_list_model.eo.h>
+# include <efl_ui_view_list_relayout.eo.h>
+# include <efl_ui_view_list.eo.h>
+# include <efl_ui_view_list_pan.eo.h>
+# include <efl_ui_pan.eo.h>
# include <efl_ui_scroll_manager.eo.h>
# include <efl_ui_scroller.eo.h>
-# include <efl_ui_pan.eo.h>
+# include <efl_ui_dnd_types.eot.h>
+# include <efl_selection.eo.h>
+# include <efl_ui_dnd.eo.h>
+# include <efl_ui_dnd_container.eo.h>
+# include <efl_ui_navigation_bar.eo.h>
+# include <efl_ui_navigation_bar_part.eo.h>
+# include <efl_ui_navigation_bar_part_back_button.eo.h>
+# include <efl_ui_navigation_layout.eo.h>
+# include <efl_ui_stack.eo.h>
+
+# ifndef _EFL_UI_PAGER_EO_CLASS_TYPE
+# define _EFL_UI_PAGER_EO_CLASS_TYPE
+typedef Eo Efl_Ui_Pager;
+# endif
+
+# include <efl_page_transition.eo.h>
+# include <efl_page_transition_scroll.eo.h>
+# include <efl_page_indicator.eo.h>
+# include <efl_page_indicator_icon.eo.h>
+# include <efl_ui_pager.eo.h>
+
+# include <efl_ui_tab_bar.eo.h>
+# include <efl_ui_tab_page.eo.h>
+# include <efl_ui_tab_page_part_tab.eo.h>
+# include <efl_ui_tab_pager.eo.h>
#endif
/* include deprecated calls last of all */
diff --git a/src/lib/elementary/Elementary.hh b/src/lib/elementary/Elementary.hh
index dff82ab28e..36a31ef700 100644
--- a/src/lib/elementary/Elementary.hh
+++ b/src/lib/elementary/Elementary.hh
@@ -18,7 +18,6 @@
extern "C" {
#include "Elementary.h"
-#include "elm_widget.h"
}
#include <Edje.hh>
diff --git a/src/lib/elementary/efl_access_action.c b/src/lib/elementary/efl_access_action.c
index a6aba74f33..8e56d79fd2 100644
--- a/src/lib/elementary/efl_access_action.c
+++ b/src/lib/elementary/efl_access_action.c
@@ -10,7 +10,7 @@
#include "elm_priv.h"
EOLIAN const char *
-_efl_access_action_action_localized_name_get(Eo *obj, void *pd EINA_UNUSED, int id)
+_efl_access_action_action_localized_name_get(const Eo *obj, void *pd EINA_UNUSED, int id)
{
const char *ret = NULL;
diff --git a/src/lib/elementary/efl_access_action.eo b/src/lib/elementary/efl_access_action.eo
index 354e3a1adb..90836eb9a3 100644
--- a/src/lib/elementary/efl_access_action.eo
+++ b/src/lib/elementary/efl_access_action.eo
@@ -1,4 +1,4 @@
-import elm_general;
+import efl_ui;
mixin Efl.Access.Action ()
{
diff --git a/src/lib/elementary/efl_access_component.c b/src/lib/elementary/efl_access_component.c
index c53c51f294..f4a3c653bc 100644
--- a/src/lib/elementary/efl_access_component.c
+++ b/src/lib/elementary/efl_access_component.c
@@ -4,7 +4,7 @@
#define EFL_ACCESS_COMPONENT_PROTECTED
#define EFL_ACCESS_COMPONENT_BETA
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#include <Elementary.h>
@@ -12,45 +12,24 @@
EOLIAN static void
-_efl_access_component_position_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, Eina_Bool type, int *x, int *y)
+_efl_access_component_screen_position_get(const Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, int *x, int *y)
{
Eina_Rect r;
- r = efl_access_component_extents_get(obj, type);
+ r = efl_access_component_extents_get(obj, EINA_TRUE);
if (x) *x = r.x;
if (y) *y = r.y;
}
EOLIAN static Eina_Bool
-_efl_access_component_position_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, Eina_Bool type, int x, int y)
+_efl_access_component_screen_position_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, int x, int y)
{
Eina_Rect r;
- r = efl_access_component_extents_get(obj, type);
+ r = efl_access_component_extents_get(obj, EINA_TRUE);
r.x = x;
r.y = y;
- return efl_access_component_extents_set(obj, type, r);
-}
-
-EOLIAN static Eina_Bool
-_efl_access_component_size_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, int w, int h)
-{
- Eina_Rect r;
-
- r = efl_access_component_extents_get(obj, EINA_FALSE);
- r.w = w;
- r.h = h;
- return efl_access_component_extents_set(obj, EINA_FALSE, r);
-}
-
-EOLIAN static void
-_efl_access_component_size_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, int *w, int *h)
-{
- Eina_Rect r;
-
- r = efl_access_component_extents_get(obj, EINA_FALSE);
- if (w) *w = r.w;
- if (h) *h = r.h;
+ return efl_access_component_extents_set(obj, EINA_TRUE, r);
}
EOLIAN static Eina_Bool
@@ -62,22 +41,13 @@ _efl_access_component_contains(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, Eina_
return eina_rectangle_coords_inside(&r.rect, x, y);
}
-EOLIAN static double
-_efl_access_component_alpha_get(Eo *obj, void *_pd EINA_UNUSED)
-{
- int alpha;
-
- evas_object_color_get(obj, NULL, NULL, NULL, &alpha);
- return (double)alpha / 255.0;
-}
-
EOLIAN static Eo *
_efl_access_component_accessible_at_point_get(Eo *obj, void *_pd EINA_UNUSED, Eina_Bool screen_coords, int x, int y)
{
Eina_List *l, *children;
Eo *ret = NULL, *child;
- children = efl_access_children_get(obj);
+ children = efl_access_object_access_children_get(obj);
EINA_LIST_FOREACH(children, l, child)
{
@@ -98,15 +68,15 @@ _efl_access_component_accessible_at_point_get(Eo *obj, void *_pd EINA_UNUSED, Ei
}
EOLIAN static Eina_Rect
-_efl_access_component_extents_get(Eo *obj, void *_pd EINA_UNUSED, Eina_Bool screen_coords)
+_efl_access_component_extents_get(const Eo *obj, void *_pd EINA_UNUSED, Eina_Bool screen_coords)
{
Eina_Rect r;
- r = efl_gfx_geometry_get(obj);
+ r = efl_gfx_entity_geometry_get(obj);
if (screen_coords)
{
Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
- if (!ee)
+ if (ee)
{
int ee_x = 0, ee_y = 0;
ecore_evas_geometry_get(ee, &ee_x, &ee_y, NULL, NULL);
@@ -139,14 +109,9 @@ _efl_access_component_extents_set(Eo *obj, void *_pd EINA_UNUSED, Eina_Bool scre
return EINA_TRUE;
}
-EOLIAN static int
-_efl_access_component_layer_get(Eo *obj, void *_pd EINA_UNUSED)
-{
- return evas_object_layer_get(obj);
-}
EOLIAN static int
-_efl_access_component_z_order_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED)
+_efl_access_component_z_order_get(const Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED)
{
// Currently not used.
return 0;
diff --git a/src/lib/elementary/efl_access_component.eo b/src/lib/elementary/efl_access_component.eo
index c6f6964eea..8a9b89bdd6 100644
--- a/src/lib/elementary/efl_access_component.eo
+++ b/src/lib/elementary/efl_access_component.eo
@@ -1,38 +1,10 @@
import eina_types;
-mixin Efl.Access.Component ()
+mixin Efl.Access.Component (Efl.Gfx.Entity, Efl.Gfx.Stack)
{
[[AT-SPI component mixin]]
data: null;
methods {
- @property size @protected @beta {
- [[Size of accessible widget.]]
- set {
- return: bool; [[$true if size was set, $false otherwise]]
- }
- get {
- }
- values {
- w: int; [[Width of the widget]]
- h: int; [[Height of the widget]]
- }
- }
- @property layer @protected @beta {
- [[Evas layer of accessible widget.]]
- get {
- }
- values {
- layer: int; [[Evas layer of the widget]]
- }
- }
- @property alpha @protected @beta {
- [[Gets alpha of accessible widget.]]
- get {
- }
- values {
- alpha: double; [[Alpha value in [0, 1] range.]]
- }
- }
@property z_order @protected @beta {
[[Gets the depth at which the component is shown in relation to other
components in the same container.]]
@@ -57,24 +29,20 @@ mixin Efl.Access.Component ()
rect: Eina.Rect; [[The geometry.]]
}
}
- @property position @protected @beta {
+ @property screen_position @protected @beta {
[[Position of accessible widget.]]
set {
return: bool; [[$true if position was set, $false otherwise]]
}
get {
}
- keys {
- screen_coords: bool; [[If $true x and y values will be relative to
- screen origin, otherwise relative to canvas]]
- }
values {
x: int; [[X coordinate]]
y: int; [[Y coordinate]]
}
}
contains @protected @beta {
- [[Contains accessible widget]]
+ [[Contains accessible widget]]
params {
screen_coords: bool; [[If $true x and y values will be relative to
screen origin, otherwise relative to canvas]]
diff --git a/src/lib/elementary/efl_access_editable_text.eo b/src/lib/elementary/efl_access_editable_text.eo
index 14d8b280e8..a1ec68f9c2 100644
--- a/src/lib/elementary/efl_access_editable_text.eo
+++ b/src/lib/elementary/efl_access_editable_text.eo
@@ -2,7 +2,7 @@ interface Efl.Access.Editable.Text ()
{
[[Elementary editable text interface]]
methods {
- @property content @protected @beta {
+ @property text_content @protected @beta {
[[Editable content property]]
set {
return: bool; [[$true if setting the value succeeded, $false otherwise]]
diff --git a/src/lib/elementary/efl_access_image.c b/src/lib/elementary/efl_access_image.c
deleted file mode 100644
index 73e8553541..0000000000
--- a/src/lib/elementary/efl_access_image.c
+++ /dev/null
@@ -1,53 +0,0 @@
-#ifdef HAVE_CONFIG_H
- #include "elementary_config.h"
-#endif
-
-#define EFL_ACCESS_IMAGE_PROTECTED
-
-#include <Elementary.h>
-#include "elm_widget.h"
-#include "elm_priv.h"
-
-static void
-_free_desc_cb(void *data, const Efl_Event *event EINA_UNUSED)
-{
- eina_stringshare_del(data);
-}
-
-EOLIAN static const char*
-_efl_access_image_description_get(Eo *obj, void *sd EINA_UNUSED)
-{
- const char *descr = NULL;
-
- descr = efl_key_data_get(obj, "atspi_image_description");
- return descr;
-}
-
-EOLIAN static void
-_efl_access_image_description_set(Eo *obj, void *sd EINA_UNUSED, const char *description)
-{
- const char *key = "atspi_image_description";
- const char *descr = eina_stringshare_add(description);
- char *old_descr = efl_key_data_get(obj, key);
- if (old_descr)
- {
- eina_stringshare_del(old_descr);
- efl_event_callback_del(obj, EFL_EVENT_DEL, _free_desc_cb, old_descr);
- }
-
- if (descr)
- {
- efl_key_data_set(obj, key, descr);
- efl_event_callback_add(obj, EFL_EVENT_DEL, _free_desc_cb, descr);
- }
-}
-
-EOLIAN static const char*
-_efl_access_image_locale_get(Eo *obj EINA_UNUSED, void *sd EINA_UNUSED)
-{
- // by default assume that descriptions are given in language of current
- // locale.
- return getenv("LANG");
-}
-
-#include "efl_access_image.eo.c"
diff --git a/src/lib/elementary/efl_access_image.eo b/src/lib/elementary/efl_access_image.eo
deleted file mode 100644
index 18b2bb111d..0000000000
--- a/src/lib/elementary/efl_access_image.eo
+++ /dev/null
@@ -1,39 +0,0 @@
-mixin Efl.Access.Image ()
-{
- [[Accessible image mixin]]
- data: null;
- methods {
- @property extents @protected @beta {
- [[Gets an image extents.]]
- get @pure_virtual {
- }
- keys {
- screen_coords: bool; [[$true if we have the screen coordinates, otherwise $false]]
- }
- values {
- x: int; [[X coordinate]]
- y: int; [[Y coordinate]]
- width: int; [[Image width]]
- height: int; [[Image height]]
- }
- }
- @property description @protected @beta {
- [[Textual description of image]]
- get {
- }
- set {
- }
- values {
- description: string; [[Textual image description]]
- }
- }
- @property locale @protected @beta {
- [[Gets locale of the image description.]]
- get {
- }
- values {
- locale: string; [[Locale of description]]
- }
- }
- }
-}
diff --git a/src/lib/elementary/efl_access.c b/src/lib/elementary/efl_access_object.c
index 2ed5dde41c..b9626274e2 100644
--- a/src/lib/elementary/efl_access.c
+++ b/src/lib/elementary/efl_access_object.c
@@ -2,7 +2,7 @@
#include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#include <Elementary.h>
#include "elm_widget.h"
@@ -121,9 +121,9 @@ struct _Efl_Access_Event_Handler
void *data;
};
-struct _Efl_Access_Data
+struct _Efl_Access_Object_Data
{
- Efl_Access_Relation_Set relations;
+ Eina_List *relations;
Eina_List *attr_list;
const char *name;
const char *description;
@@ -133,23 +133,23 @@ struct _Efl_Access_Data
Efl_Access_Type type: 2;
};
-typedef struct _Efl_Access_Data Efl_Access_Data;
+typedef struct _Efl_Access_Object_Data Efl_Access_Object_Data;
static Eina_List *global_callbacks;
static Eo *root;
EOLIAN static int
-_efl_access_index_in_parent_get(Eo *obj, Efl_Access_Data *pd EINA_UNUSED)
+_efl_access_object_index_in_parent_get(const Eo *obj, Efl_Access_Object_Data *pd EINA_UNUSED)
{
Eina_List *l, *children = NULL;
Eo *chld, *parent = NULL;
int ret = 0;
- parent = efl_access_parent_get(obj);
+ parent = efl_provider_find(efl_parent_get(obj), EFL_ACCESS_OBJECT_MIXIN);
if (!parent) return -1;
- children = efl_access_children_get(parent);
+ children = efl_access_object_access_children_get(parent);
if (!children) return -1;
EINA_LIST_FOREACH(children, l, chld)
@@ -167,33 +167,24 @@ _efl_access_index_in_parent_get(Eo *obj, Efl_Access_Data *pd EINA_UNUSED)
return ret;
}
-EOLIAN static Efl_Access *
-_efl_access_parent_get(Eo *obj EINA_UNUSED, Efl_Access_Data *pd EINA_UNUSED)
-{
- Efl_Access_Type type;
- Eo *parent = obj;
-
- do {
- parent = efl_parent_get(obj);
- if (efl_isa(parent, EFL_ACCESS_MIXIN))
- {
- type = efl_access_type_get(parent);
- if (type != EFL_ACCESS_TYPE_SKIPPED) break;
- }
- } while (parent);
- return efl_isa(parent, EFL_ACCESS_MIXIN) ? parent : NULL;
-}
-
-EOLIAN static void
-_efl_access_parent_set(Eo *obj, Efl_Access_Data *pd EINA_UNUSED, Efl_Access *new_parent EINA_UNUSED)
+EOLIAN static Efl_Object *
+_efl_access_object_efl_object_provider_find(const Eo *obj, Efl_Access_Object_Data *pd EINA_UNUSED, const Efl_Object *klass)
{
- WRN("The %s object does not implement the \"accessible_parent_set\" function.",
- efl_class_name_get(efl_class_get(obj)));
+ if (efl_isa(obj, klass))
+ {
+ if (klass == EFL_ACCESS_OBJECT_MIXIN)
+ {
+ Efl_Access_Type type = efl_access_object_access_type_get(obj);
+ if (type != EFL_ACCESS_TYPE_SKIPPED) return (Eo*)obj;
+ }
+ else return (Eo*)obj;
+ }
+ return efl_provider_find(efl_super(obj, EFL_ACCESS_OBJECT_MIXIN), klass);
}
EOLIAN Eina_List*
-_efl_access_attributes_get(Eo *obj EINA_UNUSED, Efl_Access_Data *pd EINA_UNUSED)
+_efl_access_object_attributes_get(const Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd)
{
Eina_List *attr_list = NULL;
if (pd->attr_list)
@@ -215,7 +206,7 @@ _efl_access_attributes_get(Eo *obj EINA_UNUSED, Efl_Access_Data *pd EINA_UNUSED)
}
EOLIAN static void
-_efl_access_attribute_append(Eo *obj EINA_UNUSED, Efl_Access_Data *pd EINA_UNUSED, const char *key, const char *value)
+_efl_access_object_attribute_append(Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd, const char *key, const char *value)
{
Eina_List *l;
Efl_Access_Attribute *attr = NULL;
@@ -241,7 +232,7 @@ _efl_access_attribute_append(Eo *obj EINA_UNUSED, Efl_Access_Data *pd EINA_UNUSE
pd->attr_list = eina_list_append(pd->attr_list, attr);
}
-EOLIAN static void _efl_access_attributes_clear(Eo *obj EINA_UNUSED, Efl_Access_Data *pd)
+EOLIAN static void _efl_access_object_attributes_clear(Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd)
{
if (!pd->attr_list) return;
Efl_Access_Attribute *attr;
@@ -255,7 +246,7 @@ EOLIAN static void _efl_access_attributes_clear(Eo *obj EINA_UNUSED, Efl_Access_
}
EOLIAN static void
-_efl_access_reading_info_type_set(Eo *obj, Efl_Access_Data *pd, Efl_Access_Reading_Info_Type reading_info)
+_efl_access_object_reading_info_type_set(Eo *obj, Efl_Access_Object_Data *pd, Efl_Access_Reading_Info_Type reading_info)
{
Eina_Strbuf *buf = NULL;
pd->reading_info = reading_info;
@@ -280,24 +271,24 @@ _efl_access_reading_info_type_set(Eo *obj, Efl_Access_Data *pd, Efl_Access_Readi
{
eina_strbuf_append(buf, "state");
}
- efl_access_attribute_append(obj, "reading_info_type", eina_strbuf_string_get(buf));
+ efl_access_object_attribute_append(obj, "reading_info_type", eina_strbuf_string_get(buf));
eina_strbuf_free(buf);
}
EOLIAN Efl_Access_Reading_Info_Type
-_efl_access_reading_info_type_get(Eo *obj EINA_UNUSED, Efl_Access_Data *pd)
+_efl_access_object_reading_info_type_get(const Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd)
{
return pd->reading_info;
}
EOLIAN static Efl_Access_Role
-_efl_access_role_get(Eo *obj EINA_UNUSED, Efl_Access_Data *pd EINA_UNUSED)
+_efl_access_object_role_get(const Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd)
{
return pd->role;
}
EOLIAN static void
-_efl_access_role_set(Eo *obj, Efl_Access_Data *pd EINA_UNUSED, Efl_Access_Role role)
+_efl_access_object_role_set(Eo *obj, Efl_Access_Object_Data *pd, Efl_Access_Role role)
{
if (pd->role != role)
{
@@ -307,17 +298,17 @@ _efl_access_role_set(Eo *obj, Efl_Access_Data *pd EINA_UNUSED, Efl_Access_Role r
}
EOLIAN const char *
-_efl_access_role_name_get(Eo *obj EINA_UNUSED, Efl_Access_Data *pd EINA_UNUSED)
+_efl_access_object_role_name_get(const Eo *obj, Efl_Access_Object_Data *pd EINA_UNUSED)
{
Efl_Access_Role role;
- role = efl_access_role_get(obj);
+ role = efl_access_object_role_get(obj);
return role > EFL_ACCESS_ROLE_LAST_DEFINED ? "" : Access_Name[role];
}
EOLIAN const char *
-_efl_access_name_get(Eo *obj EINA_UNUSED, Efl_Access_Data *pd)
+_efl_access_object_i18n_name_get(const Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd)
{
#ifdef ENABLE_NLS
if (pd->translation_domain)
@@ -327,12 +318,12 @@ _efl_access_name_get(Eo *obj EINA_UNUSED, Efl_Access_Data *pd)
}
EOLIAN static void
-_efl_access_name_set(Eo *obj EINA_UNUSED, Efl_Access_Data *pd, const char *val)
+_efl_access_object_i18n_name_set(Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd, const char *val)
{
eina_stringshare_replace(&pd->name, val);
}
-const char * _efl_access_description_get(Eo *obj EINA_UNUSED, Efl_Access_Data *pd)
+const char * _efl_access_object_description_get(const Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd)
{
#ifdef ENABLE_NLS
if (pd->translation_domain)
@@ -342,16 +333,16 @@ const char * _efl_access_description_get(Eo *obj EINA_UNUSED, Efl_Access_Data *p
}
EOLIAN static void
-_efl_access_description_set(Eo *obj EINA_UNUSED, Efl_Access_Data *pd, const char *val)
+_efl_access_object_description_set(Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd, const char *val)
{
eina_stringshare_replace(&pd->description, val);
}
EOLIAN static const char *
-_efl_access_localized_role_name_get(Eo *obj EINA_UNUSED, Efl_Access_Data *pd EINA_UNUSED)
+_efl_access_object_localized_role_name_get(const Eo *obj, Efl_Access_Object_Data *pd EINA_UNUSED)
{
const char *ret = NULL;
- ret = efl_access_role_name_get(obj);
+ ret = efl_access_object_role_name_get(obj);
#ifdef ENABLE_NLS
ret = gettext(ret);
#endif
@@ -359,19 +350,20 @@ _efl_access_localized_role_name_get(Eo *obj EINA_UNUSED, Efl_Access_Data *pd EIN
}
EOLIAN static Eina_List *
-_efl_access_children_get(Eo *obj EINA_UNUSED, Efl_Access_Data *pd EINA_UNUSED)
+_efl_access_object_access_children_get(const Eo *obj, Efl_Access_Object_Data *pd EINA_UNUSED)
{
Eina_List *children = NULL;
Eina_Iterator *iter = NULL;
Eo *chld;
// By default use Efl_Object object hierarchy
- iter = efl_children_iterator_new(obj);
+ /* XXX const */
+ iter = efl_children_iterator_new((Eo *)obj);
if (!iter) return NULL;
EINA_ITERATOR_FOREACH(iter, chld)
{
- if (efl_isa(chld, EFL_ACCESS_MIXIN))
+ if (efl_isa(chld, EFL_ACCESS_OBJECT_MIXIN))
children = eina_list_append(children, chld);
}
eina_iterator_free(iter);
@@ -380,15 +372,15 @@ _efl_access_children_get(Eo *obj EINA_UNUSED, Efl_Access_Data *pd EINA_UNUSED)
}
EOLIAN static Efl_Access_State_Set
-_efl_access_state_set_get(Eo *obj EINA_UNUSED, Efl_Access_Data *pd EINA_UNUSED)
+_efl_access_object_state_set_get(const Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd EINA_UNUSED)
{
return 0;
}
-EOLIAN Efl_Access_Relation_Set
-_efl_access_relation_set_get(Eo *obj EINA_UNUSED, Efl_Access_Data *pd EINA_UNUSED)
+EOLIAN Eina_Iterator *
+_efl_access_object_relations_get(const Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd)
{
- return efl_access_relation_set_clone(pd->relations);
+ return eina_list_iterator_new(pd->relations);
}
EAPI void efl_access_attributes_list_free(Eina_List *list)
@@ -403,26 +395,26 @@ EAPI void efl_access_attributes_list_free(Eina_List *list)
}
EOLIAN void
-_efl_access_event_emit(Eo *class EINA_UNUSED, void *pd EINA_UNUSED, Eo *accessible, const Efl_Event_Description *event, void *event_info)
+_efl_access_object_event_emit(Eo *class EINA_UNUSED, void *pd EINA_UNUSED, Eo *accessible, const Efl_Event_Description *event, void *event_info)
{
Eina_List *l;
Efl_Access_Event_Handler *hdl;
Efl_Access_Type type;
- if (!accessible || !event || !efl_isa(accessible, EFL_ACCESS_MIXIN))
+ if (!accessible || !event || !efl_isa(accessible, EFL_ACCESS_OBJECT_MIXIN))
{
CRI("Invalid parameters, event: %s, obj: %s", event ? event->name : "NULL", accessible ? efl_class_name_get(accessible) : "NULL");
return;
}
- type = efl_access_type_get(accessible);
+ type = efl_access_object_access_type_get(accessible);
if (type != EFL_ACCESS_TYPE_REGULAR)
return;
- if (event == EFL_ACCESS_EVENT_CHILDREN_CHANGED)
+ if (event == EFL_ACCESS_OBJECT_EVENT_CHILDREN_CHANGED)
{
Efl_Access_Event_Children_Changed_Data *event_data = event_info;
- type = efl_access_type_get(event_data->child);
+ type = efl_access_object_access_type_get(event_data->child);
if (type != EFL_ACCESS_TYPE_REGULAR)
return;
}
@@ -439,7 +431,7 @@ _efl_access_event_emit(Eo *class EINA_UNUSED, void *pd EINA_UNUSED, Eo *accessib
}
EOLIAN Efl_Access_Event_Handler *
-_efl_access_event_handler_add(Eo *class EINA_UNUSED, void *pd EINA_UNUSED, Efl_Event_Cb cb, void *data)
+_efl_access_object_event_handler_add(Eo *class EINA_UNUSED, void *pd EINA_UNUSED, Efl_Event_Cb cb, void *data)
{
Efl_Access_Event_Handler *ret = calloc(1, sizeof(Efl_Access_Event_Handler));
@@ -452,7 +444,7 @@ _efl_access_event_handler_add(Eo *class EINA_UNUSED, void *pd EINA_UNUSED, Efl_E
}
EOLIAN void
-_efl_access_event_handler_del(Eo *class EINA_UNUSED, void *pd EINA_UNUSED, Efl_Access_Event_Handler *handler)
+_efl_access_object_event_handler_del(Eo *class EINA_UNUSED, void *pd EINA_UNUSED, Efl_Access_Event_Handler *handler)
{
Eina_List *l, *l2;
Efl_Access_Event_Handler *hdl;
@@ -468,76 +460,72 @@ _efl_access_event_handler_del(Eo *class EINA_UNUSED, void *pd EINA_UNUSED, Efl_A
}
EOLIAN void
-_efl_access_translation_domain_set(Eo *obj EINA_UNUSED, Efl_Access_Data *pd, const char *domain)
+_efl_access_object_translation_domain_set(Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd, const char *domain)
{
eina_stringshare_replace(&pd->translation_domain, domain);
}
EOLIAN const char*
-_efl_access_translation_domain_get(Eo *obj EINA_UNUSED, Efl_Access_Data *pd)
+_efl_access_object_translation_domain_get(const Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd)
{
return pd->translation_domain;
}
-EAPI void
-efl_access_relation_free(Efl_Access_Relation *relation)
-{
- eina_list_free(relation->objects);
- free(relation);
-}
-
-EAPI Efl_Access_Relation *
-efl_access_relation_clone(const Efl_Access_Relation *relation)
-{
- Efl_Access_Relation *ret = calloc(1, sizeof(Efl_Access_Relation));
- if (!ret) return NULL;
-
- ret->type = relation->type;
- ret->objects = eina_list_clone(relation->objects);
- return ret;
-}
-
static void
_on_rel_obj_del(void *data, const Efl_Event *event)
{
- Efl_Access_Relation_Set *set = data;
+ Efl_Access_Object_Data *sd = data;
Efl_Access_Relation *rel;
Eina_List *l, *l2, *p, *p2;
Eo *rel_obj;
- EINA_LIST_FOREACH_SAFE(*set, l, l2, rel)
+ EINA_LIST_FOREACH_SAFE(sd->relations, l, l2, rel)
{
EINA_LIST_FOREACH_SAFE(rel->objects, p, p2, rel_obj)
{
- if (rel_obj == event->object)
+ if (rel_obj == event->object)
rel->objects = eina_list_remove_list(rel->objects, p);
}
if (!rel->objects)
{
- *set = eina_list_remove_list(*set, l);
+ sd->relations = eina_list_remove_list(sd->relations, l);
free(rel);
}
}
}
-EAPI Eina_Bool
-efl_access_relation_set_relation_append(Efl_Access_Relation_Set *set, Efl_Access_Relation_Type type, const Eo *rel_obj)
+static void
+efl_access_relation_set_free(Efl_Access_Object_Data *sd)
{
Efl_Access_Relation *rel;
- Eina_List *l;
+ Eo *obj;
- if (!efl_isa(rel_obj, EFL_ACCESS_MIXIN))
- return EINA_FALSE;
+ EINA_LIST_FREE(sd->relations, rel)
+ {
+ Eina_List *l;
+
+ EINA_LIST_FOREACH(rel->objects, l, obj)
+ efl_event_callback_del(obj, EFL_EVENT_DEL, _on_rel_obj_del, sd);
+ eina_list_free(rel->objects);
+ free(rel);
+ }
+}
- EINA_LIST_FOREACH(*set, l, rel)
+EOLIAN static Eina_Bool
+_efl_access_object_relationship_append(Eo *obj EINA_UNUSED, Efl_Access_Object_Data *sd, Efl_Access_Relation_Type type, const Efl_Access_Object *relation)
+{
+ Efl_Access_Relation *rel;
+ Eina_List *l;
+
+ EINA_LIST_FOREACH(sd->relations, l, rel)
{
if (rel->type == type)
{
- if (!eina_list_data_find(rel->objects, rel_obj))
+ if (!eina_list_data_find(rel->objects, relation))
{
- rel->objects = eina_list_append(rel->objects, rel_obj);
- efl_event_callback_add((Eo *) rel_obj, EFL_EVENT_DEL, _on_rel_obj_del, set);
+ rel->objects = eina_list_append(rel->objects, relation);
+ efl_event_callback_add((Eo *) relation, EFL_EVENT_DEL, _on_rel_obj_del, sd);
}
return EINA_TRUE;
}
@@ -547,134 +535,82 @@ efl_access_relation_set_relation_append(Efl_Access_Relation_Set *set, Efl_Access
if (!rel) return EINA_FALSE;
rel->type = type;
- rel->objects = eina_list_append(rel->objects, rel_obj);
- *set = eina_list_append(*set, rel);
+ rel->objects = eina_list_append(rel->objects, relation);
+ sd->relations = eina_list_append(sd->relations, rel);
+
+ efl_event_callback_add((Eo *) relation, EFL_EVENT_DEL, _on_rel_obj_del, sd);
- efl_event_callback_add((Eo *) rel_obj, EFL_EVENT_DEL, _on_rel_obj_del, set);
return EINA_TRUE;
}
-EAPI void
-efl_access_relation_set_relation_remove(Efl_Access_Relation_Set *set, Efl_Access_Relation_Type type, const Eo *rel_obj)
+EOLIAN static void
+_efl_access_object_relationship_remove(Eo *obj EINA_UNUSED, Efl_Access_Object_Data *sd, Efl_Access_Relation_Type type, const Efl_Access_Object *relation)
{
- Eina_List *l;
Efl_Access_Relation *rel;
+ Eina_List *l;
- EINA_LIST_FOREACH(*set, l, rel)
+ EINA_LIST_FOREACH(sd->relations, l, rel)
{
if (rel->type == type)
{
- if (eina_list_data_find(rel->objects, rel_obj))
+ if (relation)
{
- efl_event_callback_del((Eo *) rel_obj, EFL_EVENT_DEL, _on_rel_obj_del, set);
- rel->objects = eina_list_remove(rel->objects, rel_obj);
+ if (eina_list_data_find(rel->objects, relation))
+ {
+ efl_event_callback_del((Eo *) relation, EFL_EVENT_DEL, _on_rel_obj_del, sd);
+ rel->objects = eina_list_remove(rel->objects, relation);
+ }
+ if (!rel->objects)
+ {
+ sd->relations = eina_list_remove(sd->relations, rel);
+ free(rel);
+ }
}
- if (!rel->objects)
+ else
{
- *set = eina_list_remove(*set, rel);
- efl_access_relation_free(rel);
- }
- return;
- }
- }
-}
+ Eina_List *ll;
+ Eo *ro;
-EAPI void
-efl_access_relation_set_relation_type_remove(Efl_Access_Relation_Set *set, Efl_Access_Relation_Type type)
-{
- Eina_List *l;
- Efl_Access_Relation *rel;
- Eo *obj;
-
- EINA_LIST_FOREACH(*set, l, rel)
- {
- if (rel->type == type)
- {
- EINA_LIST_FOREACH(rel->objects, l, obj)
- efl_event_callback_del(obj, EFL_EVENT_DEL, _on_rel_obj_del, set);
- *set = eina_list_remove(*set, rel);
- efl_access_relation_free(rel);
- return;
+ EINA_LIST_FOREACH(rel->objects, ll, ro)
+ efl_event_callback_del(ro, EFL_EVENT_DEL, _on_rel_obj_del, sd);
+ sd->relations = eina_list_remove(sd->relations, rel);
+ free(rel);
+ }
+ return ;
}
}
}
-EAPI void
-efl_access_relation_set_free(Efl_Access_Relation_Set set)
-{
- Efl_Access_Relation *rel;
- Eina_List *l;
- Eo *obj;
-
- EINA_LIST_FREE(set, rel)
- {
- EINA_LIST_FOREACH(rel->objects, l, obj)
- efl_event_callback_del(obj, EFL_EVENT_DEL, _on_rel_obj_del, set);
- efl_access_relation_free(rel);
- }
-}
-
-EAPI Efl_Access_Relation_Set
-efl_access_relation_set_clone(const Efl_Access_Relation_Set set)
-{
- Efl_Access_Relation_Set ret = NULL;
- Eina_List *l;
- Efl_Access_Relation *rel;
-
- EINA_LIST_FOREACH(set, l, rel)
- {
- Efl_Access_Relation *cpy = efl_access_relation_clone(rel);
- ret = eina_list_append(ret, cpy);
- }
-
- return ret;
-}
-
-EOLIAN static Eina_Bool
-_efl_access_relationship_append(Eo *obj EINA_UNUSED, Efl_Access_Data *sd, Efl_Access_Relation_Type type, const Efl_Access *relation_obj)
-{
- return efl_access_relation_set_relation_append(&sd->relations, type, relation_obj);
-}
-
-EOLIAN static void
-_efl_access_relationship_remove(Eo *obj EINA_UNUSED, Efl_Access_Data *sd, Efl_Access_Relation_Type type, const Efl_Access *relation_obj)
-{
- if (relation_obj)
- efl_access_relation_set_relation_remove(&sd->relations, type, relation_obj);
- else
- efl_access_relation_set_relation_type_remove(&sd->relations, type);
-}
-
EOLIAN static void
-_efl_access_relationships_clear(Eo *obj EINA_UNUSED, Efl_Access_Data *sd)
+_efl_access_object_relationships_clear(Eo *obj EINA_UNUSED, Efl_Access_Object_Data *sd)
{
- efl_access_relation_set_free(sd->relations);
+ efl_access_relation_set_free(sd);
sd->relations = NULL;
}
EOLIAN Eo*
-_efl_access_root_get(Eo *class EINA_UNUSED, void *pd EINA_UNUSED)
+_efl_access_object_access_root_get(const Eo *class EINA_UNUSED, void *pd EINA_UNUSED)
{
if (!root)
- root = efl_add(ELM_ATSPI_APP_OBJECT_CLASS, NULL);
+ root = efl_add(ELM_ATSPI_APP_OBJECT_CLASS, efl_main_loop_get());
return root;
}
EOLIAN Efl_Access_Type
-_efl_access_type_get(Eo *obj EINA_UNUSED, Efl_Access_Data *pd)
+_efl_access_object_access_type_get(const Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd)
{
return pd->type;
}
EOLIAN void
-_efl_access_type_set(Eo *obj, Efl_Access_Data *pd, Efl_Access_Type val)
+_efl_access_object_access_type_set(Eo *obj, Efl_Access_Object_Data *pd, Efl_Access_Type val)
{
- Efl_Access *parent;
+ Efl_Access_Object *parent;
if (val == pd->type)
return;
- parent = efl_access_parent_get(obj);
+ parent = efl_provider_find(efl_parent_get(obj), EFL_ACCESS_OBJECT_MIXIN);
switch (val)
{
@@ -691,14 +627,21 @@ _efl_access_type_set(Eo *obj, Efl_Access_Data *pd, Efl_Access_Type val)
}
EOLIAN void
-_efl_access_efl_object_destructor(Eo *obj, Efl_Access_Data *pd)
+_efl_access_object_efl_object_invalidate(Eo *obj, Efl_Access_Object_Data *pd)
+{
+ efl_access_relation_set_free(pd);
+
+ efl_invalidate(efl_super(obj, EFL_ACCESS_OBJECT_MIXIN));
+}
+
+EOLIAN void
+_efl_access_object_efl_object_destructor(Eo *obj, Efl_Access_Object_Data *pd)
{
eina_stringshare_del(pd->name);
eina_stringshare_del(pd->description);
eina_stringshare_del(pd->translation_domain);
- efl_access_relation_set_free(pd->relations);
- efl_destructor(efl_super(obj, EFL_ACCESS_MIXIN));
+ efl_destructor(efl_super(obj, EFL_ACCESS_OBJECT_MIXIN));
}
void
@@ -712,4 +655,4 @@ _efl_access_shutdown(void)
ELM_SAFE_DEL(root);
}
-#include "efl_access.eo.c"
+#include "efl_access_object.eo.c"
diff --git a/src/lib/elementary/efl_access.eo b/src/lib/elementary/efl_access_object.eo
index 4c937e225f..6a6cd15b99 100644
--- a/src/lib/elementary/efl_access.eo
+++ b/src/lib/elementary/efl_access_object.eo
@@ -1,6 +1,3 @@
-/* FIXME: This definitely shouldn't be here. */
-type Efl_Event_Cb: __undefined_type; [[Efl event callback type]]
-
enum Efl.Access.Type
{
[[Type of accessibility object]]
@@ -242,13 +239,11 @@ struct Efl.Access.Relation
objects: list<Efl.Object>; [[List with relation objects]]
}
-type Efl.Access.Relation_Set: list<ptr(Efl.Access.Relation)>; [[Elementary Accessibility relation set type]]
-
-mixin Efl.Access (Efl.Interface, Efl.Object)
+mixin Efl.Access.Object (Efl.Interface, Efl.Object)
{
[[Accessibility accessible mixin]]
- eo_prefix: efl_access;
- data: Efl_Access_Data;
+ eo_prefix: efl_access_object;
+ data: Efl_Access_Object_Data;
methods {
@property localized_role_name @protected @beta {
[[Gets an localized string describing accessible object role name.]]
@@ -258,23 +253,19 @@ mixin Efl.Access (Efl.Interface, Efl.Object)
localized_name: string; [[Localized accessible object role name]]
}
}
- @property name @beta {
+ @property i18n_name @beta {
[[Accessible name of the object.]]
get {
}
set {
}
values {
- name: string; [[Accessible name]]
+ i18n_name: string; [[Accessible name]]
}
}
- @property relation_set @protected @beta {
+ relations_get @protected @beta @const {
[[Gets an all relations between accessible object and other accessible objects.]]
- get {
- }
- values {
- relations: Efl.Access.Relation_Set; [[Accessible relation set]]
- }
+ return: iterator<ptr(Efl.Access.Relation)>; [[Accessible relation set]]
}
@property role @beta {
[[The role of the object in accessibility domain.]]
@@ -286,12 +277,12 @@ mixin Efl.Access (Efl.Interface, Efl.Object)
role: Efl.Access.Role; [[Accessible role]]
}
}
- @property children @protected @beta {
+ @property access_children @protected @beta {
[[Gets object's accessible children.]]
get {
}
values {
- children: list<Efl.Access> @owned; [[List of widget's children]]
+ children: list<Efl.Access.Object> @owned; [[List of widget's children]]
}
}
@property role_name @protected @beta {
@@ -353,16 +344,6 @@ mixin Efl.Access (Efl.Interface, Efl.Object)
description: string; [[Accessible contextual information]]
}
}
- @property parent @beta {
- [[Object's accessible parent.]]
- get {
- }
- set {
- }
- values {
- parent: Efl.Access; [[Accessible parent]]
- }
- }
@property state_set @protected @beta {
[[Gets set describing object accessible states.]]
get {
@@ -374,7 +355,7 @@ mixin Efl.Access (Efl.Interface, Efl.Object)
event_handler_add @class @protected @beta {
[[Register accessibility event listener]]
params {
- @in cb: Efl_Event_Cb; [[Callback]]
+ @in cb: Efl.Event_Cb; [[Callback]]
@in data: void_ptr; [[Data]]
}
return: ptr(Efl.Access.Event.Handler); [[Event handler]]
@@ -386,10 +367,10 @@ mixin Efl.Access (Efl.Interface, Efl.Object)
}
}
event_emit @class @protected @beta {
- [[Emit event]]
+ [[Emit event]]
params {
- @in accessible: Efl.Access; [[Accessibility object.]]
- @cref event: Efl.Event.Description; [[Accessibility event type.]]
+ @in accessible: Efl.Access.Object; [[Accessibility object.]]
+ @cref event: Efl.Event_Description; [[Accessibility event type.]]
@in event_info: void_ptr; [[Accessibility event details.]]
}
}
@@ -415,7 +396,7 @@ mixin Efl.Access (Efl.Interface, Efl.Object)
domain: string; [[Translation domain]]
}
}
- @property type @beta {
+ @property access_type @beta {
[[Type of accessibility object]]
get {
}
@@ -441,7 +422,7 @@ mixin Efl.Access (Efl.Interface, Efl.Object)
return: bool; [[$true if relationship was successfully appended, $false otherwise]]
params {
@in type: Efl.Access.Relation_Type; [[Relation type]]
- @in relation_object: const(Efl.Access); [[Object to relate to]]
+ @in relation_object: const(Efl.Access.Object); [[Object to relate to]]
}
}
relationship_remove @beta {
@@ -452,13 +433,13 @@ mixin Efl.Access (Efl.Interface, Efl.Object)
]]
params {
@in type: Efl.Access.Relation_Type; [[Relation type]]
- @in relation_object: const(Efl.Access); [[Object to remove relation from]]
+ @in relation_object: const(Efl.Access.Object); [[Object to remove relation from]]
}
}
relationships_clear @beta {
[[Removes all relationships in accessible object.]]
}
- @property root @class @beta {
+ @property access_root @class @beta {
get {
[[Get root object of accessible object hierarchy]]
values {
@@ -469,15 +450,17 @@ mixin Efl.Access (Efl.Interface, Efl.Object)
}
implements {
Efl.Object.destructor;
+ Efl.Object.invalidate;
+ Efl.Object.provider_find;
}
events {
property,changed: string; [[Called when property has changed]]
children,changed: Efl.Access.Event.Children_Changed.Data; [[Called when children have changed]]
state,changed: Efl.Access.Event.State_Changed.Data; [[Called when state has changed]]
bounds,changed: Efl.Access.Event.Geometry_Changed.Data; [[Called when boundaries have changed]]
- visible,data,changed; [[Called when visibility has changed]]
- active,descendant,changed; [[Called when active state of descendant has changed]]
- added; [[Called when item is added]]
- removed; [[Called when item is removed]]
+ visible,data,changed: void; [[Called when visibility has changed]]
+ active,descendant,changed: Efl.Object; [[Called when active state of descendant has changed]]
+ added: void; [[Called when item is added]]
+ removed: void; [[Called when item is removed]]
}
}
diff --git a/src/lib/elementary/efl_access.h b/src/lib/elementary/efl_access_object.h
index ec1d9afe25..72fb57734e 100644
--- a/src/lib/elementary/efl_access.h
+++ b/src/lib/elementary/efl_access_object.h
@@ -4,10 +4,10 @@
#ifdef EFL_BETA_API_SUPPORT
#ifdef EFL_EO_API_SUPPORT
-#include "efl_access.eo.h"
+#include "efl_access_object.eo.h"
#endif
#ifndef EFL_NOLEGACY_API_SUPPORT
-#include "efl_access.eo.legacy.h"
+#include "efl_access_object.eo.legacy.h"
#endif
/*
@@ -30,41 +30,6 @@
*/
EAPI void efl_access_attributes_list_free(Eina_List *list);
-/**
- * Frees relation.
- */
-EAPI void efl_access_relation_free(Efl_Access_Relation *relation);
-
-/**
- * Clones relation.
- */
-EAPI Efl_Access_Relation * efl_access_relation_clone(const Efl_Access_Relation *relation);
-
-/**
- * Appends relation to relation set
- */
-EAPI Eina_Bool efl_access_relation_set_relation_append(Efl_Access_Relation_Set *set, Efl_Access_Relation_Type type, const Eo *rel_obj);
-
-/**
- * Removes relation from relation set
- */
-EAPI void efl_access_relation_set_relation_remove(Efl_Access_Relation_Set *set, Efl_Access_Relation_Type type, const Eo *rel_obj);
-
-/**
- * Removes all relation from relation set of a given type
- */
-EAPI void efl_access_relation_set_relation_type_remove(Efl_Access_Relation_Set *set, Efl_Access_Relation_Type type);
-
-/**
- * Frees Efl_Access_Relation_Set
- */
-EAPI void efl_access_relation_set_free(Efl_Access_Relation_Set set);
-
-/**
- * Clones Efl_Access_Relation_Set
- */
-EAPI Efl_Access_Relation_Set efl_access_relation_set_clone(const Efl_Access_Relation_Set set);
-
#ifdef EFL_EO_API_SUPPORT
/**
@@ -75,7 +40,7 @@ EAPI Efl_Access_Relation_Set efl_access_relation_set_clone(const Efl_Access_Rela
Efl_Access_Event_State_Changed_Data evinfo; \
evinfo.type = (tp); \
evinfo.new_value = (nvl); \
- efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_EVENT_STATE_CHANGED, (void*)&evinfo); \
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_OBJECT_EVENT_STATE_CHANGED, (void*)&evinfo); \
} while(0); }
/**
@@ -84,38 +49,38 @@ EAPI Efl_Access_Relation_Set efl_access_relation_set_clone(const Efl_Access_Rela
#define efl_access_bounds_changed_signal_emit(obj, x, y, width, height) \
do { \
Efl_Access_Event_Geometry_Changed_Data evinfo = { x, y, width, height }; \
- efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_EVENT_BOUNDS_CHANGED, (void*)&evinfo); \
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_OBJECT_EVENT_BOUNDS_CHANGED, (void*)&evinfo); \
} while(0);
/**
* Emits Accessible 'PropertyChanged' signal for 'Name' property.
*/
-#define efl_access_name_changed_signal_emit(obj) \
- efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_EVENT_PROPERTY_CHANGED, "name");
+#define efl_access_i18n_name_changed_signal_emit(obj) \
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_OBJECT_EVENT_PROPERTY_CHANGED, "i18n_name");
/**
* Emits Accessible 'PropertyChanged' signal for 'Description' property.
*/
#define efl_access_description_changed_signal_emit(obj) \
- efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_EVENT_PROPERTY_CHANGED, "description");
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_OBJECT_EVENT_PROPERTY_CHANGED, "description");
/**
* Emits Accessible 'PropertyChanged' signal for 'Parent' property.
*/
#define efl_access_parent_changed_signal_emit(obj) \
- efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_EVENT_PROPERTY_CHANGED, "parent");
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_OBJECT_EVENT_PROPERTY_CHANGED, "parent");
/**
* Emits Accessible 'PropertyChanged' signal for 'Role' property.
*/
#define efl_access_role_changed_signal_emit(obj) \
- efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_EVENT_PROPERTY_CHANGED, "role");
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_OBJECT_EVENT_PROPERTY_CHANGED, "role");
/**
* Emits Accessible 'PropertyChanged' signal for 'Value' property.
*/
#define efl_access_value_changed_signal_emit(obj) \
- efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_EVENT_PROPERTY_CHANGED, "value");
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_OBJECT_EVENT_PROPERTY_CHANGED, "value");
/**
* Emits Accessible 'ChildrenChanged' signal with added child as argument.
@@ -123,7 +88,7 @@ EAPI Efl_Access_Relation_Set efl_access_relation_set_clone(const Efl_Access_Rela
#define efl_access_children_changed_added_signal_emit(obj, child) \
do { \
Efl_Access_Event_Children_Changed_Data atspi_data = { EINA_TRUE, child }; \
- efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_EVENT_CHILDREN_CHANGED, &atspi_data); \
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_OBJECT_EVENT_CHILDREN_CHANGED, &atspi_data); \
} while(0);
/**
@@ -132,32 +97,32 @@ EAPI Efl_Access_Relation_Set efl_access_relation_set_clone(const Efl_Access_Rela
#define efl_access_children_changed_del_signal_emit(obj, child) \
do { \
Efl_Access_Event_Children_Changed_Data atspi_data = { EINA_FALSE, child }; \
- efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_EVENT_CHILDREN_CHANGED, &atspi_data); \
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_OBJECT_EVENT_CHILDREN_CHANGED, &atspi_data); \
} while(0);
/**
* Emits Accessible 'ActiveDescendantChanged' signal.
*/
#define efl_access_active_descendant_changed_signal_emit(obj, child) \
- efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_EVENT_ACTIVE_DESCENDANT_CHANGED, child);
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_OBJECT_EVENT_ACTIVE_DESCENDANT_CHANGED, child);
/**
* Emits Accessible 'VisibleDataChanged' signal.
*/
#define efl_access_visible_data_changed_signal_emit(obj) \
- efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_EVENT_VISIBLE_DATA_CHANGED, NULL);
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_OBJECT_EVENT_VISIBLE_DATA_CHANGED, NULL);
/**
* Emits Accessible 'AddAccessible' signal.
*/
#define efl_access_added(obj) \
- efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_EVENT_ADDED, NULL);
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_OBJECT_EVENT_ADDED, NULL);
/**
* Emits Accessible 'RemoveAccessible' signal.
*/
#define efl_access_removed(obj) \
- efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_EVENT_REMOVED, NULL);
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_OBJECT_EVENT_REMOVED, NULL);
#endif
diff --git a/src/lib/elementary/efl_access_selection.eo b/src/lib/elementary/efl_access_selection.eo
index f25b2c245b..82e3202109 100644
--- a/src/lib/elementary/efl_access_selection.eo
+++ b/src/lib/elementary/efl_access_selection.eo
@@ -42,7 +42,7 @@ interface Efl.Access.Selection ()
[[Adds selection for all children]]
return: bool; [[$true if selection was added to all children, $false otherwise]]
}
- clear @protected @beta {
+ access_selection_clear @protected @beta {
[[Clears the current selection]]
return: bool; [[$true if selection was cleared, $false otherwise]]
}
@@ -55,6 +55,6 @@ interface Efl.Access.Selection ()
}
}
events {
- selection,changed; [[Called when selection has been changed.]]
+ selection,changed: void; [[Called when selection has been changed.]]
}
}
diff --git a/src/lib/elementary/efl_access_text.eo b/src/lib/elementary/efl_access_text.eo
index 2fd823025b..c4b616d57e 100644
--- a/src/lib/elementary/efl_access_text.eo
+++ b/src/lib/elementary/efl_access_text.eo
@@ -1,6 +1,6 @@
import eina_types;
-enum Efl.Access.Text.Granularity
+enum Efl.Access.Text_Granularity
{
[[Text accessibility granularity]]
char, [[Character granularity]]
@@ -10,7 +10,7 @@ enum Efl.Access.Text.Granularity
paragraph [[Paragraph granularity]]
}
-enum Efl.Access.Text.Clip_Type
+enum Efl.Access.Text_Clip_Type
{
[[Text clip type]]
legacy: elm_atspi_text_clip;
@@ -20,14 +20,14 @@ enum Efl.Access.Text.Clip_Type
both [[Both clip types]]
}
-struct Efl.Access.Text.Attribute
+struct Efl.Access.Text_Attribute
{
[[Text attribute]]
name: string; [[Text attribute name]]
value: string; [[Text attribute value]]
}
-struct Efl.Access.Text.Range
+struct Efl.Access.Text_Range
{
[[Text range]]
start_offset: int; [[Range start offset]]
@@ -35,7 +35,7 @@ struct Efl.Access.Text.Range
content: ptr(char); [[Range content]]
}
-struct Efl.Access.Text.Change_Info
+struct Efl.Access.Text_Change_Info
{
[[Text change information]]
content: string; [[Change content]]
@@ -64,7 +64,7 @@ interface Efl.Access.Text ()
[[Gets string, start and end offset in text according to given initial offset and granularity.]]
}
keys {
- granularity: Efl.Access.Text.Granularity; [[Text granularity]]
+ granularity: Efl.Access.Text_Granularity; [[Text granularity]]
start_offset: ptr(int) @nonull; [[Offset indicating start of string according to given granularity. -1 in case of error.]]
end_offset: ptr(int); [[Offset indicating end of string according to given granularity. -1 in case of error.]]
}
@@ -72,7 +72,7 @@ interface Efl.Access.Text ()
string: mstring @owned; [[Newly allocated UTF-8 encoded string. Must be free by a user.]]
}
}
- @property text @protected @beta {
+ @property access_text @protected @beta {
get {
[[Gets text of accessible widget.]]
}
@@ -85,7 +85,7 @@ interface Efl.Access.Text ()
}
}
@property caret_offset @protected @beta {
- [[Caret offset property]]
+ [[Caret offset property]]
get {
[[Gets offset position of caret (cursor)]]
}
@@ -110,7 +110,7 @@ interface Efl.Access.Text ()
value: mstring @owned; [[Value of text attribute. Should be free()]]
}
}
- @property attributes @protected @beta {
+ @property text_attributes @protected @beta {
get {
[[Gets list of all text attributes.]]
}
@@ -119,19 +119,19 @@ interface Efl.Access.Text ()
end_offset: ptr(int); [[End offset]]
}
values {
- attributes: list<ptr(Efl.Access.Text.Attribute) @owned> @owned; [[List of text attributes]]
+ attributes: list<ptr(Efl.Access.Text_Attribute) @owned> @owned; [[List of text attributes]]
}
}
@property default_attributes @protected @beta {
- [[Default attributes]]
+ [[Default attributes]]
get {
}
values {
- attributes: list<ptr(Efl.Access.Text.Attribute) @owned> @owned; [[List of default attributes]]
+ attributes: list<ptr(Efl.Access.Text_Attribute) @owned> @owned; [[List of default attributes]]
}
}
@property character_extents @protected @beta {
- [[Character extents]]
+ [[Character extents]]
get {
return: bool; [[$true if character extents, $false otherwise]]
}
@@ -144,7 +144,7 @@ interface Efl.Access.Text ()
}
}
@property character_count @protected @beta {
- [[Character count]]
+ [[Character count]]
get {
}
values {
@@ -152,7 +152,7 @@ interface Efl.Access.Text ()
}
}
@property offset_at_point @protected @beta {
- [[Offset at given point]]
+ [[Offset at given point]]
get {
}
keys {
@@ -165,21 +165,21 @@ interface Efl.Access.Text ()
}
}
@property bounded_ranges @protected @beta {
- [[Bounded ranges]]
+ [[Bounded ranges]]
get {
}
keys {
screen_coords: bool; [[If $true, x and y values will be relative to screen origin, otherwise relative to canvas]]
rect: Eina.Rect; [[Bounding box]]
- xclip: Efl.Access.Text.Clip_Type; [[xclip]]
- yclip: Efl.Access.Text.Clip_Type; [[yclip]]
+ xclip: Efl.Access.Text_Clip_Type; [[xclip]]
+ yclip: Efl.Access.Text_Clip_Type; [[yclip]]
}
values {
- ranges: list<ptr(Efl.Access.Text.Range) @owned> @owned; [[List of ranges]]
+ ranges: list<ptr(Efl.Access.Text_Range) @owned> @owned; [[List of ranges]]
}
}
@property range_extents @protected @beta {
- [[Range extents]]
+ [[Range extents]]
get {
return: bool; [[$true if range extents, $false otherwise]]
}
@@ -200,7 +200,7 @@ interface Efl.Access.Text ()
count: int; [[Selection counter]]
}
}
- @property selection @protected @beta {
+ @property access_selection @protected @beta {
[[Selection property]]
get {
}
@@ -232,11 +232,13 @@ interface Efl.Access.Text ()
}
}
events {
- access,text,bounds,changed; [[Text bounds have changed]]
- access,text,attributes,changed; [[Text attributes have changed]]
- access,text,caret,moved; [[Caret moved]]
- access,text,inserted; [[Text was inserted]]
- access,text,removed; [[Text was removed]]
- access,text,selection,changed; [[Text selection has changed]]
+ /* FIXME: Nobody emits these
+ access,text,bounds,changed: void; [[Text bounds have changed]]
+ access,text,attributes,changed: void; [[Text attributes have changed]]
+ */
+ access,text,caret,moved: void; [[Caret moved]]
+ access,text,inserted: Efl.Access.Text_Change_Info; [[Text was inserted]]
+ access,text,removed: Efl.Access.Text_Change_Info; [[Text was removed]]
+ access,text,selection,changed: void; [[Text selection has changed]]
}
}
diff --git a/src/lib/elementary/efl_access_value.eo b/src/lib/elementary/efl_access_value.eo
index 4a7f676bf6..703f18b84b 100644
--- a/src/lib/elementary/efl_access_value.eo
+++ b/src/lib/elementary/efl_access_value.eo
@@ -3,7 +3,7 @@ interface Efl.Access.Value ()
[[Elementary Access value interface]]
methods {
@property value_and_text @protected @beta {
- [[Value and text property]]
+ [[Value and text property]]
get {
[[Gets value displayed by a accessible widget.]]
}
diff --git a/src/lib/elementary/efl_access_widget_action.c b/src/lib/elementary/efl_access_widget_action.c
index 89836ede0b..bb0c920f49 100644
--- a/src/lib/elementary/efl_access_widget_action.c
+++ b/src/lib/elementary/efl_access_widget_action.c
@@ -49,7 +49,7 @@ _efl_access_widget_action_efl_access_action_action_keybinding_get(Eo *obj, void
Elm_Config_Binding_Key *binding;
int tmp = 0;
- if (!efl_isa(obj, ELM_WIDGET_CLASS))
+ if (!efl_isa(obj, EFL_UI_WIDGET_CLASS))
return NULL;
actions = efl_access_widget_action_elm_actions_get(obj);
@@ -94,7 +94,7 @@ _efl_access_widget_action_efl_access_action_action_keybinding_get(Eo *obj, void
}
EOLIAN static const char *
-_efl_access_widget_action_efl_access_action_action_name_get(Eo *obj, void *pd EINA_UNUSED, int id)
+_efl_access_widget_action_efl_access_action_action_name_get(const Eo *obj, void *pd EINA_UNUSED, int id)
{
const Efl_Access_Action_Data *actions = NULL;
int tmp = 0;
@@ -117,13 +117,13 @@ _efl_access_widget_action_efl_access_action_action_description_set(Eo *obj EINA_
}
EOLIAN static const char *
-_efl_access_widget_action_efl_access_action_action_description_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, int id EINA_UNUSED)
+_efl_access_widget_action_efl_access_action_action_description_get(const Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, int id EINA_UNUSED)
{
return NULL;
}
EOLIAN static Eina_List*
-_efl_access_widget_action_efl_access_action_actions_get(Eo *obj, void *pd EINA_UNUSED)
+_efl_access_widget_action_efl_access_action_actions_get(const Eo *obj, void *pd EINA_UNUSED)
{
const Efl_Access_Action_Data *actions = NULL;
Eina_List *ret = NULL;
diff --git a/src/lib/elementary/efl_access_widget_action.eo b/src/lib/elementary/efl_access_widget_action.eo
index e640db8d9b..4424d428dd 100644
--- a/src/lib/elementary/efl_access_widget_action.eo
+++ b/src/lib/elementary/efl_access_widget_action.eo
@@ -1,4 +1,4 @@
-import elm_general;
+import efl_ui;
mixin Efl.Access.Widget.Action (Efl.Access.Action)
{
diff --git a/src/lib/elementary/efl_access_window.eo b/src/lib/elementary/efl_access_window.eo
index 2fcb738b60..bc91e3494e 100644
--- a/src/lib/elementary/efl_access_window.eo
+++ b/src/lib/elementary/efl_access_window.eo
@@ -2,12 +2,12 @@ interface Efl.Access.Window ()
{
[[Elementary accessible window interface]]
events {
- window,created; [[Called when new window has been created.]]
- window,destroyed; [[Called when window has been destroyed.]]
- window,activated; [[Called when window has been activated. (unfocused)]]
- window,deactivated; [[Called when window has been deactivated (unfocused).]]
- window,maximized; [[Called when window has been maximmized]]
- window,minimized; [[Called when window has been minimized]]
- window,restored; [[Called when window has been restored]]
+ window,created: void; [[Called when new window has been created.]]
+ window,destroyed: void; [[Called when window has been destroyed.]]
+ window,activated: void; [[Called when window has been activated. (unfocused)]]
+ window,deactivated: void; [[Called when window has been deactivated (unfocused).]]
+ window,maximized: void; [[Called when window has been maximmized]]
+ window,minimized: void; [[Called when window has been minimized]]
+ window,restored: void; [[Called when window has been restored]]
}
}
diff --git a/src/lib/elementary/efl_access_window.h b/src/lib/elementary/efl_access_window.h
index 06dce849b1..38938d21ca 100644
--- a/src/lib/elementary/efl_access_window.h
+++ b/src/lib/elementary/efl_access_window.h
@@ -14,43 +14,43 @@
* Emits 'Window:Activated' accessible signal.
*/
#define efl_access_window_activated_signal_emit(obj) \
- efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_WINDOW_EVENT_WINDOW_ACTIVATED, NULL);
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_WINDOW_EVENT_WINDOW_ACTIVATED, NULL);
/**
* Emits 'Window:Deactivated' accessible signal.
*/
#define efl_access_window_deactivated_signal_emit(obj) \
- efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_WINDOW_EVENT_WINDOW_DEACTIVATED, NULL);
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_WINDOW_EVENT_WINDOW_DEACTIVATED, NULL);
/**
* Emits 'Window:Created' accessible signal.
*/
#define efl_access_window_created_signal_emit(obj) \
- efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_WINDOW_EVENT_WINDOW_CREATED, NULL);
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_WINDOW_EVENT_WINDOW_CREATED, NULL);
/**
* Emits 'Window:Destroyed' accessible signal.
*/
#define efl_access_window_destroyed_signal_emit(obj) \
- efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_WINDOW_EVENT_WINDOW_DESTROYED, NULL);
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_WINDOW_EVENT_WINDOW_DESTROYED, NULL);
/**
* Emits 'Window:Maximized' accessible signal.
*/
#define efl_access_window_maximized_signal_emit(obj) \
- efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_WINDOW_EVENT_WINDOW_MAXIMIZED, NULL);
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_WINDOW_EVENT_WINDOW_MAXIMIZED, NULL);
/**
* Emits 'Window:Minimized' accessible signal.
*/
#define efl_access_window_minimized_signal_emit(obj) \
- efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_WINDOW_EVENT_WINDOW_MINIMIZED, NULL);
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_WINDOW_EVENT_WINDOW_MINIMIZED, NULL);
/**
* Emits 'Window:Restored' accessible signal.
*/
#define efl_access_window_restored_signal_emit(obj) \
- efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_WINDOW_EVENT_WINDOW_RESTORED, NULL);
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_WINDOW_EVENT_WINDOW_RESTORED, NULL);
#endif
#endif
diff --git a/src/lib/elementary/efl_config_global.eo b/src/lib/elementary/efl_config_global.eo
index 2114036039..38d4a94dfb 100644
--- a/src/lib/elementary/efl_config_global.eo
+++ b/src/lib/elementary/efl_config_global.eo
@@ -1,4 +1,4 @@
-class Efl.Config.Global (Efl.Object, Efl.Config)
+class Efl.Config_Global (Efl.Object, Efl.Config)
{
[[This class is a singleton representing the global configuration for the
running application.
diff --git a/src/lib/elementary/efl_datetime_manager.c b/src/lib/elementary/efl_datetime_manager.c
new file mode 100644
index 0000000000..8739be8251
--- /dev/null
+++ b/src/lib/elementary/efl_datetime_manager.c
@@ -0,0 +1,193 @@
+#include <config.h>
+#include "Efl.h"
+
+#ifdef HAVE_LANGINFO_H
+# include <langinfo.h>
+#endif
+
+#include <Elementary.h>
+#include "elm_priv.h"
+
+#define MY_CLASS EFL_DATETIME_MANAGER_CLASS
+
+#define MAX_FORMAT_LEN 32
+
+static const char *multifield_formats = "cxXrRTDF";
+
+typedef struct
+{
+ Efl_Time time;
+ char format[MAX_FORMAT_LEN];
+} Efl_Datetime_Manager_Data;
+
+Eina_Bool init = EINA_FALSE;
+
+static void
+_time_init(Efl_Time *curr_time)
+{
+ time_t t;
+
+ t = time(NULL);
+ localtime_r(&t, curr_time);
+
+ init = EINA_TRUE;
+}
+
+static char *
+_expanded_fmt_str_get(char ch)
+{
+ char *exp_fmt = "";
+ switch (ch)
+ {
+ case 'c':
+#if defined(HAVE_LANGINFO_H) || defined (_WIN32)
+ exp_fmt = nl_langinfo(D_T_FMT);
+#else
+ exp_fmt = "";
+#endif
+ break;
+
+ case 'x':
+#if defined(HAVE_LANGINFO_H) || defined (_WIN32)
+ exp_fmt = nl_langinfo(D_FMT);
+#else
+ exp_fmt = "";
+#endif
+ break;
+
+ case 'X':
+#if defined(HAVE_LANGINFO_H) || defined (_WIN32)
+ exp_fmt = nl_langinfo(T_FMT);
+#else
+ exp_fmt = "";
+#endif
+ break;
+
+ case 'r':
+#if defined(HAVE_LANGINFO_H) || defined (_WIN32)
+ exp_fmt = nl_langinfo(T_FMT_AMPM);
+#else
+ exp_fmt = "";
+#endif
+ break;
+
+ case 'R':
+ exp_fmt = "%H:%M";
+ break;
+
+ case 'T':
+ exp_fmt = "%H:%M:%S";
+ break;
+
+ case 'D':
+ exp_fmt = "%m/%d/%y";
+ break;
+
+ case 'F':
+ exp_fmt = "%Y-%m-%d";
+ break;
+
+ default:
+ exp_fmt = "";
+ break;
+ }
+
+ return exp_fmt;
+}
+
+static void
+_expand_format(char *dt_fmt)
+{
+ char *ptr, *expanded_fmt, ch;
+ unsigned int idx, len = 0;
+ char buf[MAX_FORMAT_LEN] = {0, };
+ Eina_Bool fmt_char, fmt_expanded;
+
+ do {
+ idx = 0;
+ fmt_char = EINA_FALSE;
+ fmt_expanded = EINA_FALSE;
+ ptr = dt_fmt;
+ while ((ch = *ptr))
+ {
+ if ((fmt_char) && (strchr(multifield_formats, ch)))
+ {
+ /* replace the multi-field format characters with
+ * corresponding expanded format */
+ expanded_fmt = _expanded_fmt_str_get(ch);
+ len = strlen(expanded_fmt);
+ if (len > 0) fmt_expanded = EINA_TRUE;
+ buf[--idx] = 0;
+ strncat(buf, expanded_fmt, len);
+ idx += len;
+ }
+ else buf[idx++] = ch;
+
+ if (ch == '%') fmt_char = EINA_TRUE;
+ else fmt_char = EINA_FALSE;
+
+ ptr++;
+ }
+
+ buf[idx] = 0;
+ strncpy(dt_fmt, buf, MAX_FORMAT_LEN);
+ } while (fmt_expanded);
+}
+
+EOLIAN static Eo*
+_efl_datetime_manager_efl_object_constructor(Eo *obj, Efl_Datetime_Manager_Data *pd EINA_UNUSED)
+{
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+
+ return obj;
+}
+
+
+EOLIAN static void
+_efl_datetime_manager_efl_object_destructor(Eo *obj, Efl_Datetime_Manager_Data *pd EINA_UNUSED)
+{
+ efl_destructor(efl_super(obj, MY_CLASS));
+}
+
+EOLIAN static void
+_efl_datetime_manager_value_set(Eo *obj EINA_UNUSED, Efl_Datetime_Manager_Data *pd, Efl_Time newtime)
+{
+ pd->time = newtime;
+}
+
+EOLIAN static Efl_Time
+_efl_datetime_manager_value_get(const Eo *obj EINA_UNUSED, Efl_Datetime_Manager_Data *pd)
+{
+ if (!init) _time_init(&pd->time);
+
+ return pd->time;
+}
+
+EOLIAN static void
+_efl_datetime_manager_format_set(Eo *obj EINA_UNUSED, Efl_Datetime_Manager_Data *pd EINA_UNUSED, const char *fmt EINA_UNUSED)
+{
+ //Is this needed?
+}
+
+EOLIAN static const char *
+_efl_datetime_manager_format_get(const Eo *obj EINA_UNUSED, Efl_Datetime_Manager_Data *pd)
+{
+#if defined(HAVE_LANGINFO_H) || defined (_WIN32)
+ strncpy(pd->format, nl_langinfo(D_T_FMT), MAX_FORMAT_LEN);
+#else
+ strncpy(pd->format, "", MAX_FORMAT_LEN);
+#endif
+ pd->format[MAX_FORMAT_LEN - 1] = '\0';
+
+ _expand_format(pd->format);
+
+ return pd->format;
+}
+EOLIAN static const char *
+_efl_datetime_manager_string_get(const Eo *obj EINA_UNUSED, Efl_Datetime_Manager_Data *pd EINA_UNUSED, const char *fmt EINA_UNUSED)
+{
+ //TODO: strftime on upsteam, icu module connect here on tizen.
+ return NULL;
+}
+#include "efl_datetime_manager.eo.c"
+
diff --git a/src/lib/elementary/efl_datetime_manager.eo b/src/lib/elementary/efl_datetime_manager.eo
new file mode 100644
index 0000000000..0728dc7312
--- /dev/null
+++ b/src/lib/elementary/efl_datetime_manager.eo
@@ -0,0 +1,50 @@
+import efl_types;
+
+class Efl.Datetime.Manager (Efl.Object)
+{
+ [[Efl datetime manager class for Datepicker and Timepicker]]
+ methods {
+ @property value {
+ [[The value of a date, time for Datepicker or Timepicker.
+
+ The value for Datepicker contains year, month, and day. (tm_year, tm_mon, and tm_mday in Efl_Time)
+ The value for Timepicker contains hour, and min. (tm_hour, and tm_min in Efl_Time)
+ ]]
+ set {
+ }
+ get {
+ }
+ values {
+ newtime: Efl.Time; [[Time structure containing date or time value.]]
+ }
+ }
+ @property format {
+ [[The format of date or time.
+
+ Default format is taken as per the system locale settings.
+ ]]
+ set {
+ }
+ get {
+ }
+ values {
+ fmt: string; [[The format string]]
+ }
+ }
+ @property string {
+ get {
+ [[Get the string that matches with the format.]]
+ }
+ keys {
+ fmt: string; [[The format string]]
+ }
+ values {
+ string: string; [[The string that matches with the format]]
+ }
+ }
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Object.destructor;
+ }
+}
diff --git a/src/lib/elementary/efl_page_indicator.c b/src/lib/elementary/efl_page_indicator.c
new file mode 100644
index 0000000000..86ea8511e5
--- /dev/null
+++ b/src/lib/elementary/efl_page_indicator.c
@@ -0,0 +1,58 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <Elementary.h>
+#include "elm_priv.h"
+
+#include "efl_page_indicator.h"
+#include "efl_ui_widget_pager.h"
+
+#define MY_CLASS EFL_PAGE_INDICATOR_CLASS
+
+
+
+EOLIAN static void
+_efl_page_indicator_update(Eo *obj EINA_UNUSED,
+ Efl_Page_Indicator_Data *pd EINA_UNUSED,
+ double pos EINA_UNUSED)
+{
+
+}
+
+EOLIAN static void
+_efl_page_indicator_pack(Eo *obj EINA_UNUSED,
+ Efl_Page_Indicator_Data *pd,
+ int index EINA_UNUSED)
+{
+ pd->cnt++;
+}
+
+EOLIAN static void
+_efl_page_indicator_bind(Eo *obj EINA_UNUSED,
+ Efl_Page_Indicator_Data *pd,
+ Eo *pager,
+ Efl_Canvas_Group *idbox)
+{
+ if (pd->pager.obj == pager) return;
+
+ pd->pager.obj = pager;
+ pd->idbox = idbox;
+
+ if (pager)
+ pd->cnt = efl_content_count(pd->pager.obj);
+}
+
+
+EOAPI EFL_VOID_FUNC_BODYV(efl_page_indicator_update,
+ EFL_FUNC_CALL(pos), double pos)
+EOAPI EFL_VOID_FUNC_BODYV(efl_page_indicator_pack,
+ EFL_FUNC_CALL(index), int index)
+
+#define EFL_PAGE_INDICATOR_EXTRA_OPS \
+ EFL_OBJECT_OP_FUNC(efl_page_indicator_update, \
+ _efl_page_indicator_update), \
+ EFL_OBJECT_OP_FUNC(efl_page_indicator_pack, \
+ _efl_page_indicator_pack)
+
+#include "efl_page_indicator.eo.c"
diff --git a/src/lib/elementary/efl_page_indicator.eo b/src/lib/elementary/efl_page_indicator.eo
new file mode 100644
index 0000000000..110c4be072
--- /dev/null
+++ b/src/lib/elementary/efl_page_indicator.eo
@@ -0,0 +1,18 @@
+class Efl.Page.Indicator (Efl.Object)
+{
+ [[Page indicator
+
+ Page indicator is used with @Efl.Ui.Pager.
+ It is located on the top layer of pager widget and helps users to know
+ the number of pages and the current page's index without scrolling.
+ ]]
+ methods {
+ bind {
+ [[set object]]
+ params {
+ @in pager: Efl.Ui.Pager; [[pager object]]
+ @in group: Efl.Canvas.Group; [[a dummy object for layer adjustment]]
+ }
+ }
+ }
+}
diff --git a/src/lib/elementary/efl_page_indicator.h b/src/lib/elementary/efl_page_indicator.h
new file mode 100644
index 0000000000..42dc88651d
--- /dev/null
+++ b/src/lib/elementary/efl_page_indicator.h
@@ -0,0 +1,23 @@
+#ifndef EFL_PAGE_INDICATOR_H
+#define EFL_PAGE_INDICATOR_H
+
+typedef struct _Efl_Page_Indicator_Data Efl_Page_Indicator_Data;
+
+struct _Efl_Page_Indicator_Data
+{
+ struct {
+ Efl_Object *obj;
+ Efl_Object *group;
+ Evas_Coord x, y, w, h;
+ } pager;
+
+ Efl_Ui_Box *idbox;
+
+ int cnt;
+};
+
+#define EFL_PAGE_INDICATOR_DATA_GET(o, pd) \
+ Efl_Page_Indicator_Data *pd = \
+ efl_data_scope_get(o, EFL_PAGE_INDICATOR_CLASS)
+
+#endif
diff --git a/src/lib/elementary/efl_page_indicator_icon.c b/src/lib/elementary/efl_page_indicator_icon.c
new file mode 100644
index 0000000000..9b9f02c78b
--- /dev/null
+++ b/src/lib/elementary/efl_page_indicator_icon.c
@@ -0,0 +1,152 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <Elementary.h>
+#include "elm_priv.h"
+
+#include "efl_page_indicator_icon.h"
+#include "efl_page_indicator.h"
+#include "efl_ui_widget_pager.h"
+
+#define MY_CLASS EFL_PAGE_INDICATOR_ICON_CLASS
+
+
+
+EOLIAN static void
+_efl_page_indicator_icon_update(Eo *obj,
+ Efl_Page_Indicator_Icon_Data *pd,
+ double pos)
+{
+ EFL_PAGE_INDICATOR_DATA_GET(obj, spd);
+ Eo *item;
+ int page = efl_ui_pager_current_page_get(spd->pager.obj);
+ double delta = fabs(pos);
+
+ if (pd->curr)
+ {
+ eina_value_set(pd->v, 0.0);
+ efl_layout_signal_message_send(pd->curr, 1, *(pd->v));
+ if (pd->adj) efl_layout_signal_message_send(pd->adj, 1, *(pd->v));
+ }
+
+ item = eina_list_nth(pd->items, page);
+ eina_value_set(pd->v, (1.0 - delta));
+ efl_layout_signal_message_send(item, 1, *(pd->v));
+ pd->curr = item;
+
+ if (pos < 0)
+ item = eina_list_nth(pd->items, (page - 1 + spd->cnt) % spd->cnt);
+ else
+ item = eina_list_nth(pd->items, (page + 1 + spd->cnt) % spd->cnt);
+
+ eina_value_set(pd->v, delta);
+ efl_layout_signal_message_send(item, 1, *(pd->v));
+ pd->adj = item;
+}
+
+EOLIAN static void
+_efl_page_indicator_icon_pack(Eo *obj,
+ Efl_Page_Indicator_Icon_Data *pd,
+ int index)
+{
+ EFL_PAGE_INDICATOR_DATA_GET(obj, spd);
+ Eo *item, *existing;
+
+ efl_page_indicator_pack(efl_super(obj, MY_CLASS), index);
+
+ item = efl_add(EFL_CANVAS_LAYOUT_CLASS, spd->idbox);
+ elm_widget_theme_object_set(spd->idbox, item,
+ "pager", "indicator", "default");
+ efl_gfx_size_hint_align_set(item, 0.5, 0.5);
+ efl_gfx_size_hint_weight_set(item, 0, 0);
+
+ if (index == 0)
+ {
+ pd->items = eina_list_prepend(pd->items, item);
+ efl_pack_begin(spd->idbox, item);
+ }
+ else if (index == (spd->cnt - 1))
+ {
+ pd->items = eina_list_append(pd->items, item);
+ efl_pack_end(spd->idbox, item);
+ }
+ else
+ {
+ existing = eina_list_nth(pd->items, index);
+ pd->items = eina_list_prepend_relative(pd->items, item, existing);
+ efl_pack_before(spd->idbox, item, existing);
+ }
+}
+
+EOLIAN static void
+_efl_page_indicator_icon_efl_page_indicator_bind(Eo *obj,
+ Efl_Page_Indicator_Icon_Data *pd,
+ Eo *pager,
+ Efl_Canvas_Group *idbox)
+{
+ EFL_PAGE_INDICATOR_DATA_GET(obj, spd);
+ Eo *item;
+ int i, page;
+
+ if (spd->pager.obj)
+ {
+ EINA_LIST_FREE(pd->items, item)
+ {
+ efl_del(item);
+ }
+ }
+
+ efl_page_indicator_bind(efl_super(obj, MY_CLASS), pager, idbox);
+
+ if (spd->pager.obj)
+ {
+ efl_ui_direction_set(spd->idbox, EFL_UI_DIR_HORIZONTAL);
+ efl_pack_padding_set(spd->idbox, 15, 15, EINA_TRUE);
+
+ pd->v = eina_value_float_new(0.0);
+
+ if (spd->cnt != 0)
+ {
+ for (i = 0; i < spd->cnt; i++)
+ {
+ item = efl_add(EFL_CANVAS_LAYOUT_CLASS, spd->idbox);
+ pd->items = eina_list_append(pd->items, item);
+
+ elm_widget_theme_object_set(spd->idbox, item,
+ "pager", "indicator", "default");
+ efl_gfx_size_hint_align_set(item, 0.5, 0.5);
+ efl_gfx_size_hint_weight_set(item, 0, 0);
+ efl_pack_end(spd->idbox, item);
+ }
+
+ page = efl_ui_pager_current_page_get(spd->pager.obj);
+ item = eina_list_nth(pd->items, page);
+ eina_value_set(pd->v, 1.0);
+ efl_layout_signal_message_send(item, 1, *(pd->v));
+
+ pd->curr = item;
+ }
+ }
+}
+
+EOLIAN static void
+_efl_page_indicator_icon_efl_object_invalidate(Eo *obj,
+ Efl_Page_Indicator_Icon_Data *pd)
+{
+ Eo *item;
+
+ EINA_LIST_FREE(pd->items, item)
+ efl_del(item);
+
+ efl_invalidate(efl_super(obj, MY_CLASS));
+}
+
+
+#define EFL_PAGE_INDICATOR_ICON_EXTRA_OPS \
+ EFL_OBJECT_OP_FUNC(efl_page_indicator_update, \
+ _efl_page_indicator_icon_update), \
+ EFL_OBJECT_OP_FUNC(efl_page_indicator_pack, \
+ _efl_page_indicator_icon_pack)
+
+#include "efl_page_indicator_icon.eo.c"
diff --git a/src/lib/elementary/efl_page_indicator_icon.eo b/src/lib/elementary/efl_page_indicator_icon.eo
new file mode 100644
index 0000000000..6a46d8071c
--- /dev/null
+++ b/src/lib/elementary/efl_page_indicator_icon.eo
@@ -0,0 +1,13 @@
+class Efl.Page.Indicator_Icon (Efl.Page.Indicator)
+{
+ [[Icon type page indicator
+
+ This class offers icon type indicator for @Efl.Ui.Pager.
+ This type of page indicator creates the same number of icons as pages and
+ arrange them in a linear order. An icon has two states: default and selected.
+ ]]
+ implements {
+ Efl.Object.invalidate;
+ Efl.Page.Indicator.bind;
+ }
+}
diff --git a/src/lib/elementary/efl_page_indicator_icon.h b/src/lib/elementary/efl_page_indicator_icon.h
new file mode 100644
index 0000000000..3c125fd475
--- /dev/null
+++ b/src/lib/elementary/efl_page_indicator_icon.h
@@ -0,0 +1,19 @@
+#ifndef EFL_PAGE_INDICATOR_ICON_H
+#define EFL_PAGE_INDICATOR_ICON_H
+
+typedef struct _Efl_Page_Indicator_Icon_Data Efl_Page_Indicator_Icon_Data;
+
+struct _Efl_Page_Indicator_Icon_Data
+{
+ Eo *curr, *adj;
+
+ Eina_List *items;
+ Eina_Value *v;
+};
+
+
+#define EFL_PAGE_INDICATOR_ICON_DATA_GET(o, pd) \
+ Efl_Page_Indicator_Icon_Data *pd = \
+ efl_data_scope_get(o, EFL_PAGE_INDICATOR_ICON_CLASS)
+
+#endif
diff --git a/src/lib/elementary/efl_page_transition.c b/src/lib/elementary/efl_page_transition.c
new file mode 100644
index 0000000000..69d4a8e020
--- /dev/null
+++ b/src/lib/elementary/efl_page_transition.c
@@ -0,0 +1,107 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <Elementary.h>
+#include "elm_priv.h"
+
+#include "efl_page_transition.h"
+#include "efl_ui_widget_pager.h"
+
+#define MY_CLASS EFL_PAGE_TRANSITION_CLASS
+
+
+EOLIAN static void
+_efl_page_transition_page_size_set(Eo *obj EINA_UNUSED,
+ Efl_Page_Transition_Data *pd,
+ Eina_Size2D sz)
+{
+ pd->page_spec.sz = sz;
+}
+
+EOLIAN static void
+_efl_page_transition_padding_size_set(Eo *obj EINA_UNUSED,
+ Efl_Page_Transition_Data *pd,
+ int padding)
+{
+ pd->page_spec.padding = padding;
+}
+
+EOLIAN static void
+_efl_page_transition_bind(Eo *obj EINA_UNUSED,
+ Efl_Page_Transition_Data *pd,
+ Eo *pager,
+ Efl_Canvas_Group *group)
+{
+ Eina_Rect group_rect;
+
+ if (pd->pager.obj == pager) return;
+
+ pd->pager.obj = pager;
+ pd->pager.group = group;
+
+ if (pager)
+ {
+ group_rect = efl_gfx_entity_geometry_get(group);
+
+ pd->pager.x = group_rect.x;
+ pd->pager.y = group_rect.y;
+ pd->pager.w = group_rect.w;
+ pd->pager.h = group_rect.h;
+
+ pd->page_spec.sz = efl_ui_pager_page_size_get(pager);
+ pd->page_spec.padding = efl_ui_pager_padding_get(pager);
+ pd->loop = efl_ui_pager_loop_mode_get(pager);
+ }
+}
+
+EOLIAN static void
+_efl_page_transition_update(Eo *obj EINA_UNUSED,
+ Efl_Page_Transition_Data *pd EINA_UNUSED,
+ double move EINA_UNUSED)
+{
+
+}
+
+EOLIAN static void
+_efl_page_transition_curr_page_change(Eo *obj EINA_UNUSED,
+ Efl_Page_Transition_Data *pd EINA_UNUSED,
+ int diff EINA_UNUSED)
+{
+
+}
+
+EOLIAN static void
+_efl_page_transition_loop_set(Eo *obj EINA_UNUSED,
+ Efl_Page_Transition_Data *pd,
+ Efl_Ui_Pager_Loop loop)
+{
+ pd->loop = loop;
+}
+
+
+EOAPI EFL_VOID_FUNC_BODYV(efl_page_transition_update,
+ EFL_FUNC_CALL(move), double move)
+EOAPI EFL_VOID_FUNC_BODYV(efl_page_transition_curr_page_change,
+ EFL_FUNC_CALL(move), double move)
+EOAPI EFL_VOID_FUNC_BODYV(efl_page_transition_page_size_set,
+ EFL_FUNC_CALL(sz), Eina_Size2D sz)
+EOAPI EFL_VOID_FUNC_BODYV(efl_page_transition_padding_size_set,
+ EFL_FUNC_CALL(padding), int padding)
+EOAPI EFL_VOID_FUNC_BODYV(efl_page_transition_loop_set,
+ EFL_FUNC_CALL(loop), Efl_Ui_Pager_Loop loop)
+
+
+#define EFL_PAGE_TRANSITION_EXTRA_OPS \
+ EFL_OBJECT_OP_FUNC(efl_page_transition_update, \
+ _efl_page_transition_update), \
+ EFL_OBJECT_OP_FUNC(efl_page_transition_curr_page_change, \
+ _efl_page_transition_curr_page_change), \
+ EFL_OBJECT_OP_FUNC(efl_page_transition_page_size_set, \
+ _efl_page_transition_page_size_set), \
+ EFL_OBJECT_OP_FUNC(efl_page_transition_padding_size_set, \
+ _efl_page_transition_padding_size_set), \
+ EFL_OBJECT_OP_FUNC(efl_page_transition_loop_set, \
+ _efl_page_transition_loop_set)
+
+#include "efl_page_transition.eo.c"
diff --git a/src/lib/elementary/efl_page_transition.eo b/src/lib/elementary/efl_page_transition.eo
new file mode 100644
index 0000000000..77e359ce04
--- /dev/null
+++ b/src/lib/elementary/efl_page_transition.eo
@@ -0,0 +1,17 @@
+class Efl.Page.Transition (Efl.Object)
+{
+ [[Page transition for @Efl.Ui.Pager
+
+ A page transition is essential to @Efl.Ui.Pager object and invoked whenever
+ pages are rearranged or scrolled (see @Efl.Ui.Pager).
+ ]]
+ methods {
+ bind {
+ [[set object]]
+ params {
+ @in pager: Efl.Ui.Pager; [[pager object]]
+ @in group: Efl.Canvas.Group; [[a dummy object for layer adjustment]]
+ }
+ }
+ }
+}
diff --git a/src/lib/elementary/efl_page_transition.h b/src/lib/elementary/efl_page_transition.h
new file mode 100644
index 0000000000..38d4e6b9ab
--- /dev/null
+++ b/src/lib/elementary/efl_page_transition.h
@@ -0,0 +1,27 @@
+#ifndef EFL_PAGE_TRANSITION_H
+#define EFL_PAGE_TRANSITION_H
+
+
+typedef struct _Efl_Page_Transition_Data Efl_Page_Transition_Data;
+
+struct _Efl_Page_Transition_Data
+{
+ struct {
+ Efl_Object *obj;
+ Efl_Canvas_Group *group;
+ Evas_Coord x, y, w, h;
+ } pager;
+
+ struct {
+ Eina_Size2D sz;
+ Evas_Coord padding;
+ } page_spec;
+
+ Efl_Ui_Pager_Loop loop;
+};
+
+#define EFL_PAGE_TRANSITION_DATA_GET(o, pd) \
+ Efl_Page_Transition_Data *pd = \
+ efl_data_scope_get(o, EFL_PAGE_TRANSITION_CLASS)
+
+#endif
diff --git a/src/lib/elementary/efl_page_transition_scroll.c b/src/lib/elementary/efl_page_transition_scroll.c
new file mode 100644
index 0000000000..ab93d7cb12
--- /dev/null
+++ b/src/lib/elementary/efl_page_transition_scroll.c
@@ -0,0 +1,606 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <Elementary.h>
+#include "elm_priv.h"
+
+#include "efl_page_transition_scroll.h"
+#include "efl_page_transition.h"
+#include "efl_ui_widget_pager.h"
+
+#define MY_CLASS EFL_PAGE_TRANSITION_SCROLL_CLASS
+
+
+
+static void
+_page_info_deallocate(Efl_Page_Transition_Scroll_Data *pd)
+{
+ Page_Info *pi;
+
+ EINA_LIST_FREE(pd->page_infos, pi)
+ {
+ if (pi->content)
+ efl_pack_unpack(pi->obj, pi->content);
+
+ efl_del(pi->obj);
+ free(pi);
+ }
+
+ pd->head = NULL;
+ pd->tail = NULL;
+}
+
+static void
+_page_info_allocate(Efl_Page_Transition_Scroll_Data *pd,
+ Efl_Page_Transition_Data *spd)
+{
+ Page_Info *pi, *prev = NULL;
+ int i;
+
+ for (i = 0; i < pd->page_info_num; i++)
+ {
+ pi = calloc(1, sizeof(*pi));
+ if (i == 0) pd->head = pi;
+ else if (i == (pd->page_info_num - 1)) pd->tail = pi;
+ pi->id = i;
+ pi->pos = i - (pd->side_page_num + 1);
+ pi->content_num = -1;
+ pi->content = NULL;
+
+ pi->obj = efl_add(EFL_UI_BOX_CLASS, spd->pager.obj);
+ efl_canvas_group_member_add(spd->pager.group, pi->obj);
+ pd->page_infos = eina_list_append(pd->page_infos, pi);
+
+ if (prev)
+ {
+ pi->prev = prev;
+ prev->next = pi;
+ }
+ prev = pi;
+ }
+
+ pd->head->prev = pd->tail;
+ pd->tail->next = pd->head;
+}
+
+static void
+_content_show(Efl_Page_Transition_Scroll_Data *pd,
+ Efl_Page_Transition_Data *spd)
+{
+ Eina_List *list;
+ Page_Info *pi;
+ int tmp_id;
+ Eo *tmp;
+ int curr_page, cnt;
+
+ curr_page = efl_ui_pager_current_page_get(spd->pager.obj);
+ cnt = efl_content_count(spd->pager.obj);
+
+ // at this point, the number of visible pages might have been changed,
+ // so empty all boxes and refill them with the right contents.
+ // FIXME make logic efficient: don't have to empty all and fill all the time
+ EINA_LIST_FOREACH(pd->page_infos, list, pi)
+ {
+ if (pi->content)
+ {
+ efl_pack_unpack(pi->obj, pi->content);
+ efl_canvas_object_clip_set(pi->content, pd->backclip);
+
+ pi->content_num = -1;
+ pi->content = NULL;
+ pi->visible = EINA_FALSE;
+ }
+ efl_canvas_object_clip_set(pi->obj, pd->backclip);
+ }
+
+ EINA_LIST_FOREACH(pd->page_infos, list, pi)
+ {
+ if (pi->vis_page)
+ {
+ tmp_id = (curr_page + pi->pos + cnt) % cnt;
+
+ if ((spd->loop == EFL_UI_PAGER_LOOP_DISABLED)
+ && ((pi->pos) * (tmp_id - curr_page) < 0)) continue;
+
+ tmp = efl_pack_content_get(spd->pager.obj, tmp_id);
+ if (tmp)
+ {
+ efl_canvas_object_clip_set(pi->obj, pd->foreclip);
+
+ efl_pack(pi->obj, tmp);
+ efl_canvas_object_clip_set(tmp, pd->foreclip);
+
+ pi->content_num = tmp_id;
+ pi->content = tmp;
+ pi->visible = EINA_TRUE;
+ }
+ }
+ }
+}
+
+//FIXME use ecore_job
+static void
+_page_info_geometry_change(Efl_Page_Transition_Scroll_Data *pd,
+ Efl_Page_Transition_Data *spd)
+{
+ Eina_List *list;
+ Page_Info *pi;
+ int content_w;
+
+ content_w = spd->page_spec.sz.w
+ + ((spd->page_spec.sz.w + spd->page_spec.padding) * pd->side_page_num * 2);
+
+ if (content_w < spd->pager.w)
+ {
+ EINA_RECTANGLE_SET(&pd->viewport,
+ spd->pager.x + ((spd->pager.w - content_w) / 2),
+ spd->pager.y,
+ content_w,
+ spd->pager.h);
+ }
+ else
+ {
+ EINA_RECTANGLE_SET(&pd->viewport,
+ spd->pager.x,
+ spd->pager.y,
+ spd->pager.w,
+ spd->pager.h);
+ }
+
+ efl_gfx_entity_geometry_set(pd->foreclip, (Eina_Rect) pd->viewport);
+
+ // this loop resets the geometry of each page based on the geometry of
+ // the pager object, the page size, and the padding size.
+ EINA_LIST_FOREACH(pd->page_infos, list, pi)
+ {
+ EINA_RECTANGLE_SET(&pi->geometry,
+ spd->pager.x + (spd->pager.w / 2)
+ + pi->pos * (spd->page_spec.sz.w + spd->page_spec.padding)
+ - (spd->page_spec.sz.w / 2),
+ spd->pager.y + (spd->pager.h / 2) - (spd->page_spec.sz.h / 2),
+ spd->page_spec.sz.w,
+ spd->page_spec.sz.h);
+
+ if (eina_rectangles_intersect(&pi->geometry, &pd->viewport) &&
+ ((pi->id != 0) && (pi->id != (pd->page_info_num - 1))))
+ {
+ pi->vis_page = EINA_TRUE;
+ pi->visible = EINA_TRUE;
+ efl_canvas_object_clip_set(pi->obj, pd->foreclip);
+ }
+ else
+ {
+ pi->vis_page = EINA_FALSE;
+ pi->visible = EINA_FALSE;
+ efl_canvas_object_clip_set(pi->obj, pd->backclip);
+ }
+
+ efl_gfx_entity_geometry_set(pi->obj, (Eina_Rect) pi->geometry);
+ }
+
+ if (efl_content_count(spd->pager.obj) > 0) _content_show(pd, spd);
+}
+
+static void
+_resize_cb(void *data, const Efl_Event *ev)
+{
+ Efl_Page_Transition_Scroll *obj = data;
+ EFL_PAGE_TRANSITION_SCROLL_DATA_GET(obj, pd);
+ EFL_PAGE_TRANSITION_DATA_GET(obj, spd);
+
+ Eina_Size2D sz;
+
+ Efl_Ui_Pager *pager = ev->object;
+
+ sz = efl_gfx_entity_size_get(pager);
+
+ spd->pager.w = sz.w;
+ spd->pager.h = sz.h;
+
+ _page_info_geometry_change(pd, spd);
+}
+
+static void
+_move_cb(void *data, const Efl_Event *ev)
+{
+ Efl_Page_Transition_Scroll *obj = data;
+ EFL_PAGE_TRANSITION_SCROLL_DATA_GET(obj, pd);
+ EFL_PAGE_TRANSITION_DATA_GET(obj, spd);
+
+ Eina_Position2D pos;
+
+ Efl_Ui_Pager *pager = ev->object;
+
+ pos = efl_gfx_entity_position_get(pager);
+
+ spd->pager.x = pos.x;
+ spd->pager.y = pos.y;
+
+ _page_info_geometry_change(pd, spd);
+}
+
+EOLIAN static void
+_efl_page_transition_scroll_efl_page_transition_bind(Eo *obj,
+ Efl_Page_Transition_Scroll_Data *pd,
+ Eo *pager,
+ Efl_Canvas_Group *group)
+{
+ EFL_PAGE_TRANSITION_DATA_GET(obj, spd);
+
+ if (spd->pager.obj == pager) return;
+
+ if (spd->pager.obj)
+ {
+ efl_event_callback_del(spd->pager.group, EFL_GFX_ENTITY_EVENT_RESIZE, _resize_cb, obj);
+ efl_event_callback_del(spd->pager.group, EFL_GFX_ENTITY_EVENT_MOVE, _move_cb, obj);
+
+ _page_info_deallocate(pd);
+ efl_del(pd->foreclip);
+ efl_del(pd->backclip);
+ }
+
+ efl_page_transition_bind(efl_super(obj, MY_CLASS), pager, group);
+
+ if (spd->pager.obj)
+ {
+ int cnt, i;
+ Eo *item;
+
+ efl_event_callback_add(spd->pager.group, EFL_GFX_ENTITY_EVENT_RESIZE, _resize_cb, obj);
+ efl_event_callback_add(spd->pager.group, EFL_GFX_ENTITY_EVENT_MOVE, _move_cb, obj);
+
+ pd->foreclip = efl_add(EFL_CANVAS_RECTANGLE_CLASS,
+ evas_object_evas_get(spd->pager.obj));
+ evas_object_static_clip_set(pd->foreclip, EINA_TRUE);
+
+ pd->backclip = efl_add(EFL_CANVAS_RECTANGLE_CLASS,
+ evas_object_evas_get(spd->pager.obj));
+ evas_object_static_clip_set(pd->backclip, EINA_TRUE);
+ efl_gfx_entity_visible_set(pd->backclip, EINA_FALSE);
+
+ cnt = efl_content_count(spd->pager.obj);
+ for (i = 0; i < cnt; i++)
+ {
+ item = efl_pack_content_get(spd->pager.obj, i);
+ efl_canvas_object_clip_set(item, pd->backclip);
+ }
+ _page_info_allocate(pd, spd);
+ _page_info_geometry_change(pd, spd);
+ }
+}
+
+EOLIAN static void
+_efl_page_transition_scroll_page_size_set(Eo *obj,
+ Efl_Page_Transition_Scroll_Data *pd,
+ Eina_Size2D sz)
+{
+ EFL_PAGE_TRANSITION_DATA_GET(obj, spd);
+
+ efl_page_transition_page_size_set(efl_super(obj, MY_CLASS), sz);
+ _page_info_geometry_change(pd, spd);
+}
+
+EOLIAN static void
+_efl_page_transition_scroll_padding_size_set(Eo *obj,
+ Efl_Page_Transition_Scroll_Data *pd,
+ int padding)
+{
+ EFL_PAGE_TRANSITION_DATA_GET(obj, spd);
+
+ efl_page_transition_padding_size_set(efl_super(obj, MY_CLASS), padding);
+ _page_info_geometry_change(pd, spd);
+}
+
+EOLIAN static void
+_efl_page_transition_scroll_update(Eo *obj,
+ Efl_Page_Transition_Scroll_Data *pd,
+ double pos)
+{
+ EFL_PAGE_TRANSITION_DATA_GET(obj, spd);
+
+ double t;
+ int tmp_id, curr_page, cnt;
+ Eo *tmp;
+ Eina_List *list;
+ Page_Info *pi, *tpi;
+
+ t = pos;
+ if (t < 0) t *= (-1);
+
+ curr_page = efl_ui_pager_current_page_get(spd->pager.obj);
+ cnt = efl_content_count(spd->pager.obj);
+
+ // while pages are scrolled,
+ // 1. the geometry of each page needs to be changed
+ // 2. if a page gets out of the viewport, it needs to be hidden
+ // 3. if a page gets into the viewport, it needs to be shown
+ EINA_LIST_FOREACH(pd->page_infos, list, pi)
+ {
+ if (pos < 0) // if scrolled right, each page takes next page's position
+ tpi = pi->next;
+ else // else if scrolled left, each page takes prev page's position
+ tpi = pi->prev;
+
+ EINA_RECTANGLE_SET(&pi->temp,
+ tpi->geometry.x * t + pi->geometry.x * (1 - t),
+ tpi->geometry.y,
+ tpi->geometry.w,
+ tpi->geometry.h);
+
+ efl_gfx_entity_geometry_set(pi->obj, (Eina_Rect) pi->temp);
+
+ if (!pi->vis_page && !tpi->vis_page) continue;
+
+ if (!eina_rectangles_intersect(&pi->temp, &pd->viewport))
+ {
+ if (pi->content)
+ {
+ efl_canvas_object_clip_set(pi->obj, pd->backclip);
+
+ efl_pack_unpack(pi->obj, pi->content);
+ efl_canvas_object_clip_set(pi->content, pd->backclip);
+
+ pi->content_num = -1;
+ pi->content = NULL;
+ pi->visible = EINA_FALSE;
+
+ }
+ }
+ else
+ {
+ tmp_id = (curr_page + pi->pos + cnt) % cnt;
+ if (pi->content_num != tmp_id)
+ {
+ if (pi->content) //FIXME if the content num is the same, do nothing
+ {
+ efl_pack_unpack(pi->obj, pi->content);
+ efl_canvas_object_clip_set(pi->content, pd->backclip);
+
+ pi->content_num = -1;
+ pi->content = NULL;
+ }
+
+ if ((spd->loop == EFL_UI_PAGER_LOOP_DISABLED)
+ && ((pi->pos) * (tmp_id - curr_page) < 0)) continue;
+ tmp = efl_pack_content_get(spd->pager.obj, tmp_id);
+
+ if (tmp)
+ {
+ efl_canvas_object_clip_set(pi->obj, pd->foreclip);
+
+ efl_pack(pi->obj, tmp);
+ efl_canvas_object_clip_set(tmp, pd->foreclip);
+
+ pi->content_num = tmp_id;
+ pi->content = tmp;
+ pi->visible = EINA_TRUE;
+ }
+ }
+ }
+ }
+}
+
+EOLIAN static void
+_efl_page_transition_scroll_curr_page_change(Eo *obj EINA_UNUSED,
+ Efl_Page_Transition_Scroll_Data *pd,
+ double pos)
+{
+ Eina_List *list;
+ Page_Info *pi, *target = NULL;
+
+ // after the current page is changed, page infos need to be updated
+ // with a new id based on the new geometry of the boxes.
+ EINA_LIST_FOREACH(pd->page_infos, list, pi)
+ {
+ if (EINA_DBL_EQ(pos, 1.0))
+ {
+ pi->id = (pi->id - 1 + pd->page_info_num) % pd->page_info_num;
+ target = pi->prev;
+ }
+ else if (EINA_DBL_EQ(pos, -1.0))
+ {
+ pi->id = (pi->id + 1) % pd->page_info_num;
+ target = pi->next;
+ }
+ pi->pos = pi->id - (pd->side_page_num + 1);
+
+ EINA_RECTANGLE_SET(&pi->temp,
+ target->geometry.x,
+ target->geometry.y,
+ target->geometry.w,
+ target->geometry.h);
+
+ if (eina_rectangles_intersect(&pi->temp, &pd->viewport) &&
+ (pi->id != 0) && (pi->id != (pd->page_info_num - 1)))
+ {
+ pi->vis_page = EINA_TRUE;
+ pi->visible = EINA_TRUE;
+ efl_canvas_object_clip_set(pi->obj, pd->foreclip);
+ }
+ else
+ {
+ pi->vis_page = EINA_FALSE;
+ pi->visible = EINA_FALSE;
+ efl_canvas_object_clip_set(pi->obj, pd->backclip);
+ if (pi->content)
+ {
+ efl_pack_unpack(pi->obj, pi->content);
+ efl_canvas_object_clip_set(pi->content, pd->backclip);
+ }
+ }
+ }
+
+ if (EINA_DBL_EQ(pos, 1.0))
+ {
+ pd->head = pd->head->next;
+ pd->tail = pd->tail->next;
+ }
+ else if (EINA_DBL_EQ(pos, -1.0))
+ {
+ pd->head = pd->head->prev;
+ pd->tail = pd->tail->prev;
+ }
+
+ EINA_LIST_FOREACH(pd->page_infos, list, pi)
+ {
+ EINA_RECTANGLE_SET(&pi->geometry,
+ pi->temp.x,
+ pi->temp.y,
+ pi->temp.w,
+ pi->temp.h);
+ }
+}
+
+EOLIAN static int
+_efl_page_transition_scroll_side_page_num_get(const Eo *obj EINA_UNUSED,
+ Efl_Page_Transition_Scroll_Data *pd)
+{
+ return pd->side_page_num;
+}
+
+static Page_Info *
+_add_item(Efl_Page_Transition_Scroll_Data *pd, Efl_Page_Transition_Data *spd)
+{
+ Page_Info *pi;
+
+ pi = calloc(1, sizeof(*pi));
+ pi->obj = efl_add(EFL_UI_BOX_CLASS, spd->pager.obj);
+ efl_canvas_group_member_add(spd->pager.group, pi->obj);
+ pi->content_num = -1;
+ pi->content = NULL;
+
+ pi->next = pd->head;
+ pd->head->prev = pi;
+ pi->prev = pd->tail;
+ pd->tail->next = pi;
+
+ return pi;
+}
+
+static void
+_remove_item(Page_Info *pi, Efl_Page_Transition_Scroll_Data *pd)
+{
+ efl_canvas_object_clip_set(pi->content, pd->backclip);
+ efl_pack_unpack(pi->obj, pi->content);
+ efl_del(pi->obj);
+ pi->prev->next = pi->next;
+ pi->next->prev = pi->prev;
+ pd->page_infos = eina_list_remove(pd->page_infos, pi);
+ free(pi);
+}
+
+EOLIAN static void
+_efl_page_transition_scroll_side_page_num_set(Eo *obj,
+ Efl_Page_Transition_Scroll_Data *pd,
+ int side_page_num)
+{
+ EFL_PAGE_TRANSITION_DATA_GET(obj, spd);
+ Page_Info *pi;
+ int delta, i;
+
+ if (pd->side_page_num == side_page_num) return;
+
+ delta = side_page_num - pd->side_page_num;
+ pd->side_page_num = side_page_num;
+ pd->page_info_num = (side_page_num * 2) + 3;
+
+ if (!spd->pager.obj) return;
+
+ if (delta > 0)
+ {
+ // side_page_num is increased, so add boxes at both ends by the diff
+ for (i = 0; i < delta; i++)
+ {
+ pi = _add_item(pd, spd);
+ pd->page_infos = eina_list_prepend_relative(pd->page_infos, pi, pd->head);
+ pd->head = pi;
+ efl_gfx_stack_below(pi->obj, pi->next->obj);
+
+ pi = _add_item(pd, spd);
+ pd->page_infos = eina_list_append_relative(pd->page_infos, pi, pd->tail);
+ pd->tail = pi;
+ efl_gfx_stack_above(pi->obj, pi->prev->obj);
+ }
+ }
+ else
+ {
+ // side_page_num is decreased, so remove boxes at both ends by the diff
+ for (i = 0; i > delta; i--)
+ {
+ pi = pd->head;
+ pd->head = pi->next;
+ _remove_item(pi, pd);
+
+ pi = pd->tail;
+ pd->tail = pi->prev;
+ _remove_item(pi, pd);
+ }
+ }
+
+ pi = pd->head;
+ for (i = 0; i < pd->page_info_num; i++)
+ {
+ pi->id = i;
+ pi->pos = i - (pd->side_page_num + 1);
+ pi = pi->next;
+ }
+
+ _page_info_geometry_change(pd, spd);
+}
+
+EOLIAN static void
+_efl_page_transition_scroll_loop_set(Eo *obj,
+ Efl_Page_Transition_Scroll_Data *pd,
+ Efl_Ui_Pager_Loop loop)
+{
+ EFL_PAGE_TRANSITION_DATA_GET(obj, spd);
+
+ if (spd->loop == loop) return;
+
+ efl_page_transition_loop_set(efl_super(obj, MY_CLASS), loop);
+
+ _content_show(pd, spd);
+}
+
+EOLIAN static Eo *
+_efl_page_transition_scroll_efl_object_constructor(Eo *obj,
+ Efl_Page_Transition_Scroll_Data *pd)
+{
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+
+ pd->side_page_num = 1;
+ pd->page_info_num = pd->side_page_num * 2 + 3;
+
+ return obj;
+}
+
+EOLIAN static void
+_efl_page_transition_scroll_efl_object_invalidate(Eo *obj,
+ Efl_Page_Transition_Scroll_Data *pd)
+{
+ Page_Info *pi;
+
+ EINA_LIST_FREE(pd->page_infos, pi)
+ {
+ efl_del(pi->obj);
+ free(pi);
+ }
+
+ efl_invalidate(efl_super(obj, MY_CLASS));
+}
+
+
+#define EFL_PAGE_TRANSITION_SCROLL_EXTRA_OPS \
+ EFL_OBJECT_OP_FUNC(efl_page_transition_update, \
+ _efl_page_transition_scroll_update), \
+ EFL_OBJECT_OP_FUNC(efl_page_transition_curr_page_change, \
+ _efl_page_transition_scroll_curr_page_change), \
+ EFL_OBJECT_OP_FUNC(efl_page_transition_page_size_set, \
+ _efl_page_transition_scroll_page_size_set), \
+ EFL_OBJECT_OP_FUNC(efl_page_transition_padding_size_set, \
+ _efl_page_transition_scroll_padding_size_set), \
+ EFL_OBJECT_OP_FUNC(efl_page_transition_loop_set, \
+ _efl_page_transition_scroll_loop_set)
+
+#include "efl_page_transition_scroll.eo.c"
diff --git a/src/lib/elementary/efl_page_transition_scroll.eo b/src/lib/elementary/efl_page_transition_scroll.eo
new file mode 100644
index 0000000000..6c720c5567
--- /dev/null
+++ b/src/lib/elementary/efl_page_transition_scroll.eo
@@ -0,0 +1,22 @@
+class Efl.Page.Transition_Scroll (Efl.Page.Transition)
+{
+ [[Page transition for @Efl.Ui.Pager
+
+ With this type of transition, pages are arranged linearly and move parallel
+ to the screen by scrolling. The current page is displayed at center, and
+ previous and next pages might be displayed optionally.
+ ]]
+ methods {
+ @property side_page_num {
+ [[The number of pages displayed on each side of the current page]]
+ values {
+ side_page_num: int;
+ }
+ }
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Object.invalidate;
+ Efl.Page.Transition.bind;
+ }
+}
diff --git a/src/lib/elementary/efl_page_transition_scroll.h b/src/lib/elementary/efl_page_transition_scroll.h
new file mode 100644
index 0000000000..b4203d7706
--- /dev/null
+++ b/src/lib/elementary/efl_page_transition_scroll.h
@@ -0,0 +1,93 @@
+#ifndef EFL_PAGE_TRANSITION_SCROLL_H
+#define EFL_PAGE_TRANSITION_SCROLL_H
+
+//#include "efl_ui_widget_pager.h"
+
+
+/**
+ * This is a description on how scroll transition works.
+ *
+ * Regardless of the number of pages, scroll transition maintains a fixed number
+ * of boxes which can contain pages. The boxes move along with scrolling and
+ * some of them are emptied or filled as they come in or out of screen area.
+ * When pager is scrolled left or right, each box takes the position of its
+ * previous or next box. Since the leftmost and rightmost boxes might move in
+ * reverse direction, they shouldn't be visible. This is why there are dummy
+ * boxes at both ends.
+ *
+ * Here is an example of box arrangement change by scrolling.
+ * The pager has 10 pages, numbered from 1 to 10.
+ * The current page is page5, and side_page_num equals 1.
+ *
+ * head |----- screen area ----| tail
+ * (dummy) | | (dummy)
+ * ---------- ---------- ---------- ---------- ----------
+ * | BOX1 | | BOX2 | | BOX3 | | BOX4 | | BOX5 |
+ * | | | | | | | | | |
+ * | (empty)| | page4 | | page5 | | page6 | | (empty)|
+ * | | | | | | | | | |
+ * | | | | | | | | | |
+ * | | | | | | | | | |
+ * ---------- ---------- ---------- ---------- ----------
+ * | |
+ * |----------------------|
+ *
+ * After scrolling left,
+ * 1. each box takes the position of it's previous box.
+ * 2. head and tail is changed.
+ * 3. The box moved to the end is emptied.
+ * 4. The box moved from the end is filled with content.
+ *
+ * head tail
+ * ---------- ---------- ---------- ---------- ----------
+ * | BOX2 | | BOX3 | | BOX4 | | BOX5 | | BOX1 |
+ * | | | | | | | | | |
+ * | (empty)| | page5 | | page6 | | page7 | | (empty)|
+ * |*emptied| | | | | |*filled | | |
+ * | | | | | | | | | |
+ * | | | | | | | | | |
+ * ---------- ---------- ---------- ---------- ----------
+ *
+ */
+
+
+typedef struct _Page_Info
+{
+ Evas_Map *map;
+ int id;
+ int pos;
+ int content_num;
+ Eo *obj;
+ Eo *content;
+
+ Eina_Rectangle geometry;
+ Eina_Rectangle temp;
+
+ struct _Page_Info *prev, *next;
+
+ Eina_Bool visible;
+ Eina_Bool vis_page;
+
+} Page_Info;
+
+typedef struct _Efl_Page_Transition_Scroll_Data Efl_Page_Transition_Scroll_Data;
+
+struct _Efl_Page_Transition_Scroll_Data
+{
+ Eina_List *page_infos;
+
+ Page_Info *head, *tail;
+
+ int page_info_num;
+ int side_page_num;
+
+ Eo *foreclip;
+ Eo *backclip;
+ Eina_Rectangle viewport;
+};
+
+#define EFL_PAGE_TRANSITION_SCROLL_DATA_GET(o, pd) \
+ Efl_Page_Transition_Scroll_Data *pd = \
+ efl_data_scope_get(o, EFL_PAGE_TRANSITION_SCROLL_CLASS)
+
+#endif
diff --git a/src/lib/elementary/efl_selection.c b/src/lib/elementary/efl_selection.c
new file mode 100644
index 0000000000..5b6bccf2b0
--- /dev/null
+++ b/src/lib/elementary/efl_selection.c
@@ -0,0 +1,328 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#define EFL_SELECTION_MANAGER_BETA
+
+#include <Elementary.h>
+#include "elm_priv.h"
+
+#define MY_CLASS EFL_SELECTION_MIXIN
+#define MY_CLASS_NAME "Efl.Selection"
+
+static inline Eo*
+_selection_manager_get(Eo *obj)
+{
+ Eo *top = elm_widget_top_get(obj);
+ if (!top)
+ {
+ top = obj;
+ }
+ Eo *sel_man = efl_key_data_get(top, "__selection_manager");
+ if (!sel_man)
+ {
+ sel_man = efl_add(EFL_SELECTION_MANAGER_CLASS, top);
+ efl_key_data_set(top, "__selection_manager", sel_man);
+ }
+ return sel_man;
+}
+
+EOLIAN static void
+_efl_selection_selection_get(Eo *obj, void *pd EINA_UNUSED, Efl_Selection_Type type, Efl_Selection_Format format,
+ void *data_func_data, Efl_Selection_Data_Ready data_func, Eina_Free_Cb data_func_free_cb, unsigned int seat)
+{
+ Eo *sel_man = _selection_manager_get(obj);
+ efl_selection_manager_selection_get(sel_man, obj, type, format,
+ data_func_data, data_func,
+ data_func_free_cb, seat);
+}
+
+EOLIAN static Eina_Future *
+_efl_selection_selection_set(Eo *obj, void *pd EINA_UNUSED, Efl_Selection_Type type, Efl_Selection_Format format, Eina_Slice data, unsigned int seat)
+{
+ Eo *sel_man = _selection_manager_get(obj);
+ return efl_selection_manager_selection_set(sel_man, obj, type, format, data, seat);
+}
+
+EOLIAN static void
+_efl_selection_selection_clear(Eo *obj, void *pd EINA_UNUSED, Efl_Selection_Type type, unsigned int seat)
+{
+ Eo *sel_man = _selection_manager_get(obj);
+ efl_selection_manager_selection_clear(sel_man, obj, type, seat);
+}
+
+EOLIAN static Eina_Bool
+_efl_selection_has_owner(Eo *obj, void *pd EINA_UNUSED, Efl_Selection_Type type, unsigned int seat)
+{
+ Eo *sel_man = _selection_manager_get(obj);
+ return efl_selection_manager_selection_has_owner(sel_man, obj, type, seat);
+}
+
+
+////////// Support legacy APIs
+
+//TODO: Clear this list (when sel_man is deleted)
+Eina_List *lost_cb_list = NULL;
+
+#ifdef HAVE_ELEMENTARY_WL2
+static Ecore_Evas *
+_wl_is_wl(const Evas_Object *obj)
+{
+ Ecore_Evas *ee;
+ Evas *evas;
+ const char *engine_name;
+
+ if (!(evas = evas_object_evas_get(obj)))
+ return NULL;
+ if (!(ee = ecore_evas_ecore_evas_get(evas)))
+ return NULL;
+
+ engine_name = ecore_evas_engine_name_get(ee);
+ if (!strcmp(engine_name, ELM_BUFFER))
+ {
+ ee = ecore_evas_buffer_ecore_evas_parent_get(ee);
+ if (!ee) return NULL;
+ engine_name = ecore_evas_engine_name_get(ee);
+ }
+ if (!strncmp(engine_name, "wayland", sizeof("wayland") - 1))
+ return ee;
+ return NULL;
+}
+
+static Ecore_Wl2_Window *
+_wl_window_get(const Evas_Object *obj)
+{
+ Evas_Object *top;
+ Ecore_Wl2_Window *win = NULL;
+
+ if (elm_widget_is(obj))
+ {
+ top = elm_widget_top_get(obj);
+ if (!top) top = elm_widget_top_get(elm_widget_parent_widget_get(obj));
+ if (top && (efl_isa(top, EFL_UI_WIN_CLASS)))
+ win = elm_win_wl_window_get(top);
+ }
+ if (!win)
+ {
+ Ecore_Evas *ee = _wl_is_wl(obj);
+
+ if (ee)
+ {
+ /* In case the engine is not a buffer, we want to check once. */
+ win = ecore_evas_wayland2_window_get(ee);
+ if (!win) return NULL;
+ }
+ }
+
+ return win;
+}
+
+int
+_wl_default_seat_id_get(Evas_Object *obj)
+{
+ Ecore_Wl2_Window *win = _wl_window_get(obj);
+ Eo *seat, *parent2, *ewin;
+ Eina_Bool is_wl = EINA_FALSE;
+
+ if (obj)
+ {
+ if (_wl_is_wl(obj)) is_wl = EINA_TRUE;
+ if (efl_isa(obj, EFL_UI_WIDGET_CLASS))
+ {
+ Eo *top = elm_widget_top_get(obj);
+ if (efl_isa(top, EFL_UI_WIN_INLINED_CLASS))
+ {
+ parent2 = efl_ui_win_inlined_parent_get(top);
+ if (parent2) obj = elm_widget_top_get(parent2) ?: parent2;
+ }
+ /* fake win means canvas seat id will not match protocol seat id */
+ ewin = elm_win_get(obj);
+ if (elm_win_type_get(ewin) == ELM_WIN_FAKE) obj = NULL;
+ }
+ }
+
+ if (!obj)
+ {
+ if (is_wl)
+ {
+ Ecore_Wl2_Input *input;
+ Eina_Iterator *it;
+
+ it = ecore_wl2_display_inputs_get(ecore_wl2_window_display_get(win));
+ EINA_ITERATOR_FOREACH(it, input) break;
+ eina_iterator_free(it);
+ if (input)
+ return ecore_wl2_input_seat_id_get(input);
+ }
+ }
+
+ seat = evas_default_device_get(evas_object_evas_get(obj), EFL_INPUT_DEVICE_TYPE_SEAT);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(seat, 1);
+ return evas_device_seat_id_get(seat);
+}
+#endif
+
+typedef struct _Cnp_Data_Cb_Wrapper Cnp_Data_Cb_Wrapper;
+struct _Cnp_Data_Cb_Wrapper
+{
+ void *udata;
+ Elm_Drop_Cb datacb;
+};
+
+static void
+_selection_data_ready_cb(void *data, Efl_Object *obj, Efl_Selection_Data *seldata)
+{
+ printf("obj: %p, data: [", obj);
+ fwrite(seldata->content.mem, seldata->content.len, 1, stdout);
+ printf("], length: %zd\n", seldata->content.len);
+
+ Cnp_Data_Cb_Wrapper *wdata = data;
+ if (!wdata) return;
+ Elm_Selection_Data ddata;
+
+ ddata.data = calloc(1, seldata->content.len + 1);
+ if (!ddata.data) return;
+ ddata.data = memcpy(ddata.data, seldata->content.mem, seldata->content.len);
+ ddata.len = seldata->content.len;
+ ddata.x = seldata->pos.x;
+ ddata.y = seldata->pos.y;
+ ddata.format = (Elm_Sel_Format)seldata->format;
+ ddata.action = (Elm_Xdnd_Action)seldata->action;
+ wdata->datacb(wdata->udata, obj, &ddata);
+ free(ddata.data);
+}
+
+typedef struct _Sel_Lost_Data Sel_Lost_Data;
+struct _Sel_Lost_Data
+{
+ const Evas_Object *obj;
+ Elm_Sel_Type type;
+ void *udata;
+ Elm_Selection_Loss_Cb loss_cb;
+};
+
+static Eina_Value
+_selection_lost_cb(void *data, const Eina_Value value)
+{
+ Eina_List *l, *l2;
+ Sel_Lost_Data *ldata, *ldata2;
+
+ ldata = data;
+ EINA_LIST_FOREACH_SAFE(lost_cb_list, l, l2, ldata2)
+ {
+ if ((ldata->obj == ldata2->obj) &&
+ (ldata->type == ldata2->type))
+ {
+ ldata2->loss_cb(ldata2->udata, ldata2->type);
+ lost_cb_list = eina_list_remove(lost_cb_list, ldata2);
+ }
+ }
+ free(ldata);
+
+ return value;
+}
+
+EAPI Eina_Bool
+elm_cnp_selection_get(const Evas_Object *obj, Elm_Sel_Type type,
+ Elm_Sel_Format format, Elm_Drop_Cb datacb, void *udata)
+{
+ int seatid = 1;
+ Eo *sel_man = _selection_manager_get((Evas_Object *)obj);
+ Cnp_Data_Cb_Wrapper *wdata = calloc(1, sizeof(Cnp_Data_Cb_Wrapper));
+
+ if (!wdata) return EINA_FALSE;
+
+#ifdef HAVE_ELEMENTARY_WL2
+
+ seatid = _wl_default_seat_id_get((Evas_Object *)obj);
+#endif
+ wdata->udata = udata;
+ wdata->datacb = datacb;
+ efl_selection_manager_selection_get(sel_man, (Evas_Object *)obj, (Efl_Selection_Type)type,
+ (Efl_Selection_Format)format,
+ wdata, _selection_data_ready_cb, NULL, seatid);
+ return EINA_TRUE;
+}
+
+EAPI Eina_Bool
+elm_cnp_selection_set(Evas_Object *obj, Elm_Sel_Type type,
+ Elm_Sel_Format format, const void *selbuf, size_t buflen)
+{
+ int seatid = 1;
+ Eina_Future *f;
+ Sel_Lost_Data *ldata;
+ Eo *sel_man = _selection_manager_get(obj);
+ Eina_Slice data;
+
+ ldata = calloc(1, sizeof(Sel_Lost_Data));
+ if (!ldata) return EINA_FALSE;
+ data.mem = selbuf;
+ data.len = buflen;
+#ifdef HAVE_ELEMENTARY_WL2
+ seatid = _wl_default_seat_id_get(obj);
+#endif
+ f = efl_selection_manager_selection_set(sel_man, obj, (Efl_Selection_Type)type,
+ (Efl_Selection_Format)format, data, seatid);
+
+ ldata->obj = obj;
+ ldata->type = type;
+ eina_future_then_easy(f, _selection_lost_cb, NULL, NULL, EINA_VALUE_TYPE_UINT, ldata);
+
+ return EINA_TRUE;
+}
+
+EAPI Eina_Bool
+elm_object_cnp_selection_clear(Evas_Object *obj, Elm_Sel_Type type)
+{
+ int seatid = 1;
+ Eo *sel_man = _selection_manager_get((Evas_Object *)obj);
+
+#ifdef HAVE_ELEMENTARY_WL2
+ seatid = _wl_default_seat_id_get(obj);
+#endif
+ efl_selection_manager_selection_clear(sel_man, obj, (Efl_Selection_Type)type, seatid);
+
+ return EINA_TRUE;
+}
+
+EAPI void
+elm_cnp_selection_loss_callback_set(Evas_Object *obj, Elm_Sel_Type type,
+ Elm_Selection_Loss_Cb func, const void *data)
+{
+ Sel_Lost_Data *ldata = calloc(1, sizeof(Sel_Lost_Data));
+ if (!ldata) return;
+ ldata->obj = obj;
+ ldata->type = type;
+ ldata->udata = (void *)data;
+ ldata->loss_cb = func;
+ lost_cb_list = eina_list_append(lost_cb_list, ldata);
+}
+
+EAPI Eina_Bool
+elm_selection_selection_has_owner(Evas_Object *obj)
+{
+ int seatid = 1;
+ Eo *sel_man = _selection_manager_get((Evas_Object *)obj);
+
+#ifdef HAVE_ELEMENTARY_WL2
+ seatid = _wl_default_seat_id_get(obj);
+#endif
+
+ return efl_selection_manager_selection_has_owner(sel_man, obj,
+ EFL_SELECTION_TYPE_CLIPBOARD, seatid);
+}
+
+EAPI Eina_Bool
+elm_cnp_clipboard_selection_has_owner(Evas_Object *obj)
+{
+ int seatid = 1;
+ Eo *sel_man = _selection_manager_get((Evas_Object *)obj);
+
+#ifdef HAVE_ELEMENTARY_WL2
+ seatid = _wl_default_seat_id_get(obj);
+#endif
+ return efl_selection_manager_selection_has_owner(sel_man, obj,
+ EFL_SELECTION_TYPE_CLIPBOARD, seatid);
+}
+
+#include "efl_selection.eo.c"
diff --git a/src/lib/elementary/efl_selection.eo b/src/lib/elementary/efl_selection.eo
new file mode 100644
index 0000000000..9db0de597b
--- /dev/null
+++ b/src/lib/elementary/efl_selection.eo
@@ -0,0 +1,45 @@
+import efl_selection_types;
+
+mixin Efl.Selection {
+ [[Efl Selection class]]
+ data: null;
+ methods {
+ selection_set {
+ [[Set the selection data to the object]]
+ params {
+ @in type: Efl.Selection_Type; [[Selection Type]]
+ @in format: Efl.Selection_Format; [[Selection Format]]
+ @in data: Eina.Slice;
+ @in seat: uint;[[Specified seat for multiple seats case.]]
+ }
+ return: future<void>; [[Future for tracking when the selection is lost]]
+ }
+ selection_get {
+ [[Get the data from the object that has selection]]
+ params {
+ @in type: Efl.Selection_Type; [[Selection Type]]
+ @in format: Efl.Selection_Format; [[Selection Format]]
+ @in data_func: Efl.Selection_Data_Ready; [[Data ready function pointer]]
+ @in seat: uint;[[Specified seat for multiple seats case.]]
+ }
+ }
+ selection_clear {
+ [[Clear the selection data from the object]]
+ params {
+ @in type: Efl.Selection_Type; [[Selection Type]]
+ @in seat: uint; [[Specified seat for multiple seats case.]]
+ }
+ }
+ has_owner {
+ [[Determine whether the selection data has owner]]
+ params {
+ @in type: Efl.Selection_Type; [[Selection type]]
+ @in seat: uint; [[Specified seat for multiple seats case.]]
+ }
+ return: bool; [[EINA_TRUE if there is object owns selection, otherwise EINA_FALSE]]
+ }
+ }
+ events {
+ selection,changed: Efl.Selection_Changed; [[Called when display server's selection has changed]]
+ }
+}
diff --git a/src/lib/elementary/efl_selection_manager.c b/src/lib/elementary/efl_selection_manager.c
new file mode 100644
index 0000000000..0498820e98
--- /dev/null
+++ b/src/lib/elementary/efl_selection_manager.c
@@ -0,0 +1,5626 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <Elementary.h>
+#include "elm_priv.h"
+#ifdef HAVE_MMAN_H
+# include <sys/mman.h>
+#endif
+
+#include "efl_selection_manager_private.h"
+
+#define MY_CLASS EFL_SELECTION_MANAGER_CLASS
+
+//#define DEBUGON 1
+#ifdef DEBUGON
+# define sel_debug(fmt, args...) fprintf(stderr, __FILE__":%s:%d : " fmt "\n", __FUNCTION__, __LINE__, ##args)
+#else
+# define sel_debug(x...) do { } while (0)
+#endif
+
+static void _anim_data_free(Sel_Manager_Drag_Container *dc);
+static void _cont_obj_mouse_move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _cont_obj_mouse_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _item_container_del_internal(Sel_Manager_Drag_Container *dc, Eina_Bool full);
+
+void efl_selection_manager_drop_target_del(Eo *obj, Efl_Object *target_obj, Efl_Selection_Format format, unsigned int seat);
+void efl_selection_manager_selection_clear(Eo *obj, Efl_Object *owner, Efl_Selection_Type type, unsigned int seat);
+void efl_selection_manager_drag_start(Eo *obj, Efl_Object *drag_obj, Efl_Selection_Format format, Eina_Slice data, Efl_Selection_Action action, void *icon_func_data, Efl_Dnd_Drag_Icon_Create icon_func, Eina_Free_Cb icon_func_free_cb, unsigned int seat);
+
+static Eina_List *managers;
+
+#ifdef HAVE_ELEMENTARY_X
+static void _set_selection_list(Sel_Manager_Selection *sel_list, Sel_Manager_Seat_Selection *seat_sel);
+static Ecore_X_Atom _x11_dnd_action_rev_map(Efl_Selection_Action action);
+static Ecore_X_Window _x11_xwin_get(const Evas_Object *obj);
+#endif
+
+#ifdef HAVE_ELEMENTARY_WL2
+static Ecore_Wl2_Window *_wl_window_get(const Evas_Object *obj);
+static Ecore_Wl2_Input *_wl_seat_get(Ecore_Wl2_Window *win, Evas_Object *obj, unsigned int seat_id);
+#endif
+
+#ifdef HAVE_ELEMENTARY_WIN32
+static void _set_selection_list(Sel_Manager_Selection *sel_list, Sel_Manager_Seat_Selection *seat_sel);
+#endif
+
+static Sel_Manager_Seat_Selection *
+_sel_manager_seat_selection_get(Efl_Selection_Manager_Data *pd, unsigned int seat)
+{
+ Eina_List *l = NULL;
+ Sel_Manager_Seat_Selection *seat_sel = NULL;
+
+ EINA_LIST_FOREACH(pd->seat_list, l, seat_sel)
+ {
+ if (seat_sel->seat == seat)
+ break;
+ }
+ if (!seat_sel)
+ ERR("Could not find request seat");
+
+ return seat_sel;
+}
+
+static inline void
+_owner_change_check(Efl_Selection_Manager *manager, Efl_Object *owner,
+ Sel_Manager_Seat_Selection *seat_sel,
+ Sel_Manager_Selection *sel,
+ Efl_Selection_Type type, Eina_Bool same_win)
+{
+ if (!same_win)
+ {
+ Eina_List *l, *l_next;
+ Eo *man;
+
+ EINA_LIST_FOREACH_SAFE(managers, l, l_next, man)
+ {
+ if (man != manager)
+ {
+ Eina_List *l2, *l2_next, *l3, *l3_next;
+ Sel_Manager_Selection_Lost *sel_lost;
+ Sel_Manager_Seat_Selection *seat_sel2;
+ Efl_Selection_Manager_Data *pd = efl_data_scope_get(man, MY_CLASS);
+
+ if (!pd) continue;
+ EINA_LIST_FOREACH_SAFE(pd->seat_list, l3, l3_next, seat_sel2)
+ {
+ EINA_LIST_FOREACH_SAFE(seat_sel2->sel_lost_list, l2, l2_next, sel_lost)
+ {
+ if ((sel_lost->request) &&
+ (sel_lost->type == type))
+ {
+ eina_promise_resolve(sel_lost->promise, eina_value_uint_init(sel_lost->type));
+ seat_sel2->sel_lost_list = eina_list_remove(seat_sel2->sel_lost_list, sel_lost);
+ free(sel_lost);
+ }
+ }
+ seat_sel2->xwin = 0;
+#if defined(HAVE_ELEMENTARY_X) || defined(HAVE_ELEMENTARY_WIN32)
+ if (seat_sel2->sel_list)
+ {
+ int i;
+
+ for (i = 0;
+ i < (EFL_SELECTION_TYPE_CLIPBOARD + 1)
+ ; i++)
+ {
+#ifdef HAVE_ELEMENTARY_X
+ seat_sel2->sel_list[i].xwin = 0;
+#elif defined (HAVE_ELEMENTARY_WIN32)
+ seat_sel2->sel_list[i].win = NULL;
+#endif
+ seat_sel2->sel_list[i].active = EINA_FALSE;
+ }
+ }
+#endif
+#if defined(HAVE_ELEMENTARY_WL2) || defined(HAVE_ELEMENTARY_COCOA)
+ if (seat_sel2->sel)
+ {
+ seat_sel2->sel->win = 0;
+ seat_sel2->sel->active = EINA_FALSE;
+ }
+#endif
+ }
+ }
+ }
+ }
+ if ((sel->owner != NULL) &&
+ (sel->owner != owner) && same_win)
+ {
+ Eina_List *l, *l_next;
+ Sel_Manager_Selection_Lost *sel_lost;
+ EINA_LIST_FOREACH_SAFE(seat_sel->sel_lost_list, l, l_next, sel_lost)
+ {
+ if ((sel_lost->request == sel->owner) &&
+ (sel_lost->type == type))
+ {
+ eina_promise_resolve(sel_lost->promise, eina_value_uint_init(sel_lost->type));
+ seat_sel->sel_lost_list = eina_list_remove(seat_sel->sel_lost_list, sel_lost);
+ free(sel_lost);
+ }
+ }
+ }
+}
+
+static Sel_Manager_Seat_Selection *
+_sel_manager_seat_selection_init(Efl_Selection_Manager_Data *pd, unsigned int seat)
+{
+ Sel_Manager_Seat_Selection *seat_sel = NULL;
+ Eina_List *l = NULL;
+
+ EINA_LIST_FOREACH(pd->seat_list, l, seat_sel)
+ {
+ if(seat_sel->seat == seat)
+ break;
+ }
+ if (!seat_sel)
+ {
+ seat_sel = calloc(1, sizeof(Sel_Manager_Seat_Selection));
+ if (!seat_sel)
+ {
+ ERR("Failed to allocate seat");
+ return NULL;
+ }
+ seat_sel->saved_types = calloc(1, sizeof(Saved_Type));
+ seat_sel->seat = seat;
+ seat_sel->pd = pd;
+ pd->seat_list = eina_list_append(pd->seat_list, seat_sel);
+ }
+#ifdef HAVE_ELEMENTARY_X
+ if (!seat_sel->sel_list)
+ {
+ seat_sel->sel_list = calloc(1, (EFL_SELECTION_TYPE_CLIPBOARD + 1) * sizeof(Sel_Manager_Selection));
+ if (!seat_sel->sel_list)
+ {
+ ERR("failed to allocate selection list");
+ return NULL;
+ }
+ _set_selection_list(seat_sel->sel_list, seat_sel);
+ }
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ if (!seat_sel->sel)
+ {
+ Sel_Manager_Selection *sel = calloc(1, sizeof(Sel_Manager_Selection));
+ if (!sel)
+ {
+ ERR("failed to allocate selection");
+ return NULL;
+ }
+ sel->seat_sel = seat_sel;
+ seat_sel->sel = sel;
+ }
+#endif
+#ifdef HAVE_ELEMENTARY_COCOA
+ if (!seat_sel->sel)
+ {
+ Sel_Manager_Selection *sel = calloc(1, sizeof(Sel_Manager_Selection));
+ if (!sel)
+ {
+ ERR("failed to allocate selection");
+ return NULL;
+ }
+ sel->seat_sel = seat_sel;
+ seat_sel->sel = sel;
+ }
+#endif
+#ifdef HAVE_ELEMENTARY_WIN32
+ if (!seat_sel->sel_list)
+ {
+ seat_sel->sel_list = calloc(1, (EFL_SELECTION_TYPE_CLIPBOARD + 1) * sizeof(Sel_Manager_Selection));
+ if (!seat_sel->sel_list)
+ {
+ ERR("failed to allocate selection list");
+ return NULL;
+ }
+ _set_selection_list(seat_sel->sel_list, seat_sel);
+ }
+#endif
+
+ return seat_sel;
+}
+
+static void
+_sel_manager_promise_cancel(void *data, const Eina_Promise *dead_future EINA_UNUSED)
+{
+ Sel_Manager_Selection_Lost *sel_lost = data;
+ //FIXME: remove from sel_lost_list in seat_sel
+ free(sel_lost);
+}
+
+static inline Eina_Future *
+_update_sel_lost_list(Efl_Object *obj, Efl_Selection_Type type,
+ Sel_Manager_Seat_Selection *seat_sel)
+{
+ Eina_Promise *p;
+ Sel_Manager_Selection_Lost *sel_lost;
+
+ sel_lost = calloc(1, sizeof(Sel_Manager_Selection_Lost));
+ if (!sel_lost)
+ return NULL;
+ sel_lost->request = obj;
+ sel_lost->type = type;
+ seat_sel->sel_lost_list = eina_list_append(seat_sel->sel_lost_list, sel_lost);
+
+ p = eina_promise_new(efl_loop_future_scheduler_get(obj),
+ _sel_manager_promise_cancel, NULL);
+ eina_promise_data_set(p, sel_lost);
+ if (!p) return NULL;
+ sel_lost->promise = p;
+
+ return eina_future_new(p);
+}
+
+/* TODO: this should not be an actual tempfile, but rather encode the object
+ * as http://dataurl.net/ if it's an image or similar. Evas should support
+ * decoding it as memfile. */
+static Tmp_Info *
+_tempfile_new(int size)
+{
+#ifdef HAVE_MMAN_H
+ Tmp_Info *info;
+ const char *tmppath = NULL;
+ mode_t cur_umask;
+ int len;
+
+ info = calloc(1, sizeof(Tmp_Info));
+ if (!info) return NULL;
+#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
+ if (getuid() == geteuid())
+#endif
+ tmppath = getenv("TMP");
+ if (!tmppath) tmppath = P_tmpdir;
+ len = snprintf(NULL, 0, "%s/%sXXXXXX", tmppath, "elmcnpitem-");
+ if (len < 0) goto on_error;
+ len++;
+ info->filename = malloc(len);
+ if (!info->filename) goto on_error;
+ snprintf(info->filename,len,"%s/%sXXXXXX", tmppath, "elmcnpitem-");
+ cur_umask = umask(S_IRWXO | S_IRWXG);
+ info->fd = mkstemp(info->filename);
+ umask(cur_umask);
+ if (info->fd < 0) goto on_error;
+# ifdef __linux__
+ {
+ char *tmp;
+ /* And before someone says anything see POSIX 1003.1-2008 page 400 */
+ long pid;
+
+ pid = (long)getpid();
+ /* Use pid instead of /proc/self: That way if can be passed around */
+ len = snprintf(NULL,0,"/proc/%li/fd/%i", pid, info->fd);
+ len++;
+ tmp = malloc(len);
+ if (tmp)
+ {
+ snprintf(tmp,len, "/proc/%li/fd/%i", pid, info->fd);
+ unlink(info->filename);
+ free(info->filename);
+ info->filename = tmp;
+ }
+ }
+# endif
+ sel_debug("filename is %s\n", info->filename);
+ if (size < 1) goto on_error;
+ /* Map it in */
+ if (ftruncate(info->fd, size))
+ {
+ perror("ftruncate");
+ goto on_error;
+ }
+ eina_mmap_safety_enabled_set(EINA_TRUE);
+ info->map = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_SHARED, info->fd, 0);
+ if (info->map == MAP_FAILED)
+ {
+ perror("mmap");
+ goto on_error;
+ }
+ return info;
+
+ on_error:
+ if (info->fd >= 0) close(info->fd);
+ info->fd = -1;
+ /* Set map to NULL and return */
+ info->map = NULL;
+ info->len = 0;
+ free(info->filename);
+ free(info);
+ return NULL;
+#else
+ (void) size;
+ return NULL;
+#endif
+}
+
+static int
+_tmpinfo_free(Tmp_Info *info)
+{
+ if (!info) return 0;
+ free(info->filename);
+ free(info);
+ return 0;
+}
+
+static inline void
+_drop_target_cbs_del(Efl_Selection_Manager_Data *pd, Sel_Manager_Dropable *dropable, Efl_Object *obj)
+{
+ if (dropable)
+ {
+ Drop_Format *df;
+ while (dropable->format_list)
+ {
+ df = EINA_INLIST_CONTAINER_GET(dropable->format_list, Drop_Format);
+ efl_selection_manager_drop_target_del(pd->sel_man, obj,
+ df->format, dropable->seat);
+ // If drop_target_del() happened to delete dropabale, then
+ // re-fetch it each loop to make sure it didn't
+ dropable = efl_key_data_get(obj, "__elm_dropable");
+ if (!dropable) break;
+ }
+ }
+}
+
+static void
+_all_drop_targets_cbs_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *info EINA_UNUSED)
+{
+ Efl_Selection_Manager_Data *pd = data;
+ Sel_Manager_Dropable *dropable = NULL;
+
+ if (!pd) return;
+ dropable = efl_key_data_get(obj, "__elm_dropable");
+ _drop_target_cbs_del(pd, dropable, obj);
+}
+
+static void
+_dropable_coords_adjust(Sel_Manager_Dropable *dropable, Eina_Position2D *pos)
+{
+ Ecore_Evas *ee;
+ Evas *evas = evas_object_evas_get(dropable->obj);
+ int ex = 0, ey = 0, ew = 0, eh = 0;
+ Evas_Object *win;
+
+ ee = ecore_evas_ecore_evas_get(evas);
+ ecore_evas_geometry_get(ee, &ex, &ey, &ew, &eh);
+ pos->x = pos->x - ex;
+ pos->y = pos->y - ey;
+
+ /* For Wayland, frame coords have to be subtracted. */
+ Evas_Coord fx, fy;
+ evas_output_framespace_get(evas, &fx, &fy, NULL, NULL);
+ if (fx || fy) sel_debug("evas frame fx %d fy %d\n", fx, fy);
+ pos->x = pos->x - fx;
+ pos->y = pos->y - fy;
+
+ if (elm_widget_is(dropable->obj))
+ {
+ win = elm_widget_top_get(dropable->obj);
+ if (win && efl_isa(win, EFL_UI_WIN_CLASS))
+ {
+ Evas_Coord x2, y2;
+ int rot = elm_win_rotation_get(win);
+ switch (rot)
+ {
+ case 90:
+ x2 = ew - pos->y;
+ y2 = pos->x;
+ break;
+ case 180:
+ x2 = ew - pos->x;
+ y2 = eh - pos->y;
+ break;
+ case 270:
+ x2 = pos->y;
+ y2 = eh - pos->x;
+ break;
+ default:
+ x2 = pos->x;
+ y2 = pos->y;
+ break;
+ }
+ sel_debug("rotation %d, w %d, h %d - x:%d->%d, y:%d->%d\n",
+ rot, ew, eh, pos->x, x2, pos->y, y2);
+ pos->x = x2;
+ pos->y = y2;
+ }
+ }
+}
+
+static Eina_Bool
+_drag_cancel_animate(void *data, double pos)
+{ /* Animation to "move back" drag-window */
+ Sel_Manager_Seat_Selection *seat_sel = data;
+ sel_debug("in, pos: %f", pos);
+ if (pos >= 0.99)
+ {
+#ifdef HAVE_ELEMENTARY_X
+ Ecore_X_Window xdragwin = _x11_xwin_get(seat_sel->drag_win);
+ ecore_x_window_ignore_set(xdragwin, 0);
+#endif
+ sel_debug("Delete drag_win");
+ evas_object_del(seat_sel->drag_win);
+ seat_sel->drag_win = NULL;
+ return ECORE_CALLBACK_CANCEL;
+ }
+ else
+ {
+ int x, y;
+ x = seat_sel->drag_win_end.x - (pos * (seat_sel->drag_win_end.x - seat_sel->drag_win_start.x));
+ y = seat_sel->drag_win_end.y - (pos * (seat_sel->drag_win_end.y - seat_sel->drag_win_start.y));
+ evas_object_move(seat_sel->drag_win, x, y);
+ }
+
+ return ECORE_CALLBACK_RENEW;
+}
+
+static Efl_Selection_Format
+_dnd_types_to_format(Efl_Selection_Manager_Data *pd, const char **types, int ntypes)
+{
+ Efl_Selection_Format ret_type = 0;
+ int i;
+ for (i = 0; i < ntypes; i++)
+ {
+ Sel_Manager_Atom *atom = eina_hash_find(pd->type_hash, types[i]);
+ if (atom) ret_type |= atom->format;
+ }
+ return ret_type;
+}
+
+static Eina_List *
+_dropable_list_geom_find(Efl_Selection_Manager_Data *pd, Evas *evas, Evas_Coord px, Evas_Coord py)
+{
+ Eina_List *itr, *top_objects_list = NULL, *dropable_list = NULL;
+ Evas_Object *top_obj;
+ Sel_Manager_Dropable *dropable = NULL;
+
+ if (!pd->drop_list) return NULL;
+
+ /* We retrieve the (non-smart) objects pointed by (px, py) */
+ top_objects_list = evas_tree_objects_at_xy_get(evas, NULL, px, py);
+ /* We walk on this list from the last because if the list contains more than one
+ * element, all but the last will repeat events. The last one can repeat events
+ * or not. Anyway, this last one is the first that has to be taken into account
+ * for the determination of the drop target.
+ */
+ EINA_LIST_REVERSE_FOREACH(top_objects_list, itr, top_obj)
+ {
+ Evas_Object *object = top_obj;
+ /* We search for the dropable data into the object. If not found, we search into its parent.
+ * For example, if a button is a drop target, the first object will be an (internal) image.
+ * The drop target is attached to the button, i.e to image's parent. That's why we need to
+ * walk on the parents until NULL.
+ * If we find this dropable data, we found our drop target.
+ */
+ while (object)
+ {
+ dropable = efl_key_data_get(object, "__elm_dropable");
+ if (dropable)
+ {
+ Eina_Bool exist = EINA_FALSE;
+ Eina_List *l;
+ Sel_Manager_Dropable *d = NULL;
+ EINA_LIST_FOREACH(dropable_list, l, d)
+ {
+ if (d == dropable)
+ {
+ exist = EINA_TRUE;
+ break;
+ }
+ }
+ if (!exist)
+ dropable_list = eina_list_append(dropable_list, dropable);
+ object = evas_object_smart_parent_get(object);
+ if (dropable)
+ sel_debug("Drop target %p of type %s found\n",
+ dropable->obj, efl_class_name_get(efl_class_get(dropable->obj)));
+ }
+ else
+ object = evas_object_smart_parent_get(object);
+ }
+ }
+ eina_list_free(top_objects_list);
+ return dropable_list;
+}
+
+#ifdef HAVE_ELEMENTARY_X
+static Ecore_X_Window
+_x11_xwin_get(const Efl_Object *obj)
+{
+ if (!obj) return 0;
+
+ Ecore_X_Window xwin = 0;
+ //get top
+ const Evas_Object *top = obj;
+ const Evas_Object *parent = obj;
+ while(parent)
+ {
+ top = parent;
+ parent = efl_parent_get(parent);
+ }
+ if (efl_isa(top, EFL_UI_WIN_CLASS))
+ {
+ xwin = elm_win_xwindow_get(top);
+ }
+ if (!xwin)
+ {
+ Ecore_Evas *ee;
+ Evas *evas = evas_object_evas_get(obj);
+ if (!evas) return 0;
+ ee = ecore_evas_ecore_evas_get(evas);
+ if (!ee) return 0;
+
+ while(!xwin)
+ {
+ const char *engine_name = ecore_evas_engine_name_get(ee);
+ if (!strcmp(engine_name, ELM_BUFFER))
+ {
+ ee = ecore_evas_buffer_ecore_evas_parent_get(ee);
+ if (!ee) return 0;
+ xwin = _elm_ee_xwin_get(ee);
+ }
+ else
+ {
+ xwin = _elm_ee_xwin_get(ee);
+ if (!xwin) return 0;
+ }
+ }
+ }
+
+ return xwin;
+}
+
+static Eina_Bool
+_x11_is_uri_type_data(Sel_Manager_Selection *sel EINA_UNUSED, Ecore_X_Event_Selection_Notify *notify)
+{
+ Ecore_X_Selection_Data *data;
+ char *p;
+
+ data = notify->data;
+ sel_debug("data->format is %d %p %p", data->format, notify, data);
+ if (data->content == ECORE_X_SELECTION_CONTENT_FILES) return EINA_TRUE;
+ p = (char *)data->data;
+ if (!p) return EINA_TRUE;
+ sel_debug("Got %s", p);
+ if (strncmp(p, "file:/", 6))
+ {
+ if (*p != '/') return EINA_FALSE;
+ }
+ return EINA_TRUE;
+}
+
+static Sel_Manager_Seat_Selection *
+_x11_sel_manager_seat_selection_init(Efl_Selection_Manager_Data *pd, unsigned int seat)
+{
+ Sel_Manager_Seat_Selection *seat_sel = NULL;
+ Eina_List *l = NULL;
+
+ EINA_LIST_FOREACH(pd->seat_list, l, seat_sel)
+ {
+ if(seat_sel->seat == seat)
+ break;
+ }
+ if (!seat_sel)
+ {
+ seat_sel = calloc(1, sizeof(Sel_Manager_Seat_Selection));
+ if (!seat_sel)
+ {
+ ERR("Failed to allocate seat");
+ return NULL;
+ }
+ seat_sel->saved_types = calloc(1, sizeof(Saved_Type));
+ seat_sel->seat = seat;
+ seat_sel->pd = pd;
+ pd->seat_list = eina_list_append(pd->seat_list, seat_sel);
+ }
+ if (!seat_sel->sel_list)
+ {
+ //TODO: reduce memory (may be just need one common sel_list)
+ seat_sel->sel_list = calloc(1, (EFL_SELECTION_TYPE_CLIPBOARD + 1) * sizeof(Sel_Manager_Selection));
+ if (!seat_sel->sel_list)
+ {
+ ERR("failed to allocate selection list");
+ return NULL;
+ }
+ _set_selection_list(seat_sel->sel_list, seat_sel);
+ }
+
+ return seat_sel;
+}
+
+static Eina_Bool
+_x11_data_preparer_text(Sel_Manager_Seat_Selection *seat_sel EINA_UNUSED,
+ Ecore_X_Event_Selection_Notify *notify,
+ Efl_Selection_Data *ddata, Tmp_Info **tmp_info EINA_UNUSED)
+{
+ sel_debug("text data preparer");
+ Ecore_X_Selection_Data *data = notify->data;
+ ddata->format = EFL_SELECTION_FORMAT_TEXT;
+ ddata->content.mem = eina_memdup(data->data, data->length, EINA_TRUE);
+ ddata->content.len = data->length;
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_x11_data_preparer_markup(Sel_Manager_Seat_Selection *seat_sel EINA_UNUSED,
+ Ecore_X_Event_Selection_Notify *notify,
+ Efl_Selection_Data *ddata, Tmp_Info **tmp_info EINA_UNUSED)
+{
+ sel_debug("markup data preparer");
+ Ecore_X_Selection_Data *data = notify->data;
+ ddata->format = EFL_SELECTION_FORMAT_MARKUP;
+ ddata->content.mem = eina_memdup(data->data, data->length, EINA_TRUE);
+ ddata->content.len = data->length;
+ return EINA_TRUE;
+}
+
+/**
+ * So someone is pasting an image into my entry or widget...
+ */
+static Eina_Bool
+_x11_data_preparer_uri(Sel_Manager_Seat_Selection *seat_sel, Ecore_X_Event_Selection_Notify *notify,
+ Efl_Selection_Data *ddata, Tmp_Info **tmp_info EINA_UNUSED)
+{
+ sel_debug("uri data preparer");
+ Ecore_X_Selection_Data *data;
+ Ecore_X_Selection_Data_Files *files;
+ char *p, *stripstr = NULL;
+
+ data = notify->data;
+ sel_debug("data->format is %d %p %p\n", data->format, notify, data);
+ if (data->content == ECORE_X_SELECTION_CONTENT_FILES)
+ {
+ Efreet_Uri *uri;
+ Eina_Strbuf *strbuf;
+ int i;
+
+ sel_debug("got a files list\n");
+ files = notify->data;
+ /*
+ if (files->num_files > 1)
+ {
+ // Don't handle many items <- this makes mr bigglesworth sad :(
+ sel_debug("more then one file: Bailing\n");
+ return EINA_FALSE;
+ }
+ stripstr = p = strdup(files->files[0]);
+ */
+
+ strbuf = eina_strbuf_new();
+ if (!strbuf)
+ return EINA_FALSE;
+
+ for (i = 0; i < files->num_files ; i++)
+ {
+ uri = efreet_uri_decode(files->files[i]);
+ if (uri)
+ {
+ eina_strbuf_append(strbuf, uri->path);
+ efreet_uri_free(uri);
+ }
+ else
+ {
+ eina_strbuf_append(strbuf, files->files[i]);
+ }
+ if (i < (files->num_files - 1))
+ eina_strbuf_append(strbuf, "\n");
+ }
+ stripstr = eina_strbuf_string_steal(strbuf);
+ eina_strbuf_free(strbuf);
+ }
+ else
+ {
+ Efreet_Uri *uri;
+
+ p = (char *)eina_memdup((unsigned char *)data->data, data->length, EINA_TRUE);
+ if (!p) return EINA_FALSE;
+ uri = efreet_uri_decode(p);
+ if (!uri)
+ {
+ /* Is there any reason why we care of URI without scheme? */
+ if (p[0] == '/') stripstr = p;
+ else free(p);
+ }
+ else
+ {
+ free(p);
+ stripstr = strdup(uri->path);
+ efreet_uri_free(uri);
+ }
+ }
+
+ if (!stripstr)
+ {
+ sel_debug("Couldn't find a file\n");
+ return EINA_FALSE;
+ }
+ free(seat_sel->saved_types->imgfile);
+ if (seat_sel->saved_types->textreq)
+ {
+ seat_sel->saved_types->textreq = 0;
+ seat_sel->saved_types->imgfile = stripstr;
+ }
+ else
+ {
+ ddata->format = EFL_SELECTION_FORMAT_IMAGE;
+ ddata->content.mem = stripstr;
+ ddata->content.len = strlen(stripstr);
+ seat_sel->saved_types->imgfile = NULL;
+ }
+ return EINA_TRUE;
+}
+
+/**
+ * Just received an vcard, either through cut and paste, or dnd.
+ */
+static Eina_Bool
+_x11_data_preparer_vcard(Sel_Manager_Seat_Selection *seat_sel EINA_UNUSED,
+ Ecore_X_Event_Selection_Notify *notify,
+ Efl_Selection_Data *ddata, Tmp_Info **tmp_info EINA_UNUSED)
+{
+ sel_debug("vcard receive\n");
+ Ecore_X_Selection_Data *data = notify->data;
+ ddata->format = EFL_SELECTION_FORMAT_VCARD;
+ ddata->content.mem = eina_memdup(data->data, data->length, EINA_TRUE);
+ ddata->content.len = data->length;
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_x11_data_preparer_image(Sel_Manager_Seat_Selection *seat_sel EINA_UNUSED,
+ Ecore_X_Event_Selection_Notify *notify,
+ Efl_Selection_Data *ddata, Tmp_Info **tmp_info)
+{
+ Ecore_X_Selection_Data *data = notify->data;
+ sel_debug("got a image file!\n");
+ sel_debug("Size if %d\n", data->length);
+
+ ddata->format = EFL_SELECTION_FORMAT_IMAGE;
+ data = notify->data;
+
+ Tmp_Info *tmp = _tempfile_new(data->length);
+ if (!tmp) return EINA_FALSE;
+ memcpy(tmp->map, data->data, data->length);
+ munmap(tmp->map, data->length);
+ ddata->content.mem = strdup(tmp->filename);
+ ddata->content.len = strlen(tmp->filename);
+ *tmp_info = tmp;
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_x11_win_filter(Eo *manager EINA_UNUSED, Ecore_X_Window xwin)
+{
+ Eo *win;
+ const Eina_List *l;
+
+ EINA_LIST_FOREACH(_elm_win_list, l, win)
+ {
+ if (elm_win_window_id_get(win) == xwin) return EINA_FALSE;
+ }
+ return EINA_TRUE;
+}
+
+/*
+ * Callback to handle a targets response on a selection request:
+ * So pick the format we'd like; and then request it.
+ */
+static Eina_Bool
+_x11_notify_handler_targets(Efl_Selection_Manager_Data *pd, Sel_Manager_Selection *sel, Ecore_X_Event_Selection_Notify *notify)
+{
+ sel_debug("notify handler targets");
+ Ecore_X_Selection_Data_Targets *targets;
+ Ecore_X_Atom *atom_list;
+ int i, j;
+
+ targets = notify->data;
+ atom_list = (Ecore_X_Atom *)(targets->data.data);
+ for (j = (SELECTION_ATOM_LISTING_ATOMS + 1); j < SELECTION_N_ATOMS; j++)
+ {
+ sel_debug("\t%s %d", pd->atom_list[j].name, pd->atom_list[j].x_atom);
+ if (!(pd->atom_list[j].format & sel->request_format)) continue;
+ for (i = 0; i < targets->data.length; i++)
+ {
+ if ((pd->atom_list[j].x_atom == atom_list[i]) && (pd->atom_list[j].x_data_preparer))
+ {
+ if (j == SELECTION_ATOM_TEXT_URILIST)
+ {
+ if (!_x11_is_uri_type_data(sel, notify)) continue;
+ }
+ sel_debug("Atom %s matches", pd->atom_list[j].name);
+ goto done;
+ }
+ }
+ }
+ sel_debug("Couldn't find anything that matches");
+ return ECORE_CALLBACK_PASS_ON;
+done:
+ sel_debug("Sending request for %s, xwin=%#llx",
+ pd->atom_list[j].name, (unsigned long long)sel->xwin);
+ sel->request(sel->xwin, pd->atom_list[j].name);
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+static Eina_Bool
+_x11_fixes_selection_notify(void *data, int t EINA_UNUSED, void *event)
+{
+ Efl_Selection_Manager_Data *pd = data;
+ Efl_Selection_Changed e;
+ Ecore_X_Event_Fixes_Selection_Notify *ev = event;
+ Sel_Manager_Seat_Selection *seat_sel;
+ Efl_Selection_Type type;
+ Sel_Manager_Selection *sel;
+
+ if (_x11_win_filter(pd->sel_man, ev->win)) return ECORE_CALLBACK_PASS_ON;
+
+ switch (ev->selection)
+ {
+ case ECORE_X_SELECTION_CLIPBOARD:
+ type = EFL_SELECTION_TYPE_CLIPBOARD;
+ break;
+ case ECORE_X_SELECTION_PRIMARY:
+ type = EFL_SELECTION_TYPE_PRIMARY;
+ break;
+ default: return ECORE_CALLBACK_RENEW;
+ }
+ seat_sel = _x11_sel_manager_seat_selection_init(pd, 1);
+ if (!seat_sel) return ECORE_CALLBACK_RENEW;
+ sel = seat_sel->sel_list + type;
+ if (sel->active && (sel->xwin != ev->owner))
+ efl_selection_manager_selection_clear(pd->sel_man, sel->owner, type, seat_sel->seat);
+ e.type = type;
+ e.seat = 1; /* under x11 this is always the default seat */
+ e.exist = !!ev->owner;
+ efl_event_callback_call(sel->owner, EFL_SELECTION_EVENT_SELECTION_CHANGED, &e);
+ //ecore_event_add(ELM_CNP_EVENT_SELECTION_CHANGED, e, NULL, NULL);
+
+ return ECORE_CALLBACK_RENEW;
+}
+
+/*
+ * Response to a selection notify:
+ * - So we have asked for the selection list.
+ * - If it's the targets list, parse it, and fire of what we want,
+ * else it's the data we want.
+ */
+//NB: x11 does not have seat, use 1 as default
+static Eina_Bool
+_efl_sel_manager_x11_selection_notify(void *udata, int type EINA_UNUSED, void *event)
+{
+ Efl_Selection_Manager_Data *pd = udata;
+ Ecore_X_Event_Selection_Notify *ev = event;
+ Sel_Manager_Selection *sel;
+ Sel_Manager_Seat_Selection *seat_sel = NULL;
+ int i;
+
+ if (_x11_win_filter(pd->sel_man, ev->win)) return ECORE_CALLBACK_PASS_ON;
+
+ seat_sel = _sel_manager_seat_selection_get(pd, 1);
+ if (!seat_sel)
+ return EINA_FALSE;
+
+ sel_debug("selection notify callback: %d", ev->selection);
+ switch (ev->selection)
+ {
+ case ECORE_X_SELECTION_PRIMARY:
+ sel = seat_sel->sel_list + EFL_SELECTION_TYPE_PRIMARY;
+ break;
+ case ECORE_X_SELECTION_SECONDARY:
+ sel = seat_sel->sel_list + EFL_SELECTION_TYPE_SECONDARY;
+ break;
+ case ECORE_X_SELECTION_XDND:
+ sel = seat_sel->sel_list + EFL_SELECTION_TYPE_DND;
+ break;
+ case ECORE_X_SELECTION_CLIPBOARD:
+ sel = seat_sel->sel_list + EFL_SELECTION_TYPE_CLIPBOARD;
+ break;
+ default:
+ return ECORE_CALLBACK_PASS_ON;
+ }
+ sel_debug("Target is %s", ev->target);
+
+ if (ev->selection != ECORE_X_SELECTION_XDND &&
+ (!strcmp(ev->target, "TARGETS") || !strcmp(ev->target, "ATOMS")))
+ {
+ _x11_notify_handler_targets(pd, sel, ev);
+ return ECORE_CALLBACK_PASS_ON;
+ }
+ for (i = 0; i < SELECTION_N_ATOMS; i++)
+ {
+ if (!strcmp(ev->target, pd->atom_list[i].name))
+ {
+ if (pd->atom_list[i].x_data_preparer)
+ {
+ Efl_Selection_Data ddata;
+ Tmp_Info *tmp_info = NULL;
+ Eina_Bool success;
+ sel_debug("Found something: %s", pd->atom_list[i].name);
+
+ success = pd->atom_list[i].x_data_preparer(seat_sel, ev, &ddata, &tmp_info);
+ sel_debug("ddata: %s (%zd)", (const char *)ddata.content.mem, ddata.content.len);
+ if ((pd->atom_list[i].format == EFL_SELECTION_FORMAT_IMAGE) &&
+ (seat_sel->saved_types->imgfile))
+ break;
+ if (ev->selection == ECORE_X_SELECTION_XDND)
+ {
+ if (success)
+ {
+ Sel_Manager_Dropable *dropable;
+ Eina_List *l;
+ sel_debug("drag & drop\n");
+ EINA_LIST_FOREACH(pd->drop_list, l, dropable)
+ {
+ if (dropable->obj == sel->request_obj) break;
+ dropable = NULL;
+ }
+ if (dropable)
+ {
+ Drop_Format *df;
+ Eina_Inlist *itr;
+
+ ddata.action = sel->action;
+ if (!dropable->is_container)
+ {
+ sel_debug("normal dnd, not container");
+ ddata.pos = seat_sel->saved_types->pos;
+ }
+ else
+ {
+ sel_debug("Drop on container");
+ Eina_Position2D pos, posret = {0, 0};
+ evas_object_geometry_get(dropable->obj, &pos.x, &pos.y, NULL, NULL);
+ //get item
+ pos = EINA_POSITION2D(seat_sel->saved_types->pos.x + pos.x,
+ seat_sel->saved_types->pos.y + pos.y);
+ Efl_Object *it = NULL;
+ if (dropable->item_func)
+ it = dropable->item_func(dropable->item_func_data,
+ dropable->obj, pos, &posret);
+ ddata.pos = posret;
+ ddata.item = it;
+ }
+ EINA_INLIST_FOREACH_SAFE(dropable->format_list, itr, df)
+ {
+ if (df->format & dropable->last.format)
+ {
+ sel_debug("calling Drop event on: %p", dropable->obj);
+ efl_event_callback_call(dropable->obj, EFL_UI_DND_EVENT_DRAG_DROP, &ddata);
+ }
+ }
+ }
+ else
+ {
+ sel_debug("dnd: has NO dropable");
+ }
+ }
+ /* We have to finish DnD, no matter what */
+ ecore_x_dnd_send_finished();
+ }
+ else if (sel->data_func && success)
+ {
+ ddata.pos.x = ddata.pos.y = 0;
+ sel->data_func(sel->data_func_data, sel->request_obj, &ddata);
+ }
+ free((void *)ddata.content.mem);
+ if (tmp_info) _tmpinfo_free(tmp_info);
+ }
+ else sel_debug("Ignored: No handler!");
+ break;
+ }
+ }
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+static Eina_Bool
+_x11_selection_clear(void *data, int type EINA_UNUSED, void *event)
+{
+ Efl_Selection_Manager_Data *pd = data;
+ Ecore_X_Event_Selection_Clear *ev = event;
+ Sel_Manager_Selection *sel;
+ Sel_Manager_Seat_Selection *seat_sel = NULL;
+ Eina_List *l, *l_next;
+ Sel_Manager_Selection_Lost *sel_lost;
+ unsigned int i;
+
+ if (_x11_win_filter(pd->sel_man, ev->win)) return ECORE_CALLBACK_PASS_ON;
+
+ seat_sel = _sel_manager_seat_selection_get(pd, 1);
+ if (!seat_sel)
+ return EINA_FALSE;
+
+ for (i = EFL_SELECTION_TYPE_PRIMARY; i <= EFL_SELECTION_TYPE_CLIPBOARD; i++)
+ {
+ if (seat_sel->sel_list[i].ecore_sel == ev->selection) break;
+ }
+ sel_debug("selection %d clear", i);
+ /* Not me... Don't care */
+ if (i > EFL_SELECTION_TYPE_CLIPBOARD) return ECORE_CALLBACK_PASS_ON;
+
+ sel = seat_sel->sel_list + i;
+
+ EINA_LIST_FOREACH_SAFE(seat_sel->sel_lost_list, l, l_next, sel_lost)
+ {
+ if ((sel_lost->request == sel->owner) &&
+ (sel_lost->type == i))
+ {
+ sel_debug("resolve the promise: %p", sel_lost->promise);
+ eina_promise_resolve(sel_lost->promise, eina_value_uint_init(sel_lost->type));
+ seat_sel->sel_lost_list = eina_list_remove(seat_sel->sel_lost_list, sel_lost);
+ free(sel_lost);
+ }
+ }
+ sel->active = EINA_FALSE;
+ sel->owner = NULL;
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+static Eina_Bool
+_x11_general_converter(char *target EINA_UNUSED, void *data, int size EINA_UNUSED, void **data_ret, int *size_ret, Ecore_X_Atom *ttype EINA_UNUSED, int *typesize EINA_UNUSED)
+{
+ sel_debug("general converter");
+ Sel_Manager_Selection *sel = *(Sel_Manager_Selection **)data;
+ if (sel->format == EFL_SELECTION_FORMAT_NONE)
+ {
+ if (data_ret)
+ {
+ *data_ret = malloc(sel->data.len * sizeof(char) + 1);
+ if (!*data_ret) return EINA_FALSE;
+ memcpy(*data_ret, sel->data.mem, sel->data.len);
+ ((char**)(data_ret))[0][sel->data.len] = 0;
+ }
+ if (size_ret) *size_ret = sel->data.len;
+ }
+ else
+ {
+ if (sel->data.mem)
+ {
+ if (data_ret)
+ *data_ret = eina_memdup(sel->data.mem, sel->data.len, 1);
+ if (size_ret) *size_ret = sel->data.len;
+ }
+ else
+ {
+ if (data_ret) *data_ret = NULL;
+ if (size_ret) *size_ret = 0;
+ }
+ }
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_x11_targets_converter(char *target EINA_UNUSED, void *data, int size EINA_UNUSED, void **data_ret, int *size_ret, Ecore_X_Atom *ttype, int *typesize)
+{
+ int i, count;
+ Ecore_X_Atom *aret;
+ Sel_Manager_Selection *sel;
+ Efl_Selection_Format seltype;
+
+ sel_debug("target converter");
+ if (!data_ret) return EINA_FALSE;
+
+ sel = *(Sel_Manager_Selection **)data;
+ seltype = sel->format;
+ Sel_Manager_Seat_Selection *seat_sel = sel->seat_sel;
+ Efl_Selection_Manager_Data *pd = seat_sel->pd;
+
+ for (i = SELECTION_ATOM_LISTING_ATOMS + 1, count = 0; i < SELECTION_N_ATOMS ; i++)
+ {
+ if (seltype & pd->atom_list[i].format) count++;
+ }
+ aret = malloc(sizeof(Ecore_X_Atom) * count);
+ if (!aret) return EINA_FALSE;
+ for (i = SELECTION_ATOM_LISTING_ATOMS + 1, count = 0; i < SELECTION_N_ATOMS ; i++)
+ {
+ if (seltype & pd->atom_list[i].format)
+ aret[count ++] = pd->atom_list[i].x_atom;
+ }
+
+ *data_ret = aret;
+ if (typesize) *typesize = 32 /* urk */;
+ if (ttype) *ttype = ECORE_X_ATOM_ATOM;
+ if (size_ret) *size_ret = count;
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_x11_image_converter(char *target EINA_UNUSED, void *data EINA_UNUSED, int size EINA_UNUSED, void **data_ret EINA_UNUSED, int *size_ret EINA_UNUSED, Ecore_X_Atom *ttype EINA_UNUSED, int *typesize EINA_UNUSED)
+{
+ sel_debug("Image converter called");
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_x11_vcard_send(char *target EINA_UNUSED, void *data EINA_UNUSED, int size EINA_UNUSED, void **data_ret, int *size_ret, Ecore_X_Atom *ttype EINA_UNUSED, int *typesize EINA_UNUSED)
+{
+ Sel_Manager_Selection *sel;
+ char *s;
+
+ sel_debug("Vcard send called");
+ sel = *(Sel_Manager_Selection **)data;
+ s = malloc(sel->data.len + 1);
+ if (!s) return EINA_FALSE;
+ memcpy(s, sel->data.mem, sel->data.len);
+ s[sel->data.len] = 0;
+ if (data_ret) *data_ret = s;
+ if (size_ret) *size_ret = sel->data.len;
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_x11_text_converter(char *target, void *data, int size EINA_UNUSED, void **data_ret, int *size_ret, Ecore_X_Atom *ttype, int *typesize)
+{
+ Sel_Manager_Selection *sel;
+
+ sel = *(Sel_Manager_Selection **)data;
+ if (!sel) return EINA_FALSE;
+
+ sel_debug("text converter");
+ if (sel->format == EFL_SELECTION_FORMAT_NONE)
+ {
+ sel_debug("none");
+ if (data_ret)
+ {
+ *data_ret = malloc(sel->data.len * sizeof(char) + 1);
+ if (!*data_ret) return EINA_FALSE;
+ memcpy(*data_ret, data, sel->data.len);
+ ((char**)(data_ret))[0][sel->data.len] = 0;
+ }
+ if (size_ret) *size_ret = sel->data.len;
+ return EINA_TRUE;
+ }
+
+ if (!sel->active) return EINA_TRUE;
+
+ if ((sel->format & EFL_SELECTION_FORMAT_MARKUP) ||
+ (sel->format & EFL_SELECTION_FORMAT_HTML))
+ {
+ char *tmp = malloc(sel->data.len + 1);
+ if (tmp)
+ {
+ strncpy(tmp, sel->data.mem, sel->data.len);
+ tmp[sel->data.len] = 0;
+ *data_ret = _elm_util_mkup_to_text(tmp);
+ if (size_ret && *data_ret) *size_ret = strlen(*data_ret);
+ free(tmp);
+ sel_debug("markup or html: %s", (const char *)*data_ret);
+ }
+ else return EINA_FALSE;
+ }
+ else if (sel->format & EFL_SELECTION_FORMAT_TEXT)
+ {
+ ecore_x_selection_converter_text(target, sel->data.mem,
+ sel->data.len,
+ data_ret, size_ret,
+ ttype, typesize);
+ sel_debug("text");
+ }
+ else if (sel->format & EFL_SELECTION_FORMAT_IMAGE)
+ {
+ efl_file_get(sel->request_obj, (const char **)data_ret, NULL);
+ if (!*data_ret) *data_ret = strdup("No file");
+ else *data_ret = strdup(*data_ret);
+
+ if (!*data_ret)
+ {
+ ERR("Failed to allocate memory!");
+ *size_ret = 0;
+ return EINA_FALSE;
+ }
+
+ *size_ret = strlen(*data_ret);
+ }
+ return EINA_TRUE;
+}
+
+static Eina_Future *
+_x11_efl_sel_manager_selection_set(Efl_Selection_Manager_Data *pd, Efl_Object *owner,
+ Efl_Selection_Type type, Efl_Selection_Format format, Eina_Slice data,
+ Ecore_X_Window xwin, unsigned int seat)
+{
+ Sel_Manager_Seat_Selection *seat_sel;
+ Sel_Manager_Selection *sel;
+ Eina_Bool same_win = EINA_FALSE;
+
+ seat_sel = _x11_sel_manager_seat_selection_init(pd, seat);
+ seat_sel->active_type = type;
+ sel = seat_sel->sel_list + type;
+ //support 1 app with multiple window, 1 selection manager
+ if (seat_sel->xwin == xwin)
+ same_win = EINA_TRUE;
+ _owner_change_check(pd->sel_man, owner, seat_sel, sel, type, same_win);
+
+ sel->owner = owner;
+ free(sel->data.mem);
+ sel->xwin = xwin;
+ sel->data = eina_slice_dup(data);
+ sel->active = EINA_TRUE;
+ sel->format = format;
+
+ sel->set(xwin, &sel, sizeof(&sel));
+ sel_debug("data: %p (%zu)", &sel, sizeof(&sel));
+
+ return _update_sel_lost_list(owner, type, seat_sel);
+}
+
+static void
+_x11_efl_sel_manager_selection_get(const Efl_Object *request, Efl_Selection_Manager_Data *pd,
+ Efl_Selection_Type type, Efl_Selection_Format format,
+ void *data_func_data, Efl_Selection_Data_Ready data_func, Eina_Free_Cb data_func_free_cb,
+ Ecore_X_Window xwin, unsigned int seat)
+{
+ Sel_Manager_Seat_Selection *seat_sel;
+ Sel_Manager_Selection *sel;;
+
+ sel_debug("request: %p, seat: %u, type: %d, format: %d", request, seat, type, format);
+ seat_sel = _sel_manager_seat_selection_init(pd, seat);
+ sel = seat_sel->sel_list + type;
+ sel->request_obj = (Efl_Object *)request;
+ sel->data_func_data = data_func_data;
+ sel->data_func = data_func;
+ sel->data_func_free_cb = data_func_free_cb;
+ sel->request_format = format;
+ sel->xwin = xwin;
+
+ if (sel->active)
+ {
+ if (sel->data.mem &&
+ ((format == sel->format) || (xwin == 0)))
+ {
+ sel_debug("use local data");
+ Efl_Selection_Data seldata;
+
+ seldata.content.mem = sel->data.mem;
+ seldata.content.len = sel->data.len;
+ seldata.pos.x = seldata.pos.y = 0;
+ seldata.format = sel->format;
+ sel->data_func(sel->data_func_data, sel->request_obj, &seldata);
+ return;
+ }
+ }
+
+ sel->request(xwin, ECORE_X_SELECTION_TARGET_TARGETS);
+}
+
+static void
+_x11_win_rotation_changed_cb(void *data, const Efl_Event *event)
+{
+ Evas_Object *win = data;
+ int rot = elm_win_rotation_get(event->object);
+ elm_win_rotation_set(win, rot);
+}
+
+static Eina_Bool
+_x11_drag_mouse_up(void *data, int etype EINA_UNUSED, void *event)
+{
+ Sel_Manager_Seat_Selection *seat_sel = data;
+ Efl_Selection_Manager_Data *pd = seat_sel->pd;
+ Ecore_X_Window xwin = seat_sel->xwin;
+ Ecore_Event_Mouse_Button *ev = event;
+
+ if ((ev->buttons == 1) &&
+ (ev->event_window == xwin))
+ {
+ Eina_Bool have_drop_list = EINA_FALSE;
+ Eina_List *l;
+ Sel_Manager_Dropable *dropable;
+
+ ecore_x_pointer_ungrab();
+ ELM_SAFE_FREE(seat_sel->mouse_up_handler, ecore_event_handler_del);
+ ELM_SAFE_FREE(seat_sel->dnd_status_handler, ecore_event_handler_del);
+ ecore_x_dnd_self_drop();
+
+ sel_debug("mouse up, xwin=%#llx\n", (unsigned long long)xwin);
+
+ EINA_LIST_FOREACH(pd->drop_list, l, dropable)
+ {
+ if (xwin == _x11_xwin_get(dropable->obj))
+ {
+ have_drop_list = EINA_TRUE;
+ break;
+ }
+ }
+ if (!have_drop_list) ecore_x_dnd_aware_set(xwin, EINA_FALSE);
+ efl_event_callback_call(seat_sel->drag_obj, EFL_UI_DND_EVENT_DRAG_DONE, NULL);
+ if (seat_sel->drag_win)
+ {
+ if (seat_sel->drag_obj)
+ {
+ if (elm_widget_is(seat_sel->drag_obj))
+ {
+ Evas_Object *win = elm_widget_top_get(seat_sel->drag_obj);
+ if (win && efl_isa(win, EFL_UI_WIN_CLASS))
+ efl_event_callback_del(win, EFL_UI_WIN_EVENT_ROTATION_CHANGED,
+ _x11_win_rotation_changed_cb, seat_sel->drag_win);
+ }
+ }
+
+ if (!seat_sel->accept)
+ { /* Commit animation when drag cancelled */
+ /* Record final position of dragwin, then do animation */
+ ecore_animator_timeline_add(0.3,
+ _drag_cancel_animate, seat_sel);
+ }
+ else
+ { /* No animation drop was committed */
+ Ecore_X_Window xdragwin = _x11_xwin_get(seat_sel->drag_win);
+ ecore_x_window_ignore_set(xdragwin, 0);
+ evas_object_del(seat_sel->drag_win);
+ seat_sel->drag_win = NULL;
+ sel_debug("deleted drag_win");
+ }
+ }
+
+ seat_sel->drag_obj = NULL;
+ seat_sel->accept = EINA_FALSE;
+ }
+ return EINA_TRUE;
+}
+
+static void
+_x11_drag_move(void *data, Ecore_X_Xdnd_Position *pos)
+{
+ Sel_Manager_Seat_Selection *seat_sel = data;
+ Efl_Dnd_Drag_Pos dp;
+
+ evas_object_move(seat_sel->drag_win,
+ pos->position.x - seat_sel->drag_pos.x,
+ pos->position.y - seat_sel->drag_pos.y);
+ seat_sel->drag_win_end.x = pos->position.x - seat_sel->drag_pos.x;
+ seat_sel->drag_win_end.y = pos->position.y - seat_sel->drag_pos.y;
+ sel_debug("dragevas: %p -> %p\n",
+ seat_sel->drag_obj,
+ evas_object_evas_get(seat_sel->drag_obj));
+ dp.pos.x = pos->position.x;
+ dp.pos.y = pos->position.y;
+ dp.action = seat_sel->drag_action;
+ //for drag side
+ efl_event_callback_call(seat_sel->drag_obj, EFL_UI_DND_EVENT_DRAG_POS, &dp);
+}
+
+static void
+_x11_drag_target_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *info EINA_UNUSED)
+{
+ Sel_Manager_Seat_Selection *seat_sel = data;
+ Sel_Manager_Selection *sel = &seat_sel->sel_list[seat_sel->active_type];
+
+ if (seat_sel->drag_obj == obj)
+ {
+ sel->request_obj = NULL;
+ seat_sel->drag_obj = NULL;
+ }
+}
+
+static Eina_Bool
+_x11_dnd_status(void *data, int etype EINA_UNUSED, void *ev)
+{
+ Sel_Manager_Seat_Selection *seat_sel = data;
+ Ecore_X_Event_Xdnd_Status *status = ev;
+
+ seat_sel->accept = EINA_FALSE;
+
+ /* Only thing we care about: will accept */
+ if ((status) && (status->will_accept))
+ {
+ sel_debug("Will accept\n");
+ seat_sel->accept = EINA_TRUE;
+ }
+ /* Won't accept */
+ else
+ {
+ sel_debug("Won't accept accept\n");
+ }
+ efl_event_callback_call(seat_sel->drag_obj, EFL_UI_DND_EVENT_DRAG_ACCEPT, &seat_sel->accept);
+
+ return EINA_TRUE;
+}
+
+static void
+_x11_efl_sel_manager_drag_start(Eo *obj EINA_UNUSED, Efl_Selection_Manager_Data *pd,
+ Efl_Object *drag_obj, Efl_Selection_Format format,
+ Eina_Slice data, Efl_Selection_Action action,
+ void *icon_func_data, Efl_Dnd_Drag_Icon_Create icon_func,
+ Eina_Free_Cb icon_func_free_cb EINA_UNUSED,
+ Ecore_X_Window xwin, unsigned int seat)
+{
+ Ecore_X_Window xdragwin;
+ Sel_Manager_Seat_Selection *seat_sel;
+ Sel_Manager_Selection *sel;
+ Ecore_Evas *ee;
+ int x, y, x2 = 0, y2 = 0, x3, y3;
+ Evas_Object *icon = NULL;
+ int w = 0, h = 0;
+ int ex, ey, ew, eh;
+ Ecore_X_Atom actx;
+ int i;
+ int xr, yr, rot;
+
+ seat_sel = _x11_sel_manager_seat_selection_init(pd, seat);
+ if (!seat_sel) return;
+ seat_sel->active_type = EFL_SELECTION_TYPE_DND;
+
+ sel = &seat_sel->sel_list[seat_sel->active_type];
+ ecore_x_dnd_types_set(xwin, NULL, 0);
+ for (i = SELECTION_ATOM_LISTING_ATOMS + 1; i < SELECTION_N_ATOMS; i++)
+ {
+ if (format == EFL_SELECTION_FORMAT_TARGETS || (pd->atom_list[i].format & format))
+ {
+ ecore_x_dnd_type_set(xwin, pd->atom_list[i].name, EINA_TRUE);
+ sel_debug("set dnd type: %s\n", pd->atom_list[i].name);
+ }
+ }
+
+ sel->active = EINA_TRUE;
+ sel->request_obj = drag_obj;
+ sel->format = format;
+ if (sel->data.mem) free(sel->data.mem);
+ sel->data = eina_slice_dup(data);
+ sel->action = action;
+ seat_sel->drag_obj = drag_obj;
+ seat_sel->drag_action = action;
+ seat_sel->xwin = xwin;
+
+ evas_object_event_callback_add(drag_obj, EVAS_CALLBACK_DEL,
+ _x11_drag_target_del, seat_sel);
+ /* TODO BUG: should increase dnd-awareness, in case it's drop target as well. See _x11_drag_mouse_up() */
+ ecore_x_dnd_aware_set(xwin, EINA_TRUE);
+ ecore_x_dnd_callback_pos_update_set(_x11_drag_move, seat_sel);
+ ecore_x_dnd_self_begin(xwin, (unsigned char *)&sel, sizeof(Sel_Manager_Selection));
+ actx = _x11_dnd_action_rev_map(seat_sel->drag_action);
+ ecore_x_dnd_source_action_set(actx);
+ ecore_x_pointer_grab(xwin);
+ seat_sel->mouse_up_handler = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP,
+ _x11_drag_mouse_up, seat_sel);
+ seat_sel->dnd_status_handler = ecore_event_handler_add(ECORE_X_EVENT_XDND_STATUS,
+ _x11_dnd_status, seat_sel);
+ seat_sel->drag_win = elm_win_add(NULL, "Elm-Drag", ELM_WIN_DND);
+ elm_win_alpha_set(seat_sel->drag_win, EINA_TRUE);
+ elm_win_override_set(seat_sel->drag_win, EINA_TRUE);
+ xdragwin = _x11_xwin_get(seat_sel->drag_win);
+ ecore_x_window_ignore_set(xdragwin, 1);
+
+ /* dragwin has to be rotated as the main window is */
+ if (elm_widget_is(drag_obj))
+ {
+ Evas_Object *win = elm_widget_top_get(drag_obj);
+ if (win && efl_isa(win, EFL_UI_WIN_CLASS))
+ {
+ elm_win_rotation_set(seat_sel->drag_win, elm_win_rotation_get(win));
+ efl_event_callback_add(win, EFL_UI_WIN_EVENT_ROTATION_CHANGED,
+ _x11_win_rotation_changed_cb, seat_sel->drag_win);
+ }
+ }
+
+ if (icon_func)
+ {
+ Eina_Position2D off;
+
+ icon = icon_func(icon_func_data, seat_sel->drag_win, drag_obj, &off);
+ if (icon)
+ {
+ x2 = off.x;
+ y2 = off.y;
+ evas_object_geometry_get(icon, NULL, NULL, &w, &h);
+ }
+ }
+ else
+ {
+ icon = elm_icon_add(seat_sel->drag_win);
+ evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ // need to resize
+ }
+ elm_win_resize_object_add(seat_sel->drag_win, icon);
+
+ /* Position subwindow appropriately */
+ ee = ecore_evas_ecore_evas_get(evas_object_evas_get(drag_obj));
+ ecore_evas_geometry_get(ee, &ex, &ey, &ew, &eh);
+ evas_object_resize(seat_sel->drag_win, w, h);
+
+ evas_object_show(icon);
+ evas_object_show(seat_sel->drag_win);
+ evas_pointer_canvas_xy_get(evas_object_evas_get(drag_obj), &x3, &y3);
+
+ rot = ecore_evas_rotation_get(ee);
+ switch (rot)
+ {
+ case 90:
+ xr = y3;
+ yr = ew - x3;
+ seat_sel->drag_pos.x = y3 - y2;
+ seat_sel->drag_pos.y = x3 - x2;
+ break;
+ case 180:
+ xr = ew - x3;
+ yr = eh - y3;
+ seat_sel->drag_pos.x = x3 - x2;
+ seat_sel->drag_pos.y = y3 - y2;
+ break;
+ case 270:
+ xr = eh - y3;
+ yr = x3;
+ seat_sel->drag_pos.x = y3 - y2;
+ seat_sel->drag_pos.y = x3 - x2;
+ break;
+ default:
+ xr = x3;
+ yr = y3;
+ seat_sel->drag_pos.x = x3 - x2;
+ seat_sel->drag_pos.y = y3 - y2;
+ break;
+ }
+ x = ex + xr - seat_sel->drag_pos.x;
+ y = ey + yr - seat_sel->drag_pos.y;
+ evas_object_move(seat_sel->drag_win, x, y);
+ seat_sel->drag_win_start = EINA_POSITION2D(x, y);
+ seat_sel->drag_win_end = EINA_POSITION2D(x, y);
+}
+
+static void
+_x11_dnd_dropable_handle(Efl_Selection_Manager_Data *pd, Sel_Manager_Dropable *dropable, Eina_Position2D pos, Efl_Selection_Action action)
+{
+ Sel_Manager_Dropable *d, *last_dropable = NULL;
+ Eina_List *l;
+ Eina_Inlist *itr;
+
+ EINA_LIST_FOREACH(pd->drop_list, l, d)
+ {
+ if (d->last.in)
+ {
+ last_dropable = d;
+ break;
+ }
+ }
+ if (last_dropable)
+ {
+ if (last_dropable == dropable) // same
+ {
+ Evas_Coord ox, oy;
+ Drop_Format *df;
+
+ sel_debug("same obj dropable %p\n", dropable->obj);
+ evas_object_geometry_get(dropable->obj, &ox, &oy, NULL, NULL);
+ Efl_Dnd_Drag_Pos pos_data;
+ if (!dropable->is_container)
+ {
+ pos_data.pos = EINA_POSITION2D(pos.x - ox, pos.y - oy);
+ pos_data.item = NULL;
+ }
+ else
+ {
+ Eina_Position2D posret = {0, 0};
+ Efl_Object *it = NULL;
+
+ if (dropable->item_func)
+ it = dropable->item_func(dropable->item_func_data, dropable->obj,
+ pos, &posret);
+ pos_data.pos = posret;
+ pos_data.item = it;
+ }
+ pos_data.format = dropable->last.format;
+ pos_data.action = action;
+ EINA_INLIST_FOREACH_SAFE(dropable->format_list, itr, df)
+ {
+ if (df->format & dropable->last.format)
+ efl_event_callback_call(dropable->obj, EFL_UI_DND_EVENT_DRAG_POS, &pos_data);
+ }
+ }
+ else
+ {
+ if (dropable) // leave last obj and enter new one
+ {
+ sel_debug("leave %p\n", last_dropable->obj);
+ sel_debug("enter %p\n", dropable->obj);
+ last_dropable->last.in = EINA_FALSE;
+ last_dropable->last.type = NULL;
+ dropable->last.in = EINA_TRUE;
+
+ Drop_Format *df;
+ EINA_INLIST_FOREACH_SAFE(dropable->format_list, itr, df)
+ {
+ if (df->format &dropable->last.format)
+ efl_event_callback_call(dropable->obj, EFL_UI_DND_EVENT_DRAG_ENTER, NULL);
+ }
+ EINA_INLIST_FOREACH_SAFE(last_dropable->format_list, itr, df)
+ {
+ if (df->format & last_dropable->last.format)
+ efl_event_callback_call(last_dropable->obj, EFL_UI_DND_EVENT_DRAG_LEAVE, NULL);
+ }
+ }
+ else // leave last obj
+ {
+ sel_debug("leave %p\n", last_dropable->obj);
+ last_dropable->last.in = EINA_FALSE;
+ last_dropable->last.type = NULL;
+
+ Drop_Format *df;
+ EINA_INLIST_FOREACH_SAFE(last_dropable->format_list, itr, df)
+ {
+ if (df->format & last_dropable->last.format)
+ efl_event_callback_call(last_dropable->obj, EFL_UI_DND_EVENT_DRAG_LEAVE, NULL);
+ }
+ }
+ }
+ }
+ else
+ {
+ if (dropable) // enter new obj
+ {
+ Evas_Coord ox, oy;
+
+ sel_debug("enter %p\n", dropable->obj);
+ evas_object_geometry_get(dropable->obj, &ox, &oy, NULL, NULL);
+ dropable->last.in = EINA_TRUE;
+
+ Drop_Format *df;
+ Efl_Dnd_Drag_Pos pos_data;
+ if (!dropable->is_container)
+ {
+ pos_data.pos = EINA_POSITION2D(pos.x - ox, pos.y - oy);
+ pos_data.item = NULL;
+ }
+ else
+ {
+ Eina_Position2D posret = {0, 0};
+ Efl_Object *it = NULL;
+ if (dropable->item_func)
+ it = dropable->item_func(dropable->item_func_data, dropable->obj,
+ pos, &posret);
+ pos_data.pos = posret;
+ pos_data.item = it;
+ }
+ pos_data.format = dropable->last.format;
+ pos_data.action = action;
+ EINA_INLIST_FOREACH_SAFE(dropable->format_list, itr, df)
+ {
+ if (df->format & dropable->last.format)
+ {
+ efl_event_callback_call(dropable->obj, EFL_UI_DND_EVENT_DRAG_ENTER, NULL);
+ efl_event_callback_call(dropable->obj, EFL_UI_DND_EVENT_DRAG_POS, &pos_data);
+ }
+ }
+ }
+ else
+ {
+ sel_debug("both dropable & last_dropable are null\n");
+ }
+ }
+}
+
+static Sel_Manager_Dropable *
+_x11_dropable_find(Efl_Selection_Manager_Data *pd, Ecore_X_Window win)
+{
+ Eina_List *l;
+ Sel_Manager_Dropable *dropable;
+
+ if (!pd->drop_list) return NULL;
+ EINA_LIST_FOREACH(pd->drop_list, l, dropable)
+ {
+ if (_x11_xwin_get(dropable->obj) == win) return dropable;
+ }
+ return NULL;
+}
+
+static Evas *
+_x11_evas_get_from_xwin(Efl_Selection_Manager_Data *pd, Ecore_X_Window win)
+{
+ /* Find the Evas connected to the window */
+ Sel_Manager_Dropable *dropable = _x11_dropable_find(pd, win);
+ return dropable ? evas_object_evas_get(dropable->obj) : NULL;
+}
+
+static Efl_Selection_Action
+_x11_dnd_action_map(Ecore_X_Atom action)
+{
+ Efl_Selection_Action act = EFL_SELECTION_ACTION_UNKNOWN;
+
+ if (action == ECORE_X_ATOM_XDND_ACTION_COPY)
+ act = EFL_SELECTION_ACTION_COPY;
+ else if (action == ECORE_X_ATOM_XDND_ACTION_MOVE)
+ act = EFL_SELECTION_ACTION_MOVE;
+ else if (action == ECORE_X_ATOM_XDND_ACTION_PRIVATE)
+ act = EFL_SELECTION_ACTION_PRIVATE;
+ else if (action == ECORE_X_ATOM_XDND_ACTION_ASK)
+ act = EFL_SELECTION_ACTION_ASK;
+ else if (action == ECORE_X_ATOM_XDND_ACTION_LIST)
+ act = EFL_SELECTION_ACTION_LIST;
+ else if (action == ECORE_X_ATOM_XDND_ACTION_LINK)
+ act = EFL_SELECTION_ACTION_LINK;
+ else if (action == ECORE_X_ATOM_XDND_ACTION_DESCRIPTION)
+ act = EFL_SELECTION_ACTION_DESCRIPTION;
+ return act;
+}
+
+static Ecore_X_Atom
+_x11_dnd_action_rev_map(Efl_Selection_Action action)
+{
+ Ecore_X_Atom act = ECORE_X_ATOM_XDND_ACTION_MOVE;
+
+ if (action == EFL_SELECTION_ACTION_COPY)
+ act = ECORE_X_ATOM_XDND_ACTION_COPY;
+ else if (action == EFL_SELECTION_ACTION_MOVE)
+ act = ECORE_X_ATOM_XDND_ACTION_MOVE;
+ else if (action == EFL_SELECTION_ACTION_PRIVATE)
+ act = ECORE_X_ATOM_XDND_ACTION_PRIVATE;
+ else if (action == EFL_SELECTION_ACTION_ASK)
+ act = ECORE_X_ATOM_XDND_ACTION_ASK;
+ else if (action == EFL_SELECTION_ACTION_LIST)
+ act = ECORE_X_ATOM_XDND_ACTION_LIST;
+ else if (action == EFL_SELECTION_ACTION_LINK)
+ act = ECORE_X_ATOM_XDND_ACTION_LINK;
+ else if (action == EFL_SELECTION_ACTION_DESCRIPTION)
+ act = ECORE_X_ATOM_XDND_ACTION_DESCRIPTION;
+ return act;
+}
+
+static Eina_Bool
+_x11_dnd_enter(void *data, int etype EINA_UNUSED, void *ev)
+{
+ Sel_Manager_Seat_Selection *seat_sel = data;
+ Efl_Selection_Manager_Data *pd = seat_sel->pd;
+ Ecore_X_Event_Xdnd_Enter *enter = ev;
+ Sel_Manager_Dropable *dropable;
+ int i;
+
+ sel_debug("In");
+ if (!enter) return EINA_TRUE;
+ dropable = _x11_dropable_find(pd, enter->win);
+ if (dropable)
+ {
+ sel_debug("Enter %x\n", enter->win);
+ }
+ /* Skip it */
+ sel_debug("enter types=%p (%d)\n", enter->types, enter->num_types);
+ if ((!enter->num_types) || (!enter->types)) return EINA_TRUE;
+
+ sel_debug("Types\n");
+ seat_sel->saved_types->ntypes = enter->num_types;
+ free(seat_sel->saved_types->types);
+ seat_sel->saved_types->types = malloc(sizeof(char *) * enter->num_types);
+ if (!seat_sel->saved_types->types) return EINA_FALSE;
+
+ for (i = 0; i < enter->num_types; i++)
+ {
+ seat_sel->saved_types->types[i] = eina_stringshare_add(enter->types[i]);
+ sel_debug("Type is %s %p %p\n", enter->types[i],
+ seat_sel->saved_types->types[i], pd->text_uri);
+ if (seat_sel->saved_types->types[i] == pd->text_uri)
+ {
+ /* Request it, so we know what it is */
+ sel_debug("Sending uri request\n");
+ seat_sel->saved_types->textreq = 1;
+ ELM_SAFE_FREE(seat_sel->saved_types->imgfile, free);
+ ecore_x_selection_xdnd_request(enter->win, pd->text_uri);
+ }
+ }
+
+ /* FIXME: Find an object and make it current */
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_x11_dnd_position(void *data, int etype EINA_UNUSED, void *ev)
+{
+ Sel_Manager_Seat_Selection *seat_sel = data;
+ Efl_Selection_Manager_Data *pd = seat_sel->pd;
+ Ecore_X_Event_Xdnd_Position *xpos = ev;
+ Ecore_X_Rectangle rect = { 0, 0, 0, 0 };
+ Sel_Manager_Dropable *dropable;
+ Efl_Selection_Action act;
+
+ sel_debug("In");
+ /* Need to send a status back */
+ /* FIXME: Should check I can drop here */
+ /* FIXME: Should highlight widget */
+ dropable = _x11_dropable_find(pd, xpos->win);
+ if (dropable)
+ {
+ Evas_Coord ox = 0, oy = 0;
+ Eina_Position2D pos;
+
+ act = _x11_dnd_action_map(xpos->action);
+ pos.x = xpos->position.x;
+ pos.y = xpos->position.y;
+ _dropable_coords_adjust(dropable, &pos);
+ Evas *evas = _x11_evas_get_from_xwin(pd, xpos->win);
+ Eina_List *dropable_list = evas ? _dropable_list_geom_find(pd, evas, pos.x, pos.y) : NULL;
+ /* check if there is dropable (obj) can accept this drop */
+ if (dropable_list)
+ {
+ Efl_Selection_Format saved_format = _dnd_types_to_format(pd, seat_sel->saved_types->types, seat_sel->saved_types->ntypes);
+ Eina_List *l;
+ Eina_Bool found = EINA_FALSE;
+
+ EINA_LIST_FOREACH(dropable_list, l, dropable)
+ {
+ Drop_Format *df;
+ Eina_Inlist *itr;
+ EINA_INLIST_FOREACH_SAFE(dropable->format_list, itr, df)
+ {
+ Efl_Selection_Format common_fmt = saved_format & df->format;
+ if (common_fmt)
+ {
+ //We found a target that can accept this type of data
+ int i, min_index = SELECTION_N_ATOMS;
+ //We have to find the first atom that corresponds to one
+ //of the supported data types.
+ for (i = 0; i < seat_sel->saved_types->ntypes; i++)
+ {
+ Sel_Manager_Atom *atom = eina_hash_find(pd->type_hash, seat_sel->saved_types->types[i]);
+ if (atom && (atom->format & common_fmt))
+ {
+ int atom_idx = (atom - pd->atom_list);
+ if (min_index > atom_idx) min_index = atom_idx;
+ }
+ }
+ if (min_index != SELECTION_N_ATOMS)
+ {
+ sel_debug("Found atom %s\n", pd->atom_list[min_index].name);
+ found = EINA_TRUE;
+ dropable->last.type = pd->atom_list[min_index].name;
+ dropable->last.format = common_fmt;
+ break;
+ }
+ }
+ }
+ if (found) break;
+ }
+ if (found)
+ {
+ Sel_Manager_Dropable *d = NULL;
+ Eina_Rectangle inter_rect = {0, 0, 0, 0};
+ int idx = 0;
+ EINA_LIST_FOREACH(dropable_list, l, d)
+ {
+ if (idx == 0)
+ {
+ evas_object_geometry_get(d->obj, &inter_rect.x, &inter_rect.y,
+ &inter_rect.w, &inter_rect.h);
+ }
+ else
+ {
+ Eina_Rectangle cur_rect;
+ evas_object_geometry_get(d->obj, &cur_rect.x, &cur_rect.y,
+ &cur_rect.w, &cur_rect.h);
+ if (!eina_rectangle_intersection(&inter_rect, &cur_rect)) continue;
+ }
+ idx++;
+ }
+ rect.x = inter_rect.x;
+ rect.y = inter_rect.y;
+ rect.width = inter_rect.w;
+ rect.height = inter_rect.h;
+ ecore_x_dnd_send_status(EINA_TRUE, EINA_FALSE, rect, xpos->action);
+ sel_debug("dnd position %i %i %p\n", pos.x - ox, pos.y - oy, dropable);
+ pos.x = pos.x - ox;
+ pos.y = pos.y - oy;
+ _x11_dnd_dropable_handle(pd, dropable, pos, act);
+ // CCCCCCC: call dnd exit on last obj if obj != last
+ // CCCCCCC: call drop position on obj
+ }
+ else
+ {
+ //if not: send false status
+ ecore_x_dnd_send_status(EINA_FALSE, EINA_FALSE, rect, xpos->action);
+ sel_debug("dnd position (%d, %d) not in obj\n", pos.x, pos.y);
+ _x11_dnd_dropable_handle(pd, NULL, EINA_POSITION2D(0, 0), act);
+ // CCCCCCC: call dnd exit on last obj
+ }
+ eina_list_free(dropable_list);
+ }
+ else
+ {
+ ecore_x_dnd_send_status(EINA_FALSE, EINA_FALSE, rect, xpos->action);
+ sel_debug("dnd position (%d, %d) has no drop\n", pos.x, pos.y);
+ _x11_dnd_dropable_handle(pd, NULL, EINA_POSITION2D(0, 0), act);
+ }
+ }
+ else
+ {
+ ecore_x_dnd_send_status(EINA_FALSE, EINA_FALSE, rect, xpos->action);
+ }
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_x11_dnd_leave(void *data, int etype EINA_UNUSED, void *ev)
+{
+ Sel_Manager_Seat_Selection *seat_sel = data;
+ Eina_Position2D pos = {0, 0};
+#ifdef DEBUGON
+ sel_debug("Leave %x\n", ((Ecore_X_Event_Xdnd_Leave *)ev)->win);
+#else
+ (void)ev;
+#endif
+ _x11_dnd_dropable_handle(seat_sel->pd, NULL, pos, EFL_SELECTION_ACTION_UNKNOWN);
+ // CCCCCCC: call dnd exit on last obj if there was one
+ // leave->win leave->source
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_x11_dnd_drop(void *data, int etype EINA_UNUSED, void *ev)
+{
+ sel_debug("In");
+ Sel_Manager_Seat_Selection *seat_sel = data;
+ Efl_Selection_Manager_Data *pd = seat_sel->pd;
+ Ecore_X_Event_Xdnd_Drop *drop;
+ Sel_Manager_Dropable *dropable = NULL;
+ Efl_Selection_Data ddata;
+ Evas_Coord x = 0, y = 0;
+ Efl_Selection_Action act = EFL_SELECTION_ACTION_UNKNOWN;
+ Eina_List *l;
+ Eina_Inlist *itr;
+ Sel_Manager_Selection *sel;
+
+ drop = ev;
+ sel_debug("drop_list %p (%d)\n", pd->drop_list, eina_list_count(pd->drop_list));
+ if (!(dropable = _x11_dropable_find(pd, drop->win))) return EINA_TRUE;
+
+ /* Calculate real (widget relative) position */
+ // - window position
+ // - widget position
+ seat_sel->saved_types->pos = EINA_POSITION2D(drop->position.x, drop->position.y);
+ _dropable_coords_adjust(dropable, &seat_sel->saved_types->pos);
+
+ sel_debug("Drop position is %d,%d\n", seat_sel->saved_types->pos.x, seat_sel->saved_types->pos.y);
+
+ EINA_LIST_FOREACH(pd->drop_list, l, dropable)
+ {
+ if (dropable->last.in)
+ {
+ evas_object_geometry_get(dropable->obj, &x, &y, NULL, NULL);
+ seat_sel->saved_types->pos.x -= x;
+ seat_sel->saved_types->pos.y -= y;
+ goto found;
+ }
+ }
+
+ sel_debug("Didn't find a target\n");
+ return EINA_TRUE;
+
+found:
+ sel_debug("0x%x\n", drop->win);
+
+ act = _x11_dnd_action_map(drop->action);
+
+ dropable->last.in = EINA_FALSE;
+ sel_debug("Last type: %s - Last format: %X\n", dropable->last.type, dropable->last.format);
+ if ((!strcmp(dropable->last.type, pd->text_uri)))
+ {
+ sel_debug("We found a URI... (%scached) %s\n",
+ seat_sel->saved_types->imgfile ? "" : "not ",
+ seat_sel->saved_types->imgfile);
+ if (seat_sel->saved_types->imgfile)
+ {
+ Drop_Format *df;
+
+ if (!dropable->is_container)
+ {
+ ddata.pos = seat_sel->saved_types->pos;
+ ddata.item = NULL;
+ }
+ else
+ {
+ //for container
+ Efl_Object *it = NULL;
+ Evas_Coord x0 = 0, y0 = 0;
+ Eina_Position2D pos, posret = {0, 0};
+
+ evas_object_geometry_get(dropable->obj, &x0, &y0, NULL, NULL);
+ pos = EINA_POSITION2D(seat_sel->saved_types->pos.x + x0,
+ seat_sel->saved_types->pos.y + y0);
+ if (dropable->item_func)
+ it = dropable->item_func(dropable->item_func_data, dropable->obj,
+ pos, &posret);
+ ddata.pos = posret;
+ ddata.item = it;
+ }
+ ddata.action = act;
+
+ EINA_INLIST_FOREACH_SAFE(dropable->format_list, itr, df)
+ {
+ if (df->format & EFL_SELECTION_FORMAT_IMAGE)
+ {
+ sel_debug("Doing image insert (%s)\n", seat_sel->saved_types->imgfile);
+ ddata.format = EFL_SELECTION_FORMAT_IMAGE;
+ ddata.content.mem = (char *)seat_sel->saved_types->imgfile;
+ ddata.content.len = strlen(ddata.content.mem);
+ if (df->format & dropable->last.format)
+ efl_event_callback_call(dropable->obj, EFL_UI_DND_EVENT_DRAG_DROP, &ddata);
+ }
+ else
+ {
+ sel_debug("Item doesn't support images... passing\n");
+ }
+ }
+ ecore_x_dnd_send_finished();
+ ELM_SAFE_FREE(seat_sel->saved_types->imgfile, free);
+ return EINA_TRUE;
+ }
+ else if (seat_sel->saved_types->textreq)
+ {
+ /* Already asked: Pretend we asked now, and paste immediately when
+ * it comes in */
+ seat_sel->saved_types->textreq = 0;
+ ecore_x_dnd_send_finished();
+ return EINA_TRUE;
+ }
+ }
+
+ sel = seat_sel->sel_list + EFL_SELECTION_TYPE_DND;
+ sel_debug("doing a request then: %s\n", dropable->last.type);
+ sel->xwin = drop->win;
+ sel->request_obj = dropable->obj;
+ sel->request_format = dropable->last.format;
+ sel->active = EINA_TRUE;
+ sel->action = act;
+ ecore_x_selection_xdnd_request(drop->win, dropable->last.type);
+
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_x11_sel_manager_drop_target_add(Efl_Selection_Manager_Data *pd, Efl_Object *target_obj,
+ Efl_Selection_Format format, Ecore_X_Window xwin,
+ unsigned int seat)
+{
+ Sel_Manager_Dropable *dropable = NULL;
+ Eina_List *l;
+ Eina_Bool have_drop_list = EINA_FALSE;
+ Sel_Manager_Seat_Selection *seat_sel = NULL;
+
+ /* Is this the first? */
+ EINA_LIST_FOREACH(pd->drop_list, l, dropable)
+ {
+ if (xwin == _x11_xwin_get(dropable->obj))
+ {
+ have_drop_list = EINA_TRUE;
+ break;
+ }
+ }
+ dropable = NULL; // In case of error, we don't want to free it
+
+
+ Drop_Format *df = calloc(1, sizeof(Drop_Format));
+ if (!df) return EINA_FALSE;
+ df->format = format;
+
+ dropable = efl_key_data_get(target_obj, "__elm_dropable");
+ if (!dropable)
+ {
+ /* Create new drop */
+ dropable = calloc(1, sizeof(Sel_Manager_Dropable));
+ if (!dropable) goto error;
+ dropable->last.in = EINA_FALSE;
+ pd->drop_list = eina_list_append(pd->drop_list, dropable);
+ if (!pd->drop_list) goto error;
+ dropable->obj = target_obj;
+ efl_key_data_set(target_obj, "__elm_dropable", dropable);
+ }
+ dropable->format_list = eina_inlist_append(dropable->format_list, EINA_INLIST_GET(df));
+ dropable->seat = seat;
+
+ evas_object_event_callback_add(target_obj, EVAS_CALLBACK_DEL,
+ _all_drop_targets_cbs_del, pd);
+ if (!have_drop_list) ecore_x_dnd_aware_set(xwin, EINA_TRUE);
+
+ seat_sel = _x11_sel_manager_seat_selection_init(pd, seat);
+
+ if (seat_sel->enter_handler) return EINA_TRUE;
+ sel_debug("Adding drop target calls xwin=%#llx", (unsigned long long)xwin);
+ seat_sel->enter_handler = ecore_event_handler_add(ECORE_X_EVENT_XDND_ENTER,
+ _x11_dnd_enter, seat_sel);
+ seat_sel->leave_handler = ecore_event_handler_add(ECORE_X_EVENT_XDND_LEAVE,
+ _x11_dnd_leave, seat_sel);
+ seat_sel->pos_handler = ecore_event_handler_add(ECORE_X_EVENT_XDND_POSITION,
+ _x11_dnd_position, seat_sel);
+ seat_sel->drop_handler = ecore_event_handler_add(ECORE_X_EVENT_XDND_DROP,
+ _x11_dnd_drop, seat_sel);
+ return EINA_TRUE;
+error:
+ free(df);
+ free(dropable);
+ return EINA_FALSE;
+}
+
+#endif
+
+//Wayland
+#ifdef HAVE_ELEMENTARY_WL2
+static Sel_Manager_Seat_Selection *
+_wl_sel_manager_seat_selection_init(Efl_Selection_Manager_Data *pd, unsigned int seat)
+{
+ Sel_Manager_Seat_Selection *seat_sel = NULL;
+ Eina_List *l = NULL;
+
+ EINA_LIST_FOREACH(pd->seat_list, l, seat_sel)
+ {
+ if(seat_sel->seat == seat)
+ break;
+ }
+ if (!seat_sel)
+ {
+ seat_sel = calloc(1, sizeof(Sel_Manager_Seat_Selection));
+ if (!seat_sel)
+ {
+ ERR("Failed to allocate seat");
+ return NULL;
+ }
+ seat_sel->saved_types = calloc(1, sizeof(Saved_Type));
+ seat_sel->seat = seat;
+ seat_sel->pd = pd;
+ pd->seat_list = eina_list_append(pd->seat_list, seat_sel);
+ }
+ if (!seat_sel->sel)
+ {
+ Sel_Manager_Selection *sel = calloc(1, sizeof(Sel_Manager_Selection));
+ if (!sel)
+ {
+ ERR("failed to allocate selection");
+ return NULL;
+ }
+ sel->seat_sel = seat_sel;
+ seat_sel->sel = sel;
+ }
+
+ return seat_sel;
+}
+
+static void
+_wl_drag_source_del(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj, void *event EINA_UNUSED)
+{
+ Sel_Manager_Seat_Selection *seat_sel = data;
+ if (seat_sel->drag_obj == obj)
+ seat_sel->drag_obj = NULL;
+}
+
+static void
+_wl_efl_sel_manager_drag_start(Eo *obj EINA_UNUSED, Efl_Selection_Manager_Data *pd, Efl_Object *drag_obj,
+ Efl_Selection_Format format, Eina_Slice data,
+ Efl_Selection_Action action, void *icon_func_data,
+ Efl_Dnd_Drag_Icon_Create icon_func, Eina_Free_Cb icon_func_free_cb EINA_UNUSED,
+ Ecore_Wl2_Window *win, unsigned int seat)
+{
+ Ecore_Evas *ee;
+ Evas_Object *icon = NULL;
+ int x, y, x2 = 0, y2 = 0, x3, y3, w = 0, h = 0;
+ const char *types[SELECTION_N_ATOMS + 1];
+ int i, nb_types = 0;
+ Ecore_Wl2_Window *parent = NULL;
+ Sel_Manager_Seat_Selection *seat_sel;
+ Sel_Manager_Selection *sel;
+
+ sel_debug("In");
+ seat_sel = _wl_sel_manager_seat_selection_init(pd, seat);
+ if (!seat_sel) return;
+ seat_sel->active_type = EFL_SELECTION_TYPE_DND;
+ sel = seat_sel->sel;
+
+ sel_debug("checking drag_win: %p", seat_sel->drag_win);
+ /* if we already have a drag, get out */
+ if (seat_sel->drag_win) return;
+
+ for (i = SELECTION_ATOM_LISTING_ATOMS + 1; i < SELECTION_N_ATOMS; i++)
+ {
+ if (format == EFL_SELECTION_FORMAT_TARGETS || (pd->atom_list[i].format & format))
+ {
+ types[nb_types++] = pd->atom_list[i].name;
+ sel_debug("set dnd type: %s\n", pd->atom_list[i].name);
+ }
+ }
+ types[nb_types] = NULL;
+
+ ecore_wl2_dnd_drag_types_set(_wl_seat_get(win, drag_obj, seat), types);
+
+ /* set the drag data used when a drop occurs */
+ free(sel->data.mem);
+ sel->data.len = 0;
+ sel->data = eina_slice_dup(data);
+
+ /* setup callback to notify if this object gets deleted */
+ evas_object_event_callback_add(drag_obj, EVAS_CALLBACK_DEL,
+ _wl_drag_source_del, sel);
+
+ seat_sel->drag_obj = drag_obj;
+ seat_sel->drag_action = action;
+
+ seat_sel->drag_win = elm_win_add(NULL, "Elm-Drag", ELM_WIN_DND);
+ elm_win_alpha_set(seat_sel->drag_win, EINA_TRUE);
+ elm_win_borderless_set(seat_sel->drag_win, EINA_TRUE);
+ elm_win_override_set(seat_sel->drag_win, EINA_TRUE);
+
+ win = elm_win_wl_window_get(seat_sel->drag_win);
+
+ if (icon_func)
+ {
+ Eina_Position2D off;
+
+ icon = icon_func(icon_func_data, seat_sel->drag_win, drag_obj, &off);
+ if (icon)
+ {
+ x2 = off.x;
+ y2 = off.y;
+ evas_object_geometry_get(icon, NULL, NULL, &w, &h);
+ }
+ }
+ else
+ {
+ icon = elm_icon_add(seat_sel->drag_win);
+ evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ }
+
+ elm_win_resize_object_add(seat_sel->drag_win, icon);
+ evas_object_show(icon);
+
+ /* Position subwindow appropriately */
+ ee = ecore_evas_ecore_evas_get(evas_object_evas_get(drag_obj));
+ ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
+ x += x2;
+ y += y2;
+ seat_sel->drag_win_start.x = seat_sel->drag_win_end.x = x;
+ seat_sel->drag_win_start.y = seat_sel->drag_win_end.y = y;
+
+ evas_object_move(seat_sel->drag_win, x, y);
+ evas_object_resize(seat_sel->drag_win, w, h);
+ evas_object_show(seat_sel->drag_win);
+
+ evas_pointer_canvas_xy_get(evas_object_evas_get(drag_obj), &x3, &y3);
+ seat_sel->drag_pos.x = x3 - x2;
+ seat_sel->drag_pos.y = y3 - y2;
+
+ if (elm_widget_is(drag_obj))
+ {
+ Evas_Object *top;
+
+ top = elm_widget_top_get(drag_obj);
+ if (!top) top = elm_widget_top_get(elm_widget_parent_widget_get(drag_obj));
+ if (top && (efl_isa(top, EFL_UI_WIN_CLASS)))
+ parent = elm_win_wl_window_get(top);
+ }
+ if (!parent)
+ {
+ Evas *evas;
+
+ if (!(evas = evas_object_evas_get(drag_obj)))
+ return;
+ if (!(ee = ecore_evas_ecore_evas_get(evas)))
+ return;
+
+ parent = ecore_evas_wayland2_window_get(ee);
+ }
+
+ sel->drag_serial = ecore_wl2_dnd_drag_start(_wl_seat_get(win, drag_obj, seat), parent, win);
+}
+
+static Eina_Bool
+_wl_is_uri_type_data(const char *data, int len)
+{
+ char *p;
+ if (len < 6) return EINA_FALSE;
+
+ p = (char *)data;
+ if (!p) return EINA_FALSE;
+ if (strncmp(p, "file:/", 6))
+ {
+ if (*p != '/') return EINA_FALSE;
+ }
+ return EINA_TRUE;
+}
+
+static Efl_Selection_Action
+_wl_to_elm(Ecore_Wl2_Drag_Action action)
+{
+ #define CONV(wl, elm) if (action == wl) return elm;
+ CONV(ECORE_WL2_DRAG_ACTION_COPY, EFL_SELECTION_ACTION_COPY);
+ CONV(ECORE_WL2_DRAG_ACTION_MOVE, EFL_SELECTION_ACTION_MOVE);
+ CONV(ECORE_WL2_DRAG_ACTION_ASK, EFL_SELECTION_ACTION_ASK);
+ #undef CONV
+ return EFL_SELECTION_ACTION_UNKNOWN;
+}
+
+static Eina_Bool
+_wl_targets_converter(char *target, Sel_Manager_Selection *sel, void *data EINA_UNUSED, int size EINA_UNUSED, void **data_ret, int *size_ret)
+{
+ sel_debug("in\n");
+ if (!data_ret) return EINA_FALSE;
+
+ const char *sep = "\n";
+ char *aret;
+ int len = 0;
+ int i = 0;
+ Sel_Manager_Seat_Selection *seat_sel = sel->seat_sel;
+ Efl_Selection_Manager_Data *pd = seat_sel->pd;
+ Efl_Selection_Format format = EFL_SELECTION_FORMAT_NONE;
+ Eina_Bool is_uri = EINA_FALSE;
+
+ if (sel->format)
+ {
+ format = sel->format;
+ is_uri = _wl_is_uri_type_data(sel->data.mem, sel->data.len);
+ }
+ else
+ {
+ Sel_Manager_Atom *atom = eina_hash_find(pd->type_hash, target);
+ if (atom)
+ format = atom->format;
+ }
+ for (i = 0; i < SELECTION_N_ATOMS; i++)
+ {
+ if (format & pd->atom_list[i].format)
+ {
+ if ((is_uri) ||
+ ((!is_uri) && strcmp(pd->atom_list[i].name, "text/uri-list")))
+ len += strlen(pd->atom_list[i].name) + strlen(sep);
+ }
+ }
+ len++; //terminating null byte
+ aret = calloc(1, len * sizeof(char));
+ if (!aret) return EINA_FALSE;
+ for (i = 0; i < SELECTION_N_ATOMS; i++)
+ {
+ if (format & pd->atom_list[i].format)
+ {
+ if ((is_uri) ||
+ ((!is_uri) && strcmp(pd->atom_list[i].name, "text/uri-list")))
+ {
+ aret = strcat(aret, pd->atom_list[i].name);
+ aret = strcat(aret, sep);
+ }
+ }
+ }
+ *data_ret = aret;
+ if (size_ret) *size_ret = len;
+
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_wl_general_converter(char *target, Sel_Manager_Selection *sel, void *data, int size, void **data_ret, int *size_ret)
+{
+ Efl_Selection_Format format = EFL_SELECTION_FORMAT_NONE;
+ Sel_Manager_Atom *atom = NULL;
+ Sel_Manager_Seat_Selection *seat_sel = sel->seat_sel;
+ Efl_Selection_Manager_Data *pd = seat_sel->pd;
+
+ sel_debug("in\n");
+
+ atom = eina_hash_find(pd->type_hash, target);
+ if (atom)
+ format = atom->format;
+ if (format == EFL_SELECTION_FORMAT_NONE)
+ {
+ if (data_ret)
+ {
+ *data_ret = malloc(size * sizeof(char) + 1);
+ if (!*data_ret) return EINA_FALSE;
+ memcpy(*data_ret, data, size);
+ ((char**)(data_ret))[0][size] = 0;
+ }
+ if (size_ret) *size_ret = size;
+ }
+ else
+ {
+ if ((data) && (size > 0))
+ {
+ char *tmp = malloc(size);
+ if (tmp)
+ {
+ memcpy(tmp, data, size);
+ if (data_ret) *data_ret = tmp;
+ if (size_ret) *size_ret = size;
+ }
+ }
+ else
+ {
+ if (data_ret) *data_ret = NULL;
+ if (size_ret) *size_ret = 0;
+ }
+ }
+
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_wl_text_converter(char *target, Sel_Manager_Selection *sel, void *data, int size, void **data_ret, int *size_ret)
+{
+ Efl_Selection_Format format = EFL_SELECTION_FORMAT_NONE;
+ Sel_Manager_Atom *atom = NULL;
+ Sel_Manager_Seat_Selection *seat_sel = sel->seat_sel;
+ Efl_Selection_Manager_Data *pd = seat_sel->pd;
+
+ sel_debug("in\n");
+
+ atom = eina_hash_find(pd->type_hash, target);
+ if (atom)
+ format = atom->format;
+ if (format == EFL_SELECTION_FORMAT_NONE)
+ {
+ if (data_ret)
+ {
+ *data_ret = malloc(size * sizeof(char) + 1);
+ if (!*data_ret) return EINA_FALSE;
+ memcpy(*data_ret, data, size);
+ ((char**)(data_ret))[0][size] = 0;
+ if (size_ret) *size_ret = size;
+ return EINA_TRUE;
+ }
+ }
+ else if ((format & EFL_SELECTION_FORMAT_MARKUP) ||
+ (format & EFL_SELECTION_FORMAT_HTML))
+ {
+ char *tmp = malloc(size + 1);
+ if (tmp)
+ {
+ strncpy(tmp, data, size);
+ tmp[size] = 0;
+ *data_ret = _elm_util_mkup_to_text(tmp);
+ if (size_ret && *data_ret) *size_ret = strlen(*data_ret);
+ free(tmp);
+ }
+ else return EINA_FALSE;
+ }
+ else if (format & EFL_SELECTION_FORMAT_TEXT)
+ {
+ char *tmp = malloc(size + 1);
+ if (tmp)
+ {
+ strncpy(tmp, data, size);
+ tmp[size] = 0;
+ *data_ret = tmp;
+ if (size_ret && *data_ret) *size_ret = strlen(*data_ret);
+ }
+ else return EINA_FALSE;
+ }
+ else if (format & EFL_SELECTION_FORMAT_IMAGE)
+ {
+ sel_debug("Image %s\n", evas_object_type_get(sel->request_obj));
+ efl_file_get(sel->request_obj, (const char **)data_ret, NULL);
+ if (!*data_ret) *data_ret = strdup("No file");
+ else *data_ret = strdup(*data_ret);
+
+ if (!*data_ret)
+ {
+ ERR("Failed to allocate memory!");
+ *size_ret = 0;
+ return EINA_FALSE;
+ }
+
+ if (size_ret) *size_ret = strlen(*data_ret);
+ }
+ return EINA_TRUE;
+}
+
+static void
+_wl_sel_obj_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
+{
+ Sel_Manager_Selection *sel = data;
+ if (sel->owner == obj)
+ {
+ sel->owner = NULL;
+ }
+ //if (dragwidget == obj) dragwidget = NULL;
+}
+
+static Eina_Future *
+_wl_efl_sel_manager_selection_set(Efl_Selection_Manager_Data *pd,
+ Efl_Object *owner, Efl_Selection_Type type,
+ Efl_Selection_Format format,
+ Eina_Slice data,
+ Ecore_Wl2_Window *win,
+ unsigned int seat)
+{
+ Sel_Manager_Seat_Selection *seat_sel;
+ Sel_Manager_Selection *sel;
+ int i = 0, count = 0;
+ Eina_Bool is_uri = EINA_FALSE;
+ const char **types;
+
+ if ((!data.mem) && (format != EFL_SELECTION_FORMAT_IMAGE))
+ {
+ efl_selection_manager_selection_clear(pd->sel_man, owner, type, seat);
+ return NULL;
+ }
+
+ if (data.len <= 0)
+ return NULL;
+
+ seat_sel = _wl_sel_manager_seat_selection_init(pd, seat);
+ seat_sel->active_type = type;
+ sel = seat_sel->sel;
+
+ if (sel->owner != owner)
+ {
+ Eina_List *l, *l_next;
+ Sel_Manager_Selection_Lost *sel_lost;
+
+ EINA_LIST_FOREACH_SAFE(seat_sel->sel_lost_list, l, l_next, sel_lost)
+ {
+ if ((sel_lost->request == sel->owner) &&
+ (sel_lost->type == type))
+ {
+ eina_promise_resolve(sel_lost->promise, eina_value_uint_init(sel_lost->type));
+ seat_sel->sel_lost_list = eina_list_remove(seat_sel->sel_lost_list, sel_lost);
+ free(sel_lost);
+ }
+ }
+ }
+
+ if (sel->owner)
+ evas_object_event_callback_del_full(sel->owner, EVAS_CALLBACK_DEL,
+ _wl_sel_obj_del, sel);
+ sel->active = EINA_TRUE;
+ sel->owner = owner;
+ sel->win = win;
+ /* sel->set(win, &selection, sizeof(Elm_Sel_Type)); */
+ sel->format = format;
+
+ evas_object_event_callback_add
+ (sel->owner, EVAS_CALLBACK_DEL, _wl_sel_obj_del, &sel);
+
+ sel->data = eina_slice_dup(data);
+ if (!sel->data.mem)
+ {
+ efl_selection_manager_selection_clear(pd->sel_man, owner, type, seat_sel->seat);
+ return NULL;
+ }
+
+ is_uri = _wl_is_uri_type_data(sel->data.mem, sel->data.len);
+ types = malloc(sizeof(char *));
+ if (!types) return NULL;
+ for (i = 0, count = 1; i < SELECTION_N_ATOMS; i++)
+ {
+ if (format & pd->atom_list[i].format)
+ {
+ if ((is_uri) ||
+ ((!is_uri) && strcmp(pd->atom_list[i].name, "text/uri-list")))
+ {
+ const char **t = NULL;
+
+ types[count - 1] = pd->atom_list[i].name;
+ count++;
+ t = realloc(types, sizeof(char *) * count);
+ if (!t)
+ {
+ free(types);
+ return NULL;
+ }
+ types = t;
+ }
+ }
+ }
+ types[count - 1] = 0;
+
+ sel->selection_serial = ecore_wl2_dnd_selection_set(_wl_seat_get(win, owner, seat_sel->seat), types);
+ DBG("serial: %d", sel->selection_serial);
+
+ free(types);
+ //return _local_elm_cnp_selection_set(obj, selection, format, buf, buflen);
+
+ return _update_sel_lost_list(owner, type, seat_sel);
+}
+
+/*static void
+_wl_selection_changed_free(void *data, void *ev EINA_UNUSED)
+{
+ ecore_wl2_display_disconnect(data);
+}*/
+
+static Eina_Bool
+_wl_selection_changed(void *data, int type EINA_UNUSED, void *event)
+{
+ Efl_Selection_Manager_Data *pd = data;
+ Sel_Manager_Seat_Selection *seat_sel;
+ Sel_Manager_Selection *sel;
+ Efl_Selection_Changed e;
+ Ecore_Wl2_Event_Seat_Selection *ev = event;
+ Ecore_Wl2_Input *seat;
+
+ seat_sel = _wl_sel_manager_seat_selection_init(pd, ev->seat);
+ sel_debug("seat: %d", ev->seat);
+ if (!seat_sel) return ECORE_CALLBACK_RENEW;
+ sel = seat_sel->sel;
+
+ seat = ecore_wl2_display_input_find(ev->display, ev->seat);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(seat, ECORE_CALLBACK_RENEW);
+ e.type = EFL_SELECTION_TYPE_CLIPBOARD;
+ e.seat = ev->seat;
+ /* connect again to add ref */
+ e.display = ecore_wl2_display_connect(ecore_wl2_display_name_get(ev->display));
+ e.exist = !!ecore_wl2_dnd_selection_get(seat);
+ //ecore_event_add(ELM_CNP_EVENT_SELECTION_CHANGED, e, _wl_selection_changed_free, ev->display);
+ efl_event_callback_call(sel->request_obj, EFL_SELECTION_EVENT_SELECTION_CHANGED, &e);
+
+ return ECORE_CALLBACK_RENEW;
+}
+
+static Eina_Bool
+_wl_selection_send(void *data, int type EINA_UNUSED, void *event)
+{
+ Efl_Selection_Manager_Data *pd = data;
+ char *buf;
+ int ret, len_remained;
+ int len_written = 0;
+ Ecore_Wl2_Event_Data_Source_Send *ev;
+ int seat;
+ Sel_Manager_Seat_Selection *seat_sel;
+ Sel_Manager_Selection *sel;
+ void *data_ret = NULL;
+ int len_ret = 0;
+ int i = 0;
+
+ ev = event;
+ seat = ev->seat;
+ sel_debug("seat: %d, type: %d", seat, type);
+ seat_sel = _wl_sel_manager_seat_selection_init(pd, seat);
+ if (!seat_sel) return ECORE_CALLBACK_RENEW;
+ sel = seat_sel->sel;
+
+ if ((ev->serial != sel->selection_serial) &&
+ (ev->serial != sel->drag_serial))
+ return ECORE_CALLBACK_RENEW;
+
+ for (i = 0; i < SELECTION_N_ATOMS; i++)
+ {
+ if (!strcmp(pd->atom_list[i].name, ev->type))
+ {
+ sel_debug("Found a type: %s\n", pd->atom_list[i].name);
+ Sel_Manager_Dropable *drop;
+ drop = efl_key_data_get(sel->request_obj, "__elm_dropable");
+ if (drop)
+ drop->last.type = pd->atom_list[i].name;
+ if (pd->atom_list[i].wl_converter)
+ {
+ pd->atom_list[i].wl_converter(ev->type, sel, sel->data.mem,
+ sel->data.len, &data_ret, &len_ret);
+ }
+ else
+ {
+ data_ret = eina_memdup(sel->data.mem, sel->data.len, 0);
+ len_ret = sel->data.len;
+ }
+ break;
+ }
+ }
+
+ len_remained = len_ret;
+ buf = data_ret;
+
+ while (len_written < len_ret)
+ {
+ ret = write(ev->fd, buf, len_remained);
+ if (ret == -1) break;
+ buf += ret;
+ len_written += ret;
+ len_remained -= ret;
+ }
+ free(data_ret);
+
+ close(ev->fd);
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+static Eina_Bool
+_wl_dnd_end(void *data, int type EINA_UNUSED, void *event)
+{
+ sel_debug("In");
+ Efl_Selection_Manager_Data *pd = data;
+ Ecore_Wl2_Event_Data_Source_End *ev;
+ Sel_Manager_Seat_Selection *seat_sel;
+ Sel_Manager_Selection *sel;
+
+ ev = event;
+ seat_sel = _wl_sel_manager_seat_selection_init(pd, ev->seat);
+ sel = seat_sel->sel;
+ if (ev->serial != sel->drag_serial)
+ return ECORE_CALLBACK_RENEW;
+
+ if (seat_sel->active_type != EFL_SELECTION_TYPE_DND)
+ return ECORE_CALLBACK_RENEW;
+
+ efl_event_callback_call(seat_sel->drag_obj, EFL_UI_DND_EVENT_DRAG_DONE, NULL);
+ if (seat_sel->drag_win)
+ {
+ if (!seat_sel->accept)
+ {
+ /* Commit animation when drag cancelled */
+ /* Record final position of dragwin, then do animation */
+ ecore_animator_timeline_add(0.3, _drag_cancel_animate, seat_sel);
+ }
+ else
+ {
+ /* No animation drop was committed */
+ evas_object_del(seat_sel->drag_win);
+ seat_sel->drag_win = NULL;
+ }
+ }
+
+ seat_sel->accept = EINA_FALSE;
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+static Ecore_Wl2_Input *
+_wl_seat_get(Ecore_Wl2_Window *win, Evas_Object *obj, unsigned int seat_id)
+{
+ Eo *seat, *parent2, *ewin;
+ Ecore_Wl2_Input *input = NULL;
+
+ input = ecore_wl2_display_input_find(ecore_wl2_window_display_get(win), seat_id);
+ if (input) return input;
+
+ if (obj)
+ {
+ // FIXME (there might be a better solution):
+ // In case of inwin, we want to use the main wl2 window for cnp, but obj
+ // obj belongs to the buffer canvas, so the default seat for obj does not
+ // match the window win.
+ Eo *top = elm_widget_top_get(obj);
+ if (efl_isa(top, EFL_UI_WIN_INLINED_CLASS))
+ {
+ parent2 = efl_ui_win_inlined_parent_get(top);
+ if (parent2) obj = elm_widget_top_get(parent2) ?: parent2;
+ }
+ /* fake win means canvas seat id will not match protocol seat id */
+ ewin = elm_win_get(obj);
+ if (elm_win_type_get(ewin) == ELM_WIN_FAKE) obj = NULL;
+ }
+
+ if (!obj)
+ {
+ Eina_Iterator *it;
+ it = ecore_wl2_display_inputs_get(ecore_wl2_window_display_get(win));
+ EINA_ITERATOR_FOREACH(it, input) break;
+ eina_iterator_free(it);
+ return input;
+ }
+
+ seat = evas_default_device_get(evas_object_evas_get(obj), EFL_INPUT_DEVICE_TYPE_SEAT);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(seat, NULL);
+ return ecore_wl2_display_input_find(ecore_wl2_window_display_get(win),
+ evas_device_seat_id_get(seat));
+}
+
+static Ecore_Wl2_Window *
+_wl_window_get(const Evas_Object *obj)
+{
+ Evas_Object *top;
+ Ecore_Wl2_Window *win = NULL;
+
+ if (elm_widget_is(obj))
+ {
+ top = elm_widget_top_get(obj);
+ if (!top) top = elm_widget_top_get(elm_widget_parent_widget_get(obj));
+ if (top && (efl_isa(top, EFL_UI_WIN_CLASS)))
+ win = elm_win_wl_window_get(top);
+ }
+ if (!win)
+ {
+ Ecore_Evas *ee;
+ Evas *evas;
+ const char *engine_name;
+
+ if (!(evas = evas_object_evas_get(obj)))
+ return NULL;
+ if (!(ee = ecore_evas_ecore_evas_get(evas)))
+ return NULL;
+
+ engine_name = ecore_evas_engine_name_get(ee);
+ if (!strcmp(engine_name, ELM_BUFFER))
+ {
+ ee = ecore_evas_buffer_ecore_evas_parent_get(ee);
+ if (!ee) return NULL;
+ engine_name = ecore_evas_engine_name_get(ee);
+ }
+ if (!strncmp(engine_name, "wayland", sizeof("wayland") - 1))
+ {
+ /* In case the engine is not a buffer, we want to check once. */
+ win = ecore_evas_wayland2_window_get(ee);
+ if (!win) return NULL;
+ }
+ }
+
+ return win;
+}
+
+static void
+_wl_selection_receive_timeout(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
+{
+ Sel_Manager_Selection *sel = data;
+
+ if (sel->request_obj != obj) return;
+
+ ecore_event_handler_del(sel->offer_handler);
+}
+
+static Eina_Bool
+_wl_selection_receive(void *data, int type EINA_UNUSED, void *event)
+{
+ Ecore_Wl2_Event_Offer_Data_Ready *ev = event;
+ Sel_Manager_Selection *sel = data;
+
+ if (sel->sel_offer != ev->offer) return ECORE_CALLBACK_PASS_ON;
+
+ if (sel->data_func)
+ {
+ Efl_Selection_Data sel_data;
+
+ sel_data.pos.x = sel_data.pos.y = 0;
+ if (((sel->format & EFL_SELECTION_FORMAT_MARKUP) ||
+ (sel->format & EFL_SELECTION_FORMAT_HTML)) &&
+ (sel->want_format == EFL_SELECTION_FORMAT_TEXT))
+ {
+ char *tmp = malloc(ev->len + 1);
+ sel_data.format = sel->format;
+ sel_data.content.mem = NULL;
+ sel_data.content.len = 0;
+ if (tmp)
+ {
+ sel_data.format = sel->want_format;
+ strncpy(tmp, ev->data, ev->len);
+ tmp[ev->len] = 0;
+ sel_data.content.mem = _elm_util_mkup_to_text(tmp);
+ if (sel_data.content.mem)
+ sel_data.content.len = strlen(sel_data.content.mem);
+ free(tmp);
+ }
+ }
+ else
+ {
+ sel_data.format = sel->format;
+ sel_data.content.mem = ev->data;
+ sel_data.content.len = ev->len;
+ }
+ sel_data.action = _wl_to_elm(ecore_wl2_offer_action_get(sel->sel_offer));
+ sel->data_func(sel->data_func_data,
+ sel->request_obj,
+ &sel_data);
+ }
+ else
+ {
+ char *stripstr, *mkupstr;
+
+ stripstr = malloc(ev->len + 1);
+ if (!stripstr) return ECORE_CALLBACK_CANCEL;
+ strncpy(stripstr, (char *)ev->data, ev->len);
+ stripstr[ev->len] = '\0';
+ mkupstr = _elm_util_text_to_mkup((const char *)stripstr);
+ /* TODO BUG: should never NEVER assume it's an elm_entry! */
+ _elm_entry_entry_paste(sel->request_obj, mkupstr);
+ free(stripstr);
+ free(mkupstr);
+ }
+
+ evas_object_event_callback_del_full(sel->request_obj,
+ EVAS_CALLBACK_DEL,
+ _wl_selection_receive_timeout, sel);
+
+ ecore_event_handler_del(sel->offer_handler);
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static Eina_Bool
+_wl_efl_sel_manager_selection_get(const Efl_Object *request, Efl_Selection_Manager_Data *pd,
+ Efl_Selection_Type type, Efl_Selection_Format format,
+ void *data_func_data, Efl_Selection_Data_Ready data_func, Eina_Free_Cb data_func_free_cb,
+ Ecore_Wl2_Window *win, unsigned int seat)
+{
+ sel_debug("In, format: %d", format);
+ Sel_Manager_Seat_Selection *seat_sel;
+ Sel_Manager_Selection *sel;
+ Ecore_Wl2_Input *input;
+ Ecore_Wl2_Offer *offer;
+ int i = 0;
+
+ if (type == EFL_SELECTION_TYPE_DND) return EINA_FALSE;
+
+ //if (sel->active)
+ //return _local_elm_cnp_selection_get(obj, selection, format, datacb, udata);
+ seat_sel = _sel_manager_seat_selection_init(pd, seat);
+ sel = seat_sel->sel;
+ sel->request_obj = (Efl_Object *)request;
+ sel->data_func_data = data_func_data;
+ sel->data_func = data_func;
+ sel->data_func_free_cb = data_func_free_cb;
+
+ input = _wl_seat_get(win, (Efl_Object *)request, seat_sel->seat);
+ offer = ecore_wl2_dnd_selection_get(input);
+
+ //there can be no selection available
+ if (!offer) return EINA_FALSE;
+
+ for (i = 0; sm_wl_convertion[i].translates; i++)
+ {
+ int j = 0;
+// if (!(format & sm_wl_convertion[i].format)) continue;
+
+ for (j = 0; sm_wl_convertion[i].translates[j]; j++)
+ {
+ if (!ecore_wl2_offer_supports_mime(offer, sm_wl_convertion[i].translates[j])) continue;
+
+ //we have found matching mimetypes
+ sel->sel_offer = offer;
+ sel->format = sm_wl_convertion[i].format;
+ sel->want_format = format;
+
+ sel_debug("request type: %s", (char *)sm_wl_convertion[i].translates[j]);
+ evas_object_event_callback_add(sel->request_obj, EVAS_CALLBACK_DEL,
+ _wl_selection_receive_timeout, sel);
+ sel->offer_handler = ecore_event_handler_add(ECORE_WL2_EVENT_OFFER_DATA_READY,
+ _wl_selection_receive, sel);
+
+ ecore_wl2_offer_receive(offer, (char*)sm_wl_convertion[i].translates[j]);
+ return EINA_TRUE;
+ }
+ }
+
+ sel_debug("no type match");
+ return EINA_FALSE;
+}
+
+static void
+_wl_sel_obj_del2(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
+{
+ Sel_Manager_Selection *sel = data;
+ if (sel->request_obj == obj) sel->request_obj = NULL;
+}
+
+static Sel_Manager_Dropable *
+_wl_dropable_find(Efl_Selection_Manager_Data *pd, Ecore_Wl2_Window *win)
+{
+ Eina_List *l;
+ Sel_Manager_Dropable *dropable;
+
+ if (!pd->drop_list) return NULL;
+
+ if (!win) return NULL;
+
+ EINA_LIST_FOREACH(pd->drop_list, l, dropable)
+ if (_wl_window_get(dropable->obj) == win)
+ return dropable;
+
+ return NULL;
+}
+
+static Evas *
+_wl_evas_get_from_win(Efl_Selection_Manager_Data *pd, Ecore_Wl2_Window *win)
+{
+ Sel_Manager_Dropable *dropable = _wl_dropable_find(pd, win);
+ return dropable ? evas_object_evas_get(dropable->obj) : NULL;
+}
+
+static Eina_Bool
+_wl_drops_accept(Sel_Manager_Seat_Selection *seat_sel, const char *type)
+{
+ Efl_Selection_Manager_Data *pd;
+ Sel_Manager_Selection *sel;
+ Eina_List *l;
+ Sel_Manager_Dropable *drop;
+ Eina_Bool will_accept = EINA_FALSE;
+
+ if (!type) return EINA_FALSE;
+
+ pd = seat_sel->pd;
+ sel = seat_sel->sel;
+ EINA_LIST_FOREACH(pd->drop_list, l, drop)
+ {
+ Drop_Format *df;
+ EINA_INLIST_FOREACH(drop->format_list, df)
+ {
+ for (int i = 0; sm_wl_convertion[i].translates ; ++i)
+ {
+ if (!(sm_wl_convertion[i].format & df->format)) continue;
+
+ for (int j = 0; sm_wl_convertion[i].translates[j]; ++j)
+ {
+ if (!strncmp(type, sm_wl_convertion[i].translates[j], strlen(sm_wl_convertion[i].translates[j])))
+ {
+ sel->request_obj = drop->obj;
+ return EINA_TRUE;
+ }
+ }
+ }
+ }
+ }
+
+ return will_accept;
+}
+
+static void
+_wl_selection_parser(void *_data, int size, char ***ret_data, int *ret_count)
+{
+ char **files = NULL;
+ int num_files = 0;
+ char *data = NULL;
+
+ data = malloc(size);
+ if (data && (size > 0))
+ {
+ int i, is;
+ char *tmp;
+ char **t2;
+
+ memcpy(data, _data, size);
+ if (data[size - 1])
+ {
+ char *t;
+
+ /* Isn't nul terminated */
+ size++;
+ t = realloc(data, size);
+ if (!t) goto done;
+ data = t;
+ data[size - 1] = 0;
+ }
+
+ tmp = malloc(size);
+ if (!tmp) goto done;
+ i = 0;
+ is = 0;
+ while ((is < size) && (data[is]))
+ {
+ if ((i == 0) && (data[is] == '#'))
+ for (; ((data[is]) && (data[is] != '\n')); is++) ;
+ else
+ {
+ if ((data[is] != '\r') && (data[is] != '\n'))
+ tmp[i++] = data[is++];
+ else
+ {
+ while ((data[is] == '\r') || (data[is] == '\n'))
+ is++;
+ tmp[i] = 0;
+ num_files++;
+ t2 = realloc(files, num_files * sizeof(char *));
+ if (t2)
+ {
+ files = t2;
+ files[num_files - 1] = strdup(tmp);
+ }
+ else
+ {
+ num_files--;
+ goto freetmp;
+ }
+ tmp[0] = 0;
+ i = 0;
+ }
+ }
+ }
+ if (i > 0)
+ {
+ tmp[i] = 0;
+ num_files++;
+ t2 = realloc(files, num_files * sizeof(char *));
+ if (t2)
+ {
+ files = t2;
+ files[num_files - 1] = strdup(tmp);
+ }
+ else
+ {
+ num_files--;
+ goto freetmp;
+ }
+ }
+freetmp:
+ free(tmp);
+ }
+done:
+ free(data);
+ if (ret_data) *ret_data = files;
+ else
+ {
+ int i;
+
+ for (i = 0; i < num_files; i++) free(files[i]);
+ free(files);
+ }
+ if (ret_count) *ret_count = num_files;
+}
+
+static Eina_Bool
+_wl_data_preparer_markup(Sel_Manager_Selection *sel, Efl_Selection_Data *ddata, Ecore_Wl2_Event_Offer_Data_Ready *ev, Tmp_Info **tmp_info EINA_UNUSED)
+{
+ sel_debug("In\n");
+
+ ddata->format = EFL_SELECTION_FORMAT_MARKUP;
+ ddata->content.mem = eina_memdup((unsigned char *)ev->data, ev->len, EINA_TRUE);
+ ddata->content.len = ev->len;
+ ddata->action = sel->action;
+
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_wl_data_preparer_uri(Sel_Manager_Selection *sel, Efl_Selection_Data *ddata, Ecore_Wl2_Event_Offer_Data_Ready *ev, Tmp_Info **tmp_info EINA_UNUSED)
+{
+ Sel_Manager_Seat_Selection *seat_sel;
+ char *p, *stripstr = NULL;
+ char *data = ev->data;
+ Sel_Manager_Dropable *drop;
+ const char *type = NULL;
+
+ sel_debug("In\n");
+
+ seat_sel = sel->seat_sel;
+ drop = efl_key_data_get(sel->request_obj, "__elm_dropable");
+ if (drop) type = drop->last.type;
+
+ if ((type) && (!strcmp(type, "text/uri-list")))
+ {
+ int num_files = 0;
+ char **files = NULL;
+ Efreet_Uri *uri;
+ Eina_Strbuf *strbuf;
+ int i;
+
+ strbuf = eina_strbuf_new();
+ if (!strbuf) return EINA_FALSE;
+
+ _wl_selection_parser(ev->data, ev->len, &files, &num_files);
+ sel_debug("got a files list\n");
+
+ for (i = 0; i < num_files; i++)
+ {
+ uri = efreet_uri_decode(files[i]);
+ if (uri)
+ {
+ eina_strbuf_append(strbuf, uri->path);
+ efreet_uri_free(uri);
+ }
+ else
+ {
+ eina_strbuf_append(strbuf, files[i]);
+ }
+ if (i < (num_files - 1))
+ eina_strbuf_append(strbuf, "\n");
+ free(files[i]);
+ }
+ free(files);
+ stripstr = eina_strbuf_string_steal(strbuf);
+ eina_strbuf_free(strbuf);
+ }
+ else
+ {
+ Efreet_Uri *uri;
+
+ p = (char *)eina_memdup((unsigned char *)data, ev->len, EINA_TRUE);
+ if (!p) return EINA_FALSE;
+ uri = efreet_uri_decode(p);
+ if (!uri)
+ {
+ /* Is there any reason why we care of URI without scheme? */
+ if (p[0] == '/') stripstr = p;
+ else free(p);
+ }
+ else
+ {
+ free(p);
+ stripstr = strdup(uri->path);
+ efreet_uri_free(uri);
+ }
+ }
+
+ if (!stripstr)
+ {
+ sel_debug("Couldn't find a file\n");
+ return EINA_FALSE;
+ }
+ free(seat_sel->saved_types->imgfile);
+
+ ddata->content.mem = stripstr;
+ ddata->content.len = strlen(stripstr);
+ ddata->action = sel->action;
+ ddata->format = sel->request_format;
+
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_wl_data_preparer_vcard(Sel_Manager_Selection *sel, Efl_Selection_Data *ddata, Ecore_Wl2_Event_Offer_Data_Ready *ev, Tmp_Info **tmp_info EINA_UNUSED)
+{
+ sel_debug("In\n");
+
+ ddata->format = EFL_SELECTION_FORMAT_VCARD;
+ ddata->content.mem = eina_memdup((unsigned char *)ev->data, ev->len, EINA_TRUE);
+ ddata->content.len = ev->len;
+ ddata->action = sel->action;
+
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_wl_data_preparer_image(Sel_Manager_Selection *sel, Efl_Selection_Data *ddata, Ecore_Wl2_Event_Offer_Data_Ready *ev, Tmp_Info **tmp_info)
+{
+ sel_debug("In\n");
+ Tmp_Info *tmp;
+ int len = 0;
+
+ tmp = _tempfile_new(ev->len);
+ if (!tmp)
+ return EINA_FALSE;
+ memcpy(tmp->map, ev->data, ev->len);
+ munmap(tmp->map, ev->len);
+
+ len = strlen(tmp->filename);
+ ddata->format = EFL_SELECTION_FORMAT_IMAGE;
+ ddata->content.mem = eina_memdup((unsigned char*)tmp->filename, len, EINA_TRUE);
+ ddata->content.len = len;
+ ddata->action = sel->action;
+ *tmp_info = tmp;
+
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_wl_data_preparer_text(Sel_Manager_Selection *sel, Efl_Selection_Data *ddata, Ecore_Wl2_Event_Offer_Data_Ready *ev, Tmp_Info **tmp_info EINA_UNUSED)
+{
+ sel_debug("In\n");
+
+ ddata->format = EFL_SELECTION_FORMAT_TEXT;
+ ddata->content.mem = eina_memdup((unsigned char *)ev->data, ev->len, EINA_TRUE);
+ ddata->content.len = ev->len;
+ ddata->action = sel->action;
+
+ return EINA_TRUE;
+}
+
+
+static void
+_wl_dropable_handle(Sel_Manager_Seat_Selection *seat_sel, Sel_Manager_Dropable *dropable, Evas_Coord x, Evas_Coord y)
+{
+ Sel_Manager_Dropable *d, *last_dropable = NULL;
+ Efl_Selection_Manager_Data *pd = seat_sel->pd;
+ Sel_Manager_Selection *sel;
+ Eina_Inlist *itr;
+ Eina_List *l;
+ Eina_Position2D pos;
+
+ EINA_LIST_FOREACH(pd->drop_list, l, d)
+ {
+ if (d->last.in)
+ {
+ last_dropable = d;
+ break;
+ }
+ }
+
+ sel = seat_sel->sel;
+ pos = EINA_POSITION2D(x, y);
+ /* If we are on the same object, just update the position */
+ if ((dropable) && (last_dropable == dropable))
+ {
+ Evas_Coord ox, oy;
+ Efl_Dnd_Drag_Pos pos_data;
+ Drop_Format *df;
+
+ evas_object_geometry_get(dropable->obj, &ox, &oy, NULL, NULL);
+ if (!dropable->is_container)
+ {
+ pos_data.pos = EINA_POSITION2D(x - ox, y - oy);
+ pos_data.item = NULL;
+ }
+ else
+ {
+ Efl_Object *it = NULL;
+
+ if (dropable->item_func)
+ it = dropable->item_func(dropable->item_func_data, dropable->obj,
+ pos, &pos_data.pos);
+ pos_data.item = it;
+ }
+ pos_data.format = dropable->last.format;
+ pos_data.action = sel->action;
+ EINA_INLIST_FOREACH_SAFE(dropable->format_list, itr, df)
+ {
+ if (df->format & dropable->last.format)
+ efl_event_callback_call(dropable->obj, EFL_UI_DND_EVENT_DRAG_POS, &pos_data);
+ }
+
+ return;
+ }
+ /* We leave the last dropable */
+ if (last_dropable)
+ {
+ Drop_Format *df;
+ sel_debug("leave %p\n", last_dropable->obj);
+ last_dropable->last.in = EINA_FALSE;
+
+ EINA_INLIST_FOREACH_SAFE(last_dropable->format_list, itr, df)
+ {
+ if (df->format & last_dropable->last.format)
+ efl_event_callback_call(last_dropable->obj, EFL_UI_DND_EVENT_DRAG_LEAVE, NULL);
+ }
+ }
+ /* We enter the new dropable */
+ if (dropable)
+ {
+ sel_debug("enter %p\n", dropable->obj);
+ Evas_Coord ox, oy;
+ Efl_Dnd_Drag_Pos pos_data;
+ Drop_Format *df;
+
+ dropable->last.in = EINA_TRUE;
+ evas_object_geometry_get(dropable->obj, &ox, &oy, NULL, NULL);
+ if (!dropable->is_container)
+ {
+ pos_data.pos = EINA_POSITION2D(x - ox, y - oy);
+ pos_data.item = NULL;
+ }
+ else
+ {
+ Efl_Object *it = NULL;
+
+ if (dropable->item_func)
+ it = dropable->item_func(dropable->item_func_data, dropable->obj,
+ pos, &pos_data.pos);
+ pos_data.item = it;
+ }
+ pos_data.format = dropable->last.format;
+ pos_data.action = sel->action;
+
+ EINA_INLIST_FOREACH_SAFE(dropable->format_list, itr, df)
+ {
+ if (df->format & dropable->last.format)
+ {
+ efl_event_callback_call(dropable->obj, EFL_UI_DND_EVENT_DRAG_ENTER, NULL);
+ efl_event_callback_call(dropable->obj, EFL_UI_DND_EVENT_DRAG_POS, &pos_data);
+ }
+ }
+ }
+}
+
+static void
+_wl_dropable_all_clean(Sel_Manager_Seat_Selection *seat_sel, Ecore_Wl2_Window *win)
+{
+ Eina_List *l;
+ Sel_Manager_Dropable *dropable;
+
+ if (!win) return;
+
+ EINA_LIST_FOREACH(seat_sel->pd->drop_list, l, dropable)
+ {
+ if (_wl_window_get(dropable->obj) == win)
+ {
+ dropable->last.pos.x = 0;
+ dropable->last.pos.y = 0;
+ dropable->last.in = EINA_FALSE;
+ }
+ }
+}
+
+static void
+_wl_dropable_data_handle(Sel_Manager_Selection *sel, Ecore_Wl2_Event_Offer_Data_Ready *ev)
+{
+ Sel_Manager_Seat_Selection *seat_sel;
+ Efl_Selection_Manager_Data *pd;
+ Sel_Manager_Dropable *drop;
+ Ecore_Wl2_Window *win;
+
+ sel_debug("In\n");
+ seat_sel = sel->seat_sel;
+ pd = seat_sel->pd;
+ drop = efl_key_data_get(sel->request_obj, "__elm_dropable");
+ if (drop)
+ {
+ Sel_Manager_Atom *atom = NULL;
+
+ atom = eina_hash_find(pd->type_hash, drop->last.type);
+ if (atom && atom->wl_data_preparer)
+ {
+ Efl_Selection_Data ddata;
+ Tmp_Info *tmp_info = NULL;
+ Eina_Bool success;
+
+ sel_debug("Call notify for: %s\n", atom->name);
+ success = atom->wl_data_preparer(sel, &ddata, ev, &tmp_info);
+ if (success)
+ {
+ Sel_Manager_Dropable *dropable;
+ Eina_List *l;
+
+ EINA_LIST_FOREACH(pd->drop_list, l, dropable)
+ {
+ if (dropable->obj == sel->request_obj) break;
+ dropable = NULL;
+ }
+ if (dropable)
+ {
+ Drop_Format *df;
+ Eina_Inlist *itr;
+
+ if (!dropable->is_container)
+ {
+ ddata.pos.x = seat_sel->saved_types->pos.x;
+ ddata.pos.y = seat_sel->saved_types->pos.y;
+ }
+ else
+ {
+ //for container
+ Efl_Object *it = NULL;
+ Evas_Coord x0 = 0, y0 = 0;
+ Eina_Position2D pos, posret = {};
+
+ evas_object_geometry_get(dropable->obj, &x0, &y0, NULL, NULL);
+ pos = EINA_POSITION2D(seat_sel->saved_types->pos.x + x0,
+ seat_sel->saved_types->pos.y + y0);
+ if (dropable->item_func)
+ it = dropable->item_func(dropable->item_func_data, dropable->obj,
+ pos, &posret);
+ ddata.pos = posret;
+ ddata.item = it;
+ }
+ ddata.action = seat_sel->drag_action;
+
+ EINA_INLIST_FOREACH_SAFE(dropable->format_list, itr, df)
+ {
+ if (df->format & dropable->last.format)
+ efl_event_callback_call(dropable->obj, EFL_UI_DND_EVENT_DRAG_DROP, &ddata);
+ }
+ }
+ }
+ win = _wl_window_get(sel->request_obj);
+ ecore_wl2_dnd_drag_end(_wl_seat_get(win, NULL, seat_sel->seat));
+ if (tmp_info) _tmpinfo_free(tmp_info);
+ return;
+ }
+ }
+
+ win = _wl_window_get(sel->request_obj);
+ ecore_wl2_dnd_drag_end(_wl_seat_get(win, NULL, seat_sel->seat));
+ seat_sel->saved_types->textreq = 0;
+}
+
+static Eina_Bool
+_wl_dnd_enter(void *data, int type EINA_UNUSED, void *event)
+{
+ Ecore_Wl2_Event_Dnd_Enter *ev;
+ Eina_Array *known, *available;
+ Sel_Manager_Seat_Selection *seat_sel = data;
+ unsigned int i = 0;
+
+ ev = event;
+
+ available = ecore_wl2_offer_mimes_get(ev->offer);
+
+ free(seat_sel->saved_types->types);
+
+ seat_sel->saved_types->ntypes = eina_array_count(available);
+ seat_sel->saved_types->types = malloc(sizeof(char *) * seat_sel->saved_types->ntypes);
+ if (!seat_sel->saved_types->types) return EINA_FALSE;
+
+ known = eina_array_new(5);
+
+ for (i = 0; i < eina_array_count(available); i++)
+ {
+ seat_sel->saved_types->types[i] =
+ eina_stringshare_add(eina_array_data_get(available, i));
+ if (seat_sel->saved_types->types[i] == seat_sel->pd->text_uri)
+ {
+ seat_sel->saved_types->textreq = 1;
+ ELM_SAFE_FREE(seat_sel->saved_types->imgfile, free);
+ }
+ }
+
+ seat_sel->accept = EINA_FALSE;
+ for (i = 0; i < eina_array_count(available); i++)
+ {
+ if (_wl_drops_accept(seat_sel, eina_array_data_get(available, i)))
+ {
+ eina_array_push(known, strdup(eina_array_data_get(available, i)));
+ }
+ }
+
+ ecore_wl2_offer_mimes_set(ev->offer, known);
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+static Eina_Bool
+_wl_dnd_leave(void *data, int type EINA_UNUSED, void *event)
+{
+ Ecore_Wl2_Event_Dnd_Leave *ev;
+ Sel_Manager_Seat_Selection *seat_sel = data;
+ Sel_Manager_Dropable *drop;
+ sel_debug("In\n");
+
+ ev = event;
+ if ((drop = _wl_dropable_find(seat_sel->pd, ev->win)))
+ {
+ _wl_dropable_handle(seat_sel, NULL, 0, 0);
+ _wl_dropable_all_clean(seat_sel, ev->win);
+ }
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+static Eina_Bool
+_wl_dnd_position(void *data, int type EINA_UNUSED, void *event)
+{
+ Ecore_Wl2_Event_Dnd_Motion *ev;
+ Sel_Manager_Seat_Selection *seat_sel = data;
+ Efl_Selection_Manager_Data *pd = seat_sel->pd;
+ Sel_Manager_Dropable *drop;
+ Eina_Bool will_accept = EINA_FALSE;
+
+ ev = event;
+
+ sel_debug("mouse pos %i %i\n", ev->x, ev->y);
+ seat_sel->drag_win_end.x = ev->x - seat_sel->drag_pos.x;
+ seat_sel->drag_win_end.y = ev->y - seat_sel->drag_pos.y;
+
+ drop = _wl_dropable_find(pd, ev->win);
+
+ if (drop)
+ {
+ Eina_Position2D pos = EINA_POSITION2D(ev->x, ev->y);
+ Evas *evas = NULL;
+ Eina_List *dropable_list = NULL;
+
+ _dropable_coords_adjust(drop, &pos);
+ evas = _wl_evas_get_from_win(pd, ev->win);
+ if (evas)
+ dropable_list = _dropable_list_geom_find(pd, evas, pos.x, pos.y);
+
+ /* check if there is dropable (obj) can accept this drop */
+ if (dropable_list)
+ {
+ Efl_Selection_Format saved_format;
+ Eina_List *l;
+ Eina_Bool found = EINA_FALSE;
+ Sel_Manager_Dropable *dropable = NULL;
+
+ saved_format =
+ _dnd_types_to_format(pd, seat_sel->saved_types->types, seat_sel->saved_types->ntypes);
+
+ EINA_LIST_FOREACH(dropable_list, l, dropable)
+ {
+ Drop_Format *df;
+ Eina_Inlist *itr;
+
+ EINA_INLIST_FOREACH_SAFE(dropable->format_list, itr, df)
+ {
+ Efl_Selection_Format common_fmt = saved_format & df->format;
+
+ if (common_fmt)
+ {
+ /* We found a target that can accept this type of data */
+ int i, min_index = SELECTION_N_ATOMS;
+
+ /* We have to find the first atom that corresponds to one
+ * of the supported data types. */
+ for (i = 0; i < seat_sel->saved_types->ntypes; i++)
+ {
+ Sel_Manager_Atom *atom;
+
+ atom = eina_hash_find(pd->type_hash,
+ seat_sel->saved_types->types[i]);
+
+ if (atom && (atom->format & common_fmt))
+ {
+ int atom_idx = (atom - pd->atom_list);
+
+ if (min_index > atom_idx)
+ min_index = atom_idx;
+ }
+ }
+ if (min_index != SELECTION_N_ATOMS)
+ {
+ sel_debug("Found atom %s\n", pd->atom_list[min_index].name);
+ found = EINA_TRUE;
+ dropable->last.type = pd->atom_list[min_index].name;
+ dropable->last.format = common_fmt;
+ break;
+ }
+ }
+ }
+ if (found) break;
+ }
+ if (found)
+ {
+ Sel_Manager_Selection *sel = seat_sel->sel;
+ Evas_Coord ox = 0, oy = 0;
+
+ evas_object_geometry_get(dropable->obj, &ox, &oy, NULL, NULL);
+
+ sel_debug("Candidate %p (%s)\n",
+ dropable->obj, efl_class_name_get(efl_class_get(dropable->obj)));
+ _wl_dropable_handle(seat_sel, dropable, pos.x - ox, pos.y - oy);
+ sel->request_obj = dropable->obj;
+ will_accept = EINA_TRUE;
+ }
+ else
+ {
+ //if not: send false status
+ sel_debug("dnd position (%d, %d) not in obj\n", pos.x, pos.y);
+ _wl_dropable_handle(seat_sel, NULL, 0, 0);
+ // CCCCCCC: call dnd exit on last obj
+ }
+ eina_list_free(dropable_list);
+ }
+ }
+
+ seat_sel->accept = will_accept;
+ efl_event_callback_call(seat_sel->drag_obj, EFL_UI_DND_EVENT_DRAG_ACCEPT, &seat_sel->accept);
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+static Eina_Bool
+_wl_dnd_receive(void *data, int type EINA_UNUSED, void *event)
+{
+ Ecore_Wl2_Event_Offer_Data_Ready *ev;
+ Sel_Manager_Seat_Selection *seat_sel = data;
+ Sel_Manager_Selection *sel;
+ Ecore_Wl2_Offer *offer;
+ sel_debug("In\n");
+
+ ev = event;
+ sel = seat_sel->sel;
+ offer = sel->dnd_offer;
+
+ if (offer != ev->offer) return ECORE_CALLBACK_PASS_ON;
+
+ if (sel->request_obj)
+ {
+ Ecore_Wl2_Drag_Action action;
+
+ action = ecore_wl2_offer_action_get(ev->offer);
+ if (action == ECORE_WL2_DRAG_ACTION_ASK)
+ ecore_wl2_offer_actions_set(ev->offer, ECORE_WL2_DRAG_ACTION_COPY, ECORE_WL2_DRAG_ACTION_COPY);
+ action = ecore_wl2_offer_action_get(ev->offer);
+ sel->action = _wl_to_elm(action);
+
+ _wl_dropable_data_handle(sel, ev);
+ evas_object_event_callback_del_full(sel->request_obj,
+ EVAS_CALLBACK_DEL,
+ _wl_sel_obj_del2, sel);
+ sel->request_obj = NULL;
+ }
+
+ ecore_wl2_offer_finish(ev->offer);
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static Eina_Bool
+_wl_dnd_drop(void *data, int type EINA_UNUSED, void *event)
+{
+ Ecore_Wl2_Event_Dnd_Drop *ev;
+ Sel_Manager_Seat_Selection *seat_sel = data;
+ Efl_Selection_Manager_Data *pd;
+ Sel_Manager_Selection *sel;
+ Sel_Manager_Dropable *drop;
+ Eina_List *l;
+
+ sel_debug("In\n");
+ ev = event;
+ seat_sel->saved_types->pos = EINA_POSITION2D(ev->x, ev->y);
+ pd = seat_sel->pd;
+ sel = seat_sel->sel;
+ sel->dnd_offer = ev->offer;
+
+ EINA_LIST_FOREACH(pd->drop_list, l, drop)
+ {
+ if (drop->last.in)
+ {
+ sel_debug("Request data of type %s; drop: %p\n", drop->last.type, drop);
+ sel->request_obj = drop->obj;
+ sel->request_format = drop->last.format;
+ evas_object_event_callback_add(sel->request_obj,
+ EVAS_CALLBACK_DEL, _wl_sel_obj_del2,
+ sel);
+ ecore_wl2_offer_receive(ev->offer, (char*)drop->last.type);
+ ecore_event_handler_add(ECORE_WL2_EVENT_OFFER_DATA_READY, _wl_dnd_receive, seat_sel);
+
+ return ECORE_CALLBACK_PASS_ON;
+ }
+ }
+
+ ecore_wl2_dnd_drag_end(_wl_seat_get(ev->win, NULL, seat_sel->seat));
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+static Eina_Bool
+_wl_sel_manager_drop_target_add(Efl_Selection_Manager_Data *pd, Efl_Object *target_obj,
+ Efl_Selection_Format format, unsigned int seat)
+{
+ Sel_Manager_Dropable *dropable = NULL;
+ Sel_Manager_Seat_Selection *seat_sel = NULL;
+ Drop_Format *df;
+
+ df = calloc(1, sizeof(Drop_Format));
+ if (!df) return EINA_FALSE;
+ df->format = format;
+ dropable = efl_key_data_get(target_obj, "__elm_dropable");
+ if (!dropable)
+ {
+ //Create new drop
+ dropable = calloc(1, sizeof(Sel_Manager_Dropable));
+ if (!dropable)
+ {
+ free(df);
+ return EINA_FALSE;
+ }
+ pd->drop_list = eina_list_append(pd->drop_list, dropable);
+ if (!pd->drop_list)
+ {
+ free(dropable);
+ free(df);
+ return EINA_FALSE;
+ }
+ dropable->obj = target_obj;
+ efl_key_data_set(target_obj, "__elm_dropable", dropable);
+ }
+
+ dropable->format_list = eina_inlist_append(dropable->format_list, EINA_INLIST_GET(df));
+ dropable->seat = seat;
+ seat_sel = _wl_sel_manager_seat_selection_init(pd, seat);
+
+ evas_object_event_callback_add(target_obj, EVAS_CALLBACK_DEL,
+ _all_drop_targets_cbs_del, pd);
+
+ if (!seat_sel->enter_handler)
+ {
+ seat_sel->enter_handler =
+ ecore_event_handler_add(ECORE_WL2_EVENT_DND_ENTER,
+ _wl_dnd_enter, seat_sel);
+ seat_sel->leave_handler =
+ ecore_event_handler_add(ECORE_WL2_EVENT_DND_LEAVE,
+ _wl_dnd_leave, seat_sel);
+ seat_sel->pos_handler =
+ ecore_event_handler_add(ECORE_WL2_EVENT_DND_MOTION,
+ _wl_dnd_position, seat_sel);
+ seat_sel->drop_handler =
+ ecore_event_handler_add(ECORE_WL2_EVENT_DND_DROP,
+ _wl_dnd_drop, seat_sel);
+ }
+
+ return EINA_TRUE;
+}
+#endif
+
+#ifdef HAVE_ELEMENTARY_COCOA
+static Sel_Manager_Seat_Selection *
+_cocoa_sel_manager_seat_selection_init(Efl_Selection_Manager_Data *pd, unsigned int seat)
+{
+ Sel_Manager_Seat_Selection *seat_sel = NULL;
+ Eina_List *l = NULL;
+
+ EINA_LIST_FOREACH(pd->seat_list, l, seat_sel)
+ {
+ if(seat_sel->seat == seat)
+ break;
+ }
+ if (!seat_sel)
+ {
+ seat_sel = calloc(1, sizeof(Sel_Manager_Seat_Selection));
+ if (!seat_sel)
+ {
+ ERR("Failed to allocate seat");
+ return NULL;
+ }
+ seat_sel->saved_types = calloc(1, sizeof(Saved_Type));
+ seat_sel->seat = seat;
+ seat_sel->pd = pd;
+ pd->seat_list = eina_list_append(pd->seat_list, seat_sel);
+ }
+ if (!seat_sel->sel)
+ {
+ Sel_Manager_Selection *sel = calloc(1, sizeof(Sel_Manager_Selection));
+ if (!sel)
+ {
+ ERR("failed to allocate selection");
+ return NULL;
+ }
+ sel->seat_sel = seat_sel;
+ seat_sel->sel = sel;
+ }
+
+ return seat_sel;
+}
+
+static Ecore_Cocoa_Window *
+_cocoa_window_get(const Evas_Object *obj)
+{
+ Evas_Object *top, *par;
+ Ecore_Cocoa_Window *win = NULL;
+
+ if (elm_widget_is(obj))
+ {
+ top = elm_widget_top_get(obj);
+ if (!top)
+ {
+ par = elm_widget_parent_widget_get(obj);
+ if (par) top = elm_widget_top_get(par);
+ }
+ if ((top) && (efl_isa(top, EFL_UI_WIN_CLASS)))
+ win = elm_win_cocoa_window_get(top);
+ }
+ if (!win)
+ {
+ // FIXME
+ CRI("WIN has not been retrieved!!!");
+ }
+
+ return win;
+}
+
+static Ecore_Cocoa_Cnp_Type
+_sel_format_to_ecore_cocoa_cnp_type(Efl_Selection_Format fmt)
+{
+ Ecore_Cocoa_Cnp_Type type = 0;
+
+ if ((fmt & EFL_SELECTION_FORMAT_TEXT) ||
+ (fmt & EFL_SELECTION_FORMAT_VCARD))
+ type |= ECORE_COCOA_CNP_TYPE_STRING;
+ if (fmt & EFL_SELECTION_FORMAT_MARKUP)
+ type |= ECORE_COCOA_CNP_TYPE_MARKUP;
+ if (fmt & EFL_SELECTION_FORMAT_HTML)
+ type |= ECORE_COCOA_CNP_TYPE_HTML;
+ if (fmt & EFL_SELECTION_FORMAT_IMAGE)
+ type |= ECORE_COCOA_CNP_TYPE_IMAGE;
+
+ return type;
+}
+
+static void
+_cocoa_sel_obj_del_req_cb(void *data,
+ Evas *e EINA_UNUSED,
+ Evas_Object *obj,
+ void *ev_info EINA_UNUSED)
+{
+ Sel_Manager_Selection *sel = data;
+ if (sel->request_obj == obj) sel->request_obj = NULL;
+}
+
+static void
+_cocoa_sel_obj_del_cb(void *data,
+ Evas *e EINA_UNUSED,
+ Evas_Object *obj,
+ void *ev_info EINA_UNUSED)
+{
+ Sel_Manager_Selection *sel = data;
+ if (sel->owner == obj)
+ {
+ sel->owner = NULL;
+ }
+ //if (dragwidget == obj) dragwidget = NULL;
+}
+
+static void
+_job_pb_cb(void *data)
+{
+ Sel_Manager_Selection *sel = data;
+ Efl_Selection_Data ddata;
+ Ecore_Cocoa_Cnp_Type type, get_type;
+ void *pbdata;
+ int pbdata_len;
+
+ if (sel->data_func)
+ {
+ ddata.pos.x = 0;
+ ddata.pos.y = 0;
+
+ /* Pass to cocoa clipboard */
+ type = _sel_format_to_ecore_cocoa_cnp_type(sel->request_format);
+ pbdata = ecore_cocoa_clipboard_get(&pbdata_len, type, &get_type);
+
+ ddata.format = EFL_SELECTION_FORMAT_NONE;
+ if (get_type & ECORE_COCOA_CNP_TYPE_STRING)
+ ddata.format |= EFL_SELECTION_FORMAT_TEXT;
+ if (get_type & ECORE_COCOA_CNP_TYPE_MARKUP)
+ ddata.format |= EFL_SELECTION_FORMAT_MARKUP;
+ if (get_type & ECORE_COCOA_CNP_TYPE_IMAGE)
+ ddata.format |= EFL_SELECTION_FORMAT_IMAGE;
+ if (get_type & ECORE_COCOA_CNP_TYPE_HTML)
+ ddata.format |= EFL_SELECTION_FORMAT_HTML;
+
+ ddata.content.mem = pbdata;
+ ddata.content.len = pbdata_len;
+ ddata.action = EFL_SELECTION_ACTION_UNKNOWN;
+ sel->data_func(sel->data_func_data, sel->request_obj, &ddata);
+ free(pbdata);
+ }
+}
+
+static Eina_Future *
+_cocoa_efl_sel_manager_selection_set(Efl_Selection_Manager_Data *pd,
+ Evas_Object *owner,
+ Efl_Selection_Type type,
+ Efl_Selection_Format format,
+ Eina_Slice data,
+ Ecore_Cocoa_Window *win,
+ unsigned int seat)
+{
+ Sel_Manager_Seat_Selection *seat_sel;
+ Sel_Manager_Selection *sel;
+ Ecore_Cocoa_Cnp_Type ecore_type;
+ Eina_List *l, *l_next;
+ Sel_Manager_Selection_Lost *sel_lost;
+
+ seat_sel = _cocoa_sel_manager_seat_selection_init(pd, seat);
+ seat_sel->active_type = type;
+ sel = seat_sel->sel;
+ if ((!data.mem) && (format != EFL_SELECTION_FORMAT_IMAGE))
+ {
+ efl_selection_manager_selection_clear(pd->sel_man, owner, type, seat);
+ return NULL;
+ }
+ if (data.len <= 0) return NULL;
+
+ EINA_LIST_FOREACH_SAFE(seat_sel->sel_lost_list, l, l_next, sel_lost)
+ {
+ if ((sel_lost->request == sel->owner) &&
+ (sel_lost->type == type))
+ {
+ eina_promise_resolve(sel_lost->promise, eina_value_uint_init(sel_lost->type));
+ seat_sel->sel_lost_list = eina_list_remove(seat_sel->sel_lost_list, sel_lost);
+ free(sel_lost);
+ }
+ }
+ if (sel->owner)
+ evas_object_event_callback_del_full(sel->owner, EVAS_CALLBACK_DEL,
+ _cocoa_sel_obj_del_cb, sel);
+
+ sel->owner = owner;
+ sel->win = win;
+ sel->format = format;
+
+ evas_object_event_callback_add(sel->owner, EVAS_CALLBACK_DEL,
+ _cocoa_sel_obj_del_cb, sel);
+ ELM_SAFE_FREE(sel->data.mem, free);
+ sel->data = eina_slice_dup(data);
+ if (sel->data.mem)
+ {
+ ecore_type = _sel_format_to_ecore_cocoa_cnp_type(format);
+ ecore_cocoa_clipboard_set(sel->data.mem, sel->data.len, ecore_type);
+ }
+ else
+ {
+ CRI("Failed to allocate memory!");
+ efl_selection_manager_selection_clear(pd->sel_man, owner, type, seat_sel->seat);
+ return NULL;
+ }
+
+ return _update_sel_lost_list(owner, type, seat_sel);
+}
+
+static void
+_cocoa_efl_sel_manager_selection_get(const Efl_Object *request,
+ Efl_Selection_Manager_Data *pd,
+ Efl_Selection_Type type EINA_UNUSED,
+ Efl_Selection_Format format,
+ void *data_func_data, Efl_Selection_Data_Ready data_func, Eina_Free_Cb data_func_free_cb,
+ Ecore_Cocoa_Window *win, unsigned int seat)
+{
+ Sel_Manager_Seat_Selection *seat_sel;
+ Sel_Manager_Selection *sel;
+
+ seat_sel = _sel_manager_seat_selection_init(pd, seat);
+ sel = seat_sel->sel;
+ sel->request_format = format;
+ sel->request_obj = (Efl_Object *)request;
+ sel->data_func_data = data_func_data;
+ sel->data_func = data_func;
+ sel->data_func_free_cb = data_func_free_cb;
+ if (sel->request_obj)
+ evas_object_event_callback_del_full(sel->request_obj, EVAS_CALLBACK_DEL,
+ _cocoa_sel_obj_del_req_cb, sel);
+
+ sel->win = win;
+ ecore_job_add(_job_pb_cb, sel);
+
+ evas_object_event_callback_add(sel->request_obj, EVAS_CALLBACK_DEL,
+ _cocoa_sel_obj_del_req_cb, sel);
+}
+
+#endif
+
+// win32 specific stuff
+////////////////////////////////////////////////////////////////////////////
+#ifdef HAVE_ELEMENTARY_WIN32
+static Sel_Manager_Seat_Selection *
+_win32_sel_manager_seat_selection_init(Efl_Selection_Manager_Data *pd, unsigned int seat)
+{
+ Sel_Manager_Seat_Selection *seat_sel = NULL;
+ Eina_List *l = NULL;
+
+ EINA_LIST_FOREACH(pd->seat_list, l, seat_sel)
+ {
+ if(seat_sel->seat == seat)
+ break;
+ }
+ if (!seat_sel)
+ {
+ seat_sel = calloc(1, sizeof(Sel_Manager_Seat_Selection));
+ if (!seat_sel)
+ {
+ ERR("Failed to allocate seat");
+ return NULL;
+ }
+ seat_sel->saved_types = calloc(1, sizeof(Saved_Type));
+ seat_sel->seat = seat;
+ seat_sel->pd = pd;
+ pd->seat_list = eina_list_append(pd->seat_list, seat_sel);
+ }
+ if (!seat_sel->sel_list)
+ {
+ seat_sel->sel_list = calloc(1, (EFL_SELECTION_TYPE_CLIPBOARD + 1) * sizeof(Sel_Manager_Selection));
+ if (!seat_sel->sel_list)
+ {
+ ERR("failed to allocate selection list");
+ return NULL;
+ }
+ _set_selection_list(seat_sel->sel_list, seat_sel);
+ }
+
+ return seat_sel;
+}
+
+static char *
+_win32_text_n_to_rn(char *intext)
+{
+ size_t size = 0, newlines = 0;
+ char *outtext = NULL, *p, *o;
+
+ if (!intext) return NULL;
+ for (p = intext; *p; p++)
+ {
+ if (*p == '\n') newlines++;
+ size++;
+ }
+ outtext = malloc(size + newlines + 1);
+ if (!outtext) return intext;
+ for (p = intext, o = outtext; *p; p++, o++)
+ {
+ if (*p == '\n')
+ {
+ o++;
+ *p = '\r';
+ }
+ *o = *p;
+ }
+ *o = '\0';
+ free(intext);
+ return outtext;
+}
+
+static void
+_win32_sel_obj_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
+{
+ Sel_Manager_Selection *sel = data;
+ if (sel->owner == obj) sel->owner = NULL;
+}
+
+static void
+_win32_sel_obj_del2(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
+{
+ Sel_Manager_Selection *sel = data;
+ if (sel->request_obj == obj) sel->request_obj = NULL;
+}
+
+static Ecore_Win32_Window *
+_win32_window_get(const Evas_Object *obj)
+{
+ Evas_Object *top;
+ Ecore_Win32_Window *win = NULL;
+
+ if (elm_widget_is(obj))
+ {
+ top = elm_widget_top_get(obj);
+ if (!top)
+ {
+ Evas_Object *par;
+ par = elm_widget_parent_widget_get(obj);
+ if (par) top = elm_widget_top_get(par);
+ }
+ if (top && (efl_isa(top, EFL_UI_WIN_CLASS)))
+ win = elm_win_win32_window_get(top);
+ }
+
+ if (!win)
+ {
+ Ecore_Evas *ee;
+ Evas *evas;
+ const char *engine_name;
+
+ evas = evas_object_evas_get(obj);
+ if (!evas) return NULL;
+
+ ee = ecore_evas_ecore_evas_get(evas);
+ if (!ee) return NULL;
+
+ engine_name = ecore_evas_engine_name_get(ee);
+ if (!strcmp(engine_name, ELM_BUFFER))
+ {
+ ee = ecore_evas_buffer_ecore_evas_parent_get(ee);
+ if (!ee) return NULL;
+ win = ecore_evas_win32_window_get(ee);
+ }
+ else
+ {
+ if ((strcmp(engine_name, ELM_SOFTWARE_WIN32) == 0) ||
+ (strcmp(engine_name, ELM_SOFTWARE_DDRAW) == 0))
+ return ecore_evas_win32_window_get(ee);
+ }
+ }
+
+ return win;
+}
+
+static Eina_Future *
+_win32_efl_sel_manager_selection_set(Efl_Selection_Manager_Data *pd,
+ Evas_Object *owner,
+ Efl_Selection_Type type,
+ Efl_Selection_Format format,
+ Eina_Slice data,
+ Ecore_Win32_Window *win,
+ unsigned int seat)
+{
+ Sel_Manager_Seat_Selection *seat_sel;
+ Sel_Manager_Selection *sel;
+
+ if (type != EFL_SELECTION_TYPE_CLIPBOARD)
+ return NULL;
+
+ if ((!data.mem) && (format != EFL_SELECTION_FORMAT_IMAGE))
+ {
+ efl_selection_manager_selection_clear(pd->sel_man, owner, type, seat);
+ return NULL;
+ }
+
+ seat_sel = _win32_sel_manager_seat_selection_init(pd, seat);
+ seat_sel->active_type = type;
+ sel = seat_sel->sel_list + type;
+ if (sel->owner != owner)
+ {
+ Eina_List *l, *l_next;
+ Sel_Manager_Selection_Lost *sel_lost;
+
+ EINA_LIST_FOREACH_SAFE(seat_sel->sel_lost_list, l, l_next, sel_lost)
+ {
+ if ((sel_lost->request == sel->owner) &&
+ (sel_lost->type == type))
+ {
+ eina_promise_resolve(sel_lost->promise, eina_value_uint_init(sel_lost->type));
+ seat_sel->sel_lost_list = eina_list_remove(seat_sel->sel_lost_list, sel_lost);
+ free(sel_lost);
+ }
+ }
+
+ }
+ if (sel->owner)
+ evas_object_event_callback_del_full(sel->owner, EVAS_CALLBACK_DEL,
+ _win32_sel_obj_del, sel);
+ sel->active = EINA_TRUE;
+ sel->owner = owner;
+ sel->win = win;
+ if (sel->set) sel->set(win, sel->data.mem, sel->data.len);
+ sel->format = format;
+
+ evas_object_event_callback_add
+ (sel->owner, EVAS_CALLBACK_DEL, _win32_sel_obj_del, sel);
+
+ ELM_SAFE_FREE(sel->data.mem, free);
+ sel->data = eina_slice_dup(data);
+ if (!sel->data.mem)
+ {
+ efl_selection_manager_selection_clear(pd->sel_man, owner, type, seat_sel->seat);
+ return NULL;
+ }
+
+ return _update_sel_lost_list(owner, type, seat_sel);
+}
+
+static void
+_win32_efl_sel_manager_selection_clear(Efl_Selection_Manager_Data *pd,
+ Evas_Object *owner,
+ Efl_Selection_Type type,
+ Sel_Manager_Seat_Selection *seat_sel)
+{
+ Sel_Manager_Selection *sel;
+ Ecore_Win32_Window *win;
+
+ if (type != EFL_SELECTION_TYPE_CLIPBOARD)
+ return;
+
+ sel = seat_sel->sel_list + type;
+
+ /* No longer this selection: Consider it gone! */
+ if ((!sel->active) || (sel->owner != owner))
+ return;
+
+ if (sel->owner)
+ evas_object_event_callback_del_full(sel->owner, EVAS_CALLBACK_DEL,
+ _win32_sel_obj_del, sel);
+ if (sel->request_obj)
+ evas_object_event_callback_del_full(sel->request_obj, EVAS_CALLBACK_DEL,
+ _win32_sel_obj_del2, sel);
+ sel->owner = NULL;
+ sel->request_obj = NULL;
+ sel->active = EINA_FALSE;
+ ELM_SAFE_FREE(sel->data.mem, free);
+ /* sel->clear(win); */
+}
+
+static Eina_Bool
+_win32_efl_sel_manager_selection_get(const Efl_Object *request,
+ Efl_Selection_Manager_Data *pd,
+ Efl_Selection_Type type, Efl_Selection_Format format,
+ void *data_func_data, Efl_Selection_Data_Ready data_func,
+ Eina_Free_Cb data_func_free_cb,
+ Ecore_Win32_Window *win, unsigned int seat)
+{
+ Sel_Manager_Seat_Selection *seat_sel;
+ Sel_Manager_Selection *sel;
+ void *data;
+ int size;
+
+ if (type != EFL_SELECTION_TYPE_CLIPBOARD)
+ return EINA_FALSE;
+
+ seat_sel = _sel_manager_seat_selection_init(pd, seat);
+ sel = seat_sel->sel_list + type;
+
+ if (sel->request_obj)
+ evas_object_event_callback_del_full(sel->request_obj, EVAS_CALLBACK_DEL,
+ _win32_sel_obj_del2, sel);
+ sel->request_format = format;
+ sel->request_obj = (Evas_Object *)request;
+ sel->win = win;
+ sel->data_func_data = data_func_data;
+ sel->data_func = data_func;
+ sel->data_func_free_cb = data_func_free_cb;
+ sel->get(win, &data, &size);
+
+ if (!data || (size <= 0))
+ goto cb_add;
+
+ if ((sel->format & EFL_SELECTION_FORMAT_MARKUP) ||
+ (sel->format & EFL_SELECTION_FORMAT_HTML))
+ {
+ char *str;
+
+ str = (char *)malloc(size + 1);
+ if (str)
+ {
+ memcpy(str, data, size);
+ str[size] = '\0';
+ data = _win32_text_n_to_rn(_elm_util_mkup_to_text(str));
+ free(str);
+ if (data)
+ size = strlen(data);
+ else
+ size = 0;
+ }
+ else
+ {
+ free(data);
+ data = NULL;
+ }
+ }
+
+ if (sel->data_func && data && (size > 0))
+ {
+ Efl_Selection_Data sdata;
+
+ sdata.pos.x = sdata.pos.y = 0;
+ sdata.format = EFL_SELECTION_FORMAT_TEXT;
+ sdata.content.mem = data;
+ sdata.content.len = size;
+ sdata.action = sel->action;
+ sel->data_func(sel->data_func_data, sel->request_obj, &sdata);
+ }
+
+ if (data)
+ free(data);
+
+ cb_add:
+ evas_object_event_callback_add
+ (sel->request_obj, EVAS_CALLBACK_DEL, _win32_sel_obj_del2, sel);
+
+ return EINA_TRUE;
+}
+
+#endif /* HAVE_ELEMENTARY_WIN32 */
+
+
+static int
+_drop_item_container_cmp(const void *d1, const void *d2)
+{
+ const Item_Container_Drop_Info *di = d1;
+ return (((uintptr_t)di->obj) - ((uintptr_t)d2));
+}
+
+static Eina_Bool
+_drop_item_container_del(Efl_Selection_Manager_Data *pd, Efl_Object *cont, Eina_Bool full)
+{
+ Item_Container_Drop_Info *di;
+
+ di = eina_list_search_unsorted(pd->drop_cont_list,
+ _drop_item_container_cmp, cont);
+ if (di)
+ {
+ _all_drop_targets_cbs_del(pd, NULL, cont, NULL);
+ di->item_func_data = NULL;
+ di->item_func = NULL;
+
+ if (full)
+ {
+ pd->drop_cont_list = eina_list_remove(pd->drop_cont_list, di);
+ free(di);
+ }
+ return EINA_TRUE;
+ }
+
+ return EINA_FALSE;
+}
+
+static inline Eina_List *
+_anim_icons_make(Sel_Manager_Drag_Container *dc)
+{
+ Eina_List *list = NULL, *icon_list = NULL;
+ Evas_Object *obj;
+
+ if (dc->icon_list_func)
+ {
+ DBG("calling icon_list_func");
+ icon_list = dc->icon_list_func(dc->icon_list_func_data, dc->cont);
+ }
+ EINA_LIST_FREE(icon_list, obj)
+ {
+ DBG("one obj in icon_list");
+ Anim_Icon *ai = calloc(1, sizeof(Anim_Icon));
+ if (!ai)
+ {
+ ERR("Failed to allocate for icon!");
+ continue;
+ }
+
+ evas_object_geometry_get(obj, &ai->start.x, &ai->start.y, &ai->start.w, &ai->start.h);
+ evas_object_show(obj);
+ ai->obj = obj;
+ list = eina_list_append(list, ai);
+ }
+ DBG("made icon list");
+
+ return list;
+}
+
+static void
+_cont_obj_drag_done_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Sel_Manager_Drag_Container *dc = data;
+ elm_widget_scroll_freeze_pop(dc->cont);
+}
+
+static Eina_Bool
+_cont_obj_drag_start(void *data)
+{
+ DBG("going to start draging");
+ Sel_Manager_Drag_Container *dc = data;
+
+ dc->timer = NULL;
+ efl_event_callback_add(dc->cont, EFL_UI_DND_EVENT_DRAG_DONE, _cont_obj_drag_done_cb, dc);
+ elm_widget_scroll_freeze_push(dc->cont);
+ efl_selection_manager_drag_start(dc->pd->sel_man, dc->cont, dc->format,
+ eina_rw_slice_slice_get(dc->data), dc->action,
+ dc->icon_func_data, dc->icon_func, dc->icon_func_free_cb,
+ dc->seat);
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static Eina_Bool
+_drag_anim_play(void *data, double pos)
+{
+ Sel_Manager_Drag_Container *dc = data;
+
+ if (dc->animator)
+ {
+ Eina_List *l;
+ Anim_Icon *ai;
+ Evas_Coord xm, ym;
+
+ if (pos > 0.99)
+ {
+ dc->animator = NULL;
+ EINA_LIST_FOREACH(dc->icons, l, ai)
+ evas_object_hide(ai->obj);
+
+ _cont_obj_drag_start(dc);
+ return ECORE_CALLBACK_CANCEL;
+ }
+
+ evas_pointer_canvas_xy_get(dc->e, &xm, &ym);
+ EINA_LIST_FOREACH(dc->icons, l, ai)
+ {
+ int x, y, w, h;
+ w = ai->start.w - ((dc->final_icon.w - ai->start.w) * pos);
+ h = ai->start.h - ((dc->final_icon.h - ai->start.h) * pos);
+ x = ai->start.x - (pos * (ai->start.x + (w / 2) - xm));
+ y = ai->start.y - (pos * (ai->start.y + (h / 2) - ym));
+ evas_object_move(ai->obj, x, y);
+ evas_object_resize(ai->obj, w, h);
+ }
+
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static inline void
+_drag_anim_start(Sel_Manager_Drag_Container *dc)
+{
+
+ dc->timer = NULL;
+ if (dc->icon_func)
+ {
+ Eina_Position2D pos_ret;
+ Evas_Object *temp_win = elm_win_add(NULL, "Temp", ELM_WIN_DND);
+ Evas_Object *final_icon = dc->icon_func(dc->icon_func_data, temp_win, dc->cont, &pos_ret);
+ evas_object_geometry_get(final_icon, NULL, NULL, &dc->final_icon.w, &dc->final_icon.h);
+ evas_object_del(final_icon);
+ evas_object_del(temp_win);
+ }
+ dc->animator = ecore_animator_timeline_add(dc->anim_duration, _drag_anim_play, dc);
+}
+
+static Eina_Bool
+_cont_obj_anim_start(void *data)
+{
+ sel_debug("In");
+ Sel_Manager_Drag_Container *dc = data;
+ Efl_Object *it = NULL;
+ Eina_Position2D posret; //does not use
+
+ if (dc->item_get_func)
+ it = dc->item_get_func(dc->item_get_func_data, dc->cont, dc->down, &posret);
+ dc->timer = NULL;
+ dc->format = EFL_SELECTION_FORMAT_TARGETS; //default
+ dc->data.len = 0;
+ dc->action = EFL_SELECTION_ACTION_COPY; //default
+ dc->icons = NULL;
+
+ //failed to get mouse-down item, abort drag
+ if (!it)
+ return ECORE_CALLBACK_CANCEL;
+
+ if (dc->drag_data_func)
+ {
+ dc->drag_data_func(dc->drag_data_func_data, dc->cont,
+ &dc->format, &dc->data, &dc->action);
+ if (EINA_DBL_EQ(dc->anim_duration, 0.0))
+ {
+ _cont_obj_drag_start(dc);
+ }
+ else
+ {
+ dc->icons = _anim_icons_make(dc);
+ if (dc->icons)
+ {
+ _drag_anim_start(dc);
+ }
+ else
+ {
+ // even if we don't manage the icons animation, we have
+ // to wait until it is finished before beginning drag.
+ dc->timer = ecore_timer_add(dc->anim_duration,
+ _cont_obj_drag_start, dc);
+ }
+ }
+ }
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static void
+_abort_drag(Evas_Object *obj EINA_UNUSED, Sel_Manager_Drag_Container *dc)
+{
+ evas_object_event_callback_del_full(dc->cont, EVAS_CALLBACK_MOUSE_MOVE,
+ _cont_obj_mouse_move_cb, dc);
+ evas_object_event_callback_del_full(dc->cont, EVAS_CALLBACK_MOUSE_UP,
+ _cont_obj_mouse_up_cb, dc);
+ _item_container_del_internal(dc, EINA_FALSE);
+
+ ELM_SAFE_FREE(dc->timer, ecore_timer_del);
+ _anim_data_free(dc);
+}
+
+static void
+_cont_obj_mouse_move_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info)
+{
+ Sel_Manager_Drag_Container *dc = data;
+ Evas_Event_Mouse_Move *ev = event_info;
+
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
+ {
+ _abort_drag(obj, dc);
+ }
+ if (dc &&
+ (evas_device_class_get(ev->dev) == EVAS_DEVICE_CLASS_TOUCH))
+ {
+ int dx, dy;
+ int fs = elm_config_finger_size_get();
+
+ dx = ev->cur.canvas.x - dc->down.x;
+ dy = ev->cur.canvas.y - dc->down.y;
+ if ((dx * dx + dy * dy) > (fs * fs))
+ {
+ sel_debug("mouse moved too much - have to cancel DnD");
+ _abort_drag(obj, dc);
+ }
+ }
+}
+
+static void
+_anim_data_free(Sel_Manager_Drag_Container *dc)
+{
+ if (dc)
+ {
+ ELM_SAFE_FREE(dc->animator, ecore_animator_del);
+ Anim_Icon *ai;
+
+ EINA_LIST_FREE(dc->icons, ai)
+ {
+ evas_object_del(ai->obj);
+ free(ai);
+ }
+ dc->icons = NULL;
+ }
+}
+
+static void
+_cont_obj_mouse_up_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
+{
+ Sel_Manager_Drag_Container *dc = data;
+
+ if (((Evas_Event_Mouse_Up *)event_info)->button != 1)
+ return;
+
+ evas_object_event_callback_del_full(dc->cont, EVAS_CALLBACK_MOUSE_MOVE,
+ _cont_obj_mouse_move_cb, dc);
+ evas_object_event_callback_del_full(dc->cont, EVAS_CALLBACK_MOUSE_UP,
+ _cont_obj_mouse_up_cb, dc);
+ ELM_SAFE_FREE(dc->timer, ecore_timer_del);
+
+ _anim_data_free(dc);
+}
+
+static void
+_cont_obj_mouse_down_cb(void *data, Evas *e, Evas_Object *obj EINA_UNUSED, void *event_info)
+{
+ Sel_Manager_Drag_Container *dc = data;
+ Evas_Event_Mouse_Down *ev = event_info;
+ if (ev->button != 1)
+ return;
+
+ dc->e = e;
+ dc->down.x = ev->canvas.x;
+ dc->down.y = ev->canvas.y;
+
+ evas_object_event_callback_add(dc->cont, EVAS_CALLBACK_MOUSE_UP,
+ _cont_obj_mouse_up_cb, dc);
+ ecore_timer_del(dc->timer);
+ if (dc->time_to_drag)
+ {
+ dc->timer = ecore_timer_add(dc->time_to_drag, _cont_obj_anim_start, dc);
+ evas_object_event_callback_add(dc->cont, EVAS_CALLBACK_MOUSE_MOVE,
+ _cont_obj_mouse_move_cb, dc);
+ }
+ else
+ {
+ _cont_obj_anim_start(dc);
+ }
+}
+
+static void
+_item_container_del_internal(Sel_Manager_Drag_Container *dc, Eina_Bool full)
+{
+ if (dc)
+ {
+ ELM_SAFE_FREE(dc->timer, ecore_timer_del);
+ if (dc->animator)
+ _anim_data_free(dc);
+ evas_object_event_callback_del_full(dc->cont, EVAS_CALLBACK_MOUSE_DOWN,
+ _cont_obj_mouse_down_cb, dc);
+ if (full)
+ {
+ dc->item_get_func = NULL;
+ dc->item_get_func_data = NULL;
+ free(dc);
+ }
+ }
+}
+
+static int
+_drag_item_container_cmp(const void *d1, const void *d2)
+{
+ const Sel_Manager_Drag_Container *dc = d1;
+ return (((uintptr_t)dc->cont) - ((uintptr_t)d2));
+}
+//exposed APIs
+EOLIAN static Eina_Future *
+_efl_selection_manager_selection_set(Eo *obj EINA_UNUSED, Efl_Selection_Manager_Data *pd,
+ Efl_Object *owner, Efl_Selection_Type type,
+ Efl_Selection_Format format,
+ Eina_Slice data, unsigned int seat)
+{
+ Eina_Future *p = NULL;
+
+ sel_debug("owner: %p, seat: %d, type: %d, format: %d", owner, seat, type, format);
+ if (type > EFL_SELECTION_TYPE_CLIPBOARD)
+ {
+ ERR("Not supported format: %d", type);
+ return NULL;
+ }
+
+#ifdef HAVE_ELEMENTARY_X
+ Ecore_X_Window xwin = _x11_xwin_get(owner);
+ if (xwin)
+ p = _x11_efl_sel_manager_selection_set(pd, owner, type, format, data, xwin, seat);
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ Ecore_Wl2_Window *win = _wl_window_get(owner);
+ if (win)
+ p = _wl_efl_sel_manager_selection_set(pd, owner, type, format, data, win, seat);
+#endif
+#ifdef HAVE_ELEMENTARY_COCOA
+ Ecore_Cocoa_Window *win = _cocoa_window_get(owner);
+ if (win)
+ p = _cocoa_efl_sel_manager_selection_set(pd, owner, type, format, data, win, seat);
+#endif
+#ifdef HAVE_ELEMENTARY_WIN32
+ Ecore_Win32_Window *win = _win32_window_get(owner);
+ if (win)
+ p = _win32_efl_sel_manager_selection_set(pd, owner, type, format, data, win, seat);
+#endif
+
+ return p;
+}
+
+//TODO: add support for local
+EOLIAN static void
+_efl_selection_manager_selection_get(Eo *obj EINA_UNUSED, Efl_Selection_Manager_Data *pd,
+ const Efl_Object *request, Efl_Selection_Type type,
+ Efl_Selection_Format format,
+ void *data_func_data, Efl_Selection_Data_Ready data_func,
+ Eina_Free_Cb data_func_free_cb, unsigned int seat)
+{
+ sel_debug("request: %p, seat: %d, type: %d, format: %d", request, seat, type, format);
+#ifdef HAVE_ELEMENTARY_X
+ Ecore_X_Window xwin = _x11_xwin_get(request);
+ if (xwin)
+ _x11_efl_sel_manager_selection_get(request, pd, type, format, data_func_data,
+ data_func, data_func_free_cb, xwin, seat);
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ Ecore_Wl2_Window *win = _wl_window_get(request);
+ if (win)
+ _wl_efl_sel_manager_selection_get(request, pd, type, format, data_func_data,
+ data_func, data_func_free_cb, win, seat);
+#endif
+#ifdef HAVE_ELEMENTARY_COCOA
+ Ecore_Cocoa_Window *win = _cocoa_window_get(request);
+ if (win)
+ _cocoa_efl_sel_manager_selection_get(request, pd, type, format, data_func_data,
+ data_func, data_func_free_cb, win, seat);
+#endif
+#ifdef HAVE_ELEMENTARY_WIN32
+ Ecore_Win32_Window *win = _win32_window_get(request);
+ if (win)
+ _win32_efl_sel_manager_selection_get(request, pd, type, format, data_func_data,
+ data_func, data_func_free_cb, win, seat);
+#endif
+}
+
+EOLIAN static void
+_efl_selection_manager_selection_clear(Eo *obj, Efl_Selection_Manager_Data *pd,
+ Efl_Object *owner, Efl_Selection_Type type, unsigned int seat)
+{
+ Eina_Bool local = EINA_FALSE;
+ Sel_Manager_Seat_Selection *seat_sel;
+ Sel_Manager_Selection *sel = NULL;
+
+ sel_debug("owner: %p, seat: %d, type: %d", owner, seat, type);
+ seat_sel = _sel_manager_seat_selection_init(pd, seat);
+#ifdef HAVE_ELEMENTARY_X
+ Ecore_X_Window xwin = _x11_xwin_get(obj);
+ if (xwin)
+ {
+ sel = seat_sel->sel_list + type;
+ }
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ Ecore_Wl2_Window *win = _wl_window_get(obj);
+ if (win)
+ {
+ sel = seat_sel->sel;
+ }
+#endif
+#ifdef HAVE_ELEMENTARY_COCOA
+ Ecore_Cocoa_Window *win = _cocoa_window_get(obj);
+ if (win)
+ {
+ sel = seat_sel->sel;
+ }
+#endif
+#ifdef HAVE_ELEMENTARY_WIN32
+ Ecore_Win32_Window *win = _win32_window_get(obj);
+ {
+ sel = seat_sel->sel_list + type;
+ }
+#endif
+ if (!sel) return;
+ if ((!sel->active) && (sel->owner != owner))
+ {
+ return;
+ }
+ sel->active = EINA_FALSE;
+#ifdef HAVE_ELEMENTARY_X
+ if (xwin)
+ {
+ seat_sel->sel_list[type].data.len = 0;
+ if (seat_sel->sel_list[type].data.mem)
+ {
+ free(seat_sel->sel_list[type].data.mem);
+ seat_sel->sel_list[type].data.mem = NULL;
+ }
+ if (sel->xwin != 0) local = EINA_TRUE;
+ if (!local) seat_sel->sel_list[type].clear();
+ else
+ {
+ Eina_List *l, *l_next;
+ Sel_Manager_Selection_Lost *sel_lost;
+
+ EINA_LIST_FOREACH_SAFE(seat_sel->sel_lost_list, l, l_next, sel_lost)
+ {
+ if ((sel_lost->request == sel->owner) &&
+ (sel_lost->type == type))
+ {
+ eina_promise_resolve(sel_lost->promise, eina_value_uint_init(sel_lost->type));
+ seat_sel->sel_lost_list = eina_list_remove(seat_sel->sel_lost_list, sel_lost);
+ free(sel_lost);
+ }
+ }
+ seat_sel->sel_list[type].owner = NULL;
+ }
+ }
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ if (win)
+ {
+ sel->selection_serial = ecore_wl2_dnd_selection_clear(_wl_seat_get(_wl_window_get(owner), owner, seat));
+ }
+#endif
+#ifdef HAVE_ELEMENTARY_COCOA
+ if (win)
+ {
+ if (sel->owner)
+ evas_object_event_callback_del_full(sel->owner, EVAS_CALLBACK_DEL,
+ _cocoa_sel_obj_del_cb, sel);
+ if (sel->request_obj)
+ evas_object_event_callback_del_full(sel->request_obj, EVAS_CALLBACK_DEL,
+ _cocoa_sel_obj_del_req_cb, sel);
+ sel->owner = NULL;
+ sel->request_obj = NULL;
+ ELM_SAFE_FREE(sel->data.mem, free);
+ sel->data.len = 0;
+
+ ecore_cocoa_clipboard_clear();
+ }
+#endif
+#ifdef HAVE_ELEMENTARY_WIN32
+ if (win)
+ {
+ _win32_efl_sel_manager_selection_clear(pd, owner, type, seat_sel);
+ }
+#endif
+}
+
+EOLIAN static Eina_Bool
+_efl_selection_manager_selection_has_owner(Eo *obj EINA_UNUSED, Efl_Selection_Manager_Data *pd EINA_UNUSED,
+ Efl_Object *request, Efl_Selection_Type type,
+ unsigned int seat)
+{
+#ifdef HAVE_ELEMENTARY_X
+ (void)seat;
+ if (_x11_xwin_get(request))
+ {
+ Ecore_X_Atom xtype;
+ switch (type)
+ {
+ case EFL_SELECTION_TYPE_PRIMARY:
+ xtype = ECORE_X_ATOM_SELECTION_PRIMARY;
+ break;
+ case EFL_SELECTION_TYPE_SECONDARY:
+ xtype = ECORE_X_ATOM_SELECTION_SECONDARY;
+ break;
+ case EFL_SELECTION_TYPE_DND:
+ xtype = ECORE_X_ATOM_SELECTION_XDND;
+ break;
+ default:
+ xtype = ECORE_X_ATOM_SELECTION_CLIPBOARD;
+ }
+ return !!ecore_x_selection_owner_get(xtype);
+ }
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ Ecore_Wl2_Window *win;
+
+ win = _wl_window_get(request);
+ if (win)
+ return !!ecore_wl2_dnd_selection_get(_wl_seat_get(win, request, seat));
+#endif
+ return EINA_FALSE;
+}
+
+EOLIAN static void
+_efl_selection_manager_drag_start(Eo *obj, Efl_Selection_Manager_Data *pd,
+ Efl_Object *drag_obj, Efl_Selection_Format format,
+ Eina_Slice data, Efl_Selection_Action action,
+ void *icon_func_data, Efl_Dnd_Drag_Icon_Create icon_func,
+ Eina_Free_Cb icon_func_free_cb, unsigned int seat)
+{
+#ifdef HAVE_ELEMENTARY_X
+ Ecore_X_Window xwin = _x11_xwin_get(drag_obj);
+ if (xwin)
+ _x11_efl_sel_manager_drag_start(obj, pd, drag_obj, format, data, action,
+ icon_func_data, icon_func, icon_func_free_cb,
+ xwin, seat);
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ Ecore_Wl2_Window *win = _wl_window_get(drag_obj);
+ if (win)
+ _wl_efl_sel_manager_drag_start(obj, pd, drag_obj, format, data, action,
+ icon_func_data, icon_func, icon_func_free_cb,
+ win, seat);
+#endif
+#ifdef HAVE_ELEMENTARY_WIN32
+#endif
+#ifdef HAVE_ELEMENTARY_COCOA
+#endif
+}
+
+EOLIAN static void
+_efl_selection_manager_drag_cancel(Eo *obj EINA_UNUSED, Efl_Selection_Manager_Data *pd,
+ Efl_Object *drag_obj, unsigned int seat)
+{
+ Sel_Manager_Seat_Selection *seat_sel = _sel_manager_seat_selection_init(pd, seat);
+
+#ifdef HAVE_ELEMENTARY_X
+ Ecore_X_Window xwin = _x11_xwin_get(drag_obj);
+ if (xwin)
+ {
+ ecore_x_pointer_ungrab();
+ ELM_SAFE_FREE(seat_sel->mouse_up_handler, ecore_event_handler_del);
+ ELM_SAFE_FREE(seat_sel->dnd_status_handler, ecore_event_handler_del);
+ ecore_x_dnd_abort(xwin);
+ if (seat_sel->drag_obj)
+ {
+ if (elm_widget_is(seat_sel->drag_obj))
+ {
+ Evas_Object *win = elm_widget_top_get(seat_sel->drag_obj);
+ if (win && efl_isa(win, EFL_UI_WIN_CLASS))
+ efl_event_callback_del(win, EFL_UI_WIN_EVENT_ROTATION_CHANGED,
+ _x11_win_rotation_changed_cb, seat_sel->drag_win);
+ }
+ }
+ seat_sel->drag_obj = NULL;
+ }
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ Ecore_Wl2_Window *win;
+
+ win = _wl_window_get(drag_obj);
+ if (win)
+ ecore_wl2_dnd_drag_end(_wl_seat_get(win, drag_obj, seat));
+#endif
+
+ ELM_SAFE_FREE(seat_sel->drag_win, evas_object_del);
+}
+
+EOLIAN static void
+_efl_selection_manager_drag_action_set(Eo *obj EINA_UNUSED, Efl_Selection_Manager_Data *pd,
+ Efl_Object *drag_obj, Efl_Selection_Action action,
+ unsigned int seat)
+{
+ Sel_Manager_Seat_Selection *seat_sel = _sel_manager_seat_selection_init(pd, seat);
+ if (seat_sel->drag_action == action) return;
+ seat_sel->drag_action = action;
+#ifdef HAVE_ELEMENTARY_X
+ Ecore_X_Atom actx;
+ Ecore_X_Window xwin = _x11_xwin_get(drag_obj);
+ if (xwin)
+ {
+ actx = _x11_dnd_action_rev_map(action);
+ ecore_x_dnd_source_action_set(actx);
+ }
+#endif
+}
+
+//drop side
+EOLIAN static Eina_Bool
+_efl_selection_manager_drop_target_add(Eo *obj EINA_UNUSED, Efl_Selection_Manager_Data *pd,
+ Efl_Object *target_obj, Efl_Selection_Format format,
+ unsigned int seat)
+{
+ Eina_Bool ret = EINA_FALSE;
+#ifdef HAVE_ELEMENTARY_X
+ Ecore_X_Window xwin = _x11_xwin_get(target_obj);
+ if (xwin)
+ ret = _x11_sel_manager_drop_target_add(pd, target_obj, format, xwin, seat);
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ Ecore_Wl2_Window *win = _wl_window_get(target_obj);
+ if (win)
+ ret = _wl_sel_manager_drop_target_add(pd, target_obj, format, seat);
+#endif
+ return ret;
+}
+
+EOLIAN static void
+_efl_selection_manager_drop_target_del(Eo *obj EINA_UNUSED, Efl_Selection_Manager_Data *pd,
+ Efl_Object *target_obj, Efl_Selection_Format format,
+ unsigned int seat)
+{
+ Sel_Manager_Dropable *dropable = NULL;
+ Sel_Manager_Seat_Selection *seat_sel;
+
+ dropable = efl_key_data_get(target_obj, "__elm_dropable");
+ if (dropable)
+ {
+ Eina_Inlist *itr;
+ Drop_Format *df;
+ EINA_INLIST_FOREACH_SAFE(dropable->format_list, itr, df)
+ {
+ if (df->format == format)
+ {
+ dropable->format_list = eina_inlist_remove(dropable->format_list,
+ EINA_INLIST_GET(df));
+ free(df);
+ }
+ }
+ if (!dropable->format_list)
+ {
+ pd->drop_list = eina_list_remove(pd->drop_list, dropable);
+ efl_key_data_set(target_obj, "__elm_dropable", NULL);
+ free(dropable);
+ evas_object_event_callback_del(target_obj, EVAS_CALLBACK_DEL,
+ _all_drop_targets_cbs_del);
+ }
+ }
+
+#ifdef HAVE_ELEMENTARY_X
+ if (pd->drop_list)
+ {
+ Eina_List *l;
+ Ecore_X_Window xwin;
+ Eina_Bool have_drop_list = EINA_FALSE;
+
+ xwin = _x11_xwin_get(target_obj);
+ EINA_LIST_FOREACH(pd->drop_list, l, dropable)
+ {
+ if (xwin == _x11_xwin_get(dropable->obj))
+ {
+ have_drop_list = EINA_TRUE;
+ break;
+ }
+ }
+ if (!have_drop_list) ecore_x_dnd_aware_set(xwin, EINA_FALSE);
+ }
+#endif
+ seat_sel = _sel_manager_seat_selection_init(pd, seat);
+ ELM_SAFE_FREE(seat_sel->pos_handler, ecore_event_handler_del);
+ ELM_SAFE_FREE(seat_sel->drop_handler, ecore_event_handler_del);
+ ELM_SAFE_FREE(seat_sel->enter_handler, ecore_event_handler_del);
+ ELM_SAFE_FREE(seat_sel->leave_handler, ecore_event_handler_del);
+}
+
+EOLIAN static void
+_efl_selection_manager_container_drop_item_add(Eo *obj, Efl_Selection_Manager_Data *pd,
+ Efl_Object *cont, Efl_Selection_Format format,
+ void *item_func_data, Efl_Dnd_Item_Get item_func,
+ Eina_Free_Cb item_func_free_cb EINA_UNUSED,
+ unsigned int seat)
+{
+ Item_Container_Drop_Info *di;
+ Sel_Manager_Dropable *dropable = NULL;
+
+ if (_drop_item_container_del(pd, cont, EINA_FALSE))
+ {
+ di = eina_list_search_unsorted(pd->drop_cont_list, _drop_item_container_cmp, obj);
+ if (!di) return;
+ }
+ else
+ {
+ di = calloc(1, sizeof(Item_Container_Drop_Info));
+ if (!di) return;
+
+ di->obj = obj;
+ pd->drop_cont_list = eina_list_append(pd->drop_cont_list, di);
+ }
+ di->item_func = item_func;
+ di->item_func_data = item_func_data;
+
+ dropable = efl_key_data_get(cont, "__elm_dropable");
+ if (!dropable)
+ {
+ dropable = calloc(1, sizeof(Sel_Manager_Dropable));
+ if (!dropable) return;
+ dropable->last.in = EINA_FALSE;
+ pd->drop_list = eina_list_append(pd->drop_list, dropable);
+ if (!pd->drop_list) return;
+ dropable->obj = cont;
+ efl_key_data_set(cont, "__elm_dropable", dropable);
+ }
+ dropable->is_container = EINA_TRUE;
+ dropable->item_func = item_func;
+ dropable->item_func_data = item_func_data;
+ _efl_selection_manager_drop_target_add(obj, pd, cont, format, seat);
+}
+
+EOLIAN static void
+_efl_selection_manager_container_drop_item_del(Eo *obj EINA_UNUSED, Efl_Selection_Manager_Data *pd,
+ Efl_Object *cont, unsigned int seat EINA_UNUSED)
+{
+ _drop_item_container_del(pd, cont, EINA_TRUE);
+}
+
+EOLIAN static void
+_efl_selection_manager_container_drag_item_add(Eo *obj EINA_UNUSED, Efl_Selection_Manager_Data *pd,
+ Efl_Object *cont, double time_to_drag, double anim_duration,
+ void *data_func_data, Efl_Dnd_Drag_Data_Get data_func, Eina_Free_Cb data_func_free_cb,
+ void *item_get_func_data, Efl_Dnd_Item_Get item_get_func, Eina_Free_Cb item_get_func_free_cb,
+ void *icon_func_data, Efl_Dnd_Drag_Icon_Create icon_func, Eina_Free_Cb icon_func_free_cb,
+ void *icon_list_func_data, Efl_Dnd_Drag_Icon_List_Create icon_list_func, Eina_Free_Cb icon_list_func_free_cb,
+ unsigned int seat)
+{
+ //TODO: remove previous drag one
+ Sel_Manager_Drag_Container *dc = calloc(1, sizeof(Sel_Manager_Drag_Container));
+ if (!dc)
+ {
+ ERR("Failed to allocate memory");
+ return;
+ }
+ dc->cont = cont;
+ dc->time_to_drag = time_to_drag;
+ dc->anim_duration = anim_duration;
+ dc->drag_data_func_data = data_func_data;
+ dc->drag_data_func = data_func;
+ dc->drag_data_func_free_cb = data_func_free_cb;
+ dc->item_get_func_data = item_get_func_data;
+ dc->item_get_func = item_get_func;
+ dc->item_get_func_free_cb = item_get_func_free_cb;
+ dc->icon_func_data = icon_func_data;
+ dc->icon_func = icon_func;
+ dc->icon_func_free_cb = icon_func_free_cb;
+ dc->icon_list_func_data = icon_list_func_data;
+ dc->icon_list_func = icon_list_func;
+ dc->icon_list_func_free_cb = icon_list_func_free_cb;
+ dc->seat = seat;
+ dc->pd = pd;
+
+ _sel_manager_seat_selection_init(pd, seat);
+
+ pd->drag_cont_list = eina_list_append(pd->drag_cont_list, dc);
+
+ evas_object_event_callback_add(cont, EVAS_CALLBACK_MOUSE_DOWN,
+ _cont_obj_mouse_down_cb, dc);
+}
+
+EOLIAN static void
+_efl_selection_manager_container_drag_item_del(Eo *obj EINA_UNUSED, Efl_Selection_Manager_Data *pd,
+ Efl_Object *cont, unsigned int seat EINA_UNUSED)
+{
+ Sel_Manager_Drag_Container *dc = eina_list_search_unsorted(pd->drag_cont_list,
+ _drag_item_container_cmp, cont);
+ if (dc)
+ _item_container_del_internal(dc, EINA_TRUE);
+}
+
+static Eo *
+_efl_selection_manager_efl_object_constructor(Eo *obj, Efl_Selection_Manager_Data *pd)
+{
+#if defined(HAVE_ELEMENTARY_X) || defined(HAVE_ELEMENTARY_WL2)
+ const char *ev = getenv("ELM_DISPLAY");
+#endif
+
+#ifdef HAVE_ELEMENTARY_X
+ Eina_Bool init_x = EINA_FALSE;
+ Eina_Bool have_display = !!getenv("DISPLAY");
+
+ if (ev) /* If ELM_DISPLAY is specified */
+ {
+ if (!strcmp(ev, "x11")) /* and it is X11 */
+ {
+ if (!have_display) /* if there is no $DISPLAY */
+ {
+ ERR("$ELM_DISPLAY is set to x11 but $DISPLAY is not set");
+ init_x = EINA_FALSE;
+ }
+ else /* if there is */
+ init_x = EINA_TRUE;
+ }
+ else /* not X11 */
+ init_x = EINA_FALSE;
+ }
+ else /* ELM_DISPLAY not specified */
+ {
+ if (have_display) /* If there is a $DISPLAY */
+ init_x = EINA_TRUE;
+ else /* No $DISPLAY */
+ init_x = EINA_FALSE;
+ }
+ if (init_x)
+ {
+ ecore_x_init(NULL);
+ }
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ Eina_Bool init_wl = EINA_FALSE;
+ Eina_Bool have_wl_display = !!getenv("WAYLAND_DISPLAY");
+
+ if (ev) /* If ELM_DISPLAY is specified */
+ {
+ if (!strcmp(ev, "wl")) /* and it is WL */
+ {
+ /* always try to connect to wl when it is enforced */
+ init_wl = EINA_TRUE;
+ }
+ else /* not wl */
+ init_wl = EINA_FALSE;
+ }
+ else /* ELM_DISPLAY not specified */
+ {
+ /* If there is a $WAYLAND_DISPLAY */
+ if ((have_wl_display) && (!getenv("DISPLAY")))
+ init_wl = EINA_TRUE;
+ else /* No $WAYLAND_DISPLAY */
+ init_wl = EINA_FALSE;
+ }
+ if (init_wl)
+ {
+ if (!ecore_wl2_init())
+ {
+ ERR("Could not initialize Ecore_Wl2");
+ return NULL;
+ }
+ _elm_wl_display = ecore_wl2_display_connect(NULL);
+ if (!_elm_wl_display)
+ {
+ ERR("Could not connect to Wayland Display");
+ ecore_wl2_shutdown();
+ return NULL;
+ }
+ }
+#endif
+
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+
+ pd->sel_man = obj;
+ pd->atom_list = calloc(1, SELECTION_N_ATOMS * sizeof(Sel_Manager_Atom));
+ if (!pd->atom_list)
+ {
+ ERR("failed to allocate atom_list");
+ return NULL;
+ }
+ pd->atom_list[SELECTION_ATOM_TARGETS].name = "TARGETS";
+ pd->atom_list[SELECTION_ATOM_TARGETS].format = EFL_SELECTION_FORMAT_TARGETS;
+#ifdef HAVE_ELEMENTARY_X
+ pd->atom_list[SELECTION_ATOM_TARGETS].x_converter = _x11_targets_converter;
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ pd->atom_list[SELECTION_ATOM_TARGETS].wl_converter = _wl_targets_converter;
+#endif
+ pd->atom_list[SELECTION_ATOM_ATOM].name = "ATOM"; // for opera browser
+ pd->atom_list[SELECTION_ATOM_ATOM].format = EFL_SELECTION_FORMAT_TARGETS;
+#ifdef HAVE_ELEMENTARY_X
+ pd->atom_list[SELECTION_ATOM_ATOM].x_converter = _x11_targets_converter;
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ pd->atom_list[SELECTION_ATOM_ATOM].wl_converter = _wl_targets_converter;
+#endif
+
+ pd->atom_list[SELECTION_ATOM_ELM].name = "application/x-elementary-markup";
+ pd->atom_list[SELECTION_ATOM_ELM].format = EFL_SELECTION_FORMAT_MARKUP;
+#ifdef HAVE_ELEMENTARY_X
+ pd->atom_list[SELECTION_ATOM_ELM].x_converter = _x11_general_converter;
+ pd->atom_list[SELECTION_ATOM_ELM].x_data_preparer = _x11_data_preparer_markup;
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ pd->atom_list[SELECTION_ATOM_ELM].wl_converter = _wl_general_converter;
+ pd->atom_list[SELECTION_ATOM_ELM].wl_data_preparer = _wl_data_preparer_markup;
+#endif
+
+ pd->atom_list[SELECTION_ATOM_TEXT_URILIST].name = "text/uri-list";
+ pd->atom_list[SELECTION_ATOM_TEXT_URILIST].format = EFL_SELECTION_FORMAT_IMAGE;
+#ifdef HAVE_ELEMENTARY_X
+ pd->atom_list[SELECTION_ATOM_TEXT_URILIST].x_converter = _x11_general_converter;
+ pd->atom_list[SELECTION_ATOM_TEXT_URILIST].x_data_preparer = _x11_data_preparer_uri;
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ pd->atom_list[SELECTION_ATOM_TEXT_URILIST].wl_converter = _wl_general_converter;
+ pd->atom_list[SELECTION_ATOM_TEXT_URILIST].wl_data_preparer = _wl_data_preparer_uri;
+#endif
+
+ pd->atom_list[SELECTION_ATOM_TEXT_X_VCARD].name = "text/x-vcard";
+ pd->atom_list[SELECTION_ATOM_TEXT_X_VCARD].format = EFL_SELECTION_FORMAT_VCARD;
+#ifdef HAVE_ELEMENTARY_X
+ pd->atom_list[SELECTION_ATOM_TEXT_X_VCARD].x_converter = _x11_vcard_send;
+ pd->atom_list[SELECTION_ATOM_TEXT_X_VCARD].x_data_preparer = _x11_data_preparer_vcard;
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ pd->atom_list[SELECTION_ATOM_TEXT_X_VCARD].wl_data_preparer = _wl_data_preparer_vcard;
+#endif
+
+ pd->atom_list[SELECTION_ATOM_IMAGE_PNG].name = "image/png";
+ pd->atom_list[SELECTION_ATOM_IMAGE_PNG].format = EFL_SELECTION_FORMAT_IMAGE;
+#ifdef HAVE_ELEMENTARY_X
+ pd->atom_list[SELECTION_ATOM_IMAGE_PNG].x_converter = _x11_image_converter;
+ pd->atom_list[SELECTION_ATOM_IMAGE_PNG].x_data_preparer = _x11_data_preparer_image;
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ pd->atom_list[SELECTION_ATOM_IMAGE_PNG].wl_data_preparer = _wl_data_preparer_image;
+#endif
+
+ pd->atom_list[SELECTION_ATOM_IMAGE_JPEG].name = "image/jpeg";
+ pd->atom_list[SELECTION_ATOM_IMAGE_JPEG].format = EFL_SELECTION_FORMAT_IMAGE;
+#ifdef HAVE_ELEMENTARY_X
+ pd->atom_list[SELECTION_ATOM_IMAGE_JPEG].x_converter = _x11_image_converter;
+ pd->atom_list[SELECTION_ATOM_IMAGE_JPEG].x_data_preparer = _x11_data_preparer_image;
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ pd->atom_list[SELECTION_ATOM_IMAGE_JPEG].wl_data_preparer = _wl_data_preparer_image;
+#endif
+
+ pd->atom_list[SELECTION_ATOM_IMAGE_BMP].name = "image/x-ms-bmp";
+ pd->atom_list[SELECTION_ATOM_IMAGE_BMP].format = EFL_SELECTION_FORMAT_IMAGE;
+#ifdef HAVE_ELEMENTARY_X
+ pd->atom_list[SELECTION_ATOM_IMAGE_BMP].x_converter = _x11_image_converter;
+ pd->atom_list[SELECTION_ATOM_IMAGE_BMP].x_data_preparer = _x11_data_preparer_image;
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ pd->atom_list[SELECTION_ATOM_IMAGE_BMP].wl_data_preparer = _wl_data_preparer_image;
+#endif
+
+ pd->atom_list[SELECTION_ATOM_IMAGE_GIF].name = "image/gif";
+ pd->atom_list[SELECTION_ATOM_IMAGE_GIF].format = EFL_SELECTION_FORMAT_IMAGE;
+#ifdef HAVE_ELEMENTARY_X
+ pd->atom_list[SELECTION_ATOM_IMAGE_GIF].x_converter = _x11_image_converter;
+ pd->atom_list[SELECTION_ATOM_IMAGE_GIF].x_data_preparer = _x11_data_preparer_image;
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ pd->atom_list[SELECTION_ATOM_IMAGE_GIF].wl_data_preparer = _wl_data_preparer_image;
+#endif
+
+ pd->atom_list[SELECTION_ATOM_IMAGE_TIFF].name = "image/tiff";
+ pd->atom_list[SELECTION_ATOM_IMAGE_TIFF].format = EFL_SELECTION_FORMAT_IMAGE;
+#ifdef HAVE_ELEMENTARY_X
+ pd->atom_list[SELECTION_ATOM_IMAGE_TIFF].x_converter = _x11_image_converter;
+ pd->atom_list[SELECTION_ATOM_IMAGE_TIFF].x_data_preparer = _x11_data_preparer_image;
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ pd->atom_list[SELECTION_ATOM_IMAGE_TIFF].wl_data_preparer = _wl_data_preparer_image;
+#endif
+
+ pd->atom_list[SELECTION_ATOM_IMAGE_SVG].name = "image/svg+xml";
+ pd->atom_list[SELECTION_ATOM_IMAGE_SVG].format = EFL_SELECTION_FORMAT_IMAGE;
+#ifdef HAVE_ELEMENTARY_X
+ pd->atom_list[SELECTION_ATOM_IMAGE_SVG].x_converter = _x11_image_converter;
+ pd->atom_list[SELECTION_ATOM_IMAGE_SVG].x_data_preparer = _x11_data_preparer_image;
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ pd->atom_list[SELECTION_ATOM_IMAGE_SVG].wl_data_preparer = _wl_data_preparer_image;
+#endif
+
+ pd->atom_list[SELECTION_ATOM_IMAGE_XPM].name = "image/x-xpixmap";
+ pd->atom_list[SELECTION_ATOM_IMAGE_XPM].format = EFL_SELECTION_FORMAT_IMAGE;
+#ifdef HAVE_ELEMENTARY_X
+ pd->atom_list[SELECTION_ATOM_IMAGE_XPM].x_converter = _x11_image_converter;
+ pd->atom_list[SELECTION_ATOM_IMAGE_XPM].x_data_preparer = _x11_data_preparer_image;
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ pd->atom_list[SELECTION_ATOM_IMAGE_XPM].wl_data_preparer = _wl_data_preparer_image;
+#endif
+
+ pd->atom_list[SELECTION_ATOM_IMAGE_TGA].name = "image/x-tga";
+ pd->atom_list[SELECTION_ATOM_IMAGE_TGA].format = EFL_SELECTION_FORMAT_IMAGE;
+#ifdef HAVE_ELEMENTARY_X
+ pd->atom_list[SELECTION_ATOM_IMAGE_TGA].x_converter = _x11_image_converter;
+ pd->atom_list[SELECTION_ATOM_IMAGE_TGA].x_data_preparer = _x11_data_preparer_image;
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ pd->atom_list[SELECTION_ATOM_IMAGE_TGA].wl_data_preparer = _wl_data_preparer_image;
+#endif
+
+ pd->atom_list[SELECTION_ATOM_IMAGE_PPM].name = "image/x-portable-pixmap";
+ pd->atom_list[SELECTION_ATOM_IMAGE_PPM].format = EFL_SELECTION_FORMAT_IMAGE;
+#ifdef HAVE_ELEMENTARY_X
+ pd->atom_list[SELECTION_ATOM_IMAGE_PPM].x_converter = _x11_image_converter;
+ pd->atom_list[SELECTION_ATOM_IMAGE_PPM].x_data_preparer = _x11_data_preparer_image;
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ pd->atom_list[SELECTION_ATOM_IMAGE_PPM].wl_data_preparer = _wl_data_preparer_image;
+#endif
+
+ pd->atom_list[SELECTION_ATOM_UTF8STRING].name = "UTF8_STRING";
+ pd->atom_list[SELECTION_ATOM_UTF8STRING].format = EFL_SELECTION_FORMAT_TEXT | EFL_SELECTION_FORMAT_MARKUP | EFL_SELECTION_FORMAT_HTML;
+#ifdef HAVE_ELEMENTARY_X
+ pd->atom_list[SELECTION_ATOM_UTF8STRING].x_converter = _x11_text_converter;
+ pd->atom_list[SELECTION_ATOM_UTF8STRING].x_data_preparer = _x11_data_preparer_text;
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ pd->atom_list[SELECTION_ATOM_UTF8STRING].wl_converter = _wl_text_converter;
+ pd->atom_list[SELECTION_ATOM_UTF8STRING].wl_data_preparer = _wl_data_preparer_text,
+#endif
+
+ pd->atom_list[SELECTION_ATOM_STRING].name = "STRING";
+ pd->atom_list[SELECTION_ATOM_STRING].format = EFL_SELECTION_FORMAT_TEXT | EFL_SELECTION_FORMAT_MARKUP | EFL_SELECTION_FORMAT_HTML;
+#ifdef HAVE_ELEMENTARY_X
+ pd->atom_list[SELECTION_ATOM_STRING].x_converter = _x11_text_converter;
+ pd->atom_list[SELECTION_ATOM_STRING].x_data_preparer = _x11_data_preparer_text;
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ pd->atom_list[SELECTION_ATOM_STRING].wl_converter = _wl_text_converter;
+ pd->atom_list[SELECTION_ATOM_STRING].wl_data_preparer = _wl_data_preparer_text;
+#endif
+
+ pd->atom_list[SELECTION_ATOM_COMPOUND_TEXT].name = "COMPOUND_TEXT";
+ pd->atom_list[SELECTION_ATOM_COMPOUND_TEXT].format = EFL_SELECTION_FORMAT_TEXT | EFL_SELECTION_FORMAT_MARKUP | EFL_SELECTION_FORMAT_HTML;
+#ifdef HAVE_ELEMENTARY_X
+ pd->atom_list[SELECTION_ATOM_COMPOUND_TEXT].x_converter = _x11_text_converter;
+ pd->atom_list[SELECTION_ATOM_COMPOUND_TEXT].x_data_preparer = _x11_data_preparer_text;
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ pd->atom_list[SELECTION_ATOM_COMPOUND_TEXT].wl_converter = _wl_text_converter;
+ pd->atom_list[SELECTION_ATOM_COMPOUND_TEXT].wl_data_preparer = _wl_data_preparer_text;
+#endif
+
+ pd->atom_list[SELECTION_ATOM_TEXT].name = "TEXT";
+ pd->atom_list[SELECTION_ATOM_TEXT].format = EFL_SELECTION_FORMAT_TEXT | EFL_SELECTION_FORMAT_MARKUP | EFL_SELECTION_FORMAT_HTML;
+#ifdef HAVE_ELEMENTARY_X
+ pd->atom_list[SELECTION_ATOM_TEXT].x_converter = _x11_text_converter;
+ pd->atom_list[SELECTION_ATOM_TEXT].x_data_preparer = _x11_data_preparer_text;
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ pd->atom_list[SELECTION_ATOM_TEXT].wl_converter = _wl_text_converter;
+ pd->atom_list[SELECTION_ATOM_TEXT].wl_data_preparer = _wl_data_preparer_text;
+#endif
+
+ pd->atom_list[SELECTION_ATOM_TEXT_PLAIN_UTF8].name = "text/plain;charset=utf-8";
+ pd->atom_list[SELECTION_ATOM_TEXT_PLAIN_UTF8].format = EFL_SELECTION_FORMAT_TEXT;
+#ifdef HAVE_ELEMENTARY_X
+ pd->atom_list[SELECTION_ATOM_TEXT_PLAIN_UTF8].x_converter = _x11_text_converter;
+ pd->atom_list[SELECTION_ATOM_TEXT_PLAIN_UTF8].x_data_preparer = _x11_data_preparer_text;
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ pd->atom_list[SELECTION_ATOM_TEXT_PLAIN_UTF8].wl_converter = _wl_text_converter;
+ pd->atom_list[SELECTION_ATOM_TEXT_PLAIN_UTF8].wl_data_preparer = _wl_data_preparer_text;
+#endif
+
+ pd->atom_list[SELECTION_ATOM_TEXT_PLAIN].name = "text/plain";
+ pd->atom_list[SELECTION_ATOM_TEXT_PLAIN].format = EFL_SELECTION_FORMAT_TEXT;
+#ifdef HAVE_ELEMENTARY_X
+ pd->atom_list[SELECTION_ATOM_TEXT_PLAIN].x_converter = _x11_text_converter;
+ pd->atom_list[SELECTION_ATOM_TEXT_PLAIN].x_data_preparer = _x11_data_preparer_text;
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ pd->atom_list[SELECTION_ATOM_TEXT_PLAIN].wl_converter = _wl_text_converter;
+ pd->atom_list[SELECTION_ATOM_TEXT_PLAIN].wl_data_preparer = _wl_data_preparer_text;
+#endif
+
+
+ int i;
+#ifdef HAVE_ELEMENTARY_X
+ if (ecore_x_display_get())
+ {
+ for (i = 0; i < SELECTION_N_ATOMS; i++)
+ {
+ pd->atom_list[i].x_atom = ecore_x_atom_get(pd->atom_list[i].name);
+ ecore_x_selection_converter_atom_add
+ (pd->atom_list[i].x_atom, pd->atom_list[i].x_converter);
+ }
+ pd->notify_handler = ecore_event_handler_add(ECORE_X_EVENT_SELECTION_NOTIFY,
+ _efl_sel_manager_x11_selection_notify, pd);
+ pd->clear_handler = ecore_event_handler_add(ECORE_X_EVENT_SELECTION_CLEAR,
+ _x11_selection_clear, pd);
+ pd->fix_handler = ecore_event_handler_add(ECORE_X_EVENT_FIXES_SELECTION_NOTIFY,
+ _x11_fixes_selection_notify, pd);
+ }
+#endif
+
+ pd->type_hash = eina_hash_string_small_new(NULL);
+ for (i = 0; i < SELECTION_N_ATOMS; i++)
+ {
+ eina_hash_add(pd->type_hash, pd->atom_list[i].name, &pd->atom_list[i]);
+ }
+ pd->text_uri = eina_stringshare_add("text/uri-list");
+
+#ifdef HAVE_ELEMENTARY_WL2
+ pd->send_handler = ecore_event_handler_add(ECORE_WL2_EVENT_DATA_SOURCE_SEND,
+ _wl_selection_send, pd);
+ pd->changed_handler = ecore_event_handler_add(ECORE_WL2_EVENT_SEAT_SELECTION,
+ _wl_selection_changed, pd);
+ pd->end_handler = ecore_event_handler_add(ECORE_WL2_EVENT_DATA_SOURCE_END,
+ _wl_dnd_end, pd);
+#endif
+ managers = eina_list_append(managers, obj);
+ return obj;
+}
+
+static void
+_efl_selection_manager_efl_object_destructor(Eo *obj, Efl_Selection_Manager_Data *pd)
+{
+ Sel_Manager_Seat_Selection *seat_sel;
+ Eina_List *l;
+ Sel_Manager_Dropable *dropable;
+
+ managers = eina_list_remove(managers, obj);
+ EINA_LIST_FOREACH(pd->drop_list, l, dropable)
+ {
+ _drop_target_cbs_del(pd, dropable, dropable->obj);
+ }
+#ifdef HAVE_ELEMENTARY_X
+ ecore_event_handler_del(pd->notify_handler);
+ ecore_event_handler_del(pd->clear_handler);
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ ecore_event_handler_del(pd->send_handler);
+ ecore_event_handler_del(pd->changed_handler);
+ ecore_event_handler_del(pd->end_handler);
+#endif
+ free(pd->atom_list);
+ EINA_LIST_FREE(pd->seat_list, seat_sel)
+ {
+ ecore_event_handler_del(seat_sel->pos_handler);
+ ecore_event_handler_del(seat_sel->drop_handler);
+ ecore_event_handler_del(seat_sel->enter_handler);
+ ecore_event_handler_del(seat_sel->leave_handler);
+#ifdef HAVE_ELEMENTARY_X
+ free(seat_sel->sel_list);
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ free(seat_sel->sel);
+#endif
+#ifdef HAVE_ELEMENTARY_COCOA
+ free(seat_sel->sel);
+#endif
+#ifdef HAVE_ELEMENTARY_WIN32
+ free(seat_sel->sel_list);
+#endif
+ free(seat_sel->saved_types->types);
+ free(seat_sel->saved_types->imgfile);
+ free(seat_sel->saved_types);
+ }
+ eina_hash_free(pd->type_hash);
+ eina_stringshare_del(pd->text_uri);
+
+ efl_destructor(efl_super(obj, MY_CLASS));
+#if defined(HAVE_ELEMENTARY_X) || defined(HAVE_ELEMENTARY_WL2) || defined(HAVE_ELEMENTARY_WIN32)
+ const char *ev = getenv("ELM_DISPLAY");
+#endif
+
+#ifdef HAVE_ELEMENTARY_X
+ Eina_Bool init_x = EINA_FALSE;
+ Eina_Bool have_display = !!getenv("DISPLAY");
+
+ if (ev) /* If ELM_DISPLAY is specified */
+ {
+ if (!strcmp(ev, "x11")) /* and it is X11 */
+ {
+ if (!have_display) /* if there is no $DISPLAY */
+ {
+ ERR("$ELM_DISPLAY is set to x11 but $DISPLAY is not set");
+ init_x = EINA_FALSE;
+ }
+ else /* if there is */
+ init_x = EINA_TRUE;
+ }
+ else /* not X11 */
+ init_x = EINA_FALSE;
+ }
+ else /* ELM_DISPLAY not specified */
+ {
+ if (have_display) /* If there is a $DISPLAY */
+ init_x = EINA_TRUE;
+ else /* No $DISPLAY */
+ init_x = EINA_FALSE;
+ }
+ if (init_x)
+ {
+ if (ecore_x_display_get())
+ ecore_x_shutdown();
+ }
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ Eina_Bool init_wl = EINA_FALSE;
+ Eina_Bool have_wl_display = !!getenv("WAYLAND_DISPLAY");
+
+ if (ev) /* If ELM_DISPLAY is specified */
+ {
+ if (!strcmp(ev, "wl")) /* and it is WL */
+ {
+ /* always try to connect to wl when it is enforced */
+ init_wl = EINA_TRUE;
+ }
+ else /* not wl */
+ init_wl = EINA_FALSE;
+ }
+ else /* ELM_DISPLAY not specified */
+ {
+ /* If there is a $WAYLAND_DISPLAY */
+ if ((have_wl_display) && (!getenv("DISPLAY")))
+ init_wl = EINA_TRUE;
+ else /* No $WAYLAND_DISPLAY */
+ init_wl = EINA_FALSE;
+ }
+ if (init_wl)
+ {
+ if (!managers) ecore_wl2_display_disconnect(_elm_wl_display);
+ ecore_wl2_shutdown();
+ }
+#endif
+}
+
+#ifdef HAVE_ELEMENTARY_X
+static void
+_set_selection_list(Sel_Manager_Selection *sel_list, Sel_Manager_Seat_Selection *seat_sel)
+{
+ sel_list[EFL_SELECTION_TYPE_PRIMARY].debug = "Primary";
+ sel_list[EFL_SELECTION_TYPE_PRIMARY].ecore_sel = ECORE_X_SELECTION_PRIMARY;
+ sel_list[EFL_SELECTION_TYPE_PRIMARY].set = ecore_x_selection_primary_set;
+ sel_list[EFL_SELECTION_TYPE_PRIMARY].clear = ecore_x_selection_primary_clear;
+ sel_list[EFL_SELECTION_TYPE_PRIMARY].request = ecore_x_selection_primary_request;
+ sel_list[EFL_SELECTION_TYPE_PRIMARY].seat_sel = seat_sel;
+
+ sel_list[EFL_SELECTION_TYPE_SECONDARY].debug = "Secondary";
+ sel_list[EFL_SELECTION_TYPE_SECONDARY].ecore_sel = ECORE_X_SELECTION_SECONDARY;
+ sel_list[EFL_SELECTION_TYPE_SECONDARY].set = ecore_x_selection_secondary_set;
+ sel_list[EFL_SELECTION_TYPE_SECONDARY].clear = ecore_x_selection_secondary_clear;
+ sel_list[EFL_SELECTION_TYPE_SECONDARY].request = ecore_x_selection_secondary_request;
+ sel_list[EFL_SELECTION_TYPE_SECONDARY].seat_sel = seat_sel;
+
+ sel_list[EFL_SELECTION_TYPE_DND].debug = "DnD";
+ sel_list[EFL_SELECTION_TYPE_DND].ecore_sel = ECORE_X_SELECTION_PRIMARY;
+ sel_list[EFL_SELECTION_TYPE_DND].request = ecore_x_selection_xdnd_request;
+ sel_list[EFL_SELECTION_TYPE_DND].seat_sel = seat_sel;
+
+ sel_list[EFL_SELECTION_TYPE_CLIPBOARD].debug = "Clipboard";
+ sel_list[EFL_SELECTION_TYPE_CLIPBOARD].ecore_sel = ECORE_X_SELECTION_CLIPBOARD;
+ sel_list[EFL_SELECTION_TYPE_CLIPBOARD].set = ecore_x_selection_clipboard_set;
+ sel_list[EFL_SELECTION_TYPE_CLIPBOARD].clear = ecore_x_selection_clipboard_clear;
+ sel_list[EFL_SELECTION_TYPE_CLIPBOARD].request = ecore_x_selection_clipboard_request;
+ sel_list[EFL_SELECTION_TYPE_CLIPBOARD].seat_sel = seat_sel;
+}
+#endif
+#ifdef HAVE_ELEMENTARY_WIN32
+static void
+_set_selection_list(Sel_Manager_Selection *sel_list, Sel_Manager_Seat_Selection *seat_sel)
+{
+ sel_list[EFL_SELECTION_TYPE_PRIMARY].debug = "Primary";
+ sel_list[EFL_SELECTION_TYPE_PRIMARY].ecore_sel = ECORE_WIN32_SELECTION_PRIMARY;
+ sel_list[EFL_SELECTION_TYPE_PRIMARY].set = ecore_win32_clipboard_set;
+ sel_list[EFL_SELECTION_TYPE_PRIMARY].clear = ecore_win32_clipboard_clear;
+ sel_list[EFL_SELECTION_TYPE_PRIMARY].get = ecore_win32_clipboard_get;
+ sel_list[EFL_SELECTION_TYPE_PRIMARY].seat_sel = seat_sel;
+
+ sel_list[EFL_SELECTION_TYPE_SECONDARY].debug = "Secondary";
+ sel_list[EFL_SELECTION_TYPE_SECONDARY].ecore_sel = ECORE_WIN32_SELECTION_OTHER;
+ sel_list[EFL_SELECTION_TYPE_SECONDARY].seat_sel = seat_sel;
+
+ sel_list[EFL_SELECTION_TYPE_DND].debug = "DnD";
+ sel_list[EFL_SELECTION_TYPE_DND].ecore_sel = ECORE_WIN32_SELECTION_OTHER;
+ sel_list[EFL_SELECTION_TYPE_DND].seat_sel = seat_sel;
+
+ sel_list[EFL_SELECTION_TYPE_CLIPBOARD].debug = "Clipboard";
+ sel_list[EFL_SELECTION_TYPE_CLIPBOARD].ecore_sel = ECORE_WIN32_SELECTION_CLIPBOARD;
+ sel_list[EFL_SELECTION_TYPE_CLIPBOARD].set = ecore_win32_clipboard_set;
+ sel_list[EFL_SELECTION_TYPE_CLIPBOARD].clear = ecore_win32_clipboard_clear;
+ sel_list[EFL_SELECTION_TYPE_CLIPBOARD].seat_sel = seat_sel;
+}
+#endif
+
+#include "efl_selection_manager.eo.c"
diff --git a/src/lib/elementary/efl_selection_manager.eo b/src/lib/elementary/efl_selection_manager.eo
new file mode 100644
index 0000000000..00914e53ba
--- /dev/null
+++ b/src/lib/elementary/efl_selection_manager.eo
@@ -0,0 +1,139 @@
+import efl_ui_dnd_types;
+
+class Efl.Selection_Manager (Efl.Object) {
+ methods {
+ selection_set @beta {
+ [[Set selection]]
+ params {
+ @in owner: Efl.Object; [[Seleciton owner]]
+ @in type: Efl.Selection_Type; [[Selection type]]
+ @in format: Efl.Selection_Format; [[Selection format]]
+ @in data: Eina.Slice; [[Selection data]]
+ @in seat: uint @optional;[[Specified seat for multiple seats case.]]
+ }
+ return: future<void>; [[Future for tracking when the selection is lost]]
+ }
+ selection_get @beta {
+ [[Get selection]]
+ params {
+ @in request: const(Efl.Object); [[Seleciton owner]]
+ @in type: Efl.Selection_Type; [[Selection type]]
+ @in format: Efl.Selection_Format; [[Selection Format]]
+ @in data_func: Efl.Selection_Data_Ready; [[Data ready function pointer]]
+ @in seat: uint @optional;[[Specified seat for multiple seats case.]]
+ }
+ }
+ selection_clear @beta {
+ params {
+ @in owner: Efl.Object; [[Seleciton owner]]
+ @in type: Efl.Selection_Type; [[Selection type]]
+ @in seat: uint @optional; [[Specified seat for multiple seats case.]]
+ }
+ }
+ selection_has_owner @beta {
+ [[Check if the request object has selection or not]]
+ params {
+ @in request: Efl.Object; [[Request object]]
+ @in type: Efl.Selection_Type; [[Selection type]]
+ @in seat: uint @optional; [[Specified seat for multiple seats case.]]
+ }
+ return: bool; [[EINA_TRUE if the request object has selection, otherwise, EINA_FALSE]]
+ }
+ drag_start @beta {
+ [[This starts a drag and drop process at the drag side.
+ During dragging, there are three events emitted as belows:
+ - EFL_UI_DND_EVENT_DRAG_POS
+ - EFL_UI_DND_EVENT_DRAG_ACCEPT
+ - EFL_UI_DND_EVENT_DRAG_DONE
+ ]]
+ params {
+ @in drag_obj: Efl.Object; [[Drag object]]
+ @in format: Efl.Selection_Format; [[Data format]]
+ @in data: Eina.Slice; [[Data to transfer]]
+ @in action: Efl.Selection_Action; [[Action when data is transferred]]
+ @in icon_func: Efl.Dnd.Drag_Icon_Create; [[Function pointer to create icon]]
+ @in seat: uint; [[Specified seat for multiple seats case.]]
+ }
+ }
+ drag_action_set @beta {
+ [[This sets the action for the drag]]
+ params {
+ @in drag_obj: Efl.Object; [[Drag object]]
+ @in action: Efl.Selection_Action; [[Drag action]]
+ @in seat: uint; [[Specified seat for multiple seats case.]]
+ }
+ }
+ drag_cancel @beta {
+ [[This cancels the on-going drag]]
+ params {
+ @in drag_obj: Efl.Object; [[Drag object]]
+ @in seat: uint; [[Specified seat for multiple seats case.]]
+ }
+ }
+ container_drag_item_add @beta {
+ [[This registers a drag for items in a container. Many items can be
+ dragged at a time. During dragging, there are three events emitted:
+ - EFL_UI_DND_EVENT_DRAG_POS
+ - EFL_UI_DND_EVENT_DRAG_ACCEPT
+ - EFL_UI_DND_EVENT_DRAG_DONE.]]
+ params {
+ @in cont: Efl.Object; [[Container object]]
+ @in time_to_drag: double; [[Time since mouse down happens to drag starts]]
+ @in anim_duration: double; [[animation duration]]
+ @in data_func: Efl.Dnd.Drag_Data_Get; [[Data and its format]]
+ @in item_func: Efl.Dnd.Item_Get; [[Item to determine drag start]]
+ @in icon_func: Efl.Dnd.Drag_Icon_Create; [[Icon used during drag]]
+ @in icon_list_func: Efl.Dnd.Drag_Icon_List_Create; [[Icons used for animations]]
+ @in seat: uint; [[Specified seat for multiple seats case]]
+ }
+ }
+ container_drag_item_del @beta {
+ [[Remove drag function of items in the container object.]]
+ params {
+ @in cont: Efl.Object; [[Container object]]
+ @in seat: uint; [[Specified seat for multiple seats case]]
+ }
+ }
+ drop_target_add @beta {
+ [[Add a dropable target. There are four events emitted:
+ - EFL_UI_DND_DROP_DRAG_ENTER
+ - EFL_UI_DND_DROP_DRAG_LEAVE
+ - EFL_UI_DND_DROP_DRAG_POS
+ - EFL_UI_DND_DROP_DRAG_DROP.]]
+ params {
+ @in target_obj: Efl.Object; [[Drop target]]
+ @in format: Efl.Selection_Format; [[Accepted data format]]
+ @in seat: uint; [[Specified seat for multiple seats case.]]
+ }
+ return: bool; [[$true on success, $false otherwise]]
+ }
+ drop_target_del @beta {
+ [[Remove a dropable target]]
+ params {
+ @in target_obj: Efl.Object; [[Drop target]]
+ @in format: Efl.Selection_Format; [[Accepted data format]]
+ @in seat: uint; [[Specified seat for multiple seats case.]]
+ }
+ }
+ container_drop_item_add @beta {
+ [[Add dropable target for a container in which items can drop to it]]
+ params {
+ @in cont: Efl.Object; [[Container object]]
+ @in format: Efl.Selection_Format; [[Accepted data formats]]
+ @in item_func: Efl.Dnd.Item_Get; [[Get item at specific position]]
+ @in seat: uint; [[Specified seat for multiple seats case.]]
+ }
+ }
+ container_drop_item_del @beta {
+ [[Remove dropable target for the container]]
+ params {
+ @in cont: Efl.Object; [[Container object]]
+ @in seat: uint; [[Specified seat for multiple seats case.]]
+ }
+ }
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Object.destructor;
+ }
+}
diff --git a/src/lib/elementary/efl_selection_manager_private.h b/src/lib/elementary/efl_selection_manager_private.h
new file mode 100644
index 0000000000..5495c9e33e
--- /dev/null
+++ b/src/lib/elementary/efl_selection_manager_private.h
@@ -0,0 +1,320 @@
+#ifndef EFL_SELECTION_MANAGER_PRIVATE_H
+#define EFL_SELECTION_MANAGER_PRIVATE_H
+
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <Elementary.h>
+#include "elm_priv.h"
+
+enum
+{
+ SELECTION_ATOM_TARGETS = 0,
+ SELECTION_ATOM_ATOM,
+ SELECTION_ATOM_LISTING_ATOMS = SELECTION_ATOM_ATOM,
+ SELECTION_ATOM_TEXT_URILIST,
+ SELECTION_ATOM_TEXT_X_VCARD,
+ SELECTION_ATOM_IMAGE_PNG,
+ SELECTION_ATOM_IMAGE_JPEG,
+ SELECTION_ATOM_IMAGE_BMP,
+ SELECTION_ATOM_IMAGE_GIF,
+ SELECTION_ATOM_IMAGE_TIFF,
+ SELECTION_ATOM_IMAGE_SVG,
+ SELECTION_ATOM_IMAGE_XPM,
+ SELECTION_ATOM_IMAGE_TGA,
+ SELECTION_ATOM_IMAGE_PPM,
+ SELECTION_ATOM_ELM,
+ SELECTION_ATOM_UTF8STRING,
+ SELECTION_ATOM_STRING,
+ SELECTION_ATOM_COMPOUND_TEXT,
+ SELECTION_ATOM_TEXT,
+ SELECTION_ATOM_TEXT_PLAIN_UTF8,
+ SELECTION_ATOM_TEXT_PLAIN,
+
+ SELECTION_N_ATOMS,
+};
+
+typedef struct _Efl_Selection_Manager_Data Efl_Selection_Manager_Data;
+typedef struct _Sel_Manager_Seat_Selection Sel_Manager_Seat_Selection;
+typedef struct _Sel_Manager_Atom Sel_Manager_Atom;
+typedef struct _Sel_Manager_Dropable Sel_Manager_Dropable;
+typedef struct _Anim_Icon Anim_Icon;
+typedef struct _Sel_Manager_Drag_Container Sel_Manager_Drag_Container;
+typedef struct _Drop_Format Drop_Format;
+typedef struct _Item_Container_Drop_Info Item_Container_Drop_Info;
+typedef struct _Sel_Manager_Selection Sel_Manager_Selection;
+typedef struct _Tmp_Info Tmp_Info;
+typedef struct _Saved_Type Saved_Type;
+
+
+#ifdef HAVE_ELEMENTARY_X
+typedef Eina_Bool (*X11_Converter_Fn_Cb) (char *target, void *data, int size, void **data_ret, int *size_ret, Ecore_X_Atom *ttype, int *typesize);
+typedef int (*X11_Response_Handler_Cb) (Sel_Manager_Selection *sel, Ecore_X_Event_Selection_Notify *);
+typedef Eina_Bool (*X11_Data_Preparer_Cb) (Sel_Manager_Seat_Selection *seat_sel, Ecore_X_Event_Selection_Notify *, Efl_Selection_Data *, Tmp_Info **);
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+typedef Eina_Bool (*Wl_Converter_Fn_Cb) (char *target, Sel_Manager_Selection *sel, void *data, int size, void **data_ret, int *size_ret);
+static Eina_Bool _wl_targets_converter(char *target, Sel_Manager_Selection *sel, void *data, int size, void **data_ret, int *size_ret);
+static Eina_Bool _wl_general_converter(char *target, Sel_Manager_Selection *sel, void *data, int size, void **data_ret, int *size_ret);
+static Eina_Bool _wl_text_converter(char *target, Sel_Manager_Selection *sel, void *data, int size, void **data_ret, int *size_ret);
+
+typedef Eina_Bool (*Wl_Data_Preparer_Cb) (Sel_Manager_Selection *sel, Efl_Selection_Data *ddata, Ecore_Wl2_Event_Offer_Data_Ready *ev, Tmp_Info **tmp_info);
+static Eina_Bool _wl_data_preparer_markup(Sel_Manager_Selection *sel, Efl_Selection_Data *ddata, Ecore_Wl2_Event_Offer_Data_Ready *ev, Tmp_Info **tmp_info);
+static Eina_Bool _wl_data_preparer_uri(Sel_Manager_Selection *sel, Efl_Selection_Data *ddata, Ecore_Wl2_Event_Offer_Data_Ready *ev, Tmp_Info **tmp_info);
+static Eina_Bool _wl_data_preparer_vcard(Sel_Manager_Selection *sel, Efl_Selection_Data *ddata, Ecore_Wl2_Event_Offer_Data_Ready *ev, Tmp_Info **tmp_info);
+static Eina_Bool _wl_data_preparer_image(Sel_Manager_Selection *sel, Efl_Selection_Data *ddata, Ecore_Wl2_Event_Offer_Data_Ready *ev, Tmp_Info **tmp_info);
+static Eina_Bool _wl_data_preparer_text(Sel_Manager_Selection *sel, Efl_Selection_Data *ddata, Ecore_Wl2_Event_Offer_Data_Ready *ev, Tmp_Info **tmp_info);
+#endif
+
+
+struct _Tmp_Info
+{
+ char *filename;
+ void *map;
+ int fd;
+ int len;
+};
+
+struct _Saved_Type
+{
+ const char **types;
+ char *imgfile;
+ int ntypes;
+ Eina_Position2D pos;
+ Eina_Bool textreq: 1;
+};
+
+struct _Sel_Manager_Selection
+{
+ const char *debug;
+ Eina_Rw_Slice data;
+ Efl_Selection_Format request_format;
+#ifdef HAVE_ELEMENTARY_X
+ Eina_Bool (*set) (Ecore_X_Window, const void *data, int size);
+ Eina_Bool (*clear) (void);
+ void (*request) (Ecore_X_Window, const char *target);
+
+ Ecore_X_Selection ecore_sel;
+ Ecore_X_Window xwin;
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ uint32_t selection_serial;
+ uint32_t drag_serial;
+ Ecore_Wl2_Offer *sel_offer;
+ Ecore_Wl2_Offer *dnd_offer;
+ Ecore_Event_Handler *offer_handler;
+ Ecore_Wl2_Window *win;
+#endif
+#ifdef HAVE_ELEMENTARY_COCOA
+ Ecore_Cocoa_Window *win;
+ int pb_count;
+#endif
+#ifdef HAVE_ELEMENTARY_WIN32
+ Eina_Bool (*set)(const Ecore_Win32_Window *window, const void *data, int size);
+ Eina_Bool (*clear)(const Ecore_Win32_Window *window);
+ Eina_Bool (*get)(const Ecore_Win32_Window *window , void **data, int *size);
+ Ecore_Win32_Selection ecore_sel;
+ Ecore_Win32_Window *win;
+#endif
+
+ Efl_Selection_Format want_format;
+ Efl_Selection_Format format;
+ Efl_Selection_Action action;
+ Eina_Bool active : 1;
+
+ Efl_Object *owner;
+ Efl_Object *request_obj;
+ void *data_func_data;
+ Efl_Selection_Data_Ready data_func;
+ Eina_Free_Cb data_func_free_cb;
+
+ Sel_Manager_Seat_Selection *seat_sel;
+};
+
+typedef struct _Sel_Manager_Selection_Lost Sel_Manager_Selection_Lost;
+
+struct _Sel_Manager_Selection_Lost
+{
+ Efl_Object *request;
+ Eina_Promise *promise;
+ Efl_Selection_Type type;
+};
+
+struct _Sel_Manager_Seat_Selection
+{
+ unsigned int seat;
+#ifdef HAVE_ELEMENTARY_X
+ Sel_Manager_Selection *sel_list;
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ Sel_Manager_Selection *sel;
+#endif
+#ifdef HAVE_ELEMENTARY_COCOA
+ Sel_Manager_Selection *sel;
+#endif
+#ifdef HAVE_ELEMENTARY_WIN32
+ Sel_Manager_Selection *sel_list;
+#endif
+
+ Eina_List *sel_lost_list;
+ //drag
+ Eo *drag_obj;
+ Efl_Selection_Action drag_action;
+ Eo *drag_win;
+ Ecore_Event_Handler *mouse_up_handler, *dnd_status_handler;
+ Eina_Bool accept;
+ Ecore_X_Window xwin;
+ Eina_Position2D drag_pos;
+ Eina_Position2D drag_win_start;
+ Eina_Position2D drag_win_end;
+ Efl_Selection_Type active_type;
+
+ Saved_Type *saved_types;
+ Ecore_Event_Handler *enter_handler;
+ Ecore_Event_Handler *leave_handler;
+ Ecore_Event_Handler *pos_handler;
+ Ecore_Event_Handler *drop_handler;
+
+ Efl_Selection_Manager_Data *pd;
+};
+
+struct _Anim_Icon
+{
+ Eina_Rectangle start;
+ Evas_Object *obj;
+};
+
+struct _Sel_Manager_Drag_Container
+{
+ Evas *e;
+ Efl_Object *cont;
+ Efl_Selection_Format format;
+ Eina_Rw_Slice data;
+ Efl_Selection_Action action;
+ Eina_List *icons;
+ Eina_Size2D final_icon;
+ Eina_Position2D down;
+ Ecore_Timer *timer;
+ Ecore_Animator *animator;
+ double time_to_drag;
+ double anim_duration;
+ void *drag_data_func_data;
+ Efl_Dnd_Drag_Data_Get drag_data_func;
+ Eina_Free_Cb drag_data_func_free_cb;
+ void *item_get_func_data;
+ Efl_Dnd_Item_Get item_get_func;
+ Eina_Free_Cb item_get_func_free_cb;
+ void *icon_func_data;
+ Efl_Dnd_Drag_Icon_Create icon_func;
+ Eina_Free_Cb icon_func_free_cb;
+ void *icon_list_func_data;
+ Efl_Dnd_Drag_Icon_List_Create icon_list_func;
+ Eina_Free_Cb icon_list_func_free_cb;
+ unsigned int seat;
+
+ Efl_Selection_Manager_Data *pd;
+};
+
+struct _Sel_Manager_Atom
+{
+ const char *name;
+ Efl_Selection_Format format;
+#ifdef HAVE_ELEMENTARY_X
+ // Called by ecore to do conversion
+ X11_Converter_Fn_Cb x_converter;
+ X11_Data_Preparer_Cb x_data_preparer;
+ // Atom
+ Ecore_X_Atom x_atom;
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ Wl_Converter_Fn_Cb wl_converter;
+ Wl_Data_Preparer_Cb wl_data_preparer;
+#endif
+
+ void *_term;
+};
+
+struct _Drop_Format
+{
+ EINA_INLIST;
+ Efl_Selection_Format format;
+};
+
+struct _Sel_Manager_Dropable
+{
+ Evas_Object *obj;
+ Eina_Inlist *format_list;
+ unsigned int seat;
+ struct {
+ Eina_Position2D pos;
+ Eina_Bool in : 1;
+ const char *type;
+ Efl_Selection_Format format;
+ } last;
+
+ //for container
+ Efl_Dnd_Item_Get item_func;
+ void *item_func_data;
+ Eina_Bool is_container : 1;
+};
+
+struct _Item_Container_Drop_Info
+{
+ Efl_Object *obj;
+ void *item_func_data;
+ Efl_Dnd_Item_Get item_func;
+};
+
+#ifdef HAVE_ELEMENTARY_WL2
+typedef struct _Wl_Format_Translation
+{
+ Efl_Selection_Format format;
+ char **translates;
+} Sel_Manager_Wl_Format_Translation;
+
+char *sm_wl_markup[] = {"application/x-elementary-markup", "", NULL};
+char *sm_wl_text[] = {"text/plain;charset=utf-8", "text/plain", NULL};
+char *sm_wl_html[] = {"text/html;charset=utf-8", "text/html", NULL};
+char *sm_wl_vcard[] = {"text/x-vcard", NULL};
+char *sm_wl_image[] = {"image/", "text/uri-list", NULL};
+
+Sel_Manager_Wl_Format_Translation sm_wl_convertion[] = {
+ {EFL_SELECTION_FORMAT_MARKUP | EFL_SELECTION_FORMAT_TEXT, sm_wl_markup},
+ {EFL_SELECTION_FORMAT_TEXT, sm_wl_text},
+ {EFL_SELECTION_FORMAT_HTML, sm_wl_html},
+ {EFL_SELECTION_FORMAT_VCARD, sm_wl_vcard},
+ {EFL_SELECTION_FORMAT_IMAGE, sm_wl_image},
+ {EFL_SELECTION_FORMAT_NONE, NULL},
+};
+#endif
+
+struct _Efl_Selection_Manager_Data
+{
+ Eo *sel_man;
+#ifdef HAVE_ELEMENTARY_X
+ Ecore_Event_Handler *notify_handler;
+ Ecore_Event_Handler *clear_handler;
+ Ecore_Event_Handler *fix_handler;
+#endif
+#ifdef HAVE_ELEMENTARY_WL2
+ Ecore_Event_Handler *send_handler;
+ Ecore_Event_Handler *changed_handler;
+ Ecore_Event_Handler *end_handler;
+ Ecore_Wl2_Display *wl_display;
+#endif
+ Efl_Selection_Type loss_type;
+
+ Sel_Manager_Atom *atom_list;
+ Eina_List *seat_list;
+
+ Eina_List *drag_cont_list;
+
+ //drop
+ Eina_List *drop_list;
+ Eina_Hash *type_hash;
+ const char *text_uri;
+ Eina_List *drop_cont_list;
+};
+
+#endif
diff --git a/src/lib/elementary/efl_selection_types.eot b/src/lib/elementary/efl_selection_types.eot
new file mode 100644
index 0000000000..e5849597fd
--- /dev/null
+++ b/src/lib/elementary/efl_selection_types.eot
@@ -0,0 +1,59 @@
+enum Efl.Selection_Type
+{
+ [[Selection type]]
+ primary, [[Primary text selection (highlighted or selected text)]]
+ secondary, [[Used when primary selection is in use]]
+ dnd, [[Drag and Drop]]
+ clipboard [[Clipboard selection (ctrl+C)]]
+}
+
+enum Efl.Selection_Format
+{
+ [[Selection format]]
+ targets = -1, [[For matching every possible atom]]
+ none = 0x0, [[Content is from outside of Elementary]]
+ text = 0x01, [[Plain unformatted text: Used for things that don't want rich markup]]
+ markup = 0x2, [[Edje textblock markup, including inline images]]
+ image = 0x4, [[Images]]
+ vcard = 0x08, [[Vcards]]
+ html = 0x10 [[Raw HTML-like data (eg. webkit)]]
+}
+
+enum Efl.Selection_Action
+{
+ [[Defines the kind of action associated with the drop data]]
+ unknown, [[Action type is unknown]]
+ copy, [[Copy the data]]
+ move, [[Move the data]]
+ private, [[Private action type]]
+ ask, [[Ask the user what to do]]
+ list, [[List the data]]
+ link, [[Link the data]]
+ description [[Describe the data]]
+}
+
+struct Efl.Selection_Data
+{
+ [[Structure holding the info about selected data]]
+ pos: Eina.Position2D; [[Coordinates of the drop (DND operations only)]]
+ format: Efl.Selection_Format; [[Format of the selection]]
+ content: Eina.Slice; [[Selection data]]
+ action: Efl.Selection_Action; [[Action to perform with the data]]
+ item: Efl.Object; [[Item under the drag position. It is only available for container]]
+}
+
+function Efl.Selection_Data_Ready {
+ [[Function pointer for getting selection]]
+ params {
+ @in obj: Efl.Object; [[Object which requested for the selection]]
+ @in seldata: ptr(Efl.Selection_Data); [[Selection data]]
+ }
+};
+
+struct Efl.Selection_Changed
+{
+ type: Efl.Selection_Type; [[Selection type]]
+ seat: int; [[The seat on which the selection changed, or NULL for "default"]]
+ display: void_ptr; [[The display connection object, NULL under X11]]
+ exist: bool; [[EINA_TRUE if the selection has an owner]]
+}
diff --git a/src/lib/elementary/efl_ui_text_interactive.eo b/src/lib/elementary/efl_text_interactive.eo
index a56857f8fb..16d0448854 100644
--- a/src/lib/elementary/efl_ui_text_interactive.eo
+++ b/src/lib/elementary/efl_text_interactive.eo
@@ -1,7 +1,7 @@
import efl_text_types;
-interface Efl.Ui.Text.Interactive (Efl.Text, Efl.Text.Font,
- Efl.Text.Format, Efl.Text.Style)
+interface Efl.Text_Interactive (Efl.Text, Efl.Text_Font,
+ Efl.Text_Format, Efl.Text_Style)
{
[[This is an interface interactive text inputs should implement]]
methods {
@@ -24,8 +24,8 @@ interface Efl.Ui.Text.Interactive (Efl.Text, Efl.Text.Font,
]]
get {}
values {
- start: ptr(Efl.Text.Cursor.Cursor); [[The start of the selection]]
- end: ptr(Efl.Text.Cursor.Cursor); [[The end of the selection]]
+ start: ptr(Efl.Text_Cursor_Cursor); [[The start of the selection]]
+ end: ptr(Efl.Text_Cursor_Cursor); [[The end of the selection]]
}
}
@property editable {
@@ -45,6 +45,6 @@ interface Efl.Ui.Text.Interactive (Efl.Text, Efl.Text.Font,
}
}
events {
- selection,changed; [[The selection on the object has changed. Query using @.selection_cursors]]
+ selection,changed: void; [[The selection on the object has changed. Query using @.selection_cursors]]
}
}
diff --git a/src/lib/elementary/efl_ui.eot b/src/lib/elementary/efl_ui.eot
index e89104009a..0fd3622d1e 100644
--- a/src/lib/elementary/efl_ui.eot
+++ b/src/lib/elementary/efl_ui.eot
@@ -42,7 +42,7 @@ enum Efl.Ui.Focus.Move_Policy
Left, Right, Up, Down, Tab, or Shift+Tab.]]
}
-enum Efl.Ui.Slider.Indicator_Visible_Mode
+enum Efl.Ui.Slider_Indicator_Visible_Mode
{
[[Slider's indicator visiblity mode.
@@ -87,3 +87,20 @@ enum Efl.Ui.Activate
left, [[Activate left]]
back, [[Activate back]]
}
+
+enum Efl.Ui.Widget_Orientation_Mode
+{
+ [[Widget orientation mode, or how the theme handles screen orientation.
+
+ Note: Support for this feature is highly dependent on the theme in use.
+ At the time of writing, the default theme for EFL does not implement
+ support for orientation modes.
+ ]]
+ default, [[Default or automatic mode: if the widget's theme supports
+ orientation, it will be handled automatically.]]
+ disabled, [[No signal is sent to the widget's theme. Widget's theme will
+ not change according to the window or screen orientation.]]
+}
+
+/* Types for A11Y (internal/beta API) */
+type @extern Efl.Access.Action_Data: __undefined_type; [[Internal struct for accesssibility.]]
diff --git a/src/lib/elementary/efl_ui_bg.eo b/src/lib/elementary/efl_ui_bg.eo
index a52b5267ff..ac94ebc0ca 100644
--- a/src/lib/elementary/efl_ui_bg.eo
+++ b/src/lib/elementary/efl_ui_bg.eo
@@ -1,4 +1,4 @@
-interface Efl.Ui.Bg (Efl.Interface, Efl.Gfx, Efl.Image, Efl.File)
+interface Efl.Ui.Bg (Efl.Interface, Efl.Gfx.Entity, Efl.Gfx.Image, Efl.File)
{
[[The bg (background) widget is used for setting (solid) background decorations
diff --git a/src/lib/elementary/efl_ui_bg_widget.c b/src/lib/elementary/efl_ui_bg_widget.c
index def31d006f..dcd8fc409e 100644
--- a/src/lib/elementary/efl_ui_bg_widget.c
+++ b/src/lib/elementary/efl_ui_bg_widget.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define ELM_LAYOUT_PROTECTED
#include <Elementary.h>
@@ -13,7 +13,6 @@
#define MY_CLASS_PFX efl_ui_bg_widget
#define MY_CLASS_NAME "Efl.Ui.Bg_Widget"
-#define MY_CLASS_NAME_LEGACY "elm_bg"
static const Elm_Layout_Part_Alias_Description _content_aliases[] =
{
@@ -21,13 +20,6 @@ static const Elm_Layout_Part_Alias_Description _content_aliases[] =
{NULL, NULL}
};
-EAPI Evas_Object *
-elm_bg_add(Evas_Object *parent)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return elm_legacy_add(MY_CLASS, parent);
-}
-
EOLIAN static Eo *
_efl_ui_bg_widget_efl_object_constructor(Eo *obj, Efl_Ui_Bg_Widget_Data *pd)
{
@@ -46,70 +38,93 @@ _efl_ui_bg_widget_efl_object_constructor(Eo *obj, Efl_Ui_Bg_Widget_Data *pd)
elm_widget_theme_style_get(obj)))
CRI("Failed to set layout!");
- pd->rect = efl_add(EFL_CANVAS_RECTANGLE_CLASS, obj,
- efl_gfx_color_set(efl_added, 0, 0, 0, 0),
- efl_content_set(efl_part(obj, "elm.swallow.rectangle"), efl_added));
+ if (elm_widget_is_legacy(obj))
+ {
+ pd->rect = efl_add(EFL_CANVAS_RECTANGLE_CLASS, obj,
+ efl_gfx_color_set(efl_added, 0, 0, 0, 0),
+ efl_content_set(efl_part(obj, "elm.swallow.rectangle"), efl_added));
- pd->img = efl_add(EFL_UI_IMAGE_CLASS, obj,
- efl_image_scale_type_set(efl_added, EFL_IMAGE_SCALE_TYPE_FIT_OUTSIDE),
- efl_content_set(efl_part(obj, "elm.swallow.background"), efl_added));
+ pd->img = efl_add(EFL_UI_IMAGE_CLASS, obj,
+ efl_gfx_image_scale_type_set(efl_added, EFL_GFX_IMAGE_SCALE_TYPE_FIT_OUTSIDE),
+ efl_content_set(efl_part(obj, "elm.swallow.background"), efl_added));
+ }
+ else
+ {
+ pd->rect = efl_add(EFL_CANVAS_RECTANGLE_CLASS, obj,
+ efl_gfx_color_set(efl_added, 0, 0, 0, 0),
+ efl_content_set(efl_part(obj, "efl.rectangle"), efl_added));
- efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
- efl_access_type_set(obj, EFL_ACCESS_TYPE_DISABLED);
+ pd->img = efl_add(EFL_UI_IMAGE_CLASS, obj,
+ efl_gfx_image_scale_type_set(efl_added, EFL_GFX_IMAGE_SCALE_TYPE_FIT_OUTSIDE),
+ efl_content_set(efl_part(obj, "efl.background"), efl_added));
+ }
+ pd->file = NULL;
+ pd->key = NULL;
+
+ efl_access_object_access_type_set(obj, EFL_ACCESS_TYPE_DISABLED);
efl_ui_widget_focus_allow_set(obj, EINA_FALSE);
return obj;
}
+EOLIAN static void
+_efl_ui_bg_widget_efl_object_destructor(Eo *obj, Efl_Ui_Bg_Widget_Data *sd)
+{
+ ELM_SAFE_FREE(sd->file, eina_stringshare_del);
+ ELM_SAFE_FREE(sd->key, eina_stringshare_del);
+
+ efl_destructor(efl_super(obj, MY_CLASS));
+}
+
EAPI void
elm_bg_option_set(Evas_Object *obj, Elm_Bg_Option option)
{
- Efl_Image_Scale_Type type;
+ Efl_Gfx_Image_Scale_Type type;
switch (option)
{
case ELM_BG_OPTION_CENTER:
- type = EFL_IMAGE_SCALE_TYPE_NONE;
+ type = EFL_GFX_IMAGE_SCALE_TYPE_NONE;
break;
case ELM_BG_OPTION_SCALE:
- type = EFL_IMAGE_SCALE_TYPE_FIT_OUTSIDE;
+ type = EFL_GFX_IMAGE_SCALE_TYPE_FIT_OUTSIDE;
break;
case ELM_BG_OPTION_TILE:
- type = EFL_IMAGE_SCALE_TYPE_TILE;
+ type = EFL_GFX_IMAGE_SCALE_TYPE_TILE;
break;
case ELM_BG_OPTION_STRETCH:
- type = EFL_IMAGE_SCALE_TYPE_FILL;
+ type = EFL_GFX_IMAGE_SCALE_TYPE_FILL;
break;
case ELM_BG_OPTION_LAST:
default:
- type = EFL_IMAGE_SCALE_TYPE_FIT_OUTSIDE;
+ type = EFL_GFX_IMAGE_SCALE_TYPE_FIT_OUTSIDE;
}
- efl_image_scale_type_set(obj, type);
+ efl_gfx_image_scale_type_set(obj, type);
}
EAPI Elm_Bg_Option
elm_bg_option_get(const Evas_Object *obj)
{
- Efl_Image_Scale_Type type;
+ Efl_Gfx_Image_Scale_Type type;
Elm_Bg_Option option = ELM_BG_OPTION_LAST;
- type = efl_image_scale_type_get(obj);
+ type = efl_gfx_image_scale_type_get(obj);
switch (type)
{
- case EFL_IMAGE_SCALE_TYPE_NONE:
+ case EFL_GFX_IMAGE_SCALE_TYPE_NONE:
option = ELM_BG_OPTION_CENTER;
break;
- case EFL_IMAGE_SCALE_TYPE_FIT_OUTSIDE:
+ case EFL_GFX_IMAGE_SCALE_TYPE_FIT_OUTSIDE:
option = ELM_BG_OPTION_SCALE;
break;
- case EFL_IMAGE_SCALE_TYPE_TILE:
+ case EFL_GFX_IMAGE_SCALE_TYPE_TILE:
option = ELM_BG_OPTION_TILE;
break;
- case EFL_IMAGE_SCALE_TYPE_FILL:
+ case EFL_GFX_IMAGE_SCALE_TYPE_FILL:
option = ELM_BG_OPTION_STRETCH;
break;
- case EFL_IMAGE_SCALE_TYPE_FIT_INSIDE:
+ case EFL_GFX_IMAGE_SCALE_TYPE_FIT_INSIDE:
default:
ERR("Scale type %d cannot be converted to Elm_Bg_Option", type);
break;
@@ -119,15 +134,15 @@ elm_bg_option_get(const Evas_Object *obj)
}
EOLIAN static void
-_efl_ui_bg_widget_efl_image_scale_type_set(Eo *obj EINA_UNUSED, Efl_Ui_Bg_Widget_Data *sd, Efl_Image_Scale_Type scale_type)
+_efl_ui_bg_widget_efl_gfx_image_scale_type_set(Eo *obj EINA_UNUSED, Efl_Ui_Bg_Widget_Data *sd, Efl_Gfx_Image_Scale_Type scale_type)
{
- efl_image_scale_type_set(sd->img, scale_type);
+ efl_gfx_image_scale_type_set(sd->img, scale_type);
}
-EOLIAN static Efl_Image_Scale_Type
-_efl_ui_bg_widget_efl_image_scale_type_get(Eo *obj EINA_UNUSED, Efl_Ui_Bg_Widget_Data *sd)
+EOLIAN static Efl_Gfx_Image_Scale_Type
+_efl_ui_bg_widget_efl_gfx_image_scale_type_get(const Eo *obj EINA_UNUSED, Efl_Ui_Bg_Widget_Data *sd)
{
- return efl_image_scale_type_get(sd->img);
+ return efl_gfx_image_scale_type_get(sd->img);
}
EAPI void
@@ -164,7 +179,7 @@ elm_bg_color_get(const Evas_Object *obj,
}
EOLIAN static void
-_efl_ui_bg_widget_efl_gfx_color_color_get(Eo *obj, Efl_Ui_Bg_Widget_Data *sd, int *r, int *g, int *b, int *a)
+_efl_ui_bg_widget_efl_gfx_color_color_get(const Eo *obj, Efl_Ui_Bg_Widget_Data *sd, int *r, int *g, int *b, int *a)
{
if (!sd->rect)
efl_gfx_color_get(efl_super(obj, MY_CLASS), r, g, b, a);
@@ -176,25 +191,19 @@ EAPI void
elm_bg_load_size_set(Evas_Object *obj, int w, int h)
{
EFL_UI_BG_WIDGET_DATA_GET_OR_RETURN(obj, sd);
- efl_image_load_size_set(sd->img, EINA_SIZE2D(w, h));
+ efl_gfx_image_load_controller_load_size_set(sd->img, EINA_SIZE2D(w, h));
}
EOLIAN static void
-_efl_ui_bg_widget_efl_image_load_load_size_set(Eo *obj EINA_UNUSED, Efl_Ui_Bg_Widget_Data *sd, Eina_Size2D sz)
+_efl_ui_bg_widget_efl_gfx_image_load_controller_load_size_set(Eo *obj EINA_UNUSED, Efl_Ui_Bg_Widget_Data *sd, Eina_Size2D sz)
{
- efl_image_load_size_set(sd->img, sz);
+ efl_gfx_image_load_controller_load_size_set(sd->img, sz);
}
EOLIAN static Eina_Size2D
-_efl_ui_bg_widget_efl_image_load_load_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Bg_Widget_Data *sd)
+_efl_ui_bg_widget_efl_gfx_image_load_controller_load_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_Bg_Widget_Data *sd)
{
- return efl_image_load_size_get(sd->img);
-}
-
-static void
-_efl_ui_bg_widget_class_constructor(Efl_Class *klass)
-{
- evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
+ return efl_gfx_image_load_controller_load_size_get(sd->img);
}
EAPI Eina_Bool
@@ -206,6 +215,9 @@ elm_bg_file_set(Eo *obj, const char *file, const char *group)
EOLIAN static Eina_Bool
_efl_ui_bg_widget_efl_file_file_set(Eo *obj EINA_UNUSED, Efl_Ui_Bg_Widget_Data *sd, const char *file, const char *key)
{
+ eina_stringshare_replace(&sd->file, file);
+ eina_stringshare_replace(&sd->key, key);
+
return efl_file_set(sd->img, file, key);
}
EAPI void
@@ -215,8 +227,15 @@ elm_bg_file_get(const Eo *obj, const char **file, const char **group)
}
EOLIAN static void
-_efl_ui_bg_widget_efl_file_file_get(Eo *obj EINA_UNUSED, Efl_Ui_Bg_Widget_Data *sd, const char **file, const char **key)
+_efl_ui_bg_widget_efl_file_file_get(const Eo *obj, Efl_Ui_Bg_Widget_Data *sd, const char **file, const char **key)
{
+ if (elm_widget_is_legacy(obj))
+ {
+ if (file) *file = sd->file;
+ if (key) *key = sd->key;
+ return;
+ }
+
efl_file_get(sd->img, file, key);
}
@@ -228,7 +247,7 @@ _efl_ui_bg_widget_efl_file_mmap_set(Eo *obj EINA_UNUSED, Efl_Ui_Bg_Widget_Data *
}
EOLIAN static void
-_efl_ui_bg_widget_efl_file_mmap_get(Eo *obj EINA_UNUSED, Efl_Ui_Bg_Widget_Data *sd,
+_efl_ui_bg_widget_efl_file_mmap_get(const Eo *obj EINA_UNUSED, Efl_Ui_Bg_Widget_Data *sd,
const Eina_File **file, const char **key)
{
efl_file_mmap_get(sd->img, file, key);
@@ -242,3 +261,34 @@ ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(MY_CLASS_PFX)
ELM_LAYOUT_CONTENT_ALIASES_OPS(MY_CLASS_PFX)
#include "efl_ui_bg_widget.eo.c"
+
+
+#include "efl_ui_bg_widget_legacy.eo.h"
+
+#define MY_CLASS_NAME_LEGACY "elm_bg"
+
+static void
+_efl_ui_bg_widget_legacy_class_constructor(Efl_Class *klass)
+{
+ evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
+}
+
+EOLIAN static Eo *
+_efl_ui_bg_widget_legacy_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED)
+{
+ obj = efl_constructor(efl_super(obj, EFL_UI_BG_WIDGET_LEGACY_CLASS));
+ efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
+ EFL_UI_BG_WIDGET_DATA_GET_OR_RETURN_VAL(obj, pd, obj);
+ efl_gfx_entity_scale_set(pd->img, 1.0);
+
+ return obj;
+}
+
+EAPI Evas_Object *
+elm_bg_add(Evas_Object *parent)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ return elm_legacy_add(EFL_UI_BG_WIDGET_LEGACY_CLASS, parent);
+}
+
+#include "efl_ui_bg_widget_legacy.eo.c"
diff --git a/src/lib/elementary/efl_ui_bg_widget.eo b/src/lib/elementary/efl_ui_bg_widget.eo
index 96a94245ca..f54775cbc9 100644
--- a/src/lib/elementary/efl_ui_bg_widget.eo
+++ b/src/lib/elementary/efl_ui_bg_widget.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Bg_Widget (Efl.Ui.Layout, Efl.Ui.Bg, Efl.Image.Load)
+class Efl.Ui.Bg_Widget (Efl.Ui.Layout.Object, Efl.Ui.Bg, Efl.Gfx.Image_Load_Controller)
{
[[The bg (background) widget is used for setting (solid) background decorations
@@ -8,12 +8,12 @@ class Efl.Ui.Bg_Widget (Efl.Ui.Layout, Efl.Ui.Bg, Efl.Image.Load)
]]
legacy_prefix: elm_bg;
implements {
- class.constructor;
Efl.Object.constructor;
+ Efl.Object.destructor;
Efl.File.file { get; set; }
Efl.File.mmap { get; set; }
Efl.Gfx.Color.color { get; set; }
- Efl.Image.scale_type { get; set; }
- Efl.Image.Load.load_size { get; set; }
+ Efl.Gfx.Image.scale_type { get; set; }
+ Efl.Gfx.Image_Load_Controller.load_size { get; set; }
}
}
diff --git a/src/lib/elementary/efl_ui_bg_widget_legacy.eo b/src/lib/elementary/efl_ui_bg_widget_legacy.eo
new file mode 100644
index 0000000000..66d38b27b1
--- /dev/null
+++ b/src/lib/elementary/efl_ui_bg_widget_legacy.eo
@@ -0,0 +1,14 @@
+class Efl.Ui.Bg_Widget_Legacy (Efl.Ui.Bg_Widget, Efl.Ui.Legacy)
+{
+ [[The bg (background) widget is used for setting (solid) background decorations
+
+ for a window (unless it has transparency enabled) or for any container object. It
+ works just like an image, but has some properties useful for backgrounds, such as
+ setting it to tiled, centered, scaled or stretched.
+ ]]
+ data: null;
+ implements {
+ class.constructor;
+ Efl.Object.constructor;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_bg_widget_private.h b/src/lib/elementary/efl_ui_bg_widget_private.h
index e09c2662f3..e886db50ba 100644
--- a/src/lib/elementary/efl_ui_bg_widget_private.h
+++ b/src/lib/elementary/efl_ui_bg_widget_private.h
@@ -28,6 +28,8 @@ struct _Efl_Ui_Bg_Widget_Data
{
Evas_Object *rect; /*<< Used for elm_bg_color_set(): elm.swallow.rectangle */
Evas_Object *img; /*<< Used for elm_bg_file_set(): elm.swallow.content */
+ const char *file; /*<< Used for elm_bg_file_set() with legacy widget */
+ const char *key; /*<< Used for elm_bg_file_set() with legacy widget */
};
/**
@@ -41,7 +43,7 @@ Efl_Ui_Bg_Widget_Data * sd = efl_data_scope_get(o, EFL_UI_BG_WIDGET_CLASS)
EFL_UI_BG_WIDGET_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -50,7 +52,7 @@ Efl_Ui_Bg_Widget_Data * sd = efl_data_scope_get(o, EFL_UI_BG_WIDGET_CLASS)
EFL_UI_BG_WIDGET_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/efl_ui_box.c b/src/lib/elementary/efl_ui_box.c
index 9274b5666b..c1bd2d8161 100644
--- a/src/lib/elementary/efl_ui_box.c
+++ b/src/lib/elementary/efl_ui_box.c
@@ -161,8 +161,8 @@ _efl_ui_box_efl_object_constructor(Eo *obj, Efl_Ui_Box_Data *pd)
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_type_set(obj, EFL_ACCESS_TYPE_SKIPPED);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_FILLER);
+ efl_access_object_access_type_set(obj, EFL_ACCESS_TYPE_SKIPPED);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_FILLER);
pd->align.h = 0.5;
pd->align.v = 0.5;
@@ -220,7 +220,7 @@ _efl_ui_box_efl_pack_unpack_all(Eo *obj, Efl_Ui_Box_Data *pd)
}
EOLIAN static Eina_Bool
-_efl_ui_box_efl_pack_unpack(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Gfx *subobj)
+_efl_ui_box_efl_pack_unpack(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Gfx_Entity *subobj)
{
Eina_Bool ret = EINA_FALSE;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
@@ -235,13 +235,13 @@ _efl_ui_box_efl_pack_unpack(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Gfx *subobj)
}
EOLIAN static Eina_Bool
-_efl_ui_box_efl_pack_pack(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNUSED, Efl_Gfx *subobj)
+_efl_ui_box_efl_pack_pack(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNUSED, Efl_Gfx_Entity *subobj)
{
return efl_pack_end(obj, subobj);
}
EOLIAN static Eina_Bool
-_efl_ui_box_efl_pack_linear_pack_end(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNUSED, Efl_Gfx *subobj)
+_efl_ui_box_efl_pack_linear_pack_end(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNUSED, Efl_Gfx_Entity *subobj)
{
Eina_Bool ret;
@@ -254,7 +254,7 @@ _efl_ui_box_efl_pack_linear_pack_end(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNUSED, E
}
EOLIAN static Eina_Bool
-_efl_ui_box_efl_pack_linear_pack_begin(Eo *obj, Efl_Ui_Box_Data *_pd EINA_UNUSED, Efl_Gfx *subobj)
+_efl_ui_box_efl_pack_linear_pack_begin(Eo *obj, Efl_Ui_Box_Data *_pd EINA_UNUSED, Efl_Gfx_Entity *subobj)
{
Eina_Bool ret;
@@ -267,7 +267,7 @@ _efl_ui_box_efl_pack_linear_pack_begin(Eo *obj, Efl_Ui_Box_Data *_pd EINA_UNUSED
}
EOLIAN static Eina_Bool
-_efl_ui_box_efl_pack_linear_pack_before(Eo *obj, Efl_Ui_Box_Data *_pd EINA_UNUSED, Efl_Gfx *subobj, const Efl_Gfx *existing)
+_efl_ui_box_efl_pack_linear_pack_before(Eo *obj, Efl_Ui_Box_Data *_pd EINA_UNUSED, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
@@ -284,7 +284,7 @@ _efl_ui_box_efl_pack_linear_pack_before(Eo *obj, Efl_Ui_Box_Data *_pd EINA_UNUSE
}
EOLIAN static Eina_Bool
-_efl_ui_box_efl_pack_linear_pack_after(Eo *obj, Efl_Ui_Box_Data *_pd EINA_UNUSED, Efl_Gfx *subobj, const Efl_Gfx *existing)
+_efl_ui_box_efl_pack_linear_pack_after(Eo *obj, Efl_Ui_Box_Data *_pd EINA_UNUSED, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
@@ -302,7 +302,7 @@ _efl_ui_box_efl_pack_linear_pack_after(Eo *obj, Efl_Ui_Box_Data *_pd EINA_UNUSED
EOLIAN static Eina_Bool
_efl_ui_box_efl_pack_linear_pack_at(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNUSED,
- Efl_Gfx *subobj, int index)
+ Efl_Gfx_Entity *subobj, int index)
{
if (!index)
return efl_pack_begin(obj, subobj);
@@ -328,13 +328,13 @@ _efl_ui_box_efl_pack_linear_pack_at(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNUSED,
}
}
-static inline Efl_Gfx *
+static inline Efl_Gfx_Entity *
_box_item(Evas_Object_Box_Option *opt)
{
return opt ? opt->obj : NULL;
}
-EOLIAN static Efl_Gfx *
+EOLIAN static Efl_Gfx_Entity *
_efl_ui_box_efl_pack_linear_pack_content_get(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNUSED,
int index)
{
@@ -365,11 +365,11 @@ _efl_ui_box_efl_pack_linear_pack_content_get(Eo *obj, Efl_Ui_Box_Data *pd EINA_U
return _box_item(eina_list_nth(bd->children, index));
}
-EOLIAN static Efl_Gfx *
+EOLIAN static Efl_Gfx_Entity *
_efl_ui_box_efl_pack_linear_pack_unpack_at(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNUSED,
int index)
{
- Efl_Gfx *content;
+ Efl_Gfx_Entity *content;
content = efl_pack_content_get(obj, index);
if (!content) return NULL;
@@ -382,7 +382,7 @@ _efl_ui_box_efl_pack_linear_pack_unpack_at(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNU
EOLIAN static int
_efl_ui_box_efl_pack_linear_pack_index_get(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNUSED,
- const Efl_Gfx *subobj)
+ const Efl_Gfx_Entity *subobj)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, -1);
Evas_Object_Box_Data *bd;
@@ -416,7 +416,7 @@ _efl_ui_box_efl_pack_layout_layout_request(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNU
static Eina_Bool
_box_item_iterator_next(Box_Item_Iterator *it, void **data)
{
- Efl_Gfx *sub;
+ Efl_Gfx_Entity *sub;
if (!eina_iterator_next(it->real_iterator, (void **) &sub))
return EINA_FALSE;
@@ -488,7 +488,7 @@ _efl_ui_box_efl_ui_direction_direction_set(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Ui_
}
EOLIAN static Efl_Ui_Dir
-_efl_ui_box_efl_ui_direction_direction_get(Eo *obj EINA_UNUSED, Efl_Ui_Box_Data *pd)
+_efl_ui_box_efl_ui_direction_direction_get(const Eo *obj EINA_UNUSED, Efl_Ui_Box_Data *pd)
{
return pd->dir;
}
@@ -514,7 +514,7 @@ _efl_ui_box_efl_pack_pack_padding_set(Eo *obj, Efl_Ui_Box_Data *pd, double h, do
}
EOLIAN static void
-_efl_ui_box_efl_pack_pack_padding_get(Eo *obj, Efl_Ui_Box_Data *pd, double *h, double *v, Eina_Bool *scalable)
+_efl_ui_box_efl_pack_pack_padding_get(const Eo *obj, Efl_Ui_Box_Data *pd, double *h, double *v, Eina_Bool *scalable)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
@@ -540,7 +540,7 @@ _efl_ui_box_efl_pack_pack_align_set(Eo *obj, Efl_Ui_Box_Data *pd, double h, doub
}
EOLIAN static void
-_efl_ui_box_efl_pack_pack_align_get(Eo *obj EINA_UNUSED, Efl_Ui_Box_Data *pd, double *h, double *v)
+_efl_ui_box_efl_pack_pack_align_get(const Eo *obj EINA_UNUSED, Efl_Ui_Box_Data *pd, double *h, double *v)
{
if (h) *h = pd->align.h;
if (v) *v = pd->align.v;
diff --git a/src/lib/elementary/efl_ui_box.eo b/src/lib/elementary/efl_ui_box.eo
index ac8834d51e..90e31ef8d5 100644
--- a/src/lib/elementary/efl_ui_box.eo
+++ b/src/lib/elementary/efl_ui_box.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Box (Elm.Widget, Efl.Pack.Linear, Efl.Pack.Layout,
+class Efl.Ui.Box (Efl.Ui.Widget, Efl.Pack_Linear, Efl.Pack_Layout,
Efl.Ui.Direction)
{
[[The box widget.
@@ -28,15 +28,15 @@ class Efl.Ui.Box (Elm.Widget, Efl.Pack.Linear, Efl.Pack.Layout,
Efl.Pack.pack;
Efl.Pack.pack_padding { get; set; }
Efl.Pack.pack_align { get; set; }
- Efl.Pack.Linear.pack_begin;
- Efl.Pack.Linear.pack_end;
- Efl.Pack.Linear.pack_before;
- Efl.Pack.Linear.pack_after;
- Efl.Pack.Linear.pack_at;
- Efl.Pack.Linear.pack_content_get;
- Efl.Pack.Linear.pack_unpack_at;
- Efl.Pack.Linear.pack_index_get;
- Efl.Pack.Layout.layout_update;
- Efl.Pack.Layout.layout_request;
+ Efl.Pack_Linear.pack_begin;
+ Efl.Pack_Linear.pack_end;
+ Efl.Pack_Linear.pack_before;
+ Efl.Pack_Linear.pack_after;
+ Efl.Pack_Linear.pack_at;
+ Efl.Pack_Linear.pack_content_get;
+ Efl.Pack_Linear.pack_unpack_at;
+ Efl.Pack_Linear.pack_index_get;
+ Efl.Pack_Layout.layout_update;
+ Efl.Pack_Layout.layout_request;
}
}
diff --git a/src/lib/elementary/efl_ui_box_flow.c b/src/lib/elementary/efl_ui_box_flow.c
index 4f69a3d290..a93ccc9e49 100644
--- a/src/lib/elementary/efl_ui_box_flow.c
+++ b/src/lib/elementary/efl_ui_box_flow.c
@@ -17,7 +17,7 @@ _efl_ui_box_flow_box_flow_homogenous_set(Eo *obj EINA_UNUSED, Efl_Ui_Box_Flow_Da
}
EOLIAN static Eina_Bool
-_efl_ui_box_flow_box_flow_homogenous_get(Eo *obj EINA_UNUSED, Efl_Ui_Box_Flow_Data *pd)
+_efl_ui_box_flow_box_flow_homogenous_get(const Eo *obj EINA_UNUSED, Efl_Ui_Box_Flow_Data *pd)
{
return pd->homogenous;
}
@@ -29,7 +29,7 @@ _efl_ui_box_flow_box_flow_max_size_set(Eo *obj EINA_UNUSED, Efl_Ui_Box_Flow_Data
}
EOLIAN static Eina_Bool
-_efl_ui_box_flow_box_flow_max_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Box_Flow_Data *pd)
+_efl_ui_box_flow_box_flow_max_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_Box_Flow_Data *pd)
{
return pd->max_size;
}
diff --git a/src/lib/elementary/efl_ui_box_flow.eo b/src/lib/elementary/efl_ui_box_flow.eo
index a9469988d6..c0cb2610a4 100644
--- a/src/lib/elementary/efl_ui_box_flow.eo
+++ b/src/lib/elementary/efl_ui_box_flow.eo
@@ -1,9 +1,9 @@
-class Efl.Ui.Box_Flow (Efl.Ui.Box, Efl.Pack.Layout)
+class Efl.Ui.Box_Flow (Efl.Ui.Box, Efl.Pack_Layout)
{
[[A custom layout engine for @Efl.Ui.Box.]]
methods {
@property box_flow_homogenous {
- [[Box flow homogenous property]]
+ [[Box flow homogenous property]]
set {}
get {}
values {
@@ -11,7 +11,7 @@ class Efl.Ui.Box_Flow (Efl.Ui.Box, Efl.Pack.Layout)
}
}
@property box_flow_max_size {
- [[Box flow maximum size property]]
+ [[Box flow maximum size property]]
set {}
get {}
values {
@@ -20,6 +20,6 @@ class Efl.Ui.Box_Flow (Efl.Ui.Box, Efl.Pack.Layout)
}
}
implements {
- Efl.Pack.Layout.layout_update;
+ Efl.Pack_Layout.layout_update;
}
}
diff --git a/src/lib/elementary/efl_ui_box_stack.eo b/src/lib/elementary/efl_ui_box_stack.eo
index 3168bb16c3..05b01cf232 100644
--- a/src/lib/elementary/efl_ui_box_stack.eo
+++ b/src/lib/elementary/efl_ui_box_stack.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Box_Stack (Efl.Ui.Box, Efl.Pack.Layout)
+class Efl.Ui.Box_Stack (Efl.Ui.Box, Efl.Pack_Layout)
{
[[A custom layout engine for @Efl.Ui.Box that stacks items.
@@ -6,6 +6,6 @@ class Efl.Ui.Box_Stack (Efl.Ui.Box, Efl.Pack.Layout)
]]
data: null;
implements {
- Efl.Pack.Layout.layout_update;
+ Efl.Pack_Layout.layout_update;
}
}
diff --git a/src/lib/elementary/efl_ui_button.c b/src/lib/elementary/efl_ui_button.c
index e2b4d09ecc..ea644b6277 100644
--- a/src/lib/elementary/efl_ui_button.c
+++ b/src/lib/elementary/efl_ui_button.c
@@ -3,21 +3,20 @@
#endif
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define ELM_LAYOUT_PROTECTED
+#define EFL_PART_PROTECTED
#include <Elementary.h>
#include "elm_priv.h"
#include "efl_ui_button_private.h"
#include "elm_widget_layout.h"
-#include "efl_ui_button_part.eo.h"
#include "elm_part_helper.h"
#define MY_CLASS EFL_UI_BUTTON_CLASS
#define MY_CLASS_PFX efl_ui_button
#define MY_CLASS_NAME "Efl.Ui.Button"
-#define MY_CLASS_NAME_LEGACY "elm_button"
static const char SIG_CLICKED[] = "clicked";
static const char SIG_REPEATED[] = "repeated";
@@ -42,12 +41,6 @@ static const Elm_Layout_Part_Alias_Description _content_aliases[] =
{NULL, NULL}
};
-static const Elm_Layout_Part_Alias_Description _text_aliases[] =
-{
- {"default", "elm.text"},
- {NULL, NULL}
-};
-
static Eina_Bool _key_action_activate(Evas_Object *obj, const char *params);
static const Elm_Action key_actions[] = {
@@ -55,6 +48,14 @@ static const Elm_Action key_actions[] = {
{NULL, NULL}
};
+#define MY_CLASS_NAME_LEGACY "elm_button"
+
+static void
+_efl_ui_button_class_constructor(Efl_Class *klass)
+{
+ evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
+}
+
static void
_activate(Evas_Object *obj)
{
@@ -88,78 +89,19 @@ _efl_ui_button_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Button_Data *_pd EINA_UNUS
}
EOLIAN static Eina_Bool
-_efl_ui_button_elm_widget_on_access_activate(Eo *obj, Efl_Ui_Button_Data *_pd EINA_UNUSED, Efl_Ui_Activate act)
+_efl_ui_button_efl_ui_widget_on_access_activate(Eo *obj, Efl_Ui_Button_Data *_pd EINA_UNUSED, Efl_Ui_Activate act)
{
if (elm_widget_disabled_get(obj)) return EINA_FALSE;
if (act != EFL_UI_ACTIVATE_DEFAULT) return EINA_FALSE;
if (evas_object_freeze_events_get(obj)) return EINA_FALSE;
efl_event_callback_legacy_call
- (obj, EFL_UI_EVENT_CLICKED, NULL);
- elm_layout_signal_emit(obj, "elm,anim,activate", "elm");
-
- return EINA_TRUE;
-}
-
-/* FIXME: replicated from elm_layout just because button's icon spot
- * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
- * can changed the theme API */
-static void
-_icon_signal_emit(Evas_Object *obj)
-{
- char buf[64];
-
- snprintf(buf, sizeof(buf), "elm,state,icon,%s",
- elm_layout_content_get(obj, "icon") ? "visible" : "hidden");
-
- elm_layout_signal_emit(obj, buf, "elm");
- edje_object_message_signal_process(elm_layout_edje_get(obj));
- elm_layout_sizing_eval(obj);
-}
-
-/* FIXME: replicated from elm_layout just because button's icon spot
- * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
- * can changed the theme API */
-EOLIAN static Efl_Ui_Theme_Apply
-_efl_ui_button_elm_widget_theme_apply(Eo *obj, Efl_Ui_Button_Data *_pd EINA_UNUSED)
-{
- Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
-
- int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
- if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
- _icon_signal_emit(obj);
-
- return int_ret;
-}
+ (obj, EFL_UI_EVENT_CLICKED, NULL);
-/* FIXME: replicated from elm_layout just because button's icon spot
- * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
- * can changed the theme API */
-EOLIAN static Eina_Bool
-_efl_ui_button_elm_widget_widget_sub_object_del(Eo *obj, Efl_Ui_Button_Data *_pd EINA_UNUSED, Evas_Object *sobj)
-{
- Eina_Bool int_ret = EINA_FALSE;
-
- int_ret = elm_widget_sub_object_del(efl_super(obj, MY_CLASS), sobj);
- if (!int_ret) return EINA_FALSE;
-
- _icon_signal_emit(obj);
-
- return EINA_TRUE;
-}
-
-/* FIXME: replicated from elm_layout just because button's icon spot
- * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
- * can changed the theme API */
-static Eina_Bool
-_efl_ui_button_content_set(Eo *obj, Efl_Ui_Button_Data *_pd EINA_UNUSED, const char *part, Evas_Object *content)
-{
- Eina_Bool int_ret = EINA_FALSE;
-
- int_ret = efl_content_set(efl_part(efl_super(obj, MY_CLASS), part), content);
- if (!int_ret) return EINA_FALSE;
-
- _icon_signal_emit(obj);
+ if (elm_widget_is_legacy(obj))
+ elm_layout_signal_emit(obj, "elm,anim,activate", "elm");
+ else
+ elm_layout_signal_emit(obj, "efl,anim,activate", "efl");
return EINA_TRUE;
}
@@ -167,7 +109,10 @@ _efl_ui_button_content_set(Eo *obj, Efl_Ui_Button_Data *_pd EINA_UNUSED, const c
static Eina_Bool
_key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED)
{
- elm_layout_signal_emit(obj, "elm,anim,activate", "elm");
+ if (elm_widget_is_legacy(obj))
+ elm_layout_signal_emit(obj, "elm,anim,activate", "elm");
+ else
+ elm_layout_signal_emit(obj, "efl,anim,activate", "efl");
_activate(obj);
return EINA_TRUE;
}
@@ -275,15 +220,30 @@ _efl_ui_button_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Button_Data *_pd EINA_
efl_canvas_group_add(efl_super(obj, MY_CLASS));
elm_widget_sub_object_parent_add(obj);
- edje_object_signal_callback_add
- (wd->resize_obj, "elm,action,click", "*",
- _on_clicked_signal, obj);
- edje_object_signal_callback_add
- (wd->resize_obj, "elm,action,press", "*",
- _on_pressed_signal, obj);
- edje_object_signal_callback_add
- (wd->resize_obj, "elm,action,unpress", "*",
- _on_unpressed_signal, obj);
+ if (elm_widget_is_legacy(obj))
+ {
+ edje_object_signal_callback_add
+ (wd->resize_obj, "elm,action,click", "*",
+ _on_clicked_signal, obj);
+ edje_object_signal_callback_add
+ (wd->resize_obj, "elm,action,press", "*",
+ _on_pressed_signal, obj);
+ edje_object_signal_callback_add
+ (wd->resize_obj, "elm,action,unpress", "*",
+ _on_unpressed_signal, obj);
+ }
+ else
+ {
+ edje_object_signal_callback_add
+ (wd->resize_obj, "efl,action,click", "*",
+ _on_clicked_signal, obj);
+ edje_object_signal_callback_add
+ (wd->resize_obj, "efl,action,press", "*",
+ _on_pressed_signal, obj);
+ edje_object_signal_callback_add
+ (wd->resize_obj, "efl,action,unpress", "*",
+ _on_unpressed_signal, obj);
+ }
_elm_access_object_register(obj, wd->resize_obj);
_elm_access_text_set
@@ -302,20 +262,12 @@ _efl_ui_button_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Button_Data *_pd EINA_
CRI("Failed to set layout!");
}
-EAPI Evas_Object *
-elm_button_add(Evas_Object *parent)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return elm_legacy_add(MY_CLASS, parent);
-}
-
EOLIAN static Eo *
_efl_ui_button_efl_object_constructor(Eo *obj, Efl_Ui_Button_Data *_pd EINA_UNUSED)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
- efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_PUSH_BUTTON);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_PUSH_BUTTON);
return obj;
}
@@ -340,13 +292,13 @@ _internal_efl_ui_button_autorepeat_supported_get(const Evas_Object *obj)
}
EOLIAN static Eina_Bool
-_efl_ui_button_efl_ui_autorepeat_autorepeat_supported_get(Eo *obj EINA_UNUSED, Efl_Ui_Button_Data *_pd EINA_UNUSED)
+_efl_ui_button_efl_ui_autorepeat_autorepeat_supported_get(const Eo *obj EINA_UNUSED, Efl_Ui_Button_Data *_pd EINA_UNUSED)
{
return EINA_TRUE;
}
EOLIAN static Eina_Bool
-_efl_ui_button_efl_ui_autorepeat_autorepeat_enabled_get(Eo *obj, Efl_Ui_Button_Data *sd)
+_efl_ui_button_efl_ui_autorepeat_autorepeat_enabled_get(const Eo *obj, Efl_Ui_Button_Data *sd)
{
return (_AR_CAPABLE(obj) & sd->autorepeat);
}
@@ -366,7 +318,7 @@ _efl_ui_button_efl_ui_autorepeat_autorepeat_initial_timeout_set(Eo *obj, Efl_Ui_
}
EOLIAN static double
-_efl_ui_button_efl_ui_autorepeat_autorepeat_initial_timeout_get(Eo *obj, Efl_Ui_Button_Data *sd)
+_efl_ui_button_efl_ui_autorepeat_autorepeat_initial_timeout_get(const Eo *obj, Efl_Ui_Button_Data *sd)
{
if (!_AR_CAPABLE(obj))
return 0.0;
@@ -390,13 +342,13 @@ _efl_ui_button_efl_ui_autorepeat_autorepeat_gap_timeout_set(Eo *obj, Efl_Ui_Butt
}
EOLIAN static double
-_efl_ui_button_efl_ui_autorepeat_autorepeat_gap_timeout_get(Eo *obj EINA_UNUSED, Efl_Ui_Button_Data *sd)
+_efl_ui_button_efl_ui_autorepeat_autorepeat_gap_timeout_get(const Eo *obj EINA_UNUSED, Efl_Ui_Button_Data *sd)
{
return sd->ar_gap_timeout;
}
EOLIAN const Efl_Access_Action_Data *
-_efl_ui_button_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Efl_Ui_Button_Data *pd EINA_UNUSED)
+_efl_ui_button_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Efl_Ui_Button_Data *pd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "activate", "activate", NULL, _key_action_activate },
@@ -405,33 +357,12 @@ _efl_ui_button_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Efl
return &atspi_actions[0];
}
-static void
-_efl_ui_button_class_constructor(Efl_Class *klass)
-{
- evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
-}
-
/* Standard widget overrides */
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_button, Efl_Ui_Button_Data)
ELM_PART_TEXT_DEFAULT_IMPLEMENT(efl_ui_button, Efl_Ui_Button_Data)
-ELM_PART_CONTENT_DEFAULT_GET(efl_ui_button, _content_aliases[0].real_part)
ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_button, Efl_Ui_Button_Data)
-/* Efl.Part begin */
-
-static Eina_Bool
-_part_is_efl_ui_button_part(const Eo *obj EINA_UNUSED, const char *part)
-{
- return eina_streq(part, "elm.swallow.content");
-}
-
-ELM_PART_OVERRIDE_PARTIAL(efl_ui_button, EFL_UI_BUTTON, Efl_Ui_Button_Data, _part_is_efl_ui_button_part)
-ELM_PART_OVERRIDE_CONTENT_SET(efl_ui_button, EFL_UI_BUTTON, Efl_Ui_Button_Data)
-#include "efl_ui_button_part.eo.c"
-
-/* Efl.Part end */
-
EAPI void
elm_button_autorepeat_initial_timeout_set(Evas_Object *obj, double t)
{
@@ -471,12 +402,108 @@ elm_button_autorepeat_get(const Evas_Object *obj)
/* Internal EO APIs and hidden overrides */
ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(MY_CLASS_PFX)
-ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX)
#define EFL_UI_BUTTON_EXTRA_OPS \
ELM_LAYOUT_CONTENT_ALIASES_OPS(MY_CLASS_PFX), \
- ELM_LAYOUT_TEXT_ALIASES_OPS(MY_CLASS_PFX), \
ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_button), \
EFL_CANVAS_GROUP_ADD_OPS(efl_ui_button)
#include "efl_ui_button.eo.c"
+
+#include "efl_ui_button_legacy.eo.h"
+#include "efl_ui_button_legacy_part.eo.h"
+
+EOLIAN static Eo *
+_efl_ui_button_legacy_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED)
+{
+ obj = efl_constructor(efl_super(obj, EFL_UI_BUTTON_LEGACY_CLASS));
+ efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
+ return obj;
+}
+
+/* FIXME: replicated from elm_layout just because button's icon spot
+ * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
+ * can changed the theme API */
+static void
+_icon_signal_emit(Evas_Object *obj)
+{
+ char buf[64];
+
+ if (!elm_widget_resize_object_get(obj)) return;
+ snprintf(buf, sizeof(buf), "elm,state,icon,%s",
+ elm_layout_content_get(obj, "icon") ? "visible" : "hidden");
+
+ elm_layout_signal_emit(obj, buf, "elm");
+ edje_object_message_signal_process(elm_layout_edje_get(obj));
+ elm_layout_sizing_eval(obj);
+}
+
+/* FIXME: replicated from elm_layout just because button's icon spot
+ * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
+ * can changed the theme API */
+EOLIAN static Efl_Ui_Theme_Apply
+_efl_ui_button_legacy_efl_ui_widget_theme_apply(Eo *obj, void *_pd EINA_UNUSED)
+{
+ Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
+
+ int_ret = efl_ui_widget_theme_apply(efl_super(obj, EFL_UI_BUTTON_LEGACY_CLASS));
+ if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
+ _icon_signal_emit(obj);
+
+ return int_ret;
+}
+
+/* FIXME: replicated from elm_layout just because button's icon spot
+ * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
+ * can changed the theme API */
+EOLIAN static Eina_Bool
+_efl_ui_button_legacy_efl_ui_widget_widget_sub_object_del(Eo *obj, void *_pd EINA_UNUSED, Evas_Object *sobj)
+{
+ Eina_Bool int_ret = EINA_FALSE;
+
+ int_ret = elm_widget_sub_object_del(efl_super(obj, EFL_UI_BUTTON_LEGACY_CLASS), sobj);
+ if (!int_ret) return EINA_FALSE;
+
+ _icon_signal_emit(obj);
+
+ return EINA_TRUE;
+}
+
+/* FIXME: replicated from elm_layout just because button's icon spot
+ * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
+ * can changed the theme API */
+static Eina_Bool
+_efl_ui_button_legacy_content_set(Eo *obj, void *_pd EINA_UNUSED, const char *part, Evas_Object *content)
+{
+ Eina_Bool int_ret = EINA_FALSE;
+
+ int_ret = efl_content_set(efl_part(efl_super(obj, EFL_UI_BUTTON_LEGACY_CLASS), part), content);
+ if (!int_ret) return EINA_FALSE;
+
+ _icon_signal_emit(obj);
+
+ return EINA_TRUE;
+}
+
+/* Efl.Part begin */
+
+static Eina_Bool
+_part_is_efl_ui_button_legacy_part(const Eo *obj EINA_UNUSED, const char *part)
+{
+ return eina_streq(part, "elm.swallow.content");
+}
+
+ELM_PART_OVERRIDE_PARTIAL(efl_ui_button_legacy, EFL_UI_BUTTON_LEGACY, void, _part_is_efl_ui_button_legacy_part)
+ELM_PART_OVERRIDE_CONTENT_SET_NO_SD(efl_ui_button_legacy)
+#include "efl_ui_button_legacy_part.eo.c"
+
+/* Efl.Part end */
+
+EAPI Evas_Object *
+elm_button_add(Evas_Object *parent)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ return elm_legacy_add(EFL_UI_BUTTON_LEGACY_CLASS, parent);
+}
+
+#include "efl_ui_button_legacy.eo.c"
diff --git a/src/lib/elementary/efl_ui_button.eo b/src/lib/elementary/efl_ui_button.eo
index 12b118a782..3ce8c7dcc3 100644
--- a/src/lib/elementary/efl_ui_button.eo
+++ b/src/lib/elementary/efl_ui_button.eo
@@ -1,5 +1,5 @@
-class Efl.Ui.Button (Efl.Ui.Layout, Efl.Ui.Clickable, Efl.Ui.Autorepeat,
- Efl.Text, Efl.Text.Markup, Efl.Content,
+class Efl.Ui.Button (Efl.Ui.Layout.Object, Efl.Ui.Clickable, Efl.Ui.Autorepeat,
+ Efl.Text, Efl.Text_Markup, Efl.Content,
Efl.Access.Widget.Action, Efl.Ui.Translatable)
{
[[Push-button widget
@@ -15,12 +15,9 @@ class Efl.Ui.Button (Efl.Ui.Layout, Efl.Ui.Clickable, Efl.Ui.Autorepeat,
Efl.Ui.Autorepeat.autorepeat_gap_timeout { set; get; }
Efl.Ui.Autorepeat.autorepeat_enabled { set; get; }
Efl.Ui.Autorepeat.autorepeat_supported { get;}
- Elm.Widget.on_access_activate;
- Elm.Widget.theme_apply;
- Elm.Widget.widget_sub_object_del;
- Elm.Widget.widget_event;
+ Efl.Ui.Widget.on_access_activate;
+ Efl.Ui.Widget.widget_event;
Efl.Access.Widget.Action.elm_actions { get; }
- Efl.Part.part;
Efl.Content.content { get; set; }
Efl.Content.content_unset;
Efl.Text.text { get; set; }
diff --git a/src/lib/elementary/efl_ui_button_legacy.eo b/src/lib/elementary/efl_ui_button_legacy.eo
new file mode 100644
index 0000000000..bf01ef88ce
--- /dev/null
+++ b/src/lib/elementary/efl_ui_button_legacy.eo
@@ -0,0 +1,15 @@
+class Efl.Ui.Button_Legacy (Efl.Ui.Button, Efl.Ui.Legacy)
+{
+ [[Push-button widget
+
+ Press it and run some function. It can contain a simple label and icon
+ object and it also has an autorepeat feature.
+ ]]
+ data: null;
+ implements {
+ Efl.Object.constructor;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.widget_sub_object_del;
+ Efl.Part.part_get;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_button_part.eo b/src/lib/elementary/efl_ui_button_legacy_part.eo
index d4c807dcc6..15b07c863f 100644
--- a/src/lib/elementary/efl_ui_button_part.eo
+++ b/src/lib/elementary/efl_ui_button_legacy_part.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Button.Part (Efl.Ui.Layout.Part_Content)
+class Efl.Ui.Button_Legacy_Part (Efl.Ui.Layout.Part_Content)
{
[[Elementary button internal part class]]
data: null;
diff --git a/src/lib/elementary/efl_ui_button_private.h b/src/lib/elementary/efl_ui_button_private.h
index 49bfcdbae4..25326202f6 100644
--- a/src/lib/elementary/efl_ui_button_private.h
+++ b/src/lib/elementary/efl_ui_button_private.h
@@ -47,7 +47,7 @@ typedef struct _Efl_Ui_button_Data
ELM_BUTTON_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -56,7 +56,7 @@ typedef struct _Efl_Ui_button_Data
ELM_BUTTON_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/efl_ui_calendar.c b/src/lib/elementary/efl_ui_calendar.c
index 492b588614..7eedec1f1f 100644
--- a/src/lib/elementary/efl_ui_calendar.c
+++ b/src/lib/elementary/efl_ui_calendar.c
@@ -16,10 +16,10 @@
#define MY_CLASS_NAME "Efl.Ui.Calendar"
#define MY_CLASS_PFX efl_ui_calendar
-#define EFL_UI_CALENDAR_BUTTON_LEFT "elm,calendar,button,left"
-#define EFL_UI_CALENDAR_BUTTON_RIGHT "elm,calendar,button,right"
-#define EFL_UI_CALENDAR_BUTTON_YEAR_LEFT "elm,calendar,button_year,left"
-#define EFL_UI_CALENDAR_BUTTON_YEAR_RIGHT "elm,calendar,button_year,right"
+#define EFL_UI_CALENDAR_BUTTON_LEFT "efl.calendar.button.left"
+#define EFL_UI_CALENDAR_BUTTON_RIGHT "efl.calendar.button.right"
+#define EFL_UI_CALENDAR_BUTTON_YEAR_LEFT "efl.calendar.button_year.left"
+#define EFL_UI_CALENDAR_BUTTON_YEAR_RIGHT "efl.calendar.button_year.right"
static const char PART_NAME_DEC_BUTTON[] = "dec_button";
static const char PART_NAME_INC_BUTTON[] = "inc_button";
@@ -112,7 +112,7 @@ _unselect(Evas_Object *obj,
char emission[32];
snprintf(emission, sizeof(emission), "cit_%d,unselected", selected);
- elm_layout_signal_emit(obj, emission, "elm");
+ elm_layout_signal_emit(obj, emission, "efl");
}
static inline void
@@ -125,7 +125,7 @@ _select(Evas_Object *obj,
sd->focused_it = sd->selected_it = selected;
snprintf(emission, sizeof(emission), "cit_%d,selected", selected);
- elm_layout_signal_emit(obj, emission, "elm");
+ elm_layout_signal_emit(obj, emission, "efl");
}
static inline void
@@ -134,7 +134,7 @@ _not_today(Efl_Ui_Calendar_Data *sd)
char emission[32];
snprintf(emission, sizeof(emission), "cit_%d,not_today", sd->today_it);
- elm_layout_signal_emit(sd->obj, emission, "elm");
+ elm_layout_signal_emit(sd->obj, emission, "efl");
sd->today_it = -1;
}
@@ -145,7 +145,7 @@ _today(Efl_Ui_Calendar_Data *sd,
char emission[32];
snprintf(emission, sizeof(emission), "cit_%d,today", it);
- elm_layout_signal_emit(sd->obj, emission, "elm");
+ elm_layout_signal_emit(sd->obj, emission, "efl");
sd->today_it = it;
}
@@ -156,7 +156,7 @@ _enable(Efl_Ui_Calendar_Data *sd,
char emission[32];
snprintf(emission, sizeof(emission), "cit_%d,enable", it);
- elm_layout_signal_emit(sd->obj, emission, "elm");
+ elm_layout_signal_emit(sd->obj, emission, "efl");
}
static inline void
@@ -166,7 +166,7 @@ _disable(Efl_Ui_Calendar_Data *sd,
char emission[32];
snprintf(emission, sizeof(emission), "cit_%d,disable", it);
- elm_layout_signal_emit(sd->obj, emission, "elm");
+ elm_layout_signal_emit(sd->obj, emission, "efl");
}
static void
@@ -225,7 +225,7 @@ static void
_access_calendar_item_register(Evas_Object *obj)
{
unsigned int maxdays, i;
- char day_s[13], pname[14];
+ char day_s[13], pname[18];
unsigned day = 0;
Evas_Object *ao;
@@ -237,7 +237,7 @@ _access_calendar_item_register(Evas_Object *obj)
if ((!day) && (i == sd->first_day_it)) day = 1;
if ((day) && (day <= maxdays))
{
- snprintf(pname, sizeof(pname), "cit_%d.access", i);
+ snprintf(pname, sizeof(pname), "efl.cit_%d.access", i);
ao = _elm_access_edje_object_part_object_register
(obj, elm_layout_edje_get(obj), pname);
@@ -251,7 +251,7 @@ _access_calendar_item_register(Evas_Object *obj)
}
else
{
- snprintf(pname, sizeof(pname), "cit_%d.access", i);
+ snprintf(pname, sizeof(pname), "efl.cit_%d.access", i);
_elm_access_edje_object_part_object_unregister
(obj, elm_layout_edje_get(obj), pname);
}
@@ -261,7 +261,7 @@ _access_calendar_item_register(Evas_Object *obj)
static void
_access_calendar_spinner_register(Evas_Object *obj)
{
- Evas_Object *po;
+ Evas_Object *po, *o;
Elm_Access_Info *ai;
EFL_UI_CALENDAR_DATA_GET(obj, sd);
@@ -285,8 +285,10 @@ _access_calendar_spinner_register(Evas_Object *obj)
ai = _elm_access_info_get(sd->year_access);
_elm_access_text_set(ai, ELM_ACCESS_TYPE, E_("calendar year"));
- po = (Evas_Object *)edje_object_part_object_get
- (elm_layout_edje_get(obj), "month_text");
+ o = elm_layout_edje_get(obj);
+ edje_object_freeze(o);
+ po = (Evas_Object *)edje_object_part_object_get(o, "month_text");
+ edje_object_thaw(o);
evas_object_pass_events_set(po, EINA_FALSE);
}
@@ -323,7 +325,7 @@ static void
_populate(Evas_Object *obj)
{
int maxdays, prev_month_maxdays, day, mon, yr, i;
- char part[12], day_s[3];
+ char part[16], day_s[3];
struct tm first_day;
EFL_UI_CALENDAR_DATA_GET(obj, sd);
@@ -395,7 +397,7 @@ _populate(Evas_Object *obj)
snprintf(day_s, sizeof(day_s), "%d", i - sd->first_day_it - maxdays + 1);
}
- snprintf(part, sizeof(part), "cit_%d.text", i);
+ snprintf(part, sizeof(part), "efl.cit_%d.text", i);
elm_layout_text_set(obj, part, day_s);
}
@@ -414,7 +416,7 @@ _populate(Evas_Object *obj)
static void
_set_headers(Evas_Object *obj)
{
- static char part[] = "ch_0.text";
+ static char part[] = "efl.ch_0.text";
int i;
struct tm *t;
time_t temp = 259200; // the first sunday since epoch
@@ -450,7 +452,7 @@ _set_headers(Evas_Object *obj)
for (i = 0; i < ELM_DAY_LAST; i++)
{
- part[3] = i + '0';
+ part[7] = i + '0';
elm_layout_text_set(obj, part, sd->weekdays[(i + sd->first_week_day) % ELM_DAY_LAST]);
}
@@ -528,7 +530,7 @@ _spinner_buttons_add(Evas_Object *obj, Efl_Ui_Calendar_Data *sd)
}
EOLIAN static Efl_Ui_Theme_Apply
-_efl_ui_calendar_elm_widget_theme_apply(Eo *obj, Efl_Ui_Calendar_Data *sd)
+_efl_ui_calendar_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Calendar_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
@@ -759,7 +761,7 @@ _update_unfocused_it(Evas_Object *obj, int unfocused_it)
sd->focused_it = -1;
snprintf(emission, sizeof(emission), "cit_%d,unfocused", unfocused_it);
- elm_layout_signal_emit(obj, emission, "elm");
+ elm_layout_signal_emit(obj, emission, "efl");
}
static Eina_Bool
@@ -775,12 +777,12 @@ _update_focused_it(Evas_Object *obj, int focused_it)
return EINA_FALSE;
snprintf(emission, sizeof(emission), "cit_%d,unfocused", sd->focused_it);
- elm_layout_signal_emit(obj, emission, "elm");
+ elm_layout_signal_emit(obj, emission, "efl");
sd->focused_it = focused_it;
snprintf(emission, sizeof(emission), "cit_%d,focused", sd->focused_it);
- elm_layout_signal_emit(obj, emission, "elm");
+ elm_layout_signal_emit(obj, emission, "efl");
return EINA_TRUE;
}
@@ -863,11 +865,11 @@ _key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED)
}
EOLIAN static Eina_Bool
-_efl_ui_calendar_elm_widget_on_focus_update(Eo *obj, Efl_Ui_Calendar_Data *sd, Elm_Object_Item *item EINA_UNUSED)
+_efl_ui_calendar_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Calendar_Data *sd)
{
Eina_Bool int_ret = EINA_FALSE;
- int_ret = efl_ui_widget_on_focus_update(efl_super(obj, MY_CLASS), NULL);
+ int_ret = efl_ui_focus_object_on_focus_update(efl_super(obj, MY_CLASS));
if (!int_ret) return EINA_FALSE;
// FIXME : Currently, focused item is same with selected item.
@@ -930,8 +932,8 @@ _access_obj_process(Evas_Object *obj, Eina_Bool is_access)
if ((!day) && (i == sd->first_day_it)) day = 1;
if ((day) && (day <= maxdays))
{
- char pname[14];
- snprintf(pname, sizeof(pname), "cit_%d.access", i);
+ char pname[18];
+ snprintf(pname, sizeof(pname), "efl.cit_%d.access", i);
_elm_access_edje_object_part_object_unregister
(obj, elm_layout_edje_get(obj), pname);
@@ -957,7 +959,7 @@ _access_obj_process(Evas_Object *obj, Eina_Bool is_access)
}
EOLIAN static void
-_efl_ui_calendar_elm_widget_on_access_update(Eo *obj EINA_UNUSED, Efl_Ui_Calendar_Data *_pd EINA_UNUSED, Eina_Bool acs)
+_efl_ui_calendar_efl_ui_widget_on_access_update(Eo *obj EINA_UNUSED, Efl_Ui_Calendar_Data *_pd EINA_UNUSED, Eina_Bool acs)
{
_efl_ui_calendar_smart_focus_next_enable = acs;
_access_obj_process(obj, _efl_ui_calendar_smart_focus_next_enable);
@@ -986,7 +988,7 @@ _efl_ui_calendar_constructor_internal(Eo *obj, Efl_Ui_Calendar_Data *priv)
priv->format_cb = NULL;
edje_object_signal_callback_add
- (wd->resize_obj, "elm,action,selected", "*",
+ (wd->resize_obj, "efl,action,selected", "*",
_day_selected, obj);
current_date = time(NULL);
@@ -1028,7 +1030,7 @@ _efl_ui_calendar_efl_object_constructor(Eo *obj, Efl_Ui_Calendar_Data *sd)
obj = efl_constructor(efl_super(obj, MY_CLASS));
sd->obj = obj;
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_DATE_EDITOR);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_DATE_EDITOR);
obj = _efl_ui_calendar_constructor_internal(obj, sd);
@@ -1103,7 +1105,7 @@ _efl_ui_calendar_date_min_set(Eo *obj, Efl_Ui_Calendar_Data *sd, Efl_Time min)
}
EOLIAN static Efl_Time
-_efl_ui_calendar_date_min_get(Eo *obj EINA_UNUSED, Efl_Ui_Calendar_Data *sd)
+_efl_ui_calendar_date_min_get(const Eo *obj EINA_UNUSED, Efl_Ui_Calendar_Data *sd)
{
return sd->date_min;
}
@@ -1164,7 +1166,7 @@ _efl_ui_calendar_date_max_set(Eo *obj, Efl_Ui_Calendar_Data *sd, Efl_Time max)
}
EOLIAN static Efl_Time
-_efl_ui_calendar_date_max_get(Eo *obj EINA_UNUSED, Efl_Ui_Calendar_Data *sd)
+_efl_ui_calendar_date_max_get(const Eo *obj EINA_UNUSED, Efl_Ui_Calendar_Data *sd)
{
return sd->date_max;
}
@@ -1204,7 +1206,7 @@ _efl_ui_calendar_date_set(Eo *obj, Efl_Ui_Calendar_Data *sd, Efl_Time date)
}
EOLIAN static Efl_Time
-_efl_ui_calendar_date_get(Eo *obj EINA_UNUSED, Efl_Ui_Calendar_Data *sd)
+_efl_ui_calendar_date_get(const Eo *obj EINA_UNUSED, Efl_Ui_Calendar_Data *sd)
{
return sd->date;
}
@@ -1238,7 +1240,7 @@ _efl_ui_calendar_first_day_of_week_set(Eo *obj, Efl_Ui_Calendar_Data *sd, Efl_Ui
}
EOLIAN static Efl_Ui_Calendar_Weekday
-_efl_ui_calendar_first_day_of_week_get(Eo *obj EINA_UNUSED, Efl_Ui_Calendar_Data *sd)
+_efl_ui_calendar_first_day_of_week_get(const Eo *obj EINA_UNUSED, Efl_Ui_Calendar_Data *sd)
{
return sd->first_week_day;
}
@@ -1253,7 +1255,7 @@ _efl_ui_calendar_class_constructor(Efl_Class *klass)
}
EOLIAN static const Efl_Access_Action_Data*
-_efl_ui_calendar_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Efl_Ui_Calendar_Data *sd EINA_UNUSED)
+_efl_ui_calendar_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Efl_Ui_Calendar_Data *sd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "activate", "activate", NULL, _key_action_activate},
@@ -1281,14 +1283,16 @@ typedef struct {
EOLIAN static void
_efl_ui_calendar_item_day_number_set(Eo *obj, Efl_Ui_Calendar_Item_Data *pd, int i)
{
- char pname[14];
- Evas_Object *po;
+ char pname[18];
+ Evas_Object *po, *o;
pd->v = i;
- snprintf(pname, sizeof(pname), "cit_%i.access", i);
+ snprintf(pname, sizeof(pname), "efl.cit_%i.access", i);
- po = (Evas_Object *)edje_object_part_object_get
- (elm_layout_edje_get(efl_parent_get(obj)), pname);
+ o = elm_layout_edje_get(efl_parent_get(obj));
+ edje_object_freeze(o);
+ po = (Evas_Object *)edje_object_part_object_get(o, pname);
+ edje_object_thaw(o);
if (_elm_config->access_mode != ELM_ACCESS_MODE_ON)
pd->part = po;
@@ -1299,7 +1303,7 @@ _efl_ui_calendar_item_day_number_set(Eo *obj, Efl_Ui_Calendar_Item_Data *pd, int
}
EOLIAN static int
-_efl_ui_calendar_item_day_number_get(Eo *obj EINA_UNUSED, Efl_Ui_Calendar_Item_Data *pd)
+_efl_ui_calendar_item_day_number_get(const Eo *obj EINA_UNUSED, Efl_Ui_Calendar_Item_Data *pd)
{
return pd->v;
}
@@ -1314,9 +1318,9 @@ _efl_ui_calendar_item_efl_ui_focus_object_focus_set(Eo *obj, Efl_Ui_Calendar_Ite
}
EOLIAN static Eina_Rect
-_efl_ui_calendar_item_efl_ui_focus_object_focus_geometry_get(Eo *obj EINA_UNUSED, Efl_Ui_Calendar_Item_Data *pd)
+_efl_ui_calendar_item_efl_ui_focus_object_focus_geometry_get(const Eo *obj EINA_UNUSED, Efl_Ui_Calendar_Item_Data *pd)
{
- return efl_gfx_geometry_get(pd->part);
+ return efl_gfx_entity_geometry_get(pd->part);
}
#include "efl_ui_calendar_item.eo.c"
diff --git a/src/lib/elementary/efl_ui_calendar.eo b/src/lib/elementary/efl_ui_calendar.eo
index 35ac4d9069..08a95ef20d 100644
--- a/src/lib/elementary/efl_ui_calendar.eo
+++ b/src/lib/elementary/efl_ui_calendar.eo
@@ -1,6 +1,6 @@
import efl_types;
-enum Efl.Ui.Calendar.Weekday
+enum Efl.Ui.Calendar_Weekday
{
[[A weekday
@@ -16,7 +16,7 @@ enum Efl.Ui.Calendar.Weekday
last [[Sentinel value to indicate last enum field during iteration]]
}
-class Efl.Ui.Calendar (Efl.Ui.Layout, Efl.Ui.Focus.Composition, Efl.Access.Widget.Action, Efl.Ui.Format)
+class Efl.Ui.Calendar (Efl.Ui.Layout.Object, Efl.Ui.Focus.Composition, Efl.Access.Widget.Action, Efl.Ui.Format)
{
[[Calendar widget
@@ -32,7 +32,7 @@ class Efl.Ui.Calendar (Efl.Ui.Layout, Efl.Ui.Focus.Composition, Efl.Access.Widge
in France or Sunday in the US).
]]
values {
- day: Efl.Ui.Calendar.Weekday(Efl.Ui.Calendar.Weekday.sunday);
+ day: Efl.Ui.Calendar_Weekday(Efl.Ui.Calendar_Weekday.sunday);
[[The first day of the week.]]
}
}
@@ -106,14 +106,14 @@ class Efl.Ui.Calendar (Efl.Ui.Layout, Efl.Ui.Focus.Composition, Efl.Access.Widge
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Canvas.Group.group_calculate;
- Elm.Widget.theme_apply;
- Elm.Widget.on_access_update;
- Elm.Widget.on_focus_update;
- Elm.Widget.widget_event;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.on_access_update;
+ Efl.Ui.Focus.Object.on_focus_update;
+ Efl.Ui.Widget.widget_event;
Efl.Access.Widget.Action.elm_actions { get; }
Efl.Ui.Format.format_cb { set; }
}
events {
- changed; [[Emitted when the selected date in the calendar is changed]]
+ changed: void; [[Emitted when the selected date in the calendar is changed]]
}
}
diff --git a/src/lib/elementary/efl_ui_calendar_item.eo b/src/lib/elementary/efl_ui_calendar_item.eo
index d567c5193d..d2d5c46609 100644
--- a/src/lib/elementary/efl_ui_calendar_item.eo
+++ b/src/lib/elementary/efl_ui_calendar_item.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Calendar.Item (Efl.Object, Efl.Ui.Focus.Object)
+class Efl.Ui.Calendar_Item (Efl.Object, Efl.Ui.Focus.Object)
{
[[EFL UI Calendar Item class]]
methods {
diff --git a/src/lib/elementary/efl_ui_check.c b/src/lib/elementary/efl_ui_check.c
index fc4ff5c7e4..4b38992e3b 100644
--- a/src/lib/elementary/efl_ui_check.c
+++ b/src/lib/elementary/efl_ui_check.c
@@ -2,21 +2,23 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define ELM_LAYOUT_PROTECTED
#define EFL_UI_NSTATE_PROTECTED
+#define EFL_PART_PROTECTED
#include <Elementary.h>
#include "elm_priv.h"
#include "efl_ui_nstate.eo.h"
#include "efl_ui_check_private.h"
+#include "efl_ui_nstate_private.h"
+#include "elm_part_helper.h"
#define MY_CLASS EFL_UI_CHECK_CLASS
#define MY_CLASS_PFX efl_ui_check
#define MY_CLASS_NAME "Efl.Ui.Check"
-#define MY_CLASS_NAME_LEGACY "elm_check"
static const Elm_Layout_Part_Alias_Description _text_aliases[] =
{
@@ -50,62 +52,64 @@ _activate(Evas_Object *obj)
{
EFL_UI_CHECK_DATA_GET(obj, sd);
- efl_ui_nstate_activate(obj);
- if (sd->statep) *sd->statep = efl_ui_nstate_value_get(obj);
+ if (sd->statep) *sd->statep = !efl_ui_nstate_value_get(obj);
- if (efl_ui_nstate_value_get(obj) == 1)
+ // state will be changed to 1 by efl_ui_nstate_activate(obj)
+ if (efl_ui_nstate_value_get(obj) == 0)
{
// FIXME: to do animation during state change , we need different signal
// so that we can distinguish between state change by user or state change
// by calling state_change() api. Keep both the signal for backward compatibility
// and remove "elm,state,check,on" signal emission when we can break ABI.
- elm_layout_signal_emit(obj, "elm,activate,check,on", "elm");
- elm_layout_signal_emit(obj, "elm,state,check,on", "elm");
+ if (elm_widget_is_legacy(obj))
+ {
+ elm_layout_signal_emit(obj, "elm,activate,check,on", "elm");
+ elm_layout_signal_emit(obj, "elm,state,check,on", "elm");
+ }
+ else
+ {
+ elm_layout_signal_emit(obj, "efl,activate,check,on", "efl");
+ elm_layout_signal_emit(obj, "efl,state,check,on", "efl");
+ }
+
if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF)
_elm_access_say(E_("State: On"));
}
- else if (efl_ui_nstate_value_get(obj) == 0)
+ else
{
// FIXME: to do animation during state change , we need different signal
// so that we can distinguish between state change by user or state change
// by calling state_change() api. Keep both the signal for backward compatibility
// and remove "elm,state,check,off" signal emission when we can break ABI.
- elm_layout_signal_emit(obj, "elm,activate,check,off", "elm");
- elm_layout_signal_emit(obj, "elm,state,check,off", "elm");
+ if (elm_widget_is_legacy(obj))
+ {
+ elm_layout_signal_emit(obj, "elm,activate,check,off", "elm");
+ elm_layout_signal_emit(obj, "elm,state,check,off", "elm");
+ }
+ else
+ {
+ elm_layout_signal_emit(obj, "efl,activate,check,off", "efl");
+ elm_layout_signal_emit(obj, "efl,state,check,off", "efl");
+ }
+
if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF)
_elm_access_say(E_("State: Off"));
}
- efl_event_callback_legacy_call(obj, EFL_UI_CHECK_EVENT_CHANGED, NULL);
+ efl_ui_nstate_activate(obj);
if (_elm_config->atspi_mode)
- efl_access_state_changed_signal_emit(obj,
- EFL_ACCESS_STATE_CHECKED,
- efl_ui_nstate_value_get(obj));
-}
-
-/* FIXME: replicated from elm_layout just because check's icon spot
- * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
- * can changed the theme API */
-static void
-_icon_signal_emit(Evas_Object *obj)
-{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
- char buf[64];
-
- snprintf(buf, sizeof(buf), "elm,state,icon,%s",
- elm_layout_content_get(obj, "icon") ? "visible" : "hidden");
-
- elm_layout_signal_emit(obj, buf, "elm");
- edje_object_message_signal_process(wd->resize_obj);
+ efl_access_state_changed_signal_emit(obj,
+ EFL_ACCESS_STATE_CHECKED,
+ efl_ui_nstate_value_get(obj));
}
EOLIAN static Efl_Access_State_Set
-_efl_ui_check_efl_access_state_set_get(Eo *obj, Efl_Ui_Check_Data *_pd EINA_UNUSED)
+_efl_ui_check_efl_access_object_state_set_get(const Eo *obj, Efl_Ui_Check_Data *_pd EINA_UNUSED)
{
Efl_Access_State_Set states = 0;
- states = efl_access_state_set_get(efl_super(obj, EFL_UI_CHECK_CLASS));
+ states = efl_access_object_state_set_get(efl_super(obj, EFL_UI_CHECK_CLASS));
if (elm_check_state_get(obj))
STATE_TYPE_SET(states, EFL_ACCESS_STATE_CHECKED);
@@ -113,26 +117,8 @@ _efl_ui_check_efl_access_state_set_get(Eo *obj, Efl_Ui_Check_Data *_pd EINA_UNUS
return states;
}
-/* FIXME: replicated from elm_layout just because check's icon spot
- * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
- * can changed the theme API */
-EOLIAN static Eina_Bool
-_efl_ui_check_elm_widget_widget_sub_object_del(Eo *obj, Efl_Ui_Check_Data *_pd EINA_UNUSED, Evas_Object *sobj)
-{
- Eina_Bool int_ret = EINA_FALSE;
-
- int_ret = elm_widget_sub_object_del(efl_super(obj, MY_CLASS), sobj);
- if (!int_ret) return EINA_FALSE;
-
- _icon_signal_emit(obj);
-
- elm_layout_sizing_eval(obj);
-
- return EINA_TRUE;
-}
-
EOLIAN static Eina_Bool
-_efl_ui_check_elm_widget_on_access_activate(Eo *obj EINA_UNUSED, Efl_Ui_Check_Data *_pd EINA_UNUSED, Efl_Ui_Activate act)
+_efl_ui_check_efl_ui_widget_on_access_activate(Eo *obj EINA_UNUSED, Efl_Ui_Check_Data *_pd EINA_UNUSED, Efl_Ui_Activate act)
{
if (elm_widget_disabled_get(obj)) return EINA_FALSE;
if (act != EFL_UI_ACTIVATE_DEFAULT) return EINA_FALSE;
@@ -150,7 +136,7 @@ _key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED)
}
EOLIAN static Efl_Ui_Theme_Apply
-_efl_ui_check_elm_widget_theme_apply(Eo *obj, Efl_Ui_Check_Data *sd EINA_UNUSED)
+_efl_ui_check_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Check_Data *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
@@ -160,18 +146,23 @@ _efl_ui_check_elm_widget_theme_apply(Eo *obj, Efl_Ui_Check_Data *sd EINA_UNUSED)
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
- if (efl_ui_nstate_value_get(obj) == 0)
- elm_layout_signal_emit(obj, "elm,state,check,off", "elm");
- else if (efl_ui_nstate_value_get(obj) == 1)
- elm_layout_signal_emit(obj, "elm,state,check,on", "elm");
+ if (elm_widget_is_legacy(obj))
+ {
+ if (efl_ui_nstate_value_get(obj) == 0)
+ elm_layout_signal_emit(obj, "elm,state,check,off", "elm");
+ else
+ elm_layout_signal_emit(obj, "elm,state,check,on", "elm");
+ }
+ else
+ {
+ if (efl_ui_nstate_value_get(obj) == 0)
+ elm_layout_signal_emit(obj, "efl,state,check,off", "efl");
+ else
+ elm_layout_signal_emit(obj, "efl,state,check,on", "efl");
+ }
edje_object_message_signal_process(wd->resize_obj);
- /* FIXME: replicated from elm_layout just because check's icon spot
- * is elm.swallow.content, not elm.swallow.icon. Fix that whenever
- * we can changed the theme API */
- _icon_signal_emit(obj);
-
elm_layout_sizing_eval(obj);
return int_ret;
@@ -232,16 +223,19 @@ _on_check_off(void *data,
EFL_UI_CHECK_DATA_GET(obj, sd);
- efl_ui_nstate_value_set(obj, 0);
- if (sd->statep) *sd->statep = efl_ui_nstate_value_get(obj);
+ if (sd->statep) *sd->statep = 0;
+
+ if (elm_widget_is_legacy(obj))
+ elm_layout_signal_emit(obj, "elm,state,check,off", "elm");
+ else
+ elm_layout_signal_emit(obj, "efl,state,check,off", "efl");
- elm_layout_signal_emit(obj, "elm,state,check,off", "elm");
- efl_event_callback_legacy_call(obj, EFL_UI_CHECK_EVENT_CHANGED, NULL);
+ efl_ui_nstate_value_set(obj, 0);
if (_elm_config->atspi_mode)
- efl_access_state_changed_signal_emit(data,
- EFL_ACCESS_STATE_CHECKED,
- efl_ui_nstate_value_get(obj));
+ efl_access_state_changed_signal_emit(data,
+ EFL_ACCESS_STATE_CHECKED,
+ efl_ui_nstate_value_get(obj));
}
static void
@@ -254,15 +248,19 @@ _on_check_on(void *data,
EFL_UI_CHECK_DATA_GET(obj, sd);
+ if (sd->statep) *sd->statep = 1;
+
+ if (elm_widget_is_legacy(obj))
+ elm_layout_signal_emit(obj, "elm,state,check,on", "elm");
+ else
+ elm_layout_signal_emit(obj, "efl,state,check,on", "efl");
+
efl_ui_nstate_value_set(obj, 1);
- if (sd->statep) *sd->statep = efl_ui_nstate_value_get(obj);
- elm_layout_signal_emit(obj, "elm,state,check,on", "elm");
- efl_event_callback_legacy_call(obj, EFL_UI_CHECK_EVENT_CHANGED, NULL);
if (_elm_config->atspi_mode)
efl_access_state_changed_signal_emit(data,
- EFL_ACCESS_STATE_CHECKED,
- efl_ui_nstate_value_get(obj));
+ EFL_ACCESS_STATE_CHECKED,
+ efl_ui_nstate_value_get(obj));
}
static void
@@ -275,7 +273,7 @@ _on_check_toggle(void *data,
}
EOLIAN static Eina_Bool
-_efl_ui_check_selected_get(Eo *obj, Efl_Ui_Check_Data *pd EINA_UNUSED)
+_efl_ui_check_selected_get(const Eo *obj, Efl_Ui_Check_Data *pd EINA_UNUSED)
{
return !!efl_ui_nstate_value_get(obj);
}
@@ -285,14 +283,26 @@ _efl_ui_check_selected_set(Eo *obj, Efl_Ui_Check_Data *sd, Eina_Bool value)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
- efl_ui_nstate_value_set(obj, value);
- if (sd->statep) *sd->statep = efl_ui_nstate_value_get(obj);
- if (efl_ui_nstate_value_get(obj) == 1)
- elm_layout_signal_emit(obj, "elm,state,check,on", "elm");
- else if (efl_ui_nstate_value_get(obj) == 0)
- elm_layout_signal_emit(obj, "elm,state,check,off", "elm");
+ if (sd->statep) *sd->statep = value;
+
+ if (elm_widget_is_legacy(obj))
+ {
+ if (value == 1)
+ elm_layout_signal_emit(obj, "elm,state,check,on", "elm");
+ else
+ elm_layout_signal_emit(obj, "elm,state,check,off", "elm");
+ }
+ else
+ {
+ if (value == 1)
+ elm_layout_signal_emit(obj, "efl,state,check,on", "efl");
+ else
+ elm_layout_signal_emit(obj, "efl,state,check,off", "efl");
+ }
edje_object_message_signal_process(wd->resize_obj);
+
+ efl_ui_nstate_value_set(obj, value);
}
EOLIAN static void
@@ -310,31 +320,36 @@ _efl_ui_check_efl_ui_nstate_value_set(Eo *obj, Efl_Ui_Check_Data *pd EINA_UNUSED
efl_ui_nstate_value_set(efl_super(obj, MY_CLASS), _state);
}
-EAPI Evas_Object *
-elm_check_add(Evas_Object *parent)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return elm_legacy_add(MY_CLASS, parent);
-}
-
EOLIAN static Eo *
_efl_ui_check_efl_object_constructor(Eo *obj, Efl_Ui_Check_Data *pd EINA_UNUSED)
{
if (!elm_widget_theme_klass_get(obj))
elm_widget_theme_klass_set(obj, "check");
obj = efl_constructor(efl_super(obj, MY_CLASS));
- efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
- efl_layout_signal_callback_add
- (wd->resize_obj, "elm,action,check,on", "*", _on_check_on, obj);
- efl_layout_signal_callback_add
- (wd->resize_obj, "elm,action,check,off", "*", _on_check_off, obj);
- efl_layout_signal_callback_add
- (wd->resize_obj, "elm,action,check,toggle", "*", _on_check_toggle, obj);
-
- efl_access_role_set(obj, EFL_ACCESS_ROLE_CHECK_BOX);
+
+ if (elm_widget_is_legacy(obj))
+ {
+ efl_layout_signal_callback_add
+ (wd->resize_obj, "elm,action,check,on", "*", _on_check_on, obj);
+ efl_layout_signal_callback_add
+ (wd->resize_obj, "elm,action,check,off", "*", _on_check_off, obj);
+ efl_layout_signal_callback_add
+ (wd->resize_obj, "elm,action,check,toggle", "*", _on_check_toggle, obj);
+ }
+ else
+ {
+ efl_layout_signal_callback_add
+ (wd->resize_obj, "efl,action,check,on", "*", _on_check_on, obj);
+ efl_layout_signal_callback_add
+ (wd->resize_obj, "efl,action,check,off", "*", _on_check_off, obj);
+ efl_layout_signal_callback_add
+ (wd->resize_obj, "efl,action,check,toggle", "*", _on_check_toggle, obj);
+ }
+
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_CHECK_BOX);
_elm_access_object_register(obj, wd->resize_obj);
_elm_access_text_set
(_elm_access_info_get(obj), ELM_ACCESS_TYPE, E_("Check"));
@@ -351,7 +366,31 @@ _efl_ui_check_efl_object_constructor(Eo *obj, Efl_Ui_Check_Data *pd EINA_UNUSED)
EAPI void
elm_check_state_set(Evas_Object *obj, Eina_Bool state)
{
- efl_ui_check_selected_set(obj, state);
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+ EFL_UI_NSTATE_DATA_GET_OR_RETURN(obj, nd);
+ EFL_UI_CHECK_DATA_GET_OR_RETURN(obj, sd);
+
+ if (state != nd->state)
+ {
+ nd->state = state;
+ if (sd->statep) *sd->statep = state;
+
+ if (elm_widget_is_legacy(obj))
+ {
+ if (state == 1)
+ elm_layout_signal_emit(obj, "elm,state,check,on", "elm");
+ else
+ elm_layout_signal_emit(obj, "elm,state,check,off", "elm");
+ }
+ else
+ {
+ if (state == 1)
+ elm_layout_signal_emit(obj, "efl,state,check,on", "efl");
+ else
+ elm_layout_signal_emit(obj, "efl,state,check,off", "efl");
+ }
+ edje_object_message_signal_process(wd->resize_obj);
+ }
}
EAPI Eina_Bool
@@ -364,6 +403,8 @@ EAPI void
elm_check_state_pointer_set(Eo *obj, Eina_Bool *statep)
{
EFL_UI_CHECK_DATA_GET_OR_RETURN(obj, sd);
+ EFL_UI_NSTATE_DATA_GET_OR_RETURN(obj, nd);
+
if (!statep)
{
sd->statep = NULL;
@@ -371,18 +412,29 @@ elm_check_state_pointer_set(Eo *obj, Eina_Bool *statep)
}
sd->statep = statep;
- if (*sd->statep != efl_ui_nstate_value_get(obj))
+ if (*sd->statep != nd->state)
{
- efl_ui_nstate_value_set(obj, *sd->statep);
- if (efl_ui_nstate_value_get(obj) == 1)
- elm_layout_signal_emit(obj, "elm,state,check,on", "elm");
- else if (efl_ui_nstate_value_get(obj) == 0)
- elm_layout_signal_emit(obj, "elm,state,check,off", "elm");
+ nd->state = *sd->statep;
+
+ if (elm_widget_is_legacy(obj))
+ {
+ if (nd->state == 1)
+ elm_layout_signal_emit(obj, "elm,state,check,on", "elm");
+ else
+ elm_layout_signal_emit(obj, "elm,state,check,off", "elm");
+ }
+ else
+ {
+ if (nd->state == 1)
+ elm_layout_signal_emit(obj, "efl,state,check,on", "efl");
+ else
+ elm_layout_signal_emit(obj, "efl,state,check,off", "efl");
+ }
}
}
EOLIAN const Efl_Access_Action_Data *
-_efl_ui_check_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Efl_Ui_Check_Data *pd EINA_UNUSED)
+_efl_ui_check_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Efl_Ui_Check_Data *pd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_action[] = {
{ "activate", "activate", NULL, _key_action_activate },
@@ -391,12 +443,6 @@ _efl_ui_check_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Efl_
return &atspi_action[0];
}
-static void
-_efl_ui_check_class_constructor(Efl_Class *klass)
-{
- evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
-}
-
/* Standard widget overrides */
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_check, Efl_Ui_Check_Data)
@@ -409,3 +455,112 @@ ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX)
ELM_LAYOUT_TEXT_ALIASES_OPS(MY_CLASS_PFX)
#include "efl_ui_check.eo.c"
+
+#include "efl_ui_check_legacy.eo.h"
+#include "efl_ui_check_legacy_part.eo.h"
+
+#define MY_CLASS_NAME_LEGACY "elm_check"
+
+static void
+_efl_ui_check_legacy_class_constructor(Efl_Class *klass)
+{
+ evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
+}
+
+EOLIAN static Eo *
+_efl_ui_check_legacy_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED)
+{
+ obj = efl_constructor(efl_super(obj, EFL_UI_CHECK_LEGACY_CLASS));
+ efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
+ return obj;
+}
+
+/* FIXME: replicated from elm_layout just because check's icon spot
+ * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
+ * can changed the theme API */
+static void
+_icon_signal_emit(Evas_Object *obj)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+ char buf[64];
+
+ if (!elm_widget_resize_object_get(obj)) return;
+ snprintf(buf, sizeof(buf), "elm,state,icon,%s",
+ elm_layout_content_get(obj, "icon") ? "visible" : "hidden");
+
+ elm_layout_signal_emit(obj, buf, "elm");
+ edje_object_message_signal_process(wd->resize_obj);
+
+ elm_layout_sizing_eval(obj);
+}
+
+/* FIXME: replicated from elm_layout just because check's icon spot
+ * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
+ * can changed the theme API */
+EOLIAN static Efl_Ui_Theme_Apply
+_efl_ui_check_legacy_efl_ui_widget_theme_apply(Eo *obj, void *_pd EINA_UNUSED)
+{
+ Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
+
+ int_ret = efl_ui_widget_theme_apply(efl_super(obj, EFL_UI_CHECK_LEGACY_CLASS));
+ if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
+
+ _icon_signal_emit(obj);
+
+ return int_ret;
+}
+
+/* FIXME: replicated from elm_layout just because check's icon spot
+ * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
+ * can changed the theme API */
+EOLIAN static Eina_Bool
+_efl_ui_check_legacy_efl_ui_widget_widget_sub_object_del(Eo *obj, void *_pd EINA_UNUSED, Evas_Object *sobj)
+{
+ Eina_Bool int_ret = EINA_FALSE;
+
+ int_ret = elm_widget_sub_object_del(efl_super(obj, EFL_UI_CHECK_LEGACY_CLASS), sobj);
+ if (!int_ret) return EINA_FALSE;
+
+ _icon_signal_emit(obj);
+
+ return EINA_TRUE;
+}
+
+/* FIXME: replicated from elm_layout just because check's icon spot
+ * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
+ * can changed the theme API */
+static Eina_Bool
+_efl_ui_check_legacy_content_set(Eo *obj, void *_pd EINA_UNUSED, const char *part, Evas_Object *content)
+{
+ Eina_Bool int_ret = EINA_FALSE;
+
+ int_ret = efl_content_set(efl_part(efl_super(obj, EFL_UI_CHECK_LEGACY_CLASS), part), content);
+ if (!int_ret) return EINA_FALSE;
+
+ _icon_signal_emit(obj);
+
+ return EINA_TRUE;
+}
+
+/* Efl.Part begin */
+
+static Eina_Bool
+_part_is_efl_ui_check_legacy_part(const Eo *obj EINA_UNUSED, const char *part)
+{
+ return eina_streq(part, "elm.swallow.content");
+}
+
+ELM_PART_OVERRIDE_PARTIAL(efl_ui_check_legacy, EFL_UI_CHECK_LEGACY, void, _part_is_efl_ui_check_legacy_part)
+ELM_PART_OVERRIDE_CONTENT_SET_NO_SD(efl_ui_check_legacy)
+#include "efl_ui_check_legacy_part.eo.c"
+
+/* Efl.Part end */
+
+EAPI Evas_Object *
+elm_check_add(Evas_Object *parent)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ return elm_legacy_add(EFL_UI_CHECK_LEGACY_CLASS, parent);
+}
+
+#include "efl_ui_check_legacy.eo.c"
diff --git a/src/lib/elementary/efl_ui_check.eo b/src/lib/elementary/efl_ui_check.eo
index 44d79d9272..43b23fbcb5 100644
--- a/src/lib/elementary/efl_ui_check.eo
+++ b/src/lib/elementary/efl_ui_check.eo
@@ -21,15 +21,13 @@ class Efl.Ui.Check (Efl.Ui.Nstate, Efl.Access.Widget.Action)
}
}
implements {
- class.constructor;
Efl.Object.constructor;
- Elm.Widget.on_access_activate;
- Elm.Widget.theme_apply;
- Elm.Widget.widget_sub_object_del;
- Elm.Widget.widget_event;
+ Efl.Ui.Widget.on_access_activate;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.widget_event;
Efl.Ui.Nstate.count { set; }
Efl.Ui.Nstate.value { set; }
- Efl.Access.state_set { get; }
+ Efl.Access.Object.state_set { get; }
Efl.Access.Widget.Action.elm_actions { get; }
}
}
diff --git a/src/lib/elementary/efl_ui_check_legacy.eo b/src/lib/elementary/efl_ui_check_legacy.eo
new file mode 100644
index 0000000000..5d311a5e79
--- /dev/null
+++ b/src/lib/elementary/efl_ui_check_legacy.eo
@@ -0,0 +1,18 @@
+class Efl.Ui.Check_Legacy (Efl.Ui.Check, Efl.Ui.Legacy)
+{
+ [[Check widget
+
+ The check widget allows for toggling a value between true and false.
+ Check objects are a lot like radio objects in layout and functionality,
+ except they do not work as a group, but independently, and only toggle
+ the value of a boolean between false and true.
+ ]]
+ data: null;
+ implements {
+ class.constructor;
+ Efl.Object.constructor;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.widget_sub_object_del;
+ Efl.Part.part_get;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_check_legacy_part.eo b/src/lib/elementary/efl_ui_check_legacy_part.eo
new file mode 100644
index 0000000000..40d62d3661
--- /dev/null
+++ b/src/lib/elementary/efl_ui_check_legacy_part.eo
@@ -0,0 +1,8 @@
+class Efl.Ui.Check_Legacy_Part (Efl.Ui.Layout.Part_Content)
+{
+ [[Elementary check internal part class]]
+ data: null;
+ implements {
+ Efl.Content.content { set; }
+ }
+}
diff --git a/src/lib/elementary/efl_ui_check_private.h b/src/lib/elementary/efl_ui_check_private.h
index ecd179f0e4..e44c6035e4 100644
--- a/src/lib/elementary/efl_ui_check_private.h
+++ b/src/lib/elementary/efl_ui_check_private.h
@@ -40,7 +40,7 @@ struct _Efl_Ui_Check_Data
EFL_UI_CHECK_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -49,7 +49,7 @@ struct _Efl_Ui_Check_Data
EFL_UI_CHECK_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/efl_ui_clock.c b/src/lib/elementary/efl_ui_clock.c
index ac10a6155d..c34fd05e57 100644
--- a/src/lib/elementary/efl_ui_clock.c
+++ b/src/lib/elementary/efl_ui_clock.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_UI_TRANSLATABLE_PROTECTED
#include <Elementary.h>
@@ -13,7 +13,6 @@
#define MY_CLASS EFL_UI_CLOCK_CLASS
#define MY_CLASS_NAME "Efl.Ui.Clock"
-#define MY_CLASS_NAME_LEGACY "efl_ui_clock"
#ifdef HAVE_LOCALE_H
# include <locale.h>
@@ -31,8 +30,8 @@
* EFL_UI_CLOCK_TYPE_COUNT are in the valid range, and must get in the
* place of "%d".
*/
-#define EDC_PART_FIELD_STR "field%d"
-#define EDC_PART_SEPARATOR_STR "separator%d"
+#define EDC_PART_FIELD_STR "efl.field%d"
+#define EDC_PART_SEPARATOR_STR "efl.separator%d"
#define EDC_PART_FIELD_ENABLE_SIG_STR "field%d,enable"
#define EDC_PART_FIELD_DISABLE_SIG_STR "field%d,disable"
@@ -66,7 +65,6 @@ static Format_Map mapping[EFL_UI_CLOCK_TYPE_COUNT] = {
static const char *multifield_formats = "cxXrRTDF";
static const char *ignore_separators = "()";
static const char *ignore_extensions = "E0_-O^#";
-static Clock_Mod_Api *dt_mod = NULL;
static const char SIG_CHANGED[] = "changed";
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
@@ -78,27 +76,34 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-static Clock_Mod_Api *
-_dt_mod_init()
+static Elm_Module *
+_dt_mod_find(void)
{
static int tried_fallback = 0;
- Elm_Module *mod = NULL;
+ Elm_Module *mod = _elm_module_find_as("clock/api");
- if (!(mod = _elm_module_find_as("clock/api")))
+ if (mod) return mod;
+ if (!tried_fallback &&
+ (!_elm_config->modules || !strstr(_elm_config->modules, "clock/api")))
{
- if (!tried_fallback &&
- (!_elm_config->modules || !strstr(_elm_config->modules, "clock/api")))
- {
- // See also _config_update(): we hardcode here the default module
- ERR("Elementary config does not contain the required module "
- "name for the clock widget! Verify your installation.");
- _elm_module_add("clock_input_ctxpopup", "clock/api");
- mod = _elm_module_find_as("clock/api");
- tried_fallback = EINA_TRUE;
- }
- if (!mod) return NULL;
+ // See also _config_update(): we hardcode here the default module
+ ERR("Elementary config does not contain the required module "
+ "name for the clock widget! Verify your installation.");
+ _elm_module_add("clock_input_ctxpopup", "clock/api");
+ mod = _elm_module_find_as("clock/api");
+ tried_fallback = EINA_TRUE;
}
+ return mod;
+}
+static Clock_Mod_Api *
+_dt_mod_init()
+{
+ Elm_Module *mod;
+
+ mod = _dt_mod_find();
+ if (!mod) return NULL;
+ if (mod->api) return mod->api;
mod->api = malloc(sizeof(Clock_Mod_Api));
if (!mod->api) return NULL;
@@ -121,9 +126,11 @@ _field_list_display(Evas_Object *obj)
{
Clock_Field *field;
unsigned int idx = 0;
+ Clock_Mod_Api *dt_mod;
EFL_UI_CLOCK_DATA_GET(obj, sd);
+ dt_mod = _dt_mod_init();
if (!dt_mod || !dt_mod->field_value_display) return;
for (idx = 0; idx < EFL_UI_CLOCK_TYPE_COUNT; idx++)
@@ -389,13 +396,13 @@ _reload_format(Evas_Object *obj)
{
snprintf(buf, sizeof(buf), EDC_PART_FIELD_ENABLE_SIG_STR,
field->location);
- elm_layout_signal_emit(obj, buf, "elm");
+ elm_layout_signal_emit(obj, buf, "efl");
}
else
{
snprintf(buf, sizeof(buf), EDC_PART_FIELD_DISABLE_SIG_STR,
field->location);
- elm_layout_signal_emit(obj, buf, "elm");
+ elm_layout_signal_emit(obj, buf, "efl");
}
if (field->location + 1)
{
@@ -431,7 +438,7 @@ _efl_ui_clock_pause_set(Eo *obj EINA_UNUSED, Efl_Ui_Clock_Data *sd, Eina_Bool pa
}
EOLIAN static Eina_Bool
-_efl_ui_clock_pause_get(Eo *obj EINA_UNUSED, Efl_Ui_Clock_Data *sd)
+_efl_ui_clock_pause_get(const Eo *obj EINA_UNUSED, Efl_Ui_Clock_Data *sd)
{
return sd->paused;
}
@@ -443,21 +450,22 @@ _efl_ui_clock_edit_mode_set(Eo *obj EINA_UNUSED, Efl_Ui_Clock_Data *sd, Eina_Boo
}
EOLIAN static Eina_Bool
-_efl_ui_clock_edit_mode_get(Eo *obj EINA_UNUSED, Efl_Ui_Clock_Data *sd)
+_efl_ui_clock_edit_mode_get(const Eo *obj EINA_UNUSED, Efl_Ui_Clock_Data *sd)
{
return sd->edit_mode;
}
EOLIAN static Eina_Bool
-_efl_ui_clock_elm_widget_on_focus_update(Eo *obj, Efl_Ui_Clock_Data *sd, Elm_Object_Item *item EINA_UNUSED)
+_efl_ui_clock_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Clock_Data *sd)
{
Eina_Bool int_ret = EINA_FALSE;
- int_ret = efl_ui_widget_on_focus_update(efl_super(obj, MY_CLASS), NULL);
+ int_ret = efl_ui_focus_object_on_focus_update(efl_super(obj, MY_CLASS));
if (!int_ret) return EINA_FALSE;
if (!efl_ui_focus_object_focus_get(obj))
{
+ Clock_Mod_Api *dt_mod = _dt_mod_init();
if ((dt_mod) && (dt_mod->obj_hide))
dt_mod->obj_hide(sd->mod_data);
}
@@ -466,7 +474,7 @@ _efl_ui_clock_elm_widget_on_focus_update(Eo *obj, Efl_Ui_Clock_Data *sd, Elm_Obj
}
EOLIAN static Eina_Bool
-_efl_ui_clock_elm_widget_on_disabled_update(Eo *obj, Efl_Ui_Clock_Data *sd, Eina_Bool disabled)
+_efl_ui_clock_efl_ui_widget_on_disabled_update(Eo *obj, Efl_Ui_Clock_Data *sd, Eina_Bool disabled)
{
Clock_Field *field;
unsigned int idx = 0;
@@ -501,19 +509,21 @@ _efl_ui_clock_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Clock_Data *sd)
}
EOLIAN static Efl_Ui_Theme_Apply
-_efl_ui_clock_elm_widget_theme_apply(Eo *obj, Efl_Ui_Clock_Data *sd)
+_efl_ui_clock_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Clock_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Clock_Field *field;
char buf[BUFFER_SIZE];
unsigned int idx;
+ Clock_Mod_Api *dt_mod;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
+ dt_mod = _dt_mod_init();
if ((!dt_mod) || (!dt_mod->field_value_display)) return EINA_TRUE;
for (idx = 0; idx < EFL_UI_CLOCK_TYPE_COUNT; idx++)
@@ -525,7 +535,7 @@ _efl_ui_clock_elm_widget_theme_apply(Eo *obj, Efl_Ui_Clock_Data *sd)
{
snprintf(buf, sizeof(buf), EDC_PART_FIELD_ENABLE_SIG_STR,
field->location);
- elm_layout_signal_emit(obj, buf, "elm");
+ elm_layout_signal_emit(obj, buf, "efl");
if (field->location)
{
@@ -539,7 +549,7 @@ _efl_ui_clock_elm_widget_theme_apply(Eo *obj, Efl_Ui_Clock_Data *sd)
{
snprintf(buf, sizeof(buf), EDC_PART_FIELD_DISABLE_SIG_STR,
field->location);
- elm_layout_signal_emit(obj, buf, "elm");
+ elm_layout_signal_emit(obj, buf, "efl");
}
}
@@ -688,7 +698,7 @@ _field_format_get(Evas_Object *obj,
{
Clock_Field *field;
- if (field_type > EFL_UI_CLOCK_TYPE_DAY) return NULL;
+ if (field_type > EFL_UI_CLOCK_TYPE_AMPM) return NULL;
EFL_UI_CLOCK_DATA_GET(obj, sd);
@@ -805,6 +815,7 @@ _ticker(void *data)
if (sd->curr_time.tm_sec > 0)
{
+ Clock_Mod_Api *dt_mod = _dt_mod_init();
field = sd->field_list + EFL_UI_CLOCK_TYPE_SECOND;
if (field->fmt_exist && field->visible &&
dt_mod && dt_mod->field_value_display)
@@ -824,6 +835,7 @@ EOLIAN static void
_efl_ui_clock_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Clock_Data *priv)
{
Clock_Field *field;
+ Clock_Mod_Api *dt_mod;
int idx;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
@@ -839,7 +851,7 @@ _efl_ui_clock_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Clock_Data *priv)
CRI("Failed to set layout!");
// module - initialise module for clock
- if (!dt_mod) dt_mod = _dt_mod_init();
+ dt_mod = _dt_mod_init();
if (dt_mod)
{
if (dt_mod->obj_hook)
@@ -883,7 +895,7 @@ _efl_ui_clock_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Clock_Data *priv)
Elm_Access_Info *ai;
priv->access_obj = _elm_access_edje_object_part_object_register
- (obj, elm_layout_edje_get(obj), "elm.access");
+ (obj, elm_layout_edje_get(obj), "efl.access");
if (!priv->access_obj)
priv->access_obj = _elm_access_edje_object_part_object_register
(obj, elm_layout_edje_get(obj), "access");
@@ -899,6 +911,7 @@ _efl_ui_clock_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Clock_Data *sd)
{
Clock_Field *tmp;
unsigned int idx;
+ Clock_Mod_Api *dt_mod;
ecore_timer_del(sd->ticker);
for (idx = 0; idx < EFL_UI_CLOCK_TYPE_COUNT; idx++)
@@ -908,6 +921,7 @@ _efl_ui_clock_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Clock_Data *sd)
eina_stringshare_del(tmp->separator);
}
+ dt_mod = _dt_mod_init();
if ((dt_mod) && (dt_mod->obj_unhook))
dt_mod->obj_unhook(sd->mod_data); // module - unhook
@@ -918,15 +932,14 @@ EOLIAN static Eo *
_efl_ui_clock_efl_object_constructor(Eo *obj, Efl_Ui_Clock_Data *_pd EINA_UNUSED)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
- efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_DATE_EDITOR);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_DATE_EDITOR);
return obj;
}
EOLIAN static const char*
-_efl_ui_clock_format_get(Eo *obj EINA_UNUSED, Efl_Ui_Clock_Data *sd)
+_efl_ui_clock_format_get(const Eo *obj EINA_UNUSED, Efl_Ui_Clock_Data *sd)
{
return sd->format;
}
@@ -946,11 +959,11 @@ _efl_ui_clock_format_set(Eo *obj, Efl_Ui_Clock_Data *sd, const char *fmt)
}
EOLIAN static Eina_Bool
-_efl_ui_clock_field_visible_get(Eo *obj EINA_UNUSED, Efl_Ui_Clock_Data *sd, Efl_Ui_Clock_Type fieldtype)
+_efl_ui_clock_field_visible_get(const Eo *obj EINA_UNUSED, Efl_Ui_Clock_Data *sd, Efl_Ui_Clock_Type fieldtype)
{
Clock_Field *field;
- if (fieldtype > EFL_UI_CLOCK_TYPE_DAY) return EINA_FALSE;
+ if (fieldtype > EFL_UI_CLOCK_TYPE_AMPM) return EINA_FALSE;
field = sd->field_list + fieldtype;
@@ -963,7 +976,7 @@ _efl_ui_clock_field_visible_set(Eo *obj, Efl_Ui_Clock_Data *sd, Efl_Ui_Clock_Typ
char buf[BUFFER_SIZE];
Clock_Field *field;
- if (fieldtype > EFL_UI_CLOCK_TYPE_DAY) return;
+ if (fieldtype > EFL_UI_CLOCK_TYPE_AMPM) return;
field = sd->field_list + fieldtype;
visible = !!visible;
@@ -980,7 +993,7 @@ _efl_ui_clock_field_visible_set(Eo *obj, Efl_Ui_Clock_Data *sd, Efl_Ui_Clock_Typ
snprintf(buf, sizeof(buf), EDC_PART_FIELD_ENABLE_SIG_STR,
field->location);
- elm_layout_signal_emit(obj, buf, "elm");
+ elm_layout_signal_emit(obj, buf, "efl");
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
edje_object_message_signal_process(wd->resize_obj);
@@ -997,7 +1010,7 @@ _efl_ui_clock_field_visible_set(Eo *obj, Efl_Ui_Clock_Data *sd, Efl_Ui_Clock_Typ
snprintf(buf, sizeof(buf), EDC_PART_FIELD_DISABLE_SIG_STR,
field->location);
- elm_layout_signal_emit(obj, buf, "elm");
+ elm_layout_signal_emit(obj, buf, "efl");
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
edje_object_message_signal_process(wd->resize_obj);
@@ -1010,17 +1023,19 @@ _efl_ui_clock_field_visible_set(Eo *obj, Efl_Ui_Clock_Data *sd, Efl_Ui_Clock_Typ
elm_layout_sizing_eval(obj);
if (!visible) return;
- if (!dt_mod || !dt_mod->field_value_display) return;
-
- dt_mod->field_value_display(sd->mod_data, field->item_obj);
+ {
+ Clock_Mod_Api *dt_mod = _dt_mod_init();
+ if (!dt_mod || !dt_mod->field_value_display) return;
+ dt_mod->field_value_display(sd->mod_data, field->item_obj);
+ }
}
EOLIAN static void
-_efl_ui_clock_field_limit_get(Eo *obj EINA_UNUSED, Efl_Ui_Clock_Data *sd, Efl_Ui_Clock_Type fieldtype, int *min, int *max)
+_efl_ui_clock_field_limit_get(const Eo *obj EINA_UNUSED, Efl_Ui_Clock_Data *sd, Efl_Ui_Clock_Type fieldtype, int *min, int *max)
{
Clock_Field *field;
- if (fieldtype >= EFL_UI_CLOCK_TYPE_DAY) return;
+ if (fieldtype >= EFL_UI_CLOCK_TYPE_AMPM) return;
field = sd->field_list + fieldtype;
if (min) *min = field->min;
@@ -1033,7 +1048,7 @@ _efl_ui_clock_field_limit_set(Eo *obj, Efl_Ui_Clock_Data *sd, Efl_Ui_Clock_Type
Clock_Field *field;
struct tm old_time;
- if (fieldtype >= EFL_UI_CLOCK_TYPE_DAY) return;
+ if (fieldtype >= EFL_UI_CLOCK_TYPE_AMPM) return;
if (min > max) return;
@@ -1055,7 +1070,7 @@ _efl_ui_clock_field_limit_set(Eo *obj, Efl_Ui_Clock_Data *sd, Efl_Ui_Clock_Type
}
EOLIAN static Efl_Time
-_efl_ui_clock_time_get(Eo *obj EINA_UNUSED, Efl_Ui_Clock_Data *sd)
+_efl_ui_clock_time_get(const Eo *obj EINA_UNUSED, Efl_Ui_Clock_Data *sd)
{
return sd->curr_time;
}
@@ -1076,7 +1091,7 @@ _efl_ui_clock_time_set(Eo *obj, Efl_Ui_Clock_Data *sd, Efl_Time newtime)
}
EOLIAN static Efl_Time
-_efl_ui_clock_time_min_get(Eo *obj EINA_UNUSED, Efl_Ui_Clock_Data *sd)
+_efl_ui_clock_time_min_get(const Eo *obj EINA_UNUSED, Efl_Ui_Clock_Data *sd)
{
return sd->min_limit;
}
@@ -1101,7 +1116,7 @@ _efl_ui_clock_time_min_set(Eo *obj, Efl_Ui_Clock_Data *sd, Efl_Time mintime)
}
EOLIAN static Efl_Time
-_efl_ui_clock_time_max_get(Eo *obj EINA_UNUSED, Efl_Ui_Clock_Data *sd)
+_efl_ui_clock_time_max_get(const Eo *obj EINA_UNUSED, Efl_Ui_Clock_Data *sd)
{
return sd->max_limit;
}
@@ -1125,12 +1140,6 @@ _efl_ui_clock_time_max_set(Eo *obj, Efl_Ui_Clock_Data *sd, Efl_Time maxtime)
efl_event_callback_legacy_call(obj, EFL_UI_CLOCK_EVENT_CHANGED, NULL);
}
-EOLIAN static void
-_efl_ui_clock_class_constructor(Efl_Class *klass)
-{
- evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
-}
-
/* Internal EO APIs and hidden overrides */
#define EFL_UI_CLOCK_EXTRA_OPS \
diff --git a/src/lib/elementary/efl_ui_clock.eo b/src/lib/elementary/efl_ui_clock.eo
index a18a0af599..962b7bac19 100644
--- a/src/lib/elementary/efl_ui_clock.eo
+++ b/src/lib/elementary/efl_ui_clock.eo
@@ -1,6 +1,6 @@
import efl_types;
-enum Efl.Ui.Clock.Type
+enum Efl.Ui.Clock_Type
{
[[Identifies a clock field, The widget supports 6 fields : Year, month,
Date, Hour, Minute, AM/PM
@@ -16,7 +16,7 @@ enum Efl.Ui.Clock.Type
ampm = 7, [[Indicates AM/PM field .]]
}
-class Efl.Ui.Clock (Efl.Ui.Layout)
+class Efl.Ui.Clock (Efl.Ui.Layout.Object)
{
[[Efl UI clock class]]
methods {
@@ -179,7 +179,7 @@ class Efl.Ui.Clock (Efl.Ui.Layout)
[[ The field to be visible/not.]]
set{} get{}
keys {
- fieldtype: Efl.Ui.Clock.Type; [[Type of the field. #EFL_UI_CLOCK_TYPE_YEAR etc.]]
+ fieldtype: Efl.Ui.Clock_Type; [[Type of the field. #EFL_UI_CLOCK_TYPE_YEAR etc.]]
}
values {
visible: bool; [[$true field can be visible, $false otherwise.]]
@@ -213,7 +213,7 @@ class Efl.Ui.Clock (Efl.Ui.Layout)
]]
}
keys {
- fieldtype: Efl.Ui.Clock.Type; [[Type of the field. #EFL_UI_CLOCK_TYPE_YEAR etc.]]
+ fieldtype: Efl.Ui.Clock_Type; [[Type of the field. #EFL_UI_CLOCK_TYPE_YEAR etc.]]
}
values {
min: int; [[Reference to field's minimum value.]]
@@ -222,14 +222,13 @@ class Efl.Ui.Clock (Efl.Ui.Layout)
}
}
implements {
- class.constructor;
Efl.Object.constructor;
- Elm.Widget.theme_apply;
- Elm.Widget.on_disabled_update;
- Elm.Widget.on_focus_update;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.on_disabled_update;
+ Efl.Ui.Focus.Object.on_focus_update;
Efl.Ui.Translatable.translation_update;
}
events {
- changed; [[Called when clock changed]]
+ changed: void; [[Called when clock changed]]
}
}
diff --git a/src/lib/elementary/efl_ui_clock_legacy.eo b/src/lib/elementary/efl_ui_clock_legacy.eo
new file mode 100644
index 0000000000..b15225742c
--- /dev/null
+++ b/src/lib/elementary/efl_ui_clock_legacy.eo
@@ -0,0 +1,9 @@
+class Efl.Ui.Clock_Legacy (Efl.Ui.Clock, Efl.Ui.Legacy)
+{
+ [[Efl UI clock class]]
+ data: null;
+ implements {
+ class.constructor;
+ Efl.Object.constructor;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_clock_private.h b/src/lib/elementary/efl_ui_clock_private.h
index e37a8ceff3..9246160fb7 100644
--- a/src/lib/elementary/efl_ui_clock_private.h
+++ b/src/lib/elementary/efl_ui_clock_private.h
@@ -118,7 +118,7 @@ struct _Format_Map
EFL_UI_CLOCK_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -127,7 +127,7 @@ struct _Format_Map
EFL_UI_CLOCK_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/efl_ui_datepicker.c b/src/lib/elementary/efl_ui_datepicker.c
new file mode 100644
index 0000000000..55f8b1d365
--- /dev/null
+++ b/src/lib/elementary/efl_ui_datepicker.c
@@ -0,0 +1,349 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <Elementary.h>
+
+#include "elm_priv.h"
+#include "efl_ui_datepicker_private.h"
+
+#define MY_CLASS EFL_UI_DATEPICKER_CLASS
+
+#define MY_CLASS_NAME "Efl.Ui.Datepicker"
+
+#define FMT_LEN_MAX 32
+
+#define DATE_GET() \
+ do { \
+ Efl_Time t = efl_datetime_manager_value_get(pd->dt_manager); \
+ pd->cur_date[DATEPICKER_YEAR] = t.tm_year + 1900; \
+ pd->cur_date[DATEPICKER_MONTH] = t.tm_mon + 1; \
+ pd->cur_date[DATEPICKER_DAY] = t.tm_mday; \
+ } while (0)
+
+#define DATE_SET() \
+ do { \
+ Efl_Time t; \
+ t.tm_year = pd->cur_date[DATEPICKER_YEAR] - 1900; \
+ t.tm_mon = pd->cur_date[DATEPICKER_MONTH] - 1; \
+ t.tm_mday = pd->cur_date[DATEPICKER_DAY]; \
+ efl_datetime_manager_value_set(pd->dt_manager, t); \
+ } while (0)
+
+static const char *fmt_char[] = {"Yy", "mbBh", "de"};
+
+static Eina_Bool
+_validate_params(int year, int month, int day)
+{
+ if (year < 1900 || year > 2037 || month < 1 || month > 12 || day < 0 || day > 31)
+ return EINA_FALSE;
+ else return EINA_TRUE;
+}
+
+static Eina_Bool
+_date_cmp(int time1[], int time2[])
+{
+ unsigned int idx;
+
+ for (idx = 0; idx < EFL_UI_DATEPICKER_TYPE_COUNT; idx++)
+ {
+ if (time1[idx] != time2[idx])
+ return EINA_FALSE;
+ }
+
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_validate_date_limits(int time1[], int time2[], Eina_Bool swap)
+{
+ unsigned int idx;
+ int *t1, *t2;
+
+ t1 = (swap) ? time2 : time1;
+ t2 = (swap) ? time1 : time2;
+
+ for (idx = 0; idx < EFL_UI_DATEPICKER_TYPE_COUNT; idx++)
+ {
+ if (time1[idx] < time2[idx])
+ {
+ memcpy(t1, t2, (sizeof(int) * EFL_UI_DATEPICKER_TYPE_COUNT));
+ return EINA_TRUE;
+ }
+ else if (time1[idx] > time2[idx])
+ return EINA_FALSE;
+ }
+
+ return EINA_FALSE;
+}
+
+static int
+_max_days_get(int year, int month)
+{
+ struct tm time1;
+ time_t t;
+ int day;
+
+ t = time(NULL);
+ localtime_r(&t, &time1);
+ time1.tm_year = year;
+ time1.tm_mon = month;
+ for (day = 28; day <= 31;
+ day++)
+ {
+ time1.tm_mday = day;
+ mktime(&time1);
+ /* To restrict month wrapping because of summer time in some locales,
+ * ignore day light saving mode in mktime(). */
+ time1.tm_isdst = -1;
+ if (time1.tm_mday == 1) break;
+ }
+ day--;
+
+ return day;
+}
+
+static void
+_field_value_update(Eo *obj)
+{
+ Efl_Ui_Datepicker_Data *pd = efl_data_scope_get(obj, MY_CLASS);
+
+ efl_ui_range_value_set(pd->year, pd->cur_date[DATEPICKER_YEAR]);
+ efl_ui_range_value_set(pd->month, pd->cur_date[DATEPICKER_MONTH]);
+ efl_ui_range_value_set(pd->day, pd->cur_date[DATEPICKER_DAY]);
+
+ DATE_SET();
+}
+
+static void
+_field_changed_cb(void *data, const Efl_Event *ev)
+{
+ int max_day;
+
+ Efl_Ui_Datepicker_Data *pd = efl_data_scope_get(data, MY_CLASS);
+
+ if (ev->object == pd->year)
+ pd->cur_date[DATEPICKER_YEAR] = efl_ui_range_value_get(pd->year);
+ else if (ev->object == pd->month)
+ pd->cur_date[DATEPICKER_MONTH] = efl_ui_range_value_get(pd->month);
+ else
+ pd->cur_date[DATEPICKER_DAY] = efl_ui_range_value_get(pd->day);
+
+ if (!(ev->object == pd->day))
+ {
+ max_day = _max_days_get((pd->cur_date[DATEPICKER_YEAR] - 1900), (pd->cur_date[DATEPICKER_MONTH] - 1));
+ efl_ui_range_min_max_set(pd->day, 1, max_day);
+ }
+
+ if (_validate_date_limits(pd->cur_date, pd->min_date, EINA_FALSE) ||
+ _validate_date_limits(pd->max_date, pd->cur_date, EINA_TRUE))
+ {
+ _field_value_update(data);
+ return;
+ }
+
+ DATE_SET();
+ efl_event_callback_call(data, EFL_UI_DATEPICKER_EVENT_CHANGED, NULL);
+}
+
+static void
+_fields_init(Eo *obj)
+{
+ const char *fmt;
+ char ch;
+ int i;
+ int field = 0;
+ char buf[FMT_LEN_MAX];
+
+ Efl_Ui_Datepicker_Data *pd = efl_data_scope_get(obj, MY_CLASS);
+
+ //Field create.
+ pd->year = efl_add(EFL_UI_SPIN_BUTTON_CLASS, obj,
+ efl_ui_range_min_max_set(efl_added, 1970, 2037),
+ efl_ui_spin_button_circulate_set(efl_added, EINA_TRUE),
+ efl_ui_spin_button_editable_set(efl_added, EINA_TRUE),
+ efl_event_callback_add(efl_added, EFL_UI_SPIN_EVENT_CHANGED,_field_changed_cb, obj),
+ elm_widget_element_update(obj, efl_added, "spin_button"));
+
+ pd->month = efl_add(EFL_UI_SPIN_BUTTON_CLASS, obj,
+ efl_ui_range_min_max_set(efl_added, 1, 12),
+ efl_ui_spin_button_circulate_set(efl_added, EINA_TRUE),
+ efl_ui_spin_button_editable_set(efl_added, EINA_TRUE),
+ efl_event_callback_add(efl_added, EFL_UI_SPIN_EVENT_CHANGED,_field_changed_cb, obj),
+ elm_widget_element_update(obj, efl_added, "spin_button"));
+
+ pd->day = efl_add(EFL_UI_SPIN_BUTTON_CLASS, obj,
+ efl_ui_range_min_max_set(efl_added, 1, 31),
+ efl_ui_spin_button_circulate_set(efl_added, EINA_TRUE),
+ efl_ui_spin_button_editable_set(efl_added, EINA_TRUE),
+ efl_event_callback_add(efl_added, EFL_UI_SPIN_EVENT_CHANGED,_field_changed_cb, obj),
+ elm_widget_element_update(obj, efl_added, "spin_button"));
+
+ DATE_GET();
+ //Using system config?
+ pd->min_date[DATEPICKER_YEAR] = 1970;
+ pd->min_date[DATEPICKER_MONTH] = 1;
+ pd->min_date[DATEPICKER_DAY] = 1;
+ pd->max_date[DATEPICKER_YEAR] = 2037;
+ pd->max_date[DATEPICKER_MONTH] = 12;
+ pd->max_date[DATEPICKER_DAY] = 31;
+
+ _field_value_update(obj);
+
+ fmt = efl_datetime_manager_format_get(pd->dt_manager);
+ if (!fmt)
+ {
+ ERR("Failed to get current format.");
+ //Gives default format when the gets format failed.
+ fmt = "%Y %b %d";
+ }
+
+ //Sort fields by format.
+ while((ch = *fmt))
+ {
+ //TODO: ignore extensions and separators.
+ for (i = 0; i < EFL_UI_DATEPICKER_TYPE_COUNT; i++)
+ {
+ if (strchr(fmt_char[i], ch))
+ {
+ snprintf(buf, sizeof(buf), "efl.field%d", field++);
+ if (i == DATEPICKER_YEAR)
+ efl_content_set(efl_part(obj, buf), pd->year);
+ else if (i == DATEPICKER_MONTH)
+ efl_content_set(efl_part(obj, buf), pd->month);
+ else
+ efl_content_set(efl_part(obj, buf), pd->day);
+
+ break;
+ }
+ }
+ fmt++;
+ }
+}
+
+EOLIAN static void
+_efl_ui_datepicker_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Datepicker_Data *_pd EINA_UNUSED)
+{
+ Evas_Coord minw = -1, minh = -1;
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+
+ elm_coords_finger_size_adjust(1, &minw, 1, &minh);
+ edje_object_size_min_restricted_calc
+ (wd->resize_obj, &minw, &minh, minw, minh);
+ elm_coords_finger_size_adjust(1, &minw, 1, &minh);
+ evas_object_size_hint_min_set(obj, minw, minh);
+ evas_object_size_hint_max_set(obj, -1, -1);
+}
+
+EOLIAN static Eo *
+_efl_ui_datepicker_efl_object_constructor(Eo *obj, Efl_Ui_Datepicker_Data *pd)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
+
+ if (!elm_widget_theme_klass_get(obj))
+ elm_widget_theme_klass_set(obj, "datepicker");
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+
+ if (!elm_widget_theme_object_set(obj, wd->resize_obj,
+ elm_widget_theme_klass_get(obj),
+ elm_widget_theme_element_get(obj),
+ elm_widget_theme_style_get(obj)))
+ CRI("Failed to set layout!");
+
+ pd->dt_manager = efl_add(EFL_DATETIME_MANAGER_CLASS, obj);
+
+ _fields_init(obj);
+
+ elm_widget_sub_object_parent_add(obj);
+
+ elm_widget_can_focus_set(obj, EINA_TRUE);
+
+ return obj;
+}
+
+EOLIAN static void
+_efl_ui_datepicker_efl_object_destructor(Eo *obj, Efl_Ui_Datepicker_Data *pd)
+{
+ efl_del(pd->dt_manager);
+ efl_destructor(efl_super(obj, MY_CLASS));
+}
+
+EOLIAN static void
+_efl_ui_datepicker_min_set(Eo *obj, Efl_Ui_Datepicker_Data *pd EINA_UNUSED, int year, int month, int day)
+{
+ int new_time[EFL_UI_DATEPICKER_TYPE_COUNT] = {year, month, day};
+
+ if (!_validate_params(year, month, day)) return;
+ if (_date_cmp(pd->min_date, new_time)) return;
+
+ memcpy(pd->min_date, new_time, (sizeof(int) * EFL_UI_DATEPICKER_TYPE_COUNT));
+
+ _validate_date_limits(pd->max_date, pd->min_date, EINA_FALSE);
+ _validate_date_limits(pd->cur_date, pd->min_date, EINA_FALSE);
+
+ DATE_SET();
+ _field_value_update(obj);
+}
+
+EOLIAN static void
+_efl_ui_datepicker_min_get(const Eo *obj EINA_UNUSED, Efl_Ui_Datepicker_Data *pd, int *year, int *month, int *day)
+{
+ *year = pd->min_date[DATEPICKER_YEAR];
+ *month = pd->min_date[DATEPICKER_MONTH];
+ *day = pd->min_date[DATEPICKER_DAY];
+}
+
+EOLIAN static void
+_efl_ui_datepicker_max_set(Eo *obj, Efl_Ui_Datepicker_Data *pd EINA_UNUSED, int year, int month, int day)
+{
+ int new_time[EFL_UI_DATEPICKER_TYPE_COUNT] = {year, month, day};
+
+ if (!_validate_params(year, month, day)) return;
+ if (_date_cmp(pd->max_date, new_time)) return;
+
+ memcpy(pd->max_date, new_time, (sizeof(int) * EFL_UI_DATEPICKER_TYPE_COUNT));
+
+ _validate_date_limits(pd->max_date, pd->min_date, EINA_TRUE);
+ _validate_date_limits(pd->max_date, pd->cur_date, EINA_TRUE);
+
+ DATE_SET();
+ _field_value_update(obj);
+}
+
+EOLIAN static void
+_efl_ui_datepicker_max_get(const Eo *obj EINA_UNUSED, Efl_Ui_Datepicker_Data *pd, int *year, int *month, int *day)
+{
+ *year = pd->max_date[DATEPICKER_YEAR];
+ *month = pd->max_date[DATEPICKER_MONTH];
+ *day = pd->max_date[DATEPICKER_DAY];
+}
+
+EOLIAN static void
+_efl_ui_datepicker_date_set(Eo *obj, Efl_Ui_Datepicker_Data *pd, int year, int month, int day)
+{
+ int new_time[EFL_UI_DATEPICKER_TYPE_COUNT] = {year, month, day};
+
+ if (!_validate_params(year, month, day)) return;
+ if (_date_cmp(pd->cur_date, new_time)) return;
+
+ memcpy(pd->cur_date, new_time, (sizeof(int) * EFL_UI_DATEPICKER_TYPE_COUNT));
+
+ _validate_date_limits(pd->cur_date, pd->min_date, EINA_FALSE);
+ _validate_date_limits(pd->max_date, pd->cur_date, EINA_TRUE);
+
+ DATE_SET();
+ _field_value_update(obj);
+}
+
+EOLIAN static void
+_efl_ui_datepicker_date_get(const Eo *obj EINA_UNUSED, Efl_Ui_Datepicker_Data *pd, int *year, int *month, int *day)
+{
+ *year = pd->cur_date[DATEPICKER_YEAR];
+ *month = pd->cur_date[DATEPICKER_MONTH];
+ *day = pd->cur_date[DATEPICKER_DAY];
+}
+
+#define EFL_UI_DATEPICKER_EXTRA_OPS \
+ ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_datepicker), \
+
+#include "efl_ui_datepicker.eo.c"
diff --git a/src/lib/elementary/efl_ui_datepicker.eo b/src/lib/elementary/efl_ui_datepicker.eo
new file mode 100644
index 0000000000..7b769e9bae
--- /dev/null
+++ b/src/lib/elementary/efl_ui_datepicker.eo
@@ -0,0 +1,75 @@
+class Efl.Ui.Datepicker (Efl.Ui.Layout.Object)
+{
+ [[Datepicker widget
+
+ This is a widget which allows the user to pick a date using internal spinner.
+ User can use the internal spinner to select year, month, day or user can input
+ value using internal entry.
+ ]]
+ methods {
+ @property min {
+ [[The lower boundary of date.
+
+ $year: Year. The year range is from 1900 to 2137.
+
+ $month: Month. The month range is from 1 to 12.
+
+ $day: Day. The day range is from 1 to 31 according to $month.
+ ]]
+ set {
+ }
+ get{
+ }
+ values {
+ year: int; [[The year value.]]
+ month: int; [[The month value from 1 to 12.]]
+ day: int; [[The day value from 1 to 31.]]
+ }
+ }
+ @property max {
+ [[The upper boundary of date.
+
+ $year: Year. The year range is from 1900 to 2137.
+
+ $month: Month. The month range is from 1 to 12.
+
+ $day: Day. The day range is from 1 to 31 according to $month.
+ ]]
+ set {
+ }
+ get {
+ }
+ values {
+ year: int; [[The year value.]]
+ month: int; [[The month value from 1 to 12.]]
+ day: int; [[The day value from 1 to 31.]]
+ }
+ }
+ @property date {
+ [[The current value of date.
+
+ $year: Year. The year range is from 1900 to 2137.
+
+ $month: Month. The month range is from 0 to 11.
+
+ $day: Day. The day range is from 1 to 31 according to $month.
+ ]]
+ set {
+ }
+ get{
+ }
+ values {
+ year: int; [[The year value.]]
+ month: int; [[The month value from 1 to 12.]]
+ day: int; [[The day value from 1 to 31.]]
+ }
+ }
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Object.destructor;
+ }
+ events {
+ changed: void; [[Called when date value is changed]]
+ }
+}
diff --git a/src/lib/elementary/efl_ui_datepicker_private.h b/src/lib/elementary/efl_ui_datepicker_private.h
new file mode 100644
index 0000000000..0ee265b8b8
--- /dev/null
+++ b/src/lib/elementary/efl_ui_datepicker_private.h
@@ -0,0 +1,22 @@
+#ifndef EFL_UI_DATEPICKER_PRIVATE_H
+#define EFL_UI_DATEPICKER_PRIVATE_H
+
+#define EFL_UI_DATEPICKER_TYPE_COUNT 3
+
+typedef enum _Efl_Ui_Datepicker_Field_Type
+{
+ DATEPICKER_YEAR,
+ DATEPICKER_MONTH,
+ DATEPICKER_DAY
+} Efl_Ui_Datepicker_Field_Type;
+
+typedef struct _Efl_Ui_Datepicker_Data Efl_Ui_Datepicker_Data;
+struct _Efl_Ui_Datepicker_Data
+{
+ Eo *dt_manager, *year, *month, *day;
+ int cur_date[EFL_UI_DATEPICKER_TYPE_COUNT],
+ min_date[EFL_UI_DATEPICKER_TYPE_COUNT],
+ max_date[EFL_UI_DATEPICKER_TYPE_COUNT];
+};
+
+#endif
diff --git a/src/lib/elementary/efl_ui_dnd.c b/src/lib/elementary/efl_ui_dnd.c
new file mode 100644
index 0000000000..2560b82438
--- /dev/null
+++ b/src/lib/elementary/efl_ui_dnd.c
@@ -0,0 +1,838 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
+#define ELM_INTERFACE_ATSPI_TEXT_PROTECTED
+#define ELM_INTERFACE_ATSPI_TEXT_EDITABLE_PROTECTED
+#define ELM_LAYOUT_PROTECTED
+
+#define EFL_SELECTION_MANAGER_BETA
+
+#include <Elementary.h>
+#include <Elementary_Cursor.h>
+#include "elm_priv.h"
+
+typedef struct _Efl_Ui_Dnd_Container_Data Efl_Ui_Dnd_Container_Data;
+struct _Efl_Ui_Dnd_Container_Data
+{
+ unsigned int drag_delay_time;
+};
+
+extern int _wl_default_seat_id_get(Evas_Object *obj);
+
+static inline Eo *
+_selection_manager_get(Eo *obj)
+{
+ if (!efl_isa(obj, EFL_UI_WIDGET_CLASS)) return NULL;
+ Eo *app = efl_app_get();
+ Eo *sel_man = efl_key_data_get(app, "__selection_manager");
+ if (!sel_man)
+ {
+ sel_man = efl_add(EFL_SELECTION_MANAGER_CLASS, app);
+ efl_key_data_set(app, "__selection_manager", sel_man);
+ }
+ return sel_man;
+}
+
+EOLIAN static void
+_efl_ui_dnd_drag_start(Eo *obj, void *pd EINA_UNUSED, Efl_Selection_Format format, Eina_Slice data,
+ Efl_Selection_Action action, void *icon_func_data, Efl_Dnd_Drag_Icon_Create icon_func, Eina_Free_Cb icon_func_free_cb,
+ unsigned int seat)
+{
+ Eo *sel_man = _selection_manager_get(obj);
+ efl_selection_manager_drag_start(sel_man, obj, format, data, action,
+ icon_func_data, icon_func, icon_func_free_cb,
+ seat);
+}
+
+EOLIAN static void
+_efl_ui_dnd_drag_cancel(Eo *obj, void *pd EINA_UNUSED, unsigned int seat)
+{
+ Eo *sel_man = _selection_manager_get(obj);
+ efl_selection_manager_drag_cancel(sel_man, obj, seat);
+}
+
+EOLIAN static void
+_efl_ui_dnd_drag_action_set(Eo *obj, void *pd EINA_UNUSED, Efl_Selection_Action action, unsigned int seat)
+{
+ Eo *sel_man = _selection_manager_get(obj);
+ efl_selection_manager_drag_action_set(sel_man, obj, action, seat);
+}
+
+
+EOLIAN static void
+_efl_ui_dnd_drop_target_add(Eo *obj, void *pd EINA_UNUSED, Efl_Selection_Format format, unsigned int seat)
+{
+ Eo *sel_man = _selection_manager_get(obj);
+ efl_selection_manager_drop_target_add(sel_man, obj, format, seat);
+}
+
+EOLIAN static void
+_efl_ui_dnd_drop_target_del(Eo *obj, void *pd EINA_UNUSED, Efl_Selection_Format format, unsigned int seat)
+{
+ Eo *sel_man = _selection_manager_get(obj);
+ efl_selection_manager_drop_target_del(sel_man, obj, format, seat);
+}
+
+EOLIAN static double
+_efl_ui_dnd_container_drag_delay_time_get(const Eo *obj EINA_UNUSED, Efl_Ui_Dnd_Container_Data *pd)
+{
+ return pd->drag_delay_time;
+}
+
+EOLIAN static void
+_efl_ui_dnd_container_drag_delay_time_set(Eo *obj EINA_UNUSED, Efl_Ui_Dnd_Container_Data *pd, double drag_delay_time)
+{
+ pd->drag_delay_time = drag_delay_time;
+}
+
+EOLIAN static void
+_efl_ui_dnd_container_drag_item_add(Eo *obj, Efl_Ui_Dnd_Container_Data *pd,
+ void *data_func_data, Efl_Dnd_Drag_Data_Get data_func, Eina_Free_Cb data_func_free_cb,
+ void *item_func_data, Efl_Dnd_Item_Get item_func, Eina_Free_Cb item_func_free_cb,
+ void *icon_func_data, Efl_Dnd_Drag_Icon_Create icon_func, Eina_Free_Cb icon_func_free_cb,
+ void *icon_list_func_data, Efl_Dnd_Drag_Icon_List_Create icon_list_func, Eina_Free_Cb icon_list_func_free_cb,
+ unsigned int seat)
+{
+ double drag_delay_time = pd->drag_delay_time;
+ double anim_time = elm_config_drag_anim_duration_get();
+ Eo *sel_man = _selection_manager_get(obj);
+ efl_selection_manager_container_drag_item_add(sel_man, obj, drag_delay_time, anim_time,
+ data_func_data, data_func, data_func_free_cb,
+ item_func_data, item_func, item_func_free_cb,
+ icon_func_data, icon_func, icon_func_free_cb,
+ icon_list_func_data, icon_list_func, icon_list_func_free_cb,
+ seat);
+}
+
+static void
+_efl_ui_dnd_container_drag_item_del(Eo *obj, Efl_Ui_Dnd_Container_Data *pd EINA_UNUSED, unsigned int seat)
+{
+ Eo *sel_man = _selection_manager_get(obj);
+ efl_selection_manager_container_drag_item_del(sel_man, obj, seat);
+}
+EOLIAN static void
+_efl_ui_dnd_container_drop_item_add(Eo *obj, Efl_Ui_Dnd_Container_Data *pd EINA_UNUSED,
+ Efl_Selection_Format format,
+ void *item_func_data, Efl_Dnd_Item_Get item_func, Eina_Free_Cb item_func_free_cb,
+ unsigned int seat)
+{
+ Eo *sel_man = _selection_manager_get(obj);
+ efl_selection_manager_container_drop_item_add(sel_man, obj, format, item_func_data, item_func, item_func_free_cb, seat);
+}
+
+EOLIAN static void
+_efl_ui_dnd_container_drop_item_del(Eo *obj, Efl_Ui_Dnd_Container_Data *pd EINA_UNUSED, unsigned int seat)
+{
+ Eo *sel_man = _selection_manager_get(obj);
+ efl_selection_manager_container_drop_item_del(sel_man, obj, seat);
+}
+
+
+///////////
+typedef struct _Dnd_Icon_Create Dnd_Icon_Create;
+typedef struct _Dnd_Drag_Pos Dnd_Drag_Pos;
+typedef struct _Dnd_Drag_Accept Dnd_Drag_Accept;
+typedef struct _Dnd_Drag_Done Dnd_Drag_Done;
+typedef struct _Dnd_Drag_State Dnd_Drag_State;
+typedef struct _Dnd_Drop Dnd_Drop;
+typedef struct _Dnd_Cont_Drag_Pos Dnd_Cont_Drag_Pos;
+typedef struct _Dnd_Cont_Drop Dnd_Cont_Drop;
+typedef struct _Item_Container_Drag_Info Item_Container_Drag_Info;
+
+struct _Dnd_Icon_Create
+{
+ void *icon_data;
+ Elm_Drag_Icon_Create_Cb icon_cb;
+};
+
+struct _Dnd_Drag_Pos
+{
+ void *pos_data;
+ Elm_Drag_Pos pos_cb;
+};
+
+struct _Dnd_Drag_Accept
+{
+ void *accept_data;
+ Elm_Drag_Accept accept_cb;
+};
+
+struct _Dnd_Drag_Done
+{
+ void *done_data;
+ Elm_Drag_State done_cb;
+
+ //for deleting
+ Dnd_Drag_Pos *pos;
+ Dnd_Drag_Accept *accept;
+};
+
+struct _Dnd_Drag_State
+{
+ void *state_data;
+ Elm_Drag_State state_cb;
+};
+
+struct _Dnd_Drop
+{
+ Efl_Object *obj;
+ Elm_Sel_Format format;
+ void *drop_data;
+ Elm_Drop_Cb drop_cb;
+
+ //for deleting
+ Dnd_Drag_State *enter;
+ Dnd_Drag_State *leave;
+ Dnd_Drag_Pos *pos;
+};
+
+struct _Dnd_Cont_Drag_Pos
+{
+ void *pos_data;
+ Elm_Drag_Item_Container_Pos pos_cb;
+ Elm_Xy_Item_Get_Cb item_get_cb;
+};
+
+struct _Dnd_Cont_Drop
+{
+ Efl_Object *obj;
+ Elm_Sel_Format format;
+ void *drop_data;
+ Elm_Drop_Item_Container_Cb drop_cb;
+ Elm_Xy_Item_Get_Cb item_get_cb;
+
+ //for deleting
+ Dnd_Drag_State *enter;
+ Dnd_Drag_State *leave;
+ Dnd_Cont_Drag_Pos *pos;
+};
+
+struct _Item_Container_Drag_Info
+{
+ Elm_Drag_User_Info user_info;
+ Elm_Object_Item *it;
+ Elm_Item_Container_Data_Get_Cb data_get_cb;
+ Elm_Xy_Item_Get_Cb item_get_cb;
+};
+
+static Efl_Object *
+_dnd_icon_create_cb(void *data, Efl_Object *win, Efl_Object *drag_obj EINA_UNUSED, Eina_Position2D *pos_ret)
+{
+ Dnd_Icon_Create *ic = data;
+ Efl_Object *ret = ic->icon_cb(ic->icon_data, win, &pos_ret->x, &pos_ret->y);
+
+ free(ic);
+ return ret;
+}
+
+static void
+_dnd_drag_pos_cb(void *data, const Efl_Event *event)
+{
+ Dnd_Drag_Pos *pos = data;
+ Efl_Dnd_Drag_Pos *ddata = event->info;
+
+ if (pos->pos_cb)
+ pos->pos_cb(pos->pos_data, event->object, ddata->pos.x, ddata->pos.y,
+ (Elm_Xdnd_Action)ddata->action);
+}
+
+static void
+_dnd_drag_accept_cb(void *data, const Efl_Event *event)
+{
+ Dnd_Drag_Accept *accept = data;
+
+ if (accept->accept_cb)
+ accept->accept_cb(accept->accept_data, event->object, *(Eina_Bool *)event->info);
+}
+
+static void
+_dnd_drag_done_cb(void *data, const Efl_Event *event)
+{
+ Dnd_Drag_Done *done = data;
+
+ if (done->done_cb)
+ done->done_cb(done->done_data, event->object);
+
+ efl_event_callback_del(event->object, EFL_UI_DND_EVENT_DRAG_POS,
+ _dnd_drag_pos_cb, done->pos);
+ efl_event_callback_del(event->object, EFL_UI_DND_EVENT_DRAG_ACCEPT,
+ _dnd_drag_accept_cb, done->accept);
+ efl_event_callback_del(event->object, EFL_UI_DND_EVENT_DRAG_DONE,
+ _dnd_drag_done_cb, done);
+ free(done->pos);
+ free(done->accept);
+ free(done);
+}
+
+static void
+_dnd_drag_enter_leave_cb(void *data, const Efl_Event *event)
+{
+ Dnd_Drag_State *state = data;
+
+ if (state->state_cb)
+ state->state_cb(state->state_data, event->object);
+}
+
+static void
+_dnd_drop_cb(void *data, const Efl_Event *event)
+{
+ Dnd_Drop *drop = data;
+ Efl_Selection_Data *org_ddata = event->info;
+ Elm_Selection_Data ddata;
+
+ ddata.x = org_ddata->pos.x;
+ ddata.y = org_ddata->pos.y;
+ ddata.format = (Elm_Sel_Format)org_ddata->format;
+ ddata.action = (Elm_Xdnd_Action)org_ddata->action;
+ ddata.data = calloc(1, org_ddata->content.len);
+ if (!ddata.data) return;
+ ddata.data = memcpy(ddata.data, org_ddata->content.mem, org_ddata->content.len);
+ ddata.len = org_ddata->content.len;
+ if (drop->drop_cb)
+ drop->drop_cb(drop->drop_data, event->object, &ddata);
+ free(ddata.data);
+}
+
+EAPI Eina_Bool
+elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data,
+ Elm_Xdnd_Action action,
+ Elm_Drag_Icon_Create_Cb icon_create_cb, void *icon_create_data,
+ Elm_Drag_Pos drag_pos_cb, void *drag_pos_data,
+ Elm_Drag_Accept drag_accept_cb, void *drag_accept_data,
+ Elm_Drag_State drag_done_cb, void *drag_done_data)
+{
+ if (!data) return EINA_FALSE;
+ Eo *sel_man = _selection_manager_get(obj);
+ int seatid = 1;
+ Eina_Slice sl;
+ Dnd_Drag_Pos *pos = calloc(1, sizeof(Dnd_Drag_Pos));
+ Dnd_Drag_Accept *accept = calloc(1, sizeof(Dnd_Drag_Accept));
+ Dnd_Drag_Done *done = calloc(1, sizeof(Dnd_Drag_Done));
+ Dnd_Icon_Create *ic = calloc(1, sizeof(Dnd_Icon_Create));
+ if (!pos || !accept || !done || !ic) goto on_error;
+
+ pos->pos_data = drag_pos_data;
+ pos->pos_cb = drag_pos_cb;
+
+ accept->accept_data = drag_accept_data;
+ accept->accept_cb = drag_accept_cb;
+
+ done->done_data = drag_done_data;
+ done->done_cb = drag_done_cb;
+ done->pos = pos;
+ done->accept = accept;
+
+ efl_event_callback_add(obj, EFL_UI_DND_EVENT_DRAG_POS, _dnd_drag_pos_cb, pos);
+ efl_event_callback_add(obj, EFL_UI_DND_EVENT_DRAG_ACCEPT, _dnd_drag_accept_cb, accept);
+ efl_event_callback_add(obj, EFL_UI_DND_EVENT_DRAG_DONE, _dnd_drag_done_cb, done);
+ sl.mem = data;
+ sl.len = strlen(data);
+#ifdef HAVE_ELEMENTARY_WL2
+ seatid = _wl_default_seat_id_get(obj);
+#endif
+
+ ic->icon_data = icon_create_data;
+ ic->icon_cb = icon_create_cb;
+ efl_selection_manager_drag_start(sel_man, obj, (Efl_Selection_Format)format, sl,
+ (Efl_Selection_Action)action,
+ ic, _dnd_icon_create_cb, NULL, seatid);
+
+ return EINA_TRUE;
+
+on_error:
+ if (pos) free(pos);
+ if (accept) free(accept);
+ if (done) free(done);
+ if (ic) free(ic);
+
+ return EINA_FALSE;
+}
+
+EAPI Eina_Bool
+elm_drag_action_set(Evas_Object *obj, Elm_Xdnd_Action action)
+{
+ Eo *sel_man = _selection_manager_get(obj);
+ int seatid = 1;
+
+#ifdef HAVE_ELEMENTARY_WL2
+ seatid = _wl_default_seat_id_get(obj);
+#endif
+ efl_selection_manager_drag_action_set(sel_man, obj, (Efl_Selection_Action)action, seatid);
+
+ return EINA_TRUE;
+}
+
+EAPI Eina_Bool
+elm_drag_cancel(Evas_Object *obj)
+{
+ Eo *sel_man = _selection_manager_get(obj);
+ int seatid = 1;
+
+#ifdef HAVE_ELEMENTARY_WL2
+ seatid = _wl_default_seat_id_get(obj);
+#endif
+
+ efl_selection_manager_drag_cancel(sel_man, obj, seatid);
+
+ return EINA_TRUE;
+}
+
+static void
+_drop_obj_del_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
+{
+ Eina_List *drop_list;
+ Dnd_Drop *drop;
+
+ drop_list = efl_key_data_get(obj, "__drop_list");
+ EINA_LIST_FREE(drop_list, drop)
+ {
+ efl_event_callback_del(drop->obj, EFL_UI_DND_EVENT_DRAG_ENTER,
+ _dnd_drag_enter_leave_cb, drop->enter);
+ efl_event_callback_del(drop->obj, EFL_UI_DND_EVENT_DRAG_LEAVE,
+ _dnd_drag_enter_leave_cb, drop->leave);
+ efl_event_callback_del(drop->obj, EFL_UI_DND_EVENT_DRAG_POS,
+ _dnd_drag_pos_cb, drop->pos);
+ efl_event_callback_del(drop->obj, EFL_UI_DND_EVENT_DRAG_DROP,
+ _dnd_drop_cb, drop);
+ free(drop->enter);
+ free(drop->leave);
+ free(drop->pos);
+ free(drop);
+ }
+ efl_key_data_set(obj, "__drop_list", NULL);
+}
+
+EAPI Eina_Bool
+elm_drop_target_add(Evas_Object *obj, Elm_Sel_Format format,
+ Elm_Drag_State enter_cb, void *enter_data,
+ Elm_Drag_State leave_cb, void *leave_data,
+ Elm_Drag_Pos pos_cb, void *pos_data,
+ Elm_Drop_Cb drop_cb, void *drop_data)
+{
+ Eo *sel_man = _selection_manager_get(obj);
+ int seatid = 1;
+ Dnd_Drag_State *enter, *leave;
+ Dnd_Drag_Pos *pos;
+ Dnd_Drop *drop;
+ Eina_List *drop_list;
+
+ enter = calloc(1, sizeof(Dnd_Drag_State));
+ leave = calloc(1, sizeof(Dnd_Drag_State));
+ pos = calloc(1, sizeof(Dnd_Drag_Pos));
+ drop = calloc(1, sizeof(Dnd_Drop));
+ if (!enter || !leave || !pos || !drop) goto on_error;
+#ifdef HAVE_ELEMENTARY_WL2
+ seatid = _wl_default_seat_id_get(obj);
+#endif
+ enter->state_cb = enter_cb;
+ enter->state_data = enter_data;
+ leave->state_cb = leave_cb;
+ leave->state_data = leave_data;
+ pos->pos_cb = pos_cb;
+ pos->pos_data = pos_data;
+ drop->obj = obj;
+ drop->format = format;
+ drop->drop_cb = drop_cb;
+ drop->drop_data = drop_data;
+ drop->enter = enter;
+ drop->leave = leave;
+ drop->pos = pos;
+
+ drop_list = efl_key_data_get(obj, "__drop_list");
+ drop_list = eina_list_append(drop_list, drop);
+ efl_key_data_set(obj, "__drop_list", drop_list);
+ evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
+ _drop_obj_del_cb, NULL);
+ efl_event_callback_add(obj, EFL_UI_DND_EVENT_DRAG_ENTER,
+ _dnd_drag_enter_leave_cb, enter);
+ efl_event_callback_add(obj, EFL_UI_DND_EVENT_DRAG_LEAVE,
+ _dnd_drag_enter_leave_cb, leave);
+ efl_event_callback_add(obj, EFL_UI_DND_EVENT_DRAG_POS,
+ _dnd_drag_pos_cb, pos);
+ efl_event_callback_add(obj, EFL_UI_DND_EVENT_DRAG_DROP,
+ _dnd_drop_cb, drop);
+ efl_selection_manager_drop_target_add(sel_man, obj, (Efl_Selection_Format)format, seatid);
+
+ return EINA_TRUE;
+
+on_error:
+ if (enter) free(enter);
+ if (leave) free(leave);
+ if (pos) free(pos);
+ if (drop) free(drop);
+
+ return EINA_FALSE;
+}
+
+EAPI Eina_Bool
+elm_drop_target_del(Evas_Object *obj, Elm_Sel_Format format,
+ Elm_Drag_State enter_cb, void *enter_data,
+ Elm_Drag_State leave_cb, void *leave_data,
+ Elm_Drag_Pos pos_cb, void *pos_data,
+ Elm_Drop_Cb drop_cb, void *drop_data)
+{
+ Eo *sel_man = _selection_manager_get(obj);
+ int seatid = 1;
+ //Eina_List *l, *l2;
+ Eina_List *drop_list;
+ Dnd_Drop *drop;
+
+#ifdef HAVE_ELEMENTARY_WL2
+ seatid = _wl_default_seat_id_get(obj);
+#endif
+
+ drop_list = efl_key_data_get(obj, "__drop_list");
+ drop = eina_list_data_get(drop_list);
+ if (drop &&
+ (drop->format == format) &&
+ (drop->enter->state_cb == enter_cb) &&
+ (drop->enter->state_data == enter_data) &&
+ (drop->leave->state_cb == leave_cb) &&
+ (drop->leave->state_data == leave_data) &&
+ (drop->pos->pos_cb == pos_cb) &&
+ (drop->pos->pos_data == pos_data) &&
+ (drop->drop_cb == drop_cb) &&
+ (drop->drop_data == drop_data))
+ {
+ drop_list = eina_list_remove(drop_list, drop);
+ efl_key_data_set(obj, "__drop_list", drop_list);
+ evas_object_event_callback_del(obj, EVAS_CALLBACK_DEL, _drop_obj_del_cb);
+ efl_event_callback_del(drop->obj, EFL_UI_DND_EVENT_DRAG_ENTER,
+ _dnd_drag_enter_leave_cb, drop->enter);
+ efl_event_callback_del(drop->obj, EFL_UI_DND_EVENT_DRAG_LEAVE,
+ _dnd_drag_enter_leave_cb, drop->leave);
+ efl_event_callback_del(drop->obj, EFL_UI_DND_EVENT_DRAG_POS,
+ _dnd_drag_pos_cb, drop->pos);
+ efl_event_callback_del(drop->obj, EFL_UI_DND_EVENT_DRAG_DROP,
+ _dnd_drop_cb, drop);
+ free(drop->enter);
+ free(drop->leave);
+ free(drop->pos);
+ free(drop);
+ }
+ efl_selection_manager_drop_target_del(sel_man, obj, (Efl_Selection_Format)format, seatid);
+
+ return EINA_TRUE;
+}
+
+static Efl_Object *
+_dnd_item_func(void *data, Efl_Canvas_Object *item, Eina_Position2D pos, Eina_Position2D *pos_ret)
+{
+ Elm_Xy_Item_Get_Cb item_get_cb = data;
+ Evas_Coord x, y;
+ Efl_Object *obj = NULL;
+
+ x = y = 0;
+ if (item_get_cb)
+ obj = item_get_cb(item, pos.x, pos.y, &x, &y);
+ if (pos_ret)
+ {
+ pos_ret->x = x;
+ pos_ret->y = y;
+ }
+
+ return obj;
+}
+
+static void
+_dnd_cont_drag_pos_cb(void *data, const Efl_Event *event)
+{
+ Dnd_Cont_Drag_Pos *pos = data;
+ Efl_Dnd_Drag_Pos *ddata = event->info;
+ Evas_Coord xret = 0, yret = 0;
+
+ if (pos->item_get_cb)
+ {
+ Evas_Coord x, y;
+ evas_object_geometry_get(event->object, &x, &y, NULL, NULL);
+ pos->item_get_cb(event->object, ddata->pos.x + x, ddata->pos.y + y,
+ &xret, &yret);
+ }
+ if (pos->pos_cb)
+ pos->pos_cb(pos->pos_data, event->object, ddata->item, ddata->pos.x, ddata->pos.y,
+ xret, yret, (Elm_Xdnd_Action)ddata->action);
+}
+
+static void
+_dnd_cont_drop_cb(void *data, const Efl_Event *event)
+{
+ Dnd_Cont_Drop *drop = data;
+ Efl_Selection_Data *org_ddata = event->info;
+ Elm_Selection_Data ddata;
+ Evas_Coord xret = 0, yret = 0;
+
+ ddata.x = org_ddata->pos.x;
+ ddata.y = org_ddata->pos.y;
+ ddata.format = (Elm_Sel_Format)org_ddata->format;
+ ddata.action = (Elm_Xdnd_Action)org_ddata->action;
+ ddata.data = calloc(1, org_ddata->content.len);
+ if (!ddata.data) return;
+ ddata.data = memcpy(ddata.data, org_ddata->content.mem, org_ddata->content.len);
+ ddata.len = org_ddata->content.len;
+
+ if (drop->item_get_cb)
+ {
+ Evas_Coord x, y;
+ evas_object_geometry_get(event->object, &x, &y, NULL, NULL);
+ drop->item_get_cb(event->object, ddata.x + x, ddata.y + y,
+ &xret, &yret);
+ }
+
+ if (drop->drop_cb)
+ drop->drop_cb(drop->drop_data, event->object, org_ddata->item,
+ &ddata, xret, yret);
+ free(ddata.data);
+}
+
+static void
+_cont_drop_free_data(Evas_Object *obj)
+{
+ Eina_List *cont_drop_list;
+ Dnd_Cont_Drop *drop;
+
+ cont_drop_list = efl_key_data_get(obj, "__cont_drop_item");
+ drop = eina_list_data_get(cont_drop_list);
+ if (drop)
+ {
+ efl_event_callback_del(drop->obj, EFL_UI_DND_EVENT_DRAG_ENTER,
+ _dnd_drag_enter_leave_cb, drop->enter);
+ efl_event_callback_del(drop->obj, EFL_UI_DND_EVENT_DRAG_LEAVE,
+ _dnd_drag_enter_leave_cb, drop->leave);
+ efl_event_callback_del(drop->obj, EFL_UI_DND_EVENT_DRAG_POS,
+ _dnd_cont_drag_pos_cb, drop->pos);
+ efl_event_callback_del(drop->obj, EFL_UI_DND_EVENT_DRAG_DROP,
+ _dnd_cont_drop_cb, drop);
+ free(drop->enter);
+ free(drop->leave);
+ free(drop->pos);
+ cont_drop_list = eina_list_remove(cont_drop_list, drop);
+ efl_key_data_set(obj, "__cont_drop_item", cont_drop_list);
+ free(drop);
+ }
+}
+
+static void
+_cont_drop_obj_del_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *info EINA_UNUSED)
+{
+ _cont_drop_free_data(obj);
+}
+
+EAPI Eina_Bool
+elm_drop_item_container_add(Evas_Object *obj,
+ Elm_Sel_Format format,
+ Elm_Xy_Item_Get_Cb item_get_cb,
+ Elm_Drag_State enter_cb, void *enter_data,
+ Elm_Drag_State leave_cb, void *leave_data,
+ Elm_Drag_Item_Container_Pos pos_cb, void *pos_data,
+ Elm_Drop_Item_Container_Cb drop_cb, void *drop_data)
+{
+ Eo *sel_man = _selection_manager_get(obj);
+ int seatid = 1;
+ Dnd_Drag_State *enter = NULL, *leave = NULL;
+ Dnd_Cont_Drag_Pos *pos = NULL;
+ Dnd_Cont_Drop *drop = NULL;
+ Eina_List *cont_drop_list;
+
+ enter = calloc(1, sizeof(Dnd_Drag_State));
+ leave = calloc(1, sizeof(Dnd_Drag_State));
+ pos = calloc(1, sizeof(Dnd_Cont_Drag_Pos));
+ drop = calloc(1, sizeof(Dnd_Cont_Drop));
+ if (!enter || !leave || !pos || !drop) goto on_error;
+#ifdef HAVE_ELEMENTARY_WL2
+ seatid = _wl_default_seat_id_get(obj);
+#endif
+
+ enter->state_cb = enter_cb;
+ enter->state_data = enter_data;
+ leave->state_cb = leave_cb;
+ leave->state_data = leave_data;
+ pos->pos_cb = pos_cb;
+ pos->pos_data = pos_data;
+ pos->item_get_cb = item_get_cb;
+ drop->obj = obj;
+ drop->format = format;
+ drop->drop_cb = drop_cb;
+ drop->drop_data = drop_data;
+ drop->enter = enter;
+ drop->leave = leave;
+ drop->pos = pos;
+
+ cont_drop_list = efl_key_data_get(obj, "__cont_drop_item");
+ cont_drop_list = eina_list_append(cont_drop_list, drop);
+ efl_key_data_set(obj, "__cont_drop_item", cont_drop_list);
+ evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
+ _cont_drop_obj_del_cb, NULL);
+ efl_event_callback_add(obj, EFL_UI_DND_EVENT_DRAG_ENTER,
+ _dnd_drag_enter_leave_cb, enter);
+ efl_event_callback_add(obj, EFL_UI_DND_EVENT_DRAG_LEAVE,
+ _dnd_drag_enter_leave_cb, leave);
+ efl_event_callback_add(obj, EFL_UI_DND_EVENT_DRAG_POS,
+ _dnd_cont_drag_pos_cb, pos);
+ efl_event_callback_add(obj, EFL_UI_DND_EVENT_DRAG_DROP,
+ _dnd_cont_drop_cb, drop);
+ efl_selection_manager_container_drop_item_add(sel_man, obj, (Efl_Selection_Format)format,
+ item_get_cb, _dnd_item_func, NULL,
+ seatid);
+
+ return EINA_TRUE;
+
+on_error:
+ if (enter) free(enter);
+ if (leave) free(leave);
+ if (pos) free(pos);
+ if (drop) free(drop);
+
+ return EINA_FALSE;
+}
+
+EAPI Eina_Bool
+elm_drop_item_container_del(Evas_Object *obj)
+{
+ Eo *sel_man = _selection_manager_get(obj);
+ int seatid = 1;
+
+#ifdef HAVE_ELEMENTARY_WL2
+ seatid = _wl_default_seat_id_get(obj);
+#endif
+
+ _cont_drop_free_data(obj);
+ evas_object_event_callback_del(obj, EVAS_CALLBACK_DEL, _cont_drop_obj_del_cb);
+ efl_selection_manager_container_drop_item_del(sel_man, obj, seatid);
+
+ return EINA_TRUE;
+}
+
+static void
+_cont_drag_data_func(void *data, Efl_Object *obj, Efl_Selection_Format *format,
+ Eina_Rw_Slice *drag_data, Efl_Selection_Action *action)
+{
+ Item_Container_Drag_Info *di;
+
+ di = data;
+ if (!di) return;
+ di->data_get_cb(obj, di->it, &di->user_info);
+ if (format) *format = (Efl_Selection_Format)di->user_info.format;
+ if (drag_data)
+ {
+ if (di->user_info.data)
+ {
+ drag_data->mem = (void *)di->user_info.data;
+ drag_data->len = strlen(di->user_info.data);
+ }
+ }
+ if (action) *action = (Efl_Selection_Action)di->user_info.action;
+}
+
+static Eina_List *
+_cont_drag_icon_list_create(void *data, Efl_Object *obj EINA_UNUSED)
+{
+ Item_Container_Drag_Info *di;
+
+ di = data;
+ return di->user_info.icons;
+}
+
+static Efl_Object *
+_cont_drag_icon_create(void *data, Efl_Object *win, Efl_Object *drag_obj EINA_UNUSED, Eina_Position2D *pos_ret)
+{
+ Item_Container_Drag_Info *di;
+ Elm_Object_Item *it = NULL;
+
+ di = data;
+ if (!di) return NULL;
+ if (!di->user_info.createicon) return NULL;
+ it = di->user_info.createicon(di->user_info.createdata, win, &pos_ret->x, &pos_ret->y);
+ di->it = it;
+ return it;
+}
+
+static Efl_Object *
+_cont_drag_item_func(void *data, Efl_Canvas_Object *item, Eina_Position2D pos, Eina_Position2D *pos_ret)
+{
+ Item_Container_Drag_Info *di = data;
+ Evas_Coord x, y;
+ Efl_Object *obj = NULL;
+
+ x = y = 0;
+ if (di->item_get_cb)
+ obj = di->item_get_cb(item, pos.x, pos.y, &x, &y);
+ if (pos_ret)
+ {
+ pos_ret->x = x;
+ pos_ret->y = y;
+ }
+ di->it = obj;
+
+ return obj;
+}
+
+static void
+_cont_drag_free_data(Evas_Object *obj)
+{
+ Eina_List *di_list;
+ Item_Container_Drag_Info *di;
+
+ di_list = efl_key_data_get(obj, "__cont_drag_item");
+ di = eina_list_data_get(di_list);
+ di_list = eina_list_remove(di_list, di);
+ efl_key_data_set(obj, "__cont_drag_item", di_list);
+ free(di);
+}
+
+static void
+_cont_drag_obj_del_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event EINA_UNUSED)
+{
+ _cont_drag_free_data(obj);
+}
+
+EAPI Eina_Bool
+elm_drag_item_container_add(Evas_Object *obj, double anim_tm, double tm_to_drag,
+ Elm_Xy_Item_Get_Cb item_get_cb, Elm_Item_Container_Data_Get_Cb data_get_cb)
+{
+ Eo *sel_man = _selection_manager_get(obj);
+ int seatid = 1;
+ Eina_List *di_list;
+ Item_Container_Drag_Info *di;
+
+#ifdef HAVE_ELEMENTARY_WL2
+ seatid = _wl_default_seat_id_get(obj);
+#endif
+
+ di = calloc(1, sizeof(Item_Container_Drag_Info));
+ if (!di) return EINA_FALSE;
+ di->data_get_cb = data_get_cb;
+ di->item_get_cb = item_get_cb;
+ di_list = efl_key_data_get(obj, "__cont_drag_item");
+ di_list = eina_list_append(di_list, di);
+ efl_key_data_set(obj, "__cont_drag_item", di_list);
+ evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, _cont_drag_obj_del_cb, NULL);
+ efl_selection_manager_container_drag_item_add(sel_man, obj, anim_tm, tm_to_drag,
+ di, _cont_drag_data_func, NULL,
+ di, _cont_drag_item_func, NULL,
+ di, _cont_drag_icon_create, NULL,
+ di, _cont_drag_icon_list_create, NULL,
+ seatid);
+ return EINA_TRUE;
+}
+
+EAPI Eina_Bool
+elm_drag_item_container_del(Evas_Object *obj)
+{
+ Eo *sel_man = _selection_manager_get(obj);
+ int seatid = 1;
+
+#ifdef HAVE_ELEMENTARY_WL2
+ seatid = _wl_default_seat_id_get(obj);
+#endif
+
+ _cont_drag_free_data(obj);
+ evas_object_event_callback_del(obj, EVAS_CALLBACK_DEL, _cont_drag_obj_del_cb);
+ efl_selection_manager_container_drag_item_del(sel_man, obj, seatid);
+
+ return EINA_TRUE;
+}
+
+#include "efl_ui_dnd.eo.c"
+#include "efl_ui_dnd_container.eo.c"
diff --git a/src/lib/elementary/efl_ui_dnd.eo b/src/lib/elementary/efl_ui_dnd.eo
new file mode 100644
index 0000000000..7c903c88cb
--- /dev/null
+++ b/src/lib/elementary/efl_ui_dnd.eo
@@ -0,0 +1,63 @@
+import efl_ui_dnd_types;
+
+mixin Efl.Ui.Dnd {
+ data: null;
+ methods {
+ drag_start {
+ [[Start a drag and drop process at the drag side.
+ During dragging, there are three events emitted as belows:
+ - EFL_UI_DND_EVENT_DRAG_POS
+ - EFL_UI_DND_EVENT_DRAG_ACCEPT
+ - EFL_UI_DND_EVENT_DRAG_DONE
+ ]]
+ params {
+ @in format: Efl.Selection_Format; [[The data format]]
+ @in data: Eina.Slice; [[The drag data]]
+ @in action: Efl.Selection_Action; [[Action when data is transferred]]
+ @in icon_func: Efl.Dnd.Drag_Icon_Create; [[Function pointer to create icon]]
+ @in seat: uint; [[Specified seat for multiple seats case.]]
+ }
+ }
+ drag_action_set {
+ [[Set the action for the drag]]
+ params {
+ @in action: Efl.Selection_Action; [[Drag action]]
+ @in seat: uint; [[Specified seat for multiple seats case.]]
+ }
+ }
+ drag_cancel {
+ [[Cancel the on-going drag]]
+ params {
+ @in seat: uint; [[Specified seat for multiple seats case.]]
+ }
+ }
+ drop_target_add {
+ [[Make the current object as drop targert.
+ There are four events emitted:
+ - EFL_UI_DND_EVENT_DRAG_ENTER
+ - EFL_UI_DND_EVENT_DRAG_LEAVE
+ - EFL_UI_DND_EVENT_DRAG_POS
+ - EFL_UI_DND_EVENT_DRAG_DROP.]]
+ params {
+ @in format: Efl.Selection_Format; [[Accepted data format]]
+ @in seat: uint; [[Specified seat for multiple seats case.]]
+ }
+ }
+ drop_target_del {
+ [[Delete the dropable status from object]]
+ params {
+ @in format: Efl.Selection_Format; [[Accepted data format]]
+ @in seat: uint; [[Specified seat for multiple seats case.]]
+ }
+ }
+ }
+ events {
+ /* FIXME: This is not very future-proof. Better return a struct. */
+ drag,accept: ptr(bool); [[accept drag data]]
+ drag,done: void; [[drag is done (mouse up)]]
+ drag,enter: void; [[called when the drag object enters this object]]
+ drag,leave: void; [[called when the drag object leaves this object]]
+ drag,pos: Efl.Dnd.Drag_Pos; [[called when the drag object changes drag position]]
+ drag,drop: Efl.Selection_Data; [[called when the drag object dropped on this object]]
+ }
+}
diff --git a/src/lib/elementary/efl_ui_dnd_container.eo b/src/lib/elementary/efl_ui_dnd_container.eo
new file mode 100644
index 0000000000..6334ea5ff5
--- /dev/null
+++ b/src/lib/elementary/efl_ui_dnd_container.eo
@@ -0,0 +1,48 @@
+import efl_ui_dnd_types;
+
+mixin Efl.Ui.Dnd_Container {
+ methods {
+ @property drag_delay_time {
+ [[The time since mouse down happens to drag starts.]]
+ set {
+ legacy: null;
+ }
+ get {
+ legacy: null;
+ }
+ values {
+ time: double; [[The drag delay time]]
+ }
+ }
+ drag_item_add {
+ [[This registers a drag for items in a container. Many items can be
+ dragged at a time. During dragging, there are three events emitted:
+ EFL_DND_EVENT_DRAG_POS, EFL_DND_EVENT_DRAG_ACCEPT, EFL_DND_EVENT_DRAG_DONE.]]
+ params {
+ @in data_func: Efl.Dnd.Drag_Data_Get; [[Data and its format]]
+ @in item_func: Efl.Dnd.Item_Get; [[Item to determine drag start]]
+ @in icon_func: Efl.Dnd.Drag_Icon_Create; [[Icon used during drag]]
+ @in icon_list_func: Efl.Dnd.Drag_Icon_List_Create; [[Icons used for animations CHECKING ]]
+ @in seat: uint; [[Specified seat for multiple seats case.]]
+ }
+ }
+ drag_item_del {
+ [[Remove drag function of items in the container object.]]
+ params {
+ @in seat: uint; [[Specified seat for multiple seats case.]]
+ }
+ }
+ drop_item_add {
+ params {
+ @in format: Efl.Selection_Format; [[Accepted data formats]]
+ @in item_func: Efl.Dnd.Item_Get; [[Get item at specific position]]
+ @in seat: uint; [[Specified seat for multiple seats case.]]
+ }
+ }
+ drop_item_del {
+ params {
+ @in seat: uint; [[Specified seat for multiple seats case.]]
+ }
+ }
+ }
+}
diff --git a/src/lib/elementary/efl_ui_dnd_types.eot b/src/lib/elementary/efl_ui_dnd_types.eot
new file mode 100644
index 0000000000..4e125c417a
--- /dev/null
+++ b/src/lib/elementary/efl_ui_dnd_types.eot
@@ -0,0 +1,58 @@
+import efl_selection_types;
+
+function Efl.Dnd.Drag_Icon_Create {
+ [[Function pointer for creating icon at the drag side.]]
+ params {
+ @in win: Efl.Canvas.Object; [[The window to create the objects relative to]]
+ @in drag_obj: Efl.Canvas.Object; [[The drag object]]
+ @out off: Eina.Position2D;
+ }
+ return: Efl.Canvas.Object; [[The drag icon object]]
+};
+
+function Efl.Dnd.Drag_Data_Get {
+ [[Function pointer for getting data and format at the drag side.]]
+ params {
+ @in obj: Efl.Canvas.Object; [[The container object]]
+ @out format: Efl.Selection_Format; [[Data format]]
+ @out drag_data: Eina.Rw_Slice; [[Data]]
+ @out action: Efl.Selection_Action; [[The drag action]]
+ }
+};
+
+function Efl.Dnd.Item_Get {
+ [[Function pointer to find out which item is under position (x, y)]]
+ params {
+ @in obj: Efl.Canvas.Object; [[The container object]]
+ @in pos: Eina.Position2D; [[The coordinates to get item]]
+ @out posret: Eina.Position2D; [[position relative to item (left (-1), middle (0), right (1)]]
+ }
+ return: Efl.Object; [[Object under x,y coordinates or NULL if not found]]
+};
+
+function Efl.Dnd.Drag_Icon_List_Create {
+ [[Function pointer to create list of icons at the drag side.
+ These icons are used for animation on combining selection icons
+ to one icon.]]
+ params {
+ @in obj: Efl.Canvas.Object; [[The container object]]
+ }
+ return: list<Efl.Canvas.Object>;
+};
+
+struct Efl.Dnd.Drag_Accept {
+ accepted: bool;
+}
+
+struct Efl.Dnd.Drag_Pos {
+ pos: Eina.Position2D; [[Evas Coordinate]]
+ action: Efl.Selection_Action; [[The drag action]]
+ format: Efl.Selection_Format; [[The drag format]]
+ item: Efl.Canvas.Object; [[The item object. It is only available for container object.]]
+}
+
+struct Efl.Dnd.Drag_Item_Container_Drop {
+ item: Efl.Canvas.Object; [[The item object]]
+ data: Efl.Selection_Data; [[The selection data]]
+ pos: Eina.Position2D; [[Position relative to item (left (-1), middle (0), right (1)]]
+}
diff --git a/src/lib/elementary/efl_ui_flip.c b/src/lib/elementary/efl_ui_flip.c
index 4fe972506d..9652389235 100644
--- a/src/lib/elementary/efl_ui_flip.c
+++ b/src/lib/elementary/efl_ui_flip.c
@@ -2,7 +2,8 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
+#define EFL_PART_PROTECTED
#include <Elementary.h>
#include "elm_priv.h"
@@ -14,7 +15,6 @@
#define MY_CLASS EFL_UI_FLIP_CLASS
#define MY_CLASS_NAME "Efl.Ui.Flip"
-#define MY_CLASS_NAME_LEGACY "elm_flip"
static const char SIG_ANIMATE_BEGIN[] = "animate,begin";
static const char SIG_ANIMATE_DONE[] = "animate,done";
@@ -98,7 +98,7 @@ _sizing_eval(Evas_Object *obj)
}
EOLIAN static Efl_Ui_Theme_Apply
-_efl_ui_flip_elm_widget_theme_apply(Eo *obj, Efl_Ui_Flip_Data *sd EINA_UNUSED)
+_efl_ui_flip_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Flip_Data *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
@@ -119,7 +119,7 @@ _changed_size_hints_cb(void *data,
}
EOLIAN static Eina_Bool
-_efl_ui_flip_elm_widget_widget_sub_object_add(Eo *obj, Efl_Ui_Flip_Data *_pd EINA_UNUSED, Evas_Object *sobj)
+_efl_ui_flip_efl_ui_widget_widget_sub_object_add(Eo *obj, Efl_Ui_Flip_Data *_pd EINA_UNUSED, Evas_Object *sobj)
{
Eina_Bool int_ret = EINA_FALSE;
@@ -139,7 +139,7 @@ _efl_ui_flip_elm_widget_widget_sub_object_add(Eo *obj, Efl_Ui_Flip_Data *_pd EIN
}
EOLIAN static Eina_Bool
-_efl_ui_flip_elm_widget_widget_sub_object_del(Eo *obj, Efl_Ui_Flip_Data *sd, Evas_Object *sobj)
+_efl_ui_flip_efl_ui_widget_widget_sub_object_del(Eo *obj, Efl_Ui_Flip_Data *sd, Evas_Object *sobj)
{
Eina_Bool int_ret = EINA_FALSE;
@@ -1743,7 +1743,7 @@ _flip_content_set(Evas_Object *obj,
//evas_object_smart_member_add(content, obj);
evas_object_clip_set
(content, front ? sd->front.clip : sd->back.clip);
- if (efl_isa(content, ELM_WIDGET_CLASS) && sd->state != front)
+ if (efl_isa(content, EFL_UI_WIDGET_CLASS) && sd->state != front)
elm_widget_tree_unfocusable_set(content, EINA_TRUE);
}
@@ -1862,28 +1862,20 @@ _efl_ui_flip_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Flip_Data *sd)
efl_canvas_group_del(efl_super(obj, MY_CLASS));
}
-EAPI Evas_Object *
-elm_flip_add(Evas_Object *parent)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return elm_legacy_add(MY_CLASS, parent);
-}
-
EOLIAN static Eo *
_efl_ui_flip_efl_object_constructor(Eo *obj, Efl_Ui_Flip_Data *sd)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
sd->obj = obj;
- efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_PAGE_TAB_LIST);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_PAGE_TAB_LIST);
return obj;
}
EOLIAN static Eina_Bool
-_efl_ui_flip_front_visible_get(Eo *obj EINA_UNUSED, Efl_Ui_Flip_Data *sd)
+_efl_ui_flip_front_visible_get(const Eo *obj EINA_UNUSED, Efl_Ui_Flip_Data *sd)
{
return sd->state;
}
@@ -1965,9 +1957,9 @@ _internal_elm_flip_go_to(Evas_Object *obj,
else elm_object_focus_set(sd->back.content, EINA_TRUE);
}
- if (sd->front.content && efl_isa(sd->front.content, ELM_WIDGET_CLASS))
+ if (sd->front.content && efl_isa(sd->front.content, EFL_UI_WIDGET_CLASS))
elm_widget_tree_unfocusable_set(sd->front.content, !front);
- if (sd->back.content && efl_isa(sd->back.content, ELM_WIDGET_CLASS))
+ if (sd->back.content && efl_isa(sd->back.content, EFL_UI_WIDGET_CLASS))
elm_widget_tree_unfocusable_set(sd->back.content, front);
@@ -2038,7 +2030,7 @@ _efl_ui_flip_interaction_set(Eo *obj, Efl_Ui_Flip_Data *sd, Efl_Ui_Flip_Interact
}
EOLIAN static Efl_Ui_Flip_Interaction
-_efl_ui_flip_interaction_get(Eo *obj EINA_UNUSED, Efl_Ui_Flip_Data *sd)
+_efl_ui_flip_interaction_get(const Eo *obj EINA_UNUSED, Efl_Ui_Flip_Data *sd)
{
return sd->intmode;
}
@@ -2133,7 +2125,7 @@ static void
_update_front_back(Eo *obj, Efl_Ui_Flip_Data *pd)
{
int count, index;
- Efl_Gfx *content;
+ Efl_Gfx_Entity *content;
count = eina_list_count(pd->content_list);
if (count <= 2) return;
@@ -2150,7 +2142,7 @@ _update_front_back(Eo *obj, Efl_Ui_Flip_Data *pd)
}
static void
-_content_added(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx *content)
+_content_added(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx_Entity *content)
{
evas_object_smart_member_add(content, obj);
@@ -2167,9 +2159,9 @@ _content_added(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx *content)
}
static void
-_content_removed(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx *content)
+_content_removed(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx_Entity *content)
{
- Efl_Gfx *back_face, *cur_face, *face;
+ Efl_Gfx_Entity *back_face, *cur_face, *face;
int index, count;
Eina_Bool state;
@@ -2225,7 +2217,7 @@ _efl_ui_flip_efl_container_content_count(Eo *obj EINA_UNUSED, Efl_Ui_Flip_Data *
}
EOLIAN static Eina_Bool
-_efl_ui_flip_efl_container_content_remove(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx *content)
+_efl_ui_flip_efl_container_content_remove(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx_Entity *content)
{
pd->content_list = eina_list_remove(pd->content_list, content);
_content_removed(obj, pd, content);
@@ -2233,7 +2225,7 @@ _efl_ui_flip_efl_container_content_remove(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx
}
EOLIAN static Eina_Bool
-_efl_ui_flip_efl_pack_unpack(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx *subobj)
+_efl_ui_flip_efl_pack_unpack(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx_Entity *subobj)
{
pd->content_list = eina_list_remove(pd->content_list, subobj);
_content_removed(obj, pd, subobj);
@@ -2241,7 +2233,7 @@ _efl_ui_flip_efl_pack_unpack(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx *subobj)
}
EOLIAN static Eina_Bool
-_efl_ui_flip_efl_pack_pack(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx *subobj)
+_efl_ui_flip_efl_pack_pack(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx_Entity *subobj)
{
pd->content_list = eina_list_append(pd->content_list, subobj);
_content_added(obj, pd, subobj);
@@ -2249,7 +2241,7 @@ _efl_ui_flip_efl_pack_pack(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx *subobj)
}
EOLIAN static Eina_Bool
-_efl_ui_flip_efl_pack_linear_pack_begin(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx *subobj)
+_efl_ui_flip_efl_pack_linear_pack_begin(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx_Entity *subobj)
{
pd->content_list = eina_list_prepend(pd->content_list, subobj);
_content_added(obj, pd, subobj);
@@ -2258,7 +2250,7 @@ _efl_ui_flip_efl_pack_linear_pack_begin(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx *
}
EOLIAN static Eina_Bool
-_efl_ui_flip_efl_pack_linear_pack_end(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx *subobj)
+_efl_ui_flip_efl_pack_linear_pack_end(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx_Entity *subobj)
{
pd->content_list = eina_list_append(pd->content_list, subobj);
_content_added(obj, pd, subobj);
@@ -2266,7 +2258,7 @@ _efl_ui_flip_efl_pack_linear_pack_end(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx *su
}
EOLIAN static Eina_Bool
-_efl_ui_flip_efl_pack_linear_pack_before(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx *subobj, const Efl_Gfx *existing)
+_efl_ui_flip_efl_pack_linear_pack_before(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing)
{
pd->content_list = eina_list_prepend_relative(pd->content_list, subobj, existing);
_content_added(obj, pd, subobj);
@@ -2274,7 +2266,7 @@ _efl_ui_flip_efl_pack_linear_pack_before(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx
}
EOLIAN static Eina_Bool
-_efl_ui_flip_efl_pack_linear_pack_after(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx *subobj, const Efl_Gfx *existing)
+_efl_ui_flip_efl_pack_linear_pack_after(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing)
{
pd->content_list = eina_list_append_relative(pd->content_list, subobj, existing);
_content_added(obj, pd, subobj);
@@ -2282,25 +2274,25 @@ _efl_ui_flip_efl_pack_linear_pack_after(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx *
}
EOLIAN static Eina_Bool
-_efl_ui_flip_efl_pack_linear_pack_at(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx *subobj, int index)
+_efl_ui_flip_efl_pack_linear_pack_at(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx_Entity *subobj, int index)
{
- Efl_Gfx *existing = NULL;
+ Efl_Gfx_Entity *existing = NULL;
existing = eina_list_nth(pd->content_list, index);
pd->content_list = eina_list_prepend_relative(pd->content_list, subobj, existing);
_content_added(obj, pd, subobj);
return EINA_TRUE;
}
-EOLIAN static Efl_Gfx *
+EOLIAN static Efl_Gfx_Entity *
_efl_ui_flip_efl_pack_linear_pack_content_get(Eo *obj EINA_UNUSED, Efl_Ui_Flip_Data *pd, int index)
{
return eina_list_nth(pd->content_list, index);
}
-EOLIAN static Efl_Gfx *
+EOLIAN static Efl_Gfx_Entity *
_efl_ui_flip_efl_pack_linear_pack_unpack_at(Eo *obj, Efl_Ui_Flip_Data *pd, int index)
{
- Efl_Gfx *content = eina_list_nth(pd->content_list ,index);
+ Efl_Gfx_Entity *content = eina_list_nth(pd->content_list ,index);
pd->content_list = eina_list_remove(pd->content_list, content);
_content_removed(obj, pd, content);
@@ -2308,17 +2300,11 @@ _efl_ui_flip_efl_pack_linear_pack_unpack_at(Eo *obj, Efl_Ui_Flip_Data *pd, int i
}
EOLIAN static int
-_efl_ui_flip_efl_pack_linear_pack_index_get(Eo *obj EINA_UNUSED, Efl_Ui_Flip_Data *pd, const Efl_Gfx *subobj)
+_efl_ui_flip_efl_pack_linear_pack_index_get(Eo *obj EINA_UNUSED, Efl_Ui_Flip_Data *pd, const Efl_Gfx_Entity *subobj)
{
return eina_list_data_idx(pd->content_list, (void *)subobj);
}
-static void
-_efl_ui_flip_class_constructor(Efl_Class *klass)
-{
- evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
-}
-
EAPI void
elm_flip_interaction_direction_hitsize_set(Efl_Ui_Flip *obj, Elm_Flip_Direction dir, double hitsize)
{
@@ -2371,3 +2357,30 @@ ELM_PART_CONTENT_DEFAULT_GET(efl_ui_flip, "front")
EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_flip)
#include "efl_ui_flip.eo.c"
+
+#include "efl_ui_flip_legacy.eo.h"
+
+#define MY_CLASS_NAME_LEGACY "elm_flip"
+
+static void
+_efl_ui_flip_legacy_class_constructor(Efl_Class *klass)
+{
+ evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
+}
+
+EOLIAN static Eo *
+_efl_ui_flip_legacy_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED)
+{
+ obj = efl_constructor(efl_super(obj, EFL_UI_FLIP_LEGACY_CLASS));
+ efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
+ return obj;
+}
+
+EAPI Evas_Object *
+elm_flip_add(Evas_Object *parent)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ return elm_legacy_add(EFL_UI_FLIP_LEGACY_CLASS, parent);
+}
+
+#include "efl_ui_flip_legacy.eo.c"
diff --git a/src/lib/elementary/efl_ui_flip.eo b/src/lib/elementary/efl_ui_flip.eo
index 7bfd1cfa7d..6b3345f4d5 100644
--- a/src/lib/elementary/efl_ui_flip.eo
+++ b/src/lib/elementary/efl_ui_flip.eo
@@ -1,4 +1,6 @@
-enum Efl.Ui.Flip.Mode
+import efl_ui_direction;
+
+enum Efl.Ui.Flip_Mode
{
[[Efl UI flip mode ]]
legacy: efl_ui_flip;
@@ -17,7 +19,7 @@ enum Efl.Ui.Flip.Mode
cross_fade, [[Cross fade flip mode]]
}
-enum Efl.Ui.Flip.Interaction
+enum Efl.Ui.Flip_Interaction
{
[[Efl UI flip interaction]]
none, [[No interaction]]
@@ -26,7 +28,7 @@ enum Efl.Ui.Flip.Interaction
page [[Page interaction]]
}
-class Efl.Ui.Flip (Elm.Widget, Efl.Pack.Linear, Efl.Part)
+class Efl.Ui.Flip (Efl.Ui.Widget, Efl.Pack_Linear, Efl.Part)
{
[[Efl UI flip class]]
legacy_prefix: elm_flip;
@@ -56,7 +58,7 @@ class Efl.Ui.Flip (Elm.Widget, Efl.Pack.Linear, Efl.Part)
[[Get the interactive flip mode.]]
}
values {
- mode: Efl.Ui.Flip.Interaction; [[The interactive flip mode to use.]]
+ mode: Efl.Ui.Flip_Interaction; [[The interactive flip mode to use.]]
}
}
@property front_visible {
@@ -172,7 +174,7 @@ class Efl.Ui.Flip (Elm.Widget, Efl.Pack.Linear, Efl.Part)
* @image latex elm_flip.eps width=\textwidth
*/
params {
- @in mode: Efl.Ui.Flip.Mode; [[The mode type.]]
+ @in mode: Efl.Ui.Flip_Mode; [[The mode type.]]
}
}
go_to {
@@ -222,33 +224,32 @@ class Efl.Ui.Flip (Elm.Widget, Efl.Pack.Linear, Efl.Part)
params {
@in front: bool; [[If $true, makes front visible, otherwise
makes back.]]
- @in mode: Efl.Ui.Flip.Mode; [[The mode type.]]
+ @in mode: Efl.Ui.Flip_Mode; [[The mode type.]]
}
}
}
implements {
- class.constructor;
Efl.Object.constructor;
- Elm.Widget.widget_sub_object_add;
- Elm.Widget.theme_apply;
- Elm.Widget.widget_sub_object_del;
+ Efl.Ui.Widget.widget_sub_object_add;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.widget_sub_object_del;
Efl.Container.content_iterate;
Efl.Container.content_count;
Efl.Container.content_remove;
- Efl.Part.part;
+ Efl.Part.part_get;
Efl.Pack.unpack;
Efl.Pack.pack;
- Efl.Pack.Linear.pack_begin;
- Efl.Pack.Linear.pack_end;
- Efl.Pack.Linear.pack_before;
- Efl.Pack.Linear.pack_after;
- Efl.Pack.Linear.pack_at;
- Efl.Pack.Linear.pack_content_get;
- Efl.Pack.Linear.pack_unpack_at;
- Efl.Pack.Linear.pack_index_get;
+ Efl.Pack_Linear.pack_begin;
+ Efl.Pack_Linear.pack_end;
+ Efl.Pack_Linear.pack_before;
+ Efl.Pack_Linear.pack_after;
+ Efl.Pack_Linear.pack_at;
+ Efl.Pack_Linear.pack_content_get;
+ Efl.Pack_Linear.pack_unpack_at;
+ Efl.Pack_Linear.pack_index_get;
}
events {
- animate,begin; [[Called when flip animation begins]]
- animate,done; [[Called when flip animation is done]]
+ animate,begin: void; [[Called when flip animation begins]]
+ animate,done: void; [[Called when flip animation is done]]
}
}
diff --git a/src/lib/elementary/efl_ui_flip_legacy.eo b/src/lib/elementary/efl_ui_flip_legacy.eo
new file mode 100644
index 0000000000..697c2d1399
--- /dev/null
+++ b/src/lib/elementary/efl_ui_flip_legacy.eo
@@ -0,0 +1,9 @@
+class Efl.Ui.Flip_Legacy (Efl.Ui.Flip, Efl.Ui.Legacy)
+{
+ [[Efl UI flip class]]
+ data: null;
+ implements {
+ class.constructor;
+ Efl.Object.constructor;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_flip_legacy.h b/src/lib/elementary/efl_ui_flip_legacy.h
index 5bbbaabc62..8470bb187d 100644
--- a/src/lib/elementary/efl_ui_flip_legacy.h
+++ b/src/lib/elementary/efl_ui_flip_legacy.h
@@ -1,5 +1,7 @@
#include "efl_ui_flip.eo.legacy.h"
+typedef Eo Elm_Flip;
+
typedef Efl_Ui_Flip_Interaction Elm_Flip_Interaction;
#define ELM_FLIP_INTERACTION_NONE EFL_UI_FLIP_INTERACTION_NONE
diff --git a/src/lib/elementary/efl_ui_flip_part.eo b/src/lib/elementary/efl_ui_flip_part.eo
index cb4fb06f45..0d3d72196b 100644
--- a/src/lib/elementary/efl_ui_flip_part.eo
+++ b/src/lib/elementary/efl_ui_flip_part.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Flip.Part (Efl.Ui.Widget.Part, Efl.Content)
+class Efl.Ui.Flip_Part (Efl.Ui.Widget_Part, Efl.Content)
{
[[Efl UI flip internal class]]
data: null;
diff --git a/src/lib/elementary/efl_ui_focus_composition.c b/src/lib/elementary/efl_ui_focus_composition.c
index 2b2b381fd7..a964146862 100644
--- a/src/lib/elementary/efl_ui_focus_composition.c
+++ b/src/lib/elementary/efl_ui_focus_composition.c
@@ -25,21 +25,15 @@ _state_apply(Eo *obj, Efl_Ui_Focus_Composition_Data *pd)
{
Efl_Ui_Focus_Manager *manager;
+ //Legacy code compatibility, only update the custom chain of elements if legacy was NOT messing with it.
+ if (elm_object_focus_custom_chain_get(obj)) return;
+
if (pd->custom_manager)
manager = pd->custom_manager;
else
manager = pd->registered;
- if (!pd->registered && pd->registered_targets)
- {
- Efl_Ui_Focus_Object *o;
- //remove all of them
- EINA_LIST_FREE(pd->registered_targets, o)
- {
- efl_ui_focus_manager_calc_unregister(manager, o);
- }
- }
- else if (pd->registered)
+ if (manager)
{
Eina_List *n;
Eina_List *safed = NULL;
@@ -52,6 +46,12 @@ _state_apply(Eo *obj, Efl_Ui_Focus_Composition_Data *pd)
safed = eina_list_append(safed, o);
else
efl_ui_focus_manager_calc_unregister(manager, o);
+
+ if (efl_isa(o, EFL_UI_FOCUS_COMPOSITION_ADAPTER_CLASS))
+ {
+ efl_ui_focus_composition_adapter_focus_manager_parent_set(o, NULL);
+ efl_ui_focus_composition_adapter_focus_manager_object_set(o, NULL);
+ }
}
pd->registered_targets = safed;
@@ -63,12 +63,25 @@ _state_apply(Eo *obj, Efl_Ui_Focus_Composition_Data *pd)
efl_ui_focus_manager_calc_register(manager, o, obj, NULL);
else
efl_ui_focus_manager_calc_register_logical(manager, o, obj, NULL);
+
+ if (efl_isa(o, EFL_UI_FOCUS_COMPOSITION_ADAPTER_CLASS))
+ {
+ efl_ui_focus_composition_adapter_focus_manager_parent_set(o, obj);
+ efl_ui_focus_composition_adapter_focus_manager_object_set(o, manager);
+ }
+
pd->registered_targets = eina_list_append(pd->registered_targets, o);
}
efl_ui_focus_manager_calc_update_order(manager, obj, eina_list_clone(pd->targets_ordered));
}
}
+static void
+_del(void *data, const Efl_Event *ev)
+{
+ Efl_Ui_Focus_Composition_Data *pd = efl_data_scope_get(data, EFL_UI_FOCUS_COMPOSITION_MIXIN);
+ pd->register_target = eina_list_remove(pd->register_target, ev->object);
+}
EOLIAN static void
_efl_ui_focus_composition_composition_elements_set(Eo *obj, Efl_Ui_Focus_Composition_Data *pd, Eina_List *logical_order)
@@ -78,7 +91,10 @@ _efl_ui_focus_composition_composition_elements_set(Eo *obj, Efl_Ui_Focus_Composi
Eina_List *n;
pd->targets_ordered = eina_list_free(pd->targets_ordered);
- pd->register_target = eina_list_free(pd->register_target);
+ EINA_LIST_FREE(pd->register_target, elem)
+ {
+ efl_event_callback_del(elem, EFL_EVENT_DEL, _del, obj);
+ }
pd->order = eina_list_free(pd->order);
pd->order = logical_order;
@@ -86,7 +102,7 @@ _efl_ui_focus_composition_composition_elements_set(Eo *obj, Efl_Ui_Focus_Composi
//get rid of all adapter objects
EINA_LIST_FREE(pd->adapters, adapter)
{
- efl_del(adapter);
+ efl_unref(adapter);
}
//now build a composition_elements list
@@ -96,22 +112,16 @@ _efl_ui_focus_composition_composition_elements_set(Eo *obj, Efl_Ui_Focus_Composi
EINA_SAFETY_ON_NULL_GOTO(elem, cont);
- if (!efl_isa(elem, ELM_WIDGET_CLASS))
+ if (!efl_isa(elem, EFL_UI_WIDGET_CLASS))
{
if (efl_isa(elem, EFL_UI_FOCUS_OBJECT_MIXIN))
{
pd->register_target = eina_list_append(pd->register_target , o);
- }
- else if (efl_isa(elem, EFL_GFX_INTERFACE))
- {
- o = efl_add(EFL_UI_FOCUS_COMPOSITION_ADAPTER_CLASS, NULL, efl_ui_focus_composition_adapter_canvas_object_set(efl_added, elem));
-
- pd->adapters = eina_list_append(pd->adapters, o);
- pd->register_target = eina_list_append(pd->register_target , o);
+ efl_event_callback_add(o, EFL_EVENT_DEL, _del, obj);
}
else
{
- EINA_SAFETY_ERROR("List contains element that is not EFL_UI_FOCUS_OBJECT_MIXIN or EFL_GFX_INTERFACE or ELM_WIDGET_CLASS");
+ EINA_SAFETY_ERROR("List contains element that is not EFL_UI_FOCUS_OBJECT_MIXIN or EFL_GFX_ENTITY_INTERFACE or EFL_UI_WIDGET_CLASS");
continue;
}
}
@@ -124,13 +134,13 @@ cont:
}
EOLIAN static Eina_List*
-_efl_ui_focus_composition_composition_elements_get(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Composition_Data *pd)
+_efl_ui_focus_composition_composition_elements_get(const Eo *obj EINA_UNUSED, Efl_Ui_Focus_Composition_Data *pd)
{
return eina_list_clone(pd->order);
}
EOLIAN static Eina_Bool
-_efl_ui_focus_composition_elm_widget_focus_state_apply(Eo *obj, Efl_Ui_Focus_Composition_Data *pd, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Elm_Widget *redirect)
+_efl_ui_focus_composition_efl_ui_widget_focus_state_apply(Eo *obj, Efl_Ui_Focus_Composition_Data *pd, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Efl_Ui_Widget *redirect)
{
Eina_Bool registered;
@@ -164,21 +174,15 @@ _efl_ui_focus_composition_dirty(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Composition_Da
}
EOLIAN static void
-_efl_ui_focus_composition_elements_flush(Eo *obj, Efl_Ui_Focus_Composition_Data *pd)
+_efl_ui_focus_composition_efl_ui_focus_object_prepare_logical_none_recursive(Eo *obj, Efl_Ui_Focus_Composition_Data *pd EINA_UNUSED)
{
- if (!pd->dirty) return;
-
- efl_ui_focus_composition_prepare(obj);
-
- pd->dirty = EINA_FALSE;
-}
-
-EOLIAN static void
-_efl_ui_focus_composition_efl_ui_focus_object_prepare_logical(Eo *obj, Efl_Ui_Focus_Composition_Data *pd EINA_UNUSED)
-{
- efl_ui_focus_composition_elements_flush(obj);
+ if (pd->dirty)
+ {
+ efl_ui_focus_composition_prepare(obj);
+ pd->dirty = EINA_FALSE;
+ }
- efl_ui_focus_object_prepare_logical(efl_super(obj, MY_CLASS));
+ efl_ui_focus_object_prepare_logical_none_recursive(efl_super(obj, MY_CLASS));
}
EOLIAN static void
@@ -188,7 +192,7 @@ _efl_ui_focus_composition_custom_manager_set(Eo *obj EINA_UNUSED, Efl_Ui_Focus_C
}
EOLIAN static Efl_Ui_Focus_Manager*
-_efl_ui_focus_composition_custom_manager_get(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Composition_Data *pd)
+_efl_ui_focus_composition_custom_manager_get(const Eo *obj EINA_UNUSED, Efl_Ui_Focus_Composition_Data *pd)
{
return pd->custom_manager;
}
@@ -200,7 +204,7 @@ _efl_ui_focus_composition_logical_mode_set(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Com
}
EOLIAN static Eina_Bool
-_efl_ui_focus_composition_logical_mode_get(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Composition_Data *pd)
+_efl_ui_focus_composition_logical_mode_get(const Eo *obj EINA_UNUSED, Efl_Ui_Focus_Composition_Data *pd)
{
return pd->logical;
}
@@ -209,24 +213,54 @@ _efl_ui_focus_composition_logical_mode_get(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Com
typedef struct {
Evas_Object *object;
+ Efl_Ui_Focus_Manager *manager;
+ Efl_Ui_Focus_Object *parent;
} Efl_Ui_Focus_Composition_Adapter_Data;
+static void
+_canvas_object_deleted(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ efl_ui_focus_composition_adapter_canvas_object_set(data, NULL);
+}
+
+static void
+_new_geom(void *data, const Efl_Event *event)
+{
+ efl_event_callback_call(data, event->desc, event->info);
+}
+
+
+EFL_CALLBACKS_ARRAY_DEFINE(canvas_obj,
+ {EFL_GFX_ENTITY_EVENT_RESIZE, _new_geom},
+ {EFL_GFX_ENTITY_EVENT_MOVE, _new_geom},
+ {EFL_EVENT_DEL, _canvas_object_deleted},
+);
+
EOLIAN static void
-_efl_ui_focus_composition_adapter_canvas_object_set(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Composition_Adapter_Data *pd, Efl_Canvas_Object *v)
+_efl_ui_focus_composition_adapter_canvas_object_set(Eo *obj, Efl_Ui_Focus_Composition_Adapter_Data *pd, Efl_Canvas_Object *v)
{
+ if (pd->object)
+ {
+ efl_event_callback_array_del(pd->object, canvas_obj(), obj);
+ }
pd->object = v;
+ if (v)
+ {
+ efl_event_callback_array_add(pd->object, canvas_obj(), obj);
+ }
+
}
EOLIAN static Efl_Canvas_Object*
-_efl_ui_focus_composition_adapter_canvas_object_get(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Composition_Adapter_Data *pd)
+_efl_ui_focus_composition_adapter_canvas_object_get(const Eo *obj EINA_UNUSED, Efl_Ui_Focus_Composition_Adapter_Data *pd)
{
return pd->object;
}
EOLIAN static Eina_Rect
-_efl_ui_focus_composition_adapter_efl_ui_focus_object_focus_geometry_get(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Composition_Adapter_Data *pd EINA_UNUSED)
+_efl_ui_focus_composition_adapter_efl_ui_focus_object_focus_geometry_get(const Eo *obj EINA_UNUSED, Efl_Ui_Focus_Composition_Adapter_Data *pd EINA_UNUSED)
{
- return efl_gfx_geometry_get(pd->object);
+ return efl_gfx_entity_geometry_get(pd->object);
}
EOLIAN static void
@@ -237,4 +271,37 @@ _efl_ui_focus_composition_adapter_efl_ui_focus_object_focus_set(Eo *obj EINA_UNU
evas_object_focus_set(pd->object, efl_ui_focus_object_focus_get(obj));
}
+EOLIAN static void
+_efl_ui_focus_composition_adapter_efl_object_destructor(Eo *obj, Efl_Ui_Focus_Composition_Adapter_Data *pd EINA_UNUSED)
+{
+ efl_ui_focus_composition_adapter_canvas_object_set(obj, NULL);
+
+ efl_destructor(efl_super(obj, EFL_UI_FOCUS_COMPOSITION_ADAPTER_CLASS));
+}
+
+EOLIAN static void
+_efl_ui_focus_composition_adapter_focus_manager_object_set(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Composition_Adapter_Data *pd, Efl_Ui_Focus_Manager *v)
+{
+ pd->manager = v;
+}
+
+EOLIAN static void
+_efl_ui_focus_composition_adapter_focus_manager_parent_set(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Composition_Adapter_Data *pd, Efl_Ui_Focus_Object *parent)
+{
+ pd->parent = parent;
+}
+
+EOLIAN static Efl_Ui_Focus_Object*
+_efl_ui_focus_composition_adapter_efl_ui_focus_object_focus_parent_get(const Eo *obj EINA_UNUSED, Efl_Ui_Focus_Composition_Adapter_Data *pd)
+{
+ return pd->parent;
+}
+
+EOLIAN static Efl_Ui_Focus_Manager*
+_efl_ui_focus_composition_adapter_efl_ui_focus_object_focus_manager_get(const Eo *obj EINA_UNUSED, Efl_Ui_Focus_Composition_Adapter_Data *pd)
+{
+ return pd->manager;
+}
+
+
#include "efl_ui_focus_composition_adapter.eo.c"
diff --git a/src/lib/elementary/efl_ui_focus_composition.eo b/src/lib/elementary/efl_ui_focus_composition.eo
index cdf295231d..0654db8b97 100644
--- a/src/lib/elementary/efl_ui_focus_composition.eo
+++ b/src/lib/elementary/efl_ui_focus_composition.eo
@@ -1,4 +1,4 @@
-mixin Efl.Ui.Focus.Composition (Efl.Interface, Elm.Widget ) {
+mixin Efl.Ui.Focus.Composition (Efl.Interface, Efl.Ui.Widget) {
[[This defines the inheriting widget as Composition widget.
A composition widget is a widget that's the logical parent of another set of widgets which can be used for interaction.
@@ -7,22 +7,18 @@ mixin Efl.Ui.Focus.Composition (Efl.Interface, Elm.Widget ) {
@property composition_elements @protected {
[[Set the order of elements that will be used for composition
- Elements of the list can be either an Elm.Widget, an Efl.Ui.Focus.Object or an Efl.Gfx.
+ Elements of the list can be either an Efl.Ui.Widget, an Efl.Ui.Focus.Object or an Efl.Gfx.
- If the element is an Efl.Gfx, then the geometry is used as focus geometry, the focus property is redirected to the evas focus property. The mixin will take care of registration.
+ If the element is an Efl.Gfx.Entity, then the geometry is used as focus geometry, the focus property is redirected to the evas focus property. The mixin will take care of registration.
If the element is an Efl.Ui.Focus.Object, then the mixin will take care of registering the element.
- If the element is a Elm.Widget nothing is done and the widget is simply part of the order.
+ If the element is a Efl.Ui.Widget nothing is done and the widget is simply part of the order.
]]
values {
- logical_order : list<Efl.Gfx> @owned; [[The order to use]]
+ logical_order : list<Efl.Gfx.Entity> @owned; [[The order to use]]
}
}
- elements_flush {
- [[Function that will emit prepare if this is marked as dirty]]
- }
-
dirty @protected {
[[ Mark this widget as dirty, the children can be considered to be changed after that call
]]
@@ -50,8 +46,8 @@ mixin Efl.Ui.Focus.Composition (Efl.Interface, Elm.Widget ) {
}
}
implements {
- Elm.Widget.focus_state_apply;
- Efl.Ui.Focus.Object.prepare_logical;
+ Efl.Ui.Widget.focus_state_apply;
+ Efl.Ui.Focus.Object.prepare_logical_none_recursive;
@empty .prepare;
}
}
diff --git a/src/lib/elementary/efl_ui_focus_composition_adapter.eo b/src/lib/elementary/efl_ui_focus_composition_adapter.eo
index b6e9fc927b..b9d26fdfe8 100644
--- a/src/lib/elementary/efl_ui_focus_composition_adapter.eo
+++ b/src/lib/elementary/efl_ui_focus_composition_adapter.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Focus.Composition.Adapter (Efl.Object, Efl.Ui.Focus.Object)
+class Efl.Ui.Focus.Composition_Adapter (Efl.Object, Efl.Ui.Focus.Object)
{
[[EFL UI Focus Composition Adapter class]]
methods {
@@ -8,9 +8,24 @@ class Efl.Ui.Focus.Composition.Adapter (Efl.Object, Efl.Ui.Focus.Object)
v : Efl.Canvas.Object; [[EFL canvas object]]
}
}
+ @property focus_manager_object {
+ set {}
+ values {
+ v : Efl.Ui.Focus.Manager;
+ }
+ }
+ @property focus_manager_parent {
+ set {}
+ values {
+ parent : Efl.Ui.Focus.Object;
+ }
+ }
}
implements {
Efl.Ui.Focus.Object.focus_geometry {get;}
+ Efl.Ui.Focus.Object.focus_parent {get;}
+ Efl.Ui.Focus.Object.focus_manager {get;}
Efl.Ui.Focus.Object.focus {set;}
+ Efl.Object.destructor;
}
}
diff --git a/src/lib/elementary/efl_ui_focus_graph.c b/src/lib/elementary/efl_ui_focus_graph.c
new file mode 100644
index 0000000000..efdd3ebff2
--- /dev/null
+++ b/src/lib/elementary/efl_ui_focus_graph.c
@@ -0,0 +1,226 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+#define EFL_UI_FOCUS_OBJECT_PROTECTED
+
+
+#include <Elementary.h>
+#include "elm_priv.h"
+#include "efl_ui_focus_graph.h"
+
+typedef enum {
+ Q_TOP = 1, Q_RIGHT = 2, Q_LEFT = 4, Q_BOTTOM = 8, Q_LAST = 16
+} Quadrant;
+
+Quadrant q_helper[] = {Q_TOP, Q_RIGHT, Q_LEFT, Q_BOTTOM};
+
+static inline Efl_Ui_Focus_Object*
+_convert(Efl_Ui_Focus_Graph_Context *ctx, Opaque_Graph_Member *member)
+{
+ return *((Efl_Ui_Focus_Object**)(((char*) member) + ctx->offset_focusable));
+}
+
+static inline unsigned int
+_distance(Eina_Rect o, Eina_Rect r2, Quadrant q)
+{
+ int res = INT_MAX;
+ if (q == Q_TOP)
+ res = o.y - eina_rectangle_max_y(&r2.rect);
+ else if (q == Q_LEFT)
+ res = o.x - eina_rectangle_max_x(&r2.rect);
+ else if (q == Q_BOTTOM)
+ res = r2.y - eina_rectangle_max_y(&o.rect);
+ else if (q == Q_RIGHT)
+ res = r2.x - eina_rectangle_max_x(&o.rect);
+
+ return res;
+}
+
+static inline Efl_Ui_Focus_Graph_Calc_Direction_Result*
+_result_get(Quadrant q, Efl_Ui_Focus_Graph_Calc_Result *result)
+{
+ if (q == Q_TOP) return &result->top;
+ else if (q == Q_LEFT) return &result->left;
+ else if (q == Q_BOTTOM) return &result->bottom;
+ else if (q == Q_RIGHT) return &result->right;
+ else return NULL;
+}
+
+/*
+
+_quadrant_get return in which quadrant the elem is placed, oriented at origin
+
+All this is based on three levels
+
+lvl1:
+ | |
+ | Top |
+ _____|_____|_____
+ | |
+ left |clean|right
+ _____|_____|_____
+ | |
+ | Bot |
+ | |
+lvl3:
+ \ /
+ \ Top /
+ \ _____ /
+ | |
+ left |clean|right
+ |_____|
+ / \
+ / Bot \
+ / \
+
+lvl3:
+ | |
+ L & T| Top | R & T
+ _____|_____|_____
+ | |
+ left |clean|right
+ _____|_____|_____
+ | |
+ L & B| Bot | R & B
+ | |
+
+
+ */
+
+static inline void
+_quadrant_get(Eina_Rect origin, Eina_Rect elem, Quadrant *lvl2, Quadrant *lvl1, Quadrant *lvl3)
+{
+ int dis = 0;
+
+ *lvl1 = 0;
+ *lvl2 = 0;
+ *lvl3 = 0;
+
+ if (eina_rectangle_max_y(&elem.rect) <= origin.y)
+ {
+ dis = origin.y - elem.y;
+
+ *lvl3 |= Q_TOP;
+
+ if (eina_spans_intersect(origin.x - dis, 2*dis + origin.w, elem.x, elem.w))
+ *lvl2 |= Q_TOP;
+ if (eina_spans_intersect(origin.x, origin.w, elem.x, elem.w))
+ *lvl1 |= Q_TOP;
+ }
+ if (elem.y >= eina_rectangle_max_y(&origin.rect))
+ {
+ dis = eina_rectangle_max_y(&elem.rect) - origin.y;
+
+ *lvl3 |= Q_BOTTOM;
+
+ if (eina_spans_intersect(origin.x - dis, 2*dis + origin.w, elem.x, elem.w))
+ *lvl2 |= Q_BOTTOM;
+ if (eina_spans_intersect(origin.x, origin.w, elem.x, elem.w))
+ *lvl1 |= Q_BOTTOM;
+ }
+ if (elem.x >= eina_rectangle_max_x(&origin.rect))
+ {
+ dis = eina_rectangle_max_x(&elem.rect) - origin.x;
+
+ *lvl3 |= Q_RIGHT;
+
+ if (eina_spans_intersect(origin.y - dis, 2*dis + origin.h, elem.y, elem.h))
+ *lvl2 |= Q_RIGHT;
+ if (eina_spans_intersect(origin.y, origin.h, elem.y, elem.h))
+ *lvl1 |= Q_RIGHT;
+ }
+ if (eina_rectangle_max_x(&elem.rect) <= origin.x)
+ {
+ dis = origin.x - elem.x;
+
+ *lvl3 |= Q_LEFT;
+
+ if (eina_spans_intersect(origin.y - dis, 2*dis + origin.h, elem.y, elem.h))
+ *lvl2 |= Q_LEFT;
+ if (eina_spans_intersect(origin.y, origin.h, elem.y, elem.h))
+ *lvl1 |= Q_LEFT;
+ }
+
+}
+
+void
+efl_ui_focus_graph_calc(Efl_Ui_Focus_Graph_Context *ctx, Eina_Iterator *nodes, Opaque_Graph_Member *origin_obj, Efl_Ui_Focus_Graph_Calc_Result *result)
+{
+ Opaque_Graph_Member *elem_obj;
+ Eina_Rect origin, elem;
+
+ for (int i = 0; i < 4; ++i)
+ {
+ Efl_Ui_Focus_Graph_Calc_Direction_Result *res;
+
+ res = _result_get(q_helper[i], result);
+
+ res->distance = INT_MAX;
+ res->lvl = INT_MAX;
+ res->relation = NULL;
+ }
+
+ origin = efl_ui_focus_object_focus_geometry_get(_convert(ctx, origin_obj));
+
+ //printf("=========> CALCING %p %s\n", _convert(ctx, origin_obj), efl_class_name_get(_convert(ctx, origin_obj)));
+
+ EINA_ITERATOR_FOREACH(nodes, elem_obj)
+ {
+ Efl_Ui_Focus_Graph_Calc_Direction_Result *res;
+ unsigned int distance;
+ Quadrant lvl3, lvl2, lvl1;
+
+ if (elem_obj == origin_obj) continue;
+
+ elem = efl_ui_focus_object_focus_geometry_get(_convert(ctx, elem_obj));
+
+ if (eina_rectangle_intersection(&origin.rect, &elem.rect)) continue;
+
+ _quadrant_get(origin, elem, &lvl2, &lvl1, &lvl3);
+
+ for (int i = 0; i < 4; ++i)
+ {
+ if (q_helper[i] & lvl3)
+ {
+ int lvl;
+ res = _result_get(q_helper[i], result);
+ EINA_SAFETY_ON_NULL_GOTO(res, cont);
+
+ distance = _distance(origin, elem, q_helper[i]);
+
+ if (q_helper[i] & lvl1)
+ lvl = 1;
+ else if (q_helper[i] & lvl2)
+ lvl = 2;
+ else //if (q_helper[i] & lvl3)
+ lvl = 3;
+
+ if (lvl < res->lvl)
+ {
+ res->relation = eina_list_free(res->relation);
+ res->relation = eina_list_append(res->relation, elem_obj);
+ res->distance = distance;
+ res->lvl = lvl;
+ //printf("=========> %p:%d LVL_DROP %d \t %d \t %p %s\n", res, i, distance, lvl, origin_obj, efl_class_name_get(_convert(ctx, elem_obj)));
+ }
+ else if (lvl == res->lvl && res->distance > distance)
+ {
+ res->relation = eina_list_free(res->relation);
+ res->relation = eina_list_append(res->relation, elem_obj);
+ res->distance = distance;
+ //printf("=========> %p:%d DIST_DROP %d \t %d \t %p %s\n", res, i, distance, lvl, origin_obj, efl_class_name_get(_convert(ctx, elem_obj)));
+
+ }
+ else if (lvl == res->lvl && res->distance >= distance)
+ {
+ res->relation = eina_list_append(res->relation, elem_obj);
+ //printf("=========> %p:%d DIST_ADD %d \t %d \t %p %s\n", res, i, distance, lvl, origin_obj, efl_class_name_get(_convert(ctx, elem_obj)));
+ }
+ }
+ }
+
+ continue;
+cont:
+ continue;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_focus_graph.h b/src/lib/elementary/efl_ui_focus_graph.h
new file mode 100644
index 0000000000..ecb4ff543b
--- /dev/null
+++ b/src/lib/elementary/efl_ui_focus_graph.h
@@ -0,0 +1,27 @@
+#ifndef EFL_UI_FOCUS_GRAPH_H
+#define EFL_UI_FOCUS_GRAPH_H
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <Eina.h>
+
+typedef struct _Opaque_Graph_Memeber Opaque_Graph_Member;
+
+
+typedef struct {
+ Eina_List *relation;
+ int lvl;
+ unsigned int distance;
+} Efl_Ui_Focus_Graph_Calc_Direction_Result;
+
+typedef struct {
+ Efl_Ui_Focus_Graph_Calc_Direction_Result right, left, top, bottom;
+} Efl_Ui_Focus_Graph_Calc_Result;
+
+typedef struct {
+ size_t offset_focusable; //offset to the focusable
+} Efl_Ui_Focus_Graph_Context;
+
+void efl_ui_focus_graph_calc(Efl_Ui_Focus_Graph_Context *context, Eina_Iterator *nodes, Opaque_Graph_Member *member, Efl_Ui_Focus_Graph_Calc_Result *result);
+
+#endif
diff --git a/src/lib/elementary/efl_ui_focus_layer.c b/src/lib/elementary/efl_ui_focus_layer.c
index 456c6e9ece..1069956881 100644
--- a/src/lib/elementary/efl_ui_focus_layer.c
+++ b/src/lib/elementary/efl_ui_focus_layer.c
@@ -2,6 +2,7 @@
# include "elementary_config.h"
#endif
+#define EFL_UI_WIDGET_FOCUS_MANAGER_PROTECTED
#define EFL_UI_FOCUS_LAYER_PROTECTED
#include <Elementary.h>
@@ -10,6 +11,7 @@
#define MY_CLASS EFL_UI_FOCUS_LAYER_MIXIN
typedef struct {
+ Efl_Ui_Focus_Object *old_focus;
Efl_Ui_Focus_Manager *registered_manager;
Efl_Ui_Focus_Manager *manager;
Eina_Bool cycle;
@@ -17,15 +19,16 @@ typedef struct {
} Efl_Ui_Focus_Layer_Data;
EOLIAN static Efl_Ui_Focus_Manager*
-_efl_ui_focus_layer_elm_widget_focus_manager_create(Eo *obj, Efl_Ui_Focus_Layer_Data *pd EINA_UNUSED, Efl_Ui_Focus_Object *root)
+_efl_ui_focus_layer_efl_ui_widget_focus_manager_focus_manager_create(Eo *obj, Efl_Ui_Focus_Layer_Data *pd EINA_UNUSED, Efl_Ui_Focus_Object *root)
{
- return efl_add(EFL_UI_FOCUS_MANAGER_ROOT_FOCUS_CLASS, obj, efl_ui_focus_manager_root_set(efl_added, root));
+ pd->manager = efl_add(EFL_UI_FOCUS_MANAGER_ROOT_FOCUS_CLASS, obj, efl_ui_focus_manager_root_set(efl_added, root));
+ return pd->manager;
}
EOLIAN static void
-_efl_ui_focus_layer_efl_gfx_visible_set(Eo *obj, Efl_Ui_Focus_Layer_Data *pd, Eina_Bool v)
+_efl_ui_focus_layer_efl_gfx_entity_visible_set(Eo *obj, Efl_Ui_Focus_Layer_Data *pd, Eina_Bool v)
{
- efl_gfx_visible_set(efl_super(obj, MY_CLASS), v);
+ efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), v);
if (pd->enable_on_visible)
{
@@ -59,13 +62,25 @@ _efl_ui_focus_layer_efl_object_destructor(Eo *obj, Efl_Ui_Focus_Layer_Data *pd E
}
EOLIAN static Efl_Ui_Focus_Manager*
-_efl_ui_focus_layer_efl_ui_focus_user_focus_manager_get(Eo *obj, Efl_Ui_Focus_Layer_Data *pd EINA_UNUSED)
+_efl_ui_focus_layer_efl_ui_focus_object_focus_manager_get(const Eo *obj EINA_UNUSED, Efl_Ui_Focus_Layer_Data *pd EINA_UNUSED)
{
- return elm_widget_top_get(obj);
+ if (pd->registered_manager)
+ return pd->registered_manager;
+ else
+ return NULL;
+}
+
+EOLIAN static Efl_Ui_Focus_Object*
+_efl_ui_focus_layer_efl_ui_focus_object_focus_parent_get(const Eo *obj EINA_UNUSED, Efl_Ui_Focus_Layer_Data *pd)
+{
+ if (pd->registered_manager)
+ return efl_ui_focus_manager_root_get(pd->registered_manager);
+ else
+ return NULL;
}
EOLIAN static Eina_Bool
-_efl_ui_focus_layer_elm_widget_focus_state_apply(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Layer_Data *pd EINA_UNUSED, Efl_Ui_Widget_Focus_State current_state EINA_UNUSED, Efl_Ui_Widget_Focus_State *configured_state EINA_UNUSED, Elm_Widget *redirect EINA_UNUSED)
+_efl_ui_focus_layer_efl_ui_widget_focus_state_apply(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Layer_Data *pd EINA_UNUSED, Efl_Ui_Widget_Focus_State current_state EINA_UNUSED, Efl_Ui_Widget_Focus_State *configured_state EINA_UNUSED, Efl_Ui_Widget *redirect EINA_UNUSED)
{
return EINA_FALSE;
}
@@ -74,35 +89,74 @@ EOLIAN static Efl_Object*
_efl_ui_focus_layer_efl_object_constructor(Eo *obj, Efl_Ui_Focus_Layer_Data *pd)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
- pd->manager = efl_ui_widget_focus_manager_create(obj, obj);
- efl_composite_attach(obj, pd->manager);
pd->enable_on_visible = EINA_TRUE;
pd->cycle = EINA_TRUE;
return obj;
}
+static void
+_publish_state_change(Eo *obj, Efl_Ui_Focus_Manager *omanager, Efl_Ui_Focus_Object *oobj)
+{
+ efl_event_callback_call(obj, EFL_UI_FOCUS_OBJECT_EVENT_MANAGER_CHANGED, omanager);
+ efl_event_callback_call(obj, EFL_UI_FOCUS_OBJECT_EVENT_LOGICAL_CHANGED, oobj);
+}
+
EOLIAN static void
_efl_ui_focus_layer_enable_set(Eo *obj, Efl_Ui_Focus_Layer_Data *pd, Eina_Bool v)
{
+ if (!elm_object_tree_focus_allow_get(obj))
+ v = EINA_FALSE;
if (v)
{
+ Efl_Ui_Focus_Manager *manager;
+
pd->registered_manager = elm_widget_top_get(obj);
+ EINA_SAFETY_ON_FALSE_RETURN(efl_isa(pd->registered_manager, EFL_UI_WIN_CLASS));
+ manager = efl_ui_focus_util_active_manager(EFL_UI_FOCUS_UTIL_CLASS, pd->registered_manager);
efl_ui_focus_manager_calc_register_logical(pd->registered_manager, obj, efl_ui_focus_manager_root_get(pd->registered_manager), obj);
+ _publish_state_change(obj, NULL, NULL);
+
+ pd->old_focus = efl_ui_focus_manager_focus_get(manager);
efl_ui_focus_manager_focus_set(pd->manager, obj);
+
}
else
{
- if (efl_ui_focus_manager_redirect_get(pd->registered_manager) == obj)
+ Eina_Bool fallback = EINA_TRUE;
+
+ Eo *oobj;
+
+ if (!pd->registered_manager) return;
+
+ oobj = efl_ui_focus_manager_root_get(pd->registered_manager);
+
+ //restore old focus
+ if (pd->old_focus)
+ {
+ Efl_Ui_Focus_Manager *manager;
+
+ manager = efl_ui_focus_object_focus_manager_get(pd->old_focus);
+ if (manager)
+ {
+ efl_ui_focus_manager_focus_set(manager, pd->old_focus);
+ fallback = EINA_FALSE;
+ }
+ }
+
+ pd->old_focus = NULL;
+
+ if (fallback && efl_ui_focus_manager_redirect_get(pd->registered_manager) == obj)
efl_ui_focus_manager_redirect_set(pd->registered_manager, NULL);
efl_ui_focus_manager_calc_unregister(pd->registered_manager, obj);
pd->registered_manager = NULL;
+ _publish_state_change(obj, pd->registered_manager, oobj);
}
}
EOLIAN static Eina_Bool
-_efl_ui_focus_layer_enable_get(Eo *obj, Efl_Ui_Focus_Layer_Data *pd)
+_efl_ui_focus_layer_enable_get(const Eo *obj, Efl_Ui_Focus_Layer_Data *pd)
{
if (!pd->registered_manager) return EINA_FALSE;
return (efl_ui_focus_manager_redirect_get(pd->registered_manager) == obj);
@@ -116,7 +170,7 @@ _efl_ui_focus_layer_behaviour_set(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Layer_Data *
}
EOLIAN static void
-_efl_ui_focus_layer_behaviour_get(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Layer_Data *pd, Eina_Bool *enable_on_visible, Eina_Bool *cycle)
+_efl_ui_focus_layer_behaviour_get(const Eo *obj EINA_UNUSED, Efl_Ui_Focus_Layer_Data *pd, Eina_Bool *enable_on_visible, Eina_Bool *cycle)
{
*cycle = pd->cycle;
*enable_on_visible = pd->enable_on_visible;
diff --git a/src/lib/elementary/efl_ui_focus_layer.eo b/src/lib/elementary/efl_ui_focus_layer.eo
index 426ca89ee8..8650981425 100644
--- a/src/lib/elementary/efl_ui_focus_layer.eo
+++ b/src/lib/elementary/efl_ui_focus_layer.eo
@@ -1,4 +1,4 @@
-mixin Efl.Ui.Focus.Layer (Efl.Interface, Elm.Widget, Efl.Gfx, Efl.Ui.Focus.Manager) {
+mixin Efl.Ui.Focus.Layer (Efl.Interface, Efl.Ui.Widget, Efl.Gfx.Entity, Efl.Ui.Widget_Focus_Manager) {
[[This defines the inheriting widget as focus layer
A focus layer is the uppermost one which received input and handles all focus related events for as long as it exists and is visible. It's NOT possible to escape this layer with focus movement.
@@ -21,11 +21,12 @@ mixin Efl.Ui.Focus.Layer (Efl.Interface, Elm.Widget, Efl.Gfx, Efl.Ui.Focus.Manag
}
}
implements {
- Elm.Widget.focus_manager_create;
- Elm.Widget.focus_state_apply;
- Efl.Gfx.visible {set;}
+ Efl.Ui.Widget_Focus_Manager.focus_manager_create;
+ Efl.Ui.Widget.focus_state_apply;
+ Efl.Gfx.Entity.visible {set;}
Efl.Ui.Focus.Manager.move;
- Efl.Ui.Focus.User.focus_manager { get; }
+ Efl.Ui.Focus.Object.focus_manager { get; }
+ Efl.Ui.Focus.Object.focus_parent { get; }
Efl.Object.constructor;
Efl.Object.destructor;
}
diff --git a/src/lib/elementary/efl_ui_focus_manager.c b/src/lib/elementary/efl_ui_focus_manager.c
index 09db7da090..2cb14a6790 100644
--- a/src/lib/elementary/efl_ui_focus_manager.c
+++ b/src/lib/elementary/efl_ui_focus_manager.c
@@ -6,3 +6,4 @@
#include "elm_priv.h"
#include "efl_ui_focus_manager.eo.c"
+#include "efl_ui_focus_manager_window_root.eo.c"
diff --git a/src/lib/elementary/efl_ui_focus_manager.eo b/src/lib/elementary/efl_ui_focus_manager.eo
index 60d7b8b69b..e5e91f3519 100644
--- a/src/lib/elementary/efl_ui_focus_manager.eo
+++ b/src/lib/elementary/efl_ui_focus_manager.eo
@@ -18,7 +18,7 @@ struct Efl.Ui.Focus.Relations {
position_in_history : int; [[The position in the history stack]]
}
-struct Efl.Ui.Focus.Manager.Logical_End_Detail {
+struct Efl.Ui.Focus.Manager_Logical_End_Detail {
[[Structure holding the focus object with extra information on logical end
@since 1.21
@@ -49,11 +49,11 @@ interface Efl.Ui.Focus.Manager {
return : Efl.Ui.Focus.Object; [[The element which is now focused]]
}
request_move {
- [[Returns the object which would be the next object to focus in the
- given direction.
- ]]
+ [[Return the object next in the $direction from $child.]]
params {
direction : Efl.Ui.Focus.Direction; [[Direction to move focus]]
+ child : Efl.Ui.Focus.Object; [[The child where to look from. Pass $null to indicate the last focused child.]]
+ logical : bool; [[Weather you want to have a logical node as result or a logical. Note, at a move call no logical node will get focus, and this is passed as $false there.]]
}
return : Efl.Ui.Focus.Object; [[Next object to focus]]
}
@@ -136,7 +136,7 @@ interface Efl.Ui.Focus.Manager {
The returned object is the last object that would be returned if you start at the root and move the direction into next.
]]
- return : Efl.Ui.Focus.Manager.Logical_End_Detail; [[Last object]]
+ return : Efl.Ui.Focus.Manager_Logical_End_Detail; [[Last object]]
}
reset_history {
[[Reset the history stack of this manager object.
@@ -159,8 +159,8 @@ interface Efl.Ui.Focus.Manager {
events {
redirect,changed : Efl.Ui.Focus.Manager; [[Emitted when the redirect
object has changed, the old manager is passed as event info]]
- flush,pre; [[Emitted once the graph calculationg will be performed]]
- coords,dirty; [[Emitted once the graph is dirty, this means there are
+ flush,pre: void; [[Emitted once the graph calculationg will be performed]]
+ coords,dirty: void; [[Emitted once the graph is dirty, this means there are
potential changes in border_elements you want to know about]]
focused : Efl.Ui.Focus.Object; [[Emitted if the manager has focused an
object, the passed focus object is the last focused object]]
diff --git a/src/lib/elementary/efl_ui_focus_manager_calc.c b/src/lib/elementary/efl_ui_focus_manager_calc.c
index 78475588f6..076874f354 100644
--- a/src/lib/elementary/efl_ui_focus_manager_calc.c
+++ b/src/lib/elementary/efl_ui_focus_manager_calc.c
@@ -7,6 +7,8 @@
#include <Elementary.h>
#include "elm_priv.h"
+#include "efl_ui_focus_graph.h"
+
#define MY_CLASS EFL_UI_FOCUS_MANAGER_CALC_CLASS
#define FOCUS_DATA(obj) Efl_Ui_Focus_Manager_Calc_Data *pd = efl_data_scope_get(obj, MY_CLASS);
@@ -38,7 +40,6 @@ typedef struct _Border Border;
typedef struct _Node Node;
struct _Border {
- Eina_List *partners; //partners that are linked in both directions
Eina_List *one_direction; //partners that are linked in one direction
Eina_List *cleanup_nodes; //a list of nodes that needs to be cleaned up when this node is deleted
};
@@ -64,6 +65,8 @@ struct _Node{
struct _Graph_Node {
Border directions[NODE_DIRECTIONS_COUNT];
} graph;
+
+ Eina_Bool on_list : 1;
};
#define T(n) (n->tree)
@@ -73,71 +76,40 @@ typedef struct {
Eina_List *focus_stack;
Eina_Hash *node_hash;
Efl_Ui_Focus_Manager *redirect;
+ Efl_Ui_Focus_Object *redirect_entry;
Eina_List *dirty;
+ Efl_Ui_Focus_Graph_Context graph_ctx;
Node *root;
} Efl_Ui_Focus_Manager_Calc_Data;
-static void
-_manager_in_chain_set(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd)
-{
- EINA_SAFETY_ON_NULL_RETURN(pd->root);
-
- if (!efl_isa(pd->root->focusable, EFL_UI_WIN_CLASS))
- EINA_SAFETY_ON_NULL_RETURN(efl_ui_focus_user_focus_manager_get(pd->root->focusable));
-
- //so we dont run infinitly this does not fix it, but at least we only have a error
- EINA_SAFETY_ON_TRUE_RETURN(efl_ui_focus_user_focus_manager_get(pd->root->focusable) == obj);
-
- efl_ui_focus_manager_focus_set(efl_ui_focus_user_focus_manager_get(pd->root->focusable), pd->root->focusable);
-}
-
-static Efl_Ui_Focus_Direction
-_complement(Efl_Ui_Focus_Direction dir)
-{
- #define COMP(a,b) \
- if (dir == a) return b; \
- if (dir == b) return a;
-
- COMP(EFL_UI_FOCUS_DIRECTION_RIGHT, EFL_UI_FOCUS_DIRECTION_LEFT)
- COMP(EFL_UI_FOCUS_DIRECTION_UP, EFL_UI_FOCUS_DIRECTION_DOWN)
- COMP(EFL_UI_FOCUS_DIRECTION_PREVIOUS, EFL_UI_FOCUS_DIRECTION_NEXT)
- #undef COMP
-
- return EFL_UI_FOCUS_DIRECTION_LAST;
-}
+static Node* _request_subchild(Node *node);
+static void dirty_add(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd, Node *dirty);
+static Node* _next(Node *node);
+static void _prepare_node(Node *root);
-/*
- * Set this new list of partners to the border.
- * All old partners will be deleted
- */
static void
-border_partners_set(Node *node, Efl_Ui_Focus_Direction direction, Eina_List *list)
+_manager_in_chain_set(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd)
{
- Node *partner;
- Eina_List *lnode;
- Border *border;
+ Eo *manager, *root;
- EINA_SAFETY_ON_FALSE_RETURN(DIRECTION_IS_2D(direction));
-
- border = &DIRECTION_ACCESS(node, direction);
-
- EINA_LIST_FREE(border->partners, partner)
- {
- Border *comp_border = &DIRECTION_ACCESS(partner, _complement(direction));
+ root = efl_ui_focus_manager_root_get(obj);
+ manager = efl_ui_focus_object_focus_manager_get(pd->root->focusable);
- comp_border->partners = eina_list_remove(comp_border->partners, node);
- }
+ EINA_SAFETY_ON_NULL_RETURN(root);
- border->partners = list;
+ if (!efl_isa(root, EFL_UI_FOCUS_MANAGER_WINDOW_ROOT_INTERFACE))
+ EINA_SAFETY_ON_NULL_RETURN(manager);
- EINA_LIST_FOREACH(border->partners, lnode, partner)
- {
- Border *comp_border = &DIRECTION_ACCESS(partner,_complement(direction));
+ //so we dont run infinitly this does not fix it, but at least we only have a error
+ EINA_SAFETY_ON_TRUE_RETURN(manager == obj);
- comp_border->partners = eina_list_append(comp_border->partners, node);
- }
+ if (manager)
+ efl_ui_focus_manager_focus_set(manager, root);
+ else
+ DBG("No focus manager for focusable %s@%p",
+ efl_class_name_get(pd->root->focusable), root);
}
static void
@@ -153,7 +125,7 @@ border_onedirection_set(Node *node, Efl_Ui_Focus_Direction direction, Eina_List
EINA_LIST_FREE(border->one_direction, partner)
{
- Border *b = &DIRECTION_ACCESS(partner, _complement(direction));
+ Border *b = &DIRECTION_ACCESS(partner, efl_ui_focus_util_direction_complement(EFL_UI_FOCUS_UTIL_CLASS,direction));
b->cleanup_nodes = eina_list_remove(b->cleanup_nodes, node);
}
@@ -161,7 +133,7 @@ border_onedirection_set(Node *node, Efl_Ui_Focus_Direction direction, Eina_List
EINA_LIST_FOREACH(border->one_direction, lnode, partner)
{
- Border *comp_border = &DIRECTION_ACCESS(partner,_complement(direction));
+ Border *comp_border = &DIRECTION_ACCESS(partner,efl_ui_focus_util_direction_complement(EFL_UI_FOCUS_UTIL_CLASS,direction));
comp_border->cleanup_nodes = eina_list_append(comp_border->cleanup_nodes, node);
}
@@ -179,7 +151,7 @@ border_onedirection_cleanup(Node *node, Efl_Ui_Focus_Direction direction)
EINA_LIST_FREE(border->cleanup_nodes, partner)
{
- Border *b = &DIRECTION_ACCESS(partner, _complement(direction));
+ Border *b = &DIRECTION_ACCESS(partner, efl_ui_focus_util_direction_complement(EFL_UI_FOCUS_UTIL_CLASS,direction));
b->one_direction = eina_list_remove(b->one_direction, node);
}
}
@@ -226,14 +198,44 @@ node_item_free(Node *item)
{
Node *n;
Eina_List *l;
- //free the graph items
- for(int i = EFL_UI_FOCUS_DIRECTION_UP;i < EFL_UI_FOCUS_DIRECTION_LAST; i++)
+ Eo *obj = item->manager;
+ FOCUS_DATA(obj);
+
+ /*cleanup graph parts*/
+
+ //add all neighbors of the node to the dirty list
+ for(int i = EFL_UI_FOCUS_DIRECTION_UP; i < EFL_UI_FOCUS_DIRECTION_LAST; i++)
{
- border_partners_set(item, i, NULL);
+ Node *partner;
+
+#define MAKE_LIST_DIRTY(node, field) \
+ EINA_LIST_FOREACH(DIRECTION_ACCESS(node, i).field, l, partner) \
+ { \
+ dirty_add(obj, pd, partner); \
+ }
+
+ MAKE_LIST_DIRTY(item, one_direction)
+ MAKE_LIST_DIRTY(item, cleanup_nodes)
+
border_onedirection_cleanup(item, i);
border_onedirection_set(item, i, NULL);
}
+ /*cleanup manager householdings*/
+
+ //remove from the focus stack
+ pd->focus_stack = eina_list_remove(pd->focus_stack, item);
+
+ //if this is the entry for redirect, NULL them out!
+ if (pd->redirect_entry == item->focusable)
+ pd->redirect_entry = NULL;
+
+ //remove from the dirty parts
+ pd->dirty = eina_list_remove(pd->dirty, item);
+ item->on_list = EINA_FALSE;
+
+ /*merge tree items*/
+
//free the tree items
if (!item->tree.parent && item->tree.children)
{
@@ -287,248 +289,6 @@ _focus_stack_unfocus_last(Efl_Ui_Focus_Manager_Calc_Data *pd)
return focusable;
}
-static Node*
-_focus_stack_last_regular(Efl_Ui_Focus_Manager_Calc_Data *pd)
-{
- Eina_List *l;
- Node *upper;
-
- l = eina_list_last(pd->focus_stack);
- upper = eina_list_last_data_get(pd->focus_stack);
-
- while (upper && upper->type != NODE_TYPE_NORMAL)
- {
- l = eina_list_prev(l);
- upper = eina_list_data_get(l);
- }
-
- return upper;
-}
-
-//CALCULATING STUFF
-
-static inline int
-_distance(Eina_Rect node, Eina_Rect op, Dimension dim)
-{
- int min, max, point;
- int v1, v2;
-
- if (dim == DIMENSION_X)
- {
- min = op.x;
- max = eina_rectangle_max_x(&op.rect);
- point = node.x + node.w/2;
- }
- else
- {
- min = op.y;
- max = eina_rectangle_max_y(&op.rect);
- point = node.y + node.h/2;
- }
-
- v1 = min - point;
- v2 = max - point;
-
- if (abs(v1) < abs(v2))
- return v1;
- else
- return v2;
-}
-
-static inline void
-_min_max_gen(Dimension dim, Eina_Rect rect, int *min, int *max)
-{
- if (dim == DIMENSION_X)
- {
- *min = rect.y;
- *max = eina_rectangle_max_y(&rect.rect);
- }
- else
- {
- *min = rect.x;
- *max = eina_rectangle_max_x(&rect.rect);
- }
-}
-
-static inline void
-_calculate_node(Efl_Ui_Focus_Manager_Calc_Data *pd, Efl_Ui_Focus_Object *node, Dimension dim, Eina_List **pos, Eina_List **neg)
-{
- int dim_min, dim_max, cur_pos_min = 0, cur_neg_min = 0;
- Efl_Ui_Focus_Object *op;
- Eina_Iterator *nodes;
- Eina_Rect rect;
- Node *n;
-
- *pos = NULL;
- *neg = NULL;
-
- rect = efl_ui_focus_object_focus_geometry_get(node);
- nodes = eina_hash_iterator_data_new(pd->node_hash);
- _min_max_gen(dim, rect, &dim_min, &dim_max);
-
- EINA_ITERATOR_FOREACH(nodes, n)
- {
- Eina_Rect op_rect;
- int min, max;
-
- op = n->focusable;
- if (op == node) continue;
-
- if (n->type == NODE_TYPE_ONLY_LOGICAL) continue;
-
- op_rect = efl_ui_focus_object_focus_geometry_get(op);
-
- _min_max_gen(dim, op_rect, &min, &max);
-
- /* The only way the calculation does make sense is if the two number
- * lines are not disconnected.
- * If they are connected one point of the 4 lies between the min and max of the other line
- */
- if (!((min <= max && max <= dim_min && dim_min <= dim_max) ||
- (dim_min <= dim_max && dim_max <= min && min <= max)) &&
- !eina_rectangle_intersection(&op_rect.rect, &rect.rect))
- {
- //this thing hits horizontal
- int tmp_dis;
-
- tmp_dis = _distance(rect, op_rect, dim);
-
- if (tmp_dis < 0)
- {
- if (tmp_dis == cur_neg_min)
- {
- //add it
- *neg = eina_list_append(*neg, op);
- }
- else if (tmp_dis > cur_neg_min
- || cur_neg_min == 0) //init case
- {
- //nuke the old and add
-#ifdef CALC_DEBUG
- printf("CORRECTION FOR %s-%s\n found anchor %s-%s in distance %d\n (%d,%d,%d,%d)\n (%d,%d,%d,%d)\n\n", DEBUG_TUPLE(node), DEBUG_TUPLE(op),
- tmp_dis,
- op_rect.x, op_rect.y, op_rect.w, op_rect.h,
- rect.x, rect.y, rect.w, rect.h);
-#endif
- *neg = eina_list_free(*neg);
- *neg = eina_list_append(NULL, op);
- cur_neg_min = tmp_dis;
- }
- }
- else
- {
- if (tmp_dis == cur_pos_min)
- {
- //add it
- *pos = eina_list_append(*pos, op);
- }
- else if (tmp_dis < cur_pos_min
- || cur_pos_min == 0) //init case
- {
- //nuke the old and add
-#ifdef CALC_DEBUG
- printf("CORRECTION FOR %s-%s\n found anchor %s-%s in distance %d\n (%d,%d,%d,%d)\n (%d,%d,%d,%d)\n\n", DEBUG_TUPLE(node), DEBUG_TUPLE(op),
- tmp_dis,
- op_rect.x, op_rect.y, op_rect.w, op_rect.h,
- rect.x, rect.y, rect.w, rect.h);
-#endif
- *pos = eina_list_free(*pos);
- *pos = eina_list_append(NULL, op);
- cur_pos_min = tmp_dis;
- }
- }
-
-
-#if 0
- printf("(%d,%d,%d,%d)%s vs(%d,%d,%d,%d)%s\n", rect.x, rect.y, rect.w, rect.h, elm_widget_part_text_get(node, NULL), op_rect.x, op_rect.y, op_rect.w, op_rect.h, elm_widget_part_text_get(op, NULL));
- printf("(%d,%d,%d,%d)\n", min, max, dim_min, dim_max);
- printf("Candidate %d\n", tmp_dis);
- if (anchor->anchor == NULL || abs(tmp_dis) < abs(distance)) //init case
- {
- distance = tmp_dis;
- anchor->positive = tmp_dis > 0 ? EINA_FALSE : EINA_TRUE;
- anchor->anchor = op;
- //Helper for debugging wrong calculations
-
- }
-#endif
- }
-
-
- }
- eina_iterator_free(nodes);
- nodes = NULL;
-
-}
-
-static inline Eina_Position2D
-_relative_position_rects(Eina_Rect *a, Eina_Rect *b)
-{
- Eina_Position2D a_pos = {a->rect.x + a->rect.w/2, a->rect.y + a->rect.h/2};
- Eina_Position2D b_pos = {b->rect.x + b->rect.w/2, b->rect.y + b->rect.h/2};
-
- return (Eina_Position2D){b_pos.x - a_pos.x, b_pos.y - b_pos.y};
-}
-
-static inline Eina_Rectangle_Outside
-_direction_to_outside(Efl_Ui_Focus_Direction direction)
-{
- if (direction == EFL_UI_FOCUS_DIRECTION_RIGHT) return EINA_RECTANGLE_OUTSIDE_RIGHT;
- if (direction == EFL_UI_FOCUS_DIRECTION_LEFT) return EINA_RECTANGLE_OUTSIDE_LEFT;
- if (direction == EFL_UI_FOCUS_DIRECTION_DOWN) return EINA_RECTANGLE_OUTSIDE_BOTTOM;
- if (direction == EFL_UI_FOCUS_DIRECTION_UP) return EINA_RECTANGLE_OUTSIDE_TOP;
-
- return -1;
-}
-
-static inline void
-_calculate_node_indirection(Efl_Ui_Focus_Manager_Calc_Data *pd, Efl_Ui_Focus_Object *node, Efl_Ui_Focus_Direction direction, Eina_List **lst)
-{
- Efl_Ui_Focus_Object *op;
- Eina_Iterator *nodes;
- int min_distance = 0;
- Node *n;
- Eina_Rect rect;
-
- rect = efl_ui_focus_object_focus_geometry_get(node);
- nodes = eina_hash_iterator_data_new(pd->node_hash);
-
- EINA_ITERATOR_FOREACH(nodes, n)
- {
- Eina_Rectangle_Outside outside, outside_dir;
- Eina_Position2D pos;
- int distance;
- Eina_Rect op_rect;
-
- op = n->focusable;
-
- if (op == node) continue;
- if (n->type == NODE_TYPE_ONLY_LOGICAL) continue;
-
- op_rect = efl_ui_focus_object_focus_geometry_get(op);
- outside = eina_rectangle_outside_position(&rect.rect, &op_rect.rect);
- outside_dir = _direction_to_outside(direction);
- //calculate relative position of the nodes
- pos = _relative_position_rects(&rect, &op_rect);
- //calculate distance
- distance = pow(pos.x, 2) + pow(pos.y, 2);
-
- if (outside & outside_dir)
- {
- if (min_distance == 0 || min_distance > distance)
- {
- min_distance = distance;
- *lst = eina_list_free(*lst);
- *lst = eina_list_append(*lst, op);
- }
- else if (min_distance == distance)
- {
- *lst = eina_list_append(*lst, op);
- }
- }
- }
-}
-
#ifdef CALC_DEBUG
static void
_debug_node(Node *node)
@@ -560,57 +320,48 @@ _debug_node(Node *node)
}
#endif
-static void
-convert_set(Efl_Ui_Focus_Manager *obj, Efl_Ui_Focus_Manager_Calc_Data *pd, Node *node, Eina_List *focusable_list, Efl_Ui_Focus_Direction dir, void (*converter)(Node *node, Efl_Ui_Focus_Direction direction, Eina_List *list))
+static Eina_Bool
+_no_logical(const void *iter EINA_UNUSED, void *data, void *fdata EINA_UNUSED)
{
- Eina_List *partners = NULL;
- Efl_Ui_Focus_Object *fobj;
+ Node *n = data;
- EINA_LIST_FREE(focusable_list, fobj)
- {
- Node *entry;
-
- entry = node_get(obj, pd, fobj);
- if (!entry)
- {
- CRI("Found a obj in graph without node-entry!");
- return;
- }
- partners = eina_list_append(partners, entry);
- }
-
- converter(node, dir, partners);
+ return n->type != NODE_TYPE_ONLY_LOGICAL;
}
static void
dirty_flush_node(Efl_Ui_Focus_Manager *obj EINA_UNUSED, Efl_Ui_Focus_Manager_Calc_Data *pd, Node *node)
{
- Eina_List *x_partners_pos, *x_partners_neg;
- Eina_List *y_partners_pos, *y_partners_neg;
-
- _calculate_node(pd, node->focusable, DIMENSION_X, &x_partners_pos, &x_partners_neg);
- _calculate_node(pd, node->focusable, DIMENSION_Y, &y_partners_pos, &y_partners_neg);
+ Efl_Ui_Focus_Graph_Calc_Result result;
- convert_set(obj, pd, node, x_partners_pos, EFL_UI_FOCUS_DIRECTION_RIGHT, border_partners_set);
- convert_set(obj, pd, node, x_partners_neg, EFL_UI_FOCUS_DIRECTION_LEFT, border_partners_set);
- convert_set(obj, pd, node, y_partners_neg, EFL_UI_FOCUS_DIRECTION_UP, border_partners_set);
- convert_set(obj, pd, node, y_partners_pos, EFL_UI_FOCUS_DIRECTION_DOWN, border_partners_set);
+ efl_ui_focus_graph_calc(&pd->graph_ctx, eina_iterator_filter_new(eina_hash_iterator_data_new(pd->node_hash), _no_logical, NULL, NULL) , (Opaque_Graph_Member*) node, &result);
-
- /*
- * Stage 2: if there is still no relation in a special direction,
- * just take every single node that is in the given direction
- * and take the one with the shortest direction
- */
- for(int i = EFL_UI_FOCUS_DIRECTION_UP; i < EFL_UI_FOCUS_DIRECTION_LAST; i++)
+ for (int i = 0; i < 4; ++i)
{
- if (!DIRECTION_ACCESS(node, i).partners)
- {
- Eina_List *tmp = NULL;
+ Efl_Ui_Focus_Direction direction = -1;
+ Efl_Ui_Focus_Graph_Calc_Direction_Result *res = NULL;
- _calculate_node_indirection(pd, node->focusable, i, &tmp);
- convert_set(obj, pd, node, tmp, i, border_onedirection_set);
+ if (i == 0)
+ {
+ direction = EFL_UI_FOCUS_DIRECTION_RIGHT;
+ res = &result.right;
}
+ else if (i == 1)
+ {
+ direction = EFL_UI_FOCUS_DIRECTION_LEFT;
+ res = &result.left;
+ }
+ else if (i == 2)
+ {
+ direction = EFL_UI_FOCUS_DIRECTION_UP;
+ res = &result.top;
+ }
+ else if (i == 3)
+ {
+ direction = EFL_UI_FOCUS_DIRECTION_DOWN;
+ res = &result.bottom;
+ }
+
+ border_onedirection_set(node, direction, res->relation);
}
#ifdef CALC_DEBUG
@@ -621,11 +372,12 @@ dirty_flush_node(Efl_Ui_Focus_Manager *obj EINA_UNUSED, Efl_Ui_Focus_Manager_Cal
static void
dirty_flush(Efl_Ui_Focus_Manager *obj, Efl_Ui_Focus_Manager_Calc_Data *pd, Node *node)
{
- if (!eina_list_data_find(pd->dirty, node)) return;
+ if (!node->on_list) return;
efl_event_callback_call(obj, EFL_UI_FOCUS_MANAGER_EVENT_FLUSH_PRE, NULL);
pd->dirty = eina_list_remove(pd->dirty, node);
+ node->on_list = EINA_FALSE;
dirty_flush_node(obj, pd, node);
}
@@ -639,6 +391,7 @@ dirty_flush_all(Efl_Ui_Focus_Manager *obj, Efl_Ui_Focus_Manager_Calc_Data *pd)
EINA_LIST_FREE(pd->dirty, node)
{
+ node->on_list = EINA_FALSE;
dirty_flush_node(obj, pd, node);
}
}
@@ -651,10 +404,11 @@ dirty_add(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd, Node *dirty)
ERR("Only not only logical nodes can be marked dirty");
return;
}
+ if (dirty->on_list) return;
//if (eina_list_data_find(pd->dirty, dirty)) return;
- pd->dirty = eina_list_remove(pd->dirty, dirty);
pd->dirty = eina_list_append(pd->dirty, dirty);
+ dirty->on_list = EINA_TRUE;
efl_event_callback_call(obj, EFL_UI_FOCUS_MANAGER_EVENT_COORDS_DIRTY, NULL);
}
@@ -685,20 +439,25 @@ _object_del_cb(void *data, const Efl_Event *event)
efl_ui_focus_manager_calc_unregister(data, event->object);
}
-EFL_CALLBACKS_ARRAY_DEFINE(focusable_node,
- {EFL_GFX_EVENT_RESIZE, _node_new_geometry_cb},
- {EFL_GFX_EVENT_MOVE, _node_new_geometry_cb},
+EFL_CALLBACKS_ARRAY_DEFINE(regular_node,
+ {EFL_GFX_ENTITY_EVENT_RESIZE, _node_new_geometry_cb},
+ {EFL_GFX_ENTITY_EVENT_MOVE, _node_new_geometry_cb},
+ {EFL_EVENT_DEL, _object_del_cb},
+);
+
+EFL_CALLBACKS_ARRAY_DEFINE(logical_node,
{EFL_EVENT_DEL, _object_del_cb},
);
+
//=============================
static Node*
-_register(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd, Efl_Ui_Focus_Object *child, Node *parent)
+_register(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd, Efl_Ui_Focus_Object *child, Node *parent, Node_Type type, Efl_Ui_Focus_Manager *redirect)
{
Node *node;
node = eina_hash_find(pd->node_hash, &child);
- if (node)
+ if (node && !(node->type == type && T(node).parent == parent && node->redirect_manager == redirect))
{
ERR("Child %p is already registered in the graph (%s)", child, node->type == NODE_TYPE_ONLY_LOGICAL ? "logical" : "regular");
return NULL;
@@ -713,6 +472,8 @@ _register(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd, Efl_Ui_Focus_Object *chil
T(node).parent = parent;
T(parent).children = eina_list_append(T(parent).children, node);
}
+ node->type = NODE_TYPE_ONLY_LOGICAL;
+ node->redirect_manager = redirect;
return node;
}
@@ -733,11 +494,11 @@ _efl_ui_focus_manager_calc_register_logical(Eo *obj, Efl_Ui_Focus_Manager_Calc_D
pnode = node_get(obj, pd, parent);
if (!pnode) return EINA_FALSE;
- node = _register(obj, pd, child, pnode);
+ node = _register(obj, pd, child, pnode, NODE_TYPE_ONLY_LOGICAL, redirect);
if (!node) return EINA_FALSE;
- node->type = NODE_TYPE_ONLY_LOGICAL;
- node->redirect_manager = redirect;
+ //listen to deletion
+ efl_event_callback_array_add(child, logical_node(), obj);
//set again
if (T(pnode).saved_order)
@@ -769,11 +530,11 @@ _efl_ui_focus_manager_calc_register(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd,
pnode = node_get(obj, pd, parent);
if (!pnode) return EINA_FALSE;
- node = _register(obj, pd, child, pnode);
+ node = _register(obj, pd, child, pnode, NODE_TYPE_NORMAL, redirect);
if (!node) return EINA_FALSE;
//listen to changes
- efl_event_callback_array_add(child, focusable_node(), obj);
+ efl_event_callback_array_add(child, regular_node(), obj);
node->type = NODE_TYPE_NORMAL;
node->redirect_manager = redirect;
@@ -955,11 +716,22 @@ _efl_ui_focus_manager_calc_update_children(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Man
return EINA_TRUE;
}
+static inline Node*
+_request_subchild_except(Node *n, Node *except)
+{
+ n = _request_subchild(n);
+ while (n == except)
+ {
+ n = _next(n);
+ }
+
+ return n;
+}
+
EOLIAN static void
_efl_ui_focus_manager_calc_unregister(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Manager_Calc_Data *pd, Efl_Ui_Focus_Object *child)
{
Node *node;
- Eina_Bool refocus = EINA_FALSE;
node = eina_hash_find(pd->node_hash, &child);
@@ -967,45 +739,30 @@ _efl_ui_focus_manager_calc_unregister(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Manager_
F_DBG("Manager: %p unregister %p", obj, child);
- if (eina_list_last_data_get(pd->focus_stack) == node)
- {
- //unfocus the current head
- efl_ui_focus_object_focus_set(child, EINA_FALSE);
- refocus = EINA_TRUE;
- }
-
-
- //remove the object from the stack if it hasn't done that until now
- //after this it's not at the top anymore
- //elm_widget_focus_set(node->focusable, EINA_FALSE);
- //delete again from the list, for the case it was not at the top
- pd->focus_stack = eina_list_remove(pd->focus_stack, node);
-
- if (refocus)
+ if (eina_list_last_data_get(pd->focus_stack) == node && !pd->redirect)
{
- Node *n = eina_list_last_data_get(pd->focus_stack);
- if (n)
- efl_ui_focus_object_focus_set(n->focusable, EINA_TRUE);
- }
+ if (!efl_invalidated_get(pd->root->focusable))
+ {
+ Node *n;
- //add all neighbors of the node to the dirty list
- for(int i = EFL_UI_FOCUS_DIRECTION_UP; i < EFL_UI_FOCUS_DIRECTION_LAST; i++)
- {
- Node *partner;
- Eina_List *n;
+ n = eina_list_nth(pd->focus_stack, eina_list_count(pd->focus_stack) - 2);
+ if (!n)
+ n = _request_subchild_except(pd->root, node);
- EINA_LIST_FOREACH(DIRECTION_ACCESS(node, i).partners, n, partner)
- {
- dirty_add(obj, pd, partner);
+ if (n)
+ efl_ui_focus_manager_focus_set(obj, n->focusable);
}
}
- //remove from the dirty parts
- pd->dirty = eina_list_remove(pd->dirty, node);
-
eina_hash_del_by_key(pd->node_hash, &child);
}
+static void
+_redirect_del(void *data, const Efl_Event *event EINA_UNUSED)
+{
+ efl_ui_focus_manager_redirect_set(data, NULL);
+}
+
EOLIAN static void
_efl_ui_focus_manager_calc_efl_ui_focus_manager_redirect_set(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd, Efl_Ui_Focus_Manager *redirect)
{
@@ -1018,25 +775,15 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_redirect_set(Eo *obj, Efl_Ui_Foc
old_manager = pd->redirect;
if (pd->redirect)
- efl_wref_del(pd->redirect, &pd->redirect);
+ efl_event_callback_del(pd->redirect, EFL_EVENT_DEL, _redirect_del, obj);
pd->redirect = redirect;
if (pd->redirect)
- efl_wref_add(pd->redirect, &pd->redirect);
+ efl_event_callback_add(pd->redirect, EFL_EVENT_DEL, _redirect_del, obj);
efl_ui_focus_manager_reset_history(old_manager);
- //we might have saved a logical element at the top, remove that if there is one
- {
- Node *n = NULL;
-
- n = eina_list_last_data_get(pd->focus_stack);
-
- if (n && n->type == NODE_TYPE_ONLY_LOGICAL && n->redirect_manager == old_manager)
- pd->focus_stack = eina_list_remove(pd->focus_stack, n);
- }
-
//adjust focus property of the most upper element
{
Node *n = NULL;
@@ -1062,7 +809,7 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_redirect_set(Eo *obj, Efl_Ui_Foc
}
EOLIAN static Efl_Ui_Focus_Manager *
-_efl_ui_focus_manager_calc_efl_ui_focus_manager_redirect_get(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Manager_Calc_Data *pd)
+_efl_ui_focus_manager_calc_efl_ui_focus_manager_redirect_get(const Eo *obj EINA_UNUSED, Efl_Ui_Focus_Manager_Calc_Data *pd)
{
return pd->redirect;
}
@@ -1073,7 +820,10 @@ _free_node(void *data)
Node *node = data;
FOCUS_DATA(node->manager);
- efl_event_callback_array_del(node->focusable, focusable_node(), node->manager);
+ if (node->type == NODE_TYPE_ONLY_LOGICAL)
+ efl_event_callback_array_del(node->focusable, logical_node(), node->manager);
+ else
+ efl_event_callback_array_del(node->focusable, regular_node(), node->manager);
if (pd->root != data)
{
@@ -1086,6 +836,9 @@ _efl_ui_focus_manager_calc_efl_object_constructor(Eo *obj, Efl_Ui_Focus_Manager_
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
pd->node_hash = eina_hash_pointer_new(_free_node);
+
+ pd->graph_ctx.offset_focusable = offsetof(Node, focusable);
+
return obj;
}
@@ -1101,9 +854,13 @@ _efl_ui_focus_manager_calc_efl_object_provider_find(const Eo *obj, Efl_Ui_Focus_
EOLIAN static void
_efl_ui_focus_manager_calc_efl_object_destructor(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd)
{
- eina_list_free(pd->focus_stack);
- eina_list_free(pd->dirty);
+ Node *n;
+ pd->focus_stack = eina_list_free(pd->focus_stack);
+ EINA_LIST_FREE(pd->dirty, n)
+ {
+ n->on_list = EINA_FALSE;
+ }
eina_hash_free(pd->node_hash);
efl_ui_focus_manager_redirect_set(obj, NULL);
@@ -1128,10 +885,11 @@ _iterator_next(Border_Elements_Iterator *it, void **data)
EINA_ITERATOR_FOREACH(it->real_iterator, node)
{
+ if (node->type == NODE_TYPE_ONLY_LOGICAL) continue;
+
for(int i = EFL_UI_FOCUS_DIRECTION_UP ;i < EFL_UI_FOCUS_DIRECTION_LAST; i++)
{
- if (node->type != NODE_TYPE_ONLY_LOGICAL &&
- !DIRECTION_ACCESS(node, i).partners)
+ if (!DIRECTION_ACCESS(node, i).one_direction)
{
*data = node->focusable;
return EINA_TRUE;
@@ -1154,12 +912,30 @@ _iterator_free(Border_Elements_Iterator *it)
free(it);
}
+static void
+_prepare_node(Node *root)
+{
+ Eina_List *n;
+ Node *node;
+
+ efl_ui_focus_object_prepare_logical(root->focusable);
+
+ EINA_LIST_FOREACH(root->tree.children, n, node)
+ {
+ _prepare_node(node);
+ }
+}
+
EOLIAN static Eina_Iterator*
-_efl_ui_focus_manager_calc_efl_ui_focus_manager_border_elements_get(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd)
+_efl_ui_focus_manager_calc_efl_ui_focus_manager_border_elements_get(const Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd)
{
Border_Elements_Iterator *it;
- dirty_flush_all(obj, pd);
+ /* XXX const */
+ dirty_flush_all((Eo *)obj, pd);
+
+ //now call prepare on every node
+ _prepare_node(pd->root);
it = calloc(1, sizeof(Border_Elements_Iterator));
@@ -1170,7 +946,7 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_border_elements_get(Eo *obj, Efl
it->iterator.next = FUNC_ITERATOR_NEXT(_iterator_next);
it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_iterator_get_container);
it->iterator.free = FUNC_ITERATOR_FREE(_iterator_free);
- it->object = obj;
+ it->object = (Eo *)obj;
return (Eina_Iterator*) it;
}
@@ -1209,7 +985,7 @@ _get_middle(Evas_Object *obj, Eina_Vector2 *elem)
}
static Node*
-_coords_movement(Efl_Ui_Focus_Manager_Calc_Data *pd, Node *upper, Efl_Ui_Focus_Direction direction)
+_coords_movement(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd, Node *upper, Efl_Ui_Focus_Direction direction)
{
Node *candidate;
Eina_List *node_list;
@@ -1217,10 +993,12 @@ _coords_movement(Efl_Ui_Focus_Manager_Calc_Data *pd, Node *upper, Efl_Ui_Focus_D
EINA_SAFETY_ON_FALSE_RETURN_VAL(DIRECTION_IS_2D(direction), NULL);
+ //flush the node and prepare all the nodes
+ _prepare_node(pd->root);
+ dirty_flush(obj, pd, upper);
+
//decide which direction we take
- lst = DIRECTION_ACCESS(upper, direction).partners;
- if (!lst)
- lst = DIRECTION_ACCESS(upper, direction).one_direction;
+ lst = DIRECTION_ACCESS(upper, direction).one_direction;
//we are searching which of the partners is lower to the history
EINA_LIST_REVERSE_FOREACH(pd->focus_stack, node_list, candidate)
@@ -1361,7 +1139,7 @@ _prev(Node *node)
static Node*
-_logical_movement(Efl_Ui_Focus_Manager_Calc_Data *pd EINA_UNUSED, Node *upper, Efl_Ui_Focus_Direction direction)
+_logical_movement(Efl_Ui_Focus_Manager_Calc_Data *pd EINA_UNUSED, Node *upper, Efl_Ui_Focus_Direction direction, Eina_Bool accept_logical)
{
Node* (*deliver)(Node *n);
Node *result;
@@ -1392,6 +1170,8 @@ _logical_movement(Efl_Ui_Focus_Manager_Calc_Data *pd EINA_UNUSED, Node *upper, E
efl_ui_focus_object_prepare_logical(result->focusable);
result = deliver(result);
+ if (accept_logical)
+ break;
} while(result && result->type != NODE_TYPE_NORMAL && !result->redirect_manager);
eina_list_free(stack);
@@ -1400,12 +1180,12 @@ _logical_movement(Efl_Ui_Focus_Manager_Calc_Data *pd EINA_UNUSED, Node *upper, E
}
static Efl_Ui_Focus_Object*
-_request_move(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Manager_Calc_Data *pd, Efl_Ui_Focus_Direction direction, Node *upper)
+_request_move(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd, Efl_Ui_Focus_Direction direction, Node *upper, Eina_Bool accept_logical)
{
Node *dir = NULL;
if (!upper)
- upper = _focus_stack_last_regular(pd);
+ upper = eina_list_last_data_get(pd->focus_stack);
if (!upper)
{
@@ -1416,13 +1196,11 @@ _request_move(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Manager_Calc_Data *pd, Efl_Ui_Fo
}
- dirty_flush(obj, pd, upper);
-
if (direction == EFL_UI_FOCUS_DIRECTION_PREVIOUS
|| direction == EFL_UI_FOCUS_DIRECTION_NEXT)
- dir = _logical_movement(pd, upper, direction);
+ dir = _logical_movement(pd, upper, direction, accept_logical);
else
- dir = _coords_movement(pd, upper, direction);
+ dir = _coords_movement(obj, pd, upper, direction);
//return the widget
if (dir)
@@ -1432,28 +1210,34 @@ _request_move(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Manager_Calc_Data *pd, Efl_Ui_Fo
}
EOLIAN static Efl_Ui_Focus_Object*
-_efl_ui_focus_manager_calc_efl_ui_focus_manager_request_move(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Manager_Calc_Data *pd, Efl_Ui_Focus_Direction direction)
+_efl_ui_focus_manager_calc_efl_ui_focus_manager_request_move(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd, Efl_Ui_Focus_Direction direction, Efl_Ui_Focus_Object *child, Eina_Bool logical)
{
+ Node *child_node;
EINA_SAFETY_ON_FALSE_RETURN_VAL(DIRECTION_CHECK(direction), NULL);
- if (pd->redirect)
- return efl_ui_focus_manager_request_move(pd->redirect, direction);
+ if (!child)
+ child_node = eina_list_last_data_get(pd->focus_stack);
else
- {
- Node *upper = NULL;
+ child_node = node_get(obj, pd, child);
- upper = eina_list_last_data_get(pd->focus_stack);
+ if (!child_node)
+ return NULL;
- if (!upper)
- {
- upper = _no_history_element(pd->node_hash);
- if (upper)
- return upper->focusable;
- return NULL;
- }
+ return _request_move(obj, pd, direction, child_node, logical);
+}
- return _request_move(obj, pd, direction, upper);
- }
+static int
+_node_depth(Node *node)
+{
+ int i = 0;
+
+ while (node && node->tree.parent)
+ {
+ node = node->tree.parent;
+ i++;
+ }
+
+ return i;
}
static Node*
@@ -1464,19 +1248,22 @@ _request_subchild(Node *node)
if (node->tree.children)
{
- target = node;
+ int new_depth, old_depth = _node_depth(node);
+ target = node;
//try to find a child that is not logical or has a redirect manager
- while (target && target->type == NODE_TYPE_ONLY_LOGICAL && !target->redirect_manager)
+ do
{
if (target != node)
efl_ui_focus_object_prepare_logical(target->focusable);
target = _next(target);
//abort if we are exceeding the childrens of node
- if (target == node) target = NULL;
- }
+ new_depth = _node_depth(target);
+ if (new_depth <= old_depth) target = NULL;
+ }
+ while (target && target->type == NODE_TYPE_ONLY_LOGICAL && !target->redirect_manager);
F_DBG("Found node %p", target);
}
@@ -1487,8 +1274,9 @@ EOLIAN static void
_efl_ui_focus_manager_calc_efl_ui_focus_manager_manager_focus_set(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd, Efl_Ui_Focus_Object *focus)
{
Node *node, *last;
- Efl_Ui_Focus_Object *last_focusable = NULL;
+ Efl_Ui_Focus_Object *last_focusable = NULL, *new_focusable;
Efl_Ui_Focus_Manager *redirect_manager;
+ Node_Type node_type;
EINA_SAFETY_ON_NULL_RETURN(focus);
@@ -1521,8 +1309,6 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_manager_focus_set(Eo *obj, Efl_U
F_DBG("Manager: %p focusing object %p %s", obj, node->focusable, efl_class_name_get(node->focusable));
- //make sure this manager is in the chain of redirects
- _manager_in_chain_set(obj, pd);
if (eina_list_last_data_get(pd->focus_stack) == node)
{
@@ -1531,19 +1317,11 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_manager_focus_set(Eo *obj, Efl_U
return;
}
- if (pd->redirect)
- {
- Efl_Ui_Focus_Manager *m = obj;
-
- //completely unset the current redirect chain
- while (efl_ui_focus_manager_redirect_get(m))
- {
- Efl_Ui_Focus_Manager *old = m;
+ //make sure this manager is in the chain of redirects
+ _manager_in_chain_set(obj, pd);
- m = efl_ui_focus_manager_redirect_get(m);
- efl_ui_focus_manager_redirect_set(old, NULL);
- }
- }
+ node_type = node->type;
+ new_focusable = node->focusable;
redirect_manager = node->redirect_manager;
@@ -1552,30 +1330,56 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_manager_focus_set(Eo *obj, Efl_U
last_focusable = last->focusable;
//remove the object from the list and add it again
- pd->focus_stack = eina_list_remove(pd->focus_stack, node);
- pd->focus_stack = eina_list_append(pd->focus_stack, node);
+ if (node_type == NODE_TYPE_NORMAL)
+ {
+ pd->focus_stack = eina_list_remove(pd->focus_stack, node);
+ pd->focus_stack = eina_list_append(pd->focus_stack, node);
+ }
- /*
- Only emit those signals if we are already at the top of the focus stack.
- Otherwise focus_get in the callback to that signal might return false.
- */
- if (node->type == NODE_TYPE_NORMAL)
+ //capture how we came to the redirect manager
+ if (redirect_manager)
{
- //populate the new change
- efl_ui_focus_object_focus_set(last_focusable, EINA_FALSE);
- efl_ui_focus_object_focus_set(node->focusable, EINA_TRUE);
- efl_event_callback_call(obj, EFL_UI_FOCUS_MANAGER_EVENT_FOCUSED, last_focusable);
+ pd->redirect_entry = new_focusable;
}
//set to NULL here, from the event earlier this pointer could be dead.
node = NULL;
+ //unset redirect manager for the case that its a different one to the one we want
+ if (pd->redirect && pd->redirect != redirect_manager)
+ {
+ Efl_Ui_Focus_Manager *m = obj;
+
+ //completely unset the current redirect chain
+ while (efl_ui_focus_manager_redirect_get(m))
+ {
+ Efl_Ui_Focus_Manager *old = m;
+
+ m = efl_ui_focus_manager_redirect_get(m);
+ efl_ui_focus_manager_redirect_set(old, NULL);
+ }
+ }
+
//now check if this is also a listener object
if (redirect_manager)
{
//set the redirect
efl_ui_focus_manager_redirect_set(obj, redirect_manager);
}
+
+ /*
+ Only emit those signals if we are already at the top of the focus stack.
+ Otherwise focus_get in the callback to that signal might return false.
+ */
+ if (node_type == NODE_TYPE_NORMAL)
+ {
+ //populate the new change
+ if (last_focusable)
+ efl_ui_focus_object_focus_set(last_focusable, EINA_FALSE);
+ if (new_focusable)
+ efl_ui_focus_object_focus_set(new_focusable, EINA_TRUE);
+ efl_event_callback_call(obj, EFL_UI_FOCUS_MANAGER_EVENT_FOCUSED, last_focusable);
+ }
}
EOLIAN static void
@@ -1608,6 +1412,11 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_move(Eo *obj EINA_UNUSED, Efl_Ui
Efl_Ui_Focus_Object *candidate = NULL;
Efl_Ui_Focus_Manager *early, *late;
+ // for the case that focus is set to a new element, a new redirect
+ // manager could have been set, to adjust everything
+ // in the new reidirect manager we have to call the first touch function.
+ Eina_Bool adjust_redirect_manager = EINA_FALSE;
+
EINA_SAFETY_ON_FALSE_RETURN_VAL(DIRECTION_CHECK(direction), NULL);
early = efl_ui_focus_manager_redirect_get(obj);
@@ -1623,13 +1432,23 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_move(Eo *obj EINA_UNUSED, Efl_Ui
if (DIRECTION_IS_LOGICAL(direction))
{
- // lets just take the last
-
- Node *n = eina_list_last_data_get(pd->focus_stack);
- new_candidate = _request_move(obj, pd, direction, n);
+ // lets just take the redirect_entry
+ Node *n = node_get(obj, pd, pd->redirect_entry);
+ new_candidate = _request_move(obj, pd, direction, n, EINA_FALSE);
if (new_candidate)
- efl_ui_focus_manager_focus_set(obj, new_candidate);
+ {
+ efl_ui_focus_manager_focus_set(obj, new_candidate);
+ adjust_redirect_manager = EINA_TRUE;
+ }
+ else
+ {
+ //we set the redirect to NULL since it cannot
+ //help us, later on the redirect manager can be
+ //set to the same again, and it is strictly new setted up.
+ efl_ui_focus_manager_redirect_set(obj, NULL);
+ pd->redirect_entry = NULL;
+ }
candidate = new_candidate;
}
@@ -1641,12 +1460,22 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_move(Eo *obj EINA_UNUSED, Efl_Ui
n = eina_hash_find(pd->node_hash, &old_candidate);
if (n)
- new_candidate = _request_move(obj, pd, direction, n);
+ new_candidate = _request_move(obj, pd, direction, n, EINA_FALSE);
if (new_candidate)
{
//redirect does not have smth. but we do have.
efl_ui_focus_manager_focus_set(obj, new_candidate);
+ adjust_redirect_manager = EINA_TRUE;
+ }
+ else
+ {
+ /*
+ DO NOT unset the redirect here, the value has to stay,
+ if one direction is not continuing in one direction, the
+ other can continue thus we need to safe the redirect for this case.
+ */
+
}
candidate = new_candidate;
@@ -1655,22 +1484,38 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_move(Eo *obj EINA_UNUSED, Efl_Ui
}
else
{
- candidate = efl_ui_focus_manager_request_move(obj, direction);
+ Efl_Ui_Focus_Object *child = NULL;
+
+ if (!pd->focus_stack)
+ {
+ Node *child_node;
+
+ child_node = _no_history_element(pd->node_hash);
+ if (child_node)
+ child = child_node->focusable;
+ }
+
+ candidate = efl_ui_focus_manager_request_move(obj, direction, child, EINA_FALSE);
F_DBG("Manager: %p moved to %p %s in direction %d", obj, candidate, efl_class_name_get(candidate), direction);
if (candidate)
{
efl_ui_focus_manager_focus_set(obj, candidate);
+ adjust_redirect_manager = EINA_TRUE;
}
}
- late = efl_ui_focus_manager_redirect_get(obj);
-
- if (early != late)
+ if (adjust_redirect_manager)
{
- //this is a new manager, we have to init its case!
- efl_ui_focus_manager_setup_on_first_touch(pd->redirect, direction, candidate);
+ late = efl_ui_focus_manager_redirect_get(obj);
+
+ if (early != late)
+ {
+ //this is a new manager, we have to init its case!
+ if (late)
+ efl_ui_focus_manager_setup_on_first_touch(late, direction, candidate);
+ }
}
return candidate;
@@ -1687,8 +1532,7 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_root_set(Eo *obj EINA_UNUSED, Ef
return EINA_FALSE;
}
- node = _register(obj, pd, root, NULL);
- node->type = NODE_TYPE_ONLY_LOGICAL;
+ node = _register(obj, pd, root, NULL, NODE_TYPE_ONLY_LOGICAL, NULL);
pd->root = node;
@@ -1696,7 +1540,7 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_root_set(Eo *obj EINA_UNUSED, Ef
}
EOLIAN static Efl_Ui_Focus_Object*
-_efl_ui_focus_manager_calc_efl_ui_focus_manager_root_get(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Manager_Calc_Data *pd)
+_efl_ui_focus_manager_calc_efl_ui_focus_manager_root_get(const Eo *obj EINA_UNUSED, Efl_Ui_Focus_Manager_Calc_Data *pd)
{
if (!pd->root) return NULL;
@@ -1725,9 +1569,6 @@ _convert(Border b)
Eina_List *n, *par = NULL;
Node *node;
- EINA_LIST_FOREACH(b.partners, n, node)
- par = eina_list_append(par, node->focusable);
-
EINA_LIST_FOREACH(b.one_direction, n, node)
par = eina_list_append(par, node->focusable);
@@ -1735,10 +1576,12 @@ _convert(Border b)
}
EOLIAN static Efl_Ui_Focus_Object*
-_efl_ui_focus_manager_calc_efl_ui_focus_manager_manager_focus_get(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Manager_Calc_Data *pd)
+_efl_ui_focus_manager_calc_efl_ui_focus_manager_manager_focus_get(const Eo *obj EINA_UNUSED, Efl_Ui_Focus_Manager_Calc_Data *pd)
{
Node *upper = NULL;
+ if (pd->redirect && pd->redirect_entry) return pd->redirect_entry;
+
upper = eina_list_last_data_get(pd->focus_stack);
if (!upper)
@@ -1857,6 +1700,8 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_request_subchild(Eo *obj, Efl_Ui
Node *child, *target;
child = node_get(obj, pd, child_obj);
+ if (!child) return NULL;
+
target = _request_subchild(child);
if (target) return target->focusable;
diff --git a/src/lib/elementary/efl_ui_focus_manager_calc.eo b/src/lib/elementary/efl_ui_focus_manager_calc.eo
index ff7d308beb..cfaffd826c 100644
--- a/src/lib/elementary/efl_ui_focus_manager_calc.eo
+++ b/src/lib/elementary/efl_ui_focus_manager_calc.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Focus.Manager.Calc (Efl.Object, Efl.Ui.Focus.Manager) {
+class Efl.Ui.Focus.Manager_Calc (Efl.Object, Efl.Ui.Focus.Manager) {
[[Calculates the directions of Efl.Ui.Focus.Direction
Each registered item will get an other registered object in each
diff --git a/src/lib/elementary/efl_ui_focus_manager_root_focus.c b/src/lib/elementary/efl_ui_focus_manager_root_focus.c
index ce4352d98e..3070a6f183 100644
--- a/src/lib/elementary/efl_ui_focus_manager_root_focus.c
+++ b/src/lib/elementary/efl_ui_focus_manager_root_focus.c
@@ -2,18 +2,18 @@
# include "elementary_config.h"
#endif
+#define EFL_UI_FOCUS_COMPOSITION_ADAPTER_PROTECTED
#define EFL_UI_FOCUS_OBJECT_PROTECTED
#include <Elementary.h>
#include "elm_priv.h"
-#include "efl_ui_focus_rectangle.eo.h"
+#include "efl_ui_focus_composition_adapter.eo.h"
#define MY_CLASS EFL_UI_FOCUS_MANAGER_ROOT_FOCUS_CLASS
typedef struct {
- Efl_Ui_Focus_Object *root;
- Eina_List *none_logicals;
+ Efl_Ui_Focus_Object *replacement_object;
Evas_Object *rect;
Eina_Bool rect_registered;
@@ -24,37 +24,69 @@ typedef struct {
static Efl_Ui_Focus_Object*
_trap(Efl_Ui_Focus_Manager_Root_Focus_Data *pd, Efl_Ui_Focus_Object *obj)
{
- if (pd->rect == obj) return pd->root;
+ if (pd->rect == obj) return pd->replacement_object;
return obj;
}
static void
_state_eval(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd)
{
- if (pd->none_logicals && pd->rect_registered)
+ Efl_Ui_Focus_Object *sub;
+
+ sub = efl_ui_focus_manager_request_subchild(obj, efl_ui_focus_manager_root_get(obj));
+
+ if (sub == pd->rect)
{
- efl_ui_focus_manager_calc_unregister(obj, pd->rect);
- pd->rect_registered = EINA_FALSE;
+ sub = efl_ui_focus_manager_request_move(obj, EFL_UI_FOCUS_DIRECTION_NEXT, pd->rect, EINA_FALSE);
+ if (sub == pd->rect)
+ sub = NULL;
}
- else if (!pd->none_logicals && !pd->rect_registered)
+
+ EINA_SAFETY_ON_TRUE_RETURN(sub == pd->rect);
+
+ if (sub && pd->rect_registered)
{
- efl_ui_focus_manager_calc_register(obj, pd->rect, pd->root, NULL);
- pd->rect_registered = EINA_TRUE;
+ efl_ui_focus_manager_calc_unregister(obj, pd->rect);
+ pd->rect_registered = EINA_FALSE;
+ efl_ui_focus_composition_adapter_focus_manager_parent_set(pd->rect, NULL);
+ efl_ui_focus_composition_adapter_focus_manager_object_set(pd->rect, NULL);
+ }
+ else if (!sub && !pd->rect_registered)
+ {
+ Efl_Ui_Focus_Object *root;
+
+ root = efl_ui_focus_manager_root_get(obj);
+ efl_ui_focus_manager_calc_register(obj, pd->rect, root, NULL);
+ efl_ui_focus_composition_adapter_focus_manager_parent_set(pd->rect, root);
+ efl_ui_focus_composition_adapter_focus_manager_object_set(pd->rect, obj);
+ pd->rect_registered = EINA_TRUE;
}
}
EOLIAN static Eina_Bool
_efl_ui_focus_manager_root_focus_efl_ui_focus_manager_calc_register(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd, Efl_Ui_Focus_Object *child, Efl_Ui_Focus_Object *parent, Efl_Ui_Focus_Manager *redirect)
{
- Eina_Bool ret = EINA_FALSE;
if (efl_ui_focus_manager_calc_register(efl_super(obj, MY_CLASS), child, parent, redirect))
{
- pd->none_logicals = eina_list_append(pd->none_logicals, child);
- ret = EINA_TRUE;
+ if (child != pd->rect)
+ _state_eval(obj, pd);
+
+ return EINA_TRUE;
}
- if (child != pd->rect)
- _state_eval(obj, pd);
- return ret;
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_focus_manager_root_focus_efl_ui_focus_manager_calc_register_logical(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd, Efl_Ui_Focus_Object *child, Efl_Ui_Focus_Object *parent, Efl_Ui_Focus_Manager *redirect)
+{
+ if (efl_ui_focus_manager_calc_register_logical(efl_super(obj, MY_CLASS), child, parent, redirect))
+ {
+ if (redirect)
+ _state_eval(obj, pd);
+
+ return EINA_TRUE;
+ }
+ return EINA_FALSE;
}
EOLIAN static void
@@ -62,8 +94,6 @@ _efl_ui_focus_manager_root_focus_efl_ui_focus_manager_calc_unregister(Eo *obj, E
{
efl_ui_focus_manager_calc_unregister(efl_super(obj, MY_CLASS), child);
- pd->none_logicals = eina_list_remove(pd->none_logicals, child);
-
if (child != pd->rect)
_state_eval(obj, pd);
}
@@ -78,7 +108,7 @@ _efl_ui_focus_manager_root_focus_efl_ui_focus_manager_manager_focus_set(Eo *obj,
EOLIAN static Efl_Ui_Focus_Object*
-_efl_ui_focus_manager_root_focus_efl_ui_focus_manager_manager_focus_get(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd)
+_efl_ui_focus_manager_root_focus_efl_ui_focus_manager_manager_focus_get(const Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd)
{
return _trap(pd, efl_ui_focus_manager_focus_get(efl_super(obj, MY_CLASS)));
}
@@ -103,84 +133,99 @@ _efl_ui_focus_manager_root_focus_efl_ui_focus_manager_logical_end(Eo *obj, Efl_U
}
EOLIAN static Eina_Iterator *
-_efl_ui_focus_manager_root_focus_efl_ui_focus_manager_border_elements_get(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd)
+_efl_ui_focus_manager_root_focus_efl_ui_focus_manager_border_elements_get(const Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd)
{
- if (!!pd->none_logicals)
- {
- return efl_ui_focus_manager_border_elements_get(efl_super(obj, MY_CLASS));;
- }
- else
- {
- return eina_list_iterator_new(pd->iterator_list);
- }
-}
+ if (pd->rect_registered)
+ return eina_list_iterator_new(pd->iterator_list);
+ return efl_ui_focus_manager_border_elements_get(efl_super(obj, MY_CLASS));
+}
EOLIAN static Efl_Ui_Focus_Object*
-_efl_ui_focus_manager_root_focus_efl_ui_focus_manager_request_move(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd, Efl_Ui_Focus_Direction direction)
+_efl_ui_focus_manager_root_focus_efl_ui_focus_manager_request_move(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd, Efl_Ui_Focus_Direction direction, Efl_Ui_Focus_Object *child, Eina_Bool logical)
{
- return _trap(pd, efl_ui_focus_manager_request_move(efl_super(obj, MY_CLASS), direction));
+ return _trap(pd, efl_ui_focus_manager_request_move(efl_super(obj, MY_CLASS), direction, child, logical));
}
-
EOLIAN static Efl_Ui_Focus_Object*
_efl_ui_focus_manager_root_focus_efl_ui_focus_manager_move(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd, Efl_Ui_Focus_Direction direction)
{
return _trap(pd, efl_ui_focus_manager_move(efl_super(obj, MY_CLASS), direction));
}
-EOLIAN static Efl_Object*
-_efl_ui_focus_manager_root_focus_efl_object_finalize(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd)
+EOLIAN static Efl_Canvas_Object*
+_efl_ui_focus_manager_root_focus_canvas_object_get(const Eo *obj EINA_UNUSED, Efl_Ui_Focus_Manager_Root_Focus_Data *pd)
+{
+ return pd->replacement_object;
+}
+
+EOLIAN static void
+_efl_ui_focus_manager_root_focus_canvas_object_set(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd, Efl_Canvas_Object *canvas_object)
{
- Efl_Object *ret;
- ret = efl_finalize(efl_super(obj, MY_CLASS));
+ //if canvas object is NULL trigger it as root
+ if (!canvas_object)
+ canvas_object = efl_ui_focus_manager_root_get(obj);
- pd->root = efl_ui_focus_manager_root_get(obj);
+ if (canvas_object == pd->replacement_object) return;
- pd->rect = efl_add(EFL_UI_FOCUS_RECTANGLE_CLASS, evas_object_evas_get(pd->root));
+ if (pd->replacement_object)
+ {
+ pd->iterator_list = eina_list_remove(pd->iterator_list, pd->replacement_object);
+ pd->replacement_object = NULL;
+ }
- EINA_SAFETY_ON_NULL_RETURN_VAL(pd->rect, NULL);
+ pd->replacement_object = canvas_object;
+ if (pd->replacement_object)
+ {
+ efl_ui_focus_composition_adapter_canvas_object_set(pd->rect, pd->replacement_object);
+ pd->iterator_list = eina_list_append(pd->iterator_list, pd->replacement_object);
+ }
+}
- pd->iterator_list = eina_list_append(pd->iterator_list, pd->root);
+static void
+_focus_changed(void *data, const Efl_Event *ev)
+{
+ Eo *root;
- _state_eval(obj, pd);
+ root = efl_ui_focus_manager_root_get(data);
- return ret;
+ efl_ui_focus_object_focus_set(root, efl_ui_focus_object_focus_get(ev->object));
}
+EFL_CALLBACKS_ARRAY_DEFINE(composition_cb,
+ { EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED, _focus_changed },
+)
-#include "efl_ui_focus_manager_root_focus.eo.c"
-/* focus rectangle implementation */
-typedef struct {
- Eina_Bool focus;
-} Efl_Ui_Focus_Rectangle_Data;
-
-EOLIAN static Eina_Rect
-_efl_ui_focus_rectangle_efl_ui_focus_object_focus_geometry_get(Eo *obj, Efl_Ui_Focus_Rectangle_Data *pd EINA_UNUSED)
+EOLIAN static Efl_Object*
+_efl_ui_focus_manager_root_focus_efl_object_constructor(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd)
{
- Eina_Rect geom;
-
- evas_object_geometry_get(obj, &geom.x, &geom.y, &geom.w, &geom.h);
+ pd->rect = efl_add_ref(EFL_UI_FOCUS_COMPOSITION_ADAPTER_CLASS, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(pd->rect, NULL);
+ efl_event_callback_array_add(pd->rect, composition_cb(), obj);
- return geom;
+ return efl_constructor(efl_super(obj, MY_CLASS));
}
-
EOLIAN static void
-_efl_ui_focus_rectangle_efl_ui_focus_object_focus_set(Eo *obj, Efl_Ui_Focus_Rectangle_Data *pd, Eina_Bool focus)
+_efl_ui_focus_manager_root_focus_efl_object_destructor(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd)
{
- efl_ui_focus_object_focus_set(efl_super(obj, EFL_UI_FOCUS_RECTANGLE_CLASS), focus);
+ efl_unref(pd->rect);
+ pd->rect = NULL;
- pd->focus = focus;
+ efl_destructor(efl_super(obj, MY_CLASS));
}
-
-EOLIAN static Eina_Bool
-_efl_ui_focus_rectangle_efl_ui_focus_object_focus_get(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Rectangle_Data *pd)
+EOLIAN static Efl_Object*
+_efl_ui_focus_manager_root_focus_efl_object_finalize(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd)
{
- return pd->focus;
-}
+ //set it to NULL so the root manager is passed to the manager
+ if (!pd->replacement_object)
+ efl_ui_focus_manager_root_focus_canvas_object_set(obj, NULL);
+ _state_eval(obj, pd);
-#include "efl_ui_focus_rectangle.eo.c"
+ return efl_finalize(efl_super(obj, MY_CLASS));
+}
+
+#include "efl_ui_focus_manager_root_focus.eo.c"
diff --git a/src/lib/elementary/efl_ui_focus_manager_root_focus.eo b/src/lib/elementary/efl_ui_focus_manager_root_focus.eo
index 4c86d3d563..81bd312abf 100644
--- a/src/lib/elementary/efl_ui_focus_manager_root_focus.eo
+++ b/src/lib/elementary/efl_ui_focus_manager_root_focus.eo
@@ -1,14 +1,29 @@
-class Efl.Ui.Focus.Manager.Root_Focus(Efl.Ui.Focus.Manager.Calc) {
+class Efl.Ui.Focus.Manager_Root_Focus(Efl.Ui.Focus.Manager_Calc) {
[[ This class ensures that the root is at least focusable, if nothing else is focusable]]
+ methods {
+ @property canvas_object {
+ [[
+ The default replacement object for the case that there is no focusable object inside the manager is the root object.
+ However, you can change this by setting this value to something else.
+ $null is triggered as the same value as Efl.Ui.Focus.Manager.root.get
+ ]]
+ values {
+ canvas_object : Efl.Canvas.Object; [[Canvas object]]
+ }
+ }
+ }
implements {
- Efl.Ui.Focus.Manager.Calc.register;
- Efl.Ui.Focus.Manager.Calc.unregister;
+ Efl.Ui.Focus.Manager_Calc.register_logical;
+ Efl.Ui.Focus.Manager_Calc.register;
+ Efl.Ui.Focus.Manager_Calc.unregister;
Efl.Ui.Focus.Manager.manager_focus {set; get;}
Efl.Ui.Focus.Manager.fetch;
Efl.Ui.Focus.Manager.logical_end;
Efl.Ui.Focus.Manager.border_elements {get;}
Efl.Ui.Focus.Manager.request_move;
Efl.Ui.Focus.Manager.move;
+ Efl.Object.constructor;
+ Efl.Object.destructor;
Efl.Object.finalize;
}
}
diff --git a/src/lib/elementary/efl_ui_focus_manager_sub.c b/src/lib/elementary/efl_ui_focus_manager_sub.c
index 5404eb05ee..57997afd41 100644
--- a/src/lib/elementary/efl_ui_focus_manager_sub.c
+++ b/src/lib/elementary/efl_ui_focus_manager_sub.c
@@ -32,13 +32,15 @@ _set_a_without_b(Eina_List *a, Eina_List *b)
static void
_register(Efl_Ui_Focus_Manager *obj, Efl_Ui_Focus_Manager *par_m, Efl_Ui_Focus_Object *node, Efl_Ui_Focus_Object *logical)
{
- efl_ui_focus_manager_calc_register(par_m, node, logical, obj);
+ if (par_m)
+ efl_ui_focus_manager_calc_register(par_m, node, logical, obj);
}
static void
_unregister(Efl_Ui_Focus_Manager *obj EINA_UNUSED, Efl_Ui_Focus_Manager *par_m, Efl_Ui_Focus_Object *node)
{
- efl_ui_focus_manager_calc_unregister(par_m, node);
+ if (par_m)
+ efl_ui_focus_manager_calc_unregister(par_m, node);
}
static void
@@ -49,7 +51,7 @@ _border_flush(Eo *obj, Efl_Ui_Focus_Manager_Sub_Data *pd)
Efl_Ui_Focus_Object *node, *logical;
Efl_Ui_Focus_Manager *manager;
- manager = efl_ui_focus_user_focus_manager_get(obj);
+ manager = efl_ui_focus_object_focus_manager_get(obj);
logical = obj;
borders = efl_ui_focus_manager_border_elements_get(obj);
@@ -90,7 +92,7 @@ _border_unregister(Eo *obj, Efl_Ui_Focus_Manager_Sub_Data *pd)
Efl_Ui_Focus_Object *node;
Efl_Ui_Focus_Manager *manager;
- manager = efl_ui_focus_user_focus_manager_get(obj);
+ manager = efl_ui_focus_object_focus_manager_get(obj);
EINA_LIST_FREE(pd->current_border, node)
{
if (node == obj) continue;
@@ -135,12 +137,12 @@ _logical_manager_change(void *data EINA_UNUSED, const Efl_Event *ev)
{
MY_DATA(data, pd);
Eina_List *n;
- Efl_Ui_Focus_User *b;
+ Efl_Ui_Focus_Object *b;
Efl_Ui_Focus_Manager *manager;
- manager = efl_ui_focus_user_focus_manager_get(ev->object);
if (!ev->info) return;
+ manager = efl_ui_focus_object_focus_manager_get(ev->object);
EINA_LIST_FOREACH(pd->current_border, n, b)
{
if (b == ev->object) continue;
@@ -153,22 +155,24 @@ _flush_manager(Eo *obj, Efl_Ui_Focus_Manager_Sub_Data *pd)
{
Efl_Ui_Focus_Manager *manager;
Efl_Ui_Focus_Object *logical;
- Efl_Ui_Focus_User *b;
+ Efl_Ui_Focus_Object *b;
Eina_List *n;
+ logical = efl_ui_focus_object_focus_parent_get(obj);
+ manager = efl_ui_focus_object_focus_manager_get(obj);
- logical = efl_ui_focus_user_focus_parent_get(obj);
- manager = efl_ui_focus_user_focus_manager_get(obj);
+ if (pd->manager == manager)
+ return;
//unregister from the old
- efl_event_callback_array_del(pd->manager, parent_manager(), obj);
- efl_event_callback_array_add(manager, parent_manager(), obj);
+ if (pd->manager) efl_event_callback_array_del(pd->manager, parent_manager(), obj);
+ if (manager) efl_event_callback_array_add(manager, parent_manager(), obj);
EINA_LIST_FOREACH(pd->current_border , n, b)
{
if (b == obj) continue;
- _unregister(obj, manager, b);
+ _unregister(obj, pd->manager, b);
_register(obj, manager, b, logical);
}
//unregister the old manager, use the new
@@ -185,8 +189,8 @@ _manager_change(void *data, const Efl_Event *ev EINA_UNUSED)
EFL_CALLBACKS_ARRAY_DEFINE(self_manager,
{EFL_UI_FOCUS_MANAGER_EVENT_COORDS_DIRTY, _self_manager_dirty},
- {EFL_UI_FOCUS_USER_EVENT_LOGICAL_CHANGED, _logical_manager_change},
- {EFL_UI_FOCUS_USER_EVENT_MANAGER_CHANGED, _manager_change}
+ {EFL_UI_FOCUS_OBJECT_EVENT_LOGICAL_CHANGED, _logical_manager_change},
+ {EFL_UI_FOCUS_OBJECT_EVENT_MANAGER_CHANGED, _manager_change}
);
EOLIAN static Efl_Object*
@@ -194,7 +198,6 @@ _efl_ui_focus_manager_sub_efl_object_constructor(Eo *obj, Efl_Ui_Focus_Manager_S
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_event_callback_array_add(obj, self_manager(), obj);
- _flush_manager(obj, pd);
return obj;
}
@@ -203,10 +206,22 @@ _efl_ui_focus_manager_sub_efl_object_destructor(Eo *obj, Efl_Ui_Focus_Manager_Su
{
_border_unregister(obj, pd);
- efl_event_callback_array_del(pd->manager, parent_manager(), obj);
+ if (pd->manager) efl_event_callback_array_del(pd->manager, parent_manager(), obj);
efl_destructor(efl_super(obj, MY_CLASS));
}
+EOLIAN static Efl_Ui_Focus_Object*
+_efl_ui_focus_manager_sub_efl_ui_focus_manager_move(Eo *obj, Efl_Ui_Focus_Manager_Sub_Data *pd, Efl_Ui_Focus_Direction direction)
+{
+ Eo *target = efl_ui_focus_manager_move(efl_super(obj, MY_CLASS), direction);
+
+ if (!target)
+ _border_flush(obj, pd);
+
+ return target;
+}
+
+
#include "efl_ui_focus_manager_sub.eo.c"
diff --git a/src/lib/elementary/efl_ui_focus_manager_sub.eo b/src/lib/elementary/efl_ui_focus_manager_sub.eo
index 899e96b4b5..936c78e938 100644
--- a/src/lib/elementary/efl_ui_focus_manager_sub.eo
+++ b/src/lib/elementary/efl_ui_focus_manager_sub.eo
@@ -1,9 +1,9 @@
-mixin Efl.Ui.Focus.Manager.Sub (Efl.Interface, Efl.Ui.Focus.Manager, Efl.Object)
+mixin Efl.Ui.Focus.Manager_Sub (Efl.Interface, Efl.Ui.Focus.Manager, Efl.Object)
{
[[A class that automatically registeres its border elements in the parent manager
This sub manager will register its border elements on the parent manager.
- The parent manager is found with the @Efl.Ui.Focus.User interface of the
+ The parent manager is found with the @Efl.Ui.Focus.Object interface of the
@Efl.Object.parent.
Each sub manager also has to be a focus object, the object itself will be
@@ -18,5 +18,6 @@ mixin Efl.Ui.Focus.Manager.Sub (Efl.Interface, Efl.Ui.Focus.Manager, Efl.Object)
implements {
Efl.Object.constructor;
Efl.Object.destructor;
+ Efl.Ui.Focus.Manager.move;
}
}
diff --git a/src/lib/elementary/efl_ui_focus_manager_window_root.eo b/src/lib/elementary/efl_ui_focus_manager_window_root.eo
new file mode 100644
index 0000000000..201e3bffc1
--- /dev/null
+++ b/src/lib/elementary/efl_ui_focus_manager_window_root.eo
@@ -0,0 +1,7 @@
+interface Efl.Ui.Focus.Manager_Window_Root {
+ [[ A interface to indicate the end of a focus chain.
+
+ Focusmanagers are ensuring that if they give focus to something, that they are registered in the upper focus manager.
+ The most upper focus manager does not need to do that, and can implement this interface to indicate that.
+ ]]
+}
diff --git a/src/lib/elementary/efl_ui_focus_object.c b/src/lib/elementary/efl_ui_focus_object.c
index e1361dfad1..946d605ccf 100644
--- a/src/lib/elementary/efl_ui_focus_object.c
+++ b/src/lib/elementary/efl_ui_focus_object.c
@@ -9,6 +9,7 @@
typedef struct {
Eina_Bool old_focus;
+ Eina_Bool ongoing_prepare_call;
} Efl_Ui_Focus_Object_Data;
EOLIAN static void
@@ -21,11 +22,23 @@ _efl_ui_focus_object_focus_set(Eo *obj, Efl_Ui_Focus_Object_Data *pd, Eina_Bool
}
EOLIAN static Eina_Bool
-_efl_ui_focus_object_focus_get(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Object_Data *pd)
+_efl_ui_focus_object_focus_get(const Eo *obj EINA_UNUSED, Efl_Ui_Focus_Object_Data *pd)
{
return pd->old_focus;
}
+EOLIAN static void
+_efl_ui_focus_object_prepare_logical(Eo *obj, Efl_Ui_Focus_Object_Data *pd)
+{
+ if (pd->ongoing_prepare_call) return;
+
+ pd->ongoing_prepare_call = EINA_TRUE;
+
+ efl_ui_focus_object_prepare_logical_none_recursive(obj);
+
+ pd->ongoing_prepare_call = EINA_FALSE;
+}
+
+
#include "efl_ui_focus_object.eo.c"
-#include "efl_ui_focus_user.eo.c"
diff --git a/src/lib/elementary/efl_ui_focus_object.eo b/src/lib/elementary/efl_ui_focus_object.eo
index 96976919ee..901de5d44b 100644
--- a/src/lib/elementary/efl_ui_focus_object.eo
+++ b/src/lib/elementary/efl_ui_focus_object.eo
@@ -36,18 +36,50 @@ mixin Efl.Ui.Focus.Object
focus : bool; [[The state in which the object should be put]]
}
}
+ @property focus_manager {
+ [[Describes which manager is used to register.
+
+ If an instance of this interface is the root of a manager, this instance should not have a manager where as root of this property. The other manager in this instance will be set as focused in the corresponding manager.
+ This instance should be registered with its own manager as redirect.
+ ]]
+ get {}
+ values {
+ manager : Efl.Ui.Focus.Manager; [[The manager object]]
+ }
+ }
+ @property focus_parent {
+ [[Describes which logical parent is used by this object.]]
+ get {}
+ values {
+ logical_parent : Efl.Ui.Focus.Object; [[The focus parent.]]
+ }
+ }
prepare_logical {
[[Tells the object that its children will be queried soon by the given manager.
+ The call will be a NOP if there is already a active preprare_logical call on this object
Deleting manager items in this call will result in undefied behaviour and may cause your system to crash.
]]
}
+ prepare_logical_none_recursive @protected {
+ [[]]
+ }
+ on_focus_update @protected @pure_virtual {
+ [[Virtual function handling focus in/out events on the widget]]
+ return: bool; [[$true if this widget can handle focus, $false otherwise]]
+ }
}
implements {
@empty .focus_geometry;
- @empty .prepare_logical;
+ @empty .prepare_logical_none_recursive;
+ @empty .focus_manager;
+ @empty .focus_parent;
}
events {
focus,changed : bool; [[Emitted if the focus state has changed]]
+ manager,changed: Efl.Ui.Focus.Manager; [[Emitted when a new manager is
+ the parent for this object.]]
+ logical,changed: Efl.Ui.Focus.Object; [[Emitted when a new logical
+ parent should be used.]]
}
}
diff --git a/src/lib/elementary/efl_ui_focus_parent_provider_gen.c b/src/lib/elementary/efl_ui_focus_parent_provider_gen.c
index ad1ed62837..34ac71aedc 100644
--- a/src/lib/elementary/efl_ui_focus_parent_provider_gen.c
+++ b/src/lib/elementary/efl_ui_focus_parent_provider_gen.c
@@ -5,10 +5,11 @@
#include <Elementary.h>
#include "elm_priv.h"
#include "efl_ui_focus_parent_provider_gen.eo.h"
+#include "efl_ui_focus_composition_adapter.eo.h"
typedef struct {
Eina_Hash *map;
- Elm_Widget *container;
+ Efl_Ui_Widget *container;
Efl_Ui_Focus_Parent_Provider *provider;
} Efl_Ui_Focus_Parent_Provider_Gen_Data;
@@ -21,13 +22,13 @@ _efl_ui_focus_parent_provider_gen_content_item_map_set(Eo *obj, Efl_Ui_Focus_Par
}
EOLIAN static Eina_Hash*
-_efl_ui_focus_parent_provider_gen_content_item_map_get(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Parent_Provider_Gen_Data *pd)
+_efl_ui_focus_parent_provider_gen_content_item_map_get(const Eo *obj EINA_UNUSED, Efl_Ui_Focus_Parent_Provider_Gen_Data *pd)
{
return pd->map;
}
EOLIAN static void
-_efl_ui_focus_parent_provider_gen_container_set(Eo *obj, Efl_Ui_Focus_Parent_Provider_Gen_Data *pd, Elm_Widget *container)
+_efl_ui_focus_parent_provider_gen_container_set(Eo *obj, Efl_Ui_Focus_Parent_Provider_Gen_Data *pd, Efl_Ui_Widget *container)
{
EINA_SAFETY_ON_TRUE_RETURN(efl_finalized_get(obj));
@@ -38,8 +39,8 @@ _efl_ui_focus_parent_provider_gen_container_set(Eo *obj, Efl_Ui_Focus_Parent_Pro
pd->provider = efl_provider_find(efl_parent_get(pd->container), EFL_UI_FOCUS_PARENT_PROVIDER_INTERFACE);
}
-EOLIAN static Elm_Widget*
-_efl_ui_focus_parent_provider_gen_container_get(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Parent_Provider_Gen_Data *pd)
+EOLIAN static Efl_Ui_Widget*
+_efl_ui_focus_parent_provider_gen_container_get(const Eo *obj EINA_UNUSED, Efl_Ui_Focus_Parent_Provider_Gen_Data *pd)
{
return pd->container;
}
@@ -50,31 +51,72 @@ _efl_ui_focus_parent_provider_gen_efl_ui_focus_parent_provider_find_logical_pare
{
//first check if this item is in the map
Elm_Widget_Item *item, *above_gengrid = widget;
+ Efl_Ui_Widget *parent;
- if (elm_widget_parent_widget_get(widget) != pd->container)
+ if (efl_isa(widget, EFL_UI_FOCUS_COMPOSITION_ADAPTER_CLASS))
{
- Elm_Widget *parent = elm_widget_parent_widget_get(widget);
- //move forward so we get the last widget above the gengrid level, this may be the widget out of the map
- do {
- above_gengrid = parent;
- parent = elm_widget_parent_widget_get(above_gengrid);
- } while(parent && parent != pd->container);
+ item = efl_parent_get(widget);
+
+ if (efl_isa(item, ELM_WIDGET_ITEM_CLASS))
+ return item;
}
+ else
+ {
+ parent = elm_widget_parent_widget_get(widget);
- item = eina_hash_find(pd->map, &above_gengrid);
+ if (parent == pd->container)
+ {
+ item = eina_hash_find(pd->map, &above_gengrid);
+ efl_ui_focus_object_prepare_logical(pd->container);
- efl_ui_focus_composition_elements_flush(pd->container);
+ if (item)
+ return item;
+ }
+ }
// We dont have a map entry
- if (!item)
+ return efl_ui_focus_parent_provider_find_logical_parent(pd->provider, widget);
+}
+
+EOLIAN static Efl_Ui_Widget*
+_efl_ui_focus_parent_provider_gen_item_fetch(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Parent_Provider_Gen_Data *pd, Efl_Ui_Widget *widget)
+{
+ //first check if this item is in the map
+ Elm_Widget_Item *item, *above_gengrid = widget;
+ Efl_Ui_Widget *parent;
+
+ if (efl_isa(widget, EFL_UI_FOCUS_COMPOSITION_ADAPTER_CLASS))
{
- return efl_ui_focus_parent_provider_find_logical_parent(pd->provider, widget);
+ item = efl_parent_get(widget);
+
+ if (efl_isa(item, ELM_WIDGET_ITEM_CLASS))
+ {
+ efl_ui_focus_object_prepare_logical(pd->container);
+ return item;
+ }
+ else
+ {
+ parent = item;
+ }
}
else
{
- return item;
+ parent = elm_widget_parent_widget_get(widget);
}
-}
+ //move forward so we get the last widget above the gengrid level,
+ //this may be the widget out of the map
+ while (parent && parent != pd->container)
+ {
+ above_gengrid = parent;
+ parent = elm_widget_parent_widget_get(above_gengrid);
+ }
+ item = eina_hash_find(pd->map, &above_gengrid);
+
+ efl_ui_focus_object_prepare_logical(pd->container);
+
+ return item;
+}
+
#include "efl_ui_focus_parent_provider_gen.eo.c"
diff --git a/src/lib/elementary/efl_ui_focus_parent_provider_gen.eo b/src/lib/elementary/efl_ui_focus_parent_provider_gen.eo
index fbdf7d2bba..4959face9b 100644
--- a/src/lib/elementary/efl_ui_focus_parent_provider_gen.eo
+++ b/src/lib/elementary/efl_ui_focus_parent_provider_gen.eo
@@ -1,18 +1,25 @@
-class Efl.Ui.Focus.Parent_Provider.Gen(Efl.Object, Efl.Ui.Focus.Parent_Provider) {
+class Efl.Ui.Focus.Parent_Provider_Gen(Efl.Object, Efl.Ui.Focus.Parent_Provider) {
[[EFL UI Focus Parent Provider Gen class]]
methods {
@property content_item_map {
[[Content item map property]]
values {
- map : hash<Elm.Widget, Elm.Widget.Item>; [[Item map]]
+ map : hash<Efl.Ui.Widget, Elm.Widget.Item>; [[Item map]]
}
}
@property container {
[[Container property]]
values {
- container : Elm.Widget; [[Container widget]]
+ container : Efl.Ui.Widget; [[Container widget]]
}
}
+ item_fetch {
+ [[Fetch the item where the item is a subchild from]]
+ params {
+ widget : Efl.Ui.Widget;
+ }
+ return : Efl.Ui.Widget;
+ }
}
implements {
Efl.Ui.Focus.Parent_Provider.find_logical_parent;
diff --git a/src/lib/elementary/efl_ui_focus_parent_provider_standard.eo b/src/lib/elementary/efl_ui_focus_parent_provider_standard.eo
index 3696bcbfe3..beaec44e7a 100644
--- a/src/lib/elementary/efl_ui_focus_parent_provider_standard.eo
+++ b/src/lib/elementary/efl_ui_focus_parent_provider_standard.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Focus.Parent_Provider.Standard(Efl.Object, Efl.Ui.Focus.Parent_Provider) {
+class Efl.Ui.Focus.Parent_Provider_Standard(Efl.Object, Efl.Ui.Focus.Parent_Provider) {
[[EFL UI Focus Parent Provider Standard Class]]
implements {
Efl.Ui.Focus.Parent_Provider.find_logical_parent;
diff --git a/src/lib/elementary/efl_ui_focus_rectangle.eo b/src/lib/elementary/efl_ui_focus_rectangle.eo
deleted file mode 100644
index fdfb145b24..0000000000
--- a/src/lib/elementary/efl_ui_focus_rectangle.eo
+++ /dev/null
@@ -1,8 +0,0 @@
-class Efl.Ui.Focus.Rectangle (Efl.Canvas.Rectangle, Efl.Ui.Focus.Object)
-{
- [[EFL UI Focus Rectangle class]]
- implements {
- Efl.Ui.Focus.Object.focus_geometry {get;}
- Efl.Ui.Focus.Object.focus {set; get;}
- }
-}
diff --git a/src/lib/elementary/efl_ui_focus_user.eo b/src/lib/elementary/efl_ui_focus_user.eo
deleted file mode 100644
index 11de8e9547..0000000000
--- a/src/lib/elementary/efl_ui_focus_user.eo
+++ /dev/null
@@ -1,32 +0,0 @@
-interface Efl.Ui.Focus.User {
- [[Interface which is used to handle the manager of a user.
-
- @since 1.20
- ]]
- methods {
- @property focus_manager {
- [[Describes which manager is used to register.
-
- If an instance of this interface is the root of a manager, this instance should not have a manager where as root of this property. The other manager in this instance will be set as focused in the corresponding manager.
- This instance should be registered with its own manager as redirect.
- ]]
- get {}
- values {
- manager : Efl.Ui.Focus.Manager; [[The manager object]]
- }
- }
- @property focus_parent {
- [[Describes which logical parent is used by this object.]]
- get {}
- values {
- logical_parent : Efl.Ui.Focus.Object; [[The focus parent.]]
- }
- }
- }
- events {
- manager,changed: Efl.Ui.Focus.Manager; [[Emitted when a new manager is
- the parent for this object.]]
- logical,changed: Efl.Ui.Focus.Object; [[Emitted when a new logical
- parent should be used.]]
- }
-}
diff --git a/src/lib/elementary/efl_ui_focus_util.c b/src/lib/elementary/efl_ui_focus_util.c
index efb3219fd1..aa342a92f4 100644
--- a/src/lib/elementary/efl_ui_focus_util.c
+++ b/src/lib/elementary/efl_ui_focus_util.c
@@ -16,27 +16,67 @@ _manager_changed(void *data, const Efl_Event *event EINA_UNUSED)
}
EOLIAN static void
-_efl_ui_focus_util_focus(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Efl_Ui_Focus_User *user)
+_efl_ui_focus_util_focus(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Efl_Ui_Focus_Object *user)
{
- Elm_Widget *top, *o;
- Efl_Ui_Focus_Manager *m;
- m = efl_ui_focus_user_focus_manager_get(user);
+ Efl_Ui_Focus_Object *entry;
+ Efl_Ui_Widget *top, *o;
+ Efl_Ui_Focus_Manager *m, *registered_manager;
top = elm_widget_top_get(user);
o = efl_key_data_get(top, "__delayed_focus_set");
- efl_event_callback_del(o, EFL_UI_FOCUS_USER_EVENT_MANAGER_CHANGED, _manager_changed, o);
+ if (o) efl_event_callback_del(o, EFL_UI_FOCUS_OBJECT_EVENT_MANAGER_CHANGED, _manager_changed, o);
efl_key_data_set(top, "__delayed_focus_set", NULL);
- if (!m)
- {
- //delayed focusung
- efl_key_data_set(top, "__delayed_focus_set", user);
- efl_event_callback_add(user, EFL_UI_FOCUS_USER_EVENT_MANAGER_CHANGED, _manager_changed, user);
- return;
- }
+ registered_manager = m = efl_ui_focus_object_focus_manager_get(user);
+ entry = user;
- efl_ui_focus_manager_focus_set(m, user);
+ do {
+ //check if the root of a manager is the window root, set focus to this object in the manager than
+ entry = efl_ui_focus_manager_root_get(m);
+ if (efl_isa(m, EFL_UI_WIN_CLASS))
+ {
+ //we are at the root of the window, we can set the focus to the object
+ efl_ui_focus_manager_focus_set(registered_manager, user);
+ return;
+ }
+
+ //if there is no manager yet, delay the focus setting until this entity gets registered for one chain
+ m = efl_ui_focus_object_focus_manager_get(entry);
+ if (!m)
+ {
+ //delayed focusung
+ efl_key_data_set(top, "__delayed_focus_set", entry);
+ efl_event_callback_add(entry, EFL_UI_FOCUS_OBJECT_EVENT_MANAGER_CHANGED, _manager_changed, user);
+ return;
+ }
+ } while (m);
+}
+
+EOLIAN static Efl_Ui_Focus_Manager*
+_efl_ui_focus_util_active_manager(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Efl_Ui_Focus_Manager *manager)
+{
+ while (efl_ui_focus_manager_redirect_get(manager))
+ manager = efl_ui_focus_manager_redirect_get(manager);
+
+ return manager;
+}
+
+EOLIAN static Efl_Ui_Focus_Direction
+_efl_ui_focus_util_direction_complement(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Efl_Ui_Focus_Direction dir)
+{
+ #define COMP(a,b) \
+ if (dir == a) return b; \
+ if (dir == b) return a;
+
+ COMP(EFL_UI_FOCUS_DIRECTION_RIGHT, EFL_UI_FOCUS_DIRECTION_LEFT)
+ COMP(EFL_UI_FOCUS_DIRECTION_UP, EFL_UI_FOCUS_DIRECTION_DOWN)
+ COMP(EFL_UI_FOCUS_DIRECTION_PREVIOUS, EFL_UI_FOCUS_DIRECTION_NEXT)
+
+ #undef COMP
+
+ return EFL_UI_FOCUS_DIRECTION_LAST;
}
+
#include "efl_ui_focus_util.eo.c"
diff --git a/src/lib/elementary/efl_ui_focus_util.eo b/src/lib/elementary/efl_ui_focus_util.eo
index 651193b10f..fdf270874d 100644
--- a/src/lib/elementary/efl_ui_focus_util.eo
+++ b/src/lib/elementary/efl_ui_focus_util.eo
@@ -7,5 +7,18 @@ class Efl.Ui.Focus.Util(Efl.Object) {
focus_elem : Efl.Ui.Focus.Object; [[Focus element]]
}
}
+ active_manager @class {
+ [[Get the highest manager in the redirect property]]
+ params {
+ manager : Efl.Ui.Focus.Manager;
+ }
+ return: Efl.Ui.Focus.Manager;
+ }
+ direction_complement @class {
+ params {
+ dir : Efl.Ui.Focus.Direction;
+ }
+ return: Efl.Ui.Focus.Direction;
+ }
}
}
diff --git a/src/lib/elementary/efl_ui_frame.c b/src/lib/elementary/efl_ui_frame.c
index 234812d928..686fdc6cc1 100644
--- a/src/lib/elementary/efl_ui_frame.c
+++ b/src/lib/elementary/efl_ui_frame.c
@@ -2,8 +2,9 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define ELM_LAYOUT_PROTECTED
+#define EFL_PART_PROTECTED
#include <Elementary.h>
#include "elm_priv.h"
@@ -14,7 +15,6 @@
#define MY_CLASS EFL_UI_FRAME_CLASS
#define MY_CLASS_PFX efl_ui_frame
#define MY_CLASS_NAME "Efl.Ui.Frame"
-#define MY_CLASS_NAME_LEGACY "elm_frame"
static const char SIG_CLICKED[] = "clicked";
@@ -25,18 +25,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-static const Elm_Layout_Part_Alias_Description _content_aliases[] =
-{
- {"default", "elm.swallow.content"},
- {NULL, NULL}
-};
-
-static const Elm_Layout_Part_Alias_Description _text_aliases[] =
-{
- {"default", "elm.text"},
- {NULL, NULL}
-};
-
static void
_sizing_eval(Evas_Object *obj,
Efl_Ui_Frame_Data *sd EINA_UNUSED)
@@ -89,7 +77,12 @@ _on_frame_clicked(void *data,
if (sd->collapsible)
{
efl_event_callback_add(wd->resize_obj, EFL_LAYOUT_EVENT_RECALC, _recalc, data);
- elm_layout_signal_emit(data, "elm,action,toggle", "elm");
+
+ if (elm_widget_is_legacy(data))
+ elm_layout_signal_emit(data, "elm,action,toggle", "elm");
+ else
+ elm_layout_signal_emit(data, "efl,action,toggle", "efl");
+
sd->collapsed++;
sd->anim = EINA_TRUE;
elm_widget_tree_unfocusable_set(data, sd->collapsed);
@@ -122,12 +115,24 @@ _efl_ui_frame_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Frame_Data *_pd EINA_UN
efl_canvas_group_add(efl_super(obj, MY_CLASS));
elm_widget_sub_object_parent_add(obj);
- edje_object_signal_callback_add
- (wd->resize_obj, "elm,anim,done", "elm",
- _on_recalc_done, obj);
- edje_object_signal_callback_add
- (wd->resize_obj, "elm,action,click", "elm",
- _on_frame_clicked, obj);
+ if (elm_widget_is_legacy(obj))
+ {
+ edje_object_signal_callback_add
+ (wd->resize_obj, "elm,anim,done", "elm",
+ _on_recalc_done, obj);
+ edje_object_signal_callback_add
+ (wd->resize_obj, "elm,action,click", "elm",
+ _on_frame_clicked, obj);
+ }
+ else
+ {
+ edje_object_signal_callback_add
+ (wd->resize_obj, "efl,anim,done", "efl",
+ _on_recalc_done, obj);
+ edje_object_signal_callback_add
+ (wd->resize_obj, "efl,action,click", "efl",
+ _on_frame_clicked, obj);
+ }
elm_widget_can_focus_set(obj, EINA_FALSE);
@@ -140,20 +145,12 @@ _efl_ui_frame_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Frame_Data *_pd EINA_UN
elm_layout_sizing_eval(obj);
}
-EAPI Evas_Object *
-elm_frame_add(Evas_Object *parent)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return elm_legacy_add(MY_CLASS, parent);
-}
-
EOLIAN static Eo *
_efl_ui_frame_efl_object_constructor(Eo *obj, Efl_Ui_Frame_Data *_pd EINA_UNUSED)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
- efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_FRAME);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_FRAME);
return obj;
}
@@ -166,7 +163,7 @@ _efl_ui_frame_autocollapse_set(Eo *obj EINA_UNUSED, Efl_Ui_Frame_Data *sd, Eina_
}
EOLIAN static Eina_Bool
-_efl_ui_frame_autocollapse_get(Eo *obj EINA_UNUSED, Efl_Ui_Frame_Data *sd)
+_efl_ui_frame_autocollapse_get(const Eo *obj EINA_UNUSED, Efl_Ui_Frame_Data *sd)
{
return sd->collapsible;
}
@@ -179,7 +176,11 @@ _efl_ui_frame_collapse_set(Eo *obj, Efl_Ui_Frame_Data *sd, Eina_Bool collapse)
collapse = !!collapse;
if (sd->collapsed == collapse) return;
- elm_layout_signal_emit(obj, "elm,action,switch", "elm");
+ if (elm_widget_is_legacy(obj))
+ elm_layout_signal_emit(obj, "elm,action,switch", "elm");
+ else
+ elm_layout_signal_emit(obj, "efl,action,switch", "efl");
+
edje_object_message_signal_process(wd->resize_obj);
sd->collapsed = !!collapse;
sd->anim = EINA_FALSE;
@@ -196,7 +197,11 @@ _efl_ui_frame_collapse_go(Eo *obj, Efl_Ui_Frame_Data *sd, Eina_Bool collapse)
collapse = !!collapse;
if (sd->collapsed == collapse) return;
- elm_layout_signal_emit(obj, "elm,action,toggle", "elm");
+ if (elm_widget_is_legacy(obj))
+ elm_layout_signal_emit(obj, "elm,action,toggle", "elm");
+ else
+ elm_layout_signal_emit(obj, "efl,action,toggle", "efl");
+
efl_event_callback_legacy_call
(wd->resize_obj, EFL_LAYOUT_EVENT_RECALC, obj);
sd->collapsed = collapse;
@@ -205,33 +210,45 @@ _efl_ui_frame_collapse_go(Eo *obj, Efl_Ui_Frame_Data *sd, Eina_Bool collapse)
}
EOLIAN static Eina_Bool
-_efl_ui_frame_collapse_get(Eo *obj EINA_UNUSED, Efl_Ui_Frame_Data *sd)
+_efl_ui_frame_collapse_get(const Eo *obj EINA_UNUSED, Efl_Ui_Frame_Data *sd)
{
return sd->collapsed;
}
-EOLIAN static void
-_efl_ui_frame_class_constructor(Efl_Class *klass)
-{
- evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
-}
-
-/* Default text (title) and content */
+/* Internal EO APIs and hidden overrides */
ELM_PART_TEXT_DEFAULT_IMPLEMENT(efl_ui_frame, Efl_Ui_Frame_Data)
ELM_PART_MARKUP_DEFAULT_IMPLEMENT(efl_ui_frame, Efl_Ui_Frame_Data)
-ELM_PART_CONTENT_DEFAULT_GET(efl_ui_frame, "elm.swallow.content")
ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_frame, Efl_Ui_Frame_Data)
-/* Internal EO APIs and hidden overrides */
-
-ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(efl_ui_frame)
-ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(efl_ui_frame)
-
#define EFL_UI_FRAME_EXTRA_OPS \
- EFL_CANVAS_GROUP_ADD_OPS(efl_ui_frame), \
- ELM_LAYOUT_CONTENT_ALIASES_OPS(efl_ui_frame), \
- ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_frame), \
- ELM_LAYOUT_TEXT_ALIASES_OPS(efl_ui_frame)
+ EFL_CANVAS_GROUP_ADD_OPS(efl_ui_frame)
#include "efl_ui_frame.eo.c"
+
+#include "efl_ui_frame_legacy.eo.h"
+
+#define MY_CLASS_NAME_LEGACY "elm_frame"
+
+static void
+_efl_ui_frame_legacy_class_constructor(Efl_Class *klass)
+{
+ evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
+}
+
+EOLIAN static Eo *
+_efl_ui_frame_legacy_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED)
+{
+ obj = efl_constructor(efl_super(obj, EFL_UI_FRAME_LEGACY_CLASS));
+ efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
+ return obj;
+}
+
+EAPI Evas_Object *
+elm_frame_add(Evas_Object *parent)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ return elm_legacy_add(EFL_UI_FRAME_LEGACY_CLASS, parent);
+}
+
+#include "efl_ui_frame_legacy.eo.c"
diff --git a/src/lib/elementary/efl_ui_frame.eo b/src/lib/elementary/efl_ui_frame.eo
index 557e475e52..dd2d25cd9a 100644
--- a/src/lib/elementary/efl_ui_frame.eo
+++ b/src/lib/elementary/efl_ui_frame.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Frame (Efl.Ui.Layout, Efl.Ui.Clickable, Efl.Text, Efl.Text.Markup,
+class Efl.Ui.Frame (Efl.Ui.Layout.Object, Efl.Ui.Clickable, Efl.Text, Efl.Text_Markup,
Efl.Ui.Translatable, Efl.Content)
{
[[Frame widget
@@ -55,10 +55,9 @@ class Efl.Ui.Frame (Efl.Ui.Layout, Efl.Ui.Clickable, Efl.Text, Efl.Text.Markup,
}
implements {
Efl.Object.constructor;
- class.constructor;
Efl.Canvas.Group.group_calculate;
Efl.Text.text { get; set; }
- Efl.Text.Markup.markup { get; set; }
+ Efl.Text_Markup.markup { get; set; }
Efl.Ui.Translatable.translatable_text { get; set; }
Efl.Content.content { get; set; }
Efl.Content.content_unset;
diff --git a/src/lib/elementary/efl_ui_frame_legacy.eo b/src/lib/elementary/efl_ui_frame_legacy.eo
new file mode 100644
index 0000000000..02393c5fc8
--- /dev/null
+++ b/src/lib/elementary/efl_ui_frame_legacy.eo
@@ -0,0 +1,14 @@
+class Efl.Ui.Frame_Legacy (Efl.Ui.Frame, Efl.Ui.Legacy)
+{
+ [[Frame widget
+
+ The Frame widget allows for collapsing and expanding the content widget
+ by clicking on the frame label.
+ the label and content can be set using text_set and content_set api.
+ ]]
+ data: null;
+ implements {
+ Efl.Object.constructor;
+ class.constructor;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_frame_legacy.h b/src/lib/elementary/efl_ui_frame_legacy.h
index 3a1f89b233..7e96f12e30 100644
--- a/src/lib/elementary/efl_ui_frame_legacy.h
+++ b/src/lib/elementary/efl_ui_frame_legacy.h
@@ -1,3 +1,5 @@
+typedef Eo Elm_Frame;
+
/**
* @brief Add a new frame to the parent
*
@@ -8,4 +10,4 @@
*/
EAPI Evas_Object *elm_frame_add(Evas_Object *parent);
-#include "efl_ui_frame.eo.legacy.h" \ No newline at end of file
+#include "efl_ui_frame.eo.legacy.h"
diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c
index a807fa536b..9d83ce37f8 100644
--- a/src/lib/elementary/efl_ui_image.c
+++ b/src/lib/elementary/efl_ui_image.c
@@ -3,7 +3,8 @@
#endif
#define EFL_ACCESS_IMAGE_PROTECTED
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
+#define EFL_ACCESS_COMPONENT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define EFL_LAYOUT_CALC_PROTECTED
@@ -16,7 +17,6 @@
#define MY_CLASS EFL_UI_IMAGE_CLASS
#define MY_CLASS_NAME "Efl.Ui.Image"
-#define MY_CLASS_NAME_LEGACY "elm_image"
#define NON_EXISTING (void *)-1
static const char *icon_theme = NULL;
@@ -181,15 +181,15 @@ _image_sizing_eval(Efl_Ui_Image_Data *sd, Evas_Object *img)
// according to (iw x ih), (sd->img_w x sd->img_h), and scale_type
switch (sd->scale_type)
{
- case EFL_IMAGE_SCALE_TYPE_NONE:
+ case EFL_GFX_IMAGE_SCALE_TYPE_NONE:
w = iw;
h = ih;
break;
- case EFL_IMAGE_SCALE_TYPE_FILL:
+ case EFL_GFX_IMAGE_SCALE_TYPE_FILL:
w = sd->img_w;
h = sd->img_h;
break;
- case EFL_IMAGE_SCALE_TYPE_FIT_INSIDE:
+ case EFL_GFX_IMAGE_SCALE_TYPE_FIT_INSIDE:
w = sd->img_w;
h = ((double)ih * w) / (double)iw;
@@ -206,7 +206,7 @@ _image_sizing_eval(Efl_Ui_Image_Data *sd, Evas_Object *img)
h = ih;
}
break;
- case EFL_IMAGE_SCALE_TYPE_FIT_OUTSIDE:
+ case EFL_GFX_IMAGE_SCALE_TYPE_FIT_OUTSIDE:
w = sd->img_w;
h = ((double)ih * w) / (double)iw;
if (h < sd->img_h)
@@ -222,7 +222,7 @@ _image_sizing_eval(Efl_Ui_Image_Data *sd, Evas_Object *img)
h = ih;
}
break;
- case EFL_IMAGE_SCALE_TYPE_TILE:
+ case EFL_GFX_IMAGE_SCALE_TYPE_TILE:
x = sd->img_x;
y = sd->img_y;
w = sd->img_w;
@@ -518,20 +518,20 @@ _efl_ui_image_edje_file_set(Evas_Object *obj,
return _efl_ui_image_async_file_set(obj, sd, file, f, group);
/* FIXME: do i want to update icon on file change ? */
- _efl_ui_image_internal_sizing_eval(obj, sd);
+ _efl_ui_image_sizing_eval(obj);
return EINA_TRUE;
}
EOLIAN static void
-_efl_ui_image_efl_image_smooth_scale_set(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd, Eina_Bool smooth)
+_efl_ui_image_efl_gfx_image_smooth_scale_set(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd, Eina_Bool smooth)
{
sd->smooth = smooth;
if (!sd->edje) evas_object_image_smooth_scale_set(sd->img, smooth);
}
EOLIAN static Eina_Bool
-_efl_ui_image_efl_image_smooth_scale_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
+_efl_ui_image_efl_gfx_image_smooth_scale_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
{
return sd->smooth;
}
@@ -594,7 +594,7 @@ EOLIAN static void
_efl_ui_image_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Image_Data *sd)
{
if (elm_widget_is_legacy(obj))
- efl_event_callback_del(obj, EFL_GFX_EVENT_CHANGE_SIZE_HINTS,
+ efl_event_callback_del(obj, EFL_GFX_ENTITY_EVENT_CHANGE_SIZE_HINTS,
_on_size_hints_changed, sd);
ecore_timer_del(sd->anim_timer);
evas_object_del(sd->img);
@@ -604,41 +604,35 @@ _efl_ui_image_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Image_Data *sd)
if (sd->remote.binbuf) ELM_SAFE_FREE(sd->remote.binbuf, eina_binbuf_free);
ELM_SAFE_FREE(sd->remote.key, eina_stringshare_del);
- if (sd->pfuture)
- {
- efl_future_cancel(sd->pfuture);
- sd->pfuture = NULL;
- }
-
- if (sd->model)
+ if (sd->property.model)
{
- efl_event_callback_del(sd->model, EFL_MODEL_EVENT_PROPERTIES_CHANGED,
- _efl_ui_image_model_properties_changed_cb, obj);
- efl_unref(sd->model);
- sd->model = NULL;
+ efl_event_callback_del(sd->property.model, EFL_MODEL_EVENT_PROPERTIES_CHANGED,
+ _efl_ui_image_model_properties_changed_cb, obj);
+ efl_unref(sd->property.model);
+ sd->property.model = NULL;
}
efl_canvas_group_del(efl_super(obj, MY_CLASS));
}
EOLIAN static void
-_efl_ui_image_efl_gfx_position_set(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Position2D pos)
+_efl_ui_image_efl_gfx_entity_position_set(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Position2D pos)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
- efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
if ((sd->img_x == pos.x) && (sd->img_y == pos.y)) return;
sd->img_x = pos.x;
sd->img_y = pos.y;
/* takes care of moving */
- _efl_ui_image_internal_sizing_eval(obj, sd);
+ _efl_ui_image_sizing_eval(obj);
}
EOLIAN static void
-_efl_ui_image_efl_gfx_size_set(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Size2D sz)
+_efl_ui_image_efl_gfx_entity_size_set(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Size2D sz)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
@@ -649,10 +643,10 @@ _efl_ui_image_efl_gfx_size_set(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Size2D sz)
sd->img_h = sz.h;
/* takes care of resizing */
- _efl_ui_image_internal_sizing_eval(obj, sd);
+ _efl_ui_image_sizing_eval(obj);
super:
- efl_gfx_size_set(efl_super(obj, MY_CLASS), sz);
+ efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
}
static void
@@ -660,10 +654,10 @@ _efl_ui_image_show(Eo *obj, Efl_Ui_Image_Data *sd)
{
sd->show = EINA_TRUE;
- efl_gfx_visible_set(efl_super(obj, MY_CLASS), EINA_TRUE);
+ efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), EINA_TRUE);
if (sd->preload_status == EFL_UI_IMAGE_PRELOADING) return;
- efl_gfx_visible_set(sd->img, EINA_TRUE);
+ efl_gfx_entity_visible_set(sd->img, EINA_TRUE);
_prev_img_del(sd);
}
@@ -671,13 +665,13 @@ static void
_efl_ui_image_hide(Eo *obj, Efl_Ui_Image_Data *sd)
{
sd->show = EINA_FALSE;
- efl_gfx_visible_set(efl_super(obj, MY_CLASS), EINA_FALSE);
- efl_gfx_visible_set(sd->img, EINA_FALSE);
+ efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), EINA_FALSE);
+ efl_gfx_entity_visible_set(sd->img, EINA_FALSE);
_prev_img_del(sd);
}
EOLIAN static void
-_efl_ui_image_efl_gfx_visible_set(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Bool vis)
+_efl_ui_image_efl_gfx_entity_visible_set(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Bool vis)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 0, vis))
return;
@@ -721,7 +715,7 @@ _efl_ui_image_efl_canvas_object_clip_set(Eo *obj, Efl_Ui_Image_Data *sd, Evas_Ob
}
EOLIAN static Efl_Ui_Theme_Apply
-_efl_ui_image_elm_widget_theme_apply(Eo *obj, Efl_Ui_Image_Data *sd EINA_UNUSED)
+_efl_ui_image_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Image_Data *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
@@ -762,12 +756,12 @@ _efl_ui_image_sizing_eval(Evas_Object *obj)
EFL_UI_IMAGE_DATA_GET_OR_RETURN(obj, sd);
_efl_ui_image_internal_sizing_eval(obj, sd);
- efl_image_smooth_scale_set(obj, sd->smooth);
+ efl_gfx_image_smooth_scale_set(obj, sd->smooth);
if (sd->no_scale)
_efl_ui_image_internal_scale_set(obj, sd, 1.0);
else
- _efl_ui_image_internal_scale_set(obj, sd, efl_gfx_scale_get(obj) * elm_config_scale_get());
+ _efl_ui_image_internal_scale_set(obj, sd, efl_gfx_entity_scale_get(obj) * elm_config_scale_get());
ts = sd->scale;
sd->scale = 1.0;
@@ -845,32 +839,19 @@ _efl_ui_image_file_set_do(Evas_Object *obj)
}
static void
-_on_size_hints_changed(void *data, const Efl_Event *ev)
-{
- _efl_ui_image_internal_sizing_eval(ev->object, data);
-}
-
-EAPI Evas_Object *
-elm_image_add(Evas_Object *parent)
+_on_size_hints_changed(void *data EINA_UNUSED, const Efl_Event *ev)
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- Evas_Object *obj = elm_legacy_add(MY_CLASS, parent);
- EFL_UI_IMAGE_DATA_GET(obj, priv);
-
- efl_event_callback_add(obj, EFL_GFX_EVENT_CHANGE_SIZE_HINTS, _on_size_hints_changed, priv);
-
- return obj;
+ _efl_ui_image_sizing_eval(ev->object);
}
EOLIAN static Eo *
_efl_ui_image_efl_object_constructor(Eo *obj, Efl_Ui_Image_Data *pd)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
- efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_IMAGE);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_IMAGE);
- pd->scale_type = EFL_IMAGE_SCALE_TYPE_FIT_INSIDE;
+ pd->scale_type = EFL_GFX_IMAGE_SCALE_TYPE_FIT_INSIDE;
pd->self = obj;
return obj;
@@ -946,7 +927,7 @@ _efl_ui_image_smart_internal_file_set(Eo *obj, Efl_Ui_Image_Data *sd,
evas_object_image_preload(sd->img, EINA_FALSE);
}
- _efl_ui_image_internal_sizing_eval(obj, sd);
+ _efl_ui_image_sizing_eval(obj);
return EINA_TRUE;
}
@@ -964,7 +945,7 @@ _efl_ui_image_remote_copier_cancel(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
Eo *copier = sd->remote.copier;
if (!copier) return;
- /* copier is flagged as close_on_destructor, thus:
+ /* copier is flagged as close_on_invalidate, thus:
* efl_del()
* -> efl_io_closer_close()
* -> "done" event
@@ -1075,7 +1056,7 @@ _efl_ui_image_download(Eo *obj, Efl_Ui_Image_Data *sd, const char *url, const ch
sd->remote.copier = efl_add(EFL_IO_COPIER_CLASS, obj,
efl_io_copier_source_set(efl_added, dialer),
- efl_io_closer_close_on_destructor_set(efl_added, EINA_TRUE),
+ efl_io_closer_close_on_invalidate_set(efl_added, EINA_TRUE),
efl_event_callback_array_add(efl_added, _efl_ui_image_remote_copier_cbs(), obj));
EINA_SAFETY_ON_NULL_GOTO(sd->remote.copier, error_copier);
eina_stringshare_replace(&sd->remote.key, key);
@@ -1143,11 +1124,11 @@ _efl_ui_image_efl_file_file_set(Eo *obj, Efl_Ui_Image_Data *sd, const char *file
sd->anim = EINA_FALSE;
}
- if (!file && !sd->prev_img) return EINA_FALSE;
- else if (!file && sd->prev_img)
+ if (!file)
{
- _prev_img_del(sd);
- return EINA_TRUE;
+ if (sd->prev_img)
+ _prev_img_del(sd);
+ return _efl_ui_image_smart_internal_file_set(obj, sd, file, NULL, key);;
}
if (_efl_ui_image_is_remote(file))
@@ -1176,7 +1157,7 @@ _efl_ui_image_efl_layout_signal_signal_emit(Eo *obj EINA_UNUSED, Efl_Ui_Image_Da
}
EOLIAN static Eina_Size2D
-_efl_ui_image_efl_layout_group_group_size_min_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
+_efl_ui_image_efl_layout_group_group_size_min_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
{
if (sd->edje)
return efl_layout_group_size_min_get(sd->img);
@@ -1185,7 +1166,7 @@ _efl_ui_image_efl_layout_group_group_size_min_get(Eo *obj EINA_UNUSED, Efl_Ui_Im
}
EOLIAN static Eina_Size2D
-_efl_ui_image_efl_layout_group_group_size_max_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
+_efl_ui_image_efl_layout_group_group_size_max_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
{
if (sd->edje)
return efl_layout_group_size_max_get(sd->img);
@@ -1213,7 +1194,7 @@ _efl_ui_image_efl_layout_calc_calc_size_min(Eo *obj EINA_UNUSED, Efl_Ui_Image_Da
}
EOLIAN static void
-_efl_ui_image_efl_file_file_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd, const char **file, const char **key)
+_efl_ui_image_efl_file_file_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd, const char **file, const char **key)
{
if (sd->async.th)
{
@@ -1257,7 +1238,7 @@ elm_image_async_open_set(Eo *obj, Eina_Bool async)
}
EOLIAN static Eina_Size2D
-_efl_ui_image_efl_gfx_view_view_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
+_efl_ui_image_efl_gfx_view_view_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
{
int tw, th;
@@ -1270,12 +1251,12 @@ _efl_ui_image_efl_gfx_view_view_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data
}
EOLIAN static Eina_Size2D
-_efl_ui_image_efl_image_image_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
+_efl_ui_image_efl_gfx_image_image_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
{
if (sd->edje)
return EINA_SIZE2D(0, 0);
- return efl_image_size_get(sd->img);
+ return efl_gfx_image_size_get(sd->img);
}
EAPI void
@@ -1283,11 +1264,11 @@ elm_image_prescale_set(Evas_Object *obj,
int size)
{
EFL_UI_IMAGE_CHECK(obj);
- efl_image_load_size_set(obj, EINA_SIZE2D(size, size));
+ efl_gfx_image_load_controller_load_size_set(obj, EINA_SIZE2D(size, size));
}
EOLIAN static void
-_efl_ui_image_efl_image_load_load_size_set(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Size2D sz)
+_efl_ui_image_efl_gfx_image_load_controller_load_size_set(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Size2D sz)
{
sd->load_size = sz;
_efl_ui_image_load_size_set_internal(obj, sd);
@@ -1299,13 +1280,13 @@ elm_image_prescale_get(const Evas_Object *obj)
Eina_Size2D sz;
EFL_UI_IMAGE_CHECK(obj) 0;
- sz = efl_image_load_size_get(obj);
+ sz = efl_gfx_image_load_controller_load_size_get(obj);
return MAX(sz.w, sz.h);
}
EOLIAN static Eina_Size2D
-_efl_ui_image_efl_image_load_load_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
+_efl_ui_image_efl_gfx_image_load_controller_load_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
{
return sd->load_size;
}
@@ -1319,30 +1300,30 @@ _efl_ui_image_efl_orientation_orientation_set(Eo *obj, Efl_Ui_Image_Data *sd, Ef
efl_orientation_set(sd->img, orient);
sd->orient = orient;
- _efl_ui_image_internal_sizing_eval(obj, sd);
+ _efl_ui_image_sizing_eval(obj);
}
EOLIAN static Efl_Orient
-_efl_ui_image_efl_orientation_orientation_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
+_efl_ui_image_efl_orientation_orientation_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
{
return sd->orient;
}
EOLIAN static void
-_efl_ui_image_efl_flipable_flip_set(Eo *obj, Efl_Ui_Image_Data *sd, Efl_Flip flip)
+_efl_ui_image_efl_orientation_flip_set(Eo *obj, Efl_Ui_Image_Data *sd, Efl_Flip flip)
{
if (sd->edje) return;
if (sd->flip == flip) return;
- efl_flip_set(sd->img, flip);
+ efl_orientation_flip_set(sd->img, flip);
sd->flip = flip;
- _efl_ui_image_internal_sizing_eval(obj, sd);
+ _efl_ui_image_sizing_eval(obj);
}
EOLIAN static Efl_Flip
-_efl_ui_image_efl_flipable_flip_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
+_efl_ui_image_efl_orientation_flip_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
{
return sd->flip;
}
@@ -1382,7 +1363,7 @@ _efl_ui_image_efl_ui_draggable_drag_target_set(Eo *obj, Efl_Ui_Image_Data *sd, E
}
EOLIAN static Eina_Bool
-_efl_ui_image_efl_ui_draggable_drag_target_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
+_efl_ui_image_efl_ui_draggable_drag_target_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
{
return sd->edit;
}
@@ -1394,7 +1375,7 @@ elm_image_animated_available_get(const Evas_Object *obj)
}
EOLIAN static Eina_Bool
-_efl_ui_image_efl_player_playable_get(Eo *obj, Efl_Ui_Image_Data *sd)
+_efl_ui_image_efl_player_playable_get(const Eo *obj, Efl_Ui_Image_Data *sd)
{
if (sd->edje) return EINA_TRUE;
@@ -1513,29 +1494,23 @@ _efl_ui_image_efl_player_play_set(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Bool play
}
EOLIAN static Eina_Bool
-_efl_ui_image_efl_player_play_get(Eo *obj, Efl_Ui_Image_Data *sd)
+_efl_ui_image_efl_player_play_get(const Eo *obj, Efl_Ui_Image_Data *sd)
{
return _efl_ui_image_animated_play_get_internal(obj, sd);
}
-static void
-_efl_ui_image_class_constructor(Efl_Class *klass)
-{
- evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
-}
-
EOLIAN static void
-_efl_ui_image_efl_image_scale_type_set(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd EINA_UNUSED, Efl_Image_Scale_Type scale_type)
+_efl_ui_image_efl_gfx_image_scale_type_set(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd EINA_UNUSED, Efl_Gfx_Image_Scale_Type scale_type)
{
if (scale_type == sd->scale_type) return;
sd->scale_type = scale_type;
- _efl_ui_image_internal_sizing_eval(obj, sd);
+ _efl_ui_image_sizing_eval(obj);
}
-EOLIAN static Efl_Image_Scale_Type
-_efl_ui_image_efl_image_scale_type_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
+EOLIAN static Efl_Gfx_Image_Scale_Type
+_efl_ui_image_efl_gfx_image_scale_type_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
{
return sd->scale_type;
}
@@ -1548,11 +1523,11 @@ _efl_ui_image_scalable_set(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Bool up, Eina_Bo
sd->scale_up = !!up;
sd->scale_down = !!down;
- _efl_ui_image_internal_sizing_eval(obj, sd);
+ _efl_ui_image_sizing_eval(obj);
}
EOLIAN static void
-_efl_ui_image_scalable_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd, Eina_Bool *scale_up, Eina_Bool *scale_down)
+_efl_ui_image_scalable_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd, Eina_Bool *scale_up, Eina_Bool *scale_down)
{
if (scale_up) *scale_up = sd->scale_up;
if (scale_down) *scale_down = sd->scale_down;
@@ -1576,11 +1551,11 @@ _efl_ui_image_align_set(Eo *obj, Efl_Ui_Image_Data *sd, double align_x, double a
sd->align_x = align_x;
sd->align_y = align_y;
- _efl_ui_image_internal_sizing_eval(obj, sd);
+ _efl_ui_image_sizing_eval(obj);
}
EOLIAN static void
-_efl_ui_image_align_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd, double *align_x, double *align_y)
+_efl_ui_image_align_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd, double *align_x, double *align_y)
{
if (align_x) *align_x = sd->align_x;
if (align_y) *align_y = sd->align_y;
@@ -1588,27 +1563,31 @@ _efl_ui_image_align_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd, double *alig
// A11Y
-EOLIAN static void
-_efl_ui_image_efl_access_image_extents_get(Eo *obj, Efl_Ui_Image_Data *sd EINA_UNUSED, Eina_Bool screen_coords, int *x, int *y, int *w, int *h)
+EOLIAN static Eina_Rect
+_efl_ui_image_efl_access_component_extents_get(const Eo *obj, Efl_Ui_Image_Data *sd EINA_UNUSED, Eina_Bool screen_coords)
{
int ee_x, ee_y;
+ Eina_Rect r;
Evas_Object *image = elm_image_object_get(obj);
- if (!image) return;
- evas_object_geometry_get(image, x, y, NULL, NULL);
+ r.x = r.y = r.w = r.h = -1;
+ if (!image) return r;
+
+ evas_object_geometry_get(image, &r.x, &r.y, NULL, NULL);
if (screen_coords)
{
Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(image));
- if (!ee) return;
+ if (!ee) return r;
ecore_evas_geometry_get(ee, &ee_x, &ee_y, NULL, NULL);
- if (x) *x += ee_x;
- if (y) *y += ee_y;
+ r.x += ee_x;
+ r.y += ee_y;
}
- elm_image_object_size_get(obj, w, h);
+ elm_image_object_size_get(obj, &r.w, &r.h);
+ return r;
}
EOLIAN const Efl_Access_Action_Data *
-_efl_ui_image_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd EINA_UNUSED)
+_efl_ui_image_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "activate", "activate", NULL, _key_action_activate },
@@ -1786,167 +1765,117 @@ _efl_ui_image_icon_set(Eo *obj, Efl_Ui_Image_Data *_pd EINA_UNUSED, const char *
}
EOLIAN static const char*
-_efl_ui_image_icon_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
+_efl_ui_image_icon_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
{
return sd->stdicon;
}
-static void
-_prop_future_error_cb(void* data, Efl_Event const* event EINA_UNUSED)
+void
+_update_viewmodel(Eo *obj, Efl_Ui_Image_Data *pd)
{
- Eo *obj = data;
- EFL_UI_IMAGE_DATA_GET(obj, pd);
- pd->pfuture = NULL;
-}
+ Eina_Value *vfile = NULL;
+ Eina_Value *vkey = NULL;
+ Eina_File *f = NULL;
+ char *file = NULL;
+ char *key = NULL;
-static void
-_prop_key_future_then_cb(void* data, Efl_Event const * event)
-{
- Eo *obj = data;
- Eina_Accessor *acc = (Eina_Accessor *)((Efl_Future_Event_Success*)event->info)->value;
- Eina_Value *value;
- char *filename, *key;
+ if (!pd->property.model) return ;
- EFL_UI_IMAGE_DATA_GET(obj, pd);
- pd->pfuture = NULL;
+ vfile = efl_model_property_get(pd->property.model, pd->property.file);
+ if (!vfile) return;
+ vkey = efl_model_property_get(pd->property.model, pd->property.key);
- if (eina_accessor_data_get(acc, 0, (void **)&value) && value)
- {
- filename = eina_value_to_string(value);
- }
- else return;
+ if (eina_value_type_get(vfile) == EINA_VALUE_TYPE_ERROR)
+ goto err;
- if (eina_accessor_data_get(acc, 1, (void **)&value) && value)
+ if (pd->property.icon)
{
- key = eina_value_to_string(value);
+ file = eina_value_to_string(vfile);
+
+ efl_ui_image_icon_set(obj, file);
}
else
{
- free(filename);
- return;
- }
-
- elm_image_file_set(obj, filename, key);
- free(filename);
- free(key);
-}
-
-static void
-_prop_future_then_cb(void* data, Efl_Event const * event)
-{
- Eo *obj = data;
- Eina_Value *value = (Eina_Value*)((Efl_Future_Event_Success*)event->info)->value;
- char *text;
- EFL_UI_IMAGE_DATA_GET(obj, pd);
- pd->pfuture = NULL;
+ if (vkey && eina_value_type_get(vkey) != EINA_VALUE_TYPE_ERROR)
+ key = eina_value_to_string(vkey);
+ if (eina_value_type_get(vfile) == EINA_VALUE_TYPE_FILE)
+ {
+ eina_value_get(vfile, &f);
- const Eina_Value_Type *vtype = eina_value_type_get(value);
+ efl_file_mmap_set(obj, f, key);
+ }
+ else
+ {
+ file = eina_value_to_string(vfile);
- if (vtype == EINA_VALUE_TYPE_STRING || vtype == EINA_VALUE_TYPE_STRINGSHARE)
- {
- eina_value_get(value, &text);
- if (pd->con_icon) efl_ui_image_icon_set(obj, text);
- else elm_image_file_set(obj, text, NULL);
- }
- else
- {
- text = eina_value_to_string(value);
- if (pd->con_icon) efl_ui_image_icon_set(obj, text);
- else elm_image_file_set(obj, text, NULL);
- free(text);
+ efl_file_set(obj, file, key);
+ }
}
-}
-void
-_update_viewmodel(Eo *obj, Efl_Ui_Image_Data *pd)
-{
- if (pd->model && pd->prop_con)
- {
- if (pd->pfuture) efl_future_cancel(pd->pfuture);
-
- pd->pfuture = efl_model_property_get(pd->model, pd->prop_con);
-
- if (pd->prop_key)
- {
- const Eina_Array *properties;
- Eina_Array_Iterator it;
- char *property;
- unsigned int i = 0;
-
- properties = efl_model_properties_get(pd->model);
- EINA_ARRAY_ITER_NEXT(properties, i, property, it)
- {
- if (strcmp(property, pd->prop_key) == 0)
- {
- Efl_Future *futures[2] = {NULL,};
- futures[0] = pd->pfuture;
- futures[1] = efl_model_property_get(pd->model, pd->prop_key);
- pd->pfuture = efl_future_all(futures[0], futures[1]);
- efl_future_then(pd->pfuture, &_prop_key_future_then_cb,
- &_prop_future_error_cb, NULL, obj);
- return;
- }
- }
- }
-
- efl_future_then(pd->pfuture, &_prop_future_then_cb,
- &_prop_future_error_cb, NULL, obj);
- }
+ free(file);
+ free(key);
+err:
+ eina_value_free(vfile);
+ eina_value_free(vkey);
}
static void
_efl_ui_image_model_properties_changed_cb(void *data, const Efl_Event *event)
{
Efl_Model_Property_Event *evt = event->info;
+ Eina_Array_Iterator it;
Eo *obj = data;
+ const char *prop;
+ unsigned int i;
+ Eina_Bool refresh = EINA_FALSE;
EFL_UI_IMAGE_DATA_GET(obj, pd);
if (!evt->changed_properties)
return;
- if (pd->model && pd->prop_con)
+ EINA_ARRAY_ITER_NEXT(evt->changed_properties, i, prop, it)
{
- Eina_Array_Iterator it;
- const char *prop;
- unsigned int i;
-
- EINA_ARRAY_ITER_NEXT(evt->changed_properties, i, prop, it)
- {
- if (!strcmp(pd->prop_con, prop) || (pd->prop_key && !strcmp(pd->prop_key, prop)))
- {
- _update_viewmodel(obj, pd);
- return;
- }
- }
+ if (pd->property.file &&
+ (pd->property.file == prop || !strcmp(pd->property.file, prop)))
+ {
+ refresh = EINA_TRUE;
+ break ;
+ }
+ if (pd->property.key &&
+ (pd->property.key == prop || !strcmp(pd->property.key, prop)))
+ {
+ refresh = EINA_TRUE;
+ break ;
+ }
}
+
+ if (refresh) _update_viewmodel(obj, pd);
}
EOLIAN static void
_efl_ui_image_efl_ui_view_model_set(Eo *obj, Efl_Ui_Image_Data *pd, Efl_Model *model)
{
- if (pd->model)
+ if (pd->property.model)
{
- efl_event_callback_del(pd->model, EFL_MODEL_EVENT_PROPERTIES_CHANGED,
- _efl_ui_image_model_properties_changed_cb, obj);
- efl_unref(pd->model);
- pd->model = NULL;
+ efl_event_callback_del(pd->property.model, EFL_MODEL_EVENT_PROPERTIES_CHANGED,
+ _efl_ui_image_model_properties_changed_cb, obj);
}
+ efl_replace(&pd->property.model, model);
+
if (model)
{
- pd->model = model;
- efl_ref(pd->model);
- efl_event_callback_add(pd->model, EFL_MODEL_EVENT_PROPERTIES_CHANGED,
- _efl_ui_image_model_properties_changed_cb, obj);
+ efl_event_callback_add(model, EFL_MODEL_EVENT_PROPERTIES_CHANGED,
+ _efl_ui_image_model_properties_changed_cb, obj);
}
_update_viewmodel(obj, pd);
}
EOLIAN static Efl_Model *
-_efl_ui_image_efl_ui_view_model_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd)
+_efl_ui_image_efl_ui_view_model_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd)
{
- return pd->model;
+ return pd->property.model;
}
EOLIAN static void
@@ -1954,18 +1883,18 @@ _efl_ui_image_efl_ui_model_connect_connect(Eo *obj, Efl_Ui_Image_Data *pd, const
{
if (strcmp(name, "filename") == 0)
{
- pd->con_icon = EINA_FALSE;
- eina_stringshare_replace(&pd->prop_con, property);
+ pd->property.icon = EINA_FALSE;
+ eina_stringshare_replace(&pd->property.file, property);
}
else if (strcmp(name, "icon") == 0)
{
- pd->con_icon = EINA_TRUE;
- eina_stringshare_replace(&pd->prop_con, property);
- eina_stringshare_replace(&pd->prop_key, NULL);
+ pd->property.icon = EINA_TRUE;
+ eina_stringshare_replace(&pd->property.file, property);
+ eina_stringshare_replace(&pd->property.key, NULL);
}
else if (strcmp(name, "key") == 0)
{
- eina_stringshare_replace(&pd->prop_key, property);
+ eina_stringshare_replace(&pd->property.key, property);
}
else return;
@@ -1976,7 +1905,7 @@ EAPI void
elm_image_smooth_set(Evas_Object *obj, Eina_Bool smooth)
{
EINA_SAFETY_ON_FALSE_RETURN(efl_isa(obj, MY_CLASS));
- efl_image_smooth_scale_set(obj, smooth);
+ efl_gfx_image_smooth_scale_set(obj, smooth);
_efl_ui_image_sizing_eval(obj);
}
@@ -1984,7 +1913,7 @@ EAPI Eina_Bool
elm_image_smooth_get(const Evas_Object *obj)
{
EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(obj, MY_CLASS), EINA_FALSE);
- return efl_image_smooth_scale_get(obj);
+ return efl_gfx_image_smooth_scale_get(obj);
}
// A11Y - END
@@ -2029,6 +1958,8 @@ elm_image_mmap_set(Evas_Object *obj, const Eina_File *file, const char *group)
EAPI Eina_Bool
elm_image_memfile_set(Evas_Object *obj, const void *img, size_t size, const char *format, const char *key)
{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(img, EINA_FALSE);
+
Evas_Load_Error err;
EFL_UI_IMAGE_CHECK(obj) EINA_FALSE;
@@ -2060,7 +1991,7 @@ elm_image_memfile_set(Evas_Object *obj, const void *img, size_t size, const char
return EINA_FALSE;
}
- _efl_ui_image_internal_sizing_eval(obj, sd);
+ _efl_ui_image_sizing_eval(obj);
return EINA_TRUE;
}
@@ -2078,13 +2009,13 @@ elm_image_fill_outside_set(Evas_Object *obj, Eina_Bool fill_outside)
if (sd->aspect_fixed)
{
- if (sd->fill_inside) sd->scale_type = EFL_IMAGE_SCALE_TYPE_FIT_INSIDE;
- else sd->scale_type = EFL_IMAGE_SCALE_TYPE_FIT_OUTSIDE;
+ if (sd->fill_inside) sd->scale_type = EFL_GFX_IMAGE_SCALE_TYPE_FIT_INSIDE;
+ else sd->scale_type = EFL_GFX_IMAGE_SCALE_TYPE_FIT_OUTSIDE;
}
else
- sd->scale_type = EFL_IMAGE_SCALE_TYPE_FILL;
+ sd->scale_type = EFL_GFX_IMAGE_SCALE_TYPE_FILL;
- _efl_ui_image_internal_sizing_eval(obj, sd);
+ _efl_ui_image_sizing_eval(obj);
}
EAPI Eina_Bool
@@ -2128,6 +2059,7 @@ elm_image_orient_set(Evas_Object *obj, Elm_Image_Orient orient)
Efl_Orient dir;
Efl_Flip flip;
+ EFL_UI_IMAGE_CHECK(obj);
EFL_UI_IMAGE_DATA_GET(obj, sd);
sd->image_orient = orient;
@@ -2172,7 +2104,7 @@ elm_image_orient_set(Evas_Object *obj, Elm_Image_Orient orient)
}
efl_orientation_set(obj, dir);
- efl_flip_set(obj, flip);
+ efl_orientation_flip_set(obj, flip);
}
EAPI Elm_Image_Orient
@@ -2251,11 +2183,11 @@ elm_image_aspect_fixed_set(Evas_Object *obj, Eina_Bool fixed)
if (sd->aspect_fixed)
{
- if (sd->fill_inside) sd->scale_type = EFL_IMAGE_SCALE_TYPE_FIT_INSIDE;
- else sd->scale_type = EFL_IMAGE_SCALE_TYPE_FIT_OUTSIDE;
+ if (sd->fill_inside) sd->scale_type = EFL_GFX_IMAGE_SCALE_TYPE_FIT_INSIDE;
+ else sd->scale_type = EFL_GFX_IMAGE_SCALE_TYPE_FIT_OUTSIDE;
}
else
- sd->scale_type = EFL_IMAGE_SCALE_TYPE_FILL;
+ sd->scale_type = EFL_GFX_IMAGE_SCALE_TYPE_FILL;
_efl_ui_image_sizing_eval(obj);
}
@@ -2278,3 +2210,35 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_image, Efl_Ui_Image_Data)
EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_image)
#include "efl_ui_image.eo.c"
+
+#include "efl_ui_image_legacy.eo.h"
+
+#define MY_CLASS_NAME_LEGACY "elm_image"
+
+static void
+_efl_ui_image_legacy_class_constructor(Efl_Class *klass)
+{
+ evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
+}
+
+EOLIAN static Eo *
+_efl_ui_image_legacy_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED)
+{
+ obj = efl_constructor(efl_super(obj, EFL_UI_IMAGE_LEGACY_CLASS));
+ efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
+ return obj;
+}
+
+EAPI Evas_Object *
+elm_image_add(Evas_Object *parent)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = elm_legacy_add(EFL_UI_IMAGE_LEGACY_CLASS, parent);
+ EFL_UI_IMAGE_DATA_GET(obj, priv);
+
+ efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_CHANGE_SIZE_HINTS, _on_size_hints_changed, priv);
+
+ return obj;
+}
+
+#include "efl_ui_image_legacy.eo.c"
diff --git a/src/lib/elementary/efl_ui_image.eo b/src/lib/elementary/efl_ui_image.eo
index c7e5815204..a572d468d0 100644
--- a/src/lib/elementary/efl_ui_image.eo
+++ b/src/lib/elementary/efl_ui_image.eo
@@ -1,4 +1,4 @@
-struct Efl.Ui.Image.Progress
+struct Efl.Ui.Image_Progress
{
[[
Structure associated with smart callback 'download,progress'.
@@ -8,7 +8,7 @@ struct Efl.Ui.Image.Progress
total: double; [[Total percentage]]
}
-struct Efl.Ui.Image.Error
+struct Efl.Ui.Image_Error
{
[[
Structure associated with smart callback 'download,progress'.
@@ -18,10 +18,10 @@ struct Efl.Ui.Image.Error
open_error: bool; [[$true if the error happened when opening the file, $false otherwise]]
}
-class Efl.Ui.Image (Elm.Widget, Efl.Ui.Clickable, Efl.Ui.Draggable,
- Efl.File, Efl.Image, Efl.Image.Load, Efl.Player, Efl.Gfx.View,
- Efl.Access.Image, Efl.Access.Widget.Action, Efl.Gfx.Color,
- Efl.Orientation, Efl.Flipable,
+class Efl.Ui.Image (Efl.Ui.Widget, Efl.Ui.Clickable, Efl.Ui.Draggable,
+ Efl.File, Efl.Gfx.Image, Efl.Gfx.Image_Load_Controller, Efl.Player, Efl.Gfx.View,
+ Efl.Access.Component, Efl.Access.Widget.Action, Efl.Gfx.Color,
+ Efl.Orientation,
Efl.Ui.View, Efl.Ui.Model.Connect, Efl.Layout.Calc,
Efl.Layout.Group, Efl.Layout.Signal)
{
@@ -88,21 +88,20 @@ class Efl.Ui.Image (Elm.Widget, Efl.Ui.Clickable, Efl.Ui.Draggable,
}
}
implements {
- class.constructor;
Efl.Object.constructor;
Efl.File.file { get; set; }
Efl.File.mmap { set; }
Efl.Gfx.Color.color { set; }
- Efl.Gfx.visible { set; }
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set; }
+ Efl.Gfx.Entity.visible { set; }
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
Efl.Gfx.View.view_size { get; }
- Efl.Image.image_size { get; }
- Efl.Image.Load.load_size { get; set; }
- Efl.Image.smooth_scale { get; set; }
- Efl.Image.scale_type { get; set; }
+ Efl.Gfx.Image.image_size { get; }
+ Efl.Gfx.Image_Load_Controller.load_size { get; set; }
+ Efl.Gfx.Image.smooth_scale { get; set; }
+ Efl.Gfx.Image.scale_type { get; set; }
Efl.Orientation.orientation { get; set; }
- Efl.Flipable.flip { get; set; }
+ Efl.Orientation.flip { get; set; }
Efl.Player.playable { get; }
Efl.Player.play { get; set; }
Efl.Layout.Signal.signal_emit;
@@ -116,12 +115,12 @@ class Efl.Ui.Image (Elm.Widget, Efl.Ui.Clickable, Efl.Ui.Draggable,
Efl.Ui.Draggable.drag_target { get; set; }
Efl.Ui.Model.Connect.connect;
Efl.Ui.View.model { get; set; }
- Elm.Widget.theme_apply;
- Elm.Widget.widget_event;
- Efl.Access.Image.extents { get; }
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.widget_event;
+ Efl.Access.Component.extents { get; }
Efl.Access.Widget.Action.elm_actions { get; }
}
events {
- drop; [[Called when drop from drag and drop happened]] /* FIXME - Belongs to DnD interface */
+ drop: string; [[Called when drop from drag and drop happened]] /* FIXME - Belongs to DnD interface */
}
}
diff --git a/src/lib/elementary/efl_ui_image_factory.c b/src/lib/elementary/efl_ui_image_factory.c
index c2a87c4546..9607665e06 100644
--- a/src/lib/elementary/efl_ui_image_factory.c
+++ b/src/lib/elementary/efl_ui_image_factory.c
@@ -32,10 +32,10 @@ _efl_ui_image_factory_efl_object_destructor(Eo *obj EINA_UNUSED, Efl_Ui_Image_Fa
efl_destructor(efl_super(obj, MY_CLASS));
}
-EOLIAN static Efl_Gfx *
-_efl_ui_image_factory_efl_ui_factory_create(Eo *obj EINA_UNUSED, Efl_Ui_Image_Factory_Data *pd, Efl_Model *model, Efl_Gfx *parent)
+EOLIAN static Efl_Gfx_Entity *
+_efl_ui_image_factory_efl_ui_factory_create(Eo *obj EINA_UNUSED, Efl_Ui_Image_Factory_Data *pd, Efl_Model *model, Efl_Gfx_Entity *parent)
{
- Efl_Gfx *ui_view;
+ Efl_Gfx_Entity *ui_view;
EINA_SAFETY_ON_NULL_RETURN_VAL(pd->property, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
@@ -47,7 +47,7 @@ _efl_ui_image_factory_efl_ui_factory_create(Eo *obj EINA_UNUSED, Efl_Ui_Image_Fa
}
EOLIAN static void
-_efl_ui_image_factory_efl_ui_factory_release(Eo *obj EINA_UNUSED, Efl_Ui_Image_Factory_Data *pd EINA_UNUSED, Efl_Gfx *ui_view)
+_efl_ui_image_factory_efl_ui_factory_release(Eo *obj EINA_UNUSED, Efl_Ui_Image_Factory_Data *pd EINA_UNUSED, Efl_Gfx_Entity *ui_view)
{
efl_parent_set(ui_view, NULL);
}
diff --git a/src/lib/elementary/efl_ui_image_factory.eo b/src/lib/elementary/efl_ui_image_factory.eo
index b66bebc0d8..a966d23ec2 100644
--- a/src/lib/elementary/efl_ui_image_factory.eo
+++ b/src/lib/elementary/efl_ui_image_factory.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Image.Factory (Efl.Object, Efl.Ui.Factory)
+class Efl.Ui.Image_Factory (Efl.Object, Efl.Ui.Factory)
{
[[Efl UI image factory class]]
implements {
diff --git a/src/lib/elementary/efl_ui_image_legacy.eo b/src/lib/elementary/efl_ui_image_legacy.eo
new file mode 100644
index 0000000000..0ee7309adf
--- /dev/null
+++ b/src/lib/elementary/efl_ui_image_legacy.eo
@@ -0,0 +1,9 @@
+class Efl.Ui.Image_Legacy (Efl.Ui.Image, Efl.Ui.Legacy)
+{
+ [[ Efl UI image class]]
+ data: null;
+ implements {
+ class.constructor;
+ Efl.Object.constructor;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_image_zoomable.c b/src/lib/elementary/efl_ui_image_zoomable.c
index 5592fcfa6b..4a31c41c0e 100644
--- a/src/lib/elementary/efl_ui_image_zoomable.c
+++ b/src/lib/elementary/efl_ui_image_zoomable.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define EFL_UI_SCROLL_MANAGER_PROTECTED
#define EFL_UI_SCROLLBAR_PROTECTED
@@ -21,7 +21,6 @@
#define MY_CLASS EFL_UI_IMAGE_ZOOMABLE_CLASS
#define MY_CLASS_NAME "Efl.Ui.Image_Zoomable"
-#define MY_CLASS_NAME_LEGACY "elm_photocam"
/*
* TODO (maybe - optional future stuff):
@@ -153,24 +152,24 @@ _calc_job_cb(void *data)
}
EOLIAN static void
-_efl_ui_image_zoomable_pan_efl_gfx_position_set(Eo *obj, Efl_Ui_Image_Zoomable_Pan_Data *psd, Eina_Position2D pos)
+_efl_ui_image_zoomable_pan_efl_gfx_entity_position_set(Eo *obj, Efl_Ui_Image_Zoomable_Pan_Data *psd, Eina_Position2D pos)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
- efl_gfx_position_set(efl_super(obj, MY_PAN_CLASS), pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_PAN_CLASS), pos);
ecore_job_del(psd->wsd->calc_job);
psd->wsd->calc_job = ecore_job_add(_calc_job_cb, psd->wobj);
}
EOLIAN static void
-_efl_ui_image_zoomable_pan_efl_gfx_size_set(Eo *obj, Efl_Ui_Image_Zoomable_Pan_Data *psd, Eina_Size2D sz)
+_efl_ui_image_zoomable_pan_efl_gfx_entity_size_set(Eo *obj, Efl_Ui_Image_Zoomable_Pan_Data *psd, Eina_Size2D sz)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
- efl_gfx_size_set(efl_super(obj, MY_PAN_CLASS), sz);
+ efl_gfx_entity_size_set(efl_super(obj, MY_PAN_CLASS), sz);
psd->wsd->resized = EINA_TRUE;
ecore_job_del(psd->wsd->calc_job);
@@ -268,9 +267,15 @@ _grid_load(Evas_Object *obj,
sd->preload_num++;
if (sd->preload_num == 1)
{
- edje_object_signal_emit
- (wd->resize_obj,
- "elm,state,busy,start", "elm");
+ if (elm_widget_is_legacy(obj))
+ edje_object_signal_emit
+ (wd->resize_obj,
+ "elm,state,busy,start", "elm");
+ else
+ edje_object_signal_emit
+ (wd->resize_obj,
+ "efl,state,busy,start", "efl");
+
efl_event_callback_legacy_call
(obj, EFL_UI_IMAGE_ZOOMABLE_EVENT_LOAD_DETAIL, NULL);
}
@@ -280,9 +285,15 @@ _grid_load(Evas_Object *obj,
sd->preload_num--;
if (!sd->preload_num)
{
- edje_object_signal_emit
- (wd->resize_obj,
- "elm,state,busy,stop", "elm");
+ if (elm_widget_is_legacy(obj))
+ edje_object_signal_emit
+ (wd->resize_obj,
+ "elm,state,busy,stop", "elm");
+ else
+ edje_object_signal_emit
+ (wd->resize_obj,
+ "efl,state,busy,stop", "efl");
+
efl_event_callback_legacy_call
(obj, EFL_UI_IMAGE_ZOOMABLE_EVENT_LOADED_DETAIL, NULL);
}
@@ -394,13 +405,13 @@ _efl_ui_image_zoomable_pan_efl_ui_pan_pan_position_set(Eo *obj, Efl_Ui_Image_Zoo
}
EOLIAN static Eina_Position2D
-_efl_ui_image_zoomable_pan_efl_ui_pan_pan_position_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Pan_Data *psd)
+_efl_ui_image_zoomable_pan_efl_ui_pan_pan_position_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Pan_Data *psd)
{
return EINA_POSITION2D(psd->wsd->pan_x, psd->wsd->pan_y);
}
EOLIAN static Eina_Position2D
-_efl_ui_image_zoomable_pan_efl_ui_pan_pan_position_max_get(Eo *obj, Efl_Ui_Image_Zoomable_Pan_Data *psd)
+_efl_ui_image_zoomable_pan_efl_ui_pan_pan_position_max_get(const Eo *obj, Efl_Ui_Image_Zoomable_Pan_Data *psd)
{
Evas_Coord ow, oh;
@@ -414,13 +425,13 @@ _efl_ui_image_zoomable_pan_efl_ui_pan_pan_position_max_get(Eo *obj, Efl_Ui_Image
}
EOLIAN static Eina_Position2D
-_efl_ui_image_zoomable_pan_efl_ui_pan_pan_position_min_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Pan_Data *_pd EINA_UNUSED)
+_efl_ui_image_zoomable_pan_efl_ui_pan_pan_position_min_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Pan_Data *_pd EINA_UNUSED)
{
return EINA_POSITION2D(0, 0);
}
EOLIAN static Eina_Size2D
-_efl_ui_image_zoomable_pan_efl_ui_pan_content_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Pan_Data *psd)
+_efl_ui_image_zoomable_pan_efl_ui_pan_content_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Pan_Data *psd)
{
return EINA_SIZE2D(psd->wsd->minw, psd->wsd->minh);
}
@@ -478,9 +489,15 @@ _grid_clear(Evas_Object *obj,
sd->preload_num--;
if (!sd->preload_num)
{
- edje_object_signal_emit
- (wd->resize_obj,
- "elm,state,busy,stop", "elm");
+ if (elm_widget_is_legacy(obj))
+ edje_object_signal_emit
+ (wd->resize_obj,
+ "elm,state,busy,stop", "elm");
+ else
+ edje_object_signal_emit
+ (wd->resize_obj,
+ "efl,state,busy,stop", "efl");
+
efl_event_callback_legacy_call
(obj, EFL_UI_IMAGE_ZOOMABLE_EVENT_LOAD_DETAIL, NULL);
}
@@ -511,9 +528,15 @@ _tile_preloaded_cb(void *data,
sd->preload_num--;
if (!sd->preload_num)
{
- edje_object_signal_emit
- (wd->resize_obj, "elm,state,busy,stop",
- "elm");
+ if (elm_widget_is_legacy(git->obj))
+ edje_object_signal_emit
+ (wd->resize_obj, "elm,state,busy,stop",
+ "elm");
+ else
+ edje_object_signal_emit
+ (wd->resize_obj, "efl,state,busy,stop",
+ "efl");
+
efl_event_callback_legacy_call
(wd->obj, EFL_UI_IMAGE_ZOOMABLE_EVENT_LOADED_DETAIL, NULL);
}
@@ -602,7 +625,7 @@ _grid_create(Evas_Object *obj)
evas_object_image_add(evas_object_evas_get(obj));
evas_object_image_load_orientation_set(g->grid[tn].img, EINA_TRUE);
efl_orientation_set(g->grid[tn].img, sd->orient);
- efl_flip_set(g->grid[tn].img, sd->flip);
+ efl_orientation_flip_set(g->grid[tn].img, sd->flip);
evas_object_image_scale_hint_set
(g->grid[tn].img, EVAS_IMAGE_SCALE_HINT_DYNAMIC);
evas_object_pass_events_set(g->grid[tn].img, EINA_TRUE);
@@ -716,8 +739,13 @@ _main_img_preloaded_cb(void *data,
sd->preload_num--;
if (!sd->preload_num)
{
- edje_object_signal_emit
- (wd->resize_obj, "elm,state,busy,stop", "elm");
+ if (elm_widget_is_legacy(data))
+ edje_object_signal_emit
+ (wd->resize_obj, "elm,state,busy,stop", "elm");
+ else
+ edje_object_signal_emit
+ (wd->resize_obj, "efl,state,busy,stop", "efl");
+
efl_event_callback_legacy_call
(obj, EFL_UI_IMAGE_ZOOMABLE_EVENT_LOADED_DETAIL, NULL);
}
@@ -863,24 +891,32 @@ _mouse_up_cb(void *data,
}
EOLIAN static Eina_Bool
-_efl_ui_image_zoomable_elm_widget_on_focus_update(Eo *obj, Efl_Ui_Image_Zoomable_Data *_pd EINA_UNUSED, Elm_Object_Item *item EINA_UNUSED)
+_efl_ui_image_zoomable_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Image_Zoomable_Data *_pd EINA_UNUSED)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
Eina_Bool int_ret = EINA_FALSE;
- int_ret = efl_ui_widget_on_focus_update(efl_super(obj, MY_CLASS), NULL);
+ int_ret = efl_ui_focus_object_on_focus_update(efl_super(obj, MY_CLASS));
if (!int_ret) return EINA_FALSE;
if (efl_ui_focus_object_focus_get(obj))
{
- edje_object_signal_emit
- (wd->resize_obj, "elm,action,focus", "elm");
+ if (elm_widget_is_legacy(obj))
+ edje_object_signal_emit
+ (wd->resize_obj, "elm,action,focus", "elm");
+ else
+ edje_object_signal_emit
+ (wd->resize_obj, "efl,action,focus", "efl");
evas_object_focus_set(wd->resize_obj, EINA_TRUE);
}
else
{
- edje_object_signal_emit
- (wd->resize_obj, "elm,action,unfocus", "elm");
+ if (elm_widget_is_legacy(obj))
+ edje_object_signal_emit
+ (wd->resize_obj, "elm,action,unfocus", "elm");
+ else
+ edje_object_signal_emit
+ (wd->resize_obj, "efl,action,unfocus", "efl");
evas_object_focus_set(wd->resize_obj, EINA_FALSE);
}
@@ -888,7 +924,7 @@ _efl_ui_image_zoomable_elm_widget_on_focus_update(Eo *obj, Efl_Ui_Image_Zoomable
}
EOLIAN static Efl_Ui_Theme_Apply
-_efl_ui_image_zoomable_elm_widget_theme_apply(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd)
+_efl_ui_image_zoomable_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Eina_Bool fdo = EINA_FALSE;
@@ -926,47 +962,28 @@ _scroll_cb(void * data,
static Eina_Bool
_key_action_move(Evas_Object *obj, const char *params)
{
- Eina_Rect view = {};
Eina_Position2D pos = {};
const char *dir = params;
EFL_UI_IMAGE_ZOOMABLE_DATA_GET(obj, sd);
- Evas_Coord step_x = 0;
- Evas_Coord step_y = 0;
- Evas_Coord page_y = 0;
-
+ Evas_Coord step = 100;
pos = efl_ui_scrollable_content_pos_get(sd->smanager);
- view = efl_ui_scrollable_viewport_geometry_get(sd->smanager);
if (!strcmp(dir, "left"))
{
- pos.x -= step_x;
+ pos.x -= step;
}
else if (!strcmp(dir, "right"))
{
- pos.x += step_x;
+ pos.x += step;
}
else if (!strcmp(dir, "up"))
{
- pos.y -= step_y;
+ pos.y -= step;
}
else if (!strcmp(dir, "down"))
{
- pos.y += step_y;
- }
- else if (!strcmp(dir, "prior"))
- {
- if (page_y < 0)
- pos.y -= -(page_y * view.h) / 100;
- else
- pos.y -= page_y;
- }
- else if (!strcmp(dir, "next"))
- {
- if (page_y < 0)
- pos.y += -(page_y * view.h) / 100;
- else
- pos.y += page_y;
+ pos.y += step;
}
else return EINA_FALSE;
@@ -1320,7 +1337,7 @@ _orient_apply(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd)
}
efl_orientation_set(sd->img, sd->orient);
- efl_flip_set(sd->img, sd->flip);
+ efl_orientation_flip_set(sd->img, sd->flip);
evas_object_image_size_get(sd->img, &iw, &ih);
sd->size.imw = iw;
sd->size.imh = ih;
@@ -1340,13 +1357,13 @@ _efl_ui_image_zoomable_efl_orientation_orientation_set(Eo *obj, Efl_Ui_Image_Zoo
}
EOLIAN static Efl_Orient
-_efl_ui_image_zoomable_efl_orientation_orientation_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd)
+_efl_ui_image_zoomable_efl_orientation_orientation_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd)
{
return sd->orient;
}
EOLIAN static void
-_efl_ui_image_zoomable_efl_flipable_flip_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd, Efl_Flip flip)
+_efl_ui_image_zoomable_efl_orientation_flip_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd, Efl_Flip flip)
{
if (sd->flip == flip) return;
@@ -1355,7 +1372,7 @@ _efl_ui_image_zoomable_efl_flipable_flip_set(Eo *obj, Efl_Ui_Image_Zoomable_Data
}
EOLIAN static Efl_Flip
-_efl_ui_image_zoomable_efl_flipable_flip_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd)
+_efl_ui_image_zoomable_efl_orientation_flip_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd)
{
return sd->flip;
}
@@ -1367,10 +1384,20 @@ _efl_ui_image_zoomable_bar_read_and_update(Eo *obj)
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
double vx, vy;
- edje_object_part_drag_value_get
- (wd->resize_obj, "elm.dragable.vbar", NULL, &vy);
- edje_object_part_drag_value_get
- (wd->resize_obj, "elm.dragable.hbar", &vx, NULL);
+ if (elm_widget_is_legacy(obj))
+ {
+ edje_object_part_drag_value_get
+ (wd->resize_obj, "elm.dragable.vbar", NULL, &vy);
+ edje_object_part_drag_value_get
+ (wd->resize_obj, "elm.dragable.hbar", &vx, NULL);
+ }
+ else
+ {
+ edje_object_part_drag_value_get
+ (wd->resize_obj, "efl.dragable.vbar", NULL, &vy);
+ edje_object_part_drag_value_get
+ (wd->resize_obj, "efl.dragable.hbar", &vx, NULL);
+ }
efl_ui_scrollbar_bar_position_set(sd->smanager, vx, vy);
}
@@ -1497,8 +1524,17 @@ _efl_ui_image_zoomable_bar_size_changed_cb(void *data, const Efl_Event *event EI
double width = 0.0, height = 0.0;
efl_ui_scrollbar_bar_size_get(sd->smanager, &width, &height);
- edje_object_part_drag_size_set(wd->resize_obj, "elm.dragable.hbar", width, 1.0);
- edje_object_part_drag_size_set(wd->resize_obj, "elm.dragable.vbar", 1.0, height);
+
+ if (elm_widget_is_legacy(obj))
+ {
+ edje_object_part_drag_size_set(wd->resize_obj, "elm.dragable.hbar", width, 1.0);
+ edje_object_part_drag_size_set(wd->resize_obj, "elm.dragable.vbar", 1.0, height);
+ }
+ else
+ {
+ edje_object_part_drag_size_set(wd->resize_obj, "efl.dragable.hbar", width, 1.0);
+ edje_object_part_drag_size_set(wd->resize_obj, "efl.dragable.vbar", 1.0, height);
+ }
}
static void
@@ -1511,8 +1547,17 @@ _efl_ui_image_zoomable_bar_pos_changed_cb(void *data, const Efl_Event *event EIN
double posx = 0.0, posy = 0.0;
efl_ui_scrollbar_bar_position_get(sd->smanager, &posx, &posy);
- edje_object_part_drag_value_set(wd->resize_obj, "elm.dragable.hbar", posx, 0.0);
- edje_object_part_drag_value_set(wd->resize_obj, "elm.dragable.vbar", 0.0, posy);
+
+ if (elm_widget_is_legacy(obj))
+ {
+ edje_object_part_drag_value_set(wd->resize_obj, "elm.dragable.hbar", posx, 0.0);
+ edje_object_part_drag_value_set(wd->resize_obj, "elm.dragable.vbar", 0.0, posy);
+ }
+ else
+ {
+ edje_object_part_drag_value_set(wd->resize_obj, "efl.dragable.hbar", posx, 0.0);
+ edje_object_part_drag_value_set(wd->resize_obj, "efl.dragable.vbar", 0.0, posy);
+ }
}
static void
@@ -1522,10 +1567,20 @@ _efl_ui_image_zoomable_bar_show_cb(void *data, const Efl_Event *event)
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
Efl_Ui_Scrollbar_Direction type = *(Efl_Ui_Scrollbar_Direction *)(event->info);
- if (type == EFL_UI_SCROLLBAR_DIRECTION_HORIZONTAL)
- edje_object_signal_emit(wd->resize_obj, "elm,action,show,hbar", "elm");
- else if (type == EFL_UI_SCROLLBAR_DIRECTION_VERTICAL)
- edje_object_signal_emit(wd->resize_obj, "elm,action,show,vbar", "elm");
+ if (elm_widget_is_legacy(obj))
+ {
+ if (type == EFL_UI_SCROLLBAR_DIRECTION_HORIZONTAL)
+ edje_object_signal_emit(wd->resize_obj, "elm,action,show,hbar", "elm");
+ else if (type == EFL_UI_SCROLLBAR_DIRECTION_VERTICAL)
+ edje_object_signal_emit(wd->resize_obj, "elm,action,show,vbar", "elm");
+ }
+ else
+ {
+ if (type == EFL_UI_SCROLLBAR_DIRECTION_HORIZONTAL)
+ edje_object_signal_emit(wd->resize_obj, "efl,action,show,hbar", "efl");
+ else if (type == EFL_UI_SCROLLBAR_DIRECTION_VERTICAL)
+ edje_object_signal_emit(wd->resize_obj, "efl,action,show,vbar", "efl");
+ }
}
static void
@@ -1535,120 +1590,242 @@ _efl_ui_image_zoomable_bar_hide_cb(void *data, const Efl_Event *event)
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
Efl_Ui_Scrollbar_Direction type = *(Efl_Ui_Scrollbar_Direction *)(event->info);
- if (type == EFL_UI_SCROLLBAR_DIRECTION_HORIZONTAL)
- edje_object_signal_emit(wd->resize_obj, "elm,action,hide,hbar", "elm");
- else if (type == EFL_UI_SCROLLBAR_DIRECTION_VERTICAL)
- edje_object_signal_emit(wd->resize_obj, "elm,action,hide,vbar", "elm");
+ if (elm_widget_is_legacy(obj))
+ {
+ if (type == EFL_UI_SCROLLBAR_DIRECTION_HORIZONTAL)
+ edje_object_signal_emit(wd->resize_obj, "elm,action,hide,hbar", "elm");
+ else if (type == EFL_UI_SCROLLBAR_DIRECTION_VERTICAL)
+ edje_object_signal_emit(wd->resize_obj, "elm,action,hide,vbar", "elm");
+ }
+ else
+ {
+ if (type == EFL_UI_SCROLLBAR_DIRECTION_HORIZONTAL)
+ edje_object_signal_emit(wd->resize_obj, "efl,action,hide,hbar", "efl");
+ else if (type == EFL_UI_SCROLLBAR_DIRECTION_VERTICAL)
+ edje_object_signal_emit(wd->resize_obj, "efl,action,hide,vbar", "efl");
+ }
}
static void
_efl_ui_image_zoomable_edje_object_attach(Eo *obj)
{
- efl_layout_signal_callback_add
- (obj, "reload", "elm", _efl_ui_image_zoomable_reload_cb, obj);
- efl_layout_signal_callback_add
- (obj, "drag", "elm.dragable.vbar", _efl_ui_image_zoomable_vbar_drag_cb,
- obj);
- efl_layout_signal_callback_add
- (obj, "drag,set", "elm.dragable.vbar",
- _efl_ui_image_zoomable_edje_drag_cb, obj);
- efl_layout_signal_callback_add
- (obj, "drag,start", "elm.dragable.vbar",
- _efl_ui_image_zoomable_edje_drag_start_cb, obj);
- efl_layout_signal_callback_add
- (obj, "drag,stop", "elm.dragable.vbar",
- _efl_ui_image_zoomable_edje_drag_stop_cb, obj);
- efl_layout_signal_callback_add
- (obj, "drag,step", "elm.dragable.vbar",
- _efl_ui_image_zoomable_edje_drag_cb, obj);
- efl_layout_signal_callback_add
- (obj, "drag,page", "elm.dragable.vbar",
- _efl_ui_image_zoomable_edje_drag_cb, obj);
- efl_layout_signal_callback_add
- (obj, "elm,vbar,press", "elm",
- _efl_ui_image_zoomable_vbar_press_cb, obj);
- efl_layout_signal_callback_add
- (obj, "elm,vbar,unpress", "elm",
- _efl_ui_image_zoomable_vbar_unpress_cb, obj);
- efl_layout_signal_callback_add
- (obj, "drag", "elm.dragable.hbar", _efl_ui_image_zoomable_hbar_drag_cb,
- obj);
- efl_layout_signal_callback_add
- (obj, "drag,set", "elm.dragable.hbar",
- _efl_ui_image_zoomable_edje_drag_cb, obj);
- efl_layout_signal_callback_add
- (obj, "drag,start", "elm.dragable.hbar",
- _efl_ui_image_zoomable_edje_drag_start_cb, obj);
- efl_layout_signal_callback_add
- (obj, "drag,stop", "elm.dragable.hbar",
- _efl_ui_image_zoomable_edje_drag_stop_cb, obj);
- efl_layout_signal_callback_add
- (obj, "drag,step", "elm.dragable.hbar",
- _efl_ui_image_zoomable_edje_drag_cb, obj);
- efl_layout_signal_callback_add
- (obj, "drag,page", "elm.dragable.hbar",
- _efl_ui_image_zoomable_edje_drag_cb, obj);
- efl_layout_signal_callback_add
- (obj, "elm,hbar,press", "elm",
- _efl_ui_image_zoomable_hbar_press_cb, obj);
- efl_layout_signal_callback_add
- (obj, "elm,hbar,unpress", "elm",
- _efl_ui_image_zoomable_hbar_unpress_cb, obj);
+ if (elm_widget_is_legacy(obj))
+ {
+ efl_layout_signal_callback_add
+ (obj, "reload", "elm", _efl_ui_image_zoomable_reload_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag", "elm.dragable.vbar",
+ _efl_ui_image_zoomable_vbar_drag_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,set", "elm.dragable.vbar",
+ _efl_ui_image_zoomable_edje_drag_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,start", "elm.dragable.vbar",
+ _efl_ui_image_zoomable_edje_drag_start_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,stop", "elm.dragable.vbar",
+ _efl_ui_image_zoomable_edje_drag_stop_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,step", "elm.dragable.vbar",
+ _efl_ui_image_zoomable_edje_drag_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,page", "elm.dragable.vbar",
+ _efl_ui_image_zoomable_edje_drag_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "elm,vbar,press", "elm",
+ _efl_ui_image_zoomable_vbar_press_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "elm,vbar,unpress", "elm",
+ _efl_ui_image_zoomable_vbar_unpress_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag", "elm.dragable.hbar",
+ _efl_ui_image_zoomable_hbar_drag_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,set", "elm.dragable.hbar",
+ _efl_ui_image_zoomable_edje_drag_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,start", "elm.dragable.hbar",
+ _efl_ui_image_zoomable_edje_drag_start_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,stop", "elm.dragable.hbar",
+ _efl_ui_image_zoomable_edje_drag_stop_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,step", "elm.dragable.hbar",
+ _efl_ui_image_zoomable_edje_drag_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,page", "elm.dragable.hbar",
+ _efl_ui_image_zoomable_edje_drag_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "elm,hbar,press", "elm",
+ _efl_ui_image_zoomable_hbar_press_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "elm,hbar,unpress", "elm",
+ _efl_ui_image_zoomable_hbar_unpress_cb, obj);
+ }
+ else
+ {
+ efl_layout_signal_callback_add
+ (obj, "reload", "efl", _efl_ui_image_zoomable_reload_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag", "efl.dragable.vbar", _efl_ui_image_zoomable_vbar_drag_cb,
+ obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,set", "efl.dragable.vbar",
+ _efl_ui_image_zoomable_edje_drag_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,start", "efl.dragable.vbar",
+ _efl_ui_image_zoomable_edje_drag_start_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,stop", "efl.dragable.vbar",
+ _efl_ui_image_zoomable_edje_drag_stop_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,step", "efl.dragable.vbar",
+ _efl_ui_image_zoomable_edje_drag_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,page", "efl.dragable.vbar",
+ _efl_ui_image_zoomable_edje_drag_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "efl,vbar,press", "efl",
+ _efl_ui_image_zoomable_vbar_press_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "efl,vbar,unpress", "efl",
+ _efl_ui_image_zoomable_vbar_unpress_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag", "efl.dragable.hbar", _efl_ui_image_zoomable_hbar_drag_cb,
+ obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,set", "efl.dragable.hbar",
+ _efl_ui_image_zoomable_edje_drag_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,start", "efl.dragable.hbar",
+ _efl_ui_image_zoomable_edje_drag_start_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,stop", "efl.dragable.hbar",
+ _efl_ui_image_zoomable_edje_drag_stop_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,step", "efl.dragable.hbar",
+ _efl_ui_image_zoomable_edje_drag_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,page", "efl.dragable.hbar",
+ _efl_ui_image_zoomable_edje_drag_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "efl,hbar,press", "efl",
+ _efl_ui_image_zoomable_hbar_press_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "efl,hbar,unpress", "efl",
+ _efl_ui_image_zoomable_hbar_unpress_cb, obj);
+ }
}
static void
_efl_ui_image_zoomable_edje_object_detach(Evas_Object *obj)
{
- efl_layout_signal_callback_del
- (obj, "reload", "elm", _efl_ui_image_zoomable_reload_cb, obj);
- efl_layout_signal_callback_del
- (obj, "drag", "elm.dragable.vbar", _efl_ui_image_zoomable_vbar_drag_cb,
- obj);
- efl_layout_signal_callback_del
- (obj, "drag,set", "elm.dragable.vbar",
- _efl_ui_image_zoomable_edje_drag_cb, obj);
- efl_layout_signal_callback_del
- (obj, "drag,start", "elm.dragable.vbar",
- _efl_ui_image_zoomable_edje_drag_start_cb, obj);
- efl_layout_signal_callback_del
- (obj, "drag,stop", "elm.dragable.vbar",
- _efl_ui_image_zoomable_edje_drag_stop_cb, obj);
- efl_layout_signal_callback_del
- (obj, "drag,step", "elm.dragable.vbar",
- _efl_ui_image_zoomable_edje_drag_cb, obj);
- efl_layout_signal_callback_del
- (obj, "drag,page", "elm.dragable.vbar",
- _efl_ui_image_zoomable_edje_drag_cb, obj);
- efl_layout_signal_callback_del
- (obj, "elm,vbar,press", "elm",
- _efl_ui_image_zoomable_vbar_press_cb, obj);
- efl_layout_signal_callback_del
- (obj, "elm,vbar,unpress", "elm",
- _efl_ui_image_zoomable_vbar_unpress_cb, obj);
- efl_layout_signal_callback_del
- (obj, "drag", "elm.dragable.hbar", _efl_ui_image_zoomable_hbar_drag_cb,
- obj);
- efl_layout_signal_callback_del
- (obj, "drag,set", "elm.dragable.hbar",
- _efl_ui_image_zoomable_edje_drag_cb, obj);
- efl_layout_signal_callback_del
- (obj, "drag,start", "elm.dragable.hbar",
- _efl_ui_image_zoomable_edje_drag_start_cb, obj);
- efl_layout_signal_callback_del
- (obj, "drag,stop", "elm.dragable.hbar",
- _efl_ui_image_zoomable_edje_drag_stop_cb, obj);
- efl_layout_signal_callback_del
- (obj, "drag,step", "elm.dragable.hbar",
- _efl_ui_image_zoomable_edje_drag_cb, obj);
- efl_layout_signal_callback_del
- (obj, "drag,page", "elm.dragable.hbar",
- _efl_ui_image_zoomable_edje_drag_cb, obj);
- efl_layout_signal_callback_del
- (obj, "elm,hbar,press", "elm",
- _efl_ui_image_zoomable_hbar_press_cb, obj);
- efl_layout_signal_callback_del
- (obj, "elm,hbar,unpress", "elm",
- _efl_ui_image_zoomable_hbar_unpress_cb, obj);
+ if (elm_widget_is_legacy(obj))
+ {
+ efl_layout_signal_callback_del
+ (obj, "reload", "elm", _efl_ui_image_zoomable_reload_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag", "elm.dragable.vbar",
+ _efl_ui_image_zoomable_vbar_drag_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,set", "elm.dragable.vbar",
+ _efl_ui_image_zoomable_edje_drag_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,start", "elm.dragable.vbar",
+ _efl_ui_image_zoomable_edje_drag_start_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,stop", "elm.dragable.vbar",
+ _efl_ui_image_zoomable_edje_drag_stop_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,step", "elm.dragable.vbar",
+ _efl_ui_image_zoomable_edje_drag_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,page", "elm.dragable.vbar",
+ _efl_ui_image_zoomable_edje_drag_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "elm,vbar,press", "elm",
+ _efl_ui_image_zoomable_vbar_press_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "elm,vbar,unpress", "elm",
+ _efl_ui_image_zoomable_vbar_unpress_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag", "elm.dragable.hbar",
+ _efl_ui_image_zoomable_hbar_drag_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,set", "elm.dragable.hbar",
+ _efl_ui_image_zoomable_edje_drag_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,start", "elm.dragable.hbar",
+ _efl_ui_image_zoomable_edje_drag_start_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,stop", "elm.dragable.hbar",
+ _efl_ui_image_zoomable_edje_drag_stop_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,step", "elm.dragable.hbar",
+ _efl_ui_image_zoomable_edje_drag_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,page", "elm.dragable.hbar",
+ _efl_ui_image_zoomable_edje_drag_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "elm,hbar,press", "elm",
+ _efl_ui_image_zoomable_hbar_press_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "elm,hbar,unpress", "elm",
+ _efl_ui_image_zoomable_hbar_unpress_cb, obj);
+ }
+ else
+ {
+ efl_layout_signal_callback_del
+ (obj, "reload", "efl", _efl_ui_image_zoomable_reload_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag", "efl.dragable.vbar",
+ _efl_ui_image_zoomable_vbar_drag_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,set", "efl.dragable.vbar",
+ _efl_ui_image_zoomable_edje_drag_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,start", "efl.dragable.vbar",
+ _efl_ui_image_zoomable_edje_drag_start_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,stop", "efl.dragable.vbar",
+ _efl_ui_image_zoomable_edje_drag_stop_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,step", "efl.dragable.vbar",
+ _efl_ui_image_zoomable_edje_drag_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,page", "efl.dragable.vbar",
+ _efl_ui_image_zoomable_edje_drag_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "efl,vbar,press", "efl",
+ _efl_ui_image_zoomable_vbar_press_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "efl,vbar,unpress", "efl",
+ _efl_ui_image_zoomable_vbar_unpress_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag", "efl.dragable.hbar",
+ _efl_ui_image_zoomable_hbar_drag_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,set", "efl.dragable.hbar",
+ _efl_ui_image_zoomable_edje_drag_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,start", "efl.dragable.hbar",
+ _efl_ui_image_zoomable_edje_drag_start_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,stop", "efl.dragable.hbar",
+ _efl_ui_image_zoomable_edje_drag_stop_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,step", "efl.dragable.hbar",
+ _efl_ui_image_zoomable_edje_drag_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,page", "efl.dragable.hbar",
+ _efl_ui_image_zoomable_edje_drag_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "efl,hbar,press", "efl",
+ _efl_ui_image_zoomable_hbar_press_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "efl,hbar,unpress", "efl",
+ _efl_ui_image_zoomable_hbar_unpress_cb, obj);
+ }
}
EOLIAN static void
@@ -1679,7 +1856,10 @@ _efl_ui_image_zoomable_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Image_Zoomable
priv->pan_obj = efl_add(MY_PAN_CLASS, obj);
efl_ui_scroll_manager_pan_set(priv->smanager, priv->pan_obj);
- edje_object_part_swallow(edje, "elm.swallow.content", priv->pan_obj);
+ if (elm_widget_is_legacy(obj))
+ edje_object_part_swallow(edje, "elm.swallow.content", priv->pan_obj);
+ else
+ edje_object_part_swallow(edje, "efl.content", priv->pan_obj);
pan_data = efl_data_scope_get(priv->pan_obj, MY_PAN_CLASS);
efl_data_ref(obj, MY_CLASS);
@@ -1762,21 +1942,21 @@ _efl_ui_image_zoomable_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Image_Zoomable
}
EOLIAN static void
-_efl_ui_image_zoomable_efl_gfx_position_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sdi EINA_UNUSED, Eina_Position2D pos)
+_efl_ui_image_zoomable_efl_gfx_entity_position_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sdi EINA_UNUSED, Eina_Position2D pos)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
- efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
}
EOLIAN static void
-_efl_ui_image_zoomable_efl_gfx_size_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd EINA_UNUSED, Eina_Size2D sz)
+_efl_ui_image_zoomable_efl_gfx_entity_size_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd EINA_UNUSED, Eina_Size2D sz)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
- efl_gfx_size_set(efl_super(obj, MY_CLASS), sz);
+ efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
}
EOLIAN static void
@@ -1789,21 +1969,20 @@ EOLIAN static Eo *
_efl_ui_image_zoomable_efl_object_constructor(Eo *obj, Efl_Ui_Image_Zoomable_Data *_pd EINA_UNUSED)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
- efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_IMAGE);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_IMAGE);
return obj;
}
EOLIAN static Eina_Size2D
-_efl_ui_image_zoomable_efl_image_image_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *pd)
+_efl_ui_image_zoomable_efl_gfx_image_image_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *pd)
{
return EINA_SIZE2D(pd->size.imw, pd->size.imh);
}
EOLIAN static Eina_Size2D
-_efl_ui_image_zoomable_efl_layout_group_group_size_min_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd)
+_efl_ui_image_zoomable_efl_layout_group_group_size_min_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd)
{
if (sd->edje)
return efl_layout_group_size_min_get(sd->edje);
@@ -1812,7 +1991,7 @@ _efl_ui_image_zoomable_efl_layout_group_group_size_min_get(Eo *obj EINA_UNUSED,
}
EOLIAN static Eina_Size2D
-_efl_ui_image_zoomable_efl_layout_group_group_size_max_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd)
+_efl_ui_image_zoomable_efl_layout_group_group_size_max_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd)
{
if (sd->edje)
return efl_layout_group_size_max_get(sd->edje);
@@ -1903,8 +2082,12 @@ _img_proxy_set(Evas_Object *obj, Efl_Ui_Image_Zoomable_Data *sd,
sd->preload_num++;
if (sd->preload_num == 1)
{
- edje_object_signal_emit
- (wd->resize_obj, "elm,state,busy,start", "elm");
+ if (elm_widget_is_legacy(obj))
+ edje_object_signal_emit
+ (wd->resize_obj, "elm,state,busy,start", "elm");
+ else
+ edje_object_signal_emit
+ (wd->resize_obj, "efl,state,busy,start", "efl");
efl_event_callback_legacy_call(obj, EFL_UI_IMAGE_ZOOMABLE_EVENT_LOAD_DETAIL, NULL);
}
@@ -1987,8 +2170,12 @@ _internal_file_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd, const char *file, Ei
sd->preload_num++;
if (sd->preload_num == 1)
{
- edje_object_signal_emit
- (wd->resize_obj, "elm,state,busy,start", "elm");
+ if (elm_widget_is_legacy(obj))
+ edje_object_signal_emit
+ (wd->resize_obj, "elm,state,busy,start", "elm");
+ else
+ edje_object_signal_emit
+ (wd->resize_obj, "efl,state,busy,start", "efl");
efl_event_callback_legacy_call(obj, EFL_UI_IMAGE_ZOOMABLE_EVENT_LOAD_DETAIL, NULL);
}
@@ -2015,7 +2202,7 @@ _efl_ui_image_zoomable_remote_copier_cancel(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zo
Eo *copier = sd->remote.copier;
if (!copier) return;
- /* copier is flagged as close_on_destructor, thus:
+ /* copier is flagged as close_on_invalidate, thus:
* efl_del()
* -> efl_io_closer_close()
* -> "done" event
@@ -2117,7 +2304,7 @@ _efl_ui_image_zoomable_download(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd, const c
sd->remote.copier = efl_add(EFL_IO_COPIER_CLASS, obj,
efl_io_copier_source_set(efl_added, dialer),
- efl_io_closer_close_on_destructor_set(efl_added, EINA_TRUE),
+ efl_io_closer_close_on_invalidate_set(efl_added, EINA_TRUE),
efl_event_callback_array_add(efl_added, _efl_ui_image_zoomable_remote_copier_cbs(), obj));
EINA_SAFETY_ON_NULL_GOTO(sd->remote.copier, error_copier);
@@ -2221,14 +2408,14 @@ _efl_ui_image_zoomable_efl_file_file_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd
}
EOLIAN static void
-_efl_ui_image_zoomable_efl_file_file_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd, const char **file, const char **key)
+_efl_ui_image_zoomable_efl_file_file_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd, const char **file, const char **key)
{
if (file) *file = sd->file;
if (key) *key = NULL;
}
EOLIAN static void
-_efl_ui_image_zoomable_efl_ui_zoom_zoom_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd, double zoom)
+_efl_ui_image_zoomable_efl_ui_zoom_zoom_level_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd, double zoom)
{
double z;
Eina_List *l;
@@ -2456,7 +2643,7 @@ done:
}
EOLIAN static double
-_efl_ui_image_zoomable_efl_ui_zoom_zoom_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd)
+_efl_ui_image_zoomable_efl_ui_zoom_zoom_level_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd)
{
return sd->zoom;
}
@@ -2474,19 +2661,19 @@ _efl_ui_image_zoomable_efl_ui_zoom_zoom_mode_set(Eo *obj, Efl_Ui_Image_Zoomable_
}
EOLIAN static Elm_Photocam_Zoom_Mode
-_efl_ui_image_zoomable_efl_ui_zoom_zoom_mode_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd)
+_efl_ui_image_zoomable_efl_ui_zoom_zoom_mode_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd)
{
return sd->mode;
}
EOLIAN static Eina_Size2D
-_efl_ui_image_zoomable_efl_gfx_view_view_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *pd)
+_efl_ui_image_zoomable_efl_gfx_view_view_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *pd)
{
return EINA_SIZE2D(pd->size.imw, pd->size.imh);
}
EOLIAN static Eina_Rect
-_efl_ui_image_zoomable_image_region_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd)
+_efl_ui_image_zoomable_image_region_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd)
{
Eina_Rect region = {};
@@ -2572,7 +2759,7 @@ _efl_ui_image_zoomable_efl_ui_zoom_zoom_animation_set(Eo *obj, Efl_Ui_Image_Zoom
}
EOLIAN static Eina_Bool
-_efl_ui_image_zoomable_efl_ui_zoom_zoom_animation_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd)
+_efl_ui_image_zoomable_efl_ui_zoom_zoom_animation_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd)
{
return sd->paused;
}
@@ -2826,19 +3013,19 @@ _efl_ui_image_zoomable_efl_ui_image_icon_set(Eo *obj, Efl_Ui_Image_Zoomable_Data
}
EOLIAN static const char *
-_efl_ui_image_zoomable_efl_ui_image_icon_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *pd)
+_efl_ui_image_zoomable_efl_ui_image_icon_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *pd)
{
return pd->stdicon;
}
EOLIAN static Eina_Bool
-_efl_ui_image_zoomable_gesture_enabled_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd)
+_efl_ui_image_zoomable_gesture_enabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd)
{
return sd->do_gesture;
}
EOLIAN static Eina_Bool
-_efl_ui_image_zoomable_efl_player_playable_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd)
+_efl_ui_image_zoomable_efl_player_playable_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd)
{
if (sd->edje) return EINA_TRUE;
return evas_object_image_animated_get(sd->img);
@@ -2948,16 +3135,14 @@ _efl_ui_image_zoomable_animated_play_get_internal(const Eo *obj EINA_UNUSED, Efl
}
EOLIAN static Eina_Bool
-_efl_ui_image_zoomable_efl_player_play_get(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd)
+_efl_ui_image_zoomable_efl_player_play_get(const Eo *obj, Efl_Ui_Image_Zoomable_Data *sd)
{
return _efl_ui_image_zoomable_animated_play_get_internal(obj, sd);
}
EOLIAN static void
-_efl_ui_image_zoomable_class_constructor(Efl_Class *klass)
+_efl_ui_image_zoomable_class_constructor(Efl_Class *klass EINA_UNUSED)
{
- evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
-
PHOTO_FILE_LOAD_ERROR_GENERIC = eina_error_msg_static_register("Generic load error");
PHOTO_FILE_LOAD_ERROR_DOES_NOT_EXIST = eina_error_msg_static_register("File does not exist");
PHOTO_FILE_LOAD_ERROR_PERMISSION_DENIED = eina_error_msg_static_register("Permission denied to an existing file");
@@ -2967,7 +3152,7 @@ _efl_ui_image_zoomable_class_constructor(Efl_Class *klass)
}
EOLIAN const Efl_Access_Action_Data *
-_efl_ui_image_zoomable_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *pd EINA_UNUSED)
+_efl_ui_image_zoomable_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *pd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "move,prior", "move", "prior", _key_action_move},
@@ -2983,13 +3168,39 @@ _efl_ui_image_zoomable_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNU
return &atspi_actions[0];
}
-/* Legacy APIs */
+/* Standard widget overrides */
+
+ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_image_zoomable, Efl_Ui_Image_Zoomable_Data)
+
+/* Internal EO APIs and hidden overrides */
+
+#define EFL_UI_IMAGE_ZOOMABLE_EXTRA_OPS \
+ EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_image_zoomable)
+
+#include "efl_ui_image_zoomable.eo.c"
+
+#include "efl_ui_image_zoomable_legacy.eo.h"
+#define MY_CLASS_NAME_LEGACY "elm_photocam"
+
+static void
+_efl_ui_image_zoomable_legacy_class_constructor(Efl_Class *klass)
+{
+ evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
+}
+
+EOLIAN static Eo *
+_efl_ui_image_zoomable_legacy_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED)
+{
+ obj = efl_constructor(efl_super(obj, EFL_UI_IMAGE_ZOOMABLE_LEGACY_CLASS));
+ efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
+ return obj;
+}
EAPI Evas_Object *
elm_photocam_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return elm_legacy_add(MY_CLASS, parent);
+ return elm_legacy_add(EFL_UI_IMAGE_ZOOMABLE_LEGACY_CLASS, parent);
}
static inline void
@@ -3080,7 +3291,7 @@ elm_photocam_image_orient_set(Eo *obj, Evas_Image_Orient evas_orient)
_evas_orient_to_eo_orient_flip(evas_orient, &orient, &flip);
efl_orientation_set(obj, orient);
- efl_flip_set(obj, flip);
+ efl_orientation_flip_set(obj, flip);
}
EAPI Evas_Image_Orient
@@ -3123,13 +3334,13 @@ elm_photocam_paused_set(Evas_Object *obj, Eina_Bool paused)
EAPI void
elm_photocam_zoom_set(Evas_Object *obj, double zoom)
{
- efl_ui_zoom_set(obj, zoom);
+ efl_ui_zoom_level_set(obj, zoom);
}
EAPI double
elm_photocam_zoom_get(const Evas_Object *obj)
{
- return efl_ui_zoom_get(obj);
+ return efl_ui_zoom_level_get(obj);
}
EAPI void
@@ -3223,13 +3434,4 @@ elm_photocam_image_region_get(const Efl_Ui_Image_Zoomable *obj, int *x, int *y,
if (h) *h = r.h;
}
-/* Standard widget overrides */
-
-ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_image_zoomable, Efl_Ui_Image_Zoomable_Data)
-
-/* Internal EO APIs and hidden overrides */
-
-#define EFL_UI_IMAGE_ZOOMABLE_EXTRA_OPS \
- EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_image_zoomable)
-
-#include "efl_ui_image_zoomable.eo.c"
+#include "efl_ui_image_zoomable_legacy.eo.c"
diff --git a/src/lib/elementary/efl_ui_image_zoomable.eo b/src/lib/elementary/efl_ui_image_zoomable.eo
index 6aa65eaf64..7695b592ac 100644
--- a/src/lib/elementary/efl_ui_image_zoomable.eo
+++ b/src/lib/elementary/efl_ui_image_zoomable.eo
@@ -1,5 +1,9 @@
-class Efl.Ui.Image_Zoomable (Elm.Widget, Efl.Ui.Image, Efl.Ui.Zoom,
- Efl.Ui.Scrollable.Interactive,
+/* FIXME: Define these structs in EO, or they are useless to bindings */
+struct @extern Elm.Photocam.Error;
+struct @extern Elm.Photocam.Progress;
+
+class Efl.Ui.Image_Zoomable (Efl.Ui.Widget, Efl.Ui.Image, Efl.Ui.Zoom,
+ Efl.Ui.Scrollable_Interactive,
Efl.Ui.Scrollbar)
{
[[Elementary Image Zoomable class]]
@@ -47,40 +51,40 @@ class Efl.Ui.Image_Zoomable (Elm.Widget, Efl.Ui.Image, Efl.Ui.Zoom,
implements {
class.constructor;
Efl.Object.constructor;
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set; }
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
Efl.Gfx.View.view_size { get; }
- Efl.Image.image_size { get; }
+ Efl.Gfx.Image.image_size { get; }
Efl.Ui.Image.icon { set; get; }
Efl.Player.playable { get; }
Efl.Player.play { get; set; }
Efl.Ui.Zoom.zoom_animation { set; get; }
- Efl.Ui.Zoom.zoom { set; get; }
+ Efl.Ui.Zoom.zoom_level { set; get; }
Efl.Ui.Zoom.zoom_mode { set; get; }
Efl.Canvas.Group.group_member_add;
- Elm.Widget.theme_apply;
- Elm.Widget.on_focus_update;
- Elm.Widget.widget_event;
- Efl.Ui.Scrollable.Interactive.scroll;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Focus.Object.on_focus_update;
+ Efl.Ui.Widget.widget_event;
+ Efl.Ui.Scrollable_Interactive.scroll;
Efl.Access.Widget.Action.elm_actions { get; }
Efl.File.file { get; set; }
Efl.Orientation.orientation { get; set; }
- Efl.Flipable.flip { get; set; }
+ Efl.Orientation.flip { get; set; }
Efl.Layout.Group.group_size_min { get; }
Efl.Layout.Group.group_size_max { get; }
- Efl.Layout.Signal.signal_callback_add;
- Efl.Layout.Signal.signal_callback_del;
+ Efl.Layout.Signal.signal_callback_add;
+ Efl.Layout.Signal.signal_callback_del;
//Efl.Canvas.Layout_Group.group_data { get; }
}
events {
- press; [[Called when photocam got pressed]]
- load; [[Called when photocam loading started]]
- loaded; [[Called when photocam loading finished]]
- load,detail; [[Called when photocal detail loading started]]
- loaded,detail; [[Called when photocam detail loading finished]]
- download,start; [[Called when photocam download started]]
- download,progress; [[Called when photocam download progress updated]]
- download,done; [[Called when photocam download finished]]
- download,error; [[Called when photocam download failed]]
+ press: void; [[Called when photocam got pressed]]
+ load: void; [[Called when photocam loading started]]
+ loaded: void; [[Called when photocam loading finished]]
+ load,detail: void; [[Called when photocal detail loading started]]
+ loaded,detail: void; [[Called when photocam detail loading finished]]
+ download,start: void; [[Called when photocam download started]]
+ download,progress: Elm.Photocam.Progress; [[Called when photocam download progress updated]]
+ download,done: void; [[Called when photocam download finished]]
+ download,error: Elm.Photocam.Error; [[Called when photocam download failed]]
}
}
diff --git a/src/lib/elementary/efl_ui_image_zoomable_legacy.eo b/src/lib/elementary/efl_ui_image_zoomable_legacy.eo
new file mode 100644
index 0000000000..3816422bc9
--- /dev/null
+++ b/src/lib/elementary/efl_ui_image_zoomable_legacy.eo
@@ -0,0 +1,9 @@
+class Efl.Ui.Image_Zoomable_Legacy (Efl.Ui.Image_Zoomable, Efl.Ui.Legacy)
+{
+ [[Elementary Image Zoomable class]]
+ data: null;
+ implements {
+ class.constructor;
+ Efl.Object.constructor;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_image_zoomable_pan.eo b/src/lib/elementary/efl_ui_image_zoomable_pan.eo
index 35f62a5622..a9c9cb3b4d 100644
--- a/src/lib/elementary/efl_ui_image_zoomable_pan.eo
+++ b/src/lib/elementary/efl_ui_image_zoomable_pan.eo
@@ -5,8 +5,8 @@ class Efl.Ui.Image_Zoomable_Pan (Efl.Ui.Pan)
implements {
class.constructor;
Efl.Object.destructor;
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set; }
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
Efl.Canvas.Group.group_calculate;
Efl.Ui.Pan.content_size { get; }
Efl.Ui.Pan.pan_position { get; set; }
@@ -14,6 +14,7 @@ class Efl.Ui.Image_Zoomable_Pan (Efl.Ui.Pan)
Efl.Ui.Pan.pan_position_max { get; }
}
events {
+ /* FIXME: Nobody is emitting these
load; [[Called when load started]]
loaded; [[Called when load finished]]
load,detail; [[Called when load details started]]
@@ -22,5 +23,6 @@ class Efl.Ui.Image_Zoomable_Pan (Efl.Ui.Pan)
download,progress; [[Called with download progress updates]]
download,done; [[Called when download finished]]
download,error; [[Called when download failed with an error]]
+ */
}
}
diff --git a/src/lib/elementary/efl_ui_image_zoomable_private.h b/src/lib/elementary/efl_ui_image_zoomable_private.h
index 1f867a9a4c..7ccbf2553c 100644
--- a/src/lib/elementary/efl_ui_image_zoomable_private.h
+++ b/src/lib/elementary/efl_ui_image_zoomable_private.h
@@ -167,7 +167,7 @@ struct _Efl_Ui_Image_Zoomable_Pan_Data
EFL_UI_IMAGE_ZOOMABLE_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -176,7 +176,7 @@ struct _Efl_Ui_Image_Zoomable_Pan_Data
EFL_UI_IMAGE_ZOOMABLE_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.c b/src/lib/elementary/efl_ui_internal_text_interactive.c
index 4f70c8cc2d..bfe41af303 100644
--- a/src/lib/elementary/efl_ui_internal_text_interactive.c
+++ b/src/lib/elementary/efl_ui_internal_text_interactive.c
@@ -510,7 +510,7 @@ _sel_cursor_changed(void *data, const Efl_Event *event EINA_UNUSED)
{
Eo *obj = data;
- efl_event_callback_call(obj, EFL_UI_TEXT_INTERACTIVE_EVENT_SELECTION_CHANGED, NULL);
+ efl_event_callback_call(obj, EFL_TEXT_INTERACTIVE_EVENT_SELECTION_CHANGED, NULL);
}
static void
@@ -1404,35 +1404,35 @@ done:
}
EOLIAN static void
-_efl_ui_internal_text_interactive_efl_ui_text_interactive_selection_allowed_set(Eo *obj EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *pd, Eina_Bool allowed)
+_efl_ui_internal_text_interactive_efl_text_interactive_selection_allowed_set(Eo *obj EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *pd, Eina_Bool allowed)
{
pd->select_allow = allowed;
}
EOLIAN static Eina_Bool
-_efl_ui_internal_text_interactive_efl_ui_text_interactive_selection_allowed_get(Eo *obj EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *pd)
+_efl_ui_internal_text_interactive_efl_text_interactive_selection_allowed_get(const Eo *obj EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *pd)
{
return pd->select_allow;
}
EOLIAN static void
-_efl_ui_internal_text_interactive_efl_ui_text_interactive_selection_cursors_get(Eo *obj EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *pd, Efl_Text_Cursor_Cursor **start, Evas_Textblock_Cursor **end)
+_efl_ui_internal_text_interactive_efl_text_interactive_selection_cursors_get(const Eo *obj EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *pd, Efl_Text_Cursor_Cursor **start, Evas_Textblock_Cursor **end)
{
if (start) *start = pd->sel_start;
if (end) *end = pd->sel_end;
}
EOLIAN static void
-_efl_ui_internal_text_interactive_efl_ui_text_interactive_editable_set(Eo *obj EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *sd, Eina_Bool editable)
+_efl_ui_internal_text_interactive_efl_text_interactive_editable_set(Eo *obj EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *sd, Eina_Bool editable)
{
sd->editable = editable;
}
EOLIAN static Eina_Bool
-_efl_ui_internal_text_interactive_efl_ui_text_interactive_editable_get(Eo *obj EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *sd)
+_efl_ui_internal_text_interactive_efl_text_interactive_editable_get(const Eo *obj EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *sd)
{
return sd->editable;
}
#include "efl_ui_internal_text_interactive.eo.c"
-#include "efl_ui_text_interactive.eo.c"
+#include "efl_text_interactive.eo.c"
diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.eo b/src/lib/elementary/efl_ui_internal_text_interactive.eo
index bf0bd65cb3..6910fa1d34 100644
--- a/src/lib/elementary/efl_ui_internal_text_interactive.eo
+++ b/src/lib/elementary/efl_ui_internal_text_interactive.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Internal.Text.Interactive (Efl.Canvas.Text, Efl.Ui.Text.Interactive)
+class Efl.Ui.Internal.Text.Interactive (Efl.Canvas.Text, Efl.Text_Interactive)
{
[[An internal object in charge of the interactive aspect of the text widget.
@@ -7,8 +7,8 @@ class Efl.Ui.Internal.Text.Interactive (Efl.Canvas.Text, Efl.Ui.Text.Interactive
implements {
Efl.Object.constructor;
Efl.Object.finalize;
- Efl.Ui.Text.Interactive.selection_allowed { get; set; }
- Efl.Ui.Text.Interactive.selection_cursors { get; }
- Efl.Ui.Text.Interactive.editable { get; set; }
+ Efl.Text_Interactive.selection_allowed { get; set; }
+ Efl.Text_Interactive.selection_cursors { get; }
+ Efl.Text_Interactive.editable { get; set; }
}
}
diff --git a/src/lib/elementary/efl_ui_item.c b/src/lib/elementary/efl_ui_item.c
new file mode 100644
index 0000000000..5eed4b2c7b
--- /dev/null
+++ b/src/lib/elementary/efl_ui_item.c
@@ -0,0 +1,260 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#define EFL_ACCESS_PROTECTED
+#define EFL_UI_WIDGET_PART_BG_PROTECTED
+
+#include <Elementary.h>
+
+#include "elm_priv.h"
+#include "efl_ui_item_private.h"
+
+#define MY_CLASS EFL_UI_ITEM_CLASS
+#define MY_CLASS_PFX efl_ui_item
+
+#define MY_CLASS_NAME "Efl.Ui.Item"
+
+static void
+_item_select(Eo *obj, Efl_Ui_Item_Data *pd)
+{
+ if (pd->selected &&
+ (*(pd->select_mode) != EFL_UI_SELECT_SINGLE_ALWAYS))
+ return;
+ if (*(pd->select_mode) == EFL_UI_SELECT_NONE) return;
+
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+
+ pd->selected = EINA_TRUE;
+ edje_object_signal_emit(wd->resize_obj, "efl,state,selected", "efl");
+ efl_event_callback_call(obj, EFL_UI_EVENT_SELECTED, NULL);
+}
+
+static void
+_item_unselect(Eo *obj, Efl_Ui_Item_Data *pd)
+{
+ if (!pd->selected) return;
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+
+ pd->selected = EINA_FALSE;
+ edje_object_signal_emit(wd->resize_obj, "efl,state,unselected", "efl");
+ efl_event_callback_call(obj, EFL_UI_EVENT_UNSELECTED, NULL);
+}
+
+/* Mouse Controls */
+static Eina_Bool
+_item_longpressed(void *data)
+{
+ Efl_Ui_Item *item = data;
+ EFL_UI_ITEM_DATA_GET_OR_RETURN(item, pd, ECORE_CALLBACK_CANCEL);
+
+ pd->longpress_timer = NULL;
+
+ efl_event_callback_call(item, EFL_UI_EVENT_LONGPRESSED, NULL);
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static void
+_item_mouse_down(void *data,
+ Evas *evas EINA_UNUSED,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info)
+{
+ Evas_Event_Mouse_Down *ev = event_info;
+ Eo *item = data;
+ EFL_UI_ITEM_DATA_GET_OR_RETURN(item, pd);
+ ELM_WIDGET_DATA_GET_OR_RETURN(item, wd);
+ if (wd->disabled) return;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
+
+ edje_object_signal_emit(wd->resize_obj, "efl,state,pressed", "efl");
+
+ pd->longpress_timer = ecore_timer_add(_elm_config->longpress_timeout, _item_longpressed, item);
+ efl_event_callback_call(item, EFL_UI_EVENT_PRESSED, NULL);
+}
+
+static void
+_item_mouse_up(void *data,
+ Evas *evas EINA_UNUSED,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info)
+{
+ Evas_Event_Mouse_Up *ev = event_info;
+ Eo *item = data;
+ EFL_UI_ITEM_DATA_GET_OR_RETURN(item, pd);
+ ELM_WIDGET_DATA_GET_OR_RETURN(item, wd);
+ if (wd->disabled) return;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
+ {
+ //FIXME: should we send this message to fallback?
+ edje_object_signal_emit(wd->resize_obj, "efl,state,unpressed", "efl");
+ //efl_event_callback_call(item, EFL_UI_EVENT_UNPRESSED, NULL);
+ return;
+ }
+
+ if (pd->longpress_timer)
+ {
+ ecore_timer_del(pd->longpress_timer);
+ pd->longpress_timer = NULL;
+ }
+
+ edje_object_signal_emit(wd->resize_obj, "efl,state,unpressed", "efl");
+ efl_event_callback_call(item, EFL_UI_EVENT_UNPRESSED, NULL);
+
+ if ((*(pd->select_mode) != EFL_UI_SELECT_SINGLE_ALWAYS) && (pd->selected))
+ _item_unselect(item, pd);
+ else if (*(pd->select_mode) != EFL_UI_SELECT_NONE)
+ _item_select(item, pd);
+}
+
+static void
+_item_mouse_move(void *data EINA_UNUSED,
+ Evas *evas EINA_UNUSED,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info)
+{
+ Evas_Event_Mouse_Move *ev = event_info;
+ Eo *item = data;
+ EFL_UI_ITEM_DATA_GET_OR_RETURN(item, pd);
+ ELM_WIDGET_DATA_GET_OR_RETURN(item, wd);
+ if (wd->disabled) return;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
+ {
+ edje_object_signal_emit(wd->resize_obj, "efl,state,unpressed", "efl");
+ return;
+ }
+}
+
+static void
+_item_mouse_in(void *data EINA_UNUSED,
+ Evas *evas EINA_UNUSED,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info)
+{
+ Evas_Event_Mouse_In *ev = event_info;
+ Eo *item = data;
+ EFL_UI_ITEM_DATA_GET_OR_RETURN(item, pd);
+ ELM_WIDGET_DATA_GET_OR_RETURN(item, wd);
+ if (wd->disabled) return;
+
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
+}
+
+static void
+_item_mouse_callback_add(Eo *obj, void *data)
+{
+ evas_object_event_callback_add
+ (obj, EVAS_CALLBACK_MOUSE_DOWN, _item_mouse_down, data);
+ evas_object_event_callback_add
+ (obj, EVAS_CALLBACK_MOUSE_UP, _item_mouse_up, data);
+ evas_object_event_callback_add
+ (obj, EVAS_CALLBACK_MOUSE_MOVE, _item_mouse_move, data);
+ evas_object_event_callback_add
+ (obj, EVAS_CALLBACK_MOUSE_IN, _item_mouse_in, data);
+}
+
+static void
+_item_mouse_callback_del(Eo *obj, void *data)
+{
+ evas_object_event_callback_del_full
+ (obj, EVAS_CALLBACK_MOUSE_DOWN, _item_mouse_down, data);
+ evas_object_event_callback_del_full
+ (obj, EVAS_CALLBACK_MOUSE_UP, _item_mouse_up, data);
+ evas_object_event_callback_del_full
+ (obj, EVAS_CALLBACK_MOUSE_MOVE, _item_mouse_move, data);
+ evas_object_event_callback_del_full
+ (obj, EVAS_CALLBACK_MOUSE_IN, _item_mouse_in, data);
+}
+/* Mouse Controls ends */
+
+static void
+_sizing_eval(Evas_Object *obj, Efl_Ui_Item_Data *pd)
+{
+ Evas_Coord minh = -1, minw = -1;
+ Evas_Coord rest_w = 0, rest_h = 0;
+ ELM_WIDGET_DATA_GET_OR_RETURN(pd->obj, wd);
+
+ edje_object_size_min_restricted_calc(wd->resize_obj, &minw, &minh,
+ rest_w, rest_h);
+ evas_object_size_hint_min_set(obj, minw, minh);
+
+ pd->needs_size_calc = EINA_FALSE;
+}
+
+static void
+_efl_ui_item_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Item_Data *pd)
+{
+ if (pd->needs_size_calc) return;
+ pd->needs_size_calc = EINA_TRUE;
+
+ efl_canvas_group_change(obj);
+}
+
+EOLIAN static void
+_efl_ui_item_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Item_Data *pd)
+{
+ if (pd->needs_size_calc)
+ {
+ _sizing_eval(obj, pd);
+ pd->needs_size_calc = EINA_FALSE;
+ }
+}
+
+EOLIAN static Eo *
+_efl_ui_item_efl_object_constructor(Eo *obj, Efl_Ui_Item_Data *pd)
+{
+ pd->obj = obj;
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+
+ return obj;
+}
+
+EOLIAN static Efl_Object *
+_efl_ui_item_efl_object_finalize(Eo *obj, Efl_Ui_Item_Data *pd EINA_UNUSED)
+{
+ Eo *eo;
+ eo = efl_finalize(efl_super(obj, MY_CLASS));
+ ELM_WIDGET_DATA_GET_OR_RETURN(eo, wd, eo);
+
+ _item_mouse_callback_add(wd->resize_obj, eo);
+ return eo;
+}
+
+EOLIAN static void
+_efl_ui_item_efl_object_destructor(Eo *obj, Efl_Ui_Item_Data *pd EINA_UNUSED)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+
+ _item_mouse_callback_del(wd->resize_obj, obj);
+ efl_destructor(efl_super(obj, MY_CLASS));
+}
+
+EOLIAN static int
+_efl_ui_item_index_get(const Eo *obj, Efl_Ui_Item_Data *pd)
+{
+ return efl_pack_index_get(pd->parent, obj);
+}
+
+EOLIAN static void
+_efl_ui_item_selected_set(Eo *obj, Efl_Ui_Item_Data *pd, Eina_Bool select)
+{
+ Eina_Bool selected = !!select;
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+ if (wd->disabled) return;
+
+ if (selected) _item_select(obj, pd);
+ else _item_unselect(obj, pd);
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_item_selected_get(const Eo *obj EINA_UNUSED, Efl_Ui_Item_Data *pd)
+{
+ return pd->selected;
+}
+
+/* Internal EO APIs and hidden overrides */
+
+#define EFL_UI_ITEM_EXTRA_OPS \
+ ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_item)
+
+#include "efl_ui_item.eo.c"
diff --git a/src/lib/elementary/efl_ui_item.eo b/src/lib/elementary/efl_ui_item.eo
new file mode 100644
index 0000000000..6137dd9fb7
--- /dev/null
+++ b/src/lib/elementary/efl_ui_item.eo
@@ -0,0 +1,30 @@
+abstract Efl.Ui.Item (Efl.Ui.Layout.Object, Efl.Ui.Selectable, Efl.Ui.Clickable)
+{
+ [[Item abstract class for pack widget. All item have to be inherited from this class.]]
+ methods {
+ @property index {
+ [[index number of item from their parent object.]]
+ get {}
+ values {
+ index : int;
+ }
+ }
+ @property selected {
+ [[Select property for item object.
+ Item can be selected by user mouse/key input also]]
+ set {}
+ get {}
+ values {
+ select: bool;
+ }
+ }
+ }
+ implements {
+ //Efl.Object
+ Efl.Object.constructor;
+ Efl.Object.finalize;
+ Efl.Object.destructor;
+ //Efl.Canvas
+ Efl.Canvas.Group.group_calculate;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_item_private.h b/src/lib/elementary/efl_ui_item_private.h
new file mode 100644
index 0000000000..b8849a2316
--- /dev/null
+++ b/src/lib/elementary/efl_ui_item_private.h
@@ -0,0 +1,37 @@
+#ifndef EFL_UI_ITEM_PRIVATE_H
+#define EFL_UI_ITEM_PRIVATE_H
+
+#include "Elementary.h"
+
+typedef struct _Efl_Ui_Item_Data
+{
+ // Eo Objects
+ Eo *obj; /* Self-Object */
+ Eo *parent; /* Parent Widget */
+
+ Efl_Ui_Select_Mode *select_mode; /* Select Mdoe of parent widget */
+ Ecore_Timer *longpress_timer; /* Timer for longpress handle */
+
+ // Boolean Data
+ Eina_Bool selected : 1; /* State for item selected */
+ Eina_Bool needs_size_calc : 1; /* Flag for Size calculation */
+} Efl_Ui_Item_Data;
+
+
+#define EFL_UI_ITEM_DATA_GET(o, pd) \
+ Efl_Ui_Item_Data * pd = efl_data_scope_safe_get(o, EFL_UI_ITEM_CLASS)
+
+#define EFL_UI_ITEM_DATA_GET_OR_RETURN(o, ptr, ...) \
+ EFL_UI_ITEM_DATA_GET(o, ptr); \
+ if (EINA_UNLIKELY(!ptr)) \
+ { \
+ ERR("No widget data for object %p (%s)", \
+ o, evas_object_type_get(o)); \
+ return __VA_ARGS__; \
+ }
+
+#define EFL_UI_ITEM_CHECK_OR_RETURN(obj, ...) \
+ if (EINA_UNLIKELY(!efl_isa((obj), EFL_UI_ITEM_CLASS))) \
+ return __VA_ARGS__;
+
+#endif
diff --git a/src/lib/elementary/efl_ui_layout_factory.c b/src/lib/elementary/efl_ui_layout_factory.c
index 6fe150dc3d..16621c53a0 100644
--- a/src/lib/elementary/efl_ui_layout_factory.c
+++ b/src/lib/elementary/efl_ui_layout_factory.c
@@ -63,11 +63,11 @@ _efl_ui_layout_factory_efl_object_destructor(Eo *obj, Efl_Ui_Layout_Factory_Data
efl_destructor(efl_super(obj, MY_CLASS));
}
-EOLIAN static Efl_Gfx *
+EOLIAN static Efl_Gfx_Entity *
_efl_ui_layout_factory_efl_ui_factory_create(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Factory_Data *pd
- , Efl_Model *model, Efl_Gfx *parent)
+ , Efl_Model *model, Efl_Gfx_Entity *parent)
{
- Efl_Gfx *layout;
+ Efl_Gfx_Entity *layout;
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
/*
if (eina_array_count(pd->layouts))
@@ -78,9 +78,9 @@ _efl_ui_layout_factory_efl_ui_factory_create(Eo *obj EINA_UNUSED, Efl_Ui_Layout_
}
else */
{
- layout = efl_add(EFL_UI_LAYOUT_CLASS, parent,
+ layout = efl_add(EFL_UI_LAYOUT_OBJECT_CLASS, parent,
efl_ui_view_model_set(efl_added, model),
- elm_layout_theme_set(efl_added, pd->klass, pd->group, pd->style));
+ efl_ui_layout_object_theme_set(efl_added, pd->klass, pd->group, pd->style));
eina_hash_foreach(pd->connects, _model_connect, layout);
@@ -92,7 +92,7 @@ _efl_ui_layout_factory_efl_ui_factory_create(Eo *obj EINA_UNUSED, Efl_Ui_Layout_
}
EOLIAN static void
-_efl_ui_layout_factory_efl_ui_factory_release(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Factory_Data *pd EINA_UNUSED, Efl_Gfx *layout)
+_efl_ui_layout_factory_efl_ui_factory_release(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Factory_Data *pd EINA_UNUSED, Efl_Gfx_Entity *layout)
{
efl_ui_view_model_set(layout, NULL);
efl_del(layout);
diff --git a/src/lib/elementary/efl_ui_layout_legacy.eo b/src/lib/elementary/efl_ui_layout_legacy.eo
new file mode 100644
index 0000000000..383f461584
--- /dev/null
+++ b/src/lib/elementary/efl_ui_layout_legacy.eo
@@ -0,0 +1,8 @@
+class Efl.Ui.Layout_Legacy (Efl.Ui.Layout.Object, Efl.Ui.Legacy)
+{
+ [[Elementary layout class]]
+ data: null;
+ implements {
+ Efl.Object.constructor;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout_object.c
index 4c7d86e9cd..9dc050fda1 100644
--- a/src/lib/elementary/efl_ui_layout.c
+++ b/src/lib/elementary/efl_ui_layout_object.c
@@ -2,9 +2,10 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define ELM_LAYOUT_PROTECTED
#define EFL_UI_WIDGET_PART_BG_PROTECTED
+#define EFL_PART_PROTECTED
#include <Elementary.h>
@@ -13,15 +14,14 @@
#include "elm_part_helper.h"
#include "elm_entry.eo.h"
-#define MY_CLASS EFL_UI_LAYOUT_CLASS
-#define MY_CLASS_PFX efl_ui_layout
+#define MY_CLASS EFL_UI_LAYOUT_OBJECT_CLASS
+#define MY_CLASS_PFX efl_ui_layout_object
-#define MY_CLASS_NAME "Efl.Ui.Layout"
-#define MY_CLASS_NAME_LEGACY "elm_layout"
+#define MY_CLASS_NAME "Efl.Ui.Layout.Object"
-Eo *_efl_ui_layout_pack_proxy_get(Efl_Ui_Layout *obj, Edje_Part_Type type, const char *part);
+Eo *_efl_ui_layout_pack_proxy_get(Efl_Ui_Layout_Object *obj, Edje_Part_Type type, const char *part);
static void _efl_model_properties_changed_cb(void *, const Efl_Event *);
-static Eina_Bool _efl_ui_layout_part_cursor_unset(Efl_Ui_Layout_Data *sd, const char *part_name);
+static Eina_Bool _efl_ui_layout_part_cursor_unset(Efl_Ui_Layout_Object_Data *sd, const char *part_name);
static const char SIG_THEME_CHANGED[] = "theme,changed";
const char SIG_LAYOUT_FOCUSED[] = "focused";
@@ -39,6 +39,9 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
+static const char efl_ui_default_text[] = "efl.text";
+static const char efl_ui_default_content[] = "efl.content";
+
static const Elm_Layout_Part_Alias_Description _text_aliases[] =
{
{"default", "elm.text"},
@@ -51,25 +54,33 @@ static const Elm_Layout_Part_Alias_Description _content_aliases[] =
{NULL, NULL}
};
-static const char *_efl_ui_layout_swallow_parts[] = {
+static const char *_elm_legacy_layout_swallow_parts[] = {
"elm.swallow.icon",
"elm.swallow.end",
"elm.swallow.background",
NULL
};
+static const char *_efl_ui_layout_swallow_parts[] = {
+ "efl.content",
+ "efl.icon",
+ "efl.end",
+ "efl.background",
+ NULL
+};
+
+
/* these are data operated by layout's class functions internally, and
* should not be messed up by inhering classes */
typedef struct _Efl_Ui_Layout_Sub_Object_Data Efl_Ui_Layout_Sub_Object_Data;
typedef struct _Efl_Ui_Layout_Sub_Object_Cursor Efl_Ui_Layout_Sub_Object_Cursor;
typedef struct _Efl_Ui_Layout_Sub_Iterator Efl_Ui_Layout_Sub_Iterator;
-typedef struct _Efl_Ui_Layout_Sub_Connect Efl_Ui_Layout_Sub_Connect;
struct _Efl_Ui_Layout_Sub_Iterator
{
Eina_Iterator iterator;
Eina_Iterator *real_iterator;
- Efl_Ui_Layout *object;
+ Efl_Ui_Layout_Object *object;
};
struct _Efl_Ui_Layout_Sub_Object_Data
@@ -109,14 +120,13 @@ struct _Efl_Ui_Layout_Sub_Object_Cursor
Eina_Bool engine_only : 1;
};
-struct _Efl_Ui_Layout_Sub_Connect
+#define MY_CLASS_NAME_LEGACY "elm_layout"
+
+static void
+_efl_ui_layout_object_class_constructor(Efl_Class *klass)
{
- Eina_Stringshare *name;
- Eina_Stringshare *property;
- Eina_Bool is_signal;
- Eo *obj;
- Efl_Future *future;
-};
+ evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
+}
static void
_on_sub_object_size_hint_change(void *data,
@@ -139,7 +149,7 @@ _part_cursor_free(Efl_Ui_Layout_Sub_Object_Cursor *pc)
}
static void
-_sizing_eval(Evas_Object *obj, Efl_Ui_Layout_Data *sd)
+_sizing_eval(Evas_Object *obj, Efl_Ui_Layout_Object_Data *sd)
{
Evas_Coord minh = -1, minw = -1;
Evas_Coord rest_w = 0, rest_h = 0;
@@ -159,40 +169,81 @@ _sizing_eval(Evas_Object *obj, Efl_Ui_Layout_Data *sd)
/* common content cases for layout objects: icon and text */
static inline void
-_icon_signal_emit(Efl_Ui_Layout_Data *sd,
+_signals_emit(Eo *obj,
+ const char *type,
+ Eina_Bool set)
+{
+ char buf[1024];
+
+ if (elm_widget_is_legacy(obj))
+ {
+ snprintf(buf, sizeof(buf), "elm,state,%s,%s", type,
+ set ? "visible" : "hidden");
+ efl_layout_signal_emit(obj, buf, "elm");
+ }
+ else
+ {
+ snprintf(buf, sizeof(buf), "efl,state,%s,%s", type,
+ set ? "set" : "unset");
+ efl_layout_signal_emit(obj, buf, "efl");
+ }
+}
+
+static inline void
+_icon_signal_emit(Efl_Ui_Layout_Object_Data *sd,
Efl_Ui_Layout_Sub_Object_Data *sub_d,
Eina_Bool visible)
{
- char buf[1024];
const char *type;
+ Eo *edje;
int i;
+ edje = elm_widget_resize_object_get(sd->obj);
+ if (!edje) return;
+
//FIXME: Don't limit to the icon and end here.
// send signals for all contents after elm 2.0
if (sub_d->type != SWALLOW) return;
- for (i = 0;; i++)
+ if (elm_widget_is_legacy(sd->obj))
{
- if (!_efl_ui_layout_swallow_parts[i]) return;
- if (!strcmp(sub_d->part, _efl_ui_layout_swallow_parts[i])) break;
+ for (i = 0;; i++)
+ {
+ if (!_elm_legacy_layout_swallow_parts[i]) return;
+ if (!strcmp(sub_d->part, _elm_legacy_layout_swallow_parts[i])) break;
+ }
}
-
- if (!strncmp(sub_d->part, "elm.swallow.", strlen("elm.swallow.")))
- type = sub_d->part + strlen("elm.swallow.");
else
- type = sub_d->part;
+ {
+ for (i = 0;; i++)
+ {
+ if (!_efl_ui_layout_swallow_parts[i]) return;
+ if (!strcmp(sub_d->part, _efl_ui_layout_swallow_parts[i])) break;
+ }
+ }
- snprintf(buf, sizeof(buf), "elm,state,%s,%s", type,
- visible ? "visible" : "hidden");
+ if (elm_widget_is_legacy(sd->obj))
+ {
+ if (!strncmp(sub_d->part, "elm.swallow.", strlen("elm.swallow.")))
+ type = sub_d->part + strlen("elm.swallow.");
+ else
+ type = sub_d->part;
+ }
+ else
+ {
+ if (!strncmp(sub_d->part, "efl.", strlen("efl.")))
+ type = sub_d->part + strlen("efl.");
+ else
+ type = sub_d->part;
+ }
- ELM_WIDGET_DATA_GET_OR_RETURN(sd->obj, wd);
- edje_object_signal_emit(wd->resize_obj, buf, "elm");
+ _signals_emit(sd->obj, type, visible);
/* themes might need immediate action here */
- edje_object_message_signal_process(wd->resize_obj);
+ efl_layout_signal_process(sd->obj, EINA_FALSE);
}
static inline void
-_text_signal_emit(Efl_Ui_Layout_Data *sd,
+_text_signal_emit(Efl_Ui_Layout_Object_Data *sd,
Efl_Ui_Layout_Sub_Object_Data *sub_d,
Eina_Bool visible)
{
@@ -201,34 +252,55 @@ _text_signal_emit(Efl_Ui_Layout_Data *sd,
//FIXME: Don't limit to "elm.text" prefix.
//Send signals for all text parts after elm 2.0
- if ((sub_d->type != TEXT) ||
- (!((!strcmp("elm.text", sub_d->part)) ||
- (!strncmp("elm.text.", sub_d->part, 9)))))
- return;
+ if (sub_d->type != TEXT) return;
+
+ if (elm_widget_is_legacy(sd->obj))
+ {
+ if (!((!strcmp("elm.text", sub_d->part)) ||
+ (!strncmp("elm.text.", sub_d->part, 9))))
+ return;
+ }
+ else
+ {
+ if (!((!strcmp("efl.text", sub_d->part)) ||
+ (!strncmp("efl.text.", sub_d->part, 9))))
+ return;
+ }
ELM_WIDGET_DATA_GET_OR_RETURN(sd->obj, wd);
- if (!strncmp(sub_d->part, "elm.text.", strlen("elm.text.")))
- type = sub_d->part + strlen("elm.text.");
+ if (elm_widget_is_legacy(sd->obj))
+ {
+ if (!strncmp(sub_d->part, "elm.text.", strlen("elm.text.")))
+ type = sub_d->part + strlen("elm.text.");
+ else
+ type = sub_d->part;
+ }
else
- type = sub_d->part;
+ {
+ if (!strncmp(sub_d->part, "efl.", strlen("efl.")))
+ type = sub_d->part + strlen("efl.");
+ else
+ type = sub_d->part;
+ }
- snprintf(buf, sizeof(buf), "elm,state,%s,%s", type,
- visible ? "visible" : "hidden");
- edje_object_signal_emit(wd->resize_obj, buf, "elm");
+ _signals_emit(sd->obj, type, visible);
/* TODO: is this right? It was like that, but IMO it should be removed: */
- snprintf(buf, sizeof(buf),
- visible ? "elm,state,text,visible" : "elm,state,text,hidden");
- edje_object_signal_emit(wd->resize_obj, buf, "elm");
+ if (elm_widget_is_legacy(sd->obj))
+ {
+ snprintf(buf, sizeof(buf),
+ visible ? "elm,state,text,visible" : "elm,state,text,hidden");
+ efl_layout_signal_emit(sd->obj, buf, "elm");
+ }
/* themes might need immediate action here */
- edje_object_message_signal_process(wd->resize_obj);
+ efl_layout_signal_process(sd->obj, EINA_FALSE);
}
static void
-_parts_signals_emit(Efl_Ui_Layout_Data *sd)
+_parts_signals_emit(Efl_Ui_Layout_Object_Data *sd)
{
const Eina_List *l;
Efl_Ui_Layout_Sub_Object_Data *sub_d;
@@ -249,7 +321,7 @@ _part_cursor_part_apply(const Efl_Ui_Layout_Sub_Object_Cursor *pc)
}
static void
-_parts_cursors_apply(Efl_Ui_Layout_Data *sd)
+_parts_cursors_apply(Efl_Ui_Layout_Object_Data *sd)
{
const Eina_List *l;
const char *file, *group;
@@ -260,8 +332,12 @@ _parts_cursors_apply(Efl_Ui_Layout_Data *sd)
EINA_LIST_FOREACH(sd->parts_cursors, l, pc)
{
- Evas_Object *obj = (Evas_Object *)edje_object_part_object_get
- (wd->resize_obj, pc->part);
+ Evas_Object *obj;
+
+ edje_object_freeze(wd->resize_obj);
+ obj = (Evas_Object *)edje_object_part_object_get
+ (wd->resize_obj, pc->part);
+ edje_object_thaw(wd->resize_obj);
if (!obj)
{
@@ -309,7 +385,7 @@ _efl_ui_layout_highlight_in_theme(Evas_Object *obj)
static Eina_Bool
_visuals_refresh(Evas_Object *obj,
- Efl_Ui_Layout_Data *sd)
+ Efl_Ui_Layout_Object_Data *sd)
{
Eina_Bool ret = EINA_FALSE;
@@ -323,7 +399,7 @@ _visuals_refresh(Evas_Object *obj,
edje_object_scale_set
(wd->resize_obj,
- efl_gfx_scale_get(obj) * elm_config_scale_get());
+ efl_gfx_entity_scale_get(obj) * elm_config_scale_get());
_efl_ui_layout_highlight_in_theme(obj);
@@ -335,24 +411,36 @@ _visuals_refresh(Evas_Object *obj,
}
EOLIAN static Eina_Bool
-_efl_ui_layout_elm_widget_on_disabled_update(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED, Eina_Bool disabled)
+_efl_ui_layout_object_efl_ui_widget_on_disabled_update(Eo *obj, Efl_Ui_Layout_Object_Data *_pd EINA_UNUSED, Eina_Bool disabled)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
// Not calling efl_super here: Elm.Widget simply returns false.
- if (disabled)
- edje_object_signal_emit
- (wd->resize_obj, "elm,state,disabled", "elm");
+ if (elm_widget_is_legacy(obj))
+ {
+ if (disabled)
+ edje_object_signal_emit
+ (wd->resize_obj, "elm,state,disabled", "elm");
+ else
+ edje_object_signal_emit
+ (wd->resize_obj, "elm,state,enabled", "elm");
+ }
else
- edje_object_signal_emit
- (wd->resize_obj, "elm,state,enabled", "elm");
+ {
+ if (disabled)
+ edje_object_signal_emit
+ (wd->resize_obj, "efl,state,disabled", "efl");
+ else
+ edje_object_signal_emit
+ (wd->resize_obj, "efl,state,enabled", "efl");
+ }
return EINA_TRUE;
}
static Efl_Ui_Theme_Apply
-_efl_ui_layout_theme_internal(Eo *obj, Efl_Ui_Layout_Data *sd)
+_efl_ui_layout_theme_internal(Eo *obj, Efl_Ui_Layout_Object_Data *sd)
{
Efl_Ui_Theme_Apply ret = EFL_UI_THEME_APPLY_FAILED;
@@ -363,13 +451,13 @@ _efl_ui_layout_theme_internal(Eo *obj, Efl_Ui_Layout_Data *sd)
{
ret = elm_widget_theme_object_set
(obj, wd->resize_obj,
- elm_widget_theme_klass_get(obj),
+ elm_widget_theme_klass_get(obj),
elm_widget_theme_element_get(obj),
elm_widget_theme_style_get(obj));
}
if (ret)
- efl_event_callback_legacy_call(obj, EFL_UI_LAYOUT_EVENT_THEME_CHANGED, NULL);
+ efl_event_callback_legacy_call(obj, EFL_UI_LAYOUT_OBJECT_EVENT_THEME_CHANGED, NULL);
if (!_visuals_refresh(obj, sd))
ret = EFL_UI_THEME_APPLY_FAILED;
@@ -378,7 +466,7 @@ _efl_ui_layout_theme_internal(Eo *obj, Efl_Ui_Layout_Data *sd)
}
EOLIAN static Efl_Ui_Theme_Apply
-_efl_ui_layout_elm_widget_theme_apply(Eo *obj, Efl_Ui_Layout_Data *sd)
+_efl_ui_layout_object_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Layout_Object_Data *sd)
{
Efl_Ui_Theme_Apply theme_apply = EFL_UI_THEME_APPLY_FAILED;
@@ -390,7 +478,7 @@ _efl_ui_layout_elm_widget_theme_apply(Eo *obj, Efl_Ui_Layout_Data *sd)
}
EOLIAN static Eina_Bool
-_efl_ui_layout_elm_widget_on_focus_update(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED, Elm_Object_Item *item EINA_UNUSED)
+_efl_ui_layout_object_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Layout_Object_Data *_pd EINA_UNUSED)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
@@ -398,16 +486,22 @@ _efl_ui_layout_elm_widget_on_focus_update(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_
if (efl_ui_focus_object_focus_get(obj))
{
- elm_layout_signal_emit(obj, "elm,action,focus", "elm");
+ if (elm_widget_is_legacy(obj))
+ elm_layout_signal_emit(obj, "elm,action,focus", "elm");
+ else
+ elm_layout_signal_emit(obj, "efl,action,focus", "efl");
evas_object_focus_set(wd->resize_obj, EINA_TRUE);
}
else
{
- elm_layout_signal_emit(obj, "elm,action,unfocus", "elm");
+ if (elm_widget_is_legacy(obj))
+ elm_layout_signal_emit(obj, "elm,action,unfocus", "elm");
+ else
+ elm_layout_signal_emit(obj, "efl,action,unfocus", "efl");
evas_object_focus_set(wd->resize_obj, EINA_FALSE);
}
- efl_ui_widget_on_focus_update(efl_super(obj, MY_CLASS), item);
+ efl_ui_focus_object_on_focus_update(efl_super(obj, MY_CLASS));
if (efl_isa(wd->resize_obj, EFL_CANVAS_LAYOUT_CLASS))
edje_object_message_signal_process(wd->resize_obj);
@@ -416,7 +510,7 @@ _efl_ui_layout_elm_widget_on_focus_update(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_
}
EOLIAN static Eina_Bool
-_efl_ui_layout_elm_widget_widget_sub_object_add(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED, Evas_Object *sobj)
+_efl_ui_layout_object_efl_ui_widget_widget_sub_object_add(Eo *obj, Efl_Ui_Layout_Object_Data *_pd EINA_UNUSED, Evas_Object *sobj)
{
Eina_Bool int_ret = EINA_FALSE;
@@ -433,7 +527,7 @@ _efl_ui_layout_elm_widget_widget_sub_object_add(Eo *obj, Efl_Ui_Layout_Data *_pd
}
EOLIAN static Eina_Bool
-_efl_ui_layout_elm_widget_widget_sub_object_del(Eo *obj, Efl_Ui_Layout_Data *sd, Evas_Object *sobj)
+_efl_ui_layout_object_efl_ui_widget_widget_sub_object_del(Eo *obj, Efl_Ui_Layout_Object_Data *sd, Evas_Object *sobj)
{
Eina_List *l;
Efl_Ui_Layout_Sub_Object_Data *sub_d;
@@ -464,7 +558,9 @@ _efl_ui_layout_elm_widget_widget_sub_object_del(Eo *obj, Efl_Ui_Layout_Data *sd,
break;
}
- elm_layout_sizing_eval(obj);
+ // No need to resize object during destruction
+ if (!efl_invalidated_get(obj))
+ elm_layout_sizing_eval(obj);
return EINA_TRUE;
}
@@ -487,6 +583,18 @@ _elm_layout_part_aliasing_eval(const Evas_Object *obj,
{
const Elm_Layout_Part_Alias_Description *aliases = NULL;
+ if (!elm_widget_is_legacy(obj))
+ {
+ if (!*part)
+ {
+ if (is_text)
+ *part = efl_ui_default_text;
+ else
+ *part = efl_ui_default_content;
+ }
+ return EINA_TRUE;
+ }
+
if (is_text)
aliases = elm_layout_text_aliases_get(obj);
else
@@ -537,7 +645,7 @@ _box_reference_del(void *data,
static Evas_Object *
_sub_box_remove(Evas_Object *obj,
- Efl_Ui_Layout_Data *sd,
+ Efl_Ui_Layout_Object_Data *sd,
Efl_Ui_Layout_Sub_Object_Data *sub_d)
{
Evas_Object *child = sub_d->obj; /* sub_d will die in
@@ -580,7 +688,7 @@ _sub_box_is(const Efl_Ui_Layout_Sub_Object_Data *sub_d)
static Evas_Object *
_sub_table_remove(Evas_Object *obj,
- Efl_Ui_Layout_Data *sd,
+ Efl_Ui_Layout_Object_Data *sd,
Efl_Ui_Layout_Sub_Object_Data *sub_d)
{
Evas_Object *child;
@@ -612,7 +720,7 @@ _on_size_evaluate_signal(void *data,
}
EOLIAN static void
-_efl_ui_layout_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED)
+_efl_ui_layout_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Layout_Object_Data *_pd EINA_UNUSED)
{
Evas_Object *edje;
@@ -626,18 +734,21 @@ _efl_ui_layout_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_
elm_widget_can_focus_set(obj, EINA_FALSE);
- edje_object_signal_callback_add
- (edje, "size,eval", "elm", _on_size_evaluate_signal, obj);
+ if (elm_widget_is_legacy(obj))
+ edje_object_signal_callback_add
+ (edje, "size,eval", "elm", _on_size_evaluate_signal, obj);
+ else
+ edje_object_signal_callback_add
+ (edje, "size,eval", "efl", _on_size_evaluate_signal, obj);
elm_layout_sizing_eval(obj);
}
EOLIAN static void
-_efl_ui_layout_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Layout_Data *sd)
+_efl_ui_layout_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Layout_Object_Data *sd)
{
Efl_Ui_Layout_Sub_Object_Data *sub_d;
Efl_Ui_Layout_Sub_Object_Cursor *pc;
- Efl_Ui_Layout_Sub_Connect *sc;
Edje_Signal_Data *esd;
Evas_Object *child;
Eina_List *l;
@@ -665,24 +776,20 @@ _efl_ui_layout_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Layout_Data *sd)
free(esd);
}
- if(sd->model)
+ if(sd->connect.model)
{
- efl_event_callback_del(sd->model, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _efl_model_properties_changed_cb, sd);
- efl_unref(sd->model);
- sd->model = NULL;
+ efl_event_callback_del(sd->connect.model, EFL_MODEL_EVENT_PROPERTIES_CHANGED,
+ _efl_model_properties_changed_cb, sd);
+ efl_unref(sd->connect.model);
+ sd->connect.model = NULL;
}
- EINA_LIST_FREE(sd->prop_connect, sc)
- {
- if (sc->future) efl_future_cancel(sc->future);
- sc->future = NULL;
- eina_stringshare_del(sc->name);
- eina_stringshare_del(sc->property);
- free(sc);
- }
- sd->prop_connect = NULL;
- eina_hash_free(sd->factories);
- sd->factories = NULL;
+ eina_hash_free(sd->connect.properties);
+ sd->connect.properties = NULL;
+ eina_hash_free(sd->connect.signals);
+ sd->connect.signals = NULL;
+ eina_hash_free(sd->connect.factories);
+ sd->connect.factories = NULL;
/* let's make our Edje object the *last* to be processed, since it
* may (smart) parent other sub objects here */
@@ -704,7 +811,7 @@ _efl_ui_layout_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Layout_Data *sd)
/* rewrite or extend this one on your derived class as to suit your
* needs */
EOLIAN static void
-_efl_ui_layout_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Layout_Data *sd)
+_efl_ui_layout_object_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Layout_Object_Data *sd)
{
if (sd->needs_size_calc)
{
@@ -714,7 +821,7 @@ _efl_ui_layout_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Layout_Data *sd)
}
static Efl_Ui_Layout_Sub_Object_Cursor *
-_parts_cursors_find(Efl_Ui_Layout_Data *sd,
+_parts_cursors_find(Efl_Ui_Layout_Object_Data *sd,
const char *part)
{
const Eina_List *l;
@@ -733,7 +840,7 @@ _parts_cursors_find(Efl_Ui_Layout_Data *sd,
* widget inheriting from elm_layout */
EOLIAN static Eina_Bool
-_efl_ui_layout_efl_file_file_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *file, const char *group)
+_efl_ui_layout_object_efl_file_file_set(Eo *obj, Efl_Ui_Layout_Object_Data *sd, const char *file, const char *group)
{
Eina_Bool int_ret = EINA_FALSE;
@@ -757,7 +864,7 @@ _efl_ui_layout_efl_file_file_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *fi
}
EOLIAN static void
-_efl_ui_layout_efl_file_file_get(Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED, const char **file, const char **group)
+_efl_ui_layout_object_efl_file_file_get(const Eo *obj, Efl_Ui_Layout_Object_Data *sd EINA_UNUSED, const char **file, const char **group)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
edje_object_file_get(wd->resize_obj, file, group);
@@ -765,7 +872,7 @@ _efl_ui_layout_efl_file_file_get(Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED, co
EOLIAN static Eina_Bool
-_efl_ui_layout_efl_file_mmap_set(Eo *obj, Efl_Ui_Layout_Data *sd, const Eina_File *file, const char *group)
+_efl_ui_layout_object_efl_file_mmap_set(Eo *obj, Efl_Ui_Layout_Object_Data *sd, const Eina_File *file, const char *group)
{
Eina_Bool int_ret = EINA_FALSE;
@@ -789,19 +896,18 @@ _efl_ui_layout_efl_file_mmap_set(Eo *obj, Efl_Ui_Layout_Data *sd, const Eina_Fil
}
EOLIAN static void
-_efl_ui_layout_efl_file_mmap_get(Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED, const Eina_File **file, const char **group)
+_efl_ui_layout_object_efl_file_mmap_get(const Eo *obj, Efl_Ui_Layout_Object_Data *sd EINA_UNUSED, const Eina_File **file, const char **group)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
efl_file_mmap_get(wd->resize_obj, file, group);
}
EOLIAN static Efl_Ui_Theme_Apply
-_efl_ui_layout_theme_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *klass, const char *group, const char *style)
+_efl_ui_layout_object_theme_set(Eo *obj, Efl_Ui_Layout_Object_Data *sd, const char *klass, const char *group, const char *style)
{
Eina_Bool changed = EINA_FALSE;
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
- if (!wd->legacy && efl_finalized_get(obj))
+ if (!elm_widget_is_legacy(obj) && efl_finalized_get(obj))
{
ERR("Efl.Ui.Layout.theme can only be set before finalize!");
return EFL_UI_THEME_APPLY_FAILED;
@@ -819,7 +925,7 @@ _efl_ui_layout_theme_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *klass, con
}
EOLIAN static void
-_efl_ui_layout_efl_layout_signal_signal_emit(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED, const char *emission, const char *source)
+_efl_ui_layout_object_efl_layout_signal_signal_emit(Eo *obj, Efl_Ui_Layout_Object_Data *_pd EINA_UNUSED, const char *emission, const char *source)
{
// Don't do anything else than call forward here
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
@@ -827,7 +933,7 @@ _efl_ui_layout_efl_layout_signal_signal_emit(Eo *obj, Efl_Ui_Layout_Data *_pd EI
}
EOLIAN static Eina_Bool
-_efl_ui_layout_efl_layout_signal_signal_callback_add(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED, const char *emission, const char *source, Efl_Signal_Cb func, void *data)
+_efl_ui_layout_object_efl_layout_signal_signal_callback_add(Eo *obj, Efl_Ui_Layout_Object_Data *_pd EINA_UNUSED, const char *emission, const char *source, Efl_Signal_Cb func, void *data)
{
// Don't do anything else than call forward here
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
@@ -835,7 +941,7 @@ _efl_ui_layout_efl_layout_signal_signal_callback_add(Eo *obj, Efl_Ui_Layout_Data
}
EOLIAN static Eina_Bool
-_efl_ui_layout_efl_layout_signal_signal_callback_del(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED, const char *emission, const char *source, Edje_Signal_Cb func, void *data)
+_efl_ui_layout_object_efl_layout_signal_signal_callback_del(Eo *obj, Efl_Ui_Layout_Object_Data *_pd EINA_UNUSED, const char *emission, const char *source, Edje_Signal_Cb func, void *data)
{
// Don't do anything else than call forward here
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
@@ -853,7 +959,7 @@ elm_layout_content_set(Evas_Object *obj, const char *swallow, Evas_Object *conte
EFL_UI_LAYOUT_CHECK(obj) EINA_FALSE;
if (!swallow)
{
- swallow = elm_widget_default_content_part_get(obj);
+ swallow = efl_ui_widget_default_content_part_get(obj);
if (!swallow) return EINA_FALSE;
}
else if (!_elm_layout_part_aliasing_eval(obj, &swallow, EINA_FALSE))
@@ -863,7 +969,7 @@ elm_layout_content_set(Evas_Object *obj, const char *swallow, Evas_Object *conte
}
static Eina_Bool
-_efl_ui_layout_content_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Evas_Object *content)
+_efl_ui_layout_content_set(Eo *obj, Efl_Ui_Layout_Object_Data *sd, const char *part, Evas_Object *content)
{
Efl_Ui_Layout_Sub_Object_Data *sub_d;
Eina_List *l;
@@ -935,9 +1041,11 @@ EAPI Evas_Object *
elm_layout_content_get(const Evas_Object *obj, const char *swallow)
{
EFL_UI_LAYOUT_CHECK(obj) NULL;
+ // If the object is already dead, their shouldn't be any part in it
+ if (efl_invalidated_get(obj)) return NULL;
if (!swallow)
{
- swallow = elm_widget_default_content_part_get(obj);
+ swallow = efl_ui_widget_default_content_part_get(obj);
if (!swallow) return NULL;
}
else if (!_elm_layout_part_aliasing_eval(obj, &swallow, EINA_FALSE))
@@ -947,7 +1055,7 @@ elm_layout_content_get(const Evas_Object *obj, const char *swallow)
}
static Evas_Object*
-_efl_ui_layout_content_get(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part)
+_efl_ui_layout_content_get(Eo *obj, Efl_Ui_Layout_Object_Data *sd, const char *part)
{
const Eina_List *l;
Efl_Ui_Layout_Sub_Object_Data *sub_d;
@@ -971,7 +1079,7 @@ elm_layout_content_unset(Evas_Object *obj, const char *swallow)
EFL_UI_LAYOUT_CHECK(obj) NULL;
if (!swallow)
{
- swallow = elm_widget_default_content_part_get(obj);
+ swallow = efl_ui_widget_default_content_part_get(obj);
if (!swallow) return NULL;
}
else if (!_elm_layout_part_aliasing_eval(obj, &swallow, EINA_FALSE))
@@ -981,7 +1089,7 @@ elm_layout_content_unset(Evas_Object *obj, const char *swallow)
}
static Evas_Object*
-_efl_ui_layout_content_unset(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part)
+_efl_ui_layout_content_unset(Eo *obj, Efl_Ui_Layout_Object_Data *sd, const char *part)
{
Efl_Ui_Layout_Sub_Object_Data *sub_d;
Eina_List *l;
@@ -1027,8 +1135,8 @@ _efl_ui_layout_content_unset(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part)
}
EOLIAN static Eina_Bool
-_efl_ui_layout_efl_container_content_remove(Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED,
- Efl_Gfx *content)
+_efl_ui_layout_object_efl_container_content_remove(Eo *obj, Efl_Ui_Layout_Object_Data *sd EINA_UNUSED,
+ Efl_Gfx_Entity *content)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
@@ -1050,7 +1158,7 @@ elm_layout_content_swallow_list_get(const Evas_Object *obj)
EFL_UI_LAYOUT_CHECK(obj) NULL;
Eina_List *ret = NULL;
Efl_Ui_Layout_Sub_Object_Data *sub_d = NULL;
- Efl_Ui_Layout_Data *sd = efl_data_scope_get(obj, MY_CLASS);
+ Efl_Ui_Layout_Object_Data *sd = efl_data_scope_get(obj, MY_CLASS);
Eina_List *l = NULL;
EINA_LIST_FOREACH(sd->subs, l, sub_d)
@@ -1074,7 +1182,7 @@ _sub_iterator_next(Efl_Ui_Layout_Sub_Iterator *it, void **data)
return EINA_TRUE;
}
-static Efl_Ui_Layout *
+static Efl_Ui_Layout_Object *
_sub_iterator_get_container(Efl_Ui_Layout_Sub_Iterator *it)
{
return it->object;
@@ -1088,7 +1196,7 @@ _sub_iterator_free(Efl_Ui_Layout_Sub_Iterator *it)
}
static Eina_Iterator *
-_sub_iterator_create(Eo *eo_obj, Efl_Ui_Layout_Data *sd)
+_sub_iterator_create(Eo *eo_obj, Efl_Ui_Layout_Object_Data *sd)
{
Efl_Ui_Layout_Sub_Iterator *it;
@@ -1108,25 +1216,24 @@ _sub_iterator_create(Eo *eo_obj, Efl_Ui_Layout_Data *sd)
}
EOLIAN static Eina_Iterator *
-_efl_ui_layout_efl_container_content_iterate(Eo *eo_obj EINA_UNUSED, Efl_Ui_Layout_Data *sd)
+_efl_ui_layout_object_efl_container_content_iterate(Eo *eo_obj EINA_UNUSED, Efl_Ui_Layout_Object_Data *sd)
{
return _sub_iterator_create(eo_obj, sd);
}
EOLIAN static int
-_efl_ui_layout_efl_container_content_count(Eo *eo_obj EINA_UNUSED, Efl_Ui_Layout_Data *sd)
+_efl_ui_layout_object_efl_container_content_count(Eo *eo_obj EINA_UNUSED, Efl_Ui_Layout_Object_Data *sd)
{
return eina_list_count(sd->subs);
}
static Eina_Bool
-_efl_ui_layout_text_generic_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, const char *text, Eina_Bool is_markup)
+_efl_ui_layout_text_generic_set(Eo *obj, Efl_Ui_Layout_Object_Data *sd, const char *part, const char *text, Eina_Bool is_markup)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
- Eina_List *l;
Efl_Ui_Layout_Sub_Object_Data *sub_d = NULL;
- Efl_Ui_Layout_Sub_Connect *sc;
+ Eina_List *l;
EINA_LIST_FOREACH(sd->subs, l, sub_d)
{
@@ -1150,7 +1257,7 @@ _efl_ui_layout_text_generic_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *par
if (!text) return EINA_TRUE;
- if (wd->legacy)
+ if (elm_widget_is_legacy(obj))
{
if (!edje_object_part_text_escaped_set
(wd->resize_obj, part, text))
@@ -1183,19 +1290,18 @@ _efl_ui_layout_text_generic_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *par
sub_d->obj = _elm_access_edje_object_part_object_register
(obj, elm_layout_edje_get(obj), part);
- if (sd->model)
+ if (sd->connect.model && !sd->connect.updating)
{
- EINA_LIST_FOREACH(sd->prop_connect, l, sc)
+ char *property = eina_hash_find(sd->connect.properties, sub_d->part);
+
+ if (property)
{
- if (sc->name == sub_d->part && !sd->view_updated)
- {
- Eina_Value v;
- eina_value_setup(&v, EINA_VALUE_TYPE_STRING);
- eina_value_set(&v, text);
- efl_model_property_set(sd->model, sc->property, &v);
- eina_value_flush(&v);
- break;
- }
+ Eina_Value v = EINA_VALUE_EMPTY;
+
+ eina_value_setup(&v, EINA_VALUE_TYPE_STRING);
+ eina_value_set(&v, text);
+
+ efl_model_property_set(sd->connect.model, property, &v);
}
}
@@ -1203,21 +1309,25 @@ _efl_ui_layout_text_generic_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *par
}
static Eina_Bool
-_efl_ui_layout_text_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, const char *text)
+_efl_ui_layout_text_set(Eo *obj, Efl_Ui_Layout_Object_Data *sd, const char *part, const char *text)
{
return _efl_ui_layout_text_generic_set(obj, sd, part, text, EINA_FALSE);
}
static const char*
-_efl_ui_layout_text_get(Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED, const char *part)
+_efl_ui_layout_text_get(Eo *obj, Efl_Ui_Layout_Object_Data *sd EINA_UNUSED, const char *part)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
+ if (elm_widget_is_legacy(obj))
+ {
+ return edje_object_part_text_get(wd->resize_obj, part);
+ }
return efl_text_get(efl_part(wd->resize_obj, part));
}
static const char*
-_efl_ui_layout_text_markup_get(Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED, const char *part)
+_efl_ui_layout_text_markup_get(Eo *obj, Efl_Ui_Layout_Object_Data *sd EINA_UNUSED, const char *part)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
@@ -1225,13 +1335,13 @@ _efl_ui_layout_text_markup_get(Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED, cons
}
static Eina_Bool
-_efl_ui_layout_text_markup_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, const char *text)
+_efl_ui_layout_text_markup_set(Eo *obj, Efl_Ui_Layout_Object_Data *sd, const char *part, const char *text)
{
return _efl_ui_layout_text_generic_set(obj, sd, part, text, EINA_TRUE);
}
static void
-_layout_box_subobj_init(Efl_Ui_Layout_Data *sd, Efl_Ui_Layout_Sub_Object_Data *sub_d, const char *part, Evas_Object *child)
+_layout_box_subobj_init(Efl_Ui_Layout_Object_Data *sd, Efl_Ui_Layout_Sub_Object_Data *sub_d, const char *part, Evas_Object *child)
{
sub_d->part = eina_stringshare_add(part);
sub_d->obj = child;
@@ -1240,7 +1350,7 @@ _layout_box_subobj_init(Efl_Ui_Layout_Data *sd, Efl_Ui_Layout_Sub_Object_Data *s
}
Eina_Bool
-_efl_ui_layout_box_append(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Evas_Object *child)
+_efl_ui_layout_box_append(Eo *obj, Efl_Ui_Layout_Object_Data *sd, const char *part, Evas_Object *child)
{
Efl_Ui_Layout_Sub_Object_Data *sub_d;
@@ -1277,7 +1387,7 @@ _efl_ui_layout_box_append(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Eva
}
Eina_Bool
-_efl_ui_layout_box_prepend(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Evas_Object *child)
+_efl_ui_layout_box_prepend(Eo *obj, Efl_Ui_Layout_Object_Data *sd, const char *part, Evas_Object *child)
{
Efl_Ui_Layout_Sub_Object_Data *sub_d;
@@ -1314,7 +1424,7 @@ _efl_ui_layout_box_prepend(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Ev
}
Eina_Bool
-_efl_ui_layout_box_insert_before(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Evas_Object *child, const Evas_Object *reference)
+_efl_ui_layout_box_insert_before(Eo *obj, Efl_Ui_Layout_Object_Data *sd, const char *part, Evas_Object *child, const Evas_Object *reference)
{
Efl_Ui_Layout_Sub_Object_Data *sub_d;
@@ -1356,7 +1466,7 @@ _efl_ui_layout_box_insert_before(Eo *obj, Efl_Ui_Layout_Data *sd, const char *pa
}
Eina_Bool
-_efl_ui_layout_box_insert_at(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Evas_Object *child, unsigned int pos)
+_efl_ui_layout_box_insert_at(Eo *obj, Efl_Ui_Layout_Object_Data *sd, const char *part, Evas_Object *child, unsigned int pos)
{
Efl_Ui_Layout_Sub_Object_Data *sub_d;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
@@ -1394,7 +1504,7 @@ _efl_ui_layout_box_insert_at(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part,
}
Evas_Object *
-_efl_ui_layout_box_remove(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Evas_Object *child)
+_efl_ui_layout_box_remove(Eo *obj, Efl_Ui_Layout_Object_Data *sd, const char *part, Evas_Object *child)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
@@ -1415,7 +1525,7 @@ _efl_ui_layout_box_remove(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Eva
}
Eina_Bool
-_efl_ui_layout_box_remove_all(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Eina_Bool clear)
+_efl_ui_layout_box_remove_all(Eo *obj, Efl_Ui_Layout_Object_Data *sd, const char *part, Eina_Bool clear)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(part, EINA_FALSE);
@@ -1445,7 +1555,7 @@ _efl_ui_layout_box_remove_all(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part,
}
Eina_Bool
-_efl_ui_layout_table_pack(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Evas_Object *child, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan)
+_efl_ui_layout_table_pack(Eo *obj, Efl_Ui_Layout_Object_Data *sd, const char *part, Evas_Object *child, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan)
{
Efl_Ui_Layout_Sub_Object_Data *sub_d;
@@ -1492,7 +1602,7 @@ _efl_ui_layout_table_pack(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Eva
}
Evas_Object *
-_efl_ui_layout_table_unpack(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Evas_Object *child)
+_efl_ui_layout_table_unpack(Eo *obj, Efl_Ui_Layout_Object_Data *sd, const char *part, Evas_Object *child)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
@@ -1514,7 +1624,7 @@ _efl_ui_layout_table_unpack(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, E
}
Eina_Bool
-_efl_ui_layout_table_clear(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Eina_Bool clear)
+_efl_ui_layout_table_clear(Eo *obj, Efl_Ui_Layout_Object_Data *sd, const char *part, Eina_Bool clear)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(part, EINA_FALSE);
@@ -1552,7 +1662,7 @@ elm_layout_edje_get(const Eo *obj)
}
EOLIAN static const char *
-_efl_ui_layout_efl_layout_group_group_data_get(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED, const char *key)
+_efl_ui_layout_object_efl_layout_group_group_data_get(const Eo *obj, Efl_Ui_Layout_Object_Data *_pd EINA_UNUSED, const char *key)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
@@ -1560,7 +1670,7 @@ _efl_ui_layout_efl_layout_group_group_data_get(Eo *obj, Efl_Ui_Layout_Data *_pd
}
EOLIAN static Eina_Size2D
-_efl_ui_layout_efl_layout_group_group_size_min_get(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED)
+_efl_ui_layout_object_efl_layout_group_group_size_min_get(const Eo *obj, Efl_Ui_Layout_Object_Data *_pd EINA_UNUSED)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_SIZE2D(0, 0));
@@ -1568,19 +1678,27 @@ _efl_ui_layout_efl_layout_group_group_size_min_get(Eo *obj, Efl_Ui_Layout_Data *
}
EOLIAN static Eina_Size2D
-_efl_ui_layout_efl_layout_group_group_size_max_get(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED)
+_efl_ui_layout_object_efl_layout_group_group_size_max_get(const Eo *obj, Efl_Ui_Layout_Object_Data *_pd EINA_UNUSED)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_SIZE2D(0, 0));
return efl_layout_group_size_max_get(wd->resize_obj);
}
+EOLIAN static Eina_Bool
+_efl_ui_layout_object_efl_layout_group_part_exist_get(const Eo *obj, Efl_Ui_Layout_Object_Data *_pd EINA_UNUSED, const char *part)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
+
+ return efl_layout_group_part_exist_get(wd->resize_obj, part);
+}
+
/* layout's sizing evaluation is deferred. evaluation requests are
* queued up and only flag the object as 'changed'. when it comes to
* Evas's rendering phase, it will be addressed, finally (see
* _efl_ui_layout_smart_calculate()). */
static void
-_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Layout_Data *sd)
+_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Layout_Object_Data *sd)
{
if (sd->frozen) return;
if (sd->needs_size_calc) return;
@@ -1592,7 +1710,7 @@ _elm_layout_sizing_eval(Eo *obj, Efl_Ui_Layout_Data *sd)
EAPI void
elm_layout_sizing_restricted_eval(Eo *obj, Eina_Bool w, Eina_Bool h)
{
- Efl_Ui_Layout_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
+ Efl_Ui_Layout_Object_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
if (!sd) return;
sd->restricted_calc_w = !!w;
@@ -1602,7 +1720,7 @@ elm_layout_sizing_restricted_eval(Eo *obj, Eina_Bool w, Eina_Bool h)
}
EOLIAN static int
-_efl_ui_layout_efl_layout_calc_calc_freeze(Eo *obj, Efl_Ui_Layout_Data *sd)
+_efl_ui_layout_object_efl_layout_calc_calc_freeze(Eo *obj, Efl_Ui_Layout_Object_Data *sd)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, 0);
@@ -1614,7 +1732,7 @@ _efl_ui_layout_efl_layout_calc_calc_freeze(Eo *obj, Efl_Ui_Layout_Data *sd)
}
EOLIAN static int
-_efl_ui_layout_efl_layout_calc_calc_thaw(Eo *obj, Efl_Ui_Layout_Data *sd)
+_efl_ui_layout_object_efl_layout_calc_calc_thaw(Eo *obj, Efl_Ui_Layout_Object_Data *sd)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, 0);
@@ -1628,7 +1746,7 @@ _efl_ui_layout_efl_layout_calc_calc_thaw(Eo *obj, Efl_Ui_Layout_Data *sd)
}
static Eina_Bool
-_efl_ui_layout_part_cursor_set(Efl_Ui_Layout_Data *sd, const char *part_name, const char *cursor)
+_efl_ui_layout_part_cursor_set(Efl_Ui_Layout_Object_Data *sd, const char *part_name, const char *cursor)
{
Evas_Object *part_obj;
Efl_Ui_Layout_Sub_Object_Cursor *pc;
@@ -1639,8 +1757,11 @@ _efl_ui_layout_part_cursor_set(Efl_Ui_Layout_Data *sd, const char *part_name, co
if (!cursor) return _efl_ui_layout_part_cursor_unset(sd, part_name);
+ edje_object_freeze(wd->resize_obj);
part_obj = (Evas_Object *)edje_object_part_object_get
(wd->resize_obj, part_name);
+ edje_object_thaw(wd->resize_obj);
+
if (!part_obj)
{
const char *group, *file;
@@ -1684,7 +1805,7 @@ _efl_ui_layout_part_cursor_set(Efl_Ui_Layout_Data *sd, const char *part_name, co
}
static const char *
-_efl_ui_layout_part_cursor_get(Efl_Ui_Layout_Data *sd, const char *part_name)
+_efl_ui_layout_part_cursor_get(Efl_Ui_Layout_Object_Data *sd, const char *part_name)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(part_name, NULL);
@@ -1696,7 +1817,7 @@ _efl_ui_layout_part_cursor_get(Efl_Ui_Layout_Data *sd, const char *part_name)
}
static Eina_Bool
-_efl_ui_layout_part_cursor_unset(Efl_Ui_Layout_Data *sd, const char *part_name)
+_efl_ui_layout_part_cursor_unset(Efl_Ui_Layout_Object_Data *sd, const char *part_name)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(part_name, EINA_FALSE);
@@ -1718,7 +1839,7 @@ _efl_ui_layout_part_cursor_unset(Efl_Ui_Layout_Data *sd, const char *part_name)
}
static Eina_Bool
-_efl_ui_layout_part_cursor_style_set(Efl_Ui_Layout_Data *sd, const char *part_name, const char *style)
+_efl_ui_layout_part_cursor_style_set(Efl_Ui_Layout_Object_Data *sd, const char *part_name, const char *style)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(part_name, EINA_FALSE);
@@ -1733,7 +1854,7 @@ _efl_ui_layout_part_cursor_style_set(Efl_Ui_Layout_Data *sd, const char *part_na
}
static const char*
-_efl_ui_layout_part_cursor_style_get(Efl_Ui_Layout_Data *sd, const char *part_name)
+_efl_ui_layout_part_cursor_style_get(Efl_Ui_Layout_Object_Data *sd, const char *part_name)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(part_name, NULL);
@@ -1745,7 +1866,7 @@ _efl_ui_layout_part_cursor_style_get(Efl_Ui_Layout_Data *sd, const char *part_na
}
static Eina_Bool
-_efl_ui_layout_part_cursor_engine_only_set(Efl_Ui_Layout_Data *sd, const char *part_name, Eina_Bool engine_only)
+_efl_ui_layout_part_cursor_engine_only_set(Efl_Ui_Layout_Object_Data *sd, const char *part_name, Eina_Bool engine_only)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(part_name, EINA_FALSE);
@@ -1760,7 +1881,7 @@ _efl_ui_layout_part_cursor_engine_only_set(Efl_Ui_Layout_Data *sd, const char *p
}
static Eina_Bool
-_efl_ui_layout_part_cursor_engine_only_get(Efl_Ui_Layout_Data *sd, const char *part_name)
+_efl_ui_layout_part_cursor_engine_only_get(Efl_Ui_Layout_Object_Data *sd, const char *part_name)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(part_name, EINA_FALSE);
@@ -1774,7 +1895,7 @@ _efl_ui_layout_part_cursor_engine_only_get(Efl_Ui_Layout_Data *sd, const char *p
EAPI Eina_Bool
elm_layout_edje_object_can_access_set(Eo *obj, Eina_Bool can_access)
{
- Efl_Ui_Layout_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
+ Efl_Ui_Layout_Object_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
EINA_SAFETY_ON_NULL_RETURN_VAL(sd, EINA_FALSE);
sd->can_access = !!can_access;
return EINA_TRUE;
@@ -1783,13 +1904,13 @@ elm_layout_edje_object_can_access_set(Eo *obj, Eina_Bool can_access)
EAPI Eina_Bool
elm_layout_edje_object_can_access_get(const Eo *obj)
{
- Efl_Ui_Layout_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
+ Efl_Ui_Layout_Object_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
EINA_SAFETY_ON_NULL_RETURN_VAL(sd, EINA_FALSE);
return sd->can_access;
}
EOLIAN static void
-_efl_ui_layout_efl_object_dbg_info_get(Eo *eo_obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED, Efl_Dbg_Info *root)
+_efl_ui_layout_efl_object_dbg_info_get(Eo *eo_obj, Efl_Ui_Layout_Object_Data *_pd EINA_UNUSED, Efl_Dbg_Info *root)
{
efl_dbg_info_get(efl_super(eo_obj, MY_CLASS), root);
ELM_WIDGET_DATA_GET_OR_RETURN(eo_obj, wd);
@@ -1815,238 +1936,241 @@ _efl_ui_layout_efl_object_dbg_info_get(Eo *eo_obj, Efl_Ui_Layout_Data *_pd EINA_
}
static void
-_prop_future_error_cb(void* data, Efl_Event const*event EINA_UNUSED)
+_efl_ui_layout_view_model_property_update(Efl_Ui_Layout_Object_Data *pd, const char *part, const char *fetch)
{
- Efl_Ui_Layout_Sub_Connect *sc = data;
- sc->future = NULL;
-}
+ Eina_Value *v = NULL;
+ char *value = NULL;
-static void
-_view_update(Efl_Ui_Layout_Sub_Connect *sc, const char *property)
-{
- Eina_Strbuf *buf;
+ v = efl_model_property_get(pd->connect.model, fetch);
+ if (!v) return;
- if (sc->is_signal == EINA_FALSE)
- {
- EFL_UI_LAYOUT_DATA_GET(sc->obj, pd);
- pd->view_updated = EINA_TRUE;
- elm_layout_text_set(sc->obj, sc->name, property);
- pd->view_updated = EINA_FALSE;
- return;
- }
+ if (eina_value_type_get(v) != EINA_VALUE_TYPE_ERROR)
+ value = eina_value_to_string(v);
- buf = eina_strbuf_new();
- eina_strbuf_append(buf, sc->name);
- eina_strbuf_replace_all(buf, "%v", property);
+ pd->connect.updating = EINA_TRUE; // Prevent recursive call to property_set while updating text
+ efl_text_set(efl_part(pd->obj, part), value);
+ pd->connect.updating = EINA_FALSE;
- elm_layout_signal_emit(sc->obj, eina_strbuf_string_get(buf), "elm");
- eina_strbuf_free(buf);
+ eina_value_free(v);
+ free(value);
}
static void
-_prop_future_then_cb(void* data, Efl_Event const*event)
+_efl_ui_layout_view_model_signal_update(Efl_Ui_Layout_Object_Data *pd, const char *signal, const char *fetch)
{
- Efl_Ui_Layout_Sub_Connect *sc = data;
- const Eina_Value_Type *vtype;
- Eina_Value *value = (Eina_Value *)((Efl_Future_Event_Success*)event->info)->value;
- Eina_Stringshare *selected;
- char *text;
+ Eina_Value *v = NULL;
+ Eina_Strbuf *buf;
+ char *value;
- sc->future = NULL;
- vtype= eina_value_type_get(value);
+ v = efl_model_property_get(pd->connect.model, fetch);
+ if (!v) return;
- if (vtype == EINA_VALUE_TYPE_STRING || vtype == EINA_VALUE_TYPE_STRINGSHARE)
+ if (eina_value_type_get(v) == EINA_VALUE_TYPE_ERROR)
{
- eina_value_get(value, &text);
- _view_update(sc, text);
- return;
+ Eina_Error error;
+
+ eina_value_get(v, &error);
+ ERR("Failed to fetch signal value. Error: %s", eina_error_msg_get(error));
+ return;
}
- selected = eina_stringshare_add("selected");
- if (vtype == EINA_VALUE_TYPE_UCHAR && sc->property == selected)
+ // FIXME: previous implementation would just do that for signal/part == "selected"
+ if (eina_value_type_get(v) == EINA_VALUE_TYPE_UCHAR)
{
- Eina_Bool sb = EINA_FALSE;
- eina_value_get(value, &sb);
- if (sb)
- _view_update(sc, "selected");
- else
- _view_update(sc, "unselected");
+ Eina_Bool bl;
+
+ eina_value_bool_get(v, &bl);
+ if (bl) value = strdup("selected");
+ else value = strdup("unselected");
}
else
{
- text = eina_value_to_string(value);
- _view_update(sc, text);
- free(text);
+ value = eina_value_to_string(v);
}
- eina_stringshare_del(selected);
+ buf = eina_strbuf_new();
+ // FIXME: is it really the form of signal we want to send ?
+ eina_strbuf_append_printf(buf, "%s%s", signal, value);
+ elm_layout_signal_emit(pd->obj, eina_strbuf_string_get(buf),
+ elm_widget_is_legacy(pd->obj) ? "elm" : "efl");
+
+ eina_strbuf_free(buf);
+ eina_value_free(v);
+ free(value);
}
static void
-_efl_ui_layout_view_model_update(Efl_Ui_Layout_Data *pd)
+_efl_ui_layout_view_model_content_update(Efl_Ui_Layout_Object_Data *pd, Efl_Ui_Factory *factory, const char *name)
{
- Efl_Ui_Layout_Sub_Connect *sc;
- Eina_List *l;
+ Efl_Gfx_Entity *content;
- if (!pd->prop_connect || !pd->model) return;
+ content = efl_ui_factory_create(factory, pd->connect.model, pd->obj);
+ elm_layout_content_set(pd->obj, name, content);
+}
- EINA_LIST_FOREACH(pd->prop_connect, l, sc)
- {
- if (sc->future) efl_future_cancel(sc->future);
- sc->future = efl_model_property_get(pd->model, sc->property);
- efl_future_then(sc->future, &_prop_future_then_cb, &_prop_future_error_cb, NULL, sc);
- }
+static void
+_efl_ui_layout_view_model_update(Efl_Ui_Layout_Object_Data *pd)
+{
+ Eina_Hash_Tuple *tuple;
+ Eina_Iterator *it;
+
+ if (!pd->connect.model) return ;
+
+ it = eina_hash_iterator_tuple_new(pd->connect.properties);
+ EINA_ITERATOR_FOREACH(it, tuple)
+ _efl_ui_layout_view_model_property_update(pd, tuple->data, tuple->key);
+ eina_iterator_free(it);
+
+ it = eina_hash_iterator_tuple_new(pd->connect.signals);
+ EINA_ITERATOR_FOREACH(it, tuple)
+ _efl_ui_layout_view_model_signal_update(pd, tuple->data, tuple->key);
+ eina_iterator_free(it);
+
+ it = eina_hash_iterator_tuple_new(pd->connect.factories);
+ EINA_ITERATOR_FOREACH(it, tuple)
+ _efl_ui_layout_view_model_content_update(pd, tuple->data, tuple->key);
+ eina_iterator_free(it);
}
static void
_efl_model_properties_changed_cb(void *data, const Efl_Event *event)
{
- Efl_Ui_Layout_Data *pd = data;
Efl_Model_Property_Event *evt = event->info;
- Eina_Stringshare *ss_prop;
- Efl_Ui_Layout_Sub_Connect *sc;
+ Efl_Ui_Layout_Object_Data *pd = data;
const char *prop;
Eina_Array_Iterator it;
unsigned int i;
- Eina_List *l;
- if (!evt->changed_properties || !pd->prop_connect) return;
+ if (!evt->changed_properties) return ;
EINA_ARRAY_ITER_NEXT(evt->changed_properties, i, prop, it)
{
- ss_prop = eina_stringshare_add(prop);
- EINA_LIST_FOREACH(pd->prop_connect, l, sc)
- {
- if (sc->property == ss_prop)
- {
- if (sc->future) efl_future_cancel(sc->future);
- sc->future = efl_model_property_get(pd->model, sc->property);
- efl_future_then(sc->future, &_prop_future_then_cb, &_prop_future_error_cb, NULL, sc);
- }
- }
- eina_stringshare_del(ss_prop);
+ Eina_Stringshare *sprop = eina_stringshare_add(prop);
+ const char *part;
+ const char *signal;
+ Efl_Ui_Factory *factory;
+
+ part = eina_hash_find(pd->connect.properties, sprop);
+ if (part) _efl_ui_layout_view_model_property_update(pd, part, sprop);
+
+ signal = eina_hash_find(pd->connect.signals, sprop);
+ if (signal) _efl_ui_layout_view_model_signal_update(pd, signal, sprop);
+
+ factory = eina_hash_find(pd->connect.factories, sprop);
+ if (factory) _efl_ui_layout_view_model_content_update(pd, factory, sprop);
+
+ eina_stringshare_del(sprop);
}
}
-EOLIAN static void
-_efl_ui_layout_efl_ui_view_model_set(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Data *pd, Efl_Model *model)
+static void
+_efl_ui_layout_connect_hash(Efl_Ui_Layout_Object_Data *pd)
{
- Efl_Ui_Layout_Sub_Connect *sc;
- Eina_List *l;
+ if (pd->connect.properties) return ;
- if (pd->model)
- {
- efl_event_callback_del(pd->model, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _efl_model_properties_changed_cb, pd);
- EINA_LIST_FOREACH(pd->prop_connect, l, sc)
- if (sc->future) efl_future_cancel(sc->future);
+ // FIXME: fix destruction function definition
+ pd->connect.properties = eina_hash_stringshared_new(NULL); // Hash of property targeting a part
+ pd->connect.signals = eina_hash_stringshared_new(NULL); // Hash of property triggering a signal
+ pd->connect.factories = eina_hash_stringshared_new(EINA_FREE_CB(efl_unref)); // Hash of property triggering a content creation
+}
- efl_unref(pd->model);
- pd->model = NULL;
- }
+EOLIAN static void
+_efl_ui_layout_object_efl_ui_view_model_set(Eo *obj, Efl_Ui_Layout_Object_Data *pd, Efl_Model *model)
+{
+ Eina_Stringshare *name;
+ Eina_Hash_Tuple *tuple;
+ Eina_Iterator *it;
+
+ efl_replace(&pd->connect.model, model);
if (model)
{
- pd->model = model;
- efl_ref(pd->model);
- efl_event_callback_add(pd->model, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _efl_model_properties_changed_cb, pd);
+ efl_event_callback_add(pd->connect.model, EFL_MODEL_EVENT_PROPERTIES_CHANGED,
+ _efl_model_properties_changed_cb, pd);
}
- else
- {
- EINA_LIST_FOREACH(pd->prop_connect, l, sc)
- {
- if (!sc->is_signal)
- elm_layout_text_set(obj, sc->name, NULL);
- }
- return;
- }
+ _efl_ui_layout_connect_hash(pd);
- if (pd->prop_connect)
- _efl_ui_layout_view_model_update(pd);
+ // Reset to empty state
+ it = eina_hash_iterator_key_new(pd->connect.properties);
+ EINA_ITERATOR_FOREACH(it, name)
+ {
+ efl_text_set(efl_part(obj, name), NULL);
+ }
+ eina_iterator_free(it);
- if (pd->factories)
+ it = eina_hash_iterator_tuple_new(pd->connect.factories);
+ EINA_ITERATOR_FOREACH(it, tuple)
{
- Eina_Hash_Tuple *tuple;
- Eina_Stringshare *name;
- Efl_Ui_Factory *factory;
- Efl_Gfx *content;
+ Efl_Ui_Factory *factory;
+ Efl_Gfx_Entity *content;
- Eina_Iterator *it_p = eina_hash_iterator_tuple_new(pd->factories);
- while (eina_iterator_next(it_p, (void **)&tuple))
- {
- name = tuple->key;
- factory = tuple->data;
- content = elm_layout_content_get(pd->obj, name);
+ name = tuple->key;
+ factory = tuple->data;
+ content = elm_layout_content_get(obj, name);
- if (content && efl_isa(content, EFL_UI_VIEW_INTERFACE))
- {
- efl_ui_view_model_set(content, pd->model);
- }
- else
- {
- efl_ui_factory_release(factory, content);
- content = efl_ui_factory_create(factory, pd->model, pd->obj);
- elm_layout_content_set(pd->obj, name, content);
- }
- }
- eina_iterator_free(it_p);
+ elm_layout_content_set(obj, name, NULL);
+ efl_ui_factory_release(factory, content);
}
+ eina_iterator_free(it);
+
+ // Refresh content if necessary
+ _efl_ui_layout_view_model_update(pd);
}
EOLIAN static Efl_Model *
-_efl_ui_layout_efl_ui_view_model_get(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Data *pd)
+_efl_ui_layout_object_efl_ui_view_model_get(const Eo *obj EINA_UNUSED, Efl_Ui_Layout_Object_Data *pd)
{
- return pd->model;
+ return pd->connect.model;
}
EOLIAN static void
-_efl_ui_layout_efl_ui_model_connect_connect(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Data *pd, const char *name, const char *property)
+_efl_ui_layout_object_efl_ui_model_connect_connect(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Object_Data *pd, const char *name, const char *property)
{
EINA_SAFETY_ON_NULL_RETURN(name);
- EINA_SAFETY_ON_NULL_RETURN(property);
- Efl_Ui_Layout_Sub_Connect *sc, *fsc;
- Eina_List *l;
+ Eina_Stringshare *sprop;
+ Eina_Hash *hash = NULL;
+ char *data = NULL;
if (!_elm_layout_part_aliasing_eval(obj, &name, EINA_TRUE))
return;
- sc = calloc(1, sizeof(*sc));
- sc->obj = obj;
- sc->property = eina_stringshare_add(property);
+ _efl_ui_layout_connect_hash(pd);
- if (strncmp(SIGNAL_PREFIX, name, sizeof(SIGNAL_PREFIX) -1) == 0)
+ sprop = eina_stringshare_add(property);
+
+ // FIXME: prevent double connect of name to multiple property ?
+ if (strncmp(SIGNAL_PREFIX, name, sizeof(SIGNAL_PREFIX) - 1) == 0)
{
- sc->name = eina_stringshare_add(name+sizeof(SIGNAL_PREFIX) -1);
- sc->is_signal = EINA_TRUE;
+ hash = pd->connect.signals;
+ data = strdup(name + sizeof(SIGNAL_PREFIX) - 1);
}
else
{
- sc->name = eina_stringshare_add(name);
- sc->is_signal = EINA_FALSE;
+ hash = pd->connect.properties;
+ data = strdup(name);
}
- EINA_LIST_FOREACH(pd->prop_connect, l, fsc)
+ if (!sprop)
{
- if (fsc->name == sc->name && fsc->property == sc->property)
- {
- eina_stringshare_del(sc->name);
- eina_stringshare_del(sc->property);
- free(sc);
- return;
- }
+ // FIXME: remove the entry from the hash ?
}
-
- pd->prop_connect = eina_list_append(pd->prop_connect, sc);
-
- if (pd->model)
+ else
{
- sc->future = efl_model_property_get(pd->model, sc->property);
- efl_future_then(sc->future, &_prop_future_then_cb, &_prop_future_error_cb, NULL, sc);
+ eina_hash_add(hash, sprop, data);
}
+
+ // Update display right away if possible
+ if (!pd->connect.model) return ;
+
+ if (hash == pd->connect.signals)
+ _efl_ui_layout_view_model_signal_update(pd, data, sprop);
+ else
+ _efl_ui_layout_view_model_property_update(pd, data, sprop);
}
EOLIAN static void
-_efl_ui_layout_efl_ui_model_factory_connect_connect(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Data *pd,
+_efl_ui_layout_object_efl_ui_factory_model_connect(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Object_Data *pd,
const char *name, Efl_Ui_Factory *factory)
{
EINA_SAFETY_ON_NULL_RETURN(name);
@@ -2059,13 +2183,13 @@ _efl_ui_layout_efl_ui_model_factory_connect_connect(Eo *obj EINA_UNUSED, Efl_Ui_
ss_name = eina_stringshare_add(name);
- if (!pd->factories)
- pd->factories = eina_hash_stringshared_new(EINA_FREE_CB(efl_unref));
+ if (!pd->connect.factories)
+ pd->connect.factories = eina_hash_stringshared_new(EINA_FREE_CB(efl_unref));
- new_ev = efl_ui_factory_create(factory, pd->model, obj);
+ new_ev = efl_ui_factory_create(factory, pd->connect.model, obj);
EINA_SAFETY_ON_NULL_RETURN(new_ev);
- old_factory = eina_hash_set(pd->factories, ss_name, efl_ref(factory));
+ old_factory = eina_hash_set(pd->connect.factories, ss_name, efl_ref(factory));
if (old_factory)
{
old_ev = elm_layout_content_get(obj, name);
@@ -2077,32 +2201,19 @@ _efl_ui_layout_efl_ui_model_factory_connect_connect(Eo *obj EINA_UNUSED, Efl_Ui_
elm_layout_content_set(obj, name, new_ev);
}
-EAPI Evas_Object *
-elm_layout_add(Evas_Object *parent)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return elm_legacy_add(MY_CLASS, parent);
-}
-
EOLIAN static Eo *
-_efl_ui_layout_efl_object_constructor(Eo *obj, Efl_Ui_Layout_Data *sd)
+_efl_ui_layout_object_efl_object_constructor(Eo *obj, Efl_Ui_Layout_Object_Data *sd)
{
sd->obj = obj;
obj = efl_constructor(efl_super(obj, MY_CLASS));
- efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_FILLER);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_FILLER);
return obj;
}
-EOLIAN static void _efl_ui_layout_class_constructor(Efl_Class *klass)
-{
- evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
-}
-
EOLIAN static Efl_Object*
-_efl_ui_layout_efl_object_finalize(Eo *obj, Efl_Ui_Layout_Data *pd EINA_UNUSED)
+_efl_ui_layout_object_efl_object_finalize(Eo *obj, Efl_Ui_Layout_Object_Data *pd EINA_UNUSED)
{
Eo *eo;
@@ -2113,21 +2224,280 @@ _efl_ui_layout_efl_object_finalize(Eo *obj, Efl_Ui_Layout_Data *pd EINA_UNUSED)
}
EOLIAN static void
-_efl_ui_layout_efl_layout_signal_message_send(Eo *obj, Efl_Ui_Layout_Data *pd EINA_UNUSED, int id, const Eina_Value msg)
+_efl_ui_layout_object_efl_layout_signal_message_send(Eo *obj, Efl_Ui_Layout_Object_Data *pd EINA_UNUSED, int id, const Eina_Value msg)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
efl_layout_signal_message_send(wd->resize_obj, id, msg);
}
EOLIAN static void
-_efl_ui_layout_efl_layout_signal_signal_process(Eo *obj, Efl_Ui_Layout_Data *pd EINA_UNUSED, Eina_Bool recurse)
+_efl_ui_layout_object_efl_layout_signal_signal_process(Eo *obj, Efl_Ui_Layout_Object_Data *pd EINA_UNUSED, Eina_Bool recurse)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
efl_layout_signal_process(wd->resize_obj, recurse);
}
+/* Efl.Part implementation */
+
+EOLIAN static Eo *
+_efl_ui_layout_object_efl_part_part_get(const Eo *obj, Efl_Ui_Layout_Object_Data *sd EINA_UNUSED, const char *part)
+{
+ Efl_Canvas_Layout_Part_Type type = EFL_CANVAS_LAYOUT_PART_TYPE_NONE;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
+ ELM_WIDGET_DATA_GET_OR_RETURN((Eo *) obj, wd, NULL);
+
+ // Check part type without using edje_object_part_object_get(), as this
+ // can cause recalc, which has side effects... and could be slow.
+
+ if (!elm_widget_is_legacy(obj))
+ {
+ if (eina_streq(part, "background"))
+ {
+ if (efl_layout_group_part_exist_get(wd->resize_obj, "efl.background"))
+ type = efl_canvas_layout_part_type_get(efl_part(wd->resize_obj, "efl.background"));
+ if (type != EFL_CANVAS_LAYOUT_PART_TYPE_SWALLOW)
+ {
+ if (type < EFL_CANVAS_LAYOUT_PART_TYPE_LAST &&
+ type > EFL_CANVAS_LAYOUT_PART_TYPE_NONE)
+ {
+ const char *file = NULL, *key = NULL;
+ efl_file_get(wd->resize_obj, &file, &key);
+ WRN("Layout has a background but it's not a swallow: '%s'",
+ elm_widget_theme_element_get(obj));
+ }
+ return efl_part_get(efl_super(obj, MY_CLASS), part);
+ }
+
+ return ELM_PART_IMPLEMENT(EFL_UI_LAYOUT_PART_BG_CLASS, obj, part);
+ }
+ else if (eina_streq(part, "shadow"))
+ return efl_part_get(efl_super(obj, MY_CLASS), part);
+ }
+
+ if (!efl_layout_group_part_exist_get(wd->resize_obj, part))
+ {
+ // edje part will handle the error message
+ return efl_part_get(wd->resize_obj, part);
+ }
+
+ type = efl_canvas_layout_part_type_get(efl_part(wd->resize_obj, part));
+ if (type >= EFL_CANVAS_LAYOUT_PART_TYPE_LAST)
+ {
+ ERR("Invalid type found for part '%s' in group '%s'",
+ part, elm_widget_theme_element_get(obj));
+ return NULL;
+ }
-/* Legacy APIs */
+ switch (type)
+ {
+ case EFL_CANVAS_LAYOUT_PART_TYPE_BOX:
+ case EFL_CANVAS_LAYOUT_PART_TYPE_TABLE:
+ return _efl_ui_layout_pack_proxy_get((Eo *) obj, type, part);
+ case EFL_CANVAS_LAYOUT_PART_TYPE_TEXT:
+ case EFL_CANVAS_LAYOUT_PART_TYPE_TEXTBLOCK:
+ return ELM_PART_IMPLEMENT(EFL_UI_LAYOUT_PART_TEXT_CLASS, obj, part);
+ case EFL_CANVAS_LAYOUT_PART_TYPE_SWALLOW:
+ return ELM_PART_IMPLEMENT(EFL_UI_LAYOUT_PART_CONTENT_CLASS, obj, part);
+ default:
+ return ELM_PART_IMPLEMENT(EFL_UI_LAYOUT_PART_CLASS, obj, part);
+ }
+}
+
+static const char *
+_efl_ui_layout_default_content_part_get(const Eo *obj, Efl_Ui_Layout_Object_Data *sd EINA_UNUSED)
+{
+ const char *part = NULL;
+ if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_FALSE))
+ return NULL;
+ return part;
+}
+
+static const char *
+_efl_ui_layout_default_text_part_get(const Eo *obj, Efl_Ui_Layout_Object_Data *sd EINA_UNUSED)
+{
+ const char *part = NULL;
+ if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE))
+ return NULL;
+ return part;
+}
+
+/* Efl.Ui.Layout.Part (common) */
+
+EOLIAN static Eina_Bool
+_efl_ui_layout_part_efl_ui_cursor_cursor_set(Eo *obj, void *_pd EINA_UNUSED, const char *cursor)
+{
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ Efl_Ui_Layout_Object_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
+ return _efl_ui_layout_part_cursor_set(sd, pd->part, cursor);
+}
+
+EOLIAN static const char *
+_efl_ui_layout_part_efl_ui_cursor_cursor_get(const Eo *obj, void *_pd EINA_UNUSED)
+{
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ Efl_Ui_Layout_Object_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
+ return _efl_ui_layout_part_cursor_get(sd, pd->part);
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_layout_part_efl_ui_cursor_cursor_style_set(Eo *obj, void *_pd EINA_UNUSED, const char *style)
+{
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ Efl_Ui_Layout_Object_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
+ return _efl_ui_layout_part_cursor_style_set(sd, pd->part, style);
+}
+
+EOLIAN static const char *
+_efl_ui_layout_part_efl_ui_cursor_cursor_style_get(const Eo *obj, void *_pd EINA_UNUSED)
+{
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ Efl_Ui_Layout_Object_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
+ return _efl_ui_layout_part_cursor_style_get(sd, pd->part);
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_layout_part_efl_ui_cursor_cursor_theme_search_enabled_set(Eo *obj, void *_pd EINA_UNUSED, Eina_Bool allow)
+{
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ Efl_Ui_Layout_Object_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
+ return _efl_ui_layout_part_cursor_engine_only_set(sd, pd->part, !allow);
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_layout_part_efl_ui_cursor_cursor_theme_search_enabled_get(const Eo *obj, void *_pd EINA_UNUSED)
+{
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ Efl_Ui_Layout_Object_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
+ return !_efl_ui_layout_part_cursor_engine_only_get(sd, pd->part);
+}
+
+#define CONTENT_FULL(part_typename, typename, CLASS, TYPENAME) \
+ ELM_PART_OVERRIDE_CONTENT_GET_FULL(part_typename, typename, ELM_PART_OVERRIDE_INTERNALS_FETCH(CLASS, TYPENAME)) \
+ ELM_PART_OVERRIDE_CONTENT_SET_FULL(part_typename, typename, ELM_PART_OVERRIDE_INTERNALS_FETCH(CLASS, TYPENAME)) \
+ ELM_PART_OVERRIDE_CONTENT_UNSET_FULL(part_typename, typename, ELM_PART_OVERRIDE_INTERNALS_FETCH(CLASS, TYPENAME))
+
+
+#define TEXT_FULL(part_typename, typename, CLASS, TYPENAME) \
+ ELM_PART_OVERRIDE_TEXT_TEXT_GET_FULL(part_typename, typename, ELM_PART_OVERRIDE_INTERNALS_FETCH(CLASS, TYPENAME)) \
+ ELM_PART_OVERRIDE_TEXT_TEXT_SET_FULL(part_typename, typename, ELM_PART_OVERRIDE_INTERNALS_FETCH(CLASS, TYPENAME)) \
+
+
+#define MARKUP_FULL(part_typename, typename, CLASS, TYPENAME) \
+ ELM_PART_OVERRIDE_TEXT_MARKUP_GET_FULL(part_typename, typename, ELM_PART_OVERRIDE_INTERNALS_FETCH(CLASS, TYPENAME)) \
+ ELM_PART_OVERRIDE_TEXT_MARKUP_SET_FULL(part_typename, typename, ELM_PART_OVERRIDE_INTERNALS_FETCH(CLASS, TYPENAME)) \
+
+/* Efl.Ui.Layout.Part_Content */
+CONTENT_FULL(efl_ui_layout_part_content, efl_ui_layout, EFL_UI_LAYOUT_OBJECT, Efl_Ui_Layout_Object_Data)
+
+/* Efl.Ui.Layout.Part_Text */
+TEXT_FULL(efl_ui_layout_part_text, efl_ui_layout, EFL_UI_LAYOUT_OBJECT, Efl_Ui_Layout_Object_Data)
+MARKUP_FULL(efl_ui_layout_part_text, efl_ui_layout, EFL_UI_LAYOUT_OBJECT, Efl_Ui_Layout_Object_Data)
+
+EOLIAN static const char *
+_efl_ui_layout_part_text_efl_ui_translatable_translatable_text_get(const Eo *obj, void *_pd EINA_UNUSED, const char **domain)
+{
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ return elm_widget_part_translatable_text_get(pd->obj, pd->part, domain);
+}
+
+EOLIAN static void
+_efl_ui_layout_part_text_efl_ui_translatable_translatable_text_set(Eo *obj, void *_pd EINA_UNUSED, const char *label, const char *domain)
+{
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ elm_widget_part_translatable_text_set(pd->obj, pd->part, label, domain);
+}
+
+/* Efl.Ui.Layout.Part_Legacy */
+CONTENT_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT_OBJECT, Efl_Ui_Layout_Object_Data)
+TEXT_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT_OBJECT, Efl_Ui_Layout_Object_Data)
+MARKUP_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT_OBJECT, Efl_Ui_Layout_Object_Data)
+
+EOLIAN static const char *
+_efl_ui_layout_part_legacy_efl_ui_translatable_translatable_text_get(const Eo *obj, void *_pd EINA_UNUSED, const char **domain)
+{
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ return elm_widget_part_translatable_text_get(pd->obj, pd->part, domain);
+}
+
+EOLIAN static void
+_efl_ui_layout_part_legacy_efl_ui_translatable_translatable_text_set(Eo *obj, void *_pd EINA_UNUSED, const char *label, const char *domain)
+{
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ elm_widget_part_translatable_text_set(pd->obj, pd->part, label, domain);
+}
+
+/* Efl.Ui.Layout.Part_Bg (common) */
+
+EOLIAN static Efl_Object *
+_efl_ui_layout_part_bg_efl_object_finalize(Eo *obj, void *_pd EINA_UNUSED)
+{
+ Efl_Ui_Layout_Object_Data *sd;
+ Elm_Part_Data *pd;
+ Eo *bg;
+
+ obj = efl_finalize(efl_super(obj, EFL_UI_LAYOUT_PART_BG_CLASS));
+ if (!obj) return NULL;
+
+ pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ sd = efl_data_scope_get(pd->obj, MY_CLASS);
+ bg = _efl_ui_widget_bg_get(pd->obj);
+ if (!_efl_ui_layout_content_set(pd->obj, sd, "efl.background", bg))
+ {
+ ERR("Failed to swallow new background object!");
+ // Shouldn't happen. What now? del bg? call super? return null?
+ }
+
+ return obj;
+}
+
+/* Efl.Ui.Layout.Part_Xxx includes */
+#include "efl_ui_layout_part.eo.c"
+#include "efl_ui_layout_part_content.eo.c"
+#include "efl_ui_layout_part_bg.eo.c"
+#include "efl_ui_layout_part_text.eo.c"
+#include "efl_ui_layout_part_legacy.eo.c"
+
+/* Efl.Part end */
+
+
+/* Internal EO APIs and hidden overrides */
+
+EAPI EFL_VOID_FUNC_BODY(elm_layout_sizing_eval)
+EFL_FUNC_BODY_CONST(elm_layout_text_aliases_get, const Elm_Layout_Part_Alias_Description *, NULL)
+EFL_FUNC_BODY_CONST(elm_layout_content_aliases_get, const Elm_Layout_Part_Alias_Description *, NULL)
+
+ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(MY_CLASS_PFX)
+ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX)
+
+#define EFL_UI_LAYOUT_OBJECT_EXTRA_OPS \
+ EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_layout), \
+ ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_layout), \
+ ELM_PART_TEXT_DEFAULT_OPS(efl_ui_layout), \
+ ELM_LAYOUT_CONTENT_ALIASES_OPS(MY_CLASS_PFX), \
+ ELM_LAYOUT_TEXT_ALIASES_OPS(MY_CLASS_PFX), \
+ EFL_OBJECT_OP_FUNC(elm_layout_sizing_eval, _elm_layout_sizing_eval), \
+ EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _efl_ui_layout_efl_object_dbg_info_get)
+
+#include "efl_ui_layout_object.eo.c"
+
+#include "efl_ui_layout_legacy.eo.h"
+
+
+EOLIAN static Eo *
+_efl_ui_layout_legacy_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED)
+{
+ obj = efl_constructor(efl_super(obj, EFL_UI_LAYOUT_LEGACY_CLASS));
+ efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
+ return obj;
+}
+
+EAPI Evas_Object *
+elm_layout_add(Evas_Object *parent)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ return elm_legacy_add(EFL_UI_LAYOUT_LEGACY_CLASS, parent);
+}
EAPI Eina_Bool
elm_layout_file_set(Eo *obj, const char *file, const char *group)
@@ -2222,7 +2592,7 @@ elm_layout_text_set(Eo *obj, const char *part, const char *text)
{
if (!part)
{
- part = elm_widget_default_text_part_get(obj);
+ part = efl_ui_widget_default_text_part_get(obj);
if (!part) return EINA_FALSE;
}
else if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE))
@@ -2237,7 +2607,7 @@ elm_layout_text_get(const Eo *obj, const char *part)
{
if (!part)
{
- part = elm_widget_default_text_part_get(obj);
+ part = efl_ui_widget_default_text_part_get(obj);
if (!part) return NULL;
}
else if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE))
@@ -2324,7 +2694,7 @@ _elm_layout_signal_callback_add_legacy(Eo *obj, Eo *edje, Eina_List **p_edje_sig
EAPI void
elm_layout_signal_callback_add(Eo *obj, const char *emission, const char *source, Edje_Signal_Cb func, void *data)
{
- Efl_Ui_Layout_Data *sd;
+ Efl_Ui_Layout_Object_Data *sd;
if (!emission || !source) return;
@@ -2378,7 +2748,7 @@ _elm_layout_signal_callback_del_legacy(Eo *obj EINA_UNUSED, Eo *edje, Eina_List
EAPI void *
elm_layout_signal_callback_del(Eo *obj, const char *emission, const char *source, Edje_Signal_Cb func)
{
- Efl_Ui_Layout_Data *sd;
+ Efl_Ui_Layout_Object_Data *sd;
if (!emission || !source) return NULL;
@@ -2410,237 +2780,8 @@ elm_layout_theme_set(Evas_Object *obj, const char *klass, const char *group, con
{
Efl_Ui_Theme_Apply ta;
- ta = efl_ui_layout_theme_set(obj, klass, group, style);
+ ta = efl_ui_layout_object_theme_set(obj, klass, group, style);
return (ta != EFL_UI_THEME_APPLY_FAILED);
}
-/* End of legacy only */
-
-
-/* Efl.Part implementation */
-
-EOLIAN static Eo *
-_efl_ui_layout_efl_part_part(const Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED, const char *part)
-{
- Efl_Canvas_Layout_Part_Type type;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
- ELM_WIDGET_DATA_GET_OR_RETURN((Eo *) obj, wd, NULL);
-
- // Check part type without using edje_object_part_object_get(), as this
- // can cause recalc, which has side effects... and could be slow.
- type = efl_canvas_layout_part_type_get(efl_part(wd->resize_obj, part));
-
- if (eina_streq(part, "background"))
- {
- if (type != EFL_CANVAS_LAYOUT_PART_TYPE_SWALLOW)
- {
- if (type < EFL_CANVAS_LAYOUT_PART_TYPE_LAST &&
- type > EFL_CANVAS_LAYOUT_PART_TYPE_NONE)
- {
- const char *file = NULL, *key = NULL;
- efl_file_get(wd->resize_obj, &file, &key);
- WRN("Layout has a background but it's not a swallow: '%s'",
- elm_widget_theme_element_get(obj));
- }
- return efl_part(efl_super(obj, MY_CLASS), part);
- }
-
- return ELM_PART_IMPLEMENT(EFL_UI_LAYOUT_PART_BG_CLASS, obj, part);
- }
- else if (eina_streq(part, "shadow"))
- return efl_part(efl_super(obj, MY_CLASS), part);
-
- if (type >= EFL_CANVAS_LAYOUT_PART_TYPE_LAST)
- {
- ERR("Invalid type found for part '%s' in group '%s'", part, elm_widget_theme_element_get(obj));
- return NULL;
- }
-
- switch (type)
- {
- case EFL_CANVAS_LAYOUT_PART_TYPE_BOX:
- case EFL_CANVAS_LAYOUT_PART_TYPE_TABLE:
- return _efl_ui_layout_pack_proxy_get((Eo *) obj, type, part);
- case EFL_CANVAS_LAYOUT_PART_TYPE_TEXT:
- case EFL_CANVAS_LAYOUT_PART_TYPE_TEXTBLOCK:
- return ELM_PART_IMPLEMENT(EFL_UI_LAYOUT_PART_TEXT_CLASS, obj, part);
- case EFL_CANVAS_LAYOUT_PART_TYPE_SWALLOW:
- return ELM_PART_IMPLEMENT(EFL_UI_LAYOUT_PART_CONTENT_CLASS, obj, part);
- case EFL_CANVAS_LAYOUT_PART_TYPE_NONE:
- WRN("No such part '%s' in group '%s'", part, elm_widget_theme_element_get(obj));
- return NULL;
- default:
- return ELM_PART_IMPLEMENT(EFL_UI_LAYOUT_PART_CLASS, obj, part);
- }
-}
-
-static const char *
-_efl_ui_layout_default_content_part_get(const Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED)
-{
- const char *part = NULL;
- if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_FALSE))
- return NULL;
- return part;
-}
-
-static const char *
-_efl_ui_layout_default_text_part_get(const Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED)
-{
- const char *part = NULL;
- if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE))
- return NULL;
- return part;
-}
-
-/* Efl.Ui.Layout.Part (common) */
-
-EOLIAN static Eina_Bool
-_efl_ui_layout_part_efl_ui_cursor_cursor_set(Eo *obj, void *_pd EINA_UNUSED, const char *cursor)
-{
- Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
- Efl_Ui_Layout_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
- return _efl_ui_layout_part_cursor_set(sd, pd->part, cursor);
-}
-
-EOLIAN static const char *
-_efl_ui_layout_part_efl_ui_cursor_cursor_get(Eo *obj, void *_pd EINA_UNUSED)
-{
- Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
- Efl_Ui_Layout_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
- return _efl_ui_layout_part_cursor_get(sd, pd->part);
-}
-
-EOLIAN static Eina_Bool
-_efl_ui_layout_part_efl_ui_cursor_cursor_style_set(Eo *obj, void *_pd EINA_UNUSED, const char *style)
-{
- Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
- Efl_Ui_Layout_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
- return _efl_ui_layout_part_cursor_style_set(sd, pd->part, style);
-}
-
-EOLIAN static const char *
-_efl_ui_layout_part_efl_ui_cursor_cursor_style_get(Eo *obj, void *_pd EINA_UNUSED)
-{
- Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
- Efl_Ui_Layout_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
- return _efl_ui_layout_part_cursor_style_get(sd, pd->part);
-}
-
-EOLIAN static Eina_Bool
-_efl_ui_layout_part_efl_ui_cursor_cursor_theme_search_enabled_set(Eo *obj, void *_pd EINA_UNUSED, Eina_Bool allow)
-{
- Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
- Efl_Ui_Layout_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
- return _efl_ui_layout_part_cursor_engine_only_set(sd, pd->part, !allow);
-}
-
-EOLIAN static Eina_Bool
-_efl_ui_layout_part_efl_ui_cursor_cursor_theme_search_enabled_get(Eo *obj, void *_pd EINA_UNUSED)
-{
- Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
- Efl_Ui_Layout_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
- return !_efl_ui_layout_part_cursor_engine_only_get(sd, pd->part);
-}
-
-/* Efl.Ui.Layout.Part_Content */
-ELM_PART_OVERRIDE_CONTENT_GET_FULL(efl_ui_layout_part_content, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
-ELM_PART_OVERRIDE_CONTENT_SET_FULL(efl_ui_layout_part_content, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
-ELM_PART_OVERRIDE_CONTENT_UNSET_FULL(efl_ui_layout_part_content, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
-
-/* Efl.Ui.Layout.Part_Text */
-ELM_PART_OVERRIDE_TEXT_GET_FULL(efl_ui_layout_part_text, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
-ELM_PART_OVERRIDE_TEXT_SET_FULL(efl_ui_layout_part_text, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
-ELM_PART_OVERRIDE_TEXT_MARKUP_GET_FULL(efl_ui_layout_part_text, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
-ELM_PART_OVERRIDE_TEXT_MARKUP_SET_FULL(efl_ui_layout_part_text, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
-
-EOLIAN static const char *
-_efl_ui_layout_part_text_efl_ui_translatable_translatable_text_get(Eo *obj, void *_pd EINA_UNUSED, const char **domain)
-{
- Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
- return elm_widget_part_translatable_text_get(pd->obj, pd->part, domain);
-}
-
-EOLIAN static void
-_efl_ui_layout_part_text_efl_ui_translatable_translatable_text_set(Eo *obj, void *_pd EINA_UNUSED, const char *label, const char *domain)
-{
- Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
- elm_widget_part_translatable_text_set(pd->obj, pd->part, label, domain);
-}
-
-/* Efl.Ui.Layout.Part_Legacy */
-ELM_PART_OVERRIDE_CONTENT_GET_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
-ELM_PART_OVERRIDE_CONTENT_SET_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
-ELM_PART_OVERRIDE_CONTENT_UNSET_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
-ELM_PART_OVERRIDE_TEXT_GET_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
-ELM_PART_OVERRIDE_TEXT_SET_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
-ELM_PART_OVERRIDE_TEXT_MARKUP_GET_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
-ELM_PART_OVERRIDE_TEXT_MARKUP_SET_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
-
-EOLIAN static const char *
-_efl_ui_layout_part_legacy_efl_ui_translatable_translatable_text_get(Eo *obj, void *_pd EINA_UNUSED, const char **domain)
-{
- Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
- return elm_widget_part_translatable_text_get(pd->obj, pd->part, domain);
-}
-
-EOLIAN static void
-_efl_ui_layout_part_legacy_efl_ui_translatable_translatable_text_set(Eo *obj, void *_pd EINA_UNUSED, const char *label, const char *domain)
-{
- Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
- elm_widget_part_translatable_text_set(pd->obj, pd->part, label, domain);
-}
-
-/* Efl.Ui.Layout.Part_Bg (common) */
-
-EOLIAN static Efl_Object *
-_efl_ui_layout_part_bg_efl_object_finalize(Eo *obj, void *_pd EINA_UNUSED)
-{
- Efl_Ui_Layout_Data *sd;
- Elm_Part_Data *pd;
- Eo *bg;
-
- obj = efl_finalize(efl_super(obj, EFL_UI_LAYOUT_PART_BG_CLASS));
- if (!obj) return NULL;
-
- pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
- sd = efl_data_scope_get(pd->obj, MY_CLASS);
- bg = _efl_ui_widget_bg_get(pd->obj);
- if (!_efl_ui_layout_content_set(pd->obj, sd, "background", bg))
- {
- ERR("Failed to swallow new background object!");
- // Shouldn't happen. What now? del bg? call super? return null?
- }
-
- return obj;
-}
-
-/* Efl.Ui.Layout.Part_Xxx includes */
-#include "efl_ui_layout_part.eo.c"
-#include "efl_ui_layout_part_content.eo.c"
-#include "efl_ui_layout_part_bg.eo.c"
-#include "efl_ui_layout_part_text.eo.c"
-#include "efl_ui_layout_part_legacy.eo.c"
-
-/* Efl.Part end */
-
-
-/* Internal EO APIs and hidden overrides */
-
-EAPI EFL_VOID_FUNC_BODY(elm_layout_sizing_eval)
-EFL_FUNC_BODY_CONST(elm_layout_text_aliases_get, const Elm_Layout_Part_Alias_Description *, NULL)
-EFL_FUNC_BODY_CONST(elm_layout_content_aliases_get, const Elm_Layout_Part_Alias_Description *, NULL)
-
-ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(MY_CLASS_PFX)
-ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX)
-
-#define EFL_UI_LAYOUT_EXTRA_OPS \
- EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_layout), \
- ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_layout), \
- ELM_PART_TEXT_DEFAULT_OPS(efl_ui_layout), \
- ELM_LAYOUT_CONTENT_ALIASES_OPS(MY_CLASS_PFX), \
- ELM_LAYOUT_TEXT_ALIASES_OPS(MY_CLASS_PFX), \
- EFL_OBJECT_OP_FUNC(elm_layout_sizing_eval, _elm_layout_sizing_eval), \
- EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _efl_ui_layout_efl_object_dbg_info_get)
-
-#include "efl_ui_layout.eo.c"
+#include "efl_ui_layout_legacy.eo.c"
diff --git a/src/lib/elementary/efl_ui_layout.eo b/src/lib/elementary/efl_ui_layout_object.eo
index 987e205ade..1aa121b10b 100644
--- a/src/lib/elementary/efl_ui_layout.eo
+++ b/src/lib/elementary/efl_ui_layout_object.eo
@@ -1,5 +1,7 @@
-class Efl.Ui.Layout (Elm.Widget, Efl.Part, Efl.Container, Efl.File,
- Efl.Ui.View, Efl.Ui.Model.Connect, Efl.Ui.Model.Factory.Connect,
+import efl_ui;
+
+class Efl.Ui.Layout.Object (Efl.Ui.Widget, Efl.Part, Efl.Container, Efl.File,
+ Efl.Ui.View, Efl.Ui.Model.Connect, Efl.Ui.Factory,
Efl.Layout.Calc, Efl.Layout.Signal,
Efl.Layout.Group)
{
@@ -14,12 +16,12 @@ class Efl.Ui.Layout (Elm.Widget, Efl.Part, Efl.Container, Efl.File,
Widgets that inherit from this class will call this function
automatically so it should not be called by applications, unless
- you are dealing directly with a @Efl.Ui.Layout object.
+ you are dealing directly with a @Efl.Ui.Layout.Object object.
]]
set {
[[Sets the edje group from the elementary theme that will be used
as layout. Note that $style will be the new style of this object,
- as in an @Elm.Widget.style. As a consequence this function can
+ as in an @Efl.Ui.Widget.style. As a consequence this function can
only be called during construction of the object, before finalize.
If this returns $false the widget is very likely to become
@@ -59,20 +61,21 @@ class Efl.Ui.Layout (Elm.Widget, Efl.Part, Efl.Container, Efl.File,
Efl.Layout.Group.group_data { get; }
Efl.Layout.Group.group_size_min { get; }
Efl.Layout.Group.group_size_max { get; }
- Elm.Widget.widget_sub_object_add;
- Elm.Widget.theme_apply;
- Elm.Widget.on_disabled_update;
- Elm.Widget.widget_sub_object_del;
- Elm.Widget.on_focus_update;
+ Efl.Layout.Group.part_exist { get; }
+ Efl.Ui.Widget.widget_sub_object_add;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.on_disabled_update;
+ Efl.Ui.Widget.widget_sub_object_del;
+ Efl.Ui.Focus.Object.on_focus_update;
Efl.Container.content_count;
Efl.Container.content_remove;
Efl.Container.content_iterate;
- Efl.Part.part;
+ Efl.Part.part_get;
Efl.Ui.View.model { get; set; }
Efl.Ui.Model.Connect.connect;
- Efl.Ui.Model.Factory.Connect.connect;
+ Efl.Ui.Factory.model_connect;
}
events {
- theme,changed; [[Called when theme changed]]
+ theme,changed: void; [[Called when theme changed]]
}
}
diff --git a/src/lib/elementary/efl_ui_layout_pack.c b/src/lib/elementary/efl_ui_layout_pack.c
index c45a13ed38..4cd9915bbf 100644
--- a/src/lib/elementary/efl_ui_layout_pack.c
+++ b/src/lib/elementary/efl_ui_layout_pack.c
@@ -5,6 +5,7 @@
#define ELM_LAYOUT_PROTECTED
#define EFL_UI_LAYOUT_PART_BOX_PROTECTED
#define EFL_UI_LAYOUT_PART_TABLE_PROTECTED
+#define EFL_PART_PROTECTED
#include <Elementary.h>
@@ -16,41 +17,32 @@
#include "../evas/canvas/evas_table.eo.h"
/* layout internals for box & table */
-Eina_Bool _efl_ui_layout_box_append(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Evas_Object *child);
-Eina_Bool _efl_ui_layout_box_prepend(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Evas_Object *child);
-Eina_Bool _efl_ui_layout_box_insert_before(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Evas_Object *child, const Evas_Object *reference);
-Eina_Bool _efl_ui_layout_box_insert_at(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Evas_Object *child, unsigned int pos);
-Evas_Object *_efl_ui_layout_box_remove(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Evas_Object *child);
-Eina_Bool _efl_ui_layout_box_remove_all(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Eina_Bool clear);
-Eina_Bool _efl_ui_layout_table_pack(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Evas_Object *child, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan);
-Evas_Object *_efl_ui_layout_table_unpack(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Evas_Object *child);
-Eina_Bool _efl_ui_layout_table_clear(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Eina_Bool clear);
+Eina_Bool _efl_ui_layout_box_append(Eo *obj, Efl_Ui_Layout_Object_Data *sd, const char *part, Evas_Object *child);
+Eina_Bool _efl_ui_layout_box_prepend(Eo *obj, Efl_Ui_Layout_Object_Data *sd, const char *part, Evas_Object *child);
+Eina_Bool _efl_ui_layout_box_insert_before(Eo *obj, Efl_Ui_Layout_Object_Data *sd, const char *part, Evas_Object *child, const Evas_Object *reference);
+Eina_Bool _efl_ui_layout_box_insert_at(Eo *obj, Efl_Ui_Layout_Object_Data *sd, const char *part, Evas_Object *child, unsigned int pos);
+Evas_Object *_efl_ui_layout_box_remove(Eo *obj, Efl_Ui_Layout_Object_Data *sd, const char *part, Evas_Object *child);
+Eina_Bool _efl_ui_layout_box_remove_all(Eo *obj, Efl_Ui_Layout_Object_Data *sd, const char *part, Eina_Bool clear);
+Eina_Bool _efl_ui_layout_table_pack(Eo *obj, Efl_Ui_Layout_Object_Data *sd, const char *part, Evas_Object *child, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan);
+Evas_Object *_efl_ui_layout_table_unpack(Eo *obj, Efl_Ui_Layout_Object_Data *sd, const char *part, Evas_Object *child);
+Eina_Bool _efl_ui_layout_table_clear(Eo *obj, Efl_Ui_Layout_Object_Data *sd, const char *part, Eina_Bool clear);
#define BOX_CLASS EFL_UI_LAYOUT_PART_BOX_CLASS
#define TABLE_CLASS EFL_UI_LAYOUT_PART_TABLE_CLASS
typedef struct _Layout_Part_Data Efl_Ui_Layout_Box_Data;
typedef struct _Layout_Part_Data Efl_Ui_Layout_Table_Data;
-typedef struct _Part_Item_Iterator Part_Item_Iterator;
struct _Layout_Part_Data
{
- Efl_Ui_Layout *obj; // no ref
- Efl_Ui_Layout_Data *sd; // data xref
+ Efl_Ui_Layout_Object *obj; // no ref
+ Efl_Ui_Layout_Object_Data *sd; // data xref
Eina_Stringshare *part;
unsigned char temp;
};
-struct _Part_Item_Iterator
-{
- Eina_Iterator iterator;
- Eina_List *list;
- Eina_Iterator *real_iterator;
- Eo *object;
-};
-
Eo *
-_efl_ui_layout_pack_proxy_get(Efl_Ui_Layout *obj, Edje_Part_Type type, const char *part)
+_efl_ui_layout_pack_proxy_get(Efl_Ui_Layout_Object *obj, Edje_Part_Type type, const char *part)
{
if (type == EDJE_PART_TYPE_BOX)
return efl_add(BOX_CLASS, obj,
@@ -75,74 +67,29 @@ EOLIAN static void
_efl_ui_layout_part_box_real_part_set(Eo *obj, Efl_Ui_Layout_Box_Data *pd, Eo *layout, const char *part)
{
pd->obj = layout;
- pd->sd = efl_data_xref(pd->obj, EFL_UI_LAYOUT_CLASS, obj);
+ pd->sd = efl_data_xref(pd->obj, EFL_UI_LAYOUT_OBJECT_CLASS, obj);
eina_stringshare_replace(&pd->part, part);
pd->temp = 1;
}
-/* this iterator is the same as efl_ui_box */
-static Eina_Bool
-_part_item_iterator_next(Part_Item_Iterator *it, void **data)
-{
- Efl_Gfx *sub;
-
- if (!it->object) return EINA_FALSE;
- if (!eina_iterator_next(it->real_iterator, (void **) &sub))
- return EINA_FALSE;
-
- if (data) *data = sub;
- return EINA_TRUE;
-}
-
-static Eo *
-_part_item_iterator_get_container(Part_Item_Iterator *it)
-{
- return it->object;
-}
-
-static void
-_part_item_iterator_free(Part_Item_Iterator *it)
-{
- eina_iterator_free(it->real_iterator);
- efl_wref_del(it->object, &it->object);
- eina_list_free(it->list);
- free(it);
-}
-
-static Eina_Iterator *
-_part_item_iterator_create(Eo *obj, Eina_Iterator *real_iterator, Eina_List *list)
-{
- Part_Item_Iterator *it;
-
- it = calloc(1, sizeof(*it));
- if (!it) return NULL;
-
- EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
-
- it->list = list;
- it->real_iterator = real_iterator;
- it->iterator.version = EINA_ITERATOR_VERSION;
- it->iterator.next = FUNC_ITERATOR_NEXT(_part_item_iterator_next);
- it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_part_item_iterator_get_container);
- it->iterator.free = FUNC_ITERATOR_FREE(_part_item_iterator_free);
- efl_wref_add(obj, &it->object);
-
- return &it->iterator;
-}
-
EOLIAN static Eina_Iterator *
_efl_ui_layout_part_box_efl_container_content_iterate(Eo *obj, Efl_Ui_Layout_Box_Data *pd)
{
Eina_Iterator *it;
+
+ edje_object_freeze(pd->obj);
Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
+ edje_object_thaw(pd->obj);
it = evas_object_box_iterator_new(pack);
- return _part_item_iterator_create(obj, it, NULL);
+ return efl_canvas_iterator_create(obj, it, NULL);
}
EOLIAN static int
_efl_ui_layout_part_box_efl_container_content_count(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Box_Data *pd)
{
+ edje_object_freeze(pd->obj);
Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
+ edje_object_thaw(pd->obj);
return evas_obj_box_count(pack);
}
@@ -159,48 +106,51 @@ _efl_ui_layout_part_box_efl_pack_unpack_all(Eo *obj EINA_UNUSED, Efl_Ui_Layout_B
}
EOLIAN static Eina_Bool
-_efl_ui_layout_part_box_efl_pack_unpack(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Box_Data *pd, Efl_Gfx *subobj)
+_efl_ui_layout_part_box_efl_pack_unpack(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Box_Data *pd, Efl_Gfx_Entity *subobj)
{
return _efl_ui_layout_box_remove(pd->obj, pd->sd, pd->part, subobj) != NULL;
}
EOLIAN static Eina_Bool
-_efl_ui_layout_part_box_efl_container_content_remove(Eo *obj, Efl_Ui_Layout_Box_Data *pd, Efl_Gfx *content)
+_efl_ui_layout_part_box_efl_container_content_remove(Eo *obj, Efl_Ui_Layout_Box_Data *pd, Efl_Gfx_Entity *content)
{
// alias for efl_pack_unpack
return _efl_ui_layout_part_box_efl_pack_unpack(obj, pd, content);
}
EOLIAN static Eina_Bool
-_efl_ui_layout_part_box_efl_pack_pack(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Box_Data *pd, Efl_Gfx *subobj)
+_efl_ui_layout_part_box_efl_pack_pack(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Box_Data *pd, Efl_Gfx_Entity *subobj)
{
return _efl_ui_layout_box_append(pd->obj, pd->sd, pd->part, subobj);
}
EOLIAN static Eina_Bool
-_efl_ui_layout_part_box_efl_pack_linear_pack_begin(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Box_Data *pd, Efl_Gfx *subobj)
+_efl_ui_layout_part_box_efl_pack_linear_pack_begin(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Box_Data *pd, Efl_Gfx_Entity *subobj)
{
return _efl_ui_layout_box_prepend(pd->obj, pd->sd, pd->part, subobj);
}
EOLIAN static Eina_Bool
-_efl_ui_layout_part_box_efl_pack_linear_pack_end(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Box_Data *pd, Efl_Gfx *subobj)
+_efl_ui_layout_part_box_efl_pack_linear_pack_end(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Box_Data *pd, Efl_Gfx_Entity *subobj)
{
return _efl_ui_layout_box_append(pd->obj, pd->sd, pd->part, subobj);
}
EOLIAN static Eina_Bool
-_efl_ui_layout_part_box_efl_pack_linear_pack_before(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Box_Data *pd, Efl_Gfx *subobj, const Efl_Gfx *existing)
+_efl_ui_layout_part_box_efl_pack_linear_pack_before(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Box_Data *pd, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing)
{
return _efl_ui_layout_box_insert_before(pd->obj, pd->sd, pd->part, subobj, existing);
}
EOLIAN static Eina_Bool
-_efl_ui_layout_part_box_efl_pack_linear_pack_after(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Box_Data *pd, Efl_Gfx *subobj, const Efl_Gfx *existing)
+_efl_ui_layout_part_box_efl_pack_linear_pack_after(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Box_Data *pd, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing)
{
- const Efl_Gfx *other;
+ const Efl_Gfx_Entity *other;
int index;
+
+ edje_object_freeze(pd->obj);
Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
+ edje_object_thaw(pd->obj);
index = efl_pack_index_get(pack, existing);
if (index < 0) return EINA_FALSE;
@@ -212,17 +162,20 @@ _efl_ui_layout_part_box_efl_pack_linear_pack_after(Eo *obj EINA_UNUSED, Efl_Ui_L
}
EOLIAN static Eina_Bool
-_efl_ui_layout_part_box_efl_pack_linear_pack_at(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Box_Data *pd, Efl_Gfx *subobj, int index)
+_efl_ui_layout_part_box_efl_pack_linear_pack_at(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Box_Data *pd, Efl_Gfx_Entity *subobj, int index)
{
return _efl_ui_layout_box_insert_at(pd->obj, pd->sd, pd->part, subobj, index);
}
-EOLIAN static Efl_Gfx *
+EOLIAN static Efl_Gfx_Entity *
_efl_ui_layout_part_box_efl_pack_linear_pack_content_get(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Box_Data *pd, int index)
{
Evas_Object_Box_Option *opt;
Evas_Object_Box_Data *priv;
+
+ edje_object_freeze(pd->obj);
Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
+ edje_object_thaw(pd->obj);
priv = efl_data_scope_get(pack, EVAS_BOX_CLASS);
opt = eina_list_nth(priv->children, index);
@@ -230,11 +183,14 @@ _efl_ui_layout_part_box_efl_pack_linear_pack_content_get(Eo *obj EINA_UNUSED, Ef
return opt->obj;
}
-EOLIAN static Efl_Gfx *
+EOLIAN static Efl_Gfx_Entity *
_efl_ui_layout_part_box_efl_pack_linear_pack_unpack_at(Eo *obj, Efl_Ui_Layout_Box_Data *pd, int index)
{
- Efl_Gfx *subobj;
+ Efl_Gfx_Entity *subobj;
+
+ edje_object_freeze(pd->obj);
Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
+ edje_object_thaw(pd->obj);
subobj = efl_pack_content_get(pack, index);
if (!subobj) return NULL;
@@ -246,14 +202,16 @@ _efl_ui_layout_part_box_efl_pack_linear_pack_unpack_at(Eo *obj, Efl_Ui_Layout_Bo
}
EOLIAN static int
-_efl_ui_layout_part_box_efl_pack_linear_pack_index_get(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Box_Data *pd, const Efl_Gfx *subobj)
+_efl_ui_layout_part_box_efl_pack_linear_pack_index_get(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Box_Data *pd, const Efl_Gfx_Entity *subobj)
{
+ edje_object_freeze(pd->obj);
Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
+ edje_object_thaw(pd->obj);
return efl_pack_index_get(pack, subobj);
}
EOLIAN static Efl_Ui_Dir
-_efl_ui_layout_part_box_efl_ui_direction_direction_get(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Box_Data *pd)
+_efl_ui_layout_part_box_efl_ui_direction_direction_get(const Eo *obj EINA_UNUSED, Efl_Ui_Layout_Box_Data *pd)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_DIR_DEFAULT);
@@ -267,7 +225,7 @@ EOLIAN static void
_efl_ui_layout_part_table_real_part_set(Eo *obj, Efl_Ui_Layout_Table_Data *pd, Eo *layout, const char *part)
{
pd->obj = layout;
- pd->sd = efl_data_xref(pd->obj, EFL_UI_LAYOUT_CLASS, obj);
+ pd->sd = efl_data_xref(pd->obj, EFL_UI_LAYOUT_OBJECT_CLASS, obj);
eina_stringshare_replace(&pd->part, part);
pd->temp = 1;
}
@@ -285,17 +243,22 @@ EOLIAN static Eina_Iterator *
_efl_ui_layout_part_table_efl_container_content_iterate(Eo *obj, Efl_Ui_Layout_Table_Data *pd)
{
Eina_Iterator *it;
+
+ edje_object_freeze(pd->obj);
Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
+ edje_object_thaw(pd->obj);
it = evas_object_table_iterator_new(pack);
- return _part_item_iterator_create(obj, it, NULL);
+ return efl_canvas_iterator_create(obj, it, NULL);
}
EOLIAN static int
_efl_ui_layout_part_table_efl_container_content_count(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd)
{
+ edje_object_freeze(pd->obj);
Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
+ edje_object_thaw(pd->obj);
return evas_obj_table_count(pack);
}
@@ -312,29 +275,31 @@ _efl_ui_layout_part_table_efl_pack_unpack_all(Eo *obj EINA_UNUSED, Efl_Ui_Layout
}
EOLIAN static Eina_Bool
-_efl_ui_layout_part_table_efl_pack_unpack(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd, Efl_Gfx *subobj)
+_efl_ui_layout_part_table_efl_pack_unpack(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd, Efl_Gfx_Entity *subobj)
{
if (!subobj) return EINA_FALSE;
return _efl_ui_layout_table_unpack(pd->obj, pd->sd, pd->part, subobj) == subobj;
}
EOLIAN static Eina_Bool
-_efl_ui_layout_part_table_efl_container_content_remove(Eo *obj, Efl_Ui_Layout_Table_Data *pd, Efl_Gfx *content)
+_efl_ui_layout_part_table_efl_container_content_remove(Eo *obj, Efl_Ui_Layout_Table_Data *pd, Efl_Gfx_Entity *content)
{
// alias for efl_pack_unpack
return _efl_ui_layout_part_table_efl_pack_unpack(obj, pd, content);
}
EOLIAN static Eina_Bool
-_efl_ui_layout_part_table_efl_pack_table_pack_table(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd, Efl_Gfx *subobj, int col, int row, int colspan, int rowspan)
+_efl_ui_layout_part_table_efl_pack_table_pack_table(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd, Efl_Gfx_Entity *subobj, int col, int row, int colspan, int rowspan)
{
return _efl_ui_layout_table_pack(pd->obj, pd->sd, pd->part, subobj, col, row, colspan, rowspan);
}
-EOLIAN static Efl_Gfx *
+EOLIAN static Efl_Gfx_Entity *
_efl_ui_layout_part_table_efl_pack_table_table_content_get(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd, int col, int row)
{
+ edje_object_freeze(pd->obj);
Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
+ edje_object_thaw(pd->obj);
return evas_object_table_child_get(pack, col, row);
}
@@ -347,7 +312,10 @@ _efl_ui_layout_part_table_efl_pack_table_table_contents_get(Eo *obj EINA_UNUSED,
Eina_List *list, *l = NULL;
Evas_Object *sobj;
unsigned short c, r, cs, rs;
+
+ edje_object_freeze(pd->obj);
Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
+ edje_object_thaw(pd->obj);
list = evas_object_table_children_get(pack);
EINA_LIST_FREE(list, sobj)
@@ -364,15 +332,18 @@ _efl_ui_layout_part_table_efl_pack_table_table_contents_get(Eo *obj EINA_UNUSED,
}
}
- return _part_item_iterator_create(pd->obj, eina_list_iterator_new(l), l);
+ return efl_canvas_iterator_create(pd->obj, eina_list_iterator_new(l), l);
}
EOLIAN static Eina_Bool
-_efl_ui_layout_part_table_efl_pack_table_table_position_get(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd, Efl_Gfx * subobj, int *col, int *row, int *colspan, int *rowspan)
+_efl_ui_layout_part_table_efl_pack_table_table_position_get(const Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd, Efl_Gfx_Entity * subobj, int *col, int *row, int *colspan, int *rowspan)
{
unsigned short c, r, cs, rs;
Eina_Bool ret;
+
+ edje_object_freeze(pd->obj);
Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
+ edje_object_thaw(pd->obj);
ret = evas_object_table_pack_get(pack, subobj, &c, &r, &cs, &rs);
if (col) *col = c;
@@ -384,26 +355,34 @@ _efl_ui_layout_part_table_efl_pack_table_table_position_get(Eo *obj EINA_UNUSED,
}
EOLIAN static void
-_efl_ui_layout_part_table_efl_pack_table_table_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd, int *cols, int *rows)
+_efl_ui_layout_part_table_efl_pack_table_table_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd, int *cols, int *rows)
{
+ edje_object_freeze(pd->obj);
Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
+ edje_object_thaw(pd->obj);
evas_object_table_col_row_size_get(pack, cols, rows);
}
EOLIAN static int
-_efl_ui_layout_part_table_efl_pack_table_table_columns_get(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd)
+_efl_ui_layout_part_table_efl_pack_table_table_columns_get(const Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd)
{
int cols, rows;
+
+ edje_object_freeze(pd->obj);
Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
+ edje_object_thaw(pd->obj);
evas_object_table_col_row_size_get(pack, &cols, &rows);
return cols;
}
EOLIAN static int
-_efl_ui_layout_part_table_efl_pack_table_table_rows_get(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd)
+_efl_ui_layout_part_table_efl_pack_table_table_rows_get(const Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd)
{
int cols, rows;
+
+ edje_object_freeze(pd->obj);
Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
+ edje_object_thaw(pd->obj);
evas_object_table_col_row_size_get(pack, &cols, &rows);
return rows;
}
diff --git a/src/lib/elementary/efl_ui_layout_part.eo b/src/lib/elementary/efl_ui_layout_part.eo
index 86a70d8b5c..eac6aa5ac7 100644
--- a/src/lib/elementary/efl_ui_layout_part.eo
+++ b/src/lib/elementary/efl_ui_layout_part.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Layout.Part (Efl.Ui.Widget.Part, Efl.Ui.Cursor)
+class Efl.Ui.Layout.Part (Efl.Ui.Widget_Part, Efl.Ui.Cursor)
{
[[Elementary layout internal part class]]
data: null;
diff --git a/src/lib/elementary/efl_ui_layout_part_bg.eo b/src/lib/elementary/efl_ui_layout_part_bg.eo
index dc157d2666..27b79d5b9e 100644
--- a/src/lib/elementary/efl_ui_layout_part_bg.eo
+++ b/src/lib/elementary/efl_ui_layout_part_bg.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Layout.Part_Bg (Efl.Ui.Widget.Part_Bg)
+class Efl.Ui.Layout.Part_Bg (Efl.Ui.Widget_Part_Bg)
{
[[Elementary layout internal part background class]]
data: null;
diff --git a/src/lib/elementary/efl_ui_layout_part_box.eo b/src/lib/elementary/efl_ui_layout_part_box.eo
index 52f6884563..6526c5681c 100644
--- a/src/lib/elementary/efl_ui_layout_part_box.eo
+++ b/src/lib/elementary/efl_ui_layout_part_box.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Layout.Part.Box (Efl.Object, Efl.Pack.Linear,
+class Efl.Ui.Layout.Part_Box (Efl.Object, Efl.Pack_Linear,
Efl.Ui.Direction)
{
[[Represents a Box created as part of a layout.
@@ -10,7 +10,7 @@ class Efl.Ui.Layout.Part.Box (Efl.Object, Efl.Pack.Linear,
methods {
/* FIXME: Remove this. */
@property real_part @protected {
- [[Real part property]]
+ [[Real part property]]
set {}
values {
layout: Efl.Object; [[Real part object]]
@@ -28,13 +28,13 @@ class Efl.Ui.Layout.Part.Box (Efl.Object, Efl.Pack.Linear,
Efl.Pack.unpack_all;
Efl.Pack.unpack;
Efl.Pack.pack;
- Efl.Pack.Linear.pack_begin;
- Efl.Pack.Linear.pack_end;
- Efl.Pack.Linear.pack_before;
- Efl.Pack.Linear.pack_after;
- Efl.Pack.Linear.pack_at;
- Efl.Pack.Linear.pack_content_get;
- Efl.Pack.Linear.pack_unpack_at;
- Efl.Pack.Linear.pack_index_get;
+ Efl.Pack_Linear.pack_begin;
+ Efl.Pack_Linear.pack_end;
+ Efl.Pack_Linear.pack_before;
+ Efl.Pack_Linear.pack_after;
+ Efl.Pack_Linear.pack_at;
+ Efl.Pack_Linear.pack_content_get;
+ Efl.Pack_Linear.pack_unpack_at;
+ Efl.Pack_Linear.pack_index_get;
}
}
diff --git a/src/lib/elementary/efl_ui_layout_part_legacy.eo b/src/lib/elementary/efl_ui_layout_part_legacy.eo
index bb0ba7bd61..8c7e2d3a43 100644
--- a/src/lib/elementary/efl_ui_layout_part_legacy.eo
+++ b/src/lib/elementary/efl_ui_layout_part_legacy.eo
@@ -1,5 +1,5 @@
class Efl.Ui.Layout.Part_Legacy (Efl.Ui.Layout.Part, Efl.Content, Efl.Text,
- Efl.Text.Markup, Efl.Ui.Translatable)
+ Efl.Text_Markup, Efl.Ui.Translatable)
{
[[Elementary layout internal part class]]
data: null;
@@ -7,7 +7,7 @@ class Efl.Ui.Layout.Part_Legacy (Efl.Ui.Layout.Part, Efl.Content, Efl.Text,
Efl.Content.content { get; set; }
Efl.Content.content_unset;
Efl.Text.text { set; get; }
- Efl.Text.Markup.markup { get; set; }
+ Efl.Text_Markup.markup { get; set; }
Efl.Ui.Translatable.translatable_text { get; set; }
}
}
diff --git a/src/lib/elementary/efl_ui_layout_part_table.eo b/src/lib/elementary/efl_ui_layout_part_table.eo
index a408128105..6f75c49c6e 100644
--- a/src/lib/elementary/efl_ui_layout_part_table.eo
+++ b/src/lib/elementary/efl_ui_layout_part_table.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Layout.Part.Table (Efl.Object, Efl.Pack.Table)
+class Efl.Ui.Layout.Part_Table (Efl.Object, Efl.Pack_Table)
{
[[Represents a Table created as part of a layout.
@@ -9,7 +9,7 @@ class Efl.Ui.Layout.Part.Table (Efl.Object, Efl.Pack.Table)
methods {
/* FIXME: Remove this. */
@property real_part @protected {
- [[Real part property]]
+ [[Real part property]]
set {}
values {
layout: Efl.Object; [[Real part object]]
@@ -25,12 +25,12 @@ class Efl.Ui.Layout.Part.Table (Efl.Object, Efl.Pack.Table)
Efl.Pack.pack_clear;
Efl.Pack.unpack_all;
Efl.Pack.unpack;
- Efl.Pack.Table.pack_table;
- Efl.Pack.Table.table_content_get;
- Efl.Pack.Table.table_contents_get;
- Efl.Pack.Table.table_position { get; }
- Efl.Pack.Table.table_size { get; }
- Efl.Pack.Table.table_columns { get; }
- Efl.Pack.Table.table_rows { get; }
+ Efl.Pack_Table.pack_table;
+ Efl.Pack_Table.table_content_get;
+ Efl.Pack_Table.table_contents_get;
+ Efl.Pack_Table.table_position { get; }
+ Efl.Pack_Table.table_size { get; }
+ Efl.Pack_Table.table_columns { get; }
+ Efl.Pack_Table.table_rows { get; }
}
}
diff --git a/src/lib/elementary/efl_ui_layout_part_text.eo b/src/lib/elementary/efl_ui_layout_part_text.eo
index 9dda607b21..82347b93ef 100644
--- a/src/lib/elementary/efl_ui_layout_part_text.eo
+++ b/src/lib/elementary/efl_ui_layout_part_text.eo
@@ -1,11 +1,11 @@
-class Efl.Ui.Layout.Part_Text (Efl.Ui.Layout.Part, Efl.Text, Efl.Text.Markup,
+class Efl.Ui.Layout.Part_Text (Efl.Ui.Layout.Part, Efl.Text, Efl.Text_Markup,
Efl.Ui.Translatable)
{
[[Elementary layout internal part class]]
data: null;
implements {
Efl.Text.text { set; get; }
- Efl.Text.Markup.markup { get; set; }
+ Efl.Text_Markup.markup { get; set; }
Efl.Ui.Translatable.translatable_text { get; set; }
}
}
diff --git a/src/lib/elementary/efl_ui_legacy.c b/src/lib/elementary/efl_ui_legacy.c
new file mode 100644
index 0000000000..85a0c23042
--- /dev/null
+++ b/src/lib/elementary/efl_ui_legacy.c
@@ -0,0 +1,8 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <Elementary.h>
+#include "elm_priv.h"
+
+#include "efl_ui_legacy.eo.c"
diff --git a/src/lib/elementary/efl_ui_legacy.eo b/src/lib/elementary/efl_ui_legacy.eo
new file mode 100644
index 0000000000..301bcdc837
--- /dev/null
+++ b/src/lib/elementary/efl_ui_legacy.eo
@@ -0,0 +1,9 @@
+interface Efl.Ui.Legacy (Efl.Interface)
+{
+ [[The bg (background) widget is used for setting (solid) background decorations
+
+ in a window (unless it has transparency enabled) or on any container object. It
+ works just like an image but has some properties useful for backgrounds, such as
+ setting it to tiled, centered, scaled or stretched.
+ ]]
+}
diff --git a/src/lib/elementary/efl_ui_list.c b/src/lib/elementary/efl_ui_list.c
index 68efe0a7ab..bb6abf3ef3 100644
--- a/src/lib/elementary/efl_ui_list.c
+++ b/src/lib/elementary/efl_ui_list.c
@@ -1,314 +1,95 @@
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif
-#define ELM_ACCESS_PROTECTED
-#define ELM_ACCESS_WIDGET_ACTION_PROTECTED
-#define EFL_ACCESS_SELECTION_PROTECTED
+
+#define ELM_LAYOUT_PROTECTED
#define EFL_UI_SCROLL_MANAGER_PROTECTED
#define EFL_UI_SCROLLBAR_PROTECTED
#define EFL_UI_SCROLLBAR_BETA
-#define EFL_GFX_SIZE_HINT_PROTECTED
-#define EFL_UI_LIST_PROTECTED
-
#include <Elementary.h>
+#include "elm_priv.h"
+#include "efl_ui_list_item_private.h"
+#include "efl_ui_item_private.h"
#include "efl_ui_list_private.h"
-#include "efl_ui_list_precise_layouter.eo.h"
-#include <assert.h>
+#define MY_CLASS EFL_UI_LIST_CLASS
+#define MY_CLASS_PFX efl_ui_list
-#define MY_CLASS EFL_UI_LIST_CLASS
#define MY_CLASS_NAME "Efl.Ui.List"
-#define MY_PAN_CLASS EFL_UI_LIST_PAN_CLASS
-
-#define SIG_CHILD_ADDED "child,added"
-#define SIG_CHILD_REMOVED "child,removed"
-#define SELECTED_PROP "selected"
-
-static const Evas_Smart_Cb_Description _smart_callbacks[] = {
- {SIG_CHILD_ADDED, ""},
- {SIG_CHILD_REMOVED, ""},
- {NULL, NULL}
-};
-
-void _efl_ui_list_custom_layout(Efl_Ui_List *);
-void _efl_ui_list_item_select_set(Efl_Ui_List_LayoutItem*, Eina_Bool);
-static void _layout(Efl_Ui_List_Data* pd);
-
-static Eina_Bool _key_action_move(Evas_Object *obj, const char *params);
-static Eina_Bool _key_action_select(Evas_Object *obj, const char *params);
-static Eina_Bool _key_action_escape(Evas_Object *obj, const char *params);
-
-static const Elm_Action key_actions[] = {
- {"move", _key_action_move},
- {"select", _key_action_select},
- {"escape", _key_action_escape},
- {NULL, NULL}
-};
-
-EOLIAN static void
-_efl_ui_list_pan_efl_canvas_group_group_calculate(Eo *obj EINA_UNUSED, Efl_Ui_List_Pan_Data *psd)
-{
- evas_object_smart_changed(psd->wobj);
-}
-
-
-EOLIAN static void
-_efl_ui_list_pan_efl_ui_pan_pan_position_set(Eo *obj EINA_UNUSED, Efl_Ui_List_Pan_Data *psd, Eina_Position2D pos)
-{
- if ((pos.x == psd->gmt.x) && (pos.y == psd->gmt.y)) return;
-
- psd->gmt.x = pos.x;
- psd->gmt.y = pos.y;
-
- efl_event_callback_call(obj, EFL_UI_PAN_EVENT_POSITION_CHANGED, NULL);
- evas_object_smart_changed(psd->wobj);
-}
-
-EOLIAN static Eina_Position2D
-_efl_ui_list_pan_efl_ui_pan_pan_position_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Pan_Data *psd)
-{
- return psd->gmt.pos;
-}
-
-EOLIAN static Eina_Position2D
-_efl_ui_list_pan_efl_ui_pan_pan_position_max_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Pan_Data *psd)
-{
- EFL_UI_LIST_DATA_GET(psd->wobj, pd);
- Eina_Rect vgmt = {};
- Eina_Size2D min = {};
-
- vgmt = efl_ui_scrollable_viewport_geometry_get(pd->scrl_mgr);
- min = efl_ui_list_model_min_size_get(psd->wobj);
-
- min.w = min.w - vgmt.w;
- if (min.w < 0) min.w = 0;
- min.h = min.h - vgmt.h;
- if (min.h < 0) min.h = 0;
-
- return EINA_POSITION2D(min.w, min.h);
-}
-
-EOLIAN static Eina_Position2D
-_efl_ui_list_pan_efl_ui_pan_pan_position_min_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Pan_Data *psd EINA_UNUSED)
-{
- return EINA_POSITION2D(0, 0);
-}
-
-EOLIAN static Eina_Size2D
-_efl_ui_list_pan_efl_ui_pan_content_size_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Pan_Data *psd)
-{
- Eina_Size2D min = {};
- min = efl_ui_list_model_min_size_get(psd->wobj);
-
- return min;
-}
-
-EOLIAN static void
-_efl_ui_list_pan_efl_object_destructor(Eo *obj, Efl_Ui_List_Pan_Data *psd EINA_UNUSED)
-{
- efl_destructor(efl_super(obj, MY_PAN_CLASS));
-}
-
-#include "efl_ui_list_pan.eo.c"
-
-EOLIAN static void
-_efl_ui_list_efl_ui_scrollable_interactive_content_pos_set(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *psd, Eina_Position2D pos)
-{
- efl_ui_scrollable_content_pos_set(psd->scrl_mgr, pos);
-}
-
-EOLIAN static Eina_Position2D
-_efl_ui_list_efl_ui_scrollable_interactive_content_pos_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *psd)
-{
- Eina_Position2D pos = efl_ui_scrollable_content_pos_get(psd->scrl_mgr);
- return pos;
-}
-
-EOLIAN static Eina_Size2D
-_efl_ui_list_efl_ui_scrollable_interactive_content_size_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *psd)
-{
- Eina_Size2D size = efl_ui_scrollable_content_size_get(psd->scrl_mgr);
- return size;
-}
-
-EOLIAN static Eina_Rect
-_efl_ui_list_efl_ui_scrollable_interactive_viewport_geometry_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *psd)
+static void
+_item_scroll_internal(Eo *obj,
+ Efl_Ui_List_Item *item,
+ double align,
+ Eina_Bool anim)
{
- Eina_Rect gmt = efl_ui_scrollable_viewport_geometry_get(psd->scrl_mgr);
- return gmt;
-}
+ EFL_UI_LIST_DATA_GET_OR_RETURN(obj, pd);
+ Eina_Rect ipos, view;
+ Eina_Position2D vpos;
-static Eina_Bool
-_efl_model_properties_has(Efl_Model *model, Eina_Stringshare *propfind)
-{
- const Eina_Array *properties;
- Eina_Array_Iterator iter_prop;
- Eina_Stringshare *property;
- Eina_Bool ret = EINA_FALSE;
- unsigned i = 0;
+ if (!pd->smanager) return;
- EINA_SAFETY_ON_NULL_RETURN_VAL(model, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(propfind, EINA_FALSE);
+ ipos = efl_gfx_entity_geometry_get(item);
+ view = efl_ui_scrollable_viewport_geometry_get(pd->smanager);
+ vpos = efl_ui_scrollable_content_pos_get(pd->smanager);
- properties = efl_model_properties_get(model);
+ ipos.x = view.x;
+ ipos.w = ipos.w;
- EINA_ARRAY_ITER_NEXT(properties, i, property, iter_prop)
+ // FIXME: align case will not correctly show in the position because of
+ // bar size calculation. there are no certain way to know the scroll calcuation finished.
+ if (EINA_DBL_EQ(align, -1.0))
{
- if (property == propfind)
- {
- ret = EINA_TRUE;
- break;
- }
+ ipos.y = ipos.y + vpos.y - view.y;
+ ipos.h = ipos.h;
}
- return ret;
-}
-
-static void
-_on_item_mouse_up(void *data, Evas *evas EINA_UNUSED, Evas_Object *o EINA_UNUSED, void *event_info)
-{
- Evas_Event_Mouse_Down *ev = event_info;
- Efl_Ui_List_LayoutItem *item = data;
-
- if (ev->button != 1) return;
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
-
- _efl_ui_list_item_select_set(item, EINA_TRUE);
-}
-
-static void
-_count_then(void * data, Efl_Event const* event EINA_UNUSED)
-{
- Efl_Ui_List_Data *pd = data;
- EINA_SAFETY_ON_NULL_RETURN(pd);
-
- pd->count_future = NULL;
- _layout(pd);
-}
-
-static void
-_count_error(void * data, Efl_Event const* event EINA_UNUSED)
-{
- Efl_Ui_List_Data *pd = data;
- EINA_SAFETY_ON_NULL_RETURN(pd);
- pd->count_future = NULL;
-}
-
-static void
-_children_slice_error(void * data EINA_UNUSED, Efl_Event const* event EINA_UNUSED)
-{
- Efl_Ui_List_Data *pd = data;
- EINA_SAFETY_ON_NULL_RETURN(pd);
- pd->slice_future = NULL;
-}
-
-EOLIAN static void
-_efl_ui_list_select_mode_set(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd, Elm_Object_Select_Mode mode)
-{
- if (pd->select_mode == mode)
- return;
-
- pd->select_mode = mode;
-}
-
-EOLIAN static Elm_Object_Select_Mode
-_efl_ui_list_select_mode_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd)
-{
- return pd->select_mode;
-}
-
-EOLIAN static void
-_efl_ui_list_default_style_set(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd, Eina_Stringshare *style)
-{
- eina_stringshare_replace(&pd->style, style);
-}
-
-EOLIAN static Eina_Stringshare *
-_efl_ui_list_default_style_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd)
-{
- return pd->style;
-}
-
-EOLIAN static void
-_efl_ui_list_homogeneous_set(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd, Eina_Bool homogeneous)
-{
- pd->homogeneous = homogeneous;
-}
-
-EOLIAN static Eina_Bool
-_efl_ui_list_homogeneous_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd)
-{
- return pd->homogeneous;
-}
-
-EOLIAN static void
-_efl_ui_list_efl_gfx_position_set(Eo *obj, Efl_Ui_List_Data *pd, Eina_Position2D pos)
-{
- if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
- return;
-
- efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
- evas_object_smart_changed(pd->obj);
-}
-
-EOLIAN static void
-_efl_ui_list_efl_gfx_size_set(Eo *obj, Efl_Ui_List_Data *pd, Eina_Size2D size)
-{
- if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, size.w, size.h))
- return;
-
- efl_gfx_size_set(efl_super(obj, MY_CLASS), size);
-
- evas_object_smart_changed(pd->obj);
-}
-
-EOLIAN static void
-_efl_ui_list_efl_canvas_group_group_calculate(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd)
-{
- _layout(pd);
-}
+ else if ((align > 0.0 || EINA_DBL_EQ(align, 0.0)) &&
+ (align < 1.0 || EINA_DBL_EQ(align, 1.0)))
+ {
+ ipos.y = ipos.y + vpos.y - view.y - (int)((view.h - ipos.h) * align);
+ ipos.h = view.h;
+ }
+ else ERR("align (%.2lf) is not proper value. it must be the value between [0.0 , 1.0]!", align);
-EOLIAN static void
-_efl_ui_list_efl_canvas_group_group_member_add(Eo *obj, Efl_Ui_List_Data *pd EINA_UNUSED, Evas_Object *member)
-{
- efl_canvas_group_member_add(efl_super(obj, MY_CLASS), member);
+ efl_ui_scrollable_scroll(pd->smanager, ipos, anim);
}
-//Scrollable Implement
static void
_efl_ui_list_bar_read_and_update(Eo *obj)
{
- EFL_UI_LIST_DATA_GET(obj, pd);
+ EFL_UI_LIST_DATA_GET_OR_RETURN(obj, pd);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
- double vx, vy;
+ double vx = 0.0, vy = 0.0;
edje_object_part_drag_value_get
- (wd->resize_obj, "elm.dragable.vbar", NULL, &vy);
- edje_object_part_drag_value_get
- (wd->resize_obj, "elm.dragable.hbar", &vx, NULL);
+ (wd->resize_obj, "efl.dragable.vbar", NULL, &vy);
- efl_ui_scrollbar_bar_position_set(pd->scrl_mgr, vx, vy);
+ /* FIXME: Horizontal Scroll is not yet supported in the list.
+ edje_object_part_drag_value_get
+ (wd->resize_obj, "efl.dragable.hbar", &vx, NULL);
+ */
- efl_canvas_group_change(pd->pan_obj);
+ efl_ui_scrollbar_bar_position_set(pd->smanager, vx, vy);
}
static void
_efl_ui_list_reload_cb(void *data,
- Evas_Object *obj EINA_UNUSED,
- const char *emission EINA_UNUSED,
- const char *source EINA_UNUSED)
+ Evas_Object *obj EINA_UNUSED,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
{
- EFL_UI_LIST_DATA_GET(data, pd);
+ Eo *list = data;
+ EFL_UI_LIST_DATA_GET_OR_RETURN(list, pd);
- efl_ui_scrollbar_bar_visibility_update(pd->scrl_mgr);
+ efl_ui_scrollbar_bar_visibility_update(pd->smanager);
}
static void
_efl_ui_list_vbar_drag_cb(void *data,
- Evas_Object *obj EINA_UNUSED,
- const char *emission EINA_UNUSED,
- const char *source EINA_UNUSED)
+ Evas_Object *obj EINA_UNUSED,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
{
_efl_ui_list_bar_read_and_update(data);
@@ -318,9 +99,9 @@ _efl_ui_list_vbar_drag_cb(void *data,
static void
_efl_ui_list_vbar_press_cb(void *data,
- Evas_Object *obj EINA_UNUSED,
- const char *emission EINA_UNUSED,
- const char *source EINA_UNUSED)
+ Evas_Object *obj EINA_UNUSED,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
{
Efl_Ui_Scrollbar_Direction type = EFL_UI_SCROLLBAR_DIRECTION_VERTICAL;
efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_PRESS, &type);
@@ -328,9 +109,9 @@ _efl_ui_list_vbar_press_cb(void *data,
static void
_efl_ui_list_vbar_unpress_cb(void *data,
- Evas_Object *obj EINA_UNUSED,
- const char *emission EINA_UNUSED,
- const char *source EINA_UNUSED)
+ Evas_Object *obj EINA_UNUSED,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
{
Efl_Ui_Scrollbar_Direction type = EFL_UI_SCROLLBAR_DIRECTION_VERTICAL;
efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_UNPRESS, &type);
@@ -338,674 +119,1022 @@ _efl_ui_list_vbar_unpress_cb(void *data,
static void
_efl_ui_list_edje_drag_start_cb(void *data,
- Evas_Object *obj EINA_UNUSED,
- const char *emission EINA_UNUSED,
- const char *source EINA_UNUSED)
+ Evas_Object *obj EINA_UNUSED,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
{
- EFL_UI_LIST_DATA_GET(data, pd);
+ Eo *list = data;
+ EFL_UI_LIST_DATA_GET_OR_RETURN(list, pd);
- _efl_ui_list_bar_read_and_update(data);
+ _efl_ui_list_bar_read_and_update(list);
- pd->scrl_freeze = efl_ui_scrollable_scroll_freeze_get(pd->scrl_mgr);
- efl_ui_scrollable_scroll_freeze_set(pd->scrl_mgr, EINA_TRUE);
- efl_event_callback_call(data, EFL_UI_EVENT_SCROLL_DRAG_START, NULL);
+ pd->freeze_want = efl_ui_scrollable_scroll_freeze_get(pd->smanager);
+ efl_ui_scrollable_scroll_freeze_set(pd->smanager, EINA_TRUE);
+ efl_event_callback_call(list, EFL_UI_EVENT_SCROLL_DRAG_START, NULL);
}
static void
_efl_ui_list_edje_drag_stop_cb(void *data,
- Evas_Object *obj EINA_UNUSED,
- const char *emission EINA_UNUSED,
- const char *source EINA_UNUSED)
+ Evas_Object *obj EINA_UNUSED,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
{
- EFL_UI_LIST_DATA_GET(data, pd);
+ Eo *list = data;
+ EFL_UI_LIST_DATA_GET_OR_RETURN(list, pd);
- _efl_ui_list_bar_read_and_update(data);
+ _efl_ui_list_bar_read_and_update(list);
- efl_ui_scrollable_scroll_freeze_set(pd->scrl_mgr, pd->scrl_freeze);
- efl_event_callback_call(data, EFL_UI_EVENT_SCROLL_DRAG_STOP, NULL);
+ efl_ui_scrollable_scroll_freeze_set(pd->smanager, pd->freeze_want);
+ efl_event_callback_call(list, EFL_UI_EVENT_SCROLL_DRAG_STOP, NULL);
}
static void
_efl_ui_list_edje_drag_cb(void *data,
- Evas_Object *obj EINA_UNUSED,
- const char *emission EINA_UNUSED,
- const char *source EINA_UNUSED)
+ Evas_Object *obj EINA_UNUSED,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
{
_efl_ui_list_bar_read_and_update(data);
}
-static void
-_efl_ui_list_hbar_drag_cb(void *data,
- Evas_Object *obj EINA_UNUSED,
- const char *emission EINA_UNUSED,
- const char *source EINA_UNUSED)
-{
+/* FIXME: Horizontal Scroll is not yet supported in the list.
+ static void
+ _efl_ui_list_hbar_drag_cb(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
+ {
_efl_ui_list_bar_read_and_update(data);
Efl_Ui_Scrollbar_Direction type = EFL_UI_SCROLLBAR_DIRECTION_HORIZONTAL;
efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_DRAG, &type);
-}
+ }
-static void
-_efl_ui_list_hbar_press_cb(void *data,
- Evas_Object *obj EINA_UNUSED,
- const char *emission EINA_UNUSED,
- const char *source EINA_UNUSED)
-{
+ static void
+ _efl_ui_list_hbar_press_cb(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
+ {
Efl_Ui_Scrollbar_Direction type = EFL_UI_SCROLLBAR_DIRECTION_HORIZONTAL;
efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_PRESS, &type);
-}
-
-static void
-_efl_ui_list_hbar_unpress_cb(void *data,
- Evas_Object *obj EINA_UNUSED,
- const char *emission EINA_UNUSED,
- const char *source EINA_UNUSED)
-{
+ }
+
+ static void
+ _efl_ui_list_hbar_unpress_cb(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
+ {
Efl_Ui_Scrollbar_Direction type = EFL_UI_SCROLLBAR_DIRECTION_HORIZONTAL;
efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_UNPRESS, &type);
-}
-
-static void
-_scroll_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
-{
- //scroll cb
-}
+ }
+ */
static void
_efl_ui_list_bar_size_changed_cb(void *data, const Efl_Event *event EINA_UNUSED)
{
Eo *obj = data;
- EFL_UI_LIST_DATA_GET(obj, pd);
+ EFL_UI_LIST_DATA_GET_OR_RETURN(obj, pd);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
double width = 0.0, height = 0.0;
- efl_ui_scrollbar_bar_size_get(pd->scrl_mgr, &width, &height);
-
- edje_object_part_drag_size_set(wd->resize_obj, "elm.dragable.hbar", width, 1.0);
- edje_object_part_drag_size_set(wd->resize_obj, "elm.dragable.vbar", 1.0, height);
+ edje_object_calc_force(wd->resize_obj);
+ efl_ui_scrollbar_bar_size_get(pd->smanager, &width, &height);
+ edje_object_part_drag_size_set(wd->resize_obj, "efl.dragable.hbar", width, 1.0);
+ edje_object_part_drag_size_set(wd->resize_obj, "efl.dragable.vbar", 1.0, height);
}
static void
_efl_ui_list_bar_pos_changed_cb(void *data, const Efl_Event *event EINA_UNUSED)
{
Eo *obj = data;
- EFL_UI_LIST_DATA_GET(obj, pd);
+ EFL_UI_LIST_DATA_GET_OR_RETURN(obj, pd);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
double posx = 0.0, posy = 0.0;
- efl_ui_scrollbar_bar_position_get(pd->scrl_mgr, &posx, &posy);
-
- edje_object_part_drag_value_set(wd->resize_obj, "elm.dragable.hbar", posx, 0.0);
- edje_object_part_drag_value_set(wd->resize_obj, "elm.dragable.vbar", 0.0, posy);
+ efl_ui_scrollbar_bar_position_get(pd->smanager, &posx, &posy);
+ edje_object_part_drag_value_set(wd->resize_obj, "efl.dragable.hbar", posx, 0.0);
+ edje_object_part_drag_value_set(wd->resize_obj, "efl.dragable.vbar", 0.0, posy);
}
static void
_efl_ui_list_bar_show_cb(void *data, const Efl_Event *event)
{
Eo *obj = data;
+ EFL_UI_LIST_DATA_GET_OR_RETURN(obj, pd);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
Efl_Ui_Scrollbar_Direction type = *(Efl_Ui_Scrollbar_Direction *)(event->info);
if (type == EFL_UI_SCROLLBAR_DIRECTION_HORIZONTAL)
- edje_object_signal_emit(wd->resize_obj, "elm,action,show,hbar", "elm");
+ edje_object_signal_emit(wd->resize_obj, "efl,action,show,hbar", "efl");
else if (type == EFL_UI_SCROLLBAR_DIRECTION_VERTICAL)
- edje_object_signal_emit(wd->resize_obj, "elm,action,show,vbar", "elm");
+ edje_object_signal_emit(wd->resize_obj, "efl,action,show,vbar", "efl");
}
static void
_efl_ui_list_bar_hide_cb(void *data, const Efl_Event *event)
{
Eo *obj = data;
+ EFL_UI_LIST_DATA_GET_OR_RETURN(obj, pd);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
Efl_Ui_Scrollbar_Direction type = *(Efl_Ui_Scrollbar_Direction *)(event->info);
if (type == EFL_UI_SCROLLBAR_DIRECTION_HORIZONTAL)
- edje_object_signal_emit(wd->resize_obj, "elm,action,hide,hbar", "elm");
+ edje_object_signal_emit(wd->resize_obj, "efl,action,hide,hbar", "efl");
else if (type == EFL_UI_SCROLLBAR_DIRECTION_VERTICAL)
- edje_object_signal_emit(wd->resize_obj, "elm,action,hide,vbar", "elm");
-}
-
-EOLIAN static Eina_Bool
-_efl_ui_list_efl_layout_signal_signal_callback_add(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *sd EINA_UNUSED, const char *emission, const char *source, Edje_Signal_Cb func_cb, void *data)
-{
- Eina_Bool ok;
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
-
- ok = efl_layout_signal_callback_add(wd->resize_obj, emission, source, func_cb, data);
-
- return ok;
-}
-
-EOLIAN static Eina_Bool
-_efl_ui_list_efl_layout_signal_signal_callback_del(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *sd EINA_UNUSED, const char *emission, const char *source, Edje_Signal_Cb func_cb, void *data)
-{
- Eina_Bool ok;
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
-
- ok = efl_layout_signal_callback_del(wd->resize_obj, emission, source, func_cb, data);
-
- return ok;
+ edje_object_signal_emit(wd->resize_obj, "efl,action,hide,vbar", "efl");
}
static void
-_efl_ui_list_edje_object_attach(Eo *obj)
+_scroll_edje_object_attach(Eo *obj)
{
+ EFL_UI_LIST_DATA_GET_OR_RETURN(obj, pd);
+
efl_layout_signal_callback_add
- (obj, "reload", "elm", _efl_ui_list_reload_cb, obj);
- //Vertical bar
+ (obj, "reload", "efl",
+ _efl_ui_list_reload_cb, obj);
efl_layout_signal_callback_add
- (obj, "drag", "elm.dragable.vbar", _efl_ui_list_vbar_drag_cb,
- obj);
+ (obj, "drag", "efl.dragable.vbar",
+ _efl_ui_list_vbar_drag_cb, obj);
efl_layout_signal_callback_add
- (obj, "drag,set", "elm.dragable.vbar",
+ (obj, "drag,set", "efl.dragable.vbar",
_efl_ui_list_edje_drag_cb, obj);
efl_layout_signal_callback_add
- (obj, "drag,start", "elm.dragable.vbar",
+ (obj, "drag,start", "efl.dragable.vbar",
_efl_ui_list_edje_drag_start_cb, obj);
efl_layout_signal_callback_add
- (obj, "drag,stop", "elm.dragable.vbar",
+ (obj, "drag,stop", "efl.dragable.vbar",
_efl_ui_list_edje_drag_stop_cb, obj);
efl_layout_signal_callback_add
- (obj, "drag,step", "elm.dragable.vbar",
+ (obj, "drag,step", "efl.dragable.vbar",
_efl_ui_list_edje_drag_cb, obj);
efl_layout_signal_callback_add
- (obj, "drag,page", "elm.dragable.vbar",
+ (obj, "drag,page", "efl.dragable.vbar",
_efl_ui_list_edje_drag_cb, obj);
efl_layout_signal_callback_add
- (obj, "elm,vbar,press", "elm",
+ (obj, "efl,vbar,press", "efl",
_efl_ui_list_vbar_press_cb, obj);
efl_layout_signal_callback_add
- (obj, "elm,vbar,unpress", "elm",
+ (obj, "efl,vbar,unpress", "efl",
_efl_ui_list_vbar_unpress_cb, obj);
- //Horizontal bar
- efl_layout_signal_callback_add
- (obj, "drag", "elm.dragable.hbar", _efl_ui_list_hbar_drag_cb,
- obj);
- efl_layout_signal_callback_add
- (obj, "drag,set", "elm.dragable.hbar",
- _efl_ui_list_edje_drag_cb, obj);
- efl_layout_signal_callback_add
- (obj, "drag,start", "elm.dragable.hbar",
- _efl_ui_list_edje_drag_start_cb, obj);
- efl_layout_signal_callback_add
- (obj, "drag,stop", "elm.dragable.hbar",
- _efl_ui_list_edje_drag_stop_cb, obj);
- efl_layout_signal_callback_add
- (obj, "drag,step", "elm.dragable.hbar",
- _efl_ui_list_edje_drag_cb, obj);
- efl_layout_signal_callback_add
- (obj, "drag,page", "elm.dragable.hbar",
- _efl_ui_list_edje_drag_cb, obj);
- efl_layout_signal_callback_add
- (obj, "elm,hbar,press", "elm",
- _efl_ui_list_hbar_press_cb, obj);
- efl_layout_signal_callback_add
- (obj, "elm,hbar,unpress", "elm",
- _efl_ui_list_hbar_unpress_cb, obj);
+ /* FIXME: Horizontal Scroll is not yet supported in the list.
+ efl_layout_signal_callback_add
+ (obj, "drag", "efl.dragable.hbar",
+ _efl_ui_list_hbar_drag_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,set", "efl.dragable.hbar",
+ _efl_ui_list_edje_drag_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,start", "efl.dragable.hbar",
+ _efl_ui_list_edje_drag_start_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,stop", "efl.dragable.hbar",
+ _efl_ui_list_edje_drag_stop_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,step", "efl.dragable.hbar",
+ _efl_ui_list_edje_drag_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,page", "efl.dragable.hbar",
+ _efl_ui_list_edje_drag_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "efl,hbar,press", "efl",
+ _efl_ui_list_hbar_press_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "efl,hbar,unpress", "efl",
+ _efl_ui_list_hbar_unpress_cb, obj);
+ */
}
static void
-_efl_ui_list_edje_object_detach(Evas_Object *obj)
+_scroll_edje_object_detach(Eo *obj)
{
+ EFL_UI_LIST_DATA_GET_OR_RETURN(obj, pd);
+
efl_layout_signal_callback_del
- (obj, "reload", "elm", _efl_ui_list_reload_cb, obj);
- //Vertical bar
+ (obj, "reload", "efl",
+ _efl_ui_list_reload_cb, obj);
efl_layout_signal_callback_del
- (obj, "drag", "elm.dragable.vbar", _efl_ui_list_vbar_drag_cb,
- obj);
+ (obj, "drag", "efl.dragable.vbar",
+ _efl_ui_list_vbar_drag_cb, obj);
efl_layout_signal_callback_del
- (obj, "drag,set", "elm.dragable.vbar",
+ (obj, "drag,set", "efl.dragable.vbar",
_efl_ui_list_edje_drag_cb, obj);
efl_layout_signal_callback_del
- (obj, "drag,start", "elm.dragable.vbar",
+ (obj, "drag,start", "efl.dragable.vbar",
_efl_ui_list_edje_drag_start_cb, obj);
efl_layout_signal_callback_del
- (obj, "drag,stop", "elm.dragable.vbar",
+ (obj, "drag,stop", "efl.dragable.vbar",
_efl_ui_list_edje_drag_stop_cb, obj);
efl_layout_signal_callback_del
- (obj, "drag,step", "elm.dragable.vbar",
+ (obj, "drag,step", "efl.dragable.vbar",
_efl_ui_list_edje_drag_cb, obj);
efl_layout_signal_callback_del
- (obj, "drag,page", "elm.dragable.vbar",
+ (obj, "drag,page", "efl.dragable.vbar",
_efl_ui_list_edje_drag_cb, obj);
efl_layout_signal_callback_del
- (obj, "elm,vbar,press", "elm",
+ (obj, "efl,vbar,press", "efl",
_efl_ui_list_vbar_press_cb, obj);
efl_layout_signal_callback_del
- (obj, "elm,vbar,unpress", "elm",
- _efl_ui_list_vbar_unpress_cb, obj);
+ (obj, "efl,vbar,unpress", "efl",
+ _efl_ui_list_vbar_unpress_cb, obj);
- //Horizontal bar
- efl_layout_signal_callback_del
- (obj, "drag", "elm.dragable.hbar", _efl_ui_list_hbar_drag_cb,
- obj);
- efl_layout_signal_callback_del
- (obj, "drag,set", "elm.dragable.hbar",
- _efl_ui_list_edje_drag_cb, obj);
- efl_layout_signal_callback_del
- (obj, "drag,start", "elm.dragable.hbar",
- _efl_ui_list_edje_drag_start_cb, obj);
- efl_layout_signal_callback_del
- (obj, "drag,stop", "elm.dragable.hbar",
- _efl_ui_list_edje_drag_stop_cb, obj);
- efl_layout_signal_callback_del
- (obj, "drag,step", "elm.dragable.hbar",
- _efl_ui_list_edje_drag_cb, obj);
- efl_layout_signal_callback_del
- (obj, "drag,page", "elm.dragable.hbar",
- _efl_ui_list_edje_drag_cb, obj);
- efl_layout_signal_callback_del
- (obj, "elm,hbar,press", "elm",
- _efl_ui_list_hbar_press_cb, obj);
- efl_layout_signal_callback_del
- (obj, "elm,hbar,unpress", "elm",
- _efl_ui_list_hbar_unpress_cb, obj);
+ /* FIXME: Horizontal Scroll is not yet supported in the list.
+ efl_layout_signal_callback_del
+ (obj, "drag", "efl.dragable.hbar",
+ _efl_ui_list_hbar_drag_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,set", "efl.dragable.hbar",
+ _efl_ui_list_edje_drag_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,start", "efl.dragable.hbar",
+ _efl_ui_list_edje_drag_start_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,stop", "efl.dragable.hbar",
+ _efl_ui_list_edje_drag_stop_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,step", "efl.dragable.hbar",
+ _efl_ui_list_edje_drag_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,page", "efl.dragable.hbar",
+ _efl_ui_list_edje_drag_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "efl,hbar,press", "efl",
+ _efl_ui_list_hbar_press_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "efl,hbar,unpress", "efl",
+ _efl_ui_list_hbar_unpress_cb, obj);
+ */
}
-EOLIAN static void
-_efl_ui_list_efl_canvas_group_group_add(Eo *obj, Efl_Ui_List_Data *pd)
+static void
+_efl_ui_list_pan_resized_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
- Efl_Ui_List_Pan_Data *pan_data;
- Eina_Size2D min = {};
- Eina_Bool bounce = _elm_config->thumbscroll_bounce_enable;
+ Eo *obj = data;
+ EFL_UI_LIST_DATA_GET_OR_RETURN(obj, pd);
+ if (!pd->smanager) return;
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+ elm_layout_sizing_eval(obj);
+
+ if (!pd->pan_resized)
+ {
+ Eina_Rect view = efl_ui_scrollable_viewport_geometry_get(pd->smanager);
+ // FIXME: Below code is workaround size check
+ if (view.h > 1)
+ {
+ pd->pan_resized = EINA_TRUE;
+ if (pd->scroll.item)
+ {
+ _item_scroll_internal(obj, pd->scroll.item, pd->scroll.align, pd->scroll.anim);
+
+ pd->scroll.item = NULL;
+ pd->scroll.align = 0.0;
+ pd->scroll.anim = EINA_FALSE;
+ return;
+ }
+ }
+ }
+}
- efl_canvas_group_add(efl_super(obj, MY_CLASS));
- elm_widget_sub_object_parent_add(obj);
+static void
+_efl_ui_list_resized_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ elm_layout_sizing_eval(data);
+}
- elm_widget_can_focus_set(obj, EINA_TRUE);
+static void
+_efl_ui_list_size_hint_changed_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ elm_layout_sizing_eval(data);
+}
- if (!elm_layout_theme_set(obj, "list", "base", elm_widget_style_get(obj)))
- CRI("Failed to set layout!");
+EOLIAN static Eo *
+_efl_ui_list_efl_object_constructor(Eo *obj, Efl_Ui_List_Data *pd EINA_UNUSED)
+{
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
- pd->scrl_mgr = efl_add(EFL_UI_SCROLL_MANAGER_CLASS, obj,
- efl_ui_mirrored_set(efl_added, efl_ui_mirrored_get(obj)));
- pd->pan_obj = efl_add(MY_PAN_CLASS, obj);
- pan_data = efl_data_scope_get(pd->pan_obj, MY_PAN_CLASS);
- pan_data->wobj = obj;
+ return obj;
+}
+
+EOLIAN static Eo *
+_efl_ui_list_efl_object_finalize(Eo *obj,
+ Efl_Ui_List_Data *pd)
+{
+ obj = efl_finalize(efl_super(obj, MY_CLASS));
- efl_ui_scroll_manager_pan_set(pd->scrl_mgr, pd->pan_obj);
- efl_ui_scrollable_bounce_enabled_set(pd->scrl_mgr, bounce, bounce);
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
- edje_object_part_swallow(wd->resize_obj, "elm.swallow.content", pd->pan_obj);
- efl_gfx_stack_raise((Eo *)edje_object_part_object_get(wd->resize_obj, "elm.dragable.vbar"));
+ efl_ui_layout_object_theme_set(obj, "list", "base", efl_ui_widget_style_get(obj));
- pd->mode = ELM_LIST_COMPRESS;
+ pd->smanager = efl_add(EFL_UI_SCROLL_MANAGER_CLASS, obj);
+ efl_ui_mirrored_set(pd->smanager, efl_ui_mirrored_get(obj));
- efl_gfx_visible_set(pd->pan_obj, EINA_TRUE);
+ pd->pan = efl_add(EFL_UI_PAN_CLASS, obj);
- efl_access_type_set(obj, EFL_ACCESS_TYPE_DISABLED);
+ efl_ui_scroll_manager_pan_set(pd->smanager, pd->pan);
+ edje_object_part_swallow(wd->resize_obj, "efl.content", pd->pan);
- edje_object_size_min_calc(wd->resize_obj, &min.w, &min.h);
- efl_gfx_size_hint_restricted_min_set(obj, min);
+ pd->box = efl_add(EFL_UI_BOX_CLASS, obj,
+ efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL));
+ efl_ui_mirrored_set(pd->box, efl_ui_mirrored_get(obj));
+ efl_content_set(pd->pan, pd->box);
+
+ pd->select_mode = EFL_UI_SELECT_SINGLE;
+
+ _scroll_edje_object_attach(obj);
- efl_event_callback_add(obj, EFL_UI_EVENT_SCROLL, _scroll_cb, obj);
efl_event_callback_add(obj, EFL_UI_SCROLLBAR_EVENT_BAR_SIZE_CHANGED,
- _efl_ui_list_bar_size_changed_cb, obj);
+ _efl_ui_list_bar_size_changed_cb, obj);
efl_event_callback_add(obj, EFL_UI_SCROLLBAR_EVENT_BAR_POS_CHANGED,
- _efl_ui_list_bar_pos_changed_cb, obj);
+ _efl_ui_list_bar_pos_changed_cb, obj);
efl_event_callback_add(obj, EFL_UI_SCROLLBAR_EVENT_BAR_SHOW,
- _efl_ui_list_bar_show_cb, obj);
+ _efl_ui_list_bar_show_cb, obj);
efl_event_callback_add(obj, EFL_UI_SCROLLBAR_EVENT_BAR_HIDE,
_efl_ui_list_bar_hide_cb, obj);
-
- _efl_ui_list_edje_object_attach(obj);
+ efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_RESIZE,
+ _efl_ui_list_resized_cb, obj);
+ efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_CHANGE_SIZE_HINTS,
+ _efl_ui_list_size_hint_changed_cb, obj);
+ efl_event_callback_add(pd->pan, EFL_GFX_ENTITY_EVENT_RESIZE,
+ _efl_ui_list_pan_resized_cb, obj);
elm_layout_sizing_eval(obj);
+
+ return obj;
}
EOLIAN static void
-_efl_ui_list_efl_canvas_group_group_del(Eo *obj, Efl_Ui_List_Data *pd)
+_efl_ui_list_efl_object_destructor(Eo *obj, Efl_Ui_List_Data *pd)
{
- ELM_SAFE_FREE(pd->pan_obj, evas_object_del);
- efl_canvas_group_del(efl_super(obj, MY_CLASS));
+ _scroll_edje_object_detach(obj);
+
+ efl_event_callback_del(obj, EFL_UI_SCROLLBAR_EVENT_BAR_SIZE_CHANGED,
+ _efl_ui_list_bar_size_changed_cb, obj);
+ efl_event_callback_del(obj, EFL_UI_SCROLLBAR_EVENT_BAR_POS_CHANGED,
+ _efl_ui_list_bar_pos_changed_cb, obj);
+ efl_event_callback_del(obj, EFL_UI_SCROLLBAR_EVENT_BAR_SHOW,
+ _efl_ui_list_bar_show_cb, obj);
+ efl_event_callback_del(obj, EFL_UI_SCROLLBAR_EVENT_BAR_HIDE,
+ _efl_ui_list_bar_hide_cb, obj);
+ efl_event_callback_del(obj, EFL_GFX_ENTITY_EVENT_RESIZE,
+ _efl_ui_list_resized_cb, obj);
+ efl_event_callback_del(obj, EFL_GFX_ENTITY_EVENT_CHANGE_SIZE_HINTS,
+ _efl_ui_list_size_hint_changed_cb, obj);
+ efl_event_callback_del(pd->pan, EFL_GFX_ENTITY_EVENT_RESIZE,
+ _efl_ui_list_pan_resized_cb, obj);
+
+ efl_del(pd->box);
+ pd->box = NULL;
+ efl_del(pd->pan);
+ pd->pan = NULL;
+ efl_del(pd->smanager);
+ pd->smanager = NULL;
+
+ efl_destructor(efl_super(obj, MY_CLASS));
}
-EOLIAN static Efl_Ui_Focus_Manager*
-_efl_ui_list_elm_widget_focus_manager_create(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd EINA_UNUSED, Efl_Ui_Focus_Object *root)
+EOLIAN static void
+_efl_ui_list_efl_canvas_group_group_calculate(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd EINA_UNUSED)
{
- if (!pd->manager)
- pd->manager = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, obj,
- efl_ui_focus_manager_root_set(efl_added, root));
-
- return pd->manager;
+ // Need to be implemented
+ efl_canvas_group_calculate(efl_super(obj, MY_CLASS));
}
-EOLIAN static Eo *
-_efl_ui_list_efl_object_finalize(Eo *obj, Efl_Ui_List_Data *pd)
+EOLIAN static void
+_efl_ui_list_elm_layout_sizing_eval(Eo *obj, Efl_Ui_List_Data *pd)
{
+ Eina_Size2D min = {0, 0}, max = {0, 0}, size = {-1, -1};
+ Eina_Rect view = {};
+ Evas_Coord vmw = 0, vmh = 0;
+ double xw = 0.0, yw = 0.0;
- if (!pd->factory)
- pd->factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, NULL);
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
- if(!pd->relayout)
+ if (pd->box)
{
- pd->relayout = efl_add(EFL_UI_LIST_PRECISE_LAYOUTER_CLASS, obj);
- if (pd->model)
- efl_ui_list_relayout_model_set(pd->relayout, pd->model);
+ min = efl_gfx_size_hint_combined_min_get(pd->box);
+ max = efl_gfx_size_hint_max_get(pd->box);
+ efl_gfx_size_hint_weight_get(pd->box, &xw, &yw);
}
- return obj;
-}
-EOLIAN static Eo *
-_efl_ui_list_efl_object_constructor(Eo *obj, Efl_Ui_List_Data *pd)
-{
- Efl_Ui_Focus_Manager *manager;
+ if (pd->smanager)
+ view = efl_ui_scrollable_viewport_geometry_get(pd->smanager);
- obj = efl_constructor(efl_super(obj, MY_CLASS));
- pd->obj = obj;
- efl_canvas_object_type_set(obj, MY_CLASS_NAME);
- evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_LIST);
+ if (xw > 0.0)
+ {
+ if ((min.w > 0) && (view.w < min.w))
+ view.w = min.w;
+ else if ((max.w > 0) && (view.w > max.w))
+ view.w = max.w;
+ }
+ else if (min.w > 0)
+ view.w = min.w;
+
+ if (yw > 0.0)
+ {
+ if ((min.h > 0) && (view.h < min.h))
+ view.h = min.h;
+ else if ((max.h > 0) && (view.h > max.h))
+ view.h = max.h;
+ }
+ else if (min.h > 0)
+ view.h = min.h;
- efl_ui_list_segarray_setup(&pd->segarray, 32);
+ if (pd->box) efl_gfx_entity_size_set(pd->box, EINA_SIZE2D(view.w, view.h));
- manager = efl_ui_widget_focus_manager_create(obj, obj);
- efl_composite_attach(obj, manager);
- _efl_ui_focus_manager_redirect_events_add(manager, obj);
+ edje_object_size_min_calc(wd->resize_obj, &vmw, &vmh);
- pd->style = eina_stringshare_add(elm_widget_style_get(obj));
+ if (pd->match_content_w) size.w = vmw + min.w;
+ if (pd->match_content_h) size.h = vmh + min.h;
- pd->factory = NULL;
- pd->orient = EFL_ORIENT_DOWN;
- pd->align.h = 0;
- pd->align.v = 0;
- pd->min.w = 0;
- pd->min.h = 0;
+ max = efl_gfx_size_hint_max_get(obj);
+ if ((max.w > 0) && (size.w > max.w)) size.w = max.w;
+ if ((max.h > 0) && (size.h > max.h)) size.h = max.h;
- return obj;
+ efl_gfx_size_hint_min_set(obj, size);
}
-EOLIAN static void
-_efl_ui_list_efl_object_destructor(Eo *obj, Efl_Ui_List_Data *pd)
+//FIXME: is this box related API could be improved more?
+EOLIAN static int
+_efl_ui_list_efl_container_content_count(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd)
+{
+ return pd->box ? efl_content_count(pd->box) : 0;
+}
+
+EOLIAN static Eina_Iterator *
+_efl_ui_list_efl_container_content_iterate(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd)
{
- efl_ui_list_relayout_model_set(pd->relayout, NULL);
+ return pd->box ? efl_content_iterate(pd->box) : NULL;
+}
- efl_unref(pd->model);
- eina_stringshare_del(pd->style);
+/* FIXME: Direction is not supported yet in the list
+ EOLIAN static void
+ _efl_ui_list_efl_ui_direction_direction_set(Eo *obj, Efl_Ui_List_Data *pd, Efl_Ui_Dir dir)
+ {
+ switch (dir)
+ {
+ case EFL_UI_DIR_RTL:
+ // FIXME: Should be inverted!
+ case EFL_UI_DIR_HORIZONTAL:
+ case EFL_UI_DIR_LTR:
+ pd->dir = EFL_UI_DIR_HORIZONTAL;
+ break;
+
+ case EFL_UI_DIR_UP:
+ // FIXME: Should be inverted!
+ case EFL_UI_DIR_DOWN:
+ case EFL_UI_DIR_VERTICAL:
+ case EFL_UI_DIR_DEFAULT:
+ default:
+ pd->dir = EFL_UI_DIR_VERTICAL;
+ break;
+ }
- efl_event_callback_del(obj, EFL_UI_EVENT_SCROLL, _scroll_cb, obj);
- _efl_ui_list_edje_object_detach(obj);
+ efl_pack_layout_request(obj);
+ }
+ */
- ELM_SAFE_FREE(pd->pan_obj, evas_object_del);
- efl_canvas_group_del(efl_super(obj, MY_CLASS));
+EOLIAN static Efl_Ui_Theme_Apply
+_efl_ui_list_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_List_Data *pd)
+{
+ Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
+ int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
+ if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
- efl_ui_list_segarray_flush(&pd->segarray);
+ efl_ui_mirrored_set(pd->smanager, efl_ui_mirrored_get(obj));
- efl_destructor(efl_super(obj, MY_CLASS));
+ elm_layout_sizing_eval(obj);
+
+ return int_ret;
}
-EOLIAN static void
-_efl_ui_list_layout_factory_set(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd, Efl_Ui_Factory *factory)
+static void
+_list_item_pressed(void *data, const Efl_Event *event)
{
- if (pd->factory)
- efl_unref(pd->factory);
+ Eo *obj = data;
+ Efl_Ui_List_Item *item = event->object;
+ efl_event_callback_call(obj, EFL_UI_EVENT_PRESSED, item);
+}
- pd->factory = factory;
- efl_ref(pd->factory);
+static void
+_list_item_unpressed(void *data, const Efl_Event *event)
+{
+ Eo *obj = data;
+ Efl_Ui_List_Item *item = event->object;
+ efl_event_callback_call(obj, EFL_UI_EVENT_UNPRESSED, item);
}
-EOLIAN static void
-_efl_ui_list_efl_ui_view_model_set(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd, Efl_Model *model)
+static void
+_list_item_longpressed(void *data, const Efl_Event *event)
{
- if (pd->model == model)
- return;
+ Eo *obj = data;
+ Efl_Ui_List_Item *item = event->object;
+ efl_event_callback_call(obj, EFL_UI_EVENT_LONGPRESSED, item);
+}
- if (pd->count_future)
- {
- efl_future_cancel(pd->count_future);
- pd->count_future = NULL;
- }
+static void
+_list_item_selected(void *data, const Efl_Event *event)
+{
+ Eo *obj = data;
+ Efl_Ui_List_Item *item = event->object;
+ Efl_Ui_List_Item *selected;
+ EFL_UI_LIST_DATA_GET_OR_RETURN(obj, pd);
- if (pd->model)
+ /* Single Select */
+ if (pd->select_mode != EFL_UI_SELECT_MULTI)
{
- if (pd->relayout)
- efl_ui_list_relayout_model_set(pd->relayout, NULL);
- efl_ui_list_segarray_flush(&pd->segarray);
- efl_unref(pd->model);
- pd->model = NULL;
+ EINA_LIST_FREE(pd->selected, selected)
+ {
+ if (selected != item)
+ efl_ui_item_selected_set(selected, EINA_FALSE);
+ }
}
+ pd->selected = eina_list_append(pd->selected, item);
+ pd->last_selected = item;
- if (model)
- {
- pd->model = model;
- efl_ref(pd->model);
- if (pd->relayout)
- efl_ui_list_relayout_model_set(pd->relayout, model);
- pd->count_future = efl_model_children_count_get(pd->model);
- efl_future_then(pd->count_future, &_count_then, &_count_error, NULL, pd);
- }
+ efl_event_callback_call(obj, EFL_UI_EVENT_SELECTED, item);
+}
- evas_object_smart_changed(pd->obj);
+static void
+_list_item_unselected(void *data, const Efl_Event *event)
+{
+ Eo *obj = data;
+ Efl_Ui_List_Item *item = event->object;
+ EFL_UI_LIST_DATA_GET_OR_RETURN(obj, pd);
+
+ pd->selected = eina_list_remove(pd->selected, item);
+ if (pd->last_selected == item) pd->last_selected = NULL;
+
+ efl_event_callback_call(obj, EFL_UI_EVENT_UNSELECTED, item);
}
-EOLIAN static Efl_Model *
-_efl_ui_list_efl_ui_view_model_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd)
+static Eina_Bool
+_list_item_process(Eo *obj, Efl_Ui_List_Data *pd, EINA_UNUSED Efl_Ui_List_Item *it)
{
- return pd->model;
+ EFL_UI_LIST_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
+
+ //FIXME: This is tricky workaround for set select mode and parent value.
+ EFL_UI_LIST_ITEM_DATA_GET(it, ld);
+ EFL_UI_ITEM_DATA_GET(it, id);
+ id->select_mode = &(pd->select_mode);
+ id->parent = obj;
+ ld->parent = obj;
+ efl_ui_mirrored_set(it, efl_ui_mirrored_get(obj));
+
+ efl_event_callback_add(it, EFL_UI_EVENT_PRESSED, _list_item_pressed, obj);
+ efl_event_callback_add(it, EFL_UI_EVENT_UNPRESSED, _list_item_unpressed, obj);
+ efl_event_callback_add(it, EFL_UI_EVENT_LONGPRESSED, _list_item_longpressed, obj);
+ efl_event_callback_add(it, EFL_UI_EVENT_SELECTED, _list_item_selected, obj);
+ efl_event_callback_add(it, EFL_UI_EVENT_UNSELECTED, _list_item_unselected, obj);
+
+ return EINA_TRUE;
}
-EOLIAN int
-_efl_ui_list_efl_access_selection_selected_children_count_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd)
+static void
+_list_item_clear(Eo *obj, Efl_Ui_List_Data *pd EINA_UNUSED, EINA_UNUSED Efl_Ui_List_Item *it)
{
- return eina_list_count(pd->selected_items);
+ EFL_UI_LIST_ITEM_CHECK_OR_RETURN(it);
+ EFL_UI_LIST_ITEM_DATA_GET(it, ld);
+ EFL_UI_ITEM_DATA_GET(it, id);
+ id->select_mode = NULL;
+ id->parent = NULL;
+ ld->parent = NULL;
+
+ efl_event_callback_del(it, EFL_UI_EVENT_PRESSED, _list_item_pressed, obj);
+ efl_event_callback_del(it, EFL_UI_EVENT_UNPRESSED, _list_item_unpressed, obj);
+ efl_event_callback_del(it, EFL_UI_EVENT_LONGPRESSED, _list_item_longpressed, obj);
+ efl_event_callback_del(it, EFL_UI_EVENT_SELECTED, _list_item_selected, obj);
+ efl_event_callback_del(it, EFL_UI_EVENT_UNSELECTED, _list_item_unselected, obj);
}
-EOLIAN Eo*
-_efl_ui_list_efl_access_selection_selected_child_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd, int child_index)
+/* Pack APIs */
+EOLIAN static Eina_Bool
+_efl_ui_list_efl_pack_pack_clear(Eo *obj, Efl_Ui_List_Data *pd)
{
- if(child_index < (int) eina_list_count(pd->selected_items))
+ Eina_Bool ret = efl_pack_clear(pd->box);
+
+ if (ret)
{
- Efl_Ui_List_Item* items = eina_list_nth(pd->selected_items, child_index);
- return items[child_index].item.layout;
+ eina_list_free(pd->items);
+ eina_list_free(pd->selected);
+ pd->items = NULL;
+ pd->selected = NULL;
}
- else
- return NULL;
+
+ elm_layout_sizing_eval(obj);
+ return ret;
}
-EOLIAN Eina_Bool
-_efl_ui_list_efl_access_selection_child_select(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd EINA_UNUSED, int child_index EINA_UNUSED)
+EOLIAN static Eina_Bool
+_efl_ui_list_efl_pack_unpack_all(Eo *obj, Efl_Ui_List_Data *pd)
{
- return EINA_FALSE;
+ Eina_Bool ret = efl_pack_unpack_all(pd->box);
+
+ if (ret)
+ {
+ Efl_Ui_List_Item *it = NULL;
+ EINA_LIST_FREE(pd->items, it)
+ {
+ _list_item_clear(obj, pd, it);
+ }
+ eina_list_free(pd->selected);
+ pd->items = NULL;
+ pd->selected = NULL;
+ }
+
+ elm_layout_sizing_eval(obj);
+ return ret;
}
-EOLIAN Eina_Bool
-_efl_ui_list_efl_access_selection_selected_child_deselect(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd EINA_UNUSED, int child_index EINA_UNUSED)
+EOLIAN static Eina_Bool
+_efl_ui_list_efl_pack_unpack(Eo *obj, Efl_Ui_List_Data *pd, Efl_Gfx_Entity *subobj)
{
- return EINA_FALSE;
+ Eina_Bool ret = efl_pack_unpack(pd->box, subobj);
+ Efl_Ui_List_Item *item = (Efl_Ui_List_Item *)subobj;
+
+ if (ret)
+ {
+ pd->items = eina_list_remove(pd->items, item);
+ if (efl_ui_item_selected_get(item))
+ {
+ pd->selected = eina_list_remove(pd->selected, item);
+ }
+ _list_item_clear(obj, pd, item);
+ }
+
+ elm_layout_sizing_eval(obj);
+ return ret;
}
-EOLIAN Eina_Bool
-_efl_ui_list_efl_access_selection_is_child_selected(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd EINA_UNUSED, int child_index EINA_UNUSED)
+EOLIAN static Eina_Bool
+_efl_ui_list_efl_pack_pack(Eo *obj, Efl_Ui_List_Data *pd, Efl_Gfx_Entity *subobj)
{
- return EINA_FALSE;
+ if (!_list_item_process(obj, pd, subobj)) return EINA_FALSE;
+
+ Eina_Bool ret = efl_pack_end(pd->box, subobj);
+ pd->items = eina_list_append(pd->items, subobj);
+ return ret;
}
-EOLIAN Eina_Bool
-_efl_ui_list_efl_access_selection_all_children_select(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd EINA_UNUSED)
+EOLIAN static Eina_Bool
+_efl_ui_list_efl_pack_linear_pack_end(Eo *obj, Efl_Ui_List_Data *pd, Efl_Gfx_Entity *subobj)
{
- return EINA_TRUE;
+ if (!_list_item_process(obj, pd, subobj)) return EINA_FALSE;
+
+ Eina_Bool ret = efl_pack_end(pd->box, subobj);
+ pd->items = eina_list_append(pd->items, subobj);
+ return ret;
}
-EOLIAN Eina_Bool
-_efl_ui_list_efl_access_selection_clear(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd EINA_UNUSED)
+EOLIAN static Eina_Bool
+_efl_ui_list_efl_pack_linear_pack_begin(Eo *obj, Efl_Ui_List_Data *pd, Efl_Gfx_Entity *subobj)
{
- return EINA_TRUE;
+ if (!_list_item_process(obj, pd, subobj)) return EINA_FALSE;
+
+ Eina_Bool ret = efl_pack_begin(pd->box, subobj);
+ pd->items = eina_list_prepend(pd->items, subobj);
+ return ret;
}
-EOLIAN Eina_Bool
-_efl_ui_list_efl_access_selection_child_deselect(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd EINA_UNUSED, int child_index EINA_UNUSED)
+EOLIAN static Eina_Bool
+_efl_ui_list_efl_pack_linear_pack_before(Eo *obj,
+ Efl_Ui_List_Data *pd,
+ Efl_Gfx_Entity *subobj,
+ const Efl_Gfx_Entity *existing)
{
- return EINA_FALSE;
+ if (!_list_item_process(obj, pd, subobj)) return EINA_FALSE;
+ EFL_UI_LIST_ITEM_CHECK_OR_RETURN(existing, EINA_FALSE);
+
+ Eina_Bool ret = efl_pack_before(pd->box, subobj, existing);
+ pd->items = eina_list_prepend_relative(pd->items, subobj, existing);
+ return ret;
}
-static Eina_Bool
-_key_action_move(Evas_Object *obj EINA_UNUSED, const char *params EINA_UNUSED)
+EOLIAN static Eina_Bool
+_efl_ui_list_efl_pack_linear_pack_after(Eo *obj,
+ Efl_Ui_List_Data *pd,
+ Efl_Gfx_Entity *subobj,
+ const Efl_Gfx_Entity *existing)
{
- return EINA_FALSE;
+ if (!_list_item_process(obj, pd, subobj)) return EINA_FALSE;
+ EFL_UI_LIST_ITEM_CHECK_OR_RETURN(existing, EINA_FALSE);
+
+ Eina_Bool ret = efl_pack_after(pd->box, subobj, existing);
+ pd->items = eina_list_append_relative(pd->items, subobj, existing);
+ return ret;
}
-static Eina_Bool
-_key_action_select(Evas_Object *obj EINA_UNUSED, const char *params EINA_UNUSED)
+EOLIAN static Eina_Bool
+_efl_ui_list_efl_pack_linear_pack_at(Eo *obj,
+ Efl_Ui_List_Data *pd,
+ Efl_Gfx_Entity *subobj,
+ int index)
{
- return EINA_FALSE;
+ if (!_list_item_process(obj, pd, subobj)) return EINA_FALSE;
+ Efl_Ui_List_Item *existing = efl_pack_content_get(pd->box, index);
+
+ Eina_Bool ret = efl_pack_at(pd->box, subobj, index);
+ pd->items = eina_list_append_relative(pd->items, subobj, existing);
+ return ret;
}
-static Eina_Bool
-_key_action_escape(Evas_Object *obj, const char *params EINA_UNUSED)
+EOLIAN static Efl_Gfx_Entity *
+_efl_ui_list_efl_pack_linear_pack_content_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd, int index)
{
- efl_ui_focus_manager_reset_history(obj);
- return EINA_TRUE;
+ return efl_pack_content_get(pd->box, index);
}
-ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_list, Efl_Ui_List_Data)
+EOLIAN static Efl_Gfx_Entity *
+_efl_ui_list_efl_pack_linear_pack_unpack_at(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd, int index)
+{
+ return efl_pack_unpack_at(pd->box, index);
+}
-void
-_efl_ui_list_item_select_set(Efl_Ui_List_LayoutItem *item, Eina_Bool selected)
+EOLIAN static int
+_efl_ui_list_efl_pack_linear_pack_index_get(Eo *obj EINA_UNUSED,
+ Efl_Ui_List_Data *pd,
+ const Efl_Gfx_Entity *subobj)
{
- Eina_Stringshare *sprop;
- assert(item != NULL);
- assert(item->children != NULL);
+ return efl_pack_index_get(pd->box, subobj);
+}
- selected = !!selected;
+EOLIAN static void
+_efl_ui_list_efl_pack_layout_layout_update(Eo *obj, Efl_Ui_List_Data *pd)
+{
+ efl_pack_layout_update(pd->box);
+ elm_layout_sizing_eval(obj);
- sprop = eina_stringshare_add(SELECTED_PROP);
+ efl_event_callback_legacy_call(obj, EFL_PACK_EVENT_LAYOUT_UPDATED, NULL);
+}
- if (_efl_model_properties_has(item->children, sprop))
- {
- Eina_Value v;
- eina_value_setup(&v, EINA_VALUE_TYPE_UCHAR);
- eina_value_set(&v, selected);
- efl_model_property_set(item->children, sprop, &v);
- eina_value_flush(&v);
- }
- eina_stringshare_del(sprop);
+EOLIAN static void
+_efl_ui_list_efl_pack_layout_layout_request(Eo *obj, Efl_Ui_List_Data *pd)
+{
+ efl_pack_layout_request(pd->box);
+ elm_layout_sizing_eval(obj);
}
-static void
-_efl_ui_list_relayout_set(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd EINA_UNUSED, Efl_Ui_List_Relayout *object)
+EOLIAN static void
+_efl_ui_list_efl_pack_pack_padding_set(Eo *obj EINA_UNUSED,
+ Efl_Ui_List_Data *pd,
+ double h,
+ double v,
+ Eina_Bool scalable)
{
- if(pd->relayout)
- efl_unref(pd->relayout);
+ efl_pack_padding_set(pd->box, h, v, scalable);
+}
- pd->relayout = object;
- efl_ref(pd->relayout);
+EOLIAN static void
+_efl_ui_list_efl_pack_pack_padding_get(const Eo *obj EINA_UNUSED,
+ Efl_Ui_List_Data *pd,
+ double *h,
+ double *v,
+ Eina_Bool *scalable)
+{
+ efl_pack_padding_get(pd->box, h, v, scalable);
+}
+
+/* FIXME: align could not work properly on the list
+ EOLIAN static void
+ _efl_ui_list_efl_pack_pack_align_set(Eo *obj, Efl_Ui_List_Data *pd, double h, double v)
+ {
+ efl_pack_align_set(pd->box, h, v);
+ }
+
+ EOLIAN static void
+ _efl_ui_list_efl_pack_pack_align_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd, double *h, double *v)
+ {
+ efl_pack_align_get(pd->box, &h, &v);
+ }
+ */
+
+/* Scroll APIs */
+EOLIAN static Eina_Size2D
+_efl_ui_list_efl_ui_scrollable_interactive_content_size_get(const Eo *obj EINA_UNUSED,
+ Efl_Ui_List_Data *pd)
+{
+ return efl_ui_scrollable_content_size_get(pd->smanager);
}
-static Efl_Ui_List_Relayout *
-_efl_ui_list_relayout_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd EINA_UNUSED)
+EOLIAN static Eina_Rect
+_efl_ui_list_efl_ui_scrollable_interactive_viewport_geometry_get(const Eo *obj EINA_UNUSED,
+ Efl_Ui_List_Data *pd)
{
- return pd->relayout;
+ return efl_ui_scrollable_viewport_geometry_get(pd->smanager);
}
-static void
-_layout(Efl_Ui_List_Data *pd)
+EOLIAN static void
+_efl_ui_list_efl_ui_scrollable_interactive_bounce_enabled_set(Eo *obj EINA_UNUSED,
+ Efl_Ui_List_Data *pd,
+ Eina_Bool horiz,
+ Eina_Bool vert)
{
- if (!pd->model)
- return;
+ efl_ui_scrollable_bounce_enabled_set(pd->smanager, horiz, vert);
+}
- efl_ui_list_relayout_layout_do(pd->relayout, pd->obj, pd->segarray_first, &pd->segarray);
+EOLIAN static void
+_efl_ui_list_efl_ui_scrollable_interactive_bounce_enabled_get(const Eo *obj EINA_UNUSED,
+ Efl_Ui_List_Data *pd,
+ Eina_Bool *horiz,
+ Eina_Bool *vert)
+{
+ efl_ui_scrollable_bounce_enabled_get(pd->smanager, horiz, vert);
}
-static void
-_children_slice_then(void * data, Efl_Event const* event)
+EOLIAN static Eina_Bool
+_efl_ui_list_efl_ui_scrollable_interactive_scroll_hold_get(const Eo *obj EINA_UNUSED,
+ Efl_Ui_List_Data *pd)
{
- Efl_Ui_List_Data *pd = data;
- Eina_Accessor *acc = (Eina_Accessor*)((Efl_Future_Event_Success*)event->info)->value;
+ return efl_ui_scrollable_scroll_hold_get(pd->smanager);
+}
- efl_ui_list_segarray_insert_accessor(&pd->segarray, pd->outstanding_slice.slice_start, acc);
+EOLIAN static void
+_efl_ui_list_efl_ui_scrollable_interactive_scroll_hold_set(Eo *obj EINA_UNUSED,
+ Efl_Ui_List_Data *pd,
+ Eina_Bool hold)
+{
+ efl_ui_scrollable_scroll_hold_set(pd->smanager, hold);
+}
- pd->segarray_first = pd->outstanding_slice.slice_start;
- pd->outstanding_slice.slice_start = pd->outstanding_slice.slice_count = 0;
- pd->slice_future = NULL;
+EOLIAN static Eina_Bool
+_efl_ui_list_efl_ui_scrollable_interactive_scroll_freeze_get(const Eo *obj EINA_UNUSED,
+ Efl_Ui_List_Data *pd)
+{
+ return efl_ui_scrollable_scroll_freeze_get(pd->smanager);
}
-/* EFL UI LIST MODEL INTERFACE */
-EOLIAN static Eina_Size2D
-_efl_ui_list_efl_ui_list_model_min_size_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd)
+EOLIAN static void
+_efl_ui_list_efl_ui_scrollable_interactive_scroll_freeze_set(Eo *obj EINA_UNUSED,
+ Efl_Ui_List_Data *pd,
+ Eina_Bool freeze)
{
- return pd->min;
+ efl_ui_scrollable_scroll_freeze_set(pd->smanager, freeze);
}
EOLIAN static void
-_efl_ui_list_efl_ui_list_model_min_size_set(Eo *obj, Efl_Ui_List_Data *pd, Eina_Size2D min)
+_efl_ui_list_efl_ui_scrollable_interactive_match_content_set(Eo *obj EINA_UNUSED,
+ Efl_Ui_List_Data *pd,
+ Eina_Bool match_content_w,
+ Eina_Bool match_content_h)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+ pd->match_content_w = !!match_content_w;
+ pd->match_content_h = !!match_content_h;
- pd->min.w = min.w;
- pd->min.h = min.h;
+ efl_ui_scrollable_match_content_set(pd->smanager, match_content_w, match_content_h);
- evas_object_size_hint_min_set(wd->resize_obj, pd->min.w, pd->min.h);
- efl_event_callback_call(pd->pan_obj, EFL_UI_PAN_EVENT_CONTENT_CHANGED, NULL);
+ elm_layout_sizing_eval(obj);
}
-EOLIAN static Efl_Ui_List_LayoutItem *
-_efl_ui_list_efl_ui_list_model_realize(Eo *obj, Efl_Ui_List_Data *pd, Efl_Ui_List_LayoutItem *item)
+EOLIAN static void
+_efl_ui_list_efl_ui_scrollbar_bar_mode_set(Eo *obj EINA_UNUSED,
+ Efl_Ui_List_Data *pd,
+ Efl_Ui_Scrollbar_Mode hmode,
+ Efl_Ui_Scrollbar_Mode vmode)
{
- Efl_Ui_List_Item_Event evt;
- EINA_SAFETY_ON_NULL_RETURN_VAL(item->children, item);
-
- item->layout = efl_ui_factory_create(pd->factory, item->children, obj);
- evas_object_smart_member_add(item->layout, pd->pan_obj);
- evas_object_event_callback_add(item->layout, EVAS_CALLBACK_MOUSE_UP, _on_item_mouse_up, item);
+ efl_ui_scrollbar_bar_mode_set(pd->smanager, hmode, vmode);
+}
- evt.child = item->children;
- evt.layout = item->layout;
- evt.index = efl_ui_list_item_index_get((Efl_Ui_List_Item *)item);
- efl_event_callback_call(obj, EFL_UI_LIST_EVENT_ITEM_REALIZED, &evt);
+EOLIAN static void
+_efl_ui_list_efl_ui_scrollbar_bar_mode_get(const Eo *obj EINA_UNUSED,
+ Efl_Ui_List_Data *pd,
+ Efl_Ui_Scrollbar_Mode *hmode,
+ Efl_Ui_Scrollbar_Mode *vmode)
+{
+ efl_ui_scrollbar_bar_mode_get(pd->smanager, hmode, vmode);
+}
- evas_object_show(item->layout);
- return item;
+EOLIAN static void
+_efl_ui_list_efl_ui_scrollable_interactive_scroll(Eo *obj EINA_UNUSED,
+ Efl_Ui_List_Data *pd,
+ Eina_Rect rc,
+ Eina_Bool animation)
+{
+ efl_ui_scrollable_scroll(pd->smanager, rc, animation);
}
EOLIAN static void
-_efl_ui_list_efl_ui_list_model_unrealize(Eo *obj, Efl_Ui_List_Data *pd, Efl_Ui_List_LayoutItem *item)
+_efl_ui_list_efl_ui_multi_selectable_select_mode_set(Eo *obj EINA_UNUSED,
+ Efl_Ui_List_Data *pd,
+ Efl_Ui_Select_Mode mode)
{
- Efl_Ui_List_Item_Event evt;
- EINA_SAFETY_ON_NULL_RETURN(item->layout);
+ Efl_Ui_List_Item *selected;
- evas_object_event_callback_del_full(item->layout, EVAS_CALLBACK_MOUSE_UP, _on_item_mouse_up, item);
- evas_object_hide(item->layout);
- evas_object_move(item->layout, -9999, -9999);
+ if ((pd->select_mode == EFL_UI_SELECT_MULTI &&
+ mode != EFL_UI_SELECT_MULTI) ||
+ mode == EFL_UI_SELECT_NONE)
+ {
+ Eina_List *clone = eina_list_clone(pd->selected);
+ EINA_LIST_FREE(clone, selected)
+ efl_ui_item_selected_set(selected, EINA_FALSE);
+ }
- evt.child = item->children;
- evt.layout = item->layout;
- evt.index = efl_ui_list_item_index_get((Efl_Ui_List_Item *)item);
- efl_event_callback_call(obj, EFL_UI_LIST_EVENT_ITEM_UNREALIZED, &evt);
+ pd->select_mode = mode;
+}
- evas_object_smart_member_del(item->layout);
- efl_ui_factory_release(pd->factory, item->layout);
- item->layout = NULL;
+EOLIAN static Efl_Ui_Select_Mode
+_efl_ui_list_efl_ui_multi_selectable_select_mode_get(const Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd)
+{
+ return pd->select_mode;
}
+/* List APIs */
EOLIAN static void
-_efl_ui_list_efl_ui_list_model_load_range_set(Eo* obj EINA_UNUSED, Efl_Ui_List_Data* pd, int first, int count)
+_efl_ui_list_item_scroll(Eo *obj,
+ Efl_Ui_List_Data *pd,
+ Efl_Ui_List_Item *item,
+ Eina_Bool animation)
{
- if(!pd->slice_future)
+ // Need to be implemented here.
+ if (pd->pan_resized)
{
- pd->slice_future = efl_model_children_slice_get(pd->model, first, count);
- pd->outstanding_slice.slice_start = first;
- pd->outstanding_slice.slice_count = count;
- efl_future_then(pd->slice_future, &_children_slice_then, &_children_slice_error, NULL, pd);
+ _item_scroll_internal(obj, item, -1.0, animation);
+ }
+ else
+ {
+ pd->scroll.item = item;
+ pd->scroll.align = -1.0;
+ pd->scroll.anim = animation;
}
}
-EOLIAN static int
-_efl_ui_list_efl_ui_list_model_size_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd)
+EOLIAN static void
+_efl_ui_list_item_scroll_align(Eo *obj,
+ Efl_Ui_List_Data *pd,
+ Efl_Ui_List_Item *item,
+ double align,
+ Eina_Bool animation)
+{
+ // Need to be implemented here.
+ if (pd->pan_resized)
+ {
+ _item_scroll_internal(obj, item, align, animation);
+ }
+ else
+ {
+ pd->scroll.item = item;
+ pd->scroll.align = align;
+ pd->scroll.anim = animation;
+ }
+}
+
+EOLIAN static Efl_Ui_List_Item *
+_efl_ui_list_last_selected_item_get(const Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd)
{
- return pd->item_count;
+ return pd->last_selected;
}
-/* Internal EO APIs and hidden overrides */
+static Eina_Bool
+_list_item_iterator_next(Item_Iterator *it, void **data)
+{
+ Efl_Ui_List_Item *item;
+
+ if (!eina_iterator_next(it->real_iterator, (void **)&item))
+ return EINA_FALSE;
+
+ if (data) *data = item;
+ return EINA_TRUE;
+}
+
+static Eo *
+_list_item_iterator_get_container(Item_Iterator *it)
+{
+ return it->object;
+}
+
+static void
+_list_item_iterator_free(Item_Iterator *it)
+{
+ eina_iterator_free(it->real_iterator);
+ eina_list_free(it->list);
+ free(it);
+}
+
+EOLIAN static Eina_Iterator *
+_efl_ui_list_selected_items_get(Eo *obj, Efl_Ui_List_Data *pd)
+{
+ Item_Iterator *item;
+
+ item = calloc(1, sizeof(*item));
+ if (!item) return NULL;
+
+ EINA_MAGIC_SET(&item->iterator, EINA_MAGIC_ITERATOR);
+
+ item->list = eina_list_clone(pd->selected);
+ item->real_iterator = eina_list_iterator_new(item->list);
+ item->iterator.version = EINA_ITERATOR_VERSION;
+ item->iterator.next = FUNC_ITERATOR_NEXT(_list_item_iterator_next);
+ item->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_list_item_iterator_get_container);
+ item->iterator.free = FUNC_ITERATOR_FREE(_list_item_iterator_free);
+ item->object = obj;
+ return &item->iterator;
+}
+
+/* Internal EO APIs and hidden overrides */
#define EFL_UI_LIST_EXTRA_OPS \
- EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_list)
+ ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_list)
#include "efl_ui_list.eo.c"
-#include "efl_ui_list_relayout.eo.c"
-#include "efl_ui_list_model.eo.c"
diff --git a/src/lib/elementary/efl_ui_list.eo b/src/lib/elementary/efl_ui_list.eo
index 72208c814f..b97e5b5b99 100644
--- a/src/lib/elementary/efl_ui_list.eo
+++ b/src/lib/elementary/efl_ui_list.eo
@@ -1,113 +1,93 @@
-import elm_general;
+import efl_ui_list_item;
-struct Efl.Ui.List.Item_Event
-{
- layout: Efl.Ui.Layout;
- child: Efl.Model;
- index: int;
-}
-class Efl.Ui.List (Efl.Ui.Layout, Efl.Ui.View, Efl.Ui.Scrollable.Interactive, Efl.Ui.Scrollbar,
- Efl.Access.Widget.Action, Efl.Access.Selection,
- Efl.Ui.Clickable, Efl.Ui.Selectable, Efl.Ui.List.Model)
+class Efl.Ui.List (Efl.Ui.Layout.Object,
+ Efl.Ui.Scrollable_Interactive,
+ Efl.Ui.Scrollbar,
+ Efl.Pack_Linear, Efl.Pack_Layout,
+ Efl.Ui.Clickable,
+ Efl.Ui.Selectable,
+ Efl.Ui.Multi_Selectable)
{
+ [[Simple list widget with Pack interface.]]
methods {
- @property relayout {
- values {
- object: Efl.Ui.List.Relayout;
+ item_scroll {
+ [[scroll move the item to show in the viewport.]]
+ params {
+ @in item: Efl.Ui.List_Item; [[Target item.]]
+ @in animation: bool; [[Boolean value for animation of scroll move.]]
}
}
- @property homogeneous {
- get {
- [[Get whether the homogeneous mode is enabled.]]
- }
- set {
- [[Enable/disable homogeneous mode.]]
- }
- values {
- homogeneous: bool; [[Assume the items within the genlist are of
- the same height and width. Default is $false.]]
+ item_scroll_align {
+ [[scroll move the item to show at the align position of the viewport.]]
+ params {
+ @in item: Efl.Ui.List_Item; [[Target item.]]
+ @in align: double; [[align value in Viewport.]]
+ @in animation: bool; [[Boolean value for animation of scroll move.]]
}
}
- @property select_mode {
- [[Listview select mode.]]
+ @property last_selected_item {
+ [[Property data of last selected item.]]
get {}
- set {}
values {
- mode: Elm.Object.Select_Mode(Elm.Object.Select_Mode.max); [[The select mode.]]
+ return: Efl.Ui.List_Item; [[last selected item of list.]]
}
}
- @property default_style {
- values {
- style: stringshare;
- }
- }
- @property layout_factory {
- [[Listview layout factory set.]]
- set {}
- values {
- factory: Efl.Ui.Factory; [[The factory.]]
- }
+ selected_items_get {
+ [[Get the selected items iterator. The iterator sequence will be decided by selection.]]
+ return: iterator<Efl.Ui.List_Item> @owned @warn_unused; [[Iterator covered by selected items list.
+ user have to free the iterator after used.]]
}
}
- events {
- item,realized : Efl.Ui.List.Item_Event;
- item,unrealized : Efl.Ui.List.Item_Event;
- item,focused : Efl.Ui.List.Item_Event;
- item,unfocused : Efl.Ui.List.Item_Event;
- item,highlighted : Efl.Ui.List.Item_Event;
- item,unhighlighted : Efl.Ui.List.Item_Event;
- item,selected : Efl.Ui.List.Item_Event;
- item,unselected : Efl.Ui.List.Item_Event;
- }
-
implements {
+ //Efl.Object
Efl.Object.constructor;
Efl.Object.finalize;
Efl.Object.destructor;
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set; }
- // Smart obj
- Efl.Canvas.Group.group_member_add;
+
+ //Efl.Canvas
Efl.Canvas.Group.group_calculate;
- Efl.Ui.List.Model.load_range { set;}
- Efl.Ui.List.Model.realize;
- Efl.Ui.List.Model.unrealize;
- Efl.Ui.List.Model.size { get; }
- Efl.Ui.List.Model.min_size { get; set; }
+ //Efl.Container
+ Efl.Container.content_iterate;
+ Efl.Container.content_count;
+
+ //Efl.Ui.Direction.direction { get; set; } //TODO
+
+ //Efl.Ui.Widget
+ Efl.Ui.Widget.theme_apply;
+
+ //Efl.Ui.Focus
+ //Efl.Ui.Focus.Object.on_focus_update;
- // Widget
-// Elm.Widget.focus_next_manager_is;
-// Elm.Widget.focus_direction_manager_is;
-// Elm.Widget.focus_register;
-// Elm.Widget.focus_next;
-// Elm.Widget.on_focus_update;
-// Elm.Widget.activate;
-// Elm.Widget.focused_item { get; }
-// Elm.Widget.focused_object { get; }
- Elm.Widget.focus_manager_create;
- Elm.Widget.widget_event;
+ //Efl.Pack
+ Efl.Pack.pack_clear;
+ Efl.Pack.unpack_all;
+ Efl.Pack.unpack;
+ Efl.Pack.pack;
+ Efl.Pack_Linear.pack_begin;
+ Efl.Pack_Linear.pack_end;
+ Efl.Pack_Linear.pack_before;
+ Efl.Pack_Linear.pack_after;
+ Efl.Pack_Linear.pack_at;
+ Efl.Pack_Linear.pack_content_get;
+ Efl.Pack_Linear.pack_unpack_at;
+ Efl.Pack_Linear.pack_index_get;
+ Efl.Pack_Layout.layout_update;
+ Efl.Pack_Layout.layout_request;
+ Efl.Pack.pack_padding { get; set; }
+ //Efl.Pack.pack_align { get; set; }
-// Efl.Ui.Focus.Manager.focus {set; }
- //Efl.Ui.Layout.sizing_eval;
- Efl.Ui.View.model { get; set; }
+ //Efl.Ui.Scrollable
+ Efl.Ui.Scrollable_Interactive.scroll;
+ Efl.Ui.Scrollable_Interactive.content_size{ get; }
+ Efl.Ui.Scrollable_Interactive.viewport_geometry{ get; }
+ Efl.Ui.Scrollable_Interactive.bounce_enabled { set; get; }
+ Efl.Ui.Scrollable_Interactive.scroll_freeze { get; set; }
+ Efl.Ui.Scrollable_Interactive.scroll_hold { get; set; }
+ Efl.Ui.Scrollable_Interactive.match_content { set; }
+ Efl.Ui.Scrollbar.bar_mode { get; set; }
- Efl.Ui.Scrollable.Interactive.viewport_geometry { get; }
- Efl.Ui.Scrollable.Interactive.content_pos { get; set; }
- Efl.Ui.Scrollable.Interactive.content_size { get; }
-// Efl.Ui.Scrollable.Interactive.scroll;
- Efl.Layout.Signal.signal_callback_add;
- Efl.Layout.Signal.signal_callback_del;
-// Elm.Interface.Atspi_Accessible.children { get; }
-// Elm.Interface.Atspi_Widget_Action.elm_actions { get; }
-// Efl.Access.Widget.Action.elm_actions { get; }
- Efl.Access.Selection.selected_children_count { get; }
- Efl.Access.Selection.selected_child { get; }
- Efl.Access.Selection.selected_child_deselect;
- Efl.Access.Selection.child_select;
- Efl.Access.Selection.child_deselect;
- Efl.Access.Selection.is_child_selected;
- Efl.Access.Selection.all_children_select;
- Efl.Access.Selection.clear;
+ //Efl.Ui.Multi_Selectable
+ Efl.Ui.Multi_Selectable.select_mode {get; set;}
}
}
diff --git a/src/lib/elementary/efl_ui_list_default_item.c b/src/lib/elementary/efl_ui_list_default_item.c
new file mode 100644
index 0000000000..19bfed4e0d
--- /dev/null
+++ b/src/lib/elementary/efl_ui_list_default_item.c
@@ -0,0 +1,112 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#define EFL_UI_LIST_DEFAULT_ITEM_PROTECTED
+#define EFL_PART_PROTECTED
+
+#include <Elementary.h>
+
+#include "elm_priv.h"
+#include "efl_ui_list_default_item_part_icon.eo.h"
+#include "efl_ui_list_default_item_part_end.eo.h"
+#include "elm_part_helper.h"
+
+#define MY_CLASS EFL_UI_LIST_DEFAULT_ITEM_CLASS
+#define MY_CLASS_PFX efl_ui_list_default_item
+
+#define MY_CLASS_NAME "Efl.Ui.List_Default_Item"
+
+EOLIAN static Efl_Object *
+_efl_ui_list_default_item_efl_object_finalize(Eo *obj, void *pd EINA_UNUSED)
+{
+ Eo *eo;
+ eo = efl_finalize(efl_super(obj, MY_CLASS));
+ ELM_WIDGET_DATA_GET_OR_RETURN(eo, wd, eo);
+ Efl_Ui_Theme_Apply theme_apply = efl_ui_layout_object_theme_set(obj, "list_item", NULL, NULL);
+
+ if (theme_apply == EFL_UI_THEME_APPLY_FAILED)
+ CRI("Default Item(%p) failed to set theme [efl/list_item]!", eo);
+ return eo;
+}
+
+EOLIAN static void
+_efl_ui_list_default_item_efl_object_destructor(Eo *obj, void *pd EINA_UNUSED)
+{
+ efl_destructor(efl_super(obj, MY_CLASS));
+}
+
+/* Efl.Part */
+
+ELM_PART_TEXT_DEFAULT_GET(efl_ui_list_default_item, "efl.text")
+ELM_PART_TEXT_DEFAULT_IMPLEMENT(efl_ui_list_default_item, void)
+ELM_PART_MARKUP_DEFAULT_IMPLEMENT(efl_ui_list_default_item, void)
+ELM_PART_CONTENT_DEFAULT_GET(efl_ui_list_default_item, "efl.icon")
+ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_list_default_item, void
+)
+
+Eina_Bool
+_efl_ui_list_default_item_part_icon_efl_content_content_set(Eo *obj, void *pd EINA_UNUSED, Efl_Gfx_Entity *content)
+{
+ Elm_Part_Data *wd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ return efl_content_set(efl_part(efl_super(wd->obj, MY_CLASS), wd->part), content);
+}
+
+Efl_Gfx_Entity *
+_efl_ui_list_default_item_part_icon_efl_content_content_get(const Eo *obj, void *pd EINA_UNUSED)
+{
+ Elm_Part_Data *wd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ return efl_content_get(efl_part(efl_super(wd->obj, MY_CLASS), wd->part));
+}
+
+Efl_Gfx_Entity *
+_efl_ui_list_default_item_part_icon_efl_content_content_unset(Eo *obj, void *pd EINA_UNUSED)
+{
+ Elm_Part_Data *wd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ return efl_content_unset(efl_part(efl_super(wd->obj, MY_CLASS), wd->part));
+}
+#include "efl_ui_list_default_item_part_icon.eo.c"
+
+Eina_Bool
+_efl_ui_list_default_item_part_end_efl_content_content_set(Eo *obj, void *pd EINA_UNUSED, Efl_Gfx_Entity *content)
+{
+ Elm_Part_Data *wd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ return efl_content_set(efl_part(efl_super(wd->obj, MY_CLASS), wd->part), content);
+}
+
+Efl_Gfx_Entity *
+_efl_ui_list_default_item_part_end_efl_content_content_get(const Eo *obj, void *pd EINA_UNUSED)
+{
+ Elm_Part_Data *wd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ return efl_content_get(efl_part(efl_super(wd->obj, MY_CLASS), wd->part));
+}
+
+Efl_Gfx_Entity *
+_efl_ui_list_default_item_part_end_efl_content_content_unset(Eo *obj, void *pd EINA_UNUSED)
+{
+ Elm_Part_Data *wd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ return efl_content_unset(efl_part(efl_super(wd->obj, MY_CLASS), wd->part));
+}
+#include "efl_ui_list_default_item_part_end.eo.c"
+
+EOLIAN static Efl_Object *
+_efl_ui_list_default_item_efl_part_part_get(const Eo *obj, void *wd EINA_UNUSED, const char *part)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
+ if (eina_streq(part, "text"))
+ return ELM_PART_IMPLEMENT(EFL_UI_LAYOUT_PART_TEXT_CLASS, obj, "efl.text");
+ else if (eina_streq(part, "icon"))
+ return ELM_PART_IMPLEMENT(EFL_UI_LIST_DEFAULT_ITEM_PART_ICON_CLASS, obj, "efl.icon");
+ else if (eina_streq(part, "end"))
+ return ELM_PART_IMPLEMENT(EFL_UI_LIST_DEFAULT_ITEM_PART_END_CLASS, obj, "efl.end");
+
+ return efl_part_get(efl_super(obj, MY_CLASS), part);
+}
+/* Efl.Part end */
+
+/* Internal EO APIs and hidden overrides */
+#define EFL_UI_LIST_DEFAULT_ITEM_EXTRA_OPS \
+ ELM_PART_TEXT_DEFAULT_OPS(efl_ui_list_default_item), \
+ ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_list_default_item)
+
+#include "efl_ui_list_default_item.eo.c"
diff --git a/src/lib/elementary/efl_ui_list_default_item.eo b/src/lib/elementary/efl_ui_list_default_item.eo
new file mode 100644
index 0000000000..3bd44e6b4f
--- /dev/null
+++ b/src/lib/elementary/efl_ui_list_default_item.eo
@@ -0,0 +1,24 @@
+
+class Efl.Ui.List_Default_Item (Efl.Ui.List_Item,
+ Efl.Text,
+ Efl.Text_Markup,
+ Efl.Ui.Translatable,
+ Efl.Content)
+{
+ [[List Default Item class.
+ This class need to be sub object of list widget.
+ text and contents can be appliable by efl_text,
+ efl_content or efl_part APIs.]]
+ data: null;
+ implements {
+ //Efl.Object
+ Efl.Object.finalize;
+ Efl.Object.destructor;
+ Efl.Text.text { get; set; }
+ Efl.Text_Markup.markup { get; set; }
+ Efl.Ui.Translatable.translatable_text { get; set; }
+ Efl.Content.content { get; set; }
+ Efl.Content.content_unset;
+ Efl.Part.part_get;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_list_default_item_part_end.eo b/src/lib/elementary/efl_ui_list_default_item_part_end.eo
new file mode 100644
index 0000000000..7388c9f49b
--- /dev/null
+++ b/src/lib/elementary/efl_ui_list_default_item_part_end.eo
@@ -0,0 +1,9 @@
+class Efl.Ui.List_Default_Item_Part_End (Efl.Ui.Layout.Part, Efl.Content)
+{
+ [[List Default Item internal content of end part class]]
+ data: null;
+ implements {
+ Efl.Content.content { get; set; }
+ Efl.Content.content_unset;
+ }
+} \ No newline at end of file
diff --git a/src/lib/elementary/efl_ui_list_default_item_part_icon.eo b/src/lib/elementary/efl_ui_list_default_item_part_icon.eo
new file mode 100644
index 0000000000..faed96db51
--- /dev/null
+++ b/src/lib/elementary/efl_ui_list_default_item_part_icon.eo
@@ -0,0 +1,9 @@
+class Efl.Ui.List_Default_Item_Part_Icon (Efl.Ui.Layout.Part, Efl.Content)
+{
+ [[List Default Item internal content of icon part class]]
+ data: null;
+ implements {
+ Efl.Content.content { get; set; }
+ Efl.Content.content_unset;
+ }
+} \ No newline at end of file
diff --git a/src/lib/elementary/efl_ui_list_empty_item.c b/src/lib/elementary/efl_ui_list_empty_item.c
new file mode 100644
index 0000000000..066abddbdc
--- /dev/null
+++ b/src/lib/elementary/efl_ui_list_empty_item.c
@@ -0,0 +1,57 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#define EFL_UI_LIST_EMPTY_ITEM_PROTECTED
+#define EFL_PART_PROTECTED
+
+#include <Elementary.h>
+
+#include "elm_priv.h"
+#include "elm_part_helper.h"
+
+#define MY_CLASS EFL_UI_LIST_EMPTY_ITEM_CLASS
+#define MY_CLASS_PFX efl_ui_list_empty_item
+
+#define MY_CLASS_NAME "Efl.Ui.List_Empty_Item"
+
+EOLIAN static Efl_Object *
+_efl_ui_list_empty_item_efl_object_finalize(Eo *obj, void *pd EINA_UNUSED)
+{
+ Eo *eo;
+ eo = efl_finalize(efl_super(obj, MY_CLASS));
+ ELM_WIDGET_DATA_GET_OR_RETURN(eo, wd, eo);
+ Efl_Ui_Theme_Apply theme_apply = efl_ui_layout_object_theme_set(obj, "list_item", NULL, "empty");
+
+ if (theme_apply == EFL_UI_THEME_APPLY_FAILED)
+ CRI("Empty Item(%p) failed to set theme [efl/list_item:empty]!", eo);
+ return eo;
+}
+
+EOLIAN static void
+_efl_ui_list_empty_item_efl_object_destructor(Eo *obj, void *pd EINA_UNUSED)
+{
+ efl_destructor(efl_super(obj, MY_CLASS));
+}
+
+/* Efl.Part */
+ELM_PART_CONTENT_DEFAULT_GET(efl_ui_list_empty_item, "efl.content")
+ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_list_empty_item, void)
+/* Efl.Part end */
+
+EOLIAN static Efl_Object *
+_efl_ui_list_empty_item_efl_part_part_get(const Eo *obj, void *wd EINA_UNUSED, const char *part)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
+ if (eina_streq(part, "content"))
+ return ELM_PART_IMPLEMENT(EFL_UI_LAYOUT_PART_CONTENT_CLASS, obj, "efl.content");
+
+ return efl_part_get(efl_super(obj, MY_CLASS), part);
+}
+
+/* Internal EO APIs and hidden overrides */
+
+#define EFL_UI_LIST_EMPTY_ITEM_EXTRA_OPS \
+ ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_list_empty_item)
+
+#include "efl_ui_list_empty_item.eo.c"
diff --git a/src/lib/elementary/efl_ui_list_empty_item.eo b/src/lib/elementary/efl_ui_list_empty_item.eo
new file mode 100644
index 0000000000..ad91107cbb
--- /dev/null
+++ b/src/lib/elementary/efl_ui_list_empty_item.eo
@@ -0,0 +1,16 @@
+
+class Efl.Ui.List_Empty_Item (Efl.Ui.List_Item, Efl.Content)
+{
+ [[List Empty Item class. This item have only one swallow space,
+ thus user can decorate item by filling the swallow with
+ any kind of container.]]
+ data: null;
+ implements {
+ //Efl.Object
+ Efl.Object.finalize;
+ Efl.Object.destructor;
+ Efl.Content.content { get; set; }
+ Efl.Content.content_unset;
+ Efl.Part.part_get;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_list_item.c b/src/lib/elementary/efl_ui_list_item.c
new file mode 100644
index 0000000000..1fe67e9c0c
--- /dev/null
+++ b/src/lib/elementary/efl_ui_list_item.c
@@ -0,0 +1,83 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#define EFL_ACCESS_PROTECTED
+#define EFL_UI_WIDGET_PART_BG_PROTECTED
+
+#include <Elementary.h>
+
+#include "elm_priv.h"
+#include "efl_ui_list_item_private.h"
+
+#define MY_CLASS EFL_UI_LIST_ITEM_CLASS
+#define MY_CLASS_PFX efl_ui_list_item
+
+#define MY_CLASS_NAME "Efl.Ui.List_Item"
+
+static void
+_sizing_eval(Evas_Object *obj, Efl_Ui_List_Item_Data *pd)
+{
+ Evas_Coord minh = -1, minw = -1;
+ Evas_Coord rest_w = 0, rest_h = 0;
+ ELM_WIDGET_DATA_GET_OR_RETURN(pd->obj, wd);
+
+ edje_object_size_min_restricted_calc(wd->resize_obj, &minw, &minh,
+ rest_w, rest_h);
+ evas_object_size_hint_min_set(obj, minw, minh);
+
+ pd->needs_size_calc = EINA_FALSE;
+}
+
+static void
+_efl_ui_list_item_elm_layout_sizing_eval(Eo *obj, Efl_Ui_List_Item_Data *pd)
+{
+ if (pd->needs_size_calc) return;
+ pd->needs_size_calc = EINA_TRUE;
+
+ efl_canvas_group_change(obj);
+}
+
+EOLIAN static void
+_efl_ui_list_item_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_List_Item_Data *pd)
+{
+ if (pd->needs_size_calc)
+ {
+ _sizing_eval(obj, pd);
+ pd->needs_size_calc = EINA_FALSE;
+ }
+}
+
+EOLIAN static Eo *
+_efl_ui_list_item_efl_object_constructor(Eo *obj, Efl_Ui_List_Item_Data *pd)
+{
+ pd->obj = obj;
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+
+ return obj;
+}
+
+EOLIAN static Efl_Object *
+_efl_ui_list_item_efl_object_finalize(Eo *obj, Efl_Ui_List_Item_Data *pd EINA_UNUSED)
+{
+ Eo *eo;
+ eo = efl_finalize(efl_super(obj, MY_CLASS));
+ ELM_WIDGET_DATA_GET_OR_RETURN(eo, wd, eo);
+
+ return eo;
+}
+
+EOLIAN static void
+_efl_ui_list_item_efl_object_destructor(Eo *obj, Efl_Ui_List_Item_Data *pd EINA_UNUSED)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+
+ efl_destructor(efl_super(obj, MY_CLASS));
+}
+
+/* Internal EO APIs and hidden overrides */
+
+#define EFL_UI_LIST_ITEM_EXTRA_OPS \
+ ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_list_item)
+
+#include "efl_ui_list_item.eo.c"
diff --git a/src/lib/elementary/efl_ui_list_item.eo b/src/lib/elementary/efl_ui_list_item.eo
new file mode 100644
index 0000000000..82943ad3c6
--- /dev/null
+++ b/src/lib/elementary/efl_ui_list_item.eo
@@ -0,0 +1,12 @@
+
+abstract Efl.Ui.List_Item (Efl.Ui.Item)
+{
+ implements {
+ //Efl.Object
+ Efl.Object.constructor;
+ Efl.Object.finalize;
+ Efl.Object.destructor;
+ //Efl.Canvas
+ Efl.Canvas.Group.group_calculate;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_list_item_private.h b/src/lib/elementary/efl_ui_list_item_private.h
new file mode 100644
index 0000000000..e68b3fa14a
--- /dev/null
+++ b/src/lib/elementary/efl_ui_list_item_private.h
@@ -0,0 +1,31 @@
+#ifndef EFL_UI_LIST_ITEM_PRIVATE_H
+#define EFL_UI_LIST_ITEM_PRIVATE_H
+
+#include "Elementary.h"
+
+typedef struct _Efl_Ui_List_Item_Data
+{
+ // Eo Objects
+ Eo *obj; /* Self-Object */
+ Eo *parent; /* Parent Widget */
+ Eina_Bool needs_size_calc : 1; /* Flag for Size calculation */
+} Efl_Ui_List_Item_Data;
+
+
+#define EFL_UI_LIST_ITEM_DATA_GET(o, pd) \
+ Efl_Ui_List_Item_Data * pd = efl_data_scope_safe_get(o, EFL_UI_LIST_ITEM_CLASS)
+
+#define EFL_UI_LIST_ITEM_DATA_GET_OR_RETURN(o, ptr, ...) \
+ EFL_UI_LIST_ITEM_DATA_GET(o, ptr); \
+ if (EINA_UNLIKELY(!ptr)) \
+ { \
+ ERR("No widget data for object %p (%s)", \
+ o, evas_object_type_get(o)); \
+ return __VA_ARGS__; \
+ }
+
+#define EFL_UI_LIST_ITEM_CHECK_OR_RETURN(obj, ...) \
+ if (EINA_UNLIKELY(!efl_isa((obj), EFL_UI_LIST_ITEM_CLASS))) \
+ return __VA_ARGS__;
+
+#endif
diff --git a/src/lib/elementary/efl_ui_list_precise_layouter.eo b/src/lib/elementary/efl_ui_list_precise_layouter.eo
deleted file mode 100644
index d6d276e4a4..0000000000
--- a/src/lib/elementary/efl_ui_list_precise_layouter.eo
+++ /dev/null
@@ -1,8 +0,0 @@
-class Efl.Ui.List.Precise_Layouter (Efl.Object, Efl.Ui.List.Relayout)
-{
- implements {
- Efl.Object.constructor;
- Efl.Ui.List.Relayout.layout_do;
- Efl.Ui.List.Relayout.model { set; }
- }
-}
diff --git a/src/lib/elementary/efl_ui_list_private.h b/src/lib/elementary/efl_ui_list_private.h
index 5cd1fb3caf..409956dce1 100644
--- a/src/lib/elementary/efl_ui_list_private.h
+++ b/src/lib/elementary/efl_ui_list_private.h
@@ -1,134 +1,63 @@
#ifndef EFL_UI_LIST_PRIVATE_H
#define EFL_UI_LIST_PRIVATE_H
-#ifdef HAVE_CONFIG_H
-# include "elementary_config.h"
-#endif
-
-#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
-#define ELM_INTERFACE_ATSPI_SELECTION_PROTECTED
-#define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED
-
-#include <Elementary.h>
-#include "elm_priv.h"
-
-typedef struct _Efl_Ui_List_Item Efl_Ui_List_Item;
-typedef struct _Efl_Ui_List_Data Efl_Ui_List_Data;
-
-struct _Efl_Ui_List_Item
-{
- Efl_Ui_List_LayoutItem item;
- Efl_Future *future;
- Efl_Ui_List *list;
- // Evas_Coord x, y, minw, minh, w, h;
- // // double h, v, wx, wy;
- // double wx, wy;
-};
-
-int efl_ui_list_item_index_get(Efl_Ui_List_Item const* item);
-
-typedef struct _Efl_Ui_List_Data Efl_Ui_List_Data;
+#include "Elementary.h"
-#include "efl_ui_list_segarray.h"
-
-struct _Efl_Ui_List_Data
+typedef struct _Efl_Ui_List_Data
{
- Eo *obj;
- Eo *scrl_mgr;
- Efl_Ui_List_Pan *pan_obj;
- Efl_Model *model;
-
- Efl_Orient orient;
-
- struct {
- double h, v;
- Eina_Bool scalable: 1;
- } pad;
+ // Eo Objects
+ Eo *box; /* Internal box for Efl.Pack support */
+ Eo *pan; /* Internal pan for scroll */
+ Eo *smanager; /* Scroll Manager for support scroll with pan */
struct {
- double h, v;
- } align;
-
- struct {
- double x, y;
- } weight;
-
- // struct {
- // Evas_Coord w, h;
- // int start;
- // int slice;
- // } realized;
-
- int segarray_first;
- Efl_Ui_List_SegArray segarray;
-
- Efl_Ui_Layout_Factory *factory;
- Eina_List *selected_items;
- // struct {
- // Eina_Inarray array;
- // } items;
- Eina_Stringshare *style;
- Elm_Object_Select_Mode select_mode;
- Elm_List_Mode mode;
-
- Efl_Ui_Focus_Manager *manager;
- Eina_Rect gmt;
- Eina_Size2D min;
- int /*average_item_size, avsom, */item_count;
- Efl_Future *slice_future;
- Efl_Future *count_future;
- Efl_Ui_List_Relayout *relayout;
- struct {
- int slice_start;
- int slice_count;
- } outstanding_slice;
-
- Eina_Bool homogeneous : 1;
- Eina_Bool recalc : 1;
- Eina_Bool on_hold : 1;
- Eina_Bool scrl_freeze : 1;
-};
-
-typedef struct _Efl_Ui_List_Pan_Data Efl_Ui_List_Pan_Data;
-
-struct _Efl_Ui_List_Pan_Data
+ Efl_Ui_List_Item *item; /* Scroll target item */
+ double align; /* Item scroll aligned position.
+ -1 is for default case of scroll in */
+ Eina_Bool anim : 1; /* boolean data for animation on scroll */
+ } scroll; /* Item scroll values for deferred operation */
+
+ Eina_List *items; /* All item list for internal maintaining */
+ Eina_List *selected; /* Selected items list */
+ Efl_Ui_List_Item *last_selected; /* latest selected item */
+
+ Efl_Ui_Select_Mode select_mode; /* Select mode for items
+ with single or multiple seleciton */
+
+ // Boolean Data
+ Eina_Bool freeze_want : 1; /* Flag for Scroll freezing */
+ Eina_Bool match_content_w: 1; /* Flag for size matching on content width.
+ it will disable horizontal scroll */
+ Eina_Bool match_content_h: 1; /* Flag for size matching on content height.
+ it will disable vertical scroll */
+ Eina_Bool pan_resized : 1; /* Flag for pan resized.
+ This value is used for checking scroll is
+ calculated after initialized */
+} Efl_Ui_List_Data;
+
+typedef struct _Item_Iterator
{
- Eo *wobj;
- Eina_Rect gmt;
- Evas_Coord move_diff;
-
- Ecore_Job *resize_job;
-};
-
-typedef struct _Efl_Ui_List_Slice Efl_Ui_List_Slice;
-
-struct _Efl_Ui_List_Slice
-{
- Efl_Ui_List_Data *pd;
- int newstart, slicestart, newslice;
-};
-
-
-
-#define EFL_UI_LIST_DATA_GET(o, ptr) \
- Efl_Ui_List_Data * ptr = efl_data_scope_get(o, EFL_UI_LIST_CLASS)
-
-#define EFL_UI_LIST_DATA_GET_OR_RETURN(o, ptr) \
- EFL_UI_LIST_DATA_GET(o, ptr); \
- if (EINA_UNLIKELY(!ptr)) \
- { \
- CRI("No widget data for object %p (%s)", \
- o, evas_object_type_get(o)); \
- return; \
+ Eina_Iterator iterator;
+ Eina_List *list;
+ Eina_Iterator *real_iterator;
+ Eo *object;
+} Item_Iterator;
+
+
+#define EFL_UI_LIST_DATA_GET(o, pd) \
+ Efl_Ui_List_Data * pd = efl_data_scope_safe_get(o, EFL_UI_LIST_CLASS)
+
+#define EFL_UI_LIST_DATA_GET_OR_RETURN(o, ptr, ...) \
+ EFL_UI_LIST_DATA_GET(o, ptr); \
+ if (EINA_UNLIKELY(!ptr)) \
+ { \
+ ERR("No widget data for object %p (%s)", \
+ o, evas_object_type_get(o)); \
+ return __VA_ARGS__; \
}
-#define EFL_UI_LIST_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
- EFL_UI_LIST_DATA_GET(o, ptr); \
- if (EINA_UNLIKELY(!ptr)) \
- { \
- CRI("No widget data for object %p (%s)", \
- o, evas_object_type_get(o)); \
- return val; \
- }
+#define EFL_UI_LIST_CHECK(obj) \
+ if (EINA_UNLIKELY(!efl_isa((obj), EFL_UI_LIST_CLASS))) \
+ return
#endif
diff --git a/src/lib/elementary/efl_ui_list_relayout.eo b/src/lib/elementary/efl_ui_list_relayout.eo
deleted file mode 100644
index 94daa479d5..0000000000
--- a/src/lib/elementary/efl_ui_list_relayout.eo
+++ /dev/null
@@ -1,23 +0,0 @@
-import efl_ui_list_types;
-
-struct @extern Efl_Ui_List_SegArray;
-
-interface Efl.Ui.List.Relayout (Efl.Interface)
-{
- methods {
- layout_do {
- params {
- modeler: Efl.Ui.List.Model;
- first: int;
- children: ptr(Efl_Ui_List_SegArray);
- }
- }
- @property model {
- [[Model that is/will be ]]
- set {}
- values {
- model: Efl.Model; [[Efl model]]
- }
- }
- }
-}
diff --git a/src/lib/elementary/efl_ui_list_segarray.c b/src/lib/elementary/efl_ui_list_segarray.c
deleted file mode 100644
index 08740b6c4d..0000000000
--- a/src/lib/elementary/efl_ui_list_segarray.c
+++ /dev/null
@@ -1,426 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include "elementary_config.h"
-#endif
-
-#include "efl_ui_list_private.h"
-#include "efl_ui_list_segarray.h"
-
-#include <Efl.h>
-
-#include <assert.h>
-
-static int _search_lookup_cb(Eina_Rbtree const* rbtree, const void* key, int length EINA_UNUSED, void* data EINA_UNUSED)
-{
- Efl_Ui_List_SegArray_Node const* node = (void const*)rbtree;
- int index = *(int*)key;
- if(index < node->first)
- {
- return 1;
- }
- else if(index < node->first + node->length)
- {
- return 0;
- }
- else
- {
- return -1;
- }
-}
-
-static int _insert_lookup_cb(Eina_Rbtree const* rbtree, const void* key, int length EINA_UNUSED, void* data EINA_UNUSED)
-{
- Efl_Ui_List_SegArray_Node const* node = (void const*)rbtree;
- int index = *(int*)key;
- if(index < node->first)
- {
- return 1;
- }
- else if(index < node->first + node->max)
- {
- return 0;
- }
- else
- {
- return -1;
- }
-}
-
-static Eina_Rbtree_Direction _rbtree_compare(Efl_Ui_List_SegArray_Node const* left,
- Efl_Ui_List_SegArray_Node const* right, void* data EINA_UNUSED)
-{
- if(left->first < right->first)
- return EINA_RBTREE_LEFT;
- else
- return EINA_RBTREE_RIGHT;
-}
-
-
-static void
-_free_node(Efl_Ui_List_SegArray_Node* node, void* data EINA_UNUSED)
-{
- int i = 0;
-
- while (i < node->length)
- {
- free(node->pointers[i]);
- ++i;
- }
-
- free(node);
-}
-
-static Efl_Ui_List_SegArray_Node*
-_alloc_node(Efl_Ui_List_SegArray* segarray, int first, int max)
-{
- Efl_Ui_List_SegArray_Node* node;
- node = calloc(1, sizeof(Efl_Ui_List_SegArray_Node) + max*sizeof(Efl_Ui_List_Item*));
- node->first = first;
- node->max = max;
- segarray->root = (void*)eina_rbtree_inline_insert(EINA_RBTREE_GET(segarray->root), EINA_RBTREE_GET(node),
- EINA_RBTREE_CMP_NODE_CB(&_rbtree_compare), NULL);
- segarray->node_count++;
- return node;
-}
-
-void efl_ui_list_segarray_setup(Efl_Ui_List_SegArray* segarray, //int member_size,
- int initial_step_size)
-{
- segarray->root = NULL;
- segarray->array_initial_size = initial_step_size;
-}
-
-void efl_ui_list_segarray_flush(Efl_Ui_List_SegArray* segarray)
-{
- eina_rbtree_delete(EINA_RBTREE_GET(segarray->root), EINA_RBTREE_FREE_CB(_free_node), NULL);
- segarray->root = NULL;
-}
-
-static Efl_Ui_List_Item* _create_item_partial(Efl_Model* model)
-{
- Efl_Ui_List_Item* item = calloc(1, sizeof(Efl_Ui_List_Item));
- item->item.children = model;
- return item;
-}
-
-static Efl_Ui_List_Item* _create_item(Efl_Model* model, Efl_Ui_List_SegArray_Node* node, unsigned int index)
-{
- Efl_Ui_List_Item* item = _create_item_partial(model);
- item->item.index_offset = index - node->first;
- item->item.tree_node = node;
- return item;
-}
-
-Efl_Ui_List_Item*
-efl_ui_list_segarray_remove(Efl_Ui_List_SegArray* segarray, int index)
-{
- Efl_Ui_List_SegArray_Node *node;
- Efl_Ui_List_Item *item, *rt;
- Eina_Iterator* iterator;
- int offset;
-
- node = (void*)eina_rbtree_inline_lookup(EINA_RBTREE_GET(segarray->root),
- &index, sizeof(index), &_insert_lookup_cb, NULL);
- if (!node) return NULL;
-
- offset = index - node->first;
- if (offset >= node->length) return NULL;
-
- rt = node->pointers[offset];
- segarray->count--;
- node->length--;
-
- if (offset >= node->length) return NULL;
-
- while (offset < node->length)
- {
- node->pointers[offset] = node->pointers[offset+1];
- item = node->pointers[offset];
- --item->item.index_offset;
- ++offset;
- }
-
- node = (void*)EINA_RBTREE_GET(node)->son[EINA_RBTREE_LEFT];
- iterator = eina_rbtree_iterator_infix((void*)node);
- while(eina_iterator_next(iterator, (void**)&node))
- node->first--;
-
- return rt;
-}
-
-static void
-_efl_ui_list_segarray_insert_at_node(Efl_Ui_List_SegArray* segarray, int index, Efl_Ui_List_Item* item, Efl_Ui_List_SegArray_Node* node)
-{
- Eina_Iterator* iterator;
- int pos;
-
- if(node && node->length != node->max && (index - node->first) <= node->length)
- {
- pos = index - node->first;
- item->item.tree_node = node;
- item->item.index_offset = pos;
- if(pos < node->length)
- {
- assert(node->length != node->max);
-
- memmove(&node->pointers[pos], &node->pointers[pos+1], sizeof(node->pointers[pos])*(node->length - pos));
- node->pointers[pos] = item;
- node->length++;
- }
- else
- {
- assert(pos == node->length);
-
- assert(node->length != node->max);
- node->pointers[pos] = item;
- node->length++;
- }
- }
- else
- {
- node = _alloc_node(segarray, index, segarray->array_initial_size);
- node->pointers[0] = item;
- node->length++;
- item->item.index_offset = 0;
- item->item.tree_node = node;
- }
-
- node = (void*)EINA_RBTREE_GET(node)->son[EINA_RBTREE_LEFT];
- iterator = eina_rbtree_iterator_infix((void*)node);
- while(eina_iterator_next(iterator, (void**)&node))
- {
- node->first++;
- }
-
- eina_iterator_free(iterator);
-}
-
-
-void efl_ui_list_segarray_insert(Efl_Ui_List_SegArray* segarray, int index, Efl_Model* model)
-{
- Efl_Ui_List_SegArray_Node* node, *next;
- Efl_Ui_List_Item* item;
-
- item = _create_item_partial(model);
-
- node = (void*)eina_rbtree_inline_lookup(EINA_RBTREE_GET(segarray->root),
- &index, sizeof(index), &_insert_lookup_cb, NULL);
- if(node)
- {
- next = (void*)EINA_RBTREE_GET(node)->son[EINA_RBTREE_LEFT];
- if(next && next->first <= index)
- _efl_ui_list_segarray_insert_at_node(segarray, index, item, next);
- else
- _efl_ui_list_segarray_insert_at_node(segarray, index, item, node);
- }
- else
- _efl_ui_list_segarray_insert_at_node(segarray, index, item, NULL);
-}
-
-void efl_ui_list_segarray_insert_accessor(Efl_Ui_List_SegArray* segarray, int first, Eina_Accessor* accessor)
-{
- int i;
- Efl_Model* children;
-
- EINA_ACCESSOR_FOREACH(accessor, i, children)
- {
- Efl_Ui_List_SegArray_Node *node;
- int idx = first + i;
-
- node = (void*)eina_rbtree_inline_lookup(EINA_RBTREE_GET(segarray->root),
- &idx, sizeof(idx), &_insert_lookup_cb, NULL);
- if (!node)
- {
- node = _alloc_node(segarray, idx, segarray->array_initial_size);
- }
-
- assert(node->length < node->max);
- node->pointers[node->length] = _create_item(children, node, idx);
- node->length++;
- segarray->count++;
- }
-}
-
-int efl_ui_list_segarray_count(Efl_Ui_List_SegArray const* segarray)
-{
- return segarray->count;
-}
-
-typedef struct _Efl_Ui_List_Segarray_Eina_Accessor
-{
- Eina_Accessor vtable;
- Efl_Ui_List_SegArray* segarray;
-} Efl_Ui_List_Segarray_Eina_Accessor;
-
-static Eina_Bool
-_efl_ui_list_segarray_accessor_get_at(Efl_Ui_List_Segarray_Eina_Accessor* acc,
- int idx, void** data)
-{
- Efl_Ui_List_SegArray_Node* node;
- node = (void*)eina_rbtree_inline_lookup(EINA_RBTREE_GET(acc->segarray->root),
- &idx, sizeof(idx), &_search_lookup_cb, NULL);
- if(node)
- {
- if(node->first <= idx && node->first + node->length > idx)
- {
- int i = idx - node->first;
- Efl_Ui_List_Item* item = node->pointers[i];
- *data = item;
- return EINA_TRUE;
- }
- }
- return EINA_FALSE;
-}
-
-static void*
-_efl_ui_list_segarray_accessor_get_container(Efl_Ui_List_Segarray_Eina_Accessor* acc EINA_UNUSED)
-{
- return NULL;
-}
-
-static void
-_efl_ui_list_segarray_accessor_free(Efl_Ui_List_Segarray_Eina_Accessor* acc EINA_UNUSED)
-{
- free(acc);
-}
-
-static void
-_efl_ui_list_segarray_accessor_lock(Efl_Ui_List_Segarray_Eina_Accessor* acc EINA_UNUSED)
-{
-}
-
-static void
-_efl_ui_list_segarray_accessor_unlock(Efl_Ui_List_Segarray_Eina_Accessor* acc EINA_UNUSED)
-{
-}
-
-static Eina_Accessor*
-_efl_ui_list_segarray_accessor_clone(Efl_Ui_List_Segarray_Eina_Accessor* acc EINA_UNUSED)
-{
- return &acc->vtable;
-}
-
-static void
-_efl_ui_list_segarray_accessor_setup(Efl_Ui_List_Segarray_Eina_Accessor* acc, Efl_Ui_List_SegArray* segarray)
-{
- EINA_MAGIC_SET(&acc->vtable, EINA_MAGIC_ACCESSOR);
- acc->vtable.version = EINA_ACCESSOR_VERSION;
- acc->vtable.get_at = FUNC_ACCESSOR_GET_AT(_efl_ui_list_segarray_accessor_get_at);
- acc->vtable.get_container = FUNC_ACCESSOR_GET_CONTAINER(_efl_ui_list_segarray_accessor_get_container);
- acc->vtable.free = FUNC_ACCESSOR_FREE(_efl_ui_list_segarray_accessor_free);
- acc->vtable.lock = FUNC_ACCESSOR_LOCK(_efl_ui_list_segarray_accessor_lock);
- acc->vtable.unlock = FUNC_ACCESSOR_LOCK(_efl_ui_list_segarray_accessor_unlock);
- acc->vtable.clone = FUNC_ACCESSOR_CLONE(_efl_ui_list_segarray_accessor_clone);
- acc->segarray = segarray;
-}
-
-Eina_Accessor* efl_ui_list_segarray_accessor_get(Efl_Ui_List_SegArray* segarray)
-{
- Efl_Ui_List_Segarray_Eina_Accessor* acc = calloc(1, sizeof(Efl_Ui_List_Segarray_Eina_Accessor));
- _efl_ui_list_segarray_accessor_setup(acc, segarray);
- return &acc->vtable;
-}
-
-typedef struct _Efl_Ui_List_Segarray_Node_Accessor
-{
- Eina_Accessor vtable;
- Efl_Ui_List_SegArray* segarray;
- Eina_Iterator* pre_iterator;
- Efl_Ui_List_SegArray_Node* current_node;
- int current_index;
-} Efl_Ui_List_Segarray_Node_Accessor;
-
-static Eina_Bool
-_efl_ui_list_segarray_node_accessor_get_at(Efl_Ui_List_Segarray_Node_Accessor* acc,
- int idx, void** data)
-{
- if(idx == acc->current_index && acc->current_node)
- {
- (*data) = acc->current_node;
- }
- else
- {
- if(acc->current_index >= idx || !acc->current_node)
- {
- eina_iterator_free(acc->pre_iterator);
- acc->pre_iterator = NULL;
- acc->current_node = NULL;
- acc->current_index = -1;
- }
-
- if(!acc->pre_iterator)
- acc->pre_iterator = eina_rbtree_iterator_infix((void*)acc->segarray->root);
-
- for(;acc->current_index != idx;++acc->current_index)
- {
- if(!eina_iterator_next(acc->pre_iterator, (void**)&acc->current_node))
- {
- --acc->current_index;
- return EINA_FALSE;
- }
- }
- (*data) = acc->current_node;
- return EINA_TRUE;
- }
- return EINA_FALSE;
-}
-
-static void*
-_efl_ui_list_segarray_node_accessor_get_container(Efl_Ui_List_Segarray_Node_Accessor* acc EINA_UNUSED)
-{
- return NULL;
-}
-
-static void
-_efl_ui_list_segarray_node_accessor_free(Efl_Ui_List_Segarray_Node_Accessor* acc EINA_UNUSED)
-{
- if (acc->pre_iterator)
- eina_iterator_free(acc->pre_iterator);
- free(acc);
-}
-
-static void
-_efl_ui_list_segarray_node_accessor_lock(Efl_Ui_List_Segarray_Node_Accessor* acc EINA_UNUSED)
-{
-}
-
-static void
-_efl_ui_list_segarray_node_accessor_unlock(Efl_Ui_List_Segarray_Node_Accessor* acc EINA_UNUSED)
-{
-}
-
-static Eina_Accessor*
-_efl_ui_list_segarray_node_accessor_clone(Efl_Ui_List_Segarray_Node_Accessor* acc EINA_UNUSED)
-{
- return &acc->vtable;
-}
-
-static void
-_efl_ui_list_segarray_node_accessor_setup(Efl_Ui_List_Segarray_Node_Accessor* acc, Efl_Ui_List_SegArray* segarray)
-{
- EINA_MAGIC_SET(&acc->vtable, EINA_MAGIC_ACCESSOR);
- acc->vtable.version = EINA_ACCESSOR_VERSION;
- acc->vtable.get_at = FUNC_ACCESSOR_GET_AT(_efl_ui_list_segarray_node_accessor_get_at);
- acc->vtable.get_container = FUNC_ACCESSOR_GET_CONTAINER(_efl_ui_list_segarray_node_accessor_get_container);
- acc->vtable.free = FUNC_ACCESSOR_FREE(_efl_ui_list_segarray_node_accessor_free);
- acc->vtable.lock = FUNC_ACCESSOR_LOCK(_efl_ui_list_segarray_node_accessor_lock);
- acc->vtable.unlock = FUNC_ACCESSOR_LOCK(_efl_ui_list_segarray_node_accessor_unlock);
- acc->vtable.clone = FUNC_ACCESSOR_CLONE(_efl_ui_list_segarray_node_accessor_clone);
- acc->segarray = segarray;
- acc->pre_iterator = NULL;
- acc->current_index = -1;
- acc->current_node = NULL;
-}
-
-Eina_Accessor* efl_ui_list_segarray_node_accessor_get(Efl_Ui_List_SegArray* segarray)
-{
- Efl_Ui_List_Segarray_Node_Accessor* acc = calloc(1, sizeof(Efl_Ui_List_Segarray_Node_Accessor));
- _efl_ui_list_segarray_node_accessor_setup(acc, segarray);
- return &acc->vtable;
-}
-
-int efl_ui_list_item_index_get(Efl_Ui_List_Item const* item)
-{
- Efl_Ui_List_SegArray_Node* node = item->item.tree_node;
- return item->item.index_offset + node->first;
-}
-
diff --git a/src/lib/elementary/efl_ui_list_segarray.h b/src/lib/elementary/efl_ui_list_segarray.h
deleted file mode 100644
index eb8529a0c2..0000000000
--- a/src/lib/elementary/efl_ui_list_segarray.h
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef EFL_UI_LIST_SEGARRAY_H
-#define EFL_UI_LIST_SEGARRAY_H
-
-#include "efl_ui_list_segarray.h"
-
-typedef struct _Efl_Ui_List_Item Efl_Ui_List_Item;
-
-typedef struct _Efl_Ui_List_SegArray_Node
-{
- EINA_RBTREE;
-
- int length;
- int max;
- int first;
-
- void* layout_data;
-
- Efl_Ui_List_Item* pointers[0];
-} Efl_Ui_List_SegArray_Node;
-
-typedef struct _Efl_Ui_List_SegArray
-{
- Efl_Ui_List_SegArray_Node *root; // of Efl_Ui_List_SegArray_Nodea
-
- int array_initial_size;
- int node_count;
- int count;
-} Efl_Ui_List_SegArray;
-
-Eina_Accessor* efl_ui_list_segarray_accessor_get(Efl_Ui_List_SegArray* segarray);
-Eina_Accessor* efl_ui_list_segarray_node_accessor_get(Efl_Ui_List_SegArray* segarray);
-Efl_Ui_List_SegArray_Node* efl_ui_list_segarray_item_node_get(Efl_Ui_List_SegArray* segarray,
- Efl_Ui_List_Item* item);
-void efl_ui_list_segarray_insert_accessor(Efl_Ui_List_SegArray* segarray, int first, Eina_Accessor* accessor);
-int efl_ui_list_segarray_count(Efl_Ui_List_SegArray const* segarray);
-void efl_ui_list_segarray_setup(Efl_Ui_List_SegArray* segarray, int initial_step_size);
-void efl_ui_list_segarray_flush(Efl_Ui_List_SegArray* segarray);
-
-void efl_ui_list_segarray_insert(Efl_Ui_List_SegArray* segarray, int index, Efl_Model* model);
-Efl_Ui_List_Item *efl_ui_list_segarray_remove(Efl_Ui_List_SegArray* segarray, int index);
-
-#endif
diff --git a/src/lib/elementary/efl_ui_model_state.eo b/src/lib/elementary/efl_ui_model_state.eo
new file mode 100644
index 0000000000..3192df1b61
--- /dev/null
+++ b/src/lib/elementary/efl_ui_model_state.eo
@@ -0,0 +1,18 @@
+class Efl.Ui.Model_State (Efl.Model_Composite_Boolean)
+{
+ [[Efl model handling visibility, enable and selected state]]
+ implements {
+ Efl.Object.constructor;
+ Efl.Model.property { set; }
+ }
+ events {
+ /* FIXME: Nobody is emitting these
+ enable;
+ disable;
+ show;
+ hide;
+ selected;
+ unselected;
+ */
+ }
+}
diff --git a/src/lib/elementary/efl_ui_multibuttonentry.h b/src/lib/elementary/efl_ui_multibuttonentry.h
deleted file mode 100644
index 3d9a75912d..0000000000
--- a/src/lib/elementary/efl_ui_multibuttonentry.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * @defgroup efl_ui_multibuttonentry
- * @ingroup Elementary
- *
- * @image html multibuttonentry_inheritance_tree.png
- * @image latex multibuttonentry_inheritance_tree.eps
- *
- * A multi-button entry is a widget letting an user enter text and
- * each chunk of text managed as a set of buttons. Each text button is
- * inserted by pressing the "return" key. If there is no space in the
- * current row, a new button is added to the next row. When a text
- * button is pressed, it will become focused. Backspace removes the
- * focus. When the multi-button entry loses focus, items longer than
- * one line are shrunk to one line.
- *
- * The typical use case of multi-button entry is composing
- * emails/messages to a group of addresses, each of which is an item
- * that can be clicked for further actions.
- *
- * This widget inherits from the @ref Layout one, so that all the
- * functions acting on it also work for multi-button entry objects (since 1.8).
- *
- * This widget emits the following signals, besides the ones sent from
- * @ref Layout:
- * - @c "item,selected" - this is called when an item is selected by
- * api, user interaction, and etc. this is also called when a
- * user press back space while cursor is on the first field of
- * entry.
- * - @c "item,added" - when a new multi-button entry item is added.
- * - @c "item,deleted" - when a multi-button entry item is deleted.
- * - @c "item,clicked" - this is called when an item is clicked by user
- * interaction. Both "item,selected" and "item,clicked" are needed.
- * - @c "item,longpressed" - when multi-button entry item is pressed for a long time.
- * - @c "clicked" - when multi-button entry is clicked.
- * - @c "focused" - when multi-button entry is focused.
- * - @c "unfocused" - when multi-button entry is unfocused.
- * - @c "expanded" - when multi-button entry is expanded.
- * - @c "contracted" - when multi-button entry is contracted.
- * - @c "expand,state,changed" - when shrink mode state of
- * multi-button entry is changed.
- *
- * Default text parts of the multi-button entry widget that you can use are:
- * @li "default" - A label of the multi-button entry
- *
- * Default text parts of multi-button entry @b items that you can use are:
- * @li "default" - A label of the multi-button entry item
- *
- * Supported elm_object_item common APIs.
- * @li @ref elm_object_item_del
- * @li @ref elm_object_item_part_text_set
- * @li @ref elm_object_item_part_text_get
- */
-
-
-/**
- * @addtogroup Multibuttonentry
- * @{
- */
-
-#ifdef EFL_EO_API_SUPPORT
-#include "efl_ui_multibuttonentry_eo.h"
-#endif
-#ifndef EFL_NOLEGACY_API_SUPPORT
-#include "elc_multibuttonentry_legacy.h"
-#endif
-/**
- * @}
- */
diff --git a/src/lib/elementary/efl_ui_navigation_bar.c b/src/lib/elementary/efl_ui_navigation_bar.c
new file mode 100644
index 0000000000..035d922494
--- /dev/null
+++ b/src/lib/elementary/efl_ui_navigation_bar.c
@@ -0,0 +1,226 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#define EFL_PART_PROTECTED
+
+#include <Elementary.h>
+
+#include "elm_priv.h"
+#include "efl_ui_navigation_bar_private.h"
+#include "efl_ui_navigation_bar_part.eo.h"
+#include "elm_part_helper.h"
+
+#define MY_CLASS EFL_UI_NAVIGATION_BAR_CLASS
+#define MY_CLASS_NAME "Efl.Ui.Navigation_Bar"
+
+static void
+_back_button_clicked_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Eo *navigation_bar = data;
+
+ Eo *stack = efl_provider_find(navigation_bar, EFL_UI_STACK_CLASS);
+ if (!stack)
+ {
+ ERR("Cannot find EFL_UI_STACK_CLASS instance!");
+ return;
+ }
+
+ efl_ui_stack_pop(stack);
+}
+
+EOLIAN static Eo *
+_efl_ui_navigation_bar_efl_object_constructor(Eo *obj, Efl_Ui_Navigation_Bar_Data *pd)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
+
+ if (!elm_widget_theme_klass_get(obj))
+ elm_widget_theme_klass_set(obj, "navigation_bar");
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+ efl_canvas_object_type_set(obj, MY_CLASS_NAME);
+
+ elm_widget_sub_object_parent_add(obj);
+
+ elm_widget_can_focus_set(obj, EINA_TRUE);
+ if (!elm_widget_theme_object_set(obj, wd->resize_obj,
+ elm_widget_theme_klass_get(obj),
+ elm_widget_theme_element_get(obj),
+ elm_widget_theme_style_get(obj)))
+ CRI("Failed to set layout!");
+
+ Eo *back_button = efl_add(EFL_UI_BUTTON_CLASS, obj,
+ elm_widget_element_update(obj, efl_added, "back_button"),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _back_button_clicked_cb, obj),
+ efl_gfx_entity_visible_set(efl_added, EINA_FALSE));
+
+ pd->back_button = back_button;
+
+ return obj;
+}
+
+
+/* Standard widget overrides */
+ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_navigation_bar, Efl_Ui_Navigation_Bar_Data)
+ELM_PART_TEXT_DEFAULT_GET(efl_ui_navigation_bar, "efl.text")
+ELM_PART_TEXT_DEFAULT_IMPLEMENT(efl_ui_navigation_bar, Efl_Ui_Navigation_Bar_Data)
+
+#define EFL_UI_NAVIGATION_BAR_EXTRA_OPS \
+ELM_PART_TEXT_DEFAULT_OPS(efl_ui_navigation_bar)
+
+static Eina_Bool
+_efl_ui_navigation_bar_content_set(Eo *obj, Efl_Ui_Navigation_Bar_Data *_pd EINA_UNUSED, const char *part, Efl_Gfx_Entity *content)
+{
+ if (eina_streq(part, "left_content"))
+ {
+ if (content)
+ efl_layout_signal_emit(obj, "efl,state,left_content,set", "efl");
+ else
+ efl_layout_signal_emit(obj, "efl,state,left_content,unset", "efl");
+ efl_layout_signal_process(obj, EINA_FALSE);
+
+ return efl_content_set(efl_part(efl_super(obj, MY_CLASS), "efl.left_content"), content);
+ }
+ else if (eina_streq(part, "right_content"))
+ return efl_content_set(efl_part(efl_super(obj, MY_CLASS), "efl.right_content"), content);
+
+ return efl_content_set(efl_part(efl_super(obj, MY_CLASS), part), content);
+}
+
+static Efl_Gfx_Entity *
+_efl_ui_navigation_bar_content_get(const Eo *obj, Efl_Ui_Navigation_Bar_Data *_pd EINA_UNUSED, const char *part)
+{
+ if (eina_streq(part, "left_content"))
+ efl_content_get(efl_part(efl_super(obj, MY_CLASS), "efl.left_content"));
+ else if (eina_streq(part, "right_content"))
+ efl_content_get(efl_part(efl_super(obj, MY_CLASS), "efl.right_content"));
+
+ return efl_content_get(efl_part(efl_super(obj, MY_CLASS), part));
+}
+
+static Efl_Gfx_Entity *
+_efl_ui_navigation_bar_content_unset(Eo *obj, Efl_Ui_Navigation_Bar_Data *_pd EINA_UNUSED, const char *part)
+{
+ if (eina_streq(part, "left_content"))
+ {
+ efl_layout_signal_emit(obj, "efl,state,left_content,unset", "efl");
+ efl_layout_signal_process(obj, EINA_FALSE);
+ return efl_content_unset(efl_part(efl_super(obj, MY_CLASS), "efl.left_content"));
+ }
+ else if (eina_streq(part, "right_content"))
+ return efl_content_unset(efl_part(efl_super(obj, MY_CLASS), "efl.right_content"));
+
+ return efl_content_unset(efl_part(efl_super(obj, MY_CLASS), part));
+}
+
+
+/* Efl.Part begin */
+EOLIAN static Efl_Object *
+_efl_ui_navigation_bar_efl_part_part_get(const Eo *obj, Efl_Ui_Navigation_Bar_Data *priv EINA_UNUSED, const char *part)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
+
+ if (eina_streq(part, "back_button"))
+ return ELM_PART_IMPLEMENT(EFL_UI_NAVIGATION_BAR_PART_BACK_BUTTON_CLASS, obj, part);
+ else if (eina_streq(part, "left_content") || eina_streq(part, "right_content"))
+ return ELM_PART_IMPLEMENT(EFL_UI_NAVIGATION_BAR_PART_CLASS, obj, part);
+
+ return efl_part_get(efl_super(obj, MY_CLASS), part);
+}
+
+EOLIAN static void
+_efl_ui_navigation_bar_part_back_button_efl_gfx_entity_visible_set(Eo *obj, void *_pd EINA_UNUSED, Eina_Bool visible)
+{
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ EFL_UI_NAVIGATION_BAR_DATA_GET_OR_RETURN(pd->obj, ppd);
+
+ if (visible)
+ {
+ if (!efl_content_set(efl_part(efl_super(pd->obj, MY_CLASS), "efl.back_button"), ppd->back_button))
+ ERR("Part for back button(i.e. \"back_button\") does not exist!");
+ else
+ efl_layout_signal_emit(pd->obj, "efl,state,back_button,visible", "efl");
+ }
+ else
+ {
+ efl_content_unset(efl_part(efl_super(pd->obj, MY_CLASS), "efl.back_button"));
+ efl_gfx_entity_visible_set(ppd->back_button, visible);
+ efl_layout_signal_emit(pd->obj, "efl,state,back_button,hidden", "efl");
+ }
+
+ efl_layout_signal_process(pd->obj, EINA_FALSE);
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_navigation_bar_part_back_button_efl_gfx_entity_visible_get(const Eo *obj, void *_pd EINA_UNUSED)
+{
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ EFL_UI_NAVIGATION_BAR_DATA_GET_OR_RETURN(pd->obj, ppd, EINA_FALSE);
+
+ return efl_gfx_entity_visible_get(ppd->back_button);
+}
+
+EOLIAN static void
+_efl_ui_navigation_bar_part_back_button_efl_text_text_set(Eo *obj, void *_pd EINA_UNUSED, const char *label)
+{
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ EFL_UI_NAVIGATION_BAR_DATA_GET_OR_RETURN(pd->obj, ppd);
+
+ efl_text_set(ppd->back_button, label);
+}
+
+EOLIAN static const char *
+_efl_ui_navigation_bar_part_back_button_efl_text_text_get(const Eo *obj, void *_pd EINA_UNUSED)
+{
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ EFL_UI_NAVIGATION_BAR_DATA_GET_OR_RETURN(pd->obj, ppd, NULL);
+
+ return efl_text_get(ppd->back_button);
+}
+
+static Eina_Bool
+_efl_ui_navigation_bar_part_back_button_efl_content_content_set(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx_Entity *content)
+{
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ EFL_UI_NAVIGATION_BAR_DATA_GET_OR_RETURN(pd->obj, ppd, EINA_FALSE);
+
+ if (content == ppd->back_button) return EINA_FALSE;
+
+ efl_event_callback_add(content, EFL_UI_EVENT_CLICKED, _back_button_clicked_cb, pd->obj);
+ ppd->back_button = content;
+
+ return _efl_ui_navigation_bar_content_set(pd->obj, ppd, pd->part, content);
+}
+
+static Efl_Gfx_Entity*
+_efl_ui_navigation_bar_part_back_button_efl_content_content_get(const Eo *obj, void *_pd EINA_UNUSED)
+{
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ EFL_UI_NAVIGATION_BAR_DATA_GET_OR_RETURN(pd->obj, ppd, NULL);
+
+ return _efl_ui_navigation_bar_content_get(pd->obj, ppd, pd->part);
+}
+
+static Efl_Gfx_Entity*
+_efl_ui_navigation_bar_part_back_button_efl_content_content_unset(Eo *obj, void *_pd EINA_UNUSED)
+{
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ EFL_UI_NAVIGATION_BAR_DATA_GET_OR_RETURN(pd->obj, ppd, NULL);
+
+ efl_event_callback_del(ppd->back_button, EFL_UI_EVENT_CLICKED, _back_button_clicked_cb, pd->obj);
+ ppd->back_button = NULL;
+
+ return _efl_ui_navigation_bar_content_unset(pd->obj, ppd, pd->part);
+}
+
+ELM_PART_OVERRIDE_CONTENT_SET(efl_ui_navigation_bar, EFL_UI_NAVIGATION_BAR, Efl_Ui_Navigation_Bar_Data)
+ELM_PART_OVERRIDE_CONTENT_GET(efl_ui_navigation_bar, EFL_UI_NAVIGATION_BAR, Efl_Ui_Navigation_Bar_Data)
+ELM_PART_OVERRIDE_CONTENT_UNSET(efl_ui_navigation_bar, EFL_UI_NAVIGATION_BAR, Efl_Ui_Navigation_Bar_Data)
+#include "efl_ui_navigation_bar_part.eo.c"
+/* Efl.Part end */
+
+
+/* Efl.Part Back_Button begin */
+#include "efl_ui_navigation_bar_part_back_button.eo.c"
+/* Efl.Part Back_Button end */
+
+#include "efl_ui_navigation_bar.eo.c"
diff --git a/src/lib/elementary/efl_ui_navigation_bar.eo b/src/lib/elementary/efl_ui_navigation_bar.eo
new file mode 100644
index 0000000000..ec43bea68b
--- /dev/null
+++ b/src/lib/elementary/efl_ui_navigation_bar.eo
@@ -0,0 +1,30 @@
+class Efl.Ui.Navigation_Bar (Efl.Ui.Layout.Object, Efl.Content, Efl.Text, Efl.Ui.Translatable)
+{
+ [[Navigation_Bar widget.
+
+ Navigation_Bar widget provides a bar form useful for navigation.
+ Navigation_Bar has a back button which is used to navigate to the previous
+ content in the stack.
+ ]]
+ parts {
+ back_button: Efl.Ui.Navigation_Bar_Part_Back_Button;
+ [[Back button to navigate to the previous content in the stack.
+
+ The back button works only if the Navigation_Bar widget is contained
+ in the Stack widget(Efl.Ui.Stack class).
+ e.g. The Navigation_Bar widget is set in the Navigation_Layout widget
+ and the Navigation_Layout widget is pushed to the Stack widget.
+
+ The back button is hidden by default and it can be visible.
+ e.g. efl_gfx_visible_set(efl_part(navigation_bar, "back_button"), EINA_TRUE);
+ ]]
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Content.content { set; get; }
+ Efl.Content.content_unset;
+ Efl.Text.text { set; get; }
+ Efl.Ui.Translatable.translatable_text { set; get; }
+ Efl.Part.part_get;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_navigation_bar_part.eo b/src/lib/elementary/efl_ui_navigation_bar_part.eo
new file mode 100644
index 0000000000..3f14eb33a3
--- /dev/null
+++ b/src/lib/elementary/efl_ui_navigation_bar_part.eo
@@ -0,0 +1,9 @@
+class Efl.Ui.Navigation_Bar_Part (Efl.Ui.Layout.Part_Content)
+{
+ [[Efl UI Navigation_Bar internal part class]]
+ data: null;
+ implements {
+ Efl.Content.content { set; get; }
+ Efl.Content.content_unset;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_navigation_bar_part_back_button.eo b/src/lib/elementary/efl_ui_navigation_bar_part_back_button.eo
new file mode 100644
index 0000000000..e89e036953
--- /dev/null
+++ b/src/lib/elementary/efl_ui_navigation_bar_part_back_button.eo
@@ -0,0 +1,11 @@
+class Efl.Ui.Navigation_Bar_Part_Back_Button (Efl.Ui.Widget_Part, Efl.Ui.Button)
+{
+ [[Efl Ui Navigation_Bar internal part back button class]]
+ data: null;
+ implements {
+ Efl.Gfx.Entity.visible { set; get; }
+ Efl.Text.text { set; get; }
+ Efl.Content.content { set; get; }
+ Efl.Content.content_unset;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_navigation_bar_private.h b/src/lib/elementary/efl_ui_navigation_bar_private.h
new file mode 100644
index 0000000000..a4ba779baa
--- /dev/null
+++ b/src/lib/elementary/efl_ui_navigation_bar_private.h
@@ -0,0 +1,20 @@
+#ifndef EFL_UI_WIDGET_NAVIGATION_BAR_H
+#define EFL_UI_WIDGET_NAVIGATION_BAR_H
+
+typedef struct _Efl_Ui_Navigation_Bar_Data Efl_Ui_Navigation_Bar_Data;
+struct _Efl_Ui_Navigation_Bar_Data
+{
+ Eo *back_button;
+};
+
+#define EFL_UI_NAVIGATION_BAR_DATA_GET_OR_RETURN(o, ptr, ...) \
+ Efl_Ui_Navigation_Bar_Data *ptr; \
+ ptr = efl_data_scope_get(o, EFL_UI_NAVIGATION_BAR_CLASS); \
+ if (EINA_UNLIKELY(!ptr)) \
+ { \
+ CRI("no ui frame navigation data for object %p (%s)", \
+ o, evas_object_type_get(o)); \
+ return __VA_ARGS__; \
+ }
+
+#endif
diff --git a/src/lib/elementary/efl_ui_navigation_layout.c b/src/lib/elementary/efl_ui_navigation_layout.c
new file mode 100644
index 0000000000..e00dc31e40
--- /dev/null
+++ b/src/lib/elementary/efl_ui_navigation_layout.c
@@ -0,0 +1,55 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+#define EFL_PART_PROTECTED
+
+#include <Elementary.h>
+
+#include "elm_priv.h"
+#include "efl_ui_navigation_layout_private.h"
+#include "elm_part_helper.h"
+
+#define MY_CLASS EFL_UI_NAVIGATION_LAYOUT_CLASS
+#define MY_CLASS_NAME "Efl.Ui.Navigation_Layout"
+
+EOLIAN static void
+_efl_ui_navigation_layout_bar_set(Eo *obj, Efl_Ui_Navigation_Layout_Data *pd, Efl_Ui_Layout_Object *bar)
+{
+ EINA_SAFETY_ON_FALSE_RETURN(efl_isa(bar, EFL_UI_LAYOUT_OBJECT_CLASS));
+
+ efl_content_set(efl_part(obj, "efl.bar"), bar);
+ pd->bar = bar;
+}
+
+EOLIAN static Efl_Ui_Layout_Object *
+_efl_ui_navigation_layout_bar_get(const Eo *obj EINA_UNUSED, Efl_Ui_Navigation_Layout_Data *pd)
+{
+ return pd->bar;
+}
+
+EOLIAN static Eo *
+_efl_ui_navigation_layout_efl_object_constructor(Eo *obj, Efl_Ui_Navigation_Layout_Data *pd EINA_UNUSED)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
+
+ if (!elm_widget_theme_klass_get(obj))
+ elm_widget_theme_klass_set(obj, "navigation_layout");
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+ efl_canvas_object_type_set(obj, MY_CLASS_NAME);
+
+ elm_widget_sub_object_parent_add(obj);
+
+ elm_widget_can_focus_set(obj, EINA_TRUE);
+ if (!elm_widget_theme_object_set(obj, wd->resize_obj,
+ elm_widget_theme_klass_get(obj),
+ elm_widget_theme_element_get(obj),
+ elm_widget_theme_style_get(obj)))
+ CRI("Failed to set layout!");
+
+ return obj;
+}
+
+/* Standard widget overrides */
+ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_navigation_layout, Efl_Ui_Navigation_Layout_Data)
+
+#include "efl_ui_navigation_layout.eo.c"
diff --git a/src/lib/elementary/efl_ui_navigation_layout.eo b/src/lib/elementary/efl_ui_navigation_layout.eo
new file mode 100644
index 0000000000..fc26479b88
--- /dev/null
+++ b/src/lib/elementary/efl_ui_navigation_layout.eo
@@ -0,0 +1,30 @@
+class Efl.Ui.Navigation_Layout (Efl.Ui.Layout.Object, Efl.Content)
+{
+ [[Navigation_Layout widget.
+
+ Navigation_Layout widget provides a layout form useful for navigation.
+ Navigation_Layout widget is used to be pushed to or popped from Stack
+ widget(Efl.Ui.Stack class) as a content.
+ ]]
+ methods {
+ @property bar {
+ [[The bar object which is located at the top area as a title.
+ e.g. Navigation_Bar widget(Efl.Ui.Navigation_Bar) can be used as $bar.
+ ]]
+ set {
+ }
+ get {
+ }
+ values {
+ value: Efl.Ui.Layout.Object;
+ [[The bar object located at the top area of the Navigation Layout.
+ ]]
+ }
+ }
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Content.content { set; get; }
+ Efl.Content.content_unset;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_navigation_layout_private.h b/src/lib/elementary/efl_ui_navigation_layout_private.h
new file mode 100644
index 0000000000..d80596110f
--- /dev/null
+++ b/src/lib/elementary/efl_ui_navigation_layout_private.h
@@ -0,0 +1,20 @@
+#ifndef EFL_UI_WIDGET_NAVIGATION_LAYOUT_H
+#define EFL_UI_WIDGET_NAVIGATION_LAYOUT_H
+
+typedef struct _Efl_Ui_Navigation_Layout_Data Efl_Ui_Navigation_Layout_Data;
+struct _Efl_Ui_Navigation_Layout_Data
+{
+ Efl_Ui_Layout_Object *bar;
+};
+
+#define EFL_UI_NAVIGATION_LAYOUT_DATA_GET_OR_RETURN(o, ptr, ...) \
+ Efl_Ui_Navigation_Layout_Data *ptr; \
+ ptr = efl_data_scope_get(o, EFL_UI_NAVIGATION_LAYOUT_CLASS); \
+ if (EINA_UNLIKELY(!ptr)) \
+ { \
+ CRI("no ui navigation layout data for object %p (%s)", \
+ o, evas_object_type_get(o)); \
+ return __VA_ARGS__; \
+ }
+
+#endif
diff --git a/src/lib/elementary/efl_ui_nstate.c b/src/lib/elementary/efl_ui_nstate.c
index 14313763ef..3811bbb889 100644
--- a/src/lib/elementary/efl_ui_nstate.c
+++ b/src/lib/elementary/efl_ui_nstate.c
@@ -7,17 +7,12 @@
#include "elm_priv.h"
#include "efl_ui_nstate.eo.h"
#include "efl_ui_button_private.h"
+#include "efl_ui_nstate_private.h"
#define MY_CLASS EFL_UI_NSTATE_CLASS
#define MY_CLASS_NAME "Efl.Ui.Nstate"
-typedef struct
-{
- int nstate;
- int state;
-} Efl_Ui_Nstate_Data;
-
static Eina_Bool _key_action_activate(Evas_Object *obj, const char *params);
static void _state_active(Evas_Object *obj, Efl_Ui_Nstate_Data *sd);
@@ -50,7 +45,7 @@ _efl_ui_nstate_efl_object_constructor(Eo *obj, Efl_Ui_Nstate_Data *pd)
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
efl_layout_signal_callback_add
- (wd->resize_obj, "elm,action,state,changed", "*", _on_state_changed, obj);
+ (wd->resize_obj, "efl,action,state,changed", "*", _on_state_changed, obj);
//TODO: Add ATSPI call here
@@ -65,19 +60,25 @@ _next_state_set(Efl_Ui_Nstate_Data *sd)
}
static void
-_state_active(Evas_Object *obj, Efl_Ui_Nstate_Data *sd)
+_state_signal_emit(Evas_Object *obj, Efl_Ui_Nstate_Data *sd)
{
char buf[64];
- sprintf(buf, "elm,state,changed,%d", sd->state);
- elm_layout_signal_emit(obj, buf, "elm");
+ sprintf(buf, "efl,state,changed,%d", sd->state);
+ elm_layout_signal_emit(obj, buf, "efl");
edje_object_message_signal_process(elm_layout_edje_get(obj));
elm_layout_sizing_eval(obj);
+}
+
+static void
+_state_active(Evas_Object *obj, Efl_Ui_Nstate_Data *sd)
+{
+ _state_signal_emit(obj, sd);
efl_event_callback_legacy_call(obj, EFL_UI_NSTATE_EVENT_CHANGED, NULL);
}
EOLIAN static int
-_efl_ui_nstate_count_get(Eo *obj EINA_UNUSED, Efl_Ui_Nstate_Data *pd)
+_efl_ui_nstate_count_get(const Eo *obj EINA_UNUSED, Efl_Ui_Nstate_Data *pd)
{
return pd->nstate;
}
@@ -92,7 +93,7 @@ _efl_ui_nstate_count_set(Eo *obj EINA_UNUSED, Efl_Ui_Nstate_Data *pd, int nstate
}
EOLIAN static int
-_efl_ui_nstate_value_get(Eo *obj EINA_UNUSED, Efl_Ui_Nstate_Data *pd)
+_efl_ui_nstate_value_get(const Eo *obj EINA_UNUSED, Efl_Ui_Nstate_Data *pd)
{
return pd->state;
}
@@ -116,14 +117,14 @@ _efl_ui_nstate_value_set(Eo *obj, Efl_Ui_Nstate_Data *pd, int state)
}
EOLIAN static Efl_Ui_Theme_Apply
-_efl_ui_nstate_elm_widget_theme_apply(Eo *obj, Efl_Ui_Nstate_Data *pd)
+_efl_ui_nstate_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Nstate_Data *pd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
- _state_active(obj, pd);
+ _state_signal_emit(obj, pd);
return int_ret;
}
diff --git a/src/lib/elementary/efl_ui_nstate.eo b/src/lib/elementary/efl_ui_nstate.eo
index bdf5da9e9d..8c3f1de642 100644
--- a/src/lib/elementary/efl_ui_nstate.eo
+++ b/src/lib/elementary/efl_ui_nstate.eo
@@ -6,7 +6,7 @@ class Efl.Ui.Nstate(Efl.Ui.Button)
[[Activate widget]]
}
@property count {
- [[Maximum number of states]]
+ [[Maximum number of states]]
set {
}
get {
@@ -30,10 +30,10 @@ class Efl.Ui.Nstate(Efl.Ui.Button)
implements {
class.constructor;
Efl.Object.constructor;
- Elm.Widget.theme_apply;
- Elm.Widget.widget_event;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.widget_event;
}
events {
- changed; [[Called when the value changed.]]
+ changed: void; [[Called when the value changed.]]
}
}
diff --git a/src/lib/elementary/efl_ui_nstate_private.h b/src/lib/elementary/efl_ui_nstate_private.h
new file mode 100644
index 0000000000..a976592b72
--- /dev/null
+++ b/src/lib/elementary/efl_ui_nstate_private.h
@@ -0,0 +1,57 @@
+#ifndef EFL_UI_NSTATE_PRIVATE_H
+#define EFL_UI_NSTATE_PRIVATE_H
+
+#include "Elementary.h"
+
+/* DO NOT USE THIS HEADER UNLESS YOU ARE PREPARED FOR BREAKING OF YOUR
+ * CODE. THIS IS ELEMENTARY'S INTERNAL WIDGET API (for now) AND IS NOT
+ * FINAL. CALL elm_widget_api_check(ELM_INTERNAL_API_VERSION) TO CHECK
+ * IT AT RUNTIME.
+ */
+
+/**
+ * @addtogroup Widget
+ * @{
+ *
+ * @section efl-ui-nstate-class The Efl Ui Nstate Class
+ *
+ */
+
+/**
+ * Base widget smart data extended with nstate instance data.
+ */
+typedef struct _Efl_Ui_Nstate_Data
+{
+ int nstate;
+ int state;
+} Efl_Ui_Nstate_Data;
+/**
+ * @}
+ */
+
+#define EFL_UI_NSTATE_DATA_GET(o, sd) \
+ Efl_Ui_Nstate_Data * sd = efl_data_scope_get(o, EFL_UI_NSTATE_CLASS)
+
+#define EFL_UI_NSTATE_DATA_GET_OR_RETURN(o, ptr) \
+ EFL_UI_NSTATE_DATA_GET(o, ptr); \
+ if (EINA_UNLIKELY(!ptr)) \
+ { \
+ ERR("No widget data for object %p (%s)", \
+ o, evas_object_type_get(o)); \
+ return; \
+ }
+
+#define EFL_UI_NSTATE_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
+ EFL_UI_NSTATE_DATA_GET(o, ptr); \
+ if (EINA_UNLIKELY(!ptr)) \
+ { \
+ ERR("No widget data for object %p (%s)", \
+ o, evas_object_type_get(o)); \
+ return val; \
+ }
+
+#define EFL_UI_NSTATE_CHECK(obj) \
+ if (EINA_UNLIKELY(!efl_isa((obj), EFL_UI_NSTATE_CLASS))) \
+ return;
+
+#endif
diff --git a/src/lib/elementary/efl_ui_pager.c b/src/lib/elementary/efl_ui_pager.c
new file mode 100644
index 0000000000..921d7676f9
--- /dev/null
+++ b/src/lib/elementary/efl_ui_pager.c
@@ -0,0 +1,811 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#define EFL_PACK_LAYOUT_PROTECTED
+
+#include <Elementary.h>
+#include "elm_priv.h"
+#include "efl_ui_widget_pager.h"
+#include "efl_page_transition.h"
+
+#define MY_CLASS EFL_UI_PAGER_CLASS
+
+
+static void
+_efl_ui_pager_update(Efl_Ui_Pager_Data *pd)
+{
+ if (pd->cnt == 0) return;
+
+ efl_page_transition_update(pd->transition, pd->curr.pos);
+ if (pd->indicator)
+ efl_page_indicator_update(pd->indicator, pd->curr.pos);
+}
+
+static void
+_job(void *data)
+{
+ Evas_Object *obj = data;
+ EFL_UI_PAGER_DATA_GET(obj, pd);
+
+ int prev_page, page_diff;
+ double prev_pos, pos_diff;
+
+ prev_page = pd->curr.page;
+ prev_pos = pd->curr.pos;
+
+ pd->job = NULL;
+
+ pos_diff = ((double) pd->down.x - (double) pd->mouse_x) / (double) pd->w;
+ pd->curr.pos = pd->down.pos + pos_diff;
+ page_diff = (int) pd->curr.pos;
+
+ //FIXME what if (prev_pos != 0.0)
+ if ((pd->loop == EFL_UI_PAGER_LOOP_DISABLED) &&
+ (((prev_page == 0) && (pd->curr.pos < 0)) ||
+ ((prev_page == (pd->cnt - 1)) && (pd->curr.pos > 0))))
+ {
+ pd->curr.page = prev_page;
+ pd->curr.pos = prev_pos;
+ return;
+ }
+
+ pd->curr.page = (pd->down.page + page_diff + pd->cnt) % pd->cnt;
+ pd->curr.pos -= page_diff;
+
+ //FIXME what if (page_diff >= 2 || page_diff <= -2)
+ if (page_diff != 0)
+ {
+ pd->down.x = pd->mouse_x;
+ pd->down.y = pd->mouse_y;
+ pd->down.page = pd->curr.page;
+ pd->down.pos = pd->curr.pos;
+
+ efl_page_transition_curr_page_change(pd->transition, page_diff);
+ }
+
+ _efl_ui_pager_update(pd);
+
+ return;
+}
+
+static void
+_page_set_animation(void *data, const Efl_Event *event)
+{
+ Efl_Ui_Pager_Data *pd = data;
+ double p = ecore_loop_time_get() - pd->change.start_time;
+ double d, temp_pos;
+ int temp_page;
+
+ if (p >= 1.0) p = 1.0;
+ p = ecore_animator_pos_map(p, ECORE_POS_MAP_ACCELERATE, 0.0, 0.0);
+
+ d = pd->change.src + pd->change.delta * p;
+ temp_page = d;
+ temp_pos = d - temp_page;
+
+ if ((temp_page < pd->curr.page) && (fabs(pd->curr.page - d) < 1.0))
+ {
+ temp_page += 1;
+ temp_pos -= 1.0;
+ }
+
+ if (pd->curr.page != temp_page)
+ {
+ if (pd->change.delta < 0)
+ efl_page_transition_curr_page_change(pd->transition, -1.0);
+ else
+ efl_page_transition_curr_page_change(pd->transition, 1.0);
+ temp_pos = 0.0;
+ }
+
+ pd->curr.page = temp_page;
+ pd->curr.pos = temp_pos;
+
+ ERR("page %d pos %lf", pd->curr.page, pd->curr.pos);
+
+ _efl_ui_pager_update(pd);
+
+ if (EINA_DBL_EQ(p, 1.0))
+ efl_event_callback_del(event->object, EFL_EVENT_ANIMATOR_TICK,
+ _page_set_animation, pd);
+}
+
+static void
+_mouse_up_animation(void *data, const Efl_Event *event)
+{
+ Efl_Ui_Pager_Data *pd = data;
+ double p = ecore_loop_time_get() - pd->mouse_up_time;
+
+ if (p >= 1.0) p = 1.0;
+ p = ecore_animator_pos_map(p, ECORE_POS_MAP_ACCELERATE, 0.0, 0.0);
+
+ if (pd->curr.pos < 0.0)
+ {
+ if (pd->curr.pos > -0.5)
+ pd->curr.pos = pd->curr.pos * (1 - p);
+ else
+ pd->curr.pos = (-1) - (-1 - pd->curr.pos) * (1 - p);
+ }
+ else
+ {
+ if (pd->curr.pos < 0.5)
+ pd->curr.pos = pd->curr.pos * (1 - p);
+ else
+ pd->curr.pos = 1 - (1 - pd->curr.pos) * (1 - p);
+ }
+
+ if (EINA_DBL_EQ(pd->curr.pos, 1.0))
+ {
+ efl_page_transition_curr_page_change(pd->transition, 1.0);
+ pd->curr.page = (pd->curr.page + 1 + pd->cnt) % pd->cnt;
+ pd->curr.pos = 0.0;
+ }
+ else if (EINA_DBL_EQ(pd->curr.pos, -1.0))
+ {
+ efl_page_transition_curr_page_change(pd->transition, -1.0);
+ pd->curr.page = (pd->curr.page - 1 + pd->cnt) % pd->cnt;
+ pd->curr.pos = 0.0;
+ }
+
+ _efl_ui_pager_update(pd);
+
+ if (EINA_DBL_EQ(p, 1.0))
+ efl_event_callback_del(event->object, EFL_EVENT_ANIMATOR_TICK,
+ _mouse_up_animation, pd);
+}
+
+static void
+_mouse_down_cb(void *data,
+ const Efl_Event *event)
+{
+ Efl_Input_Pointer *ev = event->info;
+ Eo *obj = data;
+ EFL_UI_PAGER_DATA_GET(obj, pd);
+ Eina_Position2D pos;
+
+ if (efl_input_pointer_button_get(ev) != 1) return;
+ if (efl_input_event_flags_get(ev) & EFL_INPUT_FLAGS_PROCESSED) return;
+
+ efl_event_callback_del(obj, EFL_EVENT_ANIMATOR_TICK, _mouse_up_animation, pd);
+ efl_event_callback_del(obj, EFL_EVENT_ANIMATOR_TICK, _page_set_animation, pd);
+
+ pd->move_started = EINA_FALSE;
+
+ pos = efl_input_pointer_position_get(ev);
+ pd->mouse_x = pos.x - pd->x;
+ pd->mouse_y = pos.y - pd->y;
+
+ pd->down.enabled = EINA_TRUE;
+ pd->down.x = pd->mouse_x;
+ pd->down.y = pd->mouse_y;
+ pd->down.page = pd->curr.page;
+ pd->down.pos = pd->curr.pos;
+}
+
+static void
+_mouse_move_cb(void *data,
+ const Efl_Event *event)
+{
+ Efl_Input_Pointer *ev = event->info;
+ Eo *obj = data;
+ EFL_UI_PAGER_DATA_GET(obj, pd);
+ Eina_Position2D pos;
+
+ if (efl_input_event_flags_get(ev) & EFL_INPUT_FLAGS_PROCESSED) return;
+ if (!pd->down.enabled) return;
+
+ pos = efl_input_pointer_position_get(ev);
+
+ if (pd->prev_block && (pd->mouse_x < (pos.x - pd->x))) return;
+ if (pd->next_block && (pd->mouse_x > (pos.x - pd->x))) return;
+
+ pd->mouse_x = pos.x - pd->x;
+ pd->mouse_y = pos.y - pd->y;
+
+ if (!pd->move_started)
+ {
+ Evas_Coord dx, dy;
+ dx = pd->mouse_x - pd->down.x;
+ dy = pd->mouse_y - pd->down.y;
+
+ if (((dx * dx) + (dy * dy)) <=
+ (_elm_config->finger_size * _elm_config->finger_size / 4))
+ return;
+
+ pd->move_started = EINA_TRUE;
+ }
+
+ ecore_job_del(pd->job);
+ pd->job = ecore_job_add(_job, obj);
+}
+
+static void
+_mouse_up_cb(void *data,
+ const Efl_Event *event)
+{
+ Efl_Input_Pointer *ev = event->info;
+ Eo *obj = data;
+ EFL_UI_PAGER_DATA_GET(obj, pd);
+
+ if (efl_input_event_flags_get(ev) & EFL_INPUT_FLAGS_PROCESSED) return;
+ if (!pd->down.enabled) return;
+
+ pd->down.enabled = EINA_FALSE;
+
+ ELM_SAFE_FREE(pd->job, ecore_job_del);
+
+ if (EINA_DBL_EQ(pd->curr.pos, 0.0)) return;
+
+ pd->mouse_up_time = ecore_loop_time_get();
+
+ efl_event_callback_add(obj, EFL_EVENT_ANIMATOR_TICK, _mouse_up_animation, pd);
+}
+
+//FIXME sub_object_parent_add? destruction
+static void
+_event_handler_create(Eo *obj, Efl_Ui_Pager_Data *pd)
+{
+ pd->event = efl_add(EFL_CANVAS_RECTANGLE_CLASS,
+ evas_object_evas_get(obj));
+ evas_object_color_set(pd->event, 0, 0, 0, 0);
+ evas_object_repeat_events_set(pd->event, EINA_TRUE);
+
+ efl_content_set(efl_part(obj, "efl.event"), pd->event);
+
+ efl_event_callback_add(pd->event, EFL_EVENT_POINTER_DOWN,
+ _mouse_down_cb, obj);
+ efl_event_callback_add(pd->event, EFL_EVENT_POINTER_UP,
+ _mouse_up_cb, obj);
+ efl_event_callback_add(pd->event, EFL_EVENT_POINTER_MOVE,
+ _mouse_move_cb, obj);
+}
+
+static void
+_event_handler_del(Eo *obj, Efl_Ui_Pager_Data *pd)
+{
+ efl_content_unset(efl_part(obj, "efl.event"));
+ efl_del(pd->event);
+ pd->event = NULL;
+}
+
+static void
+_resize_cb(void *data, const Efl_Event *ev)
+{
+ Efl_Ui_Pager_Data *pd = data;
+ Eina_Size2D sz;
+
+ sz = efl_gfx_entity_size_get(ev->object);
+
+ pd->w = sz.w;
+ pd->h = sz.h;
+
+ if (pd->fill_width) pd->page_spec.sz.w = pd->w;
+ if (pd->fill_height) pd->page_spec.sz.h = pd->h;
+
+ if (pd->transition)
+ efl_page_transition_page_size_set(pd->transition, pd->page_spec.sz);
+ else
+ {
+ efl_gfx_entity_size_set(pd->foreclip, sz);
+ efl_gfx_entity_size_set(pd->page_box, pd->page_spec.sz);
+ efl_gfx_entity_position_set(pd->page_box,
+ EINA_POSITION2D(pd->x + (pd->w / 2) - (pd->page_spec.sz.w / 2),
+ pd->y + (pd->h / 2) - (pd->page_spec.sz.h / 2)));
+ }
+}
+
+static void
+_move_cb(void *data, const Efl_Event *ev)
+{
+ Efl_Ui_Pager_Data *pd = data;
+ Eina_Position2D pos;
+
+ pos = efl_gfx_entity_position_get(ev->object);
+
+ pd->x = pos.x;
+ pd->y = pos.y;
+
+ if (!pd->transition)
+ {
+ efl_gfx_entity_position_set(pd->foreclip, pos);
+ efl_gfx_entity_position_set(pd->page_box,
+ EINA_POSITION2D(pd->x + (pd->w / 2) - (pd->page_spec.sz.w / 2),
+ pd->y + (pd->h / 2) - (pd->page_spec.sz.h / 2)));
+ }
+}
+
+EOLIAN static Eo *
+_efl_ui_pager_efl_object_constructor(Eo *obj,
+ Efl_Ui_Pager_Data *pd)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
+
+ if (!elm_widget_theme_klass_get(obj))
+ elm_widget_theme_klass_set(obj, "pager");
+
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+
+ if (!elm_widget_theme_object_set(obj, wd->resize_obj,
+ elm_widget_theme_klass_get(obj),
+ elm_widget_theme_element_get(obj),
+ elm_widget_theme_style_get(obj)))
+ CRI("Failed to set layout!");
+
+ elm_widget_sub_object_parent_add(obj);
+
+ pd->cnt = 0;
+ pd->loop = EFL_UI_PAGER_LOOP_DISABLED;
+
+ pd->curr.page = 0;
+ pd->curr.pos = 0.0;
+
+ pd->transition = NULL;
+ pd->indicator = NULL;
+
+ pd->fill_width = EINA_TRUE;
+ pd->fill_height = EINA_TRUE;
+
+ pd->page_spec.sz.w = -1;
+ pd->page_spec.sz.h = -1;
+
+ elm_widget_can_focus_set(obj, EINA_TRUE);
+
+ pd->page_root = efl_add(EFL_CANVAS_GROUP_CLASS, evas_object_evas_get(obj));
+ efl_content_set(efl_part(obj, "efl.page_root"), pd->page_root);
+
+ efl_event_callback_add(pd->page_root, EFL_GFX_ENTITY_EVENT_RESIZE, _resize_cb, pd);
+ efl_event_callback_add(pd->page_root, EFL_GFX_ENTITY_EVENT_MOVE, _move_cb, pd);
+
+ pd->page_box = efl_add(EFL_UI_BOX_CLASS, obj);
+ efl_canvas_group_member_add(pd->page_root, pd->page_box);
+
+ pd->foreclip = efl_add(EFL_CANVAS_RECTANGLE_CLASS,
+ evas_object_evas_get(obj));
+ efl_canvas_group_member_add(pd->page_root, pd->foreclip);
+ evas_object_static_clip_set(pd->foreclip, EINA_TRUE);
+ efl_canvas_object_clip_set(pd->page_box, pd->foreclip);
+
+ pd->backclip = efl_add(EFL_CANVAS_RECTANGLE_CLASS,
+ evas_object_evas_get(obj));
+ efl_canvas_group_member_add(pd->page_root, pd->backclip);
+ evas_object_static_clip_set(pd->backclip, EINA_TRUE);
+ efl_gfx_entity_visible_set(pd->backclip, EINA_FALSE);
+
+ return obj;
+}
+
+EOLIAN static int
+_efl_ui_pager_efl_container_content_count(Eo *obj EINA_UNUSED,
+ Efl_Ui_Pager_Data *pd)
+{
+ return pd->cnt;
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_pager_efl_pack_linear_pack_begin(Eo *obj,
+ Efl_Ui_Pager_Data *pd,
+ Efl_Gfx_Entity *subobj)
+{
+ efl_parent_set(subobj, obj);
+ elm_widget_sub_object_add(obj, subobj);
+
+ pd->content_list = eina_list_prepend(pd->content_list, subobj);
+
+ pd->cnt += 1;
+ pd->curr.page += 1;
+
+ if (pd->transition)
+ efl_page_transition_update(pd->transition, pd->curr.pos);
+ else
+ {
+ if (pd->cnt == 1)
+ efl_pack(pd->page_box, subobj);
+ else efl_canvas_object_clip_set(subobj, pd->backclip);
+ }
+
+ if (pd->indicator)
+ {
+ efl_page_indicator_pack(pd->indicator, 0);
+ efl_page_indicator_update(pd->indicator, pd->curr.pos);
+ }
+
+ return EINA_TRUE;
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_pager_efl_pack_linear_pack_end(Eo *obj,
+ Efl_Ui_Pager_Data *pd,
+ Efl_Gfx_Entity *subobj)
+{
+ efl_parent_set(subobj, obj);
+ elm_widget_sub_object_add(obj, subobj);
+
+ pd->content_list = eina_list_append(pd->content_list, subobj);
+
+ pd->cnt += 1;
+
+ if (pd->transition)
+ efl_page_transition_update(pd->transition, pd->curr.pos);
+ else
+ {
+ if (pd->cnt == 1)
+ efl_pack(pd->page_box, subobj);
+ else efl_canvas_object_clip_set(subobj, pd->backclip);
+ }
+
+ if (pd->indicator)
+ {
+ efl_page_indicator_pack(pd->indicator, (pd->cnt - 1));
+ efl_page_indicator_update(pd->indicator, pd->curr.pos);
+ }
+
+ return EINA_TRUE;
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_pager_efl_pack_linear_pack_before(Eo *obj,
+ Efl_Ui_Pager_Data *pd,
+ Efl_Gfx_Entity *subobj,
+ const Efl_Gfx_Entity *existing)
+{
+ int index;
+
+ efl_parent_set(subobj, obj);
+ elm_widget_sub_object_add(obj, subobj);
+
+ index = eina_list_data_idx(pd->content_list, (void *)existing);
+ pd->content_list = eina_list_prepend_relative(pd->content_list, subobj, existing);
+
+ pd->cnt += 1;
+ if (pd->curr.page >= index) pd->curr.page += 1;
+
+ if (pd->transition)
+ efl_page_transition_update(pd->transition, pd->curr.pos);
+ else efl_canvas_object_clip_set(subobj, pd->backclip);
+
+ if (pd->indicator)
+ {
+ efl_page_indicator_pack(pd->indicator, index);
+ efl_page_indicator_update(pd->indicator, pd->curr.pos);
+ }
+
+ return EINA_TRUE;
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_pager_efl_pack_linear_pack_after(Eo *obj,
+ Efl_Ui_Pager_Data *pd,
+ Efl_Gfx_Entity *subobj,
+ const Efl_Gfx_Entity *existing)
+{
+ int index;
+
+ efl_parent_set(subobj, obj);
+ elm_widget_sub_object_add(obj, subobj);
+
+ index = eina_list_data_idx(pd->content_list, (void *)existing);
+ pd->content_list = eina_list_append_relative(pd->content_list, subobj, existing);
+
+ pd->cnt += 1;
+ if (pd->curr.page > index) pd->curr.page += 1;
+
+ if (pd->transition)
+ efl_page_transition_update(pd->transition, pd->curr.pos);
+ else efl_canvas_object_clip_set(subobj, pd->backclip);
+
+ if (pd->indicator)
+ {
+ efl_page_indicator_pack(pd->indicator, (index + 1));
+ efl_page_indicator_update(pd->indicator, pd->curr.pos);
+ }
+
+ return EINA_TRUE;
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_pager_efl_pack_linear_pack_at(Eo *obj,
+ Efl_Ui_Pager_Data *pd,
+ Efl_Gfx_Entity *subobj,
+ int index)
+{
+ Efl_Gfx_Entity *existing = NULL;
+
+ efl_parent_set(subobj, obj);
+ elm_widget_sub_object_add(obj, subobj);
+
+ existing = eina_list_nth(pd->content_list, index);
+ pd->content_list = eina_list_prepend_relative(pd->content_list, subobj, existing);
+
+ pd->cnt += 1;
+ if (pd->curr.page >= index) pd->curr.page += 1;
+
+ if (pd->transition)
+ efl_page_transition_update(pd->transition, pd->curr.pos);
+ else efl_canvas_object_clip_set(subobj, pd->backclip);
+
+ if (pd->indicator)
+ {
+ efl_page_indicator_pack(pd->indicator, index);
+ efl_page_indicator_update(pd->indicator, pd->curr.pos);
+ }
+
+ return EINA_TRUE;
+}
+
+EOLIAN static Efl_Gfx_Entity *
+_efl_ui_pager_efl_pack_linear_pack_content_get(Eo *obj EINA_UNUSED,
+ Efl_Ui_Pager_Data *pd,
+ int index)
+{
+ return eina_list_nth(pd->content_list, index);
+}
+
+EOLIAN static int
+_efl_ui_pager_efl_pack_linear_pack_index_get(Eo *obj EINA_UNUSED,
+ Efl_Ui_Pager_Data *pd,
+ const Efl_Gfx_Entity *subobj)
+{
+ return eina_list_data_idx(pd->content_list, (void *)subobj);
+}
+
+EOLIAN static void
+_efl_ui_pager_current_page_set(Eo *obj,
+ Efl_Ui_Pager_Data *pd,
+ int index)
+{
+ if (index == pd->curr.page) return;
+
+ efl_event_callback_del(obj, EFL_EVENT_ANIMATOR_TICK, _mouse_up_animation, pd);
+ efl_event_callback_del(obj, EFL_EVENT_ANIMATOR_TICK, _page_set_animation, pd);
+
+ if (index >= pd->cnt)
+ {
+ ERR("page set fail");
+ return;
+ }
+
+ if (!pd->transition)
+ {
+ Eo *curr;
+
+ curr = eina_list_nth(pd->content_list, pd->curr.page);
+ efl_pack_unpack(pd->page_box, curr);
+ efl_canvas_object_clip_set(curr, pd->backclip);
+
+ pd->curr.page = index;
+ curr = eina_list_nth(pd->content_list, pd->curr.page);
+ efl_pack(pd->page_box, curr);
+
+ if (pd->indicator)
+ efl_page_indicator_update(pd->indicator, pd->curr.pos);
+
+ return;
+ }
+
+ pd->change.src = pd->curr.page + pd->curr.pos;
+ pd->change.delta = index - pd->change.src;
+
+ if (pd->change.delta == 0) return;
+
+ pd->change.start_time = ecore_loop_time_get();
+ efl_event_callback_add(obj, EFL_EVENT_ANIMATOR_TICK, _page_set_animation, pd);
+}
+
+EOLIAN static int
+_efl_ui_pager_current_page_get(const Eo *obj EINA_UNUSED,
+ Efl_Ui_Pager_Data *pd)
+{
+ return pd->curr.page;
+}
+
+EOLIAN static void
+_efl_ui_pager_transition_set(Eo *obj,
+ Efl_Ui_Pager_Data *pd,
+ Efl_Page_Transition *transition)
+{
+ if (pd->transition == transition) return;
+
+ if (pd->transition)
+ efl_page_transition_bind(pd->transition, NULL, NULL);
+ else
+ {
+ Eo *curr;
+
+ curr = eina_list_nth(pd->content_list, pd->curr.page);
+ efl_pack_unpack(pd->page_box, curr);
+ efl_canvas_object_clip_set(pd->page_box, pd->backclip);
+ }
+
+ pd->transition = transition;
+
+ if (pd->transition)
+ {
+ if (!pd->event) _event_handler_create(obj, pd);
+ efl_page_transition_bind(pd->transition, obj, pd->page_root);
+ }
+ else
+ {
+ Eina_List *list;
+ Eo *curr;
+
+ _event_handler_del(obj, pd);
+
+ efl_canvas_object_clip_set(pd->page_box, pd->foreclip);
+
+ EINA_LIST_FOREACH(pd->content_list, list, curr)
+ {
+ efl_canvas_object_clip_set(curr, pd->backclip);
+ }
+
+ curr = eina_list_nth(pd->content_list, pd->curr.page);
+ efl_pack(pd->page_box, curr);
+ }
+}
+
+EOLIAN static void
+_efl_ui_pager_indicator_set(Eo *obj EINA_UNUSED,
+ Efl_Ui_Pager_Data *pd,
+ Efl_Page_Indicator *indicator)
+{
+ if (pd->indicator == indicator) return;
+
+ if (pd->indicator)
+ {
+ efl_page_indicator_bind(pd->indicator, NULL, NULL);
+ pd->indicator = NULL;
+ }
+
+ pd->indicator = indicator;
+
+ if (!pd->indicator)
+ {
+ if (pd->idbox)
+ {
+ efl_del(pd->idbox);
+ pd->idbox = NULL;
+ }
+ return;
+ }
+
+ if (!pd->idbox)
+ {
+ pd->idbox = efl_add(EFL_UI_BOX_CLASS, obj);
+ efl_content_set(efl_part(obj, "efl.indicator"), pd->idbox);
+ }
+
+ efl_page_indicator_bind(pd->indicator, obj, pd->idbox);
+}
+
+EOLIAN Eina_Size2D
+_efl_ui_pager_page_size_get(const Eo *obj EINA_UNUSED,
+ Efl_Ui_Pager_Data *pd)
+{
+ return pd->page_spec.sz;
+}
+
+EOLIAN static void
+_efl_ui_pager_page_size_set(Eo *obj EINA_UNUSED,
+ Efl_Ui_Pager_Data *pd,
+ Eina_Size2D sz)
+{
+ if (sz.w < -1 || sz.h < -1) return;
+
+ if (sz.w == -1)
+ {
+ pd->fill_width = EINA_TRUE;
+ pd->page_spec.sz.w = pd->w;
+ }
+ else
+ {
+ pd->fill_width = EINA_FALSE;
+ pd->page_spec.sz.w = sz.w;
+ }
+ if (sz.h == -1)
+ {
+ pd->fill_height = EINA_TRUE;
+ pd->page_spec.sz.h = pd->h;
+ }
+ else
+ {
+ pd->fill_height = EINA_FALSE;
+ pd->page_spec.sz.h = sz.h;
+ }
+
+ if (pd->transition)
+ efl_page_transition_page_size_set(pd->transition, pd->page_spec.sz);
+ else
+ efl_gfx_entity_size_set(pd->page_box, pd->page_spec.sz);
+}
+
+EOLIAN static int
+_efl_ui_pager_padding_get(const Eo *obj EINA_UNUSED,
+ Efl_Ui_Pager_Data *pd)
+{
+ return pd->page_spec.padding;
+}
+
+EOLIAN static void
+_efl_ui_pager_padding_set(Eo *obj EINA_UNUSED,
+ Efl_Ui_Pager_Data *pd,
+ int padding)
+{
+ pd->page_spec.padding = padding;
+
+ efl_page_transition_padding_size_set(pd->transition, padding);
+}
+
+EOLIAN static void
+_efl_ui_pager_scroll_block_get(const Eo *obj EINA_UNUSED,
+ Efl_Ui_Pager_Data *pd,
+ Eina_Bool *prev,
+ Eina_Bool *next)
+{
+ if (prev) *prev = pd->prev_block;
+ if (next) *next = pd->next_block;
+}
+
+EOLIAN static void
+_efl_ui_pager_scroll_block_set(Eo *obj EINA_UNUSED,
+ Efl_Ui_Pager_Data *pd,
+ Eina_Bool prev,
+ Eina_Bool next)
+{
+ pd->prev_block = prev;
+ pd->next_block = next;
+}
+
+EOLIAN static void
+_efl_ui_pager_loop_mode_set(Eo *obj EINA_UNUSED,
+ Efl_Ui_Pager_Data *pd,
+ Efl_Ui_Pager_Loop loop)
+{
+ pd->loop = loop;
+
+ efl_page_transition_loop_set(pd->transition, loop);
+}
+
+EOLIAN static Efl_Ui_Pager_Loop
+_efl_ui_pager_loop_mode_get(const Eo *obj EINA_UNUSED,
+ Efl_Ui_Pager_Data *pd)
+{
+ return pd->loop;
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_pager_efl_pack_pack_clear(Eo *obj EINA_UNUSED,
+ Efl_Ui_Pager_Data *pd EINA_UNUSED)
+{
+ ERR("Soon to be implemented");
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_pager_efl_pack_unpack_all(Eo *obj EINA_UNUSED,
+ Efl_Ui_Pager_Data *pd EINA_UNUSED)
+{
+ ERR("Soon to be implemented");
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_pager_efl_pack_unpack(Eo *obj EINA_UNUSED,
+ Efl_Ui_Pager_Data *pd EINA_UNUSED,
+ Efl_Gfx_Entity *subobj EINA_UNUSED)
+{
+ ERR("Soon to be implemented");
+ return EINA_FALSE;
+}
+
+EOLIAN static Efl_Gfx_Entity *
+_efl_ui_pager_efl_pack_linear_pack_unpack_at(Eo *obj EINA_UNUSED,
+ Efl_Ui_Pager_Data *pd EINA_UNUSED,
+ int index EINA_UNUSED)
+{
+ ERR("Soon to be implemented");
+ return NULL;
+}
+
+
+
+#include "efl_ui_pager.eo.c"
diff --git a/src/lib/elementary/efl_ui_pager.eo b/src/lib/elementary/efl_ui_pager.eo
new file mode 100644
index 0000000000..6f22a0ffb6
--- /dev/null
+++ b/src/lib/elementary/efl_ui_pager.eo
@@ -0,0 +1,101 @@
+enum Efl.Ui.Pager_Loop
+{
+ [[Efl ui pager loop mode]]
+ disabled,
+ enabled
+}
+
+class Efl.Ui.Pager (Efl.Ui.Layout.Object, Efl.Pack_Linear)
+{
+ [[Pager widget
+
+ A pager contains many pages in a linear fashion and allows users to scroll
+ through pages. Each page is numbered according to linear order and
+ one of the pages is marked as 'current page' and displayed in the middle.
+ The way each page is displayed is defined by @Efl.Page.Transition object,
+ allowing users to adopt different types of transition.
+ The most common use case of this widget is the home screen of mobile devices.
+ ]]
+ methods {
+ @property transition {
+ [[Page transition effect
+
+ Page transition is in charge of displaying pages in a specific way and
+ invoked every time page layout needs to be updated.
+ ]]
+ set {
+ [[Set a page transition effect]]
+ }
+ values {
+ transition: Efl.Page.Transition @nullable; [[transition effect]]
+ }
+ }
+ @property indicator {
+ [[Page indicator
+
+ Page indicator, located on the top layer of pager widget, helps users
+ to know the number of pages and the current page's index without scrolling.
+ ]]
+ set {
+ [[Set a page indicator]]
+ }
+ values {
+ indicator: Efl.Page.Indicator @nullable; [[indicator class]]
+ }
+ }
+ @property current_page {
+ [[One page is selected as the current page and mainly displayed.]]
+ set {
+ [[Set one page as current page]]
+ }
+ get {
+ [[Get the current page]]
+ }
+ values {
+ index: int;
+ }
+ }
+ @property scroll_block {
+ [[Pages can be scrolled back and forth by default. This property allows
+ limiting the direction of scrolling, or blocking scroll gesture at all.
+ ]]
+ values {
+ prev: bool;
+ next: bool;
+ }
+ }
+ @property loop_mode {
+ [[Pager is not scrolled after it's scrolled to the end by default.
+ This property gives the option to make a loop through pages.
+ ]]
+ values {
+ loop: Efl.Ui.Pager_Loop;
+ }
+ }
+ @property page_size {
+ values {
+ size: Eina.Size2D;
+ }
+ }
+ @property padding {
+ values {
+ padding: int;
+ }
+ }
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Container.content_count;
+ Efl.Pack.pack_clear; //TODO
+ Efl.Pack.unpack_all; //TODO
+ Efl.Pack.unpack; //TODO
+ Efl.Pack_Linear.pack_begin;
+ Efl.Pack_Linear.pack_end;
+ Efl.Pack_Linear.pack_before;
+ Efl.Pack_Linear.pack_after;
+ Efl.Pack_Linear.pack_at;
+ Efl.Pack_Linear.pack_content_get;
+ Efl.Pack_Linear.pack_index_get;
+ Efl.Pack_Linear.pack_unpack_at; //TODO
+ }
+}
diff --git a/src/lib/elementary/efl_ui_pan.c b/src/lib/elementary/efl_ui_pan.c
index f6c065a41a..062e94cfad 100644
--- a/src/lib/elementary/efl_ui_pan.c
+++ b/src/lib/elementary/efl_ui_pan.c
@@ -16,18 +16,18 @@
EFL_UI_PAN_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return __VA_ARGS__; \
}
EOLIAN static void
-_efl_ui_pan_efl_gfx_position_set(Eo *obj, Efl_Ui_Pan_Data *psd, Eina_Position2D pos)
+_efl_ui_pan_efl_gfx_entity_position_set(Eo *obj, Efl_Ui_Pan_Data *psd, Eina_Position2D pos)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
- efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
psd->x = pos.x;
psd->y = pos.y;
@@ -36,12 +36,12 @@ _efl_ui_pan_efl_gfx_position_set(Eo *obj, Efl_Ui_Pan_Data *psd, Eina_Position2D
}
EOLIAN static void
-_efl_ui_pan_efl_gfx_size_set(Eo *obj, Efl_Ui_Pan_Data *psd, Eina_Size2D sz)
+_efl_ui_pan_efl_gfx_entity_size_set(Eo *obj, Efl_Ui_Pan_Data *psd, Eina_Size2D sz)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
- efl_gfx_size_set(efl_super(obj, MY_CLASS), sz);
+ efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
psd->w = sz.w;
psd->h = sz.h;
@@ -51,13 +51,13 @@ _efl_ui_pan_efl_gfx_size_set(Eo *obj, Efl_Ui_Pan_Data *psd, Eina_Size2D sz)
}
EOLIAN static void
-_efl_ui_pan_efl_gfx_visible_set(Eo *obj, Efl_Ui_Pan_Data *psd, Eina_Bool vis)
+_efl_ui_pan_efl_gfx_entity_visible_set(Eo *obj, Efl_Ui_Pan_Data *psd, Eina_Bool vis)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 0, vis))
return;
- efl_gfx_visible_set(efl_super(obj, MY_CLASS), vis);
- if (psd->content) efl_gfx_visible_set(psd->content, vis);
+ efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), vis);
+ if (psd->content) efl_gfx_entity_visible_set(psd->content, vis);
}
EOLIAN static void
@@ -72,13 +72,13 @@ _efl_ui_pan_pan_position_set(Eo *obj EINA_UNUSED, Efl_Ui_Pan_Data *psd, Eina_Pos
}
EOLIAN static Eina_Position2D
-_efl_ui_pan_pan_position_get(Eo *obj EINA_UNUSED, Efl_Ui_Pan_Data *psd)
+_efl_ui_pan_pan_position_get(const Eo *obj EINA_UNUSED, Efl_Ui_Pan_Data *psd)
{
return EINA_POSITION2D(psd->px, psd->py);
}
EOLIAN static Eina_Position2D
-_efl_ui_pan_pan_position_max_get(Eo *obj EINA_UNUSED, Efl_Ui_Pan_Data *psd)
+_efl_ui_pan_pan_position_max_get(const Eo *obj EINA_UNUSED, Efl_Ui_Pan_Data *psd)
{
Eina_Position2D pos = { 0, 0};
if (psd->w < psd->content_w) pos.x = psd->content_w - psd->w;
@@ -88,13 +88,13 @@ _efl_ui_pan_pan_position_max_get(Eo *obj EINA_UNUSED, Efl_Ui_Pan_Data *psd)
}
EOLIAN static Eina_Position2D
-_efl_ui_pan_pan_position_min_get(Eo *obj EINA_UNUSED, Efl_Ui_Pan_Data *_pd EINA_UNUSED)
+_efl_ui_pan_pan_position_min_get(const Eo *obj EINA_UNUSED, Efl_Ui_Pan_Data *_pd EINA_UNUSED)
{
return EINA_POSITION2D(0 ,0);
}
EOLIAN static Eina_Size2D
-_efl_ui_pan_content_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Pan_Data *psd)
+_efl_ui_pan_content_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_Pan_Data *psd)
{
return EINA_SIZE2D(psd->content_w, psd->content_h);
}
@@ -138,7 +138,7 @@ _efl_ui_pan_content_resize_cb(void *data,
Evas_Object *pobj = data;
EFL_UI_PAN_DATA_GET_OR_RETURN(pobj, psd);
- Eina_Size2D sz = efl_gfx_size_get(psd->content);
+ Eina_Size2D sz = efl_gfx_entity_size_get(psd->content);
if ((sz.w != psd->content_w) || (sz.h != psd->content_h))
{
psd->content_w = sz.w;
@@ -169,7 +169,7 @@ _efl_ui_pan_efl_content_content_set(Evas_Object *obj, Efl_Ui_Pan_Data *psd, Evas
psd->content = content;
efl_canvas_group_member_add(obj, content);
- sz = efl_gfx_size_get(psd->content);
+ sz = efl_gfx_entity_size_get(psd->content);
psd->content_w = sz.w;
psd->content_h = sz.h;
evas_object_event_callback_add
@@ -192,6 +192,6 @@ end:
EOLIAN static void
_efl_ui_pan_efl_canvas_group_group_calculate(Eo *obj EINA_UNUSED, Efl_Ui_Pan_Data *psd)
{
- efl_gfx_position_set(psd->content, EINA_POSITION2D(psd->x - psd->px, psd->y - psd->py));
+ efl_gfx_entity_position_set(psd->content, EINA_POSITION2D(psd->x - psd->px, psd->y - psd->py));
}
#include "efl_ui_pan.eo.c"
diff --git a/src/lib/elementary/efl_ui_pan.eo b/src/lib/elementary/efl_ui_pan.eo
index 5648a85160..b27b8ca77d 100644
--- a/src/lib/elementary/efl_ui_pan.eo
+++ b/src/lib/elementary/efl_ui_pan.eo
@@ -4,7 +4,7 @@ class Efl.Ui.Pan (Efl.Canvas.Group,
[[Elementary pan class]]
methods {
@property pan_position {
- [[Position]]
+ [[Position]]
set {
}
get {
@@ -14,42 +14,42 @@ class Efl.Ui.Pan (Efl.Canvas.Group,
}
}
@property content_size {
- [[Content size]]
+ [[Content size]]
get {
}
values {
- size: Eina.Size2D;
+ size: Eina.Size2D;
}
}
@property pan_position_min {
- [[The minimal position to scroll]]
+ [[The minimal position to scroll]]
get {
}
values {
- pos: Eina.Position2D;
+ pos: Eina.Position2D;
}
}
@property pan_position_max {
- [[The maximal position to scroll]]
+ [[The maximal position to scroll]]
get {
}
values {
- pos: Eina.Position2D;
+ pos: Eina.Position2D;
}
}
}
implements {
Efl.Object.constructor;
Efl.Object.destructor;
- Efl.Gfx.visible { set; }
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set; }
+ Efl.Gfx.Entity.visible { set; }
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
Efl.Content.content { set; }
Efl.Canvas.Group.group_calculate;
}
events {
- content,changed; [[Called when pan content changed]]
- viewport,changed; [[Called when pan viewport changed]]
- position,changed; [[Called when pan position changed]]
+ content,changed: void; [[Called when pan content changed]]
+ viewport,changed: void; [[Called when pan viewport changed]]
+ position,changed: void; [[Called when pan position changed]]
}
}
diff --git a/src/lib/elementary/efl_ui_panes.c b/src/lib/elementary/efl_ui_panes.c
index f215387185..0af185b713 100644
--- a/src/lib/elementary/efl_ui_panes.c
+++ b/src/lib/elementary/efl_ui_panes.c
@@ -2,9 +2,10 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define ELM_LAYOUT_PROTECTED
#define EFL_GFX_SIZE_HINT_PROTECTED
+#define EFL_PART_PROTECTED
#include <Elementary.h>
@@ -19,7 +20,6 @@
#define MY_CLASS_PFX efl_ui_panes
#define MY_CLASS_NAME "Efl.Ui.Panes"
-#define MY_CLASS_NAME_LEGACY "elm_panes"
/**
* TODO
* Update the minimun height of the bar in the theme.
@@ -111,7 +111,7 @@ _efl_ui_panes_theme_group_get(Evas_Object *obj, Efl_Ui_Panes_Data *sd)
}
EOLIAN static Efl_Ui_Theme_Apply
-_efl_ui_panes_elm_widget_theme_apply(Eo *obj, Efl_Ui_Panes_Data *sd)
+_efl_ui_panes_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Panes_Data *sd)
{
double size;
Evas_Coord minw = 0, minh = 0;
@@ -137,11 +137,16 @@ _efl_ui_panes_elm_widget_theme_apply(Eo *obj, Efl_Ui_Panes_Data *sd)
if (sd->fixed)
{
- elm_layout_signal_emit(obj, "elm,panes,fixed", "elm");
+ if (elm_widget_is_legacy(obj))
+ {
+ elm_layout_signal_emit(obj, "elm,panes,fixed", "elm");
- //TODO: remove this signal on EFL 2.0.
- // I left this due to the backward compatibility.
- elm_layout_signal_emit(obj, "elm.panes.fixed", "elm");
+ //TODO: remove this signal on EFL 2.0.
+ // I left this due to the backward compatibility.
+ elm_layout_signal_emit(obj, "elm.panes.fixed", "elm");
+ }
+ else
+ elm_layout_signal_emit(obj, "efl,panes,fixed", "efl");
}
elm_layout_sizing_eval(obj);
@@ -204,8 +209,16 @@ _efl_ui_panes_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Panes_Data *sd)
Eo *first_content, *second_content;
Eina_Size2D min;
- first_content = efl_content_get(efl_part(obj, "first"));
- second_content = efl_content_get(efl_part(obj, "second"));
+ if (elm_widget_is_legacy(obj))
+ {
+ first_content = efl_content_get(efl_part(obj, "elm.swallow.left"));
+ second_content = efl_content_get(efl_part(obj, "elm.swallow.right"));
+ }
+ else
+ {
+ first_content = efl_content_get(efl_part(obj, "first"));
+ second_content = efl_content_get(efl_part(obj, "second"));
+ }
if (first_content)
{
@@ -408,18 +421,36 @@ _efl_ui_panes_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Panes_Data *_pd EINA_UN
elm_panes_content_left_size_set(obj, 0.5);
- edje_object_signal_callback_add
- (wd->resize_obj, "elm,action,click", "*",
- _on_clicked, obj);
- edje_object_signal_callback_add
- (wd->resize_obj, "elm,action,click,double", "*",
- _double_clicked, obj);
- edje_object_signal_callback_add
- (wd->resize_obj, "elm,action,press", "*",
- _on_pressed, obj);
- edje_object_signal_callback_add
- (wd->resize_obj, "elm,action,unpress", "*",
- _on_unpressed, obj);
+ if (elm_widget_is_legacy(obj))
+ {
+ edje_object_signal_callback_add
+ (wd->resize_obj, "elm,action,click", "*",
+ _on_clicked, obj);
+ edje_object_signal_callback_add
+ (wd->resize_obj, "elm,action,click,double", "*",
+ _double_clicked, obj);
+ edje_object_signal_callback_add
+ (wd->resize_obj, "elm,action,press", "*",
+ _on_pressed, obj);
+ edje_object_signal_callback_add
+ (wd->resize_obj, "elm,action,unpress", "*",
+ _on_unpressed, obj);
+ }
+ else
+ {
+ edje_object_signal_callback_add
+ (wd->resize_obj, "efl,action,click", "*",
+ _on_clicked, obj);
+ edje_object_signal_callback_add
+ (wd->resize_obj, "efl,action,click,double", "*",
+ _double_clicked, obj);
+ edje_object_signal_callback_add
+ (wd->resize_obj, "efl,action,press", "*",
+ _on_pressed, obj);
+ edje_object_signal_callback_add
+ (wd->resize_obj, "efl,action,unpress", "*",
+ _on_unpressed, obj);
+ }
evas_object_event_callback_add
(wd->resize_obj, EVAS_CALLBACK_RESIZE,
_on_resize, obj);
@@ -439,14 +470,30 @@ _efl_ui_panes_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Panes_Data *_pd EINA_UN
sd->event = evas_object_rectangle_add(evas_object_evas_get(obj));
evas_object_color_set(sd->event, 0, 0, 0, 0);
evas_object_pass_events_set(sd->event, EINA_TRUE);
- if (edje_object_part_exists
- (wd->resize_obj, "elm.swallow.event"))
+
+ if (elm_widget_is_legacy(obj))
{
- Evas_Coord minw = 0, minh = 0;
+ if (edje_object_part_exists
+ (wd->resize_obj, "elm.swallow.event"))
+ {
+ Evas_Coord minw = 0, minh = 0;
- elm_coords_finger_size_adjust(1, &minw, 1, &minh);
- evas_object_size_hint_min_set(sd->event, minw, minh);
- elm_layout_content_set(obj, "elm.swallow.event", sd->event);
+ elm_coords_finger_size_adjust(1, &minw, 1, &minh);
+ evas_object_size_hint_min_set(sd->event, minw, minh);
+ elm_layout_content_set(obj, "elm.swallow.event", sd->event);
+ }
+ }
+ else
+ {
+ if (edje_object_part_exists
+ (wd->resize_obj, "efl.event"))
+ {
+ Evas_Coord minw = 0, minh = 0;
+
+ elm_coords_finger_size_adjust(1, &minw, 1, &minh);
+ evas_object_size_hint_min_set(sd->event, minw, minh);
+ elm_layout_content_set(obj, "efl.event", sd->event);
+ }
}
elm_widget_sub_object_add(obj, sd->event);
@@ -457,20 +504,22 @@ EOLIAN static Eo *
_efl_ui_panes_efl_object_constructor(Eo *obj, Efl_Ui_Panes_Data *_pd EINA_UNUSED)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
- efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_SPLIT_PANE);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_SPLIT_PANE);
return obj;
}
EOLIAN static double
-_efl_ui_panes_split_ratio_get(Eo *obj, Efl_Ui_Panes_Data *sd)
+_efl_ui_panes_split_ratio_get(const Eo *obj, Efl_Ui_Panes_Data *sd)
{
double w, h;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, 0.0);
- edje_object_part_drag_value_get(wd->resize_obj, "elm.bar", &w, &h);
+ if (elm_widget_is_legacy(obj))
+ edje_object_part_drag_value_get(wd->resize_obj, "elm.bar", &w, &h);
+ else
+ edje_object_part_drag_value_get(wd->resize_obj, "efl.bar", &w, &h);
if (sd->dir == EFL_UI_DIR_HORIZONTAL)
return h;
@@ -486,9 +535,19 @@ _efl_ui_panes_split_ratio_set(Eo *obj, Efl_Ui_Panes_Data *sd, double ratio)
else if (ratio > 1.0) ratio = 1.0;
if (sd->dir == EFL_UI_DIR_HORIZONTAL)
- edje_object_part_drag_value_set(wd->resize_obj, "elm.bar", 0.0, ratio);
+ {
+ if (elm_widget_is_legacy(obj))
+ edje_object_part_drag_value_set(wd->resize_obj, "elm.bar", 0.0, ratio);
+ else
+ edje_object_part_drag_value_set(wd->resize_obj, "efl.bar", 0.0, ratio);
+ }
else
- edje_object_part_drag_value_set(wd->resize_obj, "elm.bar", ratio, 0.0);
+ {
+ if (elm_widget_is_legacy(obj))
+ edje_object_part_drag_value_set(wd->resize_obj, "elm.bar", ratio, 0.0);
+ else
+ edje_object_part_drag_value_set(wd->resize_obj, "efl.bar", ratio, 0.0);
+ }
}
EOLIAN static void
@@ -509,7 +568,7 @@ _efl_ui_panes_efl_ui_direction_direction_set(Eo *obj, Efl_Ui_Panes_Data *sd, Efl
}
EOLIAN static Efl_Ui_Dir
-_efl_ui_panes_efl_ui_direction_direction_get(Eo *obj EINA_UNUSED, Efl_Ui_Panes_Data *sd)
+_efl_ui_panes_efl_ui_direction_direction_get(const Eo *obj EINA_UNUSED, Efl_Ui_Panes_Data *sd)
{
return sd->dir;
}
@@ -520,34 +579,38 @@ _efl_ui_panes_fixed_set(Eo *obj, Efl_Ui_Panes_Data *sd, Eina_Bool fixed)
sd->fixed = !!fixed;
if (sd->fixed == EINA_TRUE)
{
- elm_layout_signal_emit(obj, "elm,panes,fixed", "elm");
+ if (elm_widget_is_legacy(obj))
+ {
+ elm_layout_signal_emit(obj, "elm,panes,fixed", "elm");
- //TODO: remove this signal on EFL 2.0.
- // I left this due to the backward compatibility.
- elm_layout_signal_emit(obj, "elm.panes.fixed", "elm");
+ //TODO: remove this signal on EFL 2.0.
+ // I left this due to the backward compatibility.
+ elm_layout_signal_emit(obj, "elm.panes.fixed", "elm");
+ }
+ else
+ elm_layout_signal_emit(obj, "efl,panes,fixed", "efl");
}
else
{
- elm_layout_signal_emit(obj, "elm,panes,unfixed", "elm");
+ if (elm_widget_is_legacy(obj))
+ {
+ elm_layout_signal_emit(obj, "elm,panes,unfixed", "elm");
- //TODO: remove this signal on EFL 2.0.
- // I left this due to the backward compatibility.
- elm_layout_signal_emit(obj, "elm.panes.unfixed", "elm");
+ //TODO: remove this signal on EFL 2.0.
+ // I left this due to the backward compatibility.
+ elm_layout_signal_emit(obj, "elm.panes.unfixed", "elm");
+ }
+ else
+ elm_layout_signal_emit(obj, "efl,panes,unfixed", "efl");
}
}
EOLIAN static Eina_Bool
-_efl_ui_panes_fixed_get(Eo *obj EINA_UNUSED, Efl_Ui_Panes_Data *sd)
+_efl_ui_panes_fixed_get(const Eo *obj EINA_UNUSED, Efl_Ui_Panes_Data *sd)
{
return sd->fixed;
}
-static void
-_efl_ui_panes_class_constructor(Efl_Class *klass)
-{
- evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
-}
-
/* Efl.Part begin */
static Eina_Bool
@@ -586,7 +649,7 @@ _efl_ui_panes_part_hint_min_allow_set(Eo *obj, void *_pd EINA_UNUSED, Eina_Bool
}
EOLIAN static Eina_Bool
-_efl_ui_panes_part_hint_min_allow_get(Eo *obj, void *_pd EINA_UNUSED)
+_efl_ui_panes_part_hint_min_allow_get(const Eo *obj, void *_pd EINA_UNUSED)
{
Eina_Bool ret = EINA_FALSE;
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
@@ -605,7 +668,7 @@ _efl_ui_panes_part_hint_min_allow_get(Eo *obj, void *_pd EINA_UNUSED)
}
EOLIAN static double
-_efl_ui_panes_part_split_ratio_min_get(Eo *obj, void *_pd EINA_UNUSED)
+_efl_ui_panes_part_split_ratio_min_get(const Eo *obj, void *_pd EINA_UNUSED)
{
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
Efl_Ui_Panes_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_PANES_CLASS);
@@ -652,19 +715,36 @@ ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(efl_ui_panes)
ELM_LAYOUT_CONTENT_ALIASES_OPS(efl_ui_panes), \
ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_panes)
-/* Legacy APIs */
+#include "efl_ui_panes.eo.c"
+
+#include "efl_ui_panes_legacy.eo.h"
+#define MY_CLASS_NAME_LEGACY "elm_panes"
+
+static void
+_efl_ui_panes_legacy_class_constructor(Efl_Class *klass)
+{
+ evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
+}
+
+EOLIAN static Eo *
+_efl_ui_panes_legacy_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED)
+{
+ obj = efl_constructor(efl_super(obj, EFL_UI_PANES_LEGACY_CLASS));
+ efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
+ return obj;
+}
EAPI Evas_Object *
elm_panes_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return elm_legacy_add(MY_CLASS, parent);
+ return elm_legacy_add(EFL_UI_PANES_LEGACY_CLASS, parent);
}
EAPI void
elm_panes_content_left_min_size_set(Evas_Object *obj, int size)
{
- EFL_UI_PANES_DATA_GET(obj, sd);
+ EFL_UI_PANES_DATA_GET_OR_RETURN(obj, sd);
sd->left_min_size = size;
if (sd->left_min_size < 0) sd->left_min_size = 0;
@@ -675,14 +755,14 @@ elm_panes_content_left_min_size_set(Evas_Object *obj, int size)
EAPI int
elm_panes_content_left_min_size_get(const Evas_Object *obj)
{
- EFL_UI_PANES_DATA_GET(obj, sd);
+ EFL_UI_PANES_DATA_GET_OR_RETURN_VAL(obj, sd, 0);
return sd->left_min_size;
}
EAPI void
elm_panes_content_right_min_size_set(Evas_Object *obj, int size)
{
- EFL_UI_PANES_DATA_GET(obj, sd);
+ EFL_UI_PANES_DATA_GET_OR_RETURN(obj, sd);
sd->right_min_size = size;
if (sd->right_min_size < 0) sd->right_min_size = 0;
@@ -693,7 +773,7 @@ elm_panes_content_right_min_size_set(Evas_Object *obj, int size)
EAPI int
elm_panes_content_right_min_size_get(const Evas_Object *obj)
{
- EFL_UI_PANES_DATA_GET(obj, sd);
+ EFL_UI_PANES_DATA_GET_OR_RETURN_VAL(obj, sd, 0);
return sd->right_min_size;
}
@@ -712,6 +792,8 @@ elm_panes_content_left_size_set(Evas_Object *obj, double size)
EAPI double
elm_panes_content_right_size_get(const Evas_Object *obj)
{
+ EFL_UI_PANES_CHECK(obj) 0.0;
+
return 1.0 - elm_panes_content_left_size_get(obj);
}
@@ -724,7 +806,7 @@ elm_panes_content_right_size_set(Evas_Object *obj, double size)
EAPI void
elm_panes_content_left_min_relative_size_set(Evas_Object *obj, double size)
{
- EFL_UI_PANES_DATA_GET(obj, sd);
+ EFL_UI_PANES_DATA_GET_OR_RETURN(obj, sd);
sd->left_min_relative_size = size;
if (sd->left_min_relative_size < 0) sd->left_min_relative_size = 0;
sd->left_min_size_is_relative = EINA_TRUE;
@@ -734,14 +816,14 @@ elm_panes_content_left_min_relative_size_set(Evas_Object *obj, double size)
EAPI double
elm_panes_content_left_min_relative_size_get(const Evas_Object *obj)
{
- EFL_UI_PANES_DATA_GET(obj, sd);
+ EFL_UI_PANES_DATA_GET_OR_RETURN_VAL(obj, sd, 0.0);
return sd->left_min_relative_size;
}
EAPI void
elm_panes_content_right_min_relative_size_set(Evas_Object *obj, double size)
{
- EFL_UI_PANES_DATA_GET(obj, sd);
+ EFL_UI_PANES_DATA_GET_OR_RETURN(obj, sd);
sd->right_min_relative_size = size;
if (sd->right_min_relative_size < 0) sd->right_min_relative_size = 0;
@@ -752,13 +834,15 @@ elm_panes_content_right_min_relative_size_set(Evas_Object *obj, double size)
EAPI double
elm_panes_content_right_min_relative_size_get(const Evas_Object *obj)
{
- EFL_UI_PANES_DATA_GET(obj, sd);
+ EFL_UI_PANES_DATA_GET_OR_RETURN_VAL(obj, sd, 0.0);
return sd->right_min_relative_size;
}
EAPI void
elm_panes_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
{
+ EFL_UI_PANES_CHECK(obj);
+
Efl_Ui_Dir dir;
if (horizontal)
@@ -772,6 +856,8 @@ elm_panes_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
EAPI Eina_Bool
elm_panes_horizontal_get(const Evas_Object *obj)
{
+ EFL_UI_PANES_CHECK(obj) EINA_FALSE;
+
Efl_Ui_Dir dir = efl_ui_direction_get(obj);
if (dir == EFL_UI_DIR_HORIZONTAL)
@@ -818,6 +904,4 @@ elm_panes_content_right_unset(Evas_Object *obj)
return elm_layout_content_unset(obj, "right");
}
-/* Legacy APIs end */
-
-#include "efl_ui_panes.eo.c"
+#include "efl_ui_panes_legacy.eo.c"
diff --git a/src/lib/elementary/efl_ui_panes.eo b/src/lib/elementary/efl_ui_panes.eo
index 6d98aae940..73abf1a911 100644
--- a/src/lib/elementary/efl_ui_panes.eo
+++ b/src/lib/elementary/efl_ui_panes.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Panes (Efl.Ui.Layout, Efl.Ui.Direction,
+class Efl.Ui.Panes (Efl.Ui.Layout.Object, Efl.Ui.Direction,
Efl.Ui.Clickable)
{
[[Elementary panes class]]
@@ -44,15 +44,18 @@ class Efl.Ui.Panes (Efl.Ui.Layout, Efl.Ui.Direction,
}
}
}
+ parts {
+ first: Efl.Ui.Panes_Part; [[The first half of the panes widget (left or top)]]
+ second: Efl.Ui.Panes_Part; [[The second half of the panes widget (right or bottom)]]
+ }
implements {
- class.constructor;
Efl.Object.constructor;
- Elm.Widget.theme_apply;
+ Efl.Ui.Widget.theme_apply;
Efl.Ui.Direction.direction { get; set; [[Only supports $vertical and $horizontal. Default is $vertical.]] }
- Efl.Part.part;
+ Efl.Part.part_get;
}
events {
- press; [[Called when panes got pressed]]
- unpress; [[Called when panes are no longer pressed]]
+ press: void; [[Called when panes got pressed]]
+ unpress: void; [[Called when panes are no longer pressed]]
}
}
diff --git a/src/lib/elementary/efl_ui_panes_legacy.eo b/src/lib/elementary/efl_ui_panes_legacy.eo
new file mode 100644
index 0000000000..704f70952c
--- /dev/null
+++ b/src/lib/elementary/efl_ui_panes_legacy.eo
@@ -0,0 +1,9 @@
+class Efl.Ui.Panes_Legacy(Efl.Ui.Panes, Efl.Ui.Legacy)
+{
+ [[Elementary panes class]]
+ data: null;
+ implements {
+ class.constructor;
+ Efl.Object.constructor;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_panes_part.eo b/src/lib/elementary/efl_ui_panes_part.eo
index f025e1d9f7..b6a2138bbe 100644
--- a/src/lib/elementary/efl_ui_panes_part.eo
+++ b/src/lib/elementary/efl_ui_panes_part.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Panes.Part (Efl.Ui.Layout.Part_Content)
+class Efl.Ui.Panes_Part (Efl.Ui.Layout.Part_Content)
{
[[Elementary Panes internal part class]]
data: null;
@@ -6,7 +6,7 @@ class Efl.Ui.Panes.Part (Efl.Ui.Layout.Part_Content)
@property hint_min_allow {
[[Allows the user to set size hints to be respected and ignored combined
with a minimum size. If this flag is set, the minimum size set by
- @Efl.Gfx.Size.Hint.hint_min.set is respected forcefully.
+ @Efl.Gfx.Size_Hint.hint_min.set is respected forcefully.
]]
values {
allow: bool; [[If $true minimum size is forced]]
@@ -15,7 +15,7 @@ class Efl.Ui.Panes.Part (Efl.Ui.Layout.Part_Content)
@property split_ratio_min {
[[Controls the relative minimum size of panes widget's part.
- If @Efl.Gfx.Size.Hint.hint_min.set is also used along with
+ If @Efl.Gfx.Size_Hint.hint_min.set is also used along with
@.split_ratio_min.set, maximum value is set as minimum size to part.
]]
values {
diff --git a/src/lib/elementary/efl_ui_panes_private.h b/src/lib/elementary/efl_ui_panes_private.h
index c675237165..a95c3ba6e0 100644
--- a/src/lib/elementary/efl_ui_panes_private.h
+++ b/src/lib/elementary/efl_ui_panes_private.h
@@ -61,7 +61,7 @@ struct _Efl_Ui_Panes_Data
EFL_UI_PANES_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -70,7 +70,7 @@ struct _Efl_Ui_Panes_Data
EFL_UI_PANES_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/efl_ui_popup.c b/src/lib/elementary/efl_ui_popup.c
index c5cf4f54dd..1ff2e850a2 100644
--- a/src/lib/elementary/efl_ui_popup.c
+++ b/src/lib/elementary/efl_ui_popup.c
@@ -2,7 +2,9 @@
# include "elementary_config.h"
#endif
+#define EFL_PART_PROTECTED
#define EFL_UI_POPUP_PROTECTED
+#define EFL_PART_PROTECTED
#include <Elementary.h>
@@ -27,10 +29,10 @@ _backwall_clicked_cb(void *data,
}
EOLIAN static void
-_efl_ui_popup_efl_gfx_position_set(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED, Eina_Position2D pos)
+_efl_ui_popup_efl_gfx_entity_position_set(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED, Eina_Position2D pos)
{
pd->align = EFL_UI_POPUP_ALIGN_NONE;
- efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
}
static void
@@ -38,9 +40,9 @@ _calc_align(Eo *obj)
{
Efl_Ui_Popup_Data *pd = efl_data_scope_get(obj, MY_CLASS);
- Eina_Rect p_geom = efl_gfx_geometry_get(pd->win_parent);
+ Eina_Rect p_geom = efl_gfx_entity_geometry_get(pd->win_parent);
- Eina_Rect o_geom = efl_gfx_geometry_get(obj);
+ Eina_Rect o_geom = efl_gfx_entity_geometry_get(obj);
Evas_Coord pw, ph;
pw = p_geom.w;
@@ -53,19 +55,19 @@ _calc_align(Eo *obj)
switch (pd->align)
{
case EFL_UI_POPUP_ALIGN_CENTER:
- efl_gfx_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D((pw - ow ) / 2, (ph - oh) / 2));
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D((pw - ow ) / 2, (ph - oh) / 2));
break;
case EFL_UI_POPUP_ALIGN_LEFT:
- efl_gfx_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D(0, (ph - oh) / 2));
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D(0, (ph - oh) / 2));
break;
case EFL_UI_POPUP_ALIGN_RIGHT:
- efl_gfx_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D(pw - ow, (ph - oh) / 2));
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D(pw - ow, (ph - oh) / 2));
break;
case EFL_UI_POPUP_ALIGN_TOP:
- efl_gfx_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D((pw - ow) / 2, 0));
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D((pw - ow) / 2, 0));
break;
case EFL_UI_POPUP_ALIGN_BOTTOM:
- efl_gfx_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D((pw - ow) / 2, ph - oh));
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D((pw - ow) / 2, ph - oh));
break;
default:
break;
@@ -73,9 +75,9 @@ _calc_align(Eo *obj)
}
EOLIAN static void
-_efl_ui_popup_efl_gfx_size_set(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED, Eina_Size2D size)
+_efl_ui_popup_efl_gfx_entity_size_set(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED, Eina_Size2D size)
{
- efl_gfx_size_set(efl_super(obj, MY_CLASS), size);
+ efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), size);
elm_layout_sizing_eval(obj);
}
@@ -94,7 +96,7 @@ _parent_geom_cb(void *data, const Efl_Event *ev EINA_UNUSED)
}
EOLIAN static void
-_efl_ui_popup_elm_widget_widget_parent_set(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED, Eo *parent EINA_UNUSED)
+_efl_ui_popup_efl_ui_widget_widget_parent_set(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED, Eo *parent EINA_UNUSED)
{
pd->win_parent = efl_provider_find(obj, EFL_UI_WIN_CLASS);
if (!pd->win_parent)
@@ -103,13 +105,13 @@ _efl_ui_popup_elm_widget_widget_parent_set(Eo *obj, Efl_Ui_Popup_Data *pd EINA_U
return;
}
- Eina_Rect p_geom = efl_gfx_geometry_get(pd->win_parent);
+ Eina_Rect p_geom = efl_gfx_entity_geometry_get(pd->win_parent);
- efl_gfx_position_set(pd->backwall, EINA_POSITION2D(p_geom.x, p_geom.y));
- efl_gfx_size_set(pd->backwall, EINA_SIZE2D(p_geom.w, p_geom.h));
+ efl_gfx_entity_position_set(pd->backwall, EINA_POSITION2D(p_geom.x, p_geom.y));
+ efl_gfx_entity_size_set(pd->backwall, EINA_SIZE2D(p_geom.w, p_geom.h));
- efl_event_callback_add(pd->win_parent, EFL_GFX_EVENT_RESIZE, _parent_geom_cb, obj);
- efl_event_callback_add(pd->win_parent, EFL_GFX_EVENT_MOVE, _parent_geom_cb, obj);
+ efl_event_callback_add(pd->win_parent, EFL_GFX_ENTITY_EVENT_RESIZE, _parent_geom_cb, obj);
+ efl_event_callback_add(pd->win_parent, EFL_GFX_ENTITY_EVENT_MOVE, _parent_geom_cb, obj);
}
EOLIAN static void
@@ -124,7 +126,7 @@ _efl_ui_popup_align_set(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Data *pd, Efl_Ui_Popup
}
EOLIAN static Efl_Ui_Popup_Align
-_efl_ui_popup_align_get(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Data *pd)
+_efl_ui_popup_align_get(const Eo *obj EINA_UNUSED, Efl_Ui_Popup_Data *pd)
{
return pd->align;
}
@@ -132,13 +134,13 @@ _efl_ui_popup_align_get(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Data *pd)
EOLIAN static void
_efl_ui_popup_popup_size_set(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED, Eina_Size2D size)
{
- efl_gfx_size_set(obj, size);
+ efl_gfx_entity_size_set(obj, size);
}
EOLIAN static Eina_Size2D
-_efl_ui_popup_popup_size_get(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED)
+_efl_ui_popup_popup_size_get(const Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED)
{
- return efl_gfx_size_get(obj);
+ return efl_gfx_entity_size_get(obj);
}
static Eina_Bool
@@ -169,12 +171,12 @@ _timer_init(Eo *obj, Efl_Ui_Popup_Data *pd)
}
EOLIAN static void
-_efl_ui_popup_efl_gfx_visible_set(Eo *obj, Efl_Ui_Popup_Data *pd, Eina_Bool v)
+_efl_ui_popup_efl_gfx_entity_visible_set(Eo *obj, Efl_Ui_Popup_Data *pd, Eina_Bool v)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 0, v))
return;
- efl_gfx_visible_set(efl_super(obj, MY_CLASS), v);
+ efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), v);
if (v)
{
@@ -193,12 +195,12 @@ _efl_ui_popup_timeout_set(Eo *obj, Efl_Ui_Popup_Data *pd, double time)
_timer_del(pd);
- if (efl_gfx_visible_get(obj))
+ if (efl_gfx_entity_visible_get(obj))
_timer_init(obj, pd);
}
EOLIAN static double
-_efl_ui_popup_timeout_get(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Data *pd)
+_efl_ui_popup_timeout_get(const Eo *obj EINA_UNUSED, Efl_Ui_Popup_Data *pd)
{
return pd->timeout;
}
@@ -227,7 +229,7 @@ _efl_ui_popup_efl_object_constructor(Eo *obj, Efl_Ui_Popup_Data *pd)
evas_object_smart_member_add(pd->backwall, obj);
evas_object_stack_below(pd->backwall, wd->resize_obj);
- edje_object_signal_callback_add(pd->backwall, "elm,action,clicked", "*",
+ edje_object_signal_callback_add(pd->backwall, "efl,action,clicked", "*",
_backwall_clicked_cb, obj);
pd->align = EFL_UI_POPUP_ALIGN_CENTER;
@@ -240,9 +242,9 @@ _efl_ui_popup_efl_object_destructor(Eo *obj, Efl_Ui_Popup_Data *pd)
{
ELM_SAFE_DEL(pd->backwall);
- efl_event_callback_del(pd->win_parent, EFL_GFX_EVENT_RESIZE, _parent_geom_cb,
+ efl_event_callback_del(pd->win_parent, EFL_GFX_ENTITY_EVENT_RESIZE, _parent_geom_cb,
obj);
- efl_event_callback_del(pd->win_parent, EFL_GFX_EVENT_MOVE, _parent_geom_cb,
+ efl_event_callback_del(pd->win_parent, EFL_GFX_ENTITY_EVENT_MOVE, _parent_geom_cb,
obj);
efl_destructor(efl_super(obj, MY_CLASS));
@@ -259,12 +261,12 @@ _sizing_eval(Eo *obj)
(wd->resize_obj, &minw, &minh, minw, minh);
efl_gfx_size_hint_min_set(obj, EINA_SIZE2D(minw, minh));
- Eina_Size2D size = efl_gfx_size_get(obj);
+ Eina_Size2D size = efl_gfx_entity_size_get(obj);
Eina_Size2D new_size;
new_size.w = (minw > size.w ? minw : size.w);
new_size.h = (minh > size.h ? minh : size.h);
- efl_gfx_size_set(obj, new_size);
+ efl_gfx_entity_size_set(obj, new_size);
}
EOLIAN static void
@@ -307,10 +309,10 @@ _efl_ui_popup_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Popup_Data *pd)
pd->needs_align_calc = EINA_FALSE;
}
- Eina_Rect p_geom = efl_gfx_geometry_get(pd->win_parent);
+ Eina_Rect p_geom = efl_gfx_entity_geometry_get(pd->win_parent);
- efl_gfx_position_set(pd->backwall, EINA_POSITION2D(0, 0));
- efl_gfx_size_set(pd->backwall, EINA_SIZE2D(p_geom.w, p_geom.h));
+ efl_gfx_entity_position_set(pd->backwall, EINA_POSITION2D(0, 0));
+ efl_gfx_entity_size_set(pd->backwall, EINA_SIZE2D(p_geom.w, p_geom.h));
pd->needs_group_calc = EINA_FALSE;
}
@@ -318,18 +320,17 @@ _efl_ui_popup_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Popup_Data *pd)
/* Standard widget overrides */
-ELM_PART_CONTENT_DEFAULT_GET(efl_ui_popup, "elm.swallow.content")
ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_popup, Efl_Ui_Popup_Data)
EOLIAN static Eo *
-_efl_ui_popup_efl_part_part(const Eo *obj, Efl_Ui_Popup_Data *_pd EINA_UNUSED, const char *part)
+_efl_ui_popup_efl_part_part_get(const Eo *obj, Efl_Ui_Popup_Data *_pd EINA_UNUSED, const char *part)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
if (eina_streq(part, "backwall"))
return ELM_PART_IMPLEMENT(EFL_UI_POPUP_PART_CLASS, obj, part);
- return efl_part(efl_super(obj, MY_CLASS), part);
+ return efl_part_get(efl_super(obj, MY_CLASS), part);
}
EOLIAN static void
@@ -345,7 +346,7 @@ _efl_ui_popup_part_efl_canvas_object_repeat_events_set(Eo *obj, void *_pd EINA_U
}
EOLIAN static Eina_Bool
-_efl_ui_popup_part_efl_canvas_object_repeat_events_get(Eo *obj, void *_pd EINA_UNUSED)
+_efl_ui_popup_part_efl_canvas_object_repeat_events_get(const Eo *obj, void *_pd EINA_UNUSED)
{
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
Efl_Ui_Popup_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_POPUP_CLASS);
@@ -364,9 +365,10 @@ _efl_ui_popup_part_efl_file_file_set(Eo *obj, void *_pd EINA_UNUSED, const char
if (eina_streq(pd->part, "backwall"))
{
- Eo *prev_obj = edje_object_part_swallow_get(sd->backwall, "elm.swallow.image");
+ Eo *prev_obj = edje_object_part_swallow_get(sd->backwall, "efl.content");
if (prev_obj)
{
+ edje_object_signal_emit(sd->backwall, "efl,state,content,unset", "efl");
edje_object_part_unswallow(sd->backwall, prev_obj);
efl_del(prev_obj);
}
@@ -375,12 +377,11 @@ _efl_ui_popup_part_efl_file_file_set(Eo *obj, void *_pd EINA_UNUSED, const char
Eina_Bool ret = elm_image_file_set(image, file, group);
if (!ret)
{
- edje_object_signal_emit(sd->backwall, "elm,state,image,hidden", "elm");
efl_del(image);
return EINA_FALSE;
}
- edje_object_part_swallow(sd->backwall, "elm.swallow.image", image);
- edje_object_signal_emit(sd->backwall, "elm,state,image,visible", "elm");
+ edje_object_part_swallow(sd->backwall, "efl.content", image);
+ edje_object_signal_emit(sd->backwall, "efl,state,content,set", "efl");
return EINA_TRUE;
}
diff --git a/src/lib/elementary/efl_ui_popup.eo b/src/lib/elementary/efl_ui_popup.eo
index 62067e74e3..235b98e1e3 100644
--- a/src/lib/elementary/efl_ui_popup.eo
+++ b/src/lib/elementary/efl_ui_popup.eo
@@ -1,4 +1,4 @@
-enum Efl.Ui.Popup.Align {
+enum Efl.Ui.Popup_Align {
[[Popup alignment type]]
none = 0, [[Popup not aligned]]
center, [[Popup aligned to center]]
@@ -8,7 +8,7 @@ enum Efl.Ui.Popup.Align {
bottom [[Popup aligned to bottom]]
}
-class Efl.Ui.Popup(Efl.Ui.Layout, Efl.Content)
+class Efl.Ui.Popup(Efl.Ui.Layout.Object, Efl.Content)
{
[[EFL UI popup class]]
methods {
@@ -20,7 +20,7 @@ class Efl.Ui.Popup(Efl.Ui.Layout, Efl.Content)
[[ Get the current popup alignment.]]
}
values {
- type: Efl.Ui.Popup.Align; [[Alignment type]]
+ type: Efl.Ui.Popup_Align; [[Alignment type]]
}
}
@property timeout {
@@ -49,22 +49,22 @@ class Efl.Ui.Popup(Efl.Ui.Layout, Efl.Content)
}
}
parts {
- backwall: Efl.Ui.Popup.Part; [[A backwall behind the popup.]]
+ backwall: Efl.Ui.Popup_Part; [[A backwall behind the popup.]]
}
implements {
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Canvas.Group.group_calculate;
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set;}
- Efl.Gfx.visible { set; }
- Elm.Widget.widget_parent { set; }
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set;}
+ Efl.Gfx.Entity.visible { set; }
+ Efl.Ui.Widget.widget_parent { set; }
Efl.Content.content { get; set; }
Efl.Content.content_unset;
- Efl.Part.part;
+ Efl.Part.part_get;
}
events {
- backwall,clicked; [[This is called whenever the user clicks back wall of popup.]]
- timeout; [[This is called when popup times out.]]
+ backwall,clicked: void; [[This is called whenever the user clicks back wall of popup.]]
+ timeout: void; [[This is called when popup times out.]]
}
}
diff --git a/src/lib/elementary/efl_ui_popup_alert.c b/src/lib/elementary/efl_ui_popup_alert.c
index 25ba2208fe..ad58030f3a 100644
--- a/src/lib/elementary/efl_ui_popup_alert.c
+++ b/src/lib/elementary/efl_ui_popup_alert.c
@@ -2,6 +2,8 @@
# include "elementary_config.h"
#endif
+#define EFL_PART_PROTECTED
+
#include <Elementary.h>
#include "elm_priv.h"
@@ -19,23 +21,23 @@ static const char PART_NAME_BUTTON_LAYOUT[EFL_UI_POPUP_ALERT_BUTTON_COUNT][15] =
"button_layout3"};
static const char BUTTON_SWALLOW_NAME[EFL_UI_POPUP_ALERT_BUTTON_COUNT][20] =
- {"elm.swallow.button1",
- "elm.swallow.button2",
- "elm.swallow.button3"};
+ {"efl.button1",
+ "efl.button2",
+ "efl.button3"};
static Eina_Bool
_efl_ui_popup_alert_text_set(Eo *obj, Efl_Ui_Popup_Alert_Data *pd, const char *part, const char *label)
{
- if (eina_streq(part, "title") || eina_streq(part, "elm.text.title"))
+ if (eina_streq(part, "title") || eina_streq(part, "efl.text.title"))
{
Eina_Bool changed = eina_stringshare_replace(&pd->title_text, label);
if (changed)
{
efl_text_set(efl_part(efl_super(obj, MY_CLASS), "title"), label);
if (label)
- elm_layout_signal_emit(obj, "elm,title,show", "elm");
+ elm_layout_signal_emit(obj, "efl,title,show", "efl");
else
- elm_layout_signal_emit(obj, "elm,title,hide", "elm");
+ elm_layout_signal_emit(obj, "efl,title,hide", "efl");
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
edje_object_message_signal_process(wd->resize_obj);
@@ -51,7 +53,7 @@ _efl_ui_popup_alert_text_set(Eo *obj, Efl_Ui_Popup_Alert_Data *pd, const char *p
const char *
_efl_ui_popup_alert_text_get(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Alert_Data *pd, const char *part)
{
- if (eina_streq(part, "title") || eina_streq(part, "elm.text.title"))
+ if (eina_streq(part, "title") || eina_streq(part, "efl.text.title"))
{
if (pd->title_text)
return pd->title_text;
@@ -132,7 +134,7 @@ _efl_ui_popup_alert_button_set(Eo *obj, Efl_Ui_Popup_Alert_Data *pd, Efl_Ui_Popu
}
efl_text_set(pd->button[type], text);
- cur_content = efl_content_get(efl_part(obj, "buttons"));
+ cur_content = efl_content_get(efl_part(obj, "efl.buttons"));
if (cur_content)
{
for (i = 0; i < EFL_UI_POPUP_ALERT_BUTTON_COUNT; i++)
@@ -140,8 +142,8 @@ _efl_ui_popup_alert_button_set(Eo *obj, Efl_Ui_Popup_Alert_Data *pd, Efl_Ui_Popu
}
else
{
- cur_content = efl_add(EFL_UI_LAYOUT_CLASS, obj,
- efl_content_set(efl_part(obj, "buttons"), efl_added));
+ cur_content = efl_add(EFL_UI_LAYOUT_OBJECT_CLASS, obj,
+ efl_content_set(efl_part(obj, "efl.buttons"), efl_added));
}
int btn_count = !!pd->button[EFL_UI_POPUP_ALERT_BUTTON_POSITIVE] +
@@ -168,7 +170,7 @@ _efl_ui_popup_alert_button_set(Eo *obj, Efl_Ui_Popup_Alert_Data *pd, Efl_Ui_Popu
pd->button[EFL_UI_POPUP_ALERT_BUTTON_NEGATIVE]);
}
- elm_layout_signal_emit(obj, "elm,buttons,show", "elm");
+ elm_layout_signal_emit(obj, "efl,buttons,show", "efl");
edje_object_message_signal_process(wd->resize_obj);
elm_layout_sizing_eval(obj);
}
@@ -199,7 +201,7 @@ _efl_ui_popup_alert_efl_object_destructor(Eo *obj, Efl_Ui_Popup_Alert_Data *pd)
static Eina_Bool
_part_is_efl_ui_popup_alert_part(const Eo *obj EINA_UNUSED, const char *part)
{
- return (eina_streq(part, "title") || eina_streq(part, "elm.text.title"));
+ return (eina_streq(part, "title") || eina_streq(part, "efl.text.title"));
}
/* Efl.Part begin */
diff --git a/src/lib/elementary/efl_ui_popup_alert.eo b/src/lib/elementary/efl_ui_popup_alert.eo
index 344eb8c106..837f9a91a1 100644
--- a/src/lib/elementary/efl_ui_popup_alert.eo
+++ b/src/lib/elementary/efl_ui_popup_alert.eo
@@ -1,13 +1,13 @@
-enum Efl.Ui.Popup_Alert.Button {
+enum Efl.Ui.Popup_Alert_Button {
[[Defines the type of the alert button.]]
positive = 0, [[Button having positive meaning. e.g. "Yes"]]
negative, [[Button having negative meaning. e.g. "No"]]
user [[Button having user-defined meaning. e.g. "Cancel"]]
}
-struct Efl.Ui.Popup_Alert.Button.Clicked_Event {
+struct Efl.Ui.Popup_Alert_Button_Clicked_Event {
[[Information of clicked event]]
- button_type: Efl.Ui.Popup_Alert.Button; [[Clicked button type]]
+ button_type: Efl.Ui.Popup_Alert_Button; [[Clicked button type]]
}
class Efl.Ui.Popup_Alert(Efl.Ui.Popup)
@@ -19,7 +19,7 @@ class Efl.Ui.Popup_Alert(Efl.Ui.Popup)
[[Set popup buttons.]]
}
keys {
- type: Efl.Ui.Popup_Alert.Button; [[Alert popup button type]]
+ type: Efl.Ui.Popup_Alert_Button; [[Alert popup button type]]
}
values {
text: string; [[Alert string on button]]
@@ -29,9 +29,9 @@ class Efl.Ui.Popup_Alert(Efl.Ui.Popup)
implements {
Efl.Object.constructor;
Efl.Object.destructor;
- Efl.Part.part;
+ Efl.Part.part_get;
}
events {
- button,clicked: Efl.Ui.Popup_Alert.Button.Clicked_Event; [[Called when alert popup was clicked]]
+ button,clicked: Efl.Ui.Popup_Alert_Button_Clicked_Event; [[Called when alert popup was clicked]]
}
}
diff --git a/src/lib/elementary/efl_ui_popup_alert_part.eo b/src/lib/elementary/efl_ui_popup_alert_part.eo
index 31198e1ce0..1ca02b96ff 100644
--- a/src/lib/elementary/efl_ui_popup_alert_part.eo
+++ b/src/lib/elementary/efl_ui_popup_alert_part.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Popup_Alert.Part (Efl.Ui.Layout.Part_Text)
+class Efl.Ui.Popup_Alert_Part (Efl.Ui.Layout.Part_Text)
{
[[Efl UI Popup Alert internal part class]]
data: null;
diff --git a/src/lib/elementary/efl_ui_popup_alert_scroll.c b/src/lib/elementary/efl_ui_popup_alert_scroll.c
index e6bcdcb4f2..90ca58f838 100644
--- a/src/lib/elementary/efl_ui_popup_alert_scroll.c
+++ b/src/lib/elementary/efl_ui_popup_alert_scroll.c
@@ -3,6 +3,7 @@
#endif
#define EFL_UI_POPUP_ALERT_SCROLL_BETA
+#define EFL_PART_PROTECTED
#include <Elementary.h>
@@ -37,20 +38,20 @@ _scroller_sizing_eval(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd,
if ((max_size.w == -1) && (max_size.h == -1))
{
elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE);
- efl_gfx_size_set(obj, size);
+ efl_gfx_entity_size_set(obj, size);
}
else if ((max_size.w == -1) && (max_size.h != -1))
{
if (max_size.h < scr_min.h)
{
elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE);
- efl_gfx_size_set(obj, EINA_SIZE2D(size.w, max_size.h));
+ efl_gfx_entity_size_set(obj, EINA_SIZE2D(size.w, max_size.h));
}
else
{
new_min.h = scr_min.h;
elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_TRUE);
- efl_gfx_size_set(obj, EINA_SIZE2D(size.w, scr_min.h));
+ efl_gfx_entity_size_set(obj, EINA_SIZE2D(size.w, scr_min.h));
}
}
else if ((max_size.w != -1) && (max_size.h == -1))
@@ -58,13 +59,13 @@ _scroller_sizing_eval(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd,
if (max_size.w < scr_min.w)
{
elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE);
- efl_gfx_size_set(obj, EINA_SIZE2D(max_size.w, size.h));
+ efl_gfx_entity_size_set(obj, EINA_SIZE2D(max_size.w, size.h));
}
else
{
new_min.w = scr_min.w;
elm_scroller_content_min_limit(pd->scroller, EINA_TRUE, EINA_FALSE);
- efl_gfx_size_set(obj, EINA_SIZE2D(scr_min.w, size.h));
+ efl_gfx_entity_size_set(obj, EINA_SIZE2D(scr_min.w, size.h));
}
}
else if ((max_size.w != -1) && (max_size.h != -1))
@@ -96,7 +97,7 @@ _scroller_sizing_eval(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd,
}
elm_scroller_content_min_limit(pd->scroller, min_limit_w, min_limit_h);
- efl_gfx_size_set(obj, new_size);
+ efl_gfx_entity_size_set(obj, new_size);
}
efl_gfx_size_hint_min_set(obj, new_min);
@@ -154,7 +155,7 @@ static Eina_Bool
_efl_ui_popup_alert_scroll_content_set(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd, const char *part, Eo *content)
{
//For efl_content_set()
- if (part && !strcmp(part, "elm.swallow.content"))
+ if (part && !strcmp(part, "efl.content"))
{
pd->content = content;
@@ -162,7 +163,7 @@ _efl_ui_popup_alert_scroll_content_set(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *
efl_gfx_size_hint_weight_set(pd->content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
efl_gfx_size_hint_align_set(pd->content, EVAS_HINT_FILL, EVAS_HINT_FILL);
- efl_content_set(efl_part(pd->scroller, "default"), pd->content);
+ efl_content_set(pd->scroller, pd->content);
}
else
{
@@ -176,7 +177,7 @@ Eo *
_efl_ui_popup_alert_scroll_content_get(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd, const char *part)
{
//For efl_content_set()
- if (part && !strcmp(part, "elm.swallow.content"))
+ if (part && !strcmp(part, "efl.content"))
return pd->content;
return efl_content_get(efl_part(efl_super(obj, MY_CLASS), part));
@@ -186,14 +187,14 @@ static Eo *
_efl_ui_popup_alert_scroll_content_unset(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd, const char *part)
{
//For efl_content_set()
- if (part && !strcmp(part, "elm.swallow.content"))
+ if (part && !strcmp(part, "efl.content"))
{
Eo *content = pd->content;
if (!content) return content;
pd->content = NULL;
- return efl_content_unset(efl_part(pd->scroller, "default"));
+ return efl_content_unset(pd->scroller);
}
return efl_content_unset(efl_part(efl_super(obj, MY_CLASS), part));
@@ -240,7 +241,7 @@ _efl_ui_popup_alert_scroll_expandable_set(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Aler
}
static Eina_Size2D
-_efl_ui_popup_alert_scroll_expandable_get(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Alert_Scroll_Data *pd)
+_efl_ui_popup_alert_scroll_expandable_get(const Eo *obj EINA_UNUSED, Efl_Ui_Popup_Alert_Scroll_Data *pd)
{
return pd->max_size;
}
@@ -250,7 +251,7 @@ _efl_ui_popup_alert_scroll_efl_ui_popup_popup_size_set(Eo *obj, Efl_Ui_Popup_Ale
{
pd->size = size;
- efl_gfx_size_set(obj, size);
+ efl_gfx_entity_size_set(obj, size);
elm_layout_sizing_eval(obj);
}
@@ -273,7 +274,7 @@ _efl_ui_popup_alert_scroll_efl_object_constructor(Eo *obj,
elm_scroller_policy_set(pd->scroller, ELM_SCROLLER_POLICY_AUTO,
ELM_SCROLLER_POLICY_AUTO);
- efl_content_set(efl_part(efl_super(obj, MY_CLASS), "elm.swallow.content"),
+ efl_content_set(efl_part(efl_super(obj, MY_CLASS), "efl.content"),
pd->scroller);
pd->size = EINA_SIZE2D(0, 0);
diff --git a/src/lib/elementary/efl_ui_popup_alert_scroll.eo b/src/lib/elementary/efl_ui_popup_alert_scroll.eo
index f3f9e6ccb9..e27ba3590f 100644
--- a/src/lib/elementary/efl_ui_popup_alert_scroll.eo
+++ b/src/lib/elementary/efl_ui_popup_alert_scroll.eo
@@ -27,7 +27,7 @@ class Efl.Ui.Popup_Alert_Scroll(Efl.Ui.Popup_Alert)
implements {
Efl.Object.constructor;
Efl.Canvas.Group.group_calculate;
- Efl.Part.part;
+ Efl.Part.part_get;
Efl.Ui.Popup.popup_size { set;}
}
}
diff --git a/src/lib/elementary/efl_ui_popup_alert_scroll_part.eo b/src/lib/elementary/efl_ui_popup_alert_scroll_part.eo
index 1514b514df..b890b982a3 100644
--- a/src/lib/elementary/efl_ui_popup_alert_scroll_part.eo
+++ b/src/lib/elementary/efl_ui_popup_alert_scroll_part.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Popup_Alert_Scroll.Part (Efl.Ui.Layout.Part_Content, Efl.Ui.Layout.Part_Text)
+class Efl.Ui.Popup_Alert_Scroll_Part (Efl.Ui.Layout.Part_Content, Efl.Ui.Layout.Part_Text)
{
[[Efl UI Popup Alert Scroll internal part class]]
data: null;
diff --git a/src/lib/elementary/efl_ui_popup_alert_text.c b/src/lib/elementary/efl_ui_popup_alert_text.c
index c013847fda..3e74a5ab62 100644
--- a/src/lib/elementary/efl_ui_popup_alert_text.c
+++ b/src/lib/elementary/efl_ui_popup_alert_text.c
@@ -2,6 +2,8 @@
# include "elementary_config.h"
#endif
+#define EFL_PART_PROTECTED
+
#include <Elementary.h>
#include "elm_priv.h"
@@ -39,20 +41,20 @@ _scroller_sizing_eval(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd, Eina_Size2D obj
if ((max_size.w == -1) && (max_size.h == -1))
{
elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE);
- efl_gfx_size_set(obj, size);
+ efl_gfx_entity_size_set(obj, size);
}
else if ((max_size.w == -1) && (max_size.h != -1))
{
if (max_size.h < text_min.h)
{
elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE);
- efl_gfx_size_set(obj, EINA_SIZE2D(size.w, max_size.h));
+ efl_gfx_entity_size_set(obj, EINA_SIZE2D(size.w, max_size.h));
}
else
{
new_min.h = text_min.h;
elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_TRUE);
- efl_gfx_size_set(obj, EINA_SIZE2D(size.w, text_min.h));
+ efl_gfx_entity_size_set(obj, EINA_SIZE2D(size.w, text_min.h));
}
}
else if ((max_size.w != -1) && (max_size.h == -1))
@@ -60,13 +62,13 @@ _scroller_sizing_eval(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd, Eina_Size2D obj
if (max_size.w < text_min.w)
{
elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE);
- efl_gfx_size_set(obj, EINA_SIZE2D(max_size.w, size.h));
+ efl_gfx_entity_size_set(obj, EINA_SIZE2D(max_size.w, size.h));
}
else
{
new_min.w = text_min.w;
elm_scroller_content_min_limit(pd->scroller, EINA_TRUE, EINA_FALSE);
- efl_gfx_size_set(obj, EINA_SIZE2D(text_min.w, size.h));
+ efl_gfx_entity_size_set(obj, EINA_SIZE2D(text_min.w, size.h));
}
}
else if ((max_size.w != -1) && (max_size.h != -1))
@@ -98,7 +100,7 @@ _scroller_sizing_eval(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd, Eina_Size2D obj
}
elm_scroller_content_min_limit(pd->scroller, min_limit_w, min_limit_h);
- efl_gfx_size_set(obj, new_size);
+ efl_gfx_entity_size_set(obj, new_size);
}
efl_gfx_size_hint_min_set(obj, new_min);
@@ -109,7 +111,7 @@ _efl_ui_popup_alert_text_efl_ui_popup_popup_size_set(Eo *obj, Efl_Ui_Popup_Alert
{
pd->size = size;
- efl_gfx_size_set(obj, size);
+ efl_gfx_entity_size_set(obj, size);
elm_layout_sizing_eval(obj);
}
@@ -189,7 +191,7 @@ _efl_ui_popup_alert_text_content_unset(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd
static Eina_Bool
_efl_ui_popup_alert_text_text_set(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd, const char *part, const char *label)
{
- if (part && !strcmp(part, "elm.text"))
+ if (part && !strcmp(part, "efl.text"))
{
if (!pd->message)
{
@@ -198,7 +200,7 @@ _efl_ui_popup_alert_text_text_set(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd, con
//elm_widget_element_update(obj, pd->message, PART_NAME_TEXT);
efl_gfx_size_hint_weight_set(pd->message, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
- efl_content_set(efl_part(pd->scroller, "default"), pd->message);
+ efl_content_set(pd->scroller, pd->message);
}
elm_object_text_set(pd->message, label);
elm_layout_sizing_eval(obj);
@@ -210,9 +212,9 @@ _efl_ui_popup_alert_text_text_set(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd, con
}
const char *
-_efl_ui_popup_alert_text_text_get(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Alert_Text_Data *pd, const char *part)
+_efl_ui_popup_alert_text_text_get(const Eo *obj EINA_UNUSED, Efl_Ui_Popup_Alert_Text_Data *pd, const char *part)
{
- if (part && !strcmp(part, "elm.text"))
+ if (part && !strcmp(part, "efl.text"))
{
if (pd->message)
return elm_object_text_get(pd->message);
@@ -226,13 +228,13 @@ _efl_ui_popup_alert_text_text_get(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Alert_Text_D
EOLIAN static void
_efl_ui_popup_alert_text_efl_text_text_set(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd, const char *label)
{
- _efl_ui_popup_alert_text_text_set(obj, pd, "elm.text", label);
+ _efl_ui_popup_alert_text_text_set(obj, pd, "efl.text", label);
}
EOLIAN static const char*
-_efl_ui_popup_alert_text_efl_text_text_get(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd)
+_efl_ui_popup_alert_text_efl_text_text_get(const Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd)
{
- return _efl_ui_popup_alert_text_text_get(obj, pd, "elm.text");
+ return _efl_ui_popup_alert_text_text_get(obj, pd, "efl.text");
}
static void
@@ -279,7 +281,7 @@ _efl_ui_popup_alert_text_efl_object_constructor(Eo *obj,
elm_scroller_policy_set(pd->scroller, ELM_SCROLLER_POLICY_OFF,
ELM_SCROLLER_POLICY_AUTO);
- efl_content_set(efl_part(efl_super(obj, MY_CLASS), "elm.swallow.content"),
+ efl_content_set(efl_part(efl_super(obj, MY_CLASS), "efl.content"),
pd->scroller);
pd->size = EINA_SIZE2D(0, 0);
diff --git a/src/lib/elementary/efl_ui_popup_alert_text.eo b/src/lib/elementary/efl_ui_popup_alert_text.eo
index 28c527946f..598b24fa6a 100644
--- a/src/lib/elementary/efl_ui_popup_alert_text.eo
+++ b/src/lib/elementary/efl_ui_popup_alert_text.eo
@@ -23,6 +23,6 @@ class Efl.Ui.Popup_Alert_Text(Efl.Ui.Popup_Alert, Efl.Text)
Efl.Canvas.Group.group_calculate;
Efl.Ui.Popup.popup_size { set;}
Efl.Text.text { get; set; }
- Efl.Part.part;
+ Efl.Part.part_get;
}
}
diff --git a/src/lib/elementary/efl_ui_popup_alert_text_part.eo b/src/lib/elementary/efl_ui_popup_alert_text_part.eo
index 6c2231aaca..236ef2fd0a 100644
--- a/src/lib/elementary/efl_ui_popup_alert_text_part.eo
+++ b/src/lib/elementary/efl_ui_popup_alert_text_part.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Popup_Alert_Text.Part (Efl.Ui.Layout.Part_Content, Efl.Ui.Layout.Part_Text)
+class Efl.Ui.Popup_Alert_Text_Part (Efl.Ui.Layout.Part_Content, Efl.Ui.Layout.Part_Text)
{
[[Efl UI Popup Alert Text internal part class]]
data: null;
diff --git a/src/lib/elementary/efl_ui_popup_anchor.c b/src/lib/elementary/efl_ui_popup_anchor.c
index 9112a0cc5b..750f3ea269 100644
--- a/src/lib/elementary/efl_ui_popup_anchor.c
+++ b/src/lib/elementary/efl_ui_popup_anchor.c
@@ -23,9 +23,9 @@ _anchor_calc(Eo *obj)
Eina_Position2D pos = {0, 0};
- Eina_Rect a_geom = efl_gfx_geometry_get(pd->anchor);
- Eina_Rect o_geom = efl_gfx_geometry_get(obj);
- Eina_Rect p_geom = efl_gfx_geometry_get(ppd->win_parent);
+ Eina_Rect a_geom = efl_gfx_entity_geometry_get(pd->anchor);
+ Eina_Rect o_geom = efl_gfx_entity_geometry_get(obj);
+ Eina_Rect p_geom = efl_gfx_entity_geometry_get(ppd->win_parent);
pd->used_align = EFL_UI_POPUP_ALIGN_NONE;
@@ -192,7 +192,7 @@ _anchor_calc(Eo *obj)
end:
if (pd->used_align != EFL_UI_POPUP_ALIGN_NONE)
- efl_gfx_position_set(efl_super(obj, EFL_UI_POPUP_CLASS), pos);
+ efl_gfx_entity_position_set(efl_super(obj, EFL_UI_POPUP_CLASS), pos);
}
static void
@@ -207,7 +207,7 @@ _anchor_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
EFL_UI_POPUP_DATA_GET_OR_RETURN(data, ppd);
EFL_UI_POPUP_ANCHOR_DATA_GET(data, pd);
- efl_event_callback_del(ppd->win_parent, EFL_GFX_EVENT_RESIZE, _anchor_geom_cb, data);
+ efl_event_callback_del(ppd->win_parent, EFL_GFX_ENTITY_EVENT_RESIZE, _anchor_geom_cb, data);
pd->anchor = NULL;
//Add align calc only
@@ -224,9 +224,9 @@ _anchor_detach(Eo *obj)
if (!pd->anchor) return;
- efl_event_callback_del(ppd->win_parent, EFL_GFX_EVENT_RESIZE, _anchor_geom_cb, obj);
- efl_event_callback_del(pd->anchor, EFL_GFX_EVENT_RESIZE, _anchor_geom_cb, obj);
- efl_event_callback_del(pd->anchor, EFL_GFX_EVENT_MOVE, _anchor_geom_cb, obj);
+ efl_event_callback_del(ppd->win_parent, EFL_GFX_ENTITY_EVENT_RESIZE, _anchor_geom_cb, obj);
+ efl_event_callback_del(pd->anchor, EFL_GFX_ENTITY_EVENT_RESIZE, _anchor_geom_cb, obj);
+ efl_event_callback_del(pd->anchor, EFL_GFX_ENTITY_EVENT_MOVE, _anchor_geom_cb, obj);
efl_event_callback_del(pd->anchor, EFL_EVENT_DEL, _anchor_del_cb, obj);
}
@@ -240,9 +240,9 @@ _efl_ui_popup_anchor_anchor_set(Eo *obj, Efl_Ui_Popup_Anchor_Data *pd, Eo *ancho
if (anchor)
{
- efl_event_callback_add(ppd->win_parent, EFL_GFX_EVENT_RESIZE, _anchor_geom_cb, obj);
- efl_event_callback_add(anchor, EFL_GFX_EVENT_RESIZE, _anchor_geom_cb, obj);
- efl_event_callback_add(anchor, EFL_GFX_EVENT_MOVE, _anchor_geom_cb, obj);
+ efl_event_callback_add(ppd->win_parent, EFL_GFX_ENTITY_EVENT_RESIZE, _anchor_geom_cb, obj);
+ efl_event_callback_add(anchor, EFL_GFX_ENTITY_EVENT_RESIZE, _anchor_geom_cb, obj);
+ efl_event_callback_add(anchor, EFL_GFX_ENTITY_EVENT_MOVE, _anchor_geom_cb, obj);
efl_event_callback_add(anchor, EFL_EVENT_DEL, _anchor_del_cb, obj);
}
@@ -253,7 +253,7 @@ _efl_ui_popup_anchor_anchor_set(Eo *obj, Efl_Ui_Popup_Anchor_Data *pd, Eo *ancho
}
EOLIAN static Efl_Object *
-_efl_ui_popup_anchor_anchor_get(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Anchor_Data *pd)
+_efl_ui_popup_anchor_anchor_get(const Eo *obj EINA_UNUSED, Efl_Ui_Popup_Anchor_Data *pd)
{
return pd->anchor;
}
@@ -275,7 +275,7 @@ _efl_ui_popup_anchor_align_priority_set(Eo *obj EINA_UNUSED,
}
EOLIAN static void
-_efl_ui_popup_anchor_align_priority_get(Eo *obj EINA_UNUSED,
+_efl_ui_popup_anchor_align_priority_get(const Eo *obj EINA_UNUSED,
Efl_Ui_Popup_Anchor_Data *pd,
Efl_Ui_Popup_Align *first,
Efl_Ui_Popup_Align *second,
@@ -291,13 +291,13 @@ _efl_ui_popup_anchor_align_priority_get(Eo *obj EINA_UNUSED,
}
EOLIAN static void
-_efl_ui_popup_anchor_efl_gfx_position_set(Eo *obj, Efl_Ui_Popup_Anchor_Data *pd, Eina_Position2D pos)
+_efl_ui_popup_anchor_efl_gfx_entity_position_set(Eo *obj, Efl_Ui_Popup_Anchor_Data *pd, Eina_Position2D pos)
{
_anchor_detach(obj);
pd->anchor = NULL;
- efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
}
EOLIAN static void
diff --git a/src/lib/elementary/efl_ui_popup_anchor.eo b/src/lib/elementary/efl_ui_popup_anchor.eo
index 1175f4437e..b47a7b2ada 100644
--- a/src/lib/elementary/efl_ui_popup_anchor.eo
+++ b/src/lib/elementary/efl_ui_popup_anchor.eo
@@ -25,11 +25,11 @@ class Efl.Ui.Popup_Anchor(Efl.Ui.Popup)
[[Get the align priority of a popup.]]
}
values {
- first: Efl.Ui.Popup.Align; [[First align priority]]
- second: Efl.Ui.Popup.Align; [[Second align priority]]
- third: Efl.Ui.Popup.Align; [[Third align priority]]
- fourth: Efl.Ui.Popup.Align; [[Fourth align priority]]
- fifth: Efl.Ui.Popup.Align; [[Fifth align priority]]
+ first: Efl.Ui.Popup_Align; [[First align priority]]
+ second: Efl.Ui.Popup_Align; [[Second align priority]]
+ third: Efl.Ui.Popup_Align; [[Third align priority]]
+ fourth: Efl.Ui.Popup_Align; [[Fourth align priority]]
+ fifth: Efl.Ui.Popup_Align; [[Fifth align priority]]
}
}
}
@@ -37,6 +37,6 @@ class Efl.Ui.Popup_Anchor(Efl.Ui.Popup)
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Canvas.Group.group_calculate;
- Efl.Gfx.position { set; }
+ Efl.Gfx.Entity.position { set; }
}
}
diff --git a/src/lib/elementary/efl_ui_popup_part.eo b/src/lib/elementary/efl_ui_popup_part.eo
index 2e4969826a..28255788d2 100644
--- a/src/lib/elementary/efl_ui_popup_part.eo
+++ b/src/lib/elementary/efl_ui_popup_part.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Popup.Part (Efl.Ui.Layout.Part, Efl.Canvas.Object, Efl.File)
+class Efl.Ui.Popup_Part (Efl.Ui.Layout.Part, Efl.Canvas.Object, Efl.File)
{
[[Efl UI Popup internal part class]]
data: null;
diff --git a/src/lib/elementary/efl_ui_progressbar.c b/src/lib/elementary/efl_ui_progressbar.c
index 19b89332b7..5773a455df 100644
--- a/src/lib/elementary/efl_ui_progressbar.c
+++ b/src/lib/elementary/efl_ui_progressbar.c
@@ -2,9 +2,10 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define ELM_LAYOUT_PROTECTED
#define EFL_ACCESS_VALUE_PROTECTED
+#define EFL_PART_PROTECTED
#include <Elementary.h>
@@ -19,7 +20,6 @@
#define MY_CLASS_PFX efl_ui_progressbar
#define MY_CLASS_NAME "Efl.Ui.Progressbar"
-#define MY_CLASS_NAME_LEGACY "elm_progressbar"
static const char SIG_CHANGED[] = "changed";
@@ -43,12 +43,6 @@ static const Elm_Layout_Part_Alias_Description _content_aliases[] =
{NULL, NULL}
};
-static const Elm_Layout_Part_Alias_Description _text_aliases[] =
-{
- {"default", "elm.text"},
- {NULL, NULL}
-};
-
static Efl_Ui_Progress_Status *
_progress_status_new(const char *part_name, double val)
{
@@ -118,12 +112,21 @@ _units_set(Evas_Object *obj)
eina_strbuf_reset(sd->format_strbuf);
sd->format_cb(sd->format_cb_data, sd->format_strbuf, val);
- elm_layout_text_set(obj, "elm.text.status", eina_strbuf_string_get(sd->format_strbuf));
+
+ if (elm_widget_is_legacy(obj))
+ elm_layout_text_set(obj, "elm.text.status", eina_strbuf_string_get(sd->format_strbuf));
+ else
+ elm_layout_text_set(obj, "efl.text.status", eina_strbuf_string_get(sd->format_strbuf));
eina_value_flush(&val);
}
else
- elm_layout_text_set(obj, "elm.text.status", NULL);
+ {
+ if (elm_widget_is_legacy(obj))
+ elm_layout_text_set(obj, "elm.text.status", NULL);
+ else
+ elm_layout_text_set(obj, "efl.text.status", NULL);
+ }
}
static void
@@ -131,17 +134,23 @@ _val_set(Evas_Object *obj)
{
Eina_Bool rtl;
double pos;
+ Efl_Ui_Progress_Status *ps;
+ Eina_List *l;
EFL_UI_PROGRESSBAR_DATA_GET(obj, sd);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
rtl = efl_ui_mirrored_get(obj);
- Efl_Ui_Progress_Status *ps;
- Eina_List *l;
EINA_LIST_FOREACH(sd->progress_status, l, ps)
{
- pos = ps->val;
+ if (EINA_DBL_EQ(ps->val_max, ps->val_min))
+ {
+ WRN("progressbar min and max are equal.");
+ continue;
+ }
+ pos = (ps->val - ps->val_min)/(ps->val_max - ps->val_min);
+
if ((!rtl && _is_inverted(sd->dir)) ||
(rtl && ((sd->dir == EFL_UI_DIR_UP) ||
(sd->dir == EFL_UI_DIR_RIGHT))))
@@ -164,40 +173,6 @@ _efl_ui_progressbar_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Progressbar_Data *_pd
evas_object_size_hint_max_set(obj, -1, -1);
}
-/* FIXME: replicated from elm_layout just because progressbar's icon
- * spot is elm.swallow.content, not elm.swallow.icon. Fix that
- * whenever we can changed the theme API */
-static void
-_icon_signal_emit(Evas_Object *obj)
-{
- char buf[64];
-
- snprintf(buf, sizeof(buf), "elm,state,icon,%s",
- elm_layout_content_get(obj, "icon") ? "visible" : "hidden");
-
- elm_layout_signal_emit(obj, buf, "elm");
-}
-
-EOLIAN static Eina_Bool
-_efl_ui_progressbar_elm_widget_widget_sub_object_del(Eo *obj, Efl_Ui_Progressbar_Data *pd EINA_UNUSED, Evas_Object *sobj)
-{
- if (!efl_ui_widget_sub_object_del(efl_super(obj, MY_CLASS), sobj))
- return EINA_FALSE;
-
- _icon_signal_emit(obj);
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_efl_ui_progressbar_elm_widget_widget_sub_object_add(Eo *obj, Efl_Ui_Progressbar_Data *pd EINA_UNUSED, Evas_Object *sobj)
-{
- if (!efl_ui_widget_sub_object_add(efl_super(obj, MY_CLASS), sobj))
- return EINA_FALSE;
-
- _icon_signal_emit(obj);
- return EINA_TRUE;
-}
-
//TODO: efl_ui_slider also use this.
static const char *
_theme_group_modify_pos_get(const char *cur_group, const char *search, size_t len, Eina_Bool is_legacy)
@@ -257,7 +232,7 @@ _efl_ui_progressbar_theme_group_get(Evas_Object *obj, Efl_Ui_Progressbar_Data *s
}
EOLIAN static Efl_Ui_Theme_Apply
-_efl_ui_progressbar_elm_widget_theme_apply(Eo *obj, Efl_Ui_Progressbar_Data *sd)
+_efl_ui_progressbar_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Progressbar_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
@@ -273,39 +248,60 @@ _efl_ui_progressbar_elm_widget_theme_apply(Eo *obj, Efl_Ui_Progressbar_Data *sd)
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
- if (sd->pulse)
- elm_layout_signal_emit(obj, "elm,state,pulse", "elm");
+ if (elm_widget_is_legacy(obj))
+ {
+ if (sd->pulse)
+ elm_layout_signal_emit(obj, "elm,state,pulse", "elm");
+ else
+ elm_layout_signal_emit(obj, "elm,state,fraction", "elm");
+
+ if (sd->pulse_state)
+ elm_layout_signal_emit(obj, "elm,state,pulse,start", "elm");
+
+ if (sd->format_cb && (!sd->pulse))
+ elm_layout_signal_emit(obj, "elm,state,units,visible", "elm");
+ }
else
- elm_layout_signal_emit(obj, "elm,state,fraction", "elm");
+ {
+ if (sd->pulse)
+ elm_layout_signal_emit(obj, "efl,state,pulse", "efl");
+ else
+ elm_layout_signal_emit(obj, "efl,state,fraction", "efl");
- if (sd->pulse_state)
- elm_layout_signal_emit(obj, "elm,state,pulse,start", "elm");
+ if (sd->pulse_state)
+ elm_layout_signal_emit(obj, "efl,state,pulse,start", "efl");
- if (sd->format_cb && (!sd->pulse))
- elm_layout_signal_emit(obj, "elm,state,units,visible", "elm");
+ if (sd->format_cb && (!sd->pulse))
+ elm_layout_signal_emit(obj, "efl,state,units,visible", "efl");
+ }
if (_is_horizontal(sd->dir))
evas_object_size_hint_min_set
- (sd->spacer, (double)sd->size * efl_gfx_scale_get(obj) *
+ (sd->spacer, (double)sd->size * efl_gfx_entity_scale_get(obj) *
elm_config_scale_get(), 1);
else
evas_object_size_hint_min_set
- (sd->spacer, 1, (double)sd->size * efl_gfx_scale_get(obj) *
+ (sd->spacer, 1, (double)sd->size * efl_gfx_entity_scale_get(obj) *
elm_config_scale_get());
- if (_is_inverted(sd->dir))
- elm_layout_signal_emit(obj, "elm,state,inverted,on", "elm");
+ if (elm_widget_is_legacy(obj))
+ {
+ if (_is_inverted(sd->dir))
+ elm_layout_signal_emit(obj, "elm,state,inverted,on", "elm");
+ else
+ elm_layout_signal_emit(obj, "elm,state,inverted,off", "elm");
+ }
else
- elm_layout_signal_emit(obj, "elm,state,inverted,off", "elm");
+ {
+ if (_is_inverted(sd->dir))
+ elm_layout_signal_emit(obj, "efl,state,inverted,on", "efl");
+ else
+ elm_layout_signal_emit(obj, "efl,state,inverted,off", "efl");
+ }
_units_set(obj);
_val_set(obj);
- /* FIXME: replicated from elm_layout just because progressbar's
- * icon spot is elm.swallow.content, not elm.swallow.icon. Fix that
- * whenever we can changed the theme API */
- _icon_signal_emit(obj);
-
edje_object_message_signal_process(wd->resize_obj);
elm_layout_sizing_eval(obj);
@@ -331,7 +327,12 @@ _access_state_cb(void *data EINA_UNUSED, Evas_Object *obj)
Eina_Strbuf *buf;
buf = eina_strbuf_new();
- const char *txt = elm_layout_text_get(obj, "elm.text.status");
+ const char *txt;
+ if (elm_widget_is_legacy(obj))
+ txt = elm_layout_text_get(obj, "elm.text.status");
+ else
+ txt = elm_layout_text_get(obj, "efl.text.status");
+
if (txt) eina_strbuf_append(buf, txt);
if (elm_widget_disabled_get(obj))
@@ -361,7 +362,7 @@ _efl_ui_progressbar_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Progressbar_Data
priv->dir = EFL_UI_DIR_RIGHT;
priv->val = MIN_RATIO_LVL;
-
+ priv->val_max = 1.0;
group = _efl_ui_progressbar_theme_group_get(obj, priv);
if (!elm_widget_theme_object_set(obj, wd->resize_obj,
@@ -372,13 +373,16 @@ _efl_ui_progressbar_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Progressbar_Data
free(group);
- efl_ui_format_string_set(obj, "%.0f %%");
+ efl_ui_format_string_set(obj, "%.0f%%");
priv->spacer = evas_object_rectangle_add(evas_object_evas_get(obj));
evas_object_color_set(priv->spacer, 0, 0, 0, 0);
evas_object_pass_events_set(priv->spacer, EINA_TRUE);
- elm_layout_content_set(obj, "elm.swallow.bar", priv->spacer);
+ if (elm_widget_is_legacy(obj))
+ elm_layout_content_set(obj, "elm.swallow.bar", priv->spacer);
+ else
+ elm_layout_content_set(obj, "efl.bar", priv->spacer);
_units_set(obj);
_val_set(obj);
@@ -420,10 +424,9 @@ EOLIAN static Eo *
_efl_ui_progressbar_efl_object_constructor(Eo *obj, Efl_Ui_Progressbar_Data *_pd EINA_UNUSED)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
- efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_PROGRESS_BAR);
-
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_PROGRESS_BAR);
+ efl_ui_range_min_max_set(obj, 0.0, 1.0);
return obj;
}
@@ -439,7 +442,7 @@ _efl_ui_progressbar_pulse_mode_set(Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data
}
EOLIAN static Eina_Bool
-_efl_ui_progressbar_pulse_mode_get(Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data *sd)
+_efl_ui_progressbar_pulse_mode_get(const Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data *sd)
{
return sd->pulse;
}
@@ -453,7 +456,7 @@ _efl_ui_progressbar_efl_ui_direction_direction_set(Eo *obj, Efl_Ui_Progressbar_D
}
EOLIAN static Efl_Ui_Dir
-_efl_ui_progressbar_efl_ui_direction_direction_get(Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data *sd)
+_efl_ui_progressbar_efl_ui_direction_direction_get(const Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data *sd)
{
return sd->dir;
}
@@ -467,28 +470,94 @@ _progressbar_span_size_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, Evas_Coord size
if (_is_horizontal(sd->dir))
evas_object_size_hint_min_set
- (sd->spacer, (double)sd->size * efl_gfx_scale_get(obj) *
+ (sd->spacer, (double)sd->size * efl_gfx_entity_scale_get(obj) *
elm_config_scale_get(), 1);
else
evas_object_size_hint_min_set
- (sd->spacer, 1, (double)sd->size * efl_gfx_scale_get(obj) *
+ (sd->spacer, 1, (double)sd->size * efl_gfx_entity_scale_get(obj) *
elm_config_scale_get());
elm_layout_sizing_eval(obj);
}
static void
+_progress_part_min_max_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, const char *part_name, double min, double max)
+{
+ Efl_Ui_Progress_Status *ps;
+ Eina_Bool existing_ps = EINA_FALSE;
+ Eina_List *l;
+
+ if (EINA_DBL_EQ(min, max))
+ {
+ ERR("min & max provided are equal.");
+ return;
+ }
+
+ if (min > max)
+ {
+ WRN("min is greater than max.");
+ }
+
+ if (elm_widget_is_legacy(obj))
+ {
+ if (!strcmp(part_name, "elm.cur.progressbar"))
+ {
+ sd->val_min = min;
+ sd->val_max = max;
+ }
+ }
+ else
+ {
+ if (!strcmp(part_name, "efl.cur.progressbar"))
+ {
+ sd->val_min = min;
+ sd->val_max = max;
+ }
+ }
+
+ EINA_LIST_FOREACH(sd->progress_status, l, ps)
+ {
+ if (!strcmp(ps->part_name, part_name))
+ {
+ existing_ps = EINA_TRUE;
+ ps->val_min = min;
+ ps->val_max = max;
+ break;
+ }
+ }
+ if (!existing_ps)
+ {
+ ps = _progress_status_new(part_name, min);
+ ps->val_min = min;
+ ps->val_max = max;
+ sd->progress_status = eina_list_append(sd->progress_status, ps);
+ }
+ _val_set(obj);
+}
+
+static void
_progressbar_part_value_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, const char *part_name, double val)
{
Efl_Ui_Progress_Status *ps;
Eina_Bool existing_ps = EINA_FALSE;
Eina_List *l;
+ double min = 0.0, max = 0.0;
- if (val < MIN_RATIO_LVL) val = MIN_RATIO_LVL;
- if (val > MAX_RATIO_LVL) val = MAX_RATIO_LVL;
+ efl_ui_range_min_max_get(efl_part(obj, part_name), &min, &max);
- if (!strcmp(part_name, "elm.cur.progressbar"))
- sd->val = val;
+ if (val < min) val = min;
+ if (val > max) val = max;
+
+ if (elm_widget_is_legacy(obj))
+ {
+ if (!strcmp(part_name, "elm.cur.progressbar"))
+ sd->val = val;
+ }
+ else
+ {
+ if (!strcmp(part_name, "efl.cur.progressbar"))
+ sd->val = val;
+ }
EINA_LIST_FOREACH(sd->progress_status, l, ps)
{
@@ -502,6 +571,9 @@ _progressbar_part_value_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, const char *pa
if (!existing_ps)
{
ps = _progress_status_new(part_name, val);
+ ps->val_min = 0.0;
+ ps->val_max = 1.0;
+ ps->val = val;
sd->progress_status = eina_list_append(sd->progress_status, ps);
}
else
@@ -532,13 +604,19 @@ _efl_ui_progressbar_efl_ui_range_range_value_set(Eo *obj, Efl_Ui_Progressbar_Dat
{
if (EINA_DBL_EQ(sd->val, val)) return;
- _progressbar_part_value_set(obj, sd, "elm.cur.progressbar", val);
+ if (elm_widget_is_legacy(obj))
+ _progressbar_part_value_set(obj, sd, "elm.cur.progressbar", val);
+ else
+ _progressbar_part_value_set(obj, sd, "efl.cur.progressbar", val);
}
EOLIAN static double
-_efl_ui_progressbar_efl_ui_range_range_value_get(Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data *sd)
+_efl_ui_progressbar_efl_ui_range_range_value_get(const Eo *obj, Efl_Ui_Progressbar_Data *sd EINA_UNUSED)
{
- return sd->val;
+ if (elm_widget_is_legacy(obj))
+ return efl_ui_range_value_get(efl_part(obj, "elm.cur.progressbar"));
+ else
+ return efl_ui_range_value_get(efl_part(obj, "efl.cur.progressbar"));
}
EOLIAN static void
@@ -557,7 +635,10 @@ _efl_ui_progressbar_efl_ui_format_format_cb_set(Eo *obj, Efl_Ui_Progressbar_Data
sd->format_free_cb = func_free_cb;
if (!sd->format_strbuf) sd->format_strbuf = eina_strbuf_new();
- elm_layout_signal_emit(obj, "elm,state,units,visible", "elm");
+ if (elm_widget_is_legacy(obj))
+ elm_layout_signal_emit(obj, "elm,state,units,visible", "elm");
+ else
+ elm_layout_signal_emit(obj, "efl,state,units,visible", "efl");
edje_object_message_signal_process(wd->resize_obj);
_units_set(obj);
@@ -572,28 +653,48 @@ _efl_ui_progressbar_pulse_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, Eina_Bool st
sd->pulse_state = state;
- if (sd->pulse_state)
- elm_layout_signal_emit(obj, "elm,state,pulse,start", "elm");
+ if (elm_widget_is_legacy(obj))
+ {
+ if (sd->pulse_state)
+ elm_layout_signal_emit(obj, "elm,state,pulse,start", "elm");
+ else
+ elm_layout_signal_emit(obj, "elm,state,pulse,stop", "elm");
+ }
else
- elm_layout_signal_emit(obj, "elm,state,pulse,stop", "elm");
+ {
+ if (sd->pulse_state)
+ elm_layout_signal_emit(obj, "efl,state,pulse,start", "efl");
+ else
+ elm_layout_signal_emit(obj, "efl,state,pulse,stop", "efl");
+ }
}
EOLIAN static Eina_Bool
-_efl_ui_progressbar_pulse_get(Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data *sd)
+_efl_ui_progressbar_pulse_get(const Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data *sd)
{
return (sd->pulse_state && sd->pulse);
}
EOLIAN static void
-_efl_ui_progressbar_class_constructor(Efl_Class *klass)
+_efl_ui_progressbar_efl_ui_range_range_min_max_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, double min, double max)
{
- evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
+ if (elm_widget_is_legacy(obj))
+ _progress_part_min_max_set(obj, sd, "elm.cur.progressbar", min, max);
+ else
+ _progress_part_min_max_set(obj, sd, "efl.cur.progressbar", min, max);
+}
+
+EOLIAN static void
+_efl_ui_progressbar_efl_ui_range_range_min_max_get(const Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data *sd, double *min, double *max)
+{
+ if (min) *min = sd->val_min;
+ if (max) *max = sd->val_max;
}
/* Efl.Part begin */
EOLIAN static Eo *
-_efl_ui_progressbar_efl_part_part(const Eo *obj, Efl_Ui_Progressbar_Data *sd EINA_UNUSED, const char *part)
+_efl_ui_progressbar_efl_part_part_get(const Eo *obj, Efl_Ui_Progressbar_Data *sd EINA_UNUSED, const char *part)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
@@ -602,7 +703,7 @@ _efl_ui_progressbar_efl_part_part(const Eo *obj, Efl_Ui_Progressbar_Data *sd EIN
if (edje_object_part_drag_dir_get(wd->resize_obj, part) != EFL_UI_DRAG_DIR_NONE)
return ELM_PART_IMPLEMENT(EFL_UI_PROGRESSBAR_PART_CLASS, obj, part);
- return efl_part(efl_super(obj, MY_CLASS), part);
+ return efl_part_get(efl_super(obj, MY_CLASS), part);
}
EOLIAN static void
@@ -615,7 +716,7 @@ _efl_ui_progressbar_part_efl_ui_range_range_value_set(Eo *obj, void *_pd EINA_UN
}
EOLIAN static double
-_efl_ui_progressbar_part_efl_ui_range_range_value_get(Eo *obj, void *_pd EINA_UNUSED)
+_efl_ui_progressbar_part_efl_ui_range_range_value_get(const Eo *obj, void *_pd EINA_UNUSED)
{
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
Efl_Ui_Progressbar_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_PROGRESSBAR_CLASS);
@@ -624,36 +725,161 @@ _efl_ui_progressbar_part_efl_ui_range_range_value_get(Eo *obj, void *_pd EINA_UN
}
EOLIAN static void
-_efl_ui_progressbar_efl_access_value_value_and_text_get(Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data *_pd, double *value, const char **text EINA_UNUSED)
+_efl_ui_progressbar_efl_access_value_value_and_text_get(const Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data *_pd, double *value, const char **text EINA_UNUSED)
{
if (value) *value = _pd->val;
}
+EOLIAN static void
+_efl_ui_progressbar_part_efl_ui_range_range_min_max_set(Eo *obj, void *_pd EINA_UNUSED, double min, double max)
+{
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ Efl_Ui_Progressbar_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_PROGRESSBAR_CLASS);
+
+ _progress_part_min_max_set(pd->obj, sd, pd->part, min, max);
+}
+
+EOLIAN static void
+_efl_ui_progressbar_part_efl_ui_range_range_min_max_get(const Eo *obj, void *_pd EINA_UNUSED, double *min, double *max)
+{
+ Efl_Ui_Progress_Status *ps;
+ Eina_List *l;
+
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ Efl_Ui_Progressbar_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_PROGRESSBAR_CLASS);
+
+ EINA_LIST_FOREACH(sd->progress_status, l, ps)
+ {
+ if (!strcmp(ps->part_name, pd->part))
+ {
+ if (min) *min = ps->val_min;
+ if (max) *max = ps->val_max;
+ break;
+ }
+ }
+}
+
#include "efl_ui_progressbar_part.eo.c"
/* Efl.Part end */
/* Internal EO APIs and hidden overrides */
+ELM_PART_TEXT_DEFAULT_IMPLEMENT(efl_ui_progressbar, Efl_Ui_Progressbar_Data)
+ELM_PART_MARKUP_DEFAULT_IMPLEMENT(efl_ui_progressbar, Efl_Ui_Progressbar_Data)
+ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_progressbar, Efl_Ui_Progressbar_Data)
ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(efl_ui_progressbar)
-ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(efl_ui_progressbar)
#define EFL_UI_PROGRESSBAR_EXTRA_OPS \
ELM_LAYOUT_CONTENT_ALIASES_OPS(efl_ui_progressbar), \
- ELM_LAYOUT_TEXT_ALIASES_OPS(efl_ui_progressbar), \
ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_progressbar), \
EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_progressbar)
#include "efl_ui_progressbar.eo.c"
-/* Legacy APIs */
+#include "efl_ui_progressbar_legacy.eo.h"
+#include "efl_ui_progressbar_legacy_part.eo.h"
+
+#define MY_CLASS_NAME_LEGACY "elm_progressbar"
+
+static void
+_efl_ui_progressbar_legacy_class_constructor(Efl_Class *klass)
+{
+ evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
+}
+
+EOLIAN static Eo *
+_efl_ui_progressbar_legacy_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED)
+{
+ obj = efl_constructor(efl_super(obj, EFL_UI_PROGRESSBAR_LEGACY_CLASS));
+ efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
+ return obj;
+}
+
+/* FIXME: replicated from elm_layout just because progressbar's icon spot
+ * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
+ * can changed the theme API */
+static void
+_icon_signal_emit(Evas_Object *obj)
+{
+ char buf[64];
+
+ if (!elm_widget_resize_object_get(obj)) return;
+ snprintf(buf, sizeof(buf), "elm,state,icon,%s",
+ elm_layout_content_get(obj, "icon") ? "visible" : "hidden");
+
+ elm_layout_signal_emit(obj, buf, "elm");
+ edje_object_message_signal_process(elm_layout_edje_get(obj));
+ elm_layout_sizing_eval(obj);
+}
+
+/* FIXME: replicated from elm_layout just because progressbar's icon spot
+ * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
+ * can changed the theme API */
+EOLIAN static Efl_Ui_Theme_Apply
+_efl_ui_progressbar_legacy_efl_ui_widget_theme_apply(Eo *obj, void *_pd EINA_UNUSED)
+{
+ Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
+
+ int_ret = efl_ui_widget_theme_apply(efl_super(obj, EFL_UI_PROGRESSBAR_LEGACY_CLASS));
+ if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
+ _icon_signal_emit(obj);
+
+ return int_ret;
+}
+
+/* FIXME: replicated from elm_layout just because progressbar's icon spot
+ * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
+ * can changed the theme API */
+EOLIAN static Eina_Bool
+_efl_ui_progressbar_legacy_efl_ui_widget_widget_sub_object_del(Eo *obj, void *_pd EINA_UNUSED, Evas_Object *sobj)
+{
+ Eina_Bool int_ret = EINA_FALSE;
+
+ int_ret = elm_widget_sub_object_del(efl_super(obj, EFL_UI_PROGRESSBAR_LEGACY_CLASS), sobj);
+ if (!int_ret) return EINA_FALSE;
+
+ _icon_signal_emit(obj);
+
+ return EINA_TRUE;
+}
+
+/* FIXME: replicated from elm_layout just because progressbar's icon spot
+ * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
+ * can changed the theme API */
+static Eina_Bool
+_efl_ui_progressbar_legacy_content_set(Eo *obj, void *_pd EINA_UNUSED, const char *part, Evas_Object *content)
+{
+ Eina_Bool int_ret = EINA_FALSE;
+
+ int_ret = efl_content_set(efl_part(efl_super(obj, EFL_UI_PROGRESSBAR_LEGACY_CLASS), part), content);
+ if (!int_ret) return EINA_FALSE;
+
+ _icon_signal_emit(obj);
+
+ return EINA_TRUE;
+}
+
+/* Efl.Part for legacy begin */
+
+static Eina_Bool
+_part_is_efl_ui_progressbar_legacy_part(const Eo *obj EINA_UNUSED, const char *part)
+{
+ return eina_streq(part, "elm.swallow.content");
+}
+
+ELM_PART_OVERRIDE_PARTIAL(efl_ui_progressbar_legacy, EFL_UI_PROGRESSBAR_LEGACY, void, _part_is_efl_ui_progressbar_legacy_part)
+ELM_PART_OVERRIDE_CONTENT_SET_NO_SD(efl_ui_progressbar_legacy)
+#include "efl_ui_progressbar_legacy_part.eo.c"
+
+/* Efl.Part for legacy end */
EAPI Evas_Object *
elm_progressbar_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- Eo *obj = elm_legacy_add(MY_CLASS, parent);
- elm_progressbar_unit_format_set(obj, "%.0f %%");
+ Eo *obj = elm_legacy_add(EFL_UI_PROGRESSBAR_LEGACY_CLASS, parent);
+ elm_progressbar_unit_format_set(obj, "%.0f%%");
return obj;
}
@@ -698,17 +924,16 @@ elm_progressbar_part_value_get(const Evas_Object *obj, const char *part)
EAPI Eina_Bool
elm_progressbar_horizontal_get(const Evas_Object *obj)
{
- Efl_Ui_Dir dir;
- dir = efl_ui_direction_get(obj);
+ EFL_UI_PROGRESSBAR_DATA_GET_OR_RETURN(obj, sd, EINA_FALSE);
- return _is_horizontal(dir);
+ return _is_horizontal(sd->dir);
}
EAPI void
elm_progressbar_inverted_set(Evas_Object *obj, Eina_Bool inverted)
{
Efl_Ui_Dir dir;
- EFL_UI_PROGRESSBAR_DATA_GET(obj, sd);
+ EFL_UI_PROGRESSBAR_DATA_GET_OR_RETURN(obj, sd);
dir = _direction_get(_is_horizontal(sd->dir), inverted);
@@ -718,17 +943,16 @@ elm_progressbar_inverted_set(Evas_Object *obj, Eina_Bool inverted)
EAPI Eina_Bool
elm_progressbar_inverted_get(const Evas_Object *obj)
{
- Efl_Ui_Dir dir;
- dir = efl_ui_direction_get(obj);
+ EFL_UI_PROGRESSBAR_DATA_GET_OR_RETURN(obj, sd, EINA_FALSE);
- return _is_inverted(dir);
+ return _is_inverted(sd->dir);
}
EAPI void
elm_progressbar_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
{
Efl_Ui_Dir dir;
- EFL_UI_PROGRESSBAR_DATA_GET(obj, sd);
+ EFL_UI_PROGRESSBAR_DATA_GET_OR_RETURN(obj, sd);
dir = _direction_get(horizontal, _is_inverted(sd->dir));
@@ -820,3 +1044,5 @@ elm_progressbar_value_get(const Evas_Object *obj)
{
return efl_ui_range_value_get(obj);
}
+
+#include "efl_ui_progressbar_legacy.eo.c"
diff --git a/src/lib/elementary/efl_ui_progressbar.eo b/src/lib/elementary/efl_ui_progressbar.eo
index 90d17266ec..86592eca61 100644
--- a/src/lib/elementary/efl_ui_progressbar.eo
+++ b/src/lib/elementary/efl_ui_progressbar.eo
@@ -1,5 +1,6 @@
-class Efl.Ui.Progressbar (Efl.Ui.Layout, Efl.Ui.Range, Efl.Ui.Format,
- Efl.Ui.Direction, Efl.Access.Value)
+class Efl.Ui.Progressbar (Efl.Ui.Layout.Object, Efl.Ui.Range, Efl.Ui.Format,
+ Efl.Ui.Direction, Efl.Access.Value, Efl.Ui.Translatable,
+ Efl.Text, Efl.Content, Efl.Text_Markup)
{
[[Elementary progressbar class]]
methods {
@@ -14,7 +15,7 @@ class Efl.Ui.Progressbar (Efl.Ui.Layout, Efl.Ui.Range, Efl.Ui.Format,
without showing the precise progress rate. In the default theme, it will
animate the bar with content, switching constantly between filling it and back
to non-filled in a loop. To start and stop this pulsing
- animation you need to explicitly call elm_progressbar_pulse().
+ animation you need to explicitly call efl_ui_progressbar_pulse_set().
@since 1.20
]]
@@ -48,18 +49,21 @@ class Efl.Ui.Progressbar (Efl.Ui.Layout, Efl.Ui.Range, Efl.Ui.Format,
}
}
implements {
- class.constructor;
Efl.Object.constructor;
- Elm.Widget.theme_apply;
- Elm.Widget.widget_sub_object_add;
- Elm.Widget.widget_sub_object_del;
+ Efl.Ui.Widget.theme_apply;
Efl.Ui.Range.range_value { get; set; }
+ Efl.Ui.Range.range_min_max {get; set; }
Efl.Ui.Direction.direction { get; set; }
Efl.Ui.Format.format_cb { set; }
- Efl.Part.part;
+ Efl.Part.part_get;
Efl.Access.Value.value_and_text { get; }
+ Efl.Text.text { get; set; }
+ Efl.Text_Markup.markup { get; set; }
+ Efl.Content.content { get; set; }
+ Efl.Content.content_unset;
+ Efl.Ui.Translatable.translatable_text { get; set; }
}
events {
- changed; [[Called when progressbar changed]]
+ changed: void; [[Called when progressbar changed]]
}
}
diff --git a/src/lib/elementary/efl_ui_progressbar_legacy.eo b/src/lib/elementary/efl_ui_progressbar_legacy.eo
new file mode 100644
index 0000000000..b091225cb1
--- /dev/null
+++ b/src/lib/elementary/efl_ui_progressbar_legacy.eo
@@ -0,0 +1,12 @@
+class Efl.Ui.Progressbar_Legacy (Efl.Ui.Progressbar, Efl.Ui.Legacy)
+{
+ [[Elementary progressbar class]]
+ data: null;
+ implements {
+ class.constructor;
+ Efl.Object.constructor;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.widget_sub_object_del;
+ Efl.Part.part_get;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_progressbar_legacy_part.eo b/src/lib/elementary/efl_ui_progressbar_legacy_part.eo
new file mode 100644
index 0000000000..382980829b
--- /dev/null
+++ b/src/lib/elementary/efl_ui_progressbar_legacy_part.eo
@@ -0,0 +1,8 @@
+class Efl.Ui.Progressbar_Legacy_Part (Efl.Ui.Layout.Part_Content)
+{
+ [[Elementary progressbar internal part class]]
+ data: null;
+ implements {
+ Efl.Content.content { set; }
+ }
+}
diff --git a/src/lib/elementary/efl_ui_progressbar_part.eo b/src/lib/elementary/efl_ui_progressbar_part.eo
index a57bfa7cdc..c98152a720 100644
--- a/src/lib/elementary/efl_ui_progressbar_part.eo
+++ b/src/lib/elementary/efl_ui_progressbar_part.eo
@@ -1,8 +1,9 @@
-class Efl.Ui.Progressbar.Part (Efl.Ui.Layout.Part, Efl.Ui.Range)
+class Efl.Ui.Progressbar_Part (Efl.Ui.Layout.Part, Efl.Ui.Range)
{
[[Elementary progressbar internal part class]]
data: null;
implements {
Efl.Ui.Range.range_value { set; get; }
+ Efl.Ui.Range.range_min_max {get; set; }
}
}
diff --git a/src/lib/elementary/efl_ui_progressbar_private.h b/src/lib/elementary/efl_ui_progressbar_private.h
index c9b0c9b11f..7bdf8a98a0 100644
--- a/src/lib/elementary/efl_ui_progressbar_private.h
+++ b/src/lib/elementary/efl_ui_progressbar_private.h
@@ -32,6 +32,9 @@ struct _Efl_Ui_Progressbar_Data
Evas_Coord size; /**< Width or height of progressbar */
double val; /**< Value of progressbar */
+
+ double val_min;
+ double val_max;
Eina_List *progress_status; /**< The list of _Elm_Progress_Status. To save the progress value(in percentage) each part of given progress bar */
@@ -52,6 +55,7 @@ struct _Efl_Ui_Progress_Status
{
const char *part_name;
double val;
+ double val_min, val_max;
};
/**
diff --git a/src/lib/elementary/efl_ui_radio.c b/src/lib/elementary/efl_ui_radio.c
index cd5c157b3f..3ed97d2af8 100644
--- a/src/lib/elementary/efl_ui_radio.c
+++ b/src/lib/elementary/efl_ui_radio.c
@@ -2,9 +2,10 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define ELM_LAYOUT_PROTECTED
+#define EFL_PART_PROTECTED
#include <Elementary.h>
@@ -17,7 +18,6 @@
#define MY_CLASS_PFX efl_ui_radio
#define MY_CLASS_NAME "Efl.Ui.Radio"
-#define MY_CLASS_NAME_LEGACY "elm_radio"
static const Elm_Layout_Part_Alias_Description _text_aliases[] =
{
@@ -56,8 +56,16 @@ _state_set(Evas_Object *obj, Eina_Bool state, Eina_Bool activate)
// so that we can distinguish between state change by user or state change
// by calling state_change() api. Keep both the signal for backward compatibility
// and only emit "elm,state,radio,on" when activate is false when we can break ABI.
- if (activate) elm_layout_signal_emit(obj, "elm,activate,radio,on", "elm");
- elm_layout_signal_emit(obj, "elm,state,radio,on", "elm");
+ if (elm_widget_is_legacy(obj))
+ {
+ if (activate) elm_layout_signal_emit(obj, "elm,activate,radio,on", "elm");
+ elm_layout_signal_emit(obj, "elm,state,radio,on", "elm");
+ }
+ else
+ {
+ if (activate) elm_layout_signal_emit(obj, "efl,activate,radio,on", "efl");
+ elm_layout_signal_emit(obj, "efl,state,radio,on", "efl");
+ }
}
else
{
@@ -65,8 +73,16 @@ _state_set(Evas_Object *obj, Eina_Bool state, Eina_Bool activate)
// so that we can distinguish between state change by user or state change
// by calling state_change() api. Keep both the signal for backward compatibility
// and only emit "elm,state,radio,off"when activate is false when we can break ABI.
- if (activate) elm_layout_signal_emit(obj, "elm,activate,radio,off", "elm");
- elm_layout_signal_emit(obj, "elm,state,radio,off", "elm");
+ if (elm_widget_is_legacy(obj))
+ {
+ if (activate) elm_layout_signal_emit(obj, "elm,activate,radio,off", "elm");
+ elm_layout_signal_emit(obj, "elm,state,radio,off", "elm");
+ }
+ else
+ {
+ if (activate) elm_layout_signal_emit(obj, "efl,activate,radio,off", "efl");
+ elm_layout_signal_emit(obj, "efl,state,radio,off", "efl");
+ }
}
if (_elm_config->atspi_mode)
{
@@ -131,40 +147,27 @@ _key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED)
return EINA_TRUE;
}
-/* FIXME: replicated from elm_layout just because radio's icon spot
- * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
- * can changed the theme API */
-static void
-_icon_signal_emit(Evas_Object *obj)
-{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
- char buf[64];
-
- snprintf(buf, sizeof(buf), "elm,state,icon,%s",
- elm_layout_content_get(obj, "icon") ? "visible" : "hidden");
-
- elm_layout_signal_emit(obj, buf, "elm");
- edje_object_message_signal_process(wd->resize_obj);
-}
-
EOLIAN static Efl_Ui_Theme_Apply
-_efl_ui_radio_elm_widget_theme_apply(Eo *obj, Efl_Ui_Radio_Data *sd)
+_efl_ui_radio_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Radio_Data *sd)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, EFL_UI_CHECK_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
- if (sd->state) elm_layout_signal_emit(obj, "elm,state,radio,on", "elm");
- else elm_layout_signal_emit(obj, "elm,state,radio,off", "elm");
+ if (elm_widget_is_legacy(obj))
+ {
+ if (sd->state) elm_layout_signal_emit(obj, "elm,state,radio,on", "elm");
+ else elm_layout_signal_emit(obj, "elm,state,radio,off", "elm");
+ }
+ else
+ {
+ if (sd->state) elm_layout_signal_emit(obj, "efl,state,radio,on", "efl");
+ else elm_layout_signal_emit(obj, "efl,state,radio,off", "efl");
+ }
edje_object_message_signal_process(wd->resize_obj);
- /* FIXME: replicated from elm_layout just because radio's icon
- * spot is elm.swallow.content, not elm.swallow.icon. Fix that
- * whenever we can changed the theme API */
- _icon_signal_emit(obj);
-
elm_layout_sizing_eval(obj);
return int_ret;
@@ -207,19 +210,23 @@ _efl_ui_radio_efl_object_constructor(Eo *obj, Efl_Ui_Radio_Data *pd)
if (!elm_widget_theme_klass_get(obj))
elm_widget_theme_klass_set(obj, "radio");
obj = efl_constructor(efl_super(obj, MY_CLASS));
- efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
- elm_layout_signal_callback_add
- (obj, "elm,action,radio,toggle", "*", _radio_on_cb, obj);
+
+ if (elm_widget_is_legacy(obj))
+ elm_layout_signal_callback_add
+ (obj, "elm,action,radio,toggle", "*", _radio_on_cb, obj);
+ else
+ elm_layout_signal_callback_add
+ (obj, "efl,action,radio,toggle", "*", _radio_on_cb, obj);
pd->group = calloc(1, sizeof(Group));
pd->group->radios = eina_list_append(pd->group->radios, obj);
elm_layout_sizing_eval(obj);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_RADIO_BUTTON);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_RADIO_BUTTON);
_elm_access_text_set
(_elm_access_info_get(obj), ELM_ACCESS_TYPE, E_("Radio"));
_elm_access_callback_set
@@ -273,7 +280,7 @@ _efl_ui_radio_state_value_set(Eo *obj, Efl_Ui_Radio_Data *sd, int value)
}
EOLIAN static int
-_efl_ui_radio_state_value_get(Eo *obj EINA_UNUSED, Efl_Ui_Radio_Data *sd)
+_efl_ui_radio_state_value_get(const Eo *obj EINA_UNUSED, Efl_Ui_Radio_Data *sd)
{
return sd->value;
}
@@ -288,7 +295,7 @@ _efl_ui_radio_efl_ui_nstate_value_set(Eo *obj EINA_UNUSED, Efl_Ui_Radio_Data *sd
}
EOLIAN static int
-_efl_ui_radio_efl_ui_nstate_value_get(Eo *obj EINA_UNUSED, Efl_Ui_Radio_Data *sd)
+_efl_ui_radio_efl_ui_nstate_value_get(const Eo *obj EINA_UNUSED, Efl_Ui_Radio_Data *sd)
{
return sd->group->value;
}
@@ -309,7 +316,7 @@ _efl_ui_radio_value_pointer_set(Eo *obj EINA_UNUSED, Efl_Ui_Radio_Data *sd, int
}
EOLIAN static Evas_Object*
-_efl_ui_radio_selected_object_get(Eo *obj EINA_UNUSED, Efl_Ui_Radio_Data *sd)
+_efl_ui_radio_selected_object_get(const Eo *obj EINA_UNUSED, Efl_Ui_Radio_Data *sd)
{
Eina_List *l;
Evas_Object *child;
@@ -325,7 +332,7 @@ _efl_ui_radio_selected_object_get(Eo *obj EINA_UNUSED, Efl_Ui_Radio_Data *sd)
}
EOLIAN static Eina_Bool
-_efl_ui_radio_elm_widget_on_access_activate(Eo *obj, Efl_Ui_Radio_Data *_pd EINA_UNUSED, Efl_Ui_Activate act)
+_efl_ui_radio_efl_ui_widget_on_access_activate(Eo *obj, Efl_Ui_Radio_Data *_pd EINA_UNUSED, Efl_Ui_Activate act)
{
if (elm_widget_disabled_get(obj)) return EINA_FALSE;
if (act != EFL_UI_ACTIVATE_DEFAULT) return EINA_FALSE;
@@ -335,14 +342,8 @@ _efl_ui_radio_elm_widget_on_access_activate(Eo *obj, Efl_Ui_Radio_Data *_pd EINA
return EINA_TRUE;
}
-EOLIAN static void
-_efl_ui_radio_class_constructor(Efl_Class *klass)
-{
- evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
-}
-
EOLIAN const Efl_Access_Action_Data *
-_efl_ui_radio_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Efl_Ui_Radio_Data *pd EINA_UNUSED)
+_efl_ui_radio_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Efl_Ui_Radio_Data *pd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "activate", "activate", NULL, _key_action_activate},
@@ -352,22 +353,17 @@ _efl_ui_radio_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Efl_
}
EOLIAN Efl_Access_State_Set
-_efl_ui_radio_efl_access_state_set_get(Eo *obj, Efl_Ui_Radio_Data *pd EINA_UNUSED)
+_efl_ui_radio_efl_access_object_state_set_get(const Eo *obj, Efl_Ui_Radio_Data *pd EINA_UNUSED)
{
Efl_Access_State_Set ret;
- ret = efl_access_state_set_get(efl_super(obj, EFL_UI_RADIO_CLASS));
+ ret = efl_access_object_state_set_get(efl_super(obj, EFL_UI_RADIO_CLASS));
if (obj == elm_radio_selected_object_get(obj))
STATE_TYPE_SET(ret, EFL_ACCESS_STATE_CHECKED);
return ret;
}
-/* Part APIs */
-
-ELM_PART_CONTENT_DEFAULT_GET(efl_ui_radio, "elm.swallow.content")
-ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_radio, Efl_Ui_Radio_Data)
-
/* Internal EO APIs and hidden overrides */
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_radio, Efl_Ui_Radio_Data)
@@ -378,13 +374,111 @@ ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX)
#include "efl_ui_radio.eo.c"
+#include "efl_ui_radio_legacy.eo.h"
+#include "efl_ui_radio_legacy_part.eo.h"
+
+#define MY_CLASS_NAME_LEGACY "elm_radio"
/* Legacy APIs */
+static void
+_efl_ui_radio_legacy_class_constructor(Efl_Class *klass)
+{
+ evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
+}
+
+EOLIAN static Eo *
+_efl_ui_radio_legacy_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED)
+{
+ obj = efl_constructor(efl_super(obj, EFL_UI_RADIO_LEGACY_CLASS));
+ efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
+ return obj;
+}
+
+/* FIXME: replicated from elm_layout just because radio's icon spot
+ * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
+ * can changed the theme API */
+static void
+_icon_signal_emit(Evas_Object *obj)
+{
+ char buf[63];
+ Eo *edje;
+
+ edje = elm_widget_resize_object_get(obj);
+ if (!edje) return;
+ snprintf(buf, sizeof(buf), "elm,state,icon,%s",
+ elm_layout_content_get(obj, "icon") ? "visible" : "hidden");
+
+ elm_layout_signal_emit(obj, buf, "elm");
+ edje_object_message_signal_process(edje);
+ elm_layout_sizing_eval(obj);
+}
+
+EOLIAN static Efl_Ui_Theme_Apply
+_efl_ui_radio_legacy_efl_ui_widget_theme_apply(Eo *obj, void *_pd EINA_UNUSED)
+{
+ Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
+ int_ret = efl_ui_widget_theme_apply(efl_super(obj, EFL_UI_RADIO_LEGACY_CLASS));
+ if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
+
+ /* FIXME: replicated from elm_layout just because radio's icon
+ * spot is elm.swallow.content, not elm.swallow.icon. Fix that
+ * whenever we can changed the theme API */
+ _icon_signal_emit(obj);
+
+ return int_ret;
+}
+
+/* FIXME: replicated from elm_layout just because radio's icon spot
+ * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
+ * can changed the theme API */
+EOLIAN static Eina_Bool
+_efl_ui_radio_legacy_efl_ui_widget_widget_sub_object_del(Eo *obj, void *_pd EINA_UNUSED, Evas_Object *sobj)
+{
+ Eina_Bool int_ret = EINA_FALSE;
+
+ int_ret = elm_widget_sub_object_del(efl_super(obj, EFL_UI_RADIO_LEGACY_CLASS), sobj);
+ if (!int_ret) return EINA_FALSE;
+
+ _icon_signal_emit(obj);
+
+ return EINA_TRUE;
+}
+
+/* FIXME: replicated from elm_layout just because radio's icon spot
+ * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
+ * can changed the theme API */
+static Eina_Bool
+_efl_ui_radio_legacy_content_set(Eo *obj, void *_pd EINA_UNUSED, const char *part, Evas_Object *content)
+{
+ Eina_Bool int_ret = EINA_FALSE;
+
+ int_ret = efl_content_set(efl_part(efl_super(obj, EFL_UI_RADIO_LEGACY_CLASS), part), content);
+ if (!int_ret) return EINA_FALSE;
+
+ _icon_signal_emit(obj);
+
+ return EINA_TRUE;
+}
+
+/* Efl.Part begin */
+
+static Eina_Bool
+_part_is_efl_ui_radio_legacy_part(const Eo *obj EINA_UNUSED, const char *part)
+{
+ return eina_streq(part, "elm.swallow.content");
+}
+
+ELM_PART_OVERRIDE_PARTIAL(efl_ui_radio_legacy, EFL_UI_RADIO_LEGACY, void, _part_is_efl_ui_radio_legacy_part)
+ELM_PART_OVERRIDE_CONTENT_SET_NO_SD(efl_ui_radio_legacy)
+#include "efl_ui_radio_legacy_part.eo.c"
+
+/* Efl.Part end */
+
EAPI Evas_Object *
elm_radio_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return elm_legacy_add(MY_CLASS, parent);
+ return elm_legacy_add(EFL_UI_RADIO_LEGACY_CLASS, parent);
}
EAPI void
@@ -398,3 +492,5 @@ elm_radio_value_get(const Evas_Object *obj)
{
return efl_ui_nstate_value_get(obj);
}
+
+#include "efl_ui_radio_legacy.eo.c"
diff --git a/src/lib/elementary/efl_ui_radio.eo b/src/lib/elementary/efl_ui_radio.eo
index ce51b183e1..44d3df9276 100644
--- a/src/lib/elementary/efl_ui_radio.eo
+++ b/src/lib/elementary/efl_ui_radio.eo
@@ -59,16 +59,13 @@ class Efl.Ui.Radio (Efl.Ui.Check, Efl.Access.Widget.Action, Efl.Content)
}
}
implements {
- class.constructor;
Efl.Object.constructor;
Efl.Object.destructor;
- Elm.Widget.theme_apply;
- Elm.Widget.on_access_activate;
- Elm.Widget.widget_event;
- Efl.Access.state_set { get; }
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.on_access_activate;
+ Efl.Ui.Widget.widget_event;
+ Efl.Access.Object.state_set { get; }
Efl.Access.Widget.Action.elm_actions { get; }
- Efl.Content.content { get; set; }
- Efl.Content.content_unset;
Efl.Ui.Nstate.value { set; get; }
}
}
diff --git a/src/lib/elementary/efl_ui_radio_legacy.eo b/src/lib/elementary/efl_ui_radio_legacy.eo
new file mode 100644
index 0000000000..cee114a2b8
--- /dev/null
+++ b/src/lib/elementary/efl_ui_radio_legacy.eo
@@ -0,0 +1,12 @@
+class Efl.Ui.Radio_Legacy (Efl.Ui.Radio, Efl.Ui.Legacy)
+{
+ [[Elementary radio class]]
+ data: null;
+ implements {
+ class.constructor;
+ Efl.Object.constructor;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.widget_sub_object_del;
+ Efl.Part.part_get;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_radio_legacy_part.eo b/src/lib/elementary/efl_ui_radio_legacy_part.eo
new file mode 100644
index 0000000000..666d3c2318
--- /dev/null
+++ b/src/lib/elementary/efl_ui_radio_legacy_part.eo
@@ -0,0 +1,8 @@
+class Efl.Ui.Radio_Legacy_Part (Efl.Ui.Layout.Part_Content)
+{
+ [[Elementary radio internal part class]]
+ data: null;
+ implements {
+ Efl.Content.content { set; }
+ }
+}
diff --git a/src/lib/elementary/efl_ui_radio_private.h b/src/lib/elementary/efl_ui_radio_private.h
index 0cce85f8ab..a59ea0c48d 100644
--- a/src/lib/elementary/efl_ui_radio_private.h
+++ b/src/lib/elementary/efl_ui_radio_private.h
@@ -36,9 +36,9 @@ struct _Group
struct _Efl_Ui_Radio_Data
{
int value;
- Eina_Bool state;
-
Group *group;
+
+ Eina_Bool state : 1;
};
/**
@@ -52,7 +52,7 @@ struct _Efl_Ui_Radio_Data
ELM_RADIO_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -61,7 +61,7 @@ struct _Efl_Ui_Radio_Data
ELM_RADIO_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/efl_ui_scroll_manager.c b/src/lib/elementary/efl_ui_scroll_manager.c
index 29df43b03c..5b54482ebe 100644
--- a/src/lib/elementary/efl_ui_scroll_manager.c
+++ b/src/lib/elementary/efl_ui_scroll_manager.c
@@ -255,18 +255,18 @@ _efl_ui_scroll_manager_edge_right(Efl_Ui_Scroll_Manager_Data *sd)
}
EOLIAN static Eina_Size2D
-_efl_ui_scroll_manager_efl_ui_scrollable_interactive_content_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Scroll_Manager_Data *sd)
+_efl_ui_scroll_manager_efl_ui_scrollable_interactive_content_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_Scroll_Manager_Data *sd)
{
return efl_ui_pan_content_size_get(sd->pan_obj);
}
EOLIAN static Eina_Rect
-_efl_ui_scroll_manager_efl_ui_scrollable_interactive_viewport_geometry_get(Eo *obj EINA_UNUSED,
+_efl_ui_scroll_manager_efl_ui_scrollable_interactive_viewport_geometry_get(const Eo *obj EINA_UNUSED,
Efl_Ui_Scroll_Manager_Data *sd)
{
if (!sd->pan_obj) return EINA_RECT(0, 0, 0, 0);
- return efl_gfx_geometry_get(sd->pan_obj);
+ return efl_gfx_entity_geometry_get(sd->pan_obj);
}
EOLIAN static void
@@ -397,7 +397,7 @@ _efl_ui_scroll_manager_bounce_eval(Efl_Ui_Scroll_Manager_Data *sd)
}
EOLIAN static Eina_Position2D
-_efl_ui_scroll_manager_efl_ui_scrollable_interactive_content_pos_get(Eo *obj EINA_UNUSED, Efl_Ui_Scroll_Manager_Data *sd)
+_efl_ui_scroll_manager_efl_ui_scrollable_interactive_content_pos_get(const Eo *obj EINA_UNUSED, Efl_Ui_Scroll_Manager_Data *sd)
{
if (!sd->pan_obj) return EINA_POSITION2D(0, 0);
@@ -594,7 +594,7 @@ _efl_ui_scroll_manager_efl_ui_scrollbar_bar_mode_set(Eo *obj EINA_UNUSED,
}
EOLIAN static void
-_efl_ui_scroll_manager_efl_ui_scrollbar_bar_mode_get(Eo *obj EINA_UNUSED,
+_efl_ui_scroll_manager_efl_ui_scrollbar_bar_mode_get(const Eo *obj EINA_UNUSED,
Efl_Ui_Scroll_Manager_Data *sd,
Efl_Ui_Scrollbar_Mode *hmode,
Efl_Ui_Scrollbar_Mode *vmode)
@@ -623,7 +623,7 @@ _efl_ui_scroll_manager_content_region_show_internal(Evas_Object *obj,
min = efl_ui_pan_position_min_get(sd->pan_obj);
max = efl_ui_pan_position_max_get(sd->pan_obj);
cur = efl_ui_pan_position_get(sd->pan_obj);
- pan = efl_gfx_size_get(sd->pan_obj);
+ pan = efl_gfx_entity_size_get(sd->pan_obj);
nx = x;
if ((x > cur.x) && (w < pan.w))
@@ -1005,11 +1005,6 @@ _efl_ui_scroll_manager_mouse_up_event_smooth(Efl_Ui_Scroll_Manager_Data *sd, dou
if (ox) *ox = ax;
if (oy) *oy = ay;
if (ot) *ot = t - at;
-
- return;
- if (ox) *ox = (Evas_Coord)(ax / (i + 1));
- if (oy) *oy = (Evas_Coord)(ay / (i + 1));
- if (ot) *ot = (double)(at / (i + 1));
}
static void
@@ -2048,7 +2043,7 @@ _efl_ui_scroll_manager_pan_resized_cb(void *data,
Eo *manager = data;
EFL_UI_SCROLL_MANAGER_DATA_GET_OR_RETURN(manager, sd);
- efl_gfx_size_set(sd->event_rect, efl_gfx_size_get(obj));
+ efl_gfx_entity_size_set(sd->event_rect, efl_gfx_entity_size_get(obj));
}
static void
@@ -2060,7 +2055,7 @@ _efl_ui_scroll_manager_pan_moved_cb(void *data,
Eo *manager = data;
EFL_UI_SCROLL_MANAGER_DATA_GET_OR_RETURN(manager, sd);
- efl_gfx_position_set(sd->event_rect, efl_gfx_position_get(obj));
+ efl_gfx_entity_position_set(sd->event_rect, efl_gfx_entity_position_get(obj));
}
static void
@@ -2218,7 +2213,7 @@ _efl_ui_scroll_manager_efl_ui_scrollbar_bar_position_set(Eo *obj EINA_UNUSED, Ef
}
EOLIAN static void
-_efl_ui_scroll_manager_efl_ui_scrollbar_bar_position_get(Eo *obj EINA_UNUSED, Efl_Ui_Scroll_Manager_Data *sd, double *posx, double *posy)
+_efl_ui_scroll_manager_efl_ui_scrollbar_bar_position_get(const Eo *obj EINA_UNUSED, Efl_Ui_Scroll_Manager_Data *sd, double *posx, double *posy)
{
if (!sd->pan_obj) return;
@@ -2249,7 +2244,7 @@ _efl_ui_scroll_manager_efl_ui_scrollbar_bar_position_get(Eo *obj EINA_UNUSED, Ef
}
EOLIAN static void
-_efl_ui_scroll_manager_efl_ui_scrollbar_bar_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Scroll_Manager_Data *sd, double *width, double *height)
+_efl_ui_scroll_manager_efl_ui_scrollbar_bar_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_Scroll_Manager_Data *sd, double *width, double *height)
{
if (!sd->pan_obj) return;
@@ -2306,7 +2301,7 @@ _efl_ui_scroll_manager_pan_set(Eo *obj, Efl_Ui_Scroll_Manager_Data *sd, Eo *pan)
}
EOLIAN static Eina_Bool
-_efl_ui_scroll_manager_efl_ui_scrollable_interactive_scroll_hold_get(Eo *obj EINA_UNUSED, Efl_Ui_Scroll_Manager_Data *sd)
+_efl_ui_scroll_manager_efl_ui_scrollable_interactive_scroll_hold_get(const Eo *obj EINA_UNUSED, Efl_Ui_Scroll_Manager_Data *sd)
{
return sd->hold;
}
@@ -2318,7 +2313,7 @@ _efl_ui_scroll_manager_efl_ui_scrollable_interactive_scroll_hold_set(Eo *obj EIN
}
EOLIAN static Eina_Bool
-_efl_ui_scroll_manager_efl_ui_scrollable_interactive_scroll_freeze_get(Eo *obj EINA_UNUSED, Efl_Ui_Scroll_Manager_Data *sd)
+_efl_ui_scroll_manager_efl_ui_scrollable_interactive_scroll_freeze_get(const Eo *obj EINA_UNUSED, Efl_Ui_Scroll_Manager_Data *sd)
{
return sd->freeze;
}
@@ -2343,7 +2338,7 @@ _efl_ui_scroll_manager_efl_ui_scrollable_interactive_bounce_enabled_set(Eo *obj
}
EOLIAN static void
-_efl_ui_scroll_manager_efl_ui_scrollable_interactive_bounce_enabled_get(Eo *obj EINA_UNUSED, Efl_Ui_Scroll_Manager_Data *sd, Eina_Bool *horiz, Eina_Bool *vert)
+_efl_ui_scroll_manager_efl_ui_scrollable_interactive_bounce_enabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Scroll_Manager_Data *sd, Eina_Bool *horiz, Eina_Bool *vert)
{
if (horiz) *horiz = sd->bounce_horiz;
if (vert) *vert = sd->bounce_vert;
@@ -2388,7 +2383,7 @@ _efl_ui_scroll_manager_efl_ui_scrollable_interactive_gravity_set(Eo *obj EINA_UN
}
EOLIAN static void
-_efl_ui_scroll_manager_efl_ui_scrollable_interactive_gravity_get(Eo *obj EINA_UNUSED, Efl_Ui_Scroll_Manager_Data *sd, double *x, double *y)
+_efl_ui_scroll_manager_efl_ui_scrollable_interactive_gravity_get(const Eo *obj EINA_UNUSED, Efl_Ui_Scroll_Manager_Data *sd, double *x, double *y)
{
if (x) *x = sd->gravity_x;
if (y) *y = sd->gravity_y;
@@ -2401,7 +2396,7 @@ _efl_ui_scroll_manager_efl_ui_scrollable_interactive_movement_block_set(Eo *obj
}
EOLIAN static Efl_Ui_Scroll_Block
-_efl_ui_scroll_manager_efl_ui_scrollable_interactive_movement_block_get(Eo *obj EINA_UNUSED, Efl_Ui_Scroll_Manager_Data *sd)
+_efl_ui_scroll_manager_efl_ui_scrollable_interactive_movement_block_get(const Eo *obj EINA_UNUSED, Efl_Ui_Scroll_Manager_Data *sd)
{
return sd->block;
}
@@ -2416,7 +2411,7 @@ _efl_ui_scroll_manager_efl_ui_scrollable_interactive_looping_set(Eo *obj EINA_UN
}
EOLIAN static void
-_efl_ui_scroll_manager_efl_ui_scrollable_interactive_looping_get(Eo *obj EINA_UNUSED, Efl_Ui_Scroll_Manager_Data *sd, Eina_Bool *loop_h, Eina_Bool *loop_v)
+_efl_ui_scroll_manager_efl_ui_scrollable_interactive_looping_get(const Eo *obj EINA_UNUSED, Efl_Ui_Scroll_Manager_Data *sd, Eina_Bool *loop_h, Eina_Bool *loop_v)
{
*loop_h = sd->loop_h;
*loop_v = sd->loop_v;
@@ -2456,7 +2451,7 @@ _efl_ui_scroll_manager_efl_object_constructor(Eo *obj, Efl_Ui_Scroll_Manager_Dat
efl_ui_widget_sub_object_add(sd->parent, sd->event_rect);
efl_gfx_color_set(sd->event_rect, 0, 0, 0, 0);
- efl_gfx_visible_set(sd->event_rect, EINA_TRUE);
+ efl_gfx_entity_visible_set(sd->event_rect, EINA_TRUE);
efl_canvas_object_repeat_events_set(sd->event_rect, EINA_TRUE);
_scroll_event_object_attach(obj);
diff --git a/src/lib/elementary/efl_ui_scroll_manager.eo b/src/lib/elementary/efl_ui_scroll_manager.eo
index 462b964511..d0c59ce340 100644
--- a/src/lib/elementary/efl_ui_scroll_manager.eo
+++ b/src/lib/elementary/efl_ui_scroll_manager.eo
@@ -1,6 +1,6 @@
class Efl.Ui.Scroll.Manager (Efl.Object,
Efl.Ui.Base,
- Efl.Ui.Scrollable.Interactive,
+ Efl.Ui.Scrollable_Interactive,
Efl.Ui.Scrollbar)
{
[[Efl ui scroll manager class]]
@@ -8,16 +8,16 @@ class Efl.Ui.Scroll.Manager (Efl.Object,
eo_prefix: efl_ui_scroll_manager;
methods {
@property pan @protected {
- [[This is the internal canvas object managed by scroll manager.
-
- This property is protected as it is meant for scrollable object
- implementations only, to set and access the internal canvas object.
- If pan is set to NULL, scrolling does not work.
- ]]
+ [[This is the internal pan object managed by scroll manager.
+
+ This property is protected as it is meant for scrollable object
+ implementations only, to set and access the internal pan object.
+ If pan is set to NULL, scrolling does not work.
+ ]]
set {
}
values {
- pan: Efl.Canvas.Object @nullable; [[Pan object]]
+ pan: Efl.Ui.Pan @nullable; [[Pan object]]
}
}
}
@@ -25,20 +25,20 @@ class Efl.Ui.Scroll.Manager (Efl.Object,
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Ui.Base.mirrored { set; }
- Efl.Ui.Scrollable.Interactive.content_pos { set; get; }
- Efl.Ui.Scrollable.Interactive.content_size{ get; }
- Efl.Ui.Scrollable.Interactive.viewport_geometry{ get; }
- Efl.Ui.Scrollable.Interactive.bounce_enabled { set; get; }
- Efl.Ui.Scrollable.Interactive.scroll_freeze { get; set; }
- Efl.Ui.Scrollable.Interactive.scroll_hold { get; set; }
- Efl.Ui.Scrollable.Interactive.looping { get; set; }
- Efl.Ui.Scrollable.Interactive.movement_block { get; set; }
- Efl.Ui.Scrollable.Interactive.gravity { get; set; }
- Efl.Ui.Scrollable.Interactive.match_content { set; }
+ Efl.Ui.Scrollable_Interactive.content_pos { set; get; }
+ Efl.Ui.Scrollable_Interactive.content_size{ get; }
+ Efl.Ui.Scrollable_Interactive.viewport_geometry{ get; }
+ Efl.Ui.Scrollable_Interactive.bounce_enabled { set; get; }
+ Efl.Ui.Scrollable_Interactive.scroll_freeze { get; set; }
+ Efl.Ui.Scrollable_Interactive.scroll_hold { get; set; }
+ Efl.Ui.Scrollable_Interactive.looping { get; set; }
+ Efl.Ui.Scrollable_Interactive.movement_block { get; set; }
+ Efl.Ui.Scrollable_Interactive.gravity { get; set; }
+ Efl.Ui.Scrollable_Interactive.match_content { set; }
Efl.Ui.Scrollbar.bar_mode { get; set; }
Efl.Ui.Scrollbar.bar_size { get; }
Efl.Ui.Scrollbar.bar_position { get; set; }
Efl.Ui.Scrollbar.bar_visibility_update;
- Efl.Ui.Scrollable.Interactive.scroll;
+ Efl.Ui.Scrollable_Interactive.scroll;
}
}
diff --git a/src/lib/elementary/efl_ui_scroller.c b/src/lib/elementary/efl_ui_scroller.c
index e10d5b6cce..c7351e916f 100644
--- a/src/lib/elementary/efl_ui_scroller.c
+++ b/src/lib/elementary/efl_ui_scroller.c
@@ -24,7 +24,7 @@
EFL_UI_SCROLLER_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return __VA_ARGS__; \
}
@@ -72,9 +72,9 @@ _efl_ui_scroller_bar_read_and_update(Eo *obj)
double vx, vy;
edje_object_part_drag_value_get
- (wd->resize_obj, "elm.dragable.vbar", NULL, &vy);
+ (wd->resize_obj, "efl.dragable.vbar", NULL, &vy);
edje_object_part_drag_value_get
- (wd->resize_obj, "elm.dragable.hbar", &vx, NULL);
+ (wd->resize_obj, "efl.dragable.hbar", &vx, NULL);
efl_ui_scrollbar_bar_position_set(sd->smanager, vx, vy);
}
@@ -206,8 +206,8 @@ _efl_ui_scroller_bar_size_changed_cb(void *data, const Efl_Event *event EINA_UNU
edje_object_calc_force(wd->resize_obj);
efl_ui_scrollbar_bar_size_get(sd->smanager, &width, &height);
- edje_object_part_drag_size_set(wd->resize_obj, "elm.dragable.hbar", width, 1.0);
- edje_object_part_drag_size_set(wd->resize_obj, "elm.dragable.vbar", 1.0, height);
+ edje_object_part_drag_size_set(wd->resize_obj, "efl.dragable.hbar", width, 1.0);
+ edje_object_part_drag_size_set(wd->resize_obj, "efl.dragable.vbar", 1.0, height);
}
static void
@@ -220,8 +220,8 @@ _efl_ui_scroller_bar_pos_changed_cb(void *data, const Efl_Event *event EINA_UNUS
double posx = 0.0, posy = 0.0;
efl_ui_scrollbar_bar_position_get(sd->smanager, &posx, &posy);
- edje_object_part_drag_value_set(wd->resize_obj, "elm.dragable.hbar", posx, 0.0);
- edje_object_part_drag_value_set(wd->resize_obj, "elm.dragable.vbar", 0.0, posy);
+ edje_object_part_drag_value_set(wd->resize_obj, "efl.dragable.hbar", posx, 0.0);
+ edje_object_part_drag_value_set(wd->resize_obj, "efl.dragable.vbar", 0.0, posy);
}
static void
@@ -233,9 +233,9 @@ _efl_ui_scroller_bar_show_cb(void *data, const Efl_Event *event)
Efl_Ui_Scrollbar_Direction type = *(Efl_Ui_Scrollbar_Direction *)(event->info);
if (type == EFL_UI_SCROLLBAR_DIRECTION_HORIZONTAL)
- edje_object_signal_emit(wd->resize_obj, "elm,action,show,hbar", "elm");
+ edje_object_signal_emit(wd->resize_obj, "efl,action,show,hbar", "efl");
else if (type == EFL_UI_SCROLLBAR_DIRECTION_VERTICAL)
- edje_object_signal_emit(wd->resize_obj, "elm,action,show,vbar", "elm");
+ edje_object_signal_emit(wd->resize_obj, "efl,action,show,vbar", "efl");
}
static void
@@ -247,9 +247,9 @@ _efl_ui_scroller_bar_hide_cb(void *data, const Efl_Event *event)
Efl_Ui_Scrollbar_Direction type = *(Efl_Ui_Scrollbar_Direction *)(event->info);
if (type == EFL_UI_SCROLLBAR_DIRECTION_HORIZONTAL)
- edje_object_signal_emit(wd->resize_obj, "elm,action,hide,hbar", "elm");
+ edje_object_signal_emit(wd->resize_obj, "efl,action,hide,hbar", "efl");
else if (type == EFL_UI_SCROLLBAR_DIRECTION_VERTICAL)
- edje_object_signal_emit(wd->resize_obj, "elm,action,hide,vbar", "elm");
+ edje_object_signal_emit(wd->resize_obj, "efl,action,hide,vbar", "efl");
}
static void
@@ -258,54 +258,54 @@ _scroll_edje_object_attach(Eo *obj)
EFL_UI_SCROLLER_DATA_GET_OR_RETURN(obj, sd);
efl_layout_signal_callback_add
- (obj, "reload", "elm", _efl_ui_scroller_reload_cb, obj);
+ (obj, "reload", "efl", _efl_ui_scroller_reload_cb, obj);
efl_layout_signal_callback_add
- (obj, "drag", "elm.dragable.vbar", _efl_ui_scroller_vbar_drag_cb,
+ (obj, "drag", "efl.dragable.vbar", _efl_ui_scroller_vbar_drag_cb,
obj);
efl_layout_signal_callback_add
- (obj, "drag,set", "elm.dragable.vbar",
+ (obj, "drag,set", "efl.dragable.vbar",
_efl_ui_scroller_edje_drag_cb, obj);
efl_layout_signal_callback_add
- (obj, "drag,start", "elm.dragable.vbar",
+ (obj, "drag,start", "efl.dragable.vbar",
_efl_ui_scroller_edje_drag_start_cb, obj);
efl_layout_signal_callback_add
- (obj, "drag,stop", "elm.dragable.vbar",
+ (obj, "drag,stop", "efl.dragable.vbar",
_efl_ui_scroller_edje_drag_stop_cb, obj);
efl_layout_signal_callback_add
- (obj, "drag,step", "elm.dragable.vbar",
+ (obj, "drag,step", "efl.dragable.vbar",
_efl_ui_scroller_edje_drag_cb, obj);
efl_layout_signal_callback_add
- (obj, "drag,page", "elm.dragable.vbar",
+ (obj, "drag,page", "efl.dragable.vbar",
_efl_ui_scroller_edje_drag_cb, obj);
efl_layout_signal_callback_add
- (obj, "elm,vbar,press", "elm",
+ (obj, "efl,vbar,press", "efl",
_efl_ui_scroller_vbar_press_cb, obj);
efl_layout_signal_callback_add
- (obj, "elm,vbar,unpress", "elm",
+ (obj, "efl,vbar,unpress", "efl",
_efl_ui_scroller_vbar_unpress_cb, obj);
efl_layout_signal_callback_add
- (obj, "drag", "elm.dragable.hbar", _efl_ui_scroller_hbar_drag_cb,
+ (obj, "drag", "efl.dragable.hbar", _efl_ui_scroller_hbar_drag_cb,
obj);
efl_layout_signal_callback_add
- (obj, "drag,set", "elm.dragable.hbar",
+ (obj, "drag,set", "efl.dragable.hbar",
_efl_ui_scroller_edje_drag_cb, obj);
efl_layout_signal_callback_add
- (obj, "drag,start", "elm.dragable.hbar",
+ (obj, "drag,start", "efl.dragable.hbar",
_efl_ui_scroller_edje_drag_start_cb, obj);
efl_layout_signal_callback_add
- (obj, "drag,stop", "elm.dragable.hbar",
+ (obj, "drag,stop", "efl.dragable.hbar",
_efl_ui_scroller_edje_drag_stop_cb, obj);
efl_layout_signal_callback_add
- (obj, "drag,step", "elm.dragable.hbar",
+ (obj, "drag,step", "efl.dragable.hbar",
_efl_ui_scroller_edje_drag_cb, obj);
efl_layout_signal_callback_add
- (obj, "drag,page", "elm.dragable.hbar",
+ (obj, "drag,page", "efl.dragable.hbar",
_efl_ui_scroller_edje_drag_cb, obj);
efl_layout_signal_callback_add
- (obj, "elm,hbar,press", "elm",
+ (obj, "efl,hbar,press", "efl",
_efl_ui_scroller_hbar_press_cb, obj);
efl_layout_signal_callback_add
- (obj, "elm,hbar,unpress", "elm",
+ (obj, "efl,hbar,unpress", "efl",
_efl_ui_scroller_hbar_unpress_cb, obj);
}
@@ -315,54 +315,54 @@ _scroll_edje_object_detach(Evas_Object *obj)
EFL_UI_SCROLLER_DATA_GET_OR_RETURN(obj, sd);
efl_layout_signal_callback_del
- (obj, "reload", "elm", _efl_ui_scroller_reload_cb, obj);
+ (obj, "reload", "efl", _efl_ui_scroller_reload_cb, obj);
efl_layout_signal_callback_del
- (obj, "drag", "elm.dragable.vbar", _efl_ui_scroller_vbar_drag_cb,
+ (obj, "drag", "efl.dragable.vbar", _efl_ui_scroller_vbar_drag_cb,
obj);
efl_layout_signal_callback_del
- (obj, "drag,set", "elm.dragable.vbar",
+ (obj, "drag,set", "efl.dragable.vbar",
_efl_ui_scroller_edje_drag_cb, obj);
efl_layout_signal_callback_del
- (obj, "drag,start", "elm.dragable.vbar",
+ (obj, "drag,start", "efl.dragable.vbar",
_efl_ui_scroller_edje_drag_start_cb, obj);
efl_layout_signal_callback_del
- (obj, "drag,stop", "elm.dragable.vbar",
+ (obj, "drag,stop", "efl.dragable.vbar",
_efl_ui_scroller_edje_drag_stop_cb, obj);
efl_layout_signal_callback_del
- (obj, "drag,step", "elm.dragable.vbar",
+ (obj, "drag,step", "efl.dragable.vbar",
_efl_ui_scroller_edje_drag_cb, obj);
efl_layout_signal_callback_del
- (obj, "drag,page", "elm.dragable.vbar",
+ (obj, "drag,page", "efl.dragable.vbar",
_efl_ui_scroller_edje_drag_cb, obj);
efl_layout_signal_callback_del
- (obj, "elm,vbar,press", "elm",
+ (obj, "efl,vbar,press", "efl",
_efl_ui_scroller_vbar_press_cb, obj);
efl_layout_signal_callback_del
- (obj, "elm,vbar,unpress", "elm",
+ (obj, "efl,vbar,unpress", "efl",
_efl_ui_scroller_vbar_unpress_cb, obj);
efl_layout_signal_callback_del
- (obj, "drag", "elm.dragable.hbar", _efl_ui_scroller_hbar_drag_cb,
+ (obj, "drag", "efl.dragable.hbar", _efl_ui_scroller_hbar_drag_cb,
obj);
efl_layout_signal_callback_del
- (obj, "drag,set", "elm.dragable.hbar",
+ (obj, "drag,set", "efl.dragable.hbar",
_efl_ui_scroller_edje_drag_cb, obj);
efl_layout_signal_callback_del
- (obj, "drag,start", "elm.dragable.hbar",
+ (obj, "drag,start", "efl.dragable.hbar",
_efl_ui_scroller_edje_drag_start_cb, obj);
efl_layout_signal_callback_del
- (obj, "drag,stop", "elm.dragable.hbar",
+ (obj, "drag,stop", "efl.dragable.hbar",
_efl_ui_scroller_edje_drag_stop_cb, obj);
efl_layout_signal_callback_del
- (obj, "drag,step", "elm.dragable.hbar",
+ (obj, "drag,step", "efl.dragable.hbar",
_efl_ui_scroller_edje_drag_cb, obj);
efl_layout_signal_callback_del
- (obj, "drag,page", "elm.dragable.hbar",
+ (obj, "drag,page", "efl.dragable.hbar",
_efl_ui_scroller_edje_drag_cb, obj);
efl_layout_signal_callback_del
- (obj, "elm,hbar,press", "elm",
+ (obj, "efl,hbar,press", "efl",
_efl_ui_scroller_hbar_press_cb, obj);
efl_layout_signal_callback_del
- (obj, "elm,hbar,unpress", "elm",
+ (obj, "efl,hbar,unpress", "efl",
_efl_ui_scroller_hbar_unpress_cb, obj);
}
@@ -401,7 +401,7 @@ _efl_ui_scroller_efl_object_finalize(Eo *obj,
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
- efl_ui_layout_theme_set(obj, "scroller", "base", efl_ui_widget_style_get(obj));
+ efl_ui_layout_object_theme_set(obj, "scroller", "base", efl_ui_widget_style_get(obj));
sd->smanager = efl_add(EFL_UI_SCROLL_MANAGER_CLASS, obj);
efl_ui_mirrored_set(sd->smanager, efl_ui_mirrored_get(obj));
@@ -409,7 +409,7 @@ _efl_ui_scroller_efl_object_finalize(Eo *obj,
sd->pan_obj = efl_add(EFL_UI_PAN_CLASS, obj);
efl_ui_scroll_manager_pan_set(sd->smanager, sd->pan_obj);
- edje_object_part_swallow(wd->resize_obj, "elm.swallow.content", sd->pan_obj);
+ edje_object_part_swallow(wd->resize_obj, "efl.content", sd->pan_obj);
_scroll_edje_object_attach(obj);
@@ -421,11 +421,11 @@ _efl_ui_scroller_efl_object_finalize(Eo *obj,
_efl_ui_scroller_bar_show_cb, obj);
efl_event_callback_add(obj, EFL_UI_SCROLLBAR_EVENT_BAR_HIDE,
_efl_ui_scroller_bar_hide_cb, obj);
- efl_event_callback_add(obj, EFL_GFX_EVENT_RESIZE,
+ efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_RESIZE,
_efl_ui_scroller_resized_cb, obj);
- efl_event_callback_add(obj, EFL_GFX_EVENT_CHANGE_SIZE_HINTS,
+ efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_CHANGE_SIZE_HINTS,
_efl_ui_scroller_size_hint_changed_cb, obj);
- efl_event_callback_add(sd->pan_obj, EFL_GFX_EVENT_RESIZE,
+ efl_event_callback_add(sd->pan_obj, EFL_GFX_ENTITY_EVENT_RESIZE,
_efl_ui_scroller_pan_resized_cb, obj);
return obj;
@@ -445,11 +445,11 @@ _efl_ui_scroller_efl_object_destructor(Eo *obj,
_efl_ui_scroller_bar_show_cb, obj);
efl_event_callback_del(obj, EFL_UI_SCROLLBAR_EVENT_BAR_HIDE,
_efl_ui_scroller_bar_hide_cb, obj);
- efl_event_callback_del(obj, EFL_GFX_EVENT_RESIZE,
+ efl_event_callback_del(obj, EFL_GFX_ENTITY_EVENT_RESIZE,
_efl_ui_scroller_resized_cb, obj);
- efl_event_callback_del(obj, EFL_GFX_EVENT_CHANGE_SIZE_HINTS,
+ efl_event_callback_del(obj, EFL_GFX_ENTITY_EVENT_CHANGE_SIZE_HINTS,
_efl_ui_scroller_size_hint_changed_cb, obj);
- efl_event_callback_del(sd->pan_obj, EFL_GFX_EVENT_RESIZE,
+ efl_event_callback_del(sd->pan_obj, EFL_GFX_ENTITY_EVENT_RESIZE,
_efl_ui_scroller_pan_resized_cb, obj);
efl_del(sd->pan_obj);
sd->pan_obj = NULL;
@@ -499,7 +499,7 @@ _efl_ui_scroller_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Scroller_Data *sd)
else if (min.h > 0)
view.h = min.h;
- if (sd->content) efl_gfx_size_set(sd->content, EINA_SIZE2D(view.w, view.h));
+ if (sd->content) efl_gfx_entity_size_set(sd->content, EINA_SIZE2D(view.w, view.h));
edje_object_size_min_calc(wd->resize_obj, &vmw, &vmh);
@@ -514,7 +514,7 @@ _efl_ui_scroller_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Scroller_Data *sd)
}
EOLIAN static Efl_Ui_Theme_Apply
-_efl_ui_scroller_elm_widget_theme_apply(Eo *obj, Efl_Ui_Scroller_Data *sd)
+_efl_ui_scroller_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Scroller_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
@@ -528,14 +528,14 @@ _efl_ui_scroller_elm_widget_theme_apply(Eo *obj, Efl_Ui_Scroller_Data *sd)
}
EOLIAN static Eina_Size2D
-_efl_ui_scroller_efl_ui_scrollable_interactive_content_size_get(Eo *obj EINA_UNUSED,
+_efl_ui_scroller_efl_ui_scrollable_interactive_content_size_get(const Eo *obj EINA_UNUSED,
Efl_Ui_Scroller_Data *sd)
{
return efl_ui_scrollable_content_size_get(sd->smanager);
}
EOLIAN static Eina_Rect
-_efl_ui_scroller_efl_ui_scrollable_interactive_viewport_geometry_get(Eo *obj EINA_UNUSED,
+_efl_ui_scroller_efl_ui_scrollable_interactive_viewport_geometry_get(const Eo *obj EINA_UNUSED,
Efl_Ui_Scroller_Data *sd)
{
return efl_ui_scrollable_viewport_geometry_get(sd->smanager);
@@ -551,7 +551,7 @@ _efl_ui_scroller_efl_ui_scrollable_interactive_bounce_enabled_set(Eo *obj EINA_U
}
EOLIAN static void
-_efl_ui_scroller_efl_ui_scrollable_interactive_bounce_enabled_get(Eo *obj EINA_UNUSED,
+_efl_ui_scroller_efl_ui_scrollable_interactive_bounce_enabled_get(const Eo *obj EINA_UNUSED,
Efl_Ui_Scroller_Data *sd,
Eina_Bool *horiz,
Eina_Bool *vert)
@@ -560,7 +560,7 @@ _efl_ui_scroller_efl_ui_scrollable_interactive_bounce_enabled_get(Eo *obj EINA_U
}
EOLIAN static Eina_Bool
-_efl_ui_scroller_efl_ui_scrollable_interactive_scroll_hold_get(Eo *obj EINA_UNUSED,
+_efl_ui_scroller_efl_ui_scrollable_interactive_scroll_hold_get(const Eo *obj EINA_UNUSED,
Efl_Ui_Scroller_Data *sd)
{
return efl_ui_scrollable_scroll_hold_get(sd->smanager);
@@ -575,7 +575,7 @@ _efl_ui_scroller_efl_ui_scrollable_interactive_scroll_hold_set(Eo *obj EINA_UNUS
}
EOLIAN static Eina_Bool
-_efl_ui_scroller_efl_ui_scrollable_interactive_scroll_freeze_get(Eo *obj EINA_UNUSED,
+_efl_ui_scroller_efl_ui_scrollable_interactive_scroll_freeze_get(const Eo *obj EINA_UNUSED,
Efl_Ui_Scroller_Data *sd)
{
return efl_ui_scrollable_scroll_freeze_get(sd->smanager);
@@ -613,7 +613,7 @@ _efl_ui_scroller_efl_ui_scrollbar_bar_mode_set(Eo *obj EINA_UNUSED,
}
EOLIAN static void
-_efl_ui_scroller_efl_ui_scrollbar_bar_mode_get(Eo *obj EINA_UNUSED,
+_efl_ui_scroller_efl_ui_scrollbar_bar_mode_get(const Eo *obj EINA_UNUSED,
Efl_Ui_Scroller_Data *sd,
Efl_Ui_Scrollbar_Mode *hmode,
Efl_Ui_Scrollbar_Mode *vmode)
diff --git a/src/lib/elementary/efl_ui_scroller.eo b/src/lib/elementary/efl_ui_scroller.eo
index 805e0de207..65c4f8a5fd 100644
--- a/src/lib/elementary/efl_ui_scroller.eo
+++ b/src/lib/elementary/efl_ui_scroller.eo
@@ -1,5 +1,5 @@
-class Efl.Ui.Scroller (Efl.Ui.Layout,
- Efl.Ui.Scrollable.Interactive,
+class Efl.Ui.Scroller (Efl.Ui.Layout.Object,
+ Efl.Ui.Scrollable_Interactive,
Efl.Ui.Scrollbar,
Efl.Content,
Efl.Ui.Drag)
@@ -10,14 +10,14 @@ class Efl.Ui.Scroller (Efl.Ui.Layout,
Efl.Object.finalize;
Efl.Object.destructor;
Efl.Content.content { set; }
- Elm.Widget.theme_apply;
- Efl.Ui.Scrollable.Interactive.content_size{ get; }
- Efl.Ui.Scrollable.Interactive.viewport_geometry{ get; }
- Efl.Ui.Scrollable.Interactive.bounce_enabled { set; get; }
- Efl.Ui.Scrollable.Interactive.scroll_freeze { get; set; }
- Efl.Ui.Scrollable.Interactive.scroll_hold { get; set; }
- Efl.Ui.Scrollable.Interactive.match_content { set; }
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Scrollable_Interactive.content_size{ get; }
+ Efl.Ui.Scrollable_Interactive.viewport_geometry{ get; }
+ Efl.Ui.Scrollable_Interactive.bounce_enabled { set; get; }
+ Efl.Ui.Scrollable_Interactive.scroll_freeze { get; set; }
+ Efl.Ui.Scrollable_Interactive.scroll_hold { get; set; }
+ Efl.Ui.Scrollable_Interactive.match_content { set; }
Efl.Ui.Scrollbar.bar_mode { get; set; }
- Efl.Ui.Scrollable.Interactive.scroll;
+ Efl.Ui.Scrollable_Interactive.scroll;
}
}
diff --git a/src/lib/elementary/efl_ui_slider.c b/src/lib/elementary/efl_ui_slider.c
index d316278172..ebada1714f 100644
--- a/src/lib/elementary/efl_ui_slider.c
+++ b/src/lib/elementary/efl_ui_slider.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define EFL_ACCESS_VALUE_PROTECTED
#define ELM_LAYOUT_PROTECTED
@@ -16,45 +16,11 @@
#define MY_CLASS EFL_UI_SLIDER_CLASS
#define MY_CLASS_PFX efl_ui_slider
-
#define MY_CLASS_NAME "Efl.Ui.Slider"
-#define MY_CLASS_NAME_LEGACY "elm_slider"
+
#define SLIDER_DELAY_CHANGED_INTERVAL 0.2
#define SLIDER_STEP 0.05
-static const Elm_Layout_Part_Alias_Description _content_aliases[] =
-{
- {"icon", "elm.swallow.icon"},
- {"end", "elm.swallow.end"},
- {NULL, NULL}
-};
-
-static const Elm_Layout_Part_Alias_Description _text_aliases[] =
-{
- {"default", "elm.text"},
- {NULL, NULL}
-};
-
-static const char SIG_CHANGED[] = "changed";
-static const char SIG_DELAY_CHANGED[] = "delay,changed";
-static const char SIG_DRAG_START[] = "slider,drag,start";
-static const char SIG_DRAG_STOP[] = "slider,drag,stop";
-
-static const char PART_NAME_POPUP[] = "popup";
-static const Evas_Smart_Cb_Description _smart_callbacks[] = {
- {SIG_CHANGED, ""},
- {SIG_DELAY_CHANGED, ""},
- {SIG_DRAG_START, ""},
- {SIG_DRAG_STOP, ""},
- {SIG_WIDGET_LANG_CHANGED, ""}, /**< handled by elm_widget */
- {SIG_WIDGET_ACCESS_CHANGED, ""}, /**< handled by elm_widget */
- {SIG_LAYOUT_FOCUSED, ""}, /**< handled by elm_layout */
- {SIG_LAYOUT_UNFOCUSED, ""}, /**< handled by elm_layout */
- {NULL, NULL}
-};
-
-static void _min_max_set(Evas_Object *obj);
-
static Eina_Bool _key_action_drag(Evas_Object *obj, const char *params);
static const Elm_Action key_actions[] = {
@@ -68,7 +34,7 @@ _delay_change(void *data)
EFL_UI_SLIDER_DATA_GET(data, sd);
sd->delay = NULL;
- efl_event_callback_legacy_call(data, EFL_UI_SLIDER_EVENT_DELAY_CHANGED, NULL);
+ efl_event_callback_call(data, EFL_UI_SLIDER_EVENT_DELAY_CHANGED, NULL);
if (_elm_config->atspi_mode)
efl_access_value_changed_signal_emit(data);
@@ -85,79 +51,45 @@ _is_horizontal(Efl_Ui_Dir dir)
static inline Eina_Bool
_is_inverted(Efl_Ui_Dir dir)
{
- if ((dir == EFL_UI_DIR_LEFT) || (dir == EFL_UI_DIR_UP))
+ if ((dir == EFL_UI_DIR_LEFT) || (dir == EFL_UI_DIR_DOWN))
return EINA_TRUE;
return EINA_FALSE;
}
-static Efl_Ui_Dir
-_direction_get(Eina_Bool horizontal, Eina_Bool inverted)
-{
- if (horizontal)
- {
- if (inverted)
- return EFL_UI_DIR_LEFT;
- else
- return EFL_UI_DIR_RIGHT;
- }
- else
- {
- if (inverted)
- return EFL_UI_DIR_UP;
- else
- return EFL_UI_DIR_DOWN;
- }
-}
-
static void
-_val_fetch(Evas_Object *obj, Eina_Bool user_event)
+_efl_ui_slider_val_fetch(Evas_Object *obj, Efl_Ui_Slider_Data *sd, Eina_Bool user_event)
{
Eina_Bool rtl;
double posx = 0.0, posy = 0.0, pos = 0.0, val;
- double posx2 = 0.0, posy2 = 0.0, pos2 = 0.0, val2;
- EFL_UI_SLIDER_DATA_GET(obj, sd);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
- edje_object_part_drag_value_get
- (wd->resize_obj, "elm.dragable.slider", &posx, &posy);
+ if (elm_widget_is_legacy(obj))
+ efl_ui_drag_value_get(efl_part(wd->resize_obj, "elm.dragable.slider"),
+ &posx, &posy);
+ else
+ efl_ui_drag_value_get(efl_part(wd->resize_obj, "efl.dragable.slider"),
+ &posx, &posy);
if (_is_horizontal(sd->dir)) pos = posx;
else pos = posy;
- edje_object_part_drag_value_get
- (wd->resize_obj, "elm.dragable2.slider", &posx2, &posy2);
- if (_is_horizontal(sd->dir)) pos2 = posx2;
- else pos2 = posy2;
-
rtl = efl_ui_mirrored_get(obj);
if ((!rtl && _is_inverted(sd->dir)) ||
(rtl && ((sd->dir == EFL_UI_DIR_UP) ||
(sd->dir == EFL_UI_DIR_RIGHT))))
{
pos = 1.0 - pos;
- pos2 = 1.0 - pos2;
}
val = (pos * (sd->val_max - sd->val_min)) + sd->val_min;
- val2 = (pos2 * (sd->val_max - sd->val_min)) + sd->val_min;
if (fabs(val - sd->val) > DBL_EPSILON)
{
sd->val = val;
- sd->intvl_from = val;
- if (user_event)
- {
- efl_event_callback_legacy_call(obj, EFL_UI_SLIDER_EVENT_CHANGED, NULL);
- ecore_timer_del(sd->delay);
- sd->delay = ecore_timer_add(SLIDER_DELAY_CHANGED_INTERVAL, _delay_change, obj);
- }
- }
- if (fabs(val2 - sd->intvl_to) > DBL_EPSILON)
- {
- sd->intvl_to = val2;
if (user_event)
{
+ efl_event_callback_call(obj, EFL_UI_SLIDER_EVENT_CHANGED, NULL);
efl_event_callback_legacy_call(obj, EFL_UI_SLIDER_EVENT_CHANGED, NULL);
ecore_timer_del(sd->delay);
sd->delay = ecore_timer_add(SLIDER_DELAY_CHANGED_INTERVAL, _delay_change, obj);
@@ -166,30 +98,25 @@ _val_fetch(Evas_Object *obj, Eina_Bool user_event)
}
static void
-_val_set(Evas_Object *obj)
+_efl_ui_slider_val_set(Evas_Object *obj, Efl_Ui_Slider_Data *sd)
{
- Eina_Bool rtl;
- double pos, pos2;
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
- EFL_UI_SLIDER_DATA_GET(obj, sd);
+ Eina_Bool rtl;
+ double pos;
if (sd->val_max > sd->val_min)
{
pos = (sd->val - sd->val_min) / (sd->val_max - sd->val_min);
- pos2 = (sd->intvl_to - sd->val_min) / (sd->val_max - sd->val_min);
}
else
{
pos = 0.0;
- pos2 = 0.0;
}
if (pos < 0.0) pos = 0.0;
else if (pos > 1.0)
pos = 1.0;
- if (pos2 < 0.0) pos2 = 0.0;
- else if (pos2 > 1.0)
- pos2 = 1.0;
rtl = efl_ui_mirrored_get(obj);
if ((!rtl && _is_inverted(sd->dir)) ||
@@ -197,106 +124,52 @@ _val_set(Evas_Object *obj)
(sd->dir == EFL_UI_DIR_RIGHT))))
{
pos = 1.0 - pos;
- pos2 = 1.0 - pos2;
}
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
- edje_object_part_drag_value_set
- (wd->resize_obj, "elm.dragable.slider", pos, pos);
-
- if (sd->intvl_enable)
- edje_object_part_drag_value_set
- (wd->resize_obj, "elm.dragable2.slider", pos2, pos2);
+ if (elm_widget_is_legacy(obj))
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable.slider"),
+ pos, pos);
+ else
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable.slider"),
+ pos, pos);
// emit accessibility event also if value was changed by API
if (_elm_config->atspi_mode)
efl_access_value_changed_signal_emit(obj);
+
+ evas_object_smart_changed(obj);
}
static void
-_units_set(Evas_Object *obj)
+_efl_ui_slider_down_knob(Evas_Object *obj, Efl_Ui_Slider_Data *sd EINA_UNUSED, double button_x, double button_y)
{
- EFL_UI_SLIDER_DATA_GET(obj, sd);
-
- if (sd->format_cb)
- {
- Eina_Value val;
-
- eina_value_setup(&val, EINA_VALUE_TYPE_DOUBLE);
-
- eina_strbuf_reset(sd->format_strbuf);
- if (!sd->intvl_enable)
- eina_value_set(&val, sd->val);
- else
- {
- double v1, v2;
-
- elm_slider_range_get(obj, &v1, &v2);
- eina_value_set(&val, v2 - v1);
- }
-
- sd->format_cb(sd->format_cb_data, sd->format_strbuf, val);
- elm_layout_text_set(obj, "elm.units", eina_strbuf_string_get(sd->format_strbuf));
-
- if (!sd->units_show)
- {
- elm_layout_signal_emit(obj, "elm,state,units,visible", "elm");
- sd->units_show = EINA_TRUE;
- }
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
- eina_value_flush(&val);
- }
+ if (elm_widget_is_legacy(obj))
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable.slider"),
+ button_x, button_y);
else
- {
- elm_layout_text_set(obj, "elm.units", NULL);
- if (sd->units_show)
- {
- elm_layout_signal_emit(obj, "elm,state,units,hidden", "elm");
- sd->units_show = EINA_FALSE;
- }
- }
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable.slider"),
+ button_x, button_y);
}
static void
-_indicator_set(Evas_Object *obj)
+_efl_ui_slider_move_knob(Evas_Object *obj, Efl_Ui_Slider_Data *sd EINA_UNUSED, double button_x, double button_y)
{
- EFL_UI_SLIDER_DATA_GET(obj, sd);
-
- Eina_Value val;
- const char *str;
-
- if (!sd->indi_format_cb) return;
-
- eina_value_setup(&val, EINA_VALUE_TYPE_DOUBLE);
- eina_strbuf_reset(sd->indi_format_strbuf);
-
- eina_value_set(&val, sd->val);
- sd->indi_format_cb(sd->indi_format_cb_data, sd->indi_format_strbuf, val);
-
- str = eina_strbuf_string_get(sd->indi_format_strbuf);
-
- elm_layout_text_set(obj, "elm.indicator", str);
- elm_layout_text_set(obj, "elm.dragable.slider:elm.indicator", str);
- if (sd->popup)
- edje_object_part_text_set(sd->popup, "elm.indicator", str);
-
- if (sd->popup2)
- {
- eina_strbuf_reset(sd->indi_format_strbuf);
- eina_value_set(&val, sd->intvl_to);
- sd->indi_format_cb(sd->indi_format_cb_data, sd->indi_format_strbuf, val);
- str = eina_strbuf_string_get(sd->indi_format_strbuf);
- elm_layout_text_set(obj, "elm.dragable2.slider:elm.indicator", str);
- edje_object_part_text_set(sd->popup2, "elm.indicator", str);
- }
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
- eina_value_flush(&val);
+ if (elm_widget_is_legacy(obj))
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable.slider"),
+ button_x, button_y);
+ else
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable.slider"),
+ button_x, button_y);
}
static void
_slider_update(Evas_Object *obj, Eina_Bool user_event)
{
- _val_fetch(obj, user_event);
+ efl_ui_slider_val_fetch(obj, user_event);
evas_object_smart_changed(obj);
}
@@ -318,7 +191,7 @@ _drag_start(void *data,
if (!efl_ui_focus_object_focus_get(data))
elm_object_focus_set(data, EINA_TRUE);
_slider_update(data, EINA_TRUE);
- efl_event_callback_legacy_call(data, EFL_UI_SLIDER_EVENT_SLIDER_DRAG_START, NULL);
+ efl_event_callback_call(data, EFL_UI_SLIDER_EVENT_SLIDER_DRAG_START, NULL);
elm_widget_scroll_freeze_push(data);
}
@@ -329,7 +202,7 @@ _drag_stop(void *data,
const char *source EINA_UNUSED)
{
_slider_update(data, EINA_TRUE);
- efl_event_callback_legacy_call(data, EFL_UI_SLIDER_EVENT_SLIDER_DRAG_STOP, NULL);
+ efl_event_callback_call(data, EFL_UI_SLIDER_EVENT_SLIDER_DRAG_STOP, NULL);
elm_widget_scroll_freeze_pop(data);
}
@@ -344,7 +217,7 @@ _drag_step(void *data,
static void
_drag_up(void *data,
- Evas_Object *obj EINA_UNUSED,
+ Evas_Object *obj,
const char *emission EINA_UNUSED,
const char *source EINA_UNUSED)
{
@@ -356,13 +229,17 @@ _drag_up(void *data,
if (_is_inverted(sd->dir)) step *= -1.0;
ELM_WIDGET_DATA_GET_OR_RETURN(data, wd);
- edje_object_part_drag_step
- (wd->resize_obj, "elm.dragable.slider", step, step);
+ if (elm_widget_is_legacy(obj))
+ efl_ui_drag_step_move(efl_part(wd->resize_obj, "elm.dragable.slider"),
+ step, step);
+ else
+ efl_ui_drag_step_move(efl_part(wd->resize_obj, "efl.dragable.slider"),
+ step, step);
}
static void
_drag_down(void *data,
- Evas_Object *obj EINA_UNUSED,
+ Evas_Object *obj,
const char *emission EINA_UNUSED,
const char *source EINA_UNUSED)
{
@@ -374,103 +251,12 @@ _drag_down(void *data,
if (_is_inverted(sd->dir)) step *= -1.0;
ELM_WIDGET_DATA_GET_OR_RETURN(data, wd);
- edje_object_part_drag_step
- (wd->resize_obj, "elm.dragable.slider", step, step);
-}
-
-static void
-_popup_show(void *data,
- Evas_Object *obj EINA_UNUSED,
- const char *emission EINA_UNUSED,
- const char *source EINA_UNUSED)
-{
- EFL_UI_SLIDER_DATA_GET(data, sd);
- if (sd->popup &&
- (sd->indicator_visible_mode != ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE))
- {
- evas_object_raise(sd->popup);
- evas_object_show(sd->popup);
- sd->popup_visible = EINA_TRUE;
- edje_object_signal_emit(sd->popup, "popup,show", "elm"); // XXX: for compat
- edje_object_signal_emit(sd->popup, "elm,popup,show", "elm");
- }
- if (sd->popup2 &&
- (sd->indicator_visible_mode != ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE))
- {
- evas_object_raise(sd->popup2);
- evas_object_show(sd->popup2);
- edje_object_signal_emit(sd->popup2, "popup,show", "elm"); // XXX: for compat
- edje_object_signal_emit(sd->popup2, "elm,popup,show", "elm");
- }
- ELM_SAFE_FREE(sd->wheel_indicator_timer, ecore_timer_del);
-}
-
-static void
-_popup_hide(void *data,
- Evas_Object *obj EINA_UNUSED,
- const char *emission EINA_UNUSED,
- const char *source EINA_UNUSED)
-{
- EFL_UI_SLIDER_DATA_GET(data, sd);
-
- if (!sd->popup_visible || !sd->popup) return;
-
- if (sd->indicator_visible_mode == ELM_SLIDER_INDICATOR_VISIBLE_MODE_ALWAYS) return;
- if ((sd->indicator_visible_mode == ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS) &&
- efl_ui_focus_object_focus_get(data))
- return;
-
- edje_object_signal_emit(sd->popup, "popup,hide", "elm"); // XXX: for compat
- edje_object_signal_emit(sd->popup, "elm,popup,hide", "elm");
-
- if (sd->popup2)
- {
- edje_object_signal_emit(sd->popup2, "popup,hide", "elm"); // XXX: for compat
- edje_object_signal_emit(sd->popup2, "elm,popup,hide", "elm");
- }
-}
-
-static void
-_popup_hide_done(void *data,
- Evas_Object *obj EINA_UNUSED,
- const char *emission EINA_UNUSED,
- const char *source EINA_UNUSED)
-{
- EFL_UI_SLIDER_DATA_GET(data, sd);
- if (sd->popup)
- {
- if (!((efl_ui_focus_object_focus_get(data)) &&
- (sd->indicator_visible_mode == ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS)))
- {
- evas_object_hide(sd->popup);
- sd->popup_visible = EINA_FALSE;
- }
- }
- if (sd->popup2)
- {
- if (!((efl_ui_focus_object_focus_get(data)) &&
- (sd->indicator_visible_mode == ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS)))
- {
- evas_object_hide(sd->popup2);
- }
- }
-}
-
-static void
-_popup_emit(void *data,
- Evas_Object *obj EINA_UNUSED,
- const char *emission,
- const char *source)
-{
- EFL_UI_SLIDER_DATA_GET(data, sd);
- if (sd->popup)
- {
- edje_object_signal_emit(sd->popup, emission, source);
- }
- if (sd->popup2)
- {
- edje_object_signal_emit(sd->popup2, emission, source);
- }
+ if (elm_widget_is_legacy(obj))
+ efl_ui_drag_step_move(efl_part(wd->resize_obj, "elm.dragable.slider"),
+ step, step);
+ else
+ efl_ui_drag_step_move(efl_part(wd->resize_obj, "efl.dragable.slider"),
+ step, step);
}
static Eina_Bool
@@ -516,56 +302,51 @@ _key_action_drag(Evas_Object *obj, const char *params)
return EINA_TRUE;
}
-static Eina_Bool
-_wheel_indicator_timer_cb(void *data)
-{
- EFL_UI_SLIDER_DATA_GET(data, sd);
- sd->wheel_indicator_timer = NULL;
-
- _popup_hide(data, NULL, NULL, NULL);
- return ECORE_CALLBACK_CANCEL;
-}
-
-// _slider_elm_widget_widget_event
+// _slider_efl_ui_widget_widget_event
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(slider, Efl_Ui_Slider_Data)
EOLIAN static Eina_Bool
-_efl_ui_slider_elm_widget_widget_event(Eo *obj, Efl_Ui_Slider_Data *sd, const Efl_Event *eo_event, Evas_Object *src)
+_efl_ui_slider_efl_ui_widget_widget_event(Eo *obj, Efl_Ui_Slider_Data *sd, const Efl_Event *eo_event, Evas_Object *src)
{
Eo *ev = eo_event->info;
if (eo_event->desc == EFL_EVENT_KEY_DOWN)
{
- if (!_slider_elm_widget_widget_event(obj, sd, eo_event, src))
+ if (!_slider_efl_ui_widget_widget_event(obj, sd, eo_event, src))
return EINA_FALSE;
}
else if (eo_event->desc == EFL_EVENT_KEY_UP)
{
- _popup_hide(obj, NULL, NULL, NULL);
return EINA_FALSE;
}
else if (eo_event->desc == EFL_EVENT_POINTER_WHEEL)
{
if (efl_input_processed_get(ev)) return EINA_FALSE;
if (efl_input_pointer_wheel_delta_get(ev) < 0)
- _drag_up(obj, NULL, NULL, NULL);
- else _drag_down(obj, NULL, NULL, NULL);
+ {
+ if (_is_horizontal(sd->dir))
+ _drag_up(obj, NULL, NULL, NULL);
+ else
+ _drag_down(obj, NULL, NULL, NULL);
+ }
+ else
+ {
+ if (_is_horizontal(sd->dir))
+ _drag_down(obj, NULL, NULL, NULL);
+ else
+ _drag_up(obj, NULL, NULL, NULL);
+ }
efl_input_processed_set(ev, EINA_TRUE);
- ELM_SAFE_FREE(sd->wheel_indicator_timer, ecore_timer_del);
- sd->wheel_indicator_timer =
- ecore_timer_add(0.5, _wheel_indicator_timer_cb, obj);
-
}
else return EINA_FALSE;
- _popup_show(obj, NULL, NULL, NULL);
_slider_update(obj, EINA_TRUE);
return EINA_TRUE;
}
EOLIAN static Eina_Bool
-_efl_ui_slider_elm_widget_on_access_activate(Eo *obj, Efl_Ui_Slider_Data *sd, Efl_Ui_Activate act)
+_efl_ui_slider_efl_ui_widget_on_access_activate(Eo *obj, Efl_Ui_Slider_Data *sd, Efl_Ui_Activate act)
{
if (elm_widget_disabled_get(obj)) return EINA_FALSE;
if (act == EFL_UI_ACTIVATE_DEFAULT) return EINA_FALSE;
@@ -590,149 +371,17 @@ _efl_ui_slider_elm_widget_on_access_activate(Eo *obj, Efl_Ui_Slider_Data *sd, Ef
return EINA_TRUE;
}
-static void
-_visuals_refresh(Evas_Object *obj)
-{
- _val_set(obj);
- evas_object_smart_changed(obj);
-}
-
-static void
-_track_move_cb(void *data,
- Evas *e EINA_UNUSED,
- Evas_Object *obj,
- void *event_info EINA_UNUSED)
-{
- Evas_Coord x, y;
-
- EFL_UI_SLIDER_DATA_GET(data, sd);
- evas_object_geometry_get(obj, &x, &y, NULL, NULL);
- evas_object_move(sd->popup, x, y);
-}
-
-static void
-_track2_move_cb(void *data,
- Evas *e EINA_UNUSED,
- Evas_Object *obj,
- void *event_info EINA_UNUSED)
-{
- Evas_Coord x, y;
-
- EFL_UI_SLIDER_DATA_GET(data, sd);
- evas_object_geometry_get(obj, &x, &y, NULL, NULL);
- evas_object_move(sd->popup2, x, y);
-}
-
-static void
-_track_resize_cb(void *data,
- Evas *e EINA_UNUSED,
- Evas_Object *obj,
- void *event_info EINA_UNUSED)
-{
- Evas_Coord w, h;
-
- EFL_UI_SLIDER_DATA_GET(data, sd);
- evas_object_geometry_get(obj, NULL, NULL, &w, &h);
- evas_object_resize(sd->popup, w, h);
-}
-
-static void
-_track2_resize_cb(void *data,
- Evas *e EINA_UNUSED,
- Evas_Object *obj,
- void *event_info EINA_UNUSED)
-{
- Evas_Coord w, h;
-
- EFL_UI_SLIDER_DATA_GET(data, sd);
- evas_object_geometry_get(obj, NULL, NULL, &w, &h);
- evas_object_resize(sd->popup2, w, h);
-}
-
-static void
-_popup_update(Evas_Object *obj, Efl_Ui_Slider_Data *sd, Evas_Object *popup)
-{
- if (elm_widget_is_legacy(obj))
- {
- if (_is_horizontal(sd->dir))
- elm_widget_theme_object_set(obj, popup, "slider", "horizontal/popup", elm_widget_style_get(obj));
- else
- elm_widget_theme_object_set(obj, popup, "slider", "vertical/popup", elm_widget_style_get(obj));
- }
- else
- elm_widget_element_update(obj, popup, PART_NAME_POPUP);
- edje_object_scale_set(popup, efl_gfx_scale_get(obj) *
- elm_config_scale_get());
-
- if (!_is_inverted(sd->dir))
- edje_object_signal_emit(popup, "elm,state,inverted,off", "elm");
- else
- edje_object_signal_emit(popup, "elm,state,inverted,on", "elm");
-
- if (sd->indicator_show)
- edje_object_signal_emit(popup, "elm,state,val,show", "elm");
- else
- edje_object_signal_emit(popup, "elm,state,val,hide", "elm");
-}
-
-static void
-_popup_add(Efl_Ui_Slider_Data *sd, Eo *obj, Evas_Object **popup,
- Evas_Object **track, Eina_Bool is_range)
-{
- /* if theme has an overlayed slider mode, then lets support it */
- if (!is_range
- && !edje_object_part_exists(elm_layout_edje_get(obj), "elm.track.slider"))
- return;
- else if (is_range
- && !edje_object_part_exists(elm_layout_edje_get(obj), "elm.track2.slider"))
- return;
-
- // XXX popup needs to adapt to theme etc.
- *popup = edje_object_add(evas_object_evas_get(obj));
- evas_object_smart_member_add(*popup, obj);
- edje_object_signal_callback_add(*popup, "popup,hide,done", "elm", // XXX: for compat
- _popup_hide_done, obj);
- edje_object_signal_callback_add(*popup, "elm,popup,hide,done", "elm",
- _popup_hide_done, obj);
-
- _popup_update(obj, sd, *popup);
-
- /* create a rectangle to track position+size of the dragable */
- *track = evas_object_rectangle_add(evas_object_evas_get(obj));
- evas_object_color_set(*track, 0, 0, 0, 0);
- evas_object_pass_events_set(*track, EINA_TRUE);
- if (!is_range)
- {
- evas_object_event_callback_add
- (*track, EVAS_CALLBACK_MOVE, _track_move_cb, obj);
- evas_object_event_callback_add
- (*track, EVAS_CALLBACK_RESIZE, _track_resize_cb, obj);
- elm_layout_content_set(obj, "elm.track.slider", *track);
- }
- else
- {
- evas_object_event_callback_add
- (*track, EVAS_CALLBACK_MOVE, _track2_move_cb, obj);
- evas_object_event_callback_add
- (*track, EVAS_CALLBACK_RESIZE, _track2_resize_cb, obj);
- elm_layout_content_set(obj, "elm.track2.slider", *track);
- }
-}
-
static const char *
-_theme_group_modify_pos_get(const char *cur_group, const char *search, size_t len, Eina_Bool is_legacy)
+_theme_group_modify_pos_get(const char *cur_group, const char *search, size_t len)
{
const char *pos = NULL;
const char *temp_str = NULL;
- if (is_legacy)
- return cur_group;
-
temp_str = cur_group + len - strlen(search);
if (temp_str >= cur_group)
{
- if (!strcmp(temp_str, search))
- pos = temp_str;
+ if (!strcmp(temp_str, search))
+ pos = temp_str;
}
return pos;
@@ -744,32 +393,28 @@ _efl_ui_slider_theme_group_get(Evas_Object *obj, Efl_Ui_Slider_Data *sd)
const char *pos = NULL;
const char *cur_group = elm_widget_theme_element_get(obj);
Eina_Strbuf *new_group = eina_strbuf_new();
- Eina_Bool is_legacy = elm_widget_is_legacy(obj);
size_t len = 0;
if (cur_group)
{
len = strlen(cur_group);
- pos = _theme_group_modify_pos_get(cur_group, "horizontal", len, is_legacy);
+ pos = _theme_group_modify_pos_get(cur_group, "horizontal", len);
if (!pos)
- pos = _theme_group_modify_pos_get(cur_group, "vertical", len, is_legacy);
-
+ pos = _theme_group_modify_pos_get(cur_group, "vertical", len);
// TODO: change separator when it is decided.
// can skip when prev_group == cur_group
if (!pos)
{
- eina_strbuf_append(new_group, cur_group);
- eina_strbuf_append(new_group, "/");
+ eina_strbuf_append(new_group, cur_group);
+ eina_strbuf_append(new_group, "/");
}
else
{
- eina_strbuf_append_length(new_group, cur_group, pos - cur_group);
+ eina_strbuf_append_length(new_group, cur_group, pos - cur_group);
}
}
- if (is_legacy && sd->intvl_enable)
- eina_strbuf_append(new_group, "range/");
if (_is_horizontal(sd->dir))
eina_strbuf_append(new_group, "horizontal");
else
@@ -779,7 +424,7 @@ _efl_ui_slider_theme_group_get(Evas_Object *obj, Efl_Ui_Slider_Data *sd)
}
EOLIAN static Efl_Ui_Theme_Apply
-_efl_ui_slider_elm_widget_theme_apply(Eo *obj, Efl_Ui_Slider_Data *sd)
+_efl_ui_slider_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Slider_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
@@ -795,55 +440,24 @@ _efl_ui_slider_elm_widget_theme_apply(Eo *obj, Efl_Ui_Slider_Data *sd)
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
- if (_is_horizontal(sd->dir))
- evas_object_size_hint_min_set
- (sd->spacer, (double)sd->size * efl_gfx_scale_get(obj) *
- elm_config_scale_get(), 1);
- else
- evas_object_size_hint_min_set
- (sd->spacer, 1, (double)sd->size * efl_gfx_scale_get(obj) *
- elm_config_scale_get());
-
- if (sd->intvl_enable)
- elm_layout_signal_emit(obj, "elm,slider,range,enable", "elm");
- else
- elm_layout_signal_emit(obj, "elm,slider,range,disable", "elm");
-
- if (_is_inverted(sd->dir))
- elm_layout_signal_emit(obj, "elm,state,inverted,on", "elm");
- else
- elm_layout_signal_emit(obj, "elm,state,inverted,off", "elm");
-
- if (sd->indicator_show)
- elm_layout_signal_emit(obj, "elm,state,val,show", "elm");
- else
- elm_layout_signal_emit(obj, "elm,state,val,hide", "elm");
-
-
- if (!sd->popup)
- _popup_add(sd, obj, &sd->popup, &sd->track, sd->intvl_enable);
+ if (elm_widget_is_legacy(obj))
+ {
+ if (_is_inverted(sd->dir))
+ efl_layout_signal_emit(obj, "elm,state,inverted,on", "elm");
+ else
+ efl_layout_signal_emit(obj, "elm,state,inverted,off", "elm");
+ }
else
- _popup_update(obj, sd, sd->popup);
-
- if (sd->intvl_enable)
{
- if (!sd->popup2)
- _popup_add(sd, obj, &sd->popup2, &sd->track2, EINA_TRUE);
+ if (_is_inverted(sd->dir))
+ efl_layout_signal_emit(obj, "efl,state,inverted,on", "efl");
else
- _popup_update(obj, sd, sd->popup2);
+ efl_layout_signal_emit(obj, "efl,state,inverted,off", "efl");
}
- _min_max_set(obj);
- _units_set(obj);
- _indicator_set(obj);
- _visuals_refresh(obj);
-
- edje_object_message_signal_process(wd->resize_obj);
- if (sd->popup)
- edje_object_message_signal_process(sd->popup);
- if (sd->popup2)
- edje_object_message_signal_process(sd->popup2);
+ efl_ui_slider_val_set(obj);
+ efl_layout_signal_process(wd->resize_obj, EINA_FALSE);
evas_object_smart_changed(obj);
return int_ret;
@@ -858,56 +472,8 @@ _efl_ui_slider_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Slider_Data *_pd EINA_UNUS
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
edje_object_size_min_restricted_calc
(wd->resize_obj, &minw, &minh, minw, minh);
- evas_object_size_hint_min_set(obj, minw, minh);
- evas_object_size_hint_max_set(obj, -1, -1);
-}
-
-static void
-_move_knob_on_mouse(Evas_Object *obj, double button_x, double button_y)
-{
- EFL_UI_SLIDER_DATA_GET(obj, sd);
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
-
- if (!sd->intvl_enable)
- {
- edje_object_part_drag_value_set
- (wd->resize_obj, "elm.dragable.slider",
- button_x, button_y);
- }
- else
- {
- double posx = 0.0, posy = 0.0, posx2 = 0.0, posy2 = 0.0, diff1, diff2;
-
- edje_object_part_drag_value_get
- (wd->resize_obj, "elm.dragable.slider", &posx, &posy);
- edje_object_part_drag_value_get
- (wd->resize_obj, "elm.dragable2.slider", &posx2, &posy2);
-
- if (_is_horizontal(sd->dir))
- {
- diff1 = fabs(button_x - posx);
- diff2 = fabs(button_x - posx2);
- }
- else
- {
- diff1 = fabs(button_y - posy);
- diff2 = fabs(button_y - posy2);
- }
-
- if (diff1 < diff2)
- {
- edje_object_part_drag_value_set
- (wd->resize_obj, "elm.dragable.slider",
- button_x, button_y);
- }
- else
- {
- edje_object_part_drag_value_set
- (wd->resize_obj, "elm.dragable2.slider",
- button_x, button_y);
- }
- }
-
+ efl_gfx_size_hint_restricted_min_set(obj, EINA_SIZE2D(minw, minh));
+ efl_gfx_size_hint_max_set(obj, EINA_SIZE2D(-1, -1));
}
static void
@@ -919,34 +485,32 @@ _spacer_down_cb(void *data,
EFL_UI_SLIDER_DATA_GET(data, sd);
Evas_Event_Mouse_Down *ev = event_info;
- Evas_Coord x, y, w, h;
+ Eina_Rect sr;
double button_x = 0.0, button_y = 0.0;
sd->spacer_down = EINA_TRUE;
- sd->val2 = sd->val;
- evas_object_geometry_get(sd->spacer, &x, &y, &w, &h);
- sd->downx = ev->canvas.x - x;
- sd->downy = ev->canvas.y - y;
+ sr = efl_gfx_entity_geometry_get(sd->spacer);
+ sd->downx = ev->canvas.x - sr.x;
+ sd->downy = ev->canvas.y - sr.y;
if (_is_horizontal(sd->dir))
{
- button_x = ((double)ev->canvas.x - (double)x) / (double)w;
+ button_x = ((double)ev->canvas.x - (double)sr.x) / (double)sr.w;
if (button_x > 1) button_x = 1;
if (button_x < 0) button_x = 0;
}
else
{
- button_y = ((double)ev->canvas.y - (double)y) / (double)h;
+ button_y = ((double)ev->canvas.y - (double)sr.y) / (double)sr.h;
if (button_y > 1) button_y = 1;
if (button_y < 0) button_y = 0;
}
- _move_knob_on_mouse(data, button_x, button_y);
+ efl_ui_slider_down_knob(data, button_x, button_y);
if (!efl_ui_focus_object_focus_get(data))
elm_object_focus_set(data, EINA_TRUE);
_slider_update(data, EINA_TRUE);
- efl_event_callback_legacy_call(data, EFL_UI_SLIDER_EVENT_SLIDER_DRAG_START, NULL);
- elm_layout_signal_emit(data, "elm,state,indicator,show", "elm");
+ efl_event_callback_call(data, EFL_UI_SLIDER_EVENT_SLIDER_DRAG_START, NULL);
}
static void
@@ -957,7 +521,7 @@ _spacer_move_cb(void *data,
{
EFL_UI_SLIDER_DATA_GET(data, sd);
- Evas_Coord x, y, w, h;
+ Eina_Rect sr;
double button_x = 0.0, button_y = 0.0;
Evas_Event_Mouse_Move *ev = event_info;
@@ -965,10 +529,10 @@ _spacer_move_cb(void *data,
{
Evas_Coord d = 0;
- evas_object_geometry_get(sd->spacer, &x, &y, &w, &h);
+ sr = efl_gfx_entity_geometry_get(sd->spacer);
if (_is_horizontal(sd->dir))
- d = abs(ev->cur.canvas.x - x - sd->downx);
- else d = abs(ev->cur.canvas.y - y - sd->downy);
+ d = abs(ev->cur.canvas.x - sr.x - sd->downx);
+ else d = abs(ev->cur.canvas.y - sr.y - sd->downy);
if (d > (_elm_config->thumbscroll_threshold - 1))
{
if (!sd->frozen)
@@ -983,31 +547,29 @@ _spacer_move_cb(void *data,
{
if (sd->spacer_down) sd->spacer_down = EINA_FALSE;
_slider_update(data, EINA_TRUE);
- efl_event_callback_legacy_call
+ efl_event_callback_call
(data, EFL_UI_SLIDER_EVENT_SLIDER_DRAG_STOP, NULL);
if (sd->frozen)
{
elm_widget_scroll_freeze_pop(data);
sd->frozen = EINA_FALSE;
}
- elm_layout_signal_emit(data, "elm,state,indicator,hide", "elm");
- elm_slider_value_set(data, sd->val2);
return;
}
if (_is_horizontal(sd->dir))
{
- button_x = ((double)ev->cur.canvas.x - (double)x) / (double)w;
+ button_x = ((double)ev->cur.canvas.x - (double)sr.x) / (double)sr.w;
if (button_x > 1) button_x = 1;
if (button_x < 0) button_x = 0;
}
else
{
- button_y = ((double)ev->cur.canvas.y - (double)y) / (double)h;
+ button_y = ((double)ev->cur.canvas.y - (double)sr.y) / (double)sr.h;
if (button_y > 1) button_y = 1;
if (button_y < 0) button_y = 0;
}
- _move_knob_on_mouse(data, button_x, button_y);
+ efl_ui_slider_move_knob(data, button_x, button_y);
_slider_update(data, EINA_TRUE);
}
}
@@ -1024,62 +586,13 @@ _spacer_up_cb(void *data,
if (sd->spacer_down) sd->spacer_down = EINA_FALSE;
_slider_update(data, EINA_TRUE);
- efl_event_callback_legacy_call(data, EFL_UI_SLIDER_EVENT_SLIDER_DRAG_STOP, NULL);
+ efl_event_callback_call(data, EFL_UI_SLIDER_EVENT_SLIDER_DRAG_STOP, NULL);
if (sd->frozen)
{
elm_widget_scroll_freeze_pop(data);
sd->frozen = EINA_FALSE;
}
- elm_layout_signal_emit(data, "elm,state,indicator,hide", "elm");
-}
-
-static void
-_min_max_set(Evas_Object *obj)
-{
- EFL_UI_SLIDER_DATA_GET(obj, sd);
- Eina_Strbuf *str;
- Eina_Value val;
-
- if (!sd->format_cb) return;
- eina_value_setup(&val, EINA_VALUE_TYPE_DOUBLE);
-
- str = eina_strbuf_new();
-
- eina_value_set(&val, sd->val_max);
- sd->format_cb(sd->format_cb_data, str, val);
- elm_layout_text_set(obj, "elm.units.min", eina_strbuf_string_get(str));
-
- eina_strbuf_reset(str);
-
- eina_value_set(&val, sd->val_min);
- sd->format_cb(sd->format_cb_data, str, val);
- elm_layout_text_set(obj, "elm.units.max", eina_strbuf_string_get(str));
-
- eina_strbuf_free(str);
- eina_value_flush(&val);
-}
-
-EOLIAN static void
-_efl_ui_slider_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Slider_Data *sd)
-{
- elm_layout_freeze(obj);
-
- if (_is_horizontal(sd->dir))
- evas_object_size_hint_min_set
- (sd->spacer, (double)sd->size * efl_gfx_scale_get(obj) *
- elm_config_scale_get(), 1);
- else
- evas_object_size_hint_min_set
- (sd->spacer, 1, (double)sd->size * efl_gfx_scale_get(obj) *
- elm_config_scale_get());
-
- _val_fetch(obj, EINA_FALSE);
- _min_max_set(obj);
- _units_set(obj);
- _indicator_set(obj);
-
- elm_layout_thaw(obj);
}
static char *
@@ -1098,9 +611,6 @@ _access_state_cb(void *data EINA_UNUSED, Evas_Object *obj)
{
char *ret;
Eina_Strbuf *buf = eina_strbuf_new();
- const char *txt = elm_layout_text_get(obj, "elm.units");
-
- if (txt) eina_strbuf_append(buf, txt);
if (elm_widget_disabled_get(obj))
eina_strbuf_append(buf, " state: disabled");
@@ -1116,66 +626,46 @@ _access_state_cb(void *data EINA_UNUSED, Evas_Object *obj)
return NULL;
}
-static void
-_on_show(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj,
- void *event_info EINA_UNUSED)
-{
- EFL_UI_SLIDER_DATA_GET(obj, sd);
- if (sd->indicator_visible_mode == ELM_SLIDER_INDICATOR_VISIBLE_MODE_ALWAYS)
- _popup_show(obj, NULL, NULL, NULL);
-}
-
-EOLIAN static void
-_efl_ui_slider_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Slider_Data *priv)
+EOLIAN static Eo *
+_efl_ui_slider_efl_object_constructor(Eo *obj, Efl_Ui_Slider_Data *priv)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
char *group;
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_SLIDER);
+
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
if (!elm_widget_theme_klass_get(obj))
elm_widget_theme_klass_set(obj, "slider");
- efl_canvas_group_add(efl_super(obj, MY_CLASS));
elm_widget_sub_object_parent_add(obj);
- priv->dir = EFL_UI_DIR_RIGHT;
- priv->indicator_show = EINA_TRUE;
- priv->indicator_visible_mode = elm_config_slider_indicator_visible_mode_get();
- priv->val_max = 1.0;
- //TODO: customize this time duration from api or theme data.
- priv->wheel_indicator_duration = 0.25;
- priv->step = SLIDER_STEP;
-
group = _efl_ui_slider_theme_group_get(obj, priv);
-
if (!elm_widget_theme_object_set(obj, wd->resize_obj,
- elm_widget_theme_klass_get(obj),
- group,
- elm_widget_theme_style_get(obj)))
+ elm_widget_theme_klass_get(obj),
+ group,
+ elm_widget_theme_style_get(obj)))
CRI("Failed to set layout!");
free(group);
- elm_layout_signal_callback_add(obj, "drag", "*", _drag, obj);
- elm_layout_signal_callback_add(obj, "drag,start", "*", _drag_start, obj);
- elm_layout_signal_callback_add(obj, "drag,stop", "*", _drag_stop, obj);
- elm_layout_signal_callback_add(obj, "drag,step", "*", _drag_step, obj);
- elm_layout_signal_callback_add(obj, "drag,page", "*", _drag_stop, obj);
- elm_layout_signal_callback_add(obj, "popup,show", "elm", _popup_show, obj); // XXX: for compat
- elm_layout_signal_callback_add(obj, "popup,hide", "elm", _popup_hide, obj); // XXX: for compat
- elm_layout_signal_callback_add(obj, "elm,popup,show", "elm", _popup_show, obj);
- elm_layout_signal_callback_add(obj, "elm,popup,hide", "elm", _popup_hide, obj);
- elm_layout_signal_callback_add(obj, "*", "popup,emit", _popup_emit, obj);
- edje_object_part_drag_value_set
- (wd->resize_obj, "elm.dragable.slider", 0.0, 0.0);
-
- priv->spacer = evas_object_rectangle_add(evas_object_evas_get(obj));
- evas_object_color_set(priv->spacer, 0, 0, 0, 0);
- evas_object_pass_events_set(priv->spacer, EINA_TRUE);
- elm_layout_content_set(obj, "elm.swallow.bar", priv->spacer);
-
- if (!priv->intvl_enable)
- _popup_add(priv, obj, &priv->popup, &priv->track, priv->intvl_enable);
+ priv->dir = EFL_UI_DIR_RIGHT;
+ priv->val_max = 1.0;
+ priv->step = SLIDER_STEP;
+
+ efl_layout_signal_callback_add(obj, "drag", "*", _drag, obj);
+ efl_layout_signal_callback_add(obj, "drag,start", "*", _drag_start, obj);
+ efl_layout_signal_callback_add(obj, "drag,stop", "*", _drag_stop, obj);
+ efl_layout_signal_callback_add(obj, "drag,step", "*", _drag_step, obj);
+ efl_layout_signal_callback_add(obj, "drag,page", "*", _drag_stop, obj);
+
+ priv->spacer = efl_add(EFL_CANVAS_RECTANGLE_CLASS, obj,
+ efl_gfx_color_set(efl_added, 0, 0, 0, 0),
+ efl_canvas_object_pass_events_set(efl_added, EINA_TRUE));
+
+ if (elm_widget_is_legacy(obj))
+ efl_content_set(efl_part(obj, "elm.swallow.bar"), priv->spacer);
else
- _popup_add(priv, obj, &priv->popup2, &priv->track2, priv->intvl_enable);
+ efl_content_set(efl_part(obj, "efl.bar"), priv->spacer);
evas_object_event_callback_add
(priv->spacer, EVAS_CALLBACK_MOUSE_DOWN, _spacer_down_cb, obj);
@@ -1184,9 +674,7 @@ _efl_ui_slider_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Slider_Data *priv)
evas_object_event_callback_add
(priv->spacer, EVAS_CALLBACK_MOUSE_UP, _spacer_up_cb, obj);
- evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _on_show, NULL);
-
- elm_widget_can_focus_set(obj, EINA_TRUE);
+ efl_ui_widget_focus_allow_set(obj, EINA_TRUE);
_elm_access_object_register(obj, wd->resize_obj);
_elm_access_text_set
@@ -1196,37 +684,18 @@ _efl_ui_slider_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Slider_Data *priv)
_elm_access_callback_set
(_elm_access_info_get(obj), ELM_ACCESS_STATE, _access_state_cb, NULL);
- efl_ui_format_string_set(efl_part(obj, "indicator"), "%0.2f");
-
evas_object_smart_changed(obj);
+
+ return obj;
}
EOLIAN static void
-_efl_ui_slider_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Slider_Data *sd)
+_efl_ui_slider_efl_object_destructor(Eo *obj,
+ Efl_Ui_Slider_Data *sd)
{
ecore_timer_del(sd->delay);
- ecore_timer_del(sd->wheel_indicator_timer);
- evas_object_del(sd->popup);
- evas_object_del(sd->popup2);
-
- ELM_SAFE_FREE(sd->indi_template, eina_stringshare_del);
- eina_strbuf_free(sd->indi_format_strbuf);
-
- efl_ui_format_cb_set(obj, NULL, NULL, NULL);
- eina_strbuf_free(sd->format_strbuf);
-
- efl_canvas_group_del(efl_super(obj, MY_CLASS));
-}
-
-EOLIAN static Eo *
-_efl_ui_slider_efl_object_constructor(Eo *obj, Efl_Ui_Slider_Data *_pd EINA_UNUSED)
-{
- obj = efl_constructor(efl_super(obj, MY_CLASS));
- efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
- evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_SLIDER);
- return obj;
+ efl_destructor(efl_super(obj, MY_CLASS));
}
EOLIAN static void
@@ -1238,7 +707,7 @@ _efl_ui_slider_efl_ui_direction_direction_set(Eo *obj, Efl_Ui_Slider_Data *sd, E
}
EOLIAN static Efl_Ui_Dir
-_efl_ui_slider_efl_ui_direction_direction_get(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd)
+_efl_ui_slider_efl_ui_direction_direction_get(const Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd)
{
return sd->dir;
}
@@ -1252,11 +721,11 @@ _efl_ui_slider_efl_ui_range_range_min_max_set(Eo *obj, Efl_Ui_Slider_Data *sd, d
if (sd->val < sd->val_min) sd->val = sd->val_min;
if (sd->val > sd->val_max) sd->val = sd->val_max;
- _visuals_refresh(obj);
+ efl_ui_slider_val_set(obj);
}
EOLIAN static void
-_efl_ui_slider_efl_ui_range_range_min_max_get(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd, double *min, double *max)
+_efl_ui_slider_efl_ui_range_range_min_max_get(const Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd, double *min, double *max)
{
if (min) *min = sd->val_min;
if (max) *max = sd->val_max;
@@ -1267,22 +736,27 @@ _efl_ui_slider_efl_ui_range_range_value_set(Eo *obj, Efl_Ui_Slider_Data *sd, dou
{
if (sd->val == val) return;
sd->val = val;
- sd->intvl_from = val;
if (sd->val < sd->val_min) sd->val = sd->val_min;
if (sd->val > sd->val_max) sd->val = sd->val_max;
- _visuals_refresh(obj);
+ efl_ui_slider_val_set(obj);
}
EOLIAN static double
-_efl_ui_slider_efl_ui_range_range_value_get(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd)
+_efl_ui_slider_efl_ui_range_range_value_get(const Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd)
{
return sd->val;
}
+EOLIAN static double
+_efl_ui_slider_efl_ui_range_range_step_get(const Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd)
+{
+ return sd->step;
+}
+
EOLIAN static void
-_efl_ui_slider_step_set(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd, double step)
+_efl_ui_slider_efl_ui_range_range_step_set(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd, double step)
{
if (sd->step == step) return;
@@ -1292,37 +766,20 @@ _efl_ui_slider_step_set(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd, double step
sd->step = step;
}
-EOLIAN static double
-_efl_ui_slider_step_get(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd)
-{
- return sd->step;
-}
-
EOLIAN static Eina_Bool
-_efl_ui_slider_elm_widget_on_focus_update(Eo *obj, Efl_Ui_Slider_Data *sd EINA_UNUSED, Elm_Object_Item *item EINA_UNUSED)
+_efl_ui_slider_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Slider_Data *sd EINA_UNUSED)
{
Eina_Bool int_ret = EINA_FALSE;
- int_ret = efl_ui_widget_on_focus_update(efl_super(obj, MY_CLASS), NULL);
-
- if ((sd->indicator_visible_mode == ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS) && efl_ui_focus_object_focus_get(obj))
- _popup_show(obj, NULL, NULL, NULL);
- else if (!efl_ui_focus_object_focus_get(obj))
- _popup_hide(obj, NULL, NULL, NULL);
+ int_ret = efl_ui_focus_object_on_focus_update(efl_super(obj, MY_CLASS));
return int_ret;
}
-EOLIAN static void
-_efl_ui_slider_class_constructor(Efl_Class *klass)
-{
- evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
-}
-
// A11Y Accessibility
EOLIAN static void
-_efl_ui_slider_efl_access_value_value_and_text_get(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd, double *value, const char **text)
+_efl_ui_slider_efl_access_value_value_and_text_get(const Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd, double *value, const char **text)
{
if (value) *value = sd->val;
if (text) *text = NULL;
@@ -1336,18 +793,18 @@ _efl_ui_slider_efl_access_value_value_and_text_set(Eo *obj, Efl_Ui_Slider_Data *
if (value < sd->val_min) value = sd->val_min;
if (value > sd->val_max) value = sd->val_max;
- efl_event_callback_legacy_call(obj, EFL_UI_SLIDER_EVENT_SLIDER_DRAG_START, NULL);
+ efl_event_callback_call(obj, EFL_UI_SLIDER_EVENT_SLIDER_DRAG_START, NULL);
sd->val = value;
- _visuals_refresh(obj);
+ efl_ui_slider_val_set(obj);
sd->val = oldval;
_slider_update(obj, EINA_TRUE);
- efl_event_callback_legacy_call(obj, EFL_UI_SLIDER_EVENT_SLIDER_DRAG_STOP, NULL);
+ efl_event_callback_call(obj, EFL_UI_SLIDER_EVENT_SLIDER_DRAG_STOP, NULL);
return EINA_TRUE;
}
EOLIAN static void
-_efl_ui_slider_efl_access_value_range_get(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd, double *lower, double *upper, const char **descr)
+_efl_ui_slider_efl_access_value_range_get(const Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd, double *lower, double *upper, const char **descr)
{
if (lower) *lower = sd->val_min;
if (upper) *upper = sd->val_max;
@@ -1355,39 +812,13 @@ _efl_ui_slider_efl_access_value_range_get(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Dat
}
EOLIAN static double
-_efl_ui_slider_efl_access_value_increment_get(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd)
+_efl_ui_slider_efl_access_value_increment_get(const Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd)
{
return sd->step;
}
-EOLIAN static void
-_efl_ui_slider_efl_ui_format_format_cb_set(Eo *obj, Efl_Ui_Slider_Data *sd, void *func_data, Efl_Ui_Format_Func_Cb func, Eina_Free_Cb func_free_cb)
-{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
-
- if (sd->format_cb_data == func_data && sd->format_cb == func)
- return;
-
- if (sd->format_cb_data && sd->format_free_cb)
- sd->format_free_cb(sd->format_cb_data);
-
- sd->format_cb = func;
- sd->format_cb_data = func_data;
- sd->format_free_cb = func_free_cb;
- if (!sd->format_strbuf) sd->format_strbuf = eina_strbuf_new();
-
- elm_layout_signal_emit(obj, "elm,state,units,visible", "elm");
- edje_object_message_signal_process(wd->resize_obj);
- if (sd->popup)
- edje_object_signal_emit(sd->popup, "elm,state,units,visible", "elm");
- if (sd->popup2)
- edje_object_signal_emit(sd->popup2, "elm,state,units,visible", "elm");
-
- efl_canvas_group_change(obj);
-}
-
EOLIAN const Efl_Access_Action_Data *
-_efl_ui_slider_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *pd EINA_UNUSED)
+_efl_ui_slider_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *pd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "drag,left", "drag", "left", _key_action_drag},
@@ -1400,434 +831,18 @@ _efl_ui_slider_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Efl
}
// A11Y Accessibility - END
-
-/* Standard widget overrides */
-
-ELM_PART_TEXT_DEFAULT_IMPLEMENT(efl_ui_slider, Efl_Ui_Slider_Data)
-ELM_PART_MARKUP_DEFAULT_IMPLEMENT(efl_ui_slider, Efl_Ui_Slider_Data)
-ELM_PART_CONTENT_DEFAULT_GET(efl_ui_slider, _content_aliases[0].real_part)
-ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_slider, Efl_Ui_Slider_Data)
-
-static void
-_slider_span_size_set(Eo *obj, Efl_Ui_Slider_Data *sd, int size)
-{
- if (sd->size == size) return;
- sd->size = size;
-
- if (sd->indicator_show)
- {
- elm_layout_signal_emit(obj, "elm,state,val,show", "elm");
- if (sd->popup)
- edje_object_signal_emit(sd->popup, "elm,state,val,show", "elm");
- if (sd->popup2)
- edje_object_signal_emit(sd->popup2, "elm,state,val,show", "elm");
- }
- else
- {
- elm_layout_signal_emit(obj, "elm,state,val,hide", "elm");
- if (sd->popup)
- edje_object_signal_emit(sd->popup, "elm,state,val,hide", "elm");
- if (sd->popup2)
- edje_object_signal_emit(sd->popup2, "elm,state,val,hide", "elm");
- }
-
- evas_object_smart_changed(obj);
-}
-
-/* Efl.Part begin */
-
-EOLIAN static Eo *
-_efl_ui_slider_efl_part_part(const Eo *obj, Efl_Ui_Slider_Data *sd EINA_UNUSED, const char *part)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
-
- if (eina_streq(part, "indicator"))
- return ELM_PART_IMPLEMENT(EFL_UI_SLIDER_PART_INDICATOR_CLASS, obj, part);
-
- return efl_part(efl_super(obj, MY_CLASS), part);
-}
-
-EOLIAN static void
-_efl_ui_slider_part_indicator_efl_ui_format_format_cb_set(Eo *obj, void *_pd EINA_UNUSED, void *func_data, Efl_Ui_Format_Func_Cb func, Eina_Free_Cb func_free_cb)
-{
- Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
- Efl_Ui_Slider_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_SLIDER_CLASS);
-
- if (sd->indi_format_cb_data == func_data && sd->indi_format_cb == func)
- return;
-
- if (sd->indi_format_cb_data && sd->indi_format_free_cb)
- sd->indi_format_free_cb(sd->format_cb_data);
-
- sd->indi_format_cb = func;
- sd->indi_format_cb_data = func_data;
- sd->indi_format_free_cb = func_free_cb;
- if (!sd->indi_format_strbuf) sd->indi_format_strbuf = eina_strbuf_new();
-
- efl_canvas_group_change(pd->obj);
-}
-
-static void
-_indi_default_format_cb(void *data, Eina_Strbuf *str, const Eina_Value value)
-{
- const Eina_Value_Type *type = eina_value_type_get(&value);
- Efl_Ui_Slider_Data *sd = efl_data_scope_get(data, EFL_UI_SLIDER_CLASS);
- double v;
-
- if (type != EINA_VALUE_TYPE_DOUBLE) return;
-
- eina_value_get(&value, &v);
- eina_strbuf_append_printf(str, sd->indi_template, v);
-}
-
-static void
-_indi_default_format_free_cb(void *data)
-{
- Efl_Ui_Slider_Data *sd = efl_data_scope_get(data, EFL_UI_SLIDER_CLASS);
-
- if (sd && sd->indi_template)
- {
- eina_stringshare_del(sd->indi_template);
- sd->indi_template = NULL;
- }
-}
-
-EOLIAN static void
-_efl_ui_slider_part_indicator_efl_ui_format_format_string_set(Eo *obj, void *_pd EINA_UNUSED, const char *template)
-{
- Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
- Efl_Ui_Slider_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_SLIDER_CLASS);
-
- if (!template) return;
- eina_stringshare_replace(&sd->indi_template, template);
-
- efl_ui_format_cb_set(efl_part(pd->obj, "indicator"), pd->obj, _indi_default_format_cb, _indi_default_format_free_cb);
-}
-
-EOLIAN static const char *
-_efl_ui_slider_part_indicator_efl_ui_format_format_string_get(Eo *obj, void *_pd EINA_UNUSED)
-{
- Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
- Efl_Ui_Slider_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_SLIDER_CLASS);
-
- return sd->indi_template;
-}
-
-EOLIAN static void
-_efl_ui_slider_part_indicator_visible_mode_set(Eo *obj, void *_pd EINA_UNUSED, Efl_Ui_Slider_Indicator_Visible_Mode indicator_visible_mode)
-{
- Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
- Efl_Ui_Slider_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_SLIDER_CLASS);
-
- if (!eina_streq(pd->part, "indicator")) return;
-
- if (sd->indicator_visible_mode == indicator_visible_mode) return;
-
- sd->indicator_visible_mode = indicator_visible_mode;
-}
-
-EOLIAN static Efl_Ui_Slider_Indicator_Visible_Mode
-_efl_ui_slider_part_indicator_visible_mode_get(Eo *obj, void *_pd EINA_UNUSED)
-{
- Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
- Efl_Ui_Slider_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_SLIDER_CLASS);
-
- if (!eina_streq(pd->part, "indicator")) return EFL_UI_SLIDER_INDICATOR_VISIBLE_MODE_NONE;
- return sd->indicator_visible_mode;
-}
-
-#include "efl_ui_slider_part_indicator.eo.c"
-
-/* Efl.Part end */
-
-/* Legacy APIs */
-
-EAPI Evas_Object *
-elm_slider_add(Evas_Object *parent)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return elm_legacy_add(MY_CLASS, parent);
-}
-
-EAPI void
-elm_slider_span_size_set(Evas_Object *obj, Evas_Coord size)
-{
- EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd);
- _slider_span_size_set(obj, sd, size);
-}
-
-EAPI Evas_Coord
-elm_slider_span_size_get(const Evas_Object *obj)
-{
- EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd, 0);
- return sd->size;
-}
-
-EAPI void
-elm_slider_unit_format_set(Evas_Object *obj, const char *units)
-{
- efl_ui_format_string_set(obj, units);
-}
-
-EAPI const char *
-elm_slider_unit_format_get(const Evas_Object *obj)
-{
- return efl_ui_format_string_get(obj);
-}
-
-EAPI void
-elm_slider_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
-{
- Efl_Ui_Dir dir;
- EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd);
-
- dir = _direction_get(horizontal, _is_inverted(sd->dir));
-
- efl_ui_direction_set(obj, dir);
-}
-
-EAPI Eina_Bool
-elm_slider_horizontal_get(const Evas_Object *obj)
-{
- Efl_Ui_Dir dir;
- dir = efl_ui_direction_get(obj);
-
- return _is_horizontal(dir);
-}
-
-EAPI void
-elm_slider_value_set(Evas_Object *obj, double val)
-{
- efl_ui_range_value_set(obj, val);
-}
-
-EAPI double
-elm_slider_value_get(const Evas_Object *obj)
-{
- return efl_ui_range_value_get(obj);
-}
-
-EAPI void
-elm_slider_inverted_set(Evas_Object *obj, Eina_Bool inverted)
-{
- Efl_Ui_Dir dir;
- EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd);
-
- dir = _direction_get(_is_horizontal(sd->dir), inverted);
-
- efl_ui_direction_set(obj, dir);
-}
-
-EAPI Eina_Bool
-elm_slider_inverted_get(const Evas_Object *obj)
-{
- Efl_Ui_Dir dir;
- dir = efl_ui_direction_get(obj);
-
- return _is_inverted(dir);
-}
-
-typedef struct
-{
- slider_func_type format_cb;
- slider_freefunc_type format_free_cb;
-} Slider_Format_Wrapper_Data;
-
-static void
-_format_legacy_to_format_eo_cb(void *data, Eina_Strbuf *str, const Eina_Value value)
-{
- Slider_Format_Wrapper_Data *sfwd = data;
- char *buf = NULL;
- double val = 0;
- const Eina_Value_Type *type = eina_value_type_get(&value);
-
- if (type == EINA_VALUE_TYPE_DOUBLE)
- eina_value_get(&value, &val);
-
- if (sfwd->format_cb)
- buf = sfwd->format_cb(val);
- if (buf)
- eina_strbuf_append(str, buf);
- if (sfwd->format_free_cb) sfwd->format_free_cb(buf);
-}
-
-static void
-_format_legacy_to_format_eo_free_cb(void *data)
-{
- Slider_Format_Wrapper_Data *sfwd = data;
- free(sfwd);
-}
-
-EAPI void
-elm_slider_units_format_function_set(Evas_Object *obj, slider_func_type func, slider_freefunc_type free_func)
-{
- Slider_Format_Wrapper_Data *sfwd = malloc(sizeof(Slider_Format_Wrapper_Data));
-
- sfwd->format_cb = func;
- sfwd->format_free_cb = free_func;
-
- efl_ui_format_cb_set(obj, sfwd, _format_legacy_to_format_eo_cb, _format_legacy_to_format_eo_free_cb);
-}
-
-EAPI void
-elm_slider_range_enabled_set(Evas_Object *obj, Eina_Bool enable)
-{
- EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd);
-
- if (sd->intvl_enable == enable) return;
-
- sd->intvl_enable = enable;
- efl_ui_widget_theme_apply(obj);
- if (sd->intvl_enable)
- {
- elm_layout_signal_emit(obj, "elm,slider,range,enable", "elm");
- if (sd->indicator_show)
- edje_object_signal_emit(sd->popup2, "elm,state,val,show", "elm");
- }
- else
- {
- elm_layout_signal_emit(obj, "elm,slider,range,disable", "elm");
- ELM_SAFE_FREE(sd->popup2, evas_object_del);
- }
-
-}
-
-EAPI Eina_Bool
-elm_slider_range_enabled_get(const Evas_Object *obj)
-{
- EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, pd, EINA_FALSE);
- return pd->intvl_enable;
-}
-
-EAPI void
-elm_slider_range_set(Evas_Object *obj, double from, double to)
-{
- EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, pd);
- pd->intvl_from = from;
- pd->val = from;
- pd->intvl_to = to;
-
- if (pd->intvl_from < pd->val_min) pd->intvl_from = pd->val_min;
- if (pd->intvl_to > pd->val_max) pd->intvl_to = pd->val_max;
-
- _visuals_refresh(obj);
-}
-
-EAPI void
-elm_slider_range_get(const Evas_Object *obj, double *from, double *to)
-{
- EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, pd);
- if (from) *from = fmin(pd->intvl_from, pd->intvl_to);
- if (to) *to = fmax(pd->intvl_from, pd->intvl_to);
-}
-
-EAPI void
-elm_slider_min_max_set(Evas_Object *obj, double min, double max)
-{
- efl_ui_range_min_max_set(obj, min, max);
-}
-
-EAPI void
-elm_slider_min_max_get(const Evas_Object *obj, double *min, double *max)
-{
- efl_ui_range_min_max_get(obj, min, max);
-}
-
-EAPI void
-elm_slider_indicator_format_set(Evas_Object *obj, const char *indicator)
-{
- efl_ui_format_string_set(efl_part(obj, "indicator"), indicator);
-}
-
-EAPI const char *
-elm_slider_indicator_format_get(const Evas *obj)
-{
- return efl_ui_format_string_get(efl_part(obj, "indicator"));
-}
-
-EAPI void
-elm_slider_indicator_format_function_set(Evas_Object *obj, slider_func_type func, slider_freefunc_type free_func)
-{
- Slider_Format_Wrapper_Data *sfwd = malloc(sizeof(Slider_Format_Wrapper_Data));
-
- sfwd->format_cb = func;
- sfwd->format_free_cb = free_func;
-
- efl_ui_format_cb_set(efl_part(obj, "indicator"), sfwd,
- _format_legacy_to_format_eo_cb,
- _format_legacy_to_format_eo_free_cb);
-}
-
-EAPI void
-elm_slider_indicator_show_on_focus_set(Evas_Object *obj, Eina_Bool flag)
-{
- efl_ui_slider_part_indicator_visible_mode_set(efl_part(obj, "indicator"),
- flag ? ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS
- : ELM_SLIDER_INDICATOR_VISIBLE_MODE_DEFAULT);
-}
-
-EAPI Eina_Bool
-elm_slider_indicator_show_on_focus_get(const Evas_Object *obj)
-{
- return (efl_ui_slider_part_indicator_visible_mode_get(efl_part(obj, "indicator"))
- == EFL_UI_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS);
-}
-
-EAPI void
-elm_slider_indicator_show_set(Evas_Object *obj, Eina_Bool show)
-{
- EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd);
-
- if (show)
- {
- sd->indicator_show = EINA_TRUE;
- elm_layout_signal_emit(obj, "elm,state,val,show", "elm");
- if (sd->popup)
- edje_object_signal_emit(sd->popup, "elm,state,val,show", "elm");
- if (sd->popup2)
- edje_object_signal_emit(sd->popup2, "elm,state,val,show", "elm");
- }
- else
- {
- sd->indicator_show = EINA_FALSE;
- elm_layout_signal_emit(obj, "elm,state,val,hide", "elm");
- if (sd->popup)
- edje_object_signal_emit(sd->popup, "elm,state,val,hide", "elm");
- if (sd->popup2)
- edje_object_signal_emit(sd->popup2, "elm,state,val,hide", "elm");
- }
-
- evas_object_smart_changed(obj);
-}
-
-EAPI Eina_Bool
-elm_slider_indicator_show_get(const Evas_Object *obj)
-{
- EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd, EINA_FALSE);
- return sd->indicator_show;
-}
-
-EAPI void
-elm_slider_indicator_visible_mode_set(Evas_Object *obj, Elm_Slider_Indicator_Visible_Mode indicator_visible_mode)
-{
- efl_ui_slider_part_indicator_visible_mode_set(efl_part(obj, "indicator"), indicator_visible_mode);
-}
-
-EAPI Elm_Slider_Indicator_Visible_Mode
-elm_slider_indicator_visible_mode_get(const Evas_Object *obj)
-{
- return efl_ui_slider_part_indicator_visible_mode_get(efl_part(obj, "indicator"));
-}
-
/* Internal EO APIs and hidden overrides */
-ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(efl_ui_slider)
-ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(efl_ui_slider)
+EFL_VOID_FUNC_BODYV(efl_ui_slider_val_fetch, EFL_FUNC_CALL(user_event), Eina_Bool user_event)
+EFL_VOID_FUNC_BODY(efl_ui_slider_val_set)
+EFL_VOID_FUNC_BODYV(efl_ui_slider_down_knob, EFL_FUNC_CALL(button_x, button_y), double button_x, double button_y)
+EFL_VOID_FUNC_BODYV(efl_ui_slider_move_knob, EFL_FUNC_CALL(button_x, button_y), double button_x, double button_y)
#define EFL_UI_SLIDER_EXTRA_OPS \
- ELM_LAYOUT_CONTENT_ALIASES_OPS(efl_ui_slider), \
- ELM_LAYOUT_TEXT_ALIASES_OPS(efl_ui_slider), \
ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_slider), \
- EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_slider)
+ EFL_UI_SLIDER_VAL_FETCH_OPS(efl_ui_slider), \
+ EFL_UI_SLIDER_VAL_SET_OPS(efl_ui_slider), \
+ EFL_UI_SLIDER_DOWN_KNOB_OPS(efl_ui_slider), \
+ EFL_UI_SLIDER_MOVE_KNOB_OPS(efl_ui_slider), \
#include "efl_ui_slider.eo.c"
diff --git a/src/lib/elementary/efl_ui_slider.eo b/src/lib/elementary/efl_ui_slider.eo
index 6a464cf4ff..0fe181a675 100644
--- a/src/lib/elementary/efl_ui_slider.eo
+++ b/src/lib/elementary/efl_ui_slider.eo
@@ -1,65 +1,30 @@
-class Efl.Ui.Slider (Efl.Ui.Layout, Efl.Ui.Range, Efl.Ui.Direction,
- Efl.Access.Value, Efl.Text, Efl.Text.Markup, Efl.Ui.Format,
- Efl.Ui.Translatable, Efl.Access.Widget.Action,
+class Efl.Ui.Slider (Efl.Ui.Layout.Object, Efl.Ui.Range, Efl.Ui.Direction,
+ Efl.Access.Value,
+ Efl.Access.Widget.Action,
Efl.Content)
{
[[Elementary slider class]]
- legacy_prefix: elm_slider;
- methods {
- @property step {
- set {
- [[Set the step by which slider indicator will move.
-
- This value is used when a draggable object is moved automatically
- such as when key events like the up/down/left/right key are pressed
- or in case accessibility is set and flick event is used to
- inc/dec slider values. By default step value is 0.05.
-
- @since 1.8
- ]]
- }
- get {
- [[Get the step by which slider indicator moves.
-
- @since 1.8
- ]]
- }
- values {
- step: double; [[The step value.]]
- }
- }
- }
- parts {
- indicator: Efl.Ui.Slider.Part_Indicator;
- [[A floating indicator above the slider.]]
- }
+ legacy_prefix: null;
implements {
- class.constructor;
Efl.Object.constructor;
- Efl.Canvas.Group.group_calculate;
- Elm.Widget.theme_apply;
- Elm.Widget.on_access_activate;
- Elm.Widget.on_focus_update;
- Elm.Widget.widget_event;
+ Efl.Object.destructor;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.on_access_activate;
+ Efl.Ui.Focus.Object.on_focus_update;
+ Efl.Ui.Widget.widget_event;
Efl.Ui.Range.range_value { get; set; }
Efl.Ui.Range.range_min_max {get; set; }
+ Efl.Ui.Range.range_step { get; set; }
Efl.Ui.Direction.direction { get; set; }
Efl.Access.Value.value_and_text { get; set; }
Efl.Access.Value.range { get; }
Efl.Access.Value.increment { get; }
Efl.Access.Widget.Action.elm_actions { get; }
- Efl.Text.text { get; set; }
- Efl.Text.Markup.markup { get; set; }
- Efl.Ui.Format.format_cb { set; }
- Efl.Ui.Translatable.translatable_text { get; set; }
- Efl.Content.content { get; set; }
- Efl.Content.content_unset;
- Efl.Part.part;
}
events {
- changed; [[Called when slider changed]]
- delay,changed; [[Called when delay changed]]
- slider,drag,start; [[Called when slider drag started]]
- slider,drag,stop; [[Called when slider drag stopped]]
+ changed: void; [[Called when slider changed]]
+ delay,changed: void; [[Called when delay changed]]
+ slider,drag,start: void; [[Called when slider drag started]]
+ slider,drag,stop: void; [[Called when slider drag stopped]]
}
}
diff --git a/src/lib/elementary/efl_ui_slider_eo.h b/src/lib/elementary/efl_ui_slider_eo.h
deleted file mode 100644
index 74abf106f9..0000000000
--- a/src/lib/elementary/efl_ui_slider_eo.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "efl_ui_slider.eo.h"
diff --git a/src/lib/elementary/efl_ui_slider_interval.c b/src/lib/elementary/efl_ui_slider_interval.c
index 17b86c2409..74131e5834 100644
--- a/src/lib/elementary/efl_ui_slider_interval.c
+++ b/src/lib/elementary/efl_ui_slider_interval.c
@@ -2,46 +2,113 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
-#define ELM_INTERFACE_ATSPI_VALUE_PROTECTED
#include <Elementary.h>
#include "elm_priv.h"
#include "efl_ui_slider_private.h"
+#include "efl_ui_slider_interval_private.h"
#define MY_CLASS EFL_UI_SLIDER_INTERVAL_CLASS
+#define MY_CLASS_PFX efl_ui_slider_interval
#define MY_CLASS_NAME "Efl.Ui.Slider_Interval"
-EOLIAN static void
-_efl_ui_slider_interval_interval_value_get(Eo *obj, void *sd EINA_UNUSED, double *from, double *to)
+#define SLIDER_DELAY_CHANGED_INTERVAL 1.2
+
+static Eina_Bool
+_delay_change(void *data)
{
- Efl_Ui_Slider_Data *pd = efl_data_scope_get(obj, EFL_UI_SLIDER_CLASS);
- if (from) *from = fmin(pd->intvl_from, pd->intvl_to);
- if (to) *to = fmax(pd->intvl_from, pd->intvl_to);
+ EFL_UI_SLIDER_INTERVAL_DATA_GET(data, pd);
+
+ pd->delay = NULL;
+ efl_event_callback_call(data, EFL_UI_SLIDER_EVENT_DELAY_CHANGED, NULL);
+
+ if (_elm_config->atspi_mode)
+ efl_access_value_changed_signal_emit(data);
+
+ return ECORE_CALLBACK_CANCEL;
}
-static inline Eina_Bool
-_is_inverted(Efl_Ui_Dir dir)
+void
+_efl_ui_slider_interval_val_fetch(Evas_Object *obj, Efl_Ui_Slider_Interval_Data *pd, Eina_Bool user_event)
{
- if ((dir == EFL_UI_DIR_LEFT) || (dir == EFL_UI_DIR_UP))
- return EINA_TRUE;
+ double posx = 0.0, posy = 0.0, pos = 0.0, val;
+ double posx2 = 0.0, posy2 = 0.0, pos2 = 0.0, val2;
+
+ EFL_UI_SLIDER_DATA_GET(obj, sd);
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+
+ if (elm_widget_is_legacy(obj))
+ efl_ui_drag_value_get(efl_part(wd->resize_obj, "elm.dragable.slider"),
+ &posx, &posy);
+ else
+ efl_ui_drag_value_get(efl_part(wd->resize_obj, "efl.dragable.slider"),
+ &posx, &posy);
+ if (efl_ui_dir_is_horizontal(sd->dir, EINA_TRUE)) pos = posx;
+ else pos = posy;
+
+ if (elm_widget_is_legacy(obj))
+ efl_ui_drag_value_get(efl_part(wd->resize_obj, "elm.dragable2.slider"),
+ &posx2, &posy2);
+ else
+ efl_ui_drag_value_get(efl_part(wd->resize_obj, "efl.dragable2.slider"),
+ &posx2, &posy2);
+ if (efl_ui_dir_is_horizontal(sd->dir, EINA_TRUE)) pos2 = posx2;
+ else pos2 = posy2;
+
+ val = (pos * (sd->val_max - sd->val_min)) + sd->val_min;
+ val2 = (pos2 * (sd->val_max - sd->val_min)) + sd->val_min;
+
+ if (val > pd->intvl_to)
+ {
+ val = pd->intvl_to;
+ efl_ui_slider_val_set(obj);
+ }
+ else if (val2 < pd->intvl_from)
+ {
+ val2 = pd->intvl_from;
+ efl_ui_slider_val_set(obj);
+ }
- return EINA_FALSE;
+ if (fabs(val - pd->intvl_from) > DBL_EPSILON)
+ {
+ sd->val = val;
+ pd->intvl_from = val;
+ if (user_event)
+ {
+ efl_event_callback_call(obj, EFL_UI_SLIDER_EVENT_CHANGED, NULL);
+ efl_event_callback_legacy_call(obj, EFL_UI_SLIDER_EVENT_CHANGED, NULL);
+ ecore_timer_del(pd->delay);
+ pd->delay = ecore_timer_add(SLIDER_DELAY_CHANGED_INTERVAL, _delay_change, obj);
+ }
+ }
+
+ if (fabs(val2 - pd->intvl_to) > DBL_EPSILON)
+ {
+ pd->intvl_to = val2;
+ if (user_event)
+ {
+ efl_event_callback_call(obj, EFL_UI_SLIDER_EVENT_CHANGED, NULL);
+ efl_event_callback_legacy_call(obj, EFL_UI_SLIDER_EVENT_CHANGED, NULL);
+ ecore_timer_del(pd->delay);
+ pd->delay = ecore_timer_add(SLIDER_DELAY_CHANGED_INTERVAL, _delay_change, obj);
+ }
+ }
}
-static void
-_val_set(Evas_Object *obj)
+void
+_efl_ui_slider_interval_val_set(Evas_Object *obj, Efl_Ui_Slider_Interval_Data *pd)
{
- Eina_Bool rtl;
double pos, pos2;
EFL_UI_SLIDER_DATA_GET(obj, sd);
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
if (sd->val_max > sd->val_min)
{
- pos = (sd->val - sd->val_min) / (sd->val_max - sd->val_min);
- pos2 = (sd->intvl_to - sd->val_min) / (sd->val_max - sd->val_min);
+ pos = (pd->intvl_from - sd->val_min) / (sd->val_max - sd->val_min);
+ pos2 = (pd->intvl_to - sd->val_min) / (sd->val_max - sd->val_min);
}
else
{
@@ -52,71 +119,190 @@ _val_set(Evas_Object *obj)
if (pos < 0.0) pos = 0.0;
else if (pos > 1.0)
pos = 1.0;
+
if (pos2 < 0.0) pos2 = 0.0;
else if (pos2 > 1.0)
pos2 = 1.0;
- rtl = efl_ui_mirrored_get(obj);
- if ((!rtl && _is_inverted(sd->dir)) ||
- (rtl && ((sd->dir == EFL_UI_DIR_UP) ||
- (sd->dir == EFL_UI_DIR_RIGHT))))
+ if (elm_widget_is_legacy(obj))
{
- pos = 1.0 - pos;
- pos2 = 1.0 - pos2;
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable.slider"),
+ pos, pos);
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable2.slider"),
+ pos2, pos2);
+ }
+ else
+ {
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable.slider"),
+ pos, pos);
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable2.slider"),
+ pos2, pos2);
}
-
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
- edje_object_part_drag_value_set
- (wd->resize_obj, "elm.dragable.slider", pos, pos);
-
- if (sd->intvl_enable)
- edje_object_part_drag_value_set
- (wd->resize_obj, "elm.dragable2.slider", pos2, pos2);
// emit accessibility event also if value was changed by API
if (_elm_config->atspi_mode)
efl_access_value_changed_signal_emit(obj);
+
+ evas_object_smart_changed(obj);
}
-static void
-_visuals_refresh(Eo *obj)
+void
+_efl_ui_slider_interval_down_knob(Evas_Object *obj, Efl_Ui_Slider_Interval_Data *pd, double button_x, double button_y)
{
- _val_set(obj);
- evas_object_smart_changed(obj);
+ EFL_UI_SLIDER_DATA_GET(obj, sd);
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+
+ double posx = 0.0, posy = 0.0, posx2 = 0.0, posy2 = 0.0, diff1, diff2, diff3;
+
+ pd->intvl_flag = 0;
+
+ if (elm_widget_is_legacy(obj))
+ {
+ efl_ui_drag_value_get(efl_part(wd->resize_obj, "elm.dragable.slider"),
+ &posx, &posy);
+ efl_ui_drag_value_get(efl_part(wd->resize_obj, "elm.dragable2.slider"),
+ &posx2, &posy2);
+ }
+ else
+ {
+ efl_ui_drag_value_get(efl_part(wd->resize_obj, "efl.dragable.slider"),
+ &posx, &posy);
+ efl_ui_drag_value_get(efl_part(wd->resize_obj, "efl.dragable2.slider"),
+ &posx2, &posy2);
+ }
+
+ if (efl_ui_dir_is_horizontal(sd->dir, EINA_TRUE))
+ {
+ diff1 = fabs(button_x - posx);
+ diff2 = fabs(button_x - posx2);
+ diff3 = button_x - posx;
+ }
+ else
+ {
+ diff1 = fabs(button_y - posy);
+ diff2 = fabs(button_y - posy2);
+ diff3 = button_y - posy;
+ }
+
+ if (diff1 < diff2)
+ {
+ if (elm_widget_is_legacy(obj))
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable.slider"),
+ button_x, button_y);
+ else
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable.slider"),
+ button_x, button_y);
+ pd->intvl_flag = 1;
+ }
+ else if (diff1 > diff2)
+ {
+ if (elm_widget_is_legacy(obj))
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable2.slider"),
+ button_x, button_y);
+ else
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable2.slider"),
+ button_x, button_y);
+ pd->intvl_flag = 2;
+ }
+ else
+ {
+ if (diff3 < 0)
+ {
+ if (elm_widget_is_legacy(obj))
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable.slider"),
+ button_x, button_y);
+ else
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable.slider"),
+ button_x, button_y);
+ pd->intvl_flag = 1;
+ }
+ else
+ {
+ if (elm_widget_is_legacy(obj))
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable2.slider"),
+ button_x, button_y);
+ else
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable2.slider"),
+ button_x, button_y);
+ pd->intvl_flag = 2;
+ }
+ }
}
-EOLIAN static void
-_efl_ui_slider_interval_interval_value_set(Eo *obj, void *sd EINA_UNUSED, double from, double to)
+void
+_efl_ui_slider_interval_move_knob(Evas_Object *obj, Efl_Ui_Slider_Interval_Data *pd, double button_x, double button_y)
{
- Efl_Ui_Slider_Data *pd = efl_data_scope_get(obj, EFL_UI_SLIDER_CLASS);
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+ if (pd->intvl_flag == 1)
+ {
+ if (elm_widget_is_legacy(obj))
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable.slider"),
+ button_x, button_y);
+ else
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable.slider"),
+ button_x, button_y);
+ }
+ else if (pd->intvl_flag == 2)
+ {
+ if (elm_widget_is_legacy(obj))
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable2.slider"),
+ button_x, button_y);
+ else
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable2.slider"),
+ button_x, button_y);
+ }
+}
+
+EOLIAN static void
+_efl_ui_slider_interval_interval_value_set(Eo *obj, Efl_Ui_Slider_Interval_Data *pd, double from, double to)
+{
+ EFL_UI_SLIDER_DATA_GET(obj, sd);
pd->intvl_from = from;
- pd->val = from;
+ sd->val = from;
pd->intvl_to = to;
- if (pd->intvl_from < pd->val_min) pd->intvl_from = pd->val_min;
- if (pd->intvl_to > pd->val_max) pd->intvl_to = pd->val_max;
+ if (pd->intvl_from < sd->val_min) {
+ pd->intvl_from = sd->val_min;
+ sd->val = sd->val_min;
+ }
+ if (pd->intvl_to > sd->val_max) pd->intvl_to = sd->val_max;
- _visuals_refresh(obj);
+ efl_ui_slider_val_set(obj);
}
-EOLIAN static Efl_Object *
-_efl_ui_slider_interval_efl_object_finalize(Eo *obj, void *sd EINA_UNUSED)
+EOLIAN static void
+_efl_ui_slider_interval_interval_value_get(const Eo *obj EINA_UNUSED, Efl_Ui_Slider_Interval_Data *pd, double *from, double *to)
{
- Efl_Ui_Slider_Data *pd = efl_data_scope_get(obj, EFL_UI_SLIDER_CLASS);
+ if (from) *from = fmin(pd->intvl_from, pd->intvl_to);
+ if (to) *to = fmax(pd->intvl_from, pd->intvl_to);
+}
- pd->intvl_enable = EINA_TRUE;
+EOLIAN static Efl_Object *
+_efl_ui_slider_interval_efl_object_constructor(Eo *obj, Efl_Ui_Slider_Interval_Data *pd EINA_UNUSED)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
- elm_widget_theme_klass_set(obj, "slider_interval");
- efl_ui_widget_theme_apply(obj);
+ if (!elm_widget_theme_klass_get(obj))
+ elm_widget_theme_klass_set(obj, "slider_interval");
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
- elm_layout_signal_emit(obj, "elm,slider,range,enable", "elm");
- if (pd->indicator_show)
- edje_object_signal_emit(pd->popup2, "elm,state,val,show", "elm");
+ return obj;
+}
- obj = efl_finalize(efl_super(obj, MY_CLASS));
+EOLIAN static void
+_efl_ui_slider_interval_efl_object_destructor(Eo *obj,
+ Efl_Ui_Slider_Interval_Data *pd)
+{
+ ecore_timer_del(pd->delay);
- return obj;
+ efl_destructor(efl_super(obj, MY_CLASS));
}
+#define EFL_UI_SLIDER_INTERVAL_EXTRA_OPS \
+ EFL_UI_SLIDER_VAL_FETCH_OPS(efl_ui_slider_interval), \
+ EFL_UI_SLIDER_VAL_SET_OPS(efl_ui_slider_interval), \
+ EFL_UI_SLIDER_DOWN_KNOB_OPS(efl_ui_slider_interval), \
+ EFL_UI_SLIDER_MOVE_KNOB_OPS(efl_ui_slider_interval), \
+
#include "efl_ui_slider_interval.eo.c"
diff --git a/src/lib/elementary/efl_ui_slider_interval.eo b/src/lib/elementary/efl_ui_slider_interval.eo
index 3141fbbaac..15172dc52a 100644
--- a/src/lib/elementary/efl_ui_slider_interval.eo
+++ b/src/lib/elementary/efl_ui_slider_interval.eo
@@ -6,7 +6,6 @@ class Efl.Ui.Slider_Interval (Efl.Ui.Slider)
@since 1.21
]]
- data: null;
legacy_prefix: null;
methods {
@property interval_value {
@@ -27,6 +26,7 @@ class Efl.Ui.Slider_Interval (Efl.Ui.Slider)
}
}
implements {
- Efl.Object.finalize;
+ Efl.Object.constructor;
+ Efl.Object.destructor;
}
}
diff --git a/src/lib/elementary/efl_ui_slider_interval_private.h b/src/lib/elementary/efl_ui_slider_interval_private.h
new file mode 100644
index 0000000000..66b23e2d6f
--- /dev/null
+++ b/src/lib/elementary/efl_ui_slider_interval_private.h
@@ -0,0 +1,29 @@
+#ifndef EFL_UI_SLIDER_INTERVAL_PRIVATE_H
+#define EFL_UI_SLIDER_INTERVAL_PRIVATE_H
+
+#include "Elementary.h"
+typedef struct _Efl_Ui_Slider_Interval_Data Efl_Ui_Slider_Interval_Data;
+struct _Efl_Ui_Slider_Interval_Data
+{
+ Ecore_Timer *delay;
+ double intvl_from, intvl_to;
+ int intvl_flag;
+};
+
+/**
+ * @}
+ */
+
+#define EFL_UI_SLIDER_INTERVAL_DATA_GET(o, sd) \
+ Efl_Ui_Slider_Interval_Data * sd = efl_data_scope_get(o, EFL_UI_SLIDER_INTERVAL_CLASS)
+
+#define EFL_UI_SLIDER_INTERVAL_DATA_GET_OR_RETURN(o, sd, ...) \
+ Efl_Ui_Slider_Interval_Data * sd = efl_data_scope_safe_get(o, EFL_UI_SLIDER_INTERVAL_CLASS); \
+ if (EINA_UNLIKELY(!sd)) \
+ { \
+ ERR("No widget data for object %p (%s)", \
+ o, evas_object_type_get(o)); \
+ return __VA_ARGS__; \
+ }
+
+#endif
diff --git a/src/lib/elementary/efl_ui_slider_private.h b/src/lib/elementary/efl_ui_slider_private.h
index 8e1a27af83..539784bc4c 100644
--- a/src/lib/elementary/efl_ui_slider_private.h
+++ b/src/lib/elementary/efl_ui_slider_private.h
@@ -3,69 +3,37 @@
#include "Elementary.h"
-/* DO NOT USE THIS HEADER UNLESS YOU ARE PREPARED FOR BREAKING OF YOUR
- * CODE. THIS IS ELEMENTARY'S INTERNAL WIDGET API (for now) AND IS NOT
- * FINAL. CALL elm_widget_api_check(ELM_INTERNAL_API_VERSION) TO CHECK
- * IT AT RUNTIME.
- */
-
-/**
- * @addtogroup Widget
- * @{
- *
- * @section elm-slider-class The Elementary Slider Class
- *
- * Elementary, besides having the @ref Slider widget, exposes its
- * foundation -- the Elementary Slider Class -- in order to create other
- * widgets which are a slider with some more logic on top.
- */
-
-/**
- * Base layout smart data extended with slider instance data.
- */
typedef struct _Efl_Ui_Slider_Data Efl_Ui_Slider_Data;
struct _Efl_Ui_Slider_Data
{
- Evas_Object *spacer, *popup, *popup2, *track, *track2;
+ Evas_Object *spacer;
Ecore_Timer *delay;
- double val, val_min, val_max, val2, step;
+ double val, val_min, val_max, step;
- Ecore_Timer *wheel_indicator_timer;
- double wheel_indicator_duration;
- Efl_Ui_Slider_Indicator_Visible_Mode indicator_visible_mode; /**< indicator_visible_mode of the slider.
- This indicates when to show an indicator */
-
- Evas_Coord size;
Evas_Coord downx, downy;
Efl_Ui_Dir dir;
- double intvl_from, intvl_to;
-
- Efl_Ui_Format_Func_Cb format_cb;
- Eina_Free_Cb format_free_cb;
- void *format_cb_data;
- Eina_Strbuf *format_strbuf;
-
- Efl_Ui_Format_Func_Cb indi_format_cb;
- Eina_Free_Cb indi_format_free_cb;
- void *indi_format_cb_data;
- Eina_Strbuf *indi_format_strbuf;
- const char *indi_template;
-
-
- Eina_Bool indicator_show : 1;
Eina_Bool spacer_down : 1;
Eina_Bool frozen : 1;
- Eina_Bool units_show : 1;
- Eina_Bool popup_visible : 1;
- Eina_Bool intvl_enable : 1;
};
/**
* @}
*/
+# define EFL_UI_SLIDER_VAL_FETCH_OPS(_pfx) \
+ EFL_OBJECT_OP_FUNC(efl_ui_slider_val_fetch, _##_pfx##_val_fetch)
+
+# define EFL_UI_SLIDER_VAL_SET_OPS(_pfx) \
+ EFL_OBJECT_OP_FUNC(efl_ui_slider_val_set, _##_pfx##_val_set)
+
+# define EFL_UI_SLIDER_DOWN_KNOB_OPS(_pfx) \
+ EFL_OBJECT_OP_FUNC(efl_ui_slider_down_knob, _##_pfx##_down_knob)
+
+# define EFL_UI_SLIDER_MOVE_KNOB_OPS(_pfx) \
+ EFL_OBJECT_OP_FUNC(efl_ui_slider_move_knob, _##_pfx##_move_knob)
+
#define EFL_UI_SLIDER_DATA_GET(o, sd) \
Efl_Ui_Slider_Data * sd = efl_data_scope_get(o, EFL_UI_SLIDER_CLASS)
@@ -78,4 +46,6 @@ struct _Efl_Ui_Slider_Data
return __VA_ARGS__; \
}
+
+
#endif
diff --git a/src/lib/elementary/efl_ui_spin.c b/src/lib/elementary/efl_ui_spin.c
index d24d20d309..151fa8810e 100644
--- a/src/lib/elementary/efl_ui_spin.c
+++ b/src/lib/elementary/efl_ui_spin.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_VALUE_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
@@ -73,8 +73,24 @@ _is_label_format_integer(const char *fmt)
static void
_label_write(Evas_Object *obj)
{
+ Efl_Ui_Spin_Special_Value *sv;
+ unsigned int i;
+ Eina_Array_Iterator iterator;
+
Efl_Ui_Spin_Data *sd = efl_data_scope_get(obj, MY_CLASS);
+ EINA_ARRAY_ITER_NEXT(sd->special_values, i, sv, iterator)
+ {
+ if (sv->value == sd->val)
+ {
+ char buf[1024];
+ snprintf(buf, sizeof(buf), "%s", sv->label);
+ elm_layout_text_set(obj, "elm.text", buf);
+ sd->templates = sv->label;
+ return;
+ }
+ }
+
if (sd->format_cb)
{
const char *buf;
@@ -95,14 +111,15 @@ _label_write(Evas_Object *obj)
buf = eina_strbuf_string_get(sd->format_strbuf);
eina_value_flush(&val);
- elm_layout_text_set(obj, "elm.text", buf);
+ elm_layout_text_set(obj, "efl.text", buf);
sd->templates = buf;
}
else
{
char buf[1024];
snprintf(buf, sizeof(buf), "%.0f", sd->val);
- elm_layout_text_set(obj, "elm.text", buf);
+ elm_layout_text_set(obj, "efl.text", buf);
+ evas_object_show(obj);
}
}
@@ -151,7 +168,7 @@ _efl_ui_spin_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Spin_Data *_pd EINA_UNUSED)
}
EOLIAN static Eina_Bool
-_efl_ui_spin_elm_widget_widget_event(Eo *obj, Efl_Ui_Spin_Data *sd, const Efl_Event *eo_event, Evas_Object *src EINA_UNUSED)
+_efl_ui_spin_efl_ui_widget_widget_event(Eo *obj, Efl_Ui_Spin_Data *sd, const Efl_Event *eo_event, Evas_Object *src EINA_UNUSED)
{
Eo *ev = eo_event->info;
@@ -171,6 +188,48 @@ _efl_ui_spin_elm_widget_widget_event(Eo *obj, Efl_Ui_Spin_Data *sd, const Efl_Ev
return EINA_TRUE;
}
+EOLIAN static void
+_efl_ui_spin_special_value_set(Eo *obj, Efl_Ui_Spin_Data *sd, const Eina_Array *values)
+{
+ EINA_SAFETY_ON_NULL_RETURN(values);
+
+ unsigned int i;
+ Efl_Ui_Spin_Special_Value *sv;
+ Efl_Ui_Spin_Special_Value *temp;
+ Eina_Array_Iterator iterator;
+
+ if (eina_array_count(sd->special_values))
+ {
+ EINA_ARRAY_ITER_NEXT(sd->special_values, i, sv, iterator)
+ {
+ eina_stringshare_del(sv->label);
+ free(sv);
+ }
+ eina_array_clean(sd->special_values);
+ }
+
+ if (eina_array_count(values))
+ EINA_ARRAY_ITER_NEXT(values, i, temp, iterator)
+ {
+ sv = calloc(1, sizeof(*sv));
+ if (!sv) return;
+ sv->value = temp->value;
+ sv->label = eina_stringshare_add(temp->label);
+ eina_array_push(sd->special_values, sv);
+ }
+
+ _label_write(obj);
+}
+
+EOLIAN static const Eina_Array*
+_efl_ui_spin_special_value_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spin_Data *sd)
+{
+ if (eina_array_count(sd->special_values))
+ return sd->special_values;
+ else
+ return NULL;
+}
+
EOLIAN static Eo *
_efl_ui_spin_efl_object_constructor(Eo *obj, Efl_Ui_Spin_Data *sd)
{
@@ -184,6 +243,7 @@ _efl_ui_spin_efl_object_constructor(Eo *obj, Efl_Ui_Spin_Data *sd)
sd->val_max = 100.0;
sd->step = 1.0;
+ sd->special_values = eina_array_new(sizeof(Efl_Ui_Spin_Special_Value));
if (!elm_widget_theme_object_set(obj, wd->resize_obj,
elm_widget_theme_klass_get(obj),
@@ -202,7 +262,19 @@ _efl_ui_spin_efl_object_constructor(Eo *obj, Efl_Ui_Spin_Data *sd)
EOLIAN static void
_efl_ui_spin_efl_object_destructor(Eo *obj, Efl_Ui_Spin_Data *sd EINA_UNUSED)
{
+ Efl_Ui_Spin_Special_Value *sv;
+ Eina_Array_Iterator iterator;
+ unsigned int i;
+
efl_ui_format_cb_set(obj, NULL, NULL, NULL);
+
+ EINA_ARRAY_ITER_NEXT(sd->special_values, i, sv, iterator)
+ {
+ eina_stringshare_del(sv->label);
+ free(sv);
+ }
+ eina_array_free(sd->special_values);
+
efl_destructor(efl_super(obj, MY_CLASS));
}
@@ -259,7 +331,7 @@ _efl_ui_spin_efl_ui_range_range_min_max_set(Eo *obj, Efl_Ui_Spin_Data *sd, doubl
}
EOLIAN static void
-_efl_ui_spin_efl_ui_range_range_min_max_get(Eo *obj EINA_UNUSED, Efl_Ui_Spin_Data *sd, double *min, double *max)
+_efl_ui_spin_efl_ui_range_range_min_max_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spin_Data *sd, double *min, double *max)
{
if (min) *min = sd->val_min;
if (max) *max = sd->val_max;
@@ -278,7 +350,7 @@ _efl_ui_spin_efl_ui_range_range_step_set(Eo *obj EINA_UNUSED, Efl_Ui_Spin_Data *
}
EOLIAN static double
-_efl_ui_spin_efl_ui_range_range_step_get(Eo *obj EINA_UNUSED, Efl_Ui_Spin_Data *sd)
+_efl_ui_spin_efl_ui_range_range_step_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spin_Data *sd)
{
return sd->step;
}
@@ -306,7 +378,7 @@ _efl_ui_spin_efl_ui_range_range_value_set(Eo *obj, Efl_Ui_Spin_Data *sd, double
}
EOLIAN static double
-_efl_ui_spin_efl_ui_range_range_value_get(Eo *obj EINA_UNUSED, Efl_Ui_Spin_Data *sd)
+_efl_ui_spin_efl_ui_range_range_value_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spin_Data *sd)
{
return sd->val;
}
diff --git a/src/lib/elementary/efl_ui_spin.eo b/src/lib/elementary/efl_ui_spin.eo
index 20b33a0871..55996b5c40 100644
--- a/src/lib/elementary/efl_ui_spin.eo
+++ b/src/lib/elementary/efl_ui_spin.eo
@@ -1,4 +1,11 @@
-class Efl.Ui.Spin (Efl.Ui.Layout, Efl.Ui.Range, Efl.Ui.Format,
+struct Efl.Ui.Spin_Special_Value
+{
+ [[Special value]]
+ value: double; [[Target value]]
+ label: string; [[String to replace]]
+}
+
+class Efl.Ui.Spin (Efl.Ui.Layout.Object, Efl.Ui.Range, Efl.Ui.Format,
Efl.Access.Value, Efl.Access.Widget.Action)
{
[[A Spin.
@@ -8,18 +15,36 @@ class Efl.Ui.Spin (Efl.Ui.Layout, Efl.Ui.Range, Efl.Ui.Format,
@since 1.21
]]
+ methods {
+ @property special_value {
+ [[Control special string to display in the place of the numerical value.
+
+ It's useful for cases when a user should select an item that is
+ better indicated by a label than a value. For example, weekdays or months.
+
+ Note: If another label was previously set to $value, it will be replaced
+ by the new label.]]
+ set {
+ }
+ get {
+ }
+ values {
+ values: const(array<ptr(Efl.Ui.Spin_Special_Value)>); [[The array of special values, or NULL if none]]
+ }
+ }
+ }
implements {
Efl.Object.constructor;
Efl.Object.destructor;
- Elm.Widget.widget_event;
+ Efl.Ui.Widget.widget_event;
Efl.Ui.Range.range_min_max { get; set; }
Efl.Ui.Range.range_step { get; set; }
Efl.Ui.Range.range_value { get; set; }
Efl.Ui.Format.format_cb { set; }
}
events {
- changed; [[Called when spin changed]]
- min,reached; [[Called when spin value reached min]]
- max,reached; [[Called when spin value reached max]]
+ changed: void; [[Called when spin changed]]
+ min,reached: void; [[Called when spin value reached min]]
+ max,reached: void; [[Called when spin value reached max]]
}
}
diff --git a/src/lib/elementary/efl_ui_spin_button.c b/src/lib/elementary/efl_ui_spin_button.c
index 73d71cb861..6b2bfbeae8 100644
--- a/src/lib/elementary/efl_ui_spin_button.c
+++ b/src/lib/elementary/efl_ui_spin_button.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_VALUE_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define EFL_UI_FOCUS_COMPOSITION_PROTECTED
@@ -20,6 +20,7 @@
#define EFL_UI_SPIN_BUTTON_DELAY_CHANGE_TIME 0.2
+static const char PART_NAME_ENTRY[] = "entry";
static const char PART_NAME_DEC_BUTTON[] = "dec_button";
static const char PART_NAME_TEXT_BUTTON[] = "text_button";
static const char PART_NAME_INC_BUTTON[] = "inc_button";
@@ -49,9 +50,22 @@ EFL_CALLBACKS_ARRAY_DEFINE(_inc_dec_button_cb,
static void
_entry_show(Evas_Object *obj)
{
+ Efl_Ui_Spin_Special_Value *sv;
+ Eina_Array_Iterator iterator;
+ unsigned int i;
+ char buf[32], fmt[32] = "%0.f";
+
Efl_Ui_Spin_Button_Data *sd = efl_data_scope_get(obj, MY_CLASS);
Efl_Ui_Spin_Data *pd = efl_data_scope_get(obj, EFL_UI_SPIN_CLASS);
- char buf[32], fmt[32] = "%0.f";
+
+ EINA_ARRAY_ITER_NEXT(pd->special_values, i, sv, iterator)
+ {
+ if (sv->value == pd->val)
+ {
+ snprintf(buf, sizeof(buf), "%s", sv->label);
+ elm_object_text_set(sd->ent, buf);
+ }
+ }
/* try to construct just the format from given label
* completely ignoring pre/post words
@@ -156,8 +170,8 @@ _entry_hide(Evas_Object *obj)
{
Efl_Ui_Spin_Button_Data *sd = efl_data_scope_get(obj, MY_CLASS);
- elm_layout_signal_emit(obj, "elm,state,button,active", "elm");
- elm_layout_signal_emit(obj, "elm,state,entry,inactive", "elm");
+ elm_layout_signal_emit(obj, "efl,state,button,active", "efl");
+ elm_layout_signal_emit(obj, "efl,state,entry,inactive", "efl");
if (sd->entry_visible && !evas_focus_state_get(evas_object_evas_get(obj)))
sd->entry_reactivate = EINA_TRUE;
@@ -168,6 +182,9 @@ _entry_hide(Evas_Object *obj)
static void
_entry_value_apply(Evas_Object *obj)
{
+ Efl_Ui_Spin_Special_Value *sv;
+ Eina_Array_Iterator iterator;
+ unsigned int i;
const char *str;
double val;
char *end;
@@ -183,6 +200,10 @@ _entry_value_apply(Evas_Object *obj)
str = elm_object_text_get(sd->ent);
if (!str) return;
+ EINA_ARRAY_ITER_NEXT(pd->special_values, i, sv, iterator)
+ if (sv->value == pd->val)
+ if (!strcmp(sv->label, str)) return;
+
val = strtod(str, &end);
if (((*end != '\0') && (!isspace(*end))) || (fabs(val - pd->val) < DBL_EPSILON)) return;
efl_ui_range_value_set(obj, val);
@@ -339,7 +360,7 @@ _entry_show_cb(void *data,
elm_object_focus_set(obj, EINA_TRUE);
elm_entry_select_all(obj);
sd->entry_visible = EINA_TRUE;
- elm_layout_signal_emit(data, "elm,state,button,inactive", "elm");
+ elm_layout_signal_emit(data, "efl,state,button,inactive", "efl");
}
static void
@@ -365,7 +386,7 @@ _toggle_entry(Evas_Object *obj)
evas_object_event_callback_add
(sd->ent, EVAS_CALLBACK_SHOW, _entry_show_cb, obj);
elm_entry_single_line_set(sd->ent, EINA_TRUE);
- elm_layout_content_set(obj, "elm.swallow.entry", sd->ent);
+ elm_layout_content_set(obj, "efl.entry", sd->ent);
_entry_accept_filter_add(obj);
elm_entry_markup_filter_append(sd->ent, _invalid_input_validity_filter, NULL);
if (_elm_config->spinner_min_max_filter_enable)
@@ -377,7 +398,7 @@ _toggle_entry(Evas_Object *obj)
efl_event_callback_add(sd->ent, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED,
_entry_focus_changed_cb, obj);
sd->entry_visible = EINA_TRUE;
- elm_layout_signal_emit(obj, "elm,state,entry,active", "elm");
+ elm_layout_signal_emit(obj, "efl,state,entry,active", "efl");
{
Eina_List *items = NULL;
@@ -536,7 +557,7 @@ _key_action_toggle(Evas_Object *obj, const char *params EINA_UNUSED)
}
EOLIAN static Eina_Bool
-_efl_ui_spin_button_elm_widget_widget_event(Eo *obj, Efl_Ui_Spin_Button_Data *sd EINA_UNUSED, const Efl_Event *eo_event, Evas_Object *src EINA_UNUSED)
+_efl_ui_spin_button_efl_ui_widget_widget_event(Eo *obj, Efl_Ui_Spin_Button_Data *sd EINA_UNUSED, const Efl_Event *eo_event, Evas_Object *src EINA_UNUSED)
{
Eo *ev = eo_event->info;
@@ -568,17 +589,18 @@ _efl_ui_spin_button_elm_widget_widget_event(Eo *obj, Efl_Ui_Spin_Button_Data *sd
}
EOLIAN static Eina_Bool
-_efl_ui_spin_button_elm_widget_on_focus_update(Eo *obj, Efl_Ui_Spin_Button_Data *sd, Elm_Object_Item *item EINA_UNUSED)
+_efl_ui_spin_button_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Spin_Button_Data *sd)
{
Eina_Bool int_ret = EINA_FALSE;
- int_ret = efl_ui_widget_on_focus_update(efl_super(obj, MY_CLASS), NULL);
+ int_ret = efl_ui_focus_object_on_focus_update(efl_super(obj, MY_CLASS));
if (!int_ret) return EINA_FALSE;
if (!efl_ui_focus_object_focus_get(obj))
{
ELM_SAFE_FREE(sd->delay_change_timer, ecore_timer_del);
ELM_SAFE_FREE(sd->spin_timer, ecore_timer_del);
+ ELM_SAFE_FREE(sd->longpress_timer, ecore_timer_del);
}
else
{
@@ -656,13 +678,13 @@ _access_increment_decrement_info_say(Evas_Object *obj,
if (is_incremented)
{
elm_object_signal_emit
- (sd->inc_button, "elm,action,anim,activate", "elm");
+ (sd->inc_button, "efl,action,anim,activate", "efl");
eina_strbuf_append(buf, E_("incremented"));
}
else
{
elm_object_signal_emit
- (sd->dec_button, "elm,action,anim,activate", "elm");
+ (sd->dec_button, "efl,action,anim,activate", "efl");
eina_strbuf_append(buf, E_("decremented"));
}
@@ -686,10 +708,10 @@ _access_spinner_register(Evas_Object *obj, Eina_Bool is_access)
/* unregister access */
_elm_access_edje_object_part_object_unregister
(obj, elm_layout_edje_get(obj), "access");
- elm_layout_signal_emit(obj, "elm,state,access,inactive", "elm");
+ elm_layout_signal_emit(obj, "efl,state,access,inactive", "efl");
return;
}
- elm_layout_signal_emit(obj, "elm,state,access,active", "elm");
+ elm_layout_signal_emit(obj, "efl,state,access,active", "efl");
ao = _elm_access_edje_object_part_object_register
(obj, elm_layout_edje_get(obj), "access");
@@ -714,7 +736,7 @@ _access_spinner_register(Evas_Object *obj, Eina_Bool is_access)
}
EOLIAN static Efl_Ui_Theme_Apply
-_efl_ui_spin_button_elm_widget_theme_apply(Eo *obj, Efl_Ui_Spin_Button_Data *sd EINA_UNUSED)
+_efl_ui_spin_button_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Spin_Button_Data *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
@@ -722,13 +744,7 @@ _efl_ui_spin_button_elm_widget_theme_apply(Eo *obj, Efl_Ui_Spin_Button_Data *sd
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (sd->ent)
- {
- //elm_widget_element_update(obj, sd->ent, PART_NAME_TEXT);
- Eina_Strbuf *buf = eina_strbuf_new();
- eina_strbuf_append_printf(buf, "spin_button/%s", elm_widget_style_get(obj));
- elm_widget_style_set(sd->ent, eina_strbuf_string_get(buf));
- eina_strbuf_free(buf);
- }
+ elm_widget_element_update(obj, sd->ent, PART_NAME_ENTRY);
if (sd->inc_button)
elm_widget_element_update(obj, sd->inc_button, PART_NAME_INC_BUTTON);
@@ -761,7 +777,7 @@ _efl_ui_spin_button_efl_object_constructor(Eo *obj, Efl_Ui_Spin_Button_Data *sd)
sd->inc_button = efl_add(EFL_UI_BUTTON_CLASS, obj,
elm_widget_element_update(obj, efl_added, PART_NAME_INC_BUTTON),
efl_event_callback_array_add(efl_added, _inc_dec_button_cb(), obj),
- efl_content_set(efl_part(obj, "elm.swallow.inc_button"), efl_added));
+ efl_content_set(efl_part(obj, "efl.inc_button"), efl_added));
sd->text_button = efl_add(EFL_UI_BUTTON_CLASS, obj,
elm_widget_element_update(obj, efl_added, PART_NAME_TEXT_BUTTON),
@@ -769,12 +785,12 @@ _efl_ui_spin_button_efl_object_constructor(Eo *obj, Efl_Ui_Spin_Button_Data *sd)
_text_button_clicked_cb, obj),
efl_event_callback_add(efl_added, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED,
_text_button_focus_changed_cb, obj),
- efl_content_set(efl_part(obj, "elm.swallow.text_button"), efl_added));
+ efl_content_set(efl_part(obj, "efl.text_button"), efl_added));
sd->dec_button = efl_add(EFL_UI_BUTTON_CLASS, obj,
elm_widget_element_update(obj, efl_added, PART_NAME_DEC_BUTTON),
efl_event_callback_array_add(efl_added, _inc_dec_button_cb(), obj),
- efl_content_set(efl_part(obj, "elm.swallow.dec_button"), efl_added));
+ efl_content_set(efl_part(obj, "efl.dec_button"), efl_added));
{
Eina_List *items = NULL;
@@ -787,11 +803,11 @@ _efl_ui_spin_button_efl_object_constructor(Eo *obj, Efl_Ui_Spin_Button_Data *sd)
}
elm_layout_signal_callback_add
- (obj, "elm,action,entry,toggle", "*", _entry_toggle_cb, NULL);
+ (obj, "efl,action,entry,toggle", "*", _entry_toggle_cb, NULL);
elm_widget_can_focus_set(obj, EINA_TRUE);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_SPIN_BUTTON);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_SPIN_BUTTON);
return obj;
}
@@ -811,7 +827,7 @@ _efl_ui_spin_button_editable_set(Eo *obj EINA_UNUSED, Efl_Ui_Spin_Button_Data *s
}
EOLIAN static Eina_Bool
-_efl_ui_spin_button_editable_get(Eo *obj EINA_UNUSED, Efl_Ui_Spin_Button_Data *sd)
+_efl_ui_spin_button_editable_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spin_Button_Data *sd)
{
return sd->editable;
}
@@ -823,13 +839,13 @@ _efl_ui_spin_button_circulate_set(Eo *obj EINA_UNUSED, Efl_Ui_Spin_Button_Data *
}
EOLIAN static Eina_Bool
-_efl_ui_spin_button_circulate_get(Eo *obj EINA_UNUSED, Efl_Ui_Spin_Button_Data *sd)
+_efl_ui_spin_button_circulate_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spin_Button_Data *sd)
{
return sd->circulate;
}
EOLIAN static const Efl_Access_Action_Data *
-_efl_ui_spin_button_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Efl_Ui_Spin_Button_Data *sd EINA_UNUSED)
+_efl_ui_spin_button_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spin_Button_Data *sd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "toggle", "toggle", NULL, _key_action_toggle},
@@ -841,7 +857,7 @@ _efl_ui_spin_button_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED
// A11Y Accessibility
EOLIAN static void
-_efl_ui_spin_button_efl_access_value_value_and_text_get(Eo *obj EINA_UNUSED, Efl_Ui_Spin_Button_Data *sd EINA_UNUSED, double *value, const char **text)
+_efl_ui_spin_button_efl_access_value_value_and_text_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spin_Button_Data *sd EINA_UNUSED, double *value, const char **text)
{
Efl_Ui_Spin_Data *pd = efl_data_scope_get(obj, EFL_UI_SPIN_CLASS);
@@ -864,7 +880,7 @@ _efl_ui_spin_button_efl_access_value_value_and_text_set(Eo *obj, Efl_Ui_Spin_But
}
EOLIAN static void
-_efl_ui_spin_button_efl_access_value_range_get(Eo *obj EINA_UNUSED, Efl_Ui_Spin_Button_Data *sd EINA_UNUSED, double *lower, double *upper, const char **descr)
+_efl_ui_spin_button_efl_access_value_range_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spin_Button_Data *sd EINA_UNUSED, double *lower, double *upper, const char **descr)
{
Efl_Ui_Spin_Data *pd = efl_data_scope_get(obj, EFL_UI_SPIN_CLASS);
@@ -874,7 +890,7 @@ _efl_ui_spin_button_efl_access_value_range_get(Eo *obj EINA_UNUSED, Efl_Ui_Spin_
}
EOLIAN static double
-_efl_ui_spin_button_efl_access_value_increment_get(Eo *obj EINA_UNUSED, Efl_Ui_Spin_Button_Data *sd EINA_UNUSED)
+_efl_ui_spin_button_efl_access_value_increment_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spin_Button_Data *sd EINA_UNUSED)
{
Efl_Ui_Spin_Data *pd = efl_data_scope_get(obj, EFL_UI_SPIN_CLASS);
@@ -882,12 +898,12 @@ _efl_ui_spin_button_efl_access_value_increment_get(Eo *obj EINA_UNUSED, Efl_Ui_S
}
EOLIAN static const char*
-_efl_ui_spin_button_efl_access_name_get(Eo *obj, Efl_Ui_Spin_Button_Data *sd EINA_UNUSED)
+_efl_ui_spin_button_efl_access_object_i18n_name_get(const Eo *obj, Efl_Ui_Spin_Button_Data *sd EINA_UNUSED)
{
const char *name;
- name = efl_access_name_get(efl_super(obj, EFL_UI_SPIN_BUTTON_CLASS));
+ name = efl_access_object_i18n_name_get(efl_super(obj, EFL_UI_SPIN_BUTTON_CLASS));
if (name) return name;
- const char *ret = elm_layout_text_get(obj, "elm.text");
+ const char *ret = elm_layout_text_get(obj, "efl.text");
return ret;
}
diff --git a/src/lib/elementary/efl_ui_spin_button.eo b/src/lib/elementary/efl_ui_spin_button.eo
index c6b88a01b7..4b0b8be632 100644
--- a/src/lib/elementary/efl_ui_spin_button.eo
+++ b/src/lib/elementary/efl_ui_spin_button.eo
@@ -1,5 +1,5 @@
class Efl.Ui.Spin_Button (Efl.Ui.Spin, Efl.Ui.Focus.Composition,
- Efl.Access.Value, Efl.Access.Widget.Action)
+ Efl.Access.Value, Efl.Access.Widget.Action)
{
[[A Button Spin.
@@ -64,17 +64,17 @@ class Efl.Ui.Spin_Button (Efl.Ui.Spin, Efl.Ui.Focus.Composition,
}
implements {
Efl.Object.constructor;
- Elm.Widget.theme_apply;
- Elm.Widget.widget_event;
- Elm.Widget.on_focus_update;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.widget_event;
+ Efl.Ui.Focus.Object.on_focus_update;
Efl.Ui.Range.range_value { set; }
- Efl.Access.name { get; }
+ Efl.Access.Object.i18n_name { get; }
Efl.Access.Value.value_and_text { get; set; }
Efl.Access.Value.range { get; }
Efl.Access.Value.increment { get; }
Efl.Access.Widget.Action.elm_actions { get; }
}
events {
- delay,changed; [[Called when spin delay is changed.]]
+ delay,changed: void; [[Called when spin delay is changed.]]
}
}
diff --git a/src/lib/elementary/efl_ui_spin_private.h b/src/lib/elementary/efl_ui_spin_private.h
index a8065dc647..3d21e3df54 100644
--- a/src/lib/elementary/efl_ui_spin_private.h
+++ b/src/lib/elementary/efl_ui_spin_private.h
@@ -24,6 +24,8 @@ struct _Efl_Ui_Spin_Data
Eina_Free_Cb format_free_cb;
void *format_cb_data;
Eina_Strbuf *format_strbuf;
+
+ Eina_Array *special_values;
};
#endif
diff --git a/src/lib/elementary/efl_ui_stack.c b/src/lib/elementary/efl_ui_stack.c
new file mode 100644
index 0000000000..0c30501d62
--- /dev/null
+++ b/src/lib/elementary/efl_ui_stack.c
@@ -0,0 +1,972 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <Elementary.h>
+
+#include "elm_priv.h"
+#include "efl_ui_stack_private.h"
+
+#define MY_CLASS EFL_UI_STACK_CLASS
+#define MY_CLASS_NAME "Efl.Ui.Stack"
+
+static Efl_Canvas_Animation *show_anim = NULL;
+static Efl_Canvas_Animation *hide_anim = NULL;
+
+static void
+_content_del_cb(void *data, const Efl_Event *event EINA_UNUSED)
+{
+ Content_Data *cd = data;
+
+ //Popped content has already called deactivated event and unloaded event.
+ if (cd->popped_hidden) return;
+
+ //Deactivated Event
+ Efl_Ui_Stack_Event_Deactivated deactivated_info;
+ deactivated_info.content = cd->content;
+ efl_event_callback_call(cd->stack,
+ EFL_UI_STACK_EVENT_DEACTIVATED,
+ &deactivated_info);
+
+ //Unloaded Event
+ Efl_Ui_Stack_Event_Unloaded unloaded_info;
+ unloaded_info.content = cd->content;
+ efl_event_callback_call(cd->stack,
+ EFL_UI_STACK_EVENT_UNLOADED,
+ &unloaded_info);
+}
+
+static Content_Data *
+_content_data_new(Eo *obj, Eo *content)
+{
+ Content_Data *cd = calloc(1, sizeof(Content_Data));
+ if (!cd)
+ {
+ ERR("Memory allocation error!");
+ return NULL;
+ }
+
+ cd->stack = obj;
+ cd->content = content;
+
+ efl_event_callback_add(cd->content, EFL_EVENT_DEL, _content_del_cb, cd);
+
+ return cd;
+}
+
+static void
+_content_data_del(Content_Data *cd)
+{
+ if (!cd) return;
+
+ if (cd->content)
+ efl_del(cd->content);
+
+ free(cd);
+}
+
+static void
+_anim_started_cb(void *data EINA_UNUSED, const Efl_Event *event)
+{
+ efl_canvas_object_freeze_events_set(event->object, EINA_TRUE);
+
+ efl_event_callback_del(event->object, EFL_CANVAS_OBJECT_EVENT_ANIM_STARTED,
+ _anim_started_cb, NULL);
+}
+
+static void
+_anim_ended_cb(void *data, const Efl_Event *event)
+{
+ Transit_Data *td = data;
+ Efl_Canvas_Object_Animation_Event *anim_event = event->info;
+
+ //Unset animation because originally there is no animation.
+ if (!td->orig_anim)
+ efl_canvas_object_event_animation_set(event->object,
+ anim_event->event_desc, NULL);
+
+ efl_canvas_object_freeze_events_set(event->object,
+ td->freeze_events);
+
+ td->cd->on_pushing = EINA_FALSE;
+ td->cd->on_popping = EINA_FALSE;
+
+ if (anim_event->event_desc == EFL_GFX_ENTITY_EVENT_SHOW)
+ {
+ //Activated Event
+ Efl_Ui_Stack_Event_Activated activated_info;
+ activated_info.content = event->object;
+ efl_event_callback_call(td->cd->stack,
+ EFL_UI_STACK_EVENT_ACTIVATED,
+ &activated_info);
+ }
+ else
+ {
+ //Deactivated Event
+ Efl_Ui_Stack_Event_Deactivated deactivated_info;
+ deactivated_info.content = event->object;
+ efl_event_callback_call(td->cd->stack,
+ EFL_UI_STACK_EVENT_DEACTIVATED,
+ &deactivated_info);
+
+ //Unloaded Event
+ Efl_Ui_Stack_Event_Unloaded unloaded_info;
+ unloaded_info.content = event->object;
+ efl_event_callback_call(td->cd->stack,
+ EFL_UI_STACK_EVENT_UNLOADED,
+ &unloaded_info);
+ }
+
+ efl_event_callback_del(event->object, EFL_CANVAS_OBJECT_EVENT_ANIM_ENDED,
+ _anim_ended_cb, data);
+ free(data);
+}
+
+EOLIAN static void
+_efl_ui_stack_push(Eo *obj, Efl_Ui_Stack_Data *pd, Eo *content)
+{
+ if (!content) return;
+
+ //If the given content exists in the stack, promote the given content to the top.
+ Content_Data *cd = NULL;
+ EINA_INLIST_FOREACH(pd->stack, cd)
+ if (cd->content == content)
+ break;
+
+ Content_Data *top_cd = NULL;
+ if (pd->stack)
+ top_cd = EINA_INLIST_CONTAINER_GET(pd->stack->last, Content_Data);
+
+ if (cd)
+ {
+ //If given content is already the top content, then do nothing.
+ if (cd == top_cd)
+ return;
+
+ //Remove the given content(existing content) to promote it to the top.
+ pd->stack = eina_inlist_remove(pd->stack, EINA_INLIST_GET(cd));
+ }
+ else
+ {
+ cd = _content_data_new(obj, content);
+ if (!cd) return;
+
+ evas_object_smart_member_add(content, obj);
+ }
+
+ pd->stack = eina_inlist_append(pd->stack, EINA_INLIST_GET(cd));
+
+ //Loaded Event
+ Efl_Ui_Stack_Event_Loaded loaded_info;
+ loaded_info.content = content;
+ efl_event_callback_call(obj, EFL_UI_STACK_EVENT_LOADED, &loaded_info);
+
+ /* Apply transition to top content.
+ * Hide top content with animation. */
+ if (top_cd)
+ {
+ Eo *top_content = top_cd->content;
+
+ Efl_Canvas_Animation *orig_hide_anim =
+ efl_canvas_object_event_animation_get(top_content, EFL_GFX_ENTITY_EVENT_HIDE);
+
+ /* If content is being pushed now, then finish current animation and hide
+ * the content without animation. */
+ if (top_cd->on_pushing)
+ {
+ //Finish current animation.
+ efl_canvas_object_event_animation_set(top_content,
+ EFL_GFX_ENTITY_EVENT_SHOW, NULL);
+
+ //Hide without animation.
+ if (orig_hide_anim)
+ efl_canvas_object_event_animation_set(top_content,
+ EFL_GFX_ENTITY_EVENT_HIDE, NULL);
+
+ efl_gfx_entity_visible_set(top_content, EINA_FALSE);
+
+ if (orig_hide_anim)
+ efl_canvas_object_event_animation_set(top_content,
+ EFL_GFX_ENTITY_EVENT_HIDE,
+ orig_hide_anim);
+
+ //Deactivated Event
+ Efl_Ui_Stack_Event_Deactivated deactivated_info;
+ deactivated_info.content = top_content;
+ efl_event_callback_call(obj, EFL_UI_STACK_EVENT_DEACTIVATED,
+ &deactivated_info);
+
+ //Unloaded Event
+ Efl_Ui_Stack_Event_Unloaded unloaded_info;
+ unloaded_info.content = top_content;
+ efl_event_callback_call(obj, EFL_UI_STACK_EVENT_UNLOADED,
+ &unloaded_info);
+ }
+ else
+ {
+ top_cd->on_pushing = EINA_TRUE;
+
+ //Hide with animation.
+ if (!orig_hide_anim)
+ efl_canvas_object_event_animation_set(top_content,
+ EFL_GFX_ENTITY_EVENT_HIDE,
+ hide_anim);
+
+ Transit_Data *td = calloc(1, sizeof(Transit_Data));
+ td->cd = top_cd;
+ td->orig_anim = !!(orig_hide_anim);
+ td->freeze_events = efl_canvas_object_freeze_events_get(top_content);
+
+ efl_event_callback_add(top_content,
+ EFL_CANVAS_OBJECT_EVENT_ANIM_STARTED,
+ _anim_started_cb, NULL);
+ efl_event_callback_add(top_content,
+ EFL_CANVAS_OBJECT_EVENT_ANIM_ENDED,
+ _anim_ended_cb, td);
+
+ efl_gfx_entity_visible_set(top_content, EINA_FALSE);
+ }
+ }
+
+ /* Prepare transition for new content.
+ * Hide new content without animation. */
+ {
+ cd->on_pushing = EINA_TRUE;
+
+ Efl_Canvas_Animation *orig_hide_anim =
+ efl_canvas_object_event_animation_get(content, EFL_GFX_ENTITY_EVENT_HIDE);
+
+ //Hide without animation.
+ if (orig_hide_anim)
+ efl_canvas_object_event_animation_set(content, EFL_GFX_ENTITY_EVENT_HIDE, NULL);
+ efl_gfx_entity_visible_set(content, EINA_FALSE);
+
+ //Restore original hide animation
+ if (orig_hide_anim)
+ efl_canvas_object_event_animation_set(content, EFL_GFX_ENTITY_EVENT_HIDE,
+ orig_hide_anim);
+ }
+
+ /* Apply transition to new content.
+ * Show new content with animation. */
+ {
+ evas_object_raise(content);
+
+ Efl_Canvas_Animation *orig_show_anim =
+ efl_canvas_object_event_animation_get(content, EFL_GFX_ENTITY_EVENT_SHOW);
+
+ //Show with animation
+ if (!orig_show_anim)
+ efl_canvas_object_event_animation_set(content, EFL_GFX_ENTITY_EVENT_SHOW,
+ show_anim);
+
+ Transit_Data *td = calloc(1, sizeof(Transit_Data));
+ td->cd = cd;
+ td->orig_anim = !!(orig_show_anim);
+ td->freeze_events = efl_canvas_object_freeze_events_get(content);
+
+ efl_event_callback_add(content, EFL_CANVAS_OBJECT_EVENT_ANIM_STARTED,
+ _anim_started_cb, NULL);
+ efl_event_callback_add(content, EFL_CANVAS_OBJECT_EVENT_ANIM_ENDED,
+ _anim_ended_cb, td);
+
+ /* efl_ui_widget_resize_object_set() calls efl_gfx_entity_visible_set()
+ * internally.
+ * Therefore, efl_ui_widget_resize_object_set() is called after
+ * setting animation and efl_gfx_entity_visible_set() is not called. */
+ efl_ui_widget_resize_object_set(obj, content);
+ }
+}
+
+static void
+_pop_content_hide_cb(void *data, const Efl_Event *event EINA_UNUSED)
+{
+ Content_Data *cd = data;
+
+ cd->popped_hidden = EINA_TRUE;
+
+ _content_data_del(cd);
+}
+
+EOLIAN static Eo *
+_efl_ui_stack_pop(Eo *obj, Efl_Ui_Stack_Data *pd)
+{
+ if (!pd->stack)
+ {
+ ERR("There is no content in the stack!");
+ return NULL;
+ }
+
+ Content_Data *top_cd = EINA_INLIST_CONTAINER_GET(pd->stack->last, Content_Data);
+ if (!top_cd) return NULL;
+
+ pd->stack = eina_inlist_remove(pd->stack, EINA_INLIST_GET(top_cd));
+
+ /* Apply transition to top content.
+ * Hide top content with animation. */
+ {
+ Eo *top_content = top_cd->content;
+
+ Efl_Canvas_Animation *orig_hide_anim =
+ efl_canvas_object_event_animation_get(top_content, EFL_GFX_ENTITY_EVENT_HIDE);
+
+ /* If content is being popped now, then finish current animation and show
+ * the content without animation. */
+ if (top_cd->on_popping)
+ {
+ //Finish current animation.
+ efl_canvas_object_event_animation_set(top_content,
+ EFL_GFX_ENTITY_EVENT_SHOW, NULL);
+
+ //Hide without animation.
+ if (orig_hide_anim)
+ efl_canvas_object_event_animation_set(top_content,
+ EFL_GFX_ENTITY_EVENT_HIDE, NULL);
+
+ efl_gfx_entity_visible_set(top_content, EINA_FALSE);
+
+ if (orig_hide_anim)
+ efl_canvas_object_event_animation_set(top_content,
+ EFL_GFX_ENTITY_EVENT_HIDE,
+ orig_hide_anim);
+
+ //Deactivated Event
+ Efl_Ui_Stack_Event_Deactivated deactivated_info;
+ deactivated_info.content = top_content;
+ efl_event_callback_call(obj, EFL_UI_STACK_EVENT_DEACTIVATED,
+ &deactivated_info);
+
+ //Unloaded Event
+ Efl_Ui_Stack_Event_Unloaded unloaded_info;
+ unloaded_info.content = top_content;
+ efl_event_callback_call(obj, EFL_UI_STACK_EVENT_UNLOADED,
+ &unloaded_info);
+
+ efl_canvas_object_event_animation_set(top_content,
+ EFL_GFX_ENTITY_EVENT_SHOW,
+ NULL);
+ }
+ else
+ {
+ top_cd->on_popping = EINA_TRUE;
+
+ //Hide with animation.
+ if (!orig_hide_anim)
+ efl_canvas_object_event_animation_set(top_content,
+ EFL_GFX_ENTITY_EVENT_HIDE,
+ hide_anim);
+
+ //Deallocate content data when hide animation is finished.
+ efl_event_callback_add(top_content, EFL_GFX_ENTITY_EVENT_HIDE,
+ _pop_content_hide_cb, top_cd);
+
+ Transit_Data *td = calloc(1, sizeof(Transit_Data));
+ td->cd = top_cd;
+ td->orig_anim = !!(orig_hide_anim);
+ td->freeze_events = efl_canvas_object_freeze_events_get(top_content);
+
+ efl_event_callback_add(top_content,
+ EFL_CANVAS_OBJECT_EVENT_ANIM_STARTED,
+ _anim_started_cb, NULL);
+ efl_event_callback_add(top_content,
+ EFL_CANVAS_OBJECT_EVENT_ANIM_ENDED,
+ _anim_ended_cb, td);
+
+ efl_gfx_entity_visible_set(top_content, EINA_FALSE);
+ }
+ }
+
+ if (pd->stack)
+ {
+ Content_Data *prev_cd = EINA_INLIST_CONTAINER_GET(pd->stack->last,
+ Content_Data);
+ if (prev_cd)
+ {
+ Eo *prev_content = prev_cd->content;
+
+ //If content is being pushed now, then finish current animation.
+ if (prev_cd->on_pushing)
+ {
+ efl_canvas_object_event_animation_set(prev_content,
+ EFL_GFX_ENTITY_EVENT_HIDE,
+ NULL);
+ }
+ prev_cd->on_popping = EINA_TRUE;
+
+ //Loaded Event
+ Efl_Ui_Stack_Event_Loaded loaded_info;
+ loaded_info.content = prev_content;
+ efl_event_callback_call(obj, EFL_UI_STACK_EVENT_LOADED,
+ &loaded_info);
+
+ /* Apply transition to previous content.
+ * Show previous content with animation. */
+ {
+ Efl_Canvas_Animation *orig_show_anim =
+ efl_canvas_object_event_animation_get(prev_content,
+ EFL_GFX_ENTITY_EVENT_SHOW);
+
+ //Show with animation
+ if (!orig_show_anim)
+ efl_canvas_object_event_animation_set(prev_content,
+ EFL_GFX_ENTITY_EVENT_SHOW,
+ show_anim);
+
+ Transit_Data *td = calloc(1, sizeof(Transit_Data));
+ td->cd = prev_cd;
+ td->orig_anim = !!(orig_show_anim);
+ td->freeze_events =
+ efl_canvas_object_freeze_events_get(prev_content);
+
+ efl_event_callback_add(prev_content,
+ EFL_CANVAS_OBJECT_EVENT_ANIM_STARTED,
+ _anim_started_cb, NULL);
+ efl_event_callback_add(prev_content,
+ EFL_CANVAS_OBJECT_EVENT_ANIM_ENDED,
+ _anim_ended_cb, td);
+
+ /* efl_ui_widget_resize_object_set() calls efl_gfx_entity_visible_set()
+ * internally.
+ * Therefore, efl_ui_widget_resize_object_set() is called after
+ * setting animation and efl_gfx_entity_visible_set() is not called. */
+ efl_ui_widget_resize_object_set(obj, prev_content);
+ }
+
+ }
+ }
+
+ return NULL;
+}
+
+EOLIAN static void
+_efl_ui_stack_insert_before(Eo *obj, Efl_Ui_Stack_Data *pd,
+ Eo *base_content, Eo *content)
+{
+ if (!content) return;
+
+ Content_Data *base_cd = NULL;
+ EINA_INLIST_FOREACH(pd->stack, base_cd)
+ if (base_cd->content == base_content)
+ break;
+
+ if (!base_cd)
+ {
+ ERR("The given base content is not found in the stack!");
+ return;
+ }
+
+ Content_Data *cd = _content_data_new(obj, content);
+ if (!cd) return;
+
+ pd->stack = eina_inlist_prepend_relative(pd->stack,
+ EINA_INLIST_GET(cd),
+ EINA_INLIST_GET(base_cd));
+ evas_object_smart_member_add(content, obj);
+}
+
+EOLIAN static void
+_efl_ui_stack_insert_after(Eo *obj, Efl_Ui_Stack_Data *pd,
+ Eo *base_content, Eo *content)
+{
+ if (!content) return;
+
+ Content_Data *base_cd = NULL;
+ EINA_INLIST_FOREACH(pd->stack, base_cd)
+ if (base_cd->content == base_content)
+ break;
+
+ if (!base_cd)
+ {
+ ERR("The given base content is not found in the stack!");
+ return;
+ }
+
+ Content_Data *cd = _content_data_new(obj, content);
+ if (!cd) return;
+
+ pd->stack = eina_inlist_append_relative(pd->stack,
+ EINA_INLIST_GET(cd),
+ EINA_INLIST_GET(base_cd));
+ evas_object_smart_member_add(content, obj);
+
+ if (pd->stack->last == EINA_INLIST_GET(cd))
+ {
+ //Loaded Event
+ Efl_Ui_Stack_Event_Loaded loaded_info;
+ loaded_info.content = content;
+ efl_event_callback_call(obj, EFL_UI_STACK_EVENT_LOADED,
+ &loaded_info);
+
+ /* Do not apply transition for insert.
+ * Hide top content without animation. */
+ {
+ Efl_Canvas_Animation *orig_hide_anim =
+ efl_canvas_object_event_animation_get(base_cd->content,
+ EFL_GFX_ENTITY_EVENT_HIDE);
+
+ if (orig_hide_anim)
+ efl_canvas_object_event_animation_set(base_cd->content,
+ EFL_GFX_ENTITY_EVENT_HIDE, NULL);
+
+ efl_gfx_entity_visible_set(base_cd->content, EINA_FALSE);
+
+ if (orig_hide_anim)
+ efl_canvas_object_event_animation_set(base_cd->content,
+ EFL_GFX_ENTITY_EVENT_HIDE,
+ orig_hide_anim);
+ }
+
+ //Deactivated Event
+ Efl_Ui_Stack_Event_Deactivated deactivated_info;
+ deactivated_info.content = base_cd->content;
+ efl_event_callback_call(obj, EFL_UI_STACK_EVENT_DEACTIVATED,
+ &deactivated_info);
+
+ //Unloaded Event
+ Efl_Ui_Stack_Event_Unloaded unloaded_info;
+ unloaded_info.content = base_cd->content;
+ efl_event_callback_call(obj, EFL_UI_STACK_EVENT_UNLOADED,
+ &unloaded_info);
+
+
+ /* Do not apply transition for insert.
+ * Show new content without animation. */
+ {
+ Efl_Canvas_Animation *orig_show_anim =
+ efl_canvas_object_event_animation_get(content,
+ EFL_GFX_ENTITY_EVENT_SHOW);
+
+ if (orig_show_anim)
+ efl_canvas_object_event_animation_set(content, EFL_GFX_ENTITY_EVENT_SHOW,
+ NULL);
+
+ evas_object_raise(content);
+ /* efl_ui_widget_resize_object_set() calls efl_gfx_entity_visible_set()
+ * internally.
+ * Therefore, efl_ui_widget_resize_object_set() is called after
+ * setting animation and efl_gfx_entity_visible_set() is not called. */
+ efl_ui_widget_resize_object_set(obj, content);
+
+ if (orig_show_anim)
+ efl_canvas_object_event_animation_set(content, EFL_GFX_ENTITY_EVENT_SHOW,
+ orig_show_anim);
+ }
+
+ //Activated Event
+ Efl_Ui_Stack_Event_Activated activated_info;
+ activated_info.content = content;
+ efl_event_callback_call(obj, EFL_UI_STACK_EVENT_ACTIVATED,
+ &activated_info);
+ }
+}
+
+EOLIAN static void
+_efl_ui_stack_insert_at(Eo *obj, Efl_Ui_Stack_Data *pd,
+ int index, Eo *content)
+{
+ if (!content)
+ {
+ ERR("The given content is NULL!");
+ return;
+ }
+
+ int count = eina_inlist_count(pd->stack);
+ if ((index < 0) || (index > count))
+ {
+ ERR("The index(%d) should be from 0 to #contents in the stack(%d)!",
+ index, count);
+ return;
+ }
+
+ Content_Data *base_cd = NULL;
+
+ if (index == count)
+ {
+ base_cd = EINA_INLIST_CONTAINER_GET(pd->stack->last, Content_Data);
+ }
+ else
+ {
+ int i = 0;
+ EINA_INLIST_FOREACH(pd->stack, base_cd)
+ {
+ if (i == index)
+ break;
+
+ i++;
+ }
+ }
+
+ Content_Data *cd = _content_data_new(obj, content);
+ if (!cd) return;
+
+ if (index == count)
+ pd->stack = eina_inlist_append_relative(pd->stack,
+ EINA_INLIST_GET(cd),
+ EINA_INLIST_GET(base_cd));
+ else
+ pd->stack = eina_inlist_prepend_relative(pd->stack,
+ EINA_INLIST_GET(cd),
+ EINA_INLIST_GET(base_cd));
+
+ evas_object_smart_member_add(content, obj);
+
+ if (pd->stack->last == EINA_INLIST_GET(cd))
+ {
+ //Loaded Event
+ Efl_Ui_Stack_Event_Loaded loaded_info;
+ loaded_info.content = content;
+ efl_event_callback_call(obj, EFL_UI_STACK_EVENT_LOADED,
+ &loaded_info);
+
+ /* Do not apply transition for insert.
+ * Hide top content without animation. */
+ {
+ Efl_Canvas_Animation *orig_hide_anim =
+ efl_canvas_object_event_animation_get(base_cd->content,
+ EFL_GFX_ENTITY_EVENT_HIDE);
+
+ if (orig_hide_anim)
+ efl_canvas_object_event_animation_set(base_cd->content,
+ EFL_GFX_ENTITY_EVENT_HIDE, NULL);
+
+ efl_gfx_entity_visible_set(base_cd->content, EINA_FALSE);
+
+ if (orig_hide_anim)
+ efl_canvas_object_event_animation_set(base_cd->content,
+ EFL_GFX_ENTITY_EVENT_HIDE,
+ orig_hide_anim);
+ }
+
+ //Deactivated Event
+ Efl_Ui_Stack_Event_Deactivated deactivated_info;
+ deactivated_info.content = base_cd->content;
+ efl_event_callback_call(obj, EFL_UI_STACK_EVENT_DEACTIVATED,
+ &deactivated_info);
+
+ //Unloaded Event
+ Efl_Ui_Stack_Event_Unloaded unloaded_info;
+ unloaded_info.content = base_cd->content;
+ efl_event_callback_call(obj, EFL_UI_STACK_EVENT_UNLOADED,
+ &unloaded_info);
+
+
+ /* Do not apply transition for insert.
+ * Show new content without animation. */
+ {
+ Efl_Canvas_Animation *orig_show_anim =
+ efl_canvas_object_event_animation_get(content,
+ EFL_GFX_ENTITY_EVENT_SHOW);
+
+ if (orig_show_anim)
+ efl_canvas_object_event_animation_set(content, EFL_GFX_ENTITY_EVENT_SHOW,
+ NULL);
+
+ evas_object_raise(content);
+ /* efl_ui_widget_resize_object_set() calls efl_gfx_entity_visible_set()
+ * internally.
+ * Therefore, efl_ui_widget_resize_object_set() is called after
+ * setting animation and efl_gfx_entity_visible_set() is not called. */
+ efl_ui_widget_resize_object_set(obj, content);
+
+ if (orig_show_anim)
+ efl_canvas_object_event_animation_set(content, EFL_GFX_ENTITY_EVENT_SHOW,
+ orig_show_anim);
+ }
+
+ //Activated Event
+ Efl_Ui_Stack_Event_Activated activated_info;
+ activated_info.content = content;
+ efl_event_callback_call(obj, EFL_UI_STACK_EVENT_ACTIVATED,
+ &activated_info);
+ }
+}
+
+EOLIAN static void
+_efl_ui_stack_remove(Eo *obj, Efl_Ui_Stack_Data *pd, Eo *content)
+{
+ if (!pd->stack)
+ {
+ ERR("There is no content in the stack!");
+ return;
+ }
+
+ if (!content)
+ {
+ ERR("The given content is NULL!");
+ return;
+ }
+
+ Content_Data *cd = NULL;
+
+ EINA_INLIST_FOREACH(pd->stack, cd)
+ {
+ if (cd->content == content)
+ break;
+ }
+ if (!cd)
+ {
+ ERR("The given content does not exist in the stack!");
+ return;
+ }
+
+ Eina_Bool remove_top = EINA_FALSE;
+ if (pd->stack->last == EINA_INLIST_GET(cd))
+ remove_top = EINA_TRUE;
+
+ pd->stack = eina_inlist_remove(pd->stack, EINA_INLIST_GET(cd));
+
+ //Deactivated Event
+ Efl_Ui_Stack_Event_Deactivated deactivated_info;
+ deactivated_info.content = cd->content;
+ efl_event_callback_call(obj, EFL_UI_STACK_EVENT_DEACTIVATED,
+ &deactivated_info);
+
+ //Unloaded Event
+ Efl_Ui_Stack_Event_Unloaded unloaded_info;
+ unloaded_info.content = cd->content;
+ efl_event_callback_call(obj, EFL_UI_STACK_EVENT_UNLOADED,
+ &unloaded_info);
+ _content_data_del(cd);
+
+ if (remove_top)
+ {
+ if (pd->stack)
+ {
+ Content_Data *new_top_cd = EINA_INLIST_CONTAINER_GET(pd->stack->last,
+ Content_Data);
+ if (new_top_cd)
+ {
+ //Loaded Event
+ Efl_Ui_Stack_Event_Loaded loaded_info;
+ loaded_info.content = new_top_cd->content;
+ efl_event_callback_call(obj, EFL_UI_STACK_EVENT_LOADED,
+ &loaded_info);
+
+ /* Do not apply transition for insert.
+ * Show new content without animation. */
+ {
+ Efl_Canvas_Animation *orig_show_anim =
+ efl_canvas_object_event_animation_get(new_top_cd->content,
+ EFL_GFX_ENTITY_EVENT_SHOW);
+
+ if (orig_show_anim)
+ efl_canvas_object_event_animation_set(new_top_cd->content,
+ EFL_GFX_ENTITY_EVENT_SHOW,
+ NULL);
+
+ evas_object_raise(new_top_cd->content);
+ /* efl_ui_widget_resize_object_set() calls efl_gfx_entity_visible_set()
+ * internally.
+ * Therefore, efl_ui_widget_resize_object_set() is called after
+ * setting animation and efl_gfx_entity_visible_set() is not called. */
+ efl_ui_widget_resize_object_set(obj, new_top_cd->content);
+
+ if (orig_show_anim)
+ efl_canvas_object_event_animation_set(new_top_cd->content,
+ EFL_GFX_ENTITY_EVENT_SHOW,
+ orig_show_anim);
+ }
+
+ //Activated Event
+ Efl_Ui_Stack_Event_Activated activated_info;
+ activated_info.content = new_top_cd->content;
+ efl_event_callback_call(obj, EFL_UI_STACK_EVENT_ACTIVATED,
+ &activated_info);
+ }
+ }
+ }
+}
+
+EOLIAN static void
+_efl_ui_stack_remove_at(Eo *obj, Efl_Ui_Stack_Data *pd,
+ int index)
+{
+ if (!pd->stack)
+ {
+ ERR("There is no content in the stack!");
+ return;
+ }
+
+ int count = eina_inlist_count(pd->stack);
+ if ((index < 0) || (index >= count))
+ {
+ ERR("The index(%d) should be from 0 to (#contents - 1) in the stack(%d)!",
+ index, count);
+ return;
+ }
+
+ Content_Data *cd = NULL;
+ int i = 0;
+ EINA_INLIST_FOREACH(pd->stack, cd)
+ {
+ if (i == index)
+ break;
+ i++;
+ }
+
+ Eina_Bool remove_top = EINA_FALSE;
+ if (pd->stack->last == EINA_INLIST_GET(cd))
+ remove_top = EINA_TRUE;
+
+ pd->stack = eina_inlist_remove(pd->stack, EINA_INLIST_GET(cd));
+
+ //Deactivated Event
+ Efl_Ui_Stack_Event_Deactivated deactivated_info;
+ deactivated_info.content = cd->content;
+ efl_event_callback_call(obj, EFL_UI_STACK_EVENT_DEACTIVATED,
+ &deactivated_info);
+
+ //Unloaded Event
+ Efl_Ui_Stack_Event_Unloaded unloaded_info;
+ unloaded_info.content = cd->content;
+ efl_event_callback_call(obj, EFL_UI_STACK_EVENT_UNLOADED,
+ &unloaded_info);
+ _content_data_del(cd);
+
+ //FIXME: Apply transition here.
+ if (remove_top)
+ {
+ if (pd->stack)
+ {
+ Content_Data *new_top_cd = EINA_INLIST_CONTAINER_GET(pd->stack->last,
+ Content_Data);
+ if (new_top_cd)
+ {
+ //Loaded Event
+ Efl_Ui_Stack_Event_Loaded loaded_info;
+ loaded_info.content = new_top_cd->content;
+ efl_event_callback_call(obj, EFL_UI_STACK_EVENT_LOADED,
+ &loaded_info);
+
+ /* Do not apply transition for insert.
+ * Show new content without animation. */
+ {
+ Efl_Canvas_Animation *orig_show_anim =
+ efl_canvas_object_event_animation_get(new_top_cd->content,
+ EFL_GFX_ENTITY_EVENT_SHOW);
+
+ if (orig_show_anim)
+ efl_canvas_object_event_animation_set(new_top_cd->content,
+ EFL_GFX_ENTITY_EVENT_SHOW,
+ NULL);
+
+ evas_object_raise(new_top_cd->content);
+ /* efl_ui_widget_resize_object_set() calls efl_gfx_entity_visible_set()
+ * internally.
+ * Therefore, efl_ui_widget_resize_object_set() is called after
+ * setting animation and efl_gfx_entity_visible_set() is not called. */
+ efl_ui_widget_resize_object_set(obj, new_top_cd->content);
+
+ if (orig_show_anim)
+ efl_canvas_object_event_animation_set(new_top_cd->content,
+ EFL_GFX_ENTITY_EVENT_SHOW,
+ orig_show_anim);
+ }
+
+ //Activated Event
+ Efl_Ui_Stack_Event_Activated activated_info;
+ activated_info.content = new_top_cd->content;
+ efl_event_callback_call(obj, EFL_UI_STACK_EVENT_ACTIVATED,
+ &activated_info);
+ }
+ }
+ }
+}
+
+EOLIAN static int
+_efl_ui_stack_index_get(Eo *obj EINA_UNUSED, Efl_Ui_Stack_Data *pd, Efl_Canvas_Object *content)
+{
+ if (!pd->stack)
+ {
+ ERR("There is no content in the stack!");
+ return -1;
+ }
+
+ if (!content)
+ {
+ ERR("The given content is NULL!");
+ return -1;
+ }
+
+ Content_Data *cd = NULL;
+ int index = 0;
+ int count = eina_inlist_count(pd->stack);
+
+ EINA_INLIST_FOREACH(pd->stack, cd)
+ {
+ if (cd->content == content)
+ break;
+ index++;
+ }
+
+ //The given content is not found.
+ if (index == count) return -1;
+
+ return index;
+}
+
+EOLIAN static Eo *
+_efl_ui_stack_content_get(Eo *obj EINA_UNUSED, Efl_Ui_Stack_Data *pd, int index)
+{
+ if (!pd->stack)
+ {
+ ERR("There is no content in the stack!");
+ return NULL;
+ }
+
+ int count = eina_inlist_count(pd->stack);
+ if ((index < 0) || (index >= count))
+ {
+ ERR("The index(%d) should be from 0 to (#contents - 1) in the stack(%d)!",
+ index, count);
+ return NULL;
+ }
+
+ Content_Data *cd = NULL;
+ int i = 0;
+ EINA_INLIST_FOREACH(pd->stack, cd)
+ {
+ if (i == index)
+ break;
+ i++;
+ }
+
+ if (cd)
+ return cd->content;
+
+ return NULL;
+}
+
+EOLIAN static Eo *
+_efl_ui_stack_top(Eo *obj EINA_UNUSED, Efl_Ui_Stack_Data *pd)
+{
+ if (!pd->stack) return NULL;
+
+ Content_Data *cd = EINA_INLIST_CONTAINER_GET(pd->stack->last, Content_Data);
+ if (!cd) return NULL;
+
+ return cd->content;
+}
+
+EOLIAN static Eo *
+_efl_ui_stack_efl_object_constructor(Eo *obj, Efl_Ui_Stack_Data *pd EINA_UNUSED)
+{
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+ efl_canvas_object_type_set(obj, MY_CLASS_NAME);
+
+ //Default Show Animation
+ show_anim = efl_add(EFL_CANVAS_ANIMATION_ALPHA_CLASS, obj);
+ efl_animation_alpha_set(show_anim, 0.0, 1.0);
+ efl_animation_duration_set(show_anim, 0.5);
+ efl_animation_final_state_keep_set(show_anim, EINA_TRUE);
+
+ //Default Hide Animation
+ hide_anim = efl_add(EFL_CANVAS_ANIMATION_ALPHA_CLASS, obj);
+ efl_animation_alpha_set(hide_anim, 1.0, 0.0);
+ efl_animation_duration_set(hide_anim, 0.5);
+ efl_animation_final_state_keep_set(hide_anim, EINA_TRUE);
+
+ return obj;
+}
+
+#include "efl_ui_stack.eo.c"
diff --git a/src/lib/elementary/efl_ui_stack.eo b/src/lib/elementary/efl_ui_stack.eo
new file mode 100644
index 0000000000..65f8156789
--- /dev/null
+++ b/src/lib/elementary/efl_ui_stack.eo
@@ -0,0 +1,131 @@
+struct Efl.Ui.Stack_Event_Loaded {
+ [[Information of loaded event.]]
+ content: Efl.Canvas.Object; [[Loaded content.]]
+}
+
+struct Efl.Ui.Stack_Event_Unloaded {
+ [[Information of unloaded event.]]
+ content: Efl.Canvas.Object; [[Unloaded content.]]
+}
+
+struct Efl.Ui.Stack_Event_Activated {
+ [[Information of activated event.]]
+ content: Efl.Canvas.Object; [[Activated content.]]
+}
+
+struct Efl.Ui.Stack_Event_Deactivated {
+ [[Information of deactivated event.]]
+ content: Efl.Canvas.Object; [[Deactivated content.]]
+}
+
+class Efl.Ui.Stack (Efl.Ui.Layout.Object)
+{
+ [[Stack widget.
+
+ Stack widget arranges objects in stack structure by pushing and poping them.
+ ]]
+ methods {
+ push {
+ [[Pushes a new object to the top of the stack and shows it.
+ ]]
+ params {
+ @in content: Efl.Canvas.Object;
+ [[The pushed object which becomes the top content of the stack.]]
+ }
+ }
+ pop {
+ [[Pops the top content from the stack and deletes it.
+ ]]
+ return: Efl.Canvas.Object;
+ [[The top content which is removed from the stack.]]
+ }
+ insert_before {
+ [[Inserts an object before the given base content in the stack.
+ ]]
+ params {
+ @in base_content: Efl.Canvas.Object;
+ [[$content is inserted before this $base_content.]]
+ @in content: Efl.Canvas.Object;
+ [[The inserted object in the stack.]]
+ }
+ }
+ insert_after {
+ [[Inserts an object after the given base content in the stack.
+ ]]
+ params {
+ @in base_content: Efl.Canvas.Object;
+ [[$content is inserted after this $base_content.]]
+ @in content: Efl.Canvas.Object;
+ [[The inserted object in the stack.]]
+ }
+ }
+ insert_at {
+ [[Inserts an object at the given place in the stack.
+ ]]
+ params {
+ @in index: int;
+ [[The index of the inserted object in the stack.
+ $index begins from bottom to top of the stack.
+ $index of the bottom content is 0.
+ ]]
+ @in content: Efl.Canvas.Object;
+ [[The inserted object in the stack.]]
+ }
+ }
+ remove {
+ [[Removes the given content in the stack.
+ ]]
+ params {
+ @in content: Efl.Canvas.Object;
+ [[The removed content from the stack.]]
+ }
+ }
+ remove_at {
+ [[Removes a content matched to the given index in the stack.
+ ]]
+ params {
+ @in index: int;
+ [[The index of the removed object in the stack.
+ $index begins from bottom to top of the stack.
+ $index of the bottom content is 0.
+ ]]
+ }
+ }
+ index_get {
+ [[Gets the index of the given content in the stack.
+ The index begins from bottom to top of the stack.
+ The index of the bottom content is 0.
+ ]]
+ return: int;
+ [[The index of $content in the stack.]]
+ params {
+ @in content: Efl.Canvas.Object;
+ [[The content matched to the index to be returned in the stack.]]
+ }
+ }
+ content_get {
+ [[Gets the content matched to the given index in the stack.
+ ]]
+ return: Efl.Canvas.Object;
+ [[The content matched to $index in the stack.]]
+ params {
+ @in index: int;
+ [[The index of the content to be returned in the stack.]]
+ }
+ }
+ top {
+ [[Gets the top content in the stack.
+ ]]
+ return: Efl.Canvas.Object; [[The top content in the stack.]]
+ }
+ }
+ implements {
+ Efl.Object.constructor;
+ }
+ events {
+ loaded: Efl.Ui.Stack_Event_Loaded; [[Called when content is loaded right before transition.]]
+ unloaded: Efl.Ui.Stack_Event_Unloaded; [[Called when content is unloaded right after being deactivated.]]
+ activated: Efl.Ui.Stack_Event_Activated; [[Called when content is activated right after transition.]]
+ deactivated: Efl.Ui.Stack_Event_Deactivated; [[Called when content is deactivated right after transition.]]
+ }
+}
diff --git a/src/lib/elementary/efl_ui_stack_private.h b/src/lib/elementary/efl_ui_stack_private.h
new file mode 100644
index 0000000000..dc67451d58
--- /dev/null
+++ b/src/lib/elementary/efl_ui_stack_private.h
@@ -0,0 +1,30 @@
+#ifndef EFL_UI_WIDGET_STACK_H
+#define EFL_UI_WIDGET_STACK_H
+
+typedef struct _Efl_Ui_Stack_Data Efl_Ui_Stack_Data;
+struct _Efl_Ui_Stack_Data
+{
+ Eina_Inlist *stack; /* the last item is the top item */
+};
+
+typedef struct _Content_Data Content_Data;
+struct _Content_Data
+{
+ EINA_INLIST;
+
+ Eo *stack;
+ Eo *content;
+ Eina_Bool on_pushing : 1;
+ Eina_Bool on_popping : 1;
+ Eina_Bool popped_hidden : 1;
+};
+
+typedef struct _Transit_Data Transit_Data;
+struct _Transit_Data
+{
+ Content_Data *cd;
+ Eina_Bool orig_anim;
+ Eina_Bool freeze_events;
+};
+
+#endif
diff --git a/src/lib/elementary/efl_ui_tab_bar.c b/src/lib/elementary/efl_ui_tab_bar.c
new file mode 100644
index 0000000000..ffbc1fdbce
--- /dev/null
+++ b/src/lib/elementary/efl_ui_tab_bar.c
@@ -0,0 +1,392 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#define EFL_UI_TAB_BAR_BETA
+
+#include <Elementary.h>
+#include "elm_priv.h"
+#include "efl_ui_tab_bar_private.h"
+#include "els_box.h"
+
+#define MY_CLASS EFL_UI_TAB_BAR_CLASS
+
+static const char PART_NAME_TAB[] = "tab";
+
+static void _tab_select(Efl_Ui_Tab_Bar_Data *sd, Tab_Info *ti);
+
+EOLIAN static void
+_efl_ui_tab_bar_current_tab_set(Eo *obj EINA_UNUSED, Efl_Ui_Tab_Bar_Data *sd, int index)
+{
+ Tab_Info *ti;
+ ti = eina_list_nth(sd->tab_infos, index);
+
+ _tab_select(sd, ti);
+}
+
+EOLIAN static int
+_efl_ui_tab_bar_current_tab_get(const Eo *obj EINA_UNUSED, Efl_Ui_Tab_Bar_Data *sd)
+{
+ return sd->cur;
+}
+
+EOLIAN static unsigned int
+_efl_ui_tab_bar_tab_count(const Eo *obj EINA_UNUSED, Efl_Ui_Tab_Bar_Data *sd)
+{
+ return sd->cnt;
+}
+
+static void
+_tab_icon_update(Tab_Info *ti)
+{
+ Eo *old_icon =
+ efl_content_get(efl_part(ti->tab, "efl.icon"));
+
+ _elm_widget_sub_object_redirect_to_top(ti->tab, old_icon);
+ efl_content_unset(efl_part(ti->tab, "efl.icon"));
+ efl_content_set(efl_part(ti->tab, "efl.icon"), ti->icon);
+
+ if (ti->icon)
+ efl_layout_signal_emit(ti->tab, "efl,state,icon,visible", "efl");
+ else
+ efl_layout_signal_emit(ti->tab, "efl,state,icon,hidden", "efl");
+
+ efl_del(old_icon);
+}
+
+static void
+_tab_icon_set_cb(void *data,
+ Eo *obj,
+ const char *emission,
+ const char *source)
+{
+ Tab_Info *ti = data;
+ _tab_icon_update(ti);
+
+ efl_layout_signal_callback_del(obj, emission, source, _tab_icon_set_cb, NULL);
+ efl_layout_signal_emit(ti->tab, "efl,state,icon,reset", "efl");
+}
+
+static void
+_tab_icon_obj_set(Eo *obj,
+ Tab_Info *ti,
+ Eo *icon_obj,
+ const char *icon_str,
+ const char *sig)
+{
+ Eo *old_icon;
+ const char *s;
+
+ if (icon_str)
+ eina_stringshare_replace(&ti->icon_str, icon_str);
+ else
+ {
+ eina_stringshare_del(ti->icon_str);
+ ti->icon_str = NULL;
+ }
+
+ ti->icon = icon_obj;
+ if (icon_obj)
+ {
+ efl_gfx_entity_visible_set(ti->icon, EINA_TRUE);
+ elm_widget_sub_object_add(obj, ti->icon);
+ }
+
+ s = elm_layout_data_get(ti->tab, "transition_animation_on");
+ if ((s) && (atoi(s)))
+ {
+ old_icon = efl_content_get
+ (efl_part(ti->tab, "efl.icon_new"));
+ if (old_icon)
+ {
+ _elm_widget_sub_object_redirect_to_top(ti->tab, old_icon);
+ efl_gfx_entity_visible_set(old_icon, EINA_FALSE);
+ }
+ efl_content_set
+ (efl_part(ti->tab, "efl.icon_new"), ti->icon);
+ efl_layout_signal_emit(ti->tab, sig, "efl");
+ efl_layout_signal_callback_add
+ (ti->tab, "efl,state,icon_set,done", "efl", _tab_icon_set_cb, ti);
+ }
+ else
+ _tab_icon_update(ti);
+}
+
+static Eina_Bool
+_tab_icon_set(Eo *icon_obj,
+ const char *type,
+ const char *icon)
+{
+ char icon_str[512];
+
+ if ((!type) || (!*type)) goto end;
+ if ((!icon) || (!*icon)) return EINA_FALSE;
+ if ((snprintf(icon_str, sizeof(icon_str), "%s%s", type, icon) > 0)
+ && (elm_icon_standard_set(icon_obj, icon_str)))
+ return EINA_TRUE;
+end:
+ if (elm_icon_standard_set(icon_obj, icon))
+ return EINA_TRUE;
+
+ WRN("couldn't find icon definition for '%s'", icon);
+ return EINA_FALSE;
+}
+
+static void
+_tab_unselect(Efl_Ui_Tab_Bar_Data *sd, Tab_Info *ti)
+{
+ if ((!ti->tab) || (!ti->selected)) return;
+
+ ti->selected = EINA_FALSE;
+
+ efl_layout_signal_emit(ti->tab, "efl,state,unselected", "efl");
+ if (ti->icon)
+ elm_widget_signal_emit(ti->icon, "efl,state,unselected", "efl");
+
+ sd->cur = -1;
+}
+
+static void
+_tab_select(Efl_Ui_Tab_Bar_Data *sd, Tab_Info *ti)
+{
+ if (!ti->selected)
+ {
+ Eo *tp;
+ tp = efl_parent_get(ti->tab);
+ int index;
+
+ _tab_unselect(sd, sd->selected_tab);
+ ti->selected = EINA_TRUE;
+ sd->selected_tab = ti;
+
+ efl_layout_signal_emit(ti->tab, "efl,state,selected", "efl");
+ if (ti->icon)
+ elm_widget_signal_emit(ti->icon, "efl,state,selected", "efl");
+
+ index = eina_list_data_idx(sd->tab_infos, ti);
+
+ efl_event_callback_call(tp, EFL_UI_EVENT_SELECTED, (void *)(intptr_t)index);
+
+ sd->cur = index;
+ }
+}
+
+static void
+_action_click_cb(void *data,
+ Eo *obj EINA_UNUSED,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
+{
+ Eo *tb;
+ Tab_Info *ti;
+ ti = data;
+ tb = efl_parent_get(ti->tab);
+ EFL_UI_TAB_BAR_DATA_GET(tb, sd);
+
+ _tab_select(sd, ti);
+}
+
+static Tab_Info *
+_tab_add(Eo *obj, const char *label, const char *icon)
+{
+ Eo *tab, *icon_obj;
+ Tab_Info *ti;
+ Efl_Ui_Theme_Apply theme_apply;
+
+ ti = calloc(1, sizeof(*ti));
+
+ ti->tab = NULL;
+ ti->label = eina_stringshare_add(label);
+
+ tab = efl_add(EFL_UI_LAYOUT_OBJECT_CLASS, obj);
+
+ icon_obj = elm_icon_add(tab);
+
+ if (_tab_icon_set(icon_obj, "toolbar/", icon))
+ {
+ ti->icon = icon_obj;
+ ti->icon_str = eina_stringshare_add(icon);
+ }
+ else
+ {
+ ti->icon = NULL;
+ ti->icon_str = NULL;
+ efl_del(icon_obj);
+ }
+
+ theme_apply = elm_widget_element_update(obj, tab, PART_NAME_TAB);
+
+ if (theme_apply == EFL_UI_THEME_APPLY_FAILED)
+ CRI("Failed to set layout!");
+
+ efl_layout_signal_callback_add
+ (tab, "efl,action,click", "efl", _action_click_cb, ti);
+
+ if (ti->icon)
+ {
+ efl_content_set(efl_part(tab, "efl.icon"), ti->icon);
+ efl_layout_signal_emit(tab, "efl,state,icon,visible", "efl");
+ efl_layout_signal_emit(tab, "efl,icon,visible", "efl");
+ efl_gfx_entity_visible_set(ti->icon, EINA_TRUE);
+ }
+ else
+ {
+ efl_layout_signal_emit(tab, "efl,state,icon,hidden", "efl");
+ efl_layout_signal_emit(tab, "efl,icon,hidden", "efl");
+ }
+
+ if (ti->label)
+ {
+ efl_text_set(efl_part(tab, "efl.text"), ti->label);
+ efl_layout_signal_emit(tab, "efl,state,text,visible", "efl");
+ efl_layout_signal_emit(tab, "efl,text,visible", "efl");
+ }
+ else
+ {
+ efl_layout_signal_emit(tab, "efl,state,text,hidden", "efl");
+ efl_layout_signal_emit(tab, "efl,text,hidden", "efl");
+ }
+
+ efl_ui_widget_focus_allow_set(tab, EINA_TRUE);
+
+ ti->tab = tab;
+
+ return ti;
+}
+
+EOLIAN static void
+_efl_ui_tab_bar_tab_add(Eo *obj, Efl_Ui_Tab_Bar_Data *sd,
+ int index, const char *label, const char *icon)
+{
+ Tab_Info *ti;
+ ti = _tab_add(obj, label, icon);
+
+ efl_parent_set(ti->tab, obj);
+ efl_ui_widget_sub_object_add(obj, ti->tab);
+
+ if (sd->cnt > index)
+ {
+ Tab_Info *existing_ti;
+ existing_ti = eina_list_nth(sd->tab_infos, index);
+
+ sd->tab_infos = eina_list_prepend_relative(sd->tab_infos, ti, existing_ti);
+ evas_object_box_insert_before(sd->bx, ti->tab, existing_ti->tab);
+
+ if (sd->cur >= index) sd->cur ++;
+ }
+ else
+ {
+ sd->tab_infos = eina_list_append(sd->tab_infos, ti);
+ evas_object_box_append(sd->bx, ti->tab);
+ }
+
+ sd->cnt ++;
+}
+
+EOLIAN static void
+_efl_ui_tab_bar_tab_remove(Eo *obj EINA_UNUSED, Efl_Ui_Tab_Bar_Data *sd, int index)
+{
+ if ((sd->cnt > 0) && (sd->cnt > index) && (index >= 0))
+ {
+ Tab_Info *ti;
+ ti = eina_list_nth(sd->tab_infos, index);
+
+ _tab_unselect(sd, ti);
+ evas_object_box_remove(sd->bx, ti->tab);
+ efl_del(ti->tab);
+ efl_del(ti->icon);
+
+ sd->tab_infos = eina_list_remove(sd->tab_infos, ti);
+ sd->cnt --;
+ }
+}
+
+EOLIAN static void
+_efl_ui_tab_bar_tab_label_set(Eo *obj EINA_UNUSED, Efl_Ui_Tab_Bar_Data *sd, int index, const char *label)
+{
+ Tab_Info *ti;
+ ti = eina_list_nth(sd->tab_infos, index);
+ eina_stringshare_replace(&ti->label, label);
+
+ efl_text_set(efl_part(ti->tab, "efl.text"), ti->label);
+}
+
+EOLIAN static void
+_efl_ui_tab_bar_tab_icon_set(Eo *obj, Efl_Ui_Tab_Bar_Data *sd, int index, const char *icon)
+{
+ Eo *icon_obj;
+ Tab_Info *ti;
+ ti = eina_list_nth(sd->tab_infos, index);
+
+ if ((icon) && (ti->icon_str) && (!strcmp(icon, ti->icon_str))) return;
+
+ icon_obj = elm_icon_add(obj);
+ if (!icon_obj) return;
+ if (_tab_icon_set(icon_obj, "toolbar/", icon))
+ _tab_icon_obj_set(obj, ti, icon_obj, icon, "efl,state,icon_set");
+ else
+ {
+ _tab_icon_obj_set(obj, ti, NULL, NULL, "efl,state,icon_set");
+ efl_del(icon_obj);
+ }
+}
+
+static void
+_layout(Evas_Object *o,
+ Evas_Object_Box_Data *priv,
+ void *data)
+{
+ Evas_Object *obj = (Evas_Object *)data;
+ Eina_Bool horizontal;
+
+ EFL_UI_TAB_BAR_DATA_GET(obj, sd);
+
+ horizontal = efl_ui_dir_is_horizontal(sd->dir, EINA_TRUE);
+
+ _els_box_layout
+ (o, priv, horizontal, EINA_TRUE, efl_ui_mirrored_get(obj));
+}
+
+EOLIAN static void
+_efl_ui_tab_bar_efl_object_destructor(Eo *obj, Efl_Ui_Tab_Bar_Data *sd EINA_UNUSED)
+{
+ efl_destructor(efl_super(obj, MY_CLASS));
+}
+
+EOLIAN static Efl_Object *
+_efl_ui_tab_bar_efl_object_constructor(Eo *obj, Efl_Ui_Tab_Bar_Data *sd)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
+
+ if (!elm_widget_theme_klass_get(obj))
+ elm_widget_theme_klass_set(obj, "tab_bar");
+
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+
+ if (!elm_widget_theme_object_set(obj, wd->resize_obj,
+ elm_widget_theme_klass_get(obj),
+ elm_widget_theme_element_get(obj),
+ elm_widget_theme_style_get(obj)))
+ CRI("Failed to set layout!");
+
+ elm_widget_sub_object_parent_add(obj);
+
+ sd->dir = EFL_UI_DIR_HORIZONTAL;
+ sd->bx = evas_object_box_add(evas_object_evas_get(obj));
+ evas_object_box_align_set(sd->bx, 0.5, 0.5);
+ evas_object_box_layout_set(sd->bx, _layout, obj, NULL);
+
+ efl_ui_widget_focus_allow_set(obj, EINA_TRUE);
+
+ efl_content_set(efl_part(obj, "efl.content"), sd->bx);
+
+ sd->cnt = 0;
+ sd->cur = -1;
+
+ Tab_Info *ti = calloc(1, sizeof(*ti));
+ sd->selected_tab = ti;
+
+ return obj;
+}
+
+#include "efl_ui_tab_bar.eo.c"
diff --git a/src/lib/elementary/efl_ui_tab_bar.eo b/src/lib/elementary/efl_ui_tab_bar.eo
new file mode 100644
index 0000000000..ea07a4d051
--- /dev/null
+++ b/src/lib/elementary/efl_ui_tab_bar.eo
@@ -0,0 +1,42 @@
+class Efl.Ui.Tab_Bar (Efl.Ui.Layout.Object, Efl.Ui.Clickable)
+{
+ [[Tab Bar class]]
+ methods {
+ @property current_tab {
+ values {
+ index: int;
+ }
+ }
+ tab_count @const {
+ return: uint;
+ }
+ tab_add @beta {
+ params {
+ @in index: int;
+ @in label: string;
+ @in icon: string;
+ }
+ }
+ tab_remove @beta {
+ params {
+ @in index: int;
+ }
+ }
+ tab_label_set @beta {
+ params {
+ @in index: int;
+ @in label: string;
+ }
+ }
+ tab_icon_set @beta {
+ params {
+ @in index: int;
+ @in icon: string;
+ }
+ }
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Object.destructor;
+ }
+} \ No newline at end of file
diff --git a/src/lib/elementary/efl_ui_tab_bar_private.h b/src/lib/elementary/efl_ui_tab_bar_private.h
new file mode 100644
index 0000000000..7e11cf017d
--- /dev/null
+++ b/src/lib/elementary/efl_ui_tab_bar_private.h
@@ -0,0 +1,43 @@
+#ifndef EFL_UI_TAB_BAR_PRIVATE_H
+#define EFL_UI_TAB_BAR_PRIVATE_H
+
+typedef struct _Efl_Ui_Tab_Bar_Data Efl_Ui_Tab_Bar_Data;
+typedef struct _Tab_Info Tab_Info;
+
+struct _Efl_Ui_Tab_Bar_Data
+{
+ Efl_Canvas_Object *bx;
+ int cnt;
+ int cur;
+ Efl_Ui_Dir dir;
+
+ Eina_List *tab_infos;
+ Tab_Info *selected_tab;
+};
+
+struct _Tab_Info
+{
+ Eo *tab;
+
+ const char *label;
+ const char *icon_str;
+ Eo *icon;
+
+ Eina_Bool selected : 1;
+};
+
+
+#define EFL_UI_TAB_BAR_DATA_GET(o, sd) \
+ Efl_Ui_Tab_Bar_Data *sd = efl_data_scope_get(o, EFL_UI_TAB_BAR_CLASS)
+
+#define EFL_UI_TAB_BAR_DATA_GET_OR_RETURN(o, sd, ...) \
+ Efl_Ui_Tab_Bar_Data *sd = efl_data_scope_safe_get(o, EFL_UI_TAB_BAR_CLASS); \
+ if (EINA_UNLIKELY(!sd)) \
+ { \
+ ERR("No widget data for object %p (%s)", \
+ o, evas_object_type_get(o)); \
+ return __VA_ARGS__; \
+ }
+
+
+#endif
diff --git a/src/lib/elementary/efl_ui_tab_page.c b/src/lib/elementary/efl_ui_tab_page.c
new file mode 100644
index 0000000000..361ccd6371
--- /dev/null
+++ b/src/lib/elementary/efl_ui_tab_page.c
@@ -0,0 +1,131 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#define EFL_PART_PROTECTED
+
+#include <Elementary.h>
+#include "elm_priv.h"
+#include "efl_ui_tab_page_private.h"
+#include "elm_part_helper.h"
+
+#define MY_CLASS EFL_UI_TAB_PAGE_CLASS
+
+EOLIAN static Eina_Bool
+_efl_ui_tab_page_efl_content_content_set(Eo *obj, Efl_Ui_Tab_Page_Data *sd, Eo *content)
+{
+ if (sd->content)
+ {
+ efl_content_unset(efl_part(obj, "efl.content"));
+ efl_del(sd->content);
+ }
+
+ sd->content = content;
+ efl_content_set(efl_part(obj, "efl.content"), sd->content);
+
+ return EINA_TRUE;
+}
+
+EOLIAN static Eo *
+_efl_ui_tab_page_efl_content_content_get(const Eo *obj EINA_UNUSED, Efl_Ui_Tab_Page_Data *sd)
+{
+ return sd->content;
+}
+
+EOLIAN static Efl_Object *
+_efl_ui_tab_page_efl_object_constructor(Eo *obj, Efl_Ui_Tab_Page_Data *sd)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
+
+ if (!elm_widget_theme_klass_get(obj))
+ elm_widget_theme_klass_set(obj, "tab_page");
+
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+
+ if (!elm_widget_theme_object_set(obj, wd->resize_obj,
+ elm_widget_theme_klass_get(obj),
+ elm_widget_theme_element_get(obj),
+ elm_widget_theme_style_get(obj)))
+ CRI("Failed to set layout!");
+
+ elm_widget_sub_object_parent_add(obj);
+
+ efl_ui_widget_focus_allow_set(obj, EINA_TRUE);
+
+ sd->content = NULL;
+ sd->tab_label = NULL;
+ sd->tab_icon = NULL;
+
+ return obj;
+}
+
+EOLIAN static void
+_efl_ui_tab_page_efl_object_destructor(Eo *obj, Efl_Ui_Tab_Page_Data *sd EINA_UNUSED)
+{
+ efl_destructor(efl_super(obj, MY_CLASS));
+}
+
+/* Efl.Part begin */
+
+EOLIAN static Eo *
+_efl_ui_tab_page_efl_part_part_get(const Eo *obj, Efl_Ui_Tab_Page_Data *sd EINA_UNUSED, const char *part)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
+
+ if (eina_streq(part, "tab"))
+ return ELM_PART_IMPLEMENT(EFL_UI_TAB_PAGE_PART_TAB_CLASS, obj, part);
+
+ return efl_part_get(efl_super(obj, MY_CLASS), part);
+}
+
+EOLIAN static void
+_efl_ui_tab_page_part_tab_icon_set(Eo *obj, void *_pd EINA_UNUSED, const char *path)
+{
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ Efl_Ui_Tab_Page_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_TAB_PAGE_CLASS);
+
+ eina_stringshare_replace(&sd->tab_icon, path);
+
+ Efl_Ui_Tab_Page_Tab_Changed_Event event;
+ event.changed_info = EFL_UI_TAB_PAGE_TAB_CHANGED_ICON;
+
+ efl_event_callback_call(pd->obj, EFL_UI_TAB_PAGE_EVENT_TAB_CHANGED, &event);
+}
+
+EOLIAN static const char *
+_efl_ui_tab_page_part_tab_icon_get(const Eo *obj, void *_pd EINA_UNUSED)
+{
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ Efl_Ui_Tab_Page_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_TAB_PAGE_CLASS);
+
+ return sd->tab_icon;
+}
+
+EOLIAN static void
+_efl_ui_tab_page_part_tab_efl_text_text_set(Eo *obj, void *_pd EINA_UNUSED, const char *text)
+{
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ Efl_Ui_Tab_Page_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_TAB_PAGE_CLASS);
+
+ eina_stringshare_replace(&sd->tab_label, text);
+
+ Efl_Ui_Tab_Page_Tab_Changed_Event event;
+ event.changed_info = EFL_UI_TAB_PAGE_TAB_CHANGED_LABEL;
+
+ efl_event_callback_call(pd->obj, EFL_UI_TAB_PAGE_EVENT_TAB_CHANGED, &event);
+}
+
+EOLIAN static const char *
+_efl_ui_tab_page_part_tab_efl_text_text_get(const Eo *obj, void *_pd EINA_UNUSED)
+{
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ Efl_Ui_Tab_Page_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_TAB_PAGE_CLASS);
+
+ return sd->tab_label;
+}
+
+#include "efl_ui_tab_page_part_tab.eo.c"
+
+/* Efl.Part end */
+
+#include "efl_ui_tab_page.eo.c"
diff --git a/src/lib/elementary/efl_ui_tab_page.eo b/src/lib/elementary/efl_ui_tab_page.eo
new file mode 100644
index 0000000000..5238e8e6f3
--- /dev/null
+++ b/src/lib/elementary/efl_ui_tab_page.eo
@@ -0,0 +1,28 @@
+enum Efl.Ui.Tab_Page_Tab_Changed {
+ label = 0, [[Label changed]]
+ icon [[Icon changed]]
+}
+
+struct Efl.Ui.Tab_Page_Tab_Changed_Event {
+ [[Information of changed event]]
+ changed_info: Efl.Ui.Tab_Page_Tab_Changed;
+}
+
+class Efl.Ui.Tab_Page (Efl.Ui.Layout.Object, Efl.Content)
+{
+ [[Tab Page class]]
+ methods {
+ }
+ parts {
+ tab: Efl.Ui.Tab_Page_Part_Tab;
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Object.destructor;
+ Efl.Content.content { get; set; }
+ Efl.Part.part_get;
+ }
+ events {
+ tab,changed: Efl.Ui.Tab_Page_Tab_Changed_Event; [[Called when tab changed]]
+ }
+} \ No newline at end of file
diff --git a/src/lib/elementary/efl_ui_tab_page_part_tab.eo b/src/lib/elementary/efl_ui_tab_page_part_tab.eo
new file mode 100644
index 0000000000..8c2ce57be1
--- /dev/null
+++ b/src/lib/elementary/efl_ui_tab_page_part_tab.eo
@@ -0,0 +1,15 @@
+class Efl.Ui.Tab_Page_Part_Tab (Efl.Ui.Layout.Part, Efl.Text)
+{
+ [[Tab_Page internal part class]]
+ data: null;
+ methods {
+ @property icon {
+ values {
+ path: string;
+ }
+ }
+ }
+ implements {
+ Efl.Text.text { get; set; }
+ }
+} \ No newline at end of file
diff --git a/src/lib/elementary/efl_ui_tab_page_private.h b/src/lib/elementary/efl_ui_tab_page_private.h
new file mode 100644
index 0000000000..44153647c4
--- /dev/null
+++ b/src/lib/elementary/efl_ui_tab_page_private.h
@@ -0,0 +1,28 @@
+#ifndef EFL_UI_TAB_PAGE_PRIVATE_H
+#define EFL_UI_TAB_PAGE_PRIVATE_H
+
+typedef struct _Efl_Ui_Tab_Page_Data Efl_Ui_Tab_Page_Data;
+
+struct _Efl_Ui_Tab_Page_Data
+{
+ Eo *content;
+ const char *tab_label;
+ const char *tab_icon;
+};
+
+
+#define EFL_UI_TAB_PAGE_DATA_GET(o, sd) \
+ Efl_Ui_Tab_Page_Data *sd = efl_data_scope_get(o, EFL_UI_TAB_PAGE_CLASS)
+
+#define EFL_UI_TAB_PAGE_DATA_GET_OR_RETURN(o, sd, ...) \
+ Efl_Ui_Tab_Page_Data *sd = efl_data_scope_safe_get(o, EFL_UI_TAB_PAGE_CLASS); \
+ if (EINA_UNLIKELY(!sd)) \
+ { \
+ ERR("No widget data for object %p (%s)", \
+ o, evas_object_type_get(o)); \
+ return __VA_ARGS__; \
+ }
+
+#include "efl_ui_tab_page_part_tab.eo.h"
+
+#endif \ No newline at end of file
diff --git a/src/lib/elementary/efl_ui_tab_pager.c b/src/lib/elementary/efl_ui_tab_pager.c
new file mode 100644
index 0000000000..5fbae19c3c
--- /dev/null
+++ b/src/lib/elementary/efl_ui_tab_pager.c
@@ -0,0 +1,354 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#define EFL_UI_TAB_BAR_BETA
+
+#include <Elementary.h>
+#include "elm_priv.h"
+
+#include "efl_ui_tab_pager_private.h"
+#include "efl_ui_tab_page_private.h"
+#include "efl_ui_widget_pager.h"
+
+#define MY_CLASS EFL_UI_TAB_PAGER_CLASS
+
+static void
+_select(Eo *obj, int index)
+{
+ EFL_UI_TAB_PAGER_DATA_GET(obj, sd);
+ if (sd->cnt > index) sd->cur = index;
+ else sd->cur = 0;
+
+ efl_ui_tab_bar_current_tab_set(sd->tab_bar, sd->cur);
+ efl_ui_pager_current_page_set(efl_super(obj, MY_CLASS), sd->cur);
+}
+
+static void
+_tab_select_cb(void *data, const Efl_Event *event)
+{
+ int index = (intptr_t)event->info;
+ _select(data, index);
+}
+
+static void
+_tab_changed_cb(void *data, const Efl_Event *event)
+{
+ Efl_Ui_Tab_Page_Tab_Changed_Event *ev = event->info;
+ int index;
+
+ EFL_UI_TAB_PAGER_DATA_GET(data, sd);
+ EFL_UI_TAB_PAGE_DATA_GET(event->object, pd);
+ index = eina_list_data_idx(sd->tab_pages, event->object);
+
+ switch (ev->changed_info)
+ {
+ case EFL_UI_TAB_PAGE_TAB_CHANGED_LABEL:
+ efl_ui_tab_bar_tab_label_set(sd->tab_bar, index, pd->tab_label);
+ break;
+
+ case EFL_UI_TAB_PAGE_TAB_CHANGED_ICON:
+ efl_ui_tab_bar_tab_icon_set(sd->tab_bar, index, pd->tab_icon);
+ break;
+
+ default:
+ break;
+ }
+}
+
+EOLIAN static void
+_efl_ui_tab_pager_tab_bar_set(Eo *obj, Efl_Ui_Tab_Pager_Data *sd, Efl_Canvas_Object *tab_bar)
+{
+ if (sd->tab_bar != NULL)
+ {
+ efl_event_callback_del(sd->tab_bar, EFL_UI_EVENT_SELECTED, _tab_select_cb, obj);
+ efl_content_unset(efl_part(obj, "efl.tab_root"));
+ efl_del(sd->tab_bar);
+ }
+
+ sd->tab_bar = tab_bar;
+ efl_content_set(efl_part(obj, "efl.tab_root"), sd->tab_bar);
+
+ efl_event_callback_add(sd->tab_bar, EFL_UI_EVENT_SELECTED, _tab_select_cb, obj);
+}
+
+EOLIAN static Efl_Canvas_Object *
+_efl_ui_tab_pager_tab_bar_get(const Eo *obj EINA_UNUSED, Efl_Ui_Tab_Pager_Data *sd)
+{
+ return sd->tab_bar;
+}
+
+EOLIAN static void
+_efl_ui_tab_pager_efl_ui_pager_current_page_set(Eo *obj, Efl_Ui_Tab_Pager_Data *sd EINA_UNUSED, int index)
+{
+ _select(obj, index);
+}
+
+EOLIAN static void
+_efl_ui_tab_pager_efl_object_destructor(Eo *obj, Efl_Ui_Tab_Pager_Data *sd)
+{
+ if (sd->tab_bar != NULL)
+ efl_event_callback_del(sd->tab_bar, EFL_UI_EVENT_SELECTED, _tab_select_cb, obj);
+
+ efl_destructor(efl_super(obj, MY_CLASS));
+}
+
+EOLIAN static Efl_Object *
+_efl_ui_tab_pager_efl_object_constructor(Eo *obj, Efl_Ui_Tab_Pager_Data *sd)
+{
+ if (!elm_widget_theme_klass_get(obj))
+ elm_widget_theme_klass_set(obj, "tab_pager");
+
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+ elm_widget_sub_object_parent_add(obj);
+
+ efl_ui_widget_focus_allow_set(obj, EINA_TRUE);
+
+ sd->tab_bar = NULL;
+ sd->cur = 0;
+ sd->cnt = 0;
+
+ return obj;
+}
+
+EOLIAN static int
+_efl_ui_tab_pager_efl_container_content_count(Eo *obj EINA_UNUSED, Efl_Ui_Tab_Pager_Data *sd)
+{
+ return sd->cnt;
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_tab_pager_efl_pack_pack_clear(Eo *obj, Efl_Ui_Tab_Pager_Data *sd)
+{
+ if (sd->tab_bar)
+ {
+ Eo *subobj;
+ Eina_List *l, *l_next;
+ int begin_index = 0;
+ EINA_LIST_FOREACH_SAFE(sd->tab_pages, l, l_next, subobj)
+ {
+ efl_event_callback_del(subobj, EFL_UI_TAB_PAGE_EVENT_TAB_CHANGED, _tab_changed_cb, obj);
+
+ sd->tab_pages = eina_list_remove(sd->tab_pages, subobj);
+ sd->cnt--;
+
+ efl_ui_tab_bar_tab_remove(sd->tab_bar, begin_index);
+ }
+ efl_pack_clear(efl_super(obj, MY_CLASS));
+
+ return EINA_TRUE;
+ }
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_tab_pager_efl_pack_unpack_all(Eo *obj, Efl_Ui_Tab_Pager_Data *sd)
+{
+ if (sd->tab_bar)
+ {
+ Eo *subobj;
+ Eina_List *l, *l_next;
+ int begin_index = 0;
+ EINA_LIST_FOREACH_SAFE(sd->tab_pages, l, l_next, subobj)
+ {
+ efl_event_callback_del(subobj, EFL_UI_TAB_PAGE_EVENT_TAB_CHANGED, _tab_changed_cb, obj);
+
+ sd->tab_pages = eina_list_remove(sd->tab_pages, subobj);
+ sd->cnt--;
+
+ efl_ui_tab_bar_tab_remove(sd->tab_bar, begin_index);
+ }
+ efl_pack_unpack_all(efl_super(obj, MY_CLASS));
+
+ return EINA_TRUE;
+ }
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_tab_pager_efl_pack_unpack(Eo *obj, Efl_Ui_Tab_Pager_Data *sd, Efl_Gfx_Entity *subobj)
+{
+ if (sd->tab_bar)
+ {
+ efl_event_callback_del(subobj, EFL_UI_TAB_PAGE_EVENT_TAB_CHANGED, _tab_changed_cb, obj);
+
+ int index = eina_list_data_idx(sd->tab_pages, (void *)subobj);
+
+ sd->tab_pages = eina_list_remove(sd->tab_pages, subobj);
+ sd->cnt--;
+
+ efl_ui_tab_bar_tab_remove(sd->tab_bar, index);
+ efl_pack_unpack(efl_super(obj, MY_CLASS), subobj);
+
+
+ return EINA_TRUE;
+ }
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_tab_pager_efl_pack_linear_pack_begin(Eo *obj,
+ Efl_Ui_Tab_Pager_Data *sd,
+ Efl_Gfx_Entity *subobj)
+{
+ if (sd->tab_bar)
+ {
+ EFL_UI_TAB_PAGE_DATA_GET(subobj, pd);
+ int begin_index = 0;
+
+ sd->tab_pages = eina_list_prepend(sd->tab_pages, subobj);
+ sd->cnt ++;
+
+ efl_ui_tab_bar_tab_add(sd->tab_bar, begin_index, pd->tab_label, pd->tab_icon);
+ efl_pack_begin(efl_super(obj, MY_CLASS), subobj);
+
+ sd->cur ++;
+
+ efl_event_callback_add(subobj, EFL_UI_TAB_PAGE_EVENT_TAB_CHANGED, _tab_changed_cb, obj);
+
+ return EINA_TRUE;
+ }
+ else return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_tab_pager_efl_pack_linear_pack_end(Eo *obj,
+ Efl_Ui_Tab_Pager_Data *sd,
+ Efl_Gfx_Entity *subobj)
+{
+ if (sd->tab_bar)
+ {
+ EFL_UI_TAB_PAGE_DATA_GET(subobj, pd);
+ int end_index = efl_ui_tab_bar_tab_count(sd->tab_bar);
+
+ sd->tab_pages = eina_list_append(sd->tab_pages, subobj);
+ sd->cnt ++;
+
+ efl_ui_tab_bar_tab_add(sd->tab_bar, end_index, pd->tab_label, pd->tab_icon);
+ efl_pack_end(efl_super(obj, MY_CLASS), subobj);
+
+ efl_event_callback_add(subobj, EFL_UI_TAB_PAGE_EVENT_TAB_CHANGED, _tab_changed_cb, obj);
+
+ return EINA_TRUE;
+ }
+ else return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_tab_pager_efl_pack_linear_pack_before(Eo *obj,
+ Efl_Ui_Tab_Pager_Data *sd,
+ Efl_Gfx_Entity *subobj,
+ const Efl_Gfx_Entity *existing)
+{
+ if (sd->tab_bar)
+ {
+ EFL_UI_TAB_PAGE_DATA_GET(subobj, pd);
+ int before_index = eina_list_data_idx(sd->tab_pages, (void *)existing);
+
+ sd->tab_pages = eina_list_prepend_relative(sd->tab_pages, subobj, existing);
+ sd->cnt ++;
+
+ efl_ui_tab_bar_tab_add(sd->tab_bar, before_index, pd->tab_label, pd->tab_icon);
+ efl_pack_before(efl_super(obj, MY_CLASS), subobj, existing);
+
+ if (sd->cur >= before_index) sd->cur ++;
+
+ efl_event_callback_add(subobj, EFL_UI_TAB_PAGE_EVENT_TAB_CHANGED, _tab_changed_cb, obj);
+
+ return EINA_TRUE;
+ }
+ else return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_tab_pager_efl_pack_linear_pack_after(Eo *obj,
+ Efl_Ui_Tab_Pager_Data *sd,
+ Efl_Gfx_Entity *subobj,
+ const Efl_Gfx_Entity *existing)
+{
+ if (sd->tab_bar)
+ {
+ EFL_UI_TAB_PAGE_DATA_GET(subobj, pd);
+ int after_index = eina_list_data_idx(sd->tab_pages, (void *)existing) + 1;
+
+ sd->tab_pages = eina_list_append_relative(sd->tab_pages, subobj, existing);
+ sd->cnt ++;
+
+ efl_ui_tab_bar_tab_add(sd->tab_bar, after_index, pd->tab_label, pd->tab_icon);
+ efl_pack_after(efl_super(obj, MY_CLASS), subobj, existing);
+
+ if (sd->cur > after_index) sd->cur ++;
+
+ efl_event_callback_add(subobj, EFL_UI_TAB_PAGE_EVENT_TAB_CHANGED, _tab_changed_cb, obj);
+
+ return EINA_TRUE;
+ }
+ else return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_tab_pager_efl_pack_linear_pack_at(Eo *obj,
+ Efl_Ui_Tab_Pager_Data *sd,
+ Efl_Gfx_Entity *subobj,
+ int index)
+{
+ if (sd->tab_bar)
+ {
+ Efl_Gfx_Entity *existing = NULL;
+ EFL_UI_TAB_PAGE_DATA_GET(subobj, pd);
+
+ existing = eina_list_nth(sd->tab_pages, index);
+ sd->tab_pages = eina_list_prepend_relative(sd->tab_pages, subobj, existing);
+ sd->cnt ++;
+
+ efl_ui_tab_bar_tab_add(sd->tab_bar, index, pd->tab_label, pd->tab_icon);
+ efl_pack_at(efl_super(obj, MY_CLASS), subobj, index);
+
+ if (sd->cur >= index) sd->cur ++;
+
+ efl_event_callback_add(subobj, EFL_UI_TAB_PAGE_EVENT_TAB_CHANGED, _tab_changed_cb, obj);
+
+ return EINA_TRUE;
+ }
+ else return EINA_FALSE;
+}
+
+EOLIAN static Efl_Gfx_Entity *
+_efl_ui_tab_pager_efl_pack_linear_pack_unpack_at(Eo *obj, Efl_Ui_Tab_Pager_Data *sd, int index)
+{
+ if (sd->tab_bar)
+ {
+ Efl_Gfx_Entity *existing = NULL;
+ existing = eina_list_nth(sd->tab_pages, index);
+ if (!existing) return NULL;
+
+ efl_event_callback_del(existing, EFL_UI_TAB_PAGE_EVENT_TAB_CHANGED, _tab_changed_cb, obj);
+
+ sd->tab_pages = eina_list_remove(sd->tab_pages, existing);
+ sd->cnt--;
+
+ efl_ui_tab_bar_tab_remove(sd->tab_bar, index);
+ efl_pack_unpack_at(efl_super(obj, MY_CLASS), index);
+
+ return existing;
+ }
+ return NULL;
+}
+
+EOLIAN static Efl_Gfx_Entity *
+_efl_ui_tab_pager_efl_pack_linear_pack_content_get(Eo *obj EINA_UNUSED,
+ Efl_Ui_Tab_Pager_Data *sd,
+ int index)
+{
+ return eina_list_nth(sd->tab_pages, index);
+}
+
+EOLIAN static int
+_efl_ui_tab_pager_efl_pack_linear_pack_index_get(Eo *obj EINA_UNUSED,
+ Efl_Ui_Tab_Pager_Data *sd,
+ const Efl_Gfx_Entity *subobj)
+{
+ return eina_list_data_idx(sd->tab_pages, (void *)subobj);
+}
+
+#include "efl_ui_tab_pager.eo.c"
diff --git a/src/lib/elementary/efl_ui_tab_pager.eo b/src/lib/elementary/efl_ui_tab_pager.eo
new file mode 100644
index 0000000000..ca469342d3
--- /dev/null
+++ b/src/lib/elementary/efl_ui_tab_pager.eo
@@ -0,0 +1,28 @@
+class Efl.Ui.Tab_Pager (Efl.Ui.Pager)
+{
+ [[Tab Pager class]]
+ methods {
+ @property tab_bar {
+ values {
+ tab_bar: Efl.Canvas.Object;
+ }
+ }
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Object.destructor;
+ Efl.Container.content_count;
+ Efl.Pack.pack_clear; // TODO
+ Efl.Pack.unpack_all; // TODO
+ Efl.Pack.unpack; // TODO
+ Efl.Pack_Linear.pack_begin;
+ Efl.Pack_Linear.pack_end;
+ Efl.Pack_Linear.pack_before;
+ Efl.Pack_Linear.pack_after;
+ Efl.Pack_Linear.pack_at;
+ Efl.Pack_Linear.pack_content_get;
+ Efl.Pack_Linear.pack_index_get;
+ Efl.Pack_Linear.pack_unpack_at; // TODO
+ Efl.Ui.Pager.current_page { set; }
+ }
+} \ No newline at end of file
diff --git a/src/lib/elementary/efl_ui_tab_pager_private.h b/src/lib/elementary/efl_ui_tab_pager_private.h
new file mode 100644
index 0000000000..1a0bfd4bc1
--- /dev/null
+++ b/src/lib/elementary/efl_ui_tab_pager_private.h
@@ -0,0 +1,28 @@
+#ifndef EFL_UI_TAB_PAGER_PRIVATE_H
+#define EFL_UI_TAB_PAGER_PRIVATE_H
+
+typedef struct _Efl_Ui_Tab_Pager_Data Efl_Ui_Tab_Pager_Data;
+
+struct _Efl_Ui_Tab_Pager_Data
+{
+ Eo *tab_bar;
+
+ int cnt;
+ int cur;
+ Eina_List *tab_pages;
+};
+
+
+#define EFL_UI_TAB_PAGER_DATA_GET(o, sd) \
+ Efl_Ui_Tab_Pager_Data *sd = efl_data_scope_get(o, EFL_UI_TAB_PAGER_CLASS)
+
+#define EFL_UI_TAB_PAGER_DATA_GET_OR_RETURN(o, sd, ...) \
+ Efl_Ui_Tab_Pager_Data *sd = efl_data_scope_safe_get(o, EFL_UI_TAB_PAGER_CLASS); \
+ if (EINA_UNLIKELY(!sd)) \
+ { \
+ ERR("No widget data for object %p (%s)", \
+ o, evas_object_type_get(o)); \
+ return __VA_ARGS__; \
+ }
+
+#endif
diff --git a/src/lib/elementary/efl_ui_table.c b/src/lib/elementary/efl_ui_table.c
index 39aa7b87f5..176c57d212 100644
--- a/src/lib/elementary/efl_ui_table.c
+++ b/src/lib/elementary/efl_ui_table.c
@@ -9,7 +9,7 @@
typedef struct _Custom_Table_Data Custom_Table_Data;
static void _subobj_del_cb(void *data, const Efl_Event *event);
-static void _item_remove(Efl_Ui_Table *obj, Efl_Ui_Table_Data *pd, Efl_Gfx *subobj);
+static void _item_remove(Efl_Ui_Table *obj, Efl_Ui_Table_Data *pd, Efl_Gfx_Entity *subobj);
struct _Custom_Table_Data
{
@@ -29,7 +29,7 @@ _mirrored_set(Evas_Object *obj, Eina_Bool rtl)
}
EOLIAN static Efl_Ui_Theme_Apply
-_efl_ui_table_elm_widget_theme_apply(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED)
+_efl_ui_table_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
@@ -188,7 +188,7 @@ _efl_ui_table_efl_object_constructor(Eo *obj, Efl_Ui_Table_Data *pd)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_FILLER);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_FILLER);
pd->dir1 = EFL_UI_DIR_RIGHT;
pd->dir2 = EFL_UI_DIR_DOWN;
@@ -222,7 +222,7 @@ _efl_ui_table_efl_pack_pack_padding_set(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUS
}
EOLIAN static void
-_efl_ui_table_efl_pack_pack_padding_get(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED, double *h, double *v, Eina_Bool *scalable)
+_efl_ui_table_efl_pack_pack_padding_get(const Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED, double *h, double *v, Eina_Bool *scalable)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
@@ -245,7 +245,7 @@ _subobj_del_cb(void *data, const Efl_Event *event)
}
static Eina_Bool
-_pack_at(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Gfx *subobj,
+_pack_at(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Gfx_Entity *subobj,
int col, int row, int colspan, int rowspan, Eina_Bool linear)
{
Table_Item *gi = NULL;
@@ -311,7 +311,7 @@ _pack_at(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Gfx *subobj,
EOLIAN static Eina_Bool
_efl_ui_table_efl_pack_table_pack_table(Eo *obj, Efl_Ui_Table_Data *pd,
- Efl_Gfx *subobj,
+ Efl_Gfx_Entity *subobj,
int col, int row, int colspan, int rowspan)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(subobj, EINA_FALSE);
@@ -320,7 +320,7 @@ _efl_ui_table_efl_pack_table_pack_table(Eo *obj, Efl_Ui_Table_Data *pd,
}
EOLIAN static Eina_Bool
-_efl_ui_table_efl_pack_table_table_position_get(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED, Evas_Object *subobj, int *col, int *row, int *colspan, int *rowspan)
+_efl_ui_table_efl_pack_table_table_position_get(const Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED, Evas_Object *subobj, int *col, int *row, int *colspan, int *rowspan)
{
int c = -1, r = -1, cs = 0, rs = 0;
Table_Item *gi;
@@ -328,6 +328,7 @@ _efl_ui_table_efl_pack_table_table_position_get(Eo *obj, Efl_Ui_Table_Data *pd E
if (obj != elm_widget_parent_widget_get(subobj))
{
+ if (efl_invalidated_get(subobj)) goto end;
ERR("%p is not a child of %p", subobj, obj);
goto end;
}
@@ -351,7 +352,7 @@ end:
return ret;
}
-EOLIAN static Efl_Gfx *
+EOLIAN static Efl_Gfx_Entity *
_efl_ui_table_efl_pack_table_table_content_get(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED, int col, int row)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
@@ -360,7 +361,7 @@ _efl_ui_table_efl_pack_table_table_content_get(Eo *obj, Efl_Ui_Table_Data *pd EI
}
static void
-_item_remove(Efl_Ui_Table *obj, Efl_Ui_Table_Data *pd, Efl_Gfx *subobj)
+_item_remove(Efl_Ui_Table *obj, Efl_Ui_Table_Data *pd, Efl_Gfx_Entity *subobj)
{
Table_Item *gi = efl_key_data_get(subobj, TABLE_ITEM_KEY);
Table_Item *gi2, *last = NULL;
@@ -417,7 +418,7 @@ end:
}
EOLIAN static Eina_Bool
-_efl_ui_table_efl_pack_unpack(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Gfx *subobj)
+_efl_ui_table_efl_pack_unpack(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Gfx_Entity *subobj)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
@@ -459,7 +460,7 @@ _efl_ui_table_efl_pack_layout_layout_request(Eo *obj, Efl_Ui_Table_Data *pd EINA
static Eina_Bool
_table_item_iterator_next(Table_Item_Iterator *it, void **data)
{
- Efl_Gfx *sub;
+ Efl_Gfx_Entity *sub;
if (!eina_iterator_next(it->real_iterator, (void **) &sub))
return EINA_FALSE;
@@ -569,7 +570,7 @@ _efl_ui_table_efl_ui_direction_direction_set(Eo *obj, Efl_Ui_Table_Data *pd, Efl
}
EOLIAN static Efl_Ui_Dir
-_efl_ui_table_efl_ui_direction_direction_get(Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd)
+_efl_ui_table_efl_ui_direction_direction_get(const Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd)
{
return pd->dir1;
}
@@ -595,7 +596,7 @@ _efl_ui_table_efl_pack_table_table_direction_set(Eo *obj, Efl_Ui_Table_Data *pd,
}
EOLIAN static void
-_efl_ui_table_efl_pack_table_table_direction_get(Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd, Efl_Ui_Dir *primary, Efl_Ui_Dir *secondary)
+_efl_ui_table_efl_pack_table_table_direction_get(const Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd, Efl_Ui_Dir *primary, Efl_Ui_Dir *secondary)
{
if (primary) *primary = pd->dir1;
if (secondary) *secondary = pd->dir2;
@@ -614,7 +615,7 @@ _efl_ui_table_efl_pack_table_table_size_set(Eo *obj, Efl_Ui_Table_Data *pd EINA_
}
EOLIAN static void
-_efl_ui_table_efl_pack_table_table_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd EINA_UNUSED, int *cols, int *rows)
+_efl_ui_table_efl_pack_table_table_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd EINA_UNUSED, int *cols, int *rows)
{
if (cols) *cols = efl_pack_table_columns_get(obj);
if (rows) *rows = efl_pack_table_rows_get(obj);
@@ -629,7 +630,7 @@ _efl_ui_table_efl_pack_table_table_columns_set(Eo *obj, Efl_Ui_Table_Data *pd, i
}
EOLIAN static int
-_efl_ui_table_efl_pack_table_table_columns_get(Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd)
+_efl_ui_table_efl_pack_table_table_columns_get(const Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd)
{
if (!pd->req_cols)
{
@@ -650,7 +651,7 @@ _efl_ui_table_efl_pack_table_table_rows_set(Eo *obj, Efl_Ui_Table_Data *pd, int
}
EOLIAN static int
-_efl_ui_table_efl_pack_table_table_rows_get(Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd)
+_efl_ui_table_efl_pack_table_table_rows_get(const Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd)
{
if (!pd->req_rows)
{
@@ -663,14 +664,14 @@ _efl_ui_table_efl_pack_table_table_rows_get(Eo *obj EINA_UNUSED, Efl_Ui_Table_Da
}
EOLIAN static Eina_Bool
-_efl_ui_table_efl_pack_pack(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED, Efl_Gfx *subobj)
+_efl_ui_table_efl_pack_pack(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED, Efl_Gfx_Entity *subobj)
{
/* this is just an alias */
return efl_pack_end(obj, subobj);
}
EOLIAN static Eina_Bool
-_efl_ui_table_efl_pack_linear_pack_end(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Gfx *subobj)
+_efl_ui_table_efl_pack_linear_pack_end(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Gfx_Entity *subobj)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(subobj, EINA_FALSE);
diff --git a/src/lib/elementary/efl_ui_table.eo b/src/lib/elementary/efl_ui_table.eo
index 77086e726e..03d1f98234 100644
--- a/src/lib/elementary/efl_ui_table.eo
+++ b/src/lib/elementary/efl_ui_table.eo
@@ -1,11 +1,11 @@
-class Efl.Ui.Table (Elm.Widget, Efl.Pack.Table, Efl.Pack.Layout,
+class Efl.Ui.Table (Efl.Ui.Widget, Efl.Pack_Table, Efl.Pack_Layout,
Efl.Ui.Direction)
{
[[Efl UI table class]]
implements {
Efl.Object.constructor;
Efl.Canvas.Group.group_calculate;
- Elm.Widget.theme_apply;
+ Efl.Ui.Widget.theme_apply;
//Efl.Container.content_remove; // TODO
Efl.Container.content_iterate;
Efl.Container.content_count;
@@ -15,16 +15,16 @@ class Efl.Ui.Table (Elm.Widget, Efl.Pack.Table, Efl.Pack.Layout,
Efl.Pack.unpack;
Efl.Pack.pack;
Efl.Pack.pack_padding { get; set; }
- Efl.Pack.Table.pack_table;
- Efl.Pack.Table.table_content_get;
- Efl.Pack.Table.table_contents_get;
- Efl.Pack.Table.table_position { get; }
- Efl.Pack.Table.table_size { get; set; }
- Efl.Pack.Table.table_columns { get; set; }
- Efl.Pack.Table.table_rows { get; set; }
- Efl.Pack.Table.table_direction { get; set; }
- Efl.Pack.Linear.pack_end;
- Efl.Pack.Layout.layout_update;
- Efl.Pack.Layout.layout_request;
+ Efl.Pack_Table.pack_table;
+ Efl.Pack_Table.table_content_get;
+ Efl.Pack_Table.table_contents_get;
+ Efl.Pack_Table.table_position { get; }
+ Efl.Pack_Table.table_size { get; set; }
+ Efl.Pack_Table.table_columns { get; set; }
+ Efl.Pack_Table.table_rows { get; set; }
+ Efl.Pack_Table.table_direction { get; set; }
+ Efl.Pack_Linear.pack_end;
+ Efl.Pack_Layout.layout_update;
+ Efl.Pack_Layout.layout_request;
}
}
diff --git a/src/lib/elementary/efl_ui_table_private.h b/src/lib/elementary/efl_ui_table_private.h
index aec2e2d680..e7c3821ee9 100644
--- a/src/lib/elementary/efl_ui_table_private.h
+++ b/src/lib/elementary/efl_ui_table_private.h
@@ -20,7 +20,7 @@ struct _Table_Item
{
EINA_INLIST;
- Efl_Gfx *object;
+ Efl_Gfx_Entity *object;
int col_span, row_span;
int col, row;
diff --git a/src/lib/elementary/efl_ui_table_static.c b/src/lib/elementary/efl_ui_table_static.c
index 4febcbeee5..339df7df2f 100644
--- a/src/lib/elementary/efl_ui_table_static.c
+++ b/src/lib/elementary/efl_ui_table_static.c
@@ -11,7 +11,7 @@ _efl_ui_table_static_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED)
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_FILLER);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_FILLER);
gd = efl_data_scope_get(obj, EFL_UI_TABLE_CLASS);
gd->req_cols = 100;
@@ -36,7 +36,7 @@ _efl_ui_table_static_efl_pack_layout_layout_update(Eo *obj, void *_pd EINA_UNUSE
e = evas_object_evas_get(obj);
efl_event_freeze(e);
- r = efl_gfx_geometry_get(obj);
+ r = efl_gfx_entity_geometry_get(obj);
xl = r.x;
yl = r.y;
wl = r.w;
@@ -68,7 +68,7 @@ _efl_ui_table_static_efl_pack_layout_layout_update(Eo *obj, void *_pd EINA_UNUSE
}
y1 = yl + ((hl * (long long)gi->row) / vhl);
y2 = yl + ((hl * (long long)(gi->row + gi->row_span)) / vhl);
- efl_gfx_geometry_set(gi->object, EINA_RECT(x1, y1, x2 - x1, y2 - y1));
+ efl_gfx_entity_geometry_set(gi->object, EINA_RECT(x1, y1, x2 - x1, y2 - y1));
}
err:
efl_event_thaw(e);
diff --git a/src/lib/elementary/efl_ui_table_static.eo b/src/lib/elementary/efl_ui_table_static.eo
index 337c2a0e04..966a5dd196 100644
--- a/src/lib/elementary/efl_ui_table_static.eo
+++ b/src/lib/elementary/efl_ui_table_static.eo
@@ -4,6 +4,6 @@ class Efl.Ui.Table_Static (Efl.Ui.Table)
data: null;
implements {
Efl.Object.constructor;
- Efl.Pack.Layout.layout_update;
+ Efl.Pack_Layout.layout_update;
}
}
diff --git a/src/lib/elementary/efl_ui_tags.c b/src/lib/elementary/efl_ui_tags.c
new file mode 100644
index 0000000000..2e237c3811
--- /dev/null
+++ b/src/lib/elementary/efl_ui_tags.c
@@ -0,0 +1,1177 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <Elementary.h>
+#include "elm_priv.h"
+#include "efl_ui_tags_private.h"
+#include "elm_entry.eo.h"
+
+#define MY_CLASS EFL_UI_TAGS_CLASS
+
+#define MY_CLASS_NAME "Efl.Ui.Tags"
+
+#define MIN_W_ENTRY 10
+
+static const char PART_NAME_BUTTON[] = "btn";
+static const char PART_NAME_LABEL[] = "label";
+static const char PART_NAME_NUMBER[] = "number";
+
+static Eina_Bool _efl_ui_tags_smart_focus_direction_enable = EINA_TRUE;
+
+static void _entry_changed_cb(void *data, const Efl_Event *event);
+static void _entry_focus_changed_cb(void *data, const Efl_Event *event);
+static void _entry_clicked_cb(void *data, const Efl_Event *event);
+
+EFL_CALLBACKS_ARRAY_DEFINE(_tags_cb,
+ { ELM_ENTRY_EVENT_CHANGED, _entry_changed_cb },
+ { EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED , _entry_focus_changed_cb },
+ { EFL_UI_EVENT_CLICKED, _entry_clicked_cb }
+);
+
+static void
+_shrink_mode_set(Eo *obj,
+ Eina_Bool shrink)
+{
+ int count;
+ Eina_List *l;
+ Eo *layout;
+
+ Efl_Ui_Tags_Data *sd = efl_data_scope_get(obj, EFL_UI_TAGS_CLASS);
+
+ if (!sd->layouts) return;
+ if (sd->view_state == TAGS_VIEW_ENTRY)
+ evas_object_hide(sd->entry);
+ else if (sd->view_state == TAGS_VIEW_SHRINK)
+ evas_object_hide(sd->end);
+
+ if (shrink == EINA_TRUE)
+ {
+ Evas_Coord w = 0;
+ Evas_Coord box_inner_item_width_padding = 0;
+ Eina_Value val;
+
+ elm_box_padding_get(sd->box, &box_inner_item_width_padding, NULL);
+ // unpack all items and entry
+ elm_box_unpack_all(sd->box);
+ EINA_LIST_FOREACH(sd->layouts, l, layout)
+ {
+ evas_object_hide(layout);
+ }
+ // pack buttons only 1line
+ w = sd->w_box;
+
+ if (sd->label && sd->label_packed)
+ {
+ elm_box_pack_end(sd->box, sd->label);
+ Eina_Size2D label_min =
+ efl_gfx_size_hint_combined_min_get(sd->label);
+ w -= label_min.w;
+ w -= box_inner_item_width_padding;
+ }
+
+ layout = NULL;
+ count = eina_list_count(sd->layouts);
+
+ EINA_LIST_FOREACH(sd->layouts, l, layout)
+ {
+ char buf[32];
+ Evas_Coord w_label_count = 0, h = 0;
+
+ elm_box_pack_end(sd->box, layout);
+ evas_object_show(layout);
+
+ Eina_Size2D item_min =
+ efl_gfx_size_hint_combined_min_get(layout);
+
+ w -= item_min.w;
+ w -= box_inner_item_width_padding;
+ count--;
+
+ eina_value_setup(&val, EINA_VALUE_TYPE_INT);
+
+ if (count > 0)
+ {
+ if (sd->format_cb)
+ {
+ eina_strbuf_reset(sd->format_strbuf);
+ eina_value_set(&val, count);
+ sd->format_cb(sd->format_cb_data, sd->format_strbuf, val);
+ edje_object_part_text_escaped_set(sd->end, "efl.text",
+ eina_strbuf_string_get(sd->format_strbuf));
+ }
+ else
+ {
+ snprintf(buf, sizeof(buf), "+ %d", count);
+ edje_object_part_text_escaped_set(sd->end, "efl.text", buf);
+ }
+
+ edje_object_size_min_calc(sd->end, &w_label_count, NULL);
+ elm_coords_finger_size_adjust(1, &w_label_count, 1, NULL);
+ }
+
+ if ((w < 0) || (w < w_label_count))
+ {
+ elm_box_unpack(sd->box, layout);
+ evas_object_hide(layout);
+ count++;
+
+ if (sd->format_cb)
+ {
+ eina_strbuf_reset(sd->format_strbuf);
+ eina_value_set(&val, count);
+ sd->format_cb(sd->format_cb_data, sd->format_strbuf, val);
+ edje_object_part_text_escaped_set(sd->end, "efl.text",
+ eina_strbuf_string_get(sd->format_strbuf));
+ }
+ else
+ {
+ snprintf(buf, sizeof(buf), "+ %d", count);
+ edje_object_part_text_escaped_set(sd->end, "efl.text", buf);
+ }
+
+ edje_object_size_min_calc(sd->end, &w_label_count, &h);
+ elm_coords_finger_size_adjust(1, &w_label_count, 1, &h);
+ efl_gfx_size_hint_min_set(sd->end, EINA_SIZE2D(w_label_count, h));
+ elm_box_pack_end(sd->box, sd->end);
+ evas_object_show(sd->end);
+
+ break;
+ }
+ }
+
+ if (sd->view_state != TAGS_VIEW_SHRINK)
+ {
+ sd->view_state = TAGS_VIEW_SHRINK;
+ efl_event_callback_call
+ (obj, EFL_UI_TAGS_EVENT_EXPAND_STATE_CHANGED, (void *)1);
+ }
+
+ eina_value_flush(&val);
+ }
+ else
+ {
+ // unpack all items and entry
+ elm_box_unpack_all(sd->box);
+ EINA_LIST_FOREACH(sd->layouts, l, layout)
+ {
+ evas_object_hide(layout);
+ }
+ evas_object_hide(sd->end);
+
+ // pack buttons only 1line
+
+ if (sd->label && sd->label_packed) elm_box_pack_end(sd->box, sd->label);
+
+ // pack remain btns
+ layout = NULL;
+ EINA_LIST_FOREACH(sd->layouts, l, layout)
+ {
+ elm_box_pack_end(sd->box, layout);
+ evas_object_show(layout);
+ }
+
+ if (sd->view_state == TAGS_VIEW_SHRINK)
+ {
+ sd->view_state = TAGS_VIEW_NONE;
+ efl_event_callback_call
+ (obj, EFL_UI_TAGS_EVENT_EXPAND_STATE_CHANGED, (void *)(uintptr_t)sd->shrink);
+ }
+ }
+
+ if (sd->view_state == TAGS_VIEW_SHRINK)
+ _efl_ui_tags_smart_focus_direction_enable = EINA_FALSE;
+ else
+ _efl_ui_tags_smart_focus_direction_enable = EINA_TRUE;
+}
+
+static void
+_view_update(Efl_Ui_Tags_Data *sd)
+{
+ Eo *obj = sd->parent;
+
+ if (sd->w_box <= 0) return;
+
+ // update buttons in shrink mode
+ if (sd->view_state == TAGS_VIEW_SHRINK)
+ _shrink_mode_set(obj, EINA_TRUE);
+}
+
+static void
+_current_item_state_change(Evas_Object *obj, Tags_It_State state)
+{
+ Efl_Ui_Tags_Data *sd = efl_data_scope_get(obj, EFL_UI_TAGS_CLASS);
+
+ Eo *item = sd->selected_it;
+
+ if (!item) return;
+
+ switch (state)
+ {
+ case TAGS_IT_STATE_SELECTED:
+ elm_layout_signal_emit(item, "efl,state,focused", "efl");
+ efl_event_callback_call
+ (obj, EFL_UI_TAGS_EVENT_ITEM_SELECTED, (void *)elm_object_part_text_get(item, "efl.btn.text"));
+ break;
+ case TAGS_IT_STATE_DEFAULT:
+ default:
+ elm_layout_signal_emit(item, "efl,state,default", "efl");
+ sd->selected_it = NULL;
+ break;
+ }
+}
+
+static void
+_current_item_change(Evas_Object *obj, Evas_Object *it)
+{
+ Eina_List *l;
+ Eo *layout;
+
+ Efl_Ui_Tags_Data *sd = efl_data_scope_get(obj, EFL_UI_TAGS_CLASS);
+
+ // change the state of previous item to "default"
+ _current_item_state_change(obj, TAGS_IT_STATE_DEFAULT);
+
+ // change the current
+ EINA_LIST_FOREACH(sd->layouts, l, layout)
+ {
+ if (layout == it)
+ {
+ sd->selected_it = it;
+ break;
+ }
+ }
+ // change the state of current item to "focused"
+ _current_item_state_change(obj, TAGS_IT_STATE_SELECTED);
+}
+
+static void
+_item_select(Evas_Object *obj, Evas_Object *it)
+{
+ Efl_Ui_Tags_Data *sd = efl_data_scope_get(obj, EFL_UI_TAGS_CLASS);
+
+ if (it)
+ {
+ _current_item_change(obj, it);
+
+ if (efl_ui_focus_object_focus_get(obj))
+ {
+ elm_object_focus_set(sd->entry, EINA_FALSE);
+ elm_object_focus_set(it, EINA_TRUE);
+ }
+ }
+ else
+ {
+ _current_item_state_change
+ (obj, TAGS_IT_STATE_DEFAULT);
+ if (efl_ui_focus_object_focus_get(obj) && sd->editable)
+ elm_object_focus_set(sd->entry, EINA_TRUE);
+ }
+}
+
+static Eina_Bool
+_long_press_cb(void *data)
+{
+ Efl_Ui_Tags_Data *sd = efl_data_scope_get(data, EFL_UI_TAGS_CLASS);
+
+ sd->longpress_timer = NULL;
+
+ efl_event_callback_call
+ (data, EFL_UI_TAGS_EVENT_ITEM_LONGPRESSED,
+ (void *)elm_object_part_text_get(sd->downed_it, "efl.btn.text"));
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static void
+_mouse_down_cb(void *data,
+ Evas *evas EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info)
+{
+ Evas_Event_Mouse_Down *ev = event_info;
+
+ Efl_Ui_Tags_Data *sd = efl_data_scope_get(data, EFL_UI_TAGS_CLASS);
+
+ if (ev->button != 1) return;
+
+ ecore_timer_del(sd->longpress_timer);
+ sd->downed_it = obj;
+ sd->longpress_timer = ecore_timer_add
+ (_elm_config->longpress_timeout, _long_press_cb, data);
+}
+
+static void
+_mouse_up_cb(void *data,
+ Evas *evas EINA_UNUSED,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ Efl_Ui_Tags_Data *sd = efl_data_scope_get(data, EFL_UI_TAGS_CLASS);
+
+ sd->downed_it = NULL;
+ ELM_SAFE_FREE(sd->longpress_timer, ecore_timer_del);
+}
+
+
+static void
+_on_item_focused(void *data,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ Efl_Ui_Tags_Data *sd = efl_data_scope_get(data, EFL_UI_TAGS_CLASS);
+
+ sd->focused_it = obj;
+}
+
+static void
+_on_item_unfocused(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ Efl_Ui_Tags_Data *sd = efl_data_scope_get(data, EFL_UI_TAGS_CLASS);
+
+ sd->focused_it = NULL;
+}
+
+static void
+_on_item_deleted(void *data,
+ Evas_Object *obj,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
+{
+ Eina_List *l;
+ Eo *item;
+
+ Efl_Ui_Tags_Data *sd = efl_data_scope_get(data, EFL_UI_TAGS_CLASS);
+
+ // change the current
+ EINA_LIST_FOREACH(sd->layouts, l, item)
+ {
+ if (item == obj)
+ {
+ sd->layouts = eina_list_remove(sd->layouts, item);
+ elm_box_unpack(sd->box, item);
+
+ if (sd->selected_it == item)
+ sd->selected_it = NULL;
+
+ if (sd->focused_it == item)
+ sd->focused_it = NULL;
+
+ if (sd->view_state == TAGS_VIEW_SHRINK)
+ _shrink_mode_set(data, EINA_TRUE);
+
+ if (!sd->item_setting)
+ efl_event_callback_call
+ (data, EFL_UI_TAGS_EVENT_ITEM_DELETED,
+ (void *)elm_object_part_text_get(obj, "efl.btn.text"));
+
+ efl_del(item);
+
+ break;
+ }
+ }
+}
+
+static void
+_on_item_clicked(void *data,
+ Evas_Object *obj,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
+{
+ Efl_Ui_Tags_Data *sd = efl_data_scope_get(data, EFL_UI_TAGS_CLASS);
+ _item_select(data, obj);
+
+ if (sd->selected_it)
+ efl_event_callback_call
+ (data, EFL_UI_TAGS_EVENT_ITEM_CLICKED, (void *)elm_object_part_text_get(obj, "efl.btn.text"));
+}
+
+static Eo *
+_item_new(Efl_Ui_Tags_Data *sd,
+ const char *str)
+{
+ Evas_Object *obj;
+ Eina_Size2D min;
+ Eina_Rect r;
+ Eo *layout;
+
+ obj = sd->parent;
+
+ if (!str) return NULL;
+
+ layout = efl_add(EFL_UI_LAYOUT_OBJECT_CLASS, obj);
+
+ if (!elm_widget_element_update(obj, layout, PART_NAME_BUTTON))
+ CRI("Failed to set layout!");
+
+ efl_text_set(efl_part(layout, "efl.btn.text"), str);
+
+ //entry is cleared when text is made to button
+ efl_text_set(sd->entry, "");
+
+ elm_layout_signal_callback_add
+ (layout, "mouse,clicked,1", "*", _on_item_clicked, obj);
+ elm_layout_signal_callback_add
+ (layout, "efl,deleted", "efl", _on_item_deleted, obj);
+ evas_object_smart_callback_add
+ (layout, "focused", _on_item_focused, obj);
+ evas_object_smart_callback_add
+ (layout, "unfocused", _on_item_unfocused, obj);
+ evas_object_event_callback_add
+ (layout,
+ EVAS_CALLBACK_MOUSE_DOWN, _mouse_down_cb, obj);
+ evas_object_event_callback_add
+ (layout,
+ EVAS_CALLBACK_MOUSE_UP, _mouse_up_cb, obj);
+
+ efl_gfx_size_hint_align_set(layout, 0.5, 0.5);
+ efl_gfx_size_hint_weight_set(layout, 0.0, 0.0);
+
+ evas_object_show(layout);
+
+ evas_object_smart_calculate(layout);
+ min = efl_gfx_size_hint_combined_min_get(layout);
+ r = efl_gfx_entity_geometry_get(sd->box);
+
+ if (sd->w_box && min.w > r.w)
+ {
+ elm_coords_finger_size_adjust(1, &r.w, 1, &min.h);
+ efl_gfx_size_hint_min_set(layout, EINA_SIZE2D(r.w, min.h));
+ efl_gfx_entity_size_set(layout, EINA_SIZE2D(r.w, min.h));
+ }
+
+ elm_object_focus_allow_set(layout, EINA_TRUE);
+
+ sd->layouts = eina_list_append(sd->layouts, layout);
+ if (sd->view_state == TAGS_VIEW_SHRINK)
+ {
+ elm_widget_sub_object_add(obj, layout);
+ evas_object_hide(layout);
+ }
+ else
+ {
+ if (sd->editable)
+ elm_box_pack_before(sd->box, layout, sd->entry);
+ else
+ elm_box_pack_end(sd->box, layout);
+ }
+
+ if (!efl_ui_focus_object_focus_get(obj) && sd->view_state == TAGS_VIEW_SHRINK && sd->w_box)
+ _shrink_mode_set(obj, EINA_TRUE);
+
+ if (!sd->item_setting)
+ efl_event_callback_call
+ (obj, EFL_UI_TAGS_EVENT_ITEM_ADDED, (void *)elm_object_part_text_get(layout, "efl.btn.text"));
+
+ return layout;
+}
+
+//FIXME: having an empty event handling function and reacting on Evas
+//events on specific objects is crazy, someone should fix that.
+EOLIAN static Eina_Bool
+_efl_ui_tags_efl_ui_widget_widget_event(Eo *obj EINA_UNUSED, Efl_Ui_Tags_Data *sd EINA_UNUSED, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *src EINA_UNUSED)
+{
+ //lets stop eating all events
+ return EINA_FALSE;
+}
+
+EOLIAN static void
+_efl_ui_tags_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Tags_Data *sd EINA_UNUSED)
+{
+ Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
+
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+
+ elm_coords_finger_size_adjust(1, &minw, 1, &minh);
+ edje_object_size_min_restricted_calc
+ (wd->resize_obj, &minw, &minh, minw, minh);
+ elm_coords_finger_size_adjust(1, &minw, 1, &minh);
+ efl_gfx_size_hint_min_set(obj, EINA_SIZE2D(minw, minh));
+ efl_gfx_size_hint_max_set(obj, EINA_SIZE2D(maxw, maxh));
+}
+
+static void
+_mouse_clicked_signal_cb(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
+{
+ Efl_Ui_Tags_Data *sd = efl_data_scope_get(obj, EFL_UI_TAGS_CLASS);
+
+ if (sd->editable) efl_ui_text_input_panel_show(sd->entry);
+
+ efl_event_callback_call(obj, EFL_UI_EVENT_CLICKED, NULL);
+}
+
+static void
+_box_resize_cb(void *data,
+ Evas *evas EINA_UNUSED,
+ Evas_Object *obj,
+ void *event EINA_UNUSED)
+{
+ Eina_Size2D min;
+ Eina_Rect r;
+ Eina_List *l;
+ Eo *layout;
+ int hpad;
+
+ Efl_Ui_Tags_Data *sd = efl_data_scope_get(data, EFL_UI_TAGS_CLASS);
+
+ r = efl_gfx_entity_geometry_get(sd->box);
+ if ((r.w <= elm_config_finger_size_get()) || (r.h <= elm_config_finger_size_get())) return;
+
+ elm_box_padding_get(obj, &hpad, NULL);
+
+ if (sd->h_box < r.h)
+ efl_event_callback_call
+ (sd->parent, EFL_UI_TAGS_EVENT_EXPANDED, NULL);
+ else if (sd->h_box > r.h)
+ efl_event_callback_call
+ (sd->parent, EFL_UI_TAGS_EVENT_CONTRACTED, NULL);
+
+ if (sd->layouts && sd->w_box != r.w)
+ {
+ EINA_LIST_FOREACH (sd->layouts, l, layout)
+ {
+ elm_layout_sizing_eval(layout);
+ evas_object_smart_calculate(layout);
+
+ min = efl_gfx_size_hint_combined_min_get(layout);
+
+ if (min.w > r.w - hpad)
+ {
+ min.w = r.w - hpad;
+ efl_gfx_size_hint_min_set(layout, EINA_SIZE2D(min.w, min.h));
+ efl_gfx_entity_size_set(layout, EINA_SIZE2D(min.w, min.h));
+ }
+ }
+ }
+
+ sd->w_box = r.w;
+ sd->h_box = r.h;
+
+ if (sd->view_state == TAGS_VIEW_SHRINK)
+ _shrink_mode_set(data, EINA_TRUE);
+}
+
+static void
+_entry_resize_cb(void *data,
+ Evas *e EINA_UNUSED,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ Efl_Ui_Tags_Data *sd = efl_data_scope_get(data, EFL_UI_TAGS_CLASS);
+
+ if (efl_ui_focus_object_focus_get(sd->parent))
+ elm_widget_show_region_set(sd->entry, efl_gfx_entity_geometry_get(sd->entry), EINA_TRUE);
+}
+
+static void
+_entry_changed_cb(void *data, const Efl_Event *event EINA_UNUSED)
+{
+ Efl_Ui_Tags_Data *sd = efl_data_scope_get(data, EFL_UI_TAGS_CLASS);
+ const char *str;
+
+ str = efl_text_get(sd->entry);
+ sd->n_str = str ? strlen(str) : 0;
+}
+
+static void
+_entry_focus_changed_cb(void *data, const Efl_Event *event)
+{
+ Efl_Ui_Tags_Data *sd = efl_data_scope_get(data, EFL_UI_TAGS_CLASS);
+
+ if (efl_ui_focus_object_focus_get(event->object))
+ {
+ Eo *item;
+
+ if (sd->selected_it)
+ {
+ item = sd->selected_it;
+ elm_object_focus_set(sd->entry, EINA_FALSE);
+ elm_object_focus_set(item, EINA_TRUE);
+ }
+ }
+ else
+ {
+ const char *str;
+
+ str = efl_text_get(sd->entry);
+ if (str && str[0])
+ _item_new(sd, str);
+ }
+}
+
+static void
+_entry_clicked_cb(void *data, const Efl_Event *event EINA_UNUSED)
+{
+ Efl_Ui_Tags_Data *sd = efl_data_scope_get(data, EFL_UI_TAGS_CLASS);
+
+ _current_item_state_change(sd->parent, TAGS_IT_STATE_DEFAULT);
+ elm_object_focus_set(sd->entry, EINA_TRUE);
+}
+
+static void
+_layout_key_down_cb(void *data,
+ Evas *e EINA_UNUSED,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info)
+{
+ Efl_Ui_Tags_Data *sd = efl_data_scope_get(data, EFL_UI_TAGS_CLASS);
+ Evas_Event_Key_Up *ev = (Evas_Event_Key_Up *)event_info;
+
+ if (!sd->box) return;
+
+ if (sd->last_it_select)
+ {
+ if (sd->selected_it &&
+ ((!strcmp(ev->key, "BackSpace")) ||
+ (!strcmp(ev->key, "Delete"))))
+ {
+ Eo *item = sd->selected_it;
+ if (item && sd->editable)
+ {
+ _on_item_deleted(data, item, NULL, NULL);
+ elm_object_focus_set(sd->entry, EINA_TRUE);
+ }
+ }
+ else if (sd->focused_it &&
+ ((!strcmp(ev->key, "KP_Enter")) ||
+ (!strcmp(ev->key, "Return"))))
+ {
+ Eo *item = sd->focused_it;
+ if (item)
+ _on_item_clicked(item, NULL, NULL, NULL);
+ }
+ else if (((!sd->selected_it && (sd->n_str == 0) &&
+ (!strcmp(ev->key, "BackSpace"))) ||
+ (!strcmp(ev->key, "Delete"))))
+ {
+ Eo *item = eina_list_data_get(eina_list_last(sd->layouts));
+ if (item)
+ {
+ _item_select(sd->parent, item);
+ }
+ }
+ }
+ else
+ sd->last_it_select = EINA_TRUE;
+}
+
+static void
+_entry_key_down_cb(void *data,
+ Evas *e EINA_UNUSED,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info)
+{
+ Efl_Ui_Tags_Data *sd = efl_data_scope_get(data, EFL_UI_TAGS_CLASS);
+ Evas_Event_Key_Down *ev = (Evas_Event_Key_Down *)event_info;
+
+ if (sd->n_str == 1 &&
+ (!strcmp(ev->key, "BackSpace") || !strcmp(ev->key, "Delete")))
+ sd->last_it_select = EINA_FALSE;
+}
+
+static void
+_entry_key_up_cb(void *data,
+ Evas *e EINA_UNUSED,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info)
+{
+ Efl_Ui_Tags_Data *sd = efl_data_scope_get(data, EFL_UI_TAGS_CLASS);
+ Evas_Event_Key_Up *ev = (Evas_Event_Key_Up *)event_info;
+ const char *str;
+
+ if (!sd->box) return;
+
+ str = efl_text_get(sd->entry);
+ if (!str) return;
+
+ if (strlen(str) &&
+ (!strcmp(ev->key, "KP_Enter") || !strcmp(ev->key, "Return")))
+ {
+ _item_new(sd, str);
+ sd->n_str = 0;
+ }
+}
+
+static void
+_callbacks_register(Evas_Object *obj)
+{
+ Efl_Ui_Tags_Data *sd = efl_data_scope_get(obj, EFL_UI_TAGS_CLASS);
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+
+ elm_layout_signal_callback_add
+ (obj, "mouse,clicked,1", "*", _mouse_clicked_signal_cb, NULL);
+
+ evas_object_event_callback_add
+ (wd->resize_obj, EVAS_CALLBACK_KEY_DOWN,
+ _layout_key_down_cb, obj);
+
+ evas_object_event_callback_add
+ (sd->box, EVAS_CALLBACK_RESIZE, _box_resize_cb, obj);
+
+ evas_object_event_callback_add
+ (sd->entry, EVAS_CALLBACK_KEY_UP, _entry_key_up_cb, obj);
+ evas_object_event_callback_add
+ (sd->entry, EVAS_CALLBACK_KEY_DOWN, _entry_key_down_cb, obj);
+ evas_object_event_callback_add
+ (sd->entry, EVAS_CALLBACK_RESIZE, _entry_resize_cb, obj);
+ efl_event_callback_array_add(sd->entry, _tags_cb(), obj);
+}
+
+static void
+_label_set(Evas_Object *obj,
+ const char *str)
+{
+ Evas_Coord width, height;
+
+ Efl_Ui_Tags_Data *sd = efl_data_scope_get(obj, EFL_UI_TAGS_CLASS);
+
+ if (!str) return;
+
+ eina_stringshare_replace(&sd->label_str, str);
+
+ edje_object_part_text_escaped_set(sd->label, "efl.text", str);
+
+ if (!strlen(str))
+ {
+ sd->label_packed = EINA_FALSE;
+ elm_box_unpack(sd->box, sd->label);
+ evas_object_hide(sd->label);
+ }
+ else
+ {
+ if (sd->label_packed)
+ elm_box_unpack(sd->box, sd->label);
+ sd->label_packed = EINA_TRUE;
+ edje_object_size_min_calc(sd->label, &width, &height);
+ evas_object_size_hint_min_set(sd->label, width, height);
+ elm_box_pack_start(sd->box, sd->label);
+ evas_object_show(sd->label);
+ }
+
+ _view_update(sd);
+}
+
+static Eina_Bool
+_box_min_size_calculate(Evas_Object *box,
+ Evas_Object_Box_Data *priv,
+ int *line_height,
+ void *data EINA_UNUSED)
+{
+ Evas_Coord w, linew = 0, lineh = 0;
+ Eina_Size2D box_min;
+ Eina_Size2D min;
+ int line_num;
+ Eina_List *l;
+ Evas_Object_Box_Option *opt;
+
+ evas_object_geometry_get(box, NULL, NULL, &w, NULL);
+ box_min = efl_gfx_size_hint_combined_min_get(box);
+
+ if (!w) return EINA_FALSE;
+
+ line_num = 1;
+ EINA_LIST_FOREACH(priv->children, l, opt)
+ {
+ min = efl_gfx_size_hint_combined_min_get(opt->obj);
+
+ linew += min.w;
+ if (lineh < min.h) lineh = min.h;
+
+ if (linew > w)
+ {
+ linew = min.w;
+ line_num++;
+ }
+
+ if ((linew != 0) && (l != eina_list_last(priv->children)))
+ linew += priv->pad.h;
+ }
+ box_min.h = lineh * line_num + (line_num - 1) * priv->pad.v;
+
+ efl_gfx_size_hint_min_set(box, EINA_SIZE2D(box_min.w, box_min.h));
+ *line_height = lineh;
+
+ return EINA_TRUE;
+}
+
+static void
+_box_layout_cb(Evas_Object *o,
+ Evas_Object_Box_Data *priv,
+ void *data)
+{
+ Evas_Coord xx, yy;
+ Eina_Rect r;
+ Evas_Coord linew = 0, lineh = 0;
+ Eina_Size2D min;
+ Evas_Object_Box_Option *opt;
+ const Eina_List *l, *l_next;
+ Evas_Object *obj;
+ double ax, ay;
+ Eina_Bool rtl;
+
+ if (!_box_min_size_calculate(o, priv, &lineh, data)) return;
+
+ r = efl_gfx_entity_geometry_get(o);
+
+ min = efl_gfx_size_hint_combined_min_get(o);
+ efl_gfx_size_hint_align_get(o, &ax, &ay);
+
+ rtl = efl_ui_mirrored_get(data);
+ if (rtl) ax = 1.0 - ax;
+
+ if (r.w < min.w)
+ {
+ r.x = r.x + ((r.w - min.w) * (1.0 - ax));
+ r.w = min.w;
+ }
+ if (r.h < min.h)
+ {
+ r.y = r.y + ((r.h - min.h) * (1.0 - ay));
+ r.h = min.h;
+ }
+
+ xx = r.x;
+ yy = r.y;
+
+ EINA_LIST_FOREACH_SAFE(priv->children, l, l_next, opt)
+ {
+ Eina_Size2D obj_min;
+ Evas_Coord ww, hh, ow, oh;
+ double wx, wy;
+ int fw, fh;
+
+ obj = opt->obj;
+ evas_object_size_hint_align_get(obj, &ax, &ay);
+ evas_object_size_hint_weight_get(obj, &wx, &wy);
+ obj_min = efl_gfx_size_hint_combined_min_get(obj);
+
+ fw = fh = EINA_FALSE;
+ if (EINA_DBL_EQ(ax, -1)) {fw = 1; ax = 0.5; }
+ if (EINA_DBL_EQ(ay, -1)) {fh = 1; ay = 0.5; }
+ if (rtl) ax = 1.0 - ax;
+
+ ww = obj_min.w;
+ if (!EINA_DBL_EQ(wx, 0))
+ {
+ if (ww <= r.w - linew) ww = r.w - linew;
+ else ww = r.w;
+ }
+ hh = lineh;
+
+ ow = obj_min.w;
+ if (fw) ow = ww;
+ oh = obj_min.h;
+ if (fh) oh = hh;
+
+ linew += ww;
+ if (linew > r.w && l != priv->children)
+ {
+ xx = r.x;
+ yy += hh;
+ yy += priv->pad.v;
+ linew = ww;
+ }
+
+ evas_object_move(obj,
+ ((!rtl) ? (xx) : (r.x + (r.w - (xx - r.x) - ww)))
+ + (Evas_Coord)(((double)(ww - ow)) * ax),
+ yy + (Evas_Coord)(((double)(hh - oh)) * ay));
+ evas_object_resize(obj, ow, oh);
+ xx += ww;
+ xx += priv->pad.h;
+
+ if (linew > r.w)
+ {
+ opt = eina_list_data_get(l_next);
+ if (opt && opt->obj && efl_isa(opt->obj, ELM_ENTRY_CLASS))
+ {
+ xx = r.x;
+ yy += hh;
+ yy += priv->pad.v;
+ linew = 0;
+ }
+ }
+ if ((linew != 0) && (l != eina_list_last(priv->children)))
+ linew += priv->pad.h;
+ }
+}
+
+static void
+_view_init(Evas_Object *obj, Efl_Ui_Tags_Data *sd)
+{
+ const char *str;
+ double pad_scale;
+ int hpad = 0, vpad = 0;
+
+ //FIXME: efl_ui_box doesn't support box_layout customizing.
+ // So i use legacy box here.
+ sd->box = elm_box_add(obj);
+
+ if (!sd->box) return;
+
+ str = elm_layout_data_get(obj, "horizontal_pad");
+ if (str) hpad = atoi(str);
+ str = elm_layout_data_get(obj, "vertical_pad");
+ if (str) vpad = atoi(str);
+ pad_scale = efl_gfx_entity_scale_get(obj) * elm_config_scale_get()
+ / edje_object_base_scale_get(elm_layout_edje_get(obj));
+ elm_box_padding_set(sd->box, (hpad * pad_scale), (vpad * pad_scale));
+
+ elm_box_layout_set(sd->box, _box_layout_cb, obj, NULL);
+ elm_box_homogeneous_set(sd->box, EINA_FALSE);
+ elm_layout_content_set(obj, "efl.box", sd->box);
+
+ sd->label = edje_object_add(evas_object_evas_get(obj));
+ if (!sd->label) return;
+ elm_widget_element_update(obj, sd->label, PART_NAME_LABEL);
+
+ sd->entry = efl_add(EFL_UI_TEXT_CLASS, sd->box,
+ efl_text_multiline_set(efl_added, EINA_FALSE),
+ efl_text_set(efl_added, ""),
+ efl_ui_text_cnp_mode_set(efl_added, EFL_SELECTION_FORMAT_MARKUP),
+ efl_ui_text_input_panel_enabled_set(efl_added, EINA_FALSE),
+ efl_text_interactive_editable_set(efl_added, EINA_TRUE),
+ efl_composite_attach(obj, efl_added));
+
+ efl_gfx_size_hint_min_set(sd->entry, EINA_SIZE2D(MIN_W_ENTRY, 0));
+ evas_object_size_hint_weight_set
+ (sd->entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(sd->entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ elm_box_pack_end(sd->box, sd->entry);
+
+ sd->view_state = TAGS_VIEW_ENTRY;
+
+ {
+ Evas_Coord button_min_width = 0, button_min_height = 0;
+
+ sd->end = edje_object_add(evas_object_evas_get(obj));
+ if (!sd->end) return;
+ elm_widget_element_update(obj, sd->end, PART_NAME_NUMBER);
+
+ edje_object_size_min_calc(sd->end, &button_min_width, &button_min_height);
+ elm_coords_finger_size_adjust(1, &button_min_width, 1, &button_min_height);
+ efl_gfx_size_hint_min_set(sd->end, EINA_SIZE2D(button_min_width, button_min_height));
+ elm_widget_sub_object_add(obj, sd->end);
+ }
+}
+
+static void
+_legacy_focused(void *data, const Efl_Event *ev)
+{
+ Efl_Ui_Focus_Object *new_focus;
+ Eina_Bool meaningful_focus_in = EINA_FALSE, meaningful_focus_out = EINA_FALSE;
+ Efl_Ui_Tags_Data *pd = efl_data_scope_get(data, EFL_UI_TAGS_CLASS);
+
+ new_focus = efl_ui_focus_manager_focus_get(ev->object);
+
+ if (efl_isa(ev->info, EFL_UI_WIDGET_CLASS) && elm_widget_parent_get(ev->info) == pd->box)
+ {
+ meaningful_focus_out = EINA_TRUE;
+ }
+
+ if (efl_isa(new_focus, EFL_UI_WIDGET_CLASS) && elm_widget_parent_get(new_focus) == pd->box)
+ {
+ meaningful_focus_in = EINA_TRUE;
+ }
+
+ if (meaningful_focus_in && !meaningful_focus_out)
+ {
+ evas_object_smart_callback_call(data, "focused", NULL);
+ }
+
+ if (!meaningful_focus_in && meaningful_focus_out)
+ {
+ evas_object_smart_callback_call(data, "unfocused", NULL);
+ }
+}
+
+static void
+_legacy_manager_changed_cb(void *data EINA_UNUSED, const Efl_Event *ev)
+{
+ efl_event_callback_del(ev->info, EFL_UI_FOCUS_MANAGER_EVENT_FOCUSED, _legacy_focused, ev->object);
+ efl_event_callback_add(efl_ui_focus_object_focus_manager_get(ev->object), EFL_UI_FOCUS_MANAGER_EVENT_FOCUSED, _legacy_focused, ev->object);
+}
+
+EOLIAN static Eo *
+_efl_ui_tags_efl_object_constructor(Eo *obj, Efl_Ui_Tags_Data *sd)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
+
+ if (!elm_widget_theme_klass_get(obj))
+ elm_widget_theme_klass_set(obj, "tags");
+
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+ elm_widget_sub_object_parent_add(obj);
+
+ if (!elm_widget_theme_object_set(obj, wd->resize_obj,
+ elm_widget_theme_klass_get(obj),
+ elm_widget_theme_element_get(obj),
+ elm_widget_theme_style_get(obj)))
+ CRI("Failed to set layout!");
+
+ elm_widget_can_focus_set(obj, EINA_FALSE);
+
+ sd->last_it_select = EINA_TRUE;
+ sd->editable = EINA_TRUE;
+ sd->parent = obj;
+ sd->format_cb = NULL;
+ sd->it_array = eina_array_new(4);
+
+ _view_init(obj, sd);
+ _callbacks_register(obj);
+
+ //listen to manager changes here
+ efl_event_callback_add(obj, EFL_UI_FOCUS_OBJECT_EVENT_MANAGER_CHANGED, _legacy_manager_changed_cb, NULL);
+
+ return obj;
+}
+
+EOLIAN static void
+_efl_ui_tags_efl_object_destructor(Eo *obj, Efl_Ui_Tags_Data *sd)
+{
+ Eina_List *l;
+ Eo *layout;
+
+ EINA_LIST_FOREACH(sd->layouts, l, layout)
+ evas_object_del(layout);
+
+ sd->layouts = eina_list_free(sd->layouts);
+ eina_array_free(sd->it_array);
+
+ sd->selected_it = NULL;
+ sd->focused_it = NULL;
+
+ eina_stringshare_del(sd->label_str);
+ evas_object_del(sd->entry);
+ evas_object_del(sd->label);
+ evas_object_del(sd->end);
+ ecore_timer_del(sd->longpress_timer);
+
+ efl_ui_format_cb_set(obj, NULL, NULL, NULL);
+ eina_strbuf_free(sd->format_strbuf);
+
+ efl_destructor(efl_super(obj, MY_CLASS));
+}
+
+EOLIAN static void
+_efl_ui_tags_efl_text_text_set(Eo *obj, Efl_Ui_Tags_Data *sd EINA_UNUSED, const char *label)
+{
+ if (label) _label_set(obj, label);
+}
+
+EOLIAN static const char *
+_efl_ui_tags_efl_text_text_get(const Eo *obj EINA_UNUSED, Efl_Ui_Tags_Data *sd)
+{
+ return (sd->label_str ? sd->label_str : NULL);
+}
+
+EOLIAN static void
+_efl_ui_tags_efl_ui_format_format_cb_set(Eo *obj EINA_UNUSED, Efl_Ui_Tags_Data *sd, void *func_data, Efl_Ui_Format_Func_Cb func, Eina_Free_Cb func_free_cb)
+{
+ if ((sd->format_cb_data == func_data) && (sd->format_cb == func))
+ return;
+
+ if (sd->format_cb_data && sd->format_free_cb)
+ sd->format_free_cb(sd->format_cb_data);
+
+ sd->format_cb = func;
+ sd->format_cb_data = func_data;
+ sd->format_free_cb = func_free_cb;
+ if (!sd->format_strbuf) sd->format_strbuf = eina_strbuf_new();
+
+ _view_update(sd);
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_tags_expanded_get(const Eo *obj EINA_UNUSED, Efl_Ui_Tags_Data *sd)
+{
+ return sd->view_state == TAGS_VIEW_SHRINK ?
+ EINA_FALSE : EINA_TRUE;
+}
+
+EOLIAN static void
+_efl_ui_tags_expanded_set(Eo *obj, Efl_Ui_Tags_Data *sd, Eina_Bool expanded)
+{
+ if (((sd->view_state == TAGS_VIEW_SHRINK) ?
+ EINA_FALSE : EINA_TRUE) == expanded) return;
+
+ if (expanded)
+ _shrink_mode_set(obj, EINA_FALSE);
+ else
+ _shrink_mode_set(obj, EINA_TRUE);
+}
+
+EOLIAN static void
+_efl_ui_tags_editable_set(Eo *obj EINA_UNUSED, Efl_Ui_Tags_Data *sd, Eina_Bool editable)
+{
+ editable = !!editable;
+ if (sd->editable == editable) return;
+ sd->editable = editable;
+
+ if (sd->editable && (sd->view_state != TAGS_VIEW_SHRINK))
+ {
+ elm_box_pack_end(sd->box, sd->entry);
+ evas_object_show(sd->entry);
+ }
+ else
+ {
+ elm_box_unpack(sd->box, sd->entry);
+ evas_object_hide(sd->entry);
+ }
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_tags_editable_get(const Eo *obj EINA_UNUSED, Efl_Ui_Tags_Data *sd)
+{
+ return sd->editable;
+}
+
+EOLIAN static void
+_efl_ui_tags_items_set(Eo *obj, Efl_Ui_Tags_Data *sd, const Eina_Array *items)
+{
+ EINA_SAFETY_ON_NULL_RETURN(items);
+
+ Eina_List *l;
+ Eo *layout;
+ Eina_Array_Iterator iterator;
+ const char *it_text;
+ unsigned int i;
+
+ sd->item_setting = EINA_TRUE;
+
+ if (sd->layouts)
+ EINA_LIST_FOREACH(sd->layouts, l, layout)
+ _on_item_deleted(obj, layout, NULL, NULL);
+
+ if (eina_array_count(items))
+ EINA_ARRAY_ITER_NEXT(items, i, it_text, iterator)
+ _item_new(sd, it_text);
+
+ sd->item_setting = EINA_FALSE;
+}
+
+EOLIAN static const Eina_Array*
+_efl_ui_tags_items_get(const Eo *obj EINA_UNUSED, Efl_Ui_Tags_Data *sd)
+{
+ Eina_List *l;
+ Eo *layout;
+
+ eina_array_clean(sd->it_array);
+
+ if (sd->layouts)
+ EINA_LIST_FOREACH(sd->layouts, l, layout)
+ eina_array_push(sd->it_array, elm_object_part_text_get(layout, "efl.btn.text"));
+
+ return sd->it_array;
+}
+
+#define EFL_UI_TAGS_EXTRA_OPS \
+ ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_tags), \
+
+#include "efl_ui_tags.eo.c"
diff --git a/src/lib/elementary/efl_ui_tags.eo b/src/lib/elementary/efl_ui_tags.eo
new file mode 100644
index 0000000000..637b9f81d8
--- /dev/null
+++ b/src/lib/elementary/efl_ui_tags.eo
@@ -0,0 +1,59 @@
+class Efl.Ui.Tags (Efl.Ui.Layout.Object, Efl.Text, Efl.Ui.Format)
+{
+ [[Elementary Tags class]]
+ methods {
+ @property editable {
+ [[Control if the tags is to be editable or not.]]
+ set {
+ }
+ get {
+ }
+ values {
+ editable: bool; [[If $true, user can add/delete item in tags, if not, the tags is non-editable.]]
+ }
+ }
+ @property expanded {
+ [[Control the tags to expanded state.
+
+ In expanded state, the complete entry will be displayed.
+ Otherwise, only single line of the entry will be displayed.]]
+ set {
+ }
+ get {
+ }
+ values {
+ expanded: bool; [[The value of expanded state. Set this to $true for expanded state. Set
+ this to $false for single line state.]]
+ }
+ }
+ @property items {
+ [[Get a list of items in the tags]]
+ set {
+ }
+ get {
+ }
+ values {
+ items: const(array<string>); [[The array of items, or NULL if none]]
+ }
+ }
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Object.destructor;
+ Efl.Ui.Widget.widget_event;
+ Efl.Text.text { get; set; }
+ Efl.Ui.Format.format_cb { set; }
+ }
+ events {
+ /* FIXME: Returning a basic type is not future-proof, better return a struct */
+ item,selected: string; [[Called when item was selected]]
+ item,added: string; [[Called when item was added]]
+ item,deleted: string; [[Called when item was deleted]]
+ item,clicked: string; [[Called when item was clicked]]
+ item,longpressed: string; [[Called when item got a longpress]]
+ expanded: void; [[Called when expanded]]
+ contracted: void; [[Called when contracted]]
+ /* FIXME: Not future-proof */
+ expand,state,changed: int; [[Called when expanded state changed]]
+ }
+}
diff --git a/src/lib/elementary/efl_ui_tags_private.h b/src/lib/elementary/efl_ui_tags_private.h
new file mode 100644
index 0000000000..49d0a95264
--- /dev/null
+++ b/src/lib/elementary/efl_ui_tags_private.h
@@ -0,0 +1,48 @@
+#ifndef EFL_UI_TAGS_PRIVATE_H
+#define EFL_UI_TAGS_PRIVATE_H
+
+#include "elm_widget_layout.h"
+
+typedef enum _Tags_View_State
+{
+ TAGS_VIEW_NONE,
+ TAGS_VIEW_GUIDETEXT,
+ TAGS_VIEW_ENTRY,
+ TAGS_VIEW_SHRINK
+} Tags_View_State;
+
+typedef enum _Tags_It_State
+{
+ TAGS_IT_STATE_DEFAULT,
+ TAGS_IT_STATE_SELECTED,
+} Tags_It_State;
+
+typedef struct _Efl_Ui_Tags_Data Efl_Ui_Tags_Data;
+struct _Efl_Ui_Tags_Data
+{
+ Eina_Array *it_array;
+ Eina_List *layouts;
+
+ Eo *parent, *box, *label, *end, *entry, *selected_it, *focused_it, *downed_it;
+
+ Tags_View_State view_state;
+
+ Ecore_Timer *longpress_timer;
+
+ const char *label_str, *guide_text_str;
+ int n_str;
+ Evas_Coord w_box, h_box;
+ int shrink;
+
+ Efl_Ui_Format_Func_Cb format_cb;
+ Eina_Free_Cb format_free_cb;
+ void *format_cb_data;
+ Eina_Strbuf *format_strbuf;
+
+ Eina_Bool last_it_select : 1;
+ Eina_Bool editable : 1;
+ Eina_Bool focused : 1;
+ Eina_Bool label_packed : 1;
+ Eina_Bool item_setting : 1;
+};
+#endif
diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c
index 4f3e45f7df..3a870475a7 100644
--- a/src/lib/elementary/efl_ui_text.c
+++ b/src/lib/elementary/efl_ui_text.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_TEXT_PROTECTED
#define EFL_ACCESS_EDITABLE_TEXT_PROTECTED
#define ELM_LAYOUT_PROTECTED
@@ -63,7 +63,8 @@ struct _Efl_Ui_Text_Data
Eina_List *sel;
Eina_List *items; /** context menu item list */
Item_Obj *item_objs;
- Eina_List *item_providers;
+ Efl_Canvas_Text_Factory *item_factory;
+ Efl_Canvas_Text_Factory *item_fallback_factory;
Eina_List *markup_filters;
Ecore_Job *hov_deljob;
Mod_Api *api; // module api if supplied
@@ -131,6 +132,7 @@ struct _Efl_Ui_Text_Data
Eina_Bool scroll : 1;
Eina_Bool input_panel_show_on_demand : 1;
Eina_Bool anchors_updated : 1;
+ Eina_Bool fallback_item_provider_disabled : 1;
};
struct _Anchor
@@ -157,7 +159,7 @@ struct _Item_Obj
EFL_UI_TEXT_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -166,7 +168,7 @@ struct _Item_Obj
EFL_UI_TEXT_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
@@ -242,8 +244,8 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
/* static const Elm_Layout_Part_Alias_Description _content_aliases[] = */
/* { */
-/* {"icon", "elm.swallow.icon"}, */
-/* {"end", "elm.swallow.end"}, */
+/* {"icon", "efl.icon"}, */
+/* {"end", "efl.end"}, */
/* {NULL, NULL} */
/* }; */
@@ -276,7 +278,7 @@ static void _efl_ui_text_move_cb(void *data, Evas *e, Evas_Object *obj, void *ev
static void _efl_ui_text_select_none(Eo *obj, Efl_Ui_Text_Data *sd);
static void _efl_ui_text_anchor_hover_end(Eo *obj, Efl_Ui_Text_Data *sd);
static void _efl_ui_text_anchor_hover_parent_set(Eo *obj, Efl_Ui_Text_Data *sd, Evas_Object *parent);
-static const char* _efl_ui_text_selection_get(Eo *obj, Efl_Ui_Text_Data *sd);
+static const char* _efl_ui_text_selection_get(const Eo *obj, Efl_Ui_Text_Data *sd);
static void _edje_signal_emit(Efl_Ui_Text_Data *obj, const char *sig, const char *src);
static void _decoration_defer_all(Eo *obj);
static inline Eo * _decoration_create(Eo *obj, Efl_Ui_Text_Data *sd, const char *source, Eina_Bool above);
@@ -442,9 +444,9 @@ _efl_ui_text_guide_update(Evas_Object *obj,
EFL_UI_TEXT_DATA_GET(obj, sd);
if ((has_text) && (!sd->has_text))
- edje_object_signal_emit(sd->entry_edje, "elm,guide,disabled", "elm");
+ edje_object_signal_emit(sd->entry_edje, "efl,guide,disabled", "efl");
else if ((!has_text) && (sd->has_text))
- edje_object_signal_emit(sd->entry_edje, "elm,guide,enabled", "elm");
+ edje_object_signal_emit(sd->entry_edje, "efl,guide,enabled", "efl");
sd->has_text = has_text;
}
@@ -459,11 +461,11 @@ _validate(Evas_Object *obj)
if (sd->validators == 0) return;
- vc.text = edje_object_part_text_get(sd->entry_edje, "elm.text");
+ vc.text = edje_object_part_text_get(sd->entry_edje, "efl.text");
res = efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_VALIDATE, (void *)&vc);
buf = eina_strbuf_new();
eina_strbuf_append_printf(buf, "validation,%s,%s", vc.signal, res == EINA_FALSE ? "fail" : "pass");
- edje_object_signal_emit(sd->scr_edje, eina_strbuf_string_get(buf), "elm");
+ edje_object_signal_emit(sd->scr_edje, eina_strbuf_string_get(buf), "efl");
eina_tmpstr_del(vc.signal);
eina_strbuf_free(buf);
}
@@ -513,12 +515,12 @@ _hide_selection_handler(Evas_Object *obj)
if (sd->start_handler_shown)
{
- edje_object_signal_emit(sd->start_handler, "elm,handler,hide", "elm");
+ edje_object_signal_emit(sd->start_handler, "efl,handler,hide", "efl");
sd->start_handler_shown = EINA_FALSE;
}
if (sd->end_handler_shown)
{
- edje_object_signal_emit(sd->end_handler, "elm,handler,hide", "elm");
+ edje_object_signal_emit(sd->end_handler, "efl,handler,hide", "efl");
sd->end_handler_shown = EINA_FALSE;
}
}
@@ -579,7 +581,7 @@ _update_selection_handler(Eo *obj)
Eina_Bool hidden = EINA_FALSE;
Efl_Text_Cursor_Cursor *sel_start, *sel_end;
- efl_ui_text_interactive_selection_cursors_get(obj, &sel_start, &sel_end);
+ efl_text_interactive_selection_cursors_get(obj, &sel_start, &sel_end);
if (!sd->start_handler)
_create_selection_handlers(obj, sd);
@@ -604,13 +606,13 @@ _update_selection_handler(Eo *obj)
if (!sd->start_handler_shown && !hidden)
{
edje_object_signal_emit(sd->start_handler,
- "elm,handler,show", "elm");
+ "efl,handler,show", "efl");
sd->start_handler_shown = EINA_TRUE;
}
else if (sd->start_handler_shown && hidden)
{
edje_object_signal_emit(sd->start_handler,
- "elm,handler,hide", "elm");
+ "efl,handler,hide", "efl");
sd->start_handler_shown = EINA_FALSE;
}
@@ -630,13 +632,13 @@ _update_selection_handler(Eo *obj)
if (!sd->end_handler_shown && !hidden)
{
edje_object_signal_emit(sd->end_handler,
- "elm,handler,show", "elm");
+ "efl,handler,show", "efl");
sd->end_handler_shown = EINA_TRUE;
}
else if (sd->end_handler_shown && hidden)
{
edje_object_signal_emit(sd->end_handler,
- "elm,handler,hide", "elm");
+ "efl,handler,hide", "efl");
sd->end_handler_shown = EINA_FALSE;
}
eina_rectangle_free(rect);
@@ -646,13 +648,13 @@ _update_selection_handler(Eo *obj)
if (sd->start_handler_shown)
{
edje_object_signal_emit(sd->start_handler,
- "elm,handler,hide", "elm");
+ "efl,handler,hide", "efl");
sd->start_handler_shown = EINA_FALSE;
}
if (sd->end_handler_shown)
{
edje_object_signal_emit(sd->end_handler,
- "elm,handler,hide", "elm");
+ "efl,handler,hide", "efl");
sd->end_handler_shown = EINA_FALSE;
}
}
@@ -665,7 +667,7 @@ _edje_entry_user_insert(Evas_Object *obj, const char *data)
EFL_UI_TEXT_DATA_GET(obj, sd);
sd->changed = EINA_TRUE;
- edje_object_part_text_user_insert(sd->entry_edje, "elm.text", data);
+ edje_object_part_text_user_insert(sd->entry_edje, "efl.text", data);
elm_layout_sizing_eval(obj);
}
@@ -704,7 +706,7 @@ _selection_data_cb(void *data EINA_UNUSED,
else if (sd->cnp_mode == ELM_CNP_MODE_PLAINTEXT)
{
Efl_Text_Cursor_Cursor *cur, *start, *end;
- efl_ui_text_interactive_selection_cursors_get(obj, &start, &end);
+ efl_text_interactive_selection_cursors_get(obj, &start, &end);
if (!efl_text_cursor_equal(obj, start, end))
{
efl_canvas_text_range_delete(obj, start, end);
@@ -754,10 +756,10 @@ _dnd_pos_cb(void *data EINA_UNUSED,
y = y + oy - ey;
edje_object_part_text_cursor_coord_set
- (sd->entry_edje, "elm.text", EDJE_CURSOR_USER, x, y);
+ (sd->entry_edje, "efl.text", EDJE_CURSOR_USER, x, y);
pos = edje_object_part_text_cursor_pos_get
- (sd->entry_edje, "elm.text", EDJE_CURSOR_USER);
- edje_object_part_text_cursor_pos_set(sd->entry_edje, "elm.text",
+ (sd->entry_edje, "efl.text", EDJE_CURSOR_USER);
+ edje_object_part_text_cursor_pos_set(sd->entry_edje, "efl.text",
EDJE_CURSOR_MAIN, pos);
}
@@ -771,7 +773,7 @@ _dnd_drop_cb(void *data EINA_UNUSED,
EFL_UI_TEXT_DATA_GET(obj, sd);
rv = edje_object_part_text_cursor_coord_set
- (sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN, drop->x, drop->y);
+ (sd->entry_edje, "efl.text", EDJE_CURSOR_MAIN, drop->x, drop->y);
if (!rv) WRN("Warning: Failed to position cursor: paste anyway");
@@ -792,7 +794,7 @@ _get_drop_format(Evas_Object *obj)
/* we can't reuse layout's here, because it's on entry_edje only */
EOLIAN static Eina_Bool
-_efl_ui_text_elm_widget_on_disabled_update(Eo *obj, Efl_Ui_Text_Data *sd, Eina_Bool disabled)
+_efl_ui_text_efl_ui_widget_on_disabled_update(Eo *obj, Efl_Ui_Text_Data *sd, Eina_Bool disabled)
{
const char *emission ;
@@ -802,11 +804,11 @@ _efl_ui_text_elm_widget_on_disabled_update(Eo *obj, Efl_Ui_Text_Data *sd, Eina_B
_dnd_pos_cb, NULL,
_dnd_drop_cb, NULL);
- emission = disabled ? "elm,state,disabled" : "elm,state,enabled";
- edje_object_signal_emit(sd->entry_edje, emission, "elm");
+ emission = disabled ? "efl,state,disabled" : "efl,state,enabled";
+ edje_object_signal_emit(sd->entry_edje, emission, "efl");
if (sd->scroll)
{
- edje_object_signal_emit(sd->scr_edje, emission, "elm");
+ edje_object_signal_emit(sd->scr_edje, emission, "efl");
elm_interface_scrollable_freeze_set(obj, disabled);
}
sd->disabled = disabled;
@@ -835,16 +837,16 @@ _efl_ui_text_background_switch(Evas_Object *from_edje, Evas_Object *to_edje)
if (!from_edje || !to_edje) return;
- if (edje_object_part_exists(from_edje, "elm.swallow.background") &&
- edje_object_part_exists(to_edje, "elm.swallow.background") &&
- !edje_object_part_swallow_get(to_edje, "elm.swallow.background"))
+ if (edje_object_part_exists(from_edje, "efl.background") &&
+ edje_object_part_exists(to_edje, "efl.background") &&
+ !edje_object_part_swallow_get(to_edje, "efl.background"))
{
- bg_obj = edje_object_part_swallow_get(from_edje, "elm.swallow.background");
+ bg_obj = edje_object_part_swallow_get(from_edje, "efl.background");
if (bg_obj)
{
edje_object_part_unswallow(from_edje, bg_obj);
- edje_object_part_swallow(to_edje, "elm.swallow.background", bg_obj);
+ edje_object_part_swallow(to_edje, "efl.background", bg_obj);
}
}
}
@@ -852,7 +854,7 @@ _efl_ui_text_background_switch(Evas_Object *from_edje, Evas_Object *to_edje)
/* we can't issue the layout's theming code here, cause it assumes an
* unique edje object, always */
EOLIAN static Efl_Ui_Theme_Apply
-_efl_ui_text_elm_widget_theme_apply(Eo *obj, Efl_Ui_Text_Data *sd)
+_efl_ui_text_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Text_Data *sd)
{
const char *str;
Efl_Ui_Theme_Apply theme_apply;
@@ -861,7 +863,7 @@ _efl_ui_text_elm_widget_theme_apply(Eo *obj, Efl_Ui_Text_Data *sd)
// Note: We are skipping elm_layout here! This is by design.
// This assumes the following inheritance: my_class -> layout -> widget ...
- theme_apply = efl_ui_widget_theme_apply(efl_cast(obj, ELM_WIDGET_CLASS));
+ theme_apply = efl_ui_widget_theme_apply(efl_cast(obj, EFL_UI_WIDGET_CLASS));
if (!theme_apply) return EFL_UI_THEME_APPLY_FAILED;
efl_event_freeze(obj);
@@ -871,7 +873,7 @@ _efl_ui_text_elm_widget_theme_apply(Eo *obj, Efl_Ui_Text_Data *sd)
edje_object_scale_set
(wd->resize_obj,
- efl_gfx_scale_get(obj) * elm_config_scale_get());
+ efl_gfx_entity_scale_get(obj) * elm_config_scale_get());
_mirrored_set(obj, efl_ui_mirrored_get(obj));
@@ -879,29 +881,29 @@ _efl_ui_text_elm_widget_theme_apply(Eo *obj, Efl_Ui_Text_Data *sd)
elm_widget_theme_element_get(obj));
if (elm_widget_disabled_get(obj))
- edje_object_signal_emit(sd->entry_edje, "elm,state,disabled", "elm");
+ edje_object_signal_emit(sd->entry_edje, "efl,state,disabled", "efl");
edje_object_part_text_input_panel_layout_set
- (sd->entry_edje, "elm.text", (Edje_Input_Panel_Layout)sd->input_panel_layout);
+ (sd->entry_edje, "efl.text", (Edje_Input_Panel_Layout)sd->input_panel_layout);
edje_object_part_text_input_panel_layout_variation_set
- (sd->entry_edje, "elm.text", sd->input_panel_layout_variation);
+ (sd->entry_edje, "efl.text", sd->input_panel_layout_variation);
edje_object_part_text_autocapital_type_set
- (sd->entry_edje, "elm.text", (Edje_Text_Autocapital_Type)sd->autocapital_type);
+ (sd->entry_edje, "efl.text", (Edje_Text_Autocapital_Type)sd->autocapital_type);
edje_object_part_text_prediction_allow_set
- (sd->entry_edje, "elm.text", sd->prediction_allow);
+ (sd->entry_edje, "efl.text", sd->prediction_allow);
edje_object_part_text_input_hint_set
- (sd->entry_edje, "elm.text", (Edje_Input_Hints)sd->input_hints);
+ (sd->entry_edje, "efl.text", (Edje_Input_Hints)sd->input_hints);
edje_object_part_text_input_panel_enabled_set
- (sd->entry_edje, "elm.text", sd->input_panel_enable);
+ (sd->entry_edje, "efl.text", sd->input_panel_enable);
edje_object_part_text_input_panel_imdata_set
- (sd->entry_edje, "elm.text", sd->input_panel_imdata,
+ (sd->entry_edje, "efl.text", sd->input_panel_imdata,
sd->input_panel_imdata_len);
edje_object_part_text_input_panel_return_key_type_set
- (sd->entry_edje, "elm.text", (Edje_Input_Panel_Return_Key_Type)sd->input_panel_return_key_type);
+ (sd->entry_edje, "efl.text", (Edje_Input_Panel_Return_Key_Type)sd->input_panel_return_key_type);
edje_object_part_text_input_panel_return_key_disabled_set
- (sd->entry_edje, "elm.text", sd->input_panel_return_key_disabled);
+ (sd->entry_edje, "efl.text", sd->input_panel_return_key_disabled);
edje_object_part_text_input_panel_show_on_demand_set
- (sd->entry_edje, "elm.text", sd->input_panel_show_on_demand);
+ (sd->entry_edje, "efl.text", sd->input_panel_show_on_demand);
// elm_entry_cursor_pos_set -> cursor,changed -> widget_show_region_set
// -> smart_objects_calculate will call all smart calculate functions,
@@ -910,9 +912,9 @@ _efl_ui_text_elm_widget_theme_apply(Eo *obj, Efl_Ui_Text_Data *sd)
if (efl_ui_focus_object_focus_get(obj))
{
- edje_object_signal_emit(sd->entry_edje, "elm,action,focus", "elm");
+ edje_object_signal_emit(sd->entry_edje, "efl,action,focus", "efl");
if (sd->scroll)
- edje_object_signal_emit(sd->scr_edje, "elm,action,focus", "elm");
+ edje_object_signal_emit(sd->scr_edje, "efl,action,focus", "efl");
}
edje_object_message_signal_process(sd->entry_edje);
@@ -922,7 +924,7 @@ _efl_ui_text_elm_widget_theme_apply(Eo *obj, Efl_Ui_Text_Data *sd)
if (sd->scroll)
{
- elm_interface_scrollable_mirrored_set(obj, efl_ui_mirrored_get(obj));
+ efl_ui_mirrored_set(obj, efl_ui_mirrored_get(obj));
if (sd->single_line)
elm_widget_element_update(obj, sd->scr_edje, PART_NAME_SCROLLER);
@@ -955,7 +957,7 @@ _efl_ui_text_elm_widget_theme_apply(Eo *obj, Efl_Ui_Text_Data *sd)
_efl_ui_text_guide_update(obj, !sd->has_text);
efl_event_thaw(obj);
- efl_event_callback_call(obj, EFL_UI_LAYOUT_EVENT_THEME_CHANGED, NULL);
+ efl_event_callback_call(obj, EFL_UI_LAYOUT_OBJECT_EVENT_THEME_CHANGED, NULL);
evas_object_unref(obj);
@@ -989,7 +991,7 @@ _cursor_geometry_recalc(Evas_Object *obj)
edje_object_size_min_restricted_calc(sd->cursor, &cw, NULL, cw, 0);
evas_object_geometry_get(sd->entry_edje, &x, &y, &w, &h);
evas_object_geometry_get(
- edje_object_part_swallow_get(sd->entry_edje, "elm.text"),
+ edje_object_part_swallow_get(sd->entry_edje, "efl.text"),
&x2, &y2, &w2, &h2);
cx = cx + x - x2;
cy = cy + y - y2;
@@ -1006,7 +1008,7 @@ _layout_text_sizing_eval(Eo *obj, Evas_Coord tw, Evas_Coord th)
EFL_UI_TEXT_DATA_GET(obj, sd);
- sw = edje_object_part_swallow_get(sd->entry_edje, "elm.text");
+ sw = edje_object_part_swallow_get(sd->entry_edje, "efl.text");
if (sd->scroll)
{
Evas_Coord vw = 0, vh = 0;
@@ -1016,7 +1018,7 @@ _layout_text_sizing_eval(Eo *obj, Evas_Coord tw, Evas_Coord th)
evas_object_size_hint_min_set(sw, -1, -1);
if (vw > minw) minw = vw;
- efl_gfx_size_set(sd->entry_edje, EINA_SIZE2D(minw, minh));
+ efl_gfx_entity_size_set(sd->entry_edje, EINA_SIZE2D(minw, minh));
if (!efl_text_multiline_get(sw))
{
@@ -1071,7 +1073,7 @@ _efl_ui_text_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Text_Data *sd)
evas_object_geometry_get(obj, NULL, NULL, &resw, &resh);
- sw = edje_object_part_swallow_get(sd->entry_edje, "elm.text");
+ sw = edje_object_part_swallow_get(sd->entry_edje, "efl.text");
if (!sw) return;
if (!sd->changed && (resw == sd->ent_w) && (resh == sd->ent_h)) return;
@@ -1087,7 +1089,7 @@ _efl_ui_text_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Text_Data *sd)
{
Evas_Coord vw = 0, vh = 0;
elm_interface_scrollable_content_viewport_geometry_get(obj, NULL, NULL, &vw, &vh);
- efl_gfx_size_set(sd->entry_edje, EINA_SIZE2D(vw, vh));
+ efl_gfx_entity_size_set(sd->entry_edje, EINA_SIZE2D(vw, vh));
}
if (can_async)
{
@@ -1126,7 +1128,7 @@ _return_key_enabled_check(Evas_Object *obj)
}
EOLIAN static Eina_Bool
-_efl_ui_text_elm_widget_on_focus_update(Eo *obj, Efl_Ui_Text_Data *sd, Elm_Object_Item *item EINA_UNUSED)
+_efl_ui_text_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Text_Data *sd)
{
Evas_Object *top;
Eina_Bool top_is_win = EINA_FALSE;
@@ -1139,12 +1141,12 @@ _efl_ui_text_elm_widget_on_focus_update(Eo *obj, Efl_Ui_Text_Data *sd, Elm_Objec
if (efl_ui_focus_object_focus_get(obj))
{
- Eo *sw = edje_object_part_swallow_get(sd->entry_edje, "elm.text");
+ Eo *sw = edje_object_part_swallow_get(sd->entry_edje, "efl.text");
evas_object_focus_set(sw, EINA_TRUE);
- _edje_signal_emit(sd, "elm,action,focus", "elm");
+ _edje_signal_emit(sd, "efl,action,focus", "efl");
if (sd->scroll)
- edje_object_signal_emit(sd->scr_edje, "elm,action,focus", "elm");
+ edje_object_signal_emit(sd->scr_edje, "efl,action,focus", "efl");
if (top && top_is_win && sd->input_panel_enable && !sd->input_panel_show_on_demand)
elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON);
@@ -1155,11 +1157,11 @@ _efl_ui_text_elm_widget_on_focus_update(Eo *obj, Efl_Ui_Text_Data *sd, Elm_Objec
}
else
{
- Eo *sw = edje_object_part_swallow_get(sd->entry_edje, "elm.text");
+ Eo *sw = edje_object_part_swallow_get(sd->entry_edje, "efl.text");
- _edje_signal_emit(sd, "elm,action,unfocus", "elm");
+ _edje_signal_emit(sd, "efl,action,unfocus", "efl");
if (sd->scroll)
- edje_object_signal_emit(sd->scr_edje, "elm,action,unfocus", "elm");
+ edje_object_signal_emit(sd->scr_edje, "efl,action,unfocus", "efl");
evas_object_focus_set(sw, EINA_FALSE);
if (top && top_is_win && sd->input_panel_enable)
@@ -1173,19 +1175,19 @@ _efl_ui_text_elm_widget_on_focus_update(Eo *obj, Efl_Ui_Text_Data *sd, Elm_Objec
{
sd->sel_mode = EINA_FALSE;
elm_widget_scroll_hold_pop(obj);
- edje_object_part_text_select_allow_set(sd->entry_edje, "elm.text", EINA_FALSE);
- edje_object_signal_emit(sd->entry_edje, "elm,state,select,off", "elm");
- edje_object_part_text_select_none(sd->entry_edje, "elm.text");
+ edje_object_part_text_select_allow_set(sd->entry_edje, "efl.text", EINA_FALSE);
+ edje_object_signal_emit(sd->entry_edje, "efl,state,select,off", "efl");
+ edje_object_part_text_select_none(sd->entry_edje, "efl.text");
}
}
- edje_object_signal_emit(sd->scr_edje, "validation,default", "elm");
+ edje_object_signal_emit(sd->scr_edje, "validation,default", "efl");
}
return EINA_TRUE;
}
EOLIAN static Eina_Rect
-_efl_ui_text_elm_widget_interest_region_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
+_efl_ui_text_efl_ui_widget_interest_region_get(const Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
{
Evas_Coord edje_x, edje_y, elm_x, elm_y;
Eina_Rect r = {};
@@ -1220,19 +1222,19 @@ _show_region_hook(void *data EINA_UNUSED, Evas_Object *obj, Eina_Rect r)
}
EOLIAN static Eina_Bool
-_efl_ui_text_elm_widget_widget_sub_object_del(Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED, Evas_Object *sobj)
+_efl_ui_text_efl_ui_widget_widget_sub_object_del(Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED, Evas_Object *sobj)
{
Eina_Bool ret = EINA_FALSE;
/* unfortunately entry doesn't follow the signal pattern
* elm,state,icon,{visible,hidden}, so we have to replicate this
* smart function */
- if (sobj == elm_layout_content_get(obj, "elm.swallow.icon"))
+ if (sobj == elm_layout_content_get(obj, "efl.icon"))
{
- elm_layout_signal_emit(obj, "elm,action,hide,icon", "elm");
+ elm_layout_signal_emit(obj, "efl,action,hide,icon", "efl");
}
- else if (sobj == elm_layout_content_get(obj, "elm.swallow.end"))
+ else if (sobj == elm_layout_content_get(obj, "efl.end"))
{
- elm_layout_signal_emit(obj, "elm,action,hide,end", "elm");
+ elm_layout_signal_emit(obj, "efl,action,hide,end", "efl");
}
ret = elm_widget_sub_object_del(efl_super(obj, MY_CLASS), sobj);
@@ -1260,7 +1262,7 @@ _hoversel_position(Evas_Object *obj)
}
else
edje_object_part_text_cursor_geometry_get
- (sd->entry_edje, "elm.text", &cx, &cy, &cw, &ch);
+ (sd->entry_edje, "efl.text", &cx, &cy, &cw, &ch);
evas_object_size_hint_min_get(sd->hoversel, &mw, &mh);
if (cx + mw > w)
@@ -1293,7 +1295,7 @@ _hover_dismissed_cb(void *data, const Efl_Event *event EINA_UNUSED)
{
if (!sd->password)
edje_object_part_text_select_allow_set
- (sd->entry_edje, "elm.text", EINA_TRUE);
+ (sd->entry_edje, "efl.text", EINA_TRUE);
}
}
elm_widget_scroll_freeze_pop(data);
@@ -1311,15 +1313,15 @@ _hover_selected_cb(void *data,
if (!sd->sel_allow) return;
sd->sel_mode = EINA_TRUE;
- edje_object_part_text_select_none(sd->entry_edje, "elm.text");
+ edje_object_part_text_select_none(sd->entry_edje, "efl.text");
if (!_elm_config->desktop_entry)
{
if (!sd->password)
edje_object_part_text_select_allow_set
- (sd->entry_edje, "elm.text", EINA_TRUE);
+ (sd->entry_edje, "efl.text", EINA_TRUE);
}
- edje_object_signal_emit(sd->entry_edje, "elm,state,select,on", "elm");
+ edje_object_signal_emit(sd->entry_edje, "efl,state,select,on", "efl");
if (!_elm_config->desktop_entry)
elm_widget_scroll_hold_push(data);
@@ -1450,7 +1452,7 @@ _selection_store(Elm_Sel_Type seltype,
EFL_UI_TEXT_DATA_GET(obj, sd);
- efl_ui_text_interactive_selection_cursors_get(obj, &start, &end);
+ efl_text_interactive_selection_cursors_get(obj, &start, &end);
sel = efl_canvas_text_range_text_get(obj, start, end);
if ((!sel) || (!sel[0])) return; /* avoid deleting our own selection */
@@ -1475,14 +1477,14 @@ _cut_cb(Eo *obj)
sd->sel_mode = EINA_FALSE;
if (!_elm_config->desktop_entry)
edje_object_part_text_select_allow_set
- (sd->entry_edje, "elm.text", EINA_FALSE);
- edje_object_signal_emit(sd->entry_edje, "elm,state,select,off", "elm");
+ (sd->entry_edje, "efl.text", EINA_FALSE);
+ edje_object_signal_emit(sd->entry_edje, "efl,state,select,off", "efl");
if (!_elm_config->desktop_entry)
elm_widget_scroll_hold_pop(obj);
_selection_store(ELM_SEL_TYPE_CLIPBOARD, obj);
- efl_ui_text_interactive_selection_cursors_get(obj, &start, &end);
+ efl_text_interactive_selection_cursors_get(obj, &start, &end);
efl_canvas_text_range_delete(obj, start, end);
}
@@ -1504,8 +1506,8 @@ _copy_cb(Eo *obj)
if (!_elm_config->desktop_entry)
{
edje_object_part_text_select_allow_set
- (sd->entry_edje, "elm.text", EINA_FALSE);
- edje_object_signal_emit(sd->entry_edje, "elm,state,select,off", "elm");
+ (sd->entry_edje, "efl.text", EINA_FALSE);
+ edje_object_signal_emit(sd->entry_edje, "efl,state,select,off", "efl");
elm_widget_scroll_hold_pop(obj);
}
_selection_store(ELM_SEL_TYPE_CLIPBOARD, obj);
@@ -1529,11 +1531,11 @@ _hover_cancel_cb(void *data,
sd->sel_mode = EINA_FALSE;
if (!_elm_config->desktop_entry)
edje_object_part_text_select_allow_set
- (sd->entry_edje, "elm.text", EINA_FALSE);
- edje_object_signal_emit(sd->entry_edje, "elm,state,select,off", "elm");
+ (sd->entry_edje, "efl.text", EINA_FALSE);
+ edje_object_signal_emit(sd->entry_edje, "efl,state,select,off", "efl");
if (!_elm_config->desktop_entry)
elm_widget_scroll_hold_pop(data);
- edje_object_part_text_select_none(sd->entry_edje, "elm.text");
+ edje_object_part_text_select_none(sd->entry_edje, "efl.text");
}
static void
@@ -1658,8 +1660,8 @@ _menu_call(Evas_Object *obj)
if (!_elm_config->desktop_entry)
{
edje_object_part_text_select_allow_set
- (sd->entry_edje, "elm.text", EINA_FALSE);
- edje_object_part_text_select_abort(sd->entry_edje, "elm.text");
+ (sd->entry_edje, "efl.text", EINA_FALSE);
+ edje_object_part_text_select_abort(sd->entry_edje, "efl.text");
}
}
}
@@ -1696,7 +1698,7 @@ _magnifier_create(void *data)
_magnifier_proxy_update, data);
evas_object_event_callback_add(sd->mgf_proxy, EVAS_CALLBACK_MOVE,
_magnifier_proxy_update, data);
- edje_object_part_swallow(sd->mgf_bg, "elm.swallow.content", sd->mgf_proxy);
+ edje_object_part_swallow(sd->mgf_bg, "efl.content", sd->mgf_proxy);
evas_object_image_source_set(sd->mgf_proxy, data);
evas_object_geometry_get(data, NULL, NULL, &w, &h);
@@ -1729,7 +1731,7 @@ _magnifier_move(void *data)
double fx, fy, fw, fh;
double scale = _elm_config->magnifier_scale;
- edje_object_part_text_cursor_geometry_get(sd->entry_edje, "elm.text",
+ edje_object_part_text_cursor_geometry_get(sd->entry_edje, "efl.text",
&cx, &cy, NULL, &ch);
if (sd->scroll)
{
@@ -1805,7 +1807,7 @@ static void
_magnifier_hide(void *data)
{
EFL_UI_TEXT_DATA_GET(data, sd);
- edje_object_signal_emit(sd->mgf_bg, "elm,action,hide,magnifier", "elm");
+ edje_object_signal_emit(sd->mgf_bg, "efl,action,hide,magnifier", "efl");
elm_widget_scroll_freeze_pop(data);
evas_object_hide(sd->mgf_clip);
}
@@ -1814,7 +1816,7 @@ static void
_magnifier_show(void *data)
{
EFL_UI_TEXT_DATA_GET(data, sd);
- edje_object_signal_emit(sd->mgf_bg, "elm,action,show,magnifier", "elm");
+ edje_object_signal_emit(sd->mgf_bg, "efl,action,show,magnifier", "efl");
elm_widget_scroll_freeze_push(data);
evas_object_show(sd->mgf_clip);
}
@@ -1996,12 +1998,12 @@ _mouse_move_cb(void *data,
evas_object_geometry_get(sd->entry_edje, &x, &y, NULL, NULL);
rv = edje_object_part_text_cursor_coord_set
- (sd->entry_edje, "elm.text", EDJE_CURSOR_USER,
+ (sd->entry_edje, "efl.text", EDJE_CURSOR_USER,
ev->cur.canvas.x - x, ev->cur.canvas.y - y);
if (rv)
{
edje_object_part_text_cursor_copy
- (sd->entry_edje, "elm.text", EDJE_CURSOR_USER, EDJE_CURSOR_MAIN);
+ (sd->entry_edje, "efl.text", EDJE_CURSOR_USER, EDJE_CURSOR_MAIN);
}
else
WRN("Warning: Cannot move cursor");
@@ -2128,14 +2130,14 @@ _entry_changed_user_signal_cb(void *data,
atspi_info.content = edje_info->change.insert.content;
atspi_info.pos = edje_info->change.insert.pos;
atspi_info.len = edje_info->change.insert.plain_length;
- efl_access_event_emit(EFL_ACCESS_MIXIN, data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_INSERTED, &atspi_info);
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_INSERTED, &atspi_info);
}
else if (edje_info && !edje_info->insert)
{
atspi_info.content = edje_info->change.del.content;
atspi_info.pos = MIN(edje_info->change.del.start, edje_info->change.del.end);
atspi_info.len = MAX(edje_info->change.del.start, edje_info->change.del.end) - atspi_info.pos;
- efl_access_event_emit(EFL_ACCESS_MIXIN, data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_REMOVED, &atspi_info);
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_REMOVED, &atspi_info);
}
}
}
@@ -2175,22 +2177,22 @@ _entry_cursor_changed_signal_cb(void *data,
{
EFL_UI_TEXT_DATA_GET(data, sd);
sd->cursor_pos = edje_object_part_text_cursor_pos_get
- (sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN);
+ (sd->entry_edje, "efl.text", EDJE_CURSOR_MAIN);
sd->cur_changed = EINA_TRUE;
if (efl_ui_focus_object_focus_get(data))
{
- edje_object_signal_emit(sd->entry_edje, "elm,action,show,cursor", "elm");
+ edje_object_signal_emit(sd->entry_edje, "efl,action,show,cursor", "efl");
}
else
{
- edje_object_signal_emit(sd->entry_edje, "elm,action,hide,cursor", "elm");
+ edje_object_signal_emit(sd->entry_edje, "efl,action,hide,cursor", "efl");
}
sd->deferred_decoration_cursor = EINA_TRUE;
_decoration_defer(obj);
if (_elm_config->atspi_mode)
- efl_access_event_emit(EFL_ACCESS_MIXIN, data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_CARET_MOVED, NULL);
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_CARET_MOVED, NULL);
}
static void
@@ -2201,7 +2203,7 @@ _entry_cursor_changed_manual_signal_cb(void *data,
{
efl_event_callback_call(data, EFL_UI_TEXT_EVENT_CURSOR_CHANGED_MANUAL, NULL);
if (_elm_config->atspi_mode)
- efl_access_event_emit(EFL_ACCESS_MIXIN, data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_CARET_MOVED, NULL);
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_CARET_MOVED, NULL);
}
static void
@@ -2213,12 +2215,12 @@ _signal_anchor_geoms_do_things_with_lol(Efl_Ui_Text_Data *sd,
Evas_Coord px, py, x, y;
geoms = edje_object_part_text_anchor_geometry_get
- (sd->entry_edje, "elm.text", ei->name);
+ (sd->entry_edje, "efl.text", ei->name);
if (!geoms) return;
evas_object_geometry_get(
- edje_object_part_object_get(sd->entry_edje, "elm.text"),
+ edje_object_part_object_get(sd->entry_edje, "efl.text"),
&x, &y, NULL, NULL);
evas_pointer_canvas_xy_get
(evas_object_evas_get(sd->entry_edje), &px, &py);
@@ -2485,43 +2487,22 @@ _entry_mouse_triple_signal_cb(void *data,
static Evas_Object *
_item_get(void *data, const char *item)
{
- Eina_List *l;
- Evas_Object *o;
- Elm_Entry_Item_Provider *ip;
- const char *style = elm_widget_style_get(data);
+ Evas_Object *o = NULL;
EFL_UI_TEXT_DATA_GET(data, sd);
- EINA_LIST_FOREACH(sd->item_providers, l, ip)
- {
- o = ip->func(ip->data, data, item);
- if (o) return o;
- }
- if (item && !strncmp(item, "file://", 7))
+ if (item)
{
- const char *fname = item + 7;
-
- o = evas_object_image_filled_add(evas_object_evas_get(data));
- evas_object_image_file_set(o, fname, NULL);
- if (evas_object_image_load_error_get(o) == EVAS_LOAD_ERROR_NONE)
+ if (sd->item_factory)
{
- evas_object_show(o);
+ o = efl_canvas_text_factory_create(sd->item_factory, data, item);
}
- else
+ else if (sd->item_fallback_factory)
{
- evas_object_del(o);
- o = edje_object_add(evas_object_evas_get(data));
- elm_widget_theme_object_set
- (data, o, "text/emoticon", "wtf", style);
+ o = efl_canvas_text_factory_create(sd->item_fallback_factory,
+ data, item);
}
- return o;
}
-
- o = edje_object_add(evas_object_evas_get(data));
- if (!elm_widget_theme_object_set
- (data, o, "text", item, style))
- elm_widget_theme_object_set
- (data, o, "text/emoticon", "wtf", style);
return o;
}
@@ -2593,11 +2574,11 @@ _efl_ui_text_content_set(Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED, const char
if (!int_ret) return EINA_FALSE;
/* too bad entry does not follow the pattern
- * "elm,state,{icon,end},visible", we have to repeat ourselves */
- if (!part || !strcmp(part, "icon") || !strcmp(part, "elm.swallow.icon"))
+ * "efl,state,{icon,end},visible", we have to repeat ourselves */
+ if (!part || !strcmp(part, "icon") || !strcmp(part, "efl.icon"))
efl_ui_text_icon_visible_set(obj, EINA_TRUE);
- if (!part || !strcmp(part, "end") || !strcmp(part, "elm.swallow.end"))
+ if (!part || !strcmp(part, "end") || !strcmp(part, "efl.end"))
efl_ui_text_end_visible_set(obj, EINA_TRUE);
return EINA_TRUE;
@@ -2612,11 +2593,11 @@ _efl_ui_text_content_unset(Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED, const cha
if (!ret) return NULL;
/* too bad entry does not follow the pattern
- * "elm,state,{icon,end},hidden", we have to repeat ourselves */
- if (!part || !strcmp(part, "icon") || !strcmp(part, "elm.swallow.icon"))
+ * "efl,state,{icon,end},hidden", we have to repeat ourselves */
+ if (!part || !strcmp(part, "icon") || !strcmp(part, "efl.icon"))
efl_ui_text_icon_visible_set(obj, EINA_FALSE);
- if (!part || !strcmp(part, "end") || !strcmp(part, "elm.swallow.end"))
+ if (!part || !strcmp(part, "end") || !strcmp(part, "efl.end"))
efl_ui_text_end_visible_set(obj, EINA_FALSE);
return ret;
@@ -2759,12 +2740,12 @@ _start_handler_mouse_down_cb(void *data,
Efl_Text_Cursor_Cursor *sel_start, *sel_end;
Efl_Text_Cursor_Cursor *main_cur;
- Eo *text_obj = edje_object_part_swallow_get(sd->entry_edje, "elm.text");
+ Eo *text_obj = edje_object_part_swallow_get(sd->entry_edje, "efl.text");
sd->start_handler_down = EINA_TRUE;
/* Get the cursors */
- efl_ui_text_interactive_selection_cursors_get(text_obj, &sel_start, &sel_end);
+ efl_text_interactive_selection_cursors_get(text_obj, &sel_start, &sel_end);
main_cur = efl_text_cursor_get(text_obj, EFL_TEXT_CURSOR_GET_MAIN);
start_pos = efl_text_cursor_position_get(obj, sel_start);
@@ -2848,9 +2829,9 @@ _end_handler_mouse_down_cb(void *data,
sd->end_handler_down = EINA_TRUE;
- Eo *text_obj = edje_object_part_swallow_get(sd->entry_edje, "elm.text");
+ Eo *text_obj = edje_object_part_swallow_get(sd->entry_edje, "efl.text");
- efl_ui_text_interactive_selection_cursors_get(text_obj, &sel_start, &sel_end);
+ efl_text_interactive_selection_cursors_get(text_obj, &sel_start, &sel_end);
main_cur = efl_text_cursor_get(text_obj, EFL_TEXT_CURSOR_GET_MAIN);
start_pos = efl_text_cursor_position_get(obj, sel_start);
@@ -2947,13 +2928,13 @@ _create_selection_handlers(Evas_Object *obj, Efl_Ui_Text_Data *sd)
}
EOLIAN static void
-_efl_ui_text_efl_gfx_position_set(Eo *obj, Efl_Ui_Text_Data *sd, Eina_Position2D pos)
+_efl_ui_text_efl_gfx_entity_position_set(Eo *obj, Efl_Ui_Text_Data *sd, Eina_Position2D pos)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
- efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
- efl_gfx_position_set(sd->hit_rect, pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
+ efl_gfx_entity_position_set(sd->hit_rect, pos);
if (sd->hoversel) _hoversel_position(obj);
@@ -2961,24 +2942,24 @@ _efl_ui_text_efl_gfx_position_set(Eo *obj, Efl_Ui_Text_Data *sd, Eina_Position2D
}
EOLIAN static void
-_efl_ui_text_efl_gfx_size_set(Eo *obj, Efl_Ui_Text_Data *sd, Eina_Size2D sz)
+_efl_ui_text_efl_gfx_entity_size_set(Eo *obj, Efl_Ui_Text_Data *sd, Eina_Size2D sz)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
- efl_gfx_size_set(sd->hit_rect, sz);
+ efl_gfx_entity_size_set(sd->hit_rect, sz);
_update_selection_handler(obj);
- efl_gfx_size_set(efl_super(obj, MY_CLASS), sz);
+ efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
}
EOLIAN static void
-_efl_ui_text_efl_gfx_visible_set(Eo *obj, Efl_Ui_Text_Data *sd EINA_UNUSED, Eina_Bool vis)
+_efl_ui_text_efl_gfx_entity_visible_set(Eo *obj, Efl_Ui_Text_Data *sd EINA_UNUSED, Eina_Bool vis)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 0, vis))
return;
- efl_gfx_visible_set(efl_super(obj, MY_CLASS), vis);
+ efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), vis);
if (vis) _update_selection_handler(obj);
}
@@ -2994,9 +2975,10 @@ _efl_ui_text_efl_canvas_group_group_member_add(Eo *obj, Efl_Ui_Text_Data *sd, Ev
static void
_cb_added(void *data EINA_UNUSED, const Efl_Event *ev)
{
- const Efl_Callback_Array_Item *event = ev->info;
+ const Efl_Callback_Array_Item_Full *event = ev->info;
EFL_UI_TEXT_DATA_GET(ev->object, sd);
+ // XXX: BUG - not walking the array until a NULL entry
if (event->desc == EFL_UI_TEXT_EVENT_VALIDATE)
sd->validators++;
}
@@ -3004,9 +2986,10 @@ _cb_added(void *data EINA_UNUSED, const Efl_Event *ev)
static void
_cb_deleted(void *data EINA_UNUSED, const Efl_Event *ev)
{
- const Efl_Callback_Array_Item *event = ev->info;
+ const Efl_Callback_Array_Item_Full *event = ev->info;
EFL_UI_TEXT_DATA_GET(ev->object, sd);
+ // XXX: BUG - not walking the array until a NULL entry
if (event->desc == EFL_UI_TEXT_EVENT_VALIDATE)
sd->validators--;
return;
@@ -3027,7 +3010,7 @@ _efl_ui_text_efl_object_constructor(Eo *obj, Efl_Ui_Text_Data *sd)
elm_widget_sub_object_parent_add(obj);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_ENTRY);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_ENTRY);
efl_event_callback_add(obj, EFL_EVENT_CALLBACK_ADD, _cb_added, NULL);
efl_event_callback_add(obj, EFL_EVENT_CALLBACK_DEL, _cb_deleted, NULL);
@@ -3063,11 +3046,11 @@ _efl_ui_text_efl_object_constructor(Eo *obj, Efl_Ui_Text_Data *sd)
// For now, set this for easier setup
efl_text_font_set(text_obj, "Sans", 12);
efl_text_normal_color_set(text_obj, 255, 255, 255, 255);
- efl_ui_text_interactive_editable_set(obj, EINA_FALSE);
+ efl_text_interactive_editable_set(obj, EINA_FALSE);
sd->single_line = !efl_text_multiline_get(text_obj);
- edje_object_part_swallow(sd->entry_edje, "elm.text", text_obj);
+ edje_object_part_swallow(sd->entry_edje, "efl.text", text_obj);
evas_object_size_hint_weight_set
(sd->entry_edje, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set
@@ -3076,7 +3059,7 @@ _efl_ui_text_efl_object_constructor(Eo *obj, Efl_Ui_Text_Data *sd)
_efl_ui_text_changed_user_cb, obj);
efl_event_callback_add(text_obj, EFL_CANVAS_TEXT_EVENT_CHANGED,
_efl_ui_text_changed_cb, obj);
- efl_event_callback_add(text_obj, EFL_UI_TEXT_INTERACTIVE_EVENT_SELECTION_CHANGED,
+ efl_event_callback_add(text_obj, EFL_TEXT_INTERACTIVE_EVENT_SELECTION_CHANGED,
_efl_ui_text_selection_changed_cb, obj);
efl_event_callback_add(text_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED,
_efl_ui_text_cursor_changed_cb, obj);
@@ -3110,7 +3093,7 @@ _efl_ui_text_efl_object_constructor(Eo *obj, Efl_Ui_Text_Data *sd)
elm_interface_scrollable_objects_set(obj, sd->entry_edje, sd->hit_rect);
edje_object_text_markup_filter_callback_add
- (sd->entry_edje, "elm.text", _markup_filter_cb, obj);
+ (sd->entry_edje, "efl.text", _markup_filter_cb, obj);
evas_object_event_callback_add
(sd->entry_edje, EVAS_CALLBACK_KEY_DOWN, _key_down_cb, obj);
@@ -3125,56 +3108,56 @@ _efl_ui_text_efl_object_constructor(Eo *obj, Efl_Ui_Text_Data *sd)
evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize_cb, obj);
edje_object_signal_callback_add
- (sd->entry_edje, "entry,changed,user", "elm.text",
+ (sd->entry_edje, "entry,changed,user", "efl.text",
_entry_changed_user_signal_cb, obj);
edje_object_signal_callback_add
- (sd->entry_edje, "preedit,changed", "elm.text",
+ (sd->entry_edje, "preedit,changed", "efl.text",
_entry_preedit_changed_signal_cb, obj);
edje_object_signal_callback_add
- (sd->entry_edje, "cursor,changed", "elm.text",
+ (sd->entry_edje, "cursor,changed", "efl.text",
_entry_cursor_changed_signal_cb, obj);
edje_object_signal_callback_add
- (sd->entry_edje, "cursor,changed,manual", "elm.text",
+ (sd->entry_edje, "cursor,changed,manual", "efl.text",
_entry_cursor_changed_manual_signal_cb, obj);
edje_object_signal_callback_add
- (sd->entry_edje, "anchor,mouse,down,*", "elm.text",
+ (sd->entry_edje, "anchor,mouse,down,*", "efl.text",
_entry_anchor_down_signal_cb, obj);
edje_object_signal_callback_add
- (sd->entry_edje, "anchor,mouse,up,*", "elm.text",
+ (sd->entry_edje, "anchor,mouse,up,*", "efl.text",
_entry_anchor_up_signal_cb, obj);
edje_object_signal_callback_add
- (sd->entry_edje, "anchor,mouse,move,*", "elm.text",
+ (sd->entry_edje, "anchor,mouse,move,*", "efl.text",
_entry_anchor_move_signal_cb, obj);
edje_object_signal_callback_add
- (sd->entry_edje, "anchor,mouse,in,*", "elm.text",
+ (sd->entry_edje, "anchor,mouse,in,*", "efl.text",
_entry_anchor_in_signal_cb, obj);
edje_object_signal_callback_add
- (sd->entry_edje, "anchor,mouse,out,*", "elm.text",
+ (sd->entry_edje, "anchor,mouse,out,*", "efl.text",
_entry_anchor_out_signal_cb, obj);
edje_object_signal_callback_add
- (sd->entry_edje, "entry,key,enter", "elm.text",
+ (sd->entry_edje, "entry,key,enter", "efl.text",
_entry_key_enter_signal_cb, obj);
edje_object_signal_callback_add
- (sd->entry_edje, "entry,key,escape", "elm.text",
+ (sd->entry_edje, "entry,key,escape", "efl.text",
_entry_key_escape_signal_cb, obj);
edje_object_signal_callback_add
- (sd->entry_edje, "mouse,down,1", "elm.text",
+ (sd->entry_edje, "mouse,down,1", "efl.text",
_entry_mouse_down_signal_cb, obj);
edje_object_signal_callback_add
- (sd->entry_edje, "mouse,clicked,1", "elm.text",
+ (sd->entry_edje, "mouse,clicked,1", "efl.text",
_entry_mouse_clicked_signal_cb, obj);
edje_object_signal_callback_add
- (sd->entry_edje, "mouse,down,1,double", "elm.text",
+ (sd->entry_edje, "mouse,down,1,double", "efl.text",
_entry_mouse_double_signal_cb, obj);
edje_object_signal_callback_add
- (sd->entry_edje, "mouse,down,1,triple", "elm.text",
+ (sd->entry_edje, "mouse,down,1,triple", "efl.text",
_entry_mouse_triple_signal_cb, obj);
edje_object_signal_callback_add
- (sd->entry_edje, "entry,undo,request", "elm.text",
+ (sd->entry_edje, "entry,undo,request", "efl.text",
_entry_undo_request_signal_cb, obj);
edje_object_signal_callback_add
- (sd->entry_edje, "entry,redo,request", "elm.text",
+ (sd->entry_edje, "entry,redo,request", "efl.text",
_entry_redo_request_signal_cb, obj);
efl_text_set(sd->text_obj, "");
@@ -3184,7 +3167,7 @@ _efl_ui_text_efl_object_constructor(Eo *obj, Efl_Ui_Text_Data *sd)
elm_widget_can_focus_set(obj, EINA_TRUE);
if (_elm_config->desktop_entry)
edje_object_part_text_select_allow_set
- (sd->entry_edje, "elm.text", EINA_TRUE);
+ (sd->entry_edje, "efl.text", EINA_TRUE);
efl_ui_text_input_panel_layout_set(obj, ELM_INPUT_PANEL_LAYOUT_NORMAL);
efl_ui_text_input_panel_enabled_set(obj, EINA_TRUE);
@@ -3192,7 +3175,7 @@ _efl_ui_text_efl_object_constructor(Eo *obj, Efl_Ui_Text_Data *sd)
efl_ui_text_input_hint_set(obj, ELM_INPUT_HINT_AUTO_COMPLETE);
sd->autocapital_type = (Elm_Autocapital_Type)edje_object_part_text_autocapital_type_get
- (sd->entry_edje, "elm.text");
+ (sd->entry_edje, "efl.text");
entries = eina_list_prepend(entries, obj);
@@ -3215,6 +3198,7 @@ _efl_ui_text_efl_object_constructor(Eo *obj, Efl_Ui_Text_Data *sd)
if (_elm_config->desktop_entry)
sd->sel_handler_disabled = EINA_TRUE;
+ sd->item_fallback_factory = efl_add(EFL_UI_TEXT_FACTORY_FALLBACK_CLASS, obj);
_create_text_cursors(obj, sd);
return obj;
@@ -3224,7 +3208,6 @@ EOLIAN static void
_efl_ui_text_efl_object_destructor(Eo *obj, Efl_Ui_Text_Data *sd)
{
Elm_Entry_Context_Menu_Item *it;
- Elm_Entry_Item_Provider *ip;
Elm_Entry_Markup_Filter *tf;
Eo *text_obj;
@@ -3270,10 +3253,6 @@ _efl_ui_text_efl_object_destructor(Eo *obj, Efl_Ui_Text_Data *sd)
eina_stringshare_del(it->icon_group);
free(it);
}
- EINA_LIST_FREE(sd->item_providers, ip)
- {
- free(ip);
- }
EINA_LIST_FREE(sd->markup_filters, tf)
{
_filter_free(tf);
@@ -3294,12 +3273,12 @@ _efl_ui_text_efl_object_destructor(Eo *obj, Efl_Ui_Text_Data *sd)
_unused_item_objs_free(sd);
_clear_text_selection(sd);
- text_obj = edje_object_part_swallow_get(sd->entry_edje, "elm.text");
+ text_obj = edje_object_part_swallow_get(sd->entry_edje, "efl.text");
efl_event_callback_del(text_obj, EFL_UI_TEXT_EVENT_CHANGED_USER,
_efl_ui_text_changed_user_cb, obj);
efl_event_callback_del(text_obj, EFL_CANVAS_TEXT_EVENT_CHANGED,
_efl_ui_text_changed_cb, obj);
- efl_event_callback_del(text_obj, EFL_UI_TEXT_INTERACTIVE_EVENT_SELECTION_CHANGED,
+ efl_event_callback_del(text_obj, EFL_TEXT_INTERACTIVE_EVENT_SELECTION_CHANGED,
_efl_ui_text_selection_changed_cb, obj);
efl_event_callback_del(text_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED,
_efl_ui_text_cursor_changed_cb, obj);
@@ -3314,11 +3293,14 @@ _efl_ui_text_efl_object_destructor(Eo *obj, Efl_Ui_Text_Data *sd)
ecore_job_del(sd->deferred_decoration_job);
sd->deferred_decoration_job = NULL;
+ if (sd->item_factory) efl_unref(sd->item_factory);
+ if (sd->item_fallback_factory) efl_del(sd->item_fallback_factory);
+
efl_destructor(efl_super(obj, MY_CLASS));
}
EOLIAN static void
-_efl_ui_text_password_set(Eo *obj, Efl_Ui_Text_Data *sd, Eina_Bool password)
+_efl_ui_text_password_mode_set(Eo *obj, Efl_Ui_Text_Data *sd, Eina_Bool password)
{
password = !!password;
@@ -3335,7 +3317,7 @@ _efl_ui_text_password_set(Eo *obj, Efl_Ui_Text_Data *sd, Eina_Bool password)
sd->single_line = EINA_TRUE;
sd->line_wrap = ELM_WRAP_NONE;
efl_ui_text_input_hint_set(obj, ((sd->input_hints & ~ELM_INPUT_HINT_AUTO_COMPLETE) | ELM_INPUT_HINT_SENSITIVE_DATA));
- efl_access_role_set(obj, EFL_ACCESS_ROLE_PASSWORD_TEXT);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_PASSWORD_TEXT);
}
else
{
@@ -3347,14 +3329,14 @@ _efl_ui_text_password_set(Eo *obj, Efl_Ui_Text_Data *sd, Eina_Bool password)
_dnd_drop_cb, NULL);
efl_ui_text_input_hint_set(obj, ((sd->input_hints | ELM_INPUT_HINT_AUTO_COMPLETE) & ~ELM_INPUT_HINT_SENSITIVE_DATA));
- efl_access_role_set(obj, EFL_ACCESS_ROLE_ENTRY);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_ENTRY);
}
efl_ui_widget_theme_apply(obj);
}
EOLIAN static Eina_Bool
-_efl_ui_text_password_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
+_efl_ui_text_password_mode_get(const Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
{
return sd->password;
}
@@ -3368,13 +3350,13 @@ _efl_ui_text_calc_force(Eo *obj, Efl_Ui_Text_Data *sd)
}
static const char*
-_efl_ui_text_selection_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
+_efl_ui_text_selection_get(const Eo *obj, Efl_Ui_Text_Data *sd)
{
Efl_Text_Cursor_Cursor *start_obj, *end_obj;
if ((sd->password)) return NULL;
- efl_ui_text_interactive_selection_cursors_get(obj, &start_obj, &end_obj);
+ efl_text_interactive_selection_cursors_get(obj, &start_obj, &end_obj);
return efl_canvas_text_range_text_get(obj, start_obj, end_obj);
}
@@ -3386,7 +3368,7 @@ _efl_ui_text_selection_handler_disabled_set(Eo *obj EINA_UNUSED, Efl_Ui_Text_Dat
}
EOLIAN static Eina_Bool
-_efl_ui_text_selection_handler_disabled_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
+_efl_ui_text_selection_handler_disabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
{
return sd->sel_handler_disabled;
}
@@ -3401,9 +3383,9 @@ _efl_ui_text_entry_insert(Eo *obj, Efl_Ui_Text_Data *sd, const char *entry)
}
EOLIAN static void
-_efl_ui_text_efl_ui_text_interactive_editable_set(Eo *obj, Efl_Ui_Text_Data *sd, Eina_Bool editable)
+_efl_ui_text_efl_text_interactive_editable_set(Eo *obj, Efl_Ui_Text_Data *sd, Eina_Bool editable)
{
- efl_ui_text_interactive_editable_set(efl_super(obj, MY_CLASS), editable);
+ efl_text_interactive_editable_set(efl_super(obj, MY_CLASS), editable);
if (sd->editable == editable) return;
sd->editable = editable;
efl_ui_widget_theme_apply(obj);
@@ -3443,14 +3425,14 @@ _efl_ui_text_select_none(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
sd->sel_mode = EINA_FALSE;
if (!_elm_config->desktop_entry)
edje_object_part_text_select_allow_set
- (sd->entry_edje, "elm.text", EINA_FALSE);
- edje_object_signal_emit(sd->entry_edje, "elm,state,select,off", "elm");
+ (sd->entry_edje, "efl.text", EINA_FALSE);
+ edje_object_signal_emit(sd->entry_edje, "efl,state,select,off", "efl");
}
if (sd->have_selection)
efl_event_callback_call(obj, EFL_UI_EVENT_SELECTION_CLEARED, NULL);
sd->have_selection = EINA_FALSE;
- edje_object_part_text_select_none(sd->entry_edje, "elm.text");
+ edje_object_part_text_select_none(sd->entry_edje, "efl.text");
_hide_selection_handler(obj);
}
@@ -3462,7 +3444,7 @@ _efl_ui_text_select_region_set(Eo *obj, Efl_Ui_Text_Data *sd, int start, int end
if ((sd->password)) return;
- efl_ui_text_interactive_selection_cursors_get(obj, &sel_start, &sel_end);
+ efl_text_interactive_selection_cursors_get(obj, &sel_start, &sel_end);
efl_text_cursor_position_set(obj, sel_start, start);
efl_text_cursor_position_set(obj, sel_end, end);
@@ -3471,7 +3453,7 @@ _efl_ui_text_select_region_set(Eo *obj, Efl_Ui_Text_Data *sd, int start, int end
EOLIAN static void
_efl_ui_text_cursor_selection_end(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
{
- edje_object_part_text_select_extend(sd->entry_edje, "elm.text");
+ edje_object_part_text_select_extend(sd->entry_edje, "efl.text");
}
EOLIAN static void
@@ -3534,60 +3516,11 @@ _efl_ui_text_context_menu_disabled_set(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd
}
EOLIAN static Eina_Bool
-_efl_ui_text_context_menu_disabled_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
+_efl_ui_text_context_menu_disabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
{
return !sd->context_menu;
}
-EOLIAN static void
-_efl_ui_text_item_provider_append(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd, Elm_Entry_Item_Provider_Cb func, void *data)
-{
- Elm_Entry_Item_Provider *ip;
-
- EINA_SAFETY_ON_NULL_RETURN(func);
-
- ip = calloc(1, sizeof(Elm_Entry_Item_Provider));
- if (!ip) return;
-
- ip->func = func;
- ip->data = data;
- sd->item_providers = eina_list_append(sd->item_providers, ip);
-}
-
-EOLIAN static void
-_efl_ui_text_item_provider_prepend(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd, Elm_Entry_Item_Provider_Cb func, void *data)
-{
- Elm_Entry_Item_Provider *ip;
-
- EINA_SAFETY_ON_NULL_RETURN(func);
-
- ip = calloc(1, sizeof(Elm_Entry_Item_Provider));
- if (!ip) return;
-
- ip->func = func;
- ip->data = data;
- sd->item_providers = eina_list_prepend(sd->item_providers, ip);
-}
-
-EOLIAN static void
-_efl_ui_text_item_provider_remove(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd, Elm_Entry_Item_Provider_Cb func, void *data)
-{
- Eina_List *l;
- Elm_Entry_Item_Provider *ip;
-
- EINA_SAFETY_ON_NULL_RETURN(func);
-
- EINA_LIST_FOREACH(sd->item_providers, l, ip)
- {
- if ((ip->func == func) && ((!data) || (ip->data == data)))
- {
- sd->item_providers = eina_list_remove_list(sd->item_providers, l);
- free(ip);
- return;
- }
- }
-}
-
EOLIAN static Eina_Bool
_efl_ui_text_efl_file_file_set(Eo *obj, Efl_Ui_Text_Data *sd, const char *file, const char *group EINA_UNUSED)
{
@@ -3599,31 +3532,43 @@ _efl_ui_text_efl_file_file_set(Eo *obj, Efl_Ui_Text_Data *sd, const char *file,
}
EOLIAN static void
-_efl_ui_text_efl_file_file_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd, const char **file, const char **group)
+_efl_ui_text_efl_file_file_get(const Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd, const char **file, const char **group)
{
if (file) *file = sd->file;
if (group) *group = NULL;
}
EOLIAN static void
-_efl_ui_text_cnp_mode_set(Eo *obj, Efl_Ui_Text_Data *sd, Elm_Cnp_Mode cnp_mode)
+_efl_ui_text_cnp_mode_set(Eo *obj, Efl_Ui_Text_Data *sd, Efl_Selection_Format cnp_mode)
{
- Elm_Sel_Format format = ELM_SEL_FORMAT_MARKUP;
+ /* FIXME: CnP format handling really odd... */
+ Elm_Sel_Format dnd_format = ELM_SEL_FORMAT_MARKUP;
+ Elm_Sel_Format cnp_format = cnp_mode;
- if (sd->cnp_mode == cnp_mode) return;
- sd->cnp_mode = cnp_mode;
- if (sd->cnp_mode == ELM_CNP_MODE_PLAINTEXT)
- format = ELM_SEL_FORMAT_TEXT;
- else if (cnp_mode == ELM_CNP_MODE_MARKUP)
- format |= ELM_SEL_FORMAT_IMAGE;
+ if (cnp_mode != EFL_SELECTION_FORMAT_TARGETS)
+ {
+ if (cnp_mode & EFL_SELECTION_FORMAT_VCARD)
+ ERR("VCARD format not supported for copy & paste!");
+ else if (cnp_mode & EFL_SELECTION_FORMAT_HTML)
+ ERR("HTML format not supported for copy & paste!");
+ cnp_mode &= ~EFL_SELECTION_FORMAT_VCARD;
+ cnp_mode &= ~EFL_SELECTION_FORMAT_HTML;
+ }
+
+ if (sd->cnp_mode == cnp_format) return;
+ sd->cnp_mode = cnp_format;
+ if (sd->cnp_mode == EFL_SELECTION_FORMAT_TEXT)
+ dnd_format = ELM_SEL_FORMAT_TEXT;
+ else if (cnp_mode == EFL_SELECTION_FORMAT_IMAGE)
+ dnd_format |= ELM_SEL_FORMAT_IMAGE;
elm_drop_target_del(obj, sd->drop_format,
_dnd_enter_cb, NULL,
_dnd_leave_cb, NULL,
_dnd_pos_cb, NULL,
_dnd_drop_cb, NULL);
- sd->drop_format = format;
+ sd->drop_format = dnd_format;
elm_drop_target_add(obj, sd->drop_format,
_dnd_enter_cb, NULL,
_dnd_leave_cb, NULL,
@@ -3631,8 +3576,8 @@ _efl_ui_text_cnp_mode_set(Eo *obj, Efl_Ui_Text_Data *sd, Elm_Cnp_Mode cnp_mode)
_dnd_drop_cb, NULL);
}
-EOLIAN static Elm_Cnp_Mode
-_efl_ui_text_cnp_mode_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
+EOLIAN static Efl_Selection_Format
+_efl_ui_text_cnp_mode_get(const Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
{
return sd->cnp_mode;
}
@@ -3720,7 +3665,7 @@ _efl_ui_text_scrollable_set(Eo *obj, Efl_Ui_Text_Data *sd, Eina_Bool scroll)
}
EOLIAN static Eina_Bool
-_efl_ui_text_scrollable_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
+_efl_ui_text_scrollable_get(const Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
{
return sd->scroll;
}
@@ -3747,7 +3692,7 @@ _efl_ui_text_input_panel_layout_set(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd, E
sd->input_panel_layout = layout;
edje_object_part_text_input_panel_layout_set
- (sd->entry_edje, "elm.text", (Edje_Input_Panel_Layout)layout);
+ (sd->entry_edje, "efl.text", (Edje_Input_Panel_Layout)layout);
if (layout == ELM_INPUT_PANEL_LAYOUT_PASSWORD)
efl_ui_text_input_hint_set(obj, ((sd->input_hints & ~ELM_INPUT_HINT_AUTO_COMPLETE) | ELM_INPUT_HINT_SENSITIVE_DATA));
@@ -3756,7 +3701,7 @@ _efl_ui_text_input_panel_layout_set(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd, E
}
EOLIAN static Elm_Input_Panel_Layout
-_efl_ui_text_input_panel_layout_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
+_efl_ui_text_input_panel_layout_get(const Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
{
return sd->input_panel_layout;
}
@@ -3767,11 +3712,11 @@ _efl_ui_text_input_panel_layout_variation_set(Eo *obj EINA_UNUSED, Efl_Ui_Text_D
sd->input_panel_layout_variation = variation;
edje_object_part_text_input_panel_layout_variation_set
- (sd->entry_edje, "elm.text", variation);
+ (sd->entry_edje, "efl.text", variation);
}
EOLIAN static int
-_efl_ui_text_input_panel_layout_variation_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
+_efl_ui_text_input_panel_layout_variation_get(const Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
{
return sd->input_panel_layout_variation;
}
@@ -3781,11 +3726,11 @@ _efl_ui_text_autocapital_type_set(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd, Elm
{
sd->autocapital_type = autocapital_type;
edje_object_part_text_autocapital_type_set
- (sd->entry_edje, "elm.text", (Edje_Text_Autocapital_Type)autocapital_type);
+ (sd->entry_edje, "efl.text", (Edje_Text_Autocapital_Type)autocapital_type);
}
EOLIAN static Elm_Autocapital_Type
-_efl_ui_text_autocapital_type_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
+_efl_ui_text_autocapital_type_get(const Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
{
return sd->autocapital_type;
}
@@ -3795,11 +3740,11 @@ _efl_ui_text_prediction_allow_set(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd, Ein
{
sd->prediction_allow = prediction;
edje_object_part_text_prediction_allow_set
- (sd->entry_edje, "elm.text", prediction);
+ (sd->entry_edje, "efl.text", prediction);
}
EOLIAN static Eina_Bool
-_efl_ui_text_prediction_allow_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
+_efl_ui_text_prediction_allow_get(const Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
{
return sd->prediction_allow;
}
@@ -3810,11 +3755,11 @@ _efl_ui_text_input_hint_set(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd, Elm_Input
sd->input_hints = hints;
edje_object_part_text_input_hint_set
- (sd->entry_edje, "elm.text", (Edje_Input_Hints)hints);
+ (sd->entry_edje, "efl.text", (Edje_Input_Hints)hints);
}
EOLIAN static Elm_Input_Hints
-_efl_ui_text_input_hint_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
+_efl_ui_text_input_hint_get(const Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
{
return sd->input_hints;
}
@@ -3824,11 +3769,11 @@ _efl_ui_text_input_panel_enabled_set(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd,
{
sd->input_panel_enable = enabled;
edje_object_part_text_input_panel_enabled_set
- (sd->entry_edje, "elm.text", enabled);
+ (sd->entry_edje, "efl.text", enabled);
}
EOLIAN static Eina_Bool
-_efl_ui_text_input_panel_enabled_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
+_efl_ui_text_input_panel_enabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
{
return sd->input_panel_enable;
}
@@ -3836,14 +3781,14 @@ _efl_ui_text_input_panel_enabled_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
EOLIAN static void
_efl_ui_text_input_panel_show(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
{
- edje_object_part_text_input_panel_show(sd->entry_edje, "elm.text");
+ edje_object_part_text_input_panel_show(sd->entry_edje, "efl.text");
}
EOLIAN static void
_efl_ui_text_input_panel_hide(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
{
- edje_object_part_text_input_panel_hide(sd->entry_edje, "elm.text");
+ edje_object_part_text_input_panel_hide(sd->entry_edje, "efl.text");
}
EOLIAN static void
@@ -3851,11 +3796,11 @@ _efl_ui_text_input_panel_language_set(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd,
{
sd->input_panel_lang = lang;
edje_object_part_text_input_panel_language_set
- (sd->entry_edje, "elm.text", (Edje_Input_Panel_Lang)lang);
+ (sd->entry_edje, "efl.text", (Edje_Input_Panel_Lang)lang);
}
EOLIAN static Elm_Input_Panel_Lang
-_efl_ui_text_input_panel_language_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
+_efl_ui_text_input_panel_language_get(const Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
{
return sd->input_panel_lang;
}
@@ -3870,7 +3815,7 @@ _efl_ui_text_input_panel_imdata_set(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd, c
memcpy(sd->input_panel_imdata, data, len);
edje_object_part_text_input_panel_imdata_set
- (sd->entry_edje, "elm.text", sd->input_panel_imdata,
+ (sd->entry_edje, "efl.text", sd->input_panel_imdata,
sd->input_panel_imdata_len);
}
@@ -3878,7 +3823,7 @@ EOLIAN static void
_efl_ui_text_input_panel_imdata_get(const Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd, void *data, int *len)
{
edje_object_part_text_input_panel_imdata_get
- (sd->entry_edje, "elm.text", data, len);
+ (sd->entry_edje, "efl.text", data, len);
}
EOLIAN static void
@@ -3887,11 +3832,11 @@ _efl_ui_text_input_panel_return_key_type_set(Eo *obj EINA_UNUSED, Efl_Ui_Text_Da
sd->input_panel_return_key_type = return_key_type;
edje_object_part_text_input_panel_return_key_type_set
- (sd->entry_edje, "elm.text", (Edje_Input_Panel_Return_Key_Type)return_key_type);
+ (sd->entry_edje, "efl.text", (Edje_Input_Panel_Return_Key_Type)return_key_type);
}
EOLIAN static Elm_Input_Panel_Return_Key_Type
-_efl_ui_text_input_panel_return_key_type_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
+_efl_ui_text_input_panel_return_key_type_get(const Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
{
return sd->input_panel_return_key_type;
}
@@ -3902,11 +3847,11 @@ _efl_ui_text_input_panel_return_key_disabled_set(Eo *obj EINA_UNUSED, Efl_Ui_Tex
sd->input_panel_return_key_disabled = disabled;
edje_object_part_text_input_panel_return_key_disabled_set
- (sd->entry_edje, "elm.text", disabled);
+ (sd->entry_edje, "efl.text", disabled);
}
EOLIAN static Eina_Bool
-_efl_ui_text_input_panel_return_key_disabled_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
+_efl_ui_text_input_panel_return_key_disabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
{
return sd->input_panel_return_key_disabled;
}
@@ -3924,11 +3869,11 @@ _efl_ui_text_input_panel_show_on_demand_set(Eo *obj EINA_UNUSED, Efl_Ui_Text_Dat
sd->input_panel_show_on_demand = ondemand;
edje_object_part_text_input_panel_show_on_demand_set
- (sd->entry_edje, "elm.text", ondemand);
+ (sd->entry_edje, "efl.text", ondemand);
}
EOLIAN static Eina_Bool
-_efl_ui_text_input_panel_show_on_demand_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
+_efl_ui_text_input_panel_show_on_demand_get(const Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
{
return sd->input_panel_show_on_demand;
}
@@ -3968,7 +3913,7 @@ _efl_ui_text_anchor_hover_end(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
/* END - ANCHOR HOVER */
EOLIAN static Eina_Bool
-_efl_ui_text_elm_widget_on_access_activate(Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED, Efl_Ui_Activate act)
+_efl_ui_text_efl_ui_widget_on_access_activate(Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED, Efl_Ui_Activate act)
{
if (act != EFL_UI_ACTIVATE_DEFAULT) return EINA_FALSE;
@@ -3979,7 +3924,7 @@ _efl_ui_text_elm_widget_on_access_activate(Eo *obj, Efl_Ui_Text_Data *_pd EINA_U
{
efl_event_callback_call(obj, EFL_UI_EVENT_CLICKED, NULL);
if (sd->editable && sd->input_panel_enable)
- edje_object_part_text_input_panel_show(sd->entry_edje, "elm.text");
+ edje_object_part_text_input_panel_show(sd->entry_edje, "efl.text");
}
return EINA_TRUE;
}
@@ -3987,7 +3932,7 @@ _efl_ui_text_elm_widget_on_access_activate(Eo *obj, Efl_Ui_Text_Data *_pd EINA_U
// ATSPI Accessibility
EOLIAN static Eina_Unicode
-_efl_ui_text_efl_access_text_character_get(Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED, int offset)
+_efl_ui_text_efl_access_text_character_get(const Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED, int offset)
{
const char *txt;
int idx = 0;
@@ -4006,7 +3951,7 @@ _efl_ui_text_efl_access_text_character_get(Eo *obj, Efl_Ui_Text_Data *_pd EINA_U
}
EOLIAN static int
-_efl_ui_text_efl_access_text_character_count_get(Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED)
+_efl_ui_text_efl_access_text_character_count_get(const Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED)
{
const char *txt;
@@ -4016,11 +3961,11 @@ _efl_ui_text_efl_access_text_character_count_get(Eo *obj, Efl_Ui_Text_Data *_pd
}
EOLIAN static char*
-_efl_ui_text_efl_access_text_string_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *pd, Efl_Access_Text_Granularity granularity, int *start_offset, int *end_offset)
+_efl_ui_text_efl_access_text_string_get(const Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *pd, Efl_Access_Text_Granularity granularity, int *start_offset, int *end_offset)
{
Evas_Textblock_Cursor *cur = NULL, *cur2 = NULL;
char *ret = NULL;
- Eo *text_obj = edje_object_part_swallow_get(pd->entry_edje, "elm.text");
+ Eo *text_obj = edje_object_part_swallow_get(pd->entry_edje, "efl.text");
cur = evas_object_textblock_cursor_new(text_obj);
cur2 = evas_object_textblock_cursor_new(text_obj);
@@ -4098,11 +4043,11 @@ fail:
}
EOLIAN static char*
-_efl_ui_text_efl_access_text_text_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *pd EINA_UNUSED, int start_offset, int end_offset)
+_efl_ui_text_efl_access_text_access_text_get(const Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *pd EINA_UNUSED, int start_offset, int end_offset)
{
Evas_Textblock_Cursor *cur = NULL, *cur2 = NULL;
char *ret = NULL;
- Eo *text_obj = edje_object_part_swallow_get(pd->entry_edje, "elm.text");
+ Eo *text_obj = edje_object_part_swallow_get(pd->entry_edje, "efl.text");
cur = evas_object_textblock_cursor_new(text_obj);
cur2 = evas_object_textblock_cursor_new(text_obj);
@@ -4135,7 +4080,7 @@ fail:
}
EOLIAN static int
-_efl_ui_text_efl_access_text_caret_offset_get(Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED)
+_efl_ui_text_efl_access_text_caret_offset_get(const Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED)
{
return efl_text_cursor_position_get(obj, efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN));
}
@@ -4148,13 +4093,13 @@ _efl_ui_text_efl_access_text_caret_offset_set(Eo *obj, Efl_Ui_Text_Data *_pd EIN
}
EOLIAN static int
-_efl_ui_text_efl_access_text_selections_count_get(Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED)
+_efl_ui_text_efl_access_text_selections_count_get(const Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED)
{
return _efl_ui_text_selection_get(obj, _pd) ? 1 : 0;
}
EOLIAN static void
-_efl_ui_text_efl_access_text_selection_get(Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED, int selection_number, int *start_offset, int *end_offset)
+_efl_ui_text_efl_access_text_access_selection_get(const Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED, int selection_number, int *start_offset, int *end_offset)
{
if (selection_number != 0) return;
@@ -4162,7 +4107,7 @@ _efl_ui_text_efl_access_text_selection_get(Eo *obj, Efl_Ui_Text_Data *_pd EINA_U
}
EOLIAN static Eina_Bool
-_efl_ui_text_efl_access_text_selection_set(Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED, int selection_number, int start_offset, int end_offset)
+_efl_ui_text_efl_access_text_access_selection_set(Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED, int selection_number, int start_offset, int end_offset)
{
if (selection_number != 0) return EINA_FALSE;
@@ -4188,17 +4133,17 @@ _efl_ui_text_efl_access_text_selection_add(Eo *obj, Efl_Ui_Text_Data *pd EINA_UN
}
EOLIAN static Eina_List*
-_efl_ui_text_efl_access_text_bounded_ranges_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *_pd EINA_UNUSED, Eina_Bool screen_coods EINA_UNUSED, Eina_Rect rect EINA_UNUSED, Efl_Access_Text_Clip_Type xclip EINA_UNUSED, Efl_Access_Text_Clip_Type yclip EINA_UNUSED)
+_efl_ui_text_efl_access_text_bounded_ranges_get(const Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *_pd EINA_UNUSED, Eina_Bool screen_coods EINA_UNUSED, Eina_Rect rect EINA_UNUSED, Efl_Access_Text_Clip_Type xclip EINA_UNUSED, Efl_Access_Text_Clip_Type yclip EINA_UNUSED)
{
return NULL;
}
EOLIAN static int
-_efl_ui_text_efl_access_text_offset_at_point_get(Eo *obj, Efl_Ui_Text_Data *pd EINA_UNUSED, Eina_Bool screen_coods, int x, int y)
+_efl_ui_text_efl_access_text_offset_at_point_get(const Eo *obj, Efl_Ui_Text_Data *pd EINA_UNUSED, Eina_Bool screen_coods, int x, int y)
{
Evas_Textblock_Cursor *cur;
int ret;
- Eo *text_obj = edje_object_part_swallow_get(pd->entry_edje, "elm.text");
+ Eo *text_obj = edje_object_part_swallow_get(pd->entry_edje, "efl.text");
if (!text_obj) return -1;
@@ -4227,11 +4172,11 @@ _efl_ui_text_efl_access_text_offset_at_point_get(Eo *obj, Efl_Ui_Text_Data *pd E
}
EOLIAN static Eina_Bool
-_efl_ui_text_efl_access_text_character_extents_get(Eo *obj, Efl_Ui_Text_Data *pd EINA_UNUSED, int offset, Eina_Bool screen_coods, Eina_Rect *rect)
+_efl_ui_text_efl_access_text_character_extents_get(const Eo *obj, Efl_Ui_Text_Data *pd EINA_UNUSED, int offset, Eina_Bool screen_coods, Eina_Rect *rect)
{
Evas_Textblock_Cursor *cur;
int ret;
- Eo *text_obj = edje_object_part_swallow_get(pd->entry_edje, "elm.text");
+ Eo *text_obj = edje_object_part_swallow_get(pd->entry_edje, "efl.text");
if (!text_obj) return EINA_FALSE;
@@ -4258,12 +4203,12 @@ _efl_ui_text_efl_access_text_character_extents_get(Eo *obj, Efl_Ui_Text_Data *pd
}
EOLIAN static Eina_Bool
-_efl_ui_text_efl_access_text_range_extents_get(Eo *obj, Efl_Ui_Text_Data *pd EINA_UNUSED, Eina_Bool screen_coods, int start_offset, int end_offset, Eina_Rect *rect)
+_efl_ui_text_efl_access_text_range_extents_get(const Eo *obj, Efl_Ui_Text_Data *pd EINA_UNUSED, Eina_Bool screen_coods, int start_offset, int end_offset, Eina_Rect *rect)
{
Evas_Textblock_Cursor *cur1, *cur2;
int ret;
int x, xx, y, yy;
- Eo *text_obj = edje_object_part_swallow_get(pd->entry_edje, "elm.text");
+ Eo *text_obj = edje_object_part_swallow_get(pd->entry_edje, "efl.text");
if (!text_obj) return EINA_FALSE;
@@ -4306,7 +4251,7 @@ _efl_ui_text_efl_access_text_range_extents_get(Eo *obj, Efl_Ui_Text_Data *pd EIN
}
static Efl_Access_Text_Attribute*
-_textblock_node_format_to_atspi_text_attr(Eo *obj,
+_textblock_node_format_to_atspi_text_attr(const Eo *obj,
Efl_Text_Annotate_Annotation *annotation)
{
Efl_Access_Text_Attribute *ret;
@@ -4326,7 +4271,7 @@ _textblock_node_format_to_atspi_text_attr(Eo *obj,
}
EOLIAN static Eina_Bool
-_efl_ui_text_efl_access_text_attribute_get(Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED, const char *attr_name EINA_UNUSED, int *start_offset, int *end_offset, char **value)
+_efl_ui_text_efl_access_text_attribute_get(const Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED, const char *attr_name EINA_UNUSED, int *start_offset, int *end_offset, char **value)
{
Evas_Textblock_Cursor *cur1, *cur2;
Efl_Access_Text_Attribute *attr;
@@ -4371,7 +4316,7 @@ _efl_ui_text_efl_access_text_attribute_get(Eo *obj, Efl_Ui_Text_Data *_pd EINA_U
}
EOLIAN static Eina_List*
-_efl_ui_text_efl_access_text_attributes_get(Eo *obj, Efl_Ui_Text_Data *pd EINA_UNUSED, int *start_offset, int *end_offset)
+_efl_ui_text_efl_access_text_text_attributes_get(const Eo *obj, Efl_Ui_Text_Data *pd EINA_UNUSED, int *start_offset, int *end_offset)
{
Evas_Textblock_Cursor *cur1, *cur2;
Eina_List *ret = NULL;
@@ -4411,7 +4356,7 @@ _efl_ui_text_efl_access_text_attributes_get(Eo *obj, Efl_Ui_Text_Data *pd EINA_U
}
EOLIAN static Eina_List*
-_efl_ui_text_efl_access_text_default_attributes_get(Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED)
+_efl_ui_text_efl_access_text_default_attributes_get(const Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED)
{
Eina_List *ret = NULL;
Efl_Access_Text_Attribute *attr;
@@ -4420,11 +4365,12 @@ _efl_ui_text_efl_access_text_default_attributes_get(Eo *obj, Efl_Ui_Text_Data *_
Efl_Text_Annotate_Annotation *an;
/* Retrieve all annotations in the text. */
- start = efl_text_cursor_new(obj);
- end = efl_text_cursor_new(obj);
+ Eo *mobj = (Eo *)obj; /* XXX const */
+ start = efl_text_cursor_new(mobj);
+ end = efl_text_cursor_new(mobj);
- efl_text_cursor_paragraph_first(obj, start);
- efl_text_cursor_paragraph_last(obj, end);
+ efl_text_cursor_paragraph_first(mobj, start);
+ efl_text_cursor_paragraph_last(mobj, end);
annotations = efl_text_range_annotations_get(obj, start, end);
@@ -4440,7 +4386,7 @@ _efl_ui_text_efl_access_text_default_attributes_get(Eo *obj, Efl_Ui_Text_Data *_
}
EOLIAN static Eina_Bool
-_efl_ui_text_efl_access_editable_text_content_set(Eo *obj, Efl_Ui_Text_Data *pd EINA_UNUSED, const char *content)
+_efl_ui_text_efl_access_editable_text_text_content_set(Eo *obj, Efl_Ui_Text_Data *pd EINA_UNUSED, const char *content)
{
efl_text_set(obj, content);
return EINA_TRUE;
@@ -4469,7 +4415,7 @@ EOLIAN static Eina_Bool
_efl_ui_text_efl_access_editable_text_delete(Eo *obj, Efl_Ui_Text_Data *pd, int start_offset, int end_offset)
{
Evas_Textblock_Cursor *cur1, *cur2;
- Eo *text_obj = edje_object_part_swallow_get(pd->entry_edje, "elm.text");
+ Eo *text_obj = edje_object_part_swallow_get(pd->entry_edje, "efl.text");
if (!text_obj) return EINA_FALSE;
@@ -4514,31 +4460,31 @@ _efl_ui_text_efl_access_editable_text_cut(Eo *obj, Efl_Ui_Text_Data *pd EINA_UNU
}
EOLIAN static Efl_Access_State_Set
-_efl_ui_text_efl_access_state_set_get(Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED)
+_efl_ui_text_efl_access_object_state_set_get(const Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED)
{
Efl_Access_State_Set ret;
- ret = efl_access_state_set_get(efl_super(obj, EFL_UI_TEXT_CLASS));
+ ret = efl_access_object_state_set_get(efl_super(obj, EFL_UI_TEXT_CLASS));
- if (efl_ui_text_interactive_editable_get(obj))
+ if (efl_text_interactive_editable_get(obj))
STATE_TYPE_SET(ret, EFL_ACCESS_STATE_EDITABLE);
return ret;
}
EOLIAN static const char*
-_efl_ui_text_efl_access_name_get(Eo *obj, Efl_Ui_Text_Data *pd)
+_efl_ui_text_efl_access_object_i18n_name_get(const Eo *obj, Efl_Ui_Text_Data *pd)
{
const char *name;
- name = efl_access_name_get(efl_super(obj, EFL_UI_TEXT_CLASS));
+ name = efl_access_object_i18n_name_get(efl_super(obj, EFL_UI_TEXT_CLASS));
if (name && strncmp("", name, 1)) return name;
- const char *ret = edje_object_part_text_get(pd->entry_edje, "elm.guide");
+ const char *ret = edje_object_part_text_get(pd->entry_edje, "efl.guide");
return ret;
}
EOLIAN static Efl_Text_Cursor_Cursor *
_efl_ui_text_cursor_new(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd EINA_UNUSED)
{
- Eo *text_obj = edje_object_part_swallow_get(sd->entry_edje, "elm.text");
+ Eo *text_obj = edje_object_part_swallow_get(sd->entry_edje, "efl.text");
return efl_text_cursor_new(text_obj);
}
@@ -4555,7 +4501,7 @@ _decoration_create(Eo *obj, Efl_Ui_Text_Data *sd,
const char *group_name, Eina_Bool above)
{
Eo *ret = efl_add(EFL_CANVAS_LAYOUT_CLASS, sd->entry_edje);
- Eo *text_obj = edje_object_part_swallow_get(sd->entry_edje, "elm.text");
+ Eo *text_obj = edje_object_part_swallow_get(sd->entry_edje, "efl.text");
elm_widget_element_update(obj, ret, group_name);
evas_object_smart_member_add(ret, sd->entry_edje);
if (above)
@@ -4581,7 +4527,7 @@ _create_text_cursors(Eo *obj, Efl_Ui_Text_Data *sd)
sd->cursor = _decoration_create(obj, sd, PART_NAME_CURSOR, EINA_TRUE);
sd->cursor_bidi = _decoration_create(obj, sd, PART_NAME_CURSOR, EINA_TRUE);
- if (!efl_ui_text_interactive_editable_get(obj))
+ if (!efl_text_interactive_editable_get(obj))
{
evas_object_hide(sd->cursor);
evas_object_hide(sd->cursor_bidi);
@@ -4592,7 +4538,7 @@ static void
_decoration_calc_offset(Efl_Ui_Text_Data *sd, Evas_Coord *_x, Evas_Coord *_y)
{
Evas_Coord x, y;
- Eo *text_obj = edje_object_part_swallow_get(sd->entry_edje, "elm.text");
+ Eo *text_obj = edje_object_part_swallow_get(sd->entry_edje, "efl.text");
evas_object_geometry_get(text_obj, &x, &y, NULL, NULL);
@@ -4613,7 +4559,7 @@ _update_text_cursors(Eo *obj)
if (!sd->deferred_decoration_cursor) return;
sd->deferred_decoration_cursor = EINA_FALSE;
- text_obj = edje_object_part_swallow_get(sd->entry_edje, "elm.text");
+ text_obj = edje_object_part_swallow_get(sd->entry_edje, "efl.text");
x = y = w = h = -1;
xx = yy = ww = hh = -1;
@@ -4676,7 +4622,7 @@ _update_text_selection(Eo *obj, Eo *text_obj)
_decoration_calc_offset(sd, &x, &y);
- efl_ui_text_interactive_selection_cursors_get(text_obj, &sel_start, &sel_end);
+ efl_text_interactive_selection_cursors_get(text_obj, &sel_start, &sel_end);
range = efl_canvas_text_range_simple_geometry_get(text_obj,
sel_start, sel_end);
@@ -4896,7 +4842,7 @@ _anchors_create(Eo *obj, Efl_Ui_Text_Data *sd)
Efl_Text_Cursor_Cursor *start, *end;
Efl_Text_Annotate_Annotation *anchor;
- Eo *text_obj = edje_object_part_swallow_get(sd->entry_edje, "elm.text");
+ Eo *text_obj = edje_object_part_swallow_get(sd->entry_edje, "efl.text");
_anchors_clear_all(obj, sd);
start = efl_text_cursor_new(text_obj);
@@ -4915,8 +4861,7 @@ _anchors_create(Eo *obj, Efl_Ui_Text_Data *sd)
Eina_Bool is_anchor = EINA_FALSE;
Eina_Bool is_item = EINA_FALSE;
- if (efl_text_object_item_geometry_get(obj, anchor,
- NULL, NULL, NULL, NULL))
+ if (efl_text_annotation_is_item(obj, anchor))
{
is_anchor = EINA_TRUE;
is_item = EINA_TRUE;
@@ -5006,7 +4951,7 @@ _anchors_update(Eo *o, Efl_Ui_Text_Data *sd)
Anchor *an;
Eo *sw;
- sw = edje_object_part_swallow_get(sd->entry_edje, "elm.text");
+ sw = edje_object_part_swallow_get(sd->entry_edje, "efl.text");
if (!sd->deferred_decoration_anchor) return;
sd->deferred_decoration_anchor = EINA_FALSE;
@@ -5019,7 +4964,7 @@ _anchors_update(Eo *o, Efl_Ui_Text_Data *sd)
smart = evas_object_smart_parent_get(o);
clip = evas_object_clip_get(
- edje_object_part_swallow_get(sd->entry_edje, "elm.text"));
+ edje_object_part_swallow_get(sd->entry_edje, "efl.text"));
_decoration_calc_offset(sd, &x, &y);
EINA_LIST_FOREACH(sd->anchors, l, an)
{
@@ -5040,7 +4985,7 @@ _anchors_update(Eo *o, Efl_Ui_Text_Data *sd)
{
rect->obj = ob;
- efl_text_object_item_geometry_get(an->obj,
+ efl_text_item_geometry_get(an->obj,
an->annotation, &cx, &cy, &cw, &ch);
evas_object_move(rect->obj, x + cx, y + cy);
evas_object_resize(rect->obj, cw, ch);
@@ -5187,7 +5132,7 @@ static void
_update_decorations(Eo *obj)
{
EFL_UI_TEXT_DATA_GET(obj, sd);
- Eo *text_obj = edje_object_part_swallow_get(sd->entry_edje, "elm.text");
+ Eo *text_obj = edje_object_part_swallow_get(sd->entry_edje, "efl.text");
_update_text_cursors(obj);
_update_text_selection(obj, text_obj);
@@ -5255,21 +5200,21 @@ _efl_ui_text_selection_changed_cb(void *data, const Efl_Event *event EINA_UNUSED
char *text;
EFL_UI_TEXT_DATA_GET(obj, sd);
- efl_ui_text_interactive_selection_cursors_get(obj, &start, &end);
+ efl_text_interactive_selection_cursors_get(obj, &start, &end);
text = efl_canvas_text_range_text_get(obj, start, end);
if (!text || (text[0] == '\0'))
{
- _edje_signal_emit(sd, "selection,cleared", "elm.text");
+ _edje_signal_emit(sd, "selection,cleared", "efl.text");
sd->have_selection = EINA_FALSE;
}
else
{
if (!sd->have_selection)
{
- _edje_signal_emit(sd, "selection,start", "elm.text");
+ _edje_signal_emit(sd, "selection,start", "efl.text");
}
- _edje_signal_emit(sd, "selection,changed", "elm.text");
+ _edje_signal_emit(sd, "selection,changed", "efl.text");
sd->have_selection = EINA_TRUE;
}
if (text) free(text);
@@ -5284,6 +5229,20 @@ _efl_ui_text_move_cb(void *data, Evas *e EINA_UNUSED,
_decoration_defer_all(data);
}
+static void
+_efl_ui_text_item_factory_set(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *pd,
+ Efl_Canvas_Text_Factory *item_factory)
+{
+ if (pd->item_factory) efl_unref(pd->item_factory);
+ pd->item_factory = efl_ref(item_factory);
+}
+
+static Eo *
+_efl_ui_text_item_factory_get(const Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *pd)
+{
+ return pd->item_factory;
+}
+
#if 0
/* Efl.Part begin */
@@ -5334,7 +5293,7 @@ _efl_ui_text_editable_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED)
if (!elm_widget_theme_klass_get(obj))
elm_widget_theme_klass_set(obj, "text");
obj = efl_constructor(efl_super(obj, MY_CLASS));
- efl_ui_text_interactive_editable_set(obj, EINA_TRUE);
+ efl_text_interactive_editable_set(obj, EINA_TRUE);
return obj;
}
diff --git a/src/lib/elementary/efl_ui_text.eo b/src/lib/elementary/efl_ui_text.eo
index 5075af5f68..c0ecc3c00c 100644
--- a/src/lib/elementary/efl_ui_text.eo
+++ b/src/lib/elementary/efl_ui_text.eo
@@ -1,9 +1,9 @@
+/* FIXME - Text object must stop using elm_general! */
import elm_general;
-import elm_entry;
-class Efl.Ui.Text (Efl.Ui.Layout, Elm.Interface_Scrollable, Efl.Ui.Clickable,
+class Efl.Ui.Text (Efl.Ui.Layout.Object, Elm.Interface_Scrollable, Efl.Ui.Clickable,
Efl.Access.Text, Efl.Access.Editable.Text, Efl.File,
- Efl.Ui.Selectable, Efl.Ui.Scrollable, Efl.Ui.Text.Interactive)
+ Efl.Ui.Selectable, Efl.Ui.Scrollable, Efl.Text_Interactive)
{
[[Efl UI text class]]
methods {
@@ -59,6 +59,7 @@ class Efl.Ui.Text (Efl.Ui.Layout, Elm.Interface_Scrollable, Efl.Ui.Clickable,
}
}
@property cnp_mode {
+ /* FIXME: Efl.Selection_Format does not allow markup without images! */
set {
[[Control pasting of text and images for the widget.
@@ -77,7 +78,7 @@ class Efl.Ui.Text (Efl.Ui.Layout, Elm.Interface_Scrollable, Efl.Ui.Clickable,
]]
}
values {
- cnp_mode: Elm.Cnp_Mode; [[One of #Elm_Cnp_Mode: #ELM_CNP_MODE_MARKUP, #ELM_CNP_MODE_NO_IMAGE, #ELM_CNP_MODE_PLAINTEXT.]]
+ format: Efl.Selection_Format; [[Format for copy & paste.]]
}
}
@property input_panel_language {
@@ -134,7 +135,7 @@ class Efl.Ui.Text (Efl.Ui.Layout, Elm.Interface_Scrollable, Efl.Ui.Clickable,
autocapital_type: Elm.Autocapital.Type; [[The type of autocapitalization.]]
}
}
- @property password {
+ @property password_mode {
set {
[[Sets the entry to password mode.
@@ -232,13 +233,12 @@ class Efl.Ui.Text (Efl.Ui.Layout, Elm.Interface_Scrollable, Efl.Ui.Clickable,
enabled: bool; [[If $enabled is $true, the return key is automatically disabled when the entry has no text.]]
}
}
- item_provider_prepend {
- [[This prepends a custom item provider to the list for that entry
-
- This prepends the given callback.]]
- params {
- @in func: Elm_Entry_Item_Provider_Cb; [[The function called to provide the item object.]]
- @in data: void_ptr @optional; [[The data passed to $func.]]
+ @property item_factory {
+ [[The factory that provides item in the text e.g.
+ "emoticon/happy" or "href=file://image.jpg" etc.
+ ]]
+ values {
+ item_factory: Efl.Canvas.Text_Factory; [[Factory to create items]]
}
}
input_panel_show {
@@ -251,17 +251,6 @@ class Efl.Ui.Text (Efl.Ui.Layout, Elm.Interface_Scrollable, Efl.Ui.Clickable,
selection_copy {
[[This executes a "copy" action on the selected text in the entry.]]
}
- item_provider_remove {
- [[This removes a custom item provider to the list for that entry
-
- This removes the given callback. See @.item_provider_append for
- more information
- ]]
- params {
- @in func: Elm_Entry_Item_Provider_Cb; [[The function called to provide the item object.]]
- @in data: void_ptr @optional; [[The data passed to $func.]]
- }
- }
context_menu_clear {
[[This clears and frees the items in a entry's contextual (longpress)
menu.
@@ -305,23 +294,6 @@ class Efl.Ui.Text (Efl.Ui.Layout, Elm.Interface_Scrollable, Efl.Ui.Clickable,
selection_cut {
[[This executes a "cut" action on the selected text in the entry.]]
}
- item_provider_append {
- [[This appends a custom item provider to the list for that entry
-
- This appends the given callback. The list is walked from beginning to end
- with each function called given the item href string in the text. If the
- function returns an object handle other than $null (it should create an
- object to do this), then this object is used to replace that item. If
- not the next provider is called until one provides an item object, or the
- default provider in entry does.
-
- See also \@ref entry-items.
- ]]
- params {
- @in func: Elm_Entry_Item_Provider_Cb; [[The function called to provide the item object.]]
- @in data: void_ptr @optional; [[The data passed to $func.]]
- }
- }
context_menu_item_add {
[[This adds an item to the entry's contextual menu.
@@ -344,33 +316,33 @@ class Efl.Ui.Text (Efl.Ui.Layout, Elm.Interface_Scrollable, Efl.Ui.Clickable,
}
cursor_new {
[[Creates and returns a new cursor for the text.]]
- return: ptr(Efl.Text.Cursor.Cursor); [[Text cursor]]
+ return: ptr(Efl.Text_Cursor_Cursor); [[Text cursor]]
}
}
implements {
Efl.Object.constructor;
Efl.Object.destructor;
- Efl.Gfx.visible { set; }
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set; }
+ Efl.Gfx.Entity.visible { set; }
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
Efl.Canvas.Group.group_member_add;
Efl.Layout.Signal.signal_callback_add;
Efl.Layout.Signal.signal_callback_del;
Efl.Layout.Signal.signal_emit;
- Elm.Widget.on_access_activate;
- Elm.Widget.theme_apply;
- Elm.Widget.on_focus_update;
- Elm.Widget.interest_region { get; }
- Elm.Widget.on_disabled_update;
- Elm.Widget.widget_sub_object_del;
+ Efl.Ui.Widget.on_access_activate;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Focus.Object.on_focus_update;
+ Efl.Ui.Widget.interest_region { get; }
+ Efl.Ui.Widget.on_disabled_update;
+ Efl.Ui.Widget.widget_sub_object_del;
Elm.Interface_Scrollable.policy { set; }
Elm.Interface_Scrollable.bounce_allow { set; }
- Efl.Access.state_set { get; }
- Efl.Access.name { get; }
- Efl.Access.Text.text { get; }
+ Efl.Access.Object.state_set { get; }
+ Efl.Access.Object.i18n_name { get; }
+ Efl.Access.Text.access_text { get; }
Efl.Access.Text.string { get; }
Efl.Access.Text.attribute { get; }
- Efl.Access.Text.attributes { get; }
+ Efl.Access.Text.text_attributes { get; }
Efl.Access.Text.default_attributes { get; }
Efl.Access.Text.caret_offset { get; set; }
Efl.Access.Text.character { get; }
@@ -379,41 +351,44 @@ class Efl.Ui.Text (Efl.Ui.Layout, Elm.Interface_Scrollable, Efl.Ui.Clickable,
Efl.Access.Text.offset_at_point { get; }
Efl.Access.Text.bounded_ranges { get; }
Efl.Access.Text.range_extents { get; }
- Efl.Access.Text.selection { get; set; }
+ Efl.Access.Text.access_selection { get; set; }
Efl.Access.Text.selections_count { get; }
Efl.Access.Text.selection_add;
Efl.Access.Text.selection_remove;
- Efl.Access.Editable.Text.content { set; }
+ Efl.Access.Editable.Text.text_content { set; }
Efl.Access.Editable.Text.insert;
Efl.Access.Editable.Text.copy;
Efl.Access.Editable.Text.cut;
Efl.Access.Editable.Text.delete;
Efl.Access.Editable.Text.paste;
Efl.File.file { get; set; }
- Efl.Ui.Text.Interactive.editable { set; }
+ Efl.Text_Interactive.editable { set; }
}
events {
- activated; [[Called when entry is activated]]
- changed; [[Called when entry changes]]
- changed,user: Efl.Ui.Text.Change_Info;
+ activated: void; [[Called when entry is activated]]
+ changed: void; [[Called when entry changes]]
+ /* FIXME: Sometimes it can be NULL but @nullable does not work on events */
+ changed,user: Efl.Ui.Text_Change_Info;
[[The text object has changed due to user interaction]]
- validate; [[Called when validating]]
- context,open; [[Called when context menu was opened]]
- anchor,clicked; [[Called when anchor is clicked]]
- rejected; [[Called when entry is rejected]]
- maxlength,reached; [[Called when maximum entry length has been reached]]
- preedit,changed; [[Called when entry preedit changed]]
- press; [[Called when entry pressed]]
- redo,request; [[Called when redo is requested]]
- undo,request; [[Called when undo is requested]]
+ validate: Elm.Validate_Content; [[Called when validating]]
+ context,open: void; [[Called when context menu was opened]]
+ preedit,changed: void; [[Called when entry preedit changed]]
+ press: void; [[Called when entry pressed]]
+ redo,request: void; [[Called when redo is requested]]
+ undo,request: void; [[Called when undo is requested]]
+ aborted: void; [[Called when entry is aborted]]
+ anchor,down: Elm.Entry_Anchor_Info; [[Called on anchor down]]
+ anchor,hover,opened: Elm.Entry_Anchor_Hover_Info; [[Called when hover opened]]
+ anchor,in: Elm.Entry_Anchor_Info; [[Called on anchor in]]
+ anchor,out: Elm.Entry_Anchor_Info; [[Called on anchor out]]
+ anchor,up: Elm.Entry_Anchor_Info; [[called on anchor up]]
+ cursor,changed,manual: void; [[Called on manual cursor change]]
+ /* FIXME: Nobody emits these
+ anchor,clicked: void; [[Called when anchor is clicked]]
+ rejected: void; [[Called when entry is rejected]]
+ maxlength,reached: void; [[Called when maximum entry length has been reached]]
text,set,done; [[Called when text set finished]]
- aborted; [[Called when entry is aborted]]
- anchor,down; [[Called on anchor down]]
- anchor,hover,opened; [[Called when hover opened]]
- anchor,in; [[Called on anchor in]]
- anchor,out; [[Called on anchor out]]
- anchor,up; [[called on anchor up]]
- cursor,changed; [[Called on cursor changed]]
- cursor,changed,manual; [[Called on manual cursor change]]
+ cursor,changed: void; [[Called on cursor changed]]
+ */
}
}
diff --git a/src/lib/elementary/efl_ui_text_editable.eo b/src/lib/elementary/efl_ui_text_editable.eo
index 0092aee29b..b0535b1e5d 100644
--- a/src/lib/elementary/efl_ui_text_editable.eo
+++ b/src/lib/elementary/efl_ui_text_editable.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Text.Editable (Efl.Ui.Text)
+class Efl.Ui.Text_Editable (Efl.Ui.Text)
{
[[Efl UI text editable class]]
data: null;
diff --git a/src/lib/elementary/efl_ui_text_factory_emoticons.c b/src/lib/elementary/efl_ui_text_factory_emoticons.c
new file mode 100644
index 0000000000..561b9aa55d
--- /dev/null
+++ b/src/lib/elementary/efl_ui_text_factory_emoticons.c
@@ -0,0 +1,35 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <Elementary.h>
+#include <Elementary_Cursor.h>
+#include "elm_priv.h"
+
+#define MY_CLASS EFL_UI_TEXT_FACTORY_EMOTICONS_CLASS
+
+typedef struct _Efl_Ui_Text_Factory_Emoticons_Data Efl_Ui_Text_Factory_Emoticons_Data;
+
+struct _Efl_Ui_Text_Factory_Emoticons_Data
+{
+};
+
+EOLIAN static Efl_Canvas_Object
+*_efl_ui_text_factory_emoticons_efl_canvas_text_factory_create(
+ Eo *obj EINA_UNUSED,
+ Efl_Ui_Text_Factory_Emoticons_Data *pd EINA_UNUSED,
+ Efl_Canvas_Object *object,
+ const char *key)
+{
+ Eo *o;
+ const char *style = elm_widget_style_get(object);
+
+ o = edje_object_add(evas_object_evas_get(object));
+ if (!_elm_theme_object_set
+ (object, o, "text", key, style))
+ _elm_theme_object_set
+ (object, o, "text/emoticon", "wtf", style);
+ return o;
+}
+
+#include "efl_ui_text_factory_emoticons.eo.c"
diff --git a/src/lib/elementary/efl_ui_text_factory_emoticons.eo b/src/lib/elementary/efl_ui_text_factory_emoticons.eo
new file mode 100644
index 0000000000..6cfcdbe23c
--- /dev/null
+++ b/src/lib/elementary/efl_ui_text_factory_emoticons.eo
@@ -0,0 +1,10 @@
+class Efl.Ui.Text_Factory.Emoticons (Efl.Object, Efl.Canvas.Text_Factory)
+{
+ [[Factory that creates emoticons from the current theme given a key.
+
+ @since 1.21
+ ]]
+ implements {
+ Efl.Canvas.Text_Factory.create;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_text_factory_fallback.c b/src/lib/elementary/efl_ui_text_factory_fallback.c
new file mode 100644
index 0000000000..4ee456e1e0
--- /dev/null
+++ b/src/lib/elementary/efl_ui_text_factory_fallback.c
@@ -0,0 +1,62 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <Elementary.h>
+#include <Elementary_Cursor.h>
+#include "elm_priv.h"
+
+#define MY_CLASS EFL_UI_TEXT_FACTORY_FALLBACK_CLASS
+
+typedef struct _Efl_Ui_Text_Factory_Fallback_Data Efl_Ui_Text_Factory_Fallback_Data;
+
+struct _Efl_Ui_Text_Factory_Fallback_Data
+{
+ Efl_Canvas_Text_Factory *emoticon_factory, *image_factory;
+};
+
+EOLIAN static Eo *
+_efl_ui_text_factory_fallback_efl_object_constructor(Eo *obj,
+ Efl_Ui_Text_Factory_Fallback_Data *pd EINA_UNUSED)
+{
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+ pd->image_factory = efl_add(EFL_UI_TEXT_FACTORY_IMAGES_CLASS, obj);
+ pd->emoticon_factory = efl_add(EFL_UI_TEXT_FACTORY_EMOTICONS_CLASS, obj);
+ return obj;
+}
+
+EOLIAN static void
+_efl_ui_text_factory_fallback_efl_object_destructor(Eo *obj,
+ Efl_Ui_Text_Factory_Fallback_Data *pd EINA_UNUSED)
+{
+ efl_del(pd->emoticon_factory);
+ efl_del(pd->image_factory);
+ efl_destructor(efl_super(obj, MY_CLASS));
+}
+
+
+EOLIAN static Efl_Canvas_Object
+*_efl_ui_text_factory_fallback_efl_canvas_text_factory_create(
+ Eo *obj EINA_UNUSED,
+ Efl_Ui_Text_Factory_Fallback_Data *pd EINA_UNUSED,
+ Efl_Canvas_Object *object,
+ const char *key)
+{
+ Efl_Canvas_Object *o = NULL;
+
+ // Parse the string. Can be either:
+ // 1. some/name - an emoticon (load from theme)
+ // 2. file:// - image file
+ if (key && !strncmp(key, "file://", 7))
+ {
+ const char *fname = key + 7;
+ o = efl_canvas_text_factory_create(pd->image_factory, object, fname);
+ }
+ else
+ {
+ o = efl_canvas_text_factory_create(pd->emoticon_factory, object, key);
+ }
+ return o;
+}
+
+#include "efl_ui_text_factory_fallback.eo.c"
diff --git a/src/lib/elementary/efl_ui_text_factory_fallback.eo b/src/lib/elementary/efl_ui_text_factory_fallback.eo
new file mode 100644
index 0000000000..03b339dce7
--- /dev/null
+++ b/src/lib/elementary/efl_ui_text_factory_fallback.eo
@@ -0,0 +1,16 @@
+class Efl.Ui.Text_Factory.Fallback (Efl.Object, Efl.Canvas.Text_Factory)
+{
+ [[Internal factory for fallback cases.
+
+ This wraps some internal functionality:
+ - Contains 2 factories: image and emoticon
+ - Strips off "file://" prefix for image items, to be used with the image
+ factory.
+ @since 1.21
+ ]]
+ implements {
+ Efl.Object.constructor;
+ Efl.Object.destructor;
+ Efl.Canvas.Text_Factory.create;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_text_factory_images.c b/src/lib/elementary/efl_ui_text_factory_images.c
new file mode 100644
index 0000000000..54c5c43aa9
--- /dev/null
+++ b/src/lib/elementary/efl_ui_text_factory_images.c
@@ -0,0 +1,147 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <Elementary.h>
+#include <Elementary_Cursor.h>
+#include "elm_priv.h"
+
+#define MY_CLASS EFL_UI_TEXT_FACTORY_IMAGES_CLASS
+
+typedef struct _Efl_Ui_Text_Factory_Images_Data Efl_Ui_Text_Factory_Images_Data;
+
+struct _Efl_Ui_Text_Factory_Images_Data
+{
+ const char *name;
+ Eina_Hash *hash;
+};
+
+typedef struct
+{
+ Eina_File *file;
+ const char *key;
+} File_Entry;
+
+static void
+_entry_free_cb(void *data)
+{
+ File_Entry *e = data;
+ eina_file_close(e->file);
+ eina_stringshare_del(e->key);
+ free(e);
+}
+
+EOLIAN static Eo *
+_efl_ui_text_factory_images_efl_object_constructor(Eo *obj,
+ Efl_Ui_Text_Factory_Images_Data *pd EINA_UNUSED)
+{
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+ pd->hash = eina_hash_string_superfast_new(_entry_free_cb);
+ return obj;
+}
+
+EOLIAN static void
+_efl_ui_text_factory_images_efl_object_destructor(Eo *obj,
+ Efl_Ui_Text_Factory_Images_Data *pd EINA_UNUSED)
+{
+ eina_hash_free(pd->hash);
+ efl_destructor(efl_super(obj, MY_CLASS));
+}
+
+EOLIAN static Efl_Canvas_Object *
+_efl_ui_text_factory_images_efl_canvas_text_factory_create(Eo *obj EINA_UNUSED,
+ Efl_Ui_Text_Factory_Images_Data *pd EINA_UNUSED,
+ Efl_Canvas_Object *object,
+ const char *key)
+{
+ Efl_Canvas_Object *o;
+ File_Entry *e;
+
+ o = efl_add(EFL_CANVAS_IMAGE_CLASS, object);
+ e = eina_hash_find(pd->hash, key);
+ if (e)
+ {
+ efl_file_mmap_set(o, e->file, e->key);
+ }
+ else
+ {
+ efl_file_set(o, key, NULL);
+ }
+
+ if (efl_file_load_error_get(o) != EFL_GFX_IMAGE_LOAD_ERROR_NONE)
+ {
+ efl_del(o);
+ o = NULL;
+ }
+
+ return o;
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_text_factory_images_matches_add(Eo *obj EINA_UNUSED,
+ Efl_Ui_Text_Factory_Images_Data *pd,
+ const char *name, const char *file, const char *key)
+{
+ File_Entry *e;
+ Eina_File *f = eina_file_open(file, EINA_FALSE);
+
+ if (!f) return EINA_FALSE;
+
+ e = malloc(sizeof(*e));
+ e->file = f;
+ e->key = eina_stringshare_add(key);
+
+ if (!eina_hash_add(pd->hash, name, e))
+ {
+ ERR("Failed to add file path %s to key %s\n", file, key);
+ eina_file_close(f);
+ free(e);
+ return EINA_FALSE;
+ }
+
+ return EINA_TRUE;
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_text_factory_images_matches_del(Eo *obj EINA_UNUSED,
+ Efl_Ui_Text_Factory_Images_Data *pd,
+ const char *name)
+{
+ return eina_hash_del(pd->hash, name, NULL);
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_text_factory_images_matches_mmap_add(Eo *obj EINA_UNUSED,
+ Efl_Ui_Text_Factory_Images_Data *pd,
+ const char *name, const Eina_File *file, const char *key)
+{
+ File_Entry *e;
+ Eina_File *f;
+
+ if (!file) return EINA_FALSE;
+
+ f = eina_file_dup(file);
+ e = malloc(sizeof(*e));
+ e->file = f;
+ e->key = eina_stringshare_add(key);
+
+ if (!eina_hash_add(pd->hash, name, e))
+ {
+ ERR("Failed to add Eina_File %p to key %s\n", file, key);
+ eina_file_close(f);
+ free(e);
+ return EINA_FALSE;
+ }
+
+ return EINA_TRUE;
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_text_factory_images_matches_mmap_del(Eo *obj EINA_UNUSED,
+ Efl_Ui_Text_Factory_Images_Data *pd,
+ const char *name)
+{
+ return eina_hash_del(pd->hash, name, NULL);
+}
+
+#include "efl_ui_text_factory_images.eo.c"
diff --git a/src/lib/elementary/efl_ui_text_factory_images.eo b/src/lib/elementary/efl_ui_text_factory_images.eo
new file mode 100644
index 0000000000..012c3e1fad
--- /dev/null
+++ b/src/lib/elementary/efl_ui_text_factory_images.eo
@@ -0,0 +1,69 @@
+class Efl.Ui.Text_Factory.Images (Efl.Object, Efl.Canvas.Text_Factory)
+{
+ [[Factory that creates images given key string
+
+ The key can be either a full image path, or associated with one. The
+ factory will fallback if key was not matches with an image, and try
+ to load it as a full path.
+
+ @since 1.21
+ ]]
+ methods {
+ matches_add {
+ [[Associates given name with a path of an image or EET file.
+
+ This can be used for quick retrieval (instead of
+ providing actual filenames.
+
+ This $file is associated with $name is considered a full file path.
+
+ see @.matches_mmap_add for mmap version
+ see @.matches_del
+ ]]
+ params {
+ name: string; [[the name associated with filename]]
+ path: string; [[the image or EET file path]]
+ key: string; [[the key to use (in cases of loading an EET file]]
+ }
+ return: bool; [[$true if successful, $false otherwise]]
+ }
+ matches_del {
+ [[Deletes an association of $key with its respective file path.
+
+ see @.matches_add
+ ]]
+ params {
+ key: string; [[the entry's key to delete]]
+ }
+ return: bool; [[$true if successful, $false otherwise]]
+ }
+ matches_mmap_add {
+ [[Associates given name with a mmap'd image or EET file and key.
+
+ see @.matches_add for string file path version
+ see @.matches_mmap_del
+ ]]
+ params {
+ name: string; [[the name associated with filename]]
+ file: ptr(const(Eina.File)); [[the image or EET file]]
+ key: string; [[the key to use (in cases of loading an EET file]]
+ }
+ return: bool; [[$true if successful, $false otherwise]]
+ }
+ matches_mmap_del {
+ [[Deletes an association of $key with its respective file.
+
+ see @.matches_mmap_add
+ ]]
+ params {
+ key: string; [[the entry's key to delete]]
+ }
+ return: bool; [[$true if successful, $false otherwise]]
+ }
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Object.destructor;
+ Efl.Canvas.Text_Factory.create;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_textpath.c b/src/lib/elementary/efl_ui_textpath.c
index 9a64896521..20b04092b0 100644
--- a/src/lib/elementary/efl_ui_textpath.c
+++ b/src/lib/elementary/efl_ui_textpath.c
@@ -3,6 +3,7 @@
#endif
#define ELM_LAYOUT_PROTECTED
+#define EFL_PART_PROTECTED
#include <Elementary.h>
#include "elm_priv.h"
@@ -46,6 +47,10 @@ struct _Efl_Ui_Textpath_Segment
};
};
+/* If you need to draw slices using Evas Line,
+ * define the following debug flag manually. */
+//#define EFL_UI_TEXTPATH_LINE_DEBUG
+
struct _Efl_Ui_Textpath_Data
{
Evas_Object *text_obj;
@@ -58,11 +63,14 @@ struct _Efl_Ui_Textpath_Data
} circle;
Efl_Ui_Textpath_Direction direction;
int slice_no;
- Eina_Bool autofit;
Eina_Bool ellipsis;
Eina_Inlist *segments;
int total_length;
+ Ecore_Job *draw_text_job;
+#ifdef EFL_UI_TEXTPATH_LINE_DEBUG
+ Eina_List *lines;
+#endif
};
#define EFL_UI_TEXTPATH_DATA_GET(o, sd) \
@@ -75,26 +83,25 @@ _deg_to_rad(double angle)
}
static void
-_segment_draw(Efl_Ui_Textpath_Data *pd, int slice_no, int w1, int w2, int cmp, Evas_Map *map, Eina_Bezier bezier)
+_segment_draw(Efl_Ui_Textpath_Data *pd, int slice_no, double dt, double dist,
+ int w1, int cmp, Evas_Map *map, Eina_Bezier bezier,
+ int *last_x1, int *last_y1, int *last_x2, int *last_y2)
{
- int i, len, seg_len;
+ int i;
double u0, u1, v0, v1;
- double dist, t, dt;
+ double t;
double px, py, px2, py2;
double rad;
Eina_Rect r;
Eina_Vector2 vec, nvec, vec0, vec1, vec2, vec3;
Eina_Matrix2 mat;
+#ifdef EFL_UI_TEXTPATH_LINE_DEBUG
+ static Eina_Bool yello_color_flag = EINA_FALSE;
+ yello_color_flag = !yello_color_flag;
+#endif
- len = w2 - w1;
- r = efl_gfx_geometry_get(pd->text_obj);
+ r = efl_gfx_entity_geometry_get(pd->text_obj);
- seg_len = eina_bezier_length_get(&bezier);
- if (pd->autofit)
- dt = len / (seg_len * (double) slice_no);
- else
- dt = 1.0 / (double) slice_no;
- dist = len / (double)slice_no;
rad = _deg_to_rad(90);
eina_matrix2_values_set(&mat, cos(rad), -sin(rad), sin(rad), cos(rad));
@@ -116,19 +123,46 @@ _segment_draw(Efl_Ui_Textpath_Data *pd, int slice_no, int w1, int w2, int cmp, E
vec2.x = (-vec.x + px);
vec2.y = (-vec.y + py);
+ if (cmp == 0)
+ {
+ *last_x1 = (int) round(vec1.x + r.x);
+ *last_y1 = (int) round(vec1.y + r.y);
+ *last_x2 = (int) round(vec2.x + r.x);
+ *last_y2 = (int) round(vec2.y + r.y);
+ }
+
//add points to map
for (i = 0; i < slice_no; i++)
{
+ int mp0_x, mp0_y;
+ int mp1_x, mp1_y;
+ int mp2_x, mp2_y;
+ int mp3_x, mp3_y;
+ double next_dt = dt;
+
//v0, v3
vec0.x = vec1.x;
vec0.y = vec1.y;
vec3.x = vec2.x;
vec3.y = vec2.y;
+ //UV
+ u0 = w1 + i * dist;
+ u1 = u0 + dist;
+ if (u1 > r.w)
+ u1 = r.w;
+ v0 = (double) 0;
+ v1 = (double) r.h;
+
+ /* If u1 is modified not to exceed its end,
+ * modify next_dt according to changes of dist. */
+ if (u1 < u0 + dist)
+ next_dt = dt * (u1 - u0) / dist;
+
//v1, v2
- t = ((double) (i + 1) * dt);
+ t = (double) (i * dt) + next_dt;
eina_bezier_point_at(&bezier, t, &px, &py);
- eina_bezier_point_at(&bezier, t + dt, &px2, &py2);
+ eina_bezier_point_at(&bezier, t + next_dt, &px2, &py2);
vec.x = (px2 - px);
vec.y = (py2 - py);
@@ -142,21 +176,80 @@ _segment_draw(Efl_Ui_Textpath_Data *pd, int slice_no, int w1, int w2, int cmp, E
vec2.x = (-vec.x + px);
vec2.y = (-vec.y + py);
- evas_map_point_coord_set(map, cmp + i * 4, (int) vec0.x + r.x, (int) vec0.y + r.y, 0);
- evas_map_point_coord_set(map, cmp + i * 4 + 1, (int) vec1.x + r.x, (int) vec1.y + r.y, 0);
- evas_map_point_coord_set(map, cmp + i * 4 + 2, (int) vec2.x + r.x, (int) vec2.y + r.y, 0);
- evas_map_point_coord_set(map, cmp + i * 4 + 3, (int) vec3.x + r.x, (int) vec3.y + r.y, 0);
-
- //UV
- u0 = w1 + i * dist;
- u1 = u0 + dist;
- v0 = (double) 0;
- v1 = (double) r.h;
+ /* Set mp1, mp2 position according to difference between
+ * previous points and next points.
+ * It improves smoothness of curve's slope changing. */
+ mp0_x = *last_x1;
+ mp0_y = *last_y1;
+ mp1_x = *last_x1 + (int) round(vec1.x - vec0.x);
+ mp1_y = *last_y1 + (int) round(vec1.y - vec0.y);
+ mp2_x = *last_x2 + (int) round(vec2.x - vec3.x);
+ mp2_y = *last_y2 + (int) round(vec2.y - vec3.y);
+ mp3_x = *last_x2;
+ mp3_y = *last_y2;
+
+ evas_map_point_coord_set(map, cmp + i * 4, mp0_x, mp0_y, 0);
+ evas_map_point_coord_set(map, cmp + i * 4 + 1, mp1_x, mp1_y, 0);
+ evas_map_point_coord_set(map, cmp + i * 4 + 2, mp2_x, mp2_y, 0);
+ evas_map_point_coord_set(map, cmp + i * 4 + 3, mp3_x, mp3_y, 0);
evas_map_point_image_uv_set(map, cmp + i * 4, u0, v0);
evas_map_point_image_uv_set(map, cmp + i * 4 + 1, u1, v0);
evas_map_point_image_uv_set(map, cmp + i * 4 + 2, u1, v1);
evas_map_point_image_uv_set(map, cmp + i * 4 + 3, u0, v1);
+
+ *last_x1 = mp1_x;
+ *last_y1 = mp1_y;
+ *last_x2 = mp2_x;
+ *last_y2 = mp2_y;
+
+#ifdef EFL_UI_TEXTPATH_LINE_DEBUG
+ Evas_Object *line = evas_object_line_add(evas_object_evas_get(pd->text_obj));
+ pd->lines = eina_list_append(pd->lines, line);
+ if (yello_color_flag)
+ evas_object_color_set(line, 255, 255, 0, 255);
+ else
+ evas_object_color_set(line, 255, 0, 0, 255);
+ evas_object_line_xy_set(line,
+ mp0_x, mp0_y,
+ mp1_x, mp1_y);
+ evas_object_show(line);
+
+ line = evas_object_line_add(evas_object_evas_get(pd->text_obj));
+ pd->lines = eina_list_append(pd->lines, line);
+ if (yello_color_flag)
+ evas_object_color_set(line, 255, 255, 0, 255);
+ else
+ evas_object_color_set(line, 255, 0, 0, 255);
+ evas_object_line_xy_set(line,
+ mp1_x, mp1_y,
+ mp2_x, mp2_y);
+ evas_object_show(line);
+
+ line = evas_object_line_add(evas_object_evas_get(pd->text_obj));
+ pd->lines = eina_list_append(pd->lines, line);
+ if (yello_color_flag)
+ evas_object_color_set(line, 255, 255, 0, 255);
+ else
+ evas_object_color_set(line, 255, 0, 0, 255);
+ evas_object_line_xy_set(line,
+ mp2_x, mp2_y,
+ mp3_x, mp3_y);
+ evas_object_show(line);
+
+ line = evas_object_line_add(evas_object_evas_get(pd->text_obj));
+ pd->lines = eina_list_append(pd->lines, line);
+ if (yello_color_flag)
+ evas_object_color_set(line, 255, 255, 0, 255);
+ else
+ evas_object_color_set(line, 255, 0, 0, 255);
+ evas_object_line_xy_set(line,
+ mp3_x, mp3_y,
+ mp0_x, mp0_y);
+ evas_object_show(line);
+#endif
+
+ if (u1 >= r.w) break;
}
}
@@ -184,7 +277,7 @@ _text_on_line_draw(Efl_Ui_Textpath_Data *pd, int w1, int w2, int cmp, Evas_Map *
sina = (y2 - y1) / len;
cosa = (x2 - x1) / len;
- r = efl_gfx_geometry_get(pd->text_obj);
+ r = efl_gfx_entity_geometry_get(pd->text_obj);
r.h /= 2;
evas_map_point_coord_set(map, cmp + 3, x1 - r.h * sina, y1 + r.h * cosa, 0);
evas_map_point_coord_set(map, cmp + 2, x2 - r.h * sina, y2 + r.h * cosa, 0);
@@ -212,7 +305,7 @@ _map_point_calc(Efl_Ui_Textpath_Data *pd)
}
else if (seg->type == EFL_GFX_PATH_COMMAND_TYPE_CUBIC_TO)
{
- int no = pd->slice_no * seg->length / (double)pd->total_length;
+ int no = (int)ceil(pd->slice_no * seg->length / (double)pd->total_length);
if (no == 0) no = 1;
map_no += no;
}
@@ -223,23 +316,21 @@ _map_point_calc(Efl_Ui_Textpath_Data *pd)
}
static void
-_text_draw(Efl_Ui_Textpath_Data *pd)
+_text_draw(void *data)
{
+ Efl_Ui_Textpath_Data *pd = data;
Efl_Ui_Textpath_Segment *seg;
Evas_Map *map;
- double slice_unit;
int w1, w2;
int remained_w;
- int drawn_slice = 0;
int cur_map_point = 0, map_point_no;
Eina_Size2D sz;
+ int last_x1, last_y1, last_x2, last_y2;
- sz = efl_gfx_size_get(pd->text_obj);
- if (pd->autofit)
- remained_w = sz.w;
- else
- remained_w = pd->total_length;
- slice_unit = (double)pd->slice_no / pd->total_length;
+ last_x1 = last_y1 = last_x2 = last_y2 = 0;
+
+ sz = efl_gfx_entity_size_get(pd->text_obj);
+ remained_w = sz.w;
map_point_no = _map_point_calc(pd);
if (map_point_no == 0)
@@ -248,13 +339,18 @@ _text_draw(Efl_Ui_Textpath_Data *pd)
return;
}
map = evas_map_new(map_point_no);
+ evas_map_util_object_move_sync_set(map, EINA_TRUE);
+
+#ifdef EFL_UI_TEXTPATH_LINE_DEBUG
+ Evas_Object *line;
+ EINA_LIST_FREE(pd->lines, line)
+ evas_object_del(line);
+#endif
w1 = w2 = 0;
EINA_INLIST_FOREACH(pd->segments, seg)
{
int len = seg->length;
- if (!pd->autofit)
- len = (double)seg->length * sz.w / (double)pd->total_length;
if (remained_w <= 0)
break;
w2 = w1 + len;
@@ -262,26 +358,35 @@ _text_draw(Efl_Ui_Textpath_Data *pd)
w2 = sz.w;
if (seg->type == EFL_GFX_PATH_COMMAND_TYPE_LINE_TO)
{
- drawn_slice += 1;
_text_on_line_draw(pd, w1, w2, cur_map_point, map, seg->line);
cur_map_point += 4;
}
else
{
+ double slice_value, dt, dist;
int slice_no;
- slice_no = pd->slice_no * seg->length / (double)pd->total_length;
- if (slice_no == 0)
- slice_no = len * slice_unit + 1;
- drawn_slice += slice_no;
- _segment_draw(pd, slice_no, w1, w2, cur_map_point, map, seg->bezier);
+
+ slice_value = pd->slice_no * seg->length / (double)pd->total_length;
+ dt = (double)pd->total_length / (pd->slice_no * seg->length);
+ dist = (double)pd->total_length / (double)pd->slice_no;
+
+ slice_no = (int)ceil(slice_value);
+ dt = (double)slice_value * dt / (double)slice_no;
+ dist = (double)slice_value * dist / (double)slice_no;
+
+ _segment_draw(pd, slice_no, dt, dist,
+ w1, cur_map_point, map, seg->bezier,
+ &last_x1, &last_y1, &last_x2, &last_y2);
cur_map_point += slice_no * 4;
}
w1 = w2;
- remained_w -= len;
+ remained_w -= seg->length;
}
evas_object_map_enable_set(pd->text_obj, EINA_TRUE);
evas_object_map_set(pd->text_obj, map);
evas_map_free(map);
+
+ pd->draw_text_job = NULL;
}
static void
@@ -298,7 +403,7 @@ _path_data_get(Eo *obj, Efl_Ui_Textpath_Data *pd, Eina_Bool set_min)
free(seg);
}
- opos = efl_gfx_position_get(obj);
+ opos = efl_gfx_entity_position_get(obj);
pd->total_length = 0;
efl_gfx_path_get(obj, &cmd, &points);
@@ -400,16 +505,17 @@ _path_data_get(Eo *obj, Efl_Ui_Textpath_Data *pd, Eina_Bool set_min)
static void
_sizing_eval(Efl_Ui_Textpath_Data *pd)
{
- _text_draw(pd);
+ ecore_job_del(pd->draw_text_job);
+ pd->draw_text_job = ecore_job_add(_text_draw, pd);
}
static void
_textpath_ellipsis_set(Efl_Ui_Textpath_Data *pd, Eina_Bool enabled)
{
- edje_object_part_text_style_user_pop(pd->text_obj, "elm.text");
+ edje_object_part_text_style_user_pop(pd->text_obj, "efl.text");
if (enabled)
- edje_object_part_text_style_user_push(pd->text_obj, "elm.text",
+ edje_object_part_text_style_user_push(pd->text_obj, "efl.text",
"DEFAULT='ellipsis=1.0'");
}
@@ -422,7 +528,7 @@ _ellipsis_set(Efl_Ui_Textpath_Data *pd)
Eina_Bool is_ellipsis = EINA_FALSE;
const Evas_Object *tb;
- tb = edje_object_part_object_get(pd->text_obj, "elm.text");
+ tb = edje_object_part_object_get(pd->text_obj, "efl.text");
evas_object_textblock_size_native_get(tb, &w, &h);
evas_object_size_hint_min_set(pd->text_obj, w, h);
if (pd->ellipsis)
@@ -433,7 +539,7 @@ _ellipsis_set(Efl_Ui_Textpath_Data *pd)
w = pd->total_length;
}
}
- efl_gfx_size_set(pd->text_obj, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(pd->text_obj, EINA_SIZE2D(w, h));
_textpath_ellipsis_set(pd, is_ellipsis);
}
@@ -460,6 +566,7 @@ _textpath_text_set_internal(Eo *obj, Efl_Ui_Textpath_Data *pd, const char *part,
if (!text) text = "";
ret = edje_object_part_text_set(pd->text_obj, part, text);
_ellipsis_set(pd);
+ _sizing_eval(pd);
return ret;
}
@@ -483,7 +590,7 @@ _efl_ui_textpath_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Textpath_Data *priv)
elm_widget_style_get(obj));
efl_gfx_size_hint_weight_set(priv->text_obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
efl_gfx_size_hint_align_set(priv->text_obj, EVAS_HINT_FILL, EVAS_HINT_FILL);
- efl_gfx_visible_set(priv->text_obj, EINA_TRUE);
+ efl_gfx_entity_visible_set(priv->text_obj, EINA_TRUE);
evas_object_smart_member_add(priv->text_obj, obj);
elm_widget_sub_object_add(obj, priv->text_obj);
@@ -495,7 +602,6 @@ EOLIAN static Efl_Object *
_efl_ui_textpath_efl_object_constructor(Eo *obj, Efl_Ui_Textpath_Data *pd)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
- pd->autofit = EINA_TRUE;
pd->slice_no = SLICE_DEFAULT_NO;
pd->direction = EFL_UI_TEXTPATH_DIRECTION_CW;
@@ -514,6 +620,13 @@ _efl_ui_textpath_efl_object_destructor(Eo *obj, Efl_Ui_Textpath_Data *pd)
pd->segments = eina_inlist_remove(pd->segments, EINA_INLIST_GET(seg));
free(seg);
}
+ ecore_job_del(pd->draw_text_job);
+
+#ifdef EFL_UI_TEXTPATH_LINE_DEBUG
+ Evas_Object *line;
+ EINA_LIST_FREE(pd->lines, line)
+ evas_object_del(line);
+#endif
efl_destructor(efl_super(obj, MY_CLASS));
}
@@ -533,17 +646,17 @@ _efl_ui_textpath_text_get(Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Data *pd, const c
EOLIAN static void
_efl_ui_textpath_efl_text_text_set(Eo *obj, Efl_Ui_Textpath_Data *pd, const char *text)
{
- _textpath_text_set_internal(obj, pd, "elm.text", text);
+ _textpath_text_set_internal(obj, pd, "efl.text", text);
}
EOLIAN static const char *
-_efl_ui_textpath_efl_text_text_get(Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Data *pd)
+_efl_ui_textpath_efl_text_text_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Data *pd)
{
- return edje_object_part_text_get(pd->text_obj, "elm.text");
+ return edje_object_part_text_get(pd->text_obj, "efl.text");
}
EOLIAN static Efl_Ui_Theme_Apply
-_efl_ui_textpath_elm_widget_theme_apply(Eo *obj, Efl_Ui_Textpath_Data *pd)
+_efl_ui_textpath_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Textpath_Data *pd)
{
Efl_Ui_Theme_Apply ret = EFL_UI_THEME_APPLY_FAILED;
@@ -558,17 +671,17 @@ _efl_ui_textpath_elm_widget_theme_apply(Eo *obj, Efl_Ui_Textpath_Data *pd)
}
EOLIAN static void
-_efl_ui_textpath_efl_gfx_position_set(Eo *obj, Efl_Ui_Textpath_Data *pd, Eina_Position2D pos)
+_efl_ui_textpath_efl_gfx_entity_position_set(Eo *obj, Efl_Ui_Textpath_Data *pd, Eina_Position2D pos)
{
- efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
_path_data_get(obj, pd, EINA_FALSE);
- _text_draw(pd);
+ _sizing_eval(pd);
}
EOLIAN static void
-_efl_ui_textpath_efl_gfx_size_set(Eo *obj, Efl_Ui_Textpath_Data *pd EINA_UNUSED, Eina_Size2D sz)
+_efl_ui_textpath_efl_gfx_entity_size_set(Eo *obj, Efl_Ui_Textpath_Data *pd EINA_UNUSED, Eina_Size2D sz)
{
- efl_gfx_size_set(efl_super(obj, MY_CLASS), sz);
+ efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
}
EOLIAN static void
@@ -604,22 +717,8 @@ _efl_ui_textpath_circle_set(Eo *obj, Efl_Ui_Textpath_Data *pd, double x, double
_sizing_eval(pd);
}
-EOLIAN static Eina_Bool
-_efl_ui_textpath_autofit_get(Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Data *pd)
-{
- return pd->autofit;
-}
-
-EOLIAN static void
-_efl_ui_textpath_autofit_set(Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Data *pd, Eina_Bool autofit)
-{
- if (pd->autofit == autofit) return;
- pd->autofit = autofit;
- _sizing_eval(pd);
-}
-
EOLIAN static int
-_efl_ui_textpath_slice_number_get(Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Data *pd)
+_efl_ui_textpath_slice_number_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Data *pd)
{
return pd->slice_no;
}
@@ -643,7 +742,7 @@ _efl_ui_textpath_ellipsis_set(Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Data *pd, Ein
}
EOLIAN static Eina_Bool
-_efl_ui_textpath_ellipsis_get(Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Data *pd)
+_efl_ui_textpath_ellipsis_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Data *pd)
{
return pd->ellipsis;
}
diff --git a/src/lib/elementary/efl_ui_textpath.eo b/src/lib/elementary/efl_ui_textpath.eo
index 9c8faf9344..23740856dd 100644
--- a/src/lib/elementary/efl_ui_textpath.eo
+++ b/src/lib/elementary/efl_ui_textpath.eo
@@ -1,10 +1,10 @@
-enum Efl.Ui.Textpath.Direction {
+enum Efl.Ui.Textpath_Direction {
[[Textpath direction]]
cw, [[Clockwise]]
ccw [[Counter-clockwise]]
}
-class Efl.Ui.Textpath (Efl.Ui.Layout, Efl.Object, Efl.Text, Efl.Gfx.Path)
+class Efl.Ui.Textpath (Efl.Ui.Layout.Object, Efl.Object, Efl.Text, Efl.Gfx.Path)
{
[[Efl Ui Textpath class]]
methods {
@@ -15,16 +15,7 @@ class Efl.Ui.Textpath (Efl.Ui.Layout, Efl.Object, Efl.Text, Efl.Gfx.Path)
@in y: double; [[Y coordinate of center]]
@in radius: double; [[Radius of the circle]]
@in start_angle: double; [[Start angle of the circle]]
- @in direction: Efl.Ui.Textpath.Direction; [[Textpath direction]]
- }
- }
- @property autofit {
- [[The ability to fit the text within the path.
- Set it to $true to let text occupy only portion
- same as its size. Otherwise, text will occupied the whole path.
- By default, it is $true.]]
- values {
- autofit: bool; [[Autofit enabled if $true, $false otherwise]]
+ @in direction: Efl.Ui.Textpath_Direction; [[Textpath direction]]
}
}
@property slice_number {
@@ -50,9 +41,9 @@ class Efl.Ui.Textpath (Efl.Ui.Layout, Efl.Object, Efl.Text, Efl.Gfx.Path)
Efl.Object.destructor;
Efl.Canvas.Group.group_calculate;
Efl.Text.text {get; set;}
- Efl.Part.part;
- Elm.Widget.theme_apply;
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set; }
+ Efl.Part.part_get;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
}
}
diff --git a/src/lib/elementary/efl_ui_textpath_part.eo b/src/lib/elementary/efl_ui_textpath_part.eo
index 22ec019ea8..bf76088329 100644
--- a/src/lib/elementary/efl_ui_textpath_part.eo
+++ b/src/lib/elementary/efl_ui_textpath_part.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Textpath.Part (Efl.Ui.Layout.Part_Text)
+class Efl.Ui.Textpath_Part (Efl.Ui.Layout.Part_Text)
{
[[Efl UI Textpath internal part class]]
data: null;
diff --git a/src/lib/elementary/efl_ui_timepicker.c b/src/lib/elementary/efl_ui_timepicker.c
new file mode 100644
index 0000000000..3c13f4f89c
--- /dev/null
+++ b/src/lib/elementary/efl_ui_timepicker.c
@@ -0,0 +1,285 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <Elementary.h>
+
+#include "elm_priv.h"
+#include "efl_ui_timepicker_private.h"
+
+#define MY_CLASS EFL_UI_TIMEPICKER_CLASS
+
+#define MY_CLASS_NAME "Efl.Ui.Timepicker"
+
+#define FMT_LEN_MAX 32
+
+#define TIME_GET() \
+ do { \
+ Efl_Time t = efl_datetime_manager_value_get(pd->dt_manager); \
+ pd->cur_time[TIMEPICKER_HOUR] = t.tm_hour; \
+ pd->cur_time[TIMEPICKER_MIN] = t.tm_min; \
+ } while (0)
+
+#define TIME_SET() \
+ do { \
+ Efl_Time t; \
+ t.tm_hour = pd->cur_time[TIMEPICKER_HOUR]; \
+ t.tm_min = pd->cur_time[TIMEPICKER_MIN]; \
+ efl_datetime_manager_value_set(pd->dt_manager, t); \
+ } while (0)
+
+static const char *fmt_char[] = {"IHkl", "M", "Aa"};
+
+static Eina_Bool
+_validate_params(int hour, int min)
+{
+ if (hour < 0 || hour > 23 || min < 0 || min > 59)
+ return EINA_FALSE;
+ else return EINA_TRUE;
+}
+
+static Eina_Bool
+_time_cmp(int time1[], int time2[])
+{
+ unsigned int idx;
+
+ for (idx = 0; idx < EFL_UI_TIMEPICKER_TYPE_COUNT -1; idx++)
+ {
+ if (time1[idx] != time2[idx])
+ return EINA_FALSE;
+ }
+
+ return EINA_TRUE;
+}
+
+static void
+_field_value_update(Eo *obj)
+{
+ Efl_Ui_Timepicker_Data *pd = efl_data_scope_get(obj, MY_CLASS);
+
+ if (!pd->is_24hour)
+ {
+ if (pd->cur_time[TIMEPICKER_HOUR] >= 12)
+ {
+ //TODO: gets text from strftime.
+ efl_text_set(pd->ampm, "PM");
+ efl_ui_range_value_set(pd->hour, pd->cur_time[TIMEPICKER_HOUR] - 12);
+ }
+ else
+ {
+ efl_text_set(pd->ampm, "AM");
+ efl_ui_range_value_set(pd->hour, pd->cur_time[TIMEPICKER_HOUR] + 12);
+ }
+ }
+
+ efl_ui_range_value_set(pd->min, pd->cur_time[TIMEPICKER_MIN]);
+
+ TIME_SET();
+}
+
+static void
+_field_changed_cb(void *data, const Efl_Event *ev)
+{
+ Efl_Ui_Timepicker_Data *pd = efl_data_scope_get(data, MY_CLASS);
+
+ //TODO: hour value increase when min reached max.
+ if (ev->object == pd->hour)
+ {
+ pd->cur_time[TIMEPICKER_HOUR] = efl_ui_range_value_get(pd->hour);
+ if (!pd->is_24hour && !strcmp(efl_text_get(pd->ampm), "PM"))
+ pd->cur_time[TIMEPICKER_HOUR] += 12;
+ }
+ else if (ev->object == pd->min)
+ pd->cur_time[TIMEPICKER_MIN] = efl_ui_range_value_get(pd->min);
+ else
+ {
+ if (!strcmp(efl_text_get(pd->ampm), "PM"))
+ {
+ efl_text_set(pd->ampm, "AM");
+ pd->cur_time[TIMEPICKER_HOUR] -= 12;
+ }
+ else
+ {
+ efl_text_set(pd->ampm, "PM");
+ pd->cur_time[TIMEPICKER_HOUR] += 12;
+ }
+ }
+
+ TIME_SET();
+ efl_event_callback_call(data, EFL_UI_TIMEPICKER_EVENT_CHANGED, NULL);
+}
+
+static void
+_fields_init(Eo *obj)
+{
+ const char *fmt;
+ char ch;
+ int i;
+ int field = 0;
+ char buf[FMT_LEN_MAX];
+
+ Efl_Ui_Timepicker_Data *pd = efl_data_scope_get(obj, MY_CLASS);
+
+ //Field create.
+ pd->hour = efl_add(EFL_UI_SPIN_BUTTON_CLASS, obj,
+ efl_ui_range_min_max_set(efl_added, 1, 12),
+ efl_ui_spin_button_circulate_set(efl_added, EINA_TRUE),
+ efl_ui_spin_button_editable_set(efl_added, EINA_TRUE),
+ efl_event_callback_add(efl_added, EFL_UI_SPIN_EVENT_CHANGED,_field_changed_cb, obj),
+ elm_widget_element_update(obj, efl_added, "spin_button"));
+
+ pd->min = efl_add(EFL_UI_SPIN_BUTTON_CLASS, obj,
+ efl_ui_range_min_max_set(efl_added, 0, 59),
+ efl_ui_spin_button_circulate_set(efl_added, EINA_TRUE),
+ efl_ui_spin_button_editable_set(efl_added, EINA_TRUE),
+ efl_event_callback_add(efl_added, EFL_UI_SPIN_EVENT_CHANGED,_field_changed_cb, obj),
+ elm_widget_element_update(obj, efl_added, "spin_button"));
+
+ pd->ampm = efl_add(EFL_UI_BUTTON_CLASS, obj,
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _field_changed_cb, obj),
+ elm_widget_element_update(obj, efl_added, "button"));
+
+ pd->dt_manager = efl_add(EFL_DATETIME_MANAGER_CLASS, obj);
+
+ TIME_GET();
+
+ pd->is_24hour = EINA_FALSE;
+
+ _field_value_update(obj);
+
+ fmt = efl_datetime_manager_format_get(pd->dt_manager);
+ if (!fmt)
+ {
+ ERR("Failed to get current format.");
+ //Gives default format when the gets format failed.
+ fmt = "%H:%M %a";
+ }
+
+ //Sort fields by format.
+ while((ch = *fmt))
+ {
+ //TODO: ignore extensions and separators.
+ for (i = 0; i < EFL_UI_TIMEPICKER_TYPE_COUNT; i++)
+ {
+ if (strchr(fmt_char[i], ch))
+ {
+ snprintf(buf, sizeof(buf), "efl.field%d", field);
+ if (i == TIMEPICKER_HOUR)
+ efl_content_set(efl_part(obj, buf), pd->hour);
+ else if (i == TIMEPICKER_MIN)
+ efl_content_set(efl_part(obj, buf), pd->min);
+ else
+ {
+ //TODO: monitoring locale change and update field location.
+ if (field == 0)
+ {
+ elm_object_signal_emit(obj, "efl,state,colon,visible,field1", "efl");
+ elm_object_signal_emit(obj, "efl,state,colon,invisible,field0", "efl");
+ }
+ else
+ {
+ elm_object_signal_emit(obj, "efl,state,colon,visible,field0", "efl");
+ elm_object_signal_emit(obj, "efl,state,colon,invisible,field1", "efl");
+ }
+
+ elm_layout_signal_emit(obj, "efl,state,ampm,visible", "efl");
+ edje_object_message_signal_process(elm_layout_edje_get(obj));
+ efl_content_set(efl_part(obj, buf), pd->ampm);
+ }
+
+ field++;
+ break;
+ }
+ }
+ fmt++;
+ }
+}
+
+EOLIAN static void
+_efl_ui_timepicker_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Timepicker_Data *_pd EINA_UNUSED)
+{
+ Evas_Coord minw = -1, minh = -1;
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+
+ elm_coords_finger_size_adjust(1, &minw, 1, &minh);
+ edje_object_size_min_restricted_calc
+ (wd->resize_obj, &minw, &minh, minw, minh);
+ elm_coords_finger_size_adjust(1, &minw, 1, &minh);
+ evas_object_size_hint_min_set(obj, minw, minh);
+ evas_object_size_hint_max_set(obj, -1, -1);
+}
+
+EOLIAN static Eo *
+_efl_ui_timepicker_efl_object_constructor(Eo *obj, Efl_Ui_Timepicker_Data *pd EINA_UNUSED)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
+
+ if (!elm_widget_theme_klass_get(obj))
+ elm_widget_theme_klass_set(obj, "timepicker");
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+
+ if (!elm_widget_theme_object_set(obj, wd->resize_obj,
+ elm_widget_theme_klass_get(obj),
+ elm_widget_theme_element_get(obj),
+ elm_widget_theme_style_get(obj)))
+ CRI("Failed to set layout!");
+
+ _fields_init(obj);
+
+ elm_widget_sub_object_parent_add(obj);
+
+ elm_widget_can_focus_set(obj, EINA_TRUE);
+
+ return obj;
+}
+
+EOLIAN static void
+_efl_ui_timepicker_efl_object_destructor(Eo *obj, Efl_Ui_Timepicker_Data *pd EINA_UNUSED)
+{
+ efl_destructor(efl_super(obj, MY_CLASS));
+}
+
+EOLIAN static void
+_efl_ui_timepicker_time_set(Eo *obj, Efl_Ui_Timepicker_Data *pd, int hour, int min)
+{
+ int new_time[EFL_UI_TIMEPICKER_TYPE_COUNT - 1] = {hour, min};
+
+ if (!_validate_params(hour, min)) return;
+ if (_time_cmp(pd->cur_time, new_time)) return;
+
+ memcpy(pd->cur_time, new_time, (sizeof(int) * (EFL_UI_TIMEPICKER_TYPE_COUNT -1)));
+
+ TIME_SET();
+ _field_value_update(obj);
+}
+
+EOLIAN static void
+_efl_ui_timepicker_time_get(const Eo *obj EINA_UNUSED, Efl_Ui_Timepicker_Data *pd, int *hour, int *min)
+{
+ *hour = pd->cur_time[TIMEPICKER_HOUR];
+ *min = pd->cur_time[TIMEPICKER_MIN];
+}
+
+EOLIAN static void
+_efl_ui_timepicker_ampm_set(Eo *obj, Efl_Ui_Timepicker_Data *pd, Eina_Bool is_24hour)
+{
+ if (pd->is_24hour == is_24hour) return;
+
+ pd->is_24hour = is_24hour;
+ if (pd->is_24hour == EINA_TRUE)
+ elm_layout_signal_emit(obj, "efl,state,ampm,invisible", "efl");
+ else
+ elm_layout_signal_emit(obj, "efl,state,ampm,visible", "efl");
+ _field_value_update(obj);
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_timepicker_ampm_get(const Eo *obj EINA_UNUSED, Efl_Ui_Timepicker_Data *pd)
+{
+ return pd->is_24hour;
+}
+
+#define EFL_UI_TIMEPICKER_EXTRA_OPS \
+ ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_timepicker), \
+
+#include "efl_ui_timepicker.eo.c"
diff --git a/src/lib/elementary/efl_ui_timepicker.eo b/src/lib/elementary/efl_ui_timepicker.eo
new file mode 100644
index 0000000000..54fd2b6baa
--- /dev/null
+++ b/src/lib/elementary/efl_ui_timepicker.eo
@@ -0,0 +1,44 @@
+class Efl.Ui.Timepicker (Efl.Ui.Layout.Object)
+{
+ [[Timepicker widget
+
+ This is a widget which allows the user to pick a time using internal spinner.
+ User can use the internal spinner to select hour, minute, AM/PM or user can input
+ value using internal entry.
+ ]]
+ methods {
+ @property time {
+ [[The current value of time
+
+ $hour: Hour. The hour value is in terms of 24 hour format from 0 to 23.
+
+ $min: Minute. The minute range is from 0 to 59.
+ ]]
+ set {
+ }
+ get{
+ }
+ values {
+ hour: int; [[The hour value from 0 to 23.]]
+ min: int; [[The minute value from 0 to 59.]]
+ }
+ }
+ @property ampm {
+ [[Control if the Timepicker displays 24 hour time or 12 hour time including AM/PM button.]]
+ set {
+ }
+ get {
+ }
+ values {
+ is_24hour: bool; [[$true to display the 24 hour time, $false to display 12 hour time including AM/PM button.]]
+ }
+ }
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Object.destructor;
+ }
+ events {
+ changed: void; [[Called when date is changed]]
+ }
+}
diff --git a/src/lib/elementary/efl_ui_timepicker_private.h b/src/lib/elementary/efl_ui_timepicker_private.h
new file mode 100644
index 0000000000..6c871d7cc2
--- /dev/null
+++ b/src/lib/elementary/efl_ui_timepicker_private.h
@@ -0,0 +1,21 @@
+#ifndef EFL_UI_TIMEPICKER_PRIVATE_H
+#define EFL_UI_TIMEPICKER_PRIVATE_H
+
+#define EFL_UI_TIMEPICKER_TYPE_COUNT 3
+
+typedef enum _Efl_Ui_Timepicker_Field_Type
+{
+ TIMEPICKER_HOUR,
+ TIMEPICKER_MIN,
+ TIMEPICKER_AMPM
+} Efl_Ui_Timepicker_Field_Type;
+
+typedef struct _Efl_Ui_Timepicker_Data Efl_Ui_Timepicker_Data;
+struct _Efl_Ui_Timepicker_Data
+{
+ Eo *dt_manager, *hour, *min, *ampm;
+ int cur_time[EFL_UI_TIMEPICKER_TYPE_COUNT];
+ Eina_Bool is_24hour;
+};
+
+#endif
diff --git a/src/lib/elementary/efl_ui_video.c b/src/lib/elementary/efl_ui_video.c
index 9046777b07..c9afad2f13 100644
--- a/src/lib/elementary/efl_ui_video.c
+++ b/src/lib/elementary/efl_ui_video.c
@@ -4,7 +4,7 @@
#include <Emotion.h>
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#include <Elementary.h>
@@ -18,7 +18,6 @@
#define MY_CLASS EFL_UI_VIDEO_CLASS
#define MY_CLASS_NAME "Efl.Ui.Video"
-#define MY_CLASS_NAME_LEGACY "elm_video"
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_LAYOUT_FOCUSED, ""}, /**< handled by elm_layout */
@@ -99,7 +98,7 @@ _key_action_move(Evas_Object *obj, const char *params)
static Eina_Bool
_key_action_play(Evas_Object *obj, const char *params EINA_UNUSED)
{
- if (elm_video_is_playing_get(obj))
+ if (efl_player_play_get(obj))
elm_video_pause(obj);
else
elm_video_play(obj);
@@ -141,13 +140,19 @@ _on_size_hints_changed(void *data EINA_UNUSED,
static void
_on_open_done(void *data, const Efl_Event *event EINA_UNUSED)
{
- elm_layout_signal_emit(data, "elm,video,open", "elm");
+ if(elm_widget_is_legacy(data))
+ elm_layout_signal_emit(data, "elm,video,open", "elm");
+ else
+ elm_layout_signal_emit(data, "efl,video,open", "efl");
}
static void
_on_playback_started(void *data, const Efl_Event *event EINA_UNUSED)
{
- elm_layout_signal_emit(data, "elm,video,play", "elm");
+ if(elm_widget_is_legacy(data))
+ elm_layout_signal_emit(data, "elm,video,play", "elm");
+ else
+ elm_layout_signal_emit(data, "efl,video,play", "efl");
return;
@@ -158,7 +163,11 @@ _on_playback_finished(void *data, const Efl_Event *event EINA_UNUSED)
{
EFL_UI_VIDEO_DATA_GET(data, sd);
emotion_object_play_set(sd->emotion, EINA_FALSE);
- elm_layout_signal_emit(data, "elm,video,end", "elm");
+
+ if(elm_widget_is_legacy(data))
+ elm_layout_signal_emit(data, "elm,video,end", "elm");
+ else
+ elm_layout_signal_emit(data, "efl,video,end", "efl");
}
static void
@@ -175,8 +184,17 @@ _on_title_changed(void *data, const Efl_Event *event EINA_UNUSED)
EFL_UI_VIDEO_DATA_GET(data, sd);
title = emotion_object_title_get(sd->emotion);
- elm_layout_text_set(data, "elm,title", title);
- elm_layout_signal_emit(data, "elm,video,title", "elm");
+
+ if(elm_widget_is_legacy(data))
+ {
+ elm_layout_text_set(data, "elm,title", title);
+ elm_layout_signal_emit(data, "elm,video,title", "elm");
+ }
+ else
+ {
+ elm_layout_text_set(data, "efl,title", title);
+ elm_layout_signal_emit(data, "efl,video,title", "efl");
+ }
}
static void
@@ -220,7 +238,6 @@ EOLIAN static void
_efl_ui_video_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Video_Data *priv)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
- _elm_emotion_init();
if (!elm_widget_theme_klass_get(obj))
elm_widget_theme_klass_set(obj, "video");
@@ -238,7 +255,10 @@ _efl_ui_video_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Video_Data *priv)
elm_widget_theme_style_get(obj)))
CRI("Failed to set layout!");
- elm_layout_content_set(obj, "elm.swallow.video", priv->emotion);
+ if (elm_widget_is_legacy(obj))
+ elm_layout_content_set(obj, "elm.swallow.video", priv->emotion);
+ else
+ elm_layout_content_set(obj, "efl.video", priv->emotion);
efl_event_callback_array_add(priv->emotion, _video_cb(), obj);
@@ -258,20 +278,12 @@ _efl_ui_video_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Video_Data *sd)
efl_canvas_group_del(efl_super(obj, MY_CLASS));
}
-EAPI Evas_Object *
-elm_video_add(Evas_Object *parent)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return elm_legacy_add(MY_CLASS, parent);
-}
-
EOLIAN static Eo *
_efl_ui_video_efl_object_constructor(Eo *obj, Efl_Ui_Video_Data *_pd EINA_UNUSED)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
- efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_ANIMATION);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_ANIMATION);
return obj;
}
@@ -286,52 +298,69 @@ _efl_ui_video_efl_file_file_set(Eo *obj, Efl_Ui_Video_Data *sd, const char *file
if (filename && ((!strncmp(filename, "file://", 7)) || (!strstr(filename, "://"))))
emotion_object_last_position_load(sd->emotion);
- elm_layout_signal_emit(obj, "elm,video,load", "elm");
+ if(elm_widget_is_legacy(obj))
+ elm_layout_signal_emit(obj, "elm,video,load", "elm");
+ else
+ elm_layout_signal_emit(obj, "efl,video,load", "efl");
return EINA_TRUE;
}
EOLIAN static void
-_efl_ui_video_efl_file_file_get(Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *sd EINA_UNUSED, const char **filename, const char **key EINA_UNUSED)
+_efl_ui_video_efl_file_file_get(const Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *sd EINA_UNUSED, const char **filename, const char **key EINA_UNUSED)
{
if (filename)
*filename = emotion_object_file_get(sd->emotion);
}
EOLIAN static Evas_Object*
-_efl_ui_video_emotion_get(Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *sd)
+_efl_ui_video_emotion_get(const Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *sd)
{
return sd->emotion;
}
EOLIAN static void
-_efl_ui_video_play(Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *sd)
+_efl_ui_video_efl_player_start(Eo *obj, Efl_Ui_Video_Data *sd EINA_UNUSED)
{
- if (emotion_object_play_get(sd->emotion)) return;
-
- ELM_SAFE_FREE(sd->timer, ecore_timer_del);
- sd->stop = EINA_FALSE;
- emotion_object_play_set(sd->emotion, EINA_TRUE);
- elm_layout_signal_emit(obj, "elm,video,play", "elm");
+ efl_player_pos_set(obj, 0.0);
+ efl_player_play_set(obj, EINA_TRUE);
}
-/* FIXME: pause will setup timer and go into sleep or
- * hibernate after a while without activity.
- */
EOLIAN static void
-_efl_ui_video_pause(Eo *obj, Efl_Ui_Video_Data *sd)
+_efl_ui_video_efl_player_play_set(Eo *obj, Efl_Ui_Video_Data *sd, Eina_Bool play)
{
- if (!emotion_object_play_get(sd->emotion)) return;
+ if (emotion_object_play_get(sd->emotion) == !!play) return;
- if (!sd->timer) sd->timer = ecore_timer_add(20.0, _suspend_cb, obj);
- emotion_object_play_set(sd->emotion, EINA_FALSE);
- elm_layout_signal_emit(obj, "elm,video,pause", "elm");
+ if (play)
+ {
+ ELM_SAFE_FREE(sd->timer, ecore_timer_del);
+ sd->stop = EINA_FALSE;
+ emotion_object_play_set(sd->emotion, EINA_TRUE);
+
+ if(elm_widget_is_legacy(obj))
+ elm_layout_signal_emit(obj, "elm,video,play", "elm");
+ else
+ elm_layout_signal_emit(obj, "efl,video,play", "efl");
+ }
+ else
+ {
+ /* FIXME: pause will setup timer and go into sleep or
+ * hibernate after a while without activity.
+ */
+ if (!sd->timer) sd->timer = ecore_timer_add(20.0, _suspend_cb, obj);
+ emotion_object_play_set(sd->emotion, EINA_FALSE);
+
+ if(elm_widget_is_legacy(obj))
+ elm_layout_signal_emit(obj, "elm,video,pause", "elm");
+ else
+ elm_layout_signal_emit(obj, "efl,video,pause", "efl");
+ }
}
/* FIXME: stop should go into hibernate state directly.
*/
EOLIAN static void
-_efl_ui_video_stop(Eo *obj, Efl_Ui_Video_Data *sd)
+_efl_ui_video_efl_player_stop(Eo *obj, Efl_Ui_Video_Data *sd)
{
if (!emotion_object_play_get(sd->emotion) && sd->stop) return;
@@ -339,18 +368,23 @@ _efl_ui_video_stop(Eo *obj, Efl_Ui_Video_Data *sd)
sd->stop = EINA_TRUE;
emotion_object_play_set(sd->emotion, EINA_FALSE);
- elm_layout_signal_emit(obj, "elm,video,stop", "elm");
+
+ if(elm_widget_is_legacy(obj))
+ elm_layout_signal_emit(obj, "elm,video,stop", "elm");
+ else
+ elm_layout_signal_emit(obj, "efl,video,stop", "efl");
+
emotion_object_suspend_set(sd->emotion, EMOTION_HIBERNATE);
}
EOLIAN static Eina_Bool
-_efl_ui_video_is_playing_get(Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *sd)
+_efl_ui_video_efl_player_play_get(const Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *sd)
{
return emotion_object_play_get(sd->emotion);
}
EOLIAN static const char*
-_efl_ui_video_title_get(Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *sd)
+_efl_ui_video_title_get(const Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *sd)
{
return emotion_object_title_get(sd->emotion);
}
@@ -362,19 +396,13 @@ _efl_ui_video_remember_position_set(Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *sd,
}
EOLIAN static Eina_Bool
-_efl_ui_video_remember_position_get(Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *sd)
+_efl_ui_video_remember_position_get(const Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *sd)
{
return sd->remember;
}
-EOLIAN static void
-_efl_ui_video_class_constructor(Efl_Class *klass)
-{
- evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
-}
-
EOLIAN const Efl_Access_Action_Data *
-_efl_ui_video_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *pd EINA_UNUSED)
+_efl_ui_video_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *pd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "move,left", "move", "left", _key_action_move},
@@ -384,6 +412,42 @@ _efl_ui_video_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Efl_
};
return &atspi_actions[0];
}
+/* Internal EO APIs and hidden overrides */
+
+ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_video, Efl_Ui_Video_Data)
+
+/* Internal EO APIs and hidden overrides */
+
+#define EFL_UI_VIDEO_EXTRA_OPS \
+ ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_video), \
+ EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_video)
+
+#include "efl_ui_video.eo.c"
+
+#include "efl_ui_video_legacy.eo.h"
+
+#define MY_CLASS_NAME_LEGACY "elm_video"
+
+static void
+_efl_ui_video_legacy_class_constructor(Efl_Class *klass)
+{
+ evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
+}
+
+EOLIAN static Eo *
+_efl_ui_video_legacy_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED)
+{
+ obj = efl_constructor(efl_super(obj, EFL_UI_VIDEO_LEGACY_CLASS));
+ efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
+ return obj;
+}
+
+EAPI Evas_Object *
+elm_video_add(Evas_Object *parent)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ return elm_legacy_add(EFL_UI_VIDEO_LEGACY_CLASS, parent);
+}
EAPI Eina_Bool
elm_video_file_set(Eo *obj, const char *filename)
@@ -436,23 +500,37 @@ elm_video_is_seekable_get(const Evas_Object *obj)
EAPI void
elm_video_play_position_set(Evas_Object *obj, double position)
{
- efl_player_position_set(obj, position);
+ efl_player_pos_set(obj, position);
}
EAPI double
elm_video_play_position_get(const Evas_Object *obj)
{
- return efl_player_position_get(obj);
+ return efl_player_pos_get(obj);
}
-/* Internal EO APIs and hidden overrides */
+EAPI Eina_Bool
+elm_video_is_playing_get(Evas_Object *obj)
+{
+ return efl_player_play_get(obj);
+}
-ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_video, Efl_Ui_Video_Data)
+EAPI void
+elm_video_play(Evas_Object *obj)
+{
+ efl_player_play_set(obj, EINA_TRUE);
+}
-/* Internal EO APIs and hidden overrides */
+EAPI void
+elm_video_stop(Evas_Object *obj)
+{
+ efl_player_stop(obj);
+}
-#define EFL_UI_VIDEO_EXTRA_OPS \
- ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_video), \
- EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_video)
+EAPI void
+elm_video_pause(Evas_Object *obj)
+{
+ efl_player_play_set(obj, EINA_FALSE);
+}
-#include "efl_ui_video.eo.c"
+#include "efl_ui_video_legacy.eo.c"
diff --git a/src/lib/elementary/efl_ui_video.eo b/src/lib/elementary/efl_ui_video.eo
index f5a7940768..47b19c139e 100644
--- a/src/lib/elementary/efl_ui_video.eo
+++ b/src/lib/elementary/efl_ui_video.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Video (Efl.Ui.Layout, Efl.File,
+class Efl.Ui.Video (Efl.Ui.Layout.Object, Efl.File,
Efl.Player, Efl.Access.Widget.Action)
{
[[Efl UI video class]]
@@ -23,16 +23,6 @@ class Efl.Ui.Video (Efl.Ui.Layout, Efl.File,
remember: bool; [[$true when the object can remember the last position, $false otherwise]]
}
}
- @property is_playing {
- get {
- [[Is the video actually playing.
-
- You should consider watching event on the object instead of
- polling the object state.
- ]]
- return: bool; [[$true if the video is playing, $false otherwise]]
- }
- }
@property emotion {
get {
[[Get the underlying Emotion object.]]
@@ -50,21 +40,14 @@ class Efl.Ui.Video (Efl.Ui.Layout, Efl.File,
return: string; [[A string containing the title.]]
}
}
- play {
- [[Start playing a video.]]
- }
- pause {
- [[Pause a video.]]
- }
- stop {
- [[Stop a video.]]
- }
}
implements {
- class.constructor;
Efl.Object.constructor;
Efl.File.file { get; set; }
- Elm.Widget.widget_event;
+ Efl.Ui.Widget.widget_event;
Efl.Access.Widget.Action.elm_actions { get; }
+ Efl.Player.start;
+ Efl.Player.stop;
+ Efl.Player.play { get; set; }
}
}
diff --git a/src/lib/elementary/efl_ui_video_legacy.eo b/src/lib/elementary/efl_ui_video_legacy.eo
new file mode 100644
index 0000000000..9edfc48867
--- /dev/null
+++ b/src/lib/elementary/efl_ui_video_legacy.eo
@@ -0,0 +1,9 @@
+class Efl.Ui.Video_Legacy (Efl.Ui.Video, Efl.Ui.Legacy)
+{
+ [[Efl UI video class]]
+ data: null;
+ implements {
+ class.constructor;
+ Efl.Object.constructor;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_video_legacy.h b/src/lib/elementary/efl_ui_video_legacy.h
index 0cc087b02b..70ac16a718 100644
--- a/src/lib/elementary/efl_ui_video_legacy.h
+++ b/src/lib/elementary/efl_ui_video_legacy.h
@@ -1,3 +1,5 @@
+typedef Eo Elm_Video;
+
/**
* @brief Add a new Elm_Player object to the given parent Elementary (container) object.
*
@@ -135,4 +137,36 @@ EAPI void elm_video_play_position_set(Evas_Object *obj, double position);
*/
EAPI double elm_video_play_position_get(const Evas_Object *obj);
+/**
+ * @brief Get whether the video actually playing.
+ * You should consider watching event on the object instead of
+ * polling the object state.
+ *
+ * @return @c true if the video is playing, @c false otherwise.
+ *
+ * @ingroup Elm_Video
+ */
+EAPI Eina_Bool elm_video_is_playing_get(Evas_Object *obj);
+
+/**
+ * @brief Start playing a video.
+ *
+ * @ingroup Elm_Video
+ */
+EAPI void elm_video_play(Evas_Object *obj);
+
+/**
+ * @brief Stop a video.
+ *
+ * @ingroup Elm_Video
+ */
+EAPI void elm_video_stop(Evas_Object *obj);
+
+/**
+ * @brief Pause a video.
+ *
+ * @ingroup Elm_Video
+ */
+EAPI void elm_video_pause(Evas_Object *obj);
+
#include "efl_ui_video.eo.legacy.h"
diff --git a/src/lib/elementary/efl_ui_video_private.h b/src/lib/elementary/efl_ui_video_private.h
index c38ddb7bf9..4a2c0b90c5 100644
--- a/src/lib/elementary/efl_ui_video_private.h
+++ b/src/lib/elementary/efl_ui_video_private.h
@@ -44,7 +44,7 @@ struct _Efl_Ui_Video_Data
EFL_UI_VIDEO_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -53,7 +53,7 @@ struct _Efl_Ui_Video_Data
EFL_UI_VIDEO_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/efl_ui_view_list.c b/src/lib/elementary/efl_ui_view_list.c
new file mode 100644
index 0000000000..ca31058401
--- /dev/null
+++ b/src/lib/elementary/efl_ui_view_list.c
@@ -0,0 +1,1035 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+#define EFL_ACCESS_OBJECT_PROTECTED
+#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
+#define EFL_ACCESS_SELECTION_PROTECTED
+#define EFL_UI_SCROLL_MANAGER_PROTECTED
+#define EFL_UI_SCROLLBAR_PROTECTED
+#define EFL_UI_SCROLLBAR_BETA
+#define EFL_GFX_SIZE_HINT_PROTECTED
+#define EFL_UI_VIEW_LIST_PROTECTED
+#define EFL_UI_FOCUS_COMPOSITION_PROTECTED
+#define EFL_UI_WIDGET_FOCUS_MANAGER_PROTECTED
+
+#include <Elementary.h>
+#include "efl_ui_view_list_private.h"
+#include "efl_ui_view_list_precise_layouter.eo.h"
+
+#include <assert.h>
+
+#define MY_CLASS EFL_UI_VIEW_LIST_CLASS
+#define MY_CLASS_NAME "Efl.Ui.View.List"
+
+#define MY_PAN_CLASS EFL_UI_VIEW_LIST_PAN_CLASS
+
+#define SIG_CHILD_ADDED "child,added"
+#define SIG_CHILD_REMOVED "child,removed"
+#define SELECTED_PROP "selected"
+
+static const Evas_Smart_Cb_Description _smart_callbacks[] = {
+ {SIG_CHILD_ADDED, ""},
+ {SIG_CHILD_REMOVED, ""},
+ {NULL, NULL}
+};
+
+void _efl_ui_view_list_custom_layout(Efl_Ui_View_List *);
+void _efl_ui_view_list_item_select_set(Efl_Ui_View_List_LayoutItem*, Eina_Bool);
+static void _layout(Efl_Ui_View_List_Data* pd);
+
+static Eina_Bool _key_action_move(Evas_Object *obj, const char *params);
+static Eina_Bool _key_action_select(Evas_Object *obj, const char *params);
+static Eina_Bool _key_action_escape(Evas_Object *obj, const char *params);
+
+static const Elm_Action key_actions[] = {
+ {"move", _key_action_move},
+ {"select", _key_action_select},
+ {"escape", _key_action_escape},
+ {NULL, NULL}
+};
+
+EOLIAN static void
+_efl_ui_view_list_pan_efl_canvas_group_group_calculate(Eo *obj EINA_UNUSED, Efl_Ui_View_List_Pan_Data *psd)
+{
+ evas_object_smart_changed(psd->wobj);
+}
+
+
+EOLIAN static void
+_efl_ui_view_list_pan_efl_ui_pan_pan_position_set(Eo *obj EINA_UNUSED, Efl_Ui_View_List_Pan_Data *psd, Eina_Position2D pos)
+{
+ if ((pos.x == psd->gmt.x) && (pos.y == psd->gmt.y)) return;
+
+ psd->gmt.x = pos.x;
+ psd->gmt.y = pos.y;
+
+ efl_event_callback_call(obj, EFL_UI_PAN_EVENT_POSITION_CHANGED, NULL);
+ evas_object_smart_changed(psd->wobj);
+}
+
+EOLIAN static Eina_Position2D
+_efl_ui_view_list_pan_efl_ui_pan_pan_position_get(const Eo *obj EINA_UNUSED, Efl_Ui_View_List_Pan_Data *psd)
+{
+ return psd->gmt.pos;
+}
+
+EOLIAN static Eina_Position2D
+_efl_ui_view_list_pan_efl_ui_pan_pan_position_max_get(const Eo *obj EINA_UNUSED, Efl_Ui_View_List_Pan_Data *psd)
+{
+ EFL_UI_VIEW_LIST_DATA_GET(psd->wobj, pd);
+ Eina_Rect vgmt = {};
+ Eina_Size2D min = {};
+
+ vgmt = efl_ui_scrollable_viewport_geometry_get(pd->scrl_mgr);
+ min = efl_ui_view_list_model_min_size_get(psd->wobj);
+
+ min.w = min.w - vgmt.w;
+ if (min.w < 0) min.w = 0;
+ min.h = min.h - vgmt.h;
+ if (min.h < 0) min.h = 0;
+
+ return EINA_POSITION2D(min.w, min.h);
+}
+
+EOLIAN static Eina_Position2D
+_efl_ui_view_list_pan_efl_ui_pan_pan_position_min_get(const Eo *obj EINA_UNUSED, Efl_Ui_View_List_Pan_Data *psd EINA_UNUSED)
+{
+ return EINA_POSITION2D(0, 0);
+}
+
+EOLIAN static Eina_Size2D
+_efl_ui_view_list_pan_efl_ui_pan_content_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_View_List_Pan_Data *psd)
+{
+ Eina_Size2D min = {};
+ min = efl_ui_view_list_model_min_size_get(psd->wobj);
+
+ return min;
+}
+
+EOLIAN static void
+_efl_ui_view_list_pan_efl_object_destructor(Eo *obj, Efl_Ui_View_List_Pan_Data *psd EINA_UNUSED)
+{
+ efl_destructor(efl_super(obj, MY_PAN_CLASS));
+}
+
+#include "efl_ui_view_list_pan.eo.c"
+
+EOLIAN static void
+_efl_ui_view_list_efl_ui_scrollable_interactive_content_pos_set(Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *psd, Eina_Position2D pos)
+{
+ efl_ui_scrollable_content_pos_set(psd->scrl_mgr, pos);
+}
+
+EOLIAN static Eina_Position2D
+_efl_ui_view_list_efl_ui_scrollable_interactive_content_pos_get(const Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *psd)
+{
+ Eina_Position2D pos = efl_ui_scrollable_content_pos_get(psd->scrl_mgr);
+ return pos;
+}
+
+EOLIAN static Eina_Size2D
+_efl_ui_view_list_efl_ui_scrollable_interactive_content_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *psd)
+{
+ Eina_Size2D size = efl_ui_scrollable_content_size_get(psd->scrl_mgr);
+ return size;
+}
+
+EOLIAN static Eina_Rect
+_efl_ui_view_list_efl_ui_scrollable_interactive_viewport_geometry_get(const Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *psd)
+{
+ Eina_Rect gmt = efl_ui_scrollable_viewport_geometry_get(psd->scrl_mgr);
+ return gmt;
+}
+
+static Eina_Bool
+_efl_model_properties_has(Efl_Model *model, Eina_Stringshare *propfind)
+{
+ const Eina_Array *properties;
+ Eina_Array_Iterator iter_prop;
+ Eina_Stringshare *property;
+ Eina_Bool ret = EINA_FALSE;
+ unsigned i = 0;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(model, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(propfind, EINA_FALSE);
+
+ properties = efl_model_properties_get(model);
+
+ EINA_ARRAY_ITER_NEXT(properties, i, property, iter_prop)
+ {
+ if (property == propfind)
+ {
+ ret = EINA_TRUE;
+ break;
+ }
+ }
+ return ret;
+}
+
+static void
+_list_element_focused(void *data EINA_UNUSED, const Efl_Event *ev)
+{
+ Eina_Rect geom;
+ Eina_Position2D pos;
+ Efl_Ui_Focus_Object *focused = efl_ui_focus_manager_focus_get(ev->object);
+
+ if (!focused) return;
+
+ EFL_UI_VIEW_LIST_DATA_GET(ev->object, pd);
+ geom = efl_ui_focus_object_focus_geometry_get(focused);
+ pos = efl_ui_scrollable_content_pos_get(pd->scrl_mgr);
+
+ geom.x += pos.x;
+ geom.y += pos.y;
+ efl_ui_scrollable_scroll(pd->scrl_mgr, geom, EINA_TRUE);
+}
+
+static void
+_on_item_mouse_up(void *data, Evas *evas EINA_UNUSED, Evas_Object *o EINA_UNUSED, void *event_info)
+{
+ Evas_Event_Mouse_Down *ev = event_info;
+ Efl_Ui_View_List_LayoutItem *item = data;
+
+ if (ev->button != 1) return;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
+
+ _efl_ui_view_list_item_select_set(item, EINA_TRUE);
+}
+
+EOLIAN static void
+_efl_ui_view_list_select_mode_set(Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *pd, Elm_Object_Select_Mode mode)
+{
+ if (pd->select_mode == mode)
+ return;
+
+ pd->select_mode = mode;
+}
+
+EOLIAN static Elm_Object_Select_Mode
+_efl_ui_view_list_select_mode_get(const Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *pd)
+{
+ return pd->select_mode;
+}
+
+EOLIAN static void
+_efl_ui_view_list_default_style_set(Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *pd, Eina_Stringshare *style)
+{
+ eina_stringshare_replace(&pd->style, style);
+}
+
+EOLIAN static Eina_Stringshare *
+_efl_ui_view_list_default_style_get(const Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *pd)
+{
+ return pd->style;
+}
+
+EOLIAN static void
+_efl_ui_view_list_homogeneous_set(Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *pd, Eina_Bool homogeneous)
+{
+ pd->homogeneous = homogeneous;
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_view_list_homogeneous_get(const Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *pd)
+{
+ return pd->homogeneous;
+}
+
+EOLIAN static void
+_efl_ui_view_list_efl_gfx_entity_position_set(Eo *obj, Efl_Ui_View_List_Data *pd, Eina_Position2D pos)
+{
+ if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
+ return;
+
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
+ evas_object_smart_changed(pd->obj);
+}
+
+EOLIAN static void
+_efl_ui_view_list_efl_gfx_entity_size_set(Eo *obj, Efl_Ui_View_List_Data *pd, Eina_Size2D size)
+{
+ if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, size.w, size.h))
+ return;
+
+ efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), size);
+
+ evas_object_smart_changed(pd->obj);
+}
+
+EOLIAN static void
+_efl_ui_view_list_efl_canvas_group_group_calculate(Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *pd)
+{
+ _layout(pd);
+}
+
+EOLIAN static void
+_efl_ui_view_list_efl_canvas_group_group_member_add(Eo *obj, Efl_Ui_View_List_Data *pd EINA_UNUSED, Evas_Object *member)
+{
+ efl_canvas_group_member_add(efl_super(obj, MY_CLASS), member);
+}
+
+//Scrollable Implement
+static void
+_efl_ui_view_list_bar_read_and_update(Eo *obj)
+{
+ EFL_UI_VIEW_LIST_DATA_GET(obj, pd);
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+ double vx, vy;
+
+ edje_object_part_drag_value_get
+ (wd->resize_obj, "efl.dragable.vbar", NULL, &vy);
+ edje_object_part_drag_value_get
+ (wd->resize_obj, "efl.dragable.hbar", &vx, NULL);
+
+ efl_ui_scrollbar_bar_position_set(pd->scrl_mgr, vx, vy);
+
+ efl_canvas_group_change(pd->pan_obj);
+}
+
+static void
+_efl_ui_view_list_reload_cb(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
+{
+ EFL_UI_VIEW_LIST_DATA_GET(data, pd);
+
+ efl_ui_scrollbar_bar_visibility_update(pd->scrl_mgr);
+}
+
+static void
+_efl_ui_view_list_vbar_drag_cb(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
+{
+ _efl_ui_view_list_bar_read_and_update(data);
+
+ Efl_Ui_Scrollbar_Direction type = EFL_UI_SCROLLBAR_DIRECTION_VERTICAL;
+ efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_DRAG, &type);
+}
+
+static void
+_efl_ui_view_list_vbar_press_cb(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
+{
+ Efl_Ui_Scrollbar_Direction type = EFL_UI_SCROLLBAR_DIRECTION_VERTICAL;
+ efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_PRESS, &type);
+}
+
+static void
+_efl_ui_view_list_vbar_unpress_cb(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
+{
+ Efl_Ui_Scrollbar_Direction type = EFL_UI_SCROLLBAR_DIRECTION_VERTICAL;
+ efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_UNPRESS, &type);
+}
+
+static void
+_efl_ui_view_list_edje_drag_start_cb(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
+{
+ EFL_UI_VIEW_LIST_DATA_GET(data, pd);
+
+ _efl_ui_view_list_bar_read_and_update(data);
+
+ pd->scrl_freeze = efl_ui_scrollable_scroll_freeze_get(pd->scrl_mgr);
+ efl_ui_scrollable_scroll_freeze_set(pd->scrl_mgr, EINA_TRUE);
+ efl_event_callback_call(data, EFL_UI_EVENT_SCROLL_DRAG_START, NULL);
+}
+
+static void
+_efl_ui_view_list_edje_drag_stop_cb(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
+{
+ EFL_UI_VIEW_LIST_DATA_GET(data, pd);
+
+ _efl_ui_view_list_bar_read_and_update(data);
+
+ efl_ui_scrollable_scroll_freeze_set(pd->scrl_mgr, pd->scrl_freeze);
+ efl_event_callback_call(data, EFL_UI_EVENT_SCROLL_DRAG_STOP, NULL);
+}
+
+static void
+_efl_ui_view_list_edje_drag_cb(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
+{
+ _efl_ui_view_list_bar_read_and_update(data);
+}
+
+static void
+_efl_ui_view_list_hbar_drag_cb(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
+{
+ _efl_ui_view_list_bar_read_and_update(data);
+
+ Efl_Ui_Scrollbar_Direction type = EFL_UI_SCROLLBAR_DIRECTION_HORIZONTAL;
+ efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_DRAG, &type);
+}
+
+static void
+_efl_ui_view_list_hbar_press_cb(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
+{
+ Efl_Ui_Scrollbar_Direction type = EFL_UI_SCROLLBAR_DIRECTION_HORIZONTAL;
+ efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_PRESS, &type);
+}
+
+static void
+_efl_ui_view_list_hbar_unpress_cb(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
+{
+ Efl_Ui_Scrollbar_Direction type = EFL_UI_SCROLLBAR_DIRECTION_HORIZONTAL;
+ efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_UNPRESS, &type);
+}
+
+static void
+_scroll_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
+{
+ //scroll cb
+}
+
+static void
+_efl_ui_view_list_bar_size_changed_cb(void *data, const Efl_Event *event EINA_UNUSED)
+{
+ Eo *obj = data;
+ EFL_UI_VIEW_LIST_DATA_GET(obj, pd);
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+
+ double width = 0.0, height = 0.0;
+
+ efl_ui_scrollbar_bar_size_get(pd->scrl_mgr, &width, &height);
+
+ edje_object_part_drag_size_set(wd->resize_obj, "efl.dragable.hbar", width, 1.0);
+ edje_object_part_drag_size_set(wd->resize_obj, "efl.dragable.vbar", 1.0, height);
+}
+
+static void
+_efl_ui_view_list_bar_pos_changed_cb(void *data, const Efl_Event *event EINA_UNUSED)
+{
+ Eo *obj = data;
+ EFL_UI_VIEW_LIST_DATA_GET(obj, pd);
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+
+ double posx = 0.0, posy = 0.0;
+
+ efl_ui_scrollbar_bar_position_get(pd->scrl_mgr, &posx, &posy);
+
+ edje_object_part_drag_value_set(wd->resize_obj, "efl.dragable.hbar", posx, 0.0);
+ edje_object_part_drag_value_set(wd->resize_obj, "efl.dragable.vbar", 0.0, posy);
+}
+
+static void
+_efl_ui_view_list_bar_show_cb(void *data, const Efl_Event *event)
+{
+ Eo *obj = data;
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+ Efl_Ui_Scrollbar_Direction type = *(Efl_Ui_Scrollbar_Direction *)(event->info);
+
+ if (type == EFL_UI_SCROLLBAR_DIRECTION_HORIZONTAL)
+ edje_object_signal_emit(wd->resize_obj, "efl,action,show,hbar", "efl");
+ else if (type == EFL_UI_SCROLLBAR_DIRECTION_VERTICAL)
+ edje_object_signal_emit(wd->resize_obj, "efl,action,show,vbar", "efl");
+}
+
+static void
+_efl_ui_view_list_bar_hide_cb(void *data, const Efl_Event *event)
+{
+ Eo *obj = data;
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+ Efl_Ui_Scrollbar_Direction type = *(Efl_Ui_Scrollbar_Direction *)(event->info);
+
+ if (type == EFL_UI_SCROLLBAR_DIRECTION_HORIZONTAL)
+ edje_object_signal_emit(wd->resize_obj, "efl,action,hide,hbar", "efl");
+ else if (type == EFL_UI_SCROLLBAR_DIRECTION_VERTICAL)
+ edje_object_signal_emit(wd->resize_obj, "efl,action,hide,vbar", "efl");
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_view_list_efl_layout_signal_signal_callback_add(Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *sd EINA_UNUSED, const char *emission, const char *source, Edje_Signal_Cb func_cb, void *data)
+{
+ Eina_Bool ok;
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
+
+ ok = efl_layout_signal_callback_add(wd->resize_obj, emission, source, func_cb, data);
+
+ return ok;
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_view_list_efl_layout_signal_signal_callback_del(Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *sd EINA_UNUSED, const char *emission, const char *source, Edje_Signal_Cb func_cb, void *data)
+{
+ Eina_Bool ok;
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
+
+ ok = efl_layout_signal_callback_del(wd->resize_obj, emission, source, func_cb, data);
+
+ return ok;
+}
+
+static void
+_efl_ui_view_list_edje_object_attach(Eo *obj)
+{
+ efl_layout_signal_callback_add
+ (obj, "reload", "efl", _efl_ui_view_list_reload_cb, obj);
+ //Vertical bar
+ efl_layout_signal_callback_add
+ (obj, "drag", "efl.dragable.vbar", _efl_ui_view_list_vbar_drag_cb,
+ obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,set", "efl.dragable.vbar",
+ _efl_ui_view_list_edje_drag_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,start", "efl.dragable.vbar",
+ _efl_ui_view_list_edje_drag_start_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,stop", "efl.dragable.vbar",
+ _efl_ui_view_list_edje_drag_stop_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,step", "efl.dragable.vbar",
+ _efl_ui_view_list_edje_drag_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,page", "efl.dragable.vbar",
+ _efl_ui_view_list_edje_drag_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "efl,vbar,press", "efl",
+ _efl_ui_view_list_vbar_press_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "efl,vbar,unpress", "efl",
+ _efl_ui_view_list_vbar_unpress_cb, obj);
+
+ //Horizontal bar
+ efl_layout_signal_callback_add
+ (obj, "drag", "efl.dragable.hbar", _efl_ui_view_list_hbar_drag_cb,
+ obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,set", "efl.dragable.hbar",
+ _efl_ui_view_list_edje_drag_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,start", "efl.dragable.hbar",
+ _efl_ui_view_list_edje_drag_start_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,stop", "efl.dragable.hbar",
+ _efl_ui_view_list_edje_drag_stop_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,step", "efl.dragable.hbar",
+ _efl_ui_view_list_edje_drag_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "drag,page", "efl.dragable.hbar",
+ _efl_ui_view_list_edje_drag_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "efl,hbar,press", "efl",
+ _efl_ui_view_list_hbar_press_cb, obj);
+ efl_layout_signal_callback_add
+ (obj, "efl,hbar,unpress", "efl",
+ _efl_ui_view_list_hbar_unpress_cb, obj);
+}
+
+static void
+_efl_ui_view_list_edje_object_detach(Evas_Object *obj)
+{
+ efl_layout_signal_callback_del
+ (obj, "reload", "efl", _efl_ui_view_list_reload_cb, obj);
+ //Vertical bar
+ efl_layout_signal_callback_del
+ (obj, "drag", "efl.dragable.vbar", _efl_ui_view_list_vbar_drag_cb,
+ obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,set", "efl.dragable.vbar",
+ _efl_ui_view_list_edje_drag_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,start", "efl.dragable.vbar",
+ _efl_ui_view_list_edje_drag_start_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,stop", "efl.dragable.vbar",
+ _efl_ui_view_list_edje_drag_stop_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,step", "efl.dragable.vbar",
+ _efl_ui_view_list_edje_drag_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,page", "efl.dragable.vbar",
+ _efl_ui_view_list_edje_drag_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "efl,vbar,press", "efl",
+ _efl_ui_view_list_vbar_press_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "efl,vbar,unpress", "efl",
+ _efl_ui_view_list_vbar_unpress_cb, obj);
+
+ //Horizontal bar
+ efl_layout_signal_callback_del
+ (obj, "drag", "efl.dragable.hbar", _efl_ui_view_list_hbar_drag_cb,
+ obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,set", "efl.dragable.hbar",
+ _efl_ui_view_list_edje_drag_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,start", "efl.dragable.hbar",
+ _efl_ui_view_list_edje_drag_start_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,stop", "efl.dragable.hbar",
+ _efl_ui_view_list_edje_drag_stop_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,step", "efl.dragable.hbar",
+ _efl_ui_view_list_edje_drag_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "drag,page", "efl.dragable.hbar",
+ _efl_ui_view_list_edje_drag_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "efl,hbar,press", "efl",
+ _efl_ui_view_list_hbar_press_cb, obj);
+ efl_layout_signal_callback_del
+ (obj, "efl,hbar,unpress", "efl",
+ _efl_ui_view_list_hbar_unpress_cb, obj);
+}
+
+EOLIAN static void
+_efl_ui_view_list_efl_canvas_group_group_add(Eo *obj, Efl_Ui_View_List_Data *pd)
+{
+ Efl_Ui_View_List_Pan_Data *pan_data;
+ Eina_Size2D min = {};
+ Eina_Bool bounce = _elm_config->thumbscroll_bounce_enable;
+ Evas_Object *o;
+
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+
+ efl_canvas_group_add(efl_super(obj, MY_CLASS));
+ elm_widget_sub_object_parent_add(obj);
+
+ elm_widget_can_focus_set(obj, EINA_TRUE);
+
+ if (!elm_layout_theme_set(obj, "view_list", "base", elm_widget_style_get(obj)))
+ CRI("Failed to set layout!");
+
+ pd->scrl_mgr = efl_add(EFL_UI_SCROLL_MANAGER_CLASS, obj,
+ efl_ui_mirrored_set(efl_added, efl_ui_mirrored_get(obj)));
+ pd->pan_obj = efl_add(MY_PAN_CLASS, obj);
+ pan_data = efl_data_scope_get(pd->pan_obj, MY_PAN_CLASS);
+ pan_data->wobj = obj;
+
+ efl_ui_scroll_manager_pan_set(pd->scrl_mgr, pd->pan_obj);
+ efl_ui_scrollable_bounce_enabled_set(pd->scrl_mgr, bounce, bounce);
+
+ edje_object_part_swallow(wd->resize_obj, "efl.content", pd->pan_obj);
+ edje_object_freeze(wd->resize_obj);
+ o = (Evas_Object *)edje_object_part_object_get(wd->resize_obj, "efl.dragable.vbar");
+ edje_object_thaw(wd->resize_obj);
+ efl_gfx_stack_raise((Eo *)o);
+
+ pd->mode = ELM_LIST_COMPRESS;
+
+ efl_gfx_entity_visible_set(pd->pan_obj, EINA_TRUE);
+
+ efl_access_object_access_type_set(obj, EFL_ACCESS_TYPE_DISABLED);
+
+ edje_object_size_min_calc(wd->resize_obj, &min.w, &min.h);
+ efl_gfx_size_hint_restricted_min_set(obj, min);
+
+ efl_event_callback_add(obj, EFL_UI_EVENT_SCROLL, _scroll_cb, obj);
+ efl_event_callback_add(obj, EFL_UI_SCROLLBAR_EVENT_BAR_SIZE_CHANGED,
+ _efl_ui_view_list_bar_size_changed_cb, obj);
+ efl_event_callback_add(obj, EFL_UI_SCROLLBAR_EVENT_BAR_POS_CHANGED,
+ _efl_ui_view_list_bar_pos_changed_cb, obj);
+ efl_event_callback_add(obj, EFL_UI_SCROLLBAR_EVENT_BAR_SHOW,
+ _efl_ui_view_list_bar_show_cb, obj);
+ efl_event_callback_add(obj, EFL_UI_SCROLLBAR_EVENT_BAR_HIDE,
+ _efl_ui_view_list_bar_hide_cb, obj);
+
+ _efl_ui_view_list_edje_object_attach(obj);
+
+ elm_layout_sizing_eval(obj);
+}
+
+EOLIAN static void
+_efl_ui_view_list_efl_canvas_group_group_del(Eo *obj, Efl_Ui_View_List_Data *pd)
+{
+ ELM_SAFE_FREE(pd->pan_obj, evas_object_del);
+ efl_canvas_group_del(efl_super(obj, MY_CLASS));
+}
+
+EOLIAN static Efl_Ui_Focus_Manager*
+_efl_ui_view_list_efl_ui_widget_focus_manager_focus_manager_create(Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *pd EINA_UNUSED, Efl_Ui_Focus_Object *root)
+{
+ if (!pd->manager)
+ pd->manager = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, obj,
+ efl_ui_focus_manager_root_set(efl_added, root));
+
+ return pd->manager;
+}
+
+EOLIAN static Eo *
+_efl_ui_view_list_efl_object_finalize(Eo *obj, Efl_Ui_View_List_Data *pd)
+{
+
+ if (!pd->factory)
+ pd->factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, obj);
+
+ if(!pd->relayout)
+ {
+ pd->relayout = efl_add(EFL_UI_VIEW_LIST_PRECISE_LAYOUTER_CLASS, obj);
+ if (pd->model)
+ efl_ui_view_list_relayout_model_set(pd->relayout, pd->model);
+ }
+ return obj;
+}
+
+EOLIAN static Eo *
+_efl_ui_view_list_efl_object_constructor(Eo *obj, Efl_Ui_View_List_Data *pd)
+{
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+ pd->obj = obj;
+ efl_canvas_object_type_set(obj, MY_CLASS_NAME);
+ evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_LIST);
+
+ pd->segarray = efl_add(EFL_UI_VIEW_LIST_SEGARRAY_CLASS, obj, efl_ui_view_list_segarray_setup(efl_added, 32));
+
+ efl_event_callback_add(obj, EFL_UI_FOCUS_MANAGER_EVENT_FOCUSED, _list_element_focused, NULL);
+
+ efl_ui_focus_composition_custom_manager_set(obj, obj);
+ efl_ui_focus_composition_logical_mode_set(obj, EINA_TRUE);
+
+ pd->style = eina_stringshare_add(elm_widget_style_get(obj));
+
+ pd->factory = NULL;
+ pd->orient = EFL_ORIENT_DOWN;
+ pd->min.w = 0;
+ pd->min.h = 0;
+
+ return obj;
+}
+
+EOLIAN static void
+_efl_ui_view_list_efl_object_destructor(Eo *obj, Efl_Ui_View_List_Data *pd)
+{
+ efl_ui_view_list_relayout_model_set(pd->relayout, NULL);
+
+ efl_unref(pd->model);
+ eina_stringshare_del(pd->style);
+
+ efl_event_callback_del(obj, EFL_UI_EVENT_SCROLL, _scroll_cb, obj);
+ _efl_ui_view_list_edje_object_detach(obj);
+
+ ELM_SAFE_FREE(pd->pan_obj, evas_object_del);
+ efl_canvas_group_del(efl_super(obj, MY_CLASS));
+
+ efl_destructor(efl_super(obj, MY_CLASS));
+}
+
+EOLIAN static void
+_efl_ui_view_list_layout_factory_set(Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *pd, Efl_Ui_Factory *factory)
+{
+ if (pd->factory)
+ efl_unref(pd->factory);
+
+ pd->factory = factory;
+ efl_ref(pd->factory);
+}
+
+EOLIAN static void
+_efl_ui_view_list_efl_ui_view_model_set(Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *pd, Efl_Model *model)
+{
+ if (pd->model == model)
+ return;
+
+ if (pd->model)
+ {
+ if (pd->relayout)
+ efl_ui_view_list_relayout_model_set(pd->relayout, NULL);
+ efl_ui_view_list_segarray_flush(pd->segarray);
+ }
+
+ efl_replace(&pd->model, model);
+
+ if (pd->model && pd->relayout)
+ efl_ui_view_list_relayout_model_set(pd->relayout, pd->model);
+
+ evas_object_smart_changed(pd->obj);
+}
+
+EOLIAN static Efl_Model *
+_efl_ui_view_list_efl_ui_view_model_get(const Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *pd)
+{
+ return pd->model;
+}
+
+EOLIAN int
+_efl_ui_view_list_efl_access_selection_selected_children_count_get(const Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *pd)
+{
+ return eina_list_count(pd->selected_items);
+}
+
+EOLIAN Eo*
+_efl_ui_view_list_efl_access_selection_selected_child_get(const Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *pd, int child_index)
+{
+ if(child_index < (int) eina_list_count(pd->selected_items))
+ {
+ Efl_Ui_View_List_LayoutItem* items = eina_list_nth(pd->selected_items, child_index);
+ return items[child_index].layout;
+ }
+ else
+ return NULL;
+}
+
+EOLIAN Eina_Bool
+_efl_ui_view_list_efl_access_selection_child_select(Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *pd EINA_UNUSED, int child_index EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN Eina_Bool
+_efl_ui_view_list_efl_access_selection_selected_child_deselect(Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *pd EINA_UNUSED, int child_index EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN Eina_Bool
+_efl_ui_view_list_efl_access_selection_is_child_selected(Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *pd EINA_UNUSED, int child_index EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN Eina_Bool
+_efl_ui_view_list_efl_access_selection_all_children_select(Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *pd EINA_UNUSED)
+{
+ return EINA_TRUE;
+}
+
+EOLIAN Eina_Bool
+_efl_ui_view_list_efl_access_selection_access_selection_clear(Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *pd EINA_UNUSED)
+{
+ return EINA_TRUE;
+}
+
+EOLIAN Eina_Bool
+_efl_ui_view_list_efl_access_selection_child_deselect(Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *pd EINA_UNUSED, int child_index EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+static Eina_Bool
+_key_action_move(Evas_Object *obj EINA_UNUSED, const char *params EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+static Eina_Bool
+_key_action_select(Evas_Object *obj EINA_UNUSED, const char *params EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+static Eina_Bool
+_key_action_escape(Evas_Object *obj, const char *params EINA_UNUSED)
+{
+ efl_ui_focus_manager_reset_history(obj);
+ return EINA_TRUE;
+}
+
+void
+_efl_ui_view_list_item_select_set(Efl_Ui_View_List_LayoutItem *item, Eina_Bool selected)
+{
+ Eina_Stringshare *sprop;
+ assert(item != NULL);
+ assert(item->children != NULL);
+
+ selected = !!selected;
+
+ sprop = eina_stringshare_add(SELECTED_PROP);
+
+ if (_efl_model_properties_has(item->children, sprop))
+ {
+ Eina_Value v;
+ eina_value_setup(&v, EINA_VALUE_TYPE_UCHAR);
+ eina_value_set(&v, selected);
+ efl_model_property_set(item->children, sprop, &v);
+ eina_value_flush(&v);
+ }
+ eina_stringshare_del(sprop);
+}
+
+static void
+_efl_ui_view_list_relayout_set(Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *pd EINA_UNUSED, Efl_Ui_View_List_Relayout *object)
+{
+ efl_replace(&pd->relayout, object);
+ if (pd->model && pd->relayout)
+ efl_ui_view_list_relayout_model_set(pd->relayout, pd->model);
+}
+
+static Efl_Ui_View_List_Relayout *
+_efl_ui_view_list_relayout_get(const Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *pd EINA_UNUSED)
+{
+ return pd->relayout;
+}
+
+static void
+_layout(Efl_Ui_View_List_Data *pd)
+{
+ if (!pd->model)
+ return;
+
+ efl_ui_view_list_relayout_layout_do(pd->relayout, pd->obj, pd->segarray_first, pd->segarray);
+}
+
+static Eina_Value
+_children_slice_then(void * data, const Eina_Value v, const Eina_Future *dead_future EINA_UNUSED)
+{
+ Efl_Ui_View_List_Data *pd = data;
+
+ if (eina_value_type_get(&v) == EINA_VALUE_TYPE_ERROR)
+ goto on_error;
+
+ efl_ui_view_list_segarray_insert_value(pd->segarray, pd->slice.start, v);
+
+ pd->segarray_first = pd->slice.start;
+ pd->slice.start = pd->slice.count = 0;
+ pd->slice.future = NULL;
+
+ efl_ui_view_list_relayout_layout_do(pd->relayout, pd->obj, pd->segarray_first, pd->segarray);
+ on_error:
+ return v;
+}
+
+/* EFL UI LIST MODEL INTERFACE */
+EOLIAN static Eina_Size2D
+_efl_ui_view_list_efl_ui_view_list_model_min_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *pd)
+{
+ return pd->min;
+}
+
+EOLIAN static void
+_efl_ui_view_list_efl_ui_view_list_model_min_size_set(Eo *obj, Efl_Ui_View_List_Data *pd, Eina_Size2D min)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+
+ pd->min.w = min.w;
+ pd->min.h = min.h;
+
+ evas_object_size_hint_min_set(wd->resize_obj, pd->min.w, pd->min.h);
+ efl_event_callback_call(pd->pan_obj, EFL_UI_PAN_EVENT_CONTENT_CHANGED, NULL);
+}
+
+EOLIAN static void
+_efl_ui_view_list_efl_ui_focus_composition_prepare(Eo *obj, Efl_Ui_View_List_Data *pd)
+{
+ Eina_List *order = efl_ui_view_list_relayout_elements_get(pd->relayout);
+ efl_ui_focus_composition_elements_set(obj, order);
+}
+
+EOLIAN Eina_List*
+_efl_ui_view_list_efl_access_object_access_children_get(const Eo *obj, Efl_Ui_View_List_Data *pd)
+{
+ Eina_List *ret = NULL, *ret2 = NULL;
+
+ ret = efl_ui_view_list_relayout_elements_get(pd->relayout);
+ ret2 = efl_access_object_access_children_get(efl_super(obj, EFL_UI_VIEW_LIST_CLASS));
+
+ return eina_list_merge(ret, ret2);
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_view_list_efl_ui_widget_focus_state_apply(Eo *obj, Efl_Ui_View_List_Data *pd EINA_UNUSED, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Efl_Ui_Widget *redirect EINA_UNUSED)
+{
+ return efl_ui_widget_focus_state_apply(efl_super(obj, MY_CLASS), current_state, configured_state, obj);
+}
+
+EOLIAN static Efl_Ui_View_List_LayoutItem *
+_efl_ui_view_list_efl_ui_view_list_model_realize(Eo *obj, Efl_Ui_View_List_Data *pd, Efl_Ui_View_List_LayoutItem *item)
+{
+ Efl_Ui_View_List_Item_Event evt;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(item->children, item);
+
+ item->layout = efl_ui_factory_create(pd->factory, item->children, obj);
+ evas_object_smart_member_add(item->layout, pd->pan_obj);
+ evas_object_event_callback_add(item->layout, EVAS_CALLBACK_MOUSE_UP, _on_item_mouse_up, item);
+
+ if (_elm_config->atspi_mode)
+ {
+ efl_access_added(item->layout);
+ efl_access_children_changed_added_signal_emit(obj, item->layout);
+ }
+
+ evt.child = item->children;
+ evt.layout = item->layout;
+ evt.index = efl_ui_view_list_item_index_get(item);
+ efl_event_callback_call(obj, EFL_UI_VIEW_LIST_EVENT_ITEM_REALIZED, &evt);
+ efl_ui_focus_composition_dirty(obj);
+
+ evas_object_show(item->layout);
+ return item;
+}
+
+EOLIAN static void
+_efl_ui_view_list_efl_ui_view_list_model_unrealize(Eo *obj, Efl_Ui_View_List_Data *pd, Efl_Ui_View_List_LayoutItem *item)
+{
+ Efl_Ui_View_List_Item_Event evt;
+ EINA_SAFETY_ON_NULL_RETURN(item->layout);
+
+ evas_object_event_callback_del_full(item->layout, EVAS_CALLBACK_MOUSE_UP, _on_item_mouse_up, item);
+ if (elm_object_focus_allow_get(item->layout))
+ {
+ if (elm_object_focus_get(item->layout))
+ elm_object_focus_set(item->layout, EINA_FALSE);
+ efl_ui_focus_manager_calc_unregister(obj, item->layout);
+ }
+ evas_object_hide(item->layout);
+ evas_object_move(item->layout, -9999, -9999);
+
+ evt.child = item->children;
+ evt.layout = item->layout;
+ evt.index = efl_ui_view_list_item_index_get(item);
+ efl_event_callback_call(obj, EFL_UI_VIEW_LIST_EVENT_ITEM_UNREALIZED, &evt);
+
+ evas_object_smart_member_del(item->layout);
+ efl_ui_factory_release(pd->factory, item->layout);
+ item->layout = NULL;
+}
+
+EOLIAN static void
+_efl_ui_view_list_efl_ui_view_list_model_load_range_set(Eo* obj, Efl_Ui_View_List_Data* pd, int first, int count)
+{
+ if (pd->slice.future) return ;
+
+ pd->slice.start = first;
+ pd->slice.count = count;
+
+ if (efl_model_children_count_get(pd->model))
+ {
+ Eina_Future *f = efl_model_children_slice_get(pd->model, first, count);
+ f = eina_future_then(f, _children_slice_then, pd);
+ pd->slice.future = efl_future_Eina_FutureXXX_then(obj, f);
+ }
+}
+
+EOLIAN static int
+_efl_ui_view_list_efl_ui_view_list_model_model_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_View_List_Data *pd)
+{
+ return efl_model_children_count_get(pd->model);
+}
+
+ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_view_list, Efl_Ui_View_List_Data)
+
+/* Internal EO APIs and hidden overrides */
+
+#define EFL_UI_VIEW_LIST_EXTRA_OPS \
+ EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_view_list)
+
+#include "efl_ui_view_list.eo.c"
+#include "efl_ui_view_list_relayout.eo.c"
+#include "efl_ui_view_list_model.eo.c"
diff --git a/src/lib/elementary/efl_ui_view_list.eo b/src/lib/elementary/efl_ui_view_list.eo
new file mode 100644
index 0000000000..b24f261180
--- /dev/null
+++ b/src/lib/elementary/efl_ui_view_list.eo
@@ -0,0 +1,105 @@
+import elm_general;
+
+struct Efl.Ui.View_List_Item_Event
+{
+ layout: Efl.Ui.Layout.Object;
+ child: Efl.Model;
+ index: int;
+}
+class Efl.Ui.View_List (Efl.Ui.Layout.Object, Efl.Ui.View, Efl.Ui.Scrollable_Interactive, Efl.Ui.Scrollbar,
+ Efl.Access.Widget.Action, Efl.Access.Selection, Efl.Ui.Focus.Composition, Efl.Ui.Focus.Manager_Sub,
+ Efl.Ui.Clickable, Efl.Ui.Selectable, Efl.Ui.View_List_Model, Efl.Ui.Widget_Focus_Manager)
+{
+ methods {
+ @property relayout {
+ values {
+ object: Efl.Ui.View_List_Relayout;
+ }
+ }
+ @property homogeneous {
+ get {
+ [[Get whether the homogeneous mode is enabled.]]
+ }
+ set {
+ [[Enable/disable homogeneous mode.]]
+ }
+ values {
+ homogeneous: bool; [[Assume the items within the genlist are of
+ the same height and width. Default is $false.]]
+ }
+ }
+ @property select_mode {
+ [[Listview select mode.]]
+ get {}
+ set {}
+ values {
+ mode: Elm.Object.Select_Mode(Elm.Object.Select_Mode.max); [[The select mode.]]
+ }
+ }
+ @property default_style {
+ values {
+ style: stringshare;
+ }
+ }
+ @property layout_factory {
+ [[Listview layout factory set.]]
+ set {}
+ values {
+ factory: Efl.Ui.Factory; [[The factory.]]
+ }
+ }
+ }
+ events {
+ item,realized : Efl.Ui.View_List_Item_Event;
+ item,unrealized : Efl.Ui.View_List_Item_Event;
+ item,focused : Efl.Ui.View_List_Item_Event;
+ item,unfocused : Efl.Ui.View_List_Item_Event;
+ item,highlighted : Efl.Ui.View_List_Item_Event;
+ item,unhighlighted : Efl.Ui.View_List_Item_Event;
+ item,selected : Efl.Ui.View_List_Item_Event;
+ item,unselected : Efl.Ui.View_List_Item_Event;
+ }
+
+ implements {
+ Efl.Object.constructor;
+ Efl.Object.finalize;
+ Efl.Object.destructor;
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
+ // Smart obj
+ Efl.Canvas.Group.group_member_add;
+ Efl.Canvas.Group.group_calculate;
+
+ Efl.Ui.View_List_Model.load_range { set;}
+ Efl.Ui.View_List_Model.realize;
+ Efl.Ui.View_List_Model.unrealize;
+ Efl.Ui.View_List_Model.model_size { get; }
+ Efl.Ui.View_List_Model.min_size { get; set; }
+
+ // Widget
+ Efl.Ui.Widget_Focus_Manager.focus_manager_create;
+ Efl.Ui.Widget.widget_event;
+ Efl.Ui.Widget.focus_state_apply;
+ Efl.Ui.Focus.Composition.prepare;
+ Efl.Ui.View.model { get; set; }
+
+ Efl.Ui.Scrollable_Interactive.viewport_geometry { get; }
+ Efl.Ui.Scrollable_Interactive.content_pos { get; set; }
+ Efl.Ui.Scrollable_Interactive.content_size { get; }
+// Efl.Ui.Scrollable_Interactive.scroll;
+ Efl.Layout.Signal.signal_callback_add;
+ Efl.Layout.Signal.signal_callback_del;
+// Elm.Interface.Atspi_Accessible.children { get; }
+// Elm.Interface.Atspi_Widget.Action.elm_actions { get; }
+// Efl.Access.Widget.Action.elm_actions { get; }
+ Efl.Access.Object.access_children { get; }
+ Efl.Access.Selection.selected_children_count { get; }
+ Efl.Access.Selection.selected_child { get; }
+ Efl.Access.Selection.selected_child_deselect;
+ Efl.Access.Selection.child_select;
+ Efl.Access.Selection.child_deselect;
+ Efl.Access.Selection.is_child_selected;
+ Efl.Access.Selection.all_children_select;
+ Efl.Access.Selection.access_selection_clear;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_list_model.eo b/src/lib/elementary/efl_ui_view_list_model.eo
index ba2b2dc107..bbcdef2ef1 100644
--- a/src/lib/elementary/efl_ui_list_model.eo
+++ b/src/lib/elementary/efl_ui_view_list_model.eo
@@ -1,6 +1,6 @@
-import efl_ui_list_types;
+import efl_ui_view_list_types;
-interface Efl.Ui.List.Model (Efl.Interface)
+interface Efl.Ui.View_List_Model (Efl.Interface)
{
methods {
@property load_range {
@@ -12,13 +12,13 @@ interface Efl.Ui.List.Model (Efl.Interface)
}
realize {
params {
- item: ptr(Efl.Ui.List.LayoutItem);
+ item: ptr(Efl.Ui.View.List.LayoutItem);
}
- return: ptr(Efl.Ui.List.LayoutItem);
+ return: ptr(Efl.Ui.View.List.LayoutItem);
}
unrealize {
params {
- item: ptr(Efl.Ui.List.LayoutItem);
+ item: ptr(Efl.Ui.View.List.LayoutItem);
}
}
// @property visible_range {
@@ -28,7 +28,7 @@ interface Efl.Ui.List.Model (Efl.Interface)
// count: int;
// }
// }
- @property size {
+ @property model_size {
get {}
values {
s: int;
diff --git a/src/lib/elementary/efl_ui_list_pan.eo b/src/lib/elementary/efl_ui_view_list_pan.eo
index 57f78af10c..ceca0744a2 100644
--- a/src/lib/elementary/efl_ui_list_pan.eo
+++ b/src/lib/elementary/efl_ui_view_list_pan.eo
@@ -1,6 +1,6 @@
-class Efl.Ui.List.Pan (Efl.Ui.Pan)
+class Efl.Ui.View_List_Pan (Efl.Ui.Pan)
{
- [[Elementary Efl_Ui_List pan class]]
+ [[Elementary Efl_Ui_View_List pan class]]
implements {
Efl.Object.destructor;
Efl.Ui.Pan.content_size { get; }
@@ -10,7 +10,9 @@ class Efl.Ui.List.Pan (Efl.Ui.Pan)
Efl.Canvas.Group.group_calculate;
}
events {
- item,focused; [[Called when item is focused.]]
- item,unfocused; [[Called when item has lost focus.]]
+ /* FIXME: Nobody is emitting these
+ item,focused: void; [[Called when item is focused.]]
+ item,unfocused: void; [[Called when item has lost focus.]]
+ */
}
}
diff --git a/src/lib/elementary/efl_ui_list_precise_layouter.c b/src/lib/elementary/efl_ui_view_list_precise_layouter.c
index bc61fec2fa..ee5c1814a8 100644
--- a/src/lib/elementary/efl_ui_list_precise_layouter.c
+++ b/src/lib/elementary/efl_ui_view_list_precise_layouter.c
@@ -7,51 +7,53 @@
#include <assert.h>
#include "elm_priv.h"
-#include "efl_ui_list_segarray.h"
+#include "efl_ui_view_list_segarray.h"
-#define MY_CLASS EFL_UI_LIST_PRECISE_LAYOUTER_CLASS
+#define MY_CLASS EFL_UI_VIEW_LIST_PRECISE_LAYOUTER_CLASS
-typedef struct _Efl_Ui_List_Precise_Layouter_Data
+typedef struct _Efl_Ui_View_List_Precise_Layouter_Data
{
- Eina_Bool initialized;
- Eina_Bool recalc;
- Eina_Bool resize;
- Eina_Size2D min;
Efl_Model* model;
- Efl_Ui_List_Model *modeler;
- Efl_Future *count_future;
+ Efl_Ui_View_List_Model *modeler;
Ecore_Job *calc_job;
- Efl_Ui_List_SegArray *segarray;
+ Efl_Ui_View_List_SegArray *segarray;
+
+ Eina_Size2D min;
+
+ unsigned int calc_progress;
+
int first;
int count_total;
- unsigned int calc_progress;
-} Efl_Ui_List_Precise_Layouter_Data;
-typedef struct _Efl_Ui_List_Precise_Layouter_Node_Data
+ Eina_Bool initialized : 1;
+ Eina_Bool recalc : 1;
+ Eina_Bool resize : 1;
+} Efl_Ui_View_List_Precise_Layouter_Data;
+
+typedef struct _Efl_Ui_View_List_Precise_Layouter_Node_Data
{
Eina_Size2D min;
Eina_Size2D size;
- Eina_Bool realized;
-} Efl_Ui_List_Precise_Layouter_Node_Data;
-
-typedef struct _Efl_Ui_List_Precise_Layouter_Callback_Data
-{
- Efl_Ui_List_Precise_Layouter_Data* pd;
- Efl_Ui_List_LayoutItem* item;
-} Efl_Ui_List_Precise_Layouter_Callback_Data;
+ Eina_Bool realized;
+} Efl_Ui_View_List_Precise_Layouter_Node_Data;
-#include "efl_ui_list_precise_layouter.eo.h"
+typedef struct _Efl_Ui_View_List_Precise_Layouter_Callback_Data
+{
+ Efl_Ui_View_List_Precise_Layouter_Data *pd;
+ Efl_Ui_View_List_LayoutItem *item;
+} Efl_Ui_View_List_Precise_Layouter_Callback_Data;
+#include "efl_ui_view_list_precise_layouter.eo.h"
-static void _efl_ui_list_relayout_layout_do(Efl_Ui_List_Precise_Layouter_Data *);
-static void _initilize(Eo *, Efl_Ui_List_Precise_Layouter_Data*, Efl_Ui_List_Model*, Efl_Ui_List_SegArray*);
-static void _finalize(Eo *, Efl_Ui_List_Precise_Layouter_Data*);
-static void _node_realize(Efl_Ui_List_Precise_Layouter_Data*, Efl_Ui_List_SegArray_Node*);
-static void _node_unrealize(Efl_Ui_List_Precise_Layouter_Data*, Efl_Ui_List_SegArray_Node*);
+static void _efl_ui_view_list_relayout_layout_do(Efl_Ui_View_List_Precise_Layouter_Data *);
+static Eina_Bool _initilize(Eo *, Efl_Ui_View_List_Precise_Layouter_Data*, Efl_Ui_View_List_Model*, Efl_Ui_View_List_SegArray*);
+static void _finalize(Eo *, Efl_Ui_View_List_Precise_Layouter_Data*);
+static void _node_realize(Efl_Ui_View_List_Precise_Layouter_Data*, Efl_Ui_View_List_SegArray_Node*);
+static void _node_unrealize(Efl_Ui_View_List_Precise_Layouter_Data*, Efl_Ui_View_List_SegArray_Node*);
static void
-_item_size_calc(Efl_Ui_List_Precise_Layouter_Data *pd, Efl_Ui_List_LayoutItem* item)
+_item_size_calc(Efl_Ui_View_List_Precise_Layouter_Data *pd, Efl_Ui_View_List_LayoutItem* item)
{
int boxx, boxy, boxw, boxh, boxl, boxr, boxt, boxb, pad[4];
double align[2];
@@ -117,11 +119,11 @@ _item_size_calc(Efl_Ui_List_Precise_Layouter_Data *pd, Efl_Ui_List_LayoutItem* i
}
static void
-_item_min_calc(Efl_Ui_List_Precise_Layouter_Data *pd, Efl_Ui_List_LayoutItem* item
- , Eina_Size2D min, Efl_Ui_List_SegArray_Node *itemnode)
+_item_min_calc(Efl_Ui_View_List_Precise_Layouter_Data *pd, Efl_Ui_View_List_LayoutItem* item
+ , Eina_Size2D min, Efl_Ui_View_List_SegArray_Node *itemnode)
{
- Efl_Ui_List_Precise_Layouter_Node_Data *nodedata = itemnode->layout_data;
- Efl_Ui_List_LayoutItem *layout_item;
+ Efl_Ui_View_List_Precise_Layouter_Node_Data *nodedata = itemnode->layout_data;
+ Efl_Ui_View_List_LayoutItem *layout_item;
int i, pad[4];
efl_gfx_size_hint_margin_get(item->layout, &pad[0], &pad[1], &pad[2], &pad[3]);
@@ -142,7 +144,7 @@ _item_min_calc(Efl_Ui_List_Precise_Layouter_Data *pd, Efl_Ui_List_LayoutItem* it
nodedata->min.w = 0;
for (i = 0; i != itemnode->length; ++i)
{
- layout_item = (Efl_Ui_List_LayoutItem *)itemnode->pointers[i];
+ layout_item = (Efl_Ui_View_List_LayoutItem *)itemnode->pointers[i];
if (nodedata->min.w < layout_item->min.w)
nodedata->min.w = layout_item->min.w;
@@ -155,17 +157,17 @@ _item_min_calc(Efl_Ui_List_Precise_Layouter_Data *pd, Efl_Ui_List_LayoutItem* it
pd->min.w = min.w;
else if (pd->min.w == item->min.w)
{
- Efl_Ui_List_SegArray_Node *node;
- Eina_Accessor *nodes = efl_ui_list_segarray_node_accessor_get(pd->segarray);
+ Efl_Ui_View_List_SegArray_Node *node2;
+ Eina_Accessor *nodes = efl_ui_view_list_segarray_node_accessor_get(pd->segarray);
pd->min.w = min.w;
- EINA_ACCESSOR_FOREACH(nodes, i, node)
+ EINA_ACCESSOR_FOREACH(nodes, i, node2)
{
- Efl_Ui_List_Precise_Layouter_Node_Data *nodedata = node->layout_data;
- if (pd->min.w < nodedata->min.w)
- pd->min.w = nodedata->min.w;
+ Efl_Ui_View_List_Precise_Layouter_Node_Data *nodedata2 = node2->layout_data;
+ if (pd->min.w < nodedata2->min.w)
+ pd->min.w = nodedata2->min.w;
- if (item->min.w == nodedata->min.w)
+ if (item->min.w == nodedata2->min.w)
break;
}
eina_accessor_free(nodes);
@@ -178,45 +180,21 @@ _item_min_calc(Efl_Ui_List_Precise_Layouter_Data *pd, Efl_Ui_List_LayoutItem* it
}
static void
-_count_then(void * data, Efl_Event const* event)
-{
- Efl_Ui_List_Precise_Layouter_Data *pd = data;
- EINA_SAFETY_ON_NULL_RETURN(pd);
- pd->count_future = NULL;
-
- pd->count_total = *(int*)((Efl_Future_Event_Success*)event->info)->value;
-
- if (pd->modeler && (pd->count_total != efl_ui_list_segarray_count(pd->segarray)))
- {
- pd->recalc = EINA_TRUE;
- efl_ui_list_model_load_range_set(pd->modeler, 0, 0); // load all
- }
-}
-
-static void
-_count_error(void * data, Efl_Event const* event EINA_UNUSED)
-{
- Efl_Ui_List_Precise_Layouter_Data *pd = data;
- EINA_SAFETY_ON_NULL_RETURN(pd);
- pd->count_future = NULL;
-}
-
-static void
_on_item_size_hint_change(void *data, Evas *e EINA_UNUSED,
Evas_Object *obj, void *event_info EINA_UNUSED)
{
- Efl_Ui_List_Precise_Layouter_Callback_Data *cb_data = data;
- Efl_Ui_List_Precise_Layouter_Data *pd = cb_data->pd;
- Efl_Ui_List_LayoutItem *item = cb_data->item;;
- Efl_Ui_List_SegArray_Node *node = item->tree_node;
- Efl_Ui_List_Precise_Layouter_Node_Data *nodedata = node->layout_data;
+ Efl_Ui_View_List_Precise_Layouter_Callback_Data *cb_data = data;
+ Efl_Ui_View_List_Precise_Layouter_Data *pd = cb_data->pd;
+ Efl_Ui_View_List_LayoutItem *item = cb_data->item;;
+ Efl_Ui_View_List_SegArray_Node *node = item->tree_node;
+ Efl_Ui_View_List_Precise_Layouter_Node_Data *nodedata = node->layout_data;
Eina_Size2D min = efl_gfx_size_hint_combined_min_get(obj);
_item_min_calc(pd, item, min, node);
if (!nodedata->realized)
{
free(evas_object_event_callback_del(item->layout, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_item_size_hint_change));
- efl_ui_list_model_unrealize(pd->modeler, item);
+ efl_ui_view_list_model_unrealize(pd->modeler, item);
}
}
@@ -224,36 +202,65 @@ static void
_on_modeler_resize(void *data, Evas *e EINA_UNUSED,
Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
- Efl_Ui_List_Precise_Layouter_Data *pd = data;
+ Efl_Ui_View_List_Precise_Layouter_Data *pd = data;
pd->resize = EINA_TRUE;
}
+typedef struct _Request Request;
+struct _Request
+{
+ Efl_Ui_View_List_Precise_Layouter_Data *pd;
+ unsigned int index;
+};
+
+static Eina_Value
+_children_get(void *data, const Eina_Value v, const Eina_Future *dead_future EINA_UNUSED)
+{
+ Request *r = data;
+
+ if (eina_value_type_get(&v) == EINA_VALUE_TYPE_ERROR)
+ goto on_error;
+
+ efl_ui_view_list_segarray_insert_value(r->pd->segarray, r->index, v);
+ r->pd->recalc = EINA_TRUE;
+ evas_object_smart_changed(r->pd->modeler);
+
+ on_error:
+ free(r);
+ return v;
+}
+
static void
_child_added_cb(void *data, const Efl_Event *event)
{
Efl_Model_Children_Event* evt = event->info;
- Efl_Ui_List_Precise_Layouter_Data *pd = data;
+ Efl_Ui_View_List_Precise_Layouter_Data *pd = data;
+ Eina_Future *f;
+ Request *r;
- efl_ui_list_segarray_insert(pd->segarray, evt->index, evt->child);
- pd->recalc = EINA_TRUE;
- evas_object_smart_changed(pd->modeler);
+ r = calloc(1, sizeof (Request));
+ if (!r) return;
+
+ r->index = evt->index;
+ r->pd = pd;
+
+ f = efl_model_children_slice_get(pd->model, evt->index, 1);
+ f = eina_future_then(f, _children_get, r);
}
static void
_child_removed_cb(void *data, const Efl_Event *event)
{
Efl_Model_Children_Event* evt = event->info;
- Efl_Ui_List_Precise_Layouter_Data *pd = data;
- Efl_Ui_List_LayoutItem *layout_item, *litem;
- Efl_Ui_List_Precise_Layouter_Node_Data *nodedata;
- Efl_Ui_List_SegArray_Node *itemnode;
- Efl_Ui_List_Item* item;
+ Efl_Ui_View_List_Precise_Layouter_Data *pd = data;
+ Efl_Ui_View_List_LayoutItem *layout_item, *litem;
+ Efl_Ui_View_List_Precise_Layouter_Node_Data *nodedata;
+ Efl_Ui_View_List_SegArray_Node *itemnode;
int i;
- item = efl_ui_list_segarray_remove(pd->segarray, evt->index);
- if (!item) return;
+ litem = efl_ui_view_list_segarray_remove(pd->segarray, evt->index);
+ if (!litem) return;
- litem = (Efl_Ui_List_LayoutItem *)item;
itemnode = litem->tree_node;
nodedata = itemnode->layout_data;
@@ -267,7 +274,7 @@ _child_removed_cb(void *data, const Efl_Event *event)
for (i = 0; i != itemnode->length; ++i)
{
- layout_item = (Efl_Ui_List_LayoutItem *)itemnode->pointers[i];
+ layout_item = (Efl_Ui_View_List_LayoutItem *)itemnode->pointers[i];
if (nodedata->min.w < layout_item->min.w)
nodedata->min.w = layout_item->min.w;
@@ -280,34 +287,46 @@ _child_removed_cb(void *data, const Efl_Event *event)
if (pd->min.w == litem->min.w)
{
- Efl_Ui_List_SegArray_Node *node;
- Eina_Accessor *nodes = efl_ui_list_segarray_node_accessor_get(pd->segarray);
+ Efl_Ui_View_List_SegArray_Node *node2;
+ Eina_Accessor *nodes = efl_ui_view_list_segarray_node_accessor_get(pd->segarray);
pd->min.w = 0;
- EINA_ACCESSOR_FOREACH(nodes, i, node)
+ EINA_ACCESSOR_FOREACH(nodes, i, node2)
{
- Efl_Ui_List_Precise_Layouter_Node_Data *nodedata = node->layout_data;
- if (pd->min.w < nodedata->min.w)
- pd->min.w = nodedata->min.w;
+ Efl_Ui_View_List_Precise_Layouter_Node_Data *nodedata2 = node2->layout_data;
+ if (pd->min.w < nodedata2->min.w)
+ pd->min.w = nodedata2->min.w;
- if (litem->min.w == nodedata->min.w)
+ if (litem->min.w == nodedata2->min.w)
break;
}
eina_accessor_free(nodes);
}
- efl_ui_list_model_unrealize(pd->modeler, litem);
+ efl_ui_view_list_model_unrealize(pd->modeler, litem);
- free(item);
+ free(litem);
pd->recalc = EINA_TRUE;
evas_object_smart_changed(pd->modeler);
}
static void
-_initilize(Eo *obj EINA_UNUSED, Efl_Ui_List_Precise_Layouter_Data *pd, Efl_Ui_List_Model *modeler, Efl_Ui_List_SegArray *segarray)
+_child_count_changed_cb(void *data, const Efl_Event *event EINA_UNUSED)
+{
+ Efl_Ui_View_List_Precise_Layouter_Data *pd = data;
+ pd->count_total = efl_model_children_count_get(pd->model);
+ if (pd->count_total)
+ efl_event_callback_del(pd->model, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, _child_count_changed_cb, pd);
+}
+
+static Eina_Bool
+_initilize(Eo *obj EINA_UNUSED, Efl_Ui_View_List_Precise_Layouter_Data *pd, Efl_Ui_View_List_Model *modeler, Efl_Ui_View_List_SegArray *segarray)
{
if(pd->initialized)
- return;
+ return EINA_TRUE;
+
+ if(!pd->model || !pd->count_total)
+ return EINA_FALSE;
pd->recalc = EINA_TRUE;
pd->initialized = EINA_TRUE;
@@ -315,28 +334,29 @@ _initilize(Eo *obj EINA_UNUSED, Efl_Ui_List_Precise_Layouter_Data *pd, Efl_Ui_Li
pd->modeler = modeler;
pd->segarray = segarray;
- evas_object_event_callback_add(modeler, EVAS_CALLBACK_RESIZE, _on_modeler_resize, pd);
-// efl_event_callback_add(pd->model, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, _count_changed, pd);
+ efl_ui_view_list_model_load_range_set(pd->modeler, 0, pd->count_total); // load all
efl_event_callback_add(pd->model, EFL_MODEL_EVENT_CHILD_ADDED, _child_added_cb, pd);
efl_event_callback_add(pd->model, EFL_MODEL_EVENT_CHILD_REMOVED, _child_removed_cb, pd);
- efl_ui_list_model_load_range_set(modeler, 0, 0); // load all
+ evas_object_event_callback_add(modeler, EVAS_CALLBACK_RESIZE, _on_modeler_resize, pd);
pd->min.w = 0;
pd->min.h = 0;
+
+ return EINA_TRUE;
}
static void
-_finalize(Eo *obj EINA_UNUSED, Efl_Ui_List_Precise_Layouter_Data *pd)
+_finalize(Eo *obj EINA_UNUSED, Efl_Ui_View_List_Precise_Layouter_Data *pd)
{
- Efl_Ui_List_SegArray_Node* node;
+ Efl_Ui_View_List_SegArray_Node* node;
int i = 0;
evas_object_event_callback_del_full(pd->modeler, EVAS_CALLBACK_RESIZE, _on_modeler_resize, pd);
efl_event_callback_del(pd->model, EFL_MODEL_EVENT_CHILD_ADDED, _child_added_cb, pd);
efl_event_callback_del(pd->model, EFL_MODEL_EVENT_CHILD_REMOVED, _child_removed_cb, pd);
-// efl_event_callback_del(pd->model, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, _count_changed, pd);
+ pd->count_total = 0;
- Eina_Accessor *nodes = efl_ui_list_segarray_node_accessor_get(pd->segarray);
+ Eina_Accessor *nodes = efl_ui_view_list_segarray_node_accessor_get(pd->segarray);
EINA_ACCESSOR_FOREACH(nodes, i, node)
{
_node_unrealize(pd, node);
@@ -348,22 +368,24 @@ _finalize(Eo *obj EINA_UNUSED, Efl_Ui_List_Precise_Layouter_Data *pd)
pd->min.w = 0;
pd->min.h = 0;
- efl_ui_list_model_min_size_set(pd->modeler, pd->min);
+ efl_ui_view_list_model_min_size_set(pd->modeler, pd->min);
pd->segarray = NULL;
pd->modeler = NULL;
pd->initialized = EINA_FALSE;
+ pd->recalc = EINA_TRUE;
}
static void
-_node_realize(Efl_Ui_List_Precise_Layouter_Data *pd, Efl_Ui_List_SegArray_Node *node)
+_node_realize(Efl_Ui_View_List_Precise_Layouter_Data *pd, Efl_Ui_View_List_SegArray_Node *node)
{
- Efl_Ui_List_LayoutItem* layout_item;
- Efl_Ui_List_Precise_Layouter_Callback_Data *cb_data;
- Efl_Ui_List_Precise_Layouter_Node_Data *nodedata = node->layout_data;
+ Efl_Ui_View_List_LayoutItem* layout_item;
+ Efl_Ui_View_List_Precise_Layouter_Callback_Data *cb_data;
+ Efl_Ui_View_List_Precise_Layouter_Node_Data *nodedata = node->layout_data;
int i;
+ EINA_SAFETY_ON_NULL_RETURN(nodedata);
if (nodedata->realized)
return;
@@ -371,12 +393,12 @@ _node_realize(Efl_Ui_List_Precise_Layouter_Data *pd, Efl_Ui_List_SegArray_Node *
for (i = 0; i != node->length; ++i)
{
- layout_item = (Efl_Ui_List_LayoutItem *)node->pointers[i];
- efl_ui_list_model_realize(pd->modeler, layout_item);
+ layout_item = (Efl_Ui_View_List_LayoutItem *)node->pointers[i];
+ efl_ui_view_list_model_realize(pd->modeler, layout_item);
if (layout_item->layout)
{
- cb_data = calloc(1, sizeof(Efl_Ui_List_Precise_Layouter_Callback_Data));
+ cb_data = calloc(1, sizeof(Efl_Ui_View_List_Precise_Layouter_Callback_Data));
cb_data->pd = pd;
cb_data->item = layout_item;
evas_object_event_callback_add(layout_item->layout, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_item_size_hint_change, cb_data);
@@ -386,13 +408,14 @@ _node_realize(Efl_Ui_List_Precise_Layouter_Data *pd, Efl_Ui_List_SegArray_Node *
}
static void
-_node_unrealize(Efl_Ui_List_Precise_Layouter_Data *pd, Efl_Ui_List_SegArray_Node *node)
+_node_unrealize(Efl_Ui_View_List_Precise_Layouter_Data *pd, Efl_Ui_View_List_SegArray_Node *node)
{
- Efl_Ui_List_LayoutItem* layout_item;
- Efl_Ui_List_Precise_Layouter_Callback_Data *cb_data;
- Efl_Ui_List_Precise_Layouter_Node_Data *nodedata = node->layout_data;
+ Efl_Ui_View_List_LayoutItem* layout_item;
+ Efl_Ui_View_List_Precise_Layouter_Callback_Data *cb_data;
+ Efl_Ui_View_List_Precise_Layouter_Node_Data *nodedata = node->layout_data;
int i;
+ EINA_SAFETY_ON_NULL_RETURN(nodedata);
if (!nodedata->realized)
return;
@@ -400,31 +423,36 @@ _node_unrealize(Efl_Ui_List_Precise_Layouter_Data *pd, Efl_Ui_List_SegArray_Node
for (i = 0; i != node->length; ++i)
{
- layout_item = (Efl_Ui_List_LayoutItem *)node->pointers[i];
+ layout_item = (Efl_Ui_View_List_LayoutItem *)node->pointers[i];
if (layout_item->layout)
{
cb_data = evas_object_event_callback_del(layout_item->layout, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_item_size_hint_change);
free(cb_data);
}
- efl_ui_list_model_unrealize(pd->modeler, layout_item);
+ efl_ui_view_list_model_unrealize(pd->modeler, layout_item);
}
}
static void
-_calc_range(Efl_Ui_List_Precise_Layouter_Data *pd)
+_calc_range(Efl_Ui_View_List_Precise_Layouter_Data *pd)
{
- Efl_Ui_List_SegArray_Node *node;
- Evas_Coord ch;
+ Efl_Ui_View_List_SegArray_Node *node;
+ Evas_Coord ch, ny;
Eina_Rect vgmt;
Eina_Position2D spos;
- Efl_Ui_List_Precise_Layouter_Node_Data *nodedata;
+ Efl_Ui_View_List_Precise_Layouter_Node_Data *nodedata;
int i;
vgmt = efl_ui_scrollable_viewport_geometry_get(pd->modeler);
spos = efl_ui_scrollable_content_pos_get(pd->modeler);
+ ny = spos.y - (vgmt.h / 2);
+ if (ny < 0) spos.y = 0;
+ else spos.y = ny;
+ vgmt.h *= 2;
+
ch = 0;
- Eina_Accessor *nodes = efl_ui_list_segarray_node_accessor_get(pd->segarray);
+ Eina_Accessor *nodes = efl_ui_view_list_segarray_node_accessor_get(pd->segarray);
EINA_ACCESSOR_FOREACH(nodes, i, node)
{
nodedata = node->layout_data;
@@ -444,9 +472,9 @@ _calc_range(Efl_Ui_List_Precise_Layouter_Data *pd)
static void
_calc_size_job(void *data)
{
- Efl_Ui_List_Precise_Layouter_Data *pd;
- Efl_Ui_List_SegArray_Node *node;
- Efl_Ui_List_LayoutItem *layout_item;
+ Efl_Ui_View_List_Precise_Layouter_Data *pd;
+ Efl_Ui_View_List_SegArray_Node *node;
+ Efl_Ui_View_List_LayoutItem *layout_item;
Eo *obj = data;
Eina_Size2D min;
int i;
@@ -456,18 +484,16 @@ _calc_size_job(void *data)
pd = efl_data_scope_get(obj, MY_CLASS);
if (EINA_UNLIKELY(!pd)) return;
- pd->recalc = EINA_FALSE;
-
- Eina_Accessor *nodes = efl_ui_list_segarray_node_accessor_get(pd->segarray);
+ Eina_Accessor *nodes = efl_ui_view_list_segarray_node_accessor_get(pd->segarray);
while (eina_accessor_data_get(nodes, pd->calc_progress, (void **)&node))
{
pd->calc_progress++;
if (!node->layout_data)
- node->layout_data = calloc(1, sizeof(Efl_Ui_List_Precise_Layouter_Node_Data));
+ node->layout_data = calloc(1, sizeof(Efl_Ui_View_List_Precise_Layouter_Node_Data));
for (i = 0; i != node->length; ++i)
{
- layout_item = (Efl_Ui_List_LayoutItem *)node->pointers[i];
+ layout_item = (Efl_Ui_View_List_LayoutItem *)node->pointers[i];
EINA_SAFETY_ON_NULL_RETURN(layout_item);
// cache size of new items
@@ -475,18 +501,18 @@ _calc_size_job(void *data)
{
if (!layout_item->layout)
{
- efl_ui_list_model_realize(pd->modeler, layout_item);
+ efl_ui_view_list_model_realize(pd->modeler, layout_item);
}
min = efl_gfx_size_hint_combined_min_get(layout_item->layout);
if (min.w && min.h)
{
_item_min_calc(pd, layout_item, min, node);
- efl_ui_list_model_unrealize(pd->modeler, layout_item);
+ efl_ui_view_list_model_unrealize(pd->modeler, layout_item);
}
else
{
- Efl_Ui_List_Precise_Layouter_Callback_Data *cb_data = calloc(1, sizeof(Efl_Ui_List_Precise_Layouter_Callback_Data));
+ Efl_Ui_View_List_Precise_Layouter_Callback_Data *cb_data = calloc(1, sizeof(Efl_Ui_View_List_Precise_Layouter_Callback_Data));
cb_data->pd = pd;
cb_data->item = layout_item;
evas_object_event_callback_add(layout_item->layout, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_item_size_hint_change, cb_data);
@@ -504,57 +530,71 @@ _calc_size_job(void *data)
eina_accessor_free(nodes);
pd->calc_progress = 0;
pd->calc_job = NULL;
+ pd->recalc = EINA_FALSE;
evas_object_smart_changed(pd->modeler);
}
EOLIAN static Efl_Object *
-_efl_ui_list_precise_layouter_efl_object_constructor(Eo *obj EINA_UNUSED, Efl_Ui_List_Precise_Layouter_Data *pd)
+_efl_ui_view_list_precise_layouter_efl_object_constructor(Eo *obj EINA_UNUSED, Efl_Ui_View_List_Precise_Layouter_Data *pd)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
pd->initialized = EINA_FALSE;
- pd->count_future = NULL;
return obj;
}
-EOLIAN static void
-_efl_ui_list_precise_layouter_efl_ui_list_relayout_model_set(Eo *obj EINA_UNUSED, Efl_Ui_List_Precise_Layouter_Data *pd, Efl_Model *model)
+EOLIAN static Eina_List *
+_efl_ui_view_list_precise_layouter_efl_ui_view_list_relayout_elements_get(const Eo *obj EINA_UNUSED, Efl_Ui_View_List_Precise_Layouter_Data *pd)
{
- if (pd->model == model)
- return;
+ Eina_List *elements_order = NULL;
+ Efl_Ui_View_List_LayoutItem* layout_item;
+ Efl_Ui_View_List_SegArray_Node *items_node;
+ int i, j = 0;
- pd->count_total = 0;
- if (pd->count_future)
+ Eina_Accessor *nodes = efl_ui_view_list_segarray_node_accessor_get(pd->segarray);
+ EINA_ACCESSOR_FOREACH(nodes, i, items_node)
{
- efl_future_cancel(pd->count_future);
- pd->count_future = NULL;
- }
+ Efl_Ui_View_List_Precise_Layouter_Node_Data *nodedata = items_node->layout_data;
+ if (!nodedata || !nodedata->realized)
+ continue;
- if (pd->model)
- {
- _finalize(obj, pd);
- efl_unref(pd->model);
- pd->model = NULL;
+ for(j = 0; j != items_node->length;++j)
+ {
+ layout_item = (Efl_Ui_View_List_LayoutItem *)items_node->pointers[j];
+ if (layout_item->layout)
+ elements_order = eina_list_append(elements_order, layout_item->layout);
+ }
}
- if (model)
+ return elements_order;
+}
+
+EOLIAN static void
+_efl_ui_view_list_precise_layouter_efl_ui_view_list_relayout_model_set(Eo *obj EINA_UNUSED, Efl_Ui_View_List_Precise_Layouter_Data *pd, Efl_Model *model)
+{
+ _finalize(obj, pd);
+
+ efl_replace(&pd->model, model);
+
+ if (pd->model)
{
- pd->model = model;
- efl_ref(pd->model);
- pd->count_future = efl_model_children_count_get(pd->model);
- efl_future_then(pd->count_future, &_count_then, &_count_error, NULL, pd);
+ pd->count_total = efl_model_children_count_get(pd->model);
+ if (pd->count_total && pd->modeler)
+ efl_ui_view_list_model_load_range_set(pd->modeler, 0, pd->count_total); // load all
+ else
+ efl_event_callback_add(pd->model, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, _child_count_changed_cb, pd);
}
}
static void
-_efl_ui_list_relayout_layout_do(Efl_Ui_List_Precise_Layouter_Data *pd)
+_efl_ui_view_list_relayout_layout_do(Efl_Ui_View_List_Precise_Layouter_Data *pd)
{
Eina_Rect vgmt;
Eina_Position2D spos;
double cur_pos = 0;
- Efl_Ui_List_LayoutItem* layout_item;
- Efl_Ui_List_SegArray_Node *items_node;
+ Efl_Ui_View_List_LayoutItem* layout_item;
+ Efl_Ui_View_List_SegArray_Node *items_node;
int i, j = 0;
_calc_range(pd);
@@ -581,15 +621,15 @@ _efl_ui_list_relayout_layout_do(Efl_Ui_List_Precise_Layouter_Data *pd)
extra = boxh - pd->min.h;
if (extra < 0) extra = 0;
- efl_ui_list_model_min_size_set(pd->modeler, pd->min);
+ efl_ui_view_list_model_min_size_set(pd->modeler, pd->min);
vgmt = efl_ui_scrollable_viewport_geometry_get(pd->modeler);
spos = efl_ui_scrollable_content_pos_get(pd->modeler);
- Eina_Accessor *nodes = efl_ui_list_segarray_node_accessor_get(pd->segarray);
+ Eina_Accessor *nodes = efl_ui_view_list_segarray_node_accessor_get(pd->segarray);
EINA_ACCESSOR_FOREACH(nodes, i, items_node)
{
- Efl_Ui_List_Precise_Layouter_Node_Data *nodedata = items_node->layout_data;
+ Efl_Ui_View_List_Precise_Layouter_Node_Data *nodedata = items_node->layout_data;
if (!nodedata)
{
continue;
@@ -599,7 +639,7 @@ _efl_ui_list_relayout_layout_do(Efl_Ui_List_Precise_Layouter_Data *pd)
{
for(j = 0; j != items_node->length;++j)
{
- layout_item = (Efl_Ui_List_LayoutItem *)items_node->pointers[j];
+ layout_item = (Efl_Ui_View_List_LayoutItem *)items_node->pointers[j];
double x, y, w, h;
double weight_x, weight_y;
@@ -638,15 +678,16 @@ _efl_ui_list_relayout_layout_do(Efl_Ui_List_Precise_Layouter_Data *pd)
}
EOLIAN static void
-_efl_ui_list_precise_layouter_efl_ui_list_relayout_layout_do
- (Eo *obj EINA_UNUSED, Efl_Ui_List_Precise_Layouter_Data *pd
- , Efl_Ui_List_Model *modeler, int first, Efl_Ui_List_SegArray *segarray)
+_efl_ui_view_list_precise_layouter_efl_ui_view_list_relayout_layout_do
+ (Eo *obj EINA_UNUSED, Efl_Ui_View_List_Precise_Layouter_Data *pd
+ , Efl_Ui_View_List_Model *modeler, int first, Efl_Ui_View_List_SegArray *segarray)
{
- _initilize(obj, pd, modeler, segarray);
+ if (!_initilize(obj, pd, modeler, segarray))
+ return;
pd->first = first;
- if (pd->recalc)
+ if (pd->recalc && efl_ui_view_list_segarray_count(segarray) > 0)
{
// cache size of new items
pd->calc_progress = 0;
@@ -655,7 +696,7 @@ _efl_ui_list_precise_layouter_efl_ui_list_relayout_layout_do
return;
}
- _efl_ui_list_relayout_layout_do(pd);
+ _efl_ui_view_list_relayout_layout_do(pd);
}
-#include "efl_ui_list_precise_layouter.eo.c"
+#include "efl_ui_view_list_precise_layouter.eo.c"
diff --git a/src/lib/elementary/efl_ui_view_list_precise_layouter.eo b/src/lib/elementary/efl_ui_view_list_precise_layouter.eo
new file mode 100644
index 0000000000..690f927fb5
--- /dev/null
+++ b/src/lib/elementary/efl_ui_view_list_precise_layouter.eo
@@ -0,0 +1,9 @@
+class Efl.Ui.View_List_Precise_Layouter (Efl.Object, Efl.Ui.View_List_Relayout)
+{
+ implements {
+ Efl.Object.constructor;
+ Efl.Ui.View_List_Relayout.layout_do;
+ Efl.Ui.View_List_Relayout.model { set; }
+ Efl.Ui.View_List_Relayout.elements { get; }
+ }
+}
diff --git a/src/lib/elementary/efl_ui_view_list_private.h b/src/lib/elementary/efl_ui_view_list_private.h
new file mode 100644
index 0000000000..7560870f14
--- /dev/null
+++ b/src/lib/elementary/efl_ui_view_list_private.h
@@ -0,0 +1,102 @@
+#ifndef EFL_UI_VIEW_LIST_PRIVATE_H
+#define EFL_UI_VIEW_LIST_PRIVATE_H
+
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
+#define ELM_INTERFACE_ATSPI_SELECTION_PROTECTED
+#define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED
+
+#include <Elementary.h>
+#include "elm_priv.h"
+
+typedef struct _Efl_Ui_View_List_Data Efl_Ui_View_List_Data;
+
+int efl_ui_view_list_item_index_get(Efl_Ui_View_List_LayoutItem *item);
+
+typedef struct _Efl_Ui_View_List_Data Efl_Ui_View_List_Data;
+
+#include "efl_ui_view_list_segarray.h"
+
+struct _Efl_Ui_View_List_Data
+{
+ Eo *obj;
+ Eo *scrl_mgr;
+ Efl_Ui_View_List_Pan *pan_obj;
+ Efl_Model *model;
+
+ Eina_Stringshare *style;
+
+ struct {
+ Eina_Future *future;
+
+ int start;
+ int count;
+ } slice;
+
+ Efl_Ui_Layout_Factory *factory;
+ Eina_List *selected_items;
+
+ Efl_Ui_Focus_Manager *manager;
+ Efl_Ui_View_List_Relayout *relayout;
+
+ Efl_Orient orient;
+
+ int segarray_first;
+ Efl_Ui_View_List_SegArray *segarray;
+
+ Elm_Object_Select_Mode select_mode;
+ Elm_List_Mode mode;
+
+ Eina_Rect gmt;
+ Eina_Size2D min;
+
+ Eina_Bool homogeneous : 1;
+ Eina_Bool recalc : 1;
+ Eina_Bool on_hold : 1;
+ Eina_Bool scrl_freeze : 1;
+};
+
+typedef struct _Efl_Ui_View_List_Pan_Data Efl_Ui_View_List_Pan_Data;
+
+struct _Efl_Ui_View_List_Pan_Data
+{
+ Eo *wobj;
+ Eina_Rect gmt;
+ Evas_Coord move_diff;
+
+ Ecore_Job *resize_job;
+};
+
+typedef struct _Efl_Ui_View_List_Slice Efl_Ui_View_List_Slice;
+
+struct _Efl_Ui_View_List_Slice
+{
+ Efl_Ui_View_List_Data *pd;
+ int newstart, slicestart, newslice;
+};
+
+#define EFL_UI_VIEW_LIST_DATA_GET(o, ptr) \
+ Efl_Ui_View_List_Data * ptr = efl_data_scope_get(o, EFL_UI_VIEW_LIST_CLASS)
+
+#define EFL_UI_VIEW_LIST_DATA_GET_OR_RETURN(o, ptr) \
+ EFL_UI_VIEW_LIST_DATA_GET(o, ptr); \
+ if (EINA_UNLIKELY(!ptr)) \
+ { \
+ ERR("No widget data for object %p (%s)", \
+ o, evas_object_type_get(o)); \
+ return; \
+ }
+
+#define EFL_UI_VIEW_LIST_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
+ EFL_UI_VIEW_LIST_DATA_GET(o, ptr); \
+ if (EINA_UNLIKELY(!ptr)) \
+ { \
+ ERR("No widget data for object %p (%s)", \
+ o, evas_object_type_get(o)); \
+ return val; \
+ }
+
+#endif
diff --git a/src/lib/elementary/efl_ui_view_list_relayout.eo b/src/lib/elementary/efl_ui_view_list_relayout.eo
new file mode 100644
index 0000000000..f1d7f4b7ed
--- /dev/null
+++ b/src/lib/elementary/efl_ui_view_list_relayout.eo
@@ -0,0 +1,25 @@
+interface Efl.Ui.View_List_Relayout (Efl.Interface)
+{
+ methods {
+ layout_do {
+ params {
+ modeler: Efl.Ui.View_List_Model;
+ first: int;
+ children: Efl.Ui.View_List_SegArray;
+ }
+ }
+ @property model {
+ [[Model that is/will be ]]
+ set {}
+ values {
+ model: Efl.Model; [[Efl model]]
+ }
+ }
+ @property elements {
+ get {}
+ values {
+ elements: list<Efl.Gfx.Entity>; [[The order to use]]
+ }
+ }
+ }
+}
diff --git a/src/lib/elementary/efl_ui_view_list_segarray.c b/src/lib/elementary/efl_ui_view_list_segarray.c
new file mode 100644
index 0000000000..bb2dd9477a
--- /dev/null
+++ b/src/lib/elementary/efl_ui_view_list_segarray.c
@@ -0,0 +1,470 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <Efl.h>
+#include <assert.h>
+
+#define MY_CLASS EFL_UI_VIEW_LIST_SEGARRAY_CLASS
+#define MY_CLASS_NAME "Efl.Ui.View.List.SegArray"
+
+#include "efl_ui_view_list_private.h"
+#include "efl_ui_view_list_segarray.h"
+
+static int _search_lookup_cb(Eina_Rbtree const* rbtree, const void* key, int length EINA_UNUSED, void* data EINA_UNUSED)
+{
+ Efl_Ui_View_List_SegArray_Node const* node = (void const*)rbtree;
+ int index = *(int*)key;
+ if(index < node->first)
+ {
+ return 1;
+ }
+ else if(index < node->first + node->length)
+ {
+ return 0;
+ }
+ else
+ {
+ return -1;
+ }
+}
+
+static int _insert_lookup_cb(Eina_Rbtree const* rbtree, const void* key, int length EINA_UNUSED, void* data EINA_UNUSED)
+{
+ Efl_Ui_View_List_SegArray_Node const* node = (void const*)rbtree;
+ int index = *(int*)key;
+ if(index < node->first)
+ {
+ return 1;
+ }
+ else if(index < node->first + node->max)
+ {
+ return 0;
+ }
+ else
+ {
+ return -1;
+ }
+}
+
+static Eina_Rbtree_Direction _rbtree_compare(Efl_Ui_View_List_SegArray_Node const* left,
+ Efl_Ui_View_List_SegArray_Node const* right, void* data EINA_UNUSED)
+{
+ if(left->first < right->first)
+ return EINA_RBTREE_LEFT;
+ else
+ return EINA_RBTREE_RIGHT;
+}
+
+
+static void
+_free_node(Efl_Ui_View_List_SegArray_Node* node, void* data EINA_UNUSED)
+{
+ int i = 0;
+
+ while (i < node->length)
+ {
+ free(node->pointers[i]);
+ ++i;
+ }
+
+ free(node);
+}
+
+static Efl_Ui_View_List_SegArray_Node*
+_alloc_node(Efl_Ui_View_List_SegArray_Data* pd, int first)
+{
+ Efl_Ui_View_List_SegArray_Node* node;
+ node = calloc(1, sizeof(Efl_Ui_View_List_SegArray_Node) + pd->step_size*sizeof(Efl_Ui_View_List_LayoutItem*));
+ node->first = first;
+ node->max = pd->step_size;
+ pd->root = (void*)eina_rbtree_inline_insert(EINA_RBTREE_GET(pd->root), EINA_RBTREE_GET(node),
+ EINA_RBTREE_CMP_NODE_CB(&_rbtree_compare), NULL);
+ pd->node_count++;
+ return node;
+}
+
+EOLIAN static void
+_efl_ui_view_list_segarray_flush(Eo* obj EINA_UNUSED, Efl_Ui_View_List_SegArray_Data *pd)
+{
+ if (pd->root)
+ eina_rbtree_delete(EINA_RBTREE_GET(pd->root), EINA_RBTREE_FREE_CB(_free_node), NULL);
+
+ pd->root = NULL;
+ pd->node_count = 0;
+ pd->count = 0;
+}
+
+static Efl_Ui_View_List_LayoutItem* _create_item_partial(Efl_Model* model)
+{
+ Efl_Ui_View_List_LayoutItem* item = calloc(1, sizeof(Efl_Ui_View_List_LayoutItem));
+ item->children = model;
+ return item;
+}
+
+static Efl_Ui_View_List_LayoutItem* _create_item(Efl_Model* model, Efl_Ui_View_List_SegArray_Node* node, unsigned int index)
+{
+ Efl_Ui_View_List_LayoutItem* item = _create_item_partial(model);
+ item->index_offset = index - node->first;
+ item->tree_node = node;
+ return item;
+}
+
+EOLIAN static Efl_Ui_View_List_LayoutItem*
+_efl_ui_view_list_segarray_remove(Eo* obj EINA_UNUSED, Efl_Ui_View_List_SegArray_Data *pd, int index)
+{
+ Efl_Ui_View_List_SegArray_Node *node;
+ Efl_Ui_View_List_LayoutItem *item, *rt;
+ Eina_Iterator* iterator;
+ int offset;
+
+ node = (void*)eina_rbtree_inline_lookup(EINA_RBTREE_GET(pd->root),
+ &index, sizeof(index), &_insert_lookup_cb, NULL);
+ if (!node) return NULL;
+
+ offset = index - node->first;
+ if (offset >= node->length) return NULL;
+
+ rt = node->pointers[offset];
+ pd->count--;
+ node->length--;
+
+ while (offset < node->length)
+ {
+ node->pointers[offset] = node->pointers[offset+1];
+ item = node->pointers[offset];
+ --item->index_offset;
+ ++offset;
+ }
+
+ node = (void*)EINA_RBTREE_GET(node)->son[EINA_RBTREE_LEFT];
+ iterator = eina_rbtree_iterator_infix((void*)node);
+ while(eina_iterator_next(iterator, (void**)&node))
+ node->first--;
+
+ return rt;
+}
+
+static void
+_efl_ui_view_list_segarray_insert_at_node(Efl_Ui_View_List_SegArray_Data* pd, int index, Efl_Ui_View_List_LayoutItem* item, Efl_Ui_View_List_SegArray_Node* node)
+{
+ Eina_Iterator* iterator;
+ int pos;
+
+ if(node && node->length != node->max && (index - node->first) <= node->length)
+ {
+ pos = index - node->first;
+ item->tree_node = node;
+ item->index_offset = pos;
+ if(pos < node->length)
+ {
+ assert(node->length != node->max);
+
+ memmove(&node->pointers[pos], &node->pointers[pos+1], sizeof(node->pointers[pos])*(node->length - pos));
+ node->pointers[pos] = item;
+ node->length++;
+ }
+ else
+ {
+ assert(pos == node->length);
+
+ assert(node->length != node->max);
+ node->pointers[pos] = item;
+ node->length++;
+ }
+ }
+ else
+ {
+ node = _alloc_node(pd, index);
+ node->pointers[0] = item;
+ node->length++;
+ item->index_offset = 0;
+ item->tree_node = node;
+ }
+
+ node = (void*)EINA_RBTREE_GET(node)->son[EINA_RBTREE_LEFT];
+ iterator = eina_rbtree_iterator_infix((void*)node);
+ while(eina_iterator_next(iterator, (void**)&node))
+ {
+ node->first++;
+ }
+
+ eina_iterator_free(iterator);
+}
+
+
+EOLIAN static void
+_efl_ui_view_list_segarray_insert(Eo *obj EINA_UNUSED, Efl_Ui_View_List_SegArray_Data* pd, int index, Efl_Model* model)
+{
+ Efl_Ui_View_List_SegArray_Node* node, *next;
+ Efl_Ui_View_List_LayoutItem* item;
+
+ item = _create_item_partial(model);
+
+ node = (void*)eina_rbtree_inline_lookup(EINA_RBTREE_GET(pd->root),
+ &index, sizeof(index), &_insert_lookup_cb, NULL);
+ if(node)
+ {
+ next = (void*)EINA_RBTREE_GET(node)->son[EINA_RBTREE_LEFT];
+ if(next && next->first <= index)
+ _efl_ui_view_list_segarray_insert_at_node(pd, index, item, next);
+ else
+ _efl_ui_view_list_segarray_insert_at_node(pd, index, item, node);
+ }
+ else
+ _efl_ui_view_list_segarray_insert_at_node(pd, index, item, NULL);
+}
+
+static void
+efl_ui_view_list_segarray_insert_object(Efl_Ui_View_List_SegArray_Data *segarray, unsigned int index, Efl_Model *children)
+{
+ Efl_Ui_View_List_SegArray_Node *node;
+
+ node = (void*)eina_rbtree_inline_lookup(EINA_RBTREE_GET(segarray->root),
+ &index, sizeof(index), &_insert_lookup_cb, NULL);
+ if (!node)
+ {
+ node = _alloc_node(segarray, index);
+ }
+
+ assert(node->length < node->max);
+ node->pointers[node->length] = _create_item(children, node, index);
+ node->length++;
+ segarray->count++;
+}
+
+EOLIAN static void
+_efl_ui_view_list_segarray_insert_value(Eo *obj EINA_UNUSED, Efl_Ui_View_List_SegArray_Data *segarray, int first, Eina_Value v)
+{
+ Efl_Model *children;
+ unsigned int i, len;
+
+ if (eina_value_type_get(&v) == EINA_VALUE_TYPE_OBJECT)
+ {
+ children = eina_value_object_get(&v);
+ efl_ui_view_list_segarray_insert_object(segarray, first, children);
+ }
+ else if (eina_value_type_get(&v) == EINA_VALUE_TYPE_ARRAY)
+ {
+ EINA_VALUE_ARRAY_FOREACH(&v, len, i, children)
+ {
+ unsigned int idx = first + i;
+
+ efl_ui_view_list_segarray_insert_object(segarray, idx, children);
+ }
+ }
+ else
+ {
+ printf("Unknow type !\n");
+ }
+}
+
+EOLIAN static int
+_efl_ui_view_list_segarray_count(Eo *obj EINA_UNUSED, Efl_Ui_View_List_SegArray_Data* pd)
+{
+ return pd->count;
+}
+
+typedef struct _Efl_Ui_View_List_Segarray_Eina_Accessor
+{
+ Eina_Accessor vtable;
+ Efl_Ui_View_List_SegArray_Data* segarray;
+} Efl_Ui_View_List_Segarray_Eina_Accessor;
+
+static Eina_Bool
+_efl_ui_view_list_segarray_accessor_get_at(Efl_Ui_View_List_Segarray_Eina_Accessor* acc,
+ int idx, void** data)
+{
+ Efl_Ui_View_List_SegArray_Node* node;
+ node = (void*)eina_rbtree_inline_lookup(EINA_RBTREE_GET(acc->segarray->root),
+ &idx, sizeof(idx), &_search_lookup_cb, NULL);
+ if (node && (node->first <= idx && node->first + node->length > idx))
+ {
+ int i = idx - node->first;
+ Efl_Ui_View_List_LayoutItem* item = node->pointers[i];
+ *data = item;
+ return EINA_TRUE;
+ }
+ return EINA_FALSE;
+}
+
+EOLIAN static void
+_efl_ui_view_list_segarray_setup(Eo *obj EINA_UNUSED, Efl_Ui_View_List_SegArray_Data *pd, int size)
+{
+ pd->step_size = size;
+}
+
+EOLIAN static Eo *
+_efl_ui_view_list_segarray_efl_object_constructor(Eo *obj, Efl_Ui_View_List_SegArray_Data *pd EINA_UNUSED)
+{
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+
+ return obj;
+}
+
+EOLIAN static void
+_efl_ui_view_list_segarray_efl_object_destructor(Eo *obj, Efl_Ui_View_List_SegArray_Data *pd)
+{
+ if (pd->root)
+ eina_rbtree_delete(EINA_RBTREE_GET(pd->root), EINA_RBTREE_FREE_CB(_free_node), NULL);
+
+ pd->root = NULL;
+ efl_destructor(efl_super(obj, MY_CLASS));
+}
+
+static void*
+_efl_ui_view_list_segarray_accessor_get_container(Efl_Ui_View_List_Segarray_Eina_Accessor* acc EINA_UNUSED)
+{
+ return NULL;
+}
+
+static void
+_efl_ui_view_list_segarray_accessor_free(Efl_Ui_View_List_Segarray_Eina_Accessor* acc EINA_UNUSED)
+{
+ free(acc);
+}
+
+static void
+_efl_ui_view_list_segarray_accessor_lock(Efl_Ui_View_List_Segarray_Eina_Accessor* acc EINA_UNUSED)
+{
+}
+
+static void
+_efl_ui_view_list_segarray_accessor_unlock(Efl_Ui_View_List_Segarray_Eina_Accessor* acc EINA_UNUSED)
+{
+}
+
+static Eina_Accessor*
+_efl_ui_view_list_segarray_accessor_clone(Efl_Ui_View_List_Segarray_Eina_Accessor* acc EINA_UNUSED)
+{
+ return &acc->vtable;
+}
+
+static void
+_efl_ui_view_list_segarray_accessor_setup(Efl_Ui_View_List_Segarray_Eina_Accessor* acc, Efl_Ui_View_List_SegArray_Data* segarray)
+{
+ EINA_MAGIC_SET(&acc->vtable, EINA_MAGIC_ACCESSOR);
+ acc->vtable.version = EINA_ACCESSOR_VERSION;
+ acc->vtable.get_at = FUNC_ACCESSOR_GET_AT(_efl_ui_view_list_segarray_accessor_get_at);
+ acc->vtable.get_container = FUNC_ACCESSOR_GET_CONTAINER(_efl_ui_view_list_segarray_accessor_get_container);
+ acc->vtable.free = FUNC_ACCESSOR_FREE(_efl_ui_view_list_segarray_accessor_free);
+ acc->vtable.lock = FUNC_ACCESSOR_LOCK(_efl_ui_view_list_segarray_accessor_lock);
+ acc->vtable.unlock = FUNC_ACCESSOR_LOCK(_efl_ui_view_list_segarray_accessor_unlock);
+ acc->vtable.clone = FUNC_ACCESSOR_CLONE(_efl_ui_view_list_segarray_accessor_clone);
+ acc->segarray = segarray;
+}
+
+EOLIAN static Eina_Accessor*
+_efl_ui_view_list_segarray_accessor_get(const Eo *obj EINA_UNUSED, Efl_Ui_View_List_SegArray_Data* pd)
+{
+ Efl_Ui_View_List_Segarray_Eina_Accessor* acc = calloc(1, sizeof(Efl_Ui_View_List_Segarray_Eina_Accessor));
+ _efl_ui_view_list_segarray_accessor_setup(acc, pd);
+ return &acc->vtable;
+}
+
+typedef struct _Efl_Ui_View_List_Segarray_Node_Accessor
+{
+ Eina_Accessor vtable;
+ Efl_Ui_View_List_SegArray_Data* segarray;
+ Eina_Iterator* pre_iterator;
+ Efl_Ui_View_List_SegArray_Node* current_node;
+ int current_index;
+} Efl_Ui_View_List_Segarray_Node_Accessor;
+
+static Eina_Bool
+_efl_ui_view_list_segarray_node_accessor_get_at(Efl_Ui_View_List_Segarray_Node_Accessor* acc,
+ int idx, void** data)
+{
+ if(idx == acc->current_index && acc->current_node)
+ {
+ (*data) = acc->current_node;
+ }
+ else
+ {
+ if(acc->current_index >= idx || !acc->current_node)
+ {
+ eina_iterator_free(acc->pre_iterator);
+ acc->pre_iterator = NULL;
+ acc->current_node = NULL;
+ acc->current_index = -1;
+ }
+
+ if(!acc->pre_iterator)
+ acc->pre_iterator = eina_rbtree_iterator_infix((void*)acc->segarray->root);
+
+ for(;acc->current_index != idx;++acc->current_index)
+ {
+ if(!eina_iterator_next(acc->pre_iterator, (void**)&acc->current_node))
+ {
+ --acc->current_index;
+ return EINA_FALSE;
+ }
+ }
+ (*data) = acc->current_node;
+ return EINA_TRUE;
+ }
+ return EINA_FALSE;
+}
+
+static void*
+_efl_ui_view_list_segarray_node_accessor_get_container(Efl_Ui_View_List_Segarray_Node_Accessor* acc EINA_UNUSED)
+{
+ return NULL;
+}
+
+static void
+_efl_ui_view_list_segarray_node_accessor_free(Efl_Ui_View_List_Segarray_Node_Accessor* acc EINA_UNUSED)
+{
+ if (acc->pre_iterator)
+ eina_iterator_free(acc->pre_iterator);
+ free(acc);
+}
+
+static void
+_efl_ui_view_list_segarray_node_accessor_lock(Efl_Ui_View_List_Segarray_Node_Accessor* acc EINA_UNUSED)
+{
+}
+
+static void
+_efl_ui_view_list_segarray_node_accessor_unlock(Efl_Ui_View_List_Segarray_Node_Accessor* acc EINA_UNUSED)
+{
+}
+
+static Eina_Accessor*
+_efl_ui_view_list_segarray_node_accessor_clone(Efl_Ui_View_List_Segarray_Node_Accessor* acc EINA_UNUSED)
+{
+ return &acc->vtable;
+}
+
+static void
+_efl_ui_view_list_segarray_node_accessor_setup(Efl_Ui_View_List_Segarray_Node_Accessor* acc, Efl_Ui_View_List_SegArray_Data* segarray)
+{
+ EINA_MAGIC_SET(&acc->vtable, EINA_MAGIC_ACCESSOR);
+ acc->vtable.version = EINA_ACCESSOR_VERSION;
+ acc->vtable.get_at = FUNC_ACCESSOR_GET_AT(_efl_ui_view_list_segarray_node_accessor_get_at);
+ acc->vtable.get_container = FUNC_ACCESSOR_GET_CONTAINER(_efl_ui_view_list_segarray_node_accessor_get_container);
+ acc->vtable.free = FUNC_ACCESSOR_FREE(_efl_ui_view_list_segarray_node_accessor_free);
+ acc->vtable.lock = FUNC_ACCESSOR_LOCK(_efl_ui_view_list_segarray_node_accessor_lock);
+ acc->vtable.unlock = FUNC_ACCESSOR_LOCK(_efl_ui_view_list_segarray_node_accessor_unlock);
+ acc->vtable.clone = FUNC_ACCESSOR_CLONE(_efl_ui_view_list_segarray_node_accessor_clone);
+ acc->segarray = segarray;
+ acc->pre_iterator = NULL;
+ acc->current_index = -1;
+ acc->current_node = NULL;
+}
+
+EOLIAN static Eina_Accessor*
+_efl_ui_view_list_segarray_node_accessor_get(const Eo *obj EINA_UNUSED, Efl_Ui_View_List_SegArray_Data* pd)
+{
+ Efl_Ui_View_List_Segarray_Node_Accessor* acc = calloc(1, sizeof(Efl_Ui_View_List_Segarray_Node_Accessor));
+ _efl_ui_view_list_segarray_node_accessor_setup(acc, pd);
+ return &acc->vtable;
+}
+
+int efl_ui_view_list_item_index_get(Efl_Ui_View_List_LayoutItem* item)
+{
+ Efl_Ui_View_List_SegArray_Node* node = item->tree_node;
+ return item->index_offset + node->first;
+}
+
+#include "efl_ui_view_list_segarray.eo.c"
diff --git a/src/lib/elementary/efl_ui_view_list_segarray.eo b/src/lib/elementary/efl_ui_view_list_segarray.eo
new file mode 100644
index 0000000000..a3bc275976
--- /dev/null
+++ b/src/lib/elementary/efl_ui_view_list_segarray.eo
@@ -0,0 +1,61 @@
+import efl_ui_view_list_types;
+
+class Efl.Ui.View_List_SegArray (Efl.Object)
+{
+ methods {
+ @property accessor {
+ get {
+ [[ Get a SegArray List items accessor ]]
+ }
+ values {
+ acc: accessor<ptr(Efl.Ui.View.List.LayoutItem)>;
+ }
+ }
+ @property node_accessor {
+ get {
+ [[ Get a SegArray node accessor ]]
+ }
+ values {
+ acc: accessor<ptr(Efl.Ui.View.List.SegArray.Node)>;
+ }
+ }
+ insert_value {
+ [[ Insert a accessor in segarray tree ]]
+ params {
+ @in first: int;
+ @in v: any_value;
+ }
+ }
+ count {
+ [[ Get the number of items in SegArray tree ]]
+ return: int;
+ }
+ setup {
+ [[ Configure a step of SegArray tree, this is the max node size ]]
+ params {
+ @in initial_step_size: int;
+ }
+ }
+ flush {
+ [[ flush the SegArray tree ]]
+ }
+ insert {
+ [[ Insert a new model in SegArray tree at index position ]]
+ params {
+ @in index: int;
+ @in model: Efl.Model;
+ }
+ }
+ remove {
+ [[ Remove the item at index position in SegArray tree ]]
+ params {
+ @in index: int;
+ }
+ return: ptr(Efl.Ui.View.List.LayoutItem) @owned;
+ }
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Object.destructor;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_view_list_segarray.h b/src/lib/elementary/efl_ui_view_list_segarray.h
new file mode 100644
index 0000000000..8848331ba9
--- /dev/null
+++ b/src/lib/elementary/efl_ui_view_list_segarray.h
@@ -0,0 +1,28 @@
+#ifndef EFL_UI_LIST_SEGARRAY_H
+#define EFL_UI_LIST_SEGARRAY_H
+
+typedef struct _Efl_Ui_View_List_Item Efl_Ui_View_List_Item;
+
+typedef struct _Efl_Ui_View_List_SegArray_Node
+{
+ EINA_RBTREE;
+
+ int length;
+ int max;
+ int first;
+
+ void* layout_data;
+
+ Efl_Ui_View_List_LayoutItem* pointers[0];
+} Efl_Ui_View_List_SegArray_Node;
+
+typedef struct _Efl_Ui_View_List_SegArray_Data
+{
+ Efl_Ui_View_List_SegArray_Node *root;
+
+ int step_size;
+ int node_count;
+ int count;
+} Efl_Ui_View_List_SegArray_Data;
+
+#endif
diff --git a/src/lib/elementary/efl_ui_list_types.eot b/src/lib/elementary/efl_ui_view_list_types.eot
index a0997c8db4..6996903082 100644
--- a/src/lib/elementary/efl_ui_list_types.eot
+++ b/src/lib/elementary/efl_ui_view_list_types.eot
@@ -1,5 +1,5 @@
-struct Efl.Ui.List.LayoutItem {
- layout: Efl.Ui.Layout;
+struct Efl.Ui.View.List.LayoutItem {
+ layout: Efl.Ui.Layout.Object;
children: Efl.Model;
index_offset: int;
tree_node: void_ptr;
@@ -7,3 +7,5 @@ struct Efl.Ui.List.LayoutItem {
size: Eina.Size2D;
pos: Eina.Position2D;
}
+
+struct @extern Efl.Ui.View.List.SegArray.Node; [[ ]]
diff --git a/src/lib/elementary/elm_widget.c b/src/lib/elementary/efl_ui_widget.c
index 3d908f1209..df8fe6020a 100644
--- a/src/lib/elementary/elm_widget.c
+++ b/src/lib/elementary/efl_ui_widget.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_COMPONENT_PROTECTED
#define ELM_WIDGET_PROTECTED
#define ELM_WIDGET_ITEM_PROTECTED
@@ -11,6 +11,7 @@
#define EFL_UI_TRANSLATABLE_PROTECTED
#define EFL_UI_FOCUS_OBJECT_PROTECTED
#define EFL_UI_WIDGET_PART_BG_PROTECTED
+#define EFL_PART_PROTECTED
#include <Elementary.h>
@@ -24,9 +25,9 @@
#define EFL_INTERNAL_UNSTABLE
#include "interfaces/efl_common_internal.h"
-#define MY_CLASS ELM_WIDGET_CLASS
+#define MY_CLASS EFL_UI_WIDGET_CLASS
-#define MY_CLASS_NAME "Elm_Widget"
+#define MY_CLASS_NAME "Efl_Ui_Widget"
#define MY_CLASS_NAME_LEGACY "elm_widget"
#define ELM_WIDGET_DATA_GET(o, wd) \
@@ -42,7 +43,7 @@
if (!sd) return
#define ELM_WIDGET_FOCUS_GET(obj) \
- (efl_isa(obj, ELM_WIDGET_CLASS) && \
+ (efl_isa(obj, EFL_UI_WIDGET_CLASS) && \
((_elm_access_auto_highlight_get()) ? (elm_widget_highlight_get(obj)) : \
(efl_ui_focus_object_focus_get(obj))))
@@ -55,9 +56,6 @@ typedef struct _Elm_Event_Cb_Data Elm_Event_Cb_Data;
typedef struct _Elm_Label_Data Elm_Label_Data;
typedef struct _Elm_Translate_String_Data Elm_Translate_String_Data;
-/* FIXME: EAPI because of elm_code_widget test case */
-EAPI Eina_Bool _elm_legacy_add = EINA_FALSE;
-
struct _Elm_Event_Cb_Data
{
Elm_Event_Cb func;
@@ -79,6 +77,80 @@ struct _Elm_Translate_String_Data
Eina_Bool preset : 1;
};
+/* For keeping backward compatibility (EFL 1.18 or older versions).
+ * Since EFL 1.19 which starts to use eolian_gen2, it does not convert
+ * "." to "_" among the class name. */
+static const char *legacy_type_table[][2] =
+{
+ { "Efl.Ui.Bg_Widget_Legacy", "Elm_Bg" },
+ { "Efl.Ui.Button_Legacy", "Elm_Button" },
+ { "Efl.Ui.Check_Legacy", "Elm_Check" },
+ { "Efl.Ui.Clock_Legacy", "Elm_Datetime" },
+ { "Efl.Ui.Flip_Legacy", "Elm_Flip" },
+ { "Efl.Ui.Frame_Legacy", "Elm_Frame" },
+ { "Efl.Ui.Image_Legacy", "Elm_Image" },
+ { "Efl.Ui.Image_Zoomable_Legacy", "Elm_Photocam" },
+ { "Efl.Ui.Layout_Legacy", "Elm_Layout" },
+ { "Efl.Ui.Panes_Legacy", "Elm_Panes" },
+ { "Efl.Ui.Progressbar_Legacy", "Elm_Progressbar" },
+ { "Efl.Ui.Radio_Legacy", "Elm_Radio" },
+ { "Efl.Ui.Video_Legacy", "Elm_Video" },
+ { "Efl.Ui.Win_Legacy", "Elm_Win" },
+ { "Efl.Ui.Win_Socket_Legacy", "Elm_Win" },
+ { "Efl.Ui.Win_Inlined_Legacy", "Elm_Win" },
+ { "Elm.Code_Widget_Legacy", "Elm_Code_Widget" },
+ { "Elm.Ctxpopup", "Elm_Ctxpopup" },
+ { "Elm.Entry", "Elm_Entry" },
+ { "Elm.Colorselector", "Elm_Colorselector" },
+ { "Elm.List", "Elm_List" },
+ { "Elm.Photo", "Elm_Photo" },
+ { "Elm.Actionslider", "Elm_Actionslider" },
+ { "Elm.Box", "Elm_Box" },
+ { "Elm.Table", "Elm_Table" },
+ { "Elm.Thumb", "Elm_Thumb" },
+ { "Elm.Menu", "Elm_Menu" },
+ { "Elm.Icon", "Elm_Icon" },
+ { "Elm.Prefs", "Elm_Prefs" },
+ { "Elm.Map", "Elm_Map" },
+ { "Elm.Glview", "Elm_Glview" },
+ { "Elm.Web", "Elm_Web" },
+ { "Elm.Toolbar", "Elm_Toolbar" },
+ { "Elm.Grid", "Elm_Grid" },
+ { "Elm.Diskselector", "Elm_Diskselector" },
+ { "Elm.Notify", "Elm_Notify" },
+ { "Elm.Mapbuf", "Elm_Mapbuf" },
+ { "Elm.Separator", "Elm_Separator" },
+ { "Elm.Calendar", "Elm_Calendar" },
+ { "Elm.Inwin", "Elm_Inwin" },
+ { "Elm.Gengrid", "Elm_Gengrid" },
+ { "Elm.Scroller", "Elm_Scroller" },
+ { "Elm.Player", "Elm_Player" },
+ { "Elm.Segment_Control", "Elm_Segment_Control" },
+ { "Elm.Fileselector", "Elm_Fileselector" },
+ { "Elm.Fileselector_Button", "Elm_Fileselector_Button" },
+ { "Elm.Fileselector_Entry", "Elm_Fileselector_Entry" },
+ { "Elm.Flipselector", "Elm_Flipselector" },
+ { "Elm.Hoversel", "Elm_Hoversel" },
+ { "Elm.Naviframe", "Elm_Naviframe" },
+ { "Elm.Popup", "Elm_Popup" },
+ { "Elm.Bubble", "Elm_Bubble" },
+ { "Elm.Clock", "Elm_Clock" },
+ { "Elm.Conformant", "Elm_Conformant" },
+ { "Elm.Dayselector", "Elm_Dayselector" },
+ { "Elm.Genlist", "Elm_Genlist" },
+ { "Elm.Hover", "Elm_Hover" },
+ { "Elm.Index", "Elm_Index" },
+ { "Elm.Label", "Elm_Label" },
+ { "Elm.Panel", "Elm_Panel" },
+ { "Elm.Slider", "Elm_Slider" },
+ { "Elm.Slideshow", "Elm_Slideshow" },
+ { "Elm.Spinner", "Elm_Spinner" },
+ { "Elm.Plug", "Elm_Plug" },
+ { "Elm.Web.None", "Elm_Web" },
+ { "Elm.Multibuttonentry", "Elm_Multibuttonentry" },
+ { NULL, NULL }
+};
+
/* local subsystem globals */
static inline Eina_Bool
_elm_widget_is(const Evas_Object *obj)
@@ -104,8 +176,12 @@ static inline Eina_Bool
_elm_scrollable_is(const Evas_Object *obj)
{
INTERNAL_ENTRY EINA_FALSE;
- return
- efl_isa(obj, ELM_INTERFACE_SCROLLABLE_MIXIN);
+ if (elm_widget_is_legacy(obj))
+ return
+ efl_isa(obj, ELM_INTERFACE_SCROLLABLE_MIXIN);
+ else
+ return
+ efl_isa(obj, EFL_UI_SCROLLABLE_INTERACTIVE_INTERFACE);
}
static void
@@ -114,7 +190,7 @@ static void
_on_sub_obj_del(void *data, const Efl_Event *event);
static void _propagate_event(void *data, const Efl_Event *eo_event);
static void _elm_widget_focus_tree_unfocusable_handle(Eo *obj);
-static void _elm_widget_shadow_update(Elm_Widget *obj);
+static void _elm_widget_shadow_update(Efl_Ui_Widget *obj);
EFL_CALLBACKS_ARRAY_DEFINE(elm_widget_subitems_callbacks,
{ EFL_EVENT_DEL, _on_sub_obj_del });
@@ -161,7 +237,7 @@ _elm_widget_item_highlight_in_theme(Evas_Object *obj, Elm_Object_Item *eo_it)
{
Elm_Widget_Item_Data *it = efl_data_scope_get(eo_it, ELM_WIDGET_ITEM_CLASS);
- if (efl_isa(it->view, EFL_UI_LAYOUT_CLASS))
+ if (efl_isa(it->view, EFL_UI_LAYOUT_OBJECT_CLASS))
str = edje_object_data_get(elm_layout_edje_get(it->view), "focus_highlight");
else
str = edje_object_data_get(it->view, "focus_highlight");
@@ -184,7 +260,7 @@ _elm_widget_focus_highlight_start(const Evas_Object *obj)
}
Evas_Object *
-_elm_widget_focus_highlight_object_get(const Evas_Object *obj)
+_efl_ui_widget_focus_highlight_object_get(const Evas_Object *obj)
{
Evas_Object *top = elm_widget_top_get(obj);
@@ -194,7 +270,7 @@ _elm_widget_focus_highlight_object_get(const Evas_Object *obj)
}
EOLIAN static Eina_Bool
-_elm_widget_focus_highlight_enabled_get(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED)
+_efl_ui_widget_focus_highlight_enabled_get(const Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED)
{
// Forward to closest parent Window
const Evas_Object *win = elm_widget_top_get(obj);
@@ -206,7 +282,7 @@ _elm_widget_focus_highlight_enabled_get(Eo *obj, Elm_Widget_Smart_Data *sd EINA_
}
EOLIAN static void
-_elm_widget_focus_highlight_enabled_set(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED, Eina_Bool enable)
+_efl_ui_widget_focus_highlight_enabled_set(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED, Eina_Bool enable)
{
// Forward to closest parent Window
Evas_Object *win = elm_widget_top_get(obj);
@@ -216,7 +292,7 @@ _elm_widget_focus_highlight_enabled_set(Eo *obj, Elm_Widget_Smart_Data *sd EINA_
}
EOLIAN static Eina_Bool
-_elm_widget_focus_highlight_animate_get(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED)
+_efl_ui_widget_focus_highlight_animate_get(const Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED)
{
// Forward to closest parent Window
const Evas_Object *win = elm_widget_top_get(obj);
@@ -228,7 +304,7 @@ _elm_widget_focus_highlight_animate_get(Eo *obj, Elm_Widget_Smart_Data *sd EINA_
}
EOLIAN static void
-_elm_widget_focus_highlight_animate_set(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED, Eina_Bool enable)
+_efl_ui_widget_focus_highlight_animate_set(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED, Eina_Bool enable)
{
// Forward to closest parent Window
Evas_Object *win = elm_widget_top_get(obj);
@@ -238,7 +314,7 @@ _elm_widget_focus_highlight_animate_set(Eo *obj, Elm_Widget_Smart_Data *sd EINA_
}
EOLIAN static Eina_Bool
-_elm_widget_focus_highlight_style_set(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED, const char *style)
+_efl_ui_widget_focus_highlight_style_set(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED, const char *style)
{
// Forward to closest parent Window
Evas_Object *win = elm_widget_top_get(obj);
@@ -250,7 +326,7 @@ _elm_widget_focus_highlight_style_set(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UN
}
EOLIAN static const char *
-_elm_widget_focus_highlight_style_get(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED)
+_efl_ui_widget_focus_highlight_style_get(const Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED)
{
// Forward to closest parent Window
Evas_Object *win = elm_widget_top_get(obj);
@@ -264,7 +340,7 @@ _elm_widget_focus_highlight_style_get(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UN
static Eina_Bool
_tree_unfocusable(Eo *obj)
{
- Elm_Widget *wid = obj;
+ Efl_Ui_Widget *wid = obj;
do {
ELM_WIDGET_DATA_GET(wid, wid_pd);
@@ -276,9 +352,35 @@ _tree_unfocusable(Eo *obj)
}
static Eina_Bool
+_tree_custom_chain_missing(Eo *obj)
+{
+ Efl_Ui_Widget *wid = obj;
+
+ while (elm_widget_parent_get(wid))
+ {
+ Efl_Ui_Widget *parent = elm_widget_parent_get(wid);
+ ELM_WIDGET_DATA_GET(parent, parent_pd);
+ Eina_List *lst = parent_pd->legacy_focus.custom_chain;
+
+ if (lst)
+ {
+ if (!eina_list_data_find(lst, wid))
+ {
+ WRN("Widget %p disabled due to custom chain of %p", wid, parent);
+ return EINA_TRUE;
+ }
+ }
+
+ wid = parent;
+ }
+
+ return EINA_FALSE;
+}
+
+static Eina_Bool
_tree_disabled(Eo *obj)
{
- Elm_Widget *wid = obj;
+ Efl_Ui_Widget *wid = obj;
do {
ELM_WIDGET_DATA_GET(wid, wid_pd);
@@ -311,9 +413,9 @@ _focus_manager_eval(Eo *obj, Elm_Widget_Smart_Data *pd)
{
new = parent;
}
- else
+ else if (parent)
{
- new = efl_ui_focus_user_focus_manager_get(parent);
+ new = efl_ui_focus_object_focus_manager_get(parent);
provider = parent;
}
@@ -322,20 +424,20 @@ _focus_manager_eval(Eo *obj, Elm_Widget_Smart_Data *pd)
old = pd->manager.manager;
if (pd->manager.provider)
- efl_event_callback_del(pd->manager.provider, EFL_UI_FOCUS_USER_EVENT_MANAGER_CHANGED, _manager_changed_cb, obj);
+ efl_event_callback_del(pd->manager.provider, EFL_UI_FOCUS_OBJECT_EVENT_MANAGER_CHANGED, _manager_changed_cb, obj);
pd->manager.manager = new;
pd->manager.provider = provider;
if (pd->manager.provider)
- efl_event_callback_add(pd->manager.provider, EFL_UI_FOCUS_USER_EVENT_MANAGER_CHANGED, _manager_changed_cb, obj);
+ efl_event_callback_add(pd->manager.provider, EFL_UI_FOCUS_OBJECT_EVENT_MANAGER_CHANGED, _manager_changed_cb, obj);
}
return old;
}
EOLIAN static Eina_Bool
-_elm_widget_focus_state_apply(Eo *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Elm_Widget *redirect)
+_efl_ui_widget_focus_state_apply(Eo *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Efl_Ui_Widget *redirect)
{
Eina_Bool registered = EINA_TRUE;
@@ -358,10 +460,11 @@ _elm_widget_focus_state_apply(Eo *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED, Ef
if (!current_state.manager) registered = EINA_FALSE;
- if (//check if we have changed the manager
- (current_state.manager != configured_state->manager) ||
- //check if we are already registered but in a different state
- (current_state.logical != configured_state->logical))
+ if ((//check if we have changed the manager
+ (current_state.manager != configured_state->manager) ||
+ //check if we are already registered but in a different state
+ (current_state.logical != configured_state->logical))
+ && registered)
{
//we need to unregister here
efl_ui_focus_manager_calc_unregister(current_state.manager, obj);
@@ -397,6 +500,7 @@ _eval_registration_candidate(Eo *obj, Elm_Widget_Smart_Data *pd, Eina_Bool *shou
(!pd->parent_obj) ||
(_tree_unfocusable(obj)) ||
(_tree_disabled(obj)) ||
+ (_tree_custom_chain_missing(obj)) ||
(!evas_object_visible_get(obj)))
return;
@@ -451,7 +555,7 @@ _focus_state_eval(Eo *obj, Elm_Widget_Smart_Data *pd, Eina_Bool should, Eina_Boo
static Efl_Ui_Focus_Object*
_logical_parent_eval(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd, Eina_Bool should)
{
- Elm_Widget *parent;
+ Efl_Ui_Widget *parent;
Efl_Ui_Focus_Parent_Provider *provider;
if (should)
@@ -471,7 +575,7 @@ _logical_parent_eval(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd, Eina_Bool s
//update old logical parent;
if (pd->logical.parent)
{
- if (efl_isa(pd->logical.parent, ELM_WIDGET_CLASS))
+ if (efl_isa(pd->logical.parent, EFL_UI_WIDGET_CLASS))
{
ELM_WIDGET_DATA_GET(pd->logical.parent, logical_wd);
if (!logical_wd)
@@ -487,7 +591,7 @@ _logical_parent_eval(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd, Eina_Bool s
}
if (parent)
{
- if (efl_isa(parent, ELM_WIDGET_CLASS))
+ if (efl_isa(parent, EFL_UI_WIDGET_CLASS))
{
ELM_WIDGET_DATA_GET(parent, parent_wd);
if (!parent_wd)
@@ -517,14 +621,14 @@ _full_eval(Eo *obj, Elm_Widget_Smart_Data *pd)
old_parent = _logical_parent_eval(obj, pd, should);
- if (efl_isa(old_parent, ELM_WIDGET_CLASS))
+ if (efl_isa(old_parent, EFL_UI_WIDGET_CLASS))
{
//emit signal and focus eval old and new
ELM_WIDGET_DATA_GET(old_parent, old_pd);
_full_eval(old_parent, old_pd);
}
- if (efl_isa(pd->logical.parent, ELM_WIDGET_CLASS))
+ if (efl_isa(pd->logical.parent, EFL_UI_WIDGET_CLASS))
{
ELM_WIDGET_DATA_GET(pd->logical.parent, new_pd);
_full_eval(pd->logical.parent, new_pd);
@@ -540,13 +644,13 @@ _full_eval(Eo *obj, Elm_Widget_Smart_Data *pd)
if (old_registered_parent != pd->focus.parent)
{
efl_event_callback_call(obj,
- EFL_UI_FOCUS_USER_EVENT_LOGICAL_CHANGED, old_registered_parent);
+ EFL_UI_FOCUS_OBJECT_EVENT_LOGICAL_CHANGED, old_registered_parent);
}
if (old_registered_manager != pd->focus.manager)
{
efl_event_callback_call(obj,
- EFL_UI_FOCUS_USER_EVENT_MANAGER_CHANGED, old_registered_manager);
+ EFL_UI_FOCUS_OBJECT_EVENT_MANAGER_CHANGED, old_registered_manager);
}
}
@@ -702,7 +806,7 @@ _obj_mouse_in(void *data,
}
EOLIAN static void
-_elm_widget_efl_canvas_group_group_add(Eo *obj, Elm_Widget_Smart_Data *priv)
+_efl_ui_widget_efl_canvas_group_group_add(Eo *obj, Elm_Widget_Smart_Data *priv)
{
priv->obj = obj;
@@ -725,7 +829,7 @@ _elm_widget_efl_canvas_group_group_add(Eo *obj, Elm_Widget_Smart_Data *priv)
}
EOLIAN static void
-_elm_widget_efl_canvas_group_group_del(Eo *obj, Elm_Widget_Smart_Data *sd)
+_efl_ui_widget_efl_canvas_group_group_del(Eo *obj, Elm_Widget_Smart_Data *sd)
{
Evas_Object *sobj;
Elm_Translate_String_Data *ts;
@@ -749,6 +853,7 @@ _elm_widget_efl_canvas_group_group_del(Eo *obj, Elm_Widget_Smart_Data *sd)
sd->subobjs = eina_list_remove_list
(sd->subobjs, sd->subobjs);
}
+ // FIXME: is that a legacy or a new object ?
evas_object_del(sobj);
}
sd->tooltips = eina_list_free(sd->tooltips); /* should be empty anyway */
@@ -801,7 +906,7 @@ _smart_reconfigure(Elm_Widget_Smart_Data *sd)
}
EOLIAN static void
-_elm_widget_efl_gfx_position_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd, Eina_Position2D pos)
+_efl_ui_widget_efl_gfx_entity_position_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd, Eina_Position2D pos)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
@@ -810,11 +915,11 @@ _elm_widget_efl_gfx_position_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd,
sd->y = pos.y;
_smart_reconfigure(sd);
- efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
}
EOLIAN static void
-_elm_widget_efl_gfx_size_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd, Eina_Size2D sz)
+_efl_ui_widget_efl_gfx_entity_size_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd, Eina_Size2D sz)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
@@ -823,11 +928,11 @@ _elm_widget_efl_gfx_size_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd, Ein
sd->h = sz.h;
_smart_reconfigure(sd);
- efl_gfx_size_set(efl_super(obj, MY_CLASS), sz);
+ efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
}
-static void
-_full_eval_children(Eo *obj, Elm_Widget_Smart_Data *sd)
+void
+_elm_widget_full_eval_children(Eo *obj, Elm_Widget_Smart_Data *sd)
{
Eina_List *l;
Eo *child;
@@ -838,35 +943,35 @@ _full_eval_children(Eo *obj, Elm_Widget_Smart_Data *sd)
{
Elm_Widget_Smart_Data *sd_child;
- if (!efl_isa(child, ELM_WIDGET_CLASS)) continue;
+ if (!efl_isa(child, EFL_UI_WIDGET_CLASS)) continue;
- sd_child = efl_data_scope_get(child, ELM_WIDGET_CLASS);
- _full_eval_children(child, sd_child);
+ sd_child = efl_data_scope_get(child, EFL_UI_WIDGET_CLASS);
+ _elm_widget_full_eval_children(child, sd_child);
}
}
EOLIAN static void
-_elm_widget_efl_gfx_visible_set(Eo *obj, Elm_Widget_Smart_Data *pd, Eina_Bool vis)
+_efl_ui_widget_efl_gfx_entity_visible_set(Eo *obj, Elm_Widget_Smart_Data *pd, Eina_Bool vis)
{
Eina_Iterator *it;
Evas_Object *o;
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 0, vis))
{
- _full_eval_children(obj, pd);
+ _elm_widget_full_eval_children(obj, pd);
return;
}
- efl_gfx_visible_set(efl_super(obj, MY_CLASS), vis);
+ efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), vis);
- _full_eval_children(obj, pd);
+ _elm_widget_full_eval_children(obj, pd);
it = evas_object_smart_iterator_new(obj);
EINA_ITERATOR_FOREACH(it, o)
{
if (evas_object_data_get(o, "_elm_leaveme")) continue;
- efl_gfx_visible_set(o, vis);
+ efl_gfx_entity_visible_set(o, vis);
}
eina_iterator_free(it);
@@ -886,7 +991,7 @@ _elm_widget_efl_gfx_visible_set(Eo *obj, Elm_Widget_Smart_Data *pd, Eina_Bool vi
}
EOLIAN static void
-_elm_widget_efl_gfx_color_color_set(Eo *obj, Elm_Widget_Smart_Data *pd, int r, int g, int b, int a)
+_efl_ui_widget_efl_gfx_color_color_set(Eo *obj, Elm_Widget_Smart_Data *pd, int r, int g, int b, int a)
{
Eina_Iterator *it;
Evas_Object *o;
@@ -894,6 +999,8 @@ _elm_widget_efl_gfx_color_color_set(Eo *obj, Elm_Widget_Smart_Data *pd, int r, i
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_COLOR_SET, 0, r, g, b, a))
return;
+ efl_gfx_color_set(efl_super(obj, MY_CLASS), r, g, b, a);
+
it = evas_object_smart_iterator_new(obj);
EINA_ITERATOR_FOREACH(it, o)
{
@@ -905,7 +1012,7 @@ _elm_widget_efl_gfx_color_color_set(Eo *obj, Elm_Widget_Smart_Data *pd, int r, i
}
EOLIAN static void
-_elm_widget_efl_canvas_object_no_render_set(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Eina_Bool hide)
+_efl_ui_widget_efl_canvas_object_no_render_set(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Eina_Bool hide)
{
Eina_Iterator *it;
Evas_Object *o;
@@ -927,7 +1034,7 @@ _elm_widget_efl_canvas_object_no_render_set(Eo *obj, Elm_Widget_Smart_Data *_pd
}
EOLIAN static void
-_elm_widget_efl_canvas_object_is_frame_object_set(Eo *obj, Elm_Widget_Smart_Data *pd, Eina_Bool frame)
+_efl_ui_widget_efl_canvas_object_is_frame_object_set(Eo *obj, Elm_Widget_Smart_Data *pd, Eina_Bool frame)
{
Evas_Object *o;
Eina_List *li;
@@ -942,7 +1049,7 @@ _elm_widget_efl_canvas_object_is_frame_object_set(Eo *obj, Elm_Widget_Smart_Data
}
EOLIAN static void
-_elm_widget_efl_canvas_object_clip_set(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Evas_Object *clip)
+_efl_ui_widget_efl_canvas_object_clip_set(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Evas_Object *clip)
{
Eina_Iterator *it;
Evas_Object *o;
@@ -962,13 +1069,13 @@ _elm_widget_efl_canvas_object_clip_set(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_
}
EOLIAN static void
-_elm_widget_efl_canvas_group_group_calculate(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd EINA_UNUSED)
+_efl_ui_widget_efl_canvas_group_group_calculate(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd EINA_UNUSED)
{
/* a NO-OP, on the base */
}
EOLIAN static void
-_elm_widget_efl_canvas_group_group_member_add(Eo *obj, Elm_Widget_Smart_Data *pd, Evas_Object *child)
+_efl_ui_widget_efl_canvas_group_group_member_add(Eo *obj, Elm_Widget_Smart_Data *pd, Evas_Object *child)
{
int r, g, b, a;
efl_canvas_group_member_add(efl_super(obj, MY_CLASS), child);
@@ -991,7 +1098,7 @@ _elm_widget_efl_canvas_group_group_member_add(Eo *obj, Elm_Widget_Smart_Data *pd
}
EOLIAN static void
-_elm_widget_efl_canvas_group_group_member_del(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Evas_Object *child)
+_efl_ui_widget_efl_canvas_group_group_member_del(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Evas_Object *child)
{
if (!evas_object_data_get(child, "_elm_leaveme"))
evas_object_clip_unset(child);
@@ -1142,7 +1249,7 @@ elm_widget_focus_region_show(Eo *obj)
}
EOLIAN static void
-_elm_widget_widget_parent_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Evas_Object *parent EINA_UNUSED)
+_efl_ui_widget_widget_parent_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Evas_Object *parent EINA_UNUSED)
{
}
@@ -1179,7 +1286,7 @@ elm_widget_access(Evas_Object *obj,
}
EOLIAN static void
-_elm_widget_on_access_update(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Eina_Bool is_access EINA_UNUSED)
+_efl_ui_widget_on_access_update(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Eina_Bool is_access EINA_UNUSED)
{
}
@@ -1256,7 +1363,7 @@ elm_widget_theme_specific(Evas_Object *obj,
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_widget_theme_apply(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED)
+_efl_ui_widget_theme_apply(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED)
{
_elm_widget_mirrored_reload(obj);
if (elm_widget_disabled_get(obj))
@@ -1275,7 +1382,7 @@ _elm_widget_theme_apply(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED)
*
**/
EOLIAN static Eina_Bool
-_elm_widget_efl_ui_base_mirrored_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
+_efl_ui_widget_efl_ui_base_mirrored_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
{
return sd->is_mirrored;
}
@@ -1289,7 +1396,7 @@ _elm_widget_efl_ui_base_mirrored_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data
* @param mirrored EINA_TRUE to set mirrored mode. EINA_FALSE to unset.
*/
EOLIAN static void
-_elm_widget_efl_ui_base_mirrored_set(Eo *obj, Elm_Widget_Smart_Data *sd, Eina_Bool mirrored)
+_efl_ui_widget_efl_ui_base_mirrored_set(Eo *obj, Elm_Widget_Smart_Data *sd, Eina_Bool mirrored)
{
mirrored = !!mirrored;
@@ -1307,7 +1414,7 @@ _elm_widget_efl_ui_base_mirrored_set(Eo *obj, Elm_Widget_Smart_Data *sd, Eina_Bo
*
**/
EOLIAN static Eina_Bool
-_elm_widget_efl_ui_base_mirrored_automatic_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
+_efl_ui_widget_efl_ui_base_mirrored_automatic_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
{
return sd->mirrored_auto_mode;
}
@@ -1322,7 +1429,7 @@ _elm_widget_efl_ui_base_mirrored_automatic_get(Eo *obj EINA_UNUSED, Elm_Widget_S
* @param automatic EINA_TRUE for auto mirrored mode. EINA_FALSE for manual.
*/
EOLIAN static void
-_elm_widget_efl_ui_base_mirrored_automatic_set(Eo *obj, Elm_Widget_Smart_Data *sd, Eina_Bool automatic)
+_efl_ui_widget_efl_ui_base_mirrored_automatic_set(Eo *obj, Elm_Widget_Smart_Data *sd, Eina_Bool automatic)
{
if (sd->mirrored_auto_mode != automatic)
{
@@ -1336,7 +1443,7 @@ _elm_widget_efl_ui_base_mirrored_automatic_set(Eo *obj, Elm_Widget_Smart_Data *s
}
EOLIAN static void
-_elm_widget_on_show_region_hook_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd, void *data, Efl_Ui_Scrollable_On_Show_Region func, Eina_Free_Cb func_free_cb)
+_efl_ui_widget_on_show_region_hook_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd, void *data, Efl_Ui_Scrollable_On_Show_Region func, Eina_Free_Cb func_free_cb)
{
if ((sd->on_show_region_data == data) && (sd->on_show_region == func))
return;
@@ -1362,7 +1469,7 @@ elm_widget_sub_object_parent_add(Evas_Object *sobj)
Eo *parent = NULL;
parent = efl_parent_get(sobj);
- if (!efl_isa(parent, ELM_WIDGET_CLASS))
+ if (!efl_isa(parent, EFL_UI_WIDGET_CLASS))
{
ERR("You passed a wrong parent parameter (%p %s). "
"Elementary widget's parent should be an elementary widget.", parent, evas_object_type_get(parent));
@@ -1386,7 +1493,7 @@ elm_widget_sub_object_parent_add(Evas_Object *sobj)
* @see elm_widget_sub_object_parent_add()
*/
EOLIAN static Eina_Bool
-_elm_widget_widget_sub_object_add(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Object *sobj)
+_efl_ui_widget_widget_sub_object_add(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Object *sobj)
{
Eina_Bool mirrored, pmirrored = efl_ui_mirrored_get(obj);
@@ -1476,10 +1583,10 @@ _elm_widget_widget_sub_object_add(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Objec
* need to reset sobj's scale to 5.
* Note that each widget's scale is 0 by default.
*/
- double scale, pscale = efl_gfx_scale_get(sobj);
+ double scale, pscale = efl_gfx_entity_scale_get(sobj);
Elm_Theme *th, *pth = elm_widget_theme_get(sobj);
- scale = efl_gfx_scale_get(sobj);
+ scale = efl_gfx_entity_scale_get(sobj);
th = elm_widget_theme_get(sobj);
mirrored = efl_ui_mirrored_get(sobj);
@@ -1495,8 +1602,8 @@ _elm_widget_widget_sub_object_add(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Objec
evas_object_size_hint_display_mode_get(obj));
if (_elm_config->atspi_mode && !sd->on_create)
{
- Efl_Access *aparent;
- aparent = efl_access_parent_get(sobj);
+ Efl_Access_Object *aparent;
+ aparent = efl_provider_find(efl_parent_get(sobj), EFL_ACCESS_OBJECT_MIXIN);
if (aparent)
efl_access_children_changed_added_signal_emit(aparent, sobj);
}
@@ -1507,7 +1614,7 @@ end:
}
EOLIAN static Eina_Bool
-_elm_widget_widget_sub_object_del(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Object *sobj)
+_efl_ui_widget_widget_sub_object_del(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Object *sobj)
{
Evas_Object *sobj_parent;
@@ -1573,8 +1680,8 @@ _elm_widget_widget_sub_object_del(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Objec
}
if (_elm_config->atspi_mode && !sd->on_destroy)
{
- Efl_Access *aparent;
- aparent = efl_access_parent_get(sobj);
+ Efl_Access_Object *aparent;
+ aparent = efl_provider_find(efl_parent_get(sobj), EFL_ACCESS_OBJECT_MIXIN);
if (aparent)
efl_access_children_changed_del_signal_emit(aparent, sobj);
}
@@ -1596,7 +1703,7 @@ _elm_widget_widget_sub_object_del(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Objec
/* protected function - for widget developers only */
EOLIAN static void
-_elm_widget_resize_object_set(Eo *obj, Elm_Widget_Smart_Data *sd, Eo *sobj)
+_efl_ui_widget_resize_object_set(Eo *obj, Elm_Widget_Smart_Data *sd, Eo *sobj)
{
Evas_Object *parent;
@@ -1666,7 +1773,7 @@ elm_widget_hover_object_set(Eo *obj, Evas_Object *sobj)
}
EOLIAN static void
-_elm_widget_focus_allow_set(Eo *obj, Elm_Widget_Smart_Data *sd, Eina_Bool can_focus)
+_efl_ui_widget_focus_allow_set(Eo *obj, Elm_Widget_Smart_Data *sd, Eina_Bool can_focus)
{
can_focus = !!can_focus;
@@ -1720,7 +1827,7 @@ _elm_widget_focus_allow_set(Eo *obj, Elm_Widget_Smart_Data *sd, Eina_Bool can_fo
}
EOLIAN static Eina_Bool
-_elm_widget_focus_allow_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
+_efl_ui_widget_focus_allow_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
{
return sd->can_focus;
}
@@ -1761,7 +1868,7 @@ elm_widget_tree_unfocusable_set(Eo *obj, Eina_Bool tree_unfocusable)
_elm_widget_focus_tree_unfocusable_handle(obj);
//focus state eval on all children
- _full_eval_children(obj, sd);
+ _elm_widget_full_eval_children(obj, sd);
}
/**
@@ -1907,15 +2014,16 @@ elm_widget_highlight_get(const Eo *obj)
}
EOLIAN static Evas_Object*
-_elm_widget_widget_top_get(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED)
+_efl_ui_widget_widget_top_get(const Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED)
{
- Elm_Widget *parent = elm_widget_parent_get(obj);
+ Efl_Ui_Widget *parent = elm_widget_parent_get(obj);
if (parent)
{
- if (!efl_isa(parent, ELM_WIDGET_CLASS)) return NULL;
+ if (!efl_isa(parent, EFL_UI_WIDGET_CLASS)) return NULL;
return efl_ui_widget_top_get(parent);
}
- return obj;
+ /* XXX const */
+ return (Evas_Object *)obj;
}
EAPI Eina_Bool
@@ -2360,7 +2468,7 @@ elm_widget_parent_highlight_set(Eo *obj, Eina_Bool highlighted)
}
EOLIAN static Evas_Object*
-_elm_widget_widget_parent_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
+_efl_ui_widget_widget_parent_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
{
return sd->parent_obj;
}
@@ -2389,7 +2497,7 @@ _elm_widget_top_win_focused_set(Evas_Object *obj,
sd->top_win_focused = top_win_focused;
if (sd->focused && !sd->top_win_focused)
- efl_ui_widget_on_focus_update(obj, NULL);
+ efl_ui_focus_object_on_focus_update(obj);
}
Eina_Bool
@@ -2427,7 +2535,7 @@ elm_widget_disabled_internal(Eo *obj, Eina_Bool disabled)
}
EOLIAN static void
-_elm_widget_disabled_set(Eo *obj, Elm_Widget_Smart_Data *sd, Eina_Bool disabled)
+_efl_ui_widget_disabled_set(Eo *obj, Elm_Widget_Smart_Data *sd, Eina_Bool disabled)
{
if (sd->disabled == disabled) return;
sd->disabled = !!disabled;
@@ -2435,18 +2543,22 @@ _elm_widget_disabled_set(Eo *obj, Elm_Widget_Smart_Data *sd, Eina_Bool disabled)
elm_widget_disabled_internal(obj, disabled);
if (efl_finalized_get(obj))
- _full_eval_children(obj, sd);
+ _elm_widget_full_eval_children(obj, sd);
}
EOLIAN static Eina_Bool
-_elm_widget_disabled_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
+_efl_ui_widget_disabled_get(const Eo *obj, Elm_Widget_Smart_Data *sd)
{
+ Eo *parent;
+
if (sd->disabled) return EINA_TRUE;
- return elm_widget_disabled_get(elm_widget_parent_get(obj));
+ if ((parent = elm_widget_parent_get(obj)) != NULL)
+ return elm_widget_disabled_get(parent);
+ return EINA_FALSE;
}
EOLIAN static void
-_elm_widget_show_region_set(Eo *obj, Elm_Widget_Smart_Data *sd, Eina_Rect sr, Eina_Bool forceshow)
+_efl_ui_widget_show_region_set(Eo *obj, Elm_Widget_Smart_Data *sd, Eina_Rect sr, Eina_Bool forceshow)
{
Evas_Object *parent_obj, *child_obj;
Evas_Coord px, py, cx, cy, nx = 0, ny = 0;
@@ -2490,7 +2602,7 @@ _elm_widget_show_region_set(Eo *obj, Elm_Widget_Smart_Data *sd, Eina_Rect sr, Ei
}
EOLIAN static Eina_Rect
-_elm_widget_show_region_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
+_efl_ui_widget_show_region_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
{
return (Eina_Rect) sd->show_region;
}
@@ -2514,21 +2626,26 @@ _elm_widget_show_region_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
* @ingroup Widget
*/
EOLIAN static Eina_Rect
-_elm_widget_interest_region_get(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED)
+_efl_ui_widget_interest_region_get(const Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED)
{
Eina_Rect r = {};
- r.size = efl_gfx_size_get(obj);
+ r.size = efl_gfx_entity_size_get(obj);
return r;
}
EOLIAN static void
-_elm_widget_scroll_hold_push(Eo *obj, Elm_Widget_Smart_Data *sd)
+_efl_ui_widget_scroll_hold_push(Eo *obj, Elm_Widget_Smart_Data *sd)
{
sd->scroll_hold++;
if (sd->scroll_hold == 1)
{
if (_elm_scrollable_is(obj))
- elm_interface_scrollable_hold_set(obj, EINA_TRUE);
+ {
+ if (elm_widget_is_legacy(obj))
+ elm_interface_scrollable_hold_set(obj, EINA_TRUE);
+ else
+ efl_ui_scrollable_scroll_hold_set(obj, EINA_TRUE);
+ }
else
{
Evas_Object *child;
@@ -2537,7 +2654,12 @@ _elm_widget_scroll_hold_push(Eo *obj, Elm_Widget_Smart_Data *sd)
EINA_LIST_FOREACH(sd->subobjs, l, child)
{
if (elm_widget_is(child) && _elm_scrollable_is(child))
- elm_interface_scrollable_hold_set(child, EINA_TRUE);
+ {
+ if (elm_widget_is_legacy(obj))
+ elm_interface_scrollable_hold_set(child, EINA_TRUE);
+ else
+ efl_ui_scrollable_scroll_hold_set(child, EINA_TRUE);
+ }
}
}
}
@@ -2546,13 +2668,18 @@ _elm_widget_scroll_hold_push(Eo *obj, Elm_Widget_Smart_Data *sd)
}
EOLIAN static void
-_elm_widget_scroll_hold_pop(Eo *obj, Elm_Widget_Smart_Data *sd)
+_efl_ui_widget_scroll_hold_pop(Eo *obj, Elm_Widget_Smart_Data *sd)
{
sd->scroll_hold--;
if (!sd->scroll_hold)
{
if (_elm_scrollable_is(obj))
- elm_interface_scrollable_hold_set(obj, EINA_FALSE);
+ {
+ if (elm_widget_is_legacy(obj))
+ elm_interface_scrollable_hold_set(obj, EINA_FALSE);
+ else
+ efl_ui_scrollable_scroll_hold_set(obj, EINA_FALSE);
+ }
else
{
Evas_Object *child;
@@ -2561,7 +2688,12 @@ _elm_widget_scroll_hold_pop(Eo *obj, Elm_Widget_Smart_Data *sd)
EINA_LIST_FOREACH(sd->subobjs, l, child)
{
if (elm_widget_is(child) && _elm_scrollable_is(child))
- elm_interface_scrollable_hold_set(child, EINA_FALSE);
+ {
+ if (elm_widget_is_legacy(obj))
+ elm_interface_scrollable_hold_set(child, EINA_FALSE);
+ else
+ efl_ui_scrollable_scroll_hold_set(child, EINA_FALSE);
+ }
}
}
}
@@ -2579,13 +2711,18 @@ elm_widget_scroll_hold_get(const Eo *obj)
}
EOLIAN static void
-_elm_widget_scroll_freeze_push(Eo *obj, Elm_Widget_Smart_Data *sd)
+_efl_ui_widget_scroll_freeze_push(Eo *obj, Elm_Widget_Smart_Data *sd)
{
sd->scroll_freeze++;
if (sd->scroll_freeze == 1)
{
if (_elm_scrollable_is(obj))
- elm_interface_scrollable_freeze_set(obj, EINA_TRUE);
+ {
+ if (elm_widget_is_legacy(obj))
+ elm_interface_scrollable_freeze_set(obj, EINA_TRUE);
+ else
+ efl_ui_scrollable_scroll_freeze_set(obj, EINA_TRUE);
+ }
else
{
Evas_Object *child;
@@ -2594,7 +2731,12 @@ _elm_widget_scroll_freeze_push(Eo *obj, Elm_Widget_Smart_Data *sd)
EINA_LIST_FOREACH(sd->subobjs, l, child)
{
if (elm_widget_is(child) && _elm_scrollable_is(child))
- elm_interface_scrollable_freeze_set(child, EINA_TRUE);
+ {
+ if (elm_widget_is_legacy(obj))
+ elm_interface_scrollable_freeze_set(child, EINA_TRUE);
+ else
+ efl_ui_scrollable_scroll_freeze_set(child, EINA_TRUE);
+ }
}
}
}
@@ -2603,13 +2745,18 @@ _elm_widget_scroll_freeze_push(Eo *obj, Elm_Widget_Smart_Data *sd)
}
EOLIAN static void
-_elm_widget_scroll_freeze_pop(Eo *obj, Elm_Widget_Smart_Data *sd)
+_efl_ui_widget_scroll_freeze_pop(Eo *obj, Elm_Widget_Smart_Data *sd)
{
sd->scroll_freeze--;
if (!sd->scroll_freeze)
{
if (_elm_scrollable_is(obj))
- elm_interface_scrollable_freeze_set(obj, EINA_FALSE);
+ {
+ if (elm_widget_is_legacy(obj))
+ elm_interface_scrollable_freeze_set(obj, EINA_FALSE);
+ else
+ efl_ui_scrollable_scroll_freeze_set(obj, EINA_FALSE);
+ }
else
{
Evas_Object *child;
@@ -2618,7 +2765,12 @@ _elm_widget_scroll_freeze_pop(Eo *obj, Elm_Widget_Smart_Data *sd)
EINA_LIST_FOREACH(sd->subobjs, l, child)
{
if (elm_widget_is(child) && _elm_scrollable_is(child))
- elm_interface_scrollable_freeze_set(child, EINA_FALSE);
+ {
+ if (elm_widget_is_legacy(obj))
+ elm_interface_scrollable_freeze_set(child, EINA_FALSE);
+ else
+ efl_ui_scrollable_scroll_freeze_set(child, EINA_FALSE);
+ }
}
}
}
@@ -2636,7 +2788,7 @@ elm_widget_scroll_freeze_get(const Eo *obj)
}
EOLIAN static void
-_elm_widget_efl_gfx_scale_set(Eo *obj, Elm_Widget_Smart_Data *sd, double scale)
+_efl_ui_widget_efl_gfx_entity_scale_set(Eo *obj, Elm_Widget_Smart_Data *sd, double scale)
{
if (scale < 0.0) scale = 0.0;
if (sd->scale != scale)
@@ -2647,14 +2799,14 @@ _elm_widget_efl_gfx_scale_set(Eo *obj, Elm_Widget_Smart_Data *sd, double scale)
}
EOLIAN static double
-_elm_widget_efl_gfx_scale_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
+_efl_ui_widget_efl_gfx_entity_scale_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
{
// FIXME: save walking up the tree by storing/caching parent scale
if (sd->scale == 0.0)
{
if (sd->parent_obj && elm_widget_is(sd->parent_obj))
{
- return efl_gfx_scale_get(sd->parent_obj);
+ return efl_gfx_entity_scale_get(sd->parent_obj);
}
else
{
@@ -2667,7 +2819,9 @@ _elm_widget_efl_gfx_scale_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
EAPI void
elm_widget_theme_set(Evas_Object *obj, Elm_Theme *th)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, sd);
+ Elm_Widget_Smart_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
+ if (!sd) return;
+
Eina_Bool apply = EINA_FALSE;
if (sd->theme != th)
{
@@ -2685,7 +2839,7 @@ elm_widget_part_text_set(Eo *obj, const char *part, const char *label)
/* legacy support: combobox was special (internal entry is text object). */
if (efl_isa(obj, ELM_COMBOBOX_CLASS))
_elm_combobox_part_text_set(obj, part, label);
- else if (efl_isa(obj, EFL_UI_LAYOUT_CLASS))
+ else if (efl_isa(obj, EFL_UI_LAYOUT_OBJECT_CLASS))
elm_layout_text_set(obj, part, label);
}
@@ -2695,7 +2849,7 @@ elm_widget_part_text_get(const Eo *obj, const char *part)
/* legacy support: combobox was special (internal entry is text object). */
if (efl_isa(obj, ELM_COMBOBOX_CLASS))
return _elm_combobox_part_text_get(obj, part);
- else if (efl_isa(obj, EFL_UI_LAYOUT_CLASS))
+ else if (efl_isa(obj, EFL_UI_LAYOUT_OBJECT_CLASS))
return elm_layout_text_get(obj, part);
return NULL;
@@ -2841,7 +2995,7 @@ elm_widget_part_translatable_text_get(const Eo *obj, const char *part, const cha
}
EOLIAN static void
-_elm_widget_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
+_efl_ui_widget_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
{
const Eina_List *l;
Evas_Object *child;
@@ -2869,13 +3023,13 @@ _elm_widget_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Widg
}
EOLIAN static void
-_elm_widget_access_info_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd, const char *txt)
+_efl_ui_widget_access_info_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd, const char *txt)
{
eina_stringshare_replace(&sd->access_info, txt);
}
EOLIAN static const char*
-_elm_widget_access_info_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
+_efl_ui_widget_access_info_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
{
return sd->access_info;
}
@@ -2883,7 +3037,8 @@ _elm_widget_access_info_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
EAPI Elm_Theme *
elm_widget_theme_get(const Evas_Object *obj)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, sd, NULL);
+ Elm_Widget_Smart_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
+ if (!sd) return NULL;
if (!sd->theme)
{
@@ -2895,7 +3050,7 @@ elm_widget_theme_get(const Evas_Object *obj)
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_widget_style_set(Eo *obj, Elm_Widget_Smart_Data *sd, const char *style)
+_efl_ui_widget_style_set(Eo *obj, Elm_Widget_Smart_Data *sd, const char *style)
{
if (!elm_widget_is_legacy(obj) && efl_finalized_get(obj))
{
@@ -2910,7 +3065,7 @@ _elm_widget_style_set(Eo *obj, Elm_Widget_Smart_Data *sd, const char *style)
}
EOLIAN static const char*
-_elm_widget_style_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
+_efl_ui_widget_style_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
{
const char *ret;
ret = "default";
@@ -3008,7 +3163,8 @@ elm_widget_scroll_child_locked_y_get(const Eo *obj)
EAPI Efl_Ui_Theme_Apply
elm_widget_theme_object_set(Evas_Object *obj, Evas_Object *edj, const char *wname, const char *welement, const char *wstyle)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, sd, EFL_UI_THEME_APPLY_FAILED);
+ Elm_Widget_Smart_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
+ if (!sd) return EFL_UI_THEME_APPLY_FAILED;
if (eina_streq(welement, "base"))
welement = NULL;
@@ -3023,8 +3179,17 @@ elm_widget_theme_object_set(Evas_Object *obj, Evas_Object *edj, const char *wnam
if (sd->orient_mode != -1)
{
char buf[128];
- snprintf(buf, sizeof(buf), "elm,state,orient,%d", sd->orient_mode);
- elm_widget_signal_emit(obj, buf, "elm");
+
+ if (elm_widget_is_legacy(obj))
+ {
+ snprintf(buf, sizeof(buf), "elm,state,orient,%d", sd->orient_mode);
+ elm_widget_signal_emit(obj, buf, "elm");
+ }
+ else
+ {
+ snprintf(buf, sizeof(buf), "efl,state,orient,%d", sd->orient_mode);
+ elm_widget_signal_emit(obj, buf, "efl");
+ }
}
return ret;
@@ -3050,7 +3215,7 @@ _convert(Efl_Dbg_Info *info, Eina_Iterator *ptr_list)
}
EOLIAN static void
-_elm_widget_efl_object_dbg_info_get(Eo *eo_obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Efl_Dbg_Info *root)
+_efl_ui_widget_efl_object_dbg_info_get(Eo *eo_obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Efl_Dbg_Info *root)
{
efl_dbg_info_get(efl_super(eo_obj, MY_CLASS), root);
Efl_Ui_Focus_Relations *rel = NULL;
@@ -3135,12 +3300,30 @@ elm_widget_is_check(const Evas_Object *obj)
return EINA_FALSE;
}
+/* If you changed a legacy widget's class name,
+ * please update the "legacy_type_table". */
EAPI const char *
elm_widget_type_get(const Evas_Object *obj)
{
+ const char *ret;
+ int i;
+
API_ENTRY return NULL;
- return efl_class_name_get(efl_class_get(obj));
+ ret = efl_class_name_get(efl_class_get(obj));
+
+ /* If the given widget is created for legacy,
+ * convert type name to legacy. */
+ if (elm_widget_is_legacy(obj))
+ {
+ for (i = 0; legacy_type_table[i][0] ; i++)
+ {
+ if (eina_streq(ret, legacy_type_table[i][0]))
+ return legacy_type_table[i][1];
+ }
+ }
+
+ return ret;
}
EAPI Eina_Bool
@@ -3321,7 +3504,7 @@ elm_widget_focus_highlight_focus_part_geometry_get(const Evas_Object *obj,
if (!(target_hl_part = edje_object_data_get(edje_obj, "focus_part")))
return;
}
- else if (obj && efl_isa(obj, EFL_UI_LAYOUT_CLASS))
+ else if (obj && efl_isa(obj, EFL_UI_LAYOUT_OBJECT_CLASS))
{
edje_obj = elm_layout_edje_get(obj);
if (!(target_hl_part = elm_layout_data_get(obj, "focus_part")))
@@ -3339,7 +3522,7 @@ elm_widget_focus_highlight_focus_part_geometry_get(const Evas_Object *obj,
}
EOLIAN static Eina_Rect
-_elm_widget_focus_highlight_geometry_get(Eo *obj, Elm_Widget_Smart_Data *sd)
+_efl_ui_widget_focus_highlight_geometry_get(const Eo *obj, Elm_Widget_Smart_Data *sd)
{
Evas_Coord ox = 0, oy = 0, ow = 0, oh = 0;
Evas_Object *scroller = (Evas_Object *)obj;
@@ -3375,19 +3558,19 @@ _elm_widget_focus_highlight_geometry_get(Eo *obj, Elm_Widget_Smart_Data *sd)
}
EOLIAN static Elm_Object_Item*
-_elm_widget_focused_item_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd EINA_UNUSED)
+_efl_ui_widget_focused_item_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd EINA_UNUSED)
{
return NULL;
}
EOLIAN static void
-_elm_widget_interest_region_mode_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd, Elm_Focus_Region_Show_Mode mode)
+_efl_ui_widget_interest_region_mode_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd, Elm_Focus_Region_Show_Mode mode)
{
_pd->focus_region_show_mode = mode;
}
EOLIAN static Elm_Focus_Region_Show_Mode
-_elm_widget_interest_region_mode_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd)
+_efl_ui_widget_interest_region_mode_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd)
{
return _pd->focus_region_show_mode;
}
@@ -3451,30 +3634,30 @@ elm_widget_display_mode_set(Evas_Object *obj, Evas_Display_Mode dispmode)
}
EOLIAN static void
-_elm_widget_orientation_mode_disabled_set(Eo *obj, Elm_Widget_Smart_Data *sd, Eina_Bool disabled)
+_efl_ui_widget_orientation_mode_set(Eo *obj, Elm_Widget_Smart_Data *sd, Efl_Ui_Widget_Orientation_Mode mode)
{
- int orient_mode = -1;
+ int rotation = -1;
- if (!disabled)
+ if (mode != EFL_UI_WIDGET_ORIENTATION_MODE_DISABLED)
{
//Get current orient mode from it's parent otherwise, 0.
sd->orient_mode = 0;
ELM_WIDGET_DATA_GET(sd->parent_obj, sd_parent);
- if (!sd_parent) orient_mode = 0;
- else orient_mode = sd_parent->orient_mode;
+ if (!sd_parent) rotation = 0;
+ else rotation = sd_parent->orient_mode;
}
- efl_ui_widget_on_orientation_update(obj, orient_mode);
+ efl_ui_widget_on_orientation_update(obj, rotation);
}
-EOLIAN static Eina_Bool
-_elm_widget_orientation_mode_disabled_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
+EOLIAN static Efl_Ui_Widget_Orientation_Mode
+_efl_ui_widget_orientation_mode_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
{
- if (sd->orient_mode == -1) return EINA_TRUE;
- else return EINA_FALSE;
+ if (sd->orient_mode == -1) return EFL_UI_WIDGET_ORIENTATION_MODE_DISABLED;
+ else return EFL_UI_WIDGET_ORIENTATION_MODE_DEFAULT;
}
EOLIAN static void
-_elm_widget_on_orientation_update(Eo *obj, Elm_Widget_Smart_Data *sd, int orient_mode)
+_efl_ui_widget_on_orientation_update(Eo *obj, Elm_Widget_Smart_Data *sd, int orient_mode)
{
Evas_Object *child;
Eina_List *l;
@@ -3490,8 +3673,17 @@ _elm_widget_on_orientation_update(Eo *obj, Elm_Widget_Smart_Data *sd, int orient
if (orient_mode != -1)
{
char buf[128];
- snprintf(buf, sizeof(buf), "elm,state,orient,%d", orient_mode);
- elm_widget_signal_emit(obj, buf, "elm");
+
+ if (elm_widget_is_legacy(obj))
+ {
+ snprintf(buf, sizeof(buf), "elm,state,orient,%d", orient_mode);
+ elm_widget_signal_emit(obj, buf, "elm");
+ }
+ else
+ {
+ snprintf(buf, sizeof(buf), "efl,state,orient,%d", orient_mode);
+ elm_widget_signal_emit(obj, buf, "efl");
+ }
}
}
@@ -3505,7 +3697,7 @@ _elm_widget_on_orientation_update(Eo *obj, Elm_Widget_Smart_Data *sd, int orient
*
**/
EOLIAN static Elm_Focus_Move_Policy
-_elm_widget_focus_move_policy_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
+_efl_ui_widget_focus_move_policy_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
{
return sd->focus_move_policy;
}
@@ -3520,7 +3712,7 @@ _elm_widget_focus_move_policy_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd
*/
EOLIAN static void
-_elm_widget_focus_move_policy_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd, Elm_Focus_Move_Policy policy)
+_efl_ui_widget_focus_move_policy_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd, Elm_Focus_Move_Policy policy)
{
if (sd->focus_move_policy == policy) return;
sd->focus_move_policy = policy;
@@ -3534,7 +3726,7 @@ _elm_widget_focus_move_policy_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd
*
**/
EOLIAN static Eina_Bool
-_elm_widget_focus_move_policy_automatic_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
+_efl_ui_widget_focus_move_policy_automatic_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
{
return sd->focus_move_policy_auto_mode;
}
@@ -3549,7 +3741,7 @@ _elm_widget_focus_move_policy_automatic_get(Eo *obj EINA_UNUSED, Elm_Widget_Smar
* @param automatic EINA_TRUE for auto focus_move_policy mode. EINA_FALSE for manual.
*/
EOLIAN static void
-_elm_widget_focus_move_policy_automatic_set(Eo *obj, Elm_Widget_Smart_Data *sd, Eina_Bool automatic)
+_efl_ui_widget_focus_move_policy_automatic_set(Eo *obj, Elm_Widget_Smart_Data *sd, Eina_Bool automatic)
{
if (sd->focus_move_policy_auto_mode != automatic)
{
@@ -3573,7 +3765,9 @@ _elm_widget_focus_move_policy_automatic_set(Eo *obj, Elm_Widget_Smart_Data *sd,
EAPI Eina_Bool
elm_widget_theme_klass_set(Evas_Object *obj, const char *name)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, pd, EINA_FALSE);
+ Elm_Widget_Smart_Data *pd = efl_data_scope_safe_get(obj, MY_CLASS);
+ if (!pd) return EINA_FALSE;
+
return eina_stringshare_replace(&(pd->klass), name);
}
@@ -3587,7 +3781,9 @@ elm_widget_theme_klass_set(Evas_Object *obj, const char *name)
EAPI const char *
elm_widget_theme_klass_get(const Evas_Object *obj)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, pd, NULL);
+ Elm_Widget_Smart_Data *pd = efl_data_scope_safe_get(obj, MY_CLASS);
+ if (!pd) return NULL;
+
return (const char *)pd->klass;
}
@@ -3603,7 +3799,9 @@ elm_widget_theme_klass_get(const Evas_Object *obj)
EAPI Eina_Bool
elm_widget_theme_element_set(Evas_Object *obj, const char *name)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, pd, EINA_FALSE);
+ Elm_Widget_Smart_Data *pd = efl_data_scope_safe_get(obj, MY_CLASS);
+ if (!pd) return EINA_FALSE;
+
if (eina_streq(name, "base"))
name = NULL;
@@ -3620,7 +3818,9 @@ elm_widget_theme_element_set(Evas_Object *obj, const char *name)
EAPI const char *
elm_widget_theme_element_get(const Evas_Object *obj)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, pd, NULL);
+ Elm_Widget_Smart_Data *pd = efl_data_scope_safe_get(obj, MY_CLASS);
+ if (!pd) return NULL;
+
return (const char *)pd->group;
}
@@ -3636,7 +3836,9 @@ elm_widget_theme_element_get(const Evas_Object *obj)
EAPI Eina_Bool
elm_widget_theme_style_set(Evas_Object *obj, const char *name)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, pd, EINA_FALSE);
+ Elm_Widget_Smart_Data *pd = efl_data_scope_safe_get(obj, MY_CLASS);
+ if (!pd) return EINA_FALSE;
+
if (eina_streq(name, "default"))
name = NULL;
@@ -3653,7 +3855,9 @@ elm_widget_theme_style_set(Evas_Object *obj, const char *name)
EAPI const char *
elm_widget_theme_style_get(const Evas_Object *obj)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, pd, NULL);
+ Elm_Widget_Smart_Data *pd = efl_data_scope_safe_get(obj, MY_CLASS);
+ if (!pd) return NULL;
+
return (const char *)pd->style;
}
@@ -3679,7 +3883,7 @@ elm_widget_element_update(Evas_Object *obj, Evas_Object *component, const char *
group = eina_stringshare_add(name);
else
group = eina_stringshare_printf("%s/%s", elm_widget_theme_element_get(obj), name);
- if (efl_isa(component, ELM_WIDGET_CLASS))
+ if (efl_isa(component, EFL_UI_WIDGET_CLASS))
{
changed |= elm_widget_theme_klass_set(component, elm_widget_theme_klass_get(obj));
changed |= elm_widget_theme_element_set(component, (const char *)group);
@@ -3727,10 +3931,10 @@ static void
_track_obj_view_del(void *data, const Efl_Event *event);
EFL_CALLBACKS_ARRAY_DEFINE(tracker_callbacks,
- { EFL_GFX_EVENT_RESIZE, _track_obj_view_update },
- { EFL_GFX_EVENT_MOVE, _track_obj_view_update },
- { EFL_GFX_EVENT_SHOW, _track_obj_view_update },
- { EFL_GFX_EVENT_HIDE, _track_obj_view_update },
+ { EFL_GFX_ENTITY_EVENT_RESIZE, _track_obj_view_update },
+ { EFL_GFX_ENTITY_EVENT_MOVE, _track_obj_view_update },
+ { EFL_GFX_ENTITY_EVENT_SHOW, _track_obj_view_update },
+ { EFL_GFX_ENTITY_EVENT_HIDE, _track_obj_view_update },
{ EFL_EVENT_DEL, _track_obj_view_del });
static void
@@ -3852,8 +4056,7 @@ _elm_widget_item_efl_object_destructor(Eo *eo_item, Elm_Widget_Item_Data *item)
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
- evas_object_del(item->view);
-
+ eina_stringshare_del(item->style);
eina_stringshare_del(item->access_info);
eina_stringshare_del(item->accessible_name);
@@ -3873,7 +4076,7 @@ _elm_widget_item_efl_object_destructor(Eo *eo_item, Elm_Widget_Item_Data *item)
}
eina_hash_free(item->labels);
- efl_access_attributes_clear(eo_item);
+ efl_access_object_attributes_clear(eo_item);
efl_access_removed(eo_item);
EINA_MAGIC_SET(item, EINA_MAGIC_NONE);
@@ -3905,24 +4108,25 @@ _elm_widget_item_efl_object_destructor(Eo *eo_item, Elm_Widget_Item_Data *item)
* @ingroup Widget
*/
EOLIAN static void
-_elm_widget_item_del(Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data *item)
+_elm_widget_item_efl_object_invalidate(Eo *eo_item, Elm_Widget_Item_Data *item)
{
- ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
- ELM_WIDGET_ITEM_RETURN_IF_ONDEL(item);
- item->on_deletion = EINA_TRUE;
+ Evas_Object *view;
//Widget item delete callback
- Eina_Bool del_ok;
- del_ok = elm_wdg_item_del_pre(item->eo_obj);
- if (del_ok)
- efl_del(item->eo_obj);
- return;
+ elm_wdg_item_del_pre(item->eo_obj);
+
+ view = item->view;
+ if (item->view) efl_wref_del(item->view, &item->view);
+ // FIXME: Is view an Efl.Ui or a legacy object ?
+ evas_object_del(view);
+ item->view = NULL;
+
+ efl_invalidate(efl_super(eo_item, ELM_WIDGET_ITEM_CLASS));
}
-EOLIAN static Eina_Bool
+EOLIAN static void
_elm_widget_item_del_pre(Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data *item EINA_UNUSED)
{
- return EINA_TRUE;
}
/**
@@ -3999,9 +4203,9 @@ _elm_widget_item_widget_get(const Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data
}
EAPI Eina_Bool
-_elm_widget_onscreen_is(Evas_Object *widget)
+_elm_widget_onscreen_is(const Evas_Object *widget)
{
- Evas_Object *parent = widget;
+ Evas_Object *parent = (Evas_Object *)widget;
Eina_Rectangle r1, r2;
Evas *evas = evas_object_evas_get(widget);
@@ -4037,7 +4241,7 @@ _elm_widget_onscreen_is(Evas_Object *widget)
}
EAPI Eina_Bool
-_elm_widget_item_onscreen_is(Elm_Object_Item *item)
+_elm_widget_item_onscreen_is(const Elm_Object_Item *item)
{
Eina_Rectangle r1, r2;
Elm_Widget_Item_Data *id = efl_data_scope_get(item, ELM_WIDGET_ITEM_CLASS);
@@ -4061,7 +4265,7 @@ _elm_widget_item_onscreen_is(Elm_Object_Item *item)
}
const char*
-_elm_widget_accessible_plain_name_get(Evas_Object *obj, const char* name)
+_elm_widget_accessible_plain_name_get(const Evas_Object *obj, const char* name)
{
char *accessible_plain_name;
@@ -4075,7 +4279,7 @@ _elm_widget_accessible_plain_name_get(Evas_Object *obj, const char* name)
}
const char*
-_elm_widget_item_accessible_plain_name_get(Elm_Object_Item *item, const char* name)
+_elm_widget_item_accessible_plain_name_get(const Elm_Object_Item *item, const char* name)
{
char *accessible_plain_name;
@@ -4090,8 +4294,8 @@ _elm_widget_item_accessible_plain_name_get(Elm_Object_Item *item, const char* na
}
EOLIAN static Efl_Access_State_Set
-_elm_widget_item_efl_access_state_set_get(Eo *eo_item,
- Elm_Widget_Item_Data *item EINA_UNUSED)
+_elm_widget_item_efl_access_object_state_set_get(const Eo *eo_item,
+ Elm_Widget_Item_Data *item EINA_UNUSED)
{
Efl_Access_State_Set states = 0;
@@ -4137,23 +4341,22 @@ _elm_widget_item_disabled_set(Eo *eo_item EINA_UNUSED,
}
EOLIAN static Eina_Bool
-_elm_widget_item_disabled_get(Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data *item)
+_elm_widget_item_disabled_get(const Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data *item)
{
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, EINA_FALSE);
return item->disabled;
}
EOLIAN static void
-_elm_widget_item_style_set(Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data *item, const char *style EINA_UNUSED)
+_elm_widget_item_style_set(Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data *item, const char *style)
{
- ERR_NOT_SUPPORTED(item, "elm_object_style_set()");
+ eina_stringshare_replace(&item->style, style);
}
EOLIAN static const char *
-_elm_widget_item_style_get(Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data *item)
+_elm_widget_item_style_get(const Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data *item)
{
- ERR_NOT_SUPPORTED(item, "elm_object_style_get()");
- return NULL;
+ return item->style;
}
EOLIAN static void
@@ -4162,13 +4365,13 @@ _elm_widget_item_disable(Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data *item EIN
}
EOLIAN static void
-_elm_widget_item_focus_set(Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data *item, Eina_Bool focused EINA_UNUSED)
+_elm_widget_item_item_focus_set(Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data *item, Eina_Bool focused EINA_UNUSED)
{
ERR_NOT_SUPPORTED(item, "elm_object_item_focus_set");
}
EOLIAN static Eina_Bool
-_elm_widget_item_focus_get(Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data *item)
+_elm_widget_item_item_focus_get(const Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data *item)
{
ERR_NOT_SUPPORTED(item, "elm_object_item_focus_get");
return EINA_FALSE;
@@ -4552,7 +4755,7 @@ _elm_widget_item_tooltip_window_mode_set(Eo *eo_item EINA_UNUSED,
}
EOLIAN static Eina_Bool
-_elm_widget_item_tooltip_window_mode_get(Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data *item)
+_elm_widget_item_tooltip_window_mode_get(const Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data *item)
{
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, EINA_FALSE);
ELM_WIDGET_ITEM_RETURN_IF_ONDEL(item, EINA_FALSE);
@@ -4572,7 +4775,7 @@ _elm_widget_item_tooltip_window_mode_get(Eo *eo_item EINA_UNUSED, Elm_Widget_Ite
* @ingroup Widget
*/
EOLIAN static const char *
-_elm_widget_item_tooltip_style_get(Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data *item)
+_elm_widget_item_tooltip_style_get(const Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data *item)
{
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, NULL);
@@ -4591,10 +4794,10 @@ _elm_widget_item_cursor_set(Eo *eo_item EINA_UNUSED,
}
EOLIAN static const char *
-_elm_widget_item_cursor_get(Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data *item)
+_elm_widget_item_cursor_get(const Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data *item)
{
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, NULL);
- return elm_object_cursor_get(item->view);
+ return elm_object_sub_cursor_get(item->view);
}
EOLIAN static void
@@ -4627,7 +4830,7 @@ _elm_widget_item_cursor_style_set(Eo *eo_item EINA_UNUSED,
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
ELM_WIDGET_ITEM_RETURN_IF_ONDEL(item);
- elm_object_cursor_style_set(item->view, style);
+ elm_object_sub_cursor_style_set(item->view, style);
}
/**
@@ -4642,11 +4845,11 @@ _elm_widget_item_cursor_style_set(Eo *eo_item EINA_UNUSED,
* @ingroup Widget
*/
EOLIAN static const char *
-_elm_widget_item_cursor_style_get(Eo *eo_item EINA_UNUSED,
+_elm_widget_item_cursor_style_get(const Eo *eo_item EINA_UNUSED,
Elm_Widget_Item_Data *item)
{
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, NULL);
- return elm_object_cursor_style_get(item->view);
+ return elm_object_sub_cursor_style_get(item->view);
}
/**
@@ -4673,7 +4876,7 @@ _elm_widget_item_cursor_engine_only_set(Eo *eo_item EINA_UNUSED,
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
ELM_WIDGET_ITEM_RETURN_IF_ONDEL(item);
- elm_object_cursor_theme_search_enabled_set(item->view, !engine_only);
+ elm_object_sub_cursor_theme_search_enabled_set(item->view, !engine_only);
}
/**
@@ -4689,10 +4892,10 @@ _elm_widget_item_cursor_engine_only_set(Eo *eo_item EINA_UNUSED,
* @ingroup Widget
*/
EOLIAN static Eina_Bool
-_elm_widget_item_cursor_engine_only_get(Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data *item)
+_elm_widget_item_cursor_engine_only_get(const Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data *item)
{
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, EINA_FALSE);
- return !elm_object_cursor_theme_search_enabled_get(item->view);
+ return !elm_object_sub_cursor_theme_search_enabled_get(item->view);
}
EOLIAN static void
@@ -4705,7 +4908,7 @@ _elm_widget_item_part_content_set(Eo *eo_item EINA_UNUSED,
}
EOLIAN static Evas_Object *
-_elm_widget_item_part_content_get(Eo *eo_item EINA_UNUSED,
+_elm_widget_item_part_content_get(const Eo *eo_item EINA_UNUSED,
Elm_Widget_Item_Data *item,
const char *part EINA_UNUSED)
{
@@ -4732,7 +4935,7 @@ _elm_widget_item_part_text_set(Eo *eo_item EINA_UNUSED,
}
EOLIAN static const char *
-_elm_widget_item_part_text_get(Eo *eo_item EINA_UNUSED,
+_elm_widget_item_part_text_get(const Eo *eo_item EINA_UNUSED,
Elm_Widget_Item_Data *item,
const char *part EINA_UNUSED)
{
@@ -4781,7 +4984,7 @@ _elm_widget_item_part_text_custom_set(Eo *eo_item EINA_UNUSED,
}
EOLIAN static const char *
-_elm_widget_item_part_text_custom_get(Eo *eo_item EINA_UNUSED,
+_elm_widget_item_part_text_custom_get(const Eo *eo_item EINA_UNUSED,
Elm_Widget_Item_Data *item,
const char *part)
{
@@ -5152,16 +5355,11 @@ _focus_event_changed(void *data EINA_UNUSED, const Efl_Event *event)
}
EOLIAN static Eo *
-_elm_widget_efl_object_constructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED)
+_efl_ui_widget_efl_object_constructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED)
{
Eo *parent = NULL;
sd->on_create = EINA_TRUE;
- if (_elm_legacy_add)
- {
- sd->legacy = _elm_legacy_add;
- _elm_legacy_add = EINA_FALSE;
- }
efl_canvas_group_clipped_set(obj, EINA_FALSE);
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
@@ -5170,7 +5368,7 @@ _elm_widget_efl_object_constructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSE
efl_ui_widget_parent_set(obj, parent);
sd->on_create = EINA_FALSE;
- efl_access_role_set(obj, EFL_ACCESS_ROLE_UNKNOWN);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_UNKNOWN);
efl_event_callback_add(obj, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED, _focus_event_changed, NULL);
@@ -5178,7 +5376,7 @@ _elm_widget_efl_object_constructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSE
}
EOLIAN static Efl_Object*
-_elm_widget_efl_object_finalize(Eo *obj, Elm_Widget_Smart_Data *pd)
+_efl_ui_widget_efl_object_finalize(Eo *obj, Elm_Widget_Smart_Data *pd)
{
Eo *eo;
@@ -5191,14 +5389,14 @@ _elm_widget_efl_object_finalize(Eo *obj, Elm_Widget_Smart_Data *pd)
EOLIAN static void
-_elm_widget_efl_object_destructor(Eo *obj, Elm_Widget_Smart_Data *sd)
+_efl_ui_widget_efl_object_destructor(Eo *obj, Elm_Widget_Smart_Data *sd)
{
if (sd->manager.provider)
{
- efl_event_callback_del(sd->manager.provider, EFL_UI_FOCUS_USER_EVENT_MANAGER_CHANGED, _manager_changed_cb, obj);
+ efl_event_callback_del(sd->manager.provider, EFL_UI_FOCUS_OBJECT_EVENT_MANAGER_CHANGED, _manager_changed_cb, obj);
sd->manager.provider = NULL;
}
- efl_access_attributes_clear(obj);
+ efl_access_object_attributes_clear(obj);
efl_access_removed(obj);
if (sd->logical.parent)
{
@@ -5207,21 +5405,14 @@ _elm_widget_efl_object_destructor(Eo *obj, Elm_Widget_Smart_Data *sd)
}
sd->on_destroy = EINA_TRUE;
- efl_destructor(efl_super(obj, ELM_WIDGET_CLASS));
+ efl_destructor(efl_super(obj, EFL_UI_WIDGET_CLASS));
sd->on_destroy = EINA_FALSE;
}
/* internal eo */
-static void
-_elm_widget_legacy_ctor(Eo *obj, Elm_Widget_Smart_Data *sd)
-{
- efl_canvas_object_legacy_ctor(efl_super(obj, MY_CLASS));
- sd->legacy = EINA_TRUE;
- _elm_legacy_add = EINA_FALSE;
-}
EOLIAN static void
-_elm_widget_efl_object_debug_name_override(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED, Eina_Strbuf *sb)
+_efl_ui_widget_efl_object_debug_name_override(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED, Eina_Strbuf *sb)
{
const char *focus = "";
@@ -5231,7 +5422,7 @@ _elm_widget_efl_object_debug_name_override(Eo *obj, Elm_Widget_Smart_Data *sd EI
}
EOLIAN static Eina_Bool
-_elm_widget_on_focus_update(Eo *obj, Elm_Widget_Smart_Data *sd, Elm_Object_Item *item EINA_UNUSED)
+_efl_ui_widget_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Widget_Smart_Data *sd)
{
Eina_Bool focused;
@@ -5250,19 +5441,19 @@ _elm_widget_on_focus_update(Eo *obj, Elm_Widget_Smart_Data *sd, Elm_Object_Item
}
EOLIAN static Eina_Bool
-_elm_widget_on_disabled_update(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Eina_Bool disabled EINA_UNUSED)
+_efl_ui_widget_on_disabled_update(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Eina_Bool disabled EINA_UNUSED)
{
return EINA_FALSE;
}
EOLIAN static Eina_Bool
-_elm_widget_widget_event(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd EINA_UNUSED, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *source EINA_UNUSED)
+_efl_ui_widget_widget_event(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd EINA_UNUSED, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *source EINA_UNUSED)
{
return EINA_FALSE;
}
EOLIAN static Eina_Bool
-_elm_widget_on_access_activate(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Efl_Ui_Activate act EINA_UNUSED)
+_efl_ui_widget_on_access_activate(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Efl_Ui_Activate act EINA_UNUSED)
{
WRN("The %s widget does not implement the \"activate\" functions.",
efl_class_name_get(efl_class_get(obj)));
@@ -5270,13 +5461,13 @@ _elm_widget_on_access_activate(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd E
}
EOLIAN static void
-_elm_widget_class_constructor(Efl_Class *klass)
+_efl_ui_widget_class_constructor(Efl_Class *klass)
{
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
}
EOLIAN static Eina_Bool
-_elm_widget_efl_access_component_focus_grab(Eo *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED)
+_efl_ui_widget_efl_access_component_focus_grab(Eo *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED)
{
if (elm_object_focus_allow_get(obj))
{
@@ -5290,10 +5481,10 @@ _elm_widget_efl_access_component_focus_grab(Eo *obj, Elm_Widget_Smart_Data *pd E
}
EOLIAN static const char*
-_elm_widget_efl_access_name_get(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED)
+_efl_ui_widget_efl_access_object_i18n_name_get(const Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED)
{
const char *ret, *name;
- name = efl_access_name_get(efl_super(obj, ELM_WIDGET_CLASS));
+ name = efl_access_object_i18n_name_get(efl_super(obj, EFL_UI_WIDGET_CLASS));
if (name) return name;
@@ -5304,7 +5495,7 @@ _elm_widget_efl_access_name_get(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED)
}
EOLIAN static Eina_List*
-_elm_widget_efl_access_children_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd)
+_efl_ui_widget_efl_access_object_access_children_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd)
{
Eina_List *l, *accs = NULL;
Evas_Object *widget;
@@ -5313,13 +5504,13 @@ _elm_widget_efl_access_children_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *
EINA_LIST_FOREACH(pd->subobjs, l, widget)
{
if (!elm_object_widget_check(widget)) continue;
- if (!efl_isa(widget, EFL_ACCESS_MIXIN)) continue;
- type = efl_access_type_get(widget);
+ if (!efl_isa(widget, EFL_ACCESS_OBJECT_MIXIN)) continue;
+ type = efl_access_object_access_type_get(widget);
if (type == EFL_ACCESS_TYPE_DISABLED) continue;
if (type == EFL_ACCESS_TYPE_SKIPPED)
{
Eina_List *children;
- children = efl_access_children_get(widget);
+ children = efl_access_object_access_children_get(widget);
accs = eina_list_merge(accs, children);
continue;
}
@@ -5328,27 +5519,12 @@ _elm_widget_efl_access_children_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *
return accs;
}
-EOLIAN static Eo*
-_elm_widget_efl_access_parent_get(Eo *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED)
-{
- Efl_Access_Type type;
- Efl_Access *parent = obj;
-
- do {
- ELM_WIDGET_DATA_GET_OR_RETURN(parent, wd, NULL);
- parent = wd->parent_obj;
- type = efl_access_type_get(parent);
- } while (parent && (type == EFL_ACCESS_TYPE_SKIPPED));
-
- return efl_isa(parent, EFL_ACCESS_MIXIN) ? parent : NULL;
-}
-
EOLIAN static Efl_Access_State_Set
-_elm_widget_efl_access_state_set_get(Eo *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED)
+_efl_ui_widget_efl_access_object_state_set_get(const Eo *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED)
{
Efl_Access_State_Set states = 0;
- states = efl_access_state_set_get(efl_super(obj, ELM_WIDGET_CLASS));
+ states = efl_access_object_state_set_get(efl_super(obj, EFL_UI_WIDGET_CLASS));
if (evas_object_visible_get(obj))
{
@@ -5373,58 +5549,75 @@ _elm_widget_efl_access_state_set_get(Eo *obj, Elm_Widget_Smart_Data *pd EINA_UNU
}
EOLIAN static Eina_List*
-_elm_widget_efl_access_attributes_get(Eo *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED)
+_efl_ui_widget_efl_access_object_attributes_get(const Eo *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED)
{
+ const char *type = NULL;
+ const char *style = NULL;
Eina_List *attr_list = NULL;
+ Efl_Access_Attribute *attr = NULL;
- attr_list = efl_access_attributes_get(efl_super(obj, ELM_WIDGET_CLASS));
+ attr_list = efl_access_object_attributes_get(efl_super(obj, EFL_UI_WIDGET_CLASS));
//Add type and style information in addition.
- Efl_Access_Attribute *attr = NULL;
- attr = calloc(1, sizeof(Efl_Access_Attribute));
- if (attr)
+ type = elm_widget_type_get(obj);
+ if (type)
{
- attr->key = eina_stringshare_add("type");
- attr->value = eina_stringshare_add(elm_widget_type_get(obj));
- attr_list = eina_list_append(attr_list, attr);
+ attr = calloc(1, sizeof(Efl_Access_Attribute));
+ if (attr)
+ {
+ attr->key = eina_stringshare_add("type");
+ attr->value = eina_stringshare_add(type);
+ attr_list = eina_list_append(attr_list, attr);
+ }
}
- attr = calloc(1, sizeof(Efl_Access_Attribute));
- if (attr)
+ style = elm_widget_style_get(obj);
+ if (style)
{
- attr->key = eina_stringshare_add("style");
- attr->value = eina_stringshare_add(elm_widget_style_get(obj));
- attr_list = eina_list_append(attr_list, attr);
+ attr = calloc(1, sizeof(Efl_Access_Attribute));
+ if (attr)
+ {
+ attr->key = eina_stringshare_add("style");
+ attr->value = eina_stringshare_add(style);
+ attr_list = eina_list_append(attr_list, attr);
+ }
}
return attr_list;
}
EOLIAN static Eina_List *
-_elm_widget_item_efl_access_attributes_get(Eo *eo_item, Elm_Widget_Item_Data *pd EINA_UNUSED)
+_elm_widget_item_efl_access_object_attributes_get(const Eo *eo_item, Elm_Widget_Item_Data *pd EINA_UNUSED)
{
+ const char *style = NULL;
Eina_List *attr_list = NULL;
- attr_list = efl_access_attributes_get(efl_super(eo_item, ELM_WIDGET_ITEM_CLASS));
Efl_Access_Attribute *attr = NULL;
- attr = calloc(1, sizeof(Efl_Access_Attribute));
- if (attr)
+
+ attr_list = efl_access_object_attributes_get(efl_super(eo_item, ELM_WIDGET_ITEM_CLASS));
+
+ style = elm_object_item_style_get(eo_item);
+ if (style)
{
- attr->key = eina_stringshare_add("style");
- attr->value = eina_stringshare_add(elm_object_item_style_get(eo_item));
- attr_list = eina_list_append(attr_list, attr);
+ attr = calloc(1, sizeof(Efl_Access_Attribute));
+ if (attr)
+ {
+ attr->key = eina_stringshare_add("style");
+ attr->value = eina_stringshare_add(style);
+ attr_list = eina_list_append(attr_list, attr);
+ }
}
return attr_list;
}
EOLIAN static Eina_Rect
-_elm_widget_item_efl_access_component_extents_get(Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *sd EINA_UNUSED, Eina_Bool screen_coords)
+_elm_widget_item_efl_access_component_extents_get(const Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *sd EINA_UNUSED, Eina_Bool screen_coords)
{
Eina_Rect r = EINA_RECT(-1, -1, -1, -1);
int ee_x, ee_y;
if (!sd->view) return r;
- r = efl_gfx_geometry_get(sd->view);
+ r = efl_gfx_entity_geometry_get(sd->view);
if (screen_coords)
{
Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(sd->view));
@@ -5444,14 +5637,6 @@ _elm_widget_item_efl_access_component_extents_set(Eo *obj EINA_UNUSED, Elm_Widge
return EINA_FALSE;
}
-EOLIAN static int
-_elm_widget_item_efl_access_component_layer_get(Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *sd EINA_UNUSED)
-{
- if (!sd->view)
- return -1;
- return evas_object_layer_get(sd->view);
-}
-
EOLIAN static Eina_Bool
_elm_widget_item_efl_access_component_focus_grab(Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *_pd EINA_UNUSED)
{
@@ -5459,28 +5644,25 @@ _elm_widget_item_efl_access_component_focus_grab(Eo *obj EINA_UNUSED, Elm_Widget
return elm_object_item_focus_get(obj);
}
-EOLIAN static double
-_elm_widget_item_efl_access_component_alpha_get(Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *sd EINA_UNUSED)
-{
- int alpha;
-
- if (!sd->view) return -1.0;
- evas_object_color_get(sd->view, NULL, NULL, NULL, &alpha);
- return (double)alpha / 255.0;
-}
-
EOLIAN static Efl_Object *
-_elm_widget_efl_object_provider_find(const Eo *obj, Elm_Widget_Smart_Data *pd, const Efl_Object *klass)
+_efl_ui_widget_efl_object_provider_find(const Eo *obj, Elm_Widget_Smart_Data *pd, const Efl_Object *klass)
{
Efl_Object *lookup = NULL;
if ((klass == EFL_CONFIG_INTERFACE) || (klass == EFL_CONFIG_GLOBAL_CLASS))
return _efl_config_obj;
+ if (klass == EFL_ACCESS_OBJECT_MIXIN)
+ {
+ Efl_Access_Type type = efl_access_object_access_type_get(obj);
+ if (type != EFL_ACCESS_TYPE_SKIPPED)
+ return (Eo*)obj;
+ }
+
if (pd->provider_lookup) return NULL;
pd->provider_lookup = EINA_TRUE;
- lookup = efl_provider_find(pd->parent_obj, klass);
+ if (pd->parent_obj) lookup = efl_provider_find(pd->parent_obj, klass);
if (!lookup) lookup = efl_provider_find(efl_super(obj, MY_CLASS), klass);
pd->provider_lookup = EINA_FALSE;
@@ -5489,41 +5671,33 @@ _elm_widget_efl_object_provider_find(const Eo *obj, Elm_Widget_Smart_Data *pd, c
}
EOLIAN static Efl_Ui_Focus_Manager*
-_elm_widget_efl_ui_focus_user_focus_parent_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd EINA_UNUSED)
+_efl_ui_widget_efl_ui_focus_object_focus_parent_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd EINA_UNUSED)
{
return pd->focus.parent;
}
EOLIAN static Efl_Ui_Focus_Manager*
-_elm_widget_efl_ui_focus_user_focus_manager_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd EINA_UNUSED)
+_efl_ui_widget_efl_ui_focus_object_focus_manager_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd EINA_UNUSED)
{
return pd->focus.manager;
}
EOLIAN static Eina_Rect
-_elm_widget_efl_ui_focus_object_focus_geometry_get(Eo *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED)
+_efl_ui_widget_efl_ui_focus_object_focus_geometry_get(const Eo *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED)
{
- return efl_gfx_geometry_get(obj);
+ return efl_gfx_entity_geometry_get(obj);
}
EOLIAN static void
-_elm_widget_efl_ui_focus_object_focus_set(Eo *obj, Elm_Widget_Smart_Data *pd, Eina_Bool focus)
+_efl_ui_widget_efl_ui_focus_object_focus_set(Eo *obj, Elm_Widget_Smart_Data *pd, Eina_Bool focus)
{
pd->focused = focus;
efl_ui_focus_object_focus_set(efl_super(obj, MY_CLASS), focus);
- efl_ui_widget_on_focus_update(obj, NULL);
+ efl_ui_focus_object_on_focus_update(obj);
}
-EOLIAN static Efl_Ui_Focus_Manager*
-_elm_widget_focus_manager_create(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd EINA_UNUSED, Efl_Ui_Focus_Object *root EINA_UNUSED)
-{
- ERR("No manager presented");
- return NULL;
-}
-
-
/* Legacy APIs */
/* elm_object_content_xxx APIs are supposed to work on all objects for which
@@ -5533,7 +5707,7 @@ EAPI void
elm_widget_content_part_set(Evas_Object *obj, const char *part, Evas_Object *content)
{
ELM_WIDGET_CHECK(obj);
- if (efl_isa(obj, EFL_UI_LAYOUT_CLASS))
+ if (efl_isa(obj, EFL_UI_LAYOUT_OBJECT_CLASS))
{
elm_layout_content_set(obj, part, content);
return;
@@ -5541,7 +5715,7 @@ elm_widget_content_part_set(Evas_Object *obj, const char *part, Evas_Object *con
if (!efl_isa(obj, EFL_PART_INTERFACE)) return;
if (!part)
{
- part = elm_widget_default_content_part_get(obj);
+ part = efl_ui_widget_default_content_part_get(obj);
if (!part) return;
}
efl_content_set(efl_part(obj, part), content);
@@ -5551,12 +5725,12 @@ EAPI Evas_Object *
elm_widget_content_part_get(const Evas_Object *obj, const char *part)
{
ELM_WIDGET_CHECK(obj) NULL;
- if (efl_isa(obj, EFL_UI_LAYOUT_CLASS))
+ if (efl_isa(obj, EFL_UI_LAYOUT_OBJECT_CLASS))
return elm_layout_content_get(obj, part);
if (!efl_isa(obj, EFL_PART_INTERFACE)) return NULL;
if (!part)
{
- part = elm_widget_default_content_part_get(obj);
+ part = efl_ui_widget_default_content_part_get(obj);
if (!part) return NULL;
}
return efl_content_get(efl_part(obj, part));
@@ -5566,12 +5740,12 @@ EAPI Evas_Object *
elm_widget_content_part_unset(Evas_Object *obj, const char *part)
{
ELM_WIDGET_CHECK(obj) NULL;
- if (efl_isa(obj, EFL_UI_LAYOUT_CLASS))
+ if (efl_isa(obj, EFL_UI_LAYOUT_OBJECT_CLASS))
return elm_layout_content_unset(obj, part);
if (!efl_isa(obj, EFL_PART_INTERFACE)) return NULL;
if (!part)
{
- part = elm_widget_default_content_part_get(obj);
+ part = efl_ui_widget_default_content_part_get(obj);
if (!part) return NULL;
}
return efl_content_unset(efl_part(obj, part));
@@ -5581,7 +5755,8 @@ EAPI void
elm_widget_signal_emit(Eo *obj, const char *emission, const char *source)
{
ELM_WIDGET_CHECK(obj);
- if (evas_object_smart_type_check(obj, "elm_layout"))
+
+ if (efl_isa(obj, EFL_UI_LAYOUT_OBJECT_CLASS))
elm_layout_signal_emit(obj, emission, source);
else if (evas_object_smart_type_check(obj, "elm_icon"))
{
@@ -5661,14 +5836,14 @@ _widget_shadow_event_cb(void *data, const Efl_Event *ev EINA_UNUSED)
EFL_CALLBACKS_ARRAY_DEFINE(widget_shadow_cb,
{ EFL_EVENT_DEL, _widget_shadow_del_cb },
-{ EFL_GFX_EVENT_MOVE, _widget_shadow_event_cb },
-{ EFL_GFX_EVENT_RESIZE, _widget_shadow_event_cb },
-{ EFL_GFX_EVENT_RESTACK, _widget_shadow_event_cb },
-{ EFL_GFX_EVENT_HIDE, _widget_shadow_event_cb },
-{ EFL_GFX_EVENT_SHOW, _widget_shadow_event_cb })
+{ EFL_GFX_ENTITY_EVENT_MOVE, _widget_shadow_event_cb },
+{ EFL_GFX_ENTITY_EVENT_RESIZE, _widget_shadow_event_cb },
+{ EFL_GFX_ENTITY_EVENT_RESTACK, _widget_shadow_event_cb },
+{ EFL_GFX_ENTITY_EVENT_HIDE, _widget_shadow_event_cb },
+{ EFL_GFX_ENTITY_EVENT_SHOW, _widget_shadow_event_cb })
static Widget_Shadow *
-_widget_shadow_part_get(Eo *part_obj)
+_widget_shadow_part_get(const Eo *part_obj)
{
Elm_Part_Data *pd = efl_data_scope_get(part_obj, EFL_UI_WIDGET_PART_CLASS);
Widget_Shadow *shadow;
@@ -5718,28 +5893,28 @@ _widget_shadow_update(Widget_Shadow *ws)
ws->name ? ws->name : "shadow");
efl_gfx_filter_padding_get(ws->surface, &l, &r, &t, &b);
- wrect = efl_gfx_geometry_get(ws->widget);
+ wrect = efl_gfx_entity_geometry_get(ws->widget);
srect.x = wrect.x + (int) (-l + ws->props.ox);
srect.y = wrect.y + (int) (-t + ws->props.oy);
srect.w = wrect.w + (int) (l + r);
srect.h = wrect.h + (int) (t + b);
if ((!ws->props.a && !ws->code) ||
- !efl_gfx_visible_get(ws->widget))
+ !efl_gfx_entity_visible_get(ws->widget))
{
- efl_gfx_visible_set(ws->surface, EINA_FALSE);
+ efl_gfx_entity_visible_set(ws->surface, EINA_FALSE);
return;
}
efl_canvas_object_clip_set(ws->surface, efl_canvas_object_clip_get(ws->widget));
efl_canvas_group_member_add(efl_canvas_object_render_parent_get(ws->widget), ws->surface);
- efl_gfx_geometry_set(ws->surface, srect);
+ efl_gfx_entity_geometry_set(ws->surface, srect);
efl_gfx_stack_below(ws->surface, ws->widget);
- efl_gfx_visible_set(ws->surface, EINA_TRUE);
+ efl_gfx_entity_visible_set(ws->surface, EINA_TRUE);
}
static void
-_elm_widget_shadow_update(Elm_Widget *obj)
+_elm_widget_shadow_update(Efl_Ui_Widget *obj)
{
Widget_Shadow *shadow = _widget_shadow_part_get(obj);
_widget_shadow_update(shadow);
@@ -5755,7 +5930,7 @@ _efl_ui_widget_part_shadow_efl_gfx_blur_offset_set(Eo *obj, void *_pd EINA_UNUSE
}
EOLIAN static void
-_efl_ui_widget_part_shadow_efl_gfx_blur_offset_get(Eo *obj, void *_pd EINA_UNUSED, double *ox, double *oy)
+_efl_ui_widget_part_shadow_efl_gfx_blur_offset_get(const Eo *obj, void *_pd EINA_UNUSED, double *ox, double *oy)
{
Widget_Shadow *shadow = _widget_shadow_part_get(obj);
if (ox) *ox = shadow->props.ox;
@@ -5772,7 +5947,7 @@ _efl_ui_widget_part_shadow_efl_gfx_blur_radius_set(Eo *obj, void *_pd EINA_UNUSE
}
EOLIAN static void
-_efl_ui_widget_part_shadow_efl_gfx_blur_radius_get(Eo *obj, void *_pd EINA_UNUSED, double *rx, double *ry)
+_efl_ui_widget_part_shadow_efl_gfx_blur_radius_get(const Eo *obj, void *_pd EINA_UNUSED, double *rx, double *ry)
{
Widget_Shadow *shadow = _widget_shadow_part_get(obj);
if (rx) *rx = shadow->props.rx;
@@ -5791,7 +5966,7 @@ _efl_ui_widget_part_shadow_efl_gfx_color_color_set(Eo *obj, void *_pd EINA_UNUSE
}
EOLIAN static void
-_efl_ui_widget_part_shadow_efl_gfx_color_color_get(Eo *obj, void *_pd EINA_UNUSED, int *r, int *g, int *b, int *a)
+_efl_ui_widget_part_shadow_efl_gfx_color_color_get(const Eo *obj, void *_pd EINA_UNUSED, int *r, int *g, int *b, int *a)
{
Widget_Shadow *shadow = _widget_shadow_part_get(obj);
if (r) *r = shadow->props.r;
@@ -5809,7 +5984,7 @@ _efl_ui_widget_part_shadow_efl_gfx_blur_grow_set(Eo *obj, void *_pd EINA_UNUSED,
}
EOLIAN static double
-_efl_ui_widget_part_shadow_efl_gfx_blur_grow_get(Eo *obj, void *_pd EINA_UNUSED)
+_efl_ui_widget_part_shadow_efl_gfx_blur_grow_get(const Eo *obj, void *_pd EINA_UNUSED)
{
Widget_Shadow *shadow = _widget_shadow_part_get(obj);
return shadow->props.grow;
@@ -5825,22 +6000,22 @@ _efl_ui_widget_part_shadow_efl_gfx_filter_filter_program_set(Eo *obj, void *_pd
}
EOLIAN static void
-_efl_ui_widget_part_shadow_efl_gfx_filter_filter_program_get(Eo *obj, void *_pd EINA_UNUSED, const char **code, const char **name)
+_efl_ui_widget_part_shadow_efl_gfx_filter_filter_program_get(const Eo *obj, void *_pd EINA_UNUSED, const char **code, const char **name)
{
Widget_Shadow *ws = _widget_shadow_part_get(obj);
efl_gfx_filter_program_get(ws->surface, code, name);
}
EOLIAN static void
-_efl_ui_widget_part_shadow_efl_gfx_filter_filter_source_set(Eo *obj, void *_pd EINA_UNUSED, const char *name, Efl_Gfx *source)
+_efl_ui_widget_part_shadow_efl_gfx_filter_filter_source_set(Eo *obj, void *_pd EINA_UNUSED, const char *name, Efl_Gfx_Entity *source)
{
Widget_Shadow *ws = _widget_shadow_part_get(obj);
_widget_shadow_update(ws);
efl_gfx_filter_source_set(ws->surface, name, source);
}
-EOLIAN static Efl_Gfx *
-_efl_ui_widget_part_shadow_efl_gfx_filter_filter_source_get(Eo *obj, void *_pd EINA_UNUSED, const char *name)
+EOLIAN static Efl_Gfx_Entity *
+_efl_ui_widget_part_shadow_efl_gfx_filter_filter_source_get(const Eo *obj, void *_pd EINA_UNUSED, const char *name)
{
Widget_Shadow *ws = _widget_shadow_part_get(obj);
return efl_gfx_filter_source_get(ws->surface, name);
@@ -5855,14 +6030,14 @@ _efl_ui_widget_part_shadow_efl_gfx_filter_filter_data_set(Eo *obj, void *_pd EIN
}
EOLIAN static void
-_efl_ui_widget_part_shadow_efl_gfx_filter_filter_data_get(Eo *obj, void *_pd EINA_UNUSED, const char *name, const char **value, Eina_Bool *execute)
+_efl_ui_widget_part_shadow_efl_gfx_filter_filter_data_get(const Eo *obj, void *_pd EINA_UNUSED, const char *name, const char **value, Eina_Bool *execute)
{
Widget_Shadow *ws = _widget_shadow_part_get(obj);
efl_gfx_filter_data_get(ws->surface, name, value, execute);
}
EOLIAN static void
-_efl_ui_widget_part_shadow_efl_gfx_filter_filter_padding_get(Eo *obj, void *_pd EINA_UNUSED, int *l, int *r, int *t, int *b)
+_efl_ui_widget_part_shadow_efl_gfx_filter_filter_padding_get(const Eo *obj, void *_pd EINA_UNUSED, int *l, int *r, int *t, int *b)
{
Widget_Shadow *ws = _widget_shadow_part_get(obj);
efl_gfx_filter_padding_get(ws->surface, l, r, t, b);
@@ -5876,7 +6051,7 @@ _efl_ui_widget_part_shadow_efl_gfx_filter_filter_state_set(Eo *obj, void *_pd EI
}
EOLIAN static void
-_efl_ui_widget_part_shadow_efl_gfx_filter_filter_state_get(Eo *obj, void *_pd EINA_UNUSED, const char **cur_state, double *cur_val, const char **next_state, double *next_val, double *pos)
+_efl_ui_widget_part_shadow_efl_gfx_filter_filter_state_get(const Eo *obj, void *_pd EINA_UNUSED, const char **cur_state, double *cur_val, const char **next_state, double *next_val, double *pos)
{
Widget_Shadow *ws = _widget_shadow_part_get(obj);
efl_gfx_filter_state_get(ws->surface, cur_state, cur_val, next_state, next_val, pos);
@@ -5890,7 +6065,7 @@ _efl_ui_widget_part_shadow_efl_gfx_filter_filter_state_get(Eo *obj, void *_pd EI
/* Efl.Part implementation */
EOLIAN static Efl_Object *
-_elm_widget_efl_part_part(const Eo *obj, Elm_Widget_Smart_Data *wd EINA_UNUSED, const char *part)
+_efl_ui_widget_efl_part_part_get(const Eo *obj, Elm_Widget_Smart_Data *wd EINA_UNUSED, const char *part)
{
if (eina_streq(part, "background"))
return ELM_PART_IMPLEMENT(EFL_UI_WIDGET_PART_BG_CLASS, obj, part);
@@ -5914,17 +6089,18 @@ _efl_ui_widget_part_efl_object_destructor(Eo *obj, Elm_Part_Data *pd)
/* Efl.Part Bg implementation */
Efl_Canvas_Object *
-_efl_ui_widget_bg_get(Elm_Widget *obj)
+_efl_ui_widget_bg_get(const Efl_Ui_Widget *obj)
{
Elm_Widget_Smart_Data *sd = efl_data_scope_get(obj, MY_CLASS);
Evas_Object *bg_obj = sd->bg;
if (!bg_obj)
{
- bg_obj = efl_add(EFL_UI_BG_WIDGET_CLASS, obj);
+ /* XXX const */
+ bg_obj = efl_add(EFL_UI_BG_WIDGET_CLASS, (Eo *)obj);
EINA_SAFETY_ON_NULL_RETURN_VAL(bg_obj, NULL);
sd->bg = bg_obj;
- efl_canvas_group_member_add(obj, sd->bg);
+ efl_canvas_group_member_add((Eo *)obj, sd->bg);
evas_object_stack_below(sd->bg, sd->resize_obj);
_smart_reconfigure(sd);
}
@@ -5933,7 +6109,7 @@ _efl_ui_widget_bg_get(Elm_Widget *obj)
}
static inline Efl_Canvas_Object *
-efl_ui_widget_part_bg_get(Eo *part_obj)
+efl_ui_widget_part_bg_get(const Eo *part_obj)
{
Elm_Part_Data *pd = efl_data_scope_get(part_obj, EFL_UI_WIDGET_PART_CLASS);
return _efl_ui_widget_bg_get(pd->obj);
@@ -5948,7 +6124,7 @@ _efl_ui_widget_part_bg_efl_file_file_set(Eo *obj, void *pd EINA_UNUSED, const ch
}
EOLIAN static void
-_efl_ui_widget_part_bg_efl_file_file_get(Eo *obj, void *pd EINA_UNUSED, const char **file, const char **key)
+_efl_ui_widget_part_bg_efl_file_file_get(const Eo *obj, void *pd EINA_UNUSED, const char **file, const char **key)
{
Evas_Object *bg_obj = efl_ui_widget_part_bg_get(obj);
@@ -5964,7 +6140,7 @@ _efl_ui_widget_part_bg_efl_gfx_color_color_set(Eo *obj, void *pd EINA_UNUSED, in
}
EOLIAN static void
-_efl_ui_widget_part_bg_efl_gfx_color_color_get(Eo *obj, void *pd EINA_UNUSED, int *r, int *g, int *b, int *a)
+_efl_ui_widget_part_bg_efl_gfx_color_color_get(const Eo *obj, void *pd EINA_UNUSED, int *r, int *g, int *b, int *a)
{
Evas_Object *bg_obj = efl_ui_widget_part_bg_get(obj);
@@ -5972,19 +6148,19 @@ _efl_ui_widget_part_bg_efl_gfx_color_color_get(Eo *obj, void *pd EINA_UNUSED, in
}
EOLIAN static void
-_efl_ui_widget_part_bg_efl_image_scale_type_set(Eo *obj, void *pd EINA_UNUSED, Efl_Image_Scale_Type scale_type)
+_efl_ui_widget_part_bg_efl_gfx_image_scale_type_set(Eo *obj, void *pd EINA_UNUSED, Efl_Gfx_Image_Scale_Type scale_type)
{
Evas_Object *bg_obj = efl_ui_widget_part_bg_get(obj);
- efl_image_scale_type_set(bg_obj, scale_type);
+ efl_gfx_image_scale_type_set(bg_obj, scale_type);
}
-EOLIAN static Efl_Image_Scale_Type
-_efl_ui_widget_part_bg_efl_image_scale_type_get(Eo *obj, void *pd EINA_UNUSED)
+EOLIAN static Efl_Gfx_Image_Scale_Type
+_efl_ui_widget_part_bg_efl_gfx_image_scale_type_get(const Eo *obj, void *pd EINA_UNUSED)
{
Evas_Object *bg_obj = efl_ui_widget_part_bg_get(obj);
- return efl_image_scale_type_get(bg_obj);
+ return efl_gfx_image_scale_type_get(bg_obj);
}
#include "efl_ui_widget_part_bg.eo.c"
@@ -5994,21 +6170,20 @@ _efl_ui_widget_part_bg_efl_image_scale_type_get(Eo *obj, void *pd EINA_UNUSED)
/* Internal EO APIs and hidden overrides */
-EFL_FUNC_BODY_CONST(elm_widget_default_content_part_get, const char *, NULL)
-EFL_FUNC_BODY_CONST(elm_widget_default_text_part_get, const char *, NULL)
+EFL_FUNC_BODY_CONST(efl_ui_widget_default_content_part_get, const char *, NULL)
+EFL_FUNC_BODY_CONST(efl_ui_widget_default_text_part_get, const char *, NULL)
-ELM_PART_CONTENT_DEFAULT_GET(elm_widget, NULL)
-ELM_PART_TEXT_DEFAULT_GET(elm_widget, NULL)
+ELM_PART_CONTENT_DEFAULT_GET(efl_ui_widget, NULL)
+ELM_PART_TEXT_DEFAULT_GET(efl_ui_widget, NULL)
-#define ELM_WIDGET_EXTRA_OPS \
- EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_widget), \
- ELM_PART_CONTENT_DEFAULT_OPS(elm_widget), \
- ELM_PART_TEXT_DEFAULT_OPS(elm_widget), \
- EFL_OBJECT_OP_FUNC(efl_canvas_object_legacy_ctor, _elm_widget_legacy_ctor), \
- EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _elm_widget_efl_object_dbg_info_get)
+#define EFL_UI_WIDGET_EXTRA_OPS \
+ EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_widget), \
+ ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_widget), \
+ ELM_PART_TEXT_DEFAULT_OPS(efl_ui_widget), \
+ EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _efl_ui_widget_efl_object_dbg_info_get)
#include "elm_widget_item.eo.c"
-#include "elm_widget.eo.c"
+#include "efl_ui_widget.eo.c"
/* Others */
#include "efl_ui_translatable.eo.c"
diff --git a/src/lib/elementary/elm_widget.eo b/src/lib/elementary/efl_ui_widget.eo
index a3bf4f1ca6..b0b5610170 100644
--- a/src/lib/elementary/elm_widget.eo
+++ b/src/lib/elementary/efl_ui_widget.eo
@@ -6,22 +6,21 @@ function Efl.Ui.Scrollable_On_Show_Region {
}
};
-struct Efl.Ui.Widget.Focus_State {
+struct Efl.Ui.Widget_Focus_State {
[[All relevant fields needed for the current state of focus registeration]]
manager : Efl.Ui.Focus.Manager; [[The manager where the widget is registered in]]
- parent : Efl.Ui.Focus.User; [[The parent the widget is using as logical parent]]
+ parent : Efl.Ui.Focus.Object; [[The parent the widget is using as logical parent]]
logical : bool; [[$true if this is registered as logical currently]]
}
-/* ATTENTION: Rename to Efl.Ui.Widget is imminent. */
-abstract Elm.Widget (Efl.Canvas.Group, Efl.Access,
- Efl.Access.Component, Efl.Ui.Focus.User, Efl.Part,
- Efl.Ui.Focus.Object, Efl.Ui.Base, Efl.Ui.Cursor,
- Efl.Ui.Translatable)
+abstract Efl.Ui.Widget (Efl.Canvas.Group, Efl.Access.Object,
+ Efl.Access.Component, Efl.Part, Efl.Ui.Focus.Object,
+ Efl.Ui.Base, Efl.Ui.Cursor, Efl.Ui.Translatable,
+ Efl.Selection, Efl.Ui.Dnd)
{
- [[Elementary widget abstract class]]
+ [[Efl UI widget abstract class]]
legacy_prefix: elm_widget;
- eo_prefix: efl_ui_widget;
+ //eo_prefix: efl_ui_widget;
event_prefix: efl_ui_widget;
data: Efl_Ui_Widget_Data;
methods {
@@ -112,24 +111,6 @@ abstract Elm.Widget (Efl.Canvas.Group, Efl.Access,
return: bool; [[$true on success, $false otherwise]]
legacy: null;
}
- @property orientation_mode_disabled {
- [[Whether the widget's automatic orientation is disabled or not.
-
- Orientation mode is used for widgets to change their style or send
- signals based on the canvas rotation (i.e. the window orientation).
- If the orientation mode is enabled, the widget will emit signals
- such as "elm,state,orient,N" where $N is one of 0, 90, 180, 270,
- depending on the window orientation. Such signals may be handled by
- the theme in order to provide a different look for the widget based
- on the canvas orientation.
-
- By default orientation mode is enabled, which means this property
- is $false.
- ]]
- values {
- disabled: bool(false); [[$true if the orientation mode is disabled.]]
- }
- }
// FIXME: focus_allow? can_focus? focusable?
@property focus_allow {
[[The ability for a widget to be focused.
@@ -158,7 +139,7 @@ abstract Elm.Widget (Efl.Canvas.Group, Efl.Access,
@property widget_parent @protected {
[[The internal parent of this widget.
- @Elm.Widget objects have a parent hierarchy that may differ slightly
+ @Efl.Ui.Widget objects have a parent hierarchy that may differ slightly
from their @Efl.Object or @Efl.Canvas.Object hierarchy. This is
meant for internal handling.
@@ -169,7 +150,7 @@ abstract Elm.Widget (Efl.Canvas.Group, Efl.Access,
legacy: elm_widget_parent_get; /* internal in legacy */
}
values {
- parent: Elm.Widget @nullable; [[Widget parent object]]
+ parent: Efl.Ui.Widget @nullable; [[Widget parent object]]
}
}
@property widget_top {
@@ -194,7 +175,7 @@ abstract Elm.Widget (Efl.Canvas.Group, Efl.Access,
legacy: elm_widget_top_get; /* internal in legacy */
}
values {
- top: Elm.Widget; [[Top widget, usually a window.]]
+ top: Efl.Ui.Widget; [[Top widget, usually a window.]]
}
}
@@ -265,26 +246,46 @@ abstract Elm.Widget (Efl.Canvas.Group, Efl.Access,
return: bool; [[Indicates if the operation succeeded.]]
legacy: elm_widget_sub_object_del;
}
+ @property orientation_mode {
+ [[Whether the widget's automatic orientation is enabled or not.
+
+ Orientation mode is used for widgets to change their style or send
+ signals based on the canvas rotation (i.e. the window orientation).
+ If the orientation mode is enabled, the widget will emit signals
+ such as "elm,state,orient,N" where $N is one of 0, 90, 180, 270,
+ depending on the window orientation. Such signals may be handled by
+ the theme in order to provide a different look for the widget based
+ on the canvas orientation.
+
+ By default orientation mode is enabled.
+
+ See also @.on_orientation_update.
+ ]]
+ values {
+ mode: Efl.Ui.Widget_Orientation_Mode(Efl.Ui.Widget_Orientation_Mode.default);
+ [[How window orientation should affect this widget.]]
+ }
+ }
on_orientation_update @protected {
[[Virtual function handling canvas orientation changes.
This method will be called recursively from the top widget (the
window) to all the children objects whenever the window rotation
is changed. The given $rotation will be one of 0, 90, 180, 270 or
- the special value -1 if @.orientation_mode_disabled is $true.
+ the special value -1 if @.orientation_mode is $disabled.
- If @.orientation_mode_disabled is $false, the default implementation
- will emit the signal "elm,state,orient,$R" will be emitted (where $R
- is the rotation angle in degrees).
+ If @.orientation_mode is $default, the widget implementation will
+ emit the signal "elm,state,orient,$R" will be emitted (where $R is
+ the rotation angle in degrees).
Note: This function may be called even if the orientation has not
actually changed, like when a widget needs to be reconfigured.
- See also @Efl.Orientation.orientation.set.
+ See also @.orientation_mode.
]]
params {
rotation: int; [[Orientation in degrees: 0, 90, 180, 270 or -1 if
- @.orientation_mode_disabled is $true.]]
+ @.orientation_mode is $disabled.]]
}
}
on_disabled_update @protected {
@@ -312,14 +313,6 @@ abstract Elm.Widget (Efl.Canvas.Group, Efl.Access,
return: Efl.Ui.Theme.Apply; [[Indicates success, and if the current
theme or default theme was used.]]
}
- on_focus_update @protected {
- [[Virtual function handling focus in/out events on the widget]]
- params {
- /* FIXME: EO API is not supposed to have any widget item!!! */
- @in item: Elm.Widget.Item @nullable; [[Widget]]
- }
- return: bool; [[$true if this widget can handle focus, $false otherwise]]
- }
/* Scroll API. */
@property on_show_region_hook @protected {
@@ -549,29 +542,19 @@ abstract Elm.Widget (Efl.Canvas.Group, Efl.Access,
not registered.
]]
params {
- @in current_state : Efl.Ui.Widget.Focus_State;
+ @in current_state : Efl.Ui.Widget_Focus_State;
[[The focus manager to register with.]]
- @inout configured_state : Efl.Ui.Widget.Focus_State;
+ @inout configured_state : Efl.Ui.Widget_Focus_State;
[[The evalulated Focus state that should be used.]]
- @in redirect : Elm.Widget;
+ @in redirect : Efl.Ui.Widget;
[[A redirect that will be set by the elm.widget implementation.]]
}
return: bool; [[Returns whether the widget is registered or not.]]
}
- focus_manager_create @protected {
- [[If the widget needs a focus manager, this function will be called.
-
- It can be used and overriden to inject your own manager or set
- custom options on the focus manager.
- ]]
- params {
- @in root: Efl.Ui.Focus.Object; [[The logical root object for focus.]]
- }
- return: Efl.Ui.Focus.Manager; [[The focus manager.]]
- }
}
parts {
- shadow: Efl.Ui.Widget.Part_Shadow;
+ shadow: Efl.Ui.Widget_Part_Shadow;
+ background: Efl.Ui.Widget_Part_Bg;
}
implements {
class.constructor;
@@ -581,24 +564,23 @@ abstract Elm.Widget (Efl.Canvas.Group, Efl.Access,
Efl.Object.provider_find;
Efl.Object.debug_name_override;
Efl.Gfx.Color.color { set; }
- Efl.Gfx.visible { set; }
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set; }
- Efl.Gfx.scale { set; get; }
+ Efl.Gfx.Entity.visible { set; }
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
+ Efl.Gfx.Entity.scale { set; get; }
Efl.Canvas.Object.clip { set; }
Efl.Canvas.Object.no_render { set; }
Efl.Canvas.Object.is_frame_object { set; }
Efl.Canvas.Group.group_calculate;
Efl.Canvas.Group.group_member_del;
Efl.Canvas.Group.group_member_add;
- Efl.Access.name { get; }
- Efl.Access.state_set { get; }
- Efl.Access.children { get; }
- Efl.Access.parent { get; }
- Efl.Access.attributes { get; }
+ Efl.Access.Object.i18n_name { get; }
+ Efl.Access.Object.state_set { get; }
+ Efl.Access.Object.access_children { get; }
+ Efl.Access.Object.attributes { get; }
Efl.Access.Component.focus_grab;
- Efl.Ui.Focus.User.focus_manager { get; }
- Efl.Ui.Focus.User.focus_parent { get; }
+ Efl.Ui.Focus.Object.focus_manager { get; }
+ Efl.Ui.Focus.Object.focus_parent { get; }
Efl.Ui.Focus.Object.focus_geometry { get; }
Efl.Ui.Focus.Object.focus { set; }
Efl.Ui.Base.mirrored { get; set; }
@@ -606,12 +588,13 @@ abstract Elm.Widget (Efl.Canvas.Group, Efl.Access,
Efl.Ui.Cursor.cursor { get; set; }
Efl.Ui.Cursor.cursor_style { get; set; }
Efl.Ui.Cursor.cursor_theme_search_enabled { get; set; }
+ Efl.Ui.Focus.Object.on_focus_update;
Efl.Ui.Translatable.translation_update; [[This implements the calls to $gettext() and $text_set().]]
- Efl.Part.part; [[Returns @Efl.Ui.Widget.Part.]]
+ Efl.Part.part_get; [[Returns @Efl.Ui.Widget_Part.]]
}
events {
- moved; [[Called when widget moved]]
- language,changed; [[Called when widget language changed]]
- access,changed; [[Called when accessibility changed]]
+ moved: Efl.Object; [[Called when widget moved]]
+ language,changed: void; [[Called when widget language changed]]
+ access,changed: void; [[Called when accessibility changed]]
}
}
diff --git a/src/lib/elementary/efl_ui_widget_flip.h b/src/lib/elementary/efl_ui_widget_flip.h
index 11c2abdff1..469fef4c4f 100644
--- a/src/lib/elementary/efl_ui_widget_flip.h
+++ b/src/lib/elementary/efl_ui_widget_flip.h
@@ -90,7 +90,7 @@ struct _Vertex3
EFL_UI_FLIP_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -99,7 +99,7 @@ struct _Vertex3
EFL_UI_FLIP_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/efl_ui_widget_focus_manager.c b/src/lib/elementary/efl_ui_widget_focus_manager.c
new file mode 100644
index 0000000000..e5270adea9
--- /dev/null
+++ b/src/lib/elementary/efl_ui_widget_focus_manager.c
@@ -0,0 +1,60 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#define EFL_UI_WIDGET_FOCUS_MANAGER_PROTECTED
+
+#include <Elementary.h>
+#include <Elementary_Cursor.h>
+
+#include "elm_priv.h"
+
+#define MY_CLASS EFL_UI_WIDGET_FOCUS_MANAGER_MIXIN
+
+typedef struct
+{
+ Efl_Ui_Focus_Manager *manager;
+} Efl_Ui_Widget_Focus_Manager_Data;
+
+EOLIAN static Efl_Object*
+_efl_ui_widget_focus_manager_efl_object_constructor(Eo *obj, Efl_Ui_Widget_Focus_Manager_Data *pd)
+{
+ Eo *res = NULL;
+
+ pd->manager = efl_ui_widget_focus_manager_create(obj, obj);
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(pd->manager, res);
+
+ efl_ref(pd->manager);
+ efl_composite_attach(obj, pd->manager);
+ _efl_ui_focus_manager_redirect_events_add(pd->manager, obj);
+ res = efl_constructor(efl_super(obj, MY_CLASS));
+
+
+ return res;
+}
+
+EOLIAN static void
+_efl_ui_widget_focus_manager_efl_object_destructor(Eo *obj, Efl_Ui_Widget_Focus_Manager_Data *pd)
+{
+ efl_destructor(efl_super(obj, MY_CLASS));
+
+ _efl_ui_focus_manager_redirect_events_del(pd->manager, obj);
+ efl_unref(pd->manager);
+ pd->manager = NULL;
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_widget_focus_manager_efl_ui_widget_focus_state_apply(Eo *obj, Efl_Ui_Widget_Focus_Manager_Data *pd EINA_UNUSED, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Efl_Ui_Widget *redirect)
+{
+ Eina_Bool state;
+
+ state = efl_ui_widget_focus_state_apply(efl_super(obj, MY_CLASS), current_state, configured_state, redirect);
+
+ if (!state && !configured_state->manager && current_state.manager)
+ efl_ui_focus_manager_reset_history(obj);
+
+ return state;
+}
+
+#include "efl_ui_widget_focus_manager.eo.c"
diff --git a/src/lib/elementary/efl_ui_widget_focus_manager.eo b/src/lib/elementary/efl_ui_widget_focus_manager.eo
new file mode 100644
index 0000000000..c7c3af9037
--- /dev/null
+++ b/src/lib/elementary/efl_ui_widget_focus_manager.eo
@@ -0,0 +1,22 @@
+mixin Efl.Ui.Widget_Focus_Manager (Efl.Interface, Efl.Ui.Widget, Efl.Ui.Focus.Manager)
+{
+ methods {
+ focus_manager_create @protected @pure_virtual {
+ [[If the widget needs a focus manager, this function will be called.
+
+ It can be used and overriden to inject your own manager or set
+ custom options on the focus manager.
+ ]]
+ params {
+ @in root: Efl.Ui.Focus.Object; [[The logical root object for focus.]]
+ }
+ return: Efl.Ui.Focus.Manager; [[The focus manager.]]
+ }
+ }
+
+ implements {
+ Efl.Object.constructor;
+ Efl.Object.destructor;
+ Efl.Ui.Widget.focus_state_apply;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_widget_frame.h b/src/lib/elementary/efl_ui_widget_frame.h
index ddd7f70789..ca4321d903 100644
--- a/src/lib/elementary/efl_ui_widget_frame.h
+++ b/src/lib/elementary/efl_ui_widget_frame.h
@@ -42,7 +42,7 @@ struct _Efl_Ui_Frame_Data
EFL_UI_FRAME_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -51,7 +51,7 @@ struct _Efl_Ui_Frame_Data
EFL_UI_FRAME_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/efl_ui_widget_image.h b/src/lib/elementary/efl_ui_widget_image.h
index e5c45eb225..159f6ce232 100644
--- a/src/lib/elementary/efl_ui_widget_image.h
+++ b/src/lib/elementary/efl_ui_widget_image.h
@@ -48,7 +48,6 @@ struct _Efl_Ui_Image_Data
Evas_Object *prev_img;
Ecore_Timer *anim_timer;
-
struct {
Eo *copier;
Eina_Binbuf *binbuf;
@@ -76,14 +75,17 @@ struct _Efl_Ui_Image_Data
} async;
Efl_Ui_Image_Preload_Status preload_status;
- Efl_Image_Scale_Type scale_type;
+ Efl_Gfx_Image_Scale_Type scale_type;
const char *stdicon;
- Efl_Model *model;
- Efl_Future *pfuture;
- Eina_Stringshare *prop_con;
- Eina_Stringshare *prop_key;
+ struct {
+ Efl_Model *model;
+ Eina_Stringshare *file;
+ Eina_Stringshare *key;
+
+ Eina_Bool icon : 1;
+ } property;
struct {
int requested_size;
@@ -102,7 +104,6 @@ struct _Efl_Ui_Image_Data
Eina_Bool async_enable : 1;
Eina_Bool scale_up : 1;
Eina_Bool scale_down : 1;
- Eina_Bool con_icon : 1;
Eina_Bool legacy_align : 1;
};
@@ -117,7 +118,7 @@ struct _Efl_Ui_Image_Data
EFL_UI_IMAGE_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -126,7 +127,7 @@ struct _Efl_Ui_Image_Data
EFL_UI_IMAGE_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/efl_ui_widget_pager.h b/src/lib/elementary/efl_ui_widget_pager.h
new file mode 100644
index 0000000000..d01cc29a5f
--- /dev/null
+++ b/src/lib/elementary/efl_ui_widget_pager.h
@@ -0,0 +1,69 @@
+#ifndef EFL_UI_WIDGET_PAGER_H
+#define EFL_UI_WIDGET_PAGER_H
+
+
+#include <Elementary.h>
+
+#include "efl_page_transition.h"
+
+typedef struct _Efl_Ui_Pager_Data
+{
+ Eina_List *page_infos;
+ Eina_List *content_list;
+
+ Efl_Ui_Box *page_box;
+ Eo *foreclip;
+ Eo *backclip;
+
+ Eo *page_root;
+ Eo *event;
+ Efl_Ui_Box *idbox;
+ Ecore_Job *job;
+ Ecore_Job *page_info_job;
+
+ Evas_Coord x, y, w, h;
+ Evas_Coord mouse_x, mouse_y;
+
+ struct {
+ Eina_Size2D sz;
+ Evas_Coord padding;
+ } page_spec;
+
+ struct {
+ Evas_Coord x, y;
+ int page;
+ double pos;
+ Eina_Bool enabled;
+ } down;
+
+ struct {
+ int page;
+ double pos;
+ } curr;
+
+ struct {
+ double src;
+ double delta;
+ double start_time;
+ Eina_Bool jump;
+ } change;
+
+ int cnt;
+ double mouse_up_time;
+
+ Efl_Ui_Pager_Loop loop;
+ Efl_Page_Transition *transition;
+ Efl_Page_Indicator *indicator;
+
+ Eina_Bool move_started : 1;
+ Eina_Bool prev_block : 1;
+ Eina_Bool next_block: 1;
+ Eina_Bool fill_width: 1;
+ Eina_Bool fill_height: 1;
+
+} Efl_Ui_Pager_Data;
+
+#define EFL_UI_PAGER_DATA_GET(o, sd) \
+ Efl_Ui_Pager_Data *sd = efl_data_scope_get(o, EFL_UI_PAGER_CLASS)
+
+#endif
diff --git a/src/lib/elementary/efl_ui_widget_part.eo b/src/lib/elementary/efl_ui_widget_part.eo
index 2ddceab417..ac3a2d9626 100644
--- a/src/lib/elementary/efl_ui_widget_part.eo
+++ b/src/lib/elementary/efl_ui_widget_part.eo
@@ -1,8 +1,8 @@
-class Efl.Ui.Widget.Part (Efl.Object)
+class Efl.Ui.Widget_Part (Efl.Object)
{
[[This is the base class for all "Part" handles in Efl.Ui widgets.
- Since objects of this type are returned by @Efl.Part.part, their lifetime
+ Since objects of this type are returned by @Efl.Part.part_get, their lifetime
is limited to exactly one function call only. Each widget class should
expose more specific types for their API-defined parts.
]]
diff --git a/src/lib/elementary/efl_ui_widget_part_bg.eo b/src/lib/elementary/efl_ui_widget_part_bg.eo
index be56ad1443..a058403a55 100644
--- a/src/lib/elementary/efl_ui_widget_part_bg.eo
+++ b/src/lib/elementary/efl_ui_widget_part_bg.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Widget.Part_Bg (Efl.Ui.Widget.Part, Efl.Gfx.Color, Efl.Ui.Bg)
+class Efl.Ui.Widget_Part_Bg (Efl.Ui.Widget_Part, Efl.Gfx.Color, Efl.Ui.Bg)
{
[[Elementary widget internal part background class]]
data: null;
@@ -6,6 +6,6 @@ class Efl.Ui.Widget.Part_Bg (Efl.Ui.Widget.Part, Efl.Gfx.Color, Efl.Ui.Bg)
Efl.File.file { get; set; }
//Efl.File.mmap { get; set; }
Efl.Gfx.Color.color { set; get; }
- Efl.Image.scale_type { get; set; }
+ Efl.Gfx.Image.scale_type { get; set; }
}
}
diff --git a/src/lib/elementary/efl_ui_widget_part_shadow.eo b/src/lib/elementary/efl_ui_widget_part_shadow.eo
index 8a73e458b8..970b93b2f9 100644
--- a/src/lib/elementary/efl_ui_widget_part_shadow.eo
+++ b/src/lib/elementary/efl_ui_widget_part_shadow.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Widget.Part_Shadow (Efl.Ui.Widget.Part, Efl.Gfx, Efl.Gfx.Color,
+class Efl.Ui.Widget_Part_Shadow (Efl.Ui.Widget_Part, Efl.Gfx.Entity, Efl.Gfx.Color,
Efl.Gfx.Blur, Efl.Gfx.Filter)
{
[[A drop-shadow or glow effect around any widget.
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 710285a559..c62559d1bd 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_COMPONENT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define EFL_INPUT_EVENT_PROTECTED
@@ -13,7 +13,9 @@
#define EFL_UI_WIN_INLINED_PROTECTED
#define EFL_UI_FOCUS_OBJECT_PROTECTED
#define EFL_UI_WIN_BETA
-#define EFL_CANVAS_BETA
+#define EFL_CANVAS_SCENE_BETA
+#define EFL_UI_WIDGET_FOCUS_MANAGER_PROTECTED
+#define EFL_PART_PROTECTED
#include <Elementary.h>
#include <Elementary_Cursor.h>
@@ -32,6 +34,9 @@
#include "elm_part_helper.h"
#include "efl_ui_win_part.eo.h"
#include "elm_plug.eo.h"
+#include "efl_ui_win_legacy.eo.h"
+#include "efl_ui_win_socket_legacy.eo.h"
+#include "efl_ui_win_inlined_legacy.eo.h"
#define MY_CLASS EFL_UI_WIN_CLASS
#define MY_CLASS_NAME "Efl.Ui.Win"
@@ -61,7 +66,7 @@ static int _paused_windows = 0;
ELM_WIN_DATA_GET(o, ptr); \
if (!ptr) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, efl_class_name_get(o)); \
return __VA_ARGS__; \
}
@@ -94,6 +99,7 @@ struct _Efl_Ui_Win_Data
Ecore_X_Window xwin;
Ecore_Event_Handler *client_message_handler;
Ecore_Event_Handler *property_handler;
+ Eina_Bool shaped : 1;
} x;
#endif
#ifdef HAVE_ELEMENTARY_WL2
@@ -101,7 +107,6 @@ struct _Efl_Ui_Win_Data
{
Ecore_Wl2_Window *win;
Ecore_Event_Handler *configure_handler;
- Eina_Bool opaque_dirty : 1;
} wl;
#endif
#ifdef HAVE_ELEMENTARY_COCOA
@@ -117,7 +122,7 @@ struct _Efl_Ui_Win_Data
} win32;
#endif
- Efl_Ui_Win_Type type;
+ unsigned /* Efl_Ui_Win_Type */ type;
Efl_Ui_Win_Keyboard_Mode kbdmode;
Efl_Ui_Win_Indicator_Mode indimode;
struct
@@ -139,7 +144,7 @@ struct _Efl_Ui_Win_Data
struct wl_surface *surf;
#endif
Ecore_Evas *ee;
- Evas_Object *obj, *hot_obj;
+ Evas_Object *obj;
int hot_x, hot_y;
Eina_Bool visible : 1;
} pointer;
@@ -176,9 +181,10 @@ struct _Efl_Ui_Win_Data
Eina_Stringshare *name;
Eina_Stringshare *accel_pref;
+ Eina_Future *finalize_future;
+
Evas_Object *main_menu;
- Efl_Ui_Focus_Manager *manager;
Efl_Ui_Focus_Parent_Provider_Standard *provider;
struct
@@ -371,8 +377,7 @@ static void _elm_win_frame_add(Efl_Ui_Win_Data *sd, const char *element, const c
static void _elm_win_frame_style_update(Efl_Ui_Win_Data *sd, Eina_Bool force_emit, Eina_Bool calc);
static inline void _elm_win_need_frame_adjust(Efl_Ui_Win_Data *sd, const char *engine);
static void _elm_win_resize_objects_eval(Evas_Object *obj, Eina_Bool force_resize);
-static void _elm_win_opaque_update(Efl_Ui_Win_Data *sd, Eina_Bool force_alpha);
-static void _elm_win_frame_obj_update(Efl_Ui_Win_Data *sd);
+static void _elm_win_frame_obj_update(Efl_Ui_Win_Data *sd, Eina_Bool force);
#ifdef HAVE_ELEMENTARY_X
static void _elm_win_xwin_update(Efl_Ui_Win_Data *sd);
@@ -440,14 +445,13 @@ elm_process_state_get(void)
}
static void
-_elm_win_apply_alpha(Eo *obj, Efl_Ui_Win_Data *sd)
+_elm_win_apply_alpha(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
Eina_Bool enabled;
if (!sd->ee) return;
enabled = sd->theme_alpha | sd->application_alpha;
- _elm_win_opaque_update(sd, EINA_TRUE);
if (sd->img_obj)
{
evas_object_image_alpha_set(sd->img_obj, enabled);
@@ -459,16 +463,13 @@ _elm_win_apply_alpha(Eo *obj, Efl_Ui_Win_Data *sd)
if (sd->x.xwin)
{
enabled |= (sd->csd.need && !sd->fullscreen);
- if (enabled)
+ if (!ecore_x_screen_is_composited(0))
{
- if (!ecore_x_screen_is_composited(0))
- elm_win_shaped_set(obj, enabled);
- else
- TRAP(sd, alpha_set, enabled);
+ if (enabled || (!sd->x.shaped))
+ TRAP(sd, shaped_set, enabled);
}
else
TRAP(sd, alpha_set, enabled);
- _elm_win_xwin_update(sd);
}
else
#else
@@ -478,6 +479,39 @@ _elm_win_apply_alpha(Eo *obj, Efl_Ui_Win_Data *sd)
}
}
+/* auto norender withdrawn is really only for X11.
+ * On other backends like wayland, there's actually
+ * no way for a client to tell if the window is
+ * iconified or not. You can request iconified state
+ * but there's no explicit feedback for iconification
+ * or return to normal state.
+ *
+ * So, blocking drawing based on client side thinking
+ * it's iconified, and having the compositor think
+ * the client should be drawing will lead to
+ * predictably disappointing results.
+ *
+ * If you maintain a backend that is really capable
+ * of handling this properly, feel free to extend
+ * the whitelist.
+ */
+static Eina_Bool
+_elm_win_auto_norender_withdrawn(const Evas_Object *obj)
+{
+ const char *engine;
+ Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
+
+ if (!sd)
+ return _elm_config->auto_norender_withdrawn;
+
+ engine = ecore_evas_engine_name_get(sd->ee);
+ if (!strcmp(engine, ELM_SOFTWARE_X11) || !strcmp(engine, ELM_OPENGL_X11))
+ return _elm_config->auto_norender_withdrawn;
+
+ return EINA_FALSE;
+}
+
+
static Eina_Bool
_elm_win_state_eval(void *data EINA_UNUSED)
{
@@ -492,7 +526,7 @@ _elm_win_state_eval(void *data EINA_UNUSED)
EINA_LIST_FOREACH(_elm_win_list, l, obj)
{
- if (_elm_config->auto_norender_withdrawn)
+ if (_elm_win_auto_norender_withdrawn(obj))
{
if ((elm_win_withdrawn_get(obj)) ||
((elm_win_iconified_get(obj) &&
@@ -582,12 +616,6 @@ _elm_win_state_eval(void *data EINA_UNUSED)
static Eina_Bool
_elm_win_policy_quit_triggered(Eo* triggering_obj)
{
- if ((!_elm_win_list) &&
- (elm_policy_get(ELM_POLICY_QUIT) == ELM_POLICY_QUIT_LAST_WINDOW_CLOSED))
- {
- return EINA_TRUE;
- }
-
if (elm_policy_get(ELM_POLICY_QUIT) == ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN)
{
Eina_List *l;
@@ -902,7 +930,7 @@ _elm_win_move(Ecore_Evas *ee)
ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
sd->screen.x = x;
sd->screen.y = y;
- efl_event_callback_legacy_call(sd->obj, EFL_GFX_EVENT_MOVE, NULL);
+ efl_event_callback_legacy_call(sd->obj, EFL_GFX_ENTITY_EVENT_MOVE, NULL);
ELM_WIN_DATA_ALIVE_CHECK(obj, sd);
evas_nochange_push(evas_object_evas_get(sd->obj));
sd->response++;
@@ -937,14 +965,12 @@ _elm_win_resize_job(void *data)
evas_object_move(sd->frame_obj, -fx, -fy);
evas_object_resize(sd->frame_obj, w + fw, h + fh);
}
- else
- _elm_win_opaque_update(sd, 0);
if (sd->main_menu)
{
Eina_Position2D pos;
- pos = efl_gfx_position_get(sd->main_menu);
+ pos = efl_gfx_entity_position_get(sd->main_menu);
elm_menu_move(sd->main_menu, pos.x, pos.y);
}
@@ -967,12 +993,43 @@ _elm_win_pre_render(Ecore_Evas *ee)
_elm_win_throttle_ok = EINA_TRUE;
if (!sd->first_draw)
{
- sd->first_draw = EINA_TRUE;
- _elm_win_frame_obj_update(sd);
+ int mw, mh;
+
+ edje_object_thaw(sd->frame_obj);
+ evas_object_show(sd->frame_obj);
+ _elm_win_frame_style_update(sd, 1, 1);
ELM_WIN_DATA_ALIVE_CHECK(obj, sd);
+
+ /* set this to handle ecore-evas engine code which incorrectly
+ * assumes that a client resize call is the same as a server resize
+ * event, or which has no server event
+ */
+ sd->deferred_resize_job = EINA_TRUE;
+
+ if (sd->frame_obj)
+ {
+ /* force initial sizing on frame to enable sizing of content */
+ edje_object_size_min_calc(sd->frame_obj, &mw, &mh);
+ evas_object_resize(sd->frame_obj, mw, mh);
+ }
+
+ if (sd->img_obj)
+ {
+ evas_object_show(sd->img_obj);
+ }
+ if (sd->pointer.obj) evas_object_show(sd->pointer.obj);
+#ifdef ELEMENTARY_X
+ if (sd->type == ELM_WIN_TOOLTIP)
+ ecore_x_window_shape_input_rectangle_set(sd->x.xwin, 0, 0, 0, 0);
+#endif
+ sd->first_draw = EINA_TRUE;
+ if (sd->shot.info) _shot_handle(sd);
}
if (sd->deferred_resize_job)
- _elm_win_resize_job(sd->obj);
+ {
+ _elm_win_resize_job(sd->obj);
+ _elm_win_frame_obj_update(sd, 1);
+ }
}
static void
@@ -999,7 +1056,6 @@ _elm_win_mouse_in(Ecore_Evas *ee)
sd->pointer.surf = ecore_wl2_window_surface_get(sd->pointer.win);
_elm_win_wl_cursor_set(sd->obj, NULL);
//ELM_WIN_DATA_ALIVE_CHECK(obj, sd);
- ecore_evas_show(sd->pointer.ee);
}
#endif
}
@@ -1032,11 +1088,17 @@ _elm_win_focus_highlight_visible_set(Efl_Ui_Win_Data *sd,
if (visible)
{
evas_object_show(fobj);
- edje_object_signal_emit(fobj, "elm,action,focus,show", "elm");
+ if (elm_widget_is_legacy(sd->obj))
+ edje_object_signal_emit(fobj, "elm,action,focus,show", "elm");
+ else
+ edje_object_signal_emit(fobj, "efl,action,focus,show", "efl");
}
else
{
- edje_object_signal_emit(fobj, "elm,action,focus,hide", "elm");
+ if (elm_widget_is_legacy(sd->obj))
+ edje_object_signal_emit(fobj, "elm,action,focus,hide", "elm");
+ else
+ edje_object_signal_emit(fobj, "efl,action,focus,hide", "efl");
}
}
@@ -1056,9 +1118,9 @@ _elm_win_focus_highlight_anim_setup(Efl_Ui_Win_Data *sd,
Edje_Message_Int_Set *m;
Evas_Object *target = sd->focus_highlight.cur.target;
- rp = efl_gfx_geometry_get(obj);
+ rp = efl_gfx_entity_geometry_get(obj);
rt = elm_widget_focus_highlight_geometry_get(target);
- efl_gfx_geometry_set(obj, rt);
+ efl_gfx_entity_geometry_set(obj, rt);
if (eina_rectangle_equal(&rp.rect, &rt.rect)) return;
@@ -1084,7 +1146,7 @@ _elm_win_focus_highlight_simple_setup(Efl_Ui_Win_Data *sd,
{
Evas_Object *clip, *target = sd->focus_highlight.cur.target;
- efl_gfx_geometry_set(obj, elm_widget_focus_highlight_geometry_get(target));
+ efl_gfx_entity_geometry_set(obj, elm_widget_focus_highlight_geometry_get(target));
if (!_elm_config->focus_highlight_clip_disable)
{
@@ -1092,7 +1154,10 @@ _elm_win_focus_highlight_simple_setup(Efl_Ui_Win_Data *sd,
if (clip) evas_object_clip_set(obj, clip);
}
- edje_object_signal_emit(obj, "elm,state,anim,stop", "elm");
+ if (elm_widget_is_legacy(sd->obj))
+ edje_object_signal_emit(obj, "elm,state,anim,stop", "elm");
+ else
+ edje_object_signal_emit(obj, "efl,state,anim,stop", "efl");
}
static void
@@ -1133,8 +1198,14 @@ _elm_win_focus_highlight_reconfigure_job(void *data)
evas_object_event_callback_del_full
(previous, EVAS_CALLBACK_DEL, _elm_win_focus_prev_target_del, data);
if (sd->focus_highlight.prev.in_theme)
- elm_widget_signal_emit
- (previous, "elm,action,focus_highlight,hide", "elm");
+ {
+ if (elm_widget_is_legacy(sd->obj))
+ elm_widget_signal_emit
+ (previous, "elm,action,focus_highlight,hide", "elm");
+ else
+ elm_widget_signal_emit
+ (previous, "efl,action,focus_highlight,hide", "efl");
+ }
}
if (!target)
@@ -1142,16 +1213,32 @@ _elm_win_focus_highlight_reconfigure_job(void *data)
else if (sd->focus_highlight.cur.in_theme)
{
common_visible = EINA_FALSE;
- if (sd->focus_highlight.cur.visible)
- sig = "elm,action,focus_highlight,show";
+
+ if (elm_widget_is_legacy(sd->obj))
+ {
+ if (sd->focus_highlight.cur.visible)
+ sig = "elm,action,focus_highlight,show";
+ else
+ sig = "elm,action,focus_highlight,hide";
+ }
else
- sig = "elm,action,focus_highlight,hide";
+ {
+ if (sd->focus_highlight.cur.visible)
+ sig = "efl,action,focus_highlight,show";
+ else
+ sig = "efl,action,focus_highlight,hide";
+ }
}
else
common_visible = sd->focus_highlight.cur.visible;
if (sig)
- elm_widget_signal_emit(target, sig, "elm");
+ {
+ if (elm_widget_is_legacy(sd->obj))
+ elm_widget_signal_emit(target, sig, "elm");
+ else
+ elm_widget_signal_emit(target, sig, "efl");
+ }
if ((!target) || (!common_visible) || (sd->focus_highlight.cur.in_theme))
{
@@ -1239,10 +1326,12 @@ _elm_win_focus_in(Ecore_Evas *ee)
}
Evas_Object *focused = efl_ui_focus_manager_focus_get(man);
- efl_ui_focus_object_focus_set(focused, EINA_TRUE);
+ if (focused)
+ efl_ui_focus_object_focus_set(focused, EINA_TRUE);
}
evas_object_smart_callback_call(obj, SIG_FOCUS_IN, NULL);
+ evas_object_smart_callback_call(obj, SIG_WIDGET_FOCUSED, NULL);
ELM_WIN_DATA_ALIVE_CHECK(obj, sd);
sd->focus_highlight.cur.visible = EINA_TRUE;
_elm_win_focus_highlight_reconfigure_job_start(sd);
@@ -1258,6 +1347,18 @@ _elm_win_focus_in(Ecore_Evas *ee)
/* else if (sd->img_obj) */
/* { */
/* } */
+ if ((!efl_ui_focus_manager_focus_get(sd->obj)) &&
+ (!efl_ui_focus_manager_redirect_get(sd->obj)))
+ {
+ Efl_Ui_Focus_Object *child;
+
+ child = efl_ui_focus_manager_request_subchild(sd->obj, sd->obj);
+
+ if (child)
+ efl_ui_focus_manager_focus_set(sd->obj, sd->obj);
+ else if (!evas_focus_get(evas_object_evas_get(sd->obj)))
+ evas_object_focus_set(obj, EINA_TRUE);
+ }
}
static void
@@ -1273,6 +1374,7 @@ _elm_win_focus_out(Ecore_Evas *ee)
_elm_widget_top_win_focused_set(obj, EINA_FALSE);
ELM_WIN_DATA_ALIVE_CHECK(obj, sd);
evas_object_smart_callback_call(obj, SIG_FOCUS_OUT, NULL);
+ evas_object_smart_callback_call(obj, SIG_WIDGET_UNFOCUSED, NULL);
ELM_WIN_DATA_ALIVE_CHECK(obj, sd);
sd->focus_highlight.cur.visible = EINA_FALSE;
_elm_win_focus_highlight_reconfigure_job_start(sd);
@@ -1391,70 +1493,6 @@ _elm_win_profile_update(Efl_Ui_Win_Data *sd)
}
static inline void
-_elm_win_opaque_dirty(Efl_Ui_Win_Data *sd)
-{
-#ifdef HAVE_ELEMENTARY_WL2
- sd->wl.opaque_dirty = 1;
-#else
- (void)sd;
-#endif
-}
-
-static void
-_elm_win_opaque_update(Efl_Ui_Win_Data *sd, Eina_Bool force_alpha)
-{
-#ifdef HAVE_ELEMENTARY_WL2
- int ox, oy, ow, oh;
- Eina_Bool alpha;
- Ecore_Evas_Engine_Wl_Data *wdata;
- const char *engine_name;
-
- if (!sd->wl.win) return;
- if (!sd->shown) return;
-
- /* If this isn't a wayland window, BAIL now to avoid destroying
- * non-wayland engine data structures...
- */
- engine_name = ecore_evas_engine_name_get(sd->ee);
- if (strncmp(engine_name, "wayland", sizeof("wayland") - 1)) return;
-
- wdata = sd->ee->engine.data;
- alpha = ecore_evas_alpha_get(sd->ee) || force_alpha;
- if (sd->fullscreen || !sd->frame_obj)
- {
- ecore_evas_geometry_get(sd->ee, NULL, NULL, &ow, &oh);
- if (!alpha)
- ecore_wl2_window_opaque_region_set(sd->wl.win, 0, 0, ow, oh);
- else
- ecore_wl2_window_opaque_region_set(sd->wl.win, 0, 0, 0, 0);
- wdata->content.x = wdata->content.y = 0;
- wdata->content.w = ow;
- wdata->content.h = oh;
- ecore_wl2_window_geometry_set(sd->wl.win, 0, 0, ow, oh);
- ecore_wl2_window_input_region_set(sd->wl.win, 0, 0, ow, oh);
- return;
- }
-
- edje_object_part_geometry_get(sd->frame_obj, "elm.spacer.opaque",
- &ox, &oy, &ow, &oh);
- edje_object_part_geometry_get(sd->frame_obj, "elm.swallow.client",
- &wdata->content.x, &wdata->content.y,
- &wdata->content.w, &wdata->content.h);
- if (!alpha)
- ecore_wl2_window_opaque_region_set(sd->wl.win, ox, oy, ow, oh);
- else
- ecore_wl2_window_opaque_region_set(sd->wl.win, 0, 0, 0, 0);
-
- /* FIXME: Replace with call to ecore_evas_shadow_geometry_set(). */
- ecore_wl2_window_geometry_set(sd->wl.win, ox, oy, ow, oh);
- ecore_wl2_window_input_region_set(sd->wl.win, ox, oy, ow, oh);
-#else
- (void)sd;
- (void)force_alpha;
-#endif
-}
-
-static inline void
_elm_win_frame_geometry_adjust(Efl_Ui_Win_Data *sd)
{
int l = 0, t = 0, r = 0, b = 0;
@@ -1463,8 +1501,12 @@ _elm_win_frame_geometry_adjust(Efl_Ui_Win_Data *sd)
{
int fw, fh, ox, oy, ow, oh;
evas_object_geometry_get(sd->frame_obj, NULL, NULL, &fw, &fh);
- edje_object_part_geometry_get(sd->frame_obj, "elm.spacer.opaque",
- &ox, &oy, &ow, &oh);
+ if (elm_widget_is_legacy(sd->obj))
+ edje_object_part_geometry_get(sd->frame_obj, "elm.spacer.opaque",
+ &ox, &oy, &ow, &oh);
+ else
+ edje_object_part_geometry_get(sd->frame_obj, "efl.spacer.opaque",
+ &ox, &oy, &ow, &oh);
l = ox;
t = oy;
r = fw - ow - l;
@@ -1486,21 +1528,28 @@ _elm_win_framespace_set(Efl_Ui_Win_Data *sd, int x, int y, int w, int h)
}
static void
-_elm_win_frame_obj_update(Efl_Ui_Win_Data *sd)
+_elm_win_frame_obj_update(Efl_Ui_Win_Data *sd, Eina_Bool force)
{
int ox, oy, ow, oh;
int cx, cy, cw, ch;
int w, h;
if (!sd->frame_obj) return;
- _elm_win_opaque_dirty(sd);
_elm_win_frame_geometry_adjust(sd);
evas_object_geometry_get(sd->frame_obj, &ox, &oy, &ow, &oh);
- edje_object_part_geometry_get(sd->frame_obj, "elm.spacer.content", &cx, &cy, &cw, &ch);
- if (!_elm_win_framespace_set(sd, cx, cy, ow - cw, oh - ch)) return;
+ if (elm_widget_is_legacy(sd->obj))
+ edje_object_part_geometry_get(sd->frame_obj, "elm.spacer.content", &cx, &cy, &cw, &ch);
+ else
+ edje_object_part_geometry_get(sd->frame_obj, "efl.spacer.content", &cx, &cy, &cw, &ch);
+
+ if (!_elm_win_framespace_set(sd, cx, cy, ow - cw, oh - ch) && (!force)) return;
_elm_win_frame_geometry_adjust(sd);
- evas_object_geometry_get(sd->obj, NULL, NULL, &w, &h);
- TRAP(sd, resize, w, h);
+ if (sd->first_draw)
+ evas_object_geometry_get(sd->obj, NULL, NULL, &w, &h);
+ else
+ w = ow, h = oh;
+ if (w && h)
+ TRAP(sd, resize, w, h);
}
static void
@@ -1603,7 +1652,6 @@ _elm_win_state_change(Ecore_Evas *ee)
_elm_win_frame_style_update(sd, 0, 1);
if (sd->fullscreen)
{
- _elm_win_opaque_dirty(sd);
efl_event_callback_legacy_call
(obj, EFL_UI_WIN_EVENT_FULLSCREEN, NULL);
}
@@ -1666,9 +1714,9 @@ _elm_win_state_change(Ecore_Evas *ee)
}
EOLIAN static Eina_Bool
-_efl_ui_win_elm_widget_on_focus_update(Eo *obj, Efl_Ui_Win_Data *sd, Elm_Object_Item *item EINA_UNUSED)
+_efl_ui_win_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Win_Data *sd)
{
- if (!efl_ui_widget_on_focus_update(efl_super(obj, MY_CLASS), NULL))
+ if (!efl_ui_focus_object_on_focus_update(efl_super(obj, MY_CLASS)))
return EINA_TRUE;
if (sd->img_obj)
@@ -1693,7 +1741,6 @@ _key_action_move(Evas_Object *obj, const char *params)
_elm_widget_focus_auto_show(obj);
Efl_Ui_Focus_Direction focus_dir;
- Efl_Ui_Focus_Object *o;
if (!strcmp(dir, "previous"))
focus_dir = EFL_UI_FOCUS_DIRECTION_PREVIOUS;
@@ -1709,18 +1756,27 @@ _key_action_move(Evas_Object *obj, const char *params)
focus_dir = EFL_UI_FOCUS_DIRECTION_DOWN;
else return EINA_FALSE;
- o = efl_ui_focus_manager_move(obj, focus_dir);
- if (!o)
- {
- if (focus_dir == EFL_UI_FOCUS_DIRECTION_NEXT || focus_dir == EFL_UI_FOCUS_DIRECTION_PREVIOUS)
- {
- Efl_Ui_Focus_Object *root;
+ // The handling for legacy is different due to elm_object_next set
+ if (elm_widget_is_legacy(obj))
+ elm_object_focus_next(obj, focus_dir);
+ else
+ {
+ Efl_Ui_Widget *o;
+
+ o = efl_ui_focus_manager_move(obj, focus_dir);
+ if (!o)
+ {
+ if (focus_dir == EFL_UI_FOCUS_DIRECTION_NEXT || focus_dir == EFL_UI_FOCUS_DIRECTION_PREVIOUS)
+ {
+ Efl_Ui_Focus_Object *root;
+
+ root = efl_ui_focus_manager_root_get(obj);
+ efl_ui_focus_manager_setup_on_first_touch(obj, focus_dir, root);
+ }
+ }
+ }
- root = efl_ui_focus_manager_root_get(obj);
- efl_ui_focus_manager_setup_on_first_touch(obj, focus_dir, root);
- }
- }
return EINA_TRUE;
}
@@ -1820,7 +1876,7 @@ _elm_win_evas_render_post(void *data,
Efl_Gfx_Event_Render_Post *ev = event_info;
Eo *win = data;
- efl_event_callback_legacy_call(win, EFL_CANVAS_EVENT_RENDER_POST, ev);
+ efl_event_callback_legacy_call(win, EFL_CANVAS_SCENE_EVENT_RENDER_POST, ev);
}
static void
@@ -1831,7 +1887,7 @@ _elm_win_evas_render_pre(void *data,
Eo *win = data;
_elm_win_throttle_ok = EINA_TRUE;
- efl_event_callback_legacy_call(win, EFL_CANVAS_EVENT_RENDER_PRE, NULL);
+ efl_event_callback_legacy_call(win, EFL_CANVAS_SCENE_EVENT_RENDER_PRE, NULL);
}
static void
@@ -1842,7 +1898,7 @@ _elm_win_evas_focus_in(void *data,
Eo *win = data;
_elm_win_throttle_ok = EINA_TRUE;
- efl_event_callback_legacy_call(win, EFL_CANVAS_EVENT_FOCUS_IN, NULL);
+ efl_event_callback_legacy_call(win, EFL_CANVAS_SCENE_EVENT_FOCUS_IN, NULL);
}
static void
@@ -1852,7 +1908,7 @@ _elm_win_evas_focus_out(void *data,
{
Eo *win = data;
- efl_event_callback_legacy_call(win, EFL_CANVAS_EVENT_FOCUS_OUT, NULL);
+ efl_event_callback_legacy_call(win, EFL_CANVAS_SCENE_EVENT_FOCUS_OUT, NULL);
}
static void
@@ -1864,7 +1920,7 @@ _elm_win_evas_object_focus_in(void *data,
Eo *win = data;
_elm_win_throttle_ok = EINA_TRUE;
- efl_event_callback_legacy_call(win, EFL_CANVAS_EVENT_OBJECT_FOCUS_IN, object);
+ efl_event_callback_legacy_call(win, EFL_CANVAS_SCENE_EVENT_OBJECT_FOCUS_IN, object);
}
static void
@@ -1875,7 +1931,7 @@ _elm_win_evas_object_focus_out(void *data,
Eo *object = event_info;
Eo *win = data;
- efl_event_callback_legacy_call(win, EFL_CANVAS_EVENT_OBJECT_FOCUS_OUT, object);
+ efl_event_callback_legacy_call(win, EFL_CANVAS_SCENE_EVENT_OBJECT_FOCUS_OUT, object);
}
static void
@@ -1886,13 +1942,13 @@ _elm_win_evas_device_changed(void *data,
Eo *device = event_info;
Eo *win = data;
- efl_event_callback_legacy_call(win, EFL_CANVAS_EVENT_DEVICE_CHANGED, device);
+ efl_event_callback_legacy_call(win, EFL_CANVAS_SCENE_EVENT_DEVICE_CHANGED, device);
}
static void
_win_event_add_cb(void *data, const Efl_Event *ev)
{
- const Efl_Callback_Array_Item *array = ev->info;
+ const Efl_Callback_Array_Item_Full *array = ev->info;
Efl_Ui_Win_Data *sd = data;
Efl_Ui_Win *win = ev->object;
int i;
@@ -1975,43 +2031,43 @@ _win_event_add_cb(void *data, const Efl_Event *ev)
efl_event_callback_add(sd->evas, array[i].desc,
_evas_event_key_cb, win);
}
- else if (array[i].desc == EFL_CANVAS_EVENT_RENDER_POST)
+ else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_RENDER_POST)
{
if (!(sd->event_forward.render_post++))
evas_event_callback_add(sd->evas, EVAS_CALLBACK_RENDER_POST,
_elm_win_evas_render_post, win);
}
- else if (array[i].desc == EFL_CANVAS_EVENT_RENDER_PRE)
+ else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_RENDER_PRE)
{
if (!(sd->event_forward.render_pre++))
evas_event_callback_add(sd->evas, EVAS_CALLBACK_RENDER_PRE,
_elm_win_evas_render_pre, win);
}
- else if (array[i].desc == EFL_CANVAS_EVENT_FOCUS_IN)
+ else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_FOCUS_IN)
{
if (!(sd->event_forward.focus_in++))
evas_event_callback_add(sd->evas, EVAS_CALLBACK_FOCUS_IN,
_elm_win_evas_focus_in, win);
}
- else if (array[i].desc == EFL_CANVAS_EVENT_FOCUS_OUT)
+ else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_FOCUS_OUT)
{
if (!(sd->event_forward.focus_out++))
evas_event_callback_add(sd->evas, EVAS_CALLBACK_FOCUS_OUT,
_elm_win_evas_focus_out, win);
}
- else if (array[i].desc == EFL_CANVAS_EVENT_OBJECT_FOCUS_IN)
+ else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_OBJECT_FOCUS_IN)
{
if (!(sd->event_forward.object_focus_in++))
evas_event_callback_add(sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
_elm_win_evas_object_focus_in, win);
}
- else if (array[i].desc == EFL_CANVAS_EVENT_OBJECT_FOCUS_OUT)
+ else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_OBJECT_FOCUS_OUT)
{
if (!(sd->event_forward.object_focus_out++))
evas_event_callback_add(sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
_elm_win_evas_object_focus_out, win);
}
- else if (array[i].desc == EFL_CANVAS_EVENT_DEVICE_CHANGED)
+ else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_DEVICE_CHANGED)
{
if (!(sd->event_forward.device_changed++))
evas_event_callback_add(sd->evas, EVAS_CALLBACK_DEVICE_CHANGED,
@@ -2023,7 +2079,7 @@ _win_event_add_cb(void *data, const Efl_Event *ev)
static void
_win_event_del_cb(void *data, const Efl_Event *ev)
{
- const Efl_Callback_Array_Item *array = ev->info;
+ const Efl_Callback_Array_Item_Full *array = ev->info;
Efl_Ui_Win_Data *sd = data;
Efl_Ui_Win *win = ev->object;
int i;
@@ -2106,43 +2162,43 @@ _win_event_del_cb(void *data, const Efl_Event *ev)
efl_event_callback_del(sd->evas, array[i].desc,
_evas_event_key_cb, win);
}
- else if (array[i].desc == EFL_CANVAS_EVENT_RENDER_POST)
+ else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_RENDER_POST)
{
if (!(--sd->event_forward.render_post))
evas_event_callback_del_full(sd->evas, EVAS_CALLBACK_RENDER_POST,
_elm_win_evas_render_post, win);
}
- else if (array[i].desc == EFL_CANVAS_EVENT_RENDER_PRE)
+ else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_RENDER_PRE)
{
if (!(--sd->event_forward.render_pre))
evas_event_callback_del_full(sd->evas, EVAS_CALLBACK_RENDER_PRE,
_elm_win_evas_render_pre, win);
}
- else if (array[i].desc == EFL_CANVAS_EVENT_FOCUS_IN)
+ else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_FOCUS_IN)
{
if (!(--sd->event_forward.focus_in))
evas_event_callback_del_full(sd->evas, EVAS_CALLBACK_FOCUS_IN,
_elm_win_evas_focus_in, win);
}
- else if (array[i].desc == EFL_CANVAS_EVENT_FOCUS_OUT)
+ else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_FOCUS_OUT)
{
if (!(--sd->event_forward.focus_out))
evas_event_callback_del_full(sd->evas, EVAS_CALLBACK_FOCUS_OUT,
_elm_win_evas_focus_out, win);
}
- else if (array[i].desc == EFL_CANVAS_EVENT_OBJECT_FOCUS_IN)
+ else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_OBJECT_FOCUS_IN)
{
if (!(--sd->event_forward.object_focus_in))
evas_event_callback_del_full(sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
_elm_win_evas_object_focus_in, win);
}
- else if (array[i].desc == EFL_CANVAS_EVENT_OBJECT_FOCUS_OUT)
+ else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_OBJECT_FOCUS_OUT)
{
if (!(--sd->event_forward.object_focus_out))
evas_event_callback_del_full(sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
_elm_win_evas_object_focus_out, win);
}
- else if (array[i].desc == EFL_CANVAS_EVENT_DEVICE_CHANGED)
+ else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_DEVICE_CHANGED)
{
if (!(--sd->event_forward.device_changed))
evas_event_callback_del_full(sd->evas, EVAS_CALLBACK_DEVICE_CHANGED,
@@ -2165,7 +2221,7 @@ _win_paused(void *data, const Efl_Event *ev)
_paused_windows++;
if (_elm_win_count == _paused_windows)
- efl_event_callback_call(efl_loop_get(ev->object), EFL_LOOP_EVENT_PAUSE, NULL);
+ efl_event_callback_call(efl_loop_get(ev->object), EFL_APP_EVENT_PAUSE, NULL);
}
EFL_CALLBACKS_ARRAY_DEFINE(_elm_win_tracking,
@@ -2193,14 +2249,14 @@ _elm_win_resume(void *data, const Efl_Event *ev)
sd->paused = EINA_FALSE;
if (_elm_win_count == _paused_windows)
- efl_event_callback_call(efl_loop_get(ev->object), EFL_LOOP_EVENT_RESUME, NULL);
+ efl_event_callback_call(efl_loop_get(ev->object), EFL_APP_EVENT_RESUME, NULL);
_paused_windows--;
}
EFL_CALLBACKS_ARRAY_DEFINE(_elm_evas_tracking,
{ EFL_EVENT_POINTER_UP, _elm_win_cb_mouse_up },
- { EFL_CANVAS_EVENT_RENDER_PRE, _elm_win_resume })
+ { EFL_CANVAS_SCENE_EVENT_RENDER_PRE, _elm_win_resume })
static void
_deferred_ecore_evas_free(void *data)
@@ -2228,6 +2284,7 @@ _elm_win_modality_increment(Efl_Ui_Win_Data *modalsd)
{
Efl_Ui_Win *current;
Eina_List *l;
+ Eina_Bool is_legacy = elm_widget_is_legacy(modalsd->obj);
EINA_LIST_FOREACH(_elm_win_list, l, current)
{
@@ -2237,7 +2294,10 @@ _elm_win_modality_increment(Efl_Ui_Win_Data *modalsd)
if (cursd->modal_count > 0)
{
Edje_Object *ed = _elm_win_modal_blocker_edje_get(cursd);
- edje_object_signal_emit(ed, "elm,action,show_blocker", "elm");
+ if (is_legacy)
+ edje_object_signal_emit(ed, "elm,action,show_blocker", "elm");
+ else
+ edje_object_signal_emit(ed, "efl,action,show_blocker", "efl");
efl_event_callback_legacy_call
(cursd->main_menu, EFL_UI_WIN_EVENT_ELM_ACTION_BLOCK_MENU, NULL);
_elm_win_frame_style_update(cursd, 0, 1);
@@ -2250,6 +2310,7 @@ _elm_win_modality_decrement(Efl_Ui_Win_Data *modalsd)
{
Efl_Ui_Win *current;
Eina_List *l;
+ Eina_Bool is_legacy = elm_widget_is_legacy(modalsd->obj);
EINA_LIST_FOREACH(_elm_win_list, l, current)
{
@@ -2259,7 +2320,10 @@ _elm_win_modality_decrement(Efl_Ui_Win_Data *modalsd)
if (cursd->modal_count == 0)
{
Edje_Object *ed = _elm_win_modal_blocker_edje_get(cursd);
- edje_object_signal_emit(ed, "elm,action,hide_blocker", "elm");
+ if (is_legacy)
+ edje_object_signal_emit(ed, "elm,action,hide_blocker", "elm");
+ else
+ edje_object_signal_emit(ed, "efl,action,hide_blocker", "efl");
efl_event_callback_legacy_call
(cursd->main_menu, ELM_MENU_EVENT_ELM_ACTION_UNBLOCK_MENU, NULL);
_elm_win_frame_style_update(cursd, 0, 1);
@@ -2279,7 +2343,7 @@ _efl_ui_win_show(Eo *obj, Efl_Ui_Win_Data *sd)
* Ugly code flow: legacy code had an early return in smart_show, ie.
* evas object show would be processed but smart object show would be
* aborted. This super call tries to simulate that. */
- efl_gfx_visible_set(efl_super(obj, EFL_CANVAS_GROUP_CLASS), EINA_TRUE);
+ efl_gfx_entity_visible_set(efl_super(obj, EFL_CANVAS_GROUP_CLASS), EINA_TRUE);
return;
}
@@ -2287,7 +2351,7 @@ _efl_ui_win_show(Eo *obj, Efl_Ui_Win_Data *sd)
_elm_win_modality_increment(sd);
if (!evas_object_visible_get(obj)) do_eval = EINA_TRUE;
- efl_gfx_visible_set(efl_super(obj, MY_CLASS), EINA_TRUE);
+ efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), EINA_TRUE);
if (sd->deferred_resize_job)
_elm_win_resize_job(sd->obj);
@@ -2299,7 +2363,7 @@ _efl_ui_win_show(Eo *obj, Efl_Ui_Win_Data *sd)
{
Eo *root;
efl_access_window_created_signal_emit(obj);
- root = efl_access_root_get(EFL_ACCESS_MIXIN);
+ root = efl_access_object_access_root_get(EFL_ACCESS_OBJECT_MIXIN);
if (root)
efl_access_children_changed_added_signal_emit(root, obj);
}
@@ -2313,7 +2377,6 @@ _efl_ui_win_show(Eo *obj, Efl_Ui_Win_Data *sd)
}
_elm_win_state_eval(NULL);
}
- if (sd->shot.info) _shot_handle(sd);
}
static void
@@ -2325,7 +2388,7 @@ _efl_ui_win_hide(Eo *obj, Efl_Ui_Win_Data *sd)
* Ugly code flow: legacy code had an early return in smart_show, ie.
* evas object show would be processed but smart object show would be
* aborted. This super call tries to simulate that. */
- efl_gfx_visible_set(efl_super(obj, EFL_CANVAS_GROUP_CLASS), EINA_FALSE);
+ efl_gfx_entity_visible_set(efl_super(obj, EFL_CANVAS_GROUP_CLASS), EINA_FALSE);
return;
}
@@ -2334,7 +2397,7 @@ _efl_ui_win_hide(Eo *obj, Efl_Ui_Win_Data *sd)
if ((sd->modal) && (evas_object_visible_get(obj)))
_elm_win_modality_decrement(sd);
- efl_gfx_visible_set(efl_super(obj, MY_CLASS), EINA_FALSE);
+ efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), EINA_FALSE);
TRAP(sd, hide);
if (sd->frame_obj)
@@ -2350,17 +2413,10 @@ _efl_ui_win_hide(Eo *obj, Efl_Ui_Win_Data *sd)
evas_object_hide(sd->pointer.obj);
}
-#ifdef HAVE_ELEMENTARY_WL2
- if (sd->pointer.ee)
- {
- ecore_evas_hide(sd->pointer.ee);
- }
-#endif
-
if (_elm_config->atspi_mode)
{
Eo *root;
- root = efl_access_root_get(EFL_ACCESS_MIXIN);
+ root = efl_access_object_access_root_get(EFL_ACCESS_OBJECT_MIXIN);
efl_access_window_destroyed_signal_emit(obj);
if (root)
efl_access_children_changed_del_signal_emit(root, obj);
@@ -2371,7 +2427,7 @@ _efl_ui_win_hide(Eo *obj, Efl_Ui_Win_Data *sd)
}
EOLIAN static void
-_efl_ui_win_efl_gfx_visible_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Bool vis)
+_efl_ui_win_efl_gfx_entity_visible_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Bool vis)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 0, vis))
return;
@@ -2381,7 +2437,7 @@ _efl_ui_win_efl_gfx_visible_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Bool vis)
}
EOLIAN static Eina_Position2D
-_efl_ui_win_efl_canvas_pointer_position_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_efl_canvas_scene_pointer_position_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
Eina_Position2D pos;
evas_pointer_canvas_xy_get(sd->evas, &pos.x, &pos.y);
@@ -2389,7 +2445,7 @@ _efl_ui_win_efl_canvas_pointer_position_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data
}
EOLIAN static Eina_Bool
-_efl_ui_win_efl_canvas_pointer_pointer_inside_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eo *dev)
+_efl_ui_win_efl_canvas_pointer_pointer_inside_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eo *dev)
{
return efl_canvas_pointer_inside_get(sd->evas, dev);
}
@@ -2419,13 +2475,13 @@ _input_pointer_iterator_free(Input_Pointer_Iterator *it)
Efl_Input_Pointer *ptr;
EINA_LIST_FREE(it->list, ptr)
- efl_del(ptr);
+ efl_unref(ptr);
eina_iterator_free(it->real_iterator);
free(it);
}
EOLIAN static Eina_Iterator *
-_efl_ui_win_efl_canvas_pointer_iterate(const Eo *obj, Efl_Ui_Win_Data *sd,
+_efl_ui_win_efl_canvas_scene_pointer_iterate(const Eo *obj, Efl_Ui_Win_Data *sd,
Eina_Bool hover EINA_UNUSED)
{
Input_Pointer_Iterator *it;
@@ -2493,55 +2549,55 @@ _efl_ui_win_efl_canvas_pointer_iterate(const Eo *obj, Efl_Ui_Win_Data *sd,
}
EOLIAN static Eina_Bool
-_efl_ui_win_efl_canvas_image_max_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Size2D *max)
+_efl_ui_win_efl_canvas_scene_image_max_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Size2D *max)
{
- return efl_canvas_image_max_size_get(sd->evas, max);
+ return efl_canvas_scene_image_max_size_get(sd->evas, max);
}
EOLIAN static void
-_efl_ui_win_efl_canvas_smart_objects_calculate(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_efl_canvas_scene_smart_objects_calculate(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
evas_smart_objects_calculate(sd->evas);
}
EOLIAN static Eina_Iterator *
-_efl_ui_win_efl_canvas_objects_at_xy_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Position2D pos, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
+_efl_ui_win_efl_canvas_scene_objects_at_xy_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Position2D pos, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
{
Eina_List *objs = NULL;
objs = evas_objects_at_xy_get(sd->evas, pos.x, pos.y, include_pass_events_objects, include_hidden_objects);
return eina_list_iterator_new(objs); // FIXME: This leaks the list!
}
-EOLIAN static Efl_Gfx *
-_efl_ui_win_efl_canvas_object_top_at_xy_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Position2D pos, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
+EOLIAN static Efl_Gfx_Entity *
+_efl_ui_win_efl_canvas_scene_object_top_at_xy_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Position2D pos, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
{
return evas_object_top_at_xy_get(sd->evas, pos.x, pos.y, include_pass_events_objects, include_hidden_objects);
}
EOLIAN static Eina_Iterator *
-_efl_ui_win_efl_canvas_objects_in_rectangle_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Rect r, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
+_efl_ui_win_efl_canvas_scene_objects_in_rectangle_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Rect r, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
{
Eina_List *objs = NULL;
objs = evas_objects_in_rectangle_get(sd->evas, r.x, r.y, r.w, r.h, include_pass_events_objects, include_hidden_objects);
return eina_list_iterator_new(objs); // FIXME: This leaks the list!
}
-EOLIAN static Efl_Gfx *
-_efl_ui_win_efl_canvas_object_top_in_rectangle_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Rect r, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
+EOLIAN static Efl_Gfx_Entity *
+_efl_ui_win_efl_canvas_scene_object_top_in_rectangle_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Rect r, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
{
return evas_object_top_in_rectangle_get(sd->evas, r.x, r.y, r.w, r.h, include_pass_events_objects, include_hidden_objects);
}
EOLIAN static Efl_Input_Device *
-_efl_ui_win_efl_canvas_device_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *name)
+_efl_ui_win_efl_canvas_scene_device_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *name)
{
- return efl_canvas_device_get(sd->evas, name);
+ return efl_canvas_scene_device_get(sd->evas, name);
}
EOLIAN static Efl_Input_Device *
-_efl_ui_win_efl_canvas_seat_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, int id)
+_efl_ui_win_efl_canvas_scene_seat_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, int id)
{
- return efl_canvas_seat_get(sd->evas, id);
+ return efl_canvas_scene_seat_get(sd->evas, id);
}
static void
@@ -2597,24 +2653,15 @@ _elm_win_focus_target_get(Evas_Object *obj)
{
Evas_Object *o = obj;
- do
+ while (o)
{
if (elm_widget_is(o))
{
if (!elm_widget_highlight_ignore_get(o))
break;
- o = elm_widget_parent_get(o);
- if (!o)
- o = evas_object_smart_parent_get(o);
- }
- else
- {
- o = elm_widget_parent_widget_get(o);
- if (!o)
- o = evas_object_smart_parent_get(o);
}
+ o = elm_widget_parent_widget_get(o);
}
- while (o);
return o;
}
@@ -2698,8 +2745,12 @@ _elm_win_focus_highlight_shutdown(Efl_Ui_Win_Data *sd)
_elm_win_focus_highlight_reconfigure_job_stop(sd);
if (sd->focus_highlight.cur.target)
{
- elm_widget_signal_emit(sd->focus_highlight.cur.target,
- "elm,action,focus_highlight,hide", "elm");
+ if (elm_widget_is_legacy(sd->obj))
+ elm_widget_signal_emit(sd->focus_highlight.cur.target,
+ "elm,action,focus_highlight,hide", "elm");
+ else
+ elm_widget_signal_emit(sd->focus_highlight.cur.target,
+ "efl,action,focus_highlight,hide", "efl");
_elm_win_focus_target_callbacks_del(sd);
evas_object_event_callback_del_full
(sd->focus_highlight.cur.target,
@@ -2827,7 +2878,7 @@ _efl_ui_win_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Win_Data *sd)
_elm_win_state_eval_queue();
if (_elm_win_count == _paused_windows)
- efl_event_callback_call(efl_loop_get(obj), EFL_LOOP_EVENT_PAUSE, NULL);
+ efl_event_callback_call(efl_loop_get(obj), EFL_APP_EVENT_PAUSE, NULL);
if (sd->ee)
{
@@ -2861,6 +2912,8 @@ _efl_ui_win_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Win_Data *sd)
{
if (sd->ee && (sd->type != ELM_WIN_FAKE))
{
+ ecore_evas_manual_render_set(sd->ee, EINA_TRUE);
+ edje_object_freeze(sd->frame_obj);
ecore_job_add(_deferred_ecore_evas_free, sd->ee);
_elm_win_deferred_free++;
}
@@ -2909,43 +2962,15 @@ _efl_ui_win_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Win_Data *sd)
efl_canvas_group_del(efl_super(obj, MY_CLASS));
- if (_elm_win_policy_quit_triggered(obj))
+ if ((!_elm_win_list) &&
+ (elm_policy_get(ELM_POLICY_QUIT) == ELM_POLICY_QUIT_LAST_WINDOW_CLOSED))
{
_elm_win_flush_cache_and_exit(obj);
}
}
-static void
-_elm_win_obj_intercept_show(void *data,
- Evas_Object *obj)
-{
- ELM_WIN_DATA_GET(data, sd);
-
- /* FIXME: this intercept needs to be implemented in proper EO */
-
- // this is called to make sure all smart containers have calculated their
- // sizes BEFORE we show the window to make sure it initially appears at
- // our desired size (ie min size is known first)
- evas_smart_objects_calculate(evas_object_evas_get(obj));
- if (sd->frame_obj)
- {
- evas_object_show(sd->frame_obj);
- }
- if (sd->img_obj)
- {
- evas_object_show(sd->img_obj);
- }
- if (sd->pointer.obj) evas_object_show(sd->pointer.obj);
-
- evas_object_show(obj);
-#ifdef ELEMENTARY_X
- if (sd->type == ELM_WIN_TOOLTIP)
- ecore_x_window_shape_input_rectangle_set(sd->x.xwin, 0, 0, 0, 0);
-#endif
-}
-
EOLIAN static void
-_efl_ui_win_efl_gfx_position_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Position2D pos)
+_efl_ui_win_efl_gfx_entity_position_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Position2D pos)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
@@ -2956,7 +2981,7 @@ _efl_ui_win_efl_gfx_position_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Position2D p
{
sd->screen.x = pos.x;
sd->screen.y = pos.y;
- efl_event_callback_legacy_call(obj, EFL_GFX_EVENT_MOVE, NULL);
+ efl_event_callback_legacy_call(obj, EFL_GFX_ENTITY_EVENT_MOVE, NULL);
}
goto super_skip;
}
@@ -2972,13 +2997,13 @@ _efl_ui_win_efl_gfx_position_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Position2D p
if (!ecore_evas_override_get(sd->ee)) goto super_skip;
}
- efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
if (ecore_evas_override_get(sd->ee))
{
sd->screen.x = pos.x;
sd->screen.y = pos.y;
- efl_event_callback_legacy_call(obj, EFL_GFX_EVENT_MOVE, NULL);
+ efl_event_callback_legacy_call(obj, EFL_GFX_ENTITY_EVENT_MOVE, NULL);
}
if (sd->frame_obj)
{
@@ -3002,11 +3027,11 @@ super_skip:
* Ugly code flow: legacy code had an early return in smart_move, ie.
* evas object move would be processed but smart object move would be
* aborted. This super call tries to simulate that. */
- efl_gfx_position_set(efl_super(obj, EFL_CANVAS_GROUP_CLASS), pos);
+ efl_gfx_entity_position_set(efl_super(obj, EFL_CANVAS_GROUP_CLASS), pos);
}
EOLIAN static void
-_efl_ui_win_efl_gfx_size_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Size2D sz)
+_efl_ui_win_efl_gfx_entity_size_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Size2D sz)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
@@ -3036,7 +3061,7 @@ _efl_ui_win_efl_gfx_size_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Size2D sz)
TRAP(sd, resize, sz.w, sz.h);
}
- efl_gfx_size_set(efl_super(obj, MY_CLASS), sz);
+ efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
}
static void
@@ -3180,9 +3205,15 @@ _elm_win_wl_cursor_set(Evas_Object *obj, const char *cursor)
}
evas_object_move(sd->pointer.obj, 0, 0);
evas_object_resize(sd->pointer.obj, mw, mh);
- edje_object_part_geometry_get(sd->pointer.obj,
- "elm.swallow.hotspot",
- &hx, &hy, NULL, NULL);
+ if (elm_widget_is_legacy(obj))
+ edje_object_part_geometry_get(sd->pointer.obj,
+ "elm.swallow.hotspot",
+ &hx, &hy, NULL, NULL);
+ else
+ edje_object_part_geometry_get(sd->pointer.obj,
+ "efl.hotspot",
+ &hx, &hy, NULL, NULL);
+
sd->pointer.hot_x = hx;
sd->pointer.hot_y = hy;
@@ -3195,6 +3226,18 @@ _elm_win_wl_cursor_set(Evas_Object *obj, const char *cursor)
Ecore_Wl2_Input *input;
Eina_Iterator *it;
+ /* FIXME: Here be dragons...
+ pointer_set_cursor is totally unsynchronized, and on a cursor
+ change we get here before the new cursor is rendered. So
+ the cursor frequently moves to its new hotspot with the old
+ cursor image, causing an ugly jump.
+ Forcing manual render causes us to render first then set the
+ cursor, which is still racey but far more likely to win the
+ race.
+ The right way to do this is to create an entirely new surface
+ on every cursor change.
+ */
+ ecore_evas_manual_render(sd->pointer.ee);
it = ecore_wl2_display_inputs_get(ecore_wl2_window_display_get(sd->wl.win));
EINA_ITERATOR_FOREACH(it, input)
ecore_wl2_input_pointer_set(input, sd->pointer.surf, sd->pointer.hot_x, sd->pointer.hot_y);
@@ -3657,11 +3700,6 @@ _elm_win_translate(void)
efl_ui_translatable_translation_update(obj);
}
-void
-_elm_win_focus_reconfigure(void)
-{
- /* FOCUS-FIXME */
-}
#ifdef HAVE_ELEMENTARY_X
static Eina_Bool
@@ -3850,12 +3888,25 @@ _elm_win_focus_highlight_init(Efl_Ui_Win_Data *sd)
if (!sd->focus_highlight.fobj)
{
sd->focus_highlight.fobj = edje_object_add(sd->evas);
- edje_object_signal_callback_add(sd->focus_highlight.fobj,
- "elm,action,focus,hide,end", "*",
- _elm_win_focus_highlight_hide, NULL);
- edje_object_signal_callback_add(sd->focus_highlight.fobj,
- "elm,action,focus,anim,end", "*",
- _elm_win_focus_highlight_anim_end, sd->obj);
+
+ if (elm_widget_is_legacy(sd->obj))
+ {
+ edje_object_signal_callback_add(sd->focus_highlight.fobj,
+ "elm,action,focus,hide,end", "*",
+ _elm_win_focus_highlight_hide, NULL);
+ edje_object_signal_callback_add(sd->focus_highlight.fobj,
+ "elm,action,focus,anim,end", "*",
+ _elm_win_focus_highlight_anim_end, sd->obj);
+ }
+ else
+ {
+ edje_object_signal_callback_add(sd->focus_highlight.fobj,
+ "efl,action,focus,hide,end", "*",
+ _elm_win_focus_highlight_hide, NULL);
+ edje_object_signal_callback_add(sd->focus_highlight.fobj,
+ "efl,action,focus,anim,end", "*",
+ _elm_win_focus_highlight_anim_end, sd->obj);
+ }
}
_elm_win_focus_highlight_reconfigure_job_start(sd);
@@ -3874,7 +3925,7 @@ typedef struct _resize_info {
#endif
} resize_info;
-static const resize_info _resize_infos[8] = {
+static const resize_info _resize_infos_legacy[8] = {
{ "elm.event.resize.t", ELM_CURSOR_TOP_SIDE, EFL_UI_WIN_MOVE_RESIZE_TOP, 1 XDIR(SIZE_T) },
{ "elm.event.resize.b", ELM_CURSOR_BOTTOM_SIDE, EFL_UI_WIN_MOVE_RESIZE_BOTTOM, 2 XDIR(SIZE_B) },
{ "elm.event.resize.l", ELM_CURSOR_LEFT_SIDE, EFL_UI_WIN_MOVE_RESIZE_LEFT, 4 XDIR(SIZE_L) },
@@ -3885,6 +3936,17 @@ static const resize_info _resize_infos[8] = {
{ "elm.event.resize.tr", ELM_CURSOR_TOP_RIGHT_CORNER, EFL_UI_WIN_MOVE_RESIZE_TOP | EFL_UI_WIN_MOVE_RESIZE_RIGHT, 9 XDIR(SIZE_TR) },
};
+static const resize_info _resize_infos[8] = {
+ { "efl.event.resize.t", ELM_CURSOR_TOP_SIDE, EFL_UI_WIN_MOVE_RESIZE_TOP, 1 XDIR(SIZE_T) },
+ { "efl.event.resize.b", ELM_CURSOR_BOTTOM_SIDE, EFL_UI_WIN_MOVE_RESIZE_BOTTOM, 2 XDIR(SIZE_B) },
+ { "efl.event.resize.l", ELM_CURSOR_LEFT_SIDE, EFL_UI_WIN_MOVE_RESIZE_LEFT, 4 XDIR(SIZE_L) },
+ { "efl.event.resize.r", ELM_CURSOR_RIGHT_SIDE, EFL_UI_WIN_MOVE_RESIZE_RIGHT, 8 XDIR(SIZE_R) },
+ { "efl.event.resize.tl", ELM_CURSOR_TOP_LEFT_CORNER, EFL_UI_WIN_MOVE_RESIZE_TOP | EFL_UI_WIN_MOVE_RESIZE_LEFT, 5 XDIR(SIZE_TL) },
+ { "efl.event.resize.bl", ELM_CURSOR_BOTTOM_LEFT_CORNER, EFL_UI_WIN_MOVE_RESIZE_BOTTOM | EFL_UI_WIN_MOVE_RESIZE_LEFT, 6 XDIR(SIZE_BL) },
+ { "efl.event.resize.br", ELM_CURSOR_BOTTOM_RIGHT_CORNER, EFL_UI_WIN_MOVE_RESIZE_BOTTOM | EFL_UI_WIN_MOVE_RESIZE_RIGHT, 10 XDIR(SIZE_BR) },
+ { "efl.event.resize.tr", ELM_CURSOR_TOP_RIGHT_CORNER, EFL_UI_WIN_MOVE_RESIZE_TOP | EFL_UI_WIN_MOVE_RESIZE_RIGHT, 9 XDIR(SIZE_TR) },
+};
+
static inline Efl_Ui_Win_Move_Resize_Mode
_move_resize_mode_rotate(int rotation, Efl_Ui_Win_Move_Resize_Mode mode)
{
@@ -3915,26 +3977,46 @@ _move_resize_mode_rotate(int rotation, Efl_Ui_Win_Move_Resize_Mode mode)
}
static const resize_info *
-_resize_info_get(int rotation, Efl_Ui_Win_Move_Resize_Mode mode)
+_resize_info_get(Evas_Object *obj, int rotation, Efl_Ui_Win_Move_Resize_Mode mode)
{
if (rotation)
- return _resize_info_get(0, _move_resize_mode_rotate(rotation, mode));
+ return _resize_info_get(obj, 0, _move_resize_mode_rotate(rotation, mode));
- for (size_t k = 0; k < EINA_C_ARRAY_LENGTH(_resize_infos); k++)
+ if (elm_widget_is_legacy(obj))
{
- if (_resize_infos[k].mode == mode)
- return &_resize_infos[k];
+ for (size_t k = 0; k < EINA_C_ARRAY_LENGTH(_resize_infos_legacy); k++)
+ {
+ if (_resize_infos_legacy[k].mode == mode)
+ return &_resize_infos_legacy[k];
+ }
+ }
+ else
+ {
+ for (size_t k = 0; k < EINA_C_ARRAY_LENGTH(_resize_infos); k++)
+ {
+ if (_resize_infos[k].mode == mode)
+ return &_resize_infos[k];
+ }
}
return NULL;
}
static Efl_Ui_Win_Move_Resize_Mode
-_move_resize_mode_get(const char *source)
+_move_resize_mode_get(Evas_Object *obj, const char *source)
{
- for (size_t k = 0; k < EINA_C_ARRAY_LENGTH(_resize_infos); k++)
- if (!strcmp(source, _resize_infos[k].source))
- return _resize_infos[k].mode;
+ if (elm_widget_is_legacy(obj))
+ {
+ for (size_t k = 0; k < EINA_C_ARRAY_LENGTH(_resize_infos_legacy); k++)
+ if (!strcmp(source, _resize_infos_legacy[k].source))
+ return _resize_infos_legacy[k].mode;
+ }
+ else
+ {
+ for (size_t k = 0; k < EINA_C_ARRAY_LENGTH(_resize_infos); k++)
+ if (!strcmp(source, _resize_infos[k].source))
+ return _resize_infos[k].mode;
+ }
return EFL_UI_WIN_MOVE_RESIZE_MOVE;
}
@@ -3950,7 +4032,7 @@ _elm_win_frame_obj_move(void *data,
if (!(sd = data)) return;
if (!sd->legacy.edje) return;
- _elm_win_frame_obj_update(sd);
+ _elm_win_frame_obj_update(sd, 0);
}
static void
@@ -3964,7 +4046,7 @@ _elm_win_frame_obj_resize(void *data,
if (!(sd = data)) return;
if (!sd->legacy.edje) return;
- _elm_win_frame_obj_update(sd);
+ _elm_win_frame_obj_update(sd, 0);
}
static void
@@ -3981,8 +4063,8 @@ _elm_win_frame_cb_resize_show(void *data,
#ifdef HAVE_ELEMENTARY_WL2
if (sd->pointer.obj)
{
- Efl_Ui_Win_Move_Resize_Mode mode = _move_resize_mode_get(source);
- const resize_info *ri = _resize_info_get(sd->rot, mode);
+ Efl_Ui_Win_Move_Resize_Mode mode = _move_resize_mode_get(sd->obj, source);
+ const resize_info *ri = _resize_info_get(sd->obj, sd->rot, mode);
if (ri) elm_widget_theme_object_set(sd->obj, sd->pointer.obj, "pointer", "base", ri->cursor);
}
#else
@@ -4008,15 +4090,40 @@ _elm_win_frame_cb_resize_hide(void *data,
#endif
}
+#ifdef HAVE_ELEMENTARY_WL2
+/* This only works when called from an edje event
+ * that propagates seat info...
+ */
+static Ecore_Wl2_Input *
+_elm_win_wayland_input_get(Efl_Ui_Win_Data *sd)
+{
+ Ecore_Wl2_Display *di;
+ char *sname;
+ const char *engine;
+
+ engine = ecore_evas_engine_name_get(sd->ee);
+ if (strcmp(engine, ELM_WAYLAND_SHM) &&
+ strcmp(engine, ELM_WAYLAND_EGL))
+ return NULL;
+
+ di = ecore_wl2_window_display_get(sd->wl.win);
+
+ sname = edje_object_signal_callback_seat_data_get();
+ if (!sname) return NULL;
+ return ecore_wl2_display_input_find_by_name(di, sname);
+}
+#endif
+
static inline Eina_Bool
_win_move_start(Efl_Ui_Win_Data *sd)
{
#ifdef HAVE_ELEMENTARY_WL2
if (sd->wl.win)
{
- /* Note: Not passing any X,Y position as those don't make sense, only
- * the compositor can really handle the window & pointer position. */
- ecore_evas_wayland_move(sd->ee, 0, 0);
+ Ecore_Wl2_Input *ei;
+
+ ei = _elm_win_wayland_input_get(sd);
+ ecore_wl2_window_move(sd->wl.win, ei);
return EINA_TRUE;
}
#endif
@@ -4055,7 +4162,7 @@ _win_move_resize_start(Efl_Ui_Win_Data *sd, Efl_Ui_Win_Move_Resize_Mode mode)
if (mode == EFL_UI_WIN_MOVE_RESIZE_MOVE)
return _win_move_start(sd);
- ri = _resize_info_get(sd->rot, mode);
+ ri = _resize_info_get(sd->obj, sd->rot, mode);
if (!ri)
{
ERR("Unsupported move_resize mode %#x", (int) mode);
@@ -4067,7 +4174,10 @@ _win_move_resize_start(Efl_Ui_Win_Data *sd, Efl_Ui_Win_Move_Resize_Mode mode)
#ifdef HAVE_ELEMENTARY_WL2
if (sd->wl.win)
{
- ecore_evas_wayland_resize(sd->ee, ri->wl_location);
+ Ecore_Wl2_Input *ei;
+
+ ei = _elm_win_wayland_input_get(sd);
+ ecore_wl2_window_resize(sd->wl.win, ei, ri->wl_location);
return EINA_TRUE;
}
#endif
@@ -4099,26 +4209,13 @@ _elm_win_frame_cb_move_start(void *data,
}
static void
-_elm_win_frame_cb_move_stop(void *data,
- Evas_Object *obj EINA_UNUSED,
- const char *sig EINA_UNUSED,
- const char *source EINA_UNUSED)
-{
- ELM_WIN_DATA_GET_OR_RETURN(data, sd);
-
-#ifdef HAVE_ELEMENTARY_WL2
- _elm_win_wl_cursor_set(sd->obj, NULL);
-#endif
-}
-
-static void
_elm_win_frame_cb_resize_start(void *data, Evas_Object *obj EINA_UNUSED,
const char *sig EINA_UNUSED, const char *source)
{
ELM_WIN_DATA_GET_OR_RETURN(data, sd);
Efl_Ui_Win_Move_Resize_Mode mode;
- mode = _move_resize_mode_get(source);
+ mode = _move_resize_mode_get(sd->obj, source);
if (mode == EFL_UI_WIN_MOVE_RESIZE_MOVE) return;
_win_move_resize_start(sd, mode);
@@ -4172,13 +4269,23 @@ _elm_win_frame_cb_menu(void *data,
{
Eina_Iterator *it;
- it = ecore_wl2_display_inputs_get(ecore_wl2_window_display_get(sd->wl.win));
+ Ecore_Wl2_Display *display = ecore_wl2_window_display_get(sd->wl.win);
+ it = ecore_wl2_display_inputs_get(display);
EINA_ITERATOR_FOREACH(it, input) break;
eina_iterator_free(it);
}
- if (sd->wl.win->zxdg_toplevel)
- zxdg_toplevel_v6_show_window_menu(sd->wl.win->zxdg_toplevel,
+ if (sd->wl.win->xdg_toplevel)
+ {
+ xdg_toplevel_show_window_menu(sd->wl.win->xdg_toplevel,
+ ecore_wl2_input_seat_get(input), 0, x, y);
+ ecore_wl2_display_flush(input->display);
+ }
+ else if (sd->wl.win->zxdg_toplevel)
+ {
+ zxdg_toplevel_v6_show_window_menu(sd->wl.win->zxdg_toplevel,
ecore_wl2_input_seat_get(input), 0, x, y);
+ ecore_wl2_display_flush(input->display);
+ }
#else
(void)sd;
#endif
@@ -4227,28 +4334,23 @@ _elm_win_wl_configure(void *data, int t EINA_UNUSED, void *event)
{
Ecore_Wl2_Event_Window_Configure *ev = event;
ELM_WIN_DATA_GET(data, sd);
- if (ecore_wl2_window_id_get(sd->wl.win) != (int)ev->win) return ECORE_CALLBACK_RENEW;
+ if (sd->wl.win != ev->win) return ECORE_CALLBACK_RENEW;
if (sd->resizing && (!ev->edges)) sd->resizing = EINA_FALSE;
return ECORE_CALLBACK_RENEW;
}
-static void
-_elm_win_frame_pre_render(void *data, Evas *e EINA_UNUSED, void *ev EINA_UNUSED)
-{
- Efl_Ui_Win_Data *sd = data;
-
- if (sd->wl.opaque_dirty)
- _elm_win_opaque_update(sd, EINA_FALSE);
- sd->wl.opaque_dirty = 0;
-}
#endif
static inline void
_elm_object_part_cursor_set(Evas_Object *obj, Evas_Object *edj,
const char *part, const char *cursor)
{
- Evas_Object *sub = (Evas_Object *) edje_object_part_object_get(edj, part);
+ Evas_Object *sub;
+
+ edje_object_freeze(edj);
+ sub = (Evas_Object *)edje_object_part_object_get(edj, part);
+ edje_object_thaw(edj);
if (!sub) return;
elm_object_sub_cursor_set(sub, obj, cursor);
@@ -4275,7 +4377,6 @@ _efl_system_theme_path_get(void)
ERR("Default system theme is too old, something is wrong with your installation of EFL.");
return NULL;
}
-
return strdup(path);
}
@@ -4283,7 +4384,7 @@ static void
_elm_win_frame_add(Efl_Ui_Win_Data *sd, const char *element, const char *style)
{
Evas_Object *obj = sd->obj;
- int w, h, mw, mh, v;
+ int w, h, v;
const char *version;
if (sd->frame_obj) return;
@@ -4329,6 +4430,7 @@ _elm_win_frame_add(Efl_Ui_Win_Data *sd, const char *element, const char *style)
free(sys_theme);
}
+ edje_object_freeze(sd->frame_obj);
/* Small hack: The special value 2 means this is the top frame object.
* We propagate to the children now (the edc group contents), but subsequent
* calls to smart_member_add will not propagate the flag further. Note that
@@ -4336,7 +4438,10 @@ _elm_win_frame_add(Efl_Ui_Win_Data *sd, const char *element, const char *style)
* the fly. */
efl_canvas_object_is_frame_object_set(sd->frame_obj, 2);
- edje_object_part_swallow(sd->frame_obj, "elm.swallow.client", sd->legacy.edje);
+ if (elm_widget_is_legacy(sd->obj))
+ edje_object_part_swallow(sd->frame_obj, "elm.swallow.client", sd->legacy.edje);
+ else
+ edje_object_part_swallow(sd->frame_obj, "efl.client", sd->legacy.edje);
if (sd->icon)
evas_object_show(sd->icon);
@@ -4358,10 +4463,14 @@ _elm_win_frame_add(Efl_Ui_Win_Data *sd, const char *element, const char *style)
efreet_desktop_free(d);
}
}
- efl_access_type_set(sd->icon, EFL_ACCESS_TYPE_DISABLED);
+ efl_access_object_access_type_set(sd->icon, EFL_ACCESS_TYPE_DISABLED);
}
- edje_object_part_swallow(sd->frame_obj, "elm.swallow.icon", sd->icon);
+ if (elm_widget_is_legacy(sd->obj))
+ edje_object_part_swallow(sd->frame_obj, "elm.swallow.icon", sd->icon);
+ else
+ edje_object_part_swallow(sd->frame_obj, "efl.icon", sd->icon);
+
efl_canvas_object_is_frame_object_set(sd->icon, EINA_TRUE);
evas_object_event_callback_add
@@ -4369,62 +4478,103 @@ _elm_win_frame_add(Efl_Ui_Win_Data *sd, const char *element, const char *style)
evas_object_event_callback_add
(sd->frame_obj, EVAS_CALLBACK_RESIZE, _elm_win_frame_obj_resize, sd);
- _elm_win_frame_style_update(sd, 1, 0);
-
- /* NB: Do NOT remove these calls !! Needed to calculate proper
- * framespace on initial show of the window */
- edje_object_size_min_calc(sd->frame_obj, &mw, &mh);
- evas_object_move(sd->frame_obj, 0, 0);
- evas_object_resize(sd->frame_obj, mw, mh);
- evas_object_smart_calculate(sd->frame_obj);
-
- edje_object_signal_callback_add
- (sd->frame_obj, "elm,action,move,start", "elm",
- _elm_win_frame_cb_move_start, obj);
- edje_object_signal_callback_add
- (sd->frame_obj, "elm,action,move,stop", "elm",
- _elm_win_frame_cb_move_stop, obj);
- edje_object_signal_callback_add
- (sd->frame_obj, "elm,action,resize,show", "*",
- _elm_win_frame_cb_resize_show, obj);
- edje_object_signal_callback_add
- (sd->frame_obj, "elm,action,resize,hide", "*",
- _elm_win_frame_cb_resize_hide, obj);
- edje_object_signal_callback_add
- (sd->frame_obj, "elm,action,resize,start", "*",
- _elm_win_frame_cb_resize_start, obj);
- edje_object_signal_callback_add
- (sd->frame_obj, "elm,action,minimize", "elm",
- _elm_win_frame_cb_minimize, obj);
- edje_object_signal_callback_add
- (sd->frame_obj, "elm,action,maximize", "elm",
- _elm_win_frame_cb_maximize, obj);
- edje_object_signal_callback_add
- (sd->frame_obj, "elm,action,close", "elm", _elm_win_frame_cb_close, obj);
- edje_object_signal_callback_add
- (sd->frame_obj, "elm,action,menu", "elm", _elm_win_frame_cb_menu, obj);
+ if (elm_widget_is_legacy(sd->obj))
+ {
+ edje_object_signal_callback_add
+ (sd->frame_obj, "elm,action,move,start", "elm",
+ _elm_win_frame_cb_move_start, obj);
+ edje_object_signal_callback_add
+ (sd->frame_obj, "elm,action,resize,show", "*",
+ _elm_win_frame_cb_resize_show, obj);
+ edje_object_signal_callback_add
+ (sd->frame_obj, "elm,action,resize,hide", "*",
+ _elm_win_frame_cb_resize_hide, obj);
+ edje_object_signal_callback_add
+ (sd->frame_obj, "elm,action,resize,start", "*",
+ _elm_win_frame_cb_resize_start, obj);
+ edje_object_signal_callback_add
+ (sd->frame_obj, "elm,action,minimize", "elm",
+ _elm_win_frame_cb_minimize, obj);
+ edje_object_signal_callback_add
+ (sd->frame_obj, "elm,action,maximize", "elm",
+ _elm_win_frame_cb_maximize, obj);
+ edje_object_signal_callback_add
+ (sd->frame_obj, "elm,action,close", "elm",
+ _elm_win_frame_cb_close, obj);
+ edje_object_signal_callback_add
+ (sd->frame_obj, "elm,action,menu", "elm",
+ _elm_win_frame_cb_menu, obj);
+ }
+ else
+ {
+ edje_object_signal_callback_add
+ (sd->frame_obj, "efl,action,move,start", "efl",
+ _elm_win_frame_cb_move_start, obj);
+ edje_object_signal_callback_add
+ (sd->frame_obj, "efl,action,resize,show", "*",
+ _elm_win_frame_cb_resize_show, obj);
+ edje_object_signal_callback_add
+ (sd->frame_obj, "efl,action,resize,hide", "*",
+ _elm_win_frame_cb_resize_hide, obj);
+ edje_object_signal_callback_add
+ (sd->frame_obj, "efl,action,resize,start", "*",
+ _elm_win_frame_cb_resize_start, obj);
+ edje_object_signal_callback_add
+ (sd->frame_obj, "efl,action,minimize", "efl",
+ _elm_win_frame_cb_minimize, obj);
+ edje_object_signal_callback_add
+ (sd->frame_obj, "efl,action,maximize", "efl",
+ _elm_win_frame_cb_maximize, obj);
+ edje_object_signal_callback_add
+ (sd->frame_obj, "efl,action,close", "efl",
+ _elm_win_frame_cb_close, obj);
+ edje_object_signal_callback_add
+ (sd->frame_obj, "efl,action,menu", "efl",
+ _elm_win_frame_cb_menu, obj);
+ }
if (!sd->pointer.obj)
{
- for (size_t k = 0; k < EINA_C_ARRAY_LENGTH(_resize_infos); k++)
+ if (elm_widget_is_legacy(obj))
{
- const resize_info *ri = &_resize_infos[k];
- _elm_object_part_cursor_set(obj, sd->frame_obj, ri->source, ri->cursor);
+ for (size_t k = 0; k < EINA_C_ARRAY_LENGTH(_resize_infos_legacy); k++)
+ {
+ const resize_info *ri = &_resize_infos_legacy[k];
+ _elm_object_part_cursor_set(obj, sd->frame_obj, ri->source, ri->cursor);
+ }
+ }
+ else
+ {
+ for (size_t k = 0; k < EINA_C_ARRAY_LENGTH(_resize_infos); k++)
+ {
+ const resize_info *ri = &_resize_infos[k];
+ _elm_object_part_cursor_set(obj, sd->frame_obj, ri->source, ri->cursor);
+ }
}
}
if (sd->title)
{
- edje_object_part_text_escaped_set
- (sd->frame_obj, "elm.text.title", sd->title);
+ if (elm_widget_is_legacy(sd->obj))
+ edje_object_part_text_escaped_set(sd->frame_obj, "elm.text.title", sd->title);
+ else
+ edje_object_part_text_escaped_set(sd->frame_obj, "efl.text.title", sd->title);
}
{
// HACK: Force render mode of bg rect to COPY. This avoids render garbage.
- Eo *bgrect = (Eo *) edje_object_part_object_get(sd->frame_obj, "elm.rect.background");
+ Eo *bgrect;
+ if (elm_widget_is_legacy(sd->obj))
+ bgrect = (Eo *) edje_object_part_object_get(sd->frame_obj, "elm.rect.background");
+ else
+ bgrect = (Eo *) edje_object_part_object_get(sd->frame_obj, "efl.rect.background");
+
efl_canvas_object_render_op_set(bgrect, EFL_GFX_RENDER_OP_COPY);
}
+ if (sd->first_draw)
+ edje_object_thaw(sd->frame_obj);
+ if (!efl_finalized_get(obj)) return;
_elm_win_frame_style_update(sd, 1, 1);
_elm_win_frame_geometry_adjust(sd);
ecore_evas_geometry_get(sd->ee, NULL, NULL, &w, &h);
@@ -4443,10 +4593,7 @@ _elm_win_frame_style_update(Efl_Ui_Win_Data *sd, Eina_Bool force_emit, Eina_Bool
{
if (!efl_finalized_get(sd->obj)) return;
if (EINA_LIKELY(sd->type == ELM_WIN_FAKE))
- {
- _elm_win_opaque_update(sd, 0);
- return;
- }
+ return;
CRI("Window has no frame object!");
return;
}
@@ -4480,7 +4627,7 @@ _elm_win_frame_style_update(Efl_Ui_Win_Data *sd, Eina_Bool force_emit, Eina_Bool
else
#endif
focus = ecore_evas_focus_get(sd->ee);
- bg_solid = sd->csd.need_bg_solid;
+ bg_solid = sd->csd.need_bg_solid && (!alpha);
bg_standard = sd->csd.need_bg_standard;
unresizable = sd->csd.need_unresizable;
menu = sd->csd.need_menu;
@@ -4494,25 +4641,40 @@ _elm_win_frame_style_update(Efl_Ui_Win_Data *sd, Eina_Bool force_emit, Eina_Bool
if (trap && sd->csd.wayland && sd->csd.need_borderless)
shadow = 0;
-#define STATE_SET(state, s1, s2) do { \
+#define STATE_SET(state, s1, s2, s3) do { \
if (force_emit || (state != sd->csd.cur_##state)) \
{ \
const char *sig = state ? s1 : s2; \
- edje_object_signal_emit(sd->frame_obj, sig, "elm"); \
+ edje_object_signal_emit(sd->frame_obj, sig, s3); \
DBG("frame style emit: %p %s", sd->obj, sig); \
sd->csd.cur_##state = state; \
changed = EINA_TRUE; \
} } while (0)
- STATE_SET(borderless, "elm,state,borderless,on", "elm,state,borderless,off");
- STATE_SET(shadow, "elm,state,shadow,on", "elm,state,shadow,off");
- STATE_SET(maximized, "elm,state,maximized", "elm,state,unmaximized");
- STATE_SET(focus, "elm,action,focus", "elm,action,unfocus");
- STATE_SET(bg_solid, "elm,state,background,solid,on", "elm,state,background,solid,off");
- STATE_SET(bg_standard, "elm,state,background,standard,on", "elm,state,background,standard,off");
- STATE_SET(unresizable, "elm,state,unresizable,on", "elm,state,unresizable,off");
- STATE_SET(menu, "elm,action,show_menu", "elm,action,hide_menu");
- STATE_SET(indicator, "elm,action,show_indicator", "elm,action,hide_indicator");
+ if (elm_widget_is_legacy(sd->obj))
+ {
+ STATE_SET(borderless, "elm,state,borderless,on", "elm,state,borderless,off", "elm");
+ STATE_SET(shadow, "elm,state,shadow,on", "elm,state,shadow,off", "elm");
+ STATE_SET(maximized, "elm,state,maximized", "elm,state,unmaximized", "elm");
+ STATE_SET(focus, "elm,action,focus", "elm,action,unfocus", "elm");
+ STATE_SET(bg_solid, "elm,state,background,solid,on", "elm,state,background,solid,off", "elm");
+ STATE_SET(bg_standard, "elm,state,background,standard,on", "elm,state,background,standard,off", "elm");
+ STATE_SET(unresizable, "elm,state,unresizable,on", "elm,state,unresizable,off", "elm");
+ STATE_SET(menu, "elm,action,show_menu", "elm,action,hide_menu", "elm");
+ STATE_SET(indicator, "elm,action,show_indicator", "elm,action,hide_indicator", "elm");
+ }
+ else
+ {
+ STATE_SET(borderless, "efl,state,borderless,on", "efl,state,borderless,off", "efl");
+ STATE_SET(shadow, "efl,state,shadow,on", "efl,state,shadow,off", "efl");
+ STATE_SET(maximized, "efl,state,maximized", "efl,state,unmaximized", "efl");
+ STATE_SET(focus, "efl,action,focus", "efl,action,unfocus", "efl");
+ STATE_SET(bg_solid, "efl,state,background,solid,on", "efl,state,background,solid,off", "efl");
+ STATE_SET(bg_standard, "efl,state,background,standard,on", "efl,state,background,standard,off", "efl");
+ STATE_SET(unresizable, "efl,state,unresizable,on", "efl,state,unresizable,off", "efl");
+ STATE_SET(menu, "efl,action,show_menu", "efl,action,hide_menu", "efl");
+ STATE_SET(indicator, "efl,action,show_indicator", "efl,action,hide_indicator", "efl");
+ }
#undef STATE_SET
@@ -4522,8 +4684,7 @@ _elm_win_frame_style_update(Efl_Ui_Win_Data *sd, Eina_Bool force_emit, Eina_Bool
edje_object_message_signal_process(sd->frame_obj);
if (calc)
evas_object_smart_calculate(sd->frame_obj);
- _elm_win_frame_obj_update(sd);
- _elm_win_opaque_update(sd, EINA_FALSE);
+ _elm_win_frame_obj_update(sd, 0);
}
}
@@ -4594,7 +4755,7 @@ _elm_x_io_err(void *data EINA_UNUSED)
Evas_Object *obj;
EINA_LIST_FOREACH(_elm_win_list, l, obj)
- efl_event_callback_legacy_call(obj, EFL_UI_WIN_EVENT_IOERR, NULL);
+ evas_object_smart_callback_call(obj, "ioerr", NULL);
elm_exit();
}
#endif
@@ -4668,7 +4829,7 @@ _indicator_resized(void *data, const Efl_Event *event)
Evas_Object *indicator = event->object;
Evas_Coord_Size *size = (Evas_Coord_Size *)event->info;
efl_gfx_size_hint_restricted_min_set(indicator, EINA_SIZE2D(size->w, size->h));
- _elm_win_frame_obj_update(sd);
+ _elm_win_frame_obj_update(sd, 0);
}
static Evas_Object*
@@ -4707,10 +4868,20 @@ _indicator_add(Efl_Ui_Win_Data *sd)
sd->indicator = _create_indicator(obj);
- if ((!sd->indicator) ||
- (!edje_object_part_swallow(sd->frame_obj, "elm.swallow.indicator", sd->indicator)))
+ if (!sd->indicator)
return;
+ if (elm_widget_is_legacy(obj))
+ {
+ if (!edje_object_part_swallow(sd->frame_obj, "elm.swallow.indicator", sd->indicator))
+ return;
+ }
+ else
+ {
+ if (!edje_object_part_swallow(sd->frame_obj, "efl.indicator", sd->indicator))
+ return;
+ }
+
efl_event_callback_add
(sd->indicator, ELM_PLUG_EVENT_IMAGE_RESIZED, _indicator_resized, obj);
@@ -4738,8 +4909,10 @@ _indicator_del(Efl_Ui_Win_Data *sd)
static Eina_Value
_win_finalize_job_cb(void *data, const Eina_Value value)
{
- Evas *eo_e = evas_object_evas_get(data);
- evas_render_pending_objects_flush(eo_e);
+ Efl_Ui_Win_Data *sd = data;
+ sd->finalize_future = NULL;
+ if (!efl_invalidated_get(sd->obj))
+ evas_render_pending_objects_flush(sd->evas);
return value;
}
@@ -4768,6 +4941,9 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U
}
parent = efl_parent_get(obj);
+ if (!(efl_isa(parent, EFL_UI_WIN_CLASS) ||
+ efl_isa(parent, EFL_UI_WIN_LEGACY_CLASS) ||
+ efl_isa(parent, EFL_UI_WIN_INLINED_CLASS))) parent = NULL;
/* just to store some data while trying out to create a canvas */
memset(&tmp_sd, 0, sizeof(Efl_Ui_Win_Data));
@@ -5101,11 +5277,8 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U
/* FIXME: Major hack: calling the constructor in the middle of finalize. */
efl_constructor(efl_super(obj, MY_CLASS));
- efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- evas_object_focus_set(obj, EINA_TRUE);
-
if (getenv("ELM_FIRST_FRAME"))
evas_event_callback_add(ecore_evas_get(tmp_sd.ee), EVAS_CALLBACK_RENDER_POST,
_elm_win_first_frame_do, getenv("ELM_FIRST_FRAME"));
@@ -5208,12 +5381,10 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U
if ((_elm_config->bgpixmap)
#ifdef HAVE_ELEMENTARY_X
- &&
- (((sd->x.xwin) && (!ecore_x_screen_is_composited(0))) ||
- (!sd->x.xwin)))
-#else
- )
+ && (((sd->x.xwin) && (!ecore_x_screen_is_composited(0))) ||
+ (!sd->x.xwin))
#endif
+ )
TRAP(sd, avoid_damage_set, ECORE_EVAS_AVOID_DAMAGE_EXPOSE);
// bg pixmap done by x - has other issues like can be redrawn by x before it
// is filled/ready by app
@@ -5253,8 +5424,6 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U
(obj, _elm_win_obj_intercept_stack_below, obj);
evas_object_intercept_layer_set_callback_add
(obj, _elm_win_obj_intercept_layer_set, obj);
- evas_object_intercept_show_callback_add
- (obj, _elm_win_obj_intercept_show, obj);
}
TRAP(sd, name_class_set, name, _elm_appname);
@@ -5294,20 +5463,19 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U
#ifdef HAVE_ELEMENTARY_X
_elm_win_xwin_update(sd);
#endif
-#ifdef HAVE_ELEMENTARY_WL2
- if (eina_streq(engine, ELM_WAYLAND_SHM) || eina_streq(engine, ELM_WAYLAND_EGL))
- evas_event_callback_add(sd->evas, EVAS_CALLBACK_RENDER_FLUSH_PRE, _elm_win_frame_pre_render, sd);
-#endif
- //Prohibiting auto-rendering, until elm_win is shown.
- if (_elm_config->auto_norender_withdrawn)
+ if (type != ELM_WIN_FAKE)
{
- if (elm_win_withdrawn_get(obj))
+ //Prohibiting auto-rendering, until elm_win is shown.
+ if (_elm_win_auto_norender_withdrawn(obj))
{
- if (!evas_object_data_get(obj, "__win_auto_norender"))
+ if (elm_win_withdrawn_get(obj))
{
- elm_win_norender_push(obj);
- evas_object_data_set(obj, "__win_auto_norender", obj);
+ if (!evas_object_data_get(obj, "__win_auto_norender"))
+ {
+ elm_win_norender_push(obj);
+ evas_object_data_set(obj, "__win_auto_norender", obj);
+ }
}
}
}
@@ -5337,8 +5505,13 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U
elm_widget_theme_object_set(obj, o, "pointer", "base", "default");
edje_object_size_min_calc(o, &mw, &mh);
evas_object_resize(o, mw, mh);
- edje_object_part_geometry_get(o, "elm.swallow.hotspot",
- &hx, &hy, NULL, NULL);
+ if (elm_widget_is_legacy(obj))
+ edje_object_part_geometry_get(o, "elm.swallow.hotspot",
+ &hx, &hy, NULL, NULL);
+ else
+ edje_object_part_geometry_get(o, "efl.hotspot",
+ &hx, &hy, NULL, NULL);
+
sd->pointer.hot_x = hx;
sd->pointer.hot_y = hy;
evas_object_show(o);
@@ -5367,6 +5540,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U
sd->pointer.ee = ecore_evas_wayland_shm_new(NULL, 0, 0, 0, 0, 0, 0);
else if (!strcmp(engine, ELM_WAYLAND_EGL))
sd->pointer.ee = ecore_evas_wayland_egl_new(NULL, 0, 0, 0, 0, 0, 0);
+ ecore_evas_alpha_set(sd->pointer.ee, EINA_TRUE);
pevas = ecore_evas_get(sd->pointer.ee);
@@ -5375,6 +5549,8 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U
sd->pointer.win = ecore_evas_wayland2_window_get(sd->pointer.ee);
ecore_wl2_window_type_set(sd->pointer.win,
ECORE_WL2_WINDOW_TYPE_NONE);
+ _elm_win_wl_cursor_set(sd->obj, NULL);
+ ecore_evas_show(sd->pointer.ee);
}
}
#endif
@@ -5412,7 +5588,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U
elm_win_focus_highlight_animate_set(obj, EINA_TRUE);
}
- efl_access_role_set(obj, EFL_ACCESS_ROLE_WINDOW);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_WINDOW);
if (_elm_config->atspi_mode)
efl_access_window_created_signal_emit(obj);
@@ -5431,8 +5607,8 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U
}
else
{
- eina_future_then_easy(efl_loop_job(efl_loop_get(obj)),
- .success = _win_finalize_job_cb, .data = obj);
+ sd->finalize_future = eina_future_then_easy(efl_loop_job(efl_loop_get(obj)),
+ .success = _win_finalize_job_cb, .data = sd);
}
// All normal windows are "standard" windows with EO API
@@ -5460,7 +5636,7 @@ _efl_ui_win_efl_object_finalize(Eo *obj, Efl_Ui_Win_Data *sd)
obj = _elm_win_finalize_internal(obj, sd, sd->name, sd->type);
if (!obj) return NULL;
obj = efl_finalize(efl_super(obj, MY_CLASS));
- if (obj && resume) efl_event_callback_call(efl_loop_get(obj), EFL_LOOP_EVENT_RESUME, NULL);
+ if (obj && resume) efl_event_callback_call(efl_loop_get(obj), EFL_APP_EVENT_RESUME, NULL);
return obj;
}
@@ -5472,7 +5648,7 @@ _efl_ui_win_efl_canvas_object_legacy_ctor(Eo *obj, Efl_Ui_Win_Data *sd)
}
EOLIAN static Efl_Ui_Focus_Manager*
-_efl_ui_win_elm_widget_focus_manager_create(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd EINA_UNUSED, Efl_Ui_Focus_Object *root)
+_efl_ui_win_efl_ui_widget_focus_manager_focus_manager_create(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd EINA_UNUSED, Efl_Ui_Focus_Object *root)
{
Efl_Ui_Focus_Manager *manager;
@@ -5493,7 +5669,12 @@ _efl_ui_win_efl_object_destructor(Eo *obj, Efl_Ui_Win_Data *pd EINA_UNUSED)
ecore_wl2_window_free(pd->wl.win);
}
#endif
+ if (pd->finalize_future)
+ eina_future_cancel(pd->finalize_future);
+
efl_destructor(efl_super(obj, MY_CLASS));
+
+ efl_unref(pd->provider);
}
EOLIAN static Eo *
@@ -5504,17 +5685,13 @@ _efl_ui_win_efl_object_constructor(Eo *obj, Efl_Ui_Win_Data *pd)
* really bad and hacky. Needs fixing. */
pd->obj = obj;
- pd->manager = efl_ui_widget_focus_manager_create(obj, obj);
- pd->provider = efl_add(EFL_UI_FOCUS_PARENT_PROVIDER_STANDARD_CLASS, obj);
+ pd->provider = efl_add_ref(EFL_UI_FOCUS_PARENT_PROVIDER_STANDARD_CLASS, NULL);
pd->profile.available = eina_array_new(4);
// For bindings: if no parent, allow simple unref
if (!efl_parent_get(obj))
efl_allow_parent_unref_set(obj, EINA_TRUE);
- efl_composite_attach(obj, pd->manager);
- _efl_ui_focus_manager_redirect_events_add(pd->manager, obj);
-
return obj;
}
@@ -5526,12 +5703,16 @@ _efl_ui_win_efl_text_text_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const ch
if (sd->ee)
TRAP(sd, title_set, sd->title);
if (sd->frame_obj)
- edje_object_part_text_escaped_set
- (sd->frame_obj, "elm.text.title", sd->title);
+ {
+ if (elm_widget_is_legacy(sd->obj))
+ edje_object_part_text_escaped_set(sd->frame_obj, "elm.text.title", sd->title);
+ else
+ edje_object_part_text_escaped_set(sd->frame_obj, "efl.text.title", sd->title);
+ }
}
EOLIAN static const char*
-_efl_ui_win_efl_text_text_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_efl_text_text_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
return sd->title;
}
@@ -5548,7 +5729,7 @@ _efl_ui_win_win_type_set(Eo *obj, Efl_Ui_Win_Data *sd, Efl_Ui_Win_Type type)
}
EOLIAN static Efl_Ui_Win_Type
-_efl_ui_win_win_type_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_win_type_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
return sd->type;
}
@@ -5565,7 +5746,7 @@ _efl_ui_win_win_name_set(Eo *obj, Efl_Ui_Win_Data *sd, const char *name)
}
EOLIAN static const char *
-_efl_ui_win_win_name_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_win_name_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
return sd->name;
}
@@ -5582,7 +5763,7 @@ _efl_ui_win_accel_preference_set(Eo *obj, Efl_Ui_Win_Data *pd, const char *accel
}
EOLIAN static const char *
-_efl_ui_win_accel_preference_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd)
+_efl_ui_win_accel_preference_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd)
{
return pd->accel_pref;
}
@@ -5597,7 +5778,7 @@ _efl_ui_win_noblank_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd, Eina_Bool nobl
}
EOLIAN static Eina_Bool
-_efl_ui_win_noblank_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd)
+_efl_ui_win_noblank_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd)
{
return pd->noblank;
}
@@ -5613,7 +5794,7 @@ _efl_ui_win_win_role_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *r
}
EOLIAN static const char*
-_efl_ui_win_win_role_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_win_role_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
return sd->role;
}
@@ -5621,8 +5802,8 @@ _efl_ui_win_win_role_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
EOLIAN static void
_efl_ui_win_icon_object_set(Eo *obj, Efl_Ui_Win_Data *sd, Evas_Object *icon)
{
- if (icon && (!efl_isa(sd->icon, EFL_CANVAS_IMAGE_INTERNAL_CLASS) &&
- !efl_isa(sd->icon, EFL_UI_IMAGE_CLASS)))
+ if (icon && (!efl_isa(icon, EFL_CANVAS_IMAGE_INTERNAL_CLASS) &&
+ !efl_isa(icon, EFL_UI_IMAGE_CLASS)))
{
ERR("Icon object type is not supported!");
efl_del(icon);
@@ -5640,7 +5821,11 @@ _efl_ui_win_icon_object_set(Eo *obj, Efl_Ui_Win_Data *sd, Evas_Object *icon)
efl_event_callback_add(sd->icon, EFL_EVENT_DEL, _elm_win_on_icon_del, obj);
if (sd->frame_obj)
{
- edje_object_part_swallow(sd->frame_obj, "elm.swallow.icon", sd->icon);
+ if (elm_widget_is_legacy(sd->obj))
+ edje_object_part_swallow(sd->frame_obj, "elm.swallow.icon", sd->icon);
+ else
+ edje_object_part_swallow(sd->frame_obj, "efl.icon", sd->icon);
+
evas_object_is_frame_object_set(sd->icon, EINA_TRUE);
}
}
@@ -5650,7 +5835,7 @@ _efl_ui_win_icon_object_set(Eo *obj, Efl_Ui_Win_Data *sd, Evas_Object *icon)
}
EOLIAN static const Evas_Object*
-_efl_ui_win_icon_object_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_icon_object_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
return sd->icon;
}
@@ -5678,7 +5863,7 @@ _efl_ui_win_autohide_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool aut
}
EOLIAN static Eina_Bool
-_efl_ui_win_autohide_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_autohide_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
return sd->autohide;
}
@@ -5725,7 +5910,7 @@ _efl_ui_win_center(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Bool h, Eina_Bool v)
if ((trap) && (trap->center) && (!trap->center(sd->trap_data, obj, h, v)))
return;
- if (!efl_gfx_visible_get(obj))
+ if (!efl_gfx_entity_visible_get(obj))
{
// Chose to use env var so this will also translate more easily
// to wayland. yes - we can get x atoms to figure out if wm is
@@ -5824,7 +6009,7 @@ _efl_ui_win_borderless_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Bool borderless)
}
EOLIAN static Eina_Bool
-_efl_ui_win_borderless_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_borderless_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
if (!sd->csd.need)
return ecore_evas_borderless_get(sd->ee);
@@ -5840,7 +6025,7 @@ _efl_ui_win_alpha_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Bool enabled)
}
EOLIAN static Eina_Bool
-_efl_ui_win_alpha_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_alpha_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
if (sd->img_obj)
{
@@ -5880,7 +6065,7 @@ _efl_ui_win_fullscreen_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool f
}
EOLIAN static Eina_Bool
-_efl_ui_win_fullscreen_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_fullscreen_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
const char *engine_name = ecore_evas_engine_name_get(sd->ee);
@@ -5922,7 +6107,7 @@ _main_menu_resize_cb(void *data EINA_UNUSED, const Efl_Event *ev)
{
// After resize, the framespace size has changed, so update the win geometry
_elm_win_resize_objects_eval(ev->object, EINA_FALSE);
- efl_event_callback_del(ev->object, EFL_GFX_EVENT_RESIZE, _main_menu_resize_cb, NULL);
+ efl_event_callback_del(ev->object, EFL_GFX_ENTITY_EVENT_RESIZE, _main_menu_resize_cb, NULL);
}
static void
@@ -5942,15 +6127,23 @@ _dbus_menu_set(Eina_Bool dbus_connect, void *data)
{
// Note: Based on EFL 1.18 the signal was "elm,action,hide"
// and not "elm,action,hide_menu" as expected.
- edje_object_signal_emit(swallow, "elm,action,hide", "elm");
+ if (elm_widget_is_legacy(data))
+ edje_object_signal_emit(swallow, "elm,action,hide", "elm");
+ else
+ edje_object_signal_emit(swallow, "efl,action,hide", "efl");
edje_object_message_signal_recursive_process(swallow);
}
}
else
{
DBG("Setting menu to local mode");
- efl_event_callback_add(sd->obj, EFL_GFX_EVENT_RESIZE, _main_menu_resize_cb, NULL);
- edje_object_part_swallow(swallow, "elm.swallow.menu", sd->main_menu);
+ efl_event_callback_add(sd->obj, EFL_GFX_ENTITY_EVENT_RESIZE, _main_menu_resize_cb, NULL);
+
+ if (elm_widget_is_legacy(sd->obj))
+ edje_object_part_swallow(swallow, "elm.swallow.menu", sd->main_menu);
+ else
+ edje_object_part_swallow(swallow, "efl.menu", sd->main_menu);
+
evas_object_show(sd->main_menu);
if (swallow == sd->frame_obj)
{
@@ -5959,7 +6152,10 @@ _dbus_menu_set(Eina_Bool dbus_connect, void *data)
}
else
{
- edje_object_signal_emit(swallow, "elm,action,show_menu", "elm");
+ if (elm_widget_is_legacy(data))
+ edje_object_signal_emit(swallow, "elm,action,show_menu", "elm");
+ else
+ edje_object_signal_emit(swallow, "efl,action,show_menu", "efl");
edje_object_message_signal_recursive_process(swallow);
}
}
@@ -5979,7 +6175,7 @@ _efl_ui_win_maximized_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool ma
}
EOLIAN static Eina_Bool
-_efl_ui_win_maximized_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_maximized_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
return sd->maximized;
}
@@ -5995,7 +6191,7 @@ _efl_ui_win_iconified_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool ic
}
EOLIAN static Eina_Bool
-_efl_ui_win_iconified_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_iconified_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
return sd->iconified;
}
@@ -6048,7 +6244,7 @@ _efl_ui_win_wm_available_profiles_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd,
}
EOLIAN static const Eina_Array *
-_efl_ui_win_wm_available_profiles_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_wm_available_profiles_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
if (ecore_evas_window_profile_supported_get(sd->ee))
{
@@ -6097,7 +6293,7 @@ _efl_ui_win_urgent_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Efl_Ui_Win_Urge
}
EOLIAN static Efl_Ui_Win_Urgent_Mode
-_efl_ui_win_urgent_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_urgent_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
if (sd->urgent) return EFL_UI_WIN_URGENT_URGENT;
return EFL_UI_WIN_URGENT_NONE;
@@ -6123,7 +6319,7 @@ _efl_ui_win_modal_set(Eo *obj, Efl_Ui_Win_Data *sd, Efl_Ui_Win_Modal_Mode modal)
}
EOLIAN static Efl_Ui_Win_Modal_Mode
-_efl_ui_win_modal_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_modal_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
if (sd->modal) return EFL_UI_WIN_MODAL_MODAL;
return EFL_UI_WIN_MODAL_NONE;
@@ -6181,7 +6377,7 @@ _efl_ui_win_efl_gfx_size_hint_hint_base_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data
}
EOLIAN static Eina_Size2D
-_efl_ui_win_efl_gfx_size_hint_hint_base_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_efl_gfx_size_hint_hint_base_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
return EINA_SIZE2D(sd->size_base_w, sd->size_base_h);
}
@@ -6215,7 +6411,7 @@ _efl_ui_win_efl_gfx_size_hint_hint_max_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Si
}
EOLIAN static Eina_Size2D
-_efl_ui_win_efl_gfx_size_hint_hint_step_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_efl_gfx_size_hint_hint_step_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
return EINA_SIZE2D(sd->size_step_w, sd->size_step_h);
}
@@ -6289,7 +6485,7 @@ _win_rotate(Evas_Object *obj, Efl_Ui_Win_Data *sd, int rotation, Eina_Bool resiz
#ifdef HAVE_ELEMENTARY_X
_elm_win_xwin_update(sd);
#endif
- _elm_win_frame_obj_update(sd);
+ _elm_win_frame_obj_update(sd, 0);
efl_ui_widget_on_orientation_update(obj, rotation);
efl_event_callback_legacy_call
(obj, EFL_UI_WIN_EVENT_ROTATION_CHANGED, NULL);
@@ -6339,7 +6535,7 @@ _efl_ui_win_wm_available_rotations_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd,
}
EOLIAN static Eina_Bool
-_efl_ui_win_wm_available_rotations_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd,
+_efl_ui_win_wm_available_rotations_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd,
Eina_Bool *allow_0, Eina_Bool *allow_90,
Eina_Bool *allow_180, Eina_Bool *allow_270)
{
@@ -6429,7 +6625,7 @@ _efl_ui_win_sticky_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool stick
}
EOLIAN static Eina_Bool
-_efl_ui_win_sticky_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_sticky_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
return sd->sticky;
}
@@ -6450,13 +6646,13 @@ _efl_ui_win_keyboard_mode_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Elm_Win_
}
EOLIAN static Elm_Win_Keyboard_Mode
-_efl_ui_win_keyboard_mode_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_keyboard_mode_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
return sd->kbdmode;
}
EOLIAN static void
-_efl_ui_win_indicator_mode_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Efl_Ui_Win_Indicator_Mode mode)
+_efl_ui_win_indicator_mode_set(Eo *obj, Efl_Ui_Win_Data *sd, Efl_Ui_Win_Indicator_Mode mode)
{
sd->legacy.forbidden = EINA_TRUE;
if (sd->indimode == mode) return;
@@ -6470,27 +6666,39 @@ _efl_ui_win_indicator_mode_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Efl_Ui_
if (!sd->indicator) _indicator_add(sd);
- if (sd->indimode == EFL_UI_WIN_INDICATOR_BG_OPAQUE)
- edje_object_signal_emit(sd->frame_obj, "elm,action,indicator,bg_opaque", "elm");
- else if (sd->indimode == EFL_UI_WIN_INDICATOR_BG_TRANSPARENT)
- edje_object_signal_emit(sd->frame_obj, "elm,action,indicator,bg_transparent", "elm");
- else if (sd->indimode == EFL_UI_WIN_INDICATOR_HIDDEN)
- edje_object_signal_emit(sd->frame_obj, "elm,action,indicator,hidden", "elm");
+ if (elm_widget_is_legacy(obj))
+ {
+ if (sd->indimode == EFL_UI_WIN_INDICATOR_BG_OPAQUE)
+ edje_object_signal_emit(sd->frame_obj, "elm,action,indicator,bg_opaque", "elm");
+ else if (sd->indimode == EFL_UI_WIN_INDICATOR_BG_TRANSPARENT)
+ edje_object_signal_emit(sd->frame_obj, "elm,action,indicator,bg_transparent", "elm");
+ else if (sd->indimode == EFL_UI_WIN_INDICATOR_HIDDEN)
+ edje_object_signal_emit(sd->frame_obj, "elm,action,indicator,hidden", "elm");
+ }
+ else
+ {
+ if (sd->indimode == EFL_UI_WIN_INDICATOR_BG_OPAQUE)
+ edje_object_signal_emit(sd->frame_obj, "efl,action,indicator,bg_opaque", "efl");
+ else if (sd->indimode == EFL_UI_WIN_INDICATOR_BG_TRANSPARENT)
+ edje_object_signal_emit(sd->frame_obj, "efl,action,indicator,bg_transparent", "efl");
+ else if (sd->indimode == EFL_UI_WIN_INDICATOR_HIDDEN)
+ edje_object_signal_emit(sd->frame_obj, "efl,action,indicator,hidden", "efl");
+ }
edje_object_message_signal_process(sd->frame_obj);
evas_object_smart_calculate(sd->frame_obj);
- _elm_win_frame_obj_update(sd);
+ _elm_win_frame_obj_update(sd, 0);
}
EOLIAN static Efl_Ui_Win_Indicator_Mode
-_efl_ui_win_indicator_mode_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd EINA_UNUSED)
+_efl_ui_win_indicator_mode_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd EINA_UNUSED)
{
sd->legacy.forbidden = EINA_TRUE;
return sd->indimode;
}
EOLIAN static Eina_Bool
-_efl_ui_win_efl_ui_focus_object_focus_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_efl_ui_focus_object_focus_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
// Bypass widget implementation here.
return ecore_evas_focus_get(sd->ee);
@@ -6503,13 +6711,13 @@ _efl_ui_win_screen_constrain_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_
}
EOLIAN static Eina_Bool
-_efl_ui_win_screen_constrain_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_screen_constrain_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
return sd->constrain;
}
EOLIAN static Eina_Size2D
-_efl_ui_win_efl_screen_screen_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_efl_screen_screen_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
Eina_Size2D sz;
ecore_evas_screen_geometry_get(sd->ee, NULL, NULL, &sz.w, &sz.h);
@@ -6517,13 +6725,13 @@ _efl_ui_win_efl_screen_screen_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
}
EOLIAN static void
-_efl_ui_win_efl_screen_screen_dpi_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, int *xdpi, int *ydpi)
+_efl_ui_win_efl_screen_screen_dpi_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, int *xdpi, int *ydpi)
{
ecore_evas_screen_dpi_get(sd->ee, xdpi, ydpi);
}
EOLIAN static int
-_efl_ui_win_efl_screen_screen_rotation_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_efl_screen_screen_rotation_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
//TODO: query to wm about device's rotation
(void)sd;
@@ -6595,7 +6803,7 @@ _efl_ui_win_keygrab_unset(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *
}
EOLIAN static void
-_efl_ui_win_elm_widget_focus_highlight_enabled_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool enabled)
+_efl_ui_win_efl_ui_widget_focus_highlight_enabled_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool enabled)
{
// Do not call efl_super() here. Only Win handles this property.
enabled = !!enabled;
@@ -6611,7 +6819,7 @@ _efl_ui_win_elm_widget_focus_highlight_enabled_set(Eo *obj EINA_UNUSED, Efl_Ui_W
}
EOLIAN static Eina_Bool
-_efl_ui_win_elm_widget_focus_highlight_enabled_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_efl_ui_widget_focus_highlight_enabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
// Do not call efl_super() here. Only Win handles this property.
return sd->focus_highlight.enabled;
@@ -6630,7 +6838,7 @@ _elm_win_theme_internal(Eo *obj, Efl_Ui_Win_Data *sd)
edje_object_mirrored_set(sd->legacy.edje, efl_ui_mirrored_get(obj));
edje_object_scale_set(sd->legacy.edje,
- efl_gfx_scale_get(obj) * elm_config_scale_get());
+ efl_gfx_entity_scale_get(obj) * elm_config_scale_get());
efl_event_callback_legacy_call(obj, EFL_UI_WIN_EVENT_THEME_CHANGED, NULL);
ret = efl_ui_widget_on_disabled_update(obj, elm_widget_disabled_get(obj));
@@ -6647,7 +6855,7 @@ _elm_win_theme_internal(Eo *obj, Efl_Ui_Win_Data *sd)
}
EOLIAN static Efl_Ui_Theme_Apply
-_efl_ui_win_elm_widget_theme_apply(Eo *obj, Efl_Ui_Win_Data *sd)
+_efl_ui_win_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Win_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
@@ -6663,7 +6871,7 @@ _efl_ui_win_elm_widget_theme_apply(Eo *obj, Efl_Ui_Win_Data *sd)
}
EOLIAN static Eina_Bool
-_efl_ui_win_elm_widget_focus_highlight_style_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *style)
+_efl_ui_win_efl_ui_widget_focus_highlight_style_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *style)
{
// Do not call efl_super() here. Only Win handles this property.
if (!eina_stringshare_replace(&sd->focus_highlight.style, style))
@@ -6675,14 +6883,14 @@ _efl_ui_win_elm_widget_focus_highlight_style_set(Eo *obj EINA_UNUSED, Efl_Ui_Win
}
EOLIAN static const char*
-_efl_ui_win_elm_widget_focus_highlight_style_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_efl_ui_widget_focus_highlight_style_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
// Do not call efl_super() here. Only Win handles this property.
return sd->focus_highlight.style;
}
EOLIAN static void
-_efl_ui_win_elm_widget_focus_highlight_animate_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool animate)
+_efl_ui_win_efl_ui_widget_focus_highlight_animate_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool animate)
{
// Do not call efl_super() here. Only Win handles this property.
animate = !!animate;
@@ -6695,14 +6903,14 @@ _efl_ui_win_elm_widget_focus_highlight_animate_set(Eo *obj EINA_UNUSED, Efl_Ui_W
}
EOLIAN static Eina_Bool
-_efl_ui_win_elm_widget_focus_highlight_animate_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_efl_ui_widget_focus_highlight_animate_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
// Do not call efl_super() here. Only Win handles this property.
return sd->focus_highlight.animate;
}
EOLIAN static const char *
-_efl_ui_win_stack_id_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_stack_id_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
return sd->stack_id;
}
@@ -6726,7 +6934,7 @@ _efl_ui_win_stack_master_id_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const
}
EOLIAN static const char *
-_efl_ui_win_stack_master_id_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_stack_master_id_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
return sd->stack_master_id;
}
@@ -6745,7 +6953,7 @@ _efl_ui_win_stack_base_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool b
}
EOLIAN static Eina_Bool
-_efl_ui_win_stack_base_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_stack_base_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
return sd->stack_base;
}
@@ -6956,10 +7164,8 @@ _on_atspi_bus_connected(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUS
}
EOLIAN static void
-_efl_ui_win_class_constructor(Efl_Class *klass)
+_efl_ui_win_class_constructor(Efl_Class *klass EINA_UNUSED)
{
- evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
-
if (_elm_config->atspi_mode)
{
Eo *bridge = _elm_atspi_bridge_get();
@@ -6975,17 +7181,8 @@ _efl_ui_win_efl_object_debug_name_override(Eo *obj, Efl_Ui_Win_Data *pd, Eina_St
eina_strbuf_append_printf(sb, ":'%s':'%s'", pd->name, pd->title);
}
-EOLIAN static Eo*
-_efl_ui_win_efl_access_parent_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd EINA_UNUSED)
-{
- // attach all kinds of windows directly to ATSPI application root object
- Eo *root;
- root = efl_access_root_get(EFL_ACCESS_MIXIN);
- return root;
-}
-
EOLIAN static const Efl_Access_Action_Data*
-_efl_ui_win_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd EINA_UNUSED)
+_efl_ui_win_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "move,previous", "move", "previous", _key_action_move},
@@ -7000,10 +7197,10 @@ _efl_ui_win_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Efl_Ui
}
EOLIAN static Efl_Access_State_Set
-_efl_ui_win_efl_access_state_set_get(Eo *obj, Efl_Ui_Win_Data *sd EINA_UNUSED)
+_efl_ui_win_efl_access_object_state_set_get(const Eo *obj, Efl_Ui_Win_Data *sd EINA_UNUSED)
{
Efl_Access_State_Set ret;
- ret = efl_access_state_set_get(efl_super(obj, MY_CLASS));
+ ret = efl_access_object_state_set_get(efl_super(obj, MY_CLASS));
if (elm_win_focus_get(obj))
STATE_TYPE_SET(ret, EFL_ACCESS_STATE_ACTIVE);
@@ -7012,22 +7209,22 @@ _efl_ui_win_efl_access_state_set_get(Eo *obj, Efl_Ui_Win_Data *sd EINA_UNUSED)
}
EOLIAN static const char*
-_efl_ui_win_efl_access_name_get(Eo *obj, Efl_Ui_Win_Data *sd EINA_UNUSED)
+_efl_ui_win_efl_access_object_i18n_name_get(const Eo *obj, Efl_Ui_Win_Data *sd EINA_UNUSED)
{
const char *ret;
- ret = efl_access_name_get(efl_super(obj, EFL_UI_WIN_CLASS));
+ ret = efl_access_object_i18n_name_get(efl_super(obj, EFL_UI_WIN_CLASS));
if (ret) return ret;
const char *name = elm_win_title_get(obj);
return name;
}
EOLIAN static Eina_Rect
-_efl_ui_win_efl_access_component_extents_get(Eo *obj, Efl_Ui_Win_Data *_pd EINA_UNUSED, Eina_Bool screen_coords)
+_efl_ui_win_efl_access_component_extents_get(const Eo *obj, Efl_Ui_Win_Data *_pd EINA_UNUSED, Eina_Bool screen_coords)
{
Eina_Rect r;
int ee_x, ee_y;
- r = efl_gfx_geometry_get(obj);
+ r = efl_gfx_entity_geometry_get(obj);
r.x = r.y = 0;
if (screen_coords)
{
@@ -7043,7 +7240,7 @@ _efl_ui_win_efl_access_component_extents_get(Eo *obj, Efl_Ui_Win_Data *_pd EINA_
}
EOLIAN static Eina_Bool
-_efl_ui_win_efl_input_state_modifier_enabled_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd,
+_efl_ui_win_efl_input_state_modifier_enabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd,
Efl_Input_Modifier mod, const Efl_Input_Device *seat)
{
const Evas_Modifier *m = evas_key_modifier_get(pd->evas);
@@ -7052,7 +7249,7 @@ _efl_ui_win_efl_input_state_modifier_enabled_get(Eo *obj EINA_UNUSED, Efl_Ui_Win
}
EOLIAN static Eina_Bool
-_efl_ui_win_efl_input_state_lock_enabled_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd,
+_efl_ui_win_efl_input_state_lock_enabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd,
Efl_Input_Lock lock, const Efl_Input_Device *seat)
{
const Evas_Lock *m = evas_key_lock_get(pd->evas);
@@ -7068,6 +7265,9 @@ _efl_ui_win_efl_object_provider_find(const Eo *obj,
if (klass == EFL_UI_WIN_CLASS)
return (Eo *)obj;
+ // attach all kinds of windows directly to ATSPI application root object
+ if (klass == EFL_ACCESS_OBJECT_MIXIN) return efl_access_object_access_root_get(EFL_ACCESS_OBJECT_MIXIN);
+
if (klass == EFL_UI_FOCUS_PARENT_PROVIDER_INTERFACE)
return pd->provider;
@@ -7099,9 +7299,17 @@ _elm_win_bg_set(Efl_Ui_Win_Data *sd, Eo *bg)
if (!elm_widget_sub_object_add(sd->obj, bg))
return EINA_FALSE;
- if (!edje_object_part_swallow(sd->frame_obj, "elm.swallow.background", bg))
- return EINA_FALSE;
- efl_gfx_visible_set(bg, 1);
+ if (elm_widget_is_legacy(sd->obj))
+ {
+ if (!edje_object_part_swallow(sd->frame_obj, "elm.swallow.background", bg))
+ return EINA_FALSE;
+ }
+ else
+ {
+ if (!edje_object_part_swallow(sd->frame_obj, "efl.background", bg))
+ return EINA_FALSE;
+ }
+ efl_gfx_entity_visible_set(bg, 1);
efl_gfx_size_hint_align_set(bg, -1, -1);
efl_gfx_size_hint_weight_set(bg, 1, 1);
efl_wref_add(bg, &sd->bg);
@@ -7124,7 +7332,7 @@ _elm_win_bg_must_swallow(Efl_Ui_Win_Data *sd)
sd->legacy.bg_must_swallow_init = 1;
bg = elm_bg_add(sd->obj);
- wd = efl_data_scope_get(bg, ELM_WIDGET_CLASS);
+ wd = efl_data_scope_get(bg, EFL_UI_WIDGET_CLASS);
if (wd)
{
version = edje_object_data_get(wd->resize_obj, "version");
@@ -7153,10 +7361,21 @@ _elm_win_standard_init(Eo *obj)
}
else
{
+ Eo *bg;
+
/* Legacy theme compatibility */
DBG("Detected legacy theme used for elm_bg. Swallowing object.");
sd->csd.need_bg_solid = EINA_FALSE;
- _elm_win_bg_set(sd, efl_add(EFL_UI_BG_WIDGET_CLASS, obj));
+ if (sd->legacy.ctor)
+ bg = elm_bg_add(obj);
+ else
+ {
+ // Note: This code path is probably not necessary (custom legacy
+ // theme but efl_add'ed window -- all efl_add'ed widgets would
+ // use default theme)
+ bg = efl_add(EFL_UI_BG_WIDGET_CLASS, obj);
+ }
+ _elm_win_bg_set(sd, bg);
}
_elm_win_frame_style_update(sd, 0, 1);
@@ -7266,7 +7485,7 @@ _efl_ui_win_part_file_set(Eo *obj, Efl_Ui_Win_Data *sd, const char *part, const
if (file)
{
bg = efl_add(EFL_UI_IMAGE_CLASS, obj);
- efl_image_scale_type_set(bg, EFL_IMAGE_SCALE_TYPE_FIT_OUTSIDE);
+ efl_gfx_image_scale_type_set(bg, EFL_GFX_IMAGE_SCALE_TYPE_FIT_OUTSIDE);
ok = efl_file_set(bg, file, key);
if (!ok) ELM_SAFE_DEL(bg);
_elm_win_bg_set(sd, bg);
@@ -7316,7 +7535,7 @@ _efl_ui_win_part_efl_gfx_color_color_set(Eo *obj, void *_pd EINA_UNUSED, int r,
}
static void
-_efl_ui_win_part_efl_gfx_color_color_get(Eo *obj, void *_pd EINA_UNUSED, int *r, int *g, int *b, int *a)
+_efl_ui_win_part_efl_gfx_color_color_get(const Eo *obj, void *_pd EINA_UNUSED, int *r, int *g, int *b, int *a)
{
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
Efl_Ui_Win_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
@@ -7332,7 +7551,7 @@ _efl_ui_win_part_efl_file_file_set(Eo *obj, void *_pd EINA_UNUSED, const char *f
}
static void
-_efl_ui_win_part_efl_file_file_get(Eo *obj, void *_pd EINA_UNUSED, const char **file, const char **key)
+_efl_ui_win_part_efl_file_file_get(const Eo *obj, void *_pd EINA_UNUSED, const char **file, const char **key)
{
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
Efl_Ui_Win_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
@@ -8027,9 +8246,12 @@ elm_win_shaped_set(Evas_Object *obj, Eina_Bool shaped)
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
if (!sd) return;
- TRAP(sd, shaped_set, shaped);
+ shaped = !!shaped;
+
#ifdef HAVE_ELEMENTARY_X
- _elm_win_xwin_update(sd);
+ if (sd->x.shaped == shaped) return;
+ sd->x.shaped = shaped;
+ TRAP(sd, shaped_set, shaped);
#endif
}
@@ -8191,14 +8413,14 @@ _elm_win_window_id_get(Efl_Ui_Win_Data *sd)
{
#if HAVE_ELEMENTARY_WL2
if (sd->wl.win)
- return (Ecore_Window)ecore_wl2_window_id_get(sd->wl.win);
+ return (Ecore_Window)sd->wl.win;
if (sd->parent)
{
Ecore_Wl2_Window *parent;
parent = elm_win_wl_window_get(sd->parent);
if (parent)
- return (Ecore_Window)ecore_wl2_window_id_get(parent);
+ return (Ecore_Window)parent;
}
#endif
#ifdef HAVE_ELEMENTARY_X
@@ -8241,6 +8463,7 @@ elm_win_window_id_get(const Evas_Object *obj)
if (!evas_object_smart_type_check_ptr(obj, MY_CLASS_NAME_LEGACY))
{
Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
+ if (!ee) return 0;
return ecore_evas_window_get(ee);
}
@@ -8313,62 +8536,6 @@ _fake_canvas_set(Evas_Object *obj, Ecore_Evas *oee)
_elm_win_need_frame_adjust(sd, ecore_evas_engine_name_get(oee));
}
-EAPI Evas_Object *
-elm_win_add(Evas_Object *parent, const char *name, Efl_Ui_Win_Type type)
-{
- const Efl_Class *klass = MY_CLASS;
-
- switch ((int) type)
- {
- case ELM_WIN_INLINED_IMAGE: klass = EFL_UI_WIN_INLINED_CLASS; break;
- case ELM_WIN_SOCKET_IMAGE: klass = EFL_UI_WIN_SOCKET_CLASS; break;
- default: break;
- }
-
- return elm_legacy_add(klass, parent,
- efl_ui_win_name_set(efl_added, name),
- efl_ui_win_type_set(efl_added, type));
-}
-
-EAPI Evas_Object *
-elm_win_fake_add(Ecore_Evas *ee)
-{
- return elm_legacy_add(MY_CLASS, NULL,
- _fake_canvas_set(efl_added, ee),
- efl_ui_win_name_set(efl_added, NULL),
- efl_ui_win_type_set(efl_added, ELM_WIN_FAKE));
-}
-
-EAPI Evas_Object *
-elm_win_util_standard_add(const char *name, const char *title)
-{
- Evas_Object *win;
-
- win = elm_legacy_add(EFL_UI_WIN_CLASS, NULL,
- efl_text_set(efl_added, title),
- efl_ui_win_name_set(efl_added, name),
- efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC));
- if (!win) return NULL;
-
- _elm_win_standard_init(win);
- return win;
-}
-
-EAPI Evas_Object *
-elm_win_util_dialog_add(Evas_Object *parent, const char *name, const char *title)
-{
- Evas_Object *win;
-
- win = elm_legacy_add(EFL_UI_WIN_CLASS, parent,
- efl_text_set(efl_added, title),
- efl_ui_win_name_set(efl_added, name),
- efl_ui_win_type_set(efl_added, EFL_UI_WIN_DIALOG_BASIC));
- if (!win) return NULL;
-
- _elm_win_standard_init(win);
- return win;
-}
-
/**
* @internal
*
@@ -8393,7 +8560,7 @@ _window_layout_stack(Evas_Object *o, Evas_Object_Box_Data *p, void *data)
double weight_y = EVAS_HINT_EXPAND;
ELM_WIN_DATA_GET(data, sd);
- if (sd->main_menu && efl_gfx_visible_get(sd->main_menu))
+ if (sd->main_menu && efl_gfx_entity_visible_get(sd->main_menu))
evas_object_size_hint_combined_min_get(sd->main_menu, &menuw, NULL);
EINA_LIST_FOREACH(p->children, l, opt)
@@ -8434,7 +8601,12 @@ _elm_win_legacy_init(Efl_Ui_Win_Data *sd)
sd->legacy.box = evas_object_box_add(sd->evas);
evas_object_box_layout_set(sd->legacy.box, _window_layout_stack, sd->obj, NULL);
- edje_object_part_swallow(sd->legacy.edje, "elm.swallow.contents", sd->legacy.box);
+
+ if (elm_widget_is_legacy(sd->obj))
+ edje_object_part_swallow(sd->legacy.edje, "elm.swallow.contents", sd->legacy.box);
+ else
+ edje_object_part_swallow(sd->legacy.edje, "efl.contents", sd->legacy.box);
+
evas_object_move(sd->legacy.edje, 0, 0);
evas_object_resize(sd->legacy.edje, 1, 1);
if (sd->type != ELM_WIN_FAKE)
@@ -8663,3 +8835,76 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_win, Efl_Ui_Win_Data)
EFL_OBJECT_OP_FUNC(efl_canvas_object_legacy_ctor, _efl_ui_win_efl_canvas_object_legacy_ctor)
#include "efl_ui_win.eo.c"
+
+static void
+_efl_ui_win_legacy_class_constructor(Efl_Class *klass)
+{
+ evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
+}
+
+EOLIAN static Eo *
+_efl_ui_win_legacy_efl_object_finalize(Eo *obj, void *pd EINA_UNUSED)
+{
+ obj = efl_finalize(efl_super(obj, EFL_UI_WIN_LEGACY_CLASS));
+ efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
+ return obj;
+}
+
+EAPI Evas_Object *
+elm_win_add(Evas_Object *parent, const char *name, Efl_Ui_Win_Type type)
+{
+ const Efl_Class *klass = EFL_UI_WIN_LEGACY_CLASS;
+
+ switch ((int) type)
+ {
+ case ELM_WIN_INLINED_IMAGE: klass = EFL_UI_WIN_INLINED_LEGACY_CLASS; break;
+ case ELM_WIN_SOCKET_IMAGE: klass = EFL_UI_WIN_SOCKET_LEGACY_CLASS; break;
+ default: break;
+ }
+
+ return elm_legacy_add(klass, parent,
+ efl_ui_win_name_set(efl_added, name),
+ efl_ui_win_type_set(efl_added, type));
+}
+
+
+EAPI Evas_Object *
+elm_win_fake_add(Ecore_Evas *ee)
+{
+ return elm_legacy_add(EFL_UI_WIN_LEGACY_CLASS, NULL,
+ _fake_canvas_set(efl_added, ee),
+ efl_ui_win_name_set(efl_added, NULL),
+ efl_ui_win_type_set(efl_added, ELM_WIN_FAKE));
+}
+
+EAPI Evas_Object *
+elm_win_util_standard_add(const char *name, const char *title)
+{
+ Evas_Object *win;
+
+ win = elm_legacy_add(EFL_UI_WIN_LEGACY_CLASS, NULL,
+ efl_text_set(efl_added, title),
+ efl_ui_win_name_set(efl_added, name),
+ efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC));
+ if (!win) return NULL;
+
+ _elm_win_standard_init(win);
+ return win;
+}
+
+EAPI Evas_Object *
+elm_win_util_dialog_add(Evas_Object *parent, const char *name, const char *title)
+{
+ Evas_Object *win;
+
+ win = elm_legacy_add(EFL_UI_WIN_LEGACY_CLASS, parent,
+ efl_text_set(efl_added, title),
+ efl_ui_win_name_set(efl_added, name),
+ efl_ui_win_type_set(efl_added, EFL_UI_WIN_DIALOG_BASIC));
+ if (!win) return NULL;
+
+ _elm_win_standard_init(win);
+ return win;
+}
+
+#include "efl_ui_win_legacy.eo.c"
diff --git a/src/lib/elementary/efl_ui_win.eo b/src/lib/elementary/efl_ui_win.eo
index ed23a44aee..b235c5fdd5 100644
--- a/src/lib/elementary/efl_ui_win.eo
+++ b/src/lib/elementary/efl_ui_win.eo
@@ -1,4 +1,4 @@
-enum Efl.Ui.Win.Type
+enum Efl.Ui.Win_Type
{
[[Defines the types of window that can be created
@@ -19,7 +19,7 @@ enum Efl.Ui.Win.Type
dock, [[The window is used as a dock or panel. Usually would be kept on top
of any other window by the Window Manager.]]
toolbar, [[The window is used to hold a floating toolbar, or similar.]]
- menu, [[Similar to #ELM_WIN_TOOLBAR.]]
+ menu, [[Similar to @.toolbar.]]
utility, [[A persistent utility window, like a toolbox or palette.]]
splash, [[Splash window for a starting up application.]]
dropdown_menu, [[The window is a dropdown menu, as when an entry in a
@@ -27,7 +27,7 @@ enum Efl.Ui.Win.Type
This hint exists for completion only, as the EFL way of
implementing a menu would not normally use a separate
window for its contents.]]
- popup_menu, [[Like #ELM_WIN_DROPDOWN_MENU, but for the menu triggered by
+ popup_menu, [[Like @.dropdown_menu, but for the menu triggered by
right-clicking an object.]]
tooltip, [[The window is a tooltip. A short piece of explanatory text that
typically appear after the mouse cursor hovers over an object
@@ -36,9 +36,6 @@ enum Efl.Ui.Win.Type
a new E-Mail received.]]
combo, [[A window holding the contents of a combo box. Not usually used in
the EFL.]]
- dnd, [[Used to indicate the window is a representation of an object being
- dragged across different windows, or even applications. Typically
- used with elm_win_override_set().]]
/* Some types have been removed from EO. Skipping to 17. */
naviframe_basic = 17 [[Used for naviframe style replacement with a back
button instead of a close button.
@@ -46,7 +43,7 @@ enum Efl.Ui.Win.Type
]]
}
-enum Efl.Ui.Win.Keyboard_Mode
+enum Efl.Ui.Win_Keyboard_Mode
{
[[The different layouts that can be requested for the virtual keyboard.
@@ -73,7 +70,7 @@ enum Efl.Ui.Win.Keyboard_Mode
j2me [[J2ME keyboard layout]]
}
-enum Efl.Ui.Win.Indicator_Mode
+enum Efl.Ui.Win_Indicator_Mode
{
[[Defines the type indicator that can be shown]]
legacy: efl_ui_win_indicator;
@@ -89,7 +86,7 @@ enum Efl.Ui.Win.Indicator_Mode
If user flicks the upper side of window, the indicator is shown temporarily.]]
}
-enum Efl.Ui.Win.Keygrab_Mode
+enum Efl.Ui.Win_Keygrab_Mode
{
[[Define the keygrab modes of window. A window may send commands to the
Keyrouter according this mode, and perform different actions.]]
@@ -108,7 +105,7 @@ enum Efl.Ui.Win.Keygrab_Mode
window]]
}
-enum Efl.Ui.Win.Modal_Mode
+enum Efl.Ui.Win_Modal_Mode
{
[[Defines the mode of a modal window]]
legacy: efl_ui_win_modal;
@@ -117,7 +114,7 @@ enum Efl.Ui.Win.Modal_Mode
modal [[The window is modal window.]]
}
-enum Efl.Ui.Win.Urgent_Mode
+enum Efl.Ui.Win_Urgent_Mode
{
[[Defines the mode of a urgent window.]]
legacy: efl_ui_win_urgent;
@@ -126,7 +123,7 @@ enum Efl.Ui.Win.Urgent_Mode
urgent [[The window is a urgent window.]]
}
-enum Efl.Ui.Win.Move_Resize_Mode
+enum Efl.Ui.Win_Move_Resize_Mode
{
[[Define the move or resize mode of window.
@@ -157,16 +154,14 @@ enum Efl.Ui.Win.Move_Resize_Mode
right = (1 << 4) [[Start resizing window to the right]]
}
-class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Efl.Canvas.Pointer, Efl.Access.Window,
- Efl.Access.Component, Efl.Access.Widget.Action,
- Efl.Content, Efl.Input.State, Efl.Input.Interface, Efl.Screen,
- Efl.Gfx.Size.Hint, Efl.Text, Efl.Config.Global, Efl.Part,
- Efl.Ui.Focus.Manager )
+class Efl.Ui.Win (Efl.Ui.Widget, Efl.Canvas.Scene, Efl.Canvas.Pointer, Efl.Access.Window,
+ Efl.Access.Component, Efl.Access.Widget.Action,
+ Efl.Content, Efl.Input.State, Efl.Input.Interface, Efl.Screen,
+ Efl.Gfx.Size_Hint, Efl.Text, Efl.Config_Global, Efl.Part,
+ Efl.Ui.Widget_Focus_Manager, Efl.Ui.Focus.Manager_Window_Root)
{
[[Efl UI window class]]
legacy_prefix: elm_win;
- eo_prefix: efl_ui_win;
- event_prefix: efl_ui_win;
methods {
@property indicator_mode {
[[In some environments you may have an indicator that
@@ -187,7 +182,7 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Efl.Canvas.Pointer, Efl.Access.Window,
legacy: null;
}
values {
- type: Efl.Ui.Win.Indicator_Mode; [[The mype, one of #Efl_Ui_Win_Indicator_Mode.]]
+ type: Efl.Ui.Win_Indicator_Mode; [[The mype, one of #Efl_Ui_Win_Indicator_Mode.]]
}
}
@property keyboard_mode {
@@ -198,7 +193,7 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Efl.Canvas.Pointer, Efl.Access.Window,
[[Get the keyboard mode of the window.]]
}
values {
- mode: Efl.Ui.Win.Keyboard_Mode; [[The mode, one of #Efl_Ui_Win_Keyboard_Mode.]]
+ mode: Efl.Ui.Win_Keyboard_Mode; [[The mode, one of #Efl_Ui_Win_Keyboard_Mode.]]
}
}
@property wm_available_rotations {
@@ -393,7 +388,7 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Efl.Canvas.Pointer, Efl.Access.Window,
legacy: null;
}
values {
- urgent: Efl.Ui.Win.Urgent_Mode;
+ urgent: Efl.Ui.Win_Urgent_Mode;
[[The mode of a urgent window, one of #Efl_Ui_Win_Urgent_Mode.]]
}
}
@@ -407,7 +402,7 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Efl.Canvas.Pointer, Efl.Access.Window,
legacy: null;
}
values {
- modal: Efl.Ui.Win.Modal_Mode; [[The mode of a window, one of #Efl_Ui_Win_Modal_Mode.]]
+ modal: Efl.Ui.Win_Modal_Mode; [[The mode of a window, one of #Efl_Ui_Win_Modal_Mode.]]
}
}
@property noblank {
@@ -485,7 +480,7 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Efl.Canvas.Pointer, Efl.Access.Window,
Note: Once set, it cannot be modified afterwards.
]]
set {
- [[Name can on be set before finalize.]]
+ [[Name can only be set before finalize.]]
legacy: null;
}
get {
@@ -515,7 +510,7 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Efl.Canvas.Pointer, Efl.Access.Window,
legacy: elm_win_type_get;
}
values {
- type: Efl.Ui.Win.Type(Efl.Ui.Win.Type.unknown); [[Window type]]
+ type: Efl.Ui.Win_Type(Efl.Ui.Win_Type.unknown); [[Window type]]
}
}
@property accel_preference {
@@ -703,7 +698,7 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Efl.Canvas.Pointer, Efl.Access.Window,
@in not_modifiers: Efl.Input.Modifier; [[A combinaison of modifier
keys that must not be present to trigger the event. Not supported yet.]]
@in priority: int; [[Not supported yet.]]
- @in grab_mode: Efl.Ui.Win.Keygrab_Mode; [[Describes how the key should
+ @in grab_mode: Efl.Ui.Win_Keygrab_Mode; [[Describes how the key should
be grabbed, wrt. focus and stacking.]]
}
legacy: null;
@@ -727,7 +722,7 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Efl.Canvas.Pointer, Efl.Access.Window,
[[Start moving or resizing the window.
The user can request the display server to start moving or resizing
- the window by combining modes from @Efl.Ui.Win.Move_Resize_Mode.
+ the window by combining modes from @Efl.Ui.Win_Move_Resize_Mode.
This API can only be called if none of the following conditions is
true:
@@ -746,15 +741,15 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Efl.Canvas.Pointer, Efl.Access.Window,
Currently, only the following 9 combinations are allowed, and
possibly more combinations may be added in the future:
- 1. @Efl.Ui.Win.Move_Resize_Mode.move
- 2. @Efl.Ui.Win.Move_Resize_Mode.top
- 3. @Efl.Ui.Win.Move_Resize_Mode.bottom
- 4. @Efl.Ui.Win.Move_Resize_Mode.left
- 5. @Efl.Ui.Win.Move_Resize_Mode.right
- 6. @Efl.Ui.Win.Move_Resize_Mode.top | @Efl.Ui.Win.Move_Resize_Mode.left
- 7. @Efl.Ui.Win.Move_Resize_Mode.top | @Efl.Ui.Win.Move_Resize_Mode.right
- 8. @Efl.Ui.Win.Move_Resize_Mode.bottom | @Efl.Ui.Win.Move_Resize_Mode.left
- 9. @Efl.Ui.Win.Move_Resize_Mode.bottom | @Efl.Ui.Win.Move_Resize_Mode.right
+ 1. @Efl.Ui.Win_Move_Resize_Mode.move
+ 2. @Efl.Ui.Win_Move_Resize_Mode.top
+ 3. @Efl.Ui.Win_Move_Resize_Mode.bottom
+ 4. @Efl.Ui.Win_Move_Resize_Mode.left
+ 5. @Efl.Ui.Win_Move_Resize_Mode.right
+ 6. @Efl.Ui.Win_Move_Resize_Mode.top | @Efl.Ui.Win_Move_Resize_Mode.left
+ 7. @Efl.Ui.Win_Move_Resize_Mode.top | @Efl.Ui.Win_Move_Resize_Mode.right
+ 8. @Efl.Ui.Win_Move_Resize_Mode.bottom | @Efl.Ui.Win_Move_Resize_Mode.left
+ 9. @Efl.Ui.Win_Move_Resize_Mode.bottom | @Efl.Ui.Win_Move_Resize_Mode.right
In particular move and resize cannot happen simultaneously.
@@ -767,7 +762,7 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Efl.Canvas.Pointer, Efl.Access.Window,
return: bool; [[$true if the request was successfully sent to the
display server, $false in case of error.]]
params {
- @in mode: Efl.Ui.Win.Move_Resize_Mode; [[The requested move or
+ @in mode: Efl.Ui.Win_Move_Resize_Mode; [[The requested move or
resize mode.]]
}
}
@@ -776,25 +771,25 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Efl.Canvas.Pointer, Efl.Access.Window,
class.constructor;
Efl.Object.constructor;
Efl.Object.destructor;
+ Efl.Object.provider_find;
Efl.Object.finalize;
Efl.Object.debug_name_override;
- Efl.Gfx.visible { set; }
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set; }
+ Efl.Gfx.Entity.visible { set; }
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
Efl.Gfx.Stack.raise; [[Places the window at the top of the stack, so
that it's not covered by any other window.]]
Efl.Gfx.Stack.lower; [[This action is ignored by the Window.]]
- Elm.Widget.theme_apply;
+ Efl.Ui.Widget.theme_apply;
Efl.Ui.Focus.Object.focus { get; }
- Elm.Widget.focus_highlight_style { get; set; }
- Elm.Widget.focus_highlight_enabled { get; set; }
- Elm.Widget.focus_highlight_animate { get; set; }
- Elm.Widget.on_focus_update;
- Elm.Widget.widget_event;
- Elm.Widget.focus_manager_create;
- Efl.Access.parent { get; }
- Efl.Access.state_set { get; }
- Efl.Access.name { get; }
+ Efl.Ui.Widget.focus_highlight_style { get; set; }
+ Efl.Ui.Widget.focus_highlight_enabled { get; set; }
+ Efl.Ui.Widget.focus_highlight_animate { get; set; }
+ Efl.Ui.Focus.Object.on_focus_update;
+ Efl.Ui.Widget.widget_event;
+ Efl.Ui.Widget_Focus_Manager.focus_manager_create;
+ Efl.Access.Object.state_set { get; }
+ Efl.Access.Object.i18n_name { get; }
Efl.Access.Component.extents { get; }
Efl.Access.Widget.Action.elm_actions { get; }
Efl.Input.State.modifier_enabled { get; }
@@ -802,28 +797,27 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Efl.Canvas.Pointer, Efl.Access.Window,
Efl.Screen.screen_dpi { get; }
Efl.Screen.screen_rotation { get; }
Efl.Screen.screen_size { get; }
- Efl.Gfx.Size.Hint.hint_base { get; set; }
- Efl.Gfx.Size.Hint.hint_step { get; set; }
- Efl.Gfx.Size.Hint.hint_aspect { set; }
- Efl.Gfx.Size.Hint.hint_weight { set; }
- Efl.Gfx.Size.Hint.hint_max { set; }
+ Efl.Gfx.Size_Hint.hint_base { get; set; }
+ Efl.Gfx.Size_Hint.hint_step { get; set; }
+ Efl.Gfx.Size_Hint.hint_aspect { set; }
+ Efl.Gfx.Size_Hint.hint_weight { set; }
+ Efl.Gfx.Size_Hint.hint_max { set; }
Efl.Text.text { get; set; }
- Efl.Canvas.pointer_position { get; }
+ Efl.Canvas.Scene.pointer_position { get; }
Efl.Canvas.Pointer.pointer_inside { get; }
- Efl.Canvas.pointer_iterate;
- Efl.Canvas.image_max_size { get; }
- Efl.Canvas.smart_objects_calculate;
- Efl.Canvas.objects_at_xy_get;
- Efl.Canvas.object_top_at_xy_get;
- Efl.Canvas.objects_in_rectangle_get;
- Efl.Canvas.object_top_in_rectangle_get;
+ Efl.Canvas.Scene.pointer_iterate;
+ Efl.Canvas.Scene.image_max_size { get; }
+ Efl.Canvas.Scene.smart_objects_calculate;
+ Efl.Canvas.Scene.objects_at_xy_get;
+ Efl.Canvas.Scene.object_top_at_xy_get;
+ Efl.Canvas.Scene.objects_in_rectangle_get;
+ Efl.Canvas.Scene.object_top_in_rectangle_get;
//Efl.Canvas.seats;
- Efl.Canvas.device { get; }
- Efl.Canvas.seat { get; }
+ Efl.Canvas.Scene.device { get; }
+ Efl.Canvas.Scene.seat { get; }
Efl.Content.content { get; set; }
Efl.Content.content_unset;
- Efl.Part.part;
- Efl.Object.provider_find;
+ Efl.Part.part_get;
}
constructors {
.win_name;
@@ -831,24 +825,23 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Efl.Canvas.Pointer, Efl.Access.Window,
.accel_preference;
}
events {
- delete,request; [[Called when the window receives a delete request]]
- withdrawn; [[Called when window is withdrawn]]
- iconified; [[Called when window is iconified]]
- normal; [[Called when window is set to normal state]]
- stick; [[Called when window is set as sticky]]
- unstick; [[Called when window is no longer set as sticky]]
- fullscreen; [[Called when window is set to fullscreen]]
- unfullscreen; [[Called when window is no longer set to fullscreen]]
- maximized; [[Called when window is set to maximized]]
- unmaximized; [[Called when window is no longer set to maximized]]
- ioerr; [[Called on input output error]] /*FIXME Better explanation needed */
- indicator,prop,changed; [[Called when indicator is property changed]]
- rotation,changed; [[Called when window rotation is changed]]
- profile,changed; [[Called when profile is changed]]
- wm,rotation,changed; [[Called when window manager rotation is changed]]
- theme,changed; [[Called when theme is changed]]
- elm,action,block_menu; [[Called when elementary block menu action occurs]]
- pause; [[Called when the window is not going be displayed for some time]]
- resume; [[Called before a window is rendered after a pause event]]
+ delete,request: void; [[Called when the window receives a delete request]]
+ withdrawn: void; [[Called when window is withdrawn]]
+ iconified: void; [[Called when window is iconified]]
+ normal: void; [[Called when window is set to normal state]]
+ stick: void; [[Called when window is set as sticky]]
+ unstick: void; [[Called when window is no longer set as sticky]]
+ fullscreen: void; [[Called when window is set to fullscreen]]
+ unfullscreen: void; [[Called when window is no longer set to fullscreen]]
+ maximized: void; [[Called when window is set to maximized]]
+ unmaximized: void; [[Called when window is no longer set to maximized]]
+ indicator,prop,changed: void; [[Called when indicator is property changed]]
+ rotation,changed: void; [[Called when window rotation is changed]]
+ profile,changed: void; [[Called when profile is changed]]
+ wm,rotation,changed: void; [[Called when window manager rotation is changed]]
+ theme,changed: void; [[Called when theme is changed]]
+ elm,action,block_menu: void; [[Called when elementary block menu action occurs]]
+ pause: void; [[Called when the window is not going be displayed for some time]]
+ resume: void; [[Called before a window is rendered after a pause event]]
}
}
diff --git a/src/lib/elementary/efl_ui_win_inlined.c b/src/lib/elementary/efl_ui_win_inlined.c
index dfa6306817..54407b7705 100644
--- a/src/lib/elementary/efl_ui_win_inlined.c
+++ b/src/lib/elementary/efl_ui_win_inlined.c
@@ -7,8 +7,12 @@
#include <Elementary.h>
+#include "elm_priv.h"
+#include "efl_ui_win_inlined_legacy.eo.h"
+
#define MY_CLASS EFL_UI_WIN_INLINED_CLASS
#define MY_CLASS_NAME "Efl.Ui.Win_Inlined"
+#define MY_CLASS_NAME_LEGACY "elm_win"
typedef struct
{
@@ -24,7 +28,7 @@ efl_ui_win_inlined_parent_set(Eo *obj, Efl_Canvas_Object *parent)
}
EOLIAN static Efl_Canvas_Object *
-_efl_ui_win_inlined_inlined_parent_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Inlined_Data *pd)
+_efl_ui_win_inlined_inlined_parent_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Inlined_Data *pd)
{
return pd->parent;
}
@@ -39,3 +43,19 @@ _efl_ui_win_inlined_efl_object_finalize(Eo *obj, Efl_Ui_Win_Inlined_Data *pd EIN
}
#include "efl_ui_win_inlined.eo.c"
+
+static void
+_efl_ui_win_inlined_legacy_class_constructor(Efl_Class *klass)
+{
+ evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
+}
+
+EOLIAN static Eo *
+_efl_ui_win_inlined_legacy_efl_object_finalize(Eo *obj, void *pd EINA_UNUSED)
+{
+ obj = efl_finalize(efl_super(obj, EFL_UI_WIN_INLINED_LEGACY_CLASS));
+ efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
+ return obj;
+}
+
+#include "efl_ui_win_inlined_legacy.eo.c"
diff --git a/src/lib/elementary/efl_ui_win_inlined_legacy.eo b/src/lib/elementary/efl_ui_win_inlined_legacy.eo
new file mode 100644
index 0000000000..5c954a22e3
--- /dev/null
+++ b/src/lib/elementary/efl_ui_win_inlined_legacy.eo
@@ -0,0 +1,9 @@
+class Efl.Ui.Win_Inlined_Legacy (Efl.Ui.Win_Inlined, Efl.Ui.Legacy)
+{
+ [[Elementary window inlined class]]
+ data: null;
+ implements {
+ class.constructor;
+ Efl.Object.finalize;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_win_legacy.eo b/src/lib/elementary/efl_ui_win_legacy.eo
new file mode 100644
index 0000000000..952464ba71
--- /dev/null
+++ b/src/lib/elementary/efl_ui_win_legacy.eo
@@ -0,0 +1,9 @@
+class Efl.Ui.Win_Legacy (Efl.Ui.Win, Efl.Ui.Legacy)
+{
+ [[Efl UI window class]]
+ data: null;
+ implements {
+ class.constructor;
+ Efl.Object.finalize;
+ }
+}
diff --git a/src/lib/elementary/efl_ui_win_part.eo b/src/lib/elementary/efl_ui_win_part.eo
index 380929c12e..acb6f4349e 100644
--- a/src/lib/elementary/efl_ui_win_part.eo
+++ b/src/lib/elementary/efl_ui_win_part.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Win.Part (Efl.Ui.Widget.Part, Efl.Content, Efl.Gfx, Efl.Gfx.Color,
+class Efl.Ui.Win_Part (Efl.Ui.Widget_Part, Efl.Content, Efl.Gfx.Entity, Efl.Gfx.Color,
Efl.File)
{
[[Efl UI window interal part class]]
diff --git a/src/lib/elementary/efl_ui_win_socket.c b/src/lib/elementary/efl_ui_win_socket.c
index 8c0485a08c..14ddfdc83f 100644
--- a/src/lib/elementary/efl_ui_win_socket.c
+++ b/src/lib/elementary/efl_ui_win_socket.c
@@ -7,8 +7,12 @@
#include <Elementary.h>
+#include "elm_priv.h"
+#include "efl_ui_win_socket_legacy.eo.h"
+
#define MY_CLASS EFL_UI_WIN_SOCKET_CLASS
#define MY_CLASS_NAME "Efl.Ui.Win_Socket"
+#define MY_CLASS_NAME_LEGACY "elm_win"
typedef struct
{
@@ -33,3 +37,19 @@ _efl_ui_win_socket_socket_listen(Eo *obj, Efl_Ui_Win_Socket_Data *pd EINA_UNUSED
}
#include "efl_ui_win_socket.eo.c"
+
+static void
+_efl_ui_win_socket_legacy_class_constructor(Efl_Class *klass)
+{
+ evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
+}
+
+EOLIAN static Eo *
+_efl_ui_win_socket_legacy_efl_object_finalize(Eo *obj, void *pd EINA_UNUSED)
+{
+ obj = efl_finalize(efl_super(obj, EFL_UI_WIN_SOCKET_LEGACY_CLASS));
+ efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
+ return obj;
+}
+
+#include "efl_ui_win_socket_legacy.eo.c"
diff --git a/src/lib/elementary/efl_ui_win_socket_legacy.eo b/src/lib/elementary/efl_ui_win_socket_legacy.eo
new file mode 100644
index 0000000000..696032a797
--- /dev/null
+++ b/src/lib/elementary/efl_ui_win_socket_legacy.eo
@@ -0,0 +1,9 @@
+class Efl.Ui.Win_Socket_Legacy (Efl.Ui.Win_Socket, Efl.Ui.Legacy)
+{
+ [[Elementary window socket class]]
+ data: null;
+ implements {
+ class.constructor;
+ Efl.Object.finalize;
+ }
+}
diff --git a/src/lib/elementary/elc_combobox.c b/src/lib/elementary/elc_combobox.c
index aa426b1e0d..e9f3cb31e2 100644
--- a/src/lib/elementary/elc_combobox.c
+++ b/src/lib/elementary/elc_combobox.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define ELM_WIDGET_PROTECTED
#define EFL_UI_TRANSLATABLE_PROTECTED
@@ -61,7 +61,7 @@ _elm_combobox_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Co
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_combobox_elm_widget_theme_apply(Eo *obj, Elm_Combobox_Data *sd)
+_elm_combobox_efl_ui_widget_theme_apply(Eo *obj, Elm_Combobox_Data *sd)
{
const char *style;
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
@@ -330,12 +330,12 @@ _elm_combobox_efl_canvas_group_group_del(Eo *obj, Elm_Combobox_Data *sd)
}
EOLIAN static void
-_elm_combobox_efl_gfx_visible_set(Eo *obj, Elm_Combobox_Data *sd, Eina_Bool vis)
+_elm_combobox_efl_gfx_entity_visible_set(Eo *obj, Elm_Combobox_Data *sd, Eina_Bool vis)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 0, vis))
return;
- efl_gfx_visible_set(efl_super(obj, MY_CLASS), vis);
+ efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), vis);
if (vis)
{
if (sd->expanded) evas_object_show(sd->hover);
@@ -347,7 +347,7 @@ _elm_combobox_efl_gfx_visible_set(Eo *obj, Elm_Combobox_Data *sd, Eina_Bool vis)
}
EOLIAN static Eina_Bool
-_elm_combobox_efl_ui_autorepeat_autorepeat_supported_get(Eo *obj EINA_UNUSED,
+_elm_combobox_efl_ui_autorepeat_autorepeat_supported_get(const Eo *obj EINA_UNUSED,
Elm_Combobox_Data *sd EINA_UNUSED)
{
return EINA_FALSE;
@@ -373,7 +373,7 @@ _elm_combobox_efl_object_constructor(Eo *obj, Elm_Combobox_Data *sd)
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_GLASS_PANE);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_GLASS_PANE);
//hover-parent
sd->hover_parent = elm_object_top_widget_get(obj);
@@ -382,7 +382,7 @@ _elm_combobox_efl_object_constructor(Eo *obj, Elm_Combobox_Data *sd)
//hover
sd->hover = _elm_combobox_component_add(obj, sd->hover_parent, ELM_HOVER_CLASS, buf);
- efl_gfx_visible_set(sd->hover, EINA_FALSE);
+ efl_gfx_entity_visible_set(sd->hover, EINA_FALSE);
evas_object_layer_set(sd->hover, EVAS_LAYER_MAX);
efl_ui_mirrored_automatic_set(sd->hover, EINA_FALSE);
elm_hover_target_set(sd->hover, obj);
@@ -466,7 +466,7 @@ _elm_combobox_hover_end(Eo *obj, Elm_Combobox_Data *sd)
}
EOLIAN static Eina_Bool
-_elm_combobox_expanded_get(Eo *obj EINA_UNUSED, Elm_Combobox_Data *sd)
+_elm_combobox_expanded_get(const Eo *obj EINA_UNUSED, Elm_Combobox_Data *sd)
{
return sd->expanded;
}
@@ -521,7 +521,7 @@ _elm_combobox_class_constructor(Efl_Class *klass)
}
EOLIAN const Efl_Access_Action_Data *
-_elm_combobox_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED,
+_elm_combobox_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED,
Elm_Combobox_Data *pd
EINA_UNUSED)
{
@@ -561,13 +561,13 @@ _elm_combobox_part_text_get(const Eo *obj, const char *part)
}
EOLIAN static void
-_elm_combobox_efl_gfx_size_set(Eo *obj, Elm_Combobox_Data *pd, Eina_Size2D sz)
+_elm_combobox_efl_gfx_entity_size_set(Eo *obj, Elm_Combobox_Data *pd, Eina_Size2D sz)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
if (pd->count > 0) _table_resize(obj);
- efl_gfx_size_set(efl_super(obj, MY_CLASS), sz);
+ efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
}
/* Internal EO APIs and hidden overrides */
diff --git a/src/lib/elementary/elc_ctxpopup.c b/src/lib/elementary/elc_ctxpopup.c
index 84543812e1..9c3ddc743f 100644
--- a/src/lib/elementary/elc_ctxpopup.c
+++ b/src/lib/elementary/elc_ctxpopup.c
@@ -2,11 +2,13 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
-#define ELM_WIDGET_PROTECTED
+#define EFL_UI_WIDGET_PROTECTED
+//#define EFL_UI_WIDGET_BETA
#define ELM_WIDGET_ITEM_PROTECTED
#define EFL_UI_TRANSLATABLE_PROTECTED
+#define EFL_PART_PROTECTED
#include <Elementary.h>
@@ -522,12 +524,12 @@ _base_shift_by_arrow(Evas_Object *arrow,
}
EOLIAN static Eina_Bool
-_elm_ctxpopup_elm_widget_widget_sub_object_add(Eo *obj, Elm_Ctxpopup_Data *_pd EINA_UNUSED, Evas_Object *sobj)
+_elm_ctxpopup_efl_ui_widget_widget_sub_object_add(Eo *obj, Elm_Ctxpopup_Data *_pd EINA_UNUSED, Evas_Object *sobj)
{
/* Skipping elm_layout widget_sub_object_add in order to ignore size hint changes.
* Note: It is not clear WHY we are doing this. Same reason as genlist?
*/
- return elm_widget_sub_object_add(efl_cast(obj, ELM_WIDGET_CLASS), sobj);
+ return elm_widget_sub_object_add(efl_cast(obj, EFL_UI_WIDGET_CLASS), sobj);
}
EOLIAN static void
@@ -667,7 +669,7 @@ _on_content_resized(void *data,
//FIXME: lost the content size when theme hook is called.
EOLIAN static Efl_Ui_Theme_Apply
-_elm_ctxpopup_elm_widget_theme_apply(Eo *obj, Elm_Ctxpopup_Data *sd)
+_elm_ctxpopup_efl_ui_widget_theme_apply(Eo *obj, Elm_Ctxpopup_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
@@ -699,7 +701,7 @@ _elm_ctxpopup_elm_widget_theme_apply(Eo *obj, Elm_Ctxpopup_Data *sd)
static Eina_Bool
_elm_ctxpopup_content_set(Eo *obj, Elm_Ctxpopup_Data *sd, const char *part, Evas_Object *content)
{
- if ((part) && (strcmp(part, "default")))
+ if ((part) && (strcmp(part, "elm.swallow.content")))
{
return efl_content_set(efl_part(efl_super(obj, MY_CLASS), part), content);
}
@@ -732,7 +734,7 @@ _elm_ctxpopup_content_set(Eo *obj, Elm_Ctxpopup_Data *sd, const char *part, Evas
static Evas_Object*
_elm_ctxpopup_content_get(Eo *obj, Elm_Ctxpopup_Data *sd, const char *part)
{
- if ((part) && (strcmp(part, "default")))
+ if ((part) && (strcmp(part, "elm.swallow.content")))
return efl_content_get(efl_part(efl_super(obj, MY_CLASS), part));
return sd->content;
@@ -743,7 +745,7 @@ _elm_ctxpopup_content_unset(Eo *obj, Elm_Ctxpopup_Data *sd, const char *part)
{
Evas_Object *content = NULL;
- if ((part) && (strcmp(part, "default")))
+ if ((part) && (strcmp(part, "elm.swallow.content")))
return efl_content_unset(efl_part(efl_super(obj, MY_CLASS), part));
content = sd->content;
@@ -777,7 +779,7 @@ _elm_ctxpopup_item_elm_widget_item_part_text_set(Eo *eo_ctxpopup_it EINA_UNUSED,
}
EOLIAN static const char *
-_elm_ctxpopup_item_elm_widget_item_part_text_get(Eo *eo_ctxpopup_it EINA_UNUSED,
+_elm_ctxpopup_item_elm_widget_item_part_text_get(const Eo *eo_ctxpopup_it EINA_UNUSED,
Elm_Ctxpopup_Item_Data *ctxpopup_it,
const char *part)
{
@@ -810,7 +812,7 @@ _elm_ctxpopup_item_elm_widget_item_part_content_set(Eo *eo_ctxpopup_it EINA_UNUS
}
EOLIAN static Evas_Object *
-_elm_ctxpopup_item_elm_widget_item_part_content_get(Eo *eo_ctxpopup_it EINA_UNUSED,
+_elm_ctxpopup_item_elm_widget_item_part_content_get(const Eo *eo_ctxpopup_it EINA_UNUSED,
Elm_Ctxpopup_Item_Data *ctxpopup_it,
const char *part)
{
@@ -856,21 +858,15 @@ _elm_ctxpopup_item_elm_widget_item_disable(Eo *eo_ctxpopup_it,
(ctxpopup_it->list_item, elm_wdg_item_disabled_get(eo_ctxpopup_it));
}
-EOLIAN static Eina_Bool
+EOLIAN static void
_elm_ctxpopup_item_elm_widget_item_del_pre(Eo *eo_ctxpopup_it EINA_UNUSED,
Elm_Ctxpopup_Item_Data *ctxpopup_it)
{
- ELM_CTXPOPUP_DATA_GET(WIDGET(ctxpopup_it), sd);
- if (!sd) return EINA_FALSE;
-
if (ctxpopup_it->list_item)
{
- efl_unref(ctxpopup_it->list_item);
- elm_wdg_item_del(ctxpopup_it->list_item);
+ elm_object_item_del(ctxpopup_it->list_item);
ctxpopup_it->list_item = NULL;
}
-
- return EINA_TRUE;
}
EOLIAN static void
@@ -883,7 +879,7 @@ _elm_ctxpopup_item_elm_widget_item_signal_emit(Eo *eo_ctxpopup_it EINA_UNUSED,
}
EOLIAN static void
-_elm_ctxpopup_item_elm_widget_item_focus_set(Eo *eo_ctxpopup_it EINA_UNUSED,
+_elm_ctxpopup_item_elm_widget_item_item_focus_set(Eo *eo_ctxpopup_it EINA_UNUSED,
Elm_Ctxpopup_Item_Data *ctxpopup_it,
Eina_Bool focused)
{
@@ -891,7 +887,7 @@ _elm_ctxpopup_item_elm_widget_item_focus_set(Eo *eo_ctxpopup_it EINA_UNUSED,
}
EOLIAN static Eina_Bool
-_elm_ctxpopup_item_elm_widget_item_focus_get(Eo *eo_ctxpopup_it EINA_UNUSED,
+_elm_ctxpopup_item_elm_widget_item_item_focus_get(const Eo *eo_ctxpopup_it EINA_UNUSED,
Elm_Ctxpopup_Item_Data *ctxpopup_it)
{
return elm_object_item_focus_get(ctxpopup_it->list_item);
@@ -1016,7 +1012,10 @@ _elm_ctxpopup_item_efl_object_destructor(Eo *eo_ctxpopup_it,
list = elm_object_item_widget_get(ctxpopup_it->list_item);
if (ctxpopup_it->list_item)
- efl_unref(ctxpopup_it->list_item);
+ {
+ elm_object_item_del(ctxpopup_it->list_item);
+ ctxpopup_it->list_item = NULL;
+ }
sd->items = eina_list_remove(sd->items, eo_ctxpopup_it);
if (list && eina_list_count(elm_list_items_get(list)) < 2)
{
@@ -1031,7 +1030,7 @@ _elm_ctxpopup_item_efl_object_destructor(Eo *eo_ctxpopup_it,
}
EOLIAN static Eina_Bool
-_elm_ctxpopup_elm_widget_on_disabled_update(Eo *obj, Elm_Ctxpopup_Data *sd, Eina_Bool disabled)
+_elm_ctxpopup_efl_ui_widget_on_disabled_update(Eo *obj, Elm_Ctxpopup_Data *sd, Eina_Bool disabled)
{
if (!efl_ui_widget_on_disabled_update(efl_super(obj, MY_CLASS), disabled))
return EINA_FALSE;
@@ -1102,23 +1101,22 @@ _elm_ctxpopup_efl_canvas_group_group_del(Eo *obj, Elm_Ctxpopup_Data *sd)
{
Elm_Object_Item *it;
- evas_object_event_callback_del_full
- (sd->box, EVAS_CALLBACK_RESIZE, _on_content_resized, obj);
- evas_object_event_callback_del(sd->content, EVAS_CALLBACK_DEL, _on_content_del);
+ if (sd->content) evas_object_event_callback_del(sd->content, EVAS_CALLBACK_DEL, _on_content_del);
_parent_detach(obj);
+ //clear the items before clearing the ctxpopup as this will remove the list and all items
+ EINA_LIST_FREE(sd->items, it)
+ efl_del(it);
+
elm_ctxpopup_clear(obj);
ELM_SAFE_FREE(sd->arrow, evas_object_del); /* stops _sizing_eval() from going on on deletion */
ELM_SAFE_FREE(sd->bg, evas_object_del);
- EINA_LIST_FREE(sd->items, it)
- efl_del(it);
-
efl_canvas_group_del(efl_super(obj, MY_CLASS));
}
EOLIAN static void
-_elm_ctxpopup_elm_widget_widget_parent_set(Eo *obj, Elm_Ctxpopup_Data *_pd EINA_UNUSED, Evas_Object *parent)
+_elm_ctxpopup_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Ctxpopup_Data *_pd EINA_UNUSED, Evas_Object *parent)
{
//default parent is to be hover parent
elm_ctxpopup_hover_parent_set(obj, parent);
@@ -1144,7 +1142,7 @@ _elm_ctxpopup_efl_object_constructor(Eo *obj, Elm_Ctxpopup_Data *_pd EINA_UNUSED
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_POPUP_MENU);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_POPUP_MENU);
return obj;
}
@@ -1178,7 +1176,7 @@ _elm_ctxpopup_hover_parent_set(Eo *obj, Elm_Ctxpopup_Data *sd, Evas_Object *pare
}
EOLIAN static Evas_Object*
-_elm_ctxpopup_hover_parent_get(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
+_elm_ctxpopup_hover_parent_get(const Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
{
return sd->parent;
}
@@ -1205,51 +1203,11 @@ _elm_ctxpopup_horizontal_set(Eo *obj, Elm_Ctxpopup_Data *sd, Eina_Bool horizonta
}
EOLIAN static Eina_Bool
-_elm_ctxpopup_horizontal_get(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
+_elm_ctxpopup_horizontal_get(const Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
{
return sd->horizontal;
}
-EAPI const Eina_List *
-elm_ctxpopup_items_get(const Evas_Object *obj)
-{
- Eina_List *lst = NULL;
- Eina_Iterator *it;
- void *item_data;
-
- it = efl_ui_menu_items_get(obj);
- EINA_ITERATOR_FOREACH(it, item_data)
- {
- lst = eina_list_append(lst, item_data);
- }
- eina_iterator_free(it);
- return lst;
-}
-
-EAPI Elm_Widget_Item *
-elm_ctxpopup_first_item_get(const Evas_Object *obj)
-{
- return efl_ui_menu_first_item_get(obj);
-}
-
-EAPI Elm_Widget_Item *
-elm_ctxpopup_last_item_get(const Evas_Object *obj)
-{
- return efl_ui_menu_last_item_get(obj);
-}
-
-EAPI Elm_Widget_Item *
-elm_ctxpopup_item_prev_get(const Evas_Object *obj)
-{
- return efl_ui_item_prev_get(obj);
-}
-
-EAPI Elm_Widget_Item *
-elm_ctxpopup_item_next_get(const Evas_Object *obj)
-{
- return efl_ui_item_next_get(obj);
-}
-
static void
_item_select(Elm_Ctxpopup_Item_Data *item)
{
@@ -1302,7 +1260,6 @@ _elm_ctxpopup_item_insert_before(Eo *obj, Elm_Ctxpopup_Data *sd, Elm_Object_Item
item->list_item =
elm_list_item_insert_before(sd->list, before_it->list_item, label, icon, NULL, _item_wrap_cb, item);
- efl_ref(item->list_item);
sd->items = eina_list_prepend_relative(sd->items, eo_item, eo_before);
if (sd->visible) elm_layout_sizing_eval(obj);
@@ -1328,7 +1285,6 @@ _elm_ctxpopup_item_insert_after(Eo *obj, Elm_Ctxpopup_Data *sd, Elm_Object_Item
item->list_item =
elm_list_item_insert_after(sd->list, after_it->list_item, label, icon, NULL, _item_wrap_cb, item);
- efl_ref(item->list_item);
sd->items = eina_list_append_relative(sd->items, eo_item, eo_after);
if (sd->visible) elm_layout_sizing_eval(obj);
@@ -1348,7 +1304,6 @@ _elm_ctxpopup_item_append(Eo *obj, Elm_Ctxpopup_Data *sd, const char *label, Eva
item->list_item =
elm_list_item_append(sd->list, label, icon, NULL, _item_wrap_cb, item);
- efl_ref(item->list_item);
sd->items = eina_list_append(sd->items, eo_item);
if (sd->visible) elm_layout_sizing_eval(obj);
@@ -1368,7 +1323,7 @@ _elm_ctxpopup_direction_priority_set(Eo *obj, Elm_Ctxpopup_Data *sd, Elm_Ctxpopu
}
EOLIAN static void
-_elm_ctxpopup_direction_priority_get(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd, Elm_Ctxpopup_Direction *first, Elm_Ctxpopup_Direction *second, Elm_Ctxpopup_Direction *third, Elm_Ctxpopup_Direction *fourth)
+_elm_ctxpopup_direction_priority_get(const Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd, Elm_Ctxpopup_Direction *first, Elm_Ctxpopup_Direction *second, Elm_Ctxpopup_Direction *third, Elm_Ctxpopup_Direction *fourth)
{
if (first) *first = sd->dir_priority[0];
if (second) *second = sd->dir_priority[1];
@@ -1377,7 +1332,7 @@ _elm_ctxpopup_direction_priority_get(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd,
}
EOLIAN static Elm_Ctxpopup_Direction
-_elm_ctxpopup_direction_get(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
+_elm_ctxpopup_direction_get(const Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
{
return sd->dir;
}
@@ -1396,7 +1351,7 @@ _elm_ctxpopup_auto_hide_disabled_set(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd,
}
EOLIAN static Eina_Bool
-_elm_ctxpopup_auto_hide_disabled_get(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
+_elm_ctxpopup_auto_hide_disabled_get(const Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
{
return !sd->auto_hide;
}
@@ -1407,14 +1362,14 @@ _elm_ctxpopup_class_constructor(Efl_Class *klass)
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
}
-EOLIAN static Eina_Iterator*
-_elm_ctxpopup_efl_ui_menu_items_get(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
+EOLIAN static const Eina_List *
+_elm_ctxpopup_items_get(const Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
{
- return eina_list_iterator_new(sd->items);
+ return sd->items;
}
EOLIAN static Elm_Object_Item*
-_elm_ctxpopup_efl_ui_menu_first_item_get(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
+_elm_ctxpopup_first_item_get(const Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
{
if (!sd->items) return NULL;
@@ -1422,7 +1377,7 @@ _elm_ctxpopup_efl_ui_menu_first_item_get(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data
}
EOLIAN static Elm_Object_Item*
-_elm_ctxpopup_efl_ui_menu_last_item_get(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
+_elm_ctxpopup_last_item_get(const Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
{
if (!sd->items) return NULL;
@@ -1430,7 +1385,7 @@ _elm_ctxpopup_efl_ui_menu_last_item_get(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *
}
EOLIAN static Elm_Object_Item*
-_elm_ctxpopup_efl_ui_menu_selected_item_get(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
+_elm_ctxpopup_selected_item_get(const Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
{
Eina_List *l;
Elm_Object_Item *eo_item;
@@ -1445,7 +1400,7 @@ _elm_ctxpopup_efl_ui_menu_selected_item_get(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Da
}
EOLIAN static Elm_Object_Item*
-_elm_ctxpopup_elm_widget_focused_item_get(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
+_elm_ctxpopup_efl_ui_widget_focused_item_get(const Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
{
if (!sd->list) return NULL;
@@ -1464,7 +1419,6 @@ _elm_ctxpopup_item_prepend(Eo *obj, Elm_Ctxpopup_Data *sd, const char *label, Ev
item->list_item =
elm_list_item_prepend(sd->list, label, icon, NULL, _item_wrap_cb, item);
- efl_ref(item->list_item);
sd->items = eina_list_prepend(sd->items, eo_item);
if (sd->visible) elm_layout_sizing_eval(obj);
@@ -1473,7 +1427,7 @@ _elm_ctxpopup_item_prepend(Eo *obj, Elm_Ctxpopup_Data *sd, const char *label, Ev
}
EOLIAN static Elm_Object_Item *
-_elm_ctxpopup_item_efl_ui_item_prev_get(Eo *eo_item EINA_UNUSED, Elm_Ctxpopup_Item_Data *item)
+_elm_ctxpopup_item_prev_get(const Eo *eo_item EINA_UNUSED, Elm_Ctxpopup_Item_Data *item)
{
Eina_List *l;
@@ -1488,7 +1442,7 @@ _elm_ctxpopup_item_efl_ui_item_prev_get(Eo *eo_item EINA_UNUSED, Elm_Ctxpopup_It
}
EOLIAN static Elm_Object_Item *
-_elm_ctxpopup_item_efl_ui_item_next_get(Eo *eo_item EINA_UNUSED, Elm_Ctxpopup_Item_Data *item)
+_elm_ctxpopup_item_next_get(const Eo *eo_item EINA_UNUSED, Elm_Ctxpopup_Item_Data *item)
{
Eina_List *l;
@@ -1503,7 +1457,7 @@ _elm_ctxpopup_item_efl_ui_item_next_get(Eo *eo_item EINA_UNUSED, Elm_Ctxpopup_It
}
EOLIAN static void
-_elm_ctxpopup_item_efl_ui_item_selected_set(Eo *eo_item EINA_UNUSED,
+_elm_ctxpopup_item_selected_set(Eo *eo_item EINA_UNUSED,
Elm_Ctxpopup_Item_Data *item,
Eina_Bool selected)
{
@@ -1526,7 +1480,7 @@ _elm_ctxpopup_item_efl_ui_item_selected_set(Eo *eo_item EINA_UNUSED,
}
EOLIAN static Eina_Bool
-_elm_ctxpopup_item_efl_ui_item_selected_get(Eo *eo_item EINA_UNUSED, Elm_Ctxpopup_Item_Data *item)
+_elm_ctxpopup_item_selected_get(const Eo *eo_item EINA_UNUSED, Elm_Ctxpopup_Item_Data *item)
{
return item->selected;
}
@@ -1561,7 +1515,7 @@ _elm_ctxpopup_item_init(Eo *eo_item,
}
EOLIAN static const Efl_Access_Action_Data*
-_elm_ctxpopup_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd EINA_UNUSED)
+_elm_ctxpopup_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "escape", "escape", NULL, _key_action_escape},
@@ -1571,10 +1525,10 @@ _elm_ctxpopup_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_
}
EOLIAN static Efl_Access_State_Set
-_elm_ctxpopup_efl_access_state_set_get(Eo *obj, Elm_Ctxpopup_Data *sd EINA_UNUSED)
+_elm_ctxpopup_efl_access_object_state_set_get(const Eo *obj, Elm_Ctxpopup_Data *sd EINA_UNUSED)
{
Efl_Access_State_Set ret;
- ret = efl_access_state_set_get(efl_super(obj, MY_CLASS));
+ ret = efl_access_object_state_set_get(efl_super(obj, MY_CLASS));
STATE_TYPE_SET(ret, EFL_ACCESS_STATE_MODAL);
@@ -1592,7 +1546,7 @@ _item_access_action_activate(Evas_Object *obj, const char *params EINA_UNUSED)
}
EOLIAN static const Efl_Access_Action_Data*
-_elm_ctxpopup_item_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Item_Data *sd EINA_UNUSED)
+_elm_ctxpopup_item_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Elm_Ctxpopup_Item_Data *sd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "activate", NULL, NULL, _item_access_action_activate},
@@ -1611,7 +1565,6 @@ ELM_PART_OVERRIDE(elm_ctxpopup, ELM_CTXPOPUP, Elm_Ctxpopup_Data)
ELM_PART_OVERRIDE_CONTENT_SET(elm_ctxpopup, ELM_CTXPOPUP, Elm_Ctxpopup_Data)
ELM_PART_OVERRIDE_CONTENT_GET(elm_ctxpopup, ELM_CTXPOPUP, Elm_Ctxpopup_Data)
ELM_PART_OVERRIDE_CONTENT_UNSET(elm_ctxpopup, ELM_CTXPOPUP, Elm_Ctxpopup_Data)
-ELM_PART_CONTENT_DEFAULT_GET(elm_ctxpopup, "default")
#include "elm_ctxpopup_part.eo.c"
/* Efl.Part end */
@@ -1620,7 +1573,6 @@ ELM_PART_CONTENT_DEFAULT_GET(elm_ctxpopup, "default")
#define ELM_CTXPOPUP_EXTRA_OPS \
ELM_LAYOUT_SIZING_EVAL_OPS(elm_ctxpopup), \
- ELM_PART_CONTENT_DEFAULT_OPS(elm_ctxpopup), \
EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_ctxpopup)
#include "elm_ctxpopup_item.eo.c"
diff --git a/src/lib/elementary/elc_ctxpopup_legacy.h b/src/lib/elementary/elc_ctxpopup_legacy.h
index caf95a844a..cf3ad28371 100644
--- a/src/lib/elementary/elc_ctxpopup_legacy.h
+++ b/src/lib/elementary/elc_ctxpopup_legacy.h
@@ -8,82 +8,5 @@
*/
EAPI Evas_Object *elm_ctxpopup_add(Evas_Object *parent);
-/**
- * @brief Get the internal list of items in a given ctxpopup widget.
- *
- * This list is not to be modified in any way and must not be freed. Use the
- * list members with functions like @ref elm_object_item_text_set, @ref
- * elm_object_item_text_get, @ref elm_object_item_del.
- *
- * @warning This list is only valid until @c obj object's internal items list
- * is changed. It should be fetched again with another call to this function
- * when changes happen.
- *
- * @return The list of items or @c null on errors.
- *
- * @since 1.11
- *
- * @ingroup Elm_Ctxpopup
- */
-EAPI const Eina_List *elm_ctxpopup_items_get(const Evas_Object *obj);
-
-/**
- * @brief Get the first item in the given ctxpopup widget's list of items.
- *
- * See also @ref elm_obj_ctxpopup_item_append,
- * @ref elm_obj_ctxpopup_last_item_get.
- *
- * @return The first item or @c null, if it has no items (and on errors).
- *
- * @since 1.11
- *
- * @ingroup Elm_Ctxpopup
- */
-EAPI Elm_Widget_Item *elm_ctxpopup_first_item_get(const Evas_Object *obj);
-
-/**
- * @brief Get the last item in the given ctxpopup widget's list of items.
- *
- * See also @ref elm_obj_ctxpopup_item_prepend,
- * @ref elm_obj_ctxpopup_first_item_get.
- *
- * @return The last item or @c null, if it has no items (and on errors).
- *
- * @since 1.1
- *
- * @ingroup Elm_Ctxpopup
- */
-EAPI Elm_Widget_Item *elm_ctxpopup_last_item_get(const Evas_Object *obj);
-
-/**
- * @brief Get the item before $ it in a ctxpopup widget's internal list of
- * items.
- *
- * See also @ref elm_ctxpopup_item_next_get.
- *
- * @return The item before the object in its parent's list. If there is no
- * previous item for $ it or there's an error, @c null is returned.
- *
- * @since 1.11
- *
- * @ingroup Elm_Ctxpopup_Item
- */
-EAPI Elm_Widget_Item *elm_ctxpopup_item_prev_get(const Evas_Object *obj);
-
-/**
- * @brief Get the item after $ it in a ctxpopup widget's internal list of
- * items.
- *
- * See also @ref elm_ctxpopup_item_prev_get.
- *
- * @return The item after the object in its parent's list. If there is no
- * previous item for $ it or there's an error, @c null is returned.
- *
- * @since 1.11
- *
- * @ingroup Elm_Ctxpopup_Item
- */
-EAPI Elm_Widget_Item *elm_ctxpopup_item_next_get(const Evas_Object *obj);
-
#include "elm_ctxpopup_item.eo.legacy.h"
#include "elm_ctxpopup.eo.legacy.h"
diff --git a/src/lib/elementary/elc_fileselector.c b/src/lib/elementary/elc_fileselector.c
index bfb1c8503c..94abf68a82 100644
--- a/src/lib/elementary/elc_fileselector.c
+++ b/src/lib/elementary/elc_fileselector.c
@@ -9,10 +9,14 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
+#define ELM_INTERFACE_FILESELECTOR_BETA
+#define EFL_PART_PROTECTED
+#define EFL_UI_FOCUS_COMPOSITION_PROTECTED
#include <Elementary.h>
+#include "Eio_Eo.h"
#include "elm_priv.h"
#include "elm_fileselector_button.eo.h"
#include "elm_fileselector_entry.eo.h"
@@ -45,8 +49,6 @@ static Elm_Gengrid_Item_Class *grid_itc[ELM_FILE_LAST];
static const char _text_activated_model_key[] = "__fs_text_activated_model";
static const char _text_activated_path_key[] = "__fs_text_activated_path";
-static const char _selected_model_set_promise_owner_key[] = "__fs_selected_model_set_promise_owner";
-static const char _selected_model_set_model_key[] = "__fs_selected_model_set_model";
EAPI Eina_Error ELM_FILESELECTOR_ERROR_UNKNOWN = 0;
EAPI Eina_Error ELM_FILESELECTOR_ERROR_INVALID_MODEL = 0;
@@ -91,6 +93,7 @@ static Elm_Fileselector_Item_Data *_selected_item_data_get(Elm_Fileselector_Data
static void _resource_created(void *, const Efl_Event *);
static void _resource_deleted(void *, const Efl_Event *);
static void _listing_request_cleanup(Listing_Request *);
+static void _properties_ready(void *data, const Efl_Event *ev);
EFL_CALLBACKS_ARRAY_DEFINE(monitoring_callbacks,
{ EFL_MODEL_EVENT_CHILD_ADDED, _resource_created },
@@ -102,7 +105,7 @@ _focus_chain_update(Eo *obj, Elm_Fileselector_Data *pd)
{
Eina_List *tmp = NULL;
-#define A(p) tmp = eina_list_append(tmp, p);
+#define A(p) if (p) tmp = eina_list_append(tmp, p);
A(pd->up_button)
A(pd->home_button)
@@ -117,17 +120,9 @@ _focus_chain_update(Eo *obj, Elm_Fileselector_Data *pd)
#undef A
- efl_ui_focus_manager_calc_update_order(efl_ui_focus_user_focus_manager_get(obj), obj, tmp);
+ efl_ui_focus_composition_elements_set(obj, tmp);
}
-static void
-_model_free_eo_cb(void *data)
-{
- Eo *eo = data;
- efl_unref(eo);
-}
-
-
void
_event_to_legacy_call(Eo *obj, const Efl_Event_Description *evt_desc, void *event_info)
{
@@ -145,6 +140,7 @@ _model_event_call(Eo *obj, const Efl_Event_Description *evt_desc, Efl_Model *mod
static void
_monitoring_start(Elm_Fileselector *fs, Elm_Fileselector_Data *sd, Efl_Model *model)
{
+ if (sd->monitoring) return ;
sd->monitoring = EINA_TRUE;
efl_event_callback_array_add(model, monitoring_callbacks(), fs);
}
@@ -152,31 +148,52 @@ _monitoring_start(Elm_Fileselector *fs, Elm_Fileselector_Data *sd, Efl_Model *mo
static void
_monitoring_stop(Elm_Fileselector *fs, Elm_Fileselector_Data *sd, Efl_Model *model)
{
+ if (!sd->monitoring) return ;
sd->monitoring = EINA_FALSE;
efl_event_callback_array_del(model, monitoring_callbacks(), fs);
}
+static void _noref_death(void *data EINA_UNUSED, const Efl_Event *event);
+static void _invalidated(void *data EINA_UNUSED, const Efl_Event *event);
+
+EFL_CALLBACKS_ARRAY_DEFINE(noref_death,
+ { EFL_EVENT_NOREF, _noref_death },
+ { EFL_EVENT_INVALIDATE, _invalidated });
+
+static void
+_noref_death(void *data EINA_UNUSED, const Efl_Event *event)
+{
+ efl_event_callback_array_del(event->object, noref_death(), NULL);
+ efl_del(event->object);
+}
+
+static void
+_invalidated(void *data EINA_UNUSED, const Efl_Event *event)
+{
+ // This means our parent is dying, EFL_EVENT_NOREF can be called after invalidated
+ efl_event_callback_array_del(event->object, noref_death(), NULL);
+}
+
+static void
+_reset_target(Elm_Fileselector_Data *pd)
+{
+ efl_event_callback_del(pd->target, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _properties_ready, pd->obj);
+ efl_replace(&pd->target, NULL);
+}
+
static void
_elm_fileselector_replace_model(Elm_Fileselector *fs, Elm_Fileselector_Data *sd, Efl_Model *model, const char *path)
{
- if (sd->model)
- {
- _monitoring_stop(fs, sd, sd->model);
- efl_unref(sd->model);
- }
+ _monitoring_stop(fs, sd, sd->model);
+
+ efl_replace(&sd->model, model);
+ eina_stringshare_replace(&sd->path, path);
if (model && path)
{
- sd->model = efl_ref(model);
- eina_stringshare_replace(&sd->path, path);
_monitoring_start(fs, sd, sd->model);
/* TODO: sub directory should be monitored for expand mode */
}
- else
- {
- sd->model = NULL;
- eina_stringshare_replace(&sd->path, NULL);
- }
}
/* final routine on deletion */
@@ -204,35 +221,14 @@ _mirrored_set(Evas_Object *obj, Eina_Bool rtl)
efl_ui_mirrored_set(sd->home_button, rtl);
}
-static Eina_Bool
-_accessor_value_get(Eina_Accessor *acc, int id, void *res)
-{
- Eina_Value *v = NULL;
-
- if (!eina_accessor_data_get(acc, id, (void **) &v))
- return EINA_FALSE;
-
- eina_value_get(v, res);
- return EINA_TRUE;
-}
-
-static Efl_Future*
+static Eina_Future *
_model_str_property_set(Efl_Model *model, const char *property_name, const char *property_value)
{
- Efl_Future* r;
- Eina_Value v;
- eina_value_setup(&v, EINA_VALUE_TYPE_STRING);
- eina_value_set(&v, property_value);
-
- r = efl_model_property_set(model, property_name, &v);
-
- eina_value_flush(&v);
-
- return r;
+ return efl_model_property_set(model, property_name, eina_value_string_new(property_value));
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_fileselector_elm_widget_theme_apply(Eo *obj, Elm_Fileselector_Data *sd)
+_elm_fileselector_efl_ui_widget_theme_apply(Eo *obj, Elm_Fileselector_Data *sd)
{
const char *style;
const char *data;
@@ -300,9 +296,12 @@ _key_action_backspace(Evas_Object *obj, const char *params EINA_UNUSED)
ELM_FILESELECTOR_DATA_GET(obj, sd);
if (sd->prev_model)
{
- _populate(obj, sd->prev_model, NULL, NULL);
- efl_unref(sd->prev_model);
+ Efl_Model *tmp = NULL;
+
+ tmp = sd->prev_model;
sd->prev_model = NULL;
+ _populate(obj, sd->prev_model, NULL, NULL);
+ efl_unref(tmp);
}
else
_on_dir_up(obj, NULL);
@@ -404,11 +403,11 @@ _itc_del(void *data,
Evas_Object *obj EINA_UNUSED)
{
Elm_Fileselector_Item_Data *it_data = data;
+ efl_key_data_set(it_data->model, ".item.data", NULL);
efl_unref(it_data->model);
eina_stringshare_del(it_data->path);
eina_stringshare_del(it_data->filename);
eina_stringshare_del(it_data->mime_type);
- efl_unref(it_data->parent_model);
eina_stringshare_del(it_data->parent_path);
free(it_data);
}
@@ -657,6 +656,7 @@ static void
_signal_first(Listing_Request *lreq)
{
Elm_Fileselector_Data *sd = lreq->sd;
+
if (!lreq->first) return;
if (!sd) return;
@@ -685,59 +685,201 @@ static void
_process_last(Listing_Request *lreq)
{
Elm_Fileselector_Data *sd = lreq->sd;
- elm_progressbar_pulse(sd->spinner, EINA_FALSE);
- elm_layout_signal_emit(lreq->obj, "elm,action,spinner,hide", "elm");
- _listing_request_cleanup(lreq);
+ if (lreq->valid)
+ {
+ elm_progressbar_pulse(sd->spinner, EINA_FALSE);
+ elm_layout_signal_emit(lreq->obj, "elm,action,spinner,hide", "elm");
+ }
+ _listing_request_cleanup(lreq);
sd->current_populate_lreq = NULL;
}
+static void
+_listing_request_cleanup(Listing_Request *lreq)
+{
+ if (!lreq) return ;
+ if (lreq->parent_it)
+ efl_unref(lreq->parent_it);
+ efl_unref(lreq->obj);
+ efl_unref(lreq->model);
+ if (lreq->selected)
+ efl_unref(lreq->selected);
+ eina_stringshare_del(lreq->path);
+ eina_stringshare_del(lreq->selected_path);
+ free(lreq);
+}
+
static Eina_Bool
-_process_child(Elm_Fileselector_Item_Data *it_data, Eina_Accessor *values_acc)
+_check_again(Eina_Value *fetch)
{
- Elm_Object_Item *item;
- Listing_Request *lreq = it_data->user_data;
+ Eina_Error err = 0;
+ char *str;
+
+ if (eina_value_type_get(fetch) != EINA_VALUE_TYPE_ERROR)
+ return EINA_FALSE;
+
+ eina_value_error_get(fetch, &err);
+ if (err == EAGAIN) return EINA_TRUE;
+
+ str = eina_value_to_string(fetch);
+ ERR("Unexpected error: '%s'.", str);
+ free(str);
+
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_fetch_string_value(Efl_Model *child, const char *name, char **str)
+{
+ Eina_Value *fetch;
+ Eina_Bool r = EINA_FALSE;
+
+ *str = NULL;
+
+ fetch = efl_model_property_get(child, name);
+ if (_check_again(fetch)) goto on_error;
+
+ *str = eina_value_to_string(fetch);
+ r = EINA_TRUE;
+
+ on_error:
+ eina_value_free(fetch);
+ return r;
+}
+
+static Eina_Bool
+_fetch_bool_value(Efl_Model *child, const char *name, Eina_Bool *b)
+{
+ Eina_Value *fetch;
+ Eina_Bool r = EINA_FALSE;
+
+ fetch = efl_model_property_get(child, name);
+ if (_check_again(fetch)) goto on_error;
+ if (!eina_value_bool_get(fetch, b)) goto on_error;
+
+ r = EINA_TRUE;
+
+ on_error:
+ eina_value_free(fetch);
+ return r;
+}
+
+static Eina_Bool
+_fetch_double_value(Efl_Model *child, const char *name, double *d)
+{
+ Eina_Value convert = EINA_VALUE_EMPTY;
+ Eina_Value *fetch;
+ Eina_Bool r = EINA_FALSE;
+
+ fetch = efl_model_property_get(child, name);
+ if (_check_again(fetch)) goto on_error;
+ if (!eina_value_setup(&convert, EINA_VALUE_TYPE_DOUBLE))
+ goto on_error;
+ if (!eina_value_convert(fetch, &convert))
+ goto on_error;
+ if (!eina_value_double_get(&convert, d)) goto on_error;
+
+ r = EINA_TRUE;
+
+ on_error:
+ eina_value_flush(&convert);
+ eina_value_free(fetch);
+ return r;
+}
+
+static Eina_Bool
+_fetch_int64_value(Efl_Model *child, const char *name, int64_t *i)
+{
+ Eina_Value convert = EINA_VALUE_EMPTY;
+ Eina_Value *fetch;
+ Eina_Bool r = EINA_FALSE;
+
+ fetch = efl_model_property_get(child, name);
+ if (_check_again(fetch)) goto on_error;
+ if (!eina_value_setup(&convert, EINA_VALUE_TYPE_INT64))
+ goto on_error;
+ if (!eina_value_convert(fetch, &convert))
+ goto on_error;
+ if (!eina_value_int64_get(&convert, i)) goto on_error;
+
+ r = EINA_TRUE;
+
+ on_error:
+ eina_value_free(fetch);
+ return r;
+}
+
+static void _invalidate(void *data, const Efl_Event *ev);
+static void _properties_changed(void *data, const Efl_Event *ev);
+
+EFL_CALLBACKS_ARRAY_DEFINE(child_model_callbacks,
+ { EFL_MODEL_EVENT_PROPERTIES_CHANGED, _properties_changed },
+ { EFL_EVENT_INVALIDATE, _invalidate });
+
+static void
+_process_model(Elm_Fileselector_Data *sd, Efl_Model *child)
+{
+ Elm_Fileselector_Item_Data *it_data;
+ Elm_Object_Item *item, *it_parent;
int itcn = ELM_FILE_UNKNOW;
- const char *path = NULL;
- const char *filename = NULL;
- const char *mime_type = NULL;
+
+ Efl_Model *parent = efl_parent_get(child);
+ char *parent_path = NULL;
+ // FIXME: This could be only needed with ELM_FILESELECTOR_MIME_FILTER
+ char *mime_type = NULL;
+ char *filename = NULL;
+ char *path = NULL;
int64_t size = 0;
double mtime = 0;
Eina_Bool dir = EINA_FALSE;
- Elm_Fileselector_Data *sd = lreq->sd;
- it_data->user_data = NULL;
- if (!sd->files_view)
- return EINA_FALSE;
+ if (!_fetch_string_value(parent, "path", &parent_path) ||
+ !_fetch_string_value(child, "path", &path) ||
+ !_fetch_string_value(child, "filename", &filename) ||
+ !_fetch_string_value(child, "mime_type", &mime_type) ||
+ !_fetch_double_value(child, "mtime", &mtime) ||
+ !_fetch_int64_value(child, "size", &size) ||
+ !_fetch_bool_value(child, "is_dir", &dir))
+ {
+ // SETUP listener to retry fetching all data when ready
+ efl_event_callback_array_add(efl_ref(child), child_model_callbacks(), sd);
+ goto cleanup;
+ }
- if (!_accessor_value_get(values_acc, 0, &path) || !path ||
- !_accessor_value_get(values_acc, 1, &filename) || !filename ||
- !_accessor_value_get(values_acc, 2, &dir) ||
- !_accessor_value_get(values_acc, 3, &size) ||
- !_accessor_value_get(values_acc, 4, &mtime) ||
- !_accessor_value_get(values_acc, 5, &mime_type))
+ if (!path || !filename || !mime_type)
{
- ERR("missing child Efl.Model data");
- return EINA_FALSE;
+ ERR("Wrong file info ('%s', '%s', '%s').", path, filename, mime_type);
+ goto cleanup;
}
if (!_filter_child(sd, path, filename, dir, mime_type))
- return EINA_FALSE;
+ goto cleanup;
- _signal_first(lreq);
+ it_data = calloc(1, sizeof(Elm_Fileselector_Item_Data));
+ if (!it_data)
+ {
+ ERR("Not enough memory.");
+ goto cleanup;
+ }
+ it_data->model = efl_ref(child);
+ it_data->parent_model = parent;
+ it_data->parent_path = eina_stringshare_add(parent_path);
it_data->path = eina_stringshare_add(path);
it_data->filename = eina_stringshare_add(filename);
it_data->size = size;
it_data->mtime = mtime;
it_data->mime_type = eina_stringshare_add(mime_type);
- it_data->parent_model = efl_ref(lreq->model);
- it_data->parent_path = eina_stringshare_add(lreq->path);
it_data->is_dir = dir;
- if (it_data->is_dir)
- itcn = ELM_DIRECTORY;
+ it_parent = efl_key_data_get(parent, ".item.data");
+
+ if (dir)
+ {
+ itcn = ELM_DIRECTORY;
+ }
else
{
if (evas_object_image_extension_can_load_get(it_data->filename))
@@ -745,210 +887,78 @@ _process_child(Elm_Fileselector_Item_Data *it_data, Eina_Accessor *values_acc)
}
if (sd->mode == ELM_FILESELECTOR_LIST)
+ item = elm_genlist_item_sorted_insert(sd->files_view, list_itc[itcn],
+ it_data,
+ it_parent,
+ (sd->expand && itcn == ELM_DIRECTORY) ? ELM_GENLIST_ITEM_TREE : ELM_GENLIST_ITEM_NONE,
+ _file_list_cmp, NULL, NULL);
+ else
+ item = elm_gengrid_item_sorted_insert(sd->files_view, grid_itc[itcn],
+ it_data,
+ _file_grid_cmp, NULL, NULL);
+ efl_key_data_set(child, ".item.data", item);
+
+ // Is this item selected
+ if (sd->target)
{
- item = elm_genlist_item_sorted_insert(sd->files_view, list_itc[itcn],
- it_data,
- lreq->parent_it,
- ((sd->expand) && (itcn == ELM_DIRECTORY))
- ? ELM_GENLIST_ITEM_TREE : ELM_GENLIST_ITEM_NONE,
- _file_list_cmp, NULL, NULL);
+ const char *target_path = eio_model_path_get(sd->target);
- if (lreq->selected_path && it_data->path == lreq->selected_path)
+ if (!strcmp(it_data->path, target_path))
{
elm_genlist_item_selected_set(item, EINA_TRUE);
elm_object_text_set(sd->name_entry, it_data->filename);
- }
- }
- else if (sd->mode == ELM_FILESELECTOR_GRID)
- {
- item = elm_gengrid_item_sorted_insert(sd->files_view, grid_itc[itcn],
- it_data,
- _file_grid_cmp, NULL, NULL);
- if (lreq->selected_path && it_data->path == lreq->selected_path)
- {
- elm_gengrid_item_selected_set(item, EINA_TRUE);
- elm_object_text_set(sd->name_entry, it_data->filename);
+ _reset_target(sd);
}
}
- return EINA_TRUE;
-}
-
-static void
-_process_child_cb(void *data, Efl_Event const*event)
-{
- Elm_Fileselector_Item_Data *it_data = data;
- Listing_Request *lreq = it_data->user_data;
- Efl_Future_Event_Success *ev = event->info;
- Eina_Accessor *values_acc = ev->value;
- if (!lreq->valid || !_process_child(it_data, values_acc))
- {
- efl_unref(it_data->model);
- free(it_data);
- }
-
- ++(lreq->item_processed_count);
- if (lreq->item_processed_count >= lreq->item_total)
- {
- if (!lreq->valid)
- {
- _listing_request_cleanup(lreq);
- return;
- }
- _signal_first(lreq);
- _process_last(lreq);
- }
+ cleanup:
+ free(mime_type);
+ free(filename);
+ free(path);
+ free(parent_path);
}
static void
-_process_child_error_cb(void *data, Efl_Event const* event EINA_UNUSED)
+_invalidate(void *data EINA_UNUSED, const Efl_Event *ev)
{
- Elm_Fileselector_Item_Data *it_data = data;
- Listing_Request *lreq = it_data->user_data;
-
- efl_unref(it_data->model);
- free(it_data);
-
- ERR("Failed to access to a model property");
-
- ++(lreq->item_processed_count);
- if (lreq->item_processed_count >= lreq->item_total)
- {
- if (!lreq->valid)
- {
- _listing_request_cleanup(lreq);
- return;
- }
- _signal_first(lreq);
- _process_last(lreq);
- }
+ efl_unref(ev->object);
}
static void
-_listing_request_cleanup(Listing_Request *lreq)
+_properties_changed(void *data, const Efl_Event *ev)
{
- if (lreq->parent_it)
- efl_unref(lreq->parent_it);
- efl_unref(lreq->obj);
- efl_unref(lreq->model);
- if (lreq->selected)
- efl_unref(lreq->selected);
- eina_stringshare_del(lreq->path);
- eina_stringshare_del(lreq->selected_path);
- free(lreq);
+ Elm_Fileselector_Data *sd = data;
+ Efl_Model *child = ev->object;
+
+ efl_event_callback_array_del(child, child_model_callbacks(), sd);
+ _process_model(sd, child);
+ efl_unref(child);
}
-static void
-_process_children_cb(void *data, Efl_Event const *event)
+static Eina_Value
+_process_children_cb(void *data, const Eina_Value v, const Eina_Future *dead_future EINA_UNUSED)
{
Listing_Request *lreq = data;
- Efl_Future_Event_Success *ev = event->info;
- Eina_Accessor *all_promises = ev->value;
- Eina_Accessor *children_accessor = NULL;
- Elm_Fileselector_Item_Data *it_data = NULL;
- const char *path = NULL;
- const char *selected_path = NULL;
- unsigned int count = 0;
- Elm_Fileselector_Data *sd = lreq->sd;
+ Efl_Model *child = NULL;
+ unsigned int i, len;
- if (!lreq->valid)
- {
- _listing_request_cleanup(lreq);
- return;
- }
+ if (eina_value_type_get(&v) == EINA_VALUE_TYPE_ERROR)
+ goto end;
- if (_accessor_value_get(all_promises, 0, &path) && path &&
- eina_accessor_data_get(all_promises, 1, (void **) &children_accessor))
- {
- if (lreq->selected)
- {
- if (!_accessor_value_get(all_promises, 2, &selected_path) ||
- !selected_path)
- {
- ERR("missing selected Efl.Model path information");
- _listing_request_cleanup(lreq);
- sd->current_populate_lreq = NULL;
- return;
- }
- lreq->selected_path = eina_stringshare_add(selected_path);
- }
- lreq->path = eina_stringshare_add(path);
- if (children_accessor)
- {
- Eina_List *children = NULL;
- void *child = NULL;
- EINA_ACCESSOR_FOREACH(children_accessor, count, child)
- {
- children = eina_list_append(children, child);
- }
-
- lreq->item_total = count;
-
- EINA_LIST_FREE(children, child)
- {
- Efl_Future *futures[7];
- Efl_Future *future_all = NULL;
- const char *prop[6] = {
- "path", "filename", "is_dir", "size", "mtime", "mime_type"
- };
- unsigned int i;
-
- it_data = calloc(1, sizeof(Elm_Fileselector_Item_Data));
- if (!it_data)
- {
- ERR("insufficient memory");
- break;
- }
-
- it_data->model = efl_ref(child);
- it_data->user_data = lreq;
-
- for (i = 0; i != 6; i++)
- {
- futures[i] = efl_model_property_get(child, prop[i]);
- }
+ if (!lreq->valid) goto end;
- future_all = efl_future_all(futures[0], futures[1], futures[2], futures[3], futures[4], futures[5]);
- efl_future_then(future_all, _process_child_cb, _process_child_error_cb, NULL, it_data);
- }
+ EINA_VALUE_ARRAY_FOREACH(&v, len, i, child)
+ _process_model(lreq->sd, child);
- // NOTE: lreq may have been deallocated in the previous loop
- lreq = NULL;
- }
- if (count == 0)
- {
- _signal_first(lreq);
- _process_last(lreq);
- }
- }
- else
- {
- ERR("missing Efl.Model information");
- _listing_request_cleanup(lreq);
- sd->current_populate_lreq = NULL;
- }
-}
+ lreq->item_total = len;
-static void
-_process_children_error_cb(void *data, Efl_Event const* event)
-{
- Eina_Error error = ((Efl_Future_Event_Failure*)event->info)->error;
- Listing_Request *lreq = data;
- Elm_Fileselector_Data *sd = lreq->sd;
+ _signal_first(lreq);
- if (error != EINA_ERROR_FUTURE_CANCEL)
- {
- ERR("failed to get information from Efl.Model");
- }
+ end:
+ _process_last(lreq);
- if (lreq->valid)
- {
- elm_progressbar_pulse(sd->spinner, EINA_FALSE);
- elm_layout_signal_emit(lreq->obj, "elm,action,spinner,hide", "elm");
- sd->current_populate_lreq = NULL;
- }
- _listing_request_cleanup(lreq);
+ return v;
}
static void
@@ -958,9 +968,12 @@ _populate(Evas_Object *obj,
Efl_Model *selected)
{
ELM_FILESELECTOR_DATA_GET(obj, sd);
- if (!model) return;
-
Listing_Request *lreq;
+ Eina_Future *future;
+ Eina_Value *fetch;
+ char *string;
+
+ if (!model) return;
if (sd->expand && sd->current_populate_lreq)
return;
@@ -971,7 +984,7 @@ _populate(Evas_Object *obj,
sd->current_populate_lreq = NULL;
}
- if (sd->model)
+ if (sd->monitoring)
_monitoring_stop(obj, sd, sd->model);
lreq = calloc(1, sizeof (Listing_Request));
@@ -998,15 +1011,33 @@ _populate(Evas_Object *obj,
if (elm_object_disabled_get(sd->name_entry))
elm_object_text_set(sd->name_entry, "");
- Efl_Future *futures[4] = {NULL,};
- Efl_Future *future_all = NULL;
- futures[0] = efl_model_property_get(model, "path");
- futures[1] = efl_model_children_slice_get(model, 0, 0);
+ fetch = efl_model_property_get(model, "path");
+ string = eina_value_to_string(fetch);
+ lreq->path = eina_stringshare_add(string);
+ eina_value_free(fetch);
+ free(string);
+
if (selected)
- futures[2] = efl_model_property_get(selected, "path");
+ {
+ fetch = efl_model_property_get(selected, "path");
+ string = eina_value_to_string(fetch);
+ lreq->selected_path = eina_stringshare_add(string);
+ eina_value_free(fetch);
+ free(string);
+ }
- future_all = efl_future_all(futures[0], futures[1], futures[2]);
- efl_future_then(future_all, _process_children_cb, _process_children_error_cb, NULL, lreq);
+ _signal_first(lreq);
+
+ if (efl_model_children_count_get(model))
+ {
+ future = efl_model_children_slice_get(model, 0, efl_model_children_count_get(model));
+ future = eina_future_then(future, _process_children_cb, lreq);
+ efl_future_Eina_FutureXXX_then(obj, future);
+ }
+ else
+ {
+ _process_last(lreq);
+ }
}
static void
@@ -1047,11 +1078,10 @@ _populate_do(void *data)
{
struct sel_data *sdata = data;
ELM_FILESELECTOR_DATA_GET(sdata->fs, sd);
+
_populate(sdata->fs, sdata->model, NULL, sdata->selected);
- if (sdata->model)
- efl_unref(sdata->model);
- if (sdata->selected)
- efl_unref(sdata->selected);
+ efl_replace(&sdata->model, NULL);
+ efl_replace(&sdata->selected, NULL);
sd->populate_idler = NULL;
@@ -1066,24 +1096,20 @@ _schedule_populate(Evas_Object *fs,
Efl_Model *selected)
{
struct sel_data *sdata;
+
sdata = calloc(1, sizeof(*sdata));
if (!sdata) return;
sdata->fs = fs;
- sdata->model = model;
- sdata->selected = selected;
-
- if (model) efl_ref(model);
- if (selected) efl_ref(selected);
+ efl_replace(&sdata->model, model);
+ efl_replace(&sdata->selected, selected);
if (sd->populate_idler)
{
struct sel_data *old_sdata;
old_sdata = ecore_idler_del(sd->populate_idler);
- if (old_sdata->model)
- efl_unref(old_sdata->model);
- if (old_sdata->selected)
- efl_unref(old_sdata->selected);
+ efl_replace(&old_sdata->model, NULL);
+ efl_replace(&old_sdata->selected, NULL);
free(old_sdata);
}
sd->populate_idler = ecore_idler_add(_populate_do, sdata);
@@ -1110,6 +1136,7 @@ _on_item_activated(void *data, const Efl_Event *event)
if (!sd->double_tap_navigation) return;
+ efl_parent_set(it_data->model, data);
_schedule_populate(data, sd, it_data->model, NULL);
}
@@ -1229,6 +1256,8 @@ _on_item_selected(void *data, const Efl_Event *event)
if (sd->double_tap_navigation) return;
+ // Take ownership of the model, to keep it alive
+ efl_parent_set(it_data->model, data);
_schedule_populate(data, sd, it_data->model, NULL);
}
@@ -1283,25 +1312,35 @@ _on_dir_up(void *data, const Efl_Event *event EINA_UNUSED)
ELM_FILESELECTOR_DATA_GET(fs, sd);
parent = efl_parent_get(sd->model);
- if (!parent)
- return;
- _populate(fs, parent, NULL, NULL);
+ if (!parent) return;
+
+ if (!efl_isa(parent, EIO_MODEL_CLASS))
+ {
+ const char *path = eio_model_path_get(sd->model);
+ char dir[PATH_MAX] = "";
+ char *r;
+
+ eina_strlcpy(dir, path, sizeof (dir));
+ r = dirname(dir);
+
+ // In case we have reached '/'
+ if (!strcmp(r, path)) return ;
+
+ elm_fileselector_path_set(fs, r);
+ }
+ else
+ {
+ _populate(fs, parent, NULL, NULL);
+ }
}
static void
_home(void *data, const Efl_Event *event EINA_UNUSED)
{
Evas_Object *fs = data;
- ELM_FILESELECTOR_DATA_GET(fs, sd);
// FIXME: maybe use vpath
- if (!sd->model || efl_isa(sd->model, EIO_MODEL_CLASS))
- {
- Eio_Model *model = efl_add(EIO_MODEL_CLASS, NULL,
- eio_model_path_set(efl_added, eina_environment_home_get()));
- _populate(fs, model, NULL, NULL);
- efl_unref(model);
- }
+ elm_fileselector_path_set(fs, eina_environment_home_get());
}
static void
@@ -1320,7 +1359,7 @@ _current_filter_changed(void *data,
}
static void
-_ok(void *data, const Efl_Event *event EINA_UNUSED)
+_ok(void *data, const Efl_Event *event)
{
const char *name;
const char *selection = NULL;
@@ -1343,7 +1382,8 @@ _ok(void *data, const Efl_Event *event EINA_UNUSED)
else
selection = eina_stringshare_printf("%s/%s", sd->path, name);
- selected_model = efl_add(efl_class_get(sd->model), NULL);
+ selected_model = efl_add_ref(efl_class_get(sd->model), event->object,
+ efl_event_callback_array_add(efl_added, noref_death(), NULL));
_model_str_property_set(selected_model, "path", selection);
_model_event_call
@@ -1386,121 +1426,80 @@ _text_activated_free_fs_data(Elm_Fileselector *fs)
efl_unref(fs);
}
-static void
-_text_activated_is_dir_then(void *data, Efl_Event const *event)
+static Eina_Value
+_on_text_activated_set_path_then(void *data, const Eina_Value v, const Eina_Future *dead_future EINA_UNUSED)
{
Evas_Object *fs = data;
- Eina_Bool is_dir = EINA_FALSE;
- ELM_FILESELECTOR_DATA_GET(fs, sd);
-
+ Eina_Value *fetch = NULL;
+ Efl_Model *parent;
Efl_Model *model = efl_key_ref_get(fs, _text_activated_model_key);
Eina_Stringshare *str = efl_key_data_get(fs, _text_activated_path_key);
+ Eina_Bool dir = EINA_FALSE;
+ ELM_FILESELECTOR_DATA_GET(fs, sd);
+
+ if (!sd->model) goto end;
- eina_value_get((Eina_Value*)((Efl_Future_Event_Success*)event->info)->value, &is_dir);
- if (is_dir)
+ if (eina_value_type_get(&v) == EINA_VALUE_TYPE_ERROR)
{
- // keep previous path for backspace key action
- if (sd->prev_model)
- efl_unref(sd->prev_model);
- sd->prev_model = efl_ref(sd->model);
+ _model_event_call(fs, ELM_FILESELECTOR_EVENT_SELECTED_INVALID, model, str);
+ goto selected;
+ }
- _populate(fs, model, NULL, NULL);
+ fetch = efl_model_property_get(sd->model, "is_dir");
+ eina_value_bool_get(fetch, &dir);
- if (sd->only_folder)
- {
- _model_event_call
- (fs, EFL_UI_EVENT_SELECTED, model, str);
- }
+ if (dir)
+ {
+ efl_replace(&sd->prev_model, sd->model);
+
+ parent = model;
+ model = NULL;
}
else
{
- Efl_Model *parent = efl_parent_get(model);
- if (!parent)
- {
- ERR("Efl.Model allocation error");
- }
- else
- {
- _populate(fs, parent, NULL, model);
+ parent = efl_parent_get(model);
- if (sd->only_folder)
- {
- _model_event_call
- (fs, EFL_UI_EVENT_SELECTED, model, str);
- }
- }
+ if (!parent || efl_isa(parent, EFL_MODEL_INTERFACE))
+ goto end;
}
- _text_activated_free_fs_data(fs);
-}
-
-static void
-_text_activated_is_dir_then_error(void *data, Efl_Event const* event EINA_UNUSED)
-{
- ERR("could not get information from Efl.Model");
- _text_activated_free_fs_data(data);
-}
-
-static void
-_on_text_activated_set_path_then(void *data, Efl_Event const * event EINA_UNUSED)
-{
- Evas_Object *fs = data;
- Efl_Future *future = NULL;
- ELM_FILESELECTOR_DATA_GET(fs, sd);
-
- if (!sd->model) return ;
-
- future = efl_model_property_get(sd->model, "is_dir");
- efl_future_then
- (future, _text_activated_is_dir_then, _text_activated_is_dir_then_error, NULL, data);
-}
+ _populate(fs, parent, NULL, model);
-static void
-_on_text_activated_set_path_then_error(void *data, Efl_Event const* event EINA_UNUSED)
-{
- Evas_Object *fs = data;
- Efl_Model *model = efl_key_data_get(fs, _text_activated_model_key);
- Eina_Stringshare *str = efl_key_data_get(fs, _text_activated_path_key);
-
- _model_event_call
- (fs, EFL_UI_EVENT_SELECTED, model, str);
-
- _model_event_call
- (fs, ELM_FILESELECTOR_EVENT_SELECTED_INVALID, model, str);
+ selected:
+ if (sd->only_folder)
+ _model_event_call(fs, EFL_UI_EVENT_SELECTED, model, str);
+ end:
_text_activated_free_fs_data(fs);
+ efl_unref(model);
+
+ return v;
}
static void
_on_text_activated(void *data, const Efl_Event *event)
{
+ Eina_Future *future = NULL;
Evas_Object *fs = data;
const char *path;
Efl_Model *model;
- Efl_Future *future = NULL;
ELM_FILESELECTOR_DATA_GET(fs, sd);
- if (!sd->model)
- return;
+ if (!sd->model) return;
path = elm_widget_part_text_get(event->object, NULL);
- model = efl_add(efl_class_get(sd->model), NULL);
- if (!model)
- return;
+ model = efl_add_ref(efl_class_get(sd->model), event->object,
+ efl_event_callback_array_add(efl_added, noref_death(), NULL));
+ if (!model) return;
future = _model_str_property_set(model, "path", path);
efl_key_data_set(fs, _text_activated_path_key, eina_stringshare_add(path));
efl_key_ref_set(fs, _text_activated_model_key, model);
efl_ref(fs);
- efl_future_then(future,
- _on_text_activated_set_path_then,
- _on_text_activated_set_path_then_error,
- NULL,
- fs);
+ eina_future_then(future, _on_text_activated_set_path_then, fs);
- efl_unref(model);
elm_object_focus_set(event->object, EINA_FALSE);
}
@@ -1545,7 +1544,8 @@ _anchor_clicked(void *data, const Efl_Event *event)
if (!sd->model)
return;
- model = efl_add(efl_class_get(sd->model), NULL);
+ model = efl_add_ref(efl_class_get(sd->model), event->object,
+ efl_event_callback_array_add(efl_added, noref_death(), NULL));
if (!model)
return;
_model_str_property_set(model, "path", info->name);
@@ -1655,87 +1655,23 @@ _files_grid_add(Evas_Object *obj)
return grid;
}
-static void
-_resource_then_error(void *data, Efl_Event const* event EINA_UNUSED)
+static Eina_Value
+_resource_created_then(void *data, const Eina_Value v, const Eina_Future *dead_future EINA_UNUSED)
{
- Elm_Fileselector_Item_Data *it_data = data;
- WRN("could not get information from Efl.Model");
- efl_unref(it_data->user_data);
- efl_unref(it_data->model);
- free(it_data);
-}
-
-static void
-_resource_created_then(void *data, Efl_Event const*event)
-{
- Elm_Fileselector_Item_Data *it_data = data;
- Evas_Object *obj = it_data->user_data;
- Efl_Future_Event_Success *ev = event->info;
- Eina_Accessor *values_acc = ev->value;
- int itcn = ELM_FILE_UNKNOW;
- const char *path = NULL;
- const char *filename = NULL;
- const char *mime_type = NULL;
- int64_t size = 0;
- double mtime = 0;
- Eina_Bool dir = EINA_FALSE;
- it_data->user_data = NULL;
-
- ELM_FILESELECTOR_DATA_GET(obj, sd);
-
- if (!sd || !sd->monitoring || sd->model != it_data->parent_model)
- goto cancel;
-
- if (!_accessor_value_get(values_acc, 0, &path) || !path ||
- !_accessor_value_get(values_acc, 1, &filename) || !filename ||
- !_accessor_value_get(values_acc, 2, &dir) ||
- !_accessor_value_get(values_acc, 3, &size) ||
- !_accessor_value_get(values_acc, 4, &mtime) ||
- !_accessor_value_get(values_acc, 5, &mime_type))
- {
- ERR("missing Efl.Model data");
- goto cancel;
- }
-
- if (!_filter_child(sd, path, filename, dir, mime_type))
- goto cancel;
-
- it_data->path = eina_stringshare_add(path);
- it_data->filename = eina_stringshare_add(filename);
- it_data->size = size;
- it_data->mtime = mtime;
- it_data->mime_type = eina_stringshare_add(mime_type);
- it_data->is_dir = dir;
+ Evas_Object *fs = data;
+ Efl_Model *child = NULL;
+ unsigned int len, i;
- if (dir)
- itcn = ELM_DIRECTORY;
- else
- {
- if (evas_object_image_extension_can_load_get(filename))
- itcn = ELM_FILE_IMAGE;
- }
+ if (eina_value_type_get(&v) == EINA_VALUE_TYPE_ERROR)
+ goto end;
- if (sd->mode == ELM_FILESELECTOR_LIST)
- elm_genlist_item_sorted_insert(sd->files_view, list_itc[itcn],
- it_data,
- NULL,
- (sd->expand && itcn == ELM_DIRECTORY)
- ? ELM_GENLIST_ITEM_TREE : ELM_GENLIST_ITEM_NONE,
- _file_list_cmp, NULL, NULL);
- else
- elm_gengrid_item_sorted_insert(sd->files_view, grid_itc[itcn],
- it_data,
- _file_grid_cmp, NULL, NULL);
+ ELM_FILESELECTOR_DATA_GET(fs, sd);
- efl_unref(obj);
- return;
+ EINA_VALUE_ARRAY_FOREACH(&v, len, i, child)
+ _process_model(sd, child);
-cancel:
- efl_unref(obj);
- efl_unref(it_data->model);
- efl_unref(it_data->parent_model);
- eina_stringshare_del(it_data->parent_path);
- free(it_data);
+ end:
+ return v;
}
static void
@@ -1743,38 +1679,16 @@ _resource_created(void *data, const Efl_Event *event)
{
Elm_Fileselector *fs = data;
Efl_Model_Children_Event* evt = event->info;
- Efl_Model *child = evt->child;
- Efl_Future *futures[7] = {NULL,};
- Efl_Future *future_all = NULL;
- Elm_Fileselector_Item_Data *it_data = NULL;
+ Eina_Future *f;
ELM_FILESELECTOR_DATA_GET(fs, sd);
if (!sd || !sd->monitoring || sd->model != event->object)
return;
- it_data = calloc(1, sizeof(Elm_Fileselector_Item_Data));
- if (!it_data)
- return;
-
- it_data->model = efl_ref(child);
- it_data->user_data = efl_ref(fs);
- it_data->parent_model = efl_ref(sd->model);
- it_data->parent_path = eina_stringshare_add(sd->path);
-
- future_all = efl_future_all
- (
- futures[0] = efl_model_property_get(child, "path"),
- futures[1] = efl_model_property_get(child, "filename"),
- futures[2] = efl_model_property_get(child, "is_dir"),
- futures[3] = efl_model_property_get(child, "size"),
- futures[4] = efl_model_property_get(child, "mtime"),
- futures[5] = efl_model_property_get(child, "mime_type")
- );
-
- efl_future_then(future_all, _resource_created_then, _resource_then_error, NULL, it_data);
-
- return;
+ f = efl_model_children_slice_get(sd->model, evt->index, 1);
+ f = eina_future_then(f, _resource_created_then, fs);
+ efl_future_Eina_FutureXXX_then(fs, f);
}
static void
@@ -1782,7 +1696,6 @@ _resource_deleted(void *data, const Efl_Event *event)
{
Evas_Object *obj = data;
Efl_Model_Children_Event* evt = event->info;
- Efl_Model *child = evt->child;
Elm_Object_Item *it = NULL;
Eina_Bool selected = EINA_FALSE;
@@ -1791,36 +1704,12 @@ _resource_deleted(void *data, const Efl_Event *event)
if (!sd || !sd->monitoring || sd->model != event->object)
return;
- if (sd->mode == ELM_FILESELECTOR_LIST)
- {
- it = elm_genlist_first_item_get(sd->files_view);
- while (it)
- {
- Elm_Fileselector_Item_Data *it_data = elm_object_item_data_get(it);
- if (child == it_data->model)
- {
- selected = elm_genlist_item_selected_get(it);
- break;
- }
- it = elm_genlist_item_next_get(it);
- }
- }
- else
- {
- it = elm_gengrid_first_item_get(sd->files_view);
- while (it)
- {
- Elm_Fileselector_Item_Data *it_data = elm_object_item_data_get(it);
- if (child == it_data->model)
- {
- selected = elm_genlist_item_selected_get(it);
- break;
- }
- it = elm_gengrid_item_next_get(it);
- }
- }
+ if (!evt->child) return ;
- if (it) elm_wdg_item_del(it);
+ it = efl_key_data_get(evt->child, ".item.data");
+ if (!it) return ;
+
+ selected = elm_genlist_item_selected_get(it);
if (selected)
{
@@ -1834,13 +1723,14 @@ _resource_deleted(void *data, const Efl_Event *event)
buf = eina_strbuf_new();
EINA_LIST_FOREACH_SAFE(sd->multi_selection, li, l, item)
{
- Elm_Fileselector_Item_Data *it_data = elm_object_item_data_get(item);
- if (child == it_data->model)
+ if (item == it)
{
sd->multi_selection = eina_list_remove_list(sd->multi_selection, li);
}
else
{
+ Elm_Fileselector_Item_Data *it_data = elm_object_item_data_get(item);
+
if (!first)
eina_strbuf_append_length(buf, ", ", 2);
else
@@ -1857,6 +1747,8 @@ _resource_deleted(void *data, const Efl_Event *event)
elm_object_text_set(sd->name_entry, "");
}
+ if (it) efl_del(it);
+
return;
}
@@ -2051,44 +1943,27 @@ _elm_fileselector_efl_object_constructor(Eo *obj, Elm_Fileselector_Data *sd)
sd->obj = obj;
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_FILE_CHOOSER);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_FILE_CHOOSER);
return obj;
}
-static void
-_legacy_smart_callback_caller_path_then(void *data, Efl_Event const *event)
-{
- Legacy_Event_Path_Then_Data *evt_data = data;
- _event_to_legacy_call(evt_data->eo_obj, evt_data->evt_desc, ((Efl_Future_Event_Success*)event->info)->value);
- free(data);
-}
-
-static void
-_legacy_smart_callback_caller_path_then_error(void *data, Efl_Event const* event)
-{
- Eina_Error err = ((Efl_Future_Event_Failure*)event->info)->error;
- ERR("Efl.Model property \"path\" error: %s", eina_error_msg_get(err));
- free(data);
-}
-
static Eina_Bool
_from_efl_event_call(Elm_Fileselector *fs, const Efl_Event_Description *evt_desc, Efl_Model *model)
{
- Efl_Future *future;
Legacy_Event_Path_Then_Data *evt_data;
+ Eina_Value *fetch;
+ char *path;
evt_data = calloc(1, sizeof(Legacy_Event_Path_Then_Data));
evt_data->eo_obj = fs;
evt_data->evt_desc = evt_desc;
// Call legacy smart callback with path
- future = efl_model_property_get(model, "path");
- efl_future_then(future,
- _legacy_smart_callback_caller_path_then,
- _legacy_smart_callback_caller_path_then_error,
- NULL,
- evt_data);
+ fetch = efl_model_property_get(model, "path");
+ path = eina_value_to_string(fetch);
+
+ _event_to_legacy_call(evt_data->eo_obj, evt_data->evt_desc, path);
// Call Eo event with model
return efl_event_callback_call(fs, evt_desc, model);
@@ -2103,7 +1978,8 @@ _from_legacy_event_call(Elm_Fileselector *fs, Elm_Fileselector_Data *sd, const E
else
model_cls = efl_class_get(sd->model);
- Efl_Model *model = efl_add(model_cls, NULL);
+ Efl_Model *model = efl_add_ref(model_cls, fs,
+ efl_event_callback_array_add(efl_added, noref_death(), NULL));
_model_str_property_set(model, "path", path);
// Call Eo event with model
@@ -2177,7 +2053,7 @@ elm_fileselector_is_save_get(const Evas_Object *obj)
}
EOLIAN static Eina_Bool
-_elm_fileselector_elm_interface_fileselector_is_save_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd)
+_elm_fileselector_elm_interface_fileselector_is_save_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd)
{
return !elm_object_disabled_get(sd->name_entry);
}
@@ -2210,7 +2086,7 @@ elm_fileselector_folder_only_get(const Evas_Object *obj)
}
EOLIAN static Eina_Bool
-_elm_fileselector_elm_interface_fileselector_folder_only_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd)
+_elm_fileselector_elm_interface_fileselector_folder_only_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd)
{
return sd->only_folder;
}
@@ -2256,7 +2132,7 @@ _elm_fileselector_buttons_ok_cancel_set(Eo *obj, Elm_Fileselector_Data *sd, Eina
}
EOLIAN static Eina_Bool
-_elm_fileselector_buttons_ok_cancel_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd)
+_elm_fileselector_buttons_ok_cancel_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd)
{
return sd->ok_button ? EINA_TRUE : EINA_FALSE;
}
@@ -2288,7 +2164,7 @@ elm_fileselector_expandable_get(const Evas_Object *obj)
}
EOLIAN static Eina_Bool
-_elm_fileselector_elm_interface_fileselector_expandable_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd)
+_elm_fileselector_elm_interface_fileselector_expandable_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd)
{
return sd->expand;
}
@@ -2312,18 +2188,19 @@ elm_fileselector_path_set(Evas_Object *obj,
void
_elm_fileselector_path_set_internal(Evas_Object *obj, const char *_path)
{
- Eio_Model *model = efl_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(efl_added, _path));
+ Eio_Model *model = efl_add_ref(EIO_MODEL_CLASS, obj, eio_model_path_set(efl_added, _path),
+ efl_event_callback_array_add(efl_added, noref_death(), NULL));
if (!model)
{
ERR("Efl.Model allocation error");
return;
}
- elm_interface_fileselector_model_set(obj, model);
+ efl_ui_view_model_set(obj, model);
efl_unref(model);
}
EOLIAN static void
-_elm_fileselector_elm_interface_fileselector_model_set(Eo *obj, Elm_Fileselector_Data *sd, Efl_Model *model)
+_elm_fileselector_efl_ui_view_model_set(Eo *obj, Elm_Fileselector_Data *sd, Efl_Model *model)
{
_schedule_populate(obj, sd, model, NULL);
}
@@ -2354,7 +2231,7 @@ _elm_fileselector_path_get_internal(const Evas_Object *obj)
}
EOLIAN static Efl_Model *
-_elm_fileselector_elm_interface_fileselector_model_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd)
+_elm_fileselector_efl_ui_view_model_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd)
{
return sd->model;
}
@@ -2410,7 +2287,7 @@ elm_fileselector_mode_get(const Evas_Object *obj)
}
EOLIAN static Elm_Fileselector_Mode
-_elm_fileselector_elm_interface_fileselector_mode_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd)
+_elm_fileselector_elm_interface_fileselector_mode_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd)
{
return sd->mode;
}
@@ -2465,7 +2342,7 @@ elm_fileselector_multi_select_get(const Evas_Object *obj)
}
EOLIAN static Eina_Bool
-_elm_fileselector_elm_interface_fileselector_multi_select_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd)
+_elm_fileselector_elm_interface_fileselector_multi_select_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd)
{
return sd->multi;
}
@@ -2512,6 +2389,10 @@ _elm_fileselector_selected_get_internal(const Evas_Object *obj)
{
ELM_FILESELECTOR_DATA_GET(obj, sd);
if (!sd->path) return NULL;
+ if (sd->target)
+ {
+ return eio_model_path_get(sd->target);
+ }
Elm_Fileselector_Item_Data *it_data = _selected_item_data_get(sd);
if (it_data)
@@ -2521,7 +2402,7 @@ _elm_fileselector_selected_get_internal(const Evas_Object *obj)
}
EOLIAN static Efl_Model *
-_elm_fileselector_elm_interface_fileselector_selected_model_get(Eo *fs EINA_UNUSED, Elm_Fileselector_Data *sd)
+_elm_fileselector_elm_interface_fileselector_selected_model_get(const Eo *fs EINA_UNUSED, Elm_Fileselector_Data *sd)
{
if (!sd->model)
{
@@ -2555,140 +2436,178 @@ elm_fileselector_selected_set(Evas_Object *obj,
}
}
+static void
+_properties_ready(void *data, const Efl_Event *ev)
+{
+ Evas_Object *obj = data;
+ Efl_Model_Property_Event *event = ev->info;
+ const char *property = NULL;
+ Eina_Array_Iterator iterator;
+ unsigned int i;
+
+ ELM_FILESELECTOR_DATA_GET(obj, pd);
+
+ EINA_ARRAY_ITER_NEXT(event->changed_properties, i, property, iterator)
+ if (!strcmp(property, "is_dir"))
+ {
+ Eina_Value *value;
+ Eina_Bool is_dir = EINA_FALSE;
+
+ value = efl_model_property_get(ev->object, "is_dir");
+ if (eina_value_type_get(value) != EINA_VALUE_TYPE_BOOL)
+ {
+ ERR("Unexpected type for 'is_dir': '%s' with value '%s'.", eina_value_type_get(value)->name, eina_value_to_string(value));
+ return ;
+ }
+
+ efl_event_callback_del(ev->object, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _properties_ready, obj);
+
+ eina_value_bool_get(value, &is_dir);
+
+ if (!is_dir)
+ {
+ Efl_Model *parent;
+ const char *path = eio_model_path_get(ev->object);
+ char *dir = ecore_file_dir_get(path);
+
+ parent = efl_add_ref(EIO_MODEL_CLASS, obj, eio_model_path_set(efl_added, dir),
+ efl_event_callback_array_add(efl_added, noref_death(), NULL));
+ if (!parent)
+ {
+ ERR("Could not create model for '%s'.", dir);
+ _reset_target(pd);
+ free(dir);
+ return ;
+ }
+ efl_model_children_count_get(parent);
+
+ _schedule_populate(obj, pd, parent, ev->object);
+ efl_unref(parent);
+ free(dir);
+ }
+ else
+ {
+ efl_model_children_count_get(ev->object);
+ _schedule_populate(obj, pd, ev->object, NULL);
+ }
+ return ;
+ }
+}
+
Eina_Bool
-_elm_fileselector_selected_set_internal(Evas_Object *obj, const char *_path)
+_elm_fileselector_selected_set_internal(Evas_Object *obj, const char *path)
{
+ Eina_Value *value;
+ struct stat st;
+
ELM_FILESELECTOR_INTERFACE_CHECK(obj, EINA_FALSE);
- Eina_Bool ret = EINA_FALSE;
- char *dir;
- char *path;
- Eio_Model *model = NULL;
- Eio_Model *parent = NULL;
- ELM_FILESELECTOR_DATA_GET(obj, sd);
+ ELM_FILESELECTOR_DATA_GET(obj, pd);
- path = ecore_file_realpath(_path);
+ _reset_target(pd);
- if (ecore_file_is_dir(path))
- {
- model = efl_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(efl_added, path));
- if (!model)
- {
- ERR("Efl.Model allocation error");
- goto clean_up;
- }
+ if (stat(path, &st)) return EINA_FALSE;
- _schedule_populate(obj, sd, model, NULL);
- efl_unref(model);
- ret = EINA_TRUE;
+ pd->target = efl_add_ref(EIO_MODEL_CLASS, obj, eio_model_path_set(efl_added, path),
+ efl_event_callback_array_add(efl_added, noref_death(), NULL));
+ if (!pd->target)
+ {
+ ERR("Could not create model for '%s'.", path);
+ return EINA_FALSE;
}
- else
+
+ efl_event_callback_add(pd->target, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _properties_ready, obj);
+ value = efl_model_property_get(pd->target, "is_dir");
+ if (eina_value_type_get(value) == EINA_VALUE_TYPE_ERROR)
{
- if (!ecore_file_exists(path))
- {
- goto clean_up;
- }
+ Eina_Error err = 0;
- model = efl_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(efl_added, path));
- if (!model)
+ eina_value_error_get(value, &err);
+ if (err != EAGAIN)
{
- ERR("Efl.Model allocation error");
+ ERR("Unexpected error '%s' when setting path '%s'.", eina_value_to_string(value), path);
goto clean_up;
}
- dir = ecore_file_dir_get(path);
- parent = efl_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(efl_added, dir));
- if (parent)
- {
- _schedule_populate(obj, sd, parent, model);
- efl_unref(parent);
- ret = EINA_TRUE;
- }
- free(dir);
- efl_unref(model);
+ return EINA_TRUE;
}
-clean_up:
- free(path);
+ ERR("Unexpected value '%s' when setting path '%s'.", eina_value_to_string(value), path);
- return ret;
+clean_up:
+ _reset_target(pd);
+ return EINA_FALSE;
}
-static void
-_selected_model_set_free_fs_data(Elm_Fileselector *fs)
+EOLIAN static Eina_Bool
+_elm_fileselector_elm_interface_fileselector_selected_model_set(Eo *obj, Elm_Fileselector_Data *pd, Efl_Model *model)
{
- efl_key_ref_set(fs, _selected_model_set_model_key, NULL);
- efl_key_data_set(fs, _selected_model_set_promise_owner_key, NULL);
- efl_unref(fs);
-}
+ Eina_Value *value = NULL;
+ Eina_Bool dir = EINA_FALSE;
-static void
-_selected_model_set_then_error(void *data, Efl_Event const* event)
-{
- Eina_Error err = ((Efl_Future_Event_Failure*)event->info)->error;
- Efl_Promise *promise_owner = efl_key_data_get(data, _selected_model_set_promise_owner_key);
- if (promise_owner)
- efl_promise_failed_set(promise_owner, err);
- _selected_model_set_free_fs_data(data);
-}
+ if (!efl_isa(model, EIO_MODEL_CLASS)) return EINA_FALSE;
-static void
-_selected_model_set_is_dir_then(void *data, Efl_Event const *event)
-{
- Elm_Fileselector *fs = data;
- Eina_Bool is_dir = EINA_FALSE;
- Efl_Model *model = efl_key_ref_get(fs, _selected_model_set_model_key);
- Efl_Promise *promise_owner = efl_key_data_get(fs, _selected_model_set_promise_owner_key);
- ELM_FILESELECTOR_DATA_GET(fs, sd);
+ efl_event_callback_del(pd->target, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _properties_ready, obj);
+ efl_replace(&pd->target, model);
- eina_value_get((Eina_Value*)((Efl_Future_Event_Success*)event->info)->value, &is_dir);
- if (is_dir)
- {
- _schedule_populate(fs, sd, model, NULL);
- if (promise_owner)
- {
- efl_ref(model);
- efl_promise_value_set(promise_owner, model, _model_free_eo_cb);
- }
- }
- else
- {
- Efl_Model *parent = efl_parent_get(model);
- if (parent)
- {
- _schedule_populate(fs, sd, parent, model);
+ if (!model) return EINA_TRUE;
- if (promise_owner)
- {
- efl_ref(model);
- efl_promise_value_set(promise_owner, model, _model_free_eo_cb);
- }
- }
- else
- {
- if (promise_owner)
- efl_promise_failed_set(promise_owner, ELM_FILESELECTOR_ERROR_UNKNOWN);
- }
- }
- _selected_model_set_free_fs_data(fs);
-}
+ efl_event_callback_add(pd->target, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _properties_ready, obj);
+ value = efl_model_property_get(pd->target, "is_dir");
+ if (eina_value_type_get(value) == EINA_VALUE_TYPE_ERROR)
+ {
+ Eina_Error err = 0;
-EOLIAN static Efl_Future*
-_elm_fileselector_elm_interface_fileselector_selected_model_set(Eo *obj, Elm_Fileselector_Data *sd EINA_UNUSED, Efl_Model *model)
-{
- Efl_Future *future = NULL;
- Efl_Promise* promise = efl_add(EFL_PROMISE_CLASS, obj);
- if (!model)
- {
- efl_promise_failed_set(promise, ELM_FILESELECTOR_ERROR_INVALID_MODEL);
- return efl_promise_future_get(promise);
- }
- future = efl_model_property_get(model, "is_dir");
+ eina_value_error_get(value, &err);
+ if (err != EAGAIN)
+ {
+ ERR("Unexpected error '%s' when setting path '%s'.", eina_value_to_string(value), eio_model_path_get(pd->target));
+ goto clean_up;
+ }
+
+ return EINA_TRUE;
+ }
+
+ if (eina_value_type_get(value) != EINA_VALUE_TYPE_BOOL)
+ {
+ ERR("Unexpected type for 'is_dir': '%s' with value '%s'.", eina_value_type_get(value)->name, eina_value_to_string(value));
+ goto clean_up;
+ }
+
+ efl_event_callback_del(pd->target, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _properties_ready, obj);
+
+ eina_value_bool_get(value, &dir);
- efl_key_ref_set(obj, _selected_model_set_model_key, model);
- efl_key_data_set(obj, _selected_model_set_promise_owner_key, promise);
+ if (!dir)
+ {
+ Efl_Model *parent;
+ const char *path = eio_model_path_get(pd->target);
+ char *d = ecore_file_dir_get(path);
- efl_future_then(future, _selected_model_set_is_dir_then, _selected_model_set_then_error, NULL, efl_ref(obj));
- return efl_promise_future_get(promise);
+ parent = efl_add_ref(EIO_MODEL_CLASS, obj, eio_model_path_set(efl_added, d),
+ efl_event_callback_array_add(efl_added, noref_death(), NULL));
+ if (!parent)
+ {
+ ERR("Could not create model for '%s'.", d);
+ free(d);
+ goto clean_up;
+ }
+ efl_model_children_count_get(parent);
+
+ _schedule_populate(obj, pd, parent, pd->target);
+ efl_unref(parent);
+ free(d);
+ }
+ else
+ {
+ efl_model_children_count_get(pd->target);
+ _schedule_populate(obj, pd, pd->target, NULL);
+ }
+
+ return EINA_TRUE;
+
+ clean_up:
+ _reset_target(pd);
+ return EINA_FALSE;
}
EAPI const Eina_List *
@@ -2731,7 +2650,7 @@ _elm_fileselector_selected_paths_get_internal(const Evas_Object* obj)
}
EOLIAN static const Eina_List*
-_elm_fileselector_elm_interface_fileselector_selected_models_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd)
+_elm_fileselector_elm_interface_fileselector_selected_models_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd)
{
Eina_List *l;
Elm_Object_Item *item;
@@ -2761,7 +2680,7 @@ elm_fileselector_current_name_get(const Evas_Object *obj)
}
EOLIAN static const char *
-_elm_fileselector_elm_interface_fileselector_current_name_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd)
+_elm_fileselector_elm_interface_fileselector_current_name_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd)
{
return elm_object_text_get(sd->name_entry);
}
@@ -2953,7 +2872,7 @@ elm_fileselector_hidden_visible_get(const Evas_Object *obj)
}
EOLIAN static Eina_Bool
-_elm_fileselector_elm_interface_fileselector_hidden_visible_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd)
+_elm_fileselector_elm_interface_fileselector_hidden_visible_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd)
{
return sd->hidden_visible;
}
@@ -2997,7 +2916,7 @@ elm_fileselector_thumbnail_size_get(const Evas_Object *obj,
}
EOLIAN static void
-_elm_fileselector_elm_interface_fileselector_thumbnail_size_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd, Evas_Coord *w, Evas_Coord *h)
+_elm_fileselector_elm_interface_fileselector_thumbnail_size_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd, Evas_Coord *w, Evas_Coord *h)
{
if (w) *w = sd->thumbnail_size.w;
if (h) *h = sd->thumbnail_size.h;
@@ -3061,21 +2980,11 @@ elm_fileselector_sort_method_get(const Evas_Object *obj)
}
EOLIAN static Elm_Fileselector_Sort
-_elm_fileselector_elm_interface_fileselector_sort_method_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd)
+_elm_fileselector_elm_interface_fileselector_sort_method_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd)
{
return sd->sort_type;
}
-EOLIAN static Eina_Bool
-_elm_fileselector_elm_widget_focus_state_apply(Eo *obj, Elm_Fileselector_Data *pd, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Elm_Widget *redirect)
-{
- Eina_Bool ret = efl_ui_widget_focus_state_apply(efl_super(obj, MY_CLASS), current_state, configured_state, redirect);
-
- _focus_chain_update(obj, pd);
-
- return ret;
-}
-
static Eina_Bool
_elm_fileselector_text_set(Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd, const char *part, const char *label)
{
@@ -3146,7 +3055,7 @@ _elm_fileselector_class_destructor(Efl_Class *klass EINA_UNUSED)
}
EOLIAN const Efl_Access_Action_Data *
-_elm_fileselector_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Data *pd EINA_UNUSED)
+_elm_fileselector_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Data *pd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "select", "select", NULL, _key_action_select },
diff --git a/src/lib/elementary/elc_fileselector_button.c b/src/lib/elementary/elc_fileselector_button.c
index 52b7789e16..76c60c1c38 100644
--- a/src/lib/elementary/elc_fileselector_button.c
+++ b/src/lib/elementary/elc_fileselector_button.c
@@ -2,9 +2,11 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
+#define ELM_INTERFACE_FILESELECTOR_BETA
#include <Elementary.h>
+#include "Eio_Eo.h"
#include "elm_priv.h"
#include "elm_fileselector_button.eo.h"
#include "elm_fileselector_entry.eo.h"
@@ -37,14 +39,8 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
};
#undef ELM_PRIV_FILESELECTOR_BUTTON_SIGNALS
-static void
-_model_free_eo_cb(void *eo)
-{
- efl_unref(eo);
-}
-
EOLIAN static Efl_Ui_Theme_Apply
-_elm_fileselector_button_elm_widget_theme_apply(Eo *obj, Elm_Fileselector_Button_Data *sd EINA_UNUSED)
+_elm_fileselector_button_efl_ui_widget_theme_apply(Eo *obj, Elm_Fileselector_Button_Data *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
@@ -71,46 +67,31 @@ _elm_fileselector_button_elm_widget_theme_apply(Eo *obj, Elm_Fileselector_Button
}
static void
-_replace_path_then(void *data, Efl_Event const *event)
-{
- Elm_Fileselector_Button_Data *sd = data;
- Efl_Future_Event_Success *ev = event->info;
- Eina_Value *v = ev->value;
- const char *path = NULL;
-
- eina_value_get(v, &path);
- eina_stringshare_replace(&sd->fsd.path, path);
- _event_to_legacy_call
- (sd->obj, ELM_FILESELECTOR_BUTTON_EVENT_FILE_CHOSEN, (void *)path);
-}
-
-static void
-_replace_path_then_error(void *data, Efl_Event const* event EINA_UNUSED)
-{
- Elm_Fileselector_Button_Data *sd = data;
- ERR("could not get information from Efl.Model");
- eina_stringshare_replace(&sd->fsd.path, NULL);
- _event_to_legacy_call
- (sd->obj, ELM_FILESELECTOR_BUTTON_EVENT_FILE_CHOSEN, NULL);
-}
-
-static void
-_selection_done(void *data, const Efl_Event *event)
+_selection_done(void *data, const Efl_Event *event EINA_UNUSED)
{
Elm_Fileselector_Button_Data *sd = data;
- Efl_Model *model = event->info;
+ Efl_Model *model;;
Evas_Object *del;
+ model = elm_interface_fileselector_selected_model_get(sd->fs);
if (model)
{
- Efl_Future *future = NULL;
- if (sd->fsd.model)
- efl_unref(sd->fsd.model);
- sd->fsd.model = efl_ref(model);
- future = efl_model_property_get(model, "path");
- efl_future_then(future, _replace_path_then, _replace_path_then_error, NULL, sd);
+ Eina_Value *path;
+ char *file;
+
+ efl_replace(&sd->fsd.model, model);
+
+ path = efl_model_property_get(model, "path");
+ file = eina_value_to_string(path);
+ eina_stringshare_replace(&sd->fsd.path, file);
+
efl_event_callback_call
(sd->obj, ELM_FILESELECTOR_BUTTON_EVENT_FILE_CHOSEN, model);
+ _event_to_legacy_call
+ (sd->obj, ELM_FILESELECTOR_BUTTON_EVENT_FILE_CHOSEN, file);
+
+ eina_value_free(path);
+ free(file);
}
else
{
@@ -209,6 +190,27 @@ _button_clicked(void *data, const Efl_Event *event EINA_UNUSED)
_activate(data);
}
+static void _noref_death(void *data EINA_UNUSED, const Efl_Event *event);
+static void _invalidated(void *data EINA_UNUSED, const Efl_Event *event);
+
+EFL_CALLBACKS_ARRAY_DEFINE(noref_death,
+ { EFL_EVENT_NOREF, _noref_death },
+ { EFL_EVENT_INVALIDATE, _invalidated });
+
+static void
+_noref_death(void *data EINA_UNUSED, const Efl_Event *event)
+{
+ efl_event_callback_array_del(event->object, noref_death(), NULL);
+ efl_del(event->object);
+}
+
+static void
+_invalidated(void *data EINA_UNUSED, const Efl_Event *event)
+{
+ // This means our parent is dying, EFL_EVENT_NOREF can be called after invalidated
+ efl_event_callback_array_del(event->object, noref_death(), NULL);
+}
+
EOLIAN static void
_elm_fileselector_button_efl_canvas_group_group_add(Eo *obj, Elm_Fileselector_Button_Data *priv)
{
@@ -222,7 +224,9 @@ _elm_fileselector_button_efl_canvas_group_group_add(Eo *obj, Elm_Fileselector_Bu
if (path) priv->fsd.path = eina_stringshare_add(path);
else priv->fsd.path = eina_stringshare_add("/");
- priv->fsd.model = efl_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(efl_added, priv->fsd.path));
+ priv->fsd.model = efl_add_ref(EIO_MODEL_CLASS, obj,
+ eio_model_path_set(efl_added, priv->fsd.path),
+ efl_event_callback_array_add(efl_added, noref_death(), NULL));
priv->fsd.expandable = _elm_config->fileselector_expand_enable;
priv->inwin_mode = _elm_config->inwin_dialogs_enable;
@@ -253,7 +257,7 @@ _elm_fileselector_button_efl_canvas_group_group_del(Eo *obj, Elm_Fileselector_Bu
}
EOLIAN static Eina_Bool
-_elm_fileselector_button_efl_ui_autorepeat_autorepeat_supported_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd EINA_UNUSED)
+_elm_fileselector_button_efl_ui_autorepeat_autorepeat_supported_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd EINA_UNUSED)
{
return EINA_FALSE;
}
@@ -273,7 +277,7 @@ _elm_fileselector_button_efl_object_constructor(Eo *obj, Elm_Fileselector_Button
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_PUSH_BUTTON);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_PUSH_BUTTON);
return obj;
}
@@ -321,16 +325,15 @@ _elm_fileselector_button_path_set_internal(Evas_Object *obj, const char *path)
{
ELM_FILESELECTOR_BUTTON_DATA_GET_OR_RETURN(obj, sd);
- Efl_Model *model = efl_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(efl_added, path));
+ Efl_Model *model = efl_add(EIO_MODEL_CLASS, obj, eio_model_path_set(efl_added, path));
if (!model)
{
ERR("Efl.Model allocation error");
return;
}
- if (sd->fsd.model)
- efl_unref(sd->fsd.model);
- sd->fsd.model = efl_ref(model);
+ // XXX: the efl_ref here smells wrong. fsd.model is only unreffed ONCE so this obj leaks...
+ efl_replace(&sd->fsd.model, model);
eina_stringshare_replace(&sd->fsd.path, path);
@@ -345,23 +348,28 @@ elm_fileselector_button_path_set(Evas_Object *obj, const char *path)
}
EOLIAN static void
-_elm_fileselector_button_elm_interface_fileselector_model_set(Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd, Efl_Model *model)
+_elm_fileselector_button_efl_ui_view_model_set(Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd, Efl_Model *model)
{
- if (sd->fsd.model)
- efl_unref(sd->fsd.model);
+ char *file = NULL;
+
+ efl_replace(&sd->fsd.model, model);
if (model)
{
- sd->fsd.model = efl_ref(model);
- efl_future_then(efl_model_property_get(model, "path"),
- _replace_path_then, _replace_path_then_error, NULL, sd);
- }
- else
- {
- sd->fsd.model = NULL;
- eina_stringshare_replace(&sd->fsd.path, NULL);
+ Eina_Value *path;
+
+ path = efl_model_property_get(model, "path");
+ file = eina_value_to_string(path);
+ eina_value_free(path);
}
+ eina_stringshare_replace(&sd->fsd.path, file);
+
+ _event_to_legacy_call
+ (sd->obj, ELM_FILESELECTOR_BUTTON_EVENT_FILE_CHOSEN, file);
+
+ free(file);
+
if (sd->fs) elm_interface_fileselector_selected_model_set(sd->fs, model);
}
@@ -380,7 +388,7 @@ elm_fileselector_button_path_get(const Evas_Object *obj)
}
EOLIAN static Efl_Model *
-_elm_fileselector_button_elm_interface_fileselector_model_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd)
+_elm_fileselector_button_efl_ui_view_model_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd)
{
return sd->fsd.model;
}
@@ -411,7 +419,7 @@ elm_fileselector_button_expandable_get(const Evas_Object *obj)
}
EOLIAN static Eina_Bool
-_elm_fileselector_button_elm_interface_fileselector_expandable_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd)
+_elm_fileselector_button_elm_interface_fileselector_expandable_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd)
{
return sd->fsd.expandable;
}
@@ -442,7 +450,7 @@ elm_fileselector_button_folder_only_get(const Evas_Object *obj)
}
EOLIAN static Eina_Bool
-_elm_fileselector_button_elm_interface_fileselector_folder_only_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd)
+_elm_fileselector_button_elm_interface_fileselector_folder_only_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd)
{
return sd->fsd.folder_only;
}
@@ -473,7 +481,7 @@ elm_fileselector_button_is_save_get(const Evas_Object *obj)
}
EOLIAN static Eina_Bool
-_elm_fileselector_button_elm_interface_fileselector_is_save_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd)
+_elm_fileselector_button_elm_interface_fileselector_is_save_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd)
{
return sd->fsd.is_save;
}
@@ -487,7 +495,7 @@ _elm_fileselector_button_elm_interface_fileselector_mode_set(Eo *obj EINA_UNUSED
}
EOLIAN static Elm_Fileselector_Mode
-_elm_fileselector_button_elm_interface_fileselector_mode_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd)
+_elm_fileselector_button_elm_interface_fileselector_mode_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd)
{
return sd->fsd.mode;
}
@@ -501,7 +509,7 @@ _elm_fileselector_button_elm_interface_fileselector_sort_method_set(Eo *obj EINA
}
EOLIAN static Elm_Fileselector_Sort
-_elm_fileselector_button_elm_interface_fileselector_sort_method_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd)
+_elm_fileselector_button_elm_interface_fileselector_sort_method_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd)
{
return sd->fsd.sort_type;
}
@@ -515,7 +523,7 @@ _elm_fileselector_button_elm_interface_fileselector_multi_select_set(Eo *obj EIN
}
EOLIAN static Eina_Bool
-_elm_fileselector_button_elm_interface_fileselector_multi_select_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd)
+_elm_fileselector_button_elm_interface_fileselector_multi_select_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd)
{
return sd->fsd.multi;
}
@@ -531,7 +539,7 @@ _elm_fileselector_button_selected_paths_get_internal(const Evas_Object *obj)
}
EOLIAN static const Eina_List*
-_elm_fileselector_button_elm_interface_fileselector_selected_models_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd)
+_elm_fileselector_button_elm_interface_fileselector_selected_models_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd)
{
if (sd->fs) return elm_interface_fileselector_selected_models_get(sd->fs);
@@ -549,7 +557,7 @@ _elm_fileselector_button_selected_get_internal(const Evas_Object *obj)
}
EOLIAN static Efl_Model *
-_elm_fileselector_button_elm_interface_fileselector_selected_model_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd)
+_elm_fileselector_button_elm_interface_fileselector_selected_model_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd)
{
if (sd->fs) return elm_interface_fileselector_selected_model_get(sd->fs);
@@ -579,37 +587,15 @@ _elm_fileselector_button_selected_set_internal(Evas_Object *obj, const char *_pa
return ret;
}
-static void
-_selected_model_then(void *data, Efl_Event const *event)
-{
- Eo* v = (Eo*)((Efl_Future_Event_Success*)event->info)->value;
- Efl_Promise *owner = data;
- efl_promise_value_set(owner, efl_ref(v), _model_free_eo_cb);
-}
-
-static void
-_selected_model_then_error(void *data, Efl_Event const* event)
-{
- Efl_Promise *owner = data;
- efl_promise_failed_set(owner, ((Efl_Future_Event_Failure*)event->info)->error);
-}
-
-EOLIAN static Efl_Future*
+EOLIAN static Eina_Bool
_elm_fileselector_button_elm_interface_fileselector_selected_model_set(Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd, Efl_Model *model)
{
- Efl_Promise* promise = efl_add(EFL_PROMISE_CLASS, obj);
if (sd->fs)
- {
- efl_future_then(elm_interface_fileselector_selected_model_set(sd->fs, model),
- _selected_model_then, _selected_model_then_error, NULL, promise);
- }
- else
- efl_promise_failed_set(promise, EINA_ERROR_FUTURE_CANCEL);
+ elm_interface_fileselector_selected_model_set(sd->fs, model);
- if (sd->fsd.selection)
- efl_unref(sd->fsd.selection);
- sd->fsd.selection = model ? efl_ref(model) : NULL;
- return efl_promise_future_get(promise);
+ efl_replace(&sd->fsd.selection, model);
+
+ return EINA_TRUE;
}
EOLIAN static void
@@ -628,7 +614,7 @@ _elm_fileselector_button_elm_interface_fileselector_thumbnail_size_set(Eo *obj E
}
EOLIAN static void
-_elm_fileselector_button_elm_interface_fileselector_thumbnail_size_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd, Evas_Coord *w, Evas_Coord *h)
+_elm_fileselector_button_elm_interface_fileselector_thumbnail_size_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd, Evas_Coord *w, Evas_Coord *h)
{
if (w) *w = sd->fsd.thumbnail_size.w;
if (h) *h = sd->fsd.thumbnail_size.h;
@@ -643,7 +629,7 @@ _elm_fileselector_button_elm_interface_fileselector_hidden_visible_set(Eo *obj E
}
EOLIAN static Eina_Bool
-_elm_fileselector_button_elm_interface_fileselector_hidden_visible_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd)
+_elm_fileselector_button_elm_interface_fileselector_hidden_visible_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd)
{
return sd->fsd.hidden_visible;
}
diff --git a/src/lib/elementary/elc_fileselector_entry.c b/src/lib/elementary/elc_fileselector_entry.c
index 8b0c4238b0..d2b3b380f2 100644
--- a/src/lib/elementary/elc_fileselector_entry.c
+++ b/src/lib/elementary/elc_fileselector_entry.c
@@ -3,9 +3,12 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
+#define ELM_INTERFACE_FILESELECTOR_BETA
+#define EFL_PART_PROTECTED
#include <Elementary.h>
+#include "Eio_Eo.h"
#include "elm_priv.h"
#include "elm_fileselector_button.eo.h"
#include "elm_fileselector_entry.eo.h"
@@ -66,53 +69,25 @@ SIG_FWD(UNPRESSED, EFL_UI_EVENT_UNPRESSED)
#undef SIG_FWD
static void
-_file_chosen_path_then(void *data, Efl_Event const* event)
+_FILE_CHOSEN_fwd(void *data, const Efl_Event *event)
{
- Eina_Array *args = data;
- const char *file = NULL;
- char *s;
- Eo *fs = eina_array_data_get(args, 0);
- Efl_Model *model = eina_array_data_get(args, 1);
-
- eina_array_free(args);
-
- eina_value_get((Eina_Value*)((Efl_Future_Event_Success*)event->info)->value, &file);
-
- if (!file) return;
+ Efl_Model *model = event->info;
+ Eo *fs = data;
+ Eina_Value *path;
+ char *file = NULL;
ELM_FILESELECTOR_ENTRY_DATA_GET(fs, sd);
- s = elm_entry_utf8_to_markup(file);
- elm_object_text_set(sd->entry, s);
- free(s);
+ efl_ui_view_model_set(sd->entry, model);
+ efl_ui_model_connect(sd->entry, "default", "path");
+
+ path = efl_model_property_get(model, "path");
+ file = eina_value_to_string(path);
_model_event_call
(fs, ELM_FILESELECTOR_ENTRY_EVENT_FILE_CHOSEN, model, file);
-}
-
-static void
-_file_chosen_path_then_error(void *data, Efl_Event const* event)
-{
- Eina_Error err = ((Efl_Future_Event_Failure*)event->info)->error;
- ERR("Efl.Model property \"path\" error: %s", eina_error_msg_get(err));
- eina_array_free(data);
-}
-
-static void
-_FILE_CHOSEN_fwd(void *data, const Efl_Event *event)
-{
- Efl_Model *model = event->info;
- Efl_Future *future = NULL;
- Eina_Array *args = NULL;
-
- if (!model) return;
- args = eina_array_new(2);
- eina_array_push(args, data);
- eina_array_push(args, model);
-
- future = efl_model_property_get(model, "path");
- efl_future_then
- (future, _file_chosen_path_then, _file_chosen_path_then_error, NULL, args);
+ eina_value_free(path);
+ free(file);
}
static void
@@ -126,7 +101,7 @@ _ACTIVATED_fwd(void *data, const Efl_Event *event)
file = elm_object_text_get(sd->entry);
- bmodel = elm_interface_fileselector_model_get(sd->button);
+ bmodel = efl_ui_view_model_get(sd->button);
if (bmodel)
{
model = efl_add(efl_class_get(bmodel), NULL);
@@ -134,19 +109,13 @@ _ACTIVATED_fwd(void *data, const Efl_Event *event)
eina_value_set(&path, file);
efl_model_property_set(model, "path", &path);
eina_value_flush(&path);
- elm_interface_fileselector_model_set(sd->button, model);
+ efl_ui_view_model_set(sd->button, model);
}
efl_event_callback_legacy_call
(data, ELM_FILESELECTOR_ENTRY_EVENT_ACTIVATED, event->info);
}
-static void
-_model_free_eo_cb(void *eo)
-{
- efl_unref(eo);
-}
-
EOLIAN static void
_elm_fileselector_entry_elm_layout_sizing_eval(Eo *obj, Elm_Fileselector_Entry_Data *sd EINA_UNUSED)
{
@@ -160,7 +129,7 @@ _elm_fileselector_entry_elm_layout_sizing_eval(Eo *obj, Elm_Fileselector_Entry_D
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_fileselector_entry_elm_widget_theme_apply(Eo *obj, Elm_Fileselector_Entry_Data *sd)
+_elm_fileselector_entry_efl_ui_widget_theme_apply(Eo *obj, Elm_Fileselector_Entry_Data *sd)
{
const char *style;
char buf[1024];
@@ -191,7 +160,7 @@ _elm_fileselector_entry_elm_widget_theme_apply(Eo *obj, Elm_Fileselector_Entry_D
}
EOLIAN static Eina_Bool
-_elm_fileselector_entry_elm_widget_on_disabled_update(Eo *obj, Elm_Fileselector_Entry_Data *sd, Eina_Bool disabled)
+_elm_fileselector_entry_efl_ui_widget_on_disabled_update(Eo *obj, Elm_Fileselector_Entry_Data *sd, Eina_Bool disabled)
{
if (!efl_ui_widget_on_disabled_update(efl_super(obj, MY_CLASS), disabled))
return EINA_FALSE;
@@ -205,7 +174,7 @@ _elm_fileselector_entry_elm_widget_on_disabled_update(Eo *obj, Elm_Fileselector_
static Eina_Bool
_elm_fileselector_entry_text_set(Eo *obj, Elm_Fileselector_Entry_Data *sd, const char *part, const char *label)
{
- if (part && strcmp(part, "default"))
+ if (part && strcmp(part, "elm.text"))
{
efl_text_set(efl_part(efl_super(obj, MY_CLASS), part), label);
}
@@ -217,7 +186,7 @@ _elm_fileselector_entry_text_set(Eo *obj, Elm_Fileselector_Entry_Data *sd, const
static const char *
_elm_fileselector_entry_text_get(Eo *obj, Elm_Fileselector_Entry_Data *sd, const char *part)
{
- if (part && strcmp(part, "default"))
+ if (part && strcmp(part, "elm.text"))
{
const char *text = NULL;
text = efl_text_get(efl_part(efl_super(obj, MY_CLASS), part));
@@ -338,7 +307,7 @@ _elm_fileselector_entry_efl_object_constructor(Eo *obj, Elm_Fileselector_Entry_D
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_GROUPING);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_GROUPING);
return obj;
}
@@ -358,16 +327,14 @@ _elm_fileselector_entry_selected_set_internal(Evas_Object *obj, const char *path
return EINA_TRUE;
}
-EOLIAN static Efl_Future*
+EOLIAN static Eina_Bool
_elm_fileselector_entry_elm_interface_fileselector_selected_model_set(Eo *obj EINA_UNUSED,
Elm_Fileselector_Entry_Data *sd,
Efl_Model *model)
{
- Efl_Promise* promise = efl_add(EFL_PROMISE_CLASS, obj);
- Efl_Future* future = efl_promise_future_get(promise);
- elm_interface_fileselector_model_set(sd->button, model);
- efl_promise_value_set(promise, efl_ref(model), _model_free_eo_cb);
- return future;
+ efl_ui_view_model_set(sd->button, model);
+
+ return EINA_TRUE;
}
EINA_DEPRECATED EAPI const char *
@@ -385,9 +352,9 @@ _elm_fileselector_entry_selected_get_internal(const Evas_Object *obj)
}
EOLIAN static Efl_Model *
-_elm_fileselector_entry_elm_interface_fileselector_selected_model_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd)
+_elm_fileselector_entry_elm_interface_fileselector_selected_model_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd)
{
- return elm_interface_fileselector_model_get(sd->button);
+ return efl_ui_view_model_get(sd->button);
}
EAPI void
@@ -448,34 +415,12 @@ _elm_fileselector_entry_path_set_internal(Evas_Object *obj, const char *path)
}
}
-static void
-_fs_entry_model_path_get_then(void *data, Efl_Event const *event)
-{
- Elm_Fileselector_Entry_Data *sd = data;
- char *path = NULL;
- char *s;
- Eina_Value* v = (Eina_Value*)((Efl_Future_Event_Success*)event->info)->value;
-
- if (!v)
- return;
-
- eina_value_get(v, &path);
- s = elm_entry_utf8_to_markup(path);
- if (s)
- {
- elm_object_text_set(sd->entry, s);
- free(s);
- }
-}
-
EOLIAN static void
-_elm_fileselector_entry_elm_interface_fileselector_model_set(Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd, Efl_Model *model)
+_elm_fileselector_entry_efl_ui_view_model_set(Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd, Efl_Model *model)
{
- Efl_Future *p = NULL;
- elm_interface_fileselector_model_set(sd->button, model);
-
- p = efl_model_property_get(model, "path");
- efl_future_then(p, _fs_entry_model_path_get_then, NULL, NULL, sd);
+ efl_ui_view_model_set(sd->button, model);
+ efl_ui_view_model_set(sd->entry, model);
+ efl_ui_model_connect(sd->entry, "default", "path");
}
EINA_DEPRECATED EAPI const char *
@@ -495,11 +440,11 @@ _elm_fileselector_entry_path_get_internal(const Evas_Object *obj)
}
EOLIAN static Efl_Model *
-_elm_fileselector_entry_elm_interface_fileselector_model_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd)
+_elm_fileselector_entry_efl_ui_view_model_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd)
{
Efl_Model *bmodel, *ret;
Eina_Value path;
- bmodel = elm_interface_fileselector_model_get(sd->button);
+ bmodel = efl_ui_view_model_get(sd->button);
if (!bmodel)
{
WRN("no base Efl.Model");
@@ -539,7 +484,7 @@ elm_fileselector_entry_expandable_get(const Evas_Object *obj)
}
EOLIAN static Eina_Bool
-_elm_fileselector_entry_elm_interface_fileselector_expandable_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd)
+_elm_fileselector_entry_elm_interface_fileselector_expandable_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd)
{
return elm_fileselector_expandable_get(sd->button);
}
@@ -566,7 +511,7 @@ elm_fileselector_entry_folder_only_get(const Evas_Object *obj)
}
EOLIAN static Eina_Bool
-_elm_fileselector_entry_elm_interface_fileselector_folder_only_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd)
+_elm_fileselector_entry_elm_interface_fileselector_folder_only_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd)
{
return elm_fileselector_folder_only_get(sd->button);
}
@@ -593,7 +538,7 @@ elm_fileselector_entry_is_save_get(const Evas_Object *obj)
}
EOLIAN static Eina_Bool
-_elm_fileselector_entry_elm_interface_fileselector_is_save_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd)
+_elm_fileselector_entry_elm_interface_fileselector_is_save_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd)
{
return elm_fileselector_is_save_get(sd->button);
}
diff --git a/src/lib/elementary/elc_hoversel.c b/src/lib/elementary/elc_hoversel.c
index 960458f70b..7c8efd4eb3 100644
--- a/src/lib/elementary/elc_hoversel.c
+++ b/src/lib/elementary/elc_hoversel.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define ELM_WIDGET_PROTECTED
#define ELM_WIDGET_ITEM_PROTECTED
@@ -13,6 +13,7 @@
#include "elm_hoversel.eo.h"
#include "elm_hoversel_item.eo.h"
#include "elm_widget_hoversel.h"
+#include "efl_ui_button_legacy.eo.h"
#define MY_CLASS ELM_HOVERSEL_CLASS
@@ -41,6 +42,7 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
static Eina_Bool _key_action_move(Evas_Object *obj, const char *params);
static Eina_Bool _key_action_activate(Evas_Object *obj, const char *params);
static Eina_Bool _key_action_escape(Evas_Object *obj, const char *params);
+static Eina_Bool _hoversel_efl_ui_widget_widget_event(Eo *obj, Elm_Hoversel_Data *_pd EINA_UNUSED, const Efl_Event *eo_event, Evas_Object *src EINA_UNUSED);
static const Elm_Action key_actions[] = {
{"move", _key_action_move},
@@ -62,7 +64,7 @@ _elm_hoversel_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Ho
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_hoversel_elm_widget_theme_apply(Eo *obj, Elm_Hoversel_Data *sd)
+_elm_hoversel_efl_ui_widget_theme_apply(Eo *obj, Elm_Hoversel_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Eina_List *l;
@@ -438,6 +440,15 @@ _access_state_cb(void *data EINA_UNUSED, Evas_Object *obj)
return NULL;
}
+
+static void
+_hover_key_down(void *data, const Efl_Event *ev)
+{
+ ELM_HOVERSEL_DATA_GET(ev->object, sd);
+
+ _hoversel_efl_ui_widget_widget_event(data, sd, ev, ev->object);
+}
+
static void
_activate(Evas_Object *obj)
{
@@ -459,6 +470,8 @@ _activate(Evas_Object *obj)
sd->expanded = EINA_TRUE;
sd->hover = elm_hover_add(sd->hover_parent);
+ efl_event_callback_add(sd->hover, EFL_EVENT_KEY_DOWN, _hover_key_down, obj);
+
elm_widget_sub_object_add(obj, sd->hover);
evas_object_layer_set(sd->hover, evas_object_layer_get(sd->hover_parent));
@@ -539,7 +552,7 @@ _elm_hoversel_item_elm_widget_item_part_text_set(Eo *eo_it EINA_UNUSED,
}
static const char *
-_elm_hoversel_item_elm_widget_item_part_text_get(Eo *eo_it EINA_UNUSED,
+_elm_hoversel_item_elm_widget_item_part_text_get(const Eo *eo_it EINA_UNUSED,
Elm_Hoversel_Item_Data *it,
const char *part)
{
@@ -565,14 +578,14 @@ _elm_hoversel_item_elm_widget_item_style_set(Eo *eo_it EINA_UNUSED,
}
EOLIAN static const char *
-_elm_hoversel_item_elm_widget_item_style_get(Eo *eo_it EINA_UNUSED,
+_elm_hoversel_item_elm_widget_item_style_get(const Eo *eo_it EINA_UNUSED,
Elm_Hoversel_Item_Data *it)
{
return elm_object_style_get(VIEW(it));
}
EOLIAN static void
-_elm_hoversel_item_elm_widget_item_focus_set(Eo *eo_it EINA_UNUSED,
+_elm_hoversel_item_elm_widget_item_item_focus_set(Eo *eo_it EINA_UNUSED,
Elm_Hoversel_Item_Data *it,
Eina_Bool focused)
{
@@ -580,7 +593,7 @@ _elm_hoversel_item_elm_widget_item_focus_set(Eo *eo_it EINA_UNUSED,
}
EOLIAN static Eina_Bool
-_elm_hoversel_item_elm_widget_item_focus_get(Eo *eo_it EINA_UNUSED,
+_elm_hoversel_item_elm_widget_item_item_focus_get(const Eo *eo_it EINA_UNUSED,
Elm_Hoversel_Item_Data *it)
{
return efl_ui_focus_object_focus_get(VIEW(it));
@@ -659,23 +672,23 @@ _elm_hoversel_efl_canvas_group_group_del(Eo *obj, Elm_Hoversel_Data *sd)
}
EOLIAN static void
-_elm_hoversel_efl_gfx_visible_set(Eo *obj, Elm_Hoversel_Data *sd, Eina_Bool vis)
+_elm_hoversel_efl_gfx_entity_visible_set(Eo *obj, Elm_Hoversel_Data *sd, Eina_Bool vis)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 0, vis))
return;
- efl_gfx_visible_set(efl_super(obj, MY_CLASS), vis);
- efl_gfx_visible_set(sd->hover, vis);
+ efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), vis);
+ efl_gfx_entity_visible_set(sd->hover, vis);
}
EOLIAN static void
-_elm_hoversel_elm_widget_widget_parent_set(Eo *obj, Elm_Hoversel_Data *_pd EINA_UNUSED, Evas_Object *parent)
+_elm_hoversel_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Hoversel_Data *_pd EINA_UNUSED, Evas_Object *parent)
{
elm_hoversel_hover_parent_set(obj, parent);
}
EOLIAN static Eina_Bool
-_elm_hoversel_efl_ui_autorepeat_autorepeat_supported_get(Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd EINA_UNUSED)
+_elm_hoversel_efl_ui_autorepeat_autorepeat_supported_get(const Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd EINA_UNUSED)
{
return EINA_FALSE;
}
@@ -693,7 +706,7 @@ _elm_hoversel_efl_object_constructor(Eo *obj, Elm_Hoversel_Data *_pd EINA_UNUSED
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_PUSH_BUTTON);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_PUSH_BUTTON);
return obj;
}
@@ -707,7 +720,7 @@ _elm_hoversel_efl_object_destructor(Eo *obj, Elm_Hoversel_Data *_pd EINA_UNUSED)
EFL_CALLBACKS_ARRAY_DEFINE(_on_parent,
{ EFL_EVENT_DEL, _on_parent_del },
- { EFL_GFX_EVENT_RESIZE, _on_parent_resize });
+ { EFL_GFX_ENTITY_EVENT_RESIZE, _on_parent_resize });
EOLIAN static void
_elm_hoversel_hover_parent_set(Eo *obj, Elm_Hoversel_Data *sd, Evas_Object *parent)
@@ -725,7 +738,7 @@ _elm_hoversel_hover_parent_set(Eo *obj, Elm_Hoversel_Data *sd, Evas_Object *pare
}
EOLIAN static Evas_Object*
-_elm_hoversel_hover_parent_get(Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd)
+_elm_hoversel_hover_parent_get(const Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd)
{
return sd->hover_parent;
}
@@ -755,7 +768,7 @@ _elm_hoversel_horizontal_set(Eo *obj, Elm_Hoversel_Data *sd, Eina_Bool horizonta
}
EOLIAN static Eina_Bool
-_elm_hoversel_horizontal_get(Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd)
+_elm_hoversel_horizontal_get(const Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd)
{
return sd->horizontal;
}
@@ -789,7 +802,7 @@ _elm_hoversel_hover_end(Eo *obj, Elm_Hoversel_Data *sd)
}
EOLIAN static Eina_Bool
-_elm_hoversel_expanded_get(Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd)
+_elm_hoversel_expanded_get(const Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd)
{
return (sd->hover) ? EINA_TRUE : EINA_FALSE;
}
@@ -802,12 +815,12 @@ _elm_hoversel_clear(Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd)
EINA_LIST_FOREACH_SAFE(sd->items, l, ll, it)
{
- elm_wdg_item_del(it);
+ efl_del(it);
}
}
EOLIAN static const Eina_List*
-_elm_hoversel_items_get(Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd)
+_elm_hoversel_items_get(const Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd)
{
return sd->items;
}
@@ -845,7 +858,8 @@ _elm_hoversel_item_add(Eo *obj, Elm_Hoversel_Data *sd, const char *label, const
snprintf(buf, sizeof(buf), "hoversel_vertical_entry/%s",
elm_widget_style_get(obj));
- VIEW(item) = bt = elm_button_add(obj);
+ bt = elm_button_add(obj);
+ VIEW_SET(item, bt);
efl_ui_mirrored_set(bt, efl_ui_mirrored_get(obj));
elm_object_style_set(bt, buf);
elm_object_text_set(bt, item->label);
@@ -885,7 +899,7 @@ _elm_hoversel_item_icon_set(Eo *eo_item EINA_UNUSED,
}
EOLIAN static void
-_elm_hoversel_item_icon_get(Eo *eo_item EINA_UNUSED,
+_elm_hoversel_item_icon_get(const Eo *eo_item EINA_UNUSED,
Elm_Hoversel_Item_Data *item,
const char **icon_file,
const char **icon_group,
@@ -1000,12 +1014,12 @@ _key_action_escape(Evas_Object *obj, const char *params EINA_UNUSED)
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(hoversel, Elm_Hoversel_Data)
EOLIAN static Eina_Bool
-_elm_hoversel_elm_widget_widget_event(Eo *obj, Elm_Hoversel_Data *sd, const Efl_Event *eo_event, Evas_Object *src)
+_elm_hoversel_efl_ui_widget_widget_event(Eo *obj, Elm_Hoversel_Data *sd, const Efl_Event *eo_event, Evas_Object *src)
{
if (efl_ui_widget_event(efl_super(obj, MY_CLASS), eo_event, src))
return EINA_TRUE; // note: this was FALSE but likely wrong
- return _hoversel_elm_widget_widget_event(obj, sd, eo_event, src);
+ return _hoversel_efl_ui_widget_widget_event(obj, sd, eo_event, src);
}
static void
@@ -1015,7 +1029,7 @@ _elm_hoversel_class_constructor(Efl_Class *klass)
}
EOLIAN const Efl_Access_Action_Data *
-_elm_hoversel_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Hoversel_Data *pd EINA_UNUSED)
+_elm_hoversel_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Elm_Hoversel_Data *pd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "activate", "activate", NULL, _key_action_activate},
@@ -1030,7 +1044,7 @@ _elm_hoversel_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_
}
EOLIAN Eina_List*
-_elm_hoversel_efl_access_children_get(Eo *obj EINA_UNUSED, Elm_Hoversel_Data *pd)
+_elm_hoversel_efl_access_object_access_children_get(const Eo *obj EINA_UNUSED, Elm_Hoversel_Data *pd)
{
return eina_list_clone(pd->items);
}
@@ -1042,7 +1056,7 @@ _elm_hoversel_auto_update_set(Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd, Eina_B
}
EOLIAN Eina_Bool
-_elm_hoversel_auto_update_get(Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd)
+_elm_hoversel_auto_update_get(const Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd)
{
return sd->auto_update;
}
diff --git a/src/lib/elementary/efl_ui_multibuttonentry.c b/src/lib/elementary/elc_multibuttonentry.c
index c5304f1246..193b3204f2 100644
--- a/src/lib/elementary/efl_ui_multibuttonentry.c
+++ b/src/lib/elementary/elc_multibuttonentry.c
@@ -2,22 +2,23 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define ELM_WIDGET_ITEM_PROTECTED
+//#define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define EFL_UI_TRANSLATABLE_PROTECTED
+#define EFL_PART_PROTECTED
#include <Elementary.h>
#include "elm_priv.h"
-#include "efl_ui_multibuttonentry_private.h"
-#include "efl_ui_multibuttonentry_part.eo.h"
+#include "elm_widget_multibuttonentry.h"
+#include "elm_multibuttonentry_part.eo.h"
#include "elm_entry.eo.h"
#include "elm_part_helper.h"
-#define MY_CLASS EFL_UI_MULTIBUTTONENTRY_CLASS
-#define MY_CLASS_PFX efl_ui_multibuttonentry
+#define MY_CLASS ELM_MULTIBUTTONENTRY_CLASS
-#define MY_CLASS_NAME "Efl.Ui.Multibuttonentry"
+#define MY_CLASS_NAME "Elm_Multibuttonentry"
#define MY_CLASS_NAME_LEGACY "elm_multibuttonentry"
#define MAX_STR 256
@@ -56,8 +57,8 @@ static const char PART_NAME_GUIDE_TEXT[] = "guidetext";
static const char PART_NAME_LABEL[] = "label";
static const char PART_NAME_CLOSED_BUTTON[] = "closedbutton";
-static Eina_Bool _efl_ui_multibuttonentry_smart_focus_next_enable = EINA_FALSE;
-static Eina_Bool _efl_ui_multibuttonentry_smart_focus_direction_enable = EINA_TRUE;
+static Eina_Bool _elm_multibuttonentry_smart_focus_next_enable = EINA_FALSE;
+static Eina_Bool _elm_multibuttonentry_smart_focus_direction_enable = EINA_TRUE;
static void _entry_changed_cb(void *data, const Efl_Event *event);
static void _entry_focus_changed_cb(void *data, const Efl_Event *event);
@@ -70,7 +71,7 @@ EFL_CALLBACKS_ARRAY_DEFINE(_multi_buttonentry_cb,
);
EOLIAN static void
-_efl_ui_multibuttonentry_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Efl_Ui_Multibuttonentry_Data *sd)
+_elm_multibuttonentry_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd)
{
Elm_Object_Item *it;
Eina_List *l;
@@ -91,7 +92,7 @@ _format_count(int count, void *data EINA_UNUSED)
}
EOLIAN static Efl_Ui_Theme_Apply
-_efl_ui_multibuttonentry_elm_widget_theme_apply(Eo *obj, Efl_Ui_Multibuttonentry_Data *sd)
+_elm_multibuttonentry_efl_ui_widget_theme_apply(Eo *obj, Elm_Multibuttonentry_Data *sd)
{
const char *str;
int hpad = 0, vpad = 0;
@@ -107,7 +108,7 @@ _efl_ui_multibuttonentry_elm_widget_theme_apply(Eo *obj, Efl_Ui_Multibuttonentry
if (str) hpad = atoi(str);
str = elm_layout_data_get(obj, "vertical_pad");
if (str) vpad = atoi(str);
- pad_scale = efl_gfx_scale_get(obj) * elm_config_scale_get()
+ pad_scale = efl_gfx_entity_scale_get(obj) * elm_config_scale_get()
/ edje_object_base_scale_get(elm_layout_edje_get(obj));
elm_box_padding_set(sd->box, (hpad * pad_scale), (vpad * pad_scale));
@@ -115,13 +116,20 @@ _efl_ui_multibuttonentry_elm_widget_theme_apply(Eo *obj, Efl_Ui_Multibuttonentry
{
ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
if (VIEW(item))
- if (!elm_widget_element_update(obj, VIEW(item), PART_NAME_BUTTON))
+ if (!elm_layout_theme_set(VIEW(item), "multibuttonentry",
+ PART_NAME_BUTTON, elm_widget_style_get(obj)))
CRI("Failed to set layout!");
}
- elm_widget_element_update(obj, sd->label, PART_NAME_LABEL);
- elm_widget_element_update(obj, sd->end, PART_NAME_CLOSED_BUTTON);
- elm_widget_element_update(obj, sd->guide_text, PART_NAME_GUIDE_TEXT);
+ elm_widget_theme_object_set
+ (obj, sd->label, "multibuttonentry", PART_NAME_LABEL,
+ elm_widget_style_get(obj));
+ elm_widget_theme_object_set
+ (obj, sd->end, "multibuttonentry", PART_NAME_CLOSED_BUTTON,
+ elm_widget_style_get(obj));
+ elm_widget_theme_object_set
+ (obj,sd->guide_text, "multibuttonentry", PART_NAME_GUIDE_TEXT,
+ elm_widget_style_get(obj));
elm_layout_sizing_eval(obj);
@@ -131,7 +139,7 @@ _efl_ui_multibuttonentry_elm_widget_theme_apply(Eo *obj, Efl_Ui_Multibuttonentry
static void
_visual_guide_text_set(Evas_Object *obj)
{
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
elm_box_unpack(sd->box, sd->guide_text);
elm_box_unpack(sd->box, sd->entry);
@@ -174,7 +182,7 @@ _shrink_mode_set(Evas_Object *obj,
Eina_List *l;
Elm_Object_Item *eo_item;
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
if (!sd->items) return;
if (sd->view_state == MULTIBUTTONENTRY_VIEW_ENTRY)
@@ -188,7 +196,6 @@ _shrink_mode_set(Evas_Object *obj,
{
Evas_Coord w = 0;
Evas_Coord box_inner_item_width_padding = 0;
- Eina_Value val;
elm_box_padding_get(sd->box, &box_inner_item_width_padding, NULL);
// unpack all items and entry
@@ -205,9 +212,7 @@ _shrink_mode_set(Evas_Object *obj,
if (sd->label && sd->label_packed)
{
elm_box_pack_end(sd->box, sd->label);
- Eina_Size2D label_min =
- efl_gfx_size_hint_combined_min_get(sd->label);
- w -= label_min.w;
+ w -= efl_gfx_size_hint_combined_min_get(sd->label).w;
w -= box_inner_item_width_padding;
}
@@ -217,28 +222,26 @@ _shrink_mode_set(Evas_Object *obj,
EINA_LIST_FOREACH(sd->items, l, eo_item)
{
Evas_Coord w_label_count = 0, h = 0;
+ char *buf;
ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
elm_box_pack_end(sd->box, VIEW(item));
evas_object_show(VIEW(item));
item->visible = EINA_TRUE;
- Eina_Size2D item_min =
- efl_gfx_size_hint_combined_min_get(VIEW(item));
-
- w -= item_min.w;
+ w -= efl_gfx_size_hint_combined_min_get(VIEW(item)).w;
w -= box_inner_item_width_padding;
count--;
- eina_value_setup(&val, EINA_VALUE_TYPE_INT);
-
if (count > 0)
{
- eina_strbuf_reset(sd->format_strbuf);
- eina_value_set(&val, count);
- sd->format_cb(sd->format_cb_data, sd->format_strbuf, val);
- edje_object_part_text_escaped_set(sd->end, "elm.text",
- eina_strbuf_string_get(sd->format_strbuf));
+ buf = sd->format_func(count, (void *)sd->format_func_data);
+ if (buf)
+ {
+ edje_object_part_text_escaped_set
+ (sd->end, "elm.text", buf);
+ free(buf);
+ }
edje_object_size_min_calc(sd->end, &w_label_count, NULL);
elm_coords_finger_size_adjust(1, &w_label_count, 1, NULL);
@@ -251,12 +254,13 @@ _shrink_mode_set(Evas_Object *obj,
item->visible = EINA_FALSE;
count++;
- eina_strbuf_reset(sd->format_strbuf);
-
- eina_value_set(&val, count);
- sd->format_cb(sd->format_cb_data, sd->format_strbuf, val);
- edje_object_part_text_escaped_set(sd->end, "elm.text",
- eina_strbuf_string_get(sd->format_strbuf));
+ buf = sd->format_func(count, (void *)sd->format_func_data);
+ if (buf)
+ {
+ edje_object_part_text_escaped_set
+ (sd->end, "elm.text", buf);
+ free(buf);
+ }
edje_object_size_min_calc(sd->end, &w_label_count, &h);
elm_coords_finger_size_adjust(1, &w_label_count, 1, &h);
@@ -273,10 +277,8 @@ _shrink_mode_set(Evas_Object *obj,
{
sd->view_state = MULTIBUTTONENTRY_VIEW_SHRINK;
efl_event_callback_legacy_call
- (obj, EFL_UI_MULTIBUTTONENTRY_EVENT_EXPAND_STATE_CHANGED, (void *)1);
+ (obj, ELM_MULTIBUTTONENTRY_EVENT_EXPAND_STATE_CHANGED, (void *)1);
}
-
- eina_value_flush(&val);
}
else
{
@@ -308,36 +310,36 @@ _shrink_mode_set(Evas_Object *obj,
{
sd->view_state = MULTIBUTTONENTRY_VIEW_NONE;
efl_event_callback_legacy_call
- (obj, EFL_UI_MULTIBUTTONENTRY_EVENT_EXPAND_STATE_CHANGED, (void *)(uintptr_t)sd->shrink);
+ (obj, ELM_MULTIBUTTONENTRY_EVENT_EXPAND_STATE_CHANGED, (void *)(uintptr_t)sd->shrink);
}
}
if (sd->view_state == MULTIBUTTONENTRY_VIEW_SHRINK)
- _efl_ui_multibuttonentry_smart_focus_direction_enable = EINA_FALSE;
+ _elm_multibuttonentry_smart_focus_direction_enable = EINA_FALSE;
else
- _efl_ui_multibuttonentry_smart_focus_direction_enable = EINA_TRUE;
+ _elm_multibuttonentry_smart_focus_direction_enable = EINA_TRUE;
if (sd->view_state != MULTIBUTTONENTRY_VIEW_SHRINK)
_visual_guide_text_set(obj);
}
static void
-_view_update(Efl_Ui_Multibuttonentry_Data *sd)
+_view_update(Elm_Multibuttonentry_Data *sd)
{
- Eina_Size2D min = { 1, 1 };
+ Evas_Coord width = 1, height = 1;
Evas_Object *obj = sd->parent;
if (sd->w_box <= 0) return;
// update label
if (sd->label)
- min = efl_gfx_size_hint_combined_min_get(sd->label);
+ evas_object_size_hint_combined_min_get(sd->label, &width, &height);
if (sd->guide_text)
{
- Evas_Coord guide_text_width = sd->w_box - min.w;
+ Evas_Coord guide_text_width = sd->w_box - width;
- evas_object_size_hint_min_set(sd->guide_text, guide_text_width, min.h);
+ evas_object_size_hint_min_set(sd->guide_text, guide_text_width, height);
}
// update buttons in shrink mode
@@ -353,13 +355,13 @@ _item_del(Elm_Multibuttonentry_Item_Data *item)
{
Evas_Object *obj = WIDGET(item);
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
sd->items = eina_list_remove(sd->items, EO_OBJ(item));
elm_box_unpack(sd->box, VIEW(item));
efl_event_callback_legacy_call
- (obj, EFL_UI_MULTIBUTTONENTRY_EVENT_ITEM_DELETED, EO_OBJ(item));
+ (obj, ELM_MULTIBUTTONENTRY_EVENT_ITEM_DELETED, EO_OBJ(item));
if (sd->selected_it == item)
sd->selected_it = NULL;
@@ -380,7 +382,7 @@ _current_item_state_change(Evas_Object *obj,
{
Elm_Multibuttonentry_Item_Data *item;
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
item = sd->selected_it;
@@ -391,7 +393,7 @@ _current_item_state_change(Evas_Object *obj,
case MULTIBUTTONENTRY_BUTTON_STATE_SELECTED:
elm_layout_signal_emit(VIEW(item), "elm,state,focused", "elm");
efl_event_callback_legacy_call
- (obj, EFL_UI_MULTIBUTTONENTRY_EVENT_ITEM_SELECTED, EO_OBJ(item));
+ (obj, ELM_MULTIBUTTONENTRY_EVENT_ITEM_SELECTED, EO_OBJ(item));
break;
case MULTIBUTTONENTRY_BUTTON_STATE_DEFAULT:
default:
@@ -408,7 +410,7 @@ _current_item_change(Evas_Object *obj,
Eina_List *l;
Elm_Object_Item *eo_temp_it;
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_it, it);
// change the state of previous item to "default"
@@ -431,7 +433,7 @@ static void
_item_select(Evas_Object *obj,
Elm_Multibuttonentry_Item_Data *it)
{
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
if (it)
{
@@ -447,19 +449,22 @@ _item_select(Evas_Object *obj,
// ACCESS
if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF)
{
- Evas_Object *ao, *po;
+ Evas_Object *ao, *po, *o;
Eina_Strbuf *buf;
const char *part;
part = "elm.btn.text";
- po = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(VIEW(it)), part);
+ o = elm_layout_edje_get(VIEW(it));
+ edje_object_freeze(o);
+ po = (Evas_Object *)edje_object_part_object_get(o, part);
+ edje_object_thaw(o);
ao = evas_object_data_get(po, "_part_access_obj");
_elm_access_highlight_set(ao);
buf = eina_strbuf_new();
eina_strbuf_append_printf(buf,
"multi button entry item %s is selected",
- edje_object_part_text_get(elm_layout_edje_get(VIEW(it)), part));
+ edje_object_part_text_get(o, part));
_elm_access_say(eina_strbuf_string_get(buf));
eina_strbuf_free(buf);
@@ -484,7 +489,7 @@ _on_item_clicked(void *data,
Elm_Object_Item *eo_it = data;
ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_it, it);
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(WIDGET(it), sd);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(WIDGET(it), sd);
_item_select(WIDGET(it), it);
@@ -495,7 +500,7 @@ _on_item_clicked(void *data,
if (sd->selected_it)
efl_event_callback_legacy_call
- (WIDGET(it), EFL_UI_MULTIBUTTONENTRY_EVENT_ITEM_CLICKED, eo_it);
+ (WIDGET(it), ELM_MULTIBUTTONENTRY_EVENT_ITEM_CLICKED, eo_it);
}
static void
@@ -509,14 +514,14 @@ _on_item_deleted(void *data,
Elm_Object_Item *eo_temp_it;
ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_it, it);
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(WIDGET(it), sd);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(WIDGET(it), sd);
// change the current
EINA_LIST_FOREACH(sd->items, l, eo_temp_it)
{
ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_temp_it, temp_it);
if (VIEW(temp_it) == obj)
{
- elm_wdg_item_del(eo_temp_it);
+ elm_object_item_del(eo_temp_it);
break;
}
}
@@ -530,7 +535,7 @@ _on_item_focused(void *data,
Elm_Multibuttonentry_Item_Data *it = data;
if (!it) return;
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(WIDGET(it), sd);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(WIDGET(it), sd);
sd->focused_it = it;
}
@@ -543,7 +548,7 @@ _on_item_unfocused(void *data,
Elm_Multibuttonentry_Item_Data *it = data;
if (!it) return;
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(WIDGET(it), sd);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(WIDGET(it), sd);
sd->focused_it = NULL;
}
@@ -553,12 +558,12 @@ _long_press_cb(void *data)
{
Elm_Multibuttonentry_Item_Data *it = data;
- EFL_UI_MULTIBUTTONENTRY_DATA_GET(WIDGET(it), sd);
+ ELM_MULTIBUTTONENTRY_DATA_GET(WIDGET(it), sd);
sd->longpress_timer = NULL;
efl_event_callback_legacy_call
- (WIDGET(it), EFL_UI_MULTIBUTTONENTRY_EVENT_ITEM_LONGPRESSED, EO_OBJ(it));
+ (WIDGET(it), ELM_MULTIBUTTONENTRY_EVENT_ITEM_LONGPRESSED, EO_OBJ(it));
return ECORE_CALLBACK_CANCEL;
}
@@ -572,7 +577,7 @@ _mouse_down_cb(void *data,
Elm_Multibuttonentry_Item_Data *it = data;
Evas_Event_Mouse_Down *ev = event_info;
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(WIDGET(it), sd);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(WIDGET(it), sd);
if (ev->button != 1) return;
@@ -589,7 +594,7 @@ _mouse_up_cb(void *data,
{
Elm_Multibuttonentry_Item_Data *it = data;
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(WIDGET(it), sd);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(WIDGET(it), sd);
ELM_SAFE_FREE(sd->longpress_timer, ecore_timer_del);
}
@@ -611,7 +616,7 @@ _elm_multibuttonentry_item_elm_widget_item_part_text_set(Eo *eo_item EINA_UNUSED
{
const char *dest_part = NULL;
Evas_Coord minw = -1, minh = -1, boxw;
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(WIDGET(item), sd);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(WIDGET(item), sd);
if (!part || !strcmp(part, "elm.text"))
dest_part = "elm.btn.text";
@@ -634,7 +639,7 @@ _elm_multibuttonentry_item_elm_widget_item_part_text_set(Eo *eo_item EINA_UNUSED
}
EOLIAN static const char *
-_elm_multibuttonentry_item_elm_widget_item_part_text_get(Eo *eo_item EINA_UNUSED,
+_elm_multibuttonentry_item_elm_widget_item_part_text_get(const Eo *eo_item EINA_UNUSED,
Elm_Multibuttonentry_Item_Data *item,
const char *part)
{
@@ -662,10 +667,12 @@ _elm_multibuttonentry_item_efl_object_destructor(Eo *eo_it,
static void
_access_multibuttonentry_label_register(Evas_Object *obj, Eina_Bool is_access)
{
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
Evas_Object *po;
+ edje_object_freeze(sd->label);
po = (Evas_Object *)edje_object_part_object_get(sd->label, "elm.text");
+ edje_object_thaw(sd->label);
if (is_access)
{
Evas_Object *ao;
@@ -716,7 +723,7 @@ _elm_multibuttonentry_item_efl_object_constructor(Eo *eo_item, Elm_Multibuttonen
}
static Elm_Object_Item *
-_item_new(Efl_Ui_Multibuttonentry_Data *sd,
+_item_new(Elm_Multibuttonentry_Data *sd,
const char *str,
Multibuttonentry_Pos pos,
Elm_Object_Item *efl_reference,
@@ -730,8 +737,7 @@ _item_new(Efl_Ui_Multibuttonentry_Data *sd,
efl_data_scope_get(efl_reference, ELM_MULTIBUTTONENTRY_ITEM_CLASS):
NULL;
Evas_Object *obj;
- Eina_Size2D min;
- Evas_Coord boxw;
+ int minw, minh, boxw;
obj = sd->parent;
@@ -748,20 +754,21 @@ _item_new(Efl_Ui_Multibuttonentry_Data *sd,
return NULL;
WIDGET_ITEM_DATA_SET(eo_item, data);
- efl_access_role_set(eo_item, EFL_ACCESS_ROLE_RADIO_BUTTON);
+ efl_access_object_role_set(eo_item, EFL_ACCESS_ROLE_RADIO_BUTTON);
ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
- VIEW(item) = elm_layout_add(obj);
+ VIEW_SET(item, elm_layout_add(obj));
- efl_access_type_set(VIEW(item), EFL_ACCESS_TYPE_DISABLED);
+ efl_access_object_access_type_set(VIEW(item), EFL_ACCESS_TYPE_DISABLED);
- if (!elm_widget_element_update(obj, VIEW(item), PART_NAME_BUTTON))
+ if (!elm_layout_theme_set(VIEW(item), "multibuttonentry", PART_NAME_BUTTON,
+ elm_widget_style_get(obj)))
CRI("Failed to set layout!");
elm_object_part_text_set(VIEW(item), "elm.btn.text", str);
//entry is cleared when text is made to button
- efl_text_set(sd->entry, "");
+ elm_object_text_set(sd->entry, "");
elm_layout_signal_callback_add
(VIEW(item), "mouse,clicked,1", "*", _on_item_clicked, EO_OBJ(item));
@@ -781,14 +788,14 @@ _item_new(Efl_Ui_Multibuttonentry_Data *sd,
evas_object_show(VIEW(item));
evas_object_smart_calculate(VIEW(item));
- min = efl_gfx_size_hint_combined_min_get(VIEW(item));
+ evas_object_size_hint_combined_min_get(VIEW(item), &minw, &minh);
evas_object_geometry_get(sd->box, NULL, NULL, &boxw, NULL);
- if (sd->w_box && min.w > boxw)
+ if (sd->w_box && minw > boxw)
{
- elm_coords_finger_size_adjust(1, &boxw, 1, &min.h);
- evas_object_size_hint_min_set(VIEW(item), boxw, min.h);
- evas_object_resize(VIEW(item), boxw, min.h);
+ elm_coords_finger_size_adjust(1, &boxw, 1, &minh);
+ evas_object_size_hint_min_set(VIEW(item), boxw, minh);
+ evas_object_resize(VIEW(item), boxw, minh);
}
elm_object_focus_allow_set(VIEW(item), EINA_TRUE);
@@ -917,7 +924,7 @@ _item_new(Efl_Ui_Multibuttonentry_Data *sd,
efl_event_callback_legacy_call
- (obj, EFL_UI_MULTIBUTTONENTRY_EVENT_ITEM_ADDED, eo_item);
+ (obj, ELM_MULTIBUTTONENTRY_EVENT_ITEM_ADDED, eo_item);
if (_elm_config->atspi_mode)
{
@@ -931,7 +938,7 @@ _item_new(Efl_Ui_Multibuttonentry_Data *sd,
//FIXME: having an empty event handling function and reacting on Evas
//events on specific objects is crazy, someone should fix that.
EOLIAN static Eina_Bool
-_efl_ui_multibuttonentry_elm_widget_widget_event(Eo *obj EINA_UNUSED, Efl_Ui_Multibuttonentry_Data *sd EINA_UNUSED, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *src EINA_UNUSED)
+_elm_multibuttonentry_efl_ui_widget_widget_event(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd EINA_UNUSED, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *src EINA_UNUSED)
{
// ACCESS
if (_elm_config->access_mode == ELM_ACCESS_MODE_ON) return EINA_FALSE;
@@ -941,7 +948,7 @@ _efl_ui_multibuttonentry_elm_widget_widget_event(Eo *obj EINA_UNUSED, Efl_Ui_Mul
}
EOLIAN static void
-_efl_ui_multibuttonentry_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Multibuttonentry_Data *sd EINA_UNUSED)
+_elm_multibuttonentry_elm_layout_sizing_eval(Eo *obj, Elm_Multibuttonentry_Data *sd EINA_UNUSED)
{
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
@@ -961,9 +968,9 @@ _mouse_clicked_signal_cb(void *data EINA_UNUSED,
const char *emission EINA_UNUSED,
const char *source EINA_UNUSED)
{
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
- if (sd->editable) efl_ui_text_input_panel_show(sd->entry);
+ if (sd->editable) elm_entry_input_panel_show(sd->entry);
efl_event_callback_legacy_call(obj, EFL_UI_EVENT_CLICKED, NULL);
}
@@ -974,13 +981,12 @@ _box_resize_cb(void *data,
Evas_Object *obj EINA_UNUSED,
void *event EINA_UNUSED)
{
- Evas_Coord w, h;
- Eina_Size2D min;
+ Evas_Coord w, h, mnw, mnh;
Eina_List *l;
Elm_Object_Item *eo_it;
int hpad;
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd);
evas_object_geometry_get(sd->box, NULL, NULL, &w, &h);
if ((w <= elm_config_finger_size_get()) || (h <= elm_config_finger_size_get())) return;
@@ -989,10 +995,10 @@ _box_resize_cb(void *data,
if (sd->h_box < h)
efl_event_callback_legacy_call
- (sd->parent, EFL_UI_MULTIBUTTONENTRY_EVENT_EXPANDED, NULL);
+ (sd->parent, ELM_MULTIBUTTONENTRY_EVENT_EXPANDED, NULL);
else if (sd->h_box > h)
efl_event_callback_legacy_call
- (sd->parent, EFL_UI_MULTIBUTTONENTRY_EVENT_CONTRACTED, NULL);
+ (sd->parent, ELM_MULTIBUTTONENTRY_EVENT_CONTRACTED, NULL);
if (sd->items && sd->w_box != w)
{
@@ -1003,13 +1009,13 @@ _box_resize_cb(void *data,
elm_layout_sizing_eval(VIEW(it));
evas_object_smart_calculate(VIEW(it));
- min = efl_gfx_size_hint_combined_min_get(VIEW(it));
+ evas_object_size_hint_combined_min_get(VIEW(it), &mnw, &mnh);
- if (min.w > w - hpad)
+ if (mnw > w - hpad)
{
- min.w = w - hpad;
- evas_object_size_hint_min_set(VIEW(it), min.w, min.h);
- evas_object_resize(VIEW(it), min.w, min.h);
+ mnw = w - hpad;
+ evas_object_size_hint_min_set(VIEW(it), mnw, mnh);
+ evas_object_resize(VIEW(it), mnw, mnh);
}
}
}
@@ -1027,26 +1033,26 @@ _entry_resize_cb(void *data,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd);
if (elm_object_focus_get(sd->parent))
- elm_widget_show_region_set(sd->entry, efl_gfx_geometry_get(sd->entry), EINA_TRUE);
+ elm_widget_show_region_set(sd->entry, efl_gfx_entity_geometry_get(sd->entry), EINA_TRUE);
}
static void
_entry_changed_cb(void *data, const Efl_Event *event EINA_UNUSED)
{
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd);
const char *str;
- str = efl_text_get(sd->entry);
+ str = elm_object_text_get(sd->entry);
sd->n_str = str ? strlen(str) : 0;
}
static void
_entry_focus_changed_cb(void *data, const Efl_Event *event)
{
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd);
if (elm_object_focus_get(event->object))
{
@@ -1063,7 +1069,7 @@ _entry_focus_changed_cb(void *data, const Efl_Event *event)
{
const char *str;
- str = efl_text_get(sd->entry);
+ str = elm_object_text_get(sd->entry);
if (str && str[0])
_item_new(sd, str, MULTIBUTTONENTRY_POS_END, NULL, NULL, NULL);
}
@@ -1072,7 +1078,7 @@ _entry_focus_changed_cb(void *data, const Efl_Event *event)
static void
_entry_clicked_cb(void *data, const Efl_Event *event EINA_UNUSED)
{
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd);
_current_item_state_change(sd->parent, MULTIBUTTONENTRY_BUTTON_STATE_DEFAULT);
elm_object_focus_set(sd->entry, EINA_TRUE);
@@ -1084,7 +1090,7 @@ _layout_key_down_cb(void *data,
Evas_Object *obj EINA_UNUSED,
void *event_info)
{
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd);
Evas_Event_Key_Up *ev = (Evas_Event_Key_Up *)event_info;
if (!sd->box) return;
@@ -1098,7 +1104,7 @@ _layout_key_down_cb(void *data,
Elm_Multibuttonentry_Item_Data *item = sd->selected_it;
if (item && sd->editable)
{
- elm_wdg_item_del(EO_OBJ(item));
+ elm_object_item_del(EO_OBJ(item));
elm_object_focus_set(sd->entry, EINA_TRUE);
}
}
@@ -1132,7 +1138,7 @@ _entry_key_down_cb(void *data,
Evas_Object *obj EINA_UNUSED,
void *event_info)
{
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd);
Evas_Event_Key_Down *ev = (Evas_Event_Key_Down *)event_info;
if (sd->n_str == 1 &&
@@ -1146,13 +1152,13 @@ _entry_key_up_cb(void *data,
Evas_Object *obj EINA_UNUSED,
void *event_info)
{
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd);
Evas_Event_Key_Up *ev = (Evas_Event_Key_Up *)event_info;
const char *str;
if (!sd->box) return;
- str = efl_text_get(sd->entry);
+ str = elm_object_text_get(sd->entry);
if (!str) return;
if (strlen(str) &&
@@ -1166,7 +1172,7 @@ _entry_key_up_cb(void *data,
static void
_callbacks_register(Evas_Object *obj)
{
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
elm_layout_signal_callback_add
@@ -1194,7 +1200,7 @@ _label_set(Evas_Object *obj,
{
Evas_Coord width, height;
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
if (!str) return;
@@ -1226,7 +1232,7 @@ static void
_guide_text_set(Evas_Object *obj,
const char *str)
{
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
if (!str) return;
@@ -1236,7 +1242,9 @@ _guide_text_set(Evas_Object *obj,
if (sd->guide_text)
{
- elm_widget_element_update(obj, sd->guide_text, PART_NAME_GUIDE_TEXT);
+ elm_widget_theme_object_set(obj, sd->guide_text, "multibuttonentry",
+ PART_NAME_GUIDE_TEXT,
+ elm_widget_style_get(obj));
evas_object_size_hint_weight_set
(sd->guide_text, 0.0, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set
@@ -1272,38 +1280,36 @@ _box_min_size_calculate(Evas_Object *box,
int *line_height,
void *data EINA_UNUSED)
{
- Evas_Coord w, linew = 0, lineh = 0;
- Eina_Size2D box_min;
- Eina_Size2D min;
+ Evas_Coord mnw, mnh, w, minw, minh = 0, linew = 0, lineh = 0;
int line_num;
Eina_List *l;
Evas_Object_Box_Option *opt;
evas_object_geometry_get(box, NULL, NULL, &w, NULL);
- box_min = efl_gfx_size_hint_combined_min_get(box);
+ evas_object_size_hint_combined_min_get(box, &minw, NULL);
if (!w) return EINA_FALSE;
line_num = 1;
EINA_LIST_FOREACH(priv->children, l, opt)
{
- min = efl_gfx_size_hint_combined_min_get(opt->obj);
+ evas_object_size_hint_combined_min_get(opt->obj, &mnw, &mnh);
- linew += min.w;
- if (lineh < min.h) lineh = min.h;
+ linew += mnw;
+ if (lineh < mnh) lineh = mnh;
if (linew > w)
{
- linew = min.w;
+ linew = mnw;
line_num++;
}
if ((linew != 0) && (l != eina_list_last(priv->children)))
linew += priv->pad.h;
}
- box_min.h = lineh * line_num + (line_num - 1) * priv->pad.v;
+ minh = lineh * line_num + (line_num - 1) * priv->pad.v;
- evas_object_size_hint_min_set(box, box_min.w, box_min.h);
+ evas_object_size_hint_min_set(box, minw, minh);
*line_height = lineh;
return EINA_TRUE;
@@ -1315,8 +1321,7 @@ _box_layout_cb(Evas_Object *o,
void *data)
{
Evas_Coord x, y, w, h, xx, yy;
- Evas_Coord linew = 0, lineh = 0;
- Eina_Size2D min;
+ Evas_Coord minw, minh, linew = 0, lineh = 0;
Evas_Object_Box_Option *opt;
const Eina_List *l, *l_next;
Evas_Object *obj;
@@ -1327,21 +1332,21 @@ _box_layout_cb(Evas_Object *o,
evas_object_geometry_get(o, &x, &y, &w, &h);
- min = efl_gfx_size_hint_combined_min_get(o);
+ evas_object_size_hint_combined_min_get(o, &minw, &minh);
evas_object_size_hint_align_get(o, &ax, &ay);
rtl = efl_ui_mirrored_get(data);
if (rtl) ax = 1.0 - ax;
- if (w < min.w)
+ if (w < minw)
{
- x = x + ((w - min.w) * (1.0 - ax));
- w = min.w;
+ x = x + ((w - minw) * (1.0 - ax));
+ w = minw;
}
- if (h < min.h)
+ if (h < minh)
{
- y = y + ((h - min.h) * (1.0 - ay));
- h = min.h;
+ y = y + ((h - minh) * (1.0 - ay));
+ h = minh;
}
xx = x;
@@ -1349,7 +1354,7 @@ _box_layout_cb(Evas_Object *o,
EINA_LIST_FOREACH_SAFE(priv->children, l, l_next, opt)
{
- Eina_Size2D obj_min;
+ Evas_Coord mnw, mnh;
Evas_Coord ww, hh, ow, oh;
double wx, wy;
int fw, fh;
@@ -1357,14 +1362,14 @@ _box_layout_cb(Evas_Object *o,
obj = opt->obj;
evas_object_size_hint_align_get(obj, &ax, &ay);
evas_object_size_hint_weight_get(obj, &wx, &wy);
- obj_min = efl_gfx_size_hint_combined_min_get(obj);
+ evas_object_size_hint_combined_min_get(obj, &mnw, &mnh);
fw = fh = EINA_FALSE;
if (EINA_DBL_EQ(ax, -1)) {fw = 1; ax = 0.5; }
if (EINA_DBL_EQ(ay, -1)) {fh = 1; ay = 0.5; }
if (rtl) ax = 1.0 - ax;
- ww = obj_min.w;
+ ww = mnw;
if (!EINA_DBL_EQ(wx, 0))
{
if (ww <= w - linew) ww = w - linew;
@@ -1372,9 +1377,9 @@ _box_layout_cb(Evas_Object *o,
}
hh = lineh;
- ow = obj_min.w;
+ ow = mnw;
if (fw) ow = ww;
- oh = obj_min.h;
+ oh = mnh;
if (fh) oh = hh;
linew += ww;
@@ -1412,7 +1417,7 @@ _box_layout_cb(Evas_Object *o,
}
static void
-_view_init(Evas_Object *obj, Efl_Ui_Multibuttonentry_Data *sd)
+_view_init(Evas_Object *obj, Elm_Multibuttonentry_Data *sd)
{
const char *str;
double pad_scale;
@@ -1426,36 +1431,37 @@ _view_init(Evas_Object *obj, Efl_Ui_Multibuttonentry_Data *sd)
if (str) hpad = atoi(str);
str = elm_layout_data_get(obj, "vertical_pad");
if (str) vpad = atoi(str);
- pad_scale = efl_gfx_scale_get(obj) * elm_config_scale_get()
+ pad_scale = efl_gfx_entity_scale_get(obj) * elm_config_scale_get()
/ edje_object_base_scale_get(elm_layout_edje_get(obj));
elm_box_padding_set(sd->box, (hpad * pad_scale), (vpad * pad_scale));
elm_box_layout_set(sd->box, _box_layout_cb, obj, NULL);
elm_box_homogeneous_set(sd->box, EINA_FALSE);
- elm_layout_content_set(obj, "box.swallow", sd->box);
+ if (!elm_layout_content_set(obj, "elm.swallow.box", sd->box))
+ elm_layout_content_set(obj, "box.swallow", sd->box);
sd->label = edje_object_add(evas_object_evas_get(obj));
if (!sd->label) return;
- elm_widget_element_update(obj, sd->label, PART_NAME_LABEL);
+ elm_widget_theme_object_set
+ (obj, sd->label, "multibuttonentry", PART_NAME_LABEL,
+ elm_widget_style_get(obj));
// ACCESS
if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
_access_multibuttonentry_label_register(obj, EINA_TRUE);
- sd->entry = efl_add(EFL_UI_TEXT_CLASS, sd->box,
- efl_text_multiline_set(efl_added, EINA_FALSE),
- efl_text_set(efl_added, ""),
- efl_ui_text_cnp_mode_set(efl_added, EINA_FALSE),
- efl_ui_text_input_panel_enabled_set(efl_added, EINA_FALSE),
- efl_ui_text_interactive_editable_set(efl_added, EINA_TRUE),
- efl_composite_attach(obj, efl_added));
-
+ sd->entry = elm_entry_add(obj);
+ if (!sd->entry) return;
+ elm_entry_single_line_set(sd->entry, EINA_TRUE);
+ elm_entry_cnp_mode_set(sd->entry, ELM_CNP_MODE_PLAINTEXT);
+ elm_object_text_set(sd->entry, "");
+ elm_entry_input_panel_enabled_set(sd->entry, EINA_FALSE);
evas_object_size_hint_min_set(sd->entry, MIN_W_ENTRY, 0);
evas_object_size_hint_weight_set
(sd->entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(sd->entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
-
elm_box_pack_end(sd->box, sd->entry);
+ evas_object_show(sd->entry);
sd->view_state = MULTIBUTTONENTRY_VIEW_ENTRY;
@@ -1464,7 +1470,9 @@ _view_init(Evas_Object *obj, Efl_Ui_Multibuttonentry_Data *sd)
sd->end = edje_object_add(evas_object_evas_get(obj));
if (!sd->end) return;
- elm_widget_element_update(obj, sd->end, PART_NAME_CLOSED_BUTTON);
+ elm_widget_theme_object_set
+ (obj, sd->end, "multibuttonentry", PART_NAME_CLOSED_BUTTON,
+ elm_widget_style_get(obj));
edje_object_size_min_calc(sd->end, &button_min_width, &button_min_height);
elm_coords_finger_size_adjust(1, &button_min_width, 1, &button_min_height);
@@ -1474,9 +1482,9 @@ _view_init(Evas_Object *obj, Efl_Ui_Multibuttonentry_Data *sd)
}
static void
-_efl_ui_multibuttonentry_text_set(Eo *obj, Efl_Ui_Multibuttonentry_Data *sd EINA_UNUSED, const char *part, const char *label)
+_elm_multibuttonentry_text_set(Eo *obj, Elm_Multibuttonentry_Data *sd EINA_UNUSED, const char *part, const char *label)
{
- if (!part || !strcmp(part, "default") || !strcmp(part, "elm.text"))
+ if (!part || !strcmp(part, "elm.text"))
{
if (label) _label_set(obj, label);
}
@@ -1485,15 +1493,15 @@ _efl_ui_multibuttonentry_text_set(Eo *obj, Efl_Ui_Multibuttonentry_Data *sd EINA
if (label) _guide_text_set(obj, label);
}
else
- efl_text_set(efl_part(efl_super(obj, MY_CLASS), part), label);
+ elm_object_part_text_set(obj, part, label);
}
-static const char*
-_efl_ui_multibuttonentry_text_get(Eo *obj, Efl_Ui_Multibuttonentry_Data *sd, const char *part)
+EOLIAN static const char*
+_elm_multibuttonentry_text_get(Eo *obj, Elm_Multibuttonentry_Data *sd, const char *part)
{
const char *text = NULL;
- if (!part || !strcmp(part, "default"))
+ if (!part || !strcmp(part, "elm.text"))
{
text = sd->label_str;
}
@@ -1502,7 +1510,7 @@ _efl_ui_multibuttonentry_text_get(Eo *obj, Efl_Ui_Multibuttonentry_Data *sd, con
text = sd->guide_text_str;
}
else
- text = efl_text_get(efl_part(efl_super(obj, MY_CLASS), part));
+ text = elm_object_part_text_get(obj, part);
return text;
}
@@ -1515,7 +1523,7 @@ _access_info_cb(void *data EINA_UNUSED, Evas_Object *obj)
Eina_List *l = NULL;
Elm_Object_Item *eo_item;
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
if (sd->view_state == MULTIBUTTONENTRY_VIEW_GUIDETEXT)
{
@@ -1547,7 +1555,7 @@ _access_info_cb(void *data EINA_UNUSED, Evas_Object *obj)
}
EOLIAN static void
-_efl_ui_multibuttonentry_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Multibuttonentry_Data *priv)
+_elm_multibuttonentry_efl_canvas_group_group_add(Eo *obj, Elm_Multibuttonentry_Data *priv)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
@@ -1567,8 +1575,7 @@ _efl_ui_multibuttonentry_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Multibuttone
priv->last_it_select = EINA_TRUE;
priv->editable = EINA_TRUE;
priv->parent = obj;
-
- efl_ui_format_string_set(obj, "+%d");
+ priv->format_func = _format_count;
_view_init(obj, priv);
_callbacks_register(obj);
@@ -1582,7 +1589,7 @@ _efl_ui_multibuttonentry_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Multibuttone
}
EOLIAN static void
-_efl_ui_multibuttonentry_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Multibuttonentry_Data *sd)
+_elm_multibuttonentry_efl_canvas_group_group_del(Eo *obj, Elm_Multibuttonentry_Data *sd)
{
Eina_List *l;
Elm_Object_Item *eo_item;
@@ -1604,9 +1611,6 @@ _efl_ui_multibuttonentry_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Multibuttone
evas_object_del(sd->end);
ecore_timer_del(sd->longpress_timer);
- efl_ui_format_cb_set(obj, NULL, NULL, NULL);
- eina_strbuf_free(sd->format_strbuf);
-
EINA_LIST_FREE(sd->filter_list, _item_filter)
_filter_free(_item_filter);
@@ -1619,7 +1623,7 @@ _access_obj_process(Evas_Object *obj, Eina_Bool is_access)
Eina_List *l;
Elm_Object_Item *it;
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
/* label */
_access_multibuttonentry_label_register(obj, is_access);
@@ -1630,10 +1634,10 @@ _access_obj_process(Evas_Object *obj, Eina_Bool is_access)
}
EOLIAN static void
-_efl_ui_multibuttonentry_elm_widget_on_access_update(Eo *obj, Efl_Ui_Multibuttonentry_Data *sd EINA_UNUSED, Eina_Bool acs)
+_elm_multibuttonentry_efl_ui_widget_on_access_update(Eo *obj, Elm_Multibuttonentry_Data *sd EINA_UNUSED, Eina_Bool acs)
{
- _efl_ui_multibuttonentry_smart_focus_next_enable = acs;
- _access_obj_process(obj, _efl_ui_multibuttonentry_smart_focus_next_enable);
+ _elm_multibuttonentry_smart_focus_next_enable = acs;
+ _access_obj_process(obj, _elm_multibuttonentry_smart_focus_next_enable);
}
EAPI Evas_Object *
@@ -1648,16 +1652,16 @@ _legacy_focused(void *data, const Efl_Event *ev)
{
Efl_Ui_Focus_Object *new_focus;
Eina_Bool meaningful_focus_in = EINA_FALSE, meaningful_focus_out = EINA_FALSE;
- EFL_UI_MULTIBUTTONENTRY_DATA_GET(data, pd);
+ ELM_MULTIBUTTONENTRY_DATA_GET(data, pd);
new_focus = efl_ui_focus_manager_focus_get(ev->object);
- if (efl_isa(ev->info, ELM_WIDGET_CLASS) && elm_widget_parent_get(ev->info) == pd->box)
+ if (efl_isa(ev->info, EFL_UI_WIDGET_CLASS) && elm_widget_parent_get(ev->info) == pd->box)
{
meaningful_focus_out = EINA_TRUE;
}
- if (efl_isa(new_focus, ELM_WIDGET_CLASS) && elm_widget_parent_get(new_focus) == pd->box)
+ if (efl_isa(new_focus, EFL_UI_WIDGET_CLASS) && elm_widget_parent_get(new_focus) == pd->box)
{
meaningful_focus_in = EINA_TRUE;
}
@@ -1677,38 +1681,49 @@ static void
_legacy_manager_changed_cb(void *data EINA_UNUSED, const Efl_Event *ev)
{
efl_event_callback_del(ev->info, EFL_UI_FOCUS_MANAGER_EVENT_FOCUSED, _legacy_focused, ev->object);
- efl_event_callback_add(efl_ui_focus_user_focus_manager_get(ev->object), EFL_UI_FOCUS_MANAGER_EVENT_FOCUSED, _legacy_focused, ev->object);
+ efl_event_callback_add(efl_ui_focus_object_focus_manager_get(ev->object), EFL_UI_FOCUS_MANAGER_EVENT_FOCUSED, _legacy_focused, ev->object);
}
EOLIAN static Eo *
-_efl_ui_multibuttonentry_efl_object_constructor(Eo *obj, Efl_Ui_Multibuttonentry_Data *sd EINA_UNUSED)
+_elm_multibuttonentry_efl_object_constructor(Eo *obj, Elm_Multibuttonentry_Data *sd EINA_UNUSED)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_PANEL);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_PANEL);
//listen to manager changes here
- efl_event_callback_add(obj, EFL_UI_FOCUS_USER_EVENT_MANAGER_CHANGED, _legacy_manager_changed_cb, NULL);
+ efl_event_callback_add(obj, EFL_UI_FOCUS_OBJECT_EVENT_MANAGER_CHANGED, _legacy_manager_changed_cb, NULL);
return obj;
}
EOLIAN static Evas_Object*
-_efl_ui_multibuttonentry_entry_get(Eo *obj EINA_UNUSED, Efl_Ui_Multibuttonentry_Data *sd)
+_elm_multibuttonentry_entry_get(const Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd)
{
return sd->entry;
}
EOLIAN static Eina_Bool
-_efl_ui_multibuttonentry_expanded_get(Eo *obj EINA_UNUSED, Efl_Ui_Multibuttonentry_Data *sd)
+_elm_multibuttonentry_expanded_get(const Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd)
{
return sd->view_state == MULTIBUTTONENTRY_VIEW_SHRINK ?
EINA_FALSE : EINA_TRUE;
}
EOLIAN static void
-_efl_ui_multibuttonentry_expanded_set(Eo *obj, Efl_Ui_Multibuttonentry_Data *sd, Eina_Bool expanded)
+_elm_multibuttonentry_format_function_set(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd, Elm_Multibuttonentry_Format_Cb f_func, const void *data)
+{
+ sd->format_func = f_func;
+ if (!sd->format_func) sd->format_func = _format_count;
+
+ sd->format_func_data = data;
+
+ _view_update(sd);
+}
+
+EOLIAN static void
+_elm_multibuttonentry_expanded_set(Eo *obj, Elm_Multibuttonentry_Data *sd, Eina_Bool expanded)
{
if (((sd->view_state == MULTIBUTTONENTRY_VIEW_SHRINK) ?
EINA_FALSE : EINA_TRUE) == expanded) return;
@@ -1720,7 +1735,7 @@ _efl_ui_multibuttonentry_expanded_set(Eo *obj, Efl_Ui_Multibuttonentry_Data *sd,
}
EOLIAN static void
-_efl_ui_multibuttonentry_editable_set(Eo *obj EINA_UNUSED, Efl_Ui_Multibuttonentry_Data *sd, Eina_Bool editable)
+_elm_multibuttonentry_editable_set(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd, Eina_Bool editable)
{
editable = !!editable;
if (sd->editable == editable) return;
@@ -1739,55 +1754,55 @@ _efl_ui_multibuttonentry_editable_set(Eo *obj EINA_UNUSED, Efl_Ui_Multibuttonent
}
EOLIAN static Eina_Bool
-_efl_ui_multibuttonentry_editable_get(Eo *obj EINA_UNUSED, Efl_Ui_Multibuttonentry_Data *sd)
+_elm_multibuttonentry_editable_get(const Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd)
{
return sd->editable;
}
EOLIAN static Elm_Object_Item*
-_efl_ui_multibuttonentry_item_prepend(Eo *obj EINA_UNUSED, Efl_Ui_Multibuttonentry_Data *sd, const char *label, Evas_Smart_Cb func, void *data)
+_elm_multibuttonentry_item_prepend(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd, const char *label, Evas_Smart_Cb func, void *data)
{
return _item_new(sd, label, MULTIBUTTONENTRY_POS_START, NULL, func, data);
}
EOLIAN static Elm_Object_Item*
-_efl_ui_multibuttonentry_item_append(Eo *obj EINA_UNUSED, Efl_Ui_Multibuttonentry_Data *sd, const char *label, Evas_Smart_Cb func, void *data)
+_elm_multibuttonentry_item_append(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd, const char *label, Evas_Smart_Cb func, void *data)
{
return _item_new(sd, label, MULTIBUTTONENTRY_POS_END, NULL, func, data);
}
EOLIAN static Elm_Object_Item*
-_efl_ui_multibuttonentry_item_insert_before(Eo *obj EINA_UNUSED, Efl_Ui_Multibuttonentry_Data *sd, Elm_Object_Item *before, const char *label, Evas_Smart_Cb func, void *data)
+_elm_multibuttonentry_item_insert_before(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd, Elm_Object_Item *before, const char *label, Evas_Smart_Cb func, void *data)
{
return _item_new(sd, label, MULTIBUTTONENTRY_POS_BEFORE, before, func, data);
}
EOLIAN static Elm_Object_Item*
-_efl_ui_multibuttonentry_item_insert_after(Eo *obj EINA_UNUSED, Efl_Ui_Multibuttonentry_Data *sd, Elm_Object_Item *after, const char *label, Evas_Smart_Cb func, void *data)
+_elm_multibuttonentry_item_insert_after(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd, Elm_Object_Item *after, const char *label, Evas_Smart_Cb func, void *data)
{
return _item_new(sd, label, MULTIBUTTONENTRY_POS_AFTER, after, func, data);
}
EOLIAN static const Eina_List*
-_efl_ui_multibuttonentry_items_get(Eo *obj EINA_UNUSED, Efl_Ui_Multibuttonentry_Data *sd)
+_elm_multibuttonentry_items_get(const Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd)
{
return sd->items;
}
EOLIAN static Elm_Object_Item*
-_efl_ui_multibuttonentry_first_item_get(Eo *obj EINA_UNUSED, Efl_Ui_Multibuttonentry_Data *sd)
+_elm_multibuttonentry_first_item_get(const Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd)
{
return eina_list_data_get(sd->items);
}
EOLIAN static Elm_Object_Item*
-_efl_ui_multibuttonentry_last_item_get(Eo *obj EINA_UNUSED, Efl_Ui_Multibuttonentry_Data *sd)
+_elm_multibuttonentry_last_item_get(const Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd)
{
return eina_list_data_get(eina_list_last(sd->items));
}
EOLIAN static Elm_Object_Item*
-_efl_ui_multibuttonentry_selected_item_get(Eo *obj EINA_UNUSED, Efl_Ui_Multibuttonentry_Data *sd)
+_elm_multibuttonentry_selected_item_get(const Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd)
{
return EO_OBJ(sd->selected_it);
}
@@ -1802,10 +1817,10 @@ _elm_multibuttonentry_item_selected_set(Eo *eo_item EINA_UNUSED,
}
EOLIAN static Eina_Bool
-_elm_multibuttonentry_item_selected_get(Eo *eo_item,
+_elm_multibuttonentry_item_selected_get(const Eo *eo_item,
Elm_Multibuttonentry_Item_Data *item)
{
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN_VAL(WIDGET(item), sd, EINA_FALSE);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN_VAL(WIDGET(item), sd, EINA_FALSE);
if (!eo_item) return EINA_FALSE;
if (EO_OBJ(sd->selected_it) == eo_item)
return EINA_TRUE;
@@ -1814,10 +1829,10 @@ _elm_multibuttonentry_item_selected_get(Eo *eo_item,
}
EOLIAN static void
-_efl_ui_multibuttonentry_clear(Eo *obj EINA_UNUSED, Efl_Ui_Multibuttonentry_Data *sd)
+_elm_multibuttonentry_clear(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd)
{
while (sd->items)
- elm_wdg_item_del(eina_list_data_get(sd->items));
+ elm_object_item_del(eina_list_data_get(sd->items));
sd->selected_it = NULL;
_view_update(sd);
@@ -1830,7 +1845,7 @@ _elm_multibuttonentry_item_prev_get(const Eo *eo_it,
Eina_List *l;
Elm_Object_Item *eo_temp_it;
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN_VAL(WIDGET(it), sd, NULL);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN_VAL(WIDGET(it), sd, NULL);
EINA_LIST_FOREACH(sd->items, l, eo_temp_it)
{
@@ -1851,7 +1866,7 @@ _elm_multibuttonentry_item_next_get(const Eo *eo_it,
Eina_List *l;
Elm_Object_Item *eo_temp_it;
- EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN_VAL(WIDGET(it), sd, NULL);
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN_VAL(WIDGET(it), sd, NULL);
EINA_LIST_FOREACH(sd->items, l, eo_temp_it)
{
@@ -1891,7 +1906,7 @@ elm_multibuttonentry_item_data_set(Elm_Object_Item *it,
}
EOLIAN static void
-_efl_ui_multibuttonentry_item_filter_append(Eo *obj EINA_UNUSED, Efl_Ui_Multibuttonentry_Data *sd, Elm_Multibuttonentry_Item_Filter_Cb func, void *data)
+_elm_multibuttonentry_item_filter_append(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd, Elm_Multibuttonentry_Item_Filter_Cb func, void *data)
{
Elm_Multibuttonentry_Item_Filter *new_item_filter = NULL;
Elm_Multibuttonentry_Item_Filter *_item_filter = NULL;
@@ -1915,7 +1930,7 @@ _efl_ui_multibuttonentry_item_filter_append(Eo *obj EINA_UNUSED, Efl_Ui_Multibut
}
EOLIAN static void
-_efl_ui_multibuttonentry_item_filter_prepend(Eo *obj EINA_UNUSED, Efl_Ui_Multibuttonentry_Data *sd, Elm_Multibuttonentry_Item_Filter_Cb func, void *data)
+_elm_multibuttonentry_item_filter_prepend(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd, Elm_Multibuttonentry_Item_Filter_Cb func, void *data)
{
Elm_Multibuttonentry_Item_Filter *new_item_filter = NULL;
Elm_Multibuttonentry_Item_Filter *_item_filter = NULL;
@@ -1940,7 +1955,7 @@ _efl_ui_multibuttonentry_item_filter_prepend(Eo *obj EINA_UNUSED, Efl_Ui_Multibu
}
EOLIAN static void
-_efl_ui_multibuttonentry_item_filter_remove(Eo *obj EINA_UNUSED, Efl_Ui_Multibuttonentry_Data *sd, Elm_Multibuttonentry_Item_Filter_Cb func, void *data)
+_elm_multibuttonentry_item_filter_remove(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd, Elm_Multibuttonentry_Item_Filter_Cb func, void *data)
{
Eina_List *l;
Elm_Multibuttonentry_Item_Filter *item_filter;
@@ -1959,45 +1974,28 @@ _efl_ui_multibuttonentry_item_filter_remove(Eo *obj EINA_UNUSED, Efl_Ui_Multibut
}
}
-EOLIAN static void
-_efl_ui_multibuttonentry_efl_ui_format_format_cb_set(Eo *obj EINA_UNUSED, Efl_Ui_Multibuttonentry_Data *sd, void *func_data, Efl_Ui_Format_Func_Cb func, Eina_Free_Cb func_free_cb)
-{
- if (sd->format_cb_data == func_data && sd->format_cb == func)
- return;
-
- if (sd->format_cb_data && sd->format_free_cb)
- sd->format_free_cb(sd->format_cb_data);
-
- sd->format_cb = func;
- sd->format_cb_data = func_data;
- sd->format_free_cb = func_free_cb;
- if (!sd->format_strbuf) sd->format_strbuf = eina_strbuf_new();
-
- _view_update(sd);
-}
-
static void
-_efl_ui_multibuttonentry_class_constructor(Efl_Class *klass)
+_elm_multibuttonentry_class_constructor(Efl_Class *klass)
{
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF)
- _efl_ui_multibuttonentry_smart_focus_next_enable = EINA_TRUE;
+ _elm_multibuttonentry_smart_focus_next_enable = EINA_TRUE;
}
EOLIAN static Eina_List*
-_efl_ui_multibuttonentry_efl_access_children_get(Eo *obj, Efl_Ui_Multibuttonentry_Data *sd)
+_elm_multibuttonentry_efl_access_object_access_children_get(const Eo *obj, Elm_Multibuttonentry_Data *sd)
{
Eina_List *ret;
- ret = efl_access_children_get(efl_super(obj, EFL_UI_MULTIBUTTONENTRY_CLASS));
+ ret = efl_access_object_access_children_get(efl_super(obj, ELM_MULTIBUTTONENTRY_CLASS));
return eina_list_merge(eina_list_clone(sd->items), ret);
}
EOLIAN static const char*
-_elm_multibuttonentry_item_efl_access_name_get(Eo *eo_it, Elm_Multibuttonentry_Item_Data *item)
+_elm_multibuttonentry_item_efl_access_object_i18n_name_get(const Eo *eo_it, Elm_Multibuttonentry_Item_Data *item)
{
const char *ret;
- ret = efl_access_name_get(efl_super(eo_it, ELM_MULTIBUTTONENTRY_ITEM_CLASS));
+ ret = efl_access_object_i18n_name_get(efl_super(eo_it, ELM_MULTIBUTTONENTRY_ITEM_CLASS));
if (ret) return ret;
ret = elm_object_part_text_get(VIEW(item), "elm.btn.text");
@@ -2005,12 +2003,12 @@ _elm_multibuttonentry_item_efl_access_name_get(Eo *eo_it, Elm_Multibuttonentry_I
}
EOLIAN static Efl_Access_State_Set
-_elm_multibuttonentry_item_efl_access_state_set_get(Eo *eo_it, Elm_Multibuttonentry_Item_Data *sd EINA_UNUSED)
+_elm_multibuttonentry_item_efl_access_object_state_set_get(const Eo *eo_it, Elm_Multibuttonentry_Item_Data *sd EINA_UNUSED)
{
Efl_Access_State_Set ret;
Eina_Bool sel;
- ret = efl_access_state_set_get(efl_super(eo_it, ELM_MULTIBUTTONENTRY_ITEM_CLASS));
+ ret = efl_access_object_state_set_get(efl_super(eo_it, ELM_MULTIBUTTONENTRY_ITEM_CLASS));
sel = elm_obj_multibuttonentry_item_selected_get(eo_it);
@@ -2043,12 +2041,12 @@ _key_action_longpress(Eo *obj, const char *params EINA_UNUSED)
{
ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(obj, it);
efl_event_callback_legacy_call
- (WIDGET(it), EFL_UI_MULTIBUTTONENTRY_EVENT_ITEM_LONGPRESSED, obj);
+ (WIDGET(it), ELM_MULTIBUTTONENTRY_EVENT_ITEM_LONGPRESSED, obj);
return EINA_TRUE;
}
EOLIAN const Efl_Access_Action_Data *
-_elm_multibuttonentry_item_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Item_Data *pd EINA_UNUSED)
+_elm_multibuttonentry_item_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Item_Data *pd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "activate", NULL, NULL, _key_action_activate },
@@ -2059,72 +2057,19 @@ _elm_multibuttonentry_item_efl_access_widget_action_elm_actions_get(Eo *obj EINA
return &atspi_actions[0];
}
-static Eina_Bool
-_part_is_efl_ui_multibutton_entry_part(const Eo *obj, const char *part)
-{
- return (((elm_widget_is_legacy(obj)) && (eina_streq(part, "default"))) ||
- (eina_streq(part, "guide")));
-}
+/* Efl.Part begin */
-ELM_PART_OVERRIDE_PARTIAL(efl_ui_multibuttonentry, EFL_UI_MULTIBUTTONENTRY,
- Efl_Ui_Multibuttonentry_Data, _part_is_efl_ui_multibutton_entry_part)
-ELM_PART_OVERRIDE_TEXT_SET(efl_ui_multibuttonentry, EFL_UI_MULTIBUTTONENTRY, Efl_Ui_Multibuttonentry_Data)
-ELM_PART_OVERRIDE_TEXT_GET(efl_ui_multibuttonentry, EFL_UI_MULTIBUTTONENTRY, Efl_Ui_Multibuttonentry_Data)
-#include "efl_ui_multibuttonentry_part.eo.c"
+ELM_PART_OVERRIDE(elm_multibuttonentry, ELM_MULTIBUTTONENTRY, Elm_Multibuttonentry_Data)
+ELM_PART_OVERRIDE_TEXT_SET(elm_multibuttonentry, ELM_MULTIBUTTONENTRY, Elm_Multibuttonentry_Data)
+ELM_PART_OVERRIDE_TEXT_GET(elm_multibuttonentry, ELM_MULTIBUTTONENTRY, Elm_Multibuttonentry_Data)
+#include "elm_multibuttonentry_part.eo.c"
/* Efl.Part end */
/* Internal EO APIs and hidden overrides */
-#define EFL_UI_MULTIBUTTONENTRY_EXTRA_OPS \
- ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_multibuttonentry), \
- EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_multibuttonentry)
+#define ELM_MULTIBUTTONENTRY_EXTRA_OPS \
+ ELM_LAYOUT_SIZING_EVAL_OPS(elm_multibuttonentry), \
+ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_multibuttonentry)
#include "elm_multibuttonentry_item.eo.c"
-#include "efl_ui_multibuttonentry.eo.c"
-
-/* Legacy APIs */
-
-typedef struct
-{
- Efl_Ui_Multibuttonentry_Format_Cb format_cb;
- void *data;
-} Mbe_Format_Wrapper_Data ;
-
-static void
-_format_legacy_to_format_eo_cb(void *data, Eina_Strbuf *str, const Eina_Value value)
-{
- Mbe_Format_Wrapper_Data *mfwd = data;
- char *buf;
- int count = 0;
-
- const Eina_Value_Type *type = eina_value_type_get(&value);
-
- if (type == EINA_VALUE_TYPE_INT)
- eina_value_get(&value, &count);
-
- buf = mfwd->format_cb(count, mfwd->data);
- if (buf)
- eina_strbuf_append(str, buf);
- free(buf);
-}
-
-static void
-_format_legacy_to_format_eo_free_cb(void *data)
-{
- Mbe_Format_Wrapper_Data *mfwd = data;
-
- free(mfwd);
-}
-
-EAPI void
-elm_multibuttonentry_format_function_set(Eo *obj, Efl_Ui_Multibuttonentry_Format_Cb format_function, const void *data)
-{
- Mbe_Format_Wrapper_Data *mfwd = malloc(sizeof(Mbe_Format_Wrapper_Data));
-
- mfwd->format_cb = format_function;
- if (!mfwd->format_cb) mfwd->format_cb = _format_count;
-
- mfwd->data = (void *)data;
-
- efl_ui_format_cb_set(obj, mfwd, _format_legacy_to_format_eo_cb, _format_legacy_to_format_eo_free_cb);
-}
+#include "elm_multibuttonentry.eo.c"
diff --git a/src/lib/elementary/elc_multibuttonentry.h b/src/lib/elementary/elc_multibuttonentry.h
index b878f7829c..75fe7a1b99 100644
--- a/src/lib/elementary/elc_multibuttonentry.h
+++ b/src/lib/elementary/elc_multibuttonentry.h
@@ -59,7 +59,7 @@
#include "elc_multibuttonentry_common.h"
#ifdef EFL_EO_API_SUPPORT
-#include "efl_ui_multibuttonentry_eo.h"
+#include "elc_multibuttonentry_eo.h"
#endif
#ifndef EFL_NOLEGACY_API_SUPPORT
#include "elc_multibuttonentry_legacy.h"
diff --git a/src/lib/elementary/elc_multibuttonentry_common.h b/src/lib/elementary/elc_multibuttonentry_common.h
index 8601dbffcc..b076385698 100644
--- a/src/lib/elementary/elc_multibuttonentry_common.h
+++ b/src/lib/elementary/elc_multibuttonentry_common.h
@@ -30,4 +30,4 @@ typedef Eina_Bool (*Elm_Multibuttonentry_Item_Filter_Cb)(Evas_
*
* @ingroup Multibuttonentry
*/
-typedef char * (*Efl_Ui_Multibuttonentry_Format_Cb)(int count, void *data);
+typedef char * (*Elm_Multibuttonentry_Format_Cb)(int count, void *data);
diff --git a/src/lib/elementary/efl_ui_multibuttonentry_eo.h b/src/lib/elementary/elc_multibuttonentry_eo.h
index b6158a8927..4d958bd55b 100644
--- a/src/lib/elementary/efl_ui_multibuttonentry_eo.h
+++ b/src/lib/elementary/elc_multibuttonentry_eo.h
@@ -1,2 +1,2 @@
#include "elm_multibuttonentry_item.eo.h"
-#include "efl_ui_multibuttonentry.eo.h"
+#include "elm_multibuttonentry.eo.h"
diff --git a/src/lib/elementary/elc_multibuttonentry_legacy.h b/src/lib/elementary/elc_multibuttonentry_legacy.h
index 8831fe71ca..b12f441490 100644
--- a/src/lib/elementary/elc_multibuttonentry_legacy.h
+++ b/src/lib/elementary/elc_multibuttonentry_legacy.h
@@ -1,3 +1,5 @@
+typedef Eo Elm_Multibuttonentry;
+
/**
* @brief Add a new multibuttonentry to the parent
*
@@ -24,7 +26,7 @@ EAPI Evas_Object *elm_multibuttonentry_add(Evas_Object *parent);
*
* @ingroup Multibuttonentry
*/
- EAPI void elm_multibuttonentry_format_function_set(Eo *obj, Efl_Ui_Multibuttonentry_Format_Cb format_function, const void *data);
+ EAPI void elm_multibuttonentry_format_function_set(Eo *obj, Elm_Multibuttonentry_Format_Cb format_function, const void *data);
#include "elm_multibuttonentry_item.eo.legacy.h"
-#include "efl_ui_multibuttonentry.eo.legacy.h"
+#include "elm_multibuttonentry.eo.legacy.h"
diff --git a/src/lib/elementary/elc_naviframe.c b/src/lib/elementary/elc_naviframe.c
index 256ff2c4fc..1777a73576 100644
--- a/src/lib/elementary/elc_naviframe.c
+++ b/src/lib/elementary/elc_naviframe.c
@@ -2,11 +2,12 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define ELM_WIDGET_ITEM_PROTECTED
#define ELM_WIDGET_PROTECTED
#define EFL_UI_TRANSLATABLE_PROTECTED
+#define EFL_PART_PROTECTED
#include <Elementary.h>
#include "elm_priv.h"
@@ -60,7 +61,7 @@ static const Elm_Action key_actions[] = {
};
EOLIAN static void
-_elm_naviframe_elm_widget_resize_object_set(Eo *obj, Elm_Naviframe_Data *pd EINA_UNUSED,
+_elm_naviframe_efl_ui_widget_resize_object_set(Eo *obj, Elm_Naviframe_Data *pd EINA_UNUSED,
Efl_Canvas_Object *sobj)
{
if (!sobj || !efl_finalized_get(obj)) goto super;
@@ -92,7 +93,7 @@ _prev_page_focus_recover(Elm_Naviframe_Item_Data *it)
{
Elm_Naviframe *n = it->base->widget;
- efl_ui_focus_manager_focus_set(efl_ui_focus_user_focus_manager_get(n), n);
+ efl_ui_focus_manager_focus_set(efl_ui_focus_object_focus_manager_get(n), n);
}
EOLIAN static void
@@ -181,7 +182,6 @@ _item_free(Elm_Naviframe_Item_Data *it)
ELM_NAVIFRAME_DATA_GET(WIDGET(it), sd);
- eina_stringshare_del(it->style);
eina_stringshare_del(it->title_label);
eina_stringshare_del(it->subtitle_label);
@@ -284,10 +284,12 @@ _item_text_signals_emit(Elm_Naviframe_Item_Data *it)
static Evas_Object *
_access_object_get(Elm_Naviframe_Item_Data *it, const char* part)
{
- Evas_Object *po, *ao;
+ Evas_Object *po, *ao, *o;
- po = (Evas_Object *)edje_object_part_object_get
- (elm_layout_edje_get(VIEW(it)), part);
+ o = elm_layout_edje_get(VIEW(it));
+ edje_object_freeze(o);
+ po = (Evas_Object *)edje_object_part_object_get(o, part);
+ edje_object_thaw(o);
ao = evas_object_data_get(po, "_part_access_obj");
return ao;
@@ -334,12 +336,12 @@ _item_style_set(Elm_Naviframe_Item_Data *it,
if (!item_style)
{
strcpy(buf, "item/basic");
- eina_stringshare_replace(&it->style, "basic");
+ elm_wdg_item_style_set(efl_super(EO_OBJ(it), ELM_NAVIFRAME_ITEM_CLASS), "basic");
}
else
{
snprintf(buf, sizeof(buf), "item/%s", item_style);
- eina_stringshare_replace(&it->style, item_style);
+ elm_wdg_item_style_set(efl_super(EO_OBJ(it), ELM_NAVIFRAME_ITEM_CLASS), item_style);
}
if (!elm_layout_theme_set(VIEW(it), "naviframe", buf,
@@ -392,7 +394,7 @@ _item_title_enabled_update(Elm_Naviframe_Item_Data *nit, Eina_Bool transition)
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_naviframe_elm_widget_theme_apply(Eo *obj, Elm_Naviframe_Data *sd)
+_elm_naviframe_efl_ui_widget_theme_apply(Eo *obj, Elm_Naviframe_Data *sd)
{
Elm_Naviframe_Item_Data *it;
const char *style = NULL, *sstyle = NULL;
@@ -403,7 +405,7 @@ _elm_naviframe_elm_widget_theme_apply(Eo *obj, Elm_Naviframe_Data *sd)
{
sstyle = efl_ui_widget_style_get(VIEW(it));
if ((style && sstyle) && strcmp(style, sstyle))
- _item_style_set(it, it->style);
+ _item_style_set(it, elm_wdg_item_style_get(EO_OBJ(it)));
_item_signals_emit(it);
_item_title_enabled_update(it, EINA_FALSE);
}
@@ -545,13 +547,13 @@ _elm_naviframe_item_elm_widget_item_part_text_set(Eo *eo_it,
if (nit->title_label) strncat(buf, " ", 1);
strncat(buf, nit->subtitle_label, sizeof(buf) - strlen(buf) - 2);
}
- efl_access_name_set(eo_it, buf);
+ efl_access_object_i18n_name_set(eo_it, buf);
elm_layout_sizing_eval(WIDGET(nit));
}
EOLIAN static const char *
-_elm_naviframe_item_elm_widget_item_part_text_get(Eo *nit EINA_UNUSED,
+_elm_naviframe_item_elm_widget_item_part_text_get(const Eo *nit EINA_UNUSED,
Elm_Naviframe_Item_Data *it,
const char *part)
{
@@ -880,7 +882,7 @@ _elm_naviframe_item_elm_widget_item_part_content_set(Eo *eo_nit EINA_UNUSED,
}
EOLIAN static Evas_Object *
-_elm_naviframe_item_elm_widget_item_part_content_get(Eo *eo_nit EINA_UNUSED,
+_elm_naviframe_item_elm_widget_item_part_content_get(const Eo *eo_nit EINA_UNUSED,
Elm_Naviframe_Item_Data *nit,
const char *part)
{
@@ -1182,7 +1184,7 @@ _on_item_pop_finished(void *data,
elm_widget_tree_unfocusable_set(VIEW(it), EINA_FALSE);
sd->popping = eina_list_remove(sd->popping, it);
- elm_wdg_item_del(EO_OBJ(it));
+ efl_del(EO_OBJ(it));
}
/* "elm,state,new,pushed",
@@ -1268,8 +1270,8 @@ _item_new(Evas_Object *obj,
ELM_NAVIFRAME_DATA_GET(obj, sd);
eo_item = efl_add(ELM_NAVIFRAME_ITEM_CLASS, obj);
- efl_access_role_set(eo_item, EFL_ACCESS_ROLE_PAGE_TAB);
- efl_access_name_set(eo_item, (char*)title_label);
+ efl_access_object_role_set(eo_item, EFL_ACCESS_ROLE_PAGE_TAB);
+ efl_access_object_i18n_name_set(eo_item, (char*)title_label);
if (!eo_item)
{
@@ -1280,7 +1282,7 @@ _item_new(Evas_Object *obj,
ELM_NAVIFRAME_ITEM_DATA_GET(eo_item, it);
//item base layout
- VIEW(it) = elm_layout_add(obj);
+ VIEW_SET(it, elm_layout_add(obj));
evas_object_smart_member_add(VIEW(it), obj);
if (!elm_widget_sub_object_add(obj, VIEW(it)))
@@ -1441,14 +1443,14 @@ _elm_naviframe_efl_canvas_group_group_del(Eo *obj, Elm_Naviframe_Data *sd)
{
it = EINA_INLIST_CONTAINER_GET(l, Elm_Naviframe_Item_Data);
l = l->prev;
- elm_wdg_item_del(EO_OBJ(it));
+ efl_del(EO_OBJ(it));
}
// No need to cleanup animator as it is an event on myself
EINA_LIST_FREE(sd->ops, nfo)
free(nfo);
EINA_LIST_FREE(sd->popping, it)
- elm_wdg_item_del(EO_OBJ(it));
+ efl_del(EO_OBJ(it));
evas_object_del(sd->dummy_edje);
@@ -1457,14 +1459,14 @@ _elm_naviframe_efl_canvas_group_group_del(Eo *obj, Elm_Naviframe_Data *sd)
//Show only the top item view
EOLIAN static void
-_elm_naviframe_efl_gfx_visible_set(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, Eina_Bool vis)
+_elm_naviframe_efl_gfx_entity_visible_set(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, Eina_Bool vis)
{
Elm_Object_Item *eo_top;
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 0, vis))
return;
- efl_gfx_visible_set(efl_super(obj, MY_CLASS), vis);
+ efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), vis);
if (!vis) return;
eo_top = elm_naviframe_top_item_get(obj);
@@ -1507,7 +1509,7 @@ _key_action_item_pop(Evas_Object *obj, const char *params EINA_UNUSED)
}
EOLIAN static void
-_elm_naviframe_elm_widget_on_access_update(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd, Eina_Bool is_access)
+_elm_naviframe_efl_ui_widget_on_access_update(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd, Eina_Bool is_access)
{
Elm_Naviframe_Item_Data *it;
@@ -1594,7 +1596,7 @@ _elm_naviframe_efl_object_constructor(Eo *obj, Elm_Naviframe_Data *sd)
sd->obj = obj;
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_PAGE_TAB_LIST);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_PAGE_TAB_LIST);
return obj;
}
@@ -1719,7 +1721,7 @@ _elm_naviframe_item_pop(Eo *obj, Elm_Naviframe_Data *sd)
{
efl_unref(eo_item);
if (it->delete_me)
- elm_wdg_item_del(eo_item);
+ efl_del(eo_item);
else
{
/* To avoid multiple item pops, the auto pushed button deletes
@@ -1783,7 +1785,7 @@ _elm_naviframe_item_pop(Eo *obj, Elm_Naviframe_Data *sd)
_schedule_deferred(nfo, sd);
}
else
- elm_wdg_item_del(eo_item);
+ efl_del(eo_item);
on_error:
return content;
@@ -1811,7 +1813,7 @@ _elm_naviframe_item_pop_to(Eo *eo_it, Elm_Naviframe_Item_Data *it)
l = l->prev;
- elm_wdg_item_del(EO_OBJ(iit));
+ efl_del(EO_OBJ(iit));
}
sd->on_deletion = EINA_FALSE;
@@ -1856,13 +1858,13 @@ _elm_naviframe_content_preserve_on_pop_set(Eo *obj EINA_UNUSED, Elm_Naviframe_Da
}
EOLIAN static Eina_Bool
-_elm_naviframe_content_preserve_on_pop_get(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
+_elm_naviframe_content_preserve_on_pop_get(const Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
{
return sd->preserve;
}
EOLIAN static Elm_Object_Item*
-_elm_naviframe_top_item_get(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
+_elm_naviframe_top_item_get(const Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
{
if (!sd->stack) return NULL;
Elm_Naviframe_Item_Data *ret_it = EINA_INLIST_CONTAINER_GET
@@ -1871,7 +1873,7 @@ _elm_naviframe_top_item_get(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
}
EOLIAN static Elm_Object_Item*
-_elm_naviframe_bottom_item_get(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
+_elm_naviframe_bottom_item_get(const Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
{
if (!sd->stack) return NULL;
Elm_Naviframe_Item_Data *ret_it = EINA_INLIST_CONTAINER_GET
@@ -1880,25 +1882,30 @@ _elm_naviframe_bottom_item_get(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
}
EOLIAN static void
-_elm_naviframe_item_style_set(Eo *eo_item EINA_UNUSED,
+_elm_naviframe_item_elm_widget_item_style_set(Eo *eo_item EINA_UNUSED,
Elm_Naviframe_Item_Data *nit,
const char *item_style)
{
- if (item_style && !strcmp(item_style, nit->style)) return;
+ if (item_style && eina_streq(item_style, elm_wdg_item_style_get(EO_OBJ(nit)))) return;
if (!item_style)
- if (!strcmp("basic", nit->style)) return;
+ if (eina_streq("basic", elm_wdg_item_style_get(EO_OBJ(nit)))) return;
_item_style_set(nit, item_style);
_item_signals_emit(nit);
_item_title_enabled_update(nit, EINA_FALSE);
}
-EOLIAN static const char *
-_elm_naviframe_item_style_get(Eo *eo_item EINA_UNUSED,
- Elm_Naviframe_Item_Data *nit)
+EAPI void
+elm_naviframe_item_style_set(Elm_Object_Item *obj, const char *style)
+{
+ elm_wdg_item_style_set(obj, style);
+}
+
+EAPI const char *
+elm_naviframe_item_style_get(const Elm_Object_Item *obj)
{
- return nit->style;
+ return elm_wdg_item_style_get(obj);
}
EINA_DEPRECATED EAPI void
@@ -1946,7 +1953,7 @@ _elm_naviframe_item_pop_cb_set(Eo *eo_item EINA_UNUSED,
}
EOLIAN static Eina_List*
-_elm_naviframe_item_efl_access_children_get(Eo *eo_item EINA_UNUSED, Elm_Naviframe_Item_Data *nit)
+_elm_naviframe_item_efl_access_object_access_children_get(const Eo *eo_item EINA_UNUSED, Elm_Naviframe_Item_Data *nit)
{
Eina_List *ret = NULL;
@@ -1961,13 +1968,13 @@ _elm_naviframe_prev_btn_auto_pushed_set(Eo *obj EINA_UNUSED, Elm_Naviframe_Data
}
EOLIAN static Eina_Bool
-_elm_naviframe_prev_btn_auto_pushed_get(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
+_elm_naviframe_prev_btn_auto_pushed_get(const Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
{
return sd->auto_pushed;
}
EOLIAN static Eina_List*
-_elm_naviframe_items_get(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
+_elm_naviframe_items_get(const Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
{
Eina_List *ret = NULL;
Elm_Naviframe_Item_Data *itr;
@@ -1987,7 +1994,7 @@ _elm_naviframe_event_enabled_set(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd, Ei
}
EOLIAN static Eina_Bool
-_elm_naviframe_event_enabled_get(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
+_elm_naviframe_event_enabled_get(const Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
{
return !sd->freeze_events;
}
@@ -1999,7 +2006,7 @@ _elm_naviframe_class_constructor(Efl_Class *klass)
}
EOLIAN const Efl_Access_Action_Data *
-_elm_naviframe_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *pd EINA_UNUSED)
+_elm_naviframe_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Elm_Naviframe_Data *pd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "top_item_get", "top_item_get", NULL, _key_action_top_item_get },
diff --git a/src/lib/elementary/elc_naviframe_legacy.h b/src/lib/elementary/elc_naviframe_legacy.h
index a1b7d46303..7bcba3a6a3 100644
--- a/src/lib/elementary/elc_naviframe_legacy.h
+++ b/src/lib/elementary/elc_naviframe_legacy.h
@@ -1,2 +1,23 @@
+/**
+ * @brief Set an item style.
+ *
+ * @param[in] obj The object.
+ * @param[in] style The current item style name. @c null would be default
+ *
+ * @ingroup Elm_Naviframe_Item
+ */
+EAPI void elm_naviframe_item_style_set(Elm_Object_Item *obj, const char *style);
+
+/**
+ * @brief Get an item style.
+ *
+ * @param[in] obj The object.
+ *
+ * @return The current item style name. @c null would be default
+ *
+ * @ingroup Elm_Naviframe_Item
+ */
+EAPI const char *elm_naviframe_item_style_get(const Elm_Object_Item *obj);
+
#include "elm_naviframe_item.eo.legacy.h"
#include "elm_naviframe.eo.legacy.h"
diff --git a/src/lib/elementary/elc_player.c b/src/lib/elementary/elc_player.c
index 27cd4f4bd2..35c13967e1 100644
--- a/src/lib/elementary/elc_player.c
+++ b/src/lib/elementary/elc_player.c
@@ -2,10 +2,11 @@
# include "elementary_config.h"
#endif
-#include <Emotion.h>
-
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
+#define EFL_PART_PROTECTED
+
+#include <Emotion.h>
#include <Elementary.h>
#include "elm_priv.h"
@@ -185,7 +186,7 @@ _update_theme_slider(Evas_Object *obj, Evas_Object *sl, const char *name, const
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_player_elm_widget_theme_apply(Eo *obj, Elm_Player_Data *sd)
+_elm_player_efl_ui_widget_theme_apply(Eo *obj, Elm_Player_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
@@ -667,7 +668,7 @@ _elm_player_efl_object_constructor(Eo *obj, Elm_Player_Data *sd EINA_UNUSED)
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_ANIMATION);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_ANIMATION);
return obj;
}
@@ -679,7 +680,7 @@ _elm_player_class_constructor(Efl_Class *klass)
}
EOLIAN const Efl_Access_Action_Data *
-_elm_player_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Player_Data *pd EINA_UNUSED)
+_elm_player_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Elm_Player_Data *pd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "move,left", "move", "left", _key_action_move},
diff --git a/src/lib/elementary/elc_popup.c b/src/lib/elementary/elc_popup.c
index cc10c9da0b..048e778108 100644
--- a/src/lib/elementary/elc_popup.c
+++ b/src/lib/elementary/elc_popup.c
@@ -2,11 +2,12 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define ELM_WIDGET_PROTECTED
#define ELM_WIDGET_ITEM_PROTECTED
#define EFL_UI_TRANSLATABLE_PROTECTED
+#define EFL_PART_PROTECTED
#include <Elementary.h>
#include "elm_priv.h"
@@ -113,7 +114,7 @@ _timeout_cb(void *data, const Efl_Event *event EINA_UNUSED)
static void
_hide_effect_finished_cb(void *data, const Efl_Event *event EINA_UNUSED)
{
- efl_gfx_visible_set(data, EINA_FALSE);
+ efl_gfx_entity_visible_set(data, EINA_FALSE);
efl_event_callback_legacy_call(data, ELM_POPUP_EVENT_DISMISSED, NULL);
}
@@ -121,11 +122,13 @@ _hide_effect_finished_cb(void *data, const Efl_Event *event EINA_UNUSED)
static Evas_Object *
_access_object_get(const Evas_Object *obj, const char* part)
{
- Evas_Object *po, *ao;
+ Evas_Object *po, *ao, *o;
ELM_POPUP_DATA_GET(obj, sd);
- po = (Evas_Object *)edje_object_part_object_get
- (elm_layout_edje_get(sd->main_layout), part);
+ o = elm_layout_edje_get(sd->main_layout);
+ edje_object_freeze(o);
+ po = (Evas_Object *)edje_object_part_object_get(o, part);
+ edje_object_thaw(o);
ao = evas_object_data_get(po, "_part_access_obj");
return ao;
@@ -216,11 +219,22 @@ _items_remove(Elm_Popup_Data *sd)
if (!sd->items) return;
EINA_LIST_FREE(sd->items, it)
- elm_wdg_item_del(EO_OBJ(it));
+ efl_del(EO_OBJ(it));
sd->items = NULL;
}
+static void
+_focus_changed_popup(void *data, const Efl_Event *ev)
+{
+ //mirror property
+ efl_ui_focus_object_focus_set(data, efl_ui_focus_object_focus_get(ev->object));
+}
+
+EFL_CALLBACKS_ARRAY_DEFINE(composition_cb,
+ { EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED, _focus_changed_popup },
+)
+
EOLIAN static void
_elm_popup_efl_canvas_group_group_del(Eo *obj, Elm_Popup_Data *sd)
{
@@ -234,6 +248,7 @@ _elm_popup_efl_canvas_group_group_del(Eo *obj, Elm_Popup_Data *sd)
evas_object_event_callback_del
(sd->content, EVAS_CALLBACK_DEL, _on_content_del);
evas_object_event_callback_del(obj, EVAS_CALLBACK_SHOW, _on_show);
+ efl_event_callback_array_del(sd->notify, composition_cb(), obj);
sd->last_button_number = 0;
@@ -252,17 +267,17 @@ _elm_popup_efl_canvas_group_group_del(Eo *obj, Elm_Popup_Data *sd)
}
// XXX? delete other objects? just to be sure.
- ELM_SAFE_FREE(sd->main_layout, evas_object_del);
ELM_SAFE_FREE(sd->notify, evas_object_del);
ELM_SAFE_FREE(sd->title_icon, evas_object_del);
- ELM_SAFE_FREE(sd->content_area, evas_object_del);
ELM_SAFE_FREE(sd->text_content_obj, evas_object_del);
- ELM_SAFE_FREE(sd->action_area, evas_object_del);
ELM_SAFE_FREE(sd->box, evas_object_del);
ELM_SAFE_FREE(sd->tbl, evas_object_del);
ELM_SAFE_FREE(sd->spacer, evas_object_del);
ELM_SAFE_FREE(sd->scr, evas_object_del);
ELM_SAFE_FREE(sd->content, evas_object_del);
+ ELM_SAFE_FREE(sd->main_layout, evas_object_del);
+ ELM_SAFE_FREE(sd->content_area, evas_object_del);
+ ELM_SAFE_FREE(sd->action_area, evas_object_del);
ELM_SAFE_FREE(sd->title_text, eina_stringshare_del);
efl_canvas_group_del(efl_super(obj, MY_CLASS));
@@ -351,7 +366,7 @@ _populate_theme_scroll(Elm_Popup_Data *sd)
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_popup_elm_widget_theme_apply(Eo *obj, Elm_Popup_Data *sd)
+_elm_popup_efl_ui_widget_theme_apply(Eo *obj, Elm_Popup_Data *sd)
{
Elm_Popup_Item_Data *it;
Eina_List *elist;
@@ -488,6 +503,14 @@ _elm_popup_elm_layout_sizing_eval(Eo *obj, Elm_Popup_Data *sd)
else
evas_object_size_hint_min_set(sd->spacer, minw, minh);
+ if (sd->main_layout)
+ {
+ Evas *ev = evas_object_evas_get(sd->main_layout);
+ if (evas_smart_objects_calculating_get(ev))
+ evas_object_smart_calculate(sd->main_layout);
+ else
+ evas_object_smart_need_recalculate_set(sd->main_layout, EINA_TRUE);
+ }
return;
}
@@ -506,7 +529,7 @@ _elm_popup_efl_layout_signal_signal_emit(Eo *obj EINA_UNUSED, Elm_Popup_Data *sd
}
EOLIAN static Eina_Bool
-_elm_popup_elm_widget_widget_sub_object_del(Eo *obj, Elm_Popup_Data *sd, Evas_Object *sobj)
+_elm_popup_efl_ui_widget_widget_sub_object_del(Eo *obj, Elm_Popup_Data *sd, Evas_Object *sobj)
{
Elm_Popup_Item_Data *it;
Eina_Bool int_ret = EINA_FALSE;
@@ -765,7 +788,7 @@ _elm_popup_item_elm_widget_item_part_text_set(Eo *eo_it EINA_UNUSED, Elm_Popup_I
}
EOLIAN static const char *
-_elm_popup_item_elm_widget_item_part_text_get(Eo *eo_it EINA_UNUSED, Elm_Popup_Item_Data *it,
+_elm_popup_item_elm_widget_item_part_text_get(const Eo *eo_it EINA_UNUSED, Elm_Popup_Item_Data *it,
const char *part)
{
ELM_POPUP_ITEM_CHECK_OR_RETURN(it, NULL);
@@ -813,7 +836,7 @@ _elm_popup_item_elm_widget_item_part_content_set(Eo *eo_it EINA_UNUSED, Elm_Popu
}
EOLIAN static Evas_Object *
-_elm_popup_item_elm_widget_item_part_content_get(Eo *eo_it EINA_UNUSED, Elm_Popup_Item_Data *it,
+_elm_popup_item_elm_widget_item_part_content_get(const Eo *eo_it EINA_UNUSED, Elm_Popup_Item_Data *it,
const char *part)
{
ELM_POPUP_ITEM_CHECK_OR_RETURN(it, NULL);
@@ -922,7 +945,7 @@ _item_new(Elm_Popup_Item_Data *it)
{
char style[1024];
- VIEW(it) = elm_layout_add(WIDGET(it));
+ VIEW_SET(it, elm_layout_add(WIDGET(it)));
elm_object_focus_allow_set(VIEW(it), EINA_TRUE);
efl_ui_mirrored_automatic_set(VIEW(it), EINA_FALSE);
elm_object_mirrored_set(VIEW(it), elm_object_mirrored_get(WIDGET(it)));
@@ -1234,7 +1257,7 @@ _elm_popup_content_set(Eo *obj, Elm_Popup_Data *_pd EINA_UNUSED, const char *par
unsigned int i;
Eina_Bool ret = EINA_TRUE;
- if (!part || !strcmp(part, "default"))
+ if (!part || !strcmp(part, "elm.swallow.content"))
ret = _content_set(obj, content);
else if (!strcmp(part, "title,icon"))
ret = _title_icon_set(obj, content);
@@ -1295,7 +1318,7 @@ _elm_popup_content_get(Eo *obj, Elm_Popup_Data *_pd, const char *part)
Evas_Object *content = NULL;
unsigned int i;
- if (!part || !strcmp(part, "default"))
+ if (!part || !strcmp(part, "elm.swallow.content"))
content = _content_get(_pd);
else if (!strcmp(part, "title,text"))
content = _title_icon_get(_pd);
@@ -1363,7 +1386,7 @@ _elm_popup_content_unset(Eo *obj, Elm_Popup_Data *_pd EINA_UNUSED, const char *p
Evas_Object *content = NULL;
unsigned int i;
- if (!part || !strcmp(part, "default"))
+ if (!part || !strcmp(part, "elm.swallow.content"))
content = _content_unset(obj);
else if (!strcmp(part, "title,icon"))
content = _title_icon_unset(obj);
@@ -1422,6 +1445,7 @@ _elm_popup_efl_canvas_group_group_add(Eo *obj, Elm_Popup_Data *priv)
elm_object_mirrored_set(priv->notify, elm_object_mirrored_get(obj));
evas_object_event_callback_add(priv->notify, EVAS_CALLBACK_RESIZE, _notify_resize_cb, obj);
+ efl_event_callback_array_add(priv->notify, composition_cb(), obj);
priv->main_layout = elm_layout_add(obj);
if (!elm_layout_theme_set(priv->main_layout, "popup", "base",
@@ -1454,9 +1478,6 @@ _elm_popup_efl_canvas_group_group_add(Eo *obj, Elm_Popup_Data *priv)
priv->content_text_wrap_type = ELM_WRAP_MIXED;
efl_event_callback_array_add(priv->notify, _notify_cb(), obj);
- elm_widget_can_focus_set(obj, EINA_TRUE);
- elm_widget_can_focus_set(priv->main_layout, EINA_TRUE);
-
_populate_theme_scroll(priv);
_visuals_set(obj);
@@ -1484,7 +1505,7 @@ _parent_geom_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_i
}
EOLIAN static void
-_elm_popup_elm_widget_widget_parent_set(Eo *obj, Elm_Popup_Data *sd, Evas_Object *parent)
+_elm_popup_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Popup_Data *sd, Evas_Object *parent)
{
Evas_Coord x, y, w, h;
evas_object_geometry_get(parent, &x, &y, &w, &h);
@@ -1503,7 +1524,7 @@ _elm_popup_elm_widget_widget_parent_set(Eo *obj, Elm_Popup_Data *sd, Evas_Object
}
EOLIAN static void
-_elm_popup_elm_widget_on_access_update(Eo *obj, Elm_Popup_Data *_pd EINA_UNUSED, Eina_Bool is_access)
+_elm_popup_efl_ui_widget_on_access_update(Eo *obj, Elm_Popup_Data *_pd EINA_UNUSED, Eina_Bool is_access)
{
_access_obj_process(obj, is_access);
}
@@ -1526,7 +1547,7 @@ _elm_popup_efl_object_constructor(Eo *obj, Elm_Popup_Data *_pd EINA_UNUSED)
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_DIALOG);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_DIALOG);
return obj;
}
@@ -1543,7 +1564,7 @@ _elm_popup_content_text_wrap_type_set(Eo *obj EINA_UNUSED, Elm_Popup_Data *sd, E
}
EOLIAN static Elm_Wrap_Type
-_elm_popup_content_text_wrap_type_get(Eo *obj EINA_UNUSED, Elm_Popup_Data *sd)
+_elm_popup_content_text_wrap_type_get(const Eo *obj EINA_UNUSED, Elm_Popup_Data *sd)
{
return sd->content_text_wrap_type;
}
@@ -1641,7 +1662,7 @@ _elm_popup_orient_set(Eo *obj EINA_UNUSED, Elm_Popup_Data *sd, Elm_Popup_Orient
}
EOLIAN static Elm_Popup_Orient
-_elm_popup_orient_get(Eo *obj EINA_UNUSED, Elm_Popup_Data *sd)
+_elm_popup_orient_get(const Eo *obj EINA_UNUSED, Elm_Popup_Data *sd)
{
return (Elm_Popup_Orient)_elm_notify_orient_get(sd->notify);
}
@@ -1653,7 +1674,7 @@ _elm_popup_align_set(Eo *obj EINA_UNUSED, Elm_Popup_Data *sd, double horizontal,
}
EOLIAN static void
-_elm_popup_align_get(Eo *obj EINA_UNUSED, Elm_Popup_Data *sd, double *horizontal, double *vertical)
+_elm_popup_align_get(const Eo *obj EINA_UNUSED, Elm_Popup_Data *sd, double *horizontal, double *vertical)
{
elm_notify_align_get(sd->notify, horizontal, vertical);
}
@@ -1665,7 +1686,7 @@ _elm_popup_timeout_set(Eo *obj EINA_UNUSED, Elm_Popup_Data *sd, double timeout)
}
EOLIAN static double
-_elm_popup_timeout_get(Eo *obj EINA_UNUSED, Elm_Popup_Data *sd)
+_elm_popup_timeout_get(const Eo *obj EINA_UNUSED, Elm_Popup_Data *sd)
{
return elm_notify_timeout_get(sd->notify);
}
@@ -1679,7 +1700,7 @@ _elm_popup_allow_events_set(Eo *obj EINA_UNUSED, Elm_Popup_Data *sd, Eina_Bool a
}
EOLIAN static Eina_Bool
-_elm_popup_allow_events_get(Eo *obj EINA_UNUSED, Elm_Popup_Data *sd)
+_elm_popup_allow_events_get(const Eo *obj EINA_UNUSED, Elm_Popup_Data *sd)
{
return elm_notify_allow_events_get(sd->notify);
}
@@ -1759,7 +1780,7 @@ _elm_popup_scrollable_set(Eo *obj, Elm_Popup_Data *pd, Eina_Bool scroll)
}
EOLIAN Eina_Bool
-_elm_popup_scrollable_get(Eo *obj EINA_UNUSED, Elm_Popup_Data *pd)
+_elm_popup_scrollable_get(const Eo *obj EINA_UNUSED, Elm_Popup_Data *pd)
{
return pd->scroll;
}
@@ -1785,7 +1806,7 @@ _action_dismiss(Evas_Object *obj, const char *params EINA_UNUSED)
}
EOLIAN const Efl_Access_Action_Data *
-_elm_popup_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Popup_Data *pd)
+_elm_popup_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Elm_Popup_Data *pd)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "dismiss", NULL, NULL, _action_dismiss},
@@ -1797,10 +1818,10 @@ _elm_popup_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Pop
}
EOLIAN static Efl_Access_State_Set
-_elm_popup_efl_access_state_set_get(Eo *obj, Elm_Popup_Data *sd EINA_UNUSED)
+_elm_popup_efl_access_object_state_set_get(const Eo *obj, Elm_Popup_Data *sd EINA_UNUSED)
{
Efl_Access_State_Set ret;
- ret = efl_access_state_set_get(efl_super(obj, MY_CLASS));
+ ret = efl_access_object_state_set_get(efl_super(obj, MY_CLASS));
STATE_TYPE_SET(ret, EFL_ACCESS_STATE_MODAL);
@@ -1808,12 +1829,12 @@ _elm_popup_efl_access_state_set_get(Eo *obj, Elm_Popup_Data *sd EINA_UNUSED)
}
EOLIAN static const char*
-_elm_popup_efl_access_name_get(Eo *obj, Elm_Popup_Data *sd)
+_elm_popup_efl_access_object_i18n_name_get(const Eo *obj, Elm_Popup_Data *sd)
{
const char *name = NULL;
Eina_Strbuf *buf;
- name = efl_access_name_get(efl_super(obj, ELM_POPUP_CLASS));
+ name = efl_access_object_i18n_name_get(efl_super(obj, ELM_POPUP_CLASS));
if (name) return name;
buf = eina_strbuf_new();
@@ -1843,7 +1864,6 @@ ELM_PART_OVERRIDE_CONTENT_GET(elm_popup, ELM_POPUP, Elm_Popup_Data)
ELM_PART_OVERRIDE_CONTENT_UNSET(elm_popup, ELM_POPUP, Elm_Popup_Data)
ELM_PART_OVERRIDE_TEXT_SET(elm_popup, ELM_POPUP, Elm_Popup_Data)
ELM_PART_OVERRIDE_TEXT_GET(elm_popup, ELM_POPUP, Elm_Popup_Data)
-ELM_PART_CONTENT_DEFAULT_GET(elm_popup, "default")
#include "elm_popup_part.eo.c"
/* Efl.Part end */
@@ -1851,7 +1871,6 @@ ELM_PART_CONTENT_DEFAULT_GET(elm_popup, "default")
/* Internal EO APIs and hidden overrides */
#define ELM_POPUP_EXTRA_OPS \
- ELM_PART_CONTENT_DEFAULT_OPS(elm_popup), \
ELM_LAYOUT_SIZING_EVAL_OPS(elm_popup), \
EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_popup)
diff --git a/src/lib/elementary/elementary_config.h b/src/lib/elementary/elementary_config.h
index 38302542fa..c726711d94 100644
--- a/src/lib/elementary/elementary_config.h
+++ b/src/lib/elementary/elementary_config.h
@@ -10,12 +10,12 @@
#define ELM_CONFIG_ICON_THEME_ELEMENTARY "_Elementary_Icon_Theme"
#if defined(ELEMENTARY_BUILD) || defined(ELM_INTERNAL_API_ARGESFSDFEFC)
-#define ELM_WIDGET_PROTECTED
-#define ELM_WIDGET_BETA
+#define EFL_UI_WIDGET_PROTECTED
+#define EFL_UI_WIDGET_BETA
#define EFL_CANVAS_OBJECT_PROTECTED
#define EFL_CANVAS_GROUP_PROTECTED
#define EFL_CANVAS_GROUP_BETA
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#define EFL_ACCESS_COMPONENT_BETA
#define EFL_ACCESS_EDITABLE_TEXT_BETA
#define EFL_ACCESS_IMAGE_BETA
@@ -23,4 +23,5 @@
#define EFL_ACCESS_TEXT_BETA
#define EFL_ACCESS_VALUE_BETA
#define EFL_ACCESS_WIDGET_ACTION_BETA
+#define EFL_UI_FOCUS_OBJECT_PROTECTED
#endif
diff --git a/src/lib/elementary/elm_access.c b/src/lib/elementary/elm_access.c
index 5cf518f1a3..11247e4050 100644
--- a/src/lib/elementary/elm_access.c
+++ b/src/lib/elementary/elm_access.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#include <Elementary.h>
@@ -84,7 +84,7 @@ _access_action_callback_call(Evas_Object *obj,
}
EOLIAN static Eina_Bool
-_elm_access_elm_widget_on_access_activate(Eo *obj, void *_pd EINA_UNUSED, Efl_Ui_Activate act)
+_elm_access_efl_ui_widget_on_access_activate(Eo *obj, void *_pd EINA_UNUSED, Efl_Ui_Activate act)
{
int type = ELM_ACCESS_ACTION_FIRST;
@@ -145,7 +145,7 @@ _elm_access_elm_widget_on_access_activate(Eo *obj, void *_pd EINA_UNUSED, Efl_Ui
}
EOLIAN static Eina_Bool
-_elm_access_elm_widget_on_focus_update(Eo *obj, void *_pd EINA_UNUSED, Elm_Object_Item *item EINA_UNUSED)
+_elm_access_efl_ui_focus_object_on_focus_update(Eo *obj, void *_pd EINA_UNUSED)
{
evas_object_focus_set(obj, efl_ui_focus_object_focus_get(obj));
@@ -537,7 +537,7 @@ _access_highlight_next_get(Evas_Object *obj, Elm_Focus_Direction dir)
{
Efl_Ui_Focus_Relations *rel;
- rel = efl_ui_focus_manager_fetch(efl_ui_focus_user_focus_manager_get(obj), obj);
+ rel = efl_ui_focus_manager_fetch(efl_ui_focus_object_focus_manager_get(obj), obj);
if (rel)
{
@@ -1013,7 +1013,9 @@ _elm_access_edje_object_part_object_register(Evas_Object* obj,
{
Evas_Object *ao, *po;
+ edje_object_freeze((Evas_Object *)eobj);
po = (Evas_Object *)edje_object_part_object_get(eobj, part);
+ edje_object_thaw((Evas_Object *)eobj);
if (!obj || !po) return NULL;
/* check previous access object */
@@ -1034,7 +1036,9 @@ _elm_access_edje_object_part_object_unregister(Evas_Object* obj EINA_UNUSED,
{
Evas_Object *po;
+ edje_object_freeze((Evas_Object *)eobj);
po = (Evas_Object *)edje_object_part_object_get(eobj, part);
+ edje_object_thaw((Evas_Object *)eobj);
if (!po) return;
_access_object_unregister(po);
@@ -1505,7 +1509,7 @@ _access_atspi_action_do(Evas_Object *obj, const char *params)
}
EOLIAN const Efl_Access_Action_Data *
-_elm_access_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
+_elm_access_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "highlight", NULL, "highlight", _access_atspi_action_do},
@@ -1522,10 +1526,10 @@ _elm_access_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, void *
}
EOLIAN static Efl_Access_State_Set
-_elm_access_efl_access_state_set_get(Eo *obj, void *pd EINA_UNUSED)
+_elm_access_efl_access_object_state_set_get(const Eo *obj, void *pd EINA_UNUSED)
{
Efl_Access_State_Set ret;
- ret = efl_access_state_set_get(efl_super(obj, ELM_ACCESS_CLASS));
+ ret = efl_access_object_state_set_get(efl_super(obj, ELM_ACCESS_CLASS));
Elm_Access_Info *info = _elm_access_info_get(obj);
if (info && !evas_object_visible_get(info->part_object))
diff --git a/src/lib/elementary/elm_access.eo b/src/lib/elementary/elm_access.eo
index 10cb87d46c..fae20a694d 100644
--- a/src/lib/elementary/elm_access.eo
+++ b/src/lib/elementary/elm_access.eo
@@ -1,4 +1,4 @@
-class Elm.Access (Elm.Widget, Efl.Access.Widget.Action)
+class Elm.Access (Efl.Ui.Widget, Efl.Access.Widget.Action)
{
[[Elm abstract accessibility class]]
legacy_prefix: elm_access;
@@ -7,9 +7,9 @@ class Elm.Access (Elm.Widget, Efl.Access.Widget.Action)
implements {
class.constructor;
Efl.Object.constructor;
- Elm.Widget.on_access_activate;
- Elm.Widget.on_focus_update;
+ Efl.Ui.Widget.on_access_activate;
+ Efl.Ui.Focus.Object.on_focus_update;
Efl.Access.Widget.Action.elm_actions { get; }
- Efl.Access.state_set { get; }
+ Efl.Access.Object.state_set { get; }
}
}
diff --git a/src/lib/elementary/elm_actionslider.c b/src/lib/elementary/elm_actionslider.c
index 1fdbf2992d..7a6f50be37 100644
--- a/src/lib/elementary/elm_actionslider.c
+++ b/src/lib/elementary/elm_actionslider.c
@@ -2,8 +2,9 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define ELM_LAYOUT_PROTECTED
+#define EFL_PART_PROTECTED
#include <Elementary.h>
#include <math.h>
@@ -113,7 +114,7 @@ _mirroredness_change_eval(Evas_Object *obj)
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_actionslider_elm_widget_theme_apply(Eo *obj, Elm_Actionslider_Data *sd EINA_UNUSED)
+_elm_actionslider_efl_ui_widget_theme_apply(Eo *obj, Elm_Actionslider_Data *sd EINA_UNUSED)
{
Eina_Bool mirrored;
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
@@ -548,7 +549,7 @@ _elm_actionslider_efl_object_constructor(Eo *obj, Elm_Actionslider_Data *_pd EIN
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_SLIDER);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_SLIDER);
return obj;
}
@@ -571,7 +572,7 @@ _elm_actionslider_indicator_pos_set(Eo *obj, Elm_Actionslider_Data *_pd EINA_UNU
}
EOLIAN static Elm_Actionslider_Pos
-_elm_actionslider_indicator_pos_get(Eo *obj, Elm_Actionslider_Data *_pd EINA_UNUSED)
+_elm_actionslider_indicator_pos_get(const Eo *obj, Elm_Actionslider_Data *_pd EINA_UNUSED)
{
double position;
@@ -599,7 +600,7 @@ _elm_actionslider_magnet_pos_set(Eo *obj EINA_UNUSED, Elm_Actionslider_Data *sd,
}
EOLIAN static Elm_Actionslider_Pos
-_elm_actionslider_magnet_pos_get(Eo *obj EINA_UNUSED, Elm_Actionslider_Data *sd)
+_elm_actionslider_magnet_pos_get(const Eo *obj EINA_UNUSED, Elm_Actionslider_Data *sd)
{
return sd->magnet_position;
}
@@ -611,13 +612,13 @@ _elm_actionslider_enabled_pos_set(Eo *obj EINA_UNUSED, Elm_Actionslider_Data *sd
}
EOLIAN static Elm_Actionslider_Pos
-_elm_actionslider_enabled_pos_get(Eo *obj EINA_UNUSED, Elm_Actionslider_Data *sd)
+_elm_actionslider_enabled_pos_get(const Eo *obj EINA_UNUSED, Elm_Actionslider_Data *sd)
{
return sd->enabled_position;
}
EOLIAN static const char*
-_elm_actionslider_selected_label_get(Eo *obj, Elm_Actionslider_Data *sd)
+_elm_actionslider_selected_label_get(const Eo *obj, Elm_Actionslider_Data *sd)
{
const char *ret;
ret = NULL;
diff --git a/src/lib/elementary/elm_actionslider.eo b/src/lib/elementary/elm_actionslider.eo
index d400723c6e..07f7b09477 100644
--- a/src/lib/elementary/elm_actionslider.eo
+++ b/src/lib/elementary/elm_actionslider.eo
@@ -10,7 +10,7 @@ enum Elm.Actionslider.Pos
all = (1 << 3) - 1 [[All positions for left/center/right.]]
}
-class Elm.Actionslider (Efl.Ui.Layout, Efl.Ui.Selectable)
+class Elm.Actionslider (Efl.Ui.Layout.Object, Efl.Ui.Selectable, Efl.Ui.Legacy)
{
[[An actionslider is a switcher for 2 or 3 labels
@@ -71,10 +71,10 @@ class Elm.Actionslider (Efl.Ui.Layout, Efl.Ui.Selectable)
implements {
class.constructor;
Efl.Object.constructor;
- Elm.Widget.theme_apply;
- Efl.Part.part;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Part.part_get;
}
events {
- pos_changed; [[The position of the actionslider has changed]]
+ pos_changed: string; [[The position of the actionslider has changed]]
}
}
diff --git a/src/lib/elementary/elm_atspi_app_object.c b/src/lib/elementary/elm_atspi_app_object.c
index b1d45c1960..77cfe7f93c 100644
--- a/src/lib/elementary/elm_atspi_app_object.c
+++ b/src/lib/elementary/elm_atspi_app_object.c
@@ -2,7 +2,7 @@
#include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#include <Elementary.h>
#include "elm_widget.h"
@@ -26,7 +26,7 @@ _elm_atspi_app_object_efl_object_destructor(Eo *obj EINA_UNUSED, Elm_Atspi_App_O
}
EOLIAN static Eina_List*
-_elm_atspi_app_object_efl_access_children_get(Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *_pd EINA_UNUSED)
+_elm_atspi_app_object_efl_access_object_access_children_get(const Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *_pd EINA_UNUSED)
{
Eina_List *l, *accs = NULL;
Evas_Object *win;
@@ -34,9 +34,9 @@ _elm_atspi_app_object_efl_access_children_get(Eo *obj EINA_UNUSED, Elm_Atspi_App
EINA_LIST_FOREACH(_elm_win_list, l, win)
{
Efl_Access_Type type;
- if (!efl_isa(win, EFL_ACCESS_MIXIN))
+ if (!efl_isa(win, EFL_ACCESS_OBJECT_MIXIN))
continue;
- type = efl_access_type_get(win);
+ type = efl_access_object_access_type_get(win);
if (type == EFL_ACCESS_TYPE_REGULAR)
accs = eina_list_append(accs, win);
}
@@ -45,7 +45,7 @@ _elm_atspi_app_object_efl_access_children_get(Eo *obj EINA_UNUSED, Elm_Atspi_App
}
EOLIAN static const char*
-_elm_atspi_app_object_efl_access_name_get(Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *_pd EINA_UNUSED)
+_elm_atspi_app_object_efl_access_object_i18n_name_get(const Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *_pd EINA_UNUSED)
{
const char *ret;
ret = elm_app_name_get();
@@ -53,19 +53,19 @@ _elm_atspi_app_object_efl_access_name_get(Eo *obj EINA_UNUSED, Elm_Atspi_App_Obj
}
EOLIAN static const char*
-_elm_atspi_app_object_efl_access_description_get(Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *_pd)
+_elm_atspi_app_object_efl_access_object_description_get(const Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *_pd)
{
return _pd->descr;
}
EOLIAN static void
-_elm_atspi_app_object_efl_access_description_set(Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *_pd EINA_UNUSED, const char *descr)
+_elm_atspi_app_object_efl_access_object_description_set(Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *_pd EINA_UNUSED, const char *descr)
{
eina_stringshare_replace(&_pd->descr, descr);
}
EOLIAN static Efl_Access_Role
-_elm_atspi_app_object_efl_access_role_get(Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *_pd EINA_UNUSED)
+_elm_atspi_app_object_efl_access_object_role_get(const Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *_pd EINA_UNUSED)
{
return EFL_ACCESS_ROLE_APPLICATION;
}
diff --git a/src/lib/elementary/elm_atspi_app_object.eo b/src/lib/elementary/elm_atspi_app_object.eo
index 2d6bd1396f..1e79fcd493 100644
--- a/src/lib/elementary/elm_atspi_app_object.eo
+++ b/src/lib/elementary/elm_atspi_app_object.eo
@@ -1,13 +1,13 @@
-class Elm.Atspi.App.Object (Efl.Object, Efl.Access)
+class Elm.Atspi.App.Object (Efl.Object, Efl.Access.Object)
{
[[AT-SPI application object class]]
legacy_prefix: elm_atspi_app_object;
data: Elm_Atspi_App_Object_Data;
implements {
Efl.Object.destructor;
- Efl.Access.name { get; }
- Efl.Access.description { get; set; }
- Efl.Access.role { get; }
- Efl.Access.children { get; }
+ Efl.Access.Object.i18n_name { get; }
+ Efl.Access.Object.description { get; set; }
+ Efl.Access.Object.role { get; }
+ Efl.Access.Object.access_children { get; }
}
}
diff --git a/src/lib/elementary/elm_atspi_bridge.c b/src/lib/elementary/elm_atspi_bridge.c
index 09ea6a1693..cca6176dee 100644
--- a/src/lib/elementary/elm_atspi_bridge.c
+++ b/src/lib/elementary/elm_atspi_bridge.c
@@ -3,10 +3,9 @@
#endif
#define EFL_ACCESS_COMPONENT_PROTECTED
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_ACTION_PROTECTED
#define EFL_ACCESS_VALUE_PROTECTED
-#define EFL_ACCESS_IMAGE_PROTECTED
#define EFL_ACCESS_SELECTION_PROTECTED
#define EFL_ACCESS_TEXT_PROTECTED
#define EFL_ACCESS_EDITABLE_TEXT_PROTECTED
@@ -16,6 +15,7 @@
#include "atspi/atspi-constants.h"
#include <stdint.h>
+#include <assert.h>
#include <Elementary.h>
#include "elm_priv.h"
@@ -151,14 +151,14 @@ typedef struct {
} Elm_Atspi_Bridge_Event_Handler;
static const Elm_Atspi_Bridge_Event_Handler event_handlers[] = {
- { EFL_ACCESS_EVENT_CHILDREN_CHANGED, _children_changed_signal_send},
- { EFL_ACCESS_EVENT_PROPERTY_CHANGED, _property_changed_signal_send},
- { EFL_ACCESS_EVENT_BOUNDS_CHANGED, _bounds_changed_signal_send},
- { EFL_ACCESS_EVENT_STATE_CHANGED, _state_changed_signal_send},
- { EFL_ACCESS_EVENT_VISIBLE_DATA_CHANGED, _visible_data_changed_signal_send},
- { EFL_ACCESS_EVENT_ACTIVE_DESCENDANT_CHANGED, _active_descendant_changed_signal_send},
- { EFL_ACCESS_EVENT_ADDED, _on_object_add},
- { EFL_ACCESS_EVENT_REMOVED, _on_object_del},
+ { EFL_ACCESS_OBJECT_EVENT_CHILDREN_CHANGED, _children_changed_signal_send},
+ { EFL_ACCESS_OBJECT_EVENT_PROPERTY_CHANGED, _property_changed_signal_send},
+ { EFL_ACCESS_OBJECT_EVENT_BOUNDS_CHANGED, _bounds_changed_signal_send},
+ { EFL_ACCESS_OBJECT_EVENT_STATE_CHANGED, _state_changed_signal_send},
+ { EFL_ACCESS_OBJECT_EVENT_VISIBLE_DATA_CHANGED, _visible_data_changed_signal_send},
+ { EFL_ACCESS_OBJECT_EVENT_ACTIVE_DESCENDANT_CHANGED, _active_descendant_changed_signal_send},
+ { EFL_ACCESS_OBJECT_EVENT_ADDED, _on_object_add},
+ { EFL_ACCESS_OBJECT_EVENT_REMOVED, _on_object_del},
{ EFL_ACCESS_WINDOW_EVENT_WINDOW_CREATED, _window_signal_send},
{ EFL_ACCESS_WINDOW_EVENT_WINDOW_DESTROYED, _window_signal_send},
{ EFL_ACCESS_WINDOW_EVENT_WINDOW_ACTIVATED, _window_signal_send},
@@ -487,9 +487,9 @@ _accessible_get_role(const Eldbus_Service_Interface *iface, const Eldbus_Message
AtspiRole atspi_role = ATSPI_ROLE_INVALID;
Efl_Access_Role role;
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
- role = efl_access_role_get(obj);
+ role = efl_access_object_role_get(obj);
Eldbus_Message *ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
@@ -506,9 +506,9 @@ _accessible_get_role_name(const Eldbus_Service_Interface *iface, const Eldbus_Me
Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
Eo *obj = _bridge_object_from_path(bridge, obj_path);
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
- role_name = efl_access_role_name_get(obj);
+ role_name = efl_access_object_role_name_get(obj);
Eldbus_Message *ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
@@ -524,9 +524,9 @@ _accessible_get_localized_role_name(const Eldbus_Service_Interface *iface, const
Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
Eo *obj = _bridge_object_from_path(bridge, obj_path);
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
- l_role_name = efl_access_localized_role_name_get(obj);
+ l_role_name = efl_access_object_localized_role_name_get(obj);
EINA_SAFETY_ON_NULL_RETURN_VAL(l_role_name, NULL);
Eldbus_Message *ret = eldbus_message_method_return_new(msg);
@@ -547,9 +547,9 @@ _accessible_get_children(const Eldbus_Service_Interface *iface, const Eldbus_Mes
Eldbus_Message_Iter *iter, *iter_array;
Eo *children;
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
- children_list = efl_access_children_get(obj);
+ children_list = efl_access_object_access_children_get(obj);
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
@@ -582,13 +582,13 @@ _accessible_get_application(const Eldbus_Service_Interface *iface, const Eldbus_
Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
Eo *root, *obj = _bridge_object_from_path(bridge, obj_path);
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
Eldbus_Message_Iter *iter = eldbus_message_iter_get(ret);
- root = efl_access_root_get(EFL_ACCESS_MIXIN);
+ root = efl_access_object_access_root_get(EFL_ACCESS_OBJECT_MIXIN);
_bridge_iter_object_reference_append(bridge, iter, root);
return ret;
@@ -606,12 +606,12 @@ _accessible_attributes_get(const Eldbus_Service_Interface *iface, const Eldbus_M
Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
Eo *obj = _bridge_object_from_path(bridge, obj_path);
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
ret = eldbus_message_method_return_new(msg);
if (!ret) goto error;
- attrs = efl_access_attributes_get(obj);
+ attrs = efl_access_object_attributes_get(obj);
iter = eldbus_message_iter_get(ret);
if (!iter) goto error;
@@ -648,7 +648,7 @@ _accessible_interfaces_get(const Eldbus_Service_Interface *iface, const Eldbus_M
Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
Eo *obj = _bridge_object_from_path(bridge, obj_path);
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
@@ -718,7 +718,7 @@ _accessible_get_state(const Eldbus_Service_Interface *iface, const Eldbus_Messag
Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
Eo *obj = _bridge_object_from_path(bridge, obj_path);
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
@@ -727,7 +727,7 @@ _accessible_get_state(const Eldbus_Service_Interface *iface, const Eldbus_Messag
iter_array = eldbus_message_iter_container_new(iter, 'a', "u");
EINA_SAFETY_ON_NULL_GOTO(iter_array, fail);
- states = efl_access_state_set_get(obj);
+ states = efl_access_object_state_set_get(obj);
atspi_states = _elm_atspi_state_set_to_atspi_state_set(states);
@@ -754,12 +754,12 @@ _accessible_get_index_in_parent(const Eldbus_Service_Interface *iface EINA_UNUSE
Eldbus_Message *ret;
int idx = -1;
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
- idx = efl_access_index_in_parent_get(obj);
+ idx = efl_access_object_index_in_parent_get(obj);
eldbus_message_arguments_append(ret, "i", idx);
@@ -778,7 +778,7 @@ _accessible_child_at_index(const Eldbus_Service_Interface *iface EINA_UNUSED, co
Eldbus_Message *ret;
Eldbus_Message_Iter *iter;
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
if (!eldbus_message_arguments_get(msg, "i", &idx))
return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.InvalidArgs", "Invalid index type.");
@@ -787,7 +787,7 @@ _accessible_child_at_index(const Eldbus_Service_Interface *iface EINA_UNUSED, co
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
iter = eldbus_message_iter_get(ret);
- children = efl_access_children_get(obj);
+ children = efl_access_object_access_children_get(obj);
child = eina_list_nth(children, idx);
_bridge_iter_object_reference_append(bridge, iter, child);
@@ -805,11 +805,11 @@ _accessible_get_relation_set(const Eldbus_Service_Interface *iface EINA_UNUSED,
Eo *rel_obj, *obj = _bridge_object_from_path(bridge, obj_path);
Eldbus_Message *ret = NULL;
Eldbus_Message_Iter *iter = NULL, *iter_array = NULL, *iter_array2 = NULL, *iter_struct;
- Efl_Access_Relation *rel;
- Eina_List *l, *l2;
- Efl_Access_Relation_Set rels;
+ const Efl_Access_Relation *rel;
+ Eina_List *l;
+ Eina_Iterator *it;
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
@@ -818,15 +818,14 @@ _accessible_get_relation_set(const Eldbus_Service_Interface *iface EINA_UNUSED,
iter_array = eldbus_message_iter_container_new(iter, 'a', "(ua(so))");
EINA_SAFETY_ON_NULL_GOTO(iter_array, fail);
- rels = efl_access_relation_set_get(obj);
-
- EINA_LIST_FOREACH(rels, l, rel)
+ it = efl_access_object_relations_get(obj);
+ EINA_ITERATOR_FOREACH(it, rel)
{
iter_struct = eldbus_message_iter_container_new(iter_array, 'r', NULL);
eldbus_message_iter_basic_append(iter_struct, 'u', _elm_relation_to_atspi_relation(rel->type));
iter_array2 = eldbus_message_iter_container_new(iter_struct, 'a', "(so)");
EINA_SAFETY_ON_NULL_GOTO(iter_array2, fail);
- EINA_LIST_FOREACH(rel->objects, l2, rel_obj)
+ EINA_LIST_FOREACH(rel->objects, l, rel_obj)
{
_bridge_iter_object_reference_append(bridge, iter_array2, rel_obj);
_bridge_object_register(bridge, rel_obj);
@@ -834,7 +833,7 @@ _accessible_get_relation_set(const Eldbus_Service_Interface *iface EINA_UNUSED,
eldbus_message_iter_container_close(iter_struct, iter_array2);
eldbus_message_iter_container_close(iter_array, iter_struct);
}
- efl_access_relation_set_free(rels);
+ eina_iterator_free(it);
eldbus_message_iter_container_close(iter, iter_array);
return ret;
@@ -1216,14 +1215,12 @@ _image_extents_get(const Eldbus_Service_Interface *iface, const Eldbus_Message *
AtspiCoordType type;
Eldbus_Message *ret;
const char *obj_path = eldbus_message_path_get(msg);
- int x, y, w, h;
Eina_Bool screen_coords;
Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
Eo *obj = _bridge_object_from_path(bridge, obj_path);
+ Eina_Rect r;
- x = y = w = h = -1;
-
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_IMAGE_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
if (!eldbus_message_arguments_get(msg, "u", &type))
return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.InvalidArgs", "Invalid index type.");
@@ -1232,8 +1229,8 @@ _image_extents_get(const Eldbus_Service_Interface *iface, const Eldbus_Message *
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
screen_coords = type == ATSPI_COORD_TYPE_SCREEN ? EINA_TRUE : EINA_FALSE;
- efl_access_image_extents_get(obj, screen_coords, &x, &y, &w, &h);
- eldbus_message_arguments_append(ret, "iiii", x, y, w, h);
+ r = efl_access_component_extents_get(obj, screen_coords);
+ eldbus_message_arguments_append(ret, "iiii", r.x, r.y, r.w, r.h);
return ret;
}
@@ -1249,7 +1246,7 @@ _image_position_get(const Eldbus_Service_Interface *iface, const Eldbus_Message
int x = -1, y = -1;
Eina_Bool screen_coords;
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_IMAGE_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
if (!eldbus_message_arguments_get(msg, "u", &type))
return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.InvalidArgs", "Invalid index type.");
@@ -1258,7 +1255,10 @@ _image_position_get(const Eldbus_Service_Interface *iface, const Eldbus_Message
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
screen_coords = type == ATSPI_COORD_TYPE_SCREEN ? EINA_TRUE : EINA_FALSE;
- efl_access_image_extents_get(obj, screen_coords, &x, &y, NULL, NULL);
+ if (screen_coords)
+ efl_access_component_screen_position_get(obj, &x, &y);
+ else
+ evas_object_geometry_get(obj, &x, &y, NULL, NULL);
eldbus_message_arguments_append(ret, "i", x);
eldbus_message_arguments_append(ret, "i", y);
@@ -1274,12 +1274,12 @@ _image_size_get(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg
Eo *obj = _bridge_object_from_path(bridge, obj_path);
int w = -1, h = -1;
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_IMAGE_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
- efl_access_image_extents_get(obj, EINA_FALSE, NULL, NULL, &w, &h);
+ evas_object_geometry_get(obj, NULL, NULL, &w, &h);
eldbus_message_arguments_append(ret, "i", w);
eldbus_message_arguments_append(ret, "i", h);
@@ -1603,7 +1603,7 @@ _text_selection_get(const Eldbus_Service_Interface *iface, const Eldbus_Message
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
- efl_access_text_selection_get(obj, sel_num, &start, &end);
+ efl_access_text_access_selection_get(obj, sel_num, &start, &end);
eldbus_message_arguments_append(ret, "ii", start, end);
@@ -1678,7 +1678,7 @@ _text_selection_set(const Eldbus_Service_Interface *iface, const Eldbus_Message
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
- res = efl_access_text_selection_set(obj, sel_num, start, end);
+ res = efl_access_text_access_selection_set(obj, sel_num, start, end);
eldbus_message_arguments_append(ret, "b", res);
@@ -2028,7 +2028,7 @@ _bridge_object_from_path(Eo *bridge, const char *path)
tmp = path + len; /* Skip over the prefix */
if (!strcmp(ELM_ACCESS_OBJECT_PATH_ROOT, tmp))
{
- root = efl_access_root_get(EFL_ACCESS_MIXIN);
+ root = efl_access_object_access_root_get(EFL_ACCESS_OBJECT_MIXIN);
return root;
}
@@ -2042,7 +2042,7 @@ _bridge_object_from_path(Eo *bridge, const char *path)
return NULL;
}
- ret = efl_isa(eo, EFL_ACCESS_MIXIN) ? eo : NULL;
+ ret = efl_isa(eo, EFL_ACCESS_OBJECT_MIXIN) ? eo : NULL;
return ret;
}
@@ -2055,7 +2055,7 @@ _path_from_object(const Eo *eo)
if (!eo)
return ATSPI_DBUS_PATH_NULL;
- root = efl_access_root_get(EFL_ACCESS_MIXIN);
+ root = efl_access_object_access_root_get(EFL_ACCESS_OBJECT_MIXIN);
if (eo == root)
snprintf(path, sizeof(path), "%s%s", ELM_ACCESS_OBJECT_PATH_PREFIX, ELM_ACCESS_OBJECT_PATH_ROOT);
@@ -2073,11 +2073,11 @@ _accessible_property_get(const Eldbus_Service_Interface *interface, const char *
Eo *bridge = eldbus_service_object_data_get(interface, ELM_ATSPI_BRIDGE_CLASS_NAME);
Eo *ret_obj = NULL, *obj = _bridge_object_from_path(bridge, obj_path);
- ELM_ATSPI_PROPERTY_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, request_msg, error);
+ ELM_ATSPI_PROPERTY_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, request_msg, error);
if (!strcmp(property, "Name"))
{
- ret = efl_access_name_get(obj);
+ ret = efl_access_object_i18n_name_get(obj);
if (!ret)
ret = "";
eldbus_message_iter_basic_append(iter, 's', ret);
@@ -2085,7 +2085,7 @@ _accessible_property_get(const Eldbus_Service_Interface *interface, const char *
}
else if (!strcmp(property, "Description"))
{
- ret = efl_access_description_get(obj);
+ ret = efl_access_object_description_get(obj);
if (!ret)
ret = "";
eldbus_message_iter_basic_append(iter, 's', ret);
@@ -2093,9 +2093,9 @@ _accessible_property_get(const Eldbus_Service_Interface *interface, const char *
}
else if (!strcmp(property, "Parent"))
{
- ret_obj = efl_access_parent_get(obj);
+ ret_obj = efl_provider_find(efl_parent_get(obj), EFL_ACCESS_OBJECT_MIXIN);
Efl_Access_Role role = EFL_ACCESS_ROLE_INVALID;
- role = efl_access_role_get(obj);
+ role = efl_access_object_role_get(obj);
if ((!ret_obj) && (EFL_ACCESS_ROLE_APPLICATION == role))
_object_desktop_reference_append(iter);
else
@@ -2105,7 +2105,7 @@ _accessible_property_get(const Eldbus_Service_Interface *interface, const char *
else if (!strcmp(property, "ChildCount"))
{
Eina_List *l = NULL;
- l = efl_access_children_get(obj);
+ l = efl_access_object_access_children_get(obj);
eldbus_message_iter_basic_append(iter, 'i', eina_list_count(l));
eina_list_free(l);
return EINA_TRUE;
@@ -2233,18 +2233,18 @@ _image_properties_get(const Eldbus_Service_Interface *interface, const char *pro
Eo *bridge = eldbus_service_object_data_get(interface, ELM_ATSPI_BRIDGE_CLASS_NAME);
Eo *obj = _bridge_object_from_path(bridge, obj_path);
- ELM_ATSPI_PROPERTY_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_IMAGE_MIXIN, request_msg, error);
+ ELM_ATSPI_PROPERTY_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, request_msg, error);
if (!strcmp(property, "ImageDescription"))
{
- value = efl_access_image_description_get(obj);
+ value = efl_access_object_description_get(obj);
value = value ? value : "";
eldbus_message_iter_basic_append(iter, 's', value);
return EINA_TRUE;
}
if (!strcmp(property, "ImageLocale"))
{
- value = efl_access_image_locale_get(obj);
+ value = efl_access_object_translation_domain_get(obj);
value = value ? value : "";
eldbus_message_iter_basic_append(iter, 's', value);
return EINA_TRUE;
@@ -2574,7 +2574,7 @@ _collection_match_states_lookup(Eo *obj, struct collection_match_rule *rule)
Eina_Bool ret = EINA_FALSE;
Efl_Access_State_Set ss;
- ss = efl_access_state_set_get(obj);
+ ss = efl_access_object_state_set_get(obj);
switch (rule->statematchtype)
{
@@ -2604,7 +2604,7 @@ _collection_match_roles_lookup(Eo *obj, struct collection_match_rule *rule)
Efl_Access_Role role;
int64_t role_set;
- role = efl_access_role_get(obj);
+ role = efl_access_object_role_get(obj);
if (role >= 64)
{
@@ -2640,26 +2640,82 @@ _collection_match_roles_lookup(Eo *obj, struct collection_match_rule *rule)
}
static Eina_Bool
-_collection_match_attributes_helper(Eina_List *obj_attribs, Eina_List *attribs, Eina_Bool compare, Eina_Bool ret_if_compare, Eina_Bool ret_default)
+_collection_match_attributes_helper(Eina_List *obj_attribs, Eina_List *attribs, AtspiCollectionMatchType mode)
{
Eina_List *l, *l2;
Efl_Access_Attribute *attr, *attr2;
+ Eina_Bool obj_empty = eina_list_count(obj_attribs) == 0;
+ Eina_Bool empty = eina_list_count(attribs) == 0;
+ switch (mode)
+ {
+ case ATSPI_Collection_MATCH_ANY:
+ if (empty || obj_empty) return EINA_FALSE;
+ break;
+ case ATSPI_Collection_MATCH_ALL:
+ if (empty) return EINA_TRUE;
+ if (obj_empty) return EINA_FALSE;
+ break;
+ case ATSPI_Collection_MATCH_NONE:
+ if (empty || obj_empty) return EINA_TRUE;
+ break;
+ case ATSPI_Collection_MATCH_EMPTY:
+ if (empty && obj_empty) return EINA_TRUE;
+ if (empty || obj_empty) return EINA_FALSE;
+ break;
+ case ATSPI_Collection_MATCH_INVALID:
+ case ATSPI_Collection_MATCH_LAST_DEFINED:
+ assert(0);
+ break;
+ }
EINA_LIST_FOREACH(attribs, l, attr)
{
- EINA_LIST_FOREACH(obj_attribs, l2, attr2)
- {
- if ((attr->key && attr2->key &&
- attr->value && attr2->value &&
- !strcmp(attr->key, attr2->key) &&
- !strcmp(attr->value, attr2->value)) == compare)
- {
- return ret_if_compare;
- }
- }
+ Eina_Bool found = EINA_FALSE;
+ EINA_LIST_FOREACH(obj_attribs, l2, attr2)
+ {
+ Eina_Bool compare = (attr->key && attr2->key &&
+ attr->value && attr2->value &&
+ !strcmp(attr->key, attr2->key) &&
+ !strcmp(attr->value, attr2->value));
+ if (compare)
+ {
+ found = EINA_TRUE;
+ break;
+ }
+ }
+ switch (mode)
+ {
+ case ATSPI_Collection_MATCH_EMPTY:
+ case ATSPI_Collection_MATCH_ALL:
+ if (!found) return EINA_FALSE;
+ break;
+ case ATSPI_Collection_MATCH_ANY:
+ if (found) return EINA_TRUE;
+ break;
+ case ATSPI_Collection_MATCH_NONE:
+ if (found) return EINA_FALSE;
+ break;
+ case ATSPI_Collection_MATCH_INVALID:
+ case ATSPI_Collection_MATCH_LAST_DEFINED:
+ assert(0);
+ break;
+ }
}
- return ret_default;
+ switch (mode)
+ {
+ case ATSPI_Collection_MATCH_EMPTY:
+ case ATSPI_Collection_MATCH_ALL:
+ case ATSPI_Collection_MATCH_NONE:
+ return EINA_TRUE;
+ case ATSPI_Collection_MATCH_ANY:
+ return EINA_FALSE;
+ case ATSPI_Collection_MATCH_INVALID:
+ case ATSPI_Collection_MATCH_LAST_DEFINED:
+ assert(0);
+ break;
+ }
+ return EINA_FALSE;
}
static Eina_Bool
@@ -2668,7 +2724,7 @@ _collection_match_attributes_lookup(Eo *obj, struct collection_match_rule *rule)
Eina_Bool ret = EINA_FALSE;
Eina_List *obj_attribs;
- obj_attribs = efl_access_attributes_get(obj);
+ obj_attribs = efl_access_object_attributes_get(obj);
switch (rule->attributematchtype)
{
@@ -2676,18 +2732,13 @@ _collection_match_attributes_lookup(Eo *obj, struct collection_match_rule *rule)
ret = EINA_TRUE;
break;
case ATSPI_Collection_MATCH_ALL:
- ret = _collection_match_attributes_helper(
- obj_attribs, rule->attributes, EINA_FALSE, EINA_FALSE, EINA_TRUE);
- break;
case ATSPI_Collection_MATCH_ANY:
- ret = _collection_match_attributes_helper(
- obj_attribs, rule->attributes, EINA_TRUE, EINA_TRUE, EINA_FALSE);
- break;
case ATSPI_Collection_MATCH_NONE:
- ret = _collection_match_attributes_helper(
- obj_attribs, rule->attributes, EINA_TRUE, EINA_FALSE, EINA_TRUE);
+ case ATSPI_Collection_MATCH_EMPTY:
+ ret = _collection_match_attributes_helper(obj_attribs, rule->attributes, rule->attributematchtype);
break;
default:
+ DBG("invalid match type");
break;
}
@@ -2704,7 +2755,7 @@ _collection_sort_order_canonical(struct collection_match_rule *rule, Eina_List *
{
int i = index;
Eina_List *children;
- children = efl_access_children_get(obj);
+ children = efl_access_object_access_children_get(obj);
long acount = eina_list_count(children);
Eina_Bool prev = pobj ? EINA_TRUE : EINA_FALSE;
@@ -2768,21 +2819,21 @@ _collection_sort_order_reverse_canonical(struct collection_match_rule *rule, Ein
flag = EINA_TRUE;
/* Get the current nodes index in it's parent and the parent object. */
- indexinparent = efl_access_index_in_parent_get(obj);
- parent = efl_access_parent_get(obj);
+ indexinparent = efl_access_object_index_in_parent_get(obj);
+ parent = efl_provider_find(efl_parent_get(obj), EFL_ACCESS_OBJECT_MIXIN);
if ((indexinparent > 0) && ((max == 0) || (count < max)))
{
/* there are still some siblings to visit so get the previous sibling
and get it's last descendant.
First, get the previous sibling */
- children = efl_access_children_get(parent);
+ children = efl_access_object_access_children_get(parent);
nextobj = eina_list_nth(children, indexinparent - 1);
eina_list_free(children);
/* Now, drill down the right side to the last descendant */
do {
- children = efl_access_children_get(nextobj);
+ children = efl_access_object_access_children_get(nextobj);
if (children) nextobj = eina_list_last_data_get(children);
eina_list_free(children);
} while (children);
@@ -2825,8 +2876,8 @@ _collection_inorder(Eo *collection, struct collection_match_rule *rule, Eina_Lis
while ((max == 0 || count < max) && obj && obj != collection)
{
Eo *parent;
- parent = efl_access_parent_get(obj);
- idx = efl_access_index_in_parent_get(obj);
+ parent = efl_provider_find(efl_parent_get(obj), EFL_ACCESS_OBJECT_MIXIN);
+ idx = efl_access_object_index_in_parent_get(obj);
count = _collection_sort_order_canonical(rule, list, count, max, parent,
idx + 1, EINA_TRUE, NULL, EINA_TRUE, traverse);
obj = parent;
@@ -2902,8 +2953,8 @@ _collection_get_matches_from_handle(Eo *collection, Eo *current, struct collecti
result = eina_list_reverse(result);
break;
case ATSPI_Collection_TREE_RESTRICT_CHILDREN:
- idx = efl_access_index_in_parent_get(current);
- parent = efl_access_parent_get(current);
+ idx = efl_access_object_index_in_parent_get(current);
+ parent = efl_provider_find(efl_parent_get(current), EFL_ACCESS_OBJECT_MIXIN);
_collection_query(rule, sortby, &result, 0, max, parent, idx, EINA_FALSE, NULL, EINA_TRUE, traverse);
break;
case ATSPI_Collection_TREE_RESTRICT_SIBLING:
@@ -2931,7 +2982,7 @@ _collection_get_matches_from(const Eldbus_Service_Interface *iface EINA_UNUSED,
AtspiCollectionSortOrder sortby;
Eina_List *result = NULL;
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
iter = eldbus_message_iter_get(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(iter, NULL);
@@ -2943,7 +2994,7 @@ _collection_get_matches_from(const Eldbus_Service_Interface *iface EINA_UNUSED,
current = _bridge_object_from_path(bridge, obj_path);
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(current, EFL_ACCESS_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(current, EFL_ACCESS_OBJECT_MIXIN, msg);
if (!_collection_iter_match_rule_get(rule_iter, &rule))
return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.Failed", "Invalid match rule parameters.");
@@ -2964,7 +3015,7 @@ _collection_get_matches_to_handle(Eo *obj, Eo *current, struct collection_match_
Eo *collection = obj;
if (limit)
- collection = efl_access_parent_get(obj);
+ collection = efl_provider_find(efl_parent_get(obj), EFL_ACCESS_OBJECT_MIXIN);
switch (tree)
{
@@ -3003,7 +3054,7 @@ _collection_get_matches_to(const Eldbus_Service_Interface *iface EINA_UNUSED, co
Eina_List *result = NULL;
Eina_Bool limit;
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
iter = eldbus_message_iter_get(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(iter, NULL);
@@ -3015,7 +3066,7 @@ _collection_get_matches_to(const Eldbus_Service_Interface *iface EINA_UNUSED, co
current = _bridge_object_from_path(bridge, obj_path);
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(current, EFL_ACCESS_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(current, EFL_ACCESS_OBJECT_MIXIN, msg);
if (!_collection_iter_match_rule_get(rule_iter, &rule))
return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.Failed", "Invalid match rule parameters.");
@@ -3043,7 +3094,7 @@ _collection_get_matches(const Eldbus_Service_Interface *iface, const Eldbus_Mess
AtspiCollectionSortOrder sortby;
Eina_List *result = NULL;
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
iter = eldbus_message_iter_get(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(iter, NULL);
@@ -3117,7 +3168,7 @@ _iter_interfaces_append(Eldbus_Message_Iter *iter, const Eo *obj)
iter_array = eldbus_message_iter_container_new(iter, 'a', "s");
if (!iter_array) return;
- if (efl_isa(obj, EFL_ACCESS_MIXIN))
+ if (efl_isa(obj, EFL_ACCESS_OBJECT_MIXIN))
{
eldbus_message_iter_basic_append(iter_array, 's', ATSPI_DBUS_INTERFACE_ACCESSIBLE);
eldbus_message_iter_basic_append(iter_array, 's', ATSPI_DBUS_INTERFACE_COLLECTION);
@@ -3130,7 +3181,7 @@ _iter_interfaces_append(Eldbus_Message_Iter *iter, const Eo *obj)
eldbus_message_iter_basic_append(iter_array, 's', ATSPI_DBUS_INTERFACE_COMPONENT);
if (efl_isa(obj, EFL_ACCESS_EDITABLE_TEXT_INTERFACE))
eldbus_message_iter_basic_append(iter_array, 's', ATSPI_DBUS_INTERFACE_EDITABLE_TEXT);
- if (efl_isa(obj, EFL_ACCESS_IMAGE_MIXIN))
+ if (efl_isa(obj, EFL_ACCESS_OBJECT_MIXIN))
eldbus_message_iter_basic_append(iter_array, 's', ATSPI_DBUS_INTERFACE_IMAGE);
if (efl_isa(obj, EFL_ACCESS_SELECTION_INTERFACE))
eldbus_message_iter_basic_append(iter_array, 's', ATSPI_DBUS_INTERFACE_SELECTION);
@@ -3152,9 +3203,9 @@ _cache_item_reference_append_cb(Eo *bridge, Eo *data, Eldbus_Message_Iter *iter_
Efl_Access_State_Set states;
Efl_Access_Role role;
Eo *root;
- root = efl_access_root_get(EFL_ACCESS_MIXIN);
+ root = efl_access_object_access_root_get(EFL_ACCESS_OBJECT_MIXIN);
- role = efl_access_role_get(data);
+ role = efl_access_object_role_get(data);
iter_struct = eldbus_message_iter_container_new(iter_array, 'r', NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(iter_struct, EINA_TRUE);
@@ -3166,7 +3217,7 @@ _cache_item_reference_append_cb(Eo *bridge, Eo *data, Eldbus_Message_Iter *iter_
_bridge_iter_object_reference_append(bridge, iter_struct, root);
Eo *parent = NULL;
- parent = efl_access_parent_get(data);
+ parent = efl_provider_find(efl_parent_get(data), EFL_ACCESS_OBJECT_MIXIN);
/* Marshall parent */
if ((!parent) && (EFL_ACCESS_ROLE_APPLICATION == role))
_object_desktop_reference_append(iter_struct);
@@ -3177,7 +3228,7 @@ _cache_item_reference_append_cb(Eo *bridge, Eo *data, Eldbus_Message_Iter *iter_
Eina_List *children_list = NULL, *l;
Eo *child;
- children_list = efl_access_children_get(data);
+ children_list = efl_access_object_access_children_get(data);
iter_sub_array = eldbus_message_iter_container_new(iter_struct, 'a', "(so)");
EINA_SAFETY_ON_NULL_GOTO(iter_sub_array, fail);
@@ -3192,7 +3243,7 @@ _cache_item_reference_append_cb(Eo *bridge, Eo *data, Eldbus_Message_Iter *iter_
/* Marshall name */
const char *name = NULL;
- name = efl_access_name_get(data);
+ name = efl_access_object_i18n_name_get(data);
if (!name)
name = "";
@@ -3203,7 +3254,7 @@ _cache_item_reference_append_cb(Eo *bridge, Eo *data, Eldbus_Message_Iter *iter_
/* Marshall description */
const char* description = NULL;
- description = efl_access_description_get(data);
+ description = efl_access_object_description_get(data);
if (!description)
description = "";
eldbus_message_iter_basic_append(iter_struct, 's', description);
@@ -3212,7 +3263,7 @@ _cache_item_reference_append_cb(Eo *bridge, Eo *data, Eldbus_Message_Iter *iter_
iter_sub_array = eldbus_message_iter_container_new(iter_struct, 'a', "u");
EINA_SAFETY_ON_NULL_GOTO(iter_sub_array, fail);
- states = efl_access_state_set_get(data);
+ states = efl_access_object_state_set_get(data);
unsigned int s1 = states & 0xFFFFFFFF;
unsigned int s2 = (states >> 32) & 0xFFFFFFFF;
@@ -3249,7 +3300,7 @@ _cache_get_items(const Eldbus_Service_Interface *iface, const Eldbus_Message *ms
iter_array = eldbus_message_iter_container_new(iter, 'a', CACHE_ITEM_SIGNATURE);
EINA_SAFETY_ON_NULL_GOTO(iter_array, fail);
- root = efl_access_root_get(EFL_ACCESS_MIXIN);
+ root = efl_access_object_access_root_get(EFL_ACCESS_OBJECT_MIXIN);
to_process = eina_list_append(NULL, root);
while (to_process)
@@ -3260,7 +3311,7 @@ _cache_get_items(const Eldbus_Service_Interface *iface, const Eldbus_Message *ms
_bridge_object_register(bridge, obj);
Eina_List *children;
- children = efl_access_children_get(obj);
+ children = efl_access_object_access_children_get(obj);
to_process = eina_list_merge(to_process, children);
}
@@ -3388,7 +3439,7 @@ _component_get_position(const Eldbus_Service_Interface *iface EINA_UNUSED, const
const char *obj_path = eldbus_message_path_get(msg);
Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
Eo *obj = _bridge_object_from_path(bridge, obj_path);
- int x, y;
+ int x = 1, y = 1;
AtspiCoordType coord_type;
Eldbus_Message *ret;
@@ -3398,7 +3449,13 @@ _component_get_position(const Eldbus_Service_Interface *iface EINA_UNUSED, const
return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.InvalidArgs", "Invalid index type.");
Eina_Bool type = coord_type == ATSPI_COORD_TYPE_SCREEN ? EINA_TRUE : EINA_FALSE;
- efl_access_component_position_get(obj, type, &x, &y);
+ if (efl_gfx_entity_visible_get(obj))
+ {
+ if (type)
+ efl_access_component_screen_position_get(obj, &x, &y);
+ else
+ evas_object_geometry_get(obj, &x, &y, NULL, NULL);
+ }
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
@@ -3415,12 +3472,13 @@ _component_get_size(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eld
const char *obj_path = eldbus_message_path_get(msg);
Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
Eo *obj = _bridge_object_from_path(bridge, obj_path);
- int x, y;
+ int x = -1, y = -1;
Eldbus_Message *ret;
ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_COMPONENT_MIXIN, msg);
- efl_access_component_size_get(obj, &x, &y);
+ if (efl_gfx_entity_visible_get(obj))
+ evas_object_geometry_get(obj, NULL, NULL, &x, &y);
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
@@ -3447,13 +3505,14 @@ _component_get_layer(const Eldbus_Service_Interface *iface EINA_UNUSED, const El
const char *obj_path = eldbus_message_path_get(msg);
Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
Eo *obj = _bridge_object_from_path(bridge, obj_path);
- int layer = 0;
+ int layer = -1;
Eldbus_Message *ret;
AtspiComponentLayer atspi_layer;
ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_COMPONENT_MIXIN, msg);
- layer = efl_access_component_layer_get(obj);
+ if (efl_gfx_entity_visible_get(obj))
+ layer = evas_object_layer_get(obj);
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
@@ -3493,12 +3552,17 @@ _component_get_alpha(const Eldbus_Service_Interface *iface EINA_UNUSED, const El
Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
Eo *obj = _bridge_object_from_path(bridge, obj_path);
Eldbus_Message *ret;
- double alpha = 0;
+ double alpha = -1;
+ int a;
if (!obj)
return _dbus_invalid_ref_error_new(msg);
- alpha = efl_access_component_alpha_get(obj);
+ if (efl_gfx_entity_visible_get(obj))
+ {
+ evas_object_color_get(obj, NULL, NULL, NULL, &a);
+ alpha = a / 255.0;
+ }
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
@@ -3541,7 +3605,7 @@ _component_set_position(const Eldbus_Service_Interface *iface EINA_UNUSED, const
const char *obj_path = eldbus_message_path_get(msg);
Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
Eo *obj = _bridge_object_from_path(bridge, obj_path);
- int x, y;
+ int x = -1, y = -1;
Eina_Bool result = EINA_FALSE;
AtspiCoordType coord_type;
Eldbus_Message *ret;
@@ -3552,7 +3616,16 @@ _component_set_position(const Eldbus_Service_Interface *iface EINA_UNUSED, const
return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.InvalidArgs", "Invalid index type.");
Eina_Bool type = coord_type == ATSPI_COORD_TYPE_SCREEN ? EINA_TRUE : EINA_FALSE;
- result = efl_access_component_position_set(obj, type, x, y);
+ if (efl_gfx_entity_visible_get(obj))
+ {
+ if (type)
+ result = efl_access_component_screen_position_set(obj, x, y);
+ else
+ {
+ result = EINA_TRUE;
+ evas_object_move(obj, x, y);
+ }
+ }
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
@@ -3569,7 +3642,7 @@ _component_set_size(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eld
Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
Eo *obj = _bridge_object_from_path(bridge, obj_path);
int w, h;
- Eina_Bool result;
+ Eina_Bool result = EINA_TRUE;
Eldbus_Message *ret;
ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_COMPONENT_MIXIN, msg);
@@ -3577,7 +3650,7 @@ _component_set_size(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eld
if (!eldbus_message_arguments_get(msg, "ii", &w, &h))
return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.InvalidArgs", "Invalid index type.");
- result = efl_access_component_size_set(obj, w, h);
+ evas_object_resize(obj, w, h);
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
@@ -3632,7 +3705,7 @@ _elm_atspi_bridge_app_register(Eo *bridge)
"Embed");
Eldbus_Message_Iter *iter = eldbus_message_iter_get(message);
- root = efl_access_root_get(EFL_ACCESS_MIXIN);
+ root = efl_access_object_access_root_get(EFL_ACCESS_OBJECT_MIXIN);
_bridge_iter_object_reference_append(bridge, iter, root);
eldbus_connection_send(pd->a11y_bus, message, _on_elm_atspi_bridge_app_register, NULL, -1);
@@ -3645,7 +3718,7 @@ _elm_atspi_bridge_app_unregister(Eo *bridge)
Eo *root;
ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN_VAL(bridge, pd, EINA_FALSE);
- root = efl_access_root_get(EFL_ACCESS_MIXIN);
+ root = efl_access_object_access_root_get(EFL_ACCESS_OBJECT_MIXIN);
Eldbus_Message *message = eldbus_message_method_call_new(ATSPI_DBUS_NAME_REGISTRY,
ATSPI_DBUS_PATH_ROOT,
@@ -3863,7 +3936,7 @@ _property_changed_signal_send(void *data, const Efl_Event *event)
prop = ATSPI_OBJECT_PROPERTY_PARENT;
atspi_desc = "accessible-parent";
}
- else if (!strcmp(property, "name"))
+ else if (!strcmp(property, "i18n_name"))
{
prop = ATSPI_OBJECT_PROPERTY_NAME;
atspi_desc = "accessible-name";
@@ -3930,7 +4003,7 @@ _active_descendant_changed_signal_send(void *data, const Efl_Event *event)
return;
}
- idx = efl_access_index_in_parent_get(child);
+ idx = efl_access_object_index_in_parent_get(child);
_bridge_signal_send(data, event->object, ATSPI_DBUS_INTERFACE_EVENT_OBJECT,
&_event_obj_signals[ATSPI_OBJECT_EVENT_ACTIVE_DESCENDANT_CHANGED], "",
@@ -3964,7 +4037,7 @@ _children_changed_signal_send(void *data, const Efl_Event *event)
return;
}
- idx = efl_access_index_in_parent_get(ev_data->child);
+ idx = efl_access_object_index_in_parent_get(ev_data->child);
_bridge_signal_send(data, event->object, ATSPI_DBUS_INTERFACE_EVENT_OBJECT,
&_event_obj_signals[ATSPI_OBJECT_EVENT_CHILDREN_CHANGED], atspi_desc,
idx, 0, "(so)", eldbus_connection_unique_name_get(pd->a11y_bus), ev_data->child);
@@ -4045,7 +4118,7 @@ static void _bridge_signal_send(Eo *bridge, Eo *obj, const char *infc, const Eld
ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN(bridge, pd);
path = _path_from_object(obj);
- root = efl_access_root_get(EFL_ACCESS_MIXIN);
+ root = efl_access_object_access_root_get(EFL_ACCESS_OBJECT_MIXIN);
msg = eldbus_message_signal_new(path, infc, signal->name);
if (!msg) return;
@@ -4295,7 +4368,7 @@ _a11y_connection_shutdown(Eo *bridge)
if (pd->event_hash) eina_hash_free(pd->event_hash);
pd->event_hash = NULL;
- efl_access_event_handler_del(EFL_ACCESS_MIXIN, pd->event_hdlr);
+ efl_access_object_event_handler_del(EFL_ACCESS_OBJECT_MIXIN, pd->event_hdlr);
pd->event_hdlr = NULL;
efl_event_callback_legacy_call(bridge, ELM_ATSPI_BRIDGE_EVENT_DISCONNECTED, NULL);
@@ -4387,7 +4460,7 @@ _a11y_bus_initialize(Eo *obj, const char *socket_addr)
_elm_atspi_bridge_app_register(obj);
// register accessible object event listener
- pd->event_hdlr = efl_access_event_handler_add(EFL_ACCESS_MIXIN, _bridge_accessible_event_dispatch, obj);
+ pd->event_hdlr = efl_access_object_event_handler_add(EFL_ACCESS_OBJECT_MIXIN, _bridge_accessible_event_dispatch, obj);
}
static void
@@ -4465,9 +4538,9 @@ static void _bridge_object_register(Eo *bridge, Eo *obj)
{
ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN(bridge, pd);
- if (!efl_isa(obj, EFL_ACCESS_MIXIN))
+ if (!efl_isa(obj, EFL_ACCESS_OBJECT_MIXIN))
{
- WRN("Unable to register class w/o Efl_Access!");
+ WRN("Unable to register class w/o Efl_Access_Object!");
return;
}
@@ -4482,7 +4555,7 @@ _elm_atspi_bridge_init(void)
{
if (!_init_count)
{
- _instance = efl_add(ELM_ATSPI_BRIDGE_CLASS, NULL);
+ _instance = efl_add_ref(ELM_ATSPI_BRIDGE_CLASS, NULL);
_init_count = 1;
}
}
@@ -4498,7 +4571,7 @@ _elm_atspi_bridge_shutdown(void)
{
if (_init_count)
{
- efl_del(_instance);
+ efl_unref(_instance);
_init_count = 0;
}
_efl_access_shutdown();
@@ -4654,7 +4727,7 @@ _elm_atspi_bridge_key_filter(void *data, void *loop EINA_UNUSED, int type, void
}
EOLIAN Eina_Bool
-_elm_atspi_bridge_connected_get(Eo *obj EINA_UNUSED, Elm_Atspi_Bridge_Data *pd)
+_elm_atspi_bridge_connected_get(const Eo *obj EINA_UNUSED, Elm_Atspi_Bridge_Data *pd)
{
return pd->connected;
}
diff --git a/src/lib/elementary/elm_atspi_bridge.eo b/src/lib/elementary/elm_atspi_bridge.eo
index c1e7e5d024..9db28c26de 100644
--- a/src/lib/elementary/elm_atspi_bridge.eo
+++ b/src/lib/elementary/elm_atspi_bridge.eo
@@ -19,7 +19,7 @@ class Elm.Atspi.Bridge (Efl.Object)
Efl.Object.destructor;
}
events {
- connected; [[Connected with AT-SPI2 bus]]
- disconnected; [[Disconnected from AT-SPI2 bus]]
+ connected: void; [[Connected with AT-SPI2 bus]]
+ disconnected: void; [[Disconnected from AT-SPI2 bus]]
}
}
diff --git a/src/lib/elementary/elm_bg_legacy.h b/src/lib/elementary/elm_bg_legacy.h
index 8110c80d0f..66f56e7501 100644
--- a/src/lib/elementary/elm_bg_legacy.h
+++ b/src/lib/elementary/elm_bg_legacy.h
@@ -1,3 +1,5 @@
+typedef Eo Elm_Bg;
+
/**
* @brief Identifiers on how a background widget is to display its image
*
@@ -18,7 +20,7 @@
} Elm_Bg_Option;
/**
- * Add a new background to the parent
+ * @brief Adds a new background to the parent
*
* @param parent The parent object
* @return The new object or @c NULL if it cannot be created
@@ -28,7 +30,7 @@
EAPI Evas_Object *elm_bg_add(Evas_Object *parent);
/**
- * Set the color on a given background widget
+ * @brief Sets the color on a given background widget
*
* @param obj The background object handle
* @param r The red color component's value
@@ -51,7 +53,7 @@ EAPI Evas_Object *elm_bg_add(Evas_Object *parent);
EAPI void elm_bg_color_set(Evas_Object *obj, int r, int g, int b);
/**
- * Get the color set on a given background widget
+ * @brief Gets the color set on a given background widget
*
* @param obj The background object handle
* @param r Where to store the red color component's value
@@ -68,7 +70,7 @@ EAPI void elm_bg_color_set(Evas_Object *obj, int r, int
EAPI void elm_bg_color_get(const Evas_Object *obj, int *r, int *g, int *b);
/**
- * Set the file (image or edje collection) to give life for the
+ * @brief Sets the file (image or edje collection) to give life for the
* background
*
* @return @c EINA_TRUE on success, @c EINA_FALSE otherwise
@@ -98,7 +100,7 @@ EAPI void elm_bg_color_get(const Evas_Object *obj, int *
EAPI Eina_Bool elm_bg_file_set(Eo *obj, const char *file, const char *group);
/**
- * Get the file (image or edje collection) set on a given background
+ * @brief Gets the file (image or edje collection) set on a given background
* widget
*
* @note Use @c NULL pointers on the file components you're not
@@ -113,7 +115,7 @@ EAPI Eina_Bool elm_bg_file_set(Eo *obj, const char *file, const char *group);
EAPI void elm_bg_file_get(const Eo *obj, const char **file, const char **group);
/**
- * Set the mode of display for a given background widget's image
+ * @brief Sets the mode of display for a given background widget's image
*
* This sets how the background widget will display its image. This
* will only work if the elm_bg_file_set() was previously called with
@@ -129,7 +131,7 @@ EAPI void elm_bg_file_get(const Eo *obj, const char **file, const char **group);
EAPI void elm_bg_option_set(Evas_Object *obj, Elm_Bg_Option option);
/**
- * Get the mode of display of a given background widget's image
+ * @brief Gets the mode of display of a given background widget's image
*
* @return The background option Elm.Bg.Option Default is #Elm_Bg_SCALE.
*
@@ -140,7 +142,7 @@ EAPI void elm_bg_option_set(Evas_Object *obj, Elm_Bg_Option option);
EAPI Elm_Bg_Option elm_bg_option_get(const Evas_Object *obj);
/**
- * Set the size of the pixmap representation of the image set on a
+ * @brief Sets the size of the pixmap representation of the image set on a
* given background widget.
*
* @warning: This function just makes sense if an image file was set on
diff --git a/src/lib/elementary/elm_box.c b/src/lib/elementary/elm_box.c
index 6b4a8868d7..dd8509e7ae 100644
--- a/src/lib/elementary/elm_box.c
+++ b/src/lib/elementary/elm_box.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_UI_FOCUS_COMPOSITION_PROTECTED
#include <Elementary.h>
@@ -27,14 +27,14 @@ static void
_elm_box_efl_ui_focus_composition_prepare(Eo *obj, Elm_Box_Data *pd EINA_UNUSED)
{
Eina_List *n, *nn;
- Elm_Widget *elem;
+ Efl_Ui_Widget *elem;
- Elm_Widget_Smart_Data *wpd = efl_data_scope_get(obj, ELM_WIDGET_CLASS);
+ Elm_Widget_Smart_Data *wpd = efl_data_scope_get(obj, EFL_UI_WIDGET_CLASS);
Eina_List *order = evas_object_box_children_get(wpd->resize_obj);
EINA_LIST_FOREACH_SAFE(order, n, nn, elem)
{
- if (!efl_isa(elem, ELM_WIDGET_CLASS))
+ if (!efl_isa(elem, EFL_UI_WIDGET_CLASS))
order = eina_list_remove(order, elem);
}
@@ -58,7 +58,7 @@ _child_removed_cb_proxy(void *data, const Efl_Event *event)
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_box_elm_widget_theme_apply(Eo *obj, Elm_Box_Data *sd EINA_UNUSED)
+_elm_box_efl_ui_widget_theme_apply(Eo *obj, Elm_Box_Data *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
@@ -97,7 +97,7 @@ _on_size_hints_changed(void *data,
}
EOLIAN static Eina_Bool
-_elm_box_elm_widget_widget_sub_object_del(Eo *obj, Elm_Box_Data *_pd EINA_UNUSED, Evas_Object *child)
+_elm_box_efl_ui_widget_widget_sub_object_del(Eo *obj, Elm_Box_Data *_pd EINA_UNUSED, Evas_Object *child)
{
Eina_Bool int_ret = EINA_FALSE;
@@ -375,8 +375,8 @@ _elm_box_efl_object_constructor(Eo *obj, Elm_Box_Data *_pd EINA_UNUSED)
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_type_set(obj, EFL_ACCESS_TYPE_SKIPPED);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_FILLER);
+ efl_access_object_access_type_set(obj, EFL_ACCESS_TYPE_SKIPPED);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_FILLER);
return obj;
}
@@ -391,7 +391,7 @@ _elm_box_horizontal_set(Eo *obj, Elm_Box_Data *sd, Eina_Bool horizontal)
}
EOLIAN static Eina_Bool
-_elm_box_horizontal_get(Eo *obj EINA_UNUSED, Elm_Box_Data *sd)
+_elm_box_horizontal_get(const Eo *obj EINA_UNUSED, Elm_Box_Data *sd)
{
return sd->horizontal;
}
@@ -406,7 +406,7 @@ _elm_box_homogeneous_set(Eo *obj, Elm_Box_Data *sd, Eina_Bool homogeneous)
}
EOLIAN static Eina_Bool
-_elm_box_homogeneous_get(Eo *obj EINA_UNUSED, Elm_Box_Data *sd)
+_elm_box_homogeneous_get(const Eo *obj EINA_UNUSED, Elm_Box_Data *sd)
{
return sd->homogeneous;
}
@@ -604,7 +604,7 @@ elm_box_transition_free(void *data)
}
EOLIAN static Eina_List*
-_elm_box_children_get(Eo *obj, Elm_Box_Data *_pd EINA_UNUSED)
+_elm_box_children_get(const Eo *obj, Elm_Box_Data *_pd EINA_UNUSED)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
return evas_object_box_children_get(wd->resize_obj);
@@ -620,7 +620,7 @@ _elm_box_padding_set(Eo *obj, Elm_Box_Data *_pd EINA_UNUSED, Evas_Coord horizont
}
EOLIAN static void
-_elm_box_padding_get(Eo *obj, Elm_Box_Data *_pd EINA_UNUSED, Evas_Coord *horizontal, Evas_Coord *vertical)
+_elm_box_padding_get(const Eo *obj, Elm_Box_Data *_pd EINA_UNUSED, Evas_Coord *horizontal, Evas_Coord *vertical)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
evas_object_box_padding_get
@@ -636,7 +636,7 @@ _elm_box_align_set(Eo *obj, Elm_Box_Data *_pd EINA_UNUSED, double horizontal, do
}
EOLIAN static void
-_elm_box_align_get(Eo *obj, Elm_Box_Data *_pd EINA_UNUSED, double *horizontal, double *vertical)
+_elm_box_align_get(const Eo *obj, Elm_Box_Data *_pd EINA_UNUSED, double *horizontal, double *vertical)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
diff --git a/src/lib/elementary/elm_box.eo b/src/lib/elementary/elm_box.eo
index 8822c1cc5b..36bdd9d7bc 100644
--- a/src/lib/elementary/elm_box.eo
+++ b/src/lib/elementary/elm_box.eo
@@ -1,6 +1,4 @@
-import evas_box;
-
-class Elm.Box (Elm.Widget, Efl.Ui.Focus.Composition)
+class Elm.Box (Efl.Ui.Widget, Efl.Ui.Focus.Composition, Efl.Ui.Legacy)
{
[[Elementary box class]]
legacy_prefix: elm_box;
@@ -249,12 +247,12 @@ class Elm.Box (Elm.Widget, Efl.Ui.Focus.Composition)
class.constructor;
Efl.Object.constructor;
Efl.Canvas.Group.group_calculate;
- Elm.Widget.theme_apply;
- Elm.Widget.widget_sub_object_del;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.widget_sub_object_del;
Efl.Ui.Focus.Composition.prepare;
}
events {
- child,added; [[Called when child was added]]
- child,removed; [[Called when child was removed]]
+ child,added: Efl.Object; [[Called when child was added]]
+ child,removed: Efl.Object; [[Called when child was removed]]
}
}
diff --git a/src/lib/elementary/elm_bubble.c b/src/lib/elementary/elm_bubble.c
index 7747809f70..a882a2e567 100644
--- a/src/lib/elementary/elm_bubble.c
+++ b/src/lib/elementary/elm_bubble.c
@@ -2,8 +2,9 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define ELM_LAYOUT_PROTECTED
+#define EFL_PART_PROTECTED
#include <Elementary.h>
#include "elm_priv.h"
@@ -173,7 +174,7 @@ _elm_bubble_efl_canvas_group_group_add(Eo *obj, Elm_Bubble_Data *priv)
}
EOLIAN static void
-_elm_bubble_elm_widget_on_access_update(Eo *obj, Elm_Bubble_Data *_pd EINA_UNUSED, Eina_Bool is_access)
+_elm_bubble_efl_ui_widget_on_access_update(Eo *obj, Elm_Bubble_Data *_pd EINA_UNUSED, Eina_Bool is_access)
{
ELM_BUBBLE_CHECK(obj);
@@ -196,7 +197,7 @@ _elm_bubble_efl_object_constructor(Eo *obj, Elm_Bubble_Data *_pd EINA_UNUSED)
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_FILLER);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_FILLER);
return obj;
}
@@ -216,7 +217,7 @@ _elm_bubble_pos_set(Eo *obj, Elm_Bubble_Data *sd, Elm_Bubble_Pos pos)
}
EOLIAN static Elm_Bubble_Pos
-_elm_bubble_pos_get(Eo *obj EINA_UNUSED, Elm_Bubble_Data *sd)
+_elm_bubble_pos_get(const Eo *obj EINA_UNUSED, Elm_Bubble_Data *sd)
{
return sd->pos;
}
diff --git a/src/lib/elementary/elm_bubble.eo b/src/lib/elementary/elm_bubble.eo
index df62e212ef..8905759303 100644
--- a/src/lib/elementary/elm_bubble.eo
+++ b/src/lib/elementary/elm_bubble.eo
@@ -12,7 +12,7 @@ enum Elm.Bubble.Pos
bottom_right [[The arrow of the bubble points to the bottom right corner.]]
}
-class Elm.Bubble (Efl.Ui.Layout, Efl.Ui.Clickable)
+class Elm.Bubble (Efl.Ui.Layout.Object, Efl.Ui.Clickable, Efl.Ui.Legacy)
{
[[Speech bubble widget used in messaging applications]]
@@ -38,7 +38,7 @@ class Elm.Bubble (Efl.Ui.Layout, Efl.Ui.Clickable)
implements {
class.constructor;
Efl.Object.constructor;
- Elm.Widget.on_access_update;
- Efl.Part.part;
+ Efl.Ui.Widget.on_access_update;
+ Efl.Part.part_get;
}
}
diff --git a/src/lib/elementary/elm_button_legacy.h b/src/lib/elementary/elm_button_legacy.h
index 05760f82db..be2beab1b1 100644
--- a/src/lib/elementary/elm_button_legacy.h
+++ b/src/lib/elementary/elm_button_legacy.h
@@ -1,3 +1,5 @@
+typedef Eo Elm_Button;
+
/**
* Add a new button to the parent's canvas
*
diff --git a/src/lib/elementary/elm_calendar.c b/src/lib/elementary/elm_calendar.c
index 2aff58223b..e8bf210c0f 100644
--- a/src/lib/elementary/elm_calendar.c
+++ b/src/lib/elementary/elm_calendar.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define EFL_UI_FOCUS_COMPOSITION_PROTECTED
#define EFL_UI_FOCUS_OBJECT_PROTECTED
@@ -23,6 +23,22 @@
#define ELM_CALENDAR_BUTTON_YEAR_LEFT "elm,calendar,button_year,left"
#define ELM_CALENDAR_BUTTON_YEAR_RIGHT "elm,calendar,button_year,right"
+#define ELM_CALENDAR_CH_TEXT_PART_STR "elm.ch_%d.text"
+#define ELM_CALENDAR_CIT_TEXT_PART_STR "elm.cit_%d.text"
+#define ELM_CALENDAR_CIT_ACCESS_PART_STR "elm.cit_%d.access"
+
+static void _part_name_snprintf(char *buffer, int buffer_size,
+ const Evas_Object *obj, const char *template, int n)
+{
+ snprintf(buffer, buffer_size, template, n);
+ if (!edje_object_part_exists (obj, buffer))
+ {
+ // Skip the namespace prefix "elm." which was not present
+ // in previous versions
+ snprintf(buffer, buffer_size, template + 4, n);
+ }
+}
+
static const char SIG_CHANGED[] = "changed";
static const char SIG_DISPLAY_CHANGED[] = "display,changed";
@@ -345,7 +361,7 @@ static void
_access_calendar_item_register(Evas_Object *obj)
{
unsigned int maxdays, i;
- char day_s[13], pname[14];
+ char day_s[13], pname[18];
unsigned day = 0;
Evas_Object *ao;
@@ -357,7 +373,8 @@ _access_calendar_item_register(Evas_Object *obj)
if ((!day) && (i == sd->first_day_it)) day = 1;
if ((day) && (day <= maxdays))
{
- snprintf(pname, sizeof(pname), "cit_%i.access", i);
+ _part_name_snprintf(pname, sizeof(pname),
+ elm_layout_edje_get(obj), ELM_CALENDAR_CIT_ACCESS_PART_STR, i);
ao = _elm_access_edje_object_part_object_register
(obj, elm_layout_edje_get(obj), pname);
@@ -371,7 +388,8 @@ _access_calendar_item_register(Evas_Object *obj)
}
else
{
- snprintf(pname, sizeof(pname), "cit_%i.access", i);
+ _part_name_snprintf(pname, sizeof(pname),
+ elm_layout_edje_get(obj), ELM_CALENDAR_CIT_ACCESS_PART_STR, i);
_elm_access_edje_object_part_object_unregister
(obj, elm_layout_edje_get(obj), pname);
}
@@ -381,7 +399,7 @@ _access_calendar_item_register(Evas_Object *obj)
static void
_access_calendar_spinner_register(Evas_Object *obj)
{
- Evas_Object *po;
+ Evas_Object *po, *o;
Elm_Access_Info *ai;
ELM_CALENDAR_DATA_GET(obj, sd);
@@ -419,13 +437,14 @@ _access_calendar_spinner_register(Evas_Object *obj)
ai = _elm_access_info_get(sd->year_access);
_elm_access_text_set(ai, ELM_ACCESS_TYPE, E_("calendar year"));
- po = (Evas_Object *)edje_object_part_object_get
- (elm_layout_edje_get(obj), "month_text");
+ o = elm_layout_edje_get(obj);
+ edje_object_freeze(o);
+ po = (Evas_Object *)edje_object_part_object_get(o, "month_text");
evas_object_pass_events_set(po, EINA_FALSE);
- po = (Evas_Object *)edje_object_part_object_get
- (elm_layout_edje_get(obj), "year_text");
+ po = (Evas_Object *)edje_object_part_object_get(o, "year_text");
evas_object_pass_events_set(po, EINA_FALSE);
+ edje_object_thaw(o);
}
static void
@@ -464,7 +483,7 @@ _populate(Evas_Object *obj)
{
int maxdays, adjusted_wday, prev_month_maxdays, day, mon, yr, i;
Elm_Calendar_Mark *mark;
- char part[12], day_s[3];
+ char part[16], day_s[3];
struct tm first_day;
Eina_List *l;
Eina_Bool last_row = EINA_TRUE;
@@ -586,7 +605,7 @@ _populate(Evas_Object *obj)
snprintf(day_s, sizeof(day_s), "%i", i - sd->first_day_it - maxdays + 1);
}
- snprintf(part, sizeof(part), "cit_%i.text", i);
+ _part_name_snprintf(part, sizeof(part), obj, ELM_CALENDAR_CIT_TEXT_PART_STR, i);
elm_layout_text_set(obj, part, day_s);
/* Clear previous marks */
@@ -689,7 +708,7 @@ _populate(Evas_Object *obj)
static void
_set_headers(Evas_Object *obj)
{
- static char part[] = "ch_0.text";
+ static char part[64];
int i;
struct tm *t;
time_t temp = 259200; // the first sunday since epoch
@@ -725,7 +744,7 @@ _set_headers(Evas_Object *obj)
for (i = 0; i < ELM_DAY_LAST; i++)
{
- part[3] = i + '0';
+ _part_name_snprintf(part, sizeof(part), obj, ELM_CALENDAR_CH_TEXT_PART_STR, i);
elm_layout_text_set(obj, part, sd->weekdays[(i + sd->first_week_day) % ELM_DAY_LAST]);
}
@@ -859,7 +878,7 @@ _spinner_buttons_add(Evas_Object *obj, Elm_Calendar_Data *sd)
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_calendar_elm_widget_theme_apply(Eo *obj, Elm_Calendar_Data *sd)
+_elm_calendar_efl_ui_widget_theme_apply(Eo *obj, Elm_Calendar_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
@@ -1386,11 +1405,11 @@ _key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED)
}
EOLIAN static Eina_Bool
-_elm_calendar_elm_widget_on_focus_update(Eo *obj, Elm_Calendar_Data *sd, Elm_Object_Item *item EINA_UNUSED)
+_elm_calendar_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Calendar_Data *sd)
{
Eina_Bool int_ret = EINA_FALSE;
- int_ret = efl_ui_widget_on_focus_update(efl_super(obj, MY_CLASS), NULL);
+ int_ret = efl_ui_focus_object_on_focus_update(efl_super(obj, MY_CLASS));
if (!int_ret) return EINA_FALSE;
if (efl_ui_focus_object_focus_get(obj))
@@ -1550,8 +1569,9 @@ _access_obj_process(Evas_Object *obj, Eina_Bool is_access)
if ((!day) && (i == sd->first_day_it)) day = 1;
if ((day) && (day <= maxdays))
{
- char pname[14];
- snprintf(pname, sizeof(pname), "cit_%i.access", i);
+ char pname[18];
+ _part_name_snprintf(pname, sizeof(pname),
+ obj, ELM_CALENDAR_CIT_ACCESS_PART_STR, i);
_elm_access_edje_object_part_object_unregister
(obj, elm_layout_edje_get(obj), pname);
@@ -1593,7 +1613,7 @@ _access_obj_process(Evas_Object *obj, Eina_Bool is_access)
}
EOLIAN static void
-_elm_calendar_elm_widget_on_access_update(Eo *obj EINA_UNUSED, Elm_Calendar_Data *_pd EINA_UNUSED, Eina_Bool acs)
+_elm_calendar_efl_ui_widget_on_access_update(Eo *obj EINA_UNUSED, Elm_Calendar_Data *_pd EINA_UNUSED, Eina_Bool acs)
{
_elm_calendar_smart_focus_next_enable = acs;
_access_obj_process(obj, _elm_calendar_smart_focus_next_enable);
@@ -1614,7 +1634,7 @@ _elm_calendar_efl_object_constructor(Eo *obj, Elm_Calendar_Data *sd)
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_CALENDAR);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_CALENDAR);
return obj;
}
@@ -1636,7 +1656,7 @@ _elm_calendar_weekdays_names_set(Eo *obj, Elm_Calendar_Data *sd, const char **we
}
EOLIAN static const char**
-_elm_calendar_weekdays_names_get(Eo *obj EINA_UNUSED, Elm_Calendar_Data *sd)
+_elm_calendar_weekdays_names_get(const Eo *obj EINA_UNUSED, Elm_Calendar_Data *sd)
{
return sd->weekdays;
}
@@ -1648,7 +1668,7 @@ _elm_calendar_interval_set(Eo *obj EINA_UNUSED, Elm_Calendar_Data *sd, double in
}
EOLIAN static double
-_elm_calendar_interval_get(Eo *obj EINA_UNUSED, Elm_Calendar_Data *sd)
+_elm_calendar_interval_get(const Eo *obj EINA_UNUSED, Elm_Calendar_Data *sd)
{
return sd->first_interval;
}
@@ -1754,7 +1774,7 @@ _elm_calendar_date_min_set(Eo *obj, Elm_Calendar_Data *sd, const struct tm *min)
}
EOLIAN static const struct tm *
-_elm_calendar_date_min_get(Eo *obj EINA_UNUSED, Elm_Calendar_Data *sd)
+_elm_calendar_date_min_get(const Eo *obj EINA_UNUSED, Elm_Calendar_Data *sd)
{
return &(sd->date_min);
}
@@ -1807,7 +1827,7 @@ _elm_calendar_date_max_set(Eo *obj, Elm_Calendar_Data *sd, const struct tm *max)
}
EOLIAN static const struct tm *
-_elm_calendar_date_max_get(Eo *obj EINA_UNUSED, Elm_Calendar_Data *sd)
+_elm_calendar_date_max_get(const Eo *obj EINA_UNUSED, Elm_Calendar_Data *sd)
{
return &(sd->date_max);
}
@@ -1928,7 +1948,7 @@ _elm_calendar_marks_clear(Eo *obj EINA_UNUSED, Elm_Calendar_Data *sd)
}
EOLIAN static const Eina_List*
-_elm_calendar_marks_get(Eo *obj EINA_UNUSED, Elm_Calendar_Data *sd)
+_elm_calendar_marks_get(const Eo *obj EINA_UNUSED, Elm_Calendar_Data *sd)
{
return sd->marks;
}
@@ -1951,7 +1971,7 @@ _elm_calendar_first_day_of_week_set(Eo *obj, Elm_Calendar_Data *sd, Elm_Calendar
}
EOLIAN static Elm_Calendar_Weekday
-_elm_calendar_first_day_of_week_get(Eo *obj EINA_UNUSED, Elm_Calendar_Data *sd)
+_elm_calendar_first_day_of_week_get(const Eo *obj EINA_UNUSED, Elm_Calendar_Data *sd)
{
return sd->first_week_day;
}
@@ -1975,7 +1995,7 @@ _elm_calendar_select_mode_set(Eo *obj, Elm_Calendar_Data *sd, Elm_Calendar_Selec
}
EOLIAN static Elm_Calendar_Select_Mode
-_elm_calendar_select_mode_get(Eo *obj EINA_UNUSED, Elm_Calendar_Data *sd)
+_elm_calendar_select_mode_get(const Eo *obj EINA_UNUSED, Elm_Calendar_Data *sd)
{
return sd->select_mode;
}
@@ -1987,7 +2007,7 @@ _elm_calendar_selectable_set(Eo *obj EINA_UNUSED, Elm_Calendar_Data *sd, Elm_Cal
}
EOLIAN static Elm_Calendar_Selectable
-_elm_calendar_selectable_get(Eo *obj EINA_UNUSED, Elm_Calendar_Data *sd)
+_elm_calendar_selectable_get(const Eo *obj EINA_UNUSED, Elm_Calendar_Data *sd)
{
return sd->selectable;
}
@@ -2010,7 +2030,7 @@ _elm_calendar_class_constructor(Efl_Class *klass)
}
EOLIAN static const Efl_Access_Action_Data*
-_elm_calendar_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Calendar_Data *sd EINA_UNUSED)
+_elm_calendar_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Elm_Calendar_Data *sd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "activate", "activate", NULL, _key_action_activate},
@@ -2039,14 +2059,16 @@ typedef struct {
EOLIAN static void
_elm_calendar_item_day_number_set(Eo *obj, Elm_Calendar_Item_Data *pd, int i)
{
- char pname[14];
- Evas_Object *po;
+ char pname[18];
+ Evas_Object *po, *o;
pd->v = i;
- snprintf(pname, sizeof(pname), "cit_%i.access", i);
- po = (Evas_Object *)edje_object_part_object_get
- (elm_layout_edje_get(efl_parent_get(obj)), pname);
+ o = elm_layout_edje_get(efl_parent_get(obj));
+ _part_name_snprintf(pname, sizeof(pname), o, ELM_CALENDAR_CIT_ACCESS_PART_STR, i);
+ edje_object_freeze(o);
+ po = (Evas_Object *)edje_object_part_object_get(o, pname);
+ edje_object_thaw(o);
if (_elm_config->access_mode != ELM_ACCESS_MODE_ON)
pd->part = po;
@@ -2057,7 +2079,7 @@ _elm_calendar_item_day_number_set(Eo *obj, Elm_Calendar_Item_Data *pd, int i)
}
EOLIAN static int
-_elm_calendar_item_day_number_get(Eo *obj EINA_UNUSED, Elm_Calendar_Item_Data *pd)
+_elm_calendar_item_day_number_get(const Eo *obj EINA_UNUSED, Elm_Calendar_Item_Data *pd)
{
return pd->v;
}
@@ -2072,9 +2094,9 @@ _elm_calendar_item_efl_ui_focus_object_focus_set(Eo *obj, Elm_Calendar_Item_Data
}
EOLIAN static Eina_Rect
-_elm_calendar_item_efl_ui_focus_object_focus_geometry_get(Eo *obj EINA_UNUSED, Elm_Calendar_Item_Data *pd)
+_elm_calendar_item_efl_ui_focus_object_focus_geometry_get(const Eo *obj EINA_UNUSED, Elm_Calendar_Item_Data *pd)
{
- return efl_gfx_geometry_get(pd->part);
+ return efl_gfx_entity_geometry_get(pd->part);
}
#include "elm_calendar_item.eo.c"
diff --git a/src/lib/elementary/elm_calendar.eo b/src/lib/elementary/elm_calendar.eo
index 81f7c93c38..0bbd10e95e 100644
--- a/src/lib/elementary/elm_calendar.eo
+++ b/src/lib/elementary/elm_calendar.eo
@@ -72,7 +72,8 @@ struct Elm.Calendar.Mark; [[Item handle for a calendar mark.
with @Elm.Calendar.mark_del.
]]
-class Elm.Calendar (Efl.Ui.Layout, Efl.Ui.Focus.Composition, Efl.Access.Widget.Action)
+class Elm.Calendar (Efl.Ui.Layout.Object, Efl.Ui.Focus.Composition, Efl.Access.Widget.Action,
+ Efl.Ui.Legacy)
{
[[Calendar widget
@@ -412,14 +413,14 @@ class Elm.Calendar (Efl.Ui.Layout, Efl.Ui.Focus.Composition, Efl.Access.Widget.A
class.constructor;
Efl.Object.constructor;
Efl.Canvas.Group.group_calculate;
- Elm.Widget.theme_apply;
- Elm.Widget.on_access_update;
- Elm.Widget.on_focus_update;
- Elm.Widget.widget_event;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.on_access_update;
+ Efl.Ui.Focus.Object.on_focus_update;
+ Efl.Ui.Widget.widget_event;
Efl.Access.Widget.Action.elm_actions { get; }
}
events {
- changed; [[Emitted when the date in the calendar is changed]]
- display,changed; [[Emitted when the current month displayed in the calendar is changed]]
+ changed: void; [[Emitted when the date in the calendar is changed]]
+ display,changed: void; [[Emitted when the current month displayed in the calendar is changed]]
}
}
diff --git a/src/lib/elementary/elm_check_legacy.h b/src/lib/elementary/elm_check_legacy.h
index 6cc2d05582..e5c702770a 100644
--- a/src/lib/elementary/elm_check_legacy.h
+++ b/src/lib/elementary/elm_check_legacy.h
@@ -1,3 +1,5 @@
+typedef Eo Elm_Check;
+
/**
* @brief Add a new Check object
*
@@ -13,7 +15,7 @@ EAPI Evas_Object * elm_check_add(Evas_Object *parent);
*
* @param obj The check object
*
- * @ingroup Check
+ * @ingroup Elm_Check
*/
EAPI Eina_Bool elm_check_state_get(const Evas_Object *obj);
@@ -28,7 +30,7 @@ EAPI Eina_Bool elm_check_state_get(const Evas_Object *obj);
* @param obj The check object
* @param state The state to use (1 == on, 0 == off)
*
- * @ingroup Check
+ * @ingroup Elm_Check
*/
EAPI void elm_check_state_set(Evas_Object *obj, Eina_Bool state);
@@ -45,7 +47,7 @@ EAPI void elm_check_state_set(Evas_Object *obj, Eina_Bool
* @param obj The check object
* @param statep pointer to the boolean to modify
*
- * @ingroup Check
+ * @ingroup Elm_Check
*/
EAPI void elm_check_state_pointer_set(Evas_Object *obj, Eina_Bool *statep);
diff --git a/src/lib/elementary/elm_clock.c b/src/lib/elementary/elm_clock.c
index 95a03df743..db851796f7 100644
--- a/src/lib/elementary/elm_clock.c
+++ b/src/lib/elementary/elm_clock.c
@@ -2,12 +2,14 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_UI_FOCUS_COMPOSITION_PROTECTED
+#define EFL_UI_FOCUS_COMPOSITION_ADAPTER_PROTECTED
#include <Elementary.h>
#include "elm_priv.h"
#include "elm_widget_clock.h"
+#include "efl_ui_focus_composition_adapter.eo.h"
#define MY_CLASS ELM_CLOCK_CLASS
@@ -193,7 +195,9 @@ _access_activate_cb(void *data,
digit = evas_object_smart_parent_get(part_obj);
if (!digit) return;
+ edje_object_freeze(digit);
inc_btn = (Evas_Object *)edje_object_part_object_get(digit, "access.t");
+ edje_object_thaw(digit);
if (part_obj != inc_btn)
_on_clock_val_down_start(data, digit, NULL, NULL);
@@ -284,6 +288,7 @@ _access_time_register(Evas_Object *obj, Eina_Bool is_access)
}
/* no need to propagate mouse event with acess */
+ edje_object_freeze(sd->digit[i]);
po = (Evas_Object *)edje_object_part_object_get
(sd->digit[i], "access.t");
evas_object_propagate_events_set(po, !is_access);
@@ -291,7 +296,7 @@ _access_time_register(Evas_Object *obj, Eina_Bool is_access)
po = (Evas_Object *)edje_object_part_object_get
(sd->digit[i], "access.b");
evas_object_propagate_events_set(po, !is_access);
-
+ edje_object_thaw(sd->digit[i]);
}
/* am, pm edit button */
@@ -329,6 +334,7 @@ _access_time_register(Evas_Object *obj, Eina_Bool is_access)
}
/* no need to propagate mouse event with access */
+ edje_object_freeze(sd->am_pm_obj);
po = (Evas_Object *)edje_object_part_object_get
(sd->am_pm_obj, "access.t");
evas_object_propagate_events_set(po, !is_access);
@@ -336,21 +342,32 @@ _access_time_register(Evas_Object *obj, Eina_Bool is_access)
po = (Evas_Object *)edje_object_part_object_get
(sd->am_pm_obj, "access.b");
evas_object_propagate_events_set(po, !is_access);
-
+ edje_object_thaw(sd->am_pm_obj);
}
static Evas_Object*
-_part_get(Evas_Object *part, const char *part_name)
+_focus_part_get(Evas_Object *part, const char *part_name)
{
- Evas_Object *po;
+ Evas_Object *po, *adapter;
+ edje_object_freeze(part);
po = (Evas_Object *)edje_object_part_object_get
(part, part_name);
+ edje_object_thaw(part);
+
+ if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
+ po = evas_object_data_get(po, "_part_access_obj");
+
+ adapter = evas_object_data_get(po, "_focus_adapter_object");
- if (_elm_config->access_mode != ELM_ACCESS_MODE_ON)
- return po;
+ if (!adapter)
+ {
+ adapter = efl_add(EFL_UI_FOCUS_COMPOSITION_ADAPTER_CLASS, po);
+ efl_ui_focus_composition_adapter_canvas_object_set(adapter, part);
+ evas_object_data_set(po, "_focus_adapter_object", adapter);
+ }
- return evas_object_data_get(po, "_part_access_obj");
+ return adapter;
}
static void
@@ -366,15 +383,15 @@ _flush_clock_composite_elements(Evas_Object *obj, Elm_Clock_Data *sd)
if ((!sd->seconds) && (i >= 4)) break;
if (sd->digedit & (1 << i))
{
- items = eina_list_append(items, _part_get(sd->digit[i], "access.t"));
- items = eina_list_append(items, _part_get(sd->digit[i], "access.b"));
+ items = eina_list_append(items, _focus_part_get(sd->digit[i], "access.t"));
+ items = eina_list_append(items, _focus_part_get(sd->digit[i], "access.b"));
}
}
if (sd->am_pm)
{
- items = eina_list_append(items, _part_get(sd->am_pm_obj, "access.t"));
- items = eina_list_append(items, _part_get(sd->am_pm_obj, "access.b"));
+ items = eina_list_append(items, _focus_part_get(sd->am_pm_obj, "access.t"));
+ items = eina_list_append(items, _focus_part_get(sd->am_pm_obj, "access.b"));
}
}
@@ -422,7 +439,7 @@ _time_update(Evas_Object *obj, Eina_Bool theme_update)
}
edje_object_scale_set
- (wd->resize_obj, efl_gfx_scale_get(obj) *
+ (wd->resize_obj, efl_gfx_entity_scale_get(obj) *
elm_config_scale_get());
for (i = 0; i < 6; i++)
@@ -435,7 +452,7 @@ _time_update(Evas_Object *obj, Eina_Bool theme_update)
elm_widget_theme_object_set
(obj, sd->digit[i], "clock", "flipdigit", style);
edje_object_scale_set
- (sd->digit[i], efl_gfx_scale_get(obj) *
+ (sd->digit[i], efl_gfx_entity_scale_get(obj) *
elm_config_scale_get());
if ((sd->edit) && (sd->digedit & (1 << i)))
@@ -459,8 +476,13 @@ _time_update(Evas_Object *obj, Eina_Bool theme_update)
edje_object_size_min_restricted_calc
(sd->digit[i], &mw, &mh, mw, mh);
evas_object_size_hint_min_set(sd->digit[i], mw, mh);
- snprintf(buf, sizeof(buf), "d%i", i);
- elm_layout_content_set(obj, buf, sd->digit[i]);
+ snprintf(buf, sizeof(buf), "elm.d%i", i);
+ if (!elm_layout_content_set(obj, buf, sd->digit[i]))
+ {
+ // Previous versions of the theme did not have the namespace
+ snprintf(buf, sizeof(buf), "d%i", i);
+ elm_layout_content_set(obj, buf, sd->digit[i]);
+ }
evas_object_show(sd->digit[i]);
}
if (sd->am_pm)
@@ -469,7 +491,7 @@ _time_update(Evas_Object *obj, Eina_Bool theme_update)
edje_object_add(evas_object_evas_get(wd->resize_obj));
elm_widget_theme_object_set
(obj, sd->am_pm_obj, "clock", "flipampm", style);
- edje_object_scale_set(sd->am_pm_obj, efl_gfx_scale_get(obj) *
+ edje_object_scale_set(sd->am_pm_obj, efl_gfx_entity_scale_get(obj) *
_elm_config->scale);
if (sd->edit)
edje_object_signal_emit
@@ -492,7 +514,8 @@ _time_update(Evas_Object *obj, Eina_Bool theme_update)
edje_object_size_min_restricted_calc
(sd->am_pm_obj, &mw, &mh, mw, mh);
evas_object_size_hint_min_set(sd->am_pm_obj, mw, mh);
- elm_layout_content_set(obj, "ampm", sd->am_pm_obj);
+ if (!elm_layout_content_set(obj, "elm.ampm", sd->am_pm_obj))
+ elm_layout_content_set(obj, "ampm", sd->am_pm_obj);
evas_object_show(sd->am_pm_obj);
}
@@ -605,7 +628,7 @@ _time_update(Evas_Object *obj, Eina_Bool theme_update)
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_clock_elm_widget_theme_apply(Eo *obj, Elm_Clock_Data *sd EINA_UNUSED)
+_elm_clock_efl_ui_widget_theme_apply(Eo *obj, Elm_Clock_Data *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
@@ -765,7 +788,7 @@ _access_obj_process(Evas_Object *obj, Eina_Bool is_access)
}
EOLIAN static void
-_elm_clock_elm_widget_on_access_update(Eo *obj EINA_UNUSED, Elm_Clock_Data *_pd EINA_UNUSED, Eina_Bool acs)
+_elm_clock_efl_ui_widget_on_access_update(Eo *obj EINA_UNUSED, Elm_Clock_Data *_pd EINA_UNUSED, Eina_Bool acs)
{
_elm_clock_smart_focus_next_enable = acs;
_access_obj_process(obj, _elm_clock_smart_focus_next_enable);
@@ -784,7 +807,7 @@ _elm_clock_efl_object_constructor(Eo *obj, Elm_Clock_Data *_pd EINA_UNUSED)
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_TEXT);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_TEXT);
return obj;
}
@@ -825,7 +848,7 @@ _elm_clock_time_set(Eo *obj, Elm_Clock_Data *sd, int hrs, int min, int sec)
}
EOLIAN static void
-_elm_clock_time_get(Eo *obj EINA_UNUSED, Elm_Clock_Data *sd, int *hrs, int *min, int *sec)
+_elm_clock_time_get(const Eo *obj EINA_UNUSED, Elm_Clock_Data *sd, int *hrs, int *min, int *sec)
{
if (hrs) *hrs = sd->hrs;
if (min) *min = sd->min;
@@ -845,7 +868,7 @@ _elm_clock_edit_set(Eo *obj, Elm_Clock_Data *sd, Eina_Bool edit)
}
EOLIAN static Eina_Bool
-_elm_clock_edit_get(Eo *obj EINA_UNUSED, Elm_Clock_Data *sd)
+_elm_clock_edit_get(const Eo *obj EINA_UNUSED, Elm_Clock_Data *sd)
{
return sd->edit;
}
@@ -861,7 +884,7 @@ _elm_clock_edit_mode_set(Eo *obj, Elm_Clock_Data *sd, Elm_Clock_Edit_Mode digedi
}
EOLIAN static Elm_Clock_Edit_Mode
-_elm_clock_edit_mode_get(Eo *obj EINA_UNUSED, Elm_Clock_Data *sd)
+_elm_clock_edit_mode_get(const Eo *obj EINA_UNUSED, Elm_Clock_Data *sd)
{
return sd->digedit;
}
@@ -874,7 +897,7 @@ _elm_clock_show_am_pm_set(Eo *obj, Elm_Clock_Data *sd, Eina_Bool am_pm)
}
EOLIAN static Eina_Bool
-_elm_clock_show_am_pm_get(Eo *obj EINA_UNUSED, Elm_Clock_Data *sd)
+_elm_clock_show_am_pm_get(const Eo *obj EINA_UNUSED, Elm_Clock_Data *sd)
{
return sd->am_pm;
}
@@ -887,7 +910,7 @@ _elm_clock_show_seconds_set(Eo *obj, Elm_Clock_Data *sd, Eina_Bool seconds)
}
EOLIAN static Eina_Bool
-_elm_clock_show_seconds_get(Eo *obj EINA_UNUSED, Elm_Clock_Data *sd)
+_elm_clock_show_seconds_get(const Eo *obj EINA_UNUSED, Elm_Clock_Data *sd)
{
return sd->seconds;
}
@@ -899,7 +922,7 @@ _elm_clock_first_interval_set(Eo *obj EINA_UNUSED, Elm_Clock_Data *sd, double in
}
EOLIAN static double
-_elm_clock_first_interval_get(Eo *obj EINA_UNUSED, Elm_Clock_Data *sd)
+_elm_clock_first_interval_get(const Eo *obj EINA_UNUSED, Elm_Clock_Data *sd)
{
return sd->first_interval;
}
@@ -921,7 +944,7 @@ _elm_clock_pause_set(Eo *obj EINA_UNUSED, Elm_Clock_Data *sd, Eina_Bool paused)
}
EOLIAN static Eina_Bool
-_elm_clock_pause_get(Eo *obj EINA_UNUSED, Elm_Clock_Data *sd)
+_elm_clock_pause_get(const Eo *obj EINA_UNUSED, Elm_Clock_Data *sd)
{
return sd->paused;
}
diff --git a/src/lib/elementary/elm_clock.eo b/src/lib/elementary/elm_clock.eo
index b519c1aeab..e01048d937 100644
--- a/src/lib/elementary/elm_clock.eo
+++ b/src/lib/elementary/elm_clock.eo
@@ -18,7 +18,7 @@ enum Elm.Clock.Edit_Mode
all = (1 << 6) - 1 [[All digits should be editable.]]
}
-class Elm.Clock (Efl.Ui.Layout, Efl.Ui.Focus.Composition)
+class Elm.Clock (Efl.Ui.Layout.Object, Efl.Ui.Focus.Composition, Efl.Ui.Legacy)
{
[[Digital clock widget
@@ -163,10 +163,10 @@ class Elm.Clock (Efl.Ui.Layout, Efl.Ui.Focus.Composition)
implements {
class.constructor;
Efl.Object.constructor;
- Elm.Widget.on_access_update;
- Elm.Widget.theme_apply;
+ Efl.Ui.Widget.on_access_update;
+ Efl.Ui.Widget.theme_apply;
}
events {
- changed; [[The clock's user changed the time]]
+ changed: void; [[The clock's user changed the time]]
}
}
diff --git a/src/lib/elementary/elm_cnp.c b/src/lib/elementary/elm_cnp.c
deleted file mode 100644
index e7ac5cb625..0000000000
--- a/src/lib/elementary/elm_cnp.c
+++ /dev/null
@@ -1,5851 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include "elementary_config.h"
-#endif
-#include <Elementary.h>
-#include <Efreet.h>
-#include "elm_priv.h"
-#ifdef HAVE_MMAN_H
-# include <sys/mman.h>
-#endif
-
-//#define DEBUGON 1
-#ifdef DEBUGON
-# define cnp_debug(fmt, args...) fprintf(stderr, __FILE__":%s/%d : " fmt , __FUNCTION__, __LINE__, ##args)
-#else
-# define cnp_debug(x...) do { } while (0)
-#endif
-
-#define ARRAYINIT(foo) [foo] =
-
-EAPI int ELM_CNP_EVENT_SELECTION_CHANGED = -1;
-
-// common stuff
-enum
-{
- CNP_ATOM_TARGETS = 0,
- CNP_ATOM_ATOM,
- CNP_ATOM_LISTING_ATOMS = CNP_ATOM_ATOM,
- CNP_ATOM_text_urilist,
- CNP_ATOM_text_x_vcard,
- CNP_ATOM_image_png,
- CNP_ATOM_image_jpeg,
- CNP_ATOM_image_bmp,
- CNP_ATOM_image_gif,
- CNP_ATOM_image_tiff,
- CNP_ATOM_image_svg,
- CNP_ATOM_image_xpm,
- CNP_ATOM_image_tga,
- CNP_ATOM_image_ppm,
- CNP_ATOM_XELM,
-// CNP_ATOM_text_html_utf8,
-// CNP_ATOM_text_html,
- CNP_ATOM_UTF8STRING,
- CNP_ATOM_STRING,
- CNP_ATOM_COMPOUND_TEXT,
- CNP_ATOM_TEXT,
- CNP_ATOM_text_plain_utf8,
- CNP_ATOM_text_plain,
-
- CNP_N_ATOMS,
-};
-
-typedef struct _Tmp_Info Tmp_Info;
-typedef struct _Saved_Type Saved_Type;
-typedef struct _Cnp_Escape Cnp_Escape;
-typedef struct _Dropable Dropable;
-typedef struct _Dropable_Cbs Dropable_Cbs;
-static Eina_Bool doaccept = EINA_FALSE;
-
-struct _Tmp_Info
-{
- char *filename;
- void *map;
- int fd;
- int len;
-};
-
-struct _Saved_Type
-{
- const char **types;
- char *imgfile;
- int ntypes;
- int x, y;
- Eina_Bool textreq: 1;
-};
-
-struct _Cnp_Escape
-{
- const char *escape;
- const char *value;
-};
-
-struct _Dropable_Cbs
-{
- EINA_INLIST;
- Elm_Sel_Format types;
- Elm_Drag_State entercb;
- Elm_Drag_State leavecb;
- Elm_Drag_Pos poscb;
- Elm_Drop_Cb dropcb;
- void *enterdata;
- void *leavedata;
- void *posdata;
- void *dropdata;
-};
-
-struct _Dropable
-{
- Evas_Object *obj;
- /* FIXME: Cache window */
- Eina_Inlist *cbs_list; /* List of Dropable_Cbs * */
- struct {
- Evas_Coord x, y;
- Eina_Bool in : 1;
- const char *type;
- Elm_Sel_Format format;
- } last;
-};
-
-struct _Item_Container_Drop_Info
-{ /* Info kept for containers to support drop */
- Evas_Object *obj;
- Elm_Xy_Item_Get_Cb itemgetcb;
- Elm_Drop_Item_Container_Cb dropcb;
- Elm_Drag_Item_Container_Pos poscb;
-};
-typedef struct _Item_Container_Drop_Info Item_Container_Drop_Info;
-
-struct _Anim_Icon
-{
- int start_x;
- int start_y;
- int start_w;
- int start_h;
- Evas_Object *o;
-};
-typedef struct _Anim_Icon Anim_Icon;
-
-struct _Item_Container_Drag_Info
-{ /* Info kept for containers to support drag */
- Evas_Object *obj;
- Ecore_Timer *tm; /* When this expires, start drag */
- double anim_tm; /* Time period to set tm */
- double tm_to_drag; /* Time period to set tm */
- Elm_Xy_Item_Get_Cb itemgetcb;
- Elm_Item_Container_Data_Get_Cb data_get;
-
- Evas_Coord x_down; /* Mouse down x cord when drag starts */
- Evas_Coord y_down; /* Mouse down y cord when drag starts */
-
- /* Some extra information needed to impl default anim */
- Evas *e;
- Eina_List *icons; /* List of icons to animate (Anim_Icon) */
- int final_icon_w; /* We need the w and h of the final icon for the animation */
- int final_icon_h;
- Ecore_Animator *ea;
-
- Elm_Drag_User_Info user_info;
-};
-typedef struct _Item_Container_Drag_Info Item_Container_Drag_Info;
-
-typedef struct _Cnp_Atom Cnp_Atom;
-
-static int _elm_cnp_init_count = 0;
-/* Stringshared, so I can just compare pointers later */
-static const char *text_uri;
-
-/* Hash table type->Elm_Sel_Format */
-static Eina_Hash *_types_hash = NULL;
-
-/* Data for DND in progress */
-static Saved_Type savedtypes = { NULL, NULL, 0, 0, 0, EINA_FALSE };
-
-/* Drag & Drop functions */
-/* FIXME: Way too many globals */
-static Eina_List *drops = NULL;
-static Evas_Object *dragwin = NULL;
-static int dragwin_x_start, dragwin_y_start;
-static int dragwin_x_end, dragwin_y_end;
-static int _dragx = 0, _dragy = 0;
-static Ecore_Event_Handler *handler_pos = NULL;
-static Ecore_Event_Handler *handler_drop = NULL;
-static Ecore_Event_Handler *handler_enter = NULL;
-static Ecore_Event_Handler *handler_leave = NULL;
-#ifdef HAVE_ELEMENTARY_X
-static Ecore_Event_Handler *handler_status = NULL;
-static Ecore_Event_Handler *handler_up = NULL;
-#endif
-
-/* TODO BUG: should NEVER have these as globals! They should be per context (window). */
-static Elm_Drag_Pos dragposcb = NULL;
-static Elm_Drag_Accept dragacceptcb = NULL;
-static Elm_Drag_State dragdonecb = NULL;
-static void *dragposdata = NULL;
-static void *dragacceptdata = NULL;
-static void *dragdonedata = NULL;
-static Evas_Object *dragwidget = NULL;
-static Elm_Xdnd_Action dragaction = ELM_XDND_ACTION_UNKNOWN;
-
-static Eina_List *cont_drop_tg = NULL; /* List of Item_Container_Drop_Info */
-static Eina_List *cont_drag_tg = NULL; /* List of Item_Container_Drag_Info */
-
-static void _cont_obj_mouse_up( void *data, Evas *e, Evas_Object *obj, void *event_info);
-static void _cont_obj_mouse_move( void *data, Evas *e, Evas_Object *obj, void *event_info);
-static void _all_drop_targets_cbs_del(void *data, Evas *e, Evas_Object *obj, void *info);
-static Eina_Bool _elm_cnp_shutdown(void);
-static Eina_Bool _local_elm_drop_target_del(Evas_Object *obj, Elm_Sel_Format format,
- Elm_Drag_State entercb, void *enterdata,
- Elm_Drag_State leavecb, void *leavedata,
- Elm_Drag_Pos poscb, void *posdata,
- Elm_Drop_Cb dropcb, void *dropdata);
-
-static Tmp_Info *_tempfile_new (int size);
-static int _tmpinfo_free (Tmp_Info *tmp);
-
-static Eina_Bool _local_elm_cnp_selection_get(const Evas_Object *obj, Elm_Sel_Type selection, Elm_Sel_Format format, Elm_Drop_Cb datacb, void *udata);
-static Eina_Bool _local_elm_object_cnp_selection_clear(Evas_Object *obj, Elm_Sel_Type selection);
-static Eina_Bool _local_elm_cnp_selection_set(Evas_Object *obj, Elm_Sel_Type selection, Elm_Sel_Format format, const void *selbuf, size_t buflen);
-#ifdef HAVE_ELEMENTARY_X
-static Ecore_X_Window _x11_elm_widget_xwin_get(const Evas_Object *obj);
-
-typedef struct _X11_Cnp_Selection X11_Cnp_Selection;
-
-typedef Eina_Bool (*X11_Converter_Fn_Cb) (char *target, void *data, int size, void **data_ret, int *size_ret, Ecore_X_Atom *ttype, int *typesize);
-typedef int (*X11_Response_Handler_Cb) (X11_Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *);
-typedef Eina_Bool (*X11_Data_Preparer_Cb) (Ecore_X_Event_Selection_Notify *, Elm_Selection_Data *, Tmp_Info **);
-
-static void _x11_sel_obj_del (void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED);
-static void _x11_sel_obj_del2 (void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED);
-static Eina_Bool _x11_selection_clear (void *udata EINA_UNUSED, int type, void *event);
-static Eina_Bool _x11_selection_notify (void *udata EINA_UNUSED, int type, void *event);
-static Eina_Bool _x11_targets_converter (char *target, void *data, int size, void **data_ret, int *size_ret, Ecore_X_Atom *ttype, int *typesize);
-static Eina_Bool _x11_text_converter (char *target, void *data, int size, void **data_ret, int *size_ret, Ecore_X_Atom *ttype, int *typesize);
-static Eina_Bool _x11_general_converter (char *target, void *data, int size, void **data_ret, int *size_ret, Ecore_X_Atom *ttype, int *typesize);
-static Eina_Bool _x11_image_converter (char *target, void *data, int size, void **data_ret, int *size_ret, Ecore_X_Atom *ttype, int *typesize);
-static Eina_Bool _x11_vcard_send (char *target, void *data, int size, void **data_ret, int *size_ret, Ecore_X_Atom *ttype, int *typesize);
-static Eina_Bool _x11_is_uri_type_data (X11_Cnp_Selection *sel EINA_UNUSED, Ecore_X_Event_Selection_Notify *notify);
-static Eina_Bool _x11_notify_handler_targets (X11_Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify);
-static Eina_Bool _x11_data_preparer_text (Ecore_X_Event_Selection_Notify *notify, Elm_Selection_Data *ddata, Tmp_Info **tmp_info);
-static Eina_Bool _x11_data_preparer_markup (Ecore_X_Event_Selection_Notify *notify, Elm_Selection_Data *ddata, Tmp_Info **tmp_info);
-static Eina_Bool _x11_data_preparer_image (Ecore_X_Event_Selection_Notify *notify, Elm_Selection_Data *ddata, Tmp_Info **tmp_info);
-static Eina_Bool _x11_data_preparer_uri (Ecore_X_Event_Selection_Notify *notify, Elm_Selection_Data *ddata, Tmp_Info **tmp_info);
-//static int _x11_notify_handler_html (X11_Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify);
-static Eina_Bool _x11_data_preparer_vcard (Ecore_X_Event_Selection_Notify *notify, Elm_Selection_Data *ddata, Tmp_Info **tmp_info);
-static Eina_Bool _x11_dnd_enter (void *data EINA_UNUSED, int etype EINA_UNUSED, void *ev);
-static Eina_Bool _x11_dnd_drop (void *data EINA_UNUSED, int etype EINA_UNUSED, void *ev);
-static Eina_Bool _x11_dnd_position (void *data EINA_UNUSED, int etype EINA_UNUSED, void *ev);
-static Eina_Bool _x11_dnd_status (void *data EINA_UNUSED, int etype EINA_UNUSED, void *ev);
-static Eina_Bool _x11_dnd_leave (void *data EINA_UNUSED, int etype EINA_UNUSED, void *ev);
-static Eina_Bool _x11_drag_mouse_up (void *data, int etype EINA_UNUSED, void *event);
-static void _x11_drag_move (void *data EINA_UNUSED, Ecore_X_Xdnd_Position *pos);
-
-static Eina_Bool _x11_elm_cnp_init (void);
-static Eina_Bool _x11_elm_cnp_selection_set (Ecore_X_Window xwin, Evas_Object *obj, Elm_Sel_Type selection, Elm_Sel_Format format, const void *selbuf, size_t buflen);
-static void _x11_elm_cnp_selection_loss_callback_set(Evas_Object *obj EINA_UNUSED, Elm_Sel_Type selection, Elm_Selection_Loss_Cb func, const void *data);
-static Eina_Bool _x11_elm_object_cnp_selection_clear (Evas_Object *obj, Elm_Sel_Type selection);
-static Eina_Bool _x11_elm_cnp_selection_get (Ecore_X_Window xwin, const Evas_Object *obj, Elm_Sel_Type selection, Elm_Sel_Format format, Elm_Drop_Cb datacb, void *udata);
-static Eina_Bool _x11_elm_drop_target_add (Evas_Object *obj, Elm_Sel_Format format,
- Elm_Drag_State entercb, void *enterdata,
- Elm_Drag_State leavecb, void *leavedata,
- Elm_Drag_Pos poscb, void *posdata,
- Elm_Drop_Cb dropcb, void *dropdata);
-static Eina_Bool _x11_elm_drop_target_del (Evas_Object *obj, Elm_Sel_Format format,
- Elm_Drag_State entercb, void *enterdata,
- Elm_Drag_State leavecb, void *leavedata,
- Elm_Drag_Pos poscb, void *posdata,
- Elm_Drop_Cb dropcb, void *dropdata);
-static Eina_Bool _x11_elm_selection_selection_has_owner (Evas_Object *obj EINA_UNUSED);
-
-#endif
-
-#ifdef HAVE_ELEMENTARY_WL2
-typedef struct _Wl_Cnp_Selection Wl_Cnp_Selection;
-
-typedef Eina_Bool (*Wl_Converter_Fn_Cb) (char *target, Wl_Cnp_Selection *sel, void *data, int size, void **data_ret, int *size_ret);
-static Eina_Bool _wl_targets_converter(char *target, Wl_Cnp_Selection *sel, void *data, int size, void **data_ret, int *size_ret);
-static Eina_Bool _wl_general_converter(char *target, Wl_Cnp_Selection *sel, void *data, int size, void **data_ret, int *size_ret);
-static Eina_Bool _wl_text_converter(char *target, Wl_Cnp_Selection *sel, void *data, int size, void **data_ret, int *size_ret);
-
-typedef Eina_Bool (*Wl_Data_Preparer_Cb) (Wl_Cnp_Selection *sel, Elm_Selection_Data *ddata, Ecore_Wl2_Event_Offer_Data_Ready *ev, Tmp_Info **tmp_info);
-static Eina_Bool _wl_data_preparer_markup(Wl_Cnp_Selection *sel, Elm_Selection_Data *ddata, Ecore_Wl2_Event_Offer_Data_Ready *ev, Tmp_Info **tmp_info);
-static Eina_Bool _wl_data_preparer_uri(Wl_Cnp_Selection *sel, Elm_Selection_Data *ddata, Ecore_Wl2_Event_Offer_Data_Ready *ev, Tmp_Info **tmp_info);
-static Eina_Bool _wl_data_preparer_vcard(Wl_Cnp_Selection *sel, Elm_Selection_Data *ddata, Ecore_Wl2_Event_Offer_Data_Ready *ev, Tmp_Info **tmp_info);
-static Eina_Bool _wl_data_preparer_image(Wl_Cnp_Selection *sel, Elm_Selection_Data *ddata, Ecore_Wl2_Event_Offer_Data_Ready *ev, Tmp_Info **tmp_info);
-static Eina_Bool _wl_data_preparer_text(Wl_Cnp_Selection *sel, Elm_Selection_Data *ddata, Ecore_Wl2_Event_Offer_Data_Ready *ev, Tmp_Info **tmp_info);
-#endif
-
-struct _Cnp_Atom
-{
- const char *name;
- Elm_Sel_Format formats;
-#ifdef HAVE_ELEMENTARY_X
- /* Called by ecore to do conversion */
- X11_Converter_Fn_Cb x_converter;
- X11_Data_Preparer_Cb x_data_preparer;
- /* Atom */
- Ecore_X_Atom x_atom;
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- Wl_Converter_Fn_Cb wl_converter;
- Wl_Data_Preparer_Cb wl_data_preparer;
-#endif
-
- void *_term;
-};
-
-static Eina_List *
-_dropable_list_geom_find(Evas *evas, Evas_Coord px, Evas_Coord py)
-{
- Eina_List *itr, *top_objects_list = NULL, *dropable_list = NULL;
- Evas_Object *top_obj;
- Dropable *dropable = NULL;
-
- if (!drops) return NULL;
-
- /* We retrieve the (non-smart) objects pointed by (px, py) */
- top_objects_list = evas_tree_objects_at_xy_get(evas, NULL, px, py);
- /* We walk on this list from the last because if the list contains more than one
- * element, all but the last will repeat events. The last one can repeat events
- * or not. Anyway, this last one is the first that has to be taken into account
- * for the determination of the drop target.
- */
- EINA_LIST_REVERSE_FOREACH(top_objects_list, itr, top_obj)
- {
- Evas_Object *object = top_obj;
- /* We search for the dropable data into the object. If not found, we search into its parent.
- * For example, if a button is a drop target, the first object will be an (internal) image.
- * The drop target is attached to the button, i.e to image's parent. That's why we need to
- * walk on the parents until NULL.
- * If we find this dropable data, we found our drop target.
- */
- while (object)
- {
- dropable = efl_key_data_get(object, "__elm_dropable");
- if (dropable)
- {
- Eina_Bool exist = EINA_FALSE;
- Eina_List *l;
- Dropable *d = NULL;
- EINA_LIST_FOREACH(dropable_list, l, d)
- {
- if (d == dropable)
- {
- exist = EINA_TRUE;
- break;
- }
- }
- if (!exist)
- dropable_list = eina_list_append(dropable_list, dropable);
- object = evas_object_smart_parent_get(object);
- if (dropable)
- cnp_debug("Drop target %p of type %s found\n",
- dropable->obj, efl_class_name_get(efl_class_get(dropable->obj)));
- }
- else
- object = evas_object_smart_parent_get(object);
- }
- }
- eina_list_free(top_objects_list);
- return dropable_list;
-}
-
-static void
-_dropable_coords_adjust(Dropable *dropable, Evas_Coord *x, Evas_Coord *y)
-{
- Ecore_Evas *ee;
- Evas *evas = evas_object_evas_get(dropable->obj);
- int ex = 0, ey = 0, ew = 0, eh = 0;
- Evas_Object *win;
-
- ee = ecore_evas_ecore_evas_get(evas);
- ecore_evas_geometry_get(ee, &ex, &ey, &ew, &eh);
- *x = *x - ex;
- *y = *y - ey;
-
- /* For Wayland, frame coords have to be subtracted. */
- Evas_Coord fx, fy;
- evas_output_framespace_get(evas, &fx, &fy, NULL, NULL);
- if (fx || fy) cnp_debug("evas frame fx %d fy %d\n", fx, fy);
- *x = *x - fx;
- *y = *y - fy;
-
- if (elm_widget_is(dropable->obj))
- {
- win = elm_widget_top_get(dropable->obj);
- if (win && efl_isa(win, EFL_UI_WIN_CLASS))
- {
- Evas_Coord x2, y2;
- int rot = elm_win_rotation_get(win);
- switch (rot)
- {
- case 90:
- x2 = ew - *y;
- y2 = *x;
- break;
- case 180:
- x2 = ew - *x;
- y2 = eh - *y;
- break;
- case 270:
- x2 = *y;
- y2 = eh - *x;
- break;
- default:
- x2 = *x;
- y2 = *y;
- break;
- }
- cnp_debug("rotation %d, w %d, h %d - x:%d->%d, y:%d->%d\n",
- rot, ew, eh, *x, x2, *y, y2);
- *x = x2;
- *y = y2;
- }
- }
-}
-
-static Elm_Sel_Format
-_dnd_types_to_format(const char **types, int ntypes)
-{
- Elm_Sel_Format ret_type = 0;
- int i;
- for (i = 0; i < ntypes; i++)
- {
- Cnp_Atom *atom = eina_hash_find(_types_hash, types[i]);
- if (atom) ret_type |= atom->formats;
- }
- return ret_type;
-}
-
-static Eina_Bool
-_drag_cancel_animate(void *data, double pos)
-{ /* Animation to "move back" drag-window */
- if (pos >= 0.99)
- {
-#ifdef HAVE_ELEMENTARY_X
- Ecore_X_Window xdragwin = _x11_elm_widget_xwin_get(data);
- ecore_x_window_ignore_set(xdragwin, 0);
-#endif
- evas_object_del(data);
- return ECORE_CALLBACK_CANCEL;
- }
- else
- {
- int x, y;
- x = dragwin_x_end - (pos * (dragwin_x_end - dragwin_x_start));
- y = dragwin_y_end - (pos * (dragwin_y_end - dragwin_y_start));
- evas_object_move(data, x, y);
- }
-
- return ECORE_CALLBACK_RENEW;
-}
-
-static void
-_all_drop_targets_cbs_del(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *info EINA_UNUSED)
-{
- Dropable *dropable = NULL;
- dropable = efl_key_data_get(obj, "__elm_dropable");
- if (dropable)
- {
- Dropable_Cbs *cbs;
- while (dropable->cbs_list)
- {
- cbs = EINA_INLIST_CONTAINER_GET(dropable->cbs_list, Dropable_Cbs);
- elm_drop_target_del(obj, cbs->types,
- cbs->entercb, cbs->enterdata, cbs->leavecb, cbs->leavedata,
- cbs->poscb, cbs->posdata, cbs->dropcb, cbs->dropdata);
- // If elm_drop_target_del() happened to delete dropabale, then
- // re-fetch it each loop to make sure it didn't
- dropable = efl_key_data_get(obj, "__elm_dropable");
- if (!dropable) break;
- }
- }
-}
-
-static Cnp_Atom _atoms[CNP_N_ATOMS] = {
- ARRAYINIT(CNP_ATOM_TARGETS) {
- .name = "TARGETS",
- .formats = ELM_SEL_FORMAT_TARGETS,
-#ifdef HAVE_ELEMENTARY_X
- .x_converter = _x11_targets_converter,
-
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- .wl_converter = _wl_targets_converter,
-#endif
- },
- ARRAYINIT(CNP_ATOM_ATOM) {
- .name = "ATOM", // for opera browser
- .formats = ELM_SEL_FORMAT_TARGETS,
-#ifdef HAVE_ELEMENTARY_X
- .x_converter = _x11_targets_converter,
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- .wl_converter = _wl_targets_converter,
-#endif
- },
- ARRAYINIT(CNP_ATOM_XELM) {
- .name = "application/x-elementary-markup",
- .formats = ELM_SEL_FORMAT_MARKUP,
-#ifdef HAVE_ELEMENTARY_X
- .x_converter = _x11_general_converter,
- .x_data_preparer = _x11_data_preparer_markup,
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- .wl_converter = _wl_general_converter,
- .wl_data_preparer = _wl_data_preparer_markup,
-#endif
- },
- ARRAYINIT(CNP_ATOM_text_urilist) {
- .name = "text/uri-list",
- .formats = ELM_SEL_FORMAT_IMAGE,
-#ifdef HAVE_ELEMENTARY_X
- .x_converter = _x11_general_converter,
- .x_data_preparer = _x11_data_preparer_uri,
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- .wl_converter = _wl_general_converter,
- .wl_data_preparer = _wl_data_preparer_uri,
-#endif
- },
- ARRAYINIT(CNP_ATOM_text_x_vcard) {
- .name = "text/x-vcard",
- .formats = ELM_SEL_FORMAT_VCARD,
-#ifdef HAVE_ELEMENTARY_X
- .x_converter = _x11_vcard_send,
- .x_data_preparer = _x11_data_preparer_vcard,
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- .wl_data_preparer = _wl_data_preparer_vcard,
-#endif
- },
- ARRAYINIT(CNP_ATOM_image_png) {
- .name = "image/png",
- .formats = ELM_SEL_FORMAT_IMAGE,
-#ifdef HAVE_ELEMENTARY_X
- .x_converter = _x11_image_converter,
- .x_data_preparer = _x11_data_preparer_image,
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- .wl_data_preparer = _wl_data_preparer_image,
-#endif
- },
- ARRAYINIT(CNP_ATOM_image_jpeg) {
- .name = "image/jpeg",
- .formats = ELM_SEL_FORMAT_IMAGE,
-#ifdef HAVE_ELEMENTARY_X
- .x_converter = _x11_image_converter,
- .x_data_preparer = _x11_data_preparer_image,
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- .wl_data_preparer = _wl_data_preparer_image,
-#endif
- },
- ARRAYINIT(CNP_ATOM_image_bmp) {
- .name = "image/x-ms-bmp",
- .formats = ELM_SEL_FORMAT_IMAGE,
-#ifdef HAVE_ELEMENTARY_X
- .x_converter = _x11_image_converter,
- .x_data_preparer = _x11_data_preparer_image,
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- .wl_data_preparer = _wl_data_preparer_image,
-#endif
- },
- ARRAYINIT(CNP_ATOM_image_gif) {
- .name = "image/gif",
- .formats = ELM_SEL_FORMAT_IMAGE,
-#ifdef HAVE_ELEMENTARY_X
- .x_converter = _x11_image_converter,
- .x_data_preparer = _x11_data_preparer_image,
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- .wl_data_preparer = _wl_data_preparer_image,
-#endif
- },
- ARRAYINIT(CNP_ATOM_image_tiff) {
- .name = "image/tiff",
- .formats = ELM_SEL_FORMAT_IMAGE,
-#ifdef HAVE_ELEMENTARY_X
- .x_converter = _x11_image_converter,
- .x_data_preparer = _x11_data_preparer_image,
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- .wl_data_preparer = _wl_data_preparer_image,
-#endif
- },
- ARRAYINIT(CNP_ATOM_image_svg) {
- .name = "image/svg+xml",
- .formats = ELM_SEL_FORMAT_IMAGE,
-#ifdef HAVE_ELEMENTARY_X
- .x_converter = _x11_image_converter,
- .x_data_preparer = _x11_data_preparer_image,
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- .wl_data_preparer = _wl_data_preparer_image,
-#endif
- },
- ARRAYINIT(CNP_ATOM_image_xpm) {
- .name = "image/x-xpixmap",
- .formats = ELM_SEL_FORMAT_IMAGE,
-#ifdef HAVE_ELEMENTARY_X
- .x_converter = _x11_image_converter,
- .x_data_preparer = _x11_data_preparer_image,
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- .wl_data_preparer = _wl_data_preparer_image,
-#endif
- },
- ARRAYINIT(CNP_ATOM_image_tga) {
- .name = "image/x-tga",
- .formats = ELM_SEL_FORMAT_IMAGE,
-#ifdef HAVE_ELEMENTARY_X
- .x_converter = _x11_image_converter,
- .x_data_preparer = _x11_data_preparer_image,
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- .wl_data_preparer = _wl_data_preparer_image,
-#endif
- },
- ARRAYINIT(CNP_ATOM_image_ppm) {
- .name = "image/x-portable-pixmap",
- .formats = ELM_SEL_FORMAT_IMAGE,
-#ifdef HAVE_ELEMENTARY_X
- .x_converter = _x11_image_converter,
- .x_data_preparer = _x11_data_preparer_image,
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- .wl_data_preparer = _wl_data_preparer_image,
-#endif
- },
-/*
- ARRAYINIT(CNP_ATOM_text_html_utf8) {
- .name = "text/html;charset=utf-8",
- .formats = ELM_SEL_FORMAT_HTML,
-#ifdef HAVE_ELEMENTARY_X
- .x_converter = _x11_general_converter,
- .x_notify = _x11_notify_handler_html,
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- .wl_converter = _wl_general_converter,
- .wl_data_preparer = _wl_data_preparer_handler_html,
-#endif
-
- },
- ARRAYINIT(CNP_ATOM_text_html) {
- .name = "text/html",
- .formats = ELM_SEL_FORMAT_HTML,
-#ifdef HAVE_ELEMENTARY_X
- .x_converter = _x11_general_converter,
- .x_notify = _x11_notify_handler_html,
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- .wl_converter = _wl_general_converter,
- .wl_data_preparer = _wl_data_preparer_handler_html,
-#endif
- },
- */
- ARRAYINIT(CNP_ATOM_UTF8STRING) {
- .name = "UTF8_STRING",
- .formats = ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML,
-#ifdef HAVE_ELEMENTARY_X
- .x_converter = _x11_text_converter,
- .x_data_preparer = _x11_data_preparer_text,
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- .wl_converter = _wl_text_converter,
- .wl_data_preparer = _wl_data_preparer_text,
-#endif
- },
- ARRAYINIT(CNP_ATOM_STRING) {
- .name = "STRING",
- .formats = ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML,
-#ifdef HAVE_ELEMENTARY_X
- .x_converter = _x11_text_converter,
- .x_data_preparer = _x11_data_preparer_text,
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- .wl_converter = _wl_text_converter,
- .wl_data_preparer = _wl_data_preparer_text,
-#endif
- },
- ARRAYINIT(CNP_ATOM_COMPOUND_TEXT) {
- .name = "COMPOUND_TEXT",
- .formats = ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML,
-#ifdef HAVE_ELEMENTARY_X
- .x_converter = _x11_text_converter,
- .x_data_preparer = _x11_data_preparer_text,
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- .wl_converter = _wl_text_converter,
- .wl_data_preparer = _wl_data_preparer_text,
-#endif
- },
- ARRAYINIT(CNP_ATOM_TEXT) {
- .name = "TEXT",
- .formats = ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML,
-#ifdef HAVE_ELEMENTARY_X
- .x_converter = _x11_text_converter,
- .x_data_preparer = _x11_data_preparer_text,
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- .wl_converter = _wl_text_converter,
- .wl_data_preparer = _wl_data_preparer_text,
-#endif
- },
- ARRAYINIT(CNP_ATOM_text_plain_utf8) {
- .name = "text/plain;charset=utf-8",
- .formats = ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML,
-#ifdef HAVE_ELEMENTARY_X
- .x_converter = _x11_text_converter,
- .x_data_preparer = _x11_data_preparer_text,
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- .wl_converter = _wl_text_converter,
- .wl_data_preparer = _wl_data_preparer_text,
-#endif
- },
- ARRAYINIT(CNP_ATOM_text_plain) {
- .name = "text/plain",
- .formats = ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML,
-#ifdef HAVE_ELEMENTARY_X
- .x_converter = _x11_text_converter,
- .x_data_preparer = _x11_data_preparer_text,
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- .wl_converter = _wl_text_converter,
- .wl_data_preparer = _wl_data_preparer_text,
-#endif
- },
-};
-
-// x11 specific stuff
-////////////////////////////////////////////////////////////////////////////
-#ifdef HAVE_ELEMENTARY_X
-#define ARRAYINIT(foo) [foo] =
-struct _X11_Cnp_Selection
-{
- const char *debug;
- Evas_Object *widget;
- char *selbuf;
- Evas_Object *requestwidget;
- void *udata;
- Elm_Sel_Format requestformat;
- Elm_Drop_Cb datacb;
- Eina_Bool (*set) (Ecore_X_Window, const void *data, int size);
- Eina_Bool (*clear) (void);
- void (*request) (Ecore_X_Window, const char *target);
- Elm_Selection_Loss_Cb loss_cb;
- void *loss_data;
-
- Elm_Sel_Format format;
- Ecore_X_Selection ecore_sel;
- Ecore_X_Window xwin;
- Elm_Xdnd_Action action;
-
- Eina_Bool active : 1;
-};
-
-static X11_Cnp_Selection _x11_selections[ELM_SEL_TYPE_CLIPBOARD + 1] = {
- ARRAYINIT(ELM_SEL_TYPE_PRIMARY) {
- .debug = "Primary",
- .ecore_sel = ECORE_X_SELECTION_PRIMARY,
- .set = ecore_x_selection_primary_set,
- .clear = ecore_x_selection_primary_clear,
- .request = ecore_x_selection_primary_request,
- },
- ARRAYINIT(ELM_SEL_TYPE_SECONDARY) {
- .debug = "Secondary",
- .ecore_sel = ECORE_X_SELECTION_SECONDARY,
- .set = ecore_x_selection_secondary_set,
- .clear = ecore_x_selection_secondary_clear,
- .request = ecore_x_selection_secondary_request,
- },
- ARRAYINIT(ELM_SEL_TYPE_XDND) {
- .debug = "XDnD",
- .ecore_sel = ECORE_X_SELECTION_XDND,
- .request = ecore_x_selection_xdnd_request,
- },
- ARRAYINIT(ELM_SEL_TYPE_CLIPBOARD) {
- .debug = "Clipboard",
- .ecore_sel = ECORE_X_SELECTION_CLIPBOARD,
- .set = ecore_x_selection_clipboard_set,
- .clear = ecore_x_selection_clipboard_clear,
- .request = ecore_x_selection_clipboard_request,
- },
-};
-
-static void
-_x11_sel_obj_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
-{
- X11_Cnp_Selection *sel = data;
- if (sel->widget == obj)
- {
- sel->loss_cb = NULL;
- sel->loss_data = NULL;
- sel->widget = NULL;
- }
- if (dragwidget == obj) dragwidget = NULL;
-}
-
-static void
-_x11_sel_obj_del2(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
-{
- X11_Cnp_Selection *sel = data;
- if (sel->requestwidget == obj) sel->requestwidget = NULL;
-}
-
-static Eina_Bool
-_x11_selection_clear(void *udata EINA_UNUSED, int type EINA_UNUSED, void *event)
-{
- Ecore_X_Event_Selection_Clear *ev = event;
- X11_Cnp_Selection *sel;
- unsigned int i;
-
- _x11_elm_cnp_init();
- for (i = ELM_SEL_TYPE_PRIMARY; i <= ELM_SEL_TYPE_CLIPBOARD; i++)
- {
- if (_x11_selections[i].ecore_sel == ev->selection) break;
- }
- cnp_debug("selection %d clear\n", i);
- /* Not me... Don't care */
- if (i > ELM_SEL_TYPE_CLIPBOARD) return ECORE_CALLBACK_PASS_ON;
-
- sel = _x11_selections + i;
- if (sel->loss_cb) sel->loss_cb(sel->loss_data, i);
- if (sel->widget)
- evas_object_event_callback_del_full(sel->widget, EVAS_CALLBACK_DEL,
- _x11_sel_obj_del, sel);
- if (sel->requestwidget)
- evas_object_event_callback_del_full(sel->requestwidget, EVAS_CALLBACK_DEL,
- _x11_sel_obj_del2, sel);
- sel->widget = NULL;
- sel->requestwidget = NULL;
- sel->loss_cb = NULL;
- sel->loss_data = NULL;
-
- sel->active = EINA_FALSE;
- ELM_SAFE_FREE(sel->selbuf, free);
- return ECORE_CALLBACK_PASS_ON;
-}
-
-static Eina_Bool
-_x11_fixes_selection_notify(void *d EINA_UNUSED, int t EINA_UNUSED, void *event)
-{
- Elm_Cnp_Event_Selection_Changed *e;
- Ecore_X_Event_Fixes_Selection_Notify *ev = event;
- Elm_Sel_Type type;
- X11_Cnp_Selection *sel;
-
- switch (ev->selection)
- {
- case ECORE_X_SELECTION_CLIPBOARD:
- type = ELM_SEL_TYPE_CLIPBOARD;
- break;
- case ECORE_X_SELECTION_PRIMARY:
- type = ELM_SEL_TYPE_PRIMARY;
- break;
- default: return ECORE_CALLBACK_RENEW;
- }
- sel = _x11_selections + type;
- if (sel->active && (sel->xwin != ev->owner))
- _x11_elm_object_cnp_selection_clear(sel->widget, type);
- e = calloc(1, sizeof(Elm_Cnp_Event_Selection_Changed));
- EINA_SAFETY_ON_NULL_RETURN_VAL(e, ECORE_CALLBACK_RENEW);
- e->type = type;
- e->seat_id = 1; /* under x11 this is always the default seat */
- e->exists = !!ev->owner;
- ecore_event_add(ELM_CNP_EVENT_SELECTION_CHANGED, e, NULL, NULL);
- return ECORE_CALLBACK_RENEW;
-}
-
-/*
- * Response to a selection notify:
- * - So we have asked for the selection list.
- * - If it's the targets list, parse it, and fire of what we want,
- * else it's the data we want.
- */
-static Eina_Bool
-_x11_selection_notify(void *udata EINA_UNUSED, int type EINA_UNUSED, void *event)
-{
- Ecore_X_Event_Selection_Notify *ev = event;
- X11_Cnp_Selection *sel;
- int i;
-
- cnp_debug("selection notify callback: %d\n",ev->selection);
- switch (ev->selection)
- {
- case ECORE_X_SELECTION_PRIMARY:
- sel = _x11_selections + ELM_SEL_TYPE_PRIMARY;
- break;
- case ECORE_X_SELECTION_SECONDARY:
- sel = _x11_selections + ELM_SEL_TYPE_SECONDARY;
- break;
- case ECORE_X_SELECTION_XDND:
- sel = _x11_selections + ELM_SEL_TYPE_XDND;
- break;
- case ECORE_X_SELECTION_CLIPBOARD:
- sel = _x11_selections + ELM_SEL_TYPE_CLIPBOARD;
- break;
- default:
- return ECORE_CALLBACK_PASS_ON;
- }
- cnp_debug("Target is %s\n", ev->target);
-
- if (ev->selection != ECORE_X_SELECTION_XDND &&
- (!strcmp(ev->target, "TARGETS") || !strcmp(ev->target, "ATOMS")))
- {
- _x11_notify_handler_targets(sel, ev);
- return ECORE_CALLBACK_PASS_ON;
- }
- for (i = 0; i < CNP_N_ATOMS; i++)
- {
- if (!strcmp(ev->target, _atoms[i].name))
- {
- if (_atoms[i].x_data_preparer)
- {
- Elm_Selection_Data ddata;
- Tmp_Info *tmp_info = NULL;
- Eina_Bool success;
- ddata.data = NULL;
- cnp_debug("Found something: %s\n", _atoms[i].name);
- success = _atoms[i].x_data_preparer(ev, &ddata, &tmp_info);
- if (_atoms[i].formats == ELM_SEL_FORMAT_IMAGE && savedtypes.imgfile) break;
- if (ev->selection == ECORE_X_SELECTION_XDND)
- {
- if (success)
- {
- Dropable *dropable;
- Eina_List *l;
- cnp_debug("drag & drop\n");
- EINA_LIST_FOREACH(drops, l, dropable)
- {
- if (dropable->obj == sel->requestwidget) break;
- dropable = NULL;
- }
- if (dropable)
- {
- Dropable_Cbs *cbs;
- Eina_Inlist *itr;
- ddata.x = savedtypes.x;
- ddata.y = savedtypes.y;
- EINA_INLIST_FOREACH_SAFE(dropable->cbs_list, itr, cbs)
- if ((cbs->types & dropable->last.format) && cbs->dropcb)
- cbs->dropcb(cbs->dropdata, dropable->obj, &ddata);
- }
- }
- /* We have to finish DnD, no matter what */
- ecore_x_dnd_send_finished();
- }
- else if (sel->datacb && success)
- {
- ddata.x = ddata.y = 0;
- sel->datacb(sel->udata, sel->requestwidget, &ddata);
- }
- free(ddata.data);
- if (tmp_info) _tmpinfo_free(tmp_info);
- }
- else cnp_debug("Ignored: No handler!\n");
- break;
- }
- }
- return ECORE_CALLBACK_PASS_ON;
-}
-
-static Elm_Sel_Format
-_get_selection_type(void *data, int size)
-{
- if (size == sizeof(Elm_Sel_Type))
- {
- unsigned int seltype = *((unsigned int *)data);
- if (seltype > ELM_SEL_TYPE_CLIPBOARD)
- return ELM_SEL_FORMAT_NONE;
- X11_Cnp_Selection *sel = _x11_selections + seltype;
- if (sel->active &&
- (sel->format >= ELM_SEL_FORMAT_TARGETS) &&
- (sel->format <= ELM_SEL_FORMAT_HTML))
- return sel->format;
- }
- return ELM_SEL_FORMAT_NONE;
-}
-
-static Eina_Bool
-_x11_targets_converter(char *target EINA_UNUSED, void *data, int size, void **data_ret, int *size_ret, Ecore_X_Atom *ttype, int *typesize)
-{
- int i, count;
- Ecore_X_Atom *aret;
- X11_Cnp_Selection *sel;
- Elm_Sel_Format seltype;
-
- if (!data_ret) return EINA_FALSE;
- if (_get_selection_type(data, size) == ELM_SEL_FORMAT_NONE)
- {
- /* TODO : fallback into precise type */
- seltype = ELM_SEL_FORMAT_TEXT;
- }
- else
- {
- sel = _x11_selections + *((int *)data);
- seltype = sel->format;
- }
-
- for (i = CNP_ATOM_LISTING_ATOMS + 1, count = 0; i < CNP_N_ATOMS ; i++)
- {
- if (seltype & _atoms[i].formats) count++;
- }
- aret = malloc(sizeof(Ecore_X_Atom) * count);
- if (!aret) return EINA_FALSE;
- for (i = CNP_ATOM_LISTING_ATOMS + 1, count = 0; i < CNP_N_ATOMS ; i++)
- {
- if (seltype & _atoms[i].formats)
- aret[count ++] = _atoms[i].x_atom;
- }
-
- *data_ret = aret;
- if (typesize) *typesize = 32 /* urk */;
- if (ttype) *ttype = ECORE_X_ATOM_ATOM;
- if (size_ret) *size_ret = count;
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_x11_image_converter(char *target EINA_UNUSED, void *data EINA_UNUSED, int size EINA_UNUSED, void **data_ret EINA_UNUSED, int *size_ret EINA_UNUSED, Ecore_X_Atom *ttype EINA_UNUSED, int *typesize EINA_UNUSED)
-{
- cnp_debug("Image converter called\n");
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_x11_vcard_send(char *target EINA_UNUSED, void *data EINA_UNUSED, int size EINA_UNUSED, void **data_ret, int *size_ret, Ecore_X_Atom *ttype EINA_UNUSED, int *typesize EINA_UNUSED)
-{
- X11_Cnp_Selection *sel;
-
- cnp_debug("Vcard send called\n");
- sel = _x11_selections + *((int *)data);
- if (data_ret) *data_ret = strdup(sel->selbuf);
- if (size_ret) *size_ret = strlen(sel->selbuf);
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_x11_is_uri_type_data(X11_Cnp_Selection *sel EINA_UNUSED, Ecore_X_Event_Selection_Notify *notify)
-{
- Ecore_X_Selection_Data *data;
- char *p;
-
- data = notify->data;
- cnp_debug("data->format is %d %p %p\n", data->format, notify, data);
- if (data->content == ECORE_X_SELECTION_CONTENT_FILES) return EINA_TRUE;
- p = (char *)data->data;
- if (!p) return EINA_TRUE;
- cnp_debug("Got %s\n", p);
- if (strncmp(p, "file:/", 6))
- {
- if (*p != '/') return EINA_FALSE;
- }
- return EINA_TRUE;
-}
-
-/*
- * Callback to handle a targets response on a selection request:
- * So pick the format we'd like; and then request it.
- */
-static Eina_Bool
-_x11_notify_handler_targets(X11_Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify)
-{
- Ecore_X_Selection_Data_Targets *targets;
- Ecore_X_Atom *atomlist;
- int i, j;
-
- targets = notify->data;
- atomlist = (Ecore_X_Atom *)(targets->data.data);
- for (j = (CNP_ATOM_LISTING_ATOMS + 1); j < CNP_N_ATOMS; j++)
- {
- cnp_debug("\t%s %d\n", _atoms[j].name, _atoms[j].x_atom);
- if (!(_atoms[j].formats & sel->requestformat)) continue;
- for (i = 0; i < targets->data.length; i++)
- {
- if ((_atoms[j].x_atom == atomlist[i]) && (_atoms[j].x_data_preparer))
- {
- if (j == CNP_ATOM_text_urilist)
- {
- if (!_x11_is_uri_type_data(sel, notify)) continue;
- }
- cnp_debug("Atom %s matches\n", _atoms[j].name);
- goto done;
- }
- }
- }
- cnp_debug("Couldn't find anything that matches\n");
- return ECORE_CALLBACK_PASS_ON;
-done:
- cnp_debug("Sending request for %s, xwin=%#llx\n",
- _atoms[j].name, (unsigned long long)sel->xwin);
- sel->request(sel->xwin, _atoms[j].name);
- return ECORE_CALLBACK_PASS_ON;
-}
-
-static Eina_Bool
-_x11_data_preparer_text(Ecore_X_Event_Selection_Notify *notify,
- Elm_Selection_Data *ddata, Tmp_Info **tmp_info EINA_UNUSED)
-{
- Ecore_X_Selection_Data *data = notify->data;
- ddata->format = ELM_SEL_FORMAT_TEXT;
- ddata->data = eina_memdup(data->data, data->length, EINA_TRUE);
- ddata->len = data->length;
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_x11_data_preparer_markup(Ecore_X_Event_Selection_Notify *notify,
- Elm_Selection_Data *ddata, Tmp_Info **tmp_info EINA_UNUSED)
-{
- Ecore_X_Selection_Data *data = notify->data;
- ddata->format = ELM_SEL_FORMAT_MARKUP;
- ddata->data = eina_memdup(data->data, data->length, EINA_TRUE);
- ddata->len = data->length;
- return EINA_TRUE;
-}
-
-/**
- * So someone is pasting an image into my entry or widget...
- */
-static Eina_Bool
-_x11_data_preparer_uri(Ecore_X_Event_Selection_Notify *notify,
- Elm_Selection_Data *ddata, Tmp_Info **tmp_info EINA_UNUSED)
-{
- Ecore_X_Selection_Data *data;
- Ecore_X_Selection_Data_Files *files;
- char *p, *stripstr = NULL;
-
- data = notify->data;
- cnp_debug("data->format is %d %p %p\n", data->format, notify, data);
- if (data->content == ECORE_X_SELECTION_CONTENT_FILES)
- {
- Efreet_Uri *uri;
- Eina_Strbuf *strbuf;
- int i;
-
- cnp_debug("got a files list\n");
- files = notify->data;
- /*
- if (files->num_files > 1)
- {
- // Don't handle many items <- this makes mr bigglesworth sad :(
- cnp_debug("more then one file: Bailing\n");
- return EINA_FALSE;
- }
- stripstr = p = strdup(files->files[0]);
- */
-
- strbuf = eina_strbuf_new();
- if (!strbuf)
- return EINA_FALSE;
-
- for (i = 0; i < files->num_files ; i++)
- {
- uri = efreet_uri_decode(files->files[i]);
- if (uri)
- {
- eina_strbuf_append(strbuf, uri->path);
- efreet_uri_free(uri);
- }
- else
- {
- eina_strbuf_append(strbuf, files->files[i]);
- }
- if (i < (files->num_files - 1))
- eina_strbuf_append(strbuf, "\n");
- }
- stripstr = eina_strbuf_string_steal(strbuf);
- eina_strbuf_free(strbuf);
- }
- else
- {
- Efreet_Uri *uri;
-
- p = (char *)eina_memdup((unsigned char *)data->data, data->length, EINA_TRUE);
- if (!p) return EINA_FALSE;
- uri = efreet_uri_decode(p);
- if (!uri)
- {
- /* Is there any reason why we care of URI without scheme? */
- if (p[0] == '/') stripstr = p;
- else free(p);
- }
- else
- {
- free(p);
- stripstr = strdup(uri->path);
- efreet_uri_free(uri);
- }
- }
-
- if (!stripstr)
- {
- cnp_debug("Couldn't find a file\n");
- return EINA_FALSE;
- }
- free(savedtypes.imgfile);
- if (savedtypes.textreq)
- {
- savedtypes.textreq = 0;
- savedtypes.imgfile = stripstr;
- }
- else
- {
- ddata->format = ELM_SEL_FORMAT_IMAGE;
- ddata->data = stripstr;
- ddata->len = strlen(stripstr);
- savedtypes.imgfile = NULL;
- }
- return EINA_TRUE;
-}
-
-/**
- * Just received an vcard, either through cut and paste, or dnd.
- */
-static Eina_Bool
-_x11_data_preparer_vcard(Ecore_X_Event_Selection_Notify *notify,
- Elm_Selection_Data *ddata, Tmp_Info **tmp_info EINA_UNUSED)
-{
- cnp_debug("vcard receive\n");
- Ecore_X_Selection_Data *data = notify->data;
- ddata->format = ELM_SEL_FORMAT_VCARD;
- ddata->data = eina_memdup(data->data, data->length, EINA_TRUE);
- ddata->len = data->length;
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_x11_data_preparer_image(Ecore_X_Event_Selection_Notify *notify,
- Elm_Selection_Data *ddata, Tmp_Info **tmp_info)
-{
- Ecore_X_Selection_Data *data = notify->data;
- cnp_debug("got a image file!\n");
- cnp_debug("Size if %d\n", data->length);
-
- ddata->format = ELM_SEL_FORMAT_IMAGE;
- data = notify->data;
-
- Tmp_Info *tmp = _tempfile_new(data->length);
- if (!tmp) return EINA_FALSE;
- memcpy(tmp->map, data->data, data->length);
- munmap(tmp->map, data->length);
- ddata->data = strdup(tmp->filename);
- ddata->len = strlen(tmp->filename);
- *tmp_info = tmp;
- return EINA_TRUE;
-}
-
-/**
- * Warning: Generic text/html can';t handle it sanely.
- * Firefox sends ucs2 (i think).
- * chrome sends utf8... blerg
- */
-/*
-static int
-_x11_notify_handler_html(X11_Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify)
-{
- Ecore_X_Selection_Data *data;
-
- cnp_debug("Got some HTML: Checking encoding is useful\n");
- data = notify->data;
- char *stripstr = malloc(data->length + 1);
- if (!stripstr) return 0;
- strncpy(stripstr, (char *)data->data, data->length);
- stripstr[data->length] = '\0';
-
- if (sel->datacb)
- {
- Elm_Selection_Data ddata;
- ddata.x = ddata.y = 0;
- ddata.format = ELM_SEL_FORMAT_HTML;
- ddata.data = stripstr;
- ddata.len = data->length;
- ddata.action = ELM_XDND_ACTION_UNKNOWN;
- sel->datacb(sel->udata, sel->widget, &ddata);
- free(stripstr);
- return 0;
- }
-
- cnp_debug("String is %s (%d bytes)\n", stripstr, data->length);
- // TODO BUG: should never NEVER assume it's an elm_entry!
- _elm_entry_entry_paste(sel->requestwidget, stripstr);
- free(stripstr);
- return 0;
-}
-*/
-
-static Eina_Bool
-_x11_text_converter(char *target, void *data, int size, void **data_ret, int *size_ret, Ecore_X_Atom *ttype, int *typesize)
-{
- X11_Cnp_Selection *sel;
-
- cnp_debug("text converter\n");
- if (_get_selection_type(data, size) == ELM_SEL_FORMAT_NONE)
- {
- if (data_ret)
- {
- *data_ret = malloc(size * sizeof(char) + 1);
- if (!*data_ret) return EINA_FALSE;
- memcpy(*data_ret, data, size);
- ((char**)(data_ret))[0][size] = 0;
- }
- if (size_ret) *size_ret = size;
- return EINA_TRUE;
- }
- sel = _x11_selections + *((int *)data);
- if (!sel->active) return EINA_TRUE;
-
- if ((sel->format & ELM_SEL_FORMAT_MARKUP) ||
- (sel->format & ELM_SEL_FORMAT_HTML))
- {
- *data_ret = _elm_util_mkup_to_text(sel->selbuf);
- if (size_ret && *data_ret) *size_ret = strlen(*data_ret);
- }
- else if (sel->format & ELM_SEL_FORMAT_TEXT)
- {
- ecore_x_selection_converter_text(target, sel->selbuf,
- strlen(sel->selbuf),
- data_ret, size_ret,
- ttype, typesize);
- }
- else if (sel->format & ELM_SEL_FORMAT_IMAGE)
- {
- cnp_debug("Image %s\n", evas_object_type_get(sel->widget));
- cnp_debug("Elm type: %s\n", elm_object_widget_type_get(sel->widget));
- evas_object_image_file_get(elm_photocam_internal_image_get(sel->widget),
- (const char **)data_ret, NULL);
- if (!*data_ret) *data_ret = strdup("No file");
- else *data_ret = strdup(*data_ret);
-
- if (!*data_ret)
- {
- ERR("Failed to allocate memory!");
- *size_ret = 0;
- return EINA_FALSE;
- }
-
- *size_ret = strlen(*data_ret);
- }
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_x11_general_converter(char *target EINA_UNUSED, void *data, int size, void **data_ret, int *size_ret, Ecore_X_Atom *ttype EINA_UNUSED, int *typesize EINA_UNUSED)
-{
- if (_get_selection_type(data, size) == ELM_SEL_FORMAT_NONE)
- {
- if (data_ret)
- {
- *data_ret = malloc(size * sizeof(char) + 1);
- if (!*data_ret) return EINA_FALSE;
- memcpy(*data_ret, data, size);
- ((char**)(data_ret))[0][size] = 0;
- }
- if (size_ret) *size_ret = size;
- }
- else
- {
- X11_Cnp_Selection *sel = _x11_selections + *((int *)data);
- if (sel->selbuf)
- {
- if (data_ret) *data_ret = strdup(sel->selbuf);
- if (size_ret) *size_ret = strlen(sel->selbuf);
- }
- else
- {
- if (data_ret) *data_ret = NULL;
- if (size_ret) *size_ret = 0;
- }
- }
- return EINA_TRUE;
-}
-
-static Dropable *
-_x11_dropable_find(Ecore_X_Window win)
-{
- Eina_List *l;
- Dropable *dropable;
-
- if (!drops) return NULL;
- EINA_LIST_FOREACH(drops, l, dropable)
- {
- if (_x11_elm_widget_xwin_get(dropable->obj) == win) return dropable;
- }
- return NULL;
-}
-
-static Evas *
-_x11_evas_get_from_xwin(Ecore_X_Window win)
-{
- /* Find the Evas connected to the window */
- Dropable *dropable = _x11_dropable_find(win);
- return dropable ? evas_object_evas_get(dropable->obj) : NULL;
-}
-
-static Eina_Bool
-_x11_dnd_enter(void *data EINA_UNUSED, int etype EINA_UNUSED, void *ev)
-{
- Ecore_X_Event_Xdnd_Enter *enter = ev;
- int i;
- Dropable *dropable;
-
- if (!enter) return EINA_TRUE;
- dropable = _x11_dropable_find(enter->win);
- if (dropable)
- {
- cnp_debug("Enter %x\n", enter->win);
- }
- /* Skip it */
- cnp_debug("enter types=%p (%d)\n", enter->types, enter->num_types);
- if ((!enter->num_types) || (!enter->types)) return EINA_TRUE;
-
- cnp_debug("Types\n");
- savedtypes.ntypes = enter->num_types;
- free(savedtypes.types);
- savedtypes.types = malloc(sizeof(char *) * enter->num_types);
- if (!savedtypes.types) return EINA_FALSE;
-
- for (i = 0; i < enter->num_types; i++)
- {
- savedtypes.types[i] = eina_stringshare_add(enter->types[i]);
- cnp_debug("Type is %s %p %p\n", enter->types[i],
- savedtypes.types[i], text_uri);
- if (savedtypes.types[i] == text_uri)
- {
- /* Request it, so we know what it is */
- cnp_debug("Sending uri request\n");
- savedtypes.textreq = 1;
- ELM_SAFE_FREE(savedtypes.imgfile, free);
- ecore_x_selection_xdnd_request(enter->win, text_uri);
- }
- }
-
- /* FIXME: Find an object and make it current */
- return EINA_TRUE;
-}
-
-static void
-_x11_dnd_dropable_handle(Dropable *dropable, Evas_Coord x, Evas_Coord y, Elm_Xdnd_Action action)
-{
- Dropable *d, *last_dropable = NULL;
- Eina_List *l;
- Dropable_Cbs *cbs;
- Eina_Inlist *itr;
-
- EINA_LIST_FOREACH(drops, l, d)
- {
- if (d->last.in)
- {
- last_dropable = d;
- break;
- }
- }
- if (last_dropable)
- {
- if (last_dropable == dropable) // same
- {
- Evas_Coord ox, oy;
-
- cnp_debug("same obj dropable %p\n", dropable->obj);
- evas_object_geometry_get(dropable->obj, &ox, &oy, NULL, NULL);
- EINA_INLIST_FOREACH_SAFE(dropable->cbs_list, itr, cbs)
- if ((cbs->types & dropable->last.format) && cbs->poscb)
- cbs->poscb(cbs->posdata, dropable->obj, x - ox, y - oy, action);
- }
- else
- {
- if (dropable) // leave last obj and enter new one
- {
- cnp_debug("leave %p\n", last_dropable->obj);
- cnp_debug("enter %p\n", dropable->obj);
- last_dropable->last.in = EINA_FALSE;
- last_dropable->last.type = NULL;
- dropable->last.in = EINA_TRUE;
- EINA_INLIST_FOREACH_SAFE(dropable->cbs_list, itr, cbs)
- if ((cbs->types & dropable->last.format) && cbs->entercb)
- cbs->entercb(cbs->enterdata, dropable->obj);
- EINA_INLIST_FOREACH_SAFE(last_dropable->cbs_list, itr, cbs)
- if ((cbs->types & last_dropable->last.format) && cbs->leavecb)
- cbs->leavecb(cbs->leavedata, last_dropable->obj);
- }
- else // leave last obj
- {
- cnp_debug("leave %p\n", last_dropable->obj);
- last_dropable->last.in = EINA_FALSE;
- last_dropable->last.type = NULL;
- EINA_INLIST_FOREACH_SAFE(last_dropable->cbs_list, itr, cbs)
- if ((cbs->types & last_dropable->last.format) && cbs->leavecb)
- cbs->leavecb(cbs->leavedata, last_dropable->obj);
- }
- }
- }
- else
- {
- if (dropable) // enter new obj
- {
- Evas_Coord ox, oy;
-
- cnp_debug("enter %p\n", dropable->obj);
- evas_object_geometry_get(dropable->obj, &ox, &oy, NULL, NULL);
- dropable->last.in = EINA_TRUE;
- EINA_INLIST_FOREACH_SAFE(dropable->cbs_list, itr, cbs)
- {
- if (cbs->types & dropable->last.format)
- {
- if (cbs->entercb)
- cbs->entercb(cbs->enterdata, dropable->obj);
- if (cbs->poscb)
- cbs->poscb(cbs->posdata, dropable->obj,
- x - ox, y - oy, action);
- }
- }
- }
- else
- {
- cnp_debug("both dropable & last_dropable are null\n");
- }
- }
-}
-
-static Elm_Xdnd_Action
-_x11_dnd_action_map(Ecore_X_Atom action)
-{
- Elm_Xdnd_Action act = ELM_XDND_ACTION_UNKNOWN;
-
- if (action == ECORE_X_ATOM_XDND_ACTION_COPY)
- act = ELM_XDND_ACTION_COPY;
- else if (action == ECORE_X_ATOM_XDND_ACTION_MOVE)
- act = ELM_XDND_ACTION_MOVE;
- else if (action == ECORE_X_ATOM_XDND_ACTION_PRIVATE)
- act = ELM_XDND_ACTION_PRIVATE;
- else if (action == ECORE_X_ATOM_XDND_ACTION_ASK)
- act = ELM_XDND_ACTION_ASK;
- else if (action == ECORE_X_ATOM_XDND_ACTION_LIST)
- act = ELM_XDND_ACTION_LIST;
- else if (action == ECORE_X_ATOM_XDND_ACTION_LINK)
- act = ELM_XDND_ACTION_LINK;
- else if (action == ECORE_X_ATOM_XDND_ACTION_DESCRIPTION)
- act = ELM_XDND_ACTION_DESCRIPTION;
- return act;
-}
-
-static Ecore_X_Atom
-_x11_dnd_action_rev_map(Elm_Xdnd_Action action)
-{
- Ecore_X_Atom act = ECORE_X_ATOM_XDND_ACTION_MOVE;
-
- if (action == ELM_XDND_ACTION_COPY)
- act = ECORE_X_ATOM_XDND_ACTION_COPY;
- else if (action == ELM_XDND_ACTION_MOVE)
- act = ECORE_X_ATOM_XDND_ACTION_MOVE;
- else if (action == ELM_XDND_ACTION_PRIVATE)
- act = ECORE_X_ATOM_XDND_ACTION_PRIVATE;
- else if (action == ELM_XDND_ACTION_ASK)
- act = ECORE_X_ATOM_XDND_ACTION_ASK;
- else if (action == ELM_XDND_ACTION_LIST)
- act = ECORE_X_ATOM_XDND_ACTION_LIST;
- else if (action == ELM_XDND_ACTION_LINK)
- act = ECORE_X_ATOM_XDND_ACTION_LINK;
- else if (action == ELM_XDND_ACTION_DESCRIPTION)
- act = ECORE_X_ATOM_XDND_ACTION_DESCRIPTION;
- return act;
-}
-
-static Eina_Bool
-_x11_dnd_position(void *data EINA_UNUSED, int etype EINA_UNUSED, void *ev)
-{
- Ecore_X_Event_Xdnd_Position *pos = ev;
- Ecore_X_Rectangle rect = { 0, 0, 0, 0 };
- Dropable *dropable;
- Elm_Xdnd_Action act;
-
- /* Need to send a status back */
- /* FIXME: Should check I can drop here */
- /* FIXME: Should highlight widget */
- dropable = _x11_dropable_find(pos->win);
- if (dropable)
- {
- Evas_Coord x, y, ox = 0, oy = 0;
-
- act = _x11_dnd_action_map(pos->action);
- x = pos->position.x;
- y = pos->position.y;
- _dropable_coords_adjust(dropable, &x, &y);
- Evas *evas = _x11_evas_get_from_xwin(pos->win);
- Eina_List *dropable_list = evas ? _dropable_list_geom_find(evas, x, y) : NULL;
- /* check if there is dropable (obj) can accept this drop */
- if (dropable_list)
- {
- Elm_Sel_Format saved_format = _dnd_types_to_format(savedtypes.types, savedtypes.ntypes);
- Eina_List *l;
- Eina_Bool found = EINA_FALSE;
-
- EINA_LIST_FOREACH(dropable_list, l, dropable)
- {
- Dropable_Cbs *cbs;
- Eina_Inlist *itr;
- EINA_INLIST_FOREACH_SAFE(dropable->cbs_list, itr, cbs)
- {
- Elm_Sel_Format common_fmt = saved_format & cbs->types;
- if (common_fmt)
- {
- /* We found a target that can accept this type of data */
- int i, min_index = CNP_N_ATOMS;
- /* We have to find the first atom that corresponds to one
- * of the supported data types. */
- for (i = 0; i < savedtypes.ntypes; i++)
- {
- Cnp_Atom *atom = eina_hash_find(_types_hash, savedtypes.types[i]);
- if (atom && (atom->formats & common_fmt))
- {
- int atom_idx = (atom - _atoms);
- if (min_index > atom_idx) min_index = atom_idx;
- }
- }
- if (min_index != CNP_N_ATOMS)
- {
- cnp_debug("Found atom %s\n", _atoms[min_index].name);
- found = EINA_TRUE;
- dropable->last.type = _atoms[min_index].name;
- dropable->last.format = common_fmt;
- break;
- }
- }
- }
- if (found) break;
- }
- if (found)
- {
- Dropable *d = NULL;
- Eina_Rectangle inter_rect = {0, 0, 0, 0};
- int idx = 0;
- EINA_LIST_FOREACH(dropable_list, l, d)
- {
- if (idx == 0)
- {
- evas_object_geometry_get(d->obj, &inter_rect.x, &inter_rect.y,
- &inter_rect.w, &inter_rect.h);
- }
- else
- {
- Eina_Rectangle cur_rect;
- evas_object_geometry_get(d->obj, &cur_rect.x, &cur_rect.y,
- &cur_rect.w, &cur_rect.h);
- if (!eina_rectangle_intersection(&inter_rect, &cur_rect)) continue;
- }
- idx++;
- }
- rect.x = inter_rect.x;
- rect.y = inter_rect.y;
- rect.width = inter_rect.w;
- rect.height = inter_rect.h;
- ecore_x_dnd_send_status(EINA_TRUE, EINA_FALSE, rect, pos->action);
- cnp_debug("dnd position %i %i %p\n", x - ox, y - oy, dropable);
- _x11_dnd_dropable_handle(dropable, x - ox, y - oy, act);
- // CCCCCCC: call dnd exit on last obj if obj != last
- // CCCCCCC: call drop position on obj
- }
- else
- {
- //if not: send false status
- ecore_x_dnd_send_status(EINA_FALSE, EINA_FALSE, rect, pos->action);
- cnp_debug("dnd position (%d, %d) not in obj\n", x, y);
- _x11_dnd_dropable_handle(NULL, 0, 0, act);
- // CCCCCCC: call dnd exit on last obj
- }
- eina_list_free(dropable_list);
- }
- else
- {
- ecore_x_dnd_send_status(EINA_FALSE, EINA_FALSE, rect, pos->action);
- cnp_debug("dnd position (%d, %d) has no drop\n", x, y);
- _x11_dnd_dropable_handle(NULL, 0, 0, act);
- }
- }
- else
- {
- ecore_x_dnd_send_status(EINA_FALSE, EINA_FALSE, rect, pos->action);
- }
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_x11_dnd_leave(void *data EINA_UNUSED, int etype EINA_UNUSED, void *ev)
-{
-#ifdef DEBUGON
- cnp_debug("Leave %x\n", ((Ecore_X_Event_Xdnd_Leave *)ev)->win);
-#else
- (void)ev;
-#endif
- _x11_dnd_dropable_handle(NULL, 0, 0, ELM_XDND_ACTION_UNKNOWN);
- // CCCCCCC: call dnd exit on last obj if there was one
- // leave->win leave->source
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_x11_dnd_drop(void *data EINA_UNUSED, int etype EINA_UNUSED, void *ev)
-{
- Ecore_X_Event_Xdnd_Drop *drop;
- Dropable *dropable = NULL;
- Elm_Selection_Data ddata;
- Evas_Coord x = 0, y = 0;
- Elm_Xdnd_Action act = ELM_XDND_ACTION_UNKNOWN;
- Eina_List *l;
- Dropable_Cbs *cbs;
- Eina_Inlist *itr;
-
- drop = ev;
-
- cnp_debug("drops %p (%d)\n", drops, eina_list_count(drops));
- if (!(dropable = _x11_dropable_find(drop->win))) return EINA_TRUE;
-
- /* Calculate real (widget relative) position */
- // - window position
- // - widget position
- savedtypes.x = drop->position.x;
- savedtypes.y = drop->position.y;
- _dropable_coords_adjust(dropable, &savedtypes.x, &savedtypes.y);
-
- cnp_debug("Drop position is %d,%d\n", savedtypes.x, savedtypes.y);
-
- EINA_LIST_FOREACH(drops, l, dropable)
- {
- if (dropable->last.in)
- {
- evas_object_geometry_get(dropable->obj, &x, &y, NULL, NULL);
- savedtypes.x -= x;
- savedtypes.y -= y;
- goto found;
- }
- }
-
- cnp_debug("Didn't find a target\n");
- return EINA_TRUE;
-
-found:
- cnp_debug("0x%x\n", drop->win);
-
- act = _x11_dnd_action_map(drop->action);
-
- dropable->last.in = EINA_FALSE;
- cnp_debug("Last type: %s - Last format: %X\n", dropable->last.type, dropable->last.format);
- if ((!strcmp(dropable->last.type, text_uri)))
- {
- cnp_debug("We found a URI... (%scached) %s\n",
- savedtypes.imgfile ? "" : "not ",
- savedtypes.imgfile);
- if (savedtypes.imgfile)
- {
- ddata.x = savedtypes.x;
- ddata.y = savedtypes.y;
- ddata.action = act;
-
- EINA_INLIST_FOREACH_SAFE(dropable->cbs_list, itr, cbs)
- {
- /* If it's markup that also supports images */
- if (cbs->types & ELM_SEL_FORMAT_IMAGE)
- {
- cnp_debug("Doing image insert (%s)\n", savedtypes.imgfile);
- ddata.format = ELM_SEL_FORMAT_IMAGE;
- ddata.data = (char *)savedtypes.imgfile;
- ddata.len = strlen(ddata.data);
- if ((cbs->types & dropable->last.format) && cbs->dropcb)
- cbs->dropcb(cbs->dropdata, dropable->obj, &ddata);
- }
- else
- {
- cnp_debug("Item doesn't support images... passing\n");
- }
- }
- ecore_x_dnd_send_finished();
- ELM_SAFE_FREE(savedtypes.imgfile, free);
- return EINA_TRUE;
- }
- else if (savedtypes.textreq)
- {
- /* Already asked: Pretend we asked now, and paste immediately when
- * it comes in */
- savedtypes.textreq = 0;
- ecore_x_dnd_send_finished();
- return EINA_TRUE;
- }
- }
-
- cnp_debug("doing a request then: %s\n", dropable->last.type);
- _x11_selections[ELM_SEL_TYPE_XDND].xwin = drop->win;
- _x11_selections[ELM_SEL_TYPE_XDND].requestwidget = dropable->obj;
- _x11_selections[ELM_SEL_TYPE_XDND].requestformat = dropable->last.format;
- _x11_selections[ELM_SEL_TYPE_XDND].active = EINA_TRUE;
- _x11_selections[ELM_SEL_TYPE_XDND].action = act;
- ecore_x_selection_xdnd_request(drop->win, dropable->last.type);
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_x11_dnd_status(void *data EINA_UNUSED, int etype EINA_UNUSED, void *ev)
-{
- Ecore_X_Event_Xdnd_Status *status = ev;
-
- doaccept = EINA_FALSE;
-
- /* Only thing we care about: will accept */
- if ((status) && (status->will_accept))
- {
- cnp_debug("Will accept\n");
- doaccept = EINA_TRUE;
- }
- /* Won't accept */
- else
- {
- cnp_debug("Won't accept accept\n");
- }
- if (dragacceptcb)
- dragacceptcb(dragacceptdata, _x11_selections[ELM_SEL_TYPE_XDND].widget,
- doaccept);
- return EINA_TRUE;
-}
-
-static void
-_x11_win_rotation_changed_cb(void *data, const Efl_Event *event)
-{
- Evas_Object *win = data;
- int rot = elm_win_rotation_get(event->object);
- elm_win_rotation_set(win, rot);
-}
-
-static Eina_Bool
-_x11_drag_mouse_up(void *data, int etype EINA_UNUSED, void *event)
-{
- Ecore_X_Window xwin = (Ecore_X_Window)(long)data;
- Ecore_Event_Mouse_Button *ev = event;
-
- if ((ev->buttons == 1) &&
- (ev->event_window == xwin))
- {
- Eina_Bool have_drops = EINA_FALSE;
- Eina_List *l;
- Dropable *dropable;
-
- ecore_x_pointer_ungrab();
- ELM_SAFE_FREE(handler_up, ecore_event_handler_del);
- ELM_SAFE_FREE(handler_status, ecore_event_handler_del);
- ecore_x_dnd_self_drop();
-
- cnp_debug("mouse up, xwin=%#llx\n", (unsigned long long)xwin);
-
- EINA_LIST_FOREACH(drops, l, dropable)
- {
- if (xwin == _x11_elm_widget_xwin_get(dropable->obj))
- {
- have_drops = EINA_TRUE;
- break;
- }
- }
- if (!have_drops) ecore_x_dnd_aware_set(xwin, EINA_FALSE);
- if (dragdonecb) dragdonecb(dragdonedata, dragwidget);
- if (dragwin)
- {
- if (dragwidget)
- {
- if (elm_widget_is(dragwidget))
- {
- Evas_Object *win = elm_widget_top_get(dragwidget);
- if (win && efl_isa(win, EFL_UI_WIN_CLASS))
- efl_event_callback_del(win, EFL_UI_WIN_EVENT_ROTATION_CHANGED, _x11_win_rotation_changed_cb, dragwin);
- }
- }
-
- if (!doaccept)
- { /* Commit animation when drag cancelled */
- /* Record final position of dragwin, then do animation */
- ecore_animator_timeline_add(0.3,
- _drag_cancel_animate, dragwin);
- }
- else
- { /* No animation drop was committed */
- Ecore_X_Window xdragwin = _x11_elm_widget_xwin_get(dragwin);
- ecore_x_window_ignore_set(xdragwin, 0);
- evas_object_del(dragwin);
- }
-
- dragwin = NULL; /* if not freed here, free in end of anim */
- }
-
- dragdonecb = NULL;
- dragacceptcb = NULL;
- dragposcb = NULL;
- dragwidget = NULL;
- doaccept = EINA_FALSE;
- /* moved to _drag_cancel_animate
- if (dragwin)
- {
- evas_object_del(dragwin);
- dragwin = NULL;
- }
- */
- }
- return EINA_TRUE;
-}
-
-static void
-_x11_drag_move(void *data EINA_UNUSED, Ecore_X_Xdnd_Position *pos)
-{
- evas_object_move(dragwin,
- pos->position.x - _dragx, pos->position.y - _dragy);
- dragwin_x_end = pos->position.x - _dragx;
- dragwin_y_end = pos->position.y - _dragy;
- cnp_debug("dragevas: %p -> %p\n",
- dragwidget,
- evas_object_evas_get(dragwidget));
- if (dragposcb)
- dragposcb(dragposdata, dragwidget, pos->position.x, pos->position.y,
- dragaction);
-}
-
-static Ecore_X_Window
-_x11_elm_widget_xwin_get(const Evas_Object *obj)
-{
- Evas_Object *top, *par;
- Ecore_X_Window xwin = 0;
-
- if (elm_widget_is(obj))
- {
- top = elm_widget_top_get(obj);
- if (!top)
- {
- par = elm_widget_parent_widget_get(obj);
- if (par) top = elm_widget_top_get(par);
- }
- if (top && (efl_isa(top, EFL_UI_WIN_CLASS)))
- xwin = elm_win_xwindow_get(top);
- }
- if (!xwin)
- {
- Ecore_Evas *ee;
- Evas *evas = evas_object_evas_get(obj);
- if (!evas) return 0;
- ee = ecore_evas_ecore_evas_get(evas);
- if (!ee) return 0;
-
- while(!xwin)
- {
- const char *engine_name = ecore_evas_engine_name_get(ee);
- if (!strcmp(engine_name, ELM_BUFFER))
- {
- ee = ecore_evas_buffer_ecore_evas_parent_get(ee);
- if (!ee) return 0;
- xwin = _elm_ee_xwin_get(ee);
- }
- else
- {
- /* In case the engine is not a buffer, we want to check once. */
- xwin = _elm_ee_xwin_get(ee);
- if (!xwin) return 0;
- }
- }
- }
- return xwin;
-}
-
-static Eina_Bool
-_x11_elm_cnp_init(void)
-{
- int i;
- static int _init_count = 0;
-
- if (_init_count > 0) return EINA_TRUE;
- _init_count++;
- for (i = 0; i < CNP_N_ATOMS; i++)
- {
- _atoms[i].x_atom = ecore_x_atom_get(_atoms[i].name);
- ecore_x_selection_converter_atom_add
- (_atoms[i].x_atom, _atoms[i].x_converter);
- }
- //XXX delete handlers?
- ecore_event_handler_add(ECORE_X_EVENT_SELECTION_CLEAR, _x11_selection_clear, NULL);
- ecore_event_handler_add(ECORE_X_EVENT_SELECTION_NOTIFY, _x11_selection_notify, NULL);
- ecore_event_handler_add(ECORE_X_EVENT_FIXES_SELECTION_NOTIFY, _x11_fixes_selection_notify, NULL);
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_x11_elm_cnp_selection_set(Ecore_X_Window xwin, Evas_Object *obj, Elm_Sel_Type selection, Elm_Sel_Format format, const void *selbuf, size_t buflen)
-{
- X11_Cnp_Selection *sel;
-
- _x11_elm_cnp_init();
- if ((!selbuf) && (format != ELM_SEL_FORMAT_IMAGE))
- return elm_object_cnp_selection_clear(obj, selection);
-
- sel = _x11_selections + selection;
- if (sel->widget != obj && sel->loss_cb) sel->loss_cb(sel->loss_data, selection);
- if (sel->widget)
- evas_object_event_callback_del_full(sel->widget, EVAS_CALLBACK_DEL,
- _x11_sel_obj_del, sel);
- sel->active = EINA_TRUE;
- sel->widget = obj;
- sel->xwin = xwin;
- if (sel->set) sel->set(xwin, &selection, sizeof(Elm_Sel_Type));
- sel->format = format;
- sel->loss_cb = NULL;
- sel->loss_data = NULL;
-
- evas_object_event_callback_add
- (sel->widget, EVAS_CALLBACK_DEL, _x11_sel_obj_del, sel);
-
- ELM_SAFE_FREE(sel->selbuf, free);
- if (selbuf)
- {
- if (format == ELM_SEL_FORMAT_IMAGE)
- {
- // selbuf is actual image data, not text/string
- sel->selbuf = malloc(buflen + 1);
- if (!sel->selbuf)
- {
- elm_object_cnp_selection_clear(obj, selection);
- return EINA_FALSE;
- }
- memcpy(sel->selbuf, selbuf, buflen);
- sel->selbuf[buflen] = 0;
- }
- else
- sel->selbuf = strdup((char*)selbuf);
- }
-
- return _local_elm_cnp_selection_set(obj, selection, format, selbuf, buflen);
-}
-
-static void
-_x11_elm_cnp_selection_loss_callback_set(Evas_Object *obj EINA_UNUSED, Elm_Sel_Type selection, Elm_Selection_Loss_Cb func, const void *data)
-{
- X11_Cnp_Selection *sel;
-
- _x11_elm_cnp_init();
- sel = _x11_selections + selection;
- sel->loss_cb = func;
- sel->loss_data = (void *)data;
-}
-
-static Eina_Bool
-_x11_elm_object_cnp_selection_clear(Evas_Object *obj, Elm_Sel_Type selection)
-{
- X11_Cnp_Selection *sel;
-
- _x11_elm_cnp_init();
-
- sel = _x11_selections + selection;
-
- /* No longer this selection: Consider it gone! */
- if ((!sel->active) || (sel->widget != obj)) return EINA_TRUE;
-
- if (sel->widget)
- evas_object_event_callback_del_full(sel->widget, EVAS_CALLBACK_DEL,
- _x11_sel_obj_del, sel);
- if (sel->requestwidget)
- evas_object_event_callback_del_full(sel->requestwidget, EVAS_CALLBACK_DEL,
- _x11_sel_obj_del2, sel);
- sel->widget = NULL;
- sel->requestwidget = NULL;
- sel->loss_cb = NULL;
- sel->loss_data = NULL;
-
- sel->active = EINA_FALSE;
- ELM_SAFE_FREE(sel->selbuf, free);
- sel->clear();
-
- return _local_elm_object_cnp_selection_clear(obj, selection);
-}
-
-static Eina_Bool
-_x11_elm_cnp_selection_get(Ecore_X_Window xwin, const Evas_Object *obj, Elm_Sel_Type selection,
- Elm_Sel_Format format, Elm_Drop_Cb datacb,
- void *udata)
-{
- X11_Cnp_Selection *sel;
-
- _x11_elm_cnp_init();
-
- sel = _x11_selections + selection;
- if (sel->active)
- return _local_elm_cnp_selection_get(obj, selection, format, datacb, udata);
-
- if (sel->requestwidget)
- evas_object_event_callback_del_full(sel->requestwidget, EVAS_CALLBACK_DEL,
- _x11_sel_obj_del2, sel);
- sel->requestformat = format;
- sel->requestwidget = (Evas_Object *)obj;
- sel->xwin = xwin;
- sel->request(xwin, ECORE_X_SELECTION_TARGET_TARGETS);
- sel->datacb = datacb;
- sel->udata = udata;
-
- evas_object_event_callback_add
- (sel->requestwidget, EVAS_CALLBACK_DEL, _x11_sel_obj_del2, sel);
-
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_x11_elm_drop_target_add(Evas_Object *obj, Elm_Sel_Format format,
- Elm_Drag_State entercb, void *enterdata,
- Elm_Drag_State leavecb, void *leavedata,
- Elm_Drag_Pos poscb, void *posdata,
- Elm_Drop_Cb dropcb, void *dropdata)
-{
- Dropable *dropable = NULL;
- Dropable_Cbs *cbs = NULL;
- Ecore_X_Window xwin = _x11_elm_widget_xwin_get(obj);
- Eina_List *l;
- Eina_Bool first = !drops;
- Eina_Bool have_drops = EINA_FALSE;
-
- _x11_elm_cnp_init();
-
- /* Is this the first? */
- EINA_LIST_FOREACH(drops, l, dropable)
- {
- if (xwin == _x11_elm_widget_xwin_get(dropable->obj))
- {
- have_drops = EINA_TRUE;
- break;
- }
- }
- dropable = NULL; // In case of error, we don't want to free it
-
- cbs = calloc(1, sizeof(*cbs));
- if (!cbs) return EINA_FALSE;
-
- cbs->entercb = entercb;
- cbs->enterdata = enterdata;
- cbs->leavecb = leavecb;
- cbs->leavedata = leavedata;
- cbs->poscb = poscb;
- cbs->posdata = posdata;
- cbs->dropcb = dropcb;
- cbs->dropdata = dropdata;
- cbs->types = format;
-
- dropable = efl_key_data_get(obj, "__elm_dropable");
- if (!dropable)
- {
- /* Create new drop */
- dropable = calloc(1, sizeof(Dropable));
- if (!dropable) goto error;
- dropable->last.in = EINA_FALSE;
- drops = eina_list_append(drops, dropable);
- if (!drops) goto error;
- dropable->obj = obj;
- efl_key_data_set(obj, "__elm_dropable", dropable);
- }
- dropable->cbs_list = eina_inlist_append(dropable->cbs_list, EINA_INLIST_GET(cbs));
-
- evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
- _all_drop_targets_cbs_del, obj);
- if (!have_drops) ecore_x_dnd_aware_set(xwin, EINA_TRUE);
-
- /* TODO BUG: should handle dnd-aware per window, not just the first
- * window that requested it! */
- /* If not the first: We're done */
- if (!first) return EINA_TRUE;
-
- cnp_debug("Adding drop target calls xwin=%#llx\n", (unsigned long long)xwin);
- handler_enter = ecore_event_handler_add(ECORE_X_EVENT_XDND_ENTER,
- _x11_dnd_enter, NULL);
- handler_leave = ecore_event_handler_add(ECORE_X_EVENT_XDND_LEAVE,
- _x11_dnd_leave, NULL);
- handler_pos = ecore_event_handler_add(ECORE_X_EVENT_XDND_POSITION,
- _x11_dnd_position, NULL);
- handler_drop = ecore_event_handler_add(ECORE_X_EVENT_XDND_DROP,
- _x11_dnd_drop, NULL);
- return EINA_TRUE;
-error:
- free(cbs);
- free(dropable);
- return EINA_FALSE;
-}
-
-static Eina_Bool
-_x11_elm_drop_target_del(Evas_Object *obj, Elm_Sel_Format format,
- Elm_Drag_State entercb, void *enterdata,
- Elm_Drag_State leavecb, void *leavedata,
- Elm_Drag_Pos poscb, void *posdata,
- Elm_Drop_Cb dropcb, void *dropdata)
-{
- Dropable *dropable = NULL;
- Eina_List *l;
- Ecore_X_Window xwin;
- Eina_Bool have_drops = EINA_FALSE;
-
- _x11_elm_cnp_init();
-
- if (!_local_elm_drop_target_del(obj, format, entercb, enterdata,
- leavecb, leavedata, poscb, posdata, dropcb, dropdata))
- {
- return EINA_FALSE;
- }
-
- /* TODO BUG: we should handle dnd-aware per window, not just the last that released it */
-
- /* If still drops there: All fine.. continue */
- if (drops) return EINA_TRUE;
-
- cnp_debug("Disabling DND\n");
- xwin = _x11_elm_widget_xwin_get(obj);
- EINA_LIST_FOREACH(drops, l, dropable)
- {
- if (xwin == _x11_elm_widget_xwin_get(dropable->obj))
- {
- have_drops = EINA_TRUE;
- break;
- }
- }
- if (!have_drops) ecore_x_dnd_aware_set(xwin, EINA_FALSE);
-
- if (!drops)
- {
- ELM_SAFE_FREE(handler_pos, ecore_event_handler_del);
- ELM_SAFE_FREE(handler_drop, ecore_event_handler_del);
- ELM_SAFE_FREE(handler_enter, ecore_event_handler_del);
- ELM_SAFE_FREE(handler_leave, ecore_event_handler_del);
- }
-
- ELM_SAFE_FREE(savedtypes.imgfile, free);
-
- return EINA_TRUE;
-}
-
-static void
-_x11_drag_target_del(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *info EINA_UNUSED)
-{
- X11_Cnp_Selection *sel = _x11_selections + ELM_SEL_TYPE_XDND;
-
- if (dragwidget == obj)
- {
- sel->widget = NULL;
- dragwidget = NULL;
- }
-}
-
-static Eina_Bool
-_x11_elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data,
- Elm_Xdnd_Action action,
- Elm_Drag_Icon_Create_Cb createicon, void *createdata,
- Elm_Drag_Pos dragpos, void *dragdata,
- Elm_Drag_Accept acceptcb, void *acceptdata,
- Elm_Drag_State dragdone, void *donecbdata)
-{
- Ecore_X_Window xwin = _x11_elm_widget_xwin_get(obj);
- Ecore_X_Window xdragwin;
- X11_Cnp_Selection *sel;
- Elm_Sel_Type xdnd = ELM_SEL_TYPE_XDND;
- Ecore_Evas *ee;
- int x, y, x2 = 0, y2 = 0, x3, y3;
- Evas_Object *icon = NULL;
- int w = 0, h = 0;
- int ex, ey, ew, eh;
- Ecore_X_Atom actx;
- int i;
- int xr, yr, rot;
-
- _x11_elm_cnp_init();
-
- cnp_debug("starting drag... %p\n", obj);
-
- if (dragwin)
- {
- cnp_debug("another obj is dragging...\n");
- return EINA_FALSE;
- }
-
- ecore_x_dnd_types_set(xwin, NULL, 0);
- for (i = CNP_ATOM_LISTING_ATOMS + 1; i < CNP_N_ATOMS; i++)
- {
- if (format == ELM_SEL_FORMAT_TARGETS || (_atoms[i].formats & format))
- {
- ecore_x_dnd_type_set(xwin, _atoms[i].name, EINA_TRUE);
- cnp_debug("set dnd type: %s\n", _atoms[i].name);
- }
- }
-
- sel = _x11_selections + ELM_SEL_TYPE_XDND;
- sel->active = EINA_TRUE;
- sel->widget = obj;
- sel->format = format;
- sel->selbuf = data ? strdup(data) : NULL;
- sel->action = action;
- dragwidget = obj;
- dragaction = action;
-
- evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
- _x11_drag_target_del, obj);
- /* TODO BUG: should NEVER have these as globals! They should be per context (window). */
- dragposcb = dragpos;
- dragposdata = dragdata;
- dragacceptcb = acceptcb;
- dragacceptdata = acceptdata;
- dragdonecb = dragdone;
- dragdonedata = donecbdata;
- /* TODO BUG: should increase dnd-awareness, in case it's drop target as well. See _x11_drag_mouse_up() */
- ecore_x_dnd_aware_set(xwin, EINA_TRUE);
- ecore_x_dnd_callback_pos_update_set(_x11_drag_move, NULL);
- ecore_x_dnd_self_begin(xwin, (unsigned char *)&xdnd, sizeof(Elm_Sel_Type));
- actx = _x11_dnd_action_rev_map(dragaction);
- ecore_x_dnd_source_action_set(actx);
- ecore_x_pointer_grab(xwin);
- handler_up = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP,
- _x11_drag_mouse_up,
- (void *)(long)xwin);
- handler_status = ecore_event_handler_add(ECORE_X_EVENT_XDND_STATUS,
- _x11_dnd_status, NULL);
- dragwin = elm_win_add(NULL, "Elm-Drag", ELM_WIN_DND);
- elm_win_alpha_set(dragwin, EINA_TRUE);
- elm_win_override_set(dragwin, EINA_TRUE);
- xdragwin = _x11_elm_widget_xwin_get(dragwin);
- ecore_x_window_ignore_set(xdragwin, 1);
-
- /* dragwin has to be rotated as the main window is */
- if (elm_widget_is(obj))
- {
- Evas_Object *win = elm_widget_top_get(obj);
- if (win && efl_isa(win, EFL_UI_WIN_CLASS))
- {
- elm_win_rotation_set(dragwin, elm_win_rotation_get(win));
- efl_event_callback_add(win, EFL_UI_WIN_EVENT_ROTATION_CHANGED, _x11_win_rotation_changed_cb, dragwin);
- }
- }
-
- if (createicon)
- {
- Evas_Coord xoff = 0, yoff = 0;
-
- icon = createicon(createdata, dragwin, &xoff, &yoff);
- if (icon)
- {
- x2 = xoff;
- y2 = yoff;
- evas_object_geometry_get(icon, NULL, NULL, &w, &h);
- }
- }
- else
- {
- icon = elm_icon_add(dragwin);
- evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- // need to resize
- }
- elm_win_resize_object_add(dragwin, icon);
-
- /* Position subwindow appropriately */
- ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
- ecore_evas_geometry_get(ee, &ex, &ey, &ew, &eh);
- evas_object_resize(dragwin, w, h);
-
- evas_object_show(icon);
- evas_object_show(dragwin);
- evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x3, &y3);
-
- rot = ecore_evas_rotation_get(ee);
- switch (rot)
- {
- case 90:
- xr = y3;
- yr = ew - x3;
- _dragx = y3 - y2;
- _dragy = x3 - x2;
- break;
- case 180:
- xr = ew - x3;
- yr = eh - y3;
- _dragx = x3 - x2;
- _dragy = y3 - y2;
- break;
- case 270:
- xr = eh - y3;
- yr = x3;
- _dragx = y3 - y2;
- _dragy = x3 - x2;
- break;
- default:
- xr = x3;
- yr = y3;
- _dragx = x3 - x2;
- _dragy = y3 - y2;
- break;
- }
- x = ex + xr - _dragx;
- y = ey + yr - _dragy;
- evas_object_move(dragwin, x, y);
- dragwin_x_start = dragwin_x_end = x;
- dragwin_y_start = dragwin_y_end = y;
-
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_x11_elm_drag_action_set(Evas_Object *obj, Elm_Xdnd_Action action)
-{
- Ecore_X_Atom actx;
-
- _x11_elm_cnp_init();
- if (!dragwin) return EINA_FALSE;
-
- if (dragwidget != obj) return EINA_FALSE;
- if (dragaction == action) return EINA_TRUE;
- dragaction = action;
- actx = _x11_dnd_action_rev_map(dragaction);
- ecore_x_dnd_source_action_set(actx);
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_x11_elm_selection_selection_has_owner(Evas_Object *obj EINA_UNUSED)
-{
- _x11_elm_cnp_init();
- return !!ecore_x_selection_owner_get(ECORE_X_ATOM_SELECTION_CLIPBOARD);
-}
-
-#endif
-
-#ifdef HAVE_ELEMENTARY_WL2
-struct _Wl_Cnp_Selection
-{
- char *selbuf;
- int buflen;
-
- Evas_Object *widget;
- Evas_Object *requestwidget;
-
- void *udata;
- Elm_Sel_Type seltype;
- Elm_Sel_Format requestformat;
- Elm_Drop_Cb datacb;
-
- Elm_Selection_Loss_Cb loss_cb;
- void *loss_data;
-
- Elm_Sel_Format format;
- Ecore_Wl2_Window *win;
- Elm_Xdnd_Action action;
- uint32_t selection_serial;
- uint32_t drag_serial;
-
- Eina_Bool active : 1;
-};
-
-static Eina_Bool _wl_elm_cnp_init(void);
-
-static Wl_Cnp_Selection wl_cnp_selection =
-{
- 0, 0, NULL, NULL,
- NULL, 0, 0, NULL, NULL, NULL,
- 0, NULL, 0, EINA_FALSE
-};
-
-static void _wl_sel_obj_del2(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED);
-static Eina_Bool _wl_elm_cnp_selection_set(Evas_Object *obj EINA_UNUSED, Elm_Sel_Type selection, Elm_Sel_Format format EINA_UNUSED, const void *selbuf, size_t buflen);
-static Eina_Bool _wl_elm_cnp_selection_get(const Evas_Object *obj, Elm_Sel_Type selection, Elm_Sel_Format format EINA_UNUSED, Elm_Drop_Cb datacb EINA_UNUSED, void *udata EINA_UNUSED);
-static Eina_Bool _wl_elm_cnp_selection_clear(Evas_Object *obj, Elm_Sel_Type selection);
-
-static Eina_Bool _wl_selection_send(void *udata, int type EINA_UNUSED, void *event);
-static Eina_Bool _wl_selection_receive(void *udata, int type EINA_UNUSED, void *event);
-
-static Eina_Bool _wl_elm_dnd_init(void);
-static Eina_Bool _wl_elm_drop_target_add(Evas_Object *obj, Elm_Sel_Format format, Elm_Drag_State entercb, void *enterdata, Elm_Drag_State leavecb, void *leavedata, Elm_Drag_Pos poscb, void *posdata, Elm_Drop_Cb dropcb, void *dropdata);
-static Eina_Bool _wl_elm_drop_target_del(Evas_Object *obj, Elm_Sel_Format format, Elm_Drag_State entercb, void *enterdata, Elm_Drag_State leavecb, void *leavedata, Elm_Drag_Pos poscb, void *posdata, Elm_Drop_Cb dropcb, void *dropdata);
-
-static Eina_Bool _wl_elm_drag_action_set(Evas_Object *obj, Elm_Xdnd_Action action);
-static Eina_Bool _wl_elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data, Elm_Xdnd_Action action, Elm_Drag_Icon_Create_Cb createicon, void *createdata, Elm_Drag_Pos dragpos, void *dragdata, Elm_Drag_Accept acceptcb, void *acceptdata, Elm_Drag_State dragdone, void *donecbdata);
-
-static void _wl_drag_source_del(void *data EINA_UNUSED, Evas *evas EINA_UNUSED, Evas_Object *obj, void *event EINA_UNUSED);
-
-static Eina_Bool _wl_dnd_enter(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
-static Eina_Bool _wl_dnd_leave(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
-static Eina_Bool _wl_dnd_position(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
-static Eina_Bool _wl_dnd_drop(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
-/* static Eina_Bool _wl_dnd_offer(void *data EINA_UNUSED, int type EINA_UNUSED, void *event); */
-
-static Eina_Bool _wl_dnd_receive(void *data, int type EINA_UNUSED, void *event);
-static Eina_Bool _wl_dnd_end(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED);
-static void _wl_dropable_data_handle(Wl_Cnp_Selection *sel, Ecore_Wl2_Event_Offer_Data_Ready *ev);
-
-static Dropable *_wl_dropable_find(unsigned int win);
-static void _wl_dropable_handle(Dropable *drop, Evas_Coord x, Evas_Coord y);
-static void _wl_dropable_all_clean(unsigned int win);
-static Eina_Bool _wl_drops_accept(const char *type);
-static Ecore_Wl2_Window *_wl_elm_widget_window_get(const Evas_Object *obj);
-static Evas * _wl_evas_get_from_win(unsigned int win);
-
-static Eina_Bool
-_wl_is_uri_type_data(const char *data, int len)
-{
- char *p;
- if (len < 6) return EINA_FALSE;
-
- p = (char *)data;
- if (!p) return EINA_FALSE;
- if (strncmp(p, "file:/", 6))
- {
- if (*p != '/') return EINA_FALSE;
- }
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_wl_targets_converter(char *target, Wl_Cnp_Selection *sel EINA_UNUSED, void *data EINA_UNUSED, int size EINA_UNUSED, void **data_ret, int *size_ret)
-{
- cnp_debug("in\n");
- if (!data_ret) return EINA_FALSE;
-
- const char *sep = "\n";
- char *aret;
- int len = 0;
- int i = 0;
- Elm_Sel_Format formats = ELM_SEL_FORMAT_NONE;
- Eina_Bool is_uri = EINA_FALSE;
-
- if (sel->format)
- {
- formats = sel->format;
- is_uri = _wl_is_uri_type_data(sel->selbuf, sel->buflen);
- }
- else
- {
- Cnp_Atom *atom = eina_hash_find(_types_hash, target);
- if (atom)
- formats = atom->formats;
- }
- for (i = 0; i < CNP_N_ATOMS; i++)
- {
- if (formats & _atoms[i].formats)
- {
- if ((is_uri) ||
- ((!is_uri) && strcmp(_atoms[i].name, "text/uri-list")))
- len += strlen(_atoms[i].name) + strlen(sep);
- }
- }
- len++; //terminating null byte
- aret = calloc(1, len * sizeof(char));
- if (!aret) return EINA_FALSE;
- for (i = 0; i < CNP_N_ATOMS; i++)
- {
- if (formats & _atoms[i].formats)
- {
- if ((is_uri) ||
- ((!is_uri) && strcmp(_atoms[i].name, "text/uri-list")))
- {
- aret = strcat(aret, _atoms[i].name);
- aret = strcat(aret, sep);
- }
- }
- }
- *data_ret = aret;
- if (size_ret) *size_ret = len;
-
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_wl_general_converter(char *target, Wl_Cnp_Selection *sel EINA_UNUSED, void *data, int size, void **data_ret, int *size_ret)
-{
- Elm_Sel_Format formats = ELM_SEL_FORMAT_NONE;
- Cnp_Atom *atom = NULL;
-
- cnp_debug("in\n");
-
- atom = eina_hash_find(_types_hash, target);
- if (atom)
- formats = atom->formats;
- if (formats == ELM_SEL_FORMAT_NONE)
- {
- if (data_ret)
- {
- *data_ret = malloc(size * sizeof(char) + 1);
- if (!*data_ret) return EINA_FALSE;
- memcpy(*data_ret, data, size);
- ((char**)(data_ret))[0][size] = 0;
- }
- if (size_ret) *size_ret = size;
- }
- else
- {
- if (data)
- {
- if (data_ret) *data_ret = strdup(data);
- if (size_ret) *size_ret = strlen(data);
- }
- else
- {
- if (data_ret) *data_ret = NULL;
- if (size_ret) *size_ret = 0;
- }
- }
-
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_wl_text_converter(char *target, Wl_Cnp_Selection *sel, void *data, int size, void **data_ret, int *size_ret)
-{
- Elm_Sel_Format formats = ELM_SEL_FORMAT_NONE;
- Cnp_Atom *atom = NULL;
-
- cnp_debug("in\n");
-
- atom = eina_hash_find(_types_hash, target);
- if (atom)
- formats = atom->formats;
- if (formats == ELM_SEL_FORMAT_NONE)
- {
- if (data_ret)
- {
- *data_ret = malloc(size * sizeof(char) + 1);
- if (!*data_ret) return EINA_FALSE;
- memcpy(*data_ret, data, size);
- ((char**)(data_ret))[0][size] = 0;
- if (size_ret) *size_ret = size;
- return EINA_TRUE;
- }
- }
- else if ((formats & ELM_SEL_FORMAT_MARKUP) ||
- (formats & ELM_SEL_FORMAT_HTML))
- {
- *data_ret = _elm_util_mkup_to_text(data);
- if (size_ret && *data_ret) *size_ret = strlen(*data_ret);
- }
- else if (formats & ELM_SEL_FORMAT_TEXT)
- {
- *data_ret = strdup(data);
- if (size_ret && *data_ret) *size_ret = strlen(*data_ret);
- }
- else if (formats & ELM_SEL_FORMAT_IMAGE)
- {
- cnp_debug("Image %s\n", evas_object_type_get(sel->widget));
- evas_object_image_file_get(elm_photocam_internal_image_get(sel->widget),
- (const char **)data_ret, NULL);
- if (!*data_ret) *data_ret = strdup("No file");
- else *data_ret = strdup(*data_ret);
-
- if (!*data_ret)
- {
- ERR("Failed to allocate memory!");
- *size_ret = 0;
- return EINA_FALSE;
- }
-
- if (size_ret) *size_ret = strlen(*data_ret);
- }
- return EINA_TRUE;
-}
-
-static void
-_wl_selection_parser(void *_data, int size, char ***ret_data, int *ret_count)
-{
- char **files = NULL;
- int num_files = 0;
- char *data = NULL;
-
- data = malloc(size);
- if (data && (size > 0))
- {
- int i, is;
- char *tmp;
- char **t2;
-
- memcpy(data, _data, size);
- if (data[size - 1])
- {
- char *t;
-
- /* Isn't nul terminated */
- size++;
- t = realloc(data, size);
- if (!t) goto done;
- data = t;
- data[size - 1] = 0;
- }
-
- tmp = malloc(size);
- if (!tmp) goto done;
- i = 0;
- is = 0;
- while ((is < size) && (data[is]))
- {
- if ((i == 0) && (data[is] == '#'))
- for (; ((data[is]) && (data[is] != '\n')); is++) ;
- else
- {
- if ((data[is] != '\r') && (data[is] != '\n'))
- tmp[i++] = data[is++];
- else
- {
- while ((data[is] == '\r') || (data[is] == '\n'))
- is++;
- tmp[i] = 0;
- num_files++;
- t2 = realloc(files, num_files * sizeof(char *));
- if (t2)
- {
- files = t2;
- files[num_files - 1] = strdup(tmp);
- }
- else
- {
- num_files--;
- goto freetmp;
- }
- tmp[0] = 0;
- i = 0;
- }
- }
- }
- if (i > 0)
- {
- tmp[i] = 0;
- num_files++;
- t2 = realloc(files, num_files * sizeof(char *));
- if (t2)
- {
- files = t2;
- files[num_files - 1] = strdup(tmp);
- }
- else
- {
- num_files--;
- goto freetmp;
- }
- }
-freetmp:
- free(tmp);
- }
-done:
- free(data);
- if (ret_data) *ret_data = files;
- else
- {
- int i;
-
- for (i = 0; i < num_files; i++) free(files[i]);
- free(files);
- }
- if (ret_count) *ret_count = num_files;
-}
-
-static Eina_Bool
-_wl_data_preparer_markup(Wl_Cnp_Selection *sel, Elm_Selection_Data *ddata, Ecore_Wl2_Event_Offer_Data_Ready *ev, Tmp_Info **tmp_info EINA_UNUSED)
-{
- cnp_debug("In\n");
-
- ddata->format = ELM_SEL_FORMAT_MARKUP;
- ddata->data = eina_memdup((unsigned char *)ev->data, ev->len, EINA_TRUE);
- ddata->len = ev->len;
- ddata->action = sel->action;
-
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_wl_data_preparer_uri(Wl_Cnp_Selection *sel, Elm_Selection_Data *ddata, Ecore_Wl2_Event_Offer_Data_Ready *ev, Tmp_Info **tmp_info EINA_UNUSED)
-{
- char *p, *stripstr = NULL;
- char *data = ev->data;
- Dropable *drop;
- const char *type = NULL;
-
- cnp_debug("In\n");
-
- drop = efl_key_data_get(sel->requestwidget, "__elm_dropable");
- if (drop) type = drop->last.type;
-
- if ((type) && (!strcmp(type, "text/uri-list")))
- {
- int num_files = 0;
- char **files = NULL;
- Efreet_Uri *uri;
- Eina_Strbuf *strbuf;
- int i;
-
- strbuf = eina_strbuf_new();
- if (!strbuf) return EINA_FALSE;
-
- _wl_selection_parser(ev->data, ev->len, &files, &num_files);
- cnp_debug("got a files list\n");
-
- for (i = 0; i < num_files; i++)
- {
- uri = efreet_uri_decode(files[i]);
- if (uri)
- {
- eina_strbuf_append(strbuf, uri->path);
- efreet_uri_free(uri);
- }
- else
- {
- eina_strbuf_append(strbuf, files[i]);
- }
- if (i < (num_files - 1))
- eina_strbuf_append(strbuf, "\n");
- free(files[i]);
- }
- free(files);
- stripstr = eina_strbuf_string_steal(strbuf);
- eina_strbuf_free(strbuf);
- }
- else
- {
- Efreet_Uri *uri;
-
- p = (char *)eina_memdup((unsigned char *)data, ev->len, EINA_TRUE);
- if (!p) return EINA_FALSE;
- uri = efreet_uri_decode(p);
- if (!uri)
- {
- /* Is there any reason why we care of URI without scheme? */
- if (p[0] == '/') stripstr = p;
- else free(p);
- }
- else
- {
- free(p);
- stripstr = strdup(uri->path);
- efreet_uri_free(uri);
- }
- }
-
- if (!stripstr)
- {
- cnp_debug("Couldn't find a file\n");
- return EINA_FALSE;
- }
- free(savedtypes.imgfile);
-
- ddata->data = stripstr;
- ddata->len = strlen(stripstr);
- ddata->action = sel->action;
- ddata->format = sel->requestformat;
-
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_wl_data_preparer_vcard(Wl_Cnp_Selection *sel, Elm_Selection_Data *ddata, Ecore_Wl2_Event_Offer_Data_Ready *ev, Tmp_Info **tmp_info EINA_UNUSED)
-{
- cnp_debug("In\n");
-
- ddata->format = ELM_SEL_FORMAT_VCARD;
- ddata->data = eina_memdup((unsigned char *)ev->data, ev->len, EINA_TRUE);
- ddata->len = ev->len;
- ddata->action = sel->action;
-
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_wl_data_preparer_image(Wl_Cnp_Selection *sel, Elm_Selection_Data *ddata, Ecore_Wl2_Event_Offer_Data_Ready *ev, Tmp_Info **tmp_info)
-{
- cnp_debug("In\n");
- Tmp_Info *tmp;
- int len = 0;
-
- tmp = _tempfile_new(ev->len);
- if (!tmp)
- return EINA_FALSE;
- memcpy(tmp->map, ev->data, ev->len);
- munmap(tmp->map, ev->len);
-
- len = strlen(tmp->filename);
- ddata->format = ELM_SEL_FORMAT_IMAGE;
- ddata->data = eina_memdup((unsigned char*)tmp->filename, len, EINA_TRUE);
- ddata->len = len;
- ddata->action = sel->action;
- *tmp_info = tmp;
-
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_wl_data_preparer_text(Wl_Cnp_Selection *sel, Elm_Selection_Data *ddata, Ecore_Wl2_Event_Offer_Data_Ready *ev, Tmp_Info **tmp_info EINA_UNUSED)
-{
- cnp_debug("In\n");
-
- ddata->format = ELM_SEL_FORMAT_TEXT;
- ddata->data = eina_memdup((unsigned char *)ev->data, ev->len, EINA_TRUE);
- ddata->len = ev->len;
- ddata->action = sel->action;
-
- return EINA_TRUE;
-}
-
-static void
-_wl_sel_obj_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
-{
- Wl_Cnp_Selection *sel = data;
- if (sel->widget == obj)
- {
- sel->loss_cb = NULL;
- sel->loss_data = NULL;
- sel->widget = NULL;
- }
- if (dragwidget == obj) dragwidget = NULL;
-}
-
-static Ecore_Wl2_Input *
-_wl_default_seat_get(Ecore_Wl2_Window *win, Evas_Object *obj)
-{
- Eo *seat, *parent2, *ewin;
-
- if (obj)
- {
- // FIXME (there might be a better solution):
- // In case of inwin, we want to use the main wl2 window for cnp, but obj
- // obj belongs to the buffer canvas, so the default seat for obj does not
- // match the window win.
- Eo *top = elm_widget_top_get(obj);
- if (efl_isa(top, EFL_UI_WIN_INLINED_CLASS))
- {
- parent2 = efl_ui_win_inlined_parent_get(top);
- if (parent2) obj = elm_widget_top_get(parent2) ?: parent2;
- }
- /* fake win means canvas seat id will not match protocol seat id */
- ewin = elm_win_get(obj);
- if (elm_win_type_get(ewin) == ELM_WIN_FAKE) obj = NULL;
- }
-
- if (!obj)
- {
- Ecore_Wl2_Input *input;
- Eina_Iterator *it;
- it = ecore_wl2_display_inputs_get(ecore_wl2_window_display_get(win));
- EINA_ITERATOR_FOREACH(it, input) break;
- eina_iterator_free(it);
- return input;
- }
-
- seat = evas_default_device_get(evas_object_evas_get(obj), EFL_INPUT_DEVICE_TYPE_SEAT);
- EINA_SAFETY_ON_NULL_RETURN_VAL(seat, NULL);
- return ecore_wl2_display_input_find(ecore_wl2_window_display_get(win),
- evas_device_seat_id_get(seat));
-}
-
-static void
-_wl_sel_obj_del2(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
-{
- Wl_Cnp_Selection *sel = data;
- if (sel->requestwidget == obj) sel->requestwidget = NULL;
-}
-
-static Eina_Bool
-_wl_elm_cnp_selection_set(Evas_Object *obj, Elm_Sel_Type selection, Elm_Sel_Format format, const void *selbuf, size_t buflen)
-{
- Ecore_Wl2_Window *win;
- Wl_Cnp_Selection *sel = &wl_cnp_selection;
-
- if ((!selbuf) && (format != ELM_SEL_FORMAT_IMAGE))
- return elm_object_cnp_selection_clear(obj, selection);
-
- if (buflen <= 0)
- return EINA_FALSE;
-
- _wl_elm_cnp_init();
-
- win = _wl_elm_widget_window_get(obj);
-
- if ((sel->widget != obj) && sel->loss_cb)
- sel->loss_cb(sel->loss_data, selection);
-
- if (sel->widget)
- evas_object_event_callback_del_full(sel->widget, EVAS_CALLBACK_DEL,
- _wl_sel_obj_del, &wl_cnp_selection);
- sel->active = EINA_TRUE;
- sel->seltype = selection;
- sel->widget = obj;
- sel->win = win;
- /* sel->set(win, &selection, sizeof(Elm_Sel_Type)); */
- sel->format = format;
- sel->loss_cb = NULL;
- sel->loss_data = NULL;
-
- evas_object_event_callback_add
- (sel->widget, EVAS_CALLBACK_DEL, _wl_sel_obj_del, &wl_cnp_selection);
-
- if (selbuf)
- {
- int i = 0, count = 0;
- Eina_Bool is_uri = EINA_FALSE;
- const char **types;
-
- if (format & ELM_SEL_FORMAT_IMAGE)
- {
- /* FIXME */
- // selbuf is actual image data, not text/string
- sel->selbuf = malloc(buflen + 1);
- if (!sel->selbuf)
- {
- elm_object_cnp_selection_clear(obj, selection);
- return EINA_FALSE;
- }
- memcpy(sel->selbuf, selbuf, buflen);
- sel->selbuf[buflen] = 0;
- }
- else
- {
- free(sel->selbuf);
- sel->buflen = buflen;
- sel->selbuf = strdup((char*)selbuf);
- }
-
- is_uri = _wl_is_uri_type_data(selbuf, buflen);
- types = malloc(sizeof(char *));
- if (!types) return EINA_FALSE;
- for (i = 0, count = 1; i < CNP_N_ATOMS; i++)
- {
- if (format & _atoms[i].formats)
- {
- if ((is_uri) ||
- ((!is_uri) && strcmp(_atoms[i].name, "text/uri-list")))
- {
- const char **t = NULL;
-
- types[count - 1] = _atoms[i].name;
- count++;
- t = realloc(types, sizeof(char *) * count);
- if (!t)
- {
- free(types);
- return EINA_FALSE;
- }
- types = t;
- }
- }
- }
- types[count - 1] = 0;
-
- sel->selection_serial = ecore_wl2_dnd_selection_set(_wl_default_seat_get(win, obj), types);
-
- free(types);
- return _local_elm_cnp_selection_set(obj, selection, format, selbuf, buflen);
- }
- else
- {
- sel->selbuf = NULL;
- }
-
- return EINA_FALSE;
-}
-
-
-static Elm_Xdnd_Action
-_wl_to_elm(Ecore_Wl2_Drag_Action action)
-{
- #define CONV(wl, elm) if (action == wl) return elm;
- CONV(ECORE_WL2_DRAG_ACTION_COPY, ELM_XDND_ACTION_COPY);
- CONV(ECORE_WL2_DRAG_ACTION_MOVE, ELM_XDND_ACTION_MOVE);
- CONV(ECORE_WL2_DRAG_ACTION_ASK, ELM_XDND_ACTION_ASK);
- #undef CONV
- return ELM_XDND_ACTION_UNKNOWN;
-}
-
-typedef struct {
- Ecore_Wl2_Offer *offer;
-
- Evas_Object *requestwidget;
- Elm_Drop_Cb drop_cb;
- void *drop_cb_data;
- Elm_Sel_Format format;
-
- Ecore_Event_Handler *handler;
-} Selection_Ready;
-
-static void
-_wl_selection_receive_timeout(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
-{
- Selection_Ready *ready = data;
-
- if (ready->requestwidget != obj) return;
-
- ecore_event_handler_del(ready->handler);
- free(ready);
-}
-
-static Eina_Bool
-_wl_selection_receive(void *data, int type EINA_UNUSED, void *event)
-{
- Ecore_Wl2_Event_Offer_Data_Ready *ev = event;
- Selection_Ready *ready = data;
-
- if (ready->offer != ev->offer) return ECORE_CALLBACK_PASS_ON;
-
- if (ready->drop_cb)
- {
- Elm_Selection_Data sdata;
-
- sdata.x = sdata.y = 0;
- sdata.format = ready->format;
- sdata.data = ev->data;
- sdata.len = ev->len;
- sdata.action = _wl_to_elm(ecore_wl2_offer_action_get(ready->offer));
- ready->drop_cb(ready->drop_cb_data,
- ready->requestwidget,
- &sdata);
- }
- else
- {
- char *stripstr, *mkupstr;
-
- stripstr = malloc(ev->len + 1);
- if (!stripstr) return ECORE_CALLBACK_CANCEL;
- strncpy(stripstr, (char *)ev->data, ev->len);
- stripstr[ev->len] = '\0';
- mkupstr = _elm_util_text_to_mkup((const char *)stripstr);
- /* TODO BUG: should never NEVER assume it's an elm_entry! */
- _elm_entry_entry_paste(ready->requestwidget, mkupstr);
- free(stripstr);
- free(mkupstr);
- }
-
- evas_object_event_callback_del_full(ready->requestwidget,
- EVAS_CALLBACK_DEL,
- _wl_selection_receive_timeout, ready);
-
- ecore_event_handler_del(ready->handler);
- free(data);
- return ECORE_CALLBACK_CANCEL;
-}
-
-typedef struct _Format_Translation{
- Elm_Sel_Format format;
- char **translates;
-}Format_Translation;
-
-char *markup[] = {"application/x-elementary-markup", "", NULL};
-char *text[] = {"text/plain;charset=utf-8", "text/plain", NULL};
-char *html[] = {"text/html;charset=utf-8", "text/html", NULL};
-char *vcard[] = {"text/x-vcard", NULL};
-char *image[] = {"image/", "text/uri-list", NULL};
-
-Format_Translation convertion[] = {
- {ELM_SEL_FORMAT_MARKUP, markup},
- {ELM_SEL_FORMAT_TEXT, text},
- {ELM_SEL_FORMAT_HTML, html},
- {ELM_SEL_FORMAT_VCARD, vcard},
- {ELM_SEL_FORMAT_IMAGE, image},
- {ELM_SEL_FORMAT_NONE, NULL},
-};
-
-static Eina_Bool
-_wl_elm_cnp_selection_get(const Evas_Object *obj, Elm_Sel_Type selection, Elm_Sel_Format format, Elm_Drop_Cb datacb, void *udata)
-{
- Ecore_Wl2_Window *win;
- Ecore_Wl2_Input *input;
- Ecore_Wl2_Offer *offer;
- int i = 0;
- //Wl_Cnp_Selection *sel = &wl_cnp_selection;
-
- _wl_elm_cnp_init();
-
- if (selection == ELM_SEL_TYPE_XDND) return EINA_FALSE;
-
- //if (sel->active)
- //return _local_elm_cnp_selection_get(obj, selection, format, datacb, udata);
- win = _wl_elm_widget_window_get(obj);
-
- input = _wl_default_seat_get(win, (void*)obj);
- offer = ecore_wl2_dnd_selection_get(input);
-
- //there can be no selection available
- if (!offer) return EINA_FALSE;
-
- for (i = 0; convertion[i].translates; i++)
- {
- int j = 0;
- if (!(format & convertion[i].format)) continue;
-
- for (j = 0; convertion[i].translates[j]; j++)
- {
- if (!ecore_wl2_offer_supports_mime(offer, convertion[i].translates[j])) continue;
-
- //we have found mathing mimetypes
- Selection_Ready *ready;
-
- ready = calloc(1, sizeof(Selection_Ready));
-
- ready->requestwidget = (Evas_Object *) obj;
- ready->drop_cb = datacb;
- ready->drop_cb_data = udata;
- ready->offer = offer;
- ready->format = convertion[i].format;
-
- evas_object_event_callback_add(ready->requestwidget, EVAS_CALLBACK_DEL,
- _wl_selection_receive_timeout, ready);
- ready->handler = ecore_event_handler_add(ECORE_WL2_EVENT_OFFER_DATA_READY, _wl_selection_receive, ready);
-
- ecore_wl2_offer_receive(offer, (char*)convertion[i].translates[j]);
- return EINA_TRUE;
- }
- }
-
- return EINA_FALSE;
-}
-
-static void
-_wl_elm_cnp_selection_loss_callback_set(Evas_Object *obj EINA_UNUSED, Elm_Sel_Type selection EINA_UNUSED, Elm_Selection_Loss_Cb func, const void *data)
-{
- Wl_Cnp_Selection *sel = &wl_cnp_selection;
-
- _wl_elm_cnp_init();
-
- sel->loss_cb = func;
- sel->loss_data = (void *)data;
-}
-
-static Eina_Bool
-_wl_elm_cnp_selection_clear(Evas_Object *obj, Elm_Sel_Type selection EINA_UNUSED)
-{
- Wl_Cnp_Selection *sel = &wl_cnp_selection;
-
- _wl_elm_cnp_init();
-
- if ((!sel->active) || (sel->widget != obj))
- return EINA_TRUE;
-
- if (sel->widget)
- evas_object_event_callback_del_full(sel->widget, EVAS_CALLBACK_DEL,
- _wl_sel_obj_del, &wl_cnp_selection);
- if (sel->requestwidget)
- evas_object_event_callback_del_full(sel->requestwidget, EVAS_CALLBACK_DEL,
- _wl_sel_obj_del2, &wl_cnp_selection);
-
- sel->widget = NULL;
- sel->requestwidget = NULL;
- sel->loss_cb = NULL;
- sel->loss_data = NULL;
-
- sel->active = EINA_FALSE;
- ELM_SAFE_FREE(sel->selbuf, free);
- sel->buflen = 0;
- /* sel->clear(); */
- sel->selection_serial = ecore_wl2_dnd_selection_clear(_wl_default_seat_get(_wl_elm_widget_window_get(obj), obj));
-
- return _local_elm_object_cnp_selection_clear(obj, selection);
-}
-
-static void
-_wl_selection_changed_free(void *data, void *ev EINA_UNUSED)
-{
- ecore_wl2_display_disconnect(data);
-}
-
-static Eina_Bool
-_wl_selection_changed(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
-{
- Elm_Cnp_Event_Selection_Changed *e;
- Ecore_Wl2_Event_Seat_Selection *ev = event;
- Ecore_Wl2_Input *seat;
-
- seat = ecore_wl2_display_input_find(ev->display, ev->seat);
- EINA_SAFETY_ON_NULL_RETURN_VAL(seat, ECORE_CALLBACK_RENEW);
- e = calloc(1, sizeof(Elm_Cnp_Event_Selection_Changed));
- EINA_SAFETY_ON_NULL_RETURN_VAL(e, ECORE_CALLBACK_RENEW);
- e->type = ELM_SEL_TYPE_CLIPBOARD;
- e->seat_id = ev->seat;
- /* connect again to add ref */
- e->display = ecore_wl2_display_connect(ecore_wl2_display_name_get(ev->display));
- e->exists = !!ecore_wl2_dnd_selection_get(seat);
- ecore_event_add(ELM_CNP_EVENT_SELECTION_CHANGED, e, _wl_selection_changed_free, ev->display);
- return ECORE_CALLBACK_RENEW;
-}
-
-static Eina_Bool
-_wl_selection_send(void *data, int type EINA_UNUSED, void *event)
-{
- char *buf;
- int ret, len_remained;
- int len_written = 0;
- Wl_Cnp_Selection *sel;
- Ecore_Wl2_Event_Data_Source_Send *ev;
- void *data_ret = NULL;
- int len_ret = 0;
- int i = 0;
-
- _wl_elm_cnp_init();
- cnp_debug("In\n");
- ev = event;
- sel = data;
- if ((ev->serial != sel->selection_serial) &&
- (ev->serial != sel->drag_serial))
- return ECORE_CALLBACK_RENEW;
-
- for (i = 0; i < CNP_N_ATOMS; i++)
- {
- if (!strcmp(_atoms[i].name, ev->type))
- {
- cnp_debug("Found a type: %s\n", _atoms[i].name);
- Dropable *drop;
- drop = efl_key_data_get(sel->requestwidget, "__elm_dropable");
- if (drop)
- drop->last.type = _atoms[i].name;
- if (_atoms[i].wl_converter)
- {
- _atoms[i].wl_converter(ev->type, sel, sel->selbuf,
- sel->buflen, &data_ret, &len_ret);
- }
- else
- {
- data_ret = strdup(sel->selbuf);
- len_ret = sel->buflen;
- }
- break;
- }
- }
-
- len_remained = len_ret;
- buf = data_ret;
- cnp_debug("write: %s", buf);
-
- while (len_written < len_ret)
- {
- ret = write(ev->fd, buf, len_remained);
- if (ret == -1) break;
- buf += ret;
- len_written += ret;
- len_remained -= ret;
- }
- free(data_ret);
-
- close(ev->fd);
- return ECORE_CALLBACK_PASS_ON;
-}
-
-static Eina_Bool
-_wl_elm_cnp_init(void)
-{
- static int _init_count = 0;
-
- if (_init_count > 0) return EINA_TRUE;
- _init_count++;
-
- ecore_event_handler_add(ECORE_WL2_EVENT_DATA_SOURCE_SEND,
- _wl_selection_send, &wl_cnp_selection);
- ecore_event_handler_add(ECORE_WL2_EVENT_SEAT_SELECTION,
- _wl_selection_changed, NULL);
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_wl_elm_dnd_init(void)
-{
- static int _init_count = 0;
-
- if (_init_count > 0) return EINA_TRUE;
- _init_count++;
-
- text_uri = eina_stringshare_add("text/uri-list");
-
- _wl_elm_cnp_init();
- ecore_event_handler_add(ECORE_WL2_EVENT_DATA_SOURCE_END,
- _wl_dnd_end, &wl_cnp_selection);
-
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_wl_elm_drop_target_add(Evas_Object *obj, Elm_Sel_Format format, Elm_Drag_State entercb, void *enterdata, Elm_Drag_State leavecb, void *leavedata, Elm_Drag_Pos poscb, void *posdata, Elm_Drop_Cb dropcb, void *dropdata)
-{
- Dropable *dropable = NULL;
- Dropable_Cbs *cbs = NULL;
-
- Eina_Bool first = !drops;
-
- cbs = calloc(1, sizeof(*cbs));
- if (!cbs) return EINA_FALSE;
-
- cbs->entercb = entercb;
- cbs->enterdata = enterdata;
- cbs->leavecb = leavecb;
- cbs->leavedata = leavedata;
- cbs->poscb = poscb;
- cbs->posdata = posdata;
- cbs->dropcb = dropcb;
- cbs->dropdata = dropdata;
- cbs->types = format;
-
- dropable = efl_key_data_get(obj, "__elm_dropable");
- if (!dropable)
- {
- /* Create new drop */
- dropable = calloc(1, sizeof(Dropable));
- if (!dropable) goto error;
- drops = eina_list_append(drops, dropable);
- if (!drops) goto error;
- dropable->obj = obj;
- efl_key_data_set(obj, "__elm_dropable", dropable);
- }
-
- dropable->cbs_list =
- eina_inlist_append(dropable->cbs_list, EINA_INLIST_GET(cbs));
-
- evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
- _all_drop_targets_cbs_del, obj);
-
- if (first)
- {
- handler_enter =
- ecore_event_handler_add(ECORE_WL2_EVENT_DND_ENTER,
- _wl_dnd_enter, NULL);
- handler_leave =
- ecore_event_handler_add(ECORE_WL2_EVENT_DND_LEAVE,
- _wl_dnd_leave, NULL);
- handler_pos =
- ecore_event_handler_add(ECORE_WL2_EVENT_DND_MOTION,
- _wl_dnd_position, NULL);
- handler_drop =
- ecore_event_handler_add(ECORE_WL2_EVENT_DND_DROP,
- _wl_dnd_drop, NULL);
- _wl_elm_dnd_init();
- }
-
- return EINA_TRUE;
-error:
- free(cbs);
- free(dropable);
- return EINA_FALSE;
-}
-
-static Eina_Bool
-_wl_elm_drop_target_del(Evas_Object *obj, Elm_Sel_Format format,
- Elm_Drag_State entercb, void *enterdata,
- Elm_Drag_State leavecb, void *leavedata,
- Elm_Drag_Pos poscb, void *posdata,
- Elm_Drop_Cb dropcb, void *dropdata)
-{
-
- if (!_local_elm_drop_target_del(obj, format, entercb, enterdata,
- leavecb, leavedata, poscb, posdata, dropcb, dropdata))
- {
- return EINA_FALSE;
- }
-
- if (!drops)
- {
- ELM_SAFE_FREE(handler_pos, ecore_event_handler_del);
- ELM_SAFE_FREE(handler_drop, ecore_event_handler_del);
- ELM_SAFE_FREE(handler_enter, ecore_event_handler_del);
- ELM_SAFE_FREE(handler_leave, ecore_event_handler_del);
- }
-
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_wl_elm_drag_action_set(Evas_Object *obj, Elm_Xdnd_Action action)
-{
- if (!dragwin) return EINA_FALSE;
- if (dragwidget != obj) return EINA_FALSE;
- if (dragaction == action) return EINA_TRUE;
- dragaction = action;
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_wl_elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data,
- Elm_Xdnd_Action action,
- Elm_Drag_Icon_Create_Cb createicon, void *createdata,
- Elm_Drag_Pos dragpos, void *dragdata,
- Elm_Drag_Accept acceptcb, void *acceptdata,
- Elm_Drag_State dragdone, void *donecbdata)
-{
- Ecore_Evas *ee;
- Evas_Object *icon = NULL;
- int x, y, x2 = 0, y2 = 0, x3, y3, w = 0, h = 0;
- const char *types[CNP_N_ATOMS + 1];
- int i, nb_types = 0;
- Ecore_Wl2_Window *parent = NULL, *win;
-
- _wl_elm_dnd_init();
-
- /* if we already have a drag, get out */
- if (dragwin) return EINA_FALSE;
-
- for (i = CNP_ATOM_LISTING_ATOMS + 1; i < CNP_N_ATOMS; i++)
- {
- if (format == ELM_SEL_FORMAT_TARGETS || (_atoms[i].formats & format))
- {
- types[nb_types++] = _atoms[i].name;
- cnp_debug("set dnd type: %s\n", _atoms[i].name);
- }
- }
- types[nb_types] = NULL;
-
- win = _wl_elm_widget_window_get(obj);
- ecore_wl2_dnd_drag_types_set(_wl_default_seat_get(win, obj), types);
-
- /* set the drag data used when a drop occurs */
- free(wl_cnp_selection.selbuf);
- wl_cnp_selection.buflen = 0;
- wl_cnp_selection.selbuf = eina_strdup(data);
-
- if (data)
- {
- wl_cnp_selection.buflen = strlen(wl_cnp_selection.selbuf);
- }
-
- /* setup callback to notify if this object gets deleted */
- evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
- _wl_drag_source_del, obj);
-
- dragwidget = obj;
- dragaction = action;
- dragposcb = dragpos;
- dragposdata = dragdata;
- dragacceptcb = acceptcb;
- dragacceptdata = acceptdata;
- dragdonecb = dragdone;
- dragdonedata = donecbdata;
-
- dragwin = elm_win_add(NULL, "Elm-Drag", ELM_WIN_DND);
- elm_win_alpha_set(dragwin, EINA_TRUE);
- elm_win_borderless_set(dragwin, EINA_TRUE);
- elm_win_override_set(dragwin, EINA_TRUE);
-
- win = elm_win_wl_window_get(dragwin);
-
- if (createicon)
- {
- Evas_Coord xoff = 0, yoff = 0;
-
- icon = createicon(createdata, dragwin, &xoff, &yoff);
- if (icon)
- {
- x2 = xoff;
- y2 = yoff;
- evas_object_geometry_get(icon, NULL, NULL, &w, &h);
- }
- }
- else
- {
- icon = elm_icon_add(dragwin);
- evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
- }
-
- elm_win_resize_object_add(dragwin, icon);
- evas_object_show(icon);
-
- /* Position subwindow appropriately */
- ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
- ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
- x += x2;
- y += y2;
- dragwin_x_start = dragwin_x_end = x;
- dragwin_y_start = dragwin_y_end = y;
-
- evas_object_move(dragwin, x, y);
- evas_object_resize(dragwin, w, h);
- evas_object_show(dragwin);
-
- evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x3, &y3);
- _dragx = x3 - x2;
- _dragy = y3 - y2;
-
- if (elm_widget_is(obj))
- {
- Evas_Object *top;
-
- top = elm_widget_top_get(obj);
- if (!top) top = elm_widget_top_get(elm_widget_parent_widget_get(obj));
- if (top && (efl_isa(top, EFL_UI_WIN_CLASS)))
- parent = elm_win_wl_window_get(top);
- }
- if (!parent)
- {
- Evas *evas;
-
- if (!(evas = evas_object_evas_get(obj)))
- return EINA_FALSE;
- if (!(ee = ecore_evas_ecore_evas_get(evas)))
- return EINA_FALSE;
-
- parent = ecore_evas_wayland2_window_get(ee);
- }
-
- wl_cnp_selection.drag_serial = ecore_wl2_dnd_drag_start(_wl_default_seat_get(win, obj), parent, win);
-
- return EINA_TRUE;
-}
-
-static void
-_wl_drag_source_del(void *data EINA_UNUSED, Evas *evas EINA_UNUSED, Evas_Object *obj, void *event EINA_UNUSED)
-{
- if (dragwidget == obj)
- dragwidget = NULL;
-}
-
-static Eina_Bool
-_wl_dnd_enter(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
-{
- Ecore_Wl2_Event_Dnd_Enter *ev;
- Eina_Array *known, *available;
- unsigned int i = 0;
-
- ev = event;
-
- available = ecore_wl2_offer_mimes_get(ev->offer);
-
- free(savedtypes.types);
-
- savedtypes.ntypes = eina_array_count(available);
- savedtypes.types = malloc(sizeof(char *) * savedtypes.ntypes);
- if (!savedtypes.types) return EINA_FALSE;
-
- known = eina_array_new(5);
-
- for (i = 0; i < eina_array_count(available); i++)
- {
- savedtypes.types[i] =
- eina_stringshare_add(eina_array_data_get(available, i));
- if (savedtypes.types[i] == text_uri)
- {
- savedtypes.textreq = 1;
- ELM_SAFE_FREE(savedtypes.imgfile, free);
- }
- }
-
- doaccept = EINA_FALSE;
- for (i = 0; i < eina_array_count(available); i++)
- {
- if (_wl_drops_accept(eina_array_data_get(available, i)))
- {
- eina_array_push(known, strdup(eina_array_data_get(available, i)));
- }
- }
-
- ecore_wl2_offer_mimes_set(ev->offer, known);
-
- return ECORE_CALLBACK_PASS_ON;
-}
-
-static Eina_Bool
-_wl_dnd_leave(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
-{
- Ecore_Wl2_Event_Dnd_Leave *ev;
- Dropable *drop;
- cnp_debug("In\n");
-
- ev = event;
- if ((drop = _wl_dropable_find(ev->win)))
- {
- _wl_dropable_handle(NULL, 0, 0);
- _wl_dropable_all_clean(ev->win);
- }
-
- return ECORE_CALLBACK_PASS_ON;
-}
-
-static Eina_Bool
-_wl_dnd_position(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
-{
- Ecore_Wl2_Event_Dnd_Motion *ev;
- Dropable *drop;
- Eina_Bool will_accept = EINA_FALSE;
-
- ev = event;
-
- cnp_debug("mouse pos %i %i\n", ev->x, ev->y);
-
- dragwin_x_end = ev->x - _dragx;
- dragwin_y_end = ev->y - _dragy;
-
- drop = _wl_dropable_find(ev->win);
-
- if (drop)
- {
- Evas_Coord x = 0, y = 0;
- Evas *evas = NULL;
- Eina_List *dropable_list = NULL;
-
- x = ev->x;
- y = ev->y;
- _dropable_coords_adjust(drop, &x, &y);
- evas = _wl_evas_get_from_win(ev->win);
- if (evas)
- dropable_list = _dropable_list_geom_find(evas, x, y);
-
- /* check if there is dropable (obj) can accept this drop */
- if (dropable_list)
- {
- Elm_Sel_Format saved_format;
- Eina_List *l;
- Eina_Bool found = EINA_FALSE;
- Dropable *dropable = NULL;
-
- saved_format =
- _dnd_types_to_format(savedtypes.types, savedtypes.ntypes);
-
- EINA_LIST_FOREACH(dropable_list, l, dropable)
- {
- Dropable_Cbs *cbs;
- Eina_Inlist *itr;
-
- EINA_INLIST_FOREACH_SAFE(dropable->cbs_list, itr, cbs)
- {
- Elm_Sel_Format common_fmt = saved_format & cbs->types;
-
- if (common_fmt)
- {
- /* We found a target that can accept this type of data */
- int i, min_index = CNP_N_ATOMS;
-
- /* We have to find the first atom that corresponds to one
- * of the supported data types. */
- for (i = 0; i < savedtypes.ntypes; i++)
- {
- Cnp_Atom *atom;
-
- atom = eina_hash_find(_types_hash,
- savedtypes.types[i]);
- if (atom && (atom->formats & common_fmt))
- {
- int atom_idx = (atom - _atoms);
-
- if (min_index > atom_idx)
- min_index = atom_idx;
- }
- }
- if (min_index != CNP_N_ATOMS)
- {
- cnp_debug("Found atom %s\n", _atoms[min_index].name);
- found = EINA_TRUE;
- dropable->last.type = _atoms[min_index].name;
- dropable->last.format = common_fmt;
- break;
- }
- }
- }
- if (found) break;
- }
- if (found)
- {
- Evas_Coord ox = 0, oy = 0;
-
- evas_object_geometry_get(dropable->obj, &ox, &oy, NULL, NULL);
-
- cnp_debug("Candidate %p (%s)\n",
- dropable->obj, efl_class_name_get(efl_class_get(dropable->obj)));
- _wl_dropable_handle(dropable, x - ox, y - oy);
- wl_cnp_selection.requestwidget = dropable->obj;
- will_accept = EINA_TRUE;
- }
- else
- {
- //if not: send false status
- cnp_debug("dnd position (%d, %d) not in obj\n", x, y);
- _wl_dropable_handle(NULL, 0, 0);
- // CCCCCCC: call dnd exit on last obj
- }
- eina_list_free(dropable_list);
- }
- }
-
- doaccept = will_accept;
-
- if (dragacceptcb)
- dragacceptcb(dragacceptdata, wl_cnp_selection.requestwidget, will_accept);
-
- return ECORE_CALLBACK_PASS_ON;
-}
-
-static Eina_Bool
-_wl_dnd_receive(void *data, int type EINA_UNUSED, void *event)
-{
- Ecore_Wl2_Event_Offer_Data_Ready *ev;
- Ecore_Wl2_Offer *offer;
- cnp_debug("In\n");
-
- ev = event;
- offer = data;
-
- if (offer != ev->offer) return ECORE_CALLBACK_PASS_ON;
-
- if (wl_cnp_selection.requestwidget)
- {
- Ecore_Wl2_Drag_Action action;
-
- action = ecore_wl2_offer_action_get(ev->offer);
- if (action == ECORE_WL2_DRAG_ACTION_ASK)
- ecore_wl2_offer_actions_set(ev->offer, ECORE_WL2_DRAG_ACTION_COPY, ECORE_WL2_DRAG_ACTION_COPY);
- action = ecore_wl2_offer_action_get(ev->offer);
-
- wl_cnp_selection.action = _wl_to_elm(action);
-
- _wl_dropable_data_handle(&wl_cnp_selection, ev);
- evas_object_event_callback_del_full(wl_cnp_selection.requestwidget,
- EVAS_CALLBACK_DEL,
- _wl_sel_obj_del2, &wl_cnp_selection);
- wl_cnp_selection.requestwidget = NULL;
-
- }
-
- ecore_wl2_offer_finish(ev->offer);
-
- return ECORE_CALLBACK_CANCEL;
-}
-
-static Eina_Bool
-_wl_dnd_drop(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
-{
- Ecore_Wl2_Event_Dnd_Drop *ev;
- Ecore_Wl2_Window *win;
- Dropable *drop;
- Eina_List *l;
-
- cnp_debug("In\n");
- ev = event;
- savedtypes.x = ev->x;
- savedtypes.y = ev->y;
-
- EINA_LIST_FOREACH(drops, l, drop)
- {
- if (drop->last.in)
- {
- cnp_debug("Request data of type %s\n", drop->last.type);
- wl_cnp_selection.requestwidget = drop->obj;
- wl_cnp_selection.requestformat = drop->last.format;
- evas_object_event_callback_add(wl_cnp_selection.requestwidget,
- EVAS_CALLBACK_DEL, _wl_sel_obj_del2,
- &wl_cnp_selection);
-
- win = _wl_elm_widget_window_get(drop->obj);
- ecore_wl2_offer_receive(ev->offer, (char*)drop->last.type);
- ecore_event_handler_add(ECORE_WL2_EVENT_OFFER_DATA_READY, _wl_dnd_receive, ev->offer);
-
- return ECORE_CALLBACK_PASS_ON;
- }
- }
-
- win = ecore_wl2_display_window_find(_elm_wl_display, ev->win);
- ecore_wl2_dnd_drag_end(_wl_default_seat_get(win, NULL));
- return ECORE_CALLBACK_PASS_ON;
-}
-
-static Eina_Bool
-_wl_dnd_end(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
-{
- Ecore_Wl2_Event_Data_Source_End *ev;
- Ecore_Wl2_Window *win;
-
- cnp_debug("In\n");
-
- ev = event;
- if (ev->serial != wl_cnp_selection.drag_serial)
- return ECORE_CALLBACK_RENEW;
- if (dragdonecb) dragdonecb(dragdonedata, dragwidget);
-
- if (dragwin)
- {
- if (!doaccept)
- {
- /* Commit animation when drag cancelled */
- /* Record final position of dragwin, then do animation */
- ecore_animator_timeline_add(0.3, _drag_cancel_animate, dragwin);
- }
- else
- {
- /* No animation drop was committed */
- evas_object_del(dragwin);
- }
- dragwin = NULL; /* if not freed here, free in end of anim */
- }
-
- dragdonecb = NULL;
- dragacceptcb = NULL;
- dragposcb = NULL;
- dragwidget = NULL;
- doaccept = EINA_FALSE;
-
- win = ecore_wl2_display_window_find(_elm_wl_display, ev->win);
- ecore_wl2_input_ungrab(_wl_default_seat_get(win, NULL));
-
- return ECORE_CALLBACK_PASS_ON;
-}
-
-static void
-_wl_dropable_data_handle(Wl_Cnp_Selection *sel, Ecore_Wl2_Event_Offer_Data_Ready *ev)
-{
- Dropable *drop;
- Ecore_Wl2_Window *win;
-
- cnp_debug("In\n");
- drop = efl_key_data_get(sel->requestwidget, "__elm_dropable");
- if (drop)
- {
- Cnp_Atom *atom = NULL;
-
- atom = eina_hash_find(_types_hash, drop->last.type);
- if (atom && atom->wl_data_preparer)
- {
- Elm_Selection_Data ddata;
- Tmp_Info *tmp_info = NULL;
- Eina_Bool success;
- ddata.data = NULL;
-
- cnp_debug("Call notify for: %s\n", atom->name);
- success = atom->wl_data_preparer(sel, &ddata, ev, &tmp_info);
- if (success)
- {
- Dropable *dropable;
- Eina_List *l;
-
- EINA_LIST_FOREACH(drops, l, dropable)
- {
- if (dropable->obj == sel->requestwidget) break;
- dropable = NULL;
- }
- if (dropable)
- {
- cnp_debug("call dropcb\n");
- Dropable_Cbs *cbs;
- Eina_Inlist *itr;
- ddata.x = savedtypes.x;
- ddata.y = savedtypes.y;
- EINA_INLIST_FOREACH_SAFE(dropable->cbs_list, itr, cbs)
- if ((cbs->types & dropable->last.format) &&
- cbs->dropcb)
- cbs->dropcb(cbs->dropdata, dropable->obj, &ddata);
- }
- }
- win = _wl_elm_widget_window_get(sel->requestwidget);
- ecore_wl2_dnd_drag_end(_wl_default_seat_get(win, NULL));
- if (tmp_info) _tmpinfo_free(tmp_info);
- free(ddata.data);
- return;
- }
- }
-
- win = _wl_elm_widget_window_get(sel->requestwidget);
- ecore_wl2_dnd_drag_end(_wl_default_seat_get(win, NULL));
- savedtypes.textreq = 0;
-}
-
-static Dropable *
-_wl_dropable_find(unsigned int win)
-{
- Eina_List *l;
- Dropable *dropable;
- Ecore_Wl2_Window *window;
-
- if (!drops) return NULL;
-
- window = ecore_wl2_display_window_find(_elm_wl_display, win);
- if (!window) return NULL;
-
- EINA_LIST_FOREACH(drops, l, dropable)
- if (_wl_elm_widget_window_get(dropable->obj) == window)
- return dropable;
-
- return NULL;
-}
-
-static Evas *
-_wl_evas_get_from_win(unsigned int win)
-{
- Dropable *dropable = _wl_dropable_find(win);
- return dropable ? evas_object_evas_get(dropable->obj) : NULL;
-}
-
-static void
-_wl_dropable_handle(Dropable *drop, Evas_Coord x, Evas_Coord y)
-{
- Dropable *d, *last_dropable = NULL;
- Dropable_Cbs *cbs;
- Eina_Inlist *itr;
- Eina_List *l;
-
- EINA_LIST_FOREACH(drops, l, d)
- {
- if (d->last.in)
- {
- last_dropable = d;
- break;
- }
- }
-
- /* If we are on the same object, just update the position */
- if ((drop) && (last_dropable == drop))
- {
- EINA_INLIST_FOREACH_SAFE(drop->cbs_list, itr, cbs)
- if (cbs->poscb)
- cbs->poscb(cbs->posdata, drop->obj, x, y, dragaction);
- return;
- }
- /* We leave the last dropable */
- if (last_dropable)
- {
- EINA_INLIST_FOREACH_SAFE(last_dropable->cbs_list, itr, cbs)
- if (cbs->leavecb)
- cbs->leavecb(cbs->leavedata, last_dropable->obj);
- last_dropable->last.in = EINA_FALSE;
- }
- /* We enter the new dropable */
- if (drop)
- {
- EINA_INLIST_FOREACH_SAFE(drop->cbs_list, itr, cbs)
- if (cbs->entercb)
- cbs->entercb(cbs->enterdata, drop->obj);
- EINA_INLIST_FOREACH_SAFE(drop->cbs_list, itr, cbs)
- if (cbs->poscb)
- cbs->poscb(cbs->posdata, drop->obj, x, y, dragaction);
- drop->last.in = EINA_TRUE;
- }
-}
-
-static void
-_wl_dropable_all_clean(unsigned int win)
-{
- Eina_List *l;
- Dropable *dropable;
- Ecore_Wl2_Window *window;
-
- window = ecore_wl2_display_window_find(_elm_wl_display, win);
- if (!window) return;
-
- EINA_LIST_FOREACH(drops, l, dropable)
- {
- if (_wl_elm_widget_window_get(dropable->obj) == window)
- {
- dropable->last.x = 0;
- dropable->last.y = 0;
- dropable->last.in = EINA_FALSE;
- }
- }
-}
-
-static Eina_Bool
-_wl_drops_accept(const char *type)
-{
- Eina_List *l;
- Dropable *drop;
- Eina_Bool will_accept = EINA_FALSE;
-
- if (!type) return EINA_FALSE;
-
- EINA_LIST_FOREACH(drops, l, drop)
- {
- Dropable_Cbs *cbs;
- EINA_INLIST_FOREACH(drop->cbs_list, cbs)
- {
- for (int i = 0; convertion[i].translates ; ++i)
- {
- if (!(convertion[i].format & cbs->types)) continue;
-
- for (int j = 0; convertion[i].translates[j]; ++j)
- {
- if (!strncmp(type, convertion[i].translates[j], strlen(convertion[i].translates[j])))
- {
- wl_cnp_selection.requestwidget = drop->obj;
- return EINA_TRUE;
- }
- }
- }
- }
- }
-
- return will_accept;
-}
-
-static Ecore_Wl2_Window *
-_wl_elm_widget_window_get(const Evas_Object *obj)
-{
- Evas_Object *top;
- Ecore_Wl2_Window *win = NULL;
-
- if (elm_widget_is(obj))
- {
- top = elm_widget_top_get(obj);
- if (!top) top = elm_widget_top_get(elm_widget_parent_widget_get(obj));
- if (top && (efl_isa(top, EFL_UI_WIN_CLASS)))
- win = elm_win_wl_window_get(top);
- }
- if (!win)
- {
- Ecore_Evas *ee;
- Evas *evas;
- const char *engine_name;
-
- if (!(evas = evas_object_evas_get(obj)))
- return NULL;
- if (!(ee = ecore_evas_ecore_evas_get(evas)))
- return NULL;
-
- engine_name = ecore_evas_engine_name_get(ee);
- if (!strcmp(engine_name, ELM_BUFFER))
- {
- ee = ecore_evas_buffer_ecore_evas_parent_get(ee);
- if (!ee) return NULL;
- engine_name = ecore_evas_engine_name_get(ee);
- }
- if (!strncmp(engine_name, "wayland", sizeof("wayland") - 1))
- {
- /* In case the engine is not a buffer, we want to check once. */
- win = ecore_evas_wayland2_window_get(ee);
- if (!win) return NULL;
- }
- }
-
- return win;
-}
-
-#endif
-
-#ifdef HAVE_ELEMENTARY_COCOA
-
-typedef struct _Cocoa_Cnp_Selection Cocoa_Cnp_Selection;
-
-struct _Cocoa_Cnp_Selection
-{
- Ecore_Cocoa_Window *win;
- Evas_Object *widget;
- char *selbuf;
- int buflen;
- Evas_Object *requestwidget;
- void *udata;
- Elm_Sel_Format requestformat;
- Elm_Drop_Cb datacb;
-
- Elm_Selection_Loss_Cb loss_cb;
- void *loss_data;
- int pb_count;
-
- Elm_Sel_Format format;
-
- Eina_Bool active : 1;
-};
-
-static Cocoa_Cnp_Selection _cocoa_cnp_sel;
-
-static Ecore_Cocoa_Window *
-_cocoa_elm_widget_cocoa_window_get(const Evas_Object *obj)
-{
- Evas_Object *top, *par;
- Ecore_Cocoa_Window *win = NULL;
-
- if (elm_widget_is(obj))
- {
- top = elm_widget_top_get(obj);
- if (!top)
- {
- par = elm_widget_parent_widget_get(obj);
- if (par) top = elm_widget_top_get(par);
- }
- if ((top) && (efl_isa(top, EFL_UI_WIN_CLASS)))
- win = elm_win_cocoa_window_get(top);
- }
- if (!win)
- {
- // FIXME
- CRI("WIN has not been retrieved!!!");
- }
-
- return win;
-}
-
-static Ecore_Cocoa_Cnp_Type
-_elm_sel_format_to_ecore_cocoa_cnp_type(Elm_Sel_Format fmt)
-{
- Ecore_Cocoa_Cnp_Type type = 0;
-
- if ((fmt & ELM_SEL_FORMAT_TEXT) ||
- (fmt & ELM_SEL_FORMAT_VCARD))
- type |= ECORE_COCOA_CNP_TYPE_STRING;
- if (fmt & ELM_SEL_FORMAT_MARKUP)
- type |= ECORE_COCOA_CNP_TYPE_MARKUP;
- if (fmt & ELM_SEL_FORMAT_HTML)
- type |= ECORE_COCOA_CNP_TYPE_HTML;
- if (fmt & ELM_SEL_FORMAT_IMAGE)
- type |= ECORE_COCOA_CNP_TYPE_IMAGE;
-
- return type;
-}
-
-static void
-_cocoa_sel_obj_del_req_cb(void *data,
- Evas *e EINA_UNUSED,
- Evas_Object *obj,
- void *ev_info EINA_UNUSED)
-{
- Cocoa_Cnp_Selection *sel = data;
- if (sel->requestwidget == obj) sel->requestwidget = NULL;
-}
-
-static void
-_cocoa_sel_obj_del_cb(void *data,
- Evas *e EINA_UNUSED,
- Evas_Object *obj,
- void *ev_info EINA_UNUSED)
-{
- Cocoa_Cnp_Selection *sel = data;
- if (sel->widget == obj)
- {
- sel->widget = NULL;
- sel->loss_cb = NULL;
- sel->loss_data = NULL;
- }
- if (dragwidget == obj) dragwidget = NULL;
-}
-
-static void
-_job_pb_cb(void *data)
-{
- Cocoa_Cnp_Selection *sel = data;
- Elm_Selection_Data ddata;
- Ecore_Cocoa_Cnp_Type type, get_type;
- void *pbdata;
- int pbdata_len;
-
- if (sel->datacb)
- {
- ddata.x = 0;
- ddata.y = 0;
-
- /* Pass to cocoa clipboard */
- type = _elm_sel_format_to_ecore_cocoa_cnp_type(sel->requestformat);
- pbdata = ecore_cocoa_clipboard_get(&pbdata_len, type, &get_type);
-
- ddata.format = ELM_SEL_FORMAT_NONE;
- if (get_type & ECORE_COCOA_CNP_TYPE_STRING)
- ddata.format |= ELM_SEL_FORMAT_TEXT;
- if (get_type & ECORE_COCOA_CNP_TYPE_MARKUP)
- ddata.format |= ELM_SEL_FORMAT_MARKUP;
- if (get_type & ECORE_COCOA_CNP_TYPE_IMAGE)
- ddata.format |= ELM_SEL_FORMAT_IMAGE;
- if (get_type & ECORE_COCOA_CNP_TYPE_HTML)
- ddata.format |= ELM_SEL_FORMAT_HTML;
-
- ddata.data = pbdata;
- ddata.len = pbdata_len;
- ddata.action = ELM_XDND_ACTION_UNKNOWN;
- sel->datacb(sel->udata, sel->requestwidget, &ddata);
- free(pbdata);
- }
-}
-
-static Eina_Bool
-_cocoa_elm_cnp_selection_set(Ecore_Cocoa_Window *win,
- Evas_Object *obj,
- Elm_Sel_Type selection,
- Elm_Sel_Format format,
- const void *selbuf,
- size_t buflen)
-{
- Cocoa_Cnp_Selection *sel = &_cocoa_cnp_sel;
- Ecore_Cocoa_Cnp_Type type;
- Eina_Bool ok = EINA_TRUE;
-
- if ((!selbuf) && (format != ELM_SEL_FORMAT_IMAGE))
- return elm_object_cnp_selection_clear(obj, selection);
- if (buflen <= 0) return EINA_FALSE;
-
- if (sel->loss_cb) sel->loss_cb(sel->loss_data, selection);
- if (sel->widget)
- evas_object_event_callback_del_full(sel->widget, EVAS_CALLBACK_DEL,
- _cocoa_sel_obj_del_cb, sel);
-
- sel->widget = obj;
- sel->win = win;
- sel->format = format;
- sel->loss_cb = NULL;
- sel->loss_data = NULL;
-
- evas_object_event_callback_add(sel->widget, EVAS_CALLBACK_DEL,
- _cocoa_sel_obj_del_cb, sel);
- ELM_SAFE_FREE(sel->selbuf, free);
- sel->buflen = 0;
- if (selbuf)
- {
- sel->selbuf = malloc(buflen + 1);
- if (EINA_UNLIKELY(!sel->selbuf))
- {
- CRI("Failed to allocate memory!");
- elm_object_cnp_selection_clear(obj, selection);
- return EINA_FALSE;
- }
- memcpy(sel->selbuf, selbuf, buflen);
- sel->selbuf[buflen] = 0;
- sel->buflen = buflen;
- type = _elm_sel_format_to_ecore_cocoa_cnp_type(format);
- ecore_cocoa_clipboard_set(selbuf, buflen, type);
- }
-
- return ok;
-}
-
-static void
-_cocoa_elm_cnp_selection_loss_callback_set(Evas_Object *obj EINA_UNUSED,
- Elm_Sel_Type selection EINA_UNUSED,
- Elm_Selection_Loss_Cb func EINA_UNUSED,
- const void *data EINA_UNUSED)
-{
- // Currently, we have no way to track changes in Cocoa pasteboard.
- // Therefore, don't track this...
- //sel->loss_cb = func;
- //sel->loss_data = (void *)data;
-}
-
-static Eina_Bool
-_cocoa_elm_cnp_selection_clear(Evas_Object *obj EINA_UNUSED,
- Elm_Sel_Type selection EINA_UNUSED)
-{
- Cocoa_Cnp_Selection *sel = &_cocoa_cnp_sel;
-
- if (sel->widget)
- evas_object_event_callback_del_full(sel->widget, EVAS_CALLBACK_DEL,
- _cocoa_sel_obj_del_cb, sel);
- if (sel->requestwidget)
- evas_object_event_callback_del_full(sel->requestwidget, EVAS_CALLBACK_DEL,
- _cocoa_sel_obj_del_req_cb, sel);
-
- sel->widget = NULL;
- sel->requestwidget = NULL;
- sel->loss_cb = NULL;
- sel->loss_data = NULL;
- ELM_SAFE_FREE(sel->selbuf, free);
- sel->buflen = 0;
- ecore_cocoa_clipboard_clear();
-
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_cocoa_elm_cnp_selection_get(const Evas_Object *obj,
- Ecore_Cocoa_Window *win,
- Elm_Sel_Type selection EINA_UNUSED,
- Elm_Sel_Format format,
- Elm_Drop_Cb datacb,
- void *udata)
-{
- Cocoa_Cnp_Selection *sel = &_cocoa_cnp_sel;
-
- if (sel->requestwidget)
- evas_object_event_callback_del_full(sel->requestwidget, EVAS_CALLBACK_DEL,
- _cocoa_sel_obj_del_req_cb, sel);
-
- sel->requestformat = format;
- sel->requestwidget = (Evas_Object *)obj;
- sel->win = win;
- sel->datacb = datacb;
- sel->udata = udata;
-
- ecore_job_add(_job_pb_cb, sel);
-
- evas_object_event_callback_add(sel->requestwidget, EVAS_CALLBACK_DEL,
- _cocoa_sel_obj_del_req_cb, sel);
-
- return EINA_TRUE;
-}
-
-
-#endif
-
-////////////////////////////////////////////////////////////////////////////
-// for local (Within 1 app/process) cnp (used by fb as fallback
-////////////////////////////////////////////////////////////////////////////
-#if 1
-typedef struct _Local_Selinfo Local_Selinfo;
-
-struct _Local_Selinfo
-{
- Elm_Sel_Format format;
- struct {
- char *buf;
- size_t size;
- } sel;
- struct {
- Evas_Object *obj;
- Elm_Drop_Cb func;
- void *data;
- Ecore_Job *job;
- } get;
-};
-
-// for ELM_SEL_TYPE_PRIMARY, ELM_SEL_TYPE_SECONDARY, ELM_SEL_TYPE_XDND,
-// ELM_SEL_TYPE_CLIPBOARD
-static Local_Selinfo _local_selinfo[4];
-
-static void _local_get_job(void *data);
-
-static Eina_Bool _local_elm_cnp_init(void);
-static Eina_Bool _local_elm_cnp_selection_set(Evas_Object *obj EINA_UNUSED, Elm_Sel_Type selection, Elm_Sel_Format format, const void *selbuf, size_t buflen);
-static void _local_elm_cnp_selection_loss_callback_set(Evas_Object *obj EINA_UNUSED, Elm_Sel_Type selection EINA_UNUSED, Elm_Selection_Loss_Cb func EINA_UNUSED, const void *data EINA_UNUSED);
-static Eina_Bool _local_elm_object_cnp_selection_clear(Evas_Object *obj EINA_UNUSED, Elm_Sel_Type selection);
-static Eina_Bool _local_elm_cnp_selection_get(const Evas_Object *obj, Elm_Sel_Type selection, Elm_Sel_Format format EINA_UNUSED, Elm_Drop_Cb datacb, void *udata);
-static Eina_Bool _local_elm_drop_target_add(Evas_Object *obj EINA_UNUSED, Elm_Sel_Format format EINA_UNUSED,
- Elm_Drag_State entercb EINA_UNUSED, void *enterdata EINA_UNUSED,
- Elm_Drag_State leavecb EINA_UNUSED, void *leavedata EINA_UNUSED,
- Elm_Drag_Pos poscb EINA_UNUSED, void *posdata EINA_UNUSED,
- Elm_Drop_Cb dropcb EINA_UNUSED, void *dropdata EINA_UNUSED);
-static Eina_Bool _local_elm_drag_start(Evas_Object *obj EINA_UNUSED,
- Elm_Sel_Format format EINA_UNUSED,
- const char *data EINA_UNUSED,
- Elm_Xdnd_Action action EINA_UNUSED,
- Elm_Drag_Icon_Create_Cb createicon EINA_UNUSED,
- void *createdata EINA_UNUSED,
- Elm_Drag_Pos dragpos EINA_UNUSED,
- void *dragdata EINA_UNUSED,
- Elm_Drag_Accept acceptcb EINA_UNUSED,
- void *acceptdata EINA_UNUSED,
- Elm_Drag_State dragdone EINA_UNUSED,
- void *donecbdata EINA_UNUSED);
-static Eina_Bool _local_elm_selection_selection_has_owner(Evas_Object *obj EINA_UNUSED);
-
-static void
-_local_get_job(void *data)
-{
- Local_Selinfo *info = data;
- Elm_Selection_Data ev;
-
- info->get.job = NULL;
- ev.x = 0;
- ev.y = 0;
- ev.format = info->format;
- ev.data = info->sel.buf;
- ev.len = info->sel.size;
- ev.action = ELM_XDND_ACTION_UNKNOWN;
- if (info->get.func)
- info->get.func(info->get.data, info->get.obj, &ev);
-}
-
-static Eina_Bool
-_local_elm_cnp_init(void)
-{
- static int _init_count = 0;
-
- if (_init_count > 0) return EINA_TRUE;
- _init_count++;
- memset(&(_local_selinfo), 0, sizeof(_local_selinfo));
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_local_elm_cnp_selection_set(Evas_Object *obj EINA_UNUSED,
- Elm_Sel_Type selection, Elm_Sel_Format format,
- const void *selbuf, size_t buflen)
-{
- _local_elm_cnp_init();
- free(_local_selinfo[selection].sel.buf);
- _local_selinfo[selection].format = format;
- _local_selinfo[selection].sel.buf = malloc(buflen + 1);
- if ((_local_selinfo[selection].sel.buf) && (selbuf))
- {
- memcpy(_local_selinfo[selection].sel.buf, selbuf, buflen);
- _local_selinfo[selection].sel.buf[buflen] = 0;
- _local_selinfo[selection].sel.size = buflen;
- }
- else
- _local_selinfo[selection].sel.size = 0;
- return EINA_TRUE;
-}
-
-static void
-_local_elm_cnp_selection_loss_callback_set(Evas_Object *obj EINA_UNUSED,
- Elm_Sel_Type selection EINA_UNUSED,
- Elm_Selection_Loss_Cb func EINA_UNUSED,
- const void *data EINA_UNUSED)
-{
- _local_elm_cnp_init();
- // this doesn't need to do anything as we never lose selection to anyone
- // as thisis local
-}
-
-static Eina_Bool
-_local_elm_object_cnp_selection_clear(Evas_Object *obj EINA_UNUSED,
- Elm_Sel_Type selection)
-{
- _local_elm_cnp_init();
- ELM_SAFE_FREE(_local_selinfo[selection].sel.buf, free);
- _local_selinfo[selection].sel.size = 0;
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_local_elm_cnp_selection_get(const Evas_Object *obj,
- Elm_Sel_Type selection,
- Elm_Sel_Format format EINA_UNUSED,
- Elm_Drop_Cb datacb, void *udata)
-{
- _local_elm_cnp_init();
- if (_local_selinfo[selection].get.job)
- ecore_job_del(_local_selinfo[selection].get.job);
- _local_selinfo[selection].get.obj = (Evas_Object *)obj;
- _local_selinfo[selection].get.func = datacb;
- _local_selinfo[selection].get.data = udata;
- _local_selinfo[selection].get.job =
- ecore_job_add(_local_get_job, &(_local_selinfo[selection]));
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_local_elm_drop_target_add(Evas_Object *obj EINA_UNUSED,
- Elm_Sel_Format format EINA_UNUSED,
- Elm_Drag_State entercb EINA_UNUSED,
- void *enterdata EINA_UNUSED,
- Elm_Drag_State leavecb EINA_UNUSED,
- void *leavedata EINA_UNUSED,
- Elm_Drag_Pos poscb EINA_UNUSED,
- void *posdata EINA_UNUSED,
- Elm_Drop_Cb dropcb EINA_UNUSED,
- void *dropdata EINA_UNUSED)
-{
- // XXX: implement me
- _local_elm_cnp_init();
- return EINA_FALSE;
-}
-
-static Eina_Bool
-_local_elm_drop_target_del(Evas_Object *obj, Elm_Sel_Format format,
- Elm_Drag_State entercb, void *enterdata,
- Elm_Drag_State leavecb, void *leavedata,
- Elm_Drag_Pos poscb, void *posdata,
- Elm_Drop_Cb dropcb, void *dropdata)
-{
- Dropable *dropable = NULL;
-
- _local_elm_cnp_init();
-
- dropable = efl_key_data_get(obj, "__elm_dropable");
- if (dropable)
- {
- Eina_Inlist *itr;
- Dropable_Cbs *cbs_info;
- /* Look for the callback in the list */
- EINA_INLIST_FOREACH_SAFE(dropable->cbs_list, itr, cbs_info)
- if (cbs_info->entercb == entercb && cbs_info->enterdata == enterdata &&
- cbs_info->leavecb == leavecb && cbs_info->leavedata == leavedata &&
- cbs_info->poscb == poscb && cbs_info->posdata == posdata &&
- cbs_info->dropcb == dropcb && cbs_info->dropdata == dropdata &&
- cbs_info->types == format)
- {
- dropable->cbs_list = eina_inlist_remove(dropable->cbs_list,
- EINA_INLIST_GET(cbs_info));
- free(cbs_info);
- }
- /* In case no more callbacks are listed for the object */
- if (!dropable->cbs_list)
- {
- drops = eina_list_remove(drops, dropable);
- efl_key_data_set(obj, "__elm_dropable", NULL);
- free(dropable);
- dropable = NULL;
- evas_object_event_callback_del(obj, EVAS_CALLBACK_DEL,
- _all_drop_targets_cbs_del);
- }
- if (!drops)
- {
- _elm_cnp_shutdown();
- }
- return EINA_TRUE;
- }
-
- return EINA_FALSE;
-}
-
-static Eina_Bool
-_local_elm_drag_start(Evas_Object *obj EINA_UNUSED,
- Elm_Sel_Format format EINA_UNUSED,
- const char *data EINA_UNUSED,
- Elm_Xdnd_Action action EINA_UNUSED,
- Elm_Drag_Icon_Create_Cb createicon EINA_UNUSED,
- void *createdata EINA_UNUSED,
- Elm_Drag_Pos dragpos EINA_UNUSED,
- void *dragdata EINA_UNUSED,
- Elm_Drag_Accept acceptcb EINA_UNUSED,
- void *acceptdata EINA_UNUSED,
- Elm_Drag_State dragdone EINA_UNUSED,
- void *donecbdata EINA_UNUSED)
-{
- // XXX: implement me
- _local_elm_cnp_init();
- return EINA_FALSE;
-}
-
-static Eina_Bool
-_local_elm_drag_action_set(Evas_Object *obj EINA_UNUSED,
- Elm_Xdnd_Action action EINA_UNUSED)
-{
- // XXX: implement me
- _local_elm_cnp_init();
- return EINA_FALSE;
-}
-
-static Eina_Bool
-_local_elm_selection_selection_has_owner(Evas_Object *obj EINA_UNUSED)
-{
- _local_elm_cnp_init();
- if (_local_selinfo[ELM_SEL_TYPE_CLIPBOARD].sel.buf) return EINA_TRUE;
- return EINA_FALSE;
-}
-#endif
-
-// win32 specific stuff
-////////////////////////////////////////////////////////////////////////////
-#ifdef HAVE_ELEMENTARY_WIN32
-
-typedef struct _Win32_Cnp_Selection Win32_Cnp_Selection;
-
-struct _Win32_Cnp_Selection
-{
- const char *debug;
- Evas_Object *widget;
- char *selbuf;
- Evas_Object *requestwidget;
- void *udata;
- Elm_Sel_Format requestformat;
- Elm_Drop_Cb datacb;
- Eina_Bool (*set)(const Ecore_Win32_Window *window, const void *data, int size);
- Eina_Bool (*clear)(const Ecore_Win32_Window *window);
- Eina_Bool (*get)(const Ecore_Win32_Window *window , void **data, int *size);
- Elm_Selection_Loss_Cb loss_cb;
- void *loss_data;
-
- Elm_Sel_Format format;
- Ecore_Win32_Selection ecore_sel;
- Ecore_Win32_Window *win;
- Elm_Xdnd_Action action;
-
- Eina_Bool active : 1;
-};
-
-#define ARRAYINIT(foo) [foo] =
-
-static Win32_Cnp_Selection _win32_selections[ELM_SEL_TYPE_CLIPBOARD + 1] =
-{
- ARRAYINIT(ELM_SEL_TYPE_PRIMARY)
- {
- .debug = "Primary",
- .ecore_sel = ECORE_WIN32_SELECTION_PRIMARY,
- .set = ecore_win32_clipboard_set,
- .clear = ecore_win32_clipboard_clear,
- .get = ecore_win32_clipboard_get,
- },
- ARRAYINIT(ELM_SEL_TYPE_SECONDARY)
- {
- .debug = "Secondary",
- .ecore_sel = ECORE_WIN32_SELECTION_OTHER,
- },
- ARRAYINIT(ELM_SEL_TYPE_XDND)
- {
- .debug = "XDnD",
- .ecore_sel = ECORE_WIN32_SELECTION_OTHER,
- },
- ARRAYINIT(ELM_SEL_TYPE_CLIPBOARD)
- {
- .debug = "Clipboard",
- .ecore_sel = ECORE_WIN32_SELECTION_CLIPBOARD,
- .set = ecore_win32_clipboard_set,
- .clear = ecore_win32_clipboard_clear,
- .get = ecore_win32_clipboard_get,
- }
-};
-
-static char *
-_win32_text_n_to_rn(char *intext)
-{
- size_t size = 0, newlines = 0;
- char *outtext = NULL, *p, *o;
-
- if (!intext) return NULL;
- for (p = intext; *p; p++)
- {
- if (*p == '\n') newlines++;
- size++;
- }
- outtext = malloc(size + newlines + 1);
- if (!outtext) return intext;
- for (p = intext, o = outtext; *p; p++, o++)
- {
- if (*p == '\n')
- {
- o++;
- *p = '\r';
- }
- *o = *p;
- }
- *o = '\0';
- free(intext);
- return outtext;
-}
-
-static char *
-_win32_text_rn_to_n(char *intext)
-{
- char *outtext = NULL, *p, *o;
-
- if (!intext) return NULL;
- outtext = malloc(strlen(intext) + 1);
- if (!outtext) return intext;
- for (p = intext, o = outtext; *p; p++, o++)
- {
- if ((*p == '\r') && (p[1] == '\n'))
- {
- p++;
- *p = '\n';
- }
- else *o = *p;
- }
- *o = '\0';
- free(intext);
- return outtext;
-}
-
-static void
-_win32_sel_obj_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
-{
- Win32_Cnp_Selection *sel = data;
- if (sel->widget == obj) sel->widget = NULL;
- if (dragwidget == obj) dragwidget = NULL;
-}
-
-static void
-_win32_sel_obj_del2(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
-{
- Win32_Cnp_Selection *sel = data;
- if (sel->requestwidget == obj) sel->requestwidget = NULL;
-}
-
-static Eina_Bool
-_win32_elm_cnp_init(void)
-{
- static int _init_count = 0;
-
- if (_init_count > 0) return EINA_TRUE;
- _init_count++;
- return EINA_TRUE;
-}
-
-static Ecore_Win32_Window *
-_win32_elm_widget_window_get(const Evas_Object *obj)
-{
- Evas_Object *top;
- Ecore_Win32_Window *win = NULL;
-
- if (elm_widget_is(obj))
- {
- top = elm_widget_top_get(obj);
- if (!top)
- {
- Evas_Object *par;
- par = elm_widget_parent_widget_get(obj);
- if (par) top = elm_widget_top_get(par);
- }
- if (top && (efl_isa(top, EFL_UI_WIN_CLASS)))
- win = elm_win_win32_window_get(top);
- }
-
- if (!win)
- {
- Ecore_Evas *ee;
- Evas *evas;
- const char *engine_name;
-
- evas = evas_object_evas_get(obj);
- if (!evas) return NULL;
-
- ee = ecore_evas_ecore_evas_get(evas);
- if (!ee) return NULL;
-
- engine_name = ecore_evas_engine_name_get(ee);
- if (!strcmp(engine_name, ELM_BUFFER))
- {
- ee = ecore_evas_buffer_ecore_evas_parent_get(ee);
- if (!ee) return NULL;
- win = ecore_evas_win32_window_get(ee);
- }
- else
- {
- if ((strcmp(engine_name, ELM_SOFTWARE_WIN32) == 0) ||
- (strcmp(engine_name, ELM_SOFTWARE_DDRAW) == 0))
- return ecore_evas_win32_window_get(ee);
- }
- }
-
- return win;
-}
-
-static Eina_Bool
-_win32_elm_cnp_selection_set(Ecore_Win32_Window *win, Evas_Object *obj, Elm_Sel_Type selection, Elm_Sel_Format format, const void *selbuf, size_t buflen)
-{
- Win32_Cnp_Selection *sel;
-
- if (selection != ELM_SEL_TYPE_CLIPBOARD)
- return EINA_FALSE;
-
- _win32_elm_cnp_init();
- if ((!selbuf) && (format != ELM_SEL_FORMAT_IMAGE))
- return elm_object_cnp_selection_clear(obj, selection);
-
- sel = _win32_selections + selection;
- if (sel->widget != obj && sel->loss_cb) sel->loss_cb(sel->loss_data, selection);
- if (sel->widget)
- evas_object_event_callback_del_full(sel->widget, EVAS_CALLBACK_DEL,
- _win32_sel_obj_del, sel);
- sel->active = EINA_TRUE;
- sel->widget = obj;
- sel->win = win;
- if (sel->set) sel->set(win, selbuf, buflen);
- sel->format = format;
- sel->loss_cb = NULL;
- sel->loss_data = NULL;
-
- evas_object_event_callback_add
- (sel->widget, EVAS_CALLBACK_DEL, _win32_sel_obj_del, sel);
-
- ELM_SAFE_FREE(sel->selbuf, free);
- if (selbuf)
- {
- if (format == ELM_SEL_FORMAT_IMAGE)
- {
- // selbuf is actual image data, not text/string
- sel->selbuf = malloc(buflen + 1);
- if (!sel->selbuf)
- {
- elm_object_cnp_selection_clear(obj, selection);
- return EINA_FALSE;
- }
- memcpy(sel->selbuf, selbuf, buflen);
- sel->selbuf[buflen] = 0;
- }
- else
- sel->selbuf = strdup((char*)selbuf);
- }
-
- return EINA_TRUE;
-}
-
-static void
-_win32_elm_cnp_selection_loss_callback_set(Evas_Object *obj EINA_UNUSED, Elm_Sel_Type selection, Elm_Selection_Loss_Cb func, const void *data)
-{
- Win32_Cnp_Selection *sel;
-
- if (selection != ELM_SEL_TYPE_CLIPBOARD)
- return;
-
- _win32_elm_cnp_init();
- sel = _win32_selections + selection;
- sel->loss_cb = func;
- sel->loss_data = (void *)data;
-}
-
-static Eina_Bool
-_win32_elm_object_cnp_selection_clear(Ecore_Win32_Window *win, Evas_Object *obj, Elm_Sel_Type selection)
-{
- Win32_Cnp_Selection *sel;
-
- if (selection != ELM_SEL_TYPE_CLIPBOARD)
- return EINA_FALSE;
-
- _win32_elm_cnp_init();
-
- sel = _win32_selections + selection;
-
- /* No longer this selection: Consider it gone! */
- if ((!sel->active) || (sel->widget != obj))
- return EINA_TRUE;
-
- if (sel->widget)
- evas_object_event_callback_del_full(sel->widget, EVAS_CALLBACK_DEL,
- _win32_sel_obj_del, sel);
- if (sel->requestwidget)
- evas_object_event_callback_del_full(sel->requestwidget, EVAS_CALLBACK_DEL,
- _win32_sel_obj_del2, sel);
- sel->widget = NULL;
- sel->requestwidget = NULL;
- sel->loss_cb = NULL;
- sel->loss_data = NULL;
-
- sel->active = EINA_FALSE;
- ELM_SAFE_FREE(sel->selbuf, free);
- /* sel->clear(win); */
-
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_win32_elm_cnp_selection_get(Ecore_Win32_Window *win,
- const Evas_Object *obj,
- Elm_Sel_Type selection,
- Elm_Sel_Format format,
- Elm_Drop_Cb datacb,
- void *udata)
-{
- Win32_Cnp_Selection *sel;
- void *data;
- int size;
-
- if (selection != ELM_SEL_TYPE_CLIPBOARD)
- return EINA_FALSE;
-
- _win32_elm_cnp_init();
-
- sel = _win32_selections + selection;
-
- if (sel->requestwidget)
- evas_object_event_callback_del_full(sel->requestwidget, EVAS_CALLBACK_DEL,
- _win32_sel_obj_del2, sel);
- sel->requestformat = format;
- sel->requestwidget = (Evas_Object *)obj;
- sel->win = win;
- sel->get(win, &data, &size);
- sel->datacb = datacb;
- sel->udata = udata;
-
- if (!data || (size <= 0))
- goto cb_add;
-
- if ((sel->format & ELM_SEL_FORMAT_MARKUP) ||
- (sel->format & ELM_SEL_FORMAT_HTML))
- {
- char *str;
-
- str = (char *)malloc(size + 1);
- if (str)
- {
- memcpy(str, data, size);
- str[size] = '\0';
- data = _win32_text_n_to_rn(_elm_util_mkup_to_text(str));
- free(str);
- if (data)
- size = strlen(data);
- else
- size = 0;
- }
- else
- {
- free(data);
- data = NULL;
- }
- }
-
- if (sel->datacb && data && (size > 0))
- {
- Elm_Selection_Data sdata;
-
- sdata.x = sdata.y = 0;
- sdata.format = ELM_SEL_FORMAT_TEXT;
- sdata.data = data;
- sdata.len = size;
- sdata.action = sel->action;
- sel->datacb(sel->udata, sel->requestwidget, &sdata);
- }
-
- if (data)
- free(data);
-
- cb_add:
- evas_object_event_callback_add
- (sel->requestwidget, EVAS_CALLBACK_DEL, _win32_sel_obj_del2, sel);
-
- return EINA_TRUE;
-}
-
-#endif /* HAVE_ELEMENTARY_WIN32 */
-
-// common internal funcs
-////////////////////////////////////////////////////////////////////////////
-static Eina_Bool
-_elm_cnp_init(void)
-{
- int i;
- if (_elm_cnp_init_count > 0) return EINA_TRUE;
- _elm_cnp_init_count++;
- ELM_CNP_EVENT_SELECTION_CHANGED = ecore_event_type_new();
- text_uri = eina_stringshare_add("text/uri-list");
- _types_hash = eina_hash_string_small_new(NULL);
- for (i = 0; i < CNP_N_ATOMS; i++)
- {
- eina_hash_add(_types_hash, _atoms[i].name, &_atoms[i]);
- }
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_elm_cnp_shutdown(void)
-{
- if (!_elm_cnp_init_count) return EINA_TRUE;
- if (--_elm_cnp_init_count > 0) return EINA_TRUE;
- ELM_CNP_EVENT_SELECTION_CHANGED = -1;
- eina_stringshare_del(text_uri);
- text_uri = NULL;
- ELM_SAFE_FREE(_types_hash, eina_hash_free);
- return EINA_TRUE;
-}
-
-/* TODO: this should not be an actual tempfile, but rather encode the object
- * as http://dataurl.net/ if it's an image or similar. Evas should support
- * decoding it as memfile. */
-static Tmp_Info *
-_tempfile_new(int size)
-{
-#ifdef HAVE_MMAN_H
- Tmp_Info *info;
- const char *tmppath = NULL;
- mode_t cur_umask;
- int len;
-
- info = calloc(1, sizeof(Tmp_Info));
- if (!info) return NULL;
-#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
- if (getuid() == geteuid())
-#endif
- tmppath = getenv("TMP");
- if (!tmppath) tmppath = P_tmpdir;
- len = snprintf(NULL, 0, "%s/%sXXXXXX", tmppath, "elmcnpitem-");
- if (len < 0) goto on_error;
- len++;
- info->filename = malloc(len);
- if (!info->filename) goto on_error;
- snprintf(info->filename,len,"%s/%sXXXXXX", tmppath, "elmcnpitem-");
- cur_umask = umask(S_IRWXO | S_IRWXG);
- info->fd = mkstemp(info->filename);
- umask(cur_umask);
- if (info->fd < 0) goto on_error;
-# ifdef __linux__
- {
- char *tmp;
- /* And before someone says anything see POSIX 1003.1-2008 page 400 */
- long pid;
-
- pid = (long)getpid();
- /* Use pid instead of /proc/self: That way if can be passed around */
- len = snprintf(NULL,0,"/proc/%li/fd/%i", pid, info->fd);
- len++;
- tmp = malloc(len);
- if (tmp)
- {
- snprintf(tmp,len, "/proc/%li/fd/%i", pid, info->fd);
- unlink(info->filename);
- free(info->filename);
- info->filename = tmp;
- }
- }
-# endif
- cnp_debug("filename is %s\n", info->filename);
- if (size < 1) goto on_error;
- /* Map it in */
- if (ftruncate(info->fd, size))
- {
- perror("ftruncate");
- goto on_error;
- }
- eina_mmap_safety_enabled_set(EINA_TRUE);
- info->map = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_SHARED, info->fd, 0);
- if (info->map == MAP_FAILED)
- {
- perror("mmap");
- goto on_error;
- }
- return info;
-
- on_error:
- if (info->fd >= 0) close(info->fd);
- info->fd = -1;
- /* Set map to NULL and return */
- info->map = NULL;
- info->len = 0;
- free(info->filename);
- free(info);
- return NULL;
-#else
- (void) size;
- return NULL;
-#endif
-}
-
-static int
-_tmpinfo_free(Tmp_Info *info)
-{
- if (!info) return 0;
- free(info->filename);
- free(info);
- return 0;
-}
-
-////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////
-// common exposed funcs
-////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////
-EAPI Eina_Bool
-elm_cnp_selection_set(Evas_Object *obj, Elm_Sel_Type selection,
- Elm_Sel_Format format, const void *selbuf, size_t buflen)
-{
- if (selection > ELM_SEL_TYPE_CLIPBOARD) return EINA_FALSE;
- if (!_elm_cnp_init_count) _elm_cnp_init();
-#ifdef HAVE_ELEMENTARY_X
- Ecore_X_Window xwin = _x11_elm_widget_xwin_get(obj);
- if (xwin)
- return _x11_elm_cnp_selection_set(xwin, obj, selection, format, selbuf, buflen);
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- if (_wl_elm_widget_window_get(obj))
- return _wl_elm_cnp_selection_set(obj, selection, format, selbuf, buflen);
-#endif
-#ifdef HAVE_ELEMENTARY_COCOA
- Ecore_Cocoa_Window *win = _cocoa_elm_widget_cocoa_window_get(obj);
- if (win)
- return _cocoa_elm_cnp_selection_set(win, obj, selection, format, selbuf, buflen);
-#endif
-#ifdef HAVE_ELEMENTARY_WIN32
- Ecore_Win32_Window *win;
-
- win = _win32_elm_widget_window_get(obj);
- if (win)
- return _win32_elm_cnp_selection_set(win, obj, selection, format, selbuf, buflen);
-#endif
- return _local_elm_cnp_selection_set(obj, selection, format, selbuf, buflen);
-}
-
-EAPI void
-elm_cnp_selection_loss_callback_set(Evas_Object *obj, Elm_Sel_Type selection,
- Elm_Selection_Loss_Cb func,
- const void *data)
-{
- if (selection > ELM_SEL_TYPE_CLIPBOARD) return;
- if (!_elm_cnp_init_count) _elm_cnp_init();
-#ifdef HAVE_ELEMENTARY_X
- if (_x11_elm_widget_xwin_get(obj))
- _x11_elm_cnp_selection_loss_callback_set(obj, selection, func, data);
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- if (_wl_elm_widget_window_get(obj))
- _wl_elm_cnp_selection_loss_callback_set(obj, selection, func, data);
-#endif
-#ifdef HAVE_ELEMENTARY_COCOA
- if (_cocoa_elm_widget_cocoa_window_get(obj))
- _cocoa_elm_cnp_selection_loss_callback_set(obj, selection, func, data);
-#endif
-#ifdef HAVE_ELEMENTARY_WIN32
- if (_win32_elm_widget_window_get(obj))
- _win32_elm_cnp_selection_loss_callback_set(obj, selection, func, data);
-#endif
- _local_elm_cnp_selection_loss_callback_set(obj, selection, func, data);
-}
-
-EAPI Eina_Bool
-elm_object_cnp_selection_clear(Evas_Object *obj, Elm_Sel_Type selection)
-{
- if (selection > ELM_SEL_TYPE_CLIPBOARD) return EINA_FALSE;
- if (!_elm_cnp_init_count) _elm_cnp_init();
-#ifdef HAVE_ELEMENTARY_X
- if (_x11_elm_widget_xwin_get(obj))
- return _x11_elm_object_cnp_selection_clear(obj, selection);
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- if (_wl_elm_widget_window_get(obj))
- return _wl_elm_cnp_selection_clear(obj, selection);
-#endif
-#ifdef HAVE_ELEMENTARY_COCOA
- if (_cocoa_elm_widget_cocoa_window_get(obj))
- return _cocoa_elm_cnp_selection_clear(obj, selection);
-#endif
-#ifdef HAVE_ELEMENTARY_WIN32
- Ecore_Win32_Window *win;
-
- win = _win32_elm_widget_window_get(obj);
- if (win)
- return _win32_elm_object_cnp_selection_clear(win, obj, selection);
-#endif
- return _local_elm_object_cnp_selection_clear(obj, selection);
-}
-
-EAPI Eina_Bool
-elm_cnp_selection_get(const Evas_Object *obj, Elm_Sel_Type selection,
- Elm_Sel_Format format, Elm_Drop_Cb datacb, void *udata)
-{
- if (selection > ELM_SEL_TYPE_CLIPBOARD) return EINA_FALSE;
- if (!_elm_cnp_init_count) _elm_cnp_init();
-#ifdef HAVE_ELEMENTARY_X
- Ecore_X_Window xwin = _x11_elm_widget_xwin_get(obj);
- if (xwin)
- return _x11_elm_cnp_selection_get(xwin, obj, selection, format, datacb, udata);
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- if (_wl_elm_widget_window_get(obj))
- return _wl_elm_cnp_selection_get(obj, selection, format, datacb, udata);
-#endif
-#ifdef HAVE_ELEMENTARY_COCOA
- Ecore_Cocoa_Window *win = _cocoa_elm_widget_cocoa_window_get(obj);
- if (win)
- return _cocoa_elm_cnp_selection_get(obj, win, selection, format, datacb, udata);
-#endif
-#ifdef HAVE_ELEMENTARY_WIN32
- Ecore_Win32_Window *win;
-
- win = _win32_elm_widget_window_get(obj);
- if (win)
- return _win32_elm_cnp_selection_get(win, obj, selection, format, datacb, udata);
-#endif
- return _local_elm_cnp_selection_get(obj, selection, format, datacb, udata);
-}
-
-////////////////////////////////////////////////////////////////////////////
-
-/**
- * Add a widget as drop target.
- */
-EAPI Eina_Bool
-elm_drop_target_add(Evas_Object *obj, Elm_Sel_Format format,
- Elm_Drag_State entercb, void *enterdata,
- Elm_Drag_State leavecb, void *leavedata,
- Elm_Drag_Pos poscb, void *posdata,
- Elm_Drop_Cb dropcb, void *dropdata)
-{
- if (!_elm_cnp_init_count) _elm_cnp_init();
-#ifdef HAVE_ELEMENTARY_X
- if (_x11_elm_widget_xwin_get(obj))
- return _x11_elm_drop_target_add(obj, format, entercb, enterdata,
- leavecb, leavedata, poscb, posdata,
- dropcb, dropdata);
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- if (_wl_elm_widget_window_get(obj))
- return _wl_elm_drop_target_add(obj, format, entercb, enterdata,
- leavecb, leavedata, poscb, posdata,
- dropcb, dropdata);
-#endif
- return _local_elm_drop_target_add(obj, format, entercb, enterdata,
- leavecb, leavedata, poscb, posdata,
- dropcb, dropdata);
-}
-
-EAPI Eina_Bool
-elm_drop_target_del(Evas_Object *obj, Elm_Sel_Format format,
- Elm_Drag_State entercb, void *enterdata,
- Elm_Drag_State leavecb, void *leavedata,
- Elm_Drag_Pos poscb, void *posdata,
- Elm_Drop_Cb dropcb, void *dropdata)
-{
- if (!_elm_cnp_init_count) _elm_cnp_init();
-#ifdef HAVE_ELEMENTARY_X
- if (_x11_elm_widget_xwin_get(obj))
- return _x11_elm_drop_target_del(obj, format, entercb, enterdata,
- leavecb, leavedata, poscb, posdata, dropcb, dropdata);
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- if (_wl_elm_widget_window_get(obj))
- return _wl_elm_drop_target_del(obj, format, entercb, enterdata,
- leavecb, leavedata, poscb, posdata, dropcb, dropdata);
-#endif
- /* FIXME: Not the best place for an error message, but meh.
- * This code path is actually valid if running in framebuffer, but it still shouldn't
- * be getting here because the drop target shouldn't be added. This is an error
- * and it's because of some stupid handling in both the X11 and the wayland backends
- * as seen in the commit that introduced this comment.
- * Window check is probably not the best idea, you should be doing engine check instead. */
- ERR("Please contact developers, you should probably not get here.");
- return _local_elm_drop_target_del(obj, format, entercb, enterdata,
- leavecb, leavedata, poscb, posdata, dropcb, dropdata);
-}
-
-EAPI Eina_Bool
-elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data,
- Elm_Xdnd_Action action,
- Elm_Drag_Icon_Create_Cb createicon, void *createdata,
- Elm_Drag_Pos dragpos, void *dragdata,
- Elm_Drag_Accept acceptcb, void *acceptdata,
- Elm_Drag_State dragdone, void *donecbdata)
-{
- if (!_elm_cnp_init_count) _elm_cnp_init();
-#ifdef HAVE_ELEMENTARY_X
- if (_x11_elm_widget_xwin_get(obj))
- return _x11_elm_drag_start(obj, format, data, action,
- createicon, createdata,
- dragpos, dragdata,
- acceptcb, acceptdata,
- dragdone, donecbdata);
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- if (_wl_elm_widget_window_get(obj))
- return _wl_elm_drag_start(obj, format, data, action,
- createicon, createdata,
- dragpos, dragdata,
- acceptcb, acceptdata,
- dragdone, donecbdata);
-#endif
- return _local_elm_drag_start(obj, format, data, action,
- createicon, createdata,
- dragpos, dragdata,
- acceptcb, acceptdata,
- dragdone, donecbdata);
-}
-
-EAPI Eina_Bool
-elm_drag_action_set(Evas_Object *obj, Elm_Xdnd_Action action)
-{
- if (!_elm_cnp_init_count) _elm_cnp_init();
-#ifdef HAVE_ELEMENTARY_X
- if (_x11_elm_widget_xwin_get(obj))
- return _x11_elm_drag_action_set(obj, action);
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- if (_wl_elm_widget_window_get(obj))
- return _wl_elm_drag_action_set(obj, action);
-#endif
- return _local_elm_drag_action_set(obj, action);
-}
-
-EAPI Eina_Bool
-elm_selection_selection_has_owner(Evas_Object *obj)
-{
- if (!_elm_cnp_init_count) _elm_cnp_init();
-#ifdef HAVE_ELEMENTARY_X
- if (_x11_elm_widget_xwin_get(obj))
- return _x11_elm_selection_selection_has_owner(obj);
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- Ecore_Wl2_Window *win;
-
- win = _wl_elm_widget_window_get(obj);
- if (win)
- return !!ecore_wl2_dnd_selection_get(_wl_default_seat_get(win, obj));
-#endif
- return _local_elm_selection_selection_has_owner(obj);
-}
-
-EAPI Eina_Bool
-elm_cnp_clipboard_selection_has_owner(Evas_Object *win)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(win, EINA_FALSE);
- return elm_selection_selection_has_owner(win);
-}
-
-/* START - Support elm containers for Drag and Drop */
-/* START - Support elm containers for Drop */
-static int
-_drop_item_container_cmp(const void *d1,
- const void *d2)
-{
- const Item_Container_Drop_Info *st = d1;
- return (((uintptr_t) (st->obj)) - ((uintptr_t) d2));
-}
-
-static void
-_elm_item_container_pos_cb(void *data, Evas_Object *obj, Evas_Coord x, Evas_Coord y, Elm_Xdnd_Action action)
-{ /* obj is the container pointer */
- Elm_Object_Item *it = NULL;
- int xposret = 0;
- int yposret = 0;
-
- Item_Container_Drop_Info *st =
- eina_list_search_unsorted(cont_drop_tg, _drop_item_container_cmp, obj);
-
- if (st && st->poscb)
- { /* Call container drop func with specific item pointer */
- int xo = 0;
- int yo = 0;
-
- evas_object_geometry_get(obj, &xo, &yo, NULL, NULL);
- if (st->itemgetcb)
- it = st->itemgetcb(obj, x+xo, y+yo, &xposret, &yposret);
-
- st->poscb(data, obj, it, x, y, xposret, yposret, action);
- }
-}
-
-static Eina_Bool
-_elm_item_container_drop_cb(void *data, Evas_Object *obj , Elm_Selection_Data *ev)
-{ /* obj is the container pointer */
- Elm_Object_Item *it = NULL;
- int xposret = 0;
- int yposret = 0;
-
- Item_Container_Drop_Info *st =
- eina_list_search_unsorted(cont_drop_tg, _drop_item_container_cmp, obj);
-
- if (st && st->dropcb)
- { /* Call container drop func with specific item pointer */
- int xo = 0;
- int yo = 0;
-
- evas_object_geometry_get(obj, &xo, &yo, NULL, NULL);
- if (st->itemgetcb)
- it = st->itemgetcb(obj, ev->x+xo, ev->y+yo, &xposret, &yposret);
-
- return st->dropcb(data, obj, it, ev, xposret, yposret);
- }
-
- return EINA_FALSE;
-}
-
-static Eina_Bool
-elm_drop_item_container_del_internal(Evas_Object *obj, Eina_Bool full)
-{
- Item_Container_Drop_Info *st =
- eina_list_search_unsorted(cont_drop_tg, _drop_item_container_cmp, obj);
-
- if (st)
- {
- // temp until st is stored inside data of obj.
- _all_drop_targets_cbs_del(NULL, NULL, obj, NULL);
- st->itemgetcb= NULL;
- st->poscb = NULL;
- st->dropcb = NULL;
-
- if (full)
- {
- cont_drop_tg = eina_list_remove(cont_drop_tg, st);
- free(st);
- }
-
- return EINA_TRUE;
- }
-
- return EINA_FALSE;
-}
-
-EAPI Eina_Bool
-elm_drop_item_container_del(Evas_Object *obj)
-{
- return elm_drop_item_container_del_internal(obj, EINA_TRUE);
-}
-
-EAPI Eina_Bool
-elm_drop_item_container_add(Evas_Object *obj,
- Elm_Sel_Format format,
- Elm_Xy_Item_Get_Cb itemgetcb,
- Elm_Drag_State entercb, void *enterdata,
- Elm_Drag_State leavecb, void *leavedata,
- Elm_Drag_Item_Container_Pos poscb, void *posdata,
- Elm_Drop_Item_Container_Cb dropcb, void *dropdata)
-{
- Item_Container_Drop_Info *st;
-
- if (elm_drop_item_container_del_internal(obj, EINA_FALSE))
- { /* Updating info of existing obj */
- st = eina_list_search_unsorted(cont_drop_tg, _drop_item_container_cmp, obj);
- if (!st) return EINA_FALSE;
- }
- else
- {
- st = calloc(1, sizeof(*st));
- if (!st) return EINA_FALSE;
-
- st->obj = obj;
- cont_drop_tg = eina_list_append(cont_drop_tg, st);
- }
-
- st->itemgetcb = itemgetcb;
- st->poscb = poscb;
- st->dropcb = dropcb;
- elm_drop_target_add(obj, format,
- entercb, enterdata,
- leavecb, leavedata,
- _elm_item_container_pos_cb, posdata,
- _elm_item_container_drop_cb, dropdata);
-
- return EINA_TRUE;
-}
-/* END - Support elm containers for Drop */
-
-/* START - Support elm containers for Drag */
-static int
-_drag_item_container_cmp(const void *d1,
- const void *d2)
-{
- const Item_Container_Drag_Info *st = d1;
- return (((uintptr_t) (st->obj)) - ((uintptr_t) d2));
-}
-
-static void
-_cont_drag_done_cb(void *data, Evas_Object *obj EINA_UNUSED)
-{
- Item_Container_Drag_Info *st = data;
- elm_widget_scroll_freeze_pop(st->obj);
- if (st->user_info.dragdone)
- st->user_info.dragdone(st->user_info.donecbdata, dragwidget, doaccept);
-}
-
-static Eina_Bool
-_cont_obj_drag_start(void *data)
-{ /* Start a drag-action when timer expires */
- cnp_debug("In\n");
- Item_Container_Drag_Info *st = data;
- st->tm = NULL;
- Elm_Drag_User_Info *info = &st->user_info;
- if (info->dragstart) info->dragstart(info->startcbdata, st->obj);
- elm_widget_scroll_freeze_push(st->obj);
- evas_object_event_callback_del_full
- (st->obj, EVAS_CALLBACK_MOUSE_MOVE, _cont_obj_mouse_move, st);
- elm_drag_start( /* Commit the start only if data_get successful */
- st->obj, info->format,
- info->data, info->action,
- info->createicon, info->createdata,
- info->dragpos, info->dragdata,
- info->acceptcb, info->acceptdata,
- _cont_drag_done_cb, st);
- ELM_SAFE_FREE(info->data, free);
-
- return ECORE_CALLBACK_CANCEL;
-}
-
-static void
-_anim_st_free(Item_Container_Drag_Info *st)
-{ /* Stops and free mem of ongoing animation */
- if (st)
- {
- ELM_SAFE_FREE(st->ea, ecore_animator_del);
- Anim_Icon *sti;
- Eo *icon;
-
- EINA_LIST_FREE(st->icons, sti)
- {
- evas_object_del(sti->o);
- free(sti);
- }
- st->icons = NULL;
-
- EINA_LIST_FREE(st->user_info.icons, icon)
- {
- evas_object_del(icon);
- }
- st->user_info.icons = NULL;
- }
-}
-
-static inline Eina_List *
-_anim_icons_make(Item_Container_Drag_Info *st)
-{ /* Transfer user icons to animation icons list */
- Eina_List *list = NULL;
- Evas_Object *o;
-
- EINA_LIST_FREE(st->user_info.icons, o)
- { /* Now add icons to animation window */
- Anim_Icon *ast = calloc(1, sizeof(*ast));
-
- if (!ast)
- {
- ERR("Failed to allocate memory for icon!");
- continue;
- }
-
- evas_object_geometry_get(o, &ast->start_x, &ast->start_y, &ast->start_w, &ast->start_h);
- evas_object_show(o);
- ast->o = o;
- list = eina_list_append(list, ast);
- }
-
- return list;
-}
-
-static Eina_Bool
-_drag_anim_play(void *data, double pos)
-{ /* Impl of the animation of icons, called on frame time */
- cnp_debug("In\n");
- Item_Container_Drag_Info *st = data;
- Eina_List *l;
- Anim_Icon *sti;
-
- if (st->ea)
- {
- if (pos > 0.99)
- {
- st->ea = NULL; /* Avoid deleting on mouse up */
- EINA_LIST_FOREACH(st->icons, l, sti)
- evas_object_hide(sti->o);
-
- _cont_obj_drag_start(st); /* Start dragging */
- return ECORE_CALLBACK_CANCEL;
- }
-
- Evas_Coord xm, ym;
- evas_pointer_canvas_xy_get(st->e, &xm, &ym);
- EINA_LIST_FOREACH(st->icons, l, sti)
- {
- int x, y, h, w;
- w = sti->start_w + ((st->final_icon_w - sti->start_w) * pos);
- h = sti->start_h + ((st->final_icon_h - sti->start_h) * pos);
- x = sti->start_x - (pos * ((sti->start_x + (w/2) - xm)));
- y = sti->start_y - (pos * ((sti->start_y + (h/2) - ym)));
- evas_object_move(sti->o, x, y);
- evas_object_resize(sti->o, w, h);
- }
-
- return ECORE_CALLBACK_RENEW;
- }
-
- return ECORE_CALLBACK_CANCEL;
-}
-
-static inline Eina_Bool
-_drag_anim_start(void *data)
-{ /* Start default animation */
- cnp_debug("In\n");
- Item_Container_Drag_Info *st = data;
-
- st->tm = NULL;
- /* Now we need to build an (Anim_Icon *) list */
- st->icons = _anim_icons_make(st);
- if (st->user_info.createicon)
- {
- Evas_Object *temp_win = elm_win_add(NULL, "Temp", ELM_WIN_DND);
- Evas_Object *final_icon = st->user_info.createicon(st->user_info.createdata, temp_win, NULL, NULL);
- evas_object_geometry_get(final_icon, NULL, NULL, &st->final_icon_w, &st->final_icon_h);
- evas_object_del(final_icon);
- evas_object_del(temp_win);
- }
- st->ea = ecore_animator_timeline_add(st->anim_tm, _drag_anim_play, st);
-
- return EINA_FALSE;
-}
-
-static Eina_Bool
-_cont_obj_anim_start(void *data)
-{ /* Start a drag-action when timer expires */
- cnp_debug("In\n");
- Item_Container_Drag_Info *st = data;
- int xposret, yposret; /* Unused */
- Elm_Object_Item *it = (st->itemgetcb) ?
- (st->itemgetcb(st->obj, st->x_down, st->y_down, &xposret, &yposret))
- : NULL;
-
- st->tm = NULL;
- st->user_info.format = ELM_SEL_FORMAT_TARGETS; /* Default */
- st->icons = NULL;
- st->user_info.data = NULL;
- st->user_info.action = ELM_XDND_ACTION_COPY; /* Default */
-
- if (!it) /* Failed to get mouse-down item, abort drag */
- return ECORE_CALLBACK_CANCEL;
-
- if (st->data_get)
- { /* collect info then start animation or start dragging */
- if (st->data_get( /* Collect drag info */
- st->obj, /* The container object */
- it, /* Drag started on this item */
- &st->user_info))
- {
- if (EINA_DBL_EQ(st->anim_tm, 0.0))
- _cont_obj_drag_start(st); /* Start dragging, no anim */
- else
- {
- if (st->user_info.icons)
- {
- _drag_anim_start(st);
- }
- else
- {
- // even if we don't manage the icons animation, we have
- // to wait until it is finished before beginning drag.
- st->tm = ecore_timer_add(st->anim_tm, _cont_obj_drag_start, st);
- }
- }
- }
- }
-
- return ECORE_CALLBACK_CANCEL;
-}
-
-static void
-_cont_obj_mouse_down(void *data, Evas *e, Evas_Object *obj EINA_UNUSED, void *event_info)
-{ /* Launch a timer to start dragging */
- Evas_Event_Mouse_Down *ev = event_info;
- cnp_debug("In - event %X\n", ev->event_flags);
- if (ev->button != 1)
- return; /* We only process left-click at the moment */
-
- Item_Container_Drag_Info *st = data;
- st->e = e;
- st->x_down = ev->canvas.x;
- st->y_down = ev->canvas.y;
-
- evas_object_event_callback_add(st->obj, EVAS_CALLBACK_MOUSE_UP,
- _cont_obj_mouse_up, st);
-
- ecore_timer_del(st->tm);
-
- if (st->tm_to_drag)
- {
- st->tm = ecore_timer_add(st->tm_to_drag, _cont_obj_anim_start, st);
- evas_object_event_callback_add(st->obj, EVAS_CALLBACK_MOUSE_MOVE,
- _cont_obj_mouse_move, st);
- }
- else
- _cont_obj_anim_start(st);
-}
-
-static Eina_Bool elm_drag_item_container_del_internal(Evas_Object *obj, Eina_Bool full);
-
-static void
-_abort_drag(Evas_Object *obj, Item_Container_Drag_Info *st)
-{
- evas_object_event_callback_del_full
- (st->obj, EVAS_CALLBACK_MOUSE_MOVE, _cont_obj_mouse_move, st);
- evas_object_event_callback_del_full
- (st->obj, EVAS_CALLBACK_MOUSE_UP, _cont_obj_mouse_up, st);
- elm_drag_item_container_del_internal(obj, EINA_FALSE);
-
- ELM_SAFE_FREE(st->tm, ecore_timer_del);
-
- _anim_st_free(st);
-}
-
-static void
-_cont_obj_mouse_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
-{ /* Cancel any drag waiting to start on timeout */
- cnp_debug("In\n");
- Item_Container_Drag_Info *st = data;
- Evas_Event_Mouse_Move *ev = event_info;
-
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
- {
- cnp_debug("event on hold - have to cancel DnD\n");
-
- _abort_drag(obj, st);
- st = NULL;
- }
-
- if (st && evas_device_class_get(ev->dev) == EVAS_DEVICE_CLASS_TOUCH)
- {
- int dx = ev->cur.canvas.x - st->x_down, dy = ev->cur.canvas.y - st->y_down;
- int finger_size = elm_config_finger_size_get();
- if ((dx * dx + dy * dy > finger_size * finger_size))
- {
- cnp_debug("mouse moved too much - have to cancel DnD\n");
-
- _abort_drag(obj, st);
- st = NULL;
- }
- }
- cnp_debug("Out\n");
-}
-
-static void
-_cont_obj_mouse_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
-{ /* Cancel any drag waiting to start on timeout */
- Item_Container_Drag_Info *st = data;
-
- cnp_debug("In\n");
- if (((Evas_Event_Mouse_Up *)event_info)->button != 1)
- return; /* We only process left-click at the moment */
-
- evas_object_event_callback_del_full
- (st->obj, EVAS_CALLBACK_MOUSE_MOVE, _cont_obj_mouse_move, st);
- evas_object_event_callback_del_full
- (st->obj, EVAS_CALLBACK_MOUSE_UP, _cont_obj_mouse_up, st);
-
- ELM_SAFE_FREE(st->tm, ecore_timer_del);
-
- _anim_st_free(st);
-}
-
-static Eina_Bool
-elm_drag_item_container_del_internal(Evas_Object *obj, Eina_Bool full)
-{
- Item_Container_Drag_Info *st =
- eina_list_search_unsorted(cont_drag_tg, _drag_item_container_cmp, obj);
-
- if (st)
- {
- ELM_SAFE_FREE(st->tm, ecore_timer_del); /* Cancel drag-start timer */
-
- if (st->ea) /* Cancel ongoing default animation */
- _anim_st_free(st);
-
- if (full)
- {
- st->itemgetcb = NULL;
- st->data_get = NULL;
- evas_object_event_callback_del_full
- (obj, EVAS_CALLBACK_MOUSE_DOWN, _cont_obj_mouse_down, st);
-
- cont_drag_tg = eina_list_remove(cont_drag_tg, st);
- ELM_SAFE_FREE(st->user_info.data, free);
- free(st);
- }
-
- return EINA_TRUE;
- }
- return EINA_FALSE;
-}
-
-EAPI Eina_Bool
-elm_drag_item_container_del(Evas_Object *obj)
-{
- return elm_drag_item_container_del_internal(obj, EINA_TRUE);
-}
-
-EAPI Eina_Bool
-elm_drag_item_container_add(Evas_Object *obj, double anim_tm, double tm_to_drag, Elm_Xy_Item_Get_Cb itemgetcb, Elm_Item_Container_Data_Get_Cb data_get)
-{
- Item_Container_Drag_Info *st;
-
- if (elm_drag_item_container_del_internal(obj, EINA_FALSE))
- { /* Updating info of existing obj */
- st = eina_list_search_unsorted(cont_drag_tg, _drag_item_container_cmp, obj);
- if (!st) return EINA_FALSE;
- }
- else
- {
- st = calloc(1, sizeof(*st));
- if (!st) return EINA_FALSE;
-
- st->obj = obj;
- cont_drag_tg = eina_list_append(cont_drag_tg, st);
-
- /* Register for mouse callback for container to start/abort drag */
- evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_DOWN,
- _cont_obj_mouse_down, st);
- }
-
- st->tm = NULL;
- st->anim_tm = anim_tm;
- st->tm_to_drag = tm_to_drag;
- st->itemgetcb = itemgetcb;
- st->data_get = data_get;
-
- return EINA_TRUE;
-}
-/* END - Support elm containers for Drag */
-/* END - Support elm containers for Drag and Drop */
-
-EAPI Eina_Bool
-elm_drag_cancel(Evas_Object *obj)
-{
-#ifdef HAVE_ELEMENTARY_X
- Ecore_X_Window xwin = _x11_elm_widget_xwin_get(obj);
- if (xwin)
- {
- ecore_x_pointer_ungrab();
- ELM_SAFE_FREE(handler_up, ecore_event_handler_del);
- ELM_SAFE_FREE(handler_status, ecore_event_handler_del);
- ecore_x_dnd_abort(xwin);
- if (dragwidget)
- {
- if (elm_widget_is(dragwidget))
- {
- Evas_Object *win = elm_widget_top_get(dragwidget);
- if (win && efl_isa(win, EFL_UI_WIN_CLASS))
- efl_event_callback_del(win, EFL_UI_WIN_EVENT_ROTATION_CHANGED, _x11_win_rotation_changed_cb, dragwin);
- }
- }
- goto end;
- }
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- Ecore_Wl2_Window *win;
-
- win = _wl_elm_widget_window_get(obj);
- if (win)
- ecore_wl2_dnd_drag_end(_wl_default_seat_get(win, obj));
-#endif
-
-end:
- ELM_SAFE_FREE(dragwin, evas_object_del);
- dragdonecb = NULL;
- dragacceptcb = NULL;
- dragposcb = NULL;
- dragwidget = NULL;
- doaccept = EINA_FALSE;
- return EINA_TRUE;
-}
-
diff --git a/src/lib/elementary/elm_cnp.h b/src/lib/elementary/elm_cnp.h
index e48fe64c32..975d8f80d8 100644
--- a/src/lib/elementary/elm_cnp.h
+++ b/src/lib/elementary/elm_cnp.h
@@ -43,6 +43,8 @@
* @{
*/
+# include <efl_selection_types.eot.h>
+
/**
* Event notifying that the selection has changed
* @see Elm_Cnp_Event_Selection_Changed
@@ -55,50 +57,40 @@ EAPI extern int ELM_CNP_EVENT_SELECTION_CHANGED;
* @see http://www.x.org/docs/X11/xlib.pdf
* for more details.
*/
-typedef enum
-{
- ELM_SEL_TYPE_PRIMARY, /**< Primary text selection (highlighted or selected text) */
- ELM_SEL_TYPE_SECONDARY, /**< Used when primary selection is in use */
- ELM_SEL_TYPE_XDND, /**< Drag 'n' Drop */
- ELM_SEL_TYPE_CLIPBOARD, /**< Clipboard selection (ctrl+C) */
-} Elm_Sel_Type;
+typedef Efl_Selection_Type Elm_Sel_Type;
+
+#define ELM_SEL_TYPE_PRIMARY EFL_SELECTION_TYPE_PRIMARY
+#define ELM_SEL_TYPE_SECONDARY EFL_SELECTION_TYPE_SECONDARY
+#define ELM_SEL_TYPE_XDND EFL_SELECTION_TYPE_DND
+#define ELM_SEL_TYPE_CLIPBOARD EFL_SELECTION_TYPE_CLIPBOARD
/**
* Defines the types of content.
*/
-typedef enum
-{
- /** For matching every possible atom */
- ELM_SEL_FORMAT_TARGETS = -1,
- /** Content is from outside of Elementary */
- ELM_SEL_FORMAT_NONE = 0x0,
- /** Plain unformatted text: Used for things that don't want rich markup */
- ELM_SEL_FORMAT_TEXT = 0x01,
- /** Edje textblock markup, including inline images */
- ELM_SEL_FORMAT_MARKUP = 0x02,
- /** Images */
- ELM_SEL_FORMAT_IMAGE = 0x04,
- /** Vcards */
- ELM_SEL_FORMAT_VCARD = 0x08,
- /** Raw HTML-like data (eg. webkit) */
- ELM_SEL_FORMAT_HTML = 0x10,
-} Elm_Sel_Format;
+typedef Efl_Selection_Format Elm_Sel_Format;
+
+#define ELM_SEL_FORMAT_TARGETS EFL_SELECTION_FORMAT_TARGETS
+#define ELM_SEL_FORMAT_NONE EFL_SELECTION_FORMAT_NONE
+#define ELM_SEL_FORMAT_TEXT EFL_SELECTION_FORMAT_TEXT
+#define ELM_SEL_FORMAT_MARKUP EFL_SELECTION_FORMAT_MARKUP
+#define ELM_SEL_FORMAT_IMAGE EFL_SELECTION_FORMAT_IMAGE
+#define ELM_SEL_FORMAT_VCARD EFL_SELECTION_FORMAT_VCARD
+#define ELM_SEL_FORMAT_HTML EFL_SELECTION_FORMAT_HTML
/**
* Defines the kind of action associated with the drop data if for XDND
* @since 1.8
*/
-typedef enum
-{
- ELM_XDND_ACTION_UNKNOWN, /**< Action type is unknown */
- ELM_XDND_ACTION_COPY, /**< Copy the data */
- ELM_XDND_ACTION_MOVE, /**< Move the data */
- ELM_XDND_ACTION_PRIVATE, /**< Pricate action type */
- ELM_XDND_ACTION_ASK, /**< Ask the user what to do */
- ELM_XDND_ACTION_LIST, /**< List the data */
- ELM_XDND_ACTION_LINK, /**< Link the data */
- ELM_XDND_ACTION_DESCRIPTION /**< Describe the data */
-} Elm_Xdnd_Action;
+typedef Efl_Selection_Action Elm_Xdnd_Action;
+
+#define ELM_XDND_ACTION_UNKNOWN EFL_SELECTION_ACTION_UNKNOWN
+#define ELM_XDND_ACTION_COPY EFL_SELECTION_ACTION_COPY
+#define ELM_XDND_ACTION_MOVE EFL_SELECTION_ACTION_MOVE
+#define ELM_XDND_ACTION_PRIVATE EFL_SELECTION_ACTION_PRIVATE
+#define ELM_XDND_ACTION_ASK EFL_SELECTION_ACTION_ASK
+#define ELM_XDND_ACTION_LIST EFL_SELECTION_ACTION_LIST
+#define ELM_XDND_ACTION_LINK EFL_SELECTION_ACTION_LINK
+#define ELM_XDND_ACTION_DESCRIPTION EFL_SELECTION_ACTION_DESCRIPTION
/**
* Structure holding the info about selected data.
diff --git a/src/lib/elementary/elm_code.c b/src/lib/elementary/elm_code.c
index 38017b7cfb..cfe1f7edf3 100644
--- a/src/lib/elementary/elm_code.c
+++ b/src/lib/elementary/elm_code.c
@@ -21,6 +21,7 @@ elm_code_create(void)
Elm_Code *ret;
ret = calloc(1, sizeof(Elm_Code));
+ ret->config.indent_style_efl = EINA_TRUE;
// create an in-memory backing for this elm_code by default
elm_code_file_new(ret);
diff --git a/src/lib/elementary/elm_code_common.h b/src/lib/elementary/elm_code_common.h
index 2c0c88e922..925721f9c6 100644
--- a/src/lib/elementary/elm_code_common.h
+++ b/src/lib/elementary/elm_code_common.h
@@ -67,6 +67,7 @@ extern "C" {
struct _Elm_Code_Config
{
Eina_Bool trim_whitespace;
+ Eina_Bool indent_style_efl;
};
struct _Elm_Code
diff --git a/src/lib/elementary/elm_code_diff_widget.c b/src/lib/elementary/elm_code_diff_widget.c
index eec32ee48d..593f044bc7 100644
--- a/src/lib/elementary/elm_code_diff_widget.c
+++ b/src/lib/elementary/elm_code_diff_widget.c
@@ -5,6 +5,7 @@
#include "Elementary.h"
#include "elm_code_private.h"
+#include "elm_code_widget_legacy.eo.h"
#define _ELM_CODE_DIFF_WIDGET_LEFT "diffwidgetleft"
#define _ELM_CODE_DIFF_WIDGET_RIGHT "diffwidgetright"
@@ -95,7 +96,7 @@ elm_code_diff_widget_add(Evas_Object *parent, Elm_Code *code)
// left side of diff
wcode1 = elm_code_create();
elm_code_parser_standard_add(wcode1, ELM_CODE_PARSER_STANDARD_DIFF);
- widget_left = efl_add(ELM_CODE_WIDGET_CLASS, parent, elm_obj_code_widget_code_set(efl_added, wcode1));
+ widget_left = elm_legacy_add(ELM_CODE_WIDGET_LEGACY_CLASS, parent, elm_obj_code_widget_code_set(efl_added, wcode1));
evas_object_size_hint_weight_set(widget_left, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(widget_left, EVAS_HINT_FILL, EVAS_HINT_FILL);
@@ -106,7 +107,7 @@ elm_code_diff_widget_add(Evas_Object *parent, Elm_Code *code)
// right side of diff
wcode2 = elm_code_create();
elm_code_parser_standard_add(wcode2, ELM_CODE_PARSER_STANDARD_DIFF);
- widget_right = efl_add(ELM_CODE_WIDGET_CLASS, parent, elm_obj_code_widget_code_set(efl_added, wcode2));
+ widget_right = elm_legacy_add(ELM_CODE_WIDGET_LEGACY_CLASS, parent, elm_obj_code_widget_code_set(efl_added, wcode2));
evas_object_size_hint_weight_set(widget_right, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(widget_right, EVAS_HINT_FILL, EVAS_HINT_FILL);
diff --git a/src/lib/elementary/elm_code_indent.c b/src/lib/elementary/elm_code_indent.c
index 756186823b..9ce4cb0962 100644
--- a/src/lib/elementary/elm_code_indent.c
+++ b/src/lib/elementary/elm_code_indent.c
@@ -41,6 +41,8 @@ elm_code_line_indent_get(Elm_Code_Line *line)
unsigned int prevlength, count = 0;
char *buf, *ptr;
char next, last;
+ const char *indent = "\t";
+ Eina_Bool eflindent = ((Elm_Code *)line->file->parent)->config.indent_style_efl;
if (line->number <= 1)
return strdup("");
@@ -62,10 +64,14 @@ elm_code_line_indent_get(Elm_Code_Line *line)
strncpy(buf, prevtext, count);
buf[count] = '\0';
- if (elm_code_line_indent_startswith_keyword(prevline))
+ if (eflindent)
{
- strcpy(buf + count, " ");
- count += 2;
+ indent = " ";
+ if (elm_code_line_indent_startswith_keyword(prevline))
+ {
+ strcpy(buf + count, " ");
+ count += 2;
+ }
}
if (count < prevlength)
@@ -97,17 +103,16 @@ elm_code_line_indent_get(Elm_Code_Line *line)
else
strcpy(buf + count, "*");
}
- // VERY simple handling of braces
- else if (last == '{')
+ // Simple handling of braces
+ else if (last == '{' || (!eflindent && elm_code_line_indent_startswith_keyword(prevline)))
{
- strcpy(buf + count, " ");
+ strcpy(buf + count, indent);
}
else if (last == '}')
{
- if (count >= 2)
- buf[count-2] = '\0';
- else if (count >= 1)
- buf[count-1] = '\0';
+ unsigned int offset = strlen(indent) - 1;
+ if (count >= offset)
+ buf[count-offset] = '\0';
}
}
return buf;
diff --git a/src/lib/elementary/elm_code_parse.c b/src/lib/elementary/elm_code_parse.c
index 11f046f1ef..ce6dd78036 100644
--- a/src/lib/elementary/elm_code_parse.c
+++ b/src/lib/elementary/elm_code_parse.c
@@ -6,9 +6,11 @@
#include "elm_code_private.h"
+#ifndef ELM_CODE_TEST
EAPI Elm_Code_Parser *ELM_CODE_PARSER_STANDARD_SYNTAX = NULL;
EAPI Elm_Code_Parser *ELM_CODE_PARSER_STANDARD_DIFF = NULL;
EAPI Elm_Code_Parser *ELM_CODE_PARSER_STANDARD_TODO = NULL;
+#endif
struct _Elm_Code_Parser
{
@@ -79,7 +81,6 @@ _elm_code_parser_new(void (*parse_line)(Elm_Code_Line *, void *),
return parser;
}
-#ifndef ELM_CODE_TEST
EAPI void
elm_code_parser_add(Elm_Code *code,
void (*parse_line)(Elm_Code_Line *, void *),
@@ -105,7 +106,6 @@ elm_code_parser_standard_add(Elm_Code *code, Elm_Code_Parser *parser)
parser->standard = EINA_TRUE;
code->parsers = eina_list_append(code->parsers, parser);
}
-#endif // ELM_CODE_TEST
static void
_elm_code_parser_diff_trim_leading(Elm_Code_Line *line, unsigned int count)
diff --git a/src/lib/elementary/elm_code_syntax.c b/src/lib/elementary/elm_code_syntax.c
index 39046a194a..e1bd46f902 100644
--- a/src/lib/elementary/elm_code_syntax.c
+++ b/src/lib/elementary/elm_code_syntax.c
@@ -114,7 +114,7 @@ static Elm_Code_Syntax _elm_code_syntax_go =
"/*",
"*/",
_elm_code_syntax_scope_change_braces,
- { "break", "case", "chan", "const", "default", "defer", "else", "fallthrough", "for", "func", "go", "goto", \
+ { "break", "case", "chan", "const", "continue", "default", "defer", "else", "fallthrough", "for", "func", "go", "goto", \
"if", "import", "interface", "map", "package", "range", "return", "select", "struct", "switch", "type", "var", \
"true", "false", "iota", "nil", \
"int", "int8", "int16", "int32", "int64", "uint", "uint8", "uint16", "uint32", "uint64", "uintptr", "float32", \
diff --git a/src/lib/elementary/elm_code_widget.c b/src/lib/elementary/elm_code_widget.c
index f8c1f57d49..84a83195a6 100644
--- a/src/lib/elementary/elm_code_widget.c
+++ b/src/lib/elementary/elm_code_widget.c
@@ -58,14 +58,17 @@ static Eina_Unicode status_icons[] = {
static void _elm_code_widget_resize(Elm_Code_Widget *widget, Elm_Code_Line *newline);
-#ifndef ELM_CODE_TEST
+#include "elm_code_widget_legacy.eo.h"
+
EAPI Evas_Object *
elm_code_widget_add(Evas_Object *parent, Elm_Code *code)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return elm_legacy_add(MY_CLASS, parent, elm_obj_code_widget_code_set(efl_added, code));
+ return elm_legacy_add(ELM_CODE_WIDGET_LEGACY_CLASS, parent,
+ elm_obj_code_widget_code_set(efl_added, code));
}
-#endif // ELM_CODE_TEST
+
+#include "elm_code_widget_legacy.eo.c"
EOLIAN static Eo *
_elm_code_widget_efl_object_constructor(Eo *obj, Elm_Code_Widget_Data *pd)
@@ -1233,11 +1236,19 @@ _elm_code_widget_mouse_up_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj E
static void
_elm_code_widget_scroller_clicked_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
- void *event_info EINA_UNUSED)
+ void *event_info)
{
Elm_Code_Widget *widget;
+ Elm_Code_Widget_Data *pd;
+ Evas_Event_Mouse_Down *event;
widget = (Elm_Code_Widget *)data;
+ pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
+ event = (Evas_Event_Mouse_Down *)event_info;
+
+ if (_elm_code_widget_position_at_coordinates_get(widget, pd,
+ event->canvas.x, event->canvas.y, NULL, NULL))
+ return;
elm_code_widget_selection_clear(widget);
}
@@ -1864,7 +1875,7 @@ _elm_code_widget_scroll_event_cb(void *data, Evas_Object *obj EINA_UNUSED,
}
EOLIAN static Eina_Bool
-_elm_code_widget_elm_widget_widget_event(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd EINA_UNUSED, const Efl_Event *eo_event, Evas_Object *src EINA_UNUSED)
+_elm_code_widget_efl_ui_widget_widget_event(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd EINA_UNUSED, const Efl_Event *eo_event, Evas_Object *src EINA_UNUSED)
{
Eo *ev = eo_event->info;
@@ -2126,7 +2137,7 @@ _elm_code_widget_font_set(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd,
}
EOLIAN static void
-_elm_code_widget_font_get(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd,
+_elm_code_widget_font_get(const Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd,
const char **name, Evas_Font_Size *size)
{
if (name)
@@ -2136,7 +2147,7 @@ _elm_code_widget_font_get(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd,
}
EOLIAN static unsigned int
-_elm_code_widget_columns_get(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd)
+_elm_code_widget_columns_get(const Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd)
{
return pd->col_count;
}
@@ -2153,7 +2164,7 @@ _elm_code_widget_code_set(Eo *obj, Elm_Code_Widget_Data *pd, Elm_Code *code)
}
EOLIAN static Elm_Code *
-_elm_code_widget_code_get(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd)
+_elm_code_widget_code_get(const Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd)
{
return pd->code;
}
@@ -2166,7 +2177,7 @@ _elm_code_widget_gravity_set(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd, doub
}
EOLIAN static void
-_elm_code_widget_gravity_get(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd, double *x, double *y)
+_elm_code_widget_gravity_get(const Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd, double *x, double *y)
{
*x = pd->gravity_x;
*y = pd->gravity_y;
@@ -2179,7 +2190,7 @@ _elm_code_widget_policy_set(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd, Elm_S
}
EOLIAN static void
-_elm_code_widget_policy_get(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v)
+_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)
{
elm_scroller_policy_get(pd->scroller, policy_h, policy_v);
}
@@ -2192,7 +2203,7 @@ _elm_code_widget_tabstop_set(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd, unsi
}
EOLIAN static unsigned int
-_elm_code_widget_tabstop_get(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd)
+_elm_code_widget_tabstop_get(const Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd)
{
return pd->tabstop;
}
@@ -2205,7 +2216,7 @@ _elm_code_widget_editable_set(Eo *obj, Elm_Code_Widget_Data *pd, Eina_Bool edita
}
EOLIAN static Eina_Bool
-_elm_code_widget_editable_get(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd)
+_elm_code_widget_editable_get(const Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd)
{
return pd->editable;
}
@@ -2217,7 +2228,7 @@ _elm_code_widget_line_numbers_set(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd,
}
EOLIAN static Eina_Bool
-_elm_code_widget_line_numbers_get(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd)
+_elm_code_widget_line_numbers_get(const Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd)
{
return pd->show_line_numbers;
}
@@ -2230,7 +2241,7 @@ _elm_code_widget_line_width_marker_set(Eo *obj, Elm_Code_Widget_Data *pd, unsign
}
EOLIAN static unsigned int
-_elm_code_widget_line_width_marker_get(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd)
+_elm_code_widget_line_width_marker_get(const Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd)
{
return pd->line_width_marker;
}
@@ -2243,7 +2254,7 @@ _elm_code_widget_show_whitespace_set(Eo *obj, Elm_Code_Widget_Data *pd, Eina_Boo
}
EOLIAN static Eina_Bool
-_elm_code_widget_show_whitespace_get(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd)
+_elm_code_widget_show_whitespace_get(const Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd)
{
return pd->show_whitespace;
}
@@ -2266,9 +2277,9 @@ _elm_code_widget_syntax_enabled_set(Eo *obj, Elm_Code_Widget_Data *pd EINA_UNUSE
}
EOLIAN static Eina_Bool
-_elm_code_widget_syntax_enabled_get(Eo *obj, Elm_Code_Widget_Data *pd EINA_UNUSED)
+_elm_code_widget_syntax_enabled_get(const Eo *obj, Elm_Code_Widget_Data *pd EINA_UNUSED)
{
- Elm_Code_Widget *widget = obj;
+ const Elm_Code_Widget *widget = obj;
Elm_Code *code;
code = elm_code_widget_code_get(widget);
@@ -2280,10 +2291,12 @@ _elm_code_widget_tab_inserts_spaces_set(Eo *obj EINA_UNUSED, Elm_Code_Widget_Dat
Eina_Bool spaces)
{
pd->tab_inserts_spaces = spaces;
+ if (!spaces)
+ elm_code_widget_code_get(obj)->config.indent_style_efl = EINA_FALSE;
}
EOLIAN static Eina_Bool
-_elm_code_widget_tab_inserts_spaces_get(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd)
+_elm_code_widget_tab_inserts_spaces_get(const Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd)
{
return pd->tab_inserts_spaces;
}
@@ -2295,19 +2308,19 @@ _elm_code_widget_cursor_position_set(Eo *obj, Elm_Code_Widget_Data *pd, unsigned
}
EOLIAN static void
-_elm_code_widget_cursor_position_get(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd, unsigned int *row, unsigned int *col)
+_elm_code_widget_cursor_position_get(const Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd, unsigned int *row, unsigned int *col)
{
*row = pd->cursor_line;
*col = pd->cursor_col;
}
-EOLIAN static Efl_Ui_Theme_Apply
-_elm_code_widget_elm_widget_theme_apply(Eo *obj, Elm_Code_Widget_Data *pd)
+EOLIAN static void
+_elm_code_widget_theme_refresh(Eo *obj, Elm_Code_Widget_Data *pd)
{
Eo *edje;
int r, g, b, a;
- double fade;
unsigned int i;
+ double fade;
Evas_Object *grid;
edje = elm_layout_edje_get(obj);
@@ -2315,17 +2328,28 @@ _elm_code_widget_elm_widget_theme_apply(Eo *obj, Elm_Code_Widget_Data *pd)
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
fade = (double) pd->alpha / 255;
+ evas_object_color_set(pd->background, r * fade, g * fade, b * fade, a * fade);
+
for (i = 0; i < eina_list_count(pd->grids); i++)
{
grid = eina_list_nth(pd->grids, i);
_elm_code_widget_setup_palette(grid, obj, fade);
}
+}
+
+EOLIAN static Efl_Ui_Theme_Apply
+_elm_code_widget_efl_ui_widget_theme_apply(Eo *obj, Elm_Code_Widget_Data *pd)
+{
+ if (!efl_ui_widget_theme_apply(efl_cast(obj, EFL_UI_WIDGET_CLASS)))
+ return EFL_UI_THEME_APPLY_FAILED;
+
+ _elm_code_widget_theme_refresh(obj, pd);
return EFL_UI_THEME_APPLY_SUCCESS;
}
EOLIAN static int
-_elm_code_widget_alpha_get(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd)
+_elm_code_widget_alpha_get(const Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd)
{
return pd->alpha;
}
@@ -2335,22 +2359,21 @@ _elm_code_widget_alpha_set(Eo *obj, Elm_Code_Widget_Data *pd, int alpha)
{
pd->alpha = alpha;
- _elm_code_widget_elm_widget_theme_apply(obj, pd);
+ _elm_code_widget_efl_ui_widget_theme_apply(obj, pd);
}
EOLIAN static void
_elm_code_widget_efl_canvas_group_group_add(Eo *obj, Elm_Code_Widget_Data *pd)
{
- Evas_Object *gridrows, *scroller;
+ Evas_Object *gridrows, *scroller, *background;
const char *fontname, *fontsize;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+ efl_canvas_group_add(efl_super(obj, ELM_CODE_WIDGET_CLASS));
if (!elm_widget_theme_klass_get(obj))
elm_widget_theme_klass_set(obj, "code");
elm_widget_theme_element_set(obj, "layout");
- _elm_code_widget_elm_widget_theme_apply(obj, pd);
- efl_canvas_group_add(efl_super(obj, ELM_CODE_WIDGET_CLASS));
elm_object_focus_allow_set(obj, EINA_TRUE);
pd->alpha = 255;
@@ -2370,6 +2393,13 @@ _elm_code_widget_efl_canvas_group_group_add(Eo *obj, Elm_Code_Widget_Data *pd)
evas_object_event_callback_add(scroller, EVAS_CALLBACK_MOUSE_DOWN,
_elm_code_widget_scroller_clicked_cb, obj);
+ background = elm_bg_add(scroller);
+ evas_object_size_hint_weight_set(background, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(background, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(background);
+ elm_object_part_content_set(scroller, "elm.swallow.background", background);
+ pd->background = background;
+
fontname = edje_object_data_get(elm_layout_edje_get(obj), "font.name");
fontsize = edje_object_data_get(elm_layout_edje_get(obj), "font.size");
if (fontname && fontsize)
@@ -2381,6 +2411,8 @@ _elm_code_widget_efl_canvas_group_group_add(Eo *obj, Elm_Code_Widget_Data *pd)
elm_object_content_set(scroller, gridrows);
pd->gridbox = gridrows;
+ _elm_code_widget_efl_ui_widget_theme_apply(obj, pd);
+
evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _elm_code_widget_resize_cb, obj);
evas_object_event_callback_add(obj, EVAS_CALLBACK_KEY_DOWN, _elm_code_widget_key_down_cb, obj);
evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _elm_code_widget_hidden_cb, obj);
@@ -2403,6 +2435,4 @@ _elm_code_widget_efl_canvas_group_group_add(Eo *obj, Elm_Code_Widget_Data *pd)
#include "elm_code_widget_text.c"
#include "elm_code_widget_undo.c"
-#ifndef ELM_CODE_TEST
#include "elm_code_widget.eo.c"
-#endif // ELM_CODE_TEST
diff --git a/src/lib/elementary/elm_code_widget.eo b/src/lib/elementary/elm_code_widget.eo
index 9dbdc48b07..61431168a4 100644
--- a/src/lib/elementary/elm_code_widget.eo
+++ b/src/lib/elementary/elm_code_widget.eo
@@ -1,12 +1,10 @@
-import edje_types;
import elm_interface_scrollable;
-import elm_general;
/* FIXME: Those types make elm_code unusable from pure EO */
-struct @extern Elm_Code; [[Elementary code main data structure]] /* The main interface currently defined in code */
-struct @extern Elm_Code_Line; [[Elementary code line data structure]] /* Parts of the interface currently defined in code */
+struct @extern Elm.Code; [[Elementary code main data structure]] /* The main interface currently defined in code */
+struct @extern Elm.Code_Line; [[Elementary code line data structure]] /* Parts of the interface currently defined in code */
-class Elm.Code_Widget (Efl.Ui.Layout, Efl.Access.Text)
+class Elm.Code_Widget (Efl.Ui.Layout.Object, Efl.Access.Text)
{
[[Elementary code widget]]
eo_prefix: elm_obj_code_widget;
@@ -22,7 +20,7 @@ class Elm.Code_Widget (Efl.Ui.Layout, Efl.Access.Text)
[[Get the underlying code object we are rendering]]
}
values {
- code: ptr(Elm_Code); [[Our underlying Elm_Code object]]
+ code: ptr(Elm.Code); [[Our underlying Elm.Code object]]
}
}
@property font {
@@ -95,15 +93,15 @@ class Elm.Code_Widget (Efl.Ui.Layout, Efl.Access.Text)
[[Set whether this widget allows editing
If editable then the widget will allow user input to manipulate
- the underlying Elm_Code_File of this Elm_Code instance.
- Any other Elm_Code_Widget's connected to this Elm_Code will
+ the underlying Elm.Code_File of this Elm.Code instance.
+ Any other Elm.Code_Widget's connected to this Elm.Code will
update to reflect the changes.]]
}
get {
[[Get the current editable state of this widget
returns EINA_TRUE if the widget is editable, EINA_FALSE otherwise.
- If this widget is not editable the underlying Elm_Code_File could
+ If this widget is not editable the underlying Elm.Code_File could
still be manipulated by a different widget or the filesystem.]]
}
values {
@@ -193,21 +191,24 @@ class Elm.Code_Widget (Efl.Ui.Layout, Efl.Access.Text)
col: uint; [[The horizontal position of the cursor, starting from column 1]]
}
}
+ theme_refresh {
+ [[Update and refresh theme for widget.]]
+ }
line_refresh {
- [[Refresh code line in widget]]
+ [[Refresh code line in widget]]
params {
- line: ptr(Elm_Code_Line); [[The line to refresh.]]
+ line: ptr(Elm.Code_Line); [[The line to refresh.]]
}
}
line_visible_get {
[[Check if the code line is currently visible]]
params {
- line: ptr(Elm_Code_Line); [[The line to test for visibility.]]
+ line: ptr(Elm.Code_Line); [[The line to test for visibility.]]
}
return: bool; [[$true if the line specified is currently visible within the scroll region.]]
}
lines_visible_get {
- [[Get the number of code lines currently visible in the widget]]
+ [[Get the number of code lines currently visible in the widget]]
return: uint; [[the number of lines currently visible in the widget.]]
}
position_at_coordinates_get {
@@ -234,11 +235,11 @@ class Elm.Code_Widget (Efl.Ui.Layout, Efl.Access.Text)
}
text_left_gutter_width_get {
- [[Get the column width of the gutter]]
+ [[Get the column width of the gutter]]
return: int; [[The current column width of the gutter for the widget.]]
}
text_between_positions_get {
- [[Get text between given positions]]
+ [[Get text between given positions]]
params {
start_line: uint; [[The line of the first character to get]]
start_col: uint; [[The widget column of the first character to get]]
@@ -256,30 +257,30 @@ class Elm.Code_Widget (Efl.Ui.Layout, Efl.Access.Text)
}
line_text_column_width_to_position {
- [[Get text column width at given position]]
+ [[Get text column width at given position]]
params {
- line: ptr(Elm_Code_Line); [[Code line]]
+ line: ptr(Elm.Code_Line); [[Code line]]
position: uint; [[Code position]]
}
return: uint; [[Text column width]]
}
line_text_column_width_get {
- [[Get text column width for code line]]
+ [[Get text column width for code line]]
params {
- line: ptr(Elm_Code_Line); [[Code line]]
+ line: ptr(Elm.Code_Line); [[Code line]]
}
return: uint; [[Text column width]]
}
line_text_position_for_column_get {
- [[Get position from column]]
+ [[Get position from column]]
params {
- line: ptr(Elm_Code_Line); [[Code line]]
+ line: ptr(Elm.Code_Line); [[Code line]]
column: uint; [[Column]]
}
return: uint; [[Position]]
}
text_tabwidth_at_column_get {
- [[Get tabwidth for column]]
+ [[Get tabwidth for column]]
params {
column: uint; [[Column]]
}
@@ -288,7 +289,7 @@ class Elm.Code_Widget (Efl.Ui.Layout, Efl.Access.Text)
line_status_toggle {
[[Toggle the display of the line status widget]]
params {
- line: ptr(Elm_Code_Line); [[Code line]]
+ line: ptr(Elm.Code_Line); [[Code line]]
}
}
@@ -311,22 +312,23 @@ class Elm.Code_Widget (Efl.Ui.Layout, Efl.Access.Text)
class.constructor;
Efl.Object.constructor;
Efl.Object.finalize;
- Elm.Widget.widget_event;
- Elm.Widget.theme_apply;
+ Efl.Ui.Widget.widget_event;
+ Efl.Ui.Widget.theme_apply;
}
constructors {
.code;
}
events {
- line,clicked; [[Called when text line was clicked]]
- line,gutter,clicked; [[Called when gutter was clicked]]
- cursor,changed; [[Called when cursor changed]]
- changed,user; [[Called when object changed due to user interaction]]
- selection,start; [[Called when a selection is started]]
- selection,changed; [[Called when selection changed]]
- selection,cleared; [[Called when selection was cleared]]
- selection,cut; [[Called when a cut action is performed]]
- selection,copy; [[Called when a copy action is performed]]
- selection,paste; [[Called when a paste action is performed]]
+ line,clicked: Elm.Code_Line; [[Called when text line was clicked]]
+ line,gutter,clicked: Elm.Code_Line; [[Called when gutter was clicked]]
+ changed,user: void; [[Called when object changed due to user interaction]]
+ /* FIXME: All events below send the obj in the event_info, which is redundant */
+ cursor,changed: Elm.Code_Widget; [[Called when cursor changed]]
+ selection,start: Elm.Code_Widget; [[Called when a selection is started]]
+ selection,changed: Elm.Code_Widget; [[Called when selection changed]]
+ selection,cleared: Elm.Code_Widget; [[Called when selection was cleared]]
+ selection,cut: Elm.Code_Widget; [[Called when a cut action is performed]]
+ selection,copy: Elm.Code_Widget; [[Called when a copy action is performed]]
+ selection,paste: Elm.Code_Widget; [[Called when a paste action is performed]]
}
}
diff --git a/src/lib/elementary/elm_code_widget_legacy.eo b/src/lib/elementary/elm_code_widget_legacy.eo
new file mode 100644
index 0000000000..1c228b3e76
--- /dev/null
+++ b/src/lib/elementary/elm_code_widget_legacy.eo
@@ -0,0 +1,5 @@
+class Elm.Code_Widget_Legacy (Elm.Code_Widget, Efl.Ui.Legacy)
+{
+ [[Elementary code widget]]
+ data: null;
+}
diff --git a/src/lib/elementary/elm_code_widget_private.h b/src/lib/elementary/elm_code_widget_private.h
index 17b3810cdf..21d652d97d 100644
--- a/src/lib/elementary/elm_code_widget_private.h
+++ b/src/lib/elementary/elm_code_widget_private.h
@@ -15,7 +15,7 @@ typedef struct
Elm_Code *code;
Eina_List *grids;
unsigned int col_count;
- Evas_Object *scroller, *gridbox;
+ Evas_Object *scroller, *gridbox, *background;
const char *font_name;
Evas_Font_Size font_size;
diff --git a/src/lib/elementary/elm_code_widget_selection.c b/src/lib/elementary/elm_code_widget_selection.c
index fd2c161785..7111c42996 100644
--- a/src/lib/elementary/elm_code_widget_selection.c
+++ b/src/lib/elementary/elm_code_widget_selection.c
@@ -38,8 +38,6 @@ _elm_code_widget_selection_limit(Evas_Object *widget EINA_UNUSED, Elm_Code_Widge
*col = width + 1;
}
-#ifndef ELM_CODE_TEST
-
EAPI void
elm_code_widget_selection_start(Evas_Object *widget,
unsigned int line, unsigned int col)
@@ -90,8 +88,6 @@ elm_code_widget_selection_end(Evas_Object *widget,
efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_SELECTION_CHANGED, widget);
}
-#endif // ELM_CODE_TEST
-
EAPI void
elm_code_widget_selection_select_all(Evas_Object *widget)
{
@@ -112,7 +108,6 @@ elm_code_widget_selection_select_all(Evas_Object *widget)
efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_SELECTION_CHANGED, widget);
}
-
EAPI Elm_Code_Widget_Selection_Data *
elm_code_widget_selection_normalized_get(Evas_Object *widget)
{
@@ -154,8 +149,6 @@ elm_code_widget_selection_normalized_get(Evas_Object *widget)
return selection;
}
-#ifndef ELM_CODE_TEST
-
EAPI void
elm_code_widget_selection_clear(Evas_Object *widget)
{
@@ -171,8 +164,6 @@ elm_code_widget_selection_clear(Evas_Object *widget)
efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_SELECTION_CLEARED, widget);
}
-#endif // ELM_CODE_TEST
-
static void
_elm_code_widget_selection_delete_single(Elm_Code_Widget *widget, Elm_Code_Widget_Data *pd)
{
@@ -280,29 +271,24 @@ _elm_code_widget_selection_delete_do(Evas_Object *widget, Eina_Bool undo)
efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_SELECTION_CLEARED, widget);
}
-#ifndef ELM_CODE_TEST
-
EAPI void
elm_code_widget_selection_delete(Evas_Object *widget)
{
_elm_code_widget_selection_delete_do(widget, EINA_TRUE);
}
-#endif // ELM_CODE_TEST
-
void
_elm_code_widget_selection_delete_no_undo(Evas_Object *widget)
{
_elm_code_widget_selection_delete_do(widget, EINA_FALSE);
}
-#ifndef ELM_CODE_TEST
-
EAPI void
elm_code_widget_selection_select_line(Evas_Object *widget, unsigned int line)
{
Elm_Code_Widget_Data *pd;
Elm_Code_Line *lineobj;
+ unsigned int col;
pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
lineobj = elm_code_file_line_get(pd->code->file, line);
@@ -311,11 +297,10 @@ elm_code_widget_selection_select_line(Evas_Object *widget, unsigned int line)
return;
elm_code_widget_selection_start(widget, line, 1);
- elm_code_widget_selection_end(widget, line, lineobj->length);
+ col = elm_code_widget_line_text_column_width_to_position(widget, lineobj, lineobj->length);
+ elm_code_widget_selection_end(widget, line, col);
}
-#endif // ELM_CODE_TEST
-
static Eina_Bool
_elm_code_widget_selection_char_breaks(char chr)
{
@@ -332,8 +317,6 @@ _elm_code_widget_selection_char_breaks(char chr)
return EINA_FALSE;
}
-#ifndef ELM_CODE_TEST
-
EAPI void
elm_code_widget_selection_select_word(Evas_Object *widget, unsigned int line, unsigned int col)
{
@@ -392,8 +375,6 @@ elm_code_widget_selection_text_get(Evas_Object *widget)
return text;
}
-#endif // ELM_CODE_TEST
-
static void
_selection_loss_cb(void *data EINA_UNUSED, Elm_Sel_Type selection EINA_UNUSED)
{
diff --git a/src/lib/elementary/elm_code_widget_text.c b/src/lib/elementary/elm_code_widget_text.c
index 3b99305815..ce1db18ccb 100644
--- a/src/lib/elementary/elm_code_widget_text.c
+++ b/src/lib/elementary/elm_code_widget_text.c
@@ -284,8 +284,8 @@ _elm_code_widget_text_at_cursor_insert_do(Elm_Code_Widget *widget, const char *t
if (indent > 0)
elm_code_line_text_insert(line, 0, indent_text, indent);
- elm_obj_code_widget_cursor_position_set(widget, row, indent + 1);
- elm_obj_code_widget_cursor_position_get(widget, &row, &col);
+ col = elm_code_widget_line_text_column_width_to_position(widget, line, indent + 1);
+ elm_obj_code_widget_cursor_position_set(widget, row, col);
}
}
diff --git a/src/lib/elementary/elm_color_item.eo b/src/lib/elementary/elm_color_item.eo
index a979f76534..ba473f207f 100644
--- a/src/lib/elementary/elm_color_item.eo
+++ b/src/lib/elementary/elm_color_item.eo
@@ -41,11 +41,11 @@ class Elm.Color.Item(Elm.Widget.Item, Efl.Ui.Focus.Object, Efl.Access.Widget.Act
Efl.Object.destructor;
Elm.Widget.Item.access_register;
Elm.Widget.Item.signal_emit;
- Elm.Widget.Item.focus { get; set; }
+ Elm.Widget.Item.item_focus { get; set; }
Efl.Ui.Focus.Object.focus { set; }
Efl.Ui.Focus.Object.focus_geometry { get; }
- Efl.Access.state_set { get; }
- Efl.Access.name { get; }
+ Efl.Access.Object.state_set { get; }
+ Efl.Access.Object.i18n_name { get; }
Efl.Access.Widget.Action.elm_actions { get; }
}
}
diff --git a/src/lib/elementary/elm_colorselector.c b/src/lib/elementary/elm_colorselector.c
index 2c2856be95..72d1a040b1 100644
--- a/src/lib/elementary/elm_colorselector.c
+++ b/src/lib/elementary/elm_colorselector.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_COMPONENT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define EFL_UI_FOCUS_COMPOSITION_PROTECTED
@@ -1318,7 +1318,7 @@ _color_bars_add(Evas_Object *obj)
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_colorselector_elm_widget_theme_apply(Eo *obj, Elm_Colorselector_Data *sd)
+_elm_colorselector_efl_ui_widget_theme_apply(Eo *obj, Elm_Colorselector_Data *sd)
{
int i;
Eina_List *elist;
@@ -1347,7 +1347,7 @@ _elm_colorselector_elm_widget_theme_apply(Eo *obj, Elm_Colorselector_Data *sd)
(wd->resize_obj, "vertical_pad");
if (vpadstr) v_pad = atoi(vpadstr);
- scale = efl_gfx_scale_get(obj) * elm_config_scale_get() / edje_object_base_scale_get(wd->resize_obj);
+ scale = efl_gfx_entity_scale_get(obj) * elm_config_scale_get() / edje_object_base_scale_get(wd->resize_obj);
efl_pack_padding_set(sd->palette_box, h_pad * scale, v_pad * scale, 0);
EINA_LIST_FOREACH(sd->items, elist, eo_item)
@@ -1419,8 +1419,8 @@ _sub_obj_size_hints_set(Evas_Object *sobj,
Evas_Coord minw = -1, minh = -1;
elm_coords_finger_size_adjust(timesw, &minw, timesh, &minh);
- if (sobj && efl_isa(sobj, EFL_CANVAS_LAYOUT_CLASS))
- edje_object_size_min_restricted_calc(sobj, &minw, &minh, minw, minh);
+ if (!efl_isa(sobj, EFL_CANVAS_LAYOUT_CLASS)) return;
+ edje_object_size_min_restricted_calc(sobj, &minw, &minh, minw, minh);
evas_object_size_hint_min_set(sobj, minw, minh);
evas_object_size_hint_max_set(sobj, -1, -1);
}
@@ -1503,6 +1503,7 @@ _elm_colorselector_elm_layout_sizing_eval(Eo *obj, Elm_Colorselector_Data *sd)
Evas_Coord minw = -1, minh = -1;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+ if (!efl_finalized_get(obj)) return; //not constructed yet
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
@@ -1771,7 +1772,7 @@ _elm_color_item_efl_object_constructor(Eo *eo_item, Elm_Color_Item_Data *item)
Evas_Object *obj;
obj = efl_parent_get(eo_item);
- VIEW(item) = elm_layout_add(obj);
+ VIEW_SET(item, elm_layout_add(obj));
if (!elm_layout_theme_set
(VIEW(item), "colorselector", "item", elm_widget_style_get(obj)))
CRI("Failed to set layout!");
@@ -1795,7 +1796,8 @@ _elm_color_item_efl_object_constructor(Eo *eo_item, Elm_Color_Item_Data *item)
(item->color_obj, EVAS_CALLBACK_MOUSE_MOVE, _on_color_moved, item);
evas_object_event_callback_add
(item->color_obj, EVAS_CALLBACK_MOUSE_UP, _on_color_released, item);
- elm_object_part_content_set(VIEW(item), "color_obj", item->color_obj);
+ if (!elm_layout_content_set(VIEW(item), "elm.swallow.color_obj", item->color_obj))
+ elm_layout_content_set(VIEW(item), "color_obj", item->color_obj);
_item_sizing_eval(item);
evas_object_show(VIEW(item));
@@ -1804,7 +1806,7 @@ _elm_color_item_efl_object_constructor(Eo *eo_item, Elm_Color_Item_Data *item)
if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
elm_wdg_item_access_register(eo_item);
- efl_access_role_set(eo_item, EFL_ACCESS_ROLE_RADIO_BUTTON);
+ efl_access_object_role_set(eo_item, EFL_ACCESS_ROLE_RADIO_BUTTON);
return eo_item;
}
@@ -1888,7 +1890,7 @@ _palette_box_prepare(Eo *o)
efl_ui_direction_set(o, EFL_UI_DIR_HORIZONTAL);
efl_gfx_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
efl_gfx_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
- efl_gfx_visible_set(o, EINA_FALSE);
+ efl_gfx_entity_visible_set(o, EINA_FALSE);
}
static void
@@ -1905,21 +1907,20 @@ _create_colorpalette(Evas_Object *obj)
if (sd->palette_box) return;
if (elm_widget_is_legacy(obj))
{
- sd->palette_box = elm_legacy_add(EFL_UI_BOX_FLOW_CLASS, obj,
- _palette_box_prepare(efl_added));
+ sd->palette_box = elm_legacy_add(EFL_UI_BOX_FLOW_CLASS, obj);
}
else
{
- sd->palette_box = efl_add(EFL_UI_BOX_FLOW_CLASS, obj,
- _palette_box_prepare(efl_added));
+ sd->palette_box = efl_add(EFL_UI_BOX_FLOW_CLASS, obj);
}
+ _palette_box_prepare(sd->palette_box);
hpadstr = edje_object_data_get(wd->resize_obj, "horizontal_pad");
if (hpadstr) h_pad = atoi(hpadstr);
vpadstr = edje_object_data_get(wd->resize_obj, "vertical_pad");
if (vpadstr) v_pad = atoi(vpadstr);
- scale = efl_gfx_scale_get(obj) * elm_config_scale_get() / edje_object_base_scale_get(wd->resize_obj);
+ scale = efl_gfx_entity_scale_get(obj) * elm_config_scale_get() / edje_object_base_scale_get(wd->resize_obj);
efl_pack_padding_set(sd->palette_box, h_pad * scale, v_pad * scale, 0);
efl_pack_align_set(sd->palette_box, 0.0, 0.0);
if (!elm_layout_content_set(obj, "elm.palette", sd->palette_box))
@@ -2005,7 +2006,11 @@ _elm_colorselector_efl_canvas_group_group_del(Eo *obj, Elm_Colorselector_Data *s
ecore_event_handler_del(sd->grab.key_up);
#endif
- _items_del(sd);
+ // We created the items with efl_add, they will be dead after this.
+ sd->items = eina_list_free(sd->items);
+ sd->selected = NULL;
+ sd->focus_items = NULL;
+
/* This cb_data are used during the destruction process of base.del */
for (i = 0; i < 4; i++)
tmp[i] = sd->cb_data[i];
@@ -2243,21 +2248,21 @@ _access_obj_process(Evas_Object *obj, Eina_Bool is_access)
}
EOLIAN static Eina_Rect
-_elm_colorselector_elm_widget_focus_highlight_geometry_get(Eo *obj EINA_UNUSED, Elm_Colorselector_Data *sd)
+_elm_colorselector_efl_ui_widget_focus_highlight_geometry_get(const Eo *obj EINA_UNUSED, Elm_Colorselector_Data *sd)
{
if (sd->focused_item && (sd->focused == ELM_COLORSELECTOR_PALETTE))
{
ELM_COLOR_ITEM_DATA_GET(sd->focused_item, focus_it);
- return efl_gfx_geometry_get(VIEW(focus_it));
+ return efl_gfx_entity_geometry_get(VIEW(focus_it));
}
else if(sd->focused == ELM_COLORSELECTOR_COMPONENTS)
- return efl_gfx_geometry_get(sd->cb_data[sd->sel_color_type]->colorbar);
+ return efl_gfx_entity_geometry_get(sd->cb_data[sd->sel_color_type]->colorbar);
- return efl_gfx_geometry_get(obj);
+ return efl_gfx_entity_geometry_get(obj);
}
EOLIAN static void
-_elm_colorselector_elm_widget_on_access_update(Eo *obj, Elm_Colorselector_Data *_pd EINA_UNUSED, Eina_Bool acs)
+_elm_colorselector_efl_ui_widget_on_access_update(Eo *obj, Elm_Colorselector_Data *_pd EINA_UNUSED, Eina_Bool acs)
{
_elm_colorselector_smart_focus_next_enable = acs;
_access_obj_process(obj, _elm_colorselector_smart_focus_next_enable);
@@ -2276,19 +2281,19 @@ _elm_colorselector_efl_object_constructor(Eo *obj, Elm_Colorselector_Data *_pd E
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_COLOR_CHOOSER);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_COLOR_CHOOSER);
return obj;
}
EOLIAN static void
-_elm_colorselector_color_set(Eo *obj, Elm_Colorselector_Data *_pd EINA_UNUSED, int r, int g, int b, int a)
+_elm_colorselector_picked_color_set(Eo *obj, Elm_Colorselector_Data *_pd EINA_UNUSED, int r, int g, int b, int a)
{
_colors_set(obj, r, g, b, a, EINA_FALSE);
}
EOLIAN static void
-_elm_colorselector_color_get(Eo *obj EINA_UNUSED, Elm_Colorselector_Data *sd, int *r, int *g, int *b, int *a)
+_elm_colorselector_picked_color_get(const Eo *obj EINA_UNUSED, Elm_Colorselector_Data *sd, int *r, int *g, int *b, int *a)
{
if (r) *r = sd->r;
if (g) *g = sd->g;
@@ -2377,7 +2382,7 @@ _elm_colorselector_mode_set(Eo *obj, Elm_Colorselector_Data *sd, Elm_Colorselect
}
EOLIAN static Elm_Colorselector_Mode
-_elm_colorselector_mode_get(Eo *obj EINA_UNUSED, Elm_Colorselector_Data *sd)
+_elm_colorselector_mode_get(const Eo *obj EINA_UNUSED, Elm_Colorselector_Data *sd)
{
return sd->mode;
}
@@ -2393,7 +2398,7 @@ elm_colorselector_palette_item_color_get(const Elm_Object_Item *it,
}
EOLIAN static void
-_elm_color_item_color_get(Eo *eo_item EINA_UNUSED,
+_elm_color_item_color_get(const Eo *eo_item EINA_UNUSED,
Elm_Color_Item_Data *item,
int *r,
int *g,
@@ -2482,7 +2487,7 @@ _elm_colorselector_palette_clear(Eo *obj, Elm_Colorselector_Data *sd)
}
EOLIAN static const Eina_List*
-_elm_colorselector_palette_items_get(Eo *obj EINA_UNUSED, Elm_Colorselector_Data *sd)
+_elm_colorselector_palette_items_get(const Eo *obj EINA_UNUSED, Elm_Colorselector_Data *sd)
{
return sd->items;
}
@@ -2543,7 +2548,7 @@ elm_colorselector_palette_item_selected_get(const Elm_Object_Item *it)
}
EOLIAN static Eina_Bool
-_elm_color_item_selected_get(Eo *eo_item EINA_UNUSED, Elm_Color_Item_Data *item)
+_elm_color_item_selected_get(const Eo *eo_item EINA_UNUSED, Elm_Color_Item_Data *item)
{
Eo *eo_temp_item;
@@ -2555,7 +2560,7 @@ _elm_color_item_selected_get(Eo *eo_item EINA_UNUSED, Elm_Color_Item_Data *item)
}
EOLIAN static Elm_Object_Item*
-_elm_colorselector_palette_selected_item_get(Eo *obj EINA_UNUSED, Elm_Colorselector_Data *sd)
+_elm_colorselector_palette_selected_item_get(const Eo *obj EINA_UNUSED, Elm_Colorselector_Data *sd)
{
return eina_list_data_get(sd->selected);
}
@@ -2573,7 +2578,7 @@ _elm_colorselector_palette_name_set(Eo *obj, Elm_Colorselector_Data *sd, const c
}
EOLIAN static const char*
-_elm_colorselector_palette_name_get(Eo *obj EINA_UNUSED, Elm_Colorselector_Data *sd)
+_elm_colorselector_palette_name_get(const Eo *obj EINA_UNUSED, Elm_Colorselector_Data *sd)
{
return sd->palette_name;
}
@@ -2588,7 +2593,7 @@ _elm_colorselector_class_constructor(Efl_Class *klass)
}
EOLIAN static const Efl_Access_Action_Data*
-_elm_colorselector_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Colorselector_Data *sd EINA_UNUSED)
+_elm_colorselector_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Elm_Colorselector_Data *sd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "move,left", "move", "left", _key_action_move},
@@ -2601,11 +2606,11 @@ _elm_colorselector_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED,
}
EOLIAN static Eina_List*
-_elm_colorselector_efl_access_children_get(Eo *obj EINA_UNUSED, Elm_Colorselector_Data *sd)
+_elm_colorselector_efl_access_object_access_children_get(const Eo *obj EINA_UNUSED, Elm_Colorselector_Data *sd)
{
Eina_List *ret = NULL;
- ret = efl_access_children_get(efl_super(obj, ELM_COLORSELECTOR_CLASS));
+ ret = efl_access_object_access_children_get(efl_super(obj, ELM_COLORSELECTOR_CLASS));
// filter - out box contiainer
ret = eina_list_remove(ret, sd->palette_box);
// append items as colorselector children
@@ -2615,12 +2620,12 @@ _elm_colorselector_efl_access_children_get(Eo *obj EINA_UNUSED, Elm_Colorselecto
}
EOLIAN static Efl_Access_State_Set
-_elm_color_item_efl_access_state_set_get(Eo *obj, Elm_Color_Item_Data *sd EINA_UNUSED)
+_elm_color_item_efl_access_object_state_set_get(const Eo *obj, Elm_Color_Item_Data *sd EINA_UNUSED)
{
Efl_Access_State_Set ret;
Eina_Bool sel;
- ret = efl_access_state_set_get(efl_super(obj, ELM_COLOR_ITEM_CLASS));
+ ret = efl_access_object_state_set_get(efl_super(obj, ELM_COLOR_ITEM_CLASS));
sel = elm_obj_color_item_selected_get(obj);
@@ -2631,7 +2636,7 @@ _elm_color_item_efl_access_state_set_get(Eo *obj, Elm_Color_Item_Data *sd EINA_U
}
EOLIAN static void
-_elm_color_item_elm_widget_item_focus_set(Eo *eo_it, Elm_Color_Item_Data *it, Eina_Bool focused)
+_elm_color_item_elm_widget_item_item_focus_set(Eo *eo_it, Elm_Color_Item_Data *it, Eina_Bool focused)
{
Evas_Object *obj = WIDGET(it);
ELM_COLORSELECTOR_DATA_GET(obj, sd);
@@ -2657,7 +2662,7 @@ _elm_color_item_elm_widget_item_focus_set(Eo *eo_it, Elm_Color_Item_Data *it, Ei
}
EOLIAN static Eina_Bool
-_elm_color_item_elm_widget_item_focus_get(Eo *eo_it, Elm_Color_Item_Data *it)
+_elm_color_item_elm_widget_item_item_focus_get(const Eo *eo_it, Elm_Color_Item_Data *it)
{
Evas_Object *obj = WIDGET(it);
ELM_COLORSELECTOR_DATA_GET(obj, sd);
@@ -2668,7 +2673,7 @@ _elm_color_item_elm_widget_item_focus_get(Eo *eo_it, Elm_Color_Item_Data *it)
}
EOLIAN static const Efl_Access_Action_Data*
-_elm_color_item_efl_access_widget_action_elm_actions_get(Eo *eo_it EINA_UNUSED, Elm_Color_Item_Data *it EINA_UNUSED)
+_elm_color_item_efl_access_widget_action_elm_actions_get(const Eo *eo_it EINA_UNUSED, Elm_Color_Item_Data *it EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "activate", "activate", NULL, _item_action_activate},
@@ -2678,14 +2683,14 @@ _elm_color_item_efl_access_widget_action_elm_actions_get(Eo *eo_it EINA_UNUSED,
}
EOLIAN static const char*
-_elm_color_item_efl_access_name_get(Eo *eo_it, Elm_Color_Item_Data *it)
+_elm_color_item_efl_access_object_i18n_name_get(const Eo *eo_it, Elm_Color_Item_Data *it)
{
Eina_Strbuf *buf;
const char *color_name = NULL;
const char *name;
char *accessible_name;
- name = efl_access_name_get(efl_super(eo_it, ELM_COLOR_ITEM_CLASS));
+ name = efl_access_object_i18n_name_get(efl_super(eo_it, ELM_COLOR_ITEM_CLASS));
if (name) return name;
buf = eina_strbuf_new();
@@ -2705,9 +2710,9 @@ _elm_color_item_efl_access_name_get(Eo *eo_it, Elm_Color_Item_Data *it)
}
EOLIAN static Eina_Rect
-_elm_color_item_efl_ui_focus_object_focus_geometry_get(Eo *obj EINA_UNUSED, Elm_Color_Item_Data *pd)
+_elm_color_item_efl_ui_focus_object_focus_geometry_get(const Eo *obj EINA_UNUSED, Elm_Color_Item_Data *pd)
{
- return efl_gfx_geometry_get(pd->color_obj);
+ return efl_gfx_entity_geometry_get(pd->color_obj);
}
EOLIAN static void
@@ -2730,4 +2735,3 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_colorselector, Elm_Colorselector_Data)
#include "elm_colorselector.eo.c"
#include "elm_color_item.eo.c"
-
diff --git a/src/lib/elementary/elm_colorselector.eo b/src/lib/elementary/elm_colorselector.eo
index b7b41907f7..3b106dfde1 100644
--- a/src/lib/elementary/elm_colorselector.eo
+++ b/src/lib/elementary/elm_colorselector.eo
@@ -12,21 +12,23 @@ enum Elm.Colorselector.Mode
all [[All possible color selector is displayed.]]
}
-class Elm.Colorselector (Efl.Ui.Layout, Efl.Ui.Focus.Composition,
- Efl.Access.Widget.Action, Efl.Ui.Clickable)
+class Elm.Colorselector (Efl.Ui.Layout.Object, Efl.Ui.Focus.Composition,
+ Efl.Access.Widget.Action, Efl.Ui.Clickable, Efl.Ui.Legacy)
{
[[Elementary colorselector class]]
legacy_prefix: elm_colorselector;
eo_prefix: elm_obj_colorselector;
event_prefix: elm_colorselector;
methods {
- @property color {
+ @property picked_color {
set {
[[Set color to colorselector.]]
+ legacy: elm_colorselector_color_set;
}
get {
[[Get current color from colorselector.]]
+ legacy: elm_colorselector_color_get;
}
values {
r: int; [[Red value of color]]
@@ -108,17 +110,17 @@ class Elm.Colorselector (Efl.Ui.Layout, Efl.Ui.Focus.Composition,
implements {
class.constructor;
Efl.Object.constructor;
- Elm.Widget.theme_apply;
- Elm.Widget.focus_highlight_geometry { get; }
- Elm.Widget.on_access_update;
- Elm.Widget.widget_event;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.focus_highlight_geometry { get; }
+ Efl.Ui.Widget.on_access_update;
+ Efl.Ui.Widget.widget_event;
Efl.Access.Widget.Action.elm_actions { get; }
- Efl.Access.children { get; }
+ Efl.Access.Object.access_children { get; }
}
events {
- color,item,selected; [[Called when color item was selected]]
- color,item,longpressed; [[Called when color item got a long press]]
- changed; [[Called when colorselector changed]]
- changed,user; [[Called when the object changed due to user interaction]]
+ color,item,selected: Efl.Object; [[Called when color item was selected]]
+ color,item,longpressed: Efl.Object; [[Called when color item got a long press]]
+ changed: void; [[Called when colorselector changed]]
+ changed,user: void; [[Called when the object changed due to user interaction]]
}
}
diff --git a/src/lib/elementary/elm_combobox.eo b/src/lib/elementary/elm_combobox.eo
index 4758cca6eb..62d447024d 100644
--- a/src/lib/elementary/elm_combobox.eo
+++ b/src/lib/elementary/elm_combobox.eo
@@ -1,6 +1,6 @@
class Elm.Combobox (Efl.Ui.Button, Efl.Ui.Selectable,
Efl.Access.Widget.Action,
- Elm.Entry, Elm.Genlist, Elm.Hover)
+ Elm.Entry, Elm.Genlist, Elm.Hover, Efl.Ui.Legacy)
{
[[Elementary combobox class]]
legacy_prefix: elm_combobox;
@@ -37,22 +37,24 @@ class Elm.Combobox (Efl.Ui.Button, Efl.Ui.Selectable,
implements {
class.constructor;
Efl.Object.constructor;
- Efl.Gfx.visible { set; }
- Efl.Gfx.size { set; }
- Elm.Widget.theme_apply;
+ Efl.Gfx.Entity.visible { set; }
+ Efl.Gfx.Entity.size { set; }
+ Efl.Ui.Widget.theme_apply;
Efl.Ui.Translatable.translation_update;
- Elm.Widget.widget_event;
+ Efl.Ui.Widget.widget_event;
Efl.Ui.Autorepeat.autorepeat_supported { get; }
Elm.Genlist.filter { set; }
Efl.Access.Widget.Action.elm_actions { get; }
//Efl.Part.part; // TODO?
}
events {
- dismissed; [[Called when combobox was dismissed]]
- expanded; [[Called when combobox was expanded]]
+ dismissed: void; [[Called when combobox was dismissed]]
+ expanded: void; [[Called when combobox was expanded]]
+ /* FIXME: Nobody is emitting this
clicked; [[Called when combobox was clicked]]
- item,selected; [[Called when combobox item was selected]]
- item,pressed; [[Called when combobox item was pressed]]
- filter,done; [[Called when combobox filter was done]]
+ */
+ item,selected: Efl.Object; [[Called when combobox item was selected]]
+ item,pressed: Efl.Object; [[Called when combobox item was pressed]]
+ filter,done: Efl.Object; [[Called when combobox filter was done]]
}
}
diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c
index 8d83a5686a..a2dfa2ef41 100644
--- a/src/lib/elementary/elm_config.c
+++ b/src/lib/elementary/elm_config.c
@@ -86,6 +86,9 @@ static const Elm_Text_Class _elm_text_classes[] = {
{"multibuttonentry_item_text", "Multibuttonentry Items"},
{"multibuttonentry_item_text_pressed", "Multibuttonentry Pressed Items"},
{"multibuttonentry_item_text_disabled", "Multibuttonentry Disabled Items"},
+ {"tags_item_text", "Tags Items"},
+ {"tags_item_text_pressed", "Tags Pressed Items"},
+ {"tags_item_text_disabled", "Tags Disabled Items"},
{"title_bar", "Title Bar"},
{"list_item", "List Items"},
{"grid_item", "Grid Items"},
@@ -112,6 +115,8 @@ static const Elm_Color_Class _elm_color_classes[] = {
{"calendar_day_highlighted", "Highlighted Day Effect"},
{"calendar_day_checked", "Checked Day Effect"},
{"datetime_bg", "Datetime Background"},
+ {"datepicker_bg", "Datepicker Background"},
+ {"timepicker_bg", "Timepicker Background"},
{"datetime_separator_text", "Datetime Separator Text"},
{"datetime_separator_text_disabled", "Datetime Separator Disabled Text"},
{"hoversel_item_active", "Hoversel Item Text"},
@@ -160,10 +165,18 @@ static const Elm_Color_Class _elm_color_classes[] = {
{"multibuttonentry_item_text", "Multibuttonentry Item Text"},
{"multibuttonentry_item_text_pressed", "Multibuttonentry Item Pressed Text"},
{"multibuttonentry_item_text_disabled", "Multibuttonentry Item Disabled Text"},
+ {"tags_bg", "Tags Background"},
+ {"tags_item_bg", "Tags Item Background"},
+ {"tags_item_bg_selected", "Tags Item Selected Background"},
+ {"tags_item_text", "Tags Item Text"},
+ {"tags_item_text_pressed", "Tags Item Pressed Text"},
+ {"tags_item_text_disabled", "Tags Item Disabled Text"},
{"border_title", "Border Title Text"},
{"border_title_active", "Border Title Active Text"},
{"datetime_text", "Datetime Text"},
{"multibuttonentry_label", "Multibuttonentry Text"},
+ {"tags_label", "Tags Text"},
+ {"tags_number", "Tags Number Text"},
{"spinner", "Spinner Text"},
{"spinner_disabled", "Spinner Disabled Text"},
{NULL, NULL}
@@ -461,6 +474,7 @@ _desc_init(void)
ELM_CONFIG_VAL(D, T, glayer_flick_time_limit_ms, T_INT);
ELM_CONFIG_VAL(D, T, glayer_long_tap_start_timeout, T_DOUBLE);
ELM_CONFIG_VAL(D, T, glayer_double_tap_timeout, T_DOUBLE);
+ ELM_CONFIG_VAL(D, T, glayer_tap_finger_size, T_INT);
ELM_CONFIG_VAL(D, T, access_mode, T_UCHAR);
ELM_CONFIG_VAL(D, T, selection_clear_enable, T_UCHAR);
ELM_CONFIG_VAL(D, T, glayer_continues_enable, T_UCHAR);
@@ -508,6 +522,7 @@ _desc_init(void)
ELM_CONFIG_VAL(D, T, entry_select_allow, T_UCHAR);
ELM_CONFIG_VAL(D, T, offline, T_UCHAR);
ELM_CONFIG_VAL(D, T, powersave, T_INT);
+ ELM_CONFIG_VAL(D, T, drag_anim_duration, T_DOUBLE);
#undef T
#undef D
#undef T_INT
@@ -614,7 +629,7 @@ _elm_config_user_dir_snprintf(char *dst,
{
size_t user_dir_len = 0, off = 0;
va_list ap;
- Efl_Vpath_File *file_obj;
+ char *tmp;
static int use_xdg_config = -1;
if (use_xdg_config == -1)
@@ -623,13 +638,12 @@ _elm_config_user_dir_snprintf(char *dst,
else use_xdg_config = 0;
}
if (use_xdg_config)
- file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS,
- "(:config:)/elementary");
+ tmp = eina_vpath_resolve("(:usr.config:)/elementary");
else
- file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS,
- "(:home:)/.elementary");
- eina_strlcpy(dst, efl_vpath_file_result_get(file_obj), size);
- efl_del(file_obj);
+ tmp = eina_vpath_resolve("(:home:)/" ELEMENTARY_BASE_DIR);
+
+ eina_strlcpy(dst, tmp, size);
+ free(tmp);
user_dir_len = strlen(dst);
off = user_dir_len + 1;
@@ -1430,7 +1444,7 @@ _profile_fetch_from_conf(void)
}
}
- for (i = 0; i < 2; i++)
+ for (i = 0; i < 2 && !_use_build_config; i++)
{
// user profile
if (i == 0)
@@ -1642,6 +1656,12 @@ _config_system_load(void)
_elm_profile);
ef = eet_open(buf, EET_FILE_MODE_READ);
+ if (!ef)
+ {
+ _elm_data_dir_snprintf(buf, sizeof(buf), "config/default/base.cfg");
+
+ ef = eet_open(buf, EET_FILE_MODE_READ);
+ }
if (ef)
{
cfg = eet_data_read(ef, _config_edd, "config");
@@ -1659,25 +1679,39 @@ _efl_config_obj_del(Eo *obj EINA_UNUSED)
static void
_config_load(void)
{
- _efl_config_obj = efl_add(EFL_CONFIG_GLOBAL_CLASS, NULL);
+ if (_efl_config_obj)
+ {
+ efl_del_intercept_set(_efl_config_obj, NULL);
+ efl_loop_unregister(efl_main_loop_get(), EFL_CONFIG_INTERFACE, _efl_config_obj);
+ efl_loop_unregister(efl_main_loop_get(), EFL_CONFIG_GLOBAL_CLASS, _efl_config_obj);
+ ELM_SAFE_FREE(_efl_config_obj, efl_del);
+ ELM_SAFE_FREE(_elm_config, _config_free);
+ _elm_font_overlays_del_free();
+
+ ELM_SAFE_FREE(_elm_key_bindings, eina_hash_free);
+ }
+ _efl_config_obj = efl_add(EFL_CONFIG_GLOBAL_CLASS, efl_main_loop_get());
efl_loop_register(efl_main_loop_get(), EFL_CONFIG_INTERFACE, _efl_config_obj);
efl_loop_register(efl_main_loop_get(), EFL_CONFIG_GLOBAL_CLASS, _efl_config_obj);
efl_del_intercept_set(_efl_config_obj, _efl_config_obj_del);
- _elm_config = _config_user_load();
- if (_elm_config)
+ if (!_use_build_config)
{
- if ((_elm_config->config_version >> ELM_CONFIG_VERSION_EPOCH_OFFSET) < ELM_CONFIG_EPOCH)
- {
- WRN("User's elementary config seems outdated and unusable. Fallback to load system config.");
- _config_free(_elm_config);
- _elm_config = NULL;
- }
- else
+ _elm_config = _config_user_load();
+ if (_elm_config)
{
- if (_elm_config->config_version < ELM_CONFIG_VERSION)
- _config_update();
- _env_get();
- return;
+ if ((_elm_config->config_version >> ELM_CONFIG_VERSION_EPOCH_OFFSET) < ELM_CONFIG_EPOCH)
+ {
+ WRN("User's elementary config seems outdated and unusable. Fallback to load system config.");
+ _config_free(_elm_config);
+ _elm_config = NULL;
+ }
+ else
+ {
+ if (_elm_config->config_version < ELM_CONFIG_VERSION)
+ _config_update();
+ _env_get();
+ return;
+ }
}
}
@@ -1777,6 +1811,7 @@ _config_load(void)
_elm_config->glayer_long_tap_start_timeout = 1.2; /* 1.2 second to start long-tap */
_elm_config->glayer_double_tap_timeout = 0.25; /* 0.25 seconds between 2 mouse downs of a tap. */
_elm_config->glayer_continues_enable = EINA_TRUE; /* Continue gestures default */
+ _elm_config->glayer_tap_finger_size = 10;
_elm_config->access_mode = ELM_ACCESS_MODE_OFF;
_elm_config->selection_clear_enable = EINA_FALSE;
_elm_config->week_start = 1; /* monday */
@@ -1821,6 +1856,7 @@ _config_load(void)
_elm_config->icon_theme = eina_stringshare_add(ELM_CONFIG_ICON_THEME_ELEMENTARY);
_elm_config->popup_scrollable = EINA_FALSE;
_elm_config->entry_select_allow = EINA_TRUE;
+ _elm_config->drag_anim_duration = 0.0;
_env_get();
}
@@ -1935,6 +1971,7 @@ _elm_config_reload_do(void)
KEEP_VAL(glayer_flick_time_limit_ms);
KEEP_VAL(glayer_long_tap_start_timeout);
KEEP_VAL(glayer_double_tap_timeout);
+ KEEP_VAL(glayer_tap_finger_size);
KEEP_VAL(access_mode);
KEEP_VAL(glayer_continues_enable);
KEEP_VAL(week_start);
@@ -2021,6 +2058,7 @@ _elm_config_reload_do(void)
KEEP_VAL(gl_msaa);
KEEP_STR(icon_theme);
KEEP_VAL(entry_select_allow);
+ KEEP_VAL(drag_anim_duration);
_elm_config->priv = prev_config->priv;
_config_free(prev_config);
@@ -2056,7 +2094,7 @@ _config_flush_get(void)
if (pre_scale != _elm_config->scale)
_elm_rescale();
_elm_recache();
- _elm_clouseau_reload();
+ _elm_old_clouseau_reload();
_elm_config_key_binding_hash();
_elm_win_access(_elm_config->access_mode);
ecore_event_add(ELM_EVENT_CONFIG_ALL_CHANGED, NULL, NULL, NULL);
@@ -2791,6 +2829,12 @@ _env_get(void)
if (s) _elm_config->popup_vertical_align = _elm_atof(s);
s = getenv("ELM_POPUP_SCROLLABLE");
if (s) _elm_config->popup_scrollable = atoi(s);
+
+ s = getenv("ELM_GLAYER_TAP_FINGER_SIZE");
+ if (s) _elm_config->glayer_tap_finger_size = atoi(s);
+
+ s = getenv("EFL_UI_DND_DRAG_ANIM_DURATION");
+ if (s) _elm_config->drag_anim_duration = _elm_atof(s);
}
static void
@@ -3434,6 +3478,40 @@ elm_config_focus_move_policy_get(void)
return _elm_config->focus_move_policy;
}
+static void
+_efl_ui_widget_config_reload(Efl_Ui_Widget *obj)
+{
+ Elm_Focus_Move_Policy focus_move_policy = elm_config_focus_move_policy_get();
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, sd);
+ Efl_Ui_Widget *w;
+ Eina_List *n;
+
+ //reload focus move policy
+ if (efl_ui_widget_focus_move_policy_automatic_get(obj) &&
+ (sd->focus_move_policy != focus_move_policy))
+ {
+ sd->focus_move_policy = focus_move_policy;
+ }
+
+ EINA_LIST_FOREACH(sd->subobjs, n, w)
+ {
+ if (efl_isa(w, EFL_UI_WIDGET_CLASS))
+ _efl_ui_widget_config_reload(w);
+ }
+}
+
+void
+_elm_win_focus_reconfigure(void)
+{
+ const Eina_List *l;
+ Evas_Object *obj;
+
+ EINA_LIST_FOREACH(_elm_win_list, l, obj)
+ {
+ _efl_ui_widget_config_reload(obj);
+ }
+}
+
EAPI void
elm_config_focus_move_policy_set(Elm_Focus_Move_Policy policy)
{
@@ -3865,7 +3943,7 @@ elm_config_clouseau_enabled_set(Eina_Bool enable)
{
_elm_config->priv.clouseau_enable = EINA_TRUE;
_elm_config->clouseau_enable = !!enable;
- _elm_clouseau_reload();
+ _elm_old_clouseau_reload();
}
EAPI double
@@ -4128,7 +4206,7 @@ _elm_config_init(void)
_elm_config_font_overlay_apply();
_elm_config_color_overlay_apply();
_elm_recache();
- _elm_clouseau_reload();
+ _elm_old_clouseau_reload();
_elm_config_key_binding_hash();
}
@@ -4137,17 +4215,6 @@ _elm_config_sub_shutdown(void)
{
ecore_event_type_flush(ELM_EVENT_CONFIG_ALL_CHANGED);
-#ifdef HAVE_ELEMENTARY_X
- if (ecore_x_display_get()) ecore_x_shutdown();
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- if (_elm_wl_display)
- {
- ecore_wl2_display_disconnect(_elm_wl_display);
- _elm_wl_display = NULL;
- ecore_wl2_shutdown();
- }
-#endif
#ifdef HAVE_ELEMENTARY_WIN32
ecore_win32_shutdown();
#endif
@@ -4238,78 +4305,6 @@ _elm_config_file_monitor_cb(void *data EINA_UNUSED,
void
_elm_config_sub_init(void)
{
-#if defined(HAVE_ELEMENTARY_X) || defined(HAVE_ELEMENTARY_WL2) || defined(HAVE_ELEMENTARY_WIN32)
- const char *ev = getenv("ELM_DISPLAY");
-#endif
-
-#ifdef HAVE_ELEMENTARY_X
- Eina_Bool init_x = EINA_FALSE;
- Eina_Bool have_display = !!getenv("DISPLAY");
-
- if (ev) /* If ELM_DISPLAY is specified */
- {
- if (!strcmp(ev, "x11")) /* and it is X11 */
- {
- if (!have_display) /* if there is no $DISPLAY */
- {
- ERR("$ELM_DISPLAY is set to x11 but $DISPLAY is not set");
- init_x = EINA_FALSE;
- }
- else /* if there is */
- init_x = EINA_TRUE;
- }
- else /* not X11 */
- init_x = EINA_FALSE;
- }
- else /* ELM_DISPLAY not specified */
- {
- if (have_display) /* If there is a $DISPLAY */
- init_x = EINA_TRUE;
- else /* No $DISPLAY */
- init_x = EINA_FALSE;
- }
- if (init_x)
- {
- ecore_x_init(NULL);
- }
-#endif
-#ifdef HAVE_ELEMENTARY_WL2
- Eina_Bool init_wl = EINA_FALSE;
- Eina_Bool have_wl_display = !!getenv("WAYLAND_DISPLAY");
-
- if (ev) /* If ELM_DISPLAY is specified */
- {
- if (!strcmp(ev, "wl")) /* and it is WL */
- {
- /* always try to connect to wl when it is enforced */
- init_wl = EINA_TRUE;
- }
- else /* not wl */
- init_wl = EINA_FALSE;
- }
- else /* ELM_DISPLAY not specified */
- {
- /* If there is a $WAYLAND_DISPLAY */
- if ((have_wl_display) && (!getenv("DISPLAY")))
- init_wl = EINA_TRUE;
- else /* No $WAYLAND_DISPLAY */
- init_wl = EINA_FALSE;
- }
- if (init_wl)
- {
- if (!ecore_wl2_init())
- {
- ERR("Could not initialize Ecore_Wl2");
- goto end;
- }
- _elm_wl_display = ecore_wl2_display_connect(NULL);
- if (!_elm_wl_display)
- {
- ERR("Could not connect to Wayland Display");
- goto end;
- }
- }
-#endif
#ifdef HAVE_ELEMENTARY_COCOA
ecore_cocoa_init();
#endif
@@ -4403,7 +4398,7 @@ _elm_config_reload(void)
_elm_rescale();
#undef CMP
_elm_recache();
- _elm_clouseau_reload();
+ _elm_old_clouseau_reload();
_elm_config_key_binding_hash();
ecore_event_add(ELM_EVENT_CONFIG_ALL_CHANGED, NULL, NULL, NULL);
if (ptheme) eina_stringshare_del(ptheme);
@@ -4599,7 +4594,7 @@ elm_config_web_backend_set(const char *backend)
{
_elm_config->priv.web_backend = EINA_TRUE;
if (_elm_web_init(backend))
- _elm_config->web_backend = backend;
+ eina_stringshare_replace(&_elm_config->web_backend, backend);
}
EAPI const char *
@@ -4637,6 +4632,20 @@ elm_config_powersave_set(int set)
_elm_config->powersave = set;
}
+EAPI double
+elm_config_drag_anim_duration_get(void)
+{
+ if (!_elm_config) return 0.0;
+ return _elm_config->drag_anim_duration;
+}
+
+EAPI void
+elm_config_drag_anim_duration_set(double set)
+{
+ if (!_elm_config) return;
+ _elm_config->drag_anim_duration = set;
+}
+
void
_elm_config_profile_set(const char *profile)
{
@@ -4670,7 +4679,7 @@ _elm_config_profile_set(const char *profile)
_elm_config_color_overlay_apply();
_elm_rescale();
_elm_recache();
- _elm_clouseau_reload();
+ _elm_old_clouseau_reload();
_elm_config_key_binding_hash();
}
@@ -4967,7 +4976,7 @@ _efl_config_global_efl_config_config_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNU
}
EOLIAN static Eina_Value *
-_efl_config_global_efl_config_config_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED,
+_efl_config_global_efl_config_config_get(const Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED,
const char *name)
{
Eina_Value *val = NULL;
@@ -5074,6 +5083,7 @@ _efl_config_global_efl_config_config_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNU
CONFIG_GETS(web_backend);
CONFIG_GETB(offline);
CONFIG_GETI(powersave);
+ CONFIG_GETD(drag_anim_duration);
const size_t len = sizeof("audio_mute") - 1;
if (!strncmp(name, "audio_mute", len))
@@ -5103,7 +5113,7 @@ _efl_config_global_profile_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, const
}
EOLIAN static const char *
-_efl_config_global_profile_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED)
+_efl_config_global_profile_get(const Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED)
{
return elm_config_profile_get();
}
@@ -5125,7 +5135,7 @@ typedef struct
static Eina_Bool
_profile_iterator_next(Profile_Iterator *it, void **data)
{
- Efl_Gfx *sub;
+ Efl_Gfx_Entity *sub;
if (!it->object) return EINA_FALSE;
if (!eina_iterator_next(it->real_iterator, (void **) &sub))
diff --git a/src/lib/elementary/elm_config.h b/src/lib/elementary/elm_config.h
index aa83915d1b..30bceba323 100644
--- a/src/lib/elementary/elm_config.h
+++ b/src/lib/elementary/elm_config.h
@@ -2201,6 +2201,25 @@ EAPI int elm_config_powersave_get(void);
*/
EAPI void elm_config_powersave_set(int set);
+/**
+ * Get the animation duration for container objects
+ *
+ * @return Animation duration
+ *
+ * @since 1.21
+ * @see elm_config_drag_anim_duration_set()
+ */
+EAPI double elm_config_drag_anim_duration_get(void);
+
+/**
+ * Set the animation duration for container objects
+ *
+ * @param set Animation duration
+ *
+ * @since 1.21
+ * @see elm_config_drag_anim_duration_get()
+ */
+EAPI void elm_config_drag_anim_duration_set(double set);
/* new efl.config interface helpers in C */
diff --git a/src/lib/elementary/elm_conform.c b/src/lib/elementary/elm_conform.c
index 55f04de82a..0e51c94223 100644
--- a/src/lib/elementary/elm_conform.c
+++ b/src/lib/elementary/elm_conform.c
@@ -3,7 +3,7 @@
#endif
#define ELM_WIDGET_PROTECTED
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define ELM_LAYOUT_PROTECTED
#include <Elementary.h>
@@ -342,7 +342,7 @@ _land_indicator_connect_cb(void *data)
}
if (strchr(indicator_serv_name, '/'))
{
- sd->port_indi_timer = NULL;
+ sd->land_indi_timer = NULL;
return ECORE_CALLBACK_CANCEL;
}
if (elm_plug_connect(sd->landscape_indicator, indicator_serv_name, 0, EINA_FALSE))
@@ -574,7 +574,7 @@ _on_rotation_changed(void *data, const Efl_Event *event EINA_UNUSED)
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_conformant_elm_widget_theme_apply(Eo *obj, Elm_Conformant_Data *_pd EINA_UNUSED)
+_elm_conformant_efl_ui_widget_theme_apply(Eo *obj, Elm_Conformant_Data *_pd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
@@ -966,7 +966,7 @@ _elm_conformant_efl_canvas_group_group_del(Eo *obj, Elm_Conformant_Data *sd)
}
EOLIAN static void
-_elm_conformant_elm_widget_widget_parent_set(Eo *obj, Elm_Conformant_Data *sd, Evas_Object *parent)
+_elm_conformant_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Conformant_Data *sd, Evas_Object *parent)
{
#ifdef HAVE_ELEMENTARY_X
Evas_Object *top = elm_widget_top_get(parent);
@@ -1001,7 +1001,7 @@ _elm_conformant_efl_object_constructor(Eo *obj, Elm_Conformant_Data *sd)
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_FILLER);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_FILLER);
Efl_Event event = {};
event.object = sd->win;
diff --git a/src/lib/elementary/elm_conformant.eo b/src/lib/elementary/elm_conformant.eo
index f289493106..8026cc020e 100644
--- a/src/lib/elementary/elm_conformant.eo
+++ b/src/lib/elementary/elm_conformant.eo
@@ -1,4 +1,4 @@
-class Elm.Conformant (Efl.Ui.Layout)
+class Elm.Conformant (Efl.Ui.Layout.Object, Efl.Ui.Legacy)
{
[[Elementary conformant class]]
legacy_prefix: elm_conformant;
@@ -7,13 +7,13 @@ class Elm.Conformant (Efl.Ui.Layout)
implements {
class.constructor;
Efl.Object.constructor;
- Elm.Widget.widget_parent { set; }
- Elm.Widget.theme_apply;
+ Efl.Ui.Widget.widget_parent { set; }
+ Efl.Ui.Widget.theme_apply;
}
events {
- virtualkeypad,state,on; [[Called when virtualkeypad was enabled]]
- virtualkeypad,state,off; [[Called when virtualkeypad was disabled]]
- clipboard,state,on; [[Called when clipboard was enabled]]
- clipboard,state,off; [[Called when clipboard was disabled]]
+ virtualkeypad,state,on: void; [[Called when virtualkeypad was enabled]]
+ virtualkeypad,state,off: void; [[Called when virtualkeypad was disabled]]
+ clipboard,state,on: void; [[Called when clipboard was enabled]]
+ clipboard,state,off: void; [[Called when clipboard was disabled]]
}
}
diff --git a/src/lib/elementary/elm_ctxpopup.eo b/src/lib/elementary/elm_ctxpopup.eo
index 4166ace696..af3617b7f2 100644
--- a/src/lib/elementary/elm_ctxpopup.eo
+++ b/src/lib/elementary/elm_ctxpopup.eo
@@ -8,14 +8,44 @@ enum Elm.Ctxpopup.Direction
unknown [[Ctxpopup does not determine it's direction yet.]]
}
-class Elm.Ctxpopup (Efl.Ui.Layout, Efl.Ui.Focus.Layer, Efl.Access.Widget.Action,
- Efl.Ui.Menu)
+class Elm.Ctxpopup (Efl.Ui.Layout.Object, Efl.Ui.Focus.Layer, Efl.Access.Widget.Action, Efl.Ui.Legacy)
{
[[Elementary context popup class]]
legacy_prefix: elm_ctxpopup;
eo_prefix: elm_obj_ctxpopup;
event_prefix: elm_ctxpopup;
methods {
+ @property selected_item {
+ get {
+ [[Get the selected item in the widget.]]
+ }
+ values {
+ item: Elm.Widget.Item; [[The selected item or $null.]]
+ }
+ }
+ @property first_item {
+ get {
+ [[Get the first item in the widget.]]
+ }
+ values {
+ item: Elm.Widget.Item; [[The first item or $null.]]
+ }
+ }
+ @property last_item {
+ get {
+ [[Get the last item in the widget.]]
+ }
+ values {
+ item: Elm.Widget.Item; [[The last item or $null.]]
+ }
+ }
+ @property items {
+ get {
+ [[Returns a list of the widget item.]]
+ return: const(list<Elm.Widget.Item>); [[const list to widget items]]
+ }
+ }
+
@property horizontal {
set {
[[Change the ctxpopup's orientation to horizontal or vertical.]]
@@ -201,23 +231,19 @@ class Elm.Ctxpopup (Efl.Ui.Layout, Efl.Ui.Focus.Layer, Efl.Access.Widget.Action,
implements {
class.constructor;
Efl.Object.constructor;
- Elm.Widget.widget_parent { set; }
- Elm.Widget.on_disabled_update;
- Elm.Widget.widget_sub_object_add;
+ Efl.Ui.Widget.widget_parent { set; }
+ Efl.Ui.Widget.on_disabled_update;
+ Efl.Ui.Widget.widget_sub_object_add;
Efl.Ui.Translatable.translation_update;
- Elm.Widget.theme_apply;
- Elm.Widget.widget_event;
- Elm.Widget.focused_item { get; }
- Efl.Ui.Menu.selected_item { get; }
- Efl.Ui.Menu.first_item { get; }
- Efl.Ui.Menu.last_item { get; }
- Efl.Ui.Menu.items { get; }
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.widget_event;
+ Efl.Ui.Widget.focused_item { get; }
Efl.Access.Widget.Action.elm_actions { get; }
- Efl.Access.state_set { get; }
- Efl.Part.part;
+ Efl.Access.Object.state_set { get; }
+ Efl.Part.part_get;
}
events {
- dismissed; [[Called when context popup was dismissed]]
+ dismissed: void; [[Called when context popup was dismissed]]
geometry,update: const(ptr(Eina.Rect)); [[Called when context popup geometry was updated]]
}
}
diff --git a/src/lib/elementary/elm_ctxpopup_item.eo b/src/lib/elementary/elm_ctxpopup_item.eo
index 8c87b23a4c..2abdbfc9ad 100644
--- a/src/lib/elementary/elm_ctxpopup_item.eo
+++ b/src/lib/elementary/elm_ctxpopup_item.eo
@@ -1,11 +1,60 @@
-class Elm.Ctxpopup.Item(Elm.Widget.Item, Efl.Ui.Item, Efl.Access.Widget.Action)
+class Elm.Ctxpopup.Item(Elm.Widget.Item, Efl.Access.Widget.Action,
+ Efl.Ui.Legacy)
{
[[Elementary context popup item class]]
legacy_prefix: elm_ctxpopup_item;
eo_prefix: elm_obj_ctxpopup_item;
methods {
+ @property prev {
+ get {
+ [[Get the item before this one in the widget's list of items.
+
+ See also @.next.
+ ]]
+ }
+ values {
+ item: Elm.Widget.Item; [[The item before the object in its parent's
+ list. If there is no previous item or in case
+ of error, $null is returned.]]
+ }
+ }
+ @property next {
+ get {
+ [[Get the item after this one in the widget's list of items.
+
+ See also @.prev.
+ ]]
+ }
+ values {
+ item: Elm.Widget.Item; [[The item after the object in its parent's
+ list. If there is no next item or in case
+ of error, $null is returned.]]
+ }
+ }
+ @property selected {
+ [[Indicates whether this item is currently selected.]]
+ get {
+ [[Get the selected state of this item.]]
+ }
+ set {
+ [[Set the selected state of $item.
+
+ This sets the selected state of the given item $it.
+ $true for selected, $false for not selected.
+
+ If a new item is selected the previously selected will
+ be unselected. Previously selected item can be retrieved
+ with @Elm.Ctxpopup.selected_item.get.
+
+ Selected items will be highlighted.
+ ]]
+ }
+ values {
+ selected: bool; [[The selection state.]]
+ }
+ }
init {
- [[Init context popup item]]
+ [[Init context popup item]]
params {
func: Evas_Smart_Cb @nullable; [[Smart callback function]]
data: const(void_ptr) @optional; [[Data pointer]]
@@ -21,10 +70,7 @@ class Elm.Ctxpopup.Item(Elm.Widget.Item, Efl.Ui.Item, Efl.Access.Widget.Action)
Elm.Widget.Item.part_text { get; set; }
Elm.Widget.Item.part_content { get; set; }
Elm.Widget.Item.part_content_unset;
- Elm.Widget.Item.focus { get; set; }
- Efl.Ui.Item.selected { get; set; }
- Efl.Ui.Item.prev { get; }
- Efl.Ui.Item.next { get; }
+ Elm.Widget.Item.item_focus { get; set; }
Efl.Access.Widget.Action.elm_actions { get; }
}
}
diff --git a/src/lib/elementary/elm_datetime.c b/src/lib/elementary/elm_datetime.c
index fc68f87525..97fc763291 100644
--- a/src/lib/elementary/elm_datetime.c
+++ b/src/lib/elementary/elm_datetime.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#include <Elementary.h>
#include "elm_priv.h"
@@ -17,23 +17,45 @@
#include "elm_datetime.h"
+#include "efl_ui_clock_legacy.eo.h"
+
+#define MY_CLASS_NAME_LEGACY "elm_datetime"
+
+static void
+_efl_ui_clock_legacy_class_constructor(Efl_Class *klass)
+{
+ evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
+}
+
+EOLIAN static Eo *
+_efl_ui_clock_legacy_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED)
+{
+ obj = efl_constructor(efl_super(obj, EFL_UI_CLOCK_LEGACY_CLASS));
+ efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
+ return obj;
+}
+
EAPI Evas_Object *
elm_datetime_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return elm_legacy_add(EFL_UI_CLOCK_CLASS, parent);
+ return elm_legacy_add(EFL_UI_CLOCK_LEGACY_CLASS, parent);
}
EAPI void
elm_datetime_format_set(Evas_Object *obj,
const char *fmt)
{
+ EINA_SAFETY_ON_NULL_RETURN(obj);
+
efl_ui_clock_format_set(obj, fmt);
}
EAPI const char *
elm_datetime_format_get(const Evas_Object *obj)
{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
+
return efl_ui_clock_format_get(obj);
}
@@ -70,64 +92,106 @@ adjust_field_type(Elm_Datetime_Field_Type type)
EAPI void
elm_datetime_field_limit_set(Evas_Object *obj, Elm_Datetime_Field_Type type, int min, int max)
{
+ EINA_SAFETY_ON_NULL_RETURN(obj);
+
+ if ((type < ELM_DATETIME_YEAR) || (type >= ELM_DATETIME_AMPM)) return;
+
efl_ui_clock_field_limit_set(obj, adjust_field_type(type), min, max);
}
EAPI void
elm_datetime_field_limit_get(const Evas_Object *obj, Elm_Datetime_Field_Type fieldtype, int *min, int *max)
{
+ EINA_SAFETY_ON_NULL_RETURN(obj);
+
+ if ((fieldtype < ELM_DATETIME_YEAR) || (fieldtype >= ELM_DATETIME_AMPM)) return;
+
efl_ui_clock_field_limit_get(obj, adjust_field_type(fieldtype), min, max);
}
EAPI Eina_Bool
elm_datetime_value_min_set(Evas_Object *obj, const Efl_Time *mintime)
{
- if (mintime) efl_ui_clock_time_min_set(obj, *mintime);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(mintime, EINA_FALSE);
+
+ efl_ui_clock_time_min_set(obj, *mintime);
+
return EINA_TRUE;
}
EAPI Eina_Bool
elm_datetime_value_min_get(const Evas_Object *obj, Efl_Time *mintime)
{
- if (mintime) *mintime = efl_ui_clock_time_min_get(obj);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(mintime, EINA_FALSE);
+
+ *mintime = efl_ui_clock_time_min_get(obj);
+
return EINA_TRUE;
}
EAPI Eina_Bool
elm_datetime_value_set(Evas_Object *obj, const Efl_Time *newtime)
{
- if (newtime) efl_ui_clock_time_set(obj, *newtime);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(newtime, EINA_FALSE);
+
+ efl_ui_clock_time_set(obj, *newtime);
+
return EINA_TRUE;
}
EAPI Eina_Bool
elm_datetime_value_get(const Evas_Object *obj, Efl_Time *currtime)
{
- if (currtime) *currtime = efl_ui_clock_time_get(obj);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(currtime, EINA_FALSE);
+
+ *currtime = efl_ui_clock_time_get(obj);
+
return EINA_TRUE;
}
EAPI void
elm_datetime_field_visible_set(Evas_Object *obj, Elm_Datetime_Field_Type fieldtype, Eina_Bool visible)
{
+ EINA_SAFETY_ON_NULL_RETURN(obj);
+
+ if ((fieldtype < ELM_DATETIME_YEAR) || (fieldtype > ELM_DATETIME_AMPM)) return;
+
efl_ui_clock_field_visible_set(obj, adjust_field_type(fieldtype), visible);
}
EAPI Eina_Bool elm_datetime_field_visible_get(const Evas_Object *obj, Elm_Datetime_Field_Type fieldtype)
{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
+
+ if ((fieldtype < ELM_DATETIME_YEAR) || (fieldtype > ELM_DATETIME_AMPM)) return EINA_FALSE;
+
return efl_ui_clock_field_visible_get(obj, adjust_field_type(fieldtype));
}
EAPI Eina_Bool
elm_datetime_value_max_set(Evas_Object *obj, const Efl_Time *maxtime)
{
- if (maxtime) efl_ui_clock_time_max_set(obj, *maxtime);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(maxtime, EINA_FALSE);
+
+ efl_ui_clock_time_max_set(obj, *maxtime);
+
return EINA_TRUE;
}
EAPI Eina_Bool
elm_datetime_value_max_get(const Evas_Object *obj, Efl_Time *maxtime)
{
- if (maxtime) *maxtime = efl_ui_clock_time_max_get(obj);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(maxtime, EINA_FALSE);
+
+ *maxtime = efl_ui_clock_time_max_get(obj);
+
return EINA_TRUE;
}
+
+#include "efl_ui_clock_legacy.eo.c"
diff --git a/src/lib/elementary/elm_datetime.h b/src/lib/elementary/elm_datetime.h
index 9a111a1be9..cc47da298d 100644
--- a/src/lib/elementary/elm_datetime.h
+++ b/src/lib/elementary/elm_datetime.h
@@ -214,6 +214,8 @@ typedef enum
ELM_DATETIME_AMPM = 5 /**< Indicates AM/PM field . */
} Elm_Datetime_Field_Type;
+typedef Eo Elm_Datetime;
+
/**
* @brief Adds a new datetime Widget
*
diff --git a/src/lib/elementary/elm_dayselector.c b/src/lib/elementary/elm_dayselector.c
index 68b8dd8066..8f709944b1 100644
--- a/src/lib/elementary/elm_dayselector.c
+++ b/src/lib/elementary/elm_dayselector.c
@@ -2,8 +2,9 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_UI_TRANSLATABLE_PROTECTED
+#define EFL_PART_PROTECTED
#include <Elementary.h>
#include "elm_priv.h"
@@ -123,7 +124,7 @@ _item_location_get(Elm_Dayselector_Data *sd,
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_dayselector_elm_widget_theme_apply(Eo *obj, Elm_Dayselector_Data *sd)
+_elm_dayselector_efl_ui_widget_theme_apply(Eo *obj, Elm_Dayselector_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
@@ -140,9 +141,14 @@ _elm_dayselector_elm_widget_theme_apply(Eo *obj, Elm_Dayselector_Data *sd)
(buf, sizeof(buf), "dayselector/%s", elm_object_style_get(obj));
elm_object_style_set(VIEW(it), buf);
+ /* XXX kept for legacy compatibility, remove eventually */
snprintf
(buf, sizeof(buf), "day%d,visible", _item_location_get(sd, it));
elm_layout_signal_emit(obj, buf, "elm");
+ /* XXX */
+ snprintf
+ (buf, sizeof(buf), "elm,day%d,visible", _item_location_get(sd, it));
+ elm_layout_signal_emit(obj, buf, "elm");
}
_update_items(obj);
@@ -169,12 +175,16 @@ _item_del_cb(void *data,
{
sd->items = eina_list_remove(sd->items, it);
eina_stringshare_del(it->day_style);
+ /* XXX kept for legacy compatibility, remove eventually */
snprintf(buf, sizeof(buf), "day%d,default",
_item_location_get(sd, it));
elm_layout_signal_emit(obj, buf, "elm");
+ /* XXX */
+ snprintf(buf, sizeof(buf), "elm,day%d,default",
+ _item_location_get(sd, it));
+ elm_layout_signal_emit(obj, buf, "elm");
- VIEW(it) = NULL;
- efl_del(EO_OBJ(it));
+ // The object is already being deleted, there is no point in calling efl_del on it nore setting it to NULL.
elm_layout_sizing_eval(obj);
break;
@@ -234,15 +244,23 @@ _elm_dayselector_content_set(Eo *obj, Elm_Dayselector_Data *sd, const char *item
it = _item_find(obj, day);
if (it)
{
- snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it));
+ snprintf(buf, sizeof(buf), "elm.swallow.day%d", _item_location_get(sd, it));
int_ret = efl_content_set(efl_part(efl_super(obj, MY_CLASS), buf), content);
+ if (!int_ret)
+ {
+ /* XXX kept for legacy compatibility, remove eventually */
+ snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it));
+
+ int_ret = efl_content_set(efl_part(efl_super(obj, MY_CLASS), buf), content);
+ /* XXX */
+ }
if (!int_ret) return EINA_FALSE;
if (!content) return EINA_TRUE; /* item deletion already handled */
evas_object_del(VIEW(it));
- VIEW(it) = content;
+ VIEW_SET(it, content);
}
else
{
@@ -250,19 +268,30 @@ _elm_dayselector_content_set(Eo *obj, Elm_Dayselector_Data *sd, const char *item
it = efl_data_scope_get(eo_it, ELM_DAYSELECTOR_ITEM_CLASS);
it->day = day;
- snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it));
+ snprintf(buf, sizeof(buf), "elm.swallow.day%d", _item_location_get(sd, it));
int_ret = efl_content_set(efl_part(efl_super(obj, MY_CLASS), buf), content);
if (!int_ret)
{
+ /* XXX kept for legacy compatibility, remove eventually */
+ snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it));
+
+ int_ret = efl_content_set(efl_part(efl_super(obj, MY_CLASS), buf), content);
+ /* XXX */
+ }
+ if (!int_ret)
+ {
efl_del(eo_it);
return EINA_FALSE;
}
sd->items = eina_list_append(sd->items, it);
- VIEW(it) = content;
+ VIEW_SET(it, content);
}
+ snprintf(buf, sizeof(buf), "elm,day%d,visible", _item_location_get(sd, it));
+ elm_layout_signal_emit(obj, buf, "elm");
+ /* XXX kept for legacy compatibility, remove eventually */
snprintf(buf, sizeof(buf), "day%d,visible", _item_location_get(sd, it));
elm_layout_signal_emit(obj, buf, "elm");
@@ -325,10 +354,12 @@ _elm_dayselector_content_unset(Eo *obj, Elm_Dayselector_Data *sd, const char *it
elm_object_signal_callback_del
(content, ITEM_TYPE_WEEKEND_STYLE1, "*", _item_signal_emit_cb);
+ snprintf(buf, sizeof(buf), "elm,day%d,default", _item_location_get(sd, it));
+ elm_layout_signal_emit(obj, buf, "elm");
+ /* XXX kept for legacy compatibility, remove eventually */
snprintf(buf, sizeof(buf), "day%d,default", _item_location_get(sd, it));
elm_layout_signal_emit(obj, buf, "elm");
- VIEW(it) = NULL;
efl_del(EO_OBJ(it));
elm_layout_sizing_eval(obj);
@@ -394,8 +425,12 @@ _items_create(Evas_Object *obj)
strftime(buf, sizeof(buf), "%a", &time_daysel);
elm_object_text_set(chk, buf);
- snprintf(buf, sizeof(buf), "day%u", idx);
- elm_layout_content_set(obj, buf, chk);
+ snprintf(buf, sizeof(buf), "elm.swallow.day%u", idx);
+ if (!elm_layout_content_set(obj, buf, chk))
+ {
+ snprintf(buf, sizeof(buf), "day%u", idx);
+ elm_layout_content_set(obj, buf, chk);
+ }
// XXX: ACCESS
_elm_access_text_set(_elm_access_info_get(chk),
@@ -436,7 +471,7 @@ _elm_dayselector_efl_canvas_group_group_del(Eo *obj, Elm_Dayselector_Data *sd)
{
sd->items = eina_list_remove(sd->items, it);
eina_stringshare_del(it->day_style);
- efl_del(EO_OBJ(it));
+ // No need to efl_del the object as they have been created by efl_add and are dead by now.
}
/* handles freeing sd */
@@ -456,7 +491,7 @@ _elm_dayselector_efl_object_constructor(Eo *obj, Elm_Dayselector_Data *_pd EINA_
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_PANEL);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_PANEL);
return obj;
}
@@ -497,16 +532,19 @@ _elm_dayselector_week_start_set(Eo *obj, Elm_Dayselector_Data *sd, Elm_Dayselect
sd->week_start = day;
EINA_LIST_FOREACH(sd->items, l, it)
{
- snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it));
- edje_object_part_swallow
- (wd->resize_obj, buf, VIEW(it));
+ snprintf(buf, sizeof(buf), "elm.swallow.day%d", _item_location_get(sd, it));
+ if (!edje_object_part_swallow(wd->resize_obj, buf, VIEW(it)))
+ {
+ snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it));
+ edje_object_part_swallow(wd->resize_obj, buf, VIEW(it));
+ }
}
_update_items(obj);
}
EOLIAN static Elm_Dayselector_Day
-_elm_dayselector_week_start_get(Eo *obj EINA_UNUSED, Elm_Dayselector_Data *sd)
+_elm_dayselector_week_start_get(const Eo *obj EINA_UNUSED, Elm_Dayselector_Data *sd)
{
return sd->week_start;
}
@@ -521,7 +559,7 @@ _elm_dayselector_weekend_start_set(Eo *obj, Elm_Dayselector_Data *sd, Elm_Daysel
}
EOLIAN static Elm_Dayselector_Day
-_elm_dayselector_weekend_start_get(Eo *obj EINA_UNUSED, Elm_Dayselector_Data *sd)
+_elm_dayselector_weekend_start_get(const Eo *obj EINA_UNUSED, Elm_Dayselector_Data *sd)
{
return sd->weekend_start;
}
@@ -536,7 +574,7 @@ _elm_dayselector_weekend_length_set(Eo *obj, Elm_Dayselector_Data *sd, unsigned
}
EOLIAN static unsigned int
-_elm_dayselector_weekend_length_get(Eo *obj EINA_UNUSED, Elm_Dayselector_Data *sd)
+_elm_dayselector_weekend_length_get(const Eo *obj EINA_UNUSED, Elm_Dayselector_Data *sd)
{
return sd->weekend_len;
}
diff --git a/src/lib/elementary/elm_dayselector.eo b/src/lib/elementary/elm_dayselector.eo
index c5135da6ea..13017f1b7c 100644
--- a/src/lib/elementary/elm_dayselector.eo
+++ b/src/lib/elementary/elm_dayselector.eo
@@ -17,7 +17,7 @@ enum Elm.Dayselector.Day
max [[Sentinel value to indicate last enum field during iteration]]
}
-class Elm.Dayselector (Efl.Ui.Layout)
+class Elm.Dayselector (Efl.Ui.Layout.Object, Efl.Ui.Legacy)
{
[[Elementary dayselector class]]
legacy_prefix: elm_dayselector;
@@ -151,11 +151,13 @@ class Elm.Dayselector (Efl.Ui.Layout)
implements {
class.constructor;
Efl.Object.constructor;
- Elm.Widget.theme_apply;
+ Efl.Ui.Widget.theme_apply;
Efl.Ui.Translatable.translation_update;
- Efl.Part.part;
+ Efl.Part.part_get;
}
events {
+ /* FIXME: Nobody emits this
dayselector,changed; [[Called when dayselector widget changed]]
+ */
}
}
diff --git a/src/lib/elementary/elm_dbus_menu.c b/src/lib/elementary/elm_dbus_menu.c
index 7becff12fe..73b8a7bf0b 100644
--- a/src/lib/elementary/elm_dbus_menu.c
+++ b/src/lib/elementary/elm_dbus_menu.c
@@ -333,8 +333,7 @@ _root_layout_build(Elm_DBus_Menu *dbus_menu, Eina_List *property_list,
{
char *property;
Eldbus_Message_Iter *layout, *array, *pair, *variant;
- Eina_List *l;
- Eina_Iterator *it = NULL;
+ const Eina_List *l, *it;
Elm_Object_Item *obj_item;
layout = eldbus_message_iter_container_new(iter, 'r', NULL);
@@ -360,8 +359,8 @@ _root_layout_build(Elm_DBus_Menu *dbus_menu, Eina_List *property_list,
if (recursion_depth > 0)
{
- it = efl_ui_menu_items_get(dbus_menu->menu);
- EINA_ITERATOR_FOREACH (it, obj_item)
+ it = elm_menu_items_get(dbus_menu->menu);
+ EINA_LIST_FOREACH (it, l, obj_item)
{
variant = eldbus_message_iter_container_new(array, 'v',
"(ia{sv}av)");
@@ -370,7 +369,6 @@ _root_layout_build(Elm_DBus_Menu *dbus_menu, Eina_List *property_list,
recursion_depth - 1, variant);
eldbus_message_iter_container_close(array, variant);
}
- eina_iterator_free(it);
}
eldbus_message_iter_container_close(layout, array);
@@ -423,7 +421,7 @@ _elm_dbus_menu_add(Eo *menu)
{
Elm_DBus_Menu *dbus_menu;
Elm_Object_Item *obj_item;
- Eina_Iterator *it = NULL;
+ const Eina_List *it, *l;
ELM_MENU_CHECK(menu) NULL;
@@ -443,8 +441,8 @@ _elm_dbus_menu_add(Eo *menu)
dbus_menu->menu = menu;
- it = efl_ui_menu_items_get(menu);
- EINA_ITERATOR_FOREACH(it, obj_item)
+ it = elm_menu_items_get(menu);
+ EINA_LIST_FOREACH(it, l, obj_item)
{
ELM_MENU_ITEM_DATA_GET(obj_item, item);
if (!_menu_add_recursive(dbus_menu, item))
@@ -453,12 +451,10 @@ _elm_dbus_menu_add(Eo *menu)
goto error_hash;
}
}
- eina_iterator_free(it);
return dbus_menu;
error_hash:
- eina_iterator_free(it);
eina_hash_free(dbus_menu->elements);
error_menu:
free(dbus_menu);
diff --git a/src/lib/elementary/elm_diskselector.c b/src/lib/elementary/elm_diskselector.c
index 1a96a8ce61..1c6d3493b8 100644
--- a/src/lib/elementary/elm_diskselector.c
+++ b/src/lib/elementary/elm_diskselector.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define ELM_WIDGET_ITEM_PROTECTED
#define EFL_UI_TRANSLATABLE_PROTECTED
@@ -494,7 +494,7 @@ _elm_diskselector_item_elm_widget_item_part_text_set(Eo *eo_it EINA_UNUSED, Elm_
}
EOLIAN static const char *
-_elm_diskselector_item_elm_widget_item_part_text_get(Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Data *it,
+_elm_diskselector_item_elm_widget_item_part_text_get(const Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Data *it,
const char *part)
{
if (part && strcmp(part, "default")) return NULL;
@@ -585,7 +585,7 @@ _elm_diskselector_item_elm_widget_item_part_content_set(Eo *eo_it EINA_UNUSED, E
}
EOLIAN static Evas_Object *
-_elm_diskselector_item_elm_widget_item_part_content_get(Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Data *it,
+_elm_diskselector_item_elm_widget_item_part_content_get(const Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Data *it,
const char *part)
{
if (part && strcmp(part, "icon")) return NULL;
@@ -673,7 +673,7 @@ _item_new(Evas_Object *obj,
it->label = eina_stringshare_add(label);
it->func = func;
WIDGET_ITEM_DATA_SET(eo_it, data);
- VIEW(it) = edje_object_add(evas_object_evas_get(obj));
+ VIEW_SET(it, edje_object_add(evas_object_evas_get(obj)));
elm_widget_theme_object_set(obj, VIEW(it), "diskselector", "item",
elm_widget_style_get(obj));
@@ -812,7 +812,7 @@ _theme_data_get(Evas_Object *obj)
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_diskselector_elm_widget_theme_apply(Eo *obj, Elm_Diskselector_Data *sd)
+_elm_diskselector_efl_ui_widget_theme_apply(Eo *obj, Elm_Diskselector_Data *sd)
{
Eina_List *l;
Elm_Diskselector_Item_Data *it;
@@ -872,7 +872,7 @@ _elm_diskselector_elm_widget_theme_apply(Eo *obj, Elm_Diskselector_Data *sd)
}
EOLIAN static Eina_Bool
-_elm_diskselector_elm_widget_widget_sub_object_del(Eo *obj, Elm_Diskselector_Data *sd, Evas_Object *sobj)
+_elm_diskselector_efl_ui_widget_widget_sub_object_del(Eo *obj, Elm_Diskselector_Data *sd, Evas_Object *sobj)
{
Eina_Bool int_ret = EINA_FALSE;
@@ -897,12 +897,12 @@ _elm_diskselector_elm_widget_widget_sub_object_del(Eo *obj, Elm_Diskselector_Dat
}
EOLIAN static Eina_Bool
-_elm_diskselector_elm_widget_on_focus_update(Eo *obj, Elm_Diskselector_Data *_pd EINA_UNUSED, Elm_Object_Item *item EINA_UNUSED)
+_elm_diskselector_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Diskselector_Data *_pd EINA_UNUSED)
{
Eina_Bool int_ret = EINA_FALSE;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
- int_ret = efl_ui_widget_on_focus_update(efl_super(obj, MY_CLASS), NULL);
+ int_ret = efl_ui_focus_object_on_focus_update(efl_super(obj, MY_CLASS));
if (!int_ret) return EINA_FALSE;
if (efl_ui_focus_object_focus_get(obj))
@@ -1368,24 +1368,24 @@ _elm_diskselector_efl_canvas_group_group_del(Eo *obj, Elm_Diskselector_Data *sd)
}
EOLIAN static void
-_elm_diskselector_efl_gfx_position_set(Eo *obj, Elm_Diskselector_Data *sd, Eina_Position2D pos)
+_elm_diskselector_efl_gfx_entity_position_set(Eo *obj, Elm_Diskselector_Data *sd, Eina_Position2D pos)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
- efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
- efl_gfx_position_set(sd->hit_rect, pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
+ efl_gfx_entity_position_set(sd->hit_rect, pos);
}
EOLIAN static void
-_elm_diskselector_efl_gfx_size_set(Eo *obj, Elm_Diskselector_Data *sd, Eina_Size2D sz)
+_elm_diskselector_efl_gfx_entity_size_set(Eo *obj, Elm_Diskselector_Data *sd, Eina_Size2D sz)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
- efl_gfx_size_set(sd->hit_rect, sz);
+ efl_gfx_entity_size_set(sd->hit_rect, sz);
- efl_gfx_size_set(efl_super(obj, MY_CLASS), sz);
+ efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
}
EOLIAN static void
@@ -1398,7 +1398,7 @@ _elm_diskselector_efl_canvas_group_group_member_add(Eo *obj, Elm_Diskselector_Da
}
EOLIAN static void
-_elm_diskselector_elm_widget_on_access_update(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *_pd EINA_UNUSED, Eina_Bool acs)
+_elm_diskselector_efl_ui_widget_on_access_update(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *_pd EINA_UNUSED, Eina_Bool acs)
{
_elm_diskselector_smart_focus_next_enable = acs;
}
@@ -1416,13 +1416,13 @@ _elm_diskselector_efl_object_constructor(Eo *obj, Elm_Diskselector_Data *_pd EIN
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_LIST);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_LIST);
return obj;
}
EOLIAN static Eina_Bool
-_elm_diskselector_round_enabled_get(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
+_elm_diskselector_round_enabled_get(const Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
{
return sd->round;
}
@@ -1508,7 +1508,7 @@ _elm_diskselector_round_enabled_set(Eo *obj, Elm_Diskselector_Data *sd, Eina_Boo
}
EOLIAN static int
-_elm_diskselector_side_text_max_length_get(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
+_elm_diskselector_side_text_max_length_get(const Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
{
return sd->len_side;
}
@@ -1549,7 +1549,7 @@ elm_diskselector_scroller_policy_get(const Evas_Object *obj,
}
EOLIAN static void
-_elm_diskselector_elm_interface_scrollable_policy_get(Eo *obj, Elm_Diskselector_Data *sd EINA_UNUSED, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v)
+_elm_diskselector_elm_interface_scrollable_policy_get(const Eo *obj, Elm_Diskselector_Data *sd EINA_UNUSED, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v)
{
Elm_Scroller_Policy s_policy_h, s_policy_v;
@@ -1596,7 +1596,7 @@ _elm_diskselector_clear(Eo *obj, Elm_Diskselector_Data *sd)
}
EOLIAN static const Eina_List*
-_elm_diskselector_items_get(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
+_elm_diskselector_items_get(const Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
{
return sd->items;
}
@@ -1665,7 +1665,7 @@ _elm_diskselector_item_append(Eo *obj, Elm_Diskselector_Data *sd, const char *la
}
EOLIAN static Elm_Object_Item*
-_elm_diskselector_selected_item_get(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
+_elm_diskselector_selected_item_get(const Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
{
return EO_OBJ(sd->selected_item);
}
@@ -1693,7 +1693,7 @@ _elm_diskselector_item_selected_set(Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item
}
EOLIAN static Eina_Bool
-_elm_diskselector_item_selected_get(Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Data *it)
+_elm_diskselector_item_selected_get(const Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Data *it)
{
ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
ELM_DISKSELECTOR_DATA_GET(WIDGET(it), sd);
@@ -1702,7 +1702,7 @@ _elm_diskselector_item_selected_get(Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item
}
EOLIAN static Elm_Object_Item *
-_elm_diskselector_item_prev_get(Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Data *it)
+_elm_diskselector_item_prev_get(const Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Data *it)
{
ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, NULL);
Elm_Diskselector_Item_Data *prev_it = NULL;
@@ -1713,7 +1713,7 @@ _elm_diskselector_item_prev_get(Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Dat
}
EOLIAN static Elm_Object_Item *
-_elm_diskselector_item_next_get(Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Data *it)
+_elm_diskselector_item_next_get(const Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Data *it)
{
ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, NULL);
Elm_Diskselector_Item_Data *next_it = NULL;
@@ -1724,7 +1724,7 @@ _elm_diskselector_item_next_get(Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Dat
}
EOLIAN static Elm_Object_Item*
-_elm_diskselector_first_item_get(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
+_elm_diskselector_first_item_get(const Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
{
if (!sd || !sd->items) return NULL;
Elm_Diskselector_Item_Data *it = eina_list_data_get(sd->items);
@@ -1733,7 +1733,7 @@ _elm_diskselector_first_item_get(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
}
EOLIAN static Elm_Object_Item*
-_elm_diskselector_last_item_get(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
+_elm_diskselector_last_item_get(const Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
{
if (!sd->items) return NULL;
Elm_Diskselector_Item_Data *it = eina_list_data_get(eina_list_last(sd->items));
@@ -1752,7 +1752,7 @@ _elm_diskselector_display_item_num_set(Eo *obj EINA_UNUSED, Elm_Diskselector_Dat
}
EOLIAN static int
-_elm_diskselector_display_item_num_get(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
+_elm_diskselector_display_item_num_get(const Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
{
return sd->display_item_num;
}
@@ -1767,7 +1767,7 @@ _elm_diskselector_class_constructor(Efl_Class *klass)
}
EOLIAN static const Efl_Access_Action_Data*
-_elm_diskselector_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd EINA_UNUSED)
+_elm_diskselector_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "move,previous", "move", "prev", _key_action_move},
diff --git a/src/lib/elementary/elm_diskselector.eo b/src/lib/elementary/elm_diskselector.eo
index 635ea341fd..ac0d5fbbee 100644
--- a/src/lib/elementary/elm_diskselector.eo
+++ b/src/lib/elementary/elm_diskselector.eo
@@ -1,7 +1,7 @@
-class Elm.Diskselector (Elm.Widget, Elm.Interface_Scrollable,
+class Elm.Diskselector (Efl.Ui.Widget, Elm.Interface_Scrollable,
Efl.Access.Widget.Action,
Efl.Ui.Clickable, Efl.Ui.Scrollable,
- Efl.Ui.Selectable)
+ Efl.Ui.Selectable, Efl.Ui.Legacy)
{
[[Elementary diskselector class]]
legacy_prefix: elm_diskselector;
@@ -198,15 +198,15 @@ class Elm.Diskselector (Elm.Widget, Elm.Interface_Scrollable,
implements {
class.constructor;
Efl.Object.constructor;
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set; }
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
Efl.Canvas.Group.group_member_add;
- Elm.Widget.on_access_update;
- Elm.Widget.theme_apply;
- Elm.Widget.on_focus_update;
+ Efl.Ui.Widget.on_access_update;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Focus.Object.on_focus_update;
Efl.Ui.Translatable.translation_update;
- Elm.Widget.widget_sub_object_del;
- Elm.Widget.widget_event;
+ Efl.Ui.Widget.widget_sub_object_del;
+ Efl.Ui.Widget.widget_event;
Elm.Interface_Scrollable.policy { get; set; }
Efl.Access.Widget.Action.elm_actions { get; }
}
diff --git a/src/lib/elementary/elm_diskselector_item.eo b/src/lib/elementary/elm_diskselector_item.eo
index 9a281cc611..740364faa7 100644
--- a/src/lib/elementary/elm_diskselector_item.eo
+++ b/src/lib/elementary/elm_diskselector_item.eo
@@ -1,4 +1,4 @@
-class Elm.Diskselector.Item(Elm.Widget.Item)
+class Elm.Diskselector.Item(Elm.Widget.Item, Efl.Ui.Legacy)
{
[[Elementary diskselector item class]]
legacy_prefix: elm_diskselector_item;
diff --git a/src/lib/elementary/elm_entry.c b/src/lib/elementary/elm_entry.c
index 854f234029..a6ccaa5980 100644
--- a/src/lib/elementary/elm_entry.c
+++ b/src/lib/elementary/elm_entry.c
@@ -2,12 +2,15 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_LAYOUT_CALC_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_TEXT_PROTECTED
#define EFL_ACCESS_EDITABLE_TEXT_PROTECTED
#define ELM_LAYOUT_PROTECTED
#define EFL_UI_FOCUS_OBJECT_PROTECTED
+#define EFL_UI_WIDGET_FOCUS_MANAGER_PROTECTED 1
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
+#define EFL_PART_PROTECTED
#include <Elementary.h>
#include <Elementary_Cursor.h>
@@ -793,7 +796,7 @@ _get_drop_format(Evas_Object *obj)
/* we can't reuse layout's here, because it's on entry_edje only */
EOLIAN static Eina_Bool
-_elm_entry_elm_widget_on_disabled_update(Eo *obj, Elm_Entry_Data *sd, Eina_Bool disabled)
+_elm_entry_efl_ui_widget_on_disabled_update(Eo *obj, Elm_Entry_Data *sd, Eina_Bool disabled)
{
const char *emission;
@@ -853,19 +856,20 @@ _elm_entry_background_switch(Evas_Object *from_edje, Evas_Object *to_edje)
/* we can't issue the layout's theming code here, cause it assumes an
* unique edje object, always */
EOLIAN static Efl_Ui_Theme_Apply
-_elm_entry_elm_widget_theme_apply(Eo *obj, Elm_Entry_Data *sd)
+_elm_entry_efl_ui_widget_theme_apply(Eo *obj, Elm_Entry_Data *sd)
{
const char *str;
const char *t;
const char *stl_user;
const char *style = elm_widget_style_get(obj);
Efl_Ui_Theme_Apply theme_apply;
+ int cursor_pos;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
// Note: We are skipping elm_layout here! This is by design.
// This assumes the following inheritance: my_class -> layout -> widget ...
- theme_apply = efl_ui_widget_theme_apply(efl_cast(obj, ELM_WIDGET_CLASS));
+ theme_apply = efl_ui_widget_theme_apply(efl_cast(obj, EFL_UI_WIDGET_CLASS));
if (!theme_apply) return EFL_UI_THEME_APPLY_FAILED;
evas_event_freeze(evas_object_evas_get(obj));
@@ -877,7 +881,7 @@ _elm_entry_elm_widget_theme_apply(Eo *obj, Elm_Entry_Data *sd)
edje_object_scale_set
(wd->resize_obj,
- efl_gfx_scale_get(obj) * elm_config_scale_get());
+ efl_gfx_entity_scale_get(obj) * elm_config_scale_get());
_mirrored_set(obj, efl_ui_mirrored_get(obj));
@@ -897,6 +901,8 @@ _elm_entry_elm_widget_theme_apply(Eo *obj, Elm_Entry_Data *sd)
edje_object_part_text_style_user_push(sd->entry_edje, "elm.text", stl_user);
eina_stringshare_del(stl_user);
+ cursor_pos = sd->cursor_pos;
+
elm_object_text_set(obj, t);
eina_stringshare_del(t);
@@ -927,11 +933,10 @@ _elm_entry_elm_widget_theme_apply(Eo *obj, Elm_Entry_Data *sd)
edje_object_part_text_prediction_hint_set
(sd->entry_edje, "elm.text", sd->prediction_hint);
- // elm_entry_cursor_pos_set -> cursor,changed -> widget_show_region_set
- // -> smart_objects_calculate will call all smart calculate functions,
- // and one of them can delete elm_entry.
evas_object_ref(obj);
+ if (cursor_pos) elm_entry_cursor_pos_set(obj, cursor_pos);
+
if (efl_ui_focus_object_focus_get(obj))
{
edje_object_signal_emit(sd->entry_edje, "elm,action,focus", "elm");
@@ -948,7 +953,7 @@ _elm_entry_elm_widget_theme_apply(Eo *obj, Elm_Entry_Data *sd)
{
Efl_Ui_Theme_Apply ok = EFL_UI_THEME_APPLY_FAILED;
- elm_interface_scrollable_mirrored_set(obj, efl_ui_mirrored_get(obj));
+ efl_ui_mirrored_set(obj, efl_ui_mirrored_get(obj));
if (sd->single_line)
ok = elm_widget_theme_object_set
@@ -996,7 +1001,7 @@ _elm_entry_elm_widget_theme_apply(Eo *obj, Elm_Entry_Data *sd)
evas_event_thaw(evas_object_evas_get(obj));
evas_event_thaw_eval(evas_object_evas_get(obj));
- efl_event_callback_legacy_call(obj, EFL_UI_LAYOUT_EVENT_THEME_CHANGED, NULL);
+ efl_event_callback_legacy_call(obj, EFL_UI_LAYOUT_OBJECT_EVENT_THEME_CHANGED, NULL);
evas_object_unref(obj);
@@ -1295,12 +1300,13 @@ _elm_entry_focus_update(Eo *obj, Elm_Entry_Data *sd)
edje_object_part_text_select_none(sd->entry_edje, "elm.text");
}
}
- edje_object_signal_emit(sd->scr_edje, "validation,default", "elm");
+ if (sd->scr_edje)
+ edje_object_signal_emit(sd->scr_edje, "validation,default", "elm");
}
}
EOLIAN static Eina_Bool
-_elm_entry_elm_widget_on_focus_update(Eo *obj, Elm_Entry_Data *sd, Elm_Object_Item *item EINA_UNUSED)
+_elm_entry_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Entry_Data *sd)
{
_elm_entry_focus_update(obj, sd);
@@ -1308,7 +1314,7 @@ _elm_entry_elm_widget_on_focus_update(Eo *obj, Elm_Entry_Data *sd, Elm_Object_It
}
EOLIAN static Eina_Rect
-_elm_entry_elm_widget_interest_region_get(Eo *obj, Elm_Entry_Data *sd)
+_elm_entry_efl_ui_widget_interest_region_get(const Eo *obj, Elm_Entry_Data *sd)
{
Evas_Coord cx, cy, cw, ch;
Evas_Coord edx, edy;
@@ -1346,7 +1352,7 @@ _show_region_hook(void *data EINA_UNUSED, Evas_Object *obj, Eina_Rect r)
}
EOLIAN static Eina_Bool
-_elm_entry_elm_widget_widget_sub_object_del(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, Evas_Object *sobj)
+_elm_entry_efl_ui_widget_widget_sub_object_del(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, Evas_Object *sobj)
{
Eina_Bool ret = EINA_FALSE;
/* unfortunately entry doesn't follow the signal pattern
@@ -1511,6 +1517,7 @@ _elm_entry_entry_paste(Evas_Object *obj,
ELM_ENTRY_CHECK(obj);
ELM_ENTRY_DATA_GET(obj, sd);
+ if (!sd) return;
if (sd->cnp_mode == ELM_CNP_MODE_NO_IMAGE)
{
str = _item_tags_remove(entry);
@@ -1534,6 +1541,7 @@ _paste_cb(void *data,
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
efl_event_callback_legacy_call
(data, EFL_UI_EVENT_SELECTION_PASTE, NULL);
@@ -1553,6 +1561,7 @@ _selection_clear(void *data, Elm_Sel_Type selection)
{
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
if (!sd->have_selection) return;
if ((selection == ELM_SEL_TYPE_CLIPBOARD) ||
(selection == ELM_SEL_TYPE_PRIMARY))
@@ -1569,6 +1578,7 @@ _selection_store(Elm_Sel_Type seltype,
ELM_ENTRY_DATA_GET(obj, sd);
+ if (!sd) return;
sel = edje_object_part_text_selection_get(sd->entry_edje, "elm.text");
if ((!sel) || (!sel[0])) return; /* avoid deleting our own selection */
@@ -1586,6 +1596,7 @@ _cut_cb(void *data,
{
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
efl_event_callback_legacy_call
(data, EFL_UI_EVENT_SELECTION_CUT, NULL);
/* Store it */
@@ -1609,6 +1620,7 @@ _copy_cb(void *data,
{
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
efl_event_callback_legacy_call
(data, EFL_UI_EVENT_SELECTION_COPY, NULL);
sd->sel_mode = EINA_FALSE;
@@ -1629,6 +1641,7 @@ _hover_cancel_cb(void *data,
{
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
sd->sel_mode = EINA_FALSE;
if (!_elm_config->desktop_entry)
edje_object_part_text_select_allow_set
@@ -1659,6 +1672,7 @@ _menu_call(Evas_Object *obj)
ELM_ENTRY_DATA_GET(obj, sd);
+ if (!sd) return;
if (sd->anchor_hover.hover) return;
efl_event_callback_legacy_call(obj, ELM_ENTRY_EVENT_CONTEXT_OPEN, NULL);
@@ -1778,6 +1792,7 @@ _magnifier_create(void *data)
{
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
double scale = _elm_config->magnifier_scale;
Evas *e;
Evas_Coord w, h, mw, mh;
@@ -1822,6 +1837,7 @@ _magnifier_move(void *data)
{
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
Evas_Coord x, y, w, h;
Evas_Coord px, py, pw, ph;
Evas_Coord cx, cy, ch;
@@ -1908,6 +1924,7 @@ static void
_magnifier_hide(void *data)
{
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
edje_object_signal_emit(sd->mgf_bg, "elm,action,hide,magnifier", "elm");
elm_widget_scroll_freeze_pop(data);
evas_object_hide(sd->mgf_clip);
@@ -1917,6 +1934,7 @@ static void
_magnifier_show(void *data)
{
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
edje_object_signal_emit(sd->mgf_bg, "elm,action,show,magnifier", "elm");
elm_widget_scroll_freeze_push(data);
evas_object_show(sd->mgf_clip);
@@ -1927,6 +1945,7 @@ _long_press_cb(void *data)
{
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return ECORE_CALLBACK_CANCEL;
if (_elm_config->magnifier_enable)
{
_magnifier_create(data);
@@ -1971,6 +1990,7 @@ _mouse_down_cb(void *data,
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
if (sd->disabled) return;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
sd->downx = ev->canvas.x;
@@ -2007,6 +2027,7 @@ _mouse_up_cb(void *data,
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
if (sd->disabled) return;
if (ev->button == 1)
{
@@ -2056,6 +2077,7 @@ _mouse_move_cb(void *data,
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
if (sd->disabled) return;
if (ev->buttons == 1)
{
@@ -2127,6 +2149,7 @@ _entry_changed_handle(void *data,
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
evas_event_freeze(evas_object_evas_get(data));
sd->changed = EINA_TRUE;
/* Reset the size hints which are no more relevant. Keep the
@@ -2197,14 +2220,14 @@ _entry_changed_user_signal_cb(void *data,
atspi_info.content = edje_info->change.insert.content;
atspi_info.pos = edje_info->change.insert.pos;
atspi_info.len = edje_info->change.insert.plain_length;
- efl_access_event_emit(EFL_ACCESS_MIXIN, data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_INSERTED, &atspi_info);
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_INSERTED, &atspi_info);
}
else if (edje_info && !edje_info->insert)
{
atspi_info.content = edje_info->change.del.content;
atspi_info.pos = MIN(edje_info->change.del.start, edje_info->change.del.end);
atspi_info.len = MAX(edje_info->change.del.start, edje_info->change.del.end) - atspi_info.pos;
- efl_access_event_emit(EFL_ACCESS_MIXIN, data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_REMOVED, &atspi_info);
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_REMOVED, &atspi_info);
}
}
}
@@ -2229,7 +2252,7 @@ _entry_preedit_changed_signal_cb(void *data,
atspi_info.content = text;
atspi_info.pos = edje_info->change.insert.pos;
atspi_info.len = edje_info->change.insert.plain_length;
- efl_access_event_emit(EFL_ACCESS_MIXIN,
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN,
data,
EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_INSERTED,
&atspi_info);
@@ -2293,13 +2316,15 @@ _entry_selection_none_signal_cb(void *data,
elm_entry_select_none(data);
}
-static inline Eina_Bool
-_entry_win_is_wl(Evas_Object *obj)
-{
- Evas_Object *win = _entry_win_get(obj);
- /* primary selection does not exist (yet) */
- return win && elm_win_wl_window_get(win);
-}
+// XXX: still try primary selection even if on wl in case it's
+// supported
+//static inline Eina_Bool
+//_entry_win_is_wl(Evas_Object *obj)
+//{
+// Evas_Object *win = _entry_win_get(obj);
+// /* primary selection does not exist (yet) */
+// return win && elm_win_wl_window_get(win);
+//}
static void
_entry_selection_changed_signal_cb(void *data,
@@ -2309,14 +2334,17 @@ _entry_selection_changed_signal_cb(void *data,
{
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
sd->have_selection = EINA_TRUE;
efl_event_callback_legacy_call
(data, EFL_UI_EVENT_SELECTION_CHANGED, NULL);
- if (!_entry_win_is_wl(data))
+ // XXX: still try primary selection even if on wl in case it's
+ // supported
+// if (!_entry_win_is_wl(data))
_selection_store(ELM_SEL_TYPE_PRIMARY, data);
_update_selection_handler(data);
if (_elm_config->atspi_mode)
- efl_access_event_emit(EFL_ACCESS_MIXIN, data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_SELECTION_CHANGED, NULL);
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_SELECTION_CHANGED, NULL);
}
static void
@@ -2327,12 +2355,15 @@ _entry_selection_cleared_signal_cb(void *data,
{
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
if (!sd->have_selection) return;
sd->have_selection = EINA_FALSE;
efl_event_callback_legacy_call
(data, EFL_UI_EVENT_SELECTION_CLEARED, NULL);
- if (!_entry_win_is_wl(data))
+ // XXX: still try primary selection even if on wl in case it's
+ // supported
+// if (!_entry_win_is_wl(data))
{
if (sd->cut_sel)
{
@@ -2361,11 +2392,14 @@ _entry_paste_request_signal_cb(void *data,
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
Elm_Sel_Type type = (emission[sizeof("ntry,paste,request,")] == '1') ?
ELM_SEL_TYPE_PRIMARY : ELM_SEL_TYPE_CLIPBOARD;
if (!sd->editable) return;
- if ((type == ELM_SEL_TYPE_PRIMARY) && _entry_win_is_wl(data)) return;
+ // XXX: still try primary selection even if on wl in case it's
+ // supported
+// if ((type == ELM_SEL_TYPE_PRIMARY) && _entry_win_is_wl(data)) return;
efl_event_callback_legacy_call
(data, EFL_UI_EVENT_SELECTION_PASTE, NULL);
@@ -2410,6 +2444,7 @@ _entry_cursor_changed_signal_cb(void *data,
const char *source EINA_UNUSED)
{
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
sd->cursor_pos = edje_object_part_text_cursor_pos_get
(sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN);
sd->cur_changed = EINA_TRUE;
@@ -2420,7 +2455,7 @@ _entry_cursor_changed_signal_cb(void *data,
efl_event_callback_legacy_call(data, ELM_ENTRY_EVENT_CURSOR_CHANGED, NULL);
if (_elm_config->atspi_mode)
- efl_access_event_emit(EFL_ACCESS_MIXIN, data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_CARET_MOVED, NULL);
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_CARET_MOVED, NULL);
}
static void
@@ -2432,7 +2467,7 @@ _entry_cursor_changed_manual_signal_cb(void *data,
efl_event_callback_legacy_call
(data, ELM_ENTRY_EVENT_CURSOR_CHANGED_MANUAL, NULL);
if (_elm_config->atspi_mode)
- efl_access_event_emit(EFL_ACCESS_MIXIN, data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_CARET_MOVED, NULL);
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_CARET_MOVED, NULL);
}
static void
@@ -2480,6 +2515,7 @@ _entry_anchor_down_signal_cb(void *data,
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
p = emission + sizeof("nchor,mouse,down,");
ei.button = strtol(p, &p2, 10);
ei.name = p2 + 1;
@@ -2503,6 +2539,7 @@ _entry_anchor_up_signal_cb(void *data,
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
p = emission + sizeof("nchor,mouse,up,");
ei.button = strtol(p, &p2, 10);
ei.name = p2 + 1;
@@ -2522,6 +2559,7 @@ _anchor_hover_del_cb(void *data,
{
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
ELM_SAFE_FREE(sd->anchor_hover.pop, evas_object_del);
evas_object_event_callback_del_full
(sd->anchor_hover.hover, EVAS_CALLBACK_DEL, _anchor_hover_del_cb, obj);
@@ -2543,6 +2581,7 @@ _entry_hover_anchor_clicked_do(Evas_Object *obj,
ELM_ENTRY_DATA_GET(obj, sd);
+ if (!sd) return;
if (sd->hoversel) return;
ei.anchor_info = info;
@@ -2622,6 +2661,7 @@ _entry_anchor_clicked_signal_cb(void *data,
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
p = emission + sizeof("nchor,mouse,clicked,");
ei.button = strtol(p, &p2, 10);
ei.name = p2 + 1;
@@ -2654,6 +2694,7 @@ _entry_anchor_in_signal_cb(void *data,
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
ei.name = emission + sizeof("nchor,mouse,in,");
ei.button = 0;
ei.x = ei.y = ei.w = ei.h = 0;
@@ -2674,6 +2715,7 @@ _entry_anchor_out_signal_cb(void *data,
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
ei.name = emission + sizeof("nchor,mouse,out,");
ei.button = 0;
ei.x = ei.y = ei.w = ei.h = 0;
@@ -2690,7 +2732,10 @@ _entry_key_enter_signal_cb(void *data,
const char *emission EINA_UNUSED,
const char *source EINA_UNUSED)
{
- efl_event_callback_legacy_call(data, ELM_ENTRY_EVENT_ACTIVATED, NULL);
+ ELM_ENTRY_DATA_GET(data, sd);
+
+ if (sd->single_line)
+ efl_event_callback_legacy_call(data, ELM_ENTRY_EVENT_ACTIVATED, NULL);
}
static void
@@ -2699,7 +2744,10 @@ _entry_key_escape_signal_cb(void *data,
const char *emission EINA_UNUSED,
const char *source EINA_UNUSED)
{
- efl_event_callback_legacy_call(data, ELM_ENTRY_EVENT_ABORTED, NULL);
+ ELM_ENTRY_DATA_GET(data, sd);
+
+ if (sd->single_line)
+ efl_event_callback_legacy_call(data, ELM_ENTRY_EVENT_ABORTED, NULL);
}
static void
@@ -2754,6 +2802,7 @@ _item_get(void *data,
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return NULL;
EINA_LIST_FOREACH(sd->item_providers, l, ip)
{
o = ip->func(ip->data, data, item);
@@ -2873,6 +2922,7 @@ _markup_filter_cb(void *data,
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
EINA_LIST_FOREACH(sd->markup_filters, l, tf)
{
tf->func(tf->data, data, text);
@@ -2891,6 +2941,7 @@ _text_append_idler(void *data)
ELM_ENTRY_DATA_GET(obj, sd);
+ if (!sd) return ECORE_CALLBACK_CANCEL;
evas_event_freeze(evas_object_evas_get(obj));
ELM_SAFE_FREE(sd->text, eina_stringshare_del);
sd->changed = EINA_TRUE;
@@ -3168,6 +3219,7 @@ _entry_text_append(Evas_Object* obj, const char* entry, Eina_Bool set)
if (!entry) return;
ELM_ENTRY_DATA_GET(obj, sd);
+ if (!sd) return;
len = strlen(entry);
if (sd->append_text_left)
@@ -3324,6 +3376,7 @@ _access_info_cb(void *data EINA_UNUSED, Evas_Object *obj)
ELM_ENTRY_DATA_GET(obj, sd);
+ if (!sd) return NULL;
if (sd->password) return NULL;
txt = elm_widget_access_info_get(obj);
@@ -3341,6 +3394,7 @@ _access_state_cb(void *data EINA_UNUSED, Evas_Object *obj)
ELM_ENTRY_DATA_GET(obj, sd);
+ if (!sd) return NULL;
ret = NULL;
buf = eina_strbuf_new();
@@ -3437,6 +3491,7 @@ _elm_entry_resize_internal(Evas_Object *obj)
{
ELM_ENTRY_DATA_GET(obj, sd);
+ if (!sd) return;
if (sd->line_wrap)
{
elm_layout_sizing_eval(obj);
@@ -3473,6 +3528,7 @@ _selection_handlers_offset_calc(Evas_Object *obj, Evas_Object *handler, Evas_Coo
ELM_ENTRY_DATA_GET(obj, sd);
+ if (!sd) return;
evas_object_geometry_get(sd->entry_edje, &ex, &ey, NULL, NULL);
edje_object_part_text_cursor_geometry_get(sd->entry_edje, "elm.text",
&cx, &cy, &cw, &ch);
@@ -3502,6 +3558,7 @@ _start_handler_mouse_down_cb(void *data,
{
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
Evas_Event_Mouse_Down *ev = event_info;
int start_pos, end_pos, main_pos, pos;
@@ -3536,6 +3593,7 @@ _start_handler_mouse_up_cb(void *data,
{
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
sd->start_handler_down = EINA_FALSE;
if (_elm_config->magnifier_enable)
_magnifier_hide(data);
@@ -3554,6 +3612,7 @@ _start_handler_mouse_move_cb(void *data,
{
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
if (!sd->start_handler_down) return;
Evas_Event_Mouse_Move *ev = event_info;
Evas_Coord ex, ey;
@@ -3585,6 +3644,7 @@ _end_handler_mouse_down_cb(void *data,
{
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
Evas_Event_Mouse_Down *ev = event_info;
int pos, start_pos, end_pos, main_pos;
@@ -3619,6 +3679,7 @@ _end_handler_mouse_up_cb(void *data,
{
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
sd->end_handler_down = EINA_FALSE;
if (_elm_config->magnifier_enable)
_magnifier_hide(data);
@@ -3637,6 +3698,7 @@ _end_handler_mouse_move_cb(void *data,
{
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
if (!sd->end_handler_down) return;
Evas_Event_Mouse_Move *ev = event_info;
Evas_Coord ex, ey;
@@ -3667,6 +3729,7 @@ _entry_on_size_evaluate_signal(void *data,
const char *source EINA_UNUSED)
{
ELM_ENTRY_DATA_GET(data, sd);
+ if (!sd) return;
sd->cur_changed = EINA_TRUE;
elm_entry_calc_force(data);
}
@@ -3955,13 +4018,13 @@ _elm_entry_efl_canvas_group_group_del(Eo *obj, Elm_Entry_Data *sd)
}
EOLIAN static void
-_elm_entry_efl_gfx_position_set(Eo *obj, Elm_Entry_Data *sd, Eina_Position2D pos)
+_elm_entry_efl_gfx_entity_position_set(Eo *obj, Elm_Entry_Data *sd, Eina_Position2D pos)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
- efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
- efl_gfx_position_set(sd->hit_rect, pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
+ efl_gfx_entity_position_set(sd->hit_rect, pos);
if (sd->hoversel) _hoversel_position(obj);
@@ -3970,25 +4033,25 @@ _elm_entry_efl_gfx_position_set(Eo *obj, Elm_Entry_Data *sd, Eina_Position2D pos
}
EOLIAN static void
-_elm_entry_efl_gfx_size_set(Eo *obj, Elm_Entry_Data *sd, Eina_Size2D sz)
+_elm_entry_efl_gfx_entity_size_set(Eo *obj, Elm_Entry_Data *sd, Eina_Size2D sz)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
- efl_gfx_size_set(sd->hit_rect, sz);
+ efl_gfx_entity_size_set(sd->hit_rect, sz);
if (sd->have_selection)
_update_selection_handler(obj);
- efl_gfx_size_set(efl_super(obj, MY_CLASS), sz);
+ efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
}
EOLIAN static void
-_elm_entry_efl_gfx_visible_set(Eo *obj, Elm_Entry_Data *sd, Eina_Bool vis)
+_elm_entry_efl_gfx_entity_visible_set(Eo *obj, Elm_Entry_Data *sd, Eina_Bool vis)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 0, vis))
return;
- efl_gfx_visible_set(efl_super(obj, MY_CLASS), vis);
+ efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), vis);
if (sd->have_selection)
{
@@ -4016,9 +4079,10 @@ elm_entry_add(Evas_Object *parent)
static void
_cb_added(void *data EINA_UNUSED, const Efl_Event *ev)
{
- const Efl_Callback_Array_Item *event = ev->info;
+ const Efl_Callback_Array_Item_Full *event = ev->info;
ELM_ENTRY_DATA_GET(ev->object, sd);
+ // XXX: BUG - not walking the array until a NULL entry
if (event->desc == ELM_ENTRY_EVENT_VALIDATE)
sd->validators++;
}
@@ -4026,9 +4090,10 @@ _cb_added(void *data EINA_UNUSED, const Efl_Event *ev)
static void
_cb_deleted(void *data EINA_UNUSED, const Efl_Event *ev)
{
- const Efl_Callback_Array_Item *event = ev->info;
+ const Efl_Callback_Array_Item_Full *event = ev->info;
ELM_ENTRY_DATA_GET(ev->object, sd);
+ // XXX: BUG - not walking the array until a NULL entry
if (event->desc == ELM_ENTRY_EVENT_VALIDATE)
sd->validators--;
return;
@@ -4041,7 +4106,7 @@ _elm_entry_efl_object_constructor(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED)
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_ENTRY);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_ENTRY);
efl_event_callback_add(obj, EFL_EVENT_CALLBACK_ADD, _cb_added, NULL);
efl_event_callback_add(obj, EFL_EVENT_CALLBACK_DEL, _cb_deleted, NULL);
@@ -4102,7 +4167,7 @@ _elm_entry_single_line_set(Eo *obj, Elm_Entry_Data *sd, Eina_Bool single_line)
}
EOLIAN static Eina_Bool
-_elm_entry_single_line_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_single_line_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
return sd->single_line;
}
@@ -4126,7 +4191,7 @@ _elm_entry_password_set(Eo *obj, Elm_Entry_Data *sd, Eina_Bool password)
sd->line_wrap = ELM_WRAP_NONE;
elm_entry_input_hint_set(obj, ((sd->input_hints & ~ELM_INPUT_HINT_AUTO_COMPLETE) | ELM_INPUT_HINT_SENSITIVE_DATA));
_entry_selection_callbacks_unregister(obj);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_PASSWORD_TEXT);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_PASSWORD_TEXT);
}
else
{
@@ -4139,19 +4204,25 @@ _elm_entry_password_set(Eo *obj, Elm_Entry_Data *sd, Eina_Bool password)
elm_entry_input_hint_set(obj, ((sd->input_hints | ELM_INPUT_HINT_AUTO_COMPLETE) & ~ELM_INPUT_HINT_SENSITIVE_DATA));
_entry_selection_callbacks_register(obj);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_ENTRY);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_ENTRY);
}
efl_ui_widget_theme_apply(obj);
}
EOLIAN static Eina_Bool
-_elm_entry_password_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_password_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
return sd->password;
}
EAPI void
+elm_entry_calc_force(Evas_Object *obj)
+{
+ efl_layout_calc_force(obj);
+}
+
+EAPI void
elm_entry_entry_set(Evas_Object *obj,
const char *entry)
{
@@ -4192,14 +4263,14 @@ _elm_entry_is_empty(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
}
EOLIAN static Evas_Object*
-_elm_entry_textblock_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_textblock_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
return (Evas_Object *)edje_object_part_object_get
(sd->entry_edje, "elm.text");
}
EOLIAN static void
-_elm_entry_calc_force(Eo *obj, Elm_Entry_Data *sd)
+_elm_entry_efl_layout_calc_calc_force(Eo *obj, Elm_Entry_Data *sd)
{
edje_object_calc_force(sd->entry_edje);
sd->changed = EINA_TRUE;
@@ -4207,7 +4278,7 @@ _elm_entry_calc_force(Eo *obj, Elm_Entry_Data *sd)
}
EOLIAN static const char*
-_elm_entry_selection_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_selection_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
if ((sd->password)) return NULL;
return edje_object_part_text_selection_get(sd->entry_edje, "elm.text");
@@ -4221,7 +4292,7 @@ _elm_entry_selection_handler_disabled_set(Eo *obj EINA_UNUSED, Elm_Entry_Data *s
}
EOLIAN static Eina_Bool
-_elm_entry_selection_handler_disabled_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_selection_handler_disabled_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
return sd->sel_handler_disabled;
}
@@ -4246,7 +4317,7 @@ _elm_entry_line_wrap_set(Eo *obj, Elm_Entry_Data *sd, Elm_Wrap_Type wrap)
}
EOLIAN static Elm_Wrap_Type
-_elm_entry_line_wrap_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_line_wrap_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
return sd->line_wrap;
}
@@ -4282,7 +4353,7 @@ _elm_entry_editable_set(Eo *obj, Elm_Entry_Data *sd, Eina_Bool editable)
}
EOLIAN static Eina_Bool
-_elm_entry_editable_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_editable_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
return sd->editable;
}
@@ -4351,7 +4422,7 @@ _elm_entry_select_region_set(Eo *obj, Elm_Entry_Data *sd, int start, int end)
}
EOLIAN static void
-_elm_entry_select_region_get(Eo *obj, Elm_Entry_Data *sd, int *start, int *end)
+_elm_entry_select_region_get(const Eo *obj, Elm_Entry_Data *sd, int *start, int *end)
{
if (!elm_entry_selection_get(obj))
{
@@ -4367,7 +4438,7 @@ _elm_entry_select_region_get(Eo *obj, Elm_Entry_Data *sd, int *start, int *end)
}
EOLIAN static Eina_Bool
-_elm_entry_cursor_geometry_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
+_elm_entry_textblock_cursor_geometry_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
{
edje_object_part_text_cursor_geometry_get
(sd->entry_edje, "elm.text", x, y, w, h);
@@ -4443,21 +4514,21 @@ _elm_entry_cursor_selection_end(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
}
EOLIAN static Eina_Bool
-_elm_entry_cursor_is_format_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_cursor_is_format_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
return edje_object_part_text_cursor_is_format_get
(sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN);
}
EOLIAN static Eina_Bool
-_elm_entry_cursor_is_visible_format_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_cursor_is_visible_format_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
return edje_object_part_text_cursor_is_visible_format_get
(sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN);
}
EOLIAN static char*
-_elm_entry_cursor_content_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_textblock_cursor_content_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
return edje_object_part_text_cursor_content_get
(sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN);
@@ -4472,7 +4543,7 @@ _elm_entry_cursor_pos_set(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, int pos)
}
EOLIAN static int
-_elm_entry_cursor_pos_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_cursor_pos_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
return edje_object_part_text_cursor_pos_get
(sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN);
@@ -4538,7 +4609,7 @@ _elm_entry_context_menu_disabled_set(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, Ei
}
EOLIAN static Eina_Bool
-_elm_entry_context_menu_disabled_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_context_menu_disabled_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
return !sd->context_menu;
}
@@ -4898,7 +4969,7 @@ elm_entry_file_get(const Evas_Object *obj, const char **file, Elm_Text_Format *f
}
EOLIAN static void
-_elm_entry_efl_file_file_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, const char **file, const char **group)
+_elm_entry_efl_file_file_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, const char **file, const char **group)
{
if (file) *file = sd->file;
if (group) *group = NULL;
@@ -4920,7 +4991,7 @@ _elm_entry_autosave_set(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, Eina_Bool auto_
}
EOLIAN static Eina_Bool
-_elm_entry_autosave_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_autosave_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
return sd->auto_save;
}
@@ -4973,7 +5044,7 @@ _elm_entry_cnp_mode_set(Eo *obj, Elm_Entry_Data *sd, Elm_Cnp_Mode cnp_mode)
}
EOLIAN static Elm_Cnp_Mode
-_elm_entry_cnp_mode_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_cnp_mode_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
return sd->cnp_mode;
}
@@ -5064,7 +5135,7 @@ _elm_entry_scrollable_set(Eo *obj, Elm_Entry_Data *sd, Eina_Bool scroll)
}
EOLIAN static Eina_Bool
-_elm_entry_scrollable_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_scrollable_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
return sd->scroll;
}
@@ -5165,7 +5236,7 @@ _elm_entry_input_panel_layout_set(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, Elm_I
}
EOLIAN static Elm_Input_Panel_Layout
-_elm_entry_input_panel_layout_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_input_panel_layout_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
return sd->input_panel_layout;
}
@@ -5184,7 +5255,7 @@ _elm_entry_input_panel_layout_variation_set(Eo *obj EINA_UNUSED, Elm_Entry_Data
}
EOLIAN static int
-_elm_entry_input_panel_layout_variation_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_input_panel_layout_variation_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
return sd->input_panel_layout_variation;
}
@@ -5198,7 +5269,7 @@ _elm_entry_autocapital_type_set(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, Elm_Aut
}
EOLIAN static Elm_Autocapital_Type
-_elm_entry_autocapital_type_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_autocapital_type_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
return sd->autocapital_type;
}
@@ -5212,7 +5283,7 @@ _elm_entry_prediction_allow_set(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, Eina_Bo
}
EOLIAN static Eina_Bool
-_elm_entry_prediction_allow_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_prediction_allow_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
return sd->prediction_allow;
}
@@ -5227,7 +5298,7 @@ _elm_entry_input_hint_set(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, Elm_Input_Hin
}
EOLIAN static Elm_Input_Hints
-_elm_entry_input_hint_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_input_hint_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
return sd->input_hints;
}
@@ -5244,6 +5315,20 @@ _elm_entry_prediction_hint_set(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, const ch
(sd->entry_edje, "elm.text", prediction_hint);
}
+EOLIAN static Eina_Bool
+_elm_entry_prediction_hint_hash_set(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, const char *key, const char *value)
+{
+ return edje_object_part_text_prediction_hint_hash_set
+ (sd->entry_edje, "elm.text", key, value);
+}
+
+EOLIAN static Eina_Bool
+_elm_entry_prediction_hint_hash_del(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, const char *key)
+{
+ return edje_object_part_text_prediction_hint_hash_del
+ (sd->entry_edje, "elm.text", key);
+}
+
EOLIAN static void
_elm_entry_imf_context_reset(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
@@ -5259,7 +5344,7 @@ _elm_entry_input_panel_enabled_set(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, Eina
}
EOLIAN static Eina_Bool
-_elm_entry_input_panel_enabled_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_input_panel_enabled_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
return sd->input_panel_enable;
}
@@ -5286,7 +5371,7 @@ _elm_entry_input_panel_language_set(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, Elm
}
EOLIAN static Elm_Input_Panel_Lang
-_elm_entry_input_panel_language_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_input_panel_language_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
return sd->input_panel_lang;
}
@@ -5322,7 +5407,7 @@ _elm_entry_input_panel_return_key_type_set(Eo *obj EINA_UNUSED, Elm_Entry_Data *
}
EOLIAN static Elm_Input_Panel_Return_Key_Type
-_elm_entry_input_panel_return_key_type_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_input_panel_return_key_type_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
return sd->input_panel_return_key_type;
}
@@ -5337,7 +5422,7 @@ _elm_entry_input_panel_return_key_disabled_set(Eo *obj EINA_UNUSED, Elm_Entry_Da
}
EOLIAN static Eina_Bool
-_elm_entry_input_panel_return_key_disabled_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_input_panel_return_key_disabled_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
return sd->input_panel_return_key_disabled;
}
@@ -5359,13 +5444,13 @@ _elm_entry_input_panel_show_on_demand_set(Eo *obj EINA_UNUSED, Elm_Entry_Data *s
}
EOLIAN static Eina_Bool
-_elm_entry_input_panel_show_on_demand_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_input_panel_show_on_demand_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
return sd->input_panel_show_on_demand;
}
EOLIAN static void*
-_elm_entry_imf_context_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_imf_context_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
if (!sd) return NULL;
@@ -5399,7 +5484,7 @@ _elm_entry_anchor_hover_parent_set(Eo *obj, Elm_Entry_Data *sd, Evas_Object *par
}
EOLIAN static Evas_Object*
-_elm_entry_anchor_hover_parent_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_anchor_hover_parent_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
return sd->anchor_hover.hover_parent;
}
@@ -5411,7 +5496,7 @@ _elm_entry_anchor_hover_style_set(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, const
}
EOLIAN static const char*
-_elm_entry_anchor_hover_style_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_anchor_hover_style_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
return sd->anchor_hover.hover_style;
}
@@ -5440,7 +5525,7 @@ _activate(Evas_Object *obj)
}
EOLIAN static Eina_Bool
-_elm_entry_elm_widget_on_access_activate(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, Efl_Ui_Activate act)
+_elm_entry_efl_ui_widget_on_access_activate(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, Efl_Ui_Activate act)
{
if (act != EFL_UI_ACTIVATE_DEFAULT) return EINA_FALSE;
_activate(obj);
@@ -5458,7 +5543,7 @@ _elm_entry_select_allow_set(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, Eina_Bool a
}
EOLIAN static Eina_Bool
-_elm_entry_select_allow_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_select_allow_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
return sd->sel_allow;
}
@@ -5472,7 +5557,7 @@ _elm_entry_class_constructor(Efl_Class *klass)
// ATSPI Accessibility
EOLIAN static Eina_Unicode
-_elm_entry_efl_access_text_character_get(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, int offset)
+_elm_entry_efl_access_text_character_get(const Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, int offset)
{
char *txt;
int idx = 0;
@@ -5494,7 +5579,7 @@ _elm_entry_efl_access_text_character_get(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSE
}
EOLIAN static int
-_elm_entry_efl_access_text_character_count_get(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED)
+_elm_entry_efl_access_text_character_count_get(const Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED)
{
char *txt;
int ret = -1;
@@ -5509,7 +5594,7 @@ _elm_entry_efl_access_text_character_count_get(Eo *obj, Elm_Entry_Data *_pd EINA
}
EOLIAN static char*
-_elm_entry_efl_access_text_string_get(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, Efl_Access_Text_Granularity granularity, int *start_offset, int *end_offset)
+_elm_entry_efl_access_text_string_get(const Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, Efl_Access_Text_Granularity granularity, int *start_offset, int *end_offset)
{
Evas_Textblock_Cursor *cur = NULL, *cur2 = NULL;
Evas_Object *tblk;
@@ -5594,7 +5679,7 @@ fail:
}
EOLIAN static char*
-_elm_entry_efl_access_text_text_get(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, int start_offset, int end_offset)
+_elm_entry_efl_access_text_access_text_get(const Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, int start_offset, int end_offset)
{
Evas_Textblock_Cursor *cur = NULL, *cur2 = NULL;
Evas_Object *tblk;
@@ -5634,7 +5719,7 @@ fail:
}
EOLIAN static int
-_elm_entry_efl_access_text_caret_offset_get(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED)
+_elm_entry_efl_access_text_caret_offset_get(const Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED)
{
return elm_entry_cursor_pos_get(obj);
}
@@ -5647,13 +5732,13 @@ _elm_entry_efl_access_text_caret_offset_set(Eo *obj, Elm_Entry_Data *_pd EINA_UN
}
EOLIAN static int
-_elm_entry_efl_access_text_selections_count_get(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED)
+_elm_entry_efl_access_text_selections_count_get(const Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED)
{
return elm_entry_selection_get(obj) ? 1 : 0;
}
EOLIAN static void
-_elm_entry_efl_access_text_selection_get(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, int selection_number, int *start_offset, int *end_offset)
+_elm_entry_efl_access_text_access_selection_get(const Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, int selection_number, int *start_offset, int *end_offset)
{
if (selection_number != 0) return;
@@ -5661,7 +5746,7 @@ _elm_entry_efl_access_text_selection_get(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSE
}
EOLIAN static Eina_Bool
-_elm_entry_efl_access_text_selection_set(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, int selection_number, int start_offset, int end_offset)
+_elm_entry_efl_access_text_access_selection_set(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, int selection_number, int start_offset, int end_offset)
{
if (selection_number != 0) return EINA_FALSE;
@@ -5687,13 +5772,13 @@ _elm_entry_efl_access_text_selection_add(Eo *obj, Elm_Entry_Data *pd EINA_UNUSED
}
EOLIAN static Eina_List*
-_elm_entry_efl_access_text_bounded_ranges_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *_pd EINA_UNUSED, Eina_Bool screen_coods EINA_UNUSED, Eina_Rect rect EINA_UNUSED, Efl_Access_Text_Clip_Type xclip EINA_UNUSED, Efl_Access_Text_Clip_Type yclip EINA_UNUSED)
+_elm_entry_efl_access_text_bounded_ranges_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *_pd EINA_UNUSED, Eina_Bool screen_coods EINA_UNUSED, Eina_Rect rect EINA_UNUSED, Efl_Access_Text_Clip_Type xclip EINA_UNUSED, Efl_Access_Text_Clip_Type yclip EINA_UNUSED)
{
return NULL;
}
EOLIAN static int
-_elm_entry_efl_access_text_offset_at_point_get(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, Eina_Bool screen_coods, int x, int y)
+_elm_entry_efl_access_text_offset_at_point_get(const Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, Eina_Bool screen_coods, int x, int y)
{
Evas_Object *txtblk;
Evas_Textblock_Cursor *cur;
@@ -5727,7 +5812,7 @@ _elm_entry_efl_access_text_offset_at_point_get(Eo *obj, Elm_Entry_Data *_pd EINA
}
EOLIAN static Eina_Bool
-_elm_entry_efl_access_text_character_extents_get(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, int offset, Eina_Bool screen_coods, Eina_Rect *rect)
+_elm_entry_efl_access_text_character_extents_get(const Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, int offset, Eina_Bool screen_coods, Eina_Rect *rect)
{
Evas_Object *txtblk;
Evas_Textblock_Cursor *cur;
@@ -5759,7 +5844,7 @@ _elm_entry_efl_access_text_character_extents_get(Eo *obj, Elm_Entry_Data *_pd EI
}
EOLIAN static Eina_Bool
-_elm_entry_efl_access_text_range_extents_get(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, Eina_Bool screen_coods, int start_offset, int end_offset, Eina_Rect *rect)
+_elm_entry_efl_access_text_range_extents_get(const Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, Eina_Bool screen_coods, int start_offset, int end_offset, Eina_Rect *rect)
{
Evas_Object *txtblk;
Evas_Textblock_Cursor *cur1, *cur2;
@@ -5837,7 +5922,7 @@ _textblock_node_format_to_atspi_text_attr(const Evas_Object_Textblock_Node_Forma
}
EOLIAN static Eina_Bool
-_elm_entry_efl_access_text_attribute_get(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, const char *attr_name EINA_UNUSED, int *start_offset, int *end_offset, char **value)
+_elm_entry_efl_access_text_attribute_get(const Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, const char *attr_name EINA_UNUSED, int *start_offset, int *end_offset, char **value)
{
Evas_Object *txtblk;
Evas_Textblock_Cursor *cur1, *cur2;
@@ -5885,7 +5970,7 @@ _elm_entry_efl_access_text_attribute_get(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSE
}
EOLIAN static Eina_List*
-_elm_entry_efl_access_text_attributes_get(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, int *start_offset, int *end_offset)
+_elm_entry_efl_access_text_text_attributes_get(const Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, int *start_offset, int *end_offset)
{
Evas_Object *txtblk;
Evas_Textblock_Cursor *cur1, *cur2;
@@ -5927,7 +6012,7 @@ _elm_entry_efl_access_text_attributes_get(Eo *obj, Elm_Entry_Data *_pd EINA_UNUS
}
EOLIAN static Eina_List*
-_elm_entry_efl_access_text_default_attributes_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *_pd EINA_UNUSED)
+_elm_entry_efl_access_text_default_attributes_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *_pd EINA_UNUSED)
{
Evas_Object *txtblk;
Eina_List *ret = NULL;
@@ -5952,7 +6037,7 @@ _elm_entry_efl_access_text_default_attributes_get(Eo *obj EINA_UNUSED, Elm_Entry
}
EOLIAN static Eina_Bool
-_elm_entry_efl_access_editable_text_content_set(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, const char *content)
+_elm_entry_efl_access_editable_text_text_content_set(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, const char *content)
{
elm_entry_entry_set(obj, content);
return EINA_TRUE;
@@ -6025,10 +6110,10 @@ _elm_entry_efl_access_editable_text_cut(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED
}
EOLIAN static Efl_Access_State_Set
-_elm_entry_efl_access_state_set_get(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED)
+_elm_entry_efl_access_object_state_set_get(const Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED)
{
Efl_Access_State_Set ret;
- ret = efl_access_state_set_get(efl_super(obj, ELM_ENTRY_CLASS));
+ ret = efl_access_object_state_set_get(efl_super(obj, ELM_ENTRY_CLASS));
if (elm_entry_editable_get(obj))
STATE_TYPE_SET(ret, EFL_ACCESS_STATE_EDITABLE);
@@ -6037,10 +6122,10 @@ _elm_entry_efl_access_state_set_get(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED)
}
EOLIAN static const char*
-_elm_entry_efl_access_name_get(Eo *obj, Elm_Entry_Data *sd)
+_elm_entry_efl_access_object_i18n_name_get(const Eo *obj, Elm_Entry_Data *sd)
{
const char *name;
- name = efl_access_name_get(efl_super(obj, ELM_ENTRY_CLASS));
+ name = efl_access_object_i18n_name_get(efl_super(obj, ELM_ENTRY_CLASS));
if (name && strncmp("", name, 1)) return name;
if (sd->password) return NULL;
@@ -6060,7 +6145,7 @@ _action_activate(Evas_Object *obj, const char *params EINA_UNUSED)
}
EOLIAN const Efl_Access_Action_Data *
-_elm_entry_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd EINA_UNUSED)
+_elm_entry_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "activate", "activate", NULL, _action_activate },
@@ -6069,6 +6154,15 @@ _elm_entry_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Ent
return &atspi_actions[0];
}
+EOLIAN static Efl_Ui_Focus_Manager*
+_elm_entry_efl_ui_widget_focus_manager_focus_manager_create(Eo *obj, Elm_Entry_Data *pd EINA_UNUSED, Efl_Ui_Focus_Object *root)
+{
+ return efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, obj,
+ efl_ui_focus_manager_root_set(efl_added, root)
+ );
+}
+
+
/* Efl.Part begin */
ELM_PART_OVERRIDE(elm_entry, ELM_ENTRY, Elm_Entry_Data)
diff --git a/src/lib/elementary/elm_entry.eo b/src/lib/elementary/elm_entry.eo
index a6015a97a3..7d98befedf 100644
--- a/src/lib/elementary/elm_entry.eo
+++ b/src/lib/elementary/elm_entry.eo
@@ -3,9 +3,10 @@ import elm_general;
type Elm_Entry_Item_Provider_Cb: __undefined_type; [[Elementary entry item provider callback type]]
type Elm_Entry_Filter_Cb: __undefined_type; [[Elementary entry filter callback type]]
-class Elm.Entry (Efl.Ui.Layout, Elm.Interface_Scrollable, Efl.Ui.Clickable,
+class Elm.Entry (Efl.Ui.Layout.Object, Elm.Interface_Scrollable, Efl.Ui.Clickable,
Efl.Access.Text, Efl.Access.Editable.Text, Efl.File,
- Efl.Ui.Selectable, Efl.Ui.Scrollable, Efl.Access.Widget.Action)
+ Efl.Ui.Selectable, Efl.Ui.Scrollable, Efl.Access.Widget.Action,
+ Efl.Ui.Legacy)
{
[[Elementary entry class]]
legacy_prefix: elm_entry;
@@ -469,7 +470,7 @@ class Elm.Entry (Efl.Ui.Layout, Elm.Interface_Scrollable, Efl.Ui.Clickable,
return: Efl.Canvas.Object; [[Textblock object]]
}
}
- @property cursor_geometry {
+ @property textblock_cursor_geometry {
get {
[[This function returns the geometry of the cursor.
@@ -477,6 +478,7 @@ class Elm.Entry (Efl.Ui.Layout, Elm.Interface_Scrollable, Efl.Ui.Clickable,
or for example in the case of scrolled entry where you want to show the
cursor.
]]
+ legacy: elm_entry_cursor_geometry_get;
return: bool; [[$true on success, $false otherwise]]
}
values {
@@ -511,7 +513,7 @@ class Elm.Entry (Efl.Ui.Layout, Elm.Interface_Scrollable, Efl.Ui.Clickable,
return: bool; [[$true if format node exists, $false otherwise]]
}
}
- @property cursor_content {
+ @property textblock_cursor_content {
get {
[[Get the character pointed by the cursor at its current position.
@@ -520,6 +522,7 @@ class Elm.Entry (Efl.Ui.Layout, Elm.Interface_Scrollable, Efl.Ui.Clickable,
Only the text is returned, any format that may exist will not be part
of the return value. You must free the string when done with \@ref free.
]]
+ legacy: elm_entry_cursor_content_get;
return: mstring @owned @warn_unused; [[Character]]
}
}
@@ -590,13 +593,6 @@ class Elm.Entry (Efl.Ui.Layout, Elm.Interface_Scrollable, Efl.Ui.Clickable,
This will typically cause the Input Method Context to clear the preedit state.
]]
}
- calc_force {
- [[Forces calculation of the entry size and text layouting.
-
- This should be used after modifying the textblock object directly. See
- @.textblock.get for more information.
- ]]
- }
anchor_hover_end {
[[Ends the hover popup in the entry
@@ -834,31 +830,54 @@ class Elm.Entry (Efl.Ui.Layout, Elm.Interface_Scrollable, Efl.Ui.Clickable,
prediction_hint: string; [[The prediction hint text.]]
}
}
+ prediction_hint_hash_set {
+ [[Sets the prediction hint data at the specified key.
+
+ @since 1.21
+ ]]
+ return: bool; [[$true on success, $false otherwise]]
+ params {
+ key: string; [[The key of the prediction hint.]]
+ value: string; [[The data to replace.]]
+ }
+ }
+ prediction_hint_hash_del {
+ [[Removes the prediction hint data identified by a key.
+
+ @since 1.21
+ ]]
+ return: bool; [[$true on success, $false otherwise]]
+ params {
+ key: string; [[The key of the prediction hint.]]
+ }
+ }
}
implements {
class.constructor;
Efl.Object.constructor;
- Efl.Gfx.visible { set; }
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set; }
+ Efl.Gfx.Entity.visible { set; }
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
Efl.Canvas.Group.group_member_add;
Efl.Layout.Signal.signal_callback_add;
Efl.Layout.Signal.signal_callback_del;
Efl.Layout.Signal.signal_emit;
- Elm.Widget.on_access_activate;
- Elm.Widget.theme_apply;
- Elm.Widget.on_focus_update;
- Elm.Widget.interest_region { get; }
- Elm.Widget.on_disabled_update;
- Elm.Widget.widget_sub_object_del;
+ Efl.Layout.Calc.calc_force;
+ Efl.Ui.Widget.on_access_activate;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget_Focus_Manager.focus_manager_create;
+ Efl.Ui.Focus.Object.on_focus_update;
+ Efl.Ui.Widget.interest_region { get; }
+ Efl.Ui.Widget.on_disabled_update;
+ Efl.Ui.Widget.widget_sub_object_del;
Elm.Interface_Scrollable.policy { set; }
Elm.Interface_Scrollable.bounce_allow { set; }
- Efl.Access.state_set { get; }
- Efl.Access.name { get; }
- Efl.Access.Text.text { get; }
+ Efl.Access.Object.state_set { get; }
+ Efl.Access.Object.i18n_name { get; }
+ Efl.Access.Text.access_text { get; }
Efl.Access.Text.string { get; }
Efl.Access.Text.attribute { get; }
- Efl.Access.Text.attributes { get; }
+ Efl.Access.Text.text_attributes { get; }
Efl.Access.Text.default_attributes { get; }
Efl.Access.Text.caret_offset { get; set; }
Efl.Access.Text.character { get; }
@@ -867,11 +886,11 @@ class Elm.Entry (Efl.Ui.Layout, Elm.Interface_Scrollable, Efl.Ui.Clickable,
Efl.Access.Text.offset_at_point { get; }
Efl.Access.Text.bounded_ranges { get; }
Efl.Access.Text.range_extents { get; }
- Efl.Access.Text.selection { get; set; }
+ Efl.Access.Text.access_selection { get; set; }
Efl.Access.Text.selections_count { get; }
Efl.Access.Text.selection_add;
Efl.Access.Text.selection_remove;
- Efl.Access.Editable.Text.content { set; }
+ Efl.Access.Editable.Text.text_content { set; }
Efl.Access.Editable.Text.insert;
Efl.Access.Editable.Text.copy;
Efl.Access.Editable.Text.cut;
@@ -879,29 +898,30 @@ class Elm.Entry (Efl.Ui.Layout, Elm.Interface_Scrollable, Efl.Ui.Clickable,
Efl.Access.Editable.Text.paste;
Efl.Access.Widget.Action.elm_actions { get; }
Efl.File.file { get; set; }
- Efl.Part.part;
+ Efl.Part.part_get;
}
events {
- activated; [[Called when entry got activated]]
- changed; [[Called when entry changed]]
- changed,user; [[Called when the object changed due to user interaction]]
- validate; [[Called when validating]]
- context,open; [[Called when context menu was opened]]
- anchor,clicked; [[Called when anchor was clicked]]
- rejected; [[Called when entry was rejected]]
- maxlength,reached; [[Called when maximum entry length has been reached]]
- preedit,changed; [[Called when entry preedit changed]]
- press; [[Called when entry pressed]]
- redo,request; [[Called when redo was requested]]
- undo,request; [[Called when undo was requested]]
- text,set,done; [[Called when text set finished]]
- aborted; [[Called when entry was aborted]]
- anchor,down; [[Called on anchor down]]
- anchor,hover,opened; [[Called when hover opened]]
- anchor,in; [[Called on anchor in]]
- anchor,out; [[Called on anchor out]]
- anchor,up; [[called on anchor up]]
- cursor,changed; [[Called on cursor changed]]
- cursor,changed,manual; [[Called on manual cursor change]]
+ activated: void; [[Called when entry got activated]]
+ changed: void; [[Called when entry changed]]
+ /* FIXME: Canm be NULL but @nullable does not work on events */
+ changed,user: Elm.Entry_Change_Info; [[Called when the object changed due to user interaction]]
+ validate: Elm.Validate_Content; [[Called when validating]]
+ context,open: void; [[Called when context menu was opened]]
+ anchor,clicked: Elm.Entry_Anchor_Info; [[Called when anchor was clicked]]
+ rejected: void; [[Called when entry was rejected]]
+ maxlength,reached: void; [[Called when maximum entry length has been reached]]
+ preedit,changed: void; [[Called when entry preedit changed]]
+ press: void; [[Called when entry pressed]]
+ redo,request: void; [[Called when redo was requested]]
+ undo,request: void; [[Called when undo was requested]]
+ text,set,done: void; [[Called when text set finished]]
+ aborted: void; [[Called when entry was aborted]]
+ anchor,down: Elm.Entry_Anchor_Info; [[Called on anchor down]]
+ anchor,hover,opened: Elm.Entry_Anchor_Hover_Info; [[Called when hover opened]]
+ anchor,in: Elm.Entry_Anchor_Info; [[Called on anchor in]]
+ anchor,out: Elm.Entry_Anchor_Info; [[Called on anchor out]]
+ anchor,up: Elm.Entry_Anchor_Info; [[called on anchor up]]
+ cursor,changed: void; [[Called on cursor changed]]
+ cursor,changed,manual: void; [[Called on manual cursor change]]
}
}
diff --git a/src/lib/elementary/elm_entry.h b/src/lib/elementary/elm_entry.h
index 861ca6e331..2bb08bd52b 100644
--- a/src/lib/elementary/elm_entry.h
+++ b/src/lib/elementary/elm_entry.h
@@ -274,7 +274,6 @@
* @li "theme,changed": Called when the theme is changed.
* @li "undo,request": Called on undo request.
* @li "rejected": Called when some of inputs are rejected by the filter. (since 1.9)
- * @li "validate": Called when entry text ready to validate. (since 1.14)
*
* Default content parts of the entry items that you can use for are:
* @li "icon" - An icon in the entry
diff --git a/src/lib/elementary/elm_entry_legacy.h b/src/lib/elementary/elm_entry_legacy.h
index ef10268c3f..7e54218d07 100644
--- a/src/lib/elementary/elm_entry_legacy.h
+++ b/src/lib/elementary/elm_entry_legacy.h
@@ -73,3 +73,15 @@ EAPI Eina_Bool elm_entry_file_set(Evas_Object *obj, const char *file, E
* @param[out] format The file format
*/
EAPI void elm_entry_file_get(const Evas_Object *obj, const char **file, Elm_Text_Format *format);
+
+
+/**
+ * @brief Forces calculation of the entry size and text layouting.
+ *
+ * This should be used after modifying the textblock object directly. See
+ * @ref elm_entry_textblock_get for more information.
+ * @param[in] obj The object.
+ *
+ * @ingroup Elm_Entry
+ */
+EAPI void elm_entry_calc_force(Evas_Object *obj);
diff --git a/src/lib/elementary/elm_fileselector.eo b/src/lib/elementary/elm_fileselector.eo
index ea97c274f4..5ebf4d0a9d 100644
--- a/src/lib/elementary/elm_fileselector.eo
+++ b/src/lib/elementary/elm_fileselector.eo
@@ -1,6 +1,6 @@
-class Elm.Fileselector (Efl.Ui.Layout, Elm.Interface.Fileselector,
- Efl.Access.Widget.Action,
- Efl.Ui.Clickable, Efl.Ui.Selectable)
+class Elm.Fileselector (Efl.Ui.Layout.Object, Elm.Interface.Fileselector,
+ Efl.Access.Widget.Action, Efl.Ui.Focus.Composition,
+ Efl.Ui.Clickable, Efl.Ui.Selectable, Efl.Ui.Legacy)
{
[[Elementary fileselector class]]
legacy_prefix: elm_fileselector;
@@ -35,12 +35,10 @@ class Elm.Fileselector (Efl.Ui.Layout, Elm.Interface.Fileselector,
class.constructor;
class.destructor;
Efl.Object.constructor;
- Elm.Widget.widget_event;
- Elm.Widget.theme_apply;
- Elm.Widget.focus_state_apply;
+ Efl.Ui.Widget.widget_event;
+ Efl.Ui.Widget.theme_apply;
Elm.Interface.Fileselector.selected_models { get; }
- Elm.Interface.Fileselector.selected_model_get;
- Elm.Interface.Fileselector.selected_model_set;
+ Elm.Interface.Fileselector.selected_model { get; set; }
Elm.Interface.Fileselector.custom_filter_append;
Elm.Interface.Fileselector.expandable { get; set; }
Elm.Interface.Fileselector.thumbnail_size { get; set; }
@@ -48,19 +46,20 @@ class Elm.Fileselector (Efl.Ui.Layout, Elm.Interface.Fileselector,
Elm.Interface.Fileselector.hidden_visible { get; set; }
Elm.Interface.Fileselector.filters_clear;
Elm.Interface.Fileselector.is_save { get; set; }
- Elm.Interface.Fileselector.model { get; set; }
+ Efl.Ui.View.model { get; set; }
Elm.Interface.Fileselector.sort_method { get; set; }
Elm.Interface.Fileselector.multi_select { get; set; }
Elm.Interface.Fileselector.folder_only { get; set; }
Elm.Interface.Fileselector.mode { get; set; }
Elm.Interface.Fileselector.current_name { get; set; }
Efl.Access.Widget.Action.elm_actions { get; }
- Efl.Part.part;
+ Efl.Part.part_get;
}
events {
- done; [[Called when OK button was pressed]]
- activated; [[Called when the filesector was activated]]
- selected,invalid; [[Called when fileselector was selected]]
- directory,open; [[Called when a directory was opened]]
+ done: string; [[Called when OK button was pressed]]
+ /* FIXME: For all three events below, event_info can either be a string or an Efl.Model */
+ activated: void; [[Called when the filesector was activated]]
+ selected,invalid: void; [[Called when fileselector was selected]]
+ directory,open: void; [[Called when a directory was opened]]
}
}
diff --git a/src/lib/elementary/elm_fileselector_button.eo b/src/lib/elementary/elm_fileselector_button.eo
index 5cfcb544bc..579ed656b5 100644
--- a/src/lib/elementary/elm_fileselector_button.eo
+++ b/src/lib/elementary/elm_fileselector_button.eo
@@ -1,25 +1,26 @@
-class Elm.Fileselector_Button (Efl.Ui.Button, Elm.Interface.Fileselector)
+class Elm.Fileselector_Button (Efl.Ui.Button, Elm.Interface.Fileselector,
+ Efl.Ui.Legacy)
{
[[Elementary fileselector button class]]
event_prefix: elm_fileselector_button;
implements {
Efl.Object.constructor;
- Elm.Widget.theme_apply;
+ Efl.Ui.Widget.theme_apply;
Efl.Ui.Autorepeat.autorepeat_supported { get; }
Elm.Interface.Fileselector.selected_models { get; }
Elm.Interface.Fileselector.expandable { get; set; }
Elm.Interface.Fileselector.thumbnail_size { get; set; }
- Elm.Interface.Fileselector.selected_model_get;
- Elm.Interface.Fileselector.selected_model_set;
+ Elm.Interface.Fileselector.selected_model { get; set; }
Elm.Interface.Fileselector.hidden_visible { get; set; }
Elm.Interface.Fileselector.is_save { get; set; }
- Elm.Interface.Fileselector.model { get; set; }
+ Efl.Ui.View.model { get; set; }
Elm.Interface.Fileselector.sort_method { get; set; }
Elm.Interface.Fileselector.multi_select { get; set; }
Elm.Interface.Fileselector.folder_only { get; set; }
Elm.Interface.Fileselector.mode { get; set; }
}
events {
- file,chosen; [[Called when a file was chosen in the fileselector]]
+ /* FIXME: Can be Efl.Model, string and NULL */
+ file,chosen: void; [[Called when a file was chosen in the fileselector]]
}
}
diff --git a/src/lib/elementary/elm_fileselector_entry.eo b/src/lib/elementary/elm_fileselector_entry.eo
index df857f241e..4e5a6a8002 100644
--- a/src/lib/elementary/elm_fileselector_entry.eo
+++ b/src/lib/elementary/elm_fileselector_entry.eo
@@ -1,25 +1,25 @@
-class Elm.Fileselector_Entry (Efl.Ui.Layout, Elm.Interface.Fileselector,
- Efl.Ui.Clickable, Efl.Ui.Selectable)
+class Elm.Fileselector_Entry (Efl.Ui.Layout.Object, Elm.Interface.Fileselector,
+ Efl.Ui.Clickable, Efl.Ui.Selectable, Efl.Ui.Legacy)
{
[[Elementary fileselector entry class]]
event_prefix: elm_fileselector_entry;
implements {
class.constructor;
Efl.Object.constructor;
- Elm.Widget.theme_apply;
- Elm.Widget.on_disabled_update;
- Elm.Interface.Fileselector.selected_model_get;
- Elm.Interface.Fileselector.selected_model_set;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.on_disabled_update;
+ Elm.Interface.Fileselector.selected_model { get; set; }
Elm.Interface.Fileselector.folder_only { get; set; }
Elm.Interface.Fileselector.is_save { get; set; }
- Elm.Interface.Fileselector.model { get; set; }
+ Efl.Ui.View.model { get; set; }
Elm.Interface.Fileselector.expandable { get; set; }
- Efl.Part.part;
+ Efl.Part.part_get;
}
events {
- changed; [[Called when the entry changed]]
- activated; [[Called when the entry was activated]]
- file,chosen; [[Called when a file was chosen in the fileselector]]
- press; [[Called when entry was pressed]]
+ changed: void; [[Called when the entry changed]]
+ activated: void; [[Called when the entry was activated]]
+ /* FIXME: Can be Efl.Model or string */
+ file,chosen: void; [[Called when a file was chosen in the fileselector]]
+ press: void; [[Called when entry was pressed]]
}
}
diff --git a/src/lib/elementary/elm_flipselector.c b/src/lib/elementary/elm_flipselector.c
index ac69bd6ff2..a059e9db62 100644
--- a/src/lib/elementary/elm_flipselector.c
+++ b/src/lib/elementary/elm_flipselector.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define ELM_WIDGET_ITEM_PROTECTED
@@ -157,7 +157,7 @@ _elm_flipselector_item_elm_widget_item_part_text_set(Eo *eo_item,
}
EOLIAN static const char *
-_elm_flipselector_item_elm_widget_item_part_text_get(Eo *eo_it EINA_UNUSED,
+_elm_flipselector_item_elm_widget_item_part_text_get(const Eo *eo_it EINA_UNUSED,
Elm_Flipselector_Item_Data *it,
const char *part)
{
@@ -351,7 +351,7 @@ _item_new(Evas_Object *obj,
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_flipselector_elm_widget_theme_apply(Eo *obj, Elm_Flipselector_Data *sd)
+_elm_flipselector_efl_ui_widget_theme_apply(Eo *obj, Elm_Flipselector_Data *sd)
{
const char *max_len;
@@ -482,7 +482,7 @@ _elm_flipselector_efl_ui_range_range_min_max_set(Eo *obj, Elm_Flipselector_Data
}
EOLIAN static void
-_elm_flipselector_efl_ui_range_range_min_max_get(Eo *obj EINA_UNUSED, Elm_Flipselector_Data *sd, double *min, double *max)
+_elm_flipselector_efl_ui_range_range_min_max_get(const Eo *obj EINA_UNUSED, Elm_Flipselector_Data *sd, double *min, double *max)
{
if (min) *min = sd->val_min;
if (max) *max = sd->val_max;
@@ -498,13 +498,13 @@ _elm_flipselector_efl_ui_range_range_step_set(Eo *obj EINA_UNUSED, Elm_Flipselec
}
EOLIAN static double
-_elm_flipselector_efl_ui_range_range_step_get(Eo *obj EINA_UNUSED, Elm_Flipselector_Data *sd)
+_elm_flipselector_efl_ui_range_range_step_get(const Eo *obj EINA_UNUSED, Elm_Flipselector_Data *sd)
{
return sd->step;
}
EOLIAN static double
-_elm_flipselector_efl_ui_range_range_value_get(Eo *obj EINA_UNUSED, Elm_Flipselector_Data *sd)
+_elm_flipselector_efl_ui_range_range_value_get(const Eo *obj EINA_UNUSED, Elm_Flipselector_Data *sd)
{
if (sd->val_min == 0 && sd->val_max == 0)
{
@@ -642,7 +642,7 @@ _elm_flipselector_efl_canvas_group_group_del(Eo *obj, Elm_Flipselector_Data *sd)
if (sd->walking) ERR("flipselector deleted while walking.\n");
while (sd->items)
- elm_wdg_item_del(DATA_GET(sd->items));
+ efl_del(DATA_GET(sd->items));
ecore_timer_del(sd->spin);
ecore_job_del(sd->view_update);
@@ -664,7 +664,7 @@ _elm_flipselector_efl_object_constructor(Eo *obj, Elm_Flipselector_Data *sd)
sd->obj = obj;
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_LIST);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_LIST);
return obj;
}
@@ -748,25 +748,25 @@ _elm_flipselector_item_prepend(Eo *obj, Elm_Flipselector_Data *sd, const char *l
}
EOLIAN static const Eina_List*
-_elm_flipselector_items_get(Eo *obj EINA_UNUSED, Elm_Flipselector_Data *sd)
+_elm_flipselector_items_get(const Eo *obj EINA_UNUSED, Elm_Flipselector_Data *sd)
{
return sd->items;
}
EOLIAN static Elm_Object_Item*
-_elm_flipselector_first_item_get(Eo *obj EINA_UNUSED, Elm_Flipselector_Data *sd)
+_elm_flipselector_first_item_get(const Eo *obj EINA_UNUSED, Elm_Flipselector_Data *sd)
{
return eina_list_data_get(sd->items);
}
EOLIAN static Elm_Object_Item*
-_elm_flipselector_last_item_get(Eo *obj EINA_UNUSED, Elm_Flipselector_Data *sd)
+_elm_flipselector_last_item_get(const Eo *obj EINA_UNUSED, Elm_Flipselector_Data *sd)
{
return eina_list_last_data_get(sd->items);
}
EOLIAN static Elm_Object_Item*
-_elm_flipselector_selected_item_get(Eo *obj EINA_UNUSED, Elm_Flipselector_Data *sd)
+_elm_flipselector_selected_item_get(const Eo *obj EINA_UNUSED, Elm_Flipselector_Data *sd)
{
return DATA_GET(sd->current);
}
@@ -817,7 +817,7 @@ _elm_flipselector_item_selected_set(Eo *eo_item,
}
EOLIAN static Eina_Bool
-_elm_flipselector_item_selected_get(Eo *eo_item,
+_elm_flipselector_item_selected_get(const Eo *eo_item,
Elm_Flipselector_Item_Data *item)
{
ELM_FLIPSELECTOR_DATA_GET(WIDGET(item), sd);
@@ -864,7 +864,7 @@ _elm_flipselector_first_interval_set(Eo *obj EINA_UNUSED, Elm_Flipselector_Data
}
EOLIAN double
-_elm_flipselector_first_interval_get(Eo *obj EINA_UNUSED, Elm_Flipselector_Data *sd)
+_elm_flipselector_first_interval_get(const Eo *obj EINA_UNUSED, Elm_Flipselector_Data *sd)
{
return sd->first_interval;
}
@@ -876,7 +876,7 @@ _elm_flipselector_class_constructor(Efl_Class *klass)
}
EOLIAN const Efl_Access_Action_Data *
-_elm_flipselector_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Flipselector_Data *pd EINA_UNUSED)
+_elm_flipselector_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Elm_Flipselector_Data *pd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "flip,up", "flip", "up", _key_action_flip},
diff --git a/src/lib/elementary/elm_flipselector.eo b/src/lib/elementary/elm_flipselector.eo
index 4ba48de66e..570c642567 100644
--- a/src/lib/elementary/elm_flipselector.eo
+++ b/src/lib/elementary/elm_flipselector.eo
@@ -1,6 +1,6 @@
-class Elm.Flipselector (Efl.Ui.Layout, Efl.Ui.Range,
+class Elm.Flipselector (Efl.Ui.Layout.Object, Efl.Ui.Range,
Efl.Access.Widget.Action,
- Efl.Ui.Selectable)
+ Efl.Ui.Selectable, Efl.Ui.Legacy)
{
[[Elementary flipselector class]]
legacy_prefix: elm_flipselector;
@@ -161,15 +161,15 @@ class Elm.Flipselector (Efl.Ui.Layout, Efl.Ui.Range,
implements {
class.constructor;
Efl.Object.constructor;
- Elm.Widget.theme_apply;
- Elm.Widget.widget_event;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.widget_event;
Efl.Ui.Range.range_min_max { get; set; }
Efl.Ui.Range.range_step { get; set; }
Efl.Ui.Range.range_value { get; set; }
Efl.Access.Widget.Action.elm_actions { get; }
}
events {
- underflowed; [[Called when flipselector is underflowed]]
- overflowed; [[Called when flipselector is overflowed]]
+ underflowed: void; [[Called when flipselector is underflowed]]
+ overflowed: void; [[Called when flipselector is overflowed]]
}
}
diff --git a/src/lib/elementary/elm_focus_legacy.c b/src/lib/elementary/elm_focus_legacy.c
new file mode 100644
index 0000000000..ca84bb09a8
--- /dev/null
+++ b/src/lib/elementary/elm_focus_legacy.c
@@ -0,0 +1,342 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <Elementary.h>
+#include "elm_priv.h"
+
+//we need those for legacy compatible code
+#include "elm_genlist.eo.h"
+#include "elm_gengrid.eo.h"
+
+#define API_ENTRY()\
+ EINA_SAFETY_ON_NULL_RETURN(obj); \
+ EINA_SAFETY_ON_FALSE_RETURN(efl_isa(obj, EFL_UI_WIDGET_CLASS)); \
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, pd); \
+ EINA_SAFETY_ON_FALSE_RETURN(elm_widget_is_legacy(obj));
+
+#define API_ENTRY_VAL(val)\
+ EINA_SAFETY_ON_NULL_RETURN_VAL(obj, val); \
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(obj, EFL_UI_WIDGET_CLASS), val); \
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, pd, val); \
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(elm_widget_is_legacy(obj), val);
+
+#define MAPPING() \
+ MAP(PREVIOUS, prev) \
+ MAP(NEXT, next) \
+ MAP(UP, up) \
+ MAP(DOWN, down) \
+ MAP(LEFT, left) \
+ MAP(RIGHT, right)
+
+
+
+static Eina_List*
+_custom_chain_get(const Efl_Ui_Widget *node)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(node, pd, NULL);
+
+ return pd->legacy_focus.custom_chain;
+}
+
+static void
+_flush_manager(Efl_Ui_Widget *obj, Elm_Widget_Smart_Data *pd)
+{
+ Efl_Ui_Focus_Manager *manager;
+
+ manager = efl_ui_focus_object_focus_manager_get(obj);
+ if (manager)
+ {
+ Eina_List *order;
+
+ if (pd->legacy_focus.custom_chain)
+ order = eina_list_clone(pd->legacy_focus.custom_chain);
+ else
+ order = eina_list_clone(pd->subobjs);
+
+ efl_ui_focus_manager_calc_update_order(manager, obj, order);
+ }
+}
+
+static void
+_manager_changed(void *data EINA_UNUSED, const Efl_Event *ev)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(ev->object, pd);
+
+ _flush_manager(ev->object, pd);
+}
+
+static void
+_custom_chain_set(Efl_Ui_Widget *node, Eina_List *lst)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(node, pd);
+ Efl_Ui_Widget *list_item;
+ Eina_List *n;
+
+ pd->legacy_focus.custom_chain = eina_list_free(pd->legacy_focus.custom_chain);
+ pd->legacy_focus.custom_chain = lst;
+
+ EINA_LIST_FOREACH(pd->legacy_focus.custom_chain, n, list_item)
+ {
+ EINA_SAFETY_ON_FALSE_RETURN(efl_isa(list_item, EFL_UI_WIDGET_CLASS));
+ EINA_SAFETY_ON_FALSE_RETURN(efl_ui_widget_parent_get(list_item) == node);
+ }
+
+ _elm_widget_full_eval_children(node, pd);
+
+ if (pd->legacy_focus.custom_chain && !pd->legacy_focus.listen_to_manager)
+ {
+ efl_event_callback_add(node, EFL_UI_FOCUS_OBJECT_EVENT_MANAGER_CHANGED, _manager_changed, NULL);
+ pd->legacy_focus.listen_to_manager = EINA_TRUE;
+ }
+ else if (!pd->legacy_focus.custom_chain && pd->legacy_focus.listen_to_manager)
+ {
+ efl_event_callback_del(node, EFL_UI_FOCUS_OBJECT_EVENT_MANAGER_CHANGED, _manager_changed, NULL);
+ pd->legacy_focus.listen_to_manager = EINA_FALSE;
+ }
+
+ _flush_manager(node, pd);
+}
+
+EAPI void
+elm_object_focus_next_object_set(Evas_Object *obj,
+ Evas_Object *next,
+ Elm_Focus_Direction dir)
+{
+ API_ENTRY()
+ EINA_SAFETY_ON_FALSE_RETURN(efl_isa(next, EFL_UI_WIDGET_CLASS));
+ ELM_WIDGET_DATA_GET_OR_RETURN(next, next_pd);
+
+ #define MAP(direction, field) if (dir == EFL_UI_FOCUS_DIRECTION_ ##direction) pd->legacy_focus.field = next;
+ MAPPING()
+ #undef MAP
+ dir = efl_ui_focus_util_direction_complement(EFL_UI_FOCUS_UTIL_CLASS, dir);
+ #define MAP(direction, field) if (dir == EFL_UI_FOCUS_DIRECTION_ ##direction) next_pd->legacy_focus.field = obj;
+ MAPPING()
+ #undef MAP
+}
+
+EAPI void
+elm_object_focus_custom_chain_set(Evas_Object *obj,
+ Eina_List *objs)
+{
+ API_ENTRY()
+ _custom_chain_set(obj, objs);
+}
+
+EAPI void
+elm_object_focus_custom_chain_unset(Evas_Object *obj)
+{
+ API_ENTRY()
+
+ _custom_chain_set(obj, NULL);
+}
+
+EAPI const Eina_List *
+elm_object_focus_custom_chain_get(const Evas_Object *obj)
+{
+ API_ENTRY_VAL(NULL)
+
+ return _custom_chain_get(obj);
+}
+
+EAPI void
+elm_object_focus_custom_chain_append(Evas_Object *obj,
+ Evas_Object *child,
+ Evas_Object *relative_child)
+{
+ API_ENTRY()
+ Eina_List *tmp;
+
+ tmp = eina_list_clone(pd->legacy_focus.custom_chain);
+ tmp = eina_list_append_relative(tmp, child, relative_child);
+ _custom_chain_set(obj, tmp);
+}
+
+EAPI void
+elm_object_focus_custom_chain_prepend(Evas_Object *obj,
+ Evas_Object *child,
+ Evas_Object *relative_child)
+{
+ API_ENTRY()
+ Eina_List *tmp;
+
+ tmp = eina_list_clone(pd->legacy_focus.custom_chain);
+ tmp = eina_list_prepend_relative(tmp, child, relative_child);
+ _custom_chain_set(obj, tmp);
+}
+
+EINA_DEPRECATED EAPI void
+elm_object_focus_cycle(Evas_Object *obj,
+ Elm_Focus_Direction dir)
+{
+ elm_object_focus_next(obj, dir);
+}
+
+EAPI void
+elm_object_focus_next(Evas_Object *obj,
+ Elm_Focus_Direction dir)
+{
+ Eina_Bool legacy_focus_move = EINA_FALSE;
+ Efl_Ui_Widget *o = NULL, *top;
+ Efl_Ui_Focus_Object *logical;
+ Efl_Ui_Focus_Manager *manager_top;
+ API_ENTRY()
+
+ top = elm_object_top_widget_get(obj);
+ EINA_SAFETY_ON_FALSE_RETURN(efl_isa(top, EFL_UI_WIN_CLASS));
+
+ manager_top = efl_ui_focus_util_active_manager(EFL_UI_FOCUS_UTIL_CLASS, obj);
+ logical = efl_ui_focus_manager_focus_get(manager_top);
+
+ if (elm_widget_is(logical))
+ {
+ Efl_Ui_Focus_Object *legacy_target = NULL;
+ ELM_WIDGET_DATA_GET_OR_RETURN(logical, pd_logical);
+
+ #define MAP(direction, field) if (dir == EFL_UI_FOCUS_DIRECTION_ ##direction && pd_logical->legacy_focus.field) legacy_target = pd_logical->legacy_focus.field;
+ MAPPING()
+ #undef MAP
+
+ if (legacy_target)
+ {
+ efl_ui_focus_util_focus(EFL_UI_FOCUS_UTIL_CLASS, legacy_target);
+ if (elm_object_focused_object_get(top) == legacy_target)
+ {
+ legacy_focus_move = EINA_TRUE;
+ o = legacy_target;
+ }
+ }
+ }
+
+ if (!legacy_focus_move)
+ o = efl_ui_focus_manager_move(top, dir);
+ if (!o)
+ {
+ if (dir == EFL_UI_FOCUS_DIRECTION_NEXT || dir == EFL_UI_FOCUS_DIRECTION_PREVIOUS)
+ {
+ Efl_Ui_Focus_Object *root;
+
+ root = efl_ui_focus_manager_root_get(top);
+ efl_ui_focus_manager_setup_on_first_touch(top, dir, root);
+ }
+ }
+}
+
+EAPI Evas_Object *
+elm_object_focus_next_object_get(const Evas_Object *obj,
+ Elm_Focus_Direction dir)
+{
+ Efl_Ui_Widget *top = elm_object_top_widget_get(obj);
+ API_ENTRY_VAL(NULL)
+
+ #define MAP(direction, field) if (dir == EFL_UI_FOCUS_DIRECTION_ ##direction && pd->legacy_focus.field) return pd->legacy_focus.field;
+ MAPPING()
+ #undef MAP
+
+ return efl_ui_focus_manager_request_move(efl_ui_focus_util_active_manager(EFL_UI_FOCUS_UTIL_CLASS, top), dir, NULL, EINA_FALSE);
+}
+
+EAPI Elm_Object_Item *
+elm_object_focus_next_item_get(const Evas_Object *obj,
+ Elm_Focus_Direction dir EINA_UNUSED)
+{
+ API_ENTRY_VAL(NULL)
+ /* FOCUS-FIXME */
+ return NULL;
+}
+
+EAPI void
+elm_object_focus_next_item_set(Evas_Object *obj,
+ Elm_Object_Item *next_item EINA_UNUSED,
+ Elm_Focus_Direction dir EINA_UNUSED)
+{
+ API_ENTRY()
+ /* FOCUS-FIXME */
+}
+
+EAPI Evas_Object *
+elm_object_focused_object_get(const Evas_Object *obj)
+{
+ API_ENTRY_VAL(NULL)
+ Efl_Ui_Focus_Manager *man = elm_object_top_widget_get(obj);
+
+ while(efl_ui_focus_manager_redirect_get(man))
+ {
+ man = efl_ui_focus_manager_redirect_get(man);
+
+ // legacy compatible code, earlier those containers have not exposed theire items
+ if (efl_isa(man, ELM_GENGRID_CLASS) ||
+ efl_isa(man, ELM_TOOLBAR_CLASS) ||
+ efl_isa(man, ELM_GENLIST_CLASS)) return man;
+ }
+
+ return efl_ui_focus_manager_focus_get(man);
+}
+
+EAPI Eina_Bool
+elm_object_focus_get(const Evas_Object *obj)
+{
+ Efl_Ui_Focus_Manager *m;
+ Efl_Ui_Focus_Object *focused_child;
+ API_ENTRY_VAL(EINA_FALSE)
+
+ if (!elm_widget_is(obj))
+ return evas_object_focus_get(obj);
+
+ m = efl_ui_focus_object_focus_manager_get(obj);
+
+ //no manager means not registered
+ if (!m) return EINA_FALSE;
+
+ //assertion: our redirect manager m is in the redirect chain
+ m = efl_ui_focus_object_focus_manager_get(obj);
+
+ //if obj is the redriect manager its kind of focused
+ if (efl_ui_focus_manager_redirect_get(m) == obj) return EINA_TRUE;
+
+ //if there is a redirect manager
+ if (!!efl_ui_focus_manager_redirect_get(m)) return EINA_FALSE;
+
+ //now take the focused object and walk down the parents, if this is
+ focused_child = efl_ui_focus_manager_focus_get(m);
+
+ while(focused_child)
+ {
+ if (focused_child == obj) return EINA_TRUE;
+
+ focused_child = efl_ui_focus_object_focus_parent_get(focused_child);
+ }
+
+ return efl_ui_focus_object_focus_get(obj);
+}
+
+EAPI void
+elm_object_focus_set(Evas_Object *obj,
+ Eina_Bool focus)
+{
+ // ugly, but, special case for inlined windows
+ if (efl_isa(obj, EFL_UI_WIN_CLASS))
+ {
+ Evas_Object *inlined = elm_win_inlined_image_object_get(obj);
+ if (inlined)
+ {
+ evas_object_focus_set(inlined, focus);
+ return;
+ }
+ }
+ else if (elm_widget_is(obj))
+ {
+ if (focus)
+ efl_ui_focus_util_focus(EFL_UI_FOCUS_UTIL_CLASS, obj);
+ else
+ {
+ if (efl_ui_focus_manager_focus_get(efl_ui_focus_object_focus_manager_get(obj)) == obj)
+ efl_ui_focus_manager_pop_history_stack(efl_ui_focus_object_focus_manager_get(obj));
+ }
+ }
+ else
+ {
+ evas_object_focus_set(obj, focus);
+ }
+}
diff --git a/src/lib/elementary/elm_gen_common.h b/src/lib/elementary/elm_gen_common.h
index 3c795a2e1c..e060e9f096 100644
--- a/src/lib/elementary/elm_gen_common.h
+++ b/src/lib/elementary/elm_gen_common.h
@@ -38,7 +38,6 @@ struct Elm_Gen_Item
Elm_Gen_Item *parent;
Eina_List *texts, *contents, *states, *content_objs;
Ecore_Timer *long_timer;
- int walking;
int generation; /**< a generation of an item. when the item is created, this value is set to the value of genlist/gengrid generation. this value will be decreased when the item is going to be deleted */
const char *mouse_cursor;
Eina_List *item_focus_chain;
@@ -72,6 +71,8 @@ struct Elm_Gen_Item
Eina_Bool cursor_engine_only : 1;
Eina_Bool hide : 1; /**< flag used for hiding the items which do not match filter text */
Eina_Bool filtered: 1; /**<flag used to indicate whether or not item has been filtered */
+
+ Eina_Bool callbacks : 1;
};
#endif
diff --git a/src/lib/elementary/elm_general.eot b/src/lib/elementary/elm_general.eot
index 52bf386fda..bacb9f2b63 100644
--- a/src/lib/elementary/elm_general.eot
+++ b/src/lib/elementary/elm_general.eot
@@ -7,9 +7,6 @@ type Evas_Smart_Cb: __undefined_type; [[Evas smart callback type]]
type Eina_Compare_Cb: __undefined_type; [[Eina compare callback type]]
type @extern Elm.Glob.Match_Flags: __undefined_type; [[Elementary glob matching flags]]
-/* Types for A11Y (internal/beta API) */
-type @extern Efl.Access.Action_Data: __undefined_type; [[Internal struct for accesssibility.]]
-
/* FIXME: elm_policy API is not bound to EO */
struct Elm.Event.Policy_Changed
{
@@ -136,17 +133,21 @@ enum Elm.Icon.Type
standard [[Icon is of type standard]]
}
-/* FIXME: shouldn't exist */
+/* FIXME: shouldn't exist, they are unusable by the bindings */
struct @extern Elm_Gen_Item; [[Elementary gen item]]
struct @extern Efl_Access_Action_Data; [[Efl access action data]]
-
+struct @extern Elm.Validate_Content; [[Data for the elm_validator_regexp_helper()]]
+struct @extern Elm.Entry_Anchor_Info; [[The info sent in the callback for the "anchor,clicked" signals emitted
+ by entries.]]
+struct @extern Elm.Entry_Anchor_Hover_Info; [[The info sent in the callback for "anchor,hover" signals emitted
+ by the Anchor_Hover widget]]
+struct @extern Elm.Entry_Change_Info; [[This corresponds to Edje_Entry_Change_Info. Includes information about
+ a change in the entry]]
/* Enums from elm_entry.eo, also used by efl_ui_text */
enum Elm.Text_Format
{
[[Text Format types.
-
- See also @Elm.Entry.file_text_format.
]]
plain_utf8, [[ Plain UTF8 type ]]
markup_utf8 [[ Markup UTF8 type ]]
@@ -156,7 +157,6 @@ enum Elm.Input.Panel.Layout
{
[[Input panel (virtual keyboard) layout types.
Type of input panel (virtual keyboard) to use - this is a hint and may not provide exactly what is desired.
- See also @Elm.Entry.input_panel_layout.set.
]]
normal, [[Default layout.]]
number, [[Number layout.]]
@@ -184,8 +184,6 @@ enum Elm.Input.Panel.Layout
enum Elm.Input.Panel.Lang
{
[[Input panel (virtual keyboard) language modes.
-
- See also @Elm.Entry.input_panel_language.set.
]]
automatic, [[Automatic]]
alphabet [[Alphabet]]
@@ -195,8 +193,6 @@ enum Elm.Autocapital.Type
{
[[Autocapitalization Types.
Choose method of auto-capitalization.
-
- See also @Elm.Entry.autocapital_type.set.
]]
none, [[No auto-capitalization when typing.]]
word, [[Autocapitalize each word typed.]]
@@ -207,8 +203,6 @@ enum Elm.Autocapital.Type
enum Elm.Input.Panel.Return_Key.Type
{
[["Return" Key types on the input panel (virtual keyboard).
- See also @Elm.Entry.input_panel_return_key_type.set.
-
]]
default, [[Default.]]
done, [[Done.]]
@@ -239,17 +233,147 @@ enum Elm.Input.Hints
sensitive_data = 1 << 1, [[Typed text should not be stored.
@since 1.12]]
+ autofill_credit_card_expiration_date = 0x100, [[ Autofill hint for a credit card expiration date
+
+ @since 1.21]]
+ autofill_credit_card_expiration_day = 0x200, [[Autofill hint for a credit card expiration day
+
+ @since 1.21]]
+ autofill_credit_card_expiration_month = 0x300, [[ Autofill hint for a credit card expiration month
+
+ @since 1.21]]
+ autofill_credit_card_expiration_year = 0x400, [[ Autofill hint for a credit card expiration year
+
+ @since 1.21]]
+ autofill_credit_card_number = 0x500, [[ Autofill hint for a credit card number
+
+ @since 1.21]]
+ autofill_email_address = 0x600, [[ Autofill hint for an email address
+
+ @since 1.21]]
+ autofill_name = 0x700, [[ Autofill hint for a user's real name
+
+ @since 1.21]]
+ autofill_phone = 0x800, [[ Autofill hint for a phone number
+
+ @since 1.21]]
+ autofill_postal_address = 0x900, [[ Autofill hint for a postal address
+
+ @since 1.21]]
+ autofill_postal_code = 0xA00, [[ Autofill hint for a postal code
+
+ @since 1.21]]
+ autofill_id = 0xB00 [[ Autofill hint for a user's ID
+
+ @since 1.21]]
}
enum Elm.Cnp_Mode
{
[[
Enum of entry's copy & paste policy.
-
- See also @Elm.Entry.cnp_mode.set,
- @Elm.Entry.cnp_mode.get.
]]
markup, [[ copy & paste text with markup tag ]]
no_image, [[ copy & paste text without item(image) tag ]]
plaintext, [[ copy & paste text without markup tag ]]
}
+
+/* Elm_Genlist-related types */
+type @extern Elm.Genlist.Item.Class: __undefined_type; [[External elm genlist item class]]
+
+enum Elm.Genlist.Item.Type
+{
+ [[Defines if the item is of any special type (has subitems or it's the
+ index of a group), or is just a simple item.
+ ]]
+ legacy: elm_genlist_item;
+ none = 0, [[Simple item.]]
+ tree = (1 << 0), [[This may be expanded and have child items.]]
+ group = (1 << 1), [[An index item of a group of items. this item can have child items.]]
+ max = (1 << 2) [[Sentinel value to indicate last enum field during iteration]]
+}
+
+enum Elm.Genlist.Item.Field_Type
+{
+ [[Defines the type of the item part
+ Used while updating item's parts
+ It can be used at updating multi fields.
+ ]]
+ legacy: elm_genlist_item_field;
+ all = 0, [[Type all]]
+ text = (1 << 0), [[Type text]]
+ content = (1 << 1), [[Type content]]
+ state = (1 << 2) [[Type state]]
+}
+
+enum Elm.Genlist.Item.Scrollto_Type
+{
+ [[Defines where to position the item in the genlist.]]
+ legacy: elm_genlist_item_scrollto;
+ none = 0, [[Nothing will happen, Don't use this value.]]
+ in = (1 << 0), [[To the nearest viewport.]]
+ top = (1 << 1), [[To the top of viewport.]]
+ middle = (1 << 2), [[To the middle of viewport.]]
+ bottom = (1 << 3) [[To the bottom of viewport.]]
+}
+
+/* Elm_Gengrid-related types */
+
+type @extern Elm.Gengrid.Item.Class: __undefined_type; [[External elm gengrid item class]]
+
+enum Elm.Gengrid.Item.Scrollto_Type
+{
+ [[Defines where to position the item in the genlist.]]
+ legacy: elm_gengrid_item_scrollto;
+ none = 0, [[No scrollto.]]
+ in = (1 << 0), [[To the nearest viewport.]]
+ top = (1 << 1), [[To the top of viewport.]]
+ middle = (1 << 2), [[To the middle of viewport.]]
+ bottom = (1 << 3) [[To the bottom of viewport.]]
+}
+
+enum Elm.Gengrid.Item.Field_Type
+{
+ [[Defines the type of the item part Used while updating item's parts.
+ It can be used at updating multi fields.]]
+ legacy: elm_gengrid_item_field;
+ all = 0, [[Type all]]
+ text = (1 << 0), [[Type text]]
+ content = (1 << 1), [[Type content]]
+ state = (1 << 2) [[Type state]]
+}
+
+/* Elm_List types */
+enum Elm.List.Mode
+{
+ [[Set list's resizing behavior, transverse axis scrolling and items
+ cropping. See each mode's description for more details.
+
+ Note: Default value is @Elm.List.Mode.scroll.
+
+ Values here don't work as bitmasks -- only one can be chosen at
+ a time.
+ ]]
+ legacy: elm_list;
+ compress = 0, [[The list won't set any of its size hints to inform how a
+ possible container should resize it. Then, if it's not
+ created as a "resize object", it might end with zeroed
+ dimensions. The list will respect the container's geometry
+ and, if any of its items won't fit into its transverse axis,
+ one won't be able to scroll it in that direction.]]
+ scroll, [[Default value. This is the same as #ELM_LIST_COMPRESS, with the
+ exception that if any of its items won't fit into its transverse
+ axis, one will be able to scroll it in that direction.]]
+ limit, [[Sets a minimum size hint on the list object, so that containers may
+ respect it (and resize itself to fit the child properly). More
+ specifically, a minimum size hint will be set for its transverse
+ axis, so that the largest item in that direction fits well. This
+ is naturally bound by the list object's maximum size hints, set
+ externally.]]
+ expand, [[Besides setting a minimum size on the transverse axis, just like
+ on @Elm.List.Mode.limit, the list will set a minimum size on the
+ longitudinal axis, trying to reserve space to all its children to
+ be visible at a time. . This is naturally bound by the list
+ object's maximum size hints, set externally.]]
+ last [[Indicates error if returned by elm_list_mode_get().]]
+}
diff --git a/src/lib/elementary/elm_general.h b/src/lib/elementary/elm_general.h
index 5696f3e78a..a8b63d7494 100644
--- a/src/lib/elementary/elm_general.h
+++ b/src/lib/elementary/elm_general.h
@@ -242,7 +242,7 @@ EAPI Eina_Bool efl_quicklaunch_prepare(int argc, char **argv, const char *cwd);
/**
* Exposed symbol used only by macros and should not be used by apps
*/
-EAPI Eina_Bool elm_quicklaunch_fork(int argc, char **argv, char *cwd, void (*postfork_func) (void *data), void *postfork_data);
+EAPI int elm_quicklaunch_fork(int argc, char **argv, char *cwd, void (*postfork_func) (void *data), void *postfork_data);
/**
* Exposed symbol used only by macros and should not be used by apps
diff --git a/src/lib/elementary/elm_gengrid.c b/src/lib/elementary/elm_gengrid.c
index 4db2ed1f4a..fccee49411 100644
--- a/src/lib/elementary/elm_gengrid.c
+++ b/src/lib/elementary/elm_gengrid.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_SELECTION_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define ELM_WIDGET_ITEM_PROTECTED
@@ -146,7 +146,8 @@ _item_cache_free(Item_Cache *itc)
if (!itc) return;
evas_object_del(itc->spacer);
- evas_object_del(itc->base_view);
+ efl_wref_del(itc->base_view, &itc->base_view);
+ efl_del(itc->base_view);
eina_stringshare_del(itc->item_style);
EINA_LIST_FREE(itc->contents, c)
evas_object_del(c);
@@ -203,7 +204,7 @@ _item_cache_add(Elm_Gen_Item *it, Eina_List *contents)
}
itc->spacer = it->spacer;
- itc->base_view = VIEW(it);
+ efl_wref_add(VIEW(it), &itc->base_view);
itc->item_style = eina_stringshare_add(it->itc->item_style);
itc->contents = contents;
@@ -225,12 +226,13 @@ _item_cache_add(Elm_Gen_Item *it, Eina_List *contents)
edje_object_mirrored_set(VIEW(it),
efl_ui_mirrored_get(WIDGET(it)));
edje_object_scale_set(VIEW(it),
- efl_gfx_scale_get(WIDGET(it))
+ efl_gfx_entity_scale_get(WIDGET(it))
* elm_config_scale_get());
evas_object_hide(itc->base_view);
evas_object_move(itc->base_view, -9999, -9999);
it->spacer = NULL;
+ efl_wref_del(it->base->view, &it->base->view);
VIEW(it) = NULL;
_item_cache_clean(sd);
@@ -261,8 +263,9 @@ _item_cache_find(Elm_Gen_Item *it)
if (!itc) continue;
it->spacer = itc->spacer;
- VIEW(it) = itc->base_view;
+ VIEW_SET(it, itc->base_view);
itc->spacer = NULL;
+ efl_wref_del(itc->base_view, &itc->base_view);
itc->base_view = NULL;
itc->contents = eina_list_free(itc->contents);
@@ -347,7 +350,7 @@ _is_no_select(Elm_Gen_Item *it)
}
EOLIAN static void
-_elm_gengrid_item_custom_size_get(Eo *eo_it EINA_UNUSED,
+_elm_gengrid_item_custom_size_get(const Eo *eo_it EINA_UNUSED,
Elm_Gen_Item *it,
Evas_Coord *w,
Evas_Coord *h)
@@ -667,24 +670,24 @@ _elm_gengrid_pan_efl_object_destructor(Eo *obj, Elm_Gengrid_Pan_Data *psd)
}
EOLIAN static void
-_elm_gengrid_pan_efl_gfx_position_set(Eo *obj, Elm_Gengrid_Pan_Data *psd, Eina_Position2D pos)
+_elm_gengrid_pan_efl_gfx_entity_position_set(Eo *obj, Elm_Gengrid_Pan_Data *psd, Eina_Position2D pos)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
- efl_gfx_position_set(efl_super(obj, MY_PAN_CLASS), pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_PAN_CLASS), pos);
ecore_job_del(psd->wsd->calc_job);
psd->wsd->calc_job = ecore_job_add(_calc_job, psd->wobj);
}
EOLIAN static void
-_elm_gengrid_pan_efl_gfx_size_set(Eo *obj, Elm_Gengrid_Pan_Data *psd, Eina_Size2D sz)
+_elm_gengrid_pan_efl_gfx_entity_size_set(Eo *obj, Elm_Gengrid_Pan_Data *psd, Eina_Size2D sz)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
- efl_gfx_size_set(efl_super(obj, MY_PAN_CLASS), sz);
+ efl_gfx_entity_size_set(efl_super(obj, MY_PAN_CLASS), sz);
ecore_job_del(psd->wsd->calc_job);
psd->wsd->calc_job = ecore_job_add(_calc_job, psd->wobj);
@@ -991,6 +994,7 @@ _item_text_realize(Elm_Gen_Item *it,
const Eina_List *l;
const char *key;
char *s;
+ char buf[256];
if (!it->itc->func.text_get) return;
@@ -1007,13 +1011,19 @@ _item_text_realize(Elm_Gen_Item *it,
{
edje_object_part_text_escaped_set(target, key, s);
free(s);
+
+ snprintf(buf, sizeof(buf), "elm,state,%s,visible", key);
+ edje_object_signal_emit(target, buf, "elm");
}
else
{
edje_object_part_text_set(target, key, "");
+
+ snprintf(buf, sizeof(buf), "elm,state,%s,hidden", key);
+ edje_object_signal_emit(target, buf, "elm");
}
if (_elm_config->atspi_mode)
- efl_access_name_changed_signal_emit(EO_OBJ(it));
+ efl_access_i18n_name_changed_signal_emit(EO_OBJ(it));
}
}
@@ -1027,6 +1037,7 @@ _item_content_realize(Elm_Gen_Item *it,
Evas_Object *content;
Eina_List *source;
const char *key;
+ char buf[256];
ELM_GENGRID_DATA_GET(it->base->widget, sd);
if (!parts)
@@ -1055,7 +1066,12 @@ _item_content_realize(Elm_Gen_Item *it,
if (it->itc->func.content_get)
content = it->itc->func.content_get
((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)), WIDGET(it), key);
- if (!content) goto out;
+ if (!content)
+ {
+ snprintf(buf, sizeof(buf), "elm,state,%s,hidden", key);
+ edje_object_signal_emit(target, buf, "elm");
+ goto out;
+ }
}
eina_hash_add(sd->content_item_map, &content, it->base->eo_obj);
*contents = eina_list_append(*contents, content);
@@ -1063,9 +1079,21 @@ _item_content_realize(Elm_Gen_Item *it,
{
ERR("%s (%p) can not be swallowed into %s",
evas_object_type_get(content), content, key);
+
+ snprintf(buf, sizeof(buf), "elm,state,%s,hidden", key);
+ edje_object_signal_emit(target, buf, "elm");
evas_object_del(content);
goto out;
}
+
+ snprintf(buf, sizeof(buf), "elm,state,%s,visible", key);
+ edje_object_signal_emit(target, buf, "elm");
+
+ if (elm_widget_is(content))
+ {
+ _elm_widget_full_eval(content);
+ }
+
if (elm_wdg_item_disabled_get(EO_OBJ(it)))
elm_widget_disabled_set(content, EINA_TRUE);
@@ -1142,7 +1170,7 @@ _view_style_update(Elm_Gen_Item *it, Evas_Object *view, const char *style)
}
edje_object_mirrored_set(view, efl_ui_mirrored_get(WIDGET(it)));
- edje_object_scale_set(view, efl_gfx_scale_get(WIDGET(it)) *
+ edje_object_scale_set(view, efl_gfx_entity_scale_get(WIDGET(it)) *
elm_config_scale_get());
evas_object_stack_below(view, sd->stack);
}
@@ -1156,7 +1184,7 @@ _view_create(Elm_Gen_Item *it, const char *style)
Evas_Object *view = edje_object_add(evas_object_evas_get(WIDGET(it)));
evas_object_smart_member_add(view, GG_IT(it)->wsd->pan_obj);
elm_widget_sub_object_add(WIDGET(it), view);
- edje_object_scale_set(view, efl_gfx_scale_get(WIDGET(it)) *
+ edje_object_scale_set(view, efl_gfx_entity_scale_get(WIDGET(it)) *
elm_config_scale_get());
_view_style_update(it, view, style);
@@ -1556,7 +1584,7 @@ _item_realize(Elm_Gen_Item *it)
if (!_item_cache_find(it))
{
- VIEW(it) = _view_create(it, it->itc->item_style);
+ VIEW_SET(it, _view_create(it, it->itc->item_style));
if (it->item->nocache_once)
it->item->nocache_once = EINA_FALSE;
}
@@ -2222,21 +2250,21 @@ _elm_gengrid_pan_elm_pan_pos_set(Eo *obj, Elm_Gengrid_Pan_Data *psd, Evas_Coord
}
EOLIAN static void
-_elm_gengrid_pan_elm_pan_pos_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Pan_Data *psd, Evas_Coord *x, Evas_Coord *y)
+_elm_gengrid_pan_elm_pan_pos_get(const Eo *obj EINA_UNUSED, Elm_Gengrid_Pan_Data *psd, Evas_Coord *x, Evas_Coord *y)
{
if (x) *x = psd->wsd->pan_x;
if (y) *y = psd->wsd->pan_y;
}
EOLIAN static void
-_elm_gengrid_pan_elm_pan_content_size_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Pan_Data *psd, Evas_Coord *w, Evas_Coord *h)
+_elm_gengrid_pan_elm_pan_content_size_get(const Eo *obj EINA_UNUSED, Elm_Gengrid_Pan_Data *psd, Evas_Coord *w, Evas_Coord *h)
{
if (w) *w = psd->wsd->minw;
if (h) *h = psd->wsd->minh;
}
EOLIAN static void
-_elm_gengrid_pan_elm_pan_pos_max_get(Eo *obj, Elm_Gengrid_Pan_Data *psd, Evas_Coord *x, Evas_Coord *y)
+_elm_gengrid_pan_elm_pan_pos_max_get(const Eo *obj, Elm_Gengrid_Pan_Data *psd, Evas_Coord *x, Evas_Coord *y)
{
Evas_Coord ow, oh;
@@ -2248,7 +2276,7 @@ _elm_gengrid_pan_elm_pan_pos_max_get(Eo *obj, Elm_Gengrid_Pan_Data *psd, Evas_Co
}
EOLIAN static void
-_elm_gengrid_pan_elm_pan_pos_min_get(Eo *obj, Elm_Gengrid_Pan_Data *psd, Evas_Coord *x, Evas_Coord *y)
+_elm_gengrid_pan_elm_pan_pos_min_get(const Eo *obj, Elm_Gengrid_Pan_Data *psd, Evas_Coord *x, Evas_Coord *y)
{
Evas_Coord mx = 0, my = 0;
Eina_Bool mirrored = efl_ui_mirrored_get(psd->wsd->obj);
@@ -3498,7 +3526,7 @@ _elm_gengrid_nearest_visible_item_get(Evas_Object *obj, Elm_Object_Item *eo_it)
}
EOLIAN static Eina_Rect
-_elm_gengrid_elm_widget_interest_region_get(Eo *obj, Elm_Gengrid_Data *sd)
+_elm_gengrid_efl_ui_widget_interest_region_get(const Eo *obj, Elm_Gengrid_Data *sd)
{
Eina_Rect r = {};
@@ -3532,8 +3560,9 @@ _mirrored_set(Evas_Object *obj,
ELM_GENGRID_DATA_GET(obj, sd);
- _item_cache_zero(sd);
- elm_interface_scrollable_mirrored_set(efl_super(obj, MY_CLASS), rtl);
+ if (efl_finalized_get(sd->obj))
+ _item_cache_zero(sd);
+ efl_ui_mirrored_set(efl_super(obj, MY_CLASS), rtl);
if (!sd->items) return;
it = ELM_GEN_ITEM_FROM_INLIST(sd->items);
@@ -3547,7 +3576,7 @@ _mirrored_set(Evas_Object *obj,
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_gengrid_elm_widget_theme_apply(Eo *obj, Elm_Gengrid_Data *sd EINA_UNUSED)
+_elm_gengrid_efl_ui_widget_theme_apply(Eo *obj, Elm_Gengrid_Data *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
@@ -3580,8 +3609,6 @@ _elm_gengrid_item_del_not_serious(Elm_Gen_Item *it)
elm_wdg_item_pre_notify_del(eo_it);
it->generation = sd->generation - 1; /* This means that the item is deleted */
- if (it->walking > 0) return;
-
if (sd->show_it == eo_it)
{
sd->show_it = NULL;
@@ -3616,7 +3643,6 @@ _elm_gengrid_item_del_serious(Elm_Gen_Item *it)
sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(it));
if (it->tooltip.del_cb)
it->tooltip.del_cb((void *)it->tooltip.data, WIDGET(it), it);
- sd->walking -= it->walking;
ELM_SAFE_FREE(it->long_timer, ecore_timer_del);
if (it->group)
sd->group_items = eina_list_remove(sd->group_items, it);
@@ -3748,27 +3774,20 @@ _elm_gengrid_item_elm_widget_item_disable(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *i
}
}
-EOLIAN static Eina_Bool
+EOLIAN static void
_elm_gengrid_item_elm_widget_item_del_pre(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
{
- if (it->walking > 0)
- {
- _elm_gengrid_item_del_not_serious(it);
- return EINA_FALSE;
- }
-
_item_del(it);
- return EINA_TRUE;
}
EOLIAN static Evas_Object *
-_elm_gengrid_item_elm_widget_item_part_content_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it, const char * part)
+_elm_gengrid_item_elm_widget_item_part_content_get(const Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it, const char * part)
{
return edje_object_part_swallow_get(VIEW(it), part);
}
EOLIAN static const char *
-_elm_gengrid_item_elm_widget_item_part_text_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it, const char * part)
+_elm_gengrid_item_elm_widget_item_part_text_get(const Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it, const char * part)
{
if (!it->itc->func.text_get) return NULL;
return edje_object_part_text_get(VIEW(it), part);
@@ -3781,7 +3800,7 @@ _elm_gengrid_item_elm_widget_item_signal_emit(Eo *eo_it EINA_UNUSED, Elm_Gen_Ite
}
EOLIAN static void
-_elm_gengrid_item_elm_widget_item_focus_set(Eo *eo_it, Elm_Gen_Item *it, Eina_Bool focused)
+_elm_gengrid_item_elm_widget_item_item_focus_set(Eo *eo_it, Elm_Gen_Item *it, Eina_Bool focused)
{
ELM_GENGRID_ITEM_CHECK_OR_RETURN(it);
Evas_Object *obj = WIDGET(it);
@@ -3813,7 +3832,7 @@ _elm_gengrid_item_elm_widget_item_focus_set(Eo *eo_it, Elm_Gen_Item *it, Eina_Bo
}
EOLIAN static Eina_Bool
-_elm_gengrid_item_elm_widget_item_focus_get(Eo *eo_it, Elm_Gen_Item *it)
+_elm_gengrid_item_elm_widget_item_item_focus_get(const Eo *eo_it, Elm_Gen_Item *it)
{
ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
Evas_Object *obj = WIDGET(it);
@@ -3855,12 +3874,11 @@ _internal_elm_gengrid_clear(Evas_Object *obj,
Elm_Gen_Item *itn = NULL;
if (next) itn = ELM_GEN_ITEM_FROM_INLIST(next);
- if (itn) itn->walking++; /* prevent early death of subitem */
+ if (itn) efl_ref(EO_OBJ(itn)); /* prevent early death of subitem */
if (VIEW(it))
_item_mouse_callbacks_del(it, VIEW(it));
- it->del_cb(it);
efl_del(EO_OBJ(it));
- if (itn) itn->walking--;
+ if (itn) efl_unref(EO_OBJ(itn));
}
}
sd->clear_me = EINA_FALSE;
@@ -3908,7 +3926,7 @@ _item_select(Elm_Gen_Item *it)
return;
evas_object_ref(obj);
- it->walking++;
+ efl_ref(eo_it);
sd->walking++;
sd->last_selected_item = eo_it;
@@ -3921,15 +3939,14 @@ _item_select(Elm_Gen_Item *it)
efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_SELECTED, EINA_TRUE);
}
- it->walking--;
+ efl_ref(eo_it);
sd->walking--;
if ((sd->clear_me) && (!sd->walking))
_internal_elm_gengrid_clear(WIDGET(it), EINA_TRUE);
else
{
- if ((!it->walking) && (it->generation < sd->generation))
+ if (it->generation < sd->generation)
{
- it->del_cb(it);
efl_del(eo_it);
sd->last_selected_item = NULL;
}
@@ -3942,7 +3959,7 @@ _elm_gengrid_item_efl_object_constructor(Eo *eo_it, Elm_Gen_Item *it)
{
eo_it = efl_constructor(efl_super(eo_it, ELM_GENGRID_ITEM_CLASS));
it->base = efl_data_scope_get(eo_it, ELM_WIDGET_ITEM_CLASS);
- efl_access_role_set(eo_it, EFL_ACCESS_ROLE_LIST_ITEM);
+ efl_access_object_role_set(eo_it, EFL_ACCESS_ROLE_LIST_ITEM);
return eo_it;
}
@@ -3969,7 +3986,6 @@ _elm_gengrid_item_new(Elm_Gengrid_Data *sd,
it->func.func = func;
it->func.data = func_data;
- it->del_cb = (Ecore_Cb)_item_del;
it->highlight_cb = (Ecore_Cb)_item_highlight;
it->unhighlight_cb = (Ecore_Cb)_item_unhighlight;
it->sel_cb = (Ecore_Cb)_item_select;
@@ -4122,23 +4138,23 @@ _elm_gengrid_efl_canvas_group_group_del(Eo *obj, Elm_Gengrid_Data *sd)
}
EOLIAN static void
-_elm_gengrid_efl_gfx_position_set(Eo *obj, Elm_Gengrid_Data *sd, Eina_Position2D pos)
+_elm_gengrid_efl_gfx_entity_position_set(Eo *obj, Elm_Gengrid_Data *sd, Eina_Position2D pos)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
- efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
- efl_gfx_position_set(sd->hit_rect, pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
+ efl_gfx_entity_position_set(sd->hit_rect, pos);
}
EOLIAN static void
-_elm_gengrid_efl_gfx_size_set(Eo *obj, Elm_Gengrid_Data *sd, Eina_Size2D sz)
+_elm_gengrid_efl_gfx_entity_size_set(Eo *obj, Elm_Gengrid_Data *sd, Eina_Size2D sz)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
- efl_gfx_size_set(sd->hit_rect, sz);
- efl_gfx_size_set(efl_super(obj, MY_CLASS), sz);
+ efl_gfx_entity_size_set(sd->hit_rect, sz);
+ efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
}
EOLIAN static void
@@ -4166,7 +4182,7 @@ _access_obj_process(Elm_Gengrid_Data * sd, Eina_Bool is_access)
}
EOLIAN static void
-_elm_gengrid_elm_widget_on_access_update(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd, Eina_Bool acs)
+_elm_gengrid_efl_ui_widget_on_access_update(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd, Eina_Bool acs)
{
_elm_gengrid_smart_focus_next_enable = acs;
_access_obj_process(sd, _elm_gengrid_smart_focus_next_enable);
@@ -4184,8 +4200,6 @@ _elm_gengrid_efl_ui_focus_manager_setup_on_first_touch(Eo *obj, Elm_Gengrid_Data
{
Elm_Object_Item *eo_it = NULL;
- if (direction == EFL_UI_FOCUS_DIRECTION_LAST && entry == NULL) return;
-
if (pd->last_focused_item)
eo_it = pd->last_focused_item;
else if (pd->last_selected_item)
@@ -4212,31 +4226,32 @@ _elm_gengrid_efl_ui_focus_manager_setup_on_first_touch(Eo *obj, Elm_Gengrid_Data
else
efl_ui_focus_manager_focus_set(obj, eo_it);
}
+ else
+ {
+ //Just set evas focus on the gengrid itself, events will pass on and some element will be taken
+ evas_object_focus_set(obj, EINA_TRUE);
+ }
}
static void
_gengrid_element_focused(void *data, const Efl_Event *ev)
{
ELM_GENGRID_DATA_GET(data, pd);
- Elm_Widget *focused = efl_ui_focus_manager_focus_get(ev->object);
+ Efl_Ui_Widget *focused = efl_ui_focus_manager_focus_get(ev->object);
Elm_Widget_Item *item;
if (!focused) return;
- if (efl_isa(focused, EFL_UI_FOCUS_COMPOSITION_ADAPTER_CLASS))
- item = efl_parent_get(focused);
- else
- item = efl_ui_focus_parent_provider_find_logical_parent(pd->provider, focused);
+ item = efl_ui_focus_parent_provider_gen_item_fetch(pd->provider, focused);
+
+ EINA_SAFETY_ON_FALSE_RETURN(efl_isa(item, ELM_GENGRID_ITEM_CLASS));
- if (efl_isa(item, ELM_GENGRID_ITEM_CLASS))
+ _elm_gengrid_item_focused(item);
+ _all_items_deselect(pd);
+ if (!_elm_config->item_select_on_focus_disable)
{
- _elm_gengrid_item_focused(item);
- _all_items_deselect(pd);
- if (!_elm_config->item_select_on_focus_disable)
- {
- elm_gengrid_item_selected_set(item, EINA_TRUE);
- elm_gengrid_item_bring_in(item, ELM_GENGRID_ITEM_SCROLLTO_MIDDLE);
- }
+ elm_gengrid_item_selected_set(item, EINA_TRUE);
+ elm_gengrid_item_bring_in(item, ELM_GENGRID_ITEM_SCROLLTO_MIDDLE);
}
}
@@ -4256,7 +4271,7 @@ _elm_gengrid_efl_object_constructor(Eo *obj, Elm_Gengrid_Data *sd)
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_TREE_TABLE);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_TREE_TABLE);
efl_event_callback_add(obj, EFL_UI_FOCUS_MANAGER_EVENT_FOCUSED, _gengrid_element_focused, obj);
@@ -4274,7 +4289,7 @@ _elm_gengrid_item_size_set(Eo *obj, Elm_Gengrid_Data *sd, Evas_Coord w, Evas_Coo
}
EOLIAN static void
-_elm_gengrid_item_size_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd, Evas_Coord *w, Evas_Coord *h)
+_elm_gengrid_item_size_get(const Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd, Evas_Coord *w, Evas_Coord *h)
{
if (w) *w = sd->item_width;
if (h) *h = sd->item_height;
@@ -4291,7 +4306,7 @@ _elm_gengrid_group_item_size_set(Eo *obj, Elm_Gengrid_Data *sd, Evas_Coord w, Ev
}
EOLIAN static void
-_elm_gengrid_group_item_size_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd, Evas_Coord *w, Evas_Coord *h)
+_elm_gengrid_group_item_size_get(const Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd, Evas_Coord *w, Evas_Coord *h)
{
if (w) *w = sd->group_item_width;
if (h) *h = sd->group_item_height;
@@ -4322,7 +4337,7 @@ _elm_gengrid_align_set(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd, double align_x
}
EOLIAN static void
-_elm_gengrid_align_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd, double *align_x, double *align_y)
+_elm_gengrid_align_get(const Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd, double *align_x, double *align_y)
{
if (align_x) *align_x = sd->align_x;
if (align_y) *align_y = sd->align_y;
@@ -4475,7 +4490,7 @@ _elm_gengrid_horizontal_set(Eo *obj, Elm_Gengrid_Data *sd, Eina_Bool horizontal)
}
EOLIAN static Eina_Bool
-_elm_gengrid_horizontal_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
+_elm_gengrid_horizontal_get(const Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
{
return sd->horizontal;
}
@@ -4533,7 +4548,7 @@ _elm_gengrid_item_fields_update(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it,
}
EOLIAN static const Elm_Gengrid_Item_Class *
-_elm_gengrid_item_item_class_get(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *item)
+_elm_gengrid_item_item_class_get(const Eo *eo_item EINA_UNUSED, Elm_Gen_Item *item)
{
if (item->generation < GG_IT(item)->wsd->generation) return NULL;
return item->itc;
@@ -4553,7 +4568,7 @@ _elm_gengrid_item_item_class_update(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it,
}
EOLIAN static void
-_elm_gengrid_item_pos_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it,
+_elm_gengrid_item_pos_get(const Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it,
unsigned int *x,
unsigned int *y)
{
@@ -4568,7 +4583,7 @@ _elm_gengrid_multi_select_set(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd, Eina_Bo
}
EOLIAN static Eina_Bool
-_elm_gengrid_multi_select_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
+_elm_gengrid_multi_select_get(const Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
{
return sd->multi;
}
@@ -4584,20 +4599,20 @@ _elm_gengrid_multi_select_mode_set(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd, El
}
EOLIAN static Elm_Object_Multi_Select_Mode
-_elm_gengrid_multi_select_mode_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
+_elm_gengrid_multi_select_mode_get(const Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
{
return sd->multi_select_mode;
}
EOLIAN static Elm_Object_Item*
-_elm_gengrid_selected_item_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
+_elm_gengrid_selected_item_get(const Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
{
if (sd->selected) return sd->selected->data;
return NULL;
}
EOLIAN static const Eina_List*
-_elm_gengrid_selected_items_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
+_elm_gengrid_selected_items_get(const Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
{
return sd->selected;
}
@@ -4633,13 +4648,13 @@ _elm_gengrid_item_selected_set(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it,
}
EOLIAN static Eina_Bool
-_elm_gengrid_item_selected_get(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it)
+_elm_gengrid_item_selected_get(const Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it)
{
return it->selected;
}
EOLIAN static Eina_List*
-_elm_gengrid_realized_items_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
+_elm_gengrid_realized_items_get(const Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
{
Elm_Gen_Item *it;
Eina_Bool done = EINA_FALSE;
@@ -4796,7 +4811,7 @@ elm_gengrid_item_tooltip_style_get(const Elm_Object_Item *it)
}
EOLIAN static const char *
-_elm_gengrid_item_elm_widget_item_tooltip_style_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
+_elm_gengrid_item_elm_widget_item_tooltip_style_get(const Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
{
return it->tooltip.style;
}
@@ -4826,7 +4841,7 @@ elm_gengrid_item_tooltip_window_mode_get(const Elm_Object_Item *it)
}
EOLIAN static Eina_Bool
-_elm_gengrid_item_elm_widget_item_tooltip_window_mode_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
+_elm_gengrid_item_elm_widget_item_tooltip_window_mode_get(const Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
{
ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
@@ -4934,7 +4949,7 @@ _elm_gengrid_reorder_mode_set(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd, Eina_Bo
}
EOLIAN static Eina_Bool
-_elm_gengrid_reorder_mode_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
+_elm_gengrid_reorder_mode_get(const Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
{
return sd->reorder_mode;
}
@@ -4963,8 +4978,8 @@ elm_gengrid_bounce_get(const Evas_Object *obj,
elm_interface_scrollable_bounce_allow_get(obj, h_bounce, v_bounce);
}
-EOLIAN static void
-_elm_gengrid_page_relative_set(Eo *obj, Elm_Gengrid_Data *_pd EINA_UNUSED, double h_pagerel, double v_pagerel)
+EAPI void
+elm_gengrid_page_relative_set(Eo *obj, double h_pagerel, double v_pagerel)
{
Evas_Coord pagesize_h;
Evas_Coord pagesize_v;
@@ -4974,14 +4989,14 @@ _elm_gengrid_page_relative_set(Eo *obj, Elm_Gengrid_Data *_pd EINA_UNUSED, doubl
(obj, h_pagerel, v_pagerel, pagesize_h, pagesize_v);
}
-EOLIAN static void
-_elm_gengrid_page_relative_get(Eo *obj, Elm_Gengrid_Data *_pd EINA_UNUSED, double *h_pagerel, double *v_pagerel)
+EAPI void
+elm_gengrid_page_relative_get(const Eo *obj, double *h_pagerel, double *v_pagerel)
{
elm_interface_scrollable_paging_get(obj, h_pagerel, v_pagerel, NULL, NULL);
}
-EOLIAN static void
-_elm_gengrid_page_size_set(Eo *obj, Elm_Gengrid_Data *_pd EINA_UNUSED, Evas_Coord h_pagesize, Evas_Coord v_pagesize)
+EAPI void
+elm_gengrid_page_size_set(Eo *obj, Evas_Coord h_pagesize, Evas_Coord v_pagesize)
{
double pagerel_h;
double pagerel_v;
@@ -5056,7 +5071,7 @@ elm_gengrid_scroller_policy_get(const Evas_Object *obj,
}
EOLIAN static void
-_elm_gengrid_elm_interface_scrollable_policy_get(Eo *obj, Elm_Gengrid_Data *sd EINA_UNUSED, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v)
+_elm_gengrid_elm_interface_scrollable_policy_get(const Eo *obj, Elm_Gengrid_Data *sd EINA_UNUSED, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v)
{
Elm_Scroller_Policy s_policy_h, s_policy_v;
@@ -5066,7 +5081,7 @@ _elm_gengrid_elm_interface_scrollable_policy_get(Eo *obj, Elm_Gengrid_Data *sd E
}
EOLIAN static Elm_Object_Item*
-_elm_gengrid_first_item_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
+_elm_gengrid_first_item_get(const Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
{
if (!sd->items) return NULL;
@@ -5167,7 +5182,7 @@ _elm_gengrid_at_xy_item_get(const Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd, Eva
}
EOLIAN static Elm_Object_Item*
-_elm_gengrid_last_item_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
+_elm_gengrid_last_item_get(const Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
{
if (!sd->items) return NULL;
@@ -5179,7 +5194,7 @@ _elm_gengrid_last_item_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
}
EOLIAN static Elm_Object_Item *
-_elm_gengrid_item_next_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
+_elm_gengrid_item_next_get(const Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
{
ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, NULL);
@@ -5193,7 +5208,7 @@ _elm_gengrid_item_next_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
}
EOLIAN static Elm_Object_Item *
-_elm_gengrid_item_prev_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
+_elm_gengrid_item_prev_get(const Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
{
ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, NULL);
@@ -5243,7 +5258,7 @@ _elm_gengrid_filled_set(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd, Eina_Bool fil
}
EOLIAN static Eina_Bool
-_elm_gengrid_filled_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
+_elm_gengrid_filled_get(const Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
{
return sd->filled;
}
@@ -5315,7 +5330,7 @@ _elm_gengrid_select_mode_set(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd, Elm_Obje
}
EOLIAN static Elm_Object_Select_Mode
-_elm_gengrid_select_mode_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
+_elm_gengrid_select_mode_get(const Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
{
return sd->select_mode;
}
@@ -5327,13 +5342,13 @@ _elm_gengrid_highlight_mode_set(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd, Eina_
}
EOLIAN static Eina_Bool
-_elm_gengrid_highlight_mode_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
+_elm_gengrid_highlight_mode_get(const Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
{
return sd->highlight;
}
EOLIAN static int
-_elm_gengrid_item_index_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
+_elm_gengrid_item_index_get(const Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
{
ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, -1);
@@ -5356,7 +5371,7 @@ _elm_gengrid_item_select_mode_set(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it,
}
EOLIAN static Elm_Object_Select_Mode
-_elm_gengrid_item_select_mode_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
+_elm_gengrid_item_select_mode_get(const Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
{
ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, ELM_OBJECT_SELECT_MODE_MAX);
@@ -5364,12 +5379,12 @@ _elm_gengrid_item_select_mode_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
}
EOLIAN Efl_Access_State_Set
-_elm_gengrid_item_efl_access_state_set_get(Eo *eo_it, Elm_Gen_Item *it EINA_UNUSED)
+_elm_gengrid_item_efl_access_object_state_set_get(const Eo *eo_it, Elm_Gen_Item *it EINA_UNUSED)
{
Efl_Access_State_Set ret;
Eina_Bool sel;
- ret = efl_access_state_set_get(efl_super(eo_it, ELM_GENGRID_ITEM_CLASS));
+ ret = efl_access_object_state_set_get(efl_super(eo_it, ELM_GENGRID_ITEM_CLASS));
sel = elm_obj_gengrid_item_selected_get(eo_it);
@@ -5382,13 +5397,13 @@ _elm_gengrid_item_efl_access_state_set_get(Eo *eo_it, Elm_Gen_Item *it EINA_UNUS
}
EOLIAN const char*
-_elm_gengrid_item_efl_access_name_get(Eo *eo_it, Elm_Gen_Item *it)
+_elm_gengrid_item_efl_access_object_i18n_name_get(const Eo *eo_it, Elm_Gen_Item *it)
{
const char *ret;
Eina_Strbuf *buf;
char *accessible_name;
- ret = efl_access_name_get(efl_super(eo_it, ELM_GENGRID_ITEM_CLASS));
+ ret = efl_access_object_i18n_name_get(efl_super(eo_it, ELM_GENGRID_ITEM_CLASS));
if (ret) return ret;
buf = eina_strbuf_new();
@@ -5450,7 +5465,7 @@ elm_gengrid_nth_item_get(const Evas_Object *obj, unsigned int nth)
}
EOLIAN static Eina_Rect
-_elm_gengrid_elm_widget_focus_highlight_geometry_get(Eo *obj, Elm_Gengrid_Data *sd)
+_elm_gengrid_efl_ui_widget_focus_highlight_geometry_get(const Eo *obj, Elm_Gengrid_Data *sd)
{
Evas_Coord ox, oy, oh, ow, item_x = 0, item_y = 0, item_w = 0, item_h = 0;
Eina_Rect r = {};
@@ -5501,7 +5516,7 @@ _elm_gengrid_elm_widget_focus_highlight_geometry_get(Eo *obj, Elm_Gengrid_Data *
}
EOLIAN static Elm_Object_Item *
-_elm_gengrid_elm_widget_focused_item_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
+_elm_gengrid_efl_ui_widget_focused_item_get(const Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
{
return sd->focused_item;
}
@@ -5513,25 +5528,21 @@ _elm_gengrid_elm_interface_scrollable_item_loop_enabled_set(Eo *obj EINA_UNUSED,
}
EOLIAN static Eina_Bool
-_elm_gengrid_elm_interface_scrollable_item_loop_enabled_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
+_elm_gengrid_elm_interface_scrollable_item_loop_enabled_get(const Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
{
return sd->item_loop_enable;
}
-EOLIAN static void
-_elm_gengrid_wheel_disabled_set(Eo *obj, Elm_Gengrid_Data *sd, Eina_Bool disabled)
+EAPI void
+elm_gengrid_wheel_disabled_set(Eo *obj, Eina_Bool disabled)
{
- disabled = !!disabled;
- if (sd->wheel_disabled != disabled)
- elm_interface_scrollable_wheel_disabled_set(obj, disabled);
-
- sd->wheel_disabled = disabled;
+ elm_interface_scrollable_wheel_disabled_set(obj, disabled);
}
-EOLIAN static Eina_Bool
-_elm_gengrid_wheel_disabled_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
+EAPI Eina_Bool
+elm_gengrid_wheel_disabled_get(const Eo *obj)
{
- return sd->wheel_disabled;
+ return elm_interface_scrollable_wheel_disabled_get(obj);
}
EOLIAN static void
@@ -5544,7 +5555,7 @@ _elm_gengrid_class_constructor(Efl_Class *klass)
}
EOLIAN const Efl_Access_Action_Data *
-_elm_gengrid_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *pd EINA_UNUSED)
+_elm_gengrid_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Elm_Gengrid_Data *pd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "move,prior", "move", "prior", _key_action_move},
@@ -5568,7 +5579,7 @@ _elm_gengrid_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_G
}
EOLIAN Eina_List*
-_elm_gengrid_efl_access_children_get(Eo *obj, Elm_Gengrid_Data *sd)
+_elm_gengrid_efl_access_object_access_children_get(const Eo *obj, Elm_Gengrid_Data *sd)
{
Eina_List *ret = NULL, *ret2 = NULL;
Elm_Gen_Item *it;
@@ -5576,17 +5587,17 @@ _elm_gengrid_efl_access_children_get(Eo *obj, Elm_Gengrid_Data *sd)
EINA_INLIST_FOREACH(sd->items, it)
ret = eina_list_append(ret, EO_OBJ(it));
- ret2 = efl_access_children_get(efl_super(obj, ELM_GENGRID_CLASS));
+ ret2 = efl_access_object_access_children_get(efl_super(obj, ELM_GENGRID_CLASS));
return eina_list_merge(ret, ret2);
}
EOLIAN Efl_Access_State_Set
-_elm_gengrid_efl_access_state_set_get(Eo *obj, Elm_Gengrid_Data *sd EINA_UNUSED)
+_elm_gengrid_efl_access_object_state_set_get(const Eo *obj, Elm_Gengrid_Data *sd EINA_UNUSED)
{
Efl_Access_State_Set ret;
- ret = efl_access_state_set_get(efl_super(obj, ELM_GENGRID_CLASS));
+ ret = efl_access_object_state_set_get(efl_super(obj, ELM_GENGRID_CLASS));
STATE_TYPE_SET(ret, EFL_ACCESS_STATE_MANAGES_DESCENDANTS);
@@ -5597,13 +5608,13 @@ _elm_gengrid_efl_access_state_set_get(Eo *obj, Elm_Gengrid_Data *sd EINA_UNUSED)
}
EOLIAN int
-_elm_gengrid_efl_access_selection_selected_children_count_get(Eo *objm EINA_UNUSED, Elm_Gengrid_Data *pd)
+_elm_gengrid_efl_access_selection_selected_children_count_get(const Eo *objm EINA_UNUSED, Elm_Gengrid_Data *pd)
{
return eina_list_count(pd->selected);
}
EOLIAN Eo*
-_elm_gengrid_efl_access_selection_selected_child_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *pd, int child_idx)
+_elm_gengrid_efl_access_selection_selected_child_get(const Eo *obj EINA_UNUSED, Elm_Gengrid_Data *pd, int child_idx)
{
return eina_list_nth(pd->selected, child_idx);
}
@@ -5673,7 +5684,7 @@ _elm_gengrid_efl_access_selection_all_children_select(Eo *obj, Elm_Gengrid_Data
}
EOLIAN Eina_Bool
-_elm_gengrid_efl_access_selection_clear(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *pd)
+_elm_gengrid_efl_access_selection_access_selection_clear(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *pd)
{
return _all_items_deselect(pd);
}
@@ -5714,6 +5725,8 @@ _elm_gengrid_efl_ui_focus_composition_prepare(Eo *obj, Elm_Gengrid_Data *pd)
{
if (item->base->disabled)
continue;
+ if (item->group)
+ continue;
order = eina_list_append(order, item->base->eo_obj);
}
@@ -5722,26 +5735,24 @@ _elm_gengrid_efl_ui_focus_composition_prepare(Eo *obj, Elm_Gengrid_Data *pd)
}
EOLIAN static Eina_Bool
-_elm_gengrid_elm_widget_focus_state_apply(Eo *obj, Elm_Gengrid_Data *pd EINA_UNUSED, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Elm_Widget *redirect EINA_UNUSED)
+_elm_gengrid_efl_ui_widget_focus_state_apply(Eo *obj, Elm_Gengrid_Data *pd EINA_UNUSED, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Efl_Ui_Widget *redirect EINA_UNUSED)
{
return efl_ui_widget_focus_state_apply(efl_super(obj, MY_CLASS), current_state, configured_state, obj);
}
EOLIAN static void
-_elm_gengrid_item_efl_ui_focus_object_prepare_logical(Eo *obj, Elm_Gen_Item *pd)
+_elm_gengrid_item_efl_ui_focus_object_prepare_logical_none_recursive(Eo *obj, Elm_Gen_Item *pd)
{
Eina_List *n;
- Elm_Widget *wid;
-
- _item_realize(pd);
+ Efl_Ui_Widget *wid;
EINA_LIST_FOREACH(pd->contents, n, wid)
{
- if (efl_isa(wid, ELM_WIDGET_CLASS))
+ if (efl_isa(wid, EFL_UI_WIDGET_CLASS))
_elm_widget_full_eval(wid);
}
- efl_ui_focus_object_prepare_logical(efl_super(obj, ELM_GENGRID_ITEM_CLASS));
+ efl_ui_focus_object_prepare_logical_none_recursive(efl_super(obj, ELM_GENGRID_ITEM_CLASS));
}
/* Standard widget overrides */
diff --git a/src/lib/elementary/elm_gengrid.eo b/src/lib/elementary/elm_gengrid.eo
index 133b20d51d..671831a347 100644
--- a/src/lib/elementary/elm_gengrid.eo
+++ b/src/lib/elementary/elm_gengrid.eo
@@ -1,5 +1,4 @@
import elm_general;
-import elm_gengrid_item;
type @extern Ecore_Pos_Map: __undefined_type; [[External ecore position map]]
@@ -10,9 +9,9 @@ enum Elm.Gengrid.Reorder_Type
swap [[Swap reorder type]]
}
-class Elm.Gengrid (Efl.Ui.Layout, Efl.Ui.Focus.Composition, Elm.Interface_Scrollable,
+class Elm.Gengrid (Efl.Ui.Layout.Object, Efl.Ui.Focus.Composition, Elm.Interface_Scrollable,
Efl.Ui.Clickable, Efl.Access.Widget.Action,
- Efl.Access.Selection)
+ Efl.Access.Selection, Efl.Ui.Legacy)
{
[[Elementary gengrid class]]
legacy_prefix: elm_gengrid;
@@ -67,17 +66,6 @@ class Elm.Gengrid (Efl.Ui.Layout, Efl.Ui.Focus.Composition, Elm.Interface_Scroll
fill: bool; [[$true if the grid is filled, $false otherwise]]
}
}
- @property page_relative {
- [[Control a given gengrid widget's scrolling page size, relative
- to its viewport size.
- ]]
- set {}
- get {}
- values {
- h_pagerel: double; [[Page relation horizontal]]
- v_pagerel: double; [[Page relation vertical]]
- }
- }
@property multi_select {
set {
[[Enable or disable multi-selection in a given gengrid widget.
@@ -269,15 +257,6 @@ class Elm.Gengrid (Efl.Ui.Layout, Efl.Ui.Focus.Composition, Elm.Interface_Scroll
$false to expand vertically.]]
}
}
- @property page_size {
- set {
- [[Set a given gengrid widget's scrolling page size.]]
- }
- values {
- h_pagesize: int; [[Page size horizontal]]
- v_pagesize: int; [[Page size vertical]]
- }
- }
@property selected_item {
get {
[[Get the selected item in a given gengrid widget.
@@ -348,28 +327,6 @@ class Elm.Gengrid (Efl.Ui.Layout, Efl.Ui.Focus.Composition, Elm.Interface_Scroll
(and on errors).]]
}
}
- @property wheel_disabled {
- set {
- [[Enable or disable mouse wheel to be used to scroll the gengrid.
-
- Mouse wheel can be used for the user to scroll up and down
- the gengrid.
-
- Wheel is enabled by default.
- ]]
- }
- get {
- [[Get a value whether mouse wheel is enabled or not.
-
- Mouse wheel can be used for the user to scroll up and down
- the gengrid.
- ]]
- }
- values {
- disabled: bool; [[Use $true to disable mouse wheel or $false
- to enable it.]]
- }
- }
item_insert_before {
[[Insert an item before another in a gengrid widget.
@@ -545,20 +502,20 @@ class Elm.Gengrid (Efl.Ui.Layout, Efl.Ui.Focus.Composition, Elm.Interface_Scroll
class.constructor;
Efl.Object.constructor;
Efl.Object.provider_find;
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set; }
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
Efl.Canvas.Group.group_member_add;
- Elm.Widget.theme_apply;
- Elm.Widget.on_access_update;
- Elm.Widget.interest_region { get; }
- Elm.Widget.widget_event;
- Elm.Widget.focus_highlight_geometry { get; }
- Elm.Widget.focused_item { get; }
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.on_access_update;
+ Efl.Ui.Widget.interest_region { get; }
+ Efl.Ui.Widget.widget_event;
+ Efl.Ui.Widget.focus_highlight_geometry { get; }
+ Efl.Ui.Widget.focused_item { get; }
Elm.Interface_Scrollable.item_loop_enabled { get; set; }
Elm.Interface_Scrollable.bounce_allow { set; }
Elm.Interface_Scrollable.policy { get; set; }
- Efl.Access.children { get; }
- Efl.Access.state_set { get; }
+ Efl.Access.Object.access_children { get; }
+ Efl.Access.Object.state_set { get; }
Efl.Access.Widget.Action.elm_actions { get; }
Efl.Access.Selection.selected_children_count { get; }
Efl.Access.Selection.selected_child { get; }
@@ -567,27 +524,27 @@ class Elm.Gengrid (Efl.Ui.Layout, Efl.Ui.Focus.Composition, Elm.Interface_Scroll
Efl.Access.Selection.child_deselect;
Efl.Access.Selection.is_child_selected;
Efl.Access.Selection.all_children_select;
- Efl.Access.Selection.clear;
+ Efl.Access.Selection.access_selection_clear;
Efl.Ui.Focus.Composition.prepare;
- Elm.Widget.focus_state_apply;
+ Efl.Ui.Widget.focus_state_apply;
Efl.Ui.Focus.Manager.setup_on_first_touch;
}
events {
- realized; [[Called when gengrid realized]]
- unrealized; [[Called when gengrid unrealized]]
- index,update; [[Called on gengrid index update]]
- scroll,page,changed; [[Called when scroll page changed]]
- edge,bottom; [[Called when bottom edge is reached]]
- edge,top; [[Called when top edge is reached]]
- edge,right; [[Called when right edge is reached]]
- edge,left; [[Called when left edge is reached]]
- item,focused; [[Called when item got focus]]
- item,unfocused; [[Called when item no longer has focus]]
- item,reorder,anim,start; [[Called when item reorder animation started]]
- item,reorder,anim,stop; [[Called when item reorder animation stopped]]
- activated; [[Called when gengrid got activated]]
- highlighted; [[Called when gengrid is highlighted]]
- unhighlighted; [[Called when gengrid is no longer highlighted]]
- released; [[Called when gengrid is released]]
+ realized: Efl.Object; [[Called when gengrid realized]]
+ unrealized: Efl.Object; [[Called when gengrid unrealized]]
+ index,update: Efl.Object; [[Called on gengrid index update]]
+ scroll,page,changed: void; [[Called when scroll page changed]]
+ edge,bottom: void; [[Called when bottom edge is reached]]
+ edge,top: void; [[Called when top edge is reached]]
+ edge,right: void; [[Called when right edge is reached]]
+ edge,left: void; [[Called when left edge is reached]]
+ item,focused: Efl.Object; [[Called when item got focus]]
+ item,unfocused: Efl.Object; [[Called when item no longer has focus]]
+ item,reorder,anim,start: Efl.Object; [[Called when item reorder animation started]]
+ item,reorder,anim,stop: Efl.Object; [[Called when item reorder animation stopped]]
+ activated: Efl.Object; [[Called when gengrid got activated]]
+ highlighted: Efl.Object; [[Called when gengrid is highlighted]]
+ unhighlighted: Efl.Object; [[Called when gengrid is no longer highlighted]]
+ released: Efl.Object; [[Called when gengrid is released]]
}
}
diff --git a/src/lib/elementary/elm_gengrid_item.eo b/src/lib/elementary/elm_gengrid_item.eo
index 8a0cb65220..de1515e1e4 100644
--- a/src/lib/elementary/elm_gengrid_item.eo
+++ b/src/lib/elementary/elm_gengrid_item.eo
@@ -1,31 +1,6 @@
import elm_general;
-type @extern Elm.Gengrid.Item.Class: __undefined_type; [[External elm gengrid item class]]
-
-enum Elm.Gengrid.Item.Scrollto_Type
-{
- [[Defines where to position the item in the genlist.]]
- legacy: elm_gengrid_item_scrollto;
- none = 0, [[No scrollto.]]
- in = (1 << 0), [[To the nearest viewport.]]
- top = (1 << 1), [[To the top of viewport.]]
- middle = (1 << 2), [[To the middle of viewport.]]
- bottom = (1 << 3) [[To the bottom of viewport.]]
-}
-
-enum Elm.Gengrid.Item.Field_Type
-{
- [[Defines the type of the item part Used while updating item's parts.
- It can be used at updating multi fields.]]
- legacy: elm_gengrid_item_field;
- all = 0, [[Type all]]
- text = (1 << 0), [[Type text]]
- content = (1 << 1), [[Type content]]
- state = (1 << 2) [[Type state]]
-}
-
-
-class Elm.Gengrid.Item(Elm.Widget.Item.Static_Focus, Efl.Ui.Focus.Object)
+class Elm.Gengrid.Item(Elm.Widget.Item.Static_Focus, Efl.Ui.Focus.Object, Efl.Ui.Legacy)
{
[[Elementary gengrid item class]]
legacy_prefix: elm_gengrid_item;
@@ -243,7 +218,7 @@ class Elm.Gengrid.Item(Elm.Widget.Item.Static_Focus, Efl.Ui.Focus.Object)
Elm.Widget.Item.del_pre;
Elm.Widget.Item.disable;
Elm.Widget.Item.signal_emit;
- Elm.Widget.Item.focus { get; set; }
+ Elm.Widget.Item.item_focus { get; set; }
Elm.Widget.Item.part_text { get; }
Elm.Widget.Item.part_content { get; }
Elm.Widget.Item.tooltip_text_set;
@@ -253,8 +228,8 @@ class Elm.Gengrid.Item(Elm.Widget.Item.Static_Focus, Efl.Ui.Focus.Object)
Elm.Widget.Item.tooltip_unset;
Elm.Widget.Item.cursor { set; }
Elm.Widget.Item.cursor_unset;
- Efl.Access.name { get; }
- Efl.Access.state_set { get; }
- Efl.Ui.Focus.Object.prepare_logical;
+ Efl.Access.Object.i18n_name { get; }
+ Efl.Access.Object.state_set { get; }
+ Efl.Ui.Focus.Object.prepare_logical_none_recursive;
}
}
diff --git a/src/lib/elementary/elm_gengrid_legacy.h b/src/lib/elementary/elm_gengrid_legacy.h
index d1ee0cc516..0b30cb51a7 100644
--- a/src/lib/elementary/elm_gengrid_legacy.h
+++ b/src/lib/elementary/elm_gengrid_legacy.h
@@ -211,5 +211,69 @@ EINA_DEPRECATED EAPI void elm_gengrid_last_page_get(const Evas_Object *
*/
EINA_DEPRECATED EAPI void elm_gengrid_page_bring_in(const Evas_Object *obj, int h_pagenumber, int v_pagenumber);
+/**
+ * @brief Set a given gengrid widget's scrolling page size.
+ *
+ * @param[in] obj The object.
+ * @param[in] h_pagesize Page size horizontal
+ * @param[in] v_pagesize Page size vertical
+ *
+ * @ingroup Elm_Gengrid
+ */
+EAPI void elm_gengrid_page_size_set(Evas_Object *obj, int h_pagesize, int v_pagesize);
+
+/**
+ * @brief Control a given gengrid widget's scrolling page size, relative to
+ * its viewport size.
+ *
+ * @param[in] obj The object.
+ * @param[in] h_pagerel Page relation horizontal
+ * @param[in] v_pagerel Page relation vertical
+ *
+ * @ingroup Elm_Gengrid
+ */
+EAPI void elm_gengrid_page_relative_set(Evas_Object *obj, double h_pagerel, double v_pagerel);
+
+/**
+ * @brief Control a given gengrid widget's scrolling page size, relative to
+ * its viewport size.
+ *
+ * @param[in] obj The object.
+ * @param[out] h_pagerel Page relation horizontal
+ * @param[out] v_pagerel Page relation vertical
+ *
+ * @ingroup Elm_Gengrid
+ */
+EAPI void elm_gengrid_page_relative_get(const Evas_Object *obj, double *h_pagerel, double *v_pagerel);
+
+
+/**
+ * @brief Enable or disable mouse wheel to be used to scroll the gengrid.
+ *
+ * Mouse wheel can be used for the user to scroll up and down the gengrid.
+ *
+ * Wheel is enabled by default.
+ *
+ * @param[in] obj The object.
+ * @param[in] disabled Use @c true to disable mouse wheel or @c false to enable
+ * it.
+ *
+ * @ingroup Elm_Gengrid
+ */
+EAPI void elm_gengrid_wheel_disabled_set(Evas_Object *obj, Eina_Bool disabled);
+
+/**
+ * @brief Get a value whether mouse wheel is enabled or not.
+ *
+ * Mouse wheel can be used for the user to scroll up and down the gengrid.
+ *
+ * @param[in] obj The object.
+ *
+ * @return Use @c true to disable mouse wheel or @c false to enable it.
+ *
+ * @ingroup Elm_Gengrid
+ */
+EAPI Eina_Bool elm_gengrid_wheel_disabled_get(const Evas_Object *obj);
+
#include "elm_gengrid_item.eo.legacy.h"
#include "elm_gengrid.eo.legacy.h"
diff --git a/src/lib/elementary/elm_gengrid_pan.eo b/src/lib/elementary/elm_gengrid_pan.eo
index 5372548d3f..cce3583ae7 100644
--- a/src/lib/elementary/elm_gengrid_pan.eo
+++ b/src/lib/elementary/elm_gengrid_pan.eo
@@ -7,8 +7,8 @@ class Elm.Gengrid.Pan (Elm.Pan)
implements {
class.constructor;
Efl.Object.destructor;
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set; }
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
Efl.Canvas.Group.group_calculate;
Elm.Pan.content_size { get; }
Elm.Pan.pos { get; set; }
diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c
index 07d2fcb087..d9525d9449 100644
--- a/src/lib/elementary/elm_genlist.c
+++ b/src/lib/elementary/elm_genlist.c
@@ -4,7 +4,7 @@
#include <fnmatch.h>
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_SELECTION_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define ELM_WIDGET_ITEM_PROTECTED
@@ -236,14 +236,14 @@ done:
}
EOLIAN static void
-_elm_genlist_pan_elm_pan_pos_get(Eo *obj EINA_UNUSED, Elm_Genlist_Pan_Data *psd, Evas_Coord *x, Evas_Coord *y)
+_elm_genlist_pan_elm_pan_pos_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Pan_Data *psd, Evas_Coord *x, Evas_Coord *y)
{
if (x) *x = psd->wsd->pan_x;
if (y) *y = psd->wsd->pan_y;
}
EOLIAN static void
-_elm_genlist_pan_elm_pan_pos_max_get(Eo *obj, Elm_Genlist_Pan_Data *psd, Evas_Coord *x, Evas_Coord *y)
+_elm_genlist_pan_elm_pan_pos_max_get(const Eo *obj, Elm_Genlist_Pan_Data *psd, Evas_Coord *x, Evas_Coord *y)
{
Evas_Coord ow, oh;
@@ -257,14 +257,14 @@ _elm_genlist_pan_elm_pan_pos_max_get(Eo *obj, Elm_Genlist_Pan_Data *psd, Evas_Co
}
EOLIAN static void
-_elm_genlist_pan_elm_pan_pos_min_get(Eo *obj EINA_UNUSED, Elm_Genlist_Pan_Data *_pd EINA_UNUSED, Evas_Coord *x, Evas_Coord *y)
+_elm_genlist_pan_elm_pan_pos_min_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Pan_Data *_pd EINA_UNUSED, Evas_Coord *x, Evas_Coord *y)
{
if (x) *x = 0;
if (y) *y = 0;
}
EOLIAN static void
-_elm_genlist_pan_elm_pan_content_size_get(Eo *obj EINA_UNUSED, Elm_Genlist_Pan_Data *psd, Evas_Coord *w, Evas_Coord *h)
+_elm_genlist_pan_elm_pan_content_size_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Pan_Data *psd, Evas_Coord *w, Evas_Coord *h)
{
if (w) *w = psd->wsd->minw;
if (h) *h = psd->wsd->minh;
@@ -279,12 +279,12 @@ _elm_genlist_pan_efl_canvas_group_group_del(Eo *obj, Elm_Genlist_Pan_Data *psd)
}
EOLIAN static void
-_elm_genlist_pan_efl_gfx_position_set(Eo *obj, Elm_Genlist_Pan_Data *psd, Eina_Position2D pos)
+_elm_genlist_pan_efl_gfx_entity_position_set(Eo *obj, Elm_Genlist_Pan_Data *psd, Eina_Position2D pos)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
- efl_gfx_position_set(efl_super(obj, MY_PAN_CLASS), pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_PAN_CLASS), pos);
psd->wsd->pan_changed = EINA_TRUE;
evas_object_smart_changed(obj);
@@ -301,7 +301,7 @@ _elm_genlist_pan_smart_resize_job(void *data)
}
EOLIAN static void
-_elm_genlist_pan_efl_gfx_size_set(Eo *obj, Elm_Genlist_Pan_Data *psd, Eina_Size2D size)
+_elm_genlist_pan_efl_gfx_entity_size_set(Eo *obj, Elm_Genlist_Pan_Data *psd, Eina_Size2D size)
{
Elm_Genlist_Data *sd = psd->wsd;
Eina_Size2D old;
@@ -309,7 +309,7 @@ _elm_genlist_pan_efl_gfx_size_set(Eo *obj, Elm_Genlist_Pan_Data *psd, Eina_Size2
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, size.w, size.h))
return;
- old = efl_gfx_size_get(obj);
+ old = efl_gfx_entity_size_get(obj);
if ((old.w == size.w) && (old.h == size.h)) goto super; // should already be intercepted above
if ((sd->mode == ELM_LIST_COMPRESS) && (old.w != size.w))
{
@@ -330,7 +330,7 @@ _elm_genlist_pan_efl_gfx_size_set(Eo *obj, Elm_Genlist_Pan_Data *psd, Eina_Size2
sd->calc_job = NULL;
super:
- efl_gfx_size_set(efl_super(obj, MY_PAN_CLASS), size);
+ efl_gfx_entity_size_set(efl_super(obj, MY_PAN_CLASS), size);
}
static void
@@ -368,7 +368,7 @@ _item_text_realize(Elm_Gen_Item *it,
edje_object_part_text_set(target, key, "");
}
if (_elm_config->atspi_mode)
- efl_access_name_changed_signal_emit(EO_OBJ(it));
+ efl_access_i18n_name_changed_signal_emit(EO_OBJ(it));
}
}
@@ -379,10 +379,11 @@ _widget_calculate_recursive(Eo *obj)
Eina_List *l;
Evas_Object *child;
- if (!efl_isa(obj, ELM_WIDGET_CLASS)) return;
+ if (!efl_isa(obj, EFL_UI_WIDGET_CLASS)) return;
- pd = efl_data_scope_get(obj, ELM_WIDGET_CLASS);
- if (!pd) return;
+ pd = efl_data_scope_get(obj, EFL_UI_WIDGET_CLASS);
+ if (!pd || !pd->resize_obj)
+ return;
if (!efl_canvas_group_need_recalculate_get(obj) &&
!efl_canvas_group_need_recalculate_get(pd->resize_obj))
@@ -446,12 +447,12 @@ _item_content_realize(Elm_Gen_Item *it,
// FIXME: Genlist item doesn't update its size when the size of
// content is changed, so deferred calculation for content should
// be performed before realization.
- if (efl_isa(content, ELM_WIDGET_CLASS))
+ if (efl_isa(content, EFL_UI_WIDGET_CLASS))
{
ELM_WIDGET_DATA_GET_OR_RETURN(content, wd);
// FIXME : Layout need sizing eval before group calculate
- if (efl_class_get(content) == EFL_UI_LAYOUT_CLASS)
+ if (efl_class_get(content) == EFL_UI_LAYOUT_OBJECT_CLASS)
elm_layout_sizing_eval(content);
_widget_calculate_recursive(content);
@@ -465,6 +466,11 @@ _item_content_realize(Elm_Gen_Item *it,
goto out;
}
elm_widget_sub_object_add(WIDGET(it), content);
+
+ if (elm_widget_is(content))
+ {
+ _elm_widget_full_eval(content);
+ }
}
*contents = eina_list_append(*contents, content);
@@ -568,7 +574,7 @@ _view_style_update(Elm_Gen_Item *it, Evas_Object *view, const char *style)
}
edje_object_mirrored_set(view, efl_ui_mirrored_get(WIDGET(it)));
- edje_object_scale_set(view, efl_gfx_scale_get(WIDGET(it))
+ edje_object_scale_set(view, efl_gfx_entity_scale_get(WIDGET(it))
* elm_config_scale_get());
stacking_even = edje_object_data_get(view, "stacking_even");
@@ -589,7 +595,7 @@ _view_create(Elm_Gen_Item *it, const char *style)
Evas_Object *view = edje_object_add(evas_object_evas_get(WIDGET(it)));
evas_object_smart_member_add(view, it->item->wsd->pan_obj);
elm_widget_sub_object_add(WIDGET(it), view);
- edje_object_scale_set(view, efl_gfx_scale_get(WIDGET(it)) *
+ edje_object_scale_set(view, efl_gfx_entity_scale_get(WIDGET(it)) *
elm_config_scale_get());
_view_style_update(it, view, style);
@@ -1131,7 +1137,7 @@ _item_sub_items_clear(Elm_Gen_Item *it)
EINA_LIST_FOREACH(it->item->items, l, eo_it2)
tl = eina_list_append(tl, eo_it2);
EINA_LIST_FREE(tl, eo_it2)
- elm_wdg_item_del(eo_it2);
+ efl_del(eo_it2);
}
static void
@@ -1400,7 +1406,7 @@ _decorate_all_item_realize(Elm_Gen_Item *it,
if (it->item->decorate_all_item_realized) return;
it->deco_all_view = edje_object_add(evas_object_evas_get(WIDGET(it)));
- edje_object_scale_set(it->deco_all_view, efl_gfx_scale_get(WIDGET(it)) *
+ edje_object_scale_set(it->deco_all_view, efl_gfx_entity_scale_get(WIDGET(it)) *
elm_config_scale_get());
evas_object_smart_member_add(it->deco_all_view, sd->pan_obj);
elm_widget_sub_object_add(WIDGET(it), it->deco_all_view);
@@ -1542,7 +1548,8 @@ _item_cache_free(Item_Cache *itc)
if (!itc) return;
evas_object_del(itc->spacer);
- evas_object_del(itc->base_view);
+ efl_wref_del(itc->base_view, &itc->base_view);
+ efl_del(itc->base_view);
itc->item_class = NULL;
EINA_LIST_FREE(itc->contents, c)
{
@@ -1603,7 +1610,7 @@ _item_cache_add(Elm_Gen_Item *it, Eina_List *contents)
return EINA_FALSE;
}
itc->spacer = it->spacer;
- itc->base_view = VIEW(it);
+ efl_wref_add(VIEW(it), &itc->base_view);
itc->item_class = it->itc;
itc->contents = contents;
if (it->item->type & ELM_GENLIST_ITEM_TREE)
@@ -1637,10 +1644,11 @@ _item_cache_add(Elm_Gen_Item *it, Eina_List *contents)
edje_object_mirrored_set(itc->base_view,
efl_ui_mirrored_get(WIDGET(it)));
edje_object_scale_set(itc->base_view,
- efl_gfx_scale_get(WIDGET(it))
+ efl_gfx_entity_scale_get(WIDGET(it))
* elm_config_scale_get());
it->spacer = NULL;
+ efl_wref_del(it->base->view, &it->base->view);
VIEW(it) = NULL;
evas_object_hide(itc->base_view);
evas_object_move(itc->base_view, -9999, -9999);
@@ -1676,8 +1684,9 @@ _item_cache_find(Elm_Gen_Item *it)
if (!itc) continue;
it->spacer = itc->spacer;
- VIEW(it) = itc->base_view;
+ VIEW_SET(it, itc->base_view);
itc->spacer = NULL;
+ efl_wref_del(itc->base_view, &itc->base_view);
itc->base_view = NULL;
eina_list_free(itc->contents);
itc->contents = NULL;
@@ -1832,7 +1841,7 @@ _item_realize(Elm_Gen_Item *it, const int index, Eina_Bool calc)
if (sd->tree_effect_enabled ||
(!_item_cache_find(it)))
{
- VIEW(it) = _view_create(it, it->itc->item_style);
+ VIEW_SET(it, _view_create(it, it->itc->item_style));
if (it->item->nocache_once)
it->item->nocache_once = EINA_FALSE;
}
@@ -2045,6 +2054,15 @@ _item_realize(Elm_Gen_Item *it, const int index, Eina_Bool calc)
if (it->decorate_it_set) _decorate_item_set(it);
edje_object_message_signal_process(VIEW(it));
+
+ if (sd->focus_on_realization == it)
+ {
+ _elm_widget_item_highlight_in_theme(WIDGET(it), EO_OBJ(it));
+ _elm_widget_highlight_in_theme_update(WIDGET(it));
+ _elm_widget_focus_highlight_start(WIDGET(it));
+ efl_ui_focus_manager_focus_set(WIDGET(it), EO_OBJ(it));
+ sd->focus_on_realization = NULL;
+ }
}
static void
@@ -3096,42 +3114,13 @@ _key_action_move(Evas_Object *obj, const char *params)
(obj, NULL, NULL, &v_w, &v_h);
_elm_widget_focus_auto_show(obj);
- if (!strcmp(dir, "left"))
- {
- x -= step_x;
- Elm_Object_Item *eo_gt = elm_genlist_selected_item_get(obj);
- ELM_GENLIST_ITEM_DATA_GET(eo_gt, gt);
- _elm_genlist_item_content_focus_set(gt, ELM_FOCUS_LEFT);
-
- return EINA_FALSE;
- }
- else if (!strcmp(dir, "right"))
- {
- x += step_x;
-
- Elm_Object_Item *eo_gt = elm_genlist_selected_item_get(obj);
- ELM_GENLIST_ITEM_DATA_GET(eo_gt, gt);
- _elm_genlist_item_content_focus_set(gt, ELM_FOCUS_RIGHT);
-
- return EINA_FALSE;
- }
- else if (!strcmp(dir, "up"))
- {
- if (_key_action_move_dir(obj, ELM_FOCUS_UP, EINA_FALSE)) return EINA_TRUE;
- else return EINA_FALSE;
- }
- else if (!strcmp(dir, "up_multi"))
+ if (!strcmp(dir, "up_multi"))
{
if (_key_action_move_dir(obj, ELM_FOCUS_UP, EINA_TRUE)) return EINA_TRUE;
else if (_key_action_move_dir(obj, ELM_FOCUS_UP, EINA_FALSE)) return EINA_TRUE;
else return EINA_FALSE;
}
- else if (!strcmp(dir, "down"))
- {
- if (_key_action_move_dir(obj, ELM_FOCUS_DOWN, EINA_FALSE)) return EINA_TRUE;
- else return EINA_FALSE;
- }
else if (!strcmp(dir, "down_multi"))
{
if (_key_action_move_dir(obj, ELM_FOCUS_DOWN, EINA_TRUE)) return EINA_TRUE;
@@ -3273,7 +3262,7 @@ _key_action_escape(Evas_Object *obj, const char *params EINA_UNUSED)
}
EOLIAN static Eina_Bool
-_elm_genlist_elm_widget_widget_sub_object_add(Eo *obj, Elm_Genlist_Data *_pd EINA_UNUSED, Evas_Object *sobj)
+_elm_genlist_efl_ui_widget_widget_sub_object_add(Eo *obj, Elm_Genlist_Data *_pd EINA_UNUSED, Evas_Object *sobj)
{
/* skipping layout's code, which registers size hint changing
* callback on sub objects. this is here because items'
@@ -3281,11 +3270,11 @@ _elm_genlist_elm_widget_widget_sub_object_add(Eo *obj, Elm_Genlist_Data *_pd EIN
* creation, thus issuing TOO MANY sizing_eval()'s here. they are
* not needed at here anyway, so let's skip listening to those
* hints changes */
- return elm_widget_sub_object_add(efl_cast(obj, ELM_WIDGET_CLASS), sobj);
+ return elm_widget_sub_object_add(efl_cast(obj, EFL_UI_WIDGET_CLASS), sobj);
}
EOLIAN static Eina_Bool
-_elm_genlist_elm_widget_widget_sub_object_del(Eo *obj, Elm_Genlist_Data *sd, Evas_Object *sobj)
+_elm_genlist_efl_ui_widget_widget_sub_object_del(Eo *obj, Elm_Genlist_Data *sd, Evas_Object *sobj)
{
Eina_Bool int_ret = EINA_FALSE;
@@ -3365,62 +3354,64 @@ _elm_genlist_nearest_visible_item_get(Evas_Object *obj, Elm_Object_Item *eo_it)
return eo_it;
}
-EOLIAN static Eina_Bool
-_elm_genlist_elm_widget_on_focus_update(Eo *obj, Elm_Genlist_Data *sd, Elm_Object_Item *item EINA_UNUSED)
+EOLIAN static void
+_elm_genlist_efl_ui_focus_manager_setup_on_first_touch(Eo *obj, Elm_Genlist_Data *sd, Efl_Ui_Focus_Direction direction EINA_UNUSED, Efl_Ui_Focus_Object *entry EINA_UNUSED)
{
- Eina_Bool int_ret = EINA_FALSE;
Elm_Object_Item *eo_it = NULL;
Eina_Bool is_sel = EINA_FALSE;
- int_ret = efl_ui_widget_on_focus_update(efl_super(obj, MY_CLASS), NULL);
- if (!int_ret) return EINA_FALSE;
-
- if (efl_ui_focus_object_focus_get(obj) && (sd->items) && (sd->selected) &&
- (!sd->last_selected_item))
+ if (sd->last_focused_item)
+ eo_it = sd->last_focused_item;
+ else if (sd->last_selected_item)
+ eo_it = sd->last_selected_item;
+ else if (_elm_config->first_item_focus_on_first_focus_in)
{
- sd->last_selected_item = eina_list_data_get(sd->selected);
+ eo_it = elm_genlist_first_item_get(obj);
+ is_sel = EINA_TRUE;
}
- if (efl_ui_focus_object_focus_get(obj) && !sd->mouse_down)
+ while (eo_it)
{
- if (sd->last_focused_item)
- eo_it = sd->last_focused_item;
- else if (sd->last_selected_item)
- eo_it = sd->last_selected_item;
- else if (_elm_config->first_item_focus_on_first_focus_in)
- {
- eo_it = elm_genlist_first_item_get(obj);
- is_sel = EINA_TRUE;
- }
-
- while (eo_it)
- {
- ELM_GENLIST_ITEM_DATA_GET(eo_it, it);
- if ((!_is_no_select(it)) && (!elm_object_item_disabled_get(eo_it)))
- break;
- eo_it = EO_OBJ(ELM_GEN_ITEM_NEXT(it));
- }
+ ELM_GENLIST_ITEM_DATA_GET(eo_it, it);
+ if ((!_is_no_select(it)) && (!elm_object_item_disabled_get(eo_it)))
+ break;
+ eo_it = EO_OBJ(ELM_GEN_ITEM_NEXT(it));
+ }
+ if (eo_it)
+ {
+ eo_it = _elm_genlist_nearest_visible_item_get(obj, eo_it);
if (eo_it)
{
- eo_it = _elm_genlist_nearest_visible_item_get(obj, eo_it);
- if (eo_it)
- {
- if (!_elm_config->item_select_on_focus_disable && is_sel)
- elm_genlist_item_selected_set(eo_it, EINA_TRUE);
- else
- elm_object_item_focus_set(eo_it, EINA_TRUE);
- _elm_widget_focus_highlight_start(obj);
- }
+ if (!_elm_config->item_select_on_focus_disable && is_sel)
+ elm_genlist_item_selected_set(eo_it, EINA_TRUE);
+ else
+ elm_object_item_focus_set(eo_it, EINA_TRUE);
+ _elm_widget_focus_highlight_start(obj);
+ //set it again in the manager, there might be the case that the manager focus history and internal item foused logic are in different states
+ if (efl_ui_focus_manager_request_subchild(obj, eo_it))
+ efl_ui_focus_manager_focus_set(obj, eo_it);
}
}
else
{
- if (sd->focused_item)
- {
- sd->last_focused_item = sd->focused_item;
- _elm_genlist_item_unfocused(sd->focused_item);
- }
+ //Just set evas focus on the genlist itself, events will pass on and a other element will be taken
+ evas_object_focus_set(obj, EINA_TRUE);
+ }
+}
+
+EOLIAN static Eina_Bool
+_elm_genlist_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Genlist_Data *sd)
+{
+ Eina_Bool int_ret = EINA_FALSE;
+
+ int_ret = efl_ui_focus_object_on_focus_update(efl_super(obj, MY_CLASS));
+ if (!int_ret) return EINA_FALSE;
+
+ if (efl_ui_focus_object_focus_get(obj) && (sd->items) && (sd->selected) &&
+ (!sd->last_selected_item))
+ {
+ sd->last_selected_item = eina_list_data_get(sd->selected);
}
return EINA_TRUE;
@@ -3435,11 +3426,11 @@ _mirrored_set(Evas_Object *obj,
ELM_GENLIST_DATA_GET(obj, sd);
_item_cache_zero(sd);
- elm_interface_scrollable_mirrored_set(obj, rtl);
+ efl_ui_mirrored_set(obj, rtl);
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_genlist_elm_widget_theme_apply(Eo *obj, Elm_Genlist_Data *sd)
+_elm_genlist_efl_ui_widget_theme_apply(Eo *obj, Elm_Genlist_Data *sd)
{
Item_Block *itb;
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
@@ -3723,9 +3714,7 @@ _elm_genlist_item_del_serious(Elm_Gen_Item *it)
sd->item_count--;
_elm_genlist_item_del_not_serious(it);
- //(it->walking == -1) means it's already removed from the list.
- if (it->walking != -1)
- sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(it));
+ sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(it));
if (it->tooltip.del_cb)
it->tooltip.del_cb((void *)it->tooltip.data, WIDGET(it), it);
ELM_SAFE_FREE(it->long_timer, ecore_timer_del);
@@ -4700,6 +4689,9 @@ _queue_process(Elm_Genlist_Data *sd)
double t0, t;
t0 = ecore_time_get();
+
+ if (sd->queue) efl_ui_focus_composition_prepare(sd->obj);
+
for (n = 0; (sd->queue) && (n < ITEM_QUEUE_MAX); n++)
{
Elm_Gen_Item *it;
@@ -4934,15 +4926,19 @@ _item_mouse_up_cb(void *data,
it->down = EINA_FALSE;
ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
+ evas_object_ref(WIDGET(it));
+ efl_ref(EO_OBJ(it));
sd->mouse_down = EINA_FALSE;
+
efl_event_callback_legacy_call(WIDGET(it), ELM_GENLIST_EVENT_RELEASED, EO_OBJ(it));
+
if (sd->multi_touched)
{
if ((!sd->multi) && (!it->selected) && (it->highlighted))
_item_unhighlight(it);
- if (sd->multi_down) return;
+ if (sd->multi_down) goto early;
_multi_touch_gesture_eval(it);
- return;
+ goto early;
}
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
sd->on_hold = EINA_TRUE;
@@ -4968,7 +4964,7 @@ _item_mouse_up_cb(void *data,
sd->longpressed = EINA_FALSE;
sd->on_hold = EINA_FALSE;
sd->wasselected = EINA_FALSE;
- return;
+ goto early;
}
if ((sd->reorder_mode) && (sd->reorder_it))
{
@@ -5002,7 +4998,7 @@ _item_mouse_up_cb(void *data,
if (!sd->wasselected) _item_unselect(it);
sd->longpressed = EINA_FALSE;
sd->wasselected = EINA_FALSE;
- return;
+ goto early;
}
if (dragged)
{
@@ -5022,7 +5018,7 @@ _item_mouse_up_cb(void *data,
!it->base->still_in ||
_is_no_select(it) ||
(elm_wdg_item_disabled_get(EO_OBJ(it))))
- return;
+ goto early;
evas_object_ref(sd->obj);
@@ -5068,14 +5064,19 @@ _item_mouse_up_cb(void *data,
if (_item_select(it)) goto deleted;
}
-deleted:
+ deleted:
evas_object_unref(sd->obj);
+ early:
+ evas_object_unref(WIDGET(it));
+ efl_unref(EO_OBJ(it));
}
static void
_item_mouse_callbacks_add(Elm_Gen_Item *it,
Evas_Object *view)
{
+ if (it->callbacks) return ;
+ it->callbacks = EINA_TRUE;
evas_object_event_callback_add
(view, EVAS_CALLBACK_MOUSE_DOWN, _item_mouse_down_cb, it);
evas_object_event_callback_add
@@ -5096,6 +5097,8 @@ static void
_item_mouse_callbacks_del(Elm_Gen_Item *it,
Evas_Object *view)
{
+ if (!it->callbacks) return ;
+ it->callbacks = EINA_FALSE;
evas_object_event_callback_del_full
(view, EVAS_CALLBACK_MOUSE_DOWN, _item_mouse_down_cb, it);
evas_object_event_callback_del_full
@@ -5205,7 +5208,7 @@ _item_unrealize(Elm_Gen_Item *it)
if (!_item_cache_add(it, _content_cache_add(it, &cache)))
{
- ELM_SAFE_FREE(VIEW(it), evas_object_del);
+ ELM_SAFE_FREE(VIEW(it), efl_del);
ELM_SAFE_FREE(it->spacer, evas_object_del);
EINA_LIST_FREE(cache, c)
{
@@ -5704,49 +5707,51 @@ _elm_genlist_efl_canvas_group_group_del(Eo *obj, Elm_Genlist_Data *sd)
int i;
elm_genlist_clear(obj);
+ _item_cache_zero(sd);
+
+ efl_canvas_group_del(efl_super(obj, MY_CLASS));
+
for (i = 0; i < 2; i++)
ELM_SAFE_FREE(sd->stack[i], evas_object_del);
evas_event_callback_del_full(evas_object_evas_get(obj),
EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE,
_evas_viewport_resize_cb, sd);
+
+ ELM_SAFE_FREE(sd->calc_job, ecore_job_del);
+ ELM_SAFE_FREE(sd->update_job, ecore_job_del);
ELM_SAFE_FREE(sd->pan_obj, evas_object_del);
+ ELM_SAFE_FREE(sd->queue_idle_enterer, ecore_idle_enterer_del);
+ ELM_SAFE_FREE(sd->must_recalc_idler, ecore_idler_del);
+ ELM_SAFE_FREE(sd->multi_timer, ecore_timer_del);
+ ELM_SAFE_FREE(sd->size_caches, eina_hash_free);
- _item_cache_zero(sd);
- ecore_job_del(sd->calc_job);
- ecore_job_del(sd->update_job);
- ecore_idle_enterer_del(sd->queue_idle_enterer);
- ecore_idler_del(sd->must_recalc_idler);
- ecore_timer_del(sd->multi_timer);
- eina_stringshare_del(sd->decorate_it_type);
- eina_hash_free(sd->size_caches);
+ eina_stringshare_replace(&sd->decorate_it_type, NULL);
_elm_genlist_tree_effect_stop(sd);
-
- efl_canvas_group_del(efl_super(obj, MY_CLASS));
}
EOLIAN static void
-_elm_genlist_efl_gfx_position_set(Eo *obj, Elm_Genlist_Data *sd, Eina_Position2D pos)
+_elm_genlist_efl_gfx_entity_position_set(Eo *obj, Elm_Genlist_Data *sd, Eina_Position2D pos)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
- efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
- efl_gfx_position_set(sd->hit_rect, pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
+ efl_gfx_entity_position_set(sd->hit_rect, pos);
}
EOLIAN static void
-_elm_genlist_efl_gfx_size_set(Eo *obj, Elm_Genlist_Data *sd, Eina_Size2D sz)
+_elm_genlist_efl_gfx_entity_size_set(Eo *obj, Elm_Genlist_Data *sd, Eina_Size2D sz)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
- efl_gfx_size_set(sd->hit_rect, sz);
+ efl_gfx_entity_size_set(sd->hit_rect, sz);
if ((sd->queue) && (!sd->queue_idle_enterer) && (sz.w > 0))
_requeue_idle_enterer(sd);
- efl_gfx_size_set(efl_super(obj, MY_CLASS), sz);
+ efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
}
EOLIAN static void
@@ -5785,7 +5790,7 @@ _access_obj_process(Elm_Genlist_Data *sd, Eina_Bool is_access)
}
EOLIAN static void
-_elm_genlist_elm_widget_on_access_update(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, Eina_Bool acs)
+_elm_genlist_efl_ui_widget_on_access_update(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, Eina_Bool acs)
{
_elm_genlist_smart_focus_next_enable = acs;
_access_obj_process(sd, _elm_genlist_smart_focus_next_enable);
@@ -5802,23 +5807,15 @@ static void
_genlist_element_focused(void *data, const Efl_Event *ev)
{
ELM_GENLIST_DATA_GET(data, pd);
- Elm_Widget *focused = efl_ui_focus_manager_focus_get(ev->object);
+ Efl_Ui_Widget *focused = efl_ui_focus_manager_focus_get(ev->object);
Elm_Widget_Item *item;
if (!focused) return;
- if (efl_isa(focused, EFL_UI_FOCUS_COMPOSITION_ADAPTER_CLASS))
- item = efl_parent_get(focused);
- else
- item = efl_ui_focus_parent_provider_find_logical_parent(pd->provider, focused);
+ item = efl_ui_focus_parent_provider_gen_item_fetch(pd->provider, focused);
- if (efl_isa(item, ELM_GENLIST_ITEM_CLASS))
- {
- _elm_genlist_item_focused(item);
- _all_items_deselect(pd);
- elm_genlist_item_selected_set(item, EINA_TRUE);
- elm_genlist_item_bring_in(item, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
- }
+ EINA_SAFETY_ON_FALSE_RETURN(efl_isa(item, ELM_GENLIST_ITEM_CLASS));
+ elm_object_item_focus_set(item, EINA_TRUE);
}
EOLIAN static Eo *
@@ -5838,7 +5835,7 @@ _elm_genlist_efl_object_constructor(Eo *obj, Elm_Genlist_Data *sd)
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_LIST);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_LIST);
efl_event_callback_add(obj, EFL_UI_FOCUS_MANAGER_EVENT_FOCUSED, _genlist_element_focused, obj);
@@ -5868,8 +5865,8 @@ _internal_elm_genlist_clear(Evas_Object *obj)
// because sd->items can be modified inside elm_widget_item_del()
while (sd->items)
{
- it = EINA_INLIST_CONTAINER_GET(sd->items->last, Elm_Gen_Item);
- elm_wdg_item_del(EO_OBJ(it));
+ it = EINA_INLIST_CONTAINER_GET(sd->items, Elm_Gen_Item);
+ efl_del(EO_OBJ(it));
}
sd->pan_changed = EINA_TRUE;
@@ -5924,6 +5921,7 @@ _item_select(Elm_Gen_Item *it)
Evas_Object *obj = WIDGET(it);
ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
Elm_Object_Item *eo_it = EO_OBJ(it);
+ Eina_Bool r = EINA_FALSE;
if (elm_wdg_item_disabled_get(eo_it)) return EINA_FALSE;
if (_is_no_select(it) || (it->decorate_it_set)) return EINA_FALSE;
@@ -5949,9 +5947,8 @@ _item_select(Elm_Gen_Item *it)
eina_list_append(sd->selected, eo_it);
}
- evas_object_ref(obj);
+ efl_ref(eo_it);
- it->walking++;
elm_object_item_focus_set(eo_it, EINA_TRUE);
if ((it->base)->on_deletion) goto item_deleted;
_elm_genlist_item_content_focus_set(it, ELM_FOCUS_PREVIOUS);
@@ -5965,27 +5962,25 @@ _item_select(Elm_Gen_Item *it)
if (_elm_config->atspi_mode)
efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_SELECTED, EINA_TRUE);
// delete item if it's requested deletion in the above callbacks.
- if ((it->base)->on_deletion) goto item_deleted;
- it->walking--;
+ if ((it->base)->on_deletion)
+ {
+ r = EINA_TRUE;
+ goto item_deleted;
+ }
if (!(sd->focus_on_selection_enabled || _elm_config->item_select_on_focus_disable))
{
efl_ui_focus_manager_focus_set(obj, it->base->eo_obj);
}
- evas_object_unref(obj);
- return EINA_FALSE;
+ item_deleted:
+ efl_unref(eo_it);
-item_deleted:
- it->walking = -1; //This item was removed from it's item list.
- _item_del(it);
- efl_del(eo_it);
- evas_object_unref(obj);
- return EINA_TRUE;
+ return r;
}
EOLIAN static Evas_Object *
-_elm_genlist_item_elm_widget_item_part_content_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it, const char * part)
+_elm_genlist_item_elm_widget_item_part_content_get(const Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it, const char * part)
{
Evas_Object *ret = NULL;
if (it->deco_all_view)
@@ -6003,7 +5998,7 @@ _elm_genlist_item_elm_widget_item_part_content_get(Eo *eo_it EINA_UNUSED, Elm_Ge
}
EOLIAN static const char *
-_elm_genlist_item_elm_widget_item_part_text_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it, const char * part)
+_elm_genlist_item_elm_widget_item_part_text_get(const Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it, const char * part)
{
if (!it->itc->func.text_get) return NULL;
const char *ret = NULL;
@@ -6053,7 +6048,7 @@ _elm_genlist_item_elm_widget_item_disable(Eo *eo_it, Elm_Gen_Item *it)
}
}
-EOLIAN static Eina_Bool
+EOLIAN static void
_elm_genlist_item_elm_widget_item_del_pre(Eo *eo_it EINA_UNUSED,
Elm_Gen_Item *it)
{
@@ -6061,17 +6056,10 @@ _elm_genlist_item_elm_widget_item_del_pre(Eo *eo_it EINA_UNUSED,
_item_select(). Just pend removing. Because this will be removed right
after in the _item_select(). So pratically, this item won't be
dangled. */
- if (it->walking > 0)
- {
- ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
- sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(it));
- return EINA_FALSE;
- }
if (_elm_config->atspi_mode)
efl_access_children_changed_del_signal_emit(WIDGET(it),eo_it);
_item_del(it);
- return EINA_TRUE;
}
EOLIAN static void
@@ -6113,7 +6101,7 @@ _elm_genlist_item_elm_widget_item_style_set(Eo *eo_it,
}
EOLIAN static const char *
-_elm_genlist_item_elm_widget_item_style_get(Eo *eo_it EINA_UNUSED,
+_elm_genlist_item_elm_widget_item_style_get(const Eo *eo_it EINA_UNUSED,
Elm_Gen_Item *it)
{
if (it->itc) return it->itc->item_style;
@@ -6121,7 +6109,7 @@ _elm_genlist_item_elm_widget_item_style_get(Eo *eo_it EINA_UNUSED,
}
EOLIAN static void
-_elm_genlist_item_elm_widget_item_focus_set(Eo *eo_it, Elm_Gen_Item *it, Eina_Bool focused)
+_elm_genlist_item_elm_widget_item_item_focus_set(Eo *eo_it, Elm_Gen_Item *it, Eina_Bool focused)
{
Evas_Object *obj = WIDGET(it);
ELM_GENLIST_DATA_GET(obj, sd);
@@ -6147,6 +6135,12 @@ _elm_genlist_item_elm_widget_item_focus_set(Eo *eo_it, Elm_Gen_Item *it, Eina_Bo
_elm_widget_item_highlight_in_theme(obj, EO_OBJ(it));
_elm_widget_highlight_in_theme_update(obj);
_elm_widget_focus_highlight_start(obj);
+ efl_ui_focus_manager_focus_set(it->base->widget, eo_it);
+ sd->focus_on_realization = NULL;
+ }
+ else
+ {
+ sd->focus_on_realization = it;
}
}
}
@@ -6159,7 +6153,7 @@ _elm_genlist_item_elm_widget_item_focus_set(Eo *eo_it, Elm_Gen_Item *it, Eina_Bo
}
EOLIAN static Eina_Bool
-_elm_genlist_item_elm_widget_item_focus_get(Eo *eo_it, Elm_Gen_Item *it)
+_elm_genlist_item_elm_widget_item_item_focus_get(const Eo *eo_it, Elm_Gen_Item *it)
{
Evas_Object *obj = WIDGET(it);
ELM_GENLIST_DATA_GET(obj, sd);
@@ -6176,7 +6170,7 @@ _elm_genlist_item_efl_object_constructor(Eo *eo_it, Elm_Gen_Item *it)
eo_it = efl_constructor(efl_super(eo_it, ELM_GENLIST_ITEM_CLASS));
it->base = efl_data_scope_get(eo_it, ELM_WIDGET_ITEM_CLASS);
- efl_access_role_set(eo_it, EFL_ACCESS_ROLE_LIST_ITEM);
+ efl_access_object_role_set(eo_it, EFL_ACCESS_ROLE_LIST_ITEM);
return eo_it;
}
@@ -6697,7 +6691,7 @@ _elm_genlist_multi_select_set(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, Eina_Bo
}
EOLIAN static Eina_Bool
-_elm_genlist_multi_select_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
+_elm_genlist_multi_select_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
{
return sd->multi;
}
@@ -6713,13 +6707,13 @@ _elm_genlist_multi_select_mode_set(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, El
}
EOLIAN static Elm_Object_Multi_Select_Mode
-_elm_genlist_multi_select_mode_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
+_elm_genlist_multi_select_mode_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
{
return sd->multi_select_mode;
}
EOLIAN static Elm_Object_Item*
-_elm_genlist_selected_item_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
+_elm_genlist_selected_item_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
{
if (sd->selected)
return sd->selected->data;
@@ -6728,13 +6722,13 @@ _elm_genlist_selected_item_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
}
EOLIAN static const Eina_List*
-_elm_genlist_selected_items_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
+_elm_genlist_selected_items_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
{
return sd->selected;
}
EOLIAN static Eina_List*
-_elm_genlist_realized_items_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
+_elm_genlist_realized_items_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
{
Item_Block *itb;
Eina_Bool done = EINA_FALSE;
@@ -6813,7 +6807,7 @@ _elm_genlist_at_xy_item_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, Eva
}
EOLIAN static Elm_Object_Item*
-_elm_genlist_first_item_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
+_elm_genlist_first_item_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
{
Elm_Gen_Item *it = ELM_GEN_ITEM_FROM_INLIST(sd->items);
@@ -6824,7 +6818,7 @@ _elm_genlist_first_item_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
}
EOLIAN static Elm_Object_Item*
-_elm_genlist_last_item_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
+_elm_genlist_last_item_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
{
Elm_Gen_Item *it;
@@ -6838,7 +6832,7 @@ _elm_genlist_last_item_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
}
EOLIAN static Elm_Object_Item *
-_elm_genlist_item_next_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
+_elm_genlist_item_next_get(const Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
{
ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
@@ -6849,7 +6843,7 @@ _elm_genlist_item_next_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
}
EOLIAN static Elm_Object_Item *
-_elm_genlist_item_prev_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
+_elm_genlist_item_prev_get(const Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
{
ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
@@ -6860,7 +6854,7 @@ _elm_genlist_item_prev_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
}
EOLIAN static Elm_Object_Item *
-_elm_genlist_item_parent_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
+_elm_genlist_item_parent_item_get(const Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
{
ELM_GENLIST_ITEM_CHECK_OR_RETURN(it, NULL);
@@ -6876,7 +6870,7 @@ _elm_genlist_item_subitems_count(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *item)
}
EOLIAN static const Eina_List *
-_elm_genlist_item_subitems_get(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *item)
+_elm_genlist_item_subitems_get(const Eo *eo_item EINA_UNUSED, Elm_Gen_Item *item)
{
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item, NULL);
@@ -6914,7 +6908,7 @@ _elm_genlist_item_selected_set(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it,
}
EOLIAN static Eina_Bool
-_elm_genlist_item_selected_get(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it)
+_elm_genlist_item_selected_get(const Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it)
{
ELM_GENLIST_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
@@ -7067,7 +7061,7 @@ _elm_genlist_item_expanded_set(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it, Eina_B
}
EOLIAN static Eina_Bool
-_elm_genlist_item_expanded_get(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it)
+_elm_genlist_item_expanded_get(const Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it)
{
ELM_GENLIST_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
@@ -7075,7 +7069,7 @@ _elm_genlist_item_expanded_get(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it)
}
EOLIAN static int
-_elm_genlist_item_expanded_depth_get(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it)
+_elm_genlist_item_expanded_depth_get(const Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it)
{
ELM_GENLIST_ITEM_CHECK_OR_RETURN(it, 0);
@@ -7329,7 +7323,7 @@ _elm_genlist_item_item_class_update(Eo *eo_it, Elm_Gen_Item *it,
}
EOLIAN static const Elm_Genlist_Item_Class *
-_elm_genlist_item_item_class_get(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it)
+_elm_genlist_item_item_class_get(const Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it)
{
ELM_GENLIST_ITEM_CHECK_OR_RETURN(it, NULL);
@@ -7468,7 +7462,7 @@ elm_genlist_item_tooltip_style_get(const Elm_Object_Item *it)
}
EOLIAN static const char *
-_elm_genlist_item_elm_widget_item_tooltip_style_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
+_elm_genlist_item_elm_widget_item_tooltip_style_get(const Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
{
return it->tooltip.style;
}
@@ -7504,7 +7498,7 @@ elm_genlist_item_tooltip_window_mode_get(const Elm_Object_Item *eo_it)
}
EOLIAN static Eina_Bool
-_elm_genlist_item_elm_widget_item_tooltip_window_mode_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
+_elm_genlist_item_elm_widget_item_tooltip_window_mode_get(const Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
{
return it->tooltip.free_size;
}
@@ -7576,7 +7570,7 @@ elm_genlist_item_cursor_engine_only_get(const Elm_Object_Item *eo_it)
}
EOLIAN static int
-_elm_genlist_item_index_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
+_elm_genlist_item_index_get(const Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
{
int cnt = 1;
Elm_Gen_Item *tmp;
@@ -7616,7 +7610,7 @@ _elm_genlist_mode_set(Eo *obj, Elm_Genlist_Data *sd, Elm_List_Mode mode)
}
EOLIAN static Elm_List_Mode
-_elm_genlist_mode_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
+_elm_genlist_mode_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
{
return sd->mode;
}
@@ -7650,7 +7644,7 @@ elm_genlist_bounce_get(const Evas_Object *obj,
}
EOLIAN static void
-_elm_genlist_elm_interface_scrollable_bounce_allow_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, Eina_Bool *h_bounce, Eina_Bool *v_bounce)
+_elm_genlist_elm_interface_scrollable_bounce_allow_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, Eina_Bool *h_bounce, Eina_Bool *v_bounce)
{
if (h_bounce) *h_bounce = sd->h_bounce;
if (v_bounce) *v_bounce = sd->v_bounce;
@@ -7663,7 +7657,7 @@ _elm_genlist_homogeneous_set(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, Eina_Boo
}
EOLIAN static Eina_Bool
-_elm_genlist_homogeneous_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
+_elm_genlist_homogeneous_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
{
return sd->homogeneous;
}
@@ -7679,7 +7673,7 @@ _elm_genlist_block_count_set(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, int coun
}
EOLIAN static int
-_elm_genlist_block_count_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
+_elm_genlist_block_count_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
{
return sd->max_items_per_block;
}
@@ -7719,7 +7713,10 @@ _item_filtered_get(Elm_Gen_Item *it)
l = eina_list_data_find_list(sd->filter_queue, it);
if (l)
sd->filter_queue = eina_list_remove_list(sd->filter_queue, l);
- l = eina_list_data_find_list(sd->queue, it);
+ if (it->item->queued)
+ l = eina_list_data_find_list(sd->queue, it);
+ else
+ l = NULL;
if (l)
{
sd->queue = eina_list_remove_list(sd->queue, l);
@@ -7918,7 +7915,7 @@ _elm_genlist_longpress_timeout_set(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, do
}
EOLIAN static double
-_elm_genlist_longpress_timeout_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
+_elm_genlist_longpress_timeout_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
{
return sd->longpress_timeout;
}
@@ -7952,7 +7949,7 @@ elm_genlist_scroller_policy_get(const Evas_Object *obj,
}
EOLIAN static void
-_elm_genlist_elm_interface_scrollable_policy_get(Eo *obj, Elm_Genlist_Data *sd EINA_UNUSED, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v)
+_elm_genlist_elm_interface_scrollable_policy_get(const Eo *obj, Elm_Genlist_Data *sd EINA_UNUSED, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v)
{
Elm_Scroller_Policy s_policy_h, s_policy_v;
@@ -8029,20 +8026,20 @@ _elm_genlist_item_decorate_mode_set(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it,
}
EOLIAN static const char *
-_elm_genlist_item_decorate_mode_get(Eo *eo_i EINA_UNUSED, Elm_Gen_Item *i)
+_elm_genlist_item_decorate_mode_get(const Eo *eo_i EINA_UNUSED, Elm_Gen_Item *i)
{
ELM_GENLIST_ITEM_CHECK_OR_RETURN(i, NULL);
return i->item->wsd->decorate_it_type;
}
EOLIAN static Elm_Object_Item *
-_elm_genlist_decorated_item_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
+_elm_genlist_decorated_item_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
{
return EO_OBJ(sd->mode_item);
}
EOLIAN static Eina_Bool
-_elm_genlist_decorate_mode_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
+_elm_genlist_decorate_mode_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
{
return sd->decorate_all_mode;
}
@@ -8137,13 +8134,13 @@ _elm_genlist_reorder_mode_set(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, Eina_Bo
}
EOLIAN static Eina_Bool
-_elm_genlist_reorder_mode_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
+_elm_genlist_reorder_mode_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
{
return sd->reorder_mode;
}
EOLIAN static Elm_Genlist_Item_Type
-_elm_genlist_item_type_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
+_elm_genlist_item_type_get(const Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
{
ELM_GENLIST_ITEM_CHECK_OR_RETURN(it, ELM_GENLIST_ITEM_MAX);
@@ -8174,7 +8171,7 @@ _elm_genlist_item_pin_set(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it, Eina_Bool pin
}
EOLIAN static Eina_Bool
-_elm_genlist_item_pin_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
+_elm_genlist_item_pin_get(const Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
{
ELM_GENLIST_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
ELM_GENLIST_DATA_GET(WIDGET(it), sd);
@@ -8276,7 +8273,7 @@ _elm_genlist_item_flip_set(Eo *eo_it, Elm_Gen_Item *it, Eina_Bool flip)
}
EOLIAN static Eina_Bool
-_elm_genlist_item_flip_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
+_elm_genlist_item_flip_get(const Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
{
ELM_GENLIST_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
@@ -8305,7 +8302,7 @@ _elm_genlist_select_mode_set(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, Elm_Obje
}
EOLIAN static Elm_Object_Select_Mode
-_elm_genlist_select_mode_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
+_elm_genlist_select_mode_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
{
return sd->select_mode;
}
@@ -8317,7 +8314,7 @@ _elm_genlist_highlight_mode_set(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, Eina_
}
EOLIAN static Eina_Bool
-_elm_genlist_highlight_mode_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
+_elm_genlist_highlight_mode_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
{
return sd->highlight;
}
@@ -8358,7 +8355,7 @@ _elm_genlist_item_select_mode_set(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it,
}
EOLIAN static Elm_Object_Select_Mode
-_elm_genlist_item_select_mode_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
+_elm_genlist_item_select_mode_get(const Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
{
ELM_GENLIST_ITEM_CHECK_OR_RETURN(it, ELM_OBJECT_SELECT_MODE_MAX);
@@ -8366,12 +8363,12 @@ _elm_genlist_item_select_mode_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
}
EOLIAN Efl_Access_State_Set
-_elm_genlist_item_efl_access_state_set_get(Eo *eo_it, Elm_Gen_Item *it EINA_UNUSED)
+_elm_genlist_item_efl_access_object_state_set_get(const Eo *eo_it, Elm_Gen_Item *it EINA_UNUSED)
{
Efl_Access_State_Set ret;
Eina_Bool sel;
- ret = efl_access_state_set_get(efl_super(eo_it, ELM_GENLIST_ITEM_CLASS));
+ ret = efl_access_object_state_set_get(efl_super(eo_it, ELM_GENLIST_ITEM_CLASS));
sel = elm_obj_genlist_item_selected_get(eo_it);
@@ -8391,13 +8388,13 @@ _elm_genlist_item_efl_access_state_set_get(Eo *eo_it, Elm_Gen_Item *it EINA_UNUS
}
EOLIAN const char*
-_elm_genlist_item_efl_access_name_get(Eo *eo_it, Elm_Gen_Item *it)
+_elm_genlist_item_efl_access_object_i18n_name_get(const Eo *eo_it, Elm_Gen_Item *it)
{
const char *ret;
Eina_Strbuf *buf;
char *accessible_name;
- ret = efl_access_name_get(efl_super(eo_it, ELM_GENLIST_ITEM_CLASS));
+ ret = efl_access_object_i18n_name_get(efl_super(eo_it, ELM_GENLIST_ITEM_CLASS));
if (ret) return ret;
buf = eina_strbuf_new();
@@ -8443,7 +8440,7 @@ _elm_genlist_tree_effect_enabled_set(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd,
}
EOLIAN static Eina_Bool
-_elm_genlist_tree_effect_enabled_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
+_elm_genlist_tree_effect_enabled_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
{
return sd->tree_effect_enabled;
}
@@ -8455,7 +8452,7 @@ _elm_genlist_focus_on_selection_set(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, E
}
EOLIAN static Eina_Bool
-_elm_genlist_focus_on_selection_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
+_elm_genlist_focus_on_selection_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
{
return sd->focus_on_selection_enabled;
}
@@ -8481,7 +8478,7 @@ elm_genlist_nth_item_get(const Evas_Object *obj, unsigned int nth)
}
EOLIAN static Eina_Rect
-_elm_genlist_elm_widget_focus_highlight_geometry_get(Eo *obj, Elm_Genlist_Data *sd)
+_elm_genlist_efl_ui_widget_focus_highlight_geometry_get(const Eo *obj, Elm_Genlist_Data *sd)
{
Evas_Coord ox, oy, oh, ow, item_x = 0, item_y = 0, item_w = 0, item_h = 0;
Eina_Rect r = {};
@@ -8568,7 +8565,7 @@ _elm_genlist_search_by_text_item_get(Eo *obj EINA_UNUSED,
}
EOLIAN static Elm_Object_Item*
-_elm_genlist_elm_widget_focused_item_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
+_elm_genlist_efl_ui_widget_focused_item_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
{
return sd->focused_item;
}
@@ -8580,7 +8577,7 @@ _elm_genlist_elm_interface_scrollable_item_loop_enabled_set(Eo *obj EINA_UNUSED,
}
EOLIAN static Eina_Bool
-_elm_genlist_elm_interface_scrollable_item_loop_enabled_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
+_elm_genlist_elm_interface_scrollable_item_loop_enabled_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
{
return sd->item_loop_enable;
}
@@ -8595,7 +8592,7 @@ _elm_genlist_class_constructor(Efl_Class *klass)
}
EOLIAN const Efl_Access_Action_Data *
-_elm_genlist_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *pd EINA_UNUSED)
+_elm_genlist_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *pd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "move,prior", "move", "prior", _key_action_move},
@@ -8617,7 +8614,7 @@ _elm_genlist_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_G
}
EOLIAN Eina_List*
-_elm_genlist_efl_access_children_get(Eo *obj, Elm_Genlist_Data *sd)
+_elm_genlist_efl_access_object_access_children_get(const Eo *obj, Elm_Genlist_Data *sd)
{
Eina_List *ret = NULL, *ret2 = NULL;
Elm_Gen_Item *it;
@@ -8625,17 +8622,17 @@ _elm_genlist_efl_access_children_get(Eo *obj, Elm_Genlist_Data *sd)
EINA_INLIST_FOREACH(sd->items, it)
ret = eina_list_append(ret, EO_OBJ(it));
- ret2 = efl_access_children_get(efl_super(obj, ELM_GENLIST_CLASS));
+ ret2 = efl_access_object_access_children_get(efl_super(obj, ELM_GENLIST_CLASS));
return eina_list_merge(ret, ret2);
}
EOLIAN Efl_Access_State_Set
-_elm_genlist_efl_access_state_set_get(Eo *obj, Elm_Genlist_Data *sd EINA_UNUSED)
+_elm_genlist_efl_access_object_state_set_get(const Eo *obj, Elm_Genlist_Data *sd EINA_UNUSED)
{
Efl_Access_State_Set ret;
- ret = efl_access_state_set_get(efl_super(obj, ELM_GENLIST_CLASS));
+ ret = efl_access_object_state_set_get(efl_super(obj, ELM_GENLIST_CLASS));
STATE_TYPE_SET(ret, EFL_ACCESS_STATE_MANAGES_DESCENDANTS);
@@ -8649,13 +8646,13 @@ _elm_genlist_efl_access_state_set_get(Eo *obj, Elm_Genlist_Data *sd EINA_UNUSED)
}
EOLIAN int
-_elm_genlist_efl_access_selection_selected_children_count_get(Eo *objm EINA_UNUSED, Elm_Genlist_Data *pd)
+_elm_genlist_efl_access_selection_selected_children_count_get(const Eo *objm EINA_UNUSED, Elm_Genlist_Data *pd)
{
return eina_list_count(pd->selected);
}
EOLIAN Eo*
-_elm_genlist_efl_access_selection_selected_child_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *pd, int child_idx)
+_elm_genlist_efl_access_selection_selected_child_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *pd, int child_idx)
{
return eina_list_nth(pd->selected, child_idx);
}
@@ -8725,7 +8722,7 @@ _elm_genlist_efl_access_selection_all_children_select(Eo *obj, Elm_Genlist_Data
}
EOLIAN Eina_Bool
-_elm_genlist_efl_access_selection_clear(Eo *obj EINA_UNUSED, Elm_Genlist_Data *pd)
+_elm_genlist_efl_access_selection_access_selection_clear(Eo *obj EINA_UNUSED, Elm_Genlist_Data *pd)
{
return _all_items_deselect(pd);
}
@@ -8756,7 +8753,7 @@ _elm_genlist_efl_object_provider_find(const Eo *obj, Elm_Genlist_Data *pd, const
return efl_provider_find(efl_super(obj, ELM_GENLIST_CLASS), klass);
}
-EOLIAN static void
+EOLIAN static void
_elm_genlist_efl_ui_focus_composition_prepare(Eo *obj, Elm_Genlist_Data *pd)
{
Elm_Gen_Item *item;
@@ -8766,32 +8763,41 @@ _elm_genlist_efl_ui_focus_composition_prepare(Eo *obj, Elm_Genlist_Data *pd)
{
if (item->base->disabled)
continue;
+ if (item->item->type == ELM_GENLIST_ITEM_GROUP)
+ continue;
order = eina_list_append(order, item->base->eo_obj);
}
efl_ui_focus_composition_elements_set(obj, order);
+
+ EINA_INLIST_FOREACH(pd->items, item)
+ {
+ if (item->base->disabled)
+ continue;
+
+ efl_ui_focus_object_prepare_logical(item->base->eo_obj);
+ }
+
}
-EOLIAN static void
-_elm_genlist_item_efl_ui_focus_object_prepare_logical(Eo *obj, Elm_Gen_Item *pd)
+EOLIAN static void
+_elm_genlist_item_efl_ui_focus_object_prepare_logical_none_recursive(Eo *obj, Elm_Gen_Item *pd)
{
Eina_List *n;
- Elm_Widget *wid;
-
- _item_realize(pd, pd->item->order_num_in, EINA_FALSE);
+ Efl_Ui_Widget *wid;
EINA_LIST_FOREACH(pd->contents, n, wid)
{
- if (efl_isa(wid, ELM_WIDGET_CLASS))
+ if (efl_isa(wid, EFL_UI_WIDGET_CLASS))
_elm_widget_full_eval(wid);
}
- efl_ui_focus_object_prepare_logical(efl_super(obj, ELM_GENLIST_ITEM_CLASS));
+ efl_ui_focus_object_prepare_logical_none_recursive(efl_super(obj, ELM_GENLIST_ITEM_CLASS));
}
-EOLIAN static Eina_Bool
-_elm_genlist_elm_widget_focus_state_apply(Eo *obj, Elm_Genlist_Data *pd EINA_UNUSED, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Elm_Widget *redirect EINA_UNUSED)
+EOLIAN static Eina_Bool
+_elm_genlist_efl_ui_widget_focus_state_apply(Eo *obj, Elm_Genlist_Data *pd EINA_UNUSED, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Efl_Ui_Widget *redirect EINA_UNUSED)
{
return efl_ui_widget_focus_state_apply(efl_super(obj, MY_CLASS), current_state, configured_state, obj);
}
diff --git a/src/lib/elementary/elm_genlist.eo b/src/lib/elementary/elm_genlist.eo
index 1c5d74c8bd..e4ff2d218b 100644
--- a/src/lib/elementary/elm_genlist.eo
+++ b/src/lib/elementary/elm_genlist.eo
@@ -1,10 +1,8 @@
import elm_general;
-import elm_list;
-import elm_genlist_item;
-class Elm.Genlist (Efl.Ui.Layout, Efl.Ui.Focus.Composition, Elm.Interface_Scrollable, Efl.Ui.Clickable,
- Efl.Access.Widget_Action, Efl.Access.Selection,
- Efl.Ui.Selectable)
+class Elm.Genlist (Efl.Ui.Layout.Object, Efl.Ui.Focus.Composition, Elm.Interface_Scrollable, Efl.Ui.Clickable,
+ Efl.Access.Widget.Action, Efl.Access.Selection,
+ Efl.Ui.Selectable, Efl.Ui.Legacy)
{
[[Elementary genlist class]]
legacy_prefix: elm_genlist;
@@ -529,23 +527,23 @@ class Elm.Genlist (Efl.Ui.Layout, Efl.Ui.Focus.Composition, Elm.Interface_Scroll
implements {
class.constructor;
Efl.Object.constructor;
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set; }
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
Efl.Canvas.Group.group_member_add;
Efl.Object.provider_find;
- Elm.Widget.theme_apply;
- Elm.Widget.widget_sub_object_add;
- Elm.Widget.on_access_update;
- Elm.Widget.focus_highlight_geometry { get; }
- Elm.Widget.on_focus_update;
- Elm.Widget.widget_sub_object_del;
- Elm.Widget.widget_event;
- Elm.Widget.focused_item { get; }
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.widget_sub_object_add;
+ Efl.Ui.Widget.on_access_update;
+ Efl.Ui.Widget.focus_highlight_geometry { get; }
+ Efl.Ui.Focus.Object.on_focus_update;
+ Efl.Ui.Widget.widget_sub_object_del;
+ Efl.Ui.Widget.widget_event;
+ Efl.Ui.Widget.focused_item { get; }
Elm.Interface_Scrollable.item_loop_enabled { get; set; }
Elm.Interface_Scrollable.bounce_allow { get; set; }
Elm.Interface_Scrollable.policy { get; set; }
- Efl.Access.children { get; }
- Efl.Access.state_set { get; }
+ Efl.Access.Object.access_children { get; }
+ Efl.Access.Object.state_set { get; }
Efl.Access.Widget.Action.elm_actions { get; }
Efl.Access.Selection.selected_children_count { get; }
Efl.Access.Selection.selected_child { get; }
@@ -554,45 +552,46 @@ class Elm.Genlist (Efl.Ui.Layout, Efl.Ui.Focus.Composition, Elm.Interface_Scroll
Efl.Access.Selection.child_deselect;
Efl.Access.Selection.is_child_selected;
Efl.Access.Selection.all_children_select;
- Efl.Access.Selection.clear;
+ Efl.Access.Selection.access_selection_clear;
Efl.Ui.Focus.Composition.prepare;
- Elm.Widget.focus_state_apply;
+ Efl.Ui.Widget.focus_state_apply;
+ Efl.Ui.Focus.Manager.setup_on_first_touch;
}
events {
- item,focused; [[Called when genlist item got focus]]
- item,unfocused; [[Called when genlist item lost focus]]
- vbar,drag; [[Called when vertical bar is dragged]]
- vbar,press; [[Called when vertical bar is pressed]]
- vbar,unpress; [[Called when vertical bar is no longer pressed]]
- hbar,drag; [[Called when horizontal bar is dragged]]
- hbar,press; [[Called when horizontal bar is pressed]]
- hbar,unpress; [[Called when horizontal bar is no longer pressed]]
- edge,top; [[Called when top edge is reached]]
- edge,bottom; [[Called when bottom edge is reached]]
- edge,left; [[Called when left edge is reached]]
- edge,right; [[Called when right edge is reached]]
- moved; [[Called when genlist item moved]]
- moved,before; [[Called when genlist item moved before]]
- moved,after; [[Called when genlist item moved after]]
- swipe; [[Called when swipe is detected]]
- multi,pinch,in; [[Called when multitouch pinch in detected]]
- multi,pinch,out; [[Called when multitouch pinch out detected]]
- multi,swipe,down; [[Called when multitouch swipe down detected]]
- multi,swipe,up; [[Called when multitouch swipe up detected]]
- multi,swipe,right; [[Called when multitouch swipe right detected]]
- multi,swipe,left; [[Called when multitouch swipe left detected]]
- released; [[Called when genlist is released]]
- activated; [[called when genlist is activated]]
- highlighted; [[Called when genlist is highlighted]]
- unhighlighted; [[Called when genlist is no longer highlighted]]
- realized; [[Called when genlist is realized]]
- unrealized; [[Called when genlist is unrealized]]
- contract,request; [[Called when contract is requested]]
- expand,request; [[Called when expand is requested]]
- contracted; [[called when genlist is contracted]]
- expanded; [[Called when genlist is expanded]]
- index,update; [[Called when genlist index updated]]
- tree,effect,finished; [[Called when genlist tree effect finished]]
- filter,done; [[Called when genlist filter is done]]
+ item,focused: Efl.Object; [[Called when genlist item got focus]]
+ item,unfocused: Efl.Object; [[Called when genlist item lost focus]]
+ vbar,drag: void; [[Called when vertical bar is dragged]]
+ vbar,press: void; [[Called when vertical bar is pressed]]
+ vbar,unpress: void; [[Called when vertical bar is no longer pressed]]
+ hbar,drag: void; [[Called when horizontal bar is dragged]]
+ hbar,press: void; [[Called when horizontal bar is pressed]]
+ hbar,unpress: void; [[Called when horizontal bar is no longer pressed]]
+ edge,top: void; [[Called when top edge is reached]]
+ edge,bottom: void; [[Called when bottom edge is reached]]
+ edge,left: void; [[Called when left edge is reached]]
+ edge,right: void; [[Called when right edge is reached]]
+ moved: Efl.Object; [[Called when genlist item moved]]
+ moved,before: Efl.Object; [[Called when genlist item moved before]]
+ moved,after: Efl.Object; [[Called when genlist item moved after]]
+ swipe: Efl.Object; [[Called when swipe is detected]]
+ multi,pinch,in: Efl.Object; [[Called when multitouch pinch in detected]]
+ multi,pinch,out: Efl.Object; [[Called when multitouch pinch out detected]]
+ multi,swipe,down: Efl.Object; [[Called when multitouch swipe down detected]]
+ multi,swipe,up: Efl.Object; [[Called when multitouch swipe up detected]]
+ multi,swipe,right: Efl.Object; [[Called when multitouch swipe right detected]]
+ multi,swipe,left: Efl.Object; [[Called when multitouch swipe left detected]]
+ released: Efl.Object; [[Called when genlist is released]]
+ activated: Efl.Object; [[called when genlist is activated]]
+ highlighted: Efl.Object; [[Called when genlist is highlighted]]
+ unhighlighted: Efl.Object; [[Called when genlist is no longer highlighted]]
+ realized: Efl.Object; [[Called when genlist is realized]]
+ unrealized: Efl.Object; [[Called when genlist is unrealized]]
+ contract,request: Efl.Object; [[Called when contract is requested]]
+ expand,request: Efl.Object; [[Called when expand is requested]]
+ contracted: Efl.Object; [[called when genlist is contracted]]
+ expanded: Efl.Object; [[Called when genlist is expanded]]
+ index,update: Efl.Object; [[Called when genlist index updated]]
+ tree,effect,finished: void; [[Called when genlist tree effect finished]]
+ filter,done: void; [[Called when genlist filter is done]]
}
}
diff --git a/src/lib/elementary/elm_genlist_item.eo b/src/lib/elementary/elm_genlist_item.eo
index 64fb0982a6..714c486b1d 100644
--- a/src/lib/elementary/elm_genlist_item.eo
+++ b/src/lib/elementary/elm_genlist_item.eo
@@ -1,44 +1,6 @@
import elm_general;
-type @extern Elm.Genlist.Item.Class: __undefined_type; [[External elm genlist item class]]
-
-enum Elm.Genlist.Item.Type
-{
- [[Defines if the item is of any special type (has subitems or it's the
- index of a group), or is just a simple item.
- ]]
- legacy: elm_genlist_item;
- none = 0, [[Simple item.]]
- tree = (1 << 0), [[This may be expanded and have child items.]]
- group = (1 << 1), [[An index item of a group of items. this item can have child items.]]
- max = (1 << 2) [[Sentinel value to indicate last enum field during iteration]]
-}
-
-enum Elm.Genlist.Item.Field_Type
-{
- [[Defines the type of the item part
- Used while updating item's parts
- It can be used at updating multi fields.
- ]]
- legacy: elm_genlist_item_field;
- all = 0, [[Type all]]
- text = (1 << 0), [[Type text]]
- content = (1 << 1), [[Type content]]
- state = (1 << 2) [[Type state]]
-}
-
-enum Elm.Genlist.Item.Scrollto_Type
-{
- [[Defines where to position the item in the genlist.]]
- legacy: elm_genlist_item_scrollto;
- none = 0, [[Nothing will happen, Don't use this value.]]
- in = (1 << 0), [[To the nearest viewport.]]
- top = (1 << 1), [[To the top of viewport.]]
- middle = (1 << 2), [[To the middle of viewport.]]
- bottom = (1 << 3) [[To the bottom of viewport.]]
-}
-
-class Elm.Genlist.Item(Elm.Widget.Item.Static_Focus)
+class Elm.Genlist.Item(Elm.Widget.Item.Static_Focus, Efl.Ui.Legacy)
{
[[Elementary genlist item class]]
legacy_prefix: elm_genlist_item;
@@ -55,6 +17,12 @@ class Elm.Genlist.Item(Elm.Widget.Item.Static_Focus)
If filter is set on genlist, this returns the filtered
item placed before $item in the list.
+
+ Note that parent / child relationship is not taken into
+ account, the previous visual item is always returned,
+ could it be a parent, a child or a group item.
+
+ NULL is returned if called on the first item.
]]
}
values {
@@ -72,17 +40,18 @@ class Elm.Genlist.Item(Elm.Widget.Item.Static_Focus)
If filter is set on genlist, this returns the filtered
item placed after $item in the list.
- Also the next item means item in the same tree level.
- If a item has subitems, and it have expand all subitems
- will be ignore, and will get the next item in the same
- level.
+ Note that parent / child relationship is not taken into
+ account, the next visual item is always returned, could
+ it be a parent, a child or a group item.
+
+ NULL is returned if called on the last item.
]]
}
values {
item: Elm.Widget.Item; [[The item after $item, or $null if there's none (and on errors).]]
}
}
- @property parent {
+ @property parent_item {
get {
[[Get the parent item of the given item
@@ -90,6 +59,7 @@ class Elm.Genlist.Item(Elm.Widget.Item.Static_Focus)
of the item $it on \@ref elm_genlist_item_append
and insertion related functions.
]]
+ legacy: elm_genlist_item_parent_get;
}
values {
item: Elm.Widget.Item; [[The parent of the item or $null if it has no parent.]]
@@ -97,7 +67,7 @@ class Elm.Genlist.Item(Elm.Widget.Item.Static_Focus)
}
@property subitems {
get {
- [[et the list of subitems of a given item
+ [[Get the list of subitems of a given item
This returns the list of subitems that an item
possesses. It cannot be changed.
@@ -449,7 +419,7 @@ class Elm.Genlist.Item(Elm.Widget.Item.Static_Focus)
Elm.Widget.Item.disable;
Elm.Widget.Item.signal_emit;
Elm.Widget.Item.style { get; set; }
- Elm.Widget.Item.focus { get; set; }
+ Elm.Widget.Item.item_focus { get; set; }
Elm.Widget.Item.part_text { get; }
Elm.Widget.Item.part_content { get; }
Elm.Widget.Item.tooltip_text_set;
@@ -459,8 +429,8 @@ class Elm.Genlist.Item(Elm.Widget.Item.Static_Focus)
Elm.Widget.Item.tooltip_unset;
Elm.Widget.Item.cursor { set; }
Elm.Widget.Item.cursor_unset;
- Efl.Access.name { get; }
- Efl.Access.state_set { get; }
- Efl.Ui.Focus.Object.prepare_logical;
+ Efl.Access.Object.i18n_name { get; }
+ Efl.Access.Object.state_set { get; }
+ Efl.Ui.Focus.Object.prepare_logical_none_recursive;
}
}
diff --git a/src/lib/elementary/elm_genlist_pan.eo b/src/lib/elementary/elm_genlist_pan.eo
index f7ac810abb..9f1966cb31 100644
--- a/src/lib/elementary/elm_genlist_pan.eo
+++ b/src/lib/elementary/elm_genlist_pan.eo
@@ -7,8 +7,8 @@ class Elm.Genlist.Pan (Elm.Pan)
implements {
class.constructor;
Efl.Object.destructor;
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set; }
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
Efl.Canvas.Group.group_calculate;
Elm.Pan.content_size { get; }
Elm.Pan.pos { get; set; }
@@ -16,7 +16,9 @@ class Elm.Genlist.Pan (Elm.Pan)
Elm.Pan.pos_max { get; }
}
events {
+ /* FIXME: Nobody emits these
item,focused; [[Called when item got focus]]
item,unfocused; [[Called when item lost focus]]
+ */
}
}
diff --git a/src/lib/elementary/elm_gesture_layer.c b/src/lib/elementary/elm_gesture_layer.c
index 239e7cb826..2ea1c69589 100644
--- a/src/lib/elementary/elm_gesture_layer.c
+++ b/src/lib/elementary/elm_gesture_layer.c
@@ -63,7 +63,7 @@ _glayer_buf_dup(void *buf, size_t size)
ELM_GESTURE_LAYER_DATA_GET(o, ptr); \
if (!ptr) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -72,7 +72,7 @@ _glayer_buf_dup(void *buf, size_t size)
ELM_GESTURE_LAYER_DATA_GET(o, ptr); \
if (!ptr) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
@@ -1657,7 +1657,7 @@ _taps_rect_get(Eina_List *taps, int idx, Eina_Rectangle *r)
* @ingroup Elm_Gesture_Layer
*/
static Eina_Bool
-_tap_gesture_check_finish(Gesture_Info *gesture, Evas_Coord tap_finger_size)
+_tap_gesture_check_finish(Gesture_Info *gesture)
{
/* Here we check if taps-gesture was completed successfully */
/* Count how many taps were received on each device then */
@@ -1668,8 +1668,8 @@ _tap_gesture_check_finish(Gesture_Info *gesture, Evas_Coord tap_finger_size)
Eina_List *pe_list;
Eina_Rectangle base = {0, 0, 0, 0};
Eina_Rectangle tmp = {0, 0, 0, 0};
- if (!tap_finger_size) /* Use system default if not set by user */
- tap_finger_size = elm_config_finger_size_get();
+
+ ELM_GESTURE_LAYER_DATA_GET(gesture->obj, sd);
if (!st->l) return EINA_FALSE;
EINA_LIST_FOREACH(st->l, l, pe_list)
@@ -1690,16 +1690,16 @@ _tap_gesture_check_finish(Gesture_Info *gesture, Evas_Coord tap_finger_size)
{ /* Compare all other rects to base, tolerance is finger size */
if (_taps_rect_get(st->l, i, &tmp))
{
- if (abs(tmp.x - base.x) > tap_finger_size)
+ if (abs(tmp.x - base.x) > sd->tap_finger_size)
return EINA_FALSE;
- if (abs(tmp.y - base.y) > tap_finger_size)
+ if (abs(tmp.y - base.y) > sd->tap_finger_size)
return EINA_FALSE;
- if (abs((tmp.x + tmp.w) - (base.x + base.w)) > tap_finger_size)
+ if (abs((tmp.x + tmp.w) - (base.x + base.w)) > sd->tap_finger_size)
return EINA_FALSE;
- if (abs((tmp.y + tmp.h) - (base.y + base.h)) > tap_finger_size)
+ if (abs((tmp.y + tmp.h) - (base.y + base.h)) > sd->tap_finger_size)
return EINA_FALSE;
}
}
@@ -1717,14 +1717,14 @@ _tap_gesture_check_finish(Gesture_Info *gesture, Evas_Coord tap_finger_size)
* @ingroup Elm_Gesture_Layer
*/
static void
-_tap_gesture_finish(void *data, Evas_Coord tap_finger_size)
+_tap_gesture_finish(void *data)
{
/* This function will test each tap gesture when timer expires */
Elm_Gesture_State s = ELM_GESTURE_STATE_ABORT;
Gesture_Info *gesture = data;
Taps_Type *st = gesture->data;
- if (_tap_gesture_check_finish(gesture, tap_finger_size))
+ if (_tap_gesture_check_finish(gesture))
{
s = ELM_GESTURE_STATE_END;
}
@@ -1750,16 +1750,13 @@ _multi_tap_timeout(void *data)
ELM_GESTURE_LAYER_DATA_GET(data, sd);
if (IS_TESTED(ELM_GESTURE_N_TAPS))
- _tap_gesture_finish(sd->gesture[ELM_GESTURE_N_TAPS],
- sd->tap_finger_size);
+ _tap_gesture_finish(sd->gesture[ELM_GESTURE_N_TAPS]);
if (IS_TESTED(ELM_GESTURE_N_DOUBLE_TAPS))
- _tap_gesture_finish(sd->gesture[ELM_GESTURE_N_DOUBLE_TAPS],
- sd->tap_finger_size);
+ _tap_gesture_finish(sd->gesture[ELM_GESTURE_N_DOUBLE_TAPS]);
if (IS_TESTED(ELM_GESTURE_N_TRIPLE_TAPS))
- _tap_gesture_finish(sd->gesture[ELM_GESTURE_N_TRIPLE_TAPS],
- sd->tap_finger_size);
+ _tap_gesture_finish(sd->gesture[ELM_GESTURE_N_TRIPLE_TAPS]);
_clear_if_finished(data);
sd->gest_taps_timeout = NULL;
@@ -1950,9 +1947,9 @@ _tap_gesture_test(Evas_Object *obj,
((gesture->g_type == ELM_GESTURE_N_DOUBLE_TAPS) &&
!IS_TESTED(ELM_GESTURE_N_TRIPLE_TAPS)))
{ /* Test for finish immediately, not waiting for timeout */
- if (_tap_gesture_check_finish(gesture, sd->tap_finger_size))
+ if (_tap_gesture_check_finish(gesture))
{
- _tap_gesture_finish(gesture, sd->tap_finger_size);
+ _tap_gesture_finish(gesture);
return;
}
}
@@ -3740,7 +3737,7 @@ _rotate_test(Evas_Object *obj,
}
EOLIAN static Eina_Bool
-_elm_gesture_layer_elm_widget_on_disabled_update(Eo *obj, Elm_Gesture_Layer_Data *_pd EINA_UNUSED, Eina_Bool disabled)
+_elm_gesture_layer_efl_ui_widget_on_disabled_update(Eo *obj, Elm_Gesture_Layer_Data *_pd EINA_UNUSED, Eina_Bool disabled)
{
if (disabled)
_callbacks_unregister(obj);
@@ -3772,6 +3769,7 @@ _elm_gesture_layer_efl_canvas_group_group_add(Eo *obj, Elm_Gesture_Layer_Data *p
priv->long_tap_start_timeout = _elm_config->glayer_long_tap_start_timeout;
priv->repeat_events = EINA_TRUE;
priv->glayer_continues_enable = _elm_config->glayer_continues_enable;
+ priv->tap_finger_size = _elm_config->glayer_tap_finger_size;
/* FIXME: Hack to get around old configs - if too small, enlarge. */
if (_elm_config->glayer_double_tap_timeout < 0.00001)
@@ -3847,7 +3845,7 @@ _elm_gesture_layer_efl_object_constructor(Eo *obj, Elm_Gesture_Layer_Data *_pd E
}
EOLIAN static Eina_Bool
-_elm_gesture_layer_hold_events_get(Eo *obj EINA_UNUSED, Elm_Gesture_Layer_Data *sd)
+_elm_gesture_layer_hold_events_get(const Eo *obj EINA_UNUSED, Elm_Gesture_Layer_Data *sd)
{
return !sd->repeat_events;
}
@@ -3859,7 +3857,7 @@ _elm_gesture_layer_hold_events_set(Eo *obj EINA_UNUSED, Elm_Gesture_Layer_Data *
}
EOLIAN static double
-_elm_gesture_layer_zoom_step_get(Eo *obj EINA_UNUSED, Elm_Gesture_Layer_Data *sd)
+_elm_gesture_layer_zoom_step_get(const Eo *obj EINA_UNUSED, Elm_Gesture_Layer_Data *sd)
{
return sd->zoom_step;
}
@@ -3873,7 +3871,7 @@ _elm_gesture_layer_zoom_step_set(Eo *obj EINA_UNUSED, Elm_Gesture_Layer_Data *sd
}
EOLIAN static double
-_elm_gesture_layer_rotate_step_get(Eo *obj EINA_UNUSED, Elm_Gesture_Layer_Data *sd)
+_elm_gesture_layer_rotate_step_get(const Eo *obj EINA_UNUSED, Elm_Gesture_Layer_Data *sd)
{
return sd->rotate_step;
}
@@ -4164,7 +4162,7 @@ _elm_gesture_layer_tap_finger_size_set(Eo *obj EINA_UNUSED, Elm_Gesture_Layer_Da
}
EOLIAN static Evas_Coord
-_elm_gesture_layer_tap_finger_size_get(Eo *obj EINA_UNUSED, Elm_Gesture_Layer_Data *sd)
+_elm_gesture_layer_tap_finger_size_get(const Eo *obj EINA_UNUSED, Elm_Gesture_Layer_Data *sd)
{
return sd->tap_finger_size;
}
diff --git a/src/lib/elementary/elm_gesture_layer.eo b/src/lib/elementary/elm_gesture_layer.eo
index 3406b886f5..6f384ed8d9 100644
--- a/src/lib/elementary/elm_gesture_layer.eo
+++ b/src/lib/elementary/elm_gesture_layer.eo
@@ -31,7 +31,7 @@ enum Elm.Gesture.State
abort [[Ongoing gesture was aborted]]
}
-class Elm.Gesture_Layer (Elm.Widget)
+class Elm.Gesture_Layer (Efl.Ui.Widget, Efl.Ui.Legacy)
{
[[Elementary gesture layer class]]
legacy_prefix: elm_gesture_layer;
@@ -162,6 +162,6 @@ class Elm.Gesture_Layer (Elm.Widget)
implements {
class.constructor;
Efl.Object.constructor;
- Elm.Widget.on_disabled_update;
+ Efl.Ui.Widget.on_disabled_update;
}
}
diff --git a/src/lib/elementary/elm_glview.c b/src/lib/elementary/elm_glview.c
index 44f7a8de94..4ae1da51dc 100644
--- a/src/lib/elementary/elm_glview.c
+++ b/src/lib/elementary/elm_glview.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#include <Elementary.h>
@@ -27,12 +27,12 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
};
EOLIAN static Eina_Bool
-_elm_glview_elm_widget_on_focus_update(Eo *obj, Elm_Glview_Data *_pd EINA_UNUSED, Elm_Object_Item *item EINA_UNUSED)
+_elm_glview_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Glview_Data *_pd EINA_UNUSED)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
Eina_Bool int_ret = EINA_FALSE;
- int_ret = efl_ui_widget_on_focus_update(efl_super(obj, MY_CLASS), NULL);
+ int_ret = efl_ui_focus_object_on_focus_update(efl_super(obj, MY_CLASS));
if (!int_ret) return EINA_FALSE;
if (efl_ui_focus_object_focus_get(obj))
@@ -86,12 +86,12 @@ _glview_update_surface(Evas_Object *obj)
}
EOLIAN static void
-_elm_glview_efl_gfx_size_set(Eo *obj, Elm_Glview_Data *sd, Eina_Size2D sz)
+_elm_glview_efl_gfx_entity_size_set(Eo *obj, Elm_Glview_Data *sd, Eina_Size2D sz)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
- efl_gfx_size_set(efl_super(obj, MY_CLASS), sz);
+ efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
sd->resized = EINA_TRUE;
@@ -118,7 +118,7 @@ _render_cb(void *obj, const Efl_Event *event EINA_UNUSED)
// Do a make current
if (!evas_gl_make_current(sd->evasgl, sd->surface, sd->context))
{
- ERR("Failed doing make current.\n");
+ ERR("Failed doing make current.");
goto on_error;
}
@@ -158,7 +158,7 @@ _render_cb(void *obj, const Efl_Event *event EINA_UNUSED)
}
else
{
- ERR("Invalid Render Policy.\n");
+ ERR("Invalid Render Policy.");
goto on_error;
}
@@ -214,7 +214,7 @@ _set_render_policy_callback(Evas_Object *obj)
break;
default:
- ERR("Invalid Render Policy.\n");
+ ERR("Invalid Render Policy.");
return;
}
}
@@ -241,8 +241,7 @@ _elm_glview_constructor(Eo *obj, Elm_Glview_Data *priv)
priv->evasgl = evas_gl_new(evas_object_evas_get(obj));
if (!priv->evasgl)
{
- ERR("Failed Creating an Evas GL Object.\n");
-
+ ERR("Failed Creating an Evas GL Object.");
return;
}
@@ -250,8 +249,7 @@ _elm_glview_constructor(Eo *obj, Elm_Glview_Data *priv)
priv->config = evas_gl_config_new();
if (!priv->config)
{
- ERR("Failed Creating a Config Object.\n");
-
+ ERR("Failed Creating a Config Object.");
evas_gl_free(priv->evasgl);
priv->evasgl = NULL;
return;
@@ -278,8 +276,7 @@ _elm_glview_constructor(Eo *obj, Elm_Glview_Data *priv)
priv->context = evas_gl_context_version_create(priv->evasgl, NULL, priv->gles_version);
if (!priv->context)
{
- ERR("Error Creating an Evas_GL Context.\n");
-
+ ERR("Error Creating an Evas_GL Context.");
ELM_SAFE_FREE(priv->config, evas_gl_config_free);
ELM_SAFE_FREE(priv->evasgl, evas_gl_free);
return;
@@ -361,7 +358,7 @@ _elm_glview_version_constructor(Eo *obj, Elm_Glview_Data *sd,
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_ANIMATION);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_ANIMATION);
efl_event_callback_add(obj, EFL_EVENT_CALLBACK_ADD, _cb_added, NULL);
}
@@ -378,7 +375,7 @@ _elm_glview_efl_object_finalize(Eo *obj, Elm_Glview_Data *sd)
}
EOLIAN static Evas_GL_API*
-_elm_glview_gl_api_get(Eo *obj EINA_UNUSED, Elm_Glview_Data *sd)
+_elm_glview_gl_api_get(const Eo *obj EINA_UNUSED, Elm_Glview_Data *sd)
{
return evas_gl_context_api_get(sd->evasgl, sd->context);
}
@@ -479,7 +476,7 @@ _elm_glview_resize_policy_set(Eo *obj, Elm_Glview_Data *sd, Elm_GLView_Resize_Po
return EINA_TRUE;
default:
- ERR("Invalid Scale Policy.\n");
+ ERR("Invalid Scale Policy.");
return EINA_FALSE;
}
@@ -492,7 +489,7 @@ _elm_glview_render_policy_set(Eo *obj, Elm_Glview_Data *sd, Elm_GLView_Render_Po
if ((policy != ELM_GLVIEW_RENDER_POLICY_ON_DEMAND) &&
(policy != ELM_GLVIEW_RENDER_POLICY_ALWAYS))
{
- ERR("Invalid Render Policy.\n");
+ ERR("Invalid Render Policy.");
return EINA_FALSE;
}
@@ -518,7 +515,7 @@ _elm_glview_efl_gfx_view_view_size_set(Eo *obj, Elm_Glview_Data *sd, Eina_Size2D
}
EOLIAN static Eina_Size2D
-_elm_glview_efl_gfx_view_view_size_get(Eo *obj EINA_UNUSED, Elm_Glview_Data *sd)
+_elm_glview_efl_gfx_view_view_size_get(const Eo *obj EINA_UNUSED, Elm_Glview_Data *sd)
{
return EINA_SIZE2D(sd->w, sd->h);
}
@@ -539,13 +536,13 @@ _elm_glview_draw_request(Eo *obj, Elm_Glview_Data *sd)
}
EOLIAN static Evas_GL *
-_elm_glview_evas_gl_get(Eo *obj EINA_UNUSED, Elm_Glview_Data *sd)
+_elm_glview_evas_gl_get(const Eo *obj EINA_UNUSED, Elm_Glview_Data *sd)
{
return sd->evasgl;
}
EOLIAN static int
-_elm_glview_rotation_get(Eo *obj EINA_UNUSED, Elm_Glview_Data *sd)
+_elm_glview_rotation_get(const Eo *obj EINA_UNUSED, Elm_Glview_Data *sd)
{
return evas_gl_rotation_get(sd->evasgl);
}
diff --git a/src/lib/elementary/elm_glview.eo b/src/lib/elementary/elm_glview.eo
index 7c5b06e7d7..74cc36fd45 100644
--- a/src/lib/elementary/elm_glview.eo
+++ b/src/lib/elementary/elm_glview.eo
@@ -80,7 +80,7 @@ enum Elm.GLView.Render.Policy
always = 2 [[Render always even when it is not visible]]
}
-class Elm.Glview (Elm.Widget, Efl.Gfx.View)
+class Elm.Glview (Efl.Ui.Widget, Efl.Gfx.View, Efl.Ui.Legacy)
{
[[Elementary GL view class]]
legacy_prefix: elm_glview;
@@ -189,26 +189,29 @@ class Elm.Glview (Elm.Widget, Efl.Gfx.View)
implements {
class.constructor;
Efl.Object.finalize;
- Efl.Gfx.size { set; }
- Elm.Widget.on_focus_update;
+ Efl.Gfx.Entity.size { set; }
+ Efl.Ui.Focus.Object.on_focus_update;
Efl.Gfx.View.view_size { get; set; }
}
events {
- created; [[Event dispatched when first render happens.
+ created: void;
+ [[Event dispatched when first render happens.
The callback function gets called once during the
render loop. Callback function allows glview to hide all the
rendering context/surface details and have the user just
call GL calls that they desire for initialization GL calls.
]]
- destroyed; [[Event dispatched when GLView object is deleted.
+ destroyed: void;
+ [[Event dispatched when GLView object is deleted.
The registered destroyed function gets called when GLView object
is deleted. Callback function allows glview to hide all the
rendering context/surface details and have the user just
call GL calls that they desire when delete happens.
]]
- resized; [[Event dispatched when resize happens.
+ resized: void;
+ [[Event dispatched when resize happens.
The resized event callback functions gets called
during the render loop. The callback function allows
@@ -216,7 +219,8 @@ class Elm.Glview (Elm.Widget, Efl.Gfx.View)
details and have the user just call GL alls that
they desire when resize happens.
]]
- render; [[Event dispatched when GLView is rendered.
+ render: void;
+ [[Event dispatched when GLView is rendered.
The callback function gets called in the main loop but whether
it runs depends on the rendering policy and whether
diff --git a/src/lib/elementary/elm_grid.c b/src/lib/elementary/elm_grid.c
index f189a7ddcf..7443047912 100644
--- a/src/lib/elementary/elm_grid.c
+++ b/src/lib/elementary/elm_grid.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_UI_FOCUS_COMPOSITION_PROTECTED
#include <Elementary.h>
@@ -17,9 +17,18 @@
static void
_elm_grid_efl_ui_focus_composition_prepare(Eo *obj, void *pd EINA_UNUSED)
{
- Elm_Widget_Smart_Data *wpd = efl_data_scope_get(obj, ELM_WIDGET_CLASS);
+ Eina_List *l, *ll;
+ Efl_Ui_Widget *elem;
+
+ Elm_Widget_Smart_Data *wpd = efl_data_scope_get(obj, EFL_UI_WIDGET_CLASS);
Eina_List *order = evas_object_grid_children_get(wpd->resize_obj);
+ EINA_LIST_FOREACH_SAFE(order, l, ll, elem)
+ {
+ if (!efl_isa(elem, EFL_UI_WIDGET_CLASS))
+ order = eina_list_remove(order, elem);
+ }
+
efl_ui_focus_composition_elements_set(obj, order);
}
@@ -32,7 +41,7 @@ _mirrored_set(Evas_Object *obj, Eina_Bool rtl)
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_grid_elm_widget_theme_apply(Eo *obj, void *sd EINA_UNUSED)
+_elm_grid_efl_ui_widget_theme_apply(Eo *obj, void *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
@@ -98,13 +107,13 @@ _elm_grid_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_FILLER);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_FILLER);
return obj;
}
EOLIAN static void
-_elm_grid_size_set(Eo *obj, void *_pd EINA_UNUSED, Evas_Coord w, Evas_Coord h)
+_elm_grid_grid_size_set(Eo *obj, void *_pd EINA_UNUSED, Evas_Coord w, Evas_Coord h)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
@@ -112,7 +121,7 @@ _elm_grid_size_set(Eo *obj, void *_pd EINA_UNUSED, Evas_Coord w, Evas_Coord h)
}
EOLIAN static void
-_elm_grid_size_get(Eo *obj, void *_pd EINA_UNUSED, Evas_Coord *w, Evas_Coord *h)
+_elm_grid_grid_size_get(const Eo *obj, void *_pd EINA_UNUSED, Evas_Coord *w, Evas_Coord *h)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
@@ -191,7 +200,7 @@ elm_grid_pack_get(Evas_Object *subobj,
}
EOLIAN static Eina_List*
-_elm_grid_children_get(Eo *obj, void *_pd EINA_UNUSED)
+_elm_grid_children_get(const Eo *obj, void *_pd EINA_UNUSED)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
return evas_object_grid_children_get(wd->resize_obj);
diff --git a/src/lib/elementary/elm_grid.eo b/src/lib/elementary/elm_grid.eo
index 8e50dafe7b..ebf5bb2929 100644
--- a/src/lib/elementary/elm_grid.eo
+++ b/src/lib/elementary/elm_grid.eo
@@ -1,16 +1,18 @@
-class Elm.Grid (Elm.Widget, Efl.Ui.Focus.Composition)
+class Elm.Grid (Efl.Ui.Widget, Efl.Ui.Focus.Composition, Efl.Ui.Legacy)
{
[[Elementary grid class]]
legacy_prefix: elm_grid;
eo_prefix: elm_obj_grid;
data: null;
methods {
- @property size {
+ @property grid_size {
set {
[[Set the virtual size of the grid]]
+ legacy: elm_grid_size_set;
}
get {
[[Get the virtual size of the grid]]
+ legacy: elm_grid_size_get;
}
values {
w: int; [[The virtual width of the grid]]
@@ -55,7 +57,7 @@ class Elm.Grid (Elm.Widget, Efl.Ui.Focus.Composition)
implements {
class.constructor;
Efl.Object.constructor;
- Elm.Widget.theme_apply;
+ Efl.Ui.Widget.theme_apply;
Efl.Ui.Focus.Composition.prepare;
}
}
diff --git a/src/lib/elementary/elm_hover.c b/src/lib/elementary/elm_hover.c
index e11cf76e53..5a3a814058 100644
--- a/src/lib/elementary/elm_hover.c
+++ b/src/lib/elementary/elm_hover.c
@@ -3,9 +3,10 @@
#endif
#define ELM_WIDGET_PROTECTED
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define ELM_LAYOUT_PROTECTED
+#define EFL_PART_PROTECTED
#include <Elementary.h>
@@ -298,7 +299,7 @@ _hov_show_do(Evas_Object *obj)
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_hover_elm_widget_theme_apply(Eo *obj, Elm_Hover_Data *sd)
+_elm_hover_efl_ui_widget_theme_apply(Eo *obj, Elm_Hover_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
@@ -361,7 +362,7 @@ _on_smt_sub_changed(void *data,
}
EOLIAN static Eina_Bool
-_elm_hover_elm_widget_widget_sub_object_add(Eo *obj, Elm_Hover_Data *sd, Evas_Object *sobj)
+_elm_hover_efl_ui_widget_widget_sub_object_add(Eo *obj, Elm_Hover_Data *sd, Evas_Object *sobj)
{
Eina_Bool int_ret = EINA_FALSE;
@@ -378,7 +379,7 @@ _elm_hover_elm_widget_widget_sub_object_add(Eo *obj, Elm_Hover_Data *sd, Evas_Ob
}
EOLIAN static Eina_Bool
-_elm_hover_elm_widget_widget_sub_object_del(Eo *obj, Elm_Hover_Data *sd, Evas_Object *sobj)
+_elm_hover_efl_ui_widget_widget_sub_object_del(Eo *obj, Elm_Hover_Data *sd, Evas_Object *sobj)
{
Eina_Bool int_ret = EINA_FALSE;
@@ -631,42 +632,36 @@ _elm_hover_efl_canvas_group_group_del(Eo *obj, Elm_Hover_Data *sd)
}
EOLIAN static void
-_elm_hover_efl_gfx_position_set(Eo *obj, Elm_Hover_Data *_pd EINA_UNUSED, Eina_Position2D pos)
+_elm_hover_efl_gfx_entity_position_set(Eo *obj, Elm_Hover_Data *_pd EINA_UNUSED, Eina_Position2D pos)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
- efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
elm_layout_sizing_eval(obj);
}
EOLIAN static void
-_elm_hover_efl_gfx_size_set(Eo *obj, Elm_Hover_Data *_pd EINA_UNUSED, Eina_Size2D sz)
+_elm_hover_efl_gfx_entity_size_set(Eo *obj, Elm_Hover_Data *_pd EINA_UNUSED, Eina_Size2D sz)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
- efl_gfx_size_set(efl_super(obj, MY_CLASS), sz);
+ efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
elm_layout_sizing_eval(obj);
}
EOLIAN static void
-_elm_hover_efl_gfx_visible_set(Eo *obj, Elm_Hover_Data *pd, Eina_Bool vis)
+_elm_hover_efl_gfx_entity_visible_set(Eo *obj, Elm_Hover_Data *pd EINA_UNUSED, Eina_Bool vis)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 0, vis))
return;
- efl_gfx_visible_set(efl_super(obj, MY_CLASS), vis);
+ efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), vis);
- if (vis)
- {
- _hov_show_do(obj);
- //we just set ourself as redirect in the next upper manager
- pd->redirected = efl_ui_focus_user_focus_manager_get(pd->target);
- efl_ui_focus_manager_redirect_set(pd->redirected, obj);
- }
+ if (vis) _hov_show_do(obj);
else
{
// for backward compatibility
@@ -674,9 +669,6 @@ _elm_hover_efl_gfx_visible_set(Eo *obj, Elm_Hover_Data *pd, Eina_Bool vis)
if (!eina_streq(dismissstr, "on"))
_hide_signals_emit(obj);
-
- efl_ui_focus_manager_redirect_set(pd->redirected, NULL);
- pd->redirected = NULL;
}
}
@@ -699,16 +691,12 @@ elm_hover_add(Evas_Object *parent)
}
EOLIAN static Eo *
-_elm_hover_efl_object_constructor(Eo *obj, Elm_Hover_Data *pd)
+_elm_hover_efl_object_constructor(Eo *obj, Elm_Hover_Data *pd EINA_UNUSED)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_POPUP_MENU);
-
- pd->manager = efl_ui_widget_focus_manager_create(obj, obj);
-
- efl_composite_attach(obj, pd->manager);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_POPUP_MENU);
return obj;
}
@@ -751,7 +739,7 @@ elm_hover_parent_set(Evas_Object *obj,
}
EOLIAN static void
-_elm_hover_elm_widget_widget_parent_set(Eo *obj, Elm_Hover_Data *sd, Evas_Object *parent)
+_elm_hover_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Hover_Data *sd, Evas_Object *parent)
{
_elm_hover_parent_detach(obj);
@@ -774,7 +762,7 @@ _elm_hover_elm_widget_widget_parent_set(Eo *obj, Elm_Hover_Data *sd, Evas_Object
}
EOLIAN static Evas_Object*
-_elm_hover_target_get(Eo *obj EINA_UNUSED, Elm_Hover_Data *sd)
+_elm_hover_target_get(const Eo *obj EINA_UNUSED, Elm_Hover_Data *sd)
{
return sd->target;
}
@@ -787,7 +775,7 @@ elm_hover_parent_get(const Evas_Object *obj)
}
EOLIAN static Evas_Object*
-_elm_hover_elm_widget_widget_parent_get(Eo *obj EINA_UNUSED, Elm_Hover_Data *sd)
+_elm_hover_efl_ui_widget_widget_parent_get(const Eo *obj EINA_UNUSED, Elm_Hover_Data *sd)
{
return sd->parent;
}
@@ -856,7 +844,7 @@ _action_dismiss(Evas_Object *obj, const char *params EINA_UNUSED)
}
EOLIAN const Efl_Access_Action_Data *
-_elm_hover_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Hover_Data *pd EINA_UNUSED)
+_elm_hover_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Elm_Hover_Data *pd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "dismiss", NULL, NULL, _action_dismiss},
@@ -866,10 +854,10 @@ _elm_hover_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Hov
}
EOLIAN static Efl_Access_State_Set
-_elm_hover_efl_access_state_set_get(Eo *obj, Elm_Hover_Data *pd EINA_UNUSED)
+_elm_hover_efl_access_object_state_set_get(const Eo *obj, Elm_Hover_Data *pd EINA_UNUSED)
{
Efl_Access_State_Set states;
- states = efl_access_state_set_get(efl_super(obj, MY_CLASS));
+ states = efl_access_object_state_set_get(efl_super(obj, MY_CLASS));
STATE_TYPE_SET(states, EFL_ACCESS_STATE_MODAL);
return states;
diff --git a/src/lib/elementary/elm_hover.eo b/src/lib/elementary/elm_hover.eo
index c517b9c0a8..35f744b9c6 100644
--- a/src/lib/elementary/elm_hover.eo
+++ b/src/lib/elementary/elm_hover.eo
@@ -7,7 +7,8 @@ enum Elm.Hover.Axis
both [[ELM_HOVER_AXIS_BOTH -- both.]]
}
-class Elm.Hover (Efl.Ui.Layout, Efl.Ui.Focus.Layer, Efl.Ui.Clickable, Efl.Access.Widget.Action)
+class Elm.Hover (Efl.Ui.Layout.Object, Efl.Ui.Focus.Layer, Efl.Ui.Clickable,
+ Efl.Access.Widget.Action, Efl.Ui.Legacy)
{
[[Elementary hover class]]
legacy_prefix: elm_hover;
@@ -61,19 +62,19 @@ class Elm.Hover (Efl.Ui.Layout, Efl.Ui.Focus.Layer, Efl.Ui.Clickable, Efl.Access
implements {
class.constructor;
Efl.Object.constructor;
- Efl.Gfx.visible { set; }
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set; }
- Elm.Widget.theme_apply;
- Elm.Widget.widget_sub_object_add;
- Elm.Widget.widget_parent { get; set; }
- Elm.Widget.widget_sub_object_del;
+ Efl.Gfx.Entity.visible { set; }
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.widget_sub_object_add;
+ Efl.Ui.Widget.widget_parent { get; set; }
+ Efl.Ui.Widget.widget_sub_object_del;
Efl.Access.Widget.Action.elm_actions { get; }
- Efl.Access.state_set { get; }
- Efl.Part.part;
+ Efl.Access.Object.state_set { get; }
+ Efl.Part.part_get;
}
events {
- smart,changed; [[Called when hover changed]]
- dismissed; [[Called when hover was dismissed]]
+ smart,changed: string; [[Called when hover changed]]
+ dismissed: void; [[Called when hover was dismissed]]
}
}
diff --git a/src/lib/elementary/elm_hoversel.eo b/src/lib/elementary/elm_hoversel.eo
index bc6447f46d..863482f9c9 100644
--- a/src/lib/elementary/elm_hoversel.eo
+++ b/src/lib/elementary/elm_hoversel.eo
@@ -1,8 +1,9 @@
import elm_general;
-class Elm.Hoversel (Efl.Ui.Button, Efl.Ui.Selectable,
+class Elm.Hoversel (Efl.Ui.Button_Legacy, Efl.Ui.Selectable,
Efl.Ui.Clickable,
- Efl.Access.Widget.Action)
+ Efl.Access.Widget.Action,
+ Efl.Ui.Legacy)
{
[[Elementary hoversel class]]
legacy_prefix: elm_hoversel;
@@ -94,19 +95,19 @@ class Elm.Hoversel (Efl.Ui.Button, Efl.Ui.Selectable,
class.constructor;
Efl.Object.constructor;
Efl.Object.destructor;
- Efl.Gfx.visible { set; }
- Elm.Widget.widget_parent { set; }
- Elm.Widget.theme_apply;
+ Efl.Gfx.Entity.visible { set; }
+ Efl.Ui.Widget.widget_parent { set; }
+ Efl.Ui.Widget.theme_apply;
Efl.Ui.Translatable.translation_update;
- Elm.Widget.widget_event;
+ Efl.Ui.Widget.widget_event;
Efl.Ui.Autorepeat.autorepeat_supported { get; }
Efl.Access.Widget.Action.elm_actions { get; }
- Efl.Access.children { get; }
+ Efl.Access.Object.access_children { get; }
}
events {
- dismissed; [[Called when hoversel is dismissed]]
- expanded; [[Called when hoversel is expanded]]
- item,focused; [[Called when hoversel item got focus]]
- item,unfocused; [[Called when hoversel item lost focus]]
+ dismissed: void; [[Called when hoversel is dismissed]]
+ expanded: void; [[Called when hoversel is expanded]]
+ item,focused: Efl.Object; [[Called when hoversel item got focus]]
+ item,unfocused: Efl.Object; [[Called when hoversel item lost focus]]
}
}
diff --git a/src/lib/elementary/elm_hoversel_item.eo b/src/lib/elementary/elm_hoversel_item.eo
index 1f9a77b3a9..4497a14e2c 100644
--- a/src/lib/elementary/elm_hoversel_item.eo
+++ b/src/lib/elementary/elm_hoversel_item.eo
@@ -1,6 +1,6 @@
import elm_general;
-class Elm.Hoversel.Item(Elm.Widget.Item)
+class Elm.Hoversel.Item(Elm.Widget.Item, Efl.Ui.Legacy)
{
[[Elementary hoversel item class]]
legacy_prefix: elm_hoversel_item;
@@ -28,6 +28,6 @@ class Elm.Hoversel.Item(Elm.Widget.Item)
Elm.Widget.Item.signal_emit;
Elm.Widget.Item.part_text { get; set; }
Elm.Widget.Item.style { get; set; }
- Elm.Widget.Item.focus { get; set; }
+ Elm.Widget.Item.item_focus { get; set; }
}
}
diff --git a/src/lib/elementary/elm_icon.c b/src/lib/elementary/elm_icon.c
index 1db6b6f87b..7aa07e36df 100644
--- a/src/lib/elementary/elm_icon.c
+++ b/src/lib/elementary/elm_icon.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#include <Elementary.h>
@@ -364,7 +364,7 @@ _elm_icon_efl_file_file_set(Eo *obj, Elm_Icon_Data *sd, const char *file, const
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_icon_elm_widget_theme_apply(Eo *obj, Elm_Icon_Data *sd)
+_elm_icon_efl_ui_widget_theme_apply(Eo *obj, Elm_Icon_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
@@ -615,7 +615,7 @@ _elm_icon_efl_object_constructor(Eo *obj, Elm_Icon_Data *sd)
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_ICON);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_ICON);
return obj;
}
diff --git a/src/lib/elementary/elm_icon.eo b/src/lib/elementary/elm_icon.eo
index 529720141b..8fd9d2eef5 100644
--- a/src/lib/elementary/elm_icon.eo
+++ b/src/lib/elementary/elm_icon.eo
@@ -1,4 +1,4 @@
-class Elm.Icon (Efl.Ui.Image)
+class Elm.Icon (Efl.Ui.Image, Efl.Ui.Legacy)
{
[[Elementary Icon Class]]
legacy_prefix: elm_icon;
@@ -9,11 +9,11 @@ class Elm.Icon (Efl.Ui.Image)
implements {
class.constructor;
Efl.Object.constructor;
- Elm.Widget.theme_apply;
+ Efl.Ui.Widget.theme_apply;
Efl.File.file { set; }
}
events {
- thumb,done; [[Called when thumb nailing is successfully done]]
- thumb,error; [[Called when thumb nailing failed]]
+ thumb,done: void; [[Called when thumb nailing is successfully done]]
+ thumb,error: void; [[Called when thumb nailing failed]]
}
}
diff --git a/src/lib/elementary/elm_image_legacy.h b/src/lib/elementary/elm_image_legacy.h
index 577adfd6e9..0f8722de9b 100644
--- a/src/lib/elementary/elm_image_legacy.h
+++ b/src/lib/elementary/elm_image_legacy.h
@@ -490,7 +490,7 @@ EAPI void elm_image_resizable_get(const Evas_Object *obj, Eina_Bool *up, Eina_Bo
* This function disables scaling of the elm_image widget through the function
* elm_object_scale_set(). However, this does not affect the widget size/resize
* in any way. For that effect, take a look at @ref elm_image_resizable_get and
- * @ref efl_gfx_scale_get
+ * @ref efl_gfx_entity_scale_get
*
* @param[in] no_scale @c true if the object is not scalable, @c false
* otherwise. Default is @c false.
@@ -505,7 +505,7 @@ EAPI void elm_image_no_scale_set(Evas_Object *obj, Eina_Bool no_scale);
* This function disables scaling of the elm_image widget through the function
* elm_object_scale_set(). However, this does not affect the widget size/resize
* in any way. For that effect, take a look at @ref elm_image_resizable_get and
- * @ref efl_gfx_scale_get
+ * @ref efl_gfx_entity_scale_get
*
* @return @c true if the object is not scalable, @c false otherwise. Default
* is @c false.
diff --git a/src/lib/elementary/elm_index.c b/src/lib/elementary/elm_index.c
index bb33e027ab..cea1af6b4d 100644
--- a/src/lib/elementary/elm_index.c
+++ b/src/lib/elementary/elm_index.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define EFL_ACCESS_COMPONENT_PROTECTED
#define ELM_WIDGET_ITEM_PROTECTED
@@ -433,7 +433,7 @@ _index_priority_change(void *data, Elm_Index_Item_Data *it)
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_index_elm_widget_theme_apply(Eo *obj, Elm_Index_Data *sd)
+_elm_index_efl_ui_widget_theme_apply(Eo *obj, Elm_Index_Data *sd)
{
Evas_Coord minw = 0, minh = 0;
Elm_Object_Item *eo_item;
@@ -543,7 +543,7 @@ _elm_index_item_efl_object_constructor(Eo *obj, Elm_Index_Item_Data *it)
{
obj = efl_constructor(efl_super(obj, ELM_INDEX_ITEM_CLASS));
it->base = efl_data_scope_get(obj, ELM_WIDGET_ITEM_CLASS);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_RADIO_MENU_ITEM);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_RADIO_MENU_ITEM);
return obj;
}
@@ -1122,7 +1122,7 @@ _elm_index_efl_canvas_group_group_del(Eo *obj, Elm_Index_Data *sd)
Elm_Index_Omit *o;
while (sd->items)
- elm_wdg_item_del(sd->items->data);
+ efl_del(sd->items->data);
EINA_LIST_FREE(sd->omit, o)
free(o);
@@ -1178,7 +1178,7 @@ _access_obj_process(Evas_Object *obj, Eina_Bool is_access)
}
EOLIAN static void
-_elm_index_elm_widget_on_access_update(Eo *obj, Elm_Index_Data *_pd EINA_UNUSED, Eina_Bool acs)
+_elm_index_efl_ui_widget_on_access_update(Eo *obj, Elm_Index_Data *_pd EINA_UNUSED, Eina_Bool acs)
{
_elm_index_smart_focus_next_enable = acs;
_access_obj_process(obj, _elm_index_smart_focus_next_enable);
@@ -1211,7 +1211,7 @@ _elm_index_efl_object_constructor(Eo *obj, Elm_Index_Data *_pd EINA_UNUSED)
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_SCROLL_BAR);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_SCROLL_BAR);
return obj;
}
@@ -1235,7 +1235,7 @@ _elm_index_autohide_disabled_set(Eo *obj, Elm_Index_Data *sd, Eina_Bool disabled
}
EOLIAN static Eina_Bool
-_elm_index_autohide_disabled_get(Eo *obj EINA_UNUSED, Elm_Index_Data *sd)
+_elm_index_autohide_disabled_get(const Eo *obj EINA_UNUSED, Elm_Index_Data *sd)
{
return sd->autohide_disabled;
}
@@ -1248,7 +1248,7 @@ _elm_index_item_level_set(Eo *obj EINA_UNUSED, Elm_Index_Data *sd, int level)
}
EOLIAN static int
-_elm_index_item_level_get(Eo *obj EINA_UNUSED, Elm_Index_Data *sd)
+_elm_index_item_level_get(const Eo *obj EINA_UNUSED, Elm_Index_Data *sd)
{
return sd->level;
}
@@ -1351,7 +1351,7 @@ _elm_index_item_append(Eo *obj, Elm_Index_Data *sd, const char *letter, Evas_Sma
sd->items = eina_list_append(sd->items, eo_item);
ELM_INDEX_ITEM_DATA_GET(eo_item, it);
- VIEW(it) = edje_object_add(evas_object_evas_get(obj));
+ VIEW_SET(it, edje_object_add(evas_object_evas_get(obj)));
if (_elm_config->atspi_mode)
{
@@ -1373,7 +1373,7 @@ _elm_index_item_prepend(Eo *obj, Elm_Index_Data *sd, const char *letter, Evas_Sm
sd->items = eina_list_prepend(sd->items, eo_item);
ELM_INDEX_ITEM_DATA_GET(eo_item, it);
- VIEW(it) = edje_object_add(evas_object_evas_get(obj));
+ VIEW_SET(it, edje_object_add(evas_object_evas_get(obj)));
if (_elm_config->atspi_mode)
{
@@ -1408,7 +1408,7 @@ _elm_index_item_insert_after(Eo *obj, Elm_Index_Data *sd, Elm_Object_Item *after
sd->items = eina_list_append_relative(sd->items, eo_item, after);
ELM_INDEX_ITEM_DATA_GET(eo_item, it);
- VIEW(it) = edje_object_add(evas_object_evas_get(obj));
+ VIEW_SET(it, edje_object_add(evas_object_evas_get(obj)));
if (_elm_config->atspi_mode)
{
@@ -1432,7 +1432,7 @@ _elm_index_item_insert_before(Eo *obj, Elm_Index_Data *sd, Elm_Object_Item *befo
sd->items = eina_list_prepend_relative(sd->items, eo_item, before);
ELM_INDEX_ITEM_DATA_GET(eo_item, it);
- VIEW(it) = edje_object_add(evas_object_evas_get(obj));
+ VIEW_SET(it, edje_object_add(evas_object_evas_get(obj)));
if (_elm_config->atspi_mode)
{
@@ -1471,12 +1471,12 @@ _elm_index_item_sorted_insert(Eo *obj, Elm_Index_Data *sd, const char *letter, E
const void *item_data = WIDGET_ITEM_DATA_GET(eo_item);
if (cmp_data_func(WIDGET_ITEM_DATA_GET(eo_p_it), item_data) >= 0)
WIDGET_ITEM_DATA_SET(eo_p_it, item_data);
- elm_wdg_item_del(eo_item);
+ efl_del(eo_item);
return NULL;
}
}
ELM_INDEX_ITEM_DATA_GET(eo_item, it);
- VIEW(it) = edje_object_add(evas_object_evas_get(obj));
+ VIEW_SET(it, edje_object_add(evas_object_evas_get(obj)));
if (_elm_config->atspi_mode)
{
@@ -1508,7 +1508,7 @@ _elm_index_item_clear(Eo *obj, Elm_Index_Data *sd)
clear = eina_list_append(clear, eo_item);
}
EINA_LIST_FREE(clear, eo_item)
- elm_wdg_item_del(eo_item);
+ efl_del(eo_item);
}
EOLIAN static void
@@ -1562,7 +1562,7 @@ _elm_index_indicator_disabled_set(Eo *obj, Elm_Index_Data *sd, Eina_Bool disable
}
EOLIAN static Eina_Bool
-_elm_index_indicator_disabled_get(Eo *obj EINA_UNUSED, Elm_Index_Data *sd)
+_elm_index_indicator_disabled_get(const Eo *obj EINA_UNUSED, Elm_Index_Data *sd)
{
return sd->indicator_disabled;
}
@@ -1588,7 +1588,7 @@ _elm_index_efl_ui_direction_direction_set(Eo *obj, Elm_Index_Data *sd, Efl_Ui_Di
}
EOLIAN static Efl_Ui_Dir
-_elm_index_efl_ui_direction_direction_get(Eo *obj EINA_UNUSED, Elm_Index_Data *sd)
+_elm_index_efl_ui_direction_direction_get(const Eo *obj EINA_UNUSED, Elm_Index_Data *sd)
{
return sd->dir;
}
@@ -1600,7 +1600,7 @@ _elm_index_delay_change_time_set(Eo *obj EINA_UNUSED, Elm_Index_Data *sd, double
}
EOLIAN static double
-_elm_index_delay_change_time_get(Eo *obj EINA_UNUSED, Elm_Index_Data *sd)
+_elm_index_delay_change_time_get(const Eo *obj EINA_UNUSED, Elm_Index_Data *sd)
{
return sd->delay_change_time;
}
@@ -1622,7 +1622,7 @@ _elm_index_omit_enabled_set(Eo *obj, Elm_Index_Data *sd, Eina_Bool enabled)
}
EOLIAN static Eina_Bool
-_elm_index_omit_enabled_get(Eo *obj EINA_UNUSED, Elm_Index_Data *sd)
+_elm_index_omit_enabled_get(const Eo *obj EINA_UNUSED, Elm_Index_Data *sd)
{
return sd->omit_enabled;
}
@@ -1658,7 +1658,7 @@ _elm_index_standard_priority_set(Eo *obj, Elm_Index_Data *sd, int priority)
}
EOLIAN static int
-_elm_index_standard_priority_get(Eo *obj EINA_UNUSED, Elm_Index_Data *sd)
+_elm_index_standard_priority_get(const Eo *obj EINA_UNUSED, Elm_Index_Data *sd)
{
return sd->show_group;
}
@@ -1677,25 +1677,25 @@ _item_action_activate(Eo *obj, const char *params EINA_UNUSED EINA_UNUSED)
}
EOLIAN static Eina_List*
-_elm_index_efl_access_children_get(Eo *obj, Elm_Index_Data *data)
+_elm_index_efl_access_object_access_children_get(const Eo *obj, Elm_Index_Data *data)
{
Eina_List *ret;
- ret = efl_access_children_get(efl_super(obj, ELM_INDEX_CLASS));
+ ret = efl_access_object_access_children_get(efl_super(obj, ELM_INDEX_CLASS));
return eina_list_merge(eina_list_clone(data->items), ret);
}
EOLIAN static const char*
-_elm_index_item_efl_access_name_get(Eo *eo_it, Elm_Index_Item_Data *data)
+_elm_index_item_efl_access_object_i18n_name_get(const Eo *eo_it, Elm_Index_Item_Data *data)
{
const char *name;
- name = efl_access_name_get(efl_super(eo_it, ELM_INDEX_ITEM_CLASS));
+ name = efl_access_object_i18n_name_get(efl_super(eo_it, ELM_INDEX_ITEM_CLASS));
if (name) return name;
return _elm_widget_item_accessible_plain_name_get(eo_it, data->letter);
}
EOLIAN static const Efl_Access_Action_Data*
-_elm_index_item_efl_access_widget_action_elm_actions_get(Eo *eo_it EINA_UNUSED, Elm_Index_Item_Data *data EINA_UNUSED)
+_elm_index_item_efl_access_widget_action_elm_actions_get(const Eo *eo_it EINA_UNUSED, Elm_Index_Item_Data *data EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "activate", "activate", NULL, _item_action_activate},
diff --git a/src/lib/elementary/elm_index.eo b/src/lib/elementary/elm_index.eo
index 3dce6e8b2c..9916adcd74 100644
--- a/src/lib/elementary/elm_index.eo
+++ b/src/lib/elementary/elm_index.eo
@@ -1,5 +1,5 @@
-class Elm.Index (Efl.Ui.Layout, Efl.Ui.Direction,
- Efl.Ui.Clickable, Efl.Ui.Selectable)
+class Elm.Index (Efl.Ui.Layout.Object, Efl.Ui.Direction,
+ Efl.Ui.Clickable, Efl.Ui.Selectable, Efl.Ui.Legacy)
{
[[elementary index class]]
legacy_prefix: elm_index;
@@ -98,7 +98,7 @@ class Elm.Index (Efl.Ui.Layout, Efl.Ui.Direction,
$item will be the pointer returned back on $"changed",
"delay,changed" and $"selected" smart events.
- Note: If $relative is $NULL this function will behave as
+ Note: If $after is $NULL this function will behave as
elm_index_item_append().]]
return: Elm.Widget.Item; [[A handle to the item added or $NULL, on errors]]
@@ -127,7 +127,7 @@ class Elm.Index (Efl.Ui.Layout, Efl.Ui.Direction,
$item will be the pointer returned back on $"changed",
"delay,changed" and $"selected" smart events.
- Note: If $relative is $NULL this function will behave as
+ Note: If $before is $NULL this function will behave as
elm_index_item_prepend().]]
return: Elm.Widget.Item; [[A handle to the item added or $NULL, on errors]]
@@ -197,15 +197,15 @@ class Elm.Index (Efl.Ui.Layout, Efl.Ui.Direction,
implements {
class.constructor;
Efl.Object.constructor;
- Elm.Widget.theme_apply;
- Elm.Widget.on_access_update;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.on_access_update;
Efl.Ui.Direction.direction { get; set; [[Only supports $vertical and $horizontal. Default is $vertical.]] }
- Efl.Access.children { get; }
+ Efl.Access.Object.access_children { get; }
}
events {
- changed; [[Called when index changed]]
- delay,changed; [[Called when delay changed]]
- level,up; [[Called when level increased]]
- level,down; [[Called when level decreased]]
+ changed: Efl.Object; [[Called when index changed]]
+ delay,changed: Efl.Object; [[Called when delay changed]]
+ level,up: void; [[Called when level increased]]
+ level,down: void; [[Called when level decreased]]
}
}
diff --git a/src/lib/elementary/elm_index_item.eo b/src/lib/elementary/elm_index_item.eo
index b1c3d8bdeb..304f246cb5 100644
--- a/src/lib/elementary/elm_index_item.eo
+++ b/src/lib/elementary/elm_index_item.eo
@@ -1,4 +1,4 @@
-class Elm.Index.Item(Elm.Widget.Item, Efl.Access.Widget.Action)
+class Elm.Index.Item(Elm.Widget.Item, Efl.Access.Widget.Action, Efl.Ui.Legacy)
{
[[Elementary index item class]]
legacy_prefix: elm_index_item;
@@ -44,7 +44,7 @@ class Elm.Index.Item(Elm.Widget.Item, Efl.Access.Widget.Action)
Efl.Object.constructor;
Efl.Object.destructor;
Elm.Widget.Item.access_register;
- Efl.Access.name { get; }
+ Efl.Access.Object.i18n_name { get; }
Efl.Access.Widget.Action.elm_actions { get; }
}
}
diff --git a/src/lib/elementary/elm_interface_fileselector.c b/src/lib/elementary/elm_interface_fileselector.c
index aaa7cdae2e..091911100a 100644
--- a/src/lib/elementary/elm_interface_fileselector.c
+++ b/src/lib/elementary/elm_interface_fileselector.c
@@ -2,7 +2,11 @@
# include "elementary_config.h"
#endif
+#define ELM_INTERFACE_FILESELECTOR_BETA
+
#include <Elementary.h>
+#include "Eio_Eo.h"
+
#include "elm_interface_fileselector.h"
#include "elm_interface_fileselector.eo.c"
diff --git a/src/lib/elementary/elm_interface_fileselector.eo b/src/lib/elementary/elm_interface_fileselector.eo
index 3a8e814f32..fb35f6264a 100644
--- a/src/lib/elementary/elm_interface_fileselector.eo
+++ b/src/lib/elementary/elm_interface_fileselector.eo
@@ -25,7 +25,7 @@ enum Elm.Fileselector.Sort
last [[Sentinel value to indicate last enum field during iteration]]
}
-interface Elm.Interface.Fileselector ()
+interface Elm.Interface.Fileselector (Efl.Ui.View)
{
[[Elementary fileselector interface]]
eo_prefix: elm_interface_fileselector;
@@ -97,17 +97,6 @@ interface Elm.Interface.Fileselector ()
expand: bool; [[$true if tree view is expanded, $false otherwise]]
}
}
- @property model {
- set {
- [[Set, programmatically, the directory that a given file selector widget will display contents from]]
- }
- get {
- [[Get the directory's model that a given file selector selector widget display contents from]]
- }
- values {
- model: Efl.Model; [[Directory model]]
- }
- }
@property mode {
set {
[[Set the mode in which a given file selector widget will display (layout) file system entries in its view]]
@@ -139,7 +128,7 @@ interface Elm.Interface.Fileselector ()
}
}
@property current_name {
- [[ Current name property]]
+ [[ Current name property]]
set {
}
get {
@@ -148,16 +137,17 @@ interface Elm.Interface.Fileselector ()
name: string; [[Name]]
}
}
- selected_model_set {
- [[Set, programmatically, the currently selected file/directory in the given file selector widget]]
- params {
- @in model: Efl.Model; [[Model to be set]]
+ @property selected_model @beta {
+ set {
+ [[Set, programmatically, the currently selected file/directory in the given file selector widget]]
+ return: bool; [[$true on success, $false otherwise]]
+ }
+ get {
+ [[Get the currently selected item's model, in the given file the given file selector widget]]
+ }
+ values {
+ model: Eio.Model; [[Model to be set, NULL reset it.]]
}
- return: future<Efl.Model>; [[Promise returning the recorded selected model or error]]
- }
- selected_model_get {
- [[Get the currently selected item's model, in the given file the given file selector widget]]
- return: Efl.Model; [[Selected model]]
}
custom_filter_append {
[[Append custom filter into filter list]]
diff --git a/src/lib/elementary/elm_interface_scrollable.c b/src/lib/elementary/elm_interface_scrollable.c
index 071dc458d8..dfdfefc122 100644
--- a/src/lib/elementary/elm_interface_scrollable.c
+++ b/src/lib/elementary/elm_interface_scrollable.c
@@ -4,6 +4,8 @@
#include <Elementary.h>
+#define EFL_UI_WIDGET_FOCUS_MANAGER_PROTECTED
+
#include "elm_priv.h"
#include "elm_interface_scrollable.h"
@@ -67,6 +69,11 @@ static void _elm_scroll_bounce_y_animator(void *data, const Efl_Event *event);
static void _elm_scroll_bounce_x_animator(void *data, const Efl_Event *event);
static void _elm_scroll_momentum_animator(void *data, const Efl_Event *event);
+static const char iface_scr_legacy_dragable_hbar[] = "elm.dragable.hbar";
+static const char iface_scr_legacy_dragable_vbar[] = "elm.dragable.vbar";
+static const char iface_scr_efl_ui_dragable_hbar[] = "efl.dragable.hbar";
+static const char iface_scr_efl_ui_dragable_vbar[] = "efl.dragable.vbar";
+
static double
_round(double value, int pos)
{
@@ -82,7 +89,8 @@ _round(double value, int pos)
static void
_elm_pan_update(Elm_Pan_Smart_Data *psd)
{
- evas_object_move(psd->content, psd->x - psd->px, psd->y - psd->py);
+ if (psd->content)
+ evas_object_move(psd->content, psd->x - psd->px, psd->y - psd->py);
}
EOLIAN static void
@@ -102,12 +110,12 @@ _elm_pan_efl_canvas_group_group_del(Eo *obj, Elm_Pan_Smart_Data *_pd EINA_UNUSED
}
EOLIAN static void
-_elm_pan_efl_gfx_position_set(Eo *obj, Elm_Pan_Smart_Data *psd, Eina_Position2D pos)
+_elm_pan_efl_gfx_entity_position_set(Eo *obj, Elm_Pan_Smart_Data *psd, Eina_Position2D pos)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
- efl_gfx_position_set(efl_super(obj, MY_PAN_CLASS), pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_PAN_CLASS), pos);
psd->x = pos.x;
psd->y = pos.y;
@@ -116,12 +124,12 @@ _elm_pan_efl_gfx_position_set(Eo *obj, Elm_Pan_Smart_Data *psd, Eina_Position2D
}
EOLIAN static void
-_elm_pan_efl_gfx_size_set(Eo *obj EINA_UNUSED, Elm_Pan_Smart_Data *psd, Eina_Size2D sz)
+_elm_pan_efl_gfx_entity_size_set(Eo *obj EINA_UNUSED, Elm_Pan_Smart_Data *psd, Eina_Size2D sz)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
- efl_gfx_size_set(efl_super(obj, MY_PAN_CLASS), sz);
+ efl_gfx_entity_size_set(efl_super(obj, MY_PAN_CLASS), sz);
psd->w = sz.w;
psd->h = sz.h;
@@ -131,13 +139,13 @@ _elm_pan_efl_gfx_size_set(Eo *obj EINA_UNUSED, Elm_Pan_Smart_Data *psd, Eina_Siz
}
EOLIAN static void
-_elm_pan_efl_gfx_visible_set(Eo *obj, Elm_Pan_Smart_Data *psd, Eina_Bool vis)
+_elm_pan_efl_gfx_entity_visible_set(Eo *obj, Elm_Pan_Smart_Data *psd, Eina_Bool vis)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 0, vis))
return;
- efl_gfx_visible_set(efl_super(obj, MY_PAN_CLASS), vis);
- if (psd->content) efl_gfx_visible_set(psd->content, vis);
+ efl_gfx_entity_visible_set(efl_super(obj, MY_PAN_CLASS), vis);
+ if (psd->content) efl_gfx_entity_visible_set(psd->content, vis);
}
EOLIAN static void
@@ -152,14 +160,14 @@ _elm_pan_pos_set(Eo *obj EINA_UNUSED, Elm_Pan_Smart_Data *psd, Evas_Coord x, Eva
}
EOLIAN static void
-_elm_pan_pos_get(Eo *obj EINA_UNUSED, Elm_Pan_Smart_Data *psd, Evas_Coord *x, Evas_Coord *y)
+_elm_pan_pos_get(const Eo *obj EINA_UNUSED, Elm_Pan_Smart_Data *psd, Evas_Coord *x, Evas_Coord *y)
{
if (x) *x = psd->px;
if (y) *y = psd->py;
}
EOLIAN static void
-_elm_pan_pos_max_get(Eo *obj EINA_UNUSED, Elm_Pan_Smart_Data *psd, Evas_Coord *x, Evas_Coord *y)
+_elm_pan_pos_max_get(const Eo *obj EINA_UNUSED, Elm_Pan_Smart_Data *psd, Evas_Coord *x, Evas_Coord *y)
{
if (x)
{
@@ -174,7 +182,7 @@ _elm_pan_pos_max_get(Eo *obj EINA_UNUSED, Elm_Pan_Smart_Data *psd, Evas_Coord *x
}
EOLIAN static void
-_elm_pan_pos_min_get(Eo *obj EINA_UNUSED, Elm_Pan_Smart_Data *_pd EINA_UNUSED, Evas_Coord *x, Evas_Coord *y)
+_elm_pan_pos_min_get(const Eo *obj EINA_UNUSED, Elm_Pan_Smart_Data *_pd EINA_UNUSED, Evas_Coord *x, Evas_Coord *y)
{
if (x)
*x = 0;
@@ -183,7 +191,7 @@ _elm_pan_pos_min_get(Eo *obj EINA_UNUSED, Elm_Pan_Smart_Data *_pd EINA_UNUSED, E
}
EOLIAN static void
-_elm_pan_content_size_get(Eo *obj EINA_UNUSED, Elm_Pan_Smart_Data *psd, Evas_Coord *w, Evas_Coord *h)
+_elm_pan_content_size_get(const Eo *obj EINA_UNUSED, Elm_Pan_Smart_Data *psd, Evas_Coord *w, Evas_Coord *h)
{
if (w) *w = psd->content_w;
if (h) *h = psd->content_h;
@@ -192,7 +200,7 @@ _elm_pan_content_size_get(Eo *obj EINA_UNUSED, Elm_Pan_Smart_Data *psd, Evas_Coo
static Evas_Object *
_elm_pan_add(Evas *evas)
{
- return efl_add(MY_PAN_CLASS, evas, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_PAN_CLASS, evas);
}
EOLIAN static Eo *
@@ -746,7 +754,7 @@ _elm_scroll_scroll_bar_auto_visibility_adjust(Elm_Scrollable_Smart_Interface_Dat
w = sid->content_info.w;
h = sid->content_info.h;
- sz = efl_gfx_size_get(sid->edje_obj);
+ sz = efl_gfx_entity_size_get(sid->edje_obj);
// Adjust when the content may fit but the bars are visible. The if() test
// does not guarantee that the content will fit (offsets & margins depend
@@ -780,10 +788,30 @@ _elm_scroll_scroll_bar_visibility_adjust(
_elm_scroll_scroll_bar_auto_visibility_adjust(sid);
}
+static inline EINA_PURE Eina_Bool
+_elm_scroll_has_bars(const Elm_Scrollable_Smart_Interface_Data *sid)
+{
+ const char *iface_scr_dragable_hbar = NULL;
+ const char *iface_scr_dragable_vbar = NULL;
+ if (elm_widget_is_legacy(sid->obj))
+ {
+ iface_scr_dragable_hbar = iface_scr_legacy_dragable_hbar;
+ iface_scr_dragable_vbar = iface_scr_legacy_dragable_vbar;
+ }
+ else
+ {
+ iface_scr_dragable_hbar = iface_scr_efl_ui_dragable_hbar;
+ iface_scr_dragable_vbar = iface_scr_efl_ui_dragable_vbar;
+ }
+ return edje_object_part_exists(sid->edje_obj, iface_scr_dragable_hbar) ||
+ edje_object_part_exists(sid->edje_obj, iface_scr_dragable_vbar);
+}
+
static void
_elm_scroll_scroll_bar_size_adjust(Elm_Scrollable_Smart_Interface_Data *sid)
{
if (!sid->pan_obj || !sid->edje_obj) return;
+ if (efl_invalidated_get(sid->pan_obj) || efl_invalidated_get(sid->edje_obj)) return;
if (sid->size_adjust_recurse_abort) return;
if (sid->size_adjust_recurse > 20)
@@ -792,6 +820,20 @@ _elm_scroll_scroll_bar_size_adjust(Elm_Scrollable_Smart_Interface_Data *sid)
return;
}
sid->size_adjust_recurse++;
+
+ const char *iface_scr_dragable_hbar = NULL;
+ const char *iface_scr_dragable_vbar = NULL;
+ if (elm_widget_is_legacy(sid->obj))
+ {
+ iface_scr_dragable_hbar = iface_scr_legacy_dragable_hbar;
+ iface_scr_dragable_vbar = iface_scr_legacy_dragable_vbar;
+ }
+ else
+ {
+ iface_scr_dragable_hbar = iface_scr_efl_ui_dragable_hbar;
+ iface_scr_dragable_vbar = iface_scr_efl_ui_dragable_vbar;
+ }
+
if ((sid->content) || (sid->extern_pan))
{
Evas_Coord x, y, w, h, mx = 0, my = 0, vw = 0, vh = 0,
@@ -799,8 +841,20 @@ _elm_scroll_scroll_bar_size_adjust(Elm_Scrollable_Smart_Interface_Data *sid)
double vx = 0.0, vy = 0.0, size;
edje_object_calc_force(sid->edje_obj);
- edje_object_part_geometry_get
- (sid->edje_obj, "elm.swallow.content", NULL, NULL, &vw, &vh);
+ if (elm_widget_is_legacy(sid->obj))
+ {
+ edje_object_part_geometry_get
+ (sid->edje_obj, "elm.swallow.content", NULL, NULL, &vw, &vh);
+ }
+ else
+ {
+ edje_object_part_geometry_get
+ (sid->edje_obj, "efl.content", NULL, NULL, &vw, &vh);
+ }
+
+ if (!_elm_scroll_has_bars(sid))
+ goto skip_bars;
+
w = sid->content_info.w;
if (w < 1) w = 1;
size = (double)vw / (double)w;
@@ -809,10 +863,10 @@ _elm_scroll_scroll_bar_size_adjust(Elm_Scrollable_Smart_Interface_Data *sid)
{
size = 1.0;
edje_object_part_drag_value_set
- (sid->edje_obj, "elm.dragable.hbar", 0.0, 0.0);
+ (sid->edje_obj, iface_scr_dragable_hbar, 0.0, 0.0);
}
edje_object_part_drag_size_set
- (sid->edje_obj, "elm.dragable.hbar", size, 1.0);
+ (sid->edje_obj, iface_scr_dragable_hbar, size, 1.0);
h = sid->content_info.h;
if (h < 1) h = 1;
@@ -821,15 +875,15 @@ _elm_scroll_scroll_bar_size_adjust(Elm_Scrollable_Smart_Interface_Data *sid)
{
size = 1.0;
edje_object_part_drag_value_set
- (sid->edje_obj, "elm.dragable.vbar", 0.0, 0.0);
+ (sid->edje_obj, iface_scr_dragable_vbar, 0.0, 0.0);
}
edje_object_part_drag_size_set
- (sid->edje_obj, "elm.dragable.vbar", 1.0, size);
+ (sid->edje_obj, iface_scr_dragable_vbar, 1.0, size);
edje_object_part_drag_value_get
- (sid->edje_obj, "elm.dragable.hbar", &vx, NULL);
+ (sid->edje_obj, iface_scr_dragable_hbar, &vx, NULL);
edje_object_part_drag_value_get
- (sid->edje_obj, "elm.dragable.vbar", NULL, &vy);
+ (sid->edje_obj, iface_scr_dragable_vbar, NULL, &vy);
elm_obj_pan_pos_max_get(sid->pan_obj, &mx, &my);
elm_obj_pan_pos_min_get(sid->pan_obj, &minx, &miny);
@@ -837,26 +891,26 @@ _elm_scroll_scroll_bar_size_adjust(Elm_Scrollable_Smart_Interface_Data *sid)
y = vy * my + miny;
edje_object_part_drag_step_set
- (sid->edje_obj, "elm.dragable.hbar", (double)sid->step.x /
+ (sid->edje_obj, iface_scr_dragable_hbar, (double)sid->step.x /
(double)w, 0.0);
edje_object_part_drag_step_set
- (sid->edje_obj, "elm.dragable.vbar", 0.0, (double)sid->step.y /
+ (sid->edje_obj, iface_scr_dragable_vbar, 0.0, (double)sid->step.y /
(double)h);
if (sid->page.x > 0)
edje_object_part_drag_page_set
- (sid->edje_obj, "elm.dragable.hbar", (double)sid->page.x /
+ (sid->edje_obj, iface_scr_dragable_hbar, (double)sid->page.x /
(double)w, 0.0);
else
edje_object_part_drag_page_set
- (sid->edje_obj, "elm.dragable.hbar",
+ (sid->edje_obj, iface_scr_dragable_hbar,
-((double)sid->page.x * ((double)vw / (double)w)) / 100.0, 0.0);
if (sid->page.y > 0)
edje_object_part_drag_page_set
- (sid->edje_obj, "elm.dragable.vbar", 0.0,
+ (sid->edje_obj, iface_scr_dragable_vbar, 0.0,
(double)sid->page.y / (double)h);
else
edje_object_part_drag_page_set
- (sid->edje_obj, "elm.dragable.vbar", 0.0,
+ (sid->edje_obj, iface_scr_dragable_vbar, 0.0,
-((double)sid->page.y * ((double)vh / (double)h)) / 100.0);
elm_obj_pan_pos_get(sid->pan_obj, &px, &py);
@@ -879,24 +933,29 @@ _elm_scroll_scroll_bar_size_adjust(Elm_Scrollable_Smart_Interface_Data *sid)
vy = 1.0;
edje_object_part_drag_value_set
- (sid->edje_obj, "elm.dragable.vbar", 0.0, vy);
+ (sid->edje_obj, iface_scr_dragable_vbar, 0.0, vy);
edje_object_part_drag_value_set
- (sid->edje_obj, "elm.dragable.hbar", vx, 0.0);
+ (sid->edje_obj, iface_scr_dragable_hbar, vx, 0.0);
}
else
{
Evas_Coord px = 0, py = 0, minx = 0, miny = 0;
- edje_object_part_drag_size_set
- (sid->edje_obj, "elm.dragable.vbar", 1.0, 1.0);
- edje_object_part_drag_size_set
- (sid->edje_obj, "elm.dragable.hbar", 1.0, 1.0);
+ if (_elm_scroll_has_bars(sid))
+ {
+ edje_object_part_drag_size_set
+ (sid->edje_obj, iface_scr_dragable_vbar, 1.0, 1.0);
+ edje_object_part_drag_size_set
+ (sid->edje_obj, iface_scr_dragable_hbar, 1.0, 1.0);
+ }
elm_obj_pan_pos_min_get(sid->pan_obj, &minx, &miny);
elm_obj_pan_pos_get(sid->pan_obj, &px, &py);
elm_obj_pan_pos_set(sid->pan_obj, minx, miny);
if ((px != minx) || (py != miny))
edje_object_signal_emit(sid->edje_obj, "elm,action,scroll", "elm");
}
+
+skip_bars:
_elm_scroll_scroll_bar_visibility_adjust(sid);
sid->size_adjust_recurse--;
if (sid->size_adjust_recurse <= 0)
@@ -919,10 +978,25 @@ _elm_scroll_scroll_bar_read_and_update(
|| (sid->down.bounce_y_animator) || (sid->down.momentum_animator)
|| (sid->scrollto.x.animator) || (sid->scrollto.y.animator))
return;
+ if (!_elm_scroll_has_bars(sid)) return;
+
+ const char *iface_scr_dragable_hbar = NULL;
+ const char *iface_scr_dragable_vbar = NULL;
+ if (elm_widget_is_legacy(sid->obj))
+ {
+ iface_scr_dragable_hbar = iface_scr_legacy_dragable_hbar;
+ iface_scr_dragable_vbar = iface_scr_legacy_dragable_vbar;
+ }
+ else
+ {
+ iface_scr_dragable_hbar = iface_scr_efl_ui_dragable_hbar;
+ iface_scr_dragable_vbar = iface_scr_efl_ui_dragable_vbar;
+ }
+
edje_object_part_drag_value_get
- (sid->edje_obj, "elm.dragable.vbar", NULL, &vy);
+ (sid->edje_obj, iface_scr_dragable_vbar, NULL, &vy);
edje_object_part_drag_value_get
- (sid->edje_obj, "elm.dragable.hbar", &vx, NULL);
+ (sid->edje_obj, iface_scr_dragable_hbar, &vx, NULL);
elm_obj_pan_pos_max_get(sid->pan_obj, &mx, &my);
elm_obj_pan_pos_min_get(sid->pan_obj, &minx, &miny);
x = _round(vx * (double)mx + minx, 1);
@@ -1179,13 +1253,13 @@ _elm_scroll_edje_drag_h_cb(void *data,
}
EOLIAN static void
-_elm_interface_scrollable_content_size_get(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, Evas_Coord *w, Evas_Coord *h)
+_elm_interface_scrollable_content_size_get(const Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, Evas_Coord *w, Evas_Coord *h)
{
elm_obj_pan_content_size_get(sid->pan_obj, w, h);
}
EOLIAN static void
-_elm_interface_scrollable_content_viewport_geometry_get(Eo *obj EINA_UNUSED,
+_elm_interface_scrollable_content_viewport_geometry_get(const Eo *obj EINA_UNUSED,
Elm_Scrollable_Smart_Interface_Data *sid,
Evas_Coord *x,
Evas_Coord *y,
@@ -1482,7 +1556,7 @@ _elm_scroll_bounce_eval(Elm_Scrollable_Smart_Interface_Data *sid)
}
EOLIAN static void
-_elm_interface_scrollable_content_pos_get(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, Evas_Coord *x, Evas_Coord *y)
+_elm_interface_scrollable_content_pos_get(const Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, Evas_Coord *x, Evas_Coord *y)
{
if (!sid->pan_obj) return;
@@ -1576,10 +1650,26 @@ _elm_interface_scrollable_content_pos_set(Eo *obj, Elm_Scrollable_Smart_Interfac
else if (vy > 1.0)
vy = 1.0;
- edje_object_part_drag_value_set
- (sid->edje_obj, "elm.dragable.vbar", 0.0, vy);
- edje_object_part_drag_value_set
- (sid->edje_obj, "elm.dragable.hbar", vx, 0.0);
+ const char *iface_scr_dragable_hbar = NULL;
+ const char *iface_scr_dragable_vbar = NULL;
+ if (elm_widget_is_legacy(sid->obj))
+ {
+ iface_scr_dragable_hbar = iface_scr_legacy_dragable_hbar;
+ iface_scr_dragable_vbar = iface_scr_legacy_dragable_vbar;
+ }
+ else
+ {
+ iface_scr_dragable_hbar = iface_scr_efl_ui_dragable_hbar;
+ iface_scr_dragable_vbar = iface_scr_efl_ui_dragable_vbar;
+ }
+
+ if (_elm_scroll_has_bars(sid))
+ {
+ edje_object_part_drag_value_set
+ (sid->edje_obj, iface_scr_dragable_vbar, 0.0, vy);
+ edje_object_part_drag_value_set
+ (sid->edje_obj, iface_scr_dragable_hbar, vx, 0.0);
+ }
if (!sid->loop_h && !sid->down.bounce_x_animator)
{
@@ -1672,7 +1762,7 @@ _elm_interface_scrollable_content_pos_set(Eo *obj, Elm_Scrollable_Smart_Interfac
}
EOLIAN static void
-_elm_interface_scrollable_mirrored_set(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, Eina_Bool mirrored)
+_elm_interface_scrollable_efl_ui_base_mirrored_set(Eo *obj, Elm_Scrollable_Smart_Interface_Data *sid, Eina_Bool mirrored)
{
Evas_Coord wx;
@@ -1692,6 +1782,7 @@ _elm_interface_scrollable_mirrored_set(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart
wx = sid->wx;
elm_interface_scrollable_content_pos_set(sid->obj, wx, sid->wy, EINA_FALSE);
+ efl_ui_mirrored_set(efl_super(obj, ELM_INTERFACE_SCROLLABLE_MIXIN), mirrored);
}
/* returns TRUE when we need to move the scroller, FALSE otherwise.
@@ -1799,7 +1890,7 @@ _elm_scroll_content_region_show_internal(Evas_Object *obj,
}
EOLIAN static void
-_elm_interface_scrollable_content_region_get(Eo *obj, Elm_Scrollable_Smart_Interface_Data *_pd EINA_UNUSED, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
+_elm_interface_scrollable_content_region_get(const Eo *obj, Elm_Scrollable_Smart_Interface_Data *_pd EINA_UNUSED, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
{
elm_interface_scrollable_content_pos_get(obj, x, y);
elm_interface_scrollable_content_viewport_geometry_get
@@ -2150,10 +2241,9 @@ _elm_scroll_post_event_up(void *data,
if (sid->obj)
{
- if (sid->down.dragged)
- elm_widget_scroll_lock_set(sid->obj, EFL_UI_SCROLL_BLOCK_NONE);
+ elm_widget_scroll_lock_set(sid->obj, EFL_UI_SCROLL_BLOCK_NONE);
}
- return EINA_FALSE;
+ return EINA_TRUE;
}
static Eina_Bool
@@ -2946,7 +3036,7 @@ _elm_widget_parents_bounce_get(Eo *obj, Eina_Bool *horiz, Eina_Bool *vert)
do
{
parent_obj = elm_widget_parent_get(parent_obj);
- if ((!parent_obj) || (!efl_isa(parent_obj, ELM_WIDGET_CLASS))) break;
+ if ((!parent_obj) || (!efl_isa(parent_obj, EFL_UI_WIDGET_CLASS))) break;
if (efl_isa(parent_obj, ELM_INTERFACE_SCROLLABLE_MIXIN))
{
@@ -3037,7 +3127,7 @@ _elm_scroll_post_event_move(void *data,
}
if (start) _elm_scroll_drag_start(sid);
- return EINA_FALSE;
+ return EINA_TRUE;
}
static void
@@ -3680,48 +3770,65 @@ _scroll_edje_object_attach(Evas_Object *obj)
edje_object_signal_callback_add
(sid->edje_obj, "reload", "elm", _elm_scroll_reload_cb, sid);
+
+ if (!_elm_scroll_has_bars(sid))
+ return;
+
+ const char *iface_scr_dragable_vbar = NULL;
+ if (elm_widget_is_legacy(sid->obj))
+ iface_scr_dragable_vbar = iface_scr_legacy_dragable_vbar;
+ else
+ iface_scr_dragable_vbar = iface_scr_efl_ui_dragable_vbar;
edje_object_signal_callback_add
- (sid->edje_obj, "drag", "elm.dragable.vbar", _elm_scroll_vbar_drag_cb,
+ (sid->edje_obj, "drag", iface_scr_dragable_vbar, _elm_scroll_vbar_drag_cb,
sid);
edje_object_signal_callback_add
- (sid->edje_obj, "drag,set", "elm.dragable.vbar",
+ (sid->edje_obj, "drag,set", iface_scr_dragable_vbar,
_elm_scroll_edje_drag_v_cb, sid);
edje_object_signal_callback_add
- (sid->edje_obj, "drag,start", "elm.dragable.vbar",
+ (sid->edje_obj, "drag,start", iface_scr_dragable_vbar,
_elm_scroll_edje_drag_v_start_cb, sid);
edje_object_signal_callback_add
- (sid->edje_obj, "drag,stop", "elm.dragable.vbar",
+ (sid->edje_obj, "drag,stop", iface_scr_dragable_vbar,
_elm_scroll_edje_drag_v_stop_cb, sid);
edje_object_signal_callback_add
- (sid->edje_obj, "drag,step", "elm.dragable.vbar",
+ (sid->edje_obj, "drag,step", iface_scr_dragable_vbar,
_elm_scroll_edje_drag_v_cb, sid);
edje_object_signal_callback_add
- (sid->edje_obj, "drag,page", "elm.dragable.vbar",
+ (sid->edje_obj, "drag,page", iface_scr_dragable_vbar,
_elm_scroll_edje_drag_v_cb, sid);
+
edje_object_signal_callback_add
(sid->edje_obj, "elm,vbar,press", "elm",
_elm_scroll_vbar_press_cb, sid);
edje_object_signal_callback_add
(sid->edje_obj, "elm,vbar,unpress", "elm",
_elm_scroll_vbar_unpress_cb, sid);
+
+ const char *iface_scr_dragable_hbar = NULL;
+ if (elm_widget_is_legacy(sid->obj))
+ iface_scr_dragable_hbar = iface_scr_legacy_dragable_hbar;
+ else
+ iface_scr_dragable_hbar = iface_scr_efl_ui_dragable_hbar;
edje_object_signal_callback_add
- (sid->edje_obj, "drag", "elm.dragable.hbar", _elm_scroll_hbar_drag_cb,
+ (sid->edje_obj, "drag", iface_scr_dragable_hbar, _elm_scroll_hbar_drag_cb,
sid);
edje_object_signal_callback_add
- (sid->edje_obj, "drag,set", "elm.dragable.hbar",
+ (sid->edje_obj, "drag,set", iface_scr_dragable_hbar,
_elm_scroll_edje_drag_h_cb, sid);
edje_object_signal_callback_add
- (sid->edje_obj, "drag,start", "elm.dragable.hbar",
+ (sid->edje_obj, "drag,start", iface_scr_dragable_hbar,
_elm_scroll_edje_drag_h_start_cb, sid);
edje_object_signal_callback_add
- (sid->edje_obj, "drag,stop", "elm.dragable.hbar",
+ (sid->edje_obj, "drag,stop", iface_scr_dragable_hbar,
_elm_scroll_edje_drag_h_stop_cb, sid);
edje_object_signal_callback_add
- (sid->edje_obj, "drag,step", "elm.dragable.hbar",
+ (sid->edje_obj, "drag,step", iface_scr_dragable_hbar,
_elm_scroll_edje_drag_h_cb, sid);
edje_object_signal_callback_add
- (sid->edje_obj, "drag,page", "elm.dragable.hbar",
+ (sid->edje_obj, "drag,page", iface_scr_dragable_hbar,
_elm_scroll_edje_drag_h_cb, sid);
+
edje_object_signal_callback_add
(sid->edje_obj, "elm,hbar,press", "elm",
_elm_scroll_hbar_press_cb, sid);
@@ -3759,49 +3866,65 @@ _scroll_edje_object_detach(Evas_Object *obj)
evas_object_event_callback_del_full
(sid->edje_obj, EVAS_CALLBACK_MOVE, _on_edje_move, sid);
+ if (!_elm_scroll_has_bars(sid))
+ return;
+
+ const char *iface_scr_dragable_vbar = NULL;
+ if (elm_widget_is_legacy(sid->obj))
+ iface_scr_dragable_vbar = iface_scr_legacy_dragable_vbar;
+ else
+ iface_scr_dragable_vbar = iface_scr_efl_ui_dragable_vbar;
edje_object_signal_callback_del_full
- (sid->edje_obj, "drag", "elm.dragable.vbar", _elm_scroll_vbar_drag_cb,
+ (sid->edje_obj, "drag", iface_scr_dragable_vbar, _elm_scroll_vbar_drag_cb,
sid);
edje_object_signal_callback_del_full
- (sid->edje_obj, "drag,set", "elm.dragable.vbar",
+ (sid->edje_obj, "drag,set", iface_scr_dragable_vbar,
_elm_scroll_edje_drag_v_cb, sid);
edje_object_signal_callback_del_full
- (sid->edje_obj, "drag,start", "elm.dragable.vbar",
+ (sid->edje_obj, "drag,start", iface_scr_dragable_vbar,
_elm_scroll_edje_drag_v_start_cb, sid);
edje_object_signal_callback_del_full
- (sid->edje_obj, "drag,stop", "elm.dragable.vbar",
+ (sid->edje_obj, "drag,stop", iface_scr_dragable_vbar,
_elm_scroll_edje_drag_v_stop_cb, sid);
edje_object_signal_callback_del_full
- (sid->edje_obj, "drag,step", "elm.dragable.vbar",
+ (sid->edje_obj, "drag,step", iface_scr_dragable_vbar,
_elm_scroll_edje_drag_v_cb, sid);
edje_object_signal_callback_del_full
- (sid->edje_obj, "drag,page", "elm.dragable.vbar",
+ (sid->edje_obj, "drag,page", iface_scr_dragable_vbar,
_elm_scroll_edje_drag_v_cb, sid);
+
edje_object_signal_callback_del_full
(sid->edje_obj, "elm,vbar,press", "elm",
_elm_scroll_vbar_press_cb, sid);
edje_object_signal_callback_del_full
(sid->edje_obj, "elm,vbar,unpress", "elm",
_elm_scroll_vbar_unpress_cb, sid);
+
+ const char *iface_scr_dragable_hbar = NULL;
+ if (elm_widget_is_legacy(sid->obj))
+ iface_scr_dragable_hbar = iface_scr_legacy_dragable_hbar;
+ else
+ iface_scr_dragable_hbar = iface_scr_efl_ui_dragable_hbar;
edje_object_signal_callback_del_full
- (sid->edje_obj, "drag", "elm.dragable.hbar", _elm_scroll_hbar_drag_cb,
+ (sid->edje_obj, "drag", iface_scr_dragable_hbar, _elm_scroll_hbar_drag_cb,
sid);
edje_object_signal_callback_del_full
- (sid->edje_obj, "drag,set", "elm.dragable.hbar",
+ (sid->edje_obj, "drag,set", iface_scr_dragable_hbar,
_elm_scroll_edje_drag_h_cb, sid);
edje_object_signal_callback_del_full
- (sid->edje_obj, "drag,start", "elm.dragable.hbar",
+ (sid->edje_obj, "drag,start", iface_scr_dragable_hbar,
_elm_scroll_edje_drag_h_start_cb, sid);
edje_object_signal_callback_del_full
- (sid->edje_obj, "drag,stop", "elm.dragable.hbar",
+ (sid->edje_obj, "drag,stop", iface_scr_dragable_hbar,
_elm_scroll_edje_drag_h_stop_cb, sid);
edje_object_signal_callback_del_full
- (sid->edje_obj, "drag,step", "elm.dragable.hbar",
+ (sid->edje_obj, "drag,step", iface_scr_dragable_hbar,
_elm_scroll_edje_drag_h_cb, sid);
edje_object_signal_callback_del_full
- (sid->edje_obj, "drag,page", "elm.dragable.hbar",
+ (sid->edje_obj, "drag,page", iface_scr_dragable_hbar,
_elm_scroll_edje_drag_h_cb, sid);
- edje_object_signal_callback_del_full
+
+ edje_object_signal_callback_del_full
(sid->edje_obj, "elm,hbar,press", "elm",
_elm_scroll_hbar_press_cb, sid);
edje_object_signal_callback_del_full
@@ -3851,22 +3974,46 @@ _elm_interface_scrollable_objects_set(Eo *obj, Elm_Scrollable_Smart_Interface_Da
mw = mh = -1;
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
- if (edje_object_part_exists(sid->edje_obj, "elm.scrollbar.base"))
- {
- Evas_Object *base;
- base = edje_object_part_swallow_get
- (sid->edje_obj, "elm.scrollbar.base");
- if (!base)
+ if (elm_widget_is_legacy(sid->obj))
+ {
+ if (edje_object_part_exists(sid->edje_obj, "elm.scrollbar.base"))
+ {
+ Evas_Object *base;
+
+ base = edje_object_part_swallow_get
+ (sid->edje_obj, "elm.scrollbar.base");
+ if (!base)
+ {
+ base = evas_object_rectangle_add
+ (evas_object_evas_get(sid->edje_obj));
+ evas_object_color_set(base, 0, 0, 0, 0);
+ edje_object_part_swallow
+ (sid->edje_obj, "elm.scrollbar.base", base);
+ }
+ if (!_elm_config->thumbscroll_enable)
+ evas_object_size_hint_min_set(base, mw, mh);
+ }
+ }
+ else
+ {
+ if (edje_object_part_exists(sid->edje_obj, "efl.scrollbar.base"))
{
- base = evas_object_rectangle_add
- (evas_object_evas_get(sid->edje_obj));
- evas_object_color_set(base, 0, 0, 0, 0);
- edje_object_part_swallow
- (sid->edje_obj, "elm.scrollbar.base", base);
+ Evas_Object *base;
+
+ base = edje_object_part_swallow_get
+ (sid->edje_obj, "efl.scrollbar.base");
+ if (!base)
+ {
+ base = evas_object_rectangle_add
+ (evas_object_evas_get(sid->edje_obj));
+ evas_object_color_set(base, 0, 0, 0, 0);
+ edje_object_part_swallow
+ (sid->edje_obj, "efl.scrollbar.base", base);
+ }
+ if (!_elm_config->thumbscroll_enable)
+ evas_object_size_hint_min_set(base, mw, mh);
}
- if (!_elm_config->thumbscroll_enable)
- evas_object_size_hint_min_set(base, mw, mh);
}
_elm_scroll_scroll_bar_visibility_adjust(sid);
@@ -3877,18 +4024,34 @@ _elm_scroll_scroll_bar_reset(Elm_Scrollable_Smart_Interface_Data *sid)
{
Evas_Coord px = 0, py = 0, minx = 0, miny = 0;
- if (!sid->edje_obj) return;
+ if (!sid->edje_obj || efl_invalidated_get(sid->edje_obj)) return;
- edje_object_part_drag_value_set
- (sid->edje_obj, "elm.dragable.vbar", 0.0, 0.0);
- edje_object_part_drag_value_set
- (sid->edje_obj, "elm.dragable.hbar", 0.0, 0.0);
- if ((!sid->content) && (!sid->extern_pan))
+ const char *iface_scr_dragable_hbar = NULL;
+ const char *iface_scr_dragable_vbar = NULL;
+ if (elm_widget_is_legacy(sid->obj))
{
- edje_object_part_drag_size_set
- (sid->edje_obj, "elm.dragable.vbar", 1.0, 1.0);
- edje_object_part_drag_size_set
- (sid->edje_obj, "elm.dragable.hbar", 1.0, 1.0);
+ iface_scr_dragable_hbar = iface_scr_legacy_dragable_hbar;
+ iface_scr_dragable_vbar = iface_scr_legacy_dragable_vbar;
+ }
+ else
+ {
+ iface_scr_dragable_hbar = iface_scr_efl_ui_dragable_hbar;
+ iface_scr_dragable_vbar = iface_scr_efl_ui_dragable_vbar;
+ }
+
+ if (_elm_scroll_has_bars(sid))
+ {
+ edje_object_part_drag_value_set
+ (sid->edje_obj, iface_scr_dragable_vbar, 0.0, 0.0);
+ edje_object_part_drag_value_set
+ (sid->edje_obj, iface_scr_dragable_hbar, 0.0, 0.0);
+ if ((!sid->content) && (!sid->extern_pan))
+ {
+ edje_object_part_drag_size_set
+ (sid->edje_obj, iface_scr_dragable_vbar, 1.0, 1.0);
+ edje_object_part_drag_size_set
+ (sid->edje_obj, iface_scr_dragable_hbar, 1.0, 1.0);
+ }
}
if (sid->pan_obj)
{
@@ -3984,7 +4147,11 @@ _elm_interface_scrollable_scrollable_content_set(Eo *obj, Elm_Scrollable_Smart_I
(o, ELM_PAN_EVENT_CHANGED, _elm_scroll_pan_changed_cb, sid);
evas_object_event_callback_add(o, EVAS_CALLBACK_RESIZE,
_elm_scroll_pan_resized_cb, sid);
- edje_object_part_swallow(sid->edje_obj, "elm.swallow.content", o);
+
+ if (elm_widget_is_legacy(obj))
+ edje_object_part_swallow(sid->edje_obj, "elm.swallow.content", o);
+ else
+ edje_object_part_swallow(sid->edje_obj, "efl.content", o);
}
evas_object_event_callback_add
@@ -4039,8 +4206,17 @@ _elm_interface_scrollable_extern_pan_set(Eo *obj, Elm_Scrollable_Smart_Interface
(sid->pan_obj, ELM_PAN_EVENT_CHANGED, _elm_scroll_pan_changed_cb, sid);
evas_object_event_callback_add(sid->pan_obj, EVAS_CALLBACK_RESIZE,
_elm_scroll_pan_resized_cb, sid);
- edje_object_part_swallow
- (sid->edje_obj, "elm.swallow.content", sid->pan_obj);
+
+ if (elm_widget_is_legacy(obj))
+ {
+ edje_object_part_swallow
+ (sid->edje_obj, "elm.swallow.content", sid->pan_obj);
+ }
+ else
+ {
+ edje_object_part_swallow
+ (sid->edje_obj, "efl.content", sid->pan_obj);
+ }
}
EOLIAN static void
@@ -4176,7 +4352,7 @@ _elm_interface_scrollable_content_viewport_resize_cb_set(Eo *obj EINA_UNUSED, El
}
EOLIAN static Eina_Bool
-_elm_interface_scrollable_momentum_animator_disabled_get(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid)
+_elm_interface_scrollable_momentum_animator_disabled_get(const Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid)
{
return sid->momentum_animator_disabled;
}
@@ -4197,7 +4373,7 @@ _elm_interface_scrollable_momentum_animator_disabled_set(Eo *obj EINA_UNUSED, El
}
EOLIAN static Eina_Bool
-_elm_interface_scrollable_bounce_animator_disabled_get(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid)
+_elm_interface_scrollable_bounce_animator_disabled_get(const Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid)
{
return sid->bounce_animator_disabled;
}
@@ -4214,7 +4390,7 @@ _elm_interface_scrollable_bounce_animator_disabled_set(Eo *obj EINA_UNUSED, Elm_
}
EOLIAN static Eina_Bool
-_elm_interface_scrollable_wheel_disabled_get(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid)
+_elm_interface_scrollable_wheel_disabled_get(const Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid)
{
return sid->wheel_disabled;
}
@@ -4247,7 +4423,7 @@ _elm_interface_scrollable_step_size_set(Eo *obj EINA_UNUSED, Elm_Scrollable_Smar
}
EOLIAN static void
-_elm_interface_scrollable_step_size_get(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, Evas_Coord *x, Evas_Coord *y)
+_elm_interface_scrollable_step_size_get(const Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, Evas_Coord *x, Evas_Coord *y)
{
if (x) *x = sid->step.x;
if (y) *y = sid->step.y;
@@ -4263,7 +4439,7 @@ _elm_interface_scrollable_page_size_set(Eo *obj EINA_UNUSED, Elm_Scrollable_Smar
}
EOLIAN static void
-_elm_interface_scrollable_page_size_get(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, Evas_Coord *x, Evas_Coord *y)
+_elm_interface_scrollable_page_size_get(const Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, Evas_Coord *x, Evas_Coord *y)
{
if (x) *x = sid->page.x;
if (y) *y = sid->page.y;
@@ -4285,7 +4461,7 @@ _elm_interface_scrollable_policy_set(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_I
}
EOLIAN static void
-_elm_interface_scrollable_policy_get(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, Elm_Scroller_Policy *hbar, Elm_Scroller_Policy *vbar)
+_elm_interface_scrollable_policy_get(const Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, Elm_Scroller_Policy *hbar, Elm_Scroller_Policy *vbar)
{
if (hbar) *hbar = sid->hbar_flags;
if (vbar) *vbar = sid->vbar_flags;
@@ -4298,20 +4474,20 @@ _elm_interface_scrollable_single_direction_set(Eo *obj EINA_UNUSED, Elm_Scrollab
}
EOLIAN static Elm_Scroller_Single_Direction
-_elm_interface_scrollable_single_direction_get(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid)
+_elm_interface_scrollable_single_direction_get(const Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid)
{
return sid->one_direction_at_a_time;
}
EOLIAN static void
-_elm_interface_scrollable_repeat_events_set(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, Eina_Bool repeat_events)
+_elm_interface_scrollable_content_events_set(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, Eina_Bool repeat_events)
{
if (sid->event_rect)
evas_object_repeat_events_set(sid->event_rect, repeat_events);
}
EOLIAN static Eina_Bool
-_elm_interface_scrollable_repeat_events_get(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid)
+_elm_interface_scrollable_content_events_get(const Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid)
{
if (sid->event_rect)
return evas_object_repeat_events_get(sid->event_rect);
@@ -4351,7 +4527,7 @@ _elm_interface_scrollable_page_snap_allow_set(Eo *obj EINA_UNUSED, Elm_Scrollabl
}
EOLIAN static void
-_elm_interface_scrollable_page_snap_allow_get(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, Eina_Bool *horiz, Eina_Bool *vert)
+_elm_interface_scrollable_page_snap_allow_get(const Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, Eina_Bool *horiz, Eina_Bool *vert)
{
if (horiz) *horiz = sid->page_snap_horiz;
if (vert) *vert = sid->page_snap_vert;
@@ -4365,7 +4541,7 @@ _elm_interface_scrollable_bounce_allow_set(Eo *obj EINA_UNUSED, Elm_Scrollable_S
}
EOLIAN static void
-_elm_interface_scrollable_bounce_allow_get(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, Eina_Bool *horiz, Eina_Bool *vert)
+_elm_interface_scrollable_bounce_allow_get(const Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, Eina_Bool *horiz, Eina_Bool *vert)
{
if (horiz) *horiz = sid->bounce_horiz;
if (vert) *vert = sid->bounce_vert;
@@ -4383,7 +4559,7 @@ _elm_interface_scrollable_paging_set(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_I
}
EOLIAN static void
-_elm_interface_scrollable_paging_get(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, double *pagerel_h, double *pagerel_v, Evas_Coord *pagesize_h, Evas_Coord *pagesize_v)
+_elm_interface_scrollable_paging_get(const Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, double *pagerel_h, double *pagerel_v, Evas_Coord *pagesize_h, Evas_Coord *pagesize_v)
{
if (pagerel_h) *pagerel_h = sid->pagerel_h;
if (pagerel_v) *pagerel_v = sid->pagerel_v;
@@ -4409,14 +4585,14 @@ _elm_interface_scrollable_page_scroll_limit_set(Eo *obj EINA_UNUSED, Elm_Scrolla
}
EOLIAN static void
-_elm_interface_scrollable_page_scroll_limit_get(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, int *page_limit_h, int *page_limit_v)
+_elm_interface_scrollable_page_scroll_limit_get(const Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, int *page_limit_h, int *page_limit_v)
{
if (page_limit_h) *page_limit_h = sid->page_limit_h;
if (page_limit_v) *page_limit_v = sid->page_limit_v;
}
EOLIAN static void
-_elm_interface_scrollable_current_page_get(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, int *pagenumber_h, int *pagenumber_v)
+_elm_interface_scrollable_current_page_get(const Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, int *pagenumber_h, int *pagenumber_v)
{
Evas_Coord x, y;
@@ -4455,7 +4631,7 @@ _elm_interface_scrollable_current_page_get(Eo *obj EINA_UNUSED, Elm_Scrollable_S
}
EOLIAN static void
-_elm_interface_scrollable_last_page_get(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, int *pagenumber_h, int *pagenumber_v)
+_elm_interface_scrollable_last_page_get(const Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, int *pagenumber_h, int *pagenumber_v)
{
Evas_Coord cw, ch;
@@ -4547,7 +4723,7 @@ _elm_interface_scrollable_gravity_set(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_
}
EOLIAN static void
-_elm_interface_scrollable_gravity_get(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, double *x, double *y)
+_elm_interface_scrollable_gravity_get(const Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, double *x, double *y)
{
if (x) *x = sid->gravity_x;
if (y) *y = sid->gravity_y;
@@ -4560,13 +4736,13 @@ _elm_interface_scrollable_movement_block_set(Eo *obj EINA_UNUSED, Elm_Scrollable
}
EOLIAN static Efl_Ui_Scroll_Block
-_elm_interface_scrollable_movement_block_get(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid)
+_elm_interface_scrollable_movement_block_get(const Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid)
{
return sid->block;
}
EOLIAN static void
-_elm_interface_scrollable_loop_set(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, Eina_Bool loop_h, Eina_Bool loop_v)
+_elm_interface_scrollable_content_loop_set(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, Eina_Bool loop_h, Eina_Bool loop_v)
{
if (sid->loop_h == loop_h && sid->loop_v == loop_v) return;
@@ -4585,7 +4761,7 @@ _elm_interface_scrollable_loop_set(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Int
}
EOLIAN static void
-_elm_interface_scrollable_loop_get(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, Eina_Bool *loop_h, Eina_Bool *loop_v)
+_elm_interface_scrollable_content_loop_get(const Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, Eina_Bool *loop_h, Eina_Bool *loop_v)
{
*loop_h = sid->loop_h;
*loop_v = sid->loop_v;
@@ -4663,11 +4839,11 @@ EAPI void elm_pan_gravity_set(Elm_Pan *obj EINA_UNUSED, double x EINA_UNUSED, do
EAPI void elm_pan_gravity_get(const Elm_Pan *obj EINA_UNUSED, double *x EINA_UNUSED, double *y EINA_UNUSED) {}
EOLIAN static Efl_Ui_Focus_Manager*
-_elm_interface_scrollable_elm_widget_focus_manager_create(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *pd EINA_UNUSED, Efl_Ui_Focus_Object *root)
+_elm_interface_scrollable_efl_ui_widget_focus_manager_focus_manager_create(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *pd EINA_UNUSED, Efl_Ui_Focus_Object *root)
{
Efl_Ui_Focus_Manager *manager;
- manager = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, obj,
+ manager = efl_add(EFL_UI_FOCUS_MANAGER_ROOT_FOCUS_CLASS, obj,
efl_ui_focus_manager_root_set(efl_added, root)
);
@@ -4677,27 +4853,34 @@ _elm_interface_scrollable_elm_widget_focus_manager_create(Eo *obj EINA_UNUSED, E
EOLIAN static Efl_Object*
_elm_interface_scrollable_efl_object_constructor(Eo *obj, Elm_Scrollable_Smart_Interface_Data *pd EINA_UNUSED)
{
- pd->manager = efl_ui_widget_focus_manager_create(obj, obj);
-
- efl_composite_attach(obj, pd->manager);
+ Eo *o = efl_constructor(efl_super(obj, MY_SCROLLABLE_INTERFACE));
- _efl_ui_focus_manager_redirect_events_add(pd->manager, obj);
-
- return efl_constructor(efl_super(obj, MY_SCROLLABLE_INTERFACE));
+ return o;
}
static Eina_Bool
_filter_cb(const void *iterator EINA_UNUSED, void *data, void *fdata)
{
Eina_Rect geom;
+ int min_x, max_x, min_y, max_y;
geom = efl_ui_focus_object_focus_geometry_get(data);
- return eina_rectangles_intersect(&geom.rect, fdata);
+ min_x = geom.rect.x;
+ min_y = geom.rect.y;
+ max_x = eina_rectangle_max_x(&geom.rect);
+ max_y = eina_rectangle_max_y(&geom.rect);
+
+ Eina_Bool inside = eina_rectangle_coords_inside(fdata, min_x, min_y) ||
+ eina_rectangle_coords_inside(fdata, min_x, max_y) ||
+ eina_rectangle_coords_inside(fdata, max_x, min_y) ||
+ eina_rectangle_coords_inside(fdata, max_x, max_y);
+
+ return inside;
}
EOLIAN static Eina_Iterator*
-_elm_interface_scrollable_efl_ui_focus_manager_border_elements_get(Eo *obj, Elm_Scrollable_Smart_Interface_Data *pd EINA_UNUSED)
+_elm_interface_scrollable_efl_ui_focus_manager_border_elements_get(const Eo *obj, Elm_Scrollable_Smart_Interface_Data *pd EINA_UNUSED)
{
Eina_Iterator *border_elements;
Eina_Rectangle *rect = calloc(1, sizeof(Eina_Rectangle));
@@ -4714,7 +4897,7 @@ _elm_interface_scrollable_item_loop_enabled_set(Eo *obj EINA_UNUSED, Elm_Scrolla
}
EOLIAN static Eina_Bool
-_elm_interface_scrollable_item_loop_enabled_get(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *pd EINA_UNUSED)
+_elm_interface_scrollable_item_loop_enabled_get(const Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *pd EINA_UNUSED)
{
return EINA_FALSE;
}
diff --git a/src/lib/elementary/elm_interface_scrollable.eo b/src/lib/elementary/elm_interface_scrollable.eo
index 889efa214b..02c2739953 100644
--- a/src/lib/elementary/elm_interface_scrollable.eo
+++ b/src/lib/elementary/elm_interface_scrollable.eo
@@ -1,5 +1,3 @@
-import elm_general;
-
type Elm_Interface_Scrollable_Cb: __undefined_type; [[Elementary interface scrollable callback type]]
type Elm_Interface_Scrollable_Resize_Cb: __undefined_type; [[Elementary interface scrollable resize callback type]]
type Elm_Interface_Scrollable_Min_Limit_Cb: __undefined_type; [[Elementary interface scrollable minimal limit callback type]]
@@ -29,7 +27,7 @@ enum Elm.Scroller.Single_Direction
last [[Sentinel value to indicate last enum field during iteration]]
}
-mixin Elm.Interface_Scrollable(Efl.Ui.Scrollable, Efl.Ui.Focus.Manager.Sub, Elm.Widget)
+mixin Elm.Interface_Scrollable(Efl.Ui.Scrollable, Efl.Ui.Focus.Manager_Sub, Efl.Ui.Widget, Efl.Ui.Widget_Focus_Manager)
{
[[Elm scrollable mixin]]
eo_prefix: elm_interface_scrollable;
@@ -105,7 +103,7 @@ mixin Elm.Interface_Scrollable(Efl.Ui.Scrollable, Efl.Ui.Focus.Manager.Sub, Elm.
}
}
@property momentum_animator_disabled {
- [[Momentum animator]]
+ [[Momentum animator]]
set {
}
get {
@@ -153,7 +151,7 @@ mixin Elm.Interface_Scrollable(Efl.Ui.Scrollable, Efl.Ui.Focus.Manager.Sub, Elm.
h: int; [[Height of the region]]
}
}
- @property repeat_events {
+ @property content_events {
[[It decides whether the scrollable object propagates the events to content object or not.]]
set {
}
@@ -186,7 +184,7 @@ mixin Elm.Interface_Scrollable(Efl.Ui.Scrollable, Efl.Ui.Focus.Manager.Sub, Elm.
}
}
@property bounce_animator_disabled {
- [[Bounce animator]]
+ [[Bounce animator]]
set {
}
get {
@@ -196,7 +194,7 @@ mixin Elm.Interface_Scrollable(Efl.Ui.Scrollable, Efl.Ui.Focus.Manager.Sub, Elm.
}
}
@property page_scroll_limit {
- [[Page scroll limit]]
+ [[Page scroll limit]]
set {
}
get {
@@ -230,7 +228,7 @@ mixin Elm.Interface_Scrollable(Efl.Ui.Scrollable, Efl.Ui.Focus.Manager.Sub, Elm.
}
}
@property paging {
- [[Pagin property]]
+ [[Pagin property]]
set {
}
get {
@@ -264,7 +262,7 @@ mixin Elm.Interface_Scrollable(Efl.Ui.Scrollable, Efl.Ui.Focus.Manager.Sub, Elm.
}
}
@property step_size {
- [[Step size]]
+ [[Step size]]
set {
}
get {
@@ -274,7 +272,7 @@ mixin Elm.Interface_Scrollable(Efl.Ui.Scrollable, Efl.Ui.Focus.Manager.Sub, Elm.
y: int; [[Y coordinate]]
}
}
- @property loop {
+ @property content_loop {
[[Controls an infinite loop for a scroller.
@since 1.14]]
@@ -312,7 +310,7 @@ mixin Elm.Interface_Scrollable(Efl.Ui.Scrollable, Efl.Ui.Focus.Manager.Sub, Elm.
}
}
@property freeze {
- [[Freeze property]]
+ [[Freeze property]]
set {
}
values {
@@ -368,7 +366,7 @@ mixin Elm.Interface_Scrollable(Efl.Ui.Scrollable, Efl.Ui.Focus.Manager.Sub, Elm.
}
}
@property extern_pan {
- [[Extern pan]]
+ [[Extern pan]]
set {
}
values {
@@ -384,7 +382,7 @@ mixin Elm.Interface_Scrollable(Efl.Ui.Scrollable, Efl.Ui.Focus.Manager.Sub, Elm.
}
}
@property hold {
- [[Hold property]]
+ [[Hold property]]
set {
}
values {
@@ -432,16 +430,8 @@ mixin Elm.Interface_Scrollable(Efl.Ui.Scrollable, Efl.Ui.Focus.Manager.Sub, Elm.
animate_stop_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]]
}
}
- @property mirrored {
- [[Mirroed property]]
- set {
- }
- values {
- mirrored: bool; [[$true if mirrored, $false otherwise]]
- }
- }
@property content_min_limit_cb {
- [[set the callback to run on minimal limit content]]
+ [[set the callback to run on minimal limit content]]
set {
}
values {
@@ -457,7 +447,7 @@ mixin Elm.Interface_Scrollable(Efl.Ui.Scrollable, Efl.Ui.Focus.Manager.Sub, Elm.
}
}
@property scrollable_content {
- [[Content property]]
+ [[Content property]]
set {
}
values {
@@ -513,7 +503,7 @@ mixin Elm.Interface_Scrollable(Efl.Ui.Scrollable, Efl.Ui.Focus.Manager.Sub, Elm.
}
}
@property objects {
- [[Object property]]
+ [[Object property]]
set {
}
values {
@@ -552,7 +542,7 @@ mixin Elm.Interface_Scrollable(Efl.Ui.Scrollable, Efl.Ui.Focus.Manager.Sub, Elm.
}
}
@property content_viewport_geometry {
- [[Content viewport geometry]]
+ [[Content viewport geometry]]
get {
}
values {
@@ -575,7 +565,7 @@ mixin Elm.Interface_Scrollable(Efl.Ui.Scrollable, Efl.Ui.Focus.Manager.Sub, Elm.
}
}
content_pos_set {
- [[Set the content position]]
+ [[Set the content position]]
params {
@in x: int; [[X coordinate]]
@in y: int; [[Y coordinate]]
@@ -583,8 +573,8 @@ mixin Elm.Interface_Scrollable(Efl.Ui.Scrollable, Efl.Ui.Focus.Manager.Sub, Elm.
scroll direction, or if an edge was reached.]]
}
}
- content_pos_get {
- [[Get content position]]
+ content_pos_get @const {
+ [[Get content position]]
params {
@out x: int; [[X coordinate]]
@out y: int; [[Y coordinate]]
@@ -669,9 +659,10 @@ mixin Elm.Interface_Scrollable(Efl.Ui.Scrollable, Efl.Ui.Focus.Manager.Sub, Elm.
class.constructor;
Efl.Object.constructor;
Efl.Ui.Focus.Manager.border_elements { get; }
- Elm.Widget.focus_manager_create;
+ Efl.Ui.Widget_Focus_Manager.focus_manager_create;
+ Efl.Ui.Base.mirrored { set; }
}
events {
- changed; [[Called when content changed]]
+ changed: void; [[Called when content changed]]
}
}
diff --git a/src/lib/elementary/elm_interfaces.h b/src/lib/elementary/elm_interfaces.h
index c15669ebea..bcbe8e646f 100644
--- a/src/lib/elementary/elm_interfaces.h
+++ b/src/lib/elementary/elm_interfaces.h
@@ -1,4 +1,4 @@
-#include "efl_access.h"
+#include "efl_access_object.h"
#include "efl_access_text.h"
#include "efl_access_widget_action.h"
#include "efl_access_window.h"
@@ -13,16 +13,16 @@
#include "efl_access_action.eo.h"
#include "efl_access_component.eo.h"
#include "efl_access_editable_text.eo.h"
-#include "efl_access_image.eo.h"
#include "efl_access_selection.eo.h"
#include "efl_access_value.eo.h"
+#include "efl_ui_legacy.eo.h"
#endif
#ifndef EFL_NOLEGACY_API_SUPPORT
#include "efl_access_action.eo.legacy.h"
#include "efl_access_component.eo.legacy.h"
#include "efl_access_editable_text.eo.legacy.h"
-#include "efl_access_image.eo.legacy.h"
#include "efl_access_selection.eo.legacy.h"
#include "efl_access_value.eo.legacy.h"
+#include "efl_ui_legacy.eo.legacy.h"
#endif
#endif
diff --git a/src/lib/elementary/elm_inwin.c b/src/lib/elementary/elm_inwin.c
index 30647e7197..110a614575 100644
--- a/src/lib/elementary/elm_inwin.c
+++ b/src/lib/elementary/elm_inwin.c
@@ -3,8 +3,9 @@
#endif
#define ELM_WIDGET_PROTECTED
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define ELM_LAYOUT_PROTECTED
+#define EFL_PART_PROTECTED
#include <Elementary.h>
@@ -20,12 +21,6 @@
#define MY_CLASS_NAME "Elm_Inwin"
#define MY_CLASS_NAME_LEGACY "elm_inwin"
-static const Elm_Layout_Part_Alias_Description _content_aliases[] =
-{
- {"default", "elm.swallow.content"},
- {NULL, NULL}
-};
-
typedef struct {
} Elm_Inwin_Data;
@@ -63,7 +58,7 @@ _elm_inwin_efl_canvas_group_group_add(Eo *obj, Elm_Inwin_Data *pd EINA_UNUSED)
}
EOLIAN static void
-_elm_inwin_elm_widget_widget_parent_set(Eo *obj, Elm_Inwin_Data *pd EINA_UNUSED, Evas_Object *parent)
+_elm_inwin_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Inwin_Data *pd EINA_UNUSED, Evas_Object *parent)
{
elm_win_resize_object_add(parent, obj);
@@ -92,7 +87,7 @@ _elm_inwin_efl_object_constructor(Eo *obj, Elm_Inwin_Data *pd EINA_UNUSED)
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_GLASS_PANE);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_GLASS_PANE);
return obj;
}
@@ -111,24 +106,6 @@ _elm_inwin_activate(Eo *obj, Elm_Inwin_Data *pd EINA_UNUSED)
elm_object_focus_set(obj, EINA_TRUE);
}
-EOLIAN static Eina_Bool
-_elm_inwin_efl_content_content_set(Eo *obj, Elm_Inwin_Data *pd EINA_UNUSED, Efl_Gfx *content)
-{
- return efl_content_set(efl_part(obj, _content_aliases[0].real_part), content);
-}
-
-EOLIAN static Efl_Gfx *
-_elm_inwin_efl_content_content_get(Eo *obj, Elm_Inwin_Data *pd EINA_UNUSED)
-{
- return efl_content_get(efl_part(obj, _content_aliases[0].real_part));
-}
-
-EOLIAN static Efl_Gfx *
-_elm_inwin_efl_content_content_unset(Eo *obj, Elm_Inwin_Data *pd EINA_UNUSED)
-{
- return efl_content_unset(efl_part(obj, _content_aliases[0].real_part));
-}
-
EAPI void
elm_win_inwin_content_set(Evas_Object *obj, Evas_Object *content)
{
@@ -158,13 +135,10 @@ _elm_inwin_class_constructor(Efl_Class *klass)
/* Internal EO APIs and hidden overrides */
-ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(elm_inwin)
-ELM_PART_CONTENT_DEFAULT_GET(elm_inwin, _content_aliases[0].real_part)
+ELM_PART_CONTENT_DEFAULT_IMPLEMENT(elm_inwin, Elm_Inwin_Data)
#define ELM_INWIN_EXTRA_OPS \
EFL_CANVAS_GROUP_ADD_OPS(elm_inwin), \
- ELM_LAYOUT_SIZING_EVAL_OPS(elm_inwin), \
- ELM_LAYOUT_CONTENT_ALIASES_OPS(elm_inwin), \
- ELM_PART_CONTENT_DEFAULT_OPS(elm_inwin)
+ ELM_LAYOUT_SIZING_EVAL_OPS(elm_inwin)
#include "elm_inwin.eo.c"
diff --git a/src/lib/elementary/elm_inwin.eo b/src/lib/elementary/elm_inwin.eo
index 6e867cf7c4..82d7530cfa 100644
--- a/src/lib/elementary/elm_inwin.eo
+++ b/src/lib/elementary/elm_inwin.eo
@@ -1,4 +1,4 @@
-class Elm.Inwin (Efl.Ui.Layout, Efl.Ui.Focus.Layer, Efl.Content)
+class Elm.Inwin (Efl.Ui.Layout.Object, Efl.Ui.Focus.Layer, Efl.Content, Efl.Ui.Legacy)
{
[[Elementary inwin class]]
legacy_prefix: elm_inwin;
@@ -21,7 +21,7 @@ class Elm.Inwin (Efl.Ui.Layout, Efl.Ui.Focus.Layer, Efl.Content)
implements {
class.constructor;
Efl.Object.constructor;
- Elm.Widget.widget_parent { set; }
+ Efl.Ui.Widget.widget_parent { set; }
Efl.Content.content { get; set; }
Efl.Content.content_unset;
}
diff --git a/src/lib/elementary/elm_label.c b/src/lib/elementary/elm_label.c
index 8d493348ce..2a7734b43d 100644
--- a/src/lib/elementary/elm_label.c
+++ b/src/lib/elementary/elm_label.c
@@ -2,8 +2,9 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define ELM_LAYOUT_PROTECTED
+#define EFL_PART_PROTECTED
#include <Elementary.h>
@@ -182,7 +183,7 @@ _elm_label_horizontal_size_policy_update(Eo *obj, Elm_Label_Data *sd)
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_label_elm_widget_theme_apply(Eo *obj, Elm_Label_Data *sd)
+_elm_label_efl_ui_widget_theme_apply(Eo *obj, Elm_Label_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
@@ -337,20 +338,17 @@ static Eina_Bool
_elm_label_text_set(Eo *obj, Elm_Label_Data *sd, const char *part, const char *label)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
- Eina_Bool int_ret = EINA_TRUE;
if (!label) label = "";
_label_format_set(wd->resize_obj, sd->format);
efl_text_markup_set(efl_part(efl_super(obj, MY_CLASS), part), label);
- if (int_ret)
- {
- sd->lastw = -1;
- elm_layout_sizing_eval(obj);
- _label_slide_change(obj);
- }
- return int_ret;
+ sd->lastw = -1;
+ elm_layout_sizing_eval(obj);
+ _label_slide_change(obj);
+
+ return EINA_TRUE;
}
static char *
@@ -426,7 +424,7 @@ _elm_label_efl_object_constructor(Eo *obj, Elm_Label_Data *_pd EINA_UNUSED)
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_LABEL);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_LABEL);
return obj;
}
@@ -480,7 +478,7 @@ _elm_label_line_wrap_set(Eo *obj, Elm_Label_Data *sd, Elm_Wrap_Type wrap)
}
EOLIAN static Elm_Wrap_Type
-_elm_label_line_wrap_get(Eo *obj EINA_UNUSED, Elm_Label_Data *sd)
+_elm_label_line_wrap_get(const Eo *obj EINA_UNUSED, Elm_Label_Data *sd)
{
return sd->linewrap;
}
@@ -503,7 +501,7 @@ _elm_label_wrap_width_set(Eo *obj, Elm_Label_Data *sd, Evas_Coord w)
}
EOLIAN static Evas_Coord
-_elm_label_wrap_width_get(Eo *obj EINA_UNUSED, Elm_Label_Data *sd)
+_elm_label_wrap_width_get(const Eo *obj EINA_UNUSED, Elm_Label_Data *sd)
{
return sd->wrap_w;
}
@@ -545,7 +543,7 @@ _elm_label_ellipsis_set(Eo *obj, Elm_Label_Data *sd, Eina_Bool ellipsis)
}
EOLIAN static Eina_Bool
-_elm_label_ellipsis_get(Eo *obj EINA_UNUSED, Elm_Label_Data *sd)
+_elm_label_ellipsis_get(const Eo *obj EINA_UNUSED, Elm_Label_Data *sd)
{
return sd->ellipsis;
}
@@ -557,7 +555,7 @@ _elm_label_slide_mode_set(Eo *obj EINA_UNUSED, Elm_Label_Data *sd, Elm_Label_Sli
}
EOLIAN static Elm_Label_Slide_Mode
-_elm_label_slide_mode_get(Eo *obj EINA_UNUSED, Elm_Label_Data *sd)
+_elm_label_slide_mode_get(const Eo *obj EINA_UNUSED, Elm_Label_Data *sd)
{
return sd->slide_mode;
}
@@ -595,7 +593,7 @@ _elm_label_slide_speed_set(Eo *obj EINA_UNUSED, Elm_Label_Data *sd, double speed
}
EOLIAN static double
-_elm_label_slide_speed_get(Eo *obj EINA_UNUSED, Elm_Label_Data *sd)
+_elm_label_slide_speed_get(const Eo *obj EINA_UNUSED, Elm_Label_Data *sd)
{
return sd->slide_speed;
}
@@ -610,7 +608,7 @@ _elm_label_slide_go(Eo *obj, Elm_Label_Data *sd)
}
EOLIAN static double
-_elm_label_slide_duration_get(Eo *obj EINA_UNUSED, Elm_Label_Data *sd)
+_elm_label_slide_duration_get(const Eo *obj EINA_UNUSED, Elm_Label_Data *sd)
{
return sd->slide_duration;
}
diff --git a/src/lib/elementary/elm_label.eo b/src/lib/elementary/elm_label.eo
index d273399847..6e5e9dc0c9 100644
--- a/src/lib/elementary/elm_label.eo
+++ b/src/lib/elementary/elm_label.eo
@@ -8,7 +8,7 @@ enum Elm.Label.Slide_Mode
always [[Slide always.]]
}
-class Elm.Label (Efl.Ui.Layout)
+class Elm.Label (Efl.Ui.Layout.Object, Efl.Ui.Legacy)
{
[[Elementary label class]]
legacy_prefix: elm_label;
@@ -124,10 +124,10 @@ class Elm.Label (Efl.Ui.Layout)
implements {
class.constructor;
Efl.Object.constructor;
- Elm.Widget.theme_apply;
- Efl.Part.part;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Part.part_get;
}
events {
- slide,end; [[Called when slide stopped]]
+ slide,end: void; [[Called when slide stopped]]
}
}
diff --git a/src/lib/elementary/elm_layout.h b/src/lib/elementary/elm_layout.h
index a59fd7c650..d3205bc39b 100644
--- a/src/lib/elementary/elm_layout.h
+++ b/src/lib/elementary/elm_layout.h
@@ -168,7 +168,7 @@
#include <elm_layout_common.h>
#ifdef EFL_EO_API_SUPPORT
-#include <efl_ui_layout.eo.h>
+#include <efl_ui_layout_object.eo.h>
#endif
#ifndef EFL_NOLEGACY_API_SUPPORT
#include <elm_layout_legacy.h>
diff --git a/src/lib/elementary/elm_layout_legacy.h b/src/lib/elementary/elm_layout_legacy.h
index a9fb13d2e6..a22f16e824 100644
--- a/src/lib/elementary/elm_layout_legacy.h
+++ b/src/lib/elementary/elm_layout_legacy.h
@@ -25,6 +25,8 @@ struct _Elm_Layout_Part_Alias_Description
* with "elm.content.swallow" on this one */
};
+typedef Eo Elm_Layout;
+
typedef struct _Elm_Layout_Part_Alias_Description Elm_Layout_Part_Alias_Description;
/**
@@ -710,4 +712,4 @@ EAPI const char *elm_layout_part_cursor_style_get(const Evas_Object *obj, const
*/
EAPI Eina_Bool elm_layout_part_cursor_unset(Evas_Object *obj, const char *part_name);
-#include "efl_ui_layout.eo.legacy.h"
+#include "efl_ui_layout_object.eo.legacy.h"
diff --git a/src/lib/elementary/elm_list.c b/src/lib/elementary/elm_list.c
index 9a5631c76e..269adb5cdb 100644
--- a/src/lib/elementary/elm_list.c
+++ b/src/lib/elementary/elm_list.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define EFL_ACCESS_SELECTION_PROTECTED
#define ELM_WIDGET_ITEM_PROTECTED
@@ -70,7 +70,7 @@ static Eina_Bool _key_action_move(Evas_Object *obj, const char *params);
static Eina_Bool _key_action_select(Evas_Object *obj, const char *params);
static Eina_Bool _key_action_escape(Evas_Object *obj, const char *params);
-
+EOLIAN static void _elm_list_item_elm_widget_item_del_pre(Eo *eo_item EINA_UNUSED, Elm_List_Item_Data *item);
static const Elm_Action key_actions[] = {
{"move", _key_action_move},
{"select", _key_action_select},
@@ -78,6 +78,33 @@ static const Elm_Action key_actions[] = {
{NULL, NULL}
};
+
+static void
+_items_safe_process(Eina_List *items, void (*process)(void* data, Elm_Object_Item *sel, Elm_List_Item_Data *it), void *data)
+{
+ Elm_Object_Item *sel;
+ Eina_List *l;
+ Eina_Array walk;
+
+ eina_array_step_set(&walk, sizeof (walk), 4);
+
+ EINA_LIST_FOREACH(items, l, sel)
+ eina_array_push(&walk, efl_ref(sel));
+
+ while ((sel = eina_array_pop(&walk)))
+ {
+ if (efl_invalidated_get(sel)) goto noneed;
+
+ ELM_LIST_ITEM_DATA_GET(sel, it);
+ process(data, sel, it);
+
+ noneed:
+ efl_unref(sel);
+ }
+
+ eina_array_flush(&walk);
+}
+
static Eina_Bool
_is_no_select(Elm_List_Item_Data *it)
{
@@ -89,15 +116,10 @@ _is_no_select(Elm_List_Item_Data *it)
return EINA_FALSE;
}
-static inline void
-_elm_list_item_free(Elm_List_Item_Data *it)
+static void
+_elm_list_item_efl_object_invalidate(Elm_Object_Item *eo_it, Elm_List_Item_Data *it)
{
- Elm_Object_Item *eo_it;
-
- if (!it) return;
-
ELM_LIST_DATA_GET_FROM_ITEM(it, sd);
- eo_it = EO_OBJ(it);
if (sd->focused_item == eo_it)
sd->focused_item = NULL;
@@ -106,7 +128,6 @@ _elm_list_item_free(Elm_List_Item_Data *it)
if (sd->last_selected_item == eo_it)
sd->last_selected_item = NULL;
-
evas_object_event_callback_del_full
(VIEW(it), EVAS_CALLBACK_MOUSE_DOWN, _mouse_down_cb, it);
evas_object_event_callback_del_full
@@ -126,11 +147,19 @@ _elm_list_item_free(Elm_List_Item_Data *it)
(it->end, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_size_hints_changed_cb, WIDGET(it));
+ efl_invalidate(efl_super(eo_it, ELM_LIST_ITEM_CLASS));
+}
+
+static void
+_elm_list_item_efl_object_destructor(Elm_Object_Item *eo_it, Elm_List_Item_Data *it)
+{
ELM_SAFE_FREE(it->label, eina_stringshare_del);
ELM_SAFE_FREE(it->swipe_timer, ecore_timer_del);
ELM_SAFE_FREE(it->long_timer, ecore_timer_del);
ELM_SAFE_FREE(it->icon, evas_object_del);
ELM_SAFE_FREE(it->end, evas_object_del);
+
+ efl_destructor(efl_super(eo_it, ELM_LIST_ITEM_CLASS));
}
static Eina_Bool
@@ -358,7 +387,7 @@ _item_focused_next(Evas_Object *obj, Elm_Focus_Direction dir)
}
static Eina_Bool
-_elm_list_elm_widget_event_direction(Evas_Object *obj, Elm_Focus_Direction dir, Eina_Bool multi)
+_elm_list_efl_ui_widget_event_direction(Evas_Object *obj, Elm_Focus_Direction dir, Eina_Bool multi)
{
Elm_Object_Item *eo_it = NULL;
ELM_LIST_DATA_GET(obj, sd);
@@ -376,6 +405,22 @@ _elm_list_elm_widget_event_direction(Evas_Object *obj, Elm_Focus_Direction dir,
(!sd->h_mode && (dir != ELM_FOCUS_UP) && (dir != ELM_FOCUS_DOWN)))
return EINA_FALSE;
+ // check if list get focus at first
+ focus_only = _elm_config->item_select_on_focus_disable;
+ if (!sd->focused_item)
+ {
+ if ((dir == ELM_FOCUS_LEFT) || (dir == ELM_FOCUS_UP))
+ eo_it = elm_list_last_item_get(obj);
+ else
+ eo_it = elm_list_first_item_get(obj);
+
+ if (focus_only)
+ elm_object_item_focus_set(eo_it, EINA_TRUE);
+ else
+ elm_list_item_selected_set(eo_it, EINA_TRUE);
+ return EINA_TRUE;
+ }
+
// get content size and viewport size
if ((dir == ELM_FOCUS_LEFT) || (dir == ELM_FOCUS_RIGHT))
{
@@ -391,7 +436,6 @@ _elm_list_elm_widget_event_direction(Evas_Object *obj, Elm_Focus_Direction dir,
}
// move focus or selection according to the configuration
- focus_only = _elm_config->item_select_on_focus_disable;
if (focus_only)
ret = _item_focused_next(obj, dir);
else
@@ -486,56 +530,56 @@ static Eina_Bool _key_action_move(Evas_Object *obj, const char *params)
/* TODO: fix logic for horizontal mode */
if (!strcmp(dir, "left"))
{
- if (_elm_list_elm_widget_event_direction(obj, ELM_FOCUS_LEFT, EINA_FALSE))
+ if (_elm_list_efl_ui_widget_event_direction(obj, ELM_FOCUS_LEFT, EINA_FALSE))
return EINA_TRUE;
else
return EINA_FALSE;
}
else if (!strcmp(dir, "left_multi"))
{
- if (_elm_list_elm_widget_event_direction(obj, ELM_FOCUS_LEFT, EINA_TRUE))
+ if (_elm_list_efl_ui_widget_event_direction(obj, ELM_FOCUS_LEFT, EINA_TRUE))
return EINA_TRUE;
else
return EINA_FALSE;
}
else if (!strcmp(dir, "right"))
{
- if (_elm_list_elm_widget_event_direction(obj, ELM_FOCUS_RIGHT, EINA_FALSE))
+ if (_elm_list_efl_ui_widget_event_direction(obj, ELM_FOCUS_RIGHT, EINA_FALSE))
return EINA_TRUE;
else
return EINA_FALSE;
}
else if (!strcmp(dir, "right_multi"))
{
- if (_elm_list_elm_widget_event_direction(obj, ELM_FOCUS_RIGHT, EINA_TRUE))
+ if (_elm_list_efl_ui_widget_event_direction(obj, ELM_FOCUS_RIGHT, EINA_TRUE))
return EINA_TRUE;
else
return EINA_FALSE;
}
else if (!strcmp(dir, "up"))
{
- if (_elm_list_elm_widget_event_direction(obj, ELM_FOCUS_UP, EINA_FALSE))
+ if (_elm_list_efl_ui_widget_event_direction(obj, ELM_FOCUS_UP, EINA_FALSE))
return EINA_TRUE;
else
return EINA_FALSE;
}
else if (!strcmp(dir, "up_multi"))
{
- if (_elm_list_elm_widget_event_direction(obj, ELM_FOCUS_UP, EINA_TRUE))
+ if (_elm_list_efl_ui_widget_event_direction(obj, ELM_FOCUS_UP, EINA_TRUE))
return EINA_TRUE;
else
return EINA_FALSE;
}
else if (!strcmp(dir, "down"))
{
- if (_elm_list_elm_widget_event_direction(obj, ELM_FOCUS_DOWN, EINA_FALSE))
+ if (_elm_list_efl_ui_widget_event_direction(obj, ELM_FOCUS_DOWN, EINA_FALSE))
return EINA_TRUE;
else
return EINA_FALSE;
}
else if (!strcmp(dir, "down_multi"))
{
- if (_elm_list_elm_widget_event_direction(obj, ELM_FOCUS_DOWN, EINA_TRUE))
+ if (_elm_list_efl_ui_widget_event_direction(obj, ELM_FOCUS_DOWN, EINA_TRUE))
return EINA_TRUE;
else
return EINA_FALSE;
@@ -645,25 +689,6 @@ _elm_list_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_List_D
efl_ui_translatable_translation_update(efl_super(obj, MY_CLASS));
}
-static void
-_elm_list_deletions_process(Elm_List_Data *sd)
-{
- Elm_List_Item_Data *it;
-
- sd->walking++; // avoid nested deletion and also _sub_del() items_fix
-
- EINA_LIST_FREE(sd->to_delete, it)
- {
- sd->items = eina_list_remove_list(sd->items, it->node);
-
- /* issuing free because of "locking" item del pre hook */
- _elm_list_item_free(it);
- efl_del(EO_OBJ(it));
- }
-
- sd->walking--;
-}
-
EOLIAN static void
_elm_list_elm_layout_sizing_eval(Eo *obj, Elm_List_Data *sd)
{
@@ -672,6 +697,7 @@ _elm_list_elm_layout_sizing_eval(Eo *obj, Elm_List_Data *sd)
double xw = 0.0, yw = 0.0;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+ if (!efl_finalized_get(obj)) return; //not constructed yet
evas_object_size_hint_combined_min_get(sd->box, &minw, &minh);
evas_object_size_hint_max_get(sd->box, &maxw, &maxh);
@@ -757,7 +783,7 @@ _elm_list_mode_set_internal(Evas_Object *obj)
}
static inline void
-_elm_list_walk(Elm_List_Data *sd)
+_elm_list_walk(Evas_Object *obj, Elm_List_Data *sd)
{
if (sd->walking < 0)
{
@@ -765,6 +791,8 @@ _elm_list_walk(Elm_List_Data *sd)
sd->walking = 0;
}
sd->walking++;
+ efl_ref(obj);
+ evas_object_ref(obj);
}
static inline void
@@ -778,10 +806,7 @@ _elm_list_unwalk(Evas_Object *obj, Elm_List_Data *sd)
}
if (sd->walking)
- return;
-
- if (sd->to_delete)
- _elm_list_deletions_process(sd);
+ goto cleanup;
if (sd->fix_pending)
{
@@ -789,6 +814,10 @@ _elm_list_unwalk(Evas_Object *obj, Elm_List_Data *sd)
_items_fix(obj);
elm_layout_sizing_eval(obj);
}
+
+ cleanup:
+ evas_object_unref(obj);
+ efl_unref(obj);
}
static void
@@ -799,6 +828,7 @@ _items_fix(Evas_Object *obj)
Elm_Object_Item *eo_it;
Evas_Coord mw, mh;
int i, redo = 0;
+ Eina_Array walk;
const char *style;
const char *it_odd;
@@ -820,8 +850,10 @@ _items_fix(Evas_Object *obj)
return;
}
- evas_object_ref(obj);
- _elm_list_walk(sd); // watch out "return" before unwalk!
+ _elm_list_walk(obj, sd); // watch out "return" before unwalk!
+ sd->fixing_now = EINA_TRUE;
+
+ eina_array_step_set(&walk, sizeof (walk), 8);
EINA_LIST_FOREACH(sd->items, l, eo_it)
{
@@ -840,6 +872,8 @@ _items_fix(Evas_Object *obj)
if (mw > minw[1]) minw[1] = mw;
if (mh > minh[1]) minh[1] = mh;
}
+
+ eina_array_push(&walk, efl_ref(eo_it));
}
if ((minw[0] != sd->minw[0]) || (minw[1] != sd->minw[1]) ||
@@ -853,12 +887,12 @@ _items_fix(Evas_Object *obj)
}
i = 0;
- EINA_LIST_FOREACH(sd->items, l, eo_it)
+ while ((eo_it = eina_array_pop(&walk)))
{
+ if (efl_invalidated_get(eo_it)) goto noneed;
ELM_LIST_ITEM_DATA_GET(eo_it, it);
- if (!it) continue;
- if (it->deleted)
- continue;
+ if (!it) goto noneed;
+ if (it->deleted) goto noneed;
it->even = i & 0x1;
if ((it->even != it->is_even) || (!it->fixed) || (redo))
@@ -943,8 +977,7 @@ _items_fix(Evas_Object *obj)
// but we're safe as we're flagged as walking.
// just don't process further
edje_object_message_signal_process(VIEW(it));
- if (it->deleted)
- continue;
+ if (it->deleted) goto noneed;
mw = mh = -1;
if (!it->is_separator)
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
@@ -971,8 +1004,7 @@ _items_fix(Evas_Object *obj)
// just don't process further
edje_object_signal_emit
(VIEW(it), "elm,state,selected", "elm");
- if (it->deleted)
- continue;
+ if (it->deleted) goto noneed;
select_raise = edje_object_data_get(VIEW(it), "selectraise");
if ((select_raise) && (!strcmp(select_raise, "on")))
@@ -1000,26 +1032,36 @@ _items_fix(Evas_Object *obj)
}
if (!it->is_separator)
i++;
+
+ noneed:
+ efl_unref(eo_it);
}
+ sd->fixing_now = EINA_FALSE;
_elm_list_unwalk(obj, sd);
//focus highlight in_theme is set by list item theme.
_elm_widget_item_highlight_in_theme(
obj, elm_list_first_item_get(obj));
-
- evas_object_unref(obj);
}
static void
_size_hints_changed_cb(void *data,
Evas *e EINA_UNUSED,
- Evas_Object *obj EINA_UNUSED,
+ Evas_Object *obj,
void *event_info EINA_UNUSED)
{
ELM_LIST_DATA_GET(data, sd);
+ ELM_WIDGET_DATA_GET_OR_RETURN(data, wd);
if (sd->delete_me) return;
+ /* FIXME: Looks it updates items_fix() unnecessarily.
+ when resize_obj, box finished sizing, then
+ it can call _items_fix() one time at the end. */
+ if (sd->fixing_now)
+ {
+ if ((obj != wd->resize_obj) && (obj != sd->box)) return;
+ }
_items_fix(data);
elm_layout_sizing_eval(data);
}
@@ -1033,7 +1075,7 @@ _show_region_hook(void *data EINA_UNUSED, Evas_Object *obj, Eina_Rect r)
}
EOLIAN static Eina_Bool
-_elm_list_elm_widget_on_disabled_update(Eo *obj, Elm_List_Data *sd, Eina_Bool disabled)
+_elm_list_efl_ui_widget_on_disabled_update(Eo *obj, Elm_List_Data *sd, Eina_Bool disabled)
{
if (!efl_ui_widget_on_disabled_update(efl_super(obj, MY_CLASS), disabled))
return EINA_FALSE;
@@ -1064,7 +1106,7 @@ _mirrored_set(Evas_Object *obj,
ELM_LIST_DATA_GET(obj, sd);
- elm_interface_scrollable_mirrored_set(obj, rtl);
+ efl_ui_mirrored_set(obj, rtl);
EINA_LIST_FOREACH(sd->items, n, eo_it)
{
@@ -1074,7 +1116,7 @@ _mirrored_set(Evas_Object *obj,
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_list_elm_widget_theme_apply(Eo *obj, Elm_List_Data *sd)
+_elm_list_efl_ui_widget_theme_apply(Eo *obj, Elm_List_Data *sd)
{
Elm_Object_Item *eo_it;
Eina_List *n;
@@ -1089,7 +1131,7 @@ _elm_list_elm_widget_theme_apply(Eo *obj, Elm_List_Data *sd)
{
ELM_LIST_ITEM_DATA_GET(eo_it, it);
edje_object_scale_set
- (VIEW(it), efl_gfx_scale_get(obj) * elm_config_scale_get());
+ (VIEW(it), efl_gfx_entity_scale_get(obj) * elm_config_scale_get());
it->fixed = EINA_FALSE;
}
@@ -1236,13 +1278,13 @@ _elm_list_nearest_visible_item_get(Evas_Object *obj, Elm_List_Item_Data *it)
}
EOLIAN static Eina_Bool
-_elm_list_elm_widget_on_focus_update(Eo *obj, Elm_List_Data *sd, Elm_Object_Item *item EINA_UNUSED)
+_elm_list_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_List_Data *sd)
{
Eina_Bool int_ret = EINA_FALSE;
Elm_Object_Item *eo_it = NULL;
Eina_Bool is_sel = EINA_FALSE;
- int_ret = efl_ui_widget_on_focus_update(efl_super(obj, MY_CLASS), NULL);
+ int_ret = efl_ui_focus_object_on_focus_update(efl_super(obj, MY_CLASS));
if (!int_ret) return EINA_FALSE;
if (elm_object_focus_get(obj) && sd->selected && !sd->last_selected_item)
@@ -1288,7 +1330,7 @@ _elm_list_elm_widget_on_focus_update(Eo *obj, Elm_List_Data *sd, Elm_Object_Item
}
EOLIAN static Eina_Bool
-_elm_list_elm_widget_widget_sub_object_del(Eo *obj, Elm_List_Data *sd, Evas_Object *sobj)
+_elm_list_efl_ui_widget_widget_sub_object_del(Eo *obj, Elm_List_Data *sd, Evas_Object *sobj)
{
const Eina_List *l;
Elm_Object_Item *eo_it;
@@ -1309,7 +1351,8 @@ _elm_list_elm_widget_widget_sub_object_del(Eo *obj, Elm_List_Data *sd, Evas_Obje
evas_object_event_callback_del_full
(sobj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _size_hints_changed_cb,
obj);
- if (!sd->walking)
+ efl_del(eo_it);
+ if (!sd->walking && efl_parent_get(obj))
{
_items_fix(obj);
elm_layout_sizing_eval(obj);
@@ -1327,9 +1370,12 @@ end:
static void
_item_highlight(Elm_List_Item_Data *it)
{
+ Elm_Object_Item *eo = EO_OBJ(it);
Evas_Object *obj;
const char *select_raise;
+ if (efl_invalidated_get(eo)) return ;
+
ELM_LIST_ITEM_CHECK_OR_RETURN(it);
obj = WIDGET(it);
ELM_LIST_DATA_GET(obj, sd);
@@ -1338,8 +1384,9 @@ _item_highlight(Elm_List_Item_Data *it)
(it->highlighted) || (it->base->disabled))
return;
- evas_object_ref(obj);
- _elm_list_walk(sd);
+ efl_ref(EO_OBJ(it));
+ // This is done to delay the update of a theme change if items_fix get called
+ _elm_list_walk(obj, sd);
edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm");
efl_event_callback_legacy_call(obj, ELM_LIST_EVENT_HIGHLIGHTED, EO_OBJ(it));
@@ -1347,15 +1394,19 @@ _item_highlight(Elm_List_Item_Data *it)
if ((select_raise) && (!strcmp(select_raise, "on")))
evas_object_raise(VIEW(it));
it->highlighted = EINA_TRUE;
+
_elm_list_unwalk(obj, sd);
- evas_object_unref(obj);
+ efl_unref(EO_OBJ(it));
}
static void
_item_select(Elm_List_Item_Data *it)
{
+ Elm_Object_Item *eo = EO_OBJ(it);
Evas_Object *obj;
+ if (efl_invalidated_get(eo)) return ;
+
ELM_LIST_ITEM_CHECK_OR_RETURN(it);
obj = WIDGET(it);
ELM_LIST_DATA_GET(obj, sd);
@@ -1390,25 +1441,28 @@ _item_select(Elm_List_Item_Data *it)
sd->selected = eina_list_append(sd->selected, eo_it);
call:
- evas_object_ref(obj);
- _elm_list_walk(sd);
+ efl_ref(EO_OBJ(it));
+ _elm_list_walk(obj, sd);
if (it->func) it->func((void *)WIDGET_ITEM_DATA_GET(eo_it), WIDGET(it), eo_it);
efl_event_callback_legacy_call(obj, EFL_UI_EVENT_SELECTED, eo_it);
- if (_elm_config->atspi_mode)
- efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_SELECTED, EINA_TRUE);
+ if (_elm_config->atspi_mode)
+ efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_SELECTED, EINA_TRUE);
sd->last_selected_item = eo_it;
_elm_list_unwalk(obj, sd);
- evas_object_unref(obj);
+ efl_unref(EO_OBJ(it));
}
static void
_item_unhighlight(Elm_List_Item_Data *it)
{
+ Elm_Object_Item *eo = EO_OBJ(it);
Evas_Object *obj;
const char *stacking, *select_raise;
+ if (efl_invalidated_get(eo)) return ;
+
ELM_LIST_ITEM_CHECK_OR_RETURN(it);
obj = WIDGET(it);
ELM_LIST_DATA_GET(obj, sd);
@@ -1417,8 +1471,8 @@ _item_unhighlight(Elm_List_Item_Data *it)
// (sd->select_mode == ELM_OBJECT_SELECT_MODE_NONE)) return;
if (!it->highlighted) return;
- evas_object_ref(obj);
- _elm_list_walk(sd);
+ efl_ref(EO_OBJ(it));
+ _elm_list_walk(obj, sd);
edje_object_signal_emit(VIEW(it), "elm,state,unselected", "elm");
efl_event_callback_legacy_call
@@ -1433,14 +1487,17 @@ _item_unhighlight(Elm_List_Item_Data *it)
it->highlighted = EINA_FALSE;
_elm_list_unwalk(obj, sd);
- evas_object_unref(obj);
+ efl_unref(EO_OBJ(it));
}
static void
_item_unselect(Elm_List_Item_Data *it)
{
+ Elm_Object_Item *eo = EO_OBJ(it);
Evas_Object *obj;
+ if (efl_invalidated_get(eo)) return ;
+
ELM_LIST_ITEM_CHECK_OR_RETURN(it);
obj = WIDGET(it);
ELM_LIST_DATA_GET(obj, sd);
@@ -1448,8 +1505,8 @@ _item_unselect(Elm_List_Item_Data *it)
// if (it->base->disabled || (sd->select_mode == ELM_OBJECT_SELECT_MODE_NONE))
// return;
- evas_object_ref(obj);
- _elm_list_walk(sd);
+ efl_ref(eo);
+ _elm_list_walk(obj, sd);
if (sd->focus_on_selection_enabled)
{
@@ -1470,7 +1527,15 @@ _item_unselect(Elm_List_Item_Data *it)
}
_elm_list_unwalk(obj, sd);
- evas_object_unref(obj);
+ efl_unref(eo);
+}
+
+static void
+_process_item_unselected_set(void *data, Elm_Object_Item *sel, Elm_List_Item_Data *it)
+{
+ if (sel == data) return ;
+ _item_unhighlight(it);
+ _item_unselect(it);
}
static Eina_Bool
@@ -1585,8 +1650,8 @@ _mouse_move_cb(void *data,
obj = WIDGET(it);
ELM_LIST_DATA_GET(obj, sd);
- evas_object_ref(obj);
- _elm_list_walk(sd);
+ efl_ref(EO_OBJ(it));
+ _elm_list_walk(obj, sd);
evas_object_geometry_get(o, &x, &y, &w, &h);
@@ -1632,7 +1697,7 @@ _mouse_move_cb(void *data,
if (sd->swipe)
ELM_SAFE_FREE(it->long_timer, ecore_timer_del);
_elm_list_unwalk(obj, sd);
- evas_object_unref(obj);
+ efl_unref(EO_OBJ(it));
}
static void
@@ -1666,8 +1731,8 @@ _mouse_down_cb(void *data,
sd->mouse_down = EINA_TRUE;
sd->was_selected = it->selected;
- evas_object_ref(obj);
- _elm_list_walk(sd);
+ efl_ref(EO_OBJ(it));
+ _elm_list_walk(obj, sd);
_item_highlight(it);
sd->longpressed = EINA_FALSE;
@@ -1690,7 +1755,7 @@ _mouse_down_cb(void *data,
it->base->still_in = EINA_TRUE;
_elm_list_unwalk(obj, sd);
- evas_object_unref(obj);
+ efl_unref(EO_OBJ(it));
}
static void
@@ -1757,8 +1822,8 @@ _mouse_up_cb(void *data,
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD || !it->base->still_in)
return;
- evas_object_ref(obj);
- _elm_list_walk(sd);
+ efl_ref(EO_OBJ(it));
+ _elm_list_walk(obj, sd);
if (sd->focused_item != EO_OBJ(it))
elm_object_item_focus_set(EO_OBJ(it), EINA_TRUE);
@@ -1780,39 +1845,14 @@ _mouse_up_cb(void *data,
}
else
{
- if (!it->selected)
- {
- while (sd->selected)
- {
- Elm_Object_Item *eo_it2 = sd->selected->data;
- ELM_LIST_ITEM_DATA_GET(eo_it2, it2);
- sd->selected = eina_list_remove_list
- (sd->selected, sd->selected);
- _item_unhighlight(it2);
- _item_unselect(it2);
- }
- _item_highlight(it);
- _item_select(it);
- }
- else
- {
- const Eina_List *l, *l_next;
- Elm_Object_Item *eo_it2;
-
- EINA_LIST_FOREACH_SAFE(sd->selected, l, l_next, eo_it2)
- if (eo_it2 != EO_OBJ(it))
- {
- ELM_LIST_ITEM_DATA_GET(eo_it2, it2);
- _item_unhighlight(it2);
- _item_unselect(it2);
- }
- _item_highlight(it);
- _item_select(it);
- }
+ _items_safe_process(sd->selected, _process_item_unselected_set, EO_OBJ(it));
+
+ _item_highlight(it);
+ _item_select(it);
}
_elm_list_unwalk(obj, sd);
- evas_object_unref(obj);
+ efl_unref(EO_OBJ(it));
}
static void
@@ -1949,7 +1989,7 @@ _elm_list_item_elm_widget_item_part_content_set(Eo *eo_item EINA_UNUSED, Elm_Lis
}
EOLIAN static Evas_Object *
-_elm_list_item_elm_widget_item_part_content_get(Eo *eo_item EINA_UNUSED, Elm_List_Item_Data *item,
+_elm_list_item_elm_widget_item_part_content_get(const Eo *eo_item EINA_UNUSED, Elm_List_Item_Data *item,
const char *part)
{
if ((!part) || (!strcmp(part, "start")))
@@ -2003,7 +2043,7 @@ _elm_list_item_elm_widget_item_part_text_set(Eo *eo_list_it, Elm_List_Item_Data
}
EOLIAN static const char *
-_elm_list_item_elm_widget_item_part_text_get(Eo *eo_it, Elm_List_Item_Data *it,
+_elm_list_item_elm_widget_item_part_text_get(const Eo *eo_it, Elm_List_Item_Data *it,
const char *part)
{
if (part && strcmp(part, "default"))
@@ -2011,13 +2051,13 @@ _elm_list_item_elm_widget_item_part_text_get(Eo *eo_it, Elm_List_Item_Data *it,
return it->label;
}
-/* FIXME: this _item_del_pre_hook is never been called at all!
+/* FIXME: this _item_del_pre_hook is called stupidly!
To fix this,
1. it->walking concept should be adopted.
2. elm_widget_item_del() should be called instead of the combination of
_elm_list_item_free() + elm_widget_item_free()
*/
-EOLIAN static Eina_Bool
+EOLIAN static void
_elm_list_item_elm_widget_item_del_pre(Eo *eo_item EINA_UNUSED, Elm_List_Item_Data *item)
{
Evas_Object *obj = WIDGET(item);
@@ -2030,25 +2070,10 @@ _elm_list_item_elm_widget_item_del_pre(Eo *eo_item EINA_UNUSED, Elm_List_Item_Da
_item_unselect(item);
}
- if (sd->walking > 0)
- {
- if (item->deleted) return EINA_FALSE;
- item->deleted = EINA_TRUE;
- sd->to_delete = eina_list_append(sd->to_delete, item);
- return EINA_FALSE;
- }
+ item->deleted = EINA_TRUE;
sd->items = eina_list_remove_list(sd->items, item->node);
-
- evas_object_ref(obj);
- _elm_list_walk(sd);
-
- _elm_list_item_free(item);
-
- _elm_list_unwalk(obj, sd);
- evas_object_unref(obj);
-
- return EINA_TRUE;
+ item->node = NULL;
}
EOLIAN static void _elm_list_item_elm_widget_item_signal_emit(Eo *eo_it EINA_UNUSED, Elm_List_Item_Data *it,
@@ -2059,7 +2084,7 @@ EOLIAN static void _elm_list_item_elm_widget_item_signal_emit(Eo *eo_it EINA_UNU
}
EOLIAN static void
-_elm_list_item_elm_widget_item_focus_set(Eo *eo_it, Elm_List_Item_Data *it, Eina_Bool focused)
+_elm_list_item_elm_widget_item_item_focus_set(Eo *eo_it, Elm_List_Item_Data *it, Eina_Bool focused)
{
Evas_Object *obj = WIDGET(it);
ELM_LIST_DATA_GET(obj, sd);
@@ -2091,7 +2116,7 @@ _elm_list_item_elm_widget_item_focus_set(Eo *eo_it, Elm_List_Item_Data *it, Eina
}
EOLIAN static Eina_Bool
-_elm_list_item_elm_widget_item_focus_get(Eo *eo_it, Elm_List_Item_Data *it)
+_elm_list_item_elm_widget_item_item_focus_get(const Eo *eo_it, Elm_List_Item_Data *it)
{
ELM_LIST_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
Evas_Object *obj = WIDGET(it);
@@ -2104,12 +2129,12 @@ _elm_list_item_elm_widget_item_focus_get(Eo *eo_it, Elm_List_Item_Data *it)
}
EOLIAN static Efl_Access_State_Set
-_elm_list_item_efl_access_state_set_get(Eo *eo_it, Elm_List_Item_Data *data EINA_UNUSED)
+_elm_list_item_efl_access_object_state_set_get(const Eo *eo_it, Elm_List_Item_Data *data EINA_UNUSED)
{
Efl_Access_State_Set ret;
Eina_Bool sel;
- ret = efl_access_state_set_get(efl_super(eo_it, ELM_LIST_ITEM_CLASS));
+ ret = efl_access_object_state_set_get(efl_super(eo_it, ELM_LIST_ITEM_CLASS));
if (elm_object_item_disabled_get(eo_it))
return ret;
@@ -2126,10 +2151,10 @@ _elm_list_item_efl_access_state_set_get(Eo *eo_it, Elm_List_Item_Data *data EINA
}
EOLIAN static const char*
-_elm_list_item_efl_access_name_get(Eo *eo_it, Elm_List_Item_Data *data)
+_elm_list_item_efl_access_object_i18n_name_get(const Eo *eo_it, Elm_List_Item_Data *data)
{
const char *ret;
- ret = efl_access_name_get(efl_super(eo_it, ELM_LIST_ITEM_CLASS));
+ ret = efl_access_object_i18n_name_get(efl_super(eo_it, ELM_LIST_ITEM_CLASS));
if (ret) return ret;
return _elm_widget_item_accessible_plain_name_get(eo_it, data->label);
}
@@ -2181,8 +2206,8 @@ _access_activate_cb(void *data EINA_UNUSED,
obj = WIDGET(it);
ELM_LIST_DATA_GET(obj, sd);
- evas_object_ref(obj);
- _elm_list_walk(sd);
+ efl_ref(eo_it);
+ _elm_list_walk(obj, sd);
if (sd->multi)
{
@@ -2199,37 +2224,14 @@ _access_activate_cb(void *data EINA_UNUSED,
}
else
{
- if (!it->selected)
- {
- while (sd->selected)
- {
- Elm_Object_Item *eo_sel = sd->selected->data;
- ELM_LIST_ITEM_DATA_GET(eo_sel, sel);
- _item_unhighlight(sel);
- _item_unselect(sel);
- }
- _item_highlight(it);
- _item_select(it);
- }
- else
- {
- const Eina_List *l, *l_next;
- Elm_Object_Item *eo_it2;
-
- EINA_LIST_FOREACH_SAFE(sd->selected, l, l_next, eo_it2)
- if (eo_it2 != EO_OBJ(it))
- {
- ELM_LIST_ITEM_DATA_GET(eo_it2, it2);
- _item_unhighlight(it2);
- _item_unselect(it2);
- }
- _item_highlight(it);
- _item_select(it);
- }
+ _items_safe_process(sd->selected, _process_item_unselected_set, eo_it);
+
+ _item_highlight(it);
+ _item_select(it);
}
_elm_list_unwalk(obj, sd);
- evas_object_unref(obj);
+ efl_unref(eo_it);
}
static void
@@ -2256,7 +2258,7 @@ _elm_list_item_efl_object_constructor(Eo *eo_it, Elm_List_Item_Data *it)
{
eo_it = efl_constructor(efl_super(eo_it, ELM_LIST_ITEM_CLASS));
it->base = efl_data_scope_get(eo_it, ELM_WIDGET_ITEM_CLASS);
- efl_access_role_set(eo_it, EFL_ACCESS_ROLE_LIST_ITEM);
+ efl_access_object_role_set(eo_it, EFL_ACCESS_ROLE_LIST_ITEM);
return eo_it;
}
@@ -2279,14 +2281,11 @@ _item_new(Evas_Object *obj,
it->func = func;
WIDGET_ITEM_DATA_SET(EO_OBJ(it), data);
- VIEW(it) = edje_object_add(evas_object_evas_get(obj));
+ VIEW_SET(it, edje_object_add(evas_object_evas_get(obj)));
edje_object_update_hints_set(VIEW(it), 1);
- if (_elm_config->atspi_mode)
- {
- if (it->icon) efl_access_parent_set(it->icon, eo_it);
- if (it->end) efl_access_parent_set(it->end, eo_it);
- }
+ if (it->icon) efl_parent_set(it->icon, eo_it);
+ if (it->end) efl_parent_set(it->end, eo_it);
/* access */
if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
@@ -2312,7 +2311,7 @@ _item_new(Evas_Object *obj,
evas_object_event_callback_add
(it->icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _size_hints_changed_cb,
obj);
- efl_access_type_set(it->icon, EFL_ACCESS_TYPE_DISABLED);
+ efl_access_object_access_type_set(it->icon, EFL_ACCESS_TYPE_DISABLED);
elm_widget_tree_unfocusable_set(it->icon, EINA_TRUE);
}
if (it->end)
@@ -2321,7 +2320,7 @@ _item_new(Evas_Object *obj,
evas_object_event_callback_add
(it->end, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _size_hints_changed_cb,
obj);
- efl_access_type_set(it->end, EFL_ACCESS_TYPE_DISABLED);
+ efl_access_object_access_type_set(it->end, EFL_ACCESS_TYPE_DISABLED);
elm_widget_tree_unfocusable_set(it->end, EINA_TRUE);
}
@@ -2391,7 +2390,7 @@ _elm_list_efl_canvas_group_group_add(Eo *obj, Elm_List_Data *priv)
priv->box = elm_box_add(obj);
evas_object_size_hint_weight_set(priv->box, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(priv->box, EVAS_HINT_FILL, 0.0);
- efl_access_type_set(priv->box, EFL_ACCESS_TYPE_DISABLED);
+ efl_access_object_access_type_set(priv->box, EFL_ACCESS_TYPE_DISABLED);
/* FIXME: change this ugly code path later */
elm_widget_on_show_region_hook_set(priv->box, obj, _show_region_hook, NULL);
@@ -2414,9 +2413,6 @@ _elm_list_efl_canvas_group_group_del(Eo *obj, Elm_List_Data *sd)
const Eina_List *l;
Elm_Object_Item *eo_it;
- if (sd->walking)
- ERR("ERROR: list deleted while walking.\n");
-
sd->delete_me = EINA_TRUE;
EINA_LIST_FOREACH(sd->items, l, eo_it)
{
@@ -2437,21 +2433,8 @@ _elm_list_efl_canvas_group_group_del(Eo *obj, Elm_List_Data *sd)
evas_object_event_callback_del
(sd->box, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _size_hints_changed_cb);
- _elm_list_walk(sd);
-
EINA_LIST_FREE(sd->items, eo_it)
- {
- ELM_LIST_ITEM_DATA_GET(eo_it, it);
- /* issuing free because of "locking" item del pre hook */
- _elm_list_item_free(it);
- WIDGET(it) = NULL;
- efl_del(eo_it);
- }
-
- _elm_list_unwalk(obj, sd);
-
- if (sd->to_delete)
- ERR("ERROR: leaking nodes!\n");
+ efl_del(eo_it);
sd->selected = eina_list_free(sd->selected);
@@ -2459,23 +2442,23 @@ _elm_list_efl_canvas_group_group_del(Eo *obj, Elm_List_Data *sd)
}
EOLIAN static void
-_elm_list_efl_gfx_position_set(Eo *obj, Elm_List_Data *sd, Eina_Position2D pos)
+_elm_list_efl_gfx_entity_position_set(Eo *obj, Elm_List_Data *sd, Eina_Position2D pos)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
- efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
- efl_gfx_position_set(sd->hit_rect, pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
+ efl_gfx_entity_position_set(sd->hit_rect, pos);
}
EOLIAN static void
-_elm_list_efl_gfx_size_set(Eo *obj, Elm_List_Data *sd, Eina_Size2D sz)
+_elm_list_efl_gfx_entity_size_set(Eo *obj, Elm_List_Data *sd, Eina_Size2D sz)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
- efl_gfx_size_set(efl_super(obj, MY_CLASS), sz);
- efl_gfx_size_set(sd->hit_rect, sz);
+ efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
+ efl_gfx_entity_size_set(sd->hit_rect, sz);
}
EOLIAN static void
@@ -2488,7 +2471,7 @@ _elm_list_efl_canvas_group_group_member_add(Eo *obj, Elm_List_Data *sd, Evas_Obj
}
EOLIAN static void
-_elm_list_elm_widget_on_access_update(Eo *obj EINA_UNUSED, Elm_List_Data *sd, Eina_Bool acs)
+_elm_list_efl_ui_widget_on_access_update(Eo *obj EINA_UNUSED, Elm_List_Data *sd, Eina_Bool acs)
{
Eina_List *elist = NULL;
Elm_Object_Item *eo_it;
@@ -2514,7 +2497,7 @@ _elm_list_efl_object_constructor(Eo *obj, Elm_List_Data *sd EINA_UNUSED)
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_LIST);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_LIST);
return obj;
}
@@ -2532,7 +2515,7 @@ _elm_list_multi_select_set(Eo *obj EINA_UNUSED, Elm_List_Data *sd, Eina_Bool mul
}
EOLIAN static Eina_Bool
-_elm_list_multi_select_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd)
+_elm_list_multi_select_get(const Eo *obj EINA_UNUSED, Elm_List_Data *sd)
{
return sd->multi;
}
@@ -2548,7 +2531,7 @@ _elm_list_multi_select_mode_set(Eo *obj EINA_UNUSED, Elm_List_Data *sd, Elm_Obje
}
EOLIAN static Elm_Object_Multi_Select_Mode
-_elm_list_multi_select_mode_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd)
+_elm_list_multi_select_mode_get(const Eo *obj EINA_UNUSED, Elm_List_Data *sd)
{
return sd->multi_select_mode;
}
@@ -2575,7 +2558,7 @@ _elm_list_mode_set(Eo *obj, Elm_List_Data *sd, Elm_List_Mode mode)
}
EOLIAN static Elm_List_Mode
-_elm_list_mode_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd)
+_elm_list_mode_get(const Eo *obj EINA_UNUSED, Elm_List_Data *sd)
{
return sd->mode;
}
@@ -2608,7 +2591,7 @@ _elm_list_horizontal_set(Eo *obj, Elm_List_Data *sd, Eina_Bool horizontal)
}
EOLIAN static Eina_Bool
-_elm_list_horizontal_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd)
+_elm_list_horizontal_get(const Eo *obj EINA_UNUSED, Elm_List_Data *sd)
{
return sd->h_mode;
}
@@ -2624,7 +2607,7 @@ _elm_list_select_mode_set(Eo *obj EINA_UNUSED, Elm_List_Data *sd, Elm_Object_Sel
}
EOLIAN static Elm_Object_Select_Mode
-_elm_list_select_mode_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd)
+_elm_list_select_mode_get(const Eo *obj EINA_UNUSED, Elm_List_Data *sd)
{
return sd->select_mode;
}
@@ -2677,64 +2660,40 @@ elm_list_scroller_policy_get(const Evas_Object *obj,
elm_interface_scrollable_policy_get((Eo *) obj, policy_h, policy_v);
}
+static void
+_item_clear(void *data EINA_UNUSED, Elm_Object_Item *eo, Elm_List_Item_Data *it EINA_UNUSED)
+{
+ efl_del(eo);
+}
+
EOLIAN static void
_elm_list_clear(Eo *obj, Elm_List_Data *sd)
{
- Elm_Object_Item *eo_it;
-
if (!sd->items) return;
sd->selected = eina_list_free(sd->selected);
- if (sd->walking > 0)
- {
- Eina_List *n;
-
- EINA_LIST_FOREACH(sd->items, n, eo_it)
- {
- ELM_LIST_ITEM_DATA_GET(eo_it, it);
- if (it->deleted) continue;
- it->deleted = EINA_TRUE;
- sd->to_delete = eina_list_append(sd->to_delete, it);
- }
- return;
- }
-
- evas_object_ref(obj);
-
- _elm_list_walk(sd);
-
- EINA_LIST_FREE(sd->items, eo_it)
- {
- ELM_LIST_ITEM_DATA_GET(eo_it, it);
- /* issuing free because of "locking" item del pre hook */
- _elm_list_item_free(it);
- efl_del(eo_it);
- }
-
- _elm_list_unwalk(obj, sd);
+ _items_safe_process(sd->items, _item_clear, NULL);
_items_fix(obj);
elm_layout_sizing_eval(obj);
-
- evas_object_unref(obj);
}
EOLIAN static const Eina_List*
-_elm_list_items_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd)
+_elm_list_items_get(const Eo *obj EINA_UNUSED, Elm_List_Data *sd)
{
return sd->items;
}
EOLIAN static Elm_Object_Item*
-_elm_list_selected_item_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd)
+_elm_list_selected_item_get(const Eo *obj EINA_UNUSED, Elm_List_Data *sd)
{
if (sd->selected) return sd->selected->data;
else return NULL;
}
EOLIAN static const Eina_List*
-_elm_list_selected_items_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd)
+_elm_list_selected_items_get(const Eo *obj EINA_UNUSED, Elm_List_Data *sd)
{
return sd->selected;
}
@@ -2856,13 +2815,13 @@ _elm_list_item_separator_set(Eo *eo_item, Elm_List_Item_Data *it, Eina_Bool sett
it->is_separator = !!setting;
if (it->is_separator)
- efl_access_role_set(eo_item, EFL_ACCESS_ROLE_SEPARATOR);
+ efl_access_object_role_set(eo_item, EFL_ACCESS_ROLE_SEPARATOR);
else
- efl_access_role_set(eo_item, EFL_ACCESS_ROLE_LIST_ITEM);
+ efl_access_object_role_set(eo_item, EFL_ACCESS_ROLE_LIST_ITEM);
}
EOLIAN static Eina_Bool
-_elm_list_item_separator_get(Eo *eo_item EINA_UNUSED, Elm_List_Item_Data *it)
+_elm_list_item_separator_get(const Eo *eo_item EINA_UNUSED, Elm_List_Item_Data *it)
{
ELM_LIST_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
@@ -2870,8 +2829,8 @@ _elm_list_item_separator_get(Eo *eo_item EINA_UNUSED, Elm_List_Item_Data *it)
}
EOLIAN static void
-_elm_list_item_selected_set(Eo *eo_item EINA_UNUSED, Elm_List_Item_Data *item,
- Eina_Bool selected)
+_elm_list_item_selected_set(Eo *eo_item, Elm_List_Item_Data *item,
+ Eina_Bool selected)
{
Evas_Object *obj;
@@ -2882,37 +2841,29 @@ _elm_list_item_selected_set(Eo *eo_item EINA_UNUSED, Elm_List_Item_Data *item,
selected = !!selected;
if (item->selected == selected) return;
- evas_object_ref(obj);
- _elm_list_walk(sd);
+ efl_ref(eo_item);
+ _elm_list_walk(obj, sd);
if (selected)
{
if (!sd->multi)
- {
- while (sd->selected)
- {
- Elm_Object_Item *eo_sel = sd->selected->data;
- ELM_LIST_ITEM_DATA_GET(eo_sel, sel);
- _item_unhighlight(sel);
- _item_unselect(sel);
- }
- }
+ _items_safe_process(sd->selected, _process_item_unselected_set, NULL);
+
_item_highlight(item);
elm_object_item_focus_set(EO_OBJ(item), EINA_TRUE);
_item_select(item);
}
else
{
- _item_unhighlight(item);
- _item_unselect(item);
+ _process_item_unselected_set(NULL, eo_item, item);
}
_elm_list_unwalk(obj, sd);
- evas_object_unref(obj);
+ efl_unref(eo_item);
}
EOLIAN static Eina_Bool
-_elm_list_item_selected_get(Eo *eo_item EINA_UNUSED, Elm_List_Item_Data *it)
+_elm_list_item_selected_get(const Eo *eo_item EINA_UNUSED, Elm_List_Item_Data *it)
{
ELM_LIST_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
@@ -2956,7 +2907,7 @@ _elm_list_item_bring_in(Eo *eo_it EINA_UNUSED, Elm_List_Item_Data *it)
}
EOLIAN static Evas_Object *
-_elm_list_item_object_get(Eo *eo_it EINA_UNUSED, Elm_List_Item_Data *it)
+_elm_list_item_object_get(const Eo *eo_it EINA_UNUSED, Elm_List_Item_Data *it)
{
ELM_LIST_ITEM_CHECK_OR_RETURN(it, NULL);
@@ -2964,7 +2915,7 @@ _elm_list_item_object_get(Eo *eo_it EINA_UNUSED, Elm_List_Item_Data *it)
}
EOLIAN static Elm_Object_Item *
-_elm_list_item_prev_get(Eo *eo_item EINA_UNUSED, Elm_List_Item_Data *item)
+_elm_list_item_prev_get(const Eo *eo_item EINA_UNUSED, Elm_List_Item_Data *item)
{
if (item->node->prev)
return item->node->prev->data;
@@ -2972,7 +2923,7 @@ _elm_list_item_prev_get(Eo *eo_item EINA_UNUSED, Elm_List_Item_Data *item)
}
EOLIAN static Elm_Object_Item *
-_elm_list_item_next_get(Eo *eo_item EINA_UNUSED, Elm_List_Item_Data *item)
+_elm_list_item_next_get(const Eo *eo_item EINA_UNUSED, Elm_List_Item_Data *item)
{
if (item->node->next)
return item->node->next->data;
@@ -2980,7 +2931,7 @@ _elm_list_item_next_get(Eo *eo_item EINA_UNUSED, Elm_List_Item_Data *item)
}
EOLIAN static Elm_Object_Item*
-_elm_list_first_item_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd)
+_elm_list_first_item_get(const Eo *obj EINA_UNUSED, Elm_List_Data *sd)
{
if (!sd->items) return NULL;
else
@@ -2989,7 +2940,7 @@ _elm_list_first_item_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd)
}
EOLIAN static Elm_Object_Item*
-_elm_list_last_item_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd)
+_elm_list_last_item_get(const Eo *obj EINA_UNUSED, Elm_List_Data *sd)
{
if (!sd->items) return NULL;
else
@@ -3048,7 +2999,7 @@ _elm_list_focus_on_selection_set(Eo *obj EINA_UNUSED, Elm_List_Data *sd, Eina_Bo
}
EOLIAN static Eina_Bool
-_elm_list_focus_on_selection_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd)
+_elm_list_focus_on_selection_get(const Eo *obj EINA_UNUSED, Elm_List_Data *sd)
{
return sd->focus_on_selection_enabled;
}
@@ -3077,7 +3028,7 @@ _elm_list_item_coordinates_adjust(Elm_List_Item_Data *it)
}
EOLIAN static Eina_Rect
-_elm_list_elm_widget_focus_highlight_geometry_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd)
+_elm_list_efl_ui_widget_focus_highlight_geometry_get(const Eo *obj, Elm_List_Data *sd)
{
Eina_Rect r = {};
@@ -3087,12 +3038,16 @@ _elm_list_elm_widget_focus_highlight_geometry_get(Eo *obj EINA_UNUSED, Elm_List_
r = _elm_list_item_coordinates_adjust(focus_it);
elm_widget_focus_highlight_focus_part_geometry_get(VIEW(focus_it), &r.x, &r.y, &r.w, &r.h);
}
+ else
+ {
+ r = efl_gfx_entity_geometry_get(obj);
+ }
return r;
}
EOLIAN static Elm_Object_Item*
-_elm_list_elm_widget_focused_item_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd)
+_elm_list_efl_ui_widget_focused_item_get(const Eo *obj EINA_UNUSED, Elm_List_Data *sd)
{
return sd->focused_item;
}
@@ -3104,7 +3059,7 @@ _elm_list_elm_interface_scrollable_item_loop_enabled_set(Eo *obj EINA_UNUSED, El
}
EOLIAN static Eina_Bool
-_elm_list_elm_interface_scrollable_item_loop_enabled_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd)
+_elm_list_elm_interface_scrollable_item_loop_enabled_get(const Eo *obj EINA_UNUSED, Elm_List_Data *sd)
{
return sd->item_loop_enable;
}
@@ -3119,7 +3074,7 @@ _elm_list_class_constructor(Efl_Class *klass)
}
EOLIAN const Efl_Access_Action_Data *
-_elm_list_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_List_Data *pd EINA_UNUSED)
+_elm_list_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Elm_List_Data *pd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "move,prior", "move", "prior", _key_action_move},
@@ -3142,21 +3097,21 @@ _elm_list_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_List
}
EOLIAN Eina_List*
-_elm_list_efl_access_children_get(Eo *obj, Elm_List_Data *pd)
+_elm_list_efl_access_object_access_children_get(const Eo *obj, Elm_List_Data *pd)
{
Eina_List *ret;
- ret = efl_access_children_get(efl_super(obj, ELM_LIST_CLASS));
+ ret = efl_access_object_access_children_get(efl_super(obj, ELM_LIST_CLASS));
return eina_list_merge(eina_list_clone(pd->items), ret);
}
EOLIAN int
-_elm_list_efl_access_selection_selected_children_count_get(Eo *objm EINA_UNUSED, Elm_List_Data *pd)
+_elm_list_efl_access_selection_selected_children_count_get(const Eo *objm EINA_UNUSED, Elm_List_Data *pd)
{
return eina_list_count(pd->selected);
}
EOLIAN Eo*
-_elm_list_efl_access_selection_selected_child_get(Eo *obj EINA_UNUSED, Elm_List_Data *pd, int child_idx)
+_elm_list_efl_access_selection_selected_child_get(const Eo *obj EINA_UNUSED, Elm_List_Data *pd, int child_idx)
{
return eina_list_nth(pd->selected, child_idx);
}
@@ -3212,7 +3167,7 @@ _elm_list_efl_access_selection_all_children_select(Eo *obj EINA_UNUSED, Elm_List
}
EOLIAN Eina_Bool
-_elm_list_efl_access_selection_clear(Eo *obj EINA_UNUSED, Elm_List_Data *pd)
+_elm_list_efl_access_selection_access_selection_clear(Eo *obj EINA_UNUSED, Elm_List_Data *pd)
{
Eo *it;
Eina_List *l;
diff --git a/src/lib/elementary/elm_list.eo b/src/lib/elementary/elm_list.eo
index 9b1e970f69..f09c5299af 100644
--- a/src/lib/elementary/elm_list.eo
+++ b/src/lib/elementary/elm_list.eo
@@ -1,44 +1,8 @@
import elm_general;
-enum Elm.List.Mode
-{
- [[Set list's resizing behavior, transverse axis scrolling and items
- cropping. See each mode's description for more details.
-
- Note: Default value is @Elm.List.Mode.scroll.
-
- Values here don't work as bitmasks -- only one can be chosen at
- a time.
-
- See also @Elm.List.mode.set, @Elm.List.mode.get.
- ]]
- legacy: elm_list;
- compress = 0, [[The list won't set any of its size hints to inform how a
- possible container should resize it. Then, if it's not
- created as a "resize object", it might end with zeroed
- dimensions. The list will respect the container's geometry
- and, if any of its items won't fit into its transverse axis,
- one won't be able to scroll it in that direction.]]
- scroll, [[Default value. This is the same as #ELM_LIST_COMPRESS, with the
- exception that if any of its items won't fit into its transverse
- axis, one will be able to scroll it in that direction.]]
- limit, [[Sets a minimum size hint on the list object, so that containers may
- respect it (and resize itself to fit the child properly). More
- specifically, a minimum size hint will be set for its transverse
- axis, so that the largest item in that direction fits well. This
- is naturally bound by the list object's maximum size hints, set
- externally.]]
- expand, [[Besides setting a minimum size on the transverse axis, just like
- on @Elm.List.Mode.limit, the list will set a minimum size on the
- longitudinal axis, trying to reserve space to all its children to
- be visible at a time. . This is naturally bound by the list
- object's maximum size hints, set externally.]]
- last [[Indicates error if returned by elm_list_mode_get().]]
-}
-
-class Elm.List (Efl.Ui.Layout, Elm.Interface_Scrollable,
- Efl.Access.Widget.Action, Efl.Access.Selection,
- Efl.Ui.Clickable, Efl.Ui.Selectable)
+class Elm.List (Efl.Ui.Layout.Object, Elm.Interface_Scrollable,
+ Efl.Access.Widget.Action, Efl.Access.Selection, Efl.Access.Object,
+ Efl.Ui.Clickable, Efl.Ui.Selectable, Efl.Ui.Legacy)
{
[[Elementary list class]]
legacy_prefix: elm_list;
@@ -430,22 +394,22 @@ class Elm.List (Efl.Ui.Layout, Elm.Interface_Scrollable,
implements {
class.constructor;
Efl.Object.constructor;
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set; }
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
Efl.Canvas.Group.group_member_add;
- Elm.Widget.theme_apply;
- Elm.Widget.on_access_update;
- Elm.Widget.focus_highlight_geometry { get; }
- Elm.Widget.on_disabled_update;
- Elm.Widget.on_focus_update;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.on_access_update;
+ Efl.Ui.Widget.focus_highlight_geometry { get; }
+ Efl.Ui.Widget.on_disabled_update;
+ Efl.Ui.Focus.Object.on_focus_update;
Efl.Ui.Translatable.translation_update;
- Elm.Widget.widget_sub_object_del;
- Elm.Widget.widget_event;
- Elm.Widget.focused_item { get; }
+ Efl.Ui.Widget.widget_sub_object_del;
+ Efl.Ui.Widget.widget_event;
+ Efl.Ui.Widget.focused_item { get; }
Elm.Interface_Scrollable.item_loop_enabled { get; set; }
Elm.Interface_Scrollable.policy { set; }
Efl.Access.Widget.Action.elm_actions { get; }
- Efl.Access.children { get; }
+ Efl.Access.Object.access_children { get; }
Efl.Access.Selection.selected_children_count { get; }
Efl.Access.Selection.selected_child { get; }
Efl.Access.Selection.selected_child_deselect;
@@ -453,20 +417,22 @@ class Elm.List (Efl.Ui.Layout, Elm.Interface_Scrollable,
Efl.Access.Selection.child_deselect;
Efl.Access.Selection.is_child_selected;
Efl.Access.Selection.all_children_select;
- Efl.Access.Selection.clear;
+ Efl.Access.Selection.access_selection_clear;
}
events {
- activated; [[Called when activated]]
- edge,top; [[Called when top edge was reached]]
- edge,bottom; [[Called when bottom edge was reached]]
- edge,left; [[Called when left edge was reached]]
- edge,right; [[Called when right edge was reached]]
- swipe; [[Called when swipe is detected]]
- highlighted; [[Called when highlighted]]
- unhighlighted; [[Called when no longer highlighted]]
- item,focused; [[Called when item got focus]]
- item,unfocused; [[Called when item no longer has focus]]
+ activated: Efl.Object; [[Called when activated]]
+ edge,top: void; [[Called when top edge was reached]]
+ edge,bottom: void; [[Called when bottom edge was reached]]
+ edge,left: void; [[Called when left edge was reached]]
+ edge,right: void; [[Called when right edge was reached]]
+ swipe: Efl.Object; [[Called when swipe is detected]]
+ highlighted: Efl.Object; [[Called when highlighted]]
+ unhighlighted: Efl.Object; [[Called when no longer highlighted]]
+ item,focused: Efl.Object; [[Called when item got focus]]
+ item,unfocused: Efl.Object; [[Called when item no longer has focus]]
+ /* FIXME: Nobody emits these
item,reorder,anim,start; [[Called when item reorder animation started]]
item,reorder,anim,stop; [[Called when item reorder animation stopped]]
+ */
}
}
diff --git a/src/lib/elementary/elm_list_item.eo b/src/lib/elementary/elm_list_item.eo
index 23729d3837..bef3d8b963 100644
--- a/src/lib/elementary/elm_list_item.eo
+++ b/src/lib/elementary/elm_list_item.eo
@@ -1,4 +1,4 @@
-class Elm.List.Item(Elm.Widget.Item)
+class Elm.List.Item(Elm.Widget.Item, Efl.Ui.Legacy)
{
[[Elementary list item class]]
legacy_prefix: elm_list_item;
@@ -108,14 +108,16 @@ class Elm.List.Item(Elm.Widget.Item)
}
implements {
Efl.Object.constructor;
+ Efl.Object.invalidate;
+ Efl.Object.destructor;
Elm.Widget.Item.disable;
Elm.Widget.Item.del_pre;
Elm.Widget.Item.signal_emit;
- Elm.Widget.Item.focus { get; set; }
+ Elm.Widget.Item.item_focus { get; set; }
Elm.Widget.Item.part_text { get; set; }
Elm.Widget.Item.part_content { get; set; }
Elm.Widget.Item.part_content_unset;
- Efl.Access.name { get; }
- Efl.Access.state_set { get; }
+ Efl.Access.Object.i18n_name { get; }
+ Efl.Access.Object.state_set { get; }
}
}
diff --git a/src/lib/elementary/elm_main.c b/src/lib/elementary/elm_main.c
index b75d8a820a..8eac4fe40f 100644
--- a/src/lib/elementary/elm_main.c
+++ b/src/lib/elementary/elm_main.c
@@ -17,8 +17,11 @@
#include <Emotion.h>
#include <Elementary.h>
-#include "elm_priv.h"
+
+#include "eina_internal.h"
#include "ecore_internal.h"
+
+#include "elm_priv.h"
#include "elm_interface_scrollable.h"
//we need those for legacy compatible code
@@ -33,6 +36,8 @@
# define LIBEXT ".so"
#endif
+Eina_Bool _use_build_config;
+
static Elm_Version _version = { VMAJ, VMIN, VMIC, VREV };
EAPI Elm_Version *elm_version = &_version;
@@ -119,26 +124,6 @@ _elm_rescale(void)
_elm_ews_wm_rescale(NULL, EINA_FALSE);
}
-static Eina_Bool _emotion_inited = EINA_FALSE;
-
-void
-_elm_emotion_init(void)
-{
- if (_emotion_inited) return ;
-
- emotion_init();
- _emotion_inited = EINA_TRUE;
-}
-
-void
-_elm_emotion_shutdown(void)
-{
- if (!_emotion_inited) return ;
-
- emotion_shutdown();
- _emotion_inited = EINA_FALSE;
-}
-
static void *app_mainfunc = NULL;
static const char *app_name = NULL;
static const char *app_desktop_entry = NULL;
@@ -168,7 +153,6 @@ _prefix_check(void)
const char *dirs[4] = { NULL, NULL, NULL, NULL };
char *caps = NULL, *p1, *p2;
char buf[PATH_MAX];
- Efl_Vpath_Core *vpath;
if (app_pfx) return;
if (!app_domain) return;
@@ -200,21 +184,7 @@ _prefix_check(void)
app_pfx = eina_prefix_new(argv[0], app_mainfunc, caps, app_domain,
app_checkfile, dirs[0], dirs[1], dirs[2], dirs[3]);
- vpath = efl_vpath_core_get(EFL_VPATH_CORE_CLASS);
- efl_vpath_core_meta_set(vpath, "app.dir", eina_prefix_get(app_pfx));
- efl_vpath_core_meta_set(vpath, "app.bin", eina_prefix_bin_get(app_pfx));
- efl_vpath_core_meta_set(vpath, "app.lib", eina_prefix_lib_get(app_pfx));
- efl_vpath_core_meta_set(vpath, "app.data", eina_prefix_data_get(app_pfx));
- efl_vpath_core_meta_set(vpath, "app.locale", eina_prefix_locale_get(app_pfx));
- snprintf(buf, sizeof(buf), "%s/%s",
- efl_vpath_core_meta_get(vpath, "config"), app_domain);
- efl_vpath_core_meta_set(vpath, "app.config", buf);
- snprintf(buf, sizeof(buf), "%s/%s",
- efl_vpath_core_meta_get(vpath, "cache"), app_domain);
- efl_vpath_core_meta_set(vpath, "app.cache", buf);
- snprintf(buf, sizeof(buf), "%s/%s",
- efl_vpath_core_meta_get(vpath, "data"), app_domain);
- efl_vpath_core_meta_set(vpath, "app.local", buf);
+ eina_vpath_interface_app_set(app_domain, app_pfx);
}
static void
@@ -281,7 +251,7 @@ static struct {
while (0)
static void
-_elm_clouseau_unload()
+_elm_old_clouseau_unload()
{
if (_clouseau_old_info.is_init)
{
@@ -296,6 +266,11 @@ _elm_clouseau_unload()
}
_clouseau_old_info.is_init = EINA_FALSE;
}
+}
+
+static void
+_elm_clouseau_unload()
+{
if (_clouseau_info.is_init)
{
if (_clouseau_info.shutdown)
@@ -312,11 +287,11 @@ _elm_clouseau_unload()
}
Eina_Bool
-_elm_clouseau_reload()
+_elm_old_clouseau_reload()
{
if (!_elm_config->clouseau_enable)
{
- _elm_clouseau_unload();
+ _elm_old_clouseau_unload();
return EINA_TRUE;
}
@@ -345,7 +320,12 @@ _elm_clouseau_reload()
_clouseau_old_info.is_init = EINA_TRUE;
}
}
+ return EINA_TRUE;
+}
+static Eina_Bool
+_elm_clouseau_load()
+{
if (!_clouseau_info.is_init)
{
_clouseau_info.handle = eina_module_new(
@@ -402,16 +382,21 @@ _sys_lang_changed(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA
return ECORE_CALLBACK_PASS_ON;
}
+// This is necessary to keep backward compatibility
+static const char *bcargv[] = { "exe" };
+
EAPI int
elm_init(int argc, char **argv)
{
_elm_init_count++;
if (_elm_init_count > 1) return _elm_init_count;
- elm_quicklaunch_init(argc, argv);
- elm_quicklaunch_sub_init(argc, argv);
+ elm_quicklaunch_init(argc, argv ? argv : (char**) bcargv);
+ elm_quicklaunch_sub_init(argc, argv ? argv : (char**) bcargv);
_prefix_shutdown();
+ _elm_clouseau_load();
+
system_handlers[0] =
ecore_event_handler_add(ECORE_EVENT_MEMORY_STATE, _sys_memory_changed, NULL);
system_handlers[1] =
@@ -420,9 +405,9 @@ elm_init(int argc, char **argv)
if (_elm_config->atspi_mode != ELM_ATSPI_MODE_OFF)
_elm_atspi_bridge_init();
if (!_elm_config->web_backend)
- _elm_config->web_backend = "none";
+ _elm_config->web_backend = eina_stringshare_add("none");
if (!_elm_web_init(_elm_config->web_backend))
- _elm_config->web_backend = "none";
+ _elm_config->web_backend = eina_stringshare_add("none");
_elm_code_parse_setup();
// For backward compability, EFL startup time and ELM startup time are made
@@ -454,6 +439,7 @@ elm_shutdown(void)
while (_elm_win_deferred_free) ecore_main_loop_iterate();
_elm_clouseau_unload();
+ _elm_old_clouseau_unload();
// wrningz :(
// _prefix_shutdown();
ELM_SAFE_FREE(app_name, eina_stringshare_del);
@@ -737,6 +723,7 @@ elm_quicklaunch_init(int argc EINA_UNUSED,
{
_elm_ql_init_count++;
if (_elm_ql_init_count > 1) return _elm_ql_init_count;
+ _use_build_config = !!getenv("EFL_RUN_IN_TREE");
eina_init();
_elm_log_dom = eina_log_domain_register("elementary", EINA_COLOR_LIGHTBLUE);
if (!_elm_log_dom)
@@ -747,6 +734,7 @@ elm_quicklaunch_init(int argc EINA_UNUSED,
eet_init();
ecore_init();
+ ecore_event_init();
edje_init();
eio_init();
@@ -779,7 +767,10 @@ elm_quicklaunch_init(int argc EINA_UNUSED,
LOCALE_DIR);
if (pfx)
{
- _elm_data_dir = eina_stringshare_add(eina_prefix_data_get(pfx));
+ if (_use_build_config)
+ _elm_data_dir = eina_stringshare_add(PACKAGE_BUILD_DIR "/data/elementary");
+ else
+ _elm_data_dir = eina_stringshare_add(eina_prefix_data_get(pfx));
_elm_lib_dir = eina_stringshare_add(eina_prefix_lib_get(pfx));
}
if (!_elm_data_dir) _elm_data_dir = eina_stringshare_add("/");
@@ -840,8 +831,8 @@ elm_quicklaunch_sub_shutdown(void)
elm_color_class_shutdown();
}
- _elm_config_shutdown();
ecore_main_loop_iterate();
+ _elm_config_shutdown();
return _elm_sub_init_count;
}
@@ -879,10 +870,10 @@ elm_quicklaunch_shutdown(void)
#ifdef HAVE_ELEMENTARY_EMAP
emap_shutdown();
#endif
- _elm_emotion_shutdown();
ecore_file_shutdown();
eio_shutdown();
+ ecore_event_shutdown();
ecore_shutdown();
eet_shutdown();
@@ -938,8 +929,8 @@ static void (*qre_terminate)(void *data,
EFL_CALLBACKS_ARRAY_DEFINE(_qre_main_ex,
{ EFL_LOOP_EVENT_ARGUMENTS, qre_main },
- { EFL_LOOP_EVENT_PAUSE, qre_pause },
- { EFL_LOOP_EVENT_RESUME, qre_resume },
+ { EFL_APP_EVENT_PAUSE, qre_pause },
+ { EFL_APP_EVENT_RESUME, qre_resume },
{ EFL_EVENT_DEL, qre_terminate });
EAPI Eina_Bool
@@ -1086,7 +1077,7 @@ efl_quicklaunch_prepare(int argc,
#endif
}
-EAPI Eina_Bool
+EAPI int
elm_quicklaunch_fork(int argc,
char **argv,
char *cwd,
@@ -1104,11 +1095,11 @@ elm_quicklaunch_fork(int argc,
WRN("No main function found.");
child = fork();
- if (child > 0) return EINA_TRUE;
+ if (child > 0) return child;
else if (child < 0)
{
perror("could not fork");
- return EINA_FALSE;
+ return 0;
}
setsid();
if (chdir(cwd) != 0) perror("could not chdir");
@@ -1123,12 +1114,13 @@ elm_quicklaunch_fork(int argc,
INF("Main function found (legacy: %p, efl: %p)",
qr_main, qre_main);
child = fork();
- if (child > 0) return EINA_TRUE;
+ if (child > 0) return child;
else if (child < 0)
{
perror("could not fork");
- return EINA_FALSE;
+ return 0;
}
+ ecore_app_args_set(argc, (const char**)argv);
if (postfork_func) postfork_func(postfork_data);
eina_main_loop_define();
@@ -1144,45 +1136,12 @@ elm_quicklaunch_fork(int argc,
evas_init();
_elm_module_init();
_elm_config_sub_init();
-# ifdef HAVE_ELEMENTARY_X
- {
- Eina_Bool init_x;
- const char *ev = getenv("ELM_DISPLAY");
- Eina_Bool have_display = !!getenv("DISPLAY");
-
- if (ev) /* If ELM_DISPLAY is specified */
- {
- if (!strcmp(ev, "x11")) /* and it is X11 */
- {
- if (!have_display) /* if there is no $DISPLAY */
- {
- ERR("$ELM_DISPLAY is set to x11 but $DISPLAY"
- " is not set");
- init_x = EINA_FALSE;
- }
- else /* if there is */
- init_x = EINA_TRUE;
- }
- else /* not X11 */
- init_x = EINA_FALSE;
- }
- else /* ELM_DISPLAY not specified */
- {
- if (have_display) /* If there is a $DISPLAY */
- init_x = EINA_TRUE;
- else /* No $DISPLAY */
- init_x = EINA_FALSE;
- }
- if (init_x)
- ecore_x_init(NULL);
- }
-# endif
ecore_evas_init(); // FIXME: check errors
ecore_imf_init();
#endif
}
- setsid();
+ if (setsid() < 0) perror("could not setsid");
if (chdir(cwd) != 0) perror("could not chdir");
if (_elm_config->atspi_mode != ELM_ATSPI_MODE_OFF)
_elm_atspi_bridge_init();
@@ -1217,9 +1176,9 @@ elm_quicklaunch_fork(int argc,
exit(ret);
}
- return EINA_TRUE;
+ return 1;
#else
- return EINA_FALSE;
+ return 0;
(void)argc;
(void)argv;
(void)cwd;
@@ -1347,12 +1306,12 @@ elm_policy_set(unsigned int policy,
{
if (value == ELM_POLICY_EXIT_WINDOWS_DEL)
{
- efl_event_callback_add(efl_main_loop_get(), EFL_LOOP_EVENT_TERMINATE,
+ efl_event_callback_add(efl_main_loop_get(), EFL_APP_EVENT_TERMINATE,
_on_terminate, NULL);
}
else
{
- efl_event_callback_del(efl_main_loop_get(), EFL_LOOP_EVENT_TERMINATE,
+ efl_event_callback_del(efl_main_loop_get(), EFL_APP_EVENT_TERMINATE,
_on_terminate, NULL);
}
}
@@ -1426,14 +1385,14 @@ elm_object_scale_set(Evas_Object *obj,
double scale)
{
EINA_SAFETY_ON_NULL_RETURN(obj);
- efl_gfx_scale_set(obj, scale);
+ efl_gfx_entity_scale_set(obj, scale);
}
EAPI double
elm_object_scale_get(const Evas_Object *obj)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(obj, 0.0);
- return efl_gfx_scale_get(obj);
+ return efl_gfx_entity_scale_get(obj);
}
EAPI void
@@ -1454,20 +1413,44 @@ EAPI void
elm_object_domain_translatable_part_text_set(Evas_Object *obj, const char *part, const char *domain, const char *text)
{
EINA_SAFETY_ON_NULL_RETURN(obj);
- if (!part)
- efl_ui_translatable_text_set(obj, text, domain);
+ if (elm_widget_is_legacy(obj))
+ {
+ if (!part)
+ part = efl_ui_widget_default_text_part_get(obj);
+ else if (efl_isa(obj, EFL_UI_LAYOUT_OBJECT_CLASS))
+ _elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE);
+
+ elm_widget_part_translatable_text_set(obj, part, text, domain);
+ }
else
- efl_ui_translatable_text_set(efl_part(obj, part), text, domain);
+ {
+ if (!part)
+ efl_ui_translatable_text_set(obj, text, domain);
+ else
+ efl_ui_translatable_text_set(efl_part(obj, part), text, domain);
+ }
}
EAPI const char *
elm_object_translatable_part_text_get(const Evas_Object *obj, const char *part)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
- if (!part)
- return efl_ui_translatable_text_get(obj, NULL);
+ if (elm_widget_is_legacy(obj))
+ {
+ if (!part)
+ part = efl_ui_widget_default_text_part_get(obj);
+ else if (efl_isa(obj, EFL_UI_LAYOUT_OBJECT_CLASS))
+ _elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE);
+
+ return elm_widget_part_translatable_text_get(obj, part, NULL);
+ }
else
- return efl_ui_translatable_text_get(efl_part(obj, part), NULL);
+ {
+ if (!part)
+ return efl_ui_translatable_text_get(obj, NULL);
+ else
+ return efl_ui_translatable_text_get(efl_part(obj, part), NULL);
+ }
}
EAPI void
@@ -1576,75 +1559,6 @@ elm_cache_all_flush(void)
}
}
-EAPI Eina_Bool
-elm_object_focus_get(const Evas_Object *obj)
-{
- Efl_Ui_Focus_Manager *m;
- Efl_Ui_Focus_Object *focused_child;
- EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
-
- if (!elm_widget_is(obj))
- return evas_object_focus_get(obj);
-
- m = efl_ui_focus_user_focus_manager_get(obj);
-
- //no manager means not registered
- if (!m) return EINA_FALSE;
-
- //assertion: our redirect manager m is in the redirect chain
- m = efl_ui_focus_user_focus_manager_get(obj);
-
- //if obj is the redriect manager its kind of focused
- if (efl_ui_focus_manager_redirect_get(m) == obj) return EINA_TRUE;
-
- //if there is a redirect manager
- if (!!efl_ui_focus_manager_redirect_get(m)) return EINA_FALSE;
-
- //now take the focused object and walk down the parents, if this is
- focused_child = efl_ui_focus_manager_focus_get(m);
-
- while(focused_child)
- {
- if (focused_child == obj) return EINA_TRUE;
-
- focused_child = efl_ui_focus_user_focus_parent_get(focused_child);
- }
-
- return efl_ui_focus_object_focus_get(obj);
-}
-
-EAPI void
-elm_object_focus_set(Evas_Object *obj,
- Eina_Bool focus)
-{
- EINA_SAFETY_ON_NULL_RETURN(obj);
-
- // ugly, but, special case for inlined windows
- if (efl_isa(obj, EFL_UI_WIN_CLASS))
- {
- Evas_Object *inlined = elm_win_inlined_image_object_get(obj);
- if (inlined)
- {
- evas_object_focus_set(inlined, focus);
- return;
- }
- }
- else if (elm_widget_is(obj))
- {
- if (focus)
- efl_ui_focus_util_focus(EFL_UI_FOCUS_UTIL_CLASS, obj);
- else
- {
- if (efl_ui_focus_manager_focus_get(efl_ui_focus_user_focus_manager_get(obj)) == obj)
- efl_ui_focus_manager_pop_history_stack(efl_ui_focus_user_focus_manager_get(obj));
- }
- }
- else
- {
- evas_object_focus_set(obj, focus);
- }
-}
-
EAPI void
elm_object_focus_allow_set(Evas_Object *obj,
Eina_Bool enable)
@@ -1660,119 +1574,6 @@ elm_object_focus_allow_get(const Evas_Object *obj)
return (elm_widget_can_focus_get(obj)) || (elm_widget_child_can_focus_get(obj));
}
-EAPI void
-elm_object_focus_custom_chain_set(Evas_Object *obj,
- Eina_List *objs EINA_UNUSED)
-{
- EINA_SAFETY_ON_NULL_RETURN(obj);
- ERR("Focus-chain not supported");
-}
-
-EAPI void
-elm_object_focus_custom_chain_unset(Evas_Object *obj)
-{
- EINA_SAFETY_ON_NULL_RETURN(obj);
- ERR("Focus-chain not supported");
-}
-
-EAPI const Eina_List *
-elm_object_focus_custom_chain_get(const Evas_Object *obj)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
- ERR("Focus-chain not supported");
- return NULL;
-}
-
-EAPI void
-elm_object_focus_custom_chain_append(Evas_Object *obj,
- Evas_Object *child EINA_UNUSED,
- Evas_Object *relative_child EINA_UNUSED)
-{
- EINA_SAFETY_ON_NULL_RETURN(obj);
- ERR("Focus-chain not supported");
-}
-
-EAPI void
-elm_object_focus_custom_chain_prepend(Evas_Object *obj,
- Evas_Object *child EINA_UNUSED,
- Evas_Object *relative_child EINA_UNUSED)
-{
- EINA_SAFETY_ON_NULL_RETURN(obj);
- ERR("Focus-chain not supported");
-}
-
-EINA_DEPRECATED EAPI void
-elm_object_focus_cycle(Evas_Object *obj,
- Elm_Focus_Direction dir)
-{
- elm_object_focus_next(obj, dir);
-}
-
-EAPI void
-elm_object_focus_next(Evas_Object *obj,
- Elm_Focus_Direction dir)
-{
- Elm_Widget *top = elm_object_top_widget_get(obj);
- EINA_SAFETY_ON_NULL_RETURN(obj);
-
- efl_ui_focus_manager_move(top, dir);
-}
-
-EAPI Evas_Object *
-elm_object_focus_next_object_get(const Evas_Object *obj,
- Elm_Focus_Direction dir)
-{
- Elm_Widget *top = elm_object_top_widget_get(obj);
- EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
-
- return efl_ui_focus_manager_request_move(top, dir);
-}
-
-EAPI void
-elm_object_focus_next_object_set(Evas_Object *obj,
- Evas_Object *next EINA_UNUSED,
- Elm_Focus_Direction dir EINA_UNUSED)
-{
- EINA_SAFETY_ON_NULL_RETURN(obj);
- ERR("setting explicit objects not allowed not supported");
-}
-
-EAPI Elm_Object_Item *
-elm_object_focus_next_item_get(const Evas_Object *obj,
- Elm_Focus_Direction dir EINA_UNUSED)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
- /* FOCUS-FIXME */
- return NULL;
-}
-
-EAPI void
-elm_object_focus_next_item_set(Evas_Object *obj,
- Elm_Object_Item *next_item EINA_UNUSED,
- Elm_Focus_Direction dir EINA_UNUSED)
-{
- EINA_SAFETY_ON_NULL_RETURN(obj);
- /* FOCUS-FIXME */
-}
-
-EAPI Evas_Object *
-elm_object_focused_object_get(const Evas_Object *obj)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
- Efl_Ui_Focus_Manager *man = elm_object_top_widget_get(obj);
-
- while(efl_ui_focus_manager_redirect_get(man))
- {
- man = efl_ui_focus_manager_redirect_get(man);
-
- // legacy compatible code, earlier those containers have not exposed theire items
- if (efl_isa(man, ELM_GENGRID_CLASS) ||
- efl_isa(man, ELM_TOOLBAR_CLASS) ||
- efl_isa(man, ELM_GENLIST_CLASS)) return man;
- }
-
- return efl_ui_focus_manager_focus_get(man);
-}
EAPI void
elm_object_tree_focus_allow_set(Evas_Object *obj,
@@ -2051,13 +1852,16 @@ elm_object_name_find(const Evas_Object *obj, const char *name, int recurse)
EAPI void
elm_object_orientation_mode_disabled_set(Evas_Object *obj, Eina_Bool disabled)
{
- elm_widget_orientation_mode_disabled_set(obj, disabled);
+ Efl_Ui_Widget_Orientation_Mode mode =
+ disabled ? EFL_UI_WIDGET_ORIENTATION_MODE_DISABLED
+ : EFL_UI_WIDGET_ORIENTATION_MODE_DEFAULT;
+ efl_ui_widget_orientation_mode_set(obj, mode);
}
EAPI Eina_Bool
elm_object_orientation_mode_disabled_get(const Evas_Object *obj)
{
- return elm_widget_orientation_mode_disabled_get(obj);
+ return efl_ui_widget_orientation_mode_get(obj) == EFL_UI_WIDGET_ORIENTATION_MODE_DISABLED;
}
EAPI Elm_Object_Item *
@@ -2078,3 +1882,28 @@ elm_object_focus_region_show_mode_get(const Evas_Object *obj)
{
return elm_widget_focus_region_show_mode_get(obj);
}
+
+static void
+_item_noref(void *data EINA_UNUSED, const Efl_Event *ev)
+{
+ if (!efl_parent_get(ev->object)) return ;
+ efl_del(ev->object);
+}
+
+EAPI void
+elm_object_item_del(Eo *obj)
+{
+ Elm_Widget_Item_Data *item;
+
+ if (efl_ref_count(obj) == 1)
+ {
+ // Noref already, die little item !
+ efl_del(obj);
+ return ;
+ }
+
+ item = efl_data_scope_safe_get(obj, ELM_WIDGET_ITEM_CLASS);
+ if (!item) return ;
+ efl_event_callback_add(obj, EFL_EVENT_NOREF, _item_noref, NULL);
+ item->on_deletion = EINA_TRUE;
+}
diff --git a/src/lib/elementary/elm_map.c b/src/lib/elementary/elm_map.c
index 13b5521b96..c8ff618adc 100644
--- a/src/lib/elementary/elm_map.c
+++ b/src/lib/elementary/elm_map.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#include <Elementary.h>
@@ -324,9 +324,6 @@ static const char SIG_SCROLL_DRAG_START[] = "scroll,drag,start";
static const char SIG_SCROLL_DRAG_STOP[] = "scroll,drag,stop";
static const char SIG_SCROLL_ANIM_START[] = "scroll,anim,start";
static const char SIG_SCROLL_ANIM_STOP[] = "scroll,anim,stop";
-static const char SIG_ZOOM_START[] = "zoom,start";
-static const char SIG_ZOOM_STOP[] = "zoom,stop";
-static const char SIG_ZOOM_CHANGE[] = "zoom,change";
static const char SIG_LOADED[] = "loaded";
static const char SIG_TILE_LOAD[] = "tile,load";
static const char SIG_TILE_LOADED[] = "tile,loaded";
@@ -350,9 +347,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_SCROLL_DRAG_STOP, ""},
{SIG_SCROLL_ANIM_START, ""},
{SIG_SCROLL_ANIM_STOP, ""},
- {SIG_ZOOM_START, ""},
- {SIG_ZOOM_STOP, ""},
- {SIG_ZOOM_CHANGE, ""},
{SIG_LOADED, ""},
{SIG_TILE_LOAD, ""},
{SIG_TILE_LOADED, ""},
@@ -1153,7 +1147,7 @@ _zoom_do(Elm_Map_Data *sd,
if (sd->obj)
sd->zoom_timer = ecore_timer_add(0.25, _zoom_timeout_cb, sd->obj);
efl_event_callback_legacy_call
- (sd->obj, ELM_MAP_EVENT_ZOOM_CHANGE, NULL);
+ (sd->obj, EFL_UI_EVENT_ZOOM_CHANGE, NULL);
efl_event_callback_legacy_call
(sd->pan_obj, ELM_PAN_EVENT_CHANGED, NULL);
@@ -3737,7 +3731,7 @@ _zoom_mode_set(Elm_Map_Data *sd, double zoom)
{
EINA_SAFETY_ON_NULL_RETURN(sd);
- if (sd->mode == ELM_MAP_ZOOM_MODE_MANUAL)
+ if (sd->mode == EFL_UI_ZOOM_MODE_MANUAL)
{
if (sd->paused) _zoom_do(sd, zoom);
else _zoom_with_animation(sd, zoom, 10);
@@ -3752,7 +3746,7 @@ _zoom_mode_set(Elm_Map_Data *sd, double zoom)
h = sd->size.h;
_viewport_coord_get(sd, NULL, NULL, &vw, &vh);
- if (sd->mode == ELM_MAP_ZOOM_MODE_AUTO_FIT)
+ if (sd->mode == EFL_UI_ZOOM_MODE_AUTO_FIT)
{
if ((w < vw) && (h < vh))
{
@@ -3776,7 +3770,7 @@ _zoom_mode_set(Elm_Map_Data *sd, double zoom)
zoom -= diff;
}
}
- else if (sd->mode == ELM_MAP_ZOOM_MODE_AUTO_FILL)
+ else if (sd->mode == EFL_UI_ZOOM_MODE_AUTO_FILL)
{
if ((w < vw) || (h < vh))
{
@@ -3870,14 +3864,14 @@ _elm_map_pan_elm_pan_pos_set(Eo *obj, Elm_Map_Pan_Data *psd, Evas_Coord x, Evas_
}
EOLIAN static void
-_elm_map_pan_elm_pan_pos_get(Eo *obj EINA_UNUSED, Elm_Map_Pan_Data *psd, Evas_Coord *x, Evas_Coord *y)
+_elm_map_pan_elm_pan_pos_get(const Eo *obj EINA_UNUSED, Elm_Map_Pan_Data *psd, Evas_Coord *x, Evas_Coord *y)
{
if (x) *x = psd->wsd->pan_x;
if (y) *y = psd->wsd->pan_y;
}
EOLIAN static void
-_elm_map_pan_elm_pan_pos_max_get(Eo *obj, Elm_Map_Pan_Data *psd, Evas_Coord *x, Evas_Coord *y)
+_elm_map_pan_elm_pan_pos_max_get(const Eo *obj, Elm_Map_Pan_Data *psd, Evas_Coord *x, Evas_Coord *y)
{
Evas_Coord ow, oh;
@@ -3892,29 +3886,29 @@ _elm_map_pan_elm_pan_pos_max_get(Eo *obj, Elm_Map_Pan_Data *psd, Evas_Coord *x,
}
EOLIAN static void
-_elm_map_pan_elm_pan_pos_min_get(Eo *obj EINA_UNUSED, Elm_Map_Pan_Data *_pd EINA_UNUSED, Evas_Coord *x, Evas_Coord *y)
+_elm_map_pan_elm_pan_pos_min_get(const Eo *obj EINA_UNUSED, Elm_Map_Pan_Data *_pd EINA_UNUSED, Evas_Coord *x, Evas_Coord *y)
{
if (x) *x = 0;
if (y) *y = 0;
}
EOLIAN static void
-_elm_map_pan_elm_pan_content_size_get(Eo *obj EINA_UNUSED, Elm_Map_Pan_Data *psd, Evas_Coord *w, Evas_Coord *h)
+_elm_map_pan_elm_pan_content_size_get(const Eo *obj EINA_UNUSED, Elm_Map_Pan_Data *psd, Evas_Coord *w, Evas_Coord *h)
{
if (w) *w = psd->wsd->size.w;
if (h) *h = psd->wsd->size.h;
}
EOLIAN static void
-_elm_map_pan_efl_gfx_size_set(Eo *obj, Elm_Map_Pan_Data *psd, Eina_Size2D sz)
+_elm_map_pan_efl_gfx_entity_size_set(Eo *obj, Elm_Map_Pan_Data *psd, Eina_Size2D sz)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
- efl_gfx_size_set(efl_super(obj, MY_PAN_CLASS), sz);
+ efl_gfx_entity_size_set(efl_super(obj, MY_PAN_CLASS), sz);
_sizing_eval(psd->wsd->obj);
- elm_map_zoom_mode_set(psd->wobj, psd->wsd->mode);
+ efl_ui_zoom_mode_set(psd->wobj, psd->wsd->mode);
evas_object_smart_changed(obj);
}
@@ -3935,22 +3929,22 @@ _elm_map_pan_efl_canvas_group_group_calculate(Eo *obj, Elm_Map_Pan_Data *psd)
}
EOLIAN static void
-_elm_map_pan_efl_gfx_position_set(Eo *obj, Elm_Map_Pan_Data *_pd EINA_UNUSED, Eina_Position2D pos)
+_elm_map_pan_efl_gfx_entity_position_set(Eo *obj, Elm_Map_Pan_Data *_pd EINA_UNUSED, Eina_Position2D pos)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
- efl_gfx_position_set(efl_super(obj, MY_PAN_CLASS), pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_PAN_CLASS), pos);
evas_object_smart_changed(obj);
}
EOLIAN static Eina_Bool
-_elm_map_elm_widget_on_focus_update(Eo *obj, Elm_Map_Data *_pd EINA_UNUSED, Elm_Object_Item *item EINA_UNUSED)
+_elm_map_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Map_Data *_pd EINA_UNUSED)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
Eina_Bool int_ret = EINA_FALSE;
- int_ret = efl_ui_widget_on_focus_update(efl_super(obj, MY_CLASS), NULL);
+ int_ret = efl_ui_focus_object_on_focus_update(efl_super(obj, MY_CLASS));
if (!int_ret) return EINA_FALSE;
if (efl_ui_focus_object_focus_get(obj))
@@ -3985,7 +3979,7 @@ _elm_map_pan_class_constructor(Efl_Class *klass)
#include "elm_map_pan.eo.c"
EOLIAN static Efl_Ui_Theme_Apply
-_elm_map_elm_widget_theme_apply(Eo *obj, Elm_Map_Data *sd EINA_UNUSED)
+_elm_map_efl_ui_widget_theme_apply(Eo *obj, Elm_Map_Data *sd EINA_UNUSED)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
@@ -4118,7 +4112,7 @@ _elm_map_efl_canvas_group_group_add(Eo *obj, Elm_Map_Data *priv)
elm_interface_scrollable_animate_stop_cb_set(obj, _scroll_animate_stop_cb);
elm_interface_scrollable_scroll_cb_set(obj, _scroll_cb);
- priv->pan_obj = efl_add(MY_PAN_CLASS, evas_object_evas_get(obj));
+ priv->pan_obj = efl_add(MY_PAN_CLASS, obj);
pan_data = efl_data_scope_get(priv->pan_obj, MY_PAN_CLASS);
efl_data_ref(obj, MY_CLASS);
pan_data->wobj = obj;
@@ -4171,7 +4165,7 @@ _elm_map_efl_canvas_group_group_add(Eo *obj, Elm_Map_Data *priv)
_zoom_do(priv, 0);
- priv->mode = ELM_MAP_ZOOM_MODE_MANUAL;
+ priv->mode = EFL_UI_ZOOM_MODE_MANUAL;
if (!elm_need_efreet())
ERR("Efreet initialization failed!");
@@ -4191,12 +4185,30 @@ _elm_map_efl_canvas_group_group_add(Eo *obj, Elm_Map_Data *priv)
}
EOLIAN static void
+_elm_map_efl_object_invalidate(Eo *obj, Elm_Map_Data *sd)
+{
+ Evas_Object *track;
+
+ EINA_LIST_FREE(sd->track, track)
+ evas_object_del(track);
+
+ ELM_SAFE_FREE(sd->copyright, evas_object_del);
+
+ // pan_obj was created with efl_add and will die after invalidate.
+ // Technically it will bring down all the object above, and there is
+ // no need to explicitely destroy them, but we were doing that
+ // explicitely in the past, so keep it explicit.
+ sd->pan_obj = NULL;
+
+ efl_invalidate(efl_super(obj, MY_CLASS));
+}
+
+EOLIAN static void
_elm_map_efl_canvas_group_group_del(Eo *obj, Elm_Map_Data *sd)
{
Elm_Map_Route *r;
Elm_Map_Name *na;
Eina_List *l, *ll;
- Evas_Object *track;
Elm_Map_Overlay *overlay;
EINA_LIST_FOREACH_SAFE(sd->routes, l, ll, r)
@@ -4216,9 +4228,6 @@ _elm_map_efl_canvas_group_group_del(Eo *obj, Elm_Map_Data *sd)
eina_list_free(sd->group_overlays);
eina_list_free(sd->all_overlays);
- EINA_LIST_FREE(sd->track, track)
- evas_object_del(track);
-
ecore_timer_del(sd->scr_timer);
ecore_timer_del(sd->long_timer);
eina_stringshare_del(sd->user_agent);
@@ -4237,38 +4246,33 @@ _elm_map_efl_canvas_group_group_del(Eo *obj, Elm_Map_Data *sd)
char buf[4096];
snprintf(buf, sizeof(buf), "%s" CACHE_ROOT, efreet_cache_home_get());
- if (!ecore_file_recursive_rm(buf))
- ERR("Deletion of %s failed", buf);
+ ecore_file_recursive_rm(buf);
}
ecore_timer_del(sd->loaded_timer);
if (sd->map) evas_map_free(sd->map);
- evas_object_del(sd->pan_obj);
- sd->pan_obj = NULL;
-
- ELM_SAFE_FREE(sd->copyright, evas_object_del);
efl_canvas_group_del(efl_super(obj, MY_CLASS));
}
EOLIAN static void
-_elm_map_efl_gfx_position_set(Eo *obj, Elm_Map_Data *sd, Eina_Position2D pos)
+_elm_map_efl_gfx_entity_position_set(Eo *obj, Elm_Map_Data *sd, Eina_Position2D pos)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
- efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
- efl_gfx_position_set(sd->hit_rect, pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
+ efl_gfx_entity_position_set(sd->hit_rect, pos);
}
EOLIAN static void
-_elm_map_efl_gfx_size_set(Eo *obj, Elm_Map_Data *sd, Eina_Size2D sz)
+_elm_map_efl_gfx_entity_size_set(Eo *obj, Elm_Map_Data *sd, Eina_Size2D sz)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
- efl_gfx_size_set(efl_super(obj, MY_CLASS), sz);
- efl_gfx_size_set(sd->hit_rect, sz);
+ efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
+ efl_gfx_entity_size_set(sd->hit_rect, sz);
}
EOLIAN static void
@@ -4295,18 +4299,18 @@ _elm_map_efl_object_constructor(Eo *obj, Elm_Map_Data *sd)
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_IMAGE_MAP);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_IMAGE_MAP);
return obj;
}
EOLIAN static void
-_elm_map_zoom_set(Eo *obj, Elm_Map_Data *sd, int zoom)
+_elm_map_efl_ui_zoom_zoom_level_set(Eo *obj, Elm_Map_Data *sd, double zoom)
{
ELM_MAP_CHECK(obj);
EINA_SAFETY_ON_NULL_RETURN(sd->src_tile);
- if (sd->mode != ELM_MAP_ZOOM_MODE_MANUAL) return;
+ if (sd->mode != EFL_UI_ZOOM_MODE_MANUAL) return;
if (zoom < 0) zoom = 0;
if (sd->zoom == zoom) return;
@@ -4314,30 +4318,77 @@ _elm_map_zoom_set(Eo *obj, Elm_Map_Data *sd, int zoom)
sd->calc_job.zoom_mode_set = _zoom_mode_set;
evas_object_smart_changed(sd->pan_obj);
+ efl_ui_zoom_level_set(efl_super(obj, MY_CLASS), zoom);
}
-EOLIAN static int
-_elm_map_zoom_get(Eo *obj EINA_UNUSED, Elm_Map_Data *sd)
+EAPI void
+elm_map_zoom_set(Eo *obj, int zoom)
+{
+ efl_ui_zoom_level_set(obj, zoom);
+}
+
+EAPI int
+elm_map_zoom_get(const Eo *obj)
{
- return sd->zoom;
+ return efl_ui_zoom_level_get(obj);
}
EOLIAN static void
-_elm_map_zoom_mode_set(Eo *obj EINA_UNUSED, Elm_Map_Data *sd, Elm_Map_Zoom_Mode mode)
+_elm_map_efl_ui_zoom_zoom_mode_set(Eo *obj, Elm_Map_Data *sd, Efl_Ui_Zoom_Mode mode)
{
- if ((mode == ELM_MAP_ZOOM_MODE_MANUAL) && (sd->mode == !!mode)) return;
+ if ((mode == EFL_UI_ZOOM_MODE_MANUAL) && (sd->mode == !!mode)) return;
sd->mode = mode;
sd->calc_job.zoom = sd->zoom_detail;
sd->calc_job.zoom_mode_set = _zoom_mode_set;
evas_object_smart_changed(sd->pan_obj);
+ efl_ui_zoom_mode_set(efl_super(obj, MY_CLASS), mode);
}
-EOLIAN static Elm_Map_Zoom_Mode
-_elm_map_zoom_mode_get(Eo *obj EINA_UNUSED, Elm_Map_Data *sd)
+static inline void
+_convert_map_zoom_mode(Elm_Map_Zoom_Mode *legacy_mode, Efl_Ui_Zoom_Mode *mode, Eina_Bool to_legacy)
{
- return sd->mode;
+ #define CONVERT(LEGACY_MODE, NEW_MODE) \
+ if (to_legacy && *mode == NEW_MODE) \
+ { \
+ *legacy_mode =LEGACY_MODE; \
+ return; \
+ } \
+ if (!to_legacy && *legacy_mode == LEGACY_MODE) \
+ { \
+ *mode = NEW_MODE; \
+ return; \
+ } \
+
+ CONVERT(ELM_MAP_ZOOM_MODE_MANUAL, EFL_UI_ZOOM_MODE_MANUAL)
+ CONVERT(ELM_MAP_ZOOM_MODE_AUTO_FIT, EFL_UI_ZOOM_MODE_AUTO_FIT)
+ CONVERT(ELM_MAP_ZOOM_MODE_AUTO_FILL, EFL_UI_ZOOM_MODE_AUTO_FILL)
+ CONVERT(ELM_MAP_ZOOM_MODE_LAST, EFL_UI_ZOOM_MODE_LAST)
+ CONVERT(ELM_MAP_ZOOM_MODE_LAST, EFL_UI_ZOOM_MODE_AUTO_FIT_IN)
+
+ #undef CONVERT
+}
+
+EAPI void
+elm_map_zoom_mode_set(Eo *obj, Elm_Map_Zoom_Mode mode)
+{
+ Efl_Ui_Zoom_Mode new_mode;
+
+ _convert_map_zoom_mode(&mode, &new_mode, EINA_FALSE);
+
+ efl_ui_zoom_mode_set(obj, new_mode);
+}
+
+EAPI Elm_Map_Zoom_Mode
+elm_map_zoom_mode_get(const Eo *obj)
+{
+ Efl_Ui_Zoom_Mode new_mode = efl_ui_zoom_mode_get(obj);;
+ Elm_Map_Zoom_Mode mode;
+
+ _convert_map_zoom_mode(&mode, &new_mode, EINA_TRUE);
+
+ return mode;
}
EOLIAN static void
@@ -4349,7 +4400,7 @@ _elm_map_zoom_max_set(Eo *obj EINA_UNUSED, Elm_Map_Data *sd, int zoom)
}
EOLIAN static int
-_elm_map_zoom_max_get(Eo *obj EINA_UNUSED, Elm_Map_Data *sd)
+_elm_map_zoom_max_get(const Eo *obj EINA_UNUSED, Elm_Map_Data *sd)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(sd->src_tile, -1);
@@ -4365,7 +4416,7 @@ _elm_map_zoom_min_set(Eo *obj EINA_UNUSED, Elm_Map_Data *sd, int zoom)
}
EOLIAN static int
-_elm_map_zoom_min_get(Eo *obj EINA_UNUSED, Elm_Map_Data *sd)
+_elm_map_zoom_min_get(const Eo *obj EINA_UNUSED, Elm_Map_Data *sd)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(sd->src_tile, -1);
@@ -4373,7 +4424,7 @@ _elm_map_zoom_min_get(Eo *obj EINA_UNUSED, Elm_Map_Data *sd)
}
EOLIAN static void
-_elm_map_region_bring_in(Eo *obj EINA_UNUSED, Elm_Map_Data *sd, double lon, double lat)
+_elm_map_map_region_bring_in(Eo *obj EINA_UNUSED, Elm_Map_Data *sd, double lon, double lat)
{
sd->calc_job.bring_in = EINA_TRUE;
sd->calc_job.lon = lon;
@@ -4401,7 +4452,7 @@ _elm_map_region_zoom_bring_in(Eo *obj EINA_UNUSED, Elm_Map_Data *sd, int zoom, d
}
EOLIAN static void
-_elm_map_region_get(Eo *obj EINA_UNUSED, Elm_Map_Data *sd, double *lon, double *lat)
+_elm_map_region_get(const Eo *obj EINA_UNUSED, Elm_Map_Data *sd, double *lon, double *lat)
{
double tlon, tlat;
Evas_Coord vx = 0, vy = 0, vw = 0, vh = 0;
@@ -4438,13 +4489,13 @@ _elm_map_paused_set(Eo *obj, Elm_Map_Data *sd, Eina_Bool paused)
}
EOLIAN static Eina_Bool
-_elm_map_paused_get(Eo *obj EINA_UNUSED, Elm_Map_Data *sd)
+_elm_map_paused_get(const Eo *obj EINA_UNUSED, Elm_Map_Data *sd)
{
return sd->paused;
}
EOLIAN static void
-_elm_map_rotate_set(Eo *obj EINA_UNUSED, Elm_Map_Data *sd, double degree, Evas_Coord cx, Evas_Coord cy)
+_elm_map_map_rotate_set(Eo *obj EINA_UNUSED, Elm_Map_Data *sd, double degree, Evas_Coord cx, Evas_Coord cy)
{
sd->rotate.d = degree;
sd->rotate.cx = cx;
@@ -4454,7 +4505,7 @@ _elm_map_rotate_set(Eo *obj EINA_UNUSED, Elm_Map_Data *sd, double degree, Evas_C
}
EOLIAN static void
-_elm_map_rotate_get(Eo *obj EINA_UNUSED, Elm_Map_Data *sd, double *degree, Evas_Coord *cx, Evas_Coord *cy)
+_elm_map_map_rotate_get(const Eo *obj EINA_UNUSED, Elm_Map_Data *sd, double *degree, Evas_Coord *cx, Evas_Coord *cy)
{
if (degree) *degree = sd->rotate.d;
if (cx) *cx = sd->rotate.cx;
@@ -4462,7 +4513,7 @@ _elm_map_rotate_get(Eo *obj EINA_UNUSED, Elm_Map_Data *sd, double *degree, Evas_
}
EOLIAN static void
-_elm_map_wheel_disabled_set(Eo *obj, Elm_Map_Data *sd, Eina_Bool disabled)
+_elm_map_elm_interface_scrollable_wheel_disabled_set(Eo *obj, Elm_Map_Data *sd, Eina_Bool disabled)
{
if ((!sd->wheel_disabled) && (disabled))
evas_object_event_callback_del_full
@@ -4471,16 +4522,11 @@ _elm_map_wheel_disabled_set(Eo *obj, Elm_Map_Data *sd, Eina_Bool disabled)
evas_object_event_callback_add
(obj, EVAS_CALLBACK_MOUSE_WHEEL, _mouse_wheel_cb, obj);
sd->wheel_disabled = !!disabled;
-}
-
-EOLIAN static Eina_Bool
-_elm_map_wheel_disabled_get(Eo *obj EINA_UNUSED, Elm_Map_Data *sd)
-{
- return sd->wheel_disabled;
+ elm_interface_scrollable_wheel_disabled_set(efl_super(obj, ELM_MAP_CLASS), disabled);
}
EOLIAN static void
-_elm_map_tile_load_status_get(Eo *obj EINA_UNUSED, Elm_Map_Data *sd, int *try_num, int *finish_num)
+_elm_map_tile_load_status_get(const Eo *obj EINA_UNUSED, Elm_Map_Data *sd, int *try_num, int *finish_num)
{
if (try_num) *try_num = sd->try_num;
if (finish_num) *finish_num = sd->finish_num;
@@ -4518,7 +4564,7 @@ _elm_map_user_agent_set(Eo *obj EINA_UNUSED, Elm_Map_Data *sd, const char *user_
}
EOLIAN static const char*
-_elm_map_user_agent_get(Eo *obj EINA_UNUSED, Elm_Map_Data *sd)
+_elm_map_user_agent_get(const Eo *obj EINA_UNUSED, Elm_Map_Data *sd)
{
return sd->user_agent;
}
@@ -4777,7 +4823,7 @@ _elm_map_overlay_add(Eo *obj EINA_UNUSED, Elm_Map_Data *sd, double lon, double l
}
EOLIAN static Eina_List *
-_elm_map_overlays_get(Eo *obj EINA_UNUSED, Elm_Map_Data *sd)
+_elm_map_overlays_get(const Eo *obj EINA_UNUSED, Elm_Map_Data *sd)
{
Eina_List *l;
Elm_Map_Overlay *ovl;
@@ -5436,6 +5482,18 @@ elm_map_overlay_bubble_content_clear(Elm_Map_Overlay *bubble)
evas_object_smart_changed(bubble->wsd->pan_obj);
}
+EAPI void
+elm_map_wheel_disabled_set(Evas_Object *obj, Eina_Bool disabled)
+{
+ elm_interface_scrollable_wheel_disabled_set(obj, disabled);
+}
+
+EAPI Eina_Bool
+elm_map_wheel_disabled_get(const Evas_Object *obj)
+{
+ return elm_interface_scrollable_wheel_disabled_get(obj);
+}
+
EOLIAN static Elm_Map_Overlay*
_elm_map_overlay_route_add(Eo *obj, Elm_Map_Data *sd, const Elm_Map_Route *route)
{
@@ -5601,7 +5659,7 @@ _elm_map_class_constructor(Efl_Class *klass)
}
EOLIAN const Efl_Access_Action_Data *
-_elm_map_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Map_Data *pd EINA_UNUSED)
+_elm_map_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Elm_Map_Data *pd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "move,prior", "move", "prior", _key_action_move},
diff --git a/src/lib/elementary/elm_map.eo b/src/lib/elementary/elm_map.eo
index 0862ce606c..c81f78572d 100644
--- a/src/lib/elementary/elm_map.eo
+++ b/src/lib/elementary/elm_map.eo
@@ -5,27 +5,7 @@ type Elm_Map_Overlay: __undefined_type; [[Elementary map overlay type]]
type Elm_Map_Name: __undefined_type; [[Elementary map name type]]
type Elm_Map_Name_Cb: __undefined_type; [[Elementary map name callback type]]
type Elm_Map_Name_List_Cb: __undefined_type; [[Elementary map name list callback type]]
-
-enum Elm.Map.Zoom_Mode
-{
- [[
- Set map's zoom behavior. It can be set to manual or automatic.
-
- Default value is #ELM_MAP_ZOOM_MODE_MANUAL.
-
- Values <b> don't </b> work as bitmask, only one can be chosen.
-
- Valid sizes are 2^zoom, consequently the map may be smaller
- than the scroller view.
-
- See @Elm.Map.zoom_mode.set()
- See @Elm.Map.zoom_mode.get()
- ]]
- manual, [[Zoom controlled manually by elm_map_zoom_set(). It's set by default.]]
- auto_fit, [[Zoom until map fits inside the scroll frame with no pixels outside this area.]]
- auto_fill, [[Zoom until map fills scroll, ensuring no pixels are left unfilled.]]
- last [[Sentinel value to indicate last enum field during iteration]]
-}
+type Evas.Event_Mouse_Down: __undefined_type;
enum Elm.Map.Source_Type
{
@@ -69,46 +49,15 @@ enum Elm.Map.Route_Method
}
-class Elm.Map (Elm.Widget, Elm.Interface_Scrollable,
+class Elm.Map (Efl.Ui.Widget, Elm.Interface_Scrollable,
Efl.Access.Widget.Action,
- Efl.Ui.Clickable)
+ Efl.Ui.Clickable, Efl.Ui.Legacy, Efl.Ui.Zoom)
{
[[Elementary map class]]
legacy_prefix: elm_map;
eo_prefix: elm_obj_map;
event_prefix: elm_map;
methods {
- @property zoom {
- set {
- [[Set the zoom level of the map.
-
- This sets the zoom level.
-
- It will respect limits defined by @.zoom_min.set and
- @.zoom_max.set.
-
- By default these values are 0 (world map) and 18 (maximum zoom).
-
- This function should be used when zoom mode is set to
- #ELM_MAP_ZOOM_MODE_MANUAL. This is the default mode, and
- can be set with @.zoom_mode.set.
- ]]
- }
- get {
- [[Get the zoom level of the map.
-
- This returns the current zoom level of the map object.
-
- Note that if you set the fill mode to other than
- #ELM_MAP_ZOOM_MODE_MANUAL (which is the default), the zoom
- level may be changed at any time by the map object itself
- to account for map size and map viewport size.
- ]]
- }
- values {
- zoom: int; [[The zoom level.]]
- }
- }
@property paused {
set {
[[Pause or unpause the map.
@@ -134,26 +83,6 @@ class Elm.Map (Elm.Widget, Elm.Interface_Scrollable,
to unpause it.]]
}
}
- @property wheel_disabled {
- set {
- [[Enable or disable mouse wheel to be used to zoom in / out the
- map.
-
- Wheel is enabled by default.
- ]]
- }
- get {
- [[Get a value whether mouse wheel is enabled or not.
-
- Mouse wheel can be used for the user to zoom in or zoom out
- the map.
- ]]
- }
- values {
- disabled: bool; [[Use $true to disable mouse wheel or $false
- to enable it.]]
- }
- }
@property zoom_min {
set {
[[Set the minimum zoom of the source.]]
@@ -165,12 +94,14 @@ class Elm.Map (Elm.Widget, Elm.Interface_Scrollable,
zoom: int(-1); [[Minimum zoom value to be used.]]
}
}
- @property rotate {
+ @property map_rotate {
set {
[[Rotate the map.]]
+ legacy: elm_map_rotate_set;
}
get {
[[Get the rotate degree of the map.]]
+ legacy: elm_map_rotate_get;
}
values {
degree: double; [[Angle from 0.0 to 360.0 to rotate around Z axis.]]
@@ -209,46 +140,12 @@ class Elm.Map (Elm.Widget, Elm.Interface_Scrollable,
zoom: int(-1); [[Maximum zoom value to be used.]]
}
}
- @property zoom_mode {
- set {
- [[Set the zoom mode used by the map object.
-
- This sets the zoom mode to manual or one of the automatic
- levels. Manual (#ELM_MAP_ZOOM_MODE_MANUAL) means that zoom
- is set manually by @.zoom_mode.set and will stay at that
- level until changed by code or until zoom mode is changed.
- This is the default mode.
-
- The Automatic modes will allow the map object to
- automatically adjust zoom mode based on properties.
- #ELM_MAP_ZOOM_MODE_AUTO_FIT will adjust zoom so the map
- fits inside the scroll frame with no pixels outside this
- area. #ELM_MAP_ZOOM_MODE_AUTO_FILL will be similar but
- ensure no pixels within the frame are left unfilled. Do not
- forget that the valid sizes are 2^zoom, consequently the map
- may be smaller than the scroller view.
- ]]
- }
- get {
- [[Get the zoom mode used by the map object.
-
- This function returns the current zoom mode used by the ma
- object.
- ]]
- }
- values {
- mode: Elm.Map.Zoom_Mode; [[The zoom mode of the map, being it
- one of #ELM_MAP_ZOOM_MODE_MANUAL
- (default), #ELM_MAP_ZOOM_MODE_AUTO_FIT,
- or #ELM_MAP_ZOOM_MODE_AUTO_FILL.]]
- }
- }
@property region {
get {
[[Get the current geographic coordinates of the map.
This gets the current center coordinates of the map object.
- It can be set by @.region_bring_in and @.region_show.
+ It can be set by @.map_region_bring_in and @.region_show.
]]
}
values {
@@ -469,7 +366,7 @@ class Elm.Map (Elm.Widget, Elm.Interface_Scrollable,
containing the given $lat and $lon, that will be moved to the
center of the map.
- See @.region_bring_in for a function to move with animation.
+ See @.map_region_bring_in for a function to move with animation.
]]
params {
@in lon: double; [[Longitude to center at.]]
@@ -512,7 +409,7 @@ class Elm.Map (Elm.Widget, Elm.Interface_Scrollable,
@in data: void_ptr @optional; [[The user callback data.]]
}
}
- region_bring_in {
+ map_region_bring_in {
[[Animatedly bring in given coordinates to the center of the map.
This causes map to jump to the given $lat and $lon coordinates
@@ -522,6 +419,7 @@ class Elm.Map (Elm.Widget, Elm.Interface_Scrollable,
See @.region_show for a function to avoid animation.
]]
+ legacy: elm_map_region_bring_in;
params {
@in lon: double; [[Longitude to center at.]]
@in lat: double; [[Latitude to center at.]]
@@ -535,7 +433,7 @@ class Elm.Map (Elm.Widget, Elm.Interface_Scrollable,
to the given $lat and $lon coordinates and show it (by scrolling)
in the center of the viewport concurrently.
- See also @.region_bring_in.
+ See also @.map_region_bring_in.
@since 1.11
]]
@@ -627,28 +525,32 @@ class Elm.Map (Elm.Widget, Elm.Interface_Scrollable,
implements {
class.constructor;
Efl.Object.constructor;
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set; }
+ Efl.Object.invalidate;
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
Efl.Canvas.Group.group_member_add;
- Elm.Widget.theme_apply;
- Elm.Widget.on_focus_update;
- Elm.Widget.widget_event;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Focus.Object.on_focus_update;
+ Efl.Ui.Widget.widget_event;
Efl.Access.Widget.Action.elm_actions { get; }
+ Efl.Ui.Zoom.zoom_level { set; }
+ Efl.Ui.Zoom.zoom_mode { set; }
+ Elm.Interface_Scrollable.wheel_disabled { set; }
}
events {
- press; [[Called when map was pressed]]
- zoom,change; [[Called when map zoom changed]]
- loaded; [[Called when map loaded]]
- tile,load; [[Called when title load started]]
- tile,loaded; [[Called when title load finished]]
- tile,loaded,fail; [[Called when title load failed]]
- route,load; [[Called when route load started]]
- route,loaded; [[Called when route load finished]]
- route,loaded,fail; [[Called when route load failed]]
- name,load; [[Called when name load started]]
- name,loaded; [[Called when name load finished]]
- name,loaded,fail; [[Called when name load failed]]
- overlay,clicked; [[Called when overlay was clicked]]
- overlay,del; [[Called when overlay was deleted]]
+ press: Evas.Event_Mouse_Down; [[Called when map was pressed]]
+ loaded: void; [[Called when map loaded]]
+ tile,load: void; [[Called when title load started]]
+ tile,loaded: void; [[Called when title load finished]]
+ tile,loaded,fail: void; [[Called when title load failed]]
+ route,load: Elm_Map_Route; [[Called when route load started]]
+ route,loaded: void; [[Called when route load finished]]
+ route,loaded,fail: void; [[Called when route load failed]]
+ /* FIXME: Can be Elm_Map_Name or list<Elm_Map_Name> */
+ name,load: void; [[Called when name load started]]
+ name,loaded: void; [[Called when name load finished]]
+ name,loaded,fail: void; [[Called when name load failed]]
+ overlay,clicked: Elm_Map_Overlay; [[Called when overlay was clicked]]
+ overlay,del: Elm_Map_Overlay; [[Called when overlay was deleted]]
}
}
diff --git a/src/lib/elementary/elm_map_legacy.h b/src/lib/elementary/elm_map_legacy.h
index ff0facdb93..b919b508b0 100644
--- a/src/lib/elementary/elm_map_legacy.h
+++ b/src/lib/elementary/elm_map_legacy.h
@@ -1,3 +1,30 @@
+
+/**
+ * @brief Set map's zoom behavior. It can be set to manual or automatic.
+ *
+ * Default value is #ELM_MAP_ZOOM_MODE_MANUAL.
+ *
+ * Values <b> don't </b> work as bitmask, only one can be chosen.
+ *
+ * Valid sizes are 2^zoom, consequently the map may be smaller than the
+ * scroller view.
+ *
+ * See @ref elm_map_zoom_mode_set() See @ref elm_map_zoom_mode_get()
+ *
+ * @ingroup Elm_Map
+ */
+typedef enum
+{
+ ELM_MAP_ZOOM_MODE_MANUAL = 0, /**< Zoom controlled manually by
+ * elm_map_zoom_set(). It's set by default. */
+ ELM_MAP_ZOOM_MODE_AUTO_FIT, /**< Zoom until map fits inside the scroll frame
+ * with no pixels outside this area. */
+ ELM_MAP_ZOOM_MODE_AUTO_FILL, /**< Zoom until map fills scroll, ensuring no
+ * pixels are left unfilled. */
+ ELM_MAP_ZOOM_MODE_LAST /**< Sentinel value to indicate last enum field during
+ * iteration */
+} Elm_Map_Zoom_Mode;
+
/**
* Add a new map widget to the given parent Elementary (container) object.
*
@@ -10,4 +37,108 @@
*/
EAPI Evas_Object *elm_map_add(Evas_Object *parent);
+
+/**
+ * @brief Set the zoom level of the map.
+ *
+ * This sets the zoom level.
+ *
+ * It will respect limits defined by @ref elm_map_zoom_min_set and
+ * @ref elm_map_zoom_max_set.
+ *
+ * By default these values are 0 (world map) and 18 (maximum zoom).
+ *
+ * This function should be used when zoom mode is set to
+ * #ELM_MAP_ZOOM_MODE_MANUAL. This is the default mode, and can be set with
+ * @ref elm_map_zoom_mode_set.
+ *
+ * @param[in] obj The object.
+ * @param[in] zoom The zoom level.
+ *
+ * @ingroup Elm_Map
+ */
+EAPI void elm_map_zoom_set(Evas_Object *obj, int zoom);
+
+/**
+ * @brief Get the zoom level of the map.
+ *
+ * This returns the current zoom level of the map object.
+ *
+ * Note that if you set the fill mode to other than #ELM_MAP_ZOOM_MODE_MANUAL
+ * (which is the default), the zoom level may be changed at any time by the map
+ * object itself to account for map size and map viewport size.
+ *
+ * @param[in] obj The object.
+ *
+ * @return The zoom level.
+ *
+ * @ingroup Elm_Map
+ */
+EAPI int elm_map_zoom_get(const Evas_Object *obj);
+
+
+/**
+ * @brief Set the zoom mode used by the map object.
+ *
+ * This sets the zoom mode to manual or one of the automatic levels. Manual
+ * (#ELM_MAP_ZOOM_MODE_MANUAL) means that zoom is set manually by
+ * @ref elm_map_zoom_mode_set and will stay at that level until changed by code
+ * or until zoom mode is changed. This is the default mode.
+ *
+ * The Automatic modes will allow the map object to automatically adjust zoom
+ * mode based on properties. #ELM_MAP_ZOOM_MODE_AUTO_FIT will adjust zoom so
+ * the map fits inside the scroll frame with no pixels outside this area.
+ * #ELM_MAP_ZOOM_MODE_AUTO_FILL will be similar but ensure no pixels within the
+ * frame are left unfilled. Do not forget that the valid sizes are 2^zoom,
+ * consequently the map may be smaller than the scroller view.
+ *
+ * @param[in] obj The object.
+ * @param[in] mode The zoom mode of the map, being it one of
+ * #ELM_MAP_ZOOM_MODE_MANUAL (default), #ELM_MAP_ZOOM_MODE_AUTO_FIT, or
+ * #ELM_MAP_ZOOM_MODE_AUTO_FILL.
+ *
+ * @ingroup Elm_Map
+ */
+EAPI void elm_map_zoom_mode_set(Evas_Object *obj, Elm_Map_Zoom_Mode mode);
+
+/**
+ * @brief Get the zoom mode used by the map object.
+ *
+ * This function returns the current zoom mode used by the ma object.
+ *
+ * @param[in] obj The object.
+ *
+ * @return The zoom mode of the map, being it one of #ELM_MAP_ZOOM_MODE_MANUAL
+ * (default), #ELM_MAP_ZOOM_MODE_AUTO_FIT, or #ELM_MAP_ZOOM_MODE_AUTO_FILL.
+ *
+ * @ingroup Elm_Map
+ */
+EAPI Elm_Map_Zoom_Mode elm_map_zoom_mode_get(const Evas_Object *obj);
+
+/**
+ * @brief Enable or disable mouse wheel to be used to zoom in / out the map.
+ *
+ * Wheel is enabled by default.
+ *
+ * @param[in] obj The object.
+ * @param[in] disabled Use @c true to disable mouse wheel or @c false to enable
+ * it.
+ *
+ * @ingroup Elm_Map
+ */
+EAPI void elm_map_wheel_disabled_set(Evas_Object *obj, Eina_Bool disabled);
+
+/**
+ * @brief Get a value whether mouse wheel is enabled or not.
+ *
+ * Mouse wheel can be used for the user to zoom in or zoom out the map.
+ *
+ * @param[in] obj The object.
+ *
+ * @return Use @c true to disable mouse wheel or @c false to enable it.
+ *
+ * @ingroup Elm_Map
+ */
+EAPI Eina_Bool elm_map_wheel_disabled_get(const Evas_Object *obj);
+
#include "elm_map.eo.legacy.h"
diff --git a/src/lib/elementary/elm_map_pan.eo b/src/lib/elementary/elm_map_pan.eo
index 7f172a6ca8..d32faa0762 100644
--- a/src/lib/elementary/elm_map_pan.eo
+++ b/src/lib/elementary/elm_map_pan.eo
@@ -7,8 +7,8 @@ class Elm.Map.Pan (Elm.Pan)
implements {
class.constructor;
Efl.Object.destructor;
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set; }
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
Efl.Canvas.Group.group_calculate;
Elm.Pan.content_size { get; }
Elm.Pan.pos { get; set; }
@@ -16,6 +16,7 @@ class Elm.Map.Pan (Elm.Pan)
Elm.Pan.pos_max { get; }
}
events {
+ /* FIXME: Nobody is emitting these
loaded; [[Called when map loaded]]
tile,load; [[Called when map tile loading started]]
tile,loaded; [[Called when map tile loading finished]]
@@ -28,5 +29,6 @@ class Elm.Map.Pan (Elm.Pan)
name,loaded,fail; [[Called when name loading failed]]
overlay,clicked; [[Called when overlay was clicked]]
overlay,del; [[Called when overlay was deleted]]
+ */
}
}
diff --git a/src/lib/elementary/elm_mapbuf.c b/src/lib/elementary/elm_mapbuf.c
index 97ab0d3259..8be2124a6c 100644
--- a/src/lib/elementary/elm_mapbuf.c
+++ b/src/lib/elementary/elm_mapbuf.c
@@ -2,7 +2,8 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
+#define EFL_PART_PROTECTED
#include <Elementary.h>
@@ -36,7 +37,7 @@ _sizing_eval(Evas_Object *obj)
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_mapbuf_elm_widget_theme_apply(Eo *obj, Elm_Mapbuf_Data *sd EINA_UNUSED)
+_elm_mapbuf_efl_ui_widget_theme_apply(Eo *obj, Elm_Mapbuf_Data *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
@@ -75,7 +76,7 @@ _elm_mapbuf_content_unset_internal(Elm_Mapbuf_Data *sd, Evas_Object *obj,
}
EOLIAN static Eina_Bool
-_elm_mapbuf_elm_widget_widget_sub_object_del(Eo *obj, Elm_Mapbuf_Data *sd, Evas_Object *sobj)
+_elm_mapbuf_efl_ui_widget_widget_sub_object_del(Eo *obj, Elm_Mapbuf_Data *sd, Evas_Object *sobj)
{
Eina_Bool int_ret = EINA_FALSE;
int_ret = elm_widget_sub_object_del(efl_super(obj, MY_CLASS), sobj);
@@ -156,12 +157,12 @@ _mapbuf_auto_smooth(Evas_Object *obj EINA_UNUSED, Elm_Mapbuf_Data *sd)
}
EOLIAN static void
-_elm_mapbuf_efl_gfx_position_set(Eo *obj, Elm_Mapbuf_Data *sd, Eina_Position2D pos)
+_elm_mapbuf_efl_gfx_entity_position_set(Eo *obj, Elm_Mapbuf_Data *sd, Eina_Position2D pos)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
- efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
_mapbuf_auto_eval(obj, sd);
_mapbuf_auto_smooth(obj, sd);
@@ -169,26 +170,26 @@ _elm_mapbuf_efl_gfx_position_set(Eo *obj, Elm_Mapbuf_Data *sd, Eina_Position2D p
}
EOLIAN static void
-_elm_mapbuf_efl_gfx_size_set(Eo *obj, Elm_Mapbuf_Data *sd, Eina_Size2D sz)
+_elm_mapbuf_efl_gfx_entity_size_set(Eo *obj, Elm_Mapbuf_Data *sd, Eina_Size2D sz)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
- efl_gfx_size_set(efl_super(obj, MY_CLASS), sz);
+ efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
if (sd->content)
- efl_gfx_size_set(sd->content, sz);
+ efl_gfx_entity_size_set(sd->content, sz);
_mapbuf_auto_eval(obj, sd);
_configure(obj);
}
EOLIAN static void
-_elm_mapbuf_efl_gfx_visible_set(Eo *obj, Elm_Mapbuf_Data *sd, Eina_Bool vis)
+_elm_mapbuf_efl_gfx_entity_visible_set(Eo *obj, Elm_Mapbuf_Data *sd, Eina_Bool vis)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 0, vis))
return;
- efl_gfx_visible_set(efl_super(obj, MY_CLASS), vis);
+ efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), vis);
_mapbuf_auto_eval(obj, sd);
_configure(obj);
@@ -227,7 +228,7 @@ _elm_mapbuf_content_set(Eo *obj, Elm_Mapbuf_Data *sd, const char *part, Evas_Obj
}
static Evas_Object*
-_elm_mapbuf_content_get(Eo *obj EINA_UNUSED, Elm_Mapbuf_Data *sd, const char *part)
+_elm_mapbuf_content_get(const Eo *obj EINA_UNUSED, Elm_Mapbuf_Data *sd, const char *part)
{
if (part && strcmp(part, "default")) return NULL;
return sd->content;
@@ -253,7 +254,7 @@ _elm_mapbuf_efl_content_content_set(Eo *obj, Elm_Mapbuf_Data *sd, Evas_Object *c
}
EOLIAN static Evas_Object*
-_elm_mapbuf_efl_content_content_get(Eo *obj, Elm_Mapbuf_Data *sd)
+_elm_mapbuf_efl_content_content_get(const Eo *obj, Elm_Mapbuf_Data *sd)
{
return _elm_mapbuf_content_get(obj, sd, NULL);
}
@@ -317,7 +318,7 @@ _elm_mapbuf_efl_object_constructor(Eo *obj, Elm_Mapbuf_Data *sd EINA_UNUSED)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_IMAGE_MAP);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_IMAGE_MAP);
return obj;
}
@@ -345,7 +346,7 @@ _elm_mapbuf_enabled_set(Eo *obj, Elm_Mapbuf_Data *sd, Eina_Bool enabled)
}
EOLIAN static Eina_Bool
-_elm_mapbuf_enabled_get(Eo *obj EINA_UNUSED, Elm_Mapbuf_Data *sd)
+_elm_mapbuf_enabled_get(const Eo *obj EINA_UNUSED, Elm_Mapbuf_Data *sd)
{
return sd->enabled;
}
@@ -360,7 +361,7 @@ _elm_mapbuf_smooth_set(Eo *obj, Elm_Mapbuf_Data *sd, Eina_Bool smooth)
}
EOLIAN static Eina_Bool
-_elm_mapbuf_smooth_get(Eo *obj EINA_UNUSED, Elm_Mapbuf_Data *sd)
+_elm_mapbuf_smooth_get(const Eo *obj EINA_UNUSED, Elm_Mapbuf_Data *sd)
{
return sd->smooth;
}
@@ -374,7 +375,7 @@ _elm_mapbuf_alpha_set(Eo *obj, Elm_Mapbuf_Data *sd, Eina_Bool alpha)
}
EOLIAN static Eina_Bool
-_elm_mapbuf_alpha_get(Eo *obj EINA_UNUSED, Elm_Mapbuf_Data *sd)
+_elm_mapbuf_alpha_get(const Eo *obj EINA_UNUSED, Elm_Mapbuf_Data *sd)
{
return sd->alpha;
}
@@ -398,13 +399,13 @@ _elm_mapbuf_auto_set(Eo *obj, Elm_Mapbuf_Data *sd, Eina_Bool on)
}
EOLIAN static Eina_Bool
-_elm_mapbuf_auto_get(Eo *obj EINA_UNUSED, Elm_Mapbuf_Data *sd)
+_elm_mapbuf_auto_get(const Eo *obj EINA_UNUSED, Elm_Mapbuf_Data *sd)
{
return sd->automode;
}
EOLIAN static void
-_elm_mapbuf_point_color_get(Eo *obj EINA_UNUSED, Elm_Mapbuf_Data *sd, int idx, int *r, int *g, int *b, int *a)
+_elm_mapbuf_point_color_get(const Eo *obj EINA_UNUSED, Elm_Mapbuf_Data *sd, int idx, int *r, int *g, int *b, int *a)
{
if ((idx < 0) || (idx >= 4))
{
diff --git a/src/lib/elementary/elm_mapbuf.eo b/src/lib/elementary/elm_mapbuf.eo
index 1ac1d3544c..2aba973358 100644
--- a/src/lib/elementary/elm_mapbuf.eo
+++ b/src/lib/elementary/elm_mapbuf.eo
@@ -1,4 +1,4 @@
-class Elm.Mapbuf (Elm.Widget, Efl.Content, Efl.Part)
+class Elm.Mapbuf (Efl.Ui.Widget, Efl.Content, Efl.Part, Efl.Ui.Legacy)
{
[[Elementary mapbuf class]]
legacy_prefix: elm_mapbuf;
@@ -116,13 +116,13 @@ class Elm.Mapbuf (Elm.Widget, Efl.Content, Efl.Part)
implements {
class.constructor;
Efl.Object.constructor;
- Efl.Gfx.visible { set; }
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set; }
- Elm.Widget.theme_apply;
- Elm.Widget.widget_sub_object_del;
+ Efl.Gfx.Entity.visible { set; }
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.widget_sub_object_del;
Efl.Content.content { get; set; }
Efl.Content.content_unset;
- Efl.Part.part;
+ Efl.Part.part_get;
}
}
diff --git a/src/lib/elementary/elm_mapbuf_part.eo b/src/lib/elementary/elm_mapbuf_part.eo
index 9ed7c29907..aba7f02eb3 100644
--- a/src/lib/elementary/elm_mapbuf_part.eo
+++ b/src/lib/elementary/elm_mapbuf_part.eo
@@ -1,4 +1,4 @@
-class Elm.Mapbuf.Part (Efl.Ui.Widget.Part, Efl.Content)
+class Elm.Mapbuf.Part (Efl.Ui.Widget_Part, Efl.Content)
{
[[Elementary mapbuf internal part class]]
data: null;
diff --git a/src/lib/elementary/elm_menu.c b/src/lib/elementary/elm_menu.c
index 92ef38dfca..60069c8ba3 100644
--- a/src/lib/elementary/elm_menu.c
+++ b/src/lib/elementary/elm_menu.c
@@ -3,10 +3,11 @@
#endif
#define ELM_WIDGET_PROTECTED
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_SELECTION_PROTECTED
#define ELM_WIDGET_ITEM_PROTECTED
#define EFL_UI_TRANSLATABLE_PROTECTED
+#define EFL_UI_WIDGET_FOCUS_MANAGER_PROTECTED
#include <Elementary.h>
@@ -100,11 +101,11 @@ _parent_geometry_get(Elm_Menu_Data *sd, int *x, int *y, int *w, int *h)
{
Eina_Rect r;
- r = efl_gfx_geometry_get(sd->parent);
+ r = efl_gfx_entity_geometry_get(sd->parent);
if (efl_isa(sd->parent, EFL_UI_WIN_CLASS))
{
if (sd->menu_bar && efl_canvas_object_is_frame_object_get(sd->obj))
- r.pos = efl_gfx_position_get(sd->obj);
+ r.pos = efl_gfx_entity_position_get(sd->obj);
else
r.pos = EINA_POSITION2D(0, 0);
}
@@ -214,12 +215,12 @@ _sizing_eval(Evas_Object *obj)
if (y_p + h_p + bh > y2 + h2) y_p -= y_p + h_p + bh - (y2 + h2);
if (y_p < y2) y_p = y2;
- efl_gfx_geometry_set(sd->location, EINA_RECT(x_p, y_p, bw, h_p));
+ efl_gfx_entity_geometry_set(sd->location, EINA_RECT(x_p, y_p, bw, h_p));
evas_object_size_hint_min_set(sd->location, bw, h_p);
evas_object_size_hint_max_set(sd->location, bw, h_p);
elm_hover_target_set(sd->hv, sd->location);
- hover = efl_data_scope_get(sd->hv, ELM_WIDGET_CLASS);
+ hover = efl_data_scope_get(sd->hv, EFL_UI_WIDGET_CLASS);
edje_object_part_geometry_get(hover->resize_obj, "bottom", NULL,
NULL, &bw, &bh);
evas_object_size_hint_min_set(obj, bw, bh);
@@ -232,7 +233,7 @@ _sizing_eval(Evas_Object *obj)
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_menu_elm_widget_theme_apply(Eo *obj, Elm_Menu_Data *sd)
+_elm_menu_efl_ui_widget_theme_apply(Eo *obj, Elm_Menu_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
@@ -295,7 +296,7 @@ _elm_menu_elm_widget_theme_apply(Eo *obj, Elm_Menu_Data *sd)
elm_wdg_item_disable(eo_item);
/* SEOZ
edje_object_scale_set
- (VIEW(item), efl_gfx_scale_get(obj) *
+ (VIEW(item), efl_gfx_entity_scale_get(obj) *
elm_config_scale_get());
*/
}
@@ -330,7 +331,7 @@ _elm_menu_item_elm_widget_item_part_text_set(Eo *eo_item EINA_UNUSED,
}
EOLIAN static const char *
-_elm_menu_item_elm_widget_item_part_text_get(Eo *eo_item EINA_UNUSED,
+_elm_menu_item_elm_widget_item_part_text_get(const Eo *eo_item EINA_UNUSED,
Elm_Menu_Item_Data *it,
const char *part)
{
@@ -358,7 +359,7 @@ _elm_menu_item_elm_widget_item_part_content_set(Eo *eo_item EINA_UNUSED,
}
EOLIAN static Evas_Object *
-_elm_menu_item_elm_widget_item_part_content_get(Eo *eo_item EINA_UNUSED,
+_elm_menu_item_elm_widget_item_part_content_get(const Eo *eo_item EINA_UNUSED,
Elm_Menu_Item_Data *it,
const char *part)
{
@@ -498,7 +499,7 @@ _menu_item_activate_cb(void *data,
if (eo_item2 != EO_OBJ(item))
elm_menu_item_selected_set(eo_item2, 0);
}
- efl_access_event_emit(EFL_ACCESS_MIXIN, EO_OBJ(item->parent), EFL_ACCESS_SELECTION_EVENT_SELECTION_CHANGED, NULL);
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, EO_OBJ(item->parent), EFL_ACCESS_SELECTION_EVENT_SELECTION_CHANGED, NULL);
}
else
{
@@ -513,7 +514,7 @@ _menu_item_activate_cb(void *data,
elm_menu_item_selected_set(eo_item2, 0);
}
}
- efl_access_event_emit(EFL_ACCESS_MIXIN, WIDGET(item), EFL_ACCESS_SELECTION_EVENT_SELECTION_CHANGED, NULL);
+ efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, WIDGET(item), EFL_ACCESS_SELECTION_EVENT_SELECTION_CHANGED, NULL);
if (sd->menu_bar && was_open)
_menu_item_select_cb(item, NULL, NULL, NULL);
}
@@ -567,20 +568,20 @@ _unblock_menu(void *_sd, const Efl_Event *event EINA_UNUSED)
}
EOLIAN static void
-_elm_menu_efl_gfx_visible_set(Eo *obj EINA_UNUSED, Elm_Menu_Data *sd, Eina_Bool vis)
+_elm_menu_efl_gfx_entity_visible_set(Eo *obj EINA_UNUSED, Elm_Menu_Data *sd, Eina_Bool vis)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 0, vis))
return;
- efl_gfx_visible_set(efl_super(obj, MY_CLASS), vis);
- if (vis) efl_gfx_visible_set(sd->hv, EINA_TRUE);
+ efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), vis);
+ if (vis) efl_gfx_entity_visible_set(sd->hv, EINA_TRUE);
}
static void
_item_obj_create(Elm_Menu_Item_Data *item)
{
- VIEW(item) = elm_layout_add(WIDGET(item));
- efl_access_type_set(VIEW(item), EFL_ACCESS_TYPE_SKIPPED);
+ VIEW_SET(item, elm_layout_add(WIDGET(item)));
+ efl_access_object_access_type_set(VIEW(item), EFL_ACCESS_TYPE_SKIPPED);
evas_object_size_hint_weight_set
(VIEW(item), EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_fill_set(VIEW(item), EVAS_HINT_FILL, EVAS_HINT_FILL);
@@ -603,8 +604,8 @@ _item_obj_create(Elm_Menu_Item_Data *item)
static void
_item_separator_obj_create(Elm_Menu_Item_Data *item)
{
- VIEW(item) = elm_layout_add(WIDGET(item));
- efl_access_type_set(VIEW(item), EFL_ACCESS_TYPE_SKIPPED);
+ VIEW_SET(item, elm_layout_add(WIDGET(item)));
+ efl_access_object_access_type_set(VIEW(item), EFL_ACCESS_TYPE_SKIPPED);
evas_object_size_hint_weight_set
(VIEW(item), EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_fill_set(VIEW(item), EVAS_HINT_FILL, EVAS_HINT_FILL);
@@ -627,9 +628,9 @@ _item_submenu_obj_create(Elm_Menu_Item_Data *item)
char style[1024];
item->submenu.location = elm_icon_add(sd->bx);
- efl_access_type_set(item->submenu.location, EFL_ACCESS_TYPE_DISABLED);
+ efl_access_object_access_type_set(item->submenu.location, EFL_ACCESS_TYPE_DISABLED);
item->submenu.hv = hv = elm_hover_add(sd->bx);
- efl_access_type_set(item->submenu.hv, EFL_ACCESS_TYPE_SKIPPED);
+ efl_access_object_access_type_set(item->submenu.hv, EFL_ACCESS_TYPE_SKIPPED);
efl_ui_mirrored_set(hv, EINA_FALSE);
elm_hover_target_set(hv, item->submenu.location);
elm_hover_parent_set(hv, sd->parent);
@@ -695,10 +696,10 @@ _elm_menu_efl_canvas_group_group_add(Eo *obj, Elm_Menu_Data *priv)
elm_widget_can_focus_set(obj, EINA_FALSE);
priv->location = elm_icon_add(obj);
- efl_access_type_set(priv->location, EFL_ACCESS_TYPE_DISABLED);
+ efl_access_object_access_type_set(priv->location, EFL_ACCESS_TYPE_DISABLED);
priv->hv = elm_hover_add(obj);
- efl_access_type_set(priv->hv, EFL_ACCESS_TYPE_SKIPPED);
+ efl_access_object_access_type_set(priv->hv, EFL_ACCESS_TYPE_SKIPPED);
efl_ui_mirrored_set(priv->hv, EINA_FALSE);
elm_object_style_set(priv->hv, "menu/default");
@@ -706,7 +707,7 @@ _elm_menu_efl_canvas_group_group_add(Eo *obj, Elm_Menu_Data *priv)
(priv->hv, ELM_HOVER_EVENT_DISMISSED, _hover_dismissed_cb, obj);
priv->bx = elm_box_add(obj);
- efl_access_type_set(priv->bx, EFL_ACCESS_TYPE_SKIPPED);
+ efl_access_object_access_type_set(priv->bx, EFL_ACCESS_TYPE_SKIPPED);
efl_ui_mirrored_set(priv->bx, EINA_FALSE);
evas_object_size_hint_weight_set
(priv->bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -804,7 +805,7 @@ elm_menu_add(Evas_Object *parent)
}
EOLIAN static Efl_Ui_Focus_Manager*
-_elm_menu_elm_widget_focus_manager_create(Eo *obj EINA_UNUSED, Elm_Menu_Data *pd EINA_UNUSED, Efl_Ui_Focus_Object *root)
+_elm_menu_efl_ui_widget_focus_manager_focus_manager_create(Eo *obj EINA_UNUSED, Elm_Menu_Data *pd EINA_UNUSED, Efl_Ui_Focus_Object *root)
{
Efl_Ui_Focus_Manager *manager;
@@ -819,17 +820,12 @@ EOLIAN static Eo *
_elm_menu_efl_object_constructor(Eo *obj, Elm_Menu_Data *sd)
{
Eo *parent = NULL;
- Efl_Ui_Focus_Manager *manager;
-
- manager = efl_ui_widget_focus_manager_create(obj, obj);
- efl_composite_attach(obj, manager);
- _efl_ui_focus_manager_redirect_events_add(manager, obj);
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
parent = efl_parent_get(obj);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_MENU);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_MENU);
elm_menu_parent_set(obj, parent);
elm_hover_target_set(sd->hv, sd->location);
@@ -853,7 +849,7 @@ _elm_menu_efl_object_destructor(Eo *obj, Elm_Menu_Data *sd)
Eina_List *itr, *itr2;
Elm_Object_Item *eo_item;
EINA_LIST_FOREACH_SAFE(sd->items, itr, itr2, eo_item)
- elm_wdg_item_del(eo_item);
+ efl_del(eo_item);
efl_destructor(efl_super(obj, MY_CLASS));
}
@@ -867,7 +863,7 @@ elm_menu_parent_set(Evas_Object *obj,
}
EOLIAN static void
-_elm_menu_elm_widget_widget_parent_set(Eo *obj, Elm_Menu_Data *sd, Evas_Object *parent)
+_elm_menu_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Menu_Data *sd, Evas_Object *parent)
{
Eina_List *l, *_l, *_ll, *ll = NULL;
Elm_Object_Item *eo_item;
@@ -916,72 +912,14 @@ elm_menu_parent_get(const Evas_Object *obj)
return efl_ui_widget_parent_get(obj);
}
-EAPI Elm_Widget_Item *
-elm_menu_selected_item_get(const Evas_Object *obj)
-{
- return efl_ui_menu_selected_item_get(obj);
-}
-
-EAPI const Eina_List *
-elm_menu_items_get(const Evas_Object *obj)
-{
- Eina_List *lst = NULL;
- Eina_Iterator *it;
- void *item_data;
-
- it = efl_ui_menu_items_get(obj);
- EINA_ITERATOR_FOREACH(it, item_data)
- {
- lst = eina_list_append(lst, item_data);
- }
- eina_iterator_free(it);
- return lst;
-}
-
-EAPI Elm_Widget_Item *
-elm_menu_first_item_get(const Evas_Object *obj)
-{
- return efl_ui_menu_first_item_get(obj);
-}
-
-EAPI Elm_Widget_Item *
-elm_menu_last_item_get(const Evas_Object *obj)
-{
- return efl_ui_menu_last_item_get(obj);
-}
-
-EAPI void
-elm_menu_item_selected_set(Evas_Object *obj, Eina_Bool selected)
-{
- efl_ui_item_selected_set(obj, selected);
-}
-
-EAPI Eina_Bool
-elm_menu_item_selected_get(const Evas_Object *obj)
-{
- return efl_ui_item_selected_get(obj);
-}
-
-EAPI Elm_Widget_Item *
-elm_menu_item_prev_get(const Evas_Object *obj)
-{
- return efl_ui_item_prev_get(obj);
-}
-
-EAPI Elm_Widget_Item *
-elm_menu_item_next_get(const Evas_Object *obj)
-{
- return efl_ui_item_next_get(obj);
-}
-
EOLIAN static Evas_Object*
-_elm_menu_elm_widget_widget_parent_get(Eo *obj EINA_UNUSED, Elm_Menu_Data *sd)
+_elm_menu_efl_ui_widget_widget_parent_get(const Eo *obj EINA_UNUSED, Elm_Menu_Data *sd)
{
return sd->parent;
}
EOLIAN static void
-_elm_menu_move(Eo *obj, Elm_Menu_Data *sd, Evas_Coord x, Evas_Coord y)
+_elm_menu_relative_move(Eo *obj, Elm_Menu_Data *sd, Evas_Coord x, Evas_Coord y)
{
sd->xloc = x;
sd->yloc = y;
@@ -1115,7 +1053,7 @@ _elm_menu_item_add(Eo *obj, Elm_Menu_Data *sd, Elm_Object_Item *parent, const ch
Evas_Object *icon_obj;
icon_obj = elm_icon_add(obj);
- efl_access_type_set(icon_obj, EFL_ACCESS_TYPE_DISABLED);
+ efl_access_object_access_type_set(icon_obj, EFL_ACCESS_TYPE_DISABLED);
if (!icon_obj) return NULL;
eo_item = efl_add(ELM_MENU_ITEM_CLASS, obj);
@@ -1237,7 +1175,7 @@ _elm_menu_item_separator_add(Eo *obj, Elm_Menu_Data *sd, Elm_Object_Item *eo_p_i
}
EOLIAN static const char *
-_elm_menu_item_icon_name_get(Eo *eo_item EINA_UNUSED, Elm_Menu_Item_Data *item)
+_elm_menu_item_icon_name_get(const Eo *eo_item EINA_UNUSED, Elm_Menu_Item_Data *item)
{
return item->icon_str;
}
@@ -1262,17 +1200,17 @@ _elm_menu_item_subitems_clear(Eo *eo_item EINA_UNUSED, Elm_Menu_Item_Data *it)
EINA_LIST_FOREACH_SAFE(it->submenu.items,
l, l_next, sub_it)
- elm_wdg_item_del(sub_it);
+ efl_del(sub_it);
}
-EOLIAN static Eina_Iterator*
-_elm_menu_efl_ui_menu_items_get(Eo *obj EINA_UNUSED, Elm_Menu_Data *sd)
+EOLIAN static const Eina_List *
+_elm_menu_items_get(const Eo *obj EINA_UNUSED, Elm_Menu_Data *sd)
{
- return eina_list_iterator_new(sd->items);
+ return sd->items;
}
EOLIAN static void
-_elm_menu_item_efl_ui_item_selected_set(Eo *eo_item EINA_UNUSED,
+_elm_menu_item_selected_set(Eo *eo_item EINA_UNUSED,
Elm_Menu_Item_Data *item,
Eina_Bool selected)
{
@@ -1292,13 +1230,13 @@ _elm_menu_item_efl_ui_item_selected_set(Eo *eo_item EINA_UNUSED,
}
EOLIAN static Eina_Bool
-_elm_menu_item_efl_ui_item_selected_get(Eo *eo_item EINA_UNUSED, Elm_Menu_Item_Data *item)
+_elm_menu_item_selected_get(const Eo *eo_item EINA_UNUSED, Elm_Menu_Item_Data *item)
{
return item->selected;
}
EOLIAN static Elm_Object_Item *
-_elm_menu_item_efl_ui_item_prev_get(Eo *eo_item, Elm_Menu_Item_Data *item)
+_elm_menu_item_prev_get(const Eo *eo_item, Elm_Menu_Item_Data *item)
{
if (item->parent)
{
@@ -1322,7 +1260,7 @@ _elm_menu_item_efl_ui_item_prev_get(Eo *eo_item, Elm_Menu_Item_Data *item)
}
EOLIAN static Elm_Object_Item *
-_elm_menu_item_efl_ui_item_next_get(Eo *eo_item, Elm_Menu_Item_Data *item)
+_elm_menu_item_next_get(const Eo *eo_item, Elm_Menu_Item_Data *item)
{
if (item->parent)
{
@@ -1346,20 +1284,20 @@ _elm_menu_item_efl_ui_item_next_get(Eo *eo_item, Elm_Menu_Item_Data *item)
}
EOLIAN static Elm_Object_Item*
-_elm_menu_efl_ui_menu_first_item_get(Eo *obj EINA_UNUSED, Elm_Menu_Data *sd)
+_elm_menu_first_item_get(const Eo *obj EINA_UNUSED, Elm_Menu_Data *sd)
{
return (sd->items ? sd->items->data : NULL);
}
EOLIAN static Elm_Object_Item*
-_elm_menu_efl_ui_menu_last_item_get(Eo *obj EINA_UNUSED, Elm_Menu_Data *sd)
+_elm_menu_last_item_get(const Eo *obj EINA_UNUSED, Elm_Menu_Data *sd)
{
Eina_List *l = eina_list_last(sd->items);
return (l ? l->data : NULL);
}
EOLIAN static Elm_Object_Item*
-_elm_menu_efl_ui_menu_selected_item_get(Eo *obj EINA_UNUSED, Elm_Menu_Data *sd)
+_elm_menu_selected_item_get(const Eo *obj EINA_UNUSED, Elm_Menu_Data *sd)
{
Eina_List *l;
Elm_Object_Item *eo_item;
@@ -1380,45 +1318,47 @@ _elm_menu_class_constructor(Efl_Class *klass)
}
EOLIAN static Eina_List*
-_elm_menu_efl_access_children_get(Eo *obj, Elm_Menu_Data *sd)
+_elm_menu_efl_access_object_access_children_get(const Eo *obj, Elm_Menu_Data *sd)
{
Eina_List *ret;
- ret = efl_access_children_get(efl_super(obj, ELM_MENU_CLASS));
+ ret = efl_access_object_access_children_get(efl_super(obj, ELM_MENU_CLASS));
return eina_list_merge(eina_list_clone(sd->items), ret);
}
EOLIAN static Eina_List*
-_elm_menu_item_efl_access_children_get(Eo *obj EINA_UNUSED, Elm_Menu_Item_Data *sd)
+_elm_menu_item_efl_access_object_access_children_get(const Eo *obj EINA_UNUSED, Elm_Menu_Item_Data *sd)
{
return eina_list_clone(sd->submenu.items);
}
-EOLIAN static Efl_Access*
-_elm_menu_item_efl_access_parent_get(Eo *obj EINA_UNUSED, Elm_Menu_Item_Data *sd)
+EOLIAN static Eo*
+_elm_menu_item_efl_object_parent_get(const Eo *obj, Elm_Menu_Item_Data *sd)
{
- return sd->parent ? EO_OBJ(sd->parent) : WIDGET(sd);
+ if (sd->parent) return EO_OBJ(sd->parent);
+ if (sd->base) return WIDGET(sd);
+ return efl_parent_get(efl_super(obj, ELM_MENU_ITEM_CLASS));
}
EOLIAN static Efl_Access_Role
-_elm_menu_item_efl_access_role_get(Eo *obj EINA_UNUSED, Elm_Menu_Item_Data *sd)
+_elm_menu_item_efl_access_object_role_get(const Eo *obj EINA_UNUSED, Elm_Menu_Item_Data *sd)
{
return sd->submenu.items ? EFL_ACCESS_ROLE_MENU : EFL_ACCESS_ROLE_MENU_ITEM;
}
EOLIAN static const char*
-_elm_menu_item_efl_access_name_get(Eo *obj, Elm_Menu_Item_Data *sd)
+_elm_menu_item_efl_access_object_i18n_name_get(const Eo *obj, Elm_Menu_Item_Data *sd)
{
const char *ret;
- ret = efl_access_name_get(efl_super(obj, ELM_MENU_ITEM_CLASS));
+ ret = efl_access_object_i18n_name_get(efl_super(obj, ELM_MENU_ITEM_CLASS));
if (ret) return ret;
return sd->label;
}
EOLIAN static Efl_Access_State_Set
-_elm_menu_item_efl_access_state_set_get(Eo *obj EINA_UNUSED, Elm_Menu_Item_Data *sd)
+_elm_menu_item_efl_access_object_state_set_get(const Eo *obj EINA_UNUSED, Elm_Menu_Item_Data *sd)
{
Efl_Access_State_Set ret;
- ret = efl_access_state_set_get(efl_super(obj, ELM_MENU_ITEM_CLASS));
+ ret = efl_access_object_state_set_get(efl_super(obj, ELM_MENU_ITEM_CLASS));
STATE_TYPE_SET(ret, EFL_ACCESS_STATE_SELECTABLE);
@@ -1429,7 +1369,7 @@ _elm_menu_item_efl_access_state_set_get(Eo *obj EINA_UNUSED, Elm_Menu_Item_Data
}
EOLIAN static int
-_elm_menu_item_efl_access_selection_selected_children_count_get(Eo *obj EINA_UNUSED, Elm_Menu_Item_Data *sd)
+_elm_menu_item_efl_access_selection_selected_children_count_get(const Eo *obj EINA_UNUSED, Elm_Menu_Item_Data *sd)
{
int ret = 0;
Elm_Object_Item *sobj = NULL;
@@ -1446,7 +1386,7 @@ _elm_menu_item_efl_access_selection_selected_children_count_get(Eo *obj EINA_UNU
}
EOLIAN static Eo*
-_elm_menu_item_efl_access_selection_selected_child_get(Eo *obj EINA_UNUSED, Elm_Menu_Item_Data *sd, int child)
+_elm_menu_item_efl_access_selection_selected_child_get(const Eo *obj EINA_UNUSED, Elm_Menu_Item_Data *sd, int child)
{
int seq = 0;
Elm_Object_Item *sobj = NULL;
@@ -1468,7 +1408,7 @@ _elm_menu_item_efl_access_selection_selected_child_get(Eo *obj EINA_UNUSED, Elm_
}
EOLIAN static int
-_elm_menu_efl_access_selection_selected_children_count_get(Eo *obj EINA_UNUSED, Elm_Menu_Data *sd)
+_elm_menu_efl_access_selection_selected_children_count_get(const Eo *obj EINA_UNUSED, Elm_Menu_Data *sd)
{
Elm_Object_Item *sobj = NULL;
Eina_List *l;
@@ -1484,7 +1424,7 @@ _elm_menu_efl_access_selection_selected_children_count_get(Eo *obj EINA_UNUSED,
}
EOLIAN static Eo*
-_elm_menu_efl_access_selection_selected_child_get(Eo *obj EINA_UNUSED, Elm_Menu_Data *sd, int child)
+_elm_menu_efl_access_selection_selected_child_get(const Eo *obj EINA_UNUSED, Elm_Menu_Data *sd, int child)
{
int seq = 0;
Elm_Object_Item *sobj = NULL;
@@ -1509,13 +1449,10 @@ _elm_menu_efl_access_selection_selected_child_get(Eo *obj EINA_UNUSED, Elm_Menu_
EOLIAN static Efl_Object*
_elm_menu_efl_object_provider_find(const Eo *obj, Elm_Menu_Data *pd, const Efl_Object *klass)
{
- Efl_Object *result;
-
- result = efl_provider_find(pd->parent, klass);
-
- if (result) return result;
+ if (!pd->parent)
+ return efl_provider_find(efl_super(obj, MY_CLASS), klass);
- return efl_provider_find(efl_super(obj, MY_CLASS), klass);
+ return efl_provider_find(pd->parent, klass);
}
diff --git a/src/lib/elementary/elm_menu.eo b/src/lib/elementary/elm_menu.eo
index 322557c910..d67f87a81b 100644
--- a/src/lib/elementary/elm_menu.eo
+++ b/src/lib/elementary/elm_menu.eo
@@ -1,18 +1,49 @@
-class Elm.Menu (Elm.Widget, Efl.Ui.Clickable, Efl.Ui.Menu,
- Efl.Access.Selection, Efl.Ui.Focus.Manager)
+class Elm.Menu (Efl.Ui.Widget, Efl.Ui.Clickable,
+ Efl.Access.Selection, Efl.Ui.Widget_Focus_Manager, Efl.Ui.Legacy)
{
[[Elementary menu class]]
legacy_prefix: elm_menu;
eo_prefix: elm_obj_menu;
event_prefix: elm_menu;
methods {
- move {
+ @property selected_item {
+ get {
+ [[Get the selected item in the widget.]]
+ }
+ values {
+ item: Elm.Widget.Item; [[The selected item or $null.]]
+ }
+ }
+ @property first_item {
+ get {
+ [[Get the first item in the widget.]]
+ }
+ values {
+ item: Elm.Widget.Item; [[The first item or $null.]]
+ }
+ }
+ @property last_item {
+ get {
+ [[Get the last item in the widget.]]
+ }
+ values {
+ item: Elm.Widget.Item; [[The last item or $null.]]
+ }
+ }
+ @property items {
+ get {
+ [[Returns a list of the widget item.]]
+ return: const(list<Elm.Widget.Item>); [[const list to widget items]]
+ }
+ }
+ relative_move {
[[Move the menu to a new position
Sets the top-left position of the menu to ($x, $y).
Note: $x and $y coordinates are relative to parent.
]]
+ legacy: elm_menu_move;
params {
@in x: int; [[The new X coordinate]]
@in y: int; [[The new Y coordinate]]
@@ -56,23 +87,20 @@ class Elm.Menu (Elm.Widget, Efl.Ui.Clickable, Efl.Ui.Menu,
class.constructor;
Efl.Object.constructor;
Efl.Object.destructor;
- Efl.Gfx.visible { set; }
- Elm.Widget.widget_parent { get; set; }
- Elm.Widget.theme_apply;
+ Efl.Gfx.Entity.visible { set; }
+ Efl.Ui.Widget.widget_parent { get; set; }
+ Efl.Ui.Widget.theme_apply;
Efl.Ui.Translatable.translation_update;
- Elm.Widget.focus_manager_create;
- Efl.Access.children { get; }
+ Efl.Ui.Widget_Focus_Manager.focus_manager_create;
+ Efl.Access.Object.access_children { get; }
Efl.Access.Selection.selected_children_count { get; }
Efl.Access.Selection.selected_child { get; }
- Efl.Ui.Menu.selected_item { get; }
- Efl.Ui.Menu.first_item { get; }
- Efl.Ui.Menu.last_item { get; }
- Efl.Ui.Menu.items { get; }
Efl.Object.provider_find;
}
events {
- dismissed; [[Called when menu widget was dismissed]]
- elm,action,block_menu; [[Called when menu blocking have been enabled]]
- elm,action,unblock_menu; [[Called when menu blocking has been disabled]]
+ dismissed: void; [[Called when menu widget was dismissed]]
+ /* FIXME: Nobody is emitting this, but they are already in use */
+ elm,action,block_menu: void; [[Called when menu blocking have been enabled]]
+ elm,action,unblock_menu: void; [[Called when menu blocking has been disabled]]
}
}
diff --git a/src/lib/elementary/elm_menu_item.eo b/src/lib/elementary/elm_menu_item.eo
index 249b0f04c1..84bfbfac52 100644
--- a/src/lib/elementary/elm_menu_item.eo
+++ b/src/lib/elementary/elm_menu_item.eo
@@ -1,30 +1,77 @@
-class Elm.Menu.Item(Elm.Widget.Item, Efl.Access.Selection,
- Efl.Ui.Item)
+class Elm.Menu.Item(Elm.Widget.Item, Efl.Access.Selection, Efl.Ui.Legacy)
{
[[Elementary menu item class]]
legacy_prefix: elm_menu_item;
eo_prefix: elm_obj_menu_item;
methods {
- @property icon_name {
- get {
- [[Get the string representation from the icon of a menu item
+ @property icon_name {
+ get {
+ [[Get the string representation from the icon of a menu item
- Once this icon is set, any previously set icon will be deleted.
- To hide icon set it to "".
- ]]
- }
- set {
- [[Set the icon of a menu item to the standard icon with the
- given name.
+ Once this icon is set, any previously set icon will be deleted.
+ To hide icon set it to "".
+ ]]
+ }
+ set {
+ [[Set the icon of a menu item to the standard icon with the
+ given name.
- Once this icon is set, any previously set icon will be deleted.
- To hide icon set it to "".
- ]]
- }
- values {
- icon: string; [[The name of icon object.]]
- }
- }
+ Once this icon is set, any previously set icon will be deleted.
+ To hide icon set it to "".
+ ]]
+ }
+ values {
+ icon: string; [[The name of icon object.]]
+ }
+ }
+ @property prev {
+ get {
+ [[Get the item before this one in the widget's list of items.
+
+ See also @.next.
+ ]]
+ }
+ values {
+ item: Elm.Widget.Item; [[The item before the object in its parent's
+ list. If there is no previous item or in case
+ of error, $null is returned.]]
+ }
+ }
+ @property next {
+ get {
+ [[Get the item after this one in the widget's list of items.
+
+ See also @.prev.
+ ]]
+ }
+ values {
+ item: Elm.Widget.Item; [[The item after the object in its parent's
+ list. If there is no next item or in case
+ of error, $null is returned.]]
+ }
+ }
+ @property selected {
+ [[Indicates whether this item is currently selected.]]
+ get {
+ [[Get the selected state of this item.]]
+ }
+ set {
+ [[Set the selected state of $item.
+
+ This sets the selected state of the given item $it.
+ $true for selected, $false for not selected.
+
+ If a new item is selected the previously selected will
+ be unselected. Previously selected item can be retrieved
+ with @Elm.Menu.selected_item.get.
+
+ Selected items will be highlighted.
+ ]]
+ }
+ values {
+ selected: bool; [[The selection state.]]
+ }
+ }
index_get @const {
[[Get the item index]]
return: uint; [[Item index]]
@@ -59,19 +106,16 @@ class Elm.Menu.Item(Elm.Widget.Item, Efl.Access.Selection,
implements {
Efl.Object.constructor;
Efl.Object.destructor;
+ Efl.Object.parent { get; }
Elm.Widget.Item.disable;
Elm.Widget.Item.signal_emit;
Elm.Widget.Item.part_text { get; set; }
Elm.Widget.Item.part_content { get; set; }
- Efl.Access.children { get; }
- Efl.Access.parent { get; }
- Efl.Access.role { get; }
- Efl.Access.name { get; }
- Efl.Access.state_set { get; }
+ Efl.Access.Object.access_children { get; }
+ Efl.Access.Object.role { get; }
+ Efl.Access.Object.i18n_name { get; }
+ Efl.Access.Object.state_set { get; }
Efl.Access.Selection.selected_children_count { get; }
Efl.Access.Selection.selected_child { get; }
- Efl.Ui.Item.selected { get; set; }
- Efl.Ui.Item.prev { get; }
- Efl.Ui.Item.next { get; }
}
}
diff --git a/src/lib/elementary/elm_menu_legacy.h b/src/lib/elementary/elm_menu_legacy.h
index 8903190ce9..9c86efc722 100644
--- a/src/lib/elementary/elm_menu_legacy.h
+++ b/src/lib/elementary/elm_menu_legacy.h
@@ -30,62 +30,5 @@ EAPI void elm_menu_parent_set(Evas_Object *obj, Evas_Obj
*/
EAPI Evas_Object *elm_menu_parent_get(const Evas_Object *obj);
-/**
- * @brief Get the selected item in the menu.
- *
- * @return The selected item or @c null.
- *
- * @ingroup Elm_Menu
- */
-EAPI Elm_Widget_Item *elm_menu_selected_item_get(const Evas_Object *obj);
-
-/** Returns a list of the item's items.
- *
- * @ingroup Elm_Menu
- */
-EAPI const Eina_List *elm_menu_items_get(const Evas_Object *obj);
-
-/** Get the first item in the menu.
- *
- * @ingroup Elm_Menu
- */
-EAPI Elm_Widget_Item *elm_menu_first_item_get(const Evas_Object *obj);
-
-/** Get the last item in the menu.
- *
- * @ingroup Elm_Menu
- */
-EAPI Elm_Widget_Item *elm_menu_last_item_get(const Evas_Object *obj);
-
-/**
- * @brief Set the selected state of @c item.
- *
- * @param[in] selected The selection state.
- *
- * @ingroup Elm_Menu_Item
- */
-EAPI void elm_menu_item_selected_set(Evas_Object *obj, Eina_Bool selected);
-
-/**
- * @brief Get the selected state of @c item.
- *
- * @return The selection state.
- *
- * @ingroup Elm_Menu_Item
- */
-EAPI Eina_Bool elm_menu_item_selected_get(const Evas_Object *obj);
-
-/** Get the previous item in the menu.
- *
- * @ingroup Elm_Menu_Item
- */
-EAPI Elm_Widget_Item *elm_menu_item_prev_get(const Evas_Object *obj);
-
-/** Get the next item in the menu.
- *
- * @ingroup Elm_Menu_Item
- */
-EAPI Elm_Widget_Item *elm_menu_item_next_get(const Evas_Object *obj);
-
#include "elm_menu_item.eo.legacy.h"
#include "elm_menu.eo.legacy.h"
diff --git a/src/lib/elementary/elm_module.c b/src/lib/elementary/elm_module.c
index 75cf3dd487..2d38327c7c 100644
--- a/src/lib/elementary/elm_module.c
+++ b/src/lib/elementary/elm_module.c
@@ -3,7 +3,7 @@
#endif
#include <Elementary.h>
-
+#include "../../static_libs/buildsystem/buildsystem.h"
#include "elm_priv.h"
/* what are moodules in elementary for? for modularising behavior and features
@@ -133,10 +133,9 @@ _elm_module_load(Elm_Module *m)
if (strchr(m->name, '/')) return EINA_FALSE;
#ifdef NEED_RUN_IN_TREE
- if (getenv("ELM_RUN_IN_TREE"))
+ if (getenv("EFL_RUN_IN_TREE"))
{
- snprintf(buf, sizeof(buf),
- ELM_TOP_BUILD_DIR "/src/modules/elementary/%s/.libs/module"EFL_SHARED_EXTENSION, m->name);
+ bs_mod_get(buf, sizeof(buf), "elementary", m->name);
}
else
#endif
diff --git a/src/lib/elementary/elm_module_helper.h b/src/lib/elementary/elm_module_helper.h
index 6d9840af4b..8f882dabaa 100644
--- a/src/lib/elementary/elm_module_helper.h
+++ b/src/lib/elementary/elm_module_helper.h
@@ -18,10 +18,10 @@
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EVAS_BUILD */
+# endif
# define EAPI_WEAK
#else
# ifdef __GNUC__
@@ -36,7 +36,7 @@
# define EAPI
# define EAPI_WEAK
# endif
-#endif /* ! _WIN32 */
+#endif
#define EWAPI EAPI EAPI_WEAK
diff --git a/src/lib/elementary/efl_ui_multibuttonentry.eo b/src/lib/elementary/elm_multibuttonentry.eo
index 18654a17d2..bb8b06239f 100644
--- a/src/lib/elementary/efl_ui_multibuttonentry.eo
+++ b/src/lib/elementary/elm_multibuttonentry.eo
@@ -1,10 +1,12 @@
type Elm_Multibuttonentry_Item_Filter_Cb: __undefined_type; [[Elementary multibuttonentry item filter callback type]]
-type Efl_Ui_Multibuttonentry_Format_Cb: __undefined_type; [[Elementary multibuttonentry format callback type]]
+type Elm_Multibuttonentry_Format_Cb: __undefined_type; [[Elementary multibuttonentry format callback type]]
-class Efl.Ui.Multibuttonentry (Efl.Ui.Layout, Efl.Ui.Clickable, Efl.Ui.Format)
+class Elm.Multibuttonentry (Efl.Ui.Layout.Object, Efl.Ui.Clickable, Efl.Ui.Legacy)
{
[[Elementary multibuttonentry class]]
legacy_prefix: elm_multibuttonentry;
+ eo_prefix: elm_obj_multibuttonentry;
+ event_prefix: elm_multibuttonentry;
methods {
@property editable {
[[Control if the multibuttonentry is to be editable or not.
@@ -32,6 +34,20 @@ class Efl.Ui.Multibuttonentry (Efl.Ui.Layout, Efl.Ui.Clickable, Efl.Ui.Format)
this to $false for single line state.]]
}
}
+ @property format_function {
+ set {
+ [[Set a function to format the string that will be used to display the hidden items counter.
+
+ If $format_function is $NULL, the default format will be used,
+ which is $"... + %d".
+
+ @since 1.9]]
+ }
+ values {
+ format_function: Elm_Multibuttonentry_Format_Cb @nullable; [[Format_function The actual format function]]
+ data: const(void_ptr) @optional; [[Data User data to passed to $format_function]]
+ }
+ }
@property items {
get {
[[Get a list of items in the multibuttonentry]]
@@ -70,7 +86,7 @@ class Efl.Ui.Multibuttonentry (Efl.Ui.Layout, Efl.Ui.Clickable, Efl.Ui.Format)
item_prepend {
[[Prepend a new item to the multibuttonentry
- See @Elm.Widget.Item.del to delete the item.]]
+ See @Efl.Object.invalidate to delete the item.]]
return: Elm.Widget.Item; [[A handle to the item added or NULL if not possible]]
params {
@@ -97,7 +113,7 @@ class Efl.Ui.Multibuttonentry (Efl.Ui.Layout, Efl.Ui.Clickable, Efl.Ui.Format)
item_insert_before {
[[Add a new item to the multibuttonentry before the indicated object reference.
- See @Elm.Widget.Item.del to delete the item.]]
+ See @Efl.Object.invalidate to delete the item.]]
return: Elm.Widget.Item; [[A handle to the item added or NULL if not possible]]
params {
@@ -110,7 +126,7 @@ class Efl.Ui.Multibuttonentry (Efl.Ui.Layout, Efl.Ui.Clickable, Efl.Ui.Format)
item_append {
[[Append a new item to the multibuttonentry
- See @Elm.Widget.Item.del to delete the item.]]
+ See @Efl.Object.invalidate to delete the item.]]
return: Elm.Widget.Item; [[A handle to the item added or NULL if not possible]]
params {
@@ -148,7 +164,7 @@ class Efl.Ui.Multibuttonentry (Efl.Ui.Layout, Efl.Ui.Clickable, Efl.Ui.Format)
item_insert_after {
[[Add a new item to the multibuttonentry after the indicated object
- See @Elm.Widget.Item.del to delete the item.]]
+ See @Efl.Object.invalidate to delete the item.]]
return: Elm.Widget.Item; [[A handle to the item added or NULL if not possible]]
params {
@@ -162,22 +178,22 @@ class Efl.Ui.Multibuttonentry (Efl.Ui.Layout, Efl.Ui.Clickable, Efl.Ui.Format)
implements {
class.constructor;
Efl.Object.constructor;
- Elm.Widget.theme_apply;
- Elm.Widget.on_access_update;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.on_access_update;
Efl.Ui.Translatable.translation_update;
- Elm.Widget.widget_event;
- Efl.Access.children { get; }
- Efl.Part.part;
- Efl.Ui.Format.format_cb { set; }
+ Efl.Ui.Widget.widget_event;
+ Efl.Access.Object.access_children { get; }
+ Efl.Part.part_get;
}
events {
- item,selected; [[Called when item was selected]]
- item,added; [[Called when item was added]]
- item,deleted; [[Called when item was deleted]]
- item,clicked; [[Called when item was clicked]]
- item,longpressed; [[Called when item got a longpress]]
- expanded; [[Called when expanded]]
- contracted; [[Called when contracted]]
- expand,state,changed; [[Called when expanded state changed]]
+ item,selected: Efl.Object; [[Called when item was selected]]
+ item,added: Efl.Object; [[Called when item was added]]
+ item,deleted: Efl.Object; [[Called when item was deleted]]
+ item,clicked: Efl.Object; [[Called when item was clicked]]
+ item,longpressed: Efl.Object; [[Called when item got a longpress]]
+ expanded: void; [[Called when expanded]]
+ contracted: void; [[Called when contracted]]
+ /* FIXME: This is not very future-proof, a struct would be better */
+ expand,state,changed: int; [[Called when expanded state changed]]
}
}
diff --git a/src/lib/elementary/elm_multibuttonentry_item.eo b/src/lib/elementary/elm_multibuttonentry_item.eo
index 1c7292db71..b8d327edd5 100644
--- a/src/lib/elementary/elm_multibuttonentry_item.eo
+++ b/src/lib/elementary/elm_multibuttonentry_item.eo
@@ -1,5 +1,6 @@
class Elm.Multibuttonentry.Item(Elm.Widget.Item,
- Efl.Access.Widget.Action)
+ Efl.Access.Widget.Action,
+ Efl.Ui.Legacy)
{
[[Elementary multibuttonentry class]]
legacy_prefix: elm_multibuttonentry_item;
@@ -30,8 +31,8 @@ class Elm.Multibuttonentry.Item(Elm.Widget.Item,
Elm.Widget.Item.signal_emit;
Elm.Widget.Item.part_text { get; set; }
Elm.Widget.Item.disable;
- Efl.Access.name { get; }
- Efl.Access.state_set { get; }
+ Efl.Access.Object.i18n_name { get; }
+ Efl.Access.Object.state_set { get; }
Efl.Access.Widget.Action.elm_actions { get; }
}
}
diff --git a/src/lib/elementary/efl_ui_multibuttonentry_part.eo b/src/lib/elementary/elm_multibuttonentry_part.eo
index 111cf18da4..a0cafc541d 100644
--- a/src/lib/elementary/efl_ui_multibuttonentry_part.eo
+++ b/src/lib/elementary/elm_multibuttonentry_part.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Multibuttonentry.Part (Efl.Ui.Layout.Part_Text)
+class Elm.Multibuttonentry_Part (Efl.Ui.Layout.Part_Legacy)
{
[[Elementary multibuttonentry internal part class]]
data: null;
diff --git a/src/lib/elementary/elm_naviframe.eo b/src/lib/elementary/elm_naviframe.eo
index 0cb644f274..47c41bdd5d 100644
--- a/src/lib/elementary/elm_naviframe.eo
+++ b/src/lib/elementary/elm_naviframe.eo
@@ -1,4 +1,4 @@
-class Elm.Naviframe (Efl.Ui.Layout, Efl.Access.Widget.Action)
+class Elm.Naviframe (Efl.Ui.Layout.Object, Efl.Access.Widget.Action, Efl.Ui.Legacy)
{
[[Elementary naviframe class]]
legacy_prefix: elm_naviframe;
@@ -143,20 +143,20 @@ class Elm.Naviframe (Efl.Ui.Layout, Efl.Access.Widget.Action)
implements {
class.constructor;
Efl.Object.constructor;
- Efl.Gfx.visible { set; }
- Elm.Widget.on_access_update;
+ Efl.Gfx.Entity.visible { set; }
+ Efl.Ui.Widget.on_access_update;
Efl.Ui.Translatable.translation_update;
- Elm.Widget.theme_apply;
- Elm.Widget.widget_event;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.widget_event;
Efl.Layout.Signal.signal_emit;
Efl.Access.Widget.Action.elm_actions { get; }
- Elm.Widget.resize_object { set; }
- Efl.Part.part;
+ Efl.Ui.Widget.resize_object { set; }
+ Efl.Part.part_get;
}
events {
- transition,finished; [[Called when naviframe transition finished]]
- title,transition,finished; [[Called when naviframe title transaction finished]]
- title,clicked; [[Called when naviframe title was clicked]]
- item,activated; [[Called when naviframe item was activated]]
+ transition,finished: Efl.Object; [[Called when naviframe transition finished]]
+ title,transition,finished: Efl.Object; [[Called when naviframe title transaction finished]]
+ title,clicked: Efl.Object; [[Called when naviframe title was clicked]]
+ item,activated: Efl.Object; [[Called when naviframe item was activated]]
}
}
diff --git a/src/lib/elementary/elm_naviframe_item.eo b/src/lib/elementary/elm_naviframe_item.eo
index 6e372e7dce..3bfceed416 100644
--- a/src/lib/elementary/elm_naviframe_item.eo
+++ b/src/lib/elementary/elm_naviframe_item.eo
@@ -1,22 +1,11 @@
type Elm_Naviframe_Item_Pop_Cb: __undefined_type; [[Elementary naviframe item pop callback type]]
-class Elm.Naviframe.Item(Elm.Widget.Item)
+class Elm.Naviframe.Item(Elm.Widget.Item, Efl.Ui.Legacy)
{
[[Elementary naviframe item class]]
legacy_prefix: elm_naviframe_item;
eo_prefix: elm_obj_naviframe_item;
methods {
- @property style {
- get {
- [[Get an item style.]]
- }
- set {
- [[Set an item style.]]
- }
- values {
- style: string @nullable; [[The current item style name. $null would be default]]
- }
- }
pop_to {
[[Pop the top item and delete the items between the top and the
above one on the given item.
@@ -82,6 +71,7 @@ class Elm.Naviframe.Item(Elm.Widget.Item)
Elm.Widget.Item.part_text { get; set; }
Elm.Widget.Item.part_content { get; set; }
Elm.Widget.Item.part_content_unset;
- Efl.Access.children { get; }
+ Elm.Widget.Item.style { set; }
+ Efl.Access.Object.access_children { get; }
}
}
diff --git a/src/lib/elementary/elm_notify.c b/src/lib/elementary/elm_notify.c
index 9e6572abfd..5441608be2 100644
--- a/src/lib/elementary/elm_notify.c
+++ b/src/lib/elementary/elm_notify.c
@@ -3,7 +3,8 @@
#endif
#define ELM_WIDGET_PROTECTED
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
+#define EFL_PART_PROTECTED
#include <Elementary.h>
@@ -141,7 +142,7 @@ _sizing_eval(Evas_Object *obj)
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_notify_elm_widget_theme_apply(Eo *obj, Elm_Notify_Data *sd)
+_elm_notify_efl_ui_widget_theme_apply(Eo *obj, Elm_Notify_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
@@ -153,7 +154,7 @@ _elm_notify_elm_widget_theme_apply(Eo *obj, Elm_Notify_Data *sd)
if (sd->block_events) _block_events_theme_apply(obj);
edje_object_scale_set
- (sd->notify, efl_gfx_scale_get(obj) * elm_config_scale_get());
+ (sd->notify, efl_gfx_entity_scale_get(obj) * elm_config_scale_get());
_sizing_eval(obj);
@@ -201,7 +202,7 @@ _changed_size_hints_cb(void *data,
}
EOLIAN static Eina_Bool
-_elm_notify_elm_widget_widget_sub_object_del(Eo *obj, Elm_Notify_Data *sd, Evas_Object *sobj)
+_elm_notify_efl_ui_widget_widget_sub_object_del(Eo *obj, Elm_Notify_Data *sd, Evas_Object *sobj)
{
Eina_Bool int_ret = EINA_FALSE;
int_ret = elm_widget_sub_object_del(efl_super(obj, MY_CLASS), sobj);
@@ -228,29 +229,29 @@ _block_area_clicked_cb(void *data,
}
EOLIAN static void
-_elm_notify_efl_gfx_size_set(Eo *obj, Elm_Notify_Data *sd, Eina_Size2D sz)
+_elm_notify_efl_gfx_entity_size_set(Eo *obj, Elm_Notify_Data *sd, Eina_Size2D sz)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
- efl_gfx_size_set(efl_super(obj, MY_CLASS), sz);
+ efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
if (!sd->parent && sd->content)
{
Eina_Position2D pos;
- pos = efl_gfx_position_get(obj);
+ pos = efl_gfx_entity_position_get(obj);
_notify_move_to_orientation(obj, pos.x, pos.y, sz.w, sz.h);
}
}
EOLIAN static void
-_elm_notify_efl_gfx_position_set(Eo *obj, Elm_Notify_Data *sd, Eina_Position2D pos)
+_elm_notify_efl_gfx_entity_position_set(Eo *obj, Elm_Notify_Data *sd, Eina_Position2D pos)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
- efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
if (!sd->parent && sd->content)
{
@@ -295,7 +296,7 @@ _elm_notify_show(Eo *obj, Elm_Notify_Data *sd)
{
sd->had_hidden = EINA_FALSE;
sd->in_timeout = EINA_FALSE;
- efl_gfx_visible_set(efl_super(obj, MY_CLASS), EINA_TRUE);
+ efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), EINA_TRUE);
evas_object_show(sd->notify);
if (!sd->allow_events) evas_object_show(sd->block_events);
@@ -322,7 +323,7 @@ _elm_notify_hide(Eo *obj EINA_UNUSED, Elm_Notify_Data *sd)
}
else //for backport supporting: edc without emitting hide finished signal
{
- efl_gfx_visible_set(efl_super(obj, MY_CLASS), EINA_FALSE);
+ efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), EINA_FALSE);
evas_object_hide(sd->notify);
if (sd->allow_events) evas_object_hide(sd->block_events);
}
@@ -330,7 +331,7 @@ _elm_notify_hide(Eo *obj EINA_UNUSED, Elm_Notify_Data *sd)
}
EOLIAN static void
-_elm_notify_efl_gfx_visible_set(Eo *obj, Elm_Notify_Data *sd, Eina_Bool vis)
+_elm_notify_efl_gfx_entity_visible_set(Eo *obj, Elm_Notify_Data *sd, Eina_Bool vis)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 0, vis))
return;
@@ -382,7 +383,7 @@ _elm_notify_content_set(Eo *obj, Elm_Notify_Data *sd, const char *part, Evas_Obj
}
static Evas_Object*
-_elm_notify_content_get(Eo *obj EINA_UNUSED, Elm_Notify_Data *sd, const char *part)
+_elm_notify_content_get(const Eo *obj EINA_UNUSED, Elm_Notify_Data *sd, const char *part)
{
if (part && strcmp(part, "default")) return NULL;
@@ -407,19 +408,19 @@ _elm_notify_content_unset(Eo *obj, Elm_Notify_Data *sd, const char *part)
EOLIAN static Eina_Bool
_elm_notify_efl_content_content_set(Eo *obj, Elm_Notify_Data *sd, Evas_Object *content)
{
- return _elm_notify_content_set(obj, sd, NULL, content);
+ return _elm_notify_content_set(obj, sd, "default", content);
}
EOLIAN static Evas_Object*
-_elm_notify_efl_content_content_get(Eo *obj EINA_UNUSED, Elm_Notify_Data *sd)
+_elm_notify_efl_content_content_get(const Eo *obj EINA_UNUSED, Elm_Notify_Data *sd)
{
- return _elm_notify_content_get(obj, sd, NULL);
+ return _elm_notify_content_get(obj, sd, "default");
}
EOLIAN static Evas_Object*
_elm_notify_efl_content_content_unset(Eo *obj, Elm_Notify_Data *sd)
{
- return _elm_notify_content_unset(obj, sd, NULL);
+ return _elm_notify_content_unset(obj, sd, "default");
}
static void
@@ -432,7 +433,7 @@ _hide_finished_cb(void *data,
sd->had_hidden = EINA_TRUE;
evas_object_hide(sd->notify);
if (!sd->allow_events) evas_object_hide(sd->block_events);
- efl_gfx_visible_set(efl_super(data, MY_CLASS), EINA_FALSE);
+ efl_gfx_entity_visible_set(efl_super(data, MY_CLASS), EINA_FALSE);
efl_event_callback_legacy_call(data, ELM_NOTIFY_EVENT_DISMISSED, NULL);
}
@@ -460,7 +461,6 @@ _elm_notify_efl_canvas_group_group_del(Eo *obj, Elm_Notify_Data *sd)
edje_object_signal_callback_del_full
(sd->notify, "elm,action,hide,finished", "elm", _hide_finished_cb, obj);
elm_notify_parent_set(obj, NULL);
- elm_notify_allow_events_set(obj, EINA_FALSE);
ecore_timer_del(sd->timer);
ELM_SAFE_FREE(sd->notify, evas_object_del);
@@ -479,7 +479,7 @@ _elm_notify_efl_object_constructor(Eo *obj, Elm_Notify_Data *sd EINA_UNUSED)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_NOTIFICATION);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_NOTIFICATION);
return obj;
}
@@ -493,7 +493,7 @@ elm_notify_parent_set(Evas_Object *obj,
}
EOLIAN static void
-_elm_notify_elm_widget_widget_parent_set(Eo *obj, Elm_Notify_Data *sd, Evas_Object *parent)
+_elm_notify_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Notify_Data *sd, Evas_Object *parent)
{
if (sd->parent)
{
@@ -540,7 +540,7 @@ elm_notify_parent_get(const Evas_Object *obj)
}
EOLIAN static Evas_Object*
-_elm_notify_elm_widget_widget_parent_get(Eo *obj EINA_UNUSED, Elm_Notify_Data *sd)
+_elm_notify_efl_ui_widget_widget_parent_get(const Eo *obj EINA_UNUSED, Elm_Notify_Data *sd)
{
return sd->parent;
}
@@ -635,7 +635,7 @@ _elm_notify_timeout_set(Eo *obj, Elm_Notify_Data *sd, double timeout)
}
EOLIAN static double
-_elm_notify_timeout_get(Eo *obj EINA_UNUSED, Elm_Notify_Data *sd)
+_elm_notify_timeout_get(const Eo *obj EINA_UNUSED, Elm_Notify_Data *sd)
{
return sd->timeout;
}
@@ -663,7 +663,7 @@ _elm_notify_allow_events_set(Eo *obj, Elm_Notify_Data *sd, Eina_Bool allow)
}
EOLIAN static Eina_Bool
-_elm_notify_allow_events_get(Eo *obj EINA_UNUSED, Elm_Notify_Data *sd)
+_elm_notify_allow_events_get(const Eo *obj EINA_UNUSED, Elm_Notify_Data *sd)
{
return sd->allow_events;
}
@@ -687,7 +687,7 @@ _elm_notify_dismiss(Eo *obj EINA_UNUSED, Elm_Notify_Data *sd)
EOLIAN static void
-_elm_notify_align_get(Eo *obj EINA_UNUSED, Elm_Notify_Data *sd, double *horizontal, double *vertical)
+_elm_notify_align_get(const Eo *obj EINA_UNUSED, Elm_Notify_Data *sd, double *horizontal, double *vertical)
{
if (horizontal)
*horizontal = sd->horizontal_align;
@@ -712,7 +712,7 @@ ELM_PART_OVERRIDE_CONTENT_UNSET(elm_notify, ELM_NOTIFY, Elm_Notify_Data)
ELM_PART_CONTENT_DEFAULT_GET(elm_notify, "default")
EOLIAN static const char *
-_elm_notify_part_efl_ui_translatable_translatable_text_get(Eo *obj, void *_pd EINA_UNUSED, const char **domain)
+_elm_notify_part_efl_ui_translatable_translatable_text_get(const Eo *obj, void *_pd EINA_UNUSED, const char **domain)
{
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
return elm_widget_part_translatable_text_get(pd->obj, pd->part, domain);
diff --git a/src/lib/elementary/elm_notify.eo b/src/lib/elementary/elm_notify.eo
index 2a71c1b855..60c26f3db2 100644
--- a/src/lib/elementary/elm_notify.eo
+++ b/src/lib/elementary/elm_notify.eo
@@ -1,4 +1,4 @@
-class Elm.Notify (Elm.Widget, Efl.Ui.Focus.Layer, Efl.Content, Efl.Part)
+class Elm.Notify (Efl.Ui.Widget, Efl.Ui.Focus.Layer, Efl.Content, Efl.Part, Efl.Ui.Legacy)
{
[[Elementary notification class]]
legacy_prefix: elm_notify;
@@ -80,19 +80,19 @@ class Elm.Notify (Elm.Widget, Efl.Ui.Focus.Layer, Efl.Content, Efl.Part)
implements {
class.constructor;
Efl.Object.constructor;
- Efl.Gfx.visible { set; }
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set; }
- Elm.Widget.widget_parent { get; set; }
- Elm.Widget.theme_apply;
- Elm.Widget.widget_sub_object_del;
+ Efl.Gfx.Entity.visible { set; }
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
+ Efl.Ui.Widget.widget_parent { get; set; }
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.widget_sub_object_del;
Efl.Content.content { get; set; }
Efl.Content.content_unset;
- Efl.Part.part;
+ Efl.Part.part_get;
}
events {
- block,clicked; [[Called when block was clicked]]
- timeout; [[Called when notify timed out]]
- dismissed; [[Called when notify was dismissed]]
+ block,clicked: void; [[Called when block was clicked]]
+ timeout: void; [[Called when notify timed out]]
+ dismissed: void; [[Called when notify was dismissed]]
}
}
diff --git a/src/lib/elementary/elm_notify_part.eo b/src/lib/elementary/elm_notify_part.eo
index 86a41a253d..9f66b84bbe 100644
--- a/src/lib/elementary/elm_notify_part.eo
+++ b/src/lib/elementary/elm_notify_part.eo
@@ -1,4 +1,4 @@
-class Elm.Notify.Part (Efl.Ui.Widget.Part, Efl.Content, Efl.Text,
+class Elm.Notify.Part (Efl.Ui.Widget_Part, Efl.Content, Efl.Text,
Efl.Ui.Translatable)
{
[[Elementary notification internel part class]]
diff --git a/src/lib/elementary/elm_object_item.h b/src/lib/elementary/elm_object_item.h
index 0bda61e1b5..2956ff2278 100644
--- a/src/lib/elementary/elm_object_item.h
+++ b/src/lib/elementary/elm_object_item.h
@@ -78,3 +78,9 @@ EAPI void *elm_object_item_data_get(const Elm_Object_Item *it);
* @ingroup Elm_General
*/
EAPI void elm_object_item_data_set(Elm_Object_Item *it, void *data);
+
+/** Delete the given item.
+ *
+ * @ingroup Elm_General
+ */
+EAPI void elm_object_item_del(Elm_Object_Item *obj);
diff --git a/src/lib/elementary/elm_pan.eo b/src/lib/elementary/elm_pan.eo
index dcc13f18bc..81eaad2e5b 100644
--- a/src/lib/elementary/elm_pan.eo
+++ b/src/lib/elementary/elm_pan.eo
@@ -7,7 +7,7 @@ class Elm.Pan (Efl.Canvas.Group)
data: Elm_Pan_Smart_Data;
methods {
@property pos {
- [[Position]]
+ [[Position]]
set {
}
get {
@@ -18,7 +18,7 @@ class Elm.Pan (Efl.Canvas.Group)
}
}
@property content_size {
- [[Content size]]
+ [[Content size]]
get {
}
values {
@@ -27,7 +27,7 @@ class Elm.Pan (Efl.Canvas.Group)
}
}
@property pos_min {
- [[Minimal position]]
+ [[Minimal position]]
get {
}
values {
@@ -36,7 +36,7 @@ class Elm.Pan (Efl.Canvas.Group)
}
}
@property pos_max {
- [[Maximal position]]
+ [[Maximal position]]
get {
}
values {
@@ -48,11 +48,11 @@ class Elm.Pan (Efl.Canvas.Group)
implements {
Efl.Object.constructor;
class.constructor;
- Efl.Gfx.visible { set; }
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set; }
+ Efl.Gfx.Entity.visible { set; }
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
}
events {
- changed; [[Called when pan object changed]]
+ changed: void; [[Called when pan object changed]]
}
}
diff --git a/src/lib/elementary/elm_panel.c b/src/lib/elementary/elm_panel.c
index 4b7b1a1144..b85f9880ed 100644
--- a/src/lib/elementary/elm_panel.c
+++ b/src/lib/elementary/elm_panel.c
@@ -2,9 +2,10 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define EFL_UI_FOCUS_LAYER_PROTECTED
+#define EFL_PART_PROTECTED
#include <Elementary.h>
@@ -49,7 +50,7 @@ _mirrored_set(Evas_Object *obj,
{
ELM_PANEL_DATA_GET(obj, sd);
- if ((sd->content) && (efl_isa(sd->content, ELM_WIDGET_CLASS)))
+ if ((sd->content) && (efl_isa(sd->content, EFL_UI_WIDGET_CLASS)))
efl_ui_mirrored_set(sd->content, rtl);
elm_panel_orient_set(obj, elm_panel_orient_get(obj));
}
@@ -89,11 +90,13 @@ _access_state_cb(void *data, Evas_Object *obj EINA_UNUSED)
static Evas_Object *
_access_object_get(const Evas_Object *obj, const char *part)
{
- Evas_Object *po, *ao;
+ Evas_Object *po, *ao, *o;
ELM_PANEL_DATA_GET(obj, sd);
- po = (Evas_Object *)edje_object_part_object_get
- (elm_layout_edje_get(sd->scr_ly), part);
+ o = elm_layout_edje_get(sd->scr_ly);
+ edje_object_freeze(o);
+ po = (Evas_Object *)edje_object_part_object_get(o, part);
+ edje_object_thaw(o);
ao = evas_object_data_get(po, "_part_access_obj");
return ao;
@@ -214,7 +217,7 @@ _scrollable_layout_theme_set(Eo *obj, Elm_Panel_Data *sd)
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_panel_elm_widget_theme_apply(Eo *obj, Elm_Panel_Data *sd)
+_elm_panel_efl_ui_widget_theme_apply(Eo *obj, Elm_Panel_Data *sd)
{
const char *str;
Evas_Coord minw = 0, minh = 0;
@@ -343,7 +346,7 @@ static void
_drawer_close(Evas_Object *obj, Evas_Coord w, Evas_Coord h, Eina_Bool anim)
{
ELM_PANEL_DATA_GET(obj, sd);
- int x = 0, y = 0;
+ int x = 0, y = 0, cx, cy;
Eina_Bool horizontal = EINA_FALSE;
elm_widget_tree_unfocusable_set(obj, EINA_TRUE);
@@ -369,6 +372,25 @@ _drawer_close(Evas_Object *obj, Evas_Coord w, Evas_Coord h, Eina_Bool anim)
break;
}
+ elm_interface_scrollable_content_pos_get(obj, &cx, &cy);
+
+ if ((x == cx) && (y == cy))
+ {
+ if (!sd->freeze)
+ {
+ if (horizontal)
+ elm_interface_scrollable_movement_block_set
+ (obj, EFL_UI_SCROLL_BLOCK_HORIZONTAL);
+ else
+ elm_interface_scrollable_movement_block_set
+ (obj, EFL_UI_SCROLL_BLOCK_VERTICAL);
+ sd->freeze = EINA_TRUE;
+ elm_layout_signal_emit(sd->scr_ly, "elm,state,content,hidden", "elm");
+ }
+
+ return;
+ }
+
if (anim)
{
if (sd->freeze)
@@ -703,10 +725,10 @@ _key_action_toggle(Evas_Object *obj, const char *params EINA_UNUSED)
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(panel, Elm_Panel_Data)
EOLIAN static Eina_Bool
-_elm_panel_elm_widget_widget_event(Eo *obj, Elm_Panel_Data *pd, const Efl_Event *eo_event, Evas_Object *src)
+_elm_panel_efl_ui_widget_widget_event(Eo *obj, Elm_Panel_Data *pd, const Efl_Event *eo_event, Evas_Object *src)
{
if (src != obj) return EINA_FALSE;
- return _panel_elm_widget_widget_event(obj, pd, eo_event, src);
+ return _panel_efl_ui_widget_widget_event(obj, pd, eo_event, src);
}
static Eina_Bool
@@ -720,7 +742,7 @@ _elm_panel_content_set(Eo *obj, Elm_Panel_Data *sd, const char *part, Evas_Objec
ERR("elm.swallow.event is being used for panel internally. Don't touch this part!");
return EINA_FALSE;
}
- if (strcmp(part, "default"))
+ if (strcmp(part, "elm.swallow.content") || (content == sd->bx))
{
Eina_Bool int_ret = EINA_TRUE;
int_ret = efl_content_set(efl_part(efl_super(obj, MY_CLASS), part), content);
@@ -758,7 +780,7 @@ _elm_panel_content_get(Eo *obj, Elm_Panel_Data *sd, const char *part)
ERR("elm.swallow.event is being used for panel internally. Don't touch this part!");
return NULL;
}
- if (strcmp(part, "default"))
+ if (strcmp(part, "elm.swallow.content"))
{
Evas_Object *ret = NULL;
ret = efl_content_get(efl_part(efl_super(obj, MY_CLASS), part));
@@ -782,7 +804,7 @@ _elm_panel_content_unset(Eo *obj, Elm_Panel_Data *sd, const char *part)
ERR("elm.swallow.event is being used for panel internally. Don't touch this part!");
return NULL;
}
- if (strcmp(part, "default"))
+ if (strcmp(part, "elm.swallow.content"))
{
ret = efl_content_unset(efl_part(efl_super(obj, MY_CLASS), part));
return ret;
@@ -876,13 +898,13 @@ _elm_panel_efl_canvas_group_group_del(Eo *obj, Elm_Panel_Data *sd)
}
EOLIAN static void
-_elm_panel_efl_gfx_position_set(Eo *obj, Elm_Panel_Data *sd, Eina_Position2D pos)
+_elm_panel_efl_gfx_entity_position_set(Eo *obj, Elm_Panel_Data *sd, Eina_Position2D pos)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
- efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
- efl_gfx_position_set(sd->hit_rect, pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
+ efl_gfx_entity_position_set(sd->hit_rect, pos);
}
static void
@@ -910,16 +932,16 @@ _scrollable_layout_resize(Eo *obj, Elm_Panel_Data *sd, Evas_Coord w, Evas_Coord
}
EOLIAN static void
-_elm_panel_efl_gfx_size_set(Eo *obj, Elm_Panel_Data *sd, Eina_Size2D sz)
+_elm_panel_efl_gfx_entity_size_set(Eo *obj, Elm_Panel_Data *sd, Eina_Size2D sz)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
- efl_gfx_size_set(efl_super(obj, MY_CLASS), sz);
+ efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
if (!sd->scrollable) return;
- efl_gfx_size_set(sd->hit_rect, sz);
+ efl_gfx_entity_size_set(sd->hit_rect, sz);
_scrollable_layout_resize(obj, sd, sz.w, sz.h);
}
@@ -932,7 +954,7 @@ _elm_panel_efl_canvas_group_group_member_add(Eo *obj, Elm_Panel_Data *sd, Evas_O
}
EOLIAN static void
-_elm_panel_elm_widget_on_access_update(Eo *obj, Elm_Panel_Data *_pd, Eina_Bool is_access)
+_elm_panel_efl_ui_widget_on_access_update(Eo *obj, Elm_Panel_Data *_pd, Eina_Bool is_access)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
Elm_Panel_Data *sd = _pd;
@@ -969,7 +991,7 @@ _elm_panel_efl_object_constructor(Eo *obj, Elm_Panel_Data *_pd EINA_UNUSED)
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_PANEL);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_PANEL);
efl_ui_focus_layer_behaviour_set(obj, EINA_FALSE, EINA_FALSE);
@@ -1015,7 +1037,7 @@ _elm_panel_orient_set(Eo *obj, Elm_Panel_Data *sd, Elm_Panel_Orient orient)
}
EOLIAN static Elm_Panel_Orient
-_elm_panel_orient_get(Eo *obj EINA_UNUSED, Elm_Panel_Data *sd)
+_elm_panel_orient_get(const Eo *obj EINA_UNUSED, Elm_Panel_Data *sd)
{
return sd->orient;
}
@@ -1038,7 +1060,7 @@ _elm_panel_hidden_set(Eo *obj, Elm_Panel_Data *sd, Eina_Bool hidden)
}
EOLIAN static Eina_Bool
-_elm_panel_hidden_get(Eo *obj EINA_UNUSED, Elm_Panel_Data *sd)
+_elm_panel_hidden_get(const Eo *obj EINA_UNUSED, Elm_Panel_Data *sd)
{
return sd->hidden;
}
@@ -1050,7 +1072,7 @@ _elm_panel_toggle(Eo *obj, Elm_Panel_Data *_pd EINA_UNUSED)
}
EOLIAN static Eina_Rect
-_elm_panel_elm_widget_interest_region_get(Eo *obj, Elm_Panel_Data *sd)
+_elm_panel_efl_ui_widget_interest_region_get(const Eo *obj, Elm_Panel_Data *sd)
{
Eina_Rect r = {};
@@ -1220,14 +1242,14 @@ _scroll_cb(Evas_Object *obj, void *data EINA_UNUSED)
}
EOLIAN static Eina_Bool
-_elm_panel_elm_widget_on_disabled_update(Eo *obj, Elm_Panel_Data *sd, Eina_Bool disabled)
+_elm_panel_efl_ui_widget_on_disabled_update(Eo *obj, Elm_Panel_Data *sd, Eina_Bool disabled)
{
if (!efl_ui_widget_on_disabled_update(efl_super(obj, MY_CLASS), disabled))
return EINA_FALSE;
if (sd->scrollable)
{
- if (disabled)
+ if (disabled && sd->callback_added)
{
evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_DOWN,
_on_mouse_down);
@@ -1237,8 +1259,10 @@ _elm_panel_elm_widget_on_disabled_update(Eo *obj, Elm_Panel_Data *sd, Eina_Bool
_on_mouse_up);
evas_object_event_callback_del(sd->scr_event, EVAS_CALLBACK_MOUSE_UP,
_event_mouse_up);
+
+ sd->callback_added = EINA_FALSE;
}
- else
+ else if (!disabled && !sd->callback_added)
{
evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_DOWN,
_on_mouse_down, sd);
@@ -1248,6 +1272,8 @@ _elm_panel_elm_widget_on_disabled_update(Eo *obj, Elm_Panel_Data *sd, Eina_Bool
_on_mouse_up, sd);
evas_object_event_callback_add(sd->scr_event, EVAS_CALLBACK_MOUSE_UP,
_event_mouse_up, obj);
+
+ sd->callback_added = EINA_TRUE;
}
}
@@ -1255,7 +1281,7 @@ _elm_panel_elm_widget_on_disabled_update(Eo *obj, Elm_Panel_Data *sd, Eina_Bool
}
EOLIAN static double
-_elm_panel_scrollable_content_size_get(Eo *obj EINA_UNUSED, Elm_Panel_Data *sd)
+_elm_panel_scrollable_content_size_get(const Eo *obj EINA_UNUSED, Elm_Panel_Data *sd)
{
return sd->content_size_ratio;
}
@@ -1278,7 +1304,7 @@ _elm_panel_scrollable_content_size_set(Eo *obj, Elm_Panel_Data *sd, double ratio
}
EOLIAN static Eina_Bool
-_elm_panel_scrollable_get(Eo *obj EINA_UNUSED, Elm_Panel_Data *sd)
+_elm_panel_scrollable_get(const Eo *obj EINA_UNUSED, Elm_Panel_Data *sd)
{
return sd->scrollable;
}
@@ -1340,12 +1366,14 @@ _elm_panel_scrollable_set(Eo *obj, Elm_Panel_Data *sd, Eina_Bool scrollable)
sd->scr_panel = evas_object_rectangle_add(evas_object_evas_get(obj));
evas_object_color_set(sd->scr_panel, 0, 0, 0, 0);
elm_widget_sub_object_add(obj, sd->scr_panel);
- elm_layout_content_set(sd->scr_ly, "panel_area", sd->scr_panel);
+ if (!elm_layout_content_set(sd->scr_ly, "elm.panel_area", sd->scr_panel))
+ elm_layout_content_set(sd->scr_ly, "panel_area", sd->scr_panel);
sd->scr_event = evas_object_rectangle_add(evas_object_evas_get(obj));
evas_object_color_set(sd->scr_event, 0, 0, 0, 0);
elm_widget_sub_object_add(obj, sd->scr_event);
- elm_layout_content_set(sd->scr_ly, "event_area", sd->scr_event);
+ if (!elm_layout_content_set(sd->scr_ly, "elm.event_area", sd->scr_event))
+ elm_layout_content_set(sd->scr_ly, "event_area", sd->scr_event);
}
elm_interface_scrollable_content_set(obj, sd->scr_ly);
@@ -1370,7 +1398,7 @@ _elm_panel_scrollable_set(Eo *obj, Elm_Panel_Data *sd, Eina_Bool scrollable)
elm_interface_scrollable_single_direction_set
(obj, ELM_SCROLLER_SINGLE_DIRECTION_NONE);
- if (!elm_widget_disabled_get(obj))
+ if (!elm_widget_disabled_get(obj) && !sd->callback_added)
{
evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_DOWN,
_on_mouse_down, sd);
@@ -1380,6 +1408,8 @@ _elm_panel_scrollable_set(Eo *obj, Elm_Panel_Data *sd, Eina_Bool scrollable)
_on_mouse_up, sd);
evas_object_event_callback_add(sd->scr_event, EVAS_CALLBACK_MOUSE_UP,
_event_mouse_up, obj);
+
+ sd->callback_added = EINA_TRUE;
}
}
@@ -1387,11 +1417,16 @@ _elm_panel_scrollable_set(Eo *obj, Elm_Panel_Data *sd, Eina_Bool scrollable)
{
elm_interface_scrollable_content_set(obj, NULL);
- evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_DOWN, _on_mouse_down);
- evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_MOVE, _on_mouse_move);
- evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_UP, _on_mouse_up);
- evas_object_event_callback_del(sd->scr_event, EVAS_CALLBACK_MOUSE_UP,
- _event_mouse_up);
+ if (sd->callback_added)
+ {
+ evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_DOWN, _on_mouse_down);
+ evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_MOVE, _on_mouse_move);
+ evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_UP, _on_mouse_up);
+ evas_object_event_callback_del(sd->scr_event, EVAS_CALLBACK_MOUSE_UP,
+ _event_mouse_up);
+
+ sd->callback_added = EINA_FALSE;
+ }
elm_widget_resize_object_set(obj, NULL);
elm_widget_sub_object_add(obj, sd->scr_edje);
@@ -1411,7 +1446,7 @@ _elm_panel_class_constructor(Efl_Class *klass)
}
EOLIAN const Efl_Access_Action_Data *
-_elm_panel_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Panel_Data *pd EINA_UNUSED)
+_elm_panel_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Elm_Panel_Data *pd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "toggle", "toggle", NULL, _key_action_toggle},
diff --git a/src/lib/elementary/elm_panel.eo b/src/lib/elementary/elm_panel.eo
index 107b1aeba6..ba4db117c9 100644
--- a/src/lib/elementary/elm_panel.eo
+++ b/src/lib/elementary/elm_panel.eo
@@ -8,8 +8,8 @@ enum Elm.Panel.Orient
right [[Panel (dis)appears from the right]]
}
-class Elm.Panel (Efl.Ui.Layout, Efl.Ui.Focus.Layer, Elm.Interface_Scrollable,
- Efl.Access.Widget.Action)
+class Elm.Panel (Efl.Ui.Layout.Object, Efl.Ui.Focus.Layer, Elm.Interface_Scrollable,
+ Efl.Access.Widget.Action, Efl.Ui.Legacy)
{
[[Elementary panel class]]
legacy_prefix: elm_panel;
@@ -76,18 +76,18 @@ class Elm.Panel (Efl.Ui.Layout, Efl.Ui.Focus.Layer, Elm.Interface_Scrollable,
implements {
class.constructor;
Efl.Object.constructor;
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set; }
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
Efl.Canvas.Group.group_member_add;
- Elm.Widget.theme_apply;
- Elm.Widget.on_disabled_update;
- Elm.Widget.on_access_update;
- Elm.Widget.widget_event;
- Elm.Widget.interest_region { get; }
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.on_disabled_update;
+ Efl.Ui.Widget.on_access_update;
+ Efl.Ui.Widget.widget_event;
+ Efl.Ui.Widget.interest_region { get; }
Efl.Access.Widget.Action.elm_actions { get; }
- Efl.Part.part;
+ Efl.Part.part_get;
}
events {
- toggled; [[Called when the hidden state was toggled]]
+ toggled: void; [[Called when the hidden state was toggled]]
}
}
diff --git a/src/lib/elementary/elm_panel_part.eo b/src/lib/elementary/elm_panel_part.eo
index 3a533ce038..60ec9a3636 100644
--- a/src/lib/elementary/elm_panel_part.eo
+++ b/src/lib/elementary/elm_panel_part.eo
@@ -1,4 +1,4 @@
-class Elm.Panel.Part (Efl.Ui.Widget.Part, Efl.Content)
+class Elm.Panel.Part (Efl.Ui.Widget_Part, Efl.Content)
{
[[Elementary panel internal part class]]
data: null;
diff --git a/src/lib/elementary/elm_panes_legacy.h b/src/lib/elementary/elm_panes_legacy.h
index 251c6ff5b3..b33bbf0361 100644
--- a/src/lib/elementary/elm_panes_legacy.h
+++ b/src/lib/elementary/elm_panes_legacy.h
@@ -1,3 +1,5 @@
+typedef Eo Elm_Panes;
+
/**
* Add a new panes widget to the given parent Elementary
* (container) object.
@@ -29,7 +31,7 @@ EAPI Evas_Object *elm_panes_add(Evas_Object *parent);
EAPI void elm_panes_horizontal_set(Evas_Object *obj, Eina_Bool horizontal);
/**
- * @brief Set how to split and dispose each content.
+ * @brief Get how to split and dispose each content.
*
* Use this function to change how your panes is to be disposed: vertically or
* horizontally. Horizontal panes have "top" and "bottom" contents, vertical
@@ -57,7 +59,7 @@ EAPI Eina_Bool elm_panes_horizontal_get(const Evas_Object *obj);
EAPI void elm_panes_content_left_min_size_set(Evas_Object *obj, int size);
/**
- * @brief Set the absolute minimum size of panes widget's left side.
+ * @brief Get the absolute minimum size of panes widget's left side.
*
* @note If displayed vertically, left content is displayed at top.
*
@@ -79,7 +81,7 @@ EAPI int elm_panes_content_left_min_size_get(const Evas_Object *obj);
EAPI void elm_panes_content_right_min_size_set(Evas_Object *obj, int size);
/**
- * @brief Control the absolute minimum size of panes widget's right side.
+ * @brief Get the absolute minimum size of panes widget's right side.
*
* @note If displayed vertically, right content is displayed at bottom.
*
@@ -112,15 +114,10 @@ EAPI int elm_panes_content_right_min_size_get(const Evas_Object *obj);
EAPI void elm_panes_content_right_size_set(Evas_Object *obj, double size);
/**
- * @brief Set the size proportion of panes widget's right side.
+ * @brief Get the size proportion of panes widget's right side.
*
* By default it's homogeneous, i.e., both sides have the same size.
*
- * If something different is required, it can be set with this function. For
- * example, if the right content should be displayed over 75% of the panes
- * size, @c size should be passed as 0.75. This way, left content will be
- * resized to 25% of panes size.
- *
* If displayed vertically, left content is displayed at top, and right content
* at bottom.
*
@@ -156,15 +153,10 @@ EAPI double elm_panes_content_right_size_get(const Evas_Object *obj);
EAPI void elm_panes_content_left_size_set(Evas_Object *obj, double size);
/**
- * @brief Set the size proportion of panes widget's left side.
+ * @brief Get the size proportion of panes widget's left side.
*
* By default it's homogeneous, i.e., both sides have the same size.
*
- * If something different is required, it can be set with this function. For
- * example, if the left content should be displayed over 75% of the panes size,
- * @c size should be passed as 0.75. This way, right content will be resized to
- * 25% of panes size.
- *
* If displayed vertically, left content is displayed at top, and right content
* at bottom.
*
@@ -191,7 +183,7 @@ EAPI double elm_panes_content_left_size_get(const Evas_Object *obj);
EAPI void elm_panes_content_left_min_relative_size_set(Evas_Object *obj, double size);
/**
- * @brief Controls the relative minimum size of panes widget's left side.
+ * @brief Get the relative minimum size of panes widget's left side.
*
* proportion of minimum size of left side.
*
@@ -217,7 +209,7 @@ EAPI double elm_panes_content_left_min_relative_size_get(const Evas_Object *obj)
EAPI void elm_panes_content_right_min_relative_size_set(Evas_Object *obj, double size);
/**
- * @brief Set the relative minimum size of panes widget's right side.
+ * @brief Get the relative minimum size of panes widget's right side.
*
* @note If displayed vertically, right content is displayed at bottom.
*
diff --git a/src/lib/elementary/elm_part_helper.h b/src/lib/elementary/elm_part_helper.h
index 3177aae7b9..6fe2304d8f 100644
--- a/src/lib/elementary/elm_part_helper.h
+++ b/src/lib/elementary/elm_part_helper.h
@@ -24,31 +24,31 @@ struct _Elm_Part_Data
static const char * _ ## type ## _default_content_part_get(const Eo *obj EINA_UNUSED, void *sd EINA_UNUSED) { return part; }
#define ELM_PART_CONTENT_DEFAULT_OPS(type) \
- EFL_OBJECT_OP_FUNC(elm_widget_default_content_part_get, _ ## type ## _default_content_part_get)
+ EFL_OBJECT_OP_FUNC(efl_ui_widget_default_content_part_get, _ ## type ## _default_content_part_get)
#define ELM_PART_TEXT_DEFAULT_GET(type, part) \
static const char * _ ## type ## _default_text_part_get(const Eo *obj EINA_UNUSED, void *sd EINA_UNUSED) { return part; }
#define ELM_PART_TEXT_DEFAULT_OPS(type) \
- EFL_OBJECT_OP_FUNC(elm_widget_default_text_part_get, _ ## type ## _default_text_part_get)
+ EFL_OBJECT_OP_FUNC(efl_ui_widget_default_text_part_get, _ ## type ## _default_text_part_get)
#define ELM_PART_CONTENT_DEFAULT_IMPLEMENT(type, typedata) \
EOLIAN static Eina_Bool \
- _ ## type ## _efl_content_content_set(Eo *obj, typedata *sd, Evas_Object *content) \
+ _ ## type ## _efl_content_content_set(Eo *obj, typedata *sd EINA_UNUSED, Evas_Object *content) \
{ \
- return efl_content_set(efl_part(obj, _ ## type ## _default_content_part_get(obj, sd)), content); \
+ return efl_content_set(efl_part(obj, efl_ui_widget_default_content_part_get(obj)), content); \
} \
\
EOLIAN static Evas_Object* \
- _ ## type ## _efl_content_content_get(Eo *obj, typedata *sd) \
+ _ ## type ## _efl_content_content_get(const Eo *obj, typedata *sd EINA_UNUSED) \
{ \
- return efl_content_get(efl_part(obj, _ ## type ## _default_content_part_get(obj, sd))); \
+ return efl_content_get(efl_part(obj, efl_ui_widget_default_content_part_get(obj))); \
} \
\
EOLIAN static Evas_Object* \
- _ ## type ## _efl_content_content_unset(Eo *obj, typedata *sd) \
+ _ ## type ## _efl_content_content_unset(Eo *obj, typedata *sd EINA_UNUSED) \
{ \
- return efl_content_unset(efl_part(obj, _ ## type ## _default_content_part_get(obj, sd))); \
+ return efl_content_unset(efl_part(obj, efl_ui_widget_default_content_part_get(obj))); \
}
static inline Eo *
@@ -57,8 +57,6 @@ _elm_part_initialize(Eo *proxy, Eo *obj, const char *part)
Elm_Part_Data *pd = efl_data_scope_get(proxy, EFL_UI_WIDGET_PART_CLASS);
EINA_SAFETY_ON_FALSE_RETURN_VAL(pd && obj && part, NULL);
- efl_allow_parent_unref_set(proxy, 1);
- ___efl_auto_unref_set(proxy, 1);
pd->part = eina_tmpstr_add(part);
pd->obj = obj;
@@ -68,144 +66,167 @@ _elm_part_initialize(Eo *proxy, Eo *obj, const char *part)
static inline Eo *
ELM_PART_IMPLEMENT(const Efl_Class *part_klass, const Eo *obj, const char *part)
{
- return efl_add(part_klass, NULL,
+ return efl_add(part_klass, (Eo *) obj,
_elm_part_initialize(efl_added, (Eo *) obj, part));
}
#define ELM_PART_OVERRIDE_PARTIAL(type, TYPE, typedata, _is_part_cb) \
EOLIAN static Efl_Object * \
- _ ## type ## _efl_part_part(const Eo *obj, typedata *priv EINA_UNUSED, const char *part) \
+ _ ## type ## _efl_part_part_get(const Eo *obj, typedata *priv EINA_UNUSED, const char *part) \
{ \
EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL); \
if (_is_part_cb(obj, part)) \
return ELM_PART_IMPLEMENT(TYPE ## _PART_CLASS, obj, part); \
- return efl_part(efl_super(obj, MY_CLASS), part); \
+ return efl_part_get(efl_super(obj, TYPE ## _CLASS), part); \
}
#define ELM_PART_OVERRIDE(type, TYPE, typedata) \
EOLIAN static Efl_Object * \
-_ ## type ## _efl_part_part(const Eo *obj, typedata *priv EINA_UNUSED, const char *part) \
+_ ## type ## _efl_part_part_get(const Eo *obj, typedata *priv EINA_UNUSED, const char *part) \
{ \
EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL); \
return ELM_PART_IMPLEMENT(TYPE ## _PART_CLASS, obj, part); \
}
-#define ELM_PART_OVERRIDE_CONTENT_SET_FULL(full, type, TYPE, typedata) \
+#define ELM_PART_OVERRIDE_INTERNALS_FETCH(TYPE, typedata) \
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); \
+ typedata *sd = efl_data_scope_get(pd->obj, TYPE ## _CLASS);
+
+#define ELM_PART_OVERRIDE_INTERNALS_FETCH_NO_SD() \
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); \
+ void *sd = NULL;
+
+#define ELM_PART_OVERRIDE_CONTENT_SET_FULL(full, type, internals) \
EOLIAN static Eina_Bool \
-_ ## full ## _efl_content_content_set(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *content) \
+_ ## full ## _efl_content_content_set(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx_Entity *content) \
{ \
- Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); \
- typedata *sd = efl_data_scope_get(pd->obj, TYPE ## _CLASS); \
+ internals \
return _ ## type ## _content_set(pd->obj, sd, pd->part, content); \
}
-#define ELM_PART_OVERRIDE_CONTENT_GET_FULL(full, type, TYPE, typedata) \
-EOLIAN static Efl_Gfx * \
-_ ## full ## _efl_content_content_get(Eo *obj, void *_pd EINA_UNUSED) \
+#define ELM_PART_OVERRIDE_CONTENT_GET_FULL(full, type, internals) \
+EOLIAN static Efl_Gfx_Entity * \
+_ ## full ## _efl_content_content_get(const Eo *obj, void *_pd EINA_UNUSED) \
{ \
- Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); \
- typedata *sd = efl_data_scope_get(pd->obj, TYPE ## _CLASS); \
+ internals \
return _ ## type ## _content_get(pd->obj, sd, pd->part); \
}
-#define ELM_PART_OVERRIDE_CONTENT_UNSET_FULL(full, type, TYPE, typedata) \
-EOLIAN static Efl_Gfx * \
+#define ELM_PART_OVERRIDE_CONTENT_UNSET_FULL(full, type, internals) \
+EOLIAN static Efl_Gfx_Entity * \
_ ## full ## _efl_content_content_unset(Eo *obj, void *_pd EINA_UNUSED) \
{ \
- Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); \
- typedata *sd = efl_data_scope_get(pd->obj, TYPE ## _CLASS); \
+ internals \
return _ ## type ## _content_unset(pd->obj, sd, pd->part); \
}
-#define ELM_PART_OVERRIDE_TEXT_SET_FULL(full, type, TYPE, typedata) \
+#define ELM_PART_OVERRIDE_TEXT_TEXT_SET_FULL(full, type, internals) \
EOLIAN static void \
_ ## full ## _efl_text_text_set(Eo *obj, void *_pd EINA_UNUSED, const char *text) \
{ \
- Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); \
- typedata *sd = efl_data_scope_get(pd->obj, TYPE ## _CLASS); \
+ internals \
_ ## type ## _text_set(pd->obj, sd, pd->part, text); \
}
-#define ELM_PART_OVERRIDE_TEXT_GET_FULL(full, type, TYPE, typedata) \
+#define ELM_PART_OVERRIDE_TEXT_TEXT_GET_FULL(full, type, internals) \
EOLIAN static const char *\
-_ ## full ## _efl_text_text_get(Eo *obj, void *_pd EINA_UNUSED) \
+_ ## full ## _efl_text_text_get(const Eo *obj, void *_pd EINA_UNUSED) \
{ \
- Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); \
- typedata *sd = efl_data_scope_get(pd->obj, TYPE ## _CLASS); \
+ internals \
return _ ## type ## _text_get(pd->obj, sd, pd->part); \
}
-#define ELM_PART_OVERRIDE_TEXT_MARKUP_GET_FULL(full, type, TYPE, typedata) \
+#define ELM_PART_OVERRIDE_TEXT_MARKUP_GET_FULL(full, type, internals) \
EOLIAN static const char *\
-_ ## full ## _efl_text_markup_markup_get(Eo *obj, void *_pd EINA_UNUSED) \
+_ ## full ## _efl_text_markup_markup_get(const Eo *obj, void *_pd EINA_UNUSED) \
{ \
- Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); \
- typedata *sd = efl_data_scope_get(pd->obj, TYPE ## _CLASS); \
+ internals \
return _ ## type ## _text_markup_get(pd->obj, sd, pd->part); \
}
-#define ELM_PART_OVERRIDE_TEXT_MARKUP_SET_FULL(full, type, TYPE, typedata) \
+#define ELM_PART_OVERRIDE_TEXT_MARKUP_SET_FULL(full, type, internals) \
EOLIAN static void \
_ ## full ## _efl_text_markup_markup_set(Eo *obj, void *_pd EINA_UNUSED, const char *markup) \
{ \
- Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); \
- typedata *sd = efl_data_scope_get(pd->obj, TYPE ## _CLASS); \
+ internals \
_ ## type ## _text_markup_set(pd->obj, sd, pd->part, markup); \
}
#define ELM_PART_OVERRIDE_CONTENT_SET(type, TYPE, typedata) \
- ELM_PART_OVERRIDE_CONTENT_SET_FULL(type ## _part, type, TYPE, typedata)
+ ELM_PART_OVERRIDE_CONTENT_SET_FULL(type ## _part, type, ELM_PART_OVERRIDE_INTERNALS_FETCH(TYPE, typedata))
#define ELM_PART_OVERRIDE_CONTENT_GET(type, TYPE, typedata) \
- ELM_PART_OVERRIDE_CONTENT_GET_FULL(type ## _part, type, TYPE, typedata)
+ ELM_PART_OVERRIDE_CONTENT_GET_FULL(type ## _part, type, ELM_PART_OVERRIDE_INTERNALS_FETCH(TYPE, typedata))
#define ELM_PART_OVERRIDE_CONTENT_UNSET(type, TYPE, typedata) \
- ELM_PART_OVERRIDE_CONTENT_UNSET_FULL(type ## _part, type, TYPE, typedata)
+ ELM_PART_OVERRIDE_CONTENT_UNSET_FULL(type ## _part, type, ELM_PART_OVERRIDE_INTERNALS_FETCH(TYPE, typedata))
#define ELM_PART_OVERRIDE_TEXT_SET(type, TYPE, typedata) \
- ELM_PART_OVERRIDE_TEXT_SET_FULL(type ## _part, type, TYPE, typedata)
+ ELM_PART_OVERRIDE_TEXT_TEXT_SET_FULL(type ## _part, type, ELM_PART_OVERRIDE_INTERNALS_FETCH(TYPE, typedata))
#define ELM_PART_OVERRIDE_TEXT_GET(type, TYPE, typedata) \
- ELM_PART_OVERRIDE_TEXT_GET_FULL(type ## _part, type, TYPE, typedata)
+ ELM_PART_OVERRIDE_TEXT_TEXT_GET_FULL(type ## _part, type, ELM_PART_OVERRIDE_INTERNALS_FETCH(TYPE, typedata))
#define ELM_PART_OVERRIDE_MARKUP_SET(type, TYPE, typedata) \
- ELM_PART_OVERRIDE_TEXT_MARKUP_SET_FULL(type ## _part, type, TYPE, typedata)
+ ELM_PART_OVERRIDE_TEXT_MARKUP_SET_FULL(type ## _part, type, ELM_PART_OVERRIDE_INTERNALS_FETCH(TYPE, typedata))
#define ELM_PART_OVERRIDE_MARKUP_GET(type, TYPE, typedata) \
- ELM_PART_OVERRIDE_TEXT_MARKUP_GET_FULL(type ## _part, type, TYPE, typedata)
+ ELM_PART_OVERRIDE_TEXT_MARKUP_GET_FULL(type ## _part, type, ELM_PART_OVERRIDE_INTERNALS_FETCH(TYPE, typedata))
-#define ELM_PART_TEXT_DEFAULT_IMPLEMENT(type, Type) \
+#define ELM_PART_OVERRIDE_CONTENT_SET_NO_SD(type) \
+ ELM_PART_OVERRIDE_CONTENT_SET_FULL(type ## _part, type, ELM_PART_OVERRIDE_INTERNALS_FETCH_NO_SD())
+
+#define ELM_PART_OVERRIDE_CONTENT_GET_NO_SD(type) \
+ ELM_PART_OVERRIDE_CONTENT_GET_FULL(type ## _part, type, ELM_PART_OVERRIDE_INTERNALS_FETCH_NO_SD())
+
+#define ELM_PART_OVERRIDE_CONTENT_UNSET_NO_SD(type) \
+ ELM_PART_OVERRIDE_CONTENT_UNSET_FULL(type ## _part, type, ELM_PART_OVERRIDE_INTERNALS_FETCH_NO_SD())
+
+#define ELM_PART_OVERRIDE_TEXT_SET_NO_SD(type) \
+ ELM_PART_OVERRIDE_TEXT_TEXT_SET_FULL(type ## _part, type, ELM_PART_OVERRIDE_INTERNALS_FETCH_NO_SD())
+
+#define ELM_PART_OVERRIDE_TEXT_GET_NO_SD(type) \
+ ELM_PART_OVERRIDE_TEXT_TEXT_GET_FULL(type ## _part, type, ELM_PART_OVERRIDE_INTERNALS_FETCH_NO_SD())
+
+#define ELM_PART_OVERRIDE_MARKUP_SET_NO_SD(type) \
+ ELM_PART_OVERRIDE_TEXT_MARKUP_SET_FULL(type ## _part, type, ELM_PART_OVERRIDE_INTERNALS_FETCH_NO_SD())
+
+#define ELM_PART_OVERRIDE_MARKUP_GET_NO_SD(type) \
+ ELM_PART_OVERRIDE_TEXT_MARKUP_GET_FULL(type ## _part, type, ELM_PART_OVERRIDE_INTERNALS_FETCH_NO_SD())
+
+
+#define ELM_PART_TEXT_DEFAULT_IMPLEMENT(type, typedata) \
EOLIAN static void \
-_ ## type ## _efl_text_text_set(Eo *obj, Type *pd EINA_UNUSED, const char *text) \
+_ ## type ## _efl_text_text_set(Eo *obj, typedata *sd EINA_UNUSED, const char *text) \
{ \
- efl_text_set(efl_part(efl_super(obj, MY_CLASS), "elm.text"), text); \
+ efl_text_set(efl_part(obj, efl_ui_widget_default_text_part_get(obj)), text); \
} \
EOLIAN static const char * \
-_ ## type ## _efl_text_text_get(Eo *obj, Type *pd EINA_UNUSED) \
+_ ## type ## _efl_text_text_get(const Eo *obj, typedata *sd EINA_UNUSED) \
{ \
- return efl_text_get(efl_part(efl_super(obj, MY_CLASS), "elm.text")); \
+ return efl_text_get(efl_part(obj, efl_ui_widget_default_text_part_get(obj))); \
} \
EOLIAN static void \
-_ ## type ## _efl_ui_translatable_translatable_text_set(Eo *obj, Type *pd EINA_UNUSED, const char *label, const char *domain) \
+_ ## type ## _efl_ui_translatable_translatable_text_set(Eo *obj, typedata *sd EINA_UNUSED, const char *label, const char *domain) \
{ \
- efl_ui_translatable_text_set(efl_part(efl_super(obj, MY_CLASS), "elm.text"), label, domain); \
+ efl_ui_translatable_text_set(efl_part(obj, efl_ui_widget_default_text_part_get(obj)), label, domain); \
} \
EOLIAN static const char * \
-_ ## type ## _efl_ui_translatable_translatable_text_get(Eo *obj, Type *pd EINA_UNUSED, const char **domain) \
+_ ## type ## _efl_ui_translatable_translatable_text_get(const Eo *obj, typedata *sd EINA_UNUSED, const char **domain) \
{ \
- return efl_ui_translatable_text_get(efl_part(efl_super(obj, MY_CLASS), "elm.text"), domain); \
+ return efl_ui_translatable_text_get(efl_part(obj, efl_ui_widget_default_text_part_get(obj)), domain); \
}
-#define ELM_PART_MARKUP_DEFAULT_IMPLEMENT(type, Type) \
+#define ELM_PART_MARKUP_DEFAULT_IMPLEMENT(type, typedata) \
EOLIAN static const char * \
-_ ## type ## _efl_text_markup_markup_get(Eo *obj, Type *pd EINA_UNUSED) \
+_ ## type ## _efl_text_markup_markup_get(const Eo *obj, typedata *sd EINA_UNUSED) \
{ \
- return efl_text_markup_get(efl_part(efl_super(obj, MY_CLASS), "elm.text")); \
+ return efl_text_markup_get(efl_part(obj, efl_ui_widget_default_text_part_get(obj))); \
} \
EOLIAN static void \
-_ ## type ## _efl_text_markup_markup_set(Eo *obj, Type *pd EINA_UNUSED, const char *markup) \
+_ ## type ## _efl_text_markup_markup_set(Eo *obj, typedata *sd EINA_UNUSED, const char *markup) \
{ \
- efl_text_markup_set(efl_part(efl_super(obj, MY_CLASS), "elm.text"), markup); \
-} \
+ efl_text_markup_set(efl_part(obj, efl_ui_widget_default_text_part_get(obj)), markup); \
+}
#endif
diff --git a/src/lib/elementary/elm_photo.c b/src/lib/elementary/elm_photo.c
index 531cc0c5e7..8a92e62a05 100644
--- a/src/lib/elementary/elm_photo.c
+++ b/src/lib/elementary/elm_photo.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#include <Elementary.h>
@@ -37,7 +37,7 @@ _sizing_eval(Evas_Object *obj)
if (sd->size <= 0) return;
- scale = (sd->size * efl_gfx_scale_get(obj) * elm_config_scale_get());
+ scale = (sd->size * efl_gfx_entity_scale_get(obj) * elm_config_scale_get());
evas_object_size_hint_min_set(sd->icon, scale, scale);
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
@@ -50,7 +50,7 @@ _sizing_eval(Evas_Object *obj)
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_photo_elm_widget_theme_apply(Eo *obj, Elm_Photo_Data *sd)
+_elm_photo_efl_ui_widget_theme_apply(Eo *obj, Elm_Photo_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
@@ -65,10 +65,10 @@ _elm_photo_elm_widget_theme_apply(Eo *obj, Elm_Photo_Data *sd)
(obj, wd->resize_obj, "photo", "base",
elm_widget_style_get(obj));
- elm_object_scale_set(sd->icon, efl_gfx_scale_get(obj));
+ elm_object_scale_set(sd->icon, efl_gfx_entity_scale_get(obj));
edje_object_scale_set(wd->resize_obj,
- efl_gfx_scale_get(obj) * elm_config_scale_get());
+ efl_gfx_entity_scale_get(obj) * elm_config_scale_get());
_sizing_eval(obj);
return int_ret;
@@ -260,7 +260,7 @@ _elm_photo_efl_canvas_group_group_add(Eo *obj, Elm_Photo_Data *priv)
elm_image_fill_outside_set(priv->icon, !priv->fill_inside);
elm_image_prescale_set(priv->icon, 0);
- elm_object_scale_set(priv->icon, efl_gfx_scale_get(obj));
+ elm_object_scale_set(priv->icon, efl_gfx_entity_scale_get(obj));
evas_object_event_callback_add
(priv->icon, EVAS_CALLBACK_MOUSE_UP, _mouse_up, obj);
@@ -306,7 +306,7 @@ _elm_photo_efl_object_constructor(Eo *obj, Elm_Photo_Data *_pd EINA_UNUSED)
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_IMAGE);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_IMAGE);
return obj;
}
diff --git a/src/lib/elementary/elm_photo.eo b/src/lib/elementary/elm_photo.eo
index aa68685d1e..bd9e986142 100644
--- a/src/lib/elementary/elm_photo.eo
+++ b/src/lib/elementary/elm_photo.eo
@@ -1,4 +1,5 @@
-class Elm.Photo (Elm.Widget, Efl.File, Efl.Ui.Clickable, Efl.Ui.Draggable)
+class Elm.Photo (Efl.Ui.Widget, Efl.File, Efl.Ui.Clickable, Efl.Ui.Draggable,
+ Efl.Ui.Legacy)
{
[[Elementary photo class]]
legacy_prefix: elm_photo;
@@ -7,6 +8,6 @@ class Elm.Photo (Elm.Widget, Efl.File, Efl.Ui.Clickable, Efl.Ui.Draggable)
class.constructor;
Efl.Object.constructor;
Efl.File.file { set; }
- Elm.Widget.theme_apply;
+ Efl.Ui.Widget.theme_apply;
}
}
diff --git a/src/lib/elementary/elm_photocam_legacy.h b/src/lib/elementary/elm_photocam_legacy.h
index 309644b066..b56f8b018b 100644
--- a/src/lib/elementary/elm_photocam_legacy.h
+++ b/src/lib/elementary/elm_photocam_legacy.h
@@ -1,5 +1,7 @@
#include "interfaces/efl_ui_zoom.eo.legacy.h"
+typedef Eo Elm_Photocam;
+
/**
* @brief Add a new Photocam object
*
diff --git a/src/lib/elementary/elm_player.eo b/src/lib/elementary/elm_player.eo
index bb2d95bb24..e8f607cc77 100644
--- a/src/lib/elementary/elm_player.eo
+++ b/src/lib/elementary/elm_player.eo
@@ -1,4 +1,4 @@
-class Elm.Player (Efl.Ui.Layout, Efl.Access.Widget.Action)
+class Elm.Player (Efl.Ui.Layout.Object, Efl.Access.Widget.Action, Efl.Ui.Legacy)
{
[[Elementary player class]]
legacy_prefix: elm_player;
@@ -7,22 +7,22 @@ class Elm.Player (Efl.Ui.Layout, Efl.Access.Widget.Action)
implements {
class.constructor;
Efl.Object.constructor;
- Elm.Widget.theme_apply;
- Elm.Widget.widget_event;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.widget_event;
Efl.Access.Widget.Action.elm_actions { get; }
- Efl.Part.part;
+ Efl.Part.part_get;
}
events {
- forward,clicked; [[Called when forward was clicked]]
- info,clicked; [[Called when info was clicked]]
- next,clicked; [[Called when next was clicked]]
- pause,clicked; [[Called when pause was clicked]]
- play,clicked; [[Called when play was clicked]]
- prev,clicked; [[Called when previous was clicked]]
- rewind,clicked; [[Called when rewind was clicked]]
- quality,clicked; [[Called when quality was clicked]]
- eject,clicked; [[Called when eject was clicked]]
- volume,clicked; [[Called when volume was clicked]]
- mute,clicked; [[Called when mute was clicked]]
+ forward,clicked: void; [[Called when forward was clicked]]
+ info,clicked: void; [[Called when info was clicked]]
+ next,clicked: void; [[Called when next was clicked]]
+ pause,clicked: void; [[Called when pause was clicked]]
+ play,clicked: void; [[Called when play was clicked]]
+ prev,clicked: void; [[Called when previous was clicked]]
+ rewind,clicked: void; [[Called when rewind was clicked]]
+ quality,clicked: void; [[Called when quality was clicked]]
+ eject,clicked: void; [[Called when eject was clicked]]
+ volume,clicked: void; [[Called when volume was clicked]]
+ mute,clicked: void; [[Called when mute was clicked]]
}
}
diff --git a/src/lib/elementary/elm_plug.c b/src/lib/elementary/elm_plug.c
index 62bb83b90c..13312643b1 100644
--- a/src/lib/elementary/elm_plug.c
+++ b/src/lib/elementary/elm_plug.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#include <Elementary.h>
@@ -59,13 +59,13 @@ _elm_plug_resized(Ecore_Evas *ee)
}
EOLIAN static Eina_Bool
-_elm_plug_elm_widget_on_focus_update(Eo *obj, void *sd EINA_UNUSED, Elm_Object_Item *item EINA_UNUSED)
+_elm_plug_efl_ui_focus_object_on_focus_update(Eo *obj, void *sd EINA_UNUSED)
{
Eina_Bool int_ret = EINA_FALSE;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
- int_ret = efl_ui_widget_on_focus_update(efl_super(obj, MY_CLASS), NULL);
+ int_ret = efl_ui_focus_object_on_focus_update(efl_super(obj, MY_CLASS));
if (!int_ret) return EINA_FALSE;
if (efl_ui_focus_object_focus_get(obj))
@@ -81,7 +81,7 @@ _elm_plug_elm_widget_on_focus_update(Eo *obj, void *sd EINA_UNUSED, Elm_Object_I
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_plug_elm_widget_theme_apply(Eo *obj, void *sd EINA_UNUSED)
+_elm_plug_efl_ui_widget_theme_apply(Eo *obj, void *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
@@ -145,13 +145,13 @@ _elm_plug_efl_object_constructor(Eo *obj, void *sd EINA_UNUSED)
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_IMAGE);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_IMAGE);
return obj;
}
EOLIAN static Evas_Object*
-_elm_plug_image_object_get(Eo *obj, void *sd EINA_UNUSED)
+_elm_plug_image_object_get(const Eo *obj, void *sd EINA_UNUSED)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
return wd->resize_obj;
diff --git a/src/lib/elementary/elm_plug.eo b/src/lib/elementary/elm_plug.eo
index f1e4d292a1..d5a54b27b4 100644
--- a/src/lib/elementary/elm_plug.eo
+++ b/src/lib/elementary/elm_plug.eo
@@ -1,4 +1,4 @@
-class Elm.Plug (Elm.Widget, Efl.Ui.Clickable)
+class Elm.Plug (Efl.Ui.Widget, Efl.Ui.Clickable, Efl.Ui.Legacy)
{
[[Elementary plug class]]
legacy_prefix: elm_plug;
@@ -33,11 +33,11 @@ class Elm.Plug (Elm.Widget, Efl.Ui.Clickable)
implements {
class.constructor;
Efl.Object.constructor;
- Elm.Widget.theme_apply;
- Elm.Widget.on_focus_update;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Focus.Object.on_focus_update;
}
events {
- image,deleted; [[Called when image was deleted]]
- image,resized; [[Called when image was resized]]
+ image,deleted: void; [[Called when image was deleted]]
+ image,resized: Eina.Position2D; [[Called when image was resized]]
}
}
diff --git a/src/lib/elementary/elm_popup.eo b/src/lib/elementary/elm_popup.eo
index 347624894f..772504de9f 100644
--- a/src/lib/elementary/elm_popup.eo
+++ b/src/lib/elementary/elm_popup.eo
@@ -23,7 +23,7 @@ enum Elm.Popup.Orient
}
-class Elm.Popup (Efl.Ui.Layout, Efl.Access.Widget.Action)
+class Elm.Popup (Efl.Ui.Layout.Object, Efl.Access.Widget.Action, Efl.Ui.Legacy)
{
[[Elementary popup class]]
legacy_prefix: elm_popup;
@@ -168,23 +168,23 @@ class Elm.Popup (Efl.Ui.Layout, Efl.Access.Widget.Action)
implements {
class.constructor;
Efl.Object.constructor;
- Elm.Widget.theme_apply;
- Elm.Widget.on_access_update;
- Elm.Widget.widget_parent { set; }
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.on_access_update;
+ Efl.Ui.Widget.widget_parent { set; }
Efl.Ui.Translatable.translation_update;
- Elm.Widget.widget_sub_object_del;
- Elm.Widget.widget_event;
+ Efl.Ui.Widget.widget_sub_object_del;
+ Efl.Ui.Widget.widget_event;
Efl.Layout.Signal.signal_emit;
Efl.Access.Widget.Action.elm_actions { get; }
- Efl.Access.state_set { get; }
- Efl.Access.name { get; }
- Efl.Part.part;
+ Efl.Access.Object.state_set { get; }
+ Efl.Access.Object.i18n_name { get; }
+ Efl.Part.part_get;
}
events {
- block,clicked; [[Called when popup was clicked]]
- timeout; [[Called when popup timed out]]
- item,focused; [[Called when popup got focus]]
- item,unfocused; [[Called when popup lost focus]]
- dismissed; [[Called when popup was dismissed]]
+ block,clicked: void; [[Called when popup was clicked]]
+ timeout: void; [[Called when popup timed out]]
+ item,focused: Efl.Object; [[Called when popup got focus]]
+ item,unfocused: Efl.Object; [[Called when popup lost focus]]
+ dismissed: void; [[Called when popup was dismissed]]
}
}
diff --git a/src/lib/elementary/elm_popup_item.eo b/src/lib/elementary/elm_popup_item.eo
index dcf95772b3..7668b17d41 100644
--- a/src/lib/elementary/elm_popup_item.eo
+++ b/src/lib/elementary/elm_popup_item.eo
@@ -1,4 +1,4 @@
-class Elm.Popup.Item(Elm.Widget.Item)
+class Elm.Popup.Item(Elm.Widget.Item, Efl.Ui.Legacy)
{
[[Elementary popup item class]]
legacy_prefix: elm_popup_item;
diff --git a/src/lib/elementary/elm_prefs.c b/src/lib/elementary/elm_prefs.c
index 0077789ef3..d9d48a4c21 100644
--- a/src/lib/elementary/elm_prefs.c
+++ b/src/lib/elementary/elm_prefs.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#include <Elementary.h>
@@ -492,7 +492,7 @@ _elm_prefs_efl_object_constructor(Eo *obj, Elm_Prefs_Data *_pd EINA_UNUSED)
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _elm_prefs_smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_REDUNDANT_OBJECT);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_REDUNDANT_OBJECT);
return obj;
}
@@ -1155,7 +1155,7 @@ _elm_prefs_efl_file_file_set(Eo *obj, Elm_Prefs_Data *sd, const char *file, cons
}
EOLIAN static void
-_elm_prefs_efl_file_file_get(Eo *obj EINA_UNUSED, Elm_Prefs_Data *sd, const char **file, const char **page)
+_elm_prefs_efl_file_file_get(const Eo *obj EINA_UNUSED, Elm_Prefs_Data *sd, const char **file, const char **page)
{
if (file) *file = sd->file;
if (page) *page = sd->page;
@@ -1200,7 +1200,7 @@ end:
}
EOLIAN static Elm_Prefs_Data*
-_elm_prefs_data_get(Eo *obj EINA_UNUSED, Elm_Prefs_Data *sd)
+_elm_prefs_data_get(const Eo *obj EINA_UNUSED, Elm_Prefs_Data *sd)
{
if (!sd->root) return NULL;
else return sd->prefs_data;
@@ -1235,7 +1235,7 @@ _elm_prefs_autosave_set(Eo *obj, Elm_Prefs_Data *_pd EINA_UNUSED, Eina_Bool auto
}
EOLIAN static Eina_Bool
-_elm_prefs_autosave_get(Eo *obj EINA_UNUSED, Elm_Prefs_Data *sd)
+_elm_prefs_autosave_get(const Eo *obj EINA_UNUSED, Elm_Prefs_Data *sd)
{
return sd->autosave;
}
diff --git a/src/lib/elementary/elm_prefs.eo b/src/lib/elementary/elm_prefs.eo
index bfb0cf85dc..30d22e7869 100644
--- a/src/lib/elementary/elm_prefs.eo
+++ b/src/lib/elementary/elm_prefs.eo
@@ -1,9 +1,7 @@
-import eina_types;
-
type Elm_Prefs_Data: __undefined_type; [[Elementary preferences data type]]
type Elm_Prefs_Reset_Mode: __undefined_type; [[Elementary preferences reset mode type]]
-class Elm.Prefs (Elm.Widget, Efl.File)
+class Elm.Prefs (Efl.Ui.Widget, Efl.File, Efl.Ui.Legacy)
{
[[Elementary preferences class]]
legacy_prefix: elm_prefs;
@@ -218,11 +216,13 @@ class Elm.Prefs (Elm.Widget, Efl.File)
Efl.File.file { get; set; }
}
events {
- page,changed; [[Called when page changed]]
- page,saved; [[Called when page was saved]]
+ page,changed: string; [[Called when page changed]]
+ page,saved: string; [[Called when page was saved]]
+ /* FIXME: Nobody emits this
page,reset; [[Called when page was reset]]
- page,loaded; [[Called when page got loaded]]
- item,changed; [[Called when item changed]]
- action; [[Called when action was done]]
+ */
+ page,loaded: string; [[Called when page got loaded]]
+ item,changed: string; [[Called when item changed]]
+ action: string; [[Called when action was done]]
}
}
diff --git a/src/lib/elementary/elm_priv.h b/src/lib/elementary/elm_priv.h
index a3e15c1ea6..76d51b982b 100644
--- a/src/lib/elementary/elm_priv.h
+++ b/src/lib/elementary/elm_priv.h
@@ -38,10 +38,10 @@
# else
# error "no DLL_EXPORT"
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EVAS_BUILD */
+# endif
# define EAPI_WEAK
# else
# ifdef __GNUC__
@@ -56,7 +56,7 @@
# define EAPI
# define EAPI_WEAK
# endif
-# endif /* ! _WIN32 */
+# endif
# define EWAPI EAPI EAPI_WEAK
@@ -64,8 +64,11 @@
# include "elm_access.eo.h"
# include "elm_code_private.h"
# include "efl_ui_focus_parent_provider.eo.h"
+# include "efl_ui_widget_focus_manager.eo.h"
# include "efl_ui_focus_parent_provider_standard.eo.h"
# include "elm_widget_item_static_focus.eo.h"
+#include "efl_selection_manager.eo.h"
+# include "efl_datetime_manager.eo.h"
# ifdef HAVE_LANGINFO_H
# include <langinfo.h>
@@ -115,21 +118,24 @@ struct _Edje_Signal_Data
void *data;
};
-struct _Elm_Theme_Files
+typedef struct Elm_Theme_File
{
+ EINA_INLIST;
/*
* We are conserving a list of path even if that's duplicated
* because we expose those directly to the outside world :'(
*/
- Eina_List *items;
- Eina_List *handles;
-};
+ Eina_Stringshare *item;
+ Eina_File *handle;
+ Eina_Stringshare *base_theme; // data.item: efl_theme_base name
+ Eina_Stringshare *match_theme; // data.item: efl_theme_match name
+} Elm_Theme_File;
struct _Elm_Theme
{
- Elm_Theme_Files overlay;
- Elm_Theme_Files themes;
- Elm_Theme_Files extension;
+ Eina_Inlist *overlay;
+ Eina_Inlist *themes;
+ Eina_Inlist *extension;
Eina_Hash *cache;
Eina_Hash *cache_data;
@@ -138,6 +144,11 @@ struct _Elm_Theme
const char *theme;
int ref;
Eina_Hash *cache_style_load_failed;
+
+ /* these only exist to preserve compat with bad elm_theme_XYZ_list_get() api */
+ Eina_List *overlay_items;
+ Eina_List *theme_items;
+ Eina_List *extension_items;
};
/* increment this whenever we change config enough that you need new
@@ -148,7 +159,7 @@ struct _Elm_Theme
* the users config doesn't need to be wiped - simply new values need
* to be put in
*/
-# define ELM_CONFIG_FILE_GENERATION 0x000f
+# define ELM_CONFIG_FILE_GENERATION 0x0011
# define ELM_CONFIG_VERSION_EPOCH_OFFSET 16
# define ELM_CONFIG_VERSION ((ELM_CONFIG_EPOCH << ELM_CONFIG_VERSION_EPOCH_OFFSET) | \
ELM_CONFIG_FILE_GENERATION)
@@ -281,6 +292,7 @@ struct _Elm_Config_Flags
Eina_Bool glayer_flick_time_limit_ms : 1; // unused
Eina_Bool glayer_long_tap_start_timeout : 1;
Eina_Bool glayer_double_tap_timeout : 1;
+ Eina_Bool glayer_tap_finger_size : 1;
Eina_Bool access_mode : 1;
Eina_Bool glayer_continues_enable : 1; // unused
Eina_Bool week_start : 1; // unused
@@ -326,6 +338,7 @@ struct _Elm_Config_Flags
Eina_Bool gl_msaa : 1;
Eina_Bool icon_theme : 1;
Eina_Bool entry_select_allow : 1; // unused
+ Eina_Bool drag_anim_duration : 1;
};
struct _Elm_Config
@@ -415,6 +428,7 @@ struct _Elm_Config
unsigned int glayer_flick_time_limit_ms;
double glayer_long_tap_start_timeout;
double glayer_double_tap_timeout;
+ int glayer_tap_finger_size;
Eina_Bool access_mode;
unsigned char glayer_continues_enable;
int week_start;
@@ -462,6 +476,7 @@ struct _Elm_Config
unsigned char entry_select_allow;
Eina_Bool offline;
int powersave;
+ double drag_anim_duration;
/* Not part of the EET file */
Eina_Bool is_mirrored : 1;
@@ -520,9 +535,6 @@ void _elm_prefs_shutdown(void);
void _elm_prefs_data_init(void);
void _elm_prefs_data_shutdown(void);
-void _elm_emotion_init(void);
-void _elm_emotion_shutdown(void);
-
int _elm_ews_wm_init(void);
void _elm_ews_wm_shutdown(void);
void _elm_ews_wm_rescale(Elm_Theme *th,
@@ -585,7 +597,7 @@ void _elm_unneed_ethumb(void);
void _elm_unneed_web(void);
void _elm_rescale(void);
-Eina_Bool _elm_clouseau_reload(void);
+Eina_Bool _elm_old_clouseau_reload(void);
void _elm_config_init(void);
void _elm_config_sub_init(void);
@@ -652,6 +664,13 @@ void elm_cursor_theme(Elm_Cursor *cur);
void elm_object_sub_cursor_set(Evas_Object *eventarea,
Evas_Object *owner,
const char *cursor);
+const char * elm_object_sub_cursor_get(const Evas_Object *obj);
+Eina_Bool elm_object_sub_cursor_style_set(Evas_Object *obj,
+ const char *style);
+const char * elm_object_sub_cursor_style_get(const Evas_Object *obj);
+Eina_Bool elm_object_sub_cursor_theme_search_enabled_set(Evas_Object *obj,
+ Eina_Bool theme_search);
+Eina_Bool elm_object_sub_cursor_theme_search_enabled_get(const Evas_Object *obj);
void elm_menu_clone(Evas_Object *from_menu,
Evas_Object *to_menu,
@@ -720,6 +739,17 @@ void *_elm_icon_signal_callback_del(Evas_Object *obj,
/* DO NOT USE THIS this is only for performance optimization! */
void _elm_widget_full_eval(Eo *obj);
+void _elm_widget_full_eval_children(Eo *obj, Elm_Widget_Smart_Data *pd);
+
+EOAPI void efl_page_transition_page_size_set(Eo *obj, Eina_Size2D sz);
+EOAPI void efl_page_transition_padding_size_set(Eo *obj, int padding);
+EOAPI void efl_page_transition_update(Eo *obj, double pos);
+EOAPI void efl_page_transition_curr_page_change(Eo *obj, double move);
+EOAPI void efl_page_transition_pack_end(Eo *obj, Efl_Gfx_Entity *subobj);
+EOAPI void efl_page_transition_loop_set(Eo *obj, Efl_Ui_Pager_Loop loop);
+
+EOAPI void efl_page_indicator_update(Eo *obj, double pos);
+EOAPI void efl_page_indicator_pack(Eo *obj, int index);
Eina_Bool _elm_config_accel_preference_parse(const char *pref, Eina_Stringshare **accel, int *gl_depth, int *gl_stencil, int *gl_msaa);
@@ -762,6 +792,8 @@ _elm_dgettext(const char *string)
# endif
+extern Eina_Bool _use_build_config;
+
/* Used by the paste handler */
void _elm_entry_entry_paste(Evas_Object *obj, const char *entry);
@@ -778,6 +810,10 @@ void efl_ui_win_inlined_parent_set(Eo *obj, Efl_Canvas_Object *parent);
/* Internal EO APIs */
const Elm_Layout_Part_Alias_Description *elm_layout_content_aliases_get(const Eo *obj);
const Elm_Layout_Part_Alias_Description *elm_layout_text_aliases_get(const Eo *obj);
+void efl_ui_slider_val_fetch(Evas_Object *obj, Eina_Bool user_event);
+void efl_ui_slider_val_set(Evas_Object *obj);
+void efl_ui_slider_down_knob(Evas_Object *obj, double button_x, double button_y);
+void efl_ui_slider_move_knob(Evas_Object *obj, double button_x, double button_y);
//void elm_layout_sizing_eval_eoapi(Eo *obj);
# define _ELM_LAYOUT_ALIASES_IMPLEMENT(_pfx, _typ) \
@@ -801,7 +837,7 @@ const Elm_Layout_Part_Alias_Description *elm_layout_text_aliases_get(const Eo *o
# define ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(_pfx, _typ) \
EOLIAN static Eina_Bool \
-_##_pfx##_elm_widget_widget_event(Eo *obj, _typ *_pd EINA_UNUSED, const Efl_Event *eo_event, Evas_Object *src EINA_UNUSED) \
+_##_pfx##_efl_ui_widget_widget_event(Eo *obj, _typ *_pd EINA_UNUSED, const Efl_Event *eo_event, Evas_Object *src EINA_UNUSED) \
{ \
Evas_Event_Key_Down *ev; \
if (eo_event->desc != EFL_EVENT_KEY_DOWN) return EINA_FALSE; \
diff --git a/src/lib/elementary/elm_progressbar_legacy.h b/src/lib/elementary/elm_progressbar_legacy.h
index 5068bc0dee..8eedf940e5 100644
--- a/src/lib/elementary/elm_progressbar_legacy.h
+++ b/src/lib/elementary/elm_progressbar_legacy.h
@@ -1,3 +1,5 @@
+typedef Eo Elm_Progressbar;
+
/**
* Add a new progress bar widget to the given parent Elementary
* (container) object
@@ -283,4 +285,4 @@ EAPI void elm_progressbar_part_value_set(Evas_Object *obj, const char *part, dou
*/
EAPI double elm_progressbar_part_value_get(const Evas_Object *obj, const char *part);
-#include "efl_ui_progressbar.eo.legacy.h" \ No newline at end of file
+#include "efl_ui_progressbar.eo.legacy.h"
diff --git a/src/lib/elementary/elm_radio_legacy.h b/src/lib/elementary/elm_radio_legacy.h
index ef7735ef38..ba8b71c53e 100644
--- a/src/lib/elementary/elm_radio_legacy.h
+++ b/src/lib/elementary/elm_radio_legacy.h
@@ -1,3 +1,5 @@
+typedef Eo Elm_Radio;
+
/**
* @brief Add a new radio to the parent
*
diff --git a/src/lib/elementary/elm_route.c b/src/lib/elementary/elm_route.c
index ba4f64e15f..0f63ce927a 100644
--- a/src/lib/elementary/elm_route.c
+++ b/src/lib/elementary/elm_route.c
@@ -87,7 +87,7 @@ _move_resize_cb(void *data EINA_UNUSED,
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_route_elm_widget_theme_apply(Eo *obj, Elm_Route_Data *sd EINA_UNUSED)
+_elm_route_efl_ui_widget_theme_apply(Eo *obj, Elm_Route_Data *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
@@ -241,14 +241,14 @@ _elm_route_emap_set(Eo *obj, Elm_Route_Data *sd, void *_emap)
}
EOLIAN static void
-_elm_route_longitude_min_max_get(Eo *obj EINA_UNUSED, Elm_Route_Data *sd, double *min, double *max)
+_elm_route_longitude_min_max_get(const Eo *obj EINA_UNUSED, Elm_Route_Data *sd, double *min, double *max)
{
if (min) *min = sd->lon_min;
if (max) *max = sd->lon_max;
}
EOLIAN static void
-_elm_route_latitude_min_max_get(Eo *obj EINA_UNUSED, Elm_Route_Data *sd, double *min, double *max)
+_elm_route_latitude_min_max_get(const Eo *obj EINA_UNUSED, Elm_Route_Data *sd, double *min, double *max)
{
if (min) *min = sd->lat_min;
if (max) *max = sd->lat_max;
diff --git a/src/lib/elementary/elm_route.eo b/src/lib/elementary/elm_route.eo
index 52340054fa..fe41b6a5bf 100644
--- a/src/lib/elementary/elm_route.eo
+++ b/src/lib/elementary/elm_route.eo
@@ -1,4 +1,4 @@
-class Elm.Route (Elm.Widget)
+class Elm.Route (Efl.Ui.Widget, Efl.Ui.Legacy)
{
[[Elementary route class]]
legacy_prefix: elm_route;
@@ -42,6 +42,6 @@ class Elm.Route (Elm.Widget)
implements {
class.constructor;
Efl.Object.constructor;
- Elm.Widget.theme_apply;
+ Efl.Ui.Widget.theme_apply;
}
}
diff --git a/src/lib/elementary/elm_scroller.c b/src/lib/elementary/elm_scroller.c
index 08b2dd17cb..25423480f4 100644
--- a/src/lib/elementary/elm_scroller.c
+++ b/src/lib/elementary/elm_scroller.c
@@ -2,8 +2,9 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
+#define EFL_PART_PROTECTED
#include <Elementary.h>
@@ -262,7 +263,7 @@ _key_action_move(Evas_Object *obj, const char *params)
}
EOLIAN static Eina_Bool
-_elm_scroller_elm_widget_on_access_activate(Eo *obj, Elm_Scroller_Data *_pd EINA_UNUSED, Efl_Ui_Activate act)
+_elm_scroller_efl_ui_widget_on_access_activate(Eo *obj, Elm_Scroller_Data *_pd EINA_UNUSED, Efl_Ui_Activate act)
{
Evas_Coord x = 0;
Evas_Coord y = 0;
@@ -384,11 +385,11 @@ static void
_mirrored_set(Evas_Object *obj,
Eina_Bool mirrored)
{
- elm_interface_scrollable_mirrored_set(obj, mirrored);
+ efl_ui_mirrored_set(obj, mirrored);
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_scroller_elm_widget_theme_apply(Eo *obj, Elm_Scroller_Data *sd EINA_UNUSED)
+_elm_scroller_efl_ui_widget_theme_apply(Eo *obj, Elm_Scroller_Data *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
@@ -417,7 +418,7 @@ _changed_size_hints_cb(void *data,
}
EOLIAN static Eina_Bool
-_elm_scroller_elm_widget_widget_sub_object_del(Eo *obj, Elm_Scroller_Data *sd, Evas_Object *sobj)
+_elm_scroller_efl_ui_widget_widget_sub_object_del(Eo *obj, Elm_Scroller_Data *sd, Evas_Object *sobj)
{
Eina_Bool int_ret = EINA_FALSE;
int_ret = elm_widget_sub_object_del(efl_super(obj, MY_CLASS), sobj);
@@ -645,7 +646,7 @@ _loop_content_set(Evas_Object *obj, Elm_Scroller_Data *sd, Evas_Object *content)
static Eina_Bool
_elm_scroller_content_set(Eo *obj, Elm_Scroller_Data *sd, const char *part, Evas_Object *content)
{
- if (part && strcmp(part, "default"))
+ if (part && strcmp(part, "elm.swallow.content"))
{
return efl_content_set(efl_part(efl_super(obj, MY_CLASS), part), content);
}
@@ -686,9 +687,9 @@ _elm_scroller_content_set(Eo *obj, Elm_Scroller_Data *sd, const char *part, Evas
}
static Evas_Object*
-_elm_scroller_content_get(Eo *obj, Elm_Scroller_Data *sd, const char *part)
+_elm_scroller_content_get(const Eo *obj, Elm_Scroller_Data *sd, const char *part)
{
- if (part && strcmp(part, "default"))
+ if (part && strcmp(part, "elm.swallow.content"))
{
return efl_content_get(efl_part(efl_super(obj, MY_CLASS), part));
}
@@ -700,7 +701,7 @@ static Evas_Object*
_elm_scroller_content_unset(Eo *obj, Elm_Scroller_Data *sd, const char *part)
{
Evas_Object *ret = NULL;
- if (part && strcmp(part, "default"))
+ if (part && strcmp(part, "elm.swallow.content"))
{
return efl_content_unset(efl_part(efl_super(obj, MY_CLASS), part));
}
@@ -721,19 +722,19 @@ _elm_scroller_content_unset(Eo *obj, Elm_Scroller_Data *sd, const char *part)
EOLIAN static Eina_Bool
_elm_scroller_efl_content_content_set(Eo *obj, Elm_Scroller_Data *sd, Eo *content)
{
- return _elm_scroller_content_set(obj, sd, "default", content);
+ return _elm_scroller_content_set(obj, sd, "elm.swallow.content", content);
}
EOLIAN static Eo *
-_elm_scroller_efl_content_content_get(Eo *obj, Elm_Scroller_Data *sd)
+_elm_scroller_efl_content_content_get(const Eo *obj, Elm_Scroller_Data *sd)
{
- return _elm_scroller_content_get(obj, sd, "default");
+ return _elm_scroller_content_get(obj, sd, "elm.swallow.content");
}
EOLIAN static Eo *
_elm_scroller_efl_content_content_unset(Eo *obj, Elm_Scroller_Data *sd)
{
- return _elm_scroller_content_unset(obj, sd, "default");
+ return _elm_scroller_content_unset(obj, sd, "elm.swallow.content");
}
static void
@@ -817,23 +818,23 @@ _elm_scroller_efl_canvas_group_group_add(Eo *obj, Elm_Scroller_Data *priv)
}
EOLIAN static void
-_elm_scroller_efl_gfx_position_set(Eo *obj, Elm_Scroller_Data *sd, Eina_Position2D pos)
+_elm_scroller_efl_gfx_entity_position_set(Eo *obj, Elm_Scroller_Data *sd, Eina_Position2D pos)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
- efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
- efl_gfx_position_set(sd->hit_rect, pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
+ efl_gfx_entity_position_set(sd->hit_rect, pos);
}
EOLIAN static void
-_elm_scroller_efl_gfx_size_set(Eo *obj, Elm_Scroller_Data *sd, Eina_Size2D sz)
+_elm_scroller_efl_gfx_entity_size_set(Eo *obj, Elm_Scroller_Data *sd, Eina_Size2D sz)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
- efl_gfx_size_set(efl_super(obj, MY_CLASS), sz);
- efl_gfx_size_set(sd->hit_rect, sz);
+ efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
+ efl_gfx_entity_size_set(sd->hit_rect, sz);
}
EOLIAN static void
@@ -867,14 +868,14 @@ _focused_element(void *data, const Efl_Event *event)
if (!focus) return;
geom = efl_ui_focus_object_focus_geometry_get(focus);
- pos = efl_gfx_position_get(obj);
+ pos = efl_gfx_entity_position_get(obj);
elm_obj_pan_pos_get(pd->pan_obj, &pan_x, &pan_y);
geom.x = geom.x + pan_x - pos.x;
geom.y = geom.y + pan_y - pos.y;
elm_interface_scrollable_region_bring_in(obj, geom.x, geom.y, geom.w, geom.h);
- geom = efl_gfx_geometry_get(obj);
+ geom = efl_gfx_entity_geometry_get(obj);
geom.x = geom.y = 0;
elm_widget_show_region_set(obj, geom, EINA_TRUE);
@@ -886,7 +887,7 @@ _elm_scroller_efl_object_constructor(Eo *obj, Elm_Scroller_Data *_pd EINA_UNUSED
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_SCROLL_PANE);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_SCROLL_PANE);
efl_event_callback_add(obj, EFL_UI_FOCUS_MANAGER_EVENT_FOCUSED, _focused_element, obj);
return obj;
}
@@ -982,7 +983,7 @@ elm_scroller_single_direction_get(const Evas_Object *obj)
}
EOLIAN static Elm_Scroller_Single_Direction
-_elm_scroller_elm_interface_scrollable_single_direction_get(Eo *obj, Elm_Scroller_Data *sd EINA_UNUSED)
+_elm_scroller_elm_interface_scrollable_single_direction_get(const Eo *obj, Elm_Scroller_Data *sd EINA_UNUSED)
{
return elm_interface_scrollable_single_direction_get(efl_super(obj, MY_CLASS));
}
@@ -1198,10 +1199,10 @@ elm_scroller_movement_block_set(Evas_Object *obj,
Efl_Ui_Scroll_Block mode = EFL_UI_SCROLL_BLOCK_NONE;
// legacy -> eo
- if (block & ELM_SCROLLER_MOVEMENT_BLOCK_HORIZONTAL)
- mode |= EFL_UI_SCROLL_BLOCK_HORIZONTAL;
- if (block & ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL)
- mode |= EFL_UI_SCROLL_BLOCK_VERTICAL;
+ if (block == ELM_SCROLLER_MOVEMENT_BLOCK_HORIZONTAL)
+ mode = EFL_UI_SCROLL_BLOCK_HORIZONTAL;
+ else if (block == ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL)
+ mode = EFL_UI_SCROLL_BLOCK_VERTICAL;
elm_interface_scrollable_movement_block_set(obj, mode);
}
@@ -1209,7 +1210,6 @@ elm_scroller_movement_block_set(Evas_Object *obj,
EAPI Elm_Scroller_Movement_Block
elm_scroller_movement_block_get(const Evas_Object *obj)
{
- Elm_Scroller_Movement_Block block = ELM_SCROLLER_MOVEMENT_NO_BLOCK;
Efl_Ui_Scroll_Block mode;
ELM_SCROLLABLE_CHECK(obj, ELM_SCROLLER_MOVEMENT_NO_BLOCK);
@@ -1217,12 +1217,12 @@ elm_scroller_movement_block_get(const Evas_Object *obj)
mode = elm_interface_scrollable_movement_block_get(obj);
// eo -> legacy
- if (mode & EFL_UI_SCROLL_BLOCK_HORIZONTAL)
- block |= ELM_SCROLLER_MOVEMENT_BLOCK_HORIZONTAL;
- if (mode & EFL_UI_SCROLL_BLOCK_VERTICAL)
- block |= ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL;
+ if (mode == EFL_UI_SCROLL_BLOCK_HORIZONTAL)
+ return ELM_SCROLLER_MOVEMENT_BLOCK_HORIZONTAL;
+ else if (mode == EFL_UI_SCROLL_BLOCK_VERTICAL)
+ return ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL;
- return block;
+ return ELM_SCROLLER_MOVEMENT_NO_BLOCK;
}
EAPI void
@@ -1260,7 +1260,7 @@ elm_scroller_loop_set(Evas_Object *obj,
sd->loop_h = loop_h;
sd->loop_v = loop_v;
- elm_interface_scrollable_loop_set(obj, loop_h, loop_v);
+ elm_interface_scrollable_content_loop_set(obj, loop_h, loop_v);
if (sd->content)
{
@@ -1298,7 +1298,7 @@ elm_scroller_loop_get(const Evas_Object *obj,
{
ELM_SCROLLABLE_CHECK(obj);
- elm_interface_scrollable_loop_get(obj, loop_h, loop_v);
+ elm_interface_scrollable_content_loop_get(obj, loop_h, loop_v);
}
EAPI void
@@ -1336,7 +1336,7 @@ _elm_scroller_class_constructor(Efl_Class *klass)
}
EOLIAN static Eina_Bool
-_elm_scroller_elm_widget_focus_state_apply(Eo *obj, Elm_Scroller_Data *pd EINA_UNUSED, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Elm_Widget *redirect EINA_UNUSED)
+_elm_scroller_efl_ui_widget_focus_state_apply(Eo *obj, Elm_Scroller_Data *pd EINA_UNUSED, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Efl_Ui_Widget *redirect EINA_UNUSED)
{
//undepended from logical or not we always reigster as full with ourself as redirect
configured_state->logical = EINA_TRUE;
@@ -1345,7 +1345,7 @@ _elm_scroller_elm_widget_focus_state_apply(Eo *obj, Elm_Scroller_Data *pd EINA_U
EOLIAN const Efl_Access_Action_Data *
-_elm_scroller_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Scroller_Data *pd EINA_UNUSED)
+_elm_scroller_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Elm_Scroller_Data *pd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "move,prior", "move", "prior", _key_action_move},
@@ -1371,8 +1371,6 @@ ELM_PART_OVERRIDE(elm_scroller, ELM_SCROLLER, Elm_Scroller_Data)
ELM_PART_OVERRIDE_CONTENT_SET(elm_scroller, ELM_SCROLLER, Elm_Scroller_Data)
ELM_PART_OVERRIDE_CONTENT_GET(elm_scroller, ELM_SCROLLER, Elm_Scroller_Data)
ELM_PART_OVERRIDE_CONTENT_UNSET(elm_scroller, ELM_SCROLLER, Elm_Scroller_Data)
-// FIXME: should be "content" but "default" was legacy API
-ELM_PART_CONTENT_DEFAULT_GET(elm_scroller, "default")
#include "elm_scroller_part.eo.c"
/* Efl.Part end */
@@ -1380,7 +1378,6 @@ ELM_PART_CONTENT_DEFAULT_GET(elm_scroller, "default")
/* Internal EO APIs and hidden overrides */
#define ELM_SCROLLER_EXTRA_OPS \
- ELM_PART_CONTENT_DEFAULT_OPS(elm_scroller), \
ELM_LAYOUT_SIZING_EVAL_OPS(elm_scroller), \
EFL_CANVAS_GROUP_ADD_OPS(elm_scroller)
diff --git a/src/lib/elementary/elm_scroller.eo b/src/lib/elementary/elm_scroller.eo
index 378f3c8c72..7824a4cc98 100644
--- a/src/lib/elementary/elm_scroller.eo
+++ b/src/lib/elementary/elm_scroller.eo
@@ -1,6 +1,6 @@
-class Elm.Scroller (Efl.Ui.Layout, Elm.Interface_Scrollable,
+class Elm.Scroller (Efl.Ui.Layout.Object, Elm.Interface_Scrollable,
Efl.Access.Widget.Action,
- Efl.Ui.Scrollable, Efl.Content)
+ Efl.Ui.Scrollable, Efl.Content, Efl.Ui.Legacy)
{
[[Elementary scroller class]]
legacy_prefix: elm_scroller;
@@ -42,37 +42,37 @@ class Elm.Scroller (Efl.Ui.Layout, Elm.Interface_Scrollable,
implements {
class.constructor;
Efl.Object.constructor;
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set; }
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
Efl.Canvas.Group.group_member_add;
Efl.Content.content { get; set; }
Efl.Content.content_unset;
- Elm.Widget.theme_apply;
- Elm.Widget.on_access_activate;
- Elm.Widget.widget_sub_object_del;
- Elm.Widget.widget_event;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.on_access_activate;
+ Efl.Ui.Widget.widget_sub_object_del;
+ Efl.Ui.Widget.widget_event;
Elm.Interface_Scrollable.page_size { set; }
Elm.Interface_Scrollable.policy { set; }
Elm.Interface_Scrollable.single_direction { get; set; }
Efl.Access.Widget.Action.elm_actions { get; }
- Efl.Part.part;
- Elm.Widget.focus_state_apply;
+ Efl.Part.part_get;
+ Efl.Ui.Widget.focus_state_apply;
}
events {
- scroll,page,changed; [[Called when scroll page changed]]
- hbar,unpress; [[Called when horizontal bar is no longer pressed]]
- hbar,press; [[Called when horizontal bar is pressed]]
- hbar,drag; [[Called when horizontal bar is dragged]]
- vbar,unpress; [[Called when vertical bar is no longer pressed]]
- vbar,press; [[Called when vertical bar is pressed]]
- vbar,drag; [[Called when vertical bar is dragged]]
- scroll,left; [[Called when scrolling to left]]
- scroll,right; [[Called when scrolling to right]]
- scroll,up; [[Called scrolled upwards]]
- scroll,down; [[Called when scrolled downwards]]
- edge,left; [[Called when hitting the left edge]]
- edge,right; [[Called when hitting the right edge]]
- edge,top; [[Called when hitting the top edge]]
- edge,bottom; [[Called when hitting the bottom edge]]
+ scroll,page,changed: void; [[Called when scroll page changed]]
+ hbar,unpress: void; [[Called when horizontal bar is no longer pressed]]
+ hbar,press: void; [[Called when horizontal bar is pressed]]
+ hbar,drag: void; [[Called when horizontal bar is dragged]]
+ vbar,unpress: void; [[Called when vertical bar is no longer pressed]]
+ vbar,press: void; [[Called when vertical bar is pressed]]
+ vbar,drag: void; [[Called when vertical bar is dragged]]
+ scroll,left: void; [[Called when scrolling to left]]
+ scroll,right: void; [[Called when scrolling to right]]
+ scroll,up: void; [[Called scrolled upwards]]
+ scroll,down: void; [[Called when scrolled downwards]]
+ edge,left: void; [[Called when hitting the left edge]]
+ edge,right: void; [[Called when hitting the right edge]]
+ edge,top: void; [[Called when hitting the top edge]]
+ edge,bottom: void; [[Called when hitting the bottom edge]]
}
}
diff --git a/src/lib/elementary/elm_segment_control.c b/src/lib/elementary/elm_segment_control.c
index 2c1099848e..d0c478feaa 100644
--- a/src/lib/elementary/elm_segment_control.c
+++ b/src/lib/elementary/elm_segment_control.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define ELM_WIDGET_ITEM_PROTECTED
#define EFL_UI_TRANSLATABLE_PROTECTED
#define EFL_UI_FOCUS_COMPOSITION_PROTECTED
@@ -217,7 +217,7 @@ _update_list(Elm_Segment_Control_Data *sd)
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_segment_control_elm_widget_theme_apply(Eo *obj, Elm_Segment_Control_Data *sd)
+_elm_segment_control_efl_ui_widget_theme_apply(Eo *obj, Elm_Segment_Control_Data *sd)
{
Eina_List *l;
Eina_Bool rtl;
@@ -235,7 +235,7 @@ _elm_segment_control_elm_widget_theme_apply(Eo *obj, Elm_Segment_Control_Data *s
elm_widget_theme_object_set
(obj, VIEW(it), "segment_control", "item",
elm_widget_style_get(obj));
- edje_object_scale_set(VIEW(it), efl_gfx_scale_get(WIDGET(it)) *
+ edje_object_scale_set(VIEW(it), efl_gfx_entity_scale_get(WIDGET(it)) *
elm_config_scale_get());
edje_object_mirrored_set(VIEW(it), rtl);
}
@@ -246,7 +246,7 @@ _elm_segment_control_elm_widget_theme_apply(Eo *obj, Elm_Segment_Control_Data *s
}
EOLIAN static Eina_Bool
-_elm_segment_control_elm_widget_on_disabled_update(Eo *obj, Elm_Segment_Control_Data *sd, Eina_Bool disabled)
+_elm_segment_control_efl_ui_widget_on_disabled_update(Eo *obj, Elm_Segment_Control_Data *sd, Eina_Bool disabled)
{
if (!efl_ui_widget_on_disabled_update(efl_super(obj, MY_CLASS), disabled))
return EINA_FALSE;
@@ -429,7 +429,7 @@ _elm_segment_control_item_elm_widget_item_part_text_set(Eo *eo_item EINA_UNUSED,
}
EOLIAN static const char *
-_elm_segment_control_item_elm_widget_item_part_text_get(Eo *eo_item EINA_UNUSED,
+_elm_segment_control_item_elm_widget_item_part_text_get(const Eo *eo_item EINA_UNUSED,
Elm_Segment_Control_Item_Data *it,
const char *part)
{
@@ -483,7 +483,7 @@ _elm_segment_control_item_elm_widget_item_part_content_set(Eo *eo_item EINA_UNUS
}
EOLIAN static Evas_Object *
-_elm_segment_control_item_elm_widget_item_part_content_get(Eo *eo_item EINA_UNUSED,
+_elm_segment_control_item_elm_widget_item_part_content_get(const Eo *eo_item EINA_UNUSED,
Elm_Segment_Control_Item_Data *item,
const char *part)
{
@@ -596,8 +596,8 @@ _elm_segment_control_item_efl_object_constructor(Eo *obj, Elm_Segment_Control_It
Evas_Object *parent;
parent = efl_parent_get(obj);
- VIEW(it) = edje_object_add(evas_object_evas_get(parent));
- edje_object_scale_set(VIEW(it),efl_gfx_scale_get(WIDGET(it)) *
+ VIEW_SET(it, edje_object_add(evas_object_evas_get(parent)));
+ edje_object_scale_set(VIEW(it),efl_gfx_entity_scale_get(WIDGET(it)) *
elm_config_scale_get());
evas_object_smart_member_add(VIEW(it), parent);
@@ -662,7 +662,7 @@ _access_obj_process(Elm_Segment_Control_Data *sd, Eina_Bool is_access)
}
EOLIAN static void
-_elm_segment_control_elm_widget_on_access_update(Eo *obj EINA_UNUSED, Elm_Segment_Control_Data *sd, Eina_Bool acs)
+_elm_segment_control_efl_ui_widget_on_access_update(Eo *obj EINA_UNUSED, Elm_Segment_Control_Data *sd, Eina_Bool acs)
{
_elm_segment_control_smart_focus_next_enable = acs;
_access_obj_process(sd, _elm_segment_control_smart_focus_next_enable);
@@ -682,7 +682,7 @@ _elm_segment_control_efl_object_constructor(Eo *obj, Elm_Segment_Control_Data *s
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_LIST);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_LIST);
return obj;
}
@@ -730,7 +730,7 @@ _elm_segment_control_item_del_at(Eo *obj, Elm_Segment_Control_Data *_pd EINA_UNU
it = _item_find(obj, idx);
if (!it) return;
- elm_wdg_item_del(EO_OBJ(it));
+ efl_del(EO_OBJ(it));
}
EOLIAN static const char*
@@ -753,7 +753,7 @@ _elm_segment_control_item_icon_get(const Eo *obj, Elm_Segment_Control_Data *_pd
}
EOLIAN static int
-_elm_segment_control_item_count_get(Eo *obj EINA_UNUSED, Elm_Segment_Control_Data *sd)
+_elm_segment_control_item_count_get(const Eo *obj EINA_UNUSED, Elm_Segment_Control_Data *sd)
{
return eina_list_count(sd->items);
}
@@ -765,7 +765,7 @@ _elm_segment_control_item_object_get(const Eo *eo_it EINA_UNUSED, Elm_Segment_Co
}
EOLIAN static Elm_Object_Item*
-_elm_segment_control_item_selected_get(Eo *obj EINA_UNUSED, Elm_Segment_Control_Data *sd)
+_elm_segment_control_item_selected_get(const Eo *obj EINA_UNUSED, Elm_Segment_Control_Data *sd)
{
return EO_OBJ(sd->selected_item);
}
@@ -815,9 +815,9 @@ _elm_segment_control_class_constructor(Efl_Class *klass)
}
EOLIAN static Eina_Rect
-_elm_segment_control_item_efl_ui_focus_object_focus_geometry_get(Eo *obj EINA_UNUSED, Elm_Segment_Control_Item_Data *pd)
+_elm_segment_control_item_efl_ui_focus_object_focus_geometry_get(const Eo *obj EINA_UNUSED, Elm_Segment_Control_Item_Data *pd)
{
- return efl_gfx_geometry_get(VIEW(pd));
+ return efl_gfx_entity_geometry_get(VIEW(pd));
}
/* Internal EO APIs and hidden overrides */
diff --git a/src/lib/elementary/elm_segment_control.eo b/src/lib/elementary/elm_segment_control.eo
index 834fe81965..f43efaefdc 100644
--- a/src/lib/elementary/elm_segment_control.eo
+++ b/src/lib/elementary/elm_segment_control.eo
@@ -1,4 +1,4 @@
-class Elm.Segment_Control (Efl.Ui.Layout, Efl.Ui.Focus.Composition)
+class Elm.Segment_Control (Efl.Ui.Layout.Object, Efl.Ui.Focus.Composition, Efl.Ui.Legacy)
{
[[Elementary segment control class]]
legacy_prefix: elm_segment_control;
@@ -136,12 +136,12 @@ class Elm.Segment_Control (Efl.Ui.Layout, Efl.Ui.Focus.Composition)
implements {
class.constructor;
Efl.Object.constructor;
- Elm.Widget.theme_apply;
- Elm.Widget.on_access_update;
- Elm.Widget.on_disabled_update;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.on_access_update;
+ Efl.Ui.Widget.on_disabled_update;
Efl.Ui.Translatable.translation_update;
}
events {
- changed; [[Called when segment control changed]]
+ changed: Efl.Object; [[Called when segment control changed]]
}
}
diff --git a/src/lib/elementary/elm_segment_control_item.eo b/src/lib/elementary/elm_segment_control_item.eo
index 743b0586f5..dab3f9cc24 100644
--- a/src/lib/elementary/elm_segment_control_item.eo
+++ b/src/lib/elementary/elm_segment_control_item.eo
@@ -1,4 +1,4 @@
-class Elm.Segment_Control.Item(Elm.Widget.Item, Efl.Ui.Focus.Object)
+class Elm.Segment_Control.Item(Elm.Widget.Item, Efl.Ui.Focus.Object, Efl.Ui.Legacy)
{
[[Elementary segment control item class]]
legacy_prefix: elm_segment_control_item;
diff --git a/src/lib/elementary/elm_separator.c b/src/lib/elementary/elm_separator.c
index 2f25d53ea6..927b329f57 100644
--- a/src/lib/elementary/elm_separator.c
+++ b/src/lib/elementary/elm_separator.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#include <Elementary.h>
@@ -17,7 +17,7 @@
#define MY_CLASS_NAME_LEGACY "elm_separator"
EOLIAN static Efl_Ui_Theme_Apply
-_elm_separator_elm_widget_theme_apply(Eo *obj, Elm_Separator_Data *sd EINA_UNUSED)
+_elm_separator_efl_ui_widget_theme_apply(Eo *obj, Elm_Separator_Data *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
@@ -70,7 +70,7 @@ _elm_separator_efl_object_constructor(Eo *obj, Elm_Separator_Data *sd EINA_UNUSE
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_SEPARATOR);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_SEPARATOR);
return obj;
}
@@ -87,7 +87,7 @@ _elm_separator_horizontal_set(Eo *obj, Elm_Separator_Data *sd, Eina_Bool horizon
}
EOLIAN static Eina_Bool
-_elm_separator_horizontal_get(Eo *obj EINA_UNUSED, Elm_Separator_Data *sd)
+_elm_separator_horizontal_get(const Eo *obj EINA_UNUSED, Elm_Separator_Data *sd)
{
return sd->horizontal;
}
diff --git a/src/lib/elementary/elm_separator.eo b/src/lib/elementary/elm_separator.eo
index 835f2e3085..136311d021 100644
--- a/src/lib/elementary/elm_separator.eo
+++ b/src/lib/elementary/elm_separator.eo
@@ -1,4 +1,4 @@
-class Elm.Separator (Efl.Ui.Layout)
+class Elm.Separator (Efl.Ui.Layout.Object, Efl.Ui.Legacy)
{
[[Elementary separator class]]
legacy_prefix: elm_separator;
@@ -19,6 +19,6 @@ class Elm.Separator (Efl.Ui.Layout)
implements {
class.constructor;
Efl.Object.constructor;
- Elm.Widget.theme_apply;
+ Efl.Ui.Widget.theme_apply;
}
}
diff --git a/src/lib/elementary/elm_slider.c b/src/lib/elementary/elm_slider.c
new file mode 100644
index 0000000000..7b36da532e
--- /dev/null
+++ b/src/lib/elementary/elm_slider.c
@@ -0,0 +1,1493 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#define EFL_ACCESS_OBJECT_PROTECTED
+#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
+#define EFL_ACCESS_VALUE_PROTECTED
+#define ELM_LAYOUT_PROTECTED
+#define EFL_PART_PROTECTED
+
+#include <Elementary.h>
+
+#include "elm_priv.h"
+#include "elm_widget_slider.h"
+#include "efl_ui_slider_private.h"
+#include "efl_ui_slider_interval_private.h"
+#include "elm_widget_layout.h"
+#include "elm_part_helper.h"
+
+#define MY_CLASS ELM_SLIDER_CLASS
+
+#define MY_CLASS_NAME "Elm_Slider"
+#define MY_CLASS_NAME_LEGACY "elm_slider"
+#define SLIDER_DELAY_CHANGED_INTERVAL 0.2
+#define SLIDER_STEP 0.05
+
+static const Elm_Layout_Part_Alias_Description _content_aliases[] =
+{
+ {"icon", "elm.swallow.icon"},
+ {"end", "elm.swallow.end"},
+ {NULL, NULL}
+};
+
+static Eina_Bool _key_action_drag(Evas_Object *obj, const char *params);
+
+static const Elm_Action key_actions[] = {
+ {"drag", _key_action_drag},
+ {NULL, NULL}
+};
+
+static const char SIG_CHANGED[] = "changed";
+static const char SIG_DELAY_CHANGED[] = "delay,changed";
+static const char SIG_DRAG_START[] = "slider,drag,start";
+static const char SIG_DRAG_STOP[] = "slider,drag,stop";
+
+static const char PART_NAME_POPUP[] = "popup";
+static const Evas_Smart_Cb_Description _smart_callbacks[] = {
+ {SIG_CHANGED, ""},
+ {SIG_DELAY_CHANGED, ""},
+ {SIG_DRAG_START, ""},
+ {SIG_DRAG_STOP, ""},
+ {SIG_WIDGET_LANG_CHANGED, ""}, /**< handled by elm_widget */
+ {SIG_WIDGET_ACCESS_CHANGED, ""}, /**< handled by elm_widget */
+ {SIG_LAYOUT_FOCUSED, ""}, /**< handled by elm_layout */
+ {SIG_LAYOUT_UNFOCUSED, ""}, /**< handled by elm_layout */
+ {NULL, NULL}
+};
+
+static Eina_Bool
+_delay_change(void *data)
+{
+ ELM_SLIDER_DATA_GET(data, sd);
+
+ sd->delay = NULL;
+ efl_event_callback_legacy_call(data, EFL_UI_SLIDER_EVENT_DELAY_CHANGED, NULL);
+
+ if (_elm_config->atspi_mode)
+ efl_access_value_changed_signal_emit(data);
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static inline Eina_Bool
+_is_horizontal(Efl_Ui_Dir dir)
+{
+ return efl_ui_dir_is_horizontal(dir, EINA_TRUE);
+}
+
+static inline Eina_Bool
+_is_inverted(Efl_Ui_Dir dir)
+{
+ if ((dir == EFL_UI_DIR_LEFT) || (dir == EFL_UI_DIR_UP))
+ return EINA_TRUE;
+
+ return EINA_FALSE;
+}
+
+static Efl_Ui_Dir
+_direction_get(Eina_Bool horizontal, Eina_Bool inverted)
+{
+ if (horizontal)
+ {
+ if (inverted)
+ return EFL_UI_DIR_LEFT;
+ else
+ return EFL_UI_DIR_RIGHT;
+ }
+ else
+ {
+ if (inverted)
+ return EFL_UI_DIR_UP;
+ else
+ return EFL_UI_DIR_DOWN;
+ }
+}
+
+static void
+_units_set(Evas_Object *obj)
+{
+ EFL_UI_SLIDER_DATA_GET(obj, sd2);
+ ELM_SLIDER_DATA_GET(obj, sd);
+
+ if (sd->format_cb)
+ {
+ Eina_Value val;
+
+ eina_value_setup(&val, EINA_VALUE_TYPE_DOUBLE);
+
+ eina_strbuf_reset(sd->format_strbuf);
+ if (!sd->intvl_enable)
+ eina_value_set(&val, sd2->val);
+ else
+ {
+ double v1, v2;
+
+ elm_slider_range_get(obj, &v1, &v2);
+ eina_value_set(&val, v2 - v1);
+ }
+
+ sd->format_cb(sd->format_cb_data, sd->format_strbuf, val);
+ elm_layout_text_set(obj, "elm.units", eina_strbuf_string_get(sd->format_strbuf));
+
+ if (!sd->units_show)
+ {
+ elm_layout_signal_emit(obj, "elm,state,units,visible", "elm");
+ sd->units_show = EINA_TRUE;
+ }
+
+ eina_value_flush(&val);
+ }
+ else
+ {
+ elm_layout_text_set(obj, "elm.units", NULL);
+ if (sd->units_show)
+ {
+ elm_layout_signal_emit(obj, "elm,state,units,hidden", "elm");
+ sd->units_show = EINA_FALSE;
+ }
+ }
+}
+
+static void
+_indicator_set(Evas_Object *obj)
+{
+ EFL_UI_SLIDER_DATA_GET(obj, sd2);
+ EFL_UI_SLIDER_INTERVAL_DATA_GET(obj, pd);
+ ELM_SLIDER_DATA_GET(obj, sd);
+
+ Eina_Value val;
+ const char *str;
+
+ if (!sd->indi_format_cb) return;
+
+ eina_value_setup(&val, EINA_VALUE_TYPE_DOUBLE);
+ eina_strbuf_reset(sd->indi_format_strbuf);
+
+ eina_value_set(&val, sd2->val);
+ sd->indi_format_cb(sd->indi_format_cb_data, sd->indi_format_strbuf, val);
+
+ str = eina_strbuf_string_get(sd->indi_format_strbuf);
+
+ elm_layout_text_set(obj, "elm.indicator", str);
+ elm_layout_text_set(obj, "elm.dragable.slider:elm.indicator", str);
+ if (sd->popup)
+ edje_object_part_text_set(sd->popup, "elm.indicator", str);
+
+ if (sd->popup2)
+ {
+ eina_strbuf_reset(sd->indi_format_strbuf);
+ eina_value_set(&val, pd->intvl_to);
+ sd->indi_format_cb(sd->indi_format_cb_data, sd->indi_format_strbuf, val);
+ str = eina_strbuf_string_get(sd->indi_format_strbuf);
+ elm_layout_text_set(obj, "elm.dragable2.slider:elm.indicator", str);
+ edje_object_part_text_set(sd->popup2, "elm.indicator", str);
+ }
+
+ eina_value_flush(&val);
+}
+
+static void
+_min_max_set(Evas_Object *obj)
+{
+ EFL_UI_SLIDER_DATA_GET(obj, sd2);
+ ELM_SLIDER_DATA_GET(obj, sd);
+ Eina_Strbuf *str;
+ Eina_Value val;
+
+ if (!sd->format_cb) return;
+ eina_value_setup(&val, EINA_VALUE_TYPE_DOUBLE);
+
+ str = eina_strbuf_new();
+
+ eina_value_set(&val, sd2->val_max);
+ sd->format_cb(sd->format_cb_data, str, val);
+ elm_layout_text_set(obj, "elm.units.min", eina_strbuf_string_get(str));
+
+ eina_strbuf_reset(str);
+
+ eina_value_set(&val, sd2->val_min);
+ sd->format_cb(sd->format_cb_data, str, val);
+ elm_layout_text_set(obj, "elm.units.max", eina_strbuf_string_get(str));
+
+ eina_strbuf_free(str);
+ eina_value_flush(&val);
+}
+
+static void
+_popup_show(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
+{
+ ELM_SLIDER_DATA_GET(data, sd);
+ if (sd->popup &&
+ (sd->indicator_visible_mode != ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE))
+ {
+ evas_object_raise(sd->popup);
+ evas_object_show(sd->popup);
+ sd->popup_visible = EINA_TRUE;
+ edje_object_signal_emit(sd->popup, "popup,show", "elm"); // XXX: for compat
+ edje_object_signal_emit(sd->popup, "elm,popup,show", "elm");
+ }
+ if (sd->popup2 &&
+ (sd->indicator_visible_mode != ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE))
+ {
+ evas_object_raise(sd->popup2);
+ evas_object_show(sd->popup2);
+ edje_object_signal_emit(sd->popup2, "popup,show", "elm"); // XXX: for compat
+ edje_object_signal_emit(sd->popup2, "elm,popup,show", "elm");
+ }
+ ELM_SAFE_FREE(sd->wheel_indicator_timer, ecore_timer_del);
+}
+
+static void
+_popup_hide(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
+{
+ ELM_SLIDER_DATA_GET(data, sd);
+
+ if (!sd->popup_visible || !sd->popup) return;
+
+ if (sd->indicator_visible_mode == ELM_SLIDER_INDICATOR_VISIBLE_MODE_ALWAYS) return;
+ if ((sd->indicator_visible_mode == ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS) &&
+ efl_ui_focus_object_focus_get(data))
+ return;
+
+ edje_object_signal_emit(sd->popup, "popup,hide", "elm"); // XXX: for compat
+ edje_object_signal_emit(sd->popup, "elm,popup,hide", "elm");
+
+ if (sd->popup2)
+ {
+ edje_object_signal_emit(sd->popup2, "popup,hide", "elm"); // XXX: for compat
+ edje_object_signal_emit(sd->popup2, "elm,popup,hide", "elm");
+ }
+}
+
+static void
+_popup_hide_done(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
+{
+ ELM_SLIDER_DATA_GET(data, sd);
+ if (sd->popup)
+ {
+ if (!((efl_ui_focus_object_focus_get(data)) &&
+ (sd->indicator_visible_mode == ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS)))
+ {
+ evas_object_hide(sd->popup);
+ sd->popup_visible = EINA_FALSE;
+ }
+ }
+ if (sd->popup2)
+ {
+ if (!((efl_ui_focus_object_focus_get(data)) &&
+ (sd->indicator_visible_mode == ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS)))
+ {
+ evas_object_hide(sd->popup2);
+ }
+ }
+}
+
+static void
+_popup_emit(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ const char *emission,
+ const char *source)
+{
+ ELM_SLIDER_DATA_GET(data, sd);
+ if (sd->popup)
+ {
+ edje_object_signal_emit(sd->popup, emission, source);
+ }
+ if (sd->popup2)
+ {
+ edje_object_signal_emit(sd->popup2, emission, source);
+ }
+}
+
+static Eina_Bool
+_wheel_indicator_timer_cb(void *data)
+{
+ ELM_SLIDER_DATA_GET(data, sd);
+ sd->wheel_indicator_timer = NULL;
+
+ _popup_hide(data, NULL, NULL, NULL);
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static void
+_drag_up(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
+{
+ double step;
+
+ EFL_UI_SLIDER_DATA_GET(data, sd);
+ step = sd->step;
+
+ if (_is_inverted(sd->dir)) step *= -1.0;
+
+ ELM_WIDGET_DATA_GET_OR_RETURN(data, wd);
+ efl_ui_drag_step_move(efl_part(wd->resize_obj, "elm.dragable.slider"),
+ step, step);
+}
+
+static void
+_drag_down(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
+{
+ double step;
+
+ EFL_UI_SLIDER_DATA_GET(data, sd);
+ step = -sd->step;
+
+ if (_is_inverted(sd->dir)) step *= -1.0;
+
+ ELM_WIDGET_DATA_GET_OR_RETURN(data, wd);
+ efl_ui_drag_step_move(efl_part(wd->resize_obj, "elm.dragable.slider"),
+ step, step);
+}
+
+static Eina_Bool
+_key_action_drag(Evas_Object *obj, const char *params)
+{
+ EFL_UI_SLIDER_DATA_GET(obj, sd);
+ const char *dir = params;
+
+ if (!strcmp(dir, "left"))
+ {
+ if (!_is_horizontal(sd->dir))
+ return EINA_FALSE;
+ if (!_is_inverted(sd->dir))
+ _drag_down(obj, NULL, NULL, NULL);
+ else _drag_up(obj, NULL, NULL, NULL);
+ }
+ else if (!strcmp(dir, "right"))
+ {
+ if (!_is_horizontal(sd->dir))
+ return EINA_FALSE;
+ if (!_is_inverted(sd->dir))
+ _drag_up(obj, NULL, NULL, NULL);
+ else _drag_down(obj, NULL, NULL, NULL);
+ }
+ else if (!strcmp(dir, "up"))
+ {
+ if (_is_horizontal(sd->dir))
+ return EINA_FALSE;
+ if (_is_inverted(sd->dir))
+ _drag_up(obj, NULL, NULL, NULL);
+ else _drag_down(obj, NULL, NULL, NULL);
+ }
+ else if (!strcmp(dir, "down"))
+ {
+ if (_is_horizontal(sd->dir))
+ return EINA_FALSE;
+ if (_is_inverted(sd->dir))
+ _drag_down(obj, NULL, NULL, NULL);
+ else _drag_up(obj, NULL, NULL, NULL);
+ }
+ else return EINA_FALSE;
+
+ return EINA_TRUE;
+}
+
+// _slider_efl_ui_widget_widget_event
+ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(slider, Elm_Slider_Data)
+
+EOLIAN static Eina_Bool
+_elm_slider_efl_ui_widget_widget_event(Eo *obj, Elm_Slider_Data *sd, const Efl_Event *eo_event, Evas_Object *src)
+{
+ Eo *ev = eo_event->info;
+
+ if (eo_event->desc == EFL_EVENT_KEY_DOWN)
+ {
+ if (!_slider_efl_ui_widget_widget_event(obj, sd, eo_event, src))
+ return EINA_FALSE;
+ }
+ else if (eo_event->desc == EFL_EVENT_KEY_UP)
+ {
+ _popup_hide(obj, NULL, NULL, NULL);
+ return EINA_FALSE;
+ }
+ else if (eo_event->desc == EFL_EVENT_POINTER_WHEEL)
+ {
+ if (efl_input_processed_get(ev)) return EINA_FALSE;
+ if (efl_input_pointer_wheel_delta_get(ev) < 0)
+ _drag_up(obj, NULL, NULL, NULL);
+ else
+ _drag_down(obj, NULL, NULL, NULL);
+ efl_input_processed_set(ev, EINA_TRUE);
+ ELM_SAFE_FREE(sd->wheel_indicator_timer, ecore_timer_del);
+ sd->wheel_indicator_timer =
+ ecore_timer_add(0.5, _wheel_indicator_timer_cb, obj);
+ }
+ else return EINA_FALSE;
+
+ _popup_show(obj, NULL, NULL, NULL);
+ efl_ui_slider_val_fetch(obj, EINA_TRUE);
+ evas_object_smart_changed(obj);
+
+ return EINA_TRUE;
+}
+
+static void
+_track_move_cb(void *data,
+ Evas *e EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ Evas_Coord x, y;
+
+ ELM_SLIDER_DATA_GET(data, sd);
+ evas_object_geometry_get(obj, &x, &y, NULL, NULL);
+ evas_object_move(sd->popup, x, y);
+}
+
+static void
+_track2_move_cb(void *data,
+ Evas *e EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ Evas_Coord x, y;
+
+ ELM_SLIDER_DATA_GET(data, sd);
+ evas_object_geometry_get(obj, &x, &y, NULL, NULL);
+ evas_object_move(sd->popup2, x, y);
+}
+
+static void
+_track_resize_cb(void *data,
+ Evas *e EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ Evas_Coord w, h;
+
+ ELM_SLIDER_DATA_GET(data, sd);
+ evas_object_geometry_get(obj, NULL, NULL, &w, &h);
+ evas_object_resize(sd->popup, w, h);
+}
+
+static void
+_track2_resize_cb(void *data,
+ Evas *e EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ Evas_Coord w, h;
+
+ ELM_SLIDER_DATA_GET(data, sd);
+ evas_object_geometry_get(obj, NULL, NULL, &w, &h);
+ evas_object_resize(sd->popup2, w, h);
+}
+
+static void
+_popup_update(Evas_Object *obj, Elm_Slider_Data *sd, Evas_Object *popup)
+{
+ EFL_UI_SLIDER_DATA_GET(obj, sd2);
+ if (elm_widget_is_legacy(obj))
+ {
+ if (_is_horizontal(sd2->dir))
+ elm_widget_theme_object_set(obj, popup, "slider", "horizontal/popup", elm_widget_style_get(obj));
+ else
+ elm_widget_theme_object_set(obj, popup, "slider", "vertical/popup", elm_widget_style_get(obj));
+ }
+ else
+ elm_widget_element_update(obj, popup, PART_NAME_POPUP);
+ edje_object_scale_set(popup, efl_gfx_entity_scale_get(obj) *
+ elm_config_scale_get());
+
+ if (!_is_inverted(sd2->dir))
+ edje_object_signal_emit(popup, "elm,state,inverted,off", "elm");
+ else
+ edje_object_signal_emit(popup, "elm,state,inverted,on", "elm");
+
+ if (sd->indicator_show)
+ edje_object_signal_emit(popup, "elm,state,val,show", "elm");
+ else
+ edje_object_signal_emit(popup, "elm,state,val,hide", "elm");
+}
+
+static void
+_popup_add(Elm_Slider_Data *sd, Eo *obj, Evas_Object **popup,
+ Evas_Object **track, Eina_Bool is_range)
+{
+ /* if theme has an overlayed slider mode, then lets support it */
+ if (!is_range
+ && !edje_object_part_exists(elm_layout_edje_get(obj), "elm.track.slider"))
+ return;
+ else if (is_range
+ && !edje_object_part_exists(elm_layout_edje_get(obj), "elm.track2.slider"))
+ return;
+
+ // XXX popup needs to adapt to theme etc.
+ *popup = edje_object_add(evas_object_evas_get(obj));
+ evas_object_smart_member_add(*popup, obj);
+ edje_object_signal_callback_add(*popup, "popup,hide,done", "elm", // XXX: for compat
+ _popup_hide_done, obj);
+ edje_object_signal_callback_add(*popup, "elm,popup,hide,done", "elm",
+ _popup_hide_done, obj);
+
+ _popup_update(obj, sd, *popup);
+
+ /* create a rectangle to track position+size of the dragable */
+ *track = evas_object_rectangle_add(evas_object_evas_get(obj));
+ evas_object_color_set(*track, 0, 0, 0, 0);
+ evas_object_pass_events_set(*track, EINA_TRUE);
+ if (!is_range)
+ {
+ evas_object_event_callback_add
+ (*track, EVAS_CALLBACK_MOVE, _track_move_cb, obj);
+ evas_object_event_callback_add
+ (*track, EVAS_CALLBACK_RESIZE, _track_resize_cb, obj);
+ elm_layout_content_set(obj, "elm.track.slider", *track);
+ }
+ else
+ {
+ evas_object_event_callback_add
+ (*track, EVAS_CALLBACK_MOVE, _track2_move_cb, obj);
+ evas_object_event_callback_add
+ (*track, EVAS_CALLBACK_RESIZE, _track2_resize_cb, obj);
+ elm_layout_content_set(obj, "elm.track2.slider", *track);
+ }
+}
+
+void
+_elm_slider_val_fetch(Evas_Object *obj, Elm_Slider_Data *pd, Eina_Bool user_event)
+{
+ Eina_Bool rtl;
+ double posx = 0.0, posy = 0.0, pos = 0.0, val;
+ double posx2 = 0.0, posy2 = 0.0, pos2 = 0.0, val2;
+ Eina_Bool inverted = EINA_FALSE;
+
+ EFL_UI_SLIDER_DATA_GET(obj, sd);
+ EFL_UI_SLIDER_INTERVAL_DATA_GET(obj, id);
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+
+ efl_ui_drag_value_get(efl_part(wd->resize_obj, "elm.dragable.slider"),
+ &posx, &posy);
+ if (efl_ui_dir_is_horizontal(sd->dir, EINA_TRUE)) pos = posx;
+ else pos = posy;
+
+ efl_ui_drag_value_get(efl_part(wd->resize_obj, "elm.dragable2.slider"),
+ &posx2, &posy2);
+ if (efl_ui_dir_is_horizontal(sd->dir, EINA_TRUE)) pos2 = posx2;
+ else pos2 = posy2;
+
+ rtl = efl_ui_mirrored_get(obj);
+ if ((!rtl && _is_inverted(sd->dir)) ||
+ (rtl && ((sd->dir == EFL_UI_DIR_UP) ||
+ (sd->dir == EFL_UI_DIR_RIGHT))))
+ {
+ pos = 1.0 - pos;
+ pos2 = 1.0 - pos2;
+ inverted = EINA_TRUE;
+ }
+
+ val = (pos * (sd->val_max - sd->val_min)) + sd->val_min;
+ val2 = (pos2 * (sd->val_max - sd->val_min)) + sd->val_min;
+
+ if (pd->intvl_enable)
+ {
+ if (!inverted)
+ {
+ if (val > id->intvl_to)
+ {
+ val = id->intvl_to;
+ efl_ui_slider_val_set(obj);
+ }
+ else if (val2 < id->intvl_from)
+ {
+ val2 = id->intvl_from;
+ efl_ui_slider_val_set(obj);
+ }
+ }
+ else
+ {
+ if (val < id->intvl_to)
+ {
+ val = id->intvl_to;
+ efl_ui_slider_val_set(obj);
+ }
+ else if (val2 > id->intvl_from)
+ {
+ val2 = id->intvl_from;
+ efl_ui_slider_val_set(obj);
+ }
+ }
+ }
+ if (fabs(val - sd->val) > DBL_EPSILON)
+ {
+ sd->val = val;
+ id->intvl_from = val;
+ if (user_event)
+ {
+ efl_event_callback_call(obj, EFL_UI_SLIDER_EVENT_CHANGED, NULL);
+ efl_event_callback_legacy_call(obj, EFL_UI_SLIDER_EVENT_CHANGED, NULL);
+ ecore_timer_del(pd->delay);
+ pd->delay = ecore_timer_add(SLIDER_DELAY_CHANGED_INTERVAL, _delay_change, obj);
+ }
+ }
+
+ if (fabs(val2 - id->intvl_to) > DBL_EPSILON)
+ {
+ id->intvl_to = val2;
+ if (user_event)
+ {
+ efl_event_callback_call(obj, EFL_UI_SLIDER_EVENT_CHANGED, NULL);
+ efl_event_callback_legacy_call(obj, EFL_UI_SLIDER_EVENT_CHANGED, NULL);
+ ecore_timer_del(pd->delay);
+ pd->delay = ecore_timer_add(SLIDER_DELAY_CHANGED_INTERVAL, _delay_change, obj);
+ }
+ }
+}
+
+void
+_elm_slider_val_set(Evas_Object *obj, Elm_Slider_Data *pd EINA_UNUSED)
+{
+ Eina_Bool rtl;
+ double pos, pos2;
+
+ EFL_UI_SLIDER_DATA_GET(obj, sd);
+ EFL_UI_SLIDER_INTERVAL_DATA_GET(obj, id);
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+
+ if (sd->val_max > sd->val_min)
+ {
+ pos = (sd->val - sd->val_min) / (sd->val_max - sd->val_min);
+ pos2 = (id->intvl_to - sd->val_min) / (sd->val_max - sd->val_min);
+ }
+ else
+ {
+ pos = 0.0;
+ pos2 = 0.0;
+ }
+
+ if (pos < 0.0) pos = 0.0;
+ else if (pos > 1.0)
+ pos = 1.0;
+
+ if (pos2 < 0.0) pos2 = 0.0;
+ else if (pos2 > 1.0)
+ pos2 = 1.0;
+
+ rtl = efl_ui_mirrored_get(obj);
+ if ((!rtl && _is_inverted(sd->dir)) ||
+ (rtl && ((sd->dir == EFL_UI_DIR_UP) ||
+ (sd->dir == EFL_UI_DIR_RIGHT))))
+ {
+ pos = 1.0 - pos;
+ pos2 = 1.0 - pos2;
+ }
+
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable.slider"),
+ pos, pos);
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable2.slider"),
+ pos2, pos2);
+
+ // emit accessibility event also if value was changed by API
+ if (_elm_config->atspi_mode)
+ efl_access_value_changed_signal_emit(obj);
+
+ evas_object_smart_changed(obj);
+}
+void
+_elm_slider_down_knob(Evas_Object *obj, Elm_Slider_Data *pd, double button_x, double button_y)
+{
+ EFL_UI_SLIDER_DATA_GET(obj, sd);
+ EFL_UI_SLIDER_INTERVAL_DATA_GET(obj, id);
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+
+ if (!pd->intvl_enable)
+ {
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable.slider"),
+ button_x, button_y);
+ }
+ else
+ {
+ double posx = 0.0, posy = 0.0, posx2 = 0.0, posy2 = 0.0, diff1, diff2, diff3;
+
+ efl_ui_drag_value_get(efl_part(wd->resize_obj, "elm.dragable.slider"),
+ &posx, &posy);
+ efl_ui_drag_value_get(efl_part(wd->resize_obj, "elm.dragable2.slider"),
+ &posx2, &posy2);
+
+ if (efl_ui_dir_is_horizontal(sd->dir, EINA_TRUE))
+ {
+ diff1 = fabs(button_x - posx);
+ diff2 = fabs(button_x - posx2);
+ diff3 = button_x - posx;
+ }
+ else
+ {
+ diff1 = fabs(button_y - posy);
+ diff2 = fabs(button_y - posy2);
+ diff3 = button_y - posy;
+ }
+
+ if (diff1 < diff2)
+ {
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable.slider"),
+ button_x, button_y);
+ id->intvl_flag = 1;
+ }
+ else if (diff1 > diff2)
+ {
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable2.slider"),
+ button_x, button_y);
+ id->intvl_flag = 2;
+ }
+ else
+ {
+ if (diff3 < 0)
+ {
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable.slider"),
+ button_x, button_y);
+ id->intvl_flag = 1;
+ }
+ else
+ {
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable2.slider"),
+ button_x, button_y);
+ id->intvl_flag = 2;
+ }
+ }
+ }
+}
+
+void
+_elm_slider_move_knob(Evas_Object *obj, Elm_Slider_Data *pd, double button_x, double button_y)
+{
+ EFL_UI_SLIDER_INTERVAL_DATA_GET(obj, id);
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+
+ if (!pd->intvl_enable)
+ {
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable.slider"),
+ button_x, button_y);
+ }
+ else
+ {
+ if (id->intvl_flag == 1)
+ {
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable.slider"),
+ button_x, button_y);
+ }
+ else if (id->intvl_flag == 2)
+ {
+ efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable2.slider"),
+ button_x, button_y);
+ }
+
+ }
+}
+
+static char *
+_elm_slider_theme_group_get(Evas_Object *obj, Elm_Slider_Data *sd)
+{
+ EFL_UI_SLIDER_DATA_GET(obj, sd2);
+ Eina_Strbuf *new_group = eina_strbuf_new();
+
+ if (sd->intvl_enable)
+ eina_strbuf_append(new_group, "range/");
+ if (_is_horizontal(sd2->dir))
+ eina_strbuf_append(new_group, "horizontal");
+ else
+ eina_strbuf_append(new_group, "vertical");
+
+ return eina_strbuf_release(new_group);
+}
+
+EOLIAN static Efl_Ui_Theme_Apply
+_elm_slider_efl_ui_widget_theme_apply(Eo *obj, Elm_Slider_Data *sd)
+{
+ Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
+ EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd2, EFL_UI_THEME_APPLY_FAILED);
+ char *group;
+
+ group = _elm_slider_theme_group_get(obj, sd);
+ if (group)
+ {
+ elm_widget_theme_element_set(obj, group);
+ free(group);
+ }
+
+ int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
+ if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
+
+ if (_is_horizontal(sd2->dir))
+ evas_object_size_hint_min_set
+ (sd2->spacer, (double)sd->size * efl_gfx_entity_scale_get(obj) *
+ elm_config_scale_get(), 1);
+ else
+ evas_object_size_hint_min_set
+ (sd2->spacer, 1, (double)sd->size * efl_gfx_entity_scale_get(obj) *
+ elm_config_scale_get());
+
+ if (sd->intvl_enable)
+ elm_layout_signal_emit(obj, "elm,slider,range,enable", "elm");
+ else
+ elm_layout_signal_emit(obj, "elm,slider,range,disable", "elm");
+
+ if (_is_inverted(sd2->dir))
+ elm_layout_signal_emit(obj, "elm,state,inverted,on", "elm");
+ else
+ elm_layout_signal_emit(obj, "elm,state,inverted,off", "elm");
+ if (sd->indicator_show)
+ elm_layout_signal_emit(obj, "elm,state,val,show", "elm");
+ else
+ elm_layout_signal_emit(obj, "elm,state,val,hide", "elm");
+
+ if (!sd->popup)
+ _popup_add(sd, obj, &sd->popup, &sd->track, sd->intvl_enable);
+ else
+ _popup_update(obj, sd, sd->popup);
+
+ if (sd->intvl_enable)
+ {
+ if (!sd->popup2)
+ _popup_add(sd, obj, &sd->popup2, &sd->track2, EINA_TRUE);
+ else
+ _popup_update(obj, sd, sd->popup2);
+ }
+
+ _min_max_set(obj);
+ _units_set(obj);
+ _indicator_set(obj);
+
+ edje_object_message_signal_process(wd->resize_obj);
+ if (sd->popup)
+ edje_object_message_signal_process(sd->popup);
+ if (sd->popup2)
+ edje_object_message_signal_process(sd->popup2);
+
+ evas_object_smart_changed(obj);
+
+ return int_ret;
+}
+
+static void
+_spacer_down_cb(void *data,
+ Evas *e EINA_UNUSED,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ ELM_SLIDER_DATA_GET(data, sd);
+
+ sd->spacer_down = EINA_TRUE;
+ elm_layout_signal_emit(data, "elm,state,indicator,show", "elm");
+}
+
+static void
+_spacer_move_cb(void *data,
+ Evas *e EINA_UNUSED,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info)
+{
+ ELM_SLIDER_DATA_GET(data, sd);
+ Evas_Event_Mouse_Move *ev = event_info;
+
+ if (sd->spacer_down)
+ {
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
+ {
+ if (sd->spacer_down) sd->spacer_down = EINA_FALSE;
+ elm_layout_signal_emit(data, "elm,state,indicator,hide", "elm");
+ return;
+ }
+ }
+}
+
+static void
+_spacer_up_cb(void *data,
+ Evas *e EINA_UNUSED,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ ELM_SLIDER_DATA_GET(data, sd);
+
+ if (!sd->spacer_down) return;
+ if (sd->spacer_down) sd->spacer_down = EINA_FALSE;
+
+ elm_layout_signal_emit(data, "elm,state,indicator,hide", "elm");
+}
+
+EOLIAN static void
+_elm_slider_efl_canvas_group_group_calculate(Eo *obj, Elm_Slider_Data *sd)
+{
+ EFL_UI_SLIDER_DATA_GET(obj, sd2);
+ elm_layout_freeze(obj);
+
+ if (_is_horizontal(sd2->dir))
+ evas_object_size_hint_min_set
+ (sd2->spacer, (double)sd->size * efl_gfx_entity_scale_get(obj) *
+ elm_config_scale_get(), 1);
+ else
+ evas_object_size_hint_min_set
+ (sd2->spacer, 1, (double)sd->size * efl_gfx_entity_scale_get(obj) *
+ elm_config_scale_get());
+
+ _min_max_set(obj);
+ _units_set(obj);
+ _indicator_set(obj);
+
+ elm_layout_thaw(obj);
+}
+
+static void
+_on_show(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ ELM_SLIDER_DATA_GET(obj, sd);
+ if (sd->indicator_visible_mode == ELM_SLIDER_INDICATOR_VISIBLE_MODE_ALWAYS)
+ _popup_show(obj, NULL, NULL, NULL);
+}
+
+EOLIAN static Eo *
+_elm_slider_efl_object_constructor(Eo *obj, Elm_Slider_Data *priv)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
+ EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd, NULL)
+
+ if (!elm_widget_theme_klass_get(obj))
+ elm_widget_theme_klass_set(obj, "slider");
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+ efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
+ evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
+
+ priv->indicator_show = EINA_TRUE;
+ priv->indicator_visible_mode = elm_config_slider_indicator_visible_mode_get();
+ //TODO: customize this time duration from api or theme data.
+ priv->wheel_indicator_duration = 0.25;
+
+ elm_layout_signal_callback_add(obj, "popup,show", "elm", _popup_show, obj); // XXX: for compat
+ elm_layout_signal_callback_add(obj, "popup,hide", "elm", _popup_hide, obj); // XXX: for compat
+ elm_layout_signal_callback_add(obj, "elm,popup,show", "elm", _popup_show, obj);
+ elm_layout_signal_callback_add(obj, "elm,popup,hide", "elm", _popup_hide, obj);
+ elm_layout_signal_callback_add(obj, "*", "popup,emit", _popup_emit, obj);
+
+ if (!priv->intvl_enable)
+ _popup_add(priv, obj, &priv->popup, &priv->track, priv->intvl_enable);
+ else
+ _popup_add(priv, obj, &priv->popup2, &priv->track2, priv->intvl_enable);
+
+ evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _on_show, NULL);
+
+ elm_widget_can_focus_set(obj, EINA_TRUE);
+
+ efl_ui_format_string_set(efl_part(obj, "indicator"), "%0.2f");
+
+ evas_object_event_callback_add
+ (sd->spacer, EVAS_CALLBACK_MOUSE_DOWN, _spacer_down_cb, obj);
+ evas_object_event_callback_add
+ (sd->spacer, EVAS_CALLBACK_MOUSE_MOVE, _spacer_move_cb, obj);
+ evas_object_event_callback_add
+ (sd->spacer, EVAS_CALLBACK_MOUSE_UP, _spacer_up_cb, obj);
+
+ return obj;
+}
+
+EOLIAN static void
+_elm_slider_efl_object_destructor(Eo *obj,
+ Elm_Slider_Data *sd)
+{
+ ecore_timer_del(sd->wheel_indicator_timer);
+ evas_object_del(sd->popup);
+ evas_object_del(sd->popup2);
+
+ ELM_SAFE_FREE(sd->indi_template, eina_stringshare_del);
+ eina_strbuf_free(sd->indi_format_strbuf);
+
+ efl_ui_format_cb_set(obj, NULL, NULL, NULL);
+ eina_strbuf_free(sd->format_strbuf);
+
+ efl_destructor(efl_super(obj, MY_CLASS));
+}
+
+EOLIAN static Eina_Bool
+_elm_slider_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Slider_Data *sd)
+{
+ Eina_Bool int_ret = EINA_FALSE;
+
+ int_ret = efl_ui_focus_object_on_focus_update(efl_super(obj, MY_CLASS));
+
+ if ((sd->indicator_visible_mode == ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS) && efl_ui_focus_object_focus_get(obj))
+ _popup_show(obj, NULL, NULL, NULL);
+ else if (!efl_ui_focus_object_focus_get(obj))
+ _popup_hide(obj, NULL, NULL, NULL);
+
+ return int_ret;
+}
+
+EOLIAN static void
+_elm_slider_class_constructor(Efl_Class *klass)
+{
+ evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
+}
+
+EOLIAN static void
+_elm_slider_efl_ui_format_format_cb_set(Eo *obj, Elm_Slider_Data *sd, void *func_data, Efl_Ui_Format_Func_Cb func, Eina_Free_Cb func_free_cb)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+
+ if (sd->format_cb_data == func_data && sd->format_cb == func)
+ return;
+
+ if (sd->format_cb_data && sd->format_free_cb)
+ sd->format_free_cb(sd->format_cb_data);
+
+ sd->format_cb = func;
+ sd->format_cb_data = func_data;
+ sd->format_free_cb = func_free_cb;
+ if (!sd->format_strbuf) sd->format_strbuf = eina_strbuf_new();
+
+ elm_layout_signal_emit(obj, "elm,state,units,visible", "elm");
+ edje_object_message_signal_process(wd->resize_obj);
+ if (sd->popup)
+ edje_object_signal_emit(sd->popup, "elm,state,units,visible", "elm");
+ if (sd->popup2)
+ edje_object_signal_emit(sd->popup2, "elm,state,units,visible", "elm");
+
+ efl_canvas_group_change(obj);
+}
+
+/* Standard widget overrides */
+
+ELM_PART_TEXT_DEFAULT_IMPLEMENT(elm_slider, Elm_Slider_Data)
+ELM_PART_MARKUP_DEFAULT_IMPLEMENT(elm_slider, Elm_Slider_Data)
+
+static void
+_slider_span_size_set(Eo *obj, Elm_Slider_Data *sd, int size)
+{
+ if (sd->size == size) return;
+ sd->size = size;
+
+ if (sd->indicator_show)
+ {
+ elm_layout_signal_emit(obj, "elm,state,val,show", "elm");
+ if (sd->popup)
+ edje_object_signal_emit(sd->popup, "elm,state,val,show", "elm");
+ if (sd->popup2)
+ edje_object_signal_emit(sd->popup2, "elm,state,val,show", "elm");
+ }
+ else
+ {
+ elm_layout_signal_emit(obj, "elm,state,val,hide", "elm");
+ if (sd->popup)
+ edje_object_signal_emit(sd->popup, "elm,state,val,hide", "elm");
+ if (sd->popup2)
+ edje_object_signal_emit(sd->popup2, "elm,state,val,hide", "elm");
+ }
+
+ evas_object_smart_changed(obj);
+}
+
+/* Efl.Part begin */
+
+EOLIAN static Eo *
+_elm_slider_efl_part_part_get(const Eo *obj, Elm_Slider_Data *sd EINA_UNUSED, const char *part)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
+
+ if (eina_streq(part, "indicator"))
+ return ELM_PART_IMPLEMENT(ELM_SLIDER_PART_INDICATOR_CLASS, obj, part);
+
+ return efl_part_get(efl_super(obj, MY_CLASS), part);
+}
+
+EOLIAN static void
+_elm_slider_part_indicator_efl_ui_format_format_cb_set(Eo *obj, void *_pd EINA_UNUSED, void *func_data, Efl_Ui_Format_Func_Cb func, Eina_Free_Cb func_free_cb)
+{
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ Elm_Slider_Data *sd = efl_data_scope_get(pd->obj, ELM_SLIDER_CLASS);
+
+ if (sd->indi_format_cb_data == func_data && sd->indi_format_cb == func)
+ return;
+
+ if (sd->indi_format_cb_data && sd->indi_format_free_cb)
+ sd->indi_format_free_cb(sd->format_cb_data);
+
+ sd->indi_format_cb = func;
+ sd->indi_format_cb_data = func_data;
+ sd->indi_format_free_cb = func_free_cb;
+ if (!sd->indi_format_strbuf) sd->indi_format_strbuf = eina_strbuf_new();
+
+ efl_canvas_group_change(pd->obj);
+}
+
+static void
+_indi_default_format_cb(void *data, Eina_Strbuf *str, const Eina_Value value)
+{
+ const Eina_Value_Type *type = eina_value_type_get(&value);
+ Elm_Slider_Data *sd = efl_data_scope_get(data, ELM_SLIDER_CLASS);
+ double v;
+
+ if (type != EINA_VALUE_TYPE_DOUBLE) return;
+
+ eina_value_get(&value, &v);
+ eina_strbuf_append_printf(str, sd->indi_template, v);
+}
+
+static void
+_indi_default_format_free_cb(void *data)
+{
+ Elm_Slider_Data *sd = efl_data_scope_get(data, ELM_SLIDER_CLASS);
+
+ if (sd && sd->indi_template)
+ {
+ eina_stringshare_del(sd->indi_template);
+ sd->indi_template = NULL;
+ }
+}
+
+EOLIAN static void
+_elm_slider_part_indicator_efl_ui_format_format_string_set(Eo *obj, void *_pd EINA_UNUSED, const char *template)
+{
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ Elm_Slider_Data *sd = efl_data_scope_get(pd->obj, ELM_SLIDER_CLASS);
+
+ if (!template) return;
+ eina_stringshare_replace(&sd->indi_template, template);
+
+ efl_ui_format_cb_set(efl_part(pd->obj, "indicator"), pd->obj, _indi_default_format_cb, _indi_default_format_free_cb);
+}
+
+EOLIAN static const char *
+_elm_slider_part_indicator_efl_ui_format_format_string_get(const Eo *obj, void *_pd EINA_UNUSED)
+{
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ Elm_Slider_Data *sd = efl_data_scope_get(pd->obj, ELM_SLIDER_CLASS);
+
+ return sd->indi_template;
+}
+
+EOLIAN static void
+_elm_slider_part_indicator_visible_mode_set(Eo *obj, void *_pd EINA_UNUSED, Elm_Slider_Indicator_Visible_Mode indicator_visible_mode)
+{
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ Elm_Slider_Data *sd = efl_data_scope_get(pd->obj, ELM_SLIDER_CLASS);
+
+ if (!eina_streq(pd->part, "indicator")) return;
+
+ if (sd->indicator_visible_mode == indicator_visible_mode) return;
+
+ sd->indicator_visible_mode = indicator_visible_mode;
+}
+
+EOLIAN static Elm_Slider_Indicator_Visible_Mode
+_elm_slider_part_indicator_visible_mode_get(const Eo *obj, void *_pd EINA_UNUSED)
+{
+ Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+ Elm_Slider_Data *sd = efl_data_scope_get(pd->obj, ELM_SLIDER_CLASS);
+
+ if (!eina_streq(pd->part, "indicator")) return ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE;
+ return sd->indicator_visible_mode;
+}
+
+#include "elm_slider_part_indicator.eo.c"
+
+/* Efl.Part end */
+
+/* Legacy APIs */
+
+EAPI Evas_Object *
+elm_slider_add(Evas_Object *parent)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ return elm_legacy_add(MY_CLASS, parent);
+}
+
+EAPI void
+elm_slider_span_size_set(Evas_Object *obj, Evas_Coord size)
+{
+ ELM_SLIDER_DATA_GET_OR_RETURN(obj, sd);
+ _slider_span_size_set(obj, sd, size);
+}
+
+EAPI Evas_Coord
+elm_slider_span_size_get(const Evas_Object *obj)
+{
+ ELM_SLIDER_DATA_GET_OR_RETURN(obj, sd, 0);
+ return sd->size;
+}
+
+EAPI void
+elm_slider_unit_format_set(Evas_Object *obj, const char *units)
+{
+ efl_ui_format_string_set(obj, units);
+}
+
+EAPI const char *
+elm_slider_unit_format_get(const Evas_Object *obj)
+{
+ return efl_ui_format_string_get(obj);
+}
+
+EAPI void
+elm_slider_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
+{
+ Efl_Ui_Dir dir;
+ EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd2);
+
+ dir = _direction_get(horizontal, _is_inverted(sd2->dir));
+
+ efl_ui_direction_set(obj, dir);
+}
+
+EAPI Eina_Bool
+elm_slider_horizontal_get(const Evas_Object *obj)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
+
+ Efl_Ui_Dir dir;
+ dir = efl_ui_direction_get(obj);
+
+ return _is_horizontal(dir);
+}
+
+EAPI void
+elm_slider_step_set(Evas_Object *obj, double step)
+{
+ efl_ui_range_step_set(obj, step);
+}
+
+EAPI double
+elm_slider_step_get(const Evas_Object *obj)
+{
+ return efl_ui_range_step_get(obj);
+}
+
+EAPI void
+elm_slider_value_set(Evas_Object *obj, double val)
+{
+ efl_ui_range_value_set(obj, val);
+}
+
+EAPI double
+elm_slider_value_get(const Evas_Object *obj)
+{
+ return efl_ui_range_value_get(obj);
+}
+
+EAPI void
+elm_slider_inverted_set(Evas_Object *obj, Eina_Bool inverted)
+{
+ Efl_Ui_Dir dir;
+ EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd2);
+
+ dir = _direction_get(_is_horizontal(sd2->dir), inverted);
+
+ efl_ui_direction_set(obj, dir);
+}
+
+EAPI Eina_Bool
+elm_slider_inverted_get(const Evas_Object *obj)
+{
+ Efl_Ui_Dir dir;
+ dir = efl_ui_direction_get(obj);
+
+ return _is_inverted(dir);
+}
+
+typedef struct
+{
+ slider_func_type format_cb;
+ slider_freefunc_type format_free_cb;
+} Slider_Format_Wrapper_Data;
+
+static void
+_format_legacy_to_format_eo_cb(void *data, Eina_Strbuf *str, const Eina_Value value)
+{
+ Slider_Format_Wrapper_Data *sfwd = data;
+ char *buf = NULL;
+ double val = 0;
+ const Eina_Value_Type *type = eina_value_type_get(&value);
+
+ if (type == EINA_VALUE_TYPE_DOUBLE)
+ eina_value_get(&value, &val);
+
+ if (sfwd->format_cb)
+ buf = sfwd->format_cb(val);
+ if (buf)
+ eina_strbuf_append(str, buf);
+ if (sfwd->format_free_cb) sfwd->format_free_cb(buf);
+}
+
+static void
+_format_legacy_to_format_eo_free_cb(void *data)
+{
+ Slider_Format_Wrapper_Data *sfwd = data;
+ free(sfwd);
+}
+
+EAPI void
+elm_slider_units_format_function_set(Evas_Object *obj, slider_func_type func, slider_freefunc_type free_func)
+{
+ Slider_Format_Wrapper_Data *sfwd = malloc(sizeof(Slider_Format_Wrapper_Data));
+
+ sfwd->format_cb = func;
+ sfwd->format_free_cb = free_func;
+
+ efl_ui_format_cb_set(obj, sfwd, _format_legacy_to_format_eo_cb, _format_legacy_to_format_eo_free_cb);
+}
+
+EAPI void
+elm_slider_range_enabled_set(Evas_Object *obj, Eina_Bool enable)
+{
+ ELM_SLIDER_DATA_GET_OR_RETURN(obj, sd);
+
+ if (sd->intvl_enable == enable) return;
+
+ sd->intvl_enable = enable;
+ efl_ui_widget_theme_apply(obj);
+ if (sd->intvl_enable)
+ {
+ elm_layout_signal_emit(obj, "elm,slider,range,enable", "elm");
+ if (sd->indicator_show)
+ edje_object_signal_emit(sd->popup2, "elm,state,val,show", "elm");
+ }
+ else
+ {
+ elm_layout_signal_emit(obj, "elm,slider,range,disable", "elm");
+ ELM_SAFE_FREE(sd->popup2, evas_object_del);
+ }
+}
+
+EAPI Eina_Bool
+elm_slider_range_enabled_get(const Evas_Object *obj)
+{
+ ELM_SLIDER_DATA_GET_OR_RETURN(obj, pd, EINA_FALSE);
+ return pd->intvl_enable;
+}
+
+EAPI void
+elm_slider_range_set(Evas_Object *obj, double from, double to)
+{
+ efl_ui_slider_interval_value_set(obj, from, to);
+}
+
+EAPI void
+elm_slider_range_get(const Evas_Object *obj, double *from, double *to)
+{
+ efl_ui_slider_interval_value_get(obj, from, to);
+}
+
+EAPI void
+elm_slider_min_max_set(Evas_Object *obj, double min, double max)
+{
+ efl_ui_range_min_max_set(obj, min, max);
+}
+
+EAPI void
+elm_slider_min_max_get(const Evas_Object *obj, double *min, double *max)
+{
+ efl_ui_range_min_max_get(obj, min, max);
+}
+
+EAPI void
+elm_slider_indicator_format_set(Evas_Object *obj, const char *indicator)
+{
+ efl_ui_format_string_set(efl_part(obj, "indicator"), indicator);
+}
+
+EAPI const char *
+elm_slider_indicator_format_get(const Evas *obj)
+{
+ return efl_ui_format_string_get(efl_part(obj, "indicator"));
+}
+
+EAPI void
+elm_slider_indicator_format_function_set(Evas_Object *obj, slider_func_type func, slider_freefunc_type free_func)
+{
+ Slider_Format_Wrapper_Data *sfwd = malloc(sizeof(Slider_Format_Wrapper_Data));
+
+ sfwd->format_cb = func;
+ sfwd->format_free_cb = free_func;
+
+ efl_ui_format_cb_set(efl_part(obj, "indicator"), sfwd,
+ _format_legacy_to_format_eo_cb,
+ _format_legacy_to_format_eo_free_cb);
+}
+
+EAPI void
+elm_slider_indicator_show_on_focus_set(Evas_Object *obj, Eina_Bool flag)
+{
+ elm_slider_part_indicator_visible_mode_set(efl_part(obj, "indicator"),
+ flag ? ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS
+ : ELM_SLIDER_INDICATOR_VISIBLE_MODE_DEFAULT);
+}
+
+EAPI Eina_Bool
+elm_slider_indicator_show_on_focus_get(const Evas_Object *obj)
+{
+ return (elm_slider_part_indicator_visible_mode_get(efl_part(obj, "indicator"))
+ == ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS);
+}
+
+EAPI void
+elm_slider_indicator_show_set(Evas_Object *obj, Eina_Bool show)
+{
+ ELM_SLIDER_DATA_GET_OR_RETURN(obj, sd);
+
+ if (show)
+ {
+ sd->indicator_show = EINA_TRUE;
+ elm_layout_signal_emit(obj, "elm,state,val,show", "elm");
+ if (sd->popup)
+ edje_object_signal_emit(sd->popup, "elm,state,val,show", "elm");
+ if (sd->popup2)
+ edje_object_signal_emit(sd->popup2, "elm,state,val,show", "elm");
+ }
+ else
+ {
+ sd->indicator_show = EINA_FALSE;
+ elm_layout_signal_emit(obj, "elm,state,val,hide", "elm");
+ if (sd->popup)
+ edje_object_signal_emit(sd->popup, "elm,state,val,hide", "elm");
+ if (sd->popup2)
+ edje_object_signal_emit(sd->popup2, "elm,state,val,hide", "elm");
+ }
+
+ evas_object_smart_changed(obj);
+}
+
+EAPI Eina_Bool
+elm_slider_indicator_show_get(const Evas_Object *obj)
+{
+ ELM_SLIDER_DATA_GET_OR_RETURN(obj, sd, EINA_FALSE);
+ return sd->indicator_show;
+}
+
+EAPI void
+elm_slider_indicator_visible_mode_set(Evas_Object *obj, Elm_Slider_Indicator_Visible_Mode indicator_visible_mode)
+{
+ elm_slider_part_indicator_visible_mode_set(efl_part(obj, "indicator"), indicator_visible_mode);
+}
+
+EAPI Elm_Slider_Indicator_Visible_Mode
+elm_slider_indicator_visible_mode_get(const Evas_Object *obj)
+{
+ return elm_slider_part_indicator_visible_mode_get(efl_part(obj, "indicator"));
+}
+
+/* Internal EO APIs and hidden overrides */
+
+ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(elm_slider)
+
+#define ELM_SLIDER_EXTRA_OPS \
+ ELM_LAYOUT_CONTENT_ALIASES_OPS(elm_slider), \
+ EFL_UI_SLIDER_VAL_FETCH_OPS(elm_slider), \
+ EFL_UI_SLIDER_VAL_SET_OPS(elm_slider), \
+ EFL_UI_SLIDER_DOWN_KNOB_OPS(elm_slider), \
+ EFL_UI_SLIDER_MOVE_KNOB_OPS(elm_slider)
+
+#include "elm_slider.eo.c"
diff --git a/src/lib/elementary/elm_slider.eo b/src/lib/elementary/elm_slider.eo
new file mode 100644
index 0000000000..233da53149
--- /dev/null
+++ b/src/lib/elementary/elm_slider.eo
@@ -0,0 +1,26 @@
+class Elm.Slider (Efl.Ui.Slider_Interval, Efl.Ui.Legacy,
+ Efl.Text, Efl.Text_Markup, Efl.Ui.Format,
+ Efl.Ui.Translatable)
+{
+ [[Elementary slider class]]
+ eo_prefix: elm_obj_slider;
+ legacy_prefix: elm_slider;
+ parts {
+ indicator: Elm.Slider.Part_Indicator;
+ [[A floating indicator above the slider.]]
+ }
+ implements {
+ class.constructor;
+ Efl.Object.constructor;
+ Efl.Object.destructor;
+ Efl.Canvas.Group.group_calculate;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.widget_event;
+ Efl.Ui.Focus.Object.on_focus_update;
+ Efl.Text.text { get; set; }
+ Efl.Text_Markup.markup { get; set; }
+ Efl.Ui.Format.format_cb { set; }
+ Efl.Ui.Translatable.translatable_text { get; set; }
+ Efl.Part.part_get;
+ }
+}
diff --git a/src/lib/elementary/elm_slider.h b/src/lib/elementary/elm_slider.h
index 76fc25d6e5..5e04927026 100644
--- a/src/lib/elementary/elm_slider.h
+++ b/src/lib/elementary/elm_slider.h
@@ -76,9 +76,8 @@
#include "elm_slider_common.h"
#ifdef EFL_EO_API_SUPPORT
-#include "efl_ui_slider_eo.h"
-#include "efl_ui_slider_part_indicator.eo.h"
-#include <efl_ui_slider_interval.eo.h>
+#include "elm_slider.eo.h"
+#include "elm_slider_part_indicator.eo.h"
#endif
#ifndef EFL_NOLEGACY_API_SUPPORT
#include "elm_slider_legacy.h"
diff --git a/src/lib/elementary/elm_slider_legacy.h b/src/lib/elementary/elm_slider_legacy.h
index f117e15af0..99c5097297 100644
--- a/src/lib/elementary/elm_slider_legacy.h
+++ b/src/lib/elementary/elm_slider_legacy.h
@@ -1,3 +1,5 @@
+typedef Eo Elm_Slider;
+
/**
* Add a new slider widget to the given parent Elementary
* (container) object.
@@ -350,4 +352,34 @@ EAPI void elm_slider_indicator_visible_mode_set(Evas_Object *obj, Elm_Slider_Ind
*/
EAPI Elm_Slider_Indicator_Visible_Mode elm_slider_indicator_visible_mode_get(const Evas_Object *obj);
+/**
+ * @brief Get the step by which slider indicator moves.
+ *
+ * @param[in] obj The object.
+ *
+ * @return The step value.
+ *
+ * @since 1.8
+ *
+ * @ingroup Elm_Slider
+ */
+EAPI double elm_slider_step_get(const Evas_Object *obj);
+
+/**
+ * @brief Set the step by which slider indicator will move.
+ *
+ * This value is used when a draggable object is moved automatically such as
+ * when key events like the up/down/left/right key are pressed or in case
+ * accessibility is set and flick event is used to inc/dec slider values. By
+ * default step value is 0.05.
+ *
+ * @param[in] obj The object.
+ * @param[in] step The step value.
+ *
+ * @since 1.8
+ *
+ * @ingroup Elm_Slider
+ */
+EAPI void elm_slider_step_set(Evas_Object *obj, double step);
+
#include "efl_ui_slider.eo.legacy.h"
diff --git a/src/lib/elementary/efl_ui_slider_part_indicator.eo b/src/lib/elementary/elm_slider_part_indicator.eo
index 9930e46031..934d80875c 100644
--- a/src/lib/elementary/efl_ui_slider_part_indicator.eo
+++ b/src/lib/elementary/elm_slider_part_indicator.eo
@@ -1,6 +1,6 @@
import efl_ui;
-class Efl.Ui.Slider.Part_Indicator (Efl.Ui.Layout.Part, Efl.Ui.Format)
+class Elm.Slider.Part_Indicator (Efl.Ui.Layout.Part, Efl.Ui.Format)
{
[[Elementary slider internal part class]]
data: null;
@@ -9,7 +9,7 @@ class Efl.Ui.Slider.Part_Indicator (Efl.Ui.Layout.Part, Efl.Ui.Format)
[[Set/Get the visible mode of indicator.
]]
values {
- mode: Efl.Ui.Slider.Indicator_Visible_Mode; [[The indicator visible mode.]]
+ mode: Efl.Ui.Slider_Indicator_Visible_Mode; [[The indicator visible mode.]]
}
}
}
diff --git a/src/lib/elementary/elm_slideshow.c b/src/lib/elementary/elm_slideshow.c
index dd9d48ef0f..24d82883d8 100644
--- a/src/lib/elementary/elm_slideshow.c
+++ b/src/lib/elementary/elm_slideshow.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define ELM_WIDGET_ITEM_PROTECTED
@@ -131,7 +131,7 @@ _item_realize(Elm_Slideshow_Item_Data *item)
if ((!VIEW(item)) && (item->itc->func.get))
{
- VIEW(item) = item->itc->func.get(elm_object_item_data_get(EO_OBJ(item)), obj);
+ VIEW_SET(item, item->itc->func.get(elm_object_item_data_get(EO_OBJ(item)), obj));
item->l_built = eina_list_append(NULL, item);
sd->items_built = eina_list_merge(sd->items_built, item->l_built);
//FIXME: item could be shown by obj
@@ -161,9 +161,9 @@ _item_realize(Elm_Slideshow_Item_Data *item)
&& (_item_next->itc->func.get))
{
ic++;
- VIEW(_item_next) =
+ VIEW_SET(_item_next,
_item_next->itc->func.get(
- elm_object_item_data_get(EO_OBJ(_item_next)), obj);
+ elm_object_item_data_get(EO_OBJ(_item_next)), obj));
_item_next->l_built =
eina_list_append(NULL, _item_next);
sd->items_built = eina_list_merge
@@ -193,9 +193,9 @@ _item_realize(Elm_Slideshow_Item_Data *item)
&& (_item_prev->itc->func.get))
{
ic++;
- VIEW(_item_prev) =
+ VIEW_SET(_item_prev,
_item_prev->itc->func.get(
- elm_object_item_data_get(EO_OBJ(_item_prev)), obj);
+ elm_object_item_data_get(EO_OBJ(_item_prev)), obj));
_item_prev->l_built =
eina_list_append(NULL, _item_prev);
sd->items_built = eina_list_merge
@@ -376,7 +376,7 @@ _elm_slideshow_efl_object_constructor(Eo *obj, Elm_Slideshow_Data *_pd EINA_UNUS
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_DOCUMENT_PRESENTATION);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_DOCUMENT_PRESENTATION);
return obj;
}
@@ -547,13 +547,13 @@ _elm_slideshow_previous(Eo *obj, Elm_Slideshow_Data *sd)
}
EOLIAN static const Eina_List*
-_elm_slideshow_transitions_get(Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
+_elm_slideshow_transitions_get(const Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
{
return sd->transitions;
}
EOLIAN static const Eina_List*
-_elm_slideshow_layouts_get(Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
+_elm_slideshow_layouts_get(const Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
{
return sd->layout.list;
}
@@ -565,7 +565,7 @@ _elm_slideshow_transition_set(Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd, const
}
EOLIAN static const char*
-_elm_slideshow_transition_get(Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
+_elm_slideshow_transition_get(const Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
{
return sd->transition;
}
@@ -581,20 +581,20 @@ _elm_slideshow_timeout_set(Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd, double t
}
EOLIAN static double
-_elm_slideshow_timeout_get(Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
+_elm_slideshow_timeout_get(const Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
{
return sd->timeout;
}
EOLIAN static void
-_elm_slideshow_loop_set(Eo *obj, Elm_Slideshow_Data *sd, Eina_Bool loop)
+_elm_slideshow_items_loop_set(Eo *obj, Elm_Slideshow_Data *sd, Eina_Bool loop)
{
ELM_SLIDESHOW_CHECK(obj);
sd->loop = loop;
}
EOLIAN static const char*
-_elm_slideshow_layout_get(Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
+_elm_slideshow_layout_get(const Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
{
return sd->layout.current;
}
@@ -614,7 +614,7 @@ _elm_slideshow_layout_set(Eo *obj, Elm_Slideshow_Data *sd, const char *layout)
}
EOLIAN static Eina_Bool
-_elm_slideshow_loop_get(Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
+_elm_slideshow_items_loop_get(const Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
{
return sd->loop;
}
@@ -632,13 +632,13 @@ _elm_slideshow_clear(Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
}
EOLIAN static const Eina_List*
-_elm_slideshow_items_get(Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
+_elm_slideshow_items_get(const Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
{
return sd->items;
}
EOLIAN static Elm_Object_Item*
-_elm_slideshow_item_current_get(Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
+_elm_slideshow_item_current_get(const Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
{
return EO_OBJ(sd->current);
}
@@ -650,7 +650,7 @@ _elm_slideshow_item_object_get(const Eo *eo_item EINA_UNUSED, Elm_Slideshow_Item
}
EOLIAN static int
-_elm_slideshow_cache_before_get(Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
+_elm_slideshow_cache_before_get(const Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
{
return sd->count_item_pre_before;
}
@@ -664,7 +664,7 @@ _elm_slideshow_cache_before_set(Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd, int
}
EOLIAN static int
-_elm_slideshow_cache_after_get(Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
+_elm_slideshow_cache_after_get(const Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
{
return sd->count_item_pre_after;
}
@@ -683,7 +683,7 @@ _elm_slideshow_item_nth_get(const Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd, u
}
EOLIAN static unsigned int
-_elm_slideshow_count_get(Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
+_elm_slideshow_count_get(const Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
{
return eina_list_count(sd->items);
}
@@ -695,7 +695,7 @@ _elm_slideshow_class_constructor(Efl_Class *klass)
}
EOLIAN static const Efl_Access_Action_Data*
-_elm_slideshow_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd EINA_UNUSED)
+_elm_slideshow_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "move,left", "move", "left", _key_action_move},
diff --git a/src/lib/elementary/elm_slideshow.eo b/src/lib/elementary/elm_slideshow.eo
index 7436044040..cdaf8d654a 100644
--- a/src/lib/elementary/elm_slideshow.eo
+++ b/src/lib/elementary/elm_slideshow.eo
@@ -1,6 +1,6 @@
type Elm_Slideshow_Item_Class: __undefined_type; [[Elementary slideshow item class type]]
-class Elm.Slideshow (Efl.Ui.Layout, Efl.Access.Widget.Action)
+class Elm.Slideshow (Efl.Ui.Layout.Object, Efl.Access.Widget.Action, Efl.Ui.Legacy)
{
[[Elementary slideshow class]]
eo_prefix: elm_obj_slideshow;
@@ -80,7 +80,7 @@ class Elm.Slideshow (Efl.Ui.Layout, Efl.Access.Widget.Action)
transition: string @nullable; [[The new transition's name string.]]
}
}
- @property loop {
+ @property items_loop {
set {
[[Set if the slideshow items should be displayed cyclically or not,
so when the end is reached it will restart from the first item.
@@ -88,11 +88,13 @@ class Elm.Slideshow (Efl.Ui.Layout, Efl.Access.Widget.Action)
Note: This will affect the "automatic" slidshow behaviour and the
@.next and @.previous functions as well.
]]
+ legacy: elm_slideshow_loop_set;
}
get {
[[Get if, after a slideshow is started, for a given slideshow
widget, its items are to be displayed cyclically or not.
]]
+ legacy: elm_slideshow_loop_get;
}
values {
loop: bool; [[Use $true to make it cycle through items or
@@ -304,11 +306,11 @@ class Elm.Slideshow (Efl.Ui.Layout, Efl.Access.Widget.Action)
implements {
class.constructor;
Efl.Object.constructor;
- Elm.Widget.widget_event;
+ Efl.Ui.Widget.widget_event;
Efl.Access.Widget.Action.elm_actions { get; }
}
events {
- changed; [[Called when slideshow widget changed]]
- transition,end; [[Called on transition end]]
+ changed: Efl.Object; [[Called when slideshow widget changed]]
+ transition,end: Efl.Object; [[Called on transition end]]
}
}
diff --git a/src/lib/elementary/elm_spinner.c b/src/lib/elementary/elm_spinner.c
index 3e809ef02b..3c2c08c727 100644
--- a/src/lib/elementary/elm_spinner.c
+++ b/src/lib/elementary/elm_spinner.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_VALUE_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define EFL_UI_FOCUS_COMPOSITION_PROTECTED
@@ -219,7 +219,7 @@ apply:
else
elm_layout_text_set(obj, "elm.text", buf);
- efl_access_name_changed_signal_emit(obj);
+ efl_access_i18n_name_changed_signal_emit(obj);
if (sd->entry_visible) _entry_show(sd);
}
@@ -236,13 +236,24 @@ _delay_change_timer_cb(void *data)
static Eina_Bool
_value_set(Evas_Object *obj,
- double new_val)
+ double val, double changed)
{
+ double new_val;
+
ELM_SPINNER_DATA_GET(obj, sd);
if (sd->round > 0)
- new_val = sd->val_base +
- (double)((((int)(new_val - sd->val_base)) / sd->round) * sd->round);
+ {
+ //Spin value changed by entry input.
+ if (changed != 0)
+ new_val = sd->val_base +
+ (double)((((int)((val + changed) - sd->val_base)) / sd->round) * sd->round);
+ else
+ new_val = sd->val_base +
+ (double)((((int)(val - sd->val_base + (sd->round / 2))) / sd->round) * sd->round);
+ }
+ else
+ new_val = val + changed;
if (sd->wrap)
{
@@ -336,7 +347,7 @@ _drag_cb(void *data,
if (!strncmp(style, "vertical", 8)) delta *= -1;
/* If we are on rtl mode, change the delta to be negative on such changes */
if (efl_ui_mirrored_get(obj)) delta *= -1;
- if (_value_set(data, sd->val + delta)) _label_write(data);
+ if (_value_set(data, sd->val, delta)) _label_write(data);
sd->dragging = 1;
}
@@ -414,12 +425,8 @@ _entry_value_apply(Evas_Object *obj)
val = strtod(str, &end);
if (((*end != '\0') && (!isspace(*end))) || (fabs(val - sd->val) < DBL_EPSILON)) return;
- elm_spinner_value_set(obj, val);
- efl_event_callback_legacy_call(obj, ELM_SPINNER_EVENT_CHANGED, NULL);
- ecore_timer_del(sd->delay_change_timer);
- sd->delay_change_timer = ecore_timer_add(ELM_SPINNER_DELAY_CHANGE_TIME,
- _delay_change_timer_cb, obj);
+ if (_value_set(obj, val, 0.0)) _label_write(obj);
}
static int
@@ -594,11 +601,11 @@ _entry_show_cb(void *data,
ELM_SPINNER_DATA_GET(data, sd);
_entry_show(sd);
+ elm_layout_signal_emit(data, "elm,state,button,inactive", "elm");
+ evas_object_hide(sd->text_button);
elm_object_focus_set(obj, EINA_TRUE);
elm_entry_select_all(obj);
sd->entry_visible = EINA_TRUE;
- elm_layout_signal_emit(data, "elm,state,button,inactive", "elm");
- evas_object_hide(sd->text_button);
}
static void
@@ -660,7 +667,7 @@ _toggle_entry(Evas_Object *obj)
efl_ui_focus_composition_elements_set(obj, items);
}
- efl_ui_focus_manager_focus_set(efl_ui_focus_user_focus_manager_get(obj), sd->ent);
+ efl_ui_focus_manager_focus_set(efl_ui_focus_object_focus_manager_get(obj), sd->ent);
}
}
@@ -691,7 +698,7 @@ _spin_value(void *data)
// spin_timer does not exist when _spin_value() is called from wheel event
if (sd->spin_timer)
ecore_timer_interval_set(sd->spin_timer, sd->interval);
- if (_value_set(data, sd->val + real_speed)) _label_write(data);
+ if (_value_set(data, sd->val, real_speed)) _label_write(data);
return ECORE_CALLBACK_RENEW;
}
@@ -737,7 +744,7 @@ _key_action_toggle(Evas_Object *obj, const char *params EINA_UNUSED)
}
EOLIAN static Eina_Bool
-_elm_spinner_elm_widget_widget_event(Eo *obj, Elm_Spinner_Data *sd EINA_UNUSED, const Efl_Event *eo_event, Evas_Object *src EINA_UNUSED)
+_elm_spinner_efl_ui_widget_widget_event(Eo *obj, Elm_Spinner_Data *sd EINA_UNUSED, const Efl_Event *eo_event, Evas_Object *src EINA_UNUSED)
{
Eo *ev = eo_event->info;
@@ -930,17 +937,18 @@ _elm_spinner_elm_layout_sizing_eval(Eo *obj, Elm_Spinner_Data *_pd EINA_UNUSED)
}
EOLIAN static Eina_Bool
-_elm_spinner_elm_widget_on_focus_update(Eo *obj, Elm_Spinner_Data *sd, Elm_Object_Item *item EINA_UNUSED)
+_elm_spinner_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Spinner_Data *sd)
{
Eina_Bool int_ret = EINA_FALSE;
- int_ret = efl_ui_widget_on_focus_update(efl_super(obj, MY_CLASS), NULL);
+ int_ret = efl_ui_focus_object_on_focus_update(efl_super(obj, MY_CLASS));
if (!int_ret) return EINA_FALSE;
if (!efl_ui_focus_object_focus_get(obj))
{
ELM_SAFE_FREE(sd->delay_change_timer, ecore_timer_del);
ELM_SAFE_FREE(sd->spin_timer, ecore_timer_del);
+ ELM_SAFE_FREE(sd->longpress_timer, ecore_timer_del);
}
else
{
@@ -972,7 +980,9 @@ _access_activate_cb(void *data,
increment_part = "right_bt";
eo = elm_layout_edje_get(data);
+ edje_object_freeze(eo);
inc_btn = (Evas_Object *)edje_object_part_object_get(eo, increment_part);
+ edje_object_thaw(eo);
if (part_obj != inc_btn)
{
@@ -1210,6 +1220,7 @@ _elm_spinner_efl_canvas_group_group_add(Eo *obj, Elm_Spinner_Data *priv)
priv->text_button = elm_button_add(obj);
elm_object_style_set(priv->text_button, "spinner/default");
+ elm_widget_can_focus_set(priv->text_button, _elm_config->access_mode);
efl_event_callback_add
(priv->text_button, EFL_UI_EVENT_CLICKED, _text_button_clicked_cb, obj);
@@ -1289,7 +1300,7 @@ _elm_spinner_efl_canvas_group_group_del(Eo *obj, Elm_Spinner_Data *sd)
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_spinner_elm_widget_theme_apply(Eo *obj, Elm_Spinner_Data *sd)
+_elm_spinner_efl_ui_widget_theme_apply(Eo *obj, Elm_Spinner_Data *sd)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
@@ -1346,7 +1357,7 @@ _elm_spinner_elm_widget_theme_apply(Eo *obj, Elm_Spinner_Data *sd)
static Eina_Bool _elm_spinner_smart_focus_next_enable = EINA_FALSE;
EOLIAN static void
-_elm_spinner_elm_widget_on_access_update(Eo *obj, Elm_Spinner_Data *_pd EINA_UNUSED, Eina_Bool acs)
+_elm_spinner_efl_ui_widget_on_access_update(Eo *obj, Elm_Spinner_Data *_pd EINA_UNUSED, Eina_Bool acs)
{
_elm_spinner_smart_focus_next_enable = acs;
_access_spinner_register(obj, _elm_spinner_smart_focus_next_enable);
@@ -1401,7 +1412,7 @@ _elm_spinner_efl_object_constructor(Eo *obj, Elm_Spinner_Data *_pd EINA_UNUSED)
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_SPIN_BUTTON);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_SPIN_BUTTON);
return obj;
}
@@ -1432,7 +1443,7 @@ _elm_spinner_label_format_set(Eo *obj, Elm_Spinner_Data *sd, const char *fmt)
}
EOLIAN static const char*
-_elm_spinner_label_format_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
+_elm_spinner_label_format_get(const Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
{
return sd->label;
}
@@ -1453,7 +1464,7 @@ _elm_spinner_efl_ui_range_range_min_max_set(Eo *obj, Elm_Spinner_Data *sd, doubl
}
EOLIAN static void
-_elm_spinner_efl_ui_range_range_min_max_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd, double *min, double *max)
+_elm_spinner_efl_ui_range_range_min_max_get(const Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd, double *min, double *max)
{
if (min) *min = sd->val_min;
if (max) *max = sd->val_max;
@@ -1466,7 +1477,7 @@ _elm_spinner_efl_ui_range_range_step_set(Eo *obj EINA_UNUSED, Elm_Spinner_Data *
}
EOLIAN static double
-_elm_spinner_efl_ui_range_range_step_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
+_elm_spinner_efl_ui_range_range_step_get(const Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
{
return sd->step;
}
@@ -1476,7 +1487,9 @@ _elm_spinner_efl_ui_range_range_value_set(Eo *obj, Elm_Spinner_Data *sd, double
{
if (sd->val == val) return;
- sd->val = val;
+ sd->val = (sd->round <= 0) ? val : sd->val_base +
+ (double)((((int)(val - sd->val_base + (sd->round / 2))) / sd->round) * sd->round);
+
sd->val_updated = EINA_FALSE;
if (sd->val < sd->val_min)
@@ -1495,7 +1508,7 @@ _elm_spinner_efl_ui_range_range_value_set(Eo *obj, Elm_Spinner_Data *sd, double
}
EOLIAN static double
-_elm_spinner_efl_ui_range_range_value_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
+_elm_spinner_efl_ui_range_range_value_get(const Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
{
return sd->val;
}
@@ -1507,7 +1520,7 @@ _elm_spinner_wrap_set(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd, Eina_Bool wrap)
}
EOLIAN static Eina_Bool
-_elm_spinner_wrap_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
+_elm_spinner_wrap_get(const Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
{
return sd->wrap;
}
@@ -1583,10 +1596,11 @@ EOLIAN static void
_elm_spinner_editable_set(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd, Eina_Bool editable)
{
sd->editable = editable;
+ elm_widget_can_focus_set(sd->text_button, editable | _elm_config->access_mode);
}
EOLIAN static Eina_Bool
-_elm_spinner_editable_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
+_elm_spinner_editable_get(const Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
{
return sd->editable;
}
@@ -1598,7 +1612,7 @@ _elm_spinner_interval_set(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd, double inte
}
EOLIAN static double
-_elm_spinner_interval_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
+_elm_spinner_interval_get(const Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
{
return sd->first_interval;
}
@@ -1610,7 +1624,7 @@ _elm_spinner_base_set(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd, double base)
}
EOLIAN static double
-_elm_spinner_base_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
+_elm_spinner_base_get(const Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
{
return sd->val_base;
}
@@ -1622,7 +1636,7 @@ _elm_spinner_round_set(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd, int rnd)
}
EOLIAN static int
-_elm_spinner_round_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
+_elm_spinner_round_get(const Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
{
return sd->round;
}
@@ -1637,7 +1651,7 @@ _elm_spinner_class_constructor(Efl_Class *klass)
}
EOLIAN static const Efl_Access_Action_Data *
-_elm_spinner_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd EINA_UNUSED)
+_elm_spinner_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "toggle", "toggle", NULL, _key_action_toggle},
@@ -1649,7 +1663,7 @@ _elm_spinner_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_S
// A11Y Accessibility
EOLIAN static void
-_elm_spinner_efl_access_value_value_and_text_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd, double *value, const char **text)
+_elm_spinner_efl_access_value_value_and_text_get(const Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd, double *value, const char **text)
{
if (value) *value = sd->val;
if (text) *text = NULL;
@@ -1668,7 +1682,7 @@ _elm_spinner_efl_access_value_value_and_text_set(Eo *obj, Elm_Spinner_Data *sd,
}
EOLIAN static void
-_elm_spinner_efl_access_value_range_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd, double *lower, double *upper, const char **descr)
+_elm_spinner_efl_access_value_range_get(const Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd, double *lower, double *upper, const char **descr)
{
if (lower) *lower = sd->val_min;
if (upper) *upper = sd->val_max;
@@ -1676,16 +1690,16 @@ _elm_spinner_efl_access_value_range_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *s
}
EOLIAN static double
-_elm_spinner_efl_access_value_increment_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
+_elm_spinner_efl_access_value_increment_get(const Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
{
return sd->step;
}
EOLIAN static const char*
-_elm_spinner_efl_access_name_get(Eo *obj, Elm_Spinner_Data *sd)
+_elm_spinner_efl_access_object_i18n_name_get(const Eo *obj, Elm_Spinner_Data *sd)
{
const char *name, *ret;
- name = efl_access_name_get(efl_super(obj, ELM_SPINNER_CLASS));
+ name = efl_access_object_i18n_name_get(efl_super(obj, ELM_SPINNER_CLASS));
if (name) return name;
if (sd->button_layout)
{
diff --git a/src/lib/elementary/elm_spinner.eo b/src/lib/elementary/elm_spinner.eo
index f1496108ad..c5d1add14c 100644
--- a/src/lib/elementary/elm_spinner.eo
+++ b/src/lib/elementary/elm_spinner.eo
@@ -1,5 +1,5 @@
-class Elm.Spinner (Efl.Ui.Layout, Efl.Ui.Range, Efl.Ui.Focus.Composition,
- Efl.Access.Value, Efl.Access.Widget.Action)
+class Elm.Spinner (Efl.Ui.Layout.Object, Efl.Ui.Range, Efl.Ui.Focus.Composition,
+ Efl.Access.Value, Efl.Access.Widget.Action, Efl.Ui.Legacy)
{
[[Elementary spinner class]]
legacy_prefix: elm_spinner;
@@ -170,25 +170,26 @@ class Elm.Spinner (Efl.Ui.Layout, Efl.Ui.Range, Efl.Ui.Focus.Composition,
implements {
class.constructor;
Efl.Object.constructor;
- Elm.Widget.theme_apply;
- Elm.Widget.on_access_update;
- Elm.Widget.on_focus_update;
- Elm.Widget.widget_event;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.on_access_update;
+ Efl.Ui.Focus.Object.on_focus_update;
+ Efl.Ui.Widget.widget_event;
Efl.Ui.Range.range_min_max { get; set; }
Efl.Ui.Range.range_step { get; set; }
Efl.Ui.Range.range_value { get; set; }
- Efl.Access.name { get; }
+ Efl.Access.Object.i18n_name { get; }
Efl.Access.Value.value_and_text { get; set; }
Efl.Access.Value.range { get; }
Efl.Access.Value.increment { get; }
Efl.Access.Widget.Action.elm_actions { get; }
}
events {
- changed; [[Called when spinner changed]]
- delay,changed; [[Called when spinner delay changed]]
- spinner,drag,start; [[Called when spinner drag started]]
- spinner,drag,stop; [[Called when spinner drag stopped]]
- min,reached; [[Called when spinner value reached min]]
- max,reached; [[Called when spinner value reached max]]
+ /* FIXME: Colorselector puts Colorselector_Data here! */
+ changed: void; [[Called when spinner changed]]
+ delay,changed: void; [[Called when spinner delay changed]]
+ spinner,drag,start: void; [[Called when spinner drag started]]
+ spinner,drag,stop: void; [[Called when spinner drag stopped]]
+ min,reached: void; [[Called when spinner value reached min]]
+ max,reached: void; [[Called when spinner value reached max]]
}
}
diff --git a/src/lib/elementary/elm_sys_notify.c b/src/lib/elementary/elm_sys_notify.c
index 4d1db56af8..a993a8cc3a 100644
--- a/src/lib/elementary/elm_sys_notify.c
+++ b/src/lib/elementary/elm_sys_notify.c
@@ -185,7 +185,7 @@ _elm_sys_notify_servers_set(Eo *obj EINA_UNUSED,
}
EOLIAN static Elm_Sys_Notify_Server
-_elm_sys_notify_servers_get(Eo *obj EINA_UNUSED,
+_elm_sys_notify_servers_get(const Eo *obj EINA_UNUSED,
Elm_Sys_Notify_Data *sd)
{
Elm_Sys_Notify_Server servers = ELM_SYS_NOTIFY_SERVER_NONE;
@@ -203,7 +203,7 @@ _elm_sys_notify_singleton_get(Eo *obj EINA_UNUSED,
void *sd EINA_UNUSED)
{
if (!_singleton)
- _singleton = efl_add(MY_CLASS, NULL);
+ _singleton = efl_add(MY_CLASS, efl_main_loop_get());
return _singleton;
}
diff --git a/src/lib/elementary/elm_systray.c b/src/lib/elementary/elm_systray.c
index bcc8c0a2e5..0c6c3f0a09 100644
--- a/src/lib/elementary/elm_systray.c
+++ b/src/lib/elementary/elm_systray.c
@@ -315,7 +315,7 @@ _elm_systray_category_set(Eo *obj EINA_UNUSED, void *priv EINA_UNUSED, Elm_Systr
}
EOLIAN static Elm_Systray_Category
-_elm_systray_category_get(Eo *obj EINA_UNUSED, void *priv EINA_UNUSED)
+_elm_systray_category_get(const Eo *obj EINA_UNUSED, void *priv EINA_UNUSED)
{
return _item.cat;
}
@@ -332,7 +332,7 @@ _elm_systray_status_set(Eo *obj EINA_UNUSED, void *priv EINA_UNUSED, Elm_Systray
}
EOLIAN static Elm_Systray_Status
-_elm_systray_status_get(Eo *obj EINA_UNUSED, void *priv EINA_UNUSED)
+_elm_systray_status_get(const Eo *obj EINA_UNUSED, void *priv EINA_UNUSED)
{
return _item.status;
}
@@ -347,7 +347,7 @@ _elm_systray_att_icon_name_set(Eo *obj EINA_UNUSED, void *priv EINA_UNUSED, cons
}
EOLIAN static const char*
-_elm_systray_att_icon_name_get(Eo *obj EINA_UNUSED, void *priv EINA_UNUSED)
+_elm_systray_att_icon_name_get(const Eo *obj EINA_UNUSED, void *priv EINA_UNUSED)
{
return _item.att_icon_name;
}
@@ -362,7 +362,7 @@ _elm_systray_icon_name_set(Eo *obj EINA_UNUSED, void *priv EINA_UNUSED, const ch
}
EOLIAN static const char*
-_elm_systray_icon_name_get(Eo *obj EINA_UNUSED, void *priv EINA_UNUSED)
+_elm_systray_icon_name_get(const Eo *obj EINA_UNUSED, void *priv EINA_UNUSED)
{
return _item.icon_name;
}
@@ -379,7 +379,7 @@ _elm_systray_icon_theme_path_set(Eo *obj EINA_UNUSED, void *priv EINA_UNUSED, co
}
EOLIAN static const char*
-_elm_systray_icon_theme_path_get(Eo *obj EINA_UNUSED, void *priv EINA_UNUSED)
+_elm_systray_icon_theme_path_get(const Eo *obj EINA_UNUSED, void *priv EINA_UNUSED)
{
return _item.icon_theme_path;
}
@@ -393,7 +393,7 @@ _elm_systray_id_set(Eo *obj EINA_UNUSED, void *priv EINA_UNUSED, const char *id)
}
EOLIAN static const char*
-_elm_systray_id_get(Eo *obj EINA_UNUSED, void *priv EINA_UNUSED)
+_elm_systray_id_get(const Eo *obj EINA_UNUSED, void *priv EINA_UNUSED)
{
return _item.id;
}
@@ -408,7 +408,7 @@ _elm_systray_title_set(Eo *obj EINA_UNUSED, void *priv EINA_UNUSED, const char *
}
EOLIAN static const char*
-_elm_systray_title_get(Eo *obj EINA_UNUSED, void *priv EINA_UNUSED)
+_elm_systray_title_get(const Eo *obj EINA_UNUSED, void *priv EINA_UNUSED)
{
return _item.title;
}
@@ -439,7 +439,7 @@ _elm_systray_menu_set(Eo *obj EINA_UNUSED, void *priv EINA_UNUSED, const Eo *men
}
EOLIAN static const Eo*
-_elm_systray_menu_get(Eo *obj EINA_UNUSED, void *priv EINA_UNUSED)
+_elm_systray_menu_get(const Eo *obj EINA_UNUSED, void *priv EINA_UNUSED)
{
return _item.menu_obj;
}
diff --git a/src/lib/elementary/elm_table.c b/src/lib/elementary/elm_table.c
index ca3de608a5..5cab078534 100644
--- a/src/lib/elementary/elm_table.c
+++ b/src/lib/elementary/elm_table.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_UI_FOCUS_COMPOSITION_PROTECTED
#include <Elementary.h>
@@ -18,9 +18,18 @@
static void
_elm_table_efl_ui_focus_composition_prepare(Eo *obj, void *pd EINA_UNUSED)
{
- Elm_Widget_Smart_Data *wpd = efl_data_scope_get(obj, ELM_WIDGET_CLASS);
+ Eina_List *l, *ll;
+ Efl_Ui_Widget *elem;
+
+ Elm_Widget_Smart_Data *wpd = efl_data_scope_get(obj, EFL_UI_WIDGET_CLASS);
Eina_List *order = evas_object_table_children_get(wpd->resize_obj);
+ EINA_LIST_FOREACH_SAFE(order, l, ll, elem)
+ {
+ if (!efl_isa(elem, EFL_UI_WIDGET_CLASS))
+ order = eina_list_remove(order, elem);
+ }
+
efl_ui_focus_composition_elements_set(obj, order);
}
@@ -33,7 +42,7 @@ _mirrored_set(Evas_Object *obj, Eina_Bool rtl)
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_table_elm_widget_theme_apply(Eo *obj, void *sd EINA_UNUSED)
+_elm_table_efl_ui_widget_theme_apply(Eo *obj, void *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
@@ -65,7 +74,7 @@ _on_size_hints_changed(void *data,
}
EOLIAN static Eina_Bool
-_elm_table_elm_widget_widget_sub_object_del(Eo *obj, void *_pd EINA_UNUSED, Evas_Object *child)
+_elm_table_efl_ui_widget_widget_sub_object_del(Eo *obj, void *_pd EINA_UNUSED, Evas_Object *child)
{
Eina_Bool int_ret = EINA_FALSE;
@@ -137,7 +146,7 @@ _elm_table_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_FILLER);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_FILLER);
return obj;
}
@@ -152,7 +161,7 @@ _elm_table_homogeneous_set(Eo *obj, void *_pd EINA_UNUSED, Eina_Bool homogeneous
}
EOLIAN static Eina_Bool
-_elm_table_homogeneous_get(Eo *obj, void *_pd EINA_UNUSED)
+_elm_table_homogeneous_get(const Eo *obj, void *_pd EINA_UNUSED)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
return evas_object_table_homogeneous_get(wd->resize_obj);
@@ -168,7 +177,7 @@ _elm_table_padding_set(Eo *obj, void *_pd EINA_UNUSED, Evas_Coord horizontal, Ev
}
EOLIAN static void
-_elm_table_padding_get(Eo *obj, void *_pd EINA_UNUSED, Evas_Coord *horizontal, Evas_Coord *vertical)
+_elm_table_padding_get(const Eo *obj, void *_pd EINA_UNUSED, Evas_Coord *horizontal, Evas_Coord *vertical)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
@@ -186,7 +195,7 @@ _elm_table_align_set(Eo *obj, void *_pd EINA_UNUSED, double horizontal, double v
}
EOLIAN static void
-_elm_table_align_get(Eo *obj, void *_pd EINA_UNUSED, double *horizontal, double *vertical)
+_elm_table_align_get(const Eo *obj, void *_pd EINA_UNUSED, double *horizontal, double *vertical)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
diff --git a/src/lib/elementary/elm_table.eo b/src/lib/elementary/elm_table.eo
index 115d43c1c0..7eaae08231 100644
--- a/src/lib/elementary/elm_table.eo
+++ b/src/lib/elementary/elm_table.eo
@@ -1,4 +1,4 @@
-class Elm.Table (Elm.Widget, Efl.Ui.Focus.Composition)
+class Elm.Table (Efl.Ui.Widget, Efl.Ui.Focus.Composition, Efl.Ui.Legacy)
{
[[Elementary table class]]
legacy_prefix: elm_table;
@@ -121,8 +121,8 @@ class Elm.Table (Elm.Widget, Efl.Ui.Focus.Composition)
class.constructor;
Efl.Object.constructor;
Efl.Canvas.Group.group_calculate;
- Elm.Widget.theme_apply;
- Elm.Widget.widget_sub_object_del;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.widget_sub_object_del;
Efl.Ui.Focus.Composition.prepare;
}
}
diff --git a/src/lib/elementary/elm_theme.c b/src/lib/elementary/elm_theme.c
index 4043e11ce4..305f6fe102 100644
--- a/src/lib/elementary/elm_theme.c
+++ b/src/lib/elementary/elm_theme.c
@@ -9,30 +9,45 @@
static Elm_Theme theme_default =
{
- { NULL, NULL }, { NULL, NULL }, { NULL, NULL },
+ NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, 1, NULL
};
static Eina_List *themes = NULL;
static Eina_File *
-_elm_theme_find_try(Elm_Theme *th, Eina_File *f, const char *group)
+_elm_theme_find_try(Elm_Theme *th, Elm_Theme_File *etf, const char *group, Eina_Bool force)
{
- if (edje_mmap_group_exists(f, group))
+ if (edje_mmap_group_exists(etf->handle, group))
{
- eina_hash_add(th->cache, group, eina_file_dup(f));
- return f;
+ if (etf->match_theme && (!force)) // overlay or extension
+ {
+ Elm_Theme_File *base_etf;
+ Eina_Bool found = EINA_FALSE;
+
+ EINA_INLIST_FOREACH(th->themes, base_etf)
+ {
+ if (base_etf->base_theme != etf->match_theme) continue;
+ found = EINA_TRUE;
+ break;
+ }
+ if (!found) return NULL;
+ }
+ eina_hash_add(th->cache, group, eina_file_dup(etf->handle));
+ return etf->handle;
}
return NULL;
}
static inline void
-_elm_theme_item_finalize(Elm_Theme_Files *files,
+_elm_theme_item_finalize(Eina_Inlist **files,
const char *item,
Eina_File *f,
Eina_Bool prepend,
Eina_Bool istheme)
{
+ Elm_Theme_File *etf;
+ char *name;
/* Theme version history:
* <110: legacy, had no version tag
* 110: first supported version
@@ -55,22 +70,33 @@ _elm_theme_item_finalize(Elm_Theme_Files *files,
}
free(version);
}
+ etf = calloc(1, sizeof(Elm_Theme_File));
+ EINA_SAFETY_ON_NULL_RETURN(etf);
+ etf->item = eina_stringshare_add(item);
+ etf->handle = f;
+ if (istheme)
+ {
+ name = edje_mmap_data_get(f, "efl_theme_base");
+ etf->base_theme = eina_stringshare_add(name);
+ }
+ else
+ {
+ name = edje_mmap_data_get(f, "efl_theme_match");
+ etf->match_theme = eina_stringshare_add(name);
+ }
+ free(name);
if (prepend)
{
- files->items = eina_list_prepend(files->items,
- eina_stringshare_add(item));
- files->handles = eina_list_prepend(files->handles, f);
+ *files = eina_inlist_prepend(*files, EINA_INLIST_GET(etf));
}
else
{
- files->items = eina_list_append(files->items,
- eina_stringshare_add(item));
- files->handles = eina_list_append(files->handles, f);
+ *files = eina_inlist_append(*files, EINA_INLIST_GET(etf));
}
}
static void
-_elm_theme_file_item_add(Elm_Theme_Files *files, const char *item, Eina_Bool prepend, Eina_Bool istheme)
+_elm_theme_file_item_add(Eina_Inlist **files, const char *item, Eina_Bool prepend, Eina_Bool istheme)
{
Eina_Strbuf *buf = NULL;
Eina_File *f = NULL;
@@ -118,69 +144,54 @@ _elm_theme_file_item_add(Elm_Theme_Files *files, const char *item, Eina_Bool pre
}
static void
-_elm_theme_file_item_del(Elm_Theme_Files *files, const char *str)
+_elm_theme_file_item_del(Eina_Inlist **files, const char *str)
{
- Eina_List *l, *ll;
- Eina_List *l2, *ll2;
- const char *item;
+ Eina_Inlist *l;
+ Elm_Theme_File *item;
str = eina_stringshare_add(str);
- l2 = files->handles;
- EINA_LIST_FOREACH_SAFE(files->items, l, ll, item)
+ EINA_INLIST_FOREACH_SAFE(*files, l, item)
{
- ll2 = l2->next;
-
- if (item == str)
- {
- eina_file_close(eina_list_data_get(l2));
- eina_stringshare_del(item);
-
- files->handles = eina_list_remove_list(files->handles, l2);
- files->items = eina_list_remove_list(files->items, l);
- }
-
- l2 = ll2;
+ if (item->item != str) continue;
+ eina_file_close(item->handle);
+ eina_stringshare_del(item->item);
+ *files = eina_inlist_remove(*files, EINA_INLIST_GET(item));
+ free(item);
}
eina_stringshare_del(str);
}
static void
-_elm_theme_file_mmap_del(Elm_Theme_Files *files, const Eina_File *file)
+_elm_theme_file_mmap_del(Eina_Inlist **files, const Eina_File *file)
{
- Eina_List *l, *ll;
- Eina_List *l2, *ll2;
- Eina_File *f;
+ Eina_Inlist *l;
+ Elm_Theme_File *item;
- l2 = files->items;
- EINA_LIST_FOREACH_SAFE(files->handles, l, ll, f)
+ EINA_INLIST_FOREACH_SAFE(*files, l, item)
{
- ll2 = l2->next;
-
- if (f == file)
- {
- eina_file_close(f);
- eina_stringshare_del(eina_list_data_get(l2));
-
- files->handles = eina_list_remove_list(files->handles, l);
- files->items = eina_list_remove_list(files->items, l2);
- }
-
- l2 = ll2;
+ if (item->handle != file) continue;
+ eina_file_close(item->handle);
+ eina_stringshare_del(item->item);
+ *files = eina_inlist_remove(*files, EINA_INLIST_GET(item));
+ free(item);
}
}
static void
-_elm_theme_file_clean(Elm_Theme_Files *files)
+_elm_theme_file_clean(Eina_Inlist **files)
{
- const char *item;
- Eina_File *f;
+ while (*files)
+ {
+ Elm_Theme_File *etf = EINA_INLIST_CONTAINER_GET(*files, Elm_Theme_File);
- EINA_LIST_FREE(files->items, item)
- eina_stringshare_del(item);
- EINA_LIST_FREE(files->handles, f)
- eina_file_close(f);
+ eina_stringshare_del(etf->item);
+ eina_file_close(etf->handle);
+ eina_stringshare_del(etf->match_theme);
+ *files = eina_inlist_remove(*files, *files);
+ free(etf);
+ }
}
static void
@@ -190,6 +201,10 @@ _elm_theme_clear(Elm_Theme *th)
_elm_theme_file_clean(&th->overlay);
_elm_theme_file_clean(&th->extension);
+ ELM_SAFE_FREE(th->overlay_items, eina_list_free);
+ ELM_SAFE_FREE(th->theme_items, eina_list_free);
+ ELM_SAFE_FREE(th->extension_items, eina_list_free);
+
ELM_SAFE_FREE(th->cache, eina_hash_free);
ELM_SAFE_FREE(th->cache_data, eina_hash_free);
ELM_SAFE_FREE(th->cache_style_load_failed, eina_hash_free);
@@ -203,33 +218,42 @@ _elm_theme_clear(Elm_Theme *th)
}
}
-Eina_File *
-_elm_theme_group_file_find(Elm_Theme *th, const char *group)
+static Eina_File *
+_elm_theme_group_file_find_internal(Elm_Theme *th, const char *group, Eina_Bool force)
{
- const Eina_List *l;
+ Elm_Theme_File *etf;
Eina_File *file = eina_hash_find(th->cache, group);
if (file) return file;
- EINA_LIST_FOREACH(th->overlay.handles, l, file)
+ EINA_INLIST_FOREACH(th->overlay, etf)
{
- file = _elm_theme_find_try(th, file, group);
+ file = _elm_theme_find_try(th, etf, group, force);
if (file) return file;
}
- EINA_LIST_FOREACH(th->themes.handles, l, file)
+ EINA_INLIST_FOREACH(th->themes, etf)
{
- file = _elm_theme_find_try(th, file, group);
+ file = _elm_theme_find_try(th, etf, group, force);
if (file) return file;
}
- EINA_LIST_FOREACH(th->extension.handles, l, file)
+ EINA_INLIST_FOREACH(th->extension, etf)
{
- file = _elm_theme_find_try(th, file, group);
+ file = _elm_theme_find_try(th, etf, group, force);
if (file) return file;
}
- if (th->ref_theme) return _elm_theme_group_file_find(th->ref_theme, group);
+ if (th->ref_theme) return _elm_theme_group_file_find_internal(th->ref_theme, group, force);
return NULL;
}
+Eina_File *
+_elm_theme_group_file_find(Elm_Theme *th, const char *group)
+{
+ Eina_File *file = _elm_theme_group_file_find_internal(th, group, EINA_FALSE);
+ if (file) return file;
+ file = _elm_theme_group_file_find_internal(th, group, EINA_TRUE);
+ return file;
+}
+
static const char *
_elm_theme_find_data_try(Elm_Theme *th, const Eina_File *f, const char *key)
{
@@ -250,25 +274,24 @@ _elm_theme_find_data_try(Elm_Theme *th, const Eina_File *f, const char *key)
static const char *
_elm_theme_data_find(Elm_Theme *th, const char *key)
{
- const Eina_List *l;
- const Eina_File *f;
+ Elm_Theme_File *etf;
const char *data = eina_hash_find(th->cache_data, key);
if (data) return data;
- EINA_LIST_FOREACH(th->overlay.handles, l, f)
+ EINA_INLIST_FOREACH(th->overlay, etf)
{
- data = _elm_theme_find_data_try(th, f, key);
+ data = _elm_theme_find_data_try(th, etf->handle, key);
if (data) return data;
}
- EINA_LIST_FOREACH(th->themes.handles, l, f)
+ EINA_INLIST_FOREACH(th->themes, etf)
{
- data = _elm_theme_find_data_try(th, f, key);
+ data = _elm_theme_find_data_try(th, etf->handle, key);
if (data) return data;
}
- EINA_LIST_FOREACH(th->extension.handles, l, f)
+ EINA_INLIST_FOREACH(th->extension, etf)
{
- data = _elm_theme_find_data_try(th, f, key);
+ data = _elm_theme_find_data_try(th, etf->handle, key);
if (data) return data;
}
if (th->ref_theme) return _elm_theme_data_find(th->ref_theme, key);
@@ -281,6 +304,7 @@ _elm_theme_object_set(Evas_Object *parent, Evas_Object *o, const char *clas, con
Elm_Theme *th = NULL;
if (parent) th = elm_widget_theme_get(parent);
+
return _elm_theme_set(th, o, clas, group, style, elm_widget_is_legacy(parent));
}
@@ -296,21 +320,21 @@ _elm_theme_object_icon_set(Evas_Object *o,
}
Efl_Ui_Theme_Apply
-_elm_theme_set(Elm_Theme *th, Evas_Object *o, const char *clas, const char *group, const char *style, Eina_Bool is_legacy EINA_UNUSED)
+_elm_theme_set(Elm_Theme *th, Evas_Object *o, const char *clas, const char *group, const char *style, Eina_Bool is_legacy)
{
Eina_File *file;
char buf2[1024];
-// const char *group_sep = "/";
-// const char *style_sep = ":";
+ const char *group_sep = "/";
+ const char *style_sep = ":";
if ((!clas) || !o) return EFL_UI_THEME_APPLY_FAILED;
if (!th) th = &(theme_default);
- //if (is_legacy)
+ if (is_legacy)
snprintf(buf2, sizeof(buf2), "elm/%s/%s/%s", clas, (group) ? group : "base", (style) ? style : "default");
- //else
- //snprintf(buf2, sizeof(buf2), "efl/%s%s%s%s%s", clas,
- //((group) ? group_sep : "\0"), ((group) ? group : "\0"),
- //((style) ? style_sep : "\0"), ((style) ? style : "\0"));
+ else
+ snprintf(buf2, sizeof(buf2), "efl/%s%s%s%s%s", clas,
+ ((group) ? group_sep : "\0"), ((group) ? group : "\0"),
+ ((style) ? style_sep : "\0"), ((style) ? style : "\0"));
if (!eina_hash_find(th->cache_style_load_failed, buf2))
{
file = _elm_theme_group_file_find(th, buf2);
@@ -332,35 +356,9 @@ _elm_theme_set(Elm_Theme *th, Evas_Object *o, const char *clas, const char *grou
if (!style)
return EFL_UI_THEME_APPLY_FAILED;
+ if (eina_streq(style, "default")) return EFL_UI_THEME_APPLY_FAILED;
// Use the elementary default style.
- //if (is_legacy)
- snprintf(buf2, sizeof(buf2), "elm/%s/%s/%s", clas, (group) ? group : "base", "default");
- //else
- //snprintf(buf2, sizeof(buf2), "efl/%s%s%s", clas,
- //((group) ? group_sep : "\0"), ((group) ? group : "\0"));
- if (!eina_hash_find(th->cache_style_load_failed, buf2))
- {
- file = _elm_theme_group_file_find(th, buf2);
- if (file)
- {
- if (edje_object_mmap_set(o, file, buf2))
- {
- INF("could not set theme style '%s', fallback to default",
- style);
- return EFL_UI_THEME_APPLY_DEFAULT;
- }
- else
- {
- INF("could not set theme group '%s' from file '%s': %s",
- buf2,
- eina_file_filename_get(file),
- edje_load_error_str(edje_object_load_error_get(o)));
- }
- }
- //style not found, add to the not found list
- eina_hash_add(th->cache_style_load_failed, buf2, (void *)1);
- }
- return EFL_UI_THEME_APPLY_FAILED;
+ return _elm_theme_set(th, o, clas, group, "default", is_legacy);
}
Eina_Bool
@@ -404,7 +402,6 @@ void
_elm_theme_parse(Elm_Theme *th, const char *theme)
{
Eina_List *names = NULL;
- Eina_File *f;
const char *p, *pe;
if (!th) th = &(theme_default);
@@ -469,11 +466,12 @@ _elm_theme_parse(Elm_Theme *th, const char *theme)
th->cache_data = eina_hash_string_superfast_new(EINA_FREE_CB(eina_stringshare_del));
if (th->cache_style_load_failed) eina_hash_free(th->cache_style_load_failed);
th->cache_style_load_failed = eina_hash_string_superfast_new(NULL);
- EINA_LIST_FREE(th->themes.items, p) eina_stringshare_del(p);
- EINA_LIST_FREE(th->themes.handles, f) eina_file_close(f);
+ _elm_theme_file_clean(&th->themes);
+ th->theme_items = eina_list_free(th->theme_items);
EINA_LIST_FREE(names, p)
_elm_theme_file_item_add(&th->themes, p, EINA_FALSE, EINA_TRUE);
+ elm_theme_get(th);
}
void
@@ -513,18 +511,17 @@ elm_theme_free(Elm_Theme *th)
}
static void
-elm_theme_files_copy(Elm_Theme_Files *dst, Elm_Theme_Files *src)
+elm_theme_files_copy(Eina_Inlist **dst, Eina_Inlist **src)
{
- const Eina_List *l;
- const Eina_File *f;
- const char *item;
+ Elm_Theme_File *etf, *cpy;
- EINA_LIST_FOREACH(src->items, l, item)
- dst->items = eina_list_append(dst->items,
- eina_stringshare_ref(item));
- EINA_LIST_FOREACH(src->handles, l, f)
- dst->handles = eina_list_append(dst->handles,
- eina_file_dup(f));
+ EINA_INLIST_FOREACH(*src, etf)
+ {
+ cpy = malloc(sizeof(Elm_Theme_File));
+ cpy->item = eina_stringshare_ref(etf->item);
+ cpy->handle = eina_file_dup(etf->handle);
+ *dst = eina_inlist_append(*dst, EINA_INLIST_GET(cpy));
+ }
}
EAPI void
@@ -582,6 +579,7 @@ elm_theme_overlay_add(Elm_Theme *th, const char *item)
{
if (!item) return;
if (!th) th = &(theme_default);
+ th->overlay_items = eina_list_free(th->overlay_items);
_elm_theme_file_item_add(&th->overlay, item, EINA_TRUE, EINA_FALSE);
elm_theme_flush(th);
}
@@ -591,6 +589,7 @@ elm_theme_overlay_del(Elm_Theme *th, const char *item)
{
if (!item) return;
if (!th) th = &(theme_default);
+ th->overlay_items = eina_list_free(th->overlay_items);
_elm_theme_file_item_del(&th->overlay, item);
elm_theme_flush(th);
}
@@ -601,6 +600,7 @@ elm_theme_overlay_mmap_add(Elm_Theme *th, const Eina_File *f)
Eina_File *file = eina_file_dup(f);
if (!th) th = &(theme_default);
+ th->overlay_items = eina_list_free(th->overlay_items);
_elm_theme_item_finalize(&th->overlay, eina_file_filename_get(file), file, EINA_TRUE, EINA_FALSE);
elm_theme_flush(th);
}
@@ -610,6 +610,7 @@ elm_theme_overlay_mmap_del(Elm_Theme *th, const Eina_File *f)
{
if (!f) return;
if (!th) th = &(theme_default);
+ th->overlay_items = eina_list_free(th->overlay_items);
_elm_theme_file_mmap_del(&th->overlay, f);
elm_theme_flush(th);
}
@@ -618,7 +619,14 @@ EAPI const Eina_List *
elm_theme_overlay_list_get(const Elm_Theme *th)
{
if (!th) th = &(theme_default);
- return th->overlay.items;
+ if (!th->overlay_items)
+ {
+ Elm_Theme_File *etf;
+
+ EINA_INLIST_FOREACH(th->overlay, etf)
+ ((Elm_Theme*)th)->overlay_items = eina_list_append(th->overlay_items, etf->item);
+ }
+ return th->overlay_items;
}
EAPI void
@@ -626,6 +634,7 @@ elm_theme_extension_add(Elm_Theme *th, const char *item)
{
if (!item) return;
if (!th) th = &(theme_default);
+ th->extension_items = eina_list_free(th->extension_items);
_elm_theme_file_item_add(&th->extension, item, EINA_FALSE, EINA_FALSE);
elm_theme_flush(th);
}
@@ -635,6 +644,7 @@ elm_theme_extension_del(Elm_Theme *th, const char *item)
{
if (!item) return;
if (!th) th = &(theme_default);
+ th->extension_items = eina_list_free(th->extension_items);
_elm_theme_file_item_del(&th->extension, item);
elm_theme_flush(th);
}
@@ -646,6 +656,7 @@ elm_theme_extension_mmap_add(Elm_Theme *th, const Eina_File *f)
if (!f) return;
if (!th) th = &(theme_default);
+ th->extension_items = eina_list_free(th->extension_items);
_elm_theme_item_finalize(&th->extension, eina_file_filename_get(file), file, EINA_FALSE, EINA_FALSE);
elm_theme_flush(th);
}
@@ -655,6 +666,7 @@ elm_theme_extension_mmap_del(Elm_Theme *th, const Eina_File *f)
{
if (!f) return;
if (!th) th = &(theme_default);
+ th->extension_items = eina_list_free(th->extension_items);
_elm_theme_file_mmap_del(&th->extension, f);
elm_theme_flush(th);
}
@@ -663,7 +675,14 @@ EAPI const Eina_List *
elm_theme_extension_list_get(const Elm_Theme *th)
{
if (!th) th = &(theme_default);
- return th->extension.items;
+ if (!th->extension_items)
+ {
+ Elm_Theme_File *etf;
+
+ EINA_INLIST_FOREACH(th->extension, etf)
+ ((Elm_Theme*)th)->extension_items = eina_list_append(th->extension_items, etf->item);
+ }
+ return th->extension_items;
}
EAPI void
@@ -684,12 +703,13 @@ elm_theme_get(Elm_Theme *th)
if (!th->theme)
{
Eina_Strbuf *buf;
- Eina_List *l;
+ Elm_Theme_File *etf;
const char *f;
buf = eina_strbuf_new();
- EINA_LIST_FOREACH(th->themes.items, l, f)
+ EINA_INLIST_FOREACH(th->themes, etf)
{
+ f = etf->item;
while (*f)
{
if (*f == ':')
@@ -698,7 +718,8 @@ elm_theme_get(Elm_Theme *th)
f++;
}
- if (l->next) eina_strbuf_append_char(buf, ':');
+ if (EINA_INLIST_GET(etf)->next)
+ eina_strbuf_append_char(buf, ':');
}
th->theme = eina_stringshare_add(eina_strbuf_string_get(buf));
eina_strbuf_free(buf);
@@ -710,7 +731,14 @@ EAPI const Eina_List *
elm_theme_list_get(const Elm_Theme *th)
{
if (!th) th = &(theme_default);
- return th->themes.items;
+ if (!th->theme_items)
+ {
+ Elm_Theme_File *etf;
+
+ EINA_INLIST_FOREACH(th->themes, etf)
+ ((Elm_Theme*)th)->theme_items = eina_list_append(th->theme_items, etf->item);
+ }
+ return th->theme_items;
}
EAPI char *
@@ -904,17 +932,17 @@ elm_theme_group_path_find(Elm_Theme *th, const char *group)
static Eina_List *
_elm_theme_file_group_base_list(Eina_List *list,
- Eina_List *handles,
+ Eina_Inlist *handles,
const char *base, int len)
{
Eina_Stringshare *c, *c2;
Eina_List *coll;
- Eina_List *in, *l, *ll;
- Eina_File *f;
+ Eina_List *in, *ll;
+ Elm_Theme_File *etf;
- EINA_LIST_FOREACH(handles, l, f)
+ EINA_INLIST_FOREACH(handles, etf)
{
- coll = edje_mmap_collection_list(f);
+ coll = edje_mmap_collection_list(etf->handle);
EINA_LIST_FOREACH(coll, ll, c)
{
// if base == start of collection str
@@ -948,11 +976,11 @@ elm_theme_group_base_list(Elm_Theme *th, const char *base)
// XXX: look results up in a hash for speed
len = strlen(base);
// go through all possible theme files and find collections that match
- list = _elm_theme_file_group_base_list(NULL, th->overlay.handles,
+ list = _elm_theme_file_group_base_list(NULL, th->overlay,
base, len);
- list = _elm_theme_file_group_base_list(list, th->themes.handles,
+ list = _elm_theme_file_group_base_list(list, th->themes,
base, len);
- list = _elm_theme_file_group_base_list(list, th->extension.handles,
+ list = _elm_theme_file_group_base_list(list, th->extension,
base, len);
// sort the list nicely at the end
diff --git a/src/lib/elementary/elm_thumb.c b/src/lib/elementary/elm_thumb.c
index 9819cc3ffe..2671772726 100644
--- a/src/lib/elementary/elm_thumb.c
+++ b/src/lib/elementary/elm_thumb.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#include <Elementary.h>
@@ -287,7 +287,7 @@ _thumb_finish(Elm_Thumb_Data *sd,
ELM_SAFE_FREE(sd->thumb.thumb_key, eina_stringshare_del);
ELM_SAFE_FREE(sd->view, evas_object_del);
- wd = efl_data_scope_get(sd->obj, ELM_WIDGET_CLASS);
+ wd = efl_data_scope_get(sd->obj, EFL_UI_WIDGET_CLASS);
edje_object_signal_emit(wd->resize_obj, EDJE_SIGNAL_LOAD_ERROR, "elm");
efl_event_callback_legacy_call(sd->obj, ELM_THUMB_EVENT_LOAD_ERROR, NULL);
}
@@ -454,12 +454,12 @@ _thumb_show(Elm_Thumb_Data *sd)
}
EOLIAN static void
-_elm_thumb_efl_gfx_visible_set(Eo *obj, Elm_Thumb_Data *sd, Eina_Bool vis)
+_elm_thumb_efl_gfx_entity_visible_set(Eo *obj, Elm_Thumb_Data *sd, Eina_Bool vis)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 0, vis))
return;
- efl_gfx_visible_set(efl_super(obj, MY_CLASS), vis);
+ efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), vis);
if (vis)
{
@@ -587,7 +587,7 @@ _elm_thumb_efl_object_constructor(Eo *obj, Elm_Thumb_Data *sd)
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, "Elm_Thumb");
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_IMAGE);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_IMAGE);
sd->obj = obj;
@@ -635,7 +635,7 @@ _elm_thumb_efl_file_file_set(Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd, const char
}
EOLIAN static void
-_elm_thumb_efl_file_file_get(Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd, const char **file, const char **key)
+_elm_thumb_efl_file_file_get(const Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd, const char **file, const char **key)
{
if (file)
*file = sd->file;
@@ -679,7 +679,7 @@ _elm_thumb_efl_ui_draggable_drag_target_set(Eo *obj, Elm_Thumb_Data *sd, Eina_Bo
}
EOLIAN static Eina_Bool
-_elm_thumb_efl_ui_draggable_drag_target_get(Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd)
+_elm_thumb_efl_ui_draggable_drag_target_get(const Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd)
{
return sd->edit;
}
diff --git a/src/lib/elementary/elm_thumb.eo b/src/lib/elementary/elm_thumb.eo
index a6f9820ded..3be7e43c92 100644
--- a/src/lib/elementary/elm_thumb.eo
+++ b/src/lib/elementary/elm_thumb.eo
@@ -1,5 +1,5 @@
-class Elm.Thumb (Efl.Ui.Layout, Efl.File, Efl.Ui.Clickable,
- Efl.Ui.Draggable)
+class Elm.Thumb (Efl.Ui.Layout.Object, Efl.File, Efl.Ui.Clickable,
+ Efl.Ui.Draggable, Efl.Ui.Legacy)
{
[[Elementary thumbnail class]]
legacy_prefix: elm_thumb;
@@ -9,14 +9,14 @@ class Elm.Thumb (Efl.Ui.Layout, Efl.File, Efl.Ui.Clickable,
class.constructor;
Efl.Object.constructor;
Efl.File.file { get; set; }
- Efl.Gfx.visible { set; }
+ Efl.Gfx.Entity.visible { set; }
Efl.Ui.Draggable.drag_target { get; set; }
}
events {
- generate,error; [[Called when an error occurred during thumbnail generation]]
- generate,start; [[Called when thumbnail generation started]]
- generate,stop; [[Called when thumbnail generation stopped]]
- load,error; [[Called when an error occurred during loading]]
- press; [[Called when pressed]]
+ generate,error: void; [[Called when an error occurred during thumbnail generation]]
+ generate,start: void; [[Called when thumbnail generation started]]
+ generate,stop: void; [[Called when thumbnail generation stopped]]
+ load,error: void; [[Called when an error occurred during loading]]
+ press: void; [[Called when pressed]]
}
}
diff --git a/src/lib/elementary/elm_toolbar.c b/src/lib/elementary/elm_toolbar.c
index aa86ec8e06..a543f7dbc1 100644
--- a/src/lib/elementary/elm_toolbar.c
+++ b/src/lib/elementary/elm_toolbar.c
@@ -3,7 +3,7 @@
#endif
#define EFL_UI_FOCUS_COMPOSITION_PROTECTED
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_SELECTION_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define ELM_WIDGET_ITEM_PROTECTED
@@ -83,7 +83,8 @@ _toolbar_item_prio_compare_cb(const void *i1,
}
static void
-_items_visibility_fix(Elm_Toolbar_Data *sd,
+_items_visibility_fix(Elm_Toolbar *obj,
+ Elm_Toolbar_Data *sd,
Evas_Coord *iw,
Evas_Coord vw,
Eina_Bool *more)
@@ -127,6 +128,8 @@ _items_visibility_fix(Elm_Toolbar_Data *sd,
it->prio.visible = (*iw <= vw);
it->in_box = sd->bx;
if (!it->separator) count++;
+ if (!it->prio.visible)
+ *more = EINA_TRUE;
}
else
{
@@ -139,6 +142,8 @@ _items_visibility_fix(Elm_Toolbar_Data *sd,
*more = EINA_TRUE;
}
}
+ efl_ui_focus_composition_dirty(obj);
+ efl_ui_focus_object_prepare_logical(obj);
}
static void
@@ -381,12 +386,12 @@ _resize_job(void *data)
if (!efl_ui_dir_is_horizontal(sd->dir, EINA_TRUE))
{
h = vh;
- _items_visibility_fix(sd, &ih, vh, &more);
+ _items_visibility_fix(obj, sd, &ih, vh, &more);
}
else
{
w = vw;
- _items_visibility_fix(sd, &iw, vw, &more);
+ _items_visibility_fix(obj, sd, &iw, vw, &more);
}
evas_object_geometry_get
(sd->VIEW(more_item), NULL, NULL, &more_w, &more_h);
@@ -462,12 +467,12 @@ _resize_job(void *data)
if (!efl_ui_dir_is_horizontal(sd->dir, EINA_TRUE))
{
h = vh;
- _items_visibility_fix(sd, &ih, vh, &more);
+ _items_visibility_fix(obj, sd, &ih, vh, &more);
}
else
{
w = vw;
- _items_visibility_fix(sd, &iw, vw, &more);
+ _items_visibility_fix(obj, sd, &iw, vw, &more);
}
evas_object_box_remove_all(sd->bx, EINA_FALSE);
if ((!efl_ui_dir_is_horizontal(sd->dir, EINA_TRUE) && (ih > vh)) ||
@@ -505,9 +510,9 @@ _resize_job(void *data)
w = (vw >= mw) ? vw : mw;
if (!efl_ui_dir_is_horizontal(sd->dir, EINA_TRUE))
- _items_visibility_fix(sd, &ih, vh, &more);
+ _items_visibility_fix(obj, sd, &ih, vh, &more);
else
- _items_visibility_fix(sd, &iw, vw, &more);
+ _items_visibility_fix(obj, sd, &iw, vw, &more);
evas_object_box_remove_all(sd->bx, EINA_FALSE);
evas_object_box_remove_all(sd->bx_more, EINA_FALSE);
@@ -746,13 +751,13 @@ _elm_toolbar_nearest_visible_item_get(Evas_Object *obj, Elm_Object_Item *eo_it)
}
EOLIAN static Eina_Bool
-_elm_toolbar_elm_widget_on_focus_update(Eo *obj, Elm_Toolbar_Data *sd, Elm_Object_Item *item EINA_UNUSED)
+_elm_toolbar_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Toolbar_Data *sd)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
Eina_Bool int_ret = EINA_FALSE;
Elm_Object_Item *eo_it = NULL;
- int_ret = efl_ui_widget_on_focus_update(efl_super(obj, MY_CLASS), NULL);
+ int_ret = efl_ui_focus_object_on_focus_update(efl_super(obj, MY_CLASS));
if (!int_ret) return EINA_FALSE;
if (!sd->items) return EINA_FALSE;
@@ -785,7 +790,7 @@ _elm_toolbar_elm_widget_on_focus_update(Eo *obj, Elm_Toolbar_Data *sd, Elm_Objec
}
EOLIAN static void
-_elm_toolbar_item_elm_widget_item_focus_set(Eo *eo_it, Elm_Toolbar_Item_Data *it, Eina_Bool focused)
+_elm_toolbar_item_elm_widget_item_item_focus_set(Eo *eo_it, Elm_Toolbar_Item_Data *it, Eina_Bool focused)
{
ELM_TOOLBAR_ITEM_CHECK(it);
Evas_Object *obj = WIDGET(it);
@@ -824,7 +829,7 @@ _elm_toolbar_item_elm_widget_item_focus_set(Eo *eo_it, Elm_Toolbar_Item_Data *it
}
EOLIAN static Eina_Bool
-_elm_toolbar_item_elm_widget_item_focus_get(Eo *eo_it, Elm_Toolbar_Item_Data *it)
+_elm_toolbar_item_elm_widget_item_item_focus_get(const Eo *eo_it, Elm_Toolbar_Item_Data *it)
{
ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
Evas_Object *obj = WIDGET(it);
@@ -952,7 +957,7 @@ _internal_elm_toolbar_icon_size_get(Evas_Object *obj)
(wd->resize_obj, "icon_size");
if (icon_size)
- return (int)(atoi(icon_size) * efl_gfx_scale_get(obj) * elm_config_scale_get()
+ return (int)(atoi(icon_size) * efl_gfx_entity_scale_get(obj) * elm_config_scale_get()
/ edje_object_base_scale_get(wd->resize_obj));
return _elm_config->icon_size;
@@ -1462,7 +1467,7 @@ _elm_toolbar_highlight_in_theme(Evas_Object *obj)
}
EOLIAN static Efl_Ui_Theme_Apply
-_elm_toolbar_elm_widget_theme_apply(Eo *obj, Elm_Toolbar_Data *sd)
+_elm_toolbar_efl_ui_widget_theme_apply(Eo *obj, Elm_Toolbar_Data *sd)
{
Elm_Toolbar_Item_Data *it;
double scale = 0;
@@ -1496,7 +1501,7 @@ _elm_toolbar_elm_widget_theme_apply(Eo *obj, Elm_Toolbar_Data *sd)
if (sd->priv_icon_size) sd->icon_size = sd->priv_icon_size;
else sd->icon_size = sd->theme_icon_size;
- scale = (efl_gfx_scale_get(obj) * elm_config_scale_get());
+ scale = (efl_gfx_entity_scale_get(obj) * elm_config_scale_get());
EINA_INLIST_FOREACH(sd->items, it)
_item_theme_hook(obj, it, scale, sd->icon_size);
@@ -1588,7 +1593,7 @@ _elm_toolbar_item_elm_widget_item_part_text_set(Eo *eo_item EINA_UNUSED, Elm_Too
}
EOLIAN static const char *
-_elm_toolbar_item_elm_widget_item_part_text_get(Eo *eo_it EINA_UNUSED, Elm_Toolbar_Item_Data *it,
+_elm_toolbar_item_elm_widget_item_part_text_get(const Eo *eo_it EINA_UNUSED, Elm_Toolbar_Item_Data *it,
const char *part)
{
char buf[256];
@@ -1624,12 +1629,12 @@ _elm_toolbar_item_elm_widget_item_part_content_set(Eo *eo_item EINA_UNUSED, Elm_
if (item->object)
elm_widget_sub_object_add(obj, item->object);
- scale = (efl_gfx_scale_get(obj) * elm_config_scale_get());
+ scale = (efl_gfx_entity_scale_get(obj) * elm_config_scale_get());
_item_theme_hook(obj, item, scale, sd->icon_size);
}
EOLIAN static Evas_Object *
-_elm_toolbar_item_elm_widget_item_part_content_get(Eo *eo_it EINA_UNUSED, Elm_Toolbar_Item_Data *it,
+_elm_toolbar_item_elm_widget_item_part_content_get(const Eo *eo_it EINA_UNUSED, Elm_Toolbar_Item_Data *it,
const char *part)
{
if (part && strcmp(part, "object") && strcmp(part, "elm.swallow.object"))
@@ -1658,7 +1663,7 @@ _elm_toolbar_item_elm_widget_item_part_content_unset(Eo *eo_item EINA_UNUSED, El
_elm_widget_sub_object_redirect_to_top(obj, item->object);
o = item->object;
item->object = NULL;
- scale = (efl_gfx_scale_get(obj) * elm_config_scale_get());
+ scale = (efl_gfx_entity_scale_get(obj) * elm_config_scale_get());
_item_theme_hook(obj, item, scale, sd->icon_size);
return o;
@@ -2283,7 +2288,7 @@ _access_state_cb(void *data, Evas_Object *obj EINA_UNUSED)
}
EOLIAN static void
-_elm_toolbar_item_efl_object_destructor(Eo *eo_item, Elm_Toolbar_Item_Data *item)
+_elm_toolbar_item_efl_object_invalidate(Eo *eo_item, Elm_Toolbar_Item_Data *item)
{
Elm_Toolbar_Item_Data *next = NULL;
Evas_Object *obj;
@@ -2311,8 +2316,10 @@ _elm_toolbar_item_efl_object_destructor(Eo *eo_item, Elm_Toolbar_Item_Data *item
if (item != sd->more_item)
efl_ui_widget_theme_apply(obj);
+ else
+ sd->more_item = NULL;
- efl_destructor(efl_super(eo_item, ELM_TOOLBAR_ITEM_CLASS));
+ efl_invalidate(efl_super(eo_item, ELM_TOOLBAR_ITEM_CLASS));
}
static void
@@ -2351,7 +2358,7 @@ _access_widget_item_register(Elm_Toolbar_Item_Data *it)
}
EOLIAN static Eina_Rect
-_elm_toolbar_item_efl_ui_focus_object_focus_geometry_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Item_Data *pd)
+_elm_toolbar_item_efl_ui_focus_object_focus_geometry_get(const Eo *obj EINA_UNUSED, Elm_Toolbar_Item_Data *pd)
{
Eina_Rect rect;
@@ -2365,7 +2372,7 @@ _elm_toolbar_item_efl_object_constructor(Eo *eo_it, Elm_Toolbar_Item_Data *it)
{
eo_it = efl_constructor(efl_super(eo_it, ELM_TOOLBAR_ITEM_CLASS));
it->base = efl_data_scope_get(eo_it, ELM_WIDGET_ITEM_CLASS);
- efl_access_role_set(eo_it, EFL_ACCESS_ROLE_MENU_ITEM);
+ efl_access_object_role_set(eo_it, EFL_ACCESS_ROLE_MENU_ITEM);
return eo_it;
}
@@ -2395,15 +2402,13 @@ _item_new(Evas_Object *obj,
it->object = NULL;
WIDGET_ITEM_DATA_SET(EO_OBJ(it), data);
- VIEW(it) = elm_layout_add(obj);
+ VIEW_SET(it, elm_layout_add(obj));
elm_widget_tree_unfocusable_set(VIEW(it), EINA_TRUE);
evas_object_data_set(VIEW(it), "item", it);
- efl_access_type_set(VIEW(it), EFL_ACCESS_TYPE_DISABLED);
+ efl_access_object_access_type_set(VIEW(it), EFL_ACCESS_TYPE_DISABLED);
icon_obj = elm_icon_add(VIEW(it));
-
- if (_elm_config->atspi_mode)
- if (icon_obj) efl_access_parent_set(icon_obj, eo_it);
+ efl_parent_set(icon_obj, eo_it);
if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
_access_widget_item_register(it);
@@ -2466,6 +2471,8 @@ _item_new(Evas_Object *obj,
edje_object_message_signal_process(elm_layout_edje_get(VIEW(it)));
+ efl_ui_focus_composition_dirty(obj);
+
evas_object_event_callback_add
(VIEW(it), EVAS_CALLBACK_RESIZE, _item_resize, obj);
if ((!sd->items) && (sd->select_mode == ELM_OBJECT_SELECT_MODE_ALWAYS))
@@ -2786,7 +2793,7 @@ _elm_toolbar_efl_canvas_group_group_add(Eo *obj, Elm_Toolbar_Data *priv)
else
elm_object_signal_emit(priv->more, "elm,orient,horizontal", "elm");
- efl_access_type_set(priv->more, EFL_ACCESS_TYPE_DISABLED);
+ efl_access_object_access_type_set(priv->more, EFL_ACCESS_TYPE_DISABLED);
elm_widget_sub_object_add(obj, priv->more);
evas_object_show(priv->more);
@@ -2830,33 +2837,33 @@ _elm_toolbar_efl_canvas_group_group_del(Eo *obj, Elm_Toolbar_Data *sd)
while (it)
{
next = ELM_TOOLBAR_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
- elm_wdg_item_del(EO_OBJ(it));
+ efl_del(EO_OBJ(it));
it = next;
}
- if (sd->more_item) elm_wdg_item_del(EO_OBJ(sd->more_item));
+ if (sd->more_item) efl_del(EO_OBJ(sd->more_item));
ecore_timer_del(sd->long_timer);
efl_canvas_group_del(efl_super(obj, MY_CLASS));
}
EOLIAN static void
-_elm_toolbar_efl_gfx_position_set(Eo *obj, Elm_Toolbar_Data *sd, Eina_Position2D pos)
+_elm_toolbar_efl_gfx_entity_position_set(Eo *obj, Elm_Toolbar_Data *sd, Eina_Position2D pos)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
- efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
- efl_gfx_position_set(sd->hit_rect, pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
+ efl_gfx_entity_position_set(sd->hit_rect, pos);
}
EOLIAN static void
-_elm_toolbar_efl_gfx_size_set(Eo *obj, Elm_Toolbar_Data *sd, Eina_Size2D sz)
+_elm_toolbar_efl_gfx_entity_size_set(Eo *obj, Elm_Toolbar_Data *sd, Eina_Size2D sz)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
- efl_gfx_size_set(efl_super(obj, MY_CLASS), sz);
- efl_gfx_size_set(sd->hit_rect, sz);
+ efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
+ efl_gfx_entity_size_set(sd->hit_rect, sz);
}
EOLIAN static void
@@ -2883,7 +2890,7 @@ _access_obj_process(Elm_Toolbar_Data * sd, Eina_Bool is_access)
}
EOLIAN static void
-_elm_toolbar_elm_widget_on_access_update(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd, Eina_Bool acs)
+_elm_toolbar_efl_ui_widget_on_access_update(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd, Eina_Bool acs)
{
_elm_toolbar_smart_focus_next_enable = acs;
_access_obj_process(sd, _elm_toolbar_smart_focus_next_enable);
@@ -2929,7 +2936,7 @@ _elm_toolbar_item_efl_ui_focus_object_focus_set(Eo *obj, Elm_Toolbar_Item_Data *
}
EOLIAN static Eina_Rect
-_elm_toolbar_elm_widget_focus_highlight_geometry_get(Eo *obj, Elm_Toolbar_Data *sd)
+_elm_toolbar_efl_ui_widget_focus_highlight_geometry_get(const Eo *obj, Elm_Toolbar_Data *sd)
{
Eina_Rect r = {};
@@ -2953,7 +2960,7 @@ elm_toolbar_add(Evas_Object *parent)
}
EOLIAN static Eina_Bool
-_elm_toolbar_elm_widget_focus_state_apply(Eo *obj, Elm_Toolbar_Data *pd EINA_UNUSED, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Elm_Widget *redirect EINA_UNUSED)
+_elm_toolbar_efl_ui_widget_focus_state_apply(Eo *obj, Elm_Toolbar_Data *pd EINA_UNUSED, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Efl_Ui_Widget *redirect EINA_UNUSED)
{
configured_state->logical = EINA_TRUE;
return efl_ui_widget_focus_state_apply(efl_super(obj, MY_CLASS), current_state, configured_state, obj);
@@ -2965,7 +2972,7 @@ _elm_toolbar_efl_object_constructor(Eo *obj, Elm_Toolbar_Data *_pd EINA_UNUSED)
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_TOOL_BAR);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_TOOL_BAR);
efl_ui_focus_composition_custom_manager_set(obj, obj);
@@ -2985,7 +2992,7 @@ _elm_toolbar_icon_size_set(Eo *obj, Elm_Toolbar_Data *sd, int icon_size)
}
EOLIAN static int
-_elm_toolbar_icon_size_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
+_elm_toolbar_icon_size_get(const Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
{
return sd->priv_icon_size;
}
@@ -2999,7 +3006,7 @@ _elm_toolbar_item_append(Eo *obj, Elm_Toolbar_Data *sd, const char *icon, const
it = _item_new(obj, icon, label, func, data);
if (!it) return NULL;
- scale = (efl_gfx_scale_get(obj) * elm_config_scale_get());
+ scale = (efl_gfx_entity_scale_get(obj) * elm_config_scale_get());
prev_list = evas_object_box_children_get(sd->bx);
@@ -3025,7 +3032,7 @@ _elm_toolbar_item_prepend(Eo *obj, Elm_Toolbar_Data *sd, const char *icon, const
it = _item_new(obj, icon, label, func, data);
if (!it) return NULL;
- scale = (efl_gfx_scale_get(obj) * elm_config_scale_get());
+ scale = (efl_gfx_entity_scale_get(obj) * elm_config_scale_get());
prev_list = evas_object_box_children_get(sd->bx);
@@ -3054,7 +3061,7 @@ _elm_toolbar_item_insert_before(Eo *obj, Elm_Toolbar_Data *sd, Elm_Object_Item *
it = _item_new(obj, icon, label, func, data);
if (!it) return NULL;
- scale = (efl_gfx_scale_get(obj) * elm_config_scale_get());
+ scale = (efl_gfx_entity_scale_get(obj) * elm_config_scale_get());
prev_list = evas_object_box_children_get(sd->bx);
@@ -3083,7 +3090,7 @@ _elm_toolbar_item_insert_after(Eo *obj, Elm_Toolbar_Data *sd, Elm_Object_Item *e
it = _item_new(obj, icon, label, func, data);
if (!it) return NULL;
- scale = (efl_gfx_scale_get(obj) * elm_config_scale_get());
+ scale = (efl_gfx_entity_scale_get(obj) * elm_config_scale_get());
prev_list = evas_object_box_children_get(sd->bx);
@@ -3100,7 +3107,7 @@ _elm_toolbar_item_insert_after(Eo *obj, Elm_Toolbar_Data *sd, Elm_Object_Item *e
}
EOLIAN static Elm_Object_Item*
-_elm_toolbar_efl_ui_menu_first_item_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
+_elm_toolbar_first_item_get(const Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
{
if (!sd->items) return NULL;
Elm_Toolbar_Item_Data *it = ELM_TOOLBAR_ITEM_FROM_INLIST(sd->items);
@@ -3109,7 +3116,7 @@ _elm_toolbar_efl_ui_menu_first_item_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *s
}
EOLIAN static Elm_Object_Item*
-_elm_toolbar_efl_ui_menu_last_item_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
+_elm_toolbar_last_item_get(const Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
{
if (!sd->items) return NULL;
@@ -3119,13 +3126,13 @@ _elm_toolbar_efl_ui_menu_last_item_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd
}
EOLIAN static Eina_Iterator*
-_elm_toolbar_efl_ui_menu_items_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
+_elm_toolbar_items_get(const Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
{
return eina_inlist_iterator_new(sd->items);
}
EOLIAN static Elm_Object_Item *
-_elm_toolbar_item_efl_ui_item_next_get(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *it)
+_elm_toolbar_item_next_get(const Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *it)
{
ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, NULL);
@@ -3136,7 +3143,7 @@ _elm_toolbar_item_efl_ui_item_next_get(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item
}
EOLIAN static Elm_Object_Item *
-_elm_toolbar_item_efl_ui_item_prev_get(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *it)
+_elm_toolbar_item_prev_get(const Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *it)
{
ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, NULL);
@@ -3155,7 +3162,7 @@ _elm_toolbar_item_priority_set(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *i
}
EOLIAN static int
-_elm_toolbar_item_priority_get(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item)
+_elm_toolbar_item_priority_get(const Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item)
{
return item->prio.priority;
}
@@ -3174,7 +3181,7 @@ _elm_toolbar_item_find_by_label(const Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd,
}
EOLIAN static void
-_elm_toolbar_item_efl_ui_item_selected_set(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item, Eina_Bool selected)
+_elm_toolbar_item_selected_set(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item, Eina_Bool selected)
{
if (item->selected == selected) return;
if (selected) _item_select(item);
@@ -3182,19 +3189,19 @@ _elm_toolbar_item_efl_ui_item_selected_set(Eo *eo_item EINA_UNUSED, Elm_Toolbar_
}
EOLIAN static Eina_Bool
-_elm_toolbar_item_efl_ui_item_selected_get(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item)
+_elm_toolbar_item_selected_get(const Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item)
{
return item->selected;
}
EOLIAN static Elm_Object_Item*
-_elm_toolbar_efl_ui_menu_selected_item_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
+_elm_toolbar_selected_item_get(const Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
{
return sd->selected_item;
}
EOLIAN static Elm_Object_Item*
-_elm_toolbar_more_item_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
+_elm_toolbar_more_item_get(const Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
{
return EO_OBJ(sd->more_item);
}
@@ -3226,7 +3233,7 @@ _elm_toolbar_item_icon_set(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item,
}
EOLIAN static const char *
-_elm_toolbar_item_icon_get(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *it)
+_elm_toolbar_item_icon_get(const Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *it)
{
ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, NULL);
@@ -3234,7 +3241,7 @@ _elm_toolbar_item_icon_get(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *it)
}
EOLIAN static Evas_Object *
-_elm_toolbar_item_object_get(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item)
+_elm_toolbar_item_object_get(const Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item)
{
ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(item, NULL);
@@ -3242,7 +3249,7 @@ _elm_toolbar_item_object_get(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *ite
}
EOLIAN static Evas_Object *
-_elm_toolbar_item_icon_object_get(Eo *eo_it EINA_UNUSED, Elm_Toolbar_Item_Data *it)
+_elm_toolbar_item_icon_object_get(const Eo *eo_it EINA_UNUSED, Elm_Toolbar_Item_Data *it)
{
ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, NULL);
@@ -3329,7 +3336,7 @@ _elm_toolbar_item_separator_set(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *
if (item->separator == separator) return;
item->separator = separator;
- scale = (efl_gfx_scale_get(obj) * elm_config_scale_get());
+ scale = (efl_gfx_entity_scale_get(obj) * elm_config_scale_get());
_item_theme_hook(obj, item, scale, sd->icon_size);
evas_object_size_hint_min_set(VIEW(item), -1, -1);
if (separator) sd->separator_count++;
@@ -3337,7 +3344,7 @@ _elm_toolbar_item_separator_set(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *
}
EOLIAN static Eina_Bool
-_elm_toolbar_item_separator_get(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *it)
+_elm_toolbar_item_separator_get(const Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *it)
{
ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
@@ -3356,11 +3363,7 @@ _elm_toolbar_shrink_mode_set(Eo *obj, Elm_Toolbar_Data *sd, Elm_Toolbar_Shrink_M
(shrink_mode == ELM_TOOLBAR_SHRINK_SCROLL);
elm_interface_scrollable_bounce_allow_set(obj, bounce, EINA_FALSE);
- if (sd->more_item)
- {
- elm_wdg_item_del(EO_OBJ(sd->more_item));
- sd->more_item = NULL;
- }
+ if (sd->more_item) efl_del(EO_OBJ(sd->more_item));
if (shrink_mode == ELM_TOOLBAR_SHRINK_MENU)
{
@@ -3401,7 +3404,7 @@ _elm_toolbar_shrink_mode_set(Eo *obj, Elm_Toolbar_Data *sd, Elm_Toolbar_Shrink_M
}
EOLIAN static Elm_Toolbar_Shrink_Mode
-_elm_toolbar_shrink_mode_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
+_elm_toolbar_shrink_mode_get(const Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
{
return sd->shrink_mode;
}
@@ -3427,48 +3430,6 @@ elm_toolbar_transverse_expanded_get(const Evas_Object *obj)
return sd->transverse_expanded;
}
-EAPI Elm_Widget_Item *
-elm_toolbar_selected_item_get(const Evas_Object *obj)
-{
- return efl_ui_menu_selected_item_get(obj);
-}
-
-EAPI Elm_Widget_Item *
-elm_toolbar_first_item_get(const Evas_Object *obj)
-{
- return efl_ui_menu_first_item_get(obj);
-}
-
-EAPI Elm_Widget_Item *
-elm_toolbar_last_item_get(const Evas_Object *obj)
-{
- return efl_ui_menu_last_item_get(obj);
-}
-
-EAPI void
-elm_toolbar_item_selected_set(Evas_Object *obj, Eina_Bool selected)
-{
- efl_ui_item_selected_set(obj, selected);
-}
-
-EAPI Eina_Bool
-elm_toolbar_item_selected_get(const Evas_Object *obj)
-{
- return efl_ui_item_selected_get(obj);
-}
-
-EAPI Elm_Widget_Item *
-elm_toolbar_item_prev_get(const Evas_Object *obj)
-{
- return efl_ui_item_prev_get(obj);
-}
-
-EAPI Elm_Widget_Item *
-elm_toolbar_item_next_get(const Evas_Object *obj)
-{
- return efl_ui_item_next_get(obj);
-}
-
EOLIAN static void
_elm_toolbar_homogeneous_set(Eo *obj, Elm_Toolbar_Data *sd, Eina_Bool homogeneous)
{
@@ -3480,7 +3441,7 @@ _elm_toolbar_homogeneous_set(Eo *obj, Elm_Toolbar_Data *sd, Eina_Bool homogeneou
}
EOLIAN static Eina_Bool
-_elm_toolbar_homogeneous_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
+_elm_toolbar_homogeneous_get(const Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
{
return sd->homogeneous;
}
@@ -3503,7 +3464,7 @@ _elm_toolbar_menu_parent_set(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd, Evas_Obj
}
EOLIAN static Evas_Object*
-_elm_toolbar_menu_parent_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
+_elm_toolbar_menu_parent_get(const Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
{
return sd->menu_parent;
}
@@ -3525,7 +3486,7 @@ _elm_toolbar_align_set(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd, double align)
}
EOLIAN static double
-_elm_toolbar_align_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
+_elm_toolbar_align_get(const Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
{
return sd->align;
}
@@ -3543,7 +3504,7 @@ _elm_toolbar_item_menu_set(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item,
}
EOLIAN static Evas_Object *
-_elm_toolbar_item_menu_get(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item)
+_elm_toolbar_item_menu_get(const Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item)
{
ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(item, NULL);
@@ -3699,7 +3660,7 @@ elm_toolbar_item_state_unset(Elm_Object_Item *it)
}
EOLIAN static Elm_Toolbar_Item_State *
-_elm_toolbar_item_state_get(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item)
+_elm_toolbar_item_state_get(const Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item)
{
ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(item, NULL);
@@ -3759,7 +3720,7 @@ _elm_toolbar_efl_ui_direction_direction_set(Eo *obj, Elm_Toolbar_Data *sd, Efl_U
}
EOLIAN static Efl_Ui_Dir
-_elm_toolbar_efl_ui_direction_direction_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
+_elm_toolbar_efl_ui_direction_direction_get(const Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
{
return sd->dir;
}
@@ -3800,7 +3761,7 @@ _elm_toolbar_standard_priority_set(Eo *obj, Elm_Toolbar_Data *sd, int priority)
}
EOLIAN static int
-_elm_toolbar_standard_priority_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
+_elm_toolbar_standard_priority_get(const Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
{
return sd->standard_priority;
}
@@ -3822,7 +3783,7 @@ _elm_toolbar_select_mode_set(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd, Elm_Obje
}
EOLIAN static Elm_Object_Select_Mode
-_elm_toolbar_select_mode_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
+_elm_toolbar_select_mode_get(const Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
{
return sd->select_mode;
}
@@ -3873,23 +3834,23 @@ _elm_toolbar_item_bring_in(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item,
}
EOLIAN static const char*
-_elm_toolbar_item_efl_access_name_get(Eo *eo_item, Elm_Toolbar_Item_Data *item)
+_elm_toolbar_item_efl_access_object_i18n_name_get(const Eo *eo_item, Elm_Toolbar_Item_Data *item)
{
const char *ret;
- ret = efl_access_name_get(efl_super(eo_item, ELM_TOOLBAR_ITEM_CLASS));
+ ret = efl_access_object_i18n_name_get(efl_super(eo_item, ELM_TOOLBAR_ITEM_CLASS));
if (ret) return ret;
return _elm_widget_item_accessible_plain_name_get(eo_item, item->label);
}
EOLIAN static Efl_Access_State_Set
-_elm_toolbar_item_efl_access_state_set_get(Eo *eo_it, Elm_Toolbar_Item_Data *item EINA_UNUSED)
+_elm_toolbar_item_efl_access_object_state_set_get(const Eo *eo_it, Elm_Toolbar_Item_Data *item EINA_UNUSED)
{
Efl_Access_State_Set ret;
Eina_Bool sel;
- ret = efl_access_state_set_get(efl_super(eo_it, ELM_TOOLBAR_ITEM_CLASS));
+ ret = efl_access_object_state_set_get(efl_super(eo_it, ELM_TOOLBAR_ITEM_CLASS));
- sel = efl_ui_item_selected_get(eo_it);
+ sel = elm_toolbar_item_selected_get(eo_it);
STATE_TYPE_SET(ret, EFL_ACCESS_STATE_SELECTABLE);
@@ -3900,7 +3861,7 @@ _elm_toolbar_item_efl_access_state_set_get(Eo *eo_it, Elm_Toolbar_Item_Data *ite
}
EOLIAN static Elm_Object_Item *
-_elm_toolbar_elm_widget_focused_item_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
+_elm_toolbar_efl_ui_widget_focused_item_get(const Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
{
return sd->focused_item;
}
@@ -3912,7 +3873,7 @@ _elm_toolbar_class_constructor(Efl_Class *klass)
}
EOLIAN static const Efl_Access_Action_Data*
-_elm_toolbar_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd EINA_UNUSED)
+_elm_toolbar_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd EINA_UNUSED)
{
static Efl_Access_Action_Data atspi_actions[] = {
{ "select", "select", NULL, _key_action_select},
@@ -3922,11 +3883,11 @@ _elm_toolbar_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_T
}
EOLIAN static Eina_List*
-_elm_toolbar_efl_access_children_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
+_elm_toolbar_efl_access_object_access_children_get(const Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
{
Eina_List *ret = NULL, *ret2 = NULL;
Elm_Toolbar_Item_Data *it;
- ret2 = efl_access_children_get(efl_super(obj, ELM_TOOLBAR_CLASS));
+ ret2 = efl_access_object_access_children_get(efl_super(obj, ELM_TOOLBAR_CLASS));
EINA_INLIST_FOREACH(sd->items, it)
ret = eina_list_append(ret, EO_OBJ(it));
@@ -3935,19 +3896,19 @@ _elm_toolbar_efl_access_children_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
}
EOLIAN static Efl_Access_State_Set
-_elm_toolbar_efl_access_state_set_get(Eo *obj, Elm_Toolbar_Data *sd EINA_UNUSED)
+_elm_toolbar_efl_access_object_state_set_get(const Eo *obj, Elm_Toolbar_Data *sd EINA_UNUSED)
{
- return efl_access_state_set_get(efl_super(obj, ELM_TOOLBAR_CLASS));
+ return efl_access_object_state_set_get(efl_super(obj, ELM_TOOLBAR_CLASS));
}
EOLIAN int
-_elm_toolbar_efl_access_selection_selected_children_count_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *pd)
+_elm_toolbar_efl_access_selection_selected_children_count_get(const Eo *obj EINA_UNUSED, Elm_Toolbar_Data *pd)
{
return pd->selected_item ? 1 : 0;
}
EOLIAN Eo*
-_elm_toolbar_efl_access_selection_selected_child_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *pd, int child_idx)
+_elm_toolbar_efl_access_selection_selected_child_get(const Eo *obj EINA_UNUSED, Elm_Toolbar_Data *pd, int child_idx)
{
if (child_idx != 0)
return NULL;
@@ -4006,7 +3967,7 @@ _elm_toolbar_efl_access_selection_all_children_select(Eo *obj EINA_UNUSED, Elm_T
}
EOLIAN Eina_Bool
-_elm_toolbar_efl_access_selection_clear(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *pd)
+_elm_toolbar_efl_access_selection_access_selection_clear(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *pd)
{
if (pd->selected_item)
elm_toolbar_item_selected_set(pd->selected_item, EINA_FALSE);
@@ -4053,13 +4014,19 @@ elm_toolbar_icon_order_lookup_get(const Evas_Object *obj EINA_UNUSED)
}
static Eina_Bool
+_more_item_is_present(Elm_Toolbar_Data *pd)
+{
+ return pd->shrink_mode == ELM_TOOLBAR_SHRINK_MENU || pd->shrink_mode == ELM_TOOLBAR_SHRINK_EXPAND;
+}
+
+static Eina_Bool
_part_of_chain(Elm_Toolbar_Item_Data *pd)
{
Eina_Bool want = EINA_TRUE;
if (elm_wdg_item_disabled_get(pd->base->eo_obj))
want = EINA_FALSE;
- if (!evas_object_visible_get(VIEW(pd)))
+ if (!pd->prio.visible)
want = EINA_FALSE;
if (pd->separator)
@@ -4073,14 +4040,17 @@ _elm_toolbar_efl_ui_focus_composition_prepare(Eo *obj, Elm_Toolbar_Data *pd)
{
Elm_Toolbar_Item_Data *it;
Eina_List *order = NULL;
+ Eina_Bool require_more_items = EINA_FALSE;
EINA_INLIST_FOREACH(pd->items, it)
{
if (_part_of_chain(it))
order = eina_list_append(order, EO_OBJ(it));
+ if (_more_item_is_present(pd) && !it->prio.visible)
+ require_more_items = EINA_TRUE;
}
- if (pd->more_item)
+ if (require_more_items)
{
if (_part_of_chain(pd->more_item))
order = eina_list_append(order, EO_OBJ(pd->more_item));
diff --git a/src/lib/elementary/elm_toolbar.eo b/src/lib/elementary/elm_toolbar.eo
index 3198d61d02..4bc7d1661d 100644
--- a/src/lib/elementary/elm_toolbar.eo
+++ b/src/lib/elementary/elm_toolbar.eo
@@ -1,6 +1,6 @@
import elm_general;
-enum Elm.Toolbar.Shrink_Mode
+enum Elm.Toolbar_Shrink_Mode
{
[[Set toolbar's items display behavior, it can be scrollable,
show a menu with exceeding items, or simply hide them.
@@ -23,15 +23,45 @@ enum Elm.Toolbar.Shrink_Mode
last [[Indicates error if returned by elm_toolbar_shrink_mode_get()]]
}
-class Elm.Toolbar (Elm.Widget, Efl.Ui.Focus.Composition, Elm.Interface_Scrollable, Efl.Ui.Direction,
- Efl.Access.Widget.Action, Efl.Access.Selection,
- Efl.Ui.Clickable, Efl.Ui.Selectable, Efl.Ui.Menu)
+class Elm.Toolbar (Efl.Ui.Widget, Efl.Ui.Focus.Composition, Elm.Interface_Scrollable, Efl.Ui.Direction,
+ Efl.Access.Widget.Action, Efl.Access.Selection, Efl.Access.Object,
+ Efl.Ui.Clickable, Efl.Ui.Selectable, Efl.Ui.Legacy)
{
[[Elementary toolbar class]]
legacy_prefix: elm_toolbar;
eo_prefix: elm_obj_toolbar;
event_prefix: elm_toolbar;
methods {
+ @property selected_item {
+ get {
+ [[Get the selected item in the widget.]]
+ }
+ values {
+ item: Elm.Widget.Item; [[The selected item or $null.]]
+ }
+ }
+ @property first_item {
+ get {
+ [[Get the first item in the widget.]]
+ }
+ values {
+ item: Elm.Widget.Item; [[The first item or $null.]]
+ }
+ }
+ @property last_item {
+ get {
+ [[Get the last item in the widget.]]
+ }
+ values {
+ item: Elm.Widget.Item; [[The last item or $null.]]
+ }
+ }
+ @property items {
+ get {
+ [[Returns a list of the widget item.]]
+ return: iterator<Elm.Widget.Item> @owned @warn_unused; [[iterator to widget items]]
+ }
+ }
@property homogeneous {
[[Control homogeneous mode.
@@ -118,7 +148,7 @@ class Elm.Toolbar (Elm.Widget, Efl.Ui.Focus.Composition, Elm.Interface_Scrollabl
get {
}
values {
- shrink_mode: Elm.Toolbar.Shrink_Mode; [[Toolbar's items display behavior]]
+ shrink_mode: Elm.Toolbar_Shrink_Mode; [[Toolbar's items display behavior]]
}
}
@property menu_parent {
@@ -316,22 +346,22 @@ class Elm.Toolbar (Elm.Widget, Efl.Ui.Focus.Composition, Elm.Interface_Scrollabl
implements {
class.constructor;
Efl.Object.constructor;
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set; }
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
Efl.Canvas.Group.group_calculate;
Efl.Canvas.Group.group_member_add;
- Elm.Widget.on_access_update;
- Elm.Widget.theme_apply;
- Elm.Widget.on_focus_update;
+ Efl.Ui.Widget.on_access_update;
+ Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Focus.Object.on_focus_update;
Efl.Ui.Translatable.translation_update;
- Elm.Widget.widget_event;
- Elm.Widget.focus_highlight_geometry { get; }
- Elm.Widget.focused_item { get; }
+ Efl.Ui.Widget.widget_event;
+ Efl.Ui.Widget.focus_highlight_geometry { get; }
+ Efl.Ui.Widget.focused_item { get; }
Efl.Ui.Direction.direction { get; set; [[Only supports $vertical and $horizontal. Default is $horizontal.]] }
- Elm.Widget.focus_state_apply;
+ Efl.Ui.Widget.focus_state_apply;
Efl.Access.Widget.Action.elm_actions { get; }
- Efl.Access.children { get; }
- Efl.Access.state_set { get; }
+ Efl.Access.Object.access_children { get; }
+ Efl.Access.Object.state_set { get; }
Efl.Access.Selection.selected_children_count { get; }
Efl.Access.Selection.selected_child { get; }
Efl.Access.Selection.selected_child_deselect;
@@ -339,15 +369,11 @@ class Elm.Toolbar (Elm.Widget, Efl.Ui.Focus.Composition, Elm.Interface_Scrollabl
Efl.Access.Selection.child_deselect;
Efl.Access.Selection.is_child_selected;
Efl.Access.Selection.all_children_select;
- Efl.Access.Selection.clear;
- Efl.Ui.Menu.selected_item { get; }
- Efl.Ui.Menu.first_item { get; }
- Efl.Ui.Menu.last_item { get; }
- Efl.Ui.Menu.items { get; }
+ Efl.Access.Selection.access_selection_clear;
Efl.Ui.Focus.Composition.prepare;
}
events {
- item,focused; [[Called when toolbar item got focus]]
- item,unfocused; [[Called when toolbar item lost focus]]
+ item,focused: Efl.Object; [[Called when toolbar item got focus]]
+ item,unfocused: Efl.Object; [[Called when toolbar item lost focus]]
}
}
diff --git a/src/lib/elementary/elm_toolbar_item.eo b/src/lib/elementary/elm_toolbar_item.eo
index a9af54ee0d..b5c8ec7aa9 100644
--- a/src/lib/elementary/elm_toolbar_item.eo
+++ b/src/lib/elementary/elm_toolbar_item.eo
@@ -1,4 +1,4 @@
-enum Elm.Toolbar.Item.Scrollto_Type
+enum Elm.Toolbar_Item_Scrollto_Type
{
[[Defines where to position the item in the toolbar.]]
legacy: elm_toolbar_item_scrollto;
@@ -10,7 +10,7 @@ enum Elm.Toolbar.Item.Scrollto_Type
last = (1 << 3) [[to the last of viewport]]
}
-struct Elm.Toolbar.Item.State
+struct Elm.Toolbar_Item_State
{
[[
State of a Elm_Toolbar_Item.
@@ -23,12 +23,60 @@ struct Elm.Toolbar.Item.State
data: const(void_ptr); [[Item data]]
}
-class Elm.Toolbar.Item(Elm.Widget.Item, Efl.Ui.Item, Efl.Ui.Focus.Object)
+class Elm.Toolbar_Item(Elm.Widget.Item, Efl.Ui.Focus.Object, Efl.Ui.Legacy)
{
[[Elementary toolbar item class]]
legacy_prefix: elm_toolbar_item;
eo_prefix: elm_obj_toolbar_item;
methods {
+ @property prev {
+ get {
+ [[Get the item before this one in the widget's list of items.
+
+ See also @.next.
+ ]]
+ }
+ values {
+ item: Elm.Widget.Item; [[The item before the object in its parent's
+ list. If there is no previous item or in case
+ of error, $null is returned.]]
+ }
+ }
+ @property next {
+ get {
+ [[Get the item after this one in the widget's list of items.
+
+ See also @.prev.
+ ]]
+ }
+ values {
+ item: Elm.Widget.Item; [[The item after the object in its parent's
+ list. If there is no next item or in case
+ of error, $null is returned.]]
+ }
+ }
+ @property selected {
+ [[Indicates whether this item is currently selected.]]
+ get {
+ [[Get the selected state of this item.]]
+ }
+ set {
+ [[Set the selected state of $item.
+
+ This sets the selected state of the given item $it.
+ $true for selected, $false for not selected.
+
+ If a new item is selected the previously selected will
+ be unselected. Previously selected item can be retrieved
+ with @Elm.Toolbar.selected_item.get.
+
+ Selected items will be highlighted.
+ ]]
+ }
+ values {
+ selected: bool; [[The selection state.]]
+ }
+ }
@property priority {
get {
[[Get the priority of a toolbar item.]]
@@ -135,7 +183,7 @@ class Elm.Toolbar.Item(Elm.Widget.Item, Efl.Ui.Item, Efl.Ui.Focus.Object)
return: bool; [[$true on success, $false otherwise]]
}
values {
- state: ptr(Elm.Toolbar.Item.State) @nullable; [[Item state]]
+ state: ptr(Elm.Toolbar_Item_State) @nullable; [[Item state]]
}
}
/* init { FIXME
@@ -187,12 +235,12 @@ class Elm.Toolbar.Item(Elm.Widget.Item, Efl.Ui.Item, Efl.Ui.Focus.Object)
@in func: Evas_Smart_Cb @optional; [[The function to call when the item is clicked when this state is selected.]]
@in data: const(void_ptr) @optional; [[The data to associate with the state.]]
}
- return: ptr(Elm.Toolbar.Item.State); [[The toolbar item state, or $null upon failure.]]
+ return: ptr(Elm.Toolbar_Item_State); [[The toolbar item state, or $null upon failure.]]
}
state_del {
[[Delete a previously added state to $item.]]
params {
- @in state: ptr(Elm.Toolbar.Item.State); [[The state to be deleted.]]
+ @in state: ptr(Elm.Toolbar_Item_State); [[The state to be deleted.]]
}
return: bool; [[$true on success or $false on failure.]]
}
@@ -202,7 +250,7 @@ class Elm.Toolbar.Item(Elm.Widget.Item, Efl.Ui.Item, Efl.Ui.Focus.Object)
If last state is selected, this function will return first
state.
]]
- return: ptr(Elm.Toolbar.Item.State); [[The state after current state, or $null on failure.]]
+ return: ptr(Elm.Toolbar_Item_State); [[The state after current state, or $null on failure.]]
}
state_prev {
[[Get the state before selected state in toolbar's $item.
@@ -210,7 +258,7 @@ class Elm.Toolbar.Item(Elm.Widget.Item, Efl.Ui.Item, Efl.Ui.Focus.Object)
If first state is selected, this function will return last
state.
]]
- return: ptr(Elm.Toolbar.Item.State); [[The state before current state, or $null on failure.]]
+ return: ptr(Elm.Toolbar_Item_State); [[The state before current state, or $null on failure.]]
}
show {
[[Show a specific item, when the toolbar can be scrolled.
@@ -218,7 +266,7 @@ class Elm.Toolbar.Item(Elm.Widget.Item, Efl.Ui.Item, Efl.Ui.Focus.Object)
@since 1.8
]]
params {
- @in scrollto: Elm.Toolbar.Item.Scrollto_Type; [[The position the item should appear at.]]
+ @in scrollto: Elm.Toolbar_Item_Scrollto_Type; [[The position the item should appear at.]]
}
}
bring_in {
@@ -228,7 +276,7 @@ class Elm.Toolbar.Item(Elm.Widget.Item, Efl.Ui.Item, Efl.Ui.Focus.Object)
@since 1.8
]]
params {
- @in scrollto: Elm.Toolbar.Item.Scrollto_Type; [[The position the item should appear at.]]
+ @in scrollto: Elm.Toolbar_Item_Scrollto_Type; [[The position the item should appear at.]]
}
}
menu_set {
@@ -264,20 +312,17 @@ class Elm.Toolbar.Item(Elm.Widget.Item, Efl.Ui.Item, Efl.Ui.Focus.Object)
}
implements {
Efl.Object.constructor;
- Efl.Object.destructor;
+ Efl.Object.invalidate;
Elm.Widget.Item.disable;
Elm.Widget.Item.disabled { set; }
- Elm.Widget.Item.focus { get; set; }
+ Elm.Widget.Item.item_focus { get; set; }
Elm.Widget.Item.signal_emit;
Elm.Widget.Item.part_text { get; set; }
Elm.Widget.Item.part_content { get; set; }
Elm.Widget.Item.part_content_unset;
Efl.Ui.Focus.Object.focus_geometry { get; }
Efl.Ui.Focus.Object.focus { set; }
- Efl.Access.name { get; }
- Efl.Access.state_set { get; }
- Efl.Ui.Item.selected { get; set; }
- Efl.Ui.Item.prev { get; }
- Efl.Ui.Item.next { get; }
+ Efl.Access.Object.i18n_name { get; }
+ Efl.Access.Object.state_set { get; }
}
}
diff --git a/src/lib/elementary/elm_toolbar_legacy.h b/src/lib/elementary/elm_toolbar_legacy.h
index 6268d541e8..9d0fe5b007 100644
--- a/src/lib/elementary/elm_toolbar_legacy.h
+++ b/src/lib/elementary/elm_toolbar_legacy.h
@@ -109,91 +109,5 @@ EAPI void elm_toolbar_horizontal_set(Evas_Object *obj, Eina_Bool horizontal);
*/
EAPI Eina_Bool elm_toolbar_horizontal_get(const Evas_Object *obj);
-/**
- * @brief Get the selected item.
- *
- * The selected item can be unselected with function
- * elm_toolbar_item_selected_set().
- *
- * The selected item always will be highlighted on toolbar.
- *
- * @return The selected toolbar item.
- *
- * @ingroup Elm_Toolbar
- */
-EAPI Elm_Widget_Item *elm_toolbar_selected_item_get(const Evas_Object *obj);
-
-/**
- * @brief Get the first item in the given toolbar widget's list of items.
- *
- * See: @ref elm_obj_toolbar_item_append and @ref elm_obj_toolbar_last_item_get
- *
- * @return The first item or @c NULL, if it has no items (and on errors)
- *
- * @ingroup Elm_Toolbar
- */
-EAPI Elm_Widget_Item *elm_toolbar_first_item_get(const Evas_Object *obj);
-
-/**
- * @brief Get the last item in the given toolbar widget's list of items.
- *
- * See: @ref elm_obj_toolbar_item_prepend and
- * @ref elm_obj_toolbar_first_item_get
- *
- * @return The last item or @c NULL, if it has no items (and on errors)
- *
- * @ingroup Elm_Toolbar
- */
-EAPI Elm_Widget_Item *elm_toolbar_last_item_get(const Evas_Object *obj);
-
-/**
- * @brief Get the item before @c item in toolbar.
- *
- * @note If it is the first item, @c null will be returned.
- *
- * @return The item before @c item, or @c null if none or on failure.
- *
- * @ingroup Elm_Toolbar_Item
- */
-EAPI Elm_Widget_Item *elm_toolbar_item_prev_get(const Evas_Object *obj);
-
-/**
- * @brief Get the item after @c item in toolbar.
- *
- * @note If it is the last item, @c null will be returned.
- *
- * @return The item after @c item, or @c null if none or on failure.
- *
- * @ingroup Elm_Toolbar_Item
- */
-EAPI Elm_Widget_Item *elm_toolbar_item_next_get(const Evas_Object *obj);
-
-/**
- * @brief Set the selected state of an item.
- *
- * This sets the selected state of the given item @c it. @c true for selected,
- * @c false for not selected.
- *
- * If a new item is selected the previously selected will be unselected.
- * Previously selected item can be get with function
- * @ref efl_ui_menu_selected_item_get.
- *
- * Selected items will be highlighted.
- *
- * @param[in] selected The selected state.
- *
- * @ingroup Elm_Toolbar_Item
- */
-EAPI void elm_toolbar_item_selected_set(Evas_Object *obj, Eina_Bool selected);
-
-/**
- * @brief Get whether the @c item is selected or not.
- *
- * @return The selected state.
- *
- * @ingroup Elm_Toolbar_Item
- */
-EAPI Eina_Bool elm_toolbar_item_selected_get(const Evas_Object *obj);
-
#include "elm_toolbar_item.eo.legacy.h"
#include "elm_toolbar.eo.legacy.h"
diff --git a/src/lib/elementary/elm_transit.c b/src/lib/elementary/elm_transit.c
index 7ff9a9b26d..1fadbabb5e 100644
--- a/src/lib/elementary/elm_transit.c
+++ b/src/lib/elementary/elm_transit.c
@@ -510,7 +510,7 @@ _recover_image_uv(Evas_Object *obj, Evas_Map *map, Eina_Bool revert, Eina_Bool b
Eina_Size2D sz;
fill = efl_gfx_fill_get(obj);
- sz = efl_gfx_size_get(obj);
+ sz = efl_gfx_entity_size_get(obj);
w = sz.w;
h = sz.h;
diff --git a/src/lib/elementary/elm_view_form.c b/src/lib/elementary/elm_view_form.c
index 3055339659..4969310f9b 100644
--- a/src/lib/elementary/elm_view_form.c
+++ b/src/lib/elementary/elm_view_form.c
@@ -25,264 +25,52 @@ typedef struct _Elm_View_Form_Promise Elm_View_Form_Promise;
/**
* @brief Local-use callbacks
*/
-typedef void (*Elm_View_Form_Event_Cb)(Elm_View_Form_Widget *, Elm_View_Form_Data *, Evas_Object *);
-typedef void (*Elm_View_Form_Widget_Object_Set_Cb)(Evas_Object *, const Eina_Value *, const char *);
-
-struct _Elm_View_Form_Widget
-{
- Eina_Stringshare *widget_propname;
- Evas_Object *widget_obj;
- Elm_View_Form_Event_Cb widget_obj_value_update_cb;
- Elm_View_Form_Widget_Object_Set_Cb widget_obj_set_cb;
-};
-
struct _Elm_View_Form_Data
{
- Eo *model_obj;
- Eina_List *widgets;
+ Eo *model;
+ Eina_List *links; // List of linked object
};
-struct _Elm_View_Form_Promise
-{
- Elm_View_Form_Data *priv;
- Eina_Stringshare *property_name;
-};
-
-
-static void
-_efl_promise_then_widget(void* data, Efl_Event const* event)
-{
- Elm_View_Form_Widget *w = data;
- Efl_Future_Event_Success* info = event->info;
- Eina_Value *value = info->value;
- w->widget_obj_set_cb(w->widget_obj, value, w->widget_propname);
-}
-
static void
-_efl_promise_error_widget(void *data EINA_UNUSED, Efl_Event const* event EINA_UNUSED)
+_link_dying(void* data, Efl_Event const* event)
{
-}
-
-static void
-_efl_model_promise_then_cb(void* data, Efl_Event const* event)
-{
- Elm_View_Form_Promise *p = data;
- Eina_Value *value = ((Efl_Future_Event_Success*)event->info)->value;
- Elm_View_Form_Data *priv = p->priv;
- Elm_View_Form_Widget *w = NULL;
- Eina_List *l = NULL;
-
- EINA_SAFETY_ON_NULL_RETURN(p);
-
- EINA_LIST_FOREACH(priv->widgets, l, w)
- {
- if (!strcmp(w->widget_propname, p->property_name))
- {
- w->widget_obj_set_cb(w->widget_obj, value, w->widget_propname);
- }
- }
-
- eina_stringshare_del(p->property_name);
- free(p);
-}
-
-static void
-_efl_model_promise_error_cb(void* data, Efl_Event const* event EINA_UNUSED)
-{
- Elm_View_Form_Promise *p = data;
- EINA_SAFETY_ON_NULL_RETURN(p);
-
- eina_stringshare_del(p->property_name);
- free(p);
-}
-
-static void
-_efl_model_properties_change_cb(void *data, const Efl_Event *event)
-{
- const Efl_Model_Property_Event *evt = event->info;
- const char *prop;
- unsigned int i;
Elm_View_Form_Data *priv = data;
- Elm_View_Form_Promise *p = NULL;
- Eina_Array_Iterator it;
-
- EINA_SAFETY_ON_NULL_RETURN(priv);
- EINA_SAFETY_ON_NULL_RETURN(evt);
- if (!evt->changed_properties)
- return;
-
- //update all widgets with this property
- EINA_ARRAY_ITER_NEXT(evt->changed_properties, i, prop, it)
- {
- p = calloc(1, sizeof(Elm_View_Form_Promise));
- p->property_name = eina_stringshare_add(prop);
- p->priv = priv;
- efl_future_then(efl_model_property_get(priv->model_obj, prop),
- &_efl_model_promise_then_cb,
- &_efl_model_promise_error_cb, NULL, p);
- }
+ priv->links = eina_list_remove(priv->links, event->object);
}
-static void
-_update_model_properties(Elm_View_Form_Data *priv)
-{
- Eina_List *l;
- Elm_View_Form_Widget *w;
- //update all widgets property
- if (priv->model_obj == NULL)
- return;
-
- EINA_LIST_FOREACH(priv->widgets, l, w)
- {
- efl_future_then(efl_model_property_get(priv->model_obj, w->widget_propname),
- &_efl_promise_then_widget, &_efl_promise_error_widget, NULL, w);
- }
-}
-
-/**
- * @brief Set widget.
- * Works, so far, for widget(s): Entry, Label
- */
-static void
-_elm_evas_object_text_set_cb(Evas_Object *widget, const Eina_Value *value, const char *propname EINA_UNUSED)
-{
- const char *c_text = NULL;
- char *text = NULL;
-
- EINA_SAFETY_ON_NULL_RETURN(value);
- EINA_SAFETY_ON_NULL_RETURN(widget);
-
- text = eina_value_to_string(value);
- EINA_SAFETY_ON_NULL_RETURN(text);
-
- c_text = elm_object_text_get(widget);
- EINA_SAFETY_ON_NULL_RETURN(c_text);
-
- if (strcmp(text, c_text) != 0)
- {
- elm_object_text_set(widget, text);
- }
- free(text);
-}
-
-static void
-_elm_evas_object_thumb_set_cb(Evas_Object *thumb, const Eina_Value *value, const char *propname EINA_UNUSED)
-{
- char *filename = NULL;
-
- EINA_SAFETY_ON_NULL_RETURN(value);
- filename = eina_value_to_string(value);
- EINA_SAFETY_ON_NULL_RETURN(filename);
- if (strlen(filename) < PATH_MAX)
- {
- elm_thumb_file_set(thumb, filename, NULL);
- elm_thumb_reload(thumb);
- }
- free(filename);
-}
-
-/**
- * @brief Evas object callback implementation.
- * Updates Widget's value if not the same object
- * and the widget itself.
- */
-static void
-_elm_evas_object_text_changed_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
-{
- Eina_Value value;
- Eina_List *l;
- Elm_View_Form_Data *priv = (Elm_View_Form_Data *)data;
- Elm_View_Form_Widget *w = NULL;
-
- EINA_LIST_FOREACH(priv->widgets, l, w)
- {
- if (w->widget_obj == obj)
- break;
- }
-
- EINA_SAFETY_ON_NULL_RETURN(w);
- eina_value_setup(&value, EINA_VALUE_TYPE_STRING);
- eina_value_set(&value, elm_object_text_get(obj));
- efl_model_property_set(priv->model_obj, w->widget_propname, &value);
- eina_value_flush(&value);
-}
/**
* @brief Add new widget object.
* Adds new widget object on the list
* and perform initial setup.
*/
static Eina_Bool
-_elm_view_widget_add(Elm_View_Form_Data *priv, const char *propname, Evas_Object *widget_obj)
+_elm_view_widget_add(Elm_View_Form_Data *priv, const char *property, Evas_Object *link)
{
- Efl_Future *future = NULL;
- Elm_View_Form_Widget *w = calloc(1, sizeof(Elm_View_Form_Widget));
- EINA_SAFETY_ON_NULL_RETURN_VAL(w, EINA_FALSE);
+ if (!efl_isa(link, EFL_UI_MODEL_CONNECT_INTERFACE)) return EINA_FALSE;
+ if (!property) property = "default";
- w->widget_propname = eina_stringshare_add(propname);
- w->widget_obj = widget_obj;
- priv->widgets = eina_list_append(priv->widgets, w);
+ efl_ui_view_model_set(link, priv->model);
+ efl_ui_model_connect(link, "default", property);
+ efl_event_callback_add(link, EFL_EVENT_DEL, _link_dying, priv);
- if(efl_isa(widget_obj, ELM_ENTRY_CLASS))
- {
- w->widget_obj_set_cb = _elm_evas_object_text_set_cb;
- evas_object_event_callback_add(w->widget_obj, EVAS_CALLBACK_KEY_DOWN, _elm_evas_object_text_changed_cb, priv);
- }
- else if(efl_isa(widget_obj, ELM_LABEL_CLASS))
- {
- w->widget_obj_set_cb = _elm_evas_object_text_set_cb;
- }
- else if(efl_isa(widget_obj, ELM_THUMB_CLASS))
- {
- w->widget_obj_set_cb = _elm_evas_object_thumb_set_cb;
- }
- else
- {
- // Widget yet not supported
- EINA_SAFETY_ON_NULL_RETURN_VAL(NULL, EINA_FALSE);
- }
+ priv->links = eina_list_append(priv->links, link);
- if (priv->model_obj != NULL)
- {
- future = efl_model_property_get(priv->model_obj, w->widget_propname);
- efl_future_then(future, &_efl_promise_then_widget,
- &_efl_promise_error_widget, NULL, priv);
- }
return EINA_TRUE;
}
/**
* Helper functions - End
*/
-
-/**
- * @brief constructor
- */
-static Efl_Object*
-_elm_view_form_efl_object_constructor(Eo *obj EINA_UNUSED, Elm_View_Form_Data *_pd)
-{
- Elm_View_Form_Data *priv = (Elm_View_Form_Data *)_pd;
- priv->model_obj = NULL;
-
- efl_constructor(efl_super(obj, MY_CLASS));
-
- return obj;
-}
-
/**
* @brief destructor
*/
static void
_elm_view_form_efl_object_destructor(Eo *obj, Elm_View_Form_Data *priv)
{
- Elm_View_Form_Widget *w = NULL;
- EINA_LIST_FREE(priv->widgets, w)
- {
- eina_stringshare_del(w->widget_propname);
- free(w);
- w = NULL;
- }
- priv->widgets = NULL;
+ priv->links = eina_list_free(priv->links);
+ efl_unref(priv->model);
+ priv->model = NULL;
efl_destructor(efl_super(obj, MY_CLASS));
}
@@ -291,32 +79,21 @@ _elm_view_form_efl_object_destructor(Eo *obj, Elm_View_Form_Data *priv)
static void
_elm_view_form_model_set(Eo *obj EINA_UNUSED, Elm_View_Form_Data *priv, Eo *model)
{
- if (priv->model_obj != NULL)
- {
- efl_event_callback_del(priv->model_obj, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _efl_model_properties_change_cb, priv);
- efl_unref(priv->model_obj);
- }
+ Efl_Object *link;
+ Eina_List *l;
- priv->model_obj = model;
+ efl_replace(&priv->model, model);
- if (priv->model_obj != NULL)
- {
- efl_ref(priv->model_obj);
- efl_event_callback_add(priv->model_obj, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _efl_model_properties_change_cb, priv);
- _update_model_properties(priv);
- }
+ EINA_LIST_FOREACH(priv->links, l, link)
+ efl_ui_view_model_set(link, priv->model);
}
static void
_elm_view_form_widget_add(Eo *obj EINA_UNUSED, Elm_View_Form_Data *priv, const char *propname, Evas_Object *evas)
{
- Eina_Bool status;
-
EINA_SAFETY_ON_NULL_RETURN(evas);
- EINA_SAFETY_ON_NULL_RETURN(propname);
- status = _elm_view_widget_add(priv, propname, evas);
- EINA_SAFETY_ON_FALSE_RETURN(status);
+ _elm_view_widget_add(priv, propname, evas);
}
#include "elm_view_form.eo.c"
diff --git a/src/lib/elementary/elm_view_form.eo b/src/lib/elementary/elm_view_form.eo
index 1045653613..bdc4183fd7 100644
--- a/src/lib/elementary/elm_view_form.eo
+++ b/src/lib/elementary/elm_view_form.eo
@@ -24,7 +24,6 @@ class Elm.View.Form (Efl.Object)
}
implements {
Efl.Object.destructor;
- Efl.Object.constructor;
}
constructors {
.model_set;
diff --git a/src/lib/elementary/elm_view_list.c b/src/lib/elementary/elm_view_list.c
index fdcf8baa07..4360fa1d20 100644
--- a/src/lib/elementary/elm_view_list.c
+++ b/src/lib/elementary/elm_view_list.c
@@ -13,13 +13,8 @@
#define MY_CLASS ELM_VIEW_LIST_CLASS
#define MY_CLASS_NAME "View List"
-struct _Elm_View_List_Data;
typedef struct _Elm_View_List_Data Elm_View_List_Data;
-
-struct _View_List_ItemData;
typedef struct _View_List_ItemData View_List_ItemData;
-
-struct _View_List_ValueItem;
typedef struct _View_List_ValueItem View_List_ValueItem;
struct _Elm_View_List_Data
@@ -29,8 +24,11 @@ struct _Elm_View_List_Data
View_List_ItemData *rootdata;
Elm_Genlist_Item_Class *itc;
Elm_Genlist_Item_Type itype;
- Eina_Hash *prop_con;
- Eo *model;
+
+ struct {
+ Eina_Hash *properties;
+ Eo *model;
+ } connect;
};
struct _View_List_ItemData
@@ -50,7 +48,8 @@ struct _View_List_ValueItem
};
static void _efl_model_load_children(View_List_ItemData *);
-static void _efl_model_children_count_change_cb(void *, const Efl_Event *event);
+static void _efl_model_children_added_cb(void *, const Efl_Event *event);
+static void _efl_model_children_removed_cb(void *, const Efl_Event *event);
static void _efl_model_properties_change_cb(void *, const Efl_Event *event);
static void _expand_request_cb(void *data EINA_UNUSED, const Efl_Event *event);
@@ -59,7 +58,8 @@ static void _contracted_cb(void *data EINA_UNUSED, const Efl_Event *event);
/* --- Genlist Callbacks --- */
EFL_CALLBACKS_ARRAY_DEFINE(model_callbacks,
- { EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, _efl_model_children_count_change_cb });
+ { EFL_MODEL_EVENT_CHILD_ADDED, _efl_model_children_added_cb },
+ { EFL_MODEL_EVENT_CHILD_REMOVED, _efl_model_children_removed_cb });
EFL_CALLBACKS_ARRAY_DEFINE(genlist_callbacks,
{ ELM_GENLIST_EVENT_EXPAND_REQUEST, _expand_request_cb },
{ ELM_GENLIST_EVENT_CONTRACT_REQUEST, _contract_request_cb },
@@ -79,8 +79,8 @@ static void
_item_del(void *data, Evas_Object *obj EINA_UNUSED)
{
View_List_ItemData *idata = data;
- if (!idata)
- return;
+
+ if (!idata) return;
efl_event_callback_array_del(idata->model, model_callbacks(), idata);
efl_event_callback_del(idata->model, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _efl_model_properties_change_cb, idata);
@@ -94,107 +94,57 @@ _item_del(void *data, Evas_Object *obj EINA_UNUSED)
free(idata);
}
-static void
-_property_get_cb(void* data, Efl_Event const* event)
-{
- View_List_ValueItem *vitem = data;
- Eina_Value *value = (Eina_Value*)((Efl_Future_Event_Success*)event->info)->value;
- vitem->value = eina_value_new(eina_value_type_get(value));
- eina_value_copy(value, vitem->value);
-
- if (vitem->item)
- elm_genlist_item_update(vitem->item);
-}
-
-static void
-_property_get_error_cb(void* data, Efl_Event const* event EINA_UNUSED)
-{
- View_List_ValueItem *vitem = data;
- eina_stringshare_del(vitem->part);
-}
-
-static Eina_Value *
-_item_get_value(View_List_ItemData *idata, const char *part)
-{
- View_List_ValueItem *vitem = NULL;
- Eina_Value *value = NULL;
- Eina_List *l, *ln;
-
- EINA_LIST_FOREACH_SAFE(idata->values, l, ln, vitem)
- {
- if (vitem->part == NULL)
- {
- unsigned i = eina_list_count(idata->values);
- if (i == 1)
- {
- idata->values = eina_list_remove(idata->values, vitem);
- free(vitem);
- break;
- }
- idata->values = eina_list_remove_list(idata->values, l);
- free(vitem);
- continue;
- }
-
- if (strcmp(vitem->part, part) == 0)
- {
- value = vitem->value;
- break;
- }
- }
-
- if (value == NULL)
- {
- Efl_Future *future;
- vitem = calloc(1, sizeof(View_List_ValueItem));
- const char *prop = eina_hash_find(idata->priv->prop_con, part);
-
- if (prop == NULL) prop = part;
-
- vitem->part = eina_stringshare_add(part);
- vitem->item = idata->item;
- idata->values = eina_list_append(idata->values, vitem);
- future = efl_model_property_get(idata->model, prop);
- efl_future_then(future, &_property_get_cb,
- &_property_get_error_cb, NULL, vitem);
- }
- else
- {
- unsigned i = eina_list_count(idata->values);
- idata->values = eina_list_remove(idata->values, vitem);
- if (i == 1) idata->values = NULL;
-
- eina_stringshare_del(vitem->part);
- free(vitem);
- }
-
- return value;
-}
-
static Evas_Object *
_item_content_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part)
{
const Eina_Value_Type *vtype;
+ const char *prop;
+ Eina_Value *value = NULL;
Evas_Object *content = NULL;
View_List_ItemData *idata = data;
EINA_SAFETY_ON_NULL_RETURN_VAL(data, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
- if (!idata->item)
- return NULL;
+ if (!idata->item) return NULL;
- Eina_Value *value = _item_get_value(idata, part);
+ prop = eina_hash_find(idata->priv->connect.properties, part);
+ if (!prop) prop = part;
- if (value == NULL)
- return NULL;
+ value = efl_model_property_get(idata->model, prop);
+ if (value == NULL) return NULL;
vtype = eina_value_type_get(value);
- if (vtype == EINA_VALUE_TYPE_STRING || vtype == EINA_VALUE_TYPE_STRINGSHARE)
+ if (vtype == EINA_VALUE_TYPE_BLOB)
+ {
+ Eina_Value_Blob out;
+
+ eina_value_get(value, &out);
+ if (out.memory != NULL)
+ {
+ content = elm_image_add(obj);
+ //XXX: need copy memory??
+ elm_image_memfile_set(content, out.memory, out.size, NULL, NULL);
+ }
+ }
+ else if (vtype == EINA_VALUE_TYPE_FILE)
+ {
+ Eina_File *f = NULL;
+
+ eina_value_get(value, &f);
+
+ content = elm_image_add(obj);
+ elm_image_mmap_set(content, f, NULL);
+ }
+ else if (vtype == EINA_VALUE_TYPE_OBJECT)
{
- char *content_s = NULL;
- content_s = eina_value_to_string(value);
+ eina_value_get(value, &content);
+ }
+ else
+ {
+ char *str = NULL;
+ str = eina_value_to_string(value);
content = elm_icon_add(obj);
- if (elm_icon_standard_set(content, content_s))
+ if (elm_icon_standard_set(content, str))
{
evas_object_size_hint_aspect_set(content, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
}
@@ -203,20 +153,9 @@ _item_content_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part)
evas_object_del(content);
content = NULL;
}
- free(content_s);
- }
- else if (vtype == EINA_VALUE_TYPE_BLOB)
- {
- Eina_Value_Blob out;
- eina_value_get(value, &out);
- if (out.memory != NULL)
- {
- content = elm_image_add(obj);
- //XXX: need copy memory??
- elm_image_memfile_set(content, out.memory, out.size, NULL, NULL);
- }
+ free(str);
}
- eina_value_flush(value);
+ eina_value_free(value);
return content;
}
@@ -224,21 +163,24 @@ _item_content_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part)
static char *
_item_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part)
{
+ Eina_Value *value = NULL;
+ const char *prop;
char *text = NULL;
View_List_ItemData *idata = data;
EINA_SAFETY_ON_NULL_RETURN_VAL(data, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
- if (!idata->item)
- return text;
+ if (!idata->item) return NULL;
- Eina_Value *value = _item_get_value(idata, part);
+ prop = eina_hash_find(idata->priv->connect.properties, part);
+ if (!prop) prop = part;
- if (value)
- {
- text = eina_value_to_string(value);
- eina_value_flush(value);
- }
+ value = efl_model_property_get(idata->model, prop);
+ if (value == NULL) return NULL;
+
+ text = eina_value_to_string(value);
+
+ eina_value_free(value);
return text;
}
@@ -300,75 +242,101 @@ _efl_model_properties_change_cb(void *data, const Efl_Event *event)
elm_genlist_item_update(idata->item);
}
-static void
-_efl_model_load_children_then(void * data, Efl_Event const* event)
+static Eina_Value
+_efl_model_load_children_then(void *data, const Eina_Value v,
+ const Eina_Future *ev EINA_UNUSED)
{
View_List_ItemData *pdata = data;
- Eina_Accessor *accessor = (Eina_Accessor*)((Efl_Future_Event_Success*)event->info)->value;
- Eo *child;
- unsigned i = 0;
- EINA_SAFETY_ON_NULL_RETURN(pdata);
- EINA_SAFETY_ON_NULL_RETURN(pdata->priv);
- EINA_SAFETY_ON_NULL_RETURN(accessor);
-
Elm_View_List_Data *priv = pdata->priv;
+ unsigned int i, len;
+ Efl_Model *child = NULL;
+
+ if (eina_value_type_get(&v) == EINA_VALUE_TYPE_ERROR)
+ goto end;
- EINA_ACCESSOR_FOREACH(accessor, i, child)
+ EINA_VALUE_ARRAY_FOREACH(&v, len, i, child)
{
View_List_ItemData *idata = calloc(1, sizeof(View_List_ItemData));
- EINA_SAFETY_ON_NULL_RETURN(idata);
+ if (!idata) continue ;
+
idata->priv = priv;
idata->parent = pdata;
- idata->model = child;
- efl_ref(child);
- efl_event_callback_add(child, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _efl_model_properties_change_cb, idata);
+ idata->model = efl_ref(child);
+
+ efl_event_callback_add(idata->model, EFL_MODEL_EVENT_PROPERTIES_CHANGED,
+ _efl_model_properties_change_cb, idata);
+
idata->item = elm_genlist_item_append(priv->genlist, priv->itc, idata, pdata->item,
- priv->itype, _item_sel_cb, idata);
+ priv->itype, _item_sel_cb, idata);
}
if (i > 0 && pdata->item)
elm_genlist_item_expanded_set(pdata->item, EINA_TRUE);
+
+ end:
+ return v;
}
static void
_efl_model_load_children(View_List_ItemData *pdata)
{
- efl_future_then(efl_model_children_slice_get(pdata->model, 0, 0),
- &_efl_model_load_children_then, NULL, NULL, pdata);
+ Eina_Future *f;
+
+ f = efl_model_children_slice_get(pdata->priv->connect.model, 0,
+ efl_model_children_count_get(pdata->priv->connect.model));
+ f = eina_future_then(f, _efl_model_load_children_then, pdata);
+ efl_future_Eina_FutureXXX_then(pdata->priv->genlist, f);
}
static void
-_efl_model_children_count_change_cb(void *data, const Efl_Event *event EINA_UNUSED)
+_efl_model_children_removed_cb(void *data, const Efl_Event *event)
{
+ Efl_Model_Children_Event* evt = event->info;
View_List_ItemData *idata = data;
- EINA_SAFETY_ON_NULL_RETURN(idata);
- EINA_SAFETY_ON_NULL_RETURN(idata->priv);
- EINA_SAFETY_ON_NULL_RETURN(idata->priv->genlist);
+ Elm_Object_Item *item;
+ const Eina_List *subitems, *l;
+ unsigned int i = 0;
- elm_genlist_item_subitems_clear(idata->item);
+ subitems = elm_genlist_item_subitems_get(idata->item);
- _efl_model_load_children(idata);
+ EINA_LIST_FOREACH(subitems, l, item)
+ {
+ if (i == evt->index) break ;
+ i++;
+ }
+
+ if (i != evt->index) return ;
+ elm_object_item_del(item);
+}
+
+static void
+_efl_model_children_added_cb(void *data, const Efl_Event *event)
+{
+ Efl_Model_Children_Event* evt = event->info;
+ View_List_ItemData *idata = data;
+ Eina_Future *f;
+
+ f = efl_model_children_slice_get(idata->priv->connect.model, evt->index, 1);
+ f = eina_future_then(f, _efl_model_load_children_then, idata);
+ efl_future_Eina_FutureXXX_then(idata->priv->genlist, f);
}
static void
_priv_model_set(Elm_View_List_Data *priv, Eo *model)
{
- if (priv->model != NULL)
+ if (priv->connect.model)
{
- efl_event_callback_array_del(priv->model, model_callbacks(), priv->rootdata);
- elm_obj_genlist_clear(priv->genlist);
- efl_unref(priv->model);
- priv->model = NULL;
+ efl_event_callback_array_del(priv->connect.model, model_callbacks(), priv->rootdata);
+ elm_obj_genlist_clear(priv->genlist);
}
- if (model == NULL)
- return;
+ efl_replace(&priv->connect.model, model);
- priv->model = model;
- priv->rootdata->model = priv->model;
- efl_ref(priv->model);
+ if (model == NULL) return;
- efl_event_callback_array_add(priv->model, model_callbacks(), priv->rootdata);
+ priv->rootdata->model = priv->connect.model;
+
+ efl_event_callback_array_add(priv->connect.model, model_callbacks(), priv->rootdata);
_efl_model_load_children(priv->rootdata);
}
@@ -377,7 +345,7 @@ _priv_model_set(Elm_View_List_Data *priv, Eo *model)
*/
static void
_elm_view_list_genlist_set(Eo *obj, Elm_View_List_Data *priv, Evas_Object *genlist,
- Elm_Genlist_Item_Type itype, const char *istyle)
+ Elm_Genlist_Item_Type itype, const char *istyle)
{
priv->view = obj;
priv->genlist = genlist;
@@ -395,7 +363,7 @@ _elm_view_list_genlist_set(Eo *obj, Elm_View_List_Data *priv, Evas_Object *genli
priv->itc->func.content_get = _item_content_get;
priv->itc->func.state_get = NULL;
priv->itc->func.del = _item_del;
- priv->prop_con = eina_hash_string_superfast_new(free);
+ priv->connect.properties = eina_hash_string_superfast_new(free);
efl_event_callback_array_add(priv->genlist, genlist_callbacks(), priv);
evas_object_event_callback_add(priv->genlist, EVAS_CALLBACK_DEL, _genlist_deleted, priv);
@@ -408,23 +376,24 @@ _elm_view_list_efl_object_destructor(Eo *obj, Elm_View_List_Data *priv)
EINA_SAFETY_ON_NULL_RETURN(priv);
EINA_SAFETY_ON_NULL_RETURN(obj);
- efl_event_callback_array_del(priv->model, model_callbacks(), priv->rootdata);
+ efl_event_callback_array_del(priv->connect.model, model_callbacks(), priv->rootdata);
elm_obj_genlist_clear(priv->genlist);
free((void *)priv->itc->item_style);
elm_genlist_item_class_free(priv->itc);
- eina_hash_free(priv->prop_con);
+ eina_hash_free(priv->connect.properties);
free(priv->rootdata);
priv->rootdata = NULL;
+
if (priv->genlist)
{
- evas_object_event_callback_del(priv->genlist, EVAS_CALLBACK_DEL, _genlist_deleted);
- efl_event_callback_array_del(priv->genlist, genlist_callbacks(), priv);
- efl_unref(priv->genlist);
+ evas_object_event_callback_del(priv->genlist, EVAS_CALLBACK_DEL, _genlist_deleted);
+ efl_event_callback_array_del(priv->genlist, genlist_callbacks(), priv);
+ efl_unref(priv->genlist);
}
- efl_unref(priv->model);
+ efl_unref(priv->connect.model);
efl_destructor(efl_super(obj, MY_CLASS));
}
@@ -441,37 +410,26 @@ _elm_view_list_evas_object_get(Eo *obj, Elm_View_List_Data *priv, Evas_Object **
static void
_elm_view_list_property_connect(Eo *obj EINA_UNUSED, Elm_View_List_Data *priv,
- const char *property, const char *part)
+ const char *property, const char *part)
{
EINA_SAFETY_ON_NULL_RETURN(priv);
- EINA_SAFETY_ON_NULL_RETURN(priv->prop_con);
+ EINA_SAFETY_ON_NULL_RETURN(priv->connect.properties);
EINA_SAFETY_ON_NULL_RETURN(property);
EINA_SAFETY_ON_NULL_RETURN(part);
- free(eina_hash_set(priv->prop_con, part, strdup(property)));
+ free(eina_hash_set(priv->connect.properties, part, strdup(property)));
}
static void
_elm_view_list_model_set(Eo *obj EINA_UNUSED, Elm_View_List_Data *priv, Efl_Model *model)
{
- EINA_SAFETY_ON_NULL_RETURN(priv);
- EINA_SAFETY_ON_NULL_RETURN(model);
_priv_model_set(priv, model);
}
-static void
-_elm_view_list_model_unset(Eo *obj EINA_UNUSED, Elm_View_List_Data *priv)
-{
- EINA_SAFETY_ON_NULL_RETURN(priv);
- _priv_model_set(priv, NULL);
-}
-
-static void
-_elm_view_list_model_get(Eo *obj EINA_UNUSED, Elm_View_List_Data *priv, Eo **model)
+static Efl_Model *
+_elm_view_list_model_get(const Eo *obj EINA_UNUSED, Elm_View_List_Data *priv)
{
- EINA_SAFETY_ON_NULL_RETURN(priv);
- EINA_SAFETY_ON_NULL_RETURN(model);
- *model = priv->model;
+ return priv->connect.model;
}
#include "elm_view_list.eo.c"
diff --git a/src/lib/elementary/elm_view_list.eo b/src/lib/elementary/elm_view_list.eo
index ccd77a6923..1354963429 100644
--- a/src/lib/elementary/elm_view_list.eo
+++ b/src/lib/elementary/elm_view_list.eo
@@ -1,4 +1,4 @@
-import elm_genlist_item;
+import elm_general;
class Elm.View.List (Efl.Object)
{
@@ -34,34 +34,27 @@ class Elm.View.List (Efl.Object)
@in part: string; [[Edje's theme part]]
}
}
- model_set {
- [[Set model
+ @property model {
+ set {
+ [[Set model
- @since 1.11
- ]]
- params {
- @in model: Efl.Model; [[New Emodel to set]]
+ @since 1.11
+ ]]
}
- }
- model_unset {
- [[Unset model
-
- @since 1.11
- ]]
- }
- model_get {
+ get {
[[Get model
@since 1.11
]]
- params {
- @out model: Efl.Model; [[Returned Emodel]]
+ }
+ values {
+ model: Efl.Model; [[Efl.Model to set]]
}
}
}
/* For some reason the following comment after the event doesn't work: Event dispatch when a model is selected */
events {
- model,selected; [[Called when model was selected]]
+ model,selected: Efl.Object; [[Called when model was selected]]
}
implements {
Efl.Object.destructor;
diff --git a/src/lib/elementary/elm_web.eo b/src/lib/elementary/elm_web.eo
index db349fd100..7f66f0c43c 100644
--- a/src/lib/elementary/elm_web.eo
+++ b/src/lib/elementary/elm_web.eo
@@ -5,16 +5,7 @@ type Elm_Web_Dialog_Confirm: __undefined_type; [[Elementary web dialog confirm t
type Elm_Web_Dialog_Prompt: __undefined_type; [[Elementary web dialog prompt type]]
type Elm_Web_Dialog_Alert: __undefined_type; [[Elementary web dialog alert type]]
-enum Elm.Web.Zoom_Mode
-{
- [[Types of zoom available.]]
- manual = 0, [[Zoom controlled normally by elm_web_zoom_set]]
- auto_fit, [[Zoom until content fits in web object]]
- auto_fill, [[Zoom until content fills web object]]
- last [[Sentinel value to indicate last enum field during iteration]]
-}
-
-class Elm.Web (Elm.Widget)
+class Elm.Web (Efl.Ui.Widget, Efl.Ui.Legacy, Efl.Ui.Zoom)
{
[[Elementary web view class]]
legacy_prefix: elm_web;
@@ -138,58 +129,6 @@ class Elm.Web (Elm.Widget)
enable: bool; [[Whether to enable or disable the browsing history.]]
}
}
- @property zoom_mode @pure_virtual {
- set {
- [[Sets the zoom mode to use.
-
- The modes can be any of those defined in .Elm_Web_Zoom_Mode,
- except .ELM_WEB_ZOOM_MODE_LAST. The default is
- .ELM_WEB_ZOOM_MODE_MANUAL.
-
- .ELM_WEB_ZOOM_MODE_MANUAL means the zoom level will be
- controlled with the @.zoom.set function.
-
- .ELM_WEB_ZOOM_MODE_AUTO_FIT will calculate the needed zoom
- level to make sure the entirety of the web object's contents
- are shown.
-
- .ELM_WEB_ZOOM_MODE_AUTO_FILL will calculate the needed zoom
- level to fit the contents in the web object's size, without
- leaving any space unused.
- ]]
- }
- get {
- [[Get the currently set zoom mode.]]
- }
- values {
- mode: Elm.Web.Zoom_Mode; [[The mode to set.]]
- }
- }
- @property zoom @pure_virtual {
- set {
- [[Sets the zoom level of the web object.
-
- Zoom level matches the Webkit API, so 1.0 means normal zoom,
- with higher values meaning zoom in and lower meaning zoom out.
- This function will only affect the zoom level if the mode set
- with @.zoom_mode.set is .ELM_WEB_ZOOM_MODE_MANUAL.
- ]]
- }
- get {
- [[Get the current zoom level set on the web object
-
- Note that this is the zoom level set on the web object and
- not that of the underlying Webkit one. In the
- .ELM_WEB_ZOOM_MODE_MANUAL mode, the two zoom levels should
- match, but for the other two modes the Webkit zoom is
- calculated internally to match the chosen mode without
- changing the zoom level set for the web object.
- ]]
- }
- values {
- zoom: double; [[The zoom level to set.]]
- }
- }
@property console_message_hook {
set @pure_virtual {
[[Sets the function to call when a console message is emitted
@@ -503,8 +442,10 @@ class Elm.Web (Elm.Widget)
Efl.Object.constructor;
}
events {
+ /* FIXME: Nobody is emitting these
uri,changed; [[Called when URI changed]]
url,changed; [[Called when URL changed]]
windows,close,request; [[Called when window closed event was received]]
+ */
}
}
diff --git a/src/lib/elementary/elm_web2.c b/src/lib/elementary/elm_web2.c
index 170ae425c7..8fb606c2d4 100644
--- a/src/lib/elementary/elm_web2.c
+++ b/src/lib/elementary/elm_web2.c
@@ -2,10 +2,11 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#include <Elementary.h>
+#include "../../static_libs/buildsystem/buildsystem.h"
#include "elm_priv.h"
#include "elm_widget_web.h"
@@ -98,7 +99,7 @@ _elm_web_efl_object_constructor(Eo *obj, Elm_Web_Data *sd)
sd->obj = obj;
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _elm_web_smart_callbacks);
- efl_access_role_set(obj, EFL_ACCESS_ROLE_HTML_CONTAINER);
+ efl_access_object_role_set(obj, EFL_ACCESS_ROLE_HTML_CONTAINER);
return obj;
}
@@ -156,6 +157,64 @@ elm_web_window_features_region_get(const Elm_Web_Window_Features *wf,
ewm.window_features_region_get(wf, x, y, w, h);
}
+
+static inline void
+_convert_web_zoom_mode(Elm_Web_Zoom_Mode *legacy_mode, Efl_Ui_Zoom_Mode *mode, Eina_Bool to_legacy)
+{
+ #define CONVERT(LEGACY_MODE, NEW_MODE) \
+ if (to_legacy && *mode == NEW_MODE) \
+ { \
+ *legacy_mode =LEGACY_MODE; \
+ return; \
+ } \
+ if (!to_legacy && *legacy_mode == LEGACY_MODE) \
+ { \
+ *mode = NEW_MODE; \
+ return; \
+ } \
+
+ CONVERT(ELM_WEB_ZOOM_MODE_MANUAL, EFL_UI_ZOOM_MODE_MANUAL)
+ CONVERT(ELM_WEB_ZOOM_MODE_AUTO_FIT, EFL_UI_ZOOM_MODE_AUTO_FIT)
+ CONVERT(ELM_WEB_ZOOM_MODE_AUTO_FILL, EFL_UI_ZOOM_MODE_AUTO_FILL)
+ CONVERT(ELM_WEB_ZOOM_MODE_LAST, EFL_UI_ZOOM_MODE_LAST)
+ CONVERT(ELM_WEB_ZOOM_MODE_LAST, EFL_UI_ZOOM_MODE_AUTO_FIT_IN)
+
+ #undef CONVERT
+}
+
+EAPI void
+elm_web_zoom_mode_set(Evas_Object *obj, Elm_Web_Zoom_Mode mode)
+{
+ Efl_Ui_Zoom_Mode new_mode;
+
+ _convert_web_zoom_mode(&mode, &new_mode, EINA_FALSE);
+
+ efl_ui_zoom_mode_set(obj, new_mode);
+}
+
+EAPI Elm_Web_Zoom_Mode
+elm_web_zoom_mode_get(const Evas_Object *obj)
+{
+ Efl_Ui_Zoom_Mode new_mode = efl_ui_zoom_mode_get(obj);;
+ Elm_Web_Zoom_Mode mode;
+
+ _convert_web_zoom_mode(&mode, &new_mode, EINA_TRUE);
+
+ return mode;
+}
+
+EAPI void
+elm_web_zoom_set(Evas_Object *obj, double zoom)
+{
+ efl_ui_zoom_level_set(obj, zoom);
+}
+
+EAPI double
+elm_web_zoom_get(const Evas_Object *obj)
+{
+ return efl_ui_zoom_level_get(obj);
+}
+
static void
_elm_web_class_constructor(Efl_Class *klass)
{
@@ -173,16 +232,10 @@ _elm_web_init(const char *engine)
{
char buf[PATH_MAX];
-#ifdef NEED_RUN_IN_TREE
- if (getenv("ELM_RUN_IN_TREE"))
- snprintf(buf, sizeof(buf),
- ELM_TOP_BUILD_DIR"/src/modules/web/%s/.libs/module"EFL_SHARED_EXTENSION,
- engine);
- else
-#endif
- snprintf(buf, sizeof(buf),
- "%s/elementary/modules/web/%s/%s/module"EFL_SHARED_EXTENSION,
- _elm_lib_dir, engine, MODULE_ARCH);
+ if (!bs_mod_get(buf, sizeof(buf), "elementary/web", engine))
+ snprintf(buf, sizeof(buf),
+ "%s/elementary/modules/web/%s/%s/module"EFL_SHARED_EXTENSION,
+ _elm_lib_dir, engine, MODULE_ARCH);
if (ewm.m)
{
diff --git a/src/lib/elementary/elm_web_legacy.h b/src/lib/elementary/elm_web_legacy.h
index ff4cf09905..29588eded5 100644
--- a/src/lib/elementary/elm_web_legacy.h
+++ b/src/lib/elementary/elm_web_legacy.h
@@ -1,3 +1,17 @@
+/** Types of zoom available.
+ *
+ * @ingroup Elm_Web
+ */
+typedef enum
+{
+ ELM_WEB_ZOOM_MODE_MANUAL = 0, /**< Zoom controlled normally by
+ * elm_web_zoom_set */
+ ELM_WEB_ZOOM_MODE_AUTO_FIT, /**< Zoom until content fits in web object */
+ ELM_WEB_ZOOM_MODE_AUTO_FILL, /**< Zoom until content fills web object */
+ ELM_WEB_ZOOM_MODE_LAST /**< Sentinel value to indicate last enum field during
+ * iteration */
+} Elm_Web_Zoom_Mode;
+
/**
* Add a new web object to the parent.
*
@@ -47,4 +61,69 @@ EINA_DEPRECATED EAPI Eina_Bool elm_web_uri_set(Evas_Object *obj, const c
*/
EINA_DEPRECATED EAPI const char *elm_web_uri_get(const Evas_Object *obj);
-#include "elm_web.eo.legacy.h" \ No newline at end of file
+
+/**
+ * @brief Sets the zoom mode to use.
+ *
+ * The modes can be any of those defined in .Elm_Web_Zoom_Mode, except
+ * .ELM_WEB_ZOOM_MODE_LAST. The default is .ELM_WEB_ZOOM_MODE_MANUAL.
+ *
+ * .ELM_WEB_ZOOM_MODE_MANUAL means the zoom level will be controlled with the
+ * @ref elm_web_zoom_set function.
+ *
+ * .ELM_WEB_ZOOM_MODE_AUTO_FIT will calculate the needed zoom level to make
+ * sure the entirety of the web object's contents are shown.
+ *
+ * .ELM_WEB_ZOOM_MODE_AUTO_FILL will calculate the needed zoom level to fit the
+ * contents in the web object's size, without leaving any space unused.
+ *
+ * @param[in] obj The object.
+ * @param[in] mode The mode to set.
+ *
+ * @ingroup Elm_Web
+ */
+EAPI void elm_web_zoom_mode_set(Evas_Object *obj, Elm_Web_Zoom_Mode mode);
+
+/**
+ * @brief Get the currently set zoom mode.
+ *
+ * @param[in] obj The object.
+ *
+ * @return The mode to set.
+ *
+ * @ingroup Elm_Web
+ */
+EAPI Elm_Web_Zoom_Mode elm_web_zoom_mode_get(const Evas_Object *obj);
+
+/**
+ * @brief Sets the zoom level of the web object.
+ *
+ * Zoom level matches the Webkit API, so 1.0 means normal zoom, with higher
+ * values meaning zoom in and lower meaning zoom out. This function will only
+ * affect the zoom level if the mode set with @ref elm_web_zoom_mode_set is
+ * .ELM_WEB_ZOOM_MODE_MANUAL.
+ *
+ * @param[in] obj The object.
+ * @param[in] zoom The zoom level to set.
+ *
+ * @ingroup Elm_Web
+ */
+EAPI void elm_web_zoom_set(Evas_Object *obj, double zoom);
+
+/**
+ * @brief Get the current zoom level set on the web object
+ *
+ * Note that this is the zoom level set on the web object and not that of the
+ * underlying Webkit one. In the .ELM_WEB_ZOOM_MODE_MANUAL mode, the two zoom
+ * levels should match, but for the other two modes the Webkit zoom is
+ * calculated internally to match the chosen mode without changing the zoom
+ * level set for the web object.
+ *
+ * @param[in] obj The object.
+ *
+ * @return The zoom level to set.
+ *
+ * @ingroup Elm_Web
+ */
+EAPI double elm_web_zoom_get(const Evas_Object *obj);
+#include "elm_web.eo.legacy.h"
diff --git a/src/lib/elementary/elm_widget.h b/src/lib/elementary/elm_widget.h
index b7975a45da..c9e7d2c27a 100644
--- a/src/lib/elementary/elm_widget.h
+++ b/src/lib/elementary/elm_widget.h
@@ -316,7 +316,7 @@ typedef Eina_Bool (*Elm_Widget_Focus_Get_Cb)(const void *data);
typedef void (*Elm_Access_On_Highlight_Cb)(void *data);
typedef void * (*list_data_get_func_type)(const Eina_List * l);
-#include "elm_widget.eo.h"
+#include "efl_ui_widget.eo.h"
/**
* @addtogroup Widget
@@ -389,10 +389,6 @@ typedef struct _Elm_Widget_Smart_Data
Evas_Object *hover_obj;
Evas_Object *bg;
Eina_List *tooltips, *cursors;
- Evas_Object *focus_previous, *focus_next;
- Evas_Object *focus_up, *focus_down, *focus_right, *focus_left;
- Elm_Object_Item *item_focus_previous, *item_focus_next;
- Elm_Object_Item *item_focus_up, *item_focus_down, *item_focus_right, *item_focus_left;
/* "show region" coordinates. all widgets got those because this
* info may be set and queried recursively through the widget
@@ -439,9 +435,14 @@ typedef struct _Elm_Widget_Smart_Data
} logical;
struct {
Efl_Ui_Focus_Manager *manager;
- Efl_Ui_Focus_User *provider;
+ Efl_Ui_Focus_Object *provider;
} manager;
-
+ struct {
+ Eina_Bool listen_to_manager;
+ Eina_List *custom_chain;
+ Evas_Object *prev, *next, *up, *down, *right, *left;
+ Elm_Object_Item *item_prev, *item_next, *item_up, *item_down, *item_right, *item_left;
+ } legacy_focus;
Eina_Bool scroll_x_locked : 1;
Eina_Bool scroll_y_locked : 1;
@@ -464,7 +465,6 @@ typedef struct _Elm_Widget_Smart_Data
Eina_Bool on_create : 1; /**< This is true when the widget is on creation(general widget constructor). */
Eina_Bool on_destroy: 1; /**< This is true when the widget is on destruction(general widget destructor). */
Eina_Bool provider_lookup : 1; /**< This is true when efl_provider_find is currently walking the tree */
- Eina_Bool legacy : 1; /**< Widget was created with a legacy API, not efl_add() */
Eina_Bool has_shadow : 1;
} Elm_Widget_Smart_Data;
@@ -474,7 +474,7 @@ typedef Elm_Widget_Smart_Data Efl_Ui_Widget_Data;
* @}
*/
-/**< base structure for all widget items that are not Elm_Widget themselves */
+/**< base structure for all widget items that are not Efl_Ui_Widget themselves */
typedef struct _Elm_Widget_Item_Data Elm_Widget_Item_Data;
typedef struct _Elm_Widget_Item_Signal_Data Elm_Widget_Item_Signal_Data;
@@ -602,6 +602,7 @@ struct _Elm_Widget_Item_Data
EINA_MAGIC;
/* simple accessor macros */
#define VIEW(X) X->base->view
+#define VIEW_SET(X, V) efl_wref_add(V, &X->base->view)
#define WIDGET(X) X->base->widget
#define EO_OBJ(X) ((X)?X->base->eo_obj:NULL)
/**< the owner widget that owns this item */
@@ -619,6 +620,7 @@ struct _Elm_Widget_Item_Data
Evas_Object *focus_up, *focus_down, *focus_right, *focus_left;
Elm_Object_Item *item_focus_previous, *item_focus_next;
Elm_Object_Item *item_focus_up, *item_focus_down, *item_focus_right, *item_focus_left;
+ Eina_Stringshare *style;
Evas_Object *access_obj;
const char *access_info;
@@ -736,8 +738,6 @@ EAPI Evas_Object *elm_widget_content_part_get(const Evas_Object *obj, const
EAPI Evas_Object *elm_widget_content_part_unset(Evas_Object *obj, const char *part);
EAPI void elm_widget_access_info_set(Evas_Object *obj, const char *txt);
EAPI const char *elm_widget_access_info_get(const Evas_Object *obj);
-EAPI void elm_widget_orientation_mode_disabled_set(Evas_Object *obj, Eina_Bool disabled);
-EAPI Eina_Bool elm_widget_orientation_mode_disabled_get(const Evas_Object *obj);
EAPI Eina_Rect elm_widget_focus_highlight_geometry_get(const Evas_Object *obj);
void _elm_widget_item_highlight_in_theme(Evas_Object *obj, Elm_Object_Item *it);
EAPI void elm_widget_focus_region_show_mode_set(Evas_Object *obj, Elm_Focus_Region_Show_Mode mode);
@@ -756,25 +756,25 @@ EAPI Efl_Ui_Theme_Apply elm_widget_element_update(Evas_Object *obj, Evas_Object
/* debug function. don't use it unless you are tracking parenting issues */
EAPI void elm_widget_tree_dump(const Evas_Object *top);
EAPI void elm_widget_tree_dot_dump(const Evas_Object *top, FILE *output);
-EAPI Eina_Bool _elm_widget_onscreen_is(Evas_Object *widget);
-EAPI Eina_Bool _elm_widget_item_onscreen_is(Elm_Object_Item *item);
-const char* _elm_widget_accessible_plain_name_get(Evas_Object *obj, const char* name);
-const char* _elm_widget_item_accessible_plain_name_get(Elm_Object_Item *item, const char* name);
+EAPI Eina_Bool _elm_widget_onscreen_is(const Evas_Object *widget);
+EAPI Eina_Bool _elm_widget_item_onscreen_is(const Elm_Object_Item *item);
+const char* _elm_widget_accessible_plain_name_get(const Evas_Object *obj, const char* name);
+const char* _elm_widget_item_accessible_plain_name_get(const Elm_Object_Item *item, const char* name);
-Efl_Canvas_Object * _efl_ui_widget_bg_get(Elm_Widget *obj);
+Efl_Canvas_Object * _efl_ui_widget_bg_get(const Efl_Ui_Widget *obj);
#define ELM_WIDGET_DATA_GET_OR_RETURN(o, ptr, ...) \
Elm_Widget_Smart_Data *ptr; \
- ptr = efl_data_scope_get(o, ELM_WIDGET_CLASS); \
+ ptr = efl_data_scope_get(o, EFL_UI_WIDGET_CLASS); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("no widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return __VA_ARGS__; \
}
#define ELM_WIDGET_CHECK(obj) \
- if (EINA_UNLIKELY(!efl_isa((obj), ELM_WIDGET_CLASS))) \
+ if (EINA_UNLIKELY(!efl_isa((obj), EFL_UI_WIDGET_CLASS))) \
return
#define ELM_WIDGET_ITEM_RETURN_IF_ONDEL(item, ...) \
@@ -824,27 +824,27 @@ _elm_widget_sub_object_redirect_to_top(Evas_Object *obj, Evas_Object *sobj)
return ret;
}
-/* Internal hack to mark legacy objects as such before construction.
- * No need for TLS: Only UI objects created in the main loop matter. */
-EAPI extern Eina_Bool _elm_legacy_add;
-#define elm_legacy_add(k, p, ...) ({ _elm_legacy_add = 1; \
- efl_add(k, p, efl_canvas_object_legacy_ctor(efl_added), ##__VA_ARGS__); })
+#define elm_legacy_add(k, p, ...) ({ \
+ efl_add(k, p ? p : efl_main_loop_get(), efl_canvas_object_legacy_ctor(efl_added), ##__VA_ARGS__); })
+
+static inline Eo *
+elm_widget_resize_object_get(const Eo *obj)
+{
+ Elm_Widget_Smart_Data *wd = efl_data_scope_safe_get(obj, EFL_UI_WIDGET_CLASS);
+ return wd ? wd->resize_obj : NULL;
+}
static inline Eina_Bool
elm_widget_is_legacy(const Eo *obj)
{
- Elm_Widget_Smart_Data *sd;
-
- if (_elm_legacy_add) return EINA_TRUE;
- sd = (Elm_Widget_Smart_Data *) efl_data_scope_safe_get(obj, ELM_WIDGET_CLASS);
- return sd ? sd->legacy : EINA_FALSE;
+ return efl_isa(obj, EFL_UI_LEGACY_INTERFACE);
}
/** Takes in any canvas object and returns the first smart parent that is a widget */
-static inline Elm_Widget *
+static inline Efl_Ui_Widget *
evas_object_widget_parent_find(Evas_Object *o)
{
- while (o && !efl_isa(o, ELM_WIDGET_CLASS))
+ while (o && !efl_isa(o, EFL_UI_WIDGET_CLASS))
evas_object_smart_parent_get(o);
return o;
}
@@ -860,8 +860,8 @@ EAPI Eina_Bool _elm_layout_part_aliasing_eval(const Evas_Object *obj,
Eina_Bool is_text);
/* Internal EO APIs */
-const char *elm_widget_default_content_part_get(const Eo *obj);
-const char *elm_widget_default_text_part_get(const Eo *obj);
+const char *efl_ui_widget_default_content_part_get(const Eo *obj);
+const char *efl_ui_widget_default_text_part_get(const Eo *obj);
#define ELM_WIDGET_ITEM_PROTECTED
diff --git a/src/lib/elementary/elm_widget_actionslider.h b/src/lib/elementary/elm_widget_actionslider.h
index ad86e1f131..4668d0bbd1 100644
--- a/src/lib/elementary/elm_widget_actionslider.h
+++ b/src/lib/elementary/elm_widget_actionslider.h
@@ -45,7 +45,7 @@ struct _Elm_Actionslider_Data
ELM_ACTIONSLIDER_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -54,7 +54,7 @@ struct _Elm_Actionslider_Data
ELM_ACTIONSLIDER_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_bg.h b/src/lib/elementary/elm_widget_bg.h
index 0f867ef8b1..c7acb2a09c 100644
--- a/src/lib/elementary/elm_widget_bg.h
+++ b/src/lib/elementary/elm_widget_bg.h
@@ -47,7 +47,7 @@ struct _Elm_Bg_Data
ELM_BG_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -56,7 +56,7 @@ struct _Elm_Bg_Data
ELM_BG_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_box.h b/src/lib/elementary/elm_widget_box.h
index a41ddc1f62..a4f5348cf6 100644
--- a/src/lib/elementary/elm_widget_box.h
+++ b/src/lib/elementary/elm_widget_box.h
@@ -76,7 +76,7 @@ struct _Transition_Animation_Data
ELM_BOX_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -85,7 +85,7 @@ struct _Transition_Animation_Data
ELM_BOX_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_bubble.h b/src/lib/elementary/elm_widget_bubble.h
index 7182ad3041..5931bd2e92 100644
--- a/src/lib/elementary/elm_widget_bubble.h
+++ b/src/lib/elementary/elm_widget_bubble.h
@@ -41,7 +41,7 @@ struct _Elm_Bubble_Data
ELM_BUBBLE_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -50,7 +50,7 @@ struct _Elm_Bubble_Data
ELM_BUBBLE_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_clipper.h b/src/lib/elementary/elm_widget_clipper.h
index 39ae1956e8..6be7914277 100644
--- a/src/lib/elementary/elm_widget_clipper.h
+++ b/src/lib/elementary/elm_widget_clipper.h
@@ -45,7 +45,7 @@ struct _Elm_Clipper_Data
ELM_CLIPPER_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -54,7 +54,7 @@ struct _Elm_Clipper_Data
ELM_CLIPPER_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_clock.h b/src/lib/elementary/elm_widget_clock.h
index 4aec62d3c7..195dab4687 100644
--- a/src/lib/elementary/elm_widget_clock.h
+++ b/src/lib/elementary/elm_widget_clock.h
@@ -66,7 +66,7 @@ struct _Elm_Clock_Data
ELM_CLOCK_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -75,7 +75,7 @@ struct _Elm_Clock_Data
ELM_CLOCK_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_colorselector.h b/src/lib/elementary/elm_widget_colorselector.h
index d92d95c50d..d4f95f8d2e 100644
--- a/src/lib/elementary/elm_widget_colorselector.h
+++ b/src/lib/elementary/elm_widget_colorselector.h
@@ -122,7 +122,7 @@ struct _Elm_Color_Name
ELM_COLORSELECTOR_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -131,7 +131,7 @@ struct _Elm_Color_Name
ELM_COLORSELECTOR_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_combobox.h b/src/lib/elementary/elm_widget_combobox.h
index fa0de30e52..bdbaaaeab8 100644
--- a/src/lib/elementary/elm_widget_combobox.h
+++ b/src/lib/elementary/elm_widget_combobox.h
@@ -53,7 +53,7 @@ struct _Elm_Combobox_Data
ELM_COMBOBOX_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -62,7 +62,7 @@ struct _Elm_Combobox_Data
ELM_COMBOBOX_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_conform.h b/src/lib/elementary/elm_widget_conform.h
index 1eda4c2505..7a4dbff755 100644
--- a/src/lib/elementary/elm_widget_conform.h
+++ b/src/lib/elementary/elm_widget_conform.h
@@ -76,7 +76,7 @@ enum _Conformant_Part_Type
ELM_CONFORMANT_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -85,7 +85,7 @@ enum _Conformant_Part_Type
ELM_CONFORMANT_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_ctxpopup.h b/src/lib/elementary/elm_widget_ctxpopup.h
index aa50b29c3b..8779732069 100644
--- a/src/lib/elementary/elm_widget_ctxpopup.h
+++ b/src/lib/elementary/elm_widget_ctxpopup.h
@@ -75,7 +75,7 @@ struct _Elm_Ctxpopup_Data
ELM_CTXPOPUP_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -84,7 +84,7 @@ struct _Elm_Ctxpopup_Data
ELM_CTXPOPUP_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_dayselector.h b/src/lib/elementary/elm_widget_dayselector.h
index 9dd8784b26..ee552e3b77 100644
--- a/src/lib/elementary/elm_widget_dayselector.h
+++ b/src/lib/elementary/elm_widget_dayselector.h
@@ -55,7 +55,7 @@ struct _Elm_Dayselector_Item_Data
ELM_DAYSELECTOR_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -64,7 +64,7 @@ struct _Elm_Dayselector_Item_Data
ELM_DAYSELECTOR_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_diskselector.h b/src/lib/elementary/elm_widget_diskselector.h
index 37a1ecc3e8..25d0f37752 100644
--- a/src/lib/elementary/elm_widget_diskselector.h
+++ b/src/lib/elementary/elm_widget_diskselector.h
@@ -77,7 +77,7 @@ struct _Elm_Diskselector_Item_Data
ELM_DISKSELECTOR_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -86,7 +86,7 @@ struct _Elm_Diskselector_Item_Data
ELM_DISKSELECTOR_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_entry.h b/src/lib/elementary/elm_widget_entry.h
index 896bd99883..a40df5183b 100644
--- a/src/lib/elementary/elm_widget_entry.h
+++ b/src/lib/elementary/elm_widget_entry.h
@@ -163,7 +163,7 @@ typedef enum _Length_Unit
ELM_ENTRY_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -172,7 +172,7 @@ typedef enum _Length_Unit
ELM_ENTRY_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_fileselector.h b/src/lib/elementary/elm_widget_fileselector.h
index 6cf369c2b9..1ebf33c0ca 100644
--- a/src/lib/elementary/elm_widget_fileselector.h
+++ b/src/lib/elementary/elm_widget_fileselector.h
@@ -57,6 +57,8 @@ struct _Elm_Fileselector_Data
Ecore_Idler *populate_idler;
Ecore_Idler *path_entry_idler;
+ Efl_Model *target;
+
const char *path_separator;
const char *search_string;
@@ -104,6 +106,7 @@ struct _Listing_Request
Eina_Stringshare *selected_path;
int item_total;
int item_processed_count;
+
Eina_Bool first : 1;
Eina_Bool valid : 1;
};
@@ -114,11 +117,13 @@ struct _Elm_Fileselector_Item_Data
Efl_Model *model;
Eina_Stringshare *path;
Eina_Stringshare *filename;
- int64_t size;
- double mtime;
Eina_Stringshare *mime_type;
Efl_Model *parent_model;
const char *parent_path;
+
+ int64_t size;
+ double mtime;
+
Eina_Bool is_dir : 1;
};
@@ -166,7 +171,7 @@ struct _Elm_Fileselector_Filter
ELM_FILESELECTOR_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -175,7 +180,7 @@ struct _Elm_Fileselector_Filter
ELM_FILESELECTOR_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_fileselector_button.h b/src/lib/elementary/elm_widget_fileselector_button.h
index 329c941dbe..e055ae10de 100644
--- a/src/lib/elementary/elm_widget_fileselector_button.h
+++ b/src/lib/elementary/elm_widget_fileselector_button.h
@@ -65,7 +65,7 @@ struct _Elm_Fileselector_Button_Data
ELM_FILESELECTOR_BUTTON_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -74,7 +74,7 @@ struct _Elm_Fileselector_Button_Data
ELM_FILESELECTOR_BUTTON_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_fileselector_entry.h b/src/lib/elementary/elm_widget_fileselector_entry.h
index 50691b2487..83d4005426 100644
--- a/src/lib/elementary/elm_widget_fileselector_entry.h
+++ b/src/lib/elementary/elm_widget_fileselector_entry.h
@@ -47,7 +47,7 @@ struct _Elm_Fileselector_Entry_Data
ELM_FILESELECTOR_ENTRY_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -56,7 +56,7 @@ struct _Elm_Fileselector_Entry_Data
ELM_FILESELECTOR_ENTRY_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_flipselector.h b/src/lib/elementary/elm_widget_flipselector.h
index 1fca1a623d..58e96a5e5a 100644
--- a/src/lib/elementary/elm_widget_flipselector.h
+++ b/src/lib/elementary/elm_widget_flipselector.h
@@ -61,7 +61,7 @@ struct _Elm_Flipselector_Item_Data
ELM_FLIPSELECTOR_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -70,7 +70,7 @@ struct _Elm_Flipselector_Item_Data
ELM_FLIPSELECTOR_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_gengrid.h b/src/lib/elementary/elm_widget_gengrid.h
index 004cf6cc59..8f728b1c9a 100644
--- a/src/lib/elementary/elm_widget_gengrid.h
+++ b/src/lib/elementary/elm_widget_gengrid.h
@@ -129,7 +129,6 @@ struct _Elm_Gengrid_Data
Eina_Bool show_region : 1;
Eina_Bool bring_in : 1;
Eina_Bool mouse_down : 1; /**< a flag that mouse is down on the list at the moment. this flag is set to true on mouse and reset to false on mouse up */
- Eina_Bool wheel_disabled : 1; /**< a flag that shows mouse wheel is disabled or not. */
/**< value whether item loop feature is enabled or not. */
Eina_Bool item_loop_enable : 1;
@@ -211,7 +210,7 @@ struct _Elm_Gengrid_Pan_Data
ELM_GENGRID_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -220,7 +219,7 @@ struct _Elm_Gengrid_Pan_Data
ELM_GENGRID_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_genlist.h b/src/lib/elementary/elm_widget_genlist.h
index 69c0cb530a..c6454c8720 100644
--- a/src/lib/elementary/elm_widget_genlist.h
+++ b/src/lib/elementary/elm_widget_genlist.h
@@ -58,12 +58,6 @@ struct _Elm_Genlist_Data
Ecore_Job *calc_job;
int walking;
int minw, minh;
- Eina_Bool scr_minw : 1; /* a flag for determining
- * minimum width to limit
- * as their content size */
- Eina_Bool scr_minh : 1; /* a flag for determining
- * minimum height to limit
- * as their content size */
unsigned int item_count;
Evas_Coord pan_x, pan_y;
Elm_Object_Select_Mode select_mode;
@@ -151,8 +145,15 @@ struct _Elm_Genlist_Data
Eina_Hash *content_item_map;
Eo *provider;
+ Elm_Gen_Item *focus_on_realization;
- Eina_Bool filter;
+ Eina_Bool scr_minw : 1; /* a flag for determining
+ * minimum width to limit
+ * as their content size */
+ Eina_Bool scr_minh : 1; /* a flag for determining
+ * minimum height to limit
+ * as their content size */
+ Eina_Bool filter : 1;
Eina_Bool focus_on_selection_enabled : 1;
Eina_Bool tree_effect_enabled : 1;
Eina_Bool auto_scroll_enabled : 1;
@@ -338,7 +339,7 @@ struct _Elm_Genlist_Filter
ELM_GENLIST_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -347,7 +348,7 @@ struct _Elm_Genlist_Filter
ELM_GENLIST_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_glview.h b/src/lib/elementary/elm_widget_glview.h
index cee7603990..d561c0985e 100644
--- a/src/lib/elementary/elm_widget_glview.h
+++ b/src/lib/elementary/elm_widget_glview.h
@@ -61,7 +61,7 @@ struct _Elm_Glview_Data
ELM_GLVIEW_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -70,7 +70,7 @@ struct _Elm_Glview_Data
ELM_GLVIEW_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_hover.h b/src/lib/elementary/elm_widget_hover.h
index 41bc3151ef..91bb3f0a9a 100644
--- a/src/lib/elementary/elm_widget_hover.h
+++ b/src/lib/elementary/elm_widget_hover.h
@@ -47,8 +47,6 @@ struct _Elm_Hover_Data
sizeof(_content_aliases[0]) - 1];
Eina_Bool on_del : 1;
- Efl_Ui_Focus_Manager *manager;
- Efl_Ui_Focus_Manager *redirected;
};
/**
@@ -62,7 +60,7 @@ struct _Elm_Hover_Data
ELM_HOVER_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -71,7 +69,7 @@ struct _Elm_Hover_Data
ELM_HOVER_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_hoversel.h b/src/lib/elementary/elm_widget_hoversel.h
index f21ae34d42..eb78671a3f 100644
--- a/src/lib/elementary/elm_widget_hoversel.h
+++ b/src/lib/elementary/elm_widget_hoversel.h
@@ -71,7 +71,7 @@ struct _Elm_Hoversel_Item_Data
ELM_HOVERSEL_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -80,7 +80,7 @@ struct _Elm_Hoversel_Item_Data
ELM_HOVERSEL_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_icon.h b/src/lib/elementary/elm_widget_icon.h
index 210cfd12e6..929f7e3141 100644
--- a/src/lib/elementary/elm_widget_icon.h
+++ b/src/lib/elementary/elm_widget_icon.h
@@ -67,7 +67,7 @@ struct _Elm_Icon_Data
ELM_ICON_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -76,7 +76,7 @@ struct _Elm_Icon_Data
ELM_ICON_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_index.h b/src/lib/elementary/elm_widget_index.h
index 1b6c1a3d8d..16582e2dac 100644
--- a/src/lib/elementary/elm_widget_index.h
+++ b/src/lib/elementary/elm_widget_index.h
@@ -86,7 +86,7 @@ struct _Elm_Index_Omit
ELM_INDEX_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -95,7 +95,7 @@ struct _Elm_Index_Omit
ELM_INDEX_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_inwin.h b/src/lib/elementary/elm_widget_inwin.h
index 3e3beb3e7f..0cf7e1bea2 100644
--- a/src/lib/elementary/elm_widget_inwin.h
+++ b/src/lib/elementary/elm_widget_inwin.h
@@ -39,7 +39,7 @@ struct _Elm_Inwin_Smart_Data
ELM_INWIN_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -48,7 +48,7 @@ struct _Elm_Inwin_Smart_Data
ELM_INWIN_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_item.eo b/src/lib/elementary/elm_widget_item.eo
index b5321f017a..e409481008 100644
--- a/src/lib/elementary/elm_widget_item.eo
+++ b/src/lib/elementary/elm_widget_item.eo
@@ -4,7 +4,7 @@ import efl_ui;
type Elm_Tooltip_Item_Content_Cb: __undefined_type; [[Elementary tooltip item content callback type]]
type Elm_Object_Item_Signal_Cb: __undefined_type; [[Elementary object item signal callback type]]
-class Elm.Widget.Item(Efl.Object, Efl.Access,
+class Elm.Widget.Item(Efl.Object, Efl.Access.Object,
Efl.Access.Component)
{
[[Elementary widget item class]]
@@ -147,13 +147,15 @@ class Elm.Widget.Item(Efl.Object, Efl.Access,
label: string; [[Label name]]
}
}
- @property focus {
+ @property item_focus {
[[Control the object item focused
@since 1.10]]
get {
+ legacy: elm_object_item_focus_get;
}
set {
+ legacy: elm_object_item_focus_set;
}
values {
focused: bool; [[The focused state]]
@@ -211,9 +213,6 @@ class Elm.Widget.Item(Efl.Object, Efl.Access,
Note: Every elm_object_item supports this API]]
return: Efl.Canvas.Object; [[The widget object]]
}
- del {
- [[Delete the given item.]]
- }
pre_notify_del @protected {
[[notify deletion of widget item]]
legacy: null;
@@ -492,13 +491,12 @@ class Elm.Widget.Item(Efl.Object, Efl.Access,
@since 1.8]]
}
disable @protected {
- [[Disable widget item]]
+ [[Disable widget item]]
legacy: null;
}
del_pre @protected {
- [[Delete pre widget item]]
+ [[Delete pre widget item]]
legacy: null;
- return: bool; [[$true on success, $false otherwise]]
}
focus_next_object_get @const {
[[Get the next object with specific focus direction.
@@ -540,11 +538,10 @@ class Elm.Widget.Item(Efl.Object, Efl.Access,
implements {
Efl.Object.constructor;
Efl.Object.destructor;
- Efl.Access.state_set { get; }
- Efl.Access.attributes { get; }
+ Efl.Object.invalidate;
+ Efl.Access.Object.state_set { get; }
+ Efl.Access.Object.attributes { get; }
Efl.Access.Component.extents { get; set; }
- Efl.Access.Component.alpha { get; }
- Efl.Access.Component.layer { get; }
Efl.Access.Component.focus_grab;
}
}
diff --git a/src/lib/elementary/elm_widget_item_static_focus.c b/src/lib/elementary/elm_widget_item_static_focus.c
index 21d2f99e2d..4a90d5f822 100644
--- a/src/lib/elementary/elm_widget_item_static_focus.c
+++ b/src/lib/elementary/elm_widget_item_static_focus.c
@@ -2,32 +2,113 @@
# include "elementary_config.h"
#endif
+#define EFL_UI_FOCUS_COMPOSITION_ADAPTER_PROTECTED
#define ELM_WIDGET_ITEM_PROTECTED
+#define MY_CLASS ELM_WIDGET_ITEM_STATIC_FOCUS_CLASS
#include <Elementary.h>
+#include "elm_genlist.eo.h"
+#include "elm_gengrid.eo.h"
#include "elm_priv.h"
#include "efl_ui_focus_composition_adapter.eo.h"
typedef struct {
Eo *adapter;
+ Eina_Bool realized;
} Elm_Widget_Item_Static_Focus_Data;
+static void
+_realized_set(Elm_Widget_Item_Static_Focus *f)
+{
+ Elm_Widget_Item_Static_Focus_Data *pd = efl_data_scope_get(f, MY_CLASS);
+
+ pd->realized = EINA_TRUE;
+}
+
+static void
+_list_realized_cb(void *data, const Efl_Event *ev)
+{
+ if (ev->info != data) return;
+
+ _realized_set(data);
+
+ if (!elm_object_item_disabled_get(data) &&
+ elm_genlist_item_type_get(data) != ELM_GENLIST_ITEM_GROUP)
+ efl_ui_focus_object_prepare_logical(data);
+}
+
+static void
+_grid_realized_cb(void *data, const Efl_Event *ev)
+{
+ const Elm_Gen_Item_Class *itc;
+ Eina_Bool is_group = EINA_FALSE;
+
+ if (ev->info != data) return;
+
+ _realized_set(data);
+
+ itc = elm_gengrid_item_item_class_get(data);
+
+ is_group = (itc && itc->item_style && !strcmp(itc->item_style, "group_index"));
+
+ if (!elm_object_item_disabled_get(data) && !is_group)
+ efl_ui_focus_object_prepare_logical(data);
+}
+
+static void
+_unrealized_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Elm_Widget_Item_Static_Focus_Data *pd = efl_data_scope_get(data, MY_CLASS);
+
+ if (ev->info != data) return;
+
+ if (pd) /* if the obect is dead pd is NULL */
+ {
+ //only delete the adapter when not focused, this will lead to awfull artifacts
+ if (!efl_ui_focus_object_focus_get(pd->adapter))
+ {
+ efl_del(pd->adapter);
+ }
+ pd->realized = EINA_FALSE;
+ }
+}
+
EOLIAN static void
-_elm_widget_item_static_focus_efl_ui_focus_object_prepare_logical(Eo *obj, Elm_Widget_Item_Static_Focus_Data *pd EINA_UNUSED)
+_elm_widget_item_static_focus_efl_ui_focus_object_prepare_logical_none_recursive(Eo *obj, Elm_Widget_Item_Static_Focus_Data *pd EINA_UNUSED)
{
Eo *logical_child;
Elm_Widget_Item_Data *wpd = efl_data_scope_get(obj, ELM_WIDGET_ITEM_CLASS);
- efl_ui_focus_object_prepare_logical(efl_super(obj, ELM_WIDGET_ITEM_STATIC_FOCUS_CLASS));
+ efl_ui_focus_object_prepare_logical_none_recursive(efl_super(obj, MY_CLASS));
+
+ if (!pd->realized)
+ {
+ WRN("This item is not realized, thus things will fall over, better return NOW");
+ return;
+ }
+
logical_child = efl_ui_focus_manager_request_subchild(wpd->widget, obj);
+ if (logical_child == pd->adapter)
+ {
+ Eo *next_widget;
+ next_widget = efl_ui_focus_manager_request_move(wpd->widget, EFL_UI_FOCUS_DIRECTION_NEXT, logical_child, EINA_TRUE);
+
+ if (efl_isa(next_widget, ELM_WIDGET_ITEM_STATIC_FOCUS_CLASS))
+ {
+ next_widget = NULL;
+ }
+ logical_child = next_widget;
+ }
+
if (!logical_child)
{
if (!pd->adapter)
{
- pd->adapter = efl_add(EFL_UI_FOCUS_COMPOSITION_ADAPTER_CLASS, wpd->view,
- efl_ui_focus_composition_adapter_canvas_object_set(efl_added, wpd->view)
- );
+ // parent has to stay the object, since this is used to get the item of a adapter
+ pd->adapter = efl_add(EFL_UI_FOCUS_COMPOSITION_ADAPTER_CLASS, obj);
+ efl_ui_focus_composition_adapter_focus_manager_parent_set(pd->adapter, wpd->widget);
+ efl_ui_focus_composition_adapter_focus_manager_object_set(pd->adapter, wpd->widget);
efl_wref_add(pd->adapter, &pd->adapter);
efl_ui_focus_manager_calc_register(wpd->widget, pd->adapter, obj, NULL);
}
@@ -38,6 +119,51 @@ _elm_widget_item_static_focus_efl_ui_focus_object_prepare_logical(Eo *obj, Elm_W
efl_del(pd->adapter);
pd->adapter = NULL;
}
+
+ //genlist sometimes changes views when doing quick scrolls so reset the view in every possible call
+ if (pd->adapter)
+ efl_ui_focus_composition_adapter_canvas_object_set(pd->adapter, wpd->view);
}
+EOLIAN static Efl_Object*
+_elm_widget_item_static_focus_efl_object_constructor(Eo *obj, Elm_Widget_Item_Static_Focus_Data *pd EINA_UNUSED)
+{
+ Elm_Widget_Item_Data *wpd = efl_data_scope_get(obj, ELM_WIDGET_ITEM_CLASS);
+ Eo *ret = efl_constructor(efl_super(obj, MY_CLASS));
+
+ if (efl_isa(wpd->widget, ELM_GENLIST_CLASS))
+ {
+ efl_event_callback_add(wpd->widget, ELM_GENLIST_EVENT_REALIZED, _list_realized_cb, obj);
+ efl_event_callback_add(wpd->widget, ELM_GENLIST_EVENT_UNREALIZED, _unrealized_cb, obj);
+ }
+ else
+ {
+ efl_event_callback_add(wpd->widget, ELM_GENGRID_EVENT_REALIZED, _grid_realized_cb, obj);
+ efl_event_callback_add(wpd->widget, ELM_GENGRID_EVENT_UNREALIZED, _unrealized_cb, obj);
+ }
+ return ret;
+}
+
+EOLIAN static void
+_elm_widget_item_static_focus_efl_object_destructor(Eo *obj, Elm_Widget_Item_Static_Focus_Data *pd EINA_UNUSED)
+{
+ Elm_Widget_Item_Data *wpd = efl_data_scope_get(obj, ELM_WIDGET_ITEM_CLASS);
+ if (efl_isa(wpd->widget, ELM_GENLIST_CLASS))
+ {
+ efl_event_callback_del(wpd->widget, ELM_GENLIST_EVENT_REALIZED, _list_realized_cb, obj);
+ efl_event_callback_del(wpd->widget, ELM_GENLIST_EVENT_UNREALIZED, _unrealized_cb, obj);
+ }
+ else
+ {
+ efl_event_callback_del(wpd->widget, ELM_GENGRID_EVENT_REALIZED, _grid_realized_cb, obj);
+ efl_event_callback_del(wpd->widget, ELM_GENGRID_EVENT_UNREALIZED, _unrealized_cb, obj);
+ }
+
+ if (pd->adapter)
+ efl_del(pd->adapter);
+
+ return efl_destructor(efl_super(obj, MY_CLASS));
+}
+
+
#include "elm_widget_item_static_focus.eo.c"
diff --git a/src/lib/elementary/elm_widget_item_static_focus.eo b/src/lib/elementary/elm_widget_item_static_focus.eo
index 874466c99e..51d0fd0e46 100644
--- a/src/lib/elementary/elm_widget_item_static_focus.eo
+++ b/src/lib/elementary/elm_widget_item_static_focus.eo
@@ -2,6 +2,8 @@ class Elm.Widget.Item.Static_Focus (Elm.Widget.Item, Efl.Ui.Focus.Object)
{
[[A class that ensures that at least ONE focusable target is behind this widget item. If there is none registered to it after a prepare call it will register the view of the item as item.]]
implements {
- Efl.Ui.Focus.Object.prepare_logical;
+ Efl.Object.constructor;
+ Efl.Object.destructor;
+ Efl.Ui.Focus.Object.prepare_logical_none_recursive;
}
}
diff --git a/src/lib/elementary/elm_widget_label.h b/src/lib/elementary/elm_widget_label.h
index 1cbc99cf45..899a79e815 100644
--- a/src/lib/elementary/elm_widget_label.h
+++ b/src/lib/elementary/elm_widget_label.h
@@ -40,7 +40,7 @@ struct _Elm_Label_Data
ELM_LABEL_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -49,7 +49,7 @@ struct _Elm_Label_Data
ELM_LABEL_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_layout.h b/src/lib/elementary/elm_widget_layout.h
index 0e0c088b73..5b871790ac 100644
--- a/src/lib/elementary/elm_widget_layout.h
+++ b/src/lib/elementary/elm_widget_layout.h
@@ -53,9 +53,16 @@ typedef struct _Elm_Layout_Smart_Data
Eina_List *subs; /**< List of Elm_Layout_Sub_Object_Data structs, to hold the actual sub objects such as text, content and the children of box and table. */
Eina_List *edje_signals; /**< The list of edje signal callbacks. */
Eina_List *parts_cursors; /**< The list of cursor names of layout parts. This is a list of Elm_Layout_Sub_Object_Cursor struct. */
- Eina_List *prop_connect; /**< The list of properties connected to layout parts. */
- Eina_Hash *factories; /**< The hash with parts connected to factories. */
- Efl_Model *model; /**< The model */
+
+ struct {
+ Eina_Hash *properties; /**< The list of properties connected to layout parts. */
+ Eina_Hash *signals; /**< The list of signals connected. */
+ Eina_Hash *factories; /**< The hash with parts connected to factories. */
+ Efl_Model *model; /**< The model */
+
+ Eina_Bool updating : 1;
+ } connect;
+
int frozen; /**< Layout freeze counter */
Eina_Bool needs_size_calc : 1; /**< This flas is set true when the layout sizing eval is already requested. This defers sizing evaluation until smart calculation to avoid unnecessary calculation. */
@@ -64,18 +71,17 @@ typedef struct _Elm_Layout_Smart_Data
Eina_Bool can_access : 1; /**< This is true when all text(including textblock) parts can be accessible by accessibility. */
Eina_Bool destructed_is : 1; /**< This flag indicates if Efl.Ui.Layout destructor was called. This is needed to avoid unnecessary calculation of subobject deletion during layout object's deletion. */
Eina_Bool file_set : 1; /**< This flag indicates if Efl.Ui.Layout source is set from a file*/
- Eina_Bool view_updated : 1; /**< This flag indicates to Efl.Ui.Layout don't update model in text_set */
-} Efl_Ui_Layout_Data;
+} Efl_Ui_Layout_Object_Data;
/**
* @}
*/
#define EFL_UI_LAYOUT_DATA_GET(o, sd) \
- Efl_Ui_Layout_Data * sd = efl_data_scope_get(o, EFL_UI_LAYOUT_CLASS)
+ Efl_Ui_Layout_Object_Data * sd = efl_data_scope_get(o, EFL_UI_LAYOUT_OBJECT_CLASS)
#define EFL_UI_LAYOUT_CHECK(obj) \
- if (EINA_UNLIKELY(!efl_isa(obj, EFL_UI_LAYOUT_CLASS))) \
+ if (EINA_UNLIKELY(!efl_isa(obj, EFL_UI_LAYOUT_OBJECT_CLASS))) \
return
#endif
diff --git a/src/lib/elementary/elm_widget_list.h b/src/lib/elementary/elm_widget_list.h
index fc98f142e7..707f170e92 100644
--- a/src/lib/elementary/elm_widget_list.h
+++ b/src/lib/elementary/elm_widget_list.h
@@ -34,7 +34,7 @@ struct _Elm_List_Data
{
Evas_Object *box, *hit_rect;
- Eina_List *items, *selected, *to_delete;
+ Eina_List *items, *selected;
Elm_Object_Item *last_selected_item;
Elm_Object_Item *focused_item; /**< a focused item by keypad arrow or mouse. This is set to NULL if widget looses focus. */
Elm_Object_Item *last_focused_item; /**< This records the last focused item when widget looses focus. This is required to set the focus on last focused item when widgets gets focus. */
@@ -64,6 +64,7 @@ struct _Elm_List_Data
Eina_Bool mouse_down : 1; /**< a flag that mouse is down on the list at the moment. this flag is set to true on mouse and reset to false on mouse up */
Eina_Bool item_loop_enable : 1; /**< value whether item loop feature is enabled or not. */
Eina_Bool item_looping_on : 1;
+ Eina_Bool fixing_now : 1;
};
struct _Elm_List_Item_Data
@@ -103,7 +104,7 @@ struct _Elm_List_Item_Data
ELM_LIST_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -112,7 +113,7 @@ struct _Elm_List_Item_Data
ELM_LIST_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_map.h b/src/lib/elementary/elm_widget_map.h
index 56ebf2cb16..7c569a42ec 100644
--- a/src/lib/elementary/elm_widget_map.h
+++ b/src/lib/elementary/elm_widget_map.h
@@ -441,7 +441,7 @@ struct _Elm_Map_Data
int tile; // Current pixel size of a grid item
} size;
- Elm_Map_Zoom_Mode mode;
+ Efl_Ui_Zoom_Mode mode;
struct
{
@@ -516,7 +516,7 @@ struct _Elm_Map_Pan_Data
ELM_MAP_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -525,7 +525,7 @@ struct _Elm_Map_Pan_Data
ELM_MAP_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_mapbuf.h b/src/lib/elementary/elm_widget_mapbuf.h
index c6742dd2eb..be1400e3bb 100644
--- a/src/lib/elementary/elm_widget_mapbuf.h
+++ b/src/lib/elementary/elm_widget_mapbuf.h
@@ -53,7 +53,7 @@ struct _Elm_Mapbuf_Data
ELM_MAPBUF_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -62,7 +62,7 @@ struct _Elm_Mapbuf_Data
ELM_MAPBUF_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_menu.h b/src/lib/elementary/elm_widget_menu.h
index 0403a67480..be2daee861 100644
--- a/src/lib/elementary/elm_widget_menu.h
+++ b/src/lib/elementary/elm_widget_menu.h
@@ -78,7 +78,7 @@ struct _Elm_Menu_Item_Data
ELM_MENU_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -87,7 +87,7 @@ struct _Elm_Menu_Item_Data
ELM_MENU_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/efl_ui_multibuttonentry_private.h b/src/lib/elementary/elm_widget_multibuttonentry.h
index 572e5fa47b..1da716622b 100644
--- a/src/lib/elementary/efl_ui_multibuttonentry_private.h
+++ b/src/lib/elementary/elm_widget_multibuttonentry.h
@@ -70,9 +70,9 @@ typedef struct _Elm_Multibuttonentry_Item_Filter
void *data;
} Elm_Multibuttonentry_Item_Filter;
-typedef struct _Efl_Ui_Multibuttonentry_Data
- Efl_Ui_Multibuttonentry_Data;
-struct _Efl_Ui_Multibuttonentry_Data
+typedef struct _Elm_Multibuttonentry_Data
+ Elm_Multibuttonentry_Data;
+struct _Elm_Multibuttonentry_Data
{
Evas_Object *parent;
Evas_Object *box;
@@ -88,6 +88,9 @@ struct _Efl_Ui_Multibuttonentry_Data
Elm_Multibuttonentry_Item_Data *selected_it; /* selected item */
Elm_Multibuttonentry_Item_Data *focused_it;
+ Elm_Multibuttonentry_Format_Cb format_func;
+ const void *format_func_data;
+
const char *label_str, *guide_text_str;
int n_str;
@@ -107,7 +110,7 @@ struct _Efl_Ui_Multibuttonentry_Data
Eina_Bool last_it_select : 1;
Eina_Bool editable : 1;
- Eina_Bool focused : 1;
+ Eina_Bool focused : 1; // avoids infinite loop on focus in/out
Eina_Bool label_packed : 1;
};
@@ -115,23 +118,23 @@ struct _Efl_Ui_Multibuttonentry_Data
* @}
*/
-#define EFL_UI_MULTIBUTTONENTRY_DATA_GET(o, sd) \
- Efl_Ui_Multibuttonentry_Data *sd = efl_data_scope_get(o, EFL_UI_MULTIBUTTONENTRY_CLASS);
+#define ELM_MULTIBUTTONENTRY_DATA_GET(o, sd) \
+ Elm_Multibuttonentry_Data *sd = efl_data_scope_get(o, ELM_MULTIBUTTONENTRY_CLASS);
-#define EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(o, ptr) \
- EFL_UI_MULTIBUTTONENTRY_DATA_GET(o, ptr); \
+#define ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(o, ptr) \
+ ELM_MULTIBUTTONENTRY_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
-#define EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
- Efl_Ui_Multibuttonentry_Data * ptr = efl_data_scope_get(o, EFL_UI_MULTIBUTTONENTRY_CLASS); \
+#define ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
+ Elm_Multibuttonentry_Data * ptr = efl_data_scope_get(o, ELM_MULTIBUTTONENTRY_CLASS); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_naviframe.h b/src/lib/elementary/elm_widget_naviframe.h
index 95ce2630ad..b8db0b1a02 100644
--- a/src/lib/elementary/elm_widget_naviframe.h
+++ b/src/lib/elementary/elm_widget_naviframe.h
@@ -55,7 +55,6 @@ struct _Elm_Naviframe_Item_Data
Evas_Display_Mode dispmode;
Elm_Naviframe_Item_Pop_Cb pop_cb;
void *pop_data;
- const char *style;
const char *title_label;
const char *subtitle_label;
@@ -104,7 +103,7 @@ struct _Elm_Naviframe_Text_Item_Pair
ELM_NAVIFRAME_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -113,7 +112,7 @@ struct _Elm_Naviframe_Text_Item_Pair
ELM_NAVIFRAME_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_notify.h b/src/lib/elementary/elm_widget_notify.h
index 71ffd184d4..0026f195f3 100644
--- a/src/lib/elementary/elm_widget_notify.h
+++ b/src/lib/elementary/elm_widget_notify.h
@@ -51,7 +51,7 @@ struct _Elm_Notify_Data
ELM_NOTIFY_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -60,7 +60,7 @@ struct _Elm_Notify_Data
ELM_NOTIFY_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_panel.h b/src/lib/elementary/elm_widget_panel.h
index 16847480a6..7aa093fa44 100644
--- a/src/lib/elementary/elm_widget_panel.h
+++ b/src/lib/elementary/elm_widget_panel.h
@@ -46,6 +46,7 @@ struct _Elm_Panel_Data
Eina_Bool delete_me : 1;
Eina_Bool scrollable : 1;
Eina_Bool freeze: 1;
+ Eina_Bool callback_added: 1;
};
/**
@@ -59,7 +60,7 @@ struct _Elm_Panel_Data
ELM_PANEL_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -68,7 +69,7 @@ struct _Elm_Panel_Data
ELM_PANEL_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_photo.h b/src/lib/elementary/elm_widget_photo.h
index e6b5b769d5..bd0a967088 100644
--- a/src/lib/elementary/elm_widget_photo.h
+++ b/src/lib/elementary/elm_widget_photo.h
@@ -55,7 +55,7 @@ struct _Elm_Photo_Data
ELM_PHOTO_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -64,7 +64,7 @@ struct _Elm_Photo_Data
ELM_PHOTO_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_player.h b/src/lib/elementary/elm_widget_player.h
index ea540684ee..3bc4f204b9 100644
--- a/src/lib/elementary/elm_widget_player.h
+++ b/src/lib/elementary/elm_widget_player.h
@@ -60,7 +60,7 @@ struct _Elm_Player_Data
ELM_PLAYER_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -69,7 +69,7 @@ struct _Elm_Player_Data
ELM_PLAYER_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_plug.h b/src/lib/elementary/elm_widget_plug.h
index bc5e6da5cf..8798fee764 100644
--- a/src/lib/elementary/elm_widget_plug.h
+++ b/src/lib/elementary/elm_widget_plug.h
@@ -31,7 +31,7 @@
ELM_PLUG_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -40,7 +40,7 @@
ELM_PLUG_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_popup.h b/src/lib/elementary/elm_widget_popup.h
index 330b074d29..a57d22f40b 100644
--- a/src/lib/elementary/elm_widget_popup.h
+++ b/src/lib/elementary/elm_widget_popup.h
@@ -88,7 +88,7 @@ struct _Action_Area_Data
ELM_POPUP_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -97,7 +97,7 @@ struct _Action_Area_Data
ELM_POPUP_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_prefs.h b/src/lib/elementary/elm_widget_prefs.h
index 4b5f1263ec..439ce18489 100644
--- a/src/lib/elementary/elm_widget_prefs.h
+++ b/src/lib/elementary/elm_widget_prefs.h
@@ -110,7 +110,7 @@ extern const Elm_Prefs_Item_Iface *elm_prefs_item_default_widget;
ELM_PREFS_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -119,7 +119,7 @@ extern const Elm_Prefs_Item_Iface *elm_prefs_item_default_widget;
ELM_PREFS_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_route.h b/src/lib/elementary/elm_widget_route.h
index f8e099f17a..6c6286bf4d 100644
--- a/src/lib/elementary/elm_widget_route.h
+++ b/src/lib/elementary/elm_widget_route.h
@@ -65,7 +65,7 @@ struct Segment
ELM_ROUTE_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -74,7 +74,7 @@ struct Segment
ELM_ROUTE_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_scroller.h b/src/lib/elementary/elm_widget_scroller.h
index 29ec6bd99c..bd7fde2b4c 100644
--- a/src/lib/elementary/elm_widget_scroller.h
+++ b/src/lib/elementary/elm_widget_scroller.h
@@ -50,7 +50,7 @@ struct _Elm_Scroller_Data
ELM_SCROLLER_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -59,7 +59,7 @@ struct _Elm_Scroller_Data
ELM_SCROLLER_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_segment_control.h b/src/lib/elementary/elm_widget_segment_control.h
index 79bdf79f0a..75ae74e8bc 100644
--- a/src/lib/elementary/elm_widget_segment_control.h
+++ b/src/lib/elementary/elm_widget_segment_control.h
@@ -56,7 +56,7 @@ struct _Elm_Segment_Control_Item_Data
ELM_SEGMENT_CONTROL_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -65,7 +65,7 @@ struct _Elm_Segment_Control_Item_Data
ELM_SEGMENT_CONTROL_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_separator.h b/src/lib/elementary/elm_widget_separator.h
index 7044b58502..2c1d6b2be5 100644
--- a/src/lib/elementary/elm_widget_separator.h
+++ b/src/lib/elementary/elm_widget_separator.h
@@ -40,7 +40,7 @@ struct _Elm_Separator_Data
ELM_SEPARATOR_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -49,7 +49,7 @@ struct _Elm_Separator_Data
ELM_SEPARATOR_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_slider.h b/src/lib/elementary/elm_widget_slider.h
new file mode 100644
index 0000000000..1b9c85c1fe
--- /dev/null
+++ b/src/lib/elementary/elm_widget_slider.h
@@ -0,0 +1,73 @@
+#ifndef ELM_WIDGET_SLIDER_H
+#define ELM_WIDGET_SLIDER_H
+
+#include "Elementary.h"
+
+/* DO NOT USE THIS HEADER UNLESS YOU ARE PREPARED FOR BREAKING OF YOUR
+ * CODE. THIS IS ELEMENTARY'S INTERNAL WIDGET API (for now) AND IS NOT
+ * FINAL. CALL elm_widget_api_check(ELM_INTERNAL_API_VERSION) TO CHECK
+ * IT AT RUNTIME.
+ */
+
+/**
+ * @addtogroup Widget
+ * @{
+ *
+ * @section elm-slider-class The Elementary Slider Class
+ *
+ * Elementary, besides having the @ref Slider widget, exposes its
+ * foundation -- the Elementary Slider Class -- in order to create other
+ * widgets which are a slider with some more logic on top.
+ */
+
+/**
+ * Base layout smart data extended with slider instance data.
+ */
+typedef struct _Elm_Slider_Data Elm_Slider_Data;
+struct _Elm_Slider_Data
+{
+ Evas_Object *popup, *popup2, *track, *track2;
+
+ Ecore_Timer *wheel_indicator_timer, *delay;
+ double wheel_indicator_duration;
+ Elm_Slider_Indicator_Visible_Mode indicator_visible_mode; /**< indicator_visible_mode of the slider.
+ This indicates when to show an indicator */
+
+ Evas_Coord size;
+
+ Efl_Ui_Format_Func_Cb format_cb;
+ Eina_Free_Cb format_free_cb;
+ void *format_cb_data;
+ Eina_Strbuf *format_strbuf;
+
+ Efl_Ui_Format_Func_Cb indi_format_cb;
+ Eina_Free_Cb indi_format_free_cb;
+ void *indi_format_cb_data;
+ Eina_Strbuf *indi_format_strbuf;
+ const char *indi_template;
+
+
+ Eina_Bool indicator_show : 1;
+ Eina_Bool units_show : 1;
+ Eina_Bool popup_visible : 1;
+ Eina_Bool intvl_enable : 1;
+ Eina_Bool spacer_down : 1;
+};
+
+/**
+ * @}
+ */
+
+#define ELM_SLIDER_DATA_GET(o, sd) \
+ Elm_Slider_Data * sd = efl_data_scope_get(o, ELM_SLIDER_CLASS)
+
+#define ELM_SLIDER_DATA_GET_OR_RETURN(o, sd, ...) \
+ Elm_Slider_Data * sd = efl_data_scope_safe_get(o, ELM_SLIDER_CLASS); \
+ if (EINA_UNLIKELY(!sd)) \
+ { \
+ ERR("No widget data for object %p (%s)", \
+ o, evas_object_type_get(o)); \
+ return __VA_ARGS__; \
+ }
+
+#endif
diff --git a/src/lib/elementary/elm_widget_slideshow.h b/src/lib/elementary/elm_widget_slideshow.h
index e1226a4770..8c18138b71 100644
--- a/src/lib/elementary/elm_widget_slideshow.h
+++ b/src/lib/elementary/elm_widget_slideshow.h
@@ -71,7 +71,7 @@ struct _Elm_Slideshow_Data
ELM_SLIDESHOW_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -80,7 +80,7 @@ struct _Elm_Slideshow_Data
ELM_SLIDESHOW_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_spinner.h b/src/lib/elementary/elm_widget_spinner.h
index 50bb88c175..6d820fdd17 100644
--- a/src/lib/elementary/elm_widget_spinner.h
+++ b/src/lib/elementary/elm_widget_spinner.h
@@ -79,7 +79,7 @@ struct _Elm_Spinner_Special_Value
ELM_SPINNER_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -88,7 +88,7 @@ struct _Elm_Spinner_Special_Value
ELM_SPINNER_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_thumb.h b/src/lib/elementary/elm_widget_thumb.h
index d7aeee798a..927d79860b 100644
--- a/src/lib/elementary/elm_widget_thumb.h
+++ b/src/lib/elementary/elm_widget_thumb.h
@@ -78,7 +78,7 @@ struct _Elm_Thumb_Data
ELM_THUMB_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -87,7 +87,7 @@ struct _Elm_Thumb_Data
ELM_THUMB_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_toolbar.h b/src/lib/elementary/elm_widget_toolbar.h
index 095f1f0876..899da4d37b 100644
--- a/src/lib/elementary/elm_widget_toolbar.h
+++ b/src/lib/elementary/elm_widget_toolbar.h
@@ -101,7 +101,7 @@ struct _Elm_Toolbar_Item_Data
ELM_TOOLBAR_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -110,7 +110,7 @@ struct _Elm_Toolbar_Item_Data
ELM_TOOLBAR_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_widget_web.h b/src/lib/elementary/elm_widget_web.h
index 5fc6bd8def..2a32d231a4 100644
--- a/src/lib/elementary/elm_widget_web.h
+++ b/src/lib/elementary/elm_widget_web.h
@@ -45,7 +45,7 @@ typedef struct _Elm_Web_Callback_Proxy_Context Elm_Web_Callback_Proxy_Context;
ELM_WEB_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -54,7 +54,7 @@ typedef struct _Elm_Web_Callback_Proxy_Context Elm_Web_Callback_Proxy_Context;
ELM_WEB_DATA_GET(o, ptr); \
if (EINA_UNLIKELY(!ptr)) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
diff --git a/src/lib/elementary/elm_win_legacy.h b/src/lib/elementary/elm_win_legacy.h
index 1232015430..ef210528fc 100644
--- a/src/lib/elementary/elm_win_legacy.h
+++ b/src/lib/elementary/elm_win_legacy.h
@@ -66,7 +66,12 @@ typedef Efl_Ui_Win_Type Elm_Win_Type;
#define ELM_WIN_TOOLTIP EFL_UI_WIN_TOOLTIP
#define ELM_WIN_NOTIFICATION EFL_UI_WIN_NOTIFICATION
#define ELM_WIN_COMBO EFL_UI_WIN_COMBO
-#define ELM_WIN_DND EFL_UI_WIN_DND
+/**
+ * Used to indicate the window is a representation of an object being
+ * dragged across different windows, or even applications. Typically
+ * used with elm_win_override_set().
+ */
+#define ELM_WIN_DND 13
#define ELM_WIN_INLINED_IMAGE 14
#define ELM_WIN_SOCKET_IMAGE 15
#define ELM_WIN_FAKE 16 /**< See elm_win_fake_add(). @since 1.13 */
diff --git a/src/lib/elementary/els_cursor.c b/src/lib/elementary/els_cursor.c
index a90c7daf25..87adefe50e 100644
--- a/src/lib/elementary/els_cursor.c
+++ b/src/lib/elementary/els_cursor.c
@@ -192,6 +192,21 @@ struct _Elm_Cursor
};
static void
+_elm_cursor_obj_hints(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Elm_Cursor *cur = data;
+ int x, y;
+
+ evas_object_size_hint_min_get(cur->obj, &x, &y);
+ if ((x < 8) || (y < 8))
+ {
+ x = 8;
+ y = 8;
+ }
+ evas_object_resize(cur->obj, x, y);
+}
+
+static void
_elm_cursor_obj_del(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
Elm_Cursor *cur = data;
@@ -200,6 +215,8 @@ _elm_cursor_obj_del(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UN
{
evas_object_event_callback_del_full(cur->obj, EVAS_CALLBACK_DEL,
_elm_cursor_obj_del, cur);
+ evas_object_event_callback_del_full(cur->obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ _elm_cursor_obj_hints, cur);
cur->obj = NULL;
ELM_SAFE_FREE(cur->hotobj, evas_object_del);
}
@@ -212,6 +229,8 @@ _elm_cursor_set_hot_spots(Elm_Cursor *cur)
Evas_Coord cx, cy, cw, ch, x, y, w, h;
int prev_hot_x, prev_hot_y;
+ if (!cur->visible) return;
+
prev_hot_x = cur->hot_x;
prev_hot_y = cur->hot_y;
@@ -255,8 +274,6 @@ _elm_cursor_hot_change(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA
static Eina_Bool
_elm_cursor_obj_add(Evas_Object *obj, Elm_Cursor *cur)
{
- int x, y;
-
#ifdef HAVE_ELEMENTARY_WL2
const char *engine_name;
@@ -269,6 +286,8 @@ _elm_cursor_obj_add(Evas_Object *obj, Elm_Cursor *cur)
cur->obj = edje_object_add(cur->evas);
if (!cur->obj) return EINA_FALSE;
+ edje_object_freeze(cur->obj);
+ edje_object_update_hints_set(cur->obj, 1);
if (!elm_widget_theme_object_set(obj, cur->obj, "cursor", cur->cursor_name,
cur->style ? cur->style : "default"))
@@ -287,27 +306,40 @@ _elm_cursor_obj_add(Evas_Object *obj, Elm_Cursor *cur)
_elm_cursor_hot_change, cur);
evas_object_event_callback_add(cur->hotobj, EVAS_CALLBACK_RESIZE,
_elm_cursor_hot_change, cur);
- if (edje_object_part_exists(cur->obj, "elm.swallow.hotspot"))
- edje_object_part_swallow(cur->obj, "elm.swallow.hotspot", cur->hotobj);
- else if (edje_object_part_exists(cur->obj, "elm.content.hotspot"))
- edje_object_part_swallow(cur->obj, "elm.content.hotspot", cur->hotobj);
+
+ if (elm_widget_is_legacy(obj))
+ {
+ if (edje_object_part_exists(cur->obj, "elm.swallow.hotspot"))
+ edje_object_part_swallow(cur->obj, "elm.swallow.hotspot", cur->hotobj);
+ else if (edje_object_part_exists(cur->obj, "elm.content.hotspot"))
+ edje_object_part_swallow(cur->obj, "elm.content.hotspot", cur->hotobj);
+ else
+ {
+ ELM_SAFE_FREE(cur->hotobj, evas_object_del);
+ ELM_SAFE_FREE(cur->obj, evas_object_del);
+ return EINA_FALSE;
+ }
+ }
else
{
- ELM_SAFE_FREE(cur->hotobj, evas_object_del);
- ELM_SAFE_FREE(cur->obj, evas_object_del);
- return EINA_FALSE;
+ if (edje_object_part_exists(cur->obj, "efl.hotspot"))
+ edje_object_part_swallow(cur->obj, "efl.hotspot", cur->hotobj);
+ else if (edje_object_part_exists(cur->obj, "efl.content.hotspot"))
+ edje_object_part_swallow(cur->obj, "efl.content.hotspot", cur->hotobj);
+ else
+ {
+ ELM_SAFE_FREE(cur->hotobj, evas_object_del);
+ ELM_SAFE_FREE(cur->obj, evas_object_del);
+ return EINA_FALSE;
+ }
}
evas_object_event_callback_add(cur->obj, EVAS_CALLBACK_DEL,
_elm_cursor_obj_del, cur);
- edje_object_size_min_get(cur->obj, &x, &y);
- edje_object_size_min_restricted_calc(cur->obj, &x, &y, x, y);
- if ((x < 8) || (y < 8))
- {
- x = 8;
- y = 8;
- }
- evas_object_resize(cur->obj, x, y);
+ evas_object_event_callback_add(cur->obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ _elm_cursor_obj_hints, cur);
+ edje_object_thaw(cur->obj);
+
return EINA_TRUE;
}
@@ -640,7 +672,7 @@ elm_object_sub_cursor_set(Evas_Object *eventarea, Evas_Object *owner, const char
}
EOLIAN Eina_Bool
-_elm_widget_efl_ui_cursor_cursor_set(Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED,
+_efl_ui_widget_efl_ui_cursor_cursor_set(Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED,
const char *cursor)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
@@ -648,13 +680,19 @@ _elm_widget_efl_ui_cursor_cursor_set(Evas_Object *obj, Elm_Widget_Smart_Data *pd
return EINA_TRUE;
}
-EOLIAN const char *
-_elm_widget_efl_ui_cursor_cursor_get(const Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED)
+const char *
+elm_object_sub_cursor_get(const Evas_Object *obj)
{
ELM_CURSOR_GET_OR_RETURN(cur, obj, NULL);
return cur->cursor_name;
}
+EOLIAN const char *
+_efl_ui_widget_efl_ui_cursor_cursor_get(const Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED)
+{
+ return elm_object_sub_cursor_get(obj);
+}
+
EAPI void
elm_object_cursor_unset(Evas_Object *obj)
{
@@ -675,6 +713,8 @@ elm_object_cursor_unset(Evas_Object *obj)
{
evas_object_event_callback_del_full(cur->obj, EVAS_CALLBACK_DEL,
_elm_cursor_obj_del, cur);
+ evas_object_event_callback_del_full(cur->obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ _elm_cursor_obj_hints, cur);
ELM_SAFE_FREE(cur->obj, evas_object_del);
}
@@ -717,9 +757,8 @@ elm_object_cursor_unset(Evas_Object *obj)
free(cur);
}
-EOLIAN Eina_Bool
-_elm_widget_efl_ui_cursor_cursor_style_set(Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED,
- const char *style)
+Eina_Bool
+elm_object_sub_cursor_style_set(Evas_Object *obj, const char *style)
{
ELM_CURSOR_GET_OR_RETURN(cur, obj, EINA_FALSE);
@@ -753,13 +792,26 @@ _elm_widget_efl_ui_cursor_cursor_style_set(Evas_Object *obj, Elm_Widget_Smart_Da
return EINA_TRUE;
}
-EOLIAN const char *
-_elm_widget_efl_ui_cursor_cursor_style_get(const Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED)
+EOLIAN Eina_Bool
+_efl_ui_widget_efl_ui_cursor_cursor_style_set(Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED,
+ const char *style)
+{
+ return elm_object_sub_cursor_style_set(obj, style);
+}
+
+const char *
+elm_object_sub_cursor_style_get(const Evas_Object *obj)
{
ELM_CURSOR_GET_OR_RETURN(cur, obj, NULL);
return cur->style ? cur->style : "default";
}
+EOLIAN const char *
+_efl_ui_widget_efl_ui_cursor_cursor_style_get(const Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED)
+{
+ return elm_object_sub_cursor_style_get(obj);
+}
+
/**
* Notify cursor should recalculate its theme.
* @internal
@@ -775,9 +827,8 @@ elm_cursor_theme(Elm_Cursor *cur)
_elm_cursor_set_hot_spots(cur);
}
-EOLIAN Eina_Bool
-_elm_widget_efl_ui_cursor_cursor_theme_search_enabled_set(Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED,
- Eina_Bool theme_search)
+Eina_Bool
+elm_object_sub_cursor_theme_search_enabled_set(Evas_Object *obj, Eina_Bool theme_search)
{
ELM_CURSOR_GET_OR_RETURN(cur, obj, EINA_FALSE);
cur->theme_search = theme_search;
@@ -787,10 +838,23 @@ _elm_widget_efl_ui_cursor_cursor_theme_search_enabled_set(Evas_Object *obj, Elm_
}
EOLIAN Eina_Bool
-_elm_widget_efl_ui_cursor_cursor_theme_search_enabled_get(const Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED)
+_efl_ui_widget_efl_ui_cursor_cursor_theme_search_enabled_set(Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED,
+ Eina_Bool theme_search)
+{
+ return elm_object_sub_cursor_theme_search_enabled_set(obj, theme_search);
+}
+
+Eina_Bool
+elm_object_sub_cursor_theme_search_enabled_get(const Evas_Object *obj)
{
ELM_CURSOR_GET_OR_RETURN(cur, obj, EINA_FALSE);
return cur->theme_search;
}
+EOLIAN Eina_Bool
+_efl_ui_widget_efl_ui_cursor_cursor_theme_search_enabled_get(const Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED)
+{
+ return elm_object_sub_cursor_theme_search_enabled_get(obj);
+}
+
#include "efl_ui_cursor.eo.c"
diff --git a/src/lib/elementary/els_tooltip.c b/src/lib/elementary/els_tooltip.c
index 4eaea65cf7..3603221b4e 100644
--- a/src/lib/elementary/els_tooltip.c
+++ b/src/lib/elementary/els_tooltip.c
@@ -280,7 +280,11 @@ _elm_tooltip_hide_anim_start(Elm_Tooltip *tt)
TTDBG("HIDE START\n");
/* hide slightly faster when in window mode to look less stupid */
if ((tt->hide_timeout > 0) && tt->tt_win) extra = 0.1;
- edje_object_signal_emit(tt->tooltip, "elm,action,hide", "elm");
+
+ if (elm_widget_is_legacy(tt->owner))
+ edje_object_signal_emit(tt->tooltip, "elm,action,hide", "elm");
+ else
+ edje_object_signal_emit(tt->tooltip, "efl,action,hide", "efl");
tt->hide_timer = ecore_timer_add
(tt->hide_timeout - extra, _elm_tooltip_hide_anim_cb, tt);
}
@@ -290,7 +294,12 @@ _elm_tooltip_hide_anim_stop(Elm_Tooltip *tt)
{
if (!tt->hide_timer) return;
if (tt->tooltip)
- edje_object_signal_emit(tt->tooltip, "elm,action,show", "elm");
+ {
+ if (elm_widget_is_legacy(tt->owner))
+ edje_object_signal_emit(tt->tooltip, "elm,action,show", "elm");
+ else
+ edje_object_signal_emit(tt->tooltip, "efl,action,show", "efl");
+ }
ELM_SAFE_FREE(tt->hide_timer, ecore_timer_del);
}
@@ -426,6 +435,7 @@ _elm_tooltip_reconfigure(Elm_Tooltip *tt)
Evas_Coord eminw, eminh, ominw, ominh;
double rel_x = 0.0, rel_y = 0.0;
Eina_Bool inside_eventarea;
+ Eina_Bool new_content = EINA_FALSE;
_elm_tooltip_reconfigure_job_stop(tt);
@@ -435,8 +445,8 @@ _elm_tooltip_reconfigure(Elm_Tooltip *tt)
{
const char *style = tt->style ? tt->style : "default";
const char *str;
- if (!_elm_theme_object_set(tt->tt_win ? NULL : tt->owner, tt->tooltip,
- "tooltip", "base", style))
+ if (!_elm_theme_object_set(tt->tt_win ? : tt->owner, tt->tooltip,
+ "tooltip", NULL, style))
{
ERR("Could not apply the theme to the tooltip! style=%s", style);
if (tt->tt_win) evas_object_del(tt->tt_win);
@@ -490,10 +500,19 @@ _elm_tooltip_reconfigure(Elm_Tooltip *tt)
tt->changed_style = EINA_FALSE;
if (tt->tooltip)
- edje_object_part_swallow(tt->tooltip, "elm.swallow.content",
- tt->content);
+ {
+ if (elm_widget_is_legacy(tt->owner))
+ edje_object_part_swallow(tt->tooltip, "elm.swallow.content",
+ tt->content);
+ else
+ edje_object_part_swallow(tt->tooltip, "efl.content",
+ tt->content);
+ }
- edje_object_signal_emit(tt->tooltip, "elm,action,show", "elm");
+ if (elm_widget_is_legacy(tt->owner))
+ edje_object_signal_emit(tt->tooltip, "elm,action,show", "elm");
+ else
+ edje_object_signal_emit(tt->tooltip, "efl,action,show", "efl");
}
if (!tt->content)
@@ -518,10 +537,14 @@ _elm_tooltip_reconfigure(Elm_Tooltip *tt)
tt->tooltip = NULL;
return;
}
- edje_object_part_swallow
- (tt->tooltip, "elm.swallow.content", tt->content);
- evas_object_event_callback_add(tt->content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
- _elm_tooltip_content_changed_hints_cb, tt);
+
+ if (elm_widget_is_legacy(tt->owner))
+ edje_object_part_swallow
+ (tt->tooltip, "elm.swallow.content", tt->content);
+ else
+ edje_object_part_swallow
+ (tt->tooltip, "efl.content", tt->content);
+ new_content = EINA_TRUE;
evas_object_event_callback_add(tt->content, EVAS_CALLBACK_DEL,
_elm_tooltip_content_del_cb, tt);
@@ -530,6 +553,16 @@ _elm_tooltip_reconfigure(Elm_Tooltip *tt)
}
TTDBG("*******RECALC\n");
evas_object_size_hint_combined_min_get(tt->content, &ominw, &ominh);
+ /* force size hints to update */
+ if ((!ominw) || (!ominh))
+ {
+ evas_object_smart_need_recalculate_set(tt->content, 1);
+ evas_object_smart_calculate(tt->content);
+ evas_object_size_hint_combined_min_get(tt->content, &ominw, &ominh);
+ }
+ if (new_content)
+ evas_object_event_callback_add(tt->content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ _elm_tooltip_content_changed_hints_cb, tt);
edje_object_size_min_get(tt->tooltip, &eminw, &eminh);
if (eminw && (ominw < eminw)) ominw = eminw;
@@ -988,6 +1021,8 @@ elm_object_sub_tooltip_content_cb_set(Evas_Object *eventarea, Evas_Object *owner
tt->del_cb = del_cb;
if (!just_created) _elm_tooltip_reconfigure_job_start(tt);
+ else if (efl_canvas_pointer_inside_get(eventarea, NULL) && (!tt->tooltip))
+ _elm_tooltip_show(tt);
return;
error:
diff --git a/src/lib/elocation/Elocation.h b/src/lib/elocation/Elocation.h
index 60002c0384..6ebec636fa 100644
--- a/src/lib/elocation/Elocation.h
+++ b/src/lib/elocation/Elocation.h
@@ -39,15 +39,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ELOCATION_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ELOCATION_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -58,7 +58,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#ifdef EFL_BETA_API_SUPPORT
@@ -427,4 +427,7 @@ EAPI void elocation_shutdown(void);
#endif /* BETA API */
+#undef EAPI
+#define EAPI
+
#endif
diff --git a/src/lib/elput/Elput.h b/src/lib/elput/Elput.h
index db62c52d10..e38adf577d 100644
--- a/src/lib/elput/Elput.h
+++ b/src/lib/elput/Elput.h
@@ -1,33 +1,22 @@
#ifndef _ELPUT_H
# define _ELPUT_H
+# ifdef EFL_BETA_API_SUPPORT
+# include <Eina.h>
+
# ifdef EAPI
# undef EAPI
# endif
-# ifdef _WIN32
-# ifdef EFL_ELPUT_BUILD
-# ifdef DLL_EXPORT
-# define EAPI __declspec(dllexport)
-# else
-# define EAPI
-# endif /* ! DLL_EXPORT */
-# else
-# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ELPUT_BUILD */
-# else
-# ifdef __GNUC__
-# if __GNUC__ >= 4
-# define EAPI __attribute__ ((visibility("default")))
-# else
-# define EAPI
-# endif
+# ifdef __GNUC__
+# if __GNUC__ >= 4
+# define EAPI __attribute__ ((visibility("default")))
# else
# define EAPI
# endif
-# endif /* ! _WIN32 */
-
-# ifdef EFL_BETA_API_SUPPORT
+# else
+# define EAPI
+# endif
typedef enum
diff --git a/src/lib/elput/elput.c b/src/lib/elput/elput.c
index 503e5b57f0..3c51bca1ff 100644
--- a/src/lib/elput/elput.c
+++ b/src/lib/elput/elput.c
@@ -14,7 +14,6 @@ EAPI int ELPUT_EVENT_DEVICE_CHANGE = 0;
EAPI int ELPUT_EVENT_SESSION_ACTIVE = 0;
EAPI int ELPUT_EVENT_POINTER_MOTION = 0;
EAPI int ELPUT_EVENT_SWITCH = 0;
-EAPI int elput_event_session_ready = 0;
EAPI int
elput_init(void)
@@ -41,7 +40,6 @@ elput_init(void)
ELPUT_EVENT_SESSION_ACTIVE = ecore_event_type_new();
ELPUT_EVENT_POINTER_MOTION = ecore_event_type_new();
ELPUT_EVENT_SWITCH = ecore_event_type_new();
- elput_event_session_ready = ecore_event_type_new();
return _elput_init_count;
@@ -70,8 +68,7 @@ elput_shutdown(void)
ELPUT_EVENT_DEVICE_CHANGE,
ELPUT_EVENT_SESSION_ACTIVE,
ELPUT_EVENT_POINTER_MOTION,
- ELPUT_EVENT_SWITCH,
- elput_event_session_ready);
+ ELPUT_EVENT_SWITCH);
eina_log_domain_unregister(_elput_log_dom);
_elput_log_dom = -1;
diff --git a/src/lib/elput/elput_evdev.c b/src/lib/elput/elput_evdev.c
index 91bbbb2a81..635061a08c 100644
--- a/src/lib/elput/elput_evdev.c
+++ b/src/lib/elput/elput_evdev.c
@@ -606,16 +606,6 @@ process_key_press(xkb_keysym_t sym, Elput_Keyboard *kbd)
static void
_elput_symbol_rep_find(xkb_keysym_t keysym, char *buffer, int size, unsigned int code)
{
- int n = 0;
-
- n = xkb_keysym_to_utf8(keysym, buffer, size);
-
- /* check if we are a control code */
- if (n > 0 && !(
- (buffer[0] > 0x0 && buffer[0] < 0x20) || /* others 0x0 to 0x1F control codes */
- buffer[0] == 0x7F)) /*delete control code */
- return;
-
if (xkb_keysym_get_name(keysym, buffer, size) != 0)
return;
diff --git a/src/lib/elput/elput_input.c b/src/lib/elput/elput_input.c
index ed6f3f322d..06da3d0149 100644
--- a/src/lib/elput/elput_input.c
+++ b/src/lib/elput/elput_input.c
@@ -312,7 +312,7 @@ _process_events(Elput_Input *ei)
{
struct libinput_event *event;
- while ((event = libinput_get_event(ei->lib)))
+ while ((ei->lib) && (event = libinput_get_event(ei->lib)))
{
_process_event(event);
libinput_event_destroy(event);
@@ -326,7 +326,7 @@ _cb_input_dispatch(void *data, Ecore_Fd_Handler *hdlr EINA_UNUSED)
ei = data;
- if (libinput_dispatch(ei->lib) != 0)
+ if ((ei->lib) && (libinput_dispatch(ei->lib) != 0))
WRN("libinput failed to dispatch events");
_process_events(ei);
@@ -443,7 +443,7 @@ _elput_input_disable(Elput_Manager *manager)
EINA_LIST_FOREACH(manager->input.seats, l, seat)
seat->pending_motion = 1;
- libinput_suspend(manager->input.lib);
+ if (manager->input.lib) libinput_suspend(manager->input.lib);
_process_events(&manager->input);
manager->input.suspended = EINA_TRUE;
}
diff --git a/src/lib/elput/elput_logind.c b/src/lib/elput/elput_logind.c
index 842de225e8..82ce11ff16 100644
--- a/src/lib/elput/elput_logind.c
+++ b/src/lib/elput/elput_logind.c
@@ -523,15 +523,18 @@ _logind_connect(Elput_Manager **manager, const char *seat, unsigned int tty)
goto seat_err;
}
- if (!_logind_session_vt_get(em->sid, &em->vt_num))
+ if ((seat) && (!strcmp(seat, "seat0")))
{
- ERR("Could not get session vt");
- goto vt_err;
- }
- else if ((tty > 0) && (em->vt_num != tty))
- {
- ERR("Requested VT %u differs from session VT %u", tty, em->vt_num);
- goto vt_err;
+ if (!_logind_session_vt_get(em->sid, &em->vt_num))
+ {
+ ERR("Could not get session vt");
+ goto vt_err;
+ }
+ else if ((tty > 0) && (em->vt_num != tty))
+ {
+ ERR("Requested VT %u differs from session VT %u", tty, em->vt_num);
+ goto vt_err;
+ }
}
free(s);
diff --git a/src/lib/elua/Elua.h b/src/lib/elua/Elua.h
index 4c0f9cb3c5..2d13df5c77 100644
--- a/src/lib/elua/Elua.h
+++ b/src/lib/elua/Elua.h
@@ -23,15 +23,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ELUA_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ELUA_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -42,7 +42,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#ifdef __cplusplus
extern "C" {
diff --git a/src/lib/elua/elua.c b/src/lib/elua/elua.c
index 3f3654e678..baaed81721 100644
--- a/src/lib/elua/elua.c
+++ b/src/lib/elua/elua.c
@@ -1,6 +1,6 @@
-#include "elua_private.h"
-
+#include <limits.h>
#include <Ecore_File.h>
+#include "elua_private.h"
static Eina_Prefix *_elua_pfx = NULL;
@@ -70,7 +70,6 @@ EAPI Elua_State *
elua_state_new(const char *progname)
{
Elua_State *ret = NULL;
- Eina_Safepointer *sp;
lua_State *L = luaL_newstate();
if (!L)
return NULL;
@@ -78,10 +77,21 @@ elua_state_new(const char *progname)
ret->luastate = L;
if (progname) ret->progname = eina_stringshare_add(progname);
luaL_openlibs(L);
- sp = (Eina_Safepointer *)eina_safepointer_register(ret);
- ret->sp = sp;
- lua_pushlightuserdata(L, sp);
- lua_setfield(L, LUA_REGISTRYINDEX, "elua_ptr");
+ /* on 64-bit, split the state pointer into two and reconstruct later */
+ size_t retn = (size_t)ret;
+ if (sizeof(void *) < sizeof(lua_Number))
+ {
+ lua_pushnumber(L, 0);
+ lua_pushnumber(L, (lua_Number)retn);
+ }
+ else
+ {
+ size_t hbits = (sizeof(void *) / 2) * CHAR_BIT;
+ lua_pushnumber(L, (lua_Number)(retn >> hbits));
+ lua_pushnumber(L, (lua_Number)(retn & (((size_t)1 << hbits) - 1)));
+ }
+ lua_setfield(L, LUA_REGISTRYINDEX, "elua_ptr1");
+ lua_setfield(L, LUA_REGISTRYINDEX, "elua_ptr2");
return ret;
}
@@ -109,7 +119,6 @@ elua_state_free(Elua_State *es)
eina_stringshare_del(es->coredir);
eina_stringshare_del(es->moddir);
eina_stringshare_del(es->appsdir);
- eina_safepointer_unregister(es->sp);
free(es);
}
@@ -261,15 +270,18 @@ EAPI Elua_State *
elua_state_from_lua_state_get(lua_State *L)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(L, NULL);
- lua_getfield(L, LUA_REGISTRYINDEX, "elua_ptr");
- if (!lua_isnil(L, -1))
+ lua_getfield(L, LUA_REGISTRYINDEX, "elua_ptr1");
+ lua_getfield(L, LUA_REGISTRYINDEX, "elua_ptr2");
+ if (!lua_isnil(L, -1) && !lua_isnil(L, -2))
{
- Eina_Safepointer *sp = lua_touserdata(L, -1);
- void *st = eina_safepointer_get(sp);
- lua_pop(L, 1);
- return (Elua_State *)st;
+ size_t p1 = (size_t)lua_tonumber(L, -2),
+ p2 = (size_t)lua_tonumber(L, -1);
+ if (p2 && (sizeof(void *) >= sizeof(lua_Number)))
+ p1 |= p2 << ((sizeof(void *) / 2) * CHAR_BIT);
+ lua_pop(L, 2);
+ return (Elua_State *)p1;
}
- lua_pop(L, 1);
+ lua_pop(L, 2);
return NULL;
}
diff --git a/src/lib/elua/elua_private.h b/src/lib/elua/elua_private.h
index 1fd955c3ea..f4392f604b 100644
--- a/src/lib/elua/elua_private.h
+++ b/src/lib/elua/elua_private.h
@@ -40,7 +40,6 @@ struct _Elua_State
Eina_List *lmods;
Eina_List *cmods;
Eina_List *lincs;
- Eina_Safepointer *sp;
int requireref, apploadref;
};
diff --git a/src/lib/embryo/Embryo.h b/src/lib/embryo/Embryo.h
index fc358ef6e6..51d626b362 100644
--- a/src/lib/embryo/Embryo.h
+++ b/src/lib/embryo/Embryo.h
@@ -343,15 +343,15 @@ This is the @e only file you need to include.
#endif
#ifdef _WIN32
-# ifdef EFL_EMBRYO_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EMBRYO_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -362,7 +362,7 @@ This is the @e only file you need to include.
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#ifdef __cplusplus
extern "C" {
diff --git a/src/lib/emile/Emile.h b/src/lib/emile/Emile.h
index 03d8e53eb4..741905ef2f 100644
--- a/src/lib/emile/Emile.h
+++ b/src/lib/emile/Emile.h
@@ -27,7 +27,7 @@
#endif
#ifdef _WIN32
-# ifdef EFL_EMILE_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
diff --git a/src/lib/emile/emile_image.c b/src/lib/emile/emile_image.c
index 32722b722f..9f0a3ac18e 100644
--- a/src/lib/emile/emile_image.c
+++ b/src/lib/emile/emile_image.c
@@ -2391,6 +2391,8 @@ _emile_image_bind(Emile_Image *ei,
return ei;
/* File is not of that format */
+ if (!ei->bin_source)
+ eina_file_close(ei->source.f);
free(ei);
return NULL;
}
diff --git a/src/lib/emile/emile_main.c b/src/lib/emile/emile_main.c
index de96269872..4037c96e01 100644
--- a/src/lib/emile/emile_main.c
+++ b/src/lib/emile/emile_main.c
@@ -140,7 +140,10 @@ emile_pbkdf2_sha1(const char *key, unsigned int key_len, const unsigned char *sa
return EINA_FALSE;
step2 = eina_binbuf_manage_new(digest, 20, EINA_TRUE);
if (!step2)
- return EINA_FALSE;
+ {
+ eina_binbuf_free(step1);
+ return EINA_FALSE;
+ }
for (i = 1; len; len -= tmp_len, p += tmp_len, i++)
{
diff --git a/src/lib/emotion/Emotion.h b/src/lib/emotion/Emotion.h
index 6bd323453e..d7eef3c090 100644
--- a/src/lib/emotion/Emotion.h
+++ b/src/lib/emotion/Emotion.h
@@ -99,15 +99,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_EMOTION_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EMOTION_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -118,7 +118,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#ifdef __cplusplus
extern "C" {
diff --git a/src/lib/emotion/efl_canvas_video.eo b/src/lib/emotion/efl_canvas_video.eo
index f425b0ba13..b4f9647443 100644
--- a/src/lib/emotion/efl_canvas_video.eo
+++ b/src/lib/emotion/efl_canvas_video.eo
@@ -1,4 +1,4 @@
-class Efl.Canvas.Video (Efl.Canvas.Group, Efl.File, Efl.Player, Efl.Image, Efl.Image.Load)
+class Efl.Canvas.Video (Efl.Canvas.Group, Efl.File, Efl.Player, Efl.Gfx.Image, Efl.Gfx.Image_Load_Controller)
{
[[Efl canvas video class]]
methods {
@@ -53,39 +53,39 @@ class Efl.Canvas.Video (Efl.Canvas.Group, Efl.File, Efl.Player, Efl.Image, Efl.I
}
implements {
Efl.Object.constructor;
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set; }
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
Efl.File.file { get; set; }
Efl.Player.play { get; set; }
- Efl.Player.position { get; set; }
+ Efl.Player.pos { get; set; }
Efl.Player.progress { get; }
Efl.Player.volume { get; set; }
Efl.Player.mute { get; set; }
Efl.Player.length { get; }
Efl.Player.seekable { get; }
- Efl.Image.Load.load_size { get; }
- Efl.Image.ratio { get; }
- Efl.Image.smooth_scale { get; set; }
+ Efl.Gfx.Image_Load_Controller.load_size { get; }
+ Efl.Gfx.Image.ratio { get; }
+ Efl.Gfx.Image.smooth_scale { get; set; }
}
events {
- frame,decode; [[Called when the frame was decoded]]
- position,change; [[Called when the position changed]]
- length,change; [[Called when the length changed]]
- frame,resize; [[Called when the frame was resized]]
- playback,start; [[Called when playback started]]
- playback,stop; [[Called when playback stopped]]
- volume,change; [[Called when volume changed]]
- channels,change; [[Called when the channels changed]]
- title,change; [[Called when the title changed]]
- progress,change; [[Called when the progress changed]]
- ref,change; [[Called when ref changed]]
- button,num,change; [[Called when button number changed]]
- button,change; [[Called when button changed]]
- open,done; [[Called when the files was opened]]
- position,save,done; [[Called when the position was saved]]
- position,save,fail; [[Called when saving the position failed]]
- position,load,done; [[Called when the position loaded]]
- position,load,fail; [[Called when loading the position failed]]
+ frame,decode: void; [[Called when the frame was decoded]]
+ position,change: void; [[Called when the position changed]]
+ length,change: void; [[Called when the length changed]]
+ frame,resize: void; [[Called when the frame was resized]]
+ playback,start: void; [[Called when playback started]]
+ playback,stop: void; [[Called when playback stopped]]
+ volume,change: void; [[Called when volume changed]]
+ channels,change: void; [[Called when the channels changed]]
+ title,change: void; [[Called when the title changed]]
+ progress,change: void; [[Called when the progress changed]]
+ ref,change: void; [[Called when ref changed]]
+ button,num,change: void; [[Called when button number changed]]
+ button,change: void; [[Called when button changed]]
+ open,done: void; [[Called when the files was opened]]
+ position,save,done: void; [[Called when the position was saved]]
+ position,save,fail: void; [[Called when saving the position failed]]
+ position,load,done: void; [[Called when the position loaded]]
+ position,load,fail: void; [[Called when loading the position failed]]
}
}
diff --git a/src/lib/emotion/emotion_modules.c b/src/lib/emotion/emotion_modules.c
index 3aa0f0643f..a746f1d5dd 100644
--- a/src/lib/emotion/emotion_modules.c
+++ b/src/lib/emotion/emotion_modules.c
@@ -3,6 +3,7 @@
#endif
#include "emotion_private.h"
+#include "../../static_libs/buildsystem/buildsystem.h"
#include <unistd.h>
#ifdef EMOTION_STATIC_BUILD_XINE
@@ -92,9 +93,7 @@ _emotion_modules_load(void)
const char **itr;
for (itr = built_modules; *itr != NULL; itr++)
{
- snprintf(buf, sizeof(buf),
- "%s/src/modules/emotion/%s/.libs",
- PACKAGE_BUILD_DIR, *itr);
+ bs_mod_get(buf, sizeof(buf), "emotion", *itr);
_emotion_modules = eina_module_list_get(_emotion_modules, buf,
EINA_FALSE, NULL, NULL);
}
diff --git a/src/lib/emotion/emotion_modules.h b/src/lib/emotion/emotion_modules.h
index d5dd1dd6a2..8e41121796 100644
--- a/src/lib/emotion/emotion_modules.h
+++ b/src/lib/emotion/emotion_modules.h
@@ -8,15 +8,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_EMOTION_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EMOTION_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -27,7 +27,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#define META_TRACK_TITLE 1
#define META_TRACK_ARTIST 2
@@ -163,4 +163,7 @@ EAPI const char *emotion_webcam_custom_get(const char *device);
EAPI Eina_Bool _emotion_module_register(const Emotion_Engine *api);
EAPI Eina_Bool _emotion_module_unregister(const Emotion_Engine *api);
+#undef EAPI
+#define EAPI
+
#endif
diff --git a/src/lib/emotion/emotion_smart.c b/src/lib/emotion/emotion_smart.c
index 8feac862b1..d68b84bce4 100644
--- a/src/lib/emotion/emotion_smart.c
+++ b/src/lib/emotion/emotion_smart.c
@@ -69,7 +69,6 @@ struct _Efl_Canvas_Video_Data
Ecore_Job *job;
- Efl_Vpath_File *file_obj;
Emotion_Xattr_Data *xattr;
const char *title;
@@ -231,7 +230,7 @@ _clipper_position_size_update(Evas_Object *obj, int x, int y, int w, int h, int
EAPI Evas_Object *
emotion_object_add(Evas *evas)
{
- return efl_add(MY_CLASS, evas, efl_canvas_object_legacy_ctor(efl_added));
+ return efl_add(MY_CLASS, evas_find(evas), efl_canvas_object_legacy_ctor(efl_added));
}
EOLIAN static Eo *
@@ -363,7 +362,7 @@ _efl_canvas_video_efl_file_file_set(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *
sd->video.h = 0;
if ((file) && (file[0] != 0))
{
- const char *file2 = NULL;
+ char *file2 = NULL;
eina_stringshare_replace(&sd->file, file);
emotion_engine_instance_file_close(sd->engine_instance);
@@ -372,35 +371,17 @@ _efl_canvas_video_efl_file_file_set(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *
_emotion_image_data_zero(sd->obj);
sd->open = 0;
- if (sd->file_obj)
- {
- efl_del(sd->file_obj);
- sd->file_obj = NULL;
- }
if (file)
{
- sd->file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, file);
- efl_vpath_file_do(sd->file_obj);
- // XXX:FIXME: allow this to be async
- efl_vpath_file_wait(sd->file_obj);
- file2 = efl_vpath_file_result_get(sd->file_obj);
+ file2 = eina_vpath_resolve(file);
}
if (!emotion_engine_instance_file_open(sd->engine_instance, file2))
{
WRN("Couldn't open file=%s", sd->file);
- if (sd->file_obj)
- {
- efl_del(sd->file_obj);
- sd->file_obj = NULL;
- }
return EINA_FALSE;
}
- if ((sd->file_obj) && (!efl_vpath_file_keep_get(sd->file_obj)))
- {
- efl_del(sd->file_obj);
- sd->file_obj = NULL;
- }
+ free(file2);
DBG("successfully opened file=%s", sd->file);
sd->pos = 0.0;
if (sd->play) emotion_engine_instance_play(sd->engine_instance, 0.0);
@@ -431,7 +412,7 @@ emotion_object_file_get(const Evas_Object *obj)
}
EOLIAN static void
-_efl_canvas_video_efl_file_file_get(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd, const char **file, const char **key)
+_efl_canvas_video_efl_file_file_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd, const char **file, const char **key)
{
if (file) *file = sd->file;
if (key) *key = NULL;
@@ -667,7 +648,7 @@ emotion_object_play_get(const Evas_Object *obj)
}
EOLIAN static Eina_Bool
-_efl_canvas_video_efl_player_play_get(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd)
+_efl_canvas_video_efl_player_play_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd)
{
if (!sd->engine_instance) return EINA_FALSE;
return sd->play;
@@ -676,11 +657,11 @@ _efl_canvas_video_efl_player_play_get(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data
EAPI void
emotion_object_position_set(Evas_Object *obj, double sec)
{
- efl_player_position_set(obj, sec);
+ efl_player_pos_set(obj, sec);
}
EOLIAN static void
-_efl_canvas_video_efl_player_position_set(Eo *obj, Efl_Canvas_Video_Data *sd, double sec)
+_efl_canvas_video_efl_player_pos_set(Eo *obj, Efl_Canvas_Video_Data *sd, double sec)
{
DBG("sec=%f", sec);
if (!sd->engine_instance) return;
@@ -701,11 +682,11 @@ _efl_canvas_video_efl_player_position_set(Eo *obj, Efl_Canvas_Video_Data *sd, do
EAPI double
emotion_object_position_get(const Evas_Object *obj)
{
- return efl_player_position_get(obj);
+ return efl_player_pos_get(obj);
}
EOLIAN static double
-_efl_canvas_video_efl_player_position_get(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd)
+_efl_canvas_video_efl_player_pos_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd)
{
if (!sd->engine_instance) return 0.0;
sd->pos = emotion_engine_instance_pos_get(sd->engine_instance);
@@ -759,13 +740,13 @@ emotion_object_size_get(const Evas_Object *obj, int *iw, int *ih)
{
Eina_Size2D sz;
- sz = efl_image_load_size_get(obj);
+ sz = efl_gfx_image_load_controller_load_size_get(obj);
if (iw) *iw = sz.w;
if (ih) *ih = sz.h;
}
EOLIAN static Eina_Size2D
-_efl_canvas_video_efl_image_load_load_size_get(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd)
+_efl_canvas_video_efl_gfx_image_load_controller_load_size_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd)
{
// FIXME: Shouldn't this be efl_gfx_view_size instead?
return EINA_SIZE2D(sd->video.w, sd->video.h);
@@ -774,11 +755,11 @@ _efl_canvas_video_efl_image_load_load_size_get(Eo *obj EINA_UNUSED, Efl_Canvas_V
EAPI void
emotion_object_smooth_scale_set(Evas_Object *obj, Eina_Bool smooth)
{
- efl_image_smooth_scale_set(obj, smooth);
+ efl_gfx_image_smooth_scale_set(obj, smooth);
}
EOLIAN static void
-_efl_canvas_video_efl_image_smooth_scale_set(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd, Eina_Bool smooth)
+_efl_canvas_video_efl_gfx_image_smooth_scale_set(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd, Eina_Bool smooth)
{
evas_object_image_smooth_scale_set(sd->obj, smooth);
}
@@ -786,11 +767,11 @@ _efl_canvas_video_efl_image_smooth_scale_set(Eo *obj EINA_UNUSED, Efl_Canvas_Vid
EAPI Eina_Bool
emotion_object_smooth_scale_get(const Evas_Object *obj)
{
- return efl_image_smooth_scale_get(obj);
+ return efl_gfx_image_smooth_scale_get(obj);
}
EOLIAN static Eina_Bool
-_efl_canvas_video_efl_image_smooth_scale_get(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd)
+_efl_canvas_video_efl_gfx_image_smooth_scale_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd)
{
return evas_object_image_smooth_scale_get(sd->obj);
}
@@ -798,11 +779,11 @@ _efl_canvas_video_efl_image_smooth_scale_get(Eo *obj EINA_UNUSED, Efl_Canvas_Vid
EAPI double
emotion_object_ratio_get(const Evas_Object *obj)
{
- return efl_image_ratio_get(obj);
+ return efl_gfx_image_ratio_get(obj);
}
EOLIAN static double
-_efl_canvas_video_efl_image_ratio_get(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd)
+_efl_canvas_video_efl_gfx_image_ratio_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd)
{
if (!sd->engine_instance) return 0.0;
return sd->ratio;
@@ -842,7 +823,7 @@ emotion_object_audio_volume_get(const Evas_Object *obj)
}
EOLIAN static double
-_efl_canvas_video_efl_player_volume_get(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd)
+_efl_canvas_video_efl_player_volume_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd)
{
if (!sd->engine_instance) return 0.0;
return emotion_engine_instance_audio_channel_volume_get(sd->engine_instance);
@@ -869,7 +850,7 @@ emotion_object_audio_mute_get(const Evas_Object *obj)
}
EOLIAN static Eina_Bool
-_efl_canvas_video_efl_player_mute_get(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd)
+_efl_canvas_video_efl_player_mute_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd)
{
if (!sd->engine_instance) return EINA_FALSE;
return emotion_engine_instance_audio_channel_mute_get(sd->engine_instance);
@@ -1159,13 +1140,13 @@ emotion_object_progress_status_get(const Evas_Object *obj)
}
EOLIAN static double
-_efl_canvas_video_efl_player_progress_get(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd)
+_efl_canvas_video_efl_player_progress_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd)
{
return sd->progress.stat;
}
EOLIAN static double
-_efl_canvas_video_efl_player_length_get(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd)
+_efl_canvas_video_efl_player_length_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd)
{
if (!sd->engine_instance) return 0.0;
sd->len = emotion_engine_instance_len_get(sd->engine_instance);
@@ -1173,7 +1154,7 @@ _efl_canvas_video_efl_player_length_get(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Da
}
EOLIAN static Eina_Bool
-_efl_canvas_video_efl_player_seekable_get(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd)
+_efl_canvas_video_efl_player_seekable_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd)
{
if (!sd->engine_instance) return EINA_FALSE;
return emotion_engine_instance_seekable(sd->engine_instance);
@@ -1952,29 +1933,30 @@ _efl_canvas_video_efl_canvas_group_group_del(Evas_Object *obj EINA_UNUSED, Efl_C
sd->ref.file = NULL;
_xattr_data_unref(sd->xattr);
efl_canvas_group_del(efl_super(obj, MY_CLASS));
+ emotion_shutdown();
}
EOLIAN static void
-_efl_canvas_video_efl_gfx_position_set(Evas_Object *obj, Efl_Canvas_Video_Data *sd, Eina_Position2D pos)
+_efl_canvas_video_efl_gfx_entity_position_set(Evas_Object *obj, Efl_Canvas_Video_Data *sd, Eina_Position2D pos)
{
Eina_Size2D sz;
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
- efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
- sz = efl_gfx_size_get(obj);
+ sz = efl_gfx_entity_size_get(obj);
_clipper_position_size_update(obj, pos.x, pos.y, sz.w, sz.h, sd->video.w, sd->video.h);
}
EOLIAN static void
-_efl_canvas_video_efl_gfx_size_set(Evas_Object *obj, Efl_Canvas_Video_Data *sd, Eina_Size2D sz)
+_efl_canvas_video_efl_gfx_entity_size_set(Evas_Object *obj, Efl_Canvas_Video_Data *sd, Eina_Size2D sz)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
- efl_gfx_size_set(efl_super(obj, MY_CLASS), sz);
+ efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
_efl_canvas_video_aspect_border_apply(obj, sd, sz.w, sz.h);
evas_object_resize(sd->bg, sz.w, sz.h);
diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h
index 3ea20ec2ff..727ebde297 100644
--- a/src/lib/eo/Eo.h
+++ b/src/lib/eo/Eo.h
@@ -10,30 +10,34 @@
#define EOLIAN
-/* When used, this indicates that the function is an Eo API. */
-#define EOAPI EAPI EAPI_WEAK
-
#ifdef _WIN32
-# ifdef EFL_EO_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EO_BUILD */
+# endif
+# define EAPI_WEAK
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
# define EAPI __attribute__ ((visibility("default")))
+# define EAPI_WEAK __attribute__ ((weak))
# else
# define EAPI
+# define EAPI_WEAK
# endif
# else
# define EAPI
+# define EAPI_WEAK
# endif
-#endif /* ! _WIN32 */
+#endif
+
+/* When used, this indicates that the function is an Eo API. */
+#define EOAPI EAPI EAPI_WEAK
#ifdef __cplusplus
extern "C" {
@@ -144,8 +148,8 @@ extern "C" {
* EO_LIFECYCLE_NO_DEBUG=class1,class2.
*
* @verbatim
- # Log all but Efl_Future, Efl_Promise and Efl_Loop_Timer
- export EO_LIFECYCLE_NO_DEBUG=Efl_Future,Efl_Promise,Efl_Loop_Timer
+ # Log all but Efl_Loop_Timer
+ export EO_LIFECYCLE_NO_DEBUG=Efl_Loop_Timer
export EINA_LOG_LEVELS=eo_lifecycle:4
eo_debug my_app
* @endverbatim
@@ -210,12 +214,6 @@ EAPI extern unsigned int _efl_object_init_generation;
*/
typedef void (*Efl_Del_Intercept) (Eo *obj_id);
-/**
- * @typedef Efl_Future
- * The type of Efl Future used in asynchronous operation, the read side of a promise.
- */
-typedef Eo Efl_Future;
-
#include "efl_object_override.eo.h"
#include "efl_object.eo.h"
#include "efl_interface.eo.h"
@@ -241,10 +239,25 @@ typedef short Efl_Callback_Priority;
*/
typedef struct _Efl_Callback_Array_Item
{
- const Efl_Event_Description *desc; /**< The event description. */
- Efl_Event_Cb func; /**< The callback function. */
+ const Efl_Event_Description *desc; /**< The event description. */
+ Efl_Event_Cb func; /**< The callback function. */
} Efl_Callback_Array_Item;
+
+/**
+ * @struct _Efl_Callback_Array_Item_Full
+ * @brief An item provided by EFL_EVENT_CALLBACK_ADD/EFL_EVENT_CALLBACK_DEL.
+ *
+ * See also EFL_EVENT_CALLBACK_ADD EFL_EVENT_CALLBACK_DEL.
+ */
+typedef struct _Efl_Callback_Array_Item_Full
+{
+ const Efl_Event_Description *desc; /**< The event description. */
+ Efl_Callback_Priority priority; /** < The priorit of the event */
+ Efl_Event_Cb func; /**< The callback function. */
+ void *user_data; /**< The user data pointer to be passed to the func */
+} Efl_Callback_Array_Item_Full;
+
/**
* @brief Add a callback for an event with a specific priority.
*
@@ -331,15 +344,6 @@ EOAPI Eina_Bool efl_event_callback_call(Eo *obj, const Efl_Event_Description *de
*/
EOAPI Eina_Bool efl_event_callback_legacy_call(Eo *obj, const Efl_Event_Description *desc, void *event_info);
-/**
- * @brief Track a future life cycle and cancel it if the object dies.
- *
- * @param[in] link The future to link with the object
- *
- * @return @c true if it succeeds in setting up tracking.
- */
-EOAPI Eina_Bool efl_future_link(Eo *obj, Efl_Future *link);
-
/**
* @struct _Efl_Future_Cb_Desc
@@ -523,7 +527,7 @@ typedef struct _Efl_Future_Cb_Desc {
* @see #Efl_Future_Cb_Desc
* @see efl_key_data_set()
*/
-EOAPI Eina_Future_Desc efl_future_cb_from_desc(Eo *obj, const Efl_Future_Cb_Desc desc) EINA_ARG_NONNULL(1);
+EOAPI Eina_Future_Desc efl_future_cb_from_desc(const Eo *obj, const Efl_Future_Cb_Desc desc) EINA_ARG_NONNULL(1);
/**
* Syntax suger over efl_future_cb_from_desc()
@@ -1159,37 +1163,6 @@ typedef struct _Efl_Object_Op_Call_Data
void *extn4; // for future use to avoid ABI issues
} Efl_Object_Op_Call_Data;
-#define EFL_OBJECT_CALL_CACHE_SIZE 1
-
-typedef struct _Efl_Object_Call_Cache_Index
-{
- const void *klass;
-} Efl_Object_Call_Cache_Index;
-
-typedef struct _Efl_Object_Call_Cache_Entry
-{
- const void *func;
-} Efl_Object_Call_Cache_Entry;
-
-typedef struct _Efl_Object_Call_Cache_Off
-{
- int off;
-} Efl_Object_Call_Cache_Off;
-
-typedef struct _Efl_Object_Call_Cache
-{
-#if EFL_OBJECT_CALL_CACHE_SIZE > 0
- Efl_Object_Call_Cache_Index index[EFL_OBJECT_CALL_CACHE_SIZE];
- Efl_Object_Call_Cache_Entry entry[EFL_OBJECT_CALL_CACHE_SIZE];
- Efl_Object_Call_Cache_Off off [EFL_OBJECT_CALL_CACHE_SIZE];
-# if EFL_OBJECT_CALL_CACHE_SIZE > 1
- int next_slot;
-# endif
-#endif
- Efl_Object_Op op;
- unsigned int generation;
-} Efl_Object_Call_Cache;
-
// to pass the internal function call to EFL_FUNC_BODY (as Func parameter)
#define EFL_FUNC_CALL(...) __VA_ARGS__
@@ -1205,17 +1178,20 @@ typedef struct _Efl_Object_Call_Cache
# define EFL_FUNC_TLS __thread
#endif
+
// cache OP id, get real fct and object data then do the call
#define EFL_FUNC_COMMON_OP(Obj, Name, DefRet) \
- static EFL_FUNC_TLS Efl_Object_Call_Cache ___cache; /* static 0 by default */ \
+ static Efl_Object_Op ___op = 0; \
+ static unsigned int ___generation = 0; \
Efl_Object_Op_Call_Data ___call; \
_Eo_##Name##_func _func_; \
- if (EINA_UNLIKELY((___cache.op == EFL_NOOP) || \
- (___cache.generation != _efl_object_init_generation))) \
+ if (EINA_UNLIKELY((___op == EFL_NOOP) || \
+ (___generation != _efl_object_init_generation))) \
goto __##Name##_op_create; /* yes a goto - see below */ \
- __##Name##_op_create_done: \
- if (!_efl_object_call_resolve((Eo *) Obj, #Name, &___call, &___cache, \
- __FILE__, __LINE__)) goto __##Name##_failed; \
+ __##Name##_op_create_done: EINA_HOT; \
+ if (EINA_UNLIKELY(!_efl_object_call_resolve( \
+ (Eo *) Obj, #Name, &___call, ___op, __FILE__, __LINE__))) \
+ goto __##Name##_failed; \
_func_ = (_Eo_##Name##_func) ___call.func;
// This looks ugly with gotos BUT it moves rare "init" handling code
@@ -1227,13 +1203,12 @@ typedef struct _Efl_Object_Call_Cache
// of the cacheline that was already fetched should yield better cache
// hits.
#define EFL_FUNC_COMMON_OP_END(Obj, Name, DefRet, ErrorCase) \
-__##Name##_op_create: \
- if (EINA_UNLIKELY(___cache.op != EFL_NOOP)) memset(&___cache, 0, sizeof(___cache)); \
- ___cache.op = _efl_object_op_api_id_get(EFL_FUNC_COMMON_OP_FUNC(Name), Obj, #Name, __FILE__, __LINE__); \
- if (___cache.op == EFL_NOOP) goto __##Name##_failed; \
- ___cache.generation = _efl_object_init_generation; \
+__##Name##_op_create: EINA_COLD; \
+ ___op = _efl_object_op_api_id_get(EFL_FUNC_COMMON_OP_FUNC(Name), Obj, #Name, __FILE__, __LINE__); \
+ ___generation = _efl_object_init_generation; \
+ if (EINA_UNLIKELY(___op == EFL_NOOP)) goto __##Name##_failed; \
goto __##Name##_op_create_done; \
-__##Name##_failed: \
+__##Name##_failed: EINA_COLD; \
ErrorCase \
return DefRet;
#define _EFL_OBJECT_API_BEFORE_HOOK
@@ -1335,7 +1310,7 @@ EAPI Efl_Object_Op _efl_object_api_op_id_get(const void *api_func) EINA_DEPRECAT
EAPI Efl_Object_Op _efl_object_op_api_id_get(const void *api_func, const Eo *obj, const char *api_func_name, const char *file, int line) EINA_ARG_NONNULL(1, 2, 3, 4) EINA_WARN_UNUSED_RESULT;
// gets the real function pointer and the object data
-EAPI Eina_Bool _efl_object_call_resolve(Eo *obj, const char *func_name, Efl_Object_Op_Call_Data *call, Efl_Object_Call_Cache *callcache, const char *file, int line);
+EAPI Eina_Bool _efl_object_call_resolve(Eo *obj, const char *func_name, Efl_Object_Op_Call_Data *call, Efl_Object_Op op, const char *file, int line);
// end of the eo call barrier, unref the obj
EAPI void _efl_object_call_end(Efl_Object_Op_Call_Data *call);
@@ -1456,20 +1431,23 @@ EAPI Eo *_efl_added_get(void);
/**
* @def efl_add
- * @brief Create a new object and call its constructor (If it exists).
+ * @brief Create a new object and add it to an existing parent object.
*
* The object returned by this function will always have 1 ref
- * (reference count) irrespective of whether the parent is NULL or
- * not.
+ * (reference count) which belongs to its parent. Therefore, it is not safe
+ * to use the returned object outside the constructor methods passed as
+ * parameters. If you need to further manipulate the object, use #efl_add_ref
+ * and remember to #efl_unref the object when done.
+ *
* If the object is created using this function, then it will
* automatically be deleted when the parent object is.
* There is no need to call efl_unref on the child. This is convenient
* in C.
*
- * If you want a more "consistent" behaviour, see #efl_add_ref.
+ * If the object's class has a constructor, it is called.
*
- * @param klass the class of the object to create.
- * @param parent the parent to set to the object.
+ * @param klass The class of the object to create.
+ * @param parent The parent to set to the object (MUST not be @c NULL)
* @param ... The ops to run.
* @return An handle to the new object on success, NULL otherwise.
*/
@@ -1477,24 +1455,58 @@ EAPI Eo *_efl_added_get(void);
/**
* @def efl_add_ref
- * @brief Create a new object and call its constructor (If it exists).
+ * @brief Create a new object, add it to an existing parent object and return
+ * an extra reference for further manipulation.
+ *
+ * The object returned by this function has 1 ref which belongs to the caller.
+ * If a parent object is provided (@c parent is not @c NULL) then the object
+ * has an additional reference for the parent. Note that if a child object is
+ * created in this way then it won't get automatically deleted with the parent.
+ * You need to manually remove the extra ref by calling #efl_unref.
*
- * The object returned by this function has 1 ref for itself, 1 ref from the
- * parent (if exists) and possible other refs if were added during construction.
- * If a child object is created using this, then it won't get deleted
- * when the parent object is until you manually remove the ref
- * by calling efl_unref().
+ * If the object's class has a constructor, it is called.
*
- * @param klass the class of the object to create.
- * @param parent the parent to set to the object.
+ * @param klass The class of the object to create.
+ * @param parent The parent to set to the object (can be @c NULL).
* @param ... The ops to run.
* @return An handle to the new object on success, NULL otherwise.
*/
#define efl_add_ref(klass, parent, ...) _efl_add_common(klass, parent, EINA_TRUE, ##__VA_ARGS__)
+/**
+ * @def efl_new
+ * @brief Create a new object
+ *
+ * The object returned by this function has 1 ref which belongs to the caller.
+ * You need to manually remove the ref by calling #efl_unref when you are done
+ * working with the object. The object will be destroyed when all other refs
+ * obtained with #efl_ref have been returned with #efl_unref.
+ *
+ * If the object's class has a constructor, it is called.
+ *
+ * @param klass The class of the object to create.
+ * @param ... The ops to run.
+ * @return An handle to the new object on success, NULL otherwise.
+ */
+#define efl_new(klass, ...) efl_add_ref(klass, NULL, ##__VA_ARGS__)
+
EAPI Eo * _efl_add_internal_start(const char *file, int line, const Efl_Class *klass_id, Eo *parent, Eina_Bool ref, Eina_Bool is_fallback);
/**
+ * @brief Unrefs the object and reparents it to NULL.
+ *
+ * Because efl_del() unrefs and reparents to NULL, it doesn't really delete the
+ * object.
+ *
+ * This method accepts a const object for convenience, so all objects can be
+ * passed to it easily.
+ * @param[in] obj The object.
+ *
+ * @ingroup Efl_Object
+ */
+EAPI void efl_del(const Eo *obj);
+
+/**
* @brief Get a pointer to the data of an object for a specific class.
*
* The data reference count is not incremented. The pointer must be used only
@@ -2061,7 +2073,7 @@ static inline void
efl_replace(Eo **storage, Eo *new_obj)
{
if (!storage || *storage == new_obj) return;
- efl_ref(new_obj);
+ if (new_obj) efl_ref(new_obj);
efl_unref(*storage);
*storage = new_obj;
}
@@ -2072,6 +2084,7 @@ EOAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_OBJECT;
* @brief Create a new #Eina_Value containing the passed parameter.
* @param obj The object to use
* @return The #Eina_Value
+ * @see eina_value_object_get(), eina_value_object_init()
* @since 1.21
*/
static inline Eina_Value *
@@ -2088,6 +2101,7 @@ eina_value_object_new(Eo *obj)
* @brief Create a new #Eina_Value initialized with the passed parameter
* @param obj The object to use
* @return The #Eina_Value
+ * @see eina_value_object_new(), eina_value_object_get()
* @since 1.21
*/
static inline Eina_Value
@@ -2101,10 +2115,40 @@ eina_value_object_init(Eo *obj)
}
/**
- * @}
+ * @brief Get the object contained in an #Eina_Value
+ * @param v The #Eina_Value to extract the object from
+ * @return The object.
+ * @see eina_value_object_new(), eina_value_object_init()
+ * @since 1.21
*/
+static inline Eo *
+eina_value_object_get(Eina_Value *v)
+{
+ Eo *r = NULL;
-#include "efl_future.h"
+ if (!v) return NULL;
+ if (eina_value_type_get(v) != EINA_VALUE_TYPE_OBJECT)
+ return NULL;
+
+ eina_value_pget(v, &r);
+ return r;
+}
+
+/**
+ * @brief Event triggered when a callback was added to the object
+ */
+#define EFL_EVENT_CALLBACK_ADD (&(_EFL_EVENT_CALLBACK_ADD))
+EAPI extern const Efl_Event_Description _EFL_EVENT_CALLBACK_ADD;
+
+/**
+ * @brief Event triggered when a callback was removed from the object
+ */
+#define EFL_EVENT_CALLBACK_DEL (&(_EFL_EVENT_CALLBACK_DEL))
+EAPI extern const Efl_Event_Description _EFL_EVENT_CALLBACK_DEL;
+
+/**
+ * @}
+ */
/**
* @addtogroup Eo_Iterators Eo iterators
@@ -2137,12 +2181,6 @@ EAPI Eina_Iterator *eo_objects_iterator_new(void);
* @}
*/
-
- /* Private for EFL internal use only. Do not use these! */
-EAPI int ___efl_ref2_count(const Eo *obj_id);
-EAPI void ___efl_ref2_reset(const Eo *obj_id);
-EAPI void ___efl_auto_unref_set(Eo *obj_id, Eina_Bool val);
-
#endif
#ifdef __cplusplus
@@ -2152,4 +2190,7 @@ EAPI void ___efl_auto_unref_set(Eo *obj_id, Eina_Bool val);
#undef EAPI
#define EAPI
+#undef EOAPI
+#define EOAPI
+
#endif
diff --git a/src/lib/eo/efl_future.c b/src/lib/eo/efl_future.c
deleted file mode 100644
index 4da24f5e82..0000000000
--- a/src/lib/eo/efl_future.c
+++ /dev/null
@@ -1,60 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <Eina.h>
-
-#include "eina_internal.h"
-
-#include "Eo.h"
-
-// Efl.Future implementation is an opaque type in Ecore.
-EOAPI const Efl_Event_Description _EFL_FUTURE_EVENT_FAILURE =
- EFL_EVENT_DESCRIPTION("future,failure");
-EOAPI const Efl_Event_Description _EFL_FUTURE_EVENT_SUCCESS =
- EFL_EVENT_DESCRIPTION("future,success");
-EOAPI const Efl_Event_Description _EFL_FUTURE_EVENT_PROGRESS =
- EFL_EVENT_DESCRIPTION("future,progress");
-
-EOAPI EFL_FUNC_BODYV(efl_future_then, Efl_Future *, 0, EFL_FUNC_CALL(success, failure, progress, data), Efl_Event_Cb success, Efl_Event_Cb failure, Efl_Event_Cb progress, const void *data);
-EOAPI EFL_VOID_FUNC_BODY(efl_future_cancel);
-
-static Eina_Bool
-_efl_future_class_initializer(Efl_Class *klass)
-{
- EFL_OPS_DEFINE(ops,
- EFL_OBJECT_OP_FUNC(efl_future_then, NULL),
- EFL_OBJECT_OP_FUNC(efl_future_cancel, NULL));
-
- return efl_class_functions_set(klass, &ops, NULL);
-}
-
-static const Efl_Class_Description _efl_future_class_desc = {
- EO_VERSION,
- "Efl.Future",
- EFL_CLASS_TYPE_REGULAR_NO_INSTANT,
- 0,
- _efl_future_class_initializer,
- NULL,
- NULL
-};
-
-EFL_DEFINE_CLASS(efl_future_class_get, &_efl_future_class_desc, EFL_OBJECT_CLASS, NULL);
-
-static const char EINA_ERROR_FUTURE_CANCEL_STR[] = "Future cancelled";
-EAPI Eina_Error EINA_ERROR_FUTURE_CANCEL;
-
-Eina_Bool
-efl_future_init(void)
-{
- EINA_ERROR_FUTURE_CANCEL = eina_error_msg_static_register(EINA_ERROR_FUTURE_CANCEL_STR);
-
- return EINA_TRUE;
-}
-
-Eina_Bool
-efl_future_shutdown(void)
-{
- __eina_promise_cancel_all();
- return EINA_TRUE;
-}
diff --git a/src/lib/eo/efl_future.h b/src/lib/eo/efl_future.h
deleted file mode 100644
index 34c5d2dcaf..0000000000
--- a/src/lib/eo/efl_future.h
+++ /dev/null
@@ -1,142 +0,0 @@
-#ifndef EFL_FUTURE_H_
-# define EFL_FUTURE_H_
-
-/**
- * @addtogroup Efl_Future Efl future and promise.
- * @{
- */
-
-/**
- * @typedef Efl_Promise
- * The type of Efl Promise used in asynchronous operation, the write side of a promise.
- */
-typedef Eo Efl_Promise;
-#define _EFL_PROMISE_EO_CLASS_TYPE
-
-#define EFL_FUTURE_CLASS efl_future_class_get()
-EWAPI const Efl_Class *efl_future_class_get(void); /**< @since 1.19 */
-
-/**
- * @var EINA_ERROR_FUTURE_CANCEL
- * @brief The error identifier corresponding to a future being canceled.
- */
-EAPI extern Eina_Error EINA_ERROR_FUTURE_CANCEL; /**< @since 1.19 */
-
-/** Parameter passed in event callbacks in case of future failure to proceed.
- *
- * @ingroup Efl_Future
- */
-typedef struct _Efl_Future_Event_Failure Efl_Future_Event_Failure;
-struct _Efl_Future_Event_Failure
-{
- Efl_Promise *next; /** The promise to the next future. Allowing to send a processed value down the chain. */
- Eina_Error error; /** The error generated trying to process the request. */
-};
-
-/** Parameter passed in event callbacks in case of future succeeding to proceed.
- *
- * @ingroup Efl_Future
- */
-typedef struct _Efl_Future_Event_Success Efl_Future_Event_Success;
-struct _Efl_Future_Event_Success
-{
- Efl_Promise *next; /** The promise to the next future. Allowing to send a processed value down the chain. */
- void *value; /** The value return by the processed request. The type is defined by the function executing the request. */
-};
-
-/** Parameter passed in event callbacks while a future is progressing a request.
- *
- * @ingroup Efl_Future
- */
-typedef struct _Efl_Future_Event_Progress Efl_Future_Event_Progress;
-struct _Efl_Future_Event_Progress
-{
- Efl_Promise *next; /** The promise to the next future. Allowing to send a processed progress down the chain. */
- const void *progress; /** The progress status updated by the processed request. The type is defined by the function executing the request. */
-};
-
-EOAPI extern const Efl_Event_Description _EFL_FUTURE_EVENT_FAILURE;
-EOAPI extern const Efl_Event_Description _EFL_FUTURE_EVENT_SUCCESS;
-EOAPI extern const Efl_Event_Description _EFL_FUTURE_EVENT_PROGRESS;
-
-/** A future failed
- *
- * @ingroup Efl_Future
- */
-#define EFL_FUTURE_EVENT_FAILURE (&(_EFL_FUTURE_EVENT_FAILURE))
-
-/** A future succeeded
- *
- * @ingroup Efl_Future
- */
-#define EFL_FUTURE_EVENT_SUCCESS (&(_EFL_FUTURE_EVENT_SUCCESS))
-
-/** A future progressed
- *
- * @ingroup Efl_Future
- */
-#define EFL_FUTURE_EVENT_PROGRESS (&(_EFL_FUTURE_EVENT_PROGRESS))
-
-/**
- * @brief Add sets of callbacks to handle the progress and the result of a future.
- *
- * callbacks are called depending on the outcome of the promise related to the future.
- *
- * @param[in] success the callback to call in case of a succesful computation from the promise
- * @param[in] failure the callback to call in case of a failure to deliver from the promise
- * @param[in] progress the callback to call during the progression of the the promise, this is optional
- * @param[in] data additional data to pass to the callback
- *
- * @return Return a new future when the callback has been successfully added pointing to the next request
- * being processed during the future success, failure or progress callback (You can reference count the next
- * promise to defer the result and make it asynchronous too. This future can be ignored.
- *
- * @note except if you do reference count the Efl.Future object, you can only call once this function.
- *
- * @ingroup Efl_Future
- */
-EOAPI Efl_Future *efl_future_then(Eo *obj, Efl_Event_Cb success, Efl_Event_Cb failure, Efl_Event_Cb progress, const void *data);
-
-/**
- * @brief Cancel the need for that specific future.
- *
- * This will trigger the failure of the future and may result in the promise stopping its computation as
- * it will be notified when there is no more need for computing the request.
- *
- * @see efl_future_use
- *
- * @ingroup Efl_Future
- *
- * @since 1.19
- */
-EOAPI void efl_future_cancel(Eo *obj);
-
-/**
- * @brief To be used in conjunction with when you plan to use efl_future_cancel
- *
- * This function will store in *wref, obj and make sure that on failure or success of the future, it
- * will be reset to NULL. This guarantee that the pointer you are using will always be correct and
- * that you do not have to worry about passing a dead pointer to efl_future_cancel.
- *
- * @param[out] storage Will be set to obj and tracked during all the lifetime of the future.
- * @param[in] future The future to remember about.
- *
- * @see efl_future_cancel
- *
- * @ingroup Efl_Future
- */
-static inline void
-efl_future_use(Efl_Future **storage, Eo *future)
-{
- efl_wref_add(future, storage);
-}
-
-/**
- * @}
- */
-
-/**
- * @}
- */
-
-#endif
diff --git a/src/lib/eo/efl_object.eo b/src/lib/eo/efl_object.eo
index 7de713e5be..97a9489c30 100644
--- a/src/lib/eo/efl_object.eo
+++ b/src/lib/eo/efl_object.eo
@@ -1,6 +1,6 @@
import eina_types;
-struct Efl.Event.Description {
+struct Efl.Event_Description {
[[This struct holds the description of a specific event.]]
name: string; [[name of the event.]]
unfreezable: bool; [[$true if the event cannot be frozen.]]
@@ -39,15 +39,6 @@ abstract Efl.Object ()
parent: Efl.Object @nullable; [[The new parent]]
}
}
- del @const {
- [[Unrefs the object and reparents it to NULL.
-
- Because efl_del() unrefs and reparents to NULL, it doesn't really delete the object.
-
- This method accepts a const object for convenience, so all objects
- can be passed to it easily.
- ]]
- }
@property name {
[[ The name of the object.
@@ -130,6 +121,14 @@ abstract Efl.Object ()
finalized: bool; [[$true if the object is finalized, $false otherwise]]
}
}
+ @property invalidated {
+ [[True if the object is already invalidated, otherwise false.]]
+ get {
+ }
+ values {
+ finalized: bool; [[$true if the object is invalidated, $false otherwise]]
+ }
+ }
provider_find @const {
[[Searches upwards in the object tree for a provider which knows the given class/interface.
@@ -155,13 +154,23 @@ abstract Efl.Object ()
destructor {
[[Call the object's destructor.
- Should not be used with #eo_do. Only use it with #eo_do_super.
+ Should not be used with #efl_do. Only use it with #efl_do_super.
+ Will be triggered once #invalidate and #noref have been triggered.
]]
}
finalize {
[[Called at the end of efl_add. Should not be called, just overridden.]]
return: Efl.Object; [[The new object created, can be NULL if aborting]]
}
+ invalidate {
+ [[Called when parent reference is lost/set to $NULL and switch the state of the object to invalidate.]]
+ }
+ noref {
+ [[Triggered when no reference are keeping the object alive.
+
+ The parent can be the last one keeping an object alive and so $noref can happen before $invalidate
+ as it is only impacted by the ref/unref of the object.]]
+ }
name_find @const {
[[Find a child object with the given name and return it.
@@ -212,14 +221,14 @@ abstract Efl.Object ()
event_callback_forwarder_add {
[[Add an event callback forwarder for an event and an object.]]
params {
- @cref desc: Efl.Event.Description; [[The description of the event to listen to]]
+ @cref desc: Efl.Event_Description; [[The description of the event to listen to]]
@in new_obj: Efl.Object; [[The object to emit events from]]
}
}
event_callback_forwarder_del {
[[Remove an event callback forwarder for an event and an object.]]
params {
- @cref desc: Efl.Event.Description; [[The description of the event to listen to]]
+ @cref desc: Efl.Event_Description; [[The description of the event to listen to]]
@in new_obj: Efl.Object; [[The object to emit events from]]
}
}
@@ -285,9 +294,12 @@ abstract Efl.Object ()
class.destructor;
}
events {
- callback,add @hot; [[A callback was added.]]
- callback,del @hot; [[A callback was deleted.]]
- del @hot; [[Object is being deleted.]]
+ del @hot: void; [[Object is being deleted.]]
+ invalidate @hot: void; [[Object is being invalidated and loosing its parent.]]
+ noref @hot: void; [[Object has lost its last reference, only parent relationship is keeping it alive.]]
+ destruct @hot: void; [[Object has been fully destroyed. It can not be used
+ beyond this point. This event should only serve to clean up any
+ dangling pointer.]]
}
}
@@ -297,6 +309,6 @@ struct Efl.Event {
This is the full event information passed to callbacks in C.
]]
object: Efl.Object; [[The object the callback was called on.]]
- desc: const(ptr(Efl.Event.Description)); [[The event description.]]
+ desc: const(ptr(Efl.Event_Description)); [[The event description.]]
info: void_ptr; [[Extra event information passed by the event caller]]
}
diff --git a/src/lib/eo/efl_object_override.eo b/src/lib/eo/efl_object_override.eo
index 4d2074b6e2..01bf0837cb 100644
--- a/src/lib/eo/efl_object_override.eo
+++ b/src/lib/eo/efl_object_override.eo
@@ -1,4 +1,4 @@
-abstract Efl.Object.Override ()
+abstract Efl.Object_Override ()
{
[[A special class to pass to #eo_super() when using #eo_override()
diff --git a/src/lib/eo/eina_types.eot b/src/lib/eo/eina_types.eot
index fc0fca09cc..95b4ee611d 100644
--- a/src/lib/eo/eina_types.eot
+++ b/src/lib/eo/eina_types.eot
@@ -78,5 +78,27 @@ struct @extern Eina.Rw_Slice {
}
struct @extern Eina.Value.Type; [[Eina value type]]
-struct @extern Eina.Future; [[Eina_Future handle]]
-struct @extern Eina.Promise; [[Eina_Promise handle]]
+
+struct @extern Eina.Stat {
+ [[The structure to store some file statistics.]]
+ dev : ulong; [[The device where this file is located]]
+ ino : ulong; [[The inode]]
+ mode : uint; [[The mode]]
+ nlink : uint; [[The link number]]
+ uid : uint; [[The owner user id]]
+ gid : uint; [[The owner group id]]
+ rdev : ulong; [[The remote device]]
+ size : ulong; [[The file size in bytes]]
+ blksize : ulong; [[The block size in bytes]]
+ blocks : ulong; [[The number of blocks allocated]]
+ atime : ulong; [[The tilestamp when the file was last accessed]]
+ atimensec: ulong; [[The nano version of the timestmap when the file was last accessed]]
+ mtime : ulong; [[The tilestamp when the file was modified]]
+ mtimensec: ulong; [[The nano version of the timestmap when the file was modified]]
+ ctime : ulong; [[The tilestamp when the file was created]]
+ ctimensec: ulong; [[The nano version of the timestmap when the file was created]]
+}
+
+/* FIXME: This definitely shouldn't be here. */
+type Efl.Event_Cb: __undefined_type; [[Efl event callback type]]
+
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index d421c58bc8..3fb7fd6639 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -21,6 +21,8 @@
#include "eo_private.h"
#include "eo_add_fallback.h"
+#include "eo_internal.h"
+
#include "efl_object_override.eo.c"
#ifdef HAVE_EXECINFO_H
#include <execinfo.h>
@@ -40,6 +42,8 @@ EAPI Eina_Lock _efl_class_creation_lock;
EAPI unsigned int _efl_object_init_generation = 1;
int _eo_log_dom = -1;
Eina_Thread _efl_object_main_thread;
+static unsigned int efl_del_api_generation = 0;
+static Efl_Object_Op _efl_del_api_op_id = 0;
typedef enum _Eo_Ref_Op {
EO_REF_OP_NONE,
@@ -101,6 +105,8 @@ static inline void *_efl_data_xref_internal(const char *file, int line, _Eo_Obje
static inline void _efl_data_xunref_internal(_Eo_Object *obj, void *data, const _Eo_Object *ref_obj);
static void _vtable_init(Eo_Vtable *vtable, size_t size);
+static inline Efl_Object_Op _efl_object_api_op_id_get_internal(const void *api_func);
+
/* Start of Dich */
@@ -439,31 +445,29 @@ efl_cast(const Eo *eo_id, const Efl_Class *cur_klass)
}
EAPI Eina_Bool
-_efl_object_call_resolve(Eo *eo_id, const char *func_name, Efl_Object_Op_Call_Data *call, Efl_Object_Call_Cache *cache, const char *file, int line)
+_efl_object_call_resolve(Eo *eo_id, const char *func_name, Efl_Object_Op_Call_Data *call, Efl_Object_Op op, const char *file, int line)
{
- const _Efl_Class *klass, *inputklass, *main_klass;
+ const _Efl_Class *klass, *main_klass;
const _Efl_Class *cur_klass = NULL;
_Eo_Object *obj = NULL;
const Eo_Vtable *vtable = NULL;
const op_type_funcs *func;
Eina_Bool is_obj;
- Eina_Bool is_override = EINA_FALSE;
Eina_Bool super = EINA_TRUE;
- if (EINA_UNLIKELY(!eo_id)) return EINA_FALSE;
+ if (EINA_UNLIKELY(!eo_id)) goto on_null;
call->eo_id = eo_id;
is_obj = _eo_is_a_obj(eo_id);
- if (is_obj)
+ if (EINA_LIKELY(is_obj == EINA_TRUE))
{
EO_OBJ_POINTER_RETURN_VAL_PROXY(eo_id, _obj, EINA_FALSE);
obj = _obj;
klass = _obj->klass;
vtable = EO_VTABLE(obj);
- is_override = _obj_is_override(obj);
if (EINA_UNLIKELY(_obj->cur_klass != NULL))
{
// YES this is a goto with a label to return. this is a
@@ -485,9 +489,7 @@ obj_super_back:
}
ok_klass_back:
- inputklass = main_klass = klass;
-
- if (!cache->op) goto err_cache_op;
+ main_klass = klass;
/* If we have a current class, we need to itr to the next. */
if (cur_klass)
@@ -499,30 +501,7 @@ ok_klass_back:
}
else
{
-# if EFL_OBJECT_CALL_CACHE_SIZE > 0
- if (!is_override)
- {
-# if EFL_OBJECT_CALL_CACHE_SIZE > 1
- int i;
-
- for (i = 0; i < EFL_OBJECT_CALL_CACHE_SIZE; i++)
-# else
- const int i = 0;
-# endif
- {
- if ((const void *)inputklass == cache->index[i].klass)
- {
- func = (const op_type_funcs *)cache->entry[i].func;
- call->func = func->func;
- if (is_obj)
- call->data = (char *)obj + cache->off[i].off;
- if (EINA_UNLIKELY(!call->func)) goto err_cache_op;
- return EINA_TRUE;
- }
- }
- }
-#endif
- func = _vtable_func_get(vtable, cache->op);
+ func = _vtable_func_get(vtable, op);
// this is not very likely to happen - but may if its an invalid
// call or a composite object, but either way, it's not very likely
// so make it a goto to save on instruction cache
@@ -536,22 +515,6 @@ ok_cur_klass_back:
if (is_obj) call->data = _efl_data_scope_get(obj, func->src);
-# if EFL_OBJECT_CALL_CACHE_SIZE > 0
- if (!cur_klass && !is_override)
- {
-# if EFL_OBJECT_CALL_CACHE_SIZE > 1
- const int slot = cache->next_slot;
-# else
- const int slot = 0;
-# endif
- cache->index[slot].klass = (const void *)inputklass;
- cache->entry[slot].func = (const void *)func;
- cache->off[slot].off = (int)((long)((char *)call->data - (char *)obj));
-# if EFL_OBJECT_CALL_CACHE_SIZE > 1
- cache->next_slot = (slot + 1) % EFL_OBJECT_CALL_CACHE_SIZE;
-# endif
- }
-#endif
return EINA_TRUE;
}
@@ -570,7 +533,7 @@ end:
EO_OBJ_POINTER_PROXY(emb_obj_id, emb_obj);
if (EINA_UNLIKELY(!emb_obj)) continue;
- func = _vtable_func_get(EO_VTABLE(emb_obj), cache->op);
+ func = _vtable_func_get(EO_VTABLE(emb_obj), op);
if (func == NULL) goto composite_continue;
if (EINA_LIKELY(func->func && func->src))
@@ -594,7 +557,7 @@ composite_continue:
if (cur_klass)
{
ERR("in %s:%d: func '%s' (%d) could not be resolved for class '%s' for super of '%s'.",
- file, line, func_name, cache->op, main_klass->desc->name,
+ file, line, func_name, op, main_klass->desc->name,
cur_klass->desc->name);
goto err;
}
@@ -602,17 +565,13 @@ composite_continue:
{
/* we should not be able to take this branch */
ERR("in %s:%d: func '%s' (%d) could not be resolved for class '%s'.",
- file, line, func_name, cache->op, main_klass->desc->name);
+ file, line, func_name, op, main_klass->desc->name);
goto err;
}
-err_cache_op:
- ERR("%s:%d: unable to resolve %s api func '%s' in class '%s'.",
- file, line, (!is_obj ? "class" : "regular"),
- func_name, klass->desc->name);
- goto err;
+
err_func_src:
ERR("in %s:%d: you called a pure virtual func '%s' (%d) of class '%s'.",
- file, line, func_name, cache->op, klass->desc->name);
+ file, line, func_name, op, klass->desc->name);
err:
if (is_obj)
{
@@ -629,7 +588,7 @@ err:
// yes - special "move out of hot path" code blobs with goto's for
// speed reasons to have intr prefetches work better and miss less
ok_cur_klass:
- func = _eo_kls_itr_next(klass, cur_klass, cache->op, super);
+ func = _eo_kls_itr_next(klass, cur_klass, op, super);
if (!func) goto end;
klass = func->src;
goto ok_cur_klass_back;
@@ -661,13 +620,22 @@ obj_super:
cur_klass = NULL;
}
- is_override = _obj_is_override(obj) && (cur_klass == NULL);
}
goto obj_super_back;
err_klass:
_EO_POINTER_ERR(eo_id, "in %s:%d: func '%s': obj_id=%p is an invalid ref.", file, line, func_name, eo_id);
return EINA_FALSE;
+
+on_null:
+ if (EINA_UNLIKELY(efl_del_api_generation != _efl_object_init_generation))
+ {
+ _efl_del_api_op_id = _efl_object_api_op_id_get_internal(EFL_FUNC_COMMON_OP_FUNC(efl_del));
+ efl_del_api_generation = _efl_object_init_generation;
+ }
+ if (op != _efl_del_api_op_id)
+ WRN("NULL passed to function %s().", func_name);
+ return EINA_FALSE;
}
EAPI void
@@ -838,7 +806,9 @@ _eo_class_funcs_set(Eo_Vtable *vtable, const Efl_Object_Ops *ops, const _Efl_Cla
op_id++;
}
+#ifdef EO_DEBUG
DBG("%p->%p '%s'", op_desc->api_func, op_desc->func, _eo_op_desc_name_get(op_desc));
+#endif
if (!_vtable_func_set(vtable, klass, override_class, op, op_desc->func, EINA_TRUE))
return EINA_FALSE;
@@ -890,7 +860,7 @@ err_klass:
}
EAPI Eo *
-_efl_add_internal_start(const char *file, int line, const Efl_Class *klass_id, Eo *parent_id, Eina_Bool ref EINA_UNUSED, Eina_Bool is_fallback)
+_efl_add_internal_start(const char *file, int line, const Efl_Class *klass_id, Eo *parent_id, Eina_Bool ref, Eina_Bool is_fallback)
{
const char *func_name = __FUNCTION__;
_Eo_Object *obj;
@@ -900,6 +870,11 @@ _efl_add_internal_start(const char *file, int line, const Efl_Class *klass_id, E
EO_CLASS_POINTER_GOTO_PROXY(klass_id, klass, err_klass);
+ // Check that in the case of efl_add we do pass a parent.
+ if (!ref && !parent_id)
+ ERR("Creation of '%s' object at line %i in '%s' is done without parent. This should use efl_add_ref.",
+ klass->desc->name, line, file);
+
if (parent_id)
{
EO_OBJ_POINTER_GOTO_PROXY(parent_id, parent, err_parent);
@@ -923,7 +898,7 @@ _efl_add_internal_start(const char *file, int line, const Efl_Class *klass_id, E
eina_spinlock_release(&klass->objects.trash_lock);
obj->opt = eina_cow_alloc(efl_object_optional_cow);
- obj->refcount++;
+ _efl_ref(obj);
obj->klass = klass;
obj->header.id = _eo_id_allocate(obj, parent_id);
@@ -936,7 +911,7 @@ _efl_add_internal_start(const char *file, int line, const Efl_Class *klass_id, E
efl_ref(eo_id);
/* Reference for the parent if is_ref is done in _efl_add_end */
- efl_parent_set(eo_id, parent_id);
+ if (parent_id) efl_parent_set(eo_id, parent_id);
/* eo_id can change here. Freeing is done on the resolved object. */
eo_id = efl_constructor(eo_id);
@@ -952,10 +927,12 @@ ok_nomatch_back:
ok_nomatch:
{
EO_OBJ_POINTER_GOTO_PROXY(eo_id, new_obj, err_newid);
- /* We have two refs at this point. */
- _efl_unref(obj);
- efl_del((Eo *)obj->header.id);
_efl_ref(new_obj);
+ efl_ref(eo_id);
+ /* We might have two refs on the old object at this point. */
+ efl_parent_set((Eo *) obj->header.id, NULL);
+ efl_unref(_eo_obj_id_get(obj));
+ _efl_unref(obj);
EO_OBJ_DONE(eo_id);
}
goto ok_nomatch_back;
@@ -963,9 +940,10 @@ ok_nomatch:
err_noid:
ERR("in %s:%d: Object of class '%s' - Error while constructing object",
file, line, klass->desc->name);
- /* We have two refs at this point. */
+ /* We might have two refs at this point. */
+ efl_parent_set((Eo *) obj->header.id, NULL);
+ efl_unref(_eo_obj_id_get(obj));
_efl_unref(obj);
- efl_del((Eo *) obj->header.id);
err_newid:
if (parent_id) EO_OBJ_DONE(parent_id);
return NULL;
@@ -1015,8 +993,9 @@ err_condtor:
klass->desc->name);
}
cleanup:
+ efl_parent_set((Eo *) obj->header.id, NULL);
+ efl_unref((Eo *) obj->header.id);
_efl_unref(obj);
- efl_del((Eo *) obj->header.id);
EO_OBJ_DONE(eo_id);
return NULL;
}
@@ -1028,13 +1007,9 @@ _efl_add_end(Eo *eo_id, Eina_Bool is_ref, Eina_Bool is_fallback)
Eo *ret = efl_finalize(eo_id);
ret = _efl_add_internal_end(eo_id, ret);
- if (is_ref)
+ if (ret && !is_ref)
{
- if (efl_parent_get(eo_id))
- {
- efl_ref(eo_id);
- }
- _efl_object_parent_sink_set(eo_id, EINA_TRUE);
+ efl_unref(ret);
}
if (is_fallback)
@@ -1052,8 +1027,7 @@ efl_reuse(const Eo *eo_id)
EO_OBJ_POINTER_RETURN(obj, _obj);
efl_object_override(obj, NULL);
- if (!efl_parent_get(obj))
- _efl_object_parent_sink_set(obj, EINA_FALSE);
+ _efl_object_reuse(_obj);
#ifdef EO_DEBUG
_eo_log_obj_ref_op(_obj, EO_REF_OP_REUSE);
@@ -1324,6 +1298,8 @@ _eo_class_constructor(_Efl_Class *klass)
{
klass->constructed = EINA_TRUE;
+ klass->construction_thread = eina_thread_self();
+
if (klass->desc->class_constructor)
klass->desc->class_constructor(_eo_class_id_get(klass));
}
@@ -1332,6 +1308,12 @@ static void
eo_class_free(_Efl_Class *klass)
{
void *data;
+ Eina_Thread self = eina_thread_self();
+
+ if ((self != _efl_object_main_thread) &&
+ (self != klass->construction_thread))
+ CRI("Calling class deconstructor from thread that did not call constructor and is not main thread!\n"
+ "This will probably crash!");
if (klass->constructed)
{
@@ -1383,10 +1365,16 @@ static inline void
_eo_classes_release(void)
{
#ifdef HAVE_MMAP
- size_t size;
+# ifdef HAVE_VALGRIND
+ if (RUNNING_ON_VALGRIND) free(_eo_classes);
+ else
+# endif
+ {
+ size_t size;
- size = _eo_classes_alloc * sizeof(_Efl_Class *);
- if (_eo_classes) munmap(_eo_classes, size);
+ size = _eo_classes_alloc * sizeof(_Efl_Class *);
+ if (_eo_classes) munmap(_eo_classes, size);
+ }
#else
free(_eo_classes);
#endif
@@ -1405,17 +1393,33 @@ _eo_classes_expand(void)
if (_eo_classes_last_id <= _eo_classes_alloc) return;
psize = _eo_classes_alloc * sizeof(_Efl_Class *);
#ifdef HAVE_MMAP
- _eo_classes_alloc += (MEM_PAGE_SIZE / sizeof(_Efl_Class *));
- newsize = _eo_classes_alloc * sizeof(_Efl_Class *);
- ptr = mmap(NULL, newsize, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_ANON, -1, 0);
- if (ptr == MAP_FAILED)
+# ifdef HAVE_VALGRIND
+ if (RUNNING_ON_VALGRIND)
{
- ERR("mmap of eo class table region failed!");
- abort();
+ _eo_classes_alloc += 128;
+ newsize = _eo_classes_alloc * sizeof(_Efl_Class *);
+ ptr = realloc(_eo_classes, newsize);
+ if (!ptr)
+ {
+ ERR("realloc of eo class table region faile!!");
+ abort();
+ }
+ }
+ else
+# endif
+ {
+ _eo_classes_alloc += (MEM_PAGE_SIZE / sizeof(_Efl_Class *));
+ newsize = _eo_classes_alloc * sizeof(_Efl_Class *);
+ ptr = mmap(NULL, newsize, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANON, -1, 0);
+ if (ptr == MAP_FAILED)
+ {
+ ERR("mmap of eo class table region failed!");
+ abort();
+ }
+ if (psize > 0) memcpy(ptr, _eo_classes, psize);
+ if (_eo_classes) munmap(_eo_classes, psize);
}
- if (psize > 0) memcpy(ptr, _eo_classes, psize);
- if (_eo_classes) munmap(_eo_classes, psize);
#else
_eo_classes_alloc += 128;
newsize = _eo_classes_alloc * sizeof(_Efl_Class *);
@@ -1785,19 +1789,19 @@ efl_isa(const Eo *eo_id, const Efl_Class *klass_id)
}
return isa;
-err_shared_class:
+err_shared_class: EINA_COLD
_EO_POINTER_ERR(klass_id, "Class (%p) is an invalid ref.", klass_id);
EO_OBJ_DONE(eo_id);
-err_shared_obj:
+err_shared_obj: EINA_COLD
eina_lock_release(&(_eo_table_data_shared_data->obj_lock));
return EINA_FALSE;
-err_class:
+err_class: EINA_COLD
_EO_POINTER_ERR(klass_id, "Class (%p) is an invalid ref.", klass_id);
err_obj:
return EINA_FALSE;
-err:
+err: EINA_COLD
ERR("Object %p is not a valid object in this context: object domain: %d, "
"current domain: %d, local domain: %d, available domains: [%s %s %s %s]."
" Are you trying to access this object from another thread?",
@@ -1883,11 +1887,41 @@ efl_unref(const Eo *obj_id)
{
EO_OBJ_POINTER_RETURN(obj_id, obj);
+ if (EINA_UNLIKELY((!obj->unref_compensate && obj->user_refcount == 1 && obj->parent) ||
+ (obj->unref_compensate && obj->user_refcount == 2 && obj->parent)))
+ {
+ if (!obj->allow_parent_unref)
+ CRI("Calling efl_unref instead of efl_del or efl_parent_set(NULL). Temporary fallback in place triggered.");
+ EO_OBJ_DONE(obj_id);
+ efl_del(obj_id);
+ return ;
+ }
+
+ _efl_ref(obj);
+
+ if (EINA_UNLIKELY((!obj->unref_compensate) &&
+ ((obj->user_refcount == 1 && !obj->parent) ||
+ (obj->user_refcount == 2 && obj->parent))))
+ {
+ // We need to report efl_ref_count correctly during efl_noref, so fake it
+ // by adjusting efl_ref_count while inside efl_unref (This should avoid
+ // infinite loop)
+ obj->unref_compensate = EINA_TRUE;
+
+ // The noref event should happen before any object in the
+ // tree get affected by the change in refcount.
+ efl_event_callback_call((Eo *) obj_id, EFL_EVENT_NOREF, NULL);
+ efl_noref((Eo *) obj_id);
+
+ obj->unref_compensate = EINA_FALSE;
+ }
+
--(obj->user_refcount);
+
#ifdef EO_DEBUG
_eo_log_obj_ref_op(obj, EO_REF_OP_UNREF);
#endif
- if (EINA_UNLIKELY(obj->user_refcount <= 0))
+ if (EINA_UNLIKELY((obj->user_refcount <= 0)))
{
if (obj->user_refcount < 0)
{
@@ -1895,10 +1929,12 @@ efl_unref(const Eo *obj_id)
obj->klass->desc->name, obj_id, obj->user_refcount);
_eo_log_obj_report((Eo_Id)obj_id, EINA_LOG_LEVEL_ERR, __FUNCTION__, __FILE__, __LINE__);
EO_OBJ_DONE(obj_id);
+ _efl_unref(obj);
return;
}
_efl_unref(obj);
}
+ _efl_unref(obj);
EO_OBJ_DONE(obj_id);
}
@@ -1907,7 +1943,7 @@ efl_ref_count(const Eo *obj_id)
{
EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, 0);
int ref;
- ref = obj->user_refcount;
+ ref = obj->user_refcount - (obj->unref_compensate ? 1 : 0);
EO_OBJ_DONE(obj_id);
return ref;
}
@@ -2238,8 +2274,6 @@ efl_object_init(void)
EO_FREED_EINA_MAGIC_STR);
eina_magic_string_static_set(EO_CLASS_EINA_MAGIC,
EO_CLASS_EINA_MAGIC_STR);
- efl_future_init();
-
#ifndef _WIN32
_ops_storage = eina_hash_pointer_new(NULL);
#else
@@ -2289,6 +2323,8 @@ efl_object_init(void)
/* bootstrap EFL_CLASS_CLASS */
(void) EFL_CLASS_CLASS;
+ /* bootstrap EFL_OBJECT_CLASS */
+ (void) EFL_OBJECT_CLASS;
return EINA_TRUE;
}
@@ -2302,14 +2338,28 @@ efl_object_shutdown(void)
if (--_efl_object_init_count > 0)
return EINA_TRUE;
+#ifdef EO_DEBUG
+ {
+ Efl_Object *obj;
+ Eina_Iterator *objects;
+ objects = eo_objects_iterator_new();
+ printf("Objects leaked by EO:\n");
+ printf("class@pointer - user-refcount internal-refcount\n");
+ EINA_ITERATOR_FOREACH(objects, obj)
+ {
+ printf("%s@%p - %d %d \n", efl_class_name_get(obj), obj, efl_ref_count(obj), ___efl_ref2_count(obj));
+ }
+ eina_iterator_free(objects);
+ }
+#endif
+
+
eina_log_timing(_eo_log_dom,
EINA_LOG_STATE_START,
EINA_LOG_STATE_SHUTDOWN);
_efl_add_fallback_shutdown();
- efl_future_shutdown();
-
for (i = 0 ; i < _eo_classes_last_id ; i++, cls_itr--)
{
if (*cls_itr)
@@ -3087,10 +3137,10 @@ _eo_log_obj_init(void)
s = getenv("EO_LIFECYCLE_DEBUG");
if ((s) && (s[0] != '\0'))
{
- int lvl = 1;
-
+ char *es;
+ int lvl = (int)strtol(s, &es, 10);
_eo_log_objs_level = EO_REF_OP_FREE;
- if (sscanf(s, "%d:%*s", &lvl) == 1)
+ if ((es != s) && (*es == ':'))
{
if (lvl >= 3)
{
@@ -3104,7 +3154,7 @@ _eo_log_obj_init(void)
EINA_LOG_DOM_DBG(_eo_log_objs_dom,
"will log new, free, ref and unref");
}
- s = strchr(s, ':') + 1;
+ s = es + 1;
}
if ((strcmp(s, "*") == 0) || (strcmp(s, "1") == 0))
@@ -3394,8 +3444,8 @@ static Eina_Bool
_eo_value_vset(const Eina_Value_Type *type EINA_UNUSED, void *mem, va_list args)
{
Eo **dst = mem;
- Eo **src = va_arg(args, Eo **);
- efl_replace(dst, *src);
+ Eo *src = va_arg(args, Eo *);
+ efl_replace(dst, src);
return EINA_TRUE;
}
@@ -3438,13 +3488,25 @@ _eo_value_convert_to(const Eina_Value_Type *type EINA_UNUSED, const Eina_Value_T
return EINA_FALSE;
}
+static Eina_Bool
+_eo_value_copy(const Eina_Value_Type *type EINA_UNUSED, const void *mem, void *ptr)
+{
+ Eo * const *src = mem;
+ Eo **dst = ptr;
+
+ if (!src || !dst) return EINA_FALSE;
+ *dst = efl_ref(*src);
+
+ return EINA_TRUE;
+}
+
static const Eina_Value_Type _EINA_VALUE_TYPE_OBJECT = {
.version = EINA_VALUE_TYPE_VERSION,
.value_size = sizeof(Eo *),
.name = "Efl_Object",
.setup = _eo_value_setup,
.flush = _eo_value_flush,
- .copy = NULL,
+ .copy = _eo_value_copy,
.compare = NULL,
.convert_to = _eo_value_convert_to,
.convert_from = NULL,
diff --git a/src/lib/eo/eo_add_fallback.c b/src/lib/eo/eo_add_fallback.c
index c38a827b28..f3a82f25d6 100644
--- a/src/lib/eo/eo_add_fallback.c
+++ b/src/lib/eo/eo_add_fallback.c
@@ -2,6 +2,11 @@
# include <config.h>
#endif
+#ifdef HAVE_VALGRIND
+# include <valgrind.h>
+# include <memcheck.h>
+#endif
+
#if defined HAVE_DLADDR && ! defined _WIN32
# include <dlfcn.h>
#endif
@@ -32,20 +37,26 @@ static void *
_eo_call_stack_mem_alloc(size_t size)
{
#ifdef HAVE_MMAP
- // allocate eo call stack via mmped anon segment if on linux - more
- // secure and safe. also gives page aligned memory allowing madvise
- void *ptr;
- size_t newsize;
- newsize = MEM_PAGE_SIZE * ((size + MEM_PAGE_SIZE - 1) /
- MEM_PAGE_SIZE);
- ptr = mmap(NULL, newsize, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_ANON, -1, 0);
- if (ptr == MAP_FAILED)
+# ifdef HAVE_VALGRIND
+ if (RUNNING_ON_VALGRIND) return calloc(1, size);
+ else
+# endif
{
- ERR("eo call stack mmap failed.");
- return NULL;
+ // allocate eo call stack via mmped anon segment if on linux - more
+ // secure and safe. also gives page aligned memory allowing madvise
+ void *ptr;
+ size_t newsize;
+ newsize = MEM_PAGE_SIZE * ((size + MEM_PAGE_SIZE - 1) /
+ MEM_PAGE_SIZE);
+ ptr = mmap(NULL, newsize, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANON, -1, 0);
+ if (ptr == MAP_FAILED)
+ {
+ ERR("eo call stack mmap failed.");
+ return NULL;
+ }
+ return ptr;
}
- return ptr;
#else
//in regular cases just use malloc
return calloc(1, size);
@@ -56,6 +67,10 @@ static void
_eo_call_stack_mem_free(void *ptr, size_t size)
{
#ifdef HAVE_MMAP
+# ifdef HAVE_VALGRIND
+ if (RUNNING_ON_VALGRIND) free(ptr);
+ else
+# endif
munmap(ptr, size);
#else
(void) size;
diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index e5d932addc..5acc70bca2 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -5,13 +5,22 @@
#include <Eina.h>
#include <fnmatch.h>
-#include "Eo.h"
+#include <Eo.h>
+
+#include "eo_internal.h"
+
#include "eo_ptr_indirection.h"
#include "eo_private.h"
#include "eina_promise_private.h"
#define EFL_EVENT_SPECIAL_SKIP 1
+EAPI const Efl_Event_Description _EFL_EVENT_CALLBACK_ADD =
+ EFL_EVENT_DESCRIPTION_HOT("callback,add");
+
+EAPI const Efl_Event_Description _EFL_EVENT_CALLBACK_DEL =
+ EFL_EVENT_DESCRIPTION_HOT("callback,del");
+
static int event_freeze_count = 0;
typedef struct _Eo_Callback_Description Eo_Callback_Description;
@@ -32,10 +41,9 @@ typedef struct
Eo *composite_parent;
Eina_Inlist *generic_data;
Eo ***wrefs;
- Eina_List *futures;
} Efl_Object_Extension;
-typedef struct
+struct _Efl_Object_Data
{
Eina_Inlist *children;
Eo *parent;
@@ -54,12 +62,13 @@ typedef struct
unsigned short event_cb_efl_event_callback_add_count;
unsigned short event_cb_efl_event_callback_del_count;
unsigned short event_cb_efl_event_del_count;
+ unsigned short event_cb_efl_event_noref_count;
#endif
Eina_Bool callback_stopped : 1;
Eina_Bool need_cleaning : 1;
- Eina_Bool parent_sunk : 1; // If parent ref has already been settled (parent has been set, or we are in add_ref mode
Eina_Bool allow_parent_unref : 1; // Allows unref to zero even with a parent
-} Efl_Object_Data;
+ Eina_Bool has_destroyed_event_cb : 1; // No proper count: minor optimization triggered at destruction only
+};
typedef enum
{
@@ -85,7 +94,7 @@ typedef struct
typedef struct _Efl_Future_Pending
{
EINA_INLIST;
- Eo *o;
+ const Eo *o;
Eina_Future *future;
Efl_Future_Cb_Desc desc;
} Efl_Future_Pending;
@@ -108,6 +117,83 @@ typedef struct
static int _eo_nostep_alloc = -1;
+static void
+_efl_pending_futures_clear(Efl_Object_Data *pd)
+{
+ while (pd->pending_futures)
+ {
+ Efl_Future_Pending *pending = EINA_INLIST_CONTAINER_GET(pd->pending_futures, Efl_Future_Pending);
+ Eina_Future *future = *pending->desc.storage;
+ assert(future);
+ eina_future_cancel(future);
+ }
+}
+
+static void
+_efl_object_invalidate(Eo *obj_id, Efl_Object_Data *pd)
+{
+ _efl_pending_futures_clear(pd);
+
+ EO_OBJ_POINTER(obj_id, obj);
+
+ // Finally invalidate itself if it wasn't done already
+ // I am not sure this is a good idea, but it force the
+ // behavior of calling directly efl_invalidate to be the
+ // same as efl_parent_set(NULL).
+ if (!obj->is_invalidating)
+ efl_parent_set(obj_id, NULL);
+
+ EO_OBJ_DONE(obj_id);
+}
+
+// Generate the invalidate event in all case and make sure it happens
+// before any user code can change the children invalidate state. This
+// make sure that the entire tree of object is valid at the time of
+// the invalidate event.
+void
+_efl_invalidate(_Eo_Object *obj)
+{
+ Eina_Array stash = { 0 };
+ Efl_Object_Data *pd;
+ _Eo_Object *child;
+ Eo *id;
+
+ if (obj->is_invalidating) return ;
+ obj->is_invalidating = EINA_TRUE;
+ if (obj->invalidate) return;
+
+ id = _eo_obj_id_get(obj);
+
+ efl_event_callback_call(id, EFL_EVENT_INVALIDATE, NULL);
+
+ pd = efl_data_scope_get(id, EFL_OBJECT_CLASS);
+
+ efl_invalidate(id);
+
+ eina_array_step_set(&stash, sizeof (stash), 4);
+
+ // Invalidate all children too
+ EINA_INLIST_FOREACH(pd->children, child)
+ eina_array_push(&stash, _efl_ref(child));
+
+ while ((child = eina_array_pop(&stash)))
+ {
+ Eo *child_id = _eo_obj_id_get(child);
+
+ efl_parent_set(child_id, NULL);
+ _efl_unref(child);
+ }
+
+ eina_array_flush(&stash);
+
+ obj->invalidate = EINA_TRUE;
+}
+
+static void
+_efl_object_noref(Eo *obj EINA_UNUSED, Efl_Object_Data *pd EINA_UNUSED)
+{
+}
+
static inline void
_efl_object_extension_free(Efl_Object_Extension *ext)
{
@@ -130,8 +216,7 @@ _efl_object_extension_noneed(Efl_Object_Data *pd)
(ext->comment) ||
(ext->generic_data) ||
(ext->wrefs) ||
- (ext->composite_parent) ||
- (ext->futures)) return;
+ (ext->composite_parent)) return;
_efl_object_extension_free(pd->ext);
pd->ext = NULL;
}
@@ -146,10 +231,12 @@ _eo_generic_data_node_free(Eo_Generic_Data_Node *node)
case DATA_PTR:
break;
case DATA_OBJ:
+ // FIXME: should this use "destruct" event instead?
efl_event_callback_del(node->d.obj, EFL_EVENT_DEL, _key_generic_cb_del, node);
efl_unref(node->d.obj);
break;
case DATA_OBJ_WEAK:
+ // FIXME: should this use "destruct" event instead?
efl_event_callback_del(node->d.obj, EFL_EVENT_DEL, _key_generic_cb_del, node);
break;
case DATA_VAL:
@@ -397,7 +484,7 @@ _efl_object_name_set(Eo *obj EINA_UNUSED, Efl_Object_Data *pd, const char *name)
}
EOLIAN static const char *
-_efl_object_name_get(Eo *obj EINA_UNUSED, Efl_Object_Data *pd)
+_efl_object_name_get(const Eo *obj EINA_UNUSED, Efl_Object_Data *pd)
{
if (!pd->ext) return NULL;
return pd->ext->name;
@@ -578,7 +665,7 @@ _efl_object_comment_set(Eo *obj EINA_UNUSED, Efl_Object_Data *pd, const char *co
}
EOLIAN static const char *
-_efl_object_comment_get(Eo *obj EINA_UNUSED, Efl_Object_Data *pd)
+_efl_object_comment_get(const Eo *obj EINA_UNUSED, Efl_Object_Data *pd)
{
if (!pd->ext) return NULL;
return pd->ext->comment;
@@ -589,35 +676,65 @@ _efl_object_debug_name_override(Eo *obj_id EINA_UNUSED, Efl_Object_Data *pd EINA
{
}
-EOLIAN static void
-_efl_object_del(const Eo *obj, Efl_Object_Data *pd EINA_UNUSED)
+EAPI void
+efl_del(const Eo *obj)
{
+ if (!obj) return ;
+ EO_OBJ_POINTER_RETURN(obj, oid);
+ _efl_ref(oid);
if (efl_parent_get((Eo *) obj))
{
efl_parent_set((Eo *) obj, NULL);
}
else
{
+ ERR("Calling efl_del on an object with no parent is not advised any more.");
efl_unref(obj);
}
+ _efl_unref(oid);
+ EO_OBJ_DONE(obj);
}
void
-_efl_object_parent_sink_set(Eo *obj, Eina_Bool sink)
+_efl_object_reuse(_Eo_Object *obj)
{
- Efl_Object_Data *pd = efl_data_scope_get(obj, EFL_OBJECT_CLASS);
- pd->parent_sunk = sink;
+ obj->is_invalidating = EINA_FALSE;
+ obj->invalidate = EINA_FALSE;
}
-EOLIAN static void
+EOLIAN void
_efl_object_parent_set(Eo *obj, Efl_Object_Data *pd, Eo *parent_id)
{
Eo *prev_parent = pd->parent;
+ Eina_Bool bad_parent = EINA_FALSE;
+
if ((pd->parent == parent_id) ||
((parent_id) && (!_eo_id_domain_compatible(parent_id, obj))))
return;
- EO_OBJ_POINTER(obj, eo_obj);
+ if (parent_id != NULL)
+ {
+ EO_OBJ_POINTER_GOTO(parent_id, parent_obj, err_impossible);
+ bad_parent = parent_obj->invalidate || (obj == parent_id);
+ EO_OBJ_DONE(parent_id);
+ }
+
+ if (bad_parent) goto err_parent;
+
+ EO_OBJ_POINTER_GOTO(obj, eo_obj, err_impossible);
+
+ // Invalidated object can not be bring back to life
+ if (eo_obj->invalidate)
+ {
+ ERR("Call of efl_parent_set(%p, %p) when object of clas '%s' is already invalidated.\n", obj, parent_id, efl_class_name_get(obj));
+ goto err_impossible;
+ }
+
+ if (!parent_id)
+ {
+ if (prev_parent) _efl_invalidate(eo_obj);
+ }
+
if (pd->parent)
{
Efl_Object_Data *old_parent_pd = efl_data_scope_get(pd->parent,
@@ -642,8 +759,7 @@ _efl_object_parent_set(Eo *obj, Efl_Object_Data *pd, Eo *parent_id)
pd->parent = parent_id;
parent_pd->children = eina_inlist_append(parent_pd->children,
EINA_INLIST_GET(eo_obj));
- if (!prev_parent && pd->parent_sunk) efl_ref(obj);
- pd->parent_sunk = EINA_TRUE;
+ if (!prev_parent) efl_ref(obj);
}
else
{
@@ -651,38 +767,46 @@ _efl_object_parent_set(Eo *obj, Efl_Object_Data *pd, Eo *parent_id)
if (prev_parent) efl_unref(obj);
// unlikely this error happens, so move it out of execution path
// to improve l1 cache efficiency
- goto err_parent;
+ goto err_parent_done;
}
+
+ eo_obj->parent = EINA_TRUE;
}
else
{
pd->parent = NULL;
+ eo_obj->parent = EINA_FALSE;
+
if (prev_parent && !eo_obj->del_triggered) efl_unref(obj);
}
EO_OBJ_DONE(obj);
return;
-err_parent:
- ERR("New parent %p for object %p is not a valid Eo object.",
- parent_id, obj);
+err_parent_done:
EO_OBJ_DONE(obj);
+err_parent:
+ if (obj == parent_id)
+ ERR("New parent %p for object %p will not be set: THIS IS THE SAME OBJECT.",
+ parent_id, obj);
+ else
+ ERR("New parent %p for object %p is not a valid Eo object.",
+ parent_id, obj);
return;
err_impossible:
ERR("CONTACT DEVS!!! SHOULD NEVER HAPPEN!!! Old parent %p for object %p is not a valid Eo object.",
pd->parent, obj);
- EO_OBJ_DONE(obj);
}
EOLIAN static Eo *
-_efl_object_parent_get(Eo *obj EINA_UNUSED, Efl_Object_Data *pd)
+_efl_object_parent_get(const Eo *obj EINA_UNUSED, Efl_Object_Data *pd)
{
return pd->parent;
}
EOLIAN static Eina_Bool
-_efl_object_finalized_get(Eo *obj_id, Efl_Object_Data *pd EINA_UNUSED)
+_efl_object_finalized_get(const Eo *obj_id, Efl_Object_Data *pd EINA_UNUSED)
{
Eina_Bool finalized;
EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, EINA_FALSE);
@@ -691,14 +815,33 @@ _efl_object_finalized_get(Eo *obj_id, Efl_Object_Data *pd EINA_UNUSED)
return finalized;
}
+EOLIAN static Eina_Bool
+_efl_object_invalidated_get(const Eo *obj_id, Efl_Object_Data *pd)
+{
+ Eina_Bool invalidate;
+ EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, EINA_TRUE);
+ invalidate = obj->invalidate;
+ EO_OBJ_DONE(obj_id);
+ if (!invalidate && pd && pd->parent)
+ return efl_invalidated_get(pd->parent);
+ return invalidate;
+}
+
EOLIAN static Efl_Object *
-_efl_object_provider_find(const Eo *obj EINA_UNUSED, Efl_Object_Data *pd, const Efl_Object *klass)
+_efl_object_provider_find(const Eo *obj, Efl_Object_Data *pd, const Efl_Object *klass)
{
+ Eina_Bool invalidate;
+
+ invalidate = _efl_object_invalidated_get((Eo*) obj, NULL);
+ if (invalidate)
+ {
+ ERR("Calling efl_provider_find(%p) after the object was invalidated.", obj);
+ return NULL;
+ }
if (pd->parent) return efl_provider_find(pd->parent, klass);
return NULL;
}
-
/* Children accessor */
typedef struct _Eo_Children_Iterator Eo_Children_Iterator;
struct _Eo_Children_Iterator
@@ -981,76 +1124,32 @@ struct _Eo_Callback_Description
Eina_Bool func_array : 1;
};
-static int _eo_callbacks = 0;
static Eina_Mempool *_eo_callback_mempool = NULL;
-static int _efl_pending_futures = 0;
static Eina_Mempool *_efl_pending_future_mempool = NULL;
static void
-_mempool_data_free(Eina_Mempool **mp, int *usage, void *data)
-{
- if (!data) return;
- eina_mempool_free(*mp, data);
- (*usage)--;
- if (*usage == 0)
- {
- eina_mempool_del(*mp);
- *mp = NULL;
- }
-}
-
-static void *
-_mempool_data_alloc(Eina_Mempool **mp, int *usage, size_t size)
-{
- Eo_Callback_Description *cb;
- // very unlikely that the mempool isnt initted, so take all the init code
- // and move it out of l1 instruction cache space so we dont pollute the
- // l1 cache with unused code 99% of the time
- if (!*mp) goto init_mempool;
-init_mempool_back:
-
- cb = eina_mempool_calloc(*mp, size);
- if (cb)
- {
- (*usage)++;
- return cb;
- }
- if (*usage != 0) return NULL;
- eina_mempool_del(*mp);
- *mp = NULL;
- return NULL;
-init_mempool:
- *mp = eina_mempool_add
- ("chained_mempool", NULL, NULL, size, 256);
- if (!*mp) return NULL;
- goto init_mempool_back;
-}
-
-static void
_eo_callback_free(Eo_Callback_Description *cb)
{
- _mempool_data_free(&_eo_callback_mempool, &_eo_callbacks, cb);
+ eina_mempool_free(_eo_callback_mempool, cb);
}
static Eo_Callback_Description *
_eo_callback_new(void)
{
- return _mempool_data_alloc(&_eo_callback_mempool, &_eo_callbacks,
+ return eina_mempool_calloc(_eo_callback_mempool,
sizeof(Eo_Callback_Description));
}
static void
_efl_pending_future_free(Efl_Future_Pending *pending)
{
- _mempool_data_free(&_efl_pending_future_mempool,
- &_efl_pending_futures, pending);
+ eina_mempool_free(_efl_pending_future_mempool, pending);
}
static Efl_Future_Pending *
_efl_pending_future_new(void)
{
- return _mempool_data_alloc(&_efl_pending_future_mempool,
- &_efl_pending_futures,
+ return eina_mempool_calloc(_efl_pending_future_mempool,
sizeof(Efl_Future_Pending));
}
@@ -1068,6 +1167,10 @@ _special_event_count_inc(Efl_Object_Data *pd, const Efl_Callback_Array_Item *it)
CB_COUNT_INC(pd->event_cb_efl_event_callback_del_count);
else if (it->desc == EFL_EVENT_DEL)
CB_COUNT_INC(pd->event_cb_efl_event_del_count);
+ else if (it->desc == EFL_EVENT_NOREF)
+ CB_COUNT_INC(pd->event_cb_efl_event_noref_count);
+ else if (it->desc == EFL_EVENT_DESTRUCT)
+ pd->has_destroyed_event_cb = EINA_TRUE;
}
static inline void
@@ -1079,6 +1182,8 @@ _special_event_count_dec(Efl_Object_Data *pd, const Efl_Callback_Array_Item *it)
CB_COUNT_DEC(pd->event_cb_efl_event_callback_del_count);
else if (it->desc == EFL_EVENT_DEL)
CB_COUNT_DEC(pd->event_cb_efl_event_del_count);
+ else if (it->desc == EFL_EVENT_NOREF)
+ CB_COUNT_DEC(pd->event_cb_efl_event_noref_count);
}
#endif
@@ -1126,10 +1231,12 @@ _eo_callback_remove_all(Efl_Object_Data *pd)
eina_freeq_ptr_main_add(pd->callbacks, free, 0);
pd->callbacks = NULL;
pd->callbacks_count = 0;
+ pd->has_destroyed_event_cb = EINA_FALSE;
#ifdef EFL_EVENT_SPECIAL_SKIP
pd->event_cb_efl_event_callback_add_count = 0;
pd->event_cb_efl_event_callback_del_count = 0;
pd->event_cb_efl_event_del_count = 0;
+ pd->event_cb_efl_event_noref_count = 0;
#endif
}
@@ -1220,8 +1327,6 @@ _eo_callbacks_sorted_insert(Efl_Object_Data *pd, Eo_Callback_Description *cb)
(pd->callbacks[j]->priority >= cb->priority)) j++;
// Increase the callbacks storage by 16 entries at a time
- if (_eo_nostep_alloc == -1) _eo_nostep_alloc = !!getenv("EO_NOSTEP_ALLOC");
-
if (_eo_nostep_alloc || (pd->callbacks_count & 0xF) == 0x0)
{
Eo_Callback_Description **tmp;
@@ -1231,7 +1336,7 @@ _eo_callbacks_sorted_insert(Efl_Object_Data *pd, Eo_Callback_Description *cb)
tmp = realloc(pd->callbacks,
new_len * sizeof(Eo_Callback_Description *));
- if (!tmp) return;
+ if (EINA_UNLIKELY(!tmp)) return;
pd->callbacks = tmp;
}
@@ -1253,7 +1358,7 @@ _eo_callbacks_sorted_insert(Efl_Object_Data *pd, Eo_Callback_Description *cb)
}
}
-static unsigned char
+static unsigned short
_efl_event_generation(Efl_Object_Data *pd)
{
if (!pd->event_frame) return 0;
@@ -1268,28 +1373,31 @@ _efl_object_event_callback_priority_add(Eo *obj, Efl_Object_Data *pd,
Efl_Event_Cb func,
const void *user_data)
{
- const Efl_Callback_Array_Item arr[] = { {desc, func}, {NULL, NULL}};
+ const Efl_Callback_Array_Item_Full arr[] =
+ { {desc, priority, func, (void *)user_data}, {NULL, 0, NULL, NULL}};
Eo_Callback_Description *cb = _eo_callback_new();
// very unlikely so improve l1 instr cache by using goto
- if (!cb || !desc || !func) goto err;
+ if (EINA_UNLIKELY(!cb || !desc || !func)) goto err;
cb->items.item.desc = desc;
cb->items.item.func = func;
cb->func_data = (void *)user_data;
cb->priority = priority;
cb->generation = _efl_event_generation(pd);
- if (!!cb->generation) pd->need_cleaning = EINA_TRUE;
+ if (cb->generation) pd->need_cleaning = EINA_TRUE;
_eo_callbacks_sorted_insert(pd, cb);
#ifdef EFL_EVENT_SPECIAL_SKIP
_special_event_count_inc(pd, &(cb->items.item));
#endif
+ if (EINA_UNLIKELY(desc == EFL_EVENT_DESTRUCT))
+ pd->has_destroyed_event_cb = EINA_TRUE;
efl_event_callback_call(obj, EFL_EVENT_CALLBACK_ADD, (void *)arr);
return EINA_TRUE;
-err:
+err: EINA_COLD
ERR("Tried adding callback with invalid values: cb: %p desc: %p func: %p", cb, desc, func);
_eo_callback_free(cb);
return EINA_FALSE;
@@ -1303,7 +1411,7 @@ EOAPI EFL_FUNC_BODYV(efl_event_callback_priority_add,
static void
_efl_object_event_callback_clean(Eo *obj, Efl_Object_Data *pd,
- const Efl_Callback_Array_Item *array,
+ const Efl_Callback_Array_Item_Full *array,
Eo_Callback_Description **cb)
{
(*cb)->delete_me = EINA_TRUE;
@@ -1333,7 +1441,8 @@ _efl_object_event_callback_del(Eo *obj, Efl_Object_Data *pd,
((*cb)->items.item.func == func) &&
((*cb)->func_data == user_data))
{
- const Efl_Callback_Array_Item arr[] = { {desc, func}, {NULL, NULL}};
+ const Efl_Callback_Array_Item_Full arr[] =
+ { {desc, (*cb)->priority, func, (*cb)->func_data}, {NULL, 0, NULL, NULL}};
_efl_object_event_callback_clean(obj, pd, arr, cb);
return EINA_TRUE;
@@ -1356,9 +1465,9 @@ _efl_object_event_callback_array_priority_add(Eo *obj, Efl_Object_Data *pd,
const void *user_data)
{
Eo_Callback_Description *cb = _eo_callback_new();
-#if defined(EFL_EVENT_SPECIAL_SKIP) || defined(EO_DEBUG)
const Efl_Callback_Array_Item *it;
-#endif
+ unsigned int num, i;
+ Efl_Callback_Array_Item_Full *ev_array;
#ifdef EO_DEBUG
const Efl_Callback_Array_Item *prev;
#endif
@@ -1389,9 +1498,33 @@ _efl_object_event_callback_array_priority_add(Eo *obj, Efl_Object_Data *pd,
#ifdef EFL_EVENT_SPECIAL_SKIP
for (it = cb->items.item_array; it->func; it++)
_special_event_count_inc(pd, it);
+#else
+ if (!pd->has_destroyed_event_cb)
+ {
+ for (it = cb->items.item_array; it->func; it++)
+ if (it->desc == EFL_EVENT_DESTRUCT)
+ {
+ pd->has_destroyed_event_cb = EINA_TRUE;
+ break;
+ }
+ }
#endif
- efl_event_callback_call(obj, EFL_EVENT_CALLBACK_ADD, (void *)array);
+ num = 0;
+ for (it = cb->items.item_array; it->func; it++) num++;
+ ev_array = alloca((num + 1) * sizeof(Efl_Callback_Array_Item_Full));
+ for (i = 0, it = cb->items.item_array; it->func; it++, i++)
+ {
+ ev_array[i].desc = cb->items.item_array[i].desc;
+ ev_array[i].priority = cb->priority;
+ ev_array[i].func = cb->items.item_array[i].func;
+ ev_array[i].user_data = cb->func_data;
+ }
+ ev_array[i].desc = NULL;
+ ev_array[i].priority = 0;
+ ev_array[i].func = NULL;
+ ev_array[i].user_data = NULL;
+ efl_event_callback_call(obj, EFL_EVENT_CALLBACK_ADD, ev_array);
return EINA_TRUE;
@@ -1412,17 +1545,35 @@ _efl_object_event_callback_array_del(Eo *obj, Efl_Object_Data *pd,
const void *user_data)
{
Eo_Callback_Description **cb;
- unsigned int i;
+ unsigned int j;
- for (cb = pd->callbacks, i = 0;
- i < pd->callbacks_count;
- cb++, i++)
+ for (cb = pd->callbacks, j = 0;
+ j < pd->callbacks_count;
+ cb++, j++)
{
if (!(*cb)->delete_me &&
((*cb)->items.item_array == array) &&
((*cb)->func_data == user_data))
{
- _efl_object_event_callback_clean(obj, pd, array, cb);
+ const Efl_Callback_Array_Item *it;
+ unsigned int num, i;
+ Efl_Callback_Array_Item_Full *ev_array;
+
+ num = 0;
+ for (it = (*cb)->items.item_array; it->func; it++) num++;
+ ev_array = alloca((num + 1) * sizeof(Efl_Callback_Array_Item_Full));
+ for (i = 0, it = (*cb)->items.item_array; it->func; it++, i++)
+ {
+ ev_array[i].desc = (*cb)->items.item_array[i].desc;
+ ev_array[i].priority = (*cb)->priority;
+ ev_array[i].func = (*cb)->items.item_array[i].func;
+ ev_array[i].user_data = (*cb)->func_data;
+ }
+ ev_array[i].desc = NULL;
+ ev_array[i].priority = 0;
+ ev_array[i].func = NULL;
+ ev_array[i].user_data = NULL;
+ _efl_object_event_callback_clean(obj, pd, ev_array, cb);
return EINA_TRUE;
}
}
@@ -1456,7 +1607,12 @@ _event_callback_call(Eo *obj_id, Efl_Object_Data *pd,
Efl_Event ev;
unsigned int idx;
Eina_Bool callback_already_stopped, ret;
- Efl_Event_Callback_Frame frame;
+ Efl_Event_Callback_Frame frame = {
+ .next = NULL,
+ .idx = 0,
+ .inserted_before = 0,
+ .generation = 1,
+ };
if (pd->callbacks_count == 0) return EINA_FALSE;
#ifdef EFL_EVENT_SPECIAL_SKIP
@@ -1466,10 +1622,10 @@ _event_callback_call(Eo *obj_id, Efl_Object_Data *pd,
(pd->event_cb_efl_event_callback_del_count == 0)) return EINA_FALSE;
else if ((desc == EFL_EVENT_DEL) &&
(pd->event_cb_efl_event_del_count == 0)) return EINA_FALSE;
+ else if ((desc == EFL_EVENT_NOREF) &&
+ (pd->event_cb_efl_event_noref_count == 0)) return EINA_FALSE;
#endif
- memset(&frame, 0, sizeof(Efl_Event_Callback_Frame));
- frame.generation = 1;
if (pd->event_frame)
frame.generation = ((Efl_Event_Callback_Frame*)pd->event_frame)->generation + 1;
@@ -1682,7 +1838,7 @@ _efl_object_event_thaw(Eo *obj, Efl_Object_Data *pd)
}
EOLIAN static int
-_efl_object_event_freeze_count_get(Eo *obj EINA_UNUSED, Efl_Object_Data *pd)
+_efl_object_event_freeze_count_get(const Eo *obj EINA_UNUSED, Efl_Object_Data *pd)
{
return pd->event_freeze_count;
}
@@ -1707,7 +1863,7 @@ _efl_object_event_global_thaw(Eo *klass EINA_UNUSED, void *pd EINA_UNUSED)
}
EOLIAN static int
-_efl_object_event_global_freeze_count_get(Eo *klass EINA_UNUSED, void *pd EINA_UNUSED)
+_efl_object_event_global_freeze_count_get(const Eo *klass EINA_UNUSED, void *pd EINA_UNUSED)
{
return event_freeze_count;
}
@@ -1898,24 +2054,12 @@ EAPI const Eina_Value_Type *EFL_DBG_INFO_TYPE = &_EFL_DBG_INFO_TYPE;
/* EFL_OBJECT_CLASS stuff */
#define MY_CLASS EFL_OBJECT_CLASS
-static void
-_efl_pending_futures_clear(Efl_Object_Data *pd)
-{
- while (pd->pending_futures)
- {
- Efl_Future_Pending *pending = EINA_INLIST_CONTAINER_GET(pd->pending_futures, Efl_Future_Pending);
- Eina_Future *future = *pending->desc.storage;
- assert(future);
- eina_future_cancel(future);
- }
-}
-
static Eina_Value
_efl_future_cb(void *data, const Eina_Value value, const Eina_Future *dead_future)
{
Efl_Future_Pending *pending = data;
Eina_Value ret = value;
- Eo *o;
+ const Eo *o;
Efl_Object_Data *pd;
EINA_SAFETY_ON_NULL_GOTO(pending, err);
@@ -1926,7 +2070,7 @@ _efl_future_cb(void *data, const Eina_Value value, const Eina_Future *dead_futur
pd->pending_futures = eina_inlist_remove(pd->pending_futures,
EINA_INLIST_GET(pending));
efl_ref(o);
- EASY_FUTURE_DISPATCH(ret, value, dead_future, &pending->desc, o);
+ EASY_FUTURE_DISPATCH(ret, value, dead_future, &pending->desc, (void*) o);
efl_unref(o);
_efl_pending_future_free(pending);
@@ -1939,15 +2083,20 @@ _efl_future_cb(void *data, const Eina_Value value, const Eina_Future *dead_futur
}
EOAPI Eina_Future_Desc
-efl_future_cb_from_desc(Eo *o, const Efl_Future_Cb_Desc desc)
+efl_future_cb_from_desc(const Eo *o, const Efl_Future_Cb_Desc desc)
{
Efl_Future_Pending *pending = NULL;
Eina_Future **storage = NULL;
Efl_Object_Data *pd;
+ Eina_Bool invalidate;
EINA_SAFETY_ON_NULL_GOTO(o, end);
pd = efl_data_scope_get(o, EFL_OBJECT_CLASS);
EINA_SAFETY_ON_NULL_GOTO(pd, end);
+ EO_OBJ_POINTER_GOTO(o, eo_obj, end);
+ invalidate = eo_obj->invalidate;
+ EO_OBJ_DONE(o);
+ EINA_SAFETY_ON_TRUE_GOTO(invalidate, end);
pending = _efl_pending_future_new();
EINA_SAFETY_ON_NULL_GOTO(pending, end);
memcpy(&pending->desc, &desc, sizeof(Efl_Future_Cb_Desc));
@@ -2009,7 +2158,8 @@ _efl_object_constructor(Eo *obj, Efl_Object_Data *pd EINA_UNUSED)
EOLIAN static void
_efl_object_destructor(Eo *obj, Efl_Object_Data *pd)
{
- Eo *child;
+ _Eo_Object *obj_child;
+ Eina_Inlist *l;
Efl_Object_Extension *ext;
_Eo_Object *obj_data2 = NULL;
@@ -2043,11 +2193,18 @@ composite_obj_back:
if (pd->parent) goto err_parent;
err_parent_back:
- _efl_pending_futures_clear(pd);
+ // this isn't 100% correct, as the object is still "slightly" alive at this
+ // point (so efl_destructed_is() returns false), but triggering the
+ // "destruct" event here is the simplest, safest solution.
+ if (EINA_UNLIKELY(pd->has_destroyed_event_cb))
+ _event_callback_call(obj, pd, EFL_EVENT_DESTRUCT, NULL, EINA_FALSE);
+
+ // remove generic data after this final event, in case they are used in a cb
_eo_generic_data_del_all(obj, pd);
- _wref_destruct(pd);
_eo_callback_remove_all(pd);
+ _wref_destruct(pd);
+
ext = pd->ext;
// it is rather likely we dont have any extension section for most objects
// so return immediately here to avoid pulling in more instructions to
@@ -2061,16 +2218,18 @@ err_parent_back:
ext->name = NULL;
eina_stringshare_del(ext->comment);
ext->comment = NULL;
- while (pd->ext && ext->futures)
- efl_future_cancel(eina_list_data_get(ext->futures));
_efl_object_extension_noneed(pd);
_eo_condtor_done(obj);
return;
children:
- while (pd->children)
+ ERR("Object %p of type '%s' is still holding child at time of destruction.\n",
+ obj, efl_class_name_get(obj));
+ EINA_INLIST_FOREACH_SAFE(pd->children, l, obj_child)
{
- child = _eo_obj_id_get(EINA_INLIST_CONTAINER_GET(pd->children, _Eo_Object));
+ Eo *child;
+
+ child = _eo_obj_id_get(obj_child);
efl_parent_set(child, NULL);
}
goto children_back;
@@ -2089,19 +2248,22 @@ composite_obj:
err_parent:
if (EINA_LIKELY(!pd->allow_parent_unref))
- ERR("Object '%p' still has a parent at the time of destruction.", obj);
+ ERR("Object '%p' of type '%s' still has a parent at the time of destruction.", obj, efl_class_name_get(obj));
efl_parent_set(obj, NULL);
goto err_parent_back;
}
EOLIAN static void
-_efl_object_allow_parent_unref_set(Eo *obj_id EINA_UNUSED, Efl_Object_Data *pd, Eina_Bool allow)
+_efl_object_allow_parent_unref_set(Eo *obj_id, Efl_Object_Data *pd, Eina_Bool allow)
{
+ EO_OBJ_POINTER_RETURN(obj_id, obj);
+ obj->allow_parent_unref = !!allow;
pd->allow_parent_unref = !!allow;
+ EO_OBJ_DONE(obj_id);
}
EOLIAN static Eina_Bool
-_efl_object_allow_parent_unref_get(Eo *obj_id EINA_UNUSED, Efl_Object_Data *pd)
+_efl_object_allow_parent_unref_get(const Eo *obj_id EINA_UNUSED, Efl_Object_Data *pd)
{
return pd->allow_parent_unref;
}
@@ -2110,8 +2272,9 @@ EAPI void
___efl_auto_unref_set(Eo *obj_id, Eina_Bool enable)
{
// Write-only property
- EO_OBJ_POINTER(obj_id, obj);
+ EO_OBJ_POINTER_RETURN(obj_id, obj);
obj->auto_unref = enable ? 1 : 0;
+ EO_OBJ_DONE(obj_id);
}
EOLIAN static Eo *
@@ -2125,39 +2288,24 @@ _efl_object_class_constructor(Efl_Class *klass EINA_UNUSED)
{
event_freeze_count = 0;
_legacy_events_hash = eina_hash_stringshared_new(_legacy_events_hash_free_cb);
-}
-EOLIAN static void
-_efl_object_class_destructor(Efl_Class *klass EINA_UNUSED)
-{
- eina_hash_free(_legacy_events_hash);
-}
+ _eo_callback_mempool =
+ eina_mempool_add("chained_mempool", NULL, NULL,
+ sizeof(Eo_Callback_Description), 256);
-static void
-_efl_object_future_link_tracking_end(void *data, const Efl_Event *ev)
-{
- Efl_Future *link = ev->object;
- Eo *obj = data;
- Efl_Object_Data *pd = efl_data_scope_get(obj, EFL_OBJECT_CLASS);
- Efl_Object_Extension *ext = _efl_object_extension_need(pd);
+ _efl_pending_future_mempool =
+ eina_mempool_add("chained_mempool", NULL, NULL,
+ sizeof(Efl_Future_Pending), 256);
- ext->futures = eina_list_remove(ext->futures, link);
- _efl_object_extension_noneed(pd);
+ _eo_nostep_alloc = !!getenv("EO_NOSTEP_ALLOC");
}
-EOAPI EFL_FUNC_BODYV(efl_future_link, Eina_Bool, 0, EFL_FUNC_CALL(link), Efl_Future *link);
-
-EOLIAN static Eina_Bool
-_efl_object_future_link(Eo *obj EINA_UNUSED, Efl_Object_Data *pd, Efl_Future *link)
+EOLIAN static void
+_efl_object_class_destructor(Efl_Class *klass EINA_UNUSED)
{
- Efl_Object_Extension *ext;
-
- if (!link) return EINA_FALSE;
-
- ext = _efl_object_extension_need(pd);
-
- ext->futures = eina_list_append(ext->futures, link);
- return !!efl_future_then(link, _efl_object_future_link_tracking_end, _efl_object_future_link_tracking_end, NULL, obj);
+ eina_mempool_del(_efl_pending_future_mempool);
+ eina_mempool_del(_eo_callback_mempool);
+ eina_hash_free(_legacy_events_hash);
}
#define EFL_OBJECT_EXTRA_OPS \
@@ -2168,7 +2316,6 @@ _efl_object_future_link(Eo *obj EINA_UNUSED, Efl_Object_Data *pd, Efl_Future *li
EFL_OBJECT_OP_FUNC(efl_event_callback_call, _efl_object_event_callback_call), \
EFL_OBJECT_OP_FUNC(efl_event_callback_legacy_call, _efl_object_event_callback_legacy_call), \
EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _efl_object_dbg_info_get), \
- EFL_OBJECT_OP_FUNC(efl_future_link, _efl_object_future_link), \
EFL_OBJECT_OP_FUNC(efl_wref_add, _efl_object_wref_add), \
EFL_OBJECT_OP_FUNC(efl_wref_del, _efl_object_wref_del), \
EFL_OBJECT_OP_FUNC(efl_key_data_set, _efl_object_key_data_set), \
diff --git a/src/lib/eo/eo_internal.h b/src/lib/eo/eo_internal.h
new file mode 100644
index 0000000000..f57d2698d5
--- /dev/null
+++ b/src/lib/eo/eo_internal.h
@@ -0,0 +1,41 @@
+#ifndef _EO_INTERNAL_H_
+#define _EO_INTERNAL_H_
+
+#ifdef EAPI
+# undef EAPI
+#endif
+
+#ifdef _WIN32
+# ifdef EFL_BUILD
+# ifdef DLL_EXPORT
+# define EAPI __declspec(dllexport)
+# else
+# define EAPI
+# endif
+# else
+# define EAPI __declspec(dllimport)
+# endif
+#else
+# ifdef __GNUC__
+# if __GNUC__ >= 4
+# define EAPI __attribute__ ((visibility("default")))
+# else
+# define EAPI
+# endif
+# else
+# define EAPI
+# endif
+#endif
+
+typedef unsigned char Eina_Bool;
+typedef struct _Eo_Opaque Eo;
+
+EAPI void ___efl_auto_unref_set(Eo *obj_id, Eina_Bool enable);
+
+EAPI int ___efl_ref2_count(const Eo *obj_id);
+EAPI void ___efl_ref2_reset(const Eo *obj_id);
+
+#undef EAPI
+#define EAPI
+
+#endif
diff --git a/src/lib/eo/eo_private.h b/src/lib/eo/eo_private.h
index 38f8c9eb03..e42078a1fd 100644
--- a/src/lib/eo/eo_private.h
+++ b/src/lib/eo/eo_private.h
@@ -115,6 +115,11 @@ struct _Eo_Object
Eina_Bool condtor_done:1;
Eina_Bool finalized:1;
Eina_Bool super:1;
+ Eina_Bool invalidate:1;
+ Eina_Bool is_invalidating:1;
+ Eina_Bool parent : 1;
+ Eina_Bool unref_compensate : 1;
+ Eina_Bool allow_parent_unref : 1;
Eina_Bool del_triggered:1;
Eina_Bool destructed:1;
@@ -198,6 +203,8 @@ struct _Efl_Class
unsigned int data_offset; /* < Offset of the data within object data. */
unsigned int ops_count; /* < Offset of the data within object data. */
+ Eina_Thread construction_thread; /** < the thread which called the class constructor */
+
Eina_Bool constructed : 1;
Eina_Bool functions_set : 1;
/* [extensions*] + NULL */
@@ -217,7 +224,7 @@ typedef struct
/* provide valgrind-like tracking of object allocationg and deletion */
void _eo_log_obj_report(const Eo_Id id, int log_level, const char *func_name, const char *file, int line);
-void _efl_object_parent_sink_set(Eo *obj, Eina_Bool sink);
+void _efl_object_reuse(_Eo_Object *obj);
static inline
Eo *_eo_header_id_get(const Eo_Header *header)
@@ -246,6 +253,11 @@ _eo_condtor_reset(_Eo_Object *obj)
obj->condtor_done = EINA_FALSE;
}
+typedef struct _Efl_Object_Data Efl_Object_Data;
+
+EOLIAN void _efl_object_parent_set(Eo *obj, Efl_Object_Data *pd, Eo *parent_id);
+void _efl_invalidate(_Eo_Object *obj);
+
static inline void
_efl_del_internal(_Eo_Object *obj, const char *func_name, const char *file, int line)
{
@@ -254,6 +266,32 @@ _efl_del_internal(_Eo_Object *obj, const char *func_name, const char *file, int
const _Efl_Class *klass = obj->klass;
+ // If the object hasn't been invalidated yet, time to do it
+ // before any destructor kick in. This can happen when
+ // the object has no parent and get deleted by efl_unref.
+ if (obj->parent)
+ {
+ Eo *parent = efl_parent_get(_eo_obj_id_get(obj));
+
+ ERR("Destructor path being taken while object [%s] still has a parent [%s] in state %i:%i.",
+ efl_debug_name_get(_eo_obj_id_get(obj)),
+ efl_debug_name_get(parent),
+ obj->is_invalidating, obj->invalidate);
+
+ efl_parent_set(_eo_obj_id_get(obj), NULL);
+
+ if (obj->parent)
+ {
+ CRI("Something is preventing [%s] from disconnecting from its parent, bypassing.",
+ efl_debug_name_get(_eo_obj_id_get(obj)));
+ _efl_object_parent_set(_eo_obj_id_get(obj), efl_data_scope_get(_eo_obj_id_get(obj), EFL_OBJECT_CLASS), NULL);
+ }
+ }
+ else if (!obj->invalidate || !obj->is_invalidating)
+ {
+ _efl_invalidate(obj);
+ }
+
efl_event_callback_call(_eo_obj_id_get(obj), EFL_EVENT_DEL, NULL);
_eo_condtor_reset(obj);
@@ -302,6 +340,12 @@ _efl_unref_internal(_Eo_Object *obj, const char *func_name, const char *file, in
--(obj->refcount);
if (EINA_UNLIKELY(obj->refcount <= 0))
{
+ if (obj->user_refcount > 0)
+ {
+ ERR("Object %p is still refcounted %i by users, but internal refcount reached 0. This should never happen. Please report a bug and send a backtrace to EFL developer.", (Eo*) obj->header.id, obj->user_refcount);
+ _eo_log_obj_report((Eo_Id)_eo_obj_id_get(obj), EINA_LOG_LEVEL_ERR, __FUNCTION__, __FILE__, __LINE__);
+ return;
+ }
if (obj->refcount < 0)
{
ERR("in %s:%d: func '%s' Obj:%p. Refcount (%d) < 0. Too many unrefs.", file, line, func_name, obj, obj->refcount);
@@ -376,7 +420,4 @@ _efl_unref_internal(_Eo_Object *obj, const char *func_name, const char *file, in
}
}
-Eina_Bool efl_future_init(void);
-Eina_Bool efl_future_shutdown(void);
-
#endif
diff --git a/src/lib/eo/eo_ptr_indirection.x b/src/lib/eo/eo_ptr_indirection.x
index f4311e1c3a..d6affe0cc6 100644
--- a/src/lib/eo/eo_ptr_indirection.x
+++ b/src/lib/eo/eo_ptr_indirection.x
@@ -6,6 +6,11 @@
#include <sys/mman.h>
#endif
+#ifdef HAVE_VALGRIND
+# include <valgrind.h>
+# include <memcheck.h>
+#endif
+
/* Start of pointer indirection:
*
* This feature is responsible of hiding from the developer the real pointer of
@@ -149,23 +154,29 @@ static void *
_eo_id_mem_alloc(size_t size)
{
#ifdef HAVE_MMAP
- void *ptr;
- Mem_Header *hdr;
- size_t newsize;
- newsize = MEM_PAGE_SIZE * ((size + MEM_HEADER_SIZE + MEM_PAGE_SIZE - 1) /
- MEM_PAGE_SIZE);
- ptr = mmap(NULL, newsize, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_ANON, -1, 0);
- if (ptr == MAP_FAILED)
+# ifdef HAVE_VALGRIND
+ if (RUNNING_ON_VALGRIND) return malloc(size);
+ else
+# endif
{
- ERR("mmap of eo id table region failed!");
- return NULL;
+ void *ptr;
+ Mem_Header *hdr;
+ size_t newsize;
+ newsize = MEM_PAGE_SIZE * ((size + MEM_HEADER_SIZE + MEM_PAGE_SIZE - 1) /
+ MEM_PAGE_SIZE);
+ ptr = mmap(NULL, newsize, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANON, -1, 0);
+ if (ptr == MAP_FAILED)
+ {
+ ERR("mmap of eo id table region failed!");
+ return NULL;
+ }
+ hdr = ptr;
+ hdr->size = newsize;
+ hdr->magic = MEM_MAGIC;
+ /* DBG("asked:%lu allocated:%lu wasted:%lu bytes", size, newsize, (newsize - size)); */
+ return (void *)(((unsigned char *)ptr) + MEM_HEADER_SIZE);
}
- hdr = ptr;
- hdr->size = newsize;
- hdr->magic = MEM_MAGIC;
- /* DBG("asked:%lu allocated:%lu wasted:%lu bytes", size, newsize, (newsize - size)); */
- return (void *)(((unsigned char *)ptr) + MEM_HEADER_SIZE);
#else
return malloc(size);
#endif
@@ -184,15 +195,21 @@ static void
_eo_id_mem_free(void *ptr)
{
#ifdef HAVE_MMAP
- Mem_Header *hdr;
- if (!ptr) return;
- hdr = (Mem_Header *)(((unsigned char *)ptr) - MEM_HEADER_SIZE);
- if (hdr->magic != MEM_MAGIC)
+# ifdef HAVE_VALGRIND
+ if (RUNNING_ON_VALGRIND) free(ptr);
+ else
+# endif
{
- ERR("unmap of eo table region has bad magic!");
- return;
+ Mem_Header *hdr;
+ if (!ptr) return;
+ hdr = (Mem_Header *)(((unsigned char *)ptr) - MEM_HEADER_SIZE);
+ if (hdr->magic != MEM_MAGIC)
+ {
+ ERR("unmap of eo table region has bad magic!");
+ return;
+ }
+ munmap(hdr, hdr->size);
}
- munmap(hdr, hdr->size);
#else
free(ptr);
#endif
@@ -203,15 +220,21 @@ static void
_eo_id_mem_protect(void *ptr, Eina_Bool may_not_write)
{
# ifdef HAVE_MMAP
- Mem_Header *hdr;
- if (!ptr) return;
- hdr = (Mem_Header *)(((unsigned char *)ptr) - MEM_HEADER_SIZE);
- if (hdr->magic != MEM_MAGIC)
+# ifdef HAVE_VALGRIND
+ if (RUNNING_ON_VALGRIND) { return; }
+ else
+# endif
{
- ERR("mprotect of eo table region has bad magic!");
- return;
+ Mem_Header *hdr;
+ if (!ptr) return;
+ hdr = (Mem_Header *)(((unsigned char *)ptr) - MEM_HEADER_SIZE);
+ if (hdr->magic != MEM_MAGIC)
+ {
+ ERR("mprotect of eo table region has bad magic!");
+ return;
+ }
+ mprotect(hdr, hdr->size, PROT_READ | ( may_not_write ? 0 : PROT_WRITE) );
}
- mprotect(hdr, hdr->size, PROT_READ | ( may_not_write ? 0 : PROT_WRITE) );
# endif
}
# define PROTECT(_ptr_) _eo_id_mem_protect((_ptr_), EINA_TRUE)
diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h
index 2f6336664e..d8a662e541 100644
--- a/src/lib/eolian/Eolian.h
+++ b/src/lib/eolian/Eolian.h
@@ -6,15 +6,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_EOLIAN_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EOLIAN_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -25,7 +25,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#ifdef __cplusplus
extern "C" {
@@ -86,9 +86,20 @@ extern "C" {
/* State information
*
+ * Possible to cast to Eolian_Unit and use as such, as this represents
+ * a master unit as well as other state.
+ *
* @ingroup Eolian
*/
-typedef struct _Eolian Eolian;
+typedef struct _Eolian_State Eolian_State;
+
+/* Any Eolian object
+ *
+ * @see Eolian_Object_Type
+ *
+ * @ingroup Eolian
+ */
+typedef struct _Eolian_Object Eolian_Object;
/* Class type used to extract information on classes
*
@@ -168,12 +179,6 @@ typedef struct _Eolian_Struct_Type_Field Eolian_Struct_Type_Field;
*/
typedef struct _Eolian_Enum_Type_Field Eolian_Enum_Type_Field;
-/* Declaration information
- *
- * @ingroup Eolian
- */
-typedef struct _Eolian_Declaration Eolian_Declaration;
-
/* Documentation information
*
* @ingroup Eolian
@@ -186,6 +191,37 @@ typedef struct _Eolian_Documentation Eolian_Documentation;
*/
typedef struct _Eolian_Unit Eolian_Unit;
+#ifdef __cplusplus
+#define EOLIAN_CAST(type, expr) reinterpret_cast<const type *>(expr)
+#else
+#define EOLIAN_CAST(type, expr) ((const type *)expr)
+#endif
+
+#define EOLIAN_OBJECT(expr) EOLIAN_CAST(Eolian_Object, expr)
+#define EOLIAN_UNIT(expr) EOLIAN_CAST(Eolian_Unit, expr)
+
+typedef void (*Eolian_Panic_Cb)(const Eolian_State *state, Eina_Stringshare *msg);
+typedef void (*Eolian_Error_Cb)(const Eolian_Object *obj, const char *msg, void *data);
+
+typedef enum
+{
+ EOLIAN_OBJECT_UNKNOWN = 0,
+ EOLIAN_OBJECT_CLASS,
+ EOLIAN_OBJECT_TYPEDECL,
+ EOLIAN_OBJECT_STRUCT_FIELD,
+ EOLIAN_OBJECT_ENUM_FIELD,
+ EOLIAN_OBJECT_TYPE,
+ EOLIAN_OBJECT_VARIABLE,
+ EOLIAN_OBJECT_EXPRESSION,
+ EOLIAN_OBJECT_FUNCTION,
+ EOLIAN_OBJECT_FUNCTION_PARAMETER,
+ EOLIAN_OBJECT_EVENT,
+ EOLIAN_OBJECT_PART,
+ EOLIAN_OBJECT_IMPLEMENT,
+ EOLIAN_OBJECT_CONSTRUCTOR,
+ EOLIAN_OBJECT_DOCUMENTATION
+} Eolian_Object_Type;
+
typedef enum
{
EOLIAN_UNRESOLVED = 0,
@@ -284,14 +320,13 @@ typedef enum
EOLIAN_TYPE_BUILTIN_ACCESSOR,
EOLIAN_TYPE_BUILTIN_ARRAY,
+ EOLIAN_TYPE_BUILTIN_FUTURE,
EOLIAN_TYPE_BUILTIN_ITERATOR,
EOLIAN_TYPE_BUILTIN_HASH,
EOLIAN_TYPE_BUILTIN_LIST,
EOLIAN_TYPE_BUILTIN_INARRAY,
EOLIAN_TYPE_BUILTIN_INLIST,
- EOLIAN_TYPE_BUILTIN_FUTURE,
-
EOLIAN_TYPE_BUILTIN_ANY_VALUE,
EOLIAN_TYPE_BUILTIN_ANY_VALUE_PTR,
@@ -415,16 +450,6 @@ typedef enum
typedef enum
{
- EOLIAN_DECL_UNKNOWN = 0,
- EOLIAN_DECL_CLASS,
- EOLIAN_DECL_ALIAS,
- EOLIAN_DECL_STRUCT,
- EOLIAN_DECL_ENUM,
- EOLIAN_DECL_VAR
-} Eolian_Declaration_Type;
-
-typedef enum
-{
EOLIAN_DOC_TOKEN_UNKNOWN = 0,
EOLIAN_DOC_TOKEN_TEXT,
EOLIAN_DOC_TOKEN_REF,
@@ -435,20 +460,6 @@ typedef enum
EOLIAN_DOC_TOKEN_MARKUP_MONOSPACE
} Eolian_Doc_Token_Type;
-typedef enum
-{
- EOLIAN_DOC_REF_INVALID = 0,
- EOLIAN_DOC_REF_CLASS,
- EOLIAN_DOC_REF_FUNC,
- EOLIAN_DOC_REF_EVENT,
- EOLIAN_DOC_REF_ALIAS,
- EOLIAN_DOC_REF_STRUCT,
- EOLIAN_DOC_REF_STRUCT_FIELD,
- EOLIAN_DOC_REF_ENUM,
- EOLIAN_DOC_REF_ENUM_FIELD,
- EOLIAN_DOC_REF_VAR
-} Eolian_Doc_Ref_Type;
-
typedef struct _Eolian_Doc_Token
{
Eolian_Doc_Token_Type type;
@@ -478,11 +489,16 @@ EAPI int eolian_shutdown(void);
*
* You need to free this with eolian_free once you're done.
*
+ * This will assign a default panic function, which printers the error
+ * message passed to it into the standard Eolian log.
+ *
+ * @see eolian_state_panic_cb_set
+ *
* @return A new state (or NULL on failure).
*
* @ingroup Eolian
*/
-EAPI Eolian *eolian_new(void);
+EAPI Eolian_State *eolian_state_new(void);
/*
* @brief Free an Eolian state.
@@ -494,220 +510,874 @@ EAPI Eolian *eolian_new(void);
* @param[in] state the state to free
*
*/
-EAPI void eolian_free(Eolian *state);
+EAPI void eolian_state_free(Eolian_State *state);
/*
- * @brief Parse the given .eo or .eot file and fill the database.
+ * @brief Set the panic function for the state.
*
- * The input can be either a full path to the file or only a filename.
- * If it's a filename, it must be scanned for first.
+ * When an unrecoverable error happens in an Eolian API call, the panic
+ * function is called. The default panic function for a state just prints
+ * the error message into the standard Eolian log. After the panic function
+ * is called, Eolian forcibly exits (`exit(EXIT_FAILURE)`). If you don't
+ * want this, you can override the panic function and never return from
+ * it (by doing a long jump, or throwing an exception in C++).
+ *
+ * Unrecoverable errors include cases such as internal errors and memory
+ * allocation failures. Standard parse errors etc. are not considered
+ * unrecoverable, so they are not handled using the panic mechanism.
+ *
+ * After a panic, the Eolian state is left valid; the library does its
+ * best at trying to provide it back to you in the same condition as it
+ * was before the failing call.
+ *
+ * If you set a panic function and jump, you're responsible for the error
+ * message and have to delete it with eina_stringshare_del.
+ *
+ * If you want to catch error messages that are standard (such as parse
+ * errors), there is another, separate mechanism in place.
+ *
+ * @return The old panic callback.
+ *
+ * @see eolian_state_error_cb_set
+ */
+EAPI Eolian_Panic_Cb eolian_state_panic_cb_set(Eolian_State *state, Eolian_Panic_Cb cb);
+
+/*
+ * @brief Set the error function for the state.
+ *
+ * When a regular error (such as parse error) happens, you can use this
+ * callback to catch the error. There is no jump involved and the outer
+ * function will fail normally and safely. You are provided with the
+ * object the error happened on (for line/column/file/other information)
+ * as well as the error message. Additionally, a data pointer is passed
+ * in so you can pass some of the information into local memory somewhere.
+ *
+ * @return The old error callback.
+ *
+ * @see eolian_state_panic_cb_set
+ * @see eolian_state_error_data_set
+ */
+EAPI Eolian_Error_Cb eolian_state_error_cb_set(Eolian_State *state, Eolian_Error_Cb cb);
+
+/*
+ * @brief Set a data pointer to be passed to the error function.
+ *
+ * By default, the data is `NULL`. You can use this to set a data pointer
+ * to be passed. This is useful to e.g. expose some local memory so you can
+ * write back from the callback without using globals.
+ *
+ * @return The old data pointer.
+ *
+ * @see eolian_state_error_cb_set
+ */
+EAPI void *eolian_state_error_data_set(Eolian_State *state, void *data);
+
+/*
+ * @brief Get the type of an Eolian object.
+ *
+ * Most handles returned by Eolian somewhere are Eolian_Objects. You can cast
+ * them to Eolian_Object, store or manipulate them and then use this function
+ * to check their type in order to for example cast it back.
+ *
+ * @see eolian_object_unit_get
+ * @see eolian_object_file_get
+ * @see eolian_object_line_get
+ * @see eolian_object_column_get
+ * @see eolian_object_name_get
+ *
+ * @ingroup Eolian
+ */
+EAPI Eolian_Object_Type eolian_object_type_get(const Eolian_Object *obj);
+
+/*
+ * @brief Get the unit the object comes from.
+ *
+ * This returns the unit the object is located in.
+ *
+ * @see eolian_object_file_get
+ * @see eolian_object_type_get
+ * @see eolian_object_line_get
+ * @see eolian_object_column_get
+ * @see eolian_object_name_get
+ *
+ * @ingroup Eolian
+ */
+EAPI const Eolian_Unit *eolian_object_unit_get(const Eolian_Object *obj);
+
+/*
+ * @brief Get the name of the file the object comes from.
+ *
+ * This returns the name of the file the object was declared in. It's not
+ * a full path, just the file name.
+ *
+ * @see eolian_object_unit_get
+ * @see eolian_object_type_get
+ * @see eolian_object_line_get
+ * @see eolian_object_column_get
+ * @see eolian_object_name_get
+ *
+ * @ingroup Eolian
+ */
+EAPI const char *eolian_object_file_get(const Eolian_Object *obj);
+
+/*
+ * @brief Get the line the object was declared at.
+ *
+ * This returns the line number in the file the object was declared at.
+ *
+ * @see eolian_object_unit_get
+ * @see eolian_object_type_get
+ * @see eolian_object_file_get
+ * @see eolian_object_column_get
+ * @see eolian_object_name_get
+ *
+ * @ingroup Eolian
+ */
+EAPI int eolian_object_line_get(const Eolian_Object *obj);
+
+/*
+ * @brief Get the column the object was declared at.
+ *
+ * This returns the column number in the file the object was declared at,
+ * that means which character on the line. It is Unicode-aware, Eolian
+ * assumes all input files are encoded in UTF-8, so this is really the
+ * code point number, not the byte number.
+ *
+ * @see eolian_object_unit_get
+ * @see eolian_object_type_get
+ * @see eolian_object_file_get
+ * @see eolian_object_line_get
+ * @see eolian_object_name_get
+ *
+ * @ingroup Eolian
+ */
+EAPI int eolian_object_column_get(const Eolian_Object *obj);
+
+/*
+ * @brief Get the name of an object.
+ *
+ * This name is the full name of the object, if named at all.
+ * For toplevel file declarations, this will be the fully namespaced
+ * name, for things like params this will be just the name itself.
+ *
+ * @see eolian_object_unit_get
+ * @see eolian_object_type_get
+ * @see eolian_object_file_get
+ * @see eolian_object_line_get
+ * @see eolian_object_column_get
+ * @see eolian_object_short_name_get
+ * @see eolian_object_namespaces_get
+ *
+ * @ingroup Eolian
+ */
+EAPI const char *eolian_object_name_get(const Eolian_Object *obj);
+
+/*
+ * @brief Get the short name of an object.
+ *
+ * This means a name without namespaces. If the object's name is not
+ * namespaced in the first place, this is equivalent to getting the full name.
+ * So for `Foo.Bar.baz` this is `baz`, for `foo` it's again just `foo`.
+ *
+ * @see eolian_object_name_get
+ * @see eolian_object_namespaces_get
+ *
+ * @ingroup Eolian
+ */
+EAPI const char *eolian_object_short_name_get(const Eolian_Object *obj);
+
+/*
+ * @brief Get a list of namespaces for the object.
+ *
+ * Each item of the iterator is the next more inner namespace. So for
+ * example if the full name is `Foo.Bar.baz`, the iterator will first
+ * give you `Foo` and then `Bar`.
+ *
+ * @see eolian_object_name_get
+ * @see eolian_object_short_name_get
+ *
+ * @ingroup Eolian
+ */
+EAPI Eina_Iterator *eolian_object_namespaces_get(const Eolian_Object *obj);
+
+/*
+ * @brief Scan the given directory for .eo and .eot files.
+ *
+ * You need to add every directory you plan to use .eo/.eot files from.
+ * The directory is scanned recursively, so all of its sub-directories
+ * are also added.
*
* @param[in] state The Eolian state.
- * @param[in] filepath Path to the file to parse.
- * @return The unit corresponding to the parsed file or NULL.
+ * @param[in] dir the directory to scan
+ * @return EINA_TRUE on success, EINA_FALSE otherwise.
+ *
+ * @see eolian_state_system_directory_add
+ *
+ * @ingroup Eolian
+ */
+EAPI Eina_Bool eolian_state_directory_add(Eolian_State *state, const char *dir);
+
+/*
+ * @brief Scan the system directory for .eo and .eot files.
*
- * @see eolian_directory_scan
+ * This is just like eolian_state_directory_add, except it uses the system
+ * directory. The system directory is determined from the prefix of the
+ * Eolian library. Typically it tends to be $PREFIX/share/eolian.
+ *
+ * @param[in] state The Eolian state.
+ *
+ * @return EINA_TRUE on success, EINA_FALSE otherwise.
+ *
+ * @see eolian_state_directory_add
*
* @ingroup Eolian
*/
-EAPI const Eolian_Unit *eolian_file_parse(Eolian *state, const char *filepath);
+EAPI Eina_Bool eolian_state_system_directory_add(Eolian_State *state);
/*
* @brief Get an iterator to all .eo file names with paths.
*
* @param[in] state The Eolian state.
*
- * @see eolian_all_eo_files_get
- * @see eolian_all_eot_file_paths_get
- * @see eolian_all_eot_files_get
+ * @see eolian_state_eo_files_get
+ * @see eolian_state_eot_file_paths_get
+ * @see eolian_state_eot_files_get
*
* @ingroup Eolian
*/
-EAPI Eina_Iterator *eolian_all_eo_file_paths_get(const Eolian *state);
+EAPI Eina_Iterator *eolian_state_eo_file_paths_get(const Eolian_State *state);
/*
* @brief Get an iterator to all .eot file names with paths.
*
* @param[in] state The Eolian state.
*
- * @see eolian_all_eo_files_get
- * @see eolian_all_eo_file_paths_get
- * @see eolian_all_eot_files_get
+ * @see eolian_state_eo_files_get
+ * @see eolian_state_eo_file_paths_get
+ * @see eolian_state_eot_files_get
*
* @ingroup Eolian
*/
-EAPI Eina_Iterator *eolian_all_eot_file_paths_get(const Eolian *state);
+EAPI Eina_Iterator *eolian_state_eot_file_paths_get(const Eolian_State *state);
/*
* @brief Get an iterator to all .eo file names (without paths).
*
* @param[in] state The Eolian state.
*
- * @see eolian_all_eo_file_paths_get
- * @see eolian_all_eot_file_paths_get
- * @see eolian_all_eot_files_get
+ * @see eolian_state_eo_file_paths_get
+ * @see eolian_state_eot_file_paths_get
+ * @see eolian_state_eot_files_get
*
* @ingroup Eolian
*/
-EAPI Eina_Iterator *eolian_all_eo_files_get(const Eolian *state);
+EAPI Eina_Iterator *eolian_state_eo_files_get(const Eolian_State *state);
/*
* @brief Get an iterator to all .eot file names (without paths).
*
* @param[in] state The Eolian state.
*
- * @see eolian_all_eo_file_paths_get
- * @see eolian_all_eot_file_paths_get
- * @see eolian_all_eo_files_get
+ * @see eolian_state_eo_file_paths_get
+ * @see eolian_stete_eot_file_paths_get
+ * @see eolian_state_eo_files_get
*
* @ingroup Eolian
*/
-EAPI Eina_Iterator *eolian_all_eot_files_get(const Eolian *state);
+EAPI Eina_Iterator *eolian_state_eot_files_get(const Eolian_State *state);
/*
- * @brief Scan the given directory (recursively) and search for .eo and
- * .eot files.
+ * @brief Parse the given .eo or .eot file and fill the database.
*
- * The found files are just open to extract the class name.
+ * The input can be either a full path to the file or only a filename.
+ * If it's a filename, it must be scanned for first.
*
* @param[in] state The Eolian state.
- * @param[in] dir the directory to scan
- * @return EINA_TRUE on success, EINA_FALSE otherwise.
+ * @param[in] filepath Path to the file to parse.
+ * @return The unit corresponding to the parsed file or NULL.
*
- * @see eolian_system_directory_scan
+ * @see eolian_state_directory_add
*
* @ingroup Eolian
*/
-EAPI Eina_Bool eolian_directory_scan(Eolian *state, const char *dir);
+EAPI const Eolian_Unit *eolian_state_file_parse(Eolian_State *state, const char *filepath);
/*
- * @brief Scan the system directory (recursively) and search for .eo and
- * .eot files.
+ * @brief Parse all known eo files.
*
* @param[in] state The Eolian state.
*
* @return EINA_TRUE on success, EINA_FALSE otherwise.
*
- * @see eolian_directory_scan
+ * @see eolian_state_directory_add
+ * @see eolian_state_all_eot_files_parse
*
* @ingroup Eolian
*/
-EAPI Eina_Bool eolian_system_directory_scan(Eolian *state);
+EAPI Eina_Bool eolian_state_all_eo_files_parse(Eolian_State *state);
/*
- * @brief Force parsing of all the .eo files located in the directories
- * given in eolian_directory_scan..
+ * @brief Parse all known eot files.
*
* @param[in] state The Eolian state.
*
* @return EINA_TRUE on success, EINA_FALSE otherwise.
*
- * @see eolian_directory_scan
- * @see eolian_all_eot_files_parse
+ * @see eolian_state_directory_add
+ * @see eolian_state_all_eo_files_parse
*
* @ingroup Eolian
*/
-EAPI Eina_Bool eolian_all_eo_files_parse(Eolian *state);
+EAPI Eina_Bool eolian_state_all_eot_files_parse(Eolian_State *state);
/*
- * @brief Force parsing of all the .eot files located in the directories
- * given in eolian_directory_scan..
+ * @brief Perform additional checks on the state.
*
- * @param[in] state The Eolian state.
+ * This funciton performs additional checks that aren't crucial for the
+ * database integrity (that's checked as a part of the regular parse process,
+ * so the database is guaranteed to be valid), but are important for proper
+ * correctness. It is recommended that all available .eot and .eo files are
+ * parsed when running this.
+ *
+ * The set of available checks will expand over time.
*
* @return EINA_TRUE on success, EINA_FALSE otherwise.
*
- * @see eolian_directory_scan
- * @see eolian_all_eo_files_parse
+ * @ingroup Eolian
+ */
+EAPI Eina_Bool eolian_state_check(const Eolian_State *state);
+
+/*
+ * @brief Get an Eolian unit by file name.
+ *
+ * For any .eo or .eot file (must be within a directory previously scanned
+ * by eolian_state_directory_add or eolian_state_system_directory_add), get
+ * its corresponding unit.
+ *
+ * This only works if the file has been previously parsed.
+ *
+ * @param[in] state The Eolian state.
+ * @param[in] file The file name.
+ *
+ * @see eolian_state_units_get
*
* @ingroup Eolian
*/
-EAPI Eina_Bool eolian_all_eot_files_parse(Eolian *state);
+EAPI const Eolian_Unit *eolian_state_unit_by_file_get(const Eolian_State *state, const char *file_name);
/*
- * @brief Gets a class by its name
+ * @brief Get an iterator to all Eolian units in a state.
+ *
+ * This means units of all files that have been parsed so far.
*
- * @param[in] unit the unit to look in
- * @param[in] class_name name of the class to get.
- * @return the class
+ * @param[in] state The Eolian state.
*
* @ingroup Eolian
*/
-EAPI const Eolian_Class *eolian_class_get_by_name(const Eolian_Unit *unit, const char *class_name);
+EAPI Eina_Iterator *eolian_state_units_get(const Eolian_State *state);
/*
- * @brief Gets a class by its filename (name.eo)
+ * @brief Get the state associated with the unit.
*
- * @param[in] unit the unit to look in
- * @param[in] file_name the filename
- * @return the class stored in the file
+ * Technically you can cast away the const to make the state mutable
+ * again, it's the same pointer after all. But this is considered a
+ * bad practice, because you're only supposed to use mutable objects
+ * at the very beginning and then just read.
+ *
+ * @param[in] unit The unit.
*
* @ingroup Eolian
*/
-EAPI const Eolian_Class *eolian_class_get_by_file(const Eolian_Unit *unit, const char *file_name);
+EAPI const Eolian_State *eolian_unit_state_get(const Eolian_Unit *unit);
/*
- * @brief Returns the name of the file containing the given class.
+ * @brief Get the children (dependencies) of a unit.
*
- * @param[in] klass the class.
- * @return the name of the file on success or NULL otherwise.
+ * The iterator is obviously again to `const Eolian_Unit *`.
+ *
+ * @param[in] unit The unit.
*
* @ingroup Eolian
*/
-EAPI Eina_Stringshare *eolian_class_file_get(const Eolian_Class *klass);
+EAPI Eina_Iterator *eolian_unit_children_get(const Eolian_Unit *unit);
/*
- * @brief Returns the full name of the given class.
+ * @brief Get the file name a unit is associated with.
*
- * @param[in] class the class.
- * @return the full name of the class on success or NULL otherwise.
+ * This will be `NULL` if not associated with a file (like the master unit
+ * within `Eolian_State`).
*
- * The full name and the name of a class will be different if namespaces
- * are used.
+ * @param[in] unit The unit.
*
* @ingroup Eolian
*/
-EAPI Eina_Stringshare *eolian_class_full_name_get(const Eolian_Class *klass);
+EAPI const char *eolian_unit_file_get(const Eolian_Unit *unit);
/*
- * @brief Returns the name of the given class.
+ * @brief Get an object in a unit by name.
*
- * @param[in] class the class.
- * @return the name of the class on success or NULL otherwise.
+ * Only objects declared directly within the file can be retrieved, i.e.
+ * classes, typedecls and variables.
+ *
+ * @param[in] unit The unit.
+ * @param[in] name The fully namespaced object name.
*
* @ingroup Eolian
*/
-EAPI Eina_Stringshare *eolian_class_name_get(const Eolian_Class *klass);
+EAPI const Eolian_Object *eolian_unit_object_by_name_get(const Eolian_Unit *unit, const char *name);
/*
- * @brief Returns an iterator to the namespaces of the given class.
+ * @brief Get all objects in the unit.
+ *
+ * The order is not necessarily the declaration order. Only objects declared
+ * directly within the file can be retrieved, i.e. classes, typedecls and
+ * variables.
*
- * @param[in] class the class.
- * @return the iterator on success or NULL otherwise.
+ * @param[in] unit The unit.
*
* @ingroup Eolian
*/
-EAPI Eina_Iterator *eolian_class_namespaces_get(const Eolian_Class *klass);
+EAPI Eina_Iterator *eolian_unit_objects_get(const Eolian_Unit *unit);
/*
- * @brief Returns the class type of the given class
+ * @brief Get a class within a unit by name.
*
- * @param[in] klass the class
- * @return the class type
+ * @param[in] unit The unit.
+ * @param[in] class_name The full name of the class.
*
* @ingroup Eolian
*/
-EAPI Eolian_Class_Type eolian_class_type_get(const Eolian_Class *klass);
+EAPI const Eolian_Class *eolian_unit_class_by_name_get(const Eolian_Unit *unit, const char *class_name);
/*
- * @brief Returns an iterator to all the classes stored into the database.
+ * @brief Get an iterator to all the classes stored into a unit.
*
- * @param[in] unit the unit to look in
- * @return the iterator
+ * @param[in] unit The Eolian unit.
+ *
+ * @ingroup Eolian
+ */
+EAPI Eina_Iterator *eolian_unit_classes_get(const Eolian_Unit *unit);
+
+/*
+ * @brief Get a global variable in a unit by name.
+ *
+ * @param[in] unit The unit.
+ * @param[in] name the name of the variable
+ *
+ * @ingroup Eolian
+ */
+EAPI const Eolian_Variable *eolian_unit_global_by_name_get(const Eolian_Unit *unit, const char *name);
+
+/*
+ * @brief Get a constant variable in a unit by name.
+ *
+ * @param[in] unit The unit.
+ * @param[in] name the name of the variable
+ *
+ * @ingroup Eolian
+ */
+EAPI const Eolian_Variable *eolian_unit_constant_by_name_get(const Eolian_Unit *unit, const char *name);
+
+/*
+ * @brief Get an iterator to all constant variables in the Eolian database.
+ *
+ * @return the iterator or NULL
+ *
+ * Thanks to internal caching, this is an O(1) operation.
+ *
+ * @ingroup Eolian
+ */
+EAPI Eina_Iterator *eolian_unit_constants_get(const Eolian_Unit *unit);
+
+/*
+ * @brief Get an iterator to all global variables in the Eolian database.
+ *
+ * @return the iterator or NULL
+ *
+ * Thanks to internal caching, this is an O(1) operation.
+ *
+ * @ingroup Eolian
+ */
+EAPI Eina_Iterator *eolian_unit_globals_get(const Eolian_Unit *unit);
+
+/*
+ * @brief Get an alias type declaration within a unit by name.
+ *
+ * @param[in] unit The unit.
+ * @param[in] name The name of the alias.
+ *
+ * @ingroup Eolian
+ */
+EAPI const Eolian_Typedecl *eolian_unit_alias_by_name_get(const Eolian_Unit *unit, const char *name);
+
+/*
+ * @brief Get a struct declaration within a unit by name.
+ *
+ * @param[in] unit The unit.
+ * @param[in] name The name of the alias.
+ *
+ * @ingroup Eolian
+ */
+EAPI const Eolian_Typedecl *eolian_unit_struct_by_name_get(const Eolian_Unit *unit, const char *name);
+
+/*
+ * @brief Get an enum declaration within a unit by name.
+ *
+ * @param[in] unit The unit.
+ * @param[in] name The name of the alias.
+ *
+ * @ingroup Eolian
+ */
+EAPI const Eolian_Typedecl *eolian_unit_enum_by_name_get(const Eolian_Unit *unit, const char *name);
+
+/*
+ * @brief Get an iterator to all aliases in the Eolian database.
+ *
+ * @param[in] unit The unit.
+ *
+ * Thanks to internal caching, this is an O(1) operation.
+ *
+ * @ingroup Eolian
+ */
+EAPI Eina_Iterator *eolian_unit_aliases_get(const Eolian_Unit *unit);
+
+/*
+ * @brief Get an iterator to all structs in the Eolian database.
+ *
+ * @param[in] unit The unit.
+ *
+ * Thanks to internal caching, this is an O(1) operation.
+ *
+ * @ingroup Eolian
+ */
+EAPI Eina_Iterator *eolian_unit_structs_get(const Eolian_Unit *unit);
+
+/*
+ * @brief Get an iterator to all enums in the Eolian database.
+ *
+ * @param[in] unit The unit.
+ *
+ * Thanks to internal caching, this is an O(1) operation.
+ *
+ * @ingroup Eolian
+ */
+EAPI Eina_Iterator *eolian_unit_enums_get(const Eolian_Unit *unit);
+
+/*
+ * @brief A helper function to get an object in a state by name.
+ *
+ * @see eolian_unit_object_by_name_get
+ *
+ * @ingroup Eolian
+ */
+static inline const Eolian_Object *
+eolian_state_object_by_name_get(const Eolian_State *state, const char *name)
+{
+ return eolian_unit_object_by_name_get(EOLIAN_UNIT(state), name);
+}
+
+/*
+ * @brief Get a list of objects from a file.
+ *
+ * The list follows declaration order in the file. Only objects declared
+ * directly within the file can be retrieved, i.e. classes, typedecls and
+ * variables.
+ *
+ * @param[in] state The state.
+ * @param[in] file_name The file name.
*
* @ingroup Eolian
*/
-EAPI Eina_Iterator *eolian_all_classes_get(const Eolian_Unit *unit);
+EAPI Eina_Iterator *eolian_state_objects_by_file_get(const Eolian_State *state, const char *file_name);
+
+/*
+ * @brief A helper function to get all objects in a state.
+ *
+ * @see eolian_unit_objects_get
+ *
+ * @ingroup Eolian
+ */
+static inline Eina_Iterator *
+eolian_state_objects_get(const Eolian_State *state)
+{
+ return eolian_unit_objects_get(EOLIAN_UNIT(state));
+}
+
+/*
+ * @brief A helper function to get a class in a state by name.
+ *
+ * @see eolian_unit_class_by_name_get
+ *
+ * @ingroup Eolian
+ */
+static inline const Eolian_Class *
+eolian_state_class_by_name_get(const Eolian_State *state, const char *class_name)
+{
+ return eolian_unit_class_by_name_get(EOLIAN_UNIT(state), class_name);
+}
+
+/*
+ * @brief Get a class within a state by file name (class_name.eo).
+ *
+ * @param[in] state The state.
+ * @param[in] file_name The full name of the class.
+ *
+ * @ingroup Eolian
+ */
+EAPI const Eolian_Class *eolian_state_class_by_file_get(const Eolian_State *state, const char *file_name);
+
+/*
+ * @brief A helper function to get all classes in a state.
+ *
+ * @see eolian_unit_classes_get
+ *
+ * @ingroup Eolian
+ */
+static inline Eina_Iterator *
+eolian_state_classes_get(const Eolian_State *state)
+{
+ return eolian_unit_classes_get(EOLIAN_UNIT(state));
+}
+
+/*
+ * @brief A helper function to get a global in a state by name.
+ *
+ * @see eolian_unit_global_by_name_get
+ *
+ * @ingroup Eolian
+ */
+static inline const Eolian_Variable *
+eolian_state_global_by_name_get(const Eolian_State *state, const char *name)
+{
+ return eolian_unit_global_by_name_get(EOLIAN_UNIT(state), name);
+}
+
+/*
+ * @brief A helper function to get a constant in a state by name.
+ *
+ * @see eolian_unit_constant_by_name_get
+ *
+ * @ingroup Eolian
+ */
+static inline const Eolian_Variable *
+eolian_state_constant_by_name_get(const Eolian_State *state, const char *name)
+{
+ return eolian_unit_constant_by_name_get(EOLIAN_UNIT(state), name);
+}
+
+/*
+ * @brief Get an iterator to all global variables contained in a file.
+ *
+ * @param[in] state The state.
+ * @param[in] file_name The file name.
+ *
+ * Thanks to internal caching, this is an O(1) operation.
+ *
+ * @ingroup Eolian
+ */
+EAPI Eina_Iterator *eolian_state_globals_by_file_get(const Eolian_State *state, const char *file_name);
+
+/*
+ * @brief Get an iterator to all constant variables contained in a file.
+ *
+ * @param[in] state The state.
+ * @param[in] file_name The file name.
+ * @return the iterator or NULL
+ *
+ * Thanks to internal caching, this is an O(1) operation.
+ *
+ * @ingroup Eolian
+ */
+EAPI Eina_Iterator *eolian_state_constants_by_file_get(const Eolian_State *state, const char *file_name);
+
+/*
+ * @brief A helper function to get all globals in a state.
+ *
+ * @see eolian_unit_globals_get
+ *
+ * @ingroup Eolian
+ */
+static inline Eina_Iterator *
+eolian_state_globals_get(const Eolian_State *state)
+{
+ return eolian_unit_globals_get(EOLIAN_UNIT(state));
+}
+
+/*
+ * @brief A helper function to get all constants in a state.
+ *
+ * @see eolian_unit_constants_get
+ *
+ * @ingroup Eolian
+ */
+static inline Eina_Iterator *
+eolian_state_constants_get(const Eolian_State *state)
+{
+ return eolian_unit_constants_get(EOLIAN_UNIT(state));
+}
+
+/*
+ * @brief A helper function to get an alias in a state by name.
+ *
+ * @see eolian_unit_alias_by_name_get
+ *
+ * @ingroup Eolian
+ */
+static inline const Eolian_Typedecl *
+eolian_state_alias_by_name_get(const Eolian_State *state, const char *name)
+{
+ return eolian_unit_alias_by_name_get(EOLIAN_UNIT(state), name);
+}
+
+/*
+ * @brief A helper function to get a struct in a state by name.
+ *
+ * @see eolian_unit_struct_by_name_get
+ *
+ * @ingroup Eolian
+ */
+static inline const Eolian_Typedecl *
+eolian_state_struct_by_name_get(const Eolian_State *state, const char *name)
+{
+ return eolian_unit_struct_by_name_get(EOLIAN_UNIT(state), name);
+}
+
+/*
+ * @brief A helper function to get an enum in a state by name.
+ *
+ * @see eolian_unit_enum_by_name_get
+ *
+ * @ingroup Eolian
+ */
+static inline const Eolian_Typedecl *
+eolian_state_enum_by_name_get(const Eolian_State *state, const char *name)
+{
+ return eolian_unit_enum_by_name_get(EOLIAN_UNIT(state), name);
+}
+
+/*
+ * @brief Get an iterator to all aliases contained in a file.
+ *
+ * @param[in] state The state.
+ * @param[in] file_name The file name.
+ *
+ * Thanks to internal caching, this is an O(1) operation.
+ *
+ * @ingroup Eolian
+ */
+EAPI Eina_Iterator *eolian_state_aliases_by_file_get(const Eolian_State *state, const char *file_name);
+
+/*
+ * @brief Get an iterator to all named structs contained in a file.
+ *
+ * @param[in] state The state.
+ * @param[in] file_name The file name.
+ *
+ * Thanks to internal caching, this is an O(1) operation.
+ *
+ * @ingroup Eolian
+ */
+EAPI Eina_Iterator *eolian_state_structs_by_file_get(const Eolian_State *state, const char *file_name);
+
+/*
+ * @brief Get an iterator to all enums contained in a file.
+ *
+ * @param[in] state The state.
+ * @param[in] file_name The file name.
+ *
+ * Thanks to internal caching, this is an O(1) operation.
+ *
+ * @ingroup Eolian
+ */
+EAPI Eina_Iterator *eolian_state_enums_by_file_get(const Eolian_State *state, const char *file_name);
+
+/*
+ * @brief A helper function to get all aliases in a state.
+ *
+ * @see eolian_unit_aliases_get
+ *
+ * @ingroup Eolian
+ */
+static inline Eina_Iterator *
+eolian_state_aliases_get(const Eolian_State *state)
+{
+ return eolian_unit_aliases_get(EOLIAN_UNIT(state));
+}
+
+/*
+ * @brief A helper function to get all structs in a state.
+ *
+ * @see eolian_unit_structs_get
+ *
+ * @ingroup Eolian
+ */
+static inline Eina_Iterator *
+eolian_state_structs_get(const Eolian_State *state)
+{
+ return eolian_unit_structs_get(EOLIAN_UNIT(state));
+}
+
+/*
+ * @brief A helper function to get all enums in a state.
+ *
+ * @see eolian_unit_enums_get
+ *
+ * @ingroup Eolian
+ */
+static inline Eina_Iterator *
+eolian_state_enums_get(const Eolian_State *state)
+{
+ return eolian_unit_enums_get(EOLIAN_UNIT(state));
+}
+
+/*
+ * @brief A helper function to get the full name of a class.
+ *
+ * @see eolian_object_name_get
+ *
+ * @ingroup Eolian
+ */
+static inline const char *
+eolian_class_name_get(const Eolian_Class *klass)
+{
+ return eolian_object_name_get(EOLIAN_OBJECT(klass));
+}
+
+/*
+ * @brief A helper function to get the short name of a class.
+ *
+ * @see eolian_object_short_name_get
+ *
+ * @ingroup Eolian
+ */
+static inline const char *
+eolian_class_short_name_get(const Eolian_Class *klass)
+{
+ return eolian_object_short_name_get(EOLIAN_OBJECT(klass));
+}
+
+/*
+ * @brief A helper function to get the namespaces of a class.
+ *
+ * @see eolian_object_namespaces_get
+ *
+ * @ingroup Eolian
+ */
+static inline Eina_Iterator *
+eolian_class_namespaces_get(const Eolian_Class *klass)
+{
+ return eolian_object_namespaces_get(EOLIAN_OBJECT(klass));
+}
+
+/*
+ * @brief Returns the class type of the given class
+ *
+ * @param[in] klass the class
+ * @return the class type
+ *
+ * @ingroup Eolian
+ */
+EAPI Eolian_Class_Type eolian_class_type_get(const Eolian_Class *klass);
/*
* @brief Returns the documentation of a class.
@@ -806,14 +1476,17 @@ EAPI Eolian_Function_Type eolian_function_type_get(const Eolian_Function *functi
EAPI Eolian_Object_Scope eolian_function_scope_get(const Eolian_Function *function_id, Eolian_Function_Type ftype);
/*
- * @brief Returns the name of a function
+ * @brief A helper function to get the name of a function.
*
- * @param[in] function_id Id of the function
- * @return the function name
+ * @see eolian_object_name_get
*
* @ingroup Eolian
*/
-EAPI Eina_Stringshare *eolian_function_name_get(const Eolian_Function *function_id);
+static inline const char *
+eolian_function_name_get(const Eolian_Function *fid)
+{
+ return eolian_object_name_get(EOLIAN_OBJECT(fid));
+}
/*
* @brief Returns the full C name of a function.
@@ -851,7 +1524,7 @@ EAPI Eina_Stringshare *eolian_function_full_c_name_get(const Eolian_Function *fu
*
* @ingroup Eolian
*/
-EAPI const Eolian_Function *eolian_class_function_get_by_name(const Eolian_Class *klass, const char *func_name, Eolian_Function_Type f_type);
+EAPI const Eolian_Function *eolian_class_function_by_name_get(const Eolian_Class *klass, const char *func_name, Eolian_Function_Type f_type);
/*
* @brief Returns a legacy name for a function.
@@ -997,14 +1670,17 @@ EAPI const Eolian_Type *eolian_parameter_type_get(const Eolian_Function_Paramete
EAPI const Eolian_Expression *eolian_parameter_default_value_get(const Eolian_Function_Parameter *param);
/*
- * @brief Get name of a parameter
+ * @brief A helper function to get the name of a function parameter.
*
- * @param[in] param_desc parameter handle
- * @return the name of the parameter
+ * @see eolian_object_name_get
*
* @ingroup Eolian
*/
-EAPI Eina_Stringshare *eolian_parameter_name_get(const Eolian_Function_Parameter *param);
+static inline const char *
+eolian_parameter_name_get(const Eolian_Function_Parameter *param)
+{
+ return eolian_object_name_get(EOLIAN_OBJECT(param));
+}
/*
* @brief Get documentation of a parameter
@@ -1133,14 +1809,17 @@ EAPI Eina_Bool eolian_function_object_is_const(const Eolian_Function *function_i
EAPI const Eolian_Class *eolian_function_class_get(const Eolian_Function *function_id);
/*
- * @brief Get full string of an overriding function (implement).
+ * @brief A helper function to get the full name of an implement.
*
- * @param[in] impl the handle of the implement
- * @return the full string.
+ * @see eolian_object_name_get
*
* @ingroup Eolian
*/
-EAPI Eina_Stringshare *eolian_implement_full_name_get(const Eolian_Implement *impl);
+static inline const char *
+eolian_implement_name_get(const Eolian_Implement *impl)
+{
+ return eolian_object_name_get(EOLIAN_OBJECT(impl));
+}
/*
* @brief Get the class of an overriding function (implement).
@@ -1251,14 +1930,17 @@ EAPI Eina_Bool eolian_implement_is_prop_set(const Eolian_Implement *impl);
EAPI Eina_Iterator *eolian_class_implements_get(const Eolian_Class *klass);
/*
- * @brief Get full string of a constructing function.
+ * @brief A helper function to get the full name of a constructor.
*
- * @param[in] ctor the handle of the constructor
- * @return the full string.
+ * @see eolian_object_name_get
*
* @ingroup Eolian
*/
-EAPI Eina_Stringshare *eolian_constructor_full_name_get(const Eolian_Constructor *ctor);
+static inline const char *
+eolian_constructor_name_get(const Eolian_Constructor *ctor)
+{
+ return eolian_object_name_get(EOLIAN_OBJECT(ctor));
+}
/*
* @brief Get the class of a constructing function.
@@ -1311,14 +1993,17 @@ EAPI Eina_Iterator *eolian_class_constructors_get(const Eolian_Class *klass);
EAPI Eina_Iterator *eolian_class_events_get(const Eolian_Class *klass);
/*
- * @brief Get the name of an event.
+ * @brief A helper function to get the name of an event.
*
- * @param[in] event the event handle
- * @return the name or NULL
+ * @see eolian_object_name_get
*
* @ingroup Eolian
*/
-EAPI Eina_Stringshare *eolian_event_name_get(const Eolian_Event *event);
+static inline const char *
+eolian_event_name_get(const Eolian_Event *event)
+{
+ return eolian_object_name_get(EOLIAN_OBJECT(event));
+}
/*
* @brief Get the type of an event.
@@ -1395,14 +2080,29 @@ EAPI Eina_Bool eolian_event_is_restart(const Eolian_Event *event);
EAPI Eina_Iterator *eolian_class_parts_get(const Eolian_Class *klass);
/*
- * @brief Get the name of a part.
+ * @brief Returns the C name of an event
*
- * @param[in] part the part handle
- * @return the name or NULL
+ * @param[in] event the event handle
+ * @return the event C name
+ *
+ * You're responsible for deleting the stringshare.
+ *
+ * @ingroup Eolian
+ */
+EAPI Eina_Stringshare *eolian_event_c_name_get(const Eolian_Event *event);
+
+/*
+ * @brief A helper function to get the name of a part.
+ *
+ * @see eolian_object_name_get
*
* @ingroup Eolian
*/
-EAPI Eina_Stringshare *eolian_part_name_get(const Eolian_Part *part);
+static inline const char *
+eolian_part_name_get(const Eolian_Part *part)
+{
+ return eolian_object_name_get(EOLIAN_OBJECT(part));
+}
/*
* @brief Get the type of a part.
@@ -1425,18 +2125,6 @@ EAPI const Eolian_Class *eolian_part_class_get(const Eolian_Part *part);
EAPI const Eolian_Documentation *eolian_part_documentation_get(const Eolian_Part *part);
/*
- * @brief Returns the C name of an event
- *
- * @param[in] event the event handle
- * @return the event C name
- *
- * You're responsible for deleting the stringshare.
- *
- * @ingroup Eolian
- */
-EAPI Eina_Stringshare *eolian_event_c_name_get(const Eolian_Event *event);
-
-/*
* @brief Get an event in a class by its name
*
* @param[in] klass the class
@@ -1445,7 +2133,7 @@ EAPI Eina_Stringshare *eolian_event_c_name_get(const Eolian_Event *event);
*
* @ingroup Eolian
*/
-EAPI const Eolian_Event *eolian_class_event_get_by_name(const Eolian_Class *klass, const char *event_name);
+EAPI const Eolian_Event *eolian_class_event_by_name_get(const Eolian_Class *klass, const char *event_name);
/*
* @brief Indicates if the class constructor has to invoke
@@ -1518,114 +2206,6 @@ EAPI Eina_Stringshare *eolian_class_c_name_get(const Eolian_Class *klass);
EAPI Eina_Stringshare *eolian_class_c_data_type_get(const Eolian_Class *klass);
/*
- * @brief Get an alias type declaration by name. Supports namespaces.
- *
- * @param[in] unit the unit to look in
- * @param[in] name the name of the alias
- * @return the alias type or NULL
- *
- * @ingroup Eolian
- */
-EAPI const Eolian_Typedecl *eolian_typedecl_alias_get_by_name(const Eolian_Unit *unit, const char *name);
-
-/*
- * @brief Get a struct declaration by name. Supports namespaces.
- *
- * @param[in] unit the unit to look in
- * @param[in] name the name of the struct
- * @return the struct or NULL
- *
- * @ingroup Eolian
- */
-EAPI const Eolian_Typedecl *eolian_typedecl_struct_get_by_name(const Eolian_Unit *unit, const char *name);
-
-/*
- * @brief Get an enum declaration by name. Supports namespaces.
- *
- * @param[in] unit the unit to look in
- * @param[in] name the name of the struct
- * @return the struct or NULL
- *
- * @ingroup Eolian
- */
-EAPI const Eolian_Typedecl *eolian_typedecl_enum_get_by_name(const Eolian_Unit *unit, const char *name);
-
-/*
- * @brief Get an iterator to all aliases contained in a file.
- *
- * @param[in] unit the unit to look in
- * @param[in] fname the file name without full path
- * @return the iterator or NULL
- *
- * Thanks to internal caching, this is an O(1) operation.
- *
- * @ingroup Eolian
- */
-EAPI Eina_Iterator *eolian_typedecl_aliases_get_by_file(const Eolian_Unit *unit, const char *fname);
-
-/*
- * @brief Get an iterator to all named structs contained in a file.
- *
- * @param[in] unit the unit to look in
- * @param[in] fname the file name without full path
- * @return the iterator or NULL
- *
- * Thanks to internal caching, this is an O(1) operation.
- *
- * @ingroup Eolian
- */
-EAPI Eina_Iterator *eolian_typedecl_structs_get_by_file(const Eolian_Unit *unit, const char *fname);
-
-/*
- * @brief Get an iterator to all enums contained in a file.
- *
- * @param[in] unit the unit to look in
- * @param[in] fname the file name without full path
- * @return the iterator or NULL
- *
- * Thanks to internal caching, this is an O(1) operation.
- *
- * @ingroup Eolian
- */
-EAPI Eina_Iterator *eolian_typedecl_enums_get_by_file(const Eolian_Unit *unit, const char *fname);
-
-/*
- * @brief Get an iterator to all aliases in the Eolian database.
- *
- * @param[in] unit the unit to look in
- * @return the iterator or NULL
- *
- * Thanks to internal caching, this is an O(1) operation.
- *
- * @ingroup Eolian
- */
-EAPI Eina_Iterator *eolian_typedecl_all_aliases_get(const Eolian_Unit *unit);
-
-/*
- * @brief Get an iterator to all structs in the Eolian database.
- *
- * @param[in] unit the unit to look in
- * @return the iterator or NULL
- *
- * Thanks to internal caching, this is an O(1) operation.
- *
- * @ingroup Eolian
- */
-EAPI Eina_Iterator *eolian_typedecl_all_structs_get(const Eolian_Unit *unit);
-
-/*
- * @brief Get an iterator to all enums in the Eolian database.
- *
- * @param[in] unit the unit to look in
- * @return the iterator or NULL
- *
- * Thanks to internal caching, this is an O(1) operation.
- *
- * @ingroup Eolian
- */
-EAPI Eina_Iterator *eolian_typedecl_all_enums_get(const Eolian_Unit *unit);
-
-/*
* @brief Get the type of a type declaration.
*
* @param[in] tp the type declaration.
@@ -1658,14 +2238,17 @@ EAPI Eina_Iterator *eolian_typedecl_struct_fields_get(const Eolian_Typedecl *tp)
EAPI const Eolian_Struct_Type_Field *eolian_typedecl_struct_field_get(const Eolian_Typedecl *tp, const char *field);
/*
- * @brief Get the name of a field of a struct type.
+ * @brief A helper function to get the name of a struct field.
*
- * @param[in] fl the field.
- * @return the name.
+ * @see eolian_object_name_get
*
* @ingroup Eolian
*/
-EAPI Eina_Stringshare *eolian_typedecl_struct_field_name_get(const Eolian_Struct_Type_Field *fl);
+static inline const char *
+eolian_typedecl_struct_field_name_get(const Eolian_Struct_Type_Field *field)
+{
+ return eolian_object_name_get(EOLIAN_OBJECT(field));
+}
/*
* @brief Get the documentation of a field of a struct type.
@@ -1713,14 +2296,17 @@ EAPI Eina_Iterator *eolian_typedecl_enum_fields_get(const Eolian_Typedecl *tp);
EAPI const Eolian_Enum_Type_Field *eolian_typedecl_enum_field_get(const Eolian_Typedecl *tp, const char *field);
/*
- * @brief Get the name of a field of an enum type.
+ * @brief A helper function to get the name of an enum field.
*
- * @param[in] fl the field.
- * @return the name.
+ * @see eolian_object_name_get
*
* @ingroup Eolian
*/
-EAPI Eina_Stringshare *eolian_typedecl_enum_field_name_get(const Eolian_Enum_Type_Field *fl);
+static inline const char *
+eolian_typedecl_enum_field_name_get(const Eolian_Enum_Type_Field *field)
+{
+ return eolian_object_name_get(EOLIAN_OBJECT(field));
+}
/*
* @brief Get the C name of a field of an enum type.
@@ -1782,16 +2368,6 @@ EAPI Eina_Stringshare *eolian_typedecl_enum_legacy_prefix_get(const Eolian_Typed
EAPI const Eolian_Documentation *eolian_typedecl_documentation_get(const Eolian_Typedecl *tp);
/*
- * @brief Get the filename of a type declaration.
- *
- * @param[in] tp the type declaration.
- * @return the filename.
- *
- * @ingroup Eolian
- */
-EAPI Eina_Stringshare *eolian_typedecl_file_get(const Eolian_Typedecl *tp);
-
-/*
* @brief Get the base type of an alias declaration.
*
* @param[in] tp the type declaration.
@@ -1807,13 +2383,12 @@ EAPI const Eolian_Type *eolian_typedecl_base_type_get(const Eolian_Typedecl *tp)
* If the given typedecl is an alias, it returns the result of
* eolian_type_aliased_base_get on its base type. Otherwise this returns NULL.
*
- * @param[in] unit the unit to look in
* @param[in] tp the type declaration.
* @return the lowest alias base or the given type.
*
* @ingroup Eolian
*/
-EAPI const Eolian_Type *eolian_typedecl_aliased_base_get(const Eolian_Unit *unit, const Eolian_Typedecl *tp);
+EAPI const Eolian_Type *eolian_typedecl_aliased_base_get(const Eolian_Typedecl *tp);
/*
* @brief Check if a struct or alias type declaration is extern.
@@ -1828,7 +2403,6 @@ EAPI Eina_Bool eolian_typedecl_is_extern(const Eolian_Typedecl *tp);
/*
* @brief Get the full C type name of the given type.
*
- * @param[in] unit the unit to look in
* @param[in] tp the type declaration.
* @return The C type name assuming @c tp is not NULL.
*
@@ -1838,38 +2412,46 @@ EAPI Eina_Bool eolian_typedecl_is_extern(const Eolian_Typedecl *tp);
*
* @ingroup Eolian
*/
-EAPI Eina_Stringshare *eolian_typedecl_c_type_get(const Eolian_Unit *unit, const Eolian_Typedecl *tp);
+EAPI Eina_Stringshare *eolian_typedecl_c_type_get(const Eolian_Typedecl *tp);
/*
- * @brief Get the name of the given type declaration. Keep in mind that the
- * name doesn't include namespaces.
+ * @brief A helper function to get the full name of a typedecl.
*
- * @param[in] tp the type declaration.
- * @return the name.
+ * @see eolian_object_name_get
*
* @ingroup Eolian
*/
-EAPI Eina_Stringshare *eolian_typedecl_name_get(const Eolian_Typedecl *tp);
+static inline const char *
+eolian_typedecl_name_get(const Eolian_Typedecl *tp)
+{
+ return eolian_object_name_get(EOLIAN_OBJECT(tp));
+}
/*
- * @brief Get the full (namespaced) name of a type declaration.
+ * @brief A helper function to get the short name of a typedecl.
*
- * @param[in] tp the type declaration.
- * @return the name.
+ * @see eolian_object_short_name_get
*
* @ingroup Eolian
*/
-EAPI Eina_Stringshare *eolian_typedecl_full_name_get(const Eolian_Typedecl *tp);
+static inline const char *
+eolian_typedecl_short_name_get(const Eolian_Typedecl *tp)
+{
+ return eolian_object_short_name_get(EOLIAN_OBJECT(tp));
+}
/*
- * @brief Get an iterator to the list of namespaces of the given type decl.
+ * @brief A helper function to get the namespaces of a typedecl.
*
- * @param[in] tp the type declaration.
- * @return the iterator.
+ * @see eolian_object_namespaces_get
*
* @ingroup Eolian
*/
-EAPI Eina_Iterator *eolian_typedecl_namespaces_get(const Eolian_Typedecl *tp);
+static inline Eina_Iterator *
+eolian_typedecl_namespaces_get(const Eolian_Typedecl *tp)
+{
+ return eolian_object_namespaces_get(EOLIAN_OBJECT(tp));
+}
/*
* @brief Get the name of the function used to free this type declaration.
@@ -1915,16 +2497,6 @@ EAPI Eolian_Type_Type eolian_type_type_get(const Eolian_Type *tp);
EAPI Eolian_Type_Builtin_Type eolian_type_builtin_type_get(const Eolian_Type *tp);
/*
- * @brief Get the filename of a type.
- *
- * @param[in] tp the type.
- * @return the filename.
- *
- * @ingroup Eolian
- */
-EAPI Eina_Stringshare *eolian_type_file_get(const Eolian_Type *tp);
-
-/*
* @brief Get the base type of a type.
*
* Only applies to "complex" ordinary types, i.e. this is the first inner
@@ -1956,13 +2528,12 @@ EAPI const Eolian_Type *eolian_type_next_type_get(const Eolian_Type *tp);
*
* This tries to look up alias, struct and enum in that order.
*
- * @param[in] unit the unit to look in
* @param[in] tp the type.
* @return the pointed to type decalration or NULL.
*
* @ingroup Eolian
*/
-EAPI const Eolian_Typedecl *eolian_type_typedecl_get(const Eolian_Unit *unit, const Eolian_Type *tp);
+EAPI const Eolian_Typedecl *eolian_type_typedecl_get(const Eolian_Type *tp);
/*
* @brief Get the lowest base type of an alias stack.
@@ -1974,24 +2545,22 @@ EAPI const Eolian_Typedecl *eolian_type_typedecl_get(const Eolian_Unit *unit, co
* type actually is while still having convenience. Keep in mind that this stops
* if the found type is actually a pointer (has a ptr() on it).
*
- * @param[in] unit the unit to look in
* @param[in] tp the type.
* @return the lowest alias base or the given type.
*
* @ingroup Eolian
*/
-EAPI const Eolian_Type *eolian_type_aliased_base_get(const Eolian_Unit *unit, const Eolian_Type *tp);
+EAPI const Eolian_Type *eolian_type_aliased_base_get(const Eolian_Type *tp);
/*
* @brief Get the class associated with an EOLIAN_TYPE_CLASS type.
*
- * @param[in] unit the unit to look in
* @param[in] tp the type.
* @return the class or NULL.
*
* @ingroup Eolian
*/
-EAPI const Eolian_Class *eolian_type_class_get(const Eolian_Unit *unit, const Eolian_Type *tp);
+EAPI const Eolian_Class *eolian_type_class_get(const Eolian_Type *tp);
/*
* @brief Get whether the given type is owned.
@@ -2028,7 +2597,6 @@ EAPI Eina_Bool eolian_type_is_ptr(const Eolian_Type *tp);
/*
* @brief Get the full C type name of the given type.
*
- * @param[in] unit the unit to look in
* @param[in] tp the type.
* @param[in] ctype the context within which the C type string will be used.
* @return The C type name assuming @c tp is not NULL.
@@ -2039,39 +2607,46 @@ EAPI Eina_Bool eolian_type_is_ptr(const Eolian_Type *tp);
*
* @ingroup Eolian
*/
-EAPI Eina_Stringshare *eolian_type_c_type_get(const Eolian_Unit *unit, const Eolian_Type *tp, Eolian_C_Type_Type ctype);
+EAPI Eina_Stringshare *eolian_type_c_type_get(const Eolian_Type *tp, Eolian_C_Type_Type ctype);
/*
- * @brief Get the name of the given type. For regular types, this is for
- * example "int". For EOLIAN_TYPE_CLASS, this can be "Button". Keep in
- * mind that the name doesn't include namespaces.
+ * @brief A helper function to get the full name of a type.
*
- * @param[in] tp the type.
- * @return the name.
+ * @see eolian_object_name_get
*
* @ingroup Eolian
*/
-EAPI Eina_Stringshare *eolian_type_name_get(const Eolian_Type *tp);
+static inline const char *
+eolian_type_name_get(const Eolian_Type *tp)
+{
+ return eolian_object_name_get(EOLIAN_OBJECT(tp));
+}
/*
- * @brief Get the full (namespaced) name of a type.
+ * @brief A helper function to get the short name of a type.
*
- * @param[in] tp the type.
- * @return the name.
+ * @see eolian_object_short_name_get
*
* @ingroup Eolian
*/
-EAPI Eina_Stringshare *eolian_type_full_name_get(const Eolian_Type *tp);
+static inline const char *
+eolian_type_short_name_get(const Eolian_Type *tp)
+{
+ return eolian_object_short_name_get(EOLIAN_OBJECT(tp));
+}
/*
- * @brief Get an iterator to the list of namespaces of the given type.
+ * @brief A helper function to get the namespaces of a type.
*
- * @param[in] tp the type.
- * @return the iterator.
+ * @see eolian_object_namespaces_get
*
* @ingroup Eolian
*/
-EAPI Eina_Iterator *eolian_type_namespaces_get(const Eolian_Type *tp);
+static inline Eina_Iterator *
+eolian_type_namespaces_get(const Eolian_Type *tp)
+{
+ return eolian_object_namespaces_get(EOLIAN_OBJECT(tp));
+}
/*
* @brief Get the name of the function used to free this type.
@@ -2090,7 +2665,6 @@ EAPI Eina_Stringshare *eolian_type_free_func_get(const Eolian_Type *tp);
/*
* @brief Evaluate an Eolian expression.
*
- * @param[in] unit the unit to look in
* @param[in] expr the expression.
* @param[in] mask the mask of allowed values (can combine with bitwise OR).
* @return the value, its type is set to EOLIAN_EXPR_UNKNOWN on error.
@@ -2100,12 +2674,11 @@ EAPI Eina_Stringshare *eolian_type_free_func_get(const Eolian_Type *tp);
*
* @ingroup Eolian
*/
-EAPI Eolian_Value eolian_expression_eval(const Eolian_Unit *unit, const Eolian_Expression *expr, Eolian_Expression_Mask m);
+EAPI Eolian_Value eolian_expression_eval(const Eolian_Expression *expr, Eolian_Expression_Mask m);
/*
* @brief Evaluate an Eolian expression given a type instead of a mask.
*
- * @param[in] unit the unit to look in
* @param[in] expr the expression.
* @param[in] type the type the expression is assigned to.
* @return the value, its type is set to EOLIAN_EXPR_UNKNOWN on error.
@@ -2115,7 +2688,7 @@ EAPI Eolian_Value eolian_expression_eval(const Eolian_Unit *unit, const Eolian_E
*
* @ingroup Eolian
*/
-EAPI Eolian_Value eolian_expression_eval_type(const Eolian_Unit *unit, const Eolian_Expression *expr, const Eolian_Type *type);
+EAPI Eolian_Value eolian_expression_eval_type(const Eolian_Expression *expr, const Eolian_Type *type);
/*
* @brief Convert the result of expression evaluation to a literal as in how
@@ -2240,76 +2813,6 @@ EAPI const Eolian_Expression *eolian_expression_unary_expression_get(const Eolia
EAPI Eolian_Value eolian_expression_value_get(const Eolian_Expression *expr);
/*
- * @brief Get a global variable by name. Supports namespaces.
- *
- * @param[in] unit the unit to look in
- * @param[in] name the name of the variable
- * @return the variable handle or NULL
- *
- * @ingroup Eolian
- */
-EAPI const Eolian_Variable *eolian_variable_global_get_by_name(const Eolian_Unit *unit, const char *name);
-
-/*
- * @brief Get a constant variable by name. Supports namespaces.
- *
- * @param[in] unit the unit to look in
- * @param[in] name the name of the variable
- * @return the variable handle or NULL
- *
- * @ingroup Eolian
- */
-EAPI const Eolian_Variable *eolian_variable_constant_get_by_name(const Eolian_Unit *unit, const char *name);
-
-/*
- * @brief Get an iterator to all global variables contained in a file.
- *
- * @param[in] unit the unit to look in
- * @param[in] fname the file name without full path
- * @return the iterator or NULL
- *
- * Thanks to internal caching, this is an O(1) operation.
- *
- * @ingroup Eolian
- */
-EAPI Eina_Iterator *eolian_variable_globals_get_by_file(const Eolian_Unit *unit, const char *fname);
-
-/*
- * @brief Get an iterator to all constant variables contained in a file.
- *
- * @param[in] unit the unit to look in
- * @param[in] fname the file name without full path
- * @return the iterator or NULL
- *
- * Thanks to internal caching, this is an O(1) operation.
- *
- * @ingroup Eolian
- */
-EAPI Eina_Iterator *eolian_variable_constants_get_by_file(const Eolian_Unit *unit, const char *fname);
-
-/*
- * @brief Get an iterator to all constant variables in the Eolian database.
- *
- * @return the iterator or NULL
- *
- * Thanks to internal caching, this is an O(1) operation.
- *
- * @ingroup Eolian
- */
-EAPI Eina_Iterator *eolian_variable_all_constants_get(const Eolian_Unit *unit);
-
-/*
- * @brief Get an iterator to all global variables in the Eolian database.
- *
- * @return the iterator or NULL
- *
- * Thanks to internal caching, this is an O(1) operation.
- *
- * @ingroup Eolian
- */
-EAPI Eina_Iterator *eolian_variable_all_globals_get(const Eolian_Unit *unit);
-
-/*
* @brief Get the type of a variable (global, constant)
*
* @param[in] var the variable.
@@ -2330,16 +2833,6 @@ EAPI Eolian_Variable_Type eolian_variable_type_get(const Eolian_Variable *var);
EAPI const Eolian_Documentation *eolian_variable_documentation_get(const Eolian_Variable *var);
/*
- * @brief Get the filename of a variable.
- *
- * @param[in] var the variable.
- * @return the filename or NULL.
- *
- * @ingroup Eolian
- */
-EAPI Eina_Stringshare *eolian_variable_file_get(const Eolian_Variable *var);
-
-/*
* @brief Get the base type of a variable.
*
* @param[in] var the variable.
@@ -2360,34 +2853,43 @@ EAPI const Eolian_Type *eolian_variable_base_type_get(const Eolian_Variable *var
EAPI const Eolian_Expression *eolian_variable_value_get(const Eolian_Variable *var);
/*
- * @brief Get the name of the given variable (without namespaces).
+ * @brief A helper function to get the full name of a variable.
*
- * @param[in] var the variable.
- * @return the name.
+ * @see eolian_object_name_get
*
* @ingroup Eolian
*/
-EAPI Eina_Stringshare *eolian_variable_name_get(const Eolian_Variable *var);
+static inline const char *
+eolian_variable_name_get(const Eolian_Variable *tp)
+{
+ return eolian_object_name_get(EOLIAN_OBJECT(tp));
+}
/*
- * @brief Get the name of the given variable (with namespaces).
+ * @brief A helper function to get the short name of a variable.
*
- * @param[in] var the variable.
- * @return the name.
+ * @see eolian_object_short_name_get
*
* @ingroup Eolian
*/
-EAPI Eina_Stringshare *eolian_variable_full_name_get(const Eolian_Variable *var);
+static inline const char *
+eolian_variable_short_name_get(const Eolian_Variable *tp)
+{
+ return eolian_object_short_name_get(EOLIAN_OBJECT(tp));
+}
/*
- * @brief Get an iterator to the list of namespaces of the given variable.
+ * @brief A helper function to get the namespaces of a variable.
*
- * @param[in] var the variable.
- * @return the iterator.
+ * @see eolian_object_namespaces_get
*
* @ingroup Eolian
*/
-EAPI Eina_Iterator *eolian_variable_namespaces_get(const Eolian_Variable *var);
+static inline Eina_Iterator *
+eolian_variable_namespaces_get(const Eolian_Variable *tp)
+{
+ return eolian_object_namespaces_get(EOLIAN_OBJECT(tp));
+}
/*
* @brief Check if a variable is extern.
@@ -2400,97 +2902,6 @@ EAPI Eina_Iterator *eolian_variable_namespaces_get(const Eolian_Variable *var);
EAPI Eina_Bool eolian_variable_is_extern(const Eolian_Variable *var);
/*
- * @brief Get a declaration by name.
- *
- * @param[in] unit the unit to look in
- * @param[in] name the declaration name.
- * @return the declaration.
- *
- * @ingroup Eolian
- */
-EAPI const Eolian_Declaration *eolian_declaration_get_by_name(const Eolian_Unit *unit, const char *name);
-
-/*
- * @brief Get a list of declarations in a file.
- *
- * This function gets an iterator to a list of declarations in a particular
- * file. Declarations are either a class, a type alias, a struct, an enum
- * or a variable. This way you can get them all in the original order they
- * were declared in, which is useful during generation.
- *
- * @param[in] state the state to look in
- * @param[in] fname the filename.
- * @return the iterator or NULL.
- *
- * @ingroup Eolian
- */
-EAPI Eina_Iterator *eolian_declarations_get_by_file(const Eolian *state, const char *fname);
-
-/*
- * @brief Get an iterator to all declarations in the Eolian database.
- *
- * @param[in] unit the unit to look in
- * @return the iterator or NULL.
- *
- * Thanks to internal caching this is an O(1) operation.
- *
- * @ingroup Eolian
- */
-EAPI Eina_Iterator *eolian_all_declarations_get(const Eolian_Unit *unit);
-
-/*
- * @brief Get the type of a declaration
- *
- * @param[in] decl the declaration
- * @return the declaration type
- *
- * @ingroup Eolian
- */
-EAPI Eolian_Declaration_Type eolian_declaration_type_get(const Eolian_Declaration *decl);
-
-/*
- * @brief Get the name of a declaration
- *
- * This matches the full namespaced name of the data it's holding.
- *
- * @param[in] decl the declaration
- * @return the declaration name
- *
- * @ingroup Eolian
- */
-EAPI Eina_Stringshare *eolian_declaration_name_get(const Eolian_Declaration *decl);
-
-/*
- * @brief Get the class of a class declaration.
- *
- * @param[in] decl the declaration
- * @return the class
- *
- * @ingroup Eolian
- */
-EAPI const Eolian_Class *eolian_declaration_class_get(const Eolian_Declaration *decl);
-
-/*
- * @brief Get the type of a type (alias, struct, enum) declaration.
- *
- * @param[in] decl the declaration
- * @return the type
- *
- * @ingroup Eolian
- */
-EAPI const Eolian_Typedecl *eolian_declaration_data_type_get(const Eolian_Declaration *decl);
-
-/*
- * @brief Get the variable of a variable (constant, global) declaration.
- *
- * @param[in] decl the declaration
- * @return the class
- *
- * @ingroup Eolian
- */
-EAPI const Eolian_Variable *eolian_declaration_variable_get(const Eolian_Declaration *decl);
-
-/*
* @brief Get the summary of the documentation.
*
* This should never return NULL unless the input is invalid.
@@ -2597,7 +3008,7 @@ EAPI char *eolian_doc_token_text_get(const Eolian_Doc_Token *tok);
/*
* @brief Get the thing that a reference token references.
*
- * Returns EOLIAN_DOC_REF_INVALID on failure (when not ref token or
+ * Returns EOLIAN_OBJECT_UNKNOWN on failure (when not ref token or
* invalid ref, but invalid refs don't happen when database is valid).
*
* When the reference is a class, alias, struct, enum or var, the first data arg
@@ -2606,13 +3017,13 @@ EAPI char *eolian_doc_token_text_get(const Eolian_Doc_Token *tok);
* and the second data is the event, when it's a struct field or enum field
* the first data is is the struct/enum and the second data is the field.
*
- * @param[in] unit the unit to look in
* @param[in] tok the token
+ * @param[in] state the state to look in
* @param[out] data the primary data
* @param[out] data2 the secondary data
* @return the kind of reference this is
*/
-EAPI Eolian_Doc_Ref_Type eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok, const void **data, const void **data2);
+EAPI Eolian_Object_Type eolian_doc_token_ref_resolve(const Eolian_Doc_Token *tok, const Eolian_State *state, const Eolian_Object **data, const Eolian_Object **data2);
#endif
diff --git a/src/lib/eolian/database_check.c b/src/lib/eolian/database_check.c
new file mode 100644
index 0000000000..c13ca18002
--- /dev/null
+++ b/src/lib/eolian/database_check.c
@@ -0,0 +1,299 @@
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "eo_lexer.h"
+#include "eolian_priv.h"
+
+static Eina_Bool
+_check_cycle(Eina_Hash *chash, const Eolian_Object *obj)
+{
+ /* need to check this for classes, typedecls, vars (toplevel objects) */
+ if (eina_hash_find(chash, &obj))
+ return EINA_TRUE;
+ eina_hash_add(chash, &obj, obj);
+ return EINA_FALSE;
+}
+
+static void
+_add_dep(Eina_Hash *depset, const Eolian_Unit *dep)
+{
+ if (!eina_hash_find(depset, &dep))
+ eina_hash_add(depset, &dep, dep);
+}
+
+static void
+_check_type(const Eolian_Type *tp, Eina_Hash *depset, Eina_Hash *chash)
+{
+ if (tp->base_type)
+ _check_type(tp->base_type, depset, chash);
+
+ if (tp->next_type)
+ {
+ const Eolian_Type *ntp = tp->next_type;
+ for (; ntp; ntp = ntp->next_type)
+ _check_type(ntp, depset, chash);
+ }
+
+ /* also covers EOLIAN_TYPE_CLASS */
+ if (tp->tdecl)
+ _add_dep(depset, ((const Eolian_Object *)tp->tdecl)->unit);
+}
+
+static void
+_check_expr_cb(const Eolian_Object *obj, void *data)
+{
+ Eina_Hash *depset = data;
+ switch (obj->type)
+ {
+ case EOLIAN_OBJECT_TYPEDECL:
+ case EOLIAN_OBJECT_VARIABLE:
+ _add_dep(depset, obj->unit);
+ default:
+ break;
+ }
+}
+
+static void
+_check_expr(const Eolian_Expression *expr, Eina_Hash *depset)
+{
+ database_expr_eval(expr->base.unit, (Eolian_Expression *)expr,
+ EOLIAN_MASK_ALL, _check_expr_cb, depset);
+}
+
+static void
+_check_param(const Eolian_Function_Parameter *arg, Eina_Hash *depset,
+ Eina_Hash *chash)
+{
+ if (arg->type)
+ _check_type(arg->type, depset, chash);
+ if (arg->value)
+ _check_expr(arg->value, depset);
+}
+
+static void
+_check_function(const Eolian_Function *f, Eina_Hash *depset, Eina_Hash *chash)
+{
+ if (f->get_ret_type)
+ _check_type(f->get_ret_type, depset, chash);
+ if (f->set_ret_type)
+ _check_type(f->set_ret_type, depset, chash);
+
+ if (f->get_ret_val)
+ _check_expr(f->get_ret_val, depset);
+ if (f->set_ret_val)
+ _check_expr(f->set_ret_val, depset);
+
+ Eina_List *l;
+ const Eolian_Function_Parameter *arg;
+ if ((f->type == EOLIAN_METHOD) || (f->type == EOLIAN_FUNCTION_POINTER))
+ {
+ EINA_LIST_FOREACH(f->params, l, arg)
+ _check_param(arg, depset, chash);
+ }
+ else
+ {
+ EINA_LIST_FOREACH(f->prop_values, l, arg)
+ _check_param(arg, depset, chash);
+ EINA_LIST_FOREACH(f->prop_values_get, l, arg)
+ _check_param(arg, depset, chash);
+ EINA_LIST_FOREACH(f->prop_values_set, l, arg)
+ _check_param(arg, depset, chash);
+ EINA_LIST_FOREACH(f->prop_keys, l, arg)
+ _check_param(arg, depset, chash);
+ EINA_LIST_FOREACH(f->prop_keys_get, l, arg)
+ _check_param(arg, depset, chash);
+ EINA_LIST_FOREACH(f->prop_keys_set, l, arg)
+ _check_param(arg, depset, chash);
+ }
+}
+
+static void
+_check_class(const Eolian_Class *cl, Eina_Hash *depset, Eina_Hash *chash)
+{
+ if (_check_cycle(chash, &cl->base))
+ return;
+
+ _add_dep(depset, cl->base.unit);
+
+ Eina_Iterator *itr = eina_list_iterator_new(cl->inherits);
+ const Eolian_Class *icl;
+ EINA_ITERATOR_FOREACH(itr, icl)
+ _add_dep(depset, icl->base.unit);
+ eina_iterator_free(itr);
+
+ const Eolian_Function *fid;
+ itr = eina_list_iterator_new(cl->properties);
+ EINA_ITERATOR_FOREACH(itr, fid)
+ _check_function(fid, depset, chash);
+ eina_iterator_free(itr);
+
+ itr = eina_list_iterator_new(cl->methods);
+ EINA_ITERATOR_FOREACH(itr, fid)
+ _check_function(fid, depset, chash);
+ eina_iterator_free(itr);
+
+ const Eolian_Event *ev;
+ itr = eina_list_iterator_new(cl->events);
+ EINA_ITERATOR_FOREACH(itr, ev)
+ {
+ if (ev->type)
+ _check_type(ev->type, depset, chash);
+ }
+ eina_iterator_free(itr);
+
+ const Eolian_Part *part;
+ itr = eina_list_iterator_new(cl->parts);
+ EINA_ITERATOR_FOREACH(itr, part)
+ _add_dep(depset, part->klass->base.unit);
+ eina_iterator_free(itr);
+}
+
+static void
+_check_typedecl(const Eolian_Typedecl *tp, Eina_Hash *depset, Eina_Hash *chash)
+{
+ if (_check_cycle(chash, &tp->base))
+ return;
+
+ _add_dep(depset, tp->base.unit);
+
+ if (tp->base_type)
+ _check_type(tp->base_type, depset, chash);
+
+ if (tp->field_list)
+ {
+ Eina_List *l;
+ void *data;
+ EINA_LIST_FOREACH(tp->field_list, l, data)
+ {
+ switch (tp->type)
+ {
+ case EOLIAN_TYPEDECL_STRUCT:
+ _check_type(((const Eolian_Struct_Type_Field *)data)->type,
+ depset, chash);
+ break;
+ case EOLIAN_TYPEDECL_ENUM:
+ _check_expr(((const Eolian_Enum_Type_Field *)data)->value,
+ depset);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ if (tp->function_pointer)
+ _check_function(tp->function_pointer, depset, chash);
+}
+
+static void
+_check_variable(const Eolian_Variable *v, Eina_Hash *depset, Eina_Hash *chash)
+{
+ if (_check_cycle(chash, &v->base))
+ return;
+
+ _add_dep(depset, v->base.unit);
+
+ _check_type(v->base_type, depset, chash);
+ if (v->value)
+ _check_expr(v->value, depset);
+}
+
+static Eina_Bool
+_check_unit(const Eolian_Unit *unit)
+{
+ Eina_Bool ret = EINA_TRUE;
+ Eina_Hash *depset = eina_hash_pointer_new(NULL);
+
+ /* collect all real dependencies of the unit */
+ Eina_Hash *chash = eina_hash_pointer_new(NULL);
+ Eina_Iterator *itr = eolian_unit_objects_get(unit);
+ const Eolian_Object *obj;
+ EINA_ITERATOR_FOREACH(itr, obj)
+ {
+ /* skip stuff merged in from children */
+ if (obj->unit != unit)
+ continue;
+ switch (obj->type)
+ {
+ case EOLIAN_OBJECT_CLASS:
+ _check_class((const Eolian_Class *)obj, depset, chash);
+ break;
+ case EOLIAN_OBJECT_TYPEDECL:
+ _check_typedecl((const Eolian_Typedecl *)obj, depset, chash);
+ break;
+ case EOLIAN_OBJECT_VARIABLE:
+ _check_variable((const Eolian_Variable *)obj, depset, chash);
+ break;
+ default:
+ continue;
+ }
+ }
+ eina_hash_free(chash);
+
+ /* check collected deps against children units */
+ Eina_Iterator *citr = eolian_unit_children_get(unit);
+ const Eolian_Unit *cunit;
+ EINA_ITERATOR_FOREACH(citr, cunit)
+ {
+ if (!eina_hash_find(depset, &cunit))
+ {
+ eolian_state_log(unit->state, "%s: unused dependency %s",
+ unit->file, cunit->file);
+ ret = EINA_FALSE;
+ }
+ }
+ eina_iterator_free(citr);
+
+ eina_hash_free(depset);
+ return ret;
+}
+
+static Eina_Bool
+_check_namespaces(const Eolian_Unit *src)
+{
+ Eina_Bool ret = EINA_TRUE;
+ Eina_Iterator *itr = eina_hash_iterator_data_new(src->objects);
+ const Eolian_Object *obj;
+ EINA_ITERATOR_FOREACH(itr, obj)
+ {
+ char const *dot = strrchr(obj->name, '.');
+ if (!dot)
+ continue;
+ Eina_Stringshare *ssr = eina_stringshare_add_length(obj->name,
+ dot - obj->name);
+ const Eolian_Object *cobj = eina_hash_find(src->objects, ssr);
+ eina_stringshare_del(ssr);
+ if (cobj)
+ {
+ eolian_state_log_obj(src->state, obj,
+ "the namespace of object '%s' conflicts with %s:%d:%d",
+ obj->name, cobj->file, cobj->line, cobj->column);
+ ret = EINA_FALSE;
+ }
+ }
+ eina_iterator_free(itr);
+ return ret;
+}
+
+Eina_Bool
+database_check(const Eolian_State *state)
+{
+ Eina_Bool ret = EINA_TRUE;
+
+ /* check for extra dependencies */
+ Eina_Iterator *itr = eolian_state_units_get(state);
+ const Eolian_Unit *unit;
+ EINA_ITERATOR_FOREACH(itr, unit)
+ {
+ if (!_check_unit(unit))
+ ret = EINA_FALSE;
+ }
+ eina_iterator_free(itr);
+
+ /* namespace checks */
+ if (!_check_namespaces(&state->main.unit))
+ ret = EINA_FALSE;
+
+ return ret;
+}
diff --git a/src/lib/eolian/database_class.c b/src/lib/eolian/database_class.c
index ac5e3055e9..5bd22dfe7f 100644
--- a/src/lib/eolian/database_class.c
+++ b/src/lib/eolian/database_class.c
@@ -13,11 +13,11 @@ database_class_del(Eolian_Class *cl)
Eolian_Part *pt;
Eolian_Implement *impl;
Eolian_Constructor *ctor;
- const char *s;
- if (!cl) return;
+ if (!cl || eolian_object_unref(&cl->base)) return;
- if (cl->base.file) eina_stringshare_del(cl->base.file);
+ eina_stringshare_del(cl->base.file);
+ eina_stringshare_del(cl->base.name);
EINA_LIST_FREE(cl->implements, impl)
database_implement_del(impl);
@@ -30,8 +30,6 @@ database_class_del(Eolian_Class *cl)
EINA_LIST_FREE(cl->events, ev) database_event_del(ev);
EINA_LIST_FREE(cl->parts, pt) database_part_del(pt);
- if (cl->name) eina_stringshare_del(cl->name);
- if (cl->full_name) eina_stringshare_del(cl->full_name);
if (cl->legacy_prefix) eina_stringshare_del(cl->legacy_prefix);
if (cl->eo_prefix) eina_stringshare_del(cl->eo_prefix);
if (cl->ev_prefix) eina_stringshare_del(cl->ev_prefix);
@@ -39,8 +37,5 @@ database_class_del(Eolian_Class *cl)
database_doc_del(cl->doc);
- if (cl->namespaces) EINA_LIST_FREE(cl->namespaces, s)
- if (s) eina_stringshare_del(s);
-
free(cl);
}
diff --git a/src/lib/eolian/database_class_api.c b/src/lib/eolian/database_class_api.c
index ae151f4e82..dad2c77fc7 100644
--- a/src/lib/eolian/database_class_api.c
+++ b/src/lib/eolian/database_class_api.c
@@ -6,51 +6,6 @@
#include "eolian_database.h"
#include "eolian_priv.h"
-EAPI Eina_Stringshare *
-eolian_class_file_get(const Eolian_Class *cl)
-{
- return cl ? cl->base.file : NULL;
-}
-
-EAPI Eina_Stringshare *
-eolian_class_full_name_get(const Eolian_Class *cl)
-{
- return cl ? cl->full_name : NULL;
-}
-
-EAPI Eina_Stringshare *
-eolian_class_name_get(const Eolian_Class *cl)
-{
- return cl ? cl->name : NULL;
-}
-
-EAPI Eina_Iterator *
-eolian_class_namespaces_get(const Eolian_Class *cl)
-{
- return ((cl && cl->namespaces) ? eina_list_iterator_new(cl->namespaces)
- : NULL);
-}
-
-EAPI const Eolian_Class *
-eolian_class_get_by_name(const Eolian_Unit *unit, const char *class_name)
-{
- if (!unit) return NULL;
- Eina_Stringshare *shr = eina_stringshare_add(class_name);
- Eolian_Class *cl = eina_hash_find(unit->state->unit.classes, shr);
- eina_stringshare_del(shr);
- return cl;
-}
-
-EAPI const Eolian_Class *
-eolian_class_get_by_file(const Eolian_Unit *unit, const char *file_name)
-{
- if (!unit) return NULL;
- Eina_Stringshare *shr = eina_stringshare_add(file_name);
- Eolian_Class *cl = eina_hash_find(unit->state->classes_f, shr);
- eina_stringshare_del(shr);
- return cl;
-}
-
EAPI Eolian_Class_Type
eolian_class_type_get(const Eolian_Class *cl)
{
@@ -58,12 +13,6 @@ eolian_class_type_get(const Eolian_Class *cl)
return cl->type;
}
-EAPI Eina_Iterator *
-eolian_all_classes_get(const Eolian_Unit *unit)
-{
- return (unit ? eina_hash_iterator_data_new(unit->state->unit.classes) : NULL);
-}
-
EAPI const Eolian_Documentation *
eolian_class_documentation_get(const Eolian_Class *cl)
{
@@ -121,7 +70,7 @@ eolian_class_constructors_get(const Eolian_Class *cl)
}
EAPI const Eolian_Function *
-eolian_class_function_get_by_name(const Eolian_Class *cl, const char *func_name, Eolian_Function_Type f_type)
+eolian_class_function_by_name_get(const Eolian_Class *cl, const char *func_name, Eolian_Function_Type f_type)
{
Eina_List *itr;
Eolian_Function *fid;
@@ -130,7 +79,7 @@ eolian_class_function_get_by_name(const Eolian_Class *cl, const char *func_name,
if (f_type == EOLIAN_UNRESOLVED || f_type == EOLIAN_METHOD)
EINA_LIST_FOREACH(cl->methods, itr, fid)
{
- if (!strcmp(fid->name, func_name))
+ if (!strcmp(fid->base.name, func_name))
return fid;
}
@@ -141,12 +90,13 @@ eolian_class_function_get_by_name(const Eolian_Class *cl, const char *func_name,
{
if (!database_function_is_type(fid, f_type))
continue;
- if (!strcmp(fid->name, func_name))
+ if (!strcmp(fid->base.name, func_name))
return fid;
}
}
- _eolian_log("function '%s' not found in class '%s'", func_name, cl->name);
+ eolian_state_log(cl->base.unit->state, "function '%s' not found in class '%s'",
+ func_name, eolian_object_short_name_get(&cl->base));
return NULL;
}
@@ -199,7 +149,7 @@ eolian_class_c_get_function_name_get(const Eolian_Class *cl)
Eina_Stringshare *ret;
Eina_Strbuf *buf = eina_strbuf_new();
char *bufp;
- eina_strbuf_append(buf, cl->full_name);
+ eina_strbuf_append(buf, cl->base.name);
switch (cl->type)
{
case EOLIAN_CLASS_INTERFACE:
@@ -228,7 +178,7 @@ eolian_class_c_name_get(const Eolian_Class *cl)
Eina_Stringshare *ret;
Eina_Strbuf *buf = eina_strbuf_new();
char *bufp;
- eina_strbuf_append(buf, cl->full_name);
+ eina_strbuf_append(buf, cl->base.name);
switch (cl->type)
{
case EOLIAN_CLASS_INTERFACE:
@@ -256,7 +206,7 @@ eolian_class_c_data_type_get(const Eolian_Class *cl)
char buf[512];
EINA_SAFETY_ON_NULL_RETURN_VAL(cl, NULL);
if (!cl->data_type)
- snprintf(buf, sizeof(buf), "%s_Data", cl->full_name);
+ snprintf(buf, sizeof(buf), "%s_Data", cl->base.name);
else if (!strcmp(cl->data_type, "null"))
return eina_stringshare_add("void");
else
diff --git a/src/lib/eolian/database_constructor.c b/src/lib/eolian/database_constructor.c
index 2c1370209f..1d0f4a4f25 100644
--- a/src/lib/eolian/database_constructor.c
+++ b/src/lib/eolian/database_constructor.c
@@ -9,7 +9,7 @@ void
database_constructor_del(Eolian_Constructor *ctor)
{
if (!ctor) return;
- if (ctor->base.file) eina_stringshare_del(ctor->base.file);
- if (ctor->full_name) eina_stringshare_del(ctor->full_name);
+ eina_stringshare_del(ctor->base.file);
+ eina_stringshare_del(ctor->base.name);
free(ctor);
}
diff --git a/src/lib/eolian/database_constructor_api.c b/src/lib/eolian/database_constructor_api.c
index 90b1d47e97..bedf9ab7da 100644
--- a/src/lib/eolian/database_constructor_api.c
+++ b/src/lib/eolian/database_constructor_api.c
@@ -5,13 +5,6 @@
#include <Eina.h>
#include "eolian_database.h"
-EAPI Eina_Stringshare *
-eolian_constructor_full_name_get(const Eolian_Constructor *ctor)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(ctor, NULL);
- return ctor->full_name;
-}
-
EAPI const Eolian_Class *
eolian_constructor_class_get(const Eolian_Constructor *ctor)
{
@@ -26,8 +19,8 @@ eolian_constructor_function_get(const Eolian_Constructor *ctor)
const Eolian_Class *klass = eolian_constructor_class_get(ctor);
if (!klass)
return NULL;
- return eolian_class_function_get_by_name(klass,
- ctor->full_name + strlen(klass->full_name) + 1, EOLIAN_UNRESOLVED);
+ return eolian_class_function_by_name_get(klass,
+ ctor->base.name + strlen(klass->base.name) + 1, EOLIAN_UNRESOLVED);
}
EAPI Eina_Bool
diff --git a/src/lib/eolian/database_event.c b/src/lib/eolian/database_event.c
index 6dcd953990..6513787ea8 100644
--- a/src/lib/eolian/database_event.c
+++ b/src/lib/eolian/database_event.c
@@ -9,7 +9,8 @@ void
database_event_del(Eolian_Event *event)
{
if (!event) return;
- if (event->name) eina_stringshare_del(event->name);
+ eina_stringshare_del(event->base.file);
+ eina_stringshare_del(event->base.name);
database_type_del(event->type);
database_doc_del(event->doc);
free(event);
diff --git a/src/lib/eolian/database_event_api.c b/src/lib/eolian/database_event_api.c
index 0bd4acce86..32306009e3 100644
--- a/src/lib/eolian/database_event_api.c
+++ b/src/lib/eolian/database_event_api.c
@@ -5,17 +5,12 @@
#include <Eina.h>
#include "eolian_database.h"
-EAPI Eina_Stringshare *
-eolian_event_name_get(const Eolian_Event *event)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(event, NULL);
- return event->name;
-}
-
EAPI const Eolian_Type *
eolian_event_type_get(const Eolian_Event *event)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(event, NULL);
+ if (event->type && (event->type->type == EOLIAN_TYPE_VOID))
+ return NULL;
return event->type;
}
@@ -61,15 +56,15 @@ eolian_event_c_name_get(const Eolian_Event *event)
char *tmp = buf;
const char *pfx = event->klass->ev_prefix;
if (!pfx) pfx = event->klass->eo_prefix;
- if (!pfx) pfx = event->klass->full_name;
- snprintf(buf, sizeof(buf), "%s_EVENT_%s", pfx, event->name);
+ if (!pfx) pfx = event->klass->base.name;
+ snprintf(buf, sizeof(buf), "%s_EVENT_%s", pfx, event->base.name);
eina_str_toupper(&tmp);
while ((tmp = strpbrk(tmp, ".,"))) *tmp = '_';
return eina_stringshare_add(buf);
}
EAPI const Eolian_Event *
-eolian_class_event_get_by_name(const Eolian_Class *klass, const char *event_name)
+eolian_class_event_by_name_get(const Eolian_Class *klass, const char *event_name)
{
Eina_List *itr;
Eolian_Event *event = NULL;
@@ -78,7 +73,7 @@ eolian_class_event_get_by_name(const Eolian_Class *klass, const char *event_name
EINA_LIST_FOREACH(klass->events, itr, event)
{
- if (event->name == shr_ev)
+ if (event->base.name == shr_ev)
goto end;
}
diff --git a/src/lib/eolian/database_expr.c b/src/lib/eolian/database_expr.c
index 1b0a6d10e3..a03c8208a0 100644
--- a/src/lib/eolian/database_expr.c
+++ b/src/lib/eolian/database_expr.c
@@ -7,11 +7,12 @@
#include <Eina.h>
#include "eolian_database.h"
#include "eolian_priv.h"
+#include "eo_lexer.h"
static Eina_Bool
node_error(const Eolian_Object *obj, const char *msg)
{
- _eolian_log_line(obj->file, obj->line, obj->column, "%s", msg);
+ eolian_state_log_obj(obj->unit->state, obj, "%s", msg);
return EINA_FALSE;
}
@@ -182,12 +183,14 @@ promote(Eolian_Expression *a, Eolian_Expression *b)
}
static Eina_Bool eval_exp(const Eolian_Unit *unit,
- const Eolian_Expression *expr,
- Eolian_Expression_Mask mask, Eolian_Expression *out);
+ Eolian_Expression *expr,
+ Eolian_Expression_Mask mask, Eolian_Expression *out,
+ Expr_Obj_Cb cb, void *data);
static Eina_Bool
-eval_unary(const Eolian_Unit *unit, const Eolian_Expression *expr,
- Eolian_Expression_Mask mask, Eolian_Expression *out)
+eval_unary(const Eolian_Unit *unit, Eolian_Expression *expr,
+ Eolian_Expression_Mask mask, Eolian_Expression *out,
+ Expr_Obj_Cb cb, void *data)
{
switch (expr->unop)
{
@@ -197,7 +200,7 @@ eval_unary(const Eolian_Unit *unit, const Eolian_Expression *expr,
if (!(mask & EOLIAN_MASK_SIGNED))
return expr_type_error(expr, EOLIAN_MASK_SIGNED, mask);
- return eval_exp(unit, expr->expr, EOLIAN_MASK_SIGNED, out);
+ return eval_exp(unit, expr->expr, EOLIAN_MASK_SIGNED, out, cb, data);
}
case EOLIAN_UNOP_UNM:
{
@@ -206,7 +209,7 @@ eval_unary(const Eolian_Unit *unit, const Eolian_Expression *expr,
if (!(mask & EOLIAN_MASK_SIGNED))
return expr_type_error(expr, EOLIAN_MASK_SIGNED, mask);
- if (!eval_exp(unit, expr->expr, EOLIAN_MASK_SIGNED, &exp))
+ if (!eval_exp(unit, expr->expr, EOLIAN_MASK_SIGNED, &exp, cb, data))
return EINA_FALSE;
switch (exp.type)
@@ -229,7 +232,7 @@ eval_unary(const Eolian_Unit *unit, const Eolian_Expression *expr,
if (!(mask & EOLIAN_MASK_BOOL))
return expr_type_error(expr, EOLIAN_MASK_BOOL, mask);
- if (!eval_exp(unit, expr->expr, EOLIAN_MASK_NUMBER | EOLIAN_MASK_BOOL, &exp))
+ if (!eval_exp(unit, expr->expr, EOLIAN_MASK_NUMBER | EOLIAN_MASK_BOOL, &exp, cb, data))
return EINA_FALSE;
exp.value.b = !(exp.value.ull);
@@ -245,7 +248,7 @@ eval_unary(const Eolian_Unit *unit, const Eolian_Expression *expr,
if (!(mask & EOLIAN_MASK_INT))
return expr_type_error(expr, EOLIAN_MASK_INT, mask);
- if (!eval_exp(unit, expr->expr, EOLIAN_MASK_INT, &exp))
+ if (!eval_exp(unit, expr->expr, EOLIAN_MASK_INT, &exp, cb, data))
return EINA_FALSE;
switch (exp.type)
@@ -272,19 +275,19 @@ eval_unary(const Eolian_Unit *unit, const Eolian_Expression *expr,
}
static Eina_Bool
-eval_promote_num(const Eolian_Unit *unit, const Eolian_Expression *expr,
+eval_promote_num(const Eolian_Unit *unit, Eolian_Expression *expr,
Eolian_Expression *lhs, Eolian_Expression *rhs, int mask,
- int emask)
+ int emask, Expr_Obj_Cb cb, void *data)
{
/* make sure the output can be a number */
if (!(mask & EOLIAN_MASK_NUMBER))
return expr_type_error(expr, EOLIAN_MASK_NUMBER, mask);
/* eval into primitive value */
- if (!eval_exp(unit, expr->lhs, emask, lhs))
+ if (!eval_exp(unit, expr->lhs, emask, lhs, cb, data))
return EINA_FALSE;
- if (!eval_exp(unit, expr->rhs, emask, rhs))
+ if (!eval_exp(unit, expr->rhs, emask, rhs, cb, data))
return EINA_FALSE;
/* promote so both sides are of the same type */
@@ -295,8 +298,9 @@ eval_promote_num(const Eolian_Unit *unit, const Eolian_Expression *expr,
}
static Eina_Bool
-eval_binary(const Eolian_Unit *unit, const Eolian_Expression *expr,
- Eolian_Expression_Mask mask, Eolian_Expression *out)
+eval_binary(const Eolian_Unit *unit, Eolian_Expression *expr,
+ Eolian_Expression_Mask mask, Eolian_Expression *out,
+ Expr_Obj_Cb cb, void *data)
{
#define APPLY_CASE(id, expr, lhs, rhs, fnm, op) \
case EOLIAN_EXPR_##id: \
@@ -341,7 +345,7 @@ eval_binary(const Eolian_Unit *unit, const Eolian_Expression *expr,
int emask = (mask & EOLIAN_MASK_FLOAT) \
? EOLIAN_MASK_NUMBER \
: EOLIAN_MASK_INT; \
- if (!eval_promote_num(unit, expr, &lhs, &rhs, mask, emask)) \
+ if (!eval_promote_num(unit, expr, &lhs, &rhs, mask, emask, cb, data)) \
return EINA_FALSE; \
APPLY_NUM(out, lhs, rhs, op) \
return EINA_TRUE; \
@@ -352,7 +356,7 @@ eval_binary(const Eolian_Unit *unit, const Eolian_Expression *expr,
{ \
Eolian_Expression lhs; \
Eolian_Expression rhs; \
- if (!eval_promote_num(unit, expr, &lhs, &rhs, mask, EOLIAN_MASK_INT)) \
+ if (!eval_promote_num(unit, expr, &lhs, &rhs, mask, EOLIAN_MASK_INT, cb, data)) \
return EINA_FALSE; \
APPLY_INT(out, lhs, rhs, op) \
return EINA_TRUE; \
@@ -365,9 +369,9 @@ eval_binary(const Eolian_Unit *unit, const Eolian_Expression *expr,
Eolian_Expression rhs; \
if (!(mask & EOLIAN_MASK_BOOL)) \
return expr_type_error(expr, EOLIAN_MASK_BOOL, mask); \
- if (!eval_exp(unit, expr->lhs, allowed, &lhs)) \
+ if (!eval_exp(unit, expr->lhs, allowed, &lhs, cb, data)) \
return EINA_FALSE; \
- if (!eval_exp(unit, expr->rhs, allowed, &rhs)) \
+ if (!eval_exp(unit, expr->rhs, allowed, &rhs, cb, data)) \
return EINA_FALSE; \
if (lhs.type >= EOLIAN_EXPR_STRING && rhs.type != lhs.type) \
return expr_type_mismatch_error(&lhs, &rhs); \
@@ -436,8 +440,9 @@ split_enum_name(const char *str, char **ename, char **memb)
}
static Eina_Bool
-eval_exp(const Eolian_Unit *unit, const Eolian_Expression *expr,
- Eolian_Expression_Mask mask, Eolian_Expression *out)
+eval_exp(const Eolian_Unit *unit, Eolian_Expression *expr,
+ Eolian_Expression_Mask mask, Eolian_Expression *out,
+ Expr_Obj_Cb cb, void *data)
{
switch (expr->type)
{
@@ -469,7 +474,7 @@ eval_exp(const Eolian_Unit *unit, const Eolian_Expression *expr,
}
case EOLIAN_EXPR_STRING:
{
- if (!(mask & EOLIAN_MASK_STRING))
+ if (!(mask & EOLIAN_MASK_STRING) && !(mask & EOLIAN_MASK_NULL))
return expr_type_error(expr, EOLIAN_MASK_STRING, mask);
*out = *expr;
return EINA_TRUE;
@@ -497,9 +502,16 @@ eval_exp(const Eolian_Unit *unit, const Eolian_Expression *expr,
}
case EOLIAN_EXPR_NAME:
{
- const Eolian_Variable *var = eolian_variable_constant_get_by_name
+ if (!unit)
+ {
+ if (!expr->expr)
+ return expr_error(expr, "undefined value");
+ return eval_exp(NULL, expr->expr, mask, out, cb, data);
+ }
+
+ const Eolian_Variable *var = eolian_unit_constant_by_name_get
(unit, expr->value.s);
- const Eolian_Expression *exp = NULL;
+ Eolian_Expression *exp = NULL;
if (!var)
{
@@ -516,16 +528,21 @@ eval_exp(const Eolian_Unit *unit, const Eolian_Expression *expr,
if (!(mask & EOLIAN_MASK_INT))
return expr_type_error(expr, EOLIAN_MASK_INT, mask);
- etpd = eolian_typedecl_alias_get_by_name(unit, fulln);
+ etpd = eolian_unit_alias_by_name_get(unit, fulln);
+ if (etpd && cb) cb((const Eolian_Object *)etpd, data);
while (etpd && etpd->type == EOLIAN_TYPEDECL_ALIAS)
{
const Eolian_Type *etp = eolian_typedecl_base_type_get(etpd);
if (!etp || etp->type != EOLIAN_TYPE_REGULAR)
break;
- etpd = eolian_type_typedecl_get(unit, etp);
+ etpd = database_type_decl_find(unit, etp);
}
- if (!etpd) etpd = eolian_typedecl_enum_get_by_name(unit, fulln);
+ if (!etpd)
+ {
+ etpd = eolian_unit_enum_by_name_get(unit, fulln);
+ if (etpd && cb) cb((const Eolian_Object *)etpd, data);
+ }
if (!etpd || etpd->type != EOLIAN_TYPEDECL_ENUM)
{
free(fulln);
@@ -533,24 +550,28 @@ eval_exp(const Eolian_Unit *unit, const Eolian_Expression *expr,
}
fl = eolian_typedecl_enum_field_get(etpd, memb);
- if (fl) exp = eolian_typedecl_enum_field_value_get(fl, EINA_TRUE);
+ if (fl) exp = (Eolian_Expression *)eolian_typedecl_enum_field_value_get(fl, EINA_TRUE);
free(fulln);
if (!exp)
return expr_error(expr, "invalid enum field");
}
else
- exp = var->value;
+ {
+ exp = (Eolian_Expression *)var->value;
+ if (cb) cb((const Eolian_Object *)var, data);
+ }
if (!exp)
return expr_error(expr, "undefined variable");
- return eval_exp(unit, exp, mask, out);
+ expr->expr = exp;
+ return eval_exp(unit, exp, mask, out, cb, data);
}
case EOLIAN_EXPR_UNARY:
- return eval_unary(unit, expr, mask, out);
+ return eval_unary(unit, expr, mask, out, cb, data);
case EOLIAN_EXPR_BINARY:
- return eval_binary(unit, expr, mask, out);
+ return eval_binary(unit, expr, mask, out, cb, data);
default:
assert(EINA_FALSE);
return EINA_FALSE;
@@ -560,21 +581,95 @@ eval_exp(const Eolian_Unit *unit, const Eolian_Expression *expr,
}
Eolian_Value
-database_expr_eval(const Eolian_Unit *unit, const Eolian_Expression *expr,
- Eolian_Expression_Mask mask)
+database_expr_eval(const Eolian_Unit *unit, Eolian_Expression *expr,
+ Eolian_Expression_Mask mask, Expr_Obj_Cb cb, void *data)
{
Eolian_Expression out;
Eolian_Value ret;
ret.type = EOLIAN_EXPR_UNKNOWN;
if (!mask)
return ret;
- if (!eval_exp(unit, expr, mask, &out))
+ if (!eval_exp(unit, expr, mask, &out, cb, data))
return ret;
ret.type = out.type;
ret.value = out.value;
return ret;
}
+Eolian_Value
+database_expr_eval_type(const Eolian_Unit *unit, Eolian_Expression *expr,
+ const Eolian_Type *type, Expr_Obj_Cb cb, void *data)
+{
+ Eolian_Value err;
+ err.type = EOLIAN_EXPR_UNKNOWN;
+ if (!type)
+ return err;
+ switch (type->type)
+ {
+ case EOLIAN_TYPE_CLASS:
+ return database_expr_eval(unit, expr, EOLIAN_MASK_NULL, cb, data);
+ case EOLIAN_TYPE_REGULAR:
+ {
+ if (database_type_is_ownable(unit, type, EINA_FALSE))
+ return database_expr_eval(unit, expr, EOLIAN_MASK_NULL, cb, data);
+ int kw = eo_lexer_keyword_str_to_id(type->base.name);
+ if (!kw || kw < KW_byte || kw >= KW_void)
+ {
+ const Eolian_Typedecl *base = database_type_decl_find(unit, type);
+ if (!base)
+ return err;
+ if (base->type == EOLIAN_TYPEDECL_ALIAS)
+ return database_expr_eval_type(unit, expr, eolian_typedecl_base_type_get(base), cb, data);
+ else if (base->type == EOLIAN_TYPEDECL_ENUM)
+ return database_expr_eval(unit, expr, EOLIAN_MASK_INT, cb, data);
+ return err;
+ }
+ switch (kw)
+ {
+ case KW_byte:
+ case KW_short:
+ case KW_int:
+ case KW_long:
+ case KW_llong:
+ case KW_int8:
+ case KW_int16:
+ case KW_int32:
+ case KW_int64:
+ case KW_int128:
+ case KW_ssize:
+ case KW_intptr:
+ case KW_ptrdiff:
+ return database_expr_eval(unit, expr, EOLIAN_MASK_SINT, cb, data);
+ case KW_ubyte:
+ case KW_ushort:
+ case KW_uint:
+ case KW_ulong:
+ case KW_ullong:
+ case KW_uint8:
+ case KW_uint16:
+ case KW_uint32:
+ case KW_uint64:
+ case KW_uint128:
+ case KW_size:
+ case KW_uintptr:
+ case KW_time:
+ return database_expr_eval(unit, expr, EOLIAN_MASK_UINT, cb, data);
+ case KW_float:
+ case KW_double:
+ return database_expr_eval(unit, expr, EOLIAN_MASK_FLOAT, cb, data);
+ case KW_bool:
+ return database_expr_eval(unit, expr, EOLIAN_MASK_BOOL, cb, data);
+ case KW_char:
+ return database_expr_eval(unit, expr, EOLIAN_MASK_CHAR, cb, data);
+ default:
+ return err;
+ }
+ }
+ default:
+ return err;
+ }
+}
+
void
database_expr_del(Eolian_Expression *expr)
{
diff --git a/src/lib/eolian/database_expr_api.c b/src/lib/eolian/database_expr_api.c
index adf573435a..92f5b915aa 100644
--- a/src/lib/eolian/database_expr_api.c
+++ b/src/lib/eolian/database_expr_api.c
@@ -3,101 +3,26 @@
#endif
#include <Eina.h>
-#include "eo_lexer.h"
+
+#include "eolian_database.h"
EAPI Eolian_Value
-eolian_expression_eval(const Eolian_Unit *unit, const Eolian_Expression *expr,
- Eolian_Expression_Mask m)
+eolian_expression_eval(const Eolian_Expression *expr, Eolian_Expression_Mask m)
{
Eolian_Value err;
err.type = EOLIAN_EXPR_UNKNOWN;
EINA_SAFETY_ON_NULL_RETURN_VAL(expr, err);
- return database_expr_eval(unit, expr, m);
-}
-
-static Eolian_Value
-_eval_type(const Eolian_Unit *unit, const Eolian_Expression *expr,
- const Eolian_Type *type)
-{
- Eolian_Value err;
- err.type = EOLIAN_EXPR_UNKNOWN;
- if (!type)
- return err;
- switch (type->type)
- {
- case EOLIAN_TYPE_CLASS:
- return database_expr_eval(unit, expr, EOLIAN_MASK_NULL);
- case EOLIAN_TYPE_REGULAR:
- {
- if (database_type_is_ownable(unit, type))
- return database_expr_eval(unit, expr, EOLIAN_MASK_NULL);
- int kw = eo_lexer_keyword_str_to_id(type->name);
- if (!kw || kw < KW_byte || kw >= KW_void)
- {
- const Eolian_Typedecl *base = eolian_type_typedecl_get(unit, type);
- if (!base)
- return err;
- if (base->type == EOLIAN_TYPEDECL_ALIAS)
- return _eval_type(unit, expr, eolian_typedecl_base_type_get(base));
- else if (base->type == EOLIAN_TYPEDECL_ENUM)
- return database_expr_eval(unit, expr, EOLIAN_MASK_INT);
- return err;
- }
- switch (kw)
- {
- case KW_byte:
- case KW_short:
- case KW_int:
- case KW_long:
- case KW_llong:
- case KW_int8:
- case KW_int16:
- case KW_int32:
- case KW_int64:
- case KW_int128:
- case KW_ssize:
- case KW_intptr:
- case KW_ptrdiff:
- return database_expr_eval(unit, expr, EOLIAN_MASK_SINT);
- case KW_ubyte:
- case KW_ushort:
- case KW_uint:
- case KW_ulong:
- case KW_ullong:
- case KW_uint8:
- case KW_uint16:
- case KW_uint32:
- case KW_uint64:
- case KW_uint128:
- case KW_size:
- case KW_uintptr:
- case KW_time:
- return database_expr_eval(unit, expr, EOLIAN_MASK_UINT);
- case KW_float:
- case KW_double:
- return database_expr_eval(unit, expr, EOLIAN_MASK_FLOAT);
- case KW_bool:
- return database_expr_eval(unit, expr, EOLIAN_MASK_BOOL);
- case KW_char:
- return database_expr_eval(unit, expr, EOLIAN_MASK_CHAR);
- default:
- return err;
- }
- }
- default:
- return err;
- }
+ return database_expr_eval(NULL, (Eolian_Expression *)expr, m, NULL, NULL);
}
EAPI Eolian_Value
-eolian_expression_eval_type(const Eolian_Unit *unit,
- const Eolian_Expression *expr,
+eolian_expression_eval_type(const Eolian_Expression *expr,
const Eolian_Type *type)
{
Eolian_Value err;
err.type = EOLIAN_EXPR_UNKNOWN;
EINA_SAFETY_ON_NULL_RETURN_VAL(expr, err);
- return _eval_type(unit, expr, type);
+ return database_expr_eval_type(NULL, (Eolian_Expression *)expr, type, NULL, NULL);
}
static void
diff --git a/src/lib/eolian/database_function.c b/src/lib/eolian/database_function.c
index 8cf7171f1e..15187e93d7 100644
--- a/src/lib/eolian/database_function.c
+++ b/src/lib/eolian/database_function.c
@@ -12,8 +12,8 @@ database_function_del(Eolian_Function *fid)
Eina_Stringshare *cls_name;
if (!fid) return;
- if (fid->base.file) eina_stringshare_del(fid->base.file);
- eina_stringshare_del(fid->name);
+ eina_stringshare_del(fid->base.file);
+ eina_stringshare_del(fid->base.name);
EINA_LIST_FREE(fid->prop_values, param) database_parameter_del(param);
EINA_LIST_FREE(fid->prop_values_get, param) database_parameter_del(param);
EINA_LIST_FREE(fid->prop_values_set, param) database_parameter_del(param);
@@ -55,7 +55,7 @@ database_function_constructor_add(Eolian_Function *func, const Eolian_Class *cls
{
func->ctor_of = _list_sorted_insert_no_dup
(func->ctor_of, EINA_COMPARE_CB(strcmp),
- eina_stringshare_ref(cls->full_name));
+ eina_stringshare_ref(cls->base.name));
}
Eina_Bool
diff --git a/src/lib/eolian/database_function_api.c b/src/lib/eolian/database_function_api.c
index fffced476b..05e7bf9e51 100644
--- a/src/lib/eolian/database_function_api.c
+++ b/src/lib/eolian/database_function_api.c
@@ -37,13 +37,6 @@ eolian_function_type_get(const Eolian_Function *fid)
return fid->type;
}
-EAPI Eina_Stringshare *
-eolian_function_name_get(const Eolian_Function *fid)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(fid, NULL);
- return fid->name;
-}
-
static const char *
_get_eo_prefix(const Eolian_Function *foo_id, char *buf, Eina_Bool use_legacy)
{
@@ -52,7 +45,7 @@ _get_eo_prefix(const Eolian_Function *foo_id, char *buf, Eina_Bool use_legacy)
return foo_id->klass->legacy_prefix;
else if (foo_id->klass->eo_prefix)
return foo_id->klass->eo_prefix;
- strcpy(buf, foo_id->klass->full_name);
+ strcpy(buf, foo_id->klass->base.name);
eina_str_tolower(&buf);
while ((tmp = strchr(tmp, '.'))) *tmp = '_';
return buf;
@@ -229,7 +222,7 @@ EAPI Eina_Bool
eolian_function_is_constructor(const Eolian_Function *fid, const Eolian_Class *klass)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE);
- Eina_Stringshare *s = eina_stringshare_ref(klass->full_name);
+ Eina_Stringshare *s = eina_stringshare_ref(klass->base.name);
Eina_Bool r = !!eina_list_search_sorted_list
(fid->ctor_of, EINA_COMPARE_CB(strcmp), s);
eina_stringshare_del(s);
diff --git a/src/lib/eolian/database_function_parameter.c b/src/lib/eolian/database_function_parameter.c
index f10a52a47c..dbab917f19 100644
--- a/src/lib/eolian/database_function_parameter.c
+++ b/src/lib/eolian/database_function_parameter.c
@@ -8,8 +8,8 @@
void
database_parameter_del(Eolian_Function_Parameter *pdesc)
{
- if (pdesc->base.file) eina_stringshare_del(pdesc->base.file);
- eina_stringshare_del(pdesc->name);
+ eina_stringshare_del(pdesc->base.file);
+ eina_stringshare_del(pdesc->base.name);
database_type_del(pdesc->type);
database_expr_del(pdesc->value);
diff --git a/src/lib/eolian/database_function_parameter_api.c b/src/lib/eolian/database_function_parameter_api.c
index 34100efbbe..87f1ed34c1 100644
--- a/src/lib/eolian/database_function_parameter_api.c
+++ b/src/lib/eolian/database_function_parameter_api.c
@@ -26,13 +26,6 @@ eolian_parameter_default_value_get(const Eolian_Function_Parameter *param)
return param->value;
}
-EAPI Eina_Stringshare *
-eolian_parameter_name_get(const Eolian_Function_Parameter *param)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(param, NULL);
- return param->name;
-}
-
EAPI const Eolian_Documentation *
eolian_parameter_documentation_get(const Eolian_Function_Parameter *param)
{
diff --git a/src/lib/eolian/database_implement.c b/src/lib/eolian/database_implement.c
index df055aca47..b97a88f7ca 100644
--- a/src/lib/eolian/database_implement.c
+++ b/src/lib/eolian/database_implement.c
@@ -9,8 +9,8 @@ void
database_implement_del(Eolian_Implement *impl)
{
if (!impl) return;
- if (impl->base.file) eina_stringshare_del(impl->base.file);
- if (impl->full_name) eina_stringshare_del(impl->full_name);
+ eina_stringshare_del(impl->base.file);
+ eina_stringshare_del(impl->base.name);
database_doc_del(impl->common_doc);
database_doc_del(impl->get_doc);
database_doc_del(impl->set_doc);
diff --git a/src/lib/eolian/database_implement_api.c b/src/lib/eolian/database_implement_api.c
index 2899b2093f..ff83c9eeb6 100644
--- a/src/lib/eolian/database_implement_api.c
+++ b/src/lib/eolian/database_implement_api.c
@@ -5,13 +5,6 @@
#include <Eina.h>
#include "eolian_database.h"
-EAPI Eina_Stringshare *
-eolian_implement_full_name_get(const Eolian_Implement *impl)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(impl, NULL);
- return impl->full_name;
-}
-
EAPI const Eolian_Class *
eolian_implement_class_get(const Eolian_Implement *impl)
{
diff --git a/src/lib/eolian/database_part.c b/src/lib/eolian/database_part.c
index dca036aba5..57603a2abb 100644
--- a/src/lib/eolian/database_part.c
+++ b/src/lib/eolian/database_part.c
@@ -9,7 +9,10 @@ void
database_part_del(Eolian_Part *part)
{
if (!part) return;
- if (part->name) eina_stringshare_del(part->name);
+ eina_stringshare_del(part->base.file);
+ eina_stringshare_del(part->base.name);
+ if (!part->base.validated)
+ eina_stringshare_del(part->klass_name);
database_doc_del(part->doc);
free(part);
}
diff --git a/src/lib/eolian/database_part_api.c b/src/lib/eolian/database_part_api.c
index a67b0d4391..4fcd7c63fd 100644
--- a/src/lib/eolian/database_part_api.c
+++ b/src/lib/eolian/database_part_api.c
@@ -5,13 +5,6 @@
#include <Eina.h>
#include "eolian_database.h"
-EAPI Eina_Stringshare *
-eolian_part_name_get(const Eolian_Part *part)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
- return part->name;
-}
-
EAPI const Eolian_Class *
eolian_part_class_get(const Eolian_Part *part)
{
diff --git a/src/lib/eolian/database_type.c b/src/lib/eolian/database_type.c
index 1400aa028c..31517d6487 100644
--- a/src/lib/eolian/database_type.c
+++ b/src/lib/eolian/database_type.c
@@ -8,15 +8,11 @@
void
database_type_del(Eolian_Type *tp)
{
- if (!tp) return;
- const char *sp;
- if (tp->base.file) eina_stringshare_del(tp->base.file);
+ if (!tp || eolian_object_unref(&tp->base)) return;
+ eina_stringshare_del(tp->base.file);
+ eina_stringshare_del(tp->base.name);
database_type_del(tp->base_type);
database_type_del(tp->next_type);
- if (tp->name) eina_stringshare_del(tp->name);
- if (tp->full_name) eina_stringshare_del(tp->full_name);
- if (tp->namespaces) EINA_LIST_FREE(tp->namespaces, sp)
- eina_stringshare_del(sp);
if (tp->freefunc) eina_stringshare_del(tp->freefunc);
free(tp);
}
@@ -24,16 +20,12 @@ database_type_del(Eolian_Type *tp)
void
database_typedecl_del(Eolian_Typedecl *tp)
{
- if (!tp) return;
- const char *sp;
- if (tp->base.file) eina_stringshare_del(tp->base.file);
+ if (!tp || eolian_object_unref(&tp->base)) return;
+ eina_stringshare_del(tp->base.file);
+ eina_stringshare_del(tp->base.name);
database_type_del(tp->base_type);
- if (tp->name) eina_stringshare_del(tp->name);
- if (tp->full_name) eina_stringshare_del(tp->full_name);
if (tp->fields) eina_hash_free(tp->fields);
if (tp->field_list) eina_list_free(tp->field_list);
- if (tp->namespaces) EINA_LIST_FREE(tp->namespaces, sp)
- eina_stringshare_del(sp);
if (tp->legacy) eina_stringshare_del(tp->legacy);
if (tp->freefunc) eina_stringshare_del(tp->freefunc);
database_doc_del(tp->doc);
@@ -41,55 +33,57 @@ database_typedecl_del(Eolian_Typedecl *tp)
}
void
-database_type_add(Eolian *state, Eolian_Typedecl *def)
+database_type_add(Eolian_Unit *unit, Eolian_Typedecl *tp)
{
- eina_hash_set(state->unit.aliases, def->full_name, def);
- eina_hash_set(state->aliases_f, def->base.file, eina_list_append
- ((Eina_List*)eina_hash_find(state->aliases_f, def->base.file),
- def));
- database_decl_add(state, def->full_name, EOLIAN_DECL_ALIAS, def->base.file, def);
+ EOLIAN_OBJECT_ADD(unit, tp->base.name, tp, aliases);
+ eina_hash_set(unit->state->staging.aliases_f, tp->base.file, eina_list_append
+ ((Eina_List*)eina_hash_find(unit->state->staging.aliases_f, tp->base.file),
+ tp));
+ database_object_add(unit, &tp->base);
}
void
-database_struct_add(Eolian *state, Eolian_Typedecl *tp)
+database_struct_add(Eolian_Unit *unit, Eolian_Typedecl *tp)
{
- eina_hash_set(state->unit.structs, tp->full_name, tp);
- eina_hash_set(state->structs_f, tp->base.file, eina_list_append
- ((Eina_List*)eina_hash_find(state->structs_f, tp->base.file), tp));
- database_decl_add(state, tp->full_name, EOLIAN_DECL_STRUCT, tp->base.file, tp);
+ EOLIAN_OBJECT_ADD(unit, tp->base.name, tp, structs);
+ eina_hash_set(unit->state->staging.structs_f, tp->base.file, eina_list_append
+ ((Eina_List*)eina_hash_find(unit->state->staging.structs_f, tp->base.file), tp));
+ database_object_add(unit, &tp->base);
}
void
-database_enum_add(Eolian *state, Eolian_Typedecl *tp)
+database_enum_add(Eolian_Unit *unit, Eolian_Typedecl *tp)
{
- eina_hash_set(state->unit.enums, tp->full_name, tp);
- eina_hash_set(state->enums_f, tp->base.file, eina_list_append
- ((Eina_List*)eina_hash_find(state->enums_f, tp->base.file), tp));
- database_decl_add(state, tp->full_name, EOLIAN_DECL_ENUM, tp->base.file, tp);
+ EOLIAN_OBJECT_ADD(unit, tp->base.name, tp, enums);
+ eina_hash_set(unit->state->staging.enums_f, tp->base.file, eina_list_append
+ ((Eina_List*)eina_hash_find(unit->state->staging.enums_f, tp->base.file), tp));
+ database_object_add(unit, &tp->base);
}
Eina_Bool
-database_type_is_ownable(const Eolian_Unit *unit, const Eolian_Type *tp)
+database_type_is_ownable(const Eolian_Unit *unit, const Eolian_Type *tp, Eina_Bool allow_void)
{
if (tp->is_ptr)
return EINA_TRUE;
if (tp->type == EOLIAN_TYPE_REGULAR)
{
- int kw = eo_lexer_keyword_str_to_id(tp->name);
+ int kw = eo_lexer_keyword_str_to_id(tp->base.name);
const char *ct = eo_lexer_get_c_type(kw);
if (!ct)
{
- const Eolian_Typedecl *tpp = eolian_type_typedecl_get(unit, tp);
+ const Eolian_Typedecl *tpp = database_type_decl_find(unit, tp);
if (!tpp)
return EINA_FALSE;
if (tpp->type == EOLIAN_TYPEDECL_FUNCTION_POINTER)
return EINA_TRUE;
if (tpp->type == EOLIAN_TYPEDECL_ALIAS)
- return database_type_is_ownable(unit, tpp->base_type);
+ return database_type_is_ownable(unit, tpp->base_type, allow_void);
return EINA_FALSE;
}
return (ct[strlen(ct) - 1] == '*');
}
+ if (allow_void && (tp->type == EOLIAN_TYPE_VOID))
+ return EINA_TRUE;
return (tp->type == EOLIAN_TYPE_CLASS);
}
@@ -102,8 +96,22 @@ _buf_add_suffix(Eina_Strbuf *buf, const char *suffix)
eina_strbuf_append(buf, suffix);
}
+static void
+_append_name(const Eolian_Object *obj, Eina_Strbuf *buf)
+{
+ Eina_Iterator *itr = eolian_object_namespaces_get(obj);
+ const char *sp;
+ EINA_ITERATOR_FOREACH(itr, sp)
+ {
+ eina_strbuf_append(buf, sp);
+ eina_strbuf_append_char(buf, '_');
+ }
+ eina_strbuf_append(buf, eolian_object_short_name_get(obj));
+ eina_iterator_free(itr);
+}
+
void
-database_type_to_str(const Eolian_Unit *src, const Eolian_Type *tp,
+database_type_to_str(const Eolian_Type *tp,
Eina_Strbuf *buf, const char *name,
Eolian_C_Type_Type ctype)
{
@@ -111,25 +119,18 @@ database_type_to_str(const Eolian_Unit *src, const Eolian_Type *tp,
|| tp->type == EOLIAN_TYPE_CLASS
|| tp->type == EOLIAN_TYPE_VOID)
&& tp->is_const
- && ((ctype != EOLIAN_C_TYPE_RETURN) || database_type_is_ownable(src, tp)))
+ && ((ctype != EOLIAN_C_TYPE_RETURN) || database_type_is_ownable(NULL, tp, EINA_FALSE)))
{
eina_strbuf_append(buf, "const ");
}
if (tp->type == EOLIAN_TYPE_REGULAR
|| tp->type == EOLIAN_TYPE_CLASS)
{
- Eina_List *l;
- const char *sp;
- EINA_LIST_FOREACH(tp->namespaces, l, sp)
- {
- eina_strbuf_append(buf, sp);
- eina_strbuf_append_char(buf, '_');
- }
- int kw = eo_lexer_keyword_str_to_id(tp->name);
+ int kw = eo_lexer_keyword_str_to_id(tp->base.name);
if (kw && eo_lexer_is_type_keyword(kw))
eina_strbuf_append(buf, eo_lexer_get_c_type(kw));
else
- eina_strbuf_append(buf, tp->name);
+ _append_name(&tp->base, buf);
}
else if (tp->type == EOLIAN_TYPE_VOID)
eina_strbuf_append(buf, "void");
@@ -138,7 +139,7 @@ database_type_to_str(const Eolian_Unit *src, const Eolian_Type *tp,
else
{
/* handles arrays and pointers as they all serialize to pointers */
- database_type_to_str(src, tp->base_type, buf, NULL,
+ database_type_to_str(tp->base_type, buf, NULL,
EOLIAN_C_TYPE_DEFAULT);
_buf_add_suffix(buf, "*");
if (tp->is_const && (ctype != EOLIAN_C_TYPE_RETURN))
@@ -152,25 +153,18 @@ database_type_to_str(const Eolian_Unit *src, const Eolian_Type *tp,
}
static void
-_stype_to_str(const Eolian_Unit *src, const Eolian_Typedecl *tp,
- Eina_Strbuf *buf)
+_stype_to_str(const Eolian_Typedecl *tp, Eina_Strbuf *buf)
{
- Eolian_Struct_Type_Field *sf;
- Eina_List *l;
- const char *sp;
eina_strbuf_append(buf, "struct ");
- EINA_LIST_FOREACH(tp->namespaces, l, sp)
- {
- eina_strbuf_append(buf, sp);
- eina_strbuf_append_char(buf, '_');
- }
- eina_strbuf_append(buf, tp->name);
+ _append_name(&tp->base, buf);
if (tp->type == EOLIAN_TYPEDECL_STRUCT_OPAQUE)
return;
eina_strbuf_append(buf, " { ");
+ Eina_List *l;
+ Eolian_Struct_Type_Field *sf;
EINA_LIST_FOREACH(tp->field_list, l, sf)
{
- database_type_to_str(src, sf->type, buf, sf->name,
+ database_type_to_str(sf->type, buf, sf->base.name,
EOLIAN_C_TYPE_DEFAULT);
eina_strbuf_append(buf, "; ");
}
@@ -178,27 +172,20 @@ _stype_to_str(const Eolian_Unit *src, const Eolian_Typedecl *tp,
}
static void
-_etype_to_str(const Eolian_Unit *src, const Eolian_Typedecl *tp,
- Eina_Strbuf *buf)
+_etype_to_str(const Eolian_Typedecl *tp, Eina_Strbuf *buf)
{
- Eolian_Enum_Type_Field *ef;
- Eina_List *l;
- const char *sp;
eina_strbuf_append(buf, "enum ");
- EINA_LIST_FOREACH(tp->namespaces, l, sp)
- {
- eina_strbuf_append(buf, sp);
- eina_strbuf_append_char(buf, '_');
- }
- eina_strbuf_append(buf, tp->name);
+ _append_name(&tp->base, buf);
eina_strbuf_append(buf, " { ");
+ Eina_List *l;
+ Eolian_Enum_Type_Field *ef;
EINA_LIST_FOREACH(tp->field_list, l, ef)
{
- eina_strbuf_append(buf, ef->name);
+ eina_strbuf_append(buf, ef->base.name);
if (ef->value)
{
- Eolian_Value val = eolian_expression_eval(src, ef->value,
- EOLIAN_MASK_INT);
+ Eolian_Value val = eolian_expression_eval(ef->value,
+ EOLIAN_MASK_INT);
const char *ret;
eina_strbuf_append(buf, " = ");
ret = eolian_expression_value_to_literal(&val);
@@ -212,60 +199,63 @@ _etype_to_str(const Eolian_Unit *src, const Eolian_Typedecl *tp,
}
static void
-_append_name(const Eolian_Typedecl *tp, Eina_Strbuf *buf)
-{
- Eina_List *l;
- const char *sp;
-
- EINA_LIST_FOREACH(tp->namespaces, l, sp)
- {
- eina_strbuf_append(buf, sp);
- eina_strbuf_append_char(buf, '_');
- }
- eina_strbuf_append(buf, tp->name);
-}
-
-static void
-_atype_to_str(const Eolian_Unit *src, const Eolian_Typedecl *tp,
- Eina_Strbuf *buf)
+_atype_to_str(const Eolian_Typedecl *tp, Eina_Strbuf *buf)
{
eina_strbuf_append(buf, "typedef ");
if (tp->base_type->type == EOLIAN_TYPE_REGULAR)
{
- if (!strcmp(tp->base_type->name, "__builtin_free_cb"))
+ if (!strcmp(tp->base_type->base.name, "__builtin_free_cb"))
{
eina_strbuf_append(buf, "void (*");
- _append_name(tp, buf);
+ _append_name(&tp->base, buf);
eina_strbuf_append(buf, ")(void *data)");
return;
}
}
Eina_Strbuf *fulln = eina_strbuf_new();
- _append_name(tp, fulln);
- database_type_to_str(src, tp->base_type, buf, eina_strbuf_string_get(fulln),
+ _append_name(&tp->base, fulln);
+ database_type_to_str(tp->base_type, buf, eina_strbuf_string_get(fulln),
EOLIAN_C_TYPE_DEFAULT);
eina_strbuf_free(fulln);
}
void
-database_typedecl_to_str(const Eolian_Unit *src, const Eolian_Typedecl *tp,
- Eina_Strbuf *buf)
+database_typedecl_to_str(const Eolian_Typedecl *tp, Eina_Strbuf *buf)
{
switch (tp->type)
{
case EOLIAN_TYPEDECL_ALIAS:
- _atype_to_str(src, tp, buf);
+ _atype_to_str(tp, buf);
break;
case EOLIAN_TYPEDECL_ENUM:
- _etype_to_str(src, tp, buf);
+ _etype_to_str(tp, buf);
break;
case EOLIAN_TYPEDECL_STRUCT:
case EOLIAN_TYPEDECL_STRUCT_OPAQUE:
- _stype_to_str(src, tp, buf);
+ _stype_to_str(tp, buf);
break;
default:
break;
}
}
+
+Eolian_Typedecl *database_type_decl_find(const Eolian_Unit *unit, const Eolian_Type *tp)
+{
+ if (tp->type != EOLIAN_TYPE_REGULAR)
+ return NULL;
+ if (tp->tdecl)
+ return tp->tdecl;
+ /* try looking up if it belongs to a struct, enum or an alias... otherwise
+ * return NULL, but first check for builtins
+ */
+ int kw = eo_lexer_keyword_str_to_id(tp->base.name);
+ if (!kw || kw < KW_byte || kw >= KW_true)
+ {
+ Eolian_Object *decl = eina_hash_find(unit->objects, tp->base.name);
+ if (decl && decl->type == EOLIAN_OBJECT_TYPEDECL)
+ return (Eolian_Typedecl *)decl;
+ }
+ return NULL;
+}
diff --git a/src/lib/eolian/database_type_api.c b/src/lib/eolian/database_type_api.c
index d733a93ed3..7d471c7ee4 100644
--- a/src/lib/eolian/database_type_api.c
+++ b/src/lib/eolian/database_type_api.c
@@ -6,90 +6,6 @@
#include "eolian_database.h"
#include "eo_lexer.h"
-EAPI const Eolian_Typedecl *
-eolian_typedecl_alias_get_by_name(const Eolian_Unit *unit, const char *name)
-{
- if (!unit) return NULL;
- Eina_Stringshare *shr = eina_stringshare_add(name);
- Eolian_Typedecl *tp = eina_hash_find(unit->state->unit.aliases, shr);
- eina_stringshare_del(shr);
- if (!tp) return NULL;
- return tp;
-}
-
-EAPI const Eolian_Typedecl *
-eolian_typedecl_struct_get_by_name(const Eolian_Unit *unit, const char *name)
-{
- if (!unit) return NULL;
- Eina_Stringshare *shr = eina_stringshare_add(name);
- Eolian_Typedecl *tp = eina_hash_find(unit->state->unit.structs, shr);
- eina_stringshare_del(shr);
- if (!tp) return NULL;
- return tp;
-}
-
-EAPI const Eolian_Typedecl *
-eolian_typedecl_enum_get_by_name(const Eolian_Unit *unit, const char *name)
-{
- if (!unit) return NULL;
- Eina_Stringshare *shr = eina_stringshare_add(name);
- Eolian_Typedecl *tp = eina_hash_find(unit->state->unit.enums, shr);
- eina_stringshare_del(shr);
- if (!tp) return NULL;
- return tp;
-}
-
-EAPI Eina_Iterator *
-eolian_typedecl_aliases_get_by_file(const Eolian_Unit *unit, const char *fname)
-{
- if (!unit) return NULL;
- Eina_Stringshare *shr = eina_stringshare_add(fname);
- Eina_List *l = eina_hash_find(unit->state->aliases_f, shr);
- eina_stringshare_del(shr);
- if (!l) return NULL;
- return eina_list_iterator_new(l);
-}
-
-EAPI Eina_Iterator *
-eolian_typedecl_structs_get_by_file(const Eolian_Unit *unit, const char *fname)
-{
- if (!unit) return NULL;
- Eina_Stringshare *shr = eina_stringshare_add(fname);
- Eina_List *l = eina_hash_find(unit->state->structs_f, shr);
- eina_stringshare_del(shr);
- if (!l) return NULL;
- return eina_list_iterator_new(l);
-}
-
-EAPI Eina_Iterator *
-eolian_typedecl_enums_get_by_file(const Eolian_Unit *unit, const char *fname)
-{
- if (!unit) return NULL;
- Eina_Stringshare *shr = eina_stringshare_add(fname);
- Eina_List *l = eina_hash_find(unit->state->enums_f, shr);
- eina_stringshare_del(shr);
- if (!l) return NULL;
- return eina_list_iterator_new(l);
-}
-
-EAPI Eina_Iterator *
-eolian_typedecl_all_aliases_get(const Eolian_Unit *unit)
-{
- return (unit ? eina_hash_iterator_data_new(unit->state->unit.aliases) : NULL);
-}
-
-EAPI Eina_Iterator *
-eolian_typedecl_all_structs_get(const Eolian_Unit *unit)
-{
- return (unit ? eina_hash_iterator_data_new(unit->state->unit.structs) : NULL);
-}
-
-EAPI Eina_Iterator *
-eolian_typedecl_all_enums_get(const Eolian_Unit *unit)
-{
- return (unit ? eina_hash_iterator_data_new(unit->state->unit.enums) : NULL);
-}
-
EAPI Eolian_Type_Type
eolian_type_type_get(const Eolian_Type *tp)
{
@@ -133,13 +49,6 @@ eolian_typedecl_struct_field_get(const Eolian_Typedecl *tp, const char *field)
return sf;
}
-EAPI Eina_Stringshare *
-eolian_typedecl_struct_field_name_get(const Eolian_Struct_Type_Field *fl)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(fl, NULL);
- return fl->name;
-}
-
EAPI const Eolian_Documentation *
eolian_typedecl_struct_field_documentation_get(const Eolian_Struct_Type_Field *fl)
{
@@ -177,13 +86,6 @@ eolian_typedecl_enum_field_get(const Eolian_Typedecl *tp, const char *field)
}
EAPI Eina_Stringshare *
-eolian_typedecl_enum_field_name_get(const Eolian_Enum_Type_Field *fl)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(fl, NULL);
- return fl->name;
-}
-
-EAPI Eina_Stringshare *
eolian_typedecl_enum_field_c_name_get(const Eolian_Enum_Type_Field *fl)
{
Eina_Stringshare *ret;
@@ -194,9 +96,9 @@ eolian_typedecl_enum_field_c_name_get(const Eolian_Enum_Type_Field *fl)
if (fl->base_enum->legacy)
eina_strbuf_append(buf, fl->base_enum->legacy);
else
- eina_strbuf_append(buf, fl->base_enum->full_name);
+ eina_strbuf_append(buf, fl->base_enum->base.name);
eina_strbuf_append_char(buf, '_');
- eina_strbuf_append(buf, fl->name);
+ eina_strbuf_append(buf, fl->base.name);
bufp = eina_strbuf_string_steal(buf);
eina_strbuf_free(buf);
eina_str_toupper(&bufp);
@@ -237,20 +139,6 @@ eolian_typedecl_documentation_get(const Eolian_Typedecl *tp)
return tp->doc;
}
-EAPI Eina_Stringshare *
-eolian_type_file_get(const Eolian_Type *tp)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
- return tp->base.file;
-}
-
-EAPI Eina_Stringshare *
-eolian_typedecl_file_get(const Eolian_Typedecl *tp)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
- return tp->base.file;
-}
-
EAPI const Eolian_Type *
eolian_type_base_type_get(const Eolian_Type *tp)
{
@@ -266,23 +154,12 @@ eolian_type_next_type_get(const Eolian_Type *tp)
}
EAPI const Eolian_Typedecl *
-eolian_type_typedecl_get(const Eolian_Unit *unit, const Eolian_Type *tp)
+eolian_type_typedecl_get(const Eolian_Type *tp)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
if (eolian_type_type_get(tp) != EOLIAN_TYPE_REGULAR)
return NULL;
- /* try looking up if it belongs to a struct, enum or an alias... otherwise
- * return NULL, but first check for builtins
- */
- int kw = eo_lexer_keyword_str_to_id(tp->full_name);
- if (!kw || kw < KW_byte || kw >= KW_true)
- {
- Eolian_Declaration *decl = eina_hash_find(unit->state->unit.decls, tp->full_name);
- if (decl && decl->type != EOLIAN_DECL_CLASS
- && decl->type != EOLIAN_DECL_VAR)
- return decl->data;
- }
- return NULL;
+ return tp->tdecl;
}
EAPI const Eolian_Type *
@@ -293,31 +170,31 @@ eolian_typedecl_base_type_get(const Eolian_Typedecl *tp)
}
EAPI const Eolian_Type *
-eolian_type_aliased_base_get(const Eolian_Unit *unit, const Eolian_Type *tp)
+eolian_type_aliased_base_get(const Eolian_Type *tp)
{
if (!tp || tp->type != EOLIAN_TYPE_REGULAR || tp->is_ptr)
return tp;
- const Eolian_Typedecl *btp = eolian_type_typedecl_get(unit, tp);
+ const Eolian_Typedecl *btp = eolian_type_typedecl_get(tp);
if (btp && (btp->type == EOLIAN_TYPEDECL_ALIAS))
- return eolian_typedecl_aliased_base_get(unit, btp);
+ return eolian_typedecl_aliased_base_get(btp);
return tp;
}
EAPI const Eolian_Type *
-eolian_typedecl_aliased_base_get(const Eolian_Unit *unit, const Eolian_Typedecl *tp)
+eolian_typedecl_aliased_base_get(const Eolian_Typedecl *tp)
{
if (!tp || tp->type != EOLIAN_TYPEDECL_ALIAS)
return NULL;
- return eolian_type_aliased_base_get(unit, tp->base_type);
+ return eolian_type_aliased_base_get(tp->base_type);
}
EAPI const Eolian_Class *
-eolian_type_class_get(const Eolian_Unit *unit, const Eolian_Type *tp)
+eolian_type_class_get(const Eolian_Type *tp)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
if (eolian_type_type_get(tp) != EOLIAN_TYPE_CLASS)
return NULL;
- return eolian_class_get_by_name(unit, tp->full_name);
+ return tp->klass;
}
EAPI Eina_Bool
@@ -349,77 +226,32 @@ eolian_typedecl_is_extern(const Eolian_Typedecl *tp)
}
EAPI Eina_Stringshare *
-eolian_type_c_type_get(const Eolian_Unit *unit, const Eolian_Type *tp,
- Eolian_C_Type_Type ctype)
+eolian_type_c_type_get(const Eolian_Type *tp, Eolian_C_Type_Type ctype)
{
Eina_Stringshare *ret;
Eina_Strbuf *buf;
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
buf = eina_strbuf_new();
- database_type_to_str(unit, tp, buf, NULL, ctype);
+ database_type_to_str(tp, buf, NULL, ctype);
ret = eina_stringshare_add(eina_strbuf_string_get(buf));
eina_strbuf_free(buf);
return ret;
}
EAPI Eina_Stringshare *
-eolian_typedecl_c_type_get(const Eolian_Unit *unit, const Eolian_Typedecl *tp)
+eolian_typedecl_c_type_get(const Eolian_Typedecl *tp)
{
Eina_Stringshare *ret;
Eina_Strbuf *buf;
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
buf = eina_strbuf_new();
- database_typedecl_to_str(unit, tp, buf);
+ database_typedecl_to_str(tp, buf);
ret = eina_stringshare_add(eina_strbuf_string_get(buf));
eina_strbuf_free(buf);
return ret;
}
EAPI Eina_Stringshare *
-eolian_type_name_get(const Eolian_Type *tp)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
- return tp->name;
-}
-
-EAPI Eina_Stringshare *
-eolian_typedecl_name_get(const Eolian_Typedecl *tp)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
- return tp->name;
-}
-
-EAPI Eina_Stringshare *
-eolian_type_full_name_get(const Eolian_Type *tp)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
- return tp->full_name;
-}
-
-EAPI Eina_Stringshare *
-eolian_typedecl_full_name_get(const Eolian_Typedecl *tp)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
- return tp->full_name;
-}
-
-EAPI Eina_Iterator *
-eolian_type_namespaces_get(const Eolian_Type *tp)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
- if (!tp->namespaces) return NULL;
- return eina_list_iterator_new(tp->namespaces);
-}
-
-EAPI Eina_Iterator *
-eolian_typedecl_namespaces_get(const Eolian_Typedecl *tp)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
- if (!tp->namespaces) return NULL;
- return eina_list_iterator_new(tp->namespaces);
-}
-
-EAPI Eina_Stringshare *
eolian_type_free_func_get(const Eolian_Type *tp)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c
index 9ac74dba76..0f7d08e981 100644
--- a/src/lib/eolian/database_validate.c
+++ b/src/lib/eolian/database_validate.c
@@ -8,6 +8,12 @@
#include "eo_lexer.h"
#include "eolian_priv.h"
+typedef struct _Validate_State
+{
+ Eina_Bool warned;
+ Eina_Bool event_redef;
+} Validate_State;
+
static Eina_Bool
_validate(Eolian_Object *obj)
{
@@ -16,7 +22,7 @@ _validate(Eolian_Object *obj)
}
static Eina_Bool
-_validate_docstr(const Eolian_Unit *src, Eina_Stringshare *str, const Eolian_Object *info)
+_validate_docstr(Eina_Stringshare *str, const Eolian_Object *info, Eina_List **rdbg)
{
if (!str || !str[0]) return EINA_TRUE;
@@ -29,16 +35,33 @@ _validate_docstr(const Eolian_Unit *src, Eina_Stringshare *str, const Eolian_Obj
Eolian_Doc_Token tok;
eolian_doc_token_init(&tok);
while (ret && (doc = eolian_documentation_tokenize(doc, &tok)))
- if (eolian_doc_token_type_get(&tok) == EOLIAN_DOC_TOKEN_REF)
- if (eolian_doc_token_ref_get(src, &tok, NULL, NULL) == EOLIAN_DOC_REF_INVALID)
- {
- char *refn = eolian_doc_token_text_get(&tok);
- _eolian_log_line(info->file, info->line, info->column,
- "failed validating reference '%s'", refn);
- free(refn);
- ret = EINA_FALSE;
- break;
- }
+ {
+ if (eolian_doc_token_type_get(&tok) == EOLIAN_DOC_TOKEN_REF)
+ {
+ /* check staging first, then main */
+ Eolian_Object_Type tp = database_doc_token_ref_resolve(&tok,
+ &info->unit->state->staging.unit,
+ &info->unit->state->main.unit,
+ NULL, NULL);
+ if (tp == EOLIAN_OBJECT_UNKNOWN)
+ {
+ size_t dbgn = (size_t)eina_list_data_get(*rdbg);
+ char *refn = eolian_doc_token_text_get(&tok);
+ Eolian_Object tmp;
+ memset(&tmp, 0, sizeof(Eolian_Object));
+ tmp.unit = info->unit;
+ tmp.file = info->file;
+ tmp.line = (int)(dbgn & 0xFFFFF);
+ tmp.column = (int)(dbgn >> 20);
+ eolian_state_log_obj(info->unit->state, &tmp,
+ "failed validating reference '%s'", refn);
+ free(refn);
+ ret = EINA_FALSE;
+ break;
+ }
+ *rdbg = eina_list_next(*rdbg);
+ }
+ }
free(par);
}
@@ -46,28 +69,32 @@ _validate_docstr(const Eolian_Unit *src, Eina_Stringshare *str, const Eolian_Obj
}
static Eina_Bool
-_validate_doc(const Eolian_Unit *src, Eolian_Documentation *doc)
+_validate_doc(Eolian_Documentation *doc)
{
if (!doc)
return EINA_TRUE;
- if (!_validate_docstr(src, doc->summary, &doc->base))
+ Eina_List *rdbg = doc->ref_dbg;
+
+ if (!_validate_docstr(doc->summary, &doc->base, &rdbg))
return EINA_FALSE;
- if (!_validate_docstr(src, doc->description, &doc->base))
+ if (!_validate_docstr(doc->description, &doc->base, &rdbg))
return EINA_FALSE;
return _validate(&doc->base);
}
-static Eina_Bool _validate_type(const Eolian_Unit *src, Eolian_Type *tp);
-static Eina_Bool _validate_expr(const Eolian_Unit *src,
- Eolian_Expression *expr,
+static Eina_Bool _validate_type(Validate_State *vals, Eolian_Type *tp);
+static Eina_Bool _validate_expr(Eolian_Expression *expr,
const Eolian_Type *tp,
Eolian_Expression_Mask msk);
+static Eina_Bool _validate_function(Validate_State *vals,
+ Eolian_Function *func,
+ Eina_Hash *nhash);
typedef struct _Cb_Ret
{
- const Eolian_Unit *unit;
+ Validate_State *vals;
Eina_Bool succ;
} Cb_Ret;
@@ -75,12 +102,12 @@ static Eina_Bool
_sf_map_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED,
const Eolian_Struct_Type_Field *sf, Cb_Ret *sc)
{
- sc->succ = _validate_type(sc->unit, sf->type);
+ sc->succ = _validate_type(sc->vals, sf->type);
if (!sc->succ)
return EINA_FALSE;
- sc->succ = _validate_doc(sc->unit, sf->doc);
+ sc->succ = _validate_doc(sf->doc);
return sc->succ;
}
@@ -90,14 +117,14 @@ _ef_map_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED,
const Eolian_Enum_Type_Field *ef, Cb_Ret *sc)
{
if (ef->value)
- sc->succ = _validate_expr(sc->unit, ef->value, NULL, EOLIAN_MASK_INT);
+ sc->succ = _validate_expr(ef->value, NULL, EOLIAN_MASK_INT);
else
sc->succ = EINA_TRUE;
if (!sc->succ)
return EINA_FALSE;
- sc->succ = _validate_doc(sc->unit, ef->doc);
+ sc->succ = _validate_doc(ef->doc);
return sc->succ;
}
@@ -105,30 +132,30 @@ _ef_map_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED,
static Eina_Bool
_obj_error(const Eolian_Object *o, const char *msg)
{
- _eolian_log_line(o->file, o->line, o->column, "%s", msg);
+ eolian_state_log_obj(o->unit->state, o, "%s", msg);
return EINA_FALSE;
}
static Eina_Bool
-_validate_typedecl(const Eolian_Unit *src, Eolian_Typedecl *tp)
+_validate_typedecl(Validate_State *vals, Eolian_Typedecl *tp)
{
if (tp->base.validated)
return EINA_TRUE;
- if (!_validate_doc(src, tp->doc))
+ if (!_validate_doc(tp->doc))
return EINA_FALSE;
switch (tp->type)
{
case EOLIAN_TYPEDECL_ALIAS:
- if (!_validate_type(src, tp->base_type))
+ if (!_validate_type(vals, tp->base_type))
return EINA_FALSE;
if (!tp->freefunc && tp->base_type->freefunc)
tp->freefunc = eina_stringshare_ref(tp->base_type->freefunc);
return _validate(&tp->base);
case EOLIAN_TYPEDECL_STRUCT:
{
- Cb_Ret rt = { src, EINA_TRUE };
+ Cb_Ret rt = { vals, EINA_TRUE };
eina_hash_foreach(tp->fields, (Eina_Hash_Foreach)_sf_map_cb, &rt);
if (!rt.succ)
return EINA_FALSE;
@@ -138,14 +165,15 @@ _validate_typedecl(const Eolian_Unit *src, Eolian_Typedecl *tp)
return _validate(&tp->base);
case EOLIAN_TYPEDECL_ENUM:
{
- Cb_Ret rt = { src, EINA_TRUE };
+ Cb_Ret rt = { vals, EINA_TRUE };
eina_hash_foreach(tp->fields, (Eina_Hash_Foreach)_ef_map_cb, &rt);
if (!rt.succ)
return EINA_FALSE;
return _validate(&tp->base);
}
case EOLIAN_TYPEDECL_FUNCTION_POINTER:
- // FIXME validate functions here
+ if (!_validate_function(vals, tp->function_pointer, NULL))
+ return EINA_FALSE;
return _validate(&tp->base);
default:
return EINA_FALSE;
@@ -155,11 +183,9 @@ _validate_typedecl(const Eolian_Unit *src, Eolian_Typedecl *tp)
static const char * const eo_complex_frees[] =
{
- "eina_accessor_free", "eina_array_free",
+ "eina_accessor_free", "eina_array_free", NULL, /* future */
"eina_iterator_free", "eina_hash_free",
- "eina_list_free", "eina_inarray_free", "eina_inlist_free",
-
- "efl_del" /* future */
+ "eina_list_free", "eina_inarray_free", "eina_inlist_free"
};
static const char *eo_obj_free = "efl_del";
@@ -169,20 +195,21 @@ static const char *eo_value_free = "eina_value_flush";
static const char *eo_value_ptr_free = "eina_value_free";
static Eina_Bool
-_validate_type(const Eolian_Unit *src, Eolian_Type *tp)
+_validate_type(Validate_State *vals, Eolian_Type *tp)
{
- char buf[256];
+ const Eolian_Unit *src = tp->base.unit;
- if (tp->owned && !database_type_is_ownable(src, tp))
+ char buf[256];
+ if (tp->owned && !database_type_is_ownable(src, tp, EINA_FALSE))
{
- snprintf(buf, sizeof(buf), "type '%s' is not ownable", tp->full_name);
+ snprintf(buf, sizeof(buf), "type '%s' is not ownable", tp->base.name);
return _obj_error(&tp->base, buf);
}
if (tp->is_ptr && !tp->legacy)
{
tp->is_ptr = EINA_FALSE;
- Eina_Bool still_ownable = database_type_is_ownable(src, tp);
+ Eina_Bool still_ownable = database_type_is_ownable(src, tp, EINA_FALSE);
tp->is_ptr = EINA_TRUE;
if (still_ownable)
{
@@ -199,7 +226,7 @@ _validate_type(const Eolian_Unit *src, Eolian_Type *tp)
{
if (tp->base_type)
{
- int kwid = eo_lexer_keyword_str_to_id(tp->full_name);
+ int kwid = eo_lexer_keyword_str_to_id(tp->base.name);
if (!tp->freefunc)
{
tp->freefunc = eina_stringshare_add(eo_complex_frees[
@@ -209,15 +236,15 @@ _validate_type(const Eolian_Unit *src, Eolian_Type *tp)
/* validate types in brackets so freefuncs get written... */
while (itp)
{
- if (!_validate_type(src, itp))
+ if (!_validate_type(vals, itp))
return EINA_FALSE;
- if ((kwid >= KW_accessor) && (kwid <= KW_list))
+ if ((kwid >= KW_accessor) && (kwid <= KW_list) && (kwid != KW_future))
{
- if (!database_type_is_ownable(src, itp))
+ if (!database_type_is_ownable(src, itp, EINA_TRUE))
{
snprintf(buf, sizeof(buf),
"%s cannot contain value types (%s)",
- tp->full_name, itp->full_name);
+ tp->base.name, itp->base.name);
return _obj_error(&itp->base, buf);
}
}
@@ -225,9 +252,8 @@ _validate_type(const Eolian_Unit *src, Eolian_Type *tp)
}
return _validate(&tp->base);
}
- Eolian_Typedecl *tpp;
/* builtins */
- int id = eo_lexer_keyword_str_to_id(tp->full_name);
+ int id = eo_lexer_keyword_str_to_id(tp->base.name);
if (id)
{
if (!eo_lexer_is_type_keyword(id))
@@ -253,24 +279,25 @@ _validate_type(const Eolian_Unit *src, Eolian_Type *tp)
return _validate(&tp->base);
}
/* user defined */
- tpp = (Eolian_Typedecl *)eolian_type_typedecl_get(src, tp);
- if (!tpp)
+ tp->tdecl = database_type_decl_find(src, tp);
+ if (!tp->tdecl)
{
- snprintf(buf, sizeof(buf), "undefined type %s", tp->full_name);
+ snprintf(buf, sizeof(buf), "undefined type %s", tp->base.name);
return _obj_error(&tp->base, buf);
}
- if (!_validate_typedecl(src, tpp))
+ if (!_validate_typedecl(vals, tp->tdecl))
return EINA_FALSE;
- if (tpp->freefunc && !tp->freefunc)
- tp->freefunc = eina_stringshare_ref(tpp->freefunc);
+ if (tp->tdecl->freefunc && !tp->freefunc)
+ tp->freefunc = eina_stringshare_ref(tp->tdecl->freefunc);
return _validate(&tp->base);
}
case EOLIAN_TYPE_CLASS:
{
- if (!eolian_type_class_get(src, tp))
+ tp->klass = (Eolian_Class *)eolian_unit_class_by_name_get(src, tp->base.name);
+ if (!tp->klass)
{
snprintf(buf, sizeof(buf), "undefined class %s "
- "(likely wrong namespacing)", tp->full_name);
+ "(likely wrong namespacing)", tp->base.name);
return _obj_error(&tp->base, buf);
}
if (!tp->freefunc)
@@ -284,14 +311,14 @@ _validate_type(const Eolian_Unit *src, Eolian_Type *tp)
}
static Eina_Bool
-_validate_expr(const Eolian_Unit *src, Eolian_Expression *expr,
- const Eolian_Type *tp, Eolian_Expression_Mask msk)
+_validate_expr(Eolian_Expression *expr, const Eolian_Type *tp,
+ Eolian_Expression_Mask msk)
{
Eolian_Value val;
if (tp)
- val = eolian_expression_eval_type(src, expr, tp);
+ val = database_expr_eval_type(expr->base.unit, expr, tp, NULL, NULL);
else
- val = eolian_expression_eval(src, expr, msk);
+ val = database_expr_eval(expr->base.unit, expr, msk, NULL, NULL);
if (val.type == EOLIAN_EXPR_UNKNOWN)
return EINA_FALSE;
@@ -300,66 +327,66 @@ _validate_expr(const Eolian_Unit *src, Eolian_Expression *expr,
}
static Eina_Bool
-_validate_param(const Eolian_Unit *src, Eolian_Function_Parameter *param)
+_validate_param(Validate_State *vals, Eolian_Function_Parameter *param)
{
- if (!_validate_type(src, param->type))
+ if (!_validate_type(vals, param->type))
+ return EINA_FALSE;
+
+ if (param->value && !_validate_expr(param->value, param->type, 0))
return EINA_FALSE;
- if (!_validate_doc(src, param->doc))
+ if (!_validate_doc(param->doc))
return EINA_FALSE;
return _validate(&param->base);
}
static Eina_Bool
-_validate_function(const Eolian_Unit *src, Eolian_Function *func, Eina_Hash *nhash)
+_validate_function(Validate_State *vals, Eolian_Function *func, Eina_Hash *nhash)
{
Eina_List *l;
Eolian_Function_Parameter *param;
char buf[512];
- static int _duplicates_warn = -1;
- if (EINA_UNLIKELY(_duplicates_warn < 0))
- {
- const char *s = getenv("EOLIAN_WARN_FUNC_DUPLICATES");
- if (!s) _duplicates_warn = 0;
- else _duplicates_warn = atoi(s);
- }
-
- const Eolian_Function *ofunc = eina_hash_find(nhash, func->name);
- if (EINA_UNLIKELY(ofunc && (_duplicates_warn > 0)))
+ const Eolian_Object *oobj = nhash ? eina_hash_find(nhash, &func->base.name) : NULL;
+ if (EINA_UNLIKELY(oobj && (oobj != &func->base)))
{
snprintf(buf, sizeof(buf),
- "%sfunction '%s' redefined (originally at %s:%d:%d)",
- func->is_beta ? "beta " : "", func->name, ofunc->base.file,
- ofunc->base.line, ofunc->base.column);
- if ((!func->is_beta && !ofunc->is_beta) || (_duplicates_warn > 1))
- _obj_error(&func->base, buf);
+ "%sfunction '%s' conflicts with another symbol (at %s:%d:%d)",
+ func->is_beta ? "beta " : "", func->base.name, oobj->file,
+ oobj->line, oobj->column);
+ _obj_error(&func->base, buf);
+ vals->warned = EINA_TRUE;
}
/* if already validated, no need to perform the other checks...
* but duplicate checks need to be performed every time
*/
if (func->base.validated)
- return EINA_TRUE;
+ {
+ /* it might be validated, but need to add it anyway */
+ if (!oobj && nhash)
+ eina_hash_add(nhash, &func->base.name, &func->base);
+ return EINA_TRUE;
+ }
- if (func->get_ret_type && !_validate_type(src, func->get_ret_type))
+ if (func->get_ret_type && !_validate_type(vals, func->get_ret_type))
return EINA_FALSE;
- if (func->set_ret_type && !_validate_type(src, func->set_ret_type))
+ if (func->set_ret_type && !_validate_type(vals, func->set_ret_type))
return EINA_FALSE;
- if (func->get_ret_val && !_validate_expr(src, func->get_ret_val,
+ if (func->get_ret_val && !_validate_expr(func->get_ret_val,
func->get_ret_type, 0))
return EINA_FALSE;
- if (func->set_ret_val && !_validate_expr(src, func->set_ret_val,
+ if (func->set_ret_val && !_validate_expr(func->set_ret_val,
func->set_ret_type, 0))
return EINA_FALSE;
#define EOLIAN_PARAMS_VALIDATE(params) \
EINA_LIST_FOREACH(params, l, param) \
- if (!_validate_param(src, param)) \
+ if (!_validate_param(vals, param)) \
return EINA_FALSE;
EOLIAN_PARAMS_VALIDATE(func->prop_values);
@@ -371,75 +398,390 @@ _validate_function(const Eolian_Unit *src, Eolian_Function *func, Eina_Hash *nha
#undef EOLIAN_PARAMS_VALIDATE
- if (!_validate_doc(src, func->get_return_doc))
+ if (!_validate_doc(func->get_return_doc))
return EINA_FALSE;
- if (!_validate_doc(src, func->set_return_doc))
+ if (!_validate_doc(func->set_return_doc))
return EINA_FALSE;
/* just for now, when dups become errors there will be no need to check */
- if (!ofunc)
- eina_hash_add(nhash, func->name, func);
+ if (!oobj && nhash)
+ eina_hash_add(nhash, &func->base.name, &func->base);
return _validate(&func->base);
}
static Eina_Bool
-_validate_part(const Eolian_Unit *src, Eolian_Part *part, Eina_Hash *nhash)
+_validate_part(Eolian_Part *part, Eina_Hash *nhash)
{
- const Eolian_Function *ofunc = eina_hash_find(nhash, part->name);
- if (ofunc)
+ const Eolian_Object *oobj = eina_hash_find(nhash, &part->base.name);
+ if (oobj)
{
char buf[512];
snprintf(buf, sizeof(buf),
- "part '%s' conflicts with a function (defined at %s:%d:%d)",
- part->name, ofunc->base.file,
- ofunc->base.line, ofunc->base.column);
+ "part '%s' conflicts with another symbol (at %s:%d:%d)",
+ part->base.name, oobj->file, oobj->line, oobj->column);
_obj_error(&part->base, buf);
}
/* see _validate_function above */
if (part->base.validated)
- return EINA_TRUE;
+ {
+ if (!oobj)
+ eina_hash_add(nhash, &part->base.name, &part->base);
+ return EINA_TRUE;
+ }
- if (!_validate_doc(src, part->doc))
+ if (!_validate_doc(part->doc))
return EINA_FALSE;
+ /* switch the class name for class */
+ Eolian_Class *pcl = eina_hash_find(part->base.unit->classes, part->klass_name);
+ if (!pcl)
+ {
+ char buf[PATH_MAX];
+ snprintf(buf, sizeof(buf), "unknown part class '%s' (incorrect case?)",
+ part->klass_name);
+ _obj_error(&part->base, buf);
+ return EINA_FALSE;
+ }
+ eina_stringshare_del(part->klass_name);
+ part->klass = pcl;
+
+ if (!oobj)
+ eina_hash_add(nhash, &part->base.name, &part->base);
+
return _validate(&part->base);
}
static Eina_Bool
-_validate_event(const Eolian_Unit *src, Eolian_Event *event)
+_validate_event(Validate_State *vals, Eolian_Event *event, Eina_Hash *nhash)
{
+ char buf[512];
+ const Eolian_Object *oobj = NULL;
+
+ if (vals->event_redef)
+ {
+ oobj = eina_hash_find(nhash, &event->base.name);
+ if (EINA_UNLIKELY(!!oobj))
+ {
+ snprintf(buf, sizeof(buf),
+ "event '%s' conflicts with another symbol (at %s:%d:%d)",
+ event->base.name, oobj->file, oobj->line, oobj->column);
+ _obj_error(&event->base, buf);
+ vals->warned = EINA_TRUE;
+ }
+ }
+
if (event->base.validated)
- return EINA_TRUE;
+ {
+ if (vals->event_redef && !oobj)
+ eina_hash_add(nhash, &event->base.name, &event->base);
+ return EINA_TRUE;
+ }
- if (event->type && !_validate_type(src, event->type))
+ if (!_validate_type(vals, event->type))
return EINA_FALSE;
- if (!_validate_doc(src, event->doc))
+ if (!_validate_doc(event->doc))
return EINA_FALSE;
+ if (vals->event_redef && !oobj)
+ eina_hash_add(nhash, &event->base.name, &event->base);
+
return _validate(&event->base);
}
+const Eolian_Class *
+_get_impl_class(const Eolian_Class *cl, const char *cln)
+{
+ if (!cl || !strcmp(cl->base.name, cln))
+ return cl;
+ Eina_List *l;
+ Eolian_Class *icl;
+ EINA_LIST_FOREACH(cl->inherits, l, icl)
+ {
+ /* we can do a depth first search, it's easier and doesn't matter
+ * which part of the inheritance tree we find the class in
+ */
+ const Eolian_Class *fcl = _get_impl_class(icl, cln);
+ if (fcl)
+ return fcl;
+ }
+ return NULL;
+}
+
+#define _eo_parser_log(_base, ...) \
+ eolian_state_log_obj((_base)->unit->state, (_base), __VA_ARGS__)
+
+static Eina_Bool
+_db_fill_implement(Eolian_Class *cl, Eolian_Implement *impl)
+{
+ Eolian_Function_Type ftype = EOLIAN_METHOD;
+
+ if (impl->is_prop_get && impl->is_prop_set)
+ ftype = EOLIAN_PROPERTY;
+ else if (impl->is_prop_get)
+ ftype = EOLIAN_PROP_GET;
+ else if (impl->is_prop_set)
+ ftype = EOLIAN_PROP_SET;
+
+ size_t imlen = strlen(impl->base.name);
+ char *clbuf = alloca(imlen + 1);
+ memcpy(clbuf, impl->base.name, imlen + 1);
+
+ char *ldot = strrchr(clbuf, '.');
+ if (!ldot)
+ return EINA_FALSE; /* unreachable in practice, for static analysis */
+
+ *ldot = '\0'; /* split between class name and func name */
+ const char *clname = clbuf;
+ const char *fnname = ldot + 1;
+
+ const Eolian_Class *tcl = _get_impl_class(cl, clname);
+ if (!tcl)
+ {
+ _eo_parser_log(&impl->base, "class '%s' not found within the inheritance tree of '%s'",
+ clname, cl->base.name);
+ return EINA_FALSE;
+ }
+
+ impl->klass = tcl;
+
+ const Eolian_Function *fid = eolian_class_function_by_name_get(tcl, fnname, EOLIAN_UNRESOLVED);
+ if (!fid)
+ {
+ _eo_parser_log(&impl->base, "function '%s' not known in class '%s'", fnname, clname);
+ return EINA_FALSE;
+ }
+
+ Eolian_Function_Type aftype = eolian_function_type_get(fid);
+
+ Eina_Bool auto_empty = (impl->get_auto || impl->get_empty);
+
+ /* match implement type against function type */
+ if (ftype == EOLIAN_PROPERTY)
+ {
+ /* property */
+ if (aftype != EOLIAN_PROPERTY)
+ {
+ _eo_parser_log(&impl->base, "function '%s' is not a complete property", fnname);
+ return EINA_FALSE;
+ }
+ auto_empty = auto_empty && (impl->set_auto || impl->set_empty);
+ }
+ else if (ftype == EOLIAN_PROP_SET)
+ {
+ /* setter */
+ if ((aftype != EOLIAN_PROP_SET) && (aftype != EOLIAN_PROPERTY))
+ {
+ _eo_parser_log(&impl->base, "function '%s' doesn't have a setter", fnname);
+ return EINA_FALSE;
+ }
+ auto_empty = (impl->set_auto || impl->set_empty);
+ }
+ else if (ftype == EOLIAN_PROP_GET)
+ {
+ /* getter */
+ if ((aftype != EOLIAN_PROP_GET) && (aftype != EOLIAN_PROPERTY))
+ {
+ _eo_parser_log(&impl->base, "function '%s' doesn't have a getter", fnname);
+ return EINA_FALSE;
+ }
+ }
+ else if (aftype != EOLIAN_METHOD)
+ {
+ _eo_parser_log(&impl->base, "function '%s' is not a method", fnname);
+ return EINA_FALSE;
+ }
+
+ if ((fid->klass == cl) && !auto_empty)
+ {
+ /* only allow explicit implements from other classes, besides auto and
+ * empty... also prevents pure virtuals from being implemented
+ */
+ _eo_parser_log(&impl->base, "invalid implement '%s'", impl->base.name);
+ return EINA_FALSE;
+ }
+
+ impl->foo_id = fid;
+
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_db_fill_implements(Eolian_Class *cl)
+{
+ Eolian_Implement *impl;
+ Eina_List *l;
+
+ Eina_Bool ret = EINA_TRUE;
+
+ Eina_Hash *th = eina_hash_string_small_new(NULL),
+ *pth = eina_hash_string_small_new(NULL);
+ EINA_LIST_FOREACH(cl->implements, l, impl)
+ {
+ Eina_Bool prop = (impl->is_prop_get || impl->is_prop_set);
+ if (eina_hash_find(prop ? pth : th, impl->base.name))
+ {
+ _eo_parser_log(&impl->base, "duplicate implement '%s'", impl->base.name);
+ ret = EINA_FALSE;
+ goto end;
+ }
+ if (impl->klass != cl)
+ {
+ if (!_db_fill_implement(cl, impl))
+ {
+ ret = EINA_FALSE;
+ goto end;
+ }
+ if (eolian_function_is_constructor(impl->foo_id, impl->klass))
+ database_function_constructor_add((Eolian_Function *)impl->foo_id, cl);
+ }
+ if ((impl->klass != cl) && !_db_fill_implement(cl, impl))
+ {
+ ret = EINA_FALSE;
+ goto end;
+ }
+ eina_hash_add(prop ? pth : th, impl->base.name, impl->base.name);
+ }
+
+end:
+ eina_hash_free(th);
+ eina_hash_free(pth);
+ return ret;
+}
+
static Eina_Bool
-_validate_implement(const Eolian_Unit *src, Eolian_Implement *impl)
+_db_fill_ctors(Eolian_Class *cl)
+{
+ Eolian_Constructor *ctor;
+ Eina_List *l;
+
+ Eina_Bool ret = EINA_TRUE;
+
+ Eina_Hash *th = eina_hash_string_small_new(NULL);
+ EINA_LIST_FOREACH(cl->constructors, l, ctor)
+ {
+ if (eina_hash_find(th, ctor->base.name))
+ {
+ _eo_parser_log(&ctor->base, "duplicate ctor '%s'", ctor->base.name);
+ ret = EINA_FALSE;
+ goto end;
+ }
+ const char *ldot = strrchr(ctor->base.name, '.');
+ if (!ldot)
+ {
+ ret = EINA_FALSE;
+ goto end;
+ }
+ char *cnbuf = alloca(ldot - ctor->base.name + 1);
+ memcpy(cnbuf, ctor->base.name, ldot - ctor->base.name);
+ cnbuf[ldot - ctor->base.name] = '\0';
+ const Eolian_Class *tcl = _get_impl_class(cl, cnbuf);
+ if (!tcl)
+ {
+ _eo_parser_log(&ctor->base, "class '%s' not found within the inheritance tree of '%s'",
+ cnbuf, cl->base.name);
+ ret = EINA_FALSE;
+ goto end;
+ }
+ ctor->klass = tcl;
+ const Eolian_Function *cfunc = eolian_constructor_function_get(ctor);
+ if (!cfunc)
+ {
+ _eo_parser_log(&ctor->base, "unable to find function '%s'", ctor->base.name);
+ ret = EINA_FALSE;
+ goto end;
+ }
+ database_function_constructor_add((Eolian_Function *)cfunc, tcl);
+ eina_hash_add(th, ctor->base.name, ctor->base.name);
+ }
+
+end:
+ eina_hash_free(th);
+ return ret;
+}
+
+static Eina_Bool
+_db_fill_inherits(Eolian_Class *cl, Eina_Hash *fhash)
+{
+ if (eina_hash_find(fhash, &cl->base.name))
+ return EINA_TRUE;
+
+ /* already merged outside of staging, therefore validated, and skipped */
+ if (eina_hash_find(cl->base.unit->state->main.unit.classes, cl->base.name))
+ return EINA_TRUE;
+
+ Eina_List *il = cl->inherits;
+ Eina_Stringshare *inn = NULL;
+ cl->inherits = NULL;
+ Eina_Bool succ = EINA_TRUE;
+
+ EINA_LIST_FREE(il, inn)
+ {
+ if (!succ)
+ {
+ eina_stringshare_del(inn);
+ continue;
+ }
+ Eolian_Class *icl = eina_hash_find(cl->base.unit->classes, inn);
+ if (!icl)
+ {
+ succ = EINA_FALSE;
+ char buf[PATH_MAX];
+ snprintf(buf, sizeof(buf), "unknown inherit '%s' (incorrect case?)", inn);
+ _obj_error(&cl->base, buf);
+ }
+ else
+ {
+ cl->inherits = eina_list_append(cl->inherits, icl);
+ /* fill if not found, but do not return right away because
+ * the rest of the list needs to be freed in order not to
+ * leak any memory
+ */
+ if (!_db_fill_inherits(icl, fhash))
+ succ = EINA_FALSE;
+ }
+ eina_stringshare_del(inn);
+ }
+
+ /* failed on the way, no point in filling further
+ * the failed stuff will get dropped so it's ok if it's inconsistent
+ */
+ if (!succ)
+ return EINA_FALSE;
+
+ eina_hash_add(fhash, &cl->base.name, cl);
+
+ /* make sure impls/ctors are filled first, but do it only once */
+ if (!_db_fill_implements(cl))
+ return EINA_FALSE;
+
+ if (!_db_fill_ctors(cl))
+ return EINA_FALSE;
+
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_validate_implement(Eolian_Implement *impl)
{
if (impl->base.validated)
return EINA_TRUE;
- if (!_validate_doc(src, impl->common_doc))
+ if (!_validate_doc(impl->common_doc))
return EINA_FALSE;
- if (!_validate_doc(src, impl->get_doc))
+ if (!_validate_doc(impl->get_doc))
return EINA_FALSE;
- if (!_validate_doc(src, impl->set_doc))
+ if (!_validate_doc(impl->set_doc))
return EINA_FALSE;
return _validate(&impl->base);
}
static Eina_Bool
-_validate_class(const Eolian_Unit *src, Eolian_Class *cl, Eina_Hash *nhash)
+_validate_class(Validate_State *vals, Eolian_Class *cl,
+ Eina_Hash *nhash, Eina_Hash *chash)
{
Eina_List *l;
Eolian_Function *func;
@@ -451,6 +793,10 @@ _validate_class(const Eolian_Unit *src, Eolian_Class *cl, Eina_Hash *nhash)
if (!cl)
return EINA_FALSE; /* if this happens something is very wrong though */
+ /* we've gone through this part */
+ if (eina_hash_find(chash, &cl))
+ return EINA_TRUE;
+
Eina_Bool valid = cl->base.validated;
EINA_LIST_FOREACH(cl->inherits, l, icl)
@@ -464,7 +810,7 @@ _validate_class(const Eolian_Unit *src, Eolian_Class *cl, Eina_Hash *nhash)
{
char buf[PATH_MAX];
snprintf(buf, sizeof(buf), "regular classes ('%s') cannot inherit from non-regular classes ('%s')",
- cl->full_name, icl->full_name);
+ cl->base.name, icl->base.name);
return _obj_error(&cl->base, buf);
}
break;
@@ -474,60 +820,67 @@ _validate_class(const Eolian_Unit *src, Eolian_Class *cl, Eina_Hash *nhash)
{
char buf[PATH_MAX];
snprintf(buf, sizeof(buf), "non-regular classes ('%s') cannot inherit from regular classes ('%s')",
- cl->full_name, icl->full_name);
+ cl->base.name, icl->base.name);
return _obj_error(&cl->base, buf);
}
break;
default:
break;
}
- if (!_validate_class(src, icl, nhash))
+ if (!_validate_class(vals, icl, nhash, chash))
return EINA_FALSE;
}
EINA_LIST_FOREACH(cl->properties, l, func)
- if (!_validate_function(src, func, nhash))
+ if (!_validate_function(vals, func, nhash))
return EINA_FALSE;
EINA_LIST_FOREACH(cl->methods, l, func)
- if (!_validate_function(src, func, nhash))
+ if (!_validate_function(vals, func, nhash))
return EINA_FALSE;
EINA_LIST_FOREACH(cl->events, l, event)
- if (!_validate_event(src, event))
+ if (!_validate_event(vals, event, nhash))
return EINA_FALSE;
EINA_LIST_FOREACH(cl->parts, l, part)
- if (!_validate_part(src, part, nhash))
+ if (!_validate_part(part, nhash))
return EINA_FALSE;
EINA_LIST_FOREACH(cl->implements, l, impl)
- if (!_validate_implement(src, impl))
+ if (!_validate_implement(impl))
return EINA_FALSE;
/* all the checks that need to be done every time are performed now */
if (valid)
- return EINA_TRUE;
+ {
+ /* no need to go through this next time */
+ eina_hash_add(chash, &cl, cl);
+ return EINA_TRUE;
+ }
- if (!_validate_doc(src, cl->doc))
+ if (!_validate_doc(cl->doc))
return EINA_FALSE;
+ /* also done */
+ eina_hash_add(chash, &cl, cl);
+
return _validate(&cl->base);
}
static Eina_Bool
-_validate_variable(const Eolian_Unit *src, Eolian_Variable *var)
+_validate_variable(Validate_State *vals, Eolian_Variable *var)
{
if (var->base.validated)
return EINA_TRUE;
- if (!_validate_type(src, var->base_type))
+ if (!_validate_type(vals, var->base_type))
return EINA_FALSE;
- if (var->value && !_validate_expr(src, var->value, var->base_type, 0))
+ if (var->value && !_validate_expr(var->value, var->base_type, 0))
return EINA_FALSE;
- if (!_validate_doc(src, var->doc))
+ if (!_validate_doc(var->doc))
return EINA_FALSE;
return _validate(&var->base);
@@ -537,57 +890,83 @@ static Eina_Bool
_typedecl_map_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED,
Eolian_Typedecl *tp, Cb_Ret *sc)
{
- return (sc->succ = _validate_typedecl(sc->unit, tp));
+ return (sc->succ = _validate_typedecl(sc->vals, tp));
}
static Eina_Bool
_var_map_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED,
Eolian_Variable *var, Cb_Ret *sc)
{
- return (sc->succ = _validate_variable(sc->unit, var));
+ return (sc->succ = _validate_variable(sc->vals, var));
}
Eina_Bool
-database_validate(Eolian *state, const Eolian_Unit *src)
+database_validate(const Eolian_Unit *src)
{
Eolian_Class *cl;
- Eina_Iterator *iter = eolian_all_classes_get(src);
- Eina_Hash *nhash = eina_hash_string_small_new(NULL);
+ Validate_State vals = {
+ EINA_FALSE,
+ !!getenv("EOLIAN_EVENT_REDEF_WARN")
+ };
+
+ /* do an initial pass to refill inherits */
+ Eina_Iterator *iter = eolian_unit_classes_get(src);
+ Eina_Hash *fhash = eina_hash_pointer_new(NULL);
+ EINA_ITERATOR_FOREACH(iter, cl)
+ {
+ if (!_db_fill_inherits(cl, fhash))
+ {
+ eina_hash_free(fhash);
+ return EINA_FALSE;
+ }
+ }
+ eina_hash_free(fhash);
+ eina_iterator_free(iter);
+
+ iter = eolian_unit_classes_get(src);
+ Eina_Hash *nhash = eina_hash_pointer_new(NULL);
+ Eina_Hash *chash = eina_hash_pointer_new(NULL);
EINA_ITERATOR_FOREACH(iter, cl)
{
eina_hash_free_buckets(nhash);
- if (!_validate_class(src, cl, nhash))
+ eina_hash_free_buckets(chash);
+ if (!_validate_class(&vals, cl, nhash, chash))
{
eina_iterator_free(iter);
eina_hash_free(nhash);
+ eina_hash_free(chash);
return EINA_FALSE;
}
}
+ eina_hash_free(chash);
eina_hash_free(nhash);
eina_iterator_free(iter);
- Cb_Ret rt = { src, EINA_TRUE };
+ Cb_Ret rt = { &vals, EINA_TRUE };
- eina_hash_foreach(state->unit.aliases, (Eina_Hash_Foreach)_typedecl_map_cb, &rt);
+ eina_hash_foreach(src->aliases, (Eina_Hash_Foreach)_typedecl_map_cb, &rt);
if (!rt.succ)
return EINA_FALSE;
- eina_hash_foreach(state->unit.structs, (Eina_Hash_Foreach)_typedecl_map_cb, &rt);
+ eina_hash_foreach(src->structs, (Eina_Hash_Foreach)_typedecl_map_cb, &rt);
if (!rt.succ)
return EINA_FALSE;
- eina_hash_foreach(state->unit.enums, (Eina_Hash_Foreach)_typedecl_map_cb, &rt);
+ eina_hash_foreach(src->enums, (Eina_Hash_Foreach)_typedecl_map_cb, &rt);
if (!rt.succ)
return EINA_FALSE;
- eina_hash_foreach(state->unit.globals, (Eina_Hash_Foreach)_var_map_cb, &rt);
+ eina_hash_foreach(src->globals, (Eina_Hash_Foreach)_var_map_cb, &rt);
if (!rt.succ)
return EINA_FALSE;
- eina_hash_foreach(state->unit.constants, (Eina_Hash_Foreach)_var_map_cb, &rt);
+ eina_hash_foreach(src->constants, (Eina_Hash_Foreach)_var_map_cb, &rt);
if (!rt.succ)
return EINA_FALSE;
+ if(vals.warned)
+ return EINA_FALSE;
+
return EINA_TRUE;
}
diff --git a/src/lib/eolian/database_var.c b/src/lib/eolian/database_var.c
index d0870c3f34..a6eea20cdf 100644
--- a/src/lib/eolian/database_var.c
+++ b/src/lib/eolian/database_var.c
@@ -8,43 +8,38 @@
void
database_var_del(Eolian_Variable *var)
{
- if (!var) return;
- const char *sp;
- if (var->base.file) eina_stringshare_del(var->base.file);
+ if (!var || eolian_object_unref(&var->base)) return;
+ eina_stringshare_del(var->base.file);
+ eina_stringshare_del(var->base.name);
if (var->base_type)
database_type_del(var->base_type);
- if (var->name) eina_stringshare_del(var->name);
- if (var->full_name) eina_stringshare_del(var->full_name);
- if (var->namespaces) EINA_LIST_FREE(var->namespaces, sp)
- eina_stringshare_del(sp);
if (var->value) database_expr_del(var->value);
database_doc_del(var->doc);
free(var);
}
static void
-database_var_global_add(Eolian *state, Eolian_Variable *var)
+database_var_global_add(Eolian_Unit *unit, Eolian_Variable *var)
{
- eina_hash_set(state->unit.globals, var->full_name, var);
- eina_hash_set(state->globals_f, var->base.file, eina_list_append
- ((Eina_List*)eina_hash_find(state->globals_f, var->base.file), var));
- database_decl_add(state, var->full_name, EOLIAN_DECL_VAR, var->base.file, var);
+ EOLIAN_OBJECT_ADD(unit, var->base.name, var, globals);
+ eina_hash_set(unit->state->staging.globals_f, var->base.file, eina_list_append
+ ((Eina_List*)eina_hash_find(unit->state->staging.globals_f, var->base.file), var));
}
static void
-database_var_constant_add(Eolian *state, Eolian_Variable *var)
+database_var_constant_add(Eolian_Unit *unit, Eolian_Variable *var)
{
- eina_hash_set(state->unit.constants, var->full_name, var);
- eina_hash_set(state->constants_f, var->base.file, eina_list_append
- ((Eina_List*)eina_hash_find(state->constants_f, var->base.file), var));
- database_decl_add(state, var->full_name, EOLIAN_DECL_VAR, var->base.file, var);
+ EOLIAN_OBJECT_ADD(unit, var->base.name, var, constants);
+ eina_hash_set(unit->state->staging.constants_f, var->base.file, eina_list_append
+ ((Eina_List*)eina_hash_find(unit->state->staging.constants_f, var->base.file), var));
}
void
-database_var_add(Eolian *state, Eolian_Variable *var)
+database_var_add(Eolian_Unit *unit, Eolian_Variable *var)
{
if (var->type == EOLIAN_VAR_GLOBAL)
- database_var_global_add(state, var);
+ database_var_global_add(unit, var);
else
- database_var_constant_add(state, var);
+ database_var_constant_add(unit, var);
+ database_object_add(unit, &var->base);
}
diff --git a/src/lib/eolian/database_var_api.c b/src/lib/eolian/database_var_api.c
index a0d0e4ec1a..099237a8ba 100644
--- a/src/lib/eolian/database_var_api.c
+++ b/src/lib/eolian/database_var_api.c
@@ -5,61 +5,6 @@
#include <Eina.h>
#include "eolian_database.h"
-EAPI const Eolian_Variable *
-eolian_variable_global_get_by_name(const Eolian_Unit *unit, const char *name)
-{
- if (!unit) return NULL;
- Eina_Stringshare *shr = eina_stringshare_add(name);
- Eolian_Variable *v = eina_hash_find(unit->state->unit.globals, shr);
- eina_stringshare_del(shr);
- return v;
-}
-
-EAPI const Eolian_Variable *
-eolian_variable_constant_get_by_name(const Eolian_Unit *unit, const char *name)
-{
- if (!unit) return NULL;
- Eina_Stringshare *shr = eina_stringshare_add(name);
- Eolian_Variable *v = eina_hash_find(unit->state->unit.constants, shr);
- eina_stringshare_del(shr);
- return v;
-}
-
-EAPI Eina_Iterator *
-eolian_variable_globals_get_by_file(const Eolian_Unit *unit, const char *fname)
-{
- if (!unit) return NULL;
- Eina_Stringshare *shr = eina_stringshare_add(fname);
- Eina_List *l = eina_hash_find(unit->state->globals_f, shr);
- eina_stringshare_del(shr);
- if (!l) return NULL;
- return eina_list_iterator_new(l);
-}
-
-EAPI Eina_Iterator *
-eolian_variable_constants_get_by_file(const Eolian_Unit *unit,
- const char *fname)
-{
- if (!unit) return NULL;
- Eina_Stringshare *shr = eina_stringshare_add(fname);
- Eina_List *l = eina_hash_find(unit->state->constants_f, shr);
- eina_stringshare_del(shr);
- if (!l) return NULL;
- return eina_list_iterator_new(l);
-}
-
-EAPI Eina_Iterator *
-eolian_variable_all_constants_get(const Eolian_Unit *unit)
-{
- return (unit ? eina_hash_iterator_data_new(unit->state->unit.constants) : NULL);
-}
-
-EAPI Eina_Iterator *
-eolian_variable_all_globals_get(const Eolian_Unit *unit)
-{
- return (unit ? eina_hash_iterator_data_new(unit->state->unit.globals) : NULL);
-}
-
EAPI Eolian_Variable_Type
eolian_variable_type_get(const Eolian_Variable *var)
{
@@ -74,13 +19,6 @@ eolian_variable_documentation_get(const Eolian_Variable *var)
return var->doc;
}
-EAPI Eina_Stringshare *
-eolian_variable_file_get(const Eolian_Variable *var)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(var, NULL);
- return var->base.file;
-}
-
EAPI const Eolian_Type *
eolian_variable_base_type_get(const Eolian_Variable *var)
{
@@ -95,28 +33,6 @@ eolian_variable_value_get(const Eolian_Variable *var)
return var->value;
}
-EAPI Eina_Stringshare *
-eolian_variable_name_get(const Eolian_Variable *var)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(var, NULL);
- return var->name;
-}
-
-EAPI Eina_Stringshare *
-eolian_variable_full_name_get(const Eolian_Variable *var)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(var, NULL);
- return var->full_name;
-}
-
-EAPI Eina_Iterator *
-eolian_variable_namespaces_get(const Eolian_Variable *var)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(var, NULL);
- if (!var->namespaces) return NULL;
- return eina_list_iterator_new(var->namespaces);
-}
-
EAPI Eina_Bool
eolian_variable_is_extern(const Eolian_Variable *var)
{
diff --git a/src/lib/eolian/eo_lexer.c b/src/lib/eolian/eo_lexer.c
index 80f08eac2c..8e358164fd 100644
--- a/src/lib/eolian/eo_lexer.c
+++ b/src/lib/eolian/eo_lexer.c
@@ -72,9 +72,8 @@ static const char * const ctypes[] =
"void",
- "Eina_Accessor *", "Eina_Array *", "Eina_Iterator *", "Eina_Hash *",
- "Eina_List *", "Eina_Inarray *", "Eina_Inlist *",
- "Efl_Future *",
+ "Eina_Accessor *", "Eina_Array *", "Eina_Future *", "Eina_Iterator *",
+ "Eina_Hash *", "Eina_List *", "Eina_Inarray *", "Eina_Inlist *",
"Eina_Value", "Eina_Value *",
"char *", "const char *", "Eina_Stringshare *", "Eina_Strbuf *",
@@ -108,14 +107,19 @@ throw(Eo_Lexer *ls, const char *fmt, ...)
for (i = 0; i < ls->column; ++i)
eina_strbuf_append_char(buf, ' ');
eina_strbuf_append(buf, "^\n");
- _eolian_log_line(ls->source, ls->line_number, ls->column,
- "%s", eina_strbuf_string_get(buf));
+ Eolian_Object tmp;
+ memset(&tmp, 0, sizeof(Eolian_Object));
+ tmp.unit = ls->unit;
+ tmp.file = ls->source;
+ tmp.line = ls->line_number;
+ tmp.column = ls->column;
+ eolian_state_log_obj(ls->state, &tmp, "%s", eina_strbuf_string_get(buf));
eina_strbuf_free(buf);
- longjmp(ls->err_jmp, EINA_TRUE);
+ longjmp(ls->err_jmp, EO_LEXER_ERROR_NORMAL);
}
-static void
-init_hash(void)
+void
+eo_lexer_init(void)
{
unsigned int i;
if (keyword_map) return;
@@ -124,8 +128,8 @@ init_hash(void)
eina_hash_add(keyword_map, keywords[i], (void *)(size_t)(i + 1));
}
-static void
-destroy_hash(void)
+void
+eo_lexer_shutdown(void)
{
if (keyword_map)
{
@@ -275,18 +279,18 @@ doc_ref_class(Eo_Lexer *ls, const char *cname)
*p = tolower(*p);
}
memcpy(buf + clen, ".eo", sizeof(".eo"));
- const char *eop = eina_hash_find(ls->state->filenames_eo, buf);
- if (!eop)
+ if (!eina_hash_find(ls->state->filenames_eo, buf))
return;
- eina_hash_set(ls->state->defer, buf, eop);
+ /* ref'd classes do not become dependencies */
+ database_defer(ls->state, buf, EINA_FALSE);
}
static void
-doc_ref(Eo_Lexer *ls)
+doc_ref(Eo_Lexer *ls, Eolian_Documentation *doc)
{
const char *st = ls->stream, *ste = ls->stream_end;
size_t rlen = 0;
- while ((st != ste) && ((*st == '.') || isalnum(*st)))
+ while ((st != ste) && ((*st == '.') || (*st == '_') || isalnum(*st)))
{
++st;
++rlen;
@@ -305,6 +309,12 @@ doc_ref(Eo_Lexer *ls)
/* actual full class name */
doc_ref_class(ls, buf);
+ /* it's definitely a reference, add debug info
+ * 20 bits for line and 12 bits for column, good enough
+ */
+ doc->ref_dbg = eina_list_append(doc->ref_dbg,
+ (void *)(size_t)((ls->line_number & 0xFFFFF) | (((ls->column + 1) & 0xFFF) << 20)));
+
/* method name at the end */
char *end = strrchr(buf, '.');
if (!end)
@@ -323,7 +333,7 @@ doc_ref(Eo_Lexer *ls)
}
static int
-doc_lex(Eo_Lexer *ls, Eina_Bool *term, Eina_Bool *since)
+doc_lex(Eo_Lexer *ls, Eolian_Documentation *doc, Eina_Bool *term, Eina_Bool *since)
{
int tokret = -1;
eina_strbuf_reset(ls->buff);
@@ -393,15 +403,15 @@ doc_lex(Eo_Lexer *ls, Eina_Bool *term, Eina_Bool *since)
tokret = DOC_TEXT;
goto exit_with_token;
}
- doc_ref(ls);
+ doc_ref(ls, doc);
eina_strbuf_append_char(ls->buff, '@');
next_char(ls);
/* in-class references */
- if (ls->tmp.kls && ls->current == '.')
+ if (ls->klass && ls->current == '.')
{
next_char(ls);
if (isalpha(ls->current) || ls->current == '_')
- eina_strbuf_append(ls->buff, ls->tmp.kls->full_name);
+ eina_strbuf_append(ls->buff, ls->klass->base.name);
eina_strbuf_append_char(ls->buff, '.');
}
continue;
@@ -448,6 +458,7 @@ void doc_error(Eo_Lexer *ls, const char *msg, Eolian_Documentation *doc, Eina_St
{
eina_stringshare_del(doc->summary);
eina_stringshare_del(doc->description);
+ eina_list_free(doc->ref_dbg);
free(doc);
eina_strbuf_free(buf);
eo_lexer_lex_error(ls, msg, -1);
@@ -457,9 +468,14 @@ static void
read_doc(Eo_Lexer *ls, Eo_Token *tok, int line, int column)
{
Eolian_Documentation *doc = calloc(1, sizeof(Eolian_Documentation));
+ if (!doc)
+ longjmp(ls->err_jmp, EO_LEXER_ERROR_OOM);
+
+ doc->base.unit = ls->unit;
doc->base.file = ls->filename;
doc->base.line = line;
doc->base.column = column;
+ doc->base.type = EOLIAN_OBJECT_DOCUMENTATION;
Eina_Strbuf *rbuf = eina_strbuf_new();
@@ -473,7 +489,7 @@ read_doc(Eo_Lexer *ls, Eo_Token *tok, int line, int column)
term = EINA_TRUE;
}
else
- read = doc_lex(ls, &term, &since);
+ read = doc_lex(ls, doc, &term, &since);
switch (read)
{
case DOC_MANGLED:
@@ -504,8 +520,8 @@ read_doc(Eo_Lexer *ls, Eo_Token *tok, int line, int column)
doc->description = eina_stringshare_add(eina_strbuf_string_get(rbuf));
if (!doc->summary)
doc->summary = eina_stringshare_add("No description supplied.");
- if (!doc->since && ls->tmp.kls && ls->tmp.kls->doc)
- doc->since = eina_stringshare_ref(ls->tmp.kls->doc->since);
+ if (!doc->since && ls->klass && ls->klass->doc)
+ doc->since = eina_stringshare_ref(ls->klass->doc->since);
eina_strbuf_free(rbuf);
tok->value.doc = doc;
}
@@ -1014,13 +1030,49 @@ get_filename(Eo_Lexer *ls)
}
static void
-eo_lexer_set_input(Eo_Lexer *ls, Eolian *state, const char *source)
+_node_free(Eolian_Object *obj)
+{
+#if 0
+ /* for when we have a proper node allocator and collect on shutdown */
+ if (obj->refcount > 1)
+ {
+ eolian_state_log(obj->state, "node %p (type %d, name %s at %s:%d:%d)"
+ " dangling ref (count: %d)", obj, obj->type, obj->name,
+ obj->file, obj->line, obj->column, obj->refcount);
+ }
+#endif
+ switch (obj->type)
+ {
+ case EOLIAN_OBJECT_CLASS:
+ database_class_del((Eolian_Class *)obj);
+ break;
+ case EOLIAN_OBJECT_TYPEDECL:
+ database_typedecl_del((Eolian_Typedecl *)obj);
+ break;
+ case EOLIAN_OBJECT_TYPE:
+ database_type_del((Eolian_Type *)obj);
+ break;
+ case EOLIAN_OBJECT_VARIABLE:
+ database_var_del((Eolian_Variable *)obj);
+ break;
+ case EOLIAN_OBJECT_EXPRESSION:
+ database_expr_del((Eolian_Expression *)obj);
+ break;
+ default:
+ /* normally unreachable, just for debug */
+ assert(0);
+ break;
+ }
+}
+
+static void
+eo_lexer_set_input(Eo_Lexer *ls, Eolian_State *state, const char *source)
{
Eina_File *f = eina_file_open(source, EINA_FALSE);
if (!f)
{
- _eolian_log("%s", strerror(errno));
- longjmp(ls->err_jmp, EINA_TRUE);
+ eolian_state_log(state, "%s", strerror(errno));
+ longjmp(ls->err_jmp, EO_LEXER_ERROR_NORMAL);
}
ls->lookahead.token = -1;
ls->state = state;
@@ -1034,12 +1086,18 @@ eo_lexer_set_input(Eo_Lexer *ls, Eolian *state, const char *source)
ls->iline_number = ls->line_number = 1;
ls->icolumn = ls->column = -1;
ls->decpoint = '.';
+ ls->nodes = eina_hash_pointer_new(EINA_FREE_CB(_node_free));
next_char(ls);
Eolian_Unit *ncunit = calloc(1, sizeof(Eolian_Unit));
+ if (!ncunit)
+ {
+ eo_lexer_free(ls);
+ eolian_state_panic(state, "out of memory");
+ }
ls->unit = ncunit;
- database_unit_init(state, ncunit);
- eina_hash_add(state->units, ls->filename, ncunit);
+ database_unit_init(state, ncunit, ls->filename);
+ eina_hash_add(state->staging.units, ls->filename, ncunit);
if (ls->current != 0xEF)
return;
@@ -1052,31 +1110,25 @@ eo_lexer_set_input(Eo_Lexer *ls, Eolian *state, const char *source)
next_char(ls);
}
-static void
-_temps_free(Eo_Lexer_Temps *tmp)
+Eolian_Object *
+eo_lexer_node_new(Eo_Lexer *ls, size_t objsize)
{
- Eina_Strbuf *buf;
- Eolian_Type *tp;
- Eolian_Typedecl *tpd;
- const char *s;
-
- if (tmp->kls)
- database_class_del(tmp->kls);
-
- if (tmp->var)
- database_var_del(tmp->var);
-
- EINA_LIST_FREE(tmp->str_bufs, buf)
- eina_strbuf_free(buf);
-
- EINA_LIST_FREE(tmp->type_defs, tp)
- database_type_del(tp);
-
- EINA_LIST_FREE(tmp->type_decls, tpd)
- database_typedecl_del(tpd);
+ Eolian_Object *obj = calloc(1, objsize);
+ if (!obj)
+ longjmp(ls->err_jmp, EO_LEXER_ERROR_OOM);
+ eina_hash_add(ls->nodes, &obj, obj);
+ eolian_object_ref(obj);
+ return obj;
+}
- EINA_LIST_FREE(tmp->strs, s)
- if (s) eina_stringshare_del(s);
+Eolian_Object *
+eo_lexer_node_release(Eo_Lexer *ls, Eolian_Object *obj)
+{
+ /* just for debug */
+ assert(eina_hash_find(ls->nodes, &obj) && (obj->refcount >= 1));
+ eolian_object_unref(obj);
+ eina_hash_set(ls->nodes, &obj, NULL);
+ return obj;
}
static void
@@ -1100,6 +1152,29 @@ _free_tok(Eo_Token *tok)
}
void
+eo_lexer_dtor_push(Eo_Lexer *ls, Eina_Free_Cb free_cb, void *data)
+{
+ Eo_Lexer_Dtor *dt = malloc(sizeof(Eo_Lexer_Dtor));
+ if (!dt)
+ {
+ free_cb(data);
+ longjmp(ls->err_jmp, EO_LEXER_ERROR_OOM);
+ }
+ dt->free_cb = free_cb;
+ dt->data = data;
+ ls->dtors = eina_list_prepend(ls->dtors, dt);
+}
+
+void
+eo_lexer_dtor_pop(Eo_Lexer *ls)
+{
+ Eo_Lexer_Dtor *dt = eina_list_data_get(ls->dtors);
+ ls->dtors = eina_list_remove_list(ls->dtors, ls->dtors);
+ dt->free_cb(dt->data);
+ free(dt);
+}
+
+void
eo_lexer_free(Eo_Lexer *ls)
{
if (!ls) return;
@@ -1110,14 +1185,22 @@ eo_lexer_free(Eo_Lexer *ls)
_free_tok(&ls->t);
eo_lexer_context_clear(ls);
- _temps_free(&ls->tmp);
+
+ Eo_Lexer_Dtor *dtor;
+ EINA_LIST_FREE(ls->dtors, dtor)
+ dtor->free_cb(dtor->data);
+
+ eina_hash_free(ls->nodes);
+
free(ls);
}
Eo_Lexer *
-eo_lexer_new(Eolian *state, const char *source)
+eo_lexer_new(Eolian_State *state, const char *source)
{
volatile Eo_Lexer *ls = calloc(1, sizeof(Eo_Lexer));
+ if (!ls)
+ eolian_state_panic(state, "out of memory");
if (!setjmp(((Eo_Lexer *)(ls))->err_jmp))
{
@@ -1226,32 +1309,6 @@ eo_lexer_get_c_type(int kw)
return ctypes[kw - KW_byte];
}
-static int _init_counter = 0;
-
-int
-eo_lexer_init()
-{
- if (!_init_counter)
- {
- eina_init();
- init_hash();
- }
- return _init_counter++;
-}
-
-int
-eo_lexer_shutdown()
-{
- if (_init_counter <= 0) return 0;
- _init_counter--;
- if (!_init_counter)
- {
- destroy_hash();
- eina_shutdown();
- }
- return _init_counter;
-}
-
static Eina_Bool
_eo_is_tokstr(int t) {
return (t == TOK_STRING) || (t == TOK_VALUE);
@@ -1262,10 +1319,7 @@ eo_lexer_context_push(Eo_Lexer *ls)
{
Lexer_Ctx *ctx = malloc(sizeof(Lexer_Ctx));
if (!ctx)
- {
- _eolian_log("out of memory pushing context");
- longjmp(ls->err_jmp, EINA_TRUE);
- }
+ longjmp(ls->err_jmp, EO_LEXER_ERROR_OOM);
ctx->line = ls->line_number;
ctx->column = ls->column;
ctx->linestr = ls->stream_line;
diff --git a/src/lib/eolian/eo_lexer.h b/src/lib/eolian/eo_lexer.h
index 9ca577101b..846123937c 100644
--- a/src/lib/eolian/eo_lexer.h
+++ b/src/lib/eolian/eo_lexer.h
@@ -27,8 +27,8 @@ enum Tokens
KW(abstract), KW(constructor), KW(constructors), KW(data), \
KW(destructor), KW(eo), KW(eo_prefix), KW(event_prefix), KW(events), KW(free), \
KW(get), KW(implements), KW(import), KW(interface), KW(keys), KW(legacy), \
- KW(legacy_prefix), KW(methods), KW(mixin), KW(params), KW(parts), KW(ptr), \
- KW(set), KW(type), KW(values), KW(var), KWAT(auto), KWAT(beta), \
+ KW(legacy_prefix), KW(methods), KW(mixin), KW(params), KW(parse), KW(parts), \
+ KW(ptr), KW(set), KW(type), KW(values), KW(var), KWAT(auto), KWAT(beta), \
KWAT(class), KWAT(const), KWAT(cref), KWAT(empty), KWAT(extern), \
KWAT(free), KWAT(hot), KWAT(in), KWAT(inout), KWAT(nonull), KWAT(nullable), \
KWAT(optional), KWAT(out), KWAT(owned), KWAT(private), KWAT(property), \
@@ -51,9 +51,8 @@ enum Tokens
\
KW(void), \
\
- KW(accessor), KW(array), KW(iterator), KW(hash), KW(list), KW(inarray), KW(inlist), \
- KW(future), \
- KW(any_value), KW(any_value_ptr), \
+ KW(accessor), KW(array), KW(future), KW(iterator), KW(hash), KW(list), \
+ KW(inarray), KW(inlist), KW(any_value), KW(any_value_ptr), \
KW(mstring), KW(string), KW(stringshare), KW(strbuf), \
\
KW(void_ptr), \
@@ -119,16 +118,11 @@ typedef struct _Lexer_Ctx
Eo_Token token;
} Lexer_Ctx;
-typedef struct _Eo_Lexer_Temps
+typedef struct _Eo_Lexer_Dtor
{
- Eolian_Class *kls;
- Eolian_Variable *var;
- Eina_List *str_bufs;
- Eina_List *type_defs;
- Eina_List *type_decls;
- Eina_List *expr_defs;
- Eina_List *strs;
-} Eo_Lexer_Temps;
+ Eina_Free_Cb free_cb;
+ void *data;
+} Eo_Lexer_Dtor;
/* keeps all lexer state */
typedef struct _Eo_Lexer
@@ -167,7 +161,7 @@ typedef struct _Eo_Lexer
* display the current line with a caret at the respective column */
const char *stream_line;
/* a pointer to the state this lexer belongs to */
- Eolian *state;
+ Eolian_State *state;
/* the unit being filled during current parsing */
Eolian_Unit *unit;
/* this is jumped to when an error happens */
@@ -176,11 +170,20 @@ typedef struct _Eo_Lexer
/* saved context info */
Eina_List *saved_ctxs;
- /* represents the temporaries, every object that is allocated by the
- * parser is temporarily put here so the resources can be reclaimed in
- * case of error - and it's nulled when it's written into a more permanent
- * position (e.g. as part of another struct, or into nodes */
- Eo_Lexer_Temps tmp;
+ Eolian_Class *klass;
+ /* a dtor list; dtors can be pushed and popped during
+ * parser execution to simulate scoped resource management
+ *
+ * unpopped dtors (e.g. on error) are run when the state is freed
+ */
+ Eina_List *dtors;
+ /* a node hash; eolian objects can be allocated through this and
+ * they are stored here (with 1 reference) until they're released
+ * into the environment (they also get deref'd)
+ *
+ * if the release never happens, everything is just freed when the state is
+ */
+ Eina_Hash *nodes;
/* whether we allow lexing expression related tokens */
Eina_Bool expr_mode;
@@ -189,9 +192,16 @@ typedef struct _Eo_Lexer
char decpoint;
} Eo_Lexer;
-int eo_lexer_init (void);
-int eo_lexer_shutdown (void);
-Eo_Lexer *eo_lexer_new (Eolian *state, const char *source);
+typedef enum _Eo_Lexer_Error
+{
+ EO_LEXER_ERROR_UNKNOWN = 0,
+ EO_LEXER_ERROR_NORMAL,
+ EO_LEXER_ERROR_OOM
+} Eo_Lexer_Error;
+
+void eo_lexer_init (void);
+void eo_lexer_shutdown (void);
+Eo_Lexer *eo_lexer_new (Eolian_State *state, const char *source);
void eo_lexer_free (Eo_Lexer *ls);
/* gets a regular token, singlechar or one of TOK_something */
int eo_lexer_get (Eo_Lexer *ls);
@@ -217,4 +227,68 @@ void eo_lexer_context_pop (Eo_Lexer *ls);
void eo_lexer_context_restore(Eo_Lexer *ls);
void eo_lexer_context_clear (Eo_Lexer *ls);
+/* node ("heap") management */
+Eolian_Object *eo_lexer_node_new(Eo_Lexer *ls, size_t objsize);
+Eolian_Object *eo_lexer_node_release(Eo_Lexer *ls, Eolian_Object *obj);
+
+static inline Eolian_Type *
+eo_lexer_type_new(Eo_Lexer *ls)
+{
+ return (Eolian_Type *)eo_lexer_node_new(ls, sizeof(Eolian_Type));
+}
+
+static inline Eolian_Type *
+eo_lexer_type_release(Eo_Lexer *ls, Eolian_Type *tp)
+{
+ return (Eolian_Type *)eo_lexer_node_release(ls, (Eolian_Object *)tp);
+}
+
+static inline Eolian_Typedecl *
+eo_lexer_typedecl_new(Eo_Lexer *ls)
+{
+ return (Eolian_Typedecl *)eo_lexer_node_new(ls, sizeof(Eolian_Typedecl));
+}
+
+static inline Eolian_Typedecl *
+eo_lexer_typedecl_release(Eo_Lexer *ls, Eolian_Typedecl *tp)
+{
+ return (Eolian_Typedecl *)eo_lexer_node_release(ls, (Eolian_Object *)tp);
+}
+
+static inline Eolian_Variable *
+eo_lexer_variable_new(Eo_Lexer *ls)
+{
+ return (Eolian_Variable *)eo_lexer_node_new(ls, sizeof(Eolian_Variable));
+}
+
+static inline Eolian_Variable *
+eo_lexer_variable_release(Eo_Lexer *ls, Eolian_Variable *var)
+{
+ return (Eolian_Variable *)eo_lexer_node_release(ls, (Eolian_Object *)var);
+}
+
+static inline Eolian_Expression *
+eo_lexer_expr_new(Eo_Lexer *ls)
+{
+ return (Eolian_Expression *)eo_lexer_node_new(ls, sizeof(Eolian_Expression));
+}
+
+static inline Eolian_Expression *
+eo_lexer_expr_release(Eo_Lexer *ls, Eolian_Expression *expr)
+{
+ return (Eolian_Expression *)eo_lexer_node_release(ls, (Eolian_Object *)expr);
+}
+
+static inline Eolian_Expression *
+eo_lexer_expr_release_ref(Eo_Lexer *ls, Eolian_Expression *expr)
+{
+ eolian_object_ref(&expr->base);
+ return eo_lexer_expr_release(ls, expr);
+}
+
+/* "stack" management, only to protect against errors (jumps) in parsing */
+void eo_lexer_dtor_push(Eo_Lexer *ls, Eina_Free_Cb free_cb, void *data);
+void eo_lexer_dtor_pop(Eo_Lexer *ls);
+
+
#endif /* __EO_LEXER_H__ */
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index 08b8900016..90b0db60ae 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -12,10 +12,12 @@
eo_lexer_syntax_error(ls, "double " msg); \
has_##var = EINA_TRUE;
-#define FILL_BASE(exp, ls, l, c) \
+#define FILL_BASE(exp, ls, l, c, tp) \
+ (exp).unit = ls->unit; \
(exp).file = eina_stringshare_ref(ls->filename); \
(exp).line = l; \
- (exp).column = c;
+ (exp).column = c; \
+ (exp).type = EOLIAN_OBJECT_##tp
#define FILL_DOC(ls, def, docf) \
if (ls->t.token == TOK_DOC) \
@@ -96,92 +98,71 @@ check_match(Eo_Lexer *ls, int what, int who, int where, int col)
}
}
-static Eina_Strbuf *
-push_strbuf(Eo_Lexer *ls)
-{
- Eina_Strbuf *buf = eina_strbuf_new();
- ls->tmp.str_bufs = eina_list_prepend(ls->tmp.str_bufs, buf);
- return buf;
-}
-
-static void
-pop_strbuf(Eo_Lexer *ls)
-{
- Eina_Strbuf *buf = eina_list_data_get(ls->tmp.str_bufs);
- eina_strbuf_free(buf);
- ls->tmp.str_bufs = eina_list_remove_list(ls->tmp.str_bufs, ls->tmp.str_bufs);
-}
-
-static Eolian_Type *
-push_type(Eo_Lexer *ls)
-{
- Eolian_Type *def = calloc(1, sizeof(Eolian_Type));
- ls->tmp.type_defs = eina_list_prepend(ls->tmp.type_defs, def);
- return def;
-}
-
-static Eolian_Typedecl *
-push_typedecl(Eo_Lexer *ls)
-{
- Eolian_Typedecl *def = calloc(1, sizeof(Eolian_Typedecl));
- ls->tmp.type_decls = eina_list_prepend(ls->tmp.type_decls, def);
- return def;
-}
-
-static void
-pop_type(Eo_Lexer *ls)
+static Eina_Bool
+compare_class_file(const char *fn1, const char *fn2)
{
- eolian_object_ref((Eolian_Object *)eina_list_data_get(ls->tmp.type_defs));
- ls->tmp.type_defs = eina_list_remove_list(ls->tmp.type_defs, ls->tmp.type_defs);
+ return !strcmp(fn1, fn2);
}
-static void
-pop_typedecl(Eo_Lexer *ls)
-{
- eolian_object_ref((Eolian_Object *)eina_list_data_get(ls->tmp.type_decls));
- ls->tmp.type_decls = eina_list_remove_list(ls->tmp.type_decls, ls->tmp.type_decls);
-}
-static Eina_Stringshare *
-push_str(Eo_Lexer *ls, const char *val)
+static Eolian_Object *
+_eolian_decl_get(Eo_Lexer *ls, const char *name)
{
- Eina_Stringshare *shr = eina_stringshare_add(val);
- ls->tmp.strs = eina_list_prepend(ls->tmp.strs, shr);
- return shr;
-}
+ Eolian_Object *obj = eina_hash_find(ls->state->main.unit.objects, name);
+ if (!obj)
+ obj = eina_hash_find(ls->state->staging.unit.objects, name);
+ if (obj && ((obj->type == EOLIAN_OBJECT_CLASS) ||
+ (obj->type == EOLIAN_OBJECT_TYPEDECL) ||
+ (obj->type == EOLIAN_OBJECT_VARIABLE)))
+ return obj;
-static void
-pop_str(Eo_Lexer *ls)
-{
- ls->tmp.strs = eina_list_remove_list(ls->tmp.strs, ls->tmp.strs);
+ return NULL;
}
-static Eina_Bool
-compare_class_file(const char *fn1, const char *fn2)
+static const char *
+_eolian_decl_name_get(Eolian_Object *obj)
{
- return !strcmp(fn1, fn2);
+ switch (obj->type)
+ {
+ case EOLIAN_OBJECT_CLASS:
+ return "class";
+ case EOLIAN_OBJECT_TYPEDECL:
+ switch (((Eolian_Typedecl *)obj)->type)
+ {
+ case EOLIAN_TYPEDECL_ALIAS:
+ return "type alias";
+ case EOLIAN_TYPEDECL_STRUCT:
+ case EOLIAN_TYPEDECL_STRUCT_OPAQUE:
+ return "struct";
+ case EOLIAN_TYPEDECL_ENUM:
+ return "enum";
+ default:
+ break;
+ }
+ case EOLIAN_OBJECT_VARIABLE:
+ return "variable";
+ default:
+ break;
+ }
+ return "unknown";
}
-static const char *declnames[] = {
- "class", "type alias", "struct", "enum", "variable"
-};
-
static void
-redef_error(Eo_Lexer *ls, Eolian_Declaration *decl, Eolian_Declaration_Type newt)
+redef_error(Eo_Lexer *ls, Eolian_Object *obj, Eolian_Object *nobj)
{
- Eolian_Object *obj = (Eolian_Object *)decl->data;
char buf[256], fbuf[256] = { '\0' };
if (ls->filename != obj->file)
snprintf(fbuf, sizeof(fbuf), "%s:%d:%d", obj->file, obj->line, obj->column);
else
snprintf(fbuf, sizeof(fbuf), "%d:%d", obj->line, obj->column);
- if (newt != decl->type)
+ if (nobj->type != obj->type)
snprintf(buf, sizeof(buf), "%s '%s' redefined as %s (originally at %s)",
- declnames[decl->type], decl->name, declnames[newt], fbuf);
+ _eolian_decl_name_get(obj), obj->name,
+ _eolian_decl_name_get(nobj), fbuf);
else
snprintf(buf, sizeof(buf), "%s '%s' redefined (originally at %s)",
- declnames[decl->type], decl->name, fbuf);
+ _eolian_decl_name_get(obj), obj->name, fbuf);
eo_lexer_syntax_error(ls, buf);
}
@@ -207,45 +188,6 @@ parse_name(Eo_Lexer *ls, Eina_Strbuf *buf)
return buf;
}
-static void
-_fill_name(const char *input, Eina_Stringshare **full_name,
- Eina_Stringshare **name, Eina_List **namespaces)
-{
- char *fname = strdup(input);
- char *sname = fname, *dot = fname;
- *full_name = input;
- do
- {
- dot = strchr(dot, '.');
- if (dot)
- {
- *dot = '\0';
- *namespaces = eina_list_append(*namespaces,
- eina_stringshare_add(sname));
- ++dot;
- sname = dot;
- }
- }
- while (dot);
- *name = eina_stringshare_add(sname);
- free(fname);
-}
-
-static Eolian_Expression *
-push_expr(Eo_Lexer *ls)
-{
- Eolian_Expression *def = calloc(1, sizeof(Eolian_Expression));
- ls->tmp.expr_defs = eina_list_prepend(ls->tmp.expr_defs, def);
- return def;
-}
-
-static void
-pop_expr(Eo_Lexer *ls)
-{
- eolian_object_ref((Eolian_Object *)eina_list_data_get(ls->tmp.expr_defs));
- ls->tmp.expr_defs = eina_list_remove_list(ls->tmp.expr_defs, ls->tmp.expr_defs);
-}
-
static Eolian_Binary_Operator
get_binop_id(int tok)
{
@@ -333,12 +275,12 @@ parse_expr_simple(Eo_Lexer *ls)
int line = ls->line_number, col = ls->column;
eo_lexer_get(ls);
Eolian_Expression *exp = parse_expr_bin(ls, UNARY_PRECEDENCE);
- pop_expr(ls);
- expr = push_expr(ls);
- FILL_BASE(expr->base, ls, line, col);
+ expr = eo_lexer_expr_new(ls);
+ FILL_BASE(expr->base, ls, line, col, EXPRESSION);
expr->unop = unop;
expr->type = EOLIAN_EXPR_UNARY;
expr->expr = exp;
+ eo_lexer_expr_release_ref(ls, exp);
return expr;
}
switch (ls->t.token)
@@ -346,8 +288,8 @@ parse_expr_simple(Eo_Lexer *ls)
case TOK_NUMBER:
{
int line = ls->line_number, col = ls->column;
- expr = push_expr(ls);
- FILL_BASE(expr->base, ls, line, col);
+ expr = eo_lexer_expr_new(ls);
+ FILL_BASE(expr->base, ls, line, col, EXPRESSION);
expr->type = ls->t.kw + 1; /* map Numbers from lexer to expr type */
memcpy(&expr->value, &ls->t.value, sizeof(expr->value));
eo_lexer_get(ls);
@@ -356,8 +298,8 @@ parse_expr_simple(Eo_Lexer *ls)
case TOK_STRING:
{
int line = ls->line_number, col = ls->column;
- expr = push_expr(ls);
- FILL_BASE(expr->base, ls, line, col);
+ expr = eo_lexer_expr_new(ls);
+ FILL_BASE(expr->base, ls, line, col, EXPRESSION);
expr->type = EOLIAN_EXPR_STRING;
expr->value.s = eina_stringshare_ref(ls->t.value.s);
eo_lexer_get(ls);
@@ -366,8 +308,8 @@ parse_expr_simple(Eo_Lexer *ls)
case TOK_CHAR:
{
int line = ls->line_number, col = ls->column;
- expr = push_expr(ls);
- FILL_BASE(expr->base, ls, line, col);
+ expr = eo_lexer_expr_new(ls);
+ FILL_BASE(expr->base, ls, line, col, EXPRESSION);
expr->type = EOLIAN_EXPR_CHAR;
expr->value.c = ls->t.value.c;
eo_lexer_get(ls);
@@ -381,7 +323,7 @@ parse_expr_simple(Eo_Lexer *ls)
case KW_true:
case KW_false:
{
- expr = push_expr(ls);
+ expr = eo_lexer_expr_new(ls);
expr->type = EOLIAN_EXPR_BOOL;
expr->value.b = (ls->t.kw == KW_true);
eo_lexer_get(ls);
@@ -389,24 +331,25 @@ parse_expr_simple(Eo_Lexer *ls)
}
case KW_null:
{
- expr = push_expr(ls);
+ expr = eo_lexer_expr_new(ls);
expr->type = EOLIAN_EXPR_NULL;
eo_lexer_get(ls);
break;
}
default:
{
- Eina_Strbuf *buf = push_strbuf(ls);
- expr = push_expr(ls);
+ Eina_Strbuf *buf = eina_strbuf_new();
+ eo_lexer_dtor_push(ls, EINA_FREE_CB(eina_strbuf_free), buf);
+ expr = eo_lexer_expr_new(ls);
expr->type = EOLIAN_EXPR_NAME;
parse_name(ls, buf);
expr->value.s = eina_stringshare_add(eina_strbuf_string_get
(buf));
- pop_strbuf(ls);
+ eo_lexer_dtor_pop(ls);
break;
}
}
- FILL_BASE(expr->base, ls, line, col);
+ FILL_BASE(expr->base, ls, line, col, EXPRESSION);
break;
}
case '(':
@@ -440,14 +383,14 @@ parse_expr_bin(Eo_Lexer *ls, int min_prec)
break;
eo_lexer_get(ls);
rhs = parse_expr_bin(ls, prec + 1);
- pop_expr(ls);
- pop_expr(ls);
- bin = push_expr(ls);
- FILL_BASE(bin->base, ls, line, col);
+ bin = eo_lexer_expr_new(ls);
+ FILL_BASE(bin->base, ls, line, col, EXPRESSION);
bin->binop = op;
bin->type = EOLIAN_EXPR_BINARY;
bin->lhs = lhs;
+ eo_lexer_expr_release_ref(ls, lhs);
bin->rhs = rhs;
+ eo_lexer_expr_release_ref(ls, rhs);
lhs = bin;
}
return lhs;
@@ -479,8 +422,8 @@ parse_type(Eo_Lexer *ls)
static void
_struct_field_free(Eolian_Struct_Type_Field *def)
{
- if (def->base.file) eina_stringshare_del(def->base.file);
- if (def->name) eina_stringshare_del(def->name);
+ eina_stringshare_del(def->base.file);
+ eina_stringshare_del(def->base.name);
database_type_del(def->type);
database_doc_del(def->doc);
free(def);
@@ -491,13 +434,16 @@ parse_struct(Eo_Lexer *ls, const char *name, Eina_Bool is_extern,
int line, int column, const char *freefunc)
{
int bline = ls->line_number, bcolumn = ls->column;
- Eolian_Typedecl *def = push_typedecl(ls);
+ Eolian_Typedecl *def = eo_lexer_typedecl_new(ls);
def->is_extern = is_extern;
- if (name) _fill_name(name, &def->full_name, &def->name, &def->namespaces);
+ def->base.name = name;
def->type = EOLIAN_TYPEDECL_STRUCT;
def->fields = eina_hash_string_small_new(EINA_FREE_CB(_struct_field_free));
- def->freefunc = freefunc;
- pop_str(ls);
+ if (freefunc)
+ {
+ def->freefunc = eina_stringshare_ref(freefunc);
+ eo_lexer_dtor_pop(ls);
+ }
check_next(ls, '{');
FILL_DOC(ls, def, doc);
while (ls->t.token != '}')
@@ -517,26 +463,25 @@ parse_struct(Eo_Lexer *ls, const char *name, Eina_Bool is_extern,
eo_lexer_get(ls);
check_next(ls, ':');
tp = parse_type(ls);
- FILL_BASE(fdef->base, ls, fline, fcol);
- fdef->type = tp;
- fdef->name = eina_stringshare_ref(fname);
- pop_type(ls);
+ FILL_BASE(fdef->base, ls, fline, fcol, STRUCT_FIELD);
+ fdef->type = eo_lexer_type_release(ls, tp);
+ fdef->base.name = eina_stringshare_ref(fname);
if ((fdef->type->owned = (ls->t.kw == KW_at_owned)))
eo_lexer_get(ls);
check_next(ls, ';');
FILL_DOC(ls, fdef, doc);
}
check_match(ls, '}', '{', bline, bcolumn);
- FILL_BASE(def->base, ls, line, column);
- if (name) database_struct_add(ls->state, def);
+ FILL_BASE(def->base, ls, line, column, TYPEDECL);
+ database_struct_add(ls->unit, eo_lexer_typedecl_release(ls, def));
return def;
}
static void
_enum_field_free(Eolian_Enum_Type_Field *def)
{
- if (def->base.file) eina_stringshare_del(def->base.file);
- if (def->name) eina_stringshare_del(def->name);
+ eina_stringshare_del(def->base.file);
+ eina_stringshare_del(def->base.name);
database_expr_del(def->value);
database_doc_del(def->doc);
free(def);
@@ -547,9 +492,9 @@ parse_enum(Eo_Lexer *ls, const char *name, Eina_Bool is_extern,
int line, int column)
{
int bline = ls->line_number, bcolumn = ls->column;
- Eolian_Typedecl *def = push_typedecl(ls);
+ Eolian_Typedecl *def = eo_lexer_typedecl_new(ls);
def->is_extern = is_extern;
- _fill_name(name, &def->full_name, &def->name, &def->namespaces);
+ def->base.name = name;
def->type = EOLIAN_TYPEDECL_ENUM;
def->fields = eina_hash_string_small_new(EINA_FREE_CB(_enum_field_free));
check_next(ls, '{');
@@ -584,29 +529,29 @@ parse_enum(Eo_Lexer *ls, const char *name, Eina_Bool is_extern,
def->field_list = eina_list_append(def->field_list, fdef);
eolian_object_ref(&fdef->base);
eo_lexer_get(ls);
- FILL_BASE(fdef->base, ls, fline, fcol);
+ FILL_BASE(fdef->base, ls, fline, fcol, ENUM_FIELD);
fdef->base_enum = def;
- fdef->name = eina_stringshare_ref(fname);
+ fdef->base.name = eina_stringshare_ref(fname);
if (ls->t.token != '=')
{
if (!prev_fl)
{
- Eolian_Expression *eexp = push_expr(ls);
- FILL_BASE(eexp->base, ls, -1, -1);
+ Eolian_Expression *eexp = eo_lexer_expr_new(ls);
+ FILL_BASE(eexp->base, ls, -1, -1, EXPRESSION);
eexp->type = EOLIAN_EXPR_INT;
eexp->value.i = 0;
fdef->value = eexp;
fdef->is_public_value = EINA_TRUE;
- pop_expr(ls);
+ eo_lexer_expr_release_ref(ls, eexp);
prev_fl = fdef;
fl_nadd = 0;
}
else
{
- Eolian_Expression *rhs = push_expr(ls),
- *bin = push_expr(ls);
- FILL_BASE(rhs->base, ls, -1, -1);
- FILL_BASE(bin->base, ls, -1, -1);
+ Eolian_Expression *rhs = eo_lexer_expr_new(ls),
+ *bin = eo_lexer_expr_new(ls);
+ FILL_BASE(rhs->base, ls, -1, -1, EXPRESSION);
+ FILL_BASE(bin->base, ls, -1, -1, EXPRESSION);
rhs->type = EOLIAN_EXPR_INT;
rhs->value.i = ++fl_nadd;
@@ -616,8 +561,10 @@ parse_enum(Eo_Lexer *ls, const char *name, Eina_Bool is_extern,
bin->lhs = prev_fl->value;
bin->rhs = rhs;
bin->weak_lhs = EINA_TRUE;
+ eo_lexer_expr_release_ref(ls, rhs);
fdef->value = bin;
+ eo_lexer_expr_release_ref(ls, bin);
}
}
else
@@ -629,7 +576,7 @@ parse_enum(Eo_Lexer *ls, const char *name, Eina_Bool is_extern,
ls->expr_mode = EINA_FALSE;
prev_fl = fdef;
fl_nadd = 0;
- pop_expr(ls);
+ eo_lexer_expr_release_ref(ls, fdef->value);
}
Eina_Bool want_next = (ls->t.token == ',');
if (want_next)
@@ -639,8 +586,8 @@ parse_enum(Eo_Lexer *ls, const char *name, Eina_Bool is_extern,
break;
}
check_match(ls, '}', '{', bline, bcolumn);
- FILL_BASE(def->base, ls, line, column);
- if (name) database_enum_add(ls->state, def);
+ FILL_BASE(def->base, ls, line, column, TYPEDECL);
+ database_enum_add(ls->unit, eo_lexer_typedecl_release(ls, def));
return def;
}
@@ -667,7 +614,8 @@ parse_struct_attrs(Eo_Lexer *ls, Eina_Bool is_enum, Eina_Bool *is_extern,
int pline = ls->line_number, pcol = ls->column;
check_next(ls, '(');
check(ls, TOK_VALUE);
- *freefunc = push_str(ls, ls->t.value.s);
+ *freefunc = eina_stringshare_add(ls->t.value.s);
+ eo_lexer_dtor_push(ls, EINA_FREE_CB(eina_stringshare_del), (void *)*freefunc);
eo_lexer_get(ls);
check_match(ls, ')', '(', pline, pcol);
break;
@@ -677,22 +625,6 @@ parse_struct_attrs(Eo_Lexer *ls, Eina_Bool is_enum, Eina_Bool *is_extern,
}
}
-static Eolian_Class *
-_parse_dep(Eo_Lexer *ls, const char *fname, const char *name)
-{
- if (eina_hash_find(ls->state->parsing, fname))
- return NULL;
- Eolian_Class *cl = NULL;
- if (!eo_parser_database_fill(ls->unit, fname, EINA_FALSE, &cl) || !cl)
- {
- char buf[PATH_MAX];
- eo_lexer_context_restore(ls);
- snprintf(buf, sizeof(buf), "error parsing dependency '%s'", name);
- eo_lexer_syntax_error(ls, buf);
- }
- return cl;
-}
-
static Eolian_Type *
parse_type_void(Eo_Lexer *ls)
{
@@ -709,7 +641,7 @@ parse_type_void(Eo_Lexer *ls)
pcol = ls->column;
check_next(ls, '(');
def = parse_type_void(ls);
- FILL_BASE(def->base, ls, line, col);
+ FILL_BASE(def->base, ls, line, col, TYPE);
def->is_const = EINA_TRUE;
check_match(ls, ')', '(', pline, pcol);
return def;
@@ -722,7 +654,7 @@ parse_type_void(Eo_Lexer *ls)
pcol = ls->column;
check_next(ls, '(');
def = parse_type_void(ls);
- FILL_BASE(def->base, ls, line, col);
+ FILL_BASE(def->base, ls, line, col, TYPE);
def->is_ptr = EINA_TRUE;
check_match(ls, ')', '(', pline, pcol);
return def;
@@ -735,7 +667,7 @@ parse_type_void(Eo_Lexer *ls)
pcol = ls->column;
check_next(ls, '(');
def = parse_type_void(ls);
- FILL_BASE(def->base, ls, line, col);
+ FILL_BASE(def->base, ls, line, col, TYPE);
def->legacy = EINA_TRUE;
check_match(ls, ')', '(', pline, pcol);
return def;
@@ -752,15 +684,15 @@ parse_type_void(Eo_Lexer *ls)
check(ls, TOK_VALUE);
def->freefunc = eina_stringshare_ref(ls->t.value.s);
eo_lexer_get(ls);
- FILL_BASE(def->base, ls, line, col);
+ FILL_BASE(def->base, ls, line, col, TYPE);
check_match(ls, ')', '(', pline, pcolumn);
return def;
}
default:
break;
}
- def = push_type(ls);
- FILL_BASE(def->base, ls, line, col);
+ def = eo_lexer_type_new(ls);
+ FILL_BASE(def->base, ls, line, col, TYPE);
if (ls->t.kw == KW_void)
{
def->type = EOLIAN_TYPE_VOID;
@@ -780,33 +712,26 @@ parse_type_void(Eo_Lexer *ls)
if (eo_lexer_is_type_keyword(ls->t.kw))
{
def->btype = ls->t.kw - KW_byte + 1;
- _fill_name(eina_stringshare_ref(ls->t.value.s), &def->full_name,
- &def->name, &def->namespaces);
+ def->base.name = eina_stringshare_ref(ls->t.value.s);
eo_lexer_get(ls);
- if (tpid >= KW_accessor && tpid <= KW_future)
+ if (tpid >= KW_accessor && tpid <= KW_inlist)
{
int bline = ls->line_number, bcol = ls->column;
check_next(ls, '<');
if (tpid == KW_future)
- def->base_type = parse_type_void(ls);
+ def->base_type = eo_lexer_type_release(ls, parse_type_void(ls));
else
- def->base_type = parse_type(ls);
- pop_type(ls);
+ def->base_type = eo_lexer_type_release(ls, parse_type(ls));
if ((def->base_type->owned = (ls->t.kw == KW_at_owned)))
eo_lexer_get(ls);
if (tpid == KW_hash)
{
check_next(ls, ',');
- def->base_type->next_type = parse_type(ls);
- pop_type(ls);
+ def->base_type->next_type =
+ eo_lexer_type_release(ls, parse_type(ls));
if ((def->base_type->next_type->owned = (ls->t.kw == KW_at_owned)))
eo_lexer_get(ls);
}
- else if((tpid == KW_future) && test_next(ls, ','))
- {
- def->base_type->next_type = parse_type_void(ls);
- pop_type(ls);
- }
check_match(ls, '>', '<', bline, bcol);
}
}
@@ -814,7 +739,8 @@ parse_type_void(Eo_Lexer *ls)
{
const char *bnm, *nm;
char *fnm;
- buf = push_strbuf(ls);
+ buf = eina_strbuf_new();
+ eo_lexer_dtor_push(ls, EINA_FREE_CB(eina_strbuf_free), buf);
eo_lexer_context_push(ls);
parse_name(ls, buf);
nm = eina_strbuf_string_get(buf);
@@ -822,11 +748,10 @@ parse_type_void(Eo_Lexer *ls)
fnm = database_class_to_filename(nm);
if (!compare_class_file(bnm, fnm))
{
- const char *fname = eina_hash_find(ls->state->filenames_eo, fnm);
eina_stringshare_del(bnm);
- if (fname)
+ if (eina_hash_find(ls->state->filenames_eo, fnm))
{
- eina_hash_set(ls->state->defer, fnm, fname);
+ database_defer(ls->state, fnm, EINA_TRUE);
def->type = EOLIAN_TYPE_CLASS;
}
free(fnm);
@@ -837,10 +762,9 @@ parse_type_void(Eo_Lexer *ls)
free(fnm);
def->type = EOLIAN_TYPE_CLASS;
}
- _fill_name(eina_stringshare_add(nm), &def->full_name, &def->name,
- &def->namespaces);
+ def->base.name = eina_stringshare_add(nm);
eo_lexer_context_pop(ls);
- pop_strbuf(ls);
+ eo_lexer_dtor_pop(ls);
}
}
return def;
@@ -849,46 +773,45 @@ parse_type_void(Eo_Lexer *ls)
static Eolian_Typedecl *
parse_typedef(Eo_Lexer *ls)
{
- Eolian_Declaration *decl;
- Eolian_Typedecl *def = push_typedecl(ls);
+ Eolian_Typedecl *def = eo_lexer_typedecl_new(ls);
Eina_Bool has_extern;
const char *freefunc;
Eina_Strbuf *buf;
eo_lexer_get(ls);
parse_struct_attrs(ls, EINA_FALSE, &has_extern, &freefunc);
- def->freefunc = freefunc;
- pop_str(ls);
+ if (freefunc)
+ {
+ def->freefunc = eina_stringshare_ref(freefunc);
+ eo_lexer_dtor_pop(ls);
+ }
def->type = EOLIAN_TYPEDECL_ALIAS;
def->is_extern = has_extern;
- buf = push_strbuf(ls);
+ buf = eina_strbuf_new();
+ eo_lexer_dtor_push(ls, EINA_FREE_CB(eina_strbuf_free), buf);
eo_lexer_context_push(ls);
- FILL_BASE(def->base, ls, ls->line_number, ls->column);
+ FILL_BASE(def->base, ls, ls->line_number, ls->column, TYPEDECL);
parse_name(ls, buf);
- _fill_name(eina_stringshare_add(eina_strbuf_string_get(buf)),
- &def->full_name, &def->name, &def->namespaces);
- decl = (Eolian_Declaration *)eina_hash_find(ls->state->unit.decls, def->full_name);
+ def->base.name = eina_stringshare_add(eina_strbuf_string_get(buf));
+ Eolian_Object *decl = _eolian_decl_get(ls, def->base.name);
if (decl)
{
eo_lexer_context_restore(ls);
- redef_error(ls, decl, EOLIAN_DECL_ALIAS);
+ redef_error(ls, decl, &def->base);
}
eo_lexer_context_pop(ls);
check_next(ls, ':');
- def->base_type = parse_type(ls);
- pop_type(ls);
+ def->base_type = eo_lexer_type_release(ls, parse_type(ls));
check_next(ls, ';');
FILL_DOC(ls, def, doc);
- pop_strbuf(ls);
+ eo_lexer_dtor_pop(ls);
return def;
}
static Eolian_Variable *
parse_variable(Eo_Lexer *ls, Eina_Bool global)
{
- Eolian_Declaration *decl;
- Eolian_Variable *def = calloc(1, sizeof(Eolian_Variable));
+ Eolian_Variable *def = eo_lexer_variable_new(ls);
Eina_Strbuf *buf;
- ls->tmp.var = def;
eo_lexer_get(ls);
if (ls->t.kw == KW_at_extern)
{
@@ -896,22 +819,21 @@ parse_variable(Eo_Lexer *ls, Eina_Bool global)
eo_lexer_get(ls);
}
def->type = global ? EOLIAN_VAR_GLOBAL : EOLIAN_VAR_CONSTANT;
- buf = push_strbuf(ls);
+ buf = eina_strbuf_new();
+ eo_lexer_dtor_push(ls, EINA_FREE_CB(eina_strbuf_free), buf);
eo_lexer_context_push(ls);
- FILL_BASE(def->base, ls, ls->line_number, ls->column);
+ FILL_BASE(def->base, ls, ls->line_number, ls->column, VARIABLE);
parse_name(ls, buf);
- _fill_name(eina_stringshare_add(eina_strbuf_string_get(buf)),
- &def->full_name, &def->name, &def->namespaces);
- decl = (Eolian_Declaration *)eina_hash_find(ls->state->unit.decls, def->full_name);
+ def->base.name = eina_stringshare_add(eina_strbuf_string_get(buf));
+ Eolian_Object *decl = _eolian_decl_get(ls, def->base.name);
if (decl)
{
eo_lexer_context_restore(ls);
- redef_error(ls, decl, EOLIAN_DECL_VAR);
+ redef_error(ls, decl, &def->base);
}
eo_lexer_context_pop(ls);
check_next(ls, ':');
- def->base_type = parse_type(ls);
- pop_type(ls);
+ def->base_type = eo_lexer_type_release(ls, parse_type(ls));
/* constants are required to have a value */
if (!global)
check(ls, '=');
@@ -922,11 +844,11 @@ parse_variable(Eo_Lexer *ls, Eina_Bool global)
eo_lexer_get(ls);
def->value = parse_expr(ls);
ls->expr_mode = EINA_FALSE;
- pop_expr(ls);
+ eo_lexer_expr_release_ref(ls, def->value);
}
check_next(ls, ';');
FILL_DOC(ls, def, doc);
- pop_strbuf(ls);
+ eo_lexer_dtor_pop(ls);
return def;
}
@@ -992,7 +914,7 @@ parse_param(Eo_Lexer *ls, Eina_List **params, Eina_Bool allow_inout,
Eina_Bool cref = (ls->t.kw == KW_at_cref);
Eolian_Function_Parameter *par = calloc(1, sizeof(Eolian_Function_Parameter));
par->param_dir = EOLIAN_IN_PARAM;
- FILL_BASE(par->base, ls, ls->line_number, ls->column);
+ FILL_BASE(par->base, ls, ls->line_number, ls->column, FUNCTION_PARAMETER);
*params = eina_list_append(*params, par);
eolian_object_ref(&par->base);
if (cref || (allow_inout && (ls->t.kw == KW_at_in)))
@@ -1012,14 +934,13 @@ parse_param(Eo_Lexer *ls, Eina_List **params, Eina_Bool allow_inout,
}
else par->param_dir = EOLIAN_IN_PARAM;
check(ls, TOK_VALUE);
- par->name = eina_stringshare_ref(ls->t.value.s);
+ par->base.name = eina_stringshare_ref(ls->t.value.s);
eo_lexer_get(ls);
check_next(ls, ':');
if (par->param_dir == EOLIAN_OUT_PARAM || par->param_dir == EOLIAN_INOUT_PARAM)
- par->type = parse_type_void(ls);
+ par->type = eo_lexer_type_release(ls, parse_type_void(ls));
else
- par->type = parse_type(ls);
- pop_type(ls);
+ par->type = eo_lexer_type_release(ls, parse_type(ls));
if ((is_vals || (par->param_dir == EOLIAN_OUT_PARAM)) && (ls->t.token == '('))
{
int line = ls->line_number, col = ls->column;
@@ -1027,7 +948,7 @@ parse_param(Eo_Lexer *ls, Eina_List **params, Eina_Bool allow_inout,
eo_lexer_get(ls);
par->value = parse_expr(ls);
ls->expr_mode = EINA_FALSE;
- pop_expr(ls);
+ eo_lexer_expr_release_ref(ls, par->value);
check_match(ls, ')', '(', line, col);
}
if (cref)
@@ -1106,7 +1027,7 @@ parse_accessor(Eo_Lexer *ls, Eolian_Function *prop)
{
if (prop->base.file)
eina_stringshare_del(prop->base.file);
- FILL_BASE(prop->base, ls, ls->line_number, ls->column);
+ FILL_BASE(prop->base, ls, ls->line_number, ls->column, FUNCTION);
if (prop->type == EOLIAN_PROP_SET)
prop->type = EOLIAN_PROPERTY;
else
@@ -1114,7 +1035,7 @@ parse_accessor(Eo_Lexer *ls, Eolian_Function *prop)
}
else
{
- FILL_BASE(prop->set_base, ls, ls->line_number, ls->column);
+ FILL_BASE(prop->set_base, ls, ls->line_number, ls->column, FUNCTION);
if (prop->type == EOLIAN_PROP_GET)
prop->type = EOLIAN_PROPERTY;
else
@@ -1146,10 +1067,16 @@ parse_accessor:
{
if (getenv("EOLIAN_PROPERTY_DOC_WARN"))
{
- _eolian_log_line(prop->base.file, line, col,
- "%s doc without property doc for '%s.%s'",
- is_get ? "getter" : "setter",
- ls->tmp.kls->full_name, prop->name);
+ Eolian_Object tmp;
+ memset(&tmp, 0, sizeof(Eolian_Object));
+ tmp.file = prop->base.file;
+ tmp.line = line;
+ tmp.column = col;
+ tmp.unit = ls->unit;
+ eolian_state_log_obj(ls->state, &tmp,
+ "%s doc without property doc for '%s.%s'",
+ is_get ? "getter" : "setter",
+ ls->klass->base.name, prop->base.name);
}
}
if (is_get)
@@ -1166,11 +1093,11 @@ parse_accessor:
CASE_LOCK(ls, return, "return")
Eo_Ret_Def ret;
parse_return(ls, &ret, is_get, EINA_TRUE, EINA_FALSE);
- pop_type(ls);
- if (ret.default_ret_val) pop_expr(ls);
+ if (ret.default_ret_val)
+ eo_lexer_expr_release_ref(ls, ret.default_ret_val);
if (is_get)
{
- prop->get_ret_type = ret.type;
+ prop->get_ret_type = eo_lexer_type_release(ls, ret.type);
prop->get_return_doc = ret.doc;
prop->get_ret_val = ret.default_ret_val;
prop->get_return_warn_unused = ret.warn_unused;
@@ -1178,7 +1105,7 @@ parse_accessor:
}
else
{
- prop->set_ret_type = ret.type;
+ prop->set_ret_type = eo_lexer_type_release(ls, ret.type);
prop->set_return_doc = ret.doc;
prop->set_ret_val = ret.default_ret_val;
prop->set_return_warn_unused = ret.warn_unused;
@@ -1229,7 +1156,7 @@ end:
static void
_func_pure_virtual_set(Eo_Lexer *ls, Eolian_Function *foo_id, Eina_Bool virt)
{
- if (ls->tmp.kls->type != EOLIAN_CLASS_INTERFACE && !virt)
+ if (ls->klass->type != EOLIAN_CLASS_INTERFACE && !virt)
return;
if (foo_id->type == EOLIAN_PROP_GET || foo_id->type == EOLIAN_METHOD)
@@ -1251,17 +1178,17 @@ parse_property(Eo_Lexer *ls)
has_protected = EINA_FALSE, has_class = EINA_FALSE,
has_beta = EINA_FALSE, has_virtp = EINA_FALSE;
prop = calloc(1, sizeof(Eolian_Function));
- prop->klass = ls->tmp.kls;
+ prop->klass = ls->klass;
prop->type = EOLIAN_UNRESOLVED;
prop->get_scope = prop->set_scope = EOLIAN_SCOPE_PUBLIC;
- FILL_BASE(prop->base, ls, ls->line_number, ls->column);
+ FILL_BASE(prop->base, ls, ls->line_number, ls->column, FUNCTION);
impl = calloc(1, sizeof(Eolian_Implement));
- impl->klass = ls->tmp.kls;
+ impl->klass = ls->klass;
impl->foo_id = prop;
- FILL_BASE(impl->base, ls, ls->line_number, ls->column);
+ FILL_BASE(impl->base, ls, ls->line_number, ls->column, IMPLEMENT);
prop->impl = impl;
- ls->tmp.kls->properties = eina_list_append(ls->tmp.kls->properties, prop);
- ls->tmp.kls->implements = eina_list_append(ls->tmp.kls->implements, impl);
+ ls->klass->properties = eina_list_append(ls->klass->properties, prop);
+ ls->klass->implements = eina_list_append(ls->klass->implements, impl);
eolian_object_ref(&prop->base);
eolian_object_ref(&impl->base);
check(ls, TOK_VALUE);
@@ -1270,8 +1197,8 @@ parse_property(Eo_Lexer *ls)
eo_lexer_syntax_error(ls, "reserved keyword as property name");
return;
}
- prop->name = eina_stringshare_ref(ls->t.value.s);
- impl->full_name = eina_stringshare_printf("%s.%s", ls->tmp.kls->full_name, prop->name);
+ prop->base.name = eina_stringshare_ref(ls->t.value.s);
+ impl->base.name = eina_stringshare_printf("%s.%s", ls->klass->base.name, prop->base.name);
eo_lexer_get(ls);
for (;;) switch (ls->t.kw)
{
@@ -1341,8 +1268,9 @@ parse_function_pointer(Eo_Lexer *ls)
int bline, bcol;
int line = ls->line_number, col = ls->column;
- Eolian_Typedecl *def = push_typedecl(ls);
- Eina_Strbuf *buf = push_strbuf(ls);
+ Eolian_Typedecl *def = eo_lexer_typedecl_new(ls);
+ Eina_Strbuf *buf = eina_strbuf_new();
+ eo_lexer_dtor_push(ls, EINA_FREE_CB(eina_strbuf_free), buf);
Eolian_Function *meth = NULL;
Eina_Bool has_params = EINA_FALSE,
@@ -1356,16 +1284,14 @@ parse_function_pointer(Eo_Lexer *ls)
eo_lexer_get(ls);
parse_name(ls, buf);
- _fill_name(eina_stringshare_add(eina_strbuf_string_get(buf)),
- &def->full_name, &def->name, &def->namespaces);
-
- pop_strbuf(ls);
+ def->base.name = eina_stringshare_add(eina_strbuf_string_get(buf));
+ eo_lexer_dtor_pop(ls);
meth = calloc(1, sizeof(Eolian_Function));
meth->klass = NULL;
meth->type = EOLIAN_FUNCTION_POINTER;
meth->get_scope = meth->set_scope = EOLIAN_SCOPE_PUBLIC;
- meth->name = eina_stringshare_ref(def->name);
+ meth->base.name = eina_stringshare_add(eolian_object_short_name_get(&def->base));
def->function_pointer = meth;
eolian_object_ref(&meth->base);
@@ -1384,8 +1310,7 @@ parse_function_pointer(Eo_Lexer *ls)
CASE_LOCK(ls, return, "return");
Eo_Ret_Def ret;
parse_return(ls, &ret, EINA_FALSE, EINA_FALSE, EINA_TRUE);
- pop_type(ls);
- meth->get_ret_type = ret.type;
+ meth->get_ret_type = eo_lexer_type_release(ls, ret.type);
meth->get_return_doc = ret.doc;
meth->get_ret_val = NULL;
meth->get_return_warn_unused = EINA_FALSE;
@@ -1400,8 +1325,8 @@ parse_function_pointer(Eo_Lexer *ls)
end:
check_match(ls, '}', '{', bline, bcol);
check_next(ls, ';');
- FILL_BASE(def->base, ls, line, col);
- FILL_BASE(meth->base, ls, line, col);
+ FILL_BASE(def->base, ls, line, col, TYPEDECL);
+ FILL_BASE(meth->base, ls, line, col, FUNCTION);
return def;
}
@@ -1417,17 +1342,17 @@ parse_method(Eo_Lexer *ls)
has_eo = EINA_FALSE, has_beta = EINA_FALSE,
has_virtp = EINA_FALSE;
meth = calloc(1, sizeof(Eolian_Function));
- meth->klass = ls->tmp.kls;
+ meth->klass = ls->klass;
meth->type = EOLIAN_METHOD;
meth->get_scope = meth->set_scope = EOLIAN_SCOPE_PUBLIC;
- FILL_BASE(meth->base, ls, ls->line_number, ls->column);
+ FILL_BASE(meth->base, ls, ls->line_number, ls->column, FUNCTION);
impl = calloc(1, sizeof(Eolian_Implement));
- impl->klass = ls->tmp.kls;
+ impl->klass = ls->klass;
impl->foo_id = meth;
- FILL_BASE(impl->base, ls, ls->line_number, ls->column);
+ FILL_BASE(impl->base, ls, ls->line_number, ls->column, IMPLEMENT);
meth->impl = impl;
- ls->tmp.kls->methods = eina_list_append(ls->tmp.kls->methods, meth);
- ls->tmp.kls->implements = eina_list_append(ls->tmp.kls->implements, impl);
+ ls->klass->methods = eina_list_append(ls->klass->methods, meth);
+ ls->klass->implements = eina_list_append(ls->klass->implements, impl);
eolian_object_ref(&meth->base);
eolian_object_ref(&impl->base);
check(ls, TOK_VALUE);
@@ -1436,8 +1361,8 @@ parse_method(Eo_Lexer *ls)
eo_lexer_syntax_error(ls, "reserved keyword as method name");
return;
}
- meth->name = eina_stringshare_ref(ls->t.value.s);
- impl->full_name = eina_stringshare_printf("%s.%s", ls->tmp.kls->full_name, meth->name);
+ meth->base.name = eina_stringshare_ref(ls->t.value.s);
+ impl->base.name = eina_stringshare_printf("%s.%s", ls->klass->base.name, meth->base.name);
eo_lexer_get(ls);
for (;;) switch (ls->t.kw)
{
@@ -1479,9 +1404,9 @@ body:
CASE_LOCK(ls, return, "return")
Eo_Ret_Def ret;
parse_return(ls, &ret, EINA_FALSE, EINA_TRUE, EINA_FALSE);
- pop_type(ls);
- if (ret.default_ret_val) pop_expr(ls);
- meth->get_ret_type = ret.type;
+ if (ret.default_ret_val)
+ eo_lexer_expr_release_ref(ls, ret.default_ret_val);
+ meth->get_ret_type = eo_lexer_type_release(ls, ret.type);
meth->get_return_doc = ret.doc;
meth->get_ret_val = ret.default_ret_val;
meth->get_return_warn_unused = ret.warn_unused;
@@ -1515,39 +1440,32 @@ static void
parse_part(Eo_Lexer *ls)
{
Eolian_Part *part = calloc(1, sizeof(Eolian_Part));
- ls->tmp.kls->parts = eina_list_append(ls->tmp.kls->parts, part);
+ FILL_BASE(part->base, ls, ls->line_number, ls->column, PART);
+ ls->klass->parts = eina_list_append(ls->klass->parts, part);
eolian_object_ref(&part->base);
check(ls, TOK_VALUE);
- part->name = eina_stringshare_ref(ls->t.value.s);
+ part->base.name = eina_stringshare_ref(ls->t.value.s);
eo_lexer_get(ls);
check_next(ls, ':');
- Eina_Strbuf *buf = push_strbuf(ls);
+ Eina_Strbuf *buf = eina_strbuf_new();
+ eo_lexer_dtor_push(ls, EINA_FREE_CB(eina_strbuf_free), buf);
eo_lexer_context_push(ls);
parse_name(ls, buf);
const char *nm = eina_strbuf_string_get(buf);
- const char *bnm = eina_stringshare_ref(ls->filename);
char *fnm = database_class_to_filename(nm);
- if (!compare_class_file(bnm, fnm))
+ if (!eina_hash_find(ls->state->filenames_eo, fnm))
{
- Eolian_Class *dep = NULL;
- const char *fname = eina_hash_find(ls->state->filenames_eo, fnm);
- eina_stringshare_del(bnm);
free(fnm);
- if (fname)
- dep = _parse_dep(ls, fname, nm);
- if (!dep)
- {
- char ebuf[PATH_MAX];
- eo_lexer_context_restore(ls);
- snprintf(ebuf, sizeof(ebuf), "unknown class '%s'", nm);
- eo_lexer_syntax_error(ls, ebuf);
- return;
- }
- part->klass = dep;
+ char ebuf[PATH_MAX];
+ eo_lexer_context_restore(ls);
+ snprintf(ebuf, sizeof(ebuf), "unknown class '%s'", nm);
+ eo_lexer_syntax_error(ls, ebuf);
+ return;
}
- else
- part->klass = ls->tmp.kls;
- pop_strbuf(ls);
+ database_defer(ls->state, fnm, EINA_TRUE);
+ free(fnm);
+ part->klass_name = eina_stringshare_add(nm);
+ eo_lexer_dtor_pop(ls);
check_next(ls, ';');
FILL_DOC(ls, part, doc);
}
@@ -1566,13 +1484,13 @@ parse_implement(Eo_Lexer *ls, Eina_Bool iface)
check_next(ls, '.');
if (ls->t.kw == KW_destructor)
{
- ls->tmp.kls->class_dtor_enable = EINA_TRUE;
+ ls->klass->class_dtor_enable = EINA_TRUE;
eo_lexer_get(ls);
}
else
{
check_kw_next(ls, KW_constructor);
- ls->tmp.kls->class_ctor_enable = EINA_TRUE;
+ ls->klass->class_ctor_enable = EINA_TRUE;
}
check_next(ls, ';');
return;
@@ -1597,12 +1515,12 @@ parse_implement(Eo_Lexer *ls, Eina_Bool iface)
if (ls->t.token != TOK_VALUE)
eo_lexer_syntax_error(ls, "name expected");
Eina_Stringshare *iname = eina_stringshare_printf("%s.%s",
- ls->tmp.kls->full_name,
+ ls->klass->base.name,
ls->t.value.s);
Eina_List *l;
Eolian_Implement *fimp;
- EINA_LIST_FOREACH(ls->tmp.kls->implements, l, fimp)
- if (iname == fimp->full_name)
+ EINA_LIST_FOREACH(ls->klass->implements, l, fimp)
+ if (iname == fimp->base.name)
{
impl = fimp;
break;
@@ -1619,13 +1537,14 @@ parse_implement(Eo_Lexer *ls, Eina_Bool iface)
else
{
impl = calloc(1, sizeof(Eolian_Implement));
- FILL_BASE(impl->base, ls, iline, icol);
- ls->tmp.kls->implements = eina_list_append(ls->tmp.kls->implements, impl);
+ FILL_BASE(impl->base, ls, iline, icol, IMPLEMENT);
+ ls->klass->implements = eina_list_append(ls->klass->implements, impl);
eolian_object_ref(&impl->base);
}
if (ls->t.token != TOK_VALUE)
eo_lexer_syntax_error(ls, "class name expected");
- buf = push_strbuf(ls);
+ buf = eina_strbuf_new();
+ eo_lexer_dtor_push(ls, EINA_FREE_CB(eina_strbuf_free), buf);
eina_strbuf_append(buf, ls->t.value.s);
eo_lexer_get(ls);
check_next(ls, '.');
@@ -1713,8 +1632,8 @@ propend:
}
if (buf)
{
- impl->full_name = eina_stringshare_add(eina_strbuf_string_get(buf));
- pop_strbuf(ls);
+ impl->base.name = eina_stringshare_add(eina_strbuf_string_get(buf));
+ eo_lexer_dtor_pop(ls);
}
}
@@ -1724,16 +1643,16 @@ parse_constructor(Eo_Lexer *ls)
Eina_Strbuf *buf = NULL;
Eolian_Constructor *ctor = NULL;
ctor = calloc(1, sizeof(Eolian_Constructor));
- FILL_BASE(ctor->base, ls, ls->line_number, ls->column);
- ls->tmp.kls->constructors = eina_list_append(ls->tmp.kls->constructors, ctor);
+ FILL_BASE(ctor->base, ls, ls->line_number, ls->column, CONSTRUCTOR);
+ ls->klass->constructors = eina_list_append(ls->klass->constructors, ctor);
eolian_object_ref(&ctor->base);
if (ls->t.token == '.')
{
check_next(ls, '.');
if (ls->t.token != TOK_VALUE)
eo_lexer_syntax_error(ls, "name expected");
- ctor->full_name = eina_stringshare_printf("%s.%s",
- ls->tmp.kls->full_name,
+ ctor->base.name = eina_stringshare_printf("%s.%s",
+ ls->klass->base.name,
ls->t.value.s);
eo_lexer_get(ls);
if (ls->t.kw == KW_at_optional)
@@ -1745,7 +1664,8 @@ parse_constructor(Eo_Lexer *ls)
return;
}
check(ls, TOK_VALUE);
- buf = push_strbuf(ls);
+ buf = eina_strbuf_new();
+ eo_lexer_dtor_push(ls, EINA_FREE_CB(eina_strbuf_free), buf);
eina_strbuf_append(buf, ls->t.value.s);
eo_lexer_get(ls);
check_next(ls, '.');
@@ -1765,18 +1685,19 @@ parse_constructor(Eo_Lexer *ls)
ctor->is_optional = EINA_TRUE;
}
check_next(ls, ';');
- ctor->full_name = eina_stringshare_add(eina_strbuf_string_get(buf));
- pop_strbuf(ls);
+ ctor->base.name = eina_stringshare_add(eina_strbuf_string_get(buf));
+ eo_lexer_dtor_pop(ls);
}
static void
parse_event(Eo_Lexer *ls)
{
Eolian_Event *ev = calloc(1, sizeof(Eolian_Event));
- FILL_BASE(ev->base, ls, ls->line_number, ls->column);
+ FILL_BASE(ev->base, ls, ls->line_number, ls->column, EVENT);
ev->scope = EOLIAN_SCOPE_PUBLIC;
- Eina_Strbuf *buf = push_strbuf(ls);
- ls->tmp.kls->events = eina_list_append(ls->tmp.kls->events, ev);
+ Eina_Strbuf *buf = eina_strbuf_new();
+ eo_lexer_dtor_push(ls, EINA_FREE_CB(eina_strbuf_free), buf);
+ ls->klass->events = eina_list_append(ls->klass->events, ev);
eolian_object_ref(&ev->base);
check(ls, TOK_VALUE);
eina_strbuf_append(buf, ls->t.value.s);
@@ -1789,8 +1710,8 @@ parse_event(Eo_Lexer *ls)
eina_strbuf_append(buf, ls->t.value.s);
eo_lexer_get(ls);
}
- ev->name = eina_stringshare_add(eina_strbuf_string_get(buf));
- pop_strbuf(ls);
+ ev->base.name = eina_stringshare_add(eina_strbuf_string_get(buf));
+ eo_lexer_dtor_pop(ls);
Eina_Bool has_scope = EINA_FALSE, has_beta = EINA_FALSE,
has_hot = EINA_FALSE, has_restart = EINA_FALSE,
has_owned = EINA_FALSE;
@@ -1827,17 +1748,13 @@ parse_event(Eo_Lexer *ls)
goto end;
}
end:
- if (ls->t.token == ':')
- {
- eo_lexer_get(ls);
- ev->type = parse_type(ls);
- ev->type->owned = has_owned;
- pop_type(ls);
- }
+ check_next(ls, ':');
+ ev->type = eo_lexer_type_release(ls, parse_type_void(ls));
+ ev->type->owned = has_owned;
check(ls, ';');
eo_lexer_get(ls);
FILL_DOC(ls, ev, doc);
- ev->klass = ls->tmp.kls;
+ ev->klass = ls->klass;
}
static void
@@ -1946,10 +1863,10 @@ parse_class_body(Eo_Lexer *ls, Eolian_Class_Type type)
has_implements = EINA_FALSE,
has_constructors = EINA_FALSE,
has_events = EINA_FALSE;
- FILL_DOC(ls, ls->tmp.kls, doc);
+ FILL_DOC(ls, ls->klass, doc);
if (type == EOLIAN_CLASS_INTERFACE)
{
- ls->tmp.kls->data_type = eina_stringshare_add("null");
+ ls->klass->data_type = eina_stringshare_add("null");
}
for (;;) switch (ls->t.kw)
{
@@ -1958,7 +1875,7 @@ parse_class_body(Eo_Lexer *ls, Eolian_Class_Type type)
eo_lexer_get(ls);
check_next(ls, ':');
_validate_pfx(ls);
- ls->tmp.kls->legacy_prefix = eina_stringshare_ref(ls->t.value.s);
+ ls->klass->legacy_prefix = eina_stringshare_ref(ls->t.value.s);
eo_lexer_get(ls);
check_next(ls, ';');
break;
@@ -1967,7 +1884,7 @@ parse_class_body(Eo_Lexer *ls, Eolian_Class_Type type)
eo_lexer_get(ls);
check_next(ls, ':');
_validate_pfx(ls);
- ls->tmp.kls->eo_prefix = eina_stringshare_ref(ls->t.value.s);
+ ls->klass->eo_prefix = eina_stringshare_ref(ls->t.value.s);
eo_lexer_get(ls);
check_next(ls, ';');
break;
@@ -1976,7 +1893,7 @@ parse_class_body(Eo_Lexer *ls, Eolian_Class_Type type)
eo_lexer_get(ls);
check_next(ls, ':');
_validate_pfx(ls);
- ls->tmp.kls->ev_prefix = eina_stringshare_ref(ls->t.value.s);
+ ls->klass->ev_prefix = eina_stringshare_ref(ls->t.value.s);
eo_lexer_get(ls);
check_next(ls, ';');
break;
@@ -1986,7 +1903,7 @@ parse_class_body(Eo_Lexer *ls, Eolian_Class_Type type)
eo_lexer_get(ls);
check_next(ls, ':');
check(ls, TOK_VALUE);
- ls->tmp.kls->data_type = eina_stringshare_ref(ls->t.value.s);
+ ls->klass->data_type = eina_stringshare_ref(ls->t.value.s);
eo_lexer_get(ls);
check_next(ls, ';');
break;
@@ -2020,7 +1937,7 @@ parse_class_body(Eo_Lexer *ls, Eolian_Class_Type type)
static void
_inherit_dep(Eo_Lexer *ls, Eina_Strbuf *buf)
{
- const char *fname, *iname;
+ const char *iname;
char *fnm;
eina_strbuf_reset(buf);
eo_lexer_context_push(ls);
@@ -2037,41 +1954,51 @@ _inherit_dep(Eo_Lexer *ls, Eina_Strbuf *buf)
eo_lexer_syntax_error(ls, ebuf);
return; /* unreachable (longjmp above), make static analysis shut up */
}
- fname = eina_hash_find(ls->state->filenames_eo, fnm);
- free(fnm);
- if (!fname)
+ if (!eina_hash_find(ls->state->filenames_eo, fnm))
{
char ebuf[PATH_MAX];
+ free(fnm);
eo_lexer_context_restore(ls);
snprintf(ebuf, sizeof(ebuf), "unknown inherit '%s'", iname);
eo_lexer_syntax_error(ls, ebuf);
+ return;
}
- Eolian_Class *dep = _parse_dep(ls, fname, iname);
- if (!dep)
+
+ Eina_Stringshare *inames = eina_stringshare_add(iname), *oiname = NULL;
+ Eina_List *l;
+ /* never allow duplicate inherits */
+ EINA_LIST_FOREACH(ls->klass->inherits, l, oiname)
{
- char ebuf[PATH_MAX];
- eo_lexer_context_restore(ls);
- snprintf(ebuf, sizeof(ebuf), "unknown inherit '%s'. Incorrect case?", iname);
- eo_lexer_syntax_error(ls, ebuf);
- return;
+ if (inames == oiname)
+ {
+ char ebuf[PATH_MAX];
+ free(fnm);
+ eina_stringshare_del(inames);
+ eo_lexer_context_restore(ls);
+ snprintf(ebuf, sizeof(ebuf), "duplicate inherit '%s'", iname);
+ eo_lexer_syntax_error(ls, ebuf);
+ return;
+ }
}
- ls->tmp.kls->inherits = eina_list_append(ls->tmp.kls->inherits, dep);
+ database_defer(ls->state, fnm, EINA_TRUE);
+ ls->klass->inherits = eina_list_append(ls->klass->inherits, inames);
+ free(fnm);
eo_lexer_context_pop(ls);
}
static void
parse_class(Eo_Lexer *ls, Eolian_Class_Type type)
{
- Eolian_Declaration *decl;
const char *bnm;
char *fnm;
Eina_Bool same;
int line, col;
- Eina_Strbuf *buf = push_strbuf(ls);
- ls->tmp.kls = calloc(1, sizeof(Eolian_Class));
- FILL_BASE(ls->tmp.kls->base, ls, ls->line_number, ls->column);
+ Eina_Strbuf *buf = eina_strbuf_new();
+ eo_lexer_dtor_push(ls, EINA_FREE_CB(eina_strbuf_free), buf);
+ ls->klass = (Eolian_Class *)eo_lexer_node_new(ls, sizeof(Eolian_Class));
+ FILL_BASE(ls->klass->base, ls, ls->line_number, ls->column, CLASS);
eo_lexer_get(ls);
- ls->tmp.kls->type = type;
+ ls->klass->type = type;
eo_lexer_context_push(ls);
parse_name(ls, buf);
bnm = eina_stringshare_ref(ls->filename);
@@ -2084,17 +2011,15 @@ parse_class(Eo_Lexer *ls, Eolian_Class_Type type)
eo_lexer_context_restore(ls);
eo_lexer_syntax_error(ls, "class and file names differ");
}
- _fill_name(eina_stringshare_add(eina_strbuf_string_get(buf)),
- &ls->tmp.kls->full_name, &ls->tmp.kls->name,
- &ls->tmp.kls->namespaces);
- decl = (Eolian_Declaration *)eina_hash_find(ls->state->unit.decls, ls->tmp.kls->full_name);
+ ls->klass->base.name = eina_stringshare_add(eina_strbuf_string_get(buf));
+ Eolian_Object *decl = _eolian_decl_get(ls, ls->klass->base.name);
if (decl)
{
eo_lexer_context_restore(ls);
- redef_error(ls, decl, EOLIAN_DECL_CLASS);
+ redef_error(ls, decl, &ls->klass->base);
}
eo_lexer_context_pop(ls);
- pop_strbuf(ls);
+ eo_lexer_dtor_pop(ls);
if (ls->t.token != '{')
{
line = ls->line_number;
@@ -2102,11 +2027,12 @@ parse_class(Eo_Lexer *ls, Eolian_Class_Type type)
check_next(ls, '(');
if (ls->t.token != ')')
{
- Eina_Strbuf *ibuf = push_strbuf(ls);
+ Eina_Strbuf *ibuf = eina_strbuf_new();
+ eo_lexer_dtor_push(ls, EINA_FREE_CB(eina_strbuf_free), ibuf);
_inherit_dep(ls, ibuf);
while (test_next(ls, ','))
_inherit_dep(ls, ibuf);
- pop_strbuf(ls);
+ eo_lexer_dtor_pop(ls);
}
check_match(ls, ')', '(', line, col);
}
@@ -2139,50 +2065,51 @@ parse_unit(Eo_Lexer *ls, Eina_Bool eot)
parse_class(ls, EOLIAN_CLASS_INTERFACE);
goto found_class;
case KW_import:
+ case KW_parse:
{
- Eina_Strbuf *buf = push_strbuf(ls);
- const char *found = NULL;
+ Eina_Bool isdep = (ls->t.kw == KW_import);
+ Eina_Strbuf *buf = eina_strbuf_new();
+ eo_lexer_dtor_push(ls, EINA_FREE_CB(eina_strbuf_free), buf);
char errbuf[PATH_MAX];
eo_lexer_get(ls);
check(ls, TOK_VALUE);
eina_strbuf_append(buf, ls->t.value.s);
eina_strbuf_append(buf, ".eot");
- if (!(found = eina_hash_find(ls->state->filenames_eot, eina_strbuf_string_get(buf))))
+ if (!eina_hash_find(ls->state->filenames_eot, eina_strbuf_string_get(buf)))
{
size_t buflen = eina_strbuf_length_get(buf);
eina_strbuf_remove(buf, buflen - 1, buflen);
- if (!(found = eina_hash_find(ls->state->filenames_eo, eina_strbuf_string_get(buf))))
+ if (!eina_hash_find(ls->state->filenames_eo, eina_strbuf_string_get(buf)))
{
- pop_strbuf(ls);
+ eo_lexer_dtor_pop(ls);
snprintf(errbuf, sizeof(errbuf),
"unknown import '%s'", ls->t.value.s);
eo_lexer_syntax_error(ls, errbuf);
}
}
- eina_hash_set(ls->state->defer, eina_strbuf_string_get(buf), found);
- pop_strbuf(ls);
+ database_defer(ls->state, eina_strbuf_string_get(buf), isdep);
+ eo_lexer_dtor_pop(ls);
eo_lexer_get(ls);
check_next(ls, ';');
break;
}
case KW_type:
{
- database_type_add(ls->state, parse_typedef(ls));
- pop_typedecl(ls);
+ database_type_add(ls->unit,
+ eo_lexer_typedecl_release(ls, parse_typedef(ls)));
break;
}
case KW_function:
{
- database_type_add(ls->state, parse_function_pointer(ls));
- pop_typedecl(ls);
+ database_type_add(ls->unit,
+ eo_lexer_typedecl_release(ls, parse_function_pointer(ls)));
break;
}
case KW_const:
case KW_var:
{
- database_var_add(ls->state, parse_variable(ls, ls->t.kw == KW_var));
- eolian_object_ref(&ls->tmp.var->base);
- ls->tmp.var = NULL;
+ database_var_add(ls->unit, eo_lexer_variable_release(ls,
+ parse_variable(ls, ls->t.kw == KW_var)));
break;
}
case KW_struct:
@@ -2191,47 +2118,51 @@ parse_unit(Eo_Lexer *ls, Eina_Bool eot)
Eina_Bool is_enum = (ls->t.kw == KW_enum);
const char *name;
int line, col;
- Eolian_Declaration *decl;
Eina_Bool has_extern;
const char *freefunc;
Eina_Strbuf *buf;
eo_lexer_get(ls);
parse_struct_attrs(ls, is_enum, &has_extern, &freefunc);
- buf = push_strbuf(ls);
+ buf = eina_strbuf_new();
+ eo_lexer_dtor_push(ls, EINA_FREE_CB(eina_strbuf_free), buf);
eo_lexer_context_push(ls);
line = ls->line_number;
col = ls->column;
parse_name(ls, buf);
name = eina_stringshare_add(eina_strbuf_string_get(buf));
- decl = (Eolian_Declaration *)eina_hash_find(ls->state->unit.decls, name);
+ Eolian_Object *decl = _eolian_decl_get(ls, name);
if (decl)
{
eina_stringshare_del(name);
eo_lexer_context_restore(ls);
- redef_error(ls, decl, is_enum ? EOLIAN_DECL_ENUM : EOLIAN_DECL_STRUCT);
+ Eolian_Typedecl tdecl;
+ tdecl.base.type = EOLIAN_OBJECT_TYPEDECL;
+ tdecl.type = is_enum ? EOLIAN_TYPEDECL_ENUM : EOLIAN_TYPEDECL_STRUCT;
+ redef_error(ls, decl, &tdecl.base);
}
eo_lexer_context_pop(ls);
- pop_strbuf(ls);
+ eo_lexer_dtor_pop(ls);
if (!is_enum && ls->t.token == ';')
{
- Eolian_Typedecl *def = push_typedecl(ls);
+ Eolian_Typedecl *def = eo_lexer_typedecl_new(ls);
def->is_extern = has_extern;
def->type = EOLIAN_TYPEDECL_STRUCT_OPAQUE;
- def->freefunc = freefunc;
- pop_str(ls);
- _fill_name(name, &def->full_name, &def->name, &def->namespaces);
+ if (freefunc)
+ {
+ def->freefunc = eina_stringshare_ref(freefunc);
+ eo_lexer_dtor_pop(ls);
+ }
+ def->base.name = name;
eo_lexer_get(ls);
FILL_DOC(ls, def, doc);
- FILL_BASE(def->base, ls, line, col);
- database_struct_add(ls->state, def);
- pop_typedecl(ls);
+ FILL_BASE(def->base, ls, line, col, TYPEDECL);
+ database_struct_add(ls->unit, eo_lexer_typedecl_release(ls, def));
break;
}
if (is_enum)
parse_enum(ls, name, has_extern, line, col);
else
parse_struct(ls, name, has_extern, line, col, freefunc);
- pop_typedecl(ls);
break;
}
def:
@@ -2241,8 +2172,7 @@ parse_unit(Eo_Lexer *ls, Eina_Bool eot)
}
return EINA_FALSE;
found_class:
- database_decl_add(ls->state, ls->tmp.kls->full_name, EOLIAN_DECL_CLASS,
- ls->tmp.kls->base.file, ls->tmp.kls);
+ database_object_add(ls->unit, &ls->klass->base);
return EINA_TRUE;
}
@@ -2255,287 +2185,76 @@ parse_chunk(Eo_Lexer *ls, Eina_Bool eot)
eot = EINA_TRUE;
}
-const Eolian_Class *
-_get_impl_class(const Eolian_Class *cl, const char *cln)
-{
- if (!cl || !strcmp(cl->full_name, cln))
- return cl;
- Eina_List *l;
- Eolian_Class *icl;
- EINA_LIST_FOREACH(cl->inherits, l, icl)
- {
- /* we can do a depth first search, it's easier and doesn't matter
- * which part of the inheritance tree we find the class in
- */
- const Eolian_Class *fcl = _get_impl_class(icl, cln);
- if (fcl)
- return fcl;
- }
- return NULL;
-}
-
-#define _eo_parser_log(_base, ...) \
- _eolian_log_line((_base)->file, (_base)->line, (_base)->column, __VA_ARGS__)
-
-static Eina_Bool
-_db_fill_implement(Eolian_Class *cl, Eolian_Implement *impl)
-{
- Eolian_Function_Type ftype = EOLIAN_METHOD;
-
- if (impl->is_prop_get && impl->is_prop_set)
- ftype = EOLIAN_PROPERTY;
- else if (impl->is_prop_get)
- ftype = EOLIAN_PROP_GET;
- else if (impl->is_prop_set)
- ftype = EOLIAN_PROP_SET;
-
- size_t imlen = strlen(impl->full_name);
- char *clbuf = alloca(imlen + 1);
- memcpy(clbuf, impl->full_name, imlen + 1);
-
- char *ldot = strrchr(clbuf, '.');
- if (!ldot)
- return EINA_FALSE; /* unreachable in practice, for static analysis */
-
- *ldot = '\0'; /* split between class name and func name */
- const char *clname = clbuf;
- const char *fnname = ldot + 1;
-
- const Eolian_Class *tcl = _get_impl_class(cl, clname);
- if (!tcl)
- {
- _eo_parser_log(&impl->base, "class '%s' not found within the inheritance tree of '%s'",
- clname, cl->full_name);
- return EINA_FALSE;
- }
-
- impl->klass = tcl;
-
- const Eolian_Function *fid = eolian_class_function_get_by_name(tcl, fnname, EOLIAN_UNRESOLVED);
- if (!fid)
- {
- _eo_parser_log(&impl->base, "function '%s' not known in class '%s'", fnname, clname);
- return EINA_FALSE;
- }
-
- Eolian_Function_Type aftype = eolian_function_type_get(fid);
-
- Eina_Bool auto_empty = (impl->get_auto || impl->get_empty);
-
- /* match implement type against function type */
- if (ftype == EOLIAN_PROPERTY)
- {
- /* property */
- if (aftype != EOLIAN_PROPERTY)
- {
- _eo_parser_log(&impl->base, "function '%s' is not a complete property", fnname);
- return EINA_FALSE;
- }
- auto_empty = auto_empty && (impl->set_auto || impl->set_empty);
- }
- else if (ftype == EOLIAN_PROP_SET)
- {
- /* setter */
- if ((aftype != EOLIAN_PROP_SET) && (aftype != EOLIAN_PROPERTY))
- {
- _eo_parser_log(&impl->base, "function '%s' doesn't have a setter", fnname);
- return EINA_FALSE;
- }
- auto_empty = (impl->set_auto || impl->set_empty);
- }
- else if (ftype == EOLIAN_PROP_GET)
- {
- /* getter */
- if ((aftype != EOLIAN_PROP_GET) && (aftype != EOLIAN_PROPERTY))
- {
- _eo_parser_log(&impl->base, "function '%s' doesn't have a getter", fnname);
- return EINA_FALSE;
- }
- }
- else if (aftype != EOLIAN_METHOD)
- {
- _eo_parser_log(&impl->base, "function '%s' is not a method", fnname);
- return EINA_FALSE;
- }
-
- if ((fid->klass == cl) && !auto_empty)
- {
- /* only allow explicit implements from other classes, besides auto and
- * empty... also prevents pure virtuals from being implemented
- */
- _eo_parser_log(&impl->base, "invalid implement '%s'", impl->full_name);
- return EINA_FALSE;
- }
-
- impl->foo_id = fid;
-
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_db_fill_implements(Eolian_Class *cl)
-{
- Eolian_Implement *impl;
- Eina_List *l;
-
- Eina_Bool ret = EINA_TRUE;
-
- Eina_Hash *th = eina_hash_string_small_new(NULL),
- *pth = eina_hash_string_small_new(NULL);
- EINA_LIST_FOREACH(cl->implements, l, impl)
- {
- Eina_Bool prop = (impl->is_prop_get || impl->is_prop_set);
- if (eina_hash_find(prop ? pth : th, impl->full_name))
- {
- _eo_parser_log(&impl->base, "duplicate implement '%s'", impl->full_name);
- ret = EINA_FALSE;
- goto end;
- }
- if (impl->klass != cl)
- {
- if (!_db_fill_implement(cl, impl))
- {
- ret = EINA_FALSE;
- goto end;
- }
- if (eolian_function_is_constructor(impl->foo_id, impl->klass))
- database_function_constructor_add((Eolian_Function *)impl->foo_id, cl);
- }
- if ((impl->klass != cl) && !_db_fill_implement(cl, impl))
- {
- ret = EINA_FALSE;
- goto end;
- }
- eina_hash_add(prop ? pth : th, impl->full_name, impl->full_name);
- }
-
-end:
- eina_hash_free(th);
- eina_hash_free(pth);
- return ret;
-}
-
-static Eina_Bool
-_db_fill_ctors(Eolian_Class *cl)
-{
- Eolian_Constructor *ctor;
- Eina_List *l;
+Eolian_Unit *
+eo_parser_database_fill(Eolian_Unit *parent, const char *filename, Eina_Bool eot)
+{
+ int status = 0;
+ const char *fsl = strrchr(filename, '/');
+ const char *bsl = strrchr(filename, '\\');
+ const char *fname = NULL;
+ if (fsl || bsl)
+ fname = eina_stringshare_add((fsl > bsl) ? (fsl + 1) : (bsl + 1));
+ else
+ fname = eina_stringshare_add(filename);
- Eina_Bool ret = EINA_TRUE;
+ Eolian_Unit *ret = eina_hash_find(parent->state->main.units, fname);
+ if (!ret)
+ ret = eina_hash_find(parent->state->staging.units, fname);
- Eina_Hash *th = eina_hash_string_small_new(NULL);
- EINA_LIST_FOREACH(cl->constructors, l, ctor)
+ if (ret)
{
- if (eina_hash_find(th, ctor->full_name))
- {
- _eo_parser_log(&ctor->base, "duplicate ctor '%s'", ctor->full_name);
- ret = EINA_FALSE;
- goto end;
- }
- const char *ldot = strrchr(ctor->full_name, '.');
- if (!ldot)
- {
- ret = EINA_FALSE;
- goto end;
- }
- char *cnbuf = alloca(ldot - ctor->full_name + 1);
- memcpy(cnbuf, ctor->full_name, ldot - ctor->full_name);
- cnbuf[ldot - ctor->full_name] = '\0';
- const Eolian_Class *tcl = _get_impl_class(cl, cnbuf);
- if (!tcl)
- {
- _eo_parser_log(&ctor->base, "class '%s' not found within the inheritance tree of '%s'",
- cnbuf, cl->full_name);
- ret = EINA_FALSE;
- goto end;
- }
- ctor->klass = tcl;
- const Eolian_Function *cfunc = eolian_constructor_function_get(ctor);
- if (!cfunc)
- {
- _eo_parser_log(&ctor->base, "unable to find function '%s'", ctor->full_name);
- ret = EINA_FALSE;
- goto end;
- }
- database_function_constructor_add((Eolian_Function *)cfunc, tcl);
- eina_hash_add(th, ctor->full_name, ctor->full_name);
- }
-
-end:
- eina_hash_free(th);
- return ret;
-}
-
-Eolian_Unit *
-eo_parser_database_fill(Eolian_Unit *parent, const char *filename, Eina_Bool eot, Eolian_Class **fcl)
-{
- Eolian_Unit *ret = NULL;
- Eolian_Class *cl = eina_hash_find(parent->state->parsed, filename);
- if (cl)
- {
- if (!eot && fcl) *fcl = cl;
- const char *fsl = strrchr(filename, '/');
- const char *bsl = strrchr(filename, '\\');
- const char *fname = NULL;
- if (fsl || bsl)
- fname = eina_stringshare_add((fsl > bsl) ? (fsl + 1) : (bsl + 1));
- if (fname)
- {
- ret = eina_hash_find(parent->state->units, fname);
- eina_stringshare_del(fname);
- return ret;
- }
- return NULL;
+ if ((parent != ret) && !eina_hash_find(parent->children, fname))
+ eina_hash_add(parent->children, fname, ret);
+ eina_stringshare_del(fname);
+ return ret;
}
- eina_hash_set(parent->state->parsing, filename, (void *)EINA_TRUE);
-
Eo_Lexer *ls = eo_lexer_new(parent->state, filename);
if (!ls)
{
- _eolian_log("unable to create lexer for file '%s'", filename);
+ eolian_state_log(parent->state, "unable to create lexer for file '%s'",
+ filename);
goto error;
}
/* read first token */
eo_lexer_get(ls);
- if (setjmp(ls->err_jmp))
+ if ((status = setjmp(ls->err_jmp)))
goto error;
parse_chunk(ls, eot);
if (eot) goto done;
- if (!(cl = ls->tmp.kls))
+ Eolian_Class *cl;
+ if (!(cl = ls->klass))
{
- _eolian_log("eolian: no class for file '%s'", filename);
+ eolian_state_log(ls->state, "no class for file '%s'", filename);
goto error;
}
- ls->tmp.kls = NULL;
-
- if (!_db_fill_implements(cl))
- goto error;
-
- if (!_db_fill_ctors(cl))
- goto error;
-
- eina_hash_set(ls->state->unit.classes, cl->full_name, cl);
- eina_hash_set(ls->state->classes_f, cl->base.file, cl);
- eolian_object_ref(&cl->base);
-
- if (fcl) *fcl = cl;
+ ls->klass = NULL;
+ EOLIAN_OBJECT_ADD(ls->unit, cl->base.name, cl, classes);
+ eina_hash_set(ls->state->staging.classes_f, cl->base.file, cl);
+ eo_lexer_node_release(ls, &cl->base);
done:
ret = ls->unit;
- eina_hash_set(ls->state->parsed, filename, eot ? (void *)EINA_TRUE : cl);
- eina_hash_set(ls->state->parsing, filename, (void *)EINA_FALSE);
- eina_hash_add(parent->children, filename, ret);
+ eina_hash_add(parent->children, fname, ret);
+ eina_stringshare_del(fname);
eo_lexer_free(ls);
return ret;
error:
- eina_hash_set(ls->state->parsing, filename, (void *)EINA_FALSE);
+ eina_stringshare_del(fname);
eo_lexer_free(ls);
+ switch (status)
+ {
+ case EO_LEXER_ERROR_OOM:
+ eolian_state_panic(parent->state, "out of memory");
+ break;
+ default:
+ break;
+ }
return NULL;
}
diff --git a/src/lib/eolian/eo_parser.h b/src/lib/eolian/eo_parser.h
index f7422e4704..52029138fc 100644
--- a/src/lib/eolian/eo_parser.h
+++ b/src/lib/eolian/eo_parser.h
@@ -3,6 +3,6 @@
#include "eo_lexer.h"
-Eolian_Unit *eo_parser_database_fill(Eolian_Unit *parent, const char *filename, Eina_Bool eot, Eolian_Class **cl);
+Eolian_Unit *eo_parser_database_fill(Eolian_Unit *parent, const char *filename, Eina_Bool eot);
#endif /* __EO_PARSER_H__ */ \ No newline at end of file
diff --git a/src/lib/eolian/eolian_database.c b/src/lib/eolian/eolian_database.c
index 8b82503e7e..ddb14e3a0f 100644
--- a/src/lib/eolian/eolian_database.c
+++ b/src/lib/eolian/eolian_database.c
@@ -9,85 +9,114 @@
#include "eolian_priv.h"
void
-database_decl_add(Eolian *state, Eina_Stringshare *name,
- Eolian_Declaration_Type type,
- Eina_Stringshare *file, void *ptr)
+database_object_add(Eolian_Unit *unit, const Eolian_Object *obj)
{
- Eolian_Declaration *decl = calloc(1, sizeof(Eolian_Declaration));
- decl->type = type;
- decl->name = name;
- decl->data = ptr;
- eina_hash_set(state->unit.decls, name, decl);
- eina_hash_set(state->decls_f, file, eina_list_append
- ((Eina_List*)eina_hash_find(state->decls_f, file), decl));
+ /* object storage */
+ eina_hash_add(unit->objects, obj->name, obj);
+ eina_hash_add(unit->state->staging.unit.objects, obj->name, obj);
+ eina_hash_set(unit->state->staging.objects_f, obj->file, eina_list_append
+ ((Eina_List *)eina_hash_find(unit->state->staging.objects_f, obj->file), obj));
}
-EAPI const Eolian_Declaration *
-eolian_declaration_get_by_name(const Eolian_Unit *unit, const char *name)
+EAPI Eolian_Object_Type
+eolian_object_type_get(const Eolian_Object *obj)
{
- if (!unit) return NULL;
- Eina_Stringshare *shr = eina_stringshare_add(name);
- const Eolian_Declaration *decl = eina_hash_find(unit->state->unit.decls, shr);
- eina_stringshare_del(shr);
- return decl;
+ if (!obj) return EOLIAN_OBJECT_UNKNOWN;
+ return obj->type;
}
-EAPI Eina_Iterator *
-eolian_declarations_get_by_file(const Eolian *state, const char *fname)
+EAPI const Eolian_Unit *
+eolian_object_unit_get(const Eolian_Object *obj)
{
- if (!state) return NULL;
- Eina_Stringshare *shr = eina_stringshare_add(fname);
- Eina_List *l = eina_hash_find(state->decls_f, shr);
- eina_stringshare_del(shr);
- if (!l) return NULL;
- return eina_list_iterator_new(l);
+ if (!obj) return NULL;
+ return obj->unit;
}
-EAPI Eina_Iterator *
-eolian_all_declarations_get(const Eolian_Unit *unit)
+EAPI const char *
+eolian_object_file_get(const Eolian_Object *obj)
{
- return (unit ? eina_hash_iterator_data_new(unit->state->unit.decls) : NULL);
+ if (!obj) return NULL;
+ return obj->file;
}
-EAPI Eolian_Declaration_Type
-eolian_declaration_type_get(const Eolian_Declaration *decl)
+EAPI int
+eolian_object_line_get(const Eolian_Object *obj)
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(decl, EOLIAN_DECL_UNKNOWN);
- return decl->type;
+ if (!obj) return 0;
+ return obj->line;
}
-EAPI Eina_Stringshare *
-eolian_declaration_name_get(const Eolian_Declaration *decl)
+EAPI int
+eolian_object_column_get(const Eolian_Object *obj)
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(decl, NULL);
- return decl->name;
+ if (!obj) return 0;
+ return obj->column;
}
-EAPI const Eolian_Class *
-eolian_declaration_class_get(const Eolian_Declaration *decl)
+EAPI const char *
+eolian_object_name_get(const Eolian_Object *obj)
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(decl, NULL);
- EINA_SAFETY_ON_FALSE_RETURN_VAL(decl->type == EOLIAN_DECL_CLASS, NULL);
- return (const Eolian_Class *)decl->data;
+ if (!obj) return NULL;
+ return obj->name;
}
-EAPI const Eolian_Typedecl *
-eolian_declaration_data_type_get(const Eolian_Declaration *decl)
+typedef struct _Eolian_Namespace_List
+{
+ Eina_Iterator itr;
+ char *curp;
+} Eolian_Namespace_List;
+
+static Eina_Bool
+_nmsp_iterator_next(Eolian_Namespace_List *it, void **data)
+{
+ if (!it || !it->curp)
+ return EINA_FALSE;
+
+ char *ndot = strchr(it->curp, '.');
+ if (!ndot)
+ return EINA_FALSE;
+
+ *ndot = '\0';
+ if (data) *data = it->curp;
+ it->curp = ndot + 1;
+ return EINA_TRUE;
+}
+
+static void *
+_nmsp_container_get(Eina_Iterator *it EINA_UNUSED)
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(decl, NULL);
- EINA_SAFETY_ON_FALSE_RETURN_VAL(decl->type == EOLIAN_DECL_ALIAS ||
- decl->type == EOLIAN_DECL_STRUCT ||
- decl->type == EOLIAN_DECL_ENUM, NULL);
- return (const Eolian_Typedecl *)decl->data;
+ return NULL;
}
+EAPI const char *
+eolian_object_short_name_get(const Eolian_Object *obj)
+{
+ if (!obj || !obj->name) return NULL;
+ const char *ldot = strrchr(obj->name, '.');
+ if (ldot)
+ return ldot + 1;
+ return obj->name;
+}
-EAPI const Eolian_Variable *
-eolian_declaration_variable_get(const Eolian_Declaration *decl)
+EAPI Eina_Iterator *
+eolian_object_namespaces_get(const Eolian_Object *obj)
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(decl, NULL);
- EINA_SAFETY_ON_FALSE_RETURN_VAL(decl->type == EOLIAN_DECL_VAR, NULL);
- return (const Eolian_Variable *)decl->data;
+ if (!obj || !obj->name || !strchr(obj->name, '.')) return NULL;
+
+ size_t nstrl = strlen(obj->name) + 1;
+ size_t anstrl = nstrl - 1 - (nstrl - 1) % sizeof(void *) + sizeof(void *);
+
+ Eolian_Namespace_List *it = malloc(sizeof(Eolian_Namespace_List) + anstrl);
+ memset(&it->itr, 0, sizeof(Eina_Iterator));
+ it->curp = (char *)(it + 1);
+ memcpy(it->curp, obj->name, nstrl);
+
+ EINA_MAGIC_SET(&it->itr, EINA_MAGIC_ITERATOR);
+ it->itr.version = EINA_ITERATOR_VERSION;
+ it->itr.next = FUNC_ITERATOR_NEXT(_nmsp_iterator_next);
+ it->itr.get_container = _nmsp_container_get;
+ it->itr.free = FUNC_ITERATOR_FREE(free);
+ return &it->itr;
}
void database_doc_del(Eolian_Documentation *doc)
@@ -96,6 +125,7 @@ void database_doc_del(Eolian_Documentation *doc)
eina_stringshare_del(doc->summary);
eina_stringshare_del(doc->description);
eina_stringshare_del(doc->since);
+ eina_list_free(doc->ref_dbg);
free(doc);
}
@@ -361,38 +391,41 @@ eolian_doc_token_text_get(const Eolian_Doc_Token *tok)
return ptr;
}
-static Eolian_Doc_Ref_Type
-_resolve_event(const Eolian_Unit *src, char *name, const void **data,
- const void **data2)
+static Eolian_Object_Type
+_resolve_event(char *name, const Eolian_Unit *unit1, const Eolian_Unit *unit2,
+ const Eolian_Object **data1, const Eolian_Object **data2)
{
/* never trust the user */
if (name[0] == ',')
- return EOLIAN_DOC_REF_INVALID;
+ return EOLIAN_OBJECT_UNKNOWN;
char *evname = strrchr(name, '.');
if (!evname)
- return EOLIAN_DOC_REF_INVALID;
+ return EOLIAN_OBJECT_UNKNOWN;
*evname++ = '\0';
- const Eolian_Class *cl = eolian_class_get_by_name(src, name);
+ const Eolian_Class *cl = eolian_unit_class_by_name_get(unit1, name);
+ if (!cl && unit2)
+ cl = eolian_unit_class_by_name_get(unit2, name);
if (!cl)
- return EOLIAN_DOC_REF_INVALID;
+ return EOLIAN_OBJECT_UNKNOWN;
- const Eolian_Event *ev = eolian_class_event_get_by_name(cl, evname);
+ const Eolian_Event *ev = eolian_class_event_by_name_get(cl, evname);
if (!ev)
- return EOLIAN_DOC_REF_INVALID;
+ return EOLIAN_OBJECT_UNKNOWN;
- if (data) *data = cl;
- if (data2) *data2 = ev;
- return EOLIAN_DOC_REF_EVENT;
+ if (data1) *data1 = &cl->base;
+ if (data2) *data2 = &ev->base;
+ return EOLIAN_OBJECT_EVENT;
}
-EAPI Eolian_Doc_Ref_Type
-eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok,
- const void **data, const void **data2)
+Eolian_Object_Type
+database_doc_token_ref_resolve(const Eolian_Doc_Token *tok,
+ const Eolian_Unit *unit1, const Eolian_Unit *unit2,
+ const Eolian_Object **data1, const Eolian_Object **data2)
{
if (tok->type != EOLIAN_DOC_TOKEN_REF)
- return EOLIAN_DOC_REF_INVALID;
+ return EOLIAN_OBJECT_UNKNOWN;
size_t nlen = tok->text_end - tok->text;
@@ -404,34 +437,30 @@ eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok,
char *ename = alloca(elen + 1);
memcpy(ename, tok->text + 1, elen);
ename[elen] = '\0';
- return _resolve_event(unit, ename, data, data2);
+ return _resolve_event(ename, unit1, unit2, data1, data2);
}
char *name = alloca(nlen + 1);
memcpy(name, tok->text, nlen);
name[nlen] = '\0';
- const Eolian_Declaration *decl = eolian_declaration_get_by_name(unit, name);
- if (decl) switch (eolian_declaration_type_get(decl))
+ const Eolian_Object *decl = eolian_unit_object_by_name_get(unit1, name);
+ if (!decl && unit2)
+ decl = eolian_unit_object_by_name_get(unit2, name);
+ if (decl)
{
- case EOLIAN_DECL_CLASS:
- if (data) *data = eolian_declaration_class_get(decl);
- return EOLIAN_DOC_REF_CLASS;
- case EOLIAN_DECL_ALIAS:
- if (data) *data = eolian_declaration_data_type_get(decl);
- return EOLIAN_DOC_REF_ALIAS;
- case EOLIAN_DECL_STRUCT:
- if (data) *data = eolian_declaration_data_type_get(decl);
- return EOLIAN_DOC_REF_STRUCT;
- case EOLIAN_DECL_ENUM:
- if (data) *data = eolian_declaration_data_type_get(decl);
- return EOLIAN_DOC_REF_ENUM;
- case EOLIAN_DECL_VAR:
- if (data) *data = eolian_declaration_variable_get(decl);
- return EOLIAN_DOC_REF_VAR;
- default:
- /* this will not happen but silence static analyzers */
- return EOLIAN_DOC_REF_INVALID;
+ if (data1) *data1 = decl;
+ Eolian_Object_Type tp = eolian_object_type_get(decl);
+ switch (tp)
+ {
+ case EOLIAN_OBJECT_CLASS:
+ case EOLIAN_OBJECT_TYPEDECL:
+ case EOLIAN_OBJECT_VARIABLE:
+ /* we only allow certain types to be referenced */
+ return tp;
+ default:
+ return EOLIAN_OBJECT_UNKNOWN;
+ }
}
/* from here it can only be a function, a struct field or an enum field */
@@ -439,35 +468,39 @@ eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok,
char *suffix = strrchr(name, '.');
/* no suffix, therefore invalid */
if (!suffix)
- return EOLIAN_DOC_REF_INVALID;
+ return EOLIAN_OBJECT_UNKNOWN;
/* name will terminate before suffix, suffix will be standalone */
*suffix++ = '\0';
/* try a struct field */
- const Eolian_Typedecl *tpd = eolian_typedecl_struct_get_by_name(unit, name);
+ const Eolian_Typedecl *tpd = eolian_unit_struct_by_name_get(unit1, name);
+ if (!tpd && unit2)
+ tpd = eolian_unit_struct_by_name_get(unit2, name);
if (tpd)
{
const Eolian_Struct_Type_Field *fld = eolian_typedecl_struct_field_get(tpd, suffix);
/* field itself is invalid */
if (!fld)
- return EOLIAN_DOC_REF_INVALID;
- if (data) *data = tpd;
- if (data2) *data2 = fld;
- return EOLIAN_DOC_REF_STRUCT_FIELD;
+ return EOLIAN_OBJECT_UNKNOWN;
+ if (data1) *data1 = &tpd->base;
+ if (data2) *data2 = &fld->base;
+ return EOLIAN_OBJECT_STRUCT_FIELD;
}
/* try an enum field */
- tpd = eolian_typedecl_enum_get_by_name(unit, name);
+ tpd = eolian_unit_enum_by_name_get(unit1, name);
+ if (!tpd && unit2)
+ tpd = eolian_unit_enum_by_name_get(unit2, name);
if (tpd)
{
const Eolian_Enum_Type_Field *fld = eolian_typedecl_enum_field_get(tpd, suffix);
/* field itself is invalid */
if (!fld)
- return EOLIAN_DOC_REF_INVALID;
- if (data) *data = tpd;
- if (data2) *data2 = fld;
- return EOLIAN_DOC_REF_ENUM_FIELD;
+ return EOLIAN_OBJECT_UNKNOWN;
+ if (data1) *data1 = &tpd->base;
+ if (data2) *data2 = &fld->base;
+ return EOLIAN_OBJECT_ENUM_FIELD;
}
/* now it can only be a function or invalid */
@@ -483,28 +516,38 @@ eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok,
suffix = strrchr(name, '.');
/* wrong suffix, therefore invalid */
if (!suffix)
- return EOLIAN_DOC_REF_INVALID;
+ return EOLIAN_OBJECT_UNKNOWN;
/* re-terminate */
*suffix++ = '\0';
}
- const Eolian_Class *cl = eolian_class_get_by_name(unit, name);
+ const Eolian_Class *cl = eolian_unit_class_by_name_get(unit1, name);
+ if (!cl && unit2)
+ cl = eolian_unit_class_by_name_get(unit2, name);
if (!cl)
- return EOLIAN_DOC_REF_INVALID;
+ return EOLIAN_OBJECT_UNKNOWN;
- const Eolian_Function *fid = eolian_class_function_get_by_name(cl, suffix, ftype);
+ const Eolian_Function *fid = eolian_class_function_by_name_get(cl, suffix, ftype);
if (!fid)
- return EOLIAN_DOC_REF_INVALID;
+ return EOLIAN_OBJECT_UNKNOWN;
/* got a func */
- if (data) *data = cl;
- if (data2) *data2 = fid;
- return EOLIAN_DOC_REF_FUNC;
+ if (data1) *data1 = &cl->base;
+ if (data2) *data2 = &fid->base;
+ return EOLIAN_OBJECT_FUNCTION;
+}
+
+EAPI Eolian_Object_Type
+eolian_doc_token_ref_resolve(const Eolian_Doc_Token *tok, const Eolian_State *state,
+ const Eolian_Object **data, const Eolian_Object **data2)
+{
+ return database_doc_token_ref_resolve(tok, (const Eolian_Unit *)state, NULL, data, data2);
}
void
-database_unit_init(Eolian *state, Eolian_Unit *unit)
+database_unit_init(Eolian_State *state, Eolian_Unit *unit, const char *file)
{
+ unit->file = eina_stringshare_ref(file);
unit->state = state;
unit->children = eina_hash_stringshared_new(NULL);
@@ -514,85 +557,181 @@ database_unit_init(Eolian *state, Eolian_Unit *unit)
unit->aliases = eina_hash_stringshared_new(EINA_FREE_CB(database_typedecl_del));
unit->structs = eina_hash_stringshared_new(EINA_FREE_CB(database_typedecl_del));
unit->enums = eina_hash_stringshared_new(EINA_FREE_CB(database_typedecl_del));
- unit->decls = eina_hash_stringshared_new(free);
+ unit->objects = eina_hash_stringshared_new(NULL);
}
-void
-database_unit_del(Eolian_Unit *unit)
+static void
+_unit_contents_del(Eolian_Unit *unit)
{
- if (!unit)
- return;
-
+ eina_stringshare_del(unit->file);
+ eina_hash_free(unit->children);
eina_hash_free(unit->classes);
eina_hash_free(unit->globals);
eina_hash_free(unit->constants);
eina_hash_free(unit->aliases);
eina_hash_free(unit->structs);
eina_hash_free(unit->enums);
- eina_hash_free(unit->decls);
+ eina_hash_free(unit->objects);
+}
+
+void
+database_unit_del(Eolian_Unit *unit)
+{
+ if (!unit)
+ return;
+
+ _unit_contents_del(unit);
+ free(unit);
+}
+
+static Eina_Bool
+_hashlist_free_cb(const Eina_Hash *hash EINA_UNUSED,
+ const void *key EINA_UNUSED,
+ void *data, void *fdata EINA_UNUSED)
+{
+ eina_list_free((Eina_List *)data);
+ return EINA_TRUE;
+}
+
+static void
+_hashlist_free(Eina_Hash *h)
+{
+ eina_hash_foreach(h, _hashlist_free_cb, NULL);
+ eina_hash_free(h);
}
static void
-_hashlist_free(void *data)
+_hashlist_free_buckets(Eina_Hash *h)
{
- eina_list_free((Eina_List*)data);
+ eina_hash_foreach(h, _hashlist_free_cb, NULL);
+ eina_hash_free_buckets(h);
}
-EAPI Eolian *
-eolian_new(void)
+static void
+_state_area_init(Eolian_State *state, Eolian_State_Area *a)
{
- Eolian *state = calloc(1, sizeof(Eolian));
+ database_unit_init(state, &a->unit, NULL);
+
+ a->units = eina_hash_stringshared_new(NULL);
+
+ a->classes_f = eina_hash_stringshared_new(NULL);
+ a->aliases_f = eina_hash_stringshared_new(NULL);
+ a->structs_f = eina_hash_stringshared_new(NULL);
+ a->enums_f = eina_hash_stringshared_new(NULL);
+ a->globals_f = eina_hash_stringshared_new(NULL);
+ a->constants_f = eina_hash_stringshared_new(NULL);
+ a->objects_f = eina_hash_stringshared_new(NULL);
+}
+
+static Eina_Bool
+_ulist_free_cb(const Eina_Hash *hash EINA_UNUSED,
+ const void *key EINA_UNUSED,
+ void *data, void *fdata EINA_UNUSED)
+{
+ database_unit_del((Eolian_Unit *)data);
+ return EINA_TRUE;
+}
+
+static void
+_state_area_contents_del(Eolian_State_Area *a)
+{
+ _unit_contents_del(&a->unit);
+
+ eina_hash_foreach(a->units, _ulist_free_cb, NULL);
+ eina_hash_free(a->units);
+
+ eina_hash_free(a->classes_f);
+ _hashlist_free(a->aliases_f);
+ _hashlist_free(a->structs_f);
+ _hashlist_free(a->enums_f);
+ _hashlist_free(a->globals_f);
+ _hashlist_free(a->constants_f);
+ _hashlist_free(a->objects_f);
+}
+
+static void
+_default_panic_cb(const Eolian_State *state EINA_UNUSED, const char *msg)
+{
+ _eolian_log(msg);
+}
+
+static void
+_default_error_cb(const Eolian_Object *obj, const char *msg, void *data EINA_UNUSED)
+{
+ if (obj)
+ _eolian_log_line(obj->file, obj->line, obj->column, msg);
+ else
+ _eolian_log(msg);
+}
+
+EAPI Eolian_State *
+eolian_state_new(void)
+{
+ Eolian_State *state = calloc(1, sizeof(Eolian_State));
if (!state)
return NULL;
- database_unit_init(state, &state->unit);
+ state->panic = _default_panic_cb;
- state->filenames_eo = eina_hash_string_small_new(free);
- state->filenames_eot = eina_hash_string_small_new(free);
+ if (setjmp(state->jmp_env))
+ {
+ state->panic(state, state->panic_msg);
+ eina_stringshare_del(state->panic_msg);
+ exit(EXIT_FAILURE);
+ }
- state->parsed = eina_hash_string_small_new(NULL);
- state->parsing = eina_hash_string_small_new(NULL);
- state->defer = eina_hash_string_small_new(NULL);
+ state->error = _default_error_cb;
- state->units = eina_hash_stringshared_new(EINA_FREE_CB(database_unit_del));
+ _state_area_init(state, &state->main);
+ _state_area_init(state, &state->staging);
+
+ state->filenames_eo = eina_hash_string_small_new(free);
+ state->filenames_eot = eina_hash_string_small_new(free);
- state->classes_f = eina_hash_stringshared_new(NULL);
- state->aliases_f = eina_hash_stringshared_new(_hashlist_free);
- state->structs_f = eina_hash_stringshared_new(_hashlist_free);
- state->enums_f = eina_hash_stringshared_new(_hashlist_free);
- state->globals_f = eina_hash_stringshared_new(_hashlist_free);
- state->constants_f = eina_hash_stringshared_new(_hashlist_free);
- state->decls_f = eina_hash_stringshared_new(_hashlist_free);
+ state->defer = eina_hash_string_small_new(NULL);
return state;
}
EAPI void
-eolian_free(Eolian *state)
+eolian_state_free(Eolian_State *state)
{
if (!state)
return;
- database_unit_del(&state->unit);
+ _state_area_contents_del(&state->main);
+ _state_area_contents_del(&state->staging);
eina_hash_free(state->filenames_eo);
eina_hash_free(state->filenames_eot);
- eina_hash_free(state->parsed);
- eina_hash_free(state->parsing);
eina_hash_free(state->defer);
- eina_hash_free(state->units);
+ free(state);
+}
- eina_hash_free(state->classes_f);
- eina_hash_free(state->aliases_f);
- eina_hash_free(state->structs_f);
- eina_hash_free(state->enums_f);
- eina_hash_free(state->globals_f);
- eina_hash_free(state->constants_f);
- eina_hash_free(state->decls_f);
+EAPI Eolian_Panic_Cb
+eolian_state_panic_cb_set(Eolian_State *state, Eolian_Panic_Cb cb)
+{
+ Eolian_Panic_Cb old_cb = state->panic;
+ state->panic = cb ? cb : _default_panic_cb;
+ return old_cb;
+}
- free(state);
+EAPI Eolian_Error_Cb
+eolian_state_error_cb_set(Eolian_State *state, Eolian_Error_Cb cb)
+{
+ Eolian_Error_Cb old_cb = state->error;
+ state->error = cb ? cb : _default_error_cb;
+ return old_cb;
+}
+
+EAPI void *
+eolian_state_error_data_set(Eolian_State *state, void *data)
+{
+ void *old_data = state->error_data;
+ state->error_data = data;
+ return old_data;
}
#define EO_SUFFIX ".eo"
@@ -616,7 +755,7 @@ join_path(const char *path, const char *file)
static void
_scan_cb(const char *name, const char *path, void *data EINA_UNUSED)
{
- Eolian *state = data;
+ Eolian_State *state = data;
Eina_Bool is_eo = eina_str_has_suffix(name, EO_SUFFIX);
if (!is_eo && !eina_str_has_suffix(name, EOT_SUFFIX)) return;
eina_hash_add(is_eo ? state->filenames_eo : state->filenames_eot,
@@ -624,7 +763,7 @@ _scan_cb(const char *name, const char *path, void *data EINA_UNUSED)
}
EAPI Eina_Bool
-eolian_directory_scan(Eolian *state, const char *dir)
+eolian_state_directory_add(Eolian_State *state, const char *dir)
{
if (!dir || !state) return EINA_FALSE;
eina_file_dir_list(dir, EINA_TRUE, _scan_cb, state);
@@ -632,32 +771,43 @@ eolian_directory_scan(Eolian *state, const char *dir)
}
EAPI Eina_Bool
-eolian_system_directory_scan(Eolian *state)
+eolian_state_system_directory_add(Eolian_State *state)
{
Eina_Bool ret;
Eina_Strbuf *buf = eina_strbuf_new();
eina_strbuf_append(buf, eina_prefix_data_get(_eolian_prefix));
eina_strbuf_append(buf, "/include");
- ret = eolian_directory_scan(state, eina_strbuf_string_get(buf));
+ ret = eolian_state_directory_add(state, eina_strbuf_string_get(buf));
eina_strbuf_free(buf);
return ret;
}
-char *
-database_class_to_filename(const char *cname)
+EAPI Eina_Iterator *
+eolian_state_eot_files_get(const Eolian_State *state)
{
- char *ret;
- Eina_Strbuf *strbuf = eina_strbuf_new();
- eina_strbuf_append(strbuf, cname);
- eina_strbuf_replace_all(strbuf, ".", "_");
- eina_strbuf_append(strbuf, ".eo");
+ if (!state) return NULL;
+ return eina_hash_iterator_key_new(state->filenames_eot);
+}
- ret = eina_strbuf_string_steal(strbuf);
- eina_strbuf_free(strbuf);
+EAPI Eina_Iterator *
+eolian_state_eo_files_get(const Eolian_State *state)
+{
+ if (!state) return NULL;
+ return eina_hash_iterator_key_new(state->filenames_eo);
+}
- eina_str_tolower(&ret);
+EAPI Eina_Iterator *
+eolian_state_eot_file_paths_get(const Eolian_State *state)
+{
+ if (!state) return NULL;
+ return eina_hash_iterator_data_new(state->filenames_eot);
+}
- return ret;
+EAPI Eina_Iterator *
+eolian_state_eo_file_paths_get(const Eolian_State *state)
+{
+ if (!state) return NULL;
+ return eina_hash_iterator_data_new(state->filenames_eo);
}
static Eolian_Unit *
@@ -669,65 +819,228 @@ _eolian_file_parse_nodep(Eolian_Unit *parent, const char *filepath)
is_eo = eina_str_has_suffix(filepath, EO_SUFFIX);
if (!is_eo && !eina_str_has_suffix(filepath, EOT_SUFFIX))
{
- _eolian_log("file '%s' doesn't have a correct extension", filepath);
+ eolian_state_log(parent->state,
+ "file '%s' doesn't have a correct extension",
+ filepath);
return NULL;
}
if (!(eopath = eina_hash_find(is_eo ? parent->state->filenames_eo : parent->state->filenames_eot, filepath)))
{
char *vpath = eina_file_path_sanitize(filepath);
- Eolian_Unit *ret = eo_parser_database_fill(parent, vpath, !is_eo, NULL);
+ Eolian_Unit *ret = eo_parser_database_fill(parent, vpath, !is_eo);
free(vpath);
return ret;
}
- return eo_parser_database_fill(parent, eopath, !is_eo, NULL);
+ return eo_parser_database_fill(parent, eopath, !is_eo);
+}
+
+static void
+_state_clean(Eolian_State *state)
+{
+ eina_hash_free_buckets(state->defer);
+
+ Eolian_State_Area *st = &state->staging;
+
+ Eolian_Unit *stu = &st->unit;
+ eina_hash_free_buckets(stu->classes);
+ eina_hash_free_buckets(stu->globals);
+ eina_hash_free_buckets(stu->constants);
+ eina_hash_free_buckets(stu->aliases);
+ eina_hash_free_buckets(stu->structs);
+ eina_hash_free_buckets(stu->enums);
+ eina_hash_free_buckets(stu->objects);
+
+ eina_hash_foreach(st->units, _ulist_free_cb, NULL);
+ eina_hash_free_buckets(st->units);
+
+ eina_hash_free_buckets(st->classes_f);
+
+ _hashlist_free_buckets(st->aliases_f);
+ _hashlist_free_buckets(st->structs_f);
+ _hashlist_free_buckets(st->enums_f);
+ _hashlist_free_buckets(st->globals_f);
+ _hashlist_free_buckets(st->constants_f);
+ _hashlist_free_buckets(st->objects_f);
+}
+
+void
+database_defer(Eolian_State *state, const char *fname, Eina_Bool isdep)
+{
+ void *nval = (void *)((size_t)isdep + 1);
+ size_t found = (size_t)eina_hash_find(state->defer, fname);
+ /* add if not found or upgrade to dep if requested */
+ if (!found)
+ eina_hash_add(state->defer, fname, nval);
+ else if ((found <= 1) && isdep)
+ eina_hash_set(state->defer, fname, nval);
+}
+
+static Eina_Bool _parse_deferred(Eolian_Unit *parent);
+static void _merge_units(Eolian_Unit *unit);
+
+typedef struct _Defer_Data
+{
+ Eolian_Unit *parent;
+ Eina_Bool succ;
+} Defer_Data;
+
+static Eina_Bool
+_defer_hash_cb(const Eina_Hash *hash EINA_UNUSED, const void *key,
+ void *data, void *fdata)
+{
+ Defer_Data *d = fdata;
+ Eina_Bool alone = ((size_t)data <= 1);
+ Eolian_Unit *parent = d->parent;
+ /* not a dependency; parse standalone */
+ if (alone)
+ parent = &parent->state->staging.unit;
+ Eolian_Unit *pdep = _eolian_file_parse_nodep(parent, key);
+ d->succ = (pdep && _parse_deferred(pdep));
+ /* standalone-parsed stuff forms its own dependency trees,
+ * so we have to merge the units manually and separately
+ */
+ if (d->succ && alone)
+ _merge_units(pdep);
+ return d->succ;
}
static Eina_Bool
_parse_deferred(Eolian_Unit *parent)
{
Eina_Hash *defer = parent->state->defer;
- if (!defer || !eina_hash_population(defer))
+ if (!eina_hash_population(defer))
return EINA_TRUE;
/* clean room for more deps for later parsing */
parent->state->defer = eina_hash_string_small_new(NULL);
- Eina_Iterator *itr = eina_hash_iterator_data_new(defer);
- const char *dep;
- EINA_ITERATOR_FOREACH(itr, dep)
+ Defer_Data d = { parent, EINA_FALSE };
+ eina_hash_foreach(defer, _defer_hash_cb, &d);
+ if (!d.succ)
+ eina_hash_free_buckets(parent->state->defer);
+ eina_hash_free(defer);
+ return d.succ;
+}
+
+static Eina_Bool
+_merge_unit_cb(const Eina_Hash *hash EINA_UNUSED,
+ const void *key, void *data, void *fdata)
+{
+ Eina_Hash *dest = fdata;
+ if (!eina_hash_find(dest, key))
{
- Eolian_Unit *pdep = _eolian_file_parse_nodep(parent, dep);
- if (!pdep || !_parse_deferred(pdep))
- {
- eina_iterator_free(itr);
- eina_hash_free_buckets(parent->state->defer);
- eina_hash_free(defer);
- return EINA_FALSE;
- }
+ eina_hash_add(dest, key, data);
+ eolian_object_ref((Eolian_Object *)data);
}
- eina_iterator_free(itr);
- eina_hash_free(defer);
return EINA_TRUE;
}
+static Eina_Bool
+_merge_unit_cb_noref(const Eina_Hash *hash EINA_UNUSED,
+ const void *key, void *data, void *fdata)
+{
+ Eina_Hash *dest = fdata;
+ if (!eina_hash_find(dest, key))
+ eina_hash_add(dest, key, data);
+ return EINA_TRUE;
+}
+
+static void
+_merge_unit(Eolian_Unit *dest, Eolian_Unit *src)
+{
+ eina_hash_foreach(src->classes, _merge_unit_cb, dest->classes);
+ eina_hash_foreach(src->globals, _merge_unit_cb, dest->globals);
+ eina_hash_foreach(src->constants, _merge_unit_cb, dest->constants);
+ eina_hash_foreach(src->aliases, _merge_unit_cb, dest->aliases);
+ eina_hash_foreach(src->structs, _merge_unit_cb, dest->structs);
+ eina_hash_foreach(src->enums, _merge_unit_cb, dest->enums);
+ eina_hash_foreach(src->objects, _merge_unit_cb_noref, dest->objects);
+}
+
+typedef struct _Merge_Data
+{
+ Eina_Hash *cycles;
+ Eolian_Unit *unit;
+} Merge_Data;
+
+static Eina_Bool
+_merge_units_cb(const Eina_Hash *hash EINA_UNUSED,
+ const void *key EINA_UNUSED, void *data, void *fdata)
+{
+ Merge_Data *mdata = fdata;
+ Merge_Data imdata = { mdata->cycles, data };
+ if (!eina_hash_find(imdata.cycles, &imdata.unit))
+ {
+ eina_hash_add(imdata.cycles, &imdata.unit, imdata.unit);
+ eina_hash_foreach(imdata.unit->children, _merge_units_cb, &imdata);
+ }
+ _merge_unit(mdata->unit, imdata.unit);
+ return EINA_TRUE;
+}
+
+
+static void
+_merge_units(Eolian_Unit *unit)
+{
+ Merge_Data mdata = { eina_hash_pointer_new(NULL), unit };
+ eina_hash_foreach(unit->children, _merge_units_cb, &mdata);
+ eina_hash_free(mdata.cycles);
+}
+
+static Eina_Bool
+_merge_staging_cb(const Eina_Hash *hash EINA_UNUSED,
+ const void *key, void *data, void *fdata)
+{
+ eina_hash_add((Eina_Hash *)fdata, key, data);
+ return EINA_TRUE;
+}
+
+static void
+_merge_staging(Eolian_State *state)
+{
+ Eolian_State_Area *amain = &state->main, *staging = &state->staging;
+ _merge_unit(&amain->unit, &staging->unit);
+
+ eina_hash_foreach(staging->units, _merge_staging_cb, amain->units);
+ eina_hash_free_buckets(staging->units);
+
+#define EOLIAN_STAGING_MERGE_LIST(name) \
+ eina_hash_foreach(staging->name##_f, _merge_staging_cb, amain->name##_f); \
+ eina_hash_free_buckets(staging->name##_f);
+
+ EOLIAN_STAGING_MERGE_LIST(classes);
+ EOLIAN_STAGING_MERGE_LIST(aliases);
+ EOLIAN_STAGING_MERGE_LIST(structs);
+ EOLIAN_STAGING_MERGE_LIST(enums);
+ EOLIAN_STAGING_MERGE_LIST(globals);
+ EOLIAN_STAGING_MERGE_LIST(constants);
+ EOLIAN_STAGING_MERGE_LIST(objects);
+
+#undef EOLIAN_STAGING_MERGE_LIST
+
+ _state_clean(state);
+}
+
EAPI const Eolian_Unit *
-eolian_file_parse(Eolian *state, const char *filepath)
+eolian_state_file_parse(Eolian_State *state, const char *filepath)
{
if (!state)
return NULL;
- Eolian_Unit *ret = _eolian_file_parse_nodep((Eolian_Unit *)state, filepath);
+ _state_clean(state);
+ Eolian_Unit *ret = _eolian_file_parse_nodep(&state->staging.unit, filepath);
if (!ret)
return NULL;
if (!_parse_deferred(ret))
return NULL;
- /* FIXME: pass unit properly */
- if (!database_validate(state, &state->unit))
+ _merge_units(ret);
+ if (!database_validate(&state->staging.unit))
return NULL;
- return &state->unit;
+ _merge_staging(state);
+ return ret;
}
typedef struct _Parse_Data
{
- Eolian *state;
+ Eolian_State *state;
Eina_Bool ret;
} Parse_Data;
@@ -736,26 +1049,29 @@ static Eina_Bool _tfile_parse(const Eina_Hash *hash EINA_UNUSED, const void *key
Parse_Data *pd = fdata;
Eolian_Unit *unit = NULL;
if (pd->ret)
- unit = eo_parser_database_fill((Eolian_Unit *)pd->state, data, EINA_TRUE, NULL);
+ unit = eo_parser_database_fill(&pd->state->staging.unit, data, EINA_TRUE);
pd->ret = !!unit;
if (pd->ret) pd->ret = _parse_deferred(unit);
+ if (pd->ret) _merge_units(unit);
return pd->ret;
}
EAPI Eina_Bool
-eolian_all_eot_files_parse(Eolian *state)
+eolian_state_all_eot_files_parse(Eolian_State *state)
{
Parse_Data pd = { state, EINA_TRUE };
if (!state)
return EINA_FALSE;
+ _state_clean(state);
eina_hash_foreach(state->filenames_eot, _tfile_parse, &pd);
- /* FIXME: pass unit properly */
- if (pd.ret && !database_validate(state, &state->unit))
+ if (pd.ret && !database_validate(&state->staging.unit))
return EINA_FALSE;
+ _merge_staging(state);
+
return pd.ret;
}
@@ -764,53 +1080,279 @@ static Eina_Bool _file_parse(const Eina_Hash *hash EINA_UNUSED, const void *key
Parse_Data *pd = fdata;
Eolian_Unit *unit = NULL;
if (pd->ret)
- unit = eo_parser_database_fill((Eolian_Unit *)pd->state, data, EINA_FALSE, NULL);
+ unit = eo_parser_database_fill(&pd->state->staging.unit, data, EINA_FALSE);
pd->ret = !!unit;
if (pd->ret) pd->ret = _parse_deferred(unit);
+ if (pd->ret) _merge_units(unit);
return pd->ret;
}
EAPI Eina_Bool
-eolian_all_eo_files_parse(Eolian *state)
+eolian_state_all_eo_files_parse(Eolian_State *state)
{
Parse_Data pd = { state, EINA_TRUE };
if (!state)
return EINA_FALSE;
+ _state_clean(state);
eina_hash_foreach(state->filenames_eo, _file_parse, &pd);
- /* FIXME: pass unit properly */
- if (pd.ret && !database_validate(state, &state->unit))
+ if (pd.ret && !database_validate(&state->staging.unit))
return EINA_FALSE;
+ _merge_staging(state);
+
return pd.ret;
}
+EAPI Eina_Bool
+eolian_state_check(const Eolian_State *state)
+{
+ return database_check(state);
+}
+
+EAPI const Eolian_Unit *
+eolian_state_unit_by_file_get(const Eolian_State *state, const char *file_name)
+{
+ if (!state) return NULL;
+ Eina_Stringshare *shr = eina_stringshare_add(file_name);
+ Eolian_Unit *unit = eina_hash_find(state->main.units, shr);
+ eina_stringshare_del(shr);
+ return unit;
+}
+
EAPI Eina_Iterator *
-eolian_all_eot_files_get(const Eolian *state)
+eolian_state_units_get(const Eolian_State *state)
{
if (!state) return NULL;
- return eina_hash_iterator_key_new(state->filenames_eot);
+ return eina_hash_iterator_data_new(state->main.units);
}
EAPI Eina_Iterator *
-eolian_all_eo_files_get(const Eolian *state)
+eolian_state_objects_by_file_get(const Eolian_State *state, const char *file_name)
{
if (!state) return NULL;
- return eina_hash_iterator_key_new(state->filenames_eo);
+ Eina_Stringshare *shr = eina_stringshare_add(file_name);
+ Eina_List *l = eina_hash_find(state->main.objects_f, shr);
+ eina_stringshare_del(shr);
+ if (!l) return NULL;
+ return eina_list_iterator_new(l);
+}
+
+EAPI const Eolian_Class *
+eolian_state_class_by_file_get(const Eolian_State *state, const char *file_name)
+{
+ if (!state) return NULL;
+ Eina_Stringshare *shr = eina_stringshare_add(file_name);
+ Eolian_Class *cl = eina_hash_find(state->main.classes_f, shr);
+ eina_stringshare_del(shr);
+ return cl;
}
EAPI Eina_Iterator *
-eolian_all_eot_file_paths_get(const Eolian *state)
+eolian_state_globals_by_file_get(const Eolian_State *state, const char *file_name)
{
if (!state) return NULL;
- return eina_hash_iterator_data_new(state->filenames_eot);
+ Eina_Stringshare *shr = eina_stringshare_add(file_name);
+ Eina_List *l = eina_hash_find(state->main.globals_f, shr);
+ eina_stringshare_del(shr);
+ if (!l) return NULL;
+ return eina_list_iterator_new(l);
}
EAPI Eina_Iterator *
-eolian_all_eo_file_paths_get(const Eolian *state)
+eolian_state_constants_by_file_get(const Eolian_State *state, const char *file_name)
{
if (!state) return NULL;
- return eina_hash_iterator_data_new(state->filenames_eo);
+ Eina_Stringshare *shr = eina_stringshare_add(file_name);
+ Eina_List *l = eina_hash_find(state->main.constants_f, shr);
+ eina_stringshare_del(shr);
+ if (!l) return NULL;
+ return eina_list_iterator_new(l);
+}
+
+EAPI Eina_Iterator *
+eolian_state_aliases_by_file_get(const Eolian_State *state, const char *file_name)
+{
+ if (!state) return NULL;
+ Eina_Stringshare *shr = eina_stringshare_add(file_name);
+ Eina_List *l = eina_hash_find(state->main.aliases_f, shr);
+ eina_stringshare_del(shr);
+ if (!l) return NULL;
+ return eina_list_iterator_new(l);
+}
+
+EAPI Eina_Iterator *
+eolian_state_structs_by_file_get(const Eolian_State *state, const char *file_name)
+{
+ if (!state) return NULL;
+ Eina_Stringshare *shr = eina_stringshare_add(file_name);
+ Eina_List *l = eina_hash_find(state->main.structs_f, shr);
+ eina_stringshare_del(shr);
+ if (!l) return NULL;
+ return eina_list_iterator_new(l);
+}
+
+EAPI Eina_Iterator *
+eolian_state_enums_by_file_get(const Eolian_State *state, const char *file_name)
+{
+ if (!state) return NULL;
+ Eina_Stringshare *shr = eina_stringshare_add(file_name);
+ Eina_List *l = eina_hash_find(state->main.enums_f, shr);
+ eina_stringshare_del(shr);
+ if (!l) return NULL;
+ return eina_list_iterator_new(l);
+}
+
+EAPI const Eolian_State *
+eolian_unit_state_get(const Eolian_Unit *unit)
+{
+ if (!unit) return NULL;
+ return unit->state;
+}
+
+EAPI Eina_Iterator *
+eolian_unit_children_get(const Eolian_Unit *unit)
+{
+ if (!unit) return NULL;
+ return eina_hash_iterator_data_new(unit->children);
+}
+
+EAPI const char *
+eolian_unit_file_get(const Eolian_Unit *unit)
+{
+ if (!unit) return NULL;
+ return unit->file;
+}
+
+EAPI const Eolian_Object *
+eolian_unit_object_by_name_get(const Eolian_Unit *unit, const char *name)
+{
+ if (!unit) return NULL;
+ Eina_Stringshare *shr = eina_stringshare_add(name);
+ Eolian_Object *o = eina_hash_find(unit->objects, shr);
+ eina_stringshare_del(shr);
+ return o;
+}
+
+EAPI Eina_Iterator *eolian_unit_objects_get(const Eolian_Unit *unit)
+{
+ return (unit ? eina_hash_iterator_data_new(unit->objects) : NULL);
+}
+
+EAPI const Eolian_Class *
+eolian_unit_class_by_name_get(const Eolian_Unit *unit, const char *class_name)
+{
+ if (!unit) return NULL;
+ Eina_Stringshare *shr = eina_stringshare_add(class_name);
+ Eolian_Class *cl = eina_hash_find(unit->classes, shr);
+ eina_stringshare_del(shr);
+ return cl;
+}
+
+EAPI Eina_Iterator *
+eolian_unit_classes_get(const Eolian_Unit *unit)
+{
+ return (unit ? eina_hash_iterator_data_new(unit->classes) : NULL);
+}
+
+EAPI const Eolian_Variable *
+eolian_unit_global_by_name_get(const Eolian_Unit *unit, const char *name)
+{
+ if (!unit) return NULL;
+ Eina_Stringshare *shr = eina_stringshare_add(name);
+ Eolian_Variable *v = eina_hash_find(unit->globals, shr);
+ eina_stringshare_del(shr);
+ return v;
+}
+
+EAPI const Eolian_Variable *
+eolian_unit_constant_by_name_get(const Eolian_Unit *unit, const char *name)
+{
+ if (!unit) return NULL;
+ Eina_Stringshare *shr = eina_stringshare_add(name);
+ Eolian_Variable *v = eina_hash_find(unit->constants, shr);
+ eina_stringshare_del(shr);
+ return v;
+}
+
+EAPI Eina_Iterator *
+eolian_unit_constants_get(const Eolian_Unit *unit)
+{
+ return (unit ? eina_hash_iterator_data_new(unit->constants) : NULL);
+}
+
+EAPI Eina_Iterator *
+eolian_unit_globals_get(const Eolian_Unit *unit)
+{
+ return (unit ? eina_hash_iterator_data_new(unit->globals) : NULL);
+}
+
+EAPI const Eolian_Typedecl *
+eolian_unit_alias_by_name_get(const Eolian_Unit *unit, const char *name)
+{
+ if (!unit) return NULL;
+ Eina_Stringshare *shr = eina_stringshare_add(name);
+ Eolian_Typedecl *tp = eina_hash_find(unit->aliases, shr);
+ eina_stringshare_del(shr);
+ if (!tp) return NULL;
+ return tp;
+}
+
+EAPI const Eolian_Typedecl *
+eolian_unit_struct_by_name_get(const Eolian_Unit *unit, const char *name)
+{
+ if (!unit) return NULL;
+ Eina_Stringshare *shr = eina_stringshare_add(name);
+ Eolian_Typedecl *tp = eina_hash_find(unit->structs, shr);
+ eina_stringshare_del(shr);
+ if (!tp) return NULL;
+ return tp;
+}
+
+EAPI const Eolian_Typedecl *
+eolian_unit_enum_by_name_get(const Eolian_Unit *unit, const char *name)
+{
+ if (!unit) return NULL;
+ Eina_Stringshare *shr = eina_stringshare_add(name);
+ Eolian_Typedecl *tp = eina_hash_find(unit->enums, shr);
+ eina_stringshare_del(shr);
+ if (!tp) return NULL;
+ return tp;
+}
+
+EAPI Eina_Iterator *
+eolian_unit_aliases_get(const Eolian_Unit *unit)
+{
+ return (unit ? eina_hash_iterator_data_new(unit->aliases) : NULL);
+}
+
+EAPI Eina_Iterator *
+eolian_unit_structs_get(const Eolian_Unit *unit)
+{
+ return (unit ? eina_hash_iterator_data_new(unit->structs) : NULL);
+}
+
+EAPI Eina_Iterator *
+eolian_unit_enums_get(const Eolian_Unit *unit)
+{
+ return (unit ? eina_hash_iterator_data_new(unit->enums) : NULL);
+}
+
+char *
+database_class_to_filename(const char *cname)
+{
+ char *ret;
+ Eina_Strbuf *strbuf = eina_strbuf_new();
+ eina_strbuf_append(strbuf, cname);
+ eina_strbuf_replace_all(strbuf, ".", "_");
+ eina_strbuf_append(strbuf, ".eo");
+
+ ret = eina_strbuf_string_steal(strbuf);
+ eina_strbuf_free(strbuf);
+
+ eina_str_tolower(&ret);
+
+ return ret;
}
diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h
index f68093df3b..dfbad0c304 100644
--- a/src/lib/eolian/eolian_database.h
+++ b/src/lib/eolian/eolian_database.h
@@ -1,6 +1,8 @@
#ifndef __EOLIAN_DATABASE_H
#define __EOLIAN_DATABASE_H
+#include <setjmp.h>
+
#include <Eolian.h>
extern int _eolian_log_dom;
@@ -33,7 +35,8 @@ extern Eina_Prefix *_eolian_prefix;
struct _Eolian_Unit
{
- Eolian *state;
+ const char *file;
+ Eolian_State *state;
Eina_Hash *children;
Eina_Hash *classes;
Eina_Hash *globals;
@@ -41,20 +44,13 @@ struct _Eolian_Unit
Eina_Hash *aliases;
Eina_Hash *structs;
Eina_Hash *enums;
- Eina_Hash *decls;
+ Eina_Hash *objects;
};
-struct _Eolian
+typedef struct _Eolian_State_Area
{
Eolian_Unit unit;
- Eina_Hash *filenames_eo; /* filename to full path mapping */
- Eina_Hash *filenames_eot;
-
- Eina_Hash *parsing;
- Eina_Hash *parsed;
- Eina_Hash *defer;
-
Eina_Hash *units;
Eina_Hash *classes_f;
@@ -63,17 +59,38 @@ struct _Eolian
Eina_Hash *enums_f;
Eina_Hash *globals_f;
Eina_Hash *constants_f;
- Eina_Hash *decls_f;
+ Eina_Hash *objects_f;
+} Eolian_State_Area;
+
+struct _Eolian_State
+{
+ Eolian_State_Area main;
+ Eolian_State_Area staging;
+
+ Eolian_Panic_Cb panic;
+ Eina_Stringshare *panic_msg;
+ jmp_buf jmp_env;
+
+ Eolian_Error_Cb error;
+ void *error_data;
+
+ Eina_Hash *filenames_eo; /* filename to full path mapping */
+ Eina_Hash *filenames_eot;
+
+ Eina_Hash *defer;
};
-typedef struct _Eolian_Object
+struct _Eolian_Object
{
- const char *file;
+ Eolian_Unit *unit;
+ Eina_Stringshare *file;
+ Eina_Stringshare *name;
int line;
int column;
int refcount;
+ Eolian_Object_Type type;
Eina_Bool validated;
-} Eolian_Object;
+};
static inline void
eolian_object_ref(Eolian_Object *obj)
@@ -87,27 +104,76 @@ eolian_object_unref(Eolian_Object *obj)
return (--obj->refcount > 0);
}
+static inline void
+eolian_object_add(Eolian_Object *obj, Eina_Stringshare *name, Eina_Hash *hash)
+{
+ eina_hash_add(hash, name, obj);
+ eolian_object_ref(obj);
+}
+
+#define EOLIAN_OBJECT_ADD(tunit, name, obj, memb) \
+{ \
+ eolian_object_add(&obj->base, name, tunit->state->staging.unit.memb); \
+ eolian_object_add(&obj->base, name, tunit->memb); \
+}
+
+static inline void eolian_state_vlog(const Eolian_State *state, const Eolian_Object *obj, const char *fmt, va_list args) EINA_ARG_NONNULL(1, 3);
+static inline void eolian_state_log(const Eolian_State *state, const char *fmt, ...) EINA_ARG_NONNULL(1, 2) EINA_PRINTF(2, 3);
+static inline void eolian_state_log_obj(const Eolian_State *state, const Eolian_Object *obj, const char *fmt, ...) EINA_ARG_NONNULL(1, 2, 3) EINA_PRINTF(3, 4);
+
+static inline void eolian_state_panic(Eolian_State *state, const char *fmt, ...) EINA_ARG_NONNULL(1, 2) EINA_PRINTF(2, 3);
+
+static inline void
+eolian_state_vlog(const Eolian_State *state, const Eolian_Object *obj,
+ const char *fmt, va_list args)
+{
+ Eina_Strbuf *sb = eina_strbuf_new();
+ eina_strbuf_append_vprintf(sb, fmt, args);
+ state->error(obj, eina_strbuf_string_get(sb), state->error_data);
+ eina_strbuf_free(sb);
+}
+
+static inline void
+eolian_state_log(const Eolian_State *state, const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ eolian_state_vlog(state, NULL, fmt, args);
+ va_end(args);
+}
+
+static inline void
+eolian_state_log_obj(const Eolian_State *state, const Eolian_Object *obj,
+ const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ eolian_state_vlog(state, obj, fmt, args);
+ va_end(args);
+}
+
+static inline void
+eolian_state_panic(Eolian_State *state, const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ state->panic_msg = eina_stringshare_vprintf(fmt, args);
+ va_end(args);
+ longjmp(state->jmp_env, 1);
+}
+
struct _Eolian_Documentation
{
Eolian_Object base;
Eina_Stringshare *summary;
Eina_Stringshare *description;
Eina_Stringshare *since;
-};
-
-struct _Eolian_Declaration
-{
- Eolian_Declaration_Type type;
- Eina_Stringshare *name;
- void *data;
+ Eina_List *ref_dbg;
};
struct _Eolian_Class
{
Eolian_Object base;
- Eina_Stringshare *full_name;
- Eina_List *namespaces; /* List Eina_Stringshare * */
- Eina_Stringshare *name;
Eolian_Class_Type type;
Eolian_Documentation *doc;
Eina_Stringshare *legacy_prefix;
@@ -129,7 +195,6 @@ struct _Eolian_Function
{
Eolian_Object base;
Eolian_Object set_base;
- Eina_Stringshare *name;
union { /* lists of Eolian_Function_Parameter */
Eina_List *params;
struct {
@@ -167,15 +232,18 @@ struct _Eolian_Function
struct _Eolian_Part
{
Eolian_Object base;
- Eina_Stringshare *name;
- Eolian_Class *klass;
+ /* when not validated, class name is stored */
+ union
+ {
+ Eina_Stringshare *klass_name;
+ Eolian_Class *klass;
+ };
Eolian_Documentation *doc;
};
struct _Eolian_Function_Parameter
{
Eolian_Object base;
- Eina_Stringshare *name;
Eolian_Type *type;
Eolian_Expression *value;
Eolian_Documentation *doc;
@@ -192,10 +260,12 @@ struct _Eolian_Type
Eolian_Type_Builtin_Type btype;
Eolian_Type *base_type;
Eolian_Type *next_type;
- Eina_Stringshare *name;
- Eina_Stringshare *full_name;
- Eina_List *namespaces;
Eina_Stringshare *freefunc;
+ union
+ {
+ Eolian_Class *klass;
+ Eolian_Typedecl *tdecl;
+ };
Eina_Bool is_const :1;
Eina_Bool is_ptr :1;
Eina_Bool owned :1;
@@ -207,9 +277,6 @@ struct _Eolian_Typedecl
Eolian_Object base;
Eolian_Typedecl_Type type;
Eolian_Type *base_type;
- Eina_Stringshare *name;
- Eina_Stringshare *full_name;
- Eina_List *namespaces;
Eina_Hash *fields;
Eina_List *field_list;
Eolian_Function *function_pointer;
@@ -224,7 +291,6 @@ struct _Eolian_Implement
Eolian_Object base;
const Eolian_Class *klass;
const Eolian_Function *foo_id;
- Eina_Stringshare *full_name;
Eolian_Documentation *common_doc;
Eolian_Documentation *get_doc;
Eolian_Documentation *set_doc;
@@ -242,14 +308,12 @@ struct _Eolian_Constructor
{
Eolian_Object base;
const Eolian_Class *klass;
- Eina_Stringshare *full_name;
Eina_Bool is_optional: 1;
};
struct _Eolian_Event
{
Eolian_Object base;
- Eina_Stringshare *name;
Eolian_Documentation *doc;
Eolian_Type *type;
Eolian_Class *klass;
@@ -262,7 +326,6 @@ struct _Eolian_Event
struct _Eolian_Struct_Type_Field
{
Eolian_Object base;
- Eina_Stringshare *name;
Eolian_Type *type;
Eolian_Documentation *doc;
};
@@ -271,7 +334,6 @@ struct _Eolian_Enum_Type_Field
{
Eolian_Object base;
Eolian_Typedecl *base_enum;
- Eina_Stringshare *name;
Eolian_Expression *value;
Eolian_Documentation *doc;
Eina_Bool is_public_value :1;
@@ -291,10 +353,13 @@ struct _Eolian_Expression
};
struct
{
- Eolian_Unary_Operator unop;
+ union
+ {
+ Eolian_Unary_Operator unop;
+ Eolian_Value_Union value;
+ };
Eolian_Expression *expr;
};
- Eolian_Value_Union value;
};
Eina_Bool weak_lhs :1;
Eina_Bool weak_rhs :1;
@@ -304,9 +369,6 @@ struct _Eolian_Variable
{
Eolian_Object base;
Eolian_Variable_Type type;
- Eina_Stringshare *name;
- Eina_Stringshare *full_name;
- Eina_List *namespaces;
Eolian_Type *base_type;
Eolian_Expression *value;
Eolian_Documentation *doc;
@@ -314,40 +376,52 @@ struct _Eolian_Variable
};
char *database_class_to_filename(const char *cname);
-Eina_Bool database_validate(Eolian *state, const Eolian_Unit *src);
+Eina_Bool database_validate(const Eolian_Unit *src);
+Eina_Bool database_check(const Eolian_State *state);
+/* if isdep is EINA_TRUE, parse as a dependency of current unit */
+void database_defer(Eolian_State *state, const char *fname, Eina_Bool isdep);
-void database_decl_add(Eolian *state, Eina_Stringshare *name,
- Eolian_Declaration_Type type,
- Eina_Stringshare *file, void *ptr);
+void database_object_add(Eolian_Unit *unit, const Eolian_Object *obj);
void database_doc_del(Eolian_Documentation *doc);
-void database_unit_init(Eolian *state, Eolian_Unit *unit);
+void database_unit_init(Eolian_State *state, Eolian_Unit *unit, const char *file);
void database_unit_del(Eolian_Unit *unit);
+Eolian_Object_Type database_doc_token_ref_resolve(const Eolian_Doc_Token *tok,
+ const Eolian_Unit *unit1,
+ const Eolian_Unit *unit2,
+ const Eolian_Object **data1,
+ const Eolian_Object **data2);
+
/* types */
-void database_type_add(Eolian *state, Eolian_Typedecl *def);
-void database_struct_add(Eolian *state, Eolian_Typedecl *tp);
-void database_enum_add(Eolian *state, Eolian_Typedecl *tp);
+void database_type_add(Eolian_Unit *unit, Eolian_Typedecl *tp);
+void database_struct_add(Eolian_Unit *unit, Eolian_Typedecl *tp);
+void database_enum_add(Eolian_Unit *unit, Eolian_Typedecl *tp);
void database_type_del(Eolian_Type *tp);
void database_typedecl_del(Eolian_Typedecl *tp);
-void database_type_to_str(const Eolian_Unit *src, const Eolian_Type *tp, Eina_Strbuf *buf, const char *name, Eolian_C_Type_Type ctype);
-void database_typedecl_to_str(const Eolian_Unit *src, const Eolian_Typedecl *tp, Eina_Strbuf *buf);
+void database_type_to_str(const Eolian_Type *tp, Eina_Strbuf *buf, const char *name, Eolian_C_Type_Type ctype);
+void database_typedecl_to_str(const Eolian_Typedecl *tp, Eina_Strbuf *buf);
+
+Eolian_Typedecl *database_type_decl_find(const Eolian_Unit *src, const Eolian_Type *tp);
-Eina_Bool database_type_is_ownable(const Eolian_Unit *unit, const Eolian_Type *tp);
+Eina_Bool database_type_is_ownable(const Eolian_Unit *unit, const Eolian_Type *tp, Eina_Bool allow_void);
/* expressions */
-Eolian_Value database_expr_eval(const Eolian_Unit *unit, const Eolian_Expression *expr, Eolian_Expression_Mask mask);
+typedef void (*Expr_Obj_Cb)(const Eolian_Object *obj, void *data);
+
+Eolian_Value database_expr_eval(const Eolian_Unit *unit, Eolian_Expression *expr, Eolian_Expression_Mask mask, Expr_Obj_Cb cb, void *data);
+Eolian_Value database_expr_eval_type(const Eolian_Unit *unit, Eolian_Expression *expr, const Eolian_Type *type, Expr_Obj_Cb cb, void *data);
void database_expr_del(Eolian_Expression *expr);
void database_expr_print(Eolian_Expression *expr);
/* variables */
void database_var_del(Eolian_Variable *var);
-void database_var_add(Eolian *state, Eolian_Variable *var);
+void database_var_add(Eolian_Unit *unit, Eolian_Variable *var);
/* classes */
void database_class_del(Eolian_Class *cl);
diff --git a/src/lib/eolian/eolian_priv.h b/src/lib/eolian/eolian_priv.h
index 58c0f229ae..a49e50e7f2 100644
--- a/src/lib/eolian/eolian_priv.h
+++ b/src/lib/eolian/eolian_priv.h
@@ -5,56 +5,37 @@
#include <stdio.h>
#include <stdarg.h>
-static inline void _eolian_log_line(const char *file, int line, int column, const char *fmt, ...) EINA_ARG_NONNULL(1, 4) EINA_PRINTF(4, 5);
-static inline void _eolian_log(const char *fmt, ...) EINA_ARG_NONNULL(1) EINA_PRINTF(1, 2);
+static inline void _eolian_log_line(const char *file, int line, int column, const char *str) EINA_ARG_NONNULL(1, 4);
+static inline void _eolian_log(const char *str) EINA_ARG_NONNULL(1);
static inline void
-_eolian_log_line(const char *file, int line, int column, const char *fmt, ...)
+_eolian_log_line(const char *file, int line, int column, const char *str)
{
- Eina_Strbuf *sb = eina_strbuf_new();
- va_list args;
-
- va_start(args, fmt);
- eina_strbuf_append_vprintf(sb, fmt, args);
- va_end(args);
-
if (!eina_log_color_disable_get())
{
fprintf(stderr, EINA_COLOR_RED "eolian" EINA_COLOR_RESET ": "
EINA_COLOR_WHITE "%s" EINA_COLOR_RESET ":%d:%d: "
EINA_COLOR_ORANGE "%s\n" EINA_COLOR_RESET,
- file, line, column, eina_strbuf_string_get(sb));
+ file, line, column, str);
}
else
{
- fprintf(stderr, "eolian: %s:%d:%d: %s\n", file, line, column,
- eina_strbuf_string_get(sb));
+ fprintf(stderr, "eolian: %s:%d:%d: %s\n", file, line, column, str);
}
- eina_strbuf_free(sb);
}
static inline void
-_eolian_log(const char *fmt, ...)
+_eolian_log(const char *str)
{
- Eina_Strbuf *sb = eina_strbuf_new();
- va_list args;
-
- va_start(args, fmt);
- eina_strbuf_append_vprintf(sb, fmt, args);
- va_end(args);
-
if (!eina_log_color_disable_get())
{
fprintf(stderr, EINA_COLOR_RED "eolian" EINA_COLOR_RESET ": "
- EINA_COLOR_ORANGE "%s\n" EINA_COLOR_RESET,
- eina_strbuf_string_get(sb));
+ EINA_COLOR_ORANGE "%s\n" EINA_COLOR_RESET, str);
}
else
{
- fprintf(stderr, "eolian: %s\n", eina_strbuf_string_get(sb));
+ fprintf(stderr, "eolian: %s\n", str);
}
- eina_strbuf_free(sb);
}
#endif
-
diff --git a/src/lib/eolian_cxx/Eolian_Cxx.hh b/src/lib/eolian_cxx/Eolian_Cxx.hh
index ec5062fee3..2eb9736cb0 100644
--- a/src/lib/eolian_cxx/Eolian_Cxx.hh
+++ b/src/lib/eolian_cxx/Eolian_Cxx.hh
@@ -26,14 +26,14 @@ struct eolian_init
struct eolian_state
{
- Eolian *value;
+ Eolian_State *value;
eolian_state()
{
- value = ::eolian_new();
+ value = ::eolian_state_new();
}
~eolian_state()
{
- ::eolian_free(value);
+ ::eolian_state_free(value);
}
inline Eolian_Unit const* as_unit() const
diff --git a/src/lib/eolian_cxx/grammar/blacklist.hpp b/src/lib/eolian_cxx/grammar/blacklist.hpp
new file mode 100644
index 0000000000..21332b6f73
--- /dev/null
+++ b/src/lib/eolian_cxx/grammar/blacklist.hpp
@@ -0,0 +1,54 @@
+#ifndef EOLIAN_CXX_BLACKLIST_HH
+#define EOLIAN_CXX_BLACKLIST_HH
+
+#include <algorithm>
+#include "grammar/klass_def.hpp"
+
+namespace efl { namespace eolian { namespace grammar {
+
+namespace blacklist {
+
+bool is_blacklisted(attributes::type_def const& t);
+
+struct type_blacklisted_visitor
+{
+ typedef type_blacklisted_visitor visitor_type;
+ typedef bool result_type;
+
+ bool operator()(attributes::regular_type_def const&) const
+ {
+ return false;
+ }
+ bool operator()(attributes::klass_name const&) const
+ {
+ return false;
+ }
+ bool operator()(attributes::complex_type_def const& c) const
+ {
+ if (c.outer.base_type == "future")
+ return true;
+
+ return std::any_of(c.subtypes.begin(), c.subtypes.end(), is_blacklisted);
+ }
+};
+
+bool is_blacklisted(attributes::type_def const& t)
+{
+ return t.original_type.visit(type_blacklisted_visitor{});
+}
+
+bool is_blacklisted(attributes::function_def const& f)
+{
+ if (is_blacklisted(f.return_type))
+ return true;
+
+ return std::any_of(f.parameters.cbegin(), f.parameters.cend(), [](attributes::parameter_def const& p) { return is_blacklisted(p.type); });
+}
+
+
+} // namespace grammar
+} } } // namespace efl / eolian / grammar
+
+
+
+#endif
diff --git a/src/lib/eolian_cxx/grammar/class_definition.hpp b/src/lib/eolian_cxx/grammar/class_definition.hpp
index b282f71bf9..89455eda16 100644
--- a/src/lib/eolian_cxx/grammar/class_definition.hpp
+++ b/src/lib/eolian_cxx/grammar/class_definition.hpp
@@ -55,10 +55,10 @@ struct class_definition_generator
<< scope_tab << string << "(std::nullptr_t)\n"
<< scope_tab << scope_tab << ": ::efl::eo::concrete(nullptr) {}\n"
<< scope_tab << "explicit " << string << "() = default;\n"
- << scope_tab << string << "(" << string << " const& other) = default;\n"
- << scope_tab << string << "(" << string << "&& other) = default;\n"
- << scope_tab << string << "& operator=(" << string << " const& other) = default;\n"
- << scope_tab << string << "& operator=(" << string << "&& other) = default;\n"
+ << scope_tab << string << "(" << string << " const&) = default;\n"
+ << scope_tab << string << "(" << string << "&&) = default;\n"
+ << scope_tab << string << "& operator=(" << string << " const&) = default;\n"
+ << scope_tab << string << "& operator=(" << string << "&&) = default;\n"
<< scope_tab << "template <typename Derived>\n"
<< scope_tab << string << "(Derived&& derived\n"
<< scope_tab << scope_tab << ", typename std::enable_if<\n"
diff --git a/src/lib/eolian_cxx/grammar/converting_argument.hpp b/src/lib/eolian_cxx/grammar/converting_argument.hpp
index c419d36b7c..6975743520 100644
--- a/src/lib/eolian_cxx/grammar/converting_argument.hpp
+++ b/src/lib/eolian_cxx/grammar/converting_argument.hpp
@@ -35,8 +35,8 @@ struct converting_argument_generator
attributes::qualifier_def qualifier = param.type.original_type.visit(attributes::get_qualifier_visitor{});
if (param.type.original_type.visit(this->is_function_ptr))
{
- // FIXME: This supports only one function pointer.
- return as_generator("fw->data_to_c(), fw->func_to_c(), fw->free_to_c()")
+ return as_generator("fw_" << param.param_name << "->data_to_c(), fw_" << param.param_name << "->func_to_c(), fw_"
+ << param.param_name << "->free_to_c()")
.generate(sink, param, ctx);
}
else
diff --git a/src/lib/eolian_cxx/grammar/function_declaration.hpp b/src/lib/eolian_cxx/grammar/function_declaration.hpp
index f30f7569dc..dc6a969a58 100644
--- a/src/lib/eolian_cxx/grammar/function_declaration.hpp
+++ b/src/lib/eolian_cxx/grammar/function_declaration.hpp
@@ -12,6 +12,7 @@
#include "grammar/type.hpp"
#include "grammar/parameter.hpp"
#include "grammar/keyword.hpp"
+#include "grammar/blacklist.hpp"
namespace efl { namespace eolian { namespace grammar {
@@ -24,6 +25,9 @@ struct function_declaration_generator
template <typename OutputIterator, typename Context>
bool generate(OutputIterator sink, attributes::function_def const& f, Context const& ctx) const
{
+ if (blacklist::is_blacklisted(f))
+ return true;
+
std::string suffix, static_flag, const_flag;
switch(_klass_name.type)
{
diff --git a/src/lib/eolian_cxx/grammar/function_definition.hpp b/src/lib/eolian_cxx/grammar/function_definition.hpp
index 9b646efc9c..b3080e4c67 100644
--- a/src/lib/eolian_cxx/grammar/function_definition.hpp
+++ b/src/lib/eolian_cxx/grammar/function_definition.hpp
@@ -18,6 +18,7 @@
#include "grammar/attribute_reorder.hpp"
#include "grammar/type_impl.hpp"
#include "grammar/eps.hpp"
+#include "grammar/blacklist.hpp"
namespace efl { namespace eolian { namespace grammar {
@@ -30,6 +31,9 @@ struct function_definition_generator
template <typename OutputIterator, typename Context>
bool generate(OutputIterator sink, attributes::function_def const& f, Context const& ctx) const
{
+ if (blacklist::is_blacklisted(f))
+ return true;
+
std::string suffix;
switch(_klass_name.type)
{
diff --git a/src/lib/eolian_cxx/grammar/implementation_include_directive.hpp b/src/lib/eolian_cxx/grammar/implementation_include_directive.hpp
index 1fe50df6f7..bba8b4c28e 100644
--- a/src/lib/eolian_cxx/grammar/implementation_include_directive.hpp
+++ b/src/lib/eolian_cxx/grammar/implementation_include_directive.hpp
@@ -20,7 +20,7 @@ struct implementation_include_directive_generator
bool generate(OutputIterator sink, attributes::klass_def const& cls, Context const& ctx) const
{
return as_generator("#include \"" << string << ".impl.hh\"\n")
- .generate(sink, std::string(eolian_class_file_get(get_klass(get_klass_name(cls, unit_from_context(ctx))))), add_lower_case_context(ctx));
+ .generate(sink, std::string(eolian_object_file_get((const Eolian_Object *)get_klass(get_klass_name(cls, unit_from_context(ctx))))), add_lower_case_context(ctx));
}
template <typename OutputIterator, typename Context>
bool generate(OutputIterator sink, std::string const& cls, Context const& ctx) const
diff --git a/src/lib/eolian_cxx/grammar/klass_def.hpp b/src/lib/eolian_cxx/grammar/klass_def.hpp
index 16d15b6f24..d8b61458ce 100644
--- a/src/lib/eolian_cxx/grammar/klass_def.hpp
+++ b/src/lib/eolian_cxx/grammar/klass_def.hpp
@@ -109,13 +109,16 @@ struct klass_name
qualifier_def base_qualifier;
class_type type;
+ klass_name() {
+ }
+
klass_name(std::vector<std::string> namespaces
, std::string eolian_name, qualifier_def base_qualifier
, class_type type)
: namespaces(namespaces), eolian_name(eolian_name), base_qualifier(base_qualifier)
, type(type) {}
klass_name(Eolian_Class const* klass, qualifier_def base_qualifier)
- : eolian_name( ::eolian_class_name_get(klass))
+ : eolian_name( ::eolian_class_short_name_get(klass))
, base_qualifier(base_qualifier)
{
for(efl::eina::iterator<const char> namespace_iterator ( ::eolian_class_namespaces_get(klass))
@@ -339,7 +342,7 @@ type_def const void_ {attributes::regular_type_def{"void", {qualifier_info::is_n
inline void type_def::set(Eolian_Type const* eolian_type, Eolian_Unit const* unit, Eolian_C_Type_Type ctype)
{
- c_type = ::eolian_type_c_type_get(unit, eolian_type, ctype);
+ c_type = ::eolian_type_c_type_get(eolian_type, ctype);
// ::eina_stringshare_del(stringshare); // this crashes
Eolian_Type const* stp = eolian_type_base_type_get(eolian_type);
has_own = !!::eolian_type_is_owned(eolian_type);
@@ -353,7 +356,7 @@ inline void type_def::set(Eolian_Type const* eolian_type, Eolian_Unit const* uni
if (!stp)
{
bool is_undefined = false;
- Eolian_Typedecl const* decl = eolian_type_typedecl_get(unit, eolian_type);
+ Eolian_Typedecl const* decl = eolian_type_typedecl_get(eolian_type);
typedecl_type type_type = (decl ? typedecl_type_get(decl) : typedecl_type::unknown);
if(decl && eolian_typedecl_type_get(decl) == EOLIAN_TYPEDECL_ALIAS)
{
@@ -369,12 +372,12 @@ inline void type_def::set(Eolian_Type const* eolian_type, Eolian_Unit const* uni
for(efl::eina::iterator<const char> namespace_iterator( ::eolian_type_namespaces_get(eolian_type))
, namespace_last; namespace_iterator != namespace_last; ++namespace_iterator)
namespaces.push_back(&*namespace_iterator);
- original_type = {regular_type_def{ ::eolian_type_name_get(eolian_type), {qualifiers(eolian_type), {}}, namespaces, type_type, is_undefined}};
+ original_type = {regular_type_def{ ::eolian_type_short_name_get(eolian_type), {qualifiers(eolian_type), {}}, namespaces, type_type, is_undefined}};
}
else
{
complex_type_def complex
- {{::eolian_type_name_get(eolian_type), {qualifiers(eolian_type), {}}, {}}, {}};
+ {{::eolian_type_short_name_get(eolian_type), {qualifiers(eolian_type), {}}, {}}, {}};
while (stp)
{
complex.subtypes.push_back({stp, unit, EOLIAN_C_TYPE_DEFAULT});
@@ -385,7 +388,7 @@ inline void type_def::set(Eolian_Type const* eolian_type, Eolian_Unit const* uni
break;
case EOLIAN_TYPE_CLASS:
{
- Eolian_Class const* klass = eolian_type_class_get(unit, eolian_type);
+ Eolian_Class const* klass = eolian_type_class_get(eolian_type);
original_type = klass_name(klass, {qualifiers(eolian_type), {}});
}
break;
@@ -411,9 +414,42 @@ inline void type_def::set(Eolian_Expression_Type eolian_exp_type)
}
}
+struct alias_def
+{
+ std::string eolian_name;
+ std::string cxx_name;
+ std::vector<std::string> namespaces;
+ bool is_undefined;
+ type_def base_type {};
+ documentation_def documentation;
+
+ alias_def(Eolian_Typedecl const* alias_obj, Eolian_Unit const* unit)
+ {
+ cxx_name = eolian_name = ::eolian_typedecl_short_name_get(alias_obj);
+
+ for(efl::eina::iterator<const char> namespace_iterator( ::eolian_typedecl_namespaces_get(alias_obj))
+ , namespace_last; namespace_iterator != namespace_last; ++namespace_iterator)
+ {
+ this->namespaces.push_back((&*namespace_iterator));
+ }
+
+ Eolian_Type const* bt = ::eolian_typedecl_base_type_get(alias_obj);
+ if (eolian_type_type_get(bt) == EOLIAN_TYPE_UNDEFINED)
+ is_undefined = true;
+ else
+ {
+ base_type = type_def(::eolian_typedecl_base_type_get(alias_obj), unit, EOLIAN_C_TYPE_DEFAULT);
+ is_undefined = false;
+ }
+
+ documentation = ::eolian_typedecl_documentation_get(alias_obj);
+
+ }
+};
+
enum class parameter_direction
{
- in, inout, out
+ unknown, in, inout, out
};
namespace detail {
@@ -527,11 +563,13 @@ enum class function_type
struct function_def
{
+ klass_name klass; // Klass information for function_def as method
type_def return_type;
std::string name;
std::vector<parameter_def> parameters;
std::string c_name;
std::string filename;
+ std::vector<std::string> namespaces; // Namespaces for top-level function pointers
documentation_def documentation;
documentation_def return_documentation;
documentation_def property_documentation;
@@ -543,11 +581,13 @@ struct function_def
friend inline bool operator==(function_def const& lhs, function_def const& rhs)
{
- return lhs.return_type == rhs.return_type
+ return lhs.klass == rhs.klass
+ && lhs.return_type == rhs.return_type
&& lhs.name == rhs.name
&& lhs.parameters == rhs.parameters
&& lhs.c_name == rhs.c_name
&& lhs.filename == rhs.filename
+ && lhs.namespaces == rhs.namespaces
&& lhs.documentation == rhs.documentation
&& lhs.return_documentation == rhs.return_documentation
&& lhs.property_documentation == rhs.property_documentation
@@ -561,10 +601,12 @@ struct function_def
return !(lhs == rhs);
}
function_def() = default;
- function_def(type_def _return_type, std::string const& _name,
+ function_def(klass_name _klass,
+ type_def _return_type, std::string const& _name,
std::vector<parameter_def> const& _parameters,
std::string const& _c_name,
std::string _filename,
+ std::vector<std::string> const& _namespaces,
documentation_def _documentation,
documentation_def _return_documentation,
documentation_def _property_documentation,
@@ -572,15 +614,17 @@ struct function_def
bool _is_beta = false,
bool _is_protected = false,
Eolian_Unit const* unit = nullptr)
- : return_type(_return_type), name(_name), parameters(_parameters),
- c_name(_c_name), filename(_filename), documentation(_documentation),
+ : klass(_klass), return_type(_return_type), name(_name),
+ parameters(_parameters), c_name(_c_name), filename(_filename),
+ namespaces(_namespaces),
+ documentation(_documentation),
return_documentation(_return_documentation),
property_documentation(_property_documentation),
type(_type),
is_beta(_is_beta), is_protected(_is_protected),
unit(unit) {}
- function_def( ::Eolian_Function const* function, Eolian_Function_Type type, Eolian_Unit const* unit)
+ function_def( ::Eolian_Function const* function, Eolian_Function_Type type, Eolian_Typedecl const* tp, Eolian_Unit const* unit)
: return_type(void_), unit(unit)
{
Eolian_Type const* r_type = ::eolian_function_return_type_get(function, type);
@@ -633,12 +677,22 @@ struct function_def
c_name = eolian_function_full_c_name_get(function, type, EINA_FALSE);
if (type != EOLIAN_FUNCTION_POINTER)
{
- const Eolian_Class *klass = eolian_function_class_get(function);
- filename = eolian_class_file_get(klass);
+ const Eolian_Class *eolian_klass = eolian_function_class_get(function);
+ filename = eolian_object_file_get((const Eolian_Object *)eolian_klass);
+ klass = klass_name(eolian_klass,
+ {attributes::qualifier_info::is_none, std::string()});
}
else
{
filename = "";
+
+ if (tp)
+ {
+ for (efl::eina::iterator<const char> ns_iterator(::eolian_typedecl_namespaces_get(tp)), ns_last;
+ ns_iterator != ns_last;
+ ns_iterator++)
+ namespaces.push_back(&*ns_iterator);
+ }
}
is_beta = eolian_function_is_beta(function);
is_protected = eolian_function_scope_get(function, type) == EOLIAN_SCOPE_PROTECTED;
@@ -703,7 +757,6 @@ struct function_def
std::vector<std::string> opening_statements() const
{
- // FIXME: Supports only one function pointer
std::vector<std::string> statements;
char template_typename = 'F';
for (auto const& param : this->parameters)
@@ -714,7 +767,7 @@ struct function_def
{
char typenam[2] = { 0, };
typenam[0] = template_typename++;
- std::string statement = "auto fw = new ::efl::eolian::function_wrapper<";
+ std::string statement = "auto fw_" + param.param_name + " = new ::efl::eolian::function_wrapper<";
statement += param.type.c_type + ", " + typenam + ">(" + param.param_name + ");";
statements.push_back(statement);
}
@@ -779,6 +832,7 @@ struct compare_klass_name_by_name
struct event_def
{
+ klass_name klass;
eina::optional<type_def> type;
std::string name, c_name;
bool beta, protect;
@@ -786,7 +840,8 @@ struct event_def
friend inline bool operator==(event_def const& lhs, event_def const& rhs)
{
- return lhs.type == rhs.type
+ return lhs.klass == rhs.klass
+ && lhs.type == rhs.type
&& lhs.name == rhs.name
&& lhs.c_name == rhs.c_name
&& lhs.beta == rhs.beta
@@ -798,12 +853,14 @@ struct event_def
return !(lhs == rhs);
}
- event_def(type_def type, std::string name, std::string c_name, bool beta, bool protect,
- documentation_def documentation)
- : type(type), name(name), c_name(c_name), beta(beta), protect(protect)
+ event_def(klass_name _klass, type_def type, std::string name, std::string c_name,
+ bool beta, bool protect, documentation_def documentation)
+ : klass(_klass), type(type), name(name), c_name(c_name), beta(beta), protect(protect)
, documentation(documentation) {}
- event_def(Eolian_Event const* event, Eolian_Unit const* unit)
- : type( ::eolian_event_type_get(event) ? eina::optional<type_def>{{::eolian_event_type_get(event), unit, EOLIAN_C_TYPE_DEFAULT}} : eina::optional<type_def>{})
+
+ event_def(Eolian_Event const* event, Eolian_Class const* cls, Eolian_Unit const* unit)
+ : klass(cls, {attributes::qualifier_info::is_none, std::string()})
+ , type( ::eolian_event_type_get(event) ? eina::optional<type_def>{{::eolian_event_type_get(event), unit, EOLIAN_C_TYPE_DEFAULT}} : eina::optional<type_def>{})
, name( ::eolian_event_name_get(event))
, c_name( ::eolian_event_c_name_get(event))
, beta( ::eolian_event_is_beta(event))
@@ -849,6 +906,7 @@ struct part_def
{
klass_name klass;
std::string name;
+ documentation_def documentation;
//bool beta, protect; // can it be applied??
friend inline bool operator==(part_def const& lhs, part_def const& rhs)
@@ -868,7 +926,8 @@ struct part_def
part_def(Eolian_Part const* part, Eolian_Unit const*)
: klass(klass_name(::eolian_part_class_get(part), {attributes::qualifier_info::is_none, std::string()}))
- , name(::eolian_part_name_get(part)) {}
+ , name(::eolian_part_name_get(part))
+ , documentation(::eolian_part_documentation_get(part)) {}
};
inline Eolian_Class const* get_klass(klass_name const& klass_name_, Eolian_Unit const* unit);
@@ -941,8 +1000,8 @@ struct klass_def
{
this->namespaces.push_back(&*namespace_iterator);
}
- cxx_name = eolian_name = eolian_class_name_get(klass);
- filename = eolian_class_file_get(klass);
+ cxx_name = eolian_name = eolian_class_short_name_get(klass);
+ filename = eolian_object_file_get((const Eolian_Object *)klass);
for(efl::eina::iterator<Eolian_Function const> eolian_functions ( ::eolian_class_functions_get(klass, EOLIAN_PROPERTY))
, functions_last; eolian_functions != functions_last; ++eolian_functions)
{
@@ -953,19 +1012,19 @@ struct klass_def
try {
if(! ::eolian_function_is_legacy_only(function, EOLIAN_PROP_GET)
&& ::eolian_function_scope_get(function, EOLIAN_PROP_GET) != EOLIAN_SCOPE_PRIVATE)
- functions.push_back({function, EOLIAN_PROP_GET, unit});
+ functions.push_back({function, EOLIAN_PROP_GET, NULL, unit});
} catch(std::exception const&) {}
try {
if(! ::eolian_function_is_legacy_only(function, EOLIAN_PROP_SET)
&& ::eolian_function_scope_get(function, EOLIAN_PROP_SET) != EOLIAN_SCOPE_PRIVATE)
- functions.push_back({function, EOLIAN_PROP_SET, unit});
+ functions.push_back({function, EOLIAN_PROP_SET, NULL, unit});
} catch(std::exception const&) {}
}
else
try {
if(! ::eolian_function_is_legacy_only(function, func_type)
&& ::eolian_function_scope_get(function, func_type) != EOLIAN_SCOPE_PRIVATE)
- functions.push_back({function, func_type, unit});
+ functions.push_back({function, func_type, NULL, unit});
} catch(std::exception const&) {}
}
for(efl::eina::iterator<Eolian_Function const> eolian_functions ( ::eolian_class_functions_get(klass, EOLIAN_METHOD))
@@ -976,7 +1035,7 @@ struct klass_def
Eolian_Function_Type func_type = eolian_function_type_get(function);
if(! ::eolian_function_is_legacy_only(function, EOLIAN_METHOD)
&& ::eolian_function_scope_get(function, func_type) != EOLIAN_SCOPE_PRIVATE)
- functions.push_back({function, EOLIAN_METHOD, unit});
+ functions.push_back({function, EOLIAN_METHOD, NULL, unit});
} catch(std::exception const&) {}
}
for(efl::eina::iterator<Eolian_Class const> inherit_iterator ( ::eolian_class_inherits_get(klass))
@@ -1025,7 +1084,7 @@ struct klass_def
, event_last; event_iterator != event_last; ++event_iterator)
{
try {
- events.push_back({&*event_iterator, unit});
+ events.push_back({&*event_iterator, klass, unit});
} catch(std::exception const&) {}
}
@@ -1048,6 +1107,22 @@ struct klass_def
return ret;
}
+
+ std::vector<part_def> get_all_parts() const
+ {
+ std::vector<part_def> ret;
+
+ std::copy(parts.cbegin(), parts.cend(), std::back_inserter(ret));
+
+ for (auto inherit : inherits)
+ {
+ klass_def klass(get_klass(inherit, unit), unit);
+ std::copy(klass.parts.cbegin(), klass.parts.cend(),
+ std::back_inserter(ret));
+ }
+
+ return ret;
+ }
};
struct value_def
@@ -1073,12 +1148,12 @@ struct enum_value_def
std::string c_name;
documentation_def documentation;
- enum_value_def(Eolian_Enum_Type_Field const* enum_field, Eolian_Unit const* unit)
+ enum_value_def(Eolian_Enum_Type_Field const* enum_field, Eolian_Unit const*)
{
name = eolian_typedecl_enum_field_name_get(enum_field);
c_name = eolian_typedecl_enum_field_c_name_get(enum_field);
auto exp = eolian_typedecl_enum_field_value_get(enum_field, EINA_TRUE);
- value = eolian_expression_eval(unit, exp, EOLIAN_MASK_INT); // FIXME hardcoded int
+ value = eolian_expression_eval(exp, EOLIAN_MASK_INT); // FIXME hardcoded int
documentation = eolian_typedecl_enum_field_documentation_get(enum_field);
}
};
@@ -1098,7 +1173,7 @@ struct enum_def
{
this->namespaces.push_back((&*namespace_iterator));
}
- cxx_name = eolian_name = eolian_typedecl_name_get(enum_obj);
+ cxx_name = eolian_name = eolian_typedecl_short_name_get(enum_obj);
for (efl::eina::iterator<const Eolian_Enum_Type_Field> field_iterator(::eolian_typedecl_enum_fields_get(enum_obj))
, field_last; field_iterator != field_last; ++field_iterator)
@@ -1144,7 +1219,7 @@ struct struct_def
{
this->namespaces.push_back((&*namespace_iterator));
}
- cxx_name = eolian_name = eolian_typedecl_name_get(struct_obj);
+ cxx_name = eolian_name = eolian_typedecl_short_name_get(struct_obj);
for(efl::eina::iterator<const Eolian_Struct_Type_Field> field_iterator(::eolian_typedecl_struct_fields_get(struct_obj))
, field_last; field_iterator != field_last; ++field_iterator)
@@ -1171,7 +1246,7 @@ inline Eolian_Class const* get_klass(klass_name const& klass_name_, Eolian_Unit
, context_null{}))
return nullptr;
else
- return ::eolian_class_get_by_name(unit, klass_name.c_str());
+ return ::eolian_unit_class_by_name_get(unit, klass_name.c_str());
}
inline std::vector<std::string> cpp_namespaces(std::vector<std::string> namespaces)
diff --git a/src/lib/eolian_cxx/grammar/parameter.hpp b/src/lib/eolian_cxx/grammar/parameter.hpp
index e06cfeaaf0..c82345b685 100644
--- a/src/lib/eolian_cxx/grammar/parameter.hpp
+++ b/src/lib/eolian_cxx/grammar/parameter.hpp
@@ -23,7 +23,10 @@ struct parameter_type_generator
break;
case attributes::parameter_direction::in:
dir = "in";
- break;
+ break;
+ case attributes::parameter_direction::unknown:
+ dir = "";
+ break;
}
attributes::regular_type_def const* typ =
diff --git a/src/lib/eolian_cxx/grammar/part_implementation.hpp b/src/lib/eolian_cxx/grammar/part_implementation.hpp
index d88ae05b92..ec4da28913 100644
--- a/src/lib/eolian_cxx/grammar/part_implementation.hpp
+++ b/src/lib/eolian_cxx/grammar/part_implementation.hpp
@@ -29,9 +29,8 @@ struct part_implementation_generator
return false;
// FIXME: part_def can't depend on klass_def so C type is not known :(
if(!as_generator(string << ">::type "<< string << "::" << string << "() const\n{\n"
- << scope_tab << "::Eo *__return_value = ::efl_part"
- << "(this->_eo_ptr(), \"" << string << "\");\n"
- << scope_tab << "::___efl_auto_unref_set(__return_value, false);\n")
+ << scope_tab << "::Eo *__return_value = ::efl_part_get"
+ << "(this->_eo_ptr(), \"" << string << "\");\n")
.generate(sink, std::make_tuple(part.klass.eolian_name, klass_name, part.name, part.name), ctx))
return false;
if(!as_generator(scope_tab << "return ::" << *(string << "::"))
diff --git a/src/lib/eolian_cxx/grammar/type_impl.hpp b/src/lib/eolian_cxx/grammar/type_impl.hpp
index ebe738abed..21f59c01da 100644
--- a/src/lib/eolian_cxx/grammar/type_impl.hpp
+++ b/src/lib/eolian_cxx/grammar/type_impl.hpp
@@ -311,12 +311,12 @@ struct visitor_generate
(complex, regular_type_def{" ::efl::promise", complex.outer.base_qualifier, {}});
}
}
- , {"future", nullptr, nullptr, [&]
- {
- return replace_outer
- (complex, regular_type_def{" ::efl::shared_future", complex.outer.base_qualifier, {}});
- }
- }
+ /* , {"future", nullptr, nullptr, [&] */
+ /* { */
+ /* return replace_outer */
+ /* (complex, regular_type_def{" ::efl::shared_future", complex.outer.base_qualifier, {}}); */
+ /* } */
+ /* } */
, {"iterator", nullptr, nullptr, [&]
{
return replace_outer
diff --git a/src/lib/ephysics/EPhysics.h b/src/lib/ephysics/EPhysics.h
index f1c34244d3..2311975aab 100644
--- a/src/lib/ephysics/EPhysics.h
+++ b/src/lib/ephysics/EPhysics.h
@@ -72,15 +72,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_EPHYSICS_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EPHYSICS_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -91,7 +91,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#ifdef __cplusplus
extern "C" {
diff --git a/src/lib/ethumb/Ethumb.h b/src/lib/ethumb/Ethumb.h
index 2e497e19e8..9d3357d824 100644
--- a/src/lib/ethumb/Ethumb.h
+++ b/src/lib/ethumb/Ethumb.h
@@ -9,15 +9,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ETHUMB_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ETHUMB_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -28,7 +28,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#ifdef __cplusplus
extern "C" {
diff --git a/src/lib/ethumb/Ethumb_Plugin.h b/src/lib/ethumb/Ethumb_Plugin.h
index 3dd7c57a89..6bdc38a268 100644
--- a/src/lib/ethumb/Ethumb_Plugin.h
+++ b/src/lib/ethumb/Ethumb_Plugin.h
@@ -10,15 +10,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ETHUMB_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ETHUMB_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -29,7 +29,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#ifdef __cplusplus
extern "C" {
diff --git a/src/lib/ethumb/ethumb.c b/src/lib/ethumb/ethumb.c
index 13ee30c264..436088e9b2 100644
--- a/src/lib/ethumb/ethumb.c
+++ b/src/lib/ethumb/ethumb.c
@@ -40,7 +40,6 @@
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <dirent.h>
#include <ctype.h>
#include <pwd.h>
@@ -68,6 +67,7 @@
#include "ethumb_private.h"
#include "Ethumb_Plugin.h"
#include "md5.h"
+#include "../../static_libs/buildsystem/buildsystem.h"
static Ethumb_Version _version = { VMAJ, VMIN, VMIC, VREV };
EAPI Ethumb_Version *ethumb_version = &_version;
@@ -173,9 +173,7 @@ _ethumb_plugins_load(void)
const char **itr;
for (itr = built_modules; *itr != NULL; itr++)
{
- snprintf(buf, sizeof(buf),
- "%s/src/modules/ethumb/%s/.libs",
- PACKAGE_BUILD_DIR, *itr);
+ bs_mod_get(buf, sizeof(buf), "ethumb", *itr);
_plugins = eina_module_list_get(_plugins, buf,
EINA_FALSE, NULL, NULL);
}
diff --git a/src/lib/ethumb/ethumb_private.h b/src/lib/ethumb/ethumb_private.h
index 32e42ac716..47dba6e0ff 100644
--- a/src/lib/ethumb/ethumb_private.h
+++ b/src/lib/ethumb/ethumb_private.h
@@ -9,15 +9,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ETHUMB_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ETHUMB_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -28,7 +28,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
typedef struct _Ethumb_Frame Ethumb_Frame;
@@ -80,4 +80,7 @@ struct _Ethumb
Ethumb_Plugin *plugin;
};
+#undef EAPI
+#define EAPI
+
#endif /* __ETHUMB_PRIVATE_H__ */
diff --git a/src/lib/ethumb_client/Ethumb_Client.h b/src/lib/ethumb_client/Ethumb_Client.h
index 1ec8178c37..c8d90b230d 100644
--- a/src/lib/ethumb_client/Ethumb_Client.h
+++ b/src/lib/ethumb_client/Ethumb_Client.h
@@ -8,15 +8,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_ETHUMB_CLIENT_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_ETHUMB_CLIENT_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -27,7 +27,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#ifdef __cplusplus
extern "C" {
diff --git a/src/lib/evas/Evas.h b/src/lib/evas/Evas.h
index 81df72cba2..ad3f16fe4a 100644
--- a/src/lib/evas/Evas.h
+++ b/src/lib/evas/Evas.h
@@ -180,15 +180,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_EVAS_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EVAS_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -199,7 +199,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#ifdef __cplusplus
extern "C" {
diff --git a/src/lib/evas/Evas_Common.h b/src/lib/evas/Evas_Common.h
index 356edc7c3a..054982c367 100644
--- a/src/lib/evas/Evas_Common.h
+++ b/src/lib/evas/Evas_Common.h
@@ -175,7 +175,6 @@ typedef Efl_Canvas_Object Evas_Object;
/* These defines are used in H files generated by Eolian to avoid
* redefinition of types */
#define _EFL_CANVAS_OBJECT_EO_CLASS_TYPE
-#define _EFL_VG_EO_CLASS_TYPE
/**
* Type of abstract VG node
@@ -247,10 +246,10 @@ typedef struct _Evas_Pixel_Import_Source Evas_Pixel_Import_Source; /**< A source
/* Opaque types */
typedef Eo Evas_Device; /**< A source device handle - where the event came from */
-typedef Efl_Image_Content_Hint Evas_Image_Content_Hint;
-#define EVAS_IMAGE_CONTENT_HINT_NONE EFL_IMAGE_CONTENT_HINT_NONE
-#define EVAS_IMAGE_CONTENT_HINT_DYNAMIC EFL_IMAGE_CONTENT_HINT_DYNAMIC
-#define EVAS_IMAGE_CONTENT_HINT_STATIC EFL_IMAGE_CONTENT_HINT_STATIC
+typedef Efl_Gfx_Image_Content_Hint Evas_Image_Content_Hint;
+#define EVAS_IMAGE_CONTENT_HINT_NONE EFL_GFX_IMAGE_CONTENT_HINT_NONE
+#define EVAS_IMAGE_CONTENT_HINT_DYNAMIC EFL_GFX_IMAGE_CONTENT_HINT_DYNAMIC
+#define EVAS_IMAGE_CONTENT_HINT_STATIC EFL_GFX_IMAGE_CONTENT_HINT_STATIC
typedef enum _Evas_Alloc_Error
{
@@ -1907,7 +1906,7 @@ struct _Evas_Smart_Class
void (*resize)(Evas_Object *o, Evas_Coord w, Evas_Coord h); /**< code to be run when resizing object on a canvas. @a w and @a h will be new dimensions one applied to the object. use evas_object_geometry_get() if you need the old values, during this call. after that, the old values will be lost. */
void (*show)(Evas_Object *o); /**< code to be run when showing object on a canvas */
void (*hide)(Evas_Object *o); /**< code to be run when hiding object on a canvas */
- void (*color_set)(Evas_Object *o, int r, int g, int b, int a); /**< code to be run when setting color of object on a canvas. @a r, @a g, @a b and @a y will be new color components one applied to the object. use evas_object_color_get() if you need the old values, during this call. after that, the old values will be lost. */
+ void (*color_set)(Evas_Object *o, int r, int g, int b, int a); /**< code to be run when setting color of object on a canvas. @a r, @a g, @a b and @a a will be new color components one applied to the object. use evas_object_color_get() if you need the old values, during this call. after that, the old values will be lost. */
void (*clip_set)(Evas_Object *o, Evas_Object *clip); /**< code to be run when setting clipper of object on a canvas. @a clip will be new clipper one applied to the object. use evas_object_clip_get() if you need the old one, during this call. after that, the old (object pointer) value will be lost. */
void (*clip_unset)(Evas_Object *o); /**< code to be run when unsetting clipper of object on a canvas. if you need the pointer to a previous set clipper, during this call, use evas_object_clip_get(). after that, the old (object pointer) value will be lost. */
void (*calculate)(Evas_Object *o); /**< code to be run when object has rendering updates on a canvas */
@@ -3330,6 +3329,10 @@ EAPI const Eina_List *evas_font_path_global_list(void) EINA_WARN_UNUSED_R
*/
EAPI void evas_font_reinit(void);
+
+/* this is now public, non-beta api forever because someone didn't add a beta
+ api guard.
+ */
#ifndef _EFL_ANIMATION_EO_CLASS_TYPE
#define _EFL_ANIMATION_EO_CLASS_TYPE
@@ -3386,45 +3389,45 @@ typedef Eo Efl_Animation_Group_Sequential;
#endif
-#ifndef _EFL_ANIMATION_OBJECT_EO_CLASS_TYPE
-#define _EFL_ANIMATION_OBJECT_EO_CLASS_TYPE
+#ifndef _EFL_ANIMATION_PLAYER_EO_CLASS_TYPE
+#define _EFL_ANIMATION_PLAYER_EO_CLASS_TYPE
-typedef Eo Efl_Animation_Object;
+typedef Eo Efl_Animation_Player;
#endif
-#ifndef _EFL_ANIMATION_OBJECT_ALPHA_EO_CLASS_TYPE
-#define _EFL_ANIMATION_OBJECT_ALPHA_EO_CLASS_TYPE
+#ifndef _EFL_ANIMATION_PLAYER_ALPHA_EO_CLASS_TYPE
+#define _EFL_ANIMATION_PLAYER_ALPHA_EO_CLASS_TYPE
-typedef Eo Efl_Animation_Object_Alpha;
+typedef Eo Efl_Animation_Player_Alpha;
#endif
-#ifndef _EFL_ANIMATION_OBJECT_ROTATE_EO_CLASS_TYPE
-#define _EFL_ANIMATION_OBJECT_ROTATE_EO_CLASS_TYPE
+#ifndef _EFL_ANIMATION_PLAYER_ROTATE_EO_CLASS_TYPE
+#define _EFL_ANIMATION_PLAYER_ROTATE_EO_CLASS_TYPE
-typedef Eo Efl_Animation_Object_Rotate;
+typedef Eo Efl_Animation_Player_Rotate;
#endif
-#ifndef _EFL_ANIMATION_OBJECT_SCALE_EO_CLASS_TYPE
-#define _EFL_ANIMATION_OBJECT_SCALE_EO_CLASS_TYPE
+#ifndef _EFL_ANIMATION_PLAYER_SCALE_EO_CLASS_TYPE
+#define _EFL_ANIMATION_PLAYER_SCALE_EO_CLASS_TYPE
-typedef Eo Efl_Animation_Object_Scale;
+typedef Eo Efl_Animation_Player_Scale;
#endif
-#ifndef _EFL_ANIMATION_OBJECT_TRANSLATE_EO_CLASS_TYPE
-#define _EFL_ANIMATION_OBJECT_TRANSLATE_EO_CLASS_TYPE
+#ifndef _EFL_ANIMATION_PLAYER_TRANSLATE_EO_CLASS_TYPE
+#define _EFL_ANIMATION_PLAYER_TRANSLATE_EO_CLASS_TYPE
-typedef Eo Efl_Animation_Object_Translate;
+typedef Eo Efl_Animation_Player_Translate;
#endif
-#ifndef _EFL_ANIMATION_OBJECT_GROUP_EO_CLASS_TYPE
-#define _EFL_ANIMATION_OBJECT_GROUP_EO_CLASS_TYPE
+#ifndef _EFL_ANIMATION_PLAYER_GROUP_EO_CLASS_TYPE
+#define _EFL_ANIMATION_PLAYER_GROUP_EO_CLASS_TYPE
-typedef Eo Efl_Animation_Object_Group;
+typedef Eo Efl_Animation_Player_Group;
#endif
@@ -3442,18 +3445,12 @@ typedef Eo Efl_Animation_Group_Sequential;
#endif
-struct _Efl_Animation_Object_Running_Event_Info
-{
- double progress;
-};
-
#define EFL_ANIMATION_GROUP_DURATION_NONE -1
-#define EFL_ANIMATION_OBJECT_GROUP_DURATION_NONE -1
+#define EFL_ANIMATION_PLAYER_GROUP_DURATION_NONE -1
#define EFL_ANIMATION_REPEAT_INFINITE -1
-#define EFL_ANIMATION_OBJECT_REPEAT_INFINITE -1
+#define EFL_ANIMATION_PLAYER_REPEAT_INFINITE -1
/**
* @}
*/
-
diff --git a/src/lib/evas/Evas_Eo.h b/src/lib/evas/Evas_Eo.h
index fcc7fc67fe..9cea6ddc77 100644
--- a/src/lib/evas/Evas_Eo.h
+++ b/src/lib/evas/Evas_Eo.h
@@ -4,6 +4,143 @@
#ifdef EFL_EO_API_SUPPORT
+#ifndef _EFL_CANVAS_VG_NODE_EO_CLASS_TYPE
+#define _EFL_CANVAS_VG_NODE_EO_CLASS_TYPE
+
+typedef Eo Efl_Canvas_Vg_Node;
+
+#endif
+
+
+#ifndef _EFL_CANVAS_ANIMATION_EO_CLASS_TYPE
+#define _EFL_CANVAS_ANIMATION_EO_CLASS_TYPE
+
+typedef Eo Efl_Canvas_Animation;
+
+#endif
+
+#ifndef _EFL_CANVAS_ANIMATION_ALPHA_EO_CLASS_TYPE
+#define _EFL_CANVAS_ANIMATION_ALPHA_EO_CLASS_TYPE
+
+typedef Eo Efl_Canvas_Animation_Alpha;
+
+#endif
+
+#ifndef _EFL_CANVAS_ANIMATION_ROTATE_EO_CLASS_TYPE
+#define _EFL_CANVAS_ANIMATION_ROTATE_EO_CLASS_TYPE
+
+typedef Eo Efl_Canvas_Animation_Rotate;
+
+#endif
+
+#ifndef _EFL_CANVAS_ANIMATION_SCALE_EO_CLASS_TYPE
+#define _EFL_CANVAS_ANIMATION_SCALE_EO_CLASS_TYPE
+
+typedef Eo Efl_Canvas_Animation_Scale;
+
+#endif
+
+#ifndef _EFL_CANVAS_ANIMATION_TRANSLATE_EO_CLASS_TYPE
+#define _EFL_CANVAS_ANIMATION_TRANSLATE_EO_CLASS_TYPE
+
+typedef Eo Efl_Canvas_Animation_Translate;
+
+#endif
+
+#ifndef _EFL_CANVAS_ANIMATION_GROUP_EO_CLASS_TYPE
+#define _EFL_CANVAS_ANIMATION_GROUP_EO_CLASS_TYPE
+
+typedef Eo Efl_Canvas_Animation_Group;
+
+#endif
+
+#ifndef _EFL_CANVAS_ANIMATION_GROUP_PARALLEL_EO_CLASS_TYPE
+#define _EFL_CANVAS_ANIMATION_GROUP_PARALLEL_EO_CLASS_TYPE
+
+typedef Eo Efl_Canvas_Animation_Group_Parallel;
+
+#endif
+
+#ifndef _EFL_CANVAS_ANIMATION_GROUP_SEQUENTIAL_EO_CLASS_TYPE
+#define _EFL_CANVAS_ANIMATION_GROUP_SEQUENTIAL_EO_CLASS_TYPE
+
+typedef Eo Efl_Canvas_Animation_Group_Sequential;
+
+#endif
+
+#ifndef _EFL_CANVAS_ANIMATION_PLAYER_EO_CLASS_TYPE
+#define _EFL_CANVAS_ANIMATION_PLAYER_EO_CLASS_TYPE
+
+typedef Eo Efl_Canvas_Animation_Player;
+
+#endif
+
+#ifndef _EFL_CANVAS_ANIMATION_PLAYER_ALPHA_EO_CLASS_TYPE
+#define _EFL_CANVAS_ANIMATION_PLAYER_ALPHA_EO_CLASS_TYPE
+
+typedef Eo Efl_Canvas_Animation_Player_Alpha;
+
+#endif
+
+#ifndef _EFL_CANVAS_ANIMATION_PLAYER_ROTATE_EO_CLASS_TYPE
+#define _EFL_CANVAS_ANIMATION_PLAYER_ROTATE_EO_CLASS_TYPE
+
+typedef Eo Efl_Canvas_Animation_Player_Rotate;
+
+#endif
+
+#ifndef _EFL_CANVAS_ANIMATION_PLAYER_SCALE_EO_CLASS_TYPE
+#define _EFL_CANVAS_ANIMATION_PLAYER_SCALE_EO_CLASS_TYPE
+
+typedef Eo Efl_Canvas_Animation_Player_Scale;
+
+#endif
+
+#ifndef _EFL_CANVAS_ANIMATION_PLAYER_TRANSLATE_EO_CLASS_TYPE
+#define _EFL_CANVAS_ANIMATION_PLAYER_TRANSLATE_EO_CLASS_TYPE
+
+typedef Eo Efl_Canvas_Animation_Player_Translate;
+
+#endif
+
+#ifndef _EFL_CANVAS_ANIMATION_PLAYER_GROUP_EO_CLASS_TYPE
+#define _EFL_CANVAS_ANIMATION_PLAYER_GROUP_EO_CLASS_TYPE
+
+typedef Eo Efl_Canvas_Animation_Player_Group;
+
+#endif
+
+#ifndef _EFL_CANVAS_ANIMATION_GROUP_PARALLEL_EO_CLASS_TYPE
+#define _EFL_CANVAS_ANIMATION_GROUP_PARALLEL_EO_CLASS_TYPE
+
+typedef Eo Efl_Canvas_Animation_Group_Parallel;
+
+#endif
+
+#ifndef _EFL_CANVAS_ANIMATION_GROUP_SEQUENTIAL_EO_CLASS_TYPE
+#define _EFL_CANVAS_ANIMATION_GROUP_SEQUENTIAL_EO_CLASS_TYPE
+
+typedef Eo Efl_Canvas_Animation_Group_Sequential;
+
+#endif
+
+#define EFL_ANIMATION_GROUP_DURATION_NONE -1
+#define EFL_ANIMATION_PLAYER_GROUP_DURATION_NONE -1
+
+#define EFL_ANIMATION_REPEAT_INFINITE -1
+#define EFL_ANIMATION_PLAYER_REPEAT_INFINITE -1
+
+
+struct _Efl_Canvas_Animation_Player_Event_Running
+{
+ double progress;
+};
+
+struct _Efl_Canvas_Object_Animation_Event
+{
+ const Efl_Event_Description *event_desc;
+};
+
/**
* @ingroup Evas_Object_Rectangle
*
@@ -21,6 +158,7 @@
*/
//#include "canvas/efl_canvas_text_cursor.eo.h"
#include "canvas/efl_canvas_text.eo.h"
+#include "canvas/efl_canvas_text_factory.eo.h"
/**
* @}
*/
@@ -49,32 +187,25 @@
* @}
*/
-#include "canvas/efl_animation_types.eot.h"
+#include "canvas/efl_canvas_animation_types.eot.h"
#include "canvas/efl_canvas_object.eo.h"
-#include "canvas/efl_animation.eo.h"
-#include "canvas/efl_animation_alpha.eo.h"
-#include "canvas/efl_animation_rotate.eo.h"
-#include "canvas/efl_animation_scale.eo.h"
-#include "canvas/efl_animation_translate.eo.h"
-#include "canvas/efl_animation_group.eo.h"
-#include "canvas/efl_animation_group_parallel.eo.h"
-#include "canvas/efl_animation_group_sequential.eo.h"
-#include "canvas/efl_animation_object.eo.h"
-#include "canvas/efl_animation_object_alpha.eo.h"
-#include "canvas/efl_animation_object_rotate.eo.h"
-#include "canvas/efl_animation_object_scale.eo.h"
-#include "canvas/efl_animation_object_translate.eo.h"
-#include "canvas/efl_animation_object_group.eo.h"
-#include "canvas/efl_animation_object_group_parallel.eo.h"
-#include "canvas/efl_animation_object_group_sequential.eo.h"
+#include "canvas/efl_canvas_animation.eo.h"
+#include "canvas/efl_canvas_animation_alpha.eo.h"
+#include "canvas/efl_canvas_animation_rotate.eo.h"
+#include "canvas/efl_canvas_animation_scale.eo.h"
+#include "canvas/efl_canvas_animation_translate.eo.h"
+#include "canvas/efl_canvas_animation_group.eo.h"
+#include "canvas/efl_canvas_animation_group_parallel.eo.h"
+#include "canvas/efl_canvas_animation_group_sequential.eo.h"
+#include "canvas/efl_canvas_animation_player.eo.h"
#endif /* EFL_EO_API_SUPPORT */
#if defined(EFL_BETA_API_SUPPORT) && defined(EFL_EO_API_SUPPORT)
-#include "canvas/efl_canvas_object_event_grabber.eo.h"
+#include "canvas/efl_canvas_event_grabber.eo.h"
/**
* @defgroup Evas_3D Evas 3D Extensions
@@ -303,17 +434,17 @@ typedef void (Evas_Canvas3D_Surface_Func)(Evas_Real *out_x,
*
* @{
*/
-#include "canvas/efl_canvas_vg.eo.h"
+#include "canvas/efl_canvas_vg_object.eo.h"
/**
* @}
*/
-#include "canvas/efl_vg.eo.h"
-#include "canvas/efl_vg_container.eo.h"
-#include "canvas/efl_vg_shape.eo.h"
-#include "canvas/efl_vg_gradient.eo.h"
-#include "canvas/efl_vg_gradient_linear.eo.h"
-#include "canvas/efl_vg_gradient_radial.eo.h"
+#include "canvas/efl_canvas_vg_node.eo.h"
+#include "canvas/efl_canvas_vg_container.eo.h"
+#include "canvas/efl_canvas_vg_shape.eo.h"
+#include "canvas/efl_canvas_vg_gradient.eo.h"
+#include "canvas/efl_canvas_vg_gradient_linear.eo.h"
+#include "canvas/efl_canvas_vg_gradient_radial.eo.h"
#endif /* EFL_BETA_API_SUPPORT */
#ifdef EFL_EO_API_SUPPORT
@@ -327,11 +458,11 @@ typedef void (Evas_Canvas3D_Surface_Func)(Evas_Real *out_x,
#endif /* EFL_EO_API_SUPPORT */
#ifdef EFL_EO_API_SUPPORT
-# include "gesture/efl_gesture_types.eot.h"
-# include "gesture/efl_gesture_touch.eo.h"
-# include "gesture/efl_gesture.eo.h"
-# include "gesture/efl_gesture_tap.eo.h"
-# include "gesture/efl_gesture_long_tap.eo.h"
-# include "gesture/efl_gesture_recognizer.eo.h"
-# include "gesture/efl_gesture_manager.eo.h"
+# include "gesture/efl_canvas_gesture_types.eot.h"
+# include "gesture/efl_canvas_gesture_touch.eo.h"
+# include "gesture/efl_canvas_gesture.eo.h"
+# include "gesture/efl_canvas_gesture_tap.eo.h"
+# include "gesture/efl_canvas_gesture_long_tap.eo.h"
+# include "gesture/efl_canvas_gesture_recognizer.eo.h"
+# include "gesture/efl_canvas_gesture_manager.eo.h"
#endif /* EFL_EO_API_SUPPORT */
diff --git a/src/lib/evas/Evas_GL.h b/src/lib/evas/Evas_GL.h
index abc03ef267..fa3e6f4fe4 100644
--- a/src/lib/evas/Evas_GL.h
+++ b/src/lib/evas/Evas_GL.h
@@ -9,15 +9,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_EVAS_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EVAS_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -28,7 +28,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#ifdef __cplusplus
extern "C" {
diff --git a/src/lib/evas/Evas_Internal.h b/src/lib/evas/Evas_Internal.h
index 5dcf351066..b65277ed2d 100644
--- a/src/lib/evas/Evas_Internal.h
+++ b/src/lib/evas/Evas_Internal.h
@@ -7,15 +7,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_EVAS_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EVAS_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -26,7 +26,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#ifdef __cplusplus
extern "C" {
@@ -50,6 +50,8 @@ EAPI void evas_render_pending_objects_flush(Evas *eo_evas);
EAPI void efl_input_pointer_finalize(Efl_Input_Pointer *obj);
+EAPI Eina_Iterator *efl_canvas_iterator_create(Eo *obj, Eina_Iterator *real_iterator, Eina_List *list);
+
static inline void
evas_object_size_hint_combined_min_get(const Eo *obj, int *w, int *h)
{
@@ -60,6 +62,7 @@ evas_object_size_hint_combined_min_get(const Eo *obj, int *w, int *h)
}
/* Internal EO APIs */
+EAPI Eo *evas_find(const Eo *obj);
EOAPI void efl_canvas_object_legacy_ctor(Eo *obj);
EOAPI void efl_canvas_object_type_set(Eo *obj, const char *type);
EOAPI void efl_canvas_group_add(Eo *obj);
@@ -89,79 +92,10 @@ EWAPI extern const Efl_Event_Description _EVAS_CANVAS_EVENT_VIEWPORT_RESIZE;
#define EFL_CANVAS_GROUP_ADD_OPS(kls) EFL_OBJECT_OP_FUNC(efl_canvas_group_add, _##kls##_efl_canvas_group_group_add)
#define EFL_CANVAS_GROUP_ADD_DEL_OPS(kls) EFL_CANVAS_GROUP_ADD_OPS(kls), EFL_CANVAS_GROUP_DEL_OPS(kls)
-/* Efl.Animation.Object */
-EOAPI void efl_animation_object_target_set(Eo *obj, Efl_Canvas_Object *target);
-EOAPI Efl_Canvas_Object *efl_animation_object_target_get(const Eo *obj);
-
-EOAPI void efl_animation_object_final_state_keep_set(Eo *obj, Eina_Bool state_keep);
-EOAPI Eina_Bool efl_animation_object_final_state_keep_get(const Eo *obj);
-
-EOAPI void efl_animation_object_duration_set(Eo *obj, double duration);
-EOAPI double efl_animation_object_duration_get(const Eo *obj);
-
-EOAPI double efl_animation_object_total_duration_get(const Eo *obj);
-
-EOAPI void efl_animation_object_start_delay_set(Eo *obj, double delay_time);
-EOAPI double efl_animation_object_start_delay_get(const Eo *obj);
-
-typedef enum
-{
- EFL_ANIMATION_OBJECT_REPEAT_MODE_RESTART = 0,
- EFL_ANIMATION_OBJECT_REPEAT_MODE_REVERSE
-} Efl_Animation_Object_Repeat_Mode;
-
-EOAPI void efl_animation_object_repeat_mode_set(Eo *obj, Efl_Animation_Object_Repeat_Mode mode);
-EOAPI Efl_Animation_Object_Repeat_Mode efl_animation_object_repeat_mode_get(const Eo *obj);
-
-EOAPI void efl_animation_object_repeat_count_set(Eo *obj, int count);
-EOAPI int efl_animation_object_repeat_count_get(const Eo *obj);
-
-EOAPI void efl_animation_object_interpolator_set(Eo *obj, Efl_Object *interpolator);
-EOAPI Efl_Object *efl_animation_object_interpolator_get(const Eo *obj);
-
-EOAPI void efl_animation_object_target_state_save(Eo *obj);
-EOAPI void efl_animation_object_target_state_reset(Eo *obj);
-EOAPI void efl_animation_object_target_map_reset(Eo *obj);
-
-EWAPI extern const Efl_Event_Description _EFL_ANIMATION_OBJECT_EVENT_PRE_STARTED;
-#define EFL_ANIMATION_OBJECT_EVENT_PRE_STARTED (&(_EFL_ANIMATION_OBJECT_EVENT_PRE_STARTED))
-/* Efl.Animation.Object END */
-
-/* Efl.Animation.Object.Alpha */
-EOAPI void efl_animation_object_alpha_set(Eo *obj, double from_alpha, double to_alpha);
-EOAPI void efl_animation_object_alpha_get(const Eo *obj, double *from_alpha, double *to_alpha);
-/* Efl.Animation.Object.Alpha END */
-
-/* Efl.Animation.Object.Rotate */
-EOAPI void efl_animation_object_rotate_set(Eo *obj, double from_degree, double to_degree, Efl_Canvas_Object *pivot, double cx, double cy);
-EOAPI void efl_animation_object_rotate_get(const Eo *obj, double *from_degree, double *to_degree, Efl_Canvas_Object **pivot, double *cx, double *cy);
-
-EOAPI void efl_animation_object_rotate_absolute_set(Eo *obj, double from_degree, double to_degree, int cx, int cy);
-EOAPI void efl_animation_object_rotate_absolute_get(const Eo *obj, double *from_degree, double *to_degree, int *cx, int *cy);
-/* Efl.Animation.Object.Rotate END */
-
-/* Efl.Animation.Object.Scale */
-EOAPI void efl_animation_object_scale_set(Eo *obj, double from_scale_x, double from_scale_y, double to_scale_x, double to_scale_y, Efl_Canvas_Object *pivot, double cx, double cy);
-EOAPI void efl_animation_object_scale_get(const Eo *obj, double *from_scale_x, double *from_scale_y, double *to_scale_x, double *to_scale_y, Efl_Canvas_Object **pivot, double *cx, double *cy);
-
-EOAPI void efl_animation_object_scale_absolute_set(Eo *obj, double from_scale_x, double from_scale_y, double to_scale_x, double to_scale_y, int cx, int cy);
-EOAPI void efl_animation_object_scale_absolute_get(const Eo *obj, double *from_scale_x, double *from_scale_y, double *to_scale_x, double *to_scale_y, int *cx, int *cy);
-/* Efl.Animation.Object.Scale END */
-
-/* Efl.Animation.Object.Translate */
-EOAPI void efl_animation_object_translate_set(Eo *obj, int from_x, int from_y, int to_x, int to_y);
-EOAPI void efl_animation_object_translate_get(const Eo *obj, int *from_x, int *from_y, int *to_x, int *to_y);
-
-EOAPI void efl_animation_object_translate_absolute_set(Eo *obj, int from_x, int from_y, int to_x, int to_y);
-EOAPI void efl_animation_object_translate_absolute_get(const Eo *obj, int *from_x, int *from_y, int *to_x, int *to_y);
-/* Efl.Animation.Object.Translate END */
-
-/* Efl.Animation.Object.Group */
-EOAPI void efl_animation_object_group_object_add(Eo *obj, Efl_Animation_Object *anim_obj);
-EOAPI void efl_animation_object_group_object_del(Eo *obj, Efl_Animation_Object *anim_obj);
-
-EOAPI Eina_List *efl_animation_object_group_objects_get(Eo *obj);
-/* Efl.Animation.Object.Group END */
+/* Efl.Animation.Player */
+EWAPI extern const Efl_Event_Description _EFL_ANIMATION_PLAYER_EVENT_PRE_STARTED;
+#define EFL_ANIMATION_PLAYER_EVENT_PRE_STARTED (&(_EFL_ANIMATION_PLAYER_EVENT_PRE_STARTED))
+/* Efl.Animation.Player END */
#ifdef __cplusplus
}
diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h
index 9c29fb1b2a..380e21a1a8 100644
--- a/src/lib/evas/Evas_Legacy.h
+++ b/src/lib/evas/Evas_Legacy.h
@@ -85,6 +85,23 @@ EAPI Eina_Bool evas_engine_info_set(Evas *obj, Evas_Engine_Info *info);
*/
EAPI Evas_Engine_Info *evas_engine_info_get(const Evas *obj);
+/**
+ * @brief Get the maximum image size evas can possibly handle.
+ *
+ * This function returns the largest image or surface size that evas can handle
+ * in pixels, and if there is one, returns @c true. It returns @c false if no
+ * extra constraint on maximum image size exists. You still should check the
+ * return values of @c maxw and @c maxh as there may still be a limit, just a
+ * much higher one.
+ *
+ * @param[in] obj The object.
+ * @param[out] max The maximum image size (in pixels).
+ *
+ * @return @c true on success, @c false otherwise
+ */
+EAPI Eina_Bool evas_image_max_size_get(Eo *eo_e, int *w, int *h);
+
+
#include "canvas/evas_canvas.eo.legacy.h"
/**
@@ -2276,6 +2293,105 @@ EAPI Eina_Bool evas_object_pointer_coords_inside_get(const Evas_Object *eo_obj,
EAPI Evas *evas_object_evas_get(const Eo *obj);
/**
+ * @brief Retrieve a list of objects lying over a given position in a canvas.
+ *
+ * This function will traverse all the layers of the given canvas, from top to
+ * bottom, querying for objects with areas covering the given position. The
+ * user can remove from query objects which are hidden and/or which are set to
+ * pass events.
+ *
+ * @warning This function will skip objects parented by smart objects, acting
+ * only on the ones at the "top level", with regard to object parenting.
+ *
+ * @param[in] obj The object.
+ * @param[in] x The pixel position.
+ * @param[in] y The pixel position.
+ * @param[in] include_pass_events_objects Boolean flag to include or not
+ * objects which pass events in this calculation.
+ * @param[in] include_hidden_objects Boolean flag to include or not hidden
+ * objects in this calculation.
+ *
+ * @return The list of objects that are over the given position in @c e.
+ *
+ * @ingroup Efl_Canvas
+ */
+ EAPI Eina_List *evas_objects_at_xy_get(Eo *eo_e, int x, int y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects);
+
+
+/**
+ * @brief Retrieve the object stacked at the top of a given position in a
+ * canvas.
+ *
+ * This function will traverse all the layers of the given canvas, from top to
+ * bottom, querying for objects with areas covering the given position. The
+ * user can remove from the query objects which are hidden and/or which are set
+ * to pass events.
+ *
+ * @warning This function will skip objects parented by smart objects, acting
+ * only on the ones at the "top level", with regard to object parenting.
+ *
+ * @param[in] obj The object.
+ * @param[in] x The pixel position.
+ * @param[in] y The pixel position.
+ * @param[in] include_pass_events_objects Boolean flag to include or not
+ * objects which pass events in this calculation.
+ * @param[in] include_hidden_objects Boolean flag to include or not hidden
+ * objects in this calculation.
+ *
+ * @return The Evas object that is over all other objects at the given
+ * position.
+ */
+ EAPI Evas_Object* evas_object_top_at_xy_get(Eo *eo_e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects);
+
+
+/**
+ * @brief Get all objects in the given rectangle
+ *
+ * @param[in] obj The object.
+ * @param[in] x X coordinate
+ * @param[in] y Y coordinate
+ * @param[in] w Width
+ * @param[in] h Height
+ * @param[in] include_pass_events_objects @c true if the list should include
+ * objects which pass events
+ * @param[in] include_hidden_objects @c true if the list should include hidden
+ * objects
+ *
+ * @return List of objects
+ */
+EAPI Eina_List *evas_objects_in_rectangle_get(const Eo *obj, int x, int y, int w, int h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects) EINA_WARN_UNUSED_RESULT;
+
+/**
+ * @brief Retrieve the Evas object stacked at the top of a given rectangular
+ * region in a canvas
+ *
+ * This function will traverse all the layers of the given canvas, from top to
+ * bottom, querying for objects with areas overlapping with the given
+ * rectangular region inside @c e. The user can remove from the query objects
+ * which are hidden and/or which are set to pass events.
+ *
+ * @warning This function will skip objects parented by smart objects, acting
+ * only on the ones at the "top level", with regard to object parenting.
+ *
+ * @param[in] obj The object.
+ * @param[in] x The top left corner's horizontal coordinate for the rectangular
+ * region.
+ * @param[in] y The top left corner's vertical coordinate for the rectangular
+ * region.
+ * @param[in] w The width of the rectangular region.
+ * @param[in] h The height of the rectangular region.
+ * @param[in] include_pass_events_objects Boolean flag to include or not
+ * objects which pass events in this calculation.
+ * @param[in] include_hidden_objects Boolean flag to include or not hidden
+ * objects in this calculation.
+ *
+ * @return The Evas object that is over all other objects at the given
+ * rectangular region.
+ *
+ * @ingroup Evas_Canvas
+ */
+EAPI Evas_Object *evas_object_top_in_rectangle_get(const Eo *obj, int x, int y, int w, int h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects) EINA_WARN_UNUSED_RESULT;
+/**
* @}
*/
@@ -3471,8 +3587,6 @@ EAPI Evas_Object *evas_object_rectangle_add(Evas *e) EINA_WARN_UNUSED_RESULT EIN
* @since 1.14
*/
-#ifdef EFL_BETA_API_SUPPORT
-
/**
* Creates a new vector object on the given Evas @p e canvas.
*
@@ -3488,8 +3602,9 @@ EAPI Evas_Object *evas_object_rectangle_add(Evas *e) EINA_WARN_UNUSED_RESULT EIN
*/
EAPI Evas_Object *evas_object_vg_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
-#include "canvas/efl_canvas_vg.eo.legacy.h"
-#include "canvas/efl_vg_container.eo.legacy.h"
+#include "canvas/efl_canvas_vg_node.eo.legacy.h"
+#include "canvas/efl_canvas_vg_object.eo.legacy.h"
+#include "canvas/efl_canvas_vg_container.eo.legacy.h"
/**
* Creates a new vector shape object \.
*
@@ -3682,7 +3797,7 @@ EAPI void evas_vg_node_raise(Eo *obj);
*/
EAPI void evas_vg_node_lower(Eo *obj);
-#include "canvas/efl_vg.eo.legacy.h"
+#include "canvas/efl_canvas_vg_node.eo.legacy.h"
/**
*
@@ -4125,7 +4240,7 @@ EAPI void evas_vg_shape_stroke_fill_set(Eo *obj, Efl_VG *f);
*/
EAPI Efl_VG* evas_vg_shape_stroke_fill_get(const Eo *obj);
-#include "canvas/efl_vg_shape.eo.legacy.h"
+#include "canvas/efl_canvas_vg_shape.eo.legacy.h"
/**
*
@@ -4169,7 +4284,7 @@ EAPI void evas_vg_gradient_spread_set(Eo *obj, Efl_Gfx_Gradient_Spread s);
*/
EAPI Efl_Gfx_Gradient_Spread evas_vg_gradient_spread_get(Eo *obj);
-#include "canvas/efl_vg_gradient.eo.legacy.h"
+#include "canvas/efl_canvas_vg_gradient.eo.legacy.h"
/**
* Creates a new linear gradient object \.
@@ -4220,7 +4335,7 @@ EAPI void evas_vg_gradient_linear_end_set(Eo *obj, double x, double y);
*/
EAPI void evas_vg_gradient_linear_end_get(Eo *obj, double *x, double *y);
-#include "canvas/efl_vg_gradient_linear.eo.legacy.h"
+#include "canvas/efl_canvas_vg_gradient_linear.eo.legacy.h"
/**
* Creates a new radial gradient object \.
@@ -4288,9 +4403,7 @@ EAPI void evas_vg_gradient_radial_focal_set(Eo *obj, double x, double y);
*/
EAPI void evas_vg_gradient_radial_focal_get(Eo *obj, double *x, double *y);
-#include "canvas/efl_vg_gradient_radial.eo.legacy.h"
-
-#endif
+#include "canvas/efl_canvas_vg_gradient_radial.eo.legacy.h"
/**
* @}
@@ -6134,6 +6247,27 @@ EAPI void evas_object_polygon_points_clear(Evas_Object *obj);
*
* @{
*/
+
+
+/** Call user-provided @c calculate smart functions and unset the flag
+ * signalling that the object needs to get recalculated to all smart objects in
+ * the canvas.
+ *
+ * @ingroup Evas_Canvas
+ */
+EAPI void evas_smart_objects_calculate(Eo *obj);
+
+/**
+ * @brief Get if the canvas is currently calculating smart objects.
+ *
+ * @param[in] obj The object.
+ *
+ * @return @c true if currently calculating smart objects.
+ *
+ * @ingroup Evas_Canvas
+ */
+EAPI Eina_Bool evas_smart_objects_calculating_get(const Eo *obj);
+
/**
* Instantiates a new smart object described by @p s.
*
@@ -6775,6 +6909,35 @@ EAPI Eina_List *evas_object_box_children_get(const Evas_Object *
*/
EAPI Evas_Object *evas_object_table_add(Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
+/**
+ * @brief Control the mirrored mode of the table. In mirrored mode, the table
+ * items go from right to left instead of left to right. That is, 1,1 is top
+ * right, not top left.
+ *
+ * @param[in] obj The object.
+ * @param[in] mirrored @c true if mirrored, @c false otherwise
+ *
+ * @since 1.1
+ *
+ * @ingroup Evas_Table
+ */
+EAPI void evas_object_table_mirrored_set(Eo *obj, Eina_Bool mirrored);
+
+/**
+ * @brief Control the mirrored mode of the table. In mirrored mode, the table
+ * items go from right to left instead of left to right. That is, 1,1 is top
+ * right, not top left.
+ *
+ * @param[in] obj The object.
+ *
+ * @return @c true if mirrored, @c false otherwise
+ *
+ * @since 1.1
+ *
+ * @ingroup Evas_Table
+ */
+EAPI Eina_Bool evas_object_table_mirrored_get(const Eo *obj);
+
#include "canvas/evas_table.eo.legacy.h"
/**
@@ -6795,6 +6958,36 @@ EAPI Evas_Object *evas_object_table_add(Evas *evas) EINA_W
*/
EAPI Evas_Object *evas_object_grid_add(Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
+
+/**
+ * @brief Sets the mirrored mode of the grid. In mirrored mode the grid items
+ * go from right to left instead of left to right. That is, 0,0 is top right,
+ * not to left.
+ *
+ * @param[in] obj The object.
+ * @param[in] mirrored @c true if mirrored mode is set, @c false otherwise
+ *
+ * @since 1.1
+ *
+ * @ingroup Evas_Grid
+ */
+EAPI void evas_object_grid_mirrored_set(Eo *obj, Eina_Bool mirrored);
+
+/**
+ * @brief Gets the mirrored mode of the grid.
+ *
+ * See also @ref evas_object_grid_mirrored_set
+ *
+ * @param[in] obj The object.
+ *
+ * @return @c true if mirrored mode is set, @c false otherwise
+ *
+ * @since 1.1
+ *
+ * @ingroup Evas_Grid
+ */
+EAPI Eina_Bool evas_object_grid_mirrored_get(const Eo *obj);
+
#include "canvas/evas_grid.eo.legacy.h"
/**
@@ -7865,7 +8058,6 @@ EAPI void evas_object_text_filter_program_set(Evas_Object *obj, const char *code
*/
EAPI void evas_object_text_filter_source_set(Evas_Object *obj, const char *name, Evas_Object *source) EINA_DEPRECATED;
-#ifdef EFL_BETA_API_SUPPORT
/**
* Creates a new smart rectangle object on the given Evas @p e canvas.
*
@@ -7889,5 +8081,14 @@ EAPI void evas_object_text_filter_source_set(Evas_Object *obj, const char *name,
* @since 1.20
*/
EAPI Evas_Object *evas_object_event_grabber_add(Evas *e);
-#include "canvas/efl_canvas_object_event_grabber.eo.legacy.h"
-#endif
+#include "canvas/efl_canvas_event_grabber.eo.legacy.h"
+
+#include "canvas/efl_canvas_animation_alpha.eo.legacy.h"
+#include "canvas/efl_canvas_animation.eo.legacy.h"
+#include "canvas/efl_canvas_animation_group.eo.legacy.h"
+#include "canvas/efl_canvas_animation_group_parallel.eo.legacy.h"
+#include "canvas/efl_canvas_animation_group_sequential.eo.legacy.h"
+#include "canvas/efl_canvas_animation_player.eo.legacy.h"
+#include "canvas/efl_canvas_animation_rotate.eo.legacy.h"
+#include "canvas/efl_canvas_animation_scale.eo.legacy.h"
+#include "canvas/efl_canvas_animation_translate.eo.legacy.h"
diff --git a/src/lib/evas/Evas_Loader.h b/src/lib/evas/Evas_Loader.h
index 3c52dc3201..5dbbab99df 100644
--- a/src/lib/evas/Evas_Loader.h
+++ b/src/lib/evas/Evas_Loader.h
@@ -44,15 +44,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_EVAS_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EVAS_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -63,7 +63,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#ifdef __cplusplus
extern "C" {
@@ -134,16 +134,16 @@ typedef Emile_Image_Property Evas_Image_Property;
typedef struct _Evas_Image_Load_Func Evas_Image_Load_Func;
-typedef Efl_Image_Load_Error Evas_Load_Error;
+typedef Efl_Gfx_Image_Load_Error Evas_Load_Error;
-#define EVAS_LOAD_ERROR_NONE EFL_IMAGE_LOAD_ERROR_NONE
-#define EVAS_LOAD_ERROR_GENERIC EFL_IMAGE_LOAD_ERROR_GENERIC
-#define EVAS_LOAD_ERROR_DOES_NOT_EXIST EFL_IMAGE_LOAD_ERROR_DOES_NOT_EXIST
-#define EVAS_LOAD_ERROR_PERMISSION_DENIED EFL_IMAGE_LOAD_ERROR_PERMISSION_DENIED
-#define EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED EFL_IMAGE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED
-#define EVAS_LOAD_ERROR_CORRUPT_FILE EFL_IMAGE_LOAD_ERROR_CORRUPT_FILE
-#define EVAS_LOAD_ERROR_UNKNOWN_FORMAT EFL_IMAGE_LOAD_ERROR_UNKNOWN_FORMAT
-#define EVAS_LOAD_ERROR_CANCELLED EFL_IMAGE_LOAD_ERROR_CANCELLED
+#define EVAS_LOAD_ERROR_NONE EFL_GFX_IMAGE_LOAD_ERROR_NONE
+#define EVAS_LOAD_ERROR_GENERIC EFL_GFX_IMAGE_LOAD_ERROR_GENERIC
+#define EVAS_LOAD_ERROR_DOES_NOT_EXIST EFL_GFX_IMAGE_LOAD_ERROR_DOES_NOT_EXIST
+#define EVAS_LOAD_ERROR_PERMISSION_DENIED EFL_GFX_IMAGE_LOAD_ERROR_PERMISSION_DENIED
+#define EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED EFL_GFX_IMAGE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED
+#define EVAS_LOAD_ERROR_CORRUPT_FILE EFL_GFX_IMAGE_LOAD_ERROR_CORRUPT_FILE
+#define EVAS_LOAD_ERROR_UNKNOWN_FORMAT EFL_GFX_IMAGE_LOAD_ERROR_UNKNOWN_FORMAT
+#define EVAS_LOAD_ERROR_CANCELLED EFL_GFX_IMAGE_LOAD_ERROR_CANCELLED
typedef Emile_Image_Animated_Loop_Hint Evas_Image_Animated_Loop_Hint;
@@ -219,7 +219,7 @@ EAPI Eina_Bool evas_module_task_cancelled (void); /**< @since 1.19 */
Count = 0; \
if (evas_module_task_cancelled()) \
{ \
- *Error = EFL_IMAGE_LOAD_ERROR_CANCELLED; \
+ *Error = EFL_GFX_IMAGE_LOAD_ERROR_CANCELLED; \
goto Error_Handler; \
} \
} \
diff --git a/src/lib/evas/cache/evas_cache_image.c b/src/lib/evas/cache/evas_cache_image.c
index b2d83aa9ce..11b9a1d64e 100644
--- a/src/lib/evas/cache/evas_cache_image.c
+++ b/src/lib/evas/cache/evas_cache_image.c
@@ -52,6 +52,7 @@ static void
_evas_cache_image_dirty_add(Image_Entry *im)
{
if (im->flags.dirty) return;
+ if (!im->cache) return;
_evas_cache_image_activ_del(im);
_evas_cache_image_lru_del(im);
_evas_cache_image_lru_nodata_del(im);
@@ -69,6 +70,7 @@ static void
_evas_cache_image_dirty_del(Image_Entry *im)
{
if (!im->flags.dirty) return;
+ if (!im->cache) return;
im->flags.dirty = 0;
im->flags.cached = 0;
im->cache->dirty = eina_inlist_remove(im->cache->dirty, EINA_INLIST_GET(im));
@@ -78,6 +80,7 @@ static void
_evas_cache_image_activ_add(Image_Entry *im)
{
if (im->flags.activ) return;
+ if (!im->cache) return;
_evas_cache_image_dirty_del(im);
_evas_cache_image_lru_del(im);
_evas_cache_image_lru_nodata_del(im);
@@ -95,6 +98,7 @@ _evas_cache_image_activ_del(Image_Entry *im)
{
if (!im->flags.activ) return;
if (!im->cache_key) return;
+ if (!im->cache) return;
im->flags.activ = 0;
im->flags.cached = 0;
if (im->flags.given_mmap)
@@ -107,6 +111,7 @@ static void
_evas_cache_image_lru_add(Image_Entry *im)
{
if (im->flags.lru) return;
+ if (!im->cache) return;
_evas_cache_image_dirty_del(im);
_evas_cache_image_activ_del(im);
_evas_cache_image_lru_nodata_del(im);
@@ -126,6 +131,7 @@ _evas_cache_image_lru_del(Image_Entry *im)
{
if (!im->flags.lru) return;
if (!im->cache_key) return;
+ if (!im->cache) return;
im->flags.lru = 0;
im->flags.cached = 0;
if (im->flags.given_mmap)
@@ -140,6 +146,7 @@ static void
_evas_cache_image_lru_nodata_add(Image_Entry *im)
{
if (im->flags.lru_nodata) return;
+ if (!im->cache) return;
_evas_cache_image_dirty_del(im);
_evas_cache_image_activ_del(im);
_evas_cache_image_lru_del(im);
@@ -152,6 +159,7 @@ static void
_evas_cache_image_lru_nodata_del(Image_Entry *im)
{
if (!im->flags.lru_nodata) return;
+ if (!im->cache) return;
im->flags.lru = 0;
im->flags.cached = 0;
im->cache->lru_nodata = eina_inlist_remove(im->cache->lru_nodata, EINA_INLIST_GET(im));
@@ -163,6 +171,7 @@ _evas_cache_image_entry_delete(Evas_Cache_Image *cache, Image_Entry *ie)
Image_Entry_Task *task;
if (!ie) return;
+ if (!ie->cache) return;
//// SLKL(ie->lock);
//// SLKU(ie->lock);
if ((cache) && (cache->func.debug)) cache->func.debug("deleting", ie);
@@ -345,6 +354,7 @@ _evas_cache_image_async_heavy(void *data)
current = data;
+ if (!current->cache) return;
SLKL(current->lock);
pchannel = current->channel;
current->channel++;
@@ -426,6 +436,7 @@ _evas_cache_image_async_end(void *data)
Image_Entry *ie = (Image_Entry *)data;
Image_Entry_Task *task;
+ if (!ie->cache) return;
evas_cache_image_ref(ie);
ie->cache->preload = eina_list_remove(ie->cache->preload, ie);
ie->cache->pending = eina_list_remove(ie->cache->pending, ie);
@@ -448,6 +459,7 @@ _evas_cache_image_async_cancel(void *data)
Evas_Cache_Image *cache = NULL;
Image_Entry *ie = (Image_Entry *)data;
+ if (!ie->cache) return;
evas_cache_image_ref(ie);
ie->preload = NULL;
ie->cache->pending = eina_list_remove(ie->cache->pending, ie);
@@ -495,6 +507,7 @@ _evas_cache_image_entry_preload_add(Image_Entry *ie, const Eo *target,
Evas_Cache_Target *tg;
Image_Entry_Task *task;
+ if (!ie->cache) return 0;
evas_cache_image_ref(ie);
if (ie->flags.preload_done)
{
@@ -550,6 +563,7 @@ _evas_cache_image_entry_preload_remove(Image_Entry *ie, const Eo *target)
Eina_List *l;
Image_Entry_Task *task;
+ if (!ie->cache) return;
// evas_cache_image_ref(ie);
if (target)
{
@@ -605,18 +619,21 @@ _evas_cache_image_entry_preload_remove(Image_Entry *ie, const Eo *target)
EAPI int
evas_cache_image_usage_get(Evas_Cache_Image *cache)
{
+ if (!cache) return 0;
return cache->usage;
}
EAPI int
evas_cache_image_get(Evas_Cache_Image *cache)
{
+ if (!cache) return 0;
return cache->limit;
}
EAPI void
evas_cache_image_set(Evas_Cache_Image *cache, unsigned int limit)
{
+ if (!cache) return;
if (cache->limit == limit)
{
return;
@@ -904,6 +921,7 @@ evas_cache_image_drop(Image_Entry *im)
Evas_Cache_Image *cache;
int references;
+ if (!im->cache) return;
SLKL(engine_lock);
//// SLKL(im->lock);
im->references--;
@@ -957,6 +975,7 @@ evas_cache_image_dirty(Image_Entry *im, unsigned int x, unsigned int y, unsigned
Image_Entry *im_dirty = im;
Evas_Cache_Image *cache;
+ if (!im->cache) return NULL;
cache = im->cache;
if (!(im->flags.dirty))
{
@@ -996,6 +1015,7 @@ evas_cache_image_alone(Image_Entry *im)
Image_Entry *im_dirty = im;
int references;
+ if (!im->cache) return NULL;
cache = im->cache;
references = im->references;
@@ -1034,6 +1054,7 @@ evas_cache_image_copied_data(Evas_Cache_Image *cache,
int err;
Image_Entry *im;
+ if (!cache) return NULL;
if ((cspace == EVAS_COLORSPACE_YCBCR422P601_PL) ||
(cspace == EVAS_COLORSPACE_YCBCR422P709_PL) ||
(cspace == EVAS_COLORSPACE_YCBCR422601_PL))
@@ -1066,6 +1087,7 @@ evas_cache_image_data(Evas_Cache_Image *cache, unsigned int w, unsigned int h,
int err;
Image_Entry *im;
+ if (!cache) return NULL;
if ((cspace == EVAS_COLORSPACE_YCBCR422P601_PL) ||
(cspace == EVAS_COLORSPACE_YCBCR422P709_PL) ||
(cspace == EVAS_COLORSPACE_YCBCR422601_PL))
@@ -1096,6 +1118,7 @@ evas_cache_image_surface_alloc(Image_Entry *im, unsigned int w, unsigned int h)
{
Evas_Cache_Image *cache = im->cache;
+ if (!im->cache) return;
if ((im->space == EVAS_COLORSPACE_YCBCR422P601_PL) ||
(im->space == EVAS_COLORSPACE_YCBCR422P709_PL) ||
(im->space == EVAS_COLORSPACE_YCBCR422601_PL))
@@ -1112,6 +1135,7 @@ evas_cache_image_size_set(Image_Entry *im, unsigned int w, unsigned int h)
Image_Entry *im2 = NULL;
int error;
+ if (!im->cache) return im;
evas_cache_image_ref(im);
if ((im->space == EVAS_COLORSPACE_YCBCR422P601_PL) ||
(im->space == EVAS_COLORSPACE_YCBCR422P709_PL) ||
@@ -1157,6 +1181,7 @@ evas_cache_image_load_data(Image_Entry *im)
Eina_Bool preload = EINA_FALSE;
int error = EVAS_LOAD_ERROR_NONE;
+ if (!im->cache) return error;
evas_cache_image_ref(im);
if ((im->flags.loaded) && (!im->animated.animated))
{
@@ -1211,6 +1236,7 @@ evas_cache_image_load_data(Image_Entry *im)
EAPI void
evas_cache_image_unload_data(Image_Entry *im)
{
+ if (!im->cache) return;
evas_cache_image_ref(im);
if (im->flags.in_progress)
{
@@ -1256,6 +1282,7 @@ evas_cache_image_unload_all(Evas_Cache_Image *cache)
{
Image_Entry *im;
+ if (!cache) return;
// _evas_cache_image_unload_cb -> evas_cache_image_unload_data -> evas_cache_image_ref
// deadlock
////// SLKL(engine_lock);
@@ -1299,6 +1326,7 @@ evas_cache_image_preload_data(Image_Entry *im, const Eo *target,
{
RGBA_Image *img = (RGBA_Image *)im;
+ if (!im->cache) return;
evas_cache_image_ref(im);
if (((int)im->w > 0) && ((int)im->h > 0) &&
(((im->flags.loaded) && (img->image.data)) ||
@@ -1330,6 +1358,7 @@ static int total = 0;
static void
_dump_img(Image_Entry *im, const char *type)
{
+ if (!im->cache) return;
total += im->cache->func.mem_size_get(im);
printf("%s: %4i: %4ib, %4ix%4i alloc[%4ix%4i] [%s] [%s]\n",
type,
@@ -1352,6 +1381,7 @@ _dump_cache(Evas_Cache_Image *cache)
{
Image_Entry *im;
+ if (!cache) return;
printf("--CACHE DUMP----------------------------------------------------\n");
printf("cache: %ikb / %ikb\n",
cache->usage / 1024,
@@ -1375,6 +1405,7 @@ _dump_cache(Evas_Cache_Image *cache)
EAPI int
evas_cache_image_flush(Evas_Cache_Image *cache)
{
+ if (!cache) return 0;
#ifdef CACHEDUMP
_dump_cache(cache);
#endif
@@ -1411,6 +1442,7 @@ evas_cache_image_empty(Evas_Cache_Image *cache)
int err;
Image_Entry *im;
+ if (!cache) return NULL;
SLKL(engine_lock);
im = _evas_cache_image_entry_new(cache, NULL, NULL, NULL, NULL, NULL, NULL, &err);
SLKU(engine_lock);
@@ -1422,6 +1454,7 @@ evas_cache_image_empty(Evas_Cache_Image *cache)
EAPI void
evas_cache_image_colorspace(Image_Entry *im, Evas_Colorspace cspace)
{
+ if (!im->cache) return;
evas_cache_image_ref(im);
if (im->space == cspace) goto done;
im->space = cspace;
@@ -1435,6 +1468,7 @@ EAPI void *
evas_cache_private_from_image_entry_get(Image_Entry *im)
{
void *data;
+ if (!im->cache) return NULL;
evas_cache_image_ref(im);
data = (void *)im->cache->data;
evas_cache_image_drop(im);
@@ -1444,12 +1478,14 @@ evas_cache_private_from_image_entry_get(Image_Entry *im)
EAPI void *
evas_cache_private_get(Evas_Cache_Image *cache)
{
+ if (!cache) return NULL;
return cache->data;
}
EAPI void
evas_cache_private_set(Evas_Cache_Image *cache, const void *data)
{
+ if (!cache) return;
cache->data = (void *)data;
}
diff --git a/src/lib/evas/cache/evas_preload.c b/src/lib/evas/cache/evas_preload.c
index c71e5ed7d5..921b03c6f4 100644
--- a/src/lib/evas/cache/evas_preload.c
+++ b/src/lib/evas/cache/evas_preload.c
@@ -71,7 +71,6 @@ _evas_preload_thread_worker(void *data, Ecore_Thread *thread)
void
_evas_preload_thread_init(void)
{
- ecore_init();
}
void
@@ -91,7 +90,6 @@ _evas_preload_thread_shutdown(void)
works = eina_inlist_remove(works, works);
}
}
- ecore_shutdown();
}
Evas_Preload_Pthread *
diff --git a/src/lib/evas/canvas/efl_animation.c b/src/lib/evas/canvas/efl_animation.c
deleted file mode 100644
index c5c461e0b1..0000000000
--- a/src/lib/evas/canvas/efl_animation.c
+++ /dev/null
@@ -1,183 +0,0 @@
-#include "efl_animation_private.h"
-
-static void
-_target_del_cb(void *data, const Efl_Event *event EINA_UNUSED)
-{
- Eo *eo_obj = data;
-
- EFL_ANIMATION_DATA_GET(eo_obj, pd);
-
- pd->target = NULL;
-}
-
-EOLIAN static void
-_efl_animation_target_set(Eo *eo_obj,
- Efl_Animation_Data *pd,
- Efl_Canvas_Object *target)
-{
- efl_event_callback_add(target, EFL_EVENT_DEL, _target_del_cb, eo_obj);
-
- pd->target = target;
-}
-
-EOLIAN static Efl_Canvas_Object *
-_efl_animation_target_get(Eo *eo_obj EINA_UNUSED, Efl_Animation_Data *pd)
-{
- return pd->target;
-}
-
-EOLIAN static void
-_efl_animation_duration_set(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Data *pd,
- double duration)
-{
- pd->duration = duration;
-}
-
-EOLIAN static double
-_efl_animation_duration_get(Eo *eo_obj EINA_UNUSED, Efl_Animation_Data *pd)
-{
- return pd->duration;
-}
-
-EOLIAN static double
-_efl_animation_total_duration_get(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Data *pd)
-{
- return pd->duration;
-}
-
-EOLIAN static void
-_efl_animation_final_state_keep_set(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Data *pd,
- Eina_Bool keep_final_state)
-{
- if (pd->keep_final_state == keep_final_state) return;
-
- pd->keep_final_state = !!keep_final_state;
-}
-
-EOLIAN static Eina_Bool
-_efl_animation_final_state_keep_get(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Data *pd)
-{
- return pd->keep_final_state;
-}
-
-EOLIAN static Efl_Animation_Object *
-_efl_animation_object_create(Eo *eo_obj, Efl_Animation_Data *pd EINA_UNUSED)
-{
- Efl_Animation_Object *anim_obj
- = efl_add(EFL_ANIMATION_OBJECT_CLASS, NULL);
-
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- efl_animation_object_target_set(anim_obj, target);
-
- Eina_Bool state_keep = efl_animation_final_state_keep_get(eo_obj);
- efl_animation_object_final_state_keep_set(anim_obj, state_keep);
-
- double duration = efl_animation_duration_get(eo_obj);
- efl_animation_object_duration_set(anim_obj, duration);
-
- int repeat_count = efl_animation_repeat_count_get(eo_obj);
- efl_animation_object_repeat_count_set(anim_obj, repeat_count);
-
- return anim_obj;
-}
-
-EOLIAN static void
-_efl_animation_repeat_mode_set(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Data *pd,
- Efl_Animation_Repeat_Mode mode)
-{
- if ((mode == EFL_ANIMATION_REPEAT_MODE_RESTART) ||
- (mode == EFL_ANIMATION_REPEAT_MODE_REVERSE))
- pd->repeat_mode = mode;
-}
-
-EOLIAN static Efl_Animation_Repeat_Mode
-_efl_animation_repeat_mode_get(Eo *eo_obj EINA_UNUSED, Efl_Animation_Data *pd)
-{
- return pd->repeat_mode;
-}
-
-EOLIAN static void
-_efl_animation_repeat_count_set(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Data *pd,
- int count)
-{
- //EFL_ANIMATION_REPEAT_INFINITE repeats animation infinitely
- if ((count < 0) && (count != EFL_ANIMATION_REPEAT_INFINITE)) return;
-
- pd->repeat_count = count;
-}
-
-EOLIAN static int
-_efl_animation_repeat_count_get(Eo *eo_obj EINA_UNUSED, Efl_Animation_Data *pd)
-{
- return pd->repeat_count;
-}
-
-EOLIAN static void
-_efl_animation_start_delay_set(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Data *pd,
- double delay_time)
-{
- if (delay_time < 0.0) return;
-
- pd->start_delay_time = delay_time;
-}
-
-EOLIAN static double
-_efl_animation_start_delay_get(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Data *pd)
-{
- return pd->start_delay_time;
-}
-
-EOLIAN static void
-_efl_animation_interpolator_set(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Data *pd,
- Efl_Interpolator *interpolator)
-{
- pd->interpolator = interpolator;
-}
-
-EOLIAN static Efl_Interpolator *
-_efl_animation_interpolator_get(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Data *pd)
-{
- return pd->interpolator;
-}
-
-EOLIAN static Efl_Object *
-_efl_animation_efl_object_constructor(Eo *eo_obj,
- Efl_Animation_Data *pd)
-{
- eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
-
- pd->target = NULL;
-
- pd->duration = 0.0;
-
- pd->start_delay_time = 0.0;
-
- pd->repeat_count = 0;
-
- pd->interpolator = NULL;
-
- pd->keep_final_state = EINA_FALSE;
-
- return eo_obj;
-}
-
-EOLIAN static void
-_efl_animation_efl_object_destructor(Eo *eo_obj, Efl_Animation_Data *pd)
-{
- if (pd->target)
- efl_event_callback_del(pd->target, EFL_EVENT_DEL, _target_del_cb, eo_obj);
-
- efl_destructor(efl_super(eo_obj, MY_CLASS));
-}
-
-#include "efl_animation.eo.c"
diff --git a/src/lib/evas/canvas/efl_animation_alpha.c b/src/lib/evas/canvas/efl_animation_alpha.c
deleted file mode 100644
index d077120881..0000000000
--- a/src/lib/evas/canvas/efl_animation_alpha.c
+++ /dev/null
@@ -1,71 +0,0 @@
-#include "efl_animation_alpha_private.h"
-
-EOLIAN static void
-_efl_animation_alpha_alpha_set(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Alpha_Data *pd,
- double from_alpha,
- double to_alpha)
-{
- pd->from.alpha = from_alpha;
- pd->to.alpha = to_alpha;
-}
-
-EOLIAN static void
-_efl_animation_alpha_alpha_get(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Alpha_Data *pd,
- double *from_alpha,
- double *to_alpha)
-{
- if (from_alpha)
- *from_alpha = pd->from.alpha;
- if (to_alpha)
- *to_alpha = pd->to.alpha;
-}
-
-EOLIAN static Efl_Animation_Object *
-_efl_animation_alpha_efl_animation_object_create(Eo *eo_obj,
- Efl_Animation_Alpha_Data *pd)
-{
- Efl_Animation_Object_Alpha *anim_obj
- = efl_add(EFL_ANIMATION_OBJECT_ALPHA_CLASS, NULL);
-
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- efl_animation_object_target_set(anim_obj, target);
-
- Eina_Bool state_keep = efl_animation_final_state_keep_get(eo_obj);
- efl_animation_object_final_state_keep_set(anim_obj, state_keep);
-
- double duration = efl_animation_duration_get(eo_obj);
- efl_animation_object_duration_set(anim_obj, duration);
-
- double start_delay_time = efl_animation_start_delay_get(eo_obj);
- efl_animation_object_start_delay_set(anim_obj, start_delay_time);
-
- Efl_Animation_Object_Repeat_Mode repeat_mode =
- (Efl_Animation_Object_Repeat_Mode)efl_animation_repeat_mode_get(eo_obj);
- efl_animation_object_repeat_mode_set(anim_obj, repeat_mode);
-
- int repeat_count = efl_animation_repeat_count_get(eo_obj);
- efl_animation_object_repeat_count_set(anim_obj, repeat_count);
-
- Efl_Interpolator *interpolator = efl_animation_interpolator_get(eo_obj);
- efl_animation_object_interpolator_set(anim_obj, interpolator);
-
- efl_animation_object_alpha_set(anim_obj, pd->from.alpha, pd->to.alpha);
-
- return anim_obj;
-}
-
-EOLIAN static Efl_Object *
-_efl_animation_alpha_efl_object_constructor(Eo *eo_obj,
- Efl_Animation_Alpha_Data *pd)
-{
- eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
-
- pd->from.alpha = 1.0;
- pd->to.alpha = 1.0;
-
- return eo_obj;
-}
-
-#include "efl_animation_alpha.eo.c"
diff --git a/src/lib/evas/canvas/efl_animation_alpha_private.h b/src/lib/evas/canvas/efl_animation_alpha_private.h
deleted file mode 100644
index 9350fd1d77..0000000000
--- a/src/lib/evas/canvas/efl_animation_alpha_private.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#define EFL_ANIMATION_PROTECTED
-
-#include "evas_common_private.h"
-#include <Ecore.h>
-
-#define MY_CLASS EFL_ANIMATION_ALPHA_CLASS
-#define MY_CLASS_NAME efl_class_name_get(MY_CLASS)
-
-#define EFL_ANIMATION_ALPHA_DATA_GET(o, pd) \
- Efl_Animation_Alpha_Data *pd = efl_data_scope_get(o, EFL_ANIMATION_ALPHA_CLASS)
-
-typedef struct _Efl_Animation_Alpha_Property
-{
- double alpha;
-} Efl_Animation_Alpha_Property;
-
-typedef struct _Efl_Animation_Alpha_Data
-{
- Efl_Animation_Alpha_Property from;
- Efl_Animation_Alpha_Property to;
-} Efl_Animation_Alpha_Data;
diff --git a/src/lib/evas/canvas/efl_animation_group.c b/src/lib/evas/canvas/efl_animation_group.c
deleted file mode 100644
index 2e657e67f1..0000000000
--- a/src/lib/evas/canvas/efl_animation_group.c
+++ /dev/null
@@ -1,135 +0,0 @@
-#include "efl_animation_group_private.h"
-
-EOLIAN static void
-_efl_animation_group_animation_add(Eo *eo_obj,
- Efl_Animation_Group_Data *pd,
- Efl_Animation *animation)
-{
- if (!animation) return;
-
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (target)
- efl_animation_target_set(animation, target);
-
- double duration = efl_animation_duration_get(eo_obj);
- /* if group animation duration is available value, then the duration is
- * propagated to its child. */
- if (duration != EFL_ANIMATION_GROUP_DURATION_NONE)
- efl_animation_duration_set(animation, duration);
-
- Eina_Bool keep_final_state = efl_animation_final_state_keep_get(eo_obj);
- efl_animation_final_state_keep_set(animation, keep_final_state);
-
- pd->animations = eina_list_append(pd->animations, animation);
-}
-
-EOLIAN static void
-_efl_animation_group_animation_del(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Group_Data *pd,
- Efl_Animation*animation)
-{
- if (!animation) return;
-
- pd->animations = eina_list_remove(pd->animations, animation);
-}
-
-EOLIAN static Eina_List *
-_efl_animation_group_animations_get(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Group_Data *pd)
-{
- return pd->animations;
-}
-
-EOLIAN static void
-_efl_animation_group_efl_animation_target_set(Eo *eo_obj,
- Efl_Animation_Group_Data *pd,
- Efl_Canvas_Object *target)
-{
- Eina_List *l;
- Efl_Animation *anim;
- EINA_LIST_FOREACH(pd->animations, l, anim)
- {
- efl_animation_target_set(anim, target);
- }
-
- efl_animation_target_set(efl_super(eo_obj, MY_CLASS), target);
-}
-
-EOLIAN static void
-_efl_animation_group_efl_animation_duration_set(Eo *eo_obj,
- Efl_Animation_Group_Data *pd,
- double duration)
-{
- if (duration == EFL_ANIMATION_GROUP_DURATION_NONE) goto end;
-
- if (duration < 0.0) return;
-
- Eina_List *l;
- Efl_Animation *anim;
- EINA_LIST_FOREACH(pd->animations, l, anim)
- {
- efl_animation_duration_set(anim, duration);
- }
-
-end:
- efl_animation_duration_set(efl_super(eo_obj, MY_CLASS), duration);
-}
-
-EOLIAN static void
-_efl_animation_group_efl_animation_final_state_keep_set(Eo *eo_obj,
- Efl_Animation_Group_Data *pd,
- Eina_Bool keep_final_state)
-{
- Eina_List *l;
- Efl_Animation *anim;
- EINA_LIST_FOREACH(pd->animations, l, anim)
- {
- efl_animation_final_state_keep_set(anim, keep_final_state);
- }
-
- efl_animation_final_state_keep_set(efl_super(eo_obj, MY_CLASS), keep_final_state);
-}
-
-EOLIAN static void
-_efl_animation_group_efl_animation_interpolator_set(Eo *eo_obj,
- Efl_Animation_Group_Data *pd,
- Efl_Interpolator *interpolator)
-{
- Eina_List *l;
- Efl_Animation *anim;
- EINA_LIST_FOREACH(pd->animations, l, anim)
- {
- efl_animation_interpolator_set(anim, interpolator);
- }
-
- efl_animation_interpolator_set(efl_super(eo_obj, MY_CLASS), interpolator);
-}
-
-EOLIAN static Efl_Object *
-_efl_animation_group_efl_object_constructor(Eo *eo_obj,
- Efl_Animation_Group_Data *pd)
-{
- eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
-
- pd->animations = NULL;
-
- //group animation does not affect its child duration by default.
- efl_animation_duration_set(efl_super(eo_obj, MY_CLASS),
- EFL_ANIMATION_GROUP_DURATION_NONE);
-
- return eo_obj;
-}
-
-EOLIAN static void
-_efl_animation_group_efl_object_destructor(Eo *eo_obj,
- Efl_Animation_Group_Data *pd)
-{
- Efl_Animation *anim;
-
- EINA_LIST_FREE(pd->animations, anim)
- efl_del(anim);
-
- efl_destructor(efl_super(eo_obj, MY_CLASS));
-}
-
-#include "efl_animation_group.eo.c"
diff --git a/src/lib/evas/canvas/efl_animation_group.eo b/src/lib/evas/canvas/efl_animation_group.eo
deleted file mode 100644
index a431e39737..0000000000
--- a/src/lib/evas/canvas/efl_animation_group.eo
+++ /dev/null
@@ -1,33 +0,0 @@
-import efl_animation_types;
-
-abstract Efl.Animation.Group (Efl.Animation)
-{
- [[Efl group animation abstract class]]
- data: Efl_Animation_Group_Data;
- methods {
- animation_add {
- [[Add the given animation to the animation group.]]
- params {
- @in animation: Efl.Animation; [[The animation which needs to be added to the animation group]]
- }
- }
- animation_del {
- [[Delete the given animation from the animation group.]]
- params {
- @in animation: Efl.Animation; [[The animation which needs to be deleted from the animation group]]
- }
- }
- animations_get {
- [[Get the animations of the animation group.]]
- return: list<Efl.Animation>; [[The animations of the animation group]]
- }
- }
- implements {
- Efl.Object.constructor;
- Efl.Object.destructor;
- Efl.Animation.target { set; }
- Efl.Animation.duration { set; }
- Efl.Animation.final_state_keep { set; }
- Efl.Animation.interpolator { set; }
- }
-}
diff --git a/src/lib/evas/canvas/efl_animation_group_parallel.c b/src/lib/evas/canvas/efl_animation_group_parallel.c
deleted file mode 100644
index 0e401614e8..0000000000
--- a/src/lib/evas/canvas/efl_animation_group_parallel.c
+++ /dev/null
@@ -1,98 +0,0 @@
-#include "efl_animation_group_parallel_private.h"
-
-EOLIAN static void
-_efl_animation_group_parallel_efl_animation_group_animation_add(Eo *eo_obj,
- Efl_Animation_Group_Parallel_Data *pd EINA_UNUSED,
- Efl_Animation *animation)
-{
- if (!animation) return;
-
- efl_animation_group_animation_add(efl_super(eo_obj, MY_CLASS),
- animation);
-}
-
-EOLIAN static void
-_efl_animation_group_parallel_efl_animation_group_animation_del(Eo *eo_obj,
- Efl_Animation_Group_Parallel_Data *pd EINA_UNUSED,
- Efl_Animation *animation)
-{
- if (!animation) return;
-
- efl_animation_group_animation_del(efl_super(eo_obj, MY_CLASS),
- animation);
-}
-
-EOLIAN static double
-_efl_animation_group_parallel_efl_animation_total_duration_get(Eo *eo_obj,
- Efl_Animation_Group_Parallel_Data *pd EINA_UNUSED)
-{
- Eina_List *animations =
- efl_animation_group_animations_get(eo_obj);
- if (!animations) return 0.0;
-
- double total_duration = 0.0;
- Eina_List *l;
- Efl_Animation *anim;
- EINA_LIST_FOREACH(animations, l, anim)
- {
- double child_total_duration = efl_animation_total_duration_get(anim);
-
- double start_delay = efl_animation_start_delay_get(anim);
- if (start_delay > 0.0)
- child_total_duration += start_delay;
-
- int child_repeat_count = efl_animation_repeat_count_get(anim);
- if (child_repeat_count > 0)
- child_total_duration *= (child_repeat_count + 1);
-
- if (child_total_duration > total_duration)
- total_duration = child_total_duration;
- }
- return total_duration;
-}
-
-EOLIAN static Efl_Animation_Object *
-_efl_animation_group_parallel_efl_animation_object_create(Eo *eo_obj,
- Efl_Animation_Group_Parallel_Data *pd EINA_UNUSED)
-{
- Efl_Animation_Object_Group_Parallel *group_anim_obj
- = efl_add(EFL_ANIMATION_OBJECT_GROUP_PARALLEL_CLASS, NULL);
-
- Eina_List *animations = efl_animation_group_animations_get(eo_obj);
- Eina_List *l;
- Efl_Animation *child_anim;
- Efl_Animation_Object *child_anim_obj;
-
- EINA_LIST_FOREACH(animations, l, child_anim)
- {
- child_anim_obj = efl_animation_object_create(child_anim);
- efl_animation_object_group_object_add(group_anim_obj, child_anim_obj);
- }
-
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (target)
- efl_animation_object_target_set(group_anim_obj, target);
-
- Eina_Bool state_keep = efl_animation_final_state_keep_get(eo_obj);
- efl_animation_object_final_state_keep_set(group_anim_obj, state_keep);
-
- double duration = efl_animation_duration_get(eo_obj);
- efl_animation_object_duration_set(group_anim_obj, duration);
-
- double start_delay_time = efl_animation_start_delay_get(eo_obj);
- efl_animation_object_start_delay_set(group_anim_obj, start_delay_time);
-
- Efl_Animation_Object_Repeat_Mode repeat_mode =
- (Efl_Animation_Object_Repeat_Mode)efl_animation_repeat_mode_get(eo_obj);
- efl_animation_object_repeat_mode_set(group_anim_obj, repeat_mode);
-
- int repeat_count = efl_animation_repeat_count_get(eo_obj);
- efl_animation_object_repeat_count_set(group_anim_obj, repeat_count);
-
- Efl_Interpolator *interpolator = efl_animation_interpolator_get(eo_obj);
- efl_animation_object_interpolator_set(group_anim_obj, interpolator);
-
- return group_anim_obj;
-}
-
-#include "efl_animation_group_parallel.eo.c"
diff --git a/src/lib/evas/canvas/efl_animation_group_parallel.eo b/src/lib/evas/canvas/efl_animation_group_parallel.eo
deleted file mode 100644
index ca0beb6478..0000000000
--- a/src/lib/evas/canvas/efl_animation_group_parallel.eo
+++ /dev/null
@@ -1,15 +0,0 @@
-import efl_animation_types;
-
-class Efl.Animation.Group.Parallel (Efl.Animation.Group)
-{
- [[Efl group parallel animation class]]
- data: Efl_Animation_Group_Parallel_Data;
- methods {
- }
- implements {
- Efl.Animation.object_create;
- Efl.Animation.Group.animation_add;
- Efl.Animation.Group.animation_del;
- Efl.Animation.total_duration { get; }
- }
-}
diff --git a/src/lib/evas/canvas/efl_animation_group_parallel_private.h b/src/lib/evas/canvas/efl_animation_group_parallel_private.h
deleted file mode 100644
index 963a8adf74..0000000000
--- a/src/lib/evas/canvas/efl_animation_group_parallel_private.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#define EFL_ANIMATION_PROTECTED
-
-#include "evas_common_private.h"
-#include <Ecore.h>
-
-#define MY_CLASS EFL_ANIMATION_GROUP_PARALLEL_CLASS
-#define MY_CLASS_NAME efl_class_name_get(MY_CLASS)
-
-#define EFL_ANIMATION_GROUP_PARALLEL_DATA_GET(o, pd) \
- Efl_Animation_Group_Parallel_Data *pd = efl_data_scope_get(o, EFL_ANIMATION_GROUP_PARALLEL_CLASS)
-
-typedef struct _Efl_Animation_Group_Parallel_Data
-{
-} Efl_Animation_Group_Parallel_Data;
diff --git a/src/lib/evas/canvas/efl_animation_group_private.h b/src/lib/evas/canvas/efl_animation_group_private.h
deleted file mode 100644
index 28c6b8b947..0000000000
--- a/src/lib/evas/canvas/efl_animation_group_private.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#define EFL_ANIMATION_PROTECTED
-
-#include "evas_common_private.h"
-#include <Ecore.h>
-
-#define MY_CLASS EFL_ANIMATION_GROUP_CLASS
-#define MY_CLASS_NAME efl_class_name_get(MY_CLASS)
-
-#define EFL_ANIMATION_GROUP_DATA_GET(o, pd) \
- Efl_Animation_Group_Data *pd = efl_data_scope_get(o, EFL_ANIMATION_GROUP_CLASS)
-
-typedef struct _Efl_Animation_Group_Data
-{
- Eina_List *animations;
-} Efl_Animation_Group_Data;
diff --git a/src/lib/evas/canvas/efl_animation_group_sequential.c b/src/lib/evas/canvas/efl_animation_group_sequential.c
deleted file mode 100644
index 8db4928ff4..0000000000
--- a/src/lib/evas/canvas/efl_animation_group_sequential.c
+++ /dev/null
@@ -1,94 +0,0 @@
-#include "efl_animation_group_sequential_private.h"
-
-EOLIAN static void
-_efl_animation_group_sequential_efl_animation_group_animation_add(Eo *eo_obj,
- Efl_Animation_Group_Sequential_Data *pd EINA_UNUSED,
- Efl_Animation *animation)
-{
- if (!animation) return;
-
- efl_animation_group_animation_add(efl_super(eo_obj, MY_CLASS), animation);
-}
-
-EOLIAN static void
-_efl_animation_group_sequential_efl_animation_group_animation_del(Eo *eo_obj,
- Efl_Animation_Group_Sequential_Data *pd EINA_UNUSED,
- Efl_Animation *animation)
-{
- if (!animation) return;
-
- efl_animation_group_animation_del(efl_super(eo_obj, MY_CLASS), animation);
-}
-
-EOLIAN static double
-_efl_animation_group_sequential_efl_animation_total_duration_get(Eo *eo_obj,
- Efl_Animation_Group_Sequential_Data *pd EINA_UNUSED)
-{
- Eina_List *animations = efl_animation_group_animations_get(eo_obj);
- if (!animations) return 0.0;
-
- double total_duration = 0.0;
- Eina_List *l;
- Efl_Animation *anim;
- EINA_LIST_FOREACH(animations, l, anim)
- {
- double child_total_duration = efl_animation_total_duration_get(anim);
-
- double start_delay = efl_animation_start_delay_get(anim);
- if (start_delay > 0.0)
- child_total_duration += start_delay;
-
- int child_repeat_count = efl_animation_repeat_count_get(anim);
- if (child_repeat_count > 0)
- child_total_duration *= (child_repeat_count + 1);
-
- total_duration += child_total_duration;
- }
- return total_duration;
-}
-
-EOLIAN static Efl_Animation_Object *
-_efl_animation_group_sequential_efl_animation_object_create(Eo *eo_obj,
- Efl_Animation_Group_Sequential_Data *pd EINA_UNUSED)
-{
- Efl_Animation_Object_Group_Sequential *group_anim_obj
- = efl_add(EFL_ANIMATION_OBJECT_GROUP_SEQUENTIAL_CLASS, NULL);
-
- Eina_List *animations = efl_animation_group_animations_get(eo_obj);
- Eina_List *l;
- Efl_Animation *child_anim;
- Efl_Animation_Object *child_anim_obj;
-
- EINA_LIST_FOREACH(animations, l, child_anim)
- {
- child_anim_obj = efl_animation_object_create(child_anim);
- efl_animation_object_group_object_add(group_anim_obj, child_anim_obj);
- }
-
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (target)
- efl_animation_object_target_set(group_anim_obj, target);
-
- Eina_Bool state_keep = efl_animation_final_state_keep_get(eo_obj);
- efl_animation_object_final_state_keep_set(group_anim_obj, state_keep);
-
- double duration = efl_animation_duration_get(eo_obj);
- efl_animation_object_duration_set(group_anim_obj, duration);
-
- double start_delay_time = efl_animation_start_delay_get(eo_obj);
- efl_animation_object_start_delay_set(group_anim_obj, start_delay_time);
-
- Efl_Animation_Object_Repeat_Mode repeat_mode =
- (Efl_Animation_Object_Repeat_Mode)efl_animation_repeat_mode_get(eo_obj);
- efl_animation_object_repeat_mode_set(group_anim_obj, repeat_mode);
-
- int repeat_count = efl_animation_repeat_count_get(eo_obj);
- efl_animation_object_repeat_count_set(group_anim_obj, repeat_count);
-
- Efl_Interpolator *interpolator = efl_animation_interpolator_get(eo_obj);
- efl_animation_object_interpolator_set(group_anim_obj, interpolator);
-
- return group_anim_obj;
-}
-
-#include "efl_animation_group_sequential.eo.c"
diff --git a/src/lib/evas/canvas/efl_animation_group_sequential.eo b/src/lib/evas/canvas/efl_animation_group_sequential.eo
deleted file mode 100644
index 650b017b71..0000000000
--- a/src/lib/evas/canvas/efl_animation_group_sequential.eo
+++ /dev/null
@@ -1,15 +0,0 @@
-import efl_animation_types;
-
-class Efl.Animation.Group.Sequential (Efl.Animation.Group)
-{
- [[Efl group sequential animation class]]
- data: Efl_Animation_Group_Sequential_Data;
- methods {
- }
- implements {
- Efl.Animation.object_create;
- Efl.Animation.Group.animation_add;
- Efl.Animation.Group.animation_del;
- Efl.Animation.total_duration { get; }
- }
-}
diff --git a/src/lib/evas/canvas/efl_animation_group_sequential_private.h b/src/lib/evas/canvas/efl_animation_group_sequential_private.h
deleted file mode 100644
index 69503e9751..0000000000
--- a/src/lib/evas/canvas/efl_animation_group_sequential_private.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#define EFL_ANIMATION_PROTECTED
-
-#include "evas_common_private.h"
-#include <Ecore.h>
-
-#define MY_CLASS EFL_ANIMATION_GROUP_SEQUENTIAL_CLASS
-#define MY_CLASS_NAME efl_class_name_get(MY_CLASS)
-
-#define EFL_ANIMATION_GROUP_SEQUENTIAL_DATA_GET(o, pd) \
- Efl_Animation_Group_Sequential_Data *pd = efl_data_scope_get(o, EFL_ANIMATION_GROUP_SEQUENTIAL_CLASS)
-
-typedef struct _Efl_Animation_Group_Sequential_Data
-{
-} Efl_Animation_Group_Sequential_Data;
diff --git a/src/lib/evas/canvas/efl_animation_object.c b/src/lib/evas/canvas/efl_animation_object.c
deleted file mode 100644
index 87d1988c91..0000000000
--- a/src/lib/evas/canvas/efl_animation_object.c
+++ /dev/null
@@ -1,585 +0,0 @@
-#include "efl_animation_object_private.h"
-
-EOLIAN static void
-_efl_animation_object_auto_del_set(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Object_Data *pd,
- Eina_Bool auto_del)
-{
- pd->auto_del = auto_del;
-}
-
-EOLIAN static Eina_Bool
-_efl_animation_object_auto_del_get(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Object_Data *pd)
-{
- return pd->auto_del;
-}
-
-static void
-_target_del_cb(void *data, const Efl_Event *event EINA_UNUSED)
-{
- Eo *eo_obj = data;
-
- EFL_ANIMATION_OBJECT_DATA_GET(eo_obj, pd);
-
- pd->target = NULL;
- efl_animation_object_cancel(eo_obj);
-}
-
-EOLIAN static void
-_efl_animation_object_target_set(Eo *eo_obj,
- Efl_Animation_Object_Data *pd,
- Efl_Canvas_Object *target)
-{
- if (pd->target == target) return;
-
- if (pd->target)
- efl_event_callback_del(pd->target, EFL_EVENT_DEL, _target_del_cb, eo_obj);
-
- efl_event_callback_add(target, EFL_EVENT_DEL, _target_del_cb, eo_obj);
-
- pd->target = target;
-}
-
-EOLIAN static Efl_Canvas_Object *
-_efl_animation_object_target_get(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Object_Data *pd)
-{
- return pd->target;
-}
-
-EOLIAN static void
-_efl_animation_object_duration_set(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Object_Data *pd,
- double duration)
-{
- pd->duration = duration;
-}
-
-EOLIAN static double
-_efl_animation_object_duration_get(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Object_Data *pd)
-{
- return pd->duration;
-}
-
-EOLIAN static double
-_efl_animation_object_total_duration_get(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Object_Data *pd)
-{
- return pd->duration;
-}
-
-EOLIAN static void
-_efl_animation_object_repeat_mode_set(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Object_Data *pd,
- Efl_Animation_Object_Repeat_Mode mode)
-{
- if ((mode == EFL_ANIMATION_OBJECT_REPEAT_MODE_RESTART) ||
- (mode == EFL_ANIMATION_OBJECT_REPEAT_MODE_REVERSE))
- pd->repeat_mode = mode;
-}
-
-EOLIAN static Efl_Animation_Object_Repeat_Mode
-_efl_animation_object_repeat_mode_get(const Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Object_Data *pd)
-{
- return pd->repeat_mode;
-}
-
-EOLIAN static void
-_efl_animation_object_repeat_count_set(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Object_Data *pd,
- int count)
-{
- //EFL_ANIMATION_OBJECT_REPEAT_INFINITE repeats animation infinitely
- if ((count < 0) && (count != EFL_ANIMATION_OBJECT_REPEAT_INFINITE)) return;
-
- pd->repeat_count = count;
-}
-
-EOLIAN static int
-_efl_animation_object_repeat_count_get(const Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Object_Data *pd)
-{
- return pd->repeat_count;
-}
-
-EOLIAN static void
-_efl_animation_object_start_delay_set(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Object_Data *pd,
- double delay_time)
-{
- if (delay_time < 0.0) return;
-
- pd->start_delay_time = delay_time;
-}
-
-EOLIAN static double
-_efl_animation_object_start_delay_get(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Object_Data *pd)
-{
- return pd->start_delay_time;
-}
-
-EOLIAN static void
-_efl_animation_object_interpolator_set(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Object_Data *pd,
- Efl_Interpolator *interpolator)
-{
- pd->interpolator = interpolator;
-}
-
-EOLIAN static Efl_Interpolator *
-_efl_animation_object_interpolator_get(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Object_Data *pd)
-{
- return pd->interpolator;
-}
-
-EOLIAN static void
-_efl_animation_object_target_state_save(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Object_Data *pd)
-{
- if (!pd->target || !pd->target_state) return;
-
- Evas_Coord x, y, w, h;
- evas_object_geometry_get(pd->target, &x, &y, &w, &h);
-
- pd->target_state->x = x;
- pd->target_state->y = y;
- pd->target_state->w = w;
- pd->target_state->h = h;
-
- int r, g, b, a;
- evas_object_color_get(pd->target, &r, &g, &b, &a);
-
- pd->target_state->r = r;
- pd->target_state->g = g;
- pd->target_state->b = b;
- pd->target_state->a = a;
-
- Evas_Map *map = evas_map_dup(evas_object_map_get(pd->target));
- pd->target_state->map = map;
-
- Eina_Bool enable_map = evas_object_map_enable_get(pd->target);
- pd->target_state->enable_map = enable_map;
-}
-
-EOLIAN static void
-_efl_animation_object_target_state_reset(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Object_Data *pd)
-{
- if (!pd->target) return;
-
- if (efl_gfx_map_has(pd->target))
- efl_gfx_map_reset(pd->target);
-
- if (!pd->target_state) return;
-
- Evas_Coord x, y, w, h;
- x = pd->target_state->x;
- y = pd->target_state->y;
- w = pd->target_state->w;
- h = pd->target_state->h;
-
- evas_object_resize(pd->target, w, h);
- evas_object_move(pd->target, x, y);
-
- int r, g, b, a;
- r = pd->target_state->r;
- g = pd->target_state->g;
- b = pd->target_state->b;
- a = pd->target_state->a;
-
- evas_object_color_set(pd->target, r, g, b, a);
-
- Evas_Map *map = pd->target_state->map;
- evas_object_map_set(pd->target, map);
-
- Eina_Bool enable_map = pd->target_state->enable_map;
- evas_object_map_enable_set(pd->target, enable_map);
-}
-
-EOLIAN static void
-_efl_animation_object_target_map_reset(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Object_Data *pd)
-{
- if (!pd->target) return;
-
- if (efl_gfx_map_has(pd->target))
- efl_gfx_map_reset(pd->target);
-}
-
-EOLIAN static void
-_efl_animation_object_final_state_keep_set(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Object_Data *pd,
- Eina_Bool keep_final_state)
-{
- if (pd->keep_final_state == keep_final_state) return;
-
- pd->keep_final_state = !!keep_final_state;
-}
-
-EOLIAN static Eina_Bool
-_efl_animation_object_final_state_keep_get(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Object_Data *pd)
-{
- return pd->keep_final_state;
-}
-
-static Eina_Bool
-_animator_cb(void *data)
-{
- Eo *eo_obj = data;
- EFL_ANIMATION_OBJECT_DATA_GET(eo_obj, pd);
-
- if (pd->is_paused)
- {
- pd->animator = NULL;
- return ECORE_CALLBACK_CANCEL;
- }
-
- if (pd->is_cancelled) goto end;
-
- double paused_time = pd->paused_time;
-
- double total_duration = efl_animation_object_total_duration_get(eo_obj);
-
- pd->time.current = ecore_loop_time_get();
- double elapsed_time = pd->time.current - pd->time.begin;
-
- if ((elapsed_time - paused_time) > total_duration)
- elapsed_time = total_duration + paused_time;
-
- if (total_duration < 0.0) goto end;
-
- if (total_duration == 0.0)
- {
- ecore_animator_del(pd->animator);
- pd->animator = NULL;
-
- pd->progress = 1.0;
- }
- else
- pd->progress = (elapsed_time - paused_time) / total_duration;
-
- if (!pd->is_direction_forward)
- pd->progress = 1.0 - pd->progress;
-
- //If the direction is changed, then reset the target state.
- if (pd->is_direction_changed)
- {
- pd->is_direction_changed = EINA_FALSE;
- efl_animation_object_target_state_reset(eo_obj);
- }
-
- //Apply interpolator
- if (pd->interpolator)
- {
- pd->progress = efl_interpolator_interpolate(pd->interpolator,
- pd->progress);
- }
-
- //Reset previous animation effect before applying animation effect
- /* FIXME: When the target state is saved, it may not be finished to calculate
- * target geometry.
- * In this case, incorrect geometry is saved and the target moves to the
- * incorrect position when animation is paused and resumed.
- * As a result, flicking issue happens.
- * To avoid the flicking issue, reset map only during animation. */
- efl_animation_object_target_map_reset(eo_obj);
-
- efl_animation_object_progress_set(eo_obj, pd->progress);
-
- //Not end. Keep going.
- if ((elapsed_time - paused_time) < total_duration)
- return ECORE_CALLBACK_RENEW;
-
-end:
- //Repeat animation
- if ((pd->repeat_count == EFL_ANIMATION_OBJECT_REPEAT_INFINITE) ||
- (pd->remaining_repeat_count > 0))
- {
- if (pd->remaining_repeat_count > 0)
- pd->remaining_repeat_count--;
-
- pd->time.begin = ecore_loop_time_get();
- pd->paused_time = 0.0;
-
- if (pd->repeat_mode == EFL_ANIMATION_OBJECT_REPEAT_MODE_REVERSE)
- {
- pd->is_direction_forward = !pd->is_direction_forward;
- pd->is_direction_changed = EINA_TRUE;
- }
-
- return ECORE_CALLBACK_RENEW;
- }
-
- pd->is_ended = EINA_TRUE;
- pd->animator = NULL;
-
- //Reset the state of the target to the initial state
- if (!pd->keep_final_state)
- efl_animation_object_target_state_reset(eo_obj);
-
- efl_event_callback_call(eo_obj, EFL_ANIMATION_OBJECT_EVENT_ENDED, NULL);
-
- if (pd->auto_del) efl_del(eo_obj);
-
- return ECORE_CALLBACK_CANCEL;
-}
-
-static void
-_start(Eo *eo_obj, Efl_Animation_Object_Data *pd)
-{
- double total_duration = efl_animation_object_total_duration_get(eo_obj);
- if (total_duration < 0.0) return;
-
- //Save the current state of the target
- efl_animation_object_target_state_save(eo_obj);
-
- pd->is_started = EINA_TRUE;
- pd->is_cancelled = EINA_FALSE;
- pd->is_ended = EINA_FALSE;
- pd->is_direction_forward = EINA_TRUE;
- pd->is_direction_changed = EINA_FALSE;
-
- pd->paused_time = 0.0;
-
- pd->remaining_repeat_count = pd->repeat_count;
-
- ecore_animator_del(pd->animator);
- pd->animator = NULL;
-
- pd->time.begin = ecore_loop_time_get();
-
- //pre started event is supported within class only (protected event)
- efl_event_callback_call(eo_obj, EFL_ANIMATION_OBJECT_EVENT_PRE_STARTED,
- NULL);
- efl_event_callback_call(eo_obj, EFL_ANIMATION_OBJECT_EVENT_STARTED, NULL);
-
- pd->animator = ecore_animator_add(_animator_cb, eo_obj);
-
- _animator_cb(eo_obj);
-}
-
-static Eina_Bool
-_start_delay_timer_cb(void *data)
-{
- Eo *eo_obj = data;
- EFL_ANIMATION_OBJECT_DATA_GET(eo_obj, pd);
-
- pd->start_delay_timer = NULL;
-
- _start(eo_obj, pd);
-
- return ECORE_CALLBACK_CANCEL;
-}
-
-EOLIAN static void
-_efl_animation_object_start(Eo *eo_obj,
- Efl_Animation_Object_Data *pd)
-{
- if (pd->start_delay_timer) return;
-
- if (pd->start_delay_time > 0.0)
- {
- pd->start_delay_timer = ecore_timer_add(pd->start_delay_time,
- _start_delay_timer_cb, eo_obj);
- return;
- }
-
- _start(eo_obj, pd);
-}
-
-EOLIAN static void
-_efl_animation_object_cancel(Eo *eo_obj,
- Efl_Animation_Object_Data *pd)
-{
- ecore_timer_del(pd->start_delay_timer);
- pd->start_delay_timer = NULL;
-
- pd->is_cancelled = EINA_TRUE;
- pd->is_ended = EINA_TRUE;
-
- if (pd->animator)
- {
- ecore_animator_del(pd->animator);
- pd->animator = NULL;
-
- //Reset the state of the target to the initial state
- if (!pd->keep_final_state)
- efl_animation_object_target_state_reset(eo_obj);
-
- efl_event_callback_call(eo_obj, EFL_ANIMATION_OBJECT_EVENT_ENDED, NULL);
- }
-
- if (pd->auto_del) efl_del(eo_obj);
-}
-
-EOLIAN static void
-_efl_animation_object_progress_set(Eo *eo_obj,
- Efl_Animation_Object_Data *pd EINA_UNUSED,
- double progress)
-{
- if ((progress < 0.0) || (progress > 1.0)) return;
-
- if (!pd->is_direction_forward)
- pd->progress = 1.0 - pd->progress;
-
- //Apply interpolator
- if (pd->interpolator)
- {
- pd->progress = efl_interpolator_interpolate(pd->interpolator,
- pd->progress);
- }
-
- Efl_Animation_Object_Running_Event_Info event_info;
- event_info.progress = progress;
-
- efl_event_callback_call(eo_obj, EFL_ANIMATION_OBJECT_EVENT_RUNNING,
- &event_info);
-}
-
-EOLIAN static void
-_efl_animation_object_pause(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Object_Data *pd)
-{
- if (!pd->is_started) return;
- if (pd->is_ended) return;
- if (pd->is_paused) return;
-
- pd->is_paused = EINA_TRUE;
-
- if (pd->start_delay_timer) return;
-
- ecore_animator_del(pd->animator);
- pd->animator = NULL;
-
- pd->time.pause_begin = ecore_loop_time_get();
-}
-
-EOLIAN static void
-_efl_animation_object_resume(Eo *eo_obj,
- Efl_Animation_Object_Data *pd)
-{
- if (!pd->is_started) return;
- if (pd->is_ended) return;
- if (!pd->is_paused) return;
-
- pd->is_paused = EINA_FALSE;
-
- if (pd->start_delay_timer) return;
-
- pd->paused_time += (ecore_loop_time_get() - pd->time.pause_begin);
-
- pd->animator = ecore_animator_add(_animator_cb, eo_obj);
-
- _animator_cb(eo_obj);
-}
-
-EOLIAN static Efl_Object *
-_efl_animation_object_efl_object_constructor(Eo *eo_obj,
- Efl_Animation_Object_Data *pd)
-{
- eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
-
- pd->time.begin = 0.0;
- pd->time.current = 0.0;
-
- pd->target = NULL;
- pd->target_state = (Target_State *) calloc(1, sizeof(Target_State));
-
- pd->progress = 0.0;
-
- pd->duration = 0.0;
-
- pd->repeat_mode = EFL_ANIMATION_OBJECT_REPEAT_MODE_RESTART;
- pd->repeat_count = 0;
-
- pd->auto_del = EINA_TRUE;
- pd->is_cancelled = EINA_FALSE;
- pd->keep_final_state = EINA_FALSE;
-
- return eo_obj;
-}
-
-EOLIAN static void
-_efl_animation_object_efl_object_destructor(Eo *eo_obj,
- Efl_Animation_Object_Data *pd)
-{
- if (pd->animator)
- {
- ecore_animator_del(pd->animator);
- pd->animator = NULL;
-
- //Reset the state of the target to the initial state
- if (!pd->keep_final_state)
- efl_animation_object_target_state_reset(eo_obj);
-
- efl_event_callback_call(eo_obj, EFL_ANIMATION_OBJECT_EVENT_ENDED, NULL);
- }
-
- if (pd->target)
- efl_event_callback_del(pd->target, EFL_EVENT_DEL, _target_del_cb, eo_obj);
-
- free(pd->target_state);
- pd->target_state = NULL;
-
- efl_destructor(efl_super(eo_obj, MY_CLASS));
-}
-
-/* Internal EO APIs */
-
-EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_target_set, EFL_FUNC_CALL(target), Efl_Canvas_Object *target);
-EOAPI EFL_FUNC_BODY_CONST(efl_animation_object_target_get, Efl_Canvas_Object *, NULL);
-
-EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_final_state_keep_set, EFL_FUNC_CALL(state_keep), Eina_Bool state_keep);
-EOAPI EFL_FUNC_BODY_CONST(efl_animation_object_final_state_keep_get, Eina_Bool, 0);
-
-EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_duration_set, EFL_FUNC_CALL(duration), double duration);
-EOAPI EFL_FUNC_BODY_CONST(efl_animation_object_duration_get, double, 0);
-
-EOAPI EFL_FUNC_BODY_CONST(efl_animation_object_total_duration_get, double, 0);
-
-EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_start_delay_set, EFL_FUNC_CALL(delay_time), double delay_time);
-EOAPI EFL_FUNC_BODY_CONST(efl_animation_object_start_delay_get, double, 0);
-
-EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_repeat_mode_set, EFL_FUNC_CALL(mode), Efl_Animation_Object_Repeat_Mode mode);
-EOAPI EFL_FUNC_BODY_CONST(efl_animation_object_repeat_mode_get, Efl_Animation_Object_Repeat_Mode, 0);
-
-EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_repeat_count_set, EFL_FUNC_CALL(count), int count);
-EOAPI EFL_FUNC_BODY_CONST(efl_animation_object_repeat_count_get, int, 0);
-
-EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_interpolator_set, EFL_FUNC_CALL(interpolator), Efl_Interpolator *interpolator);
-EOAPI EFL_FUNC_BODY_CONST(efl_animation_object_interpolator_get, Efl_Interpolator *, NULL);
-
-EOAPI EFL_VOID_FUNC_BODY(efl_animation_object_target_state_save);
-EOAPI EFL_VOID_FUNC_BODY(efl_animation_object_target_state_reset);
-EOAPI EFL_VOID_FUNC_BODY(efl_animation_object_target_map_reset);
-
-#define EFL_ANIMATION_OBJECT_EXTRA_OPS \
- EFL_OBJECT_OP_FUNC(efl_animation_object_target_set, _efl_animation_object_target_set), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_target_get, _efl_animation_object_target_get), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_final_state_keep_set, _efl_animation_object_final_state_keep_set), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_final_state_keep_get, _efl_animation_object_final_state_keep_get), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_duration_set, _efl_animation_object_duration_set), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_duration_get, _efl_animation_object_duration_get), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_total_duration_get, _efl_animation_object_total_duration_get), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_start_delay_set, _efl_animation_object_start_delay_set), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_start_delay_get, _efl_animation_object_start_delay_get), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_repeat_mode_set, _efl_animation_object_repeat_mode_set), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_repeat_mode_get, _efl_animation_object_repeat_mode_get), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_repeat_count_set, _efl_animation_object_repeat_count_set), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_repeat_count_get, _efl_animation_object_repeat_count_get), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_interpolator_set, _efl_animation_object_interpolator_set), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_interpolator_get, _efl_animation_object_interpolator_get), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_target_state_save, _efl_animation_object_target_state_save), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_target_state_reset, _efl_animation_object_target_state_reset), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_target_map_reset, _efl_animation_object_target_map_reset)
-
-EWAPI const Efl_Event_Description _EFL_ANIMATION_OBJECT_EVENT_PRE_STARTED =
- EFL_EVENT_DESCRIPTION("pre_started");
-
-#include "efl_animation_object.eo.c"
diff --git a/src/lib/evas/canvas/efl_animation_object.eo b/src/lib/evas/canvas/efl_animation_object.eo
deleted file mode 100644
index 2543982fa1..0000000000
--- a/src/lib/evas/canvas/efl_animation_object.eo
+++ /dev/null
@@ -1,46 +0,0 @@
-import efl_animation_types;
-
-class Efl.Animation.Object (Efl.Object)
-{
- [[Efl animation object class]]
- data: Efl_Animation_Object_Data;
- methods {
- @property auto_del {
- [[Auto delete property]]
- set {
- }
- get {
- }
- values {
- auto_del: bool; [[$true to delete animation object automatically when animation is finished or animation is cancelled, $false otherwise.]]
- }
- }
- start {
- [[Start animation.]]
- }
- cancel {
- [[Cancel animation.]]
- }
- pause {
- [[Pause animation.]]
- }
- resume {
- [[Resume animation.]]
- }
- progress_set @protected {
- [[Display the moment of animation according to the given progress.]]
- params {
- @in progress: double; [[The value between 0.0 and 1.0 which indicates the progress of the animation]]
- }
- }
- }
- implements {
- Efl.Object.constructor;
- Efl.Object.destructor;
- }
- events {
- started; [[Animation is started.]]
- running; [[Animation is running.]]
- ended; [[Animation is ended.]]
- }
-}
diff --git a/src/lib/evas/canvas/efl_animation_object_alpha.c b/src/lib/evas/canvas/efl_animation_object_alpha.c
deleted file mode 100644
index d98b0590c3..0000000000
--- a/src/lib/evas/canvas/efl_animation_object_alpha.c
+++ /dev/null
@@ -1,84 +0,0 @@
-#include "efl_animation_object_alpha_private.h"
-
-EOLIAN static void
-_efl_animation_object_alpha_alpha_set(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Object_Alpha_Data *pd,
- double from_alpha,
- double to_alpha)
-{
- pd->from.alpha = from_alpha;
- pd->to.alpha = to_alpha;
-}
-
-EOLIAN static void
-_efl_animation_object_alpha_alpha_get(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Object_Alpha_Data *pd,
- double *from_alpha,
- double *to_alpha)
-{
- if (from_alpha)
- *from_alpha = pd->from.alpha;
- if (to_alpha)
- *to_alpha = pd->to.alpha;
-}
-
-static void
-_progress_set(Eo *eo_obj, double progress)
-{
- EFL_ANIMATION_OBJECT_ALPHA_DATA_GET(eo_obj, pd);
-
- Efl_Canvas_Object *target = efl_animation_object_target_get(eo_obj);
- if (!target) return;
-
- double alpha
- = (pd->from.alpha * (1.0 - progress)) + (pd->to.alpha * progress);
-
- int r[4], g[4], b[4], a[4];
- int i;
- for (i = 0; i < 4; i++)
- efl_gfx_map_color_get(target, i, &r[i], &g[i], &b[i], &a[i]);
-
- for (i = 0; i < 4; i++)
- {
- r[i] = (int)(r[i] * alpha);
- g[i] = (int)(g[i] * alpha);
- b[i] = (int)(b[i] * alpha);
- a[i] = (int)(a[i] * alpha);
- efl_gfx_map_color_set(target, i, r[i], g[i], b[i], a[i]);
- }
-}
-
-EOLIAN static void
-_efl_animation_object_alpha_efl_animation_object_progress_set(Eo *eo_obj,
- Efl_Animation_Object_Alpha_Data *pd EINA_UNUSED,
- double progress)
-{
- if ((progress < 0.0) || (progress > 1.0)) return;
-
- _progress_set(eo_obj, progress);
-
- efl_animation_object_progress_set(efl_super(eo_obj, MY_CLASS), progress);
-}
-
-EOLIAN static Efl_Object *
-_efl_animation_object_alpha_efl_object_constructor(Eo *eo_obj,
- Efl_Animation_Object_Alpha_Data *pd)
-{
- eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
-
- pd->from.alpha = 1.0;
- pd->to.alpha = 1.0;
-
- return eo_obj;
-}
-
-/* Internal EO APIs */
-
-EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_alpha_set, EFL_FUNC_CALL(from_alpha, to_alpha), double from_alpha, double to_alpha);
-EOAPI EFL_VOID_FUNC_BODYV_CONST(efl_animation_object_alpha_get, EFL_FUNC_CALL(from_alpha, to_alpha), double *from_alpha, double *to_alpha);
-
-#define EFL_ANIMATION_OBJECT_ALPHA_EXTRA_OPS \
- EFL_OBJECT_OP_FUNC(efl_animation_object_alpha_set, _efl_animation_object_alpha_alpha_set), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_alpha_get, _efl_animation_object_alpha_alpha_get)
-
-#include "efl_animation_object_alpha.eo.c"
diff --git a/src/lib/evas/canvas/efl_animation_object_alpha.eo b/src/lib/evas/canvas/efl_animation_object_alpha.eo
deleted file mode 100644
index 8aa28b8c7b..0000000000
--- a/src/lib/evas/canvas/efl_animation_object_alpha.eo
+++ /dev/null
@@ -1,11 +0,0 @@
-import efl_animation_types;
-
-class Efl.Animation.Object.Alpha (Efl.Animation.Object)
-{
- [[Efl alpha animation object class]]
- data: Efl_Animation_Object_Alpha_Data;
- implements {
- Efl.Object.constructor;
- Efl.Animation.Object.progress_set;
- }
-}
diff --git a/src/lib/evas/canvas/efl_animation_object_alpha_private.h b/src/lib/evas/canvas/efl_animation_object_alpha_private.h
deleted file mode 100644
index 799edc1b66..0000000000
--- a/src/lib/evas/canvas/efl_animation_object_alpha_private.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#define EFL_ANIMATION_OBJECT_PROTECTED
-#define EFL_ANIMATION_OBJECT_ALPHA_PROTECTED
-
-#include "evas_common_private.h"
-
-#define MY_CLASS EFL_ANIMATION_OBJECT_ALPHA_CLASS
-#define MY_CLASS_NAME efl_class_name_get(MY_CLASS)
-
-#define MY_CLASS EFL_ANIMATION_OBJECT_ALPHA_CLASS
-#define MY_CLASS_NAME efl_class_name_get(MY_CLASS)
-
-#define EFL_ANIMATION_OBJECT_ALPHA_DATA_GET(o, pd) \
- Efl_Animation_Object_Alpha_Data *pd = efl_data_scope_get(o, EFL_ANIMATION_OBJECT_ALPHA_CLASS)
-
-typedef struct _Efl_Animation_Object_Alpha_Property
-{
- double alpha;
-} Efl_Animation_Object_Alpha_Property;
-
-typedef struct _Efl_Animation_Object_Alpha_Data
-{
- Efl_Animation_Object_Alpha_Property from;
- Efl_Animation_Object_Alpha_Property to;
-} Efl_Animation_Object_Alpha_Data;
diff --git a/src/lib/evas/canvas/efl_animation_object_group.c b/src/lib/evas/canvas/efl_animation_object_group.c
deleted file mode 100644
index 092ae02809..0000000000
--- a/src/lib/evas/canvas/efl_animation_object_group.c
+++ /dev/null
@@ -1,200 +0,0 @@
-#include "efl_animation_object_group_private.h"
-
-EOLIAN static void
-_efl_animation_object_group_object_add(Eo *eo_obj,
- Efl_Animation_Object_Group_Data *pd,
- Efl_Animation_Object *anim_obj)
-{
- if (!anim_obj) return;
-
- Efl_Canvas_Object *target = efl_animation_object_target_get(eo_obj);
- if (target)
- efl_animation_object_target_set(anim_obj, target);
-
- double duration = efl_animation_object_duration_get(eo_obj);
- /* if group animation object duration is available value, then the duration
- * is propagated to its child. */
- if (duration != EFL_ANIMATION_OBJECT_GROUP_DURATION_NONE)
- efl_animation_object_duration_set(anim_obj, duration);
-
- Eina_Bool state_keep = efl_animation_object_final_state_keep_get(eo_obj);
- efl_animation_object_final_state_keep_set(anim_obj, state_keep);
-
- pd->anim_objs = eina_list_append(pd->anim_objs, anim_obj);
-}
-
-EOLIAN static void
-_efl_animation_object_group_object_del(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Object_Group_Data *pd,
- Efl_Animation_Object *anim_obj)
-{
- if (!anim_obj) return;
-
- pd->anim_objs = eina_list_remove(pd->anim_objs, anim_obj);
-}
-
-EOLIAN static Eina_List *
-_efl_animation_object_group_objects_get(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Object_Group_Data *pd)
-{
- return pd->anim_objs;
-}
-
-EOLIAN static void
-_efl_animation_object_group_efl_animation_object_target_set(Eo *eo_obj,
- Efl_Animation_Object_Group_Data *pd,
- Efl_Canvas_Object *target)
-{
- Eina_List *l;
- Efl_Animation_Object *anim_obj;
-
- EINA_LIST_FOREACH(pd->anim_objs, l, anim_obj)
- {
- efl_animation_object_target_set(anim_obj, target);
- }
-
- efl_animation_object_target_set(efl_super(eo_obj, MY_CLASS), target);
-}
-
-EOLIAN static void
-_efl_animation_object_group_efl_animation_object_duration_set(Eo *eo_obj,
- Efl_Animation_Object_Group_Data *pd,
- double duration)
-{
- if (duration == EFL_ANIMATION_OBJECT_GROUP_DURATION_NONE) goto end;
-
- if (duration < 0.0) return;
-
- Eina_List *l;
- Efl_Animation_Object *anim_obj;
-
- EINA_LIST_FOREACH(pd->anim_objs, l, anim_obj)
- {
- efl_animation_object_duration_set(anim_obj, duration);
- }
-
-end:
- efl_animation_object_duration_set(efl_super(eo_obj, MY_CLASS), duration);
-}
-
-EOLIAN static void
-_efl_animation_object_group_efl_animation_object_final_state_keep_set(Eo *eo_obj,
- Efl_Animation_Object_Group_Data *pd,
- Eina_Bool state_keep)
-{
- Eina_List *l;
- Efl_Animation_Object *anim_obj;
-
- EINA_LIST_FOREACH(pd->anim_objs, l, anim_obj)
- {
- efl_animation_object_final_state_keep_set(anim_obj, state_keep);
- }
-
- efl_animation_object_final_state_keep_set(efl_super(eo_obj, MY_CLASS),
- state_keep);
-}
-
-EOLIAN static void
-_efl_animation_object_group_efl_animation_object_interpolator_set(Eo *eo_obj,
- Efl_Animation_Object_Group_Data *pd,
- Efl_Interpolator *interpolator)
-{
- Eina_List *l;
- Efl_Animation_Object *anim_obj;
-
- EINA_LIST_FOREACH(pd->anim_objs, l, anim_obj)
- {
- efl_animation_object_interpolator_set(anim_obj, interpolator);
- }
-
- efl_animation_object_interpolator_set(efl_super(eo_obj, MY_CLASS),
- interpolator);
-}
-
-EOLIAN static Efl_Object *
-_efl_animation_object_group_efl_object_constructor(Eo *eo_obj,
- Efl_Animation_Object_Group_Data *pd)
-{
- eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
-
- pd->anim_objs = NULL;
-
- //group animation object does not affect its child duration by default.
- efl_animation_object_duration_set(efl_super(eo_obj, MY_CLASS),
- EFL_ANIMATION_OBJECT_GROUP_DURATION_NONE);
-
- return eo_obj;
-}
-
-EOLIAN static void
-_efl_animation_object_group_efl_object_destructor(Eo *eo_obj,
- Efl_Animation_Object_Group_Data *pd)
-{
- Efl_Animation_Object *anim_obj;
-
- EINA_LIST_FREE(pd->anim_objs, anim_obj)
- efl_del(anim_obj);
-
- efl_destructor(efl_super(eo_obj, MY_CLASS));
-}
-
-EOLIAN static void
-_efl_animation_object_group_efl_animation_object_target_state_save(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Object_Group_Data *pd)
-{
- Eina_List *l;
- Efl_Animation_Object *anim_obj;
-
- EINA_LIST_FOREACH(pd->anim_objs, l, anim_obj)
- {
- efl_animation_object_target_state_save(anim_obj);
- }
-}
-
-EOLIAN static void
-_efl_animation_object_group_efl_animation_object_target_state_reset(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Object_Group_Data *pd)
-{
- Eina_List *l;
- Efl_Animation_Object *anim_obj;
-
- EINA_LIST_FOREACH(pd->anim_objs, l, anim_obj)
- {
- efl_animation_object_target_state_reset(anim_obj);
- }
-}
-
-EOLIAN static void
-_efl_animation_object_group_efl_animation_object_target_map_reset(Eo *eo_obj EINA_UNUSED,
- Efl_Animation_Object_Group_Data *pd)
-{
- Eina_List *l;
- Efl_Animation_Object *anim_obj;
-
- EINA_LIST_FOREACH(pd->anim_objs, l, anim_obj)
- {
- efl_animation_object_target_map_reset(anim_obj);
- }
-}
-
-/* Internal EO APIs */
-
-EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_group_object_add, EFL_FUNC_CALL(anim_obj), Efl_Animation_Object *anim_obj);
-
-EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_group_object_del, EFL_FUNC_CALL(anim_obj), Efl_Animation_Object *anim_obj);
-
-EOAPI EFL_FUNC_BODY(efl_animation_object_group_objects_get, Eina_List *, NULL);
-
-#define EFL_ANIMATION_OBJECT_GROUP_EXTRA_OPS \
- EFL_OBJECT_OP_FUNC(efl_animation_object_group_object_add, _efl_animation_object_group_object_add), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_group_object_del, _efl_animation_object_group_object_del), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_group_objects_get, _efl_animation_object_group_objects_get), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_target_set, _efl_animation_object_group_efl_animation_object_target_set), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_duration_set, _efl_animation_object_group_efl_animation_object_duration_set), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_final_state_keep_set, _efl_animation_object_group_efl_animation_object_final_state_keep_set), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_interpolator_set, _efl_animation_object_group_efl_animation_object_interpolator_set), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_target_state_save, _efl_animation_object_group_efl_animation_object_target_state_save), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_target_state_reset, _efl_animation_object_group_efl_animation_object_target_state_reset), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_target_map_reset, _efl_animation_object_group_efl_animation_object_target_map_reset)
-
-#include "efl_animation_object_group.eo.c"
diff --git a/src/lib/evas/canvas/efl_animation_object_group.eo b/src/lib/evas/canvas/efl_animation_object_group.eo
deleted file mode 100644
index 1ad80394f0..0000000000
--- a/src/lib/evas/canvas/efl_animation_object_group.eo
+++ /dev/null
@@ -1,11 +0,0 @@
-import efl_animation_types;
-
-abstract Efl.Animation.Object.Group (Efl.Animation.Object)
-{
- [[Efl group animation object abstract class]]
- data: Efl_Animation_Object_Group_Data;
- implements {
- Efl.Object.constructor;
- Efl.Object.destructor;
- }
-}
diff --git a/src/lib/evas/canvas/efl_animation_object_group_parallel.c b/src/lib/evas/canvas/efl_animation_object_group_parallel.c
deleted file mode 100644
index 3c9d928d7b..0000000000
--- a/src/lib/evas/canvas/efl_animation_object_group_parallel.c
+++ /dev/null
@@ -1,256 +0,0 @@
-#include "efl_animation_object_group_parallel_private.h"
-
-/* Add member object data and append the data to the member object data list.
- * The member object data contains the repeated count of the member object.
- */
-static void
-_member_anim_obj_data_add(Efl_Animation_Object_Group_Parallel_Data *pd,
- Efl_Animation_Object *anim_obj,
- int repeated_count)
-{
- Member_Object_Data *member_anim_obj_data =
- calloc(1, sizeof(Member_Object_Data));
-
- if (!member_anim_obj_data) return;
-
- member_anim_obj_data->anim_obj = anim_obj;
- member_anim_obj_data->repeated_count = repeated_count;
-
- pd->member_anim_obj_data_list =
- eina_list_append(pd->member_anim_obj_data_list, member_anim_obj_data);
-}
-
-/* Find the member object data which contains the repeated count of the member
- * object. */
-static Member_Object_Data *
-_member_anim_obj_data_find(Efl_Animation_Object_Group_Parallel_Data *pd,
- Efl_Animation_Object *anim_obj)
-{
- Eina_List *l;
- Member_Object_Data *member_anim_obj_data = NULL;
- EINA_LIST_FOREACH(pd->member_anim_obj_data_list, l, member_anim_obj_data)
- {
- if (member_anim_obj_data->anim_obj == anim_obj)
- break;
- }
-
- return member_anim_obj_data;
-}
-
-/* Delete member object data and remove the data from the member object data
- * list.
- * The member object data contains the repeated count of the member object.
- */
-static void
-_member_anim_obj_data_del(Efl_Animation_Object_Group_Parallel_Data *pd,
- Efl_Animation_Object *anim_obj)
-{
- Member_Object_Data *member_anim_obj_data = _member_anim_obj_data_find(pd, anim_obj);
- if (member_anim_obj_data)
- {
- pd->member_anim_obj_data_list =
- eina_list_remove(pd->member_anim_obj_data_list, member_anim_obj_data);
- free(member_anim_obj_data);
- }
-}
-
-EOLIAN static void
-_efl_animation_object_group_parallel_efl_animation_object_group_object_add(Eo *eo_obj,
- Efl_Animation_Object_Group_Parallel_Data *pd,
- Efl_Animation_Object *anim_obj)
-{
- if (!anim_obj) return;
-
- efl_animation_object_group_object_add(efl_super(eo_obj, MY_CLASS), anim_obj);
-
- /* Add member object data and append the data to the member object data
- * list. */
- _member_anim_obj_data_add(pd, anim_obj, 0);
-}
-
-EOLIAN static void
-_efl_animation_object_group_parallel_efl_animation_object_group_object_del(Eo *eo_obj,
- Efl_Animation_Object_Group_Parallel_Data *pd EINA_UNUSED,
- Efl_Animation_Object *anim_obj)
-{
- if (!anim_obj) return;
-
- efl_animation_object_group_object_del(efl_super(eo_obj, MY_CLASS), anim_obj);
-
- /* Delete member object data and remove the data from the member object
- * data list. */
- _member_anim_obj_data_del(pd, anim_obj);
-}
-
-EOLIAN static double
-_efl_animation_object_group_parallel_efl_animation_object_total_duration_get(Eo *eo_obj,
- Efl_Animation_Object_Group_Parallel_Data *pd EINA_UNUSED)
-{
- Eina_List *anim_objs = efl_animation_object_group_objects_get(eo_obj);
- if (!anim_objs) return 0.0;
-
- double total_duration = 0.0;
- Eina_List *l;
- Efl_Animation *anim_obj;
- EINA_LIST_FOREACH(anim_objs, l, anim_obj)
- {
- double child_total_duration =
- efl_animation_object_total_duration_get(anim_obj);
-
- double start_delay = efl_animation_object_start_delay_get(anim_obj);
- if (start_delay > 0.0)
- child_total_duration += start_delay;
-
- int child_repeat_count =
- efl_animation_object_repeat_count_get(anim_obj);
- if (child_repeat_count > 0)
- child_total_duration *= (child_repeat_count + 1);
-
- if (child_total_duration > total_duration)
- total_duration = child_total_duration;
- }
- return total_duration;
-}
-
-//Set how many times the given object has been repeated.
-static void
-_repeated_count_set(Efl_Animation_Object_Group_Parallel_Data *pd,
- Efl_Animation_Object *anim_obj,
- int repeated_count)
-{
-
- Member_Object_Data *member_anim_obj_data =
- _member_anim_obj_data_find(pd, anim_obj);
- if (!member_anim_obj_data) return;
-
- member_anim_obj_data->repeated_count = repeated_count;
-}
-
-//Get how many times the given object has been repeated.
-static int
-_repeated_count_get(Efl_Animation_Object_Group_Parallel_Data *pd,
- Efl_Animation_Object *anim_obj)
-{
- Member_Object_Data *member_anim_obj_data =
- _member_anim_obj_data_find(pd, anim_obj);
- if (!member_anim_obj_data) return 0;
-
- return member_anim_obj_data->repeated_count;
-}
-
-EOLIAN static void
-_efl_animation_object_group_parallel_efl_animation_object_progress_set(Eo *eo_obj,
- Efl_Animation_Object_Group_Parallel_Data *pd,
- double progress)
-{
- if ((progress < 0.0) || (progress > 1.0)) return;
-
- Eina_List *anim_objs = efl_animation_object_group_objects_get(eo_obj);
- if (!anim_objs) return;
-
- double group_total_duration =
- efl_animation_object_total_duration_get(eo_obj);
-
- double elapsed_time = progress * group_total_duration;
-
- Eina_List *l;
- Efl_Animation_Object *anim_obj;
- EINA_LIST_FOREACH(anim_objs, l, anim_obj)
- {
- double total_duration =
- efl_animation_object_total_duration_get(anim_obj);
- double start_delay = efl_animation_object_start_delay_get(anim_obj);
- double anim_obj_progress;
-
- Eina_Bool start_repeat = EINA_FALSE;
-
- if (total_duration == 0.0)
- anim_obj_progress = 1.0;
- else
- {
- double elapsed_time_without_delay;
-
- //If object is repeated, then recalculate progress.
- int repeated_count = _repeated_count_get(pd, anim_obj);
- if (repeated_count > 0)
- elapsed_time_without_delay =
- (elapsed_time - ((total_duration + start_delay) * repeated_count)) - start_delay;
- else
- elapsed_time_without_delay = elapsed_time - start_delay;
-
- //Object should not start to wait for start delay time.
- if (elapsed_time_without_delay < 0.0) continue;
-
- anim_obj_progress = elapsed_time_without_delay / total_duration;
-
- if (anim_obj_progress > 1.0)
- anim_obj_progress = 1.0;
-
- //Animation has been finished.
- if (anim_obj_progress == 1.0)
- {
- /* If object is finished and it should be repeated, then
- * increate the repeated count to recalculate progress. */
- int repeat_count =
- efl_animation_object_repeat_count_get(anim_obj);
- if (repeat_count > 0)
- {
- repeated_count = _repeated_count_get(pd, anim_obj);
- if (repeated_count < repeat_count)
- {
- repeated_count++;
- _repeated_count_set(pd, anim_obj, repeated_count);
-
- start_repeat = EINA_TRUE;
- }
- }
- }
- }
-
- /* If object is repeated with reverse mode, then the progress value
- * should be modified as (1.0 - progress). */
- Efl_Animation_Object_Repeat_Mode repeat_mode
- = efl_animation_object_repeat_mode_get(anim_obj);
- if (repeat_mode == EFL_ANIMATION_OBJECT_REPEAT_MODE_REVERSE)
- {
- int repeated_count = _repeated_count_get(pd, anim_obj);
- if (repeated_count > 0)
- {
- if ((((repeated_count % 2) == 1) && (!start_repeat)) ||
- (((repeated_count % 2) == 0) && (start_repeat)))
- anim_obj_progress = 1.0 - anim_obj_progress;
- }
- }
-
- //Apply interpolator
- Efl_Interpolator *group_interp =
- efl_animation_object_interpolator_get(eo_obj);
-
- /* If group interpolator exists, then the group interpolator has been
- * already applied. So it is not needed to apply interpolator again. */
- if (!group_interp)
- {
- Efl_Interpolator *interpolator =
- efl_animation_object_interpolator_get(anim_obj);
- if (interpolator)
- {
- anim_obj_progress =
- efl_interpolator_interpolate(interpolator,
- anim_obj_progress);
- }
- }
-
- efl_animation_object_progress_set(anim_obj, anim_obj_progress);
- }
-
- efl_animation_object_progress_set(efl_super(eo_obj, MY_CLASS), progress);
-}
-
-/* Internal EO APIs */
-
-#define EFL_ANIMATION_OBJECT_GROUP_PARALLEL_EXTRA_OPS \
- EFL_OBJECT_OP_FUNC(efl_animation_object_group_object_add, _efl_animation_object_group_parallel_efl_animation_object_group_object_add), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_group_object_del, _efl_animation_object_group_parallel_efl_animation_object_group_object_del), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_total_duration_get, _efl_animation_object_group_parallel_efl_animation_object_total_duration_get)
-
-#include "efl_animation_object_group_parallel.eo.c"
diff --git a/src/lib/evas/canvas/efl_animation_object_group_parallel.eo b/src/lib/evas/canvas/efl_animation_object_group_parallel.eo
deleted file mode 100644
index 50609f8344..0000000000
--- a/src/lib/evas/canvas/efl_animation_object_group_parallel.eo
+++ /dev/null
@@ -1,12 +0,0 @@
-import efl_animation_types;
-
-class Efl.Animation.Object.Group.Parallel (Efl.Animation.Object.Group)
-{
- [[Efl group parallel animation object class]]
- data: Efl_Animation_Object_Group_Parallel_Data;
- methods {
- }
- implements {
- Efl.Animation.Object.progress_set;
- }
-}
diff --git a/src/lib/evas/canvas/efl_animation_object_group_parallel_private.h b/src/lib/evas/canvas/efl_animation_object_group_parallel_private.h
deleted file mode 100644
index e0026ec6f4..0000000000
--- a/src/lib/evas/canvas/efl_animation_object_group_parallel_private.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#define EFL_ANIMATION_OBJECT_PROTECTED
-
-#include "evas_common_private.h"
-#include <Ecore.h>
-
-#define MY_CLASS EFL_ANIMATION_OBJECT_GROUP_PARALLEL_CLASS
-#define MY_CLASS_NAME efl_class_name_get(MY_CLASS)
-
-#define EFL_ANIMATION_OBJECT_GROUP_PARALLEL_DATA_GET(o, pd) \
- Efl_Animation_Object_Group_Parallel_Data *pd = efl_data_scope_get(o, EFL_ANIMATION_OBJECT_GROUP_PARALLEL_CLASS)
-
-typedef struct _Member_Object_Data
-{
- Efl_Animation_Object *anim_obj;
-
- int repeated_count; /* How many times object has been
- * repeated. */
-} Member_Object_Data;
-
-typedef struct _Efl_Animation_Object_Group_Parallel_Data
-{
- Eina_List *member_anim_obj_data_list; //List of Member_Object_Data
-} Efl_Animation_Object_Group_Parallel_Data;
diff --git a/src/lib/evas/canvas/efl_animation_object_group_private.h b/src/lib/evas/canvas/efl_animation_object_group_private.h
deleted file mode 100644
index 5342e2c22f..0000000000
--- a/src/lib/evas/canvas/efl_animation_object_group_private.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#define EFL_ANIMATION_OBJECT_PROTECTED
-
-#include "evas_common_private.h"
-#include <Ecore.h>
-
-#define MY_CLASS EFL_ANIMATION_OBJECT_GROUP_CLASS
-#define MY_CLASS_NAME efl_class_name_get(MY_CLASS)
-
-#define EFL_ANIMATION_OBJECT_GROUP_DATA_GET(o, pd) \
- Efl_Animation_Object_Group_Data *pd = efl_data_scope_get(o, EFL_ANIMATION_OBJECT_GROUP_CLASS)
-
-typedef struct _Efl_Animation_Object_Group_Data
-{
- Eina_List *anim_objs;
-} Efl_Animation_Object_Group_Data;
diff --git a/src/lib/evas/canvas/efl_animation_object_group_sequential.c b/src/lib/evas/canvas/efl_animation_object_group_sequential.c
deleted file mode 100644
index bc171a830d..0000000000
--- a/src/lib/evas/canvas/efl_animation_object_group_sequential.c
+++ /dev/null
@@ -1,269 +0,0 @@
-#include "efl_animation_object_group_sequential_private.h"
-
-/* Add member object data and append the data to the member object data list.
- * The member object data contains the repeated count of the member object.
- */
-static void
-_member_anim_obj_data_add(Efl_Animation_Object_Group_Sequential_Data *pd,
- Efl_Animation_Object *anim_obj,
- int repeated_count)
-{
- Member_Object_Data *member_anim_obj_data =
- calloc(1, sizeof(Member_Object_Data));
-
- if (!member_anim_obj_data) return;
-
- member_anim_obj_data->anim_obj = anim_obj;
- member_anim_obj_data->repeated_count = repeated_count;
-
- pd->member_anim_obj_data_list =
- eina_list_append(pd->member_anim_obj_data_list, member_anim_obj_data);
-}
-
-/* Find the member object data which contains the repeated count of the member
- * object. */
-static Member_Object_Data *
-_member_anim_obj_data_find(Efl_Animation_Object_Group_Sequential_Data *pd,
- Efl_Animation_Object *anim_obj)
-{
- Eina_List *l;
- Member_Object_Data *member_anim_obj_data = NULL;
- EINA_LIST_FOREACH(pd->member_anim_obj_data_list, l, member_anim_obj_data)
- {
- if (member_anim_obj_data->anim_obj == anim_obj)
- break;
- }
-
- return member_anim_obj_data;
-}
-
-/* Delete member object data and remove the data from the member object data
- * list.
- * The member object data contains the repeated count of the member object.
- */
-static void
-_member_anim_obj_data_del(Efl_Animation_Object_Group_Sequential_Data *pd,
- Efl_Animation_Object *anim_obj)
-{
- Member_Object_Data *member_anim_obj_data =
- _member_anim_obj_data_find(pd, anim_obj);
- if (member_anim_obj_data)
- {
- pd->member_anim_obj_data_list =
- eina_list_remove(pd->member_anim_obj_data_list,
- member_anim_obj_data);
- free(member_anim_obj_data);
- }
-}
-
-EOLIAN static void
-_efl_animation_object_group_sequential_efl_animation_object_group_object_add(Eo *eo_obj,
- Efl_Animation_Object_Group_Sequential_Data *pd EINA_UNUSED,
- Efl_Animation_Object *anim_obj)
-{
- if (!anim_obj) return;
-
- efl_animation_object_group_object_add(efl_super(eo_obj, MY_CLASS), anim_obj);
-
- /* Add member object data and append the data to the member object data
- * list. */
- _member_anim_obj_data_add(pd, anim_obj, 0);
-}
-
-EOLIAN static void
-_efl_animation_object_group_sequential_efl_animation_object_group_object_del(Eo *eo_obj,
- Efl_Animation_Object_Group_Sequential_Data *pd EINA_UNUSED,
- Efl_Animation_Object *anim_obj)
-{
- if (!anim_obj) return;
-
- efl_animation_object_group_object_del(efl_super(eo_obj, MY_CLASS), anim_obj);
-
- /* Delete member object data and remove the data from the member object
- * data list. */
- _member_anim_obj_data_del(pd, anim_obj);
-}
-
-EOLIAN static double
-_efl_animation_object_group_sequential_efl_animation_object_total_duration_get(Eo *eo_obj,
- Efl_Animation_Object_Group_Sequential_Data *pd EINA_UNUSED)
-{
- Eina_List *anim_objs = efl_animation_object_group_objects_get(eo_obj);
- if (!anim_objs) return 0.0;
-
- double total_duration = 0.0;
- Eina_List *l;
- Efl_Animation *anim_obj;
- EINA_LIST_FOREACH(anim_objs, l, anim_obj)
- {
- double child_total_duration =
- efl_animation_object_total_duration_get(anim_obj);
-
- double start_delay = efl_animation_object_start_delay_get(anim_obj);
- if (start_delay > 0.0)
- child_total_duration += start_delay;
-
- int child_repeat_count =
- efl_animation_object_repeat_count_get(anim_obj);
- if (child_repeat_count > 0)
- child_total_duration *= (child_repeat_count + 1);
-
- total_duration += child_total_duration;
- }
- return total_duration;
-}
-
-//Set how many times the given object has been repeated.
-static void
-_repeated_count_set(Efl_Animation_Object_Group_Sequential_Data *pd,
- Efl_Animation_Object *anim_obj,
- int repeated_count)
-{
-
- Member_Object_Data *member_anim_obj_data = _member_anim_obj_data_find(pd, anim_obj);
- if (!member_anim_obj_data) return;
-
- member_anim_obj_data->repeated_count = repeated_count;
-}
-
-//Get how many times the given object has been repeated.
-static int
-_repeated_count_get(Efl_Animation_Object_Group_Sequential_Data *pd,
- Efl_Animation_Object *anim_obj)
-{
- Member_Object_Data *member_anim_obj_data =
- _member_anim_obj_data_find(pd, anim_obj);
- if (!member_anim_obj_data) return 0;
-
- return member_anim_obj_data->repeated_count;
-}
-
-EOLIAN static void
-_efl_animation_object_group_sequential_efl_animation_object_progress_set(Eo *eo_obj,
- Efl_Animation_Object_Group_Sequential_Data *pd EINA_UNUSED,
- double progress)
-{
- if ((progress < 0.0) || (progress > 1.0)) return;
-
- Eina_List *anim_objs = efl_animation_object_group_objects_get(eo_obj);
- if (!anim_objs) return;
-
- double group_total_duration =
- efl_animation_object_total_duration_get(eo_obj);
-
- double elapsed_time = progress * group_total_duration;
-
- double sum_prev_total_duration = 0.0;
-
- Eina_List *l;
- Efl_Animation_Object *anim_obj;
- EINA_LIST_FOREACH(anim_objs, l, anim_obj)
- {
- //Current animation object does not start
- if (sum_prev_total_duration > elapsed_time) break;
-
- //Sum the current total duration
- double total_duration =
- efl_animation_object_total_duration_get(anim_obj);
- double start_delay = efl_animation_object_start_delay_get(anim_obj);
- double anim_obj_progress;
-
- Eina_Bool start_repeat = EINA_FALSE;
-
- if (total_duration == 0.0)
- anim_obj_progress = 1.0;
- else
- {
- //If object is repeated, then recalculate progress.
- int repeated_count = _repeated_count_get(pd, anim_obj);
- if (repeated_count > 0)
- sum_prev_total_duration +=
- ((total_duration + start_delay) * repeated_count);
-
- double elapsed_time_without_delay =
- elapsed_time - sum_prev_total_duration - start_delay;
-
- //Object should not start to wait for start delay time.
- if (elapsed_time_without_delay < 0.0) break;
-
- anim_obj_progress = elapsed_time_without_delay / total_duration;
-
- if (anim_obj_progress > 1.0)
- anim_obj_progress = 1.0;
-
- //Animation has been finished.
- if (anim_obj_progress == 1.0)
- {
- /* If object is finished and it should be repeated, then
- * increate the repeated count to recalculate progress. */
- int repeat_count =
- efl_animation_object_repeat_count_get(anim_obj);
- if (repeat_count > 0)
- {
- repeated_count = _repeated_count_get(pd, anim_obj);
- if (repeated_count < repeat_count)
- {
- repeated_count++;
- _repeated_count_set(pd, anim_obj, repeated_count);
-
- start_repeat = EINA_TRUE;
- }
- }
- }
- }
-
- /* Update the sum of the previous objects' total durations and start
- * delays */
- sum_prev_total_duration += (total_duration + start_delay);
-
- if ((anim_obj_progress == 1.0) && (!start_repeat) &&
- (!efl_animation_object_final_state_keep_get(anim_obj)))
- continue;
-
- /* If object is repeated with reverse mode, then the progress value
- * should be modified as (1.0 - progress). */
- Efl_Animation_Object_Repeat_Mode repeat_mode
- = efl_animation_object_repeat_mode_get(anim_obj);
- if (repeat_mode == EFL_ANIMATION_OBJECT_REPEAT_MODE_REVERSE)
- {
- int repeated_count = _repeated_count_get(pd, anim_obj);
- if (repeated_count > 0)
- {
- if ((((repeated_count % 2) == 1) && (!start_repeat)) ||
- (((repeated_count % 2) == 0) && (start_repeat)))
- anim_obj_progress = 1.0 - anim_obj_progress;
- }
- }
-
- //Apply interpolator
- Efl_Interpolator *group_interp =
- efl_animation_object_interpolator_get(eo_obj);
-
- /* If group interpolator exists, then the group interpolator has been
- * already applied. So it is not needed to apply interpolator again. */
- if (!group_interp)
- {
- Efl_Interpolator *interpolator =
- efl_animation_object_interpolator_get(anim_obj);
- if (interpolator)
- {
- anim_obj_progress =
- efl_interpolator_interpolate(interpolator,
- anim_obj_progress);
- }
- }
-
- efl_animation_object_progress_set(anim_obj, anim_obj_progress);
- }
-
- efl_animation_object_progress_set(efl_super(eo_obj, MY_CLASS), progress);
-}
-
-/* Internal EO APIs */
-
-#define EFL_ANIMATION_OBJECT_GROUP_SEQUENTIAL_EXTRA_OPS \
- EFL_OBJECT_OP_FUNC(efl_animation_object_group_object_add, _efl_animation_object_group_sequential_efl_animation_object_group_object_add), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_group_object_del, _efl_animation_object_group_sequential_efl_animation_object_group_object_del), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_total_duration_get, _efl_animation_object_group_sequential_efl_animation_object_total_duration_get)
-
-#include "efl_animation_object_group_sequential.eo.c"
diff --git a/src/lib/evas/canvas/efl_animation_object_group_sequential.eo b/src/lib/evas/canvas/efl_animation_object_group_sequential.eo
deleted file mode 100644
index d32841bfb9..0000000000
--- a/src/lib/evas/canvas/efl_animation_object_group_sequential.eo
+++ /dev/null
@@ -1,12 +0,0 @@
-import efl_animation_types;
-
-class Efl.Animation.Object.Group.Sequential (Efl.Animation.Object.Group)
-{
- [[Efl group sequential animation object class]]
- data: Efl_Animation_Object_Group_Sequential_Data;
- methods {
- }
- implements {
- Efl.Animation.Object.progress_set;
- }
-}
diff --git a/src/lib/evas/canvas/efl_animation_object_group_sequential_private.h b/src/lib/evas/canvas/efl_animation_object_group_sequential_private.h
deleted file mode 100644
index 2c8515a68c..0000000000
--- a/src/lib/evas/canvas/efl_animation_object_group_sequential_private.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#define EFL_ANIMATION_OBJECT_PROTECTED
-
-#include "evas_common_private.h"
-#include <Ecore.h>
-
-#define MY_CLASS EFL_ANIMATION_OBJECT_GROUP_SEQUENTIAL_CLASS
-#define MY_CLASS_NAME efl_class_name_get(MY_CLASS)
-
-#define EFL_ANIMATION_OBJECT_GROUP_SEQUENTIAL_DATA_GET(o, pd) \
- Efl_Animation_Object_Group_Sequential_Data *pd = efl_data_scope_get(o, EFL_ANIMATION_OBJECT_GROUP_SEQUENTIAL_CLASS)
-
-typedef struct _Member_Object_Data
-{
- Efl_Animation_Object *anim_obj;
-
- int repeated_count; /* How many times object has been
- * repeated. */
-} Member_Object_Data;
-
-typedef struct _Efl_Animation_Object_Group_Sequential_Data
-{
- Eina_List *member_anim_obj_data_list; //List of Member_Object_Data
-} Efl_Animation_Object_Group_Sequential_Data;
diff --git a/src/lib/evas/canvas/efl_animation_object_private.h b/src/lib/evas/canvas/efl_animation_object_private.h
deleted file mode 100644
index 27e9d13ea7..0000000000
--- a/src/lib/evas/canvas/efl_animation_object_private.h
+++ /dev/null
@@ -1,56 +0,0 @@
-#define EFL_ANIMATION_OBJECT_PROTECTED
-
-#include "evas_common_private.h"
-#include <Ecore.h>
-
-#define MY_CLASS EFL_ANIMATION_OBJECT_CLASS
-#define MY_CLASS_NAME efl_class_name_get(MY_CLASS)
-
-typedef struct _Target_State
-{
- Evas_Coord x, y, w, h;
- int r, g, b, a;
-
- Evas_Map *map;
- Eina_Bool enable_map : 1;
-} Target_State;
-
-typedef struct _Efl_Animation_Object_Data
-{
- Ecore_Animator *animator;
-
- Ecore_Timer *start_delay_timer;
- double start_delay_time;
-
- struct {
- double begin;
- double current;
- double pause_begin;
- } time;
-
- Efl_Canvas_Object *target;
- Target_State *target_state;
-
- double progress;
-
- double duration;
- double paused_time;
-
- Efl_Animation_Object_Repeat_Mode repeat_mode;
- int repeat_count;
- int remaining_repeat_count;
-
- Efl_Interpolator *interpolator;
-
- Eina_Bool auto_del : 1;
- Eina_Bool is_started : 1;
- Eina_Bool is_cancelled : 1;
- Eina_Bool is_ended : 1;
- Eina_Bool is_paused : 1;
- Eina_Bool keep_final_state : 1;
- Eina_Bool is_direction_forward : 1;
- Eina_Bool is_direction_changed : 1;
-} Efl_Animation_Object_Data;
-
-#define EFL_ANIMATION_OBJECT_DATA_GET(o, pd) \
- Efl_Animation_Object_Data *pd = efl_data_scope_get(o, EFL_ANIMATION_OBJECT_CLASS)
diff --git a/src/lib/evas/canvas/efl_animation_object_rotate.c b/src/lib/evas/canvas/efl_animation_object_rotate.c
deleted file mode 100644
index 65972d090d..0000000000
--- a/src/lib/evas/canvas/efl_animation_object_rotate.c
+++ /dev/null
@@ -1,243 +0,0 @@
-#include "efl_animation_object_rotate_private.h"
-
-EOLIAN static void
-_efl_animation_object_rotate_rotate_set(Eo *eo_obj,
- Efl_Animation_Object_Rotate_Data *pd,
- double from_degree,
- double to_degree,
- Efl_Canvas_Object *pivot,
- double cx,
- double cy)
-{
- pd->from.degree = from_degree;
- pd->to.degree = to_degree;
-
- pd->rel_pivot.obj = pivot;
- pd->rel_pivot.cx = cx;
- pd->rel_pivot.cy = cy;
-
- //Update absolute pivot based on relative pivot
- Evas_Coord x = 0;
- Evas_Coord y = 0;
- Evas_Coord w = 0;
- Evas_Coord h = 0;
-
- if (pivot)
- evas_object_geometry_get(pivot, &x, &y, &w, &h);
- else
- {
- Efl_Canvas_Object *target = efl_animation_object_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, &w, &h);
- }
-
- pd->abs_pivot.cx = x + (w * cx);
- pd->abs_pivot.cy = y + (h * cy);
-
- pd->use_rel_pivot = EINA_TRUE;
-}
-
-EOLIAN static void
-_efl_animation_object_rotate_rotate_get(Eo *eo_obj,
- Efl_Animation_Object_Rotate_Data *pd,
- double *from_degree,
- double *to_degree,
- Efl_Canvas_Object **pivot,
- double *cx,
- double *cy)
-{
- //Update relative pivot based on absolute pivot
- if (!pd->use_rel_pivot)
- {
- Evas_Coord x = 0;
- Evas_Coord y = 0;
- Evas_Coord w = 0;
- Evas_Coord h = 0;
-
- Efl_Canvas_Object *target = efl_animation_object_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, &w, &h);
-
- if (w != 0)
- pd->rel_pivot.cx = (double)(pd->abs_pivot.cx - x) / w;
- else
- pd->rel_pivot.cx = 0.0;
-
- if (h != 0)
- pd->rel_pivot.cy = (double)(pd->abs_pivot.cy - y) / h;
- else
- pd->rel_pivot.cy = 0.0;
- }
-
- if (from_degree)
- *from_degree = pd->from.degree;
-
- if (to_degree)
- *to_degree = pd->to.degree;
-
- if (pivot)
- *pivot = pd->rel_pivot.obj;
-
- if (cx)
- *cx = pd->rel_pivot.cx;
-
- if (cy)
- *cy = pd->rel_pivot.cy;
-}
-
-EOLIAN static void
-_efl_animation_object_rotate_rotate_absolute_set(Eo *eo_obj,
- Efl_Animation_Object_Rotate_Data *pd,
- double from_degree,
- double to_degree,
- Evas_Coord cx,
- Evas_Coord cy)
-{
- pd->from.degree = from_degree;
- pd->to.degree = to_degree;
-
- pd->abs_pivot.cx = cx;
- pd->abs_pivot.cy = cy;
-
- //Update relative pivot based on absolute pivot
- Evas_Coord x = 0;
- Evas_Coord y = 0;
- Evas_Coord w = 0;
- Evas_Coord h = 0;
-
- Efl_Canvas_Object *target = efl_animation_object_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, &w, &h);
-
- pd->rel_pivot.obj = NULL;
-
- if (w != 0)
- pd->rel_pivot.cx = (double)(cx - x) / w;
- else
- pd->rel_pivot.cx = 0.0;
-
- if (h != 0)
- pd->rel_pivot.cy = (double)(cy - y) / h;
- else
- pd->rel_pivot.cy = 0.0;
-
- pd->use_rel_pivot = EINA_FALSE;
-}
-
-EOLIAN static void
-_efl_animation_object_rotate_rotate_absolute_get(Eo *eo_obj,
- Efl_Animation_Object_Rotate_Data *pd,
- double *from_degree,
- double *to_degree,
- Evas_Coord *cx,
- Evas_Coord *cy)
-{
- //Update absolute pivot based on relative pivot
- if (pd->use_rel_pivot)
- {
- Evas_Coord x = 0;
- Evas_Coord y = 0;
- Evas_Coord w = 0;
- Evas_Coord h = 0;
-
- if (pd->rel_pivot.obj)
- evas_object_geometry_get(pd->rel_pivot.obj, &x, &y, &w, &h);
- else
- {
- Efl_Canvas_Object *target
- = efl_animation_object_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, &w, &h);
- }
-
- pd->abs_pivot.cx = x + (w * pd->rel_pivot.cx);
- pd->abs_pivot.cy = y + (h * pd->rel_pivot.cy);
- }
-
- if (from_degree)
- *from_degree = pd->from.degree;
-
- if (to_degree)
- *to_degree = pd->to.degree;
-
- if (cx)
- *cx = pd->abs_pivot.cx;
-
- if (cy)
- *cy = pd->abs_pivot.cy;
-}
-
-static void
-_progress_set(Eo *eo_obj, double progress)
-{
- EFL_ANIMATION_OBJECT_ROTATE_DATA_GET(eo_obj, pd);
-
- Efl_Canvas_Object *target = efl_animation_object_target_get(eo_obj);
- if (!target) return;
-
- double degree =
- (pd->from.degree * (1.0 - progress)) + (pd->to.degree * progress);
-
- if (pd->use_rel_pivot)
- {
- efl_gfx_map_rotate(target,
- degree,
- pd->rel_pivot.obj,
- pd->rel_pivot.cx, pd->rel_pivot.cy);
- }
- else
- {
- efl_gfx_map_rotate_absolute(target,
- degree,
- pd->abs_pivot.cx, pd->abs_pivot.cy);
- }
-}
-
-EOLIAN static void
-_efl_animation_object_rotate_efl_animation_object_progress_set(Eo *eo_obj,
- Efl_Animation_Object_Rotate_Data *pd EINA_UNUSED,
- double progress)
-{
- if ((progress < 0.0) || (progress > 1.0)) return;
-
- _progress_set(eo_obj, progress);
-
- efl_animation_object_progress_set(efl_super(eo_obj, MY_CLASS), progress);
-}
-
-EOLIAN static Efl_Object *
-_efl_animation_object_rotate_efl_object_constructor(Eo *eo_obj,
- Efl_Animation_Object_Rotate_Data *pd)
-{
- eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
-
- pd->from.degree = 0.0;
- pd->to.degree = 0.0;
-
- pd->rel_pivot.obj = NULL;
- pd->rel_pivot.cx = 0.5;
- pd->rel_pivot.cy = 0.5;
-
- pd->abs_pivot.cx = 0;
- pd->abs_pivot.cy = 0;
-
- pd->use_rel_pivot = EINA_TRUE;
-
- return eo_obj;
-}
-
-/* Internal EO APIs */
-
-EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_rotate_set, EFL_FUNC_CALL(from_degree, to_degree, pivot, cx, cy), double from_degree, double to_degree, Efl_Canvas_Object *pivot, double cx, double cy);
-EOAPI EFL_VOID_FUNC_BODYV_CONST(efl_animation_object_rotate_get, EFL_FUNC_CALL(from_degree, to_degree, pivot, cx, cy), double *from_degree, double *to_degree, Efl_Canvas_Object **pivot, double *cx, double *cy);
-
-EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_rotate_absolute_set, EFL_FUNC_CALL(from_degree, to_degree, cx, cy), double from_degree, double to_degree, int cx, int cy);
-EOAPI EFL_VOID_FUNC_BODYV_CONST(efl_animation_object_rotate_absolute_get, EFL_FUNC_CALL(from_degree, to_degree, cx, cy), double *from_degree, double *to_degree, int *cx, int *cy);
-
-#define EFL_ANIMATION_OBJECT_ROTATE_EXTRA_OPS \
- EFL_OBJECT_OP_FUNC(efl_animation_object_rotate_set, _efl_animation_object_rotate_rotate_set), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_rotate_get, _efl_animation_object_rotate_rotate_get), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_rotate_absolute_set, _efl_animation_object_rotate_rotate_absolute_set), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_rotate_absolute_get, _efl_animation_object_rotate_rotate_absolute_get)
-
-#include "efl_animation_object_rotate.eo.c"
diff --git a/src/lib/evas/canvas/efl_animation_object_rotate.eo b/src/lib/evas/canvas/efl_animation_object_rotate.eo
deleted file mode 100644
index 4cf898b05e..0000000000
--- a/src/lib/evas/canvas/efl_animation_object_rotate.eo
+++ /dev/null
@@ -1,11 +0,0 @@
-import efl_animation_types;
-
-class Efl.Animation.Object.Rotate (Efl.Animation.Object)
-{
- [[Efl rotate animation object class]]
- data: Efl_Animation_Object_Rotate_Data;
- implements {
- Efl.Object.constructor;
- Efl.Animation.Object.progress_set;
- }
-}
diff --git a/src/lib/evas/canvas/efl_animation_object_rotate_private.h b/src/lib/evas/canvas/efl_animation_object_rotate_private.h
deleted file mode 100644
index f1bfed9a3c..0000000000
--- a/src/lib/evas/canvas/efl_animation_object_rotate_private.h
+++ /dev/null
@@ -1,37 +0,0 @@
-#define EFL_ANIMATION_OBJECT_PROTECTED
-#define EFL_ANIMATION_OBJECT_ROTATE_PROTECTED
-
-#include "evas_common_private.h"
-
-#define MY_CLASS EFL_ANIMATION_OBJECT_ROTATE_CLASS
-#define MY_CLASS_NAME efl_class_name_get(MY_CLASS)
-
-#define EFL_ANIMATION_OBJECT_ROTATE_DATA_GET(o, pd) \
- Efl_Animation_Object_Rotate_Data *pd = efl_data_scope_get(o, EFL_ANIMATION_OBJECT_ROTATE_CLASS)
-
-typedef struct _Efl_Animation_Object_Rotate_Property
-{
- double degree;
-} Efl_Animation_Object_Rotate_Property;
-
-typedef struct _Efl_Animation_Object_Rotate_Absolute_Pivot
-{
- Evas_Coord cx, cy;
-} Efl_Animation_Object_Rotate_Absolute_Pivot;
-
-typedef struct _Efl_Animation_Object_Rotate_Relative_Pivot
-{
- Efl_Canvas_Object *obj;
- double cx, cy;
-} Efl_Animation_Object_Rotate_Relative_Pivot;
-
-typedef struct _Efl_Animation_Object_Rotate_Data
-{
- Efl_Animation_Object_Rotate_Property from;
- Efl_Animation_Object_Rotate_Property to;
-
- Efl_Animation_Object_Rotate_Absolute_Pivot abs_pivot;
- Efl_Animation_Object_Rotate_Relative_Pivot rel_pivot;
-
- Eina_Bool use_rel_pivot;
-} Efl_Animation_Object_Rotate_Data;
diff --git a/src/lib/evas/canvas/efl_animation_object_scale.c b/src/lib/evas/canvas/efl_animation_object_scale.c
deleted file mode 100644
index 1e1ed28fd9..0000000000
--- a/src/lib/evas/canvas/efl_animation_object_scale.c
+++ /dev/null
@@ -1,272 +0,0 @@
-#include "efl_animation_object_scale_private.h"
-
-EOLIAN static void
-_efl_animation_object_scale_scale_set(Eo *eo_obj,
- Efl_Animation_Object_Scale_Data *pd,
- double from_scale_x,
- double from_scale_y,
- double to_scale_x,
- double to_scale_y,
- Efl_Canvas_Object *pivot,
- double cx,
- double cy)
-{
- pd->from.scale_x = from_scale_x;
- pd->from.scale_y = from_scale_y;
-
- pd->to.scale_x = to_scale_x;
- pd->to.scale_y = to_scale_y;
-
- pd->rel_pivot.obj = pivot;
- pd->rel_pivot.cx = cx;
- pd->rel_pivot.cy = cy;
-
- //Update absolute pivot based on relative pivot
- Evas_Coord x = 0;
- Evas_Coord y = 0;
- Evas_Coord w = 0;
- Evas_Coord h = 0;
-
- if (pivot)
- evas_object_geometry_get(pivot, &x, &y, &w, &h);
- else
- {
- Efl_Canvas_Object *target = efl_animation_object_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, &w, &h);
- }
-
- pd->abs_pivot.cx = x + (w * cx);
- pd->abs_pivot.cy = y + (h * cy);
-
- pd->use_rel_pivot = EINA_TRUE;
-}
-
-EOLIAN static void
-_efl_animation_object_scale_scale_get(Eo *eo_obj,
- Efl_Animation_Object_Scale_Data *pd,
- double *from_scale_x,
- double *from_scale_y,
- double *to_scale_x,
- double *to_scale_y,
- Efl_Canvas_Object **pivot,
- double *cx,
- double *cy)
-{
- //Update relative pivot based on absolute pivot
- if (!pd->use_rel_pivot)
- {
- Evas_Coord x = 0;
- Evas_Coord y = 0;
- Evas_Coord w = 0;
- Evas_Coord h = 0;
-
- Efl_Canvas_Object *target = efl_animation_object_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, &w, &h);
-
- if (w != 0)
- pd->rel_pivot.cx = (double)(pd->abs_pivot.cx - x) / w;
- else
- pd->rel_pivot.cx = 0.0;
-
- if (h != 0)
- pd->rel_pivot.cy = (double)(pd->abs_pivot.cy - y) / h;
- else
- pd->rel_pivot.cy = 0.0;
- }
-
- if (from_scale_x)
- *from_scale_x = pd->from.scale_x;
-
- if (from_scale_y)
- *from_scale_y = pd->from.scale_y;
-
- if (to_scale_x)
- *to_scale_x = pd->to.scale_x;
-
- if (to_scale_y)
- *to_scale_y = pd->to.scale_y;
-
- if (pivot)
- *pivot = pd->rel_pivot.obj;
-
- if (cx)
- *cx = pd->rel_pivot.cx;
-
- if (cy)
- *cy = pd->rel_pivot.cy;
-}
-
-EOLIAN static void
-_efl_animation_object_scale_scale_absolute_set(Eo *eo_obj,
- Efl_Animation_Object_Scale_Data *pd,
- double from_scale_x,
- double from_scale_y,
- double to_scale_x,
- double to_scale_y,
- Evas_Coord cx,
- Evas_Coord cy)
-{
- pd->from.scale_x = from_scale_x;
- pd->from.scale_y = from_scale_y;
-
- pd->to.scale_x = to_scale_x;
- pd->to.scale_y = to_scale_y;
-
- pd->abs_pivot.cx = cx;
- pd->abs_pivot.cy = cy;
-
- //Update relative pivot based on absolute pivot
- Evas_Coord x = 0;
- Evas_Coord y = 0;
- Evas_Coord w = 0;
- Evas_Coord h = 0;
-
- Efl_Canvas_Object *target = efl_animation_object_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, &w, &h);
-
- pd->rel_pivot.obj = NULL;
-
- if (w != 0)
- pd->rel_pivot.cx = (double)(cx - x) / w;
- else
- pd->rel_pivot.cx = 0.0;
-
- if (h != 0)
- pd->rel_pivot.cy = (double)(cy - y) / h;
- else
- pd->rel_pivot.cy = 0.0;
-
- pd->use_rel_pivot = EINA_FALSE;
-}
-
-EOLIAN static void
-_efl_animation_object_scale_scale_absolute_get(Eo *eo_obj,
- Efl_Animation_Object_Scale_Data *pd,
- double *from_scale_x,
- double *from_scale_y,
- double *to_scale_x,
- double *to_scale_y,
- Evas_Coord *cx,
- Evas_Coord *cy)
-{
- //Update absolute pivot based on relative pivot
- if (pd->use_rel_pivot)
- {
- Evas_Coord x = 0;
- Evas_Coord y = 0;
- Evas_Coord w = 0;
- Evas_Coord h = 0;
-
- if (pd->rel_pivot.obj)
- evas_object_geometry_get(pd->rel_pivot.obj, &x, &y, &w, &h);
- else
- {
- Efl_Canvas_Object *target
- = efl_animation_object_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, &w, &h);
- }
-
- pd->abs_pivot.cx = x + (w * pd->rel_pivot.cx);
- pd->abs_pivot.cy = y + (h * pd->rel_pivot.cy);
- }
-
- if (from_scale_x)
- *from_scale_x = pd->from.scale_x;
-
- if (from_scale_y)
- *from_scale_y = pd->from.scale_y;
-
- if (to_scale_x)
- *to_scale_x = pd->to.scale_x;
-
- if (to_scale_y)
- *to_scale_y = pd->to.scale_y;
-
- if (cx)
- *cx = pd->abs_pivot.cx;
-
- if (cy)
- *cy = pd->abs_pivot.cy;
-}
-
-static void
-_progress_set(Eo *eo_obj, double progress)
-{
- EFL_ANIMATION_OBJECT_SCALE_DATA_GET(eo_obj, pd);
-
- Efl_Canvas_Object *target = efl_animation_object_target_get(eo_obj);
- if (!target) return;
-
- double scale_x =
- (pd->from.scale_x * (1.0 - progress)) + (pd->to.scale_x * progress);
-
- double scale_y =
- (pd->from.scale_y * (1.0 - progress)) + (pd->to.scale_y * progress);
-
- if (pd->use_rel_pivot)
- {
- efl_gfx_map_zoom(target,
- scale_x, scale_y,
- pd->rel_pivot.obj,
- pd->rel_pivot.cx, pd->rel_pivot.cy);
- }
- else
- {
- efl_gfx_map_zoom_absolute(target,
- scale_x, scale_y,
- pd->abs_pivot.cx, pd->abs_pivot.cy);
- }
-}
-
-EOLIAN static void
-_efl_animation_object_scale_efl_animation_object_progress_set(Eo *eo_obj,
- Efl_Animation_Object_Scale_Data *pd EINA_UNUSED,
- double progress)
-{
- if ((progress < 0.0) || (progress > 1.0)) return;
-
- _progress_set(eo_obj, progress);
-
- efl_animation_object_progress_set(efl_super(eo_obj, MY_CLASS), progress);
-}
-
-EOLIAN static Efl_Object *
-_efl_animation_object_scale_efl_object_constructor(Eo *eo_obj,
- Efl_Animation_Object_Scale_Data *pd)
-{
- eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
-
- pd->from.scale_x = 1.0;
- pd->from.scale_y = 1.0;
-
- pd->rel_pivot.obj = NULL;
- pd->rel_pivot.cx = 0.5;
- pd->rel_pivot.cy = 0.5;
-
- pd->abs_pivot.cx = 0;
- pd->abs_pivot.cy = 0;
-
- pd->use_rel_pivot = EINA_TRUE;
-
- return eo_obj;
-}
-
-/* Internal EO APIs */
-
-EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_scale_set, EFL_FUNC_CALL(from_scale_x, from_scale_y, to_scale_x, to_scale_y, pivot, cx, cy), double from_scale_x, double from_scale_y, double to_scale_x, double to_scale_y, Efl_Canvas_Object *pivot, double cx, double cy);
-EOAPI EFL_VOID_FUNC_BODYV_CONST(efl_animation_object_scale_get, EFL_FUNC_CALL(from_scale_x, from_scale_y, to_scale_x, to_scale_y, pivot, cx, cy), double *from_scale_x, double *from_scale_y, double *to_scale_x, double *to_scale_y, Efl_Canvas_Object **pivot, double *cx, double *cy);
-
-EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_scale_absolute_set, EFL_FUNC_CALL(from_scale_x, from_scale_y, to_scale_x, to_scale_y, cx, cy), double from_scale_x, double from_scale_y, double to_scale_x, double to_scale_y, int cx, int cy);
-EOAPI EFL_VOID_FUNC_BODYV_CONST(efl_animation_object_scale_absolute_get, EFL_FUNC_CALL(from_scale_x, from_scale_y, to_scale_x, to_scale_y, cx, cy), double *from_scale_x, double *from_scale_y, double *to_scale_x, double *to_scale_y, int *cx, int *cy);
-
-#define EFL_ANIMATION_OBJECT_SCALE_EXTRA_OPS \
- EFL_OBJECT_OP_FUNC(efl_animation_object_scale_set, _efl_animation_object_scale_scale_set), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_scale_get, _efl_animation_object_scale_scale_get), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_scale_absolute_set, _efl_animation_object_scale_scale_absolute_set), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_scale_absolute_get, _efl_animation_object_scale_scale_absolute_get)
-
-#include "efl_animation_object_scale.eo.c"
diff --git a/src/lib/evas/canvas/efl_animation_object_scale.eo b/src/lib/evas/canvas/efl_animation_object_scale.eo
deleted file mode 100644
index 1278fb0988..0000000000
--- a/src/lib/evas/canvas/efl_animation_object_scale.eo
+++ /dev/null
@@ -1,11 +0,0 @@
-import efl_animation_types;
-
-class Efl.Animation.Object.Scale (Efl.Animation.Object)
-{
- [[Efl scale animation object class]]
- data: Efl_Animation_Object_Scale_Data;
- implements {
- Efl.Object.constructor;
- Efl.Animation.Object.progress_set;
- }
-}
diff --git a/src/lib/evas/canvas/efl_animation_object_scale_private.h b/src/lib/evas/canvas/efl_animation_object_scale_private.h
deleted file mode 100644
index 2b049005f5..0000000000
--- a/src/lib/evas/canvas/efl_animation_object_scale_private.h
+++ /dev/null
@@ -1,37 +0,0 @@
-#define EFL_ANIMATION_OBJECT_PROTECTED
-#define EFL_ANIMATION_OBJECT_SCALE_PROTECTED
-
-#include "evas_common_private.h"
-
-#define MY_CLASS EFL_ANIMATION_OBJECT_SCALE_CLASS
-#define MY_CLASS_NAME efl_class_name_get(MY_CLASS)
-
-#define EFL_ANIMATION_OBJECT_SCALE_DATA_GET(o, pd) \
- Efl_Animation_Object_Scale_Data *pd = efl_data_scope_get(o, EFL_ANIMATION_OBJECT_SCALE_CLASS)
-
-typedef struct _Efl_Animation_Object_Scale_Property
-{
- double scale_x, scale_y;
-} Efl_Animation_Object_Scale_Property;
-
-typedef struct _Efl_Animation_Object_Scale_Absolute_Pivot
-{
- Evas_Coord cx, cy;
-} Efl_Animation_Object_Scale_Absolute_Pivot;
-
-typedef struct _Efl_Animation_Object_Scale_Relative_Pivot
-{
- Efl_Canvas_Object *obj;
- double cx, cy;
-} Efl_Animation_Object_Scale_Relative_Pivot;
-
-typedef struct _Efl_Animation_Object_Scale_Data
-{
- Efl_Animation_Object_Scale_Property from;
- Efl_Animation_Object_Scale_Property to;
-
- Efl_Animation_Object_Scale_Absolute_Pivot abs_pivot;
- Efl_Animation_Object_Scale_Relative_Pivot rel_pivot;
-
- Eina_Bool use_rel_pivot;
-} Efl_Animation_Object_Scale_Data;
diff --git a/src/lib/evas/canvas/efl_animation_object_translate.c b/src/lib/evas/canvas/efl_animation_object_translate.c
deleted file mode 100644
index 78ac9e7ee5..0000000000
--- a/src/lib/evas/canvas/efl_animation_object_translate.c
+++ /dev/null
@@ -1,240 +0,0 @@
-#include "efl_animation_object_translate_private.h"
-
-EOLIAN static void
-_efl_animation_object_translate_translate_set(Eo *eo_obj,
- Efl_Animation_Object_Translate_Data *pd,
- Evas_Coord from_x,
- Evas_Coord from_y,
- Evas_Coord to_x,
- Evas_Coord to_y)
-{
- pd->from.move_x = from_x;
- pd->from.move_y = from_y;
-
- pd->to.move_x = to_x;
- pd->to.move_y = to_y;
-
- //Update absolute coordinate based on relative move
- Evas_Coord x = 0;
- Evas_Coord y = 0;
-
- Efl_Canvas_Object *target = efl_animation_object_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, NULL, NULL);
-
- pd->from.x = pd->from.move_x + x;
- pd->from.y = pd->from.move_y + y;
-
- pd->to.x = pd->to.move_x + x;
- pd->to.y = pd->to.move_y + y;
-
- pd->use_rel_move = EINA_TRUE;
-}
-
-EOLIAN static void
-_efl_animation_object_translate_translate_get(Eo *eo_obj,
- Efl_Animation_Object_Translate_Data *pd,
- Evas_Coord *from_x,
- Evas_Coord *from_y,
- Evas_Coord *to_x,
- Evas_Coord *to_y)
-{
- //Update relative move based on absolute coordinate
- if (!pd->use_rel_move)
- {
- Evas_Coord x = 0;
- Evas_Coord y = 0;
-
- Efl_Canvas_Object *target = efl_animation_object_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, NULL, NULL);
-
- pd->from.move_x = pd->from.x - x;
- pd->from.move_y = pd->from.y - y;
-
- pd->to.move_x = pd->to.x - x;
- pd->to.move_y = pd->to.y - y;
- }
-
- if (from_x)
- *from_x = pd->from.move_x;
- if (from_y)
- *from_y = pd->from.move_y;
-
- if (to_x)
- *to_x = pd->to.move_x;
- if (to_y)
- *to_y = pd->to.move_y;
-}
-
-EOLIAN static void
-_efl_animation_object_translate_translate_absolute_set(Eo *eo_obj,
- Efl_Animation_Object_Translate_Data *pd,
- Evas_Coord from_x,
- Evas_Coord from_y,
- Evas_Coord to_x,
- Evas_Coord to_y)
-{
- pd->from.x = from_x;
- pd->from.y = from_y;
-
- pd->to.x = to_x;
- pd->to.y = to_y;
-
- //Update relative move based on absolute coordinate
- Evas_Coord x = 0;
- Evas_Coord y = 0;
-
- Efl_Canvas_Object *target = efl_animation_object_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, NULL, NULL);
-
- pd->from.move_x = pd->from.x - x;
- pd->from.move_y = pd->from.y - y;
-
- pd->to.move_x = pd->to.x - x;
- pd->to.move_y = pd->to.y - y;
-
- pd->use_rel_move = EINA_FALSE;
-}
-
-EOLIAN static void
-_efl_animation_object_translate_translate_absolute_get(Eo *eo_obj,
- Efl_Animation_Object_Translate_Data *pd,
- Evas_Coord *from_x,
- Evas_Coord *from_y,
- Evas_Coord *to_x,
- Evas_Coord *to_y)
-{
- //Update absolute coordinate based on relative move
- if (pd->use_rel_move)
- {
- Evas_Coord x = 0;
- Evas_Coord y = 0;
-
- Efl_Canvas_Object *target = efl_animation_object_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, NULL, NULL);
-
- pd->from.x = pd->from.move_x + x;
- pd->from.y = pd->from.move_y + y;
-
- pd->to.x = pd->to.move_x + x;
- pd->to.y = pd->to.move_y + y;
- }
-
- if (from_x)
- *from_x = pd->from.x;
- if (from_y)
- *from_y = pd->from.y;
-
- if (to_x)
- *to_x = pd->to.x;
- if (to_y)
- *to_y = pd->to.y;
-}
-
-static void
-_pre_started_cb(void *data EINA_UNUSED, const Efl_Event *event)
-{
- EFL_ANIMATION_OBJECT_TRANSLATE_DATA_GET(event->object, pd);
-
- pd->start_x = 0;
- pd->start_y = 0;
-
- Efl_Canvas_Object *target = efl_animation_object_target_get(event->object);
- if (!target) return;
-
- Evas_Coord x, y;
- evas_object_geometry_get(target, &x, &y, NULL, NULL);
-
- pd->start_x = x;
- pd->start_y = y;
-}
-
-static void
-_progress_set(Eo *eo_obj, double progress)
-{
- EFL_ANIMATION_OBJECT_TRANSLATE_DATA_GET(eo_obj, pd);
-
- Efl_Canvas_Object *target = efl_animation_object_target_get(eo_obj);
- if (!target) return;
-
- Evas_Coord new_x = 0;
- Evas_Coord new_y = 0;
-
- if (pd->use_rel_move)
- {
- new_x =
- (pd->from.move_x * (1.0 - progress)) + (pd->to.move_x * progress);
- new_y =
- (pd->from.move_y * (1.0 - progress)) + (pd->to.move_y * progress);
- }
- else
- {
- /* Since efl_gfx_map_translate() moves position relatively, the original
- * position should be subtracted to move position absolutely. */
- new_x =
- (pd->from.x * (1.0 - progress)) + (pd->to.x * progress) - pd->start_x;
- new_y =
- (pd->from.y * (1.0 - progress)) + (pd->to.y * progress) - pd->start_y;
- }
-
- efl_gfx_map_translate(target, (double) new_x, (double) new_y, 0.0);
-}
-
-EOLIAN static void
-_efl_animation_object_translate_efl_animation_object_progress_set(Eo *eo_obj,
- Efl_Animation_Object_Translate_Data *pd EINA_UNUSED,
- double progress)
-{
- if ((progress < 0.0) || (progress > 1.0)) return;
-
- _progress_set(eo_obj, progress);
-
- efl_animation_object_progress_set(efl_super(eo_obj, MY_CLASS), progress);
-}
-
-EOLIAN static Efl_Object *
-_efl_animation_object_translate_efl_object_constructor(Eo *eo_obj,
- Efl_Animation_Object_Translate_Data *pd)
-{
- eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
-
- pd->from.move_x = 0;
- pd->from.move_y = 0;
- pd->from.x = 0;
- pd->from.y = 0;
-
- pd->to.move_x = 0;
- pd->to.move_y = 0;
- pd->to.x = 0;
- pd->to.y = 0;
-
- pd->start_x = 0;
- pd->start_y = 0;
-
- pd->use_rel_move = EINA_TRUE;
-
- //pre_started event is supported within class only (protected event)
- efl_event_callback_add(eo_obj, EFL_ANIMATION_OBJECT_EVENT_PRE_STARTED,
- _pre_started_cb, NULL);
-
- return eo_obj;
-}
-
-/* Internal EO APIs */
-
-EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_translate_set, EFL_FUNC_CALL(from_x, from_y, to_x, to_y), int from_x, int from_y, int to_x, int to_y);
-EOAPI EFL_VOID_FUNC_BODYV_CONST(efl_animation_object_translate_get, EFL_FUNC_CALL(from_x, from_y, to_x, to_y), int *from_x, int *from_y, int *to_x, int *to_y);
-
-EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_translate_absolute_set, EFL_FUNC_CALL(from_x, from_y, to_x, to_y), int from_x, int from_y, int to_x, int to_y);
-EOAPI EFL_VOID_FUNC_BODYV_CONST(efl_animation_object_translate_absolute_get, EFL_FUNC_CALL(from_x, from_y, to_x, to_y), int *from_x, int *from_y, int *to_x, int *to_y);
-
-#define EFL_ANIMATION_OBJECT_TRANSLATE_EXTRA_OPS \
- EFL_OBJECT_OP_FUNC(efl_animation_object_translate_set, _efl_animation_object_translate_translate_set), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_translate_get, _efl_animation_object_translate_translate_get), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_translate_absolute_set, _efl_animation_object_translate_translate_absolute_set), \
- EFL_OBJECT_OP_FUNC(efl_animation_object_translate_absolute_get, _efl_animation_object_translate_translate_absolute_get)
-
-#include "efl_animation_object_translate.eo.c"
diff --git a/src/lib/evas/canvas/efl_animation_object_translate.eo b/src/lib/evas/canvas/efl_animation_object_translate.eo
deleted file mode 100644
index b3f778b609..0000000000
--- a/src/lib/evas/canvas/efl_animation_object_translate.eo
+++ /dev/null
@@ -1,11 +0,0 @@
-import efl_animation_types;
-
-class Efl.Animation.Object.Translate (Efl.Animation.Object)
-{
- [[Efl translate animation object class]]
- data: Efl_Animation_Object_Translate_Data;
- implements {
- Efl.Object.constructor;
- Efl.Animation.Object.progress_set;
- }
-}
diff --git a/src/lib/evas/canvas/efl_animation_object_translate_private.h b/src/lib/evas/canvas/efl_animation_object_translate_private.h
deleted file mode 100644
index 6431c3e2c7..0000000000
--- a/src/lib/evas/canvas/efl_animation_object_translate_private.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#define EFL_ANIMATION_OBJECT_PROTECTED
-
-#include "evas_common_private.h"
-
-#define MY_CLASS EFL_ANIMATION_OBJECT_TRANSLATE_CLASS
-#define MY_CLASS_NAME efl_class_name_get(MY_CLASS)
-
-#define EFL_ANIMATION_OBJECT_TRANSLATE_DATA_GET(o, pd) \
- Efl_Animation_Object_Translate_Data *pd = efl_data_scope_get(o, EFL_ANIMATION_OBJECT_TRANSLATE_CLASS)
-
-typedef struct _Efl_Animation_Object_Translate_Property
-{
- Evas_Coord move_x, move_y;
- Evas_Coord x, y;
-} Efl_Animation_Object_Translate_Property;
-
-typedef struct _Efl_Animation_Object_Translate_Data
-{
- Efl_Animation_Object_Translate_Property from;
- Efl_Animation_Object_Translate_Property to;
-
- Evas_Coord start_x, start_y;
-
- Eina_Bool use_rel_move;
-} Efl_Animation_Object_Translate_Data;
diff --git a/src/lib/evas/canvas/efl_animation_private.h b/src/lib/evas/canvas/efl_animation_private.h
deleted file mode 100644
index 626eb78eb9..0000000000
--- a/src/lib/evas/canvas/efl_animation_private.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#define EFL_ANIMATION_PROTECTED
-
-#include "evas_common_private.h"
-#include <Ecore.h>
-
-#define MY_CLASS EFL_ANIMATION_CLASS
-#define MY_CLASS_NAME efl_class_name_get(MY_CLASS)
-
-typedef struct _Efl_Animation_Data
-{
- Efl_Canvas_Object *target;
-
- double duration;
-
- double start_delay_time;
-
- Efl_Animation_Repeat_Mode repeat_mode;
- int repeat_count;
-
- Efl_Interpolator *interpolator;
-
- Eina_Bool keep_final_state : 1;
-} Efl_Animation_Data;
-
-#define EFL_ANIMATION_DATA_GET(o, pd) \
- Efl_Animation_Data *pd = efl_data_scope_get(o, EFL_ANIMATION_CLASS)
diff --git a/src/lib/evas/canvas/efl_animation_rotate.c b/src/lib/evas/canvas/efl_animation_rotate.c
deleted file mode 100644
index f1238f71d9..0000000000
--- a/src/lib/evas/canvas/efl_animation_rotate.c
+++ /dev/null
@@ -1,240 +0,0 @@
-#include "efl_animation_rotate_private.h"
-
-EOLIAN static void
-_efl_animation_rotate_rotate_set(Eo *eo_obj,
- Efl_Animation_Rotate_Data *pd,
- double from_degree,
- double to_degree,
- Efl_Canvas_Object *pivot,
- double cx,
- double cy)
-{
- pd->from.degree = from_degree;
- pd->to.degree = to_degree;
-
- pd->rel_pivot.obj = pivot;
- pd->rel_pivot.cx = cx;
- pd->rel_pivot.cy = cy;
-
- //Update absolute pivot based on relative pivot
- Evas_Coord x = 0;
- Evas_Coord y = 0;
- Evas_Coord w = 0;
- Evas_Coord h = 0;
-
- if (pivot)
- evas_object_geometry_get(pivot, &x, &y, &w, &h);
- else
- {
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, &w, &h);
- }
-
- pd->abs_pivot.cx = x + (w * cx);
- pd->abs_pivot.cy = y + (h * cy);
-
- pd->use_rel_pivot = EINA_TRUE;
-}
-
-EOLIAN static void
-_efl_animation_rotate_rotate_get(Eo *eo_obj,
- Efl_Animation_Rotate_Data *pd,
- double *from_degree,
- double *to_degree,
- Efl_Canvas_Object **pivot,
- double *cx,
- double *cy)
-{
- //Update relative pivot based on absolute pivot
- if (!pd->use_rel_pivot)
- {
- Evas_Coord x = 0;
- Evas_Coord y = 0;
- Evas_Coord w = 0;
- Evas_Coord h = 0;
-
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, &w, &h);
-
- if (w != 0)
- pd->rel_pivot.cx = (double)(pd->abs_pivot.cx - x) / w;
- else
- pd->rel_pivot.cx = 0.0;
-
- if (h != 0)
- pd->rel_pivot.cy = (double)(pd->abs_pivot.cy - y) / h;
- else
- pd->rel_pivot.cy = 0.0;
- }
-
- if (from_degree)
- *from_degree = pd->from.degree;
-
- if (to_degree)
- *to_degree = pd->to.degree;
-
- if (pivot)
- *pivot = pd->rel_pivot.obj;
-
- if (cx)
- *cx = pd->rel_pivot.cx;
-
- if (cy)
- *cy = pd->rel_pivot.cy;
-}
-
-EOLIAN static void
-_efl_animation_rotate_rotate_absolute_set(Eo *eo_obj,
- Efl_Animation_Rotate_Data *pd,
- double from_degree,
- double to_degree,
- Evas_Coord cx,
- Evas_Coord cy)
-{
- pd->from.degree = from_degree;
- pd->to.degree = to_degree;
-
- pd->abs_pivot.cx = cx;
- pd->abs_pivot.cy = cy;
-
- //Update relative pivot based on absolute pivot
- Evas_Coord x = 0;
- Evas_Coord y = 0;
- Evas_Coord w = 0;
- Evas_Coord h = 0;
-
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, &w, &h);
-
- pd->rel_pivot.obj = NULL;
-
- if (w != 0)
- pd->rel_pivot.cx = (double)(cx - x) / w;
- else
- pd->rel_pivot.cx = 0.0;
-
- if (h != 0)
- pd->rel_pivot.cy = (double)(cy - y) / h;
- else
- pd->rel_pivot.cy = 0.0;
-
- pd->use_rel_pivot = EINA_FALSE;
-}
-
-EOLIAN static void
-_efl_animation_rotate_rotate_absolute_get(Eo *eo_obj,
- Efl_Animation_Rotate_Data *pd,
- double *from_degree,
- double *to_degree,
- Evas_Coord *cx,
- Evas_Coord *cy)
-{
- //Update relative pivot based on absolute pivot
- if (pd->use_rel_pivot)
- {
- Evas_Coord x = 0;
- Evas_Coord y = 0;
- Evas_Coord w = 0;
- Evas_Coord h = 0;
-
- if (pd->rel_pivot.obj)
- evas_object_geometry_get(pd->rel_pivot.obj, &x, &y, &w, &h);
- else
- {
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, &w, &h);
- }
-
- pd->abs_pivot.cx = x + (w * pd->rel_pivot.cx);
- pd->abs_pivot.cy = y + (h * pd->rel_pivot.cy);
- }
-
- if (from_degree)
- *from_degree = pd->from.degree;
-
- if (to_degree)
- *to_degree = pd->to.degree;
-
- if (cx)
- *cx = pd->abs_pivot.cx;
-
- if (cy)
- *cy = pd->abs_pivot.cy;
-}
-
-EOLIAN static Efl_Animation_Object *
-_efl_animation_rotate_efl_animation_object_create(Eo *eo_obj,
- Efl_Animation_Rotate_Data *pd)
-{
- Efl_Animation_Object_Rotate *anim_obj
- = efl_add(EFL_ANIMATION_OBJECT_ROTATE_CLASS, NULL);
-
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- efl_animation_object_target_set(anim_obj, target);
-
- Eina_Bool state_keep = efl_animation_final_state_keep_get(eo_obj);
- efl_animation_object_final_state_keep_set(anim_obj, state_keep);
-
- double duration = efl_animation_duration_get(eo_obj);
- efl_animation_object_duration_set(anim_obj, duration);
-
- double start_delay_time = efl_animation_start_delay_get(eo_obj);
- efl_animation_object_start_delay_set(anim_obj, start_delay_time);
-
- Efl_Animation_Object_Repeat_Mode repeat_mode =
- (Efl_Animation_Object_Repeat_Mode)efl_animation_repeat_mode_get(eo_obj);
- efl_animation_object_repeat_mode_set(anim_obj, repeat_mode);
-
- int repeat_count = efl_animation_repeat_count_get(eo_obj);
- efl_animation_object_repeat_count_set(anim_obj, repeat_count);
-
- Efl_Interpolator *interpolator = efl_animation_interpolator_get(eo_obj);
- efl_animation_object_interpolator_set(anim_obj, interpolator);
-
- if (pd->use_rel_pivot)
- {
- efl_animation_object_rotate_set(anim_obj,
- pd->from.degree,
- pd->to.degree,
- pd->rel_pivot.obj,
- pd->rel_pivot.cx,
- pd->rel_pivot.cy);
- }
- else
- {
- efl_animation_object_rotate_absolute_set(anim_obj,
- pd->from.degree,
- pd->to.degree,
- pd->abs_pivot.cx,
- pd->abs_pivot.cy);
- }
-
- return anim_obj;
-}
-
-EOLIAN static Efl_Object *
-_efl_animation_rotate_efl_object_constructor(Eo *eo_obj,
- Efl_Animation_Rotate_Data *pd)
-{
- eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
-
- pd->from.degree = 0.0;
- pd->to.degree = 0.0;
-
- pd->rel_pivot.obj = NULL;
- pd->rel_pivot.cx = 0.5;
- pd->rel_pivot.cy = 0.5;
-
- pd->abs_pivot.cx = 0;
- pd->abs_pivot.cy = 0;
-
- pd->use_rel_pivot = EINA_TRUE;
-
- return eo_obj;
-}
-
-#include "efl_animation_rotate.eo.c"
diff --git a/src/lib/evas/canvas/efl_animation_rotate_private.h b/src/lib/evas/canvas/efl_animation_rotate_private.h
deleted file mode 100644
index 63d3a0b390..0000000000
--- a/src/lib/evas/canvas/efl_animation_rotate_private.h
+++ /dev/null
@@ -1,37 +0,0 @@
-#define EFL_ANIMATION_PROTECTED
-
-#include "evas_common_private.h"
-#include <Ecore.h>
-
-#define MY_CLASS EFL_ANIMATION_ROTATE_CLASS
-#define MY_CLASS_NAME efl_class_name_get(MY_CLASS)
-
-#define EFL_ANIMATION_ROTATE_DATA_GET(o, pd) \
- Efl_Animation_Rotate_Data *pd = efl_data_scope_get(o, EFL_ANIMATION_ROTATE_CLASS)
-
-typedef struct _Efl_Animation_Rotate_Property
-{
- double degree;
-} Efl_Animation_Rotate_Property;
-
-typedef struct _Efl_Animation_Rotate_Absolute_Pivot
-{
- Evas_Coord cx, cy;
-} Efl_Animation_Rotate_Absolute_Pivot;
-
-typedef struct _Efl_Animation_Rotate_Relative_Pivot
-{
- Efl_Canvas_Object *obj;
- double cx, cy;
-} Efl_Animation_Rotate_Relative_Pivot;
-
-typedef struct _Efl_Animation_Rotate_Data
-{
- Efl_Animation_Rotate_Property from;
- Efl_Animation_Rotate_Property to;
-
- Efl_Animation_Rotate_Absolute_Pivot abs_pivot;
- Efl_Animation_Rotate_Relative_Pivot rel_pivot;
-
- Eina_Bool use_rel_pivot;
-} Efl_Animation_Rotate_Data;
diff --git a/src/lib/evas/canvas/efl_animation_scale.c b/src/lib/evas/canvas/efl_animation_scale.c
deleted file mode 100644
index c34ddf7e8b..0000000000
--- a/src/lib/evas/canvas/efl_animation_scale.c
+++ /dev/null
@@ -1,264 +0,0 @@
-#include "efl_animation_scale_private.h"
-
-EOLIAN static void
-_efl_animation_scale_scale_set(Eo *eo_obj,
- Efl_Animation_Scale_Data *pd,
- double from_scale_x,
- double from_scale_y,
- double to_scale_x,
- double to_scale_y,
- Efl_Canvas_Object *pivot,
- double cx,
- double cy)
-{
- pd->from.scale_x = from_scale_x;
- pd->from.scale_y = from_scale_y;
-
- pd->to.scale_x = to_scale_x;
- pd->to.scale_y = to_scale_y;
-
- pd->rel_pivot.obj = pivot;
- pd->rel_pivot.cx = cx;
- pd->rel_pivot.cy = cy;
-
- //Update absolute pivot based on relative pivot
- Evas_Coord x = 0;
- Evas_Coord y = 0;
- Evas_Coord w = 0;
- Evas_Coord h = 0;
-
- if (pivot)
- evas_object_geometry_get(pivot, &x, &y, &w, &h);
- else
- {
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, &w, &h);
- }
-
- pd->abs_pivot.cx = x + (w * cx);
- pd->abs_pivot.cy = y + (h * cy);
-
- pd->use_rel_pivot = EINA_TRUE;
-}
-
-EOLIAN static void
-_efl_animation_scale_scale_get(Eo *eo_obj,
- Efl_Animation_Scale_Data *pd,
- double *from_scale_x,
- double *from_scale_y,
- double *to_scale_x,
- double *to_scale_y,
- Efl_Canvas_Object **pivot,
- double *cx,
- double *cy)
-{
- //Update relative pivot based on absolute pivot
- if (!pd->use_rel_pivot)
- {
- Evas_Coord x = 0;
- Evas_Coord y = 0;
- Evas_Coord w = 0;
- Evas_Coord h = 0;
-
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, &w, &h);
-
- if (w != 0)
- pd->rel_pivot.cx = (double)(pd->abs_pivot.cx - x) / w;
- else
- pd->rel_pivot.cx = 0.0;
-
- if (h != 0)
- pd->rel_pivot.cy = (double)(pd->abs_pivot.cy - y) / h;
- else
- pd->rel_pivot.cy = 0.0;
- }
-
- if (from_scale_x)
- *from_scale_x = pd->from.scale_x;
-
- if (from_scale_y)
- *from_scale_y = pd->from.scale_y;
-
- if (to_scale_x)
- *to_scale_x = pd->to.scale_x;
-
- if (to_scale_y)
- *to_scale_y = pd->to.scale_y;
-
- if (pivot)
- *pivot = pd->rel_pivot.obj;
-
- if (cx)
- *cx = pd->rel_pivot.cx;
-
- if (cy)
- *cy = pd->rel_pivot.cy;
-}
-
-EOLIAN static void
-_efl_animation_scale_scale_absolute_set(Eo *eo_obj,
- Efl_Animation_Scale_Data *pd,
- double from_scale_x,
- double from_scale_y,
- double to_scale_x,
- double to_scale_y,
- Evas_Coord cx,
- Evas_Coord cy)
-{
- pd->from.scale_x = from_scale_x;
- pd->from.scale_y = from_scale_y;
-
- pd->to.scale_x = to_scale_x;
- pd->to.scale_y = to_scale_y;
-
- pd->abs_pivot.cx = cx;
- pd->abs_pivot.cy = cy;
-
- //Update relative pivot based on absolute pivot
- Evas_Coord x = 0;
- Evas_Coord y = 0;
- Evas_Coord w = 0;
- Evas_Coord h = 0;
-
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, &w, &h);
-
- pd->rel_pivot.obj = NULL;
-
- if (w != 0)
- pd->rel_pivot.cx = (double)(cx - x) / w;
- else
- pd->rel_pivot.cx = 0.0;
-
- if (h != 0)
- pd->rel_pivot.cy = (double)(cy - y) / h;
- else
- pd->rel_pivot.cy = 0.0;
-
- pd->use_rel_pivot = EINA_FALSE;
-}
-
-EOLIAN static void
-_efl_animation_scale_scale_absolute_get(Eo *eo_obj,
- Efl_Animation_Scale_Data *pd,
- double *from_scale_x,
- double *from_scale_y,
- double *to_scale_x,
- double *to_scale_y,
- Evas_Coord *cx,
- Evas_Coord *cy)
-{
- //Update absolute pivot based on relative pivot
- if (pd->use_rel_pivot)
- {
- Evas_Coord x = 0;
- Evas_Coord y = 0;
- Evas_Coord w = 0;
- Evas_Coord h = 0;
-
- if (pd->rel_pivot.obj)
- evas_object_geometry_get(pd->rel_pivot.obj, &x, &y, &w, &h);
- else
- {
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, &w, &h);
- }
-
- pd->abs_pivot.cx = x + (w * pd->rel_pivot.cx);
- pd->abs_pivot.cy = y + (h * pd->rel_pivot.cy);
- }
-
- if (from_scale_x)
- *from_scale_x = pd->from.scale_x;
-
- if (from_scale_y)
- *from_scale_y = pd->from.scale_y;
-
- if (to_scale_x)
- *to_scale_x = pd->to.scale_x;
-
- if (to_scale_y)
- *to_scale_y = pd->to.scale_y;
-
- if (cx)
- *cx = pd->abs_pivot.cx;
-
- if (cy)
- *cy = pd->abs_pivot.cy;
-}
-
-EOLIAN static Efl_Animation_Object *
-_efl_animation_scale_efl_animation_object_create(Eo *eo_obj,
- Efl_Animation_Scale_Data *pd)
-{
- Efl_Animation_Object_Scale *anim_obj
- = efl_add(EFL_ANIMATION_OBJECT_SCALE_CLASS, NULL);
-
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- efl_animation_object_target_set(anim_obj, target);
-
- Eina_Bool state_keep = efl_animation_final_state_keep_get(eo_obj);
- efl_animation_object_final_state_keep_set(anim_obj, state_keep);
-
- double duration = efl_animation_duration_get(eo_obj);
- efl_animation_object_duration_set(anim_obj, duration);
-
- double start_delay_time = efl_animation_start_delay_get(eo_obj);
- efl_animation_object_start_delay_set(anim_obj, start_delay_time);
-
- Efl_Animation_Object_Repeat_Mode repeat_mode =
- (Efl_Animation_Object_Repeat_Mode)efl_animation_repeat_mode_get(eo_obj);
- efl_animation_object_repeat_mode_set(anim_obj, repeat_mode);
-
- int repeat_count = efl_animation_repeat_count_get(eo_obj);
- efl_animation_object_repeat_count_set(anim_obj, repeat_count);
-
- Efl_Interpolator *interpolator = efl_animation_interpolator_get(eo_obj);
- efl_animation_object_interpolator_set(anim_obj, interpolator);
-
- if (pd->use_rel_pivot)
- {
- efl_animation_object_scale_set(anim_obj,
- pd->from.scale_x, pd->from.scale_y,
- pd->to.scale_x, pd->to.scale_y,
- pd->rel_pivot.obj,
- pd->rel_pivot.cx, pd->rel_pivot.cy);
- }
- else
- {
- efl_animation_object_scale_absolute_set(anim_obj,
- pd->from.scale_x, pd->from.scale_y,
- pd->to.scale_x, pd->to.scale_y,
- pd->abs_pivot.cx, pd->abs_pivot.cy);
- }
-
- return anim_obj;
-}
-
-EOLIAN static Efl_Object *
-_efl_animation_scale_efl_object_constructor(Eo *eo_obj,
- Efl_Animation_Scale_Data *pd)
-{
- eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
-
- pd->from.scale_x = 1.0;
- pd->from.scale_y = 1.0;
-
- pd->rel_pivot.obj = NULL;
- pd->rel_pivot.cx = 0.5;
- pd->rel_pivot.cy = 0.5;
-
- pd->abs_pivot.cx = 0;
- pd->abs_pivot.cy = 0;
-
- pd->use_rel_pivot = EINA_TRUE;
-
- return eo_obj;
-}
-
-#include "efl_animation_scale.eo.c"
diff --git a/src/lib/evas/canvas/efl_animation_scale_private.h b/src/lib/evas/canvas/efl_animation_scale_private.h
deleted file mode 100644
index 96a6030289..0000000000
--- a/src/lib/evas/canvas/efl_animation_scale_private.h
+++ /dev/null
@@ -1,37 +0,0 @@
-#define EFL_ANIMATION_PROTECTED
-
-#include "evas_common_private.h"
-#include <Ecore.h>
-
-#define MY_CLASS EFL_ANIMATION_SCALE_CLASS
-#define MY_CLASS_NAME efl_class_name_get(MY_CLASS)
-
-#define EFL_ANIMATION_SCALE_DATA_GET(o, pd) \
- Efl_Animation_Scale_Data *pd = efl_data_scope_get(o, EFL_ANIMATION_SCALE_CLASS)
-
-typedef struct _Efl_Animation_Scale_Property
-{
- double scale_x, scale_y;
-} Efl_Animation_Scale_Property;
-
-typedef struct _Efl_Animation_Scale_Absolute_Pivot
-{
- Evas_Coord cx, cy;
-} Efl_Animation_Scale_Absolute_Pivot;
-
-typedef struct _Efl_Animation_Scale_Relative_Pivot
-{
- Efl_Canvas_Object *obj;
- double cx, cy;
-} Efl_Animation_Scale_Relative_Pivot;
-
-typedef struct _Efl_Animation_Scale_Data
-{
- Efl_Animation_Scale_Property from;
- Efl_Animation_Scale_Property to;
-
- Efl_Animation_Scale_Absolute_Pivot abs_pivot;
- Efl_Animation_Scale_Relative_Pivot rel_pivot;
-
- Eina_Bool use_rel_pivot;
-} Efl_Animation_Scale_Data;
diff --git a/src/lib/evas/canvas/efl_animation_translate.c b/src/lib/evas/canvas/efl_animation_translate.c
deleted file mode 100644
index 4dad1d87ea..0000000000
--- a/src/lib/evas/canvas/efl_animation_translate.c
+++ /dev/null
@@ -1,207 +0,0 @@
-#include "efl_animation_translate_private.h"
-
-EOLIAN static void
-_efl_animation_translate_translate_set(Eo *eo_obj,
- Efl_Animation_Translate_Data *pd,
- Evas_Coord from_x,
- Evas_Coord from_y,
- Evas_Coord to_x,
- Evas_Coord to_y)
-{
- pd->from.move_x = from_x;
- pd->from.move_y = from_y;
-
- pd->to.move_x = to_x;
- pd->to.move_y = to_y;
-
- //Update absolute coordinate based on relative move
- Evas_Coord x = 0;
- Evas_Coord y = 0;
-
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, NULL, NULL);
-
- pd->from.x = pd->from.move_x + x;
- pd->from.y = pd->from.move_y + y;
-
- pd->to.x = pd->to.move_x + x;
- pd->to.y = pd->to.move_y + y;
-
- pd->use_rel_move = EINA_TRUE;
-}
-
-EOLIAN static void
-_efl_animation_translate_translate_get(Eo *eo_obj,
- Efl_Animation_Translate_Data *pd,
- Evas_Coord *from_x,
- Evas_Coord *from_y,
- Evas_Coord *to_x,
- Evas_Coord *to_y)
-{
- //Update relative move based on absolute coordinate
- if (!pd->use_rel_move)
- {
- Evas_Coord x = 0;
- Evas_Coord y = 0;
-
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, NULL, NULL);
-
- pd->from.move_x = pd->from.x - x;
- pd->from.move_y = pd->from.y - y;
-
- pd->to.move_x = pd->to.x - x;
- pd->to.move_y = pd->to.y - y;
- }
-
- if (from_x)
- *from_x = pd->from.move_x;
- if (from_y)
- *from_y = pd->from.move_y;
-
- if (to_x)
- *to_x = pd->to.move_x;
- if (to_y)
- *to_y = pd->to.move_y;
-}
-
-EOLIAN static void
-_efl_animation_translate_translate_absolute_set(Eo *eo_obj,
- Efl_Animation_Translate_Data *pd,
- Evas_Coord from_x,
- Evas_Coord from_y,
- Evas_Coord to_x,
- Evas_Coord to_y)
-{
- pd->from.x = from_x;
- pd->from.y = from_y;
-
- pd->to.x = to_x;
- pd->to.y = to_y;
-
- //Update relative move based on absolute coordinate
- Evas_Coord x = 0;
- Evas_Coord y = 0;
-
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, NULL, NULL);
-
- pd->from.move_x = pd->from.x - x;
- pd->from.move_y = pd->from.y - y;
-
- pd->to.move_x = pd->to.x - x;
- pd->to.move_y = pd->to.y - y;
-
- pd->use_rel_move = EINA_FALSE;
-}
-
-EOLIAN static void
-_efl_animation_translate_translate_absolute_get(Eo *eo_obj,
- Efl_Animation_Translate_Data *pd,
- Evas_Coord *from_x,
- Evas_Coord *from_y,
- Evas_Coord *to_x,
- Evas_Coord *to_y)
-{
- //Update absolute coordinate based on relative move
- if (pd->use_rel_move)
- {
- Evas_Coord x = 0;
- Evas_Coord y = 0;
-
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, NULL, NULL);
-
- pd->from.x = pd->from.move_x + x;
- pd->from.y = pd->from.move_y + y;
-
- pd->to.x = pd->to.move_x + x;
- pd->to.y = pd->to.move_y + y;
- }
-
- if (from_x)
- *from_x = pd->from.x;
- if (from_y)
- *from_y = pd->from.y;
-
- if (to_x)
- *to_x = pd->to.x;
- if (to_y)
- *to_y = pd->to.y;
-}
-
-EOLIAN static Efl_Animation_Object *
-_efl_animation_translate_efl_animation_object_create(Eo *eo_obj,
- Efl_Animation_Translate_Data *pd)
-{
- Efl_Animation_Object_Translate *anim_obj
- = efl_add(EFL_ANIMATION_OBJECT_TRANSLATE_CLASS, NULL);
-
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- efl_animation_object_target_set(anim_obj, target);
-
- Eina_Bool state_keep = efl_animation_final_state_keep_get(eo_obj);
- efl_animation_object_final_state_keep_set(anim_obj, state_keep);
-
- double duration = efl_animation_duration_get(eo_obj);
- efl_animation_object_duration_set(anim_obj, duration);
-
- double start_delay_time = efl_animation_start_delay_get(eo_obj);
- efl_animation_object_start_delay_set(anim_obj, start_delay_time);
-
- Efl_Animation_Object_Repeat_Mode repeat_mode =
- (Efl_Animation_Object_Repeat_Mode)efl_animation_repeat_mode_get(eo_obj);
- efl_animation_object_repeat_mode_set(anim_obj, repeat_mode);
-
- int repeat_count = efl_animation_repeat_count_get(eo_obj);
- efl_animation_object_repeat_count_set(anim_obj, repeat_count);
-
- Efl_Interpolator *interpolator = efl_animation_interpolator_get(eo_obj);
- efl_animation_object_interpolator_set(anim_obj, interpolator);
-
- if (pd->use_rel_move)
- {
- efl_animation_object_translate_set(anim_obj,
- pd->from.move_x,
- pd->from.move_y,
- pd->to.move_x,
- pd->to.move_y);
- }
- else
- {
- efl_animation_object_translate_absolute_set(anim_obj,
- pd->from.x,
- pd->from.y,
- pd->to.x,
- pd->to.y);
- }
-
- return anim_obj;
-}
-
-EOLIAN static Efl_Object *
-_efl_animation_translate_efl_object_constructor(Eo *eo_obj,
- Efl_Animation_Translate_Data *pd)
-{
- eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
-
- pd->from.move_x = 0;
- pd->from.move_y = 0;
- pd->from.x = 0;
- pd->from.y = 0;
-
- pd->to.move_x = 0;
- pd->to.move_y = 0;
- pd->to.x = 0;
- pd->to.y = 0;
-
- pd->use_rel_move = EINA_TRUE;
-
- return eo_obj;
-}
-
-#include "efl_animation_translate.eo.c"
diff --git a/src/lib/evas/canvas/efl_animation_translate_private.h b/src/lib/evas/canvas/efl_animation_translate_private.h
deleted file mode 100644
index 8243ee8bea..0000000000
--- a/src/lib/evas/canvas/efl_animation_translate_private.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#define EFL_ANIMATION_PROTECTED
-
-#include "evas_common_private.h"
-#include <Ecore.h>
-
-#define MY_CLASS EFL_ANIMATION_TRANSLATE_CLASS
-#define MY_CLASS_NAME efl_class_name_get(MY_CLASS)
-
-#define EFL_ANIMATION_TRANSLATE_DATA_GET(o, pd) \
- Efl_Animation_Translate_Data *pd = efl_data_scope_get(o, EFL_ANIMATION_TRANSLATE_CLASS)
-
-typedef struct _Efl_Animation_Translate_Property
-{
- Evas_Coord move_x, move_y;
- Evas_Coord x, y;
-} Efl_Animation_Translate_Property;
-
-typedef struct _Efl_Animation_Translate_Data
-{
- Efl_Animation_Translate_Property from;
- Efl_Animation_Translate_Property to;
-
- Eina_Bool use_rel_move;
-} Efl_Animation_Translate_Data;
diff --git a/src/lib/evas/canvas/efl_canvas_animation.c b/src/lib/evas/canvas/efl_canvas_animation.c
new file mode 100644
index 0000000000..b8c7c99861
--- /dev/null
+++ b/src/lib/evas/canvas/efl_canvas_animation.c
@@ -0,0 +1,138 @@
+#include "efl_canvas_animation_private.h"
+
+#define MY_CLASS EFL_CANVAS_ANIMATION_CLASS
+
+EOLIAN static void
+_efl_canvas_animation_duration_set(Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Data *pd,
+ double sec)
+{
+ pd->duration = sec;
+}
+
+EOLIAN static double
+_efl_canvas_animation_duration_get(const Eo *eo_obj EINA_UNUSED, Efl_Canvas_Animation_Data *pd)
+{
+ return pd->duration;
+}
+
+EOLIAN static void
+_efl_canvas_animation_final_state_keep_set(Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Data *pd,
+ Eina_Bool keep)
+{
+ if (pd->keep_final_state == keep) return;
+
+ pd->keep_final_state = !!keep;
+}
+
+EOLIAN static Eina_Bool
+_efl_canvas_animation_final_state_keep_get(const Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Data *pd)
+{
+ return pd->keep_final_state;
+}
+
+EOLIAN static void
+_efl_canvas_animation_repeat_mode_set(Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Data *pd,
+ Efl_Canvas_Animation_Repeat_Mode mode)
+{
+ if ((mode == EFL_CANVAS_ANIMATION_REPEAT_MODE_RESTART) ||
+ (mode == EFL_CANVAS_ANIMATION_REPEAT_MODE_REVERSE))
+ pd->repeat_mode = mode;
+}
+
+EOLIAN static Efl_Canvas_Animation_Repeat_Mode
+_efl_canvas_animation_repeat_mode_get(const Eo *eo_obj EINA_UNUSED, Efl_Canvas_Animation_Data *pd)
+{
+ return pd->repeat_mode;
+}
+
+EOLIAN static void
+_efl_canvas_animation_repeat_count_set(Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Data *pd,
+ int count)
+{
+ //EFL_ANIMATION_REPEAT_INFINITE repeats animation infinitely
+ if ((count < 0) && (count != EFL_ANIMATION_REPEAT_INFINITE)) return;
+
+ pd->repeat_count = count;
+}
+
+EOLIAN static int
+_efl_canvas_animation_repeat_count_get(const Eo *eo_obj EINA_UNUSED, Efl_Canvas_Animation_Data *pd)
+{
+ return pd->repeat_count;
+}
+
+EOLIAN static void
+_efl_canvas_animation_start_delay_set(Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Data *pd,
+ double sec)
+{
+ if (sec < 0.0) return;
+
+ pd->start_delay_time = sec;
+}
+
+EOLIAN static double
+_efl_canvas_animation_start_delay_get(const Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Data *pd)
+{
+ return pd->start_delay_time;
+}
+
+EOLIAN static void
+_efl_canvas_animation_interpolator_set(Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Data *pd,
+ Efl_Interpolator *interpolator)
+{
+ pd->interpolator = interpolator;
+}
+
+EOLIAN static Efl_Interpolator *
+_efl_canvas_animation_interpolator_get(const Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Data *pd)
+{
+ return pd->interpolator;
+}
+
+EOLIAN static double
+_efl_canvas_animation_animation_apply(Eo *eo_obj,
+ Efl_Canvas_Animation_Data *pd EINA_UNUSED,
+ double progress,
+ Efl_Canvas_Object *target EINA_UNUSED)
+{
+ Efl_Interpolator *interpolator = efl_animation_interpolator_get(eo_obj);
+ if (interpolator)
+ progress = efl_interpolator_interpolate(interpolator, progress);
+
+ return progress;
+}
+
+EOLIAN static double
+_efl_canvas_animation_efl_playable_length_get(const Eo *eo_obj, Efl_Canvas_Animation_Data *pd EINA_UNUSED)
+{
+ if (efl_animation_repeat_count_get(eo_obj) == EFL_ANIMATION_REPEAT_INFINITE)
+ {
+ //TODO: what's correct?
+ return (double)EFL_ANIMATION_REPEAT_INFINITE;
+ }
+
+ return (efl_animation_duration_get(eo_obj) * (efl_animation_repeat_count_get(eo_obj) + 1));
+}
+
+EOLIAN static Eina_Bool
+_efl_canvas_animation_efl_playable_playable_get(const Eo *eo_obj EINA_UNUSED, Efl_Canvas_Animation_Data *pd EINA_UNUSED)
+{
+ return EINA_TRUE;
+}
+
+EOLIAN static Eina_Bool
+_efl_canvas_animation_efl_playable_seekable_get(const Eo *eo_obj EINA_UNUSED, Efl_Canvas_Animation_Data *pd EINA_UNUSED)
+{
+ return EINA_TRUE;
+}
+
+#include "efl_canvas_animation.eo.c"
diff --git a/src/lib/evas/canvas/efl_animation.eo b/src/lib/evas/canvas/efl_canvas_animation.eo
index d8a728d3b9..7773ca3d7c 100644
--- a/src/lib/evas/canvas/efl_animation.eo
+++ b/src/lib/evas/canvas/efl_canvas_animation.eo
@@ -1,20 +1,10 @@
-import efl_animation_types;
+import efl_canvas_animation_types;
-class Efl.Animation (Efl.Object)
+class Efl.Canvas.Animation (Efl.Object, Efl.Playable)
{
[[Efl animation class]]
- data: Efl_Animation_Data;
+ eo_prefix: efl_animation;
methods {
- @property target {
- [[Target object property]]
- set {
- }
- get {
- }
- values {
- target: Efl.Canvas.Object; [[Target object which is applied animation.]]
- }
- }
@property final_state_keep {
[[Keep final state property]]
set {
@@ -22,7 +12,7 @@ class Efl.Animation (Efl.Object)
get {
}
values {
- keep_final_state: bool; [[$true to keep final state, $false otherwise.]]
+ keep: bool; [[$true to keep final state, $false otherwise.]]
}
}
@property duration {
@@ -32,15 +22,7 @@ class Efl.Animation (Efl.Object)
get {
}
values {
- duration: double; [[Duration value.]]
- }
- }
- @property total_duration {
- [[Total duration property]]
- get {
- }
- values {
- total_duration: double; [[Total duration value.]]
+ sec: double; [[Duration value.]]
}
}
@property repeat_mode {
@@ -50,7 +32,7 @@ class Efl.Animation (Efl.Object)
get {
}
values {
- mode: Efl.Animation.Repeat_Mode; [[Repeat mode. EFL_ANIMATION_REPEAT_MODE_RESTART restarts animation when the animation ends and EFL_ANIMATION_REPEAT_MODE_REVERSE reverses animation when the animation ends.]]
+ mode: Efl.Canvas.Animation_Repeat_Mode; [[Repeat mode. EFL_ANIMATION_REPEAT_MODE_RESTART restarts animation when the animation ends and EFL_ANIMATION_REPEAT_MODE_REVERSE reverses animation when the animation ends.]]
}
}
@property repeat_count {
@@ -70,7 +52,7 @@ class Efl.Animation (Efl.Object)
get {
}
values {
- delay_time: double; [[Delay time, in seconds, from when the animation starts until the animation is animated]]
+ sec: double; [[Delay time, in seconds, from when the animation starts until the animation is animated]]
}
}
@property interpolator {
@@ -83,13 +65,17 @@ class Efl.Animation (Efl.Object)
interpolator: Efl.Object; [[Interpolator which indicates interpolation fucntion. Efl_Interpolator is required.]]
}
}
- object_create {
- [[Create object of the animation.]]
- return: Efl.Animation.Object; [[Created object of the animation]]
+ animation_apply {
+ params {
+ @in progress: double;
+ @in target: Efl.Canvas.Object;
+ }
+ return: double; [[Final applied progress.]]
}
}
implements {
- Efl.Object.constructor;
- Efl.Object.destructor;
+ Efl.Playable.length { get; }
+ Efl.Playable.seekable { get; }
+ Efl.Playable.playable { get; }
}
}
diff --git a/src/lib/evas/canvas/efl_canvas_animation_alpha.c b/src/lib/evas/canvas/efl_canvas_animation_alpha.c
new file mode 100644
index 0000000000..8723aee184
--- /dev/null
+++ b/src/lib/evas/canvas/efl_canvas_animation_alpha.c
@@ -0,0 +1,64 @@
+#include "efl_canvas_animation_alpha_private.h"
+
+#define MY_CLASS EFL_CANVAS_ANIMATION_ALPHA_CLASS
+
+EOLIAN static void
+_efl_canvas_animation_alpha_alpha_set(Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Alpha_Data *pd,
+ double from_alpha,
+ double to_alpha)
+{
+ pd->from.alpha = from_alpha;
+ pd->to.alpha = to_alpha;
+}
+
+EOLIAN static void
+_efl_canvas_animation_alpha_alpha_get(const Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Alpha_Data *pd,
+ double *from_alpha,
+ double *to_alpha)
+{
+ if (from_alpha)
+ *from_alpha = pd->from.alpha;
+ if (to_alpha)
+ *to_alpha = pd->to.alpha;
+}
+
+
+EOLIAN static double
+_efl_canvas_animation_alpha_efl_canvas_animation_animation_apply(Eo *eo_obj,
+ Efl_Canvas_Animation_Alpha_Data *pd EINA_UNUSED,
+ double progress,
+ Efl_Canvas_Object *target)
+{
+ double from_alpha, to_alpha;
+ int cur_alpha;
+ int i;
+
+ progress = efl_animation_apply(efl_super(eo_obj, MY_CLASS), progress, target);
+ if (!target) return progress;
+
+ efl_animation_alpha_get(eo_obj, &from_alpha, &to_alpha);
+ cur_alpha = (int)(GET_STATUS(from_alpha, to_alpha, progress) * 255);
+
+ for (i = 0; i < 4; i++)
+ {
+ efl_gfx_map_color_set(target, i, cur_alpha, cur_alpha, cur_alpha, cur_alpha);
+ }
+
+ return progress;
+}
+
+EOLIAN static Efl_Object *
+_efl_canvas_animation_alpha_efl_object_constructor(Eo *eo_obj,
+ Efl_Canvas_Animation_Alpha_Data *pd)
+{
+ eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
+
+ pd->from.alpha = 1.0;
+ pd->to.alpha = 1.0;
+
+ return eo_obj;
+}
+
+#include "efl_canvas_animation_alpha.eo.c"
diff --git a/src/lib/evas/canvas/efl_animation_alpha.eo b/src/lib/evas/canvas/efl_canvas_animation_alpha.eo
index d5da203d19..2ef971e013 100644
--- a/src/lib/evas/canvas/efl_animation_alpha.eo
+++ b/src/lib/evas/canvas/efl_canvas_animation_alpha.eo
@@ -1,9 +1,8 @@
-import efl_animation_types;
-
-class Efl.Animation.Alpha (Efl.Animation)
+class Efl.Canvas.Animation_Alpha (Efl.Canvas.Animation)
{
[[Efl alpha animation class]]
- data: Efl_Animation_Alpha_Data;
+ eo_prefix: efl_animation_alpha;
+ data: Efl_Canvas_Animation_Alpha_Data;
methods {
@property alpha {
[[Alpha property]]
@@ -19,6 +18,6 @@ class Efl.Animation.Alpha (Efl.Animation)
}
implements {
Efl.Object.constructor;
- Efl.Animation.object_create;
+ Efl.Canvas.Animation.animation_apply;
}
}
diff --git a/src/lib/evas/canvas/efl_canvas_animation_alpha_private.h b/src/lib/evas/canvas/efl_canvas_animation_alpha_private.h
new file mode 100644
index 0000000000..fc0b9e655f
--- /dev/null
+++ b/src/lib/evas/canvas/efl_canvas_animation_alpha_private.h
@@ -0,0 +1,19 @@
+#define EFL_ANIMATION_PROTECTED
+
+#include "evas_common_private.h"
+#include <Ecore.h>
+#include "efl_canvas_animation_private.h"
+
+#define EFL_ANIMATION_ALPHA_DATA_GET(o, pd) \
+ Efl_Canvas_Animation_Alpha_Data *pd = efl_data_scope_get(o, EFL_CANVAS_ANIMATION_ALPHA_CLASS)
+
+typedef struct _Efl_Canvas_Animation_Alpha_Property
+{
+ double alpha;
+} Efl_Canvas_Animation_Alpha_Property;
+
+typedef struct _Efl_Canvas_Animation_Alpha_Data
+{
+ Efl_Canvas_Animation_Alpha_Property from;
+ Efl_Canvas_Animation_Alpha_Property to;
+} Efl_Canvas_Animation_Alpha_Data;
diff --git a/src/lib/evas/canvas/efl_canvas_animation_group.c b/src/lib/evas/canvas/efl_canvas_animation_group.c
new file mode 100644
index 0000000000..ab88743a26
--- /dev/null
+++ b/src/lib/evas/canvas/efl_canvas_animation_group.c
@@ -0,0 +1,127 @@
+#include "efl_canvas_animation_group_private.h"
+
+EOLIAN static void
+_efl_canvas_animation_group_animation_add(Eo *eo_obj,
+ Efl_Canvas_Animation_Group_Data *pd,
+ Efl_Canvas_Animation *animation)
+{
+ if (!animation) return;
+
+ double duration = efl_animation_duration_get(efl_super(eo_obj, MY_CLASS));
+ /* if group animation duration is available value, then the duration is
+ * propagated to its child. */
+ if (duration != EFL_ANIMATION_GROUP_DURATION_NONE)
+ efl_animation_duration_set(animation, duration);
+
+ Eina_Bool keep_final_state = efl_animation_final_state_keep_get(eo_obj);
+ efl_animation_final_state_keep_set(animation, keep_final_state);
+
+ pd->animations = eina_list_append(pd->animations, animation);
+ efl_ref(animation);
+}
+
+EOLIAN static void
+_efl_canvas_animation_group_animation_del(Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Group_Data *pd,
+ Efl_Canvas_Animation *animation)
+{
+ Eina_List *list;
+ if (!animation) return;
+
+ list = eina_list_data_find_list(pd->animations, animation);
+ if (list)
+ {
+ pd->animations = eina_list_remove_list(pd->animations, list);
+ efl_unref(animation);
+ }
+ else
+ {
+ ERR("Animation(%s@%p) is not in the group animation.",
+ efl_class_name_get(animation), animation);
+ }
+}
+
+EOLIAN static Eina_List *
+_efl_canvas_animation_group_animations_get(const Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Group_Data *pd)
+{
+ return pd->animations;
+}
+
+EOLIAN static void
+_efl_canvas_animation_group_efl_canvas_animation_duration_set(Eo *eo_obj,
+ Efl_Canvas_Animation_Group_Data *pd,
+ double duration)
+{
+ if (duration == EFL_ANIMATION_GROUP_DURATION_NONE) goto end;
+
+ if (duration < 0.0) return;
+
+ Eina_List *l;
+ Efl_Canvas_Animation *anim;
+ EINA_LIST_FOREACH(pd->animations, l, anim)
+ {
+ efl_animation_duration_set(anim, duration);
+ }
+
+end:
+ efl_animation_duration_set(efl_super(eo_obj, MY_CLASS), duration);
+}
+
+EOLIAN static void
+_efl_canvas_animation_group_efl_canvas_animation_final_state_keep_set(Eo *eo_obj,
+ Efl_Canvas_Animation_Group_Data *pd,
+ Eina_Bool keep_final_state)
+{
+ Eina_List *l;
+ Efl_Canvas_Animation *anim;
+ EINA_LIST_FOREACH(pd->animations, l, anim)
+ {
+ efl_animation_final_state_keep_set(anim, keep_final_state);
+ }
+
+ efl_animation_final_state_keep_set(efl_super(eo_obj, MY_CLASS), keep_final_state);
+}
+
+EOLIAN static void
+_efl_canvas_animation_group_efl_canvas_animation_interpolator_set(Eo *eo_obj,
+ Efl_Canvas_Animation_Group_Data *pd,
+ Efl_Interpolator *interpolator)
+{
+ Eina_List *l;
+ Efl_Canvas_Animation *anim;
+ EINA_LIST_FOREACH(pd->animations, l, anim)
+ {
+ efl_animation_interpolator_set(anim, interpolator);
+ }
+
+ efl_animation_interpolator_set(efl_super(eo_obj, MY_CLASS), interpolator);
+}
+
+EOLIAN static Efl_Object *
+_efl_canvas_animation_group_efl_object_constructor(Eo *eo_obj,
+ Efl_Canvas_Animation_Group_Data *pd)
+{
+ eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
+
+ pd->animations = NULL;
+
+ //group animation does not affect its child duration by default.
+ efl_animation_duration_set(eo_obj, EFL_ANIMATION_GROUP_DURATION_NONE);
+
+ return eo_obj;
+}
+
+EOLIAN static void
+_efl_canvas_animation_group_efl_object_destructor(Eo *eo_obj,
+ Efl_Canvas_Animation_Group_Data *pd)
+{
+ Efl_Canvas_Animation *anim;
+
+ EINA_LIST_FREE(pd->animations, anim)
+ efl_unref(anim);
+
+ efl_destructor(efl_super(eo_obj, MY_CLASS));
+}
+
+#include "efl_canvas_animation_group.eo.c"
diff --git a/src/lib/evas/canvas/efl_canvas_animation_group.eo b/src/lib/evas/canvas/efl_canvas_animation_group.eo
new file mode 100644
index 0000000000..76fcbb2d81
--- /dev/null
+++ b/src/lib/evas/canvas/efl_canvas_animation_group.eo
@@ -0,0 +1,31 @@
+abstract Efl.Canvas.Animation_Group (Efl.Canvas.Animation)
+{
+ [[Efl group animation abstract class]]
+ eo_prefix: efl_animation_group;
+ data: Efl_Canvas_Animation_Group_Data;
+ methods {
+ animation_add {
+ [[Add the given animation to the animation group.]]
+ params {
+ @in animation: Efl.Canvas.Animation; [[The animation which needs to be added to the animation group]]
+ }
+ }
+ animation_del {
+ [[Delete the given animation from the animation group.]]
+ params {
+ @in animation: Efl.Canvas.Animation; [[The animation which needs to be deleted from the animation group]]
+ }
+ }
+ animations_get @const {
+ [[Get the animations of the animation group.]]
+ return: list<Efl.Canvas.Animation>; [[The animations of the animation group]]
+ }
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Object.destructor;
+ Efl.Canvas.Animation.duration { set; }
+ Efl.Canvas.Animation.final_state_keep { set; }
+ Efl.Canvas.Animation.interpolator { set; }
+ }
+}
diff --git a/src/lib/evas/canvas/efl_canvas_animation_group_parallel.c b/src/lib/evas/canvas/efl_canvas_animation_group_parallel.c
new file mode 100644
index 0000000000..4ec979caff
--- /dev/null
+++ b/src/lib/evas/canvas/efl_canvas_animation_group_parallel.c
@@ -0,0 +1,77 @@
+#include "efl_canvas_animation_group_parallel_private.h"
+
+#define MY_CLASS EFL_CANVAS_ANIMATION_GROUP_PARALLEL_CLASS
+
+EOLIAN static double
+_efl_canvas_animation_group_parallel_efl_canvas_animation_animation_apply(Eo *eo_obj,
+ void *_pd EINA_UNUSED,
+ double progress,
+ Efl_Canvas_Object *target)
+{
+ double group_length, group_elapsed_time;
+ double anim_length, anim_duration, anim_start_delay, anim_progress, anim_elapsed_time;
+ int anim_repeated_count;
+
+ progress = efl_animation_apply(efl_super(eo_obj, MY_CLASS), progress, target);
+ Eina_List *group_anim = efl_animation_group_animations_get(eo_obj);
+ if (!group_anim) return progress;
+
+ group_length = efl_playable_length_get(eo_obj);
+ group_elapsed_time = group_length * progress;
+
+ Eina_List *l;
+ Efl_Canvas_Animation *anim;
+ EINA_LIST_FOREACH(group_anim, l, anim)
+ {
+ anim_length = efl_playable_length_get(anim);
+ anim_duration = efl_animation_duration_get(anim);
+ anim_start_delay = efl_animation_start_delay_get(anim);
+
+ anim_repeated_count = (int)(group_elapsed_time / anim_length);
+
+ if ((anim_length + anim_start_delay) <= group_elapsed_time)
+ {
+ if (efl_animation_final_state_keep_get(anim) && (!FINAL_STATE_IS_REVERSE(anim)))
+ anim_progress = 1.0;
+ else
+ anim_progress = 0.0;
+ efl_animation_apply(anim, anim_progress, target);
+
+ continue;
+ }
+
+ anim_elapsed_time =
+ MAX(((group_elapsed_time - (anim_length * anim_repeated_count)) - anim_start_delay), 0.0);
+ anim_progress = MIN((anim_elapsed_time / anim_duration), 1.0);
+ if (FINAL_STATE_IS_REVERSE(anim))
+ anim_progress = 1.0 - anim_progress;
+
+ efl_animation_apply(anim, anim_progress, target);
+ }
+
+ return progress;
+}
+
+EOLIAN static double
+_efl_canvas_animation_group_parallel_efl_canvas_animation_duration_get(const Eo *eo_obj, void *_pd EINA_UNUSED)
+{
+ double child_total_duration;
+ double total_duration = 0.0;
+
+ Eina_List *animations = efl_animation_group_animations_get(eo_obj);
+ if (!animations) return 0.0;
+
+ Eina_List *l;
+ Efl_Canvas_Animation *anim;
+ EINA_LIST_FOREACH(animations, l, anim)
+ {
+ child_total_duration = efl_playable_length_get(anim);
+ child_total_duration += efl_animation_start_delay_get(anim);
+ if (child_total_duration > total_duration)
+ total_duration = child_total_duration;
+ }
+
+ return total_duration;
+}
+
+#include "efl_canvas_animation_group_parallel.eo.c"
diff --git a/src/lib/evas/canvas/efl_canvas_animation_group_parallel.eo b/src/lib/evas/canvas/efl_canvas_animation_group_parallel.eo
new file mode 100644
index 0000000000..98700ec8b9
--- /dev/null
+++ b/src/lib/evas/canvas/efl_canvas_animation_group_parallel.eo
@@ -0,0 +1,12 @@
+class Efl.Canvas.Animation_Group_Parallel (Efl.Canvas.Animation_Group)
+{
+ [[Efl group parallel animation class]]
+ eo_prefix: efl_animation_group_parallel;
+ data: null;
+ methods {
+ }
+ implements {
+ Efl.Canvas.Animation.duration { get; }
+ Efl.Canvas.Animation.animation_apply;
+ }
+}
diff --git a/src/lib/evas/canvas/efl_canvas_animation_group_parallel_private.h b/src/lib/evas/canvas/efl_canvas_animation_group_parallel_private.h
new file mode 100644
index 0000000000..332e3b673c
--- /dev/null
+++ b/src/lib/evas/canvas/efl_canvas_animation_group_parallel_private.h
@@ -0,0 +1,5 @@
+#define EFL_ANIMATION_PROTECTED
+
+#include "evas_common_private.h"
+#include <Ecore.h>
+#include "efl_canvas_animation_private.h"
diff --git a/src/lib/evas/canvas/efl_canvas_animation_group_private.h b/src/lib/evas/canvas/efl_canvas_animation_group_private.h
new file mode 100644
index 0000000000..685e8f6063
--- /dev/null
+++ b/src/lib/evas/canvas/efl_canvas_animation_group_private.h
@@ -0,0 +1,15 @@
+#define EFL_ANIMATION_PROTECTED
+
+#include "evas_common_private.h"
+#include <Ecore.h>
+
+#define MY_CLASS EFL_CANVAS_ANIMATION_GROUP_CLASS
+#define MY_CLASS_NAME efl_class_name_get(MY_CLASS)
+
+#define EFL_ANIMATION_GROUP_DATA_GET(o, pd) \
+ Efl_Canvas_Animation_Group_Data *pd = efl_data_scope_get(o, EFL_CANVAS_ANIMATION_GROUP_CLASS)
+
+typedef struct _Efl_Canvas_Animation_Group_Data
+{
+ Eina_List *animations;
+} Efl_Canvas_Animation_Group_Data;
diff --git a/src/lib/evas/canvas/efl_canvas_animation_group_sequential.c b/src/lib/evas/canvas/efl_canvas_animation_group_sequential.c
new file mode 100644
index 0000000000..2a83fc4431
--- /dev/null
+++ b/src/lib/evas/canvas/efl_canvas_animation_group_sequential.c
@@ -0,0 +1,81 @@
+#include "efl_canvas_animation_group_sequential_private.h"
+
+#define MY_CLASS EFL_CANVAS_ANIMATION_GROUP_SEQUENTIAL_CLASS
+
+EOLIAN static double
+_efl_canvas_animation_group_sequential_efl_canvas_animation_animation_apply(Eo *eo_obj,
+ void *_pd EINA_UNUSED,
+ double progress,
+ Efl_Canvas_Object *target)
+{
+ double group_length, group_elapsed_time;
+ double anim_length, anim_duration, anim_start_delay, anim_progress, anim_play_time, anim_position;
+ double total_anim_elapsed_time = 0.0;
+ double temp;
+ int anim_repeated_count;
+
+ progress = efl_animation_apply(efl_super(eo_obj, MY_CLASS), progress, target);
+ Eina_List *group_anim = efl_animation_group_animations_get(eo_obj);
+ if (!group_anim) return progress;
+
+ group_length = efl_playable_length_get(eo_obj);
+ group_elapsed_time = group_length * progress;
+
+ Eina_List *l;
+ Efl_Canvas_Animation *anim;
+ EINA_LIST_FOREACH(group_anim, l, anim)
+ {
+ anim_start_delay = efl_animation_start_delay_get(anim);
+ anim_length = efl_playable_length_get(anim) + anim_start_delay;
+ anim_duration = efl_animation_duration_get(anim);
+
+ //Check whether this animation is playing.
+ temp = total_anim_elapsed_time + anim_length + anim_start_delay;
+ if (temp <= group_elapsed_time)
+ {
+ if (efl_animation_final_state_keep_get(anim) && (!FINAL_STATE_IS_REVERSE(anim)))
+ anim_progress = 1.0;
+ else
+ anim_progress = 0.0;
+ efl_animation_apply(anim, anim_progress, target);
+ total_anim_elapsed_time = temp;
+ continue;
+ }
+
+ anim_play_time = group_elapsed_time - total_anim_elapsed_time - anim_start_delay;
+ //TODO: check infinite repeat
+ anim_repeated_count = (int)(anim_play_time / anim_length);
+ anim_position = MAX(((anim_play_time - anim_duration * anim_repeated_count)), 0.0);
+ anim_progress = MIN((anim_position / anim_duration), 1.0);
+ if (FINAL_STATE_IS_REVERSE(anim))
+ anim_progress = 1.0 - anim_progress;
+ efl_animation_apply(anim, anim_progress, target);
+
+ break;
+ }
+
+ return progress;
+}
+
+EOLIAN static double
+_efl_canvas_animation_group_sequential_efl_canvas_animation_duration_get(const Eo *eo_obj, void *_pd EINA_UNUSED)
+{
+ double total_duration = 0.0;
+ double child_total_duration;
+
+ Eina_List *animations = efl_animation_group_animations_get(eo_obj);
+ if (!animations) return 0.0;
+
+ Eina_List *l;
+ Efl_Canvas_Animation *anim;
+ EINA_LIST_FOREACH(animations, l, anim)
+ {
+ child_total_duration = efl_playable_length_get(anim);
+ child_total_duration += efl_animation_start_delay_get(anim);
+ total_duration += child_total_duration;
+ }
+
+ return total_duration;
+}
+
+#include "efl_canvas_animation_group_sequential.eo.c"
diff --git a/src/lib/evas/canvas/efl_canvas_animation_group_sequential.eo b/src/lib/evas/canvas/efl_canvas_animation_group_sequential.eo
new file mode 100644
index 0000000000..8cdce7f0f5
--- /dev/null
+++ b/src/lib/evas/canvas/efl_canvas_animation_group_sequential.eo
@@ -0,0 +1,11 @@
+class Efl.Canvas.Animation_Group_Sequential (Efl.Canvas.Animation_Group)
+{
+ [[Efl group sequential animation class]]
+ data: null;
+ methods {
+ }
+ implements {
+ Efl.Canvas.Animation.duration { get; }
+ Efl.Canvas.Animation.animation_apply;
+ }
+}
diff --git a/src/lib/evas/canvas/efl_canvas_animation_group_sequential_private.h b/src/lib/evas/canvas/efl_canvas_animation_group_sequential_private.h
new file mode 100644
index 0000000000..332e3b673c
--- /dev/null
+++ b/src/lib/evas/canvas/efl_canvas_animation_group_sequential_private.h
@@ -0,0 +1,5 @@
+#define EFL_ANIMATION_PROTECTED
+
+#include "evas_common_private.h"
+#include <Ecore.h>
+#include "efl_canvas_animation_private.h"
diff --git a/src/lib/evas/canvas/efl_canvas_animation_player.c b/src/lib/evas/canvas/efl_canvas_animation_player.c
new file mode 100644
index 0000000000..864fab986a
--- /dev/null
+++ b/src/lib/evas/canvas/efl_canvas_animation_player.c
@@ -0,0 +1,386 @@
+#include "efl_canvas_animation_player_private.h"
+
+static void
+_target_del_cb(void *data, const Efl_Event *event EINA_UNUSED)
+{
+ Efl_Canvas_Animation_Player_Data *pd = data;
+ pd->target = NULL;
+}
+
+EOLIAN static void
+_efl_canvas_animation_player_target_set(Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Player_Data *pd,
+ Efl_Canvas_Object *target)
+{
+ efl_event_callback_add(target, EFL_EVENT_DEL, _target_del_cb, pd);
+
+ pd->target = target;
+}
+
+EOLIAN static Efl_Canvas_Object *
+_efl_canvas_animation_player_target_get(const Eo *eo_obj EINA_UNUSED, Efl_Canvas_Animation_Player_Data *pd)
+{
+ return pd->target;
+}
+
+EOLIAN static void
+_efl_canvas_animation_player_auto_del_set(Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Player_Data *pd,
+ Eina_Bool auto_del)
+{
+ pd->auto_del = auto_del;
+}
+
+EOLIAN static Eina_Bool
+_efl_canvas_animation_player_auto_del_get(const Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Player_Data *pd)
+{
+ return pd->auto_del;
+}
+
+EOLIAN static void
+_efl_canvas_animation_player_animation_set(Eo *eo_obj,
+ Efl_Canvas_Animation_Player_Data *pd,
+ Efl_Canvas_Animation *anim)
+{
+ if (anim == pd->animation)
+ return;
+
+ if (!efl_isa(anim, EFL_CANVAS_ANIMATION_CLASS))
+ {
+ ERR("Passed argument [%p]:[%s] is not an Efl.Animation",
+ anim, efl_class_name_get(efl_class_get(anim)));
+ return;
+ }
+
+ if (pd->animation)
+ {
+ efl_player_stop(eo_obj);
+ efl_unref(pd->animation);
+ }
+ pd->animation = anim;
+ efl_ref(pd->animation);
+}
+
+EOLIAN static Efl_Canvas_Animation *
+_efl_canvas_animation_player_animation_get(const Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Player_Data *pd)
+{
+ return pd->animation;
+}
+
+static Eina_Bool
+_animator_cb(void *data)
+{
+ Eo *eo_obj = data;
+ EFL_ANIMATION_PLAYER_DATA_GET(eo_obj, pd);
+ EFL_ANIMATION_PLAYER_ANIMATION_GET(eo_obj, anim);
+ double duration, elapsed_time, vector;
+
+ if (efl_player_seekable_get(eo_obj))
+ {
+ pd->time.current = ecore_loop_time_get();
+
+ duration = efl_animation_duration_get(anim);
+ elapsed_time = pd->time.current - pd->time.prev;
+ vector = elapsed_time / duration;
+
+ if (vector <= DBL_EPSILON)
+ return ECORE_CALLBACK_RENEW; // There is no update.
+
+ //TODO: check negative play_speed.
+ if (!pd->is_direction_forward)
+ vector *= -1;
+ pd->progress += vector;
+
+ if (pd->progress > 1.0)
+ pd->progress = 1.0;
+ else if (pd->progress < 0.0)
+ pd->progress = 0.0;
+ }
+ else
+ {
+ pd->progress = (double)(pd->is_direction_forward);
+ }
+
+ efl_animation_apply(anim, pd->progress, efl_animation_player_target_get(eo_obj));
+
+ Efl_Canvas_Animation_Player_Event_Running event_running;
+ event_running.progress = pd->progress;
+ efl_event_callback_call(eo_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING,
+ &event_running);
+ pd->time.prev = pd->time.current;
+
+ //Not end. Keep going.
+ if (fabs((!!(pd->is_direction_forward)) - pd->progress) > DBL_EPSILON)
+ return ECORE_CALLBACK_RENEW;
+
+ //Repeat animation
+ if ((efl_animation_repeat_count_get(anim) == EFL_ANIMATION_REPEAT_INFINITE) ||
+ (pd->remaining_repeat_count > 0))
+ {
+ if (pd->remaining_repeat_count > 0)
+ pd->remaining_repeat_count--;
+
+ if (efl_animation_repeat_mode_get(anim) == EFL_CANVAS_ANIMATION_REPEAT_MODE_REVERSE)
+ {
+ pd->is_direction_forward = !pd->is_direction_forward;
+ }
+ else
+ {
+ pd->progress = 0.0;
+ }
+
+ return ECORE_CALLBACK_RENEW;
+ }
+ efl_player_stop(eo_obj);
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static void
+_start(Eo *eo_obj, Efl_Canvas_Animation_Player_Data *pd)
+{
+ EFL_ANIMATION_PLAYER_ANIMATION_GET(eo_obj, anim);
+
+ pd->is_direction_forward = EINA_TRUE;
+
+ pd->remaining_repeat_count = efl_animation_repeat_count_get(anim);
+
+ ecore_animator_del(pd->animator);
+ pd->animator = NULL;
+ pd->time.prev = ecore_loop_time_get();
+
+ //pre started event is supported within class only (protected event)
+ efl_event_callback_call(eo_obj, EFL_ANIMATION_PLAYER_EVENT_PRE_STARTED,
+ NULL);
+ efl_event_callback_call(eo_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, NULL);
+
+ pd->animator = ecore_animator_add(_animator_cb, eo_obj);
+
+ _animator_cb(eo_obj);
+}
+
+static Eina_Bool
+_start_delay_timer_cb(void *data)
+{
+ Eo *eo_obj = data;
+ EFL_ANIMATION_PLAYER_DATA_GET(eo_obj, pd);
+
+ pd->start_delay_timer = NULL;
+
+ _start(eo_obj, pd);
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+EOLIAN static void
+_efl_canvas_animation_player_efl_player_start(Eo *eo_obj,
+ Efl_Canvas_Animation_Player_Data *pd)
+{
+ double start_delay;
+ EFL_ANIMATION_PLAYER_ANIMATION_GET(eo_obj, anim);
+
+ if (!efl_player_playable_get(eo_obj)) return;
+ pd->is_play = EINA_TRUE;
+ //TODO: check this case is correct
+ if (pd->start_delay_timer) return;
+
+ pd->progress = 0.0;
+ start_delay = efl_animation_start_delay_get(anim);
+ if (start_delay > 0.0)
+ {
+ pd->start_delay_timer = ecore_timer_add(start_delay,
+ _start_delay_timer_cb, eo_obj);
+ return;
+ }
+
+ _start(eo_obj, pd);
+}
+
+EOLIAN static void
+_efl_canvas_animation_player_efl_player_stop(Eo *eo_obj,
+ Efl_Canvas_Animation_Player_Data *pd)
+{
+ EFL_ANIMATION_PLAYER_ANIMATION_GET(eo_obj, anim);
+ Eina_Bool play = efl_player_play_get(eo_obj);
+ if (play)
+ {
+ efl_player_play_set(eo_obj, EINA_FALSE);
+ //Reset the state of the target to the initial state
+ if ((efl_animation_final_state_keep_get(anim)) &&
+ (efl_animation_repeat_mode_get(anim) != EFL_CANVAS_ANIMATION_REPEAT_MODE_REVERSE) &&
+ (!(efl_animation_repeat_count_get(anim) & 1)))
+ {
+ pd->progress = 1.0;
+ efl_animation_apply(anim, pd->progress,
+ efl_animation_player_target_get(eo_obj));
+ }
+ else
+ {
+ pd->progress = 0.0;
+ efl_gfx_map_reset(efl_animation_player_target_get(eo_obj));
+ }
+ efl_event_callback_call(eo_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, NULL);
+ }
+ else
+ {
+ pd->progress = 0.0;
+ efl_gfx_map_reset(efl_animation_player_target_get(eo_obj));
+ }
+
+ if (pd->auto_del) efl_del(eo_obj);
+}
+
+EOLIAN static void
+_efl_canvas_animation_player_efl_player_play_set(Eo *eo_obj,
+ Efl_Canvas_Animation_Player_Data *pd,
+ Eina_Bool play)
+{
+ if (efl_player_play_get(eo_obj) == !!play)
+ return;
+
+ pd->is_play = play;
+ if (play)
+ {
+ //TODO: check this case is correct.
+ if (pd->start_delay_timer) return;
+
+ pd->time.prev = ecore_loop_time_get();
+ pd->animator = ecore_animator_add(_animator_cb, eo_obj);
+
+ _animator_cb(eo_obj);
+ }
+ else
+ {
+ ecore_timer_del(pd->start_delay_timer);
+ pd->start_delay_timer = NULL;
+ ecore_animator_del(pd->animator);
+ pd->animator = NULL;
+ }
+}
+
+EOLIAN static Eina_Bool
+_efl_canvas_animation_player_efl_player_play_get(const Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Player_Data *pd)
+{
+ return pd->is_play;
+}
+
+EOLIAN static Eina_Bool
+_efl_canvas_animation_player_efl_player_playable_get(const Eo *eo_obj,
+ Efl_Canvas_Animation_Player_Data *pd EINA_UNUSED)
+{
+ Efl_Canvas_Animation *anim = efl_animation_player_animation_get(eo_obj);
+
+ return efl_playable_get(anim);
+}
+
+EOLIAN static double
+_efl_canvas_animation_player_efl_player_pos_get(const Eo *eo_obj,
+ Efl_Canvas_Animation_Player_Data *pd EINA_UNUSED)
+{
+ //TODO: this is not correct
+ Efl_Canvas_Animation *anim = efl_animation_player_animation_get(eo_obj);
+ double length = efl_player_length_get(anim);
+
+ return length * efl_player_progress_get(anim);
+}
+
+EOLIAN static void
+_efl_canvas_animation_player_efl_player_pos_set(Eo *eo_obj,
+ Efl_Canvas_Animation_Player_Data *pd EINA_UNUSED,
+ double sec)
+{
+ //TODO: this is not correct
+ if (!efl_player_seekable_get(eo_obj))
+ return;
+
+ EFL_ANIMATION_PLAYER_ANIMATION_GET(eo_obj, anim);
+ double length = efl_player_length_get(anim);
+ pd->progress = sec / length;
+ efl_animation_apply(anim, pd->progress, efl_animation_player_target_get(eo_obj));
+}
+
+EOLIAN static double
+_efl_canvas_animation_player_efl_player_progress_get(const Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Player_Data *pd)
+{
+ return pd->progress;
+}
+
+EOLIAN static void
+_efl_canvas_animation_player_efl_player_play_speed_set(Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Player_Data *pd,
+ double play_speed)
+{
+ //TODO: check reverse play case.
+ if (play_speed < 0)
+ return;
+ pd->play_speed = play_speed;
+}
+
+EOLIAN static double
+_efl_canvas_animation_player_efl_player_play_speed_get(const Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Player_Data *pd)
+{
+ return pd->play_speed;
+}
+
+EOLIAN static double
+_efl_canvas_animation_player_efl_player_length_get(const Eo *eo_obj,
+ Efl_Canvas_Animation_Player_Data *pd EINA_UNUSED)
+{
+ EFL_ANIMATION_PLAYER_ANIMATION_GET(eo_obj, anim);
+ return efl_playable_length_get(anim);
+}
+
+EOLIAN static Eina_Bool
+_efl_canvas_animation_player_efl_player_seekable_get(const Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Player_Data *pd EINA_UNUSED)
+{
+ EFL_ANIMATION_PLAYER_ANIMATION_GET(eo_obj, anim);
+ return efl_playable_seekable_get(anim);
+}
+
+EOLIAN static Efl_Object *
+_efl_canvas_animation_player_efl_object_constructor(Eo *eo_obj,
+ Efl_Canvas_Animation_Player_Data *pd)
+{
+ eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
+
+ pd->time.begin = 0.0;
+ pd->time.current = 0.0;
+
+ pd->animation = NULL;
+
+ pd->progress = 0.0;
+
+ //pd->auto_del = EINA_TRUE;
+
+ return eo_obj;
+}
+
+EOLIAN static void
+_efl_canvas_animation_player_efl_object_destructor(Eo *eo_obj,
+ Efl_Canvas_Animation_Player_Data *pd)
+{
+ if (pd->animator)
+ {
+ ecore_animator_del(pd->animator);
+ pd->animator = NULL;
+
+ //Reset the state of the target to the initial state
+ efl_player_stop(eo_obj);
+
+ efl_event_callback_call(eo_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, NULL);
+ }
+ efl_unref(pd->animation);
+
+ efl_destructor(efl_super(eo_obj, MY_CLASS));
+}
+
+EWAPI const Efl_Event_Description _EFL_ANIMATION_PLAYER_EVENT_PRE_STARTED =
+ EFL_EVENT_DESCRIPTION("pre_started");
+
+#include "efl_canvas_animation_player.eo.c"
diff --git a/src/lib/evas/canvas/efl_canvas_animation_player.eo b/src/lib/evas/canvas/efl_canvas_animation_player.eo
new file mode 100644
index 0000000000..a8e6dee9e8
--- /dev/null
+++ b/src/lib/evas/canvas/efl_canvas_animation_player.eo
@@ -0,0 +1,56 @@
+class Efl.Canvas.Animation_Player (Efl.Object, Efl.Player)
+{
+ [[Efl animation object class]]
+ eo_prefix: efl_animation_player;
+ methods {
+ @property animation {
+ set {}
+ get {}
+ values {
+ animation: Efl.Canvas.Animation;
+ }
+ }
+ @property auto_del {
+ [[Auto delete property]]
+ set {
+ }
+ get {
+ }
+ values {
+ auto_del: bool; [[$true to delete animation object automatically when animation is finished or animation is cancelled, $false otherwise.]]
+ }
+ }
+ @property target {
+ [[Target object property]]
+ set {
+ }
+ get {
+ }
+ values {
+ target: Efl.Canvas.Object; [[Target object which is applied animation.]]
+ }
+ }
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Object.destructor;
+ Efl.Player.start;
+ Efl.Player.stop;
+ Efl.Player.play { get; set; }
+ Efl.Player.playable { get; }
+ Efl.Player.pos { get; set; }
+ Efl.Player.progress { get;}
+ Efl.Player.play_speed { get; set; }
+ //Efl.Player.volume { get; set; }
+ //Efl.Player.mute { get; set; }
+ Efl.Player.length { get; }
+ Efl.Player.seekable { get; }
+ }
+ events {
+ /* FIXME: This event is similar to Efl.Canvas.Object.anim_started but with different type, might be confusing. */
+ started: void; [[Animation is started.]]
+ running: Efl.Canvas.Object_Animation_Event; [[Animation is running.]]
+ /* FIXME: This event is similar to Efl.Canvas.Object.anim_ended but with different type, might be confusing. */
+ ended: void; [[Animation is ended.]]
+ }
+}
diff --git a/src/lib/evas/canvas/efl_canvas_animation_player_private.h b/src/lib/evas/canvas/efl_canvas_animation_player_private.h
new file mode 100644
index 0000000000..f0128aaa74
--- /dev/null
+++ b/src/lib/evas/canvas/efl_canvas_animation_player_private.h
@@ -0,0 +1,52 @@
+#define EFL_ANIMATION_PLAYER_PROTECTED
+
+#include "evas_common_private.h"
+#include <Ecore.h>
+
+#define MY_CLASS EFL_CANVAS_ANIMATION_PLAYER_CLASS
+#define MY_CLASS_NAME efl_class_name_get(MY_CLASS)
+
+#if 0
+typedef struct _Target_State
+{
+ Evas_Coord x, y, w, h;
+ int r, g, b, a;
+
+ Evas_Map *map;
+ Eina_Bool enable_map : 1;
+} Target_State;
+#endif
+
+typedef struct _Efl_Canvas_Animation_Player_Data
+{
+ Ecore_Animator *animator;
+ Ecore_Timer *start_delay_timer;
+
+ struct {
+ double prev;
+ double begin;
+ double current;
+ double pause_begin;
+ } time;
+
+ Efl_Canvas_Animation *animation;
+ Efl_Canvas_Object *target;
+
+ double progress;
+ double play_speed;
+
+ int remaining_repeat_count;
+
+ Efl_Interpolator *interpolator;
+
+ Eina_Bool auto_del : 1;
+ Eina_Bool is_play : 1;
+ Eina_Bool keep_final_state : 1;
+ Eina_Bool is_direction_forward : 1;
+} Efl_Canvas_Animation_Player_Data;
+
+#define EFL_ANIMATION_PLAYER_DATA_GET(o, pd) \
+ Efl_Canvas_Animation_Player_Data *pd = efl_data_scope_get(o, EFL_CANVAS_ANIMATION_PLAYER_CLASS)
+
+#define EFL_ANIMATION_PLAYER_ANIMATION_GET(o, anim) \
+ Efl_Canvas_Animation *anim = efl_animation_player_animation_get(o)
diff --git a/src/lib/evas/canvas/efl_canvas_animation_private.h b/src/lib/evas/canvas/efl_canvas_animation_private.h
new file mode 100644
index 0000000000..c1fe16ff09
--- /dev/null
+++ b/src/lib/evas/canvas/efl_canvas_animation_private.h
@@ -0,0 +1,28 @@
+#define EFL_ANIMATION_PROTECTED
+
+#include "evas_common_private.h"
+#include <Ecore.h>
+
+typedef struct _Efl_Canvas_Animation_Data
+{
+ double duration;
+
+ double start_delay_time;
+
+ Efl_Canvas_Animation_Repeat_Mode repeat_mode;
+ int repeat_count;
+
+ Efl_Interpolator *interpolator;
+
+ Eina_Bool keep_final_state : 1;
+} Efl_Canvas_Animation_Data;
+
+#define EFL_ANIMATION_DATA_GET(o, pd) \
+ Efl_Canvas_Animation_Data *pd = efl_data_scope_get(o, EFL_CANVAS_ANIMATION_CLASS)
+
+#define GET_STATUS(from, to, progress) \
+ ((from) + (((to) - (from)) * (progress)))
+
+#define FINAL_STATE_IS_REVERSE(anim) \
+ ((efl_animation_repeat_mode_get(anim) == EFL_CANVAS_ANIMATION_REPEAT_MODE_REVERSE) && \
+ (efl_animation_repeat_count_get(anim) & 1))
diff --git a/src/lib/evas/canvas/efl_canvas_animation_rotate.c b/src/lib/evas/canvas/efl_canvas_animation_rotate.c
new file mode 100644
index 0000000000..d75f3475c6
--- /dev/null
+++ b/src/lib/evas/canvas/efl_canvas_animation_rotate.c
@@ -0,0 +1,164 @@
+#include "efl_canvas_animation_rotate_private.h"
+
+#define MY_CLASS EFL_CANVAS_ANIMATION_ROTATE_CLASS
+
+static double
+_rotation_get(Eo *target)
+{
+ double x1, x2, y1, y2;
+ double theta;
+
+ efl_gfx_map_coord_absolute_get(target, 0, &x1, &y1, NULL);
+ efl_gfx_map_coord_absolute_get(target, 1, &x2, &y2, NULL);
+ theta = atan((y2 - y1) / (x2 - x1));
+
+ return theta * 180 / M_PI;
+}
+
+EOLIAN static void
+_efl_canvas_animation_rotate_rotate_set(Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Rotate_Data *pd,
+ double from_degree,
+ double to_degree,
+ Efl_Canvas_Object *pivot,
+ double cx,
+ double cy)
+{
+ pd->from.degree = from_degree;
+ pd->to.degree = to_degree;
+
+ //TODO: check whether ref for pivot should be added.
+ pd->rel_pivot.obj = pivot;
+ pd->rel_pivot.cx = cx;
+ pd->rel_pivot.cy = cy;
+ pd->use_rel_pivot = EINA_TRUE;
+}
+
+EOLIAN static void
+_efl_canvas_animation_rotate_rotate_get(const Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Rotate_Data *pd,
+ double *from_degree,
+ double *to_degree,
+ Efl_Canvas_Object **pivot,
+ double *cx,
+ double *cy)
+{
+ if (!pd->use_rel_pivot)
+ {
+ ERR("Animation is done in absolute value.");
+ return;
+ }
+
+ if (from_degree)
+ *from_degree = pd->from.degree;
+
+ if (to_degree)
+ *to_degree = pd->to.degree;
+
+ if (pivot)
+ *pivot = pd->rel_pivot.obj;
+
+ if (cx)
+ *cx = pd->rel_pivot.cx;
+
+ if (cy)
+ *cy = pd->rel_pivot.cy;
+}
+
+EOLIAN static void
+_efl_canvas_animation_rotate_rotate_absolute_set(Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Rotate_Data *pd,
+ double from_degree,
+ double to_degree,
+ Evas_Coord cx,
+ Evas_Coord cy)
+{
+ pd->from.degree = from_degree;
+ pd->to.degree = to_degree;
+
+ pd->abs_pivot.cx = cx;
+ pd->abs_pivot.cy = cy;
+ pd->use_rel_pivot = EINA_FALSE;
+}
+
+EOLIAN static void
+_efl_canvas_animation_rotate_rotate_absolute_get(const Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Rotate_Data *pd,
+ double *from_degree,
+ double *to_degree,
+ Evas_Coord *cx,
+ Evas_Coord *cy)
+{
+ if (pd->use_rel_pivot)
+ {
+ ERR("Animation is done in relative value.");
+ return;
+ }
+
+ if (from_degree)
+ *from_degree = pd->from.degree;
+
+ if (to_degree)
+ *to_degree = pd->to.degree;
+
+ if (cx)
+ *cx = pd->abs_pivot.cx;
+
+ if (cy)
+ *cy = pd->abs_pivot.cy;
+}
+
+EOLIAN static double
+_efl_canvas_animation_rotate_efl_canvas_animation_animation_apply(Eo *eo_obj,
+ Efl_Canvas_Animation_Rotate_Data *pd,
+ double progress,
+ Efl_Canvas_Object *target)
+{
+ double new_degree;
+ double prev_degree;
+
+ progress = efl_animation_apply(efl_super(eo_obj, MY_CLASS), progress, target);
+ if (!target) return progress;
+
+ prev_degree = _rotation_get(target);
+ new_degree = GET_STATUS(pd->from.degree, pd->to.degree, progress);
+
+ if (pd->use_rel_pivot)
+ {
+ efl_gfx_map_rotate(target,
+ new_degree - prev_degree,
+ (pd->rel_pivot.obj) ? pd->rel_pivot.obj : target,
+ pd->rel_pivot.cx, pd->rel_pivot.cy);
+ }
+ else
+ {
+ efl_gfx_map_rotate_absolute(target,
+ new_degree - prev_degree,
+ pd->abs_pivot.cx, pd->abs_pivot.cy);
+ }
+
+ return progress;
+}
+
+EOLIAN static Efl_Object *
+_efl_canvas_animation_rotate_efl_object_constructor(Eo *eo_obj,
+ Efl_Canvas_Animation_Rotate_Data *pd)
+{
+ eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
+
+ pd->from.degree = 0.0;
+ pd->to.degree = 0.0;
+
+ pd->rel_pivot.obj = NULL;
+ pd->rel_pivot.cx = 0.5;
+ pd->rel_pivot.cy = 0.5;
+
+ pd->abs_pivot.cx = 0;
+ pd->abs_pivot.cy = 0;
+
+ pd->use_rel_pivot = EINA_TRUE;
+
+ return eo_obj;
+}
+
+#include "efl_canvas_animation_rotate.eo.c"
diff --git a/src/lib/evas/canvas/efl_animation_rotate.eo b/src/lib/evas/canvas/efl_canvas_animation_rotate.eo
index 2212de79d8..c7f9da197c 100644
--- a/src/lib/evas/canvas/efl_animation_rotate.eo
+++ b/src/lib/evas/canvas/efl_canvas_animation_rotate.eo
@@ -1,9 +1,8 @@
-import efl_animation_types;
-
-class Efl.Animation.Rotate (Efl.Animation)
+class Efl.Canvas.Animation_Rotate (Efl.Canvas.Animation)
{
[[Efl rotate animation class]]
- data: Efl_Animation_Rotate_Data;
+ eo_prefix: efl_animation_rotate;
+ data: Efl_Canvas_Animation_Rotate_Data;
methods {
@property rotate {
[[Rotate property]]
@@ -35,6 +34,6 @@ class Efl.Animation.Rotate (Efl.Animation)
}
implements {
Efl.Object.constructor;
- Efl.Animation.object_create;
+ Efl.Canvas.Animation.animation_apply;
}
}
diff --git a/src/lib/evas/canvas/efl_canvas_animation_rotate_private.h b/src/lib/evas/canvas/efl_canvas_animation_rotate_private.h
new file mode 100644
index 0000000000..e50db39bff
--- /dev/null
+++ b/src/lib/evas/canvas/efl_canvas_animation_rotate_private.h
@@ -0,0 +1,35 @@
+#define EFL_ANIMATION_PROTECTED
+
+#include "evas_common_private.h"
+#include <Ecore.h>
+#include "efl_canvas_animation_private.h"
+
+#define EFL_ANIMATION_ROTATE_DATA_GET(o, pd) \
+ Efl_Canvas_Animation_Rotate_Data *pd = efl_data_scope_get(o, EFL_CANVAS_ANIMATION_ROTATE_CLASS)
+
+typedef struct _Efl_Canvas_Animation_Rotate_Property
+{
+ double degree;
+} Efl_Canvas_Animation_Rotate_Property;
+
+typedef struct _Efl_Canvas_Animation_Rotate_Absolute_Pivot
+{
+ Evas_Coord cx, cy;
+} Efl_Canvas_Animation_Rotate_Absolute_Pivot;
+
+typedef struct _Efl_Canvas_Animation_Rotate_Relative_Pivot
+{
+ Efl_Canvas_Object *obj;
+ double cx, cy;
+} Efl_Canvas_Animation_Rotate_Relative_Pivot;
+
+typedef struct _Efl_Canvas_Animation_Rotate_Data
+{
+ Efl_Canvas_Animation_Rotate_Property from;
+ Efl_Canvas_Animation_Rotate_Property to;
+
+ Efl_Canvas_Animation_Rotate_Absolute_Pivot abs_pivot;
+ Efl_Canvas_Animation_Rotate_Relative_Pivot rel_pivot;
+
+ Eina_Bool use_rel_pivot;
+} Efl_Canvas_Animation_Rotate_Data;
diff --git a/src/lib/evas/canvas/efl_canvas_animation_scale.c b/src/lib/evas/canvas/efl_canvas_animation_scale.c
new file mode 100644
index 0000000000..b09d7a794b
--- /dev/null
+++ b/src/lib/evas/canvas/efl_canvas_animation_scale.c
@@ -0,0 +1,204 @@
+#include "efl_canvas_animation_scale_private.h"
+
+#define MY_CLASS EFL_CANVAS_ANIMATION_SCALE_CLASS
+
+static Efl_Canvas_Animation_Scale_Property
+_scale_get(Eo *target)
+{
+ double x1, x2, x3, y1, y2, y3, w, h;
+ Efl_Canvas_Animation_Scale_Property scale;
+ Eina_Rect geometry;
+
+ geometry = efl_gfx_entity_geometry_get(target);
+ efl_gfx_map_coord_absolute_get(target, 0, &x1, &y1, NULL);
+ efl_gfx_map_coord_absolute_get(target, 1, &x2, &y2, NULL);
+ efl_gfx_map_coord_absolute_get(target, 2, &x3, &y3, NULL);
+
+ w = sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)));
+ h = sqrt(((x3 - x2) * (x3 - x2)) + ((y3 - y2) * (y3 - y2)));
+
+ scale.scale_x = w / geometry.w;
+ scale.scale_y = h / geometry.h;
+
+ return scale;
+}
+
+EOLIAN static void
+_efl_canvas_animation_scale_scale_set(Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Scale_Data *pd,
+ double from_scale_x,
+ double from_scale_y,
+ double to_scale_x,
+ double to_scale_y,
+ Efl_Canvas_Object *pivot,
+ double cx,
+ double cy)
+{
+ pd->from.scale_x = from_scale_x;
+ pd->from.scale_y = from_scale_y;
+
+ pd->to.scale_x = to_scale_x;
+ pd->to.scale_y = to_scale_y;
+
+ pd->rel_pivot.obj = pivot;
+ pd->rel_pivot.cx = cx;
+ pd->rel_pivot.cy = cy;
+
+ pd->use_rel_pivot = EINA_TRUE;
+}
+
+EOLIAN static void
+_efl_canvas_animation_scale_scale_get(const Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Scale_Data *pd,
+ double *from_scale_x,
+ double *from_scale_y,
+ double *to_scale_x,
+ double *to_scale_y,
+ Efl_Canvas_Object **pivot,
+ double *cx,
+ double *cy)
+{
+ if (!pd->use_rel_pivot)
+ {
+ ERR("Animation is done in absolute value.");
+ return;
+ }
+
+ if (from_scale_x)
+ *from_scale_x = pd->from.scale_x;
+
+ if (from_scale_y)
+ *from_scale_y = pd->from.scale_y;
+
+ if (to_scale_x)
+ *to_scale_x = pd->to.scale_x;
+
+ if (to_scale_y)
+ *to_scale_y = pd->to.scale_y;
+
+ if (pivot)
+ *pivot = pd->rel_pivot.obj;
+
+ if (cx)
+ *cx = pd->rel_pivot.cx;
+
+ if (cy)
+ *cy = pd->rel_pivot.cy;
+}
+
+EOLIAN static void
+_efl_canvas_animation_scale_scale_absolute_set(Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Scale_Data *pd,
+ double from_scale_x,
+ double from_scale_y,
+ double to_scale_x,
+ double to_scale_y,
+ Evas_Coord cx,
+ Evas_Coord cy)
+{
+ pd->from.scale_x = from_scale_x;
+ pd->from.scale_y = from_scale_y;
+
+ pd->to.scale_x = to_scale_x;
+ pd->to.scale_y = to_scale_y;
+
+ pd->abs_pivot.cx = cx;
+ pd->abs_pivot.cy = cy;
+
+ pd->use_rel_pivot = EINA_FALSE;
+}
+
+EOLIAN static void
+_efl_canvas_animation_scale_scale_absolute_get(const Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Scale_Data *pd,
+ double *from_scale_x,
+ double *from_scale_y,
+ double *to_scale_x,
+ double *to_scale_y,
+ Evas_Coord *cx,
+ Evas_Coord *cy)
+{
+ if (pd->use_rel_pivot)
+ {
+ ERR("Animation is done in relative value.");
+ return;
+ }
+
+ if (from_scale_x)
+ *from_scale_x = pd->from.scale_x;
+
+ if (from_scale_y)
+ *from_scale_y = pd->from.scale_y;
+
+ if (to_scale_x)
+ *to_scale_x = pd->to.scale_x;
+
+ if (to_scale_y)
+ *to_scale_y = pd->to.scale_y;
+
+ if (cx)
+ *cx = pd->abs_pivot.cx;
+
+ if (cy)
+ *cy = pd->abs_pivot.cy;
+}
+
+EOLIAN static double
+_efl_canvas_animation_scale_efl_canvas_animation_animation_apply(Eo *eo_obj,
+ Efl_Canvas_Animation_Scale_Data *pd,
+ double progress,
+ Efl_Canvas_Object *target)
+{
+ Efl_Canvas_Animation_Scale_Property prev_scale;
+ Efl_Canvas_Animation_Scale_Property new_scale;
+
+ progress = efl_animation_apply(efl_super(eo_obj, MY_CLASS), progress, target);
+ if (!target) return progress;
+
+ prev_scale = _scale_get(target);
+ new_scale.scale_x = GET_STATUS(pd->from.scale_x, pd->to.scale_x, progress);
+ new_scale.scale_y = GET_STATUS(pd->from.scale_y, pd->to.scale_y, progress);
+
+ if (pd->use_rel_pivot)
+ {
+ efl_gfx_map_zoom(target,
+ new_scale.scale_x / prev_scale.scale_x,
+ new_scale.scale_y / prev_scale.scale_y,
+ (pd->rel_pivot.obj) ? pd->rel_pivot.obj : target,
+ pd->rel_pivot.cx, pd->rel_pivot.cy);
+ }
+ else
+ {
+ efl_gfx_map_zoom_absolute(target,
+ new_scale.scale_x / prev_scale.scale_x,
+ new_scale.scale_y / prev_scale.scale_y,
+ pd->abs_pivot.cx, pd->abs_pivot.cy);
+ }
+
+ return progress;
+}
+
+EOLIAN static Efl_Object *
+_efl_canvas_animation_scale_efl_object_constructor(Eo *eo_obj,
+ Efl_Canvas_Animation_Scale_Data *pd)
+{
+ eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
+
+ pd->from.scale_x = 1.0;
+ pd->from.scale_y = 1.0;
+ pd->to.scale_x = 1.0;
+ pd->to.scale_y = 1.0;
+
+ pd->rel_pivot.obj = NULL;
+ pd->rel_pivot.cx = 0.5;
+ pd->rel_pivot.cy = 0.5;
+
+ pd->abs_pivot.cx = 0;
+ pd->abs_pivot.cy = 0;
+
+ pd->use_rel_pivot = EINA_TRUE;
+
+ return eo_obj;
+}
+
+#include "efl_canvas_animation_scale.eo.c"
diff --git a/src/lib/evas/canvas/efl_animation_scale.eo b/src/lib/evas/canvas/efl_canvas_animation_scale.eo
index 34f1ec1cf4..79a4d2247b 100644
--- a/src/lib/evas/canvas/efl_animation_scale.eo
+++ b/src/lib/evas/canvas/efl_canvas_animation_scale.eo
@@ -1,9 +1,8 @@
-import efl_animation_types;
-
-class Efl.Animation.Scale (Efl.Animation)
+class Efl.Canvas.Animation_Scale (Efl.Canvas.Animation)
{
[[Efl scale animation class]]
- data: Efl_Animation_Scale_Data;
+ eo_prefix: efl_animation_scale;
+ data: Efl_Canvas_Animation_Scale_Data;
methods {
@property scale {
[[Scale property]]
@@ -39,6 +38,6 @@ class Efl.Animation.Scale (Efl.Animation)
}
implements {
Efl.Object.constructor;
- Efl.Animation.object_create;
+ Efl.Canvas.Animation.animation_apply;
}
}
diff --git a/src/lib/evas/canvas/efl_canvas_animation_scale_private.h b/src/lib/evas/canvas/efl_canvas_animation_scale_private.h
new file mode 100644
index 0000000000..020d9fdcb3
--- /dev/null
+++ b/src/lib/evas/canvas/efl_canvas_animation_scale_private.h
@@ -0,0 +1,35 @@
+#define EFL_ANIMATION_PROTECTED
+
+#include "evas_common_private.h"
+#include <Ecore.h>
+#include "efl_canvas_animation_private.h"
+
+#define EFL_ANIMATION_SCALE_DATA_GET(o, pd) \
+ Efl_Canvas_Animation_Scale_Data *pd = efl_data_scope_get(o, EFL_CANVAS_ANIMATION_SCALE_CLASS)
+
+typedef struct _Efl_Canvas_Animation_Scale_Property
+{
+ double scale_x, scale_y;
+} Efl_Canvas_Animation_Scale_Property;
+
+typedef struct _Efl_Canvas_Animation_Scale_Absolute_Pivot
+{
+ Evas_Coord cx, cy;
+} Efl_Canvas_Animation_Scale_Absolute_Pivot;
+
+typedef struct _Efl_Canvas_Animation_Scale_Relative_Pivot
+{
+ Efl_Canvas_Object *obj;
+ double cx, cy;
+} Efl_Canvas_Animation_Scale_Relative_Pivot;
+
+typedef struct _Efl_Canvas_Animation_Scale_Data
+{
+ Efl_Canvas_Animation_Scale_Property from;
+ Efl_Canvas_Animation_Scale_Property to;
+
+ Efl_Canvas_Animation_Scale_Absolute_Pivot abs_pivot;
+ Efl_Canvas_Animation_Scale_Relative_Pivot rel_pivot;
+
+ Eina_Bool use_rel_pivot;
+} Efl_Canvas_Animation_Scale_Data;
diff --git a/src/lib/evas/canvas/efl_canvas_animation_translate.c b/src/lib/evas/canvas/efl_canvas_animation_translate.c
new file mode 100644
index 0000000000..e0c9ef7424
--- /dev/null
+++ b/src/lib/evas/canvas/efl_canvas_animation_translate.c
@@ -0,0 +1,162 @@
+#include "efl_canvas_animation_translate_private.h"
+
+#define MY_CLASS EFL_CANVAS_ANIMATION_TRANSLATE_CLASS
+
+typedef struct __Translate_Property_Double
+{
+ double x;
+ double y;
+} _Translate_Property_Double;
+
+static _Translate_Property_Double
+_translation_get(Eo *target)
+{
+ double x1, x2, y1, y2;
+ _Translate_Property_Double translate;
+ Eina_Rect geometry;
+
+ geometry = efl_gfx_entity_geometry_get(target);
+
+ efl_gfx_map_coord_absolute_get(target, 0, &x1, &y1, NULL);
+ efl_gfx_map_coord_absolute_get(target, 2, &x2, &y2, NULL);
+ translate.x = ((x1 + x2) / 2.0) - (geometry.x + (geometry.w / 2.0));
+ translate.y = ((y1 + y2) / 2.0) - (geometry.y + (geometry.h / 2.0));
+
+ return translate;
+}
+
+EOLIAN static void
+_efl_canvas_animation_translate_translate_set(Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Translate_Data *pd,
+ Evas_Coord from_x,
+ Evas_Coord from_y,
+ Evas_Coord to_x,
+ Evas_Coord to_y)
+{
+ pd->from.move_x = from_x;
+ pd->from.move_y = from_y;
+
+ pd->to.move_x = to_x;
+ pd->to.move_y = to_y;
+
+ pd->use_rel_move = EINA_TRUE;
+}
+
+EOLIAN static void
+_efl_canvas_animation_translate_translate_get(const Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Translate_Data *pd,
+ Evas_Coord *from_x,
+ Evas_Coord *from_y,
+ Evas_Coord *to_x,
+ Evas_Coord *to_y)
+{
+ if (!pd->use_rel_move)
+ {
+ ERR("Animation is done in absolute value.");
+ return;
+ }
+
+ if (from_x)
+ *from_x = pd->from.move_x;
+ if (from_y)
+ *from_y = pd->from.move_y;
+
+ if (to_x)
+ *to_x = pd->to.move_x;
+ if (to_y)
+ *to_y = pd->to.move_y;
+}
+
+EOLIAN static void
+_efl_canvas_animation_translate_translate_absolute_set(Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Translate_Data *pd,
+ Evas_Coord from_x,
+ Evas_Coord from_y,
+ Evas_Coord to_x,
+ Evas_Coord to_y)
+{
+ pd->from.x = from_x;
+ pd->from.y = from_y;
+
+ pd->to.x = to_x;
+ pd->to.y = to_y;
+
+ pd->use_rel_move = EINA_FALSE;
+}
+
+EOLIAN static void
+_efl_canvas_animation_translate_translate_absolute_get(const Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Animation_Translate_Data *pd,
+ Evas_Coord *from_x,
+ Evas_Coord *from_y,
+ Evas_Coord *to_x,
+ Evas_Coord *to_y)
+{
+ if (pd->use_rel_move)
+ {
+ ERR("Animation is done in absolute value.");
+ return;
+ }
+
+ if (from_x)
+ *from_x = pd->from.x;
+ if (from_y)
+ *from_y = pd->from.y;
+
+ if (to_x)
+ *to_x = pd->to.x;
+ if (to_y)
+ *to_y = pd->to.y;
+}
+
+EOLIAN static double
+_efl_canvas_animation_translate_efl_canvas_animation_animation_apply(Eo *eo_obj,
+ Efl_Canvas_Animation_Translate_Data *pd,
+ double progress,
+ Efl_Canvas_Object *target)
+{
+ _Translate_Property_Double prev;
+ _Translate_Property_Double new;
+
+ progress = efl_animation_apply(efl_super(eo_obj, MY_CLASS), progress, target);
+ if (!target) return progress;
+
+ prev = _translation_get(target);
+ if (pd->use_rel_move)
+ {
+ new.x = GET_STATUS(pd->from.move_x, pd->to.move_x, progress);
+ new.y = GET_STATUS(pd->from.move_y, pd->to.move_y, progress);
+ }
+ else
+ {
+ new.x = GET_STATUS(pd->from.x, pd->to.x, progress);
+ new.y = GET_STATUS(pd->from.y, pd->to.y, progress);
+ }
+
+ efl_gfx_map_translate(target, new.x - prev.x, new.y - prev.y, 0.0);
+
+ return progress;
+}
+
+EOLIAN static Efl_Object *
+_efl_canvas_animation_translate_efl_object_constructor(Eo *eo_obj,
+ Efl_Canvas_Animation_Translate_Data *pd)
+{
+ eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
+
+ pd->from.move_x = 0;
+ pd->from.move_y = 0;
+ pd->from.x = 0;
+ pd->from.y = 0;
+
+ pd->to.move_x = 0;
+ pd->to.move_y = 0;
+ pd->to.x = 0;
+ pd->to.y = 0;
+
+ pd->use_rel_move = EINA_TRUE;
+
+ return eo_obj;
+}
+
+#include "efl_canvas_animation_translate.eo.c"
diff --git a/src/lib/evas/canvas/efl_animation_translate.eo b/src/lib/evas/canvas/efl_canvas_animation_translate.eo
index 68b7a77710..29276c4ec3 100644
--- a/src/lib/evas/canvas/efl_animation_translate.eo
+++ b/src/lib/evas/canvas/efl_canvas_animation_translate.eo
@@ -1,9 +1,8 @@
-import efl_animation_types;
-
-class Efl.Animation.Translate (Efl.Animation)
+class Efl.Canvas.Animation_Translate (Efl.Canvas.Animation)
{
[[Efl translate animation class]]
- data: Efl_Animation_Translate_Data;
+ eo_prefix: efl_animation_translate;
+ data: Efl_Canvas_Animation_Translate_Data;
methods {
@property translate {
[[Translate property]]
@@ -34,6 +33,6 @@ class Efl.Animation.Translate (Efl.Animation)
}
implements {
Efl.Object.constructor;
- Efl.Animation.object_create;
+ Efl.Canvas.Animation.animation_apply;
}
}
diff --git a/src/lib/evas/canvas/efl_canvas_animation_translate_private.h b/src/lib/evas/canvas/efl_canvas_animation_translate_private.h
new file mode 100644
index 0000000000..17c4b6d432
--- /dev/null
+++ b/src/lib/evas/canvas/efl_canvas_animation_translate_private.h
@@ -0,0 +1,22 @@
+#define EFL_ANIMATION_PROTECTED
+
+#include "evas_common_private.h"
+#include <Ecore.h>
+#include "efl_canvas_animation_private.h"
+
+#define EFL_ANIMATION_TRANSLATE_DATA_GET(o, pd) \
+ Efl_Canvas_Animation_Translate_Data *pd = efl_data_scope_get(o, EFL_CANVAS_ANIMATION_TRANSLATE_CLASS)
+
+typedef struct _Efl_Canvas_Animation_Translate_Property
+{
+ Evas_Coord move_x, move_y;
+ Evas_Coord x, y;
+} Efl_Canvas_Animation_Translate_Property;
+
+typedef struct _Efl_Canvas_Animation_Translate_Data
+{
+ Efl_Canvas_Animation_Translate_Property from;
+ Efl_Canvas_Animation_Translate_Property to;
+
+ Eina_Bool use_rel_move;
+} Efl_Canvas_Animation_Translate_Data;
diff --git a/src/lib/evas/canvas/efl_animation_types.eot b/src/lib/evas/canvas/efl_canvas_animation_types.eot
index bb29937f24..ad3aecc637 100644
--- a/src/lib/evas/canvas/efl_animation_types.eot
+++ b/src/lib/evas/canvas/efl_canvas_animation_types.eot
@@ -1,9 +1,9 @@
// ----------------------------------------------------------------------------
// All the below types are for Efl Animation
-struct Efl.Animation.Object.Running_Event_Info; [[Information of running event]]
+struct Efl.Canvas.Animation_Player_Event_Running; [[Information of event running]]
-enum Efl.Animation.Repeat_Mode
+enum Efl.Canvas.Animation_Repeat_Mode
{
[[Animation repeat mode]]
diff --git a/src/lib/evas/canvas/efl_canvas_object_event_grabber.c b/src/lib/evas/canvas/efl_canvas_event_grabber.c
index ddf31c90ba..df7282754b 100644
--- a/src/lib/evas/canvas/efl_canvas_object_event_grabber.c
+++ b/src/lib/evas/canvas/efl_canvas_event_grabber.c
@@ -1,8 +1,8 @@
#include "evas_common_private.h"
#include "evas_private.h"
-#include "efl_canvas_object_event_grabber.eo.h"
+#include "efl_canvas_event_grabber.eo.h"
-#define MY_CLASS EFL_CANVAS_OBJECT_EVENT_GRABBER_CLASS
+#define MY_CLASS EFL_CANVAS_EVENT_GRABBER_CLASS
#define MY_CLASS_NAME "Efl_Object_Event_Grabber"
#define MY_CLASS_NAME_LEGACY "evas_object_event_grabber"
@@ -46,7 +46,7 @@ _efl_canvas_group_group_iterator_free(Efl_Object_Event_Grabber_Iterator *it)
}
EOLIAN static Eina_Iterator*
-_efl_canvas_object_event_grabber_efl_canvas_group_group_members_iterate(const Eo *eo_obj, Efl_Object_Event_Grabber_Data *pd)
+_efl_canvas_event_grabber_efl_canvas_group_group_members_iterate(const Eo *eo_obj, Efl_Object_Event_Grabber_Data *pd)
{
Efl_Object_Event_Grabber_Iterator *it;
@@ -67,7 +67,7 @@ _efl_canvas_object_event_grabber_efl_canvas_group_group_members_iterate(const Eo
}
EOLIAN static Eina_Bool
-_efl_canvas_object_event_grabber_efl_canvas_group_group_member_is(const Eo *eo_obj, Efl_Object_Event_Grabber_Data *pd EINA_UNUSED, const Eo *sub_obj)
+_efl_canvas_event_grabber_efl_canvas_group_group_member_is(const Eo *eo_obj, Efl_Object_Event_Grabber_Data *pd EINA_UNUSED, const Eo *sub_obj)
{
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
Evas_Object_Protected_Data *sub = efl_data_scope_safe_get(sub_obj, EFL_CANVAS_OBJECT_CLASS);
@@ -123,13 +123,21 @@ _child_insert(Efl_Object_Event_Grabber_Data *pd, Evas_Object_Protected_Data *obj
if (a->layer->layer > obj->layer->layer) continue;
if (a->layer->layer < obj->layer->layer)
{
+ /* new object is higher layer than 'a' */
found = EINA_TRUE;
break;
}
EINA_INLIST_FOREACH(EINA_INLIST_GET(a->layer->objects), i)
{
- if (a == i || obj == i)
+ if (obj == i)
{
+ /* new object is below 'a' */
+ pd->contained = eina_list_prepend_relative(pd->contained, obj, a);
+ return;
+ }
+ else if (a == i)
+ {
+ /* new object is above 'a' */
found = EINA_TRUE;
break;
}
@@ -181,7 +189,7 @@ _efl_canvas_object_event_grabber_child_restack(void *data, const Efl_Event *even
}
static void
-_efl_canvas_object_event_grabber_child_del(void *data, const Efl_Event *event)
+_efl_canvas_object_event_grabber_child_invalidate(void *data, const Efl_Event *event)
{
Efl_Object_Event_Grabber_Data *pd = data;
@@ -189,7 +197,7 @@ _efl_canvas_object_event_grabber_child_del(void *data, const Efl_Event *event)
}
EOLIAN static void
-_efl_canvas_object_event_grabber_efl_canvas_group_group_member_add(Eo *eo_obj, Efl_Object_Event_Grabber_Data *pd, Eo *eo_sub)
+_efl_canvas_event_grabber_efl_canvas_group_group_member_add(Eo *eo_obj, Efl_Object_Event_Grabber_Data *pd, Eo *eo_sub)
{
Evas_Object_Protected_Data *sub = efl_data_scope_safe_get(eo_sub, EFL_CANVAS_OBJECT_CLASS);
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
@@ -236,18 +244,18 @@ _efl_canvas_object_event_grabber_efl_canvas_group_group_member_add(Eo *eo_obj, E
events->parent = eo_obj;
EINA_COW_WRITE_END(evas_object_events_cow, sub->events, events);
_child_insert(pd, sub);
- efl_event_callback_add(eo_sub, EFL_EVENT_DEL, _efl_canvas_object_event_grabber_child_del, pd);
+ efl_event_callback_add(eo_sub, EFL_EVENT_INVALIDATE, _efl_canvas_object_event_grabber_child_invalidate, pd);
if (eo_sub != pd->rect)
- efl_event_callback_add(eo_sub, EFL_GFX_EVENT_RESTACK, _efl_canvas_object_event_grabber_child_restack, pd);
+ efl_event_callback_add(eo_sub, EFL_GFX_ENTITY_EVENT_RESTACK, _efl_canvas_object_event_grabber_child_restack, pd);
}
EOLIAN static void
-_efl_canvas_object_event_grabber_efl_canvas_group_group_member_del(Eo *eo_obj EINA_UNUSED, Efl_Object_Event_Grabber_Data *pd, Eo *member)
+_efl_canvas_event_grabber_efl_canvas_group_group_member_del(Eo *eo_obj EINA_UNUSED, Efl_Object_Event_Grabber_Data *pd, Eo *member)
{
Evas_Object_Protected_Data *obj = efl_data_scope_get(member, EFL_CANVAS_OBJECT_CLASS);
- efl_event_callback_del(member, EFL_EVENT_DEL, _efl_canvas_object_event_grabber_child_del, pd);
- efl_event_callback_del(member, EFL_GFX_EVENT_RESTACK, _efl_canvas_object_event_grabber_child_restack, pd);
+ efl_event_callback_del(member, EFL_EVENT_INVALIDATE, _efl_canvas_object_event_grabber_child_invalidate, pd);
+ efl_event_callback_del(member, EFL_GFX_ENTITY_EVENT_RESTACK, _efl_canvas_object_event_grabber_child_restack, pd);
pd->contained = eina_list_remove(pd->contained, obj);
EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events)
@@ -256,45 +264,45 @@ _efl_canvas_object_event_grabber_efl_canvas_group_group_member_del(Eo *eo_obj EI
}
EOLIAN static void
-_efl_canvas_object_event_grabber_efl_canvas_group_group_change(Eo *eo_obj EINA_UNUSED, Efl_Object_Event_Grabber_Data *pd EINA_UNUSED)
+_efl_canvas_event_grabber_efl_canvas_group_group_change(Eo *eo_obj EINA_UNUSED, Efl_Object_Event_Grabber_Data *pd EINA_UNUSED)
{}
EOLIAN static void
-_efl_canvas_object_event_grabber_efl_canvas_group_group_calculate(Eo *eo_obj EINA_UNUSED, Efl_Object_Event_Grabber_Data *pd EINA_UNUSED)
+_efl_canvas_event_grabber_efl_canvas_group_group_calculate(Eo *eo_obj EINA_UNUSED, Efl_Object_Event_Grabber_Data *pd EINA_UNUSED)
{}
EOLIAN static void
-_efl_canvas_object_event_grabber_efl_canvas_group_group_need_recalculate_set(Eo *eo_obj EINA_UNUSED, Efl_Object_Event_Grabber_Data *pd EINA_UNUSED, Eina_Bool set EINA_UNUSED)
+_efl_canvas_event_grabber_efl_canvas_group_group_need_recalculate_set(Eo *eo_obj EINA_UNUSED, Efl_Object_Event_Grabber_Data *pd EINA_UNUSED, Eina_Bool set EINA_UNUSED)
{}
EOLIAN static Eina_Bool
-_efl_canvas_object_event_grabber_efl_canvas_group_group_need_recalculate_get(Eo *eo_obj EINA_UNUSED, Efl_Object_Event_Grabber_Data *pd EINA_UNUSED)
+_efl_canvas_event_grabber_efl_canvas_group_group_need_recalculate_get(const Eo *eo_obj EINA_UNUSED, Efl_Object_Event_Grabber_Data *pd EINA_UNUSED)
{
return EINA_FALSE;
}
EOLIAN static void
-_efl_canvas_object_event_grabber_efl_gfx_position_set(Eo *eo_obj, Efl_Object_Event_Grabber_Data *pd, Eina_Position2D pos)
+_efl_canvas_event_grabber_efl_gfx_entity_position_set(Eo *eo_obj, Efl_Object_Event_Grabber_Data *pd, Eina_Position2D pos)
{
- efl_gfx_position_set(efl_super(eo_obj, MY_CLASS), pos);
- efl_gfx_position_set(pd->rect, pos);
+ efl_gfx_entity_position_set(efl_super(eo_obj, MY_CLASS), pos);
+ efl_gfx_entity_position_set(pd->rect, pos);
}
EOLIAN static void
-_efl_canvas_object_event_grabber_efl_gfx_size_set(Eo *eo_obj, Efl_Object_Event_Grabber_Data *pd, Eina_Size2D sz)
+_efl_canvas_event_grabber_efl_gfx_entity_size_set(Eo *eo_obj, Efl_Object_Event_Grabber_Data *pd, Eina_Size2D sz)
{
- efl_gfx_size_set(efl_super(eo_obj, MY_CLASS), sz);
- efl_gfx_size_set(pd->rect, sz);
+ efl_gfx_entity_size_set(efl_super(eo_obj, MY_CLASS), sz);
+ efl_gfx_entity_size_set(pd->rect, sz);
}
EOLIAN static Eina_Bool
-_efl_canvas_object_event_grabber_efl_gfx_visible_get(Eo *eo_obj EINA_UNUSED, Efl_Object_Event_Grabber_Data *pd)
+_efl_canvas_event_grabber_efl_gfx_entity_visible_get(const Eo *eo_obj EINA_UNUSED, Efl_Object_Event_Grabber_Data *pd)
{
return pd->vis;
}
EOLIAN static void
-_efl_canvas_object_event_grabber_efl_gfx_visible_set(Eo *eo_obj EINA_UNUSED, Efl_Object_Event_Grabber_Data *pd, Eina_Bool set)
+_efl_canvas_event_grabber_efl_gfx_entity_visible_set(Eo *eo_obj EINA_UNUSED, Efl_Object_Event_Grabber_Data *pd, Eina_Bool set)
{
if (set)
{
@@ -305,13 +313,13 @@ _efl_canvas_object_event_grabber_efl_gfx_visible_set(Eo *eo_obj EINA_UNUSED, Efl
if (obj->object != pd->rect) _stacking_verify(pd, obj);
}
pd->vis = !!set;
- efl_gfx_visible_set(pd->rect, set);
+ efl_gfx_entity_visible_set(pd->rect, set);
if (pd->restack && pd->freeze && (!set))
_full_restack(pd);
}
EOLIAN static void
-_efl_canvas_object_event_grabber_efl_gfx_stack_layer_set(Eo *eo_obj, Efl_Object_Event_Grabber_Data *pd, short l)
+_efl_canvas_event_grabber_efl_gfx_stack_layer_set(Eo *eo_obj, Efl_Object_Event_Grabber_Data *pd, short l)
{
efl_gfx_stack_layer_set(efl_super(eo_obj, MY_CLASS), l);
efl_gfx_stack_layer_set(pd->rect, l);
@@ -331,7 +339,7 @@ _efl_canvas_object_event_grabber_restack(void *data, const Efl_Event *event)
}
EOLIAN static Eo *
-_efl_canvas_object_event_grabber_efl_object_constructor(Eo *eo_obj, Efl_Object_Event_Grabber_Data *pd)
+_efl_canvas_event_grabber_efl_object_constructor(Eo *eo_obj, Efl_Object_Event_Grabber_Data *pd)
{
Evas_Object_Protected_Data *obj;
@@ -342,7 +350,7 @@ _efl_canvas_object_event_grabber_efl_object_constructor(Eo *eo_obj, Efl_Object_E
obj->is_event_parent = 1;
obj->is_smart = 0;
- efl_event_callback_add(eo_obj, EFL_GFX_EVENT_RESTACK, _efl_canvas_object_event_grabber_restack, pd);
+ efl_event_callback_add(eo_obj, EFL_GFX_ENTITY_EVENT_RESTACK, _efl_canvas_object_event_grabber_restack, pd);
pd->rect = evas_object_rectangle_add(efl_parent_get(eo_obj));
evas_object_pointer_mode_set(pd->rect, EVAS_OBJECT_POINTER_MODE_NOGRAB);
efl_parent_set(pd->rect, eo_obj);
@@ -352,7 +360,7 @@ _efl_canvas_object_event_grabber_efl_object_constructor(Eo *eo_obj, Efl_Object_E
}
EOLIAN static void
-_efl_canvas_object_event_grabber_efl_object_destructor(Eo *eo_obj, Efl_Object_Event_Grabber_Data *pd)
+_efl_canvas_event_grabber_efl_object_destructor(Eo *eo_obj, Efl_Object_Event_Grabber_Data *pd)
{
Evas_Object_Protected_Data *obj;
Eina_List *l, *ln;
@@ -364,7 +372,7 @@ _efl_canvas_object_event_grabber_efl_object_destructor(Eo *eo_obj, Efl_Object_Ev
}
static void
-_efl_canvas_object_event_grabber_class_constructor(Efl_Class *klass)
+_efl_canvas_event_grabber_class_constructor(Efl_Class *klass)
{
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
}
@@ -377,7 +385,7 @@ evas_object_event_grabber_members_list(const Eo *eo_obj)
}
EOLIAN static void
-_efl_canvas_object_event_grabber_freeze_when_visible_set(Eo *eo_obj EINA_UNUSED, Efl_Object_Event_Grabber_Data *pd, Eina_Bool set)
+_efl_canvas_event_grabber_freeze_when_visible_set(Eo *eo_obj EINA_UNUSED, Efl_Object_Event_Grabber_Data *pd, Eina_Bool set)
{
set = !!set;
if (pd->freeze == set) return;
@@ -387,7 +395,7 @@ _efl_canvas_object_event_grabber_freeze_when_visible_set(Eo *eo_obj EINA_UNUSED,
}
EOLIAN static Eina_Bool
-_efl_canvas_object_event_grabber_freeze_when_visible_get(Eo *eo_obj EINA_UNUSED, Efl_Object_Event_Grabber_Data *pd)
+_efl_canvas_event_grabber_freeze_when_visible_get(const Eo *eo_obj EINA_UNUSED, Efl_Object_Event_Grabber_Data *pd)
{
return pd->freeze;
}
@@ -396,7 +404,7 @@ EAPI Evas_Object *
evas_object_event_grabber_add(Evas *eo_e)
{
EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(eo_e, EVAS_CANVAS_CLASS), NULL);
- return efl_add(MY_CLASS, eo_e, efl_canvas_object_legacy_ctor(efl_added));
+ return efl_add(MY_CLASS, evas_find(eo_e), efl_canvas_object_legacy_ctor(efl_added));
}
-#include "efl_canvas_object_event_grabber.eo.c"
+#include "efl_canvas_event_grabber.eo.c"
diff --git a/src/lib/evas/canvas/efl_canvas_object_event_grabber.eo b/src/lib/evas/canvas/efl_canvas_event_grabber.eo
index 06f586131e..f756820815 100644
--- a/src/lib/evas/canvas/efl_canvas_object_event_grabber.eo
+++ b/src/lib/evas/canvas/efl_canvas_event_grabber.eo
@@ -1,4 +1,4 @@
-class Efl.Canvas.Object.Event.Grabber (Efl.Canvas.Group)
+class Efl.Canvas.Event_Grabber (Efl.Canvas.Group)
{
[[Low-level rectangle object.
@@ -41,9 +41,9 @@ class Efl.Canvas.Object.Event.Grabber (Efl.Canvas.Group)
Efl.Canvas.Group.group_calculate;
Efl.Canvas.Group.group_change;
Efl.Canvas.Group.group_need_recalculate { get; set; }
- Efl.Gfx.position { set; }
- Efl.Gfx.size { set; }
- Efl.Gfx.visible { get; set; }
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
+ Efl.Gfx.Entity.visible { get; set; }
Efl.Gfx.Stack.layer { set; }
}
}
diff --git a/src/lib/evas/canvas/efl_canvas_filter_internal.eo b/src/lib/evas/canvas/efl_canvas_filter_internal.eo
index 0a2c34b547..e25eba1584 100644
--- a/src/lib/evas/canvas/efl_canvas_filter_internal.eo
+++ b/src/lib/evas/canvas/efl_canvas_filter_internal.eo
@@ -1,5 +1,4 @@
// import efl_gfx_types -> need to add Efl.Gfx.Color
-import eina_types;
/* Everything in this file is internal to Evas. It is not meant to be used
from outside EFL itself! */
@@ -83,10 +82,10 @@ mixin Efl.Canvas.Filter.Internal (Efl.Gfx.Filter, Efl.Object)
return: bool; [[Indicates success from the object render function.]]
params {
filter: void_ptr; [[Current filter context]]
- engine: void_ptr; [[Engine context]]
- output: void_ptr; [[Output context]]
+ engine: void_ptr; [[Engine context]]
+ output: void_ptr; [[Output context]]
drawctx: void_ptr; [[Draw context (for evas engine)]]
- data: void_ptr; [[Private data used by textblock]]
+ data: void_ptr; [[Private data used by textblock]]
l: int; [[Left]]
r: int; [[Right]]
t: int; [[Top]]
diff --git a/src/lib/evas/canvas/efl_canvas_group.eo b/src/lib/evas/canvas/efl_canvas_group.eo
index 62c6df5bde..eecb255ad3 100644
--- a/src/lib/evas/canvas/efl_canvas_group.eo
+++ b/src/lib/evas/canvas/efl_canvas_group.eo
@@ -130,8 +130,8 @@ class Efl.Canvas.Group (Efl.Canvas.Object)
Efl.Object.destructor;
Efl.Object.debug_name_override;
Efl.Gfx.Color.color { set; }
- Efl.Gfx.visible { set; }
- Efl.Gfx.position { set; }
+ Efl.Gfx.Entity.visible { set; }
+ Efl.Gfx.Entity.position { set; }
Efl.Canvas.Object.clip { set; }
Efl.Canvas.Object.no_render { set; }
Efl.Canvas.Object.paragraph_direction { get; set; }
diff --git a/src/lib/evas/canvas/efl_canvas_image.c b/src/lib/evas/canvas/efl_canvas_image.c
index 0a71b98da0..f2ee207d4b 100644
--- a/src/lib/evas/canvas/efl_canvas_image.c
+++ b/src/lib/evas/canvas/efl_canvas_image.c
@@ -48,24 +48,24 @@ _evas_image_mmap_get(const Eo *eo_obj, const Eina_File **f, const char **key)
}
EOLIAN static void
-_efl_canvas_image_efl_file_mmap_get(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED,
+_efl_canvas_image_efl_file_mmap_get(const Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED,
const Eina_File **f, const char **key)
{
_evas_image_mmap_get(eo_obj, f, key);
}
-Efl_Image_Load_Error
+Efl_Gfx_Image_Load_Error
_evas_image_load_error_get(const Eo *eo_obj)
{
Evas_Image_Data *o = efl_data_scope_get(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS);
- Efl_Image_Load_Error r = efl_file_load_error_get(efl_cast(eo_obj, EFL_FILE_MIXIN));
+ Efl_Gfx_Image_Load_Error r = efl_file_load_error_get(efl_cast(eo_obj, EFL_FILE_MIXIN));
- if (r != EFL_IMAGE_LOAD_ERROR_NONE) return r;
+ if (r != EFL_GFX_IMAGE_LOAD_ERROR_NONE) return r;
return o->load_error;
}
-EOLIAN static Efl_Image_Load_Error
-_efl_canvas_image_efl_file_load_error_get(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
+EOLIAN static Efl_Gfx_Image_Load_Error
+_efl_canvas_image_efl_file_load_error_get(const Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
{
return _evas_image_load_error_get(eo_obj);
}
@@ -111,7 +111,7 @@ _evas_image_load_async_start(Eo *eo_obj)
}
EOLIAN static void
-_efl_canvas_image_efl_image_load_load_async_start(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
+_efl_canvas_image_efl_gfx_image_load_controller_load_async_start(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
{
_evas_image_load_async_start(eo_obj);
}
@@ -127,7 +127,7 @@ _evas_image_load_async_cancel(Eo *eo_obj)
}
EOLIAN static void
-_efl_canvas_image_efl_image_load_load_async_cancel(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
+_efl_canvas_image_efl_gfx_image_load_controller_load_async_cancel(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
{
_evas_image_load_async_cancel(eo_obj);
}
@@ -155,7 +155,7 @@ _evas_image_load_dpi_set(Eo *eo_obj, double dpi)
}
EOLIAN static void
-_efl_canvas_image_efl_image_load_load_dpi_set(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED, double dpi)
+_efl_canvas_image_efl_gfx_image_load_controller_load_dpi_set(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED, double dpi)
{
_evas_image_load_dpi_set(eo_obj, dpi);
}
@@ -169,7 +169,7 @@ _evas_image_load_dpi_get(const Eo *eo_obj)
}
EOLIAN static double
-_efl_canvas_image_efl_image_load_load_dpi_get(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
+_efl_canvas_image_efl_gfx_image_load_controller_load_dpi_get(const Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
{
return _evas_image_load_dpi_get(eo_obj);
}
@@ -201,7 +201,7 @@ _evas_image_load_size_set(Eo *eo_obj, int w, int h)
}
EOLIAN static void
-_efl_canvas_image_efl_image_load_load_size_set(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED, Eina_Size2D sz)
+_efl_canvas_image_efl_gfx_image_load_controller_load_size_set(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED, Eina_Size2D sz)
{
_evas_image_load_size_set(eo_obj, sz.w, sz.h);
}
@@ -216,7 +216,7 @@ _evas_image_load_size_get(const Eo *eo_obj, int *w, int *h)
}
EOLIAN static Eina_Size2D
-_efl_canvas_image_efl_image_load_load_size_get(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
+_efl_canvas_image_efl_gfx_image_load_controller_load_size_get(const Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
{
Eina_Size2D sz;
_evas_image_load_size_get(eo_obj, &sz.w, &sz.h);
@@ -246,7 +246,7 @@ _evas_image_load_scale_down_set(Eo *eo_obj, int scale_down)
}
EOLIAN static void
-_efl_canvas_image_efl_image_load_load_scale_down_set(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED, int scale_down)
+_efl_canvas_image_efl_gfx_image_load_controller_load_scale_down_set(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED, int scale_down)
{
_evas_image_load_scale_down_set(eo_obj, scale_down);
}
@@ -260,7 +260,7 @@ _evas_image_load_scale_down_get(const Eo *eo_obj)
}
EOLIAN static int
-_efl_canvas_image_efl_image_load_load_scale_down_get(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
+_efl_canvas_image_efl_gfx_image_load_controller_load_scale_down_get(const Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
{
return _evas_image_load_scale_down_get(eo_obj);
}
@@ -273,7 +273,7 @@ _evas_image_load_head_skip_set(const Eo *eo_obj, Eina_Bool skip)
}
EOLIAN static void
-_efl_canvas_image_efl_image_load_load_skip_header_set(Eo *eo_obj, void *_pd EINA_UNUSED, Eina_Bool skip)
+_efl_canvas_image_efl_gfx_image_load_controller_load_skip_header_set(Eo *eo_obj, void *_pd EINA_UNUSED, Eina_Bool skip)
{
_evas_image_load_head_skip_set(eo_obj, skip);
}
@@ -286,7 +286,7 @@ _evas_image_load_head_skip_get(const Eo *eo_obj)
}
EOLIAN static Eina_Bool
-_efl_canvas_image_efl_image_load_load_skip_header_get(Eo *eo_obj, void *_pd EINA_UNUSED)
+_efl_canvas_image_efl_gfx_image_load_controller_load_skip_header_get(const Eo *eo_obj, void *_pd EINA_UNUSED)
{
return _evas_image_load_head_skip_get(eo_obj);
}
@@ -320,7 +320,7 @@ _evas_image_load_region_set(Eo *eo_obj, int x, int y, int w, int h)
}
EOLIAN static void
-_efl_canvas_image_efl_image_load_load_region_set(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED, Eina_Rect region)
+_efl_canvas_image_efl_gfx_image_load_controller_load_region_set(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED, Eina_Rect region)
{
_evas_image_load_region_set(eo_obj, region.x, region.y, region.w, region.h);
}
@@ -337,7 +337,7 @@ _evas_image_load_region_get(const Eo *eo_obj, int *x, int *y, int *w, int *h)
}
EOLIAN static Eina_Rect
-_efl_canvas_image_efl_image_load_load_region_get(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
+_efl_canvas_image_efl_gfx_image_load_controller_load_region_get(const Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
{
Eina_Rect r;
_evas_image_load_region_get(eo_obj, &r.x, &r.y, &r.w, &r.h);
@@ -359,7 +359,7 @@ _evas_image_load_orientation_set(Eo *eo_obj, Eina_Bool enable)
}
EOLIAN static void
-_efl_canvas_image_efl_image_load_load_orientation_set(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED, Eina_Bool enable)
+_efl_canvas_image_efl_gfx_image_load_controller_load_orientation_set(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED, Eina_Bool enable)
{
_evas_image_load_orientation_set(eo_obj, enable);
}
@@ -373,7 +373,7 @@ _evas_image_load_orientation_get(const Eo *eo_obj)
}
EOLIAN static Eina_Bool
-_efl_canvas_image_efl_image_load_load_orientation_get(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
+_efl_canvas_image_efl_gfx_image_load_controller_load_orientation_get(const Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
{
return _evas_image_load_orientation_get(eo_obj);
}
@@ -388,7 +388,7 @@ _evas_image_load_region_support_get(const Eo *eo_obj)
}
EOLIAN static Eina_Bool
-_efl_canvas_image_efl_image_load_load_region_support_get(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
+_efl_canvas_image_efl_gfx_image_load_controller_load_region_support_get(const Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
{
return _evas_image_load_region_support_get(eo_obj);
}
@@ -407,7 +407,7 @@ _evas_image_animated_get(const Eo *eo_obj)
}
EOLIAN static Eina_Bool
-_efl_canvas_image_efl_image_animated_animated_get(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
+_efl_canvas_image_efl_gfx_image_animation_controller_animated_get(const Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
{
return _evas_image_animated_get(eo_obj);
}
@@ -427,12 +427,12 @@ _evas_image_animated_frame_count_get(const Eo *eo_obj)
}
EOLIAN static int
-_efl_canvas_image_efl_image_animated_animated_frame_count_get(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
+_efl_canvas_image_efl_gfx_image_animation_controller_animated_frame_count_get(const Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
{
return _evas_image_animated_frame_count_get(eo_obj);
}
-Efl_Image_Animated_Loop_Hint
+Efl_Gfx_Image_Animation_Controller_Loop_Hint
_evas_image_animated_loop_type_get(const Eo *eo_obj)
{
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
@@ -440,13 +440,13 @@ _evas_image_animated_loop_type_get(const Eo *eo_obj)
if (!ENFN->image_animated_loop_type_get ||
!evas_object_image_animated_get(eo_obj))
- return EFL_IMAGE_ANIMATED_LOOP_HINT_NONE;
+ return EFL_GFX_IMAGE_ANIMATION_CONTROLLER_LOOP_HINT_NONE;
- return (Efl_Image_Animated_Loop_Hint) ENFN->image_animated_loop_type_get(ENC, o->engine_data);
+ return (Efl_Gfx_Image_Animation_Controller_Loop_Hint) ENFN->image_animated_loop_type_get(ENC, o->engine_data);
}
-EOLIAN static Efl_Image_Animated_Loop_Hint
-_efl_canvas_image_efl_image_animated_animated_loop_type_get(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
+EOLIAN static Efl_Gfx_Image_Animation_Controller_Loop_Hint
+_efl_canvas_image_efl_gfx_image_animation_controller_animated_loop_type_get(const Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
{
return _evas_image_animated_loop_type_get(eo_obj);
}
@@ -465,7 +465,7 @@ _evas_image_animated_loop_count_get(const Eo *eo_obj)
}
EOLIAN static int
-_efl_canvas_image_efl_image_animated_animated_loop_count_get(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
+_efl_canvas_image_efl_gfx_image_animation_controller_animated_loop_count_get(const Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
{
return _evas_image_animated_loop_count_get(eo_obj);
}
@@ -489,7 +489,7 @@ _evas_image_animated_frame_duration_get(const Eo *eo_obj, int start_frame, int f
}
EOLIAN static double
-_efl_canvas_image_efl_image_animated_animated_frame_duration_get(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED, int start_frame, int frame_num)
+_efl_canvas_image_efl_gfx_image_animation_controller_animated_frame_duration_get(const Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED, int start_frame, int frame_num)
{
return _evas_image_animated_frame_duration_get(eo_obj, start_frame, frame_num);
}
@@ -531,7 +531,7 @@ _evas_image_animated_frame_set(Eo *eo_obj, int frame_index)
}
EOLIAN static Eina_Bool
-_efl_canvas_image_efl_image_animated_animated_frame_set(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED, int frame_index)
+_efl_canvas_image_efl_gfx_image_animation_controller_animated_frame_set(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED, int frame_index)
{
return _evas_image_animated_frame_set(eo_obj, frame_index);
}
@@ -547,13 +547,13 @@ _evas_image_animated_frame_get(const Eo *eo_obj)
}
EOLIAN static int
-_efl_canvas_image_efl_image_animated_animated_frame_get(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
+_efl_canvas_image_efl_gfx_image_animation_controller_animated_frame_get(const Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
{
return _evas_image_animated_frame_get(eo_obj);
}
EOLIAN static Eina_Size2D
-_efl_canvas_image_efl_gfx_buffer_buffer_size_get(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
+_efl_canvas_image_efl_gfx_buffer_buffer_size_get(const Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
{
Evas_Image_Data *o = efl_data_scope_get(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS);
@@ -784,7 +784,7 @@ _efl_canvas_image_efl_object_dbg_info_get(Eo *obj, void *pd EINA_UNUSED, Efl_Dbg
{
efl_dbg_info_get(efl_super(obj, MY_CLASS), root);
- if ((efl_file_load_error_get(obj) != EFL_IMAGE_LOAD_ERROR_NONE) &&
+ if ((efl_file_load_error_get(obj) != EFL_GFX_IMAGE_LOAD_ERROR_NONE) &&
(root))
{
Efl_Dbg_Info *group = EFL_DBG_INFO_LIST_APPEND(root, MY_CLASS_NAME);
diff --git a/src/lib/evas/canvas/efl_canvas_image.eo b/src/lib/evas/canvas/efl_canvas_image.eo
index 0164b2d038..7edcb0bc13 100644
--- a/src/lib/evas/canvas/efl_canvas_image.eo
+++ b/src/lib/evas/canvas/efl_canvas_image.eo
@@ -1,5 +1,5 @@
-class Efl.Canvas.Image (Efl.Canvas.Image.Internal, Efl.Gfx.Buffer,
- Efl.Image.Load, Efl.Image.Animated,
+class Efl.Canvas.Image (Efl.Canvas.Image_Internal, Efl.Gfx.Buffer,
+ Efl.Gfx.Image_Load_Controller, Efl.Gfx.Image_Animation_Controller,
Efl.File)
{
[[Low-level Image object.
@@ -18,20 +18,20 @@ class Efl.Canvas.Image (Efl.Canvas.Image.Internal, Efl.Gfx.Buffer,
Efl.Gfx.Buffer.buffer_unmap;
Efl.File.mmap { get; set; }
Efl.File.load_error { get; }
- Efl.Image.Animated.animated { get; }
- Efl.Image.Animated.animated_frame { get; set; }
- Efl.Image.Animated.animated_frame_count { get; }
- Efl.Image.Animated.animated_loop_type { get; }
- Efl.Image.Animated.animated_loop_count { get; }
- Efl.Image.Animated.animated_frame_duration { get; }
- Efl.Image.Load.load_async_start;
- Efl.Image.Load.load_async_cancel;
- Efl.Image.Load.load_dpi { get; set; }
- Efl.Image.Load.load_size { get; set; }
- Efl.Image.Load.load_orientation { get; set; }
- Efl.Image.Load.load_scale_down { get; set; }
- Efl.Image.Load.load_skip_header { get; set; }
- Efl.Image.Load.load_region { get; set; }
- Efl.Image.Load.load_region_support { get; }
+ Efl.Gfx.Image_Animation_Controller.animated { get; }
+ Efl.Gfx.Image_Animation_Controller.animated_frame { get; set; }
+ Efl.Gfx.Image_Animation_Controller.animated_frame_count { get; }
+ Efl.Gfx.Image_Animation_Controller.animated_loop_type { get; }
+ Efl.Gfx.Image_Animation_Controller.animated_loop_count { get; }
+ Efl.Gfx.Image_Animation_Controller.animated_frame_duration { get; }
+ Efl.Gfx.Image_Load_Controller.load_async_start;
+ Efl.Gfx.Image_Load_Controller.load_async_cancel;
+ Efl.Gfx.Image_Load_Controller.load_dpi { get; set; }
+ Efl.Gfx.Image_Load_Controller.load_size { get; set; }
+ Efl.Gfx.Image_Load_Controller.load_orientation { get; set; }
+ Efl.Gfx.Image_Load_Controller.load_scale_down { get; set; }
+ Efl.Gfx.Image_Load_Controller.load_skip_header { get; set; }
+ Efl.Gfx.Image_Load_Controller.load_region { get; set; }
+ Efl.Gfx.Image_Load_Controller.load_region_support { get; }
}
}
diff --git a/src/lib/evas/canvas/efl_canvas_image_internal.eo b/src/lib/evas/canvas/efl_canvas_image_internal.eo
index f21053a371..1ccb02965f 100644
--- a/src/lib/evas/canvas/efl_canvas_image_internal.eo
+++ b/src/lib/evas/canvas/efl_canvas_image_internal.eo
@@ -1,8 +1,7 @@
-abstract Efl.Canvas.Image.Internal (Efl.Canvas.Object, Efl.Canvas.Filter.Internal,
- Efl.Image, Efl.Gfx.Buffer,
+abstract Efl.Canvas.Image_Internal (Efl.Canvas.Object, Efl.Canvas.Filter.Internal,
+ Efl.Gfx.Image, Efl.Gfx.Buffer,
Efl.Gfx.Fill, Efl.Gfx.View,
- Efl.Orientation, Efl.Flipable,
- Efl.File)
+ Efl.Orientation, Efl.File)
{
[[Efl canvas internal image class]]
data: Evas_Image_Data;
@@ -13,15 +12,15 @@ abstract Efl.Canvas.Image.Internal (Efl.Canvas.Object, Efl.Canvas.Filter.Interna
Efl.Object.debug_name_override;
Efl.File.save;
Efl.Orientation.orientation { get; set; }
- Efl.Flipable.flip { get; set; }
- Efl.Image.smooth_scale { get; set; }
- Efl.Image.ratio { get; }
- Efl.Image.border { get; set; }
- Efl.Image.border_scale { get; set; }
- Efl.Image.border_center_fill { get; set; }
- Efl.Image.scale_hint { get; set; }
- Efl.Image.content_hint { get; set; }
- Efl.Image.image_size { get; }
+ Efl.Orientation.flip { get; set; }
+ Efl.Gfx.Image.smooth_scale { get; set; }
+ Efl.Gfx.Image.ratio { get; }
+ Efl.Gfx.Image.border { get; set; }
+ Efl.Gfx.Image.border_scale { get; set; }
+ Efl.Gfx.Image.border_center_fill { get; set; }
+ Efl.Gfx.Image.scale_hint { get; set; }
+ Efl.Gfx.Image.content_hint { get; set; }
+ Efl.Gfx.Image.image_size { get; }
Efl.Gfx.Buffer.alpha { get; set; }
Efl.Gfx.Buffer.buffer_update_add;
Efl.Gfx.Buffer.colorspace { get; }
diff --git a/src/lib/evas/canvas/efl_canvas_object.eo b/src/lib/evas/canvas/efl_canvas_object.eo
index 7d85781ef5..2f4d3fe28c 100644
--- a/src/lib/evas/canvas/efl_canvas_object.eo
+++ b/src/lib/evas/canvas/efl_canvas_object.eo
@@ -1,9 +1,10 @@
import efl_text_types;
-import efl_animation_types;
-abstract Efl.Canvas.Object (Efl.Object, Efl.Gfx, Efl.Gfx.Color, Efl.Gfx.Stack, Efl.Animator,
- Efl.Input.Interface, Efl.Gfx.Size.Hint,
- Efl.Gfx.Map, Efl.Loop.Consumer, Efl.Ui.Base, Efl.Canvas.Pointer)
+struct Efl.Canvas.Object_Animation_Event; [[Information of animation events]]
+
+abstract Efl.Canvas.Object (Efl.Object, Efl.Gfx.Entity, Efl.Gfx.Color, Efl.Gfx.Stack, Efl.Animator,
+ Efl.Input.Interface, Efl.Gfx.Size_Hint,
+ Efl.Gfx.Map, Efl.Loop_Consumer, Efl.Ui.Base, Efl.Canvas.Pointer)
{
[[Efl canvas object abstract class]]
legacy_prefix: evas_object;
@@ -443,7 +444,7 @@ abstract Efl.Canvas.Object (Efl.Object, Efl.Gfx, Efl.Gfx.Color, Efl.Gfx.Stack, E
The default paragraph direction is $inherit.
]]
values {
- dir: Efl.Text.Bidirectional_Type; [[Paragraph direction for the given object.]]
+ dir: Efl.Text_Bidirectional_Type; [[Paragraph direction for the given object.]]
}
}
clipees_has @const {
@@ -576,32 +577,32 @@ abstract Efl.Canvas.Object (Efl.Object, Efl.Gfx, Efl.Gfx.Color, Efl.Gfx.Stack, E
}
}
@property event_animation {
- [[Set the $animation which starts when the given $event_name happens to the object.]]
+ [[Set the $animation which starts when the given $desc happens to the object.]]
get { legacy: null; }
set { legacy: null; }
keys {
- @cref event_type: Efl.Event.Description;
+ @cref desc: Efl.Event_Description;
[[The event description for which the given $animation is set.]]
}
values {
- animation: Efl.Animation;
- [[The animation which starts when the given $event_name
+ animation: Efl.Canvas.Animation;
+ [[The animation which starts when the given $desc
happens to the object.]]
}
}
}
implements {
Efl.Object.constructor;
- Efl.Object.destructor;
Efl.Object.finalize;
+ Efl.Object.invalidate;
+ Efl.Object.destructor;
Efl.Object.provider_find;
- Efl.Object.del;
Efl.Object.debug_name_override;
- Efl.Gfx.visible { get; set; }
+ Efl.Gfx.Entity.visible { get; set; }
Efl.Gfx.Color.color { get; set; }
- Efl.Gfx.geometry { get; set; }
- Efl.Gfx.position { get; set; }
- Efl.Gfx.size { get; set; }
+ Efl.Gfx.Entity.geometry { get; set; }
+ Efl.Gfx.Entity.position { get; set; }
+ Efl.Gfx.Entity.size { get; set; }
Efl.Gfx.Stack.layer { get; set; }
Efl.Gfx.Stack.below { get; }
Efl.Gfx.Stack.above { get; }
@@ -609,17 +610,22 @@ abstract Efl.Canvas.Object (Efl.Object, Efl.Gfx, Efl.Gfx.Color, Efl.Gfx.Stack, E
Efl.Gfx.Stack.stack_above;
Efl.Gfx.Stack.raise;
Efl.Gfx.Stack.lower;
- Efl.Gfx.Size.Hint.hint_aspect { get; set; }
- Efl.Gfx.Size.Hint.hint_align { get; set; }
- Efl.Gfx.Size.Hint.hint_combined_min { get; }
- Efl.Gfx.Size.Hint.hint_restricted_min { get; set; }
- Efl.Gfx.Size.Hint.hint_min { get; set; }
- Efl.Gfx.Size.Hint.hint_max { get; set; }
- Efl.Gfx.Size.Hint.hint_margin { get; set; }
- Efl.Gfx.Size.Hint.hint_weight { get; set; }
- Efl.Gfx.scale { set; get; }
+ Efl.Gfx.Size_Hint.hint_aspect { get; set; }
+ Efl.Gfx.Size_Hint.hint_align { get; set; }
+ Efl.Gfx.Size_Hint.hint_combined_min { get; }
+ Efl.Gfx.Size_Hint.hint_restricted_min { get; set; }
+ Efl.Gfx.Size_Hint.hint_min { get; set; }
+ Efl.Gfx.Size_Hint.hint_max { get; set; }
+ Efl.Gfx.Size_Hint.hint_margin { get; set; }
+ Efl.Gfx.Size_Hint.hint_weight { get; set; }
+ Efl.Gfx.Entity.scale { set; get; }
Efl.Input.Interface.seat_event_filter { get; set; }
- Efl.Loop.Consumer.loop { get; }
+ Efl.Loop_Consumer.loop { get; }
Efl.Canvas.Pointer.pointer_inside { get; }
}
+ events {
+ anim_started: Efl.Canvas.Object_Animation_Event; [[Animation is started.]]
+ anim_running: Efl.Canvas.Object_Animation_Event; [[Animation is running.]]
+ anim_ended: Efl.Canvas.Object_Animation_Event; [[Animation is ended.]]
+ }
}
diff --git a/src/lib/evas/canvas/efl_canvas_proxy.c b/src/lib/evas/canvas/efl_canvas_proxy.c
index 60049ecaaf..b057400808 100644
--- a/src/lib/evas/canvas/efl_canvas_proxy.c
+++ b/src/lib/evas/canvas/efl_canvas_proxy.c
@@ -70,7 +70,7 @@ _evas_image_proxy_source_get(const Eo *eo_obj)
}
EOLIAN static Evas_Object *
-_efl_canvas_proxy_source_get(Eo *eo_obj, void *_pd EINA_UNUSED)
+_efl_canvas_proxy_source_get(const Eo *eo_obj, void *_pd EINA_UNUSED)
{
return _evas_image_proxy_source_get(eo_obj);
}
@@ -107,7 +107,7 @@ _evas_image_proxy_source_clip_get(const Eo *eo_obj)
}
EOLIAN static Eina_Bool
-_efl_canvas_proxy_source_clip_get(Eo *eo_obj, void *_pd EINA_UNUSED)
+_efl_canvas_proxy_source_clip_get(const Eo *eo_obj, void *_pd EINA_UNUSED)
{
return _evas_image_proxy_source_clip_get(eo_obj);
}
@@ -144,7 +144,7 @@ _evas_image_proxy_source_events_get(const Eo *eo_obj)
}
EOLIAN static Eina_Bool
-_efl_canvas_proxy_source_events_get(Eo *eo_obj, void *_pd EINA_UNUSED)
+_efl_canvas_proxy_source_events_get(const Eo *eo_obj, void *_pd EINA_UNUSED)
{
return _evas_image_proxy_source_events_get(eo_obj);
}
diff --git a/src/lib/evas/canvas/efl_canvas_proxy.eo b/src/lib/evas/canvas/efl_canvas_proxy.eo
index b8048fbaed..3814dcebeb 100644
--- a/src/lib/evas/canvas/efl_canvas_proxy.eo
+++ b/src/lib/evas/canvas/efl_canvas_proxy.eo
@@ -1,4 +1,4 @@
-class Efl.Canvas.Proxy (Efl.Canvas.Image.Internal, Efl.Gfx.Buffer)
+class Efl.Canvas.Proxy (Efl.Canvas.Image_Internal, Efl.Gfx.Buffer)
{
[[Low-level proxy image object.
diff --git a/src/lib/evas/canvas/efl_canvas_scene3d.c b/src/lib/evas/canvas/efl_canvas_scene3d.c
index 54ca41a06a..3dff89783a 100644
--- a/src/lib/evas/canvas/efl_canvas_scene3d.c
+++ b/src/lib/evas/canvas/efl_canvas_scene3d.c
@@ -22,7 +22,7 @@ _efl_canvas_scene3d_scene3d_set(Eo *eo_obj, void *pd EINA_UNUSED, Evas_Canvas3D_
}
EOLIAN static Evas_Canvas3D_Scene *
-_efl_canvas_scene3d_scene3d_get(Eo *eo_obj, void *pd EINA_UNUSED)
+_efl_canvas_scene3d_scene3d_get(const Eo *eo_obj, void *pd EINA_UNUSED)
{
Evas_Image_Data *o = efl_data_scope_get(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS);
return o->cur->scene;
diff --git a/src/lib/evas/canvas/efl_canvas_scene3d.eo b/src/lib/evas/canvas/efl_canvas_scene3d.eo
index ee5df99db4..ea875c3df0 100644
--- a/src/lib/evas/canvas/efl_canvas_scene3d.eo
+++ b/src/lib/evas/canvas/efl_canvas_scene3d.eo
@@ -1,4 +1,4 @@
-class Efl.Canvas.Scene3d (Efl.Canvas.Image.Internal, Efl.Gfx.Buffer)
+class Efl.Canvas.Scene3d (Efl.Canvas.Image_Internal, Efl.Gfx.Buffer)
{
[[A UI view for EFL Canvas 3D.]]
data: null;
diff --git a/src/lib/evas/canvas/efl_canvas_snapshot.eo b/src/lib/evas/canvas/efl_canvas_snapshot.eo
index e370581685..49271ed3fa 100644
--- a/src/lib/evas/canvas/efl_canvas_snapshot.eo
+++ b/src/lib/evas/canvas/efl_canvas_snapshot.eo
@@ -1,4 +1,4 @@
-class Efl.Canvas.Snapshot (Efl.Canvas.Image.Internal)
+class Efl.Canvas.Snapshot (Efl.Canvas.Image_Internal)
{
[[Low-level snapshot image object.
diff --git a/src/lib/evas/canvas/efl_canvas_surface.c b/src/lib/evas/canvas/efl_canvas_surface.c
index 9d3437b1a0..a9993829b7 100644
--- a/src/lib/evas/canvas/efl_canvas_surface.c
+++ b/src/lib/evas/canvas/efl_canvas_surface.c
@@ -11,7 +11,7 @@ _efl_canvas_surface_efl_object_constructor(Eo *eo, Efl_Canvas_Surface_Data *pd)
}
EOLIAN static void *
-_efl_canvas_surface_native_buffer_get(Eo *obj EINA_UNUSED, Efl_Canvas_Surface_Data *pd)
+_efl_canvas_surface_native_buffer_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Surface_Data *pd)
{
return pd->buffer;
}
diff --git a/src/lib/evas/canvas/efl_canvas_surface.eo b/src/lib/evas/canvas/efl_canvas_surface.eo
index 18495c8fcb..5a113f333b 100644
--- a/src/lib/evas/canvas/efl_canvas_surface.eo
+++ b/src/lib/evas/canvas/efl_canvas_surface.eo
@@ -1,4 +1,4 @@
-mixin Efl.Canvas.Surface (Efl.Interface, Efl.Canvas.Image.Internal)
+mixin Efl.Canvas.Surface (Efl.Interface, Efl.Canvas.Image_Internal)
{
[[Native surfaces usually bound to an externally-managed buffer.
diff --git a/src/lib/evas/canvas/efl_canvas_surface_tbm.eo b/src/lib/evas/canvas/efl_canvas_surface_tbm.eo
index 421774a8cb..89b255cb47 100644
--- a/src/lib/evas/canvas/efl_canvas_surface_tbm.eo
+++ b/src/lib/evas/canvas/efl_canvas_surface_tbm.eo
@@ -1,4 +1,4 @@
-class Efl.Canvas.Surface.Tbm (Efl.Object, Efl.Canvas.Surface)
+class Efl.Canvas.Surface_Tbm (Efl.Object, Efl.Canvas.Surface)
{
[[Native Tizen Buffer Manager surface for Efl canvas]]
diff --git a/src/lib/evas/canvas/efl_canvas_surface_wayland.eo b/src/lib/evas/canvas/efl_canvas_surface_wayland.eo
index 59cd2a89d1..e5e80140f7 100644
--- a/src/lib/evas/canvas/efl_canvas_surface_wayland.eo
+++ b/src/lib/evas/canvas/efl_canvas_surface_wayland.eo
@@ -1,4 +1,4 @@
-class Efl.Canvas.Surface.Wayland (Efl.Object, Efl.Canvas.Surface)
+class Efl.Canvas.Surface_Wayland (Efl.Object, Efl.Canvas.Surface)
{
[[Native Wayland surface for Efl canvas]]
diff --git a/src/lib/evas/canvas/efl_canvas_surface_x11.c b/src/lib/evas/canvas/efl_canvas_surface_x11.c
index bb56e8c14f..5dc10ddbbe 100644
--- a/src/lib/evas/canvas/efl_canvas_surface_x11.c
+++ b/src/lib/evas/canvas/efl_canvas_surface_x11.c
@@ -57,7 +57,7 @@ _efl_canvas_surface_x11_pixmap_set(Eo *eo, Efl_Canvas_Surface_X11_Data *pd EINA_
}
EOLIAN static void
-_efl_canvas_surface_x11_pixmap_get(Eo *eo EINA_UNUSED, Efl_Canvas_Surface_X11_Data *pd, void **visual, unsigned long *pixmap)
+_efl_canvas_surface_x11_pixmap_get(const Eo *eo EINA_UNUSED, Efl_Canvas_Surface_X11_Data *pd, void **visual, unsigned long *pixmap)
{
if (pixmap) *pixmap = pd->px.pixmap;
if (visual) *visual = pd->px.visual;
diff --git a/src/lib/evas/canvas/efl_canvas_surface_x11.eo b/src/lib/evas/canvas/efl_canvas_surface_x11.eo
index 2da2e39044..6f4744d123 100644
--- a/src/lib/evas/canvas/efl_canvas_surface_x11.eo
+++ b/src/lib/evas/canvas/efl_canvas_surface_x11.eo
@@ -1,11 +1,11 @@
-struct Efl.Canvas.Surface.X11_Pixmap
+struct Efl.Canvas.Surface_X11_Pixmap
{
[[The type used by @Efl.Canvas.Surface.native_buffer.]]
visual: void_ptr; [[X11 Visual for this Pixmap.]]
pixmap: ulong; [[X11 Pixmap ID.]]
}
-class Efl.Canvas.Surface.X11 (Efl.Object, Efl.Canvas.Surface)
+class Efl.Canvas.Surface_X11 (Efl.Object, Efl.Canvas.Surface)
{
[[Native X11 surface for Efl canvas]]
diff --git a/src/lib/evas/canvas/efl_canvas_text.eo b/src/lib/evas/canvas/efl_canvas_text.eo
index a021fbacef..b24139e34a 100644
--- a/src/lib/evas/canvas/efl_canvas_text.eo
+++ b/src/lib/evas/canvas/efl_canvas_text.eo
@@ -1,11 +1,11 @@
import efl_text_types;
-struct Efl.Canvas.Text.Style; [[EFL text style data structure]]
+struct Efl.Canvas.Text_Style; [[EFL text style data structure]]
-class Efl.Canvas.Text (Efl.Canvas.Object, Efl.Text, Efl.Text.Properties,
- Efl.Canvas.Filter.Internal, Efl.Text.Font,
- Efl.Text.Style, Efl.Text.Format, Efl.Text.Cursor,
- Efl.Text.Annotate, Efl.Text.Markup, Efl.Ui.Base)
+class Efl.Canvas.Text (Efl.Canvas.Object, Efl.Text,
+ Efl.Canvas.Filter.Internal, Efl.Text_Font,
+ Efl.Text_Style, Efl.Text_Format, Efl.Text_Cursor,
+ Efl.Text_Annotate, Efl.Text_Markup, Efl.Ui.Base)
{
[[Efl canvas text class]]
legacy_prefix: evas_object_textblock;
@@ -33,8 +33,8 @@ class Efl.Canvas.Text (Efl.Canvas.Object, Efl.Text, Efl.Text.Properties,
]]
return: bool; [[$true on success, $false otherwise]]
params {
- @in start: ptr(Efl.Text.Cursor.Cursor); [[Range start position]]
- @in end: ptr(Efl.Text.Cursor.Cursor); [[Range end position]]
+ @in start: ptr(Efl.Text_Cursor_Cursor); [[Range start position]]
+ @in end: ptr(Efl.Text_Cursor_Cursor); [[Range end position]]
}
}
@property style_insets {
@@ -155,7 +155,7 @@ class Efl.Canvas.Text (Efl.Canvas.Object, Efl.Text, Efl.Text.Properties,
h: int; [[The height returned.]]
}
}
- range_text_get {
+ range_text_get @const {
[[Returns the text in the range between $cur1 and $cur2.
@since 1.18
@@ -163,8 +163,8 @@ class Efl.Canvas.Text (Efl.Canvas.Object, Efl.Text, Efl.Text.Properties,
legacy: null;
return: mstring @owned; [[The text in the given range]]
params {
- @cref cur1: Efl.Text.Cursor.Cursor; [[Start of range]]
- @cref cur2: Efl.Text.Cursor.Cursor; [[End of range]]
+ @cref cur1: Efl.Text_Cursor_Cursor; [[Start of range]]
+ @cref cur2: Efl.Text_Cursor_Cursor; [[End of range]]
}
}
range_geometry_get {
@@ -177,8 +177,8 @@ class Efl.Canvas.Text (Efl.Canvas.Object, Efl.Text, Efl.Text.Properties,
]]
legacy: null;
params {
- @cref cur1: Efl.Text.Cursor.Cursor; [[Start of range]]
- @cref cur2: Efl.Text.Cursor.Cursor; [[End of range]]
+ @cref cur1: Efl.Text_Cursor_Cursor; [[Start of range]]
+ @cref cur2: Efl.Text_Cursor_Cursor; [[End of range]]
}
return: iterator<ptr(Eina.Rect)> @owned; [[
Iterator on all geoemtries of the given range
@@ -195,8 +195,8 @@ class Efl.Canvas.Text (Efl.Canvas.Object, Efl.Text, Efl.Text.Properties,
]]
legacy: null;
params {
- @cref cur1: Efl.Text.Cursor.Cursor; [[Start of range]]
- @cref cur2: Efl.Text.Cursor.Cursor; [[End of range]]
+ @cref cur1: Efl.Text_Cursor_Cursor; [[Start of range]]
+ @cref cur2: Efl.Text_Cursor_Cursor; [[End of range]]
}
return: iterator<ptr(Eina.Rect)> @owned; [[
Iterator on all simple geometries of the given range
@@ -209,8 +209,8 @@ class Efl.Canvas.Text (Efl.Canvas.Object, Efl.Text, Efl.Text.Properties,
]]
legacy: null;
params {
- @in cur1: ptr(Efl.Text.Cursor.Cursor); [[Range start position]]
- @in cur2: ptr(Efl.Text.Cursor.Cursor); [[Range end position]]
+ @in cur1: ptr(Efl.Text_Cursor_Cursor); [[Range start position]]
+ @in cur2: ptr(Efl.Text_Cursor_Cursor); [[Range end position]]
}
}
// Obstacles
@@ -263,7 +263,7 @@ class Efl.Canvas.Text (Efl.Canvas.Object, Efl.Text, Efl.Text.Properties,
@since 1.21
]]
legacy: null;
- return: ptr(Eina.Future) @owned; [[Future for layout result]]
+ return: future<Eina.Rect> @owned; [[Future for layout result]]
}
}
implements {
@@ -277,85 +277,86 @@ class Efl.Canvas.Text (Efl.Canvas.Object, Efl.Text, Efl.Text.Properties,
Efl.Canvas.Filter.Internal.filter_dirty;
Efl.Canvas.Filter.Internal.filter_input_render;
Efl.Canvas.Filter.Internal.filter_state_prepare;
- Efl.Text.Font.font { get; set; }
- Efl.Text.Font.font_source { get; set; }
- Efl.Text.Font.font_fallbacks { get; set; }
- Efl.Text.Font.font_lang { get; set; }
- Efl.Text.Font.font_weight { get; set; }
- Efl.Text.Font.font_slant { get; set; }
- Efl.Text.Font.font_width { get; set; }
- Efl.Text.Font.font_bitmap_scalable { get; set; }
- Efl.Text.Style.normal_color { get; set; }
- Efl.Text.Style.backing_type { get; set; }
- Efl.Text.Style.backing_color { get; set; }
- Efl.Text.Style.underline_type { get; set; }
- Efl.Text.Style.underline_color { get; set; }
- Efl.Text.Style.underline_height { get; set; }
- Efl.Text.Style.underline_dashed_color { get; set; }
- Efl.Text.Style.underline_dashed_width { get; set; }
- Efl.Text.Style.underline_dashed_gap { get; set; }
- Efl.Text.Style.underline2_type { get; set; }
- Efl.Text.Style.underline2_color { get; set; }
- Efl.Text.Style.strikethrough_type { get; set; }
- Efl.Text.Style.strikethrough_color { get; set; }
- Efl.Text.Style.effect_type { get; set; }
- Efl.Text.Style.outline_color { get; set; }
- Efl.Text.Style.shadow_direction { get; set; }
- Efl.Text.Style.shadow_color { get; set; }
- Efl.Text.Style.glow_color { get; set; }
- Efl.Text.Style.glow2_color { get; set; }
- Efl.Text.Style.gfx_filter { get; set; }
- Efl.Text.Format.ellipsis { get; set; }
- Efl.Text.Format.wrap { get; set; }
- Efl.Text.Format.multiline { get; set; }
- Efl.Text.Format.halign { get; set; }
- Efl.Text.Format.halign_auto_type { get; set; }
- Efl.Text.Format.valign { get; set; }
- Efl.Text.Format.linegap { get; set; }
- Efl.Text.Format.linerelgap { get; set; }
- Efl.Text.Format.tabstops { get; set; }
- Efl.Text.Format.password { get; set; }
- Efl.Text.Format.replacement_char { get; set; }
- Efl.Text.Cursor.cursor { get; }
- Efl.Text.Cursor.cursor_position { set; get; }
- Efl.Text.Cursor.cursor_content { get; }
- Efl.Text.Cursor.cursor_geometry { get; }
- Efl.Text.Cursor.cursor_new;
- Efl.Text.Cursor.cursor_free;
- Efl.Text.Cursor.cursor_equal;
- Efl.Text.Cursor.cursor_compare;
- Efl.Text.Cursor.cursor_copy;
- Efl.Text.Cursor.cursor_char_next;
- Efl.Text.Cursor.cursor_char_prev;
- Efl.Text.Cursor.cursor_paragraph_char_first;
- Efl.Text.Cursor.cursor_paragraph_char_last;
- Efl.Text.Cursor.cursor_word_start;
- Efl.Text.Cursor.cursor_word_end;
- Efl.Text.Cursor.cursor_line_char_first;
- Efl.Text.Cursor.cursor_line_char_last;
- Efl.Text.Cursor.cursor_paragraph_first;
- Efl.Text.Cursor.cursor_paragraph_last;
- Efl.Text.Cursor.cursor_paragraph_next;
- Efl.Text.Cursor.cursor_paragraph_prev;
- Efl.Text.Cursor.cursor_line_jump_by;
- Efl.Text.Cursor.cursor_coord_set;
- Efl.Text.Cursor.cursor_text_insert;
- Efl.Text.Cursor.cursor_char_delete;
- Efl.Text.Annotate.annotation { set; get; }
- Efl.Text.Annotate.range_annotations_get;
- Efl.Text.Annotate.annotation_insert;
- Efl.Text.Annotate.annotation_del;
- Efl.Text.Annotate.object_item_geometry_get;
- Efl.Text.Annotate.annotation_positions_get;
- Efl.Text.Annotate.cursor_object_item_annotation { get; }
- Efl.Text.Annotate.cursor_object_item_insert;
- Efl.Text.Markup.markup { set; get; }
- Efl.Text.Markup.cursor_markup_insert;
- Efl.Gfx.scale { set; }
+ Efl.Text_Font.font { get; set; }
+ Efl.Text_Font.font_source { get; set; }
+ Efl.Text_Font.font_fallbacks { get; set; }
+ Efl.Text_Font.font_lang { get; set; }
+ Efl.Text_Font.font_weight { get; set; }
+ Efl.Text_Font.font_slant { get; set; }
+ Efl.Text_Font.font_width { get; set; }
+ Efl.Text_Font.font_bitmap_scalable { get; set; }
+ Efl.Text_Style.normal_color { get; set; }
+ Efl.Text_Style.backing_type { get; set; }
+ Efl.Text_Style.backing_color { get; set; }
+ Efl.Text_Style.underline_type { get; set; }
+ Efl.Text_Style.underline_color { get; set; }
+ Efl.Text_Style.underline_height { get; set; }
+ Efl.Text_Style.underline_dashed_color { get; set; }
+ Efl.Text_Style.underline_dashed_width { get; set; }
+ Efl.Text_Style.underline_dashed_gap { get; set; }
+ Efl.Text_Style.underline2_type { get; set; }
+ Efl.Text_Style.underline2_color { get; set; }
+ Efl.Text_Style.strikethrough_type { get; set; }
+ Efl.Text_Style.strikethrough_color { get; set; }
+ Efl.Text_Style.effect_type { get; set; }
+ Efl.Text_Style.outline_color { get; set; }
+ Efl.Text_Style.shadow_direction { get; set; }
+ Efl.Text_Style.shadow_color { get; set; }
+ Efl.Text_Style.glow_color { get; set; }
+ Efl.Text_Style.glow2_color { get; set; }
+ Efl.Text_Style.gfx_filter { get; set; }
+ Efl.Text_Format.ellipsis { get; set; }
+ Efl.Text_Format.wrap { get; set; }
+ Efl.Text_Format.multiline { get; set; }
+ Efl.Text_Format.halign { get; set; }
+ Efl.Text_Format.halign_auto_type { get; set; }
+ Efl.Text_Format.valign { get; set; }
+ Efl.Text_Format.linegap { get; set; }
+ Efl.Text_Format.linerelgap { get; set; }
+ Efl.Text_Format.tabstops { get; set; }
+ Efl.Text_Format.password { get; set; }
+ Efl.Text_Format.replacement_char { get; set; }
+ Efl.Text_Cursor.text_cursor { get; }
+ Efl.Text_Cursor.cursor_position { set; get; }
+ Efl.Text_Cursor.cursor_content { get; }
+ Efl.Text_Cursor.cursor_geometry { get; }
+ Efl.Text_Cursor.cursor_new;
+ Efl.Text_Cursor.cursor_free;
+ Efl.Text_Cursor.cursor_equal;
+ Efl.Text_Cursor.cursor_compare;
+ Efl.Text_Cursor.cursor_copy;
+ Efl.Text_Cursor.cursor_char_next;
+ Efl.Text_Cursor.cursor_char_prev;
+ Efl.Text_Cursor.cursor_paragraph_char_first;
+ Efl.Text_Cursor.cursor_paragraph_char_last;
+ Efl.Text_Cursor.cursor_word_start;
+ Efl.Text_Cursor.cursor_word_end;
+ Efl.Text_Cursor.cursor_line_char_first;
+ Efl.Text_Cursor.cursor_line_char_last;
+ Efl.Text_Cursor.cursor_paragraph_first;
+ Efl.Text_Cursor.cursor_paragraph_last;
+ Efl.Text_Cursor.cursor_paragraph_next;
+ Efl.Text_Cursor.cursor_paragraph_prev;
+ Efl.Text_Cursor.cursor_line_jump_by;
+ Efl.Text_Cursor.cursor_coord_set;
+ Efl.Text_Cursor.cursor_text_insert;
+ Efl.Text_Cursor.cursor_char_delete;
+ Efl.Text_Annotate.annotation { set; get; }
+ Efl.Text_Annotate.range_annotations_get;
+ Efl.Text_Annotate.annotation_insert;
+ Efl.Text_Annotate.annotation_del;
+ Efl.Text_Annotate.annotation_is_item;
+ Efl.Text_Annotate.item_geometry_get;
+ Efl.Text_Annotate.annotation_positions_get;
+ Efl.Text_Annotate.cursor_item_annotation { get; }
+ Efl.Text_Annotate.cursor_item_insert;
+ Efl.Text_Markup.markup { set; get; }
+ Efl.Text_Markup.cursor_markup_insert;
+ Efl.Gfx.Entity.scale { set; }
}
events {
- cursor,changed; [[Called when cursor changed]]
- changed; [[Called when canvas text changed ]]
- style_insets,changed; [[Called when the property @.style_insets changed.]]
+ cursor,changed: void; [[Called when cursor changed]]
+ changed: void; [[Called when canvas text changed ]]
+ style_insets,changed: void; [[Called when the property @.style_insets changed.]]
}
}
diff --git a/src/lib/evas/canvas/efl_canvas_text_factory.eo b/src/lib/evas/canvas/efl_canvas_text_factory.eo
new file mode 100644
index 0000000000..772521a408
--- /dev/null
+++ b/src/lib/evas/canvas/efl_canvas_text_factory.eo
@@ -0,0 +1,25 @@
+interface Efl.Canvas.Text_Factory ()
+{
+ [[Object factory that creates Efl.Canvas.Object objects.
+
+ Translates a given key to an object (item), to be later placed in a text
+ for higher level usages. The translation implementation is left to be
+ decided by the inheriting class, whether it is by treating the $key as an
+ image path, or a key associated with a real-path in a hashtable
+ or something else entirely.
+
+ @since 1.21
+ ]]
+ methods {
+ create {
+ [[Translates a given $key to an item object, and returns the object.
+ The returned object should be owned by the passed $object.
+ ]]
+ params {
+ object: Efl.Canvas.Object; [[The parent of the created object]]
+ key: string; [[Key that is associated to an item object]]
+ }
+ return: Efl.Canvas.Object @owned;
+ }
+ }
+}
diff --git a/src/lib/evas/canvas/efl_vg_container.eo b/src/lib/evas/canvas/efl_canvas_vg_container.eo
index 4913e78162..f89d584d86 100644
--- a/src/lib/evas/canvas/efl_vg_container.eo
+++ b/src/lib/evas/canvas/efl_canvas_vg_container.eo
@@ -1,25 +1,25 @@
-class Efl.VG.Container (Efl.VG)
+class Efl.Canvas.Vg.Container (Efl.Canvas.Vg.Node)
{
[[Efl vector graphics container class]]
legacy_prefix: evas_vg_container;
methods {
child_get {
- [[Get child of container]]
+ [[Get child of container]]
params {
@in name: string; [[Child node name]]
}
- return: Efl.VG; [[Child object]]
+ return: Efl.Canvas.Vg.Node; [[Child object]]
}
children_get {
- [[Get all children of container]]
- return: iterator<Efl.VG> @owned @warn_unused; [[Iterator to children]]
+ [[Get all children of container]]
+ return: iterator<Efl.Canvas.Vg.Node> @owned @warn_unused; [[Iterator to children]]
}
}
implements {
Efl.Object.constructor;
Efl.Object.destructor;
- Efl.VG.bounds_get;
- Efl.VG.interpolate;
+ Efl.Gfx.Path.bounds_get;
+ Efl.Gfx.Path.interpolate;
Efl.Duplicate.duplicate;
}
}
diff --git a/src/lib/evas/canvas/efl_vg_gradient.eo b/src/lib/evas/canvas/efl_canvas_vg_gradient.eo
index 53ec94182f..944b5f21a7 100644
--- a/src/lib/evas/canvas/efl_vg_gradient.eo
+++ b/src/lib/evas/canvas/efl_canvas_vg_gradient.eo
@@ -1,11 +1,11 @@
-abstract Efl.VG.Gradient (Efl.VG, Efl.Gfx.Gradient)
+abstract Efl.Canvas.Vg.Gradient (Efl.Canvas.Vg.Node, Efl.Gfx.Gradient)
{
[[Efl vectopr graphics gradient abstract class]]
legacy_prefix: evas_vg_gradient;
implements {
Efl.Gfx.Gradient.stop { get; set; }
Efl.Gfx.Gradient.spread { get; set; }
- Efl.VG.interpolate;
+ Efl.Gfx.Path.interpolate;
Efl.Duplicate.duplicate;
}
}
diff --git a/src/lib/evas/canvas/efl_canvas_vg_gradient_linear.eo b/src/lib/evas/canvas/efl_canvas_vg_gradient_linear.eo
new file mode 100644
index 0000000000..3dab9b4907
--- /dev/null
+++ b/src/lib/evas/canvas/efl_canvas_vg_gradient_linear.eo
@@ -0,0 +1,14 @@
+class Efl.Canvas.Vg.Gradient_Linear (Efl.Canvas.Vg.Gradient, Efl.Gfx.Gradient_Linear)
+{
+ [[Efl vector graphics gradient linear class]]
+ legacy_prefix: evas_vg_gradient_linear;
+ implements {
+ Efl.Gfx.Gradient_Linear.start { get; set; }
+ Efl.Gfx.Gradient_Linear.end { get; set; }
+ Efl.Gfx.Path.interpolate;
+ Efl.Duplicate.duplicate;
+ Efl.Gfx.Path.bounds_get;
+ Efl.Object.constructor;
+ Efl.Object.destructor;
+ }
+}
diff --git a/src/lib/evas/canvas/efl_canvas_vg_gradient_radial.eo b/src/lib/evas/canvas/efl_canvas_vg_gradient_radial.eo
new file mode 100644
index 0000000000..de631edf83
--- /dev/null
+++ b/src/lib/evas/canvas/efl_canvas_vg_gradient_radial.eo
@@ -0,0 +1,15 @@
+class Efl.Canvas.Vg.Gradient_Radial (Efl.Canvas.Vg.Gradient, Efl.Gfx.Gradient_Radial)
+{
+ [[Efl vector graphics gradient radial class]]
+ legacy_prefix: evas_vg_gradient_radial;
+ implements {
+ Efl.Gfx.Gradient_Radial.center { get; set; }
+ Efl.Gfx.Gradient_Radial.radius { get; set; }
+ Efl.Gfx.Gradient_Radial.focal { get; set; }
+ Efl.Gfx.Path.bounds_get;
+ Efl.Gfx.Path.interpolate;
+ Efl.Duplicate.duplicate;
+ Efl.Object.constructor;
+ Efl.Object.destructor;
+ }
+}
diff --git a/src/lib/evas/canvas/efl_vg.eo b/src/lib/evas/canvas/efl_canvas_vg_node.eo
index 5d41ac229c..9ea185e8fb 100644
--- a/src/lib/evas/canvas/efl_vg.eo
+++ b/src/lib/evas/canvas/efl_canvas_vg_node.eo
@@ -1,33 +1,11 @@
import eina_types;
-abstract Efl.VG (Efl.Object, Efl.Gfx, Efl.Gfx.Color, Efl.Gfx.Stack, Efl.Duplicate)
+abstract Efl.Canvas.Vg.Node (Efl.Object, Efl.Gfx.Entity, Efl.Gfx.Color, Efl.Gfx.Stack, Efl.Duplicate, Efl.Gfx.Path)
{
[[Efl vector graphics abstract class]]
- eo_prefix: efl_vg;
+ eo_prefix: efl_canvas_vg_node;
legacy_prefix: evas_vg_node;
methods {
- @property name {
- set {
- [[Set an unique name from the parent's point of view. $null means
- no name.
-
- @since 1.16
- ]]
- }
- get {
- [[Get an unique name from the parent's point of view.
-
- $null means no name. When setting a parent after a name has
- already been defined, it might be forced back to $null if the parent
- already has a node of that name.
-
- @since 1.16
- ]]
- }
- values {
- name: string; [[Node name]]
- }
- }
@property transformation {
set {
[[Sets the transformation matrix to be used for this node object.
@@ -70,7 +48,7 @@ abstract Efl.VG (Efl.Object, Efl.Gfx, Efl.Gfx.Color, Efl.Gfx.Stack, Efl.Duplicat
get {
}
values {
- m: Efl.VG; [[Object mask]]
+ m: Efl.Canvas.Vg.Node; [[Object mask]]
}
}
/* quality {
@@ -82,43 +60,25 @@ abstract Efl.VG (Efl.Object, Efl.Gfx, Efl.Gfx.Color, Efl.Gfx.Stack, Efl.Duplicat
Evas_VG_Quality q;
}
} */
- bounds_get @pure_virtual {
- [[Give the bounding box in screen coordinates as being drawn.
-
- It will start as the control box until it is refined, once the shape
- is computed.
-
- @since 1.14]]
- params {
- @out r: Eina.Rect; [[Bounding box to be returned.]]
- }
- }
- interpolate {
- [[Interpolate a given vector graphics object]]
-
- return: bool; [[$true on success, $false otherwise]]
- params {
- @in from: const(Efl.VG); [[Source object]]
- @in to: const(Efl.VG); [[Destination object]]
- @in pos_map: double; [[Interpolate mapping]]
- }
- }
}
implements {
+ Efl.Object.name { set; }
Efl.Object.parent { set; }
Efl.Object.constructor;
+ Efl.Object.invalidate;
Efl.Object.destructor;
- Efl.Gfx.visible { get; set; }
+ Efl.Gfx.Entity.visible { get; set; }
Efl.Gfx.Color.color { get; set; }
- Efl.Gfx.size { get; }
- Efl.Gfx.position { get; set; }
- Efl.Gfx.geometry { get; }
+ Efl.Gfx.Entity.size { get; }
+ Efl.Gfx.Entity.position { get; set; }
+ Efl.Gfx.Entity.geometry { get; }
Efl.Gfx.Stack.below { get; }
Efl.Gfx.Stack.above { get; }
Efl.Gfx.Stack.stack_below;
Efl.Gfx.Stack.stack_above;
Efl.Gfx.Stack.raise;
Efl.Gfx.Stack.lower;
+ Efl.Gfx.Path.interpolate;
Efl.Duplicate.duplicate;
}
}
diff --git a/src/lib/evas/canvas/efl_canvas_vg.c b/src/lib/evas/canvas/efl_canvas_vg_object.c
index e981619dc6..cfd1898326 100644
--- a/src/lib/evas/canvas/efl_canvas_vg.c
+++ b/src/lib/evas/canvas/efl_canvas_vg_object.c
@@ -5,7 +5,7 @@
#include "evas_vg_private.h"
-#define MY_CLASS EFL_CANVAS_VG_CLASS
+#define MY_CLASS EFL_CANVAS_VG_OBJECT_CLASS
/* private magic number for rectangle objects */
static const char o_type[] = "vectors";
@@ -65,7 +65,7 @@ static void
_evas_vg_tree_changed(void *data, const Efl_Event *event EINA_UNUSED)
{
Evas_Object_Protected_Data *obj = data;
- Efl_Canvas_Vg_Data *pd = efl_data_scope_get(obj->object, MY_CLASS);
+ Efl_Canvas_Vg_Object_Data *pd = efl_data_scope_get(obj->object, MY_CLASS);
if (pd->changed) return;
@@ -75,10 +75,10 @@ _evas_vg_tree_changed(void *data, const Efl_Event *event EINA_UNUSED)
}
static void
-_update_vgtree_viewport(Eo *obj, Efl_Canvas_Vg_Data *pd)
+_update_vgtree_viewport(Eo *obj, Efl_Canvas_Vg_Object_Data *pd)
{
double vb_w, vb_h, vp_w, vp_h, scale_w, scale_h, scale;
- Eina_Size2D sz = efl_gfx_size_get(obj);
+ Eina_Size2D sz = efl_gfx_entity_size_get(obj);
Eina_Matrix3 m;
eina_matrix3_identity(&m);
@@ -107,13 +107,13 @@ _update_vgtree_viewport(Eo *obj, Efl_Canvas_Vg_Data *pd)
eina_matrix3_translate(&m, -pd->viewbox.x, -pd->viewbox.y);
}
- efl_vg_transformation_set(pd->root, &m);
+ efl_canvas_vg_node_transformation_set(pd->root, &m);
}
static void
_evas_vg_resize(void *data, const Efl_Event *ev)
{
- Efl_Canvas_Vg_Data *pd = data;
+ Efl_Canvas_Vg_Object_Data *pd = data;
if (eina_rectangle_is_empty(&pd->viewbox.rect))
return;
@@ -128,11 +128,11 @@ evas_object_vg_add(Evas *e)
return NULL;
MAGIC_CHECK_END();
// TODO: Ask backend to return the main Ector_Surface
- return efl_add(MY_CLASS, e, efl_canvas_object_legacy_ctor(efl_added));
+ return efl_add(MY_CLASS, evas_find(e), efl_canvas_object_legacy_ctor(efl_added));
}
EOLIAN static Efl_VG *
-_efl_canvas_vg_root_node_get(Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Data *pd)
+_efl_canvas_vg_object_root_node_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Object_Data *pd)
{
Efl_VG *root = NULL;
@@ -145,7 +145,7 @@ _efl_canvas_vg_root_node_get(Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Data *pd)
}
EOLIAN static void
-_efl_canvas_vg_root_node_set(Eo *obj, Efl_Canvas_Vg_Data *pd, Efl_VG *root_node)
+_efl_canvas_vg_object_root_node_set(Eo *obj, Efl_Canvas_Vg_Object_Data *pd, Efl_VG *root_node)
{
// if the same root is already set
if (pd->user_entry && pd->user_entry->root == root_node)
@@ -164,20 +164,24 @@ _efl_canvas_vg_root_node_set(Eo *obj, Efl_Canvas_Vg_Data *pd, Efl_VG *root_node)
if (root_node)
{
- pd->user_entry = calloc(1, sizeof(User_Vg_Entry));
+ if (!pd->user_entry)
+ pd->user_entry = malloc(sizeof(User_Vg_Entry));
+
+ pd->user_entry->w = pd->user_entry->h = 0;
pd->user_entry->root = root_node;
+
// set the parent so that vg canvas can render it.
efl_parent_set(pd->user_entry->root, pd->root);
+
+ efl_canvas_vg_node_root_set(root_node, obj);
}
- else
+ else if (pd->user_entry)
{
- if (pd->user_entry)
- {
- // drop any surface cache attached to it.
- Evas_Object_Protected_Data *eobj = efl_data_scope_get(obj, EFL_CANVAS_OBJECT_CLASS);
- eobj->layer->evas->engine.func->ector_surface_cache_drop(_evas_engine_context(eobj->layer->evas), pd->user_entry);
- free(pd->user_entry);
- }
+ // drop any surface cache attached to it.
+ Evas_Object_Protected_Data *eobj = efl_data_scope_get(obj, EFL_CANVAS_OBJECT_CLASS);
+ eobj->layer->evas->engine.func->ector_surface_cache_drop(_evas_engine_context(eobj->layer->evas),
+ pd->user_entry);
+ free(pd->user_entry);
pd->user_entry = NULL;
}
@@ -188,19 +192,19 @@ _efl_canvas_vg_root_node_set(Eo *obj, Efl_Canvas_Vg_Data *pd, Efl_VG *root_node)
}
EOLIAN static void
-_efl_canvas_vg_fill_mode_set(Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Data *pd, Efl_Canvas_Vg_Fill_Mode fill_mode)
+_efl_canvas_vg_object_fill_mode_set(Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Object_Data *pd, Efl_Canvas_Vg_Fill_Mode fill_mode)
{
pd->fill_mode = fill_mode;
}
EOLIAN static Efl_Canvas_Vg_Fill_Mode
-_efl_canvas_vg_fill_mode_get(Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Data *pd)
+_efl_canvas_vg_object_fill_mode_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Object_Data *pd)
{
return pd->fill_mode;
}
EOLIAN static void
-_efl_canvas_vg_viewbox_set(Eo *obj, Efl_Canvas_Vg_Data *pd, Eina_Rect viewbox)
+_efl_canvas_vg_object_viewbox_set(Eo *obj, Efl_Canvas_Vg_Object_Data *pd, Eina_Rect viewbox)
{
// viewbox should be a valid rectangle
if (eina_rectangle_is_empty(&viewbox.rect))
@@ -212,28 +216,28 @@ _efl_canvas_vg_viewbox_set(Eo *obj, Efl_Canvas_Vg_Data *pd, Eina_Rect viewbox)
pd->viewbox = EINA_RECT_EMPTY();
eina_matrix3_identity(&m);
- efl_vg_transformation_set(pd->root, &m);
+ efl_canvas_vg_node_transformation_set(pd->root, &m);
// un register the resize callback
- efl_event_callback_del(obj, EFL_GFX_EVENT_RESIZE, _evas_vg_resize, pd);
+ efl_event_callback_del(obj, EFL_GFX_ENTITY_EVENT_RESIZE, _evas_vg_resize, pd);
}
return;
}
// register for resize callback if not done yet
if (eina_rectangle_is_empty(&pd->viewbox.rect))
- efl_event_callback_add(obj, EFL_GFX_EVENT_RESIZE, _evas_vg_resize, pd);
+ efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_RESIZE, _evas_vg_resize, pd);
pd->viewbox = viewbox;
_update_vgtree_viewport(obj, pd);
}
EOLIAN static Eina_Rect
-_efl_canvas_vg_viewbox_get(Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Data *pd)
+_efl_canvas_vg_object_viewbox_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Object_Data *pd)
{
return pd->viewbox;
}
EOLIAN static void
-_efl_canvas_vg_viewbox_align_set(Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Data *pd, double align_x, double align_y)
+_efl_canvas_vg_object_viewbox_align_set(Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Object_Data *pd, double align_x, double align_y)
{
align_x = align_x < 0 ? 0 : align_x;
align_x = align_x > 1 ? 1 : align_x;
@@ -246,7 +250,7 @@ _efl_canvas_vg_viewbox_align_set(Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Data *pd, do
}
EOLIAN static void
-_efl_canvas_vg_viewbox_align_get(Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Data *pd, double *align_x, double *align_y)
+_efl_canvas_vg_object_viewbox_align_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Object_Data *pd, double *align_x, double *align_y)
{
if (align_x) *align_x = pd->align_x;
if (align_y) *align_y = pd->align_y;
@@ -255,7 +259,7 @@ _efl_canvas_vg_viewbox_align_get(Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Data *pd, do
// file set and save api implementation
EOLIAN static Eina_Bool
-_efl_canvas_vg_efl_file_file_set(Eo *obj, Efl_Canvas_Vg_Data *pd, const char *file, const char *key)
+_efl_canvas_vg_object_efl_file_file_set(Eo *obj, Efl_Canvas_Vg_Object_Data *pd, const char *file, const char *key)
{
Evas_Cache_Vg_Entry *old_entry;
int w, h;
@@ -273,7 +277,7 @@ _efl_canvas_vg_efl_file_file_set(Eo *obj, Efl_Canvas_Vg_Data *pd, const char *fi
}
EOLIAN static void
-_efl_canvas_vg_efl_file_file_get(Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Data *pd, const char **file, const char **key)
+_efl_canvas_vg_object_efl_file_file_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Object_Data *pd, const char **file, const char **key)
{
if (pd->vg_entry)
{
@@ -283,7 +287,7 @@ _efl_canvas_vg_efl_file_file_get(Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Data *pd, co
}
EOLIAN static Eina_Bool
-_efl_canvas_vg_efl_file_save(const Eo *obj, Efl_Canvas_Vg_Data *pd, const char *file, const char *key, const char *flags)
+_efl_canvas_vg_object_efl_file_save(const Eo *obj, Efl_Canvas_Vg_Object_Data *pd, const char *file, const char *key, const char *flags)
{
Vg_File_Data tmp = {};
Vg_File_Data *info = &tmp;
@@ -306,7 +310,7 @@ _efl_canvas_vg_efl_file_save(const Eo *obj, Efl_Canvas_Vg_Data *pd, const char *
static void
_cleanup_reference(void *data, const Efl_Event *event EINA_UNUSED)
{
- Efl_Canvas_Vg_Data *pd = data;
+ Efl_Canvas_Vg_Object_Data *pd = data;
Eo *renderer;
/* unref all renderer and may also destroy them async */
@@ -315,19 +319,22 @@ _cleanup_reference(void *data, const Efl_Event *event EINA_UNUSED)
}
EOLIAN static void
-_efl_canvas_vg_efl_object_destructor(Eo *eo_obj, Efl_Canvas_Vg_Data *pd)
+_efl_canvas_vg_object_efl_object_destructor(Eo *eo_obj, Efl_Canvas_Vg_Object_Data *pd)
{
Evas *e = evas_object_evas_get(eo_obj);
- efl_event_callback_del(e, EFL_CANVAS_EVENT_RENDER_POST, _cleanup_reference, pd);
+ efl_event_callback_del(e, EFL_CANVAS_SCENE_EVENT_RENDER_POST, _cleanup_reference, pd);
+
+ efl_unref(pd->root);
+
+ if (pd->user_entry)
+ free(pd->user_entry);
- efl_del(pd->root);
- pd->root = NULL;
efl_destructor(efl_super(eo_obj, MY_CLASS));
}
EOLIAN static Eo *
-_efl_canvas_vg_efl_object_constructor(Eo *eo_obj, Efl_Canvas_Vg_Data *pd)
+_efl_canvas_vg_object_efl_object_constructor(Eo *eo_obj, Efl_Canvas_Vg_Object_Data *pd)
{
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
@@ -339,7 +346,8 @@ _efl_canvas_vg_efl_object_constructor(Eo *eo_obj, Efl_Canvas_Vg_Data *pd)
obj->type = o_type;
/* root node */
- pd->root = efl_add(EFL_VG_CONTAINER_CLASS, NULL);
+ //FIXME: Well. I don't think this is necessary if user set a new root node...
+ pd->root = efl_add_ref(EFL_CANVAS_VG_CONTAINER_CLASS, NULL);
eina_array_step_set(&pd->cleanup, sizeof(pd->cleanup), 8);
@@ -349,29 +357,29 @@ _efl_canvas_vg_efl_object_constructor(Eo *eo_obj, Efl_Canvas_Vg_Data *pd)
}
static Efl_Object *
-_efl_canvas_vg_efl_object_finalize(Eo *obj, Efl_Canvas_Vg_Data *pd)
+_efl_canvas_vg_object_efl_object_finalize(Eo *obj, Efl_Canvas_Vg_Object_Data *pd)
{
Evas *e = evas_object_evas_get(obj);
// TODO: If we start to have to many Evas_Object_VG per canvas, it may be nice
// to actually have one event per canvas and one array per canvas to.
- efl_event_callback_add(e, EFL_CANVAS_EVENT_RENDER_POST, _cleanup_reference, pd);
+ efl_event_callback_add(e, EFL_CANVAS_SCENE_EVENT_RENDER_POST, _cleanup_reference, pd);
return obj;
}
static void
-_evas_vg_render(Evas_Object_Protected_Data *obj, Efl_Canvas_Vg_Data *vd,
+_evas_vg_render(Evas_Object_Protected_Data *obj, Efl_Canvas_Vg_Object_Data *vd,
void *engine, void *output, void *context, void *surface, Efl_VG *n,
Eina_Array *clips, Eina_Bool do_async)
{
- if (efl_isa(n, EFL_VG_CONTAINER_CLASS))
+ if (efl_isa(n, EFL_CANVAS_VG_CONTAINER_CLASS))
{
- Efl_VG_Container_Data *vc;
+ Efl_Canvas_Vg_Container_Data *vc;
Efl_VG *child;
Eina_List *l;
- vc = efl_data_scope_get(n, EFL_VG_CONTAINER_CLASS);
+ vc = efl_data_scope_get(n, EFL_CANVAS_VG_CONTAINER_CLASS);
EINA_LIST_FOREACH(vc->children, l, child)
_evas_vg_render(obj, vd,
@@ -380,12 +388,9 @@ _evas_vg_render(Evas_Object_Protected_Data *obj, Efl_Canvas_Vg_Data *vd,
}
else
{
- Efl_VG_Data *nd;
-
- nd = efl_data_scope_get(n, EFL_VG_CLASS);
-
+ Efl_Canvas_Vg_Node_Data *nd;
+ nd = efl_data_scope_get(n, EFL_CANVAS_VG_NODE_CLASS);
obj->layer->evas->engine.func->ector_renderer_draw(engine, output, context, surface, nd->renderer, clips, do_async);
-
if (do_async)
eina_array_push(&vd->cleanup, efl_ref(nd->renderer));
}
@@ -394,7 +399,7 @@ _evas_vg_render(Evas_Object_Protected_Data *obj, Efl_Canvas_Vg_Data *vd,
// renders a vg_tree to an offscreen buffer
// and push it to the cache.
static void *
-_render_to_buffer(Evas_Object_Protected_Data *obj, Efl_Canvas_Vg_Data *vd,
+_render_to_buffer(Evas_Object_Protected_Data *obj, Efl_Canvas_Vg_Object_Data *vd,
void *engine, void *surface,
Efl_VG *root, int w, int h, void *key,
void *buffer, Eina_Bool do_async)
@@ -436,6 +441,7 @@ _render_to_buffer(Evas_Object_Protected_Data *obj, Efl_Canvas_Vg_Data *vd,
context, surface,
root, NULL,
do_async);
+
obj->layer->evas->engine.func->image_dirty_region(engine, buffer, 0, 0, 0, 0);
obj->layer->evas->engine.func->ector_end(engine, buffer,
context, surface,
@@ -473,7 +479,7 @@ _render_buffer_to_screen(Evas_Object_Protected_Data *obj,
static void
_cache_vg_entry_render(Evas_Object_Protected_Data *obj,
- Efl_Canvas_Vg_Data *vd,
+ Efl_Canvas_Vg_Object_Data *vd,
void *engine, void *output, void *context, void *surface,
int x, int y, int w, int h, Eina_Bool do_async)
{
@@ -490,10 +496,11 @@ _cache_vg_entry_render(Evas_Object_Protected_Data *obj,
w, h);
vd->vg_entry = vg_entry;
}
- // if the buffer is not created yet
root = evas_cache_vg_tree_get(vg_entry);
if (!root) return;
buffer = obj->layer->evas->engine.func->ector_surface_cache_get(engine, root);
+
+ // if the buffer is not created yet
if (!buffer)
{
dupe_root = efl_duplicate(root);
@@ -505,7 +512,7 @@ _cache_vg_entry_render(Evas_Object_Protected_Data *obj,
root,
buffer,
do_async);
- efl_del(dupe_root);
+ efl_unref(dupe_root);
}
else
{
@@ -521,7 +528,7 @@ _cache_vg_entry_render(Evas_Object_Protected_Data *obj,
static void
_user_vg_entry_render(Evas_Object_Protected_Data *obj,
- Efl_Canvas_Vg_Data *vd,
+ Efl_Canvas_Vg_Object_Data *vd,
void *engine, void *output, void *context, void *surface,
int x, int y, int w, int h, Eina_Bool do_async)
{
@@ -578,7 +585,7 @@ _efl_canvas_vg_render(Evas_Object *eo_obj EINA_UNUSED,
void *engine, void *output, void *context, void *surface,
int x, int y, Eina_Bool do_async)
{
- Efl_Canvas_Vg_Data *vd = type_private_data;
+ Efl_Canvas_Vg_Object_Data *vd = type_private_data;
/* render object to surface with context, and offxet by x,y */
obj->layer->evas->engine.func->context_color_set(engine,
@@ -619,7 +626,7 @@ _efl_canvas_vg_render_pre(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data)
{
- Efl_Canvas_Vg_Data *vd = type_private_data;
+ Efl_Canvas_Vg_Object_Data *vd = type_private_data;
int is_v, was_v;
Ector_Surface *s;
@@ -752,7 +759,7 @@ _efl_canvas_vg_render_post(Evas_Object *eo_obj EINA_UNUSED,
static unsigned int
_efl_canvas_vg_id_get(Evas_Object *eo_obj)
{
- Efl_Canvas_Vg_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
+ Efl_Canvas_Vg_Object_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
if (!o) return 0;
return MAGIC_OBJ_VG;
}
@@ -760,7 +767,7 @@ _efl_canvas_vg_id_get(Evas_Object *eo_obj)
static unsigned int
_efl_canvas_vg_visual_id_get(Evas_Object *eo_obj)
{
- Efl_Canvas_Vg_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
+ Efl_Canvas_Vg_Object_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
if (!o) return 0;
return MAGIC_OBJ_SHAPE;
}
@@ -768,7 +775,7 @@ _efl_canvas_vg_visual_id_get(Evas_Object *eo_obj)
static void *
_efl_canvas_vg_engine_data_get(Evas_Object *eo_obj)
{
- Efl_Canvas_Vg_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
+ Efl_Canvas_Vg_Object_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
return o->engine_data;
}
@@ -788,4 +795,4 @@ _efl_canvas_vg_was_opaque(Evas_Object *eo_obj EINA_UNUSED,
return 0;
}
-#include "efl_canvas_vg.eo.c"
+#include "efl_canvas_vg_object.eo.c"
diff --git a/src/lib/evas/canvas/efl_canvas_vg.eo b/src/lib/evas/canvas/efl_canvas_vg_object.eo
index 398dd6cf2c..971c977daf 100644
--- a/src/lib/evas/canvas/efl_canvas_vg.eo
+++ b/src/lib/evas/canvas/efl_canvas_vg_object.eo
@@ -21,7 +21,7 @@ enum Efl.Canvas.Vg.Fill_Mode
dimension of the viewport.]]
}
-class Efl.Canvas.Vg (Efl.Canvas.Object, Efl.File)
+class Efl.Canvas.Vg.Object (Efl.Canvas.Object, Efl.File)
{
[[Efl vector graphics class]]
legacy_prefix: evas_object_vg;
@@ -47,8 +47,8 @@ class Efl.Canvas.Vg (Efl.Canvas.Object, Efl.File)
@property viewbox_align {
[[Control how the viewbox is positioned inside the viewport.]]
values {
- align_x: double(0); [[Alignment in the horizontal axis (0 <= align_x <= 1).]]
- align_y: double(0); [[Alignment in the vertical axis (0 <= align_y <= 1).]]
+ align_x: double(0.0); [[Alignment in the horizontal axis (0 <= align_x <= 1).]]
+ align_y: double(0.0); [[Alignment in the vertical axis (0 <= align_y <= 1).]]
}
}
@property root_node {
@@ -65,7 +65,7 @@ class Efl.Canvas.Vg (Efl.Canvas.Object, Efl.File)
It takes the ownership of the root node. ]]
}
values {
- root: Efl.VG; [[Root node of the VG canvas.]]
+ root: Efl.Canvas.Vg.Node; [[Root node of the VG canvas.]]
}
}
}
diff --git a/src/lib/evas/canvas/efl_canvas_vg_shape.eo b/src/lib/evas/canvas/efl_canvas_vg_shape.eo
new file mode 100644
index 0000000000..2706d0f253
--- /dev/null
+++ b/src/lib/evas/canvas/efl_canvas_vg_shape.eo
@@ -0,0 +1,43 @@
+class Efl.Canvas.Vg.Shape (Efl.Canvas.Vg.Node, Efl.Gfx.Shape)
+{
+ [[Efl vector graphics shape class]]
+ legacy_prefix: evas_vg_shape;
+ methods {
+ @property fill {
+ [[Fill of the shape object]]
+ set {
+ }
+ get {
+ }
+ values {
+ f: Efl.Canvas.Vg.Node; [[Fill object]]
+ }
+ }
+ @property stroke_fill {
+ [[Stroke fill of the shape object]]
+ set {
+ }
+ get {
+ }
+ values {
+ f: Efl.Canvas.Vg.Node; [[Stroke fill object]]
+ }
+ }
+ @property stroke_marker {
+ [[Stroke marker of the shape object]]
+ set {
+ }
+ get {
+ }
+ values {
+ m: Efl.Canvas.Vg.Node; [[Stroke marker object]]
+ }
+ }
+ }
+ implements {
+ Efl.Gfx.Path.interpolate;
+ Efl.Duplicate.duplicate;
+ Efl.Object.constructor;
+ Efl.Object.destructor;
+ }
+}
diff --git a/src/lib/evas/canvas/efl_gfx_map.c b/src/lib/evas/canvas/efl_gfx_map.c
index 4bcc11871d..8e64469e84 100644
--- a/src/lib/evas/canvas/efl_gfx_map.c
+++ b/src/lib/evas/canvas/efl_gfx_map.c
@@ -194,8 +194,8 @@ _geometry_changed_cb(void *data, const Efl_Event *ev EINA_UNUSED)
}
EFL_CALLBACKS_ARRAY_DEFINE(_geometry_changes,
- { EFL_GFX_EVENT_MOVE, _geometry_changed_cb },
- { EFL_GFX_EVENT_RESIZE, _geometry_changed_cb });
+ { EFL_GFX_ENTITY_EVENT_MOVE, _geometry_changed_cb },
+ { EFL_GFX_ENTITY_EVENT_RESIZE, _geometry_changed_cb });
static void
_pivot_changed_cb(void *data, const Efl_Event *ev EINA_UNUSED)
@@ -208,8 +208,8 @@ _pivot_changed_cb(void *data, const Efl_Event *ev EINA_UNUSED)
}
EFL_CALLBACKS_ARRAY_DEFINE(_pivot_changes,
- { EFL_GFX_EVENT_MOVE, _pivot_changed_cb },
- { EFL_GFX_EVENT_RESIZE, _pivot_changed_cb });
+ { EFL_GFX_ENTITY_EVENT_MOVE, _pivot_changed_cb },
+ { EFL_GFX_ENTITY_EVENT_RESIZE, _pivot_changed_cb });
static inline void
_map_dirty(Eo *eo_obj, Efl_Gfx_Map_Data *pd, Eina_Bool reset)
@@ -244,7 +244,7 @@ _map_dirty(Eo *eo_obj, Efl_Gfx_Map_Data *pd, Eina_Bool reset)
}
static Evas_Map *
-_map_calc(Eo *eo_obj, Evas_Object_Protected_Data *obj, Efl_Gfx_Map_Data *pd)
+_map_calc(const Eo *eo_obj, Evas_Object_Protected_Data *obj, Efl_Gfx_Map_Data *pd)
{
Gfx_Map_Op *op, *first_op = pd->cow->ops, *last_op;
Gfx_Map_Pivot *pivot;
@@ -269,7 +269,7 @@ _map_calc(Eo *eo_obj, Evas_Object_Protected_Data *obj, Efl_Gfx_Map_Data *pd)
pivot->changed = EINA_FALSE;
if (!pivot->is_canvas)
{
- pivot->geometry = efl_gfx_geometry_get(pivot->eo_obj);
+ pivot->geometry = efl_gfx_entity_geometry_get(pivot->eo_obj);
}
else
{
@@ -277,7 +277,7 @@ _map_calc(Eo *eo_obj, Evas_Object_Protected_Data *obj, Efl_Gfx_Map_Data *pd)
if (pivot->is_evas)
evas_output_size_get(pivot->eo_obj, &pivot->geometry.w, &pivot->geometry.h);
else
- pivot->geometry.size = efl_gfx_size_get(pivot->eo_obj);
+ pivot->geometry.size = efl_gfx_entity_size_get(pivot->eo_obj);
pivot->geometry.x = 0;
pivot->geometry.y = 0;
}
@@ -518,7 +518,7 @@ _efl_gfx_map_map_reset(Eo *eo_obj, Efl_Gfx_Map_Data *pd)
}
EOLIAN static int
-_efl_gfx_map_map_point_count_get(Eo *eo_obj EINA_UNUSED, Efl_Gfx_Map_Data *pd)
+_efl_gfx_map_map_point_count_get(const Eo *eo_obj EINA_UNUSED, Efl_Gfx_Map_Data *pd)
{
return pd->cow->count;
}
@@ -560,7 +560,7 @@ _efl_gfx_map_map_point_count_set(Eo *eo_obj EINA_UNUSED, Efl_Gfx_Map_Data *pd, i
}
EOLIAN static Eina_Bool
-_efl_gfx_map_map_clockwise_get(Eo *eo_obj, Efl_Gfx_Map_Data *pd)
+_efl_gfx_map_map_clockwise_get(const Eo *eo_obj, Efl_Gfx_Map_Data *pd)
{
Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj, EINA_TRUE);
Evas_Map *m;
@@ -581,7 +581,7 @@ _efl_gfx_map_map_smooth_set(Eo *eo_obj, Efl_Gfx_Map_Data *pd, Eina_Bool smooth)
}
EOLIAN static Eina_Bool
-_efl_gfx_map_map_smooth_get(Eo *eo_obj EINA_UNUSED, Efl_Gfx_Map_Data *pd)
+_efl_gfx_map_map_smooth_get(const Eo *eo_obj EINA_UNUSED, Efl_Gfx_Map_Data *pd)
{
return pd->cow->smooth;
}
@@ -597,13 +597,13 @@ _efl_gfx_map_map_alpha_set(Eo *eo_obj, Efl_Gfx_Map_Data *pd, Eina_Bool alpha)
}
EOLIAN static Eina_Bool
-_efl_gfx_map_map_alpha_get(Eo *eo_obj EINA_UNUSED, Efl_Gfx_Map_Data *pd)
+_efl_gfx_map_map_alpha_get(const Eo *eo_obj EINA_UNUSED, Efl_Gfx_Map_Data *pd)
{
return pd->cow->alpha;
}
EOLIAN static void
-_efl_gfx_map_map_coord_absolute_get(Eo *eo_obj, Efl_Gfx_Map_Data *pd,
+_efl_gfx_map_map_coord_absolute_get(const Eo *eo_obj, Efl_Gfx_Map_Data *pd,
int idx, double *x, double *y, double *z)
{
Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj);
@@ -665,7 +665,7 @@ _efl_gfx_map_map_uv_set(Eo *eo_obj, Efl_Gfx_Map_Data *pd,
}
EOLIAN static void
-_efl_gfx_map_map_uv_get(Eo *eo_obj EINA_UNUSED, Efl_Gfx_Map_Data *pd,
+_efl_gfx_map_map_uv_get(const Eo *eo_obj EINA_UNUSED, Efl_Gfx_Map_Data *pd,
int idx, double *u, double *v)
{
EINA_SAFETY_ON_FALSE_RETURN((idx >= 0) && (idx < pd->cow->count)
@@ -676,7 +676,7 @@ _efl_gfx_map_map_uv_get(Eo *eo_obj EINA_UNUSED, Efl_Gfx_Map_Data *pd,
}
EOLIAN static void
-_efl_gfx_map_map_color_get(Eo *eo_obj EINA_UNUSED, Efl_Gfx_Map_Data *pd,
+_efl_gfx_map_map_color_get(const Eo *eo_obj EINA_UNUSED, Efl_Gfx_Map_Data *pd,
int idx, int *r, int *g, int *b, int *a)
{
Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj);
@@ -706,7 +706,7 @@ _efl_gfx_map_map_color_get(Eo *eo_obj EINA_UNUSED, Efl_Gfx_Map_Data *pd,
static Gfx_Map_Op *
_gfx_map_op_add(Eo *eo_obj, Efl_Gfx_Map_Data *pd, Gfx_Map_Op_Type type,
- const Efl_Gfx *eo_pivot, double cx, double cy, double cz,
+ const Efl_Gfx_Entity *eo_pivot, double cx, double cy, double cz,
Eina_Bool is_absolute)
{
Eina_Bool is_self = EINA_FALSE;
@@ -742,7 +742,7 @@ _gfx_map_op_add(Eo *eo_obj, Efl_Gfx_Map_Data *pd, Gfx_Map_Op_Type type,
pivot->is_evas = EINA_TRUE;
pivot->is_canvas = EINA_TRUE;
}
- else if (efl_isa(eo_pivot, EFL_CANVAS_INTERFACE))
+ else if (efl_isa(eo_pivot, EFL_CANVAS_SCENE_INTERFACE))
pivot->is_canvas = EINA_TRUE;
pivot->map_obj = obj;
EINA_INLIST_APPEND(mcow->pivots, pivot);
@@ -817,7 +817,7 @@ _efl_gfx_map_translate(Eo *eo_obj, Efl_Gfx_Map_Data *pd,
static inline void
_map_rotate(Eo *eo_obj, Efl_Gfx_Map_Data *pd,
- double degrees, const Efl_Gfx *pivot, double cx, double cy,
+ double degrees, const Efl_Gfx_Entity *pivot, double cx, double cy,
Eina_Bool absolute)
{
Gfx_Map_Op *op;
@@ -830,7 +830,7 @@ _map_rotate(Eo *eo_obj, Efl_Gfx_Map_Data *pd,
EOLIAN static void
_efl_gfx_map_rotate(Eo *eo_obj, Efl_Gfx_Map_Data *pd,
- double degrees, const Efl_Gfx *pivot, double cx, double cy)
+ double degrees, const Efl_Gfx_Entity *pivot, double cx, double cy)
{
_map_rotate(eo_obj, pd, degrees, pivot, cx, cy, EINA_FALSE);
}
@@ -844,7 +844,7 @@ _efl_gfx_map_rotate_absolute(Eo *eo_obj, Efl_Gfx_Map_Data *pd, double degrees, d
static inline void
_map_rotate_3d(Eo *eo_obj, Efl_Gfx_Map_Data *pd,
double dx, double dy, double dz,
- const Efl_Gfx *pivot, double cx, double cy, double cz,
+ const Efl_Gfx_Entity *pivot, double cx, double cy, double cz,
Eina_Bool absolute)
{
Gfx_Map_Op *op;
@@ -860,7 +860,7 @@ _map_rotate_3d(Eo *eo_obj, Efl_Gfx_Map_Data *pd,
EOLIAN static void
_efl_gfx_map_rotate_3d(Eo *eo_obj, Efl_Gfx_Map_Data *pd,
double dx, double dy, double dz,
- const Efl_Gfx *pivot, double cx, double cy, double cz)
+ const Efl_Gfx_Entity *pivot, double cx, double cy, double cz)
{
_map_rotate_3d(eo_obj, pd, dx, dy, dz, pivot, cx, cy, cz, EINA_FALSE);
}
@@ -875,7 +875,7 @@ _efl_gfx_map_rotate_3d_absolute(Eo *eo_obj, Efl_Gfx_Map_Data *pd,
static inline void
_map_rotate_quat(Eo *eo_obj, Efl_Gfx_Map_Data *pd,
double qx, double qy, double qz, double qw,
- const Efl_Gfx *pivot, double cx, double cy, double cz,
+ const Efl_Gfx_Entity *pivot, double cx, double cy, double cz,
Eina_Bool absolute)
{
Gfx_Map_Op *op;
@@ -892,7 +892,7 @@ _map_rotate_quat(Eo *eo_obj, Efl_Gfx_Map_Data *pd,
EOLIAN static void
_efl_gfx_map_rotate_quat(Eo *eo_obj, Efl_Gfx_Map_Data *pd,
double qx, double qy, double qz, double qw,
- const Efl_Gfx *pivot, double cx, double cy, double cz)
+ const Efl_Gfx_Entity *pivot, double cx, double cy, double cz)
{
_map_rotate_quat(eo_obj, pd, qx, qy, qz, qw, pivot, cx, cy, cz, EINA_FALSE);
}
@@ -908,7 +908,7 @@ _efl_gfx_map_rotate_quat_absolute(Eo *eo_obj, Efl_Gfx_Map_Data *pd,
static inline void
_map_zoom(Eo *eo_obj, Efl_Gfx_Map_Data *pd,
double zoomx, double zoomy,
- const Efl_Gfx *pivot, double cx, double cy,
+ const Efl_Gfx_Entity *pivot, double cx, double cy,
Eina_Bool absolute)
{
Gfx_Map_Op *op;
@@ -923,7 +923,7 @@ _map_zoom(Eo *eo_obj, Efl_Gfx_Map_Data *pd,
EOLIAN static void
_efl_gfx_map_zoom(Eo *eo_obj, Efl_Gfx_Map_Data *pd,
double zoomx, double zoomy,
- const Efl_Gfx *pivot, double cx, double cy)
+ const Efl_Gfx_Entity *pivot, double cx, double cy)
{
_map_zoom(eo_obj, pd, zoomx, zoomy, pivot, cx, cy, EINA_FALSE);
}
@@ -937,7 +937,7 @@ _efl_gfx_map_zoom_absolute(Eo *eo_obj, Efl_Gfx_Map_Data *pd,
static inline void
_map_lightning_3d(Eo *eo_obj, Efl_Gfx_Map_Data *pd,
- const Efl_Gfx *pivot, double lx, double ly, double lz,
+ const Efl_Gfx_Entity *pivot, double lx, double ly, double lz,
int lr, int lg, int lb, int ar, int ag, int ab,
Eina_Bool absolute)
{
@@ -956,7 +956,7 @@ _map_lightning_3d(Eo *eo_obj, Efl_Gfx_Map_Data *pd,
EOLIAN static void
_efl_gfx_map_lightning_3d(Eo *eo_obj, Efl_Gfx_Map_Data *pd,
- const Efl_Gfx *pivot, double lx, double ly, double lz,
+ const Efl_Gfx_Entity *pivot, double lx, double ly, double lz,
int lr, int lg, int lb, int ar, int ag, int ab)
{
_map_lightning_3d(eo_obj, pd, pivot, lx, ly, lz, lr, lg, lb, ar, ag, ab, EINA_FALSE);
@@ -972,7 +972,7 @@ _efl_gfx_map_lightning_3d_absolute(Eo *eo_obj, Efl_Gfx_Map_Data *pd,
static inline void
_map_perspective_3d(Eo *eo_obj, Efl_Gfx_Map_Data *pd,
- const Efl_Gfx *pivot, double px, double py,
+ const Efl_Gfx_Entity *pivot, double px, double py,
double z0, double foc,
Eina_Bool absolute)
{
@@ -993,7 +993,7 @@ _map_perspective_3d(Eo *eo_obj, Efl_Gfx_Map_Data *pd,
EOLIAN static void
_efl_gfx_map_perspective_3d(Eo *eo_obj, Efl_Gfx_Map_Data *pd,
- const Efl_Gfx *pivot, double px, double py,
+ const Efl_Gfx_Entity *pivot, double px, double py,
double z0, double foc)
{
_map_perspective_3d(eo_obj, pd, pivot, px, py, z0, foc, EINA_FALSE);
diff --git a/src/lib/evas/canvas/efl_gfx_map.eo b/src/lib/evas/canvas/efl_gfx_map.eo
index 4e6ab03bf7..c581ba1093 100644
--- a/src/lib/evas/canvas/efl_gfx_map.eo
+++ b/src/lib/evas/canvas/efl_gfx_map.eo
@@ -198,7 +198,7 @@ mixin Efl.Gfx.Map (Efl.Interface, Efl.Object)
]]
params {
degrees: double; [[CCW rotation in degrees.]]
- pivot: const(Efl.Gfx); [[A pivot object for the center point, can be $null.]]
+ pivot: const(Efl.Gfx.Entity); [[A pivot object for the center point, can be $null.]]
cx: double; [[X relative coordinate of the center point.]]
cy: double; [[y relative coordinate of the center point.]]
}
@@ -221,7 +221,7 @@ mixin Efl.Gfx.Map (Efl.Interface, Efl.Object)
dx: double; [[Rotation in degrees around X axis (0 to 360).]]
dy: double; [[Rotation in degrees around Y axis (0 to 360).]]
dz: double; [[Rotation in degrees around Z axis (0 to 360).]]
- pivot: const(Efl.Gfx); [[A pivot object for the center point, can be $null.]]
+ pivot: const(Efl.Gfx.Entity); [[A pivot object for the center point, can be $null.]]
cx: double; [[X relative coordinate of the center point.]]
cy: double; [[y relative coordinate of the center point.]]
cz: double; [[Z absolute coordinate of the center point.]]
@@ -244,7 +244,7 @@ mixin Efl.Gfx.Map (Efl.Interface, Efl.Object)
qy: double; [[The y component of the imaginary part of the quaternion.]]
qz: double; [[The z component of the imaginary part of the quaternion.]]
qw: double; [[The w component of the real part of the quaternion.]]
- pivot: const(Efl.Gfx); [[A pivot object for the center point, can be $null.]]
+ pivot: const(Efl.Gfx.Entity); [[A pivot object for the center point, can be $null.]]
cx: double; [[X relative coordinate of the center point.]]
cy: double; [[y relative coordinate of the center point.]]
cz: double; [[Z absolute coordinate of the center point.]]
@@ -265,7 +265,7 @@ mixin Efl.Gfx.Map (Efl.Interface, Efl.Object)
params {
zoomx: double; [[Zoom in X direction]]
zoomy: double; [[Zoom in Y direction]]
- pivot: const(Efl.Gfx); [[A pivot object for the center point, can be $null.]]
+ pivot: const(Efl.Gfx.Entity); [[A pivot object for the center point, can be $null.]]
cx: double; [[X relative coordinate of the center point.]]
cy: double; [[y relative coordinate of the center point.]]
}
@@ -288,7 +288,7 @@ mixin Efl.Gfx.Map (Efl.Interface, Efl.Object)
is $null then this object will be its own pivot.
]]
params {
- pivot: const(Efl.Gfx); [[A pivot object for the light point, can be $null.]]
+ pivot: const(Efl.Gfx.Entity); [[A pivot object for the light point, can be $null.]]
lx: double; [[X relative coordinate in space of light point.]]
ly: double; [[Y relative coordinate in space of light point.]]
lz: double; [[Z absolute coordinate in space of light point.]]
@@ -322,7 +322,7 @@ mixin Efl.Gfx.Map (Efl.Interface, Efl.Object)
is $null then this object will be its own pivot.
]]
params {
- pivot: const(Efl.Gfx); [[A pivot object for the infinite point, can be $null.]]
+ pivot: const(Efl.Gfx.Entity); [[A pivot object for the infinite point, can be $null.]]
px: double; [[The perspective distance X relative coordinate.]]
py: double; [[The perspective distance Y relative coordinate.]]
z0: double; [[The "0" Z plane value.]]
diff --git a/src/lib/evas/canvas/efl_input_event.c b/src/lib/evas/canvas/efl_input_event.c
index 29925b1c46..9bd5151a07 100644
--- a/src/lib/evas/canvas/efl_input_event.c
+++ b/src/lib/evas/canvas/efl_input_event.c
@@ -23,7 +23,7 @@ _efl_input_event_processed_set(Eo *obj, void *pd EINA_UNUSED, Eina_Bool val)
}
EOLIAN static Eina_Bool
-_efl_input_event_processed_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
+_efl_input_event_processed_get(const Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
{
return !!(efl_input_event_flags_get(obj) & EFL_INPUT_FLAGS_PROCESSED);
}
@@ -38,13 +38,13 @@ _efl_input_event_scrolling_set(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Eina_B
}
EOLIAN static Eina_Bool
-_efl_input_event_scrolling_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
+_efl_input_event_scrolling_get(const Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
{
return !!(efl_input_event_flags_get(obj) & EFL_INPUT_FLAGS_SCROLLING);
}
EOLIAN static Eina_Bool
-_efl_input_event_fake_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
+_efl_input_event_fake_get(const Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
{
return EINA_FALSE;
}
@@ -64,6 +64,75 @@ _efl_input_event_efl_object_provider_find(const Eo *obj, void *pd EINA_UNUSED, c
return efl_provider_find(efl_super(obj, MY_CLASS), klass);
}
+static Eina_Hash *_cached_events = NULL;
+
+static void
+_del_hook(Eo *evt)
+{
+ Efl_Input_Event *cached;
+ const Eo *klass = efl_class_get(evt);
+
+ efl_del_intercept_set(evt, NULL);
+
+ cached = eina_hash_find(_cached_events, &klass);
+ if (!cached)
+ {
+ efl_reuse(evt);
+ eina_hash_add(_cached_events, &klass, evt);
+ efl_input_reset(evt);
+ }
+ else
+ {
+ efl_unref(evt);
+ }
+}
+
+static void
+_noref_death(void *data EINA_UNUSED, const Efl_Event *event)
+{
+ efl_event_callback_del(event->object, EFL_EVENT_NOREF, _noref_death, NULL);
+ efl_del(event->object);
+}
+
+Efl_Input_Event *
+efl_input_event_instance_get(Eo *klass, Eo *owner)
+{
+ Efl_Input_Event *evt;
+
+ if (efl_invalidated_get(owner)) return NULL;
+
+ if (!_cached_events)
+ _cached_events = eina_hash_pointer_new(EINA_FREE_CB(efl_unref));
+
+ evt = eina_hash_find(_cached_events, &klass);
+ if (evt)
+ {
+ // eina_hash_del will call efl_unref, so prevent the destruction of the object
+ evt = efl_ref(evt);
+ eina_hash_del(_cached_events, &klass, evt);
+ efl_parent_set(evt, owner);
+ efl_unref(evt); // Remove reference before turning on self destruction
+ efl_del_intercept_set(evt, _del_hook);
+ efl_event_callback_add(evt, EFL_EVENT_NOREF, _noref_death, NULL);
+ }
+ else
+ {
+ evt = efl_add(klass, owner,
+ efl_event_callback_add(efl_added, EFL_EVENT_NOREF, _noref_death, NULL),
+ efl_del_intercept_set(efl_added, _del_hook));
+ }
+
+ return efl_ref(evt);
+}
+
+void
+efl_input_event_instance_clean(Eo *klass)
+{
+ if (!_cached_events) return ;
+
+ eina_hash_del(_cached_events, &klass, NULL);
+}
+
/* Internal EO APIs */
EOAPI EFL_FUNC_BODY_CONST(efl_input_legacy_info_get, void *, NULL)
diff --git a/src/lib/evas/canvas/efl_input_focus.c b/src/lib/evas/canvas/efl_input_focus.c
index abf1c735ae..599cf4e37c 100644
--- a/src/lib/evas/canvas/efl_input_focus.c
+++ b/src/lib/evas/canvas/efl_input_focus.c
@@ -2,6 +2,9 @@
# include <config.h>
#endif
+#include "evas_common_private.h"
+#include "evas_private.h"
+
#define EFL_INPUT_EVENT_PROTECTED
#include <Evas.h>
@@ -13,29 +16,6 @@
#define MY_CLASS EFL_INPUT_FOCUS_CLASS
-static Efl_Input_Focus *s_cached_event = NULL;
-
-static void
-_del_hook(Eo *evt)
-{
- if (!s_cached_event)
- {
- if (efl_parent_get(evt))
- {
- efl_ref(evt);
- efl_parent_set(evt, NULL);
- }
- efl_reuse(evt);
- s_cached_event = evt;
- efl_input_reset(s_cached_event);
- }
- else
- {
- efl_del_intercept_set(evt, NULL);
- efl_del(evt);
- }
-}
-
static void
_efl_input_focus_free(Efl_Input_Focus_Data *pd)
{
@@ -60,15 +40,6 @@ _efl_input_focus_efl_object_destructor(Eo *obj,
}
EOLIAN static void
-_efl_input_focus_class_destructor(Efl_Class *klass EINA_UNUSED)
-{
- // this is a strange situation...
- efl_del_intercept_set(s_cached_event, NULL);
- efl_del(s_cached_event);
- s_cached_event = NULL;
-}
-
-EOLIAN static void
_efl_input_focus_object_set(Eo *obj EINA_UNUSED, Efl_Input_Focus_Data *pd,
Efl_Object *object)
{
@@ -76,7 +47,7 @@ _efl_input_focus_object_set(Eo *obj EINA_UNUSED, Efl_Input_Focus_Data *pd,
}
EOLIAN static Efl_Object *
-_efl_input_focus_object_get(Eo *obj EINA_UNUSED, Efl_Input_Focus_Data *pd)
+_efl_input_focus_object_get(const Eo *obj EINA_UNUSED, Efl_Input_Focus_Data *pd)
{
return pd->object_wref;
}
@@ -90,7 +61,7 @@ _efl_input_focus_efl_input_event_device_set(Eo *obj EINA_UNUSED,
}
EOLIAN static Efl_Input_Device *
-_efl_input_focus_efl_input_event_device_get(Eo *obj EINA_UNUSED,
+_efl_input_focus_efl_input_event_device_get(const Eo *obj EINA_UNUSED,
Efl_Input_Focus_Data *pd)
{
return pd->device;
@@ -105,7 +76,7 @@ _efl_input_focus_efl_input_event_timestamp_set(Eo *obj EINA_UNUSED,
}
EOLIAN static double
-_efl_input_focus_efl_input_event_timestamp_get(Eo *obj EINA_UNUSED,
+_efl_input_focus_efl_input_event_timestamp_get(const Eo *obj EINA_UNUSED,
Efl_Input_Focus_Data *pd)
{
return pd->timestamp;
@@ -131,23 +102,14 @@ _efl_input_focus_efl_duplicate_duplicate(const Eo *obj, Efl_Input_Focus_Data *pd
}
EOLIAN static Efl_Input_Focus *
-_efl_input_focus_efl_input_event_instance_get(Eo *klass EINA_UNUSED, void *_pd EINA_UNUSED,
+_efl_input_focus_efl_input_event_instance_get(Eo *klass, void *_pd EINA_UNUSED,
Eo *owner, void **priv)
{
Efl_Input_Focus_Data *ev;
Efl_Input_Focus *evt;
- if (s_cached_event)
- {
- evt = s_cached_event;
- s_cached_event = NULL;
- efl_parent_set(evt, owner);
- }
- else
- {
- evt = efl_add(MY_CLASS, owner);
- efl_del_intercept_set(evt, _del_hook);
- }
+ evt = efl_input_event_instance_get(klass, owner);
+ if (!evt) return NULL;
ev = efl_data_scope_get(evt, MY_CLASS);
if (priv) *priv = ev;
@@ -155,6 +117,12 @@ _efl_input_focus_efl_input_event_instance_get(Eo *klass EINA_UNUSED, void *_pd E
}
EOLIAN static void
+_efl_input_focus_class_destructor(Efl_Class *klass)
+{
+ efl_input_event_instance_clean(klass);
+}
+
+EOLIAN static void
_efl_input_focus_efl_input_event_reset(Eo *obj, Efl_Input_Focus_Data *pd)
{
_efl_input_focus_free(pd);
diff --git a/src/lib/evas/canvas/efl_input_hold.c b/src/lib/evas/canvas/efl_input_hold.c
index 0e23efd3cc..e034e4ab6e 100644
--- a/src/lib/evas/canvas/efl_input_hold.c
+++ b/src/lib/evas/canvas/efl_input_hold.c
@@ -19,7 +19,7 @@ _efl_input_hold_hold_set(Eo *obj EINA_UNUSED, Efl_Input_Hold_Data *pd, Eina_Bool
}
EOLIAN static Eina_Bool
-_efl_input_hold_hold_get(Eo *obj EINA_UNUSED, Efl_Input_Hold_Data *pd)
+_efl_input_hold_hold_get(const Eo *obj EINA_UNUSED, Efl_Input_Hold_Data *pd)
{
return pd->hold;
}
@@ -31,13 +31,13 @@ _efl_input_hold_efl_input_event_device_set(Eo *obj EINA_UNUSED, Efl_Input_Hold_D
}
EOLIAN static Efl_Input_Device *
-_efl_input_hold_efl_input_event_device_get(Eo *obj EINA_UNUSED, Efl_Input_Hold_Data *pd)
+_efl_input_hold_efl_input_event_device_get(const Eo *obj EINA_UNUSED, Efl_Input_Hold_Data *pd)
{
return pd->device;
}
EOLIAN static double
-_efl_input_hold_efl_input_event_timestamp_get(Eo *obj EINA_UNUSED, Efl_Input_Hold_Data *pd)
+_efl_input_hold_efl_input_event_timestamp_get(const Eo *obj EINA_UNUSED, Efl_Input_Hold_Data *pd)
{
return pd->timestamp;
}
@@ -55,7 +55,7 @@ _efl_input_hold_efl_input_event_event_flags_set(Eo *obj EINA_UNUSED, Efl_Input_H
}
EOLIAN static Efl_Input_Flags
-_efl_input_hold_efl_input_event_event_flags_get(Eo *obj EINA_UNUSED, Efl_Input_Hold_Data *pd)
+_efl_input_hold_efl_input_event_event_flags_get(const Eo *obj EINA_UNUSED, Efl_Input_Hold_Data *pd)
{
return pd->event_flags;
}
@@ -83,16 +83,23 @@ _efl_input_hold_efl_object_destructor(Eo *obj, Efl_Input_Hold_Data *pd)
}
EOLIAN static Efl_Input_Event *
-_efl_input_hold_efl_input_event_instance_get(Eo *klass EINA_UNUSED, void *_pd EINA_UNUSED,
+_efl_input_hold_efl_input_event_instance_get(Eo *klass, void *_pd EINA_UNUSED,
Efl_Object *owner, void **priv)
{
- // TODO: Implement a cache. Depends only on how many hold events we trigger.
- Efl_Input_Event *evt = efl_add(MY_CLASS, owner);
+ Efl_Input_Event *evt = efl_input_event_instance_get(klass, owner);;
+
+ if (!evt) return NULL;
if (priv) *priv = efl_data_scope_get(evt, MY_CLASS);
return evt;
}
EOLIAN static void
+_efl_input_hold_class_destructor(Efl_Class *klass)
+{
+ efl_input_event_instance_clean(klass);
+}
+
+EOLIAN static void
_efl_input_hold_efl_input_event_reset(Eo *obj, Efl_Input_Hold_Data *pd)
{
_efl_input_hold_free(pd);
diff --git a/src/lib/evas/canvas/efl_input_hold.eo b/src/lib/evas/canvas/efl_input_hold.eo
index 7e83917411..f320d061fe 100644
--- a/src/lib/evas/canvas/efl_input_hold.eo
+++ b/src/lib/evas/canvas/efl_input_hold.eo
@@ -10,6 +10,7 @@ class Efl.Input.Hold (Efl.Object, Efl.Input.Event)
}
}
implements {
+ class.destructor;
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Input.Event.reset;
diff --git a/src/lib/evas/canvas/efl_input_interface.eo b/src/lib/evas/canvas/efl_input_interface.eo
index 68408a3281..7d9df41025 100644
--- a/src/lib/evas/canvas/efl_input_interface.eo
+++ b/src/lib/evas/canvas/efl_input_interface.eo
@@ -1,5 +1,3 @@
-import eina_types;
-
interface Efl.Input.Interface ()
{
[[An object implementing this interface can send pointer events.
diff --git a/src/lib/evas/canvas/efl_input_key.c b/src/lib/evas/canvas/efl_input_key.c
index c6b8061211..ce1acd6b26 100644
--- a/src/lib/evas/canvas/efl_input_key.c
+++ b/src/lib/evas/canvas/efl_input_key.c
@@ -12,50 +12,18 @@
#define MY_CLASS EFL_INPUT_KEY_CLASS
-static Efl_Input_Key *s_cached_event = NULL;
-
-static void
-_del_hook(Eo *evt)
-{
- if (!s_cached_event)
- {
- if (efl_parent_get(evt))
- {
- efl_ref(evt);
- efl_parent_set(evt, NULL);
- }
- efl_reuse(evt);
- s_cached_event = evt;
- efl_input_reset(s_cached_event);
- }
- else
- {
- efl_del_intercept_set(evt, NULL);
- efl_del(evt);
- }
-}
-
EOLIAN static Efl_Input_Key *
-_efl_input_key_efl_input_event_instance_get(Eo *klass EINA_UNUSED, void *_pd EINA_UNUSED,
+_efl_input_key_efl_input_event_instance_get(Eo *klass, void *_pd EINA_UNUSED,
Eo *owner, void **priv)
{
Efl_Input_Key_Data *ev;
Efl_Input_Key *evt;
Evas *evas;
- if (s_cached_event)
- {
- evt = s_cached_event;
- s_cached_event = NULL;
- efl_parent_set(evt, owner);
- }
- else
- {
- evt = efl_add(EFL_INPUT_KEY_CLASS, owner);
- efl_del_intercept_set(evt, _del_hook);
- }
+ evt = efl_input_event_instance_get(klass, owner);
+ if (!evt) return NULL;
- ev = efl_data_scope_get(evt, EFL_INPUT_KEY_CLASS);
+ ev = efl_data_scope_get(evt, klass);
ev->fake = EINA_FALSE;
if (priv) *priv = ev;
@@ -71,12 +39,9 @@ _efl_input_key_efl_input_event_instance_get(Eo *klass EINA_UNUSED, void *_pd EIN
}
EOLIAN static void
-_efl_input_key_class_destructor(Efl_Class *klass EINA_UNUSED)
+_efl_input_key_class_destructor(Efl_Class *klass)
{
- // this is a strange situation...
- efl_del_intercept_set(s_cached_event, NULL);
- efl_del(s_cached_event);
- s_cached_event = NULL;
+ efl_input_event_instance_clean(klass);
}
EOLIAN static Efl_Object *
@@ -113,7 +78,7 @@ _efl_input_key_pressed_set(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd, Eina_Boo
}
EOLIAN static Eina_Bool
-_efl_input_key_pressed_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd)
+_efl_input_key_pressed_get(const Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd)
{
return pd->pressed;
}
@@ -125,7 +90,7 @@ _efl_input_key_key_name_set(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd, const c
}
EOLIAN static const char *
-_efl_input_key_key_name_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd)
+_efl_input_key_key_name_get(const Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd)
{
return pd->keyname;
}
@@ -137,7 +102,7 @@ _efl_input_key_key_set(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd, const char *
}
EOLIAN static const char *
-_efl_input_key_key_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd)
+_efl_input_key_key_get(const Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd)
{
return pd->key;
}
@@ -149,7 +114,7 @@ _efl_input_key_string_set(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd, const cha
}
EOLIAN static const char *
-_efl_input_key_string_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd)
+_efl_input_key_string_get(const Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd)
{
return pd->string;
}
@@ -161,7 +126,7 @@ _efl_input_key_compose_set(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd, const ch
}
EOLIAN static const char *
-_efl_input_key_compose_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd)
+_efl_input_key_compose_get(const Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd)
{
return pd->compose;
}
@@ -173,7 +138,7 @@ _efl_input_key_key_code_set(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd, int val
}
EOLIAN static int
-_efl_input_key_key_code_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd)
+_efl_input_key_key_code_get(const Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd)
{
return pd->keycode;
}
@@ -221,7 +186,7 @@ _efl_input_key_efl_input_event_timestamp_set(Eo *obj EINA_UNUSED, Efl_Input_Key_
}
EOLIAN static double
-_efl_input_key_efl_input_event_timestamp_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd)
+_efl_input_key_efl_input_event_timestamp_get(const Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd)
{
return pd->timestamp;
}
@@ -233,7 +198,7 @@ _efl_input_key_efl_input_event_event_flags_set(Eo *obj EINA_UNUSED, Efl_Input_Ke
}
EOLIAN static Efl_Input_Flags
-_efl_input_key_efl_input_event_event_flags_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd)
+_efl_input_key_efl_input_event_event_flags_get(const Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd)
{
return pd->event_flags;
}
@@ -245,13 +210,13 @@ _efl_input_key_efl_input_event_device_set(Eo *obj EINA_UNUSED, Efl_Input_Key_Dat
}
EOLIAN static Efl_Input_Device *
-_efl_input_key_efl_input_event_device_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd)
+_efl_input_key_efl_input_event_device_get(const Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd)
{
return pd->device;
}
EOLIAN static Eina_Bool
-_efl_input_key_efl_input_state_modifier_enabled_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd,
+_efl_input_key_efl_input_state_modifier_enabled_get(const Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd,
Efl_Input_Modifier mod, const Efl_Input_Device *seat)
{
const char *name;
@@ -268,7 +233,7 @@ _efl_input_key_efl_input_state_modifier_enabled_get(Eo *obj EINA_UNUSED, Efl_Inp
}
EOLIAN static Eina_Bool
-_efl_input_key_efl_input_state_lock_enabled_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd,
+_efl_input_key_efl_input_state_lock_enabled_get(const Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd,
Efl_Input_Lock lock, const Efl_Input_Device *seat)
{
const char *name;
@@ -285,7 +250,7 @@ _efl_input_key_efl_input_state_lock_enabled_get(Eo *obj EINA_UNUSED, Efl_Input_K
}
EOLIAN static Eina_Bool
-_efl_input_key_efl_input_event_fake_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd)
+_efl_input_key_efl_input_event_fake_get(const Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd)
{
return pd->fake;
}
diff --git a/src/lib/evas/canvas/efl_input_key.eo b/src/lib/evas/canvas/efl_input_key.eo
index 45fe094d6f..501a188a3e 100644
--- a/src/lib/evas/canvas/efl_input_key.eo
+++ b/src/lib/evas/canvas/efl_input_key.eo
@@ -1,4 +1,4 @@
-class Efl.Input.Key (Efl.Object, Efl.Input.Event, Efl.Input.State, Efl.Input.Event)
+class Efl.Input.Key (Efl.Object, Efl.Input.Event, Efl.Input.State)
{
[[Represents a single key event from a keyboard or similar device.
diff --git a/src/lib/evas/canvas/efl_input_pointer.c b/src/lib/evas/canvas/efl_input_pointer.c
index 282ffeaf8d..4dfa3bc2c6 100644
--- a/src/lib/evas/canvas/efl_input_pointer.c
+++ b/src/lib/evas/canvas/efl_input_pointer.c
@@ -23,56 +23,30 @@
* Do not add any logic here.
*/
-static Efl_Input_Pointer *s_cached_event = NULL;
-
-static void
-_del_hook(Eo *evt)
-{
- if (!s_cached_event)
- {
- if (efl_parent_get(evt))
- {
- efl_ref(evt);
- efl_parent_set(evt, NULL);
- }
- efl_reuse(evt);
- s_cached_event = evt;
- efl_input_reset(s_cached_event);
- }
- else
- {
- efl_del_intercept_set(evt, NULL);
- efl_del(evt);
- }
-}
-
/* internal eo */
static Efl_Input_Pointer *
-_efl_input_pointer_efl_input_event_instance_get(Eo *klass EINA_UNUSED, void *_pd EINA_UNUSED,
+_efl_input_pointer_efl_input_event_instance_get(Eo *klass, void *_pd EINA_UNUSED,
Eo *owner, void **priv)
{
Efl_Input_Pointer_Data *ev;
Efl_Input_Pointer *evt;
- if (s_cached_event)
- {
- evt = s_cached_event;
- s_cached_event = NULL;
- efl_parent_set(evt, owner);
- }
- else
- {
- evt = efl_add(EFL_INPUT_POINTER_CLASS, owner);
- efl_del_intercept_set(evt, _del_hook);
- }
+ evt = efl_input_event_instance_get(klass, owner);
+ if (!evt) return NULL;
- ev = efl_data_scope_get(evt, EFL_INPUT_POINTER_CLASS);
+ ev = efl_data_scope_get(evt, klass);
ev->fake = EINA_FALSE;
if (priv) *priv = ev;
return evt;
}
+EOLIAN static void
+_efl_input_pointer_class_destructor(Efl_Class *klass)
+{
+ efl_input_event_instance_clean(klass);
+}
+
EAPI void
efl_input_pointer_finalize(Efl_Input_Pointer *obj)
{
@@ -100,15 +74,6 @@ efl_input_pointer_finalize(Efl_Input_Pointer *obj)
ev->pressed_buttons = pdata->button;
}
-EOLIAN static void
-_efl_input_pointer_class_destructor(Efl_Class *klass EINA_UNUSED)
-{
- // this is a strange situation...
- efl_del_intercept_set(s_cached_event, NULL);
- efl_del(s_cached_event);
- s_cached_event = NULL;
-}
-
EOLIAN static Efl_Object *
_efl_input_pointer_efl_object_constructor(Eo *obj, Efl_Input_Pointer_Data *pd)
{
@@ -148,6 +113,16 @@ _efl_input_pointer_efl_duplicate_duplicate(const Eo *obj, Efl_Input_Pointer_Data
Efl_Input_Pointer_Data *ev;
Efl_Input_Focus *evt;
+ if (efl_invalidated_get(obj))
+ {
+ ERR("Object %s has already been invalidated and can't be duplicated.", efl_debug_name_get(obj));
+ return NULL;
+ }
+ if (!efl_parent_get(obj))
+ {
+ ERR("Object %s has not parent during duplicate.", efl_debug_name_get(obj));
+ return NULL;
+ }
evt = efl_add(MY_CLASS, efl_parent_get(obj),
efl_allow_parent_unref_set(efl_added, EINA_TRUE));
ev = efl_data_scope_get(evt, MY_CLASS);
@@ -171,7 +146,7 @@ _efl_input_pointer_action_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, E
}
EOLIAN static Efl_Pointer_Action
-_efl_input_pointer_action_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
+_efl_input_pointer_action_get(const Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
{
return pd->action;
}
@@ -184,7 +159,7 @@ _efl_input_pointer_button_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, i
}
EOLIAN static int
-_efl_input_pointer_button_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
+_efl_input_pointer_button_get(const Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
{
return pd->button;
}
@@ -202,7 +177,7 @@ _efl_input_pointer_button_pressed_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Dat
}
EOLIAN static Eina_Bool
-_efl_input_pointer_button_pressed_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, int button)
+_efl_input_pointer_button_pressed_get(const Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, int button)
{
if (button < 0) return EINA_FALSE;
if (button > 31) return EINA_FALSE;
@@ -219,7 +194,7 @@ _efl_input_pointer_position_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd,
}
EOLIAN static Eina_Position2D
-_efl_input_pointer_position_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
+_efl_input_pointer_position_get(const Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
{
return EINA_POSITION2D((int) pd->cur.x, (int) pd->cur.y);
}
@@ -233,7 +208,7 @@ _efl_input_pointer_precise_position_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_D
}
EOLIAN static Eina_Vector2
-_efl_input_pointer_precise_position_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
+_efl_input_pointer_precise_position_get(const Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
{
return pd->cur;
}
@@ -248,7 +223,7 @@ _efl_input_pointer_previous_position_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_
}
EOLIAN static Eina_Position2D
-_efl_input_pointer_previous_position_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
+_efl_input_pointer_previous_position_get(const Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
{
return EINA_POSITION2D((int) pd->prev.x, (int) pd->prev.y);
}
@@ -260,20 +235,20 @@ _efl_input_pointer_efl_input_event_device_set(Eo *obj EINA_UNUSED, Efl_Input_Poi
}
EOLIAN static Efl_Input_Device *
-_efl_input_pointer_efl_input_event_device_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
+_efl_input_pointer_efl_input_event_device_get(const Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
{
return pd->device;
}
EOLIAN static void
-_efl_input_pointer_source_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Efl_Gfx *src)
+_efl_input_pointer_source_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Efl_Gfx_Entity *src)
{
/* ref? */
pd->source = src;
}
-EOLIAN static Efl_Gfx *
-_efl_input_pointer_source_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
+EOLIAN static Efl_Gfx_Entity *
+_efl_input_pointer_source_get(const Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
{
return pd->source;
}
@@ -285,7 +260,7 @@ _efl_input_pointer_button_flags_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data
}
EOLIAN static Efl_Pointer_Flags
-_efl_input_pointer_button_flags_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
+_efl_input_pointer_button_flags_get(const Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
{
return pd->button_flags;
}
@@ -297,7 +272,7 @@ _efl_input_pointer_efl_input_event_event_flags_set(Eo *obj EINA_UNUSED, Efl_Inpu
}
EOLIAN static Efl_Input_Flags
-_efl_input_pointer_efl_input_event_event_flags_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
+_efl_input_pointer_efl_input_event_event_flags_get(const Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
{
return pd->event_flags;
}
@@ -310,7 +285,7 @@ _efl_input_pointer_efl_input_event_timestamp_set(Eo *obj EINA_UNUSED, Efl_Input_
}
EOLIAN static double
-_efl_input_pointer_efl_input_event_timestamp_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
+_efl_input_pointer_efl_input_event_timestamp_get(const Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
{
return (double) pd->timestamp;
}
@@ -323,7 +298,7 @@ _efl_input_pointer_wheel_horizontal_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_D
}
EOLIAN static Eina_Bool
-_efl_input_pointer_wheel_horizontal_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
+_efl_input_pointer_wheel_horizontal_get(const Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
{
return pd->wheel.horizontal;
}
@@ -336,13 +311,13 @@ _efl_input_pointer_wheel_delta_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *
}
EOLIAN static int
-_efl_input_pointer_wheel_delta_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
+_efl_input_pointer_wheel_delta_get(const Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
{
return pd->wheel.z;
}
EOLIAN static int
-_efl_input_pointer_tool_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
+_efl_input_pointer_tool_get(const Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
{
return pd->tool;
}
@@ -355,7 +330,7 @@ _efl_input_pointer_tool_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, int
}
EOLIAN static Eina_Bool
-_efl_input_pointer_efl_input_state_modifier_enabled_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd,
+_efl_input_pointer_efl_input_state_modifier_enabled_get(const Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd,
Efl_Input_Modifier mod, const Efl_Input_Device *seat)
{
const char *name;
@@ -372,7 +347,7 @@ _efl_input_pointer_efl_input_state_modifier_enabled_get(Eo *obj EINA_UNUSED, Efl
}
EOLIAN static Eina_Bool
-_efl_input_pointer_efl_input_state_lock_enabled_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd,
+_efl_input_pointer_efl_input_state_lock_enabled_get(const Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd,
Efl_Input_Lock lock, const Efl_Input_Device *seat)
{
const char *name;
@@ -398,7 +373,7 @@ _efl_input_pointer_double_click_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data
}
EOLIAN static Eina_Bool
-_efl_input_pointer_double_click_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
+_efl_input_pointer_double_click_get(const Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
{
return !!(pd->button_flags & EFL_POINTER_FLAGS_DOUBLE_CLICK);
}
@@ -413,20 +388,20 @@ _efl_input_pointer_triple_click_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data
}
EOLIAN static Eina_Bool
-_efl_input_pointer_triple_click_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
+_efl_input_pointer_triple_click_get(const Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
{
return !!(pd->button_flags & EFL_POINTER_FLAGS_TRIPLE_CLICK);
}
EOLIAN static Eina_Bool
-_efl_input_pointer_efl_input_event_fake_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
+_efl_input_pointer_efl_input_event_fake_get(const Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
{
// read-only
return pd->fake;
}
EOLIAN static Eina_Bool
-_efl_input_pointer_value_has_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Efl_Input_Value key)
+_efl_input_pointer_value_has_get(const Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Efl_Input_Value key)
{
if (!pd || (key <= EFL_INPUT_VALUE_NONE) || (key > EFL_INPUT_VALUE_SLIDER))
return EINA_FALSE;
@@ -544,7 +519,7 @@ _efl_input_pointer_value_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Ef
}
EOLIAN static double
-_efl_input_pointer_value_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Efl_Input_Value key)
+_efl_input_pointer_value_get(const Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Efl_Input_Value key)
{
switch (key)
{
diff --git a/src/lib/evas/canvas/efl_input_pointer.eo b/src/lib/evas/canvas/efl_input_pointer.eo
index 400ce3481b..03516b62a7 100644
--- a/src/lib/evas/canvas/efl_input_pointer.eo
+++ b/src/lib/evas/canvas/efl_input_pointer.eo
@@ -1,4 +1,3 @@
-import efl_orientation;
import efl_input_types;
class Efl.Input.Pointer (Efl.Object, Efl.Input.Event, Efl.Input.State)
@@ -116,7 +115,7 @@ class Efl.Input.Pointer (Efl.Object, Efl.Input.Event, Efl.Input.State)
propagation or repetition of the event.
]]
values {
- src: Efl.Object; [[Source object: @Efl.Gfx]]
+ src: Efl.Object; [[Source object: @Efl.Gfx.Entity]]
}
}
@property button_flags {
diff --git a/src/lib/evas/canvas/efl_vg_gradient_linear.eo b/src/lib/evas/canvas/efl_vg_gradient_linear.eo
deleted file mode 100644
index 3048e17970..0000000000
--- a/src/lib/evas/canvas/efl_vg_gradient_linear.eo
+++ /dev/null
@@ -1,14 +0,0 @@
-class Efl.VG.Gradient.Linear (Efl.VG.Gradient, Efl.Gfx.Gradient.Linear)
-{
- [[Efl vector graphics gradient linear class]]
- legacy_prefix: evas_vg_gradient_linear;
- implements {
- Efl.Gfx.Gradient.Linear.start { get; set; }
- Efl.Gfx.Gradient.Linear.end { get; set; }
- Efl.VG.bounds_get;
- Efl.VG.interpolate;
- Efl.Duplicate.duplicate;
- Efl.Object.constructor;
- Efl.Object.destructor;
- }
-}
diff --git a/src/lib/evas/canvas/efl_vg_gradient_radial.eo b/src/lib/evas/canvas/efl_vg_gradient_radial.eo
deleted file mode 100644
index efc75bebe4..0000000000
--- a/src/lib/evas/canvas/efl_vg_gradient_radial.eo
+++ /dev/null
@@ -1,15 +0,0 @@
-class Efl.VG.Gradient.Radial (Efl.VG.Gradient, Efl.Gfx.Gradient.Radial)
-{
- [[Efl vector graphics gradient radial class]]
- legacy_prefix: evas_vg_gradient_radial;
- implements {
- Efl.Gfx.Gradient.Radial.center { get; set; }
- Efl.Gfx.Gradient.Radial.radius { get; set; }
- Efl.Gfx.Gradient.Radial.focal { get; set; }
- Efl.VG.bounds_get;
- Efl.VG.interpolate;
- Efl.Duplicate.duplicate;
- Efl.Object.constructor;
- Efl.Object.destructor;
- }
-}
diff --git a/src/lib/evas/canvas/efl_vg_shape.eo b/src/lib/evas/canvas/efl_vg_shape.eo
deleted file mode 100644
index 6dc846b420..0000000000
--- a/src/lib/evas/canvas/efl_vg_shape.eo
+++ /dev/null
@@ -1,44 +0,0 @@
-class Efl.VG.Shape (Efl.VG, Efl.Gfx.Shape)
-{
- [[Efl vector graphics shape class]]
- legacy_prefix: evas_vg_shape;
- methods {
- @property fill {
- [[Fill of the shape object]]
- set {
- }
- get {
- }
- values {
- f: Efl.VG; [[Fill object]]
- }
- }
- @property stroke_fill {
- [[Stroke fill of the shape object]]
- set {
- }
- get {
- }
- values {
- f: Efl.VG; [[Stroke fill object]]
- }
- }
- @property stroke_marker {
- [[Stroke marker of the shape object]]
- set {
- }
- get {
- }
- values {
- m: Efl.VG; [[Stroke marker object]]
- }
- }
- }
- implements {
- Efl.VG.bounds_get;
- Efl.VG.interpolate;
- Efl.Duplicate.duplicate;
- Efl.Object.constructor;
- Efl.Object.destructor;
- }
-}
diff --git a/src/lib/evas/canvas/evas_async_events.c b/src/lib/evas/canvas/evas_async_events.c
index 5cbf90a201..b7141a54e4 100644
--- a/src/lib/evas/canvas/evas_async_events.c
+++ b/src/lib/evas/canvas/evas_async_events.c
@@ -107,7 +107,6 @@ _evas_async_events_fork_handle(void *data EINA_UNUSED)
{
ecore_pipe_del(_async_pipe);
_async_pipe = ecore_pipe_add(_async_events_pipe_read_cb, NULL);
- ecore_pipe_freeze(_async_pipe);
}
int
@@ -116,11 +115,6 @@ evas_async_events_init(void)
if (_init_evas_event++)
return _init_evas_event;
- if ( !ecore_init() )
- {
- _init_evas_event = 0;
- return 0;
- }
ecore_fork_reset_callback_add(_evas_async_events_fork_handle, NULL);
@@ -131,7 +125,6 @@ evas_async_events_init(void)
return 0;
}
- ecore_pipe_freeze(_async_pipe);
_read_error = EINA_FALSE;
_write_error = EINA_FALSE;
@@ -173,7 +166,6 @@ evas_async_events_shutdown(void)
ecore_pipe_del(_async_pipe);
_read_error = EINA_TRUE;
_write_error = EINA_TRUE;
- ecore_shutdown();
return _init_evas_event;
}
@@ -181,7 +173,7 @@ evas_async_events_shutdown(void)
EAPI int
evas_async_events_fd_get(void)
{
- return ecore_pipe_read_fd(_async_pipe);
+ return -1;
}
EAPI int
diff --git a/src/lib/evas/canvas/evas_box.eo b/src/lib/evas/canvas/evas_box.eo
index 7a75da352a..719e50aee2 100644
--- a/src/lib/evas/canvas/evas_box.eo
+++ b/src/lib/evas/canvas/evas_box.eo
@@ -658,12 +658,12 @@ class Evas.Box (Efl.Canvas.Group)
implements {
class.constructor;
Efl.Object.constructor;
- Efl.Gfx.size { set; }
- Efl.Gfx.position { set; }
+ Efl.Gfx.Entity.size { set; }
+ Efl.Gfx.Entity.position { set; }
Efl.Canvas.Group.group_calculate;
}
events {
- child,added; [[Called when a child object was added to the box]]
- child,removed; [[Called when a child object was removed from the box]]
+ child,added: ptr(Evas_Object_Box_Option); [[Called when a child object was added to the box]]
+ child,removed: Efl.Canvas.Object; [[Called when a child object was removed from the box]]
}
}
diff --git a/src/lib/evas/canvas/evas_callbacks.c b/src/lib/evas/canvas/evas_callbacks.c
index 61e7ce8dcc..0814b6fa5b 100644
--- a/src/lib/evas/canvas/evas_callbacks.c
+++ b/src/lib/evas/canvas/evas_callbacks.c
@@ -50,26 +50,26 @@ DEFINE_EVAS_CALLBACKS(_legacy_evas_callback_table, EVAS_CALLBACK_LAST,
EFL_EVENT_KEY_UP,
EFL_EVENT_FOCUS_IN,
EFL_EVENT_FOCUS_OUT,
- EFL_GFX_EVENT_SHOW,
- EFL_GFX_EVENT_HIDE,
- EFL_GFX_EVENT_MOVE,
- EFL_GFX_EVENT_RESIZE,
- EFL_GFX_EVENT_RESTACK,
+ EFL_GFX_ENTITY_EVENT_SHOW,
+ EFL_GFX_ENTITY_EVENT_HIDE,
+ EFL_GFX_ENTITY_EVENT_MOVE,
+ EFL_GFX_ENTITY_EVENT_RESIZE,
+ EFL_GFX_ENTITY_EVENT_RESTACK,
EVAS_OBJECT_EVENT_DEL,
EFL_EVENT_HOLD,
- EFL_GFX_EVENT_CHANGE_SIZE_HINTS,
- EFL_IMAGE_EVENT_PRELOAD,
- EFL_CANVAS_EVENT_FOCUS_IN,
- EFL_CANVAS_EVENT_FOCUS_OUT,
+ EFL_GFX_ENTITY_EVENT_CHANGE_SIZE_HINTS,
+ EFL_GFX_IMAGE_EVENT_PRELOAD,
+ EFL_CANVAS_SCENE_EVENT_FOCUS_IN,
+ EFL_CANVAS_SCENE_EVENT_FOCUS_OUT,
EVAS_CANVAS_EVENT_RENDER_FLUSH_PRE,
EVAS_CANVAS_EVENT_RENDER_FLUSH_POST,
- EFL_CANVAS_EVENT_OBJECT_FOCUS_IN,
- EFL_CANVAS_EVENT_OBJECT_FOCUS_OUT,
- EFL_IMAGE_EVENT_UNLOAD,
- EFL_CANVAS_EVENT_RENDER_PRE,
- EFL_CANVAS_EVENT_RENDER_POST,
- EFL_IMAGE_EVENT_RESIZE,
- EFL_CANVAS_EVENT_DEVICE_CHANGED,
+ EFL_CANVAS_SCENE_EVENT_OBJECT_FOCUS_IN,
+ EFL_CANVAS_SCENE_EVENT_OBJECT_FOCUS_OUT,
+ EFL_GFX_IMAGE_EVENT_UNLOAD,
+ EFL_CANVAS_SCENE_EVENT_RENDER_PRE,
+ EFL_CANVAS_SCENE_EVENT_RENDER_POST,
+ EFL_GFX_IMAGE_EVENT_RESIZE,
+ EFL_CANVAS_SCENE_EVENT_DEVICE_CHANGED,
EFL_EVENT_POINTER_AXIS,
EVAS_CANVAS_EVENT_VIEWPORT_RESIZE );
@@ -209,8 +209,8 @@ _eo_evas_cb(void *data, const Efl_Event *event)
if (!info->func.evas_cb) return;
- if (event->desc == EFL_CANVAS_EVENT_OBJECT_FOCUS_IN ||
- event->desc == EFL_CANVAS_EVENT_OBJECT_FOCUS_OUT)
+ if (event->desc == EFL_CANVAS_SCENE_EVENT_OBJECT_FOCUS_IN ||
+ event->desc == EFL_CANVAS_SCENE_EVENT_OBJECT_FOCUS_OUT)
{
event_info = efl_input_focus_object_get(efl_event_info);
goto emit;
@@ -385,7 +385,7 @@ evas_object_event_callback_call(Evas_Object *eo_obj, Evas_Object_Protected_Data
type == EVAS_CALLBACK_MULTI_DOWN ||
type == EVAS_CALLBACK_MOUSE_UP ||
type == EVAS_CALLBACK_MULTI_UP)
- _efl_gesture_manager_filter_event(e->gesture_manager, eo_obj, event_info);
+ _efl_canvas_gesture_manager_filter_event(e->gesture_manager, eo_obj, event_info);
if (!_evas_object_callback_has_by_type(obj, type))
goto nothing_here;
@@ -471,12 +471,17 @@ evas_object_event_callback_add(Evas_Object *eo_obj, Evas_Callback_Type type, Eva
EAPI void
evas_object_event_callback_priority_add(Evas_Object *eo_obj, Evas_Callback_Type type, Evas_Callback_Priority priority, Evas_Object_Event_Cb func, const void *data)
{
- Evas_Object_Protected_Data *obj = efl_data_scope_safe_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
+ Evas_Object_Protected_Data *obj;
Evas_Event_Cb_Wrapper_Info *cb_info;
const Efl_Event_Description *desc;
- if (!obj) return;
- if (!func) return;
+ EINA_SAFETY_ON_NULL_RETURN(eo_obj);
+ EINA_SAFETY_ON_NULL_RETURN(func);
+
+ EINA_SAFETY_ON_TRUE_RETURN(efl_invalidated_get(eo_obj));
+
+ obj = efl_data_scope_safe_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
+ EINA_SAFETY_ON_NULL_RETURN(obj);
cb_info = calloc(1, sizeof(*cb_info));
cb_info->func.object_cb = func;
@@ -494,11 +499,14 @@ evas_object_event_callback_priority_add(Evas_Object *eo_obj, Evas_Callback_Type
EAPI void *
evas_object_event_callback_del(Evas_Object *eo_obj, Evas_Callback_Type type, Evas_Object_Event_Cb func)
{
- Evas_Object_Protected_Data *obj = efl_data_scope_safe_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
+ Evas_Object_Protected_Data *obj;
Evas_Event_Cb_Wrapper_Info *info;
- if (!obj) return NULL;
- if (!func) return NULL;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(eo_obj, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(func, NULL);
+
+ obj = efl_data_scope_safe_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
if (!obj->callbacks) return NULL;
@@ -521,11 +529,14 @@ evas_object_event_callback_del(Evas_Object *eo_obj, Evas_Callback_Type type, Eva
EAPI void *
evas_object_event_callback_del_full(Evas_Object *eo_obj, Evas_Callback_Type type, Evas_Object_Event_Cb func, const void *data)
{
- Evas_Object_Protected_Data *obj = efl_data_scope_safe_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
+ Evas_Object_Protected_Data *obj;
Evas_Event_Cb_Wrapper_Info *info;
- if (!obj) return NULL;
- if (!func) return NULL;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(eo_obj, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(func, NULL);
+
+ obj = efl_data_scope_safe_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
if (!obj->callbacks) return NULL;
@@ -555,12 +566,17 @@ evas_event_callback_add(Evas *eo_e, Evas_Callback_Type type, Evas_Event_Cb func,
EAPI void
evas_event_callback_priority_add(Evas *eo_e, Evas_Callback_Type type, Evas_Callback_Priority priority, Evas_Event_Cb func, const void *data)
{
- Evas_Public_Data *e = efl_data_scope_safe_get(eo_e, EVAS_CANVAS_CLASS);
+ Evas_Public_Data *e;
Evas_Event_Cb_Wrapper_Info *cb_info;
const Efl_Event_Description *desc;
- if (!e) return;
- if (!func) return;
+ EINA_SAFETY_ON_NULL_RETURN(eo_e);
+ EINA_SAFETY_ON_NULL_RETURN(func);
+
+ EINA_SAFETY_ON_TRUE_RETURN(efl_invalidated_get(eo_e));
+
+ e = efl_data_scope_safe_get(eo_e, EVAS_CANVAS_CLASS);
+ EINA_SAFETY_ON_NULL_RETURN(e);
cb_info = calloc(1, sizeof(*cb_info));
cb_info->func.evas_cb = func;
@@ -577,11 +593,14 @@ evas_event_callback_priority_add(Evas *eo_e, Evas_Callback_Type type, Evas_Callb
EAPI void *
evas_event_callback_del(Evas *eo_e, Evas_Callback_Type type, Evas_Event_Cb func)
{
- Evas_Public_Data *e = efl_data_scope_safe_get(eo_e, EVAS_CANVAS_CLASS);
+ Evas_Public_Data *e;
Evas_Event_Cb_Wrapper_Info *info;
- if (!e) return NULL;
- if (!func) return NULL;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(eo_e, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(func, NULL);
+
+ e = efl_data_scope_safe_get(eo_e, EVAS_CANVAS_CLASS);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(e, NULL);
if (!e->callbacks) return NULL;
@@ -604,11 +623,14 @@ evas_event_callback_del(Evas *eo_e, Evas_Callback_Type type, Evas_Event_Cb func)
EAPI void *
evas_event_callback_del_full(Evas *eo_e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data)
{
- Evas_Public_Data *e = efl_data_scope_safe_get(eo_e, EVAS_CANVAS_CLASS);
+ Evas_Public_Data *e;
Evas_Event_Cb_Wrapper_Info *info;
- if (!e) return NULL;
- if (!func) return NULL;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(eo_e, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(func, NULL);
+
+ e = efl_data_scope_safe_get(eo_e, EVAS_CANVAS_CLASS);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(e, NULL);
if (!e->callbacks) return NULL;
@@ -631,10 +653,15 @@ evas_event_callback_del_full(Evas *eo_e, Evas_Callback_Type type, Evas_Event_Cb
EAPI void
evas_post_event_callback_push(Evas *eo_e, Evas_Object_Event_Post_Cb func, const void *data)
{
- Evas_Public_Data *e = efl_data_scope_safe_get(eo_e, EVAS_CANVAS_CLASS);
+ Evas_Public_Data *e;
Evas_Post_Callback *pc;
- if (!e || e->delete_me) return;
+ EINA_SAFETY_ON_NULL_RETURN(eo_e);
+ EINA_SAFETY_ON_TRUE_RETURN(efl_invalidated_get(eo_e));
+
+ e = efl_data_scope_safe_get(eo_e, EVAS_CANVAS_CLASS);
+ EINA_SAFETY_ON_NULL_RETURN(e);
+ if (e->delete_me) return;
if (e->current_event == EVAS_CALLBACK_LAST)
{
ERR("%s() can only be called from an input event callback!", __FUNCTION__);
@@ -655,11 +682,14 @@ evas_post_event_callback_push(Evas *eo_e, Evas_Object_Event_Post_Cb func, const
EAPI void
evas_post_event_callback_remove(Evas *eo_e, Evas_Object_Event_Post_Cb func)
{
- Evas_Public_Data *e = efl_data_scope_safe_get(eo_e, EVAS_CANVAS_CLASS);
+ Evas_Public_Data *e;
Evas_Post_Callback *pc;
Eina_List *l;
- if (!e) return;
+ EINA_SAFETY_ON_NULL_RETURN(eo_e);
+
+ e = efl_data_scope_safe_get(eo_e, EVAS_CANVAS_CLASS);
+ EINA_SAFETY_ON_NULL_RETURN(e);
EINA_LIST_FOREACH(e->post_events, l, pc)
{
if (pc->func == func)
@@ -673,11 +703,14 @@ evas_post_event_callback_remove(Evas *eo_e, Evas_Object_Event_Post_Cb func)
EAPI void
evas_post_event_callback_remove_full(Evas *eo_e, Evas_Object_Event_Post_Cb func, const void *data)
{
- Evas_Public_Data *e = efl_data_scope_safe_get(eo_e, EVAS_CANVAS_CLASS);
+ Evas_Public_Data *e;
Evas_Post_Callback *pc;
Eina_List *l;
- if (!e) return;
+ EINA_SAFETY_ON_NULL_RETURN(eo_e);
+
+ e = efl_data_scope_safe_get(eo_e, EVAS_CANVAS_CLASS);
+ EINA_SAFETY_ON_NULL_RETURN(e);
EINA_LIST_FOREACH(e->post_events, l, pc)
{
if ((pc->func == func) && (pc->data == data))
@@ -700,7 +733,7 @@ _animator_repeater(void *data, const Efl_Event *event)
static void
_check_event_catcher_add(void *data, const Efl_Event *event)
{
- const Efl_Callback_Array_Item *array = event->info;
+ const Efl_Callback_Array_Item_Full *array = event->info;
Evas_Object_Protected_Data *obj = data;
Evas_Callback_Type type = EVAS_CALLBACK_LAST;
int i;
@@ -708,7 +741,7 @@ _check_event_catcher_add(void *data, const Efl_Event *event)
for (i = 0; array[i].desc != NULL; i++)
{
if (obj->layer->evas->gesture_manager)
- _efl_gesture_manager_callback_add_hook(obj->layer->evas->gesture_manager, obj->object, array[i].desc);
+ _efl_canvas_gesture_manager_callback_add_hook(obj->layer->evas->gesture_manager, obj->object, array[i].desc);
if (array[i].desc == EFL_EVENT_ANIMATOR_TICK)
{
@@ -728,14 +761,18 @@ _check_event_catcher_add(void *data, const Efl_Event *event)
static void
_check_event_catcher_del(void *data, const Efl_Event *event)
{
- const Efl_Callback_Array_Item *array = event->info;
+ const Efl_Callback_Array_Item_Full *array = event->info;
Evas_Object_Protected_Data *obj = data;
int i;
+ if (!obj->layer ||
+ !obj->layer->evas)
+ return ;
+
for (i = 0; array[i].desc != NULL; i++)
{
if (obj->layer->evas->gesture_manager)
- _efl_gesture_manager_callback_del_hook(obj->layer->evas->gesture_manager, obj->object, array[i].desc);
+ _efl_canvas_gesture_manager_callback_del_hook(obj->layer->evas->gesture_manager, obj->object, array[i].desc);
if (array[i].desc == EFL_EVENT_ANIMATOR_TICK)
{
diff --git a/src/lib/evas/canvas/evas_canvas.eo b/src/lib/evas/canvas/evas_canvas.eo
index 5a51b69d8f..29a20414ba 100644
--- a/src/lib/evas/canvas/evas_canvas.eo
+++ b/src/lib/evas/canvas/evas_canvas.eo
@@ -1,7 +1,7 @@
import efl_input_types;
-class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface,
- Efl.Loop.Consumer, Efl.Canvas.Pointer)
+class Evas.Canvas (Efl.Object, Efl.Canvas.Scene, Efl.Animator, Efl.Input.Interface,
+ Efl.Loop_Consumer, Efl.Canvas.Pointer)
{
[[Evas canvas class]]
legacy_prefix: evas;
@@ -269,26 +269,6 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface,
y: int; [[The pointer to an integer to be filled in.]]
}
}
- @property image_max_size {
- get {
- [[Get the maximum image size evas can possibly handle.
-
- This function returns the largest image or surface size that
- evas can handle in pixels, and if there is one, returns $true.
- It returns $false if no extra constraint on maximum image
- size exists. You still should check the return values of
- $maxw and $maxh as there may still be a limit, just a
- much higher one.
-
- @since 1.1
- ]]
- return: bool; [[$true if it can handle the maximum image size, $false otherwise]]
- }
- values {
- maxw: int; [[Pointer to hold the return value in pixels of the maximum width.]]
- maxh: int; [[Pointer to hold the return value in pixels of the maximum height.]]
- }
- }
@property object_bottom {
get {
[[Get the lowest (stacked) Evas object on the canvas $e.
@@ -460,35 +440,6 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface,
@in keyname: string @nonull; [[The name of the modifier to disable.]]
}
}
- objects_at_xy_get @const {
- [[Retrieve a list of Evas objects lying over a given position in
- a canvas.
-
- This function will traverse all the layers of the given canvas,
- from top to bottom, querying for objects with areas covering the
- given position. The user can remove from query objects which are
- hidden and/or which are set to pass events.
-
- Warning: This function will skip objects parented by smart
- objects, acting only on the ones at the "top level", with
- regard to object parenting.
- ]]
- return: list<Efl.Canvas.Object> @warn_unused; [[
- The list of Evas objects that are over the given position in $e.
- ]]
- params {
- @in x: int; [[The horizontal coordinate of the position.]]
- @in y: int; [[The vertical coordinate of the position.]]
- @in include_pass_events_objects: bool; [[
- Boolean flag to include or not objects which pass events
- in this calculation.
- ]]
- @in include_hidden_objects: bool; [[
- Boolean flag to include or not hidden objects in this
- calculation.
- ]]
- }
- }
render_async {
[[Render the given Evas canvas asynchronously.
@@ -585,33 +536,6 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface,
[[Force the given evas and associated engine to flush its font cache.]]
}
- object_top_at_xy_get @const {
- [[Retrieve the Evas object stacked at the top of a given position
- in a canvas.
-
- This function will traverse all the layers of the given canvas,
- from top to bottom, querying for objects with areas covering the
- given position. The user can remove from the query
- objects which are hidden and/or which are set to pass events.
-
- Warning: This function will skip objects parented by smart
- objects, acting only on the ones at the "top level", with
- regard to object parenting.
- ]]
- return: Efl.Canvas.Object @warn_unused; [[The Evas object that is over all other objects at the given position.]]
- params {
- @in x: int; [[The horizontal coordinate of the position.]]
- @in y: int; [[The vertical coordinate of the position.]]
- @in include_pass_events_objects: bool; [[
- Boolean flag to include or not objects which pass events
- in this calculation.
- ]]
- @in include_hidden_objects: bool; [[
- Boolean flag to include or not hidden objects in this
- calculation.
- ]]
- }
- }
key_modifier_on {
[[Enables or turns on programmatically the modifier key with name
$keyname for the default seat.
@@ -669,18 +593,6 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface,
after you're done.
]]
}
- objects_in_rectangle_get @const {
- [[Get all objects in the given rectangle]]
- return: list<Efl.Canvas.Object> @warn_unused; [[List of objects]]
- params {
- @in x: int; [[X coordinate]]
- @in y: int; [[Y coordinate]]
- @in w: int; [[Width]]
- @in h: int; [[Height]]
- @in include_pass_events_objects: bool; [[$true if the list should include objects which pass events]]
- @in include_hidden_objects: bool; [[$true if the list should include hidden objects]]
- }
- }
object_name_find @const {
[[Retrieves the object on the given evas with the given name.
@@ -709,20 +621,6 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface,
font_path_clear {
[[Removes all font paths loaded into memory for the given evas.]]
}
- smart_objects_calculate {
- [[Call user-provided $calculate smart functions and unset the
- flag signalling that the object needs to get recalculated to
- all smart objects in the canvas.
- ]]
- }
- @property smart_objects_calculating {
- get {
- [[Get if the canvas is currently calculating smart objects.]]
- }
- values {
- calculating: bool; [[$true if currently calculating smart objects.]]
- }
- }
/* FIXME: The below function is only for efl.ui.win */
touch_point_list_nth_xy_get {
[[This function returns the nth touch point's coordinates.
@@ -952,45 +850,6 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface,
@.render_idle_flush might discard too.
]]
}
- object_top_in_rectangle_get @const {
- [[Retrieve the Evas object stacked at the top of a given
- rectangular region in a canvas
-
- This function will traverse all the layers of the given canvas,
- from top to bottom, querying for objects with areas overlapping
- with the given rectangular region inside $e. The user can remove
- from the query objects which are hidden and/or which are set to
- pass events.
-
- Warning: This function will skip objects parented by smart
- objects, acting only on the ones at the "top level", with
- regard to object parenting.
- ]]
- return: Efl.Canvas.Object @warn_unused; [[
- The Evas object that is over all other objects at the given
- rectangular region.
- ]]
- params {
- @in x: int; [[
- The top left corner's horizontal coordinate for the
- rectangular region.
- ]]
- @in y: int; [[
- The top left corner's vertical coordinate for the
- rectangular region.
- ]]
- @in w: int; [[The width of the rectangular region.]]
- @in h: int; [[The height of the rectangular region.]]
- @in include_pass_events_objects: bool; [[
- Boolean flag to include or not objects which pass events
- in this calculation.
- ]]
- @in include_hidden_objects: bool; [[
- Boolean flag to include or not hidden objects in this
- calculation.
- ]]
- }
- }
render {
[[Force renderization of the given canvas.]]
@@ -1089,7 +948,7 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface,
]]
get {}
keys {
- type: Efl.Input.Device.Type; [[The class of the default device to fetch.]]
+ type: Efl.Input.Device_Type; [[The class of the default device to fetch.]]
}
values {
seat: Efl.Input.Device; [[The default device or $null on error.]]
@@ -1124,13 +983,21 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface,
implements {
Efl.Object.constructor;
Efl.Object.destructor;
+ Efl.Object.invalidate;
Efl.Object.event_thaw;
Efl.Object.event_freeze;
Efl.Object.provider_find;
- Efl.Loop.Consumer.loop { get; }
+ Efl.Loop_Consumer.loop { get; }
//Efl.Canvas.seats;
Efl.Canvas.Pointer.pointer_inside { get; }
- Efl.Canvas.device { get; }
- Efl.Canvas.seat { get; }
+ Efl.Canvas.Scene.device { get; }
+ Efl.Canvas.Scene.seat { get; }
+ Efl.Canvas.Scene.image_max_size { get; }
+ Efl.Canvas.Scene.objects_at_xy_get;
+ Efl.Canvas.Scene.object_top_at_xy_get;
+ Efl.Canvas.Scene.objects_in_rectangle_get;
+ Efl.Canvas.Scene.object_top_in_rectangle_get;
+ Efl.Canvas.Scene.smart_objects_calculate;
+ Efl.Canvas.Scene.smart_objects_calculating { get; }
}
}
diff --git a/src/lib/evas/canvas/evas_canvas3d_light.c b/src/lib/evas/canvas/evas_canvas3d_light.c
index 3149e83dc0..887f3abb6c 100644
--- a/src/lib/evas/canvas/evas_canvas3d_light.c
+++ b/src/lib/evas/canvas/evas_canvas3d_light.c
@@ -129,7 +129,7 @@ _evas_canvas3d_light_directional_set(Eo *obj, Evas_Canvas3D_Light_Data *pd, Eina
}
EOLIAN static Eina_Bool
-_evas_canvas3d_light_directional_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Light_Data *pd)
+_evas_canvas3d_light_directional_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Light_Data *pd)
{
return pd->directional;
}
@@ -202,7 +202,7 @@ _evas_canvas3d_light_spot_exponent_set(Eo *obj, Evas_Canvas3D_Light_Data *pd, Ev
}
EOLIAN static Evas_Real
-_evas_canvas3d_light_spot_exponent_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Light_Data *pd)
+_evas_canvas3d_light_spot_exponent_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Light_Data *pd)
{
return pd->spot_exp;
}
@@ -216,7 +216,7 @@ _evas_canvas3d_light_spot_cutoff_set(Eo *obj, Evas_Canvas3D_Light_Data *pd, Evas
}
EOLIAN static Evas_Real
-_evas_canvas3d_light_spot_cutoff_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Light_Data *pd)
+_evas_canvas3d_light_spot_cutoff_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Light_Data *pd)
{
return pd->spot_cutoff;
}
@@ -249,7 +249,7 @@ _evas_canvas3d_light_attenuation_enable_set(Eo *obj, Evas_Canvas3D_Light_Data *p
}
EOLIAN static Eina_Bool
-_evas_canvas3d_light_attenuation_enable_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Light_Data *pd)
+_evas_canvas3d_light_attenuation_enable_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Light_Data *pd)
{
return pd->enable_attenuation;
}
diff --git a/src/lib/evas/canvas/evas_canvas3d_material.c b/src/lib/evas/canvas/evas_canvas3d_material.c
index 404efd3cac..48f6ce1e5a 100644
--- a/src/lib/evas/canvas/evas_canvas3d_material.c
+++ b/src/lib/evas/canvas/evas_canvas3d_material.c
@@ -145,7 +145,7 @@ _evas_canvas3d_material_enable_set(Eo *obj EINA_UNUSED, Evas_Canvas3D_Material_D
}
EOLIAN static Eina_Bool
-_evas_canvas3d_material_enable_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Material_Data *pd, Evas_Canvas3D_Material_Attrib attrib)
+_evas_canvas3d_material_enable_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Material_Data *pd, Evas_Canvas3D_Material_Attrib attrib)
{
return pd->attribs[attrib].enable;
}
@@ -173,7 +173,7 @@ _evas_canvas3d_material_shininess_set(Eo *obj EINA_UNUSED, Evas_Canvas3D_Materia
}
EOLIAN static Evas_Real
-_evas_canvas3d_material_shininess_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Material_Data *pd)
+_evas_canvas3d_material_shininess_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Material_Data *pd)
{
return pd->shininess;
}
@@ -198,7 +198,7 @@ _evas_canvas3d_material_texture_set(Eo *obj, Evas_Canvas3D_Material_Data *pd, Ev
}
EOLIAN static Evas_Canvas3D_Texture *
-_evas_canvas3d_material_texture_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Material_Data *pd, Evas_Canvas3D_Material_Attrib attrib)
+_evas_canvas3d_material_texture_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Material_Data *pd, Evas_Canvas3D_Material_Attrib attrib)
{
return pd->attribs[attrib].texture;
}
diff --git a/src/lib/evas/canvas/evas_canvas3d_mesh.c b/src/lib/evas/canvas/evas_canvas3d_mesh.c
index ad5b3fdc8e..5f3d6a0d9a 100644
--- a/src/lib/evas/canvas/evas_canvas3d_mesh.c
+++ b/src/lib/evas/canvas/evas_canvas3d_mesh.c
@@ -287,7 +287,7 @@ _evas_canvas3d_mesh_shader_mode_set(Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data
}
EOLIAN static Evas_Canvas3D_Shader_Mode
-_evas_canvas3d_mesh_shader_mode_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *pd)
+_evas_canvas3d_mesh_shader_mode_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *pd)
{
return pd->shader_mode;
}
@@ -300,7 +300,7 @@ _evas_canvas3d_mesh_vertex_count_set(Eo *obj, Evas_Canvas3D_Mesh_Data *pd, unsig
}
EOLIAN static unsigned int
-_evas_canvas3d_mesh_vertex_count_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *pd)
+_evas_canvas3d_mesh_vertex_count_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *pd)
{
return pd->vertex_count;
}
@@ -380,7 +380,7 @@ _evas_canvas3d_mesh_frame_material_set(Eo *obj, Evas_Canvas3D_Mesh_Data *pd, int
}
EOLIAN static Evas_Canvas3D_Material *
-_evas_canvas3d_mesh_frame_material_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *pd, int frame)
+_evas_canvas3d_mesh_frame_material_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *pd, int frame)
{
Evas_Canvas3D_Mesh_Frame *f = evas_canvas3d_mesh_frame_find(pd, frame);
@@ -763,7 +763,7 @@ _evas_canvas3d_mesh_vertex_assembly_set(Eo *obj, Evas_Canvas3D_Mesh_Data *pd, Ev
}
EOLIAN static Evas_Canvas3D_Vertex_Assembly
-_evas_canvas3d_mesh_vertex_assembly_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *pd)
+_evas_canvas3d_mesh_vertex_assembly_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *pd)
{
return pd->assembly;
}
@@ -793,7 +793,7 @@ _evas_canvas3d_mesh_fog_enable_set(Eo *obj, Evas_Canvas3D_Mesh_Data *pd, Eina_Bo
}
EOLIAN static Eina_Bool
-_evas_canvas3d_mesh_fog_enable_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *pd)
+_evas_canvas3d_mesh_fog_enable_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *pd)
{
return pd->fog_enabled;
}
@@ -806,7 +806,7 @@ _evas_canvas3d_mesh_blending_enable_set(Eo *obj, Evas_Canvas3D_Mesh_Data *pd, Ei
}
EOLIAN static Eina_Bool
-_evas_canvas3d_mesh_blending_enable_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *pd)
+_evas_canvas3d_mesh_blending_enable_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *pd)
{
return pd->blending;
}
@@ -840,7 +840,7 @@ _evas_canvas3d_mesh_alpha_func_set(Eo *obj, Evas_Canvas3D_Mesh_Data *pd, Evas_Ca
}
EOLIAN static void
-_evas_canvas3d_mesh_alpha_func_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *pd,
+_evas_canvas3d_mesh_alpha_func_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *pd,
Evas_Canvas3D_Comparison *comparison,
Evas_Real *ref_value)
{
@@ -856,7 +856,7 @@ _evas_canvas3d_mesh_alpha_test_enable_set(Eo *obj, Evas_Canvas3D_Mesh_Data *pd,
}
EOLIAN static Eina_Bool
-_evas_canvas3d_mesh_alpha_test_enable_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *pd)
+_evas_canvas3d_mesh_alpha_test_enable_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *pd)
{
return pd->alpha_test_enabled;
}
@@ -1080,7 +1080,7 @@ evas_canvas3d_mesh_interpolate_vertex_buffer_get(Evas_Canvas3D_Mesh *mesh, int f
}
EOLIAN static Eina_Bool
-_evas_canvas3d_mesh_color_pick_enable_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *pd)
+_evas_canvas3d_mesh_color_pick_enable_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *pd)
{
return pd->color_pick_enabled;
}
@@ -1104,7 +1104,7 @@ _evas_canvas3d_mesh_shadows_edges_filtering_set(Eo *obj, Evas_Canvas3D_Mesh_Data
}
EOLIAN static void
-_evas_canvas3d_mesh_shadows_edges_filtering_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *pd,
+_evas_canvas3d_mesh_shadows_edges_filtering_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *pd,
int *blur_level, Evas_Real *edges_size)
{
if (blur_level) *blur_level = pd->shadows_edges_filtering_level;
@@ -1123,7 +1123,7 @@ _evas_canvas3d_mesh_shadows_constant_bias_set(Eo *obj EINA_UNUSED, Evas_Canvas3D
}
EOLIAN static Evas_Real
-_evas_canvas3d_mesh_shadows_constant_bias_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *pd)
+_evas_canvas3d_mesh_shadows_constant_bias_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *pd)
{
return pd->shadows_constant_bias;
}
@@ -1162,7 +1162,7 @@ _evas_canvas3d_mesh_lod_boundary_set(Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Dat
}
EOLIAN static void
-_evas_canvas3d_mesh_lod_boundary_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *pd,
+_evas_canvas3d_mesh_lod_boundary_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *pd,
Evas_Real *near_lod, Evas_Real *far_lod)
{
*near_lod = pd->near_lod_boundary;
diff --git a/src/lib/evas/canvas/evas_canvas3d_mesh.eo b/src/lib/evas/canvas/evas_canvas3d_mesh.eo
index 2305a0cd66..04771d7d45 100644
--- a/src/lib/evas/canvas/evas_canvas3d_mesh.eo
+++ b/src/lib/evas/canvas/evas_canvas3d_mesh.eo
@@ -1,4 +1,3 @@
-import eina_types;
import evas_canvas3d_types;
struct @extern Eina.Inarray; [[Eina inarray data structure]]
diff --git a/src/lib/evas/canvas/evas_canvas3d_node.c b/src/lib/evas/canvas/evas_canvas3d_node.c
index 0760b231be..f80395f362 100644
--- a/src/lib/evas/canvas/evas_canvas3d_node.c
+++ b/src/lib/evas/canvas/evas_canvas3d_node.c
@@ -1025,11 +1025,27 @@ evas_canvas3d_node_add(Evas *e, Evas_Canvas3D_Node_Type type)
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
return NULL;
MAGIC_CHECK_END();
- return efl_add(MY_CLASS, e, evas_canvas3d_node_constructor(efl_added, type));
+ return efl_add(MY_CLASS, e, evas_canvas3d_node_type_set(efl_added, type));
}
-EOLIAN static void
-_evas_canvas3d_node_constructor(Eo *obj, Evas_Canvas3D_Node_Data *pd, Evas_Canvas3D_Node_Type type)
+EOLIAN static Efl_Object *
+_evas_canvas3d_node_efl_object_finalize(Eo *obj, Evas_Canvas3D_Node_Data *pd)
+{
+ if (pd->type == EVAS_CANVAS3D_NODE_TYPE_MESH)
+ {
+ pd->data.mesh.node_meshes = eina_hash_pointer_new(_node_mesh_free_func);
+ if (pd->data.mesh.node_meshes == NULL)
+ {
+ ERR("Failed to create node mesh table.");
+ _node_free(obj);
+ return NULL;
+ }
+ }
+ return obj;
+}
+
+EOLIAN static Efl_Object *
+_evas_canvas3d_node_efl_object_constructor(Eo *obj, Evas_Canvas3D_Node_Data *pd)
{
evas_canvas3d_object_type_set(obj, EVAS_CANVAS3D_OBJECT_TYPE_NODE);
@@ -1049,18 +1065,7 @@ _evas_canvas3d_node_constructor(Eo *obj, Evas_Canvas3D_Node_Data *pd, Evas_Canva
pd->lod = EINA_FALSE;
evas_box3_set(&pd->aabb, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
-
- pd->type = type;
-
- if (type == EVAS_CANVAS3D_NODE_TYPE_MESH)
- {
- pd->data.mesh.node_meshes = eina_hash_pointer_new(_node_mesh_free_func);
- if (pd->data.mesh.node_meshes == NULL)
- {
- ERR("Failed to create node mesh table.");
- _node_free(obj);
- }
- }
+ return obj;
}
EOLIAN static void
@@ -1072,12 +1077,18 @@ _evas_canvas3d_node_efl_object_destructor(Eo *obj, Evas_Canvas3D_Node_Data *pd E
}
EOLIAN static Evas_Canvas3D_Node_Type
-_evas_canvas3d_node_type_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Node_Data *pd)
+_evas_canvas3d_node_node_type_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Node_Data *pd)
{
return pd->type;
}
EOLIAN static void
+_evas_canvas3d_node_node_type_set(Eo *obj EINA_UNUSED, Evas_Canvas3D_Node_Data *pd, Evas_Canvas3D_Node_Type type)
+{
+ pd->type = type;
+}
+
+EOLIAN static void
_evas_canvas3d_node_member_add(Eo *obj, Evas_Canvas3D_Node_Data *pd, Evas_Canvas3D_Node *member)
{
if (obj == member)
@@ -1305,19 +1316,19 @@ _evas_canvas3d_node_scale_inherit_set(Eo *obj, Evas_Canvas3D_Node_Data *pd, Eina
}
EOLIAN static Eina_Bool
-_evas_canvas3d_node_position_inherit_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Node_Data *pd)
+_evas_canvas3d_node_position_inherit_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Node_Data *pd)
{
return pd->position_inherit;
}
EOLIAN static Eina_Bool
-_evas_canvas3d_node_orientation_inherit_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Node_Data *pd)
+_evas_canvas3d_node_orientation_inherit_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Node_Data *pd)
{
return pd->orientation_inherit;
}
EOLIAN static Eina_Bool
-_evas_canvas3d_node_scale_inherit_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Node_Data *pd)
+_evas_canvas3d_node_scale_inherit_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Node_Data *pd)
{
return pd->scale_inherit;
}
@@ -1469,7 +1480,7 @@ _evas_canvas3d_node_camera_set(Eo *obj, Evas_Canvas3D_Node_Data *pd, Evas_Canvas
}
EOLIAN static Evas_Canvas3D_Camera *
-_evas_canvas3d_node_camera_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Node_Data *pd)
+_evas_canvas3d_node_camera_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Node_Data *pd)
{
return pd->data.camera.camera;
}
@@ -1504,7 +1515,7 @@ _evas_canvas3d_node_light_set(Eo *obj, Evas_Canvas3D_Node_Data *pd, Evas_Canvas3
}
EOLIAN static Evas_Canvas3D_Light *
-_evas_canvas3d_node_light_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Node_Data *pd)
+_evas_canvas3d_node_light_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Node_Data *pd)
{
return pd->data.light.light;
}
@@ -1602,7 +1613,7 @@ _evas_canvas3d_node_mesh_frame_set(Eo *obj, Evas_Canvas3D_Node_Data *pd, Evas_Ca
}
EOLIAN static int
-_evas_canvas3d_node_mesh_frame_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Node_Data *pd, Evas_Canvas3D_Mesh *mesh)
+_evas_canvas3d_node_mesh_frame_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Node_Data *pd, Evas_Canvas3D_Mesh *mesh)
{
Evas_Canvas3D_Node_Mesh *nm = NULL;
@@ -1661,7 +1672,7 @@ _evas_canvas3d_node_billboard_target_set(Eo *obj EINA_UNUSED, Evas_Canvas3D_Node
}
EOLIAN static Evas_Canvas3D_Node *
-_evas_canvas3d_node_billboard_target_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Node_Data *pd)
+_evas_canvas3d_node_billboard_target_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Node_Data *pd)
{
return pd->billboard_target;
}
@@ -1675,7 +1686,7 @@ _evas_canvas3d_node_lod_enable_set(Eo *obj, Evas_Canvas3D_Node_Data *pd,
}
EOLIAN static Eina_Bool
-_evas_canvas3d_node_lod_enable_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Node_Data *pd)
+_evas_canvas3d_node_lod_enable_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Node_Data *pd)
{
return pd->lod;
}
diff --git a/src/lib/evas/canvas/evas_canvas3d_node.eo b/src/lib/evas/canvas/evas_canvas3d_node.eo
index ca4e155824..98f27483f4 100644
--- a/src/lib/evas/canvas/evas_canvas3d_node.eo
+++ b/src/lib/evas/canvas/evas_canvas3d_node.eo
@@ -5,18 +5,19 @@ class Evas.Canvas3D.Node (Evas.Canvas3D.Object)
[[Evas 3D canvas node class]]
data: Evas_Canvas3D_Node_Data;
methods {
- constructor {
- [[Constructor.]]
- legacy: null;
- params {
- @in type: Evas.Canvas3D.Node_Type; [[Node type]]
- }
- }
- type_get @const {
+ @property node_type {
[[Get the type of the given node.
See also @Evas.Canvas3D.Node.member_add.]]
- return: Evas.Canvas3D.Node_Type ; [[The type of the given node.]]
+ set {
+ [[Type can only be set before finalize.]]
+ }
+ get {
+ [[If the object is not node object, returns $unknown.]]
+ }
+ values {
+ type: Evas.Canvas3D.Node_Type(Evas.Canvas3D.Node_Type.unknown); [[Node type]]
+ }
}
member_add {
[[Add a member node to the given node.
@@ -383,13 +384,12 @@ class Evas.Canvas3D.Node (Evas.Canvas3D.Object)
}
}
implements {
+ Efl.Object.constructor;
Efl.Object.destructor;
+ Efl.Object.finalize;
Evas.Canvas3D.Object.update_notify;
Evas.Canvas3D.Object.change_notify;
Evas.Canvas3D.Object.callback_register;
Evas.Canvas3D.Object.callback_unregister;
}
- constructors {
- .constructor;
- }
}
diff --git a/src/lib/evas/canvas/evas_canvas3d_object.eo b/src/lib/evas/canvas/evas_canvas3d_object.eo
index 4a6f56b022..0fa7161f29 100644
--- a/src/lib/evas/canvas/evas_canvas3d_object.eo
+++ b/src/lib/evas/canvas/evas_canvas3d_object.eo
@@ -70,7 +70,8 @@ class Evas.Canvas3D.Object (Efl.Object)
Efl.Object.provider_find;
}
events {
- clicked; [[Clicked Event.]]
- collision; [[Collision Event.]]
+ /* FIXME: Make sure that these two events are actually being emitted */
+ clicked: Evas.Canvas3D.Node; [[Clicked Event.]]
+ collision: Evas.Canvas3D.Node; [[Collision Event.]]
}
}
diff --git a/src/lib/evas/canvas/evas_canvas3d_primitive.c b/src/lib/evas/canvas/evas_canvas3d_primitive.c
index dce1bcfa06..45625df424 100644
--- a/src/lib/evas/canvas/evas_canvas3d_primitive.c
+++ b/src/lib/evas/canvas/evas_canvas3d_primitive.c
@@ -55,7 +55,7 @@ _evas_canvas3d_primitive_form_set(Eo *obj EINA_UNUSED,
}
EOLIAN static Evas_Canvas3D_Mesh_Primitive
-_evas_canvas3d_primitive_form_get(Eo *obj EINA_UNUSED,
+_evas_canvas3d_primitive_form_get(const Eo *obj EINA_UNUSED,
Evas_Canvas3D_Primitive_Data *pd)
{
return pd->form;
@@ -71,7 +71,7 @@ _evas_canvas3d_primitive_mode_set(Eo *obj EINA_UNUSED,
}
EOLIAN static Evas_Canvas3D_Primitive_Mode
-_evas_canvas3d_primitive_mode_get(Eo *obj EINA_UNUSED,
+_evas_canvas3d_primitive_mode_get(const Eo *obj EINA_UNUSED,
Evas_Canvas3D_Primitive_Data *pd)
{
return pd->mode;
@@ -86,7 +86,7 @@ _evas_canvas3d_primitive_ratio_set(Eo *obj EINA_UNUSED,
}
EOLIAN static Evas_Real
-_evas_canvas3d_primitive_ratio_get(Eo *obj EINA_UNUSED,
+_evas_canvas3d_primitive_ratio_get(const Eo *obj EINA_UNUSED,
Evas_Canvas3D_Primitive_Data *pd)
{
return pd->ratio;
@@ -115,7 +115,7 @@ _evas_canvas3d_primitive_precision_set(Eo *obj EINA_UNUSED,
}
EOLIAN static int
-_evas_canvas3d_primitive_precision_get(Eo *obj EINA_UNUSED,
+_evas_canvas3d_primitive_precision_get(const Eo *obj EINA_UNUSED,
Evas_Canvas3D_Primitive_Data *pd)
{
return pd->precision;
@@ -140,7 +140,7 @@ _evas_canvas3d_primitive_tex_scale_set(Eo *obj EINA_UNUSED,
}
EOLIAN static void
-_evas_canvas3d_primitive_tex_scale_get(Eo *obj EINA_UNUSED,
+_evas_canvas3d_primitive_tex_scale_get(const Eo *obj EINA_UNUSED,
Evas_Canvas3D_Primitive_Data *pd,
Evas_Real *x,
Evas_Real *y)
diff --git a/src/lib/evas/canvas/evas_canvas3d_scene.c b/src/lib/evas/canvas/evas_canvas3d_scene.c
index 161d1de120..a11848326b 100644
--- a/src/lib/evas/canvas/evas_canvas3d_scene.c
+++ b/src/lib/evas/canvas/evas_canvas3d_scene.c
@@ -106,7 +106,7 @@ _evas_canvas3d_scene_root_node_set(Eo *obj, Evas_Canvas3D_Scene_Data *pd, Evas_C
}
EOLIAN static Evas_Canvas3D_Node *
-_evas_canvas3d_scene_root_node_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Scene_Data *pd)
+_evas_canvas3d_scene_root_node_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Scene_Data *pd)
{
return pd->root_node;
}
@@ -133,7 +133,7 @@ _evas_canvas3d_scene_camera_node_set(Eo *obj, Evas_Canvas3D_Scene_Data *pd, Evas
}
EOLIAN static Evas_Canvas3D_Node *
-_evas_canvas3d_scene_camera_node_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Scene_Data *pd)
+_evas_canvas3d_scene_camera_node_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Scene_Data *pd)
{
return pd->camera_node;
}
@@ -828,7 +828,7 @@ _evas_canvas3d_scene_shadows_depth_set(Eo *obj EINA_UNUSED, Evas_Canvas3D_Scene_
}
EOLIAN static void
-_evas_canvas3d_scene_shadows_depth_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Scene_Data *pd,
+_evas_canvas3d_scene_shadows_depth_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Scene_Data *pd,
Evas_Real *depth_offset, Evas_Real *depth_constant)
{
if (depth_offset) *depth_offset = pd->depth_offset;
diff --git a/src/lib/evas/canvas/evas_canvas3d_texture.c b/src/lib/evas/canvas/evas_canvas3d_texture.c
index 00cef85524..540f6c6b39 100644
--- a/src/lib/evas/canvas/evas_canvas3d_texture.c
+++ b/src/lib/evas/canvas/evas_canvas3d_texture.c
@@ -373,7 +373,7 @@ _evas_canvas3d_texture_data_set(Eo *obj, Evas_Canvas3D_Texture_Data *pd,
}
EOLIAN static void
-_evas_canvas3d_texture_efl_file_mmap_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Texture_Data *pd, const Eina_File **f, const char **key)
+_evas_canvas3d_texture_efl_file_mmap_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Texture_Data *pd, const Eina_File **f, const char **key)
{
if (f) *f = pd->f;
if (key) *key = pd->key;
@@ -482,7 +482,7 @@ _evas_canvas3d_texture_source_visible_set(Eo *obj EINA_UNUSED, Evas_Canvas3D_Tex
}
EOLIAN static Eina_Bool
-_evas_canvas3d_texture_source_visible_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Texture_Data *pd)
+_evas_canvas3d_texture_source_visible_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Texture_Data *pd)
{
Evas_Object_Protected_Data *src_obj;
@@ -587,7 +587,7 @@ _evas_canvas3d_texture_atlas_enable_set(Eo *obj EINA_UNUSED, Evas_Canvas3D_Textu
}
EOLIAN static Eina_Bool
-_evas_canvas3d_texture_atlas_enable_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Texture_Data *pd)
+_evas_canvas3d_texture_atlas_enable_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Texture_Data *pd)
{
return pd->atlas_enable;
}
diff --git a/src/lib/evas/canvas/evas_canvas3d_types.eot b/src/lib/evas/canvas/evas_canvas3d_types.eot
index 84153ae201..a050af3be9 100644
--- a/src/lib/evas/canvas/evas_canvas3d_types.eot
+++ b/src/lib/evas/canvas/evas_canvas3d_types.eot
@@ -109,6 +109,7 @@ enum Evas.Canvas3D.Node_Type
[[Types of a node
@since 1.10]]
+ unknown = -1, [[Unknown node type @since 1.21]]
node = 0, [[Node with no items]]
camera, [[Node which can contain camera object]]
light, [[Node which can contain light object]]
diff --git a/src/lib/evas/canvas/evas_clip.c b/src/lib/evas/canvas/evas_clip.c
index 38c468bc1b..c69097dc8f 100644
--- a/src/lib/evas/canvas/evas_clip.c
+++ b/src/lib/evas/canvas/evas_clip.c
@@ -215,7 +215,7 @@ _efl_canvas_object_clip_mask_unset(Evas_Object_Protected_Data *obj)
extern const char *o_rect_type;
extern const char *o_image_type;
-static void _clipper_del_cb(void *data, const Efl_Event *event);
+static void _clipper_invalidated_cb(void *data, const Efl_Event *event);
Eina_Bool
_efl_canvas_object_clip_set_block(Eo *eo_obj, Evas_Object_Protected_Data *obj,
@@ -306,7 +306,7 @@ _efl_canvas_object_clip_unset_common(Evas_Object_Protected_Data *obj, Eina_Bool
}
evas_object_change(clip->object, clip);
if (obj->prev->clipper != clip)
- efl_event_callback_del(clip->object, EFL_EVENT_DEL, _clipper_del_cb, obj->object);
+ efl_event_callback_del(clip->object, EFL_EVENT_INVALIDATE, _clipper_invalidated_cb, obj->object);
}
EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur)
@@ -373,7 +373,7 @@ _efl_canvas_object_clip_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Ob
state_write->clipper = clip;
EINA_COW_STATE_WRITE_END(obj, state_write, cur);
if (obj->prev->clipper != clip)
- efl_event_callback_add(clip->object, EFL_EVENT_DEL, _clipper_del_cb, eo_obj);
+ efl_event_callback_add(clip->object, EFL_EVENT_INVALIDATE, _clipper_invalidated_cb, eo_obj);
clip->clip.cache_clipees_answer = eina_list_free(clip->clip.cache_clipees_answer);
clip->clip.clipees = eina_list_append(clip->clip.clipees, obj);
@@ -394,7 +394,7 @@ _efl_canvas_object_clip_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Ob
evas_object_update_bounding_box(eo_obj, obj, NULL);
evas_object_clip_dirty(eo_obj, obj);
evas_object_recalc_clippees(obj);
- if ((!obj->is_smart) &&
+ if (obj->cur->visible && (!obj->is_smart) &&
(!((obj->map->cur.map) && (obj->map->cur.usemap))))
{
_evas_canvas_event_pointer_in_rect_mouse_move_feed(obj->layer->evas,
@@ -407,7 +407,7 @@ _efl_canvas_object_clip_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Ob
}
EOLIAN Evas_Object *
-_efl_canvas_object_clip_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
+_efl_canvas_object_clip_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
{
EVAS_OBJECT_DATA_ALIVE_CHECK(obj, NULL);
if (obj->cur->clipper)
@@ -442,7 +442,8 @@ _clip_unset(Eo *eo_obj, Evas_Object_Protected_Data *obj)
evas_object_change(eo_obj, obj);
evas_object_clip_dirty(eo_obj, obj);
evas_object_recalc_clippees(obj);
- if ((!obj->is_smart) &&
+
+ if (obj->cur->visible && (!obj->is_smart) &&
(!((obj->map->cur.map) && (obj->map->cur.usemap))))
{
_evas_canvas_event_pointer_in_rect_mouse_move_feed(obj->layer->evas,
@@ -463,7 +464,7 @@ evas_object_clip_unset(Evas_Object *eo_obj)
}
static void
-_clipper_del_cb(void *data, const Efl_Event *event)
+_clipper_invalidated_cb(void *data, const Efl_Event *event)
{
Evas_Object *eo_obj = data;
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
@@ -495,7 +496,7 @@ _efl_canvas_object_clip_prev_reset(Evas_Object_Protected_Data *obj, Eina_Bool cu
EINA_COW_STATE_WRITE_END(obj, state_write, prev);
}
if (clip != obj->cur->clipper)
- efl_event_callback_del(clip->object, EFL_EVENT_DEL, _clipper_del_cb, obj->object);
+ efl_event_callback_del(clip->object, EFL_EVENT_INVALIDATE, _clipper_invalidated_cb, obj->object);
}
}
@@ -550,7 +551,7 @@ _clipee_iterator_free(Clipee_Iterator *it)
}
EOLIAN Eina_Iterator *
-_efl_canvas_object_clipees_get(Eo *eo_obj, Evas_Object_Protected_Data *obj)
+_efl_canvas_object_clipees_get(const Eo *eo_obj, Evas_Object_Protected_Data *obj)
{
Clipee_Iterator *it;
@@ -565,7 +566,7 @@ _efl_canvas_object_clipees_get(Eo *eo_obj, Evas_Object_Protected_Data *obj)
it->iterator.next = FUNC_ITERATOR_NEXT(_clipee_iterator_next);
it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_clipee_iterator_get_container);
it->iterator.free = FUNC_ITERATOR_FREE(_clipee_iterator_free);
- it->object = eo_obj;
+ it->object = (Evas_Object *)eo_obj;
return &it->iterator;
}
@@ -583,7 +584,7 @@ _efl_canvas_object_no_render_set(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_D
}
EOLIAN Eina_Bool
-_efl_canvas_object_no_render_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
+_efl_canvas_object_no_render_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
{
return obj->no_render;
}
diff --git a/src/lib/evas/canvas/evas_device.c b/src/lib/evas/canvas/evas_device.c
index 23eb01d08c..3f52d59635 100644
--- a/src/lib/evas/canvas/evas_device.c
+++ b/src/lib/evas/canvas/evas_device.c
@@ -76,6 +76,7 @@ _new_default_device_find(Evas_Public_Data *e, Evas_Device *old_dev)
static void
_del_cb(void *data, const Efl_Event *ev)
{
+ Efl_Input_Device_Type devtype;
Evas_Public_Data *e = data;
e->devices_modified = EINA_TRUE;
@@ -89,7 +90,8 @@ _del_cb(void *data, const Efl_Event *ev)
else if (e->default_keyboard == ev->object)
e->default_keyboard = _new_default_device_find(e, ev->object);
- if ((efl_input_device_type_get(ev->object) == EFL_INPUT_DEVICE_TYPE_SEAT) && (!e->default_seat))
+ devtype = efl_input_device_type_get(ev->object);
+ if ((devtype == EFL_INPUT_DEVICE_TYPE_SEAT) && (!e->default_seat))
{
Evas_Pointer_Data *pdata = _evas_pointer_data_by_device_get(e, ev->object);
if (pdata)
@@ -108,15 +110,16 @@ _del_cb(void *data, const Efl_Event *ev)
}
}
- _evas_pointer_data_remove(e, ev->object);
+ if (devtype == EFL_INPUT_DEVICE_TYPE_MOUSE)
+ _evas_pointer_data_remove(e, ev->object);
eina_hash_del_by_key(e->locks.masks, &ev->object);
eina_hash_del_by_key(e->modifiers.masks, &ev->object);
- efl_event_callback_call(e->evas, EFL_CANVAS_EVENT_DEVICE_REMOVED,
+ efl_event_callback_call(e->evas, EFL_CANVAS_SCENE_EVENT_DEVICE_REMOVED,
ev->object);
}
EOLIAN Efl_Input_Device *
-_evas_canvas_efl_canvas_device_get(Evas *eo_e EINA_UNUSED, Evas_Public_Data *e, const char *name)
+_evas_canvas_efl_canvas_scene_device_get(Evas *eo_e EINA_UNUSED, Evas_Public_Data *e, const char *name)
{
const char *dev_name;
Evas_Device *dev;
@@ -138,11 +141,11 @@ _evas_canvas_efl_canvas_device_get(Evas *eo_e EINA_UNUSED, Evas_Public_Data *e,
EAPI Evas_Device *
evas_device_get(Evas *eo_e, const char *name)
{
- return efl_canvas_device_get(eo_e, name);
+ return efl_canvas_scene_device_get(eo_e, name);
}
EOLIAN Efl_Input_Device *
-_evas_canvas_efl_canvas_seat_get(Evas *eo_e EINA_UNUSED, Evas_Public_Data *e, unsigned int id)
+_evas_canvas_efl_canvas_scene_seat_get(Evas *eo_e EINA_UNUSED, Evas_Public_Data *e, unsigned int id)
{
Evas_Device *dev;
Eina_List *l;
@@ -162,7 +165,7 @@ _evas_canvas_efl_canvas_seat_get(Evas *eo_e EINA_UNUSED, Evas_Public_Data *e, un
EAPI Evas_Device *
evas_device_get_by_seat_id(Evas *eo_e, unsigned int id)
{
- return efl_canvas_seat_get(eo_e, id);
+ return efl_canvas_scene_seat_get(eo_e, id);
}
EAPI Evas_Device *
@@ -184,11 +187,11 @@ evas_device_add_full(Evas *eo_e, const char *name, const char *desc,
SAFETY_CHECK(eo_e, EVAS_CANVAS_CLASS, NULL);
- dev = efl_add(EFL_INPUT_DEVICE_CLASS, parent_dev ?: eo_e,
- efl_name_set(efl_added, name),
- efl_comment_set(efl_added, desc),
- efl_input_device_type_set(efl_added, clas),
- efl_input_device_source_set(efl_added, emulation_dev));
+ dev = efl_add_ref(EFL_INPUT_DEVICE_CLASS, parent_dev ?: eo_e,
+ efl_name_set(efl_added, name),
+ efl_comment_set(efl_added, desc),
+ efl_input_device_type_set(efl_added, clas),
+ efl_input_device_source_set(efl_added, emulation_dev));
d = efl_data_scope_get(dev, EFL_INPUT_DEVICE_CLASS);
d->evas = eo_e;
@@ -247,7 +250,7 @@ evas_device_add_full(Evas *eo_e, const char *name, const char *desc,
e->devices = eina_list_append(e->devices, dev);
efl_event_callback_add(dev, EFL_EVENT_DEL, _del_cb, e);
- efl_event_callback_call(eo_e, EFL_CANVAS_EVENT_DEVICE_ADDED, dev);
+ efl_event_callback_call(eo_e, EFL_CANVAS_SCENE_EVENT_DEVICE_ADDED, dev);
// Keeping this event to do not break things...
evas_event_callback_call(eo_e, EVAS_CALLBACK_DEVICE_CHANGED, dev);
if (e->pending_default_focus_obj && (e->default_seat == dev))
@@ -264,8 +267,9 @@ EAPI void
evas_device_del(Evas_Device *dev)
{
SAFETY_CHECK(dev, EFL_INPUT_DEVICE_CLASS);
-
- efl_del(dev);
+ if (!efl_invalidated_get(dev))
+ efl_del(dev);
+ efl_unref(dev);
}
EAPI void
@@ -500,7 +504,7 @@ again:
*/
EINA_LIST_FREE(e->devices, dev)
{
- efl_event_callback_call(e->evas, EFL_CANVAS_EVENT_DEVICE_REMOVED, dev);
+ efl_event_callback_call(e->evas, EFL_CANVAS_SCENE_EVENT_DEVICE_REMOVED, dev);
efl_event_callback_del(dev, EFL_EVENT_DEL, _del_cb, e);
}
}
diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c
index 148ac173bc..171a1df655 100644
--- a/src/lib/evas/canvas/evas_events.c
+++ b/src/lib/evas/canvas/evas_events.c
@@ -551,7 +551,7 @@ _evas_event_source_mouse_down_events(Evas_Object *eo_obj, Evas *eo_e,
}
eina_list_free(copy);
- efl_del(evt);
+ efl_unref(evt);
}
static void
@@ -765,7 +765,7 @@ _evas_event_source_mouse_move_events(Evas_Object *eo_obj, Evas *eo_e,
}
}
- efl_del(evt);
+ efl_unref(evt);
}
static void
@@ -833,7 +833,7 @@ _evas_event_source_mouse_up_events(Evas_Object *eo_obj, Evas *eo_e,
}
eina_list_free(copy);
- efl_del(evt);
+ efl_unref(evt);
}
static void
@@ -915,7 +915,7 @@ _evas_event_source_wheel_events(Evas_Object *eo_obj, Evas *eo_e,
}
eina_list_free(copy);
- efl_del(evt);
+ efl_unref(evt);
}
static void
@@ -983,7 +983,7 @@ _evas_event_source_multi_down_events(Evas_Object_Protected_Data *obj, Evas_Publi
}
eina_list_free(copy);
- efl_del(evt);
+ efl_unref(evt);
}
static void
@@ -1041,7 +1041,7 @@ _evas_event_source_multi_up_events(Evas_Object_Protected_Data *obj, Evas_Public_
}
eina_list_free(copy);
- efl_del(evt);
+ efl_unref(evt);
}
static void
@@ -1156,7 +1156,7 @@ _evas_event_source_multi_move_events(Evas_Object_Protected_Data *obj, Evas_Publi
eina_list_free(ins);
}
- efl_del(evt);
+ efl_unref(evt);
}
static void
@@ -1246,7 +1246,7 @@ _evas_event_source_mouse_in_events(Evas_Object *eo_obj, Evas *eo_e,
}
EINA_COW_WRITE_END(evas_object_proxy_cow, src->proxy, proxy_write);
- efl_del(evt);
+ efl_unref(evt);
}
static void
@@ -1307,7 +1307,7 @@ _evas_event_source_mouse_out_events(Evas_Object *eo_obj, Evas *eo_e,
proxy_write->src_event_in = eina_list_free(proxy_write->src_event_in);
EINA_COW_WRITE_END(evas_object_proxy_cow, src->proxy, proxy_write);
- efl_del(evt);
+ efl_unref(evt);
}
static Eina_List *
@@ -1378,7 +1378,7 @@ _evas_canvas_event_default_flags_set(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e,
}
EOLIAN Evas_Event_Flags
-_evas_canvas_event_default_flags_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
+_evas_canvas_event_default_flags_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
{
return e->default_event_flags;
}
@@ -1701,7 +1701,7 @@ _post_up_handle(Evas_Public_Data *e, Efl_Input_Pointer *parent_ev,
if (pdata->seat->inside)
_evas_canvas_event_pointer_move_event_dispatch(e, pdata, ev->data);
- efl_del(evt);
+ efl_unref(evt);
}
static void
@@ -1850,7 +1850,7 @@ _canvas_event_feed_mouse_updown(Eo *eo_e, int b, Evas_Button_Flags flags,
else
_canvas_event_feed_mouse_up_internal(e, ev);
- efl_del(evt);
+ efl_unref(evt);
}
static void
@@ -1952,7 +1952,7 @@ evas_event_feed_mouse_cancel(Eo *eo_e, unsigned int timestamp, const void *data)
_canvas_event_feed_mouse_cancel_internal(e, ev);
- efl_del(evt);
+ efl_unref(evt);
}
static void
@@ -2024,7 +2024,7 @@ _canvas_event_feed_mouse_wheel_internal(Eo *eo_e, Efl_Input_Pointer_Data *pe)
eina_list_free(copy);
_evas_post_event_callback_call(eo_e, e, event_id);
- efl_del(evt);
+ efl_unref(evt);
_evas_unwalk(e);
}
@@ -2044,7 +2044,7 @@ evas_event_feed_mouse_wheel(Eo *eo_e, int direction, int z, unsigned int timesta
ev->device = efl_ref(_evas_event_legacy_device_get(eo_e, EINA_TRUE));
_canvas_event_feed_mouse_wheel_internal(eo_e, ev);
- efl_del(evt);
+ efl_unref(evt);
}
static void
@@ -2485,7 +2485,7 @@ _canvas_event_feed_mouse_move_legacy(Evas *eo_e, Evas_Public_Data *e, int x, int
_canvas_event_feed_mouse_move_internal(e, ev);
- efl_del(evt);
+ efl_unref(evt);
}
EAPI void
@@ -2713,7 +2713,7 @@ _canvas_event_feed_mouse_inout_legacy(Eo *eo_e, unsigned int timestamp,
else
_canvas_event_feed_mouse_out_internal(eo_e, ev);
- efl_del(evt);
+ efl_unref(evt);
}
EAPI void
@@ -2961,7 +2961,7 @@ _canvas_event_feed_multi_internal(Evas *eo_e, Evas_Public_Data *e,
default: break;
}
- efl_del(evt);
+ efl_unref(evt);
}
EAPI void
@@ -3414,7 +3414,7 @@ _canvas_event_feed_key_legacy(Eo *eo_e, Evas_Public_Data *e,
else
_canvas_event_feed_key_up_internal(e, ev);
- efl_del(evt);
+ efl_unref(evt);
}
EAPI void
@@ -3502,7 +3502,7 @@ evas_event_feed_hold(Eo *eo_e, int hold, unsigned int timestamp, const void *dat
_evas_unwalk(e);
_evas_object_event_new();
- efl_del(evt);
+ efl_unref(evt);
}
void
@@ -3671,7 +3671,7 @@ evas_event_feed_axis_update(Evas *eo_e, unsigned int timestamp, int device, int
_canvas_event_feed_axis_update_internal(e, ev);
- efl_del(evt);
+ efl_unref(evt);
}
static void
@@ -3708,7 +3708,7 @@ _efl_canvas_object_freeze_events_set(Eo *eo_obj, Evas_Object_Protected_Data *obj
}
EOLIAN Eina_Bool
-_efl_canvas_object_freeze_events_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
+_efl_canvas_object_freeze_events_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
{
return obj->freeze_events;
}
@@ -3724,7 +3724,7 @@ _efl_canvas_object_pass_events_set(Eo *eo_obj, Evas_Object_Protected_Data *obj,
}
EOLIAN Eina_Bool
-_efl_canvas_object_pass_events_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
+_efl_canvas_object_pass_events_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
{
return obj->pass_events;
}
@@ -3739,7 +3739,7 @@ _efl_canvas_object_repeat_events_set(Eo *eo_obj, Evas_Object_Protected_Data *obj
}
EOLIAN Eina_Bool
-_efl_canvas_object_repeat_events_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
+_efl_canvas_object_repeat_events_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
{
return obj->repeat_events;
}
@@ -3751,7 +3751,7 @@ _efl_canvas_object_propagate_events_set(Eo *eo_obj EINA_UNUSED, Evas_Object_Prot
}
EOLIAN Eina_Bool
-_efl_canvas_object_propagate_events_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
+_efl_canvas_object_propagate_events_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
{
return !(obj->no_propagate);
}
@@ -3838,7 +3838,7 @@ _efl_canvas_object_pointer_mode_by_device_set(Eo *eo_obj, Evas_Object_Protected_
}
EOLIAN Evas_Object_Pointer_Mode
-_efl_canvas_object_pointer_mode_by_device_get(Eo *eo_obj EINA_UNUSED,
+_efl_canvas_object_pointer_mode_by_device_get(const Eo *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj,
Efl_Input_Device *dev)
{
@@ -3862,13 +3862,13 @@ _efl_canvas_object_pointer_mode_set(Eo *eo_obj, Evas_Object_Protected_Data *obj,
}
EOLIAN Evas_Object_Pointer_Mode
-_efl_canvas_object_pointer_mode_get(Eo *eo_obj, Evas_Object_Protected_Data *obj)
+_efl_canvas_object_pointer_mode_get(const Eo *eo_obj, Evas_Object_Protected_Data *obj)
{
return _efl_canvas_object_pointer_mode_by_device_get(eo_obj, obj, NULL);
}
EOLIAN Eina_Bool
-_efl_canvas_object_efl_canvas_pointer_pointer_inside_get(Eo *eo_obj,
+_efl_canvas_object_efl_canvas_pointer_pointer_inside_get(const Eo *eo_obj,
Evas_Object_Protected_Data *obj,
Efl_Input_Device *pointer)
{
@@ -4007,7 +4007,7 @@ evas_event_refeed_event(Eo *eo_e, void *event_copy, Evas_Callback_Type event_typ
EOLIAN int
-_evas_canvas_event_down_count_by_device_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e,
+_evas_canvas_event_down_count_by_device_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e,
Efl_Input_Device *dev)
{
Evas_Pointer_Data *pdata = _evas_pointer_data_by_device_get(e, dev);
@@ -4016,7 +4016,7 @@ _evas_canvas_event_down_count_by_device_get(Eo *eo_e EINA_UNUSED, Evas_Public_Da
}
EOLIAN int
-_evas_canvas_event_down_count_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
+_evas_canvas_event_down_count_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
{
return _evas_canvas_event_down_count_by_device_get(eo_e, e, NULL);
}
@@ -4194,7 +4194,7 @@ _evas_canvas_event_pointer_move_event_dispatch(Evas_Public_Data *edata,
_canvas_event_feed_mouse_move_internal(edata, ev);
- efl_del(evt);
+ efl_unref(evt);
}
void
diff --git a/src/lib/evas/canvas/evas_filter_mixin.c b/src/lib/evas/canvas/evas_filter_mixin.c
index 2cf3017dce..4da1c6ddaf 100644
--- a/src/lib/evas/canvas/evas_filter_mixin.c
+++ b/src/lib/evas/canvas/evas_filter_mixin.c
@@ -511,7 +511,7 @@ _efl_canvas_filter_internal_efl_gfx_filter_filter_program_set(Eo *eo_obj, Evas_F
}
EOLIAN static void
-_efl_canvas_filter_internal_efl_gfx_filter_filter_program_get(Eo *eo_obj EINA_UNUSED, Evas_Filter_Data *pd, const char **code, const char **name)
+_efl_canvas_filter_internal_efl_gfx_filter_filter_program_get(const Eo *eo_obj EINA_UNUSED, Evas_Filter_Data *pd, const char **code, const char **name)
{
if (code) *code = pd->data->code;
if (name) *name = pd->data->name;
@@ -519,7 +519,7 @@ _efl_canvas_filter_internal_efl_gfx_filter_filter_program_get(Eo *eo_obj EINA_UN
EOLIAN static void
_efl_canvas_filter_internal_efl_gfx_filter_filter_source_set(Eo *eo_obj, Evas_Filter_Data *pd,
- const char *name, Efl_Gfx *eo_source)
+ const char *name, Efl_Gfx_Entity *eo_source)
{
Evas_Object_Protected_Data *obj;
Evas_Filter_Proxy_Binding *pb, *pb_old = NULL;
@@ -604,8 +604,8 @@ update:
evas_filter_dirty(eo_obj);
}
-EOLIAN static Efl_Gfx *
-_efl_canvas_filter_internal_efl_gfx_filter_filter_source_get(Eo *obj EINA_UNUSED, Evas_Filter_Data *pd,
+EOLIAN static Efl_Gfx_Entity *
+_efl_canvas_filter_internal_efl_gfx_filter_filter_source_get(const Eo *obj EINA_UNUSED, Evas_Filter_Data *pd,
const char * name)
{
Evas_Filter_Proxy_Binding *pb = eina_hash_find(pd->data->sources, name);
@@ -647,7 +647,7 @@ _efl_canvas_filter_internal_efl_gfx_filter_filter_state_set(Eo *eo_obj, Evas_Fil
}
EOLIAN static void
-_efl_canvas_filter_internal_efl_gfx_filter_filter_state_get(Eo *obj EINA_UNUSED, Evas_Filter_Data *pd,
+_efl_canvas_filter_internal_efl_gfx_filter_filter_state_get(const Eo *obj EINA_UNUSED, Evas_Filter_Data *pd,
const char **cur_state, double *cur_val,
const char **next_state, double *next_val,
double *pos)
@@ -660,7 +660,7 @@ _efl_canvas_filter_internal_efl_gfx_filter_filter_state_get(Eo *obj EINA_UNUSED,
}
EOLIAN static void
-_efl_canvas_filter_internal_efl_gfx_filter_filter_padding_get(Eo *eo_obj EINA_UNUSED, Evas_Filter_Data *pd,
+_efl_canvas_filter_internal_efl_gfx_filter_filter_padding_get(const Eo *eo_obj EINA_UNUSED, Evas_Filter_Data *pd,
int *l, int *r, int *t, int *b)
{
Evas_Filter_Padding pad = { 0, 0, 0, 0 };
@@ -810,7 +810,7 @@ _efl_canvas_filter_internal_efl_gfx_filter_filter_data_set(Eo *eo_obj, Evas_Filt
}
EOLIAN static void
-_efl_canvas_filter_internal_efl_gfx_filter_filter_data_get(Eo *obj EINA_UNUSED, Evas_Filter_Data *pd,
+_efl_canvas_filter_internal_efl_gfx_filter_filter_data_get(const Eo *obj EINA_UNUSED, Evas_Filter_Data *pd,
const char *name, const char **value,
Eina_Bool *execute)
{
@@ -834,7 +834,7 @@ _efl_canvas_filter_internal_efl_gfx_filter_filter_data_get(Eo *obj EINA_UNUSED,
}
EOLIAN static void *
-_efl_canvas_filter_internal_filter_output_buffer_get(Eo *obj EINA_UNUSED, Evas_Filter_Data *pd)
+_efl_canvas_filter_internal_filter_output_buffer_get(const Eo *obj EINA_UNUSED, Evas_Filter_Data *pd)
{
return pd->data->output;
}
diff --git a/src/lib/evas/canvas/evas_focus.c b/src/lib/evas/canvas/evas_focus.c
index e57008bff9..52ad4fe033 100644
--- a/src/lib/evas/canvas/evas_focus.c
+++ b/src/lib/evas/canvas/evas_focus.c
@@ -5,12 +5,33 @@
#include "evas_private.h"
#include "interfaces/efl_common_internal.h"
+
+static int evas_focus_log_domain = -1;
+
+#define F_CRI(...) EINA_LOG_DOM_CRIT(evas_focus_log_domain, __VA_ARGS__)
+#define F_ERR(...) EINA_LOG_DOM_ERR(evas_focus_log_domain, __VA_ARGS__)
+#define F_WRN(...) EINA_LOG_DOM_WARN(evas_focus_log_domain, __VA_ARGS__)
+#define F_INF(...) EINA_LOG_DOM_INFO(evas_focus_log_domain, __VA_ARGS__)
+#define F_DBG(...) EINA_LOG_DOM_DBG(evas_focus_log_domain, __VA_ARGS__)
+
/* private calls */
/* local calls */
/* public calls */
+void
+evas_focus_init(void)
+{
+ evas_focus_log_domain = eina_log_domain_register("evas-focus", "red");
+}
+
+void
+evas_focus_shutdown(void)
+{
+ eina_log_domain_unregister(evas_focus_log_domain);
+ evas_focus_log_domain = -1;
+}
static Eina_Bool
_already_focused(Eina_List *seats, Efl_Input_Device *seat)
@@ -28,16 +49,18 @@ _already_focused(Eina_List *seats, Efl_Input_Device *seat)
}
static Efl_Input_Device *
-_default_seat_get(Eo *evas_obj)
+_default_seat_get(const Eo *evas_obj)
{
Evas_Public_Data *edata;
- Evas *evas = evas_object_evas_get(evas_obj);
+ Evas *evas = evas_object_evas_get((Evas_Object *)evas_obj);
edata = efl_data_scope_get(evas, EVAS_CANVAS_CLASS);
if (!edata) return NULL;
return edata->default_seat;
}
+#define DEBUG_TUPLE(v) v, (v ? efl_class_name_get(v) : "(null)")
+
static void
_evas_focus_set(Eo *evas_obj, Efl_Input_Device *key, Eina_Bool focus)
{
@@ -47,8 +70,18 @@ _evas_focus_set(Eo *evas_obj, Efl_Input_Device *key, Eina_Bool focus)
EINA_SAFETY_ON_NULL_RETURN(evas);
edata = efl_data_scope_get(evas, EVAS_CANVAS_CLASS);
+ F_DBG("Focus moved in %d from (%p,%s) to (%p,%s)", efl_input_device_seat_id_get(key), DEBUG_TUPLE(eina_hash_find(edata->focused_objects, &key)), DEBUG_TUPLE(evas_obj));
+
if (focus)
- eina_hash_add(edata->focused_objects, &key, evas_obj);
+ {
+ Eo *foc;
+
+ foc = eina_hash_set(edata->focused_objects, &key, evas_obj);
+ if (foc)
+ {
+ F_ERR("Element %p was focused while a other object was unfocused, this is not expected! No unfocus event will be sent to it", foc);
+ }
+ }
else
eina_hash_del_by_key(edata->focused_objects, &key);
}
@@ -101,7 +134,7 @@ _evas_focus_dispatch_event(Evas_Object_Protected_Data *obj, Efl_Input_Device *se
evt, _evas_object_event_new(),
efl_object_focus_event);
evas_event_callback_call(obj->layer->evas->evas, cb_evas, evt);
- efl_del(evt);
+ efl_unref(evt);
}
static void
@@ -120,7 +153,7 @@ _evas_object_unfocus(Evas_Object_Protected_Data *obj, Efl_Input_Device *seat)
}
void
-_evas_focus_device_del_cb(void *data, const Efl_Event *ev)
+_evas_focus_device_invalidate_cb(void *data, const Efl_Event *ev)
{
_evas_object_unfocus(data, ev->object);
}
@@ -170,8 +203,8 @@ _efl_canvas_object_seat_focus_del(Eo *eo_obj,
return EINA_FALSE;
}
- efl_event_callback_del(dev, EFL_EVENT_DEL,
- _evas_focus_device_del_cb, obj);
+ efl_event_callback_del(dev, EFL_EVENT_INVALIDATE,
+ _evas_focus_device_invalidate_cb, obj);
_evas_object_unfocus(obj, dev);
return EINA_TRUE;
}
@@ -236,7 +269,7 @@ _efl_canvas_object_seat_focus_add(Eo *eo_obj,
//In case intercept focus callback focused object we should return.
if (_current_focus_get(eo_obj, seat)) goto end;
- efl_event_callback_add(seat, EFL_EVENT_DEL, _evas_focus_device_del_cb, obj);
+ efl_event_callback_add(seat, EFL_EVENT_INVALIDATE, _evas_focus_device_invalidate_cb, obj);
EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events)
events->focused_by_seats = eina_list_append(events->focused_by_seats, seat);
@@ -252,7 +285,7 @@ _efl_canvas_object_seat_focus_add(Eo *eo_obj,
}
EOLIAN Eina_Bool
-_efl_canvas_object_seat_focus_check(Eo *eo_obj,
+_efl_canvas_object_seat_focus_check(const Eo *eo_obj,
Evas_Object_Protected_Data *obj,
Efl_Input_Device *seat)
{
@@ -289,7 +322,7 @@ _efl_canvas_object_key_focus_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Ei
}
EOLIAN Eina_Bool
-_efl_canvas_object_seat_focus_get(Eo *eo_obj, Evas_Object_Protected_Data *obj)
+_efl_canvas_object_seat_focus_get(const Eo *eo_obj, Evas_Object_Protected_Data *obj)
{
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return EINA_FALSE;
@@ -299,13 +332,13 @@ _efl_canvas_object_seat_focus_get(Eo *eo_obj, Evas_Object_Protected_Data *obj)
}
EOLIAN Eina_Bool
-_efl_canvas_object_key_focus_get(Eo *eo_obj, Evas_Object_Protected_Data *obj)
+_efl_canvas_object_key_focus_get(const Eo *eo_obj, Evas_Object_Protected_Data *obj)
{
return _efl_canvas_object_seat_focus_check(eo_obj, obj, NULL);
}
EOLIAN Evas_Object *
-_evas_canvas_seat_focus_get(Eo *eo_obj EINA_UNUSED, Evas_Public_Data *e,
+_evas_canvas_seat_focus_get(const Eo *eo_obj EINA_UNUSED, Evas_Public_Data *e,
Efl_Input_Device *seat)
{
if (!seat)
@@ -315,7 +348,7 @@ _evas_canvas_seat_focus_get(Eo *eo_obj EINA_UNUSED, Evas_Public_Data *e,
}
EOLIAN Evas_Object*
-_evas_canvas_focus_get(Eo *eo_obj EINA_UNUSED, Evas_Public_Data *e)
+_evas_canvas_focus_get(const Eo *eo_obj EINA_UNUSED, Evas_Public_Data *e)
{
return _evas_canvas_seat_focus_get(eo_obj, e, NULL);
}
diff --git a/src/lib/evas/canvas/evas_font_dir.c b/src/lib/evas/canvas/evas_font_dir.c
index f73b77dab1..e4006ab611 100644
--- a/src/lib/evas/canvas/evas_font_dir.c
+++ b/src/lib/evas/canvas/evas_font_dir.c
@@ -537,7 +537,8 @@ evas_font_desc_cmp(const Evas_Font_Description *a,
/* FIXME: Do actual comparison, i.e less than and bigger than. */
return !((a->name == b->name) && (a->weight == b->weight) &&
(a->slant == b->slant) && (a->width == b->width) &&
- (a->spacing == b->spacing) && (a->lang == b->lang));
+ (a->spacing == b->spacing) && (a->lang == b->lang) &&
+ (a->fallbacks == b->fallbacks));
}
const char *
@@ -873,10 +874,11 @@ evas_font_load(const Eina_List *font_paths, int hinting, Evas_Font_Description *
/* Handle font fallbacks */
if (fdesc->fallbacks)
{
- while (1)
+ const char *start, *end;
+ start = fdesc->fallbacks;
+
+ while (start)
{
- const char *start, *end;
- start = fdesc->fallbacks;
end = strchr(start, ',');
if (end)
{
@@ -884,6 +886,7 @@ evas_font_load(const Eina_List *font_paths, int hinting, Evas_Font_Description *
strncpy(tmp, start, end - start);
tmp[end - start] = 0;
FcPatternAddString (p_nm, FC_FAMILY, (FcChar8*) tmp);
+ start = end + 1;
}
else
{
diff --git a/src/lib/evas/canvas/evas_gl.c b/src/lib/evas/canvas/evas_gl.c
index a54de42236..62b7a3fa0f 100644
--- a/src/lib/evas/canvas/evas_gl.c
+++ b/src/lib/evas/canvas/evas_gl.c
@@ -147,7 +147,10 @@ evas_gl_new(Evas *e)
evas_gl->evas = efl_data_ref(e, EVAS_CANVAS_CLASS);
LKI(evas_gl->lck);
- if (!evas_gl->evas->engine.func->gl_context_create)
+ if (!evas_gl->evas->engine.func->gl_context_create ||
+ !evas_gl->evas->engine.func->gl_supports_evas_gl ||
+ !evas_gl->evas->engine.func->gl_supports_evas_gl(
+ _evas_engine_context(evas_gl->evas)))
{
ERR("Evas GL engine not available.");
efl_data_unref(e, evas_gl->evas);
diff --git a/src/lib/evas/canvas/evas_grid.eo b/src/lib/evas/canvas/evas_grid.eo
index 11e3614ecf..f1b32c7945 100644
--- a/src/lib/evas/canvas/evas_grid.eo
+++ b/src/lib/evas/canvas/evas_grid.eo
@@ -4,37 +4,20 @@ class Evas.Grid (Efl.Canvas.Group)
legacy_prefix: evas_object_grid;
eo_prefix: evas_obj_grid;
methods {
- @property mirrored {
- set {
- [[Sets the mirrored mode of the grid. In mirrored mode the grid items go
- from right to left instead of left to right. That is, 0,0 is top right, not
- to left.
-
- @since 1.1]]
- }
- get {
- [[Gets the mirrored mode of the grid.
-
- See also @.mirrored.set
-
- @since 1.1]]
- }
- values {
- mirrored: bool; [[$true if mirrored mode is set, $false otherwise]]
- }
- }
- @property size {
+ @property grid_size {
set {
[[Set the virtual resolution for the grid
@since 1.1]]
+ legacy: evas_object_grid_size_set;
}
get {
[[Get the current virtual resolution
- See also @.size.set
+ See also @.grid_size.set
@since 1.1]]
+ legacy: evas_object_grid_size_get;
}
values {
w: int; [[The virtual horizontal size (resolution) in integer units.]]
@@ -135,5 +118,6 @@ class Evas.Grid (Efl.Canvas.Group)
}
implements {
Efl.Object.constructor;
+ Efl.Ui.Base.mirrored {get; set;}
}
}
diff --git a/src/lib/evas/canvas/evas_image.eo b/src/lib/evas/canvas/evas_image.eo
index 2f0ccaf4f9..e54d35a305 100644
--- a/src/lib/evas/canvas/evas_image.eo
+++ b/src/lib/evas/canvas/evas_image.eo
@@ -1,4 +1,4 @@
-class Evas.Image (Efl.Canvas.Image.Internal, Efl.File)
+class Evas.Image (Efl.Canvas.Image_Internal, Efl.File)
{
[[Internal class for legacy support of Evas Image.]]
data: null;
diff --git a/src/lib/evas/canvas/evas_image_legacy.c b/src/lib/evas/canvas/evas_image_legacy.c
index 7d19b8b08f..344408e38a 100644
--- a/src/lib/evas/canvas/evas_image_legacy.c
+++ b/src/lib/evas/canvas/evas_image_legacy.c
@@ -26,7 +26,7 @@ EAPI Evas_Object *
evas_object_image_add(Evas *eo_e)
{
EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(eo_e, EVAS_CANVAS_CLASS), NULL);
- return efl_add(EVAS_IMAGE_CLASS, eo_e,
+ return efl_add(EVAS_IMAGE_CLASS, evas_find(eo_e),
efl_gfx_fill_auto_set(efl_added, EINA_FALSE),
efl_canvas_object_legacy_ctor(efl_added));
}
@@ -35,7 +35,7 @@ EAPI Evas_Object *
evas_object_image_filled_add(Evas *eo_e)
{
EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(eo_e, EVAS_CANVAS_CLASS), NULL);
- return efl_add(EVAS_IMAGE_CLASS, eo_e,
+ return efl_add(EVAS_IMAGE_CLASS, evas_find(eo_e),
efl_canvas_object_legacy_ctor(efl_added));
}
@@ -118,42 +118,42 @@ EAPI void
evas_object_image_border_set(Evas_Object *obj, int l, int r, int t, int b)
{
EVAS_IMAGE_API(obj);
- efl_image_border_set(obj, l, r, t, b);
+ efl_gfx_image_border_set(obj, l, r, t, b);
}
EAPI void
evas_object_image_border_get(const Evas_Object *obj, int *l, int *r, int *t, int *b)
{
EVAS_IMAGE_API(obj);
- efl_image_border_get(obj, l, r, t, b);
+ efl_gfx_image_border_get(obj, l, r, t, b);
}
EAPI void
evas_object_image_border_scale_set(Evas_Object *obj, double scale)
{
EVAS_IMAGE_API(obj);
- efl_image_border_scale_set(obj, scale);
+ efl_gfx_image_border_scale_set(obj, scale);
}
EAPI double
evas_object_image_border_scale_get(const Evas_Object *obj)
{
- EVAS_IMAGE_API(obj, 1.0);
- return efl_image_border_scale_get(obj);
+ EVAS_IMAGE_API(obj, 0.0);
+ return efl_gfx_image_border_scale_get(obj);
}
EAPI void
evas_object_image_border_center_fill_set(Evas_Object *obj, Evas_Border_Fill_Mode fill)
{
EVAS_IMAGE_API(obj);
- efl_image_border_center_fill_set(obj, (Efl_Gfx_Border_Fill_Mode) fill);
+ efl_gfx_image_border_center_fill_set(obj, (Efl_Gfx_Border_Fill_Mode) fill);
}
EAPI Evas_Border_Fill_Mode
evas_object_image_border_center_fill_get(const Evas_Object *obj)
{
- EVAS_IMAGE_API(obj, EVAS_BORDER_FILL_DEFAULT);
- return (Evas_Border_Fill_Mode) efl_image_border_center_fill_get(obj);
+ EVAS_IMAGE_API(obj, EVAS_BORDER_FILL_NONE);
+ return (Evas_Border_Fill_Mode) efl_gfx_image_border_center_fill_get(obj);
}
EAPI void
@@ -370,14 +370,14 @@ EAPI void
evas_object_image_smooth_scale_set(Evas_Object *obj, Eina_Bool smooth_scale)
{
EVAS_IMAGE_API(obj);
- efl_image_smooth_scale_set(obj, smooth_scale);
+ efl_gfx_image_smooth_scale_set(obj, smooth_scale);
}
EAPI Eina_Bool
evas_object_image_smooth_scale_get(const Evas_Object *obj)
{
EVAS_IMAGE_API(obj, EINA_FALSE);
- return efl_image_smooth_scale_get(obj);
+ return efl_gfx_image_smooth_scale_get(obj);
}
EAPI void
@@ -475,28 +475,28 @@ EAPI void
evas_object_image_content_hint_set(Evas_Object *obj, Evas_Image_Content_Hint hint)
{
EVAS_IMAGE_API(obj);
- return efl_image_content_hint_set(obj, hint);
+ return efl_gfx_image_content_hint_set(obj, hint);
}
EAPI Evas_Image_Content_Hint
evas_object_image_content_hint_get(const Evas_Object *obj)
{
EVAS_IMAGE_API(obj, EVAS_IMAGE_CONTENT_HINT_NONE);
- return efl_image_content_hint_get(obj);
+ return efl_gfx_image_content_hint_get(obj);
}
EAPI void
evas_object_image_scale_hint_set(Evas_Object *obj, Evas_Image_Scale_Hint hint)
{
EVAS_IMAGE_API(obj);
- return efl_image_scale_hint_set(obj, (Efl_Image_Scale_Hint) hint);
+ return efl_gfx_image_scale_hint_set(obj, (Efl_Gfx_Image_Scale_Hint) hint);
}
EAPI Evas_Image_Scale_Hint
evas_object_image_scale_hint_get(const Evas_Object *obj)
{
EVAS_IMAGE_API(obj, EVAS_IMAGE_SCALE_HINT_NONE);
- return (Evas_Image_Scale_Hint) efl_image_scale_hint_get(obj);
+ return (Evas_Image_Scale_Hint) efl_gfx_image_scale_hint_get(obj);
}
EAPI void
@@ -1214,6 +1214,21 @@ evas_object_image_pixels_import(Evas_Object *eo_obj, Evas_Pixel_Import_Source *p
return EINA_TRUE;
}
+EAPI Eina_Bool
+evas_image_max_size_get(Eo *eo_e, int *w, int *h)
+{
+ Eina_Size2D size;
+ Eina_Bool ret;
+
+ ret = efl_canvas_scene_image_max_size_get(eo_e, &size);
+ if (ret)
+ {
+ if (w) *w = size.w;
+ if (h) *h = size.h;
+ }
+ return ret;
+}
+
/* deprecated */
EAPI void
evas_object_image_alpha_mask_set(Evas_Object *eo_obj EINA_UNUSED, Eina_Bool ismask EINA_UNUSED)
@@ -1225,15 +1240,13 @@ evas_object_image_alpha_mask_set(Evas_Object *eo_obj EINA_UNUSED, Eina_Bool isma
EOLIAN static Eina_Bool
_evas_image_efl_file_mmap_set(Eo *obj, void *pd EINA_UNUSED, const Eina_File *f, const char *key)
{
- WRN("efl_file_mmap_set shouldn't be used on Evas.Image. please switch to Efl.Canvas.Image");
EVAS_IMAGE_API(obj, EINA_FALSE);
return _evas_image_mmap_set(obj, f, key);
}
EOLIAN static void
-_evas_image_efl_file_mmap_get(Eo *obj, void *pd EINA_UNUSED, const Eina_File **f, const char **key)
+_evas_image_efl_file_mmap_get(const Eo *obj, void *pd EINA_UNUSED, const Eina_File **f, const char **key)
{
- WRN("efl_file_mmap_get shouldn't be used on Evas.Image. please switch to Efl.Canvas.Image");
if (f) *f = NULL;
if (key) *key = NULL;
EVAS_IMAGE_API(obj);
diff --git a/src/lib/evas/canvas/evas_image_private.h b/src/lib/evas/canvas/evas_image_private.h
index b4e0f277b0..91f5948a70 100644
--- a/src/lib/evas/canvas/evas_image_private.h
+++ b/src/lib/evas/canvas/evas_image_private.h
@@ -111,8 +111,8 @@ struct _Evas_Image_Data
int pixels_checked_out;
int load_error;
- Efl_Image_Scale_Hint scale_hint;
- Efl_Image_Content_Hint content_hint;
+ Efl_Gfx_Image_Scale_Hint scale_hint;
+ Efl_Gfx_Image_Content_Hint content_hint;
Efl_Flip flip_value;
Efl_Orient orient_value;
@@ -163,7 +163,7 @@ Eina_Bool _evas_image_file_set(Eo *eo_obj, const char *file, const char *key);
void _evas_image_file_get(const Eo *eo_obj, const char **file, const char **key);
/* Efl.Image.Load */
-Efl_Image_Load_Error _evas_image_load_error_get(const Eo *eo_obj);
+Efl_Gfx_Image_Load_Error _evas_image_load_error_get(const Eo *eo_obj);
void _evas_image_load_post_update(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
void _evas_image_load_async_start(Eo *eo_obj);
void _evas_image_load_async_cancel(Eo *eo_obj);
@@ -182,10 +182,10 @@ Eina_Bool _evas_image_load_orientation_get(const Eo *eo_obj);
Eina_Bool _evas_image_load_region_support_get(const Eo *eo_obj);
void _evas_image_orientation_set(Eo *eo_obj, Evas_Image_Data *o, Evas_Image_Orient orient);
-/* Efl.Image.Animated */
+/* Efl.Image_Animation_Controller */
Eina_Bool _evas_image_animated_get(const Eo *eo_obj);
int _evas_image_animated_frame_count_get(const Eo *eo_obj);
-Efl_Image_Animated_Loop_Hint _evas_image_animated_loop_type_get(const Eo *eo_obj);
+Efl_Gfx_Image_Animation_Controller_Loop_Hint _evas_image_animated_loop_type_get(const Eo *eo_obj);
int _evas_image_animated_loop_count_get(const Eo *eo_obj);
double _evas_image_animated_frame_duration_get(const Eo *eo_obj, int start_frame, int frame_num);
Eina_Bool _evas_image_animated_frame_set(Eo *eo_obj, int frame_index);
diff --git a/src/lib/evas/canvas/evas_layer.c b/src/lib/evas/canvas/evas_layer.c
index 0a8dba6545..d4e2eb3469 100644
--- a/src/lib/evas/canvas/evas_layer.c
+++ b/src/lib/evas/canvas/evas_layer.c
@@ -106,7 +106,11 @@ evas_layer_free_objects(Evas_Layer *lay)
EINA_INLIST_FREE(lay->objects, obj)
{
- evas_object_free(obj->object, EINA_FALSE);
+ if (obj->object == NULL)
+ {
+ ERR("Object still present in the canvas stack, but without a valid object pointer (%s@%p).", obj->type, obj);
+ }
+ evas_object_free(obj, EINA_FALSE);
}
}
@@ -268,7 +272,7 @@ evas_object_layer_get(const Evas_Object *obj)
}
EOLIAN short
-_efl_canvas_object_efl_gfx_stack_layer_get(Eo *eo_obj EINA_UNUSED,
+_efl_canvas_object_efl_gfx_stack_layer_get(const Eo *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj)
{
if (obj->smart.parent)
diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c
index 7498916611..389c5ce6dd 100644
--- a/src/lib/evas/canvas/evas_main.c
+++ b/src/lib/evas/canvas/evas_main.c
@@ -1,5 +1,6 @@
#define EVAS_CANVAS_BETA
#define EFL_INPUT_EVENT_PROTECTED
+
#include "evas_common_private.h"
#include "evas_private.h"
//#include "evas_cs.h"
@@ -11,6 +12,8 @@
#include "evas_polygon_private.h"
#include "evas_vg_private.h"
+#include "eo_internal.h"
+
#include <Ecore.h>
#define EFL_INTERNAL_UNSTABLE
@@ -96,6 +99,7 @@ evas_init(void)
EINA_LOG_STATE_INIT);
_efl_gfx_map_init();
+ evas_focus_init();
return _evas_init_count;
@@ -105,8 +109,8 @@ evas_init(void)
#ifdef EVAS_CSERVE2
if (cs2) evas_cserve2_shutdown();
shutdown_async_events:
-#endif
evas_async_events_shutdown();
+#endif
shutdown_module:
evas_module_shutdown();
#ifdef BUILD_LOADER_EET
@@ -141,7 +145,7 @@ evas_shutdown(void)
EINA_LOG_STATE_START,
EINA_LOG_STATE_SHUTDOWN);
- evas_common_shutdown();
+ evas_focus_shutdown();
#ifdef EVAS_CSERVE2
if (evas_cserve2_use_get())
@@ -149,9 +153,20 @@ evas_shutdown(void)
#endif
evas_cache_vg_shutdown();
+ evas_font_path_global_clear();
+
+ evas_thread_shutdown();
+ _evas_preload_thread_shutdown();
+ evas_async_events_shutdown();
+
+ ecore_shutdown();
+ evas_common_shutdown();
+
+ evas_filter_shutdown();
+ evas_module_shutdown();
+
_efl_gfx_map_shutdown();
- evas_font_path_global_clear();
eina_cow_del(evas_object_proxy_cow);
eina_cow_del(evas_object_map_cow);
eina_cow_del(evas_object_state_cow);
@@ -166,17 +181,9 @@ evas_shutdown(void)
evas_object_image_load_opts_cow = NULL;
evas_object_image_state_cow = NULL;
- evas_filter_shutdown();
eina_cow_del(evas_object_mask_cow);
evas_object_mask_cow = NULL;
- evas_thread_shutdown();
- _evas_preload_thread_shutdown();
- evas_async_events_shutdown();
- evas_module_shutdown();
-
- ecore_shutdown();
-
#ifdef BUILD_LOADER_EET
eet_shutdown();
#endif
@@ -198,7 +205,7 @@ evas_shutdown(void)
EAPI Evas *
evas_new(void)
{
- Evas_Object *eo_obj = efl_add(EVAS_CANVAS_CLASS, NULL);
+ Evas_Object *eo_obj = efl_add(EVAS_CANVAS_CLASS, efl_main_loop_get());
return eo_obj;
}
@@ -227,7 +234,7 @@ _evas_canvas_efl_object_constructor(Eo *eo_obj, Evas_Public_Data *e)
eina_clist_init(&e->calc_list);
eina_clist_init(&e->calc_done);
- e->gesture_manager = efl_add(EFL_GESTURE_MANAGER_CLASS, eo_obj);
+ efl_wref_add(efl_add(EFL_CANVAS_GESTURE_MANAGER_CLASS, eo_obj), &e->gesture_manager);
#define EVAS_ARRAY_SET(E, Array) \
eina_array_step_set(&E->Array, sizeof (E->Array), \
@@ -273,106 +280,193 @@ evas_free(Evas *eo_e)
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
return;
MAGIC_CHECK_END();
- evas_sync(eo_e);
- efl_unref(eo_e);
+ if (efl_parent_get(eo_e))
+ efl_del(eo_e);
+ else
+ efl_unref(eo_e);
+}
+
+typedef struct _Forced_Death Forced_Death;
+struct _Forced_Death
+{
+ Eina_Bool invalidated;
+ Eina_Bool noref;
+ Eina_Bool destroyed;
+};
+
+static void
+_object_invalidate(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Forced_Death *force = data;
+ force->invalidated = EINA_TRUE;
+}
+
+static void
+_object_del(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Forced_Death *force = data;
+ force->destroyed = EINA_TRUE;
+}
+
+static void
+_object_noref(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Forced_Death *force = data;
+ force->noref = EINA_TRUE;
}
+EFL_CALLBACKS_ARRAY_DEFINE(_object_forced_death,
+ { EFL_EVENT_DEL, _object_del },
+ { EFL_EVENT_INVALIDATE, _object_invalidate },
+ { EFL_EVENT_NOREF, _object_noref } );
+
+
EOLIAN static void
-_evas_canvas_efl_object_destructor(Eo *eo_e, Evas_Public_Data *e)
+_evas_canvas_efl_object_invalidate(Eo *eo_e, Evas_Public_Data *e)
{
- Eina_Rectangle *r;
- Evas_Coord_Touch_Point *touch_point;
- Evas_Post_Render_Job *job;
+ Evas_Object_Protected_Data *o;
Evas_Layer *lay;
- Efl_Canvas_Output *evo;
- unsigned int prev_zombie_count = UINT_MAX;
- int i;
- Eina_Bool del;
+ Eo *obj;
+ Eina_Array stash = { 0 };
- evas_canvas_async_block(e);
- if (e->walking_list == 0) evas_render_idle_flush(eo_e);
-
- if (e->walking_list > 0) return;
+ evas_sync(eo_e);
+ evas_canvas_async_block(e);
evas_render_idle_flush(eo_e);
+ efl_replace(&e->default_seat, NULL);
+ efl_replace(&e->default_mouse, NULL);
+ efl_replace(&e->default_keyboard, NULL);
+
_evas_post_event_callback_free(eo_e);
_evas_canvas_event_shutdown(eo_e, e);
- efl_del(e->gesture_manager);
- e->gesture_manager = NULL;
-
- del = EINA_TRUE;
- e->walking_list++;
e->cleanup = 1;
- while (del)
+
+ eina_array_step_set(&stash, sizeof (Eina_Array), 16);
+
+ // The first pass should destroy all object that are properly referenced
+ EINA_INLIST_FOREACH(e->layers, lay)
{
- Eina_Bool detach_zombies = EINA_FALSE;
- Evas_Object_Protected_Data *o;
- Eina_List *unrefs = NULL;
- Eo *eo_obj;
+ evas_layer_pre_free(lay);
- del = EINA_FALSE;
- EINA_INLIST_FOREACH(e->layers, lay)
+ EINA_INLIST_FOREACH(lay->objects, o)
{
- evas_layer_pre_free(lay);
-
- EINA_INLIST_FOREACH(lay->objects, o)
- {
- if (!o->delete_me)
- {
- if ((o->ref > 0) || (efl_ref_count(o->object) > 0))
- {
- ERR("obj(%s) ref count(%d) is bigger than 0. This "
- "object couldn't be deleted",
- efl_debug_name_get(o->object),
- efl_ref_count(o->object));
- continue;
- }
- unrefs = eina_list_append(unrefs, o->object);
- del = EINA_TRUE;
- }
- }
+ if (!o->delete_me)
+ eina_array_push(&stash, o->object);
}
+ }
- if (eina_list_count(unrefs) >= prev_zombie_count)
- detach_zombies = EINA_TRUE;
- prev_zombie_count = eina_list_count(unrefs);
+ while ((obj = eina_array_pop(&stash)))
+ {
+ Evas_Object_Protected_Data *pd = efl_data_scope_get(obj, EFL_CANVAS_OBJECT_CLASS);
- EINA_LIST_FREE(unrefs, eo_obj)
+ // Properly destroy depending on the object being legacy or not
+ if (pd->legacy.ctor) evas_object_del(obj);
+ else efl_del(obj);
+ }
+
+ // We are now potentially only facing zombies
+ EINA_INLIST_FOREACH(e->layers, lay)
+ {
+ evas_layer_pre_free(lay);
+ EINA_INLIST_FOREACH(lay->objects, o)
{
- ERR("Killing Zombie Object [%s]. Refs: %i:%i",
- efl_debug_name_get(eo_obj), efl_ref_count(eo_obj), ___efl_ref2_count(eo_obj));
- ___efl_ref2_reset(eo_obj);
- while (efl_ref_count(eo_obj) > 1) efl_unref(eo_obj);
- while (efl_ref_count(eo_obj) < 1) efl_ref(eo_obj);
- efl_del(eo_obj);
-
- if (!detach_zombies) continue;
-
- EINA_INLIST_FOREACH(e->layers, lay)
- EINA_INLIST_FOREACH(lay->objects, o)
- if (o && (o->object == eo_obj))
- {
- ERR("Zombie Object [%s] could not be removed "
- "from the list of objects. Maybe this object "
- "was deleted but the call to efl_destructor() "
- "was not propagated to all the parent classes? "
- "Forcibly removing it. This may leak! Refs: %i:%i",
- efl_debug_name_get(eo_obj), efl_ref_count(eo_obj), ___efl_ref2_count(eo_obj));
- lay->objects = (Evas_Object_Protected_Data *)
- eina_inlist_remove(EINA_INLIST_GET(lay->objects), EINA_INLIST_GET(o));
- goto next_zombie;
- }
-next_zombie:
- continue;
+ if (!o->delete_me)
+ eina_array_push(&stash, o->object);
}
}
+
+ // Killing zombies now
+ while ((obj = eina_array_pop(&stash)))
+ {
+ Forced_Death force = {
+ efl_invalidated_get(obj),
+ efl_parent_get(obj) ? (efl_ref_count(obj) <= 1) : (efl_ref_count(obj) <= 0),
+ EINA_FALSE
+ };
+
+ efl_event_callback_array_add(obj, _object_forced_death(), &force);
+
+ ERR("Killing Zombie Object [%s:%i:%i]. Refs: %i:%i",
+ efl_debug_name_get(obj), force.invalidated, force.noref,
+ efl_ref_count(obj), ___efl_ref2_count(obj));
+ ___efl_ref2_reset(obj);
+ // This code explicitely bypass all refcounting to destroy them
+ if (!force.invalidated) efl_del(obj);
+ while (!force.destroyed) efl_unref(obj);
+
+ if (!force.invalidated)
+ {
+ ERR("Zombie Object [%s] %s@%p could not be invalidated. "
+ "It seems like the call to efl_invalidated() wasn't "
+ "propagated to all the parent classes.",
+ efl_debug_name_get(obj), efl_class_name_get(obj), obj);
+ }
+ if (!force.destroyed)
+ {
+ ERR("Zombie Object [%s] %s@%p could not be destroyed. "
+ "It seems like the call to efl_destructor() wasn't "
+ "propagated to all the parent classes.",
+ efl_debug_name_get(obj), efl_class_name_get(obj), obj);
+ }
+
+ // Forcefully remove the object from layers
+ EINA_INLIST_FOREACH(e->layers, lay)
+ EINA_INLIST_FOREACH(lay->objects, o)
+ if (o && (o->object == obj))
+ {
+ ERR("Zombie Object [%s] %s@%p could not be removed "
+ "from the canvas list of objects. Maybe this object "
+ "was deleted but the call to efl_invalidated() "
+ "was not propagated to all the parent classes? "
+ "Forcibly removing it. This may leak! Refs: %i:%i",
+ efl_debug_name_get(obj), efl_class_name_get(obj), obj,
+ efl_ref_count(obj), ___efl_ref2_count(obj));
+ lay->objects = (Evas_Object_Protected_Data *)
+ eina_inlist_remove(EINA_INLIST_GET(lay->objects), EINA_INLIST_GET(o));
+ goto next_zombie;
+ }
+
+ next_zombie:
+ continue;
+ }
+
+ eina_array_flush(&stash);
+
+ // Destroying layers and their associated objects completely
EINA_INLIST_FOREACH(e->layers, lay)
evas_layer_free_objects(lay);
evas_layer_clean(eo_e);
- e->walking_list--;
+ efl_invalidate(efl_super(eo_e, MY_CLASS));
+}
+
+EOLIAN static void
+_evas_canvas_efl_object_destructor(Eo *eo_e, Evas_Public_Data *e)
+{
+ Eina_Rectangle *r;
+ Evas_Coord_Touch_Point *touch_point;
+ Evas_Post_Render_Job *job;
+ Evas_Layer *lay;
+ Efl_Canvas_Output *evo;
+ int i;
+
+ if (e->layers)
+ {
+ // This should never happen as during invalidate we explicitely
+ // destroy all layers. If they survive, we have a zombie appocallypse.
+ Evas_Object_Protected_Data *o;
+
+ CRI("The layers of %p are not empty !", eo_e);
+
+ EINA_INLIST_FOREACH(e->layers, lay)
+ EINA_INLIST_FOREACH(lay->objects, o)
+ {
+ CRI("Zombie object [%s] %s@%p still present.",
+ efl_debug_name_get(o->object), efl_class_name_get(o->object), o->object);
+ }
+ }
evas_font_path_clear(eo_e);
@@ -411,10 +505,12 @@ next_zombie:
}
/* Ector surface may require an existing output to finish its job */
- e->engine.func->ector_destroy(_evas_engine_context(e), e->ector);
+ if (e->engine.func)
+ e->engine.func->ector_destroy(_evas_engine_context(e), e->ector);
/* cleanup engine backend */
EINA_LIST_FREE(e->outputs, evo) efl_canvas_output_del(evo);
- e->engine.func->engine_free(e->backend);
+ if (e->engine.func)
+ e->engine.func->engine_free(e->backend);
for (i = 0; i < e->modifiers.mod.count; i++)
free(e->modifiers.mod.list[i]);
@@ -466,6 +562,8 @@ next_zombie:
EAPI Evas_Engine_Info *
evas_engine_info_get(const Evas *obj)
{
+ if (!obj) return NULL;
+
Evas_Public_Data *e = efl_data_scope_get(obj, EVAS_CANVAS_CLASS);
Efl_Canvas_Output *output;
@@ -483,6 +581,8 @@ evas_engine_info_get(const Evas *obj)
EAPI Eina_Bool
evas_engine_info_set(Evas *obj, Evas_Engine_Info *info)
{
+ if (!obj) return EINA_FALSE;
+
Evas_Public_Data *e = efl_data_scope_get(obj, EVAS_CANVAS_CLASS);
Efl_Canvas_Output *output;
@@ -523,7 +623,7 @@ _evas_canvas_coord_world_y_to_screen(const Eo *eo_e EINA_UNUSED, Evas_Public_Dat
}
EOLIAN static Efl_Input_Device *
-_evas_canvas_default_device_get(Eo *eo_e EINA_UNUSED,
+_evas_canvas_default_device_get(const Eo *eo_e EINA_UNUSED,
Evas_Public_Data *e,
Efl_Input_Device_Type klass)
{
@@ -583,7 +683,7 @@ evas_object_image_extension_can_load_fast_get(const char *file)
}
EOLIAN static void
-_evas_canvas_pointer_output_xy_by_device_get(Eo *eo_e EINA_UNUSED,
+_evas_canvas_pointer_output_xy_by_device_get(const Eo *eo_e EINA_UNUSED,
Evas_Public_Data *e,
Efl_Input_Device *dev,
int *x, int *y)
@@ -604,7 +704,7 @@ _evas_canvas_pointer_output_xy_by_device_get(Eo *eo_e EINA_UNUSED,
}
EOLIAN static void
-_evas_canvas_pointer_canvas_xy_by_device_get(Eo *eo_e EINA_UNUSED,
+_evas_canvas_pointer_canvas_xy_by_device_get(const Eo *eo_e EINA_UNUSED,
Evas_Public_Data *e,
Efl_Input_Device *dev,
int *x, int *y)
@@ -624,7 +724,7 @@ _evas_canvas_pointer_canvas_xy_by_device_get(Eo *eo_e EINA_UNUSED,
}
EOLIAN static unsigned int
-_evas_canvas_pointer_button_down_mask_by_device_get(Eo *eo_e EINA_UNUSED,
+_evas_canvas_pointer_button_down_mask_by_device_get(const Eo *eo_e EINA_UNUSED,
Evas_Public_Data *e,
Efl_Input_Device *dev)
{
@@ -634,7 +734,7 @@ _evas_canvas_pointer_button_down_mask_by_device_get(Eo *eo_e EINA_UNUSED,
}
EOLIAN static Eina_Bool
-_evas_canvas_efl_canvas_pointer_pointer_inside_get(Eo *eo_e EINA_UNUSED,
+_evas_canvas_efl_canvas_pointer_pointer_inside_get(const Eo *eo_e EINA_UNUSED,
Evas_Public_Data *e,
Efl_Input_Device *dev)
{
@@ -644,19 +744,19 @@ _evas_canvas_efl_canvas_pointer_pointer_inside_get(Eo *eo_e EINA_UNUSED,
}
EOLIAN static void
-_evas_canvas_pointer_output_xy_get(Eo *eo_e, Evas_Public_Data *e, int *x, int *y)
+_evas_canvas_pointer_output_xy_get(const Eo *eo_e, Evas_Public_Data *e, int *x, int *y)
{
return _evas_canvas_pointer_output_xy_by_device_get(eo_e, e, NULL, x, y);
}
EOLIAN static void
-_evas_canvas_pointer_canvas_xy_get(Eo *eo_e, Evas_Public_Data *e, Evas_Coord *x, Evas_Coord *y)
+_evas_canvas_pointer_canvas_xy_get(const Eo *eo_e, Evas_Public_Data *e, Evas_Coord *x, Evas_Coord *y)
{
return _evas_canvas_pointer_canvas_xy_by_device_get(eo_e, e, NULL, x, y);
}
EOLIAN static unsigned int
-_evas_canvas_pointer_button_down_mask_get(Eo *eo_e, Evas_Public_Data *e)
+_evas_canvas_pointer_button_down_mask_get(const Eo *eo_e, Evas_Public_Data *e)
{
return _evas_canvas_pointer_button_down_mask_by_device_get(eo_e, e, NULL);
}
@@ -668,7 +768,7 @@ _evas_canvas_data_attach_set(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, void *da
}
EOLIAN static void*
-_evas_canvas_data_attach_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
+_evas_canvas_data_attach_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
{
return e->attach_data;
}
@@ -688,7 +788,7 @@ _evas_canvas_focus_inout_dispatch(Eo *eo_e, Efl_Input_Device *seat,
efl_event_callback_call(eo_e,
in ? EFL_EVENT_FOCUS_IN : EFL_EVENT_FOCUS_OUT,
evt);
- efl_del(evt);
+ efl_unref(evt);
}
EOLIAN static void
@@ -722,7 +822,7 @@ _evas_canvas_focus_out(Eo *eo_e, Evas_Public_Data *e)
}
EOLIAN static Eina_Bool
-_evas_canvas_seat_focus_state_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e,
+_evas_canvas_seat_focus_state_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e,
Efl_Input_Device *seat)
{
if (!seat) seat = e->default_seat;
@@ -730,13 +830,13 @@ _evas_canvas_seat_focus_state_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e,
}
EOLIAN static Eina_Bool
-_evas_canvas_focus_state_get(Eo *eo_e, Evas_Public_Data *e)
+_evas_canvas_focus_state_get(const Eo *eo_e, Evas_Public_Data *e)
{
return _evas_canvas_seat_focus_state_get(eo_e, e, NULL);
}
EOLIAN static Eina_Bool
-_evas_canvas_changed_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
+_evas_canvas_changed_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
{
return e->changed;
}
@@ -756,14 +856,13 @@ _evas_canvas_nochange_pop(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
void
_evas_walk(Evas_Public_Data *e)
{
- e->walking_list++;
+ efl_ref(e->evas);
}
void
_evas_unwalk(Evas_Public_Data *e)
{
- e->walking_list--;
- if ((e->walking_list == 0) && (e->delete_me)) evas_free(e->evas);
+ efl_unref(e->evas);
}
EAPI const char *
@@ -837,13 +936,13 @@ _evas_canvas_efl_object_provider_find(const Eo *eo_e,
return (Eo *)eo_e;
else if (klass == EFL_LOOP_CLASS)
return efl_main_loop_get();
- else if (klass == EFL_GESTURE_MANAGER_CLASS)
+ else if (klass == EFL_CANVAS_GESTURE_MANAGER_CLASS)
return e->gesture_manager;
return efl_provider_find(efl_super(eo_e, MY_CLASS), klass);
}
EOLIAN static Efl_Loop *
-_evas_canvas_efl_loop_consumer_loop_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e EINA_UNUSED)
+_evas_canvas_efl_loop_consumer_loop_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e EINA_UNUSED)
{
return efl_main_loop_get();
}
@@ -952,7 +1051,7 @@ _image_data_regenerate(Evas_Object *eo_obj)
CHECK(EFL_CANVAS_IMAGE_INTERNAL_CLASS, Evas_Image_Data, _image_image_data_regenerate(eo_obj, obj, data))
else CHECK(EFL_CANVAS_IMAGE_CLASS, Evas_Image_Data, _image_image_data_regenerate(eo_obj, obj, data))
else CHECK(EFL_CANVAS_SCENE3D_CLASS, Evas_Image_Data, _image_image_data_regenerate(eo_obj, obj, data))
- //else CHECK(EFL_CANVAS_VG_CLASS, Efl_Canvas_Vg_Data,)
+ //else CHECK(EFL_CANVAS_VG_OBJECT_CLASS, Efl_Canvas_Vg_Object_Data,)
//else CHECK(EFL_CANVAS_POLYGON_CLASS, Efl_Canvas_Polygon_Data,)
//else CHECK(EVAS_CANVAS3D_TEXTURE_CLASS, Evas_Canvas3D_Texture_Data,
}
@@ -969,6 +1068,92 @@ _evas_canvas_image_data_regenerate(Eina_List *list)
}
}
+
+EOLIAN void
+_evas_canvas_image_cache_flush(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
+{
+ evas_canvas_async_block(e);
+ evas_render_rendering_wait(e);
+ if (_evas_engine_context(e))
+ e->engine.func->image_cache_flush(_evas_engine_context(e));
+}
+
+EOLIAN void
+_evas_canvas_image_cache_reload(Eo *eo_e, Evas_Public_Data *e)
+{
+ Evas_Layer *layer;
+
+ evas_canvas_async_block(e);
+ evas_image_cache_flush(eo_e);
+ EINA_INLIST_FOREACH(e->layers, layer)
+ {
+ Evas_Object_Protected_Data *obj;
+
+ layer->walking_objects++;
+ EINA_INLIST_FOREACH(layer->objects, obj)
+ {
+ if (efl_isa(obj->object, MY_CLASS))
+ {
+ _evas_image_unload(obj->object, obj, 1);
+ evas_object_inform_call_image_unloaded(obj->object);
+ }
+ }
+ layer->walking_objects--;
+ _evas_layer_flush_removes(layer);
+ }
+ evas_image_cache_flush(eo_e);
+ EINA_INLIST_FOREACH(e->layers, layer)
+ {
+ Evas_Object_Protected_Data *obj;
+
+ layer->walking_objects++;
+ EINA_INLIST_FOREACH(layer->objects, obj)
+ {
+ if (efl_isa(obj->object, MY_CLASS))
+ {
+ Evas_Image_Data *o = efl_data_scope_get(obj->object, MY_CLASS);
+ _evas_image_load(obj->object, obj, o);
+ o->changed = EINA_TRUE;
+ evas_object_change(obj->object, obj);
+ }
+ }
+ layer->walking_objects--;
+ _evas_layer_flush_removes(layer);
+ }
+ evas_image_cache_flush(eo_e);
+}
+
+EOLIAN static void
+_evas_canvas_image_cache_set(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, int size)
+{
+ if (size < 0) size = 0;
+ evas_canvas_async_block(e);
+ evas_render_rendering_wait(e);
+ if (_evas_engine_context(e))
+ e->engine.func->image_cache_set(_evas_engine_context(e), size);
+}
+
+EOLIAN static int
+_evas_canvas_image_cache_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
+{
+ if (_evas_engine_context(e))
+ return e->engine.func->image_cache_get(_evas_engine_context(e));
+ return -1;
+}
+
+EOLIAN static Eina_Bool
+_evas_canvas_efl_canvas_scene_image_max_size_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Eina_Size2D *max)
+{
+ int w = 0, h = 0;
+
+ if (max) *max = EINA_SIZE2D(0xffff, 0xffff);
+ if (!e->engine.func->image_max_size_get) return EINA_FALSE;
+ if (!max) return EINA_TRUE;
+ e->engine.func->image_max_size_get(_evas_engine_context(e), &w, &h);
+ *max = EINA_SIZE2D(w, h);
+ return EINA_TRUE;
+}
+
/* Legacy deprecated functions */
EAPI void
@@ -1065,20 +1250,20 @@ evas_output_method_set(Evas *eo_e, int render_method)
return;
}
- e->default_seat = evas_device_add_full(eo_e, "default", "The default seat",
- NULL, NULL, EVAS_DEVICE_CLASS_SEAT,
- EVAS_DEVICE_SUBCLASS_NONE);
+ e->default_seat = efl_ref(evas_device_add_full(eo_e, "default", "The default seat",
+ NULL, NULL, EVAS_DEVICE_CLASS_SEAT,
+ EVAS_DEVICE_SUBCLASS_NONE));
evas_device_seat_id_set(e->default_seat, 1);
- e->default_mouse = evas_device_add_full(eo_e, "Mouse",
- "The default mouse",
- e->default_seat, NULL,
- EVAS_DEVICE_CLASS_MOUSE,
- EVAS_DEVICE_SUBCLASS_NONE);
- e->default_keyboard = evas_device_add_full(eo_e, "Keyboard",
- "The default keyboard",
- e->default_seat, NULL,
- EVAS_DEVICE_CLASS_KEYBOARD,
- EVAS_DEVICE_SUBCLASS_NONE);
+ e->default_mouse = efl_ref(evas_device_add_full(eo_e, "Mouse",
+ "The default mouse",
+ e->default_seat, NULL,
+ EVAS_DEVICE_CLASS_MOUSE,
+ EVAS_DEVICE_SUBCLASS_NONE));
+ e->default_keyboard = efl_ref(evas_device_add_full(eo_e, "Keyboard",
+ "The default keyboard",
+ e->default_seat, NULL,
+ EVAS_DEVICE_CLASS_KEYBOARD,
+ EVAS_DEVICE_SUBCLASS_NONE));
}
EAPI int
@@ -1247,25 +1432,24 @@ _evas_pointer_data_remove(Evas_Public_Data *edata, Efl_Input_Device *pointer)
{
Evas_Pointer_Data *pdata;
Evas_Pointer_Seat *pseat;
- Eo *seat;
+ Evas_Pointer_Seat *hit = NULL;
- seat = efl_input_device_seat_get(pointer);
EINA_INLIST_FOREACH(edata->seats, pseat)
{
- if (pseat->seat != seat) continue;
EINA_INLIST_FOREACH(pseat->pointers, pdata)
if (pdata->pointer == pointer)
{
pseat->pointers = eina_inlist_remove(pseat->pointers, EINA_INLIST_GET(pdata));
free(pdata);
+ hit = pseat;
break;
}
- if (pseat->pointers) break;
- eina_list_free(pseat->object.in);
- edata->seats = eina_inlist_remove(edata->seats, EINA_INLIST_GET(pseat));
- free(pseat);
- break;
}
+ EINA_SAFETY_ON_NULL_RETURN(hit);
+ if (hit->pointers) return;
+ eina_list_free(hit->object.in);
+ edata->seats = eina_inlist_remove(edata->seats, EINA_INLIST_GET(hit));
+ free(hit);
}
Eina_List *
@@ -1288,6 +1472,299 @@ _evas_pointer_list_in_rect_get(Evas_Public_Data *edata, Evas_Object *obj,
return list;
}
+static Eina_Inlist *
+get_layer_objects(Evas_Layer *l)
+{
+ if ((!l) || (!l->objects)) return NULL;
+ return (EINA_INLIST_GET(l->objects));
+}
+
+typedef struct _Efl_Canvas_Iterator
+{
+ Eina_Iterator iterator;
+ Eina_List *list;
+ Eina_Iterator *real_iterator;
+ Eo *object;
+} Efl_Canvas_Iterator;
+
+/* this iterator is the same as efl_ui_box */
+static Eina_Bool
+_efl_canvas_iterator_next(Efl_Canvas_Iterator *it, void **data)
+{
+ Efl_Gfx_Entity *sub;
+
+ if (!it->object) return EINA_FALSE;
+ if (!eina_iterator_next(it->real_iterator, (void **) &sub))
+ return EINA_FALSE;
+
+ if (data) *data = sub;
+ return EINA_TRUE;
+}
+
+static Eo *
+_efl_canvas_iterator_get_container(Efl_Canvas_Iterator *it)
+{
+ return it->object;
+}
+
+static void
+_efl_canvas_iterator_free(Efl_Canvas_Iterator *it)
+{
+ eina_iterator_free(it->real_iterator);
+ efl_wref_del(it->object, &it->object);
+ eina_list_free(it->list);
+ free(it);
+}
+
+EAPI Eina_Iterator *
+efl_canvas_iterator_create(Eo *obj, Eina_Iterator *real_iterator, Eina_List *list)
+{
+ Efl_Canvas_Iterator *it;
+
+ it = calloc(1, sizeof(*it));
+ if (!it) return NULL;
+
+ EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
+
+ it->list = list;
+ it->real_iterator = real_iterator;
+ it->iterator.version = EINA_ITERATOR_VERSION;
+ it->iterator.next = FUNC_ITERATOR_NEXT(_efl_canvas_iterator_next);
+ it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_efl_canvas_iterator_get_container);
+ it->iterator.free = FUNC_ITERATOR_FREE(_efl_canvas_iterator_free);
+ efl_wref_add(obj, &it->object);
+
+ return &it->iterator;
+}
+
+EOLIAN static Evas_Object*
+_evas_canvas_efl_canvas_scene_object_top_at_xy_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Eina_Position2D pos, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
+{
+ Evas_Layer *lay;
+ int xx, yy;
+
+ xx = pos.x;
+ yy = pos.y;
+//// xx = evas_coord_world_x_to_screen(eo_e, x);
+//// yy = evas_coord_world_y_to_screen(eo_e, y);
+ EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
+ {
+ Evas_Object *eo_obj;
+ Evas_Object_Protected_Data *obj;
+
+ EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
+ {
+ eo_obj = obj->object;
+ if (obj->delete_me) continue;
+ if ((!include_pass_events_objects) &&
+ (evas_event_passes_through(eo_obj, obj))) continue;
+ if (evas_object_is_source_invisible(eo_obj, obj)) continue;
+ if ((!include_hidden_objects) && (!obj->cur->visible)) continue;
+ evas_object_clip_recalc(obj);
+ if ((evas_object_is_in_output_rect(eo_obj, obj, xx, yy, 1, 1)) &&
+ (!obj->clip.clipees) &&
+ RECTS_INTERSECT(xx, yy, 1, 1,
+ obj->cur->geometry.x, obj->cur->geometry.y,
+ obj->cur->geometry.w, obj->cur->geometry.h))
+ return eo_obj;
+ }
+ }
+ return NULL;
+}
+
+EAPI Evas_Object*
+evas_object_top_at_xy_get(Eo *eo_e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
+{
+ Eina_Position2D pos = {x, y};
+ return efl_canvas_scene_object_top_at_xy_get(eo_e, pos, include_pass_events_objects, include_hidden_objects);
+}
+
+EAPI Evas_Object *
+evas_object_top_at_pointer_get(const Evas *eo_e)
+{
+ Evas_Public_Data *e = efl_isa(eo_e, EVAS_CANVAS_CLASS) ?
+ efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS) : NULL;
+ if (!e) return NULL;
+
+ Evas_Pointer_Data *pdata = _evas_pointer_data_by_device_get(e, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(pdata, NULL);
+ return efl_canvas_scene_object_top_at_xy_get((Eo *)eo_e, EINA_POSITION2D(pdata->seat->x, pdata->seat->y), EINA_TRUE, EINA_TRUE);
+}
+
+EOLIAN Evas_Object*
+_evas_canvas_efl_canvas_scene_object_top_in_rectangle_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Eina_Rect rect, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
+{
+ Evas_Layer *lay;
+ int xx, yy, ww, hh;
+
+ xx = rect.x;
+ yy = rect.y;
+ ww = rect.w;
+ hh = rect.h;
+//// xx = evas_coord_world_x_to_screen(eo_e, x);
+//// yy = evas_coord_world_y_to_screen(eo_e, y);
+//// ww = evas_coord_world_x_to_screen(eo_e, w);
+//// hh = evas_coord_world_y_to_screen(eo_e, h);
+ if (ww < 1) ww = 1;
+ if (hh < 1) hh = 1;
+ EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
+ {
+ Evas_Object *eo_obj;
+ Evas_Object_Protected_Data *obj;
+
+ EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
+ {
+ eo_obj = obj->object;
+ if (obj->delete_me) continue;
+ if ((!include_pass_events_objects) &&
+ (evas_event_passes_through(eo_obj, obj))) continue;
+ if (evas_object_is_source_invisible(eo_obj, obj)) continue;
+ if ((!include_hidden_objects) && (!obj->cur->visible)) continue;
+ evas_object_clip_recalc(obj);
+ if ((evas_object_is_in_output_rect(eo_obj, obj, xx, yy, ww, hh)) &&
+ (!obj->clip.clipees) &&
+ RECTS_INTERSECT(xx, yy, ww, hh,
+ obj->cur->geometry.x, obj->cur->geometry.y,
+ obj->cur->geometry.w, obj->cur->geometry.h)) return eo_obj;
+ }
+ }
+ return NULL;
+}
+
+EAPI Evas_Object *
+evas_object_top_in_rectangle_get(const Eo *obj, int x, int y, int w, int h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
+{
+ return efl_canvas_scene_object_top_in_rectangle_get(obj, EINA_RECT(x, y, w, h), include_pass_events_objects, include_hidden_objects);
+}
+
+static Eina_List *
+_efl_canvas_evas_canvas_objects_at_xy_get_helper(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, int x, int y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
+{
+ Eina_List *in = NULL;
+ Evas_Layer *lay;
+ int xx, yy;
+
+ xx = x;
+ yy = y;
+//// xx = evas_coord_world_x_to_screen(eo_e, x);
+//// yy = evas_coord_world_y_to_screen(eo_e, y);
+ EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
+ {
+ Evas_Object *eo_obj;
+ Evas_Object_Protected_Data *obj;
+
+ EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
+ {
+ eo_obj = obj->object;
+ // FIXME - Daniel: we don't know yet how to handle the next line
+ if (obj->delete_me) continue;
+ if ((!include_pass_events_objects) &&
+ (evas_event_passes_through(eo_obj, obj))) continue;
+ if (evas_object_is_source_invisible(eo_obj, obj)) continue;
+ if ((!include_hidden_objects) && (!obj->cur->visible)) continue;
+ evas_object_clip_recalc(obj);
+ if ((evas_object_is_in_output_rect(eo_obj, obj, xx, yy, 1, 1)) &&
+ (!obj->clip.clipees))
+ {
+ // evas_object_is_in_output_rect is based on the clip which
+ // may be larger than the geometry (bounding box)
+ if (!RECTS_INTERSECT(xx, yy, 1, 1,
+ obj->cur->geometry.x,
+ obj->cur->geometry.y,
+ obj->cur->geometry.w,
+ obj->cur->geometry.h))
+ continue;
+ in = eina_list_prepend(in, eo_obj);
+ }
+ }
+ }
+ return in;
+}
+
+EOLIAN static Eina_Iterator *
+_evas_canvas_efl_canvas_scene_objects_at_xy_get(Eo *eo_e, Evas_Public_Data *e, Eina_Position2D pos, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
+{
+ Eina_List *l = _efl_canvas_evas_canvas_objects_at_xy_get_helper(eo_e, e, pos.x, pos.y, include_pass_events_objects, include_hidden_objects);
+ if (l) return efl_canvas_iterator_create(eo_e, eina_list_iterator_new(l), l);
+ return NULL;
+}
+
+/**
+ * Retrieves the objects in the given rectangle region
+ * @param eo_e The given evas object.
+ * @param x The horizontal coordinate.
+ * @param y The vertical coordinate.
+ * @param w The width size.
+ * @param h The height size.
+ * @param include_pass_events_objects Boolean Flag to include or not pass events objects
+ * @param include_hidden_objects Boolean Flag to include or not hidden objects
+ * @return The list of evas object in the rectangle region.
+ *
+ */
+static Eina_List*
+_efl_canvas_objects_in_rectangle_get_helper(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
+{
+ Eina_List *in = NULL;
+ Evas_Layer *lay;
+ int xx, yy, ww, hh;
+
+ xx = x;
+ yy = y;
+ ww = w;
+ hh = h;
+//// xx = evas_coord_world_x_to_screen(eo_e, x);
+//// yy = evas_coord_world_y_to_screen(eo_e, y);
+//// ww = evas_coord_world_x_to_screen(eo_e, w);
+//// hh = evas_coord_world_y_to_screen(eo_e, h);
+ if (ww < 1) ww = 1;
+ if (hh < 1) hh = 1;
+ EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
+ {
+ Evas_Object *eo_obj;
+ Evas_Object_Protected_Data *obj;
+
+ EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
+ {
+ eo_obj = obj->object;
+ // FIXME - Daniel: we don't know yet how to handle the next line
+ if (obj->delete_me) continue;
+ if ((!include_pass_events_objects) &&
+ (evas_event_passes_through(eo_obj, obj))) continue;
+ if (evas_object_is_source_invisible(eo_obj, obj)) continue;
+ if ((!include_hidden_objects) && (!obj->cur->visible)) continue;
+ evas_object_clip_recalc(obj);
+ if ((evas_object_is_in_output_rect(eo_obj, obj, xx, yy, ww, hh)) &&
+ (!obj->clip.clipees))
+ {
+ if (!RECTS_INTERSECT(xx, yy, ww, hh,
+ obj->cur->geometry.x,
+ obj->cur->geometry.y,
+ obj->cur->geometry.w,
+ obj->cur->geometry.h))
+ continue;
+ in = eina_list_prepend(in, eo_obj);
+ }
+ }
+ }
+ return in;
+}
+
+
+EOLIAN static Eina_Iterator*
+_evas_canvas_efl_canvas_scene_objects_in_rectangle_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Eina_Rect rect, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
+{
+ Eina_List *l = _efl_canvas_objects_in_rectangle_get_helper(eo_e, e, rect.x, rect.y, rect.w, rect.h, include_pass_events_objects, include_hidden_objects);
+ if (!l) return NULL;
+ return efl_canvas_iterator_create(eo_e, eina_list_iterator_new(l), l);
+}
+
+EAPI Eina_List *
+evas_objects_in_rectangle_get(const Evas_Canvas *eo_e, int x, int y, int w, int h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
+{
+ EVAS_LEGACY_API(eo_e, e, NULL);
+ return _efl_canvas_objects_in_rectangle_get_helper(eo_e, e, x, y, w, h, include_pass_events_objects, include_hidden_objects);
+}
+
/* font related api */
EOLIAN static void
@@ -1343,7 +1820,7 @@ _evas_canvas_font_cache_set(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, int size)
}
EOLIAN static int
-_evas_canvas_font_cache_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
+_evas_canvas_font_cache_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
{
if (_evas_engine_context(e))
return e->engine.func->font_cache_get(_evas_engine_context(e));
@@ -1421,6 +1898,35 @@ evas_font_available_list_free(Evas *eo_e, Eina_List *available)
}
+EOLIAN static void
+_evas_canvas_efl_canvas_scene_smart_objects_calculate(Eo *eo_e, Evas_Public_Data *o EINA_UNUSED)
+{
+ evas_call_smarts_calculate(eo_e);
+}
+
+EAPI void
+evas_smart_objects_calculate(Eo *eo_e)
+{
+ evas_call_smarts_calculate(eo_e);
+}
+
+EOLIAN Eina_Bool
+_evas_canvas_efl_canvas_scene_smart_objects_calculating_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
+{
+ return !!e->in_smart_calc;
+}
+
+EAPI Eina_Bool
+evas_smart_objects_calculating_get(const Eo *obj)
+{
+ return efl_canvas_scene_smart_objects_calculating_get(obj);
+}
+
+EOLIAN int
+_evas_canvas_smart_objects_calculate_count_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
+{
+ return e->smart_calc_count;
+}
/* Legacy EAPI */
EAPI Eina_Bool
@@ -1435,6 +1941,11 @@ evas_pointer_inside_by_device_get(const Evas *obj, Eo *dev)
return efl_canvas_pointer_inside_get(obj, dev);
}
+EAPI Eina_List*
+evas_objects_at_xy_get(Eo *eo_e, int x, int y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
+{
+ return _efl_canvas_evas_canvas_objects_at_xy_get_helper(eo_e, efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS), x, y, include_pass_events_objects, include_hidden_objects);
+}
/* Internal EO APIs */
EWAPI const Efl_Event_Description _EVAS_CANVAS_EVENT_RENDER_FLUSH_PRE =
@@ -1446,4 +1957,5 @@ EWAPI const Efl_Event_Description _EVAS_CANVAS_EVENT_AXIS_UPDATE =
EWAPI const Efl_Event_Description _EVAS_CANVAS_EVENT_VIEWPORT_RESIZE =
EFL_EVENT_DESCRIPTION("viewport,resize");
+#include "evas_stack.x"
#include "canvas/evas_canvas.eo.c"
diff --git a/src/lib/evas/canvas/evas_map.c b/src/lib/evas/canvas/evas_map.c
index e05ad97323..e633ccd883 100644
--- a/src/lib/evas/canvas/evas_map.c
+++ b/src/lib/evas/canvas/evas_map.c
@@ -848,6 +848,7 @@ evas_map_point_color_get(const Evas_Map *m, int idx, int *r, int *g, int *b, int
if (g) *g = p->g;
if (b) *b = p->b;
if (a) *a = p->a;
+ return;
error:
if (r) *r = 255;
diff --git a/src/lib/evas/canvas/evas_object_box.c b/src/lib/evas/canvas/evas_object_box.c
index bbe66b23e7..53e945118d 100644
--- a/src/lib/evas/canvas/evas_object_box.c
+++ b/src/lib/evas/canvas/evas_object_box.c
@@ -48,7 +48,7 @@ static void _sizing_eval(Evas_Object *obj);
EVAS_OBJECT_BOX_DATA_GET(o, ptr); \
if (!ptr) \
{ \
- CRI("no widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
fflush(stderr); \
return; \
@@ -58,7 +58,7 @@ if (!ptr) \
EVAS_OBJECT_BOX_DATA_GET(o, ptr); \
if (!ptr) \
{ \
- CRI("no widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
fflush(stderr); \
return val; \
@@ -121,7 +121,7 @@ _on_child_resize(void *data, const Efl_Event *event EINA_UNUSED)
}
static void
-_on_child_del(void *data, const Efl_Event *event)
+_on_child_invalidate(void *data, const Efl_Event *event)
{
Evas_Object *box = data;
@@ -165,9 +165,9 @@ _evas_object_box_option_new(Evas_Object *o, Evas_Object_Box_Data *priv EINA_UNUS
}
EFL_CALLBACKS_ARRAY_DEFINE(evas_object_box_callbacks,
- { EFL_GFX_EVENT_RESIZE, _on_child_resize },
- { EFL_EVENT_DEL, _on_child_del },
- { EFL_GFX_EVENT_CHANGE_SIZE_HINTS, _on_child_hints_changed }
+ { EFL_GFX_ENTITY_EVENT_RESIZE, _on_child_resize },
+ { EFL_EVENT_INVALIDATE, _on_child_invalidate },
+ { EFL_GFX_ENTITY_EVENT_CHANGE_SIZE_HINTS, _on_child_hints_changed }
);
static void
@@ -432,22 +432,22 @@ _evas_box_efl_canvas_group_group_del(Eo *o, Evas_Object_Box_Data *priv)
}
EOLIAN static void
-_evas_box_efl_gfx_size_set(Eo *o, Evas_Object_Box_Data *_pd EINA_UNUSED, Eina_Size2D sz)
+_evas_box_efl_gfx_entity_size_set(Eo *o, Evas_Object_Box_Data *_pd EINA_UNUSED, Eina_Size2D sz)
{
if (_evas_object_intercept_call(o, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
- efl_gfx_size_set(efl_super(o, MY_CLASS), sz);
+ efl_gfx_entity_size_set(efl_super(o, MY_CLASS), sz);
evas_object_smart_changed(o);
}
EOLIAN static void
-_evas_box_efl_gfx_position_set(Eo *o, Evas_Object_Box_Data *_pd EINA_UNUSED, Eina_Position2D pos)
+_evas_box_efl_gfx_entity_position_set(Eo *o, Evas_Object_Box_Data *_pd EINA_UNUSED, Eina_Position2D pos)
{
if (_evas_object_intercept_call(o, EVAS_OBJECT_INTERCEPT_CB_MOVE , 0, pos.x, pos.y))
return;
- efl_gfx_position_set(efl_super(o, MY_CLASS), pos);
+ efl_gfx_entity_position_set(efl_super(o, MY_CLASS), pos);
evas_object_smart_changed(o);
}
@@ -478,7 +478,7 @@ evas_object_box_add(Evas *evas)
MAGIC_CHECK(evas, Evas, MAGIC_EVAS);
return NULL;
MAGIC_CHECK_END();
- return efl_add(MY_CLASS, evas, efl_canvas_object_legacy_ctor(efl_added));
+ return efl_add(MY_CLASS, evas_find(evas), efl_canvas_object_legacy_ctor(efl_added));
}
EOLIAN static Eo *
@@ -1678,7 +1678,7 @@ _evas_box_align_set(Eo *o, Evas_Object_Box_Data *priv, double horizontal, double
}
EOLIAN static void
-_evas_box_align_get(Eo *o EINA_UNUSED, Evas_Object_Box_Data *priv, double *horizontal, double *vertical)
+_evas_box_align_get(const Eo *o EINA_UNUSED, Evas_Object_Box_Data *priv, double *horizontal, double *vertical)
{
if (priv)
{
@@ -1703,7 +1703,7 @@ _evas_box_padding_set(Eo *o, Evas_Object_Box_Data *priv, Evas_Coord horizontal,
}
EOLIAN static void
-_evas_box_padding_get(Eo *o EINA_UNUSED, Evas_Object_Box_Data *priv, Evas_Coord *horizontal, Evas_Coord *vertical)
+_evas_box_padding_get(const Eo *o EINA_UNUSED, Evas_Object_Box_Data *priv, Evas_Coord *horizontal, Evas_Coord *vertical)
{
if (priv)
{
diff --git a/src/lib/evas/canvas/evas_object_grid.c b/src/lib/evas/canvas/evas_object_grid.c
index 8aab7cffd4..b954bf2dce 100644
--- a/src/lib/evas/canvas/evas_object_grid.c
+++ b/src/lib/evas/canvas/evas_object_grid.c
@@ -49,7 +49,7 @@ struct _Evas_Object_Grid_Accessor
EVAS_OBJECT_GRID_DATA_GET(o, ptr); \
if (!ptr) \
{ \
- CRI("no widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -58,7 +58,7 @@ struct _Evas_Object_Grid_Accessor
EVAS_OBJECT_GRID_DATA_GET(o, ptr); \
if (!ptr) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
@@ -276,7 +276,7 @@ evas_object_grid_add(Evas *evas)
MAGIC_CHECK(evas, Evas, MAGIC_EVAS);
return NULL;
MAGIC_CHECK_END();
- return efl_add(MY_CLASS, evas, efl_canvas_object_legacy_ctor(efl_added));
+ return efl_add(MY_CLASS, evas_find(evas), efl_canvas_object_legacy_ctor(efl_added));
}
EOLIAN static Eo *
@@ -302,7 +302,7 @@ _evas_grid_add_to(Eo *parent, Evas_Grid_Data *_pd EINA_UNUSED)
}
EOLIAN static void
-_evas_grid_size_set(Eo *o, Evas_Grid_Data *priv, int w, int h)
+_evas_grid_grid_size_set(Eo *o, Evas_Grid_Data *priv, int w, int h)
{
if ((priv->size.w == w) && (priv->size.h == h)) return;
priv->size.w = w;
@@ -311,7 +311,7 @@ _evas_grid_size_set(Eo *o, Evas_Grid_Data *priv, int w, int h)
}
EOLIAN static void
-_evas_grid_size_get(Eo *o EINA_UNUSED, Evas_Grid_Data *priv, int *w, int *h)
+_evas_grid_grid_size_get(const Eo *o EINA_UNUSED, Evas_Grid_Data *priv, int *w, int *h)
{
if (w) *w = priv->size.w;
if (h) *h = priv->size.h;
@@ -468,7 +468,7 @@ _evas_grid_accessor_new(const Eo *o, Evas_Grid_Data *priv)
}
EOLIAN static Eina_List*
-_evas_grid_children_get(Eo *o EINA_UNUSED, Evas_Grid_Data *priv)
+_evas_grid_children_get(const Eo *o EINA_UNUSED, Evas_Grid_Data *priv)
{
Eina_List *new_list = NULL, *l;
Evas_Object_Grid_Option *opt;
@@ -480,13 +480,13 @@ _evas_grid_children_get(Eo *o EINA_UNUSED, Evas_Grid_Data *priv)
}
EOLIAN static Eina_Bool
-_evas_grid_mirrored_get(Eo *o EINA_UNUSED, Evas_Grid_Data *priv)
+_evas_grid_efl_ui_base_mirrored_get(const Eo *o EINA_UNUSED, Evas_Grid_Data *priv)
{
return priv->is_mirrored;
}
EOLIAN static void
-_evas_grid_mirrored_set(Eo *o EINA_UNUSED, Evas_Grid_Data *priv, Eina_Bool mirrored)
+_evas_grid_efl_ui_base_mirrored_set(Eo *o EINA_UNUSED, Evas_Grid_Data *priv, Eina_Bool mirrored)
{
mirrored = !!mirrored;
if (priv->is_mirrored != mirrored)
@@ -496,4 +496,16 @@ _evas_grid_mirrored_set(Eo *o EINA_UNUSED, Evas_Grid_Data *priv, Eina_Bool mirro
}
}
+EAPI void
+evas_object_grid_mirrored_set(Evas_Grid *obj, Eina_Bool mirrored)
+{
+ efl_ui_mirrored_set(obj, mirrored);
+}
+
+EAPI Eina_Bool
+evas_object_grid_mirrored_get(const Evas_Grid *obj)
+{
+ return efl_ui_mirrored_get(obj);
+}
+
#include "canvas/evas_grid.eo.c"
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index 02be7f017b..2d217e3ad7 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -465,13 +465,13 @@ _efl_canvas_image_internal_efl_orientation_orientation_set(Eo *obj, Evas_Image_D
}
EOLIAN static Efl_Orient
-_efl_canvas_image_internal_efl_orientation_orientation_get(Eo *obj EINA_UNUSED, Evas_Image_Data *o)
+_efl_canvas_image_internal_efl_orientation_orientation_get(const Eo *obj EINA_UNUSED, Evas_Image_Data *o)
{
return o->orient_value;
}
EOLIAN static void
-_efl_canvas_image_internal_efl_flipable_flip_set(Eo *obj, Evas_Image_Data *o, Efl_Flip flip)
+_efl_canvas_image_internal_efl_orientation_flip_set(Eo *obj, Evas_Image_Data *o, Efl_Flip flip)
{
Evas_Image_Orient orient;
@@ -482,7 +482,7 @@ _efl_canvas_image_internal_efl_flipable_flip_set(Eo *obj, Evas_Image_Data *o, Ef
}
EOLIAN static Efl_Flip
-_efl_canvas_image_internal_efl_flipable_flip_get(Eo *obj EINA_UNUSED, Evas_Image_Data *o)
+_efl_canvas_image_internal_efl_orientation_flip_get(const Eo *obj EINA_UNUSED, Evas_Image_Data *o)
{
return o->flip_value;
}
@@ -504,7 +504,7 @@ _efl_canvas_image_internal_efl_object_dbg_info_get(Eo *eo_obj, Evas_Image_Data *
}
EOLIAN static void
-_efl_canvas_image_internal_efl_image_border_set(Eo *eo_obj, Evas_Image_Data *o, int l, int r, int t, int b)
+_efl_canvas_image_internal_efl_gfx_image_border_set(Eo *eo_obj, Evas_Image_Data *o, int l, int r, int t, int b)
{
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
@@ -531,7 +531,7 @@ _efl_canvas_image_internal_efl_image_border_set(Eo *eo_obj, Evas_Image_Data *o,
}
EOLIAN static void
-_efl_canvas_image_internal_efl_image_border_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o, int *l, int *r, int *t, int *b)
+_efl_canvas_image_internal_efl_gfx_image_border_get(const Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o, int *l, int *r, int *t, int *b)
{
if (l) *l = o->cur->border.l;
if (r) *r = o->cur->border.r;
@@ -540,7 +540,7 @@ _efl_canvas_image_internal_efl_image_border_get(Eo *eo_obj EINA_UNUSED, Evas_Ima
}
EOLIAN static void
-_efl_canvas_image_internal_efl_image_border_center_fill_set(Eo *eo_obj, Evas_Image_Data *o, Efl_Gfx_Border_Fill_Mode _fill)
+_efl_canvas_image_internal_efl_gfx_image_border_center_fill_set(Eo *eo_obj, Evas_Image_Data *o, Efl_Gfx_Border_Fill_Mode _fill)
{
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
Evas_Border_Fill_Mode fill = (Evas_Border_Fill_Mode)_fill;
@@ -556,7 +556,7 @@ _efl_canvas_image_internal_efl_image_border_center_fill_set(Eo *eo_obj, Evas_Ima
}
EOLIAN static Efl_Gfx_Border_Fill_Mode
-_efl_canvas_image_internal_efl_image_border_center_fill_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
+_efl_canvas_image_internal_efl_gfx_image_border_center_fill_get(const Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
{
return (Efl_Gfx_Border_Fill_Mode)o->cur->border.fill;
}
@@ -578,7 +578,7 @@ _efl_canvas_image_internal_efl_gfx_fill_fill_auto_set(Eo *eo_obj, Evas_Image_Dat
{
Eina_Size2D sz;
- sz = efl_gfx_size_get(eo_obj);
+ sz = efl_gfx_entity_size_get(eo_obj);
_evas_image_fill_set(eo_obj, o, 0, 0, sz.w, sz.h);
evas_object_event_callback_add(eo_obj, EVAS_CALLBACK_RESIZE,
@@ -588,13 +588,13 @@ _efl_canvas_image_internal_efl_gfx_fill_fill_auto_set(Eo *eo_obj, Evas_Image_Dat
}
EOLIAN static Eina_Bool
-_efl_canvas_image_internal_efl_gfx_fill_fill_auto_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
+_efl_canvas_image_internal_efl_gfx_fill_fill_auto_get(const Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
{
return o->filled;
}
EOLIAN static void
-_efl_canvas_image_internal_efl_image_border_scale_set(Eo *eo_obj, Evas_Image_Data *o, double scale)
+_efl_canvas_image_internal_efl_gfx_image_border_scale_set(Eo *eo_obj, Evas_Image_Data *o, double scale)
{
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
@@ -609,7 +609,7 @@ _efl_canvas_image_internal_efl_image_border_scale_set(Eo *eo_obj, Evas_Image_Dat
}
EOLIAN static double
-_efl_canvas_image_internal_efl_image_border_scale_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
+_efl_canvas_image_internal_efl_gfx_image_border_scale_get(const Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
{
return o->cur->border.scale;
}
@@ -654,19 +654,19 @@ _efl_canvas_image_internal_efl_gfx_fill_fill_set(Eo *eo_obj, Evas_Image_Data *o,
}
EOLIAN static Eina_Rect
-_efl_canvas_image_internal_efl_gfx_fill_fill_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
+_efl_canvas_image_internal_efl_gfx_fill_fill_get(const Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
{
return (Eina_Rect) o->cur->fill;
}
EOLIAN static Eina_Size2D
-_efl_canvas_image_internal_efl_image_image_size_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
+_efl_canvas_image_internal_efl_gfx_image_image_size_get(const Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
{
return EINA_SIZE2D(o->file_size.w, o->file_size.h);
}
EOLIAN static Eina_Size2D
-_efl_canvas_image_internal_efl_gfx_view_view_size_get(Eo *eo_obj, Evas_Image_Data *o)
+_efl_canvas_image_internal_efl_gfx_view_view_size_get(const Eo *eo_obj, Evas_Image_Data *o)
{
int uvw, uvh;
Evas_Object_Protected_Data *source = NULL;
@@ -821,13 +821,13 @@ _efl_canvas_image_internal_efl_gfx_buffer_alpha_set(Eo *eo_obj, Evas_Image_Data
}
EOLIAN static Eina_Bool
-_efl_canvas_image_internal_efl_gfx_buffer_alpha_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
+_efl_canvas_image_internal_efl_gfx_buffer_alpha_get(const Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
{
return o->cur->has_alpha;
}
EOLIAN static void
-_efl_canvas_image_internal_efl_image_smooth_scale_set(Eo *eo_obj, Evas_Image_Data *o, Eina_Bool smooth_scale)
+_efl_canvas_image_internal_efl_gfx_image_smooth_scale_set(Eo *eo_obj, Evas_Image_Data *o, Eina_Bool smooth_scale)
{
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
@@ -844,13 +844,13 @@ _efl_canvas_image_internal_efl_image_smooth_scale_set(Eo *eo_obj, Evas_Image_Dat
}
EOLIAN static Eina_Bool
-_efl_canvas_image_internal_efl_image_smooth_scale_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
+_efl_canvas_image_internal_efl_gfx_image_smooth_scale_get(const Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
{
return o->cur->smooth_scale;
}
EOLIAN static double
-_efl_canvas_image_internal_efl_image_ratio_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
+_efl_canvas_image_internal_efl_gfx_image_ratio_get(const Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
{
if (!o->cur->image.h) return 1.0;
return (double)o->cur->image.w / (double)o->cur->image.h;
@@ -938,16 +938,6 @@ _efl_canvas_image_internal_efl_file_save(const Eo *eo_obj, Evas_Image_Data *o, c
data = (DATA32 *)sl.mem;
}
- if ((o->cur->orient == EVAS_IMAGE_ORIENT_90) ||
- (o->cur->orient == EVAS_IMAGE_ORIENT_270) ||
- (o->cur->orient == EVAS_IMAGE_FLIP_TRANSPOSE) ||
- (o->cur->orient == EVAS_IMAGE_FLIP_TRANSVERSE))
- {
- int tmp = imagew;
- imagew = imageh;
- imageh = tmp;
- }
-
if (!data)
{
int stride;
@@ -982,12 +972,13 @@ _efl_canvas_image_internal_efl_file_save(const Eo *eo_obj, Evas_Image_Data *o, c
return ok;
no_pixels:
+ free(encoding);
ERR("Could not get image pixels for saving.");
return EINA_FALSE;
}
EOLIAN static Efl_Gfx_Colorspace
-_efl_canvas_image_internal_efl_gfx_buffer_colorspace_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
+_efl_canvas_image_internal_efl_gfx_buffer_colorspace_get(const Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
{
return (Efl_Gfx_Colorspace)o->cur->cspace;
}
@@ -1050,7 +1041,7 @@ _evas_image_native_surface_get(const Evas_Object *eo_obj)
}
EOLIAN static void
-_efl_canvas_image_internal_efl_image_scale_hint_set(Eo *eo_obj, Evas_Image_Data *o, Efl_Image_Scale_Hint hint)
+_efl_canvas_image_internal_efl_gfx_image_scale_hint_set(Eo *eo_obj, Evas_Image_Data *o, Efl_Gfx_Image_Scale_Hint hint)
{
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
evas_object_async_block(obj);
@@ -1076,14 +1067,14 @@ _efl_canvas_image_internal_efl_image_scale_hint_set(Eo *eo_obj, Evas_Image_Data
}
}
-EOLIAN static Efl_Image_Scale_Hint
-_efl_canvas_image_internal_efl_image_scale_hint_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
+EOLIAN static Efl_Gfx_Image_Scale_Hint
+_efl_canvas_image_internal_efl_gfx_image_scale_hint_get(const Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
{
return o->scale_hint;
}
EOLIAN static void
-_efl_canvas_image_internal_efl_image_content_hint_set(Eo *eo_obj, Evas_Image_Data *o, Efl_Image_Content_Hint hint)
+_efl_canvas_image_internal_efl_gfx_image_content_hint_set(Eo *eo_obj, Evas_Image_Data *o, Efl_Gfx_Image_Content_Hint hint)
{
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
evas_object_async_block(obj);
@@ -1109,97 +1100,12 @@ _efl_canvas_image_internal_efl_image_content_hint_set(Eo *eo_obj, Evas_Image_Dat
}
}
-EOLIAN static Efl_Image_Content_Hint
-_efl_canvas_image_internal_efl_image_content_hint_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
+EOLIAN static Efl_Gfx_Image_Content_Hint
+_efl_canvas_image_internal_efl_gfx_image_content_hint_get(const Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
{
return o->content_hint;
}
-EOLIAN void
-_evas_canvas_image_cache_flush(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
-{
- evas_canvas_async_block(e);
- evas_render_rendering_wait(e);
- if (_evas_engine_context(e))
- e->engine.func->image_cache_flush(_evas_engine_context(e));
-}
-
-EOLIAN void
-_evas_canvas_image_cache_reload(Eo *eo_e, Evas_Public_Data *e)
-{
- Evas_Layer *layer;
-
- evas_canvas_async_block(e);
- evas_image_cache_flush(eo_e);
- EINA_INLIST_FOREACH(e->layers, layer)
- {
- Evas_Object_Protected_Data *obj;
-
- layer->walking_objects++;
- EINA_INLIST_FOREACH(layer->objects, obj)
- {
- if (efl_isa(obj->object, MY_CLASS))
- {
- _evas_image_unload(obj->object, obj, 1);
- evas_object_inform_call_image_unloaded(obj->object);
- }
- }
- layer->walking_objects--;
- _evas_layer_flush_removes(layer);
- }
- evas_image_cache_flush(eo_e);
- EINA_INLIST_FOREACH(e->layers, layer)
- {
- Evas_Object_Protected_Data *obj;
-
- layer->walking_objects++;
- EINA_INLIST_FOREACH(layer->objects, obj)
- {
- if (efl_isa(obj->object, MY_CLASS))
- {
- Evas_Image_Data *o = efl_data_scope_get(obj->object, MY_CLASS);
- _evas_image_load(obj->object, obj, o);
- o->changed = EINA_TRUE;
- evas_object_change(obj->object, obj);
- }
- }
- layer->walking_objects--;
- _evas_layer_flush_removes(layer);
- }
- evas_image_cache_flush(eo_e);
-}
-
-EOLIAN void
-_evas_canvas_image_cache_set(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, int size)
-{
- if (size < 0) size = 0;
- evas_canvas_async_block(e);
- evas_render_rendering_wait(e);
- if (_evas_engine_context(e))
- e->engine.func->image_cache_set(_evas_engine_context(e), size);
-}
-
-EOLIAN int
-_evas_canvas_image_cache_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
-{
- if (_evas_engine_context(e))
- return e->engine.func->image_cache_get(_evas_engine_context(e));
- return -1;
-}
-
-EOLIAN Eina_Bool
-_evas_canvas_image_max_size_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Eina_Size2D *max)
-{
- int w = 0, h = 0;
-
- if (max) *max = EINA_SIZE2D(0xffff, 0xffff);
- if (!e->engine.func->image_max_size_get) return EINA_FALSE;
- if (!max) return EINA_TRUE;
- e->engine.func->image_max_size_get(_evas_engine_context(e), &w, &h);
- *max = EINA_SIZE2D(w, h);
- return EINA_TRUE;
-}
-
void
_evas_image_unload(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Eina_Bool dirty)
{
@@ -3057,15 +2963,15 @@ evas_object_image_is_inside(Evas_Object *eo_obj,
&imagew, &imageh, &uvw, &uvh, EINA_TRUE, EINA_FALSE);
if (!pixels) return is_inside;
- /* TODO: not handling o->dirty_pixels && o->pixels->func.get_pixels,
- * should we handle it now or believe they were done in the last render?
- */
if (o->dirty_pixels)
{
if (o->pixels->func.get_pixels)
{
- ERR("dirty_pixels && get_pixels not supported");
- // FIXME: no return here?
+ if (ENFN->gl_get_pixels_pre)
+ ENFN->gl_get_pixels_pre(ENC, output);
+ o->pixels->func.get_pixels(o->pixels->func.get_pixels_data, eo_obj);
+ if (ENFN->gl_get_pixels_post)
+ ENFN->gl_get_pixels_post(ENC, output);
}
}
@@ -3475,7 +3381,7 @@ evas_object_image_filled_resize_listener(void *data EINA_UNUSED, Evas *e EINA_UN
Evas_Image_Data *o = efl_data_scope_get(obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS);
Eina_Size2D sz;
- sz = efl_gfx_size_get(obj);
+ sz = efl_gfx_entity_size_get(obj);
if (sz.w < 1) sz.w = 1;
if (sz.h < 1) sz.h = 1;
_evas_image_fill_set(obj, o, 0, 0, sz.w, sz.h);
diff --git a/src/lib/evas/canvas/evas_object_inform.c b/src/lib/evas/canvas/evas_object_inform.c
index 1057cb92e6..ae436917cf 100644
--- a/src/lib/evas/canvas/evas_object_inform.c
+++ b/src/lib/evas/canvas/evas_object_inform.c
@@ -9,7 +9,7 @@ evas_object_inform_call_show(Evas_Object *eo_obj, Evas_Object_Protected_Data *ob
{
int event_id = _evas_object_event_new();
- evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_SHOW, NULL, event_id, EFL_GFX_EVENT_SHOW);
+ evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_SHOW, NULL, event_id, EFL_GFX_ENTITY_EVENT_SHOW);
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
}
@@ -18,7 +18,7 @@ evas_object_inform_call_hide(Evas_Object *eo_obj, Evas_Object_Protected_Data *ob
{
int event_id = _evas_object_event_new();
- evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_HIDE, NULL, event_id, EFL_GFX_EVENT_HIDE);
+ evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_HIDE, NULL, event_id, EFL_GFX_ENTITY_EVENT_HIDE);
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
}
@@ -27,7 +27,7 @@ evas_object_inform_call_move(Evas_Object *eo_obj, Evas_Object_Protected_Data *ob
{
int event_id = _evas_object_event_new();
- evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOVE, NULL, event_id, EFL_GFX_EVENT_MOVE);
+ evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOVE, NULL, event_id, EFL_GFX_ENTITY_EVENT_MOVE);
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
}
@@ -36,7 +36,7 @@ evas_object_inform_call_resize(Evas_Object *eo_obj, Evas_Object_Protected_Data *
{
int event_id = _evas_object_event_new();
- evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_RESIZE, NULL, event_id, EFL_GFX_EVENT_RESIZE);
+ evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_RESIZE, NULL, event_id, EFL_GFX_ENTITY_EVENT_RESIZE);
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
}
@@ -45,8 +45,9 @@ evas_object_inform_call_restack(Evas_Object *eo_obj, Evas_Object_Protected_Data
{
int event_id = _evas_object_event_new();
- evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_RESTACK, NULL, event_id, EFL_GFX_EVENT_RESTACK);
- _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
+ evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_RESTACK, NULL, event_id, EFL_GFX_ENTITY_EVENT_RESTACK);
+ if (obj->layer)
+ _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
}
void
@@ -54,7 +55,7 @@ evas_object_inform_call_changed_size_hints(Evas_Object *eo_obj, Evas_Object_Prot
{
int event_id = _evas_object_event_new();
- evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, NULL, event_id, EFL_GFX_EVENT_CHANGE_SIZE_HINTS);
+ evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, NULL, event_id, EFL_GFX_ENTITY_EVENT_CHANGE_SIZE_HINTS);
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
}
@@ -71,7 +72,7 @@ evas_object_inform_call_image_preloaded(Evas_Object *eo_obj)
_evas_object_image_preloading_set(eo_obj, 0);
event_id = _evas_object_event_new();
- evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_IMAGE_PRELOADED, NULL, event_id, EFL_IMAGE_EVENT_PRELOAD);
+ evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_IMAGE_PRELOADED, NULL, event_id, EFL_GFX_IMAGE_EVENT_PRELOAD);
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
}
@@ -81,7 +82,7 @@ evas_object_inform_call_image_unloaded(Evas_Object *eo_obj)
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
int event_id = _evas_object_event_new();
- evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_IMAGE_UNLOADED, NULL, event_id, EFL_IMAGE_EVENT_UNLOAD);
+ evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_IMAGE_UNLOADED, NULL, event_id, EFL_GFX_IMAGE_EVENT_UNLOAD);
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
}
@@ -91,6 +92,6 @@ evas_object_inform_call_image_resize(Evas_Object *eo_obj)
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
int event_id = _evas_object_event_new();
- evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_IMAGE_RESIZE, NULL, event_id, EFL_IMAGE_EVENT_RESIZE);
+ evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_IMAGE_RESIZE, NULL, event_id, EFL_GFX_IMAGE_EVENT_RESIZE);
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
}
diff --git a/src/lib/evas/canvas/evas_object_intercept.c b/src/lib/evas/canvas/evas_object_intercept.c
index 0676f6e759..cc4232b3df 100644
--- a/src/lib/evas/canvas/evas_object_intercept.c
+++ b/src/lib/evas/canvas/evas_object_intercept.c
@@ -106,11 +106,7 @@ _evas_object_intercept_call_internal(Evas_Object *eo_obj,
/* If show is called during hide animation is running, then the
* current hide animation is cancelled and show operation is
* proceeded. */
- if (i &&
- _efl_canvas_object_event_animation_is_running(eo_obj,
- EFL_GFX_EVENT_HIDE))
- _efl_canvas_object_event_animation_cancel(eo_obj);
- else
+ if ((!obj->anim_player) || (!efl_player_play_get(obj->anim_player)))
return 1;
}
if (!obj->interceptors) return 0;
@@ -138,7 +134,7 @@ _evas_object_intercept_call_internal(Evas_Object *eo_obj,
j = va_arg(args, int);
if (obj->interceptors)
blocked = evas_object_intercept_call_resize(eo_obj, obj, i, j);
- if (!blocked && _efl_canvas_object_efl_gfx_size_set_block(eo_obj, obj, i, j, internal))
+ if (!blocked && _efl_canvas_object_efl_gfx_entity_size_set_block(eo_obj, obj, i, j, internal))
blocked = 1;
break;
diff --git a/src/lib/evas/canvas/evas_object_line.c b/src/lib/evas/canvas/evas_object_line.c
index f6f9d573a8..e26ea6677b 100644
--- a/src/lib/evas/canvas/evas_object_line.c
+++ b/src/lib/evas/canvas/evas_object_line.c
@@ -97,7 +97,7 @@ evas_object_line_add(Evas *e)
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
return NULL;
MAGIC_CHECK_END();
- return efl_add(EVAS_LINE_CLASS, e, efl_canvas_object_legacy_ctor(efl_added));
+ return efl_add(EVAS_LINE_CLASS, evas_find(e), efl_canvas_object_legacy_ctor(efl_added));
}
EOLIAN static void
@@ -179,7 +179,7 @@ _evas_line_xy_set(Eo *eo_obj, Evas_Line_Data *_pd, Evas_Coord x1, Evas_Coord y1,
}
EOLIAN static void
-_evas_line_xy_get(Eo *eo_obj, Evas_Line_Data *_pd, Evas_Coord *x1, Evas_Coord *y1, Evas_Coord *x2, Evas_Coord *y2)
+_evas_line_xy_get(const Eo *eo_obj, Evas_Line_Data *_pd, Evas_Coord *x1, Evas_Coord *y1, Evas_Coord *x2, Evas_Coord *y2)
{
const Evas_Line_Data *o = _pd;
diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c
index b18861f90a..e0856b7561 100644
--- a/src/lib/evas/canvas/evas_object_main.c
+++ b/src/lib/evas/canvas/evas_object_main.c
@@ -12,13 +12,6 @@ EVAS_MEMPOOL(_mp_sh);
#define MY_CLASS_NAME "Evas_Object"
-static Eina_Inlist *
-get_layer_objects(Evas_Layer *l)
-{
- if ((!l) || (!l->objects)) return NULL;
- return (EINA_INLIST_GET(l->objects));
-}
-
/* evas internal stuff */
static const Evas_Object_Proxy_Data default_proxy = {
NULL, NULL, NULL, 0, 0, NULL, 0, 0, 0, 0
@@ -51,12 +44,7 @@ typedef struct _Event_Animation
EINA_INLIST;
const Efl_Event_Description *desc;
-
- Efl_Animation *anim;
- Efl_Animation_Object *anim_obj;
-
- Eina_Bool hide_anim_started : 1;
- Eina_Bool hide_anim_ended : 1;
+ Efl_Canvas_Animation *anim;
} Event_Animation;
static Eina_Bool
@@ -177,102 +165,133 @@ _evas_object_pointer_data_get(Evas_Pointer_Data *evas_pdata,
return pdata;
}
-static void _animation_intercept_hide(void *data, Evas_Object *eo_obj);
+static void _hide(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
static void
-_animation_hide_end_cb(void *data, const Efl_Event *event EINA_UNUSED)
+_anim_started_cb(void *data, const Efl_Event *ev)
{
- Event_Animation *event_anim = data;
+ const Efl_Event_Description *desc = data;
+
+ Efl_Canvas_Object_Animation_Event event;
+ event.event_desc = desc;
+
+ Eo *eo_obj = efl_animation_player_target_get(ev->object);
- event_anim->hide_anim_ended = EINA_TRUE;
+ efl_event_callback_call(eo_obj, EFL_CANVAS_OBJECT_EVENT_ANIM_STARTED,
+ &event);
+}
+
+static void
+_anim_running_cb(void *data, const Efl_Event *ev)
+{
+ const Efl_Event_Description *desc = data;
- //Animation Object is automatically deleted when animation is ended.
- event_anim->anim_obj = NULL;
+ Efl_Canvas_Object_Animation_Event event;
+ event.event_desc = desc;
- Evas_Object *target = efl_animation_target_get(event_anim->anim);
- _animation_intercept_hide(event_anim, target);
+ Eo *eo_obj = efl_animation_player_target_get(ev->object);
- event_anim->hide_anim_started = EINA_FALSE;
- event_anim->hide_anim_ended = EINA_FALSE;
+ efl_event_callback_call(eo_obj, EFL_CANVAS_OBJECT_EVENT_ANIM_RUNNING,
+ &event);
}
-static void _all_animation_objects_cancel(Evas_Object_Protected_Data *obj);
+static void
+_anim_ended_cb(void *data, const Efl_Event *ev)
+{
+ const Efl_Event_Description *desc = data;
+
+ efl_event_callback_del(ev->object, EFL_ANIMATION_PLAYER_EVENT_STARTED,
+ _anim_started_cb, desc);
+ efl_event_callback_del(ev->object, EFL_ANIMATION_PLAYER_EVENT_RUNNING,
+ _anim_running_cb, desc);
+ efl_event_callback_del(ev->object, EFL_ANIMATION_PLAYER_EVENT_ENDED,
+ _anim_ended_cb, desc);
+
+ Efl_Canvas_Object_Animation_Event event;
+ event.event_desc = desc;
+
+ Eo *eo_obj = efl_animation_player_target_get(ev->object);
+
+ efl_event_callback_call(eo_obj, EFL_CANVAS_OBJECT_EVENT_ANIM_ENDED,
+ &event);
+
+ if (desc == EFL_GFX_ENTITY_EVENT_HIDE)
+ {
+ Evas_Object_Protected_Data *obj = EVAS_OBJECT_DATA_SAFE_GET(eo_obj);
+ if (!obj) return;
+
+ _hide(eo_obj, obj);
+ }
+}
static void
_animation_intercept_hide(void *data, Evas_Object *eo_obj)
{
Event_Animation *event_anim = data;
Evas_Object_Protected_Data *obj = EVAS_OBJECT_DATA_SAFE_GET(eo_obj);
+ if (!obj) return;
- if (event_anim->anim &&
- !event_anim->hide_anim_started && !event_anim->hide_anim_ended)
+ if (event_anim->anim && obj->anim_player &&
+ (event_anim->anim != efl_animation_player_animation_get(obj->anim_player)))
{
- event_anim->hide_anim_started = EINA_TRUE;
+ efl_animation_player_animation_set(obj->anim_player, event_anim->anim);
- if (obj) _all_animation_objects_cancel(obj);
-
- //Create animation object to start animation
- event_anim->anim_obj = efl_animation_object_create(event_anim->anim);
-
- efl_event_callback_add(event_anim->anim_obj,
- EFL_ANIMATION_OBJECT_EVENT_ENDED,
- _animation_hide_end_cb,
- event_anim);
+ efl_event_callback_add(obj->anim_player,
+ EFL_ANIMATION_PLAYER_EVENT_STARTED,
+ _anim_started_cb, EFL_GFX_ENTITY_EVENT_HIDE);
+ efl_event_callback_add(obj->anim_player,
+ EFL_ANIMATION_PLAYER_EVENT_RUNNING,
+ _anim_running_cb, EFL_GFX_ENTITY_EVENT_HIDE);
+ efl_event_callback_add(obj->anim_player,
+ EFL_ANIMATION_PLAYER_EVENT_ENDED,
+ _anim_ended_cb, EFL_GFX_ENTITY_EVENT_HIDE);
//Start animation
- efl_animation_object_start(event_anim->anim_obj);
+ efl_player_start(obj->anim_player);
}
- else
- efl_gfx_visible_set(eo_obj, EINA_FALSE);
}
static void
-_event_anim_free(Event_Animation *event_anim)
+_event_anim_free(Event_Animation *event_anim, Evas_Object_Protected_Data *obj)
{
if (event_anim->anim)
{
- //Deallocate memory and Unset callbacks for Hide event
- if (event_anim->desc == EFL_GFX_EVENT_HIDE)
- {
- Efl_Canvas_Object *target =
- efl_animation_target_get(event_anim->anim);
+ //Unset callbacks for Hide event
+ if (event_anim->desc == EFL_GFX_ENTITY_EVENT_HIDE)
+ evas_object_intercept_hide_callback_del(obj->object,
+ _animation_intercept_hide);
- evas_object_intercept_hide_callback_del(target,
- _animation_intercept_hide);
+ if (efl_player_play_get(obj->anim_player))
+ {
+ Efl_Animation *running_anim =
+ efl_animation_player_animation_get(obj->anim_player);
- if (event_anim->hide_anim_started &&
- !event_anim->hide_anim_ended)
- efl_gfx_visible_set(target, EINA_FALSE);
+ if (running_anim == event_anim->anim)
+ efl_player_stop(obj->anim_player);
}
}
- if (event_anim->anim_obj)
- {
- efl_del(event_anim->anim_obj);
- event_anim->anim_obj = NULL;
- }
-
free(event_anim);
}
EOLIAN static Eo *
_efl_canvas_object_efl_object_constructor(Eo *eo_obj, Evas_Object_Protected_Data *obj)
{
+ const char *class_name;
Eo *parent = NULL;
- Evas *evas;
+ Evas *evas = NULL;
+
+ class_name = efl_class_name_get(eo_obj);
eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
+ if (!eo_obj) goto on_error;
efl_canvas_object_type_set(eo_obj, MY_CLASS_NAME);
efl_manual_free_set(eo_obj, EINA_TRUE);
parent = efl_parent_get(eo_obj);
evas = evas_object_evas_get(parent);
- if (!obj || !_init_cow() || !evas)
- {
- ERR("Failed to create a canvas object (evas: %p)", evas);
- return NULL;
- }
+ if (!obj || !_init_cow() || !evas) goto on_error;
obj->is_frame = EINA_FALSE;
obj->object = eo_obj;
@@ -289,6 +308,10 @@ _efl_canvas_object_efl_object_constructor(Eo *eo_obj, Evas_Object_Protected_Data
evas_object_callback_init(eo_obj, obj);
return eo_obj;
+
+ on_error:
+ ERR("Failed to create a canvas object (evas: %p) of type '%s'.", evas, class_name);
+ return NULL;
}
EOLIAN static Eo *
@@ -518,14 +541,14 @@ evas_object_cur_prev(Evas_Object_Protected_Data *obj)
}
void
-evas_object_free(Evas_Object *eo_obj, Eina_Bool clean_layer)
+evas_object_free(Evas_Object_Protected_Data *obj, Eina_Bool clean_layer)
{
- Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, MY_CLASS);
- if (!obj) return;
- obj->clean_layer = !!clean_layer;
-
+ Evas_Object *eo_obj;
int was_smart_child = 0;
+ if (!obj) return ;
+ eo_obj = obj->object;
+
evas_object_callback_shutdown(eo_obj, obj);
if (efl_isa(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS))
_evas_object_image_free(eo_obj);
@@ -559,15 +582,18 @@ evas_object_free(Evas_Object *eo_obj, Eina_Bool clean_layer)
}
EINA_COW_WRITE_END(evas_object_mask_cow, obj->mask, mask);
}
- evas_object_grabs_cleanup(eo_obj, obj);
- evas_object_intercept_cleanup(eo_obj);
- if (obj->smart.parent) was_smart_child = 1;
- evas_object_smart_cleanup(eo_obj);
- if (obj->func->free)
+ if (eo_obj)
{
- obj->func->free(eo_obj, obj, obj->private_data);
+ evas_object_grabs_cleanup(eo_obj, obj);
+ evas_object_intercept_cleanup(eo_obj);
+ if (obj->smart.parent) was_smart_child = 1;
+ evas_object_smart_cleanup(eo_obj);
+ if (obj->func->free)
+ {
+ obj->func->free(eo_obj, obj, obj->private_data);
+ }
}
- if (!was_smart_child) evas_object_release(eo_obj, obj, obj->clean_layer);
+ if (!was_smart_child) evas_object_release(eo_obj, obj, !!clean_layer);
if (obj->clip.clipees)
obj->clip.clipees = eina_list_free(obj->clip.clipees);
obj->clip.cache_clipees_answer = eina_list_free(obj->clip.cache_clipees_answer);
@@ -595,18 +621,6 @@ evas_object_free(Evas_Object *eo_obj, Eina_Bool clean_layer)
eina_cow_free(evas_object_mask_cow, (const Eina_Cow_Data**) &obj->mask);
eina_cow_free(evas_object_events_cow, (const Eina_Cow_Data**) &obj->events);
- //Free event animations
- while (obj->event_anims)
- {
- Event_Animation *event_anim =
- EINA_INLIST_CONTAINER_GET(obj->event_anims, Event_Animation);
-
- obj->event_anims =
- eina_inlist_remove(obj->event_anims, obj->event_anims);
-
- _event_anim_free(event_anim);
- }
-
efl_data_unref(eo_obj, obj->private_data);
obj->private_data = NULL;
@@ -1007,36 +1021,30 @@ evas_object_ref_get(const Evas_Object *eo_obj)
return obj->ref;
}
-EOLIAN static void
-_efl_canvas_object_efl_object_del(const Eo *eo_obj, Evas_Object_Protected_Data *obj)
+EAPI void
+evas_object_del(Evas_Object *obj)
{
- evas_object_async_block(obj);
- if (obj->delete_me || obj->efl_del_called) return;
- if (obj->ref > 0)
+ Evas_Object_Protected_Data *pd;
+
+ if (!obj) return;
+ if (!efl_isa(obj, MY_CLASS))
{
- obj->del_ref = EINA_TRUE;
+ ERR("Called %s on a non-evas object: %s@%p",
+ __FUNCTION__, efl_class_name_get(obj), obj);
return;
}
- efl_gfx_visible_set((Eo *) eo_obj, EINA_FALSE);
- obj->efl_del_called = EINA_TRUE;
- efl_del(efl_super(eo_obj, MY_CLASS));
-}
-
-EAPI void
-evas_object_del(Evas_Object *eo_obj)
-{
- if (!eo_obj) return;
- if (!efl_isa(eo_obj, MY_CLASS))
+ pd = efl_data_scope_get(obj, MY_CLASS);
+ if (pd->delete_me || pd->efl_del_called) return;
+ if (pd->ref)
{
- ERR("Called %s on a non-evas object: %s@%p",
- __FUNCTION__, efl_class_name_get(eo_obj), eo_obj);
+ pd->del_ref = EINA_TRUE;
return;
}
- efl_del(eo_obj);
+ efl_del(obj);
}
EOLIAN static Eina_Bool
-_efl_canvas_object_efl_input_interface_seat_event_filter_get(Eo *eo_obj EINA_UNUSED,
+_efl_canvas_object_efl_input_interface_seat_event_filter_get(const Eo *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj,
Efl_Input_Device *seat)
{
@@ -1133,17 +1141,6 @@ _is_event_blocked(Eo *eo_obj, const Efl_Event_Description *desc,
return EINA_FALSE;
}
-static Eina_Bool
-_efl_animation_event_type_is_inform_call(const Efl_Event_Description *desc)
-{
- if ((desc == EFL_GFX_EVENT_SHOW) || (desc == EFL_GFX_EVENT_HIDE) ||
- (desc == EFL_GFX_EVENT_MOVE) || (desc == EFL_GFX_EVENT_RESIZE) ||
- (desc == EFL_GFX_EVENT_CHANGE_SIZE_HINTS))
- return EINA_TRUE;
-
- return EINA_FALSE;
-}
-
static Event_Animation *
_event_animation_find(Evas_Object_Protected_Data *obj,
const Efl_Event_Description *desc)
@@ -1157,43 +1154,6 @@ _event_animation_find(Evas_Object_Protected_Data *obj,
return NULL;
}
-static Efl_Animation_Object *
-_event_animation_object_get(Evas_Object_Protected_Data *obj,
- const Efl_Event_Description *desc)
-{
- Event_Animation *event_anim = _event_animation_find(obj, desc);
- if (event_anim && event_anim->anim_obj)
- return event_anim->anim_obj;
-
- return NULL;
-}
-
-static void
-_all_animation_objects_cancel(Evas_Object_Protected_Data *obj)
-{
- if (obj->event_anims)
- {
- Event_Animation *event_anim;
- EINA_INLIST_FOREACH(obj->event_anims, event_anim)
- {
- if (event_anim && event_anim->anim_obj)
- {
- efl_animation_object_cancel(event_anim->anim_obj);
- event_anim->anim_obj = NULL;
- }
- }
- }
-}
-
-static void
-_animation_end_cb(void *data, const Efl_Event *event EINA_UNUSED)
-{
- Event_Animation *event_anim = data;
-
- //Animation Object is automatically deleted when animation is ended.
- event_anim->anim_obj = NULL;
-}
-
EOLIAN static Eina_Bool
_efl_canvas_object_efl_object_event_callback_call(Eo *eo_obj,
Evas_Object_Protected_Data *obj,
@@ -1205,24 +1165,26 @@ _efl_canvas_object_efl_object_event_callback_call(Eo *eo_obj,
//Start animation corresponding to the current event
if (desc)
{
- if (!_efl_animation_event_type_is_inform_call(desc))
+ if ((desc != EFL_GFX_ENTITY_EVENT_HIDE) && desc != (EFL_GFX_ENTITY_EVENT_SHOW))
{
Event_Animation *event_anim = _event_animation_find(obj, desc);
if (event_anim)
{
- _all_animation_objects_cancel(obj);
-
//Create animation object to start animation
- event_anim->anim_obj =
- efl_animation_object_create(event_anim->anim);
-
- efl_event_callback_add(event_anim->anim_obj,
- EFL_ANIMATION_OBJECT_EVENT_ENDED,
- _animation_end_cb,
- event_anim);
+ efl_animation_player_animation_set(obj->anim_player, event_anim->anim);
+
+ efl_event_callback_add(obj->anim_player,
+ EFL_ANIMATION_PLAYER_EVENT_STARTED,
+ _anim_started_cb, desc);
+ efl_event_callback_add(obj->anim_player,
+ EFL_ANIMATION_PLAYER_EVENT_RUNNING,
+ _anim_running_cb, desc);
+ efl_event_callback_add(obj->anim_player,
+ EFL_ANIMATION_PLAYER_EVENT_ENDED,
+ _anim_ended_cb, desc);
//Start animation
- efl_animation_object_start(event_anim->anim_obj);
+ efl_player_start(obj->anim_player);
}
}
}
@@ -1242,24 +1204,26 @@ _efl_canvas_object_efl_object_event_callback_legacy_call(Eo *eo_obj,
//Start animation corresponding to the current event
if (desc)
{
- if (!_efl_animation_event_type_is_inform_call(desc))
+ if ((desc != EFL_GFX_ENTITY_EVENT_HIDE) && desc != (EFL_GFX_ENTITY_EVENT_SHOW))
{
Event_Animation *event_anim = _event_animation_find(obj, desc);
if (event_anim)
{
- _all_animation_objects_cancel(obj);
-
//Create animation object to start animation
- event_anim->anim_obj =
- efl_animation_object_create(event_anim->anim);
-
- efl_event_callback_add(event_anim->anim_obj,
- EFL_ANIMATION_OBJECT_EVENT_ENDED,
- _animation_end_cb,
- event_anim);
+ efl_animation_player_animation_set(obj->anim_player, event_anim->anim);
+
+ efl_event_callback_add(obj->anim_player,
+ EFL_ANIMATION_PLAYER_EVENT_STARTED,
+ _anim_started_cb, desc);
+ efl_event_callback_add(obj->anim_player,
+ EFL_ANIMATION_PLAYER_EVENT_RUNNING,
+ _anim_running_cb, desc);
+ efl_event_callback_add(obj->anim_player,
+ EFL_ANIMATION_PLAYER_EVENT_ENDED,
+ _anim_ended_cb, desc);
//Start animation
- efl_animation_object_start(event_anim->anim_obj);
+ efl_player_start(obj->anim_player);
}
}
}
@@ -1269,64 +1233,123 @@ _efl_canvas_object_efl_object_event_callback_legacy_call(Eo *eo_obj,
}
EOLIAN static void
-_efl_canvas_object_efl_object_destructor(Eo *eo_obj, Evas_Object_Protected_Data *obj)
+_efl_canvas_object_efl_object_invalidate(Eo *eo_obj, Evas_Object_Protected_Data *obj)
{
- MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
- return;
- MAGIC_CHECK_END();
- Evas_Object *proxy;
- Eina_List *l, *l2;
- Evas_Canvas3D_Texture *texture;
Efl_Input_Device *dev;
- Evas_Public_Data *edata;
Evas_Object_Pointer_Data *pdata;
+ Evas_Object *proxy;
+ Eina_List *l, *l2;
int event_id;
- edata = efl_data_scope_get(evas_object_evas_get(eo_obj), EVAS_CANVAS_CLASS);
+ evas_object_async_block(obj);
+
+ // Unset callbacks for Hide event before hiding
+ evas_object_intercept_hide_callback_del((Eo *)eo_obj,
+ _animation_intercept_hide);
+
+ efl_gfx_entity_visible_set((Eo *) eo_obj, EINA_FALSE);
+ obj->efl_del_called = EINA_TRUE;
evas_object_hide(eo_obj);
- if (obj->events) EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events)
- {
- EINA_LIST_FREE (events->focused_by_seats, dev)
- {
- event_id = _evas_event_counter;
- efl_event_callback_del(dev, EFL_EVENT_DEL,
- _evas_focus_device_del_cb, obj);
- eina_hash_del_by_key(edata->focused_objects, &dev);
- _evas_focus_dispatch_event(obj, dev, EINA_FALSE);
- if ((obj->layer) && (obj->layer->evas))
- _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
- }
- EINA_INLIST_FREE(events->pointer_grabs, pdata)
- _evas_object_pointer_grab_del(obj, pdata);
- EINA_LIST_FREE(events->events_whitelist, dev)
- efl_event_callback_del(dev, EFL_EVENT_DEL, _whitelist_events_device_remove_cb, obj);
- }
- EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events);
+ if (obj->events)
+ EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events)
+ {
+ Evas_Public_Data *edata = NULL;
+
+ if (!efl_invalidated_get(evas_object_evas_get(eo_obj)))
+ edata = efl_data_scope_get(evas_object_evas_get(eo_obj), EVAS_CANVAS_CLASS);
+
+ EINA_LIST_FREE (events->focused_by_seats, dev)
+ {
+ event_id = _evas_event_counter;
+ efl_event_callback_del(dev, EFL_EVENT_INVALIDATE,
+ _evas_focus_device_invalidate_cb, obj);
+ if (edata) eina_hash_del_by_key(edata->focused_objects, &dev);
+ _evas_focus_dispatch_event(obj, dev, EINA_FALSE);
+ if ((obj->layer) && (obj->layer->evas))
+ _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
+ }
+ EINA_INLIST_FREE(events->pointer_grabs, pdata)
+ _evas_object_pointer_grab_del(obj, pdata);
+ EINA_LIST_FREE(events->events_whitelist, dev)
+ efl_event_callback_del(dev, EFL_EVENT_DEL, _whitelist_events_device_remove_cb, obj);
+ }
+ EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events);
event_id = _evas_object_event_new();
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_DEL, NULL, event_id, NULL);
if ((obj->layer) && (obj->layer->evas))
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
- if (obj->name) evas_object_name_set(eo_obj, NULL);
+
if (obj->layer)
{
if (obj->layer->evas)
if (obj->layer->evas->pending_default_focus_obj == eo_obj)
obj->layer->evas->pending_default_focus_obj = NULL;
}
- else
+
+ evas_object_grabs_cleanup(eo_obj, obj);
+
+ /* FIXME: Proxies should listen to source death */
+ if (obj->proxy)
{
- efl_manual_free_set(eo_obj, EINA_FALSE);
- obj->clean_layer = 1;
- goto end;
+ EINA_LIST_FOREACH_SAFE(obj->proxy->proxies, l, l2, proxy)
+ {
+ if (efl_isa(proxy, EFL_CANVAS_IMAGE_INTERNAL_CLASS))
+ evas_object_image_source_unset(proxy);
+ if (efl_isa(proxy, EFL_GFX_FILTER_INTERFACE))
+ efl_gfx_filter_source_set(proxy, NULL, eo_obj);
+ }
+
+ /* Eina_Cow has no way to know if we are going to really change something
+ or not. So before calling the cow, let's check if we want to do something */
+ if (obj->proxy->proxy_textures)
+ {
+ EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, obj->proxy,
+ Evas_Object_Proxy_Data, proxy_src)
+ {
+ Evas_Canvas3D_Texture *texture;
+
+ EINA_LIST_FREE(proxy_src->proxy_textures, texture)
+ evas_canvas3d_texture_source_set(texture, NULL);
+ }
+ EINA_COW_WRITE_END(evas_object_proxy_cow, obj->proxy, proxy_src);
+ }
}
- evas_object_grabs_cleanup(eo_obj, obj);
+
+ if (obj->cur && obj->cur->clipper) evas_object_clip_unset(eo_obj);
+ if (obj->prev) _efl_canvas_object_clip_prev_reset(obj, EINA_FALSE);
+
+ //Free event animations
+ while (obj->event_anims)
+ {
+ Event_Animation *event_anim =
+ EINA_INLIST_CONTAINER_GET(obj->event_anims, Event_Animation);
+
+ obj->event_anims =
+ eina_inlist_remove(obj->event_anims, obj->event_anims);
+
+ _event_anim_free(event_anim, obj);
+ }
+
+ if (obj->map) evas_object_map_set(eo_obj, NULL);
+
+ if (obj->is_smart) evas_object_smart_del(eo_obj);
+ evas_object_change(eo_obj, obj);
+
+ efl_invalidate(efl_super(eo_obj, MY_CLASS));
+}
+
+EOLIAN static void
+_efl_canvas_object_efl_object_destructor(Eo *eo_obj, Evas_Object_Protected_Data *obj)
+{
+ int event_id;
+
if (obj->clip.clipees)
{
- ERR("object %p still has %d clippees after del callback",
- eo_obj, eina_list_count(obj->clip.clipees));
+ ERR("object %p of type '%s' still has %d clippees after del callback",
+ eo_obj, efl_class_name_get(eo_obj), eina_list_count(obj->clip.clipees));
/* "while" should be used for null check of obj->clip.clipees,
because evas_objct_clip_unset can set null to obj->clip.clipees */
while (obj->clip.clipees)
@@ -1337,33 +1360,13 @@ _efl_canvas_object_efl_object_destructor(Eo *eo_obj, Evas_Object_Protected_Data
}
}
- /* FIXME: Proxies should listen to source death */
- EINA_LIST_FOREACH_SAFE(obj->proxy->proxies, l, l2, proxy)
- {
- if (efl_isa(proxy, EFL_CANVAS_IMAGE_INTERNAL_CLASS))
- evas_object_image_source_unset(proxy);
- if (efl_isa(proxy, EFL_GFX_FILTER_INTERFACE))
- efl_gfx_filter_source_set(proxy, NULL, eo_obj);
- }
-
- /* Eina_Cow has no way to know if we are going to really change something
- or not. So before calling the cow, let's check if we want to do something */
- if (obj->proxy->proxy_textures)
+ if (obj->name) evas_object_name_set(eo_obj, NULL);
+ if (!obj->layer)
{
- EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, obj->proxy,
- Evas_Object_Proxy_Data, proxy_src)
- {
- EINA_LIST_FREE(proxy_src->proxy_textures, texture)
- evas_canvas3d_texture_source_set(texture, NULL);
- }
- EINA_COW_WRITE_END(evas_object_proxy_cow, obj->proxy, proxy_src);
+ efl_manual_free_set(eo_obj, EINA_FALSE);
+ goto end;
}
- if (obj->cur->clipper) evas_object_clip_unset(eo_obj);
- _efl_canvas_object_clip_prev_reset(obj, EINA_FALSE);
-
- evas_object_map_set(eo_obj, NULL);
- if (obj->is_smart) evas_object_smart_del(eo_obj);
event_id = _evas_object_event_new();
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_FREE, NULL, event_id, NULL);
if ((obj->layer) && (obj->layer->evas))
@@ -1378,11 +1381,12 @@ end:
efl_destructor(efl_super(eo_obj, MY_CLASS));
}
+
EOLIAN static void
-_efl_canvas_object_efl_gfx_geometry_set(Eo *obj, Evas_Object_Protected_Data *pd EINA_UNUSED, Eina_Rect r)
+_efl_canvas_object_efl_gfx_entity_geometry_set(Eo *obj, Evas_Object_Protected_Data *pd EINA_UNUSED, Eina_Rect r)
{
- efl_gfx_position_set(obj, r.pos);
- efl_gfx_size_set(obj, EINA_SIZE2D(r.w, r.h));
+ efl_gfx_entity_position_set(obj, r.pos);
+ efl_gfx_entity_size_set(obj, EINA_SIZE2D(r.w, r.h));
}
EAPI void
@@ -1391,17 +1395,17 @@ evas_object_geometry_set(Evas_Object *eo_obj, Evas_Coord x, Evas_Coord y, Evas_C
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return;
MAGIC_CHECK_END();
- efl_gfx_geometry_set(eo_obj, EINA_RECT(x, y, w, h));
+ efl_gfx_entity_geometry_set(eo_obj, EINA_RECT(x, y, w, h));
}
EAPI void
evas_object_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
{
- efl_gfx_position_set(obj, EINA_POSITION2D(x, y));
+ efl_gfx_entity_position_set(obj, EINA_POSITION2D(x, y));
}
EOLIAN static void
-_efl_canvas_object_efl_gfx_position_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Position2D pos)
+_efl_canvas_object_efl_gfx_entity_position_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Position2D pos)
{
Eina_Bool pass = EINA_FALSE, freeze = EINA_FALSE;
Eina_Bool source_invisible = EINA_FALSE;
@@ -1462,11 +1466,11 @@ _efl_canvas_object_efl_gfx_position_set(Eo *eo_obj, Evas_Object_Protected_Data *
EAPI void
evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
{
- efl_gfx_size_set((Evas_Object *)obj, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set((Evas_Object *)obj, EINA_SIZE2D(w, h));
}
Eina_Bool
-_efl_canvas_object_efl_gfx_size_set_block(Eo *eo_obj, Evas_Object_Protected_Data *obj,
+_efl_canvas_object_efl_gfx_entity_size_set_block(Eo *eo_obj, Evas_Object_Protected_Data *obj,
Evas_Coord w, Evas_Coord h, Eina_Bool internal)
{
if (!internal && (obj->doing.in_resize > 0))
@@ -1486,7 +1490,7 @@ _efl_canvas_object_efl_gfx_size_set_block(Eo *eo_obj, Evas_Object_Protected_Data
}
EOLIAN static void
-_efl_canvas_object_efl_gfx_size_set(Eo *eo_obj, Evas_Object_Protected_Data *obj,
+_efl_canvas_object_efl_gfx_entity_size_set(Eo *eo_obj, Evas_Object_Protected_Data *obj,
Eina_Size2D sz)
{
Eina_Bool pass = EINA_FALSE, freeze = EINA_FALSE;
@@ -1541,7 +1545,7 @@ _efl_canvas_object_efl_gfx_size_set(Eo *eo_obj, Evas_Object_Protected_Data *obj,
}
EOLIAN Eina_Rect
-_efl_canvas_object_efl_gfx_geometry_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
+_efl_canvas_object_efl_gfx_entity_geometry_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
{
return (Eina_Rect) obj->cur->geometry;
}
@@ -1549,7 +1553,7 @@ _efl_canvas_object_efl_gfx_geometry_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Prot
EAPI void
evas_object_geometry_get(const Evas_Object *eo_obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
{
- Eina_Rect r = efl_gfx_geometry_get(eo_obj);
+ Eina_Rect r = efl_gfx_entity_geometry_get(eo_obj);
if (x) *x = r.x;
if (y) *y = r.y;
if (w) *w = r.w;
@@ -1557,7 +1561,7 @@ evas_object_geometry_get(const Evas_Object *eo_obj, Evas_Coord *x, Evas_Coord *y
}
EOLIAN static Eina_Position2D
-_efl_canvas_object_efl_gfx_position_get(Eo *obj EINA_UNUSED,
+_efl_canvas_object_efl_gfx_entity_position_get(const Eo *obj EINA_UNUSED,
Evas_Object_Protected_Data *pd)
{
if ((pd->delete_me) || (!pd->layer))
@@ -1567,8 +1571,8 @@ _efl_canvas_object_efl_gfx_position_get(Eo *obj EINA_UNUSED,
}
EOLIAN static Eina_Size2D
-_efl_canvas_object_efl_gfx_size_get(Eo *obj EINA_UNUSED,
- Evas_Object_Protected_Data *pd)
+_efl_canvas_object_efl_gfx_entity_size_get(const Eo *obj EINA_UNUSED,
+ Evas_Object_Protected_Data *pd)
{
if (pd->delete_me)
return EINA_SIZE2D(0, 0);
@@ -1622,7 +1626,7 @@ evas_object_size_hint_display_mode_set(Eo *eo_obj, Evas_Display_Mode dispmode)
}
EOLIAN static Eina_Size2D
-_efl_canvas_object_efl_gfx_size_hint_hint_restricted_min_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
+_efl_canvas_object_efl_gfx_size_hint_hint_restricted_min_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
{
if ((!obj->size_hints) || obj->delete_me)
return EINA_SIZE2D(0, 0);
@@ -1650,7 +1654,7 @@ _efl_canvas_object_efl_gfx_size_hint_hint_restricted_min_set(Eo *eo_obj, Evas_Ob
}
EOLIAN static Eina_Size2D
-_efl_canvas_object_efl_gfx_size_hint_hint_combined_min_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
+_efl_canvas_object_efl_gfx_size_hint_hint_combined_min_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
{
Eina_Size2D sz = { 0, 0 };
@@ -1663,7 +1667,7 @@ _efl_canvas_object_efl_gfx_size_hint_hint_combined_min_get(Eo *eo_obj EINA_UNUSE
}
EOLIAN static Eina_Size2D
-_efl_canvas_object_efl_gfx_size_hint_hint_max_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
+_efl_canvas_object_efl_gfx_size_hint_hint_max_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
{
if ((!obj->size_hints) || obj->delete_me)
return EINA_SIZE2D(-1, -1);
@@ -1727,7 +1731,7 @@ evas_object_size_hint_request_set(Eo *eo_obj, Evas_Coord w, Evas_Coord h)
}
EOLIAN static Eina_Size2D
-_efl_canvas_object_efl_gfx_size_hint_hint_min_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
+_efl_canvas_object_efl_gfx_size_hint_hint_min_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
{
if ((!obj->size_hints) || obj->delete_me)
return EINA_SIZE2D(0, 0);
@@ -1755,7 +1759,7 @@ _efl_canvas_object_efl_gfx_size_hint_hint_min_set(Eo *eo_obj, Evas_Object_Protec
}
EOLIAN static void
-_efl_canvas_object_efl_gfx_size_hint_hint_aspect_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Efl_Gfx_Size_Hint_Aspect *aspect, Eina_Size2D *sz)
+_efl_canvas_object_efl_gfx_size_hint_hint_aspect_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Efl_Gfx_Size_Hint_Aspect *aspect, Eina_Size2D *sz)
{
if ((!obj->size_hints) || obj->delete_me)
{
@@ -1794,7 +1798,7 @@ _efl_canvas_object_efl_gfx_size_hint_hint_aspect_set(Eo *eo_obj, Evas_Object_Pro
}
EOLIAN static void
-_efl_canvas_object_efl_gfx_size_hint_hint_align_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, double *x, double *y)
+_efl_canvas_object_efl_gfx_size_hint_hint_align_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, double *x, double *y)
{
if ((!obj->size_hints) || obj->delete_me)
{
@@ -1830,7 +1834,7 @@ _efl_canvas_object_efl_gfx_size_hint_hint_align_set(Eo *eo_obj, Evas_Object_Prot
}
EOLIAN static void
-_efl_canvas_object_efl_gfx_size_hint_hint_weight_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, double *x, double *y)
+_efl_canvas_object_efl_gfx_size_hint_hint_weight_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, double *x, double *y)
{
if ((!obj->size_hints) || obj->delete_me)
{
@@ -1866,7 +1870,7 @@ _efl_canvas_object_efl_gfx_size_hint_hint_weight_set(Eo *eo_obj, Evas_Object_Pro
}
EOLIAN static void
-_efl_canvas_object_efl_gfx_size_hint_hint_margin_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Evas_Coord *l, Evas_Coord *r, Evas_Coord *t, Evas_Coord *b)
+_efl_canvas_object_efl_gfx_size_hint_hint_margin_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Evas_Coord *l, Evas_Coord *r, Evas_Coord *t, Evas_Coord *b)
{
if ((!obj->size_hints) || obj->delete_me)
{
@@ -1910,25 +1914,27 @@ evas_object_show(Evas_Object *eo_obj)
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return;
MAGIC_CHECK_END();
- efl_gfx_visible_set(eo_obj, EINA_TRUE);
+ efl_gfx_entity_visible_set(eo_obj, EINA_TRUE);
}
EAPI void
evas_object_hide(Evas_Object *eo_obj)
{
if (!eo_obj) return;
- efl_gfx_visible_set(eo_obj, EINA_FALSE);
+ efl_gfx_entity_visible_set(eo_obj, EINA_FALSE);
}
EAPI Eina_Bool
evas_object_visible_get(const Evas_Object *obj)
{
- return efl_gfx_visible_get((Evas_Object *)obj);
+ return efl_gfx_entity_visible_get((Evas_Object *)obj);
}
static void
_show(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
{
+ if (obj->anim_player)
+ efl_player_stop(obj->anim_player);
if (obj->is_smart && obj->smart.smart && obj->smart.smart->smart_class->show)
{
obj->smart.smart->smart_class->show(eo_obj);
@@ -1962,22 +1968,24 @@ _show(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
evas_object_update_bounding_box(eo_obj, obj, NULL);
evas_object_inform_call_show(eo_obj, obj);
- Event_Animation *event_anim = _event_animation_find(obj, EFL_GFX_EVENT_SHOW);
+ Event_Animation *event_anim = _event_animation_find(obj, EFL_GFX_ENTITY_EVENT_SHOW);
if (event_anim)
{
- _all_animation_objects_cancel(obj);
-
//Create animation object to start animation
- event_anim->anim_obj =
- efl_animation_object_create(event_anim->anim);
-
- efl_event_callback_add(event_anim->anim_obj,
- EFL_ANIMATION_OBJECT_EVENT_ENDED,
- _animation_end_cb,
- event_anim);
+ efl_animation_player_animation_set(obj->anim_player, event_anim->anim);
+
+ efl_event_callback_add(obj->anim_player,
+ EFL_ANIMATION_PLAYER_EVENT_STARTED,
+ _anim_started_cb, EFL_GFX_ENTITY_EVENT_SHOW);
+ efl_event_callback_add(obj->anim_player,
+ EFL_ANIMATION_PLAYER_EVENT_RUNNING,
+ _anim_running_cb, EFL_GFX_ENTITY_EVENT_SHOW);
+ efl_event_callback_add(obj->anim_player,
+ EFL_ANIMATION_PLAYER_EVENT_ENDED,
+ _anim_ended_cb, EFL_GFX_ENTITY_EVENT_SHOW);
//Start animation
- efl_animation_object_start(event_anim->anim_obj);
+ efl_player_start(obj->anim_player);
}
}
@@ -2093,12 +2101,11 @@ _hide(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
}
EOLIAN static void
-_efl_canvas_object_efl_gfx_visible_set(Eo *eo_obj, Evas_Object_Protected_Data *obj,
+_efl_canvas_object_efl_gfx_entity_visible_set(Eo *eo_obj, Evas_Object_Protected_Data *obj,
Eina_Bool vis)
{
if (!obj->legacy.visible_set)
obj->legacy.visible_set = EINA_TRUE;
-
if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 1, vis))
return;
@@ -2107,8 +2114,8 @@ _efl_canvas_object_efl_gfx_visible_set(Eo *eo_obj, Evas_Object_Protected_Data *o
}
EOLIAN static Eina_Bool
-_efl_canvas_object_efl_gfx_visible_get(Eo *eo_obj EINA_UNUSED,
- Evas_Object_Protected_Data *obj)
+_efl_canvas_object_efl_gfx_entity_visible_get(const Eo *eo_obj EINA_UNUSED,
+ Evas_Object_Protected_Data *obj)
{
if (!EVAS_OBJECT_DATA_ALIVE(obj)) return EINA_FALSE;
#if 0
@@ -2175,7 +2182,7 @@ evas_object_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a)
}
EOLIAN static void
-_efl_canvas_object_efl_gfx_color_color_get(Eo *eo_obj EINA_UNUSED,
+_efl_canvas_object_efl_gfx_color_color_get(const Eo *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj,
int *r, int *g, int *b, int *a)
{
@@ -2211,14 +2218,14 @@ _efl_canvas_object_anti_alias_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, E
}
EOLIAN static Eina_Bool
-_efl_canvas_object_anti_alias_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
+_efl_canvas_object_anti_alias_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
{
if (obj->delete_me) return EINA_FALSE;
return obj->cur->anti_alias;
}
EOLIAN static void
-_efl_canvas_object_efl_gfx_scale_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, double scale)
+_efl_canvas_object_efl_gfx_entity_scale_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, double scale)
{
if (obj->delete_me) return;
if (EINA_DBL_EQ(obj->cur->scale, scale)) return;
@@ -2233,7 +2240,7 @@ _efl_canvas_object_efl_gfx_scale_set(Eo *eo_obj, Evas_Object_Protected_Data *obj
}
EOLIAN static double
-_efl_canvas_object_efl_gfx_scale_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
+_efl_canvas_object_efl_gfx_entity_scale_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
{
if (obj->delete_me) return 1.0;
return obj->cur->scale;
@@ -2269,7 +2276,7 @@ evas_object_render_op_set(Evas_Object *eo_obj, Evas_Render_Op render_op)
}
EOLIAN static Efl_Gfx_Render_Op
-_efl_canvas_object_render_op_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
+_efl_canvas_object_render_op_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
{
return _evas_to_gfx_render_op(obj->cur->render_op);
}
@@ -2303,11 +2310,11 @@ _efl_canvas_object_efl_object_dbg_info_get(Eo *eo_obj, Evas_Object_Protected_Dat
Eina_Bool repeat_event;
Eina_Bool clipees_has;
- visible = efl_gfx_visible_get(eo_obj);
+ visible = efl_gfx_entity_visible_get(eo_obj);
layer = efl_gfx_stack_layer_get(eo_obj);
name = efl_name_get(eo_obj); // evas_object_name_get(eo_obj);
- geom = efl_gfx_geometry_get(eo_obj);
- scale = efl_gfx_scale_get(eo_obj);
+ geom = efl_gfx_entity_geometry_get(eo_obj);
+ scale = efl_gfx_entity_scale_get(eo_obj);
min = efl_gfx_size_hint_restricted_min_get(eo_obj);
max = efl_gfx_size_hint_max_get(eo_obj);
//efl_gfx_size_hint_request_get(eo_obj, &requestw, &requesth);
@@ -2441,202 +2448,11 @@ fallback:
}
EOLIAN static Efl_Loop *
-_efl_canvas_object_efl_loop_consumer_loop_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED)
+_efl_canvas_object_efl_loop_consumer_loop_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED)
{
return efl_main_loop_get();
}
-EOLIAN Evas_Object*
-_evas_canvas_object_top_at_xy_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
-{
- Evas_Layer *lay;
- int xx, yy;
-
- xx = x;
- yy = y;
-//// xx = evas_coord_world_x_to_screen(eo_e, x);
-//// yy = evas_coord_world_y_to_screen(eo_e, y);
- EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
- {
- Evas_Object *eo_obj;
- Evas_Object_Protected_Data *obj;
-
- EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
- {
- eo_obj = obj->object;
- if (obj->delete_me) continue;
- if ((!include_pass_events_objects) &&
- (evas_event_passes_through(eo_obj, obj))) continue;
- if (evas_object_is_source_invisible(eo_obj, obj)) continue;
- if ((!include_hidden_objects) && (!obj->cur->visible)) continue;
- evas_object_clip_recalc(obj);
- if ((evas_object_is_in_output_rect(eo_obj, obj, xx, yy, 1, 1)) &&
- (!obj->clip.clipees) &&
- RECTS_INTERSECT(xx, yy, 1, 1,
- obj->cur->geometry.x, obj->cur->geometry.y,
- obj->cur->geometry.w, obj->cur->geometry.h))
- return eo_obj;
- }
- }
- return NULL;
-}
-
-EAPI Evas_Object *
-evas_object_top_at_pointer_get(const Evas *eo_e)
-{
- Evas_Public_Data *e = efl_isa(eo_e, EVAS_CANVAS_CLASS) ?
- efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS) : NULL;
- if (!e) return NULL;
-
- Evas_Pointer_Data *pdata = _evas_pointer_data_by_device_get(e, NULL);
- EINA_SAFETY_ON_NULL_RETURN_VAL(pdata, NULL);
- return evas_canvas_object_top_at_xy_get((Eo *)eo_e, pdata->seat->x, pdata->seat->y, EINA_TRUE, EINA_TRUE);
-}
-
-EOLIAN Evas_Object*
-_evas_canvas_object_top_in_rectangle_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
-{
- Evas_Layer *lay;
- int xx, yy, ww, hh;
-
- xx = x;
- yy = y;
- ww = w;
- hh = h;
-//// xx = evas_coord_world_x_to_screen(eo_e, x);
-//// yy = evas_coord_world_y_to_screen(eo_e, y);
-//// ww = evas_coord_world_x_to_screen(eo_e, w);
-//// hh = evas_coord_world_y_to_screen(eo_e, h);
- if (ww < 1) ww = 1;
- if (hh < 1) hh = 1;
- EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
- {
- Evas_Object *eo_obj;
- Evas_Object_Protected_Data *obj;
-
- EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
- {
- eo_obj = obj->object;
- if (obj->delete_me) continue;
- if ((!include_pass_events_objects) &&
- (evas_event_passes_through(eo_obj, obj))) continue;
- if (evas_object_is_source_invisible(eo_obj, obj)) continue;
- if ((!include_hidden_objects) && (!obj->cur->visible)) continue;
- evas_object_clip_recalc(obj);
- if ((evas_object_is_in_output_rect(eo_obj, obj, xx, yy, ww, hh)) &&
- (!obj->clip.clipees) &&
- RECTS_INTERSECT(xx, yy, ww, hh,
- obj->cur->geometry.x, obj->cur->geometry.y,
- obj->cur->geometry.w, obj->cur->geometry.h)) return eo_obj;
- }
- }
- return NULL;
-}
-
-EOLIAN Eina_List*
-_evas_canvas_objects_at_xy_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
-{
- Eina_List *in = NULL;
- Evas_Layer *lay;
- int xx, yy;
-
- xx = x;
- yy = y;
-//// xx = evas_coord_world_x_to_screen(eo_e, x);
-//// yy = evas_coord_world_y_to_screen(eo_e, y);
- EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
- {
- Evas_Object *eo_obj;
- Evas_Object_Protected_Data *obj;
-
- EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
- {
- eo_obj = obj->object;
- // FIXME - Daniel: we don't know yet how to handle the next line
- if (obj->delete_me) continue;
- if ((!include_pass_events_objects) &&
- (evas_event_passes_through(eo_obj, obj))) continue;
- if (evas_object_is_source_invisible(eo_obj, obj)) continue;
- if ((!include_hidden_objects) && (!obj->cur->visible)) continue;
- evas_object_clip_recalc(obj);
- if ((evas_object_is_in_output_rect(eo_obj, obj, xx, yy, 1, 1)) &&
- (!obj->clip.clipees))
- {
- // evas_object_is_in_output_rect is based on the clip which
- // may be larger than the geometry (bounding box)
- if (!RECTS_INTERSECT(xx, yy, 1, 1,
- obj->cur->geometry.x,
- obj->cur->geometry.y,
- obj->cur->geometry.w,
- obj->cur->geometry.h))
- continue;
- in = eina_list_prepend(in, eo_obj);
- }
- }
- }
- return in;
-}
-
-/**
- * Retrieves the objects in the given rectangle region
- * @param eo_e The given evas object.
- * @param x The horizontal coordinate.
- * @param y The vertical coordinate.
- * @param w The width size.
- * @param h The height size.
- * @param include_pass_events_objects Boolean Flag to include or not pass events objects
- * @param include_hidden_objects Boolean Flag to include or not hidden objects
- * @return The list of evas object in the rectangle region.
- *
- */
-EOLIAN Eina_List*
-_evas_canvas_objects_in_rectangle_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
-{
- Eina_List *in = NULL;
- Evas_Layer *lay;
- int xx, yy, ww, hh;
-
- xx = x;
- yy = y;
- ww = w;
- hh = h;
-//// xx = evas_coord_world_x_to_screen(eo_e, x);
-//// yy = evas_coord_world_y_to_screen(eo_e, y);
-//// ww = evas_coord_world_x_to_screen(eo_e, w);
-//// hh = evas_coord_world_y_to_screen(eo_e, h);
- if (ww < 1) ww = 1;
- if (hh < 1) hh = 1;
- EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
- {
- Evas_Object *eo_obj;
- Evas_Object_Protected_Data *obj;
-
- EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
- {
- eo_obj = obj->object;
- // FIXME - Daniel: we don't know yet how to handle the next line
- if (obj->delete_me) continue;
- if ((!include_pass_events_objects) &&
- (evas_event_passes_through(eo_obj, obj))) continue;
- if (evas_object_is_source_invisible(eo_obj, obj)) continue;
- if ((!include_hidden_objects) && (!obj->cur->visible)) continue;
- evas_object_clip_recalc(obj);
- if ((evas_object_is_in_output_rect(eo_obj, obj, xx, yy, ww, hh)) &&
- (!obj->clip.clipees))
- {
- if (!RECTS_INTERSECT(xx, yy, ww, hh,
- obj->cur->geometry.x,
- obj->cur->geometry.y,
- obj->cur->geometry.w,
- obj->cur->geometry.h))
- continue;
- in = eina_list_prepend(in, eo_obj);
- }
- }
- }
- return in;
-}
-
EOLIAN static void
_efl_canvas_object_type_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, const char *type)
{
@@ -2656,13 +2472,13 @@ _efl_canvas_object_precise_is_inside_set(Eo *eo_obj EINA_UNUSED, Evas_Object_Pro
}
EOLIAN static Eina_Bool
-_efl_canvas_object_precise_is_inside_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
+_efl_canvas_object_precise_is_inside_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
{
return obj->precise_is_inside;
}
EOLIAN static Eina_Bool
-_efl_canvas_object_coords_inside_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Eina_Position2D pos)
+_efl_canvas_object_coords_inside_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Eina_Position2D pos)
{
Eina_Rectangle c;
@@ -2721,13 +2537,13 @@ _efl_canvas_object_is_frame_object_set(Eo *eo_obj, Evas_Object_Protected_Data *o
}
EOLIAN static Eina_Bool
-_efl_canvas_object_is_frame_object_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
+_efl_canvas_object_is_frame_object_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
{
return obj->is_frame;
}
EOLIAN static Evas_Object *
-_efl_canvas_object_render_parent_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
+_efl_canvas_object_render_parent_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
{
if (!obj) return NULL;
return obj->smart.parent;
@@ -2740,7 +2556,7 @@ _efl_canvas_object_paragraph_direction_set(Eo *eo_obj EINA_UNUSED, Evas_Object_P
}
EOLIAN static Evas_BiDi_Direction
-_efl_canvas_object_paragraph_direction_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED)
+_efl_canvas_object_paragraph_direction_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED)
{
return EVAS_BIDI_DIRECTION_NEUTRAL;
}
@@ -2752,14 +2568,30 @@ _efl_canvas_object_legacy_ctor(Eo *eo_obj, Evas_Object_Protected_Data *obj)
obj->legacy.ctor = EINA_TRUE;
}
+EAPI Eo *
+evas_find(const Eo *obj)
+{
+ if (efl_isa(obj, EVAS_CANVAS_CLASS))
+ return (Eo*) obj;
+ if (efl_isa(obj, EFL_CANVAS_OBJECT_CLASS))
+ return evas_object_evas_get(obj);
+ return efl_provider_find(obj, EVAS_CANVAS_CLASS);
+}
+
EOLIAN void
_efl_canvas_object_event_animation_set(Eo *eo_obj,
Evas_Object_Protected_Data *pd,
const Efl_Event_Description *desc,
- Efl_Animation *animation)
+ Efl_Canvas_Animation *animation)
{
Event_Animation *event_anim = _event_animation_find(pd, desc);
+ if (!pd->anim_player)
+ {
+ pd->anim_player = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, eo_obj,
+ efl_animation_player_target_set(efl_added, eo_obj));
+ }
+
if (event_anim)
{
if (event_anim->anim == animation)
@@ -2768,75 +2600,49 @@ _efl_canvas_object_event_animation_set(Eo *eo_obj,
pd->event_anims =
eina_inlist_remove(pd->event_anims, EINA_INLIST_GET(event_anim));
- _event_anim_free(event_anim);
+ _event_anim_free(event_anim, pd);
}
if (!animation) return;
event_anim = calloc(1, sizeof(Event_Animation));
- //Set target object for the given animation
- Efl_Canvas_Object *target = efl_animation_target_get(animation);
- if (!target)
- target = eo_obj;
- efl_animation_target_set(animation, target);
-
//Set callback for Hide event
- if (desc == EFL_GFX_EVENT_HIDE)
+ if (desc == EFL_GFX_ENTITY_EVENT_HIDE)
{
- evas_object_intercept_hide_callback_add(target,
+ evas_object_intercept_hide_callback_add(eo_obj,
_animation_intercept_hide,
event_anim);
}
event_anim->desc = desc;
event_anim->anim = animation;
- event_anim->anim_obj = NULL;
- event_anim->hide_anim_started = EINA_FALSE;
- event_anim->hide_anim_ended = EINA_FALSE;
pd->event_anims =
eina_inlist_append(pd->event_anims, EINA_INLIST_GET(event_anim));
}
-EOLIAN Efl_Animation *
-_efl_canvas_object_event_animation_get(Eo *eo_obj EINA_UNUSED,
+EOLIAN Efl_Canvas_Animation *
+_efl_canvas_object_event_animation_get(const Eo *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *pd,
const Efl_Event_Description *desc)
{
Event_Animation *event_anim = _event_animation_find(pd, desc);
- if (event_anim && event_anim->anim)
- return event_anim->anim_obj;
+ if (event_anim)
+ return event_anim->anim;
return NULL;
}
-/* This function is to show object if show is called during hide animation.
- * If show is called during hide animation is running, then the running hide
- * animation is cancelled and show operation is proceeded. */
-Eina_Bool
-_efl_canvas_object_event_animation_is_running(Eo *eo_obj,
- const Efl_Event_Description *desc)
-{
- Evas_Object_Protected_Data *obj = EVAS_OBJECT_DATA_SAFE_GET(eo_obj);
-
- if (!obj) return EINA_FALSE;
-
- if (_event_animation_object_get(obj, desc))
- return EINA_TRUE;
-
- return EINA_FALSE;
-}
-
void
_efl_canvas_object_event_animation_cancel(Eo *eo_obj)
{
Evas_Object_Protected_Data *obj = EVAS_OBJECT_DATA_SAFE_GET(eo_obj);
- if (obj) _all_animation_objects_cancel(obj);
+ if (obj)
+ efl_player_stop(obj->anim_player);
}
-
/* legacy */
EAPI const char *
@@ -2946,19 +2752,26 @@ evas_object_size_hint_align_get(const Evas_Object *obj, double *x, double *y)
EAPI Evas *
evas_object_evas_get(const Eo *eo_obj)
{
+ if (efl_isa(eo_obj, EFL_CANVAS_OBJECT_CLASS))
+ {
+ Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj, NULL);
+
+ if (!obj->layer || !obj->layer->evas) return NULL;
+ return obj->layer->evas->evas;
+ }
return efl_provider_find((Eo *) eo_obj, EVAS_CANVAS_CLASS);
}
EAPI void
evas_object_scale_set(Evas_Object *obj, double scale)
{
- efl_gfx_scale_set(obj, scale);
+ efl_gfx_entity_scale_set(obj, scale);
}
EAPI double
evas_object_scale_get(const Evas_Object *obj)
{
- return efl_gfx_scale_get(obj);
+ return efl_gfx_entity_scale_get(obj);
}
EAPI Eina_Bool
diff --git a/src/lib/evas/canvas/evas_object_polygon.c b/src/lib/evas/canvas/evas_object_polygon.c
index b1649de152..90c05dda42 100644
--- a/src/lib/evas/canvas/evas_object_polygon.c
+++ b/src/lib/evas/canvas/evas_object_polygon.c
@@ -84,7 +84,10 @@ static const Evas_Object_Func object_func =
EAPI Evas_Object *
evas_object_polygon_add(Evas *e)
{
- return efl_add(MY_CLASS, e, efl_canvas_object_legacy_ctor(efl_added));
+ MAGIC_CHECK(e, Evas, MAGIC_EVAS);
+ return NULL;
+ MAGIC_CHECK_END();
+ return efl_add(MY_CLASS, evas_find(e), efl_canvas_object_legacy_ctor(efl_added));
}
EOLIAN static Eo *
diff --git a/src/lib/evas/canvas/evas_object_rectangle.c b/src/lib/evas/canvas/evas_object_rectangle.c
index d9e0d28b64..c5d8253aee 100644
--- a/src/lib/evas/canvas/evas_object_rectangle.c
+++ b/src/lib/evas/canvas/evas_object_rectangle.c
@@ -95,7 +95,7 @@ evas_object_rectangle_add(Evas *e)
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
return NULL;
MAGIC_CHECK_END();
- return efl_add(EFL_CANVAS_RECTANGLE_CLASS, e, efl_canvas_object_legacy_ctor(efl_added));
+ return efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas_find(e), efl_canvas_object_legacy_ctor(efl_added));
}
EOLIAN static Eo *
diff --git a/src/lib/evas/canvas/evas_object_smart.c b/src/lib/evas/canvas/evas_object_smart.c
index f5f5c25fe9..37c8868479 100644
--- a/src/lib/evas/canvas/evas_object_smart.c
+++ b/src/lib/evas/canvas/evas_object_smart.c
@@ -309,7 +309,7 @@ _efl_canvas_group_group_member_add(Eo *smart_obj, Evas_Smart_Data *o, Evas_Objec
EINA_SAFETY_ON_NULL_RETURN(clipper);
efl_canvas_object_clip_set(eo_obj, clipper);
if (!had_clippees && smart->cur->visible)
- efl_gfx_visible_set(clipper, 1);
+ efl_gfx_entity_visible_set(clipper, 1);
}
}
@@ -323,7 +323,10 @@ _efl_canvas_group_group_member_add(Eo *smart_obj, Evas_Smart_Data *o, Evas_Objec
EAPI void
evas_object_smart_member_del(Evas_Object *eo_obj)
{
- Evas_Object_Protected_Data *obj = efl_data_scope_safe_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
+ Evas_Object_Protected_Data *obj;
+
+ if (!eo_obj) return ;
+ obj = efl_data_scope_safe_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
if (!obj) return;
if (!obj->smart.parent) return;
Evas_Object *smart_obj = obj->smart.parent;
@@ -354,7 +357,7 @@ _efl_canvas_group_group_member_del(Eo *smart_obj, Evas_Smart_Data *_pd EINA_UNUS
EINA_SAFETY_ON_NULL_RETURN(clipper);
efl_canvas_object_clip_set(eo_obj, NULL);
if (!efl_canvas_object_clipees_has(clipper))
- efl_gfx_visible_set(clipper, 0);
+ efl_gfx_entity_visible_set(clipper, 0);
}
o->contained = eina_inlist_remove(o->contained, EINA_INLIST_GET(obj));
@@ -579,17 +582,16 @@ evas_object_smart_members_get_direct(const Evas_Object *eo_obj)
static void
_efl_canvas_group_group_members_all_del_internal(Evas_Smart_Data *o)
{
+ Evas_Object_Smart_Clipped_Data *cso = o->clipped ? o->data : NULL;
Evas_Object_Protected_Data *memobj;
Eina_Inlist *itrn;
- Eo *eo_clipper;
- eo_clipper = _smart_clipper_get(o);
EINA_INLIST_FOREACH_SAFE(o->contained, itrn, memobj)
{
- if (memobj->object != eo_clipper)
- efl_del(memobj->object);
+ if (memobj->object != cso->clipper)
+ _evas_wrap_del(&memobj->object, memobj);
}
- efl_del(eo_clipper);
+ _evas_wrap_del(&cso->clipper, efl_data_scope_get(cso->clipper, EFL_CANVAS_OBJECT_CLASS));
o->group_del_called = EINA_TRUE;
}
@@ -676,7 +678,7 @@ evas_object_smart_add(Evas *eo_e, Evas_Smart *s)
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
return NULL;
MAGIC_CHECK_END();
- eo_obj = efl_add(EFL_CANVAS_GROUP_CLASS, eo_e, efl_canvas_object_legacy_ctor(efl_added));
+ eo_obj = efl_add(EFL_CANVAS_GROUP_CLASS, evas_find(eo_e), efl_canvas_object_legacy_ctor(efl_added));
evas_object_smart_attach(eo_obj, s);
return eo_obj;
}
@@ -863,12 +865,12 @@ _efl_canvas_group_efl_gfx_color_color_set(Eo *eo_obj, Evas_Smart_Data *o, int r,
}
EOLIAN static void
-_efl_canvas_group_efl_gfx_visible_set(Eo *eo_obj, Evas_Smart_Data *o, Eina_Bool vis)
+_efl_canvas_group_efl_gfx_entity_visible_set(Eo *eo_obj, Evas_Smart_Data *o, Eina_Bool vis)
{
if (_evas_object_intercept_call(eo_obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 0, vis))
return;
- efl_gfx_visible_set(efl_super(eo_obj, MY_CLASS), vis);
+ efl_gfx_entity_visible_set(efl_super(eo_obj, MY_CLASS), vis);
if (o->clipped)
{
@@ -879,19 +881,19 @@ _efl_canvas_group_efl_gfx_visible_set(Eo *eo_obj, Evas_Smart_Data *o, Eina_Bool
if (vis && !evas_object_clipees_has(clipper))
return;
- efl_gfx_visible_set(clipper, vis);
+ efl_gfx_entity_visible_set(clipper, vis);
}
}
EOLIAN static void
-_efl_canvas_group_efl_gfx_position_set(Eo *eo_obj, Evas_Smart_Data *o, Eina_Position2D pos)
+_efl_canvas_group_efl_gfx_entity_position_set(Eo *eo_obj, Evas_Smart_Data *o, Eina_Position2D pos)
{
if (_evas_object_intercept_call(eo_obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
if (o->clipped)
_evas_object_smart_clipped_smart_move_internal(eo_obj, pos.x, pos.y);
- efl_gfx_position_set(efl_super(eo_obj, MY_CLASS), pos);
+ efl_gfx_entity_position_set(efl_super(eo_obj, MY_CLASS), pos);
}
EOLIAN static void
@@ -918,6 +920,10 @@ evas_object_smart_attach(Evas_Object *eo_obj, Evas_Smart *s)
Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj);
unsigned int i;
+ MAGIC_CHECK(s, Evas_Smart, MAGIC_SMART);
+ return;
+ MAGIC_CHECK_END();
+
obj->smart.smart = s;
obj->type = s->smart_class->name;
evas_object_smart_use(s);
@@ -1136,7 +1142,7 @@ _efl_canvas_group_group_need_recalculate_set(Eo *eo_obj, Evas_Smart_Data *o, Ein
}
EOLIAN static Eina_Bool
-_efl_canvas_group_group_need_recalculate_get(Eo *eo_obj EINA_UNUSED, Evas_Smart_Data *o)
+_efl_canvas_group_group_need_recalculate_get(const Eo *eo_obj EINA_UNUSED, Evas_Smart_Data *o)
{
return o->need_recalculate;
}
@@ -1154,24 +1160,6 @@ _efl_canvas_group_group_calculate(Eo *eo_obj, Evas_Smart_Data *o)
obj->smart.smart->smart_class->calculate(eo_obj);
}
-EOLIAN void
-_evas_canvas_smart_objects_calculate(Eo *eo_e, Evas_Public_Data *o EINA_UNUSED)
-{
- evas_call_smarts_calculate(eo_e);
-}
-
-EOLIAN Eina_Bool
-_evas_canvas_smart_objects_calculating_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
-{
- return !!e->in_smart_calc;
-}
-
-EOLIAN int
-_evas_canvas_smart_objects_calculate_count_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
-{
- return e->smart_calc_count;
-}
-
/**
* Call calculate() on all smart objects that need_recalculate.
*
@@ -1492,7 +1480,13 @@ evas_object_smart_cleanup(Evas_Object *eo_obj)
(Evas_Object_Protected_Data *)o->contained;
Evas_Object *contained_obj = contained->object;
- if (contained->smart.parent != eo_obj)
+ if (!contained_obj)
+ {
+ ERR("Found an undefined object %p in %s.", contained, efl_debug_name_get(eo_obj));
+ o->contained = eina_inlist_remove
+ (o->contained, EINA_INLIST_GET(contained));
+ }
+ else if (contained->smart.parent != eo_obj)
{
Evas_Layer *lay = obj->layer;
@@ -1833,13 +1827,13 @@ _efl_canvas_group_efl_canvas_object_paragraph_direction_set(Eo *eo_obj, Evas_Sma
}
EOLIAN static Evas_BiDi_Direction
-_efl_canvas_group_efl_canvas_object_paragraph_direction_get(Eo *eo_obj EINA_UNUSED, Evas_Smart_Data *o)
+_efl_canvas_group_efl_canvas_object_paragraph_direction_get(const Eo *eo_obj EINA_UNUSED, Evas_Smart_Data *o)
{
return o->paragraph_direction;
}
EOLIAN static const Eo *
-_efl_canvas_group_group_clipper_get(Eo *eo_obj EINA_UNUSED, Evas_Smart_Data *o)
+_efl_canvas_group_group_clipper_get(const Eo *eo_obj EINA_UNUSED, Evas_Smart_Data *o)
{
// NOTE: This may be NULL until all EO smart objects are clipped!
return _smart_clipper_get(o);
diff --git a/src/lib/evas/canvas/evas_object_table.c b/src/lib/evas/canvas/evas_object_table.c
index a07461f0f3..97ba008266 100644
--- a/src/lib/evas/canvas/evas_object_table.c
+++ b/src/lib/evas/canvas/evas_object_table.c
@@ -105,7 +105,7 @@ struct _Evas_Object_Table_Accessor
EVAS_OBJECT_TABLE_DATA_GET(o, ptr); \
if (!ptr) \
{ \
- CRI("no widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return; \
}
@@ -114,7 +114,7 @@ if (!ptr) \
EVAS_OBJECT_TABLE_DATA_GET(o, ptr); \
if (!ptr) \
{ \
- CRI("No widget data for object %p (%s)", \
+ ERR("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
return val; \
}
@@ -251,7 +251,7 @@ _evas_object_table_option_del(Evas_Object *o)
}
static void
-_on_child_del(void *data, const Efl_Event *event)
+_on_child_invalidate(void *data, const Efl_Event *event)
{
Evas_Object *table = data;
evas_object_table_unpack(table, event->object);
@@ -267,8 +267,8 @@ _on_child_hints_changed(void *data, const Efl_Event *event EINA_UNUSED)
}
EFL_CALLBACKS_ARRAY_DEFINE(evas_object_table_callbacks,
- { EFL_EVENT_DEL, _on_child_del },
- { EFL_GFX_EVENT_CHANGE_SIZE_HINTS, _on_child_hints_changed }
+ { EFL_EVENT_INVALIDATE, _on_child_invalidate },
+ { EFL_GFX_ENTITY_EVENT_CHANGE_SIZE_HINTS, _on_child_hints_changed }
);
static void
@@ -934,22 +934,22 @@ _evas_table_efl_canvas_group_group_del(Eo *obj, Evas_Table_Data *priv)
}
EOLIAN static void
-_evas_table_efl_gfx_size_set(Eo *obj, Evas_Table_Data *_pd EINA_UNUSED, Eina_Size2D sz)
+_evas_table_efl_gfx_entity_size_set(Eo *obj, Evas_Table_Data *_pd EINA_UNUSED, Eina_Size2D sz)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
- efl_gfx_size_set(efl_super(obj, MY_CLASS), sz);
+ efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
evas_object_smart_changed(obj);
}
EOLIAN static void
-_evas_table_efl_gfx_position_set(Eo *obj, Evas_Table_Data *_pd EINA_UNUSED, Eina_Position2D pos)
+_evas_table_efl_gfx_entity_position_set(Eo *obj, Evas_Table_Data *_pd EINA_UNUSED, Eina_Position2D pos)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
- efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
evas_object_smart_changed(obj);
}
@@ -982,7 +982,7 @@ evas_object_table_add(Evas *evas)
MAGIC_CHECK(evas, Evas, MAGIC_EVAS);
return NULL;
MAGIC_CHECK_END();
- return efl_add(MY_CLASS, evas, efl_canvas_object_legacy_ctor(efl_added));
+ return efl_add(MY_CLASS, evas_find(evas), efl_canvas_object_legacy_ctor(efl_added));
}
EOLIAN static Eo *
@@ -1019,7 +1019,7 @@ _evas_table_homogeneous_set(Eo *o, Evas_Table_Data *priv, Evas_Object_Table_Homo
}
EOLIAN static Evas_Object_Table_Homogeneous_Mode
-_evas_table_homogeneous_get(Eo *o EINA_UNUSED, Evas_Table_Data *priv)
+_evas_table_homogeneous_get(const Eo *o EINA_UNUSED, Evas_Table_Data *priv)
{
return priv->homogeneous;
}
@@ -1036,7 +1036,7 @@ _evas_table_align_set(Eo *o, Evas_Table_Data *priv, double horizontal, double ve
}
EOLIAN static void
-_evas_table_align_get(Eo *o EINA_UNUSED, Evas_Table_Data *priv, double *horizontal, double *vertical)
+_evas_table_align_get(const Eo *o EINA_UNUSED, Evas_Table_Data *priv, double *horizontal, double *vertical)
{
if (priv)
{
@@ -1062,7 +1062,7 @@ _evas_table_padding_set(Eo *o, Evas_Table_Data *priv, Evas_Coord horizontal, Eva
}
EOLIAN static void
-_evas_table_padding_get(Eo *o EINA_UNUSED, Evas_Table_Data *priv, Evas_Coord *horizontal, Evas_Coord *vertical)
+_evas_table_padding_get(const Eo *o EINA_UNUSED, Evas_Table_Data *priv, Evas_Coord *horizontal, Evas_Coord *vertical)
{
if (priv)
{
@@ -1323,7 +1323,7 @@ _evas_table_clear(Eo *o, Evas_Table_Data *priv, Eina_Bool clear)
}
EOLIAN static void
-_evas_table_col_row_size_get(Eo *o EINA_UNUSED, Evas_Table_Data *priv, int *cols, int *rows)
+_evas_table_col_row_size_get(const Eo *o EINA_UNUSED, Evas_Table_Data *priv, int *cols, int *rows)
{
if (priv)
{
@@ -1388,7 +1388,7 @@ _evas_table_accessor_new(const Eo *o, Evas_Table_Data *priv)
}
EOLIAN static Eina_List*
-_evas_table_children_get(Eo *o EINA_UNUSED, Evas_Table_Data *priv)
+_evas_table_children_get(const Eo *o EINA_UNUSED, Evas_Table_Data *priv)
{
Eina_List *new_list = NULL, *l;
Evas_Object_Table_Option *opt;
@@ -1406,7 +1406,7 @@ _evas_table_count(Eo *o EINA_UNUSED, Evas_Table_Data *priv)
}
EOLIAN static Evas_Object *
-_evas_table_child_get(Eo *o EINA_UNUSED, Evas_Table_Data *priv, unsigned short col, unsigned short row)
+_evas_table_child_get(const Eo *o EINA_UNUSED, Evas_Table_Data *priv, unsigned short col, unsigned short row)
{
Eina_List *l;
Evas_Object_Table_Option *opt;
@@ -1418,13 +1418,19 @@ _evas_table_child_get(Eo *o EINA_UNUSED, Evas_Table_Data *priv, unsigned short c
}
EOLIAN static Eina_Bool
-_evas_table_mirrored_get(Eo *o EINA_UNUSED, Evas_Table_Data *priv)
+_evas_table_efl_ui_base_mirrored_get(const Eo *o EINA_UNUSED, Evas_Table_Data *priv)
{
return priv->is_mirrored;
}
+EAPI Eina_Bool
+evas_object_table_mirrored_get(const Eo *obj)
+{
+ return efl_ui_mirrored_get(obj);
+}
+
EOLIAN static void
-_evas_table_mirrored_set(Eo *o, Evas_Table_Data *priv, Eina_Bool mirrored)
+_evas_table_efl_ui_base_mirrored_set(Eo *o, Evas_Table_Data *priv, Eina_Bool mirrored)
{
if (priv->is_mirrored != mirrored)
{
@@ -1433,6 +1439,12 @@ _evas_table_mirrored_set(Eo *o, Evas_Table_Data *priv, Eina_Bool mirrored)
}
}
+EAPI void
+evas_object_table_mirrored_set(Eo *obj, Eina_Bool mirrored)
+{
+ efl_ui_mirrored_set(obj, mirrored);
+}
+
EOLIAN static void
_evas_table_class_constructor(Efl_Class *klass)
{
diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c
index 5145be615d..315b7ce015 100644
--- a/src/lib/evas/canvas/evas_object_text.c
+++ b/src/lib/evas/canvas/evas_object_text.c
@@ -379,7 +379,7 @@ evas_object_text_add(Evas *e)
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
return NULL;
MAGIC_CHECK_END();
- return efl_add(EVAS_TEXT_CLASS, e, efl_canvas_object_legacy_ctor(efl_added));
+ return efl_add(EVAS_TEXT_CLASS, evas_find(e), efl_canvas_object_legacy_ctor(efl_added));
}
EOLIAN static Eo *
@@ -392,7 +392,7 @@ _evas_text_efl_object_constructor(Eo *eo_obj, Evas_Text_Data *o EINA_UNUSED)
}
EOLIAN static void
-_evas_text_efl_text_properties_font_source_set(Eo *eo_obj, Evas_Text_Data *o, const char *font_source)
+_evas_text_efl_text_font_font_source_set(Eo *eo_obj, Evas_Text_Data *o, const char *font_source)
{
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
if (((o->cur.source) && (font_source) &&
@@ -409,7 +409,7 @@ _evas_text_efl_text_properties_font_source_set(Eo *eo_obj, Evas_Text_Data *o, co
}
EOLIAN static const char*
-_evas_text_efl_text_properties_font_source_get(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o)
+_evas_text_efl_text_font_font_source_get(const Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o)
{
return o->cur.source;
}
@@ -433,11 +433,8 @@ _evas_text_font_reload(Eo *eo_obj, Evas_Text_Data *o)
}
/* DO IT */
- if (o->font)
- {
- evas_font_free(o->font);
- o->font = NULL;
- }
+ evas_font_free(o->font);
+ o->font = NULL;
o->font = evas_font_load(obj->layer->evas->font_path,
obj->layer->evas->hinting,
@@ -465,7 +462,7 @@ _evas_text_font_reload(Eo *eo_obj, Evas_Text_Data *o)
}
EOLIAN static void
-_evas_text_efl_text_properties_font_set(Eo *eo_obj, Evas_Text_Data *o, const char *font, Evas_Font_Size size)
+_evas_text_efl_text_font_font_set(Eo *eo_obj, Evas_Text_Data *o, const char *font, Evas_Font_Size size)
{
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
Evas_Font_Description *fdesc;
@@ -503,7 +500,7 @@ _evas_text_efl_text_properties_font_set(Eo *eo_obj, Evas_Text_Data *o, const cha
}
EOLIAN static void
-_evas_text_efl_text_properties_font_get(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o, const char **font, Evas_Font_Size *size)
+_evas_text_efl_text_font_font_get(const Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o, const char **font, Evas_Font_Size *size)
{
if (font) *font = o->cur.font;
if (size) *size = o->cur.size;
@@ -1006,7 +1003,7 @@ _evas_object_text_layout(Evas_Object *eo_obj, Evas_Text_Data *o, Eina_Unicode *t
}
EOLIAN static void
-_evas_text_efl_gfx_size_set(Eo *eo_obj, Evas_Text_Data *o, Eina_Size2D sz)
+_evas_text_efl_gfx_entity_size_set(Eo *eo_obj, Evas_Text_Data *o, Eina_Size2D sz)
{
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
@@ -1041,7 +1038,7 @@ _evas_text_ellipsis_set(Eo *eo_obj, Evas_Text_Data *o, double ellipsis)
}
EOLIAN static double
-_evas_text_ellipsis_get(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o)
+_evas_text_ellipsis_get(const Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o)
{
return o->cur.ellipsis;
}
@@ -1054,11 +1051,11 @@ _evas_text_efl_object_dbg_info_get(Eo *eo_obj, Evas_Text_Data *o EINA_UNUSED, Ef
const char *text;
int size;
- efl_text_properties_font_get(eo_obj, &text, &size);
+ efl_text_font_get(eo_obj, &text, &size);
EFL_DBG_INFO_APPEND(group, "Font", EINA_VALUE_TYPE_STRING, text);
EFL_DBG_INFO_APPEND(group, "Text size", EINA_VALUE_TYPE_INT, size);
- text = efl_text_properties_font_source_get(eo_obj);
+ text = efl_text_font_source_get(eo_obj);
EFL_DBG_INFO_APPEND(group, "Font source", EINA_VALUE_TYPE_STRING, text);
text = efl_text_get(eo_obj);
@@ -1112,19 +1109,19 @@ _evas_text_bidi_delimiters_set(Eo *eo_obj, Evas_Text_Data *o, const char *delim)
}
EOLIAN static const char*
-_evas_text_bidi_delimiters_get(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o)
+_evas_text_bidi_delimiters_get(const Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o)
{
return o->bidi_delimiters;
}
EOLIAN static const char*
-_evas_text_efl_text_text_get(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o)
+_evas_text_efl_text_text_get(const Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o)
{
return o->cur.utf8_text;
}
EOLIAN static Evas_BiDi_Direction
-_evas_text_direction_get(Eo *eo_obj, Evas_Text_Data *o)
+_evas_text_direction_get(const Eo *eo_obj, Evas_Text_Data *o)
{
#ifdef BIDI_SUPPORT
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
@@ -1145,9 +1142,10 @@ _evas_text_direction_get(Eo *eo_obj, Evas_Text_Data *o)
if (o->changed_paragraph_direction)
{
- _evas_object_text_recalc(eo_obj, o->cur.text);
+ /* XXX const? */
+ _evas_object_text_recalc((Evas_Object *)eo_obj, o->cur.text);
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
- eo_obj, obj);
+ (Evas_Object *)eo_obj, obj);
}
#endif
@@ -1155,31 +1153,31 @@ _evas_text_direction_get(Eo *eo_obj, Evas_Text_Data *o)
}
EOLIAN static Evas_Coord
-_evas_text_ascent_get(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o)
+_evas_text_ascent_get(const Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o)
{
return o->ascent;
}
EOLIAN static Evas_Coord
-_evas_text_descent_get(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o)
+_evas_text_descent_get(const Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o)
{
return o->descent;
}
EOLIAN static Evas_Coord
-_evas_text_max_ascent_get(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o)
+_evas_text_max_ascent_get(const Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o)
{
return o->max_ascent;
}
EOLIAN static Evas_Coord
-_evas_text_max_descent_get(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o)
+_evas_text_max_descent_get(const Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o)
{
return o->max_descent;
}
EOLIAN static Evas_Coord
-_evas_text_inset_get(Eo *eo_obj, Evas_Text_Data *o)
+_evas_text_inset_get(const Eo *eo_obj, Evas_Text_Data *o)
{
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
Evas_Coord inset = 0;
@@ -1191,7 +1189,7 @@ _evas_text_inset_get(Eo *eo_obj, Evas_Text_Data *o)
}
EOLIAN static Evas_Coord
-_evas_text_horiz_advance_get(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o)
+_evas_text_horiz_advance_get(const Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o)
{
Evas_Coord horiz = 0;
if (!o->font) return horiz;
@@ -1202,7 +1200,7 @@ _evas_text_horiz_advance_get(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o)
}
EOLIAN static Evas_Coord
-_evas_text_vert_advance_get(Eo *eo_obj, Evas_Text_Data *o)
+_evas_text_vert_advance_get(const Eo *eo_obj, Evas_Text_Data *o)
{
Evas_Coord vert;
vert = 0;
@@ -1334,12 +1332,12 @@ _evas_text_style_set(Eo *eo_obj, Evas_Text_Data *o, Evas_Text_Style_Type style)
if (o->items) w = obj->cur->geometry.w + (l - pl) + (r - pr);
h = obj->cur->geometry.h + (t - pt) + (b - pb);
- efl_gfx_size_set(efl_super(eo_obj, MY_CLASS), EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(efl_super(eo_obj, MY_CLASS), EINA_SIZE2D(w, h));
evas_object_change(eo_obj, obj);
}
EOLIAN static Evas_Text_Style_Type
-_evas_text_style_get(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o)
+_evas_text_style_get(const Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o)
{
return o->cur.style;
}
@@ -1361,7 +1359,7 @@ _evas_text_shadow_color_set(Eo *eo_obj, Evas_Text_Data *o, int r, int g, int b,
}
EOLIAN static void
-_evas_text_shadow_color_get(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o, int *r, int *g, int *b, int *a)
+_evas_text_shadow_color_get(const Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o, int *r, int *g, int *b, int *a)
{
if (r) *r = o->cur.shadow.r;
if (g) *g = o->cur.shadow.g;
@@ -1386,7 +1384,7 @@ _evas_text_glow_color_set(Eo *eo_obj, Evas_Text_Data *o, int r, int g, int b, in
}
EOLIAN static void
-_evas_text_glow_color_get(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o, int *r, int *g, int *b, int *a)
+_evas_text_glow_color_get(const Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o, int *r, int *g, int *b, int *a)
{
if (r) *r = o->cur.glow.r;
if (g) *g = o->cur.glow.g;
@@ -1411,7 +1409,7 @@ _evas_text_glow2_color_set(Eo *eo_obj, Evas_Text_Data *o, int r, int g, int b, i
}
EOLIAN static void
-_evas_text_glow2_color_get(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o, int *r, int *g, int *b, int *a)
+_evas_text_glow2_color_get(const Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o, int *r, int *g, int *b, int *a)
{
if (r) *r = o->cur.glow2.r;
if (g) *g = o->cur.glow2.g;
@@ -1436,7 +1434,7 @@ _evas_text_outline_color_set(Eo *eo_obj, Evas_Text_Data *o, int r, int g, int b,
}
EOLIAN static void
-_evas_text_outline_color_get(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o, int *r, int *g, int *b, int *a)
+_evas_text_outline_color_get(const Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o, int *r, int *g, int *b, int *a)
{
if (r) *r = o->cur.outline.r;
if (g) *g = o->cur.outline.g;
@@ -1445,7 +1443,7 @@ _evas_text_outline_color_get(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o, int *r,
}
EOLIAN static void
-_evas_text_style_pad_get(Eo *eo_obj, Evas_Text_Data *o, int *l, int *r, int *t, int *b)
+_evas_text_style_pad_get(const Eo *eo_obj, Evas_Text_Data *o, int *l, int *r, int *t, int *b)
{
_evas_object_text_pad_get(eo_obj, o, l, r, t, b);
}
@@ -1655,7 +1653,7 @@ evas_object_text_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
if (o->cur.source) eina_stringshare_del(o->cur.source);
if (o->bidi_delimiters) eina_stringshare_del(o->bidi_delimiters);
if (o->cur.text) free(o->cur.text);
- if (o->font && obj->layer && obj->layer->evas)
+ if (obj->layer && obj->layer->evas)
evas_font_free(o->font);
o->font = NULL;
o->cur.utf8_text = NULL;
@@ -2214,14 +2212,14 @@ evas_object_text_was_opaque(Evas_Object *eo_obj EINA_UNUSED,
}
EOLIAN static void
-_evas_text_efl_gfx_scale_set(Evas_Object *eo_obj, Evas_Text_Data *o,
+_evas_text_efl_gfx_entity_scale_set(Evas_Object *eo_obj, Evas_Text_Data *o,
double scale)
{
int size;
const char *font;
- if (EINA_DBL_EQ(efl_gfx_scale_get(eo_obj), scale)) return;
- efl_gfx_scale_set(efl_super(eo_obj, MY_CLASS), scale);
+ if (EINA_DBL_EQ(efl_gfx_entity_scale_get(eo_obj), scale)) return;
+ efl_gfx_entity_scale_set(efl_super(eo_obj, MY_CLASS), scale);
font = eina_stringshare_add(o->cur.font);
size = o->cur.size;
@@ -2323,11 +2321,11 @@ _evas_object_text_recalc(Evas_Object *eo_obj, Eina_Unicode *text)
int min;
min = w + l + r < obj->cur->geometry.w || obj->cur->geometry.w == 0 ? w + l + r : obj->cur->geometry.w;
- efl_gfx_size_set(efl_super(eo_obj, MY_CLASS), EINA_SIZE2D(min, h + t + b));
+ efl_gfx_entity_size_set(efl_super(eo_obj, MY_CLASS), EINA_SIZE2D(min, h + t + b));
}
else
{
- efl_gfx_size_set(efl_super(eo_obj, MY_CLASS), EINA_SIZE2D(w + l + r, h + t + b));
+ efl_gfx_entity_size_set(efl_super(eo_obj, MY_CLASS), EINA_SIZE2D(w + l + r, h + t + b));
}
//// obj->cur->cache.geometry.validity = 0;
}
@@ -2335,7 +2333,7 @@ _evas_object_text_recalc(Evas_Object *eo_obj, Eina_Unicode *text)
{
int t = 0, b = 0, l = 0, r = 0;
_evas_object_text_pad_get(eo_obj, o, &l, &r, &t, &b);
- efl_gfx_size_set(efl_super(eo_obj, MY_CLASS), EINA_SIZE2D(0, o->max_ascent + o->max_descent + t + b));
+ efl_gfx_entity_size_set(efl_super(eo_obj, MY_CLASS), EINA_SIZE2D(0, o->max_ascent + o->max_descent + t + b));
//// obj->cur->cache.geometry.validity = 0;
}
o->last_computed.w = obj->cur->geometry.w;
@@ -2348,27 +2346,27 @@ _evas_object_text_recalc(Evas_Object *eo_obj, Eina_Unicode *text)
EAPI void
evas_object_text_font_source_set(Eo *obj, const char *font_source)
{
- efl_text_properties_font_source_set((Eo *) obj, font_source);
+ efl_text_font_source_set((Eo *) obj, font_source);
}
EAPI const char *
evas_object_text_font_source_get(const Eo *obj)
{
const char *font_source = 0;
- font_source = efl_text_properties_font_source_get((Eo *) obj);
+ font_source = efl_text_font_source_get((Eo *) obj);
return font_source;
}
EAPI void
evas_object_text_font_set(Eo *obj, const char *font, Evas_Font_Size size)
{
- efl_text_properties_font_set((Eo *) obj, font, size);
+ efl_text_font_set((Eo *) obj, font, size);
}
EAPI void
evas_object_text_font_get(const Eo *obj, const char **font, Evas_Font_Size *size)
{
- efl_text_properties_font_get((Eo *) obj, font, size);
+ efl_text_font_get((Eo *) obj, font, size);
}
EAPI void
@@ -2445,7 +2443,7 @@ _evas_text_efl_canvas_object_paragraph_direction_set(Eo *eo_obj, Evas_Text_Data
}
EOLIAN static Evas_BiDi_Direction
-_evas_text_efl_canvas_object_paragraph_direction_get(Eo *eo_obj EINA_UNUSED,
+_evas_text_efl_canvas_object_paragraph_direction_get(const Eo *eo_obj EINA_UNUSED,
Evas_Text_Data *o)
{
return o->paragraph_direction;
@@ -2461,7 +2459,7 @@ _evas_text_efl_text_font_font_bitmap_scalable_set(Eo *eo_obj, Evas_Text_Data *o,
}
EOLIAN static Efl_Text_Font_Bitmap_Scalable
-_evas_text_efl_text_font_font_bitmap_scalable_get(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o)
+_evas_text_efl_text_font_font_bitmap_scalable_get(const Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o)
{
return o->cur.bitmap_scalable;
}
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c
index 70c5618390..f523f131e9 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -606,7 +606,6 @@ struct _Evas_Object_Textblock
Evas_Object_Textblock_Paragraph *par_index[TEXTBLOCK_PAR_INDEX_SIZE];
Evas_Object_Textblock_Text_Item *ellip_ti;
- Eina_List *ellip_prev_it; /* item that is placed before ellipsis item (0.0 <= ellipsis < 1.0), if required */
Eina_List *anchors_a;
Eina_List *anchors_item;
Eina_List *obstacles;
@@ -766,6 +765,7 @@ static Eina_Bool _evas_textblock_cursor_format_is_visible_get(const Efl_Text_Cur
static void _evas_textblock_cursor_at_format_set(Efl_Text_Cursor_Cursor *cur, const Evas_Object_Textblock_Node_Format *fmt);
static void _evas_textblock_cursor_init(Efl_Text_Cursor_Cursor *cur, const Evas_Object *tb);
static Evas_Filter_Program *_format_filter_program_get(Efl_Canvas_Text_Data *o, Evas_Object_Textblock_Format *fmt);
+static const char *_textblock_format_node_from_style_tag(Efl_Canvas_Text_Data *o, Evas_Object_Textblock_Node_Format *fnode, const char *format, size_t format_len);
#ifdef HAVE_HYPHEN
/* Hyphenation */
#include "evas_textblock_hyphenation.x"
@@ -2886,6 +2886,7 @@ struct _Ctxt
Evas_Object_Textblock_Format *fmt;
Eina_List *obs_infos; /**< Extra information for items in current line. */
+ Eina_List *ellip_prev_it; /* item that is placed before ellipsis item (0.0 <= ellipsis < 1.0), if required */
int x, y;
int w, h;
@@ -3152,13 +3153,18 @@ _layout_find_paragraph_by_line_no(Efl_Canvas_Text_Data *o, int line_no)
* @param c The context to work on - Not NULL.
* @param n the associated text node
* @param append true to append, false to prpend.
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
*/
-static void
+static Eina_Bool
_layout_paragraph_new(Ctxt *c, Evas_Object_Textblock_Node_Text *n,
Eina_Bool append)
{
Evas_Object_Textblock_Paragraph *rel_par = c->par;
- c->par = calloc(1, sizeof(Evas_Object_Textblock_Paragraph));
+ Evas_Object_Textblock_Paragraph *new_par = calloc(1, sizeof(Evas_Object_Textblock_Paragraph));
+
+ if (!new_par) return EINA_FALSE;
+ c->par = new_par;
+
if (append || !rel_par)
c->paragraphs = (Evas_Object_Textblock_Paragraph *)
eina_inlist_append_relative(EINA_INLIST_GET(c->paragraphs),
@@ -3177,6 +3183,8 @@ _layout_paragraph_new(Ctxt *c, Evas_Object_Textblock_Node_Text *n,
c->par->line_no = -1;
c->par->visible = 1;
c->o->num_paragraphs++;
+
+ return EINA_TRUE;
}
#ifdef BIDI_SUPPORT
@@ -4567,7 +4575,7 @@ _format_finalize(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt)
fmt->font.source,
(int)(((double) fmt->font.size) * obj->cur->scale),
fmt->font.bitmap_scalable);
- if (of) evas_font_free(of);
+ evas_font_free(of);
}
static Efl_Canvas_Text_Filter_Program *
@@ -5464,7 +5472,7 @@ _layout_par_ellipsis_items(Ctxt *c, double ellip)
Evas_Coord l, h, off;
int pos;
- c->o->ellip_prev_it = NULL;
+ c->ellip_prev_it = NULL;
/* calc exceed amount */
items_width = _calc_items_width(c);
@@ -5493,7 +5501,7 @@ _layout_par_ellipsis_items(Ctxt *c, double ellip)
break;
off += it->adv;
}
- c->o->ellip_prev_it = i;
+ c->ellip_prev_it = i;
if (it) ellip_ti = _layout_ellipsis_item_new(c, it);
@@ -5680,7 +5688,7 @@ _layout_par(Ctxt *c)
((it->type == EVAS_TEXTBLOCK_ITEM_TEXT) && !it->format->font.font))
{
//one more chance for ellipsis special cases
- if (c->o->ellip_prev_it == i)
+ if (c->ellip_prev_it == i)
_layout_par_append_ellipsis(c);
i = eina_list_next(i);
@@ -6013,7 +6021,7 @@ _layout_par(Ctxt *c)
}
}
if (!obs_info) c->x += it->adv;
- if (c->o->ellip_prev_it == i)
+ if (c->ellip_prev_it == i)
_layout_par_append_ellipsis(c);
i = eina_list_next(i);
item_preadv = EINA_FALSE;
@@ -6323,7 +6331,8 @@ _layout_pre(Ctxt *c)
else
{
/* If it's a new paragraph, just add it. */
- _layout_paragraph_new(c, n, EINA_FALSE);
+ if (!_layout_paragraph_new(c, n, EINA_FALSE))
+ break;
}
#ifdef BIDI_SUPPORT
@@ -6428,7 +6437,7 @@ _layout_pre(Ctxt *c)
* if the last paragraph has no lines/text, create that as well */
if (!c->paragraphs)
{
- _layout_paragraph_new(c, NULL, EINA_TRUE);
+ if (!_layout_paragraph_new(c, NULL, EINA_TRUE)) return;
o->paragraphs = c->paragraphs;
}
c->par = (Evas_Object_Textblock_Paragraph *)
@@ -6536,19 +6545,22 @@ _layout_visual(Ctxt *c)
}
}
- c->par = (Evas_Object_Textblock_Paragraph *)
- EINA_INLIST_GET(c->par)->next;
- while (c->par)
+ if (c->par)
{
- c->par->visible = 0;
- _paragraph_clear(c->evas, c->o, c->evas_o, c->par);
c->par = (Evas_Object_Textblock_Paragraph *)
EINA_INLIST_GET(c->par)->next;
+ while (c->par)
+ {
+ c->par->visible = 0;
+ _paragraph_clear(c->evas, c->o, c->evas_o, c->par);
+ c->par = (Evas_Object_Textblock_Paragraph *)
+ EINA_INLIST_GET(c->par)->next;
+ }
}
}
/* Get the last visible paragraph in the layout */
- if (!last_vis_par && c->paragraphs)
+ if (!last_vis_par)
last_vis_par = (Evas_Object_Textblock_Paragraph *)
EINA_INLIST_GET(c->paragraphs)->last;
@@ -6639,6 +6651,7 @@ _layout_setup(Ctxt *c, const Eo *eo_obj, Evas_Coord w, Evas_Coord h)
c->h = h;
c->style_pad.r = c->style_pad.l = c->style_pad.t = c->style_pad.b = 0;
c->vertical_ellipsis = EINA_FALSE;
+ c->ellip_prev_it = NULL;
/* Update all obstacles */
if (c->o->obstacle_changed || c->width_changed)
@@ -6762,12 +6775,13 @@ _relayout(const Evas_Object *eo_obj)
* Check if the object needs a relayout, and if so, execute it.
*/
static Eina_Bool
-_relayout_if_needed(Evas_Object *eo_obj, Efl_Canvas_Text_Data *o)
+_relayout_if_needed(const Evas_Object *eo_obj, Efl_Canvas_Text_Data *o)
{
ASYNC_BLOCK;
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
- evas_object_textblock_coords_recalc(eo_obj, obj, obj->private_data);
+ /* XXX const */
+ evas_object_textblock_coords_recalc((Evas_Object *)eo_obj, obj, obj->private_data);
if (o->formatted.valid)
{
return EINA_TRUE;
@@ -6942,6 +6956,47 @@ evas_textblock_style_free(Evas_Textblock_Style *ts)
free(ts);
}
+static void
+_evas_textblock_update_format_nodes_from_style_tag(Efl_Canvas_Text_Data *o)
+{
+ Evas_Object_Textblock_Node_Format *fnode = o->format_nodes;
+
+ if (!o)
+ {
+ ERR("The given address Efl_Canvas_Text_Data is NULL");
+ return;
+ }
+
+ while (fnode)
+ {
+ const char *match;
+ size_t format_len = eina_stringshare_strlen(fnode->orig_format);
+ /* Is this safe to use alloca here? Strings might possibly get large */
+
+ if (fnode->own_closer &&
+ (format_len > 0) && (fnode->orig_format[format_len - 1] == '/'))
+ {
+ format_len--;
+ }
+
+ match = _textblock_format_node_from_style_tag(o, fnode, fnode->orig_format,
+ format_len);
+
+ if (match && fnode->format && strcmp(match, fnode->format))
+ {
+ if ((*match == '+') || (*match == '-'))
+ {
+ match++;
+ while (*match == ' ') match++;
+ }
+ fnode->is_new = EINA_TRUE;
+ eina_stringshare_replace(&fnode->format, match);
+ }
+
+ fnode = _NODE_FORMAT(EINA_INLIST_GET(fnode)->next);
+ }
+}
+
EAPI void
evas_textblock_style_set(Evas_Textblock_Style *ts, const char *text)
{
@@ -6956,11 +7011,8 @@ evas_textblock_style_set(Evas_Textblock_Style *ts, const char *text)
EINA_LIST_FOREACH(ts->objects, l, eo_obj)
{
- Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
evas_object_async_block(obj);
- _evas_textblock_invalidate_all(o);
- _evas_textblock_changed(o, eo_obj);
}
_style_replace(ts, text);
@@ -7083,6 +7135,14 @@ evas_textblock_style_set(Evas_Textblock_Style *ts, const char *text)
p++;
}
}
+
+ EINA_LIST_FOREACH(ts->objects, l, eo_obj)
+ {
+ Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
+ _evas_textblock_update_format_nodes_from_style_tag(o);
+ _evas_textblock_invalidate_all(o);
+ _evas_textblock_changed(o, eo_obj);
+ }
}
EAPI const char *
@@ -7155,34 +7215,7 @@ _textblock_style_generic_set(Evas_Object *eo_obj, Evas_Textblock_Style *ts,
}
*obj_ts = ts;
- Evas_Object_Textblock_Node_Format *fnode = o->format_nodes;
- while (fnode)
- {
- const char *match;
- size_t format_len = eina_stringshare_strlen(fnode->orig_format);
- /* Is this safe to use alloca here? Strings might possibly get large */
-
- if (fnode->own_closer &&
- (format_len > 0) && (fnode->orig_format[format_len - 1] == '/'))
- {
- format_len--;
- }
-
- match = _textblock_format_node_from_style_tag(o, fnode, fnode->orig_format,
- format_len);
-
- if (match && fnode->format && strcmp(match, fnode->format))
- {
- if ((*match == '+') || (*match == '-'))
- {
- match++;
- while (*match == ' ') match++;
- }
- fnode->is_new = EINA_TRUE;
- eina_stringshare_replace(&fnode->format, match);
- }
- fnode = _NODE_FORMAT(EINA_INLIST_GET(fnode)->next);
- }
+ _evas_textblock_update_format_nodes_from_style_tag(o);
o->format_changed = EINA_TRUE;
_evas_textblock_invalidate_all(o);
@@ -7192,6 +7225,7 @@ _textblock_style_generic_set(Evas_Object *eo_obj, Evas_Textblock_Style *ts,
EAPI void
evas_object_textblock_style_set(Eo *eo_obj, const Evas_Textblock_Style *ts)
{
+ EINA_SAFETY_ON_NULL_RETURN(eo_obj);
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
evas_object_async_block(obj);
Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
@@ -7216,6 +7250,16 @@ _style_by_key_find(Efl_Canvas_Text_Data *o, const char *key)
return NULL;
}
+static void
+_style_remove_from_obj(Eo *eo_obj, Efl_Canvas_Text_Data *o, Evas_Textblock_Style *ts, Eina_Bool style_free)
+{
+ o->styles = eina_list_remove(o->styles, ts);
+ ts->objects = eina_list_remove(ts->objects, eo_obj);
+
+ if (style_free || (ts->delete_me && !ts->objects))
+ evas_textblock_style_free(ts);
+}
+
EOLIAN static void
_efl_canvas_text_style_set(Eo *eo_obj, Efl_Canvas_Text_Data *o, const char *key, const char *style)
{
@@ -7241,9 +7285,7 @@ _efl_canvas_text_style_set(Eo *eo_obj, Efl_Canvas_Text_Data *o, const char *key,
}
else
{
- o->styles = eina_list_remove(o->styles, ts);
- ts->objects = eina_list_remove(ts->objects, eo_obj);
- evas_textblock_style_free(ts);
+ _style_remove_from_obj(eo_obj, o, ts, EINA_TRUE);
}
}
else if (!ts && style)
@@ -7254,7 +7296,14 @@ _efl_canvas_text_style_set(Eo *eo_obj, Efl_Canvas_Text_Data *o, const char *key,
ts = evas_textblock_style_new();
evas_textblock_style_set(ts, style);
ts->key = eina_stringshare_add(key);
- o->styles = eina_list_append(o->styles, ts);
+
+ /* If the given key value is NULL, newly created Evas Textblock Style
+ * has to be assigned to o->style. */
+ if (ts->key)
+ o->styles = eina_list_append(o->styles, ts);
+ else
+ o->style = ts;
+
_textblock_style_generic_set(eo_obj, ts, &tmp);
}
else if (ts && style)
@@ -7269,8 +7318,9 @@ _efl_canvas_text_style_set(Eo *eo_obj, Efl_Canvas_Text_Data *o, const char *key,
}
EAPI Evas_Textblock_Style *
-evas_object_textblock_style_get(const Eo *eo_obj EINA_UNUSED)
+evas_object_textblock_style_get(const Eo *eo_obj)
{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(eo_obj, NULL);
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
evas_object_async_block(obj);
Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
@@ -7278,7 +7328,7 @@ evas_object_textblock_style_get(const Eo *eo_obj EINA_UNUSED)
}
EOLIAN static const char *
-_efl_canvas_text_style_get(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o, const char *key)
+_efl_canvas_text_style_get(const Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o, const char *key)
{
Evas_Textblock_Style *ts = _style_by_key_find(o, key);
@@ -7289,44 +7339,68 @@ _efl_canvas_text_style_get(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o, cons
EAPI void
evas_object_textblock_style_user_push(Eo *eo_obj, Evas_Textblock_Style *ts)
{
- Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
+ EINA_SAFETY_ON_NULL_RETURN(eo_obj);
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
evas_object_async_block(obj);
+ Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
+ Evas_Textblock_Style *old_ts, *tmp = NULL;
- Evas_Textblock_Style *old_ts = _style_by_key_find(o, _STYLE_USER);
+ old_ts = _style_by_key_find(o, _STYLE_USER);
+
+ if (old_ts == ts) return;
if (old_ts)
+ _style_remove_from_obj(eo_obj, o, old_ts, EINA_FALSE);
+
+ if (ts)
{
- efl_canvas_text_style_set(eo_obj, _STYLE_USER, NULL);
+ _textblock_style_generic_set(eo_obj, ts, &tmp);
+ ts->key = eina_stringshare_add(_STYLE_USER);
+ o->styles = eina_list_append(o->styles, ts);
}
- Evas_Textblock_Style *tmp = NULL;
- _textblock_style_generic_set(eo_obj, ts, &tmp);
- ts->key = eina_stringshare_add(_STYLE_USER);
- o->styles = eina_list_append(o->styles, ts);
+
+ o->format_changed = EINA_TRUE;
+ _evas_textblock_invalidate_all(o);
+ _evas_textblock_changed(o, eo_obj);
+ efl_event_callback_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CHANGED, NULL);
}
EAPI const Evas_Textblock_Style*
evas_object_textblock_style_user_peek(const Eo *eo_obj)
{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(eo_obj, NULL);
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
evas_object_async_block(obj);
Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
Evas_Textblock_Style *ts = _style_by_key_find(o, _STYLE_USER);
+
return ts;
}
EAPI void
evas_object_textblock_style_user_pop(Eo *eo_obj)
{
+ EINA_SAFETY_ON_NULL_RETURN(eo_obj);
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
evas_object_async_block(obj);
+ Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
+ Evas_Textblock_Style *ts = _style_by_key_find(o, _STYLE_USER);
- efl_canvas_text_style_set(eo_obj, _STYLE_USER, NULL);
+ if (ts)
+ {
+ _style_remove_from_obj(eo_obj, o, ts, EINA_FALSE);
+
+ o->format_changed = EINA_TRUE;
+ _evas_textblock_invalidate_all(o);
+ _evas_textblock_changed(o, eo_obj);
+ efl_event_callback_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CHANGED, NULL);
+ }
}
EAPI void
evas_object_textblock_replace_char_set(Efl_Canvas_Text *eo_obj, const char *ch)
{
+ EINA_SAFETY_ON_NULL_RETURN(eo_obj);
Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
evas_object_async_block(obj);
@@ -7352,13 +7426,13 @@ _efl_canvas_text_legacy_newline_set(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data
}
EOLIAN static Eina_Bool
-_efl_canvas_text_legacy_newline_get(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o)
+_efl_canvas_text_legacy_newline_get(const Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o)
{
return o->legacy_newline;
}
EOLIAN static Eina_Bool
-_efl_canvas_text_is_empty_get(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o)
+_efl_canvas_text_is_empty_get(const Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o)
{
return !o->text_nodes || (eina_ustrbuf_length_get(o->text_nodes->unicode) == 0);
}
@@ -7366,6 +7440,7 @@ _efl_canvas_text_is_empty_get(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o)
EAPI void
evas_object_textblock_valign_set(Efl_Canvas_Text *eo_obj, double align)
{
+ EINA_SAFETY_ON_NULL_RETURN(eo_obj);
Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
evas_object_async_block(obj);
@@ -7379,6 +7454,7 @@ evas_object_textblock_valign_set(Efl_Canvas_Text *eo_obj, double align)
EAPI double
evas_object_textblock_valign_get(const Efl_Canvas_Text *obj)
{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(obj, 0.0);
Efl_Canvas_Text_Data *o = efl_data_scope_get(obj, MY_CLASS);
return o->valign;
}
@@ -7392,7 +7468,7 @@ _efl_canvas_text_bidi_delimiters_set(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Dat
}
EOLIAN static const char*
-_efl_canvas_text_bidi_delimiters_get(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o)
+_efl_canvas_text_bidi_delimiters_get(const Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o)
{
return o->bidi_delimiters;
}
@@ -7400,6 +7476,7 @@ _efl_canvas_text_bidi_delimiters_get(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Dat
EAPI const char *
evas_object_textblock_replace_char_get(const Efl_Canvas_Text *obj)
{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
Efl_Canvas_Text_Data *o = efl_data_scope_get(obj, MY_CLASS);
return o->repch;
}
@@ -7668,6 +7745,7 @@ _evas_object_textblock_text_markup_set(Eo *eo_obj, Efl_Canvas_Text_Data *o,
EAPI void
evas_object_textblock_text_markup_set(Eo *eo_obj, const char *text)
{
+ EINA_SAFETY_ON_NULL_RETURN(eo_obj);
Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
_evas_object_textblock_text_markup_set(eo_obj, o, text);
}
@@ -7809,6 +7887,7 @@ _evas_object_textblock_text_markup_prepend(Eo *eo_obj,
EAPI void
evas_object_textblock_text_markup_prepend(Efl_Text_Cursor_Cursor *cur, const char *text)
{
+ EINA_SAFETY_ON_NULL_RETURN(cur);
_evas_object_textblock_text_markup_prepend(cur->obj, cur, text);
}
@@ -7902,7 +7981,7 @@ _markup_get_text_append(Eina_Strbuf *txt, const Eina_Unicode *text)
free(base);
}
static const char*
-_evas_object_textblock_text_markup_get(Eo *eo_obj, Efl_Canvas_Text_Data *o)
+_evas_object_textblock_text_markup_get(const Eo *eo_obj, Efl_Canvas_Text_Data *o)
{
Evas_Object_Textblock_Node_Text *n;
Eina_Strbuf *txt = NULL;
@@ -7973,12 +8052,13 @@ _evas_object_textblock_text_markup_get(Eo *eo_obj, Efl_Canvas_Text_Data *o)
EAPI const char*
evas_object_textblock_text_markup_get(Eo *eo_obj)
{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(eo_obj, NULL);
Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
return _evas_object_textblock_text_markup_get(eo_obj, o);
}
EOLIAN const char*
-_efl_canvas_text_efl_text_markup_markup_get(Eo *eo_obj, Efl_Canvas_Text_Data *o)
+_efl_canvas_text_efl_text_markup_markup_get(const Eo *eo_obj, Efl_Canvas_Text_Data *o)
{
return _evas_object_textblock_text_markup_get(eo_obj, o);
}
@@ -7993,7 +8073,6 @@ evas_textblock_text_markup_to_utf8(const Evas_Object *eo_obj, const char *text)
if (!text) return NULL;
-
tag_start = tag_end = esc_start = esc_end = NULL;
sbuf = eina_strbuf_new();
p = (char *)text;
@@ -8168,8 +8247,8 @@ _obstacle_update(Evas_Textblock_Obstacle *obs, Eo *eo_obj)
Eina_Rect tb_geom, obs_geom;
Eo *eo_obs = obs->eo_obs;
- obs_geom = efl_gfx_geometry_get(eo_obs);
- tb_geom = efl_gfx_geometry_get(eo_obj);
+ obs_geom = efl_gfx_entity_geometry_get(eo_obs);
+ tb_geom = efl_gfx_entity_geometry_get(eo_obj);
obs->x = obs_geom.x - tb_geom.x;
obs->y = obs_geom.y - tb_geom.y;
@@ -8313,7 +8392,7 @@ _layout_item_obstacle_get(Ctxt *c, Evas_Object_Textblock_Item *it)
EINA_LIST_FOREACH(c->o->obstacles, i, obs)
{
Eina_Bool is_visible;
- is_visible = efl_gfx_visible_get(obs->eo_obs);
+ is_visible = efl_gfx_entity_visible_get(obs->eo_obs);
if (!is_visible)
continue;
if ((obs->y < c->y + it->h) &&
@@ -8685,6 +8764,7 @@ evas_textblock_cursor_is_format(const Evas_Textblock_Cursor *cur)
EAPI const Eina_List *
evas_textblock_node_format_list_get(const Eo *eo_obj, const char *anchor)
{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(eo_obj, NULL);
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
evas_object_async_block(obj);
Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
@@ -8698,6 +8778,7 @@ evas_textblock_node_format_list_get(const Eo *eo_obj, const char *anchor)
EAPI const Evas_Object_Textblock_Node_Format*
evas_textblock_node_format_first_get(Evas_Object *eo_obj)
{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(eo_obj, NULL);
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
evas_object_async_block(obj);
Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
@@ -8707,6 +8788,7 @@ evas_textblock_node_format_first_get(Evas_Object *eo_obj)
EAPI const Evas_Object_Textblock_Node_Format*
evas_textblock_node_format_last_get(Evas_Object *eo_obj)
{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(eo_obj, NULL);
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
evas_object_async_block(obj);
Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
@@ -8730,6 +8812,7 @@ evas_textblock_node_format_prev_get(const Evas_Object_Textblock_Node_Format *n)
EAPI void
evas_textblock_node_format_remove_pair(Eo *eo_obj, Evas_Object_Textblock_Node_Format *n)
{
+ EINA_SAFETY_ON_NULL_RETURN(eo_obj);
Evas_Object_Textblock_Node_Text *tnode1;
Evas_Object_Textblock_Node_Format *fmt, *found_node = NULL;
Eina_List *fstack = NULL;
@@ -9866,7 +9949,7 @@ _evas_textblock_node_format_pos_get(const Evas_Object_Textblock_Node_Format *fmt
}
EOLIAN static int
-_efl_canvas_text_efl_text_cursor_cursor_position_get(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur)
+_efl_canvas_text_efl_text_cursor_cursor_position_get(const Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur)
{
ASYNC_BLOCK;
Evas_Object_Textblock_Node_Text *n;
@@ -10753,7 +10836,7 @@ _evas_textblock_cursor_format_append(Efl_Text_Cursor_Cursor *cur,
Eina_Unicode insert_char;
/* Insert a visual representation according to the type of the
format */
- if (_IS_PARAGRAPH_SEPARATOR(o, format))
+ if (_IS_PARAGRAPH_SEPARATOR_SIMPLE(format))
insert_char = _PARAGRAPH_SEPARATOR;
else if (_IS_LINE_SEPARATOR(format))
insert_char = _NEWLINE;
@@ -11024,7 +11107,7 @@ _efl_canvas_text_range_delete(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *pd E
}
EOLIAN static Eina_Unicode
-_efl_canvas_text_efl_text_cursor_cursor_content_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED,
+_efl_canvas_text_efl_text_cursor_cursor_content_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED,
const Efl_Text_Cursor_Cursor *cur)
{
ASYNC_BLOCK;
@@ -11328,7 +11411,7 @@ evas_textblock_cursor_range_text_get(const Efl_Text_Cursor_Cursor *cur1, const E
}
EOLIAN static char *
-_efl_canvas_text_range_text_get(Eo *eo_obj EINA_UNUSED,
+_efl_canvas_text_range_text_get(const Eo *eo_obj EINA_UNUSED,
Efl_Canvas_Text_Data *pd EINA_UNUSED,
const Efl_Text_Cursor_Cursor *cur1,
const Evas_Textblock_Cursor *cur2)
@@ -11493,7 +11576,7 @@ evas_textblock_cursor_geometry_bidi_get(const Efl_Text_Cursor_Cursor *cur, Evas_
}
EOLIAN static Eina_Bool
-_efl_canvas_text_efl_text_cursor_cursor_geometry_get(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, const Efl_Text_Cursor_Cursor *cur, Efl_Text_Cursor_Cursor_Type ctype, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch, Evas_Coord *cx2, Evas_Coord *cy2, Evas_Coord *cw2, Evas_Coord *ch2)
+_efl_canvas_text_efl_text_cursor_cursor_geometry_get(const Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, const Efl_Text_Cursor_Cursor *cur, Efl_Text_Cursor_Type ctype, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch, Evas_Coord *cx2, Evas_Coord *cy2, Evas_Coord *cw2, Evas_Coord *ch2)
{
ASYNC_BLOCK;
if (!cur) return EINA_FALSE;
@@ -12789,9 +12872,8 @@ evas_textblock_cursor_eol_get(const Evas_Textblock_Cursor *cur)
EAPI Eina_Bool
evas_object_textblock_line_number_geometry_get(const Eo *eo_obj, int line, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
{
-
+ EINA_SAFETY_ON_NULL_RETURN_VAL(eo_obj, EINA_FALSE);
Evas_Object_Textblock_Line *ln;
-
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
evas_object_async_block(obj);
Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
@@ -12855,7 +12937,7 @@ evas_object_textblock_clear(Evas_Object *eo_obj)
}
EOLIAN static void
-_efl_canvas_text_size_formatted_get(Eo *eo_obj, Efl_Canvas_Text_Data *o, Evas_Coord *w, Evas_Coord *h)
+_efl_canvas_text_size_formatted_get(const Eo *eo_obj, Efl_Canvas_Text_Data *o, Evas_Coord *w, Evas_Coord *h)
{
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
evas_object_async_block(obj);
@@ -13098,7 +13180,7 @@ _size_native_calc_paragraph_size(const Evas_Object *eo_obj,
}
EOLIAN static void
-_efl_canvas_text_size_native_get(Eo *eo_obj, Efl_Canvas_Text_Data *o, Evas_Coord *w, Evas_Coord *h)
+_efl_canvas_text_size_native_get(const Eo *eo_obj, Efl_Canvas_Text_Data *o, Evas_Coord *w, Evas_Coord *h)
{
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
evas_object_async_block(obj);
@@ -13132,7 +13214,7 @@ _efl_canvas_text_size_native_get(Eo *eo_obj, Efl_Canvas_Text_Data *o, Evas_Coord
}
EOLIAN static void
-_efl_canvas_text_style_insets_get(Eo *eo_obj, Efl_Canvas_Text_Data *o, Evas_Coord *l, Evas_Coord *r, Evas_Coord *t, Evas_Coord *b)
+_efl_canvas_text_style_insets_get(const Eo *eo_obj, Efl_Canvas_Text_Data *o, Evas_Coord *l, Evas_Coord *r, Evas_Coord *t, Evas_Coord *b)
{
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
evas_object_async_block(obj);
@@ -14213,7 +14295,7 @@ _efl_canvas_text_efl_gfx_filter_filter_program_set(Eo *eo_obj, Efl_Canvas_Text_D
}
EOLIAN static void
-_efl_canvas_text_efl_gfx_filter_filter_program_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *pd EINA_UNUSED,
+_efl_canvas_text_efl_gfx_filter_filter_program_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *pd EINA_UNUSED,
const char **code EINA_UNUSED, const char **name EINA_UNUSED)
{
// FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME
@@ -14282,7 +14364,7 @@ _efl_canvas_text_efl_gfx_filter_filter_data_set(Eo *obj, Efl_Canvas_Text_Data *p
}
EOLIAN static void
-_efl_canvas_text_efl_gfx_filter_filter_data_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *pd, const char *name, const char **value, Eina_Bool *execute)
+_efl_canvas_text_efl_gfx_filter_filter_data_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *pd, const char *name, const char **value, Eina_Bool *execute)
{
Evas_Filter_Data_Binding *db;
@@ -14299,7 +14381,7 @@ _efl_canvas_text_efl_gfx_filter_filter_data_get(Eo *obj EINA_UNUSED, Efl_Canvas_
}
EOLIAN static void
-_efl_canvas_text_efl_gfx_filter_filter_source_set(Eo *eo_obj, Efl_Canvas_Text_Data *pd, const char *name, Efl_Gfx *eo_source)
+_efl_canvas_text_efl_gfx_filter_filter_source_set(Eo *eo_obj, Efl_Canvas_Text_Data *pd, const char *name, Efl_Gfx_Entity *eo_source)
{
Evas_Object_Protected_Data *obj, *source;
Evas_Filter_Proxy_Binding *pb;
@@ -14352,8 +14434,8 @@ _efl_canvas_text_efl_gfx_filter_filter_source_set(Eo *eo_obj, Efl_Canvas_Text_Da
evas_object_change(eo_obj, obj);
}
-EOLIAN static Efl_Gfx *
-_efl_canvas_text_efl_gfx_filter_filter_source_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *pd, const char *name)
+EOLIAN static Efl_Gfx_Entity *
+_efl_canvas_text_efl_gfx_filter_filter_source_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *pd, const char *name)
{
return eina_hash_find(pd->gfx_filter.sources, name);
}
@@ -14600,12 +14682,12 @@ evas_object_textblock_was_opaque(Evas_Object *eo_obj EINA_UNUSED,
}
EOLIAN static void
-_efl_canvas_text_efl_gfx_scale_set(Evas_Object *eo_obj,
+_efl_canvas_text_efl_gfx_entity_scale_set(Evas_Object *eo_obj,
Efl_Canvas_Text_Data *o,
double scale)
{
- if (EINA_DBL_EQ(efl_gfx_scale_get(eo_obj), scale)) return;
- efl_gfx_scale_set(efl_super(eo_obj, MY_CLASS), scale);
+ if (EINA_DBL_EQ(efl_gfx_entity_scale_get(eo_obj), scale)) return;
+ efl_gfx_entity_scale_set(efl_super(eo_obj, MY_CLASS), scale);
_evas_textblock_invalidate_all(o);
_evas_textblock_changed(o, eo_obj);
@@ -14689,7 +14771,7 @@ _efl_canvas_text_efl_canvas_object_paragraph_direction_set(Eo *eo_obj,
}
EOLIAN static Evas_BiDi_Direction
-_efl_canvas_text_efl_canvas_object_paragraph_direction_get(Eo *eo_obj EINA_UNUSED,
+_efl_canvas_text_efl_canvas_object_paragraph_direction_get(const Eo *eo_obj EINA_UNUSED,
Efl_Canvas_Text_Data *o)
{
return o->paragraph_direction;
@@ -14769,7 +14851,7 @@ _efl_canvas_text_efl_text_text_set(Eo *eo_obj, Efl_Canvas_Text_Data *o,
}
static char *
-_canvas_text_get_all(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED)
+_canvas_text_get_all(const Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED)
{
Efl_Text_Cursor_Cursor start, end;
@@ -14783,7 +14865,7 @@ _canvas_text_get_all(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED)
}
EOLIAN static const char *
-_efl_canvas_text_efl_text_text_get(Eo *eo_obj, Efl_Canvas_Text_Data *o)
+_efl_canvas_text_efl_text_text_get(const Eo *eo_obj, Efl_Canvas_Text_Data *o)
{
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
evas_object_async_block(obj);
@@ -14859,7 +14941,7 @@ _evas_textblock_annotation_iterator_new(Eina_List *list)
}
static void
-_textblock_cursor_pos_at_fnode_set(Eo *eo_obj EINA_UNUSED,
+_textblock_cursor_pos_at_fnode_set(const Eo *eo_obj EINA_UNUSED,
Efl_Text_Cursor_Cursor *cur,
Evas_Object_Textblock_Node_Format *fnode)
{
@@ -14908,7 +14990,7 @@ _textblock_annotation_set(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o,
}
EOLIAN static const char *
-_efl_canvas_text_efl_text_annotate_annotation_get(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED,
+_efl_canvas_text_efl_text_annotate_annotation_get(const Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED,
Efl_Text_Annotate_Annotation *annotation)
{
if (!annotation || (annotation->obj != eo_obj))
@@ -15097,7 +15179,7 @@ _efl_canvas_text_efl_text_annotate_annotation_insert(Eo *eo_obj, Efl_Canvas_Text
}
EOLIAN static Eina_Iterator *
-_efl_canvas_text_efl_text_annotate_range_annotations_get(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED,
+_efl_canvas_text_efl_text_annotate_range_annotations_get(const Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED,
const Evas_Textblock_Cursor *start, const Evas_Textblock_Cursor *end)
{
Eina_List *lst = NULL;
@@ -15123,16 +15205,24 @@ _efl_canvas_text_efl_text_annotate_range_annotations_get(Eo *eo_obj EINA_UNUSED,
}
EOLIAN static Efl_Text_Annotate_Annotation *
-_efl_canvas_text_efl_text_annotate_cursor_object_item_insert(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur, const char *format)
+_efl_canvas_text_efl_text_annotate_cursor_item_insert(Eo *eo_obj,
+ Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur,
+ const char *item, const char *format)
{
+ Eina_Strbuf *buf = eina_strbuf_new();
+
+ eina_strbuf_append_printf(buf, "%s href=%s", format, item);
+
Efl_Text_Annotate_Annotation *ret =
- _textblock_annotation_insert(cur->obj, o, cur, cur, format, EINA_TRUE);
+ _textblock_annotation_insert(cur->obj, o, cur, cur,
+ eina_strbuf_string_get(buf), EINA_TRUE);
+ eina_strbuf_free(buf);
efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CHANGED, NULL);
return ret;
}
EOLIAN static Efl_Text_Annotate_Annotation *
-_efl_canvas_text_efl_text_annotate_cursor_object_item_annotation_get(Eo *eo_obj EINA_UNUSED,
+_efl_canvas_text_efl_text_annotate_cursor_item_annotation_get(const Eo *eo_obj EINA_UNUSED,
Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur)
{
Eina_Iterator *it;
@@ -15153,7 +15243,21 @@ _efl_canvas_text_efl_text_annotate_cursor_object_item_annotation_get(Eo *eo_obj
}
EOLIAN static Eina_Bool
-_efl_canvas_text_efl_text_annotate_object_item_geometry_get(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED,
+_efl_canvas_text_efl_text_annotate_annotation_is_item(Eo *eo_obj EINA_UNUSED,
+ Efl_Canvas_Text_Data *o EINA_UNUSED,
+ Efl_Text_Annotate_Annotation *annotation)
+{
+ if (!annotation || (annotation->obj != eo_obj))
+ {
+ ERR("Used invalid handle or of a different object");
+ return EINA_FALSE;
+ }
+
+ return annotation->is_item;
+}
+
+EOLIAN static Eina_Bool
+_efl_canvas_text_efl_text_annotate_item_geometry_get(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED,
const Efl_Text_Annotate_Annotation *an, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
{
Efl_Text_Cursor_Cursor cur;
@@ -15225,7 +15329,7 @@ _efl_canvas_text_efl_text_font_font_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Dat
}
static void
-_efl_canvas_text_efl_text_font_font_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, const char **font EINA_UNUSED, int *size EINA_UNUSED)
+_efl_canvas_text_efl_text_font_font_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, const char **font EINA_UNUSED, int *size EINA_UNUSED)
{
if (font) *font = o->default_format.info.font;
if (size) *size = o->default_format.info.size;
@@ -15253,7 +15357,7 @@ _efl_canvas_text_efl_text_font_font_source_set(Eo *obj EINA_UNUSED, Efl_Canvas_T
}
static const char*
-_efl_canvas_text_efl_text_font_font_source_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
+_efl_canvas_text_efl_text_font_font_source_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
{
return _FMT_INFO(font_source);
}
@@ -15280,7 +15384,7 @@ _efl_canvas_text_efl_text_font_font_fallbacks_set(Eo *obj EINA_UNUSED, Efl_Canva
}
static const char*
-_efl_canvas_text_efl_text_font_font_fallbacks_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
+_efl_canvas_text_efl_text_font_font_fallbacks_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
{
return _FMT_INFO(font_fallbacks);
}
@@ -15307,7 +15411,7 @@ _efl_canvas_text_efl_text_font_font_lang_set(Eo *obj EINA_UNUSED, Efl_Canvas_Tex
}
static const char*
-_efl_canvas_text_efl_text_font_font_lang_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
+_efl_canvas_text_efl_text_font_font_lang_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
{
return _FMT_INFO(font_lang);
}
@@ -15321,7 +15425,7 @@ _efl_canvas_text_efl_text_font_font_weight_set(Eo *obj EINA_UNUSED, Efl_Canvas_T
}
static Efl_Text_Font_Weight
-_efl_canvas_text_efl_text_font_font_weight_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
+_efl_canvas_text_efl_text_font_font_weight_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
{
return _FMT_INFO(font_weight);
}
@@ -15336,7 +15440,7 @@ _efl_canvas_text_efl_text_font_font_slant_set(Eo *obj EINA_UNUSED, Efl_Canvas_Te
}
static Efl_Text_Font_Slant
-_efl_canvas_text_efl_text_font_font_slant_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
+_efl_canvas_text_efl_text_font_font_slant_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
{
return _FMT_INFO(font_slant);
}
@@ -15351,7 +15455,7 @@ _efl_canvas_text_efl_text_font_font_width_set(Eo *obj EINA_UNUSED, Efl_Canvas_Te
}
static Efl_Text_Font_Width
-_efl_canvas_text_efl_text_font_font_width_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
+_efl_canvas_text_efl_text_font_font_width_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
{
return _FMT_INFO(font_width);
}
@@ -15365,7 +15469,7 @@ _efl_canvas_text_efl_text_font_font_bitmap_scalable_set(Eo *obj, Efl_Canvas_Text
}
EOLIAN static Efl_Text_Font_Bitmap_Scalable
-_efl_canvas_text_efl_text_font_font_bitmap_scalable_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o)
+_efl_canvas_text_efl_text_font_font_bitmap_scalable_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o)
{
return _FMT_INFO(bitmap_scalable);
}
@@ -15418,7 +15522,7 @@ _efl_canvas_text_efl_text_style_normal_color_set(Eo *obj EINA_UNUSED, Efl_Canvas
}
static void
-_efl_canvas_text_efl_text_style_normal_color_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
+_efl_canvas_text_efl_text_style_normal_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
{
_FMT_COLOR_RET(normal);
}
@@ -15431,7 +15535,7 @@ _efl_canvas_text_efl_text_style_backing_type_set(Eo *obj EINA_UNUSED, Efl_Canvas
}
static Efl_Text_Style_Backing_Type
-_efl_canvas_text_efl_text_style_backing_type_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
+_efl_canvas_text_efl_text_style_backing_type_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
{
return _FMT(backing);
}
@@ -15444,7 +15548,7 @@ _efl_canvas_text_efl_text_style_backing_color_set(Eo *obj EINA_UNUSED, Efl_Canva
}
static void
-_efl_canvas_text_efl_text_style_backing_color_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
+_efl_canvas_text_efl_text_style_backing_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
{
_FMT_COLOR_RET(backing);
}
@@ -15457,7 +15561,7 @@ _efl_canvas_text_efl_text_style_underline_type_set(Eo *obj EINA_UNUSED, Efl_Canv
}
static Efl_Text_Style_Underline_Type
-_efl_canvas_text_efl_text_style_underline_type_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
+_efl_canvas_text_efl_text_style_underline_type_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
{
return _FMT(underline);
}
@@ -15470,7 +15574,7 @@ _efl_canvas_text_efl_text_style_underline_color_set(Eo *obj EINA_UNUSED, Efl_Can
}
static void
-_efl_canvas_text_efl_text_style_underline_color_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
+_efl_canvas_text_efl_text_style_underline_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
{
_FMT_COLOR_RET(underline);
}
@@ -15483,7 +15587,7 @@ _efl_canvas_text_efl_text_style_underline_height_set(Eo *obj EINA_UNUSED, Efl_Ca
}
static double
-_efl_canvas_text_efl_text_style_underline_height_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
+_efl_canvas_text_efl_text_style_underline_height_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
{
return _FMT(underline_height);
}
@@ -15496,7 +15600,7 @@ _efl_canvas_text_efl_text_style_underline_dashed_color_set(Eo *obj EINA_UNUSED,
}
static void
-_efl_canvas_text_efl_text_style_underline_dashed_color_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
+_efl_canvas_text_efl_text_style_underline_dashed_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
{
_FMT_COLOR_RET(underline_dash);
}
@@ -15509,7 +15613,7 @@ _efl_canvas_text_efl_text_style_underline_dashed_width_set(Eo *obj EINA_UNUSED,
}
static int
-_efl_canvas_text_efl_text_style_underline_dashed_width_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
+_efl_canvas_text_efl_text_style_underline_dashed_width_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
{
return _FMT(underline_dash_width);
}
@@ -15522,7 +15626,7 @@ _efl_canvas_text_efl_text_style_underline_dashed_gap_set(Eo *obj EINA_UNUSED, Ef
}
static int
-_efl_canvas_text_efl_text_style_underline_dashed_gap_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
+_efl_canvas_text_efl_text_style_underline_dashed_gap_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
{
return _FMT(underline_dash_width);
}
@@ -15535,7 +15639,7 @@ _efl_canvas_text_efl_text_style_underline2_type_set(Eo *obj EINA_UNUSED, Efl_Can
}
static Efl_Text_Style_Underline_Type
-_efl_canvas_text_efl_text_style_underline2_type_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
+_efl_canvas_text_efl_text_style_underline2_type_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
{
return _FMT(underline2);
}
@@ -15548,7 +15652,7 @@ _efl_canvas_text_efl_text_style_underline2_color_set(Eo *obj EINA_UNUSED, Efl_Ca
}
static void
-_efl_canvas_text_efl_text_style_underline2_color_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
+_efl_canvas_text_efl_text_style_underline2_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
{
_FMT_COLOR_RET(underline2);
}
@@ -15561,7 +15665,7 @@ _efl_canvas_text_efl_text_style_strikethrough_type_set(Eo *obj EINA_UNUSED, Efl_
}
static Efl_Text_Style_Strikethrough_Type
-_efl_canvas_text_efl_text_style_strikethrough_type_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
+_efl_canvas_text_efl_text_style_strikethrough_type_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
{
return _FMT(strikethrough);
}
@@ -15574,7 +15678,7 @@ _efl_canvas_text_efl_text_style_strikethrough_color_set(Eo *obj EINA_UNUSED, Efl
}
static void
-_efl_canvas_text_efl_text_style_strikethrough_color_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
+_efl_canvas_text_efl_text_style_strikethrough_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
{
_FMT_COLOR_RET(strikethrough);
}
@@ -15654,7 +15758,7 @@ _efl_canvas_text_efl_text_style_effect_type_set(Eo *obj EINA_UNUSED, Efl_Canvas_
}
static Efl_Text_Style_Effect_Type
-_efl_canvas_text_efl_text_style_effect_type_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
+_efl_canvas_text_efl_text_style_effect_type_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
{
return _FMT_INFO(effect);
}
@@ -15667,7 +15771,7 @@ _efl_canvas_text_efl_text_style_outline_color_set(Eo *obj EINA_UNUSED, Efl_Canva
}
static void
-_efl_canvas_text_efl_text_style_outline_color_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
+_efl_canvas_text_efl_text_style_outline_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
{
_FMT_COLOR_RET(outline);
}
@@ -15683,7 +15787,7 @@ _efl_canvas_text_efl_text_style_shadow_direction_set(Eo *obj EINA_UNUSED, Efl_Ca
}
static Efl_Text_Style_Shadow_Direction
-_efl_canvas_text_efl_text_style_shadow_direction_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
+_efl_canvas_text_efl_text_style_shadow_direction_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
{
return _FMT_INFO(shadow_direction);
}
@@ -15696,7 +15800,7 @@ _efl_canvas_text_efl_text_style_shadow_color_set(Eo *obj EINA_UNUSED, Efl_Canvas
}
static void
-_efl_canvas_text_efl_text_style_shadow_color_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
+_efl_canvas_text_efl_text_style_shadow_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
{
_FMT_COLOR_RET(shadow);
}
@@ -15709,7 +15813,7 @@ _efl_canvas_text_efl_text_style_glow_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_T
}
static void
-_efl_canvas_text_efl_text_style_glow_color_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
+_efl_canvas_text_efl_text_style_glow_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
{
_FMT_COLOR_RET(glow);
}
@@ -15722,7 +15826,7 @@ _efl_canvas_text_efl_text_style_glow2_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_
}
static void
-_efl_canvas_text_efl_text_style_glow2_color_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
+_efl_canvas_text_efl_text_style_glow2_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
{
_FMT_COLOR_RET(glow2);
}
@@ -15752,7 +15856,7 @@ _efl_canvas_text_efl_text_style_gfx_filter_set(Eo *obj EINA_UNUSED, Efl_Canvas_T
}
static const char *
-_efl_canvas_text_efl_text_style_gfx_filter_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
+_efl_canvas_text_efl_text_style_gfx_filter_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
{
return _FMT(gfx_filter)?_FMT(gfx_filter->name):NULL;
}
@@ -15765,7 +15869,7 @@ _efl_canvas_text_efl_text_format_ellipsis_set(Eo *obj EINA_UNUSED, Efl_Canvas_Te
}
static double
-_efl_canvas_text_efl_text_format_ellipsis_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
+_efl_canvas_text_efl_text_format_ellipsis_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
{
return _FMT(ellipsis);
}
@@ -15783,7 +15887,7 @@ _efl_canvas_text_efl_text_format_wrap_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_D
}
static Efl_Text_Format_Wrap
-_efl_canvas_text_efl_text_format_wrap_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
+_efl_canvas_text_efl_text_format_wrap_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
{
return _FMT_INFO(wrap);
}
@@ -15798,7 +15902,7 @@ _efl_canvas_text_efl_text_format_multiline_set(Eo *obj EINA_UNUSED, Efl_Canvas_T
}
static Eina_Bool
-_efl_canvas_text_efl_text_format_multiline_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
+_efl_canvas_text_efl_text_format_multiline_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
{
return o->multiline;
}
@@ -15826,7 +15930,7 @@ _efl_canvas_text_efl_text_format_halign_auto_type_set(Eo *obj, Efl_Canvas_Text_D
}
static Efl_Text_Format_Horizontal_Alignment_Auto_Type
-_efl_canvas_text_efl_text_format_halign_auto_type_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o)
+_efl_canvas_text_efl_text_format_halign_auto_type_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o)
{
Efl_Text_Format_Horizontal_Alignment_Auto_Type ret =
EFL_TEXT_HORIZONTAL_ALIGNMENT_AUTO_NONE;
@@ -15856,7 +15960,7 @@ _efl_canvas_text_efl_text_format_halign_set(Eo *obj, Efl_Canvas_Text_Data *o,
}
static double
-_efl_canvas_text_efl_text_format_halign_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
+_efl_canvas_text_efl_text_format_halign_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
{
return _FMT(halign);
}
@@ -15874,7 +15978,7 @@ _efl_canvas_text_efl_text_format_valign_set(Eo *obj, Efl_Canvas_Text_Data *o,
}
static double
-_efl_canvas_text_efl_text_format_valign_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
+_efl_canvas_text_efl_text_format_valign_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
{
return o->valign;
}
@@ -15899,7 +16003,7 @@ _efl_canvas_text_efl_text_format_linegap_set(Eo *obj EINA_UNUSED, Efl_Canvas_Tex
}
static double
-_efl_canvas_text_efl_text_format_linegap_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
+_efl_canvas_text_efl_text_format_linegap_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
{
return _FMT(linegap);
}
@@ -15923,7 +16027,7 @@ _efl_canvas_text_efl_text_format_linerelgap_set(Eo *obj EINA_UNUSED, Efl_Canvas_
}
static double
-_efl_canvas_text_efl_text_format_linerelgap_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
+_efl_canvas_text_efl_text_format_linerelgap_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
{
return _FMT(linerelgap);
}
@@ -15936,7 +16040,7 @@ _efl_canvas_text_efl_text_format_tabstops_set(Eo *obj EINA_UNUSED, Efl_Canvas_Te
}
static int
-_efl_canvas_text_efl_text_format_tabstops_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
+_efl_canvas_text_efl_text_format_tabstops_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
{
return _FMT(tabstops);
}
@@ -15949,7 +16053,7 @@ _efl_canvas_text_efl_text_format_password_set(Eo *obj EINA_UNUSED, Efl_Canvas_Te
}
static Eina_Bool
-_efl_canvas_text_efl_text_format_password_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
+_efl_canvas_text_efl_text_format_password_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
{
return _FMT(password);
}
@@ -15977,7 +16081,7 @@ _efl_canvas_text_efl_text_format_replacement_char_set(Eo *obj EINA_UNUSED, Efl_C
}
static const char *
-_efl_canvas_text_efl_text_format_replacement_char_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
+_efl_canvas_text_efl_text_format_replacement_char_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED)
{
return o->repch;
}
@@ -16092,7 +16196,7 @@ ppar(Evas_Object_Textblock_Paragraph *par)
EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _efl_canvas_text_efl_object_dbg_info_get)
EOLIAN static Efl_Text_Cursor_Cursor *
-_efl_canvas_text_efl_text_cursor_cursor_get(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o, Efl_Text_Cursor_Cursor_Get_Type get_type)
+_efl_canvas_text_efl_text_cursor_text_cursor_get(const Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o, Efl_Text_Cursor_Get_Type get_type)
{
if (get_type > EFL_TEXT_CURSOR_GET_MAIN)
{
@@ -16264,3 +16368,4 @@ _efl_canvas_text_async_layout(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o)
}
#include "canvas/efl_canvas_text.eo.c"
+#include "canvas/efl_canvas_text_factory.eo.c" // interface
diff --git a/src/lib/evas/canvas/evas_object_textgrid.c b/src/lib/evas/canvas/evas_object_textgrid.c
index 2402170a6c..d817d94e46 100644
--- a/src/lib/evas/canvas/evas_object_textgrid.c
+++ b/src/lib/evas/canvas/evas_object_textgrid.c
@@ -872,14 +872,14 @@ evas_object_textgrid_was_opaque(Evas_Object *eo_obj EINA_UNUSED,
}
EOLIAN static void
-_evas_textgrid_efl_gfx_scale_set(Evas_Object *eo_obj, Evas_Textgrid_Data *o,
+_evas_textgrid_efl_gfx_entity_scale_set(Evas_Object *eo_obj, Evas_Textgrid_Data *o,
double scale)
{
int font_size;
const char *font_name;
- if (EINA_DBL_EQ(efl_gfx_scale_get(eo_obj), scale)) return;
- efl_gfx_scale_set(efl_super(eo_obj, MY_CLASS), scale);
+ if (EINA_DBL_EQ(efl_gfx_entity_scale_get(eo_obj), scale)) return;
+ efl_gfx_entity_scale_set(efl_super(eo_obj, MY_CLASS), scale);
font_name = eina_stringshare_add(o->cur.font_name);
font_size = o->cur.font_size;
@@ -902,7 +902,7 @@ evas_object_textgrid_add(Evas *e)
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
return NULL;
MAGIC_CHECK_END();
- return efl_add(EVAS_TEXTGRID_CLASS, e, efl_canvas_object_legacy_ctor(efl_added));
+ return efl_add(EVAS_TEXTGRID_CLASS, evas_find(e), efl_canvas_object_legacy_ctor(efl_added));
}
EOLIAN static Eo *
@@ -916,7 +916,7 @@ _evas_textgrid_efl_object_constructor(Eo *eo_obj, Evas_Textgrid_Data *class_data
}
EOLIAN static void
-_evas_textgrid_size_set(Eo *eo_obj, Evas_Textgrid_Data *o, int w, int h)
+_evas_textgrid_grid_size_set(Eo *eo_obj, Evas_Textgrid_Data *o, int w, int h)
{
int i;
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
@@ -959,14 +959,14 @@ _evas_textgrid_size_set(Eo *eo_obj, Evas_Textgrid_Data *o, int w, int h)
}
EOLIAN static void
-_evas_textgrid_size_get(Eo *eo_obj EINA_UNUSED, Evas_Textgrid_Data *o, int *w, int *h)
+_evas_textgrid_grid_size_get(const Eo *eo_obj EINA_UNUSED, Evas_Textgrid_Data *o, int *w, int *h)
{
if (w) *w = o->cur.w;
if (h) *h = o->cur.h;
}
EOLIAN static void
-_evas_textgrid_efl_text_properties_font_source_set(Eo *eo_obj, Evas_Textgrid_Data *o, const char *font_source)
+_evas_textgrid_efl_text_font_font_source_set(Eo *eo_obj, Evas_Textgrid_Data *o, const char *font_source)
{
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
@@ -984,7 +984,7 @@ _evas_textgrid_efl_text_properties_font_source_set(Eo *eo_obj, Evas_Textgrid_Dat
}
EOLIAN static const char*
-_evas_textgrid_efl_text_properties_font_source_get(Eo *eo_obj EINA_UNUSED, Evas_Textgrid_Data *o)
+_evas_textgrid_efl_text_font_font_source_get(const Eo *eo_obj EINA_UNUSED, Evas_Textgrid_Data *o)
{
return o->cur.font_source;
}
@@ -1221,7 +1221,7 @@ _evas_textgrid_font_reload(Eo *eo_obj, Evas_Textgrid_Data *o)
}
EOLIAN static void
-_evas_textgrid_efl_text_properties_font_set(Eo *eo_obj,
+_evas_textgrid_efl_text_font_font_set(Eo *eo_obj,
Evas_Textgrid_Data *o,
const char *font_name,
Evas_Font_Size font_size)
@@ -1258,14 +1258,14 @@ _evas_textgrid_efl_text_properties_font_set(Eo *eo_obj,
}
EOLIAN static void
-_evas_textgrid_efl_text_properties_font_get(Eo *eo_obj EINA_UNUSED, Evas_Textgrid_Data *o, const char **font_name, Evas_Font_Size *font_size)
+_evas_textgrid_efl_text_font_font_get(const Eo *eo_obj EINA_UNUSED, Evas_Textgrid_Data *o, const char **font_name, Evas_Font_Size *font_size)
{
if (font_name) *font_name = o->cur.font_name;
if (font_size) *font_size = o->cur.font_size;
}
EOLIAN static void
-_evas_textgrid_cell_size_get(Eo *eo_obj EINA_UNUSED, Evas_Textgrid_Data *o, int *w, int *h)
+_evas_textgrid_cell_size_get(const Eo *eo_obj EINA_UNUSED, Evas_Textgrid_Data *o, int *w, int *h)
{
if (w) *w = o->cur.char_width;
if (h) *h = o->cur.char_height;
@@ -1406,7 +1406,7 @@ _evas_textgrid_supported_font_styles_set(Eo *eo_obj, Evas_Textgrid_Data *o, Evas
}
EOLIAN static Evas_Textgrid_Font_Style
-_evas_textgrid_supported_font_styles_get(Eo *eo_obj EINA_UNUSED, Evas_Textgrid_Data *o EINA_UNUSED)
+_evas_textgrid_supported_font_styles_get(const Eo *eo_obj EINA_UNUSED, Evas_Textgrid_Data *o EINA_UNUSED)
{
/* FIXME: to do */
return EVAS_TEXTGRID_FONT_STYLE_NORMAL;
@@ -1471,16 +1471,16 @@ _evas_textgrid_efl_object_dbg_info_get(Eo *eo_obj, Evas_Textgrid_Data *o EINA_UN
const char *text;
int size;
- efl_text_properties_font_get(eo_obj, &text, &size);
+ efl_text_font_get(eo_obj, &text, &size);
EFL_DBG_INFO_APPEND(group, "Font", EINA_VALUE_TYPE_STRING, text);
EFL_DBG_INFO_APPEND(group, "Text size", EINA_VALUE_TYPE_INT, size);
- text = efl_text_properties_font_source_get(eo_obj);
+ text = efl_text_font_source_get(eo_obj);
EFL_DBG_INFO_APPEND(group, "Font source", EINA_VALUE_TYPE_STRING, text);
{
int w, h;
- evas_obj_textgrid_size_get(eo_obj, &w, &h);
+ evas_obj_textgrid_grid_size_get(eo_obj, &w, &h);
node = EFL_DBG_INFO_LIST_APPEND(group, "Grid size");
EFL_DBG_INFO_APPEND(node, "w", EINA_VALUE_TYPE_INT, w);
EFL_DBG_INFO_APPEND(node, "h", EINA_VALUE_TYPE_INT, h);
@@ -1490,27 +1490,27 @@ _evas_textgrid_efl_object_dbg_info_get(Eo *eo_obj, Evas_Textgrid_Data *o EINA_UN
EAPI void
evas_object_textgrid_font_source_set(Eo *obj, const char *font_source)
{
- efl_text_properties_font_source_set((Eo *) obj, font_source);
+ efl_text_font_source_set((Eo *) obj, font_source);
}
EAPI const char *
evas_object_textgrid_font_source_get(const Eo *obj)
{
const char *font_source = NULL;
- font_source = efl_text_properties_font_source_get((Eo *) obj);
+ font_source = efl_text_font_source_get((Eo *) obj);
return font_source;
}
EAPI void
evas_object_textgrid_font_set(Eo *obj, const char *font_name, Evas_Font_Size font_size)
{
- efl_text_properties_font_set((Eo *) obj, font_name, font_size);
+ efl_text_font_set((Eo *) obj, font_name, font_size);
}
EAPI void
evas_object_textgrid_font_get(const Eo *obj, const char **font_name, Evas_Font_Size *font_size)
{
- efl_text_properties_font_get((Eo *) obj, font_name, font_size);
+ efl_text_font_get((Eo *) obj, font_name, font_size);
}
EOLIAN static void
@@ -1523,7 +1523,7 @@ _evas_textgrid_efl_text_font_font_bitmap_scalable_set(Eo *eo_obj, Evas_Textgrid_
}
EOLIAN static Efl_Text_Font_Bitmap_Scalable
-_evas_textgrid_efl_text_font_font_bitmap_scalable_get(Eo *eo_obj EINA_UNUSED, Evas_Textgrid_Data *o)
+_evas_textgrid_efl_text_font_font_bitmap_scalable_get(const Eo *eo_obj EINA_UNUSED, Evas_Textgrid_Data *o)
{
return o->cur.bitmap_scalable;
}
diff --git a/src/lib/evas/canvas/evas_out.c b/src/lib/evas/canvas/evas_out.c
index 2c44b0868f..40cce4ce04 100644
--- a/src/lib/evas/canvas/evas_out.c
+++ b/src/lib/evas/canvas/evas_out.c
@@ -53,6 +53,13 @@ efl_canvas_output_add(Evas *canvas)
r->changed = EINA_TRUE;
e = _efl_canvas_output_async_block(r);
+ if (!e)
+ {
+ efl_wref_del(canvas, &r->canvas);
+ free(r);
+ return NULL;
+ }
+
// Track this output in Evas
e->outputs = eina_list_append(e->outputs, r);
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index 8da9ed8116..f03a6a5cab 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -494,20 +494,30 @@ _evas_render_phase1_direct(Evas_Public_Data *e,
_evas_object_gfx_map_update(obj);
+ Eina_Bool has_map = _evas_render_has_map(obj);
+
RD(0, " pre-render-done smart:%p|%p [%p, %i] | [%p, %i] has_map:%i had_map:%i\n",
obj->smart.smart,
obj->is_smart ? evas_object_smart_members_get_direct(eo_obj) : NULL,
obj->map->cur.map, obj->map->cur.usemap,
obj->map->prev.map, obj->map->prev.usemap,
- _evas_render_has_map(obj),
- _evas_render_had_map(obj));
+ has_map, _evas_render_had_map(obj));
+
if ((obj->is_smart) &&
- (((_evas_render_has_map(obj) && !_evas_render_can_map(obj)) ||
- (obj->changed_src_visible))))
+ ((has_map && !_evas_render_can_map(obj)) ||
+ obj->changed_src_visible))
{
RD(0, " has map + smart\n");
_evas_render_prev_cur_clip_cache_add(e, obj);
}
+ /* This is the only case that map was just turned off,
+ Need to redraw the previous obj region as well. */
+ else if (!has_map && obj->changed_map &&
+ _evas_render_object_changed_get(obj))
+ {
+ _evas_render_prev_cur_clip_cache_add(e, obj);
+ obj->changed_map = EINA_FALSE;
+ }
}
else
{
@@ -656,6 +666,20 @@ evas_render_object_render_cache_free(Evas_Object *eo_obj EINA_UNUSED,
free(rc);
}
+typedef struct
+{
+ Evas_Public_Data *e;
+ Eina_Inarray *active_objects;
+ Eina_Array *render_objects;
+ Eina_Array *snapshot_objects;
+ Eina_Array *restack_objects;
+ Eina_Array *delete_objects;
+ int redraw_all;
+} Phase1_Context;
+
+#define RENDCACHE 1
+
+#ifdef RENDCACHE
static Render_Cache *
_evas_render_phase1_object_render_cache_new(void)
{
@@ -669,17 +693,6 @@ _evas_render_phase1_object_render_cache_new(void)
return rc;
}
-typedef struct
-{
- Evas_Public_Data *e;
- Eina_Inarray *active_objects;
- Eina_Array *render_objects;
- Eina_Array *snapshot_objects;
- Eina_Array *restack_objects;
- Eina_Array *delete_objects;
- int redraw_all;
-} Phase1_Context;
-
static void
_evas_render_phase1_object_ctx_render_cache_fill(Phase1_Context *ctx,
Render_Cache *rc)
@@ -725,6 +738,7 @@ _evas_render_phase1_object_ctx_render_cache_append(Phase1_Context *ctx,
evas_render_update_del(ctx->e, r->x, r->y, r->w, r->h);
}
}
+#endif
static Eina_Bool
_evas_render_phase1_object_process(Phase1_Context *p1ctx,
@@ -824,8 +838,6 @@ _evas_render_phase1_object_mapped_had_restack(Phase1_Context *p1ctx,
evas_object_update_bounding_box(eo_obj, obj, NULL);
}
-#define RENDCACHE 1
-
static Eina_Bool
_evas_render_phase1_object_changed_smart(Phase1_Context *p1ctx,
Evas_Object_Protected_Data *obj,
@@ -836,8 +848,6 @@ _evas_render_phase1_object_changed_smart(Phase1_Context *p1ctx,
int level)
{
Evas_Object_Protected_Data *obj2;
- Render_Cache *rc = NULL;
- void *p_del_redir;
Evas_Object *eo_obj = obj->object;
RD(level, " changed + smart - render ok\n");
@@ -859,9 +869,12 @@ _evas_render_phase1_object_changed_smart(Phase1_Context *p1ctx,
else
{
Phase1_Context *ctx = p1ctx;
- Phase1_Context tmpctx;
#ifdef RENDCACHE
+ Render_Cache *rc = NULL;
+ void *p_del_redir;
+ Phase1_Context tmpctx;
+
if (obj->no_change_render > 3)
{
rc = evas_object_smart_render_cache_get(eo_obj);
@@ -966,15 +979,16 @@ _evas_render_phase1_object_no_changed_smart(Phase1_Context *p1ctx,
{
Evas_Object_Protected_Data *obj2;
Phase1_Context *ctx = p1ctx;
- Phase1_Context tmpctx;
- Render_Cache *rc = NULL;
- void *p_del_redir;
Evas_Object *eo_obj = obj->object;
RD(level, " smart + visible/was visible + not clip\n");
OBJ_ARRAY_PUSH(p1ctx->render_objects, obj);
obj->render_pre = EINA_TRUE;
#ifdef RENDCACHE
+ void *p_del_redir;
+ Render_Cache *rc = NULL;
+ Phase1_Context tmpctx;
+
if (obj->no_change_render > 3)
{
rc = evas_object_smart_render_cache_get(eo_obj);
@@ -1734,7 +1748,7 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj,
{
/* don't render if the source is invisible */
if ((evas_object_is_source_invisible(eo_obj, obj)))
- return clean_them;
+ return EINA_FALSE;
}
else
proxy_src_clip = proxy_render_data->source_clip;
@@ -1744,7 +1758,7 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj,
/* leave early if clipper is not visible */
if ((obj->cur->clipper) && (!obj->cur->clipper->cur->visible))
- return clean_them;
+ return EINA_FALSE;
eina_evlog("+render_object", eo_obj, 0.0, NULL);
#ifdef REND_DBG
@@ -1791,7 +1805,7 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj,
RD(level, " not rendering mask surface\n");
RD(level, "}\n");
eina_evlog("-render_object", eo_obj, 0.0, NULL);
- return clean_them;
+ return EINA_FALSE;
}
// else don't return: draw mask in its surface
}
@@ -1807,7 +1821,7 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj,
IFRD(!evas_object_is_visible(eo_obj, obj), level, " not visible\n");
RD(level, "}\n");
eina_evlog("-render_object", eo_obj, 0.0, NULL);
- return clean_them;
+ return EINA_FALSE;
}
}
else
@@ -1822,7 +1836,7 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj,
IFRD(!obj->cur->color.a && (obj->cur->render_op == EVAS_RENDER_BLEND), level, " proxy_src_clip + 0 alpha\n");
RD(level, "}\n");
eina_evlog("-render_object", eo_obj, 0.0, NULL);
- return clean_them;
+ return EINA_FALSE;
}
else if (proxy_render_data && (surface != obj->proxy->surface) &&
obj->proxy->src_invisible)
@@ -1830,7 +1844,7 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj,
RD(level, " src_invisible + not proxy surface (recursive proxies)\n");
RD(level, "}\n");
eina_evlog("-render_object", eo_obj, 0.0, NULL);
- return clean_them;
+ return EINA_FALSE;
}
}
}
@@ -1841,14 +1855,14 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj,
IFRD(obj->clip.clipees || obj->cur->have_clipees, level, " has clippees\n");
RD(level, "}\n");
eina_evlog("-render_object", eo_obj, 0.0, NULL);
- return clean_them;
+ return EINA_FALSE;
}
else if (obj->no_render && (surface != obj->proxy->surface))
{
RD(level, " no_render\n");
RD(level, "}\n");
eina_evlog("-render_object", eo_obj, 0.0, NULL);
- return clean_them;
+ return EINA_FALSE;
}
}
else if (!(((evas_object_is_active(eo_obj, obj) && (!obj->clip.clipees) &&
@@ -1860,7 +1874,7 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj,
IFRD(obj->clip.clipees, level, " has clippees\n");
RD(level, "}\n");
eina_evlog("-render_object", eo_obj, 0.0, NULL);
- return clean_them;
+ return EINA_FALSE;
}
// set render_pre - for child objs that may not have gotten it.
@@ -2882,7 +2896,7 @@ evas_render_pre(Evas *eo_e, Evas_Public_Data *evas)
obj->legacy.finalized = EINA_TRUE;
if (!obj->legacy.visible_set)
- efl_gfx_visible_set(eo_obj, EINA_TRUE);
+ efl_gfx_entity_visible_set(eo_obj, EINA_TRUE);
// weight should be set during finalize()
if (EINA_UNLIKELY(!obj->legacy.weight_set))
@@ -3157,11 +3171,7 @@ evas_render_updates_internal(Evas *eo_e,
e = evas = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
if (e->inside_post_render) return EINA_FALSE;
- if (!e->changed)
- {
- _cb_always_call(eo_e, EVAS_CALLBACK_RENDER_PRE, NULL);
- goto nothing2render;
- }
+ if (!e->changed) return EINA_FALSE;
if (e->rendering)
{
@@ -3326,10 +3336,10 @@ evas_render_updates_internal(Evas *eo_e,
EINA_LIST_FOREACH(e->outputs, l, out)
{
// Avoid processing not ready output until they are
- if (!out->output) continue ;
+ if (!out->output) continue;
// Locked output are output that should not yet be rendered
// because the tick/vsync for it doesn't allow it yet.
- if (out->lock > 0) continue ;
+ if (out->lock > 0) continue;
/* phase 6. Initialize output */
if (out->changed)
@@ -3420,6 +3430,10 @@ evas_render_updates_internal(Evas *eo_e,
int fy = e->framespace.y;
int j;
+ DBG("Rendering output %p [%i, %i, %i, %i]\n", out,
+ out->geometry.x, out->geometry.y,
+ out->geometry.w, out->geometry.h);
+
if (do_async) _evas_render_busy_begin();
eina_evlog("+render_surface", eo_e, 0.0, NULL);
while ((surface =
@@ -3436,6 +3450,9 @@ evas_render_updates_internal(Evas *eo_e,
ux += out->geometry.x;
uy += out->geometry.y;
+ DBG("Surface %p offset: [%i, %i, %i, %i]\n", surface,
+ ux, uy, uw, uh);
+
/* phase 7.1 render every snapshot that needs to be updated
for this part of the screen */
eina_evlog("+render_snapshots", eo_e, 0.0, NULL);
@@ -3522,7 +3539,9 @@ evas_render_updates_internal(Evas *eo_e,
if (!do_async)
{
eina_evlog("+render_push", eo_e, 0.0, NULL);
- ENFN->output_redraws_next_update_push(ENC, out->output, surface, ux, uy, uw, uh, render_mode);
+ ENFN->output_redraws_next_update_push(ENC, out->output, surface,
+ ux - out->geometry.x, uy - out->geometry.y, uw, uh,
+ render_mode);
eina_evlog("-render_push", eo_e, 0.0, NULL);
}
}
@@ -3673,7 +3692,7 @@ evas_render_updates_internal(Evas *eo_e,
for (i = 0; i < e->delete_objects.count; ++i)
{
obj = eina_array_data_get(&e->delete_objects, i);
- evas_object_free(obj->object, EINA_TRUE);
+ evas_object_free(obj, EINA_TRUE);
}
eina_array_clean(&e->delete_objects);
/* if we deleted no objects this frame or we deleted a lot (> 1024) then
@@ -3684,14 +3703,14 @@ evas_render_updates_internal(Evas *eo_e,
evas_module_clean();
- // Send a RENDER_POST when we are rendering synchronously or when there is no update done asynchronously
+ /* Send a RENDER_POST when we are rendering synchronously or,
+ when do_async but no drawing. This gurantees pre-post pair. */
if (!do_async || !rendering)
{
Evas_Event_Render_Post post;
Eina_List *l1, *l2;
Render_Updates *ru;
- nothing2render:
post.updated_area = NULL;
EINA_LIST_FOREACH(e->outputs, l1, out)
{
@@ -3856,7 +3875,9 @@ evas_render_pipe_wakeup(void *data)
{
eina_evlog("+render_push", evas->evas, 0.0, NULL);
ENFN->output_redraws_next_update_push
- (ENC, out->output, ru->surface, ru->area->x, ru->area->y, ru->area->w, ru->area->h,
+ (ENC, out->output, ru->surface,
+ ru->area->x - out->geometry.x, ru->area->y - out->geometry.y,
+ ru->area->w, ru->area->h,
EVAS_RENDER_MODE_ASYNC_END);
eina_evlog("-render_push", evas->evas, 0.0, NULL);
//XXX: need a way to unref render output surfaces
@@ -3993,7 +4014,7 @@ _evas_canvas_norender(Eo *eo_e, Evas_Public_Data *e)
evas_canvas_async_block(e);
// if (!e->changed) return;
- ret = evas_render_updates_internal_wait(eo_e, 0, 1);
+ ret = evas_render_updates_internal_wait(eo_e, 0, 0);
EINA_LIST_FREE(ret, ru)
{
eina_rectangle_free(ru->area);
diff --git a/src/lib/evas/canvas/evas_stack.c b/src/lib/evas/canvas/evas_stack.x
index a42562fbe8..fb75e86bc6 100644
--- a/src/lib/evas/canvas/evas_stack.c
+++ b/src/lib/evas/canvas/evas_stack.x
@@ -1,6 +1,3 @@
-#include "evas_common_private.h"
-#include "evas_private.h"
-
static Evas_Object_Protected_Data *
evas_object_above_get_internal(const Evas_Object_Protected_Data *obj)
{
@@ -377,7 +374,7 @@ _efl_canvas_object_efl_gfx_stack_below_get(Eo *eo_obj EINA_UNUSED,
}
EOLIAN Evas_Object*
-_evas_canvas_object_bottom_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
+_evas_canvas_object_bottom_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
{
if (e->layers)
{
@@ -394,7 +391,7 @@ _evas_canvas_object_bottom_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
}
EOLIAN Evas_Object*
-_evas_canvas_object_top_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
+_evas_canvas_object_top_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
{
Evas_Object_Protected_Data *obj = NULL;
Eina_Inlist *list;
@@ -420,4 +417,3 @@ _evas_canvas_object_top_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
return NULL;
}
-
diff --git a/src/lib/evas/canvas/evas_table.eo b/src/lib/evas/canvas/evas_table.eo
index d503e8d482..3c7acdb156 100644
--- a/src/lib/evas/canvas/evas_table.eo
+++ b/src/lib/evas/canvas/evas_table.eo
@@ -86,20 +86,6 @@ class Evas.Table (Efl.Canvas.Group)
vertical: int; [[Vertical padding]]
}
}
- @property mirrored {
- [[Control the mirrored mode of the table. In mirrored mode, the table items go
- from right to left instead of left to right. That is, 1,1 is top right, not
- top left.
-
- @since 1.1]]
- set {
- }
- get {
- }
- values {
- mirrored: bool; [[$true if mirrored, $false otherwise]]
- }
- }
@property col_row_size {
get {
[[Get the number of columns and rows this table takes.
@@ -217,8 +203,9 @@ class Evas.Table (Efl.Canvas.Group)
implements {
class.constructor;
Efl.Object.constructor;
- Efl.Gfx.size { set; }
- Efl.Gfx.position { set; }
+ Efl.Gfx.Entity.size { set; }
+ Efl.Gfx.Entity.position { set; }
Efl.Canvas.Group.group_calculate;
+ Efl.Ui.Base.mirrored { get; set; }
}
}
diff --git a/src/lib/evas/canvas/evas_text.eo b/src/lib/evas/canvas/evas_text.eo
index 7a8049e200..617c9dedae 100644
--- a/src/lib/evas/canvas/evas_text.eo
+++ b/src/lib/evas/canvas/evas_text.eo
@@ -1,7 +1,7 @@
type @extern Evas.Text_Style_Type : __undefined_type; [[External text style type]]
-class Evas.Text (Efl.Canvas.Object, Efl.Text, Efl.Text.Properties,
- Efl.Text.Font, Efl.Canvas.Filter.Internal, Efl.Ui.Base)
+class Evas.Text (Efl.Canvas.Object, Efl.Text,
+ Efl.Text_Font, Efl.Canvas.Filter.Internal, Efl.Ui.Base)
{
[[Evas text class]]
legacy_prefix: evas_object_text;
@@ -165,7 +165,7 @@ class Evas.Text (Efl.Canvas.Object, Efl.Text, Efl.Text.Properties,
}
}
@property max_descent {
- [[Maximal descent property]]
+ [[Maximal descent property]]
get {
return: int; [[Evas coordinate]]
}
@@ -186,41 +186,41 @@ class Evas.Text (Efl.Canvas.Object, Efl.Text, Efl.Text.Properties,
[[Retrieves the direction of the text currently being displayed in the
text object.]]
- return: Efl.Text.Bidirectional_Type; [[Bidirectional type]]
+ return: Efl.Text_Bidirectional_Type; [[Bidirectional type]]
}
}
@property ascent {
- [[Ascent property]]
+ [[Ascent property]]
get {
return: int; [[Evas coordinate]]
}
}
@property horiz_advance {
- [[Horizontal advance property]]
+ [[Horizontal advance property]]
get {
return: int; [[Evas coordinate]]
}
}
@property inset {
- [[Inset property]]
+ [[Inset property]]
get {
return: int; [[Evas coordinate]]
}
}
@property max_ascent {
- [[Maximal ascent property]]
+ [[Maximal ascent property]]
get {
return: int; [[Evas coordinate]]
}
}
@property vert_advance {
- [[Vertical advance property]]
+ [[Vertical advance property]]
get {
return: int; [[Evas coordinate]]
}
}
@property descent {
- [[descent property]]
+ [[descent property]]
get {
return: int; [[Evas coordinate]]
}
@@ -239,7 +239,7 @@ class Evas.Text (Efl.Canvas.Object, Efl.Text, Efl.Text.Properties,
}
}
char_coords_get @const {
- [[Get character coordinates]]
+ [[Get character coordinates]]
return: int; [[Logical position of char]]
params {
@in x: int; [[X coordinate]]
@@ -271,12 +271,12 @@ class Evas.Text (Efl.Canvas.Object, Efl.Text, Efl.Text.Properties,
implements {
Efl.Object.constructor;
Efl.Object.destructor;
- Efl.Gfx.size { set; }
- Efl.Gfx.scale { set; }
+ Efl.Gfx.Entity.size { set; }
+ Efl.Gfx.Entity.scale { set; }
Efl.Text.text { get; set; }
- Efl.Text.Properties.font { get; set; }
- Efl.Text.Properties.font_source { get; set; }
- Efl.Text.Font.font_bitmap_scalable { get; set; }
+ Efl.Text_Font.font { get; set; }
+ Efl.Text_Font.font_source { get; set; }
+ Efl.Text_Font.font_bitmap_scalable { get; set; }
Efl.Gfx.Filter.filter_program { set; }
Efl.Canvas.Filter.Internal.filter_dirty;
Efl.Canvas.Filter.Internal.filter_input_alpha;
diff --git a/src/lib/evas/canvas/evas_textblock_hyphenation.x b/src/lib/evas/canvas/evas_textblock_hyphenation.x
index 684b44032c..e8073b37bc 100644
--- a/src/lib/evas/canvas/evas_textblock_hyphenation.x
+++ b/src/lib/evas/canvas/evas_textblock_hyphenation.x
@@ -26,14 +26,19 @@ _dicts_hyphen_init(Eo *eo_obj)
}
}
-static void *
+static HyphenDict *
_dict_hyphen_load(const char *lang)
{
- Eina_Iterator *it;
+ Eina_Iterator *it = NULL;
Eina_File_Direct_Info *dir;
- void *dict = NULL;
+ HyphenDict *dict = NULL;
+ const char *env_dir = getenv("EVAS_DICTS_HYPHEN_DIR");
+
+ if (env_dir && strlen(env_dir) > 0)
+ it = eina_file_direct_ls(env_dir);
+
+ if (!it) it = eina_file_direct_ls(EVAS_DICTS_HYPHEN_DIR);
- it = eina_file_direct_ls(EVAS_DICTS_HYPHEN_DIR);
if (!it)
{
ERR("Couldn't list files in hyphens path: %s\n", EVAS_DICTS_HYPHEN_DIR);
@@ -103,7 +108,7 @@ _dicts_hyphen_detach(Eo *eo_obj)
/* Returns the hyphen dictionary that matches the given language
* string. The string should be in the format xx_XX e.g. en_US */
-static inline void *
+static inline HyphenDict *
_hyphen_dict_get_from_lang(const char *lang)
{
if (!lang || !(*lang))
@@ -127,13 +132,14 @@ static char *
_layout_wrap_hyphens_get(const Eina_Unicode *text, const char *lang,
int word_start, int word_len)
{
- char *utf8;
- int utf8_len; /* length of word */
- char *hyphens;
+ char *hyphens = NULL;
char **rep = NULL;
int *pos = NULL;
int *cut = NULL;
- void *dict;
+ HyphenDict *dict;
+ char *converted_text = NULL;
+ size_t converted_text_offset = 0;
+ size_t converted_len = 0;
dict = _hyphen_dict_get_from_lang(lang);
if (!dict)
@@ -142,11 +148,44 @@ _layout_wrap_hyphens_get(const Eina_Unicode *text, const char *lang,
return NULL;
}
- utf8 = eina_unicode_unicode_to_utf8_range(
- text + word_start, word_len, &utf8_len);
- hyphens = malloc(sizeof(char) * (word_len + 5));
- hnj_hyphen_hyphenate2(dict, utf8, word_len, hyphens, NULL, &rep, &pos, &cut);
- free(utf8);
+ /* Convert UTF-32 encoded text to the other encoding
+ * which is described in hyphen dictionary. */
+ if (dict->cset && strcmp(dict->cset, "UTF-32"))
+ {
+ converted_text = eina_str_convert_len("UTF-32", dict->cset,
+ (char *)(text + word_start),
+ word_len * sizeof(Eina_Unicode),
+ &converted_len);
+
+ if (!converted_text) goto hyphens_done;
+
+ /* Skip BOM character (0xFFFE) from converted text */
+ if ((converted_len >= 2) &&
+ (converted_text[0] == 0xff) &&
+ (converted_text[1] == 0xfe))
+ converted_text_offset = 2;
+
+ /* If there is only a BOM character, return NULL */
+ if (converted_len == converted_text_offset)
+ goto hyphens_done;
+ }
+
+ if (converted_text)
+ {
+ hyphens = malloc(sizeof(char) * (converted_len + 5));
+ hnj_hyphen_hyphenate2(dict, converted_text + converted_text_offset,
+ (int)(converted_len - converted_text_offset), hyphens, NULL, &rep, &pos, &cut);
+ }
+ else
+ {
+ hyphens = malloc(sizeof(char) * (word_len + 5));
+ hnj_hyphen_hyphenate2(dict, (char *)(text + word_start),
+ word_len, hyphens, NULL, &rep, &pos, &cut);
+ }
+
+hyphens_done:
+ if (converted_text) free(converted_text);
+
return hyphens;
}
diff --git a/src/lib/evas/canvas/evas_textblock_legacy.h b/src/lib/evas/canvas/evas_textblock_legacy.h
index f55691d48b..0d84075fa0 100644
--- a/src/lib/evas/canvas/evas_textblock_legacy.h
+++ b/src/lib/evas/canvas/evas_textblock_legacy.h
@@ -127,6 +127,7 @@
*
* @{
*/
+typedef Eo Evas_Textblock;
/**
* @typedef Evas_Textblock_Style
@@ -157,6 +158,14 @@ typedef struct _Efl_Text_Cursor_Cursor Evas_Textblock_Cursor;
typedef struct _Evas_Textblock_Node_Format Evas_Object_Textblock_Node_Format;
/**
+ * @typedef Evas_Textblock_Node_Format
+ * A format node.
+ *
+ * XXX: Adapter for legacy.
+ */
+typedef struct _Evas_Textblock_Node_Format Evas_Textblock_Node_Format;
+
+/**
* @typedef Evas_Textblock_Rectangle
* General-purpose rectangle that represents some geometry in this object.
*
diff --git a/src/lib/evas/canvas/evas_textgrid.eo b/src/lib/evas/canvas/evas_textgrid.eo
index 51b4583ea4..53e4d017e1 100644
--- a/src/lib/evas/canvas/evas_textgrid.eo
+++ b/src/lib/evas/canvas/evas_textgrid.eo
@@ -20,7 +20,7 @@ enum Evas.Textgrid.Font_Style {
/* XXX: Actual definition is in C. */
struct Evas.Textgrid.Cell; [[Evas textgrid cell data structure]]
-class Evas.Textgrid (Efl.Canvas.Object, Efl.Text.Properties, Efl.Text.Font,
+class Evas.Textgrid (Efl.Canvas.Object, Efl.Text_Font,
Efl.Ui.Base)
{
[[Evas textgrid class]]
@@ -38,7 +38,7 @@ class Evas.Textgrid (Efl.Canvas.Object, Efl.Text.Properties, Efl.Text.Font,
styles: Evas.Textgrid.Font_Style; [[EVAS_TEXTGRID_FONT_STYLE_NORMAL]]
}
}
- @property size {
+ @property grid_size {
set {
[[Set the size of the textgrid object.
@@ -48,6 +48,7 @@ class Evas.Textgrid (Efl.Canvas.Object, Efl.Text.Properties, Efl.Text.Font,
function does nothing.
@since 1.7]]
+ legacy: evas_object_textgrid_size_set;
}
get {
[[Get the size of the textgrid object.
@@ -58,6 +59,7 @@ class Evas.Textgrid (Efl.Canvas.Object, Efl.Text.Properties, Efl.Text.Font,
$null. On error, they are set to 0.
@since 1.7]]
+ legacy: evas_object_textgrid_size_get;
}
values {
w: int; [[The number of columns (width in cells) of the grid.]]
@@ -75,7 +77,7 @@ class Evas.Textgrid (Efl.Canvas.Object, Efl.Text.Properties, Efl.Text.Font,
$width and $height can be $null. On error, they are
set to 0.
- See also @Efl.Text.Properties.font.set and @.supported_font_styles.set
+ See also @Efl.Text_Font.font.set and @.supported_font_styles.set
@since 1.7]]
}
@@ -90,7 +92,7 @@ class Evas.Textgrid (Efl.Canvas.Object, Efl.Text.Properties, Efl.Text.Font,
This function declares to evas that a region of cells was updated by
code and needs refreshing.
- See also @.cellrow_set, @.cellrow_get and @.size.set.
+ See also @.cellrow_set, @.cellrow_get and @.grid_size.set.
@since 1.7]]
/* FIXME-doc
@@ -121,7 +123,7 @@ class Evas.Textgrid (Efl.Canvas.Object, Efl.Text.Properties, Efl.Text.Font,
same row pointer returned by evas_object_textgrid_cellrow_get for the
same row $y.
- See also @.cellrow_get, @.size.set and @.update_add.
+ See also @.cellrow_get, @.grid_size.set and @.update_add.
@since 1.7]]
@@ -137,7 +139,7 @@ class Evas.Textgrid (Efl.Canvas.Object, Efl.Text.Properties, Efl.Text.Font,
of the textgrid object $obj. If $y is not between 0 and the
number of lines of the grid - 1, or on error, this function return $null.
- See also @.cellrow_set, @.size.set and @.update_add.
+ See also @.cellrow_set, @.grid_size.set and @.update_add.
@since 1.7]]
return: ptr(Evas.Textgrid.Cell); [[A pointer to the first cell of the given row.]]
@@ -199,9 +201,9 @@ class Evas.Textgrid (Efl.Canvas.Object, Efl.Text.Properties, Efl.Text.Font,
implements {
Efl.Object.constructor;
Efl.Object.destructor;
- Efl.Text.Properties.font { get; set; }
- Efl.Text.Properties.font_source { get; set; }
- Efl.Text.Font.font_bitmap_scalable { get; set; }
- Efl.Gfx.scale { set; }
+ Efl.Text_Font.font { get; set; }
+ Efl.Text_Font.font_source { get; set; }
+ Efl.Text_Font.font_bitmap_scalable { get; set; }
+ Efl.Gfx.Entity.scale { set; }
}
}
diff --git a/src/lib/evas/canvas/evas_vg_container.c b/src/lib/evas/canvas/evas_vg_container.c
index 5ddad99390..367a3c99ca 100644
--- a/src/lib/evas/canvas/evas_vg_container.c
+++ b/src/lib/evas/canvas/evas_vg_container.c
@@ -3,19 +3,36 @@
#include "evas_vg_private.h"
-#define MY_CLASS EFL_VG_CONTAINER_CLASS
+#define MY_CLASS EFL_CANVAS_VG_CONTAINER_CLASS
static void
-_efl_vg_container_render_pre(Eo *obj EINA_UNUSED,
+_invalidate_cb(void *data EINA_UNUSED, const Efl_Event *event)
+{
+ Efl_Canvas_Vg_Container_Data *pd;
+ Eina_List *l;
+ Efl_VG* child;
+
+ pd = efl_data_scope_get(event->object, MY_CLASS);
+
+ /* Clean up all the references by copying.
+ If the container is copied, it copies its children as well.
+ Since evas_vg_node is duplicated using efl_add_ref(),
+ we definitely call efl_unref() after that. */
+ EINA_LIST_FOREACH(pd->children, l, child)
+ efl_unref(child);
+}
+
+static void
+_efl_canvas_vg_container_render_pre(Eo *obj EINA_UNUSED,
Eina_Matrix3 *parent,
Ector_Surface *s,
void *data,
- Efl_VG_Data *nd)
+ Efl_Canvas_Vg_Node_Data *nd)
{
- Efl_VG_Container_Data *pd = data;
+ Efl_Canvas_Vg_Container_Data *pd = data;
Eina_List *l;
Eo *child;
- Efl_VG_Data *child_nd;
+ Efl_Canvas_Vg_Node_Data *child_nd;
Efl_Gfx_Change_Flag flag;
if (nd->flags == EFL_GFX_CHANGE_FLAG_NONE) return ;
@@ -23,13 +40,13 @@ _efl_vg_container_render_pre(Eo *obj EINA_UNUSED,
flag = nd->flags;
nd->flags = EFL_GFX_CHANGE_FLAG_NONE;
- EFL_VG_COMPUTE_MATRIX(current, parent, nd);
+ EFL_CANVAS_VG_COMPUTE_MATRIX(current, parent, nd);
EINA_LIST_FOREACH(pd->children, l, child)
{
if (flag & EFL_GFX_CHANGE_FLAG_MATRIX)
{
- child_nd = efl_data_scope_get(child, EFL_VG_CLASS);
+ child_nd = efl_data_scope_get(child, EFL_CANVAS_VG_NODE_CLASS);
child_nd->flags |= EFL_GFX_CHANGE_FLAG_MATRIX;
}
_evas_vg_render_pre(child, s, current);
@@ -37,17 +54,17 @@ _efl_vg_container_render_pre(Eo *obj EINA_UNUSED,
}
static Eo *
-_efl_vg_container_efl_object_constructor(Eo *obj,
- Efl_VG_Container_Data *pd)
+_efl_canvas_vg_container_efl_object_constructor(Eo *obj,
+ Efl_Canvas_Vg_Container_Data *pd)
{
- Efl_VG_Data *nd;
+ Efl_Canvas_Vg_Node_Data *nd;
pd->names = eina_hash_stringshared_new(NULL);
obj = efl_constructor(efl_super(obj, MY_CLASS));
- nd = efl_data_scope_get(obj, EFL_VG_CLASS);
- nd->render_pre = _efl_vg_container_render_pre;
+ nd = efl_data_scope_get(obj, EFL_CANVAS_VG_NODE_CLASS);
+ nd->render_pre = _efl_canvas_vg_container_render_pre;
nd->data = pd;
nd->flags = EFL_GFX_CHANGE_FLAG_ALL;
@@ -55,18 +72,16 @@ _efl_vg_container_efl_object_constructor(Eo *obj,
}
static void
-_efl_vg_container_efl_object_destructor(Eo *obj,
- Efl_VG_Container_Data *pd EINA_UNUSED)
+_efl_canvas_vg_container_efl_object_destructor(Eo *obj,
+ Efl_Canvas_Vg_Container_Data *pd EINA_UNUSED)
{
efl_destructor(efl_super(obj, MY_CLASS));
-
eina_hash_free(pd->names);
- pd->names = NULL;
}
static void
-_efl_vg_container_efl_vg_bounds_get(Eo *obj EINA_UNUSED,
- Efl_VG_Container_Data *pd,
+_efl_canvas_vg_container_efl_gfx_path_bounds_get(const Eo *obj EINA_UNUSED,
+ Efl_Canvas_Vg_Container_Data *pd,
Eina_Rect *r)
{
Eina_Rect s;
@@ -80,19 +95,19 @@ _efl_vg_container_efl_vg_bounds_get(Eo *obj EINA_UNUSED,
{
if (first)
{
- efl_vg_bounds_get(child, r);
+ efl_gfx_path_bounds_get(child, r);
first = EINA_FALSE;
}
else
{
- efl_vg_bounds_get(child, &s);
+ efl_gfx_path_bounds_get(child, &s);
eina_rectangle_union(&r->rect, &s.rect);
}
}
}
static Efl_VG *
-_efl_vg_container_child_get(Eo *obj EINA_UNUSED, Efl_VG_Container_Data *pd, const char *name)
+_efl_canvas_vg_container_child_get(Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Container_Data *pd, const char *name)
{
const char *tmp = eina_stringshare_add(name);
Efl_VG *r;
@@ -104,33 +119,31 @@ _efl_vg_container_child_get(Eo *obj EINA_UNUSED, Efl_VG_Container_Data *pd, cons
}
static Eina_Iterator *
-_efl_vg_container_children_get(Eo *obj EINA_UNUSED, Efl_VG_Container_Data *pd)
+_efl_canvas_vg_container_children_get(Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Container_Data *pd)
{
return eina_list_iterator_new(pd->children);
}
static Eina_Bool
-_efl_vg_container_efl_vg_interpolate(Eo *obj,
- Efl_VG_Container_Data *pd,
- const Efl_VG *from, const Efl_VG *to,
- double pos_map)
+_efl_canvas_vg_container_efl_gfx_path_interpolate(Eo *obj, Efl_Canvas_Vg_Container_Data *pd, const Efl_VG *from, const Efl_VG *to, double pos_map)
{
Eina_Iterator *from_it, *to_it;
Eina_List *l;
Eina_Bool r, res = EINA_TRUE;
Eo *from_child, *to_child, *child;
- //1. check if both the object are containers
- if (!(efl_isa(from, EFL_VG_CONTAINER_CLASS) &&
- efl_isa(to, EFL_VG_CONTAINER_CLASS)))
+ //Check if both objects have same type
+ if (!(efl_isa(from, MY_CLASS) && efl_isa(to, MY_CLASS)))
return EINA_FALSE;
- r = efl_vg_interpolate(efl_super(obj, EFL_VG_CONTAINER_CLASS), from, to, pos_map);
-
+ //Interpolates this nodes
+ r = efl_gfx_path_interpolate(efl_super(obj, MY_CLASS), from, to, pos_map);
if (!r) return EINA_FALSE;
- from_it = efl_vg_container_children_get((Efl_VG *)from);
- to_it = efl_vg_container_children_get((Efl_VG *)to);
+ from_it = efl_canvas_vg_container_children_get((Efl_VG *)from);
+ to_it = efl_canvas_vg_container_children_get((Efl_VG *)to);
+
+ //Interpolates children
EINA_LIST_FOREACH (pd->children, l, child)
{
res &= eina_iterator_next(from_it, (void **)&from_child);
@@ -141,10 +154,10 @@ _efl_vg_container_efl_vg_interpolate(Eo *obj,
r = EINA_FALSE;
break;
}
- r &= efl_vg_interpolate(child, from_child, to_child, pos_map);
- if (!r)
- break;
+ r = efl_gfx_path_interpolate(child, from_child, to_child, pos_map);
+ if (!r) break;
}
+
eina_iterator_free(from_it);
eina_iterator_free(to_it);
@@ -152,25 +165,34 @@ _efl_vg_container_efl_vg_interpolate(Eo *obj,
}
EOLIAN static Efl_VG *
-_efl_vg_container_efl_duplicate_duplicate(const Eo *obj, Efl_VG_Container_Data *pd)
+_efl_canvas_vg_container_efl_duplicate_duplicate(const Eo *obj,
+ Efl_Canvas_Vg_Container_Data *pd)
{
Eina_List *l;
Efl_VG *child;
- Efl_VG *cn = NULL;
+ Efl_VG *container;
+
+ container = efl_duplicate(efl_super(obj, MY_CLASS));
+ efl_event_callback_add(container, EFL_EVENT_INVALIDATE, _invalidate_cb, NULL);
+ efl_parent_set(container, efl_parent_get(obj));
- cn = efl_duplicate(efl_super(obj, MY_CLASS));
+ //Copy Children
EINA_LIST_FOREACH(pd->children, l, child)
{
- // parent_set adds the new node to the list of children of cn
- efl_parent_set(efl_duplicate(child), cn);
+ Efl_VG *eo = efl_duplicate(child);
+ efl_parent_set(eo, container);
}
- return cn;
+
+ return container;
}
EAPI Efl_VG*
evas_vg_container_add(Efl_VG *parent)
{
- return efl_add(EFL_VG_CONTAINER_CLASS, parent);
+ /* Warn it because the usage has been changed.
+ We can remove this message after v1.21. */
+ if (!parent) CRI("Efl_VG Container doesn't allow null parent!");
+ return efl_add(MY_CLASS, parent);
}
-#include "efl_vg_container.eo.c"
+#include "efl_canvas_vg_container.eo.c"
diff --git a/src/lib/evas/canvas/evas_vg_gradient.c b/src/lib/evas/canvas/evas_vg_gradient.c
index af4014c99f..b55f3c31a8 100644
--- a/src/lib/evas/canvas/evas_vg_gradient.c
+++ b/src/lib/evas/canvas/evas_vg_gradient.c
@@ -5,11 +5,11 @@
#include <strings.h>
-#define MY_CLASS EFL_VG_GRADIENT_CLASS
+#define MY_CLASS EFL_CANVAS_VG_GRADIENT_CLASS
static void
-_efl_vg_gradient_efl_gfx_gradient_stop_set(Eo *obj EINA_UNUSED,
- Efl_VG_Gradient_Data *pd,
+_efl_canvas_vg_gradient_efl_gfx_gradient_stop_set(Eo *obj EINA_UNUSED,
+ Efl_Canvas_Vg_Gradient_Data *pd,
const Efl_Gfx_Gradient_Stop *colors,
unsigned int length)
{
@@ -23,12 +23,12 @@ _efl_vg_gradient_efl_gfx_gradient_stop_set(Eo *obj EINA_UNUSED,
memcpy(pd->colors, colors, length * sizeof(Efl_Gfx_Gradient_Stop));
pd->colors_count = length;
- _efl_vg_changed(obj);
+ _efl_canvas_vg_node_changed(obj);
}
static void
-_efl_vg_gradient_efl_gfx_gradient_stop_get(Eo *obj EINA_UNUSED,
- Efl_VG_Gradient_Data *pd,
+_efl_canvas_vg_gradient_efl_gfx_gradient_stop_get(const Eo *obj EINA_UNUSED,
+ Efl_Canvas_Vg_Gradient_Data *pd,
const Efl_Gfx_Gradient_Stop **colors,
unsigned int *length)
{
@@ -37,38 +37,38 @@ _efl_vg_gradient_efl_gfx_gradient_stop_get(Eo *obj EINA_UNUSED,
}
static void
-_efl_vg_gradient_efl_gfx_gradient_spread_set(Eo *obj EINA_UNUSED,
- Efl_VG_Gradient_Data *pd,
+_efl_canvas_vg_gradient_efl_gfx_gradient_spread_set(Eo *obj EINA_UNUSED,
+ Efl_Canvas_Vg_Gradient_Data *pd,
Efl_Gfx_Gradient_Spread s)
{
pd->s = s;
- _efl_vg_changed(obj);
+ _efl_canvas_vg_node_changed(obj);
}
static Efl_Gfx_Gradient_Spread
-_efl_vg_gradient_efl_gfx_gradient_spread_get(Eo *obj EINA_UNUSED,
- Efl_VG_Gradient_Data *pd)
+_efl_canvas_vg_gradient_efl_gfx_gradient_spread_get(const Eo *obj EINA_UNUSED,
+ Efl_Canvas_Vg_Gradient_Data *pd)
{
return pd->s;
}
static Eina_Bool
-_efl_vg_gradient_efl_vg_interpolate(Eo *obj,
- Efl_VG_Gradient_Data *pd,
+_efl_canvas_vg_gradient_efl_gfx_path_interpolate(Eo *obj,
+ Efl_Canvas_Vg_Gradient_Data *pd,
const Efl_VG *from, const Efl_VG *to,
double pos_map)
{
- Efl_VG_Gradient_Data *fromd, *tod;
+ Efl_Canvas_Vg_Gradient_Data *fromd, *tod;
Efl_Gfx_Gradient_Stop *colors;
unsigned int i;
double from_map;
Eina_Bool r;
- r = efl_vg_interpolate(efl_super(obj, EFL_VG_GRADIENT_CLASS), from, to, pos_map);
+ r = efl_gfx_path_interpolate(efl_super(obj, EFL_CANVAS_VG_GRADIENT_CLASS), from, to, pos_map);
- fromd = efl_data_scope_get(from, EFL_VG_GRADIENT_CLASS);
- tod = efl_data_scope_get(to, EFL_VG_GRADIENT_CLASS);
+ fromd = efl_data_scope_get(from, EFL_CANVAS_VG_GRADIENT_CLASS);
+ tod = efl_data_scope_get(to, EFL_CANVAS_VG_GRADIENT_CLASS);
from_map = 1.0 - pos_map;
if (!r) return EINA_FALSE;
@@ -97,7 +97,7 @@ _efl_vg_gradient_efl_vg_interpolate(Eo *obj,
}
EOLIAN static Efl_VG *
-_efl_vg_gradient_efl_duplicate_duplicate(const Eo *obj, Efl_VG_Gradient_Data *pd)
+_efl_canvas_vg_gradient_efl_duplicate_duplicate(const Eo *obj, Efl_Canvas_Vg_Gradient_Data *pd)
{
Efl_VG *cn = NULL;
@@ -132,4 +132,4 @@ evas_vg_gradient_spread_get(Eo *obj)
return efl_gfx_gradient_spread_get(obj);
}
-#include "efl_vg_gradient.eo.c"
+#include "efl_canvas_vg_gradient.eo.c"
diff --git a/src/lib/evas/canvas/evas_vg_gradient_linear.c b/src/lib/evas/canvas/evas_vg_gradient_linear.c
index 8747950b5f..c7a1263c92 100644
--- a/src/lib/evas/canvas/evas_vg_gradient_linear.c
+++ b/src/lib/evas/canvas/evas_vg_gradient_linear.c
@@ -5,10 +5,10 @@
#include <strings.h>
-#define MY_CLASS EFL_VG_GRADIENT_LINEAR_CLASS
+#define MY_CLASS EFL_CANVAS_VG_GRADIENT_LINEAR_CLASS
-typedef struct _Efl_VG_Gradient_Linear_Data Efl_VG_Gradient_Linear_Data;
-struct _Efl_VG_Gradient_Linear_Data
+typedef struct _Efl_Canvas_Vg_Gradient_Linear_Data Efl_Canvas_Vg_Gradient_Linear_Data;
+struct _Efl_Canvas_Vg_Gradient_Linear_Data
{
struct {
double x, y;
@@ -16,19 +16,19 @@ struct _Efl_VG_Gradient_Linear_Data
};
static void
-_efl_vg_gradient_linear_efl_gfx_gradient_linear_start_set(Eo *obj EINA_UNUSED,
- Efl_VG_Gradient_Linear_Data *pd,
+_efl_canvas_vg_gradient_linear_efl_gfx_gradient_linear_start_set(Eo *obj EINA_UNUSED,
+ Efl_Canvas_Vg_Gradient_Linear_Data *pd,
double x, double y)
{
pd->start.x = x;
pd->start.y = y;
- _efl_vg_changed(obj);
+ _efl_canvas_vg_node_changed(obj);
}
static void
-_efl_vg_gradient_linear_efl_gfx_gradient_linear_start_get(Eo *obj EINA_UNUSED,
- Efl_VG_Gradient_Linear_Data *pd,
+_efl_canvas_vg_gradient_linear_efl_gfx_gradient_linear_start_get(const Eo *obj EINA_UNUSED,
+ Efl_Canvas_Vg_Gradient_Linear_Data *pd,
double *x, double *y)
{
if (x) *x = pd->start.x;
@@ -36,19 +36,19 @@ _efl_vg_gradient_linear_efl_gfx_gradient_linear_start_get(Eo *obj EINA_UNUSED,
}
static void
-_efl_vg_gradient_linear_efl_gfx_gradient_linear_end_set(Eo *obj EINA_UNUSED,
- Efl_VG_Gradient_Linear_Data *pd,
+_efl_canvas_vg_gradient_linear_efl_gfx_gradient_linear_end_set(Eo *obj EINA_UNUSED,
+ Efl_Canvas_Vg_Gradient_Linear_Data *pd,
double x, double y)
{
pd->end.x = x;
pd->end.y = y;
- _efl_vg_changed(obj);
+ _efl_canvas_vg_node_changed(obj);
}
static void
-_efl_vg_gradient_linear_efl_gfx_gradient_linear_end_get(Eo *obj EINA_UNUSED,
- Efl_VG_Gradient_Linear_Data *pd,
+_efl_canvas_vg_gradient_linear_efl_gfx_gradient_linear_end_get(const Eo *obj EINA_UNUSED,
+ Efl_Canvas_Vg_Gradient_Linear_Data *pd,
double *x, double *y)
{
if (x) *x = pd->end.x;
@@ -56,21 +56,21 @@ _efl_vg_gradient_linear_efl_gfx_gradient_linear_end_get(Eo *obj EINA_UNUSED,
}
static void
-_efl_vg_gradient_linear_render_pre(Eo *obj,
+_efl_canvas_vg_gradient_linear_render_pre(Eo *obj,
Eina_Matrix3 *parent,
Ector_Surface *s,
void *data,
- Efl_VG_Data *nd)
+ Efl_Canvas_Vg_Node_Data *nd)
{
- Efl_VG_Gradient_Linear_Data *pd = data;
- Efl_VG_Gradient_Data *gd;
+ Efl_Canvas_Vg_Gradient_Linear_Data *pd = data;
+ Efl_Canvas_Vg_Gradient_Data *gd;
if (nd->flags == EFL_GFX_CHANGE_FLAG_NONE) return ;
nd->flags = EFL_GFX_CHANGE_FLAG_NONE;
- gd = efl_data_scope_get(obj, EFL_VG_GRADIENT_CLASS);
- EFL_VG_COMPUTE_MATRIX(current, parent, nd);
+ gd = efl_data_scope_get(obj, EFL_CANVAS_VG_GRADIENT_CLASS);
+ EFL_CANVAS_VG_COMPUTE_MATRIX(current, parent, nd);
if (!nd->renderer)
{
@@ -91,53 +91,53 @@ _efl_vg_gradient_linear_render_pre(Eo *obj,
}
static Eo *
-_efl_vg_gradient_linear_efl_object_constructor(Eo *obj,
- Efl_VG_Gradient_Linear_Data *pd)
+_efl_canvas_vg_gradient_linear_efl_object_constructor(Eo *obj,
+ Efl_Canvas_Vg_Gradient_Linear_Data *pd)
{
- Efl_VG_Data *nd;
+ Efl_Canvas_Vg_Node_Data *nd;
obj = efl_constructor(efl_super(obj, MY_CLASS));
- nd = efl_data_scope_get(obj, EFL_VG_CLASS);
- nd->render_pre = _efl_vg_gradient_linear_render_pre;
+ nd = efl_data_scope_get(obj, EFL_CANVAS_VG_NODE_CLASS);
+ nd->render_pre = _efl_canvas_vg_gradient_linear_render_pre;
nd->data = pd;
return obj;
}
static void
-_efl_vg_gradient_linear_efl_object_destructor(Eo *obj, Efl_VG_Gradient_Linear_Data *pd EINA_UNUSED)
+_efl_canvas_vg_gradient_linear_efl_object_destructor(Eo *obj, Efl_Canvas_Vg_Gradient_Linear_Data *pd EINA_UNUSED)
{
efl_destructor(efl_super(obj, MY_CLASS));
}
static void
-_efl_vg_gradient_linear_efl_vg_bounds_get(Eo *obj, Efl_VG_Gradient_Linear_Data *pd, Eina_Rect *r)
+_efl_canvas_vg_gradient_linear_efl_gfx_path_bounds_get(const Eo *obj, Efl_Canvas_Vg_Gradient_Linear_Data *pd, Eina_Rect *r)
{
- Efl_VG_Data *nd;
+ Efl_Canvas_Vg_Node_Data *nd;
- nd = efl_data_scope_get(obj, EFL_VG_CLASS);
+ nd = efl_data_scope_get(obj, EFL_CANVAS_VG_NODE_CLASS);
EINA_RECTANGLE_SET(r,
nd->x + pd->start.x, nd->y + pd->start.y,
pd->end.x - pd->start.x, pd->end.y - pd->start.x);
}
static Eina_Bool
-_efl_vg_gradient_linear_efl_vg_interpolate(Eo *obj,
- Efl_VG_Gradient_Linear_Data *pd,
+_efl_canvas_vg_gradient_linear_efl_gfx_path_interpolate(Eo *obj,
+ Efl_Canvas_Vg_Gradient_Linear_Data *pd,
const Efl_VG *from, const Efl_VG *to,
double pos_map)
{
- Efl_VG_Gradient_Linear_Data *fromd, *tod;
+ Efl_Canvas_Vg_Gradient_Linear_Data *fromd, *tod;
double from_map;
Eina_Bool r;
- r = efl_vg_interpolate(efl_super(obj, EFL_VG_GRADIENT_LINEAR_CLASS), from, to, pos_map);
+ r = efl_gfx_path_interpolate(efl_super(obj, EFL_CANVAS_VG_GRADIENT_LINEAR_CLASS), from, to, pos_map);
if (!r) return EINA_FALSE;
- fromd = efl_data_scope_get(from, EFL_VG_GRADIENT_LINEAR_CLASS);
- tod = efl_data_scope_get(to, EFL_VG_GRADIENT_LINEAR_CLASS);
+ fromd = efl_data_scope_get(from, EFL_CANVAS_VG_GRADIENT_LINEAR_CLASS);
+ tod = efl_data_scope_get(to, EFL_CANVAS_VG_GRADIENT_LINEAR_CLASS);
from_map = 1.0 - pos_map;
#define INTP(Pd, From, To, Member, From_Map, Pos_Map) \
@@ -154,7 +154,7 @@ _efl_vg_gradient_linear_efl_vg_interpolate(Eo *obj,
}
EOLIAN static Efl_VG *
-_efl_vg_gradient_linear_efl_duplicate_duplicate(const Eo *obj, Efl_VG_Gradient_Linear_Data *pd)
+_efl_canvas_vg_gradient_linear_efl_duplicate_duplicate(const Eo *obj, Efl_Canvas_Vg_Gradient_Linear_Data *pd)
{
Efl_VG *cn = NULL;
@@ -191,7 +191,7 @@ evas_vg_gradient_linear_end_get(Eo *obj, double *x, double *y)
EAPI Efl_VG*
evas_vg_gradient_linear_add(Efl_VG *parent)
{
- return efl_add(EFL_VG_GRADIENT_LINEAR_CLASS, parent);
+ return efl_add(EFL_CANVAS_VG_GRADIENT_LINEAR_CLASS, parent);
}
-#include "efl_vg_gradient_linear.eo.c"
+#include "efl_canvas_vg_gradient_linear.eo.c"
diff --git a/src/lib/evas/canvas/evas_vg_gradient_radial.c b/src/lib/evas/canvas/evas_vg_gradient_radial.c
index 1489e8100c..573c17a79f 100644
--- a/src/lib/evas/canvas/evas_vg_gradient_radial.c
+++ b/src/lib/evas/canvas/evas_vg_gradient_radial.c
@@ -3,10 +3,10 @@
#include "evas_vg_private.h"
-#define MY_CLASS EFL_VG_GRADIENT_RADIAL_CLASS
+#define MY_CLASS EFL_CANVAS_VG_GRADIENT_RADIAL_CLASS
-typedef struct _Efl_VG_Gradient_Radial_Data Efl_VG_Gradient_Radial_Data;
-struct _Efl_VG_Gradient_Radial_Data
+typedef struct _Efl_Canvas_Vg_Gradient_Radial_Data Efl_Canvas_Vg_Gradient_Radial_Data;
+struct _Efl_Canvas_Vg_Gradient_Radial_Data
{
struct {
double x, y;
@@ -15,19 +15,19 @@ struct _Efl_VG_Gradient_Radial_Data
};
static void
-_efl_vg_gradient_radial_efl_gfx_gradient_radial_center_set(Eo *obj EINA_UNUSED,
- Efl_VG_Gradient_Radial_Data *pd,
+_efl_canvas_vg_gradient_radial_efl_gfx_gradient_radial_center_set(Eo *obj EINA_UNUSED,
+ Efl_Canvas_Vg_Gradient_Radial_Data *pd,
double x, double y)
{
pd->center.x = x;
pd->center.y = y;
- _efl_vg_changed(obj);
+ _efl_canvas_vg_node_changed(obj);
}
static void
-_efl_vg_gradient_radial_efl_gfx_gradient_radial_center_get(Eo *obj EINA_UNUSED,
- Efl_VG_Gradient_Radial_Data *pd,
+_efl_canvas_vg_gradient_radial_efl_gfx_gradient_radial_center_get(const Eo *obj EINA_UNUSED,
+ Efl_Canvas_Vg_Gradient_Radial_Data *pd,
double *x, double *y)
{
if (x) *x = pd->center.x;
@@ -35,36 +35,36 @@ _efl_vg_gradient_radial_efl_gfx_gradient_radial_center_get(Eo *obj EINA_UNUSED,
}
static void
-_efl_vg_gradient_radial_efl_gfx_gradient_radial_radius_set(Eo *obj EINA_UNUSED,
- Efl_VG_Gradient_Radial_Data *pd,
+_efl_canvas_vg_gradient_radial_efl_gfx_gradient_radial_radius_set(Eo *obj EINA_UNUSED,
+ Efl_Canvas_Vg_Gradient_Radial_Data *pd,
double r)
{
pd->radius = r;
- _efl_vg_changed(obj);
+ _efl_canvas_vg_node_changed(obj);
}
static double
-_efl_vg_gradient_radial_efl_gfx_gradient_radial_radius_get(Eo *obj EINA_UNUSED,
- Efl_VG_Gradient_Radial_Data *pd)
+_efl_canvas_vg_gradient_radial_efl_gfx_gradient_radial_radius_get(const Eo *obj EINA_UNUSED,
+ Efl_Canvas_Vg_Gradient_Radial_Data *pd)
{
return pd->radius;
}
static void
-_efl_vg_gradient_radial_efl_gfx_gradient_radial_focal_set(Eo *obj EINA_UNUSED,
- Efl_VG_Gradient_Radial_Data *pd,
+_efl_canvas_vg_gradient_radial_efl_gfx_gradient_radial_focal_set(Eo *obj EINA_UNUSED,
+ Efl_Canvas_Vg_Gradient_Radial_Data *pd,
double x, double y)
{
pd->focal.x = x;
pd->focal.y = y;
- _efl_vg_changed(obj);
+ _efl_canvas_vg_node_changed(obj);
}
static void
-_efl_vg_gradient_radial_efl_gfx_gradient_radial_focal_get(Eo *obj EINA_UNUSED,
- Efl_VG_Gradient_Radial_Data *pd,
+_efl_canvas_vg_gradient_radial_efl_gfx_gradient_radial_focal_get(const Eo *obj EINA_UNUSED,
+ Efl_Canvas_Vg_Gradient_Radial_Data *pd,
double *x, double *y)
{
if (x) *x = pd->focal.x;
@@ -72,21 +72,21 @@ _efl_vg_gradient_radial_efl_gfx_gradient_radial_focal_get(Eo *obj EINA_UNUSED,
}
static void
-_efl_vg_gradient_radial_render_pre(Eo *obj,
+_efl_canvas_vg_gradient_radial_render_pre(Eo *obj,
Eina_Matrix3 *parent,
Ector_Surface *s,
void *data,
- Efl_VG_Data *nd)
+ Efl_Canvas_Vg_Node_Data *nd)
{
- Efl_VG_Gradient_Radial_Data *pd = data;
- Efl_VG_Gradient_Data *gd;
+ Efl_Canvas_Vg_Gradient_Radial_Data *pd = data;
+ Efl_Canvas_Vg_Gradient_Data *gd;
if (nd->flags == EFL_GFX_CHANGE_FLAG_NONE) return ;
nd->flags = EFL_GFX_CHANGE_FLAG_NONE;
- gd = efl_data_scope_get(obj, EFL_VG_GRADIENT_CLASS);
- EFL_VG_COMPUTE_MATRIX(current, parent, nd);
+ gd = efl_data_scope_get(obj, EFL_CANVAS_VG_GRADIENT_CLASS);
+ EFL_CANVAS_VG_COMPUTE_MATRIX(current, parent, nd);
if (!nd->renderer)
{
@@ -108,32 +108,32 @@ _efl_vg_gradient_radial_render_pre(Eo *obj,
}
static Eo *
-_efl_vg_gradient_radial_efl_object_constructor(Eo *obj, Efl_VG_Gradient_Radial_Data *pd)
+_efl_canvas_vg_gradient_radial_efl_object_constructor(Eo *obj, Efl_Canvas_Vg_Gradient_Radial_Data *pd)
{
- Efl_VG_Data *nd;
+ Efl_Canvas_Vg_Node_Data *nd;
obj = efl_constructor(efl_super(obj, MY_CLASS));
- nd = efl_data_scope_get(obj, EFL_VG_CLASS);
- nd->render_pre = _efl_vg_gradient_radial_render_pre;
+ nd = efl_data_scope_get(obj, EFL_CANVAS_VG_NODE_CLASS);
+ nd->render_pre = _efl_canvas_vg_gradient_radial_render_pre;
nd->data = pd;
return obj;
}
static void
-_efl_vg_gradient_radial_efl_object_destructor(Eo *obj,
- Efl_VG_Gradient_Radial_Data *pd EINA_UNUSED)
+_efl_canvas_vg_gradient_radial_efl_object_destructor(Eo *obj,
+ Efl_Canvas_Vg_Gradient_Radial_Data *pd EINA_UNUSED)
{
efl_destructor(efl_super(obj, MY_CLASS));
}
static void
-_efl_vg_gradient_radial_efl_vg_bounds_get(Eo *obj, Efl_VG_Gradient_Radial_Data *pd, Eina_Rect *r)
+_efl_canvas_vg_gradient_radial_efl_gfx_path_bounds_get(const Eo *obj, Efl_Canvas_Vg_Gradient_Radial_Data *pd, Eina_Rect *r)
{
- Efl_VG_Data *nd;
+ Efl_Canvas_Vg_Node_Data *nd;
- nd = efl_data_scope_get(obj, EFL_VG_CLASS);
+ nd = efl_data_scope_get(obj, EFL_CANVAS_VG_NODE_CLASS);
EINA_RECTANGLE_SET(r,
nd->x + pd->center.x - pd->radius,
nd->y + pd->center.y - pd->radius,
@@ -141,21 +141,21 @@ _efl_vg_gradient_radial_efl_vg_bounds_get(Eo *obj, Efl_VG_Gradient_Radial_Data *
}
static Eina_Bool
-_efl_vg_gradient_radial_efl_vg_interpolate(Eo *obj,
- Efl_VG_Gradient_Radial_Data *pd,
+_efl_canvas_vg_gradient_radial_efl_gfx_path_interpolate(Eo *obj,
+ Efl_Canvas_Vg_Gradient_Radial_Data *pd,
const Efl_VG *from, const Efl_VG *to,
double pos_map)
{
- Efl_VG_Gradient_Radial_Data *fromd, *tod;
+ Efl_Canvas_Vg_Gradient_Radial_Data *fromd, *tod;
double from_map;
Eina_Bool r;
- r = efl_vg_interpolate(efl_super(obj, EFL_VG_GRADIENT_RADIAL_CLASS), from, to, pos_map);
+ r = efl_gfx_path_interpolate(efl_super(obj, EFL_CANVAS_VG_GRADIENT_RADIAL_CLASS), from, to, pos_map);
if (!r) return EINA_FALSE;
- fromd = efl_data_scope_get(from, EFL_VG_GRADIENT_RADIAL_CLASS);
- tod = efl_data_scope_get(to, EFL_VG_GRADIENT_RADIAL_CLASS);
+ fromd = efl_data_scope_get(from, EFL_CANVAS_VG_GRADIENT_RADIAL_CLASS);
+ tod = efl_data_scope_get(to, EFL_CANVAS_VG_GRADIENT_RADIAL_CLASS);
from_map = 1.0 - pos_map;
#define INTP(Pd, From, To, Member, From_Map, Pos_Map) \
@@ -174,7 +174,7 @@ _efl_vg_gradient_radial_efl_vg_interpolate(Eo *obj,
EOLIAN static Efl_VG *
-_efl_vg_gradient_radial_efl_duplicate_duplicate(const Eo *obj, Efl_VG_Gradient_Radial_Data *pd)
+_efl_canvas_vg_gradient_radial_efl_duplicate_duplicate(const Eo *obj, Efl_Canvas_Vg_Gradient_Radial_Data *pd)
{
Efl_VG *cn = NULL;
@@ -225,7 +225,7 @@ evas_vg_gradient_radial_focal_get(Eo *obj, double *x, double *y)
EAPI Efl_VG*
evas_vg_gradient_radial_add(Efl_VG *parent)
{
- return efl_add(EFL_VG_GRADIENT_RADIAL_CLASS, parent);
+ return efl_add(EFL_CANVAS_VG_GRADIENT_RADIAL_CLASS, parent);
}
-#include "efl_vg_gradient_radial.eo.c"
+#include "efl_canvas_vg_gradient_radial.eo.c"
diff --git a/src/lib/evas/canvas/evas_vg_node.c b/src/lib/evas/canvas/evas_vg_node.c
index e5883e465a..e7ef736528 100644
--- a/src/lib/evas/canvas/evas_vg_node.c
+++ b/src/lib/evas/canvas/evas_vg_node.c
@@ -6,9 +6,9 @@
#include <string.h>
#include <math.h>
-#define MY_CLASS EFL_VG_CLASS
+#define MY_CLASS EFL_CANVAS_VG_NODE_CLASS
-static const Efl_VG_Interpolation interpolation_identity = {
+static const Efl_Canvas_Vg_Interpolation interpolation_identity = {
{ 0, 0, 0, 1 },
{ 0, 0, 0, 1 },
{ 0, 0, 0 },
@@ -17,20 +17,21 @@ static const Efl_VG_Interpolation interpolation_identity = {
};
static void
-_efl_vg_property_changed(void *data, const Efl_Event *event EINA_UNUSED)
+_efl_canvas_vg_node_property_changed(void *data, const Efl_Event *event EINA_UNUSED)
{
- Efl_VG_Data *pd = data;
+ Efl_Canvas_Vg_Node_Data *pd = data;
Eo *parent;
if (!pd->flags) pd->flags = EFL_GFX_CHANGE_FLAG_ALL;
+ if (efl_invalidated_get(event->object)) return;
parent = efl_parent_get(event->object);
efl_event_callback_call(parent, event->desc, event->info);
}
static void
-_efl_vg_transformation_set(Eo *obj,
- Efl_VG_Data *pd,
+_efl_canvas_vg_node_transformation_set(Eo *obj,
+ Efl_Canvas_Vg_Node_Data *pd,
const Eina_Matrix3 *m)
{
if (pd->intp)
@@ -55,29 +56,29 @@ _efl_vg_transformation_set(Eo *obj,
}
pd->flags |= EFL_GFX_CHANGE_FLAG_MATRIX;
- _efl_vg_changed(obj);
+ _efl_canvas_vg_node_changed(obj);
}
const Eina_Matrix3 *
-_efl_vg_transformation_get(Eo *obj EINA_UNUSED, Efl_VG_Data *pd)
+_efl_canvas_vg_node_transformation_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Node_Data *pd)
{
return pd->m;
}
static void
-_efl_vg_origin_set(Eo *obj,
- Efl_VG_Data *pd,
+_efl_canvas_vg_node_origin_set(Eo *obj,
+ Efl_Canvas_Vg_Node_Data *pd,
double x, double y)
{
pd->x = x;
pd->y = y;
- _efl_vg_changed(obj);
+ _efl_canvas_vg_node_changed(obj);
}
static void
-_efl_vg_origin_get(Eo *obj EINA_UNUSED,
- Efl_VG_Data *pd,
+_efl_canvas_vg_node_origin_get(const Eo *obj EINA_UNUSED,
+ Efl_Canvas_Vg_Node_Data *pd,
double *x, double *y)
{
if (x) *x = pd->x;
@@ -85,41 +86,41 @@ _efl_vg_origin_get(Eo *obj EINA_UNUSED,
}
static void
-_efl_vg_efl_gfx_position_set(Eo *obj EINA_UNUSED, Efl_VG_Data *pd, Eina_Position2D pos)
+_efl_canvas_vg_node_efl_gfx_entity_position_set(Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Node_Data *pd, Eina_Position2D pos)
{
pd->x = (double) pos.x;
pd->y = (double) pos.y;
- _efl_vg_changed(obj);
+ _efl_canvas_vg_node_changed(obj);
}
static Eina_Position2D
-_efl_vg_efl_gfx_position_get(Eo *obj EINA_UNUSED, Efl_VG_Data *pd)
+_efl_canvas_vg_node_efl_gfx_entity_position_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Node_Data *pd)
{
// NOTE: This casts double to int!
return EINA_POSITION2D(pd->x, pd->y);
}
static void
-_efl_vg_efl_gfx_visible_set(Eo *obj EINA_UNUSED,
- Efl_VG_Data *pd, Eina_Bool v)
+_efl_canvas_vg_node_efl_gfx_entity_visible_set(Eo *obj EINA_UNUSED,
+ Efl_Canvas_Vg_Node_Data *pd, Eina_Bool v)
{
pd->visibility = v;
- _efl_vg_changed(obj);
+ _efl_canvas_vg_node_changed(obj);
}
static Eina_Bool
-_efl_vg_efl_gfx_visible_get(Eo *obj EINA_UNUSED,
- Efl_VG_Data *pd)
+_efl_canvas_vg_node_efl_gfx_entity_visible_get(const Eo *obj EINA_UNUSED,
+ Efl_Canvas_Vg_Node_Data *pd)
{
return pd->visibility;
}
static void
-_efl_vg_efl_gfx_color_color_set(Eo *obj EINA_UNUSED,
- Efl_VG_Data *pd,
+_efl_canvas_vg_node_efl_gfx_color_color_set(Eo *obj EINA_UNUSED,
+ Efl_Canvas_Vg_Node_Data *pd,
int r, int g, int b, int a)
{
if (r > 255) r = 255;
@@ -151,12 +152,12 @@ _efl_vg_efl_gfx_color_color_set(Eo *obj EINA_UNUSED,
pd->b = b;
pd->a = a;
- _efl_vg_changed(obj);
+ _efl_canvas_vg_node_changed(obj);
}
static void
-_efl_vg_efl_gfx_color_color_get(Eo *obj EINA_UNUSED,
- Efl_VG_Data *pd,
+_efl_canvas_vg_node_efl_gfx_color_color_get(const Eo *obj EINA_UNUSED,
+ Efl_Canvas_Vg_Node_Data *pd,
int *r, int *g, int *b, int *a)
{
if (r) *r = pd->r;
@@ -166,8 +167,8 @@ _efl_vg_efl_gfx_color_color_get(Eo *obj EINA_UNUSED,
}
static void
-_efl_vg_mask_set(Eo *obj EINA_UNUSED,
- Efl_VG_Data *pd,
+_efl_canvas_vg_node_mask_set(Eo *obj EINA_UNUSED,
+ Efl_Canvas_Vg_Node_Data *pd,
Efl_VG *r)
{
Efl_VG *tmp = pd->mask;
@@ -175,84 +176,73 @@ _efl_vg_mask_set(Eo *obj EINA_UNUSED,
pd->mask = efl_ref(r);
efl_unref(tmp);
- _efl_vg_changed(obj);
+ _efl_canvas_vg_node_changed(obj);
}
static Efl_VG*
-_efl_vg_mask_get(Eo *obj EINA_UNUSED, Efl_VG_Data *pd)
+_efl_canvas_vg_node_mask_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Node_Data *pd)
{
return pd->mask;
}
static Eina_Size2D
-_efl_vg_efl_gfx_size_get(Eo *obj, Efl_VG_Data *pd EINA_UNUSED)
+_efl_canvas_vg_node_efl_gfx_entity_size_get(const Eo *obj, Efl_Canvas_Vg_Node_Data *pd EINA_UNUSED)
{
Eina_Rect r;
- efl_vg_bounds_get(obj, &r);
+ efl_gfx_path_bounds_get(obj, &r);
return r.size;
}
EOLIAN static Eina_Rect
-_efl_vg_efl_gfx_geometry_get(Eo *obj, Efl_VG_Data *pd EINA_UNUSED)
+_efl_canvas_vg_node_efl_gfx_entity_geometry_get(const Eo *obj, Efl_Canvas_Vg_Node_Data *pd EINA_UNUSED)
{
Eina_Rect r;
- r.pos = efl_gfx_position_get(obj);
- r.size = efl_gfx_size_get(obj);
+ r.pos = efl_gfx_entity_position_get(obj);
+ r.size = efl_gfx_entity_size_get(obj);
return r;
}
// Parent should be a container otherwise dismissing the stacking operation
static Eina_Bool
-_efl_vg_parent_checked_get(Eo *obj,
- Eo **parent,
- Efl_VG_Container_Data **cd)
+_efl_canvas_vg_node_parent_checked_get(Eo *obj,
+ Eo **parent,
+ Efl_Canvas_Vg_Container_Data **cd)
{
*cd = NULL;
*parent = efl_parent_get(obj);
- if (efl_isa(*parent, EFL_VG_CONTAINER_CLASS))
- {
- *cd = efl_data_scope_get(*parent, EFL_VG_CONTAINER_CLASS);
- if (!*cd)
- {
- ERR("Can't get EFL_VG_CONTAINER_CLASS data.");
- goto on_error;
- }
- }
- else if (efl_isa(*parent, EFL_CANVAS_VG_CLASS))
- {
- goto on_error;
- }
- else if (*parent != NULL)
+ if (efl_isa(*parent, EFL_CANVAS_VG_CONTAINER_CLASS))
+ *cd = efl_data_scope_get(*parent, EFL_CANVAS_VG_CONTAINER_CLASS);
+ else if (efl_isa(*parent, EFL_CANVAS_VG_OBJECT_CLASS))
+ *parent = NULL;
+ else if (*parent)
{
ERR("Parent of unauthorized class '%s'.", efl_class_name_get(efl_class_get(*parent)));
- goto on_error;
+ *parent = NULL;
+ return EINA_FALSE;
}
return EINA_TRUE;
-
- on_error:
- *parent = NULL;
- *cd = NULL;
- return EINA_FALSE;
}
static Eo *
-_efl_vg_efl_object_constructor(Eo *obj,
- Efl_VG_Data *pd)
+_efl_canvas_vg_node_efl_object_constructor(Eo *obj,
+ Efl_Canvas_Vg_Node_Data *pd)
{
- Efl_VG_Container_Data *cd = NULL;
+ Efl_Canvas_Vg_Container_Data *cd;
Eo *parent;
obj = efl_constructor(efl_super(obj, MY_CLASS));
- if (!_efl_vg_parent_checked_get(obj, &parent, &cd)) {
+ if (!_efl_canvas_vg_node_parent_checked_get(obj, &parent, &cd))
+ {
ERR("Failed");
return NULL;
- }
+ }
- efl_event_callback_add(obj, EFL_GFX_PATH_EVENT_CHANGED, _efl_vg_property_changed, pd);
+ efl_event_callback_add(obj, EFL_GFX_PATH_EVENT_CHANGED,
+ _efl_canvas_vg_node_property_changed, pd);
pd->flags = EFL_GFX_CHANGE_FLAG_ALL;
pd->changed = EINA_TRUE;
@@ -260,18 +250,24 @@ _efl_vg_efl_object_constructor(Eo *obj,
}
static void
-_efl_vg_efl_object_destructor(Eo *obj, Efl_VG_Data *pd)
+_efl_canvas_vg_node_efl_object_invalidate(Eo *obj, Efl_Canvas_Vg_Node_Data *pd)
{
- if (pd->m)
+ if (pd->renderer)
{
- free(pd->m);
- pd->m = NULL;
+ efl_unref(pd->renderer);
+ pd->renderer = NULL;
}
- if (pd->renderer)
+ efl_invalidate(efl_super(obj, MY_CLASS));
+}
+
+static void
+_efl_canvas_vg_node_efl_object_destructor(Eo *obj, Efl_Canvas_Vg_Node_Data *pd)
+{
+ if (pd->m)
{
- efl_del(pd->renderer);
- pd->renderer = NULL;
+ free(pd->m);
+ pd->m = NULL;
}
if (pd->intp)
{
@@ -283,114 +279,113 @@ _efl_vg_efl_object_destructor(Eo *obj, Efl_VG_Data *pd)
}
static void
-_efl_vg_name_insert(Eo *obj, Efl_VG_Data *pd, Efl_VG_Container_Data *cd)
+_efl_canvas_vg_node_name_insert(Eo *obj, Efl_Canvas_Vg_Container_Data *cd)
{
Eo *set;
+ const char *name = efl_name_get(efl_super(obj, MY_CLASS));
+ if (!name) return;
- if (!pd->name) return ;
-
- set = eina_hash_find(cd->names, pd->name);
- if (set == obj) return ;
+ set = eina_hash_find(cd->names, name);
+ if (set == obj) return;
if (set)
{
- eina_stringshare_del(pd->name);
- pd->name = NULL;
+ ERR("node name(%s) is already exist in container but child node(%p) is different...", name, obj);
+ efl_name_set(efl_super(obj, MY_CLASS), NULL);
}
else
{
- eina_hash_direct_add(cd->names, pd->name, obj);
+ eina_hash_direct_add(cd->names, name, obj);
}
}
static void
-_efl_vg_name_set(Eo *obj, Efl_VG_Data *pd, const char *name)
+_efl_canvas_vg_node_efl_object_name_set(Eo *obj, Efl_Canvas_Vg_Node_Data *pd EINA_UNUSED, const char *name)
{
- Efl_VG_Container_Data *cd = NULL;
- Eo *parent = NULL;
+ Efl_Canvas_Vg_Container_Data *cd;
+ Eo *parent;
+ const char *pname = efl_name_get(obj);
- if (_efl_vg_parent_checked_get(obj, &parent, &cd))
+ if (_efl_canvas_vg_node_parent_checked_get(obj, &parent, &cd))
{
- if (pd->name) eina_hash_del(cd->names, pd->name, obj);
+ if (pname) eina_hash_del(cd->names, pname, obj);
}
- eina_stringshare_replace(&pd->name, name);
+ efl_name_set(efl_super(obj, MY_CLASS), name);
- if (cd) _efl_vg_name_insert(obj, pd, cd);
-}
-
-static const char *
-_efl_vg_name_get(Eo *obj EINA_UNUSED, Efl_VG_Data *pd)
-{
- return pd->name;
+ if (cd) _efl_canvas_vg_node_name_insert(obj, cd);
}
static void
-_efl_vg_efl_object_parent_set(Eo *obj,
- Efl_VG_Data *pd EINA_UNUSED,
+_efl_canvas_vg_node_efl_object_parent_set(Eo *obj,
+ Efl_Canvas_Vg_Node_Data *pd EINA_UNUSED,
Eo *parent)
{
- Efl_VG_Container_Data *cd = NULL;
- Efl_VG_Container_Data *old_cd = NULL;
- Eo *old_parent;
+ Efl_Canvas_Vg_Container_Data *cd = NULL;
+ Efl_Canvas_Vg_Container_Data *old_cd;
+ Efl_Canvas_Vg_Node_Data *nd;
+ Efl_VG *old_parent;
+ Eina_Bool parent_container = EINA_TRUE;
- if (efl_isa(parent, EFL_VG_CONTAINER_CLASS))
- {
- cd = efl_data_scope_get(parent, EFL_VG_CONTAINER_CLASS);
- if (!cd)
- {
- ERR("Can't get EFL_VG_CONTAINER_CLASS data from %p.", parent);
- goto on_error;
- }
- }
- else if (parent != NULL)
+ nd = efl_data_scope_get(obj, MY_CLASS);
+
+ //No, prevent infinite calls parent_set() -> root_node_set() -> parent_set() -> ...
+ if (nd->parenting) return;
+
+ //Cut off root node from vg object if it does....
+ if (nd->vg_obj)
{
- ERR("%p not even an EVAS_VG_CLASS.", parent);
- goto on_error;
+ nd->parenting = EINA_TRUE;
+ evas_object_vg_root_node_set(nd->vg_obj, NULL);
+ nd->parenting = EINA_FALSE;
+ nd->vg_obj = NULL;
}
- if (!_efl_vg_parent_checked_get(obj, &old_parent, &old_cd))
+ if (efl_isa(parent, EFL_CANVAS_VG_CONTAINER_CLASS))
+ cd = efl_data_scope_get(parent, EFL_CANVAS_VG_CONTAINER_CLASS);
+ else if (efl_isa(parent, EFL_CANVAS_VG_OBJECT_CLASS))
+ parent_container = EINA_FALSE;
+ else if (parent)
{
- ERR("Can't check the old parent of %p.", obj);
- goto on_error;
+ ERR("parent(%p, class = %s) is not allowed by vg node(%p).",
+ parent, efl_class_name_get(efl_class_get(parent)), obj);
+ return;
}
+ else parent_container = EINA_FALSE;
+
+ if (!_efl_canvas_vg_node_parent_checked_get(obj, &old_parent, &old_cd))
+ return;
// FIXME: this may become slow with to much object
if (old_cd)
{
old_cd->children = eina_list_remove(old_cd->children, obj);
-
- if (pd->name) eina_hash_del(old_cd->names, pd->name, obj);
+ eina_hash_del(old_cd->names, efl_name_get(efl_super(obj, MY_CLASS)), obj);
}
efl_parent_set(efl_super(obj, MY_CLASS), parent);
+
if (cd)
{
cd->children = eina_list_append(cd->children, obj);
-
- _efl_vg_name_insert(obj, pd, cd);
+ _efl_canvas_vg_node_name_insert(obj, cd);
}
- _efl_vg_changed(old_parent);
- _efl_vg_changed(obj);
- _efl_vg_changed(parent);
-
- return ;
-
- on_error:
- return ;
+ _efl_canvas_vg_node_changed(old_parent);
+ _efl_canvas_vg_node_changed(obj);
+ if (parent_container) _efl_canvas_vg_node_changed(parent);
}
static void
-_efl_vg_efl_gfx_stack_raise(Eo *obj, Efl_VG_Data *pd EINA_UNUSED)
+_efl_canvas_vg_node_efl_gfx_stack_raise(Eo *obj, Efl_Canvas_Vg_Node_Data *pd EINA_UNUSED)
{
- Efl_VG_Container_Data *cd;
+ Efl_Canvas_Vg_Container_Data *cd;
Eina_List *lookup, *next;
Eo *parent;
parent = efl_parent_get(obj);
- if (!efl_isa(parent, EFL_VG_CONTAINER_CLASS)) goto on_error;
- cd = efl_data_scope_get(parent, EFL_VG_CONTAINER_CLASS);
+ if (!efl_isa(parent, EFL_CANVAS_VG_CONTAINER_CLASS)) goto on_error;
+ cd = efl_data_scope_get(parent, EFL_CANVAS_VG_CONTAINER_CLASS);
// FIXME: this could become slow with to much object
lookup = eina_list_data_find_list(cd->children, obj);
@@ -402,7 +397,7 @@ _efl_vg_efl_gfx_stack_raise(Eo *obj, Efl_VG_Data *pd EINA_UNUSED)
cd->children = eina_list_remove_list(cd->children, lookup);
cd->children = eina_list_append_relative_list(cd->children, obj, next);
- _efl_vg_changed(parent);
+ _efl_canvas_vg_node_changed(parent);
return ;
on_error:
@@ -410,17 +405,17 @@ _efl_vg_efl_gfx_stack_raise(Eo *obj, Efl_VG_Data *pd EINA_UNUSED)
}
static void
-_efl_vg_efl_gfx_stack_stack_above(Eo *obj,
- Efl_VG_Data *pd EINA_UNUSED,
+_efl_canvas_vg_node_efl_gfx_stack_stack_above(Eo *obj,
+ Efl_Canvas_Vg_Node_Data *pd EINA_UNUSED,
Efl_Gfx_Stack *above)
{
- Efl_VG_Container_Data *cd;
+ Efl_Canvas_Vg_Container_Data *cd;
Eina_List *lookup, *ref;
Eo *parent;
parent = efl_parent_get(obj);
- if (!efl_isa(parent, EFL_VG_CONTAINER_CLASS)) goto on_error;
- cd = efl_data_scope_get(parent, EFL_VG_CONTAINER_CLASS);
+ if (!efl_isa(parent, EFL_CANVAS_VG_CONTAINER_CLASS)) goto on_error;
+ cd = efl_data_scope_get(parent, EFL_CANVAS_VG_CONTAINER_CLASS);
// FIXME: this could become slow with to much object
lookup = eina_list_data_find_list(cd->children, obj);
@@ -432,7 +427,7 @@ _efl_vg_efl_gfx_stack_stack_above(Eo *obj,
cd->children = eina_list_remove_list(cd->children, lookup);
cd->children = eina_list_append_relative_list(cd->children, obj, ref);
- _efl_vg_changed(parent);
+ _efl_canvas_vg_node_changed(parent);
return ;
on_error:
@@ -440,17 +435,17 @@ _efl_vg_efl_gfx_stack_stack_above(Eo *obj,
}
static void
-_efl_vg_efl_gfx_stack_stack_below(Eo *obj,
- Efl_VG_Data *pd EINA_UNUSED,
+_efl_canvas_vg_node_efl_gfx_stack_stack_below(Eo *obj,
+ Efl_Canvas_Vg_Node_Data *pd EINA_UNUSED,
Efl_Gfx_Stack *below)
{
- Efl_VG_Container_Data *cd;
+ Efl_Canvas_Vg_Container_Data *cd;
Eina_List *lookup, *ref;
Eo *parent;
parent = efl_parent_get(obj);
- if (!efl_isa(parent, EFL_VG_CONTAINER_CLASS)) goto on_error;
- cd = efl_data_scope_get(parent, EFL_VG_CONTAINER_CLASS);
+ if (!efl_isa(parent, EFL_CANVAS_VG_CONTAINER_CLASS)) goto on_error;
+ cd = efl_data_scope_get(parent, EFL_CANVAS_VG_CONTAINER_CLASS);
// FIXME: this could become slow with to much object
lookup = eina_list_data_find_list(cd->children, obj);
@@ -462,7 +457,7 @@ _efl_vg_efl_gfx_stack_stack_below(Eo *obj,
cd->children = eina_list_remove_list(cd->children, lookup);
cd->children = eina_list_prepend_relative_list(cd->children, obj, ref);
- _efl_vg_changed(parent);
+ _efl_canvas_vg_node_changed(parent);
return ;
on_error:
@@ -470,15 +465,15 @@ _efl_vg_efl_gfx_stack_stack_below(Eo *obj,
}
static void
-_efl_vg_efl_gfx_stack_lower(Eo *obj, Efl_VG_Data *pd EINA_UNUSED)
+_efl_canvas_vg_node_efl_gfx_stack_lower(Eo *obj, Efl_Canvas_Vg_Node_Data *pd EINA_UNUSED)
{
- Efl_VG_Container_Data *cd;
+ Efl_Canvas_Vg_Container_Data *cd;
Eina_List *lookup, *prev;
Eo *parent;
parent = efl_parent_get(obj);
- if (!efl_isa(parent, EFL_VG_CONTAINER_CLASS)) goto on_error;
- cd = efl_data_scope_get(parent, EFL_VG_CONTAINER_CLASS);
+ if (!efl_isa(parent, EFL_CANVAS_VG_CONTAINER_CLASS)) goto on_error;
+ cd = efl_data_scope_get(parent, EFL_CANVAS_VG_CONTAINER_CLASS);
// FIXME: this could become slow with to much object
lookup = eina_list_data_find_list(cd->children, obj);
@@ -490,59 +485,59 @@ _efl_vg_efl_gfx_stack_lower(Eo *obj, Efl_VG_Data *pd EINA_UNUSED)
cd->children = eina_list_remove_list(cd->children, lookup);
cd->children = eina_list_prepend_relative_list(cd->children, obj, prev);
- _efl_vg_changed(parent);
+ _efl_canvas_vg_node_changed(parent);
return ;
on_error:
ERR("Err");
}
-static Eo *
-_efl_vg_root_parent_get(Eo *obj)
+static const Eo *
+_efl_canvas_vg_node_root_parent_get(const Eo *obj)
{
- Eo *parent;
+ const Eo *parent;
parent = efl_parent_get(obj);
if (!parent) return obj;
- return _efl_vg_root_parent_get(parent);
+ return _efl_canvas_vg_node_root_parent_get(parent);
}
static void
-_efl_vg_walk_down_at(Eo *root, Eina_Array *a, Eina_Rectangle *r)
+_efl_canvas_vg_node_walk_down_at(const Eo *root, Eina_Array *a, Eina_Rectangle *r)
{
Eina_Rect bounds;
- efl_vg_bounds_get(root, &bounds);
+ efl_gfx_path_bounds_get(root, &bounds);
if (!eina_rectangles_intersect(&bounds.rect, r)) return ;
eina_array_push(a, root);
- if (efl_isa(root, EFL_VG_CONTAINER_CLASS))
+ if (efl_isa(root, EFL_CANVAS_VG_CONTAINER_CLASS))
{
- Efl_VG_Container_Data *cd;
+ Efl_Canvas_Vg_Container_Data *cd;
Eina_List *l;
Eo *child;
- cd = efl_data_scope_get(root, EFL_VG_CONTAINER_CLASS);
+ cd = efl_data_scope_get(root, EFL_CANVAS_VG_CONTAINER_CLASS);
EINA_LIST_FOREACH(cd->children, l, child)
- _efl_vg_walk_down_at(child, a, r);
+ _efl_canvas_vg_node_walk_down_at(child, a, r);
}
}
static void
-_efl_vg_object_at(Eo *obj, Eina_Array *a, Eina_Rectangle *r)
+_efl_canvas_vg_node_object_at(const Eo *obj, Eina_Array *a, Eina_Rectangle *r)
{
- Eo *root;
+ const Eo *root;
- root = _efl_vg_root_parent_get(obj);
+ root = _efl_canvas_vg_node_root_parent_get(obj);
if (!root) return ;
- _efl_vg_walk_down_at(root, a, r);
+ _efl_canvas_vg_node_walk_down_at(root, a, r);
}
static Efl_Gfx_Stack *
-_efl_vg_efl_gfx_stack_below_get(Eo *obj, Efl_VG_Data *pd EINA_UNUSED)
+_efl_canvas_vg_node_efl_gfx_stack_below_get(const Eo *obj, Efl_Canvas_Vg_Node_Data *pd EINA_UNUSED)
{
Eina_Rect r;
Eina_Array a;
@@ -551,11 +546,11 @@ _efl_vg_efl_gfx_stack_below_get(Eo *obj, Efl_VG_Data *pd EINA_UNUSED)
Eina_Array_Iterator iterator;
unsigned int i;
- efl_vg_bounds_get(obj, &r);
+ efl_gfx_path_bounds_get(obj, &r);
eina_array_step_set(&a, sizeof (Eina_Array), 8);
- _efl_vg_object_at(obj, &a, &r.rect);
+ _efl_canvas_vg_node_object_at(obj, &a, &r.rect);
EINA_ARRAY_ITER_NEXT(&a, i, current, iterator)
if (current == obj)
@@ -572,7 +567,7 @@ _efl_vg_efl_gfx_stack_below_get(Eo *obj, Efl_VG_Data *pd EINA_UNUSED)
}
static Efl_Gfx_Stack *
-_efl_vg_efl_gfx_stack_above_get(Eo *obj, Efl_VG_Data *pd EINA_UNUSED)
+_efl_canvas_vg_node_efl_gfx_stack_above_get(const Eo *obj, Efl_Canvas_Vg_Node_Data *pd EINA_UNUSED)
{
Eina_Rect r;
Eina_Array a;
@@ -581,11 +576,11 @@ _efl_vg_efl_gfx_stack_above_get(Eo *obj, Efl_VG_Data *pd EINA_UNUSED)
Eina_Array_Iterator iterator;
unsigned int i;
- efl_vg_bounds_get(obj, &r);
+ efl_gfx_path_bounds_get(obj, &r);
eina_array_step_set(&a, sizeof (Eina_Array), 8);
- _efl_vg_object_at(obj, &a, &r.rect);
+ _efl_canvas_vg_node_object_at(obj, &a, &r.rect);
EINA_ARRAY_ITER_NEXT(&a, i, current, iterator)
if (current == obj)
@@ -600,15 +595,15 @@ _efl_vg_efl_gfx_stack_above_get(Eo *obj, Efl_VG_Data *pd EINA_UNUSED)
return above;
}
-static Efl_VG_Interpolation *
-_efl_vg_interpolation_get(Efl_VG_Data *pd)
+static Efl_Canvas_Vg_Interpolation *
+_efl_canvas_vg_node_interpolation_get(Efl_Canvas_Vg_Node_Data *pd)
{
Eina_Matrix4 m;
if (!pd->m) return NULL;
if (pd->intp) return pd->intp;
- pd->intp = calloc(1, sizeof (Efl_VG_Interpolation));
+ pd->intp = calloc(1, sizeof (Efl_Canvas_Vg_Interpolation));
if (!pd->intp) return NULL;
eina_matrix3_matrix4_to(&m, pd->m);
@@ -628,62 +623,70 @@ _efl_vg_interpolation_get(Efl_VG_Data *pd)
}
static inline void
-_efl_vg_interpolate_point(Eina_Point_3D *d,
- const Eina_Point_3D *a, const Eina_Point_3D *b,
- double pos_map, double from_map)
+_efl_canvas_vg_node_interpolate_point(Eina_Point_3D *d,
+ const Eina_Point_3D *a, const Eina_Point_3D *b,
+ double pos_map, double from_map)
{
d->x = a->x * from_map + b->x * pos_map;
d->y = a->y * from_map + b->y * pos_map;
d->z = a->z * from_map + b->z * pos_map;
}
+/* Warning! Node itself doesn't have any path. Don't call super class(Path)'s */
static Eina_Bool
-_efl_vg_interpolate(Eo *obj,
- Efl_VG_Data *pd, const Efl_VG *from, const Efl_VG *to,
- double pos_map)
+_efl_canvas_vg_node_efl_gfx_path_interpolate(Eo *obj, Efl_Canvas_Vg_Node_Data *pd, const Efl_VG *from, const Efl_VG *to, double pos_map)
{
- Efl_VG_Data *fromd, *tod;
+ Efl_Canvas_Vg_Node_Data *fromd, *tod;
double from_map;
- Eina_Bool r = EINA_TRUE;
- fromd = efl_data_scope_get(from, EFL_VG_CLASS);
- tod = efl_data_scope_get(to, EFL_VG_CLASS);
+ //Check if both objects have same type
+ if (!(efl_isa(from, MY_CLASS) && efl_isa(to, MY_CLASS)))
+ return EINA_FALSE;
+
+ fromd = efl_data_scope_get(from, MY_CLASS);
+ tod = efl_data_scope_get(to, MY_CLASS);
from_map = 1.0 - pos_map;
- efl_del(pd->renderer);
+ efl_unref(pd->renderer);
pd->renderer = NULL;
+ //Interpolates Node Transform Matrix
if (fromd->m || tod->m)
{
if (!pd->m) pd->m = malloc(sizeof (Eina_Matrix3));
if (pd->m)
{
- const Efl_VG_Interpolation *fi, *ti;
- Efl_VG_Interpolation result;
+ const Efl_Canvas_Vg_Interpolation *fi, *ti;
+ Efl_Canvas_Vg_Interpolation result;
Eina_Matrix4 m;
- fi = _efl_vg_interpolation_get(fromd);
+ fi = _efl_canvas_vg_node_interpolation_get(fromd);
if (!fi) fi = &interpolation_identity;
- ti = _efl_vg_interpolation_get(tod);
+
+ ti = _efl_canvas_vg_node_interpolation_get(tod);
if (!ti) ti = &interpolation_identity;
eina_quaternion_slerp(&result.rotation,
&fi->rotation, &ti->rotation,
pos_map);
- _efl_vg_interpolate_point(&result.translation,
+ _efl_canvas_vg_node_interpolate_point(&result.translation,
&fi->translation, &ti->translation,
pos_map, from_map);
- _efl_vg_interpolate_point(&result.scale,
+ _efl_canvas_vg_node_interpolate_point(&result.scale,
&fi->scale, &ti->scale,
pos_map, from_map);
- _efl_vg_interpolate_point(&result.skew,
+ _efl_canvas_vg_node_interpolate_point(&result.skew,
&fi->skew, &ti->skew,
pos_map, from_map);
- result.perspective.x = fi->perspective.x * from_map + ti->perspective.x * pos_map;
- result.perspective.y = fi->perspective.y * from_map + ti->perspective.y * pos_map;
- result.perspective.z = fi->perspective.z * from_map + ti->perspective.z * pos_map;
- result.perspective.w = fi->perspective.w * from_map + ti->perspective.w * pos_map;
+ result.perspective.x =
+ fi->perspective.x * from_map + ti->perspective.x * pos_map;
+ result.perspective.y =
+ fi->perspective.y * from_map + ti->perspective.y * pos_map;
+ result.perspective.z =
+ fi->perspective.z * from_map + ti->perspective.z * pos_map;
+ result.perspective.w =
+ fi->perspective.w * from_map + ti->perspective.w * pos_map;
eina_quaternion_matrix4_to(&m,
&result.rotation,
@@ -691,13 +694,16 @@ _efl_vg_interpolate(Eo *obj,
&result.translation,
&result.scale,
&result.skew);
+
eina_matrix4_matrix3_to(pd->m, &m);
}
}
+ //Position
pd->x = fromd->x * from_map + tod->x * pos_map;
pd->y = fromd->y * from_map + tod->y * pos_map;
+ //Color
pd->r = fromd->r * from_map + tod->r * pos_map;
pd->g = fromd->g * from_map + tod->g * pos_map;
pd->b = fromd->b * from_map + tod->b * pos_map;
@@ -705,57 +711,72 @@ _efl_vg_interpolate(Eo *obj,
pd->visibility = pos_map >= 0.5 ? tod->visibility : fromd->visibility;
+ //Interpolates Mask
if (fromd->mask && tod->mask && pd->mask)
{
- r &= efl_vg_interpolate(pd->mask, fromd->mask, tod->mask, pos_map);
+ if (!efl_gfx_path_interpolate(pd->mask,
+ fromd->mask, tod->mask, pos_map))
+ return EINA_FALSE;
}
- _efl_vg_changed(obj);
+ _efl_canvas_vg_node_changed(obj);
- return r;
+ return EINA_TRUE;
}
+void
+efl_canvas_vg_node_root_set(Efl_VG *node, Efl_VG *vg_obj)
+{
+ Efl_Canvas_Vg_Node_Data *nd = efl_data_scope_get(node, MY_CLASS);
+ nd->vg_obj = vg_obj;
+}
+
+
EOLIAN static Efl_VG *
-_efl_vg_efl_duplicate_duplicate(const Eo *obj, Efl_VG_Data *pd)
+_efl_canvas_vg_node_efl_duplicate_duplicate(const Eo *obj, Efl_Canvas_Vg_Node_Data *pd)
{
- Efl_VG *cn;
- Efl_VG_Data *cd;
+ Efl_VG *node;
+ Efl_Canvas_Vg_Node_Data *nd;
+
+ node = efl_add_ref(efl_class_get(obj), NULL);
+ nd = efl_data_scope_get(node, MY_CLASS);
+
+ //Hmm...?
+ efl_name_set(efl_super(node, MY_CLASS), efl_name_get(efl_super(obj, MY_CLASS)));
- cn = efl_add(efl_class_get(obj), NULL);
- cd = efl_data_scope_get(cn, MY_CLASS);
- EINA_SAFETY_ON_NULL_RETURN_VAL(cd, NULL);
- if (pd->name)
- cd->name = eina_stringshare_ref(pd->name);
if (pd->m)
{
- cd->m = malloc(sizeof (Eina_Matrix3)) ;
- if (cd->m) memcpy(cd->m, pd->m, sizeof (Eina_Matrix3));
+ nd->m = malloc(sizeof(Eina_Matrix3));
+ if (nd->m) memcpy(nd->m, pd->m, sizeof(Eina_Matrix3));
}
if (pd->mask)
- cd->mask = efl_duplicate(pd->mask);
+ {
+ nd->mask = efl_duplicate(pd->mask);
+ efl_parent_set(nd->mask, node);
+ }
- cd->x = pd->x;
- cd->y = pd->y;
- cd->r = pd->r;
- cd->g = pd->g;
- cd->b = pd->b;
- cd->a = pd->a;
- cd->visibility = pd->visibility;
+ nd->x = pd->x;
+ nd->y = pd->y;
+ nd->r = pd->r;
+ nd->g = pd->g;
+ nd->b = pd->b;
+ nd->a = pd->a;
+ nd->visibility = pd->visibility;
- return cn;
+ return node;
}
EAPI Eina_Bool
evas_vg_node_visible_get(Eo *obj)
{
- return efl_gfx_visible_get(obj);
+ return efl_gfx_entity_visible_get(obj);
}
EAPI void
evas_vg_node_visible_set(Eo *obj, Eina_Bool v)
{
- efl_gfx_visible_set(obj, v);
+ efl_gfx_entity_visible_set(obj, v);
}
EAPI void
@@ -774,8 +795,8 @@ EAPI void
evas_vg_node_geometry_get(Eo *obj, int *x, int *y, int *w, int *h)
{
Eina_Rect r;
- r.pos = efl_gfx_position_get(obj);
- r.size = efl_gfx_size_get(obj);
+ r.pos = efl_gfx_entity_position_get(obj);
+ r.size = efl_gfx_entity_size_get(obj);
if (x) *x = r.x;
if (y) *y = r.y;
if (w) *w = r.w;
@@ -785,8 +806,8 @@ evas_vg_node_geometry_get(Eo *obj, int *x, int *y, int *w, int *h)
EAPI void
evas_vg_node_geometry_set(Eo *obj, int x, int y, int w, int h)
{
- efl_gfx_position_set(obj, EINA_POSITION2D(x, y));
- efl_gfx_size_set(obj, EINA_SIZE2D(w, h));
+ efl_gfx_entity_position_set(obj, EINA_POSITION2D(x, y));
+ efl_gfx_entity_size_set(obj, EINA_SIZE2D(w, h));
}
EAPI void
@@ -813,4 +834,4 @@ evas_vg_node_lower(Eo *obj)
efl_gfx_stack_lower(obj);
}
-#include "efl_vg.eo.c"
+#include "efl_canvas_vg_node.eo.c"
diff --git a/src/lib/evas/canvas/evas_vg_private.h b/src/lib/evas/canvas/evas_vg_private.h
index e2f393fec2..cc43fb03ab 100644
--- a/src/lib/evas/canvas/evas_vg_private.h
+++ b/src/lib/evas/canvas/evas_vg_private.h
@@ -3,13 +3,13 @@
#include <Ector.h>
-typedef struct _Efl_VG_Data Efl_VG_Data;
-typedef struct _Efl_VG_Container_Data Efl_VG_Container_Data;
-typedef struct _Efl_VG_Gradient_Data Efl_VG_Gradient_Data;
-typedef struct _Efl_VG_Interpolation Efl_VG_Interpolation;
+typedef struct _Efl_Canvas_Vg_Node_Data Efl_Canvas_Vg_Node_Data;
+typedef struct _Efl_Canvas_Vg_Container_Data Efl_Canvas_Vg_Container_Data;
+typedef struct _Efl_Canvas_Vg_Gradient_Data Efl_Canvas_Vg_Gradient_Data;
+typedef struct _Efl_Canvas_Vg_Interpolation Efl_Canvas_Vg_Interpolation;
-typedef struct _Efl_Canvas_Vg_Data Efl_Canvas_Vg_Data;
+typedef struct _Efl_Canvas_Vg_Object_Data Efl_Canvas_Vg_Object_Data;
typedef struct _Evas_Cache_Vg_Entry Evas_Cache_Vg_Entry;
typedef struct _Evas_Cache_Vg Evas_Cache_Vg;
@@ -39,7 +39,7 @@ typedef struct _User_Vg_Entry
Efl_VG *root;
}User_Vg_Entry; // holds the vg tree info set by the user
-struct _Efl_Canvas_Vg_Data
+struct _Efl_Canvas_Vg_Object_Data
{
void *engine_data;
Efl_VG *root;
@@ -54,17 +54,17 @@ struct _Efl_Canvas_Vg_Data
Eina_Bool changed;
};
-struct _Efl_VG_Data
+struct _Efl_Canvas_Vg_Node_Data
{
- const char *name;
-
Eina_Matrix3 *m;
- Efl_VG_Interpolation *intp;
+ Efl_Canvas_Vg_Interpolation *intp;
- Efl_VG *mask;
+ Efl_Canvas_Vg_Node *mask;
Ector_Renderer *renderer;
- void (*render_pre)(Eo *obj, Eina_Matrix3 *parent, Ector_Surface *s, void *data, Efl_VG_Data *nd);
+ Efl_VG *vg_obj;
+
+ void (*render_pre)(Eo *obj, Eina_Matrix3 *parent, Ector_Surface *s, void *data, Efl_Canvas_Vg_Node_Data *nd);
void *data;
double x, y;
@@ -73,16 +73,17 @@ struct _Efl_VG_Data
Eina_Bool visibility : 1;
Eina_Bool changed : 1;
+ Eina_Bool parenting : 1;
};
-struct _Efl_VG_Container_Data
+struct _Efl_Canvas_Vg_Container_Data
{
Eina_List *children;
Eina_Hash *names;
};
-struct _Efl_VG_Gradient_Data
+struct _Efl_Canvas_Vg_Gradient_Data
{
// FIXME: Later on we should deduplicate it somehow (Using Ector ?).
Efl_Gfx_Gradient_Stop *colors;
@@ -91,7 +92,7 @@ struct _Efl_VG_Gradient_Data
Efl_Gfx_Gradient_Spread s;
};
-struct _Efl_VG_Interpolation
+struct _Efl_Canvas_Vg_Interpolation
{
Eina_Quaternion rotation;
Eina_Quaternion perspective;
@@ -110,14 +111,16 @@ Vg_File_Data * evas_cache_vg_file_info(const char *file, const char
Eina_Bool evas_vg_save_to_file(Vg_File_Data *evg_data, const char *file, const char *key, const char *flags);
-static inline Efl_VG_Data *
+void efl_canvas_vg_node_root_set(Efl_VG *node, Efl_VG *vg_obj);
+
+static inline Efl_Canvas_Vg_Node_Data *
_evas_vg_render_pre(Efl_VG *child, Ector_Surface *s, Eina_Matrix3 *m)
{
- Efl_VG_Data *child_nd = NULL;
+ Efl_Canvas_Vg_Node_Data *child_nd = NULL;
// FIXME: Prevent infinite loop
if (child)
- child_nd = efl_data_scope_get(child, EFL_VG_CLASS);
+ child_nd = efl_data_scope_get(child, EFL_CANVAS_VG_NODE_CLASS);
if (child_nd)
child_nd->render_pre(child, m, s, child_nd->data, child_nd);
@@ -125,10 +128,11 @@ _evas_vg_render_pre(Efl_VG *child, Ector_Surface *s, Eina_Matrix3 *m)
}
static inline void
-_efl_vg_changed(Eo *obj)
+_efl_canvas_vg_node_changed(Eo *obj)
{
Efl_Gfx_Path_Change_Event ev = { EFL_GFX_CHANGE_FLAG_FILL };
- efl_event_callback_call(obj, EFL_GFX_PATH_EVENT_CHANGED, &ev);
+
+ if (obj) efl_event_callback_call(obj, EFL_GFX_PATH_EVENT_CHANGED, &ev);
}
static inline void *
@@ -149,7 +153,7 @@ _efl_vg_clean_object(Eo **obj)
*obj = NULL;
}
-#define EFL_VG_COMPUTE_MATRIX(Current, Parent, Nd) \
+#define EFL_CANVAS_VG_COMPUTE_MATRIX(Current, Parent, Nd) \
Eina_Matrix3 *Current = Nd->m; \
Eina_Matrix3 _matrix_tmp; \
\
diff --git a/src/lib/evas/canvas/evas_vg_shape.c b/src/lib/evas/canvas/evas_vg_shape.c
index 4d603235a5..936bc26aa1 100644
--- a/src/lib/evas/canvas/evas_vg_shape.c
+++ b/src/lib/evas/canvas/evas_vg_shape.c
@@ -3,102 +3,95 @@
#include "evas_vg_private.h"
-#define MY_CLASS EFL_VG_SHAPE_CLASS
+#define MY_CLASS EFL_CANVAS_VG_SHAPE_CLASS
-typedef struct _Efl_VG_Shape_Data Efl_VG_Shape_Data;
-struct _Efl_VG_Shape_Data
+typedef struct _Efl_Canvas_Vg_Shape_Data Efl_Canvas_Vg_Shape_Data;
+struct _Efl_Canvas_Vg_Shape_Data
{
- Efl_VG *fill;
+ Efl_Canvas_Vg_Node *fill;
struct {
- Efl_VG *fill;
- Efl_VG *marker;
+ Efl_Canvas_Vg_Node *fill;
+ Efl_Canvas_Vg_Node *marker;
} stroke;
};
-static void
-_efl_vg_shape_efl_vg_bounds_get(Eo *obj,
- Efl_VG_Shape_Data *pd EINA_UNUSED,
- Eina_Rect *r)
-{
- // FIXME: Use the renderer bounding box when it has been created instead of an estimation
- efl_gfx_path_bounds_get(obj, r);
-}
+// FIXME: Use the renderer bounding box when it has been created instead of an estimation
static void
-_efl_vg_shape_fill_set(Eo *obj EINA_UNUSED,
- Efl_VG_Shape_Data *pd,
- Efl_VG *f)
+_efl_canvas_vg_shape_fill_set(Eo *obj EINA_UNUSED,
+ Efl_Canvas_Vg_Shape_Data *pd,
+ Efl_Canvas_Vg_Node *f)
{
- Efl_VG *tmp = pd->fill;
+ Efl_Canvas_Vg_Node *tmp = pd->fill;
pd->fill = efl_ref(f);
efl_unref(tmp);
- _efl_vg_changed(obj);
+ _efl_canvas_vg_node_changed(obj);
}
-static Efl_VG *
-_efl_vg_shape_fill_get(Eo *obj EINA_UNUSED, Efl_VG_Shape_Data *pd)
+static Efl_Canvas_Vg_Node *
+_efl_canvas_vg_shape_fill_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Shape_Data *pd)
{
return pd->fill;
}
static void
-_efl_vg_shape_stroke_fill_set(Eo *obj EINA_UNUSED,
- Efl_VG_Shape_Data *pd,
- Efl_VG *f)
+_efl_canvas_vg_shape_stroke_fill_set(Eo *obj EINA_UNUSED,
+ Efl_Canvas_Vg_Shape_Data *pd,
+ Efl_Canvas_Vg_Node *f)
{
- Efl_VG *tmp = pd->fill;
+ Efl_Canvas_Vg_Node *tmp = pd->fill;
pd->stroke.fill = efl_ref(f);
efl_unref(tmp);
- _efl_vg_changed(obj);
+ _efl_canvas_vg_node_changed(obj);
}
-static Efl_VG *
-_efl_vg_shape_stroke_fill_get(Eo *obj EINA_UNUSED,
- Efl_VG_Shape_Data *pd)
+static Efl_Canvas_Vg_Node *
+_efl_canvas_vg_shape_stroke_fill_get(const Eo *obj EINA_UNUSED,
+ Efl_Canvas_Vg_Shape_Data *pd)
{
return pd->stroke.fill;
}
static void
-_efl_vg_shape_stroke_marker_set(Eo *obj EINA_UNUSED,
- Efl_VG_Shape_Data *pd,
- Efl_VG_Shape *m)
+_efl_canvas_vg_shape_stroke_marker_set(Eo *obj EINA_UNUSED,
+ Efl_Canvas_Vg_Shape_Data *pd,
+ Efl_Canvas_Vg_Shape *m)
{
- Efl_VG *tmp = pd->stroke.marker;
+ Efl_Canvas_Vg_Node *tmp = pd->stroke.marker;
pd->stroke.marker = efl_ref(m);
efl_unref(tmp);
- _efl_vg_changed(obj);
+ _efl_canvas_vg_node_changed(obj);
}
-static Efl_VG_Shape *
-_efl_vg_shape_stroke_marker_get(Eo *obj EINA_UNUSED,
- Efl_VG_Shape_Data *pd)
+static Efl_Canvas_Vg_Shape *
+_efl_canvas_vg_shape_stroke_marker_get(const Eo *obj EINA_UNUSED,
+ Efl_Canvas_Vg_Shape_Data *pd)
{
return pd->stroke.marker;
}
static void
-_efl_vg_shape_render_pre(Eo *obj EINA_UNUSED,
+_efl_canvas_vg_shape_render_pre(Eo *obj EINA_UNUSED,
Eina_Matrix3 *parent,
Ector_Surface *s,
void *data,
- Efl_VG_Data *nd)
+ Efl_Canvas_Vg_Node_Data *nd)
{
- Efl_VG_Shape_Data *pd = data;
- Efl_VG_Data *fill, *stroke_fill, *stroke_marker, *mask;
+ Efl_Canvas_Vg_Shape_Data *pd = data;
+ Efl_Canvas_Vg_Node_Data *fill, *stroke_fill, *stroke_marker, *mask;
if (nd->flags == EFL_GFX_CHANGE_FLAG_NONE) return ;
nd->flags = EFL_GFX_CHANGE_FLAG_NONE;
- EFL_VG_COMPUTE_MATRIX(current, parent, nd);
+ EFL_CANVAS_VG_COMPUTE_MATRIX(current, parent, nd);
fill = _evas_vg_render_pre(pd->fill, s, current);
stroke_fill = _evas_vg_render_pre(pd->stroke.fill, s, current);
@@ -125,9 +118,9 @@ _efl_vg_shape_render_pre(Eo *obj EINA_UNUSED,
}
static Eo *
-_efl_vg_shape_efl_object_constructor(Eo *obj, Efl_VG_Shape_Data *pd)
+_efl_canvas_vg_shape_efl_object_constructor(Eo *obj, Efl_Canvas_Vg_Shape_Data *pd)
{
- Efl_VG_Data *nd;
+ Efl_Canvas_Vg_Node_Data *nd;
obj = efl_constructor(efl_super(obj, MY_CLASS));
@@ -136,69 +129,88 @@ _efl_vg_shape_efl_object_constructor(Eo *obj, Efl_VG_Shape_Data *pd)
efl_gfx_shape_stroke_cap_set(obj, EFL_GFX_CAP_BUTT);
efl_gfx_shape_stroke_join_set(obj, EFL_GFX_JOIN_MITER);
- nd = efl_data_scope_get(obj, EFL_VG_CLASS);
- nd->render_pre = _efl_vg_shape_render_pre;
+ nd = efl_data_scope_get(obj, EFL_CANVAS_VG_NODE_CLASS);
+ nd->render_pre = _efl_canvas_vg_shape_render_pre;
nd->data = pd;
return obj;
}
static void
-_efl_vg_shape_efl_object_destructor(Eo *obj, Efl_VG_Shape_Data *pd EINA_UNUSED)
+_efl_canvas_vg_shape_efl_object_destructor(Eo *obj, Efl_Canvas_Vg_Shape_Data *pd EINA_UNUSED)
{
+ efl_gfx_path_reset(obj);
efl_destructor(efl_super(obj, MY_CLASS));
}
static Eina_Bool
-_efl_vg_shape_efl_vg_interpolate(Eo *obj,
- Efl_VG_Shape_Data *pd,
- const Efl_VG *from, const Efl_VG *to,
- double pos_map)
+_efl_canvas_vg_shape_efl_gfx_path_interpolate(Eo *obj,
+ Efl_Canvas_Vg_Shape_Data *pd,
+ const Efl_Canvas_Vg_Node *from,
+ const Efl_Canvas_Vg_Node *to,
+ double pos_map)
{
- Efl_VG_Shape_Data *fromd, *tod;
- Eina_Bool r;
+ Efl_Canvas_Vg_Shape_Data *fromd, *tod;
+ Eina_Bool r = EINA_TRUE;
- fromd = efl_data_scope_get(from, EFL_VG_SHAPE_CLASS);
- tod = efl_data_scope_get(to, EFL_VG_SHAPE_CLASS);
+ //Check if both objects have same type
+ if (!(efl_isa(from, MY_CLASS) && efl_isa(to, MY_CLASS)))
+ return EINA_FALSE;
- r = efl_vg_interpolate(efl_super(obj, MY_CLASS), from, to, pos_map);
+ //Is this the best way?
+ r &= efl_gfx_path_interpolate(efl_cast(obj, EFL_CANVAS_VG_NODE_CLASS),
+ from, to, pos_map);
+ r &= efl_gfx_path_interpolate(efl_super(obj, MY_CLASS), from, to, pos_map);
- r &= efl_gfx_path_interpolate(obj, from, to, pos_map);
+ fromd = efl_data_scope_get(from, MY_CLASS);
+ tod = efl_data_scope_get(to, MY_CLASS);
+ //Fill
if (fromd->fill && tod->fill && pd->fill)
- {
- r &= efl_vg_interpolate(pd->fill, fromd->fill, tod->fill, pos_map);
- }
+ r &= efl_gfx_path_interpolate(pd->fill, fromd->fill, tod->fill, pos_map);
+
+ //Stroke Fill
if (fromd->stroke.fill && tod->stroke.fill && pd->stroke.fill)
- {
- r &= efl_vg_interpolate(pd->stroke.fill, fromd->stroke.fill, tod->stroke.fill, pos_map);
- }
+ r &= efl_gfx_path_interpolate(pd->stroke.fill, fromd->stroke.fill, tod->stroke.fill, pos_map);
+
+ //Stroke Marker
if (fromd->stroke.marker && tod->stroke.marker && pd->stroke.marker)
- {
- r &= efl_vg_interpolate(pd->stroke.marker, fromd->stroke.marker, tod->stroke.marker, pos_map);
- }
+ r &= efl_gfx_path_interpolate(pd->stroke.marker, fromd->stroke.marker, tod->stroke.marker, pos_map);
return r;
}
-EOLIAN static Efl_VG *
-_efl_vg_shape_efl_duplicate_duplicate(const Eo *obj, Efl_VG_Shape_Data *pd)
+EOLIAN static Efl_Canvas_Vg_Node *
+_efl_canvas_vg_shape_efl_duplicate_duplicate(const Eo *obj, Efl_Canvas_Vg_Shape_Data *pd)
{
- Efl_VG *cn = NULL;
- Efl_VG_Shape_Data *cd = NULL;
+ Efl_Canvas_Vg_Node *node;
+ Efl_Canvas_Vg_Shape_Data *sd;
+
+ node = efl_duplicate(efl_super(obj, MY_CLASS));
+ sd = efl_data_scope_get(node, MY_CLASS);
- cn = efl_duplicate(efl_super(obj, MY_CLASS));
- cd = efl_data_scope_get(cn, MY_CLASS);
if (pd->fill)
- cd->fill = efl_duplicate(pd->fill);
+ {
+ sd->fill = efl_duplicate(pd->fill);
+ efl_parent_set(sd->fill, node);
+ }
+
if (pd->stroke.fill)
- cd->stroke.fill = efl_duplicate(pd->stroke.fill);
+ {
+ sd->stroke.fill = efl_duplicate(pd->stroke.fill);
+ efl_parent_set(sd->stroke.fill, node);
+ }
+
if (pd->stroke.marker)
- cd->stroke.marker = efl_duplicate(pd->stroke.marker);
+ {
+ sd->stroke.marker = efl_duplicate(pd->stroke.marker);
+ efl_parent_set(sd->stroke.marker, node);
+ }
+
+ efl_gfx_path_copy_from(node, obj);
- efl_gfx_path_copy_from(cn, obj);
- return cn;
+ return node;
}
EAPI double
@@ -411,10 +423,13 @@ evas_vg_shape_equal_commands(Eo *obj, const Eo *with)
return efl_gfx_path_equal_commands(obj, with);
}
-EAPI Efl_VG*
-evas_vg_shape_add(Efl_VG *parent)
+EAPI Efl_Canvas_Vg_Node*
+evas_vg_shape_add(Efl_Canvas_Vg_Node *parent)
{
- return efl_add(EFL_VG_SHAPE_CLASS, parent);
+ /* Warn it because the usage has been changed.
+ We can remove this message after v1.21. */
+ if (!parent) CRI("Efl_VG Shape doesn't allow null parent!");
+ return efl_add(EFL_CANVAS_VG_SHAPE_CLASS, parent);
}
-#include "efl_vg_shape.eo.c"
+#include "efl_canvas_vg_shape.eo.c"
diff --git a/src/lib/evas/canvas/render2/evas_render2_th_main.c b/src/lib/evas/canvas/render2/evas_render2_th_main.c
index e3039776dd..c101a9abbb 100644
--- a/src/lib/evas/canvas/render2/evas_render2_th_main.c
+++ b/src/lib/evas/canvas/render2/evas_render2_th_main.c
@@ -58,7 +58,7 @@ _evas_render2_th_main_delete_objects_clean(Evas_Public_Data *e)
for (i = 0; i < e->delete_objects.count; ++i)
{
obj = eina_array_data_get(&e->delete_objects, i);
- evas_object_free(obj->object, 1);
+ evas_object_free(obj, 1);
}
// OBJS_ARRAY_CLEAN(&e->delete_objects);
eina_array_clean(&e->delete_objects);
diff --git a/src/lib/evas/common/evas_cpu.c b/src/lib/evas/common/evas_cpu.c
index 2adf1d16d7..6283d97f39 100644
--- a/src/lib/evas/common/evas_cpu.c
+++ b/src/lib/evas/common/evas_cpu.c
@@ -1,27 +1,36 @@
#include "evas_common_private.h"
-#ifdef BUILD_MMX
-#include "evas_mmx.h"
-#endif
#ifdef BUILD_NEON
#ifdef BUILD_NEON_INTRINSICS
#include <arm_neon.h>
#endif
#endif
-#if defined BUILD_SSE3
-#include <immintrin.h>
+
+static int cpu_feature_mask = 0;
+
+
+#ifdef BUILD_ALTIVEC
+# ifdef __POWERPC__
+# ifdef __VEC__
+# define NEED_FEATURE_TEST
+# endif
+# endif
+#endif
+#ifdef __SPARC__
+# define NEED_FEATURE_TEST
+#endif
+#if defined(__ARM_ARCH__)
+# ifdef BUILD_NEON
+# define NEED_FEATURE_TEST
+# endif
#endif
+#ifdef NEED_FEATURE_TEST
#if defined (HAVE_STRUCT_SIGACTION) && defined (HAVE_SIGLONGJMP)
#include <signal.h>
#include <setjmp.h>
#include <errno.h>
static sigjmp_buf detect_buf;
-#endif
-
-static int cpu_feature_mask = 0;
-
-#if defined (HAVE_STRUCT_SIGACTION) && defined (HAVE_SIGLONGJMP)
static void evas_common_cpu_catch_ill(int sig);
static void evas_common_cpu_catch_segv(int sig);
@@ -38,46 +47,6 @@ evas_common_cpu_catch_segv(int sig EINA_UNUSED)
}
#endif
-void
-evas_common_cpu_mmx_test(void)
-{
-#ifdef BUILD_MMX
- pxor_r2r(mm4, mm4);
-#endif
-}
-
-void
-evas_common_cpu_mmx2_test(void)
-{
-#ifdef BUILD_MMX
- char data[16];
-
- data[0] = 0;
- mmx_r2m(movntq, mm0, data);
- data[0] = 0;
-#endif
-}
-
-void
-evas_common_cpu_sse_test(void)
-{
-#ifdef BUILD_MMX
- int blah[16];
-
- movntq_r2m(mm0, blah);
-#endif
-}
-
-void evas_common_op_sse3_test(void);
-
-void
-evas_common_cpu_sse3_test(void)
-{
-#ifdef BUILD_SSE3
- evas_common_op_sse3_test();
-#endif
-}
-
#ifdef BUILD_ALTIVEC
void
evas_common_cpu_altivec_test(void)
@@ -119,7 +88,18 @@ evas_common_cpu_vis_test(void)
#ifdef __SPARC__
#endif /* __SPARC__ */
}
+#endif /* NEED_FEATURE_TEST */
+static Eina_Bool
+_cpu_check(Eina_Cpu_Features f)
+{
+ Eina_Cpu_Features features;
+
+ features = eina_cpu_features_get();
+ return (features & f) == f;
+}
+
+#ifdef NEED_FEATURE_TEST
int
evas_common_cpu_feature_test(void (*feature)(void))
{
@@ -150,19 +130,17 @@ evas_common_cpu_feature_test(void (*feature)(void))
sigaction(SIGSEGV, &oact2, NULL);
return enabled;
#else
- Eina_Cpu_Features f;
-
- f = eina_cpu_features_get();
if (feature == evas_common_cpu_mmx_test)
- return (f & EINA_CPU_MMX) == EINA_CPU_MMX;
+ return _cpu_check(EINA_CPU_MMX);
/* no mmx2 support in eina */
if (feature == evas_common_cpu_sse_test)
- return (f & EINA_CPU_SSE) == EINA_CPU_SSE;
+ return _cpu_check(EINA_CPU_SSE);
if (feature == evas_common_cpu_sse3_test)
- return (f & EINA_CPU_SSE3) == EINA_CPU_SSE3;
+ return _cpu_check(EINA_CPU_SSE3);
return 0;
#endif
}
+#endif
EAPI void
evas_common_cpu_init(void)
@@ -175,36 +153,20 @@ evas_common_cpu_init(void)
if (getenv("EVAS_CPU_NO_MMX"))
cpu_feature_mask &= ~CPU_FEATURE_MMX;
else
- {
- cpu_feature_mask |= CPU_FEATURE_MMX *
- evas_common_cpu_feature_test(evas_common_cpu_mmx_test);
- evas_common_cpu_end_opt();
- }
+ cpu_feature_mask |= _cpu_check(EINA_CPU_MMX) * CPU_FEATURE_MMX;
if (getenv("EVAS_CPU_NO_MMX2"))
cpu_feature_mask &= ~CPU_FEATURE_MMX2;
- else
- {
- cpu_feature_mask |= CPU_FEATURE_MMX2 *
- evas_common_cpu_feature_test(evas_common_cpu_mmx2_test);
- evas_common_cpu_end_opt();
- }
+ else /* It seems "MMX2" is actually part of SSE (and 3DNow)? */
+ cpu_feature_mask |= _cpu_check(EINA_CPU_SSE) * CPU_FEATURE_MMX2;
if (getenv("EVAS_CPU_NO_SSE"))
cpu_feature_mask &= ~CPU_FEATURE_SSE;
else
- {
- cpu_feature_mask |= CPU_FEATURE_SSE *
- evas_common_cpu_feature_test(evas_common_cpu_sse_test);
- evas_common_cpu_end_opt();
- }
+ cpu_feature_mask |= _cpu_check(EINA_CPU_SSE) * CPU_FEATURE_SSE;
# ifdef BUILD_SSE3
if (getenv("EVAS_CPU_NO_SSE3"))
- cpu_feature_mask &= ~CPU_FEATURE_SSE3;
+ cpu_feature_mask &= ~CPU_FEATURE_SSE3;
else
- {
- cpu_feature_mask |= CPU_FEATURE_SSE3 *
- evas_common_cpu_feature_test(evas_common_cpu_sse3_test);
- evas_common_cpu_end_opt();
- }
+ cpu_feature_mask |= _cpu_check(EINA_CPU_SSE3) * CPU_FEATURE_SSE3;
# endif /* BUILD_SSE3 */
#endif /* BUILD_MMX */
#ifdef BUILD_ALTIVEC
@@ -237,9 +199,15 @@ evas_common_cpu_init(void)
cpu_feature_mask &= ~CPU_FEATURE_NEON;
else
{
+ /* On linux eina_cpu sets this up with getauxval() */
+#if defined(HAVE_SYS_AUXV_H) && defined(HAVE_ASM_HWCAP_H) && defined(__arm__) && defined(__linux__)
+ cpu_feature_mask |= CPU_FEATURE_NEON *
+ !!(eina_cpu_features_get() & EINA_CPU_NEON);
+#else
cpu_feature_mask |= CPU_FEATURE_NEON *
evas_common_cpu_feature_test(evas_common_cpu_neon_test);
evas_common_cpu_end_opt();
+#endif
}
# endif
#endif
diff --git a/src/lib/evas/common/evas_font.h b/src/lib/evas/common/evas_font.h
index 1a010bfe05..246fe5a3cb 100644
--- a/src/lib/evas/common/evas_font.h
+++ b/src/lib/evas/common/evas_font.h
@@ -27,15 +27,15 @@ typedef unsigned long long DATA64;
#endif
#ifdef _WIN32
-# ifdef EFL_EVAS_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EVAS_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -46,7 +46,7 @@ typedef unsigned long long DATA64;
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#define LK(x) Eina_Lock x
#define LKI(x) eina_lock_new(&(x))
diff --git a/src/lib/evas/common/evas_image_load.c b/src/lib/evas/common/evas_image_load.c
index 0ea6a582d6..d1ffed88c6 100644
--- a/src/lib/evas/common/evas_image_load.c
+++ b/src/lib/evas/common/evas_image_load.c
@@ -516,14 +516,17 @@ evas_common_extension_can_load_get(const char *file)
unsigned int i;
length = eina_stringshare_strlen(file) + 1;
- if (length < 5) return EINA_FALSE;
for (i = 0; i < sizeof (loaders) / sizeof (struct ext_loader_s); ++i)
{
if (loaders[i].length > length) continue;
if (!strcasecmp(loaders[i].extension, file + length - loaders[i].length))
- return EINA_TRUE;
+ {
+ if ((file[length - loaders[i].length] != '/') ||
+ (length == loaders[i].length))
+ return EINA_TRUE;
+ }
}
return EINA_FALSE;
}
diff --git a/src/lib/evas/common/evas_image_main.c b/src/lib/evas/common/evas_image_main.c
index 591f82fb99..404c70b566 100644
--- a/src/lib/evas/common/evas_image_main.c
+++ b/src/lib/evas/common/evas_image_main.c
@@ -17,6 +17,7 @@
//#include "evas_cs.h"
#ifdef HAVE_VALGRIND
+# include <valgrind.h>
# include <memcheck.h>
#endif
@@ -115,6 +116,10 @@ _evas_common_rgba_image_surface_size(unsigned int w, unsigned int h,
int siz, block_size = 8;
Eina_Bool reset_borders = EINA_TRUE;
+#ifdef HAVE_VALGRIND
+ if (RUNNING_ON_VALGRIND) evas_image_no_mmap = 1;
+#endif
+
if (EINA_UNLIKELY(evas_image_no_mmap == -1))
{
const char *s = getenv("EVAS_IMAGE_NO_MMAP");
diff --git a/src/lib/evas/common/evas_map_image.c b/src/lib/evas/common/evas_map_image.c
index 339db5aff4..94c35f84d1 100644
--- a/src/lib/evas/common/evas_map_image.c
+++ b/src/lib/evas/common/evas_map_image.c
@@ -495,7 +495,7 @@ _evas_common_map_rgba_span(RGBA_Map_Spans *span,
span->havea = 0;
span->direct = 0;
- // find y yop line and y bottom line
+ // find y top line and y bottom line
ytop = p[0].y;
if ((p[0].col >> 24) < 0xff) span->havea = 1;
if (p[0].col == 0xffffffff) span->havecol--;
diff --git a/src/lib/evas/common/evas_map_image_aa.c b/src/lib/evas/common/evas_map_image_aa.c
index 79ff4a34eb..444755c333 100644
--- a/src/lib/evas/common/evas_map_image_aa.c
+++ b/src/lib/evas/common/evas_map_image_aa.c
@@ -1,117 +1,57 @@
-#define READY_TX() \
+#define PUSH_EDGE_POINT() \
+do \
{ \
- if (eidx == 0) \
- { \
- tx[0] = edge2.x; \
- tx[1] = spans[y].span[0].x[0]; \
- } \
- else \
- { \
- tx[0] = spans[y].span[0].x[1]; \
- tx[1] = edge2.x; \
- } \
-}
-
-#define READY_TX2() \
-{ \
- if (eidx == 0) \
- { \
- tx2[0] = edge2.x; \
- tx2[1] = edge1.x; \
- } \
- else \
- { \
- tx2[0] = edge1.x; \
- tx2[1] = edge2.x; \
- } \
-}
-
-#define PUSH_EDGES(xx) \
-{ \
- if (!leftover) \
- { \
- edge1.x = edge2.x; \
- edge1.y = edge2.y; \
- edge2.x = (xx); \
- edge2.y = y; \
- } \
- else \
- { \
- edge1.y = edge2.y; \
- edge2.y = y; \
- } \
- reset_tx2 = EINA_TRUE; \
-}
+ p_edge.x = spans[y].span[0].x[eidx]; \
+ p_edge.y = y; \
+ ptx[0] = tx[0]; \
+ ptx[1] = tx[1]; \
+} while (0)
-//Vertical Inside Direction
-#define VERT_INSIDE(rewind, y_advance) \
-{ \
- int cov_range = edge2.y - edge1.y; \
- int coverage = (256 / (cov_range + 1)); \
- int ry; \
- int val; \
- for (ry = 1; ry < ((rewind) + 1); ry++) \
- { \
- int ridx = (y - ry) + (y_advance); \
- if (spans[ridx].aa_len[eidx] > 1) continue; \
- if (eidx == 1) \
- val = (256 - (coverage * (ry + (cov_range - (rewind))))); \
- else \
- val = (coverage * (ry + (cov_range - (rewind)))); \
- if ((spans[ridx].aa_len[eidx] == 0) || \
- (val < spans[ridx].aa_cov[eidx])) \
- spans[ridx].aa_cov[eidx] = val; \
- spans[ridx].aa_len[eidx] = 1; \
- } \
- prev_aa = 4; \
-}
-
-//Vertical Outside Direction
-#define VERT_OUTSIDE(rewind, y_advance, cov_range) \
-{ \
- int coverage = (256 / ((cov_range) + 1)); \
- int ry = 1; \
- for (; ry < ((rewind) + 1); ry++) \
- { \
- int ridx = (y - ry) + (y_advance); \
- if (spans[ridx].aa_len[(eidx)] > 1) continue; \
- spans[ridx].aa_len[(eidx)] = 1; \
- if (eidx == 1) \
- { \
- spans[ridx].aa_cov[(eidx)] = \
- (coverage * (ry + (cov_range - (rewind)))); \
- } \
- else \
- { \
- spans[ridx].aa_cov[(eidx)] = \
- (256 - (coverage * (ry + ((cov_range) - (rewind))))); \
- } \
- } \
- prev_aa = 2; \
+static void
+calc_irregular_coverage(Line* spans, int eidx, int y, int diagonal,
+ int edge_dist, Eina_Bool reverse)
+{
+ if (eidx == 1) reverse = !reverse;
+ int coverage = (256 / (diagonal + 2));
+ int tmp;
+ for (int ry = 0; ry < (diagonal + 2); ry++)
+ {
+ tmp = y - ry - edge_dist;
+ if (tmp < 0) return;
+ spans[tmp].aa_len[eidx] = 1;
+ if (reverse) spans[tmp].aa_cov[eidx] = 256 - (coverage * ry);
+ else spans[tmp].aa_cov[eidx] = (coverage * ry);
+ }
}
-//Horizontal Inside Direction
-#define HORIZ_INSIDE(yy, xx, xx2) \
-{ \
- if (((xx) - (xx2)) > spans[(yy)].aa_len[(eidx)]) \
- { \
- spans[(yy)].aa_len[(eidx)] = ((xx) - (xx2)); \
- spans[(yy)].aa_cov[(eidx)] = (256 / (spans[(yy)].aa_len[(eidx)] + 1)); \
- } \
+static void
+calc_vert_coverage(Line *spans, int eidx, int y, int rewind, Eina_Bool reverse)
+{
+ if (eidx == 1) reverse = !reverse;
+ int coverage = (256 / (rewind + 1));
+ int tmp;
+ for (int ry = 1; ry < (rewind + 1); ry++)
+ {
+ tmp = y - ry;
+ if (tmp < 0 ) return;
+ spans[tmp].aa_len[eidx] = 1;
+ if (reverse) spans[tmp].aa_cov[eidx] = (256 - (coverage * ry));
+ else spans[tmp].aa_cov[eidx] = (coverage * ry);
+ }
}
-//Horizontal Outside Direction
-#define HORIZ_OUTSIDE(yy, xx, xx2) \
-{ \
- if (((xx) - (xx2)) > spans[(yy)].aa_len[(eidx)]) \
- { \
- spans[(yy)].aa_len[(eidx)] = ((xx) - (xx2)); \
- spans[(yy)].aa_cov[(eidx)] = (256 / (spans[(yy)].aa_len[(eidx)] + 1)); \
- } \
+static void
+calc_horiz_coverage(Line *spans, int eidx, int y, int x, int x2)
+{
+ if (spans[y].aa_len[eidx] < abs(x - x2))
+ {
+ spans[y].aa_len[eidx] = abs(x - x2);
+ spans[y].aa_cov[eidx] = (256 / (spans[y].aa_len[eidx] + 1));
+ }
}
static inline DATA32
-_aa_coverage_apply(Line *line, int ww, int w, DATA32 val)
+_aa_coverage_apply(Line *line, int ww, int w, DATA32 val, Eina_Bool src_alpha)
{
//Left Edge Anti Anliasing
if ((w - line->aa_len[0]) < ww)
@@ -124,28 +64,37 @@ _aa_coverage_apply(Line *line, int ww, int w, DATA32 val)
return MUL_256(256 - (line->aa_cov[1] * (line->aa_len[1] - ww + 1)),
val);
}
+ //Remove Transparency if src image alpha is off.
+ if (!src_alpha)
+ {
+ if (((val & 0xff000000) >> 24) < 0xff)
+ return (val | 0xff000000);
+ }
return val;
}
-void
+static void
_calc_aa_edges_internal(Line *spans, int eidx, int ystart, int yend)
{
int y;
- Evas_Coord_Point edge1 = { -1, -1 }; //prev-previous edge pixel
- Evas_Coord_Point edge2 = { -1, -1 }; //previous edge pixel
+ Evas_Coord_Point p_edge = {-1, -1}; //previous edge point
+ Evas_Coord_Point edge_diff = {0, 0}; //temporary used for point distance
- /* store larger to tx[0] between prev and current edge's x positions. */
+ /* store bigger to tx[0] between prev and current edge's x positions. */
int tx[2] = {0, 0};
+ /* back up prev tx values */
+ int ptx[2] = {0, 0};
+ int diagonal = 0; //straight diagonal pixels counti
- /* store lager to tx2[0] between edge1 and edge2's x positions. */
- int tx2[2] = {0, 0};
-
- /* previous edge anti-aliased type.
- 2: vertical outside
- 4: vertical inside */
- int prev_aa = 0;
+//Previous edge direction:
+#define DirOutHor 0x0011
+#define DirOutVer 0x0001
+#define DirInHor 0x0010
+#define DirInVer 0x0000
+#define DirNone 0x1000
- Eina_Bool reset_tx2 = EINA_TRUE;
+ int prev_dir = DirNone;
+ int cur_dir = DirNone;
yend -= ystart;
@@ -153,129 +102,131 @@ _calc_aa_edges_internal(Line *spans, int eidx, int ystart, int yend)
for (y = 0; y < yend; y++)
{
if (spans[y].span[0].x[0] == -1) continue;
- edge1.x = edge2.x = spans[y].span[0].x[eidx];
- edge1.y = edge2.y = y;
+ p_edge.x = spans[y].span[0].x[eidx];
+ p_edge.y = y;
break;
}
//Calculates AA Edges
- for (y++; y <= yend; y++)
+ for (y++; y < yend; y++)
{
- Eina_Bool leftover = EINA_FALSE;
+ //Ready tx
+ if (eidx == 0)
+ {
+ tx[0] = p_edge.x;
+ tx[1] = spans[y].span[0].x[0];
+ }
+ else
+ {
+ tx[0] = spans[y].span[0].x[1];
+ tx[1] = p_edge.x;
+ }
- if (spans[y].span[0].x[eidx] == -1) leftover = EINA_TRUE;
+ edge_diff.x = (tx[0] - tx[1]);
+ edge_diff.y = (y - p_edge.y);
- if (!leftover) READY_TX()
+ //Confirm current edge direction
+ if (edge_diff.x > 0)
+ {
+ if (edge_diff.y == 1) cur_dir = DirOutHor;
+ else cur_dir = DirOutVer;
+ }
+ else if (edge_diff.x < 0)
+ {
+ if (edge_diff.y == 1) cur_dir = DirInHor;
+ else cur_dir = DirInVer;
+ }
+ else cur_dir = DirNone;
- //Case1. Outside Incremental
- if (tx[0] > tx[1])
+ //straight diagonal increase
+ if ((cur_dir == prev_dir) && (y < yend))
{
- //Horizontal Edge
- if ((y - edge2.y) == 1)
+ if ((abs(edge_diff.x) == 1) && (edge_diff.y == 1))
{
- HORIZ_OUTSIDE(y, tx[0], tx[1])
+ ++diagonal;
+ PUSH_EDGE_POINT();
+ continue;
}
- //Vertical Edge
- else if (tx[0] > tx[1])
- {
- VERT_OUTSIDE((y - edge2.y), 0, (y - edge2.y))
-
- //Just in case: 1 pixel alias next to vertical edge?
- if (abs(spans[(y + 1)].span[0].x[eidx] -
- spans[y].span[0].x[eidx]) >= 1)
- {
- HORIZ_OUTSIDE(y, tx[0], tx[1])
- }
- }
- PUSH_EDGES(spans[y].span[0].x[eidx])
}
- //Case2. Inside Incremental
- else if (tx[1] > tx[0])
+ switch (cur_dir)
{
- //Just in case: direction is reversed at the outside vertical edge?
- if (prev_aa == 2)
- {
- VERT_OUTSIDE((y - edge2.y), 0, (y - edge2.y))
- edge1.x = spans[y - 1].span[0].x[eidx];
- edge1.y = y - 1;
- edge2.x = spans[y].span[0].x[eidx];
- edge2.y = y;
- }
- else
- PUSH_EDGES(spans[y].span[0].x[eidx])
-
- /* Find next edge. We go forward 2 more index since this logic
- computes aa edges by looking back in advance 2 spans. */
- for (y++; y <= (yend + 2); y++)
- {
- leftover = EINA_FALSE;
-
- if ((spans[y].span[0].x[eidx] == -1) || (y > yend))
- leftover = EINA_TRUE;
-
- if (!leftover) READY_TX()
- if (reset_tx2) READY_TX2()
-
- //Case 1. Inside Direction
- if (tx[1] > tx[0])
- {
- //Horizontal Edge
- if ((edge2.y - edge1.y) == 1)
- {
- HORIZ_INSIDE(edge1.y, tx2[0], tx2[1]);
- }
- //Vertical Edge
- else if ((tx2[0] - tx2[1]) == 1)
- {
- VERT_INSIDE((edge2.y - edge1.y), -(y - edge2.y))
- }
- //Just in case: Right Side Square Edge...?
- else if (prev_aa == 4)
- {
- VERT_INSIDE((edge2.y - edge1.y), -(y - edge2.y))
- if ((y - edge2.y) == 1)
- {
- HORIZ_INSIDE((edge2.y - 1), edge2.x,
- spans[y].span[0].x[eidx]);
- }
- }
- PUSH_EDGES(spans[y].span[0].x[eidx])
- }
- //Case 2. Reversed. Outside Direction
- else if (tx[1] < tx[0])
- {
- //Horizontal Edge
- if ((edge2.y - edge1.y) == 1)
- HORIZ_INSIDE(edge1.y, tx2[0], tx2[1])
- //Vertical Edge
- else
- VERT_INSIDE((edge2.y - edge1.y), -(y - edge2.y))
-
- PUSH_EDGES(spans[y].span[0].x[eidx])
- break;
- }
- }
+ case DirOutHor:
+ {
+ calc_horiz_coverage(spans, eidx, y, tx[0], tx[1]);
+ if (diagonal > 0)
+ {
+ calc_irregular_coverage(spans, eidx, y, diagonal, 0,
+ EINA_TRUE);
+ diagonal = 0;
+ }
+ /* Increment direction is changed:
+ Outside Vertical -> Outside Horizontal */
+ if (prev_dir == DirOutVer)
+ calc_horiz_coverage(spans, eidx, p_edge.y, ptx[0], ptx[1]);
+ PUSH_EDGE_POINT();
+ }
+ break;
+ case DirOutVer:
+ {
+ calc_vert_coverage(spans, eidx, y, edge_diff.y, EINA_TRUE);
+ if (diagonal > 0)
+ {
+ calc_irregular_coverage(spans, eidx, y, diagonal,
+ edge_diff.y, EINA_FALSE);
+ diagonal = 0;
+ }
+ /* Increment direction is changed:
+ Outside Horizontal -> Outside Vertical */
+ if (prev_dir == DirOutHor)
+ calc_horiz_coverage(spans, eidx, p_edge.y, ptx[0], ptx[1]);
+ PUSH_EDGE_POINT();
+ }
+ break;
+ case DirInHor:
+ {
+ calc_horiz_coverage(spans, eidx, (y - 1), tx[0], tx[1]);
+ if (diagonal > 0)
+ {
+ calc_irregular_coverage(spans, eidx, y, diagonal, 0,
+ EINA_FALSE);
+ diagonal = 0;
+ }
+ /* Increment direction is changed:
+ Outside Horizontal -> Inside Horizontal */
+ if (prev_dir == DirOutHor)
+ calc_horiz_coverage(spans, eidx, p_edge.y, ptx[0], ptx[1]);
+ PUSH_EDGE_POINT();
+ }
+ break;
+ case DirInVer:
+ {
+ calc_vert_coverage(spans, eidx, y, edge_diff.y, EINA_FALSE);
+ if (diagonal > 0)
+ {
+ calc_irregular_coverage(spans, eidx, y, diagonal,
+ edge_diff.y, EINA_TRUE);
+ diagonal = 0;
+ }
+ /* Increment direction is changed:
+ Outside Horizontal -> Inside Vertical */
+ if (prev_dir == DirOutHor)
+ calc_horiz_coverage(spans, eidx, p_edge.y, ptx[0], ptx[1]);
+ PUSH_EDGE_POINT();
+ }
+ break;
}
+ if (cur_dir != DirNone) prev_dir = cur_dir;
}
- y = yend;
-
- //Leftovers for verticals.
- if (prev_aa == 2)
- {
- if (((eidx == 0) && (edge1.x > edge2.x)) ||
- ((eidx == 1) && (edge1.x < edge2.x)))
- VERT_OUTSIDE((y - edge2.y + 1), 1, (edge2.y - edge1.y));
- }
- else if (prev_aa == 4)
+ //leftovers...?
+ if ((edge_diff.y == 1) && (edge_diff.x != 0))
{
- if (((eidx == 0) && (edge1.x < edge2.x)) ||
- ((eidx == 1) && (edge1.x > edge2.x)))
- {
- VERT_INSIDE((edge2.y - edge1.y), -(y - edge2.y))
- VERT_INSIDE((y - edge2.y) + 1, 1);
- }
+ calc_horiz_coverage(spans, eidx, y - 1, ptx[0], ptx[1]);
+ calc_horiz_coverage(spans, eidx, y, tx[0], tx[1]);
}
+ else
+ calc_vert_coverage(spans, eidx, (y + 1), (edge_diff.y + 2),
+ (prev_dir & 0x00000001));
}
static void
diff --git a/src/lib/evas/common/evas_map_image_internal.c b/src/lib/evas/common/evas_map_image_internal.c
index bc3a80912c..b458dff675 100644
--- a/src/lib/evas/common/evas_map_image_internal.c
+++ b/src/lib/evas/common/evas_map_image_internal.c
@@ -15,6 +15,7 @@ FUNC_NAME(RGBA_Image *src, RGBA_Image *dst,
RGBA_Gfx_Func func = NULL, func2 = NULL;
Eina_Bool havea = EINA_FALSE;
Eina_Bool sa, ssa, da;
+ Eina_Bool saa; //Source alpha overriding with anti-alias flag.
int havecol = 4;
cx = clip_x;
@@ -102,21 +103,24 @@ FUNC_NAME(RGBA_Image *src, RGBA_Image *dst,
else
{
buf = alloca(cw * sizeof(DATA32));
- if (havea) sa = 1;
+ if (havea) sa = EINA_TRUE;
+
+ saa = (anti_alias | sa);
+
if (!mask_ie)
{
if (mul_col != 0xffffffff)
- func = evas_common_gfx_func_composite_pixel_color_span_get(sa, ssa, mul_col, da, cw, render_op);
+ func = evas_common_gfx_func_composite_pixel_color_span_get(saa, ssa, mul_col, da, cw, render_op);
else
- func = evas_common_gfx_func_composite_pixel_span_get(sa, ssa, da, cw, render_op);
+ func = evas_common_gfx_func_composite_pixel_span_get(saa, ssa, da, cw, render_op);
}
else
{
- func = evas_common_gfx_func_composite_pixel_mask_span_get(sa, ssa, da, cw, render_op);
+ func = evas_common_gfx_func_composite_pixel_mask_span_get(saa, ssa, da, cw, render_op);
if (mul_col != 0xffffffff)
- func2 = evas_common_gfx_func_composite_pixel_color_span_get(sa, ssa, mul_col, da, cw, EVAS_RENDER_COPY);
+ func2 = evas_common_gfx_func_composite_pixel_color_span_get(saa, ssa, mul_col, da, cw, EVAS_RENDER_COPY);
}
- if (sa || anti_alias) src->cache_entry.flags.alpha = EINA_TRUE;
+ if (sa) src->cache_entry.flags.alpha = EINA_TRUE;
}
if (havecol == 0)
{
@@ -134,7 +138,7 @@ static void
FUNC_NAME_DO(RGBA_Image *src, RGBA_Image *dst,
RGBA_Draw_Context *dc,
const RGBA_Map_Spans *ms,
- int smooth, int anti_alias EINA_UNUSED, int level EINA_UNUSED) // level unused for now - for future use
+ int smooth, int anti_alias, int level EINA_UNUSED) // level unused for now - for future use
{
Line *spans;
DATA32 *buf = NULL, *sp;
@@ -145,6 +149,7 @@ FUNC_NAME_DO(RGBA_Image *src, RGBA_Image *dst,
int havecol;
int i;
Eina_Bool sa, ssa, da;
+ Eina_Bool saa; //Source alpha overriding with anti-alias flag.
RGBA_Image *mask_ie = dc->clip.mask;
int mask_x = dc->clip.mask_x;
@@ -184,21 +189,24 @@ FUNC_NAME_DO(RGBA_Image *src, RGBA_Image *dst,
if (!direct)
{
buf = alloca(cw * sizeof(DATA32));
- if (ms->havea) sa = 1;
+ if (ms->havea) sa = EINA_TRUE;
+
+ saa = (anti_alias | sa);
+
if (!mask_ie)
{
if (mul_col != 0xffffffff)
- func = evas_common_gfx_func_composite_pixel_color_span_get(sa, ssa, dc->mul.col, da, cw, dc->render_op);
+ func = evas_common_gfx_func_composite_pixel_color_span_get(saa, ssa, dc->mul.col, da, cw, dc->render_op);
else
- func = evas_common_gfx_func_composite_pixel_span_get(sa, ssa, da, cw, dc->render_op);
+ func = evas_common_gfx_func_composite_pixel_span_get(saa, ssa, da, cw, dc->render_op);
}
else
{
- func = evas_common_gfx_func_composite_pixel_mask_span_get(sa, ssa, da, cw, dc->render_op);
+ func = evas_common_gfx_func_composite_pixel_mask_span_get(saa, ssa, da, cw, dc->render_op);
if (mul_col != 0xffffffff)
- func2 = evas_common_gfx_func_composite_pixel_color_span_get(sa, ssa, dc->mul.col, da, cw, EVAS_RENDER_COPY);
+ func2 = evas_common_gfx_func_composite_pixel_color_span_get(saa, ssa, dc->mul.col, da, cw, EVAS_RENDER_COPY);
}
- if (sa || anti_alias) src->cache_entry.flags.alpha = EINA_TRUE;
+ if (sa) src->cache_entry.flags.alpha = EINA_TRUE;
}
if (havecol == 0)
diff --git a/src/lib/evas/common/evas_map_image_loop.c b/src/lib/evas/common/evas_map_image_loop.c
index 92bff0ebfa..7cbb494c12 100644
--- a/src/lib/evas/common/evas_map_image_loop.c
+++ b/src/lib/evas/common/evas_map_image_loop.c
@@ -237,7 +237,7 @@
u += ud;
v += vd;
# endif //COLBLACK
- if (anti_alias) *d = _aa_coverage_apply(line, ww, w, *d);
+ if (anti_alias) *d = _aa_coverage_apply(line, ww, w, *d, sa);
d++;
ww--;
}
@@ -352,7 +352,6 @@
*d = MUL4_SYM(cval, val1);
cv += cd; // col
# endif
- if (anti_alias) *d = _aa_coverage_apply(line, ww, w, *d);
# endif
# else
*d = *s;
@@ -360,6 +359,7 @@
u += ud;
v += vd;
# endif //COLBLACK
+ if (anti_alias) *d = _aa_coverage_apply(line, ww, w, *d, sa);
d++;
ww--;
}
diff --git a/src/lib/evas/common/evas_scale_sample.c b/src/lib/evas/common/evas_scale_sample.c
index 737aeb2fec..fc1eb00a51 100644
--- a/src/lib/evas/common/evas_scale_sample.c
+++ b/src/lib/evas/common/evas_scale_sample.c
@@ -889,8 +889,6 @@ evas_common_scale_sample_init(void)
return;
#endif
- ecore_init();
-
ecore_fork_reset_callback_add(evas_common_scale_sample_fork_reset, NULL);
thread_queue = eina_thread_queue_new();
@@ -944,6 +942,4 @@ evas_common_scale_sample_shutdown(void)
eina_thread_queue_free(thread_queue);
eina_thread_queue_free(main_queue);
-
- ecore_shutdown();
}
diff --git a/src/lib/evas/common/evas_thread_render.c b/src/lib/evas/common/evas_thread_render.c
index c823125f69..324f6e9e3b 100644
--- a/src/lib/evas/common/evas_thread_render.c
+++ b/src/lib/evas/common/evas_thread_render.c
@@ -11,7 +11,8 @@ static Eina_Inarray evas_thread_queue;
static Evas_Thread_Command *evas_thread_queue_cache = NULL;
static unsigned int evas_thread_queue_cache_max = 0;
-static volatile int evas_thread_exited = 0;
+static Eina_Lock evas_thread_exited_lock;
+static int evas_thread_exited = 0;
static Eina_Bool exit_thread = EINA_FALSE;
static int init_count = 0;
@@ -132,7 +133,7 @@ evas_thread_worker_func(void *data EINA_UNUSED, Eina_Thread thread EINA_UNUSED)
eina_lock_release(&evas_thread_queue_lock);
goto out;
}
- eina_condition_wait(&evas_thread_queue_condition);
+ eina_condition_timedwait(&evas_thread_queue_condition, SHUTDOWN_TIMEOUT * 0.75);
}
if (!eina_inarray_count(&evas_thread_queue))
@@ -176,14 +177,20 @@ evas_thread_worker_func(void *data EINA_UNUSED, Eina_Thread thread EINA_UNUSED)
}
out:
- /* WRN: add a memory barrier or use a lock if we add more code here */
+ eina_lock_take(&evas_thread_exited_lock);
evas_thread_exited = 1;
+ eina_lock_release(&evas_thread_exited_lock);
return NULL;
}
static void
evas_thread_fork_reset(void *data EINA_UNUSED)
{
+ if (!eina_lock_new(&evas_thread_exited_lock))
+ {
+ CRI("Could not create exit thread lock (%m)");
+ goto on_error;
+ }
if (!eina_lock_new(&evas_thread_queue_lock))
{
CRI("Could not create draw thread lock (%m)");
@@ -205,6 +212,7 @@ evas_thread_fork_reset(void *data EINA_UNUSED)
return ;
on_error:
+ eina_lock_free(&evas_thread_exited_lock);
eina_lock_free(&evas_thread_queue_lock);
eina_condition_free(&evas_thread_queue_condition);
@@ -227,8 +235,6 @@ evas_thread_init(void)
exit_thread = EINA_FALSE;
evas_thread_exited = 0;
- ecore_init();
-
if(!eina_threads_init())
{
CRI("Could not init eina threads");
@@ -237,6 +243,12 @@ evas_thread_init(void)
eina_inarray_step_set(&evas_thread_queue, sizeof (Eina_Inarray), sizeof (Evas_Thread_Command), 128);
+ if (!eina_lock_new(&evas_thread_exited_lock))
+ {
+ CRI("Could not create exit thread lock (%m)");
+ goto fail_on_lock_creation;
+ }
+
if (!eina_lock_new(&evas_thread_queue_lock))
{
CRI("Could not create draw thread lock (%m)");
@@ -263,13 +275,13 @@ fail_on_thread_creation:
evas_thread_worker = 0;
eina_condition_free(&evas_thread_queue_condition);
fail_on_cond_creation:
+ eina_lock_free(&evas_thread_exited_lock);
eina_lock_free(&evas_thread_queue_lock);
fail_on_lock_creation:
eina_threads_shutdown();
fail_on_eina_thread_init:
exit_thread = EINA_TRUE;
evas_thread_exited = 1;
- ecore_shutdown();
return --init_count;
}
@@ -300,8 +312,13 @@ evas_thread_shutdown(void)
eina_lock_release(&evas_thread_queue_lock);
_shutdown_timeout(&to, SHUTDOWN_TIMEOUT_RESET, SHUTDOWN_TIMEOUT);
- while (!evas_thread_exited && (evas_async_events_process() != -1))
+ while (1)
{
+ int exited;
+ eina_lock_take(&evas_thread_exited_lock);
+ exited = evas_thread_exited;
+ eina_lock_release(&evas_thread_exited_lock);
+ if (exited || (evas_async_events_process() == -1)) break;
if(_shutdown_timeout(&to, SHUTDOWN_TIMEOUT_CHECK, SHUTDOWN_TIMEOUT))
{
CRI("Timeout shutdown thread. Skipping thread_join. Some resources could be leaked");
@@ -311,6 +328,7 @@ evas_thread_shutdown(void)
eina_thread_join(evas_thread_worker);
timeout_shutdown:
+ eina_lock_free(&evas_thread_exited_lock);
eina_lock_free(&evas_thread_queue_lock);
eina_condition_free(&evas_thread_queue_condition);
@@ -323,7 +341,5 @@ timeout_shutdown:
eina_threads_shutdown();
- ecore_shutdown();
-
return 0;
}
diff --git a/src/lib/evas/common/language/evas_bidi_utils.c b/src/lib/evas/common/language/evas_bidi_utils.c
index fc9a35dd9b..a4653416e7 100644
--- a/src/lib/evas/common/language/evas_bidi_utils.c
+++ b/src/lib/evas/common/language/evas_bidi_utils.c
@@ -234,6 +234,10 @@ evas_bidi_paragraph_props_get(const Eina_Unicode *eina_ustr, size_t len,
EvasBiDiLevel *embedding_levels = NULL;
const FriBidiChar *ustr;
FriBidiChar *base_ustr = NULL;
+ EvasBiDiLevel ret_level = 0;
+#if FRIBIDI_MAJOR_VERSION >= 1
+ EvasBiDiBracketType *bracket_types = NULL;
+#endif
if (!eina_ustr)
return NULL;
@@ -266,6 +270,15 @@ evas_bidi_paragraph_props_get(const Eina_Unicode *eina_ustr, size_t len,
}
fribidi_get_bidi_types(ustr, len, char_types);
+#if FRIBIDI_MAJOR_VERSION >= 1
+ bracket_types = (EvasBiDiBracketType *) malloc(sizeof(EvasBiDiBracketType) * len);
+ if (!bracket_types)
+ {
+ goto cleanup;
+ }
+ fribidi_get_bracket_types(ustr, len, char_types, bracket_types);
+#endif
+
embedding_levels = (EvasBiDiLevel *)malloc(sizeof(EvasBiDiLevel) * len);
if (!embedding_levels)
{
@@ -282,10 +295,19 @@ evas_bidi_paragraph_props_get(const Eina_Unicode *eina_ustr, size_t len,
for (itr = segment_idxs ; *itr > 0 ; itr++)
{
direction = base_bidi;
- if (!fribidi_get_par_embedding_levels(char_types + pos,
- *itr - pos,
- &direction,
- embedding_levels + pos))
+#if FRIBIDI_MAJOR_VERSION >= 1
+ ret_level = fribidi_get_par_embedding_levels_ex(char_types + pos,
+ bracket_types,
+ *itr - pos,
+ &direction,
+ embedding_levels + pos);
+#else
+ ret_level = fribidi_get_par_embedding_levels(char_types + pos,
+ *itr - pos,
+ &direction,
+ embedding_levels + pos);
+#endif
+ if (!ret_level)
{
goto cleanup;
}
@@ -308,10 +330,19 @@ evas_bidi_paragraph_props_get(const Eina_Unicode *eina_ustr, size_t len,
}
direction = base_bidi;
- if (!fribidi_get_par_embedding_levels(char_types + pos,
- len - pos,
- &direction,
- embedding_levels + pos))
+#if FRIBIDI_MAJOR_VERSION >= 1
+ ret_level = fribidi_get_par_embedding_levels_ex(char_types + pos,
+ bracket_types,
+ len - pos,
+ &direction,
+ embedding_levels + pos);
+#else
+ ret_level = fribidi_get_par_embedding_levels(char_types + pos,
+ len - pos,
+ &direction,
+ embedding_levels + pos);
+#endif
+ if (!ret_level)
{
goto cleanup;
}
@@ -328,8 +359,19 @@ evas_bidi_paragraph_props_get(const Eina_Unicode *eina_ustr, size_t len,
}
else
{
- if (!fribidi_get_par_embedding_levels(char_types, len,
- &bidi_props->direction, embedding_levels))
+#if FRIBIDI_MAJOR_VERSION >= 1
+ ret_level = fribidi_get_par_embedding_levels_ex(char_types,
+ bracket_types,
+ len,
+ &bidi_props->direction,
+ embedding_levels);
+#else
+ ret_level = fribidi_get_par_embedding_levels(char_types,
+ len,
+ &bidi_props->direction,
+ embedding_levels);
+#endif
+ if (!ret_level)
{
goto cleanup;
}
@@ -352,13 +394,19 @@ evas_bidi_paragraph_props_get(const Eina_Unicode *eina_ustr, size_t len,
bidi_props->char_types = char_types;
if (base_ustr) free(base_ustr);
-
+#if FRIBIDI_MAJOR_VERSION >= 1
+ /* Currently, bracket_types is not reused in other places. */
+ if (bracket_types) free(bracket_types);
+#endif
return bidi_props;
/* Cleanup */
cleanup:
if (char_types) free(char_types);
+#if FRIBIDI_MAJOR_VERSION >= 1
+ if (bracket_types) free(bracket_types);
+#endif
if (embedding_levels) free(embedding_levels);
if (base_ustr) free(base_ustr);
if (bidi_props) evas_bidi_paragraph_props_unref(bidi_props); /* Clean up the bidi props */
diff --git a/src/lib/evas/common/language/evas_bidi_utils.h b/src/lib/evas/common/language/evas_bidi_utils.h
index dfccec8166..9b4ea68d64 100644
--- a/src/lib/evas/common/language/evas_bidi_utils.h
+++ b/src/lib/evas/common/language/evas_bidi_utils.h
@@ -56,6 +56,9 @@ _EVAS_BIDI_TYPEDEF(ParType);
_EVAS_BIDI_TYPEDEF(StrIndex);
_EVAS_BIDI_TYPEDEF(Level);
_EVAS_BIDI_TYPEDEF(JoiningType);
+#if FRIBIDI_MAJOR_VERSION >= 1
+_EVAS_BIDI_TYPEDEF(BracketType);
+#endif
typedef struct _Evas_BiDi_Paragraph_Props Evas_BiDi_Paragraph_Props;
typedef struct _Evas_BiDi_Props Evas_BiDi_Props;
diff --git a/src/lib/evas/cserve2/evas_cs2_private.h b/src/lib/evas/cserve2/evas_cs2_private.h
index 9412a7d633..70448321f7 100644
--- a/src/lib/evas/cserve2/evas_cs2_private.h
+++ b/src/lib/evas/cserve2/evas_cs2_private.h
@@ -9,15 +9,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_EVAS_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EVAS_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -28,7 +28,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#define SHARED_BUFFER_PATH_MAX 64
typedef struct _Data_Entry Data_Entry;
diff --git a/src/lib/evas/file/evas_module.c b/src/lib/evas/file/evas_module.c
index b4cabf845b..5e6a4d6a53 100644
--- a/src/lib/evas/file/evas_module.c
+++ b/src/lib/evas/file/evas_module.c
@@ -6,6 +6,7 @@
#include "evas_common_private.h"
#include "evas_private.h"
+#include "../../static_libs/buildsystem/buildsystem.h"
#ifndef EVAS_MODULE_NO_ENGINES
@@ -436,8 +437,7 @@ evas_module_engine_list(void)
{
if (run_in_tree)
{
- snprintf(buf, sizeof(buf), "%s/engines/%s/.libs",
- s, fname);
+ bs_mod_dir_get(buf, sizeof(buf), "evas/engines", fname);
if (!evas_file_path_exists(buf))
buf[0] = '\0';
}
@@ -566,8 +566,10 @@ evas_module_find_type(Evas_Module_Type type, const char *name)
{
if (run_in_tree)
{
- snprintf(buffer, sizeof(buffer), "%s/%s/%s/.libs/%s",
- path, type_str, name, EVAS_MODULE_NAME);
+ char subsystem[PATH_MAX];
+
+ snprintf(subsystem, sizeof(subsystem), "evas/%s", type_str);
+ bs_mod_get(buffer, sizeof(buffer), subsystem, name);
if (!evas_file_path_exists(buffer))
buffer[0] = '\0';
}
@@ -643,7 +645,7 @@ evas_module_unload(Evas_Module *em)
if (!em->definition)
return;
-// for now lets not unload modules - they may still be in use.
+// for now lets not unload modules - they may still be in use.
// em->definition->func.close(em);
// em->loaded = 0;
diff --git a/src/lib/evas/filters/evas_filter.c b/src/lib/evas/filters/evas_filter.c
index 135d20b2bc..fcbad016f2 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -116,7 +116,7 @@ static void
_filter_buffer_backing_free(Evas_Filter_Buffer *fb)
{
if (!fb || !fb->buffer) return;
- efl_del(fb->buffer);
+ efl_unref(fb->buffer);
fb->buffer = NULL;
}
diff --git a/src/lib/evas/gesture/efl_canvas_gesture.c b/src/lib/evas/gesture/efl_canvas_gesture.c
new file mode 100644
index 0000000000..7386a90396
--- /dev/null
+++ b/src/lib/evas/gesture/efl_canvas_gesture.c
@@ -0,0 +1,36 @@
+#include "efl_canvas_gesture_private.h"
+
+#define MY_CLASS EFL_CANVAS_GESTURE_CLASS
+
+EOLIAN static const Efl_Event_Description *
+ _efl_canvas_gesture_type_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Data *pd)
+{
+ return pd->type;
+}
+
+EOLIAN static Efl_Canvas_Gesture_State
+_efl_canvas_gesture_state_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Data *pd)
+{
+ return pd->state;
+}
+
+EOLIAN static void
+_efl_canvas_gesture_state_set(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Data *pd, Efl_Canvas_Gesture_State state)
+{
+ pd->state = state;
+}
+
+EOLIAN static void
+_efl_canvas_gesture_hotspot_set(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Data *pd, Eina_Vector2 hotspot)
+{
+ pd->hotspot = hotspot;
+}
+
+
+EOLIAN static Eina_Vector2
+_efl_canvas_gesture_hotspot_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Data *pd)
+{
+ return pd->hotspot;
+}
+
+#include "efl_canvas_gesture.eo.c" \ No newline at end of file
diff --git a/src/lib/evas/gesture/efl_gesture.eo b/src/lib/evas/gesture/efl_canvas_gesture.eo
index 5fd6de9913..d4abd7c671 100644
--- a/src/lib/evas/gesture/efl_gesture.eo
+++ b/src/lib/evas/gesture/efl_canvas_gesture.eo
@@ -1,15 +1,16 @@
-import efl_gesture_types;
+import efl_canvas_gesture_types;
-abstract Efl.Gesture(Efl.Object)
+abstract Efl.Canvas.Gesture(Efl.Object)
{
[[EFL Gesture abstract class]]
+ eo_prefix: efl_gesture;
methods {
@property type {
[[This property holds the type of the gesture.]]
get {
}
values {
- @cref type: Efl.Event.Description; [[gesture type]]
+ @cref type: Efl.Event_Description; [[gesture type]]
}
}
@property state {
@@ -19,7 +20,7 @@ abstract Efl.Gesture(Efl.Object)
set {
}
values {
- state: Efl.Gesture.State; [[gesture state]]
+ state: Efl.Canvas.Gesture_State; [[gesture state]]
}
}
@property hotspot {
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_long_tap.c b/src/lib/evas/gesture/efl_canvas_gesture_long_tap.c
new file mode 100644
index 0000000000..099893a58e
--- /dev/null
+++ b/src/lib/evas/gesture/efl_canvas_gesture_long_tap.c
@@ -0,0 +1,27 @@
+#include "efl_canvas_gesture_private.h"
+
+#define MY_CLASS EFL_CANVAS_GESTURE_LONG_TAP_CLASS
+
+
+EOLIAN static Efl_Object *
+_efl_canvas_gesture_long_tap_efl_object_constructor(Eo *obj, Efl_Canvas_Gesture_Long_Tap_Data *pd EINA_UNUSED)
+{
+ Efl_Canvas_Gesture_Data *gd;
+
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+ gd = efl_data_scope_get(obj, EFL_CANVAS_GESTURE_CLASS);
+ gd->type = EFL_EVENT_GESTURE_LONG_TAP;
+
+ return obj;
+}
+
+EOLIAN static void
+_efl_canvas_gesture_long_tap_efl_object_destructor(Eo *obj, Efl_Canvas_Gesture_Long_Tap_Data *pd)
+{
+ if (pd->timeout)
+ ecore_timer_del(pd->timeout);
+
+ efl_destructor(efl_super(obj, MY_CLASS));
+}
+
+#include "efl_canvas_gesture_long_tap.eo.c"
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_long_tap.eo b/src/lib/evas/gesture/efl_canvas_gesture_long_tap.eo
new file mode 100644
index 0000000000..5edcbcf8e9
--- /dev/null
+++ b/src/lib/evas/gesture/efl_canvas_gesture_long_tap.eo
@@ -0,0 +1,13 @@
+class Efl.Canvas.Gesture_Long_Tap (Efl.Canvas.Gesture)
+{
+ [[EFL Gesture Long Tap class]]
+ eo_prefix: efl_gesture_long_tap;
+ event_prefix: efl;
+ events {
+ gesture,long_tap: Efl.Canvas.Gesture; [[Event for tap gesture]]
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Object.destructor;
+ }
+}
diff --git a/src/lib/evas/gesture/efl_gesture_manager.c b/src/lib/evas/gesture/efl_canvas_gesture_manager.c
index e8fbf55835..c8ea0d2008 100644
--- a/src/lib/evas/gesture/efl_gesture_manager.c
+++ b/src/lib/evas/gesture/efl_canvas_gesture_manager.c
@@ -1,16 +1,16 @@
-#include "efl_gesture_private.h"
+#include "efl_canvas_gesture_private.h"
-#define MY_CLASS EFL_GESTURE_MANAGER_CLASS
+#define MY_CLASS EFL_CANVAS_GESTURE_MANAGER_CLASS
typedef struct _Object_Gesture
{
Eo *object;
const Efl_Event_Description *type;
- Efl_Gesture *gesture;
- Efl_Gesture_Recognizer *recognizer;
+ Efl_Canvas_Gesture *gesture;
+ Efl_Canvas_Gesture_Recognizer *recognizer;
}Object_Gesture;
-typedef struct _Efl_Gesture_Manager_Data
+typedef struct _Efl_Canvas_Gesture_Manager_Data
{
// keeps track of all the gesture request for a particular target
Eina_Hash *m_gesture_contex; // (*target, *event_desc)
@@ -24,13 +24,13 @@ typedef struct _Efl_Gesture_Manager_Data
Eina_List *m_gestures_to_delete;
Eina_Hash *m_config;
-} Efl_Gesture_Manager_Data;
+} Efl_Canvas_Gesture_Manager_Data;
-static void _cleanup_cached_gestures(Efl_Gesture_Manager_Data *pd,
+static void _cleanup_cached_gestures(Efl_Canvas_Gesture_Manager_Data *pd,
Eo *target, const Efl_Event_Description *type);
-static Efl_Gesture*
-_get_state(Efl_Gesture_Manager_Data *pd, Eo *target,
- Efl_Gesture_Recognizer *recognizer, const Efl_Event_Description *type);
+static Efl_Canvas_Gesture*
+_get_state(Efl_Canvas_Gesture_Manager_Data *pd, Eo *target,
+ Efl_Canvas_Gesture_Recognizer *recognizer, const Efl_Event_Description *type);
static void
_cleanup_object(Eina_List *list)
@@ -47,39 +47,39 @@ _cleanup_object(Eina_List *list)
}
static void
-_hash_free_cb(Eo *obj)
+_hash_unref_cb(Eo *obj)
{
- efl_del(obj);
+ efl_unref(obj);
}
EOLIAN static Efl_Object *
-_efl_gesture_manager_efl_object_constructor(Eo *obj, Efl_Gesture_Manager_Data *pd EINA_UNUSED)
+_efl_canvas_gesture_manager_efl_object_constructor(Eo *obj, Efl_Canvas_Gesture_Manager_Data *pd EINA_UNUSED)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
- pd->m_recognizers = eina_hash_pointer_new(EINA_FREE_CB(_hash_free_cb));
+ pd->m_recognizers = eina_hash_pointer_new(EINA_FREE_CB(_hash_unref_cb));
pd->m_gesture_contex = eina_hash_pointer_new(NULL);
- pd->m_object_events = eina_hash_pointer_new(EINA_FREE_CB(_hash_free_cb));
+ pd->m_object_events = eina_hash_pointer_new(EINA_FREE_CB(_hash_unref_cb));
pd->m_object_gestures = NULL;
pd->m_gestures_to_delete = NULL;
pd->m_config = eina_hash_string_superfast_new(EINA_FREE_CB(eina_value_free));
- efl_gesture_manager_recognizer_register(obj, efl_add(EFL_GESTURE_RECOGNIZER_TAP_CLASS, obj));
- efl_gesture_manager_recognizer_register(obj, efl_add(EFL_GESTURE_RECOGNIZER_LONG_TAP_CLASS, obj));
+ efl_gesture_manager_recognizer_register(obj, efl_add(EFL_CANVAS_GESTURE_RECOGNIZER_TAP_CLASS, obj));
+ efl_gesture_manager_recognizer_register(obj, efl_add(EFL_CANVAS_GESTURE_RECOGNIZER_LONG_TAP_CLASS, obj));
return obj;
}
EOLIAN static Eina_Value *
-_efl_gesture_manager_config_get(Eo *obj EINA_UNUSED, Efl_Gesture_Manager_Data *pd, const char *name)
+_efl_canvas_gesture_manager_config_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Manager_Data *pd, const char *name)
{
return eina_hash_find(pd->m_config, name);
}
EOLIAN static void
-_efl_gesture_manager_config_set(Eo *obj EINA_UNUSED, Efl_Gesture_Manager_Data *pd, const char *name, Eina_Value *value)
+_efl_canvas_gesture_manager_config_set(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Manager_Data *pd, const char *name, Eina_Value *value)
{
Eina_Value *v = eina_value_new(eina_value_type_get(value));
eina_value_copy(value, v);
@@ -87,8 +87,9 @@ _efl_gesture_manager_config_set(Eo *obj EINA_UNUSED, Efl_Gesture_Manager_Data *p
}
EOLIAN static void
-_efl_gesture_manager_efl_object_destructor(Eo *obj, Efl_Gesture_Manager_Data *pd EINA_UNUSED)
+_efl_canvas_gesture_manager_efl_object_destructor(Eo *obj, Efl_Canvas_Gesture_Manager_Data *pd EINA_UNUSED)
{
+ eina_hash_free(pd->m_config);
eina_hash_free(pd->m_recognizers);
eina_hash_free(pd->m_gesture_contex);
eina_hash_free(pd->m_object_events);
@@ -97,11 +98,11 @@ _efl_gesture_manager_efl_object_destructor(Eo *obj, Efl_Gesture_Manager_Data *pd
}
void
-_efl_gesture_manager_callback_add_hook(Eo *obj, Eo *target, const Efl_Event_Description *type)
+_efl_canvas_gesture_manager_callback_add_hook(Eo *obj, Eo *target, const Efl_Event_Description *type)
{
- Efl_Gesture_Manager_Data *pd = efl_data_scope_get(obj, MY_CLASS);
+ Efl_Canvas_Gesture_Manager_Data *pd = efl_data_scope_get(obj, MY_CLASS);
// if there is a recognizer registered for that event then add it to the gesture context
- Efl_Gesture_Recognizer *recognizer = eina_hash_find (pd->m_recognizers, &type);
+ Efl_Canvas_Gesture_Recognizer *recognizer = eina_hash_find (pd->m_recognizers, &type);
if (recognizer)
{
// add it to the gesture context.
@@ -110,11 +111,11 @@ _efl_gesture_manager_callback_add_hook(Eo *obj, Eo *target, const Efl_Event_Desc
}
void
-_efl_gesture_manager_callback_del_hook(Eo *obj, Eo *target, const Efl_Event_Description *type)
+_efl_canvas_gesture_manager_callback_del_hook(Eo *obj, Eo *target, const Efl_Event_Description *type)
{
- Efl_Gesture_Manager_Data *pd = efl_data_scope_get(obj, MY_CLASS);
+ Efl_Canvas_Gesture_Manager_Data *pd = efl_data_scope_get(obj, MY_CLASS);
// if there is a recognizer registered for that event then add it to the gesture context
- Efl_Gesture_Recognizer *recognizer = eina_hash_find (pd->m_recognizers, &type);
+ Efl_Canvas_Gesture_Recognizer *recognizer = eina_hash_find (pd->m_recognizers, &type);
if (recognizer)
{
eina_hash_list_remove(pd->m_gesture_contex, &target, type);
@@ -123,16 +124,16 @@ _efl_gesture_manager_callback_del_hook(Eo *obj, Eo *target, const Efl_Event_Desc
}
void
-_efl_gesture_manager_filter_event(Eo *obj, Eo *target, void *event)
+_efl_canvas_gesture_manager_filter_event(Eo *obj, Eo *target, void *event)
{
Eina_List *l, *gesture_context;
- Efl_Gesture_Manager_Data *pd;
+ Efl_Canvas_Gesture_Manager_Data *pd;
const Efl_Event_Description *gesture_type;
- Efl_Gesture_Recognizer *recognizer;
- Efl_Gesture *gesture;
- Efl_Gesture_Recognizer_Result recog_result;
- Efl_Gesture_Recognizer_Result recog_state;
- Efl_Gesture_Touch *touch_event;
+ Efl_Canvas_Gesture_Recognizer *recognizer;
+ Efl_Canvas_Gesture *gesture;
+ Efl_Canvas_Gesture_Recognizer_Result recog_result;
+ Efl_Canvas_Gesture_Recognizer_Result recog_state;
+ Efl_Canvas_Gesture_Touch *touch_event;
Efl_Input_Pointer_Data *pointer_data = efl_data_scope_get(event, EFL_INPUT_POINTER_CLASS);
pd = efl_data_scope_get(obj, MY_CLASS);
@@ -143,7 +144,7 @@ _efl_gesture_manager_filter_event(Eo *obj, Eo *target, void *event)
touch_event = eina_hash_find(pd->m_object_events, &target);
if (!touch_event)
{
- touch_event = efl_add(EFL_GESTURE_TOUCH_CLASS, NULL);
+ touch_event = efl_add_ref(EFL_CANVAS_GESTURE_TOUCH_CLASS, NULL);
eina_hash_add(pd->m_object_events, &target, touch_event);
}
@@ -206,11 +207,11 @@ _efl_gesture_manager_filter_event(Eo *obj, Eo *target, void *event)
}
EOLIAN static const Efl_Event_Description *
-_efl_gesture_manager_recognizer_register(Eo *obj EINA_UNUSED, Efl_Gesture_Manager_Data *pd,
- Efl_Gesture_Recognizer *recognizer)
+_efl_canvas_gesture_manager_recognizer_register(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Manager_Data *pd,
+ Efl_Canvas_Gesture_Recognizer *recognizer)
{
- Efl_Gesture_Recognizer_Data *rpd;
- Efl_Gesture *dummy = efl_gesture_recognizer_create(recognizer, 0);
+ Efl_Canvas_Gesture_Recognizer_Data *rpd;
+ Efl_Canvas_Gesture *dummy = efl_gesture_recognizer_create(recognizer, 0);
if (!dummy)
return NULL;
@@ -218,9 +219,9 @@ _efl_gesture_manager_recognizer_register(Eo *obj EINA_UNUSED, Efl_Gesture_Manage
const Efl_Event_Description *type = efl_gesture_type_get(dummy);
// Add the recognizer to the m_recognizers
- eina_hash_add(pd->m_recognizers, &type, recognizer);
+ eina_hash_add(pd->m_recognizers, &type, efl_ref(recognizer));
// update the manager
- rpd = efl_data_scope_get(recognizer, EFL_GESTURE_RECOGNIZER_CLASS);
+ rpd = efl_data_scope_get(recognizer, EFL_CANVAS_GESTURE_RECOGNIZER_CLASS);
rpd->manager = obj;
efl_del(dummy);
@@ -229,13 +230,13 @@ _efl_gesture_manager_recognizer_register(Eo *obj EINA_UNUSED, Efl_Gesture_Manage
}
EOLIAN static void
-_efl_gesture_manager_recognizer_unregister(Eo *obj EINA_UNUSED, Efl_Gesture_Manager_Data *pd,
- Efl_Gesture_Recognizer *recognizer)
+_efl_canvas_gesture_manager_recognizer_unregister(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Manager_Data *pd,
+ Efl_Canvas_Gesture_Recognizer *recognizer)
{
Eina_List *l, *l_next;
Object_Gesture *object_gesture;
const Efl_Event_Description *type;
- Efl_Gesture *dummy;
+ Efl_Canvas_Gesture *dummy;
if (!recognizer) return;
@@ -265,7 +266,7 @@ _efl_gesture_manager_recognizer_unregister(Eo *obj EINA_UNUSED, Efl_Gesture_Mana
}
// EOLIAN static void
-// _efl_gesture_manager_ungrab_all(Eo *obj EINA_UNUSED, Efl_Gesture_Manager_Data *pd,
+// _efl_canvas_gesture_manager_ungrab_all(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Manager_Data *pd,
// Eo *target)
// {
// const Efl_Event_Description *type;
@@ -283,13 +284,13 @@ _efl_gesture_manager_recognizer_unregister(Eo *obj EINA_UNUSED, Efl_Gesture_Mana
// }
// get or create a gesture object that will represent the state for a given object, used by the recognizer
-Efl_Gesture*
-_get_state(Efl_Gesture_Manager_Data *pd,
- Eo *target, Efl_Gesture_Recognizer *recognizer, const Efl_Event_Description *type)
+Efl_Canvas_Gesture*
+_get_state(Efl_Canvas_Gesture_Manager_Data *pd,
+ Eo *target, Efl_Canvas_Gesture_Recognizer *recognizer, const Efl_Event_Description *type)
{
Eina_List *l;
Object_Gesture *object_gesture;
- Efl_Gesture *gesture;
+ Efl_Canvas_Gesture *gesture;
// if the widget is being deleted we should be careful not to
// create a new state.
@@ -326,7 +327,7 @@ _get_state(Efl_Gesture_Manager_Data *pd,
}
static void
-_cleanup_cached_gestures(Efl_Gesture_Manager_Data *pd,
+_cleanup_cached_gestures(Efl_Canvas_Gesture_Manager_Data *pd,
Eo *target, const Efl_Event_Description *type)
{
Eina_List *l, *l_next;
@@ -344,4 +345,4 @@ _cleanup_cached_gestures(Efl_Gesture_Manager_Data *pd,
}
-#include "efl_gesture_manager.eo.c"
+#include "efl_canvas_gesture_manager.eo.c"
diff --git a/src/lib/evas/gesture/efl_gesture_manager.eo b/src/lib/evas/gesture/efl_canvas_gesture_manager.eo
index 52d48ec0af..5084083a38 100644
--- a/src/lib/evas/gesture/efl_gesture_manager.eo
+++ b/src/lib/evas/gesture/efl_canvas_gesture_manager.eo
@@ -1,20 +1,19 @@
-import efl_gesture_types;
-
-class Efl.Gesture.Manager (Efl.Object)
+class Efl.Canvas.Gesture_Manager (Efl.Object)
{
[[EFL Gesture Manager class]]
+ eo_prefix: efl_gesture_manager;
methods {
recognizer_register {
- [[This function is called to register a new Efl.Gesture.Recognizer]]
+ [[This function is called to register a new Efl.Canvas.Gesture_Recognizer]]
params {
- @in recognizer: Efl.Gesture.Recognizer; [[The gesture recognizer object]]
+ @in recognizer: Efl.Canvas.Gesture_Recognizer; [[The gesture recognizer object]]
}
- return: ptr(const(Efl.Event.Description)); [[Returns the Efl.Event.Description type the recognizer supports]]
+ return: ptr(const(Efl.Event_Description)); [[Returns the Efl.Event_Description type the recognizer supports]]
}
recognizer_unregister {
- [[This function is called to unregister a Efl.Gesture.Recognizer]]
+ [[This function is called to unregister a Efl.Canvas.Gesture_Recognizer]]
params {
- @in recognizer: Efl.Gesture.Recognizer; [[The gesture recognizer object]]
+ @in recognizer: Efl.Canvas.Gesture_Recognizer; [[The gesture recognizer object]]
}
}
@property config {
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_private.h b/src/lib/evas/gesture/efl_canvas_gesture_private.h
new file mode 100644
index 0000000000..c09fd26779
--- /dev/null
+++ b/src/lib/evas/gesture/efl_canvas_gesture_private.h
@@ -0,0 +1,42 @@
+#ifndef EFL_GESTURE_PRIVATE_H_
+#define EFL_GESTURE_PRIVATE_H_
+
+#include "evas_common_private.h"
+#include "evas_private.h"
+#define EFL_INTERNAL_UNSTABLE
+#include "interfaces/efl_common_internal.h"
+
+#include <Ecore.h>
+
+//private gesture classes
+#include "efl_canvas_gesture_recognizer_tap.eo.h"
+#include "efl_canvas_gesture_recognizer_long_tap.eo.h"
+
+typedef struct _Efl_Canvas_Gesture_Recognizer_Data Efl_Canvas_Gesture_Recognizer_Data;
+typedef struct _Efl_Canvas_Gesture_Data Efl_Canvas_Gesture_Data;
+typedef struct _Efl_Canvas_Gesture_Tap_Data Efl_Canvas_Gesture_Tap_Data;
+typedef struct _Efl_Canvas_Gesture_Long_Tap_Data Efl_Canvas_Gesture_Long_Tap_Data;
+
+struct _Efl_Canvas_Gesture_Recognizer_Data
+{
+ Eo *manager; // keeps a reference of the manager
+};
+
+struct _Efl_Canvas_Gesture_Data
+{
+ const Efl_Event_Description *type;
+ Efl_Canvas_Gesture_State state;
+ Eina_Vector2 hotspot;
+};
+
+struct _Efl_Canvas_Gesture_Tap_Data
+{
+};
+
+struct _Efl_Canvas_Gesture_Long_Tap_Data
+{
+ Ecore_Timer *timeout;
+ Eina_Bool is_timeout;
+};
+
+#endif
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer.c b/src/lib/evas/gesture/efl_canvas_gesture_recognizer.c
new file mode 100644
index 0000000000..eac5f1cecf
--- /dev/null
+++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer.c
@@ -0,0 +1,18 @@
+#include "efl_canvas_gesture_private.h"
+
+#define MY_CLASS EFL_CANVAS_GESTURE_RECOGNIZER_CLASS
+
+EOLIAN static Eina_Value *
+_efl_canvas_gesture_recognizer_config_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Recognizer_Data *pd, const char *name)
+{
+ return efl_gesture_manager_config_get(pd->manager, name);
+}
+
+EOLIAN static void
+_efl_canvas_gesture_recognizer_reset(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Recognizer_Data *pd EINA_UNUSED,
+ Efl_Canvas_Gesture *gesture EINA_UNUSED)
+{
+
+}
+
+#include "efl_canvas_gesture_recognizer.eo.c"
diff --git a/src/lib/evas/gesture/efl_gesture_recognizer.eo b/src/lib/evas/gesture/efl_canvas_gesture_recognizer.eo
index 617638147e..d2a918e118 100644
--- a/src/lib/evas/gesture/efl_gesture_recognizer.eo
+++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer.eo
@@ -1,15 +1,16 @@
-import efl_gesture_types;
+import efl_canvas_gesture_types;
-abstract Efl.Gesture.Recognizer (Efl.Object)
+abstract Efl.Canvas.Gesture_Recognizer (Efl.Object)
{
[[EFL Gesture Recognizer abstract class]]
+ eo_prefix: efl_gesture_recognizer;
methods {
create @pure_virtual {
- [[This function is called to create a new Efl.Gesture object for the given target]]
+ [[This function is called to create a new Efl.Canvas.Gesture object for the given target]]
params {
@in target: Efl.Object; [[The target widget]]
}
- return: Efl.Gesture; [[Returns the Efl.Gesture event object]]
+ return: Efl.Canvas.Gesture; [[Returns the Efl.Canvas.Gesture event object]]
}
recognize @pure_virtual {
[[Handles the given event for the watched object.
@@ -18,17 +19,17 @@ abstract Efl.Gesture.Recognizer (Efl.Object)
suitable result for the current recognition step.
]]
params {
- @in gesture: Efl.Gesture; [[The gesture object]]
+ @in gesture: Efl.Canvas.Gesture; [[The gesture object]]
@in watched: Efl.Object; [[The watched object]]
- @in event: Efl.Gesture.Touch; [[The pointer event]]
+ @in event: Efl.Canvas.Gesture_Touch; [[The pointer event]]
}
- return: Efl.Gesture.Recognizer_Result; [[Returns the Efl.Gesture event object]]
+ return: Efl.Canvas.Gesture_Recognizer_Result; [[Returns the Efl.Canvas.Gesture event object]]
}
/* FIXME: This function is not used? */
reset {
[[This function is called by the framework to reset a given gesture.]]
params {
- @in gesture: Efl.Gesture; [[The gesture object]]
+ @in gesture: Efl.Canvas.Gesture; [[The gesture object]]
}
}
@property config {
diff --git a/src/lib/evas/gesture/efl_gesture_recognizer_long_tap.c b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_long_tap.c
index 501538b863..9f5463cf49 100644
--- a/src/lib/evas/gesture/efl_gesture_recognizer_long_tap.c
+++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_long_tap.c
@@ -1,20 +1,20 @@
-#include "efl_gesture_private.h"
+#include "efl_canvas_gesture_private.h"
-#define MY_CLASS EFL_GESTURE_RECOGNIZER_LONG_TAP_CLASS
+#define MY_CLASS EFL_CANVAS_GESTURE_RECOGNIZER_LONG_TAP_CLASS
#define LONG_TAP_TIME_OUT 0.2
-EOLIAN static Efl_Gesture *
-_efl_gesture_recognizer_long_tap_efl_gesture_recognizer_create(Eo *obj, void *pd EINA_UNUSED,
+EOLIAN static Efl_Canvas_Gesture *
+_efl_canvas_gesture_recognizer_long_tap_efl_canvas_gesture_recognizer_create(Eo *obj, void *pd EINA_UNUSED,
Efl_Object *target EINA_UNUSED)
{
- return efl_add(EFL_GESTURE_LONG_TAP_CLASS, obj);
+ return efl_add(EFL_CANVAS_GESTURE_LONG_TAP_CLASS, obj);
}
static Eina_Bool
_long_tap_timeout_cb(void *data)
{
- Efl_Gesture_Long_Tap_Data *ltp = data;
+ Efl_Canvas_Gesture_Long_Tap_Data *ltp = data;
/* FIXME: Needs to propagate this event back to evas! */
ltp->is_timeout = EINA_TRUE;
@@ -22,16 +22,16 @@ _long_tap_timeout_cb(void *data)
return ECORE_CALLBACK_RENEW;
}
-EOLIAN static Efl_Gesture_Recognizer_Result
-_efl_gesture_recognizer_long_tap_efl_gesture_recognizer_recognize(Eo *obj EINA_UNUSED,
+EOLIAN static Efl_Canvas_Gesture_Recognizer_Result
+_efl_canvas_gesture_recognizer_long_tap_efl_canvas_gesture_recognizer_recognize(Eo *obj EINA_UNUSED,
void *pd EINA_UNUSED,
- Efl_Gesture *gesture, Efl_Object *watched EINA_UNUSED,
- Efl_Gesture_Touch *event)
+ Efl_Canvas_Gesture *gesture, Efl_Object *watched EINA_UNUSED,
+ Efl_Canvas_Gesture_Touch *event)
{
double length; // Manhattan distance
Eina_Vector2 pos, dist;
- Efl_Gesture_Recognizer_Result result = EFL_GESTURE_CANCEL;
- Efl_Gesture_Long_Tap_Data *ltp = efl_data_scope_get(gesture, EFL_GESTURE_LONG_TAP_CLASS);
+ Efl_Canvas_Gesture_Recognizer_Result result = EFL_GESTURE_CANCEL;
+ Efl_Canvas_Gesture_Long_Tap_Data *ltp = efl_data_scope_get(gesture, EFL_CANVAS_GESTURE_LONG_TAP_CLASS);
switch (efl_gesture_touch_state_get(event))
{
@@ -99,12 +99,12 @@ _efl_gesture_recognizer_long_tap_efl_gesture_recognizer_recognize(Eo *obj EINA_U
}
EOLIAN static void
-_efl_gesture_recognizer_long_tap_efl_gesture_recognizer_reset(Eo *obj,
+_efl_canvas_gesture_recognizer_long_tap_efl_canvas_gesture_recognizer_reset(Eo *obj,
void *pd EINA_UNUSED,
- Efl_Gesture *gesture)
+ Efl_Canvas_Gesture *gesture)
{
- Efl_Gesture_Long_Tap_Data *ltp;
- ltp = efl_data_scope_get(gesture, EFL_GESTURE_LONG_TAP_CLASS);
+ Efl_Canvas_Gesture_Long_Tap_Data *ltp;
+ ltp = efl_data_scope_get(gesture, EFL_CANVAS_GESTURE_LONG_TAP_CLASS);
if (ltp->timeout)
ecore_timer_del(ltp->timeout);
ltp->timeout = NULL;
@@ -112,4 +112,4 @@ _efl_gesture_recognizer_long_tap_efl_gesture_recognizer_reset(Eo *obj,
efl_gesture_recognizer_reset(efl_super(obj, MY_CLASS), gesture);
}
-#include "efl_gesture_recognizer_long_tap.eo.c"
+#include "efl_canvas_gesture_recognizer_long_tap.eo.c"
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_long_tap.eo b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_long_tap.eo
new file mode 100644
index 0000000000..6991b8fda2
--- /dev/null
+++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_long_tap.eo
@@ -0,0 +1,11 @@
+class Efl.Canvas.Gesture_Recognizer_Long_Tap (Efl.Canvas.Gesture_Recognizer)
+{
+ [[EFL Gesture Recognizer Long Tap class]]
+ data: null;
+ eo_prefix: efl_gesture_recognizer_long_tap;
+ implements {
+ Efl.Canvas.Gesture_Recognizer.create;
+ Efl.Canvas.Gesture_Recognizer.recognize;
+ Efl.Canvas.Gesture_Recognizer.reset;
+ }
+}
diff --git a/src/lib/evas/gesture/efl_gesture_recognizer_tap.c b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_tap.c
index 7f8c2a893b..2e4a5a6b76 100644
--- a/src/lib/evas/gesture/efl_gesture_recognizer_tap.c
+++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_tap.c
@@ -1,23 +1,23 @@
-#include "efl_gesture_private.h"
+#include "efl_canvas_gesture_private.h"
-#define MY_CLASS EFL_GESTURE_RECOGNIZER_TAP_CLASS
+#define MY_CLASS EFL_CANVAS_GESTURE_RECOGNIZER_TAP_CLASS
-EOLIAN static Efl_Gesture *
-_efl_gesture_recognizer_tap_efl_gesture_recognizer_create(Eo *obj, void *pd EINA_UNUSED,
+EOLIAN static Efl_Canvas_Gesture *
+_efl_canvas_gesture_recognizer_tap_efl_canvas_gesture_recognizer_create(Eo *obj, void *pd EINA_UNUSED,
Efl_Object *target EINA_UNUSED)
{
- return efl_add(EFL_GESTURE_TAP_CLASS, obj);
+ return efl_add(EFL_CANVAS_GESTURE_TAP_CLASS, obj);
}
-EOLIAN static Efl_Gesture_Recognizer_Result
-_efl_gesture_recognizer_tap_efl_gesture_recognizer_recognize(Eo *obj EINA_UNUSED,
+EOLIAN static Efl_Canvas_Gesture_Recognizer_Result
+_efl_canvas_gesture_recognizer_tap_efl_canvas_gesture_recognizer_recognize(Eo *obj EINA_UNUSED,
void *pd EINA_UNUSED,
- Efl_Gesture *gesture, Efl_Object *watched EINA_UNUSED,
- Efl_Gesture_Touch *event EINA_UNUSED)
+ Efl_Canvas_Gesture *gesture, Efl_Object *watched EINA_UNUSED,
+ Efl_Canvas_Gesture_Touch *event EINA_UNUSED)
{
double length;
Eina_Vector2 pos, dist;
- Efl_Gesture_Recognizer_Result result = EFL_GESTURE_CANCEL;
+ Efl_Canvas_Gesture_Recognizer_Result result = EFL_GESTURE_CANCEL;
switch (efl_gesture_touch_state_get(event))
{
@@ -52,4 +52,4 @@ _efl_gesture_recognizer_tap_efl_gesture_recognizer_recognize(Eo *obj EINA_UNUSED
return result;
}
-#include "efl_gesture_recognizer_tap.eo.c"
+#include "efl_canvas_gesture_recognizer_tap.eo.c"
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_tap.eo b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_tap.eo
new file mode 100644
index 0000000000..7926bb62a9
--- /dev/null
+++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_tap.eo
@@ -0,0 +1,10 @@
+class Efl.Canvas.Gesture_Recognizer_Tap (Efl.Canvas.Gesture_Recognizer)
+{
+ [[EFL Gesture Recognizer Tap class]]
+ data: null;
+ eo_prefix: efl_gesture_recognizer_tap;
+ implements {
+ Efl.Canvas.Gesture_Recognizer.create;
+ Efl.Canvas.Gesture_Recognizer.recognize;
+ }
+}
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_tap.c b/src/lib/evas/gesture/efl_canvas_gesture_tap.c
new file mode 100644
index 0000000000..aca24a9dbd
--- /dev/null
+++ b/src/lib/evas/gesture/efl_canvas_gesture_tap.c
@@ -0,0 +1,19 @@
+#include "efl_canvas_gesture_private.h"
+
+#define MY_CLASS EFL_CANVAS_GESTURE_TAP_CLASS
+
+
+EOLIAN static Efl_Object *
+_efl_canvas_gesture_tap_efl_object_constructor(Eo *obj, Efl_Canvas_Gesture_Tap_Data *pd EINA_UNUSED)
+{
+ Efl_Canvas_Gesture_Data *gd;
+
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+
+ gd = efl_data_scope_get(obj, EFL_CANVAS_GESTURE_CLASS);
+ gd->type = EFL_EVENT_GESTURE_TAP;
+
+ return obj;
+}
+
+#include "efl_canvas_gesture_tap.eo.c"
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_tap.eo b/src/lib/evas/gesture/efl_canvas_gesture_tap.eo
new file mode 100644
index 0000000000..60bcdcacfe
--- /dev/null
+++ b/src/lib/evas/gesture/efl_canvas_gesture_tap.eo
@@ -0,0 +1,12 @@
+class Efl.Canvas.Gesture_Tap(Efl.Canvas.Gesture)
+{
+ [[EFL Gesture Tap class]]
+ eo_prefix: efl_gesture_tap;
+ event_prefix: efl;
+ events {
+ gesture,tap: Efl.Canvas.Gesture; [[Event for tap gesture]]
+ }
+ implements {
+ Efl.Object.constructor;
+ }
+}
diff --git a/src/lib/evas/gesture/efl_gesture_touch.c b/src/lib/evas/gesture/efl_canvas_gesture_touch.c
index 0484d43f30..9f997f59e6 100644
--- a/src/lib/evas/gesture/efl_gesture_touch.c
+++ b/src/lib/evas/gesture/efl_canvas_gesture_touch.c
@@ -1,6 +1,6 @@
-#include "efl_gesture_private.h"
+#include "efl_canvas_gesture_private.h"
-#define MY_CLASS EFL_GESTURE_TOUCH_CLASS
+#define MY_CLASS EFL_CANVAS_GESTURE_TOUCH_CLASS
typedef struct _Pointer_Data
{
@@ -12,14 +12,14 @@ typedef struct _Pointer_Data
Efl_Pointer_Action action;
} Pointer_Data;
-typedef struct _Efl_Gesture_Touch_Data
+typedef struct _Efl_Canvas_Gesture_Touch_Data
{
- Efl_Gesture_Touch_State state;
+ Efl_Canvas_Gesture_Touch_State state;
Eina_Hash *touch_points;
int touch_down;
Eina_Bool multi_touch;
Eo *target;
-} Efl_Gesture_Touch_Data;
+} Efl_Canvas_Gesture_Touch_Data;
// This event object accumulates all the touch points
@@ -32,7 +32,7 @@ static void _hash_free_cb(Pointer_Data *point)
}
static inline void
-_touch_points_reset(Efl_Gesture_Touch_Data *pd)
+_touch_points_reset(Efl_Canvas_Gesture_Touch_Data *pd)
{
eina_hash_free(pd->touch_points);
pd->touch_points = eina_hash_int32_new(EINA_FREE_CB(_hash_free_cb));
@@ -41,7 +41,7 @@ _touch_points_reset(Efl_Gesture_Touch_Data *pd)
}
EOLIAN static Efl_Object *
-_efl_gesture_touch_efl_object_constructor(Eo *obj, Efl_Gesture_Touch_Data *pd)
+_efl_canvas_gesture_touch_efl_object_constructor(Eo *obj, Efl_Canvas_Gesture_Touch_Data *pd)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
_touch_points_reset(pd);
@@ -49,20 +49,20 @@ _efl_gesture_touch_efl_object_constructor(Eo *obj, Efl_Gesture_Touch_Data *pd)
}
EOLIAN static void
-_efl_gesture_touch_efl_object_destructor(Eo *obj, Efl_Gesture_Touch_Data *pd)
+_efl_canvas_gesture_touch_efl_object_destructor(Eo *obj, Efl_Canvas_Gesture_Touch_Data *pd)
{
eina_hash_free(pd->touch_points);
efl_destructor(efl_super(obj, MY_CLASS));
}
-EOLIAN static Efl_Gesture_Touch_State
-_efl_gesture_touch_state_get(Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *pd)
+EOLIAN static Efl_Canvas_Gesture_Touch_State
+_efl_canvas_gesture_touch_state_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Touch_Data *pd)
{
return pd->state;
}
EOLIAN static void
-_efl_gesture_touch_point_record(Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *pd,
+_efl_canvas_gesture_touch_point_record(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Touch_Data *pd,
int id, Eina_Vector2 pos, double timestamp, Efl_Pointer_Action action)
{
Pointer_Data *point = eina_hash_find(pd->touch_points, &id);
@@ -122,13 +122,13 @@ bad_fingers:
}
EOLIAN static Eina_Bool
-_efl_gesture_touch_multi_touch_get(Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *pd)
+_efl_canvas_gesture_touch_multi_touch_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Touch_Data *pd)
{
return pd->multi_touch;
}
EOLIAN static Eina_Vector2
-_efl_gesture_touch_start_point_get(Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *pd)
+_efl_canvas_gesture_touch_start_point_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Touch_Data *pd)
{
int tool = 0;
Pointer_Data *point = eina_hash_find(pd->touch_points, &tool);
@@ -141,7 +141,7 @@ _efl_gesture_touch_start_point_get(Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *
}
EOLIAN static Eina_Vector2
-_efl_gesture_touch_delta(const Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *pd, int tool)
+_efl_canvas_gesture_touch_delta(const Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Touch_Data *pd, int tool)
{
Pointer_Data *point = eina_hash_find(pd->touch_points, &tool);
Eina_Vector2 vec = { 0, 0 };
@@ -154,7 +154,7 @@ _efl_gesture_touch_delta(const Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *pd,
}
EOLIAN static Eina_Vector2
-_efl_gesture_touch_distance(const Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *pd, int tool)
+_efl_canvas_gesture_touch_distance(const Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Touch_Data *pd, int tool)
{
Pointer_Data *point = eina_hash_find(pd->touch_points, &tool);
Eina_Vector2 vec = { 0, 0 };
@@ -166,4 +166,4 @@ _efl_gesture_touch_distance(const Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *p
return vec;
}
-#include "efl_gesture_touch.eo.c"
+#include "efl_canvas_gesture_touch.eo.c"
diff --git a/src/lib/evas/gesture/efl_gesture_touch.eo b/src/lib/evas/gesture/efl_canvas_gesture_touch.eo
index b85d14599c..d18001759b 100644
--- a/src/lib/evas/gesture/efl_gesture_touch.eo
+++ b/src/lib/evas/gesture/efl_canvas_gesture_touch.eo
@@ -1,11 +1,12 @@
-import efl_gesture_types;
+import efl_canvas_gesture_types;
import efl_input_types;
/* FIXME: This class lacks a lot of useful helpers. */
-class Efl.Gesture.Touch(Efl.Object)
+class Efl.Canvas.Gesture_Touch(Efl.Object)
{
[[EFL Gesture Touch class]]
+ eo_prefix: efl_gesture_touch;
methods {
point_record {
[[Touch point record method]]
@@ -47,7 +48,7 @@ class Efl.Gesture.Touch(Efl.Object)
@property state {
[[This property holds the state of the touch event.]]
get {
- return : Efl.Gesture.Touch.State; [[touch event state]]
+ return : Efl.Canvas.Gesture_Touch_State; [[touch event state]]
}
}
/* FIXME: finger_list was broken by design - TODO */
diff --git a/src/lib/evas/gesture/efl_gesture_types.eot b/src/lib/evas/gesture/efl_canvas_gesture_types.eot
index d78d12ba21..4dbf88c727 100644
--- a/src/lib/evas/gesture/efl_gesture_types.eot
+++ b/src/lib/evas/gesture/efl_canvas_gesture_types.eot
@@ -1,4 +1,4 @@
-enum Efl.Gesture.Touch.State
+enum Efl.Canvas.Gesture_Touch_State
{
[[ This enum type describes the state of a touch event. ]]
legacy: efl_gesture_touch;
@@ -8,7 +8,7 @@ enum Efl.Gesture.Touch.State
end, [[Last fingure touch up]]
}
-enum Efl.Gesture.State
+enum Efl.Canvas.Gesture_State
{
[[ This enum type describes the state of a gesture. ]]
legacy: efl_gesture;
@@ -19,7 +19,7 @@ enum Efl.Gesture.State
canceled, [[A gesture was canceled.]]
}
-enum Efl.Gesture.Recognizer_Result
+enum Efl.Canvas.Gesture_Recognizer_Result
{
[[ This enum type describes the state of a gesture recognizer. ]]
legacy: efl_gesture;
diff --git a/src/lib/evas/gesture/efl_gesture.c b/src/lib/evas/gesture/efl_gesture.c
deleted file mode 100644
index 1ea99936e3..0000000000
--- a/src/lib/evas/gesture/efl_gesture.c
+++ /dev/null
@@ -1,36 +0,0 @@
-#include "efl_gesture_private.h"
-
-#define MY_CLASS EFL_GESTURE_CLASS
-
-EOLIAN static const Efl_Event_Description *
- _efl_gesture_type_get(Eo *obj EINA_UNUSED, Efl_Gesture_Data *pd)
-{
- return pd->type;
-}
-
-EOLIAN static Efl_Gesture_State
-_efl_gesture_state_get(Eo *obj EINA_UNUSED, Efl_Gesture_Data *pd)
-{
- return pd->state;
-}
-
-EOLIAN static void
-_efl_gesture_state_set(Eo *obj EINA_UNUSED, Efl_Gesture_Data *pd, Efl_Gesture_State state)
-{
- pd->state = state;
-}
-
-EOLIAN static void
-_efl_gesture_hotspot_set(Eo *obj EINA_UNUSED, Efl_Gesture_Data *pd, Eina_Vector2 hotspot)
-{
- pd->hotspot = hotspot;
-}
-
-
-EOLIAN static Eina_Vector2
-_efl_gesture_hotspot_get(Eo *obj EINA_UNUSED, Efl_Gesture_Data *pd)
-{
- return pd->hotspot;
-}
-
-#include "efl_gesture.eo.c" \ No newline at end of file
diff --git a/src/lib/evas/gesture/efl_gesture_long_tap.c b/src/lib/evas/gesture/efl_gesture_long_tap.c
deleted file mode 100644
index 9c1bd45a9c..0000000000
--- a/src/lib/evas/gesture/efl_gesture_long_tap.c
+++ /dev/null
@@ -1,27 +0,0 @@
-#include "efl_gesture_private.h"
-
-#define MY_CLASS EFL_GESTURE_LONG_TAP_CLASS
-
-
-EOLIAN static Efl_Object *
-_efl_gesture_long_tap_efl_object_constructor(Eo *obj, Efl_Gesture_Long_Tap_Data *pd EINA_UNUSED)
-{
- Efl_Gesture_Data *gd;
-
- obj = efl_constructor(efl_super(obj, MY_CLASS));
- gd = efl_data_scope_get(obj, EFL_GESTURE_CLASS);
- gd->type = EFL_EVENT_GESTURE_LONG_TAP;
-
- return obj;
-}
-
-EOLIAN static void
-_efl_gesture_long_tap_efl_object_destructor(Eo *obj, Efl_Gesture_Long_Tap_Data *pd)
-{
- if (pd->timeout)
- ecore_timer_del(pd->timeout);
-
- efl_destructor(efl_super(obj, MY_CLASS));
-}
-
-#include "efl_gesture_long_tap.eo.c"
diff --git a/src/lib/evas/gesture/efl_gesture_long_tap.eo b/src/lib/evas/gesture/efl_gesture_long_tap.eo
deleted file mode 100644
index 4bb0869bcc..0000000000
--- a/src/lib/evas/gesture/efl_gesture_long_tap.eo
+++ /dev/null
@@ -1,14 +0,0 @@
-import efl_gesture_types;
-
-class Efl.Gesture.Long_Tap (Efl.Gesture)
-{
- [[EFL Gesture Long Tap class]]
- event_prefix: efl;
- events {
- gesture,long_tap; [[Event for tap gesture]]
- }
- implements {
- Efl.Object.constructor;
- Efl.Object.destructor;
- }
-}
diff --git a/src/lib/evas/gesture/efl_gesture_private.h b/src/lib/evas/gesture/efl_gesture_private.h
deleted file mode 100644
index 6a7d4528e8..0000000000
--- a/src/lib/evas/gesture/efl_gesture_private.h
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef EFL_GESTURE_PRIVATE_H_
-#define EFL_GESTURE_PRIVATE_H_
-
-#include "evas_common_private.h"
-#include "evas_private.h"
-#define EFL_INTERNAL_UNSTABLE
-#include "interfaces/efl_common_internal.h"
-
-#include <Ecore.h>
-
-//private gesture classes
-#include "efl_gesture_recognizer_tap.eo.h"
-#include "efl_gesture_recognizer_long_tap.eo.h"
-
-typedef struct _Efl_Gesture_Recognizer_Data Efl_Gesture_Recognizer_Data;
-typedef struct _Efl_Gesture_Data Efl_Gesture_Data;
-typedef struct _Efl_Gesture_Tap_Data Efl_Gesture_Tap_Data;
-typedef struct _Efl_Gesture_Long_Tap_Data Efl_Gesture_Long_Tap_Data;
-
-struct _Efl_Gesture_Recognizer_Data
-{
- Eo *manager; // keeps a reference of the manager
-};
-
-struct _Efl_Gesture_Data
-{
- const Efl_Event_Description *type;
- Efl_Gesture_State state;
- Eina_Vector2 hotspot;
-};
-
-struct _Efl_Gesture_Tap_Data
-{
-};
-
-struct _Efl_Gesture_Long_Tap_Data
-{
- Ecore_Timer *timeout;
- Eina_Bool is_timeout;
-};
-
-#endif
diff --git a/src/lib/evas/gesture/efl_gesture_recognizer.c b/src/lib/evas/gesture/efl_gesture_recognizer.c
deleted file mode 100644
index 684bfe0d93..0000000000
--- a/src/lib/evas/gesture/efl_gesture_recognizer.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include "efl_gesture_private.h"
-
-#define MY_CLASS EFL_GESTURE_RECOGNIZER_CLASS
-
-EOLIAN static Eina_Value *
-_efl_gesture_recognizer_config_get(Eo *obj EINA_UNUSED, Efl_Gesture_Recognizer_Data *pd, const char *name)
-{
- return efl_gesture_manager_config_get(pd->manager, name);
-}
-
-EOLIAN static void
-_efl_gesture_recognizer_reset(Eo *obj EINA_UNUSED, Efl_Gesture_Recognizer_Data *pd EINA_UNUSED,
- Efl_Gesture *gesture EINA_UNUSED)
-{
-
-}
-
-#include "efl_gesture_recognizer.eo.c"
diff --git a/src/lib/evas/gesture/efl_gesture_recognizer_long_tap.eo b/src/lib/evas/gesture/efl_gesture_recognizer_long_tap.eo
deleted file mode 100644
index 94b5b10913..0000000000
--- a/src/lib/evas/gesture/efl_gesture_recognizer_long_tap.eo
+++ /dev/null
@@ -1,10 +0,0 @@
-class Efl.Gesture.Recognizer_Long_Tap (Efl.Gesture.Recognizer)
-{
- [[EFL Gesture Recognizer Long Tap class]]
- data: null;
- implements {
- Efl.Gesture.Recognizer.create;
- Efl.Gesture.Recognizer.recognize;
- Efl.Gesture.Recognizer.reset;
- }
-}
diff --git a/src/lib/evas/gesture/efl_gesture_recognizer_tap.eo b/src/lib/evas/gesture/efl_gesture_recognizer_tap.eo
deleted file mode 100644
index bf2ceef326..0000000000
--- a/src/lib/evas/gesture/efl_gesture_recognizer_tap.eo
+++ /dev/null
@@ -1,9 +0,0 @@
-class Efl.Gesture.Recognizer_Tap (Efl.Gesture.Recognizer)
-{
- [[EFL Gesture Recognizer Tap class]]
- data: null;
- implements {
- Efl.Gesture.Recognizer.create;
- Efl.Gesture.Recognizer.recognize;
- }
-}
diff --git a/src/lib/evas/gesture/efl_gesture_tap.c b/src/lib/evas/gesture/efl_gesture_tap.c
deleted file mode 100644
index 6b1a239310..0000000000
--- a/src/lib/evas/gesture/efl_gesture_tap.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#include "efl_gesture_private.h"
-
-#define MY_CLASS EFL_GESTURE_TAP_CLASS
-
-
-EOLIAN static Efl_Object *
-_efl_gesture_tap_efl_object_constructor(Eo *obj, Efl_Gesture_Tap_Data *pd EINA_UNUSED)
-{
- Efl_Gesture_Data *gd;
-
- obj = efl_constructor(efl_super(obj, MY_CLASS));
-
- gd = efl_data_scope_get(obj, EFL_GESTURE_CLASS);
- gd->type = EFL_EVENT_GESTURE_TAP;
-
- return obj;
-}
-
-#include "efl_gesture_tap.eo.c"
diff --git a/src/lib/evas/gesture/efl_gesture_tap.eo b/src/lib/evas/gesture/efl_gesture_tap.eo
deleted file mode 100644
index 993d2067c1..0000000000
--- a/src/lib/evas/gesture/efl_gesture_tap.eo
+++ /dev/null
@@ -1,13 +0,0 @@
-import efl_gesture_types;
-
-class Efl.Gesture.Tap(Efl.Gesture)
-{
- [[EFL Gesture Tap class]]
- event_prefix: efl;
- events {
- gesture,tap; [[Event for tap gesture]]
- }
- implements {
- Efl.Object.constructor;
- }
-}
diff --git a/src/lib/evas/include/evas_common_private.h b/src/lib/evas/include/evas_common_private.h
index 27332c0c67..6b1e15f25d 100644
--- a/src/lib/evas/include/evas_common_private.h
+++ b/src/lib/evas/include/evas_common_private.h
@@ -67,15 +67,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_EVAS_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EVAS_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -86,7 +86,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#ifndef HAVE_LROUND
/* right now i dont care about rendering bugs on platforms without lround
diff --git a/src/lib/evas/include/evas_ector_buffer.eo b/src/lib/evas/include/evas_ector_buffer.eo
index 77f66a3d5b..8801c5aecb 100644
--- a/src/lib/evas/include/evas_ector_buffer.eo
+++ b/src/lib/evas/include/evas_ector_buffer.eo
@@ -1,5 +1,3 @@
-import evas_canvas;
-
interface Evas.Ector.Buffer
{
[[Binding layer between ector buffers and evas images.
diff --git a/src/lib/evas/include/evas_filter.h b/src/lib/evas/include/evas_filter.h
index c6618d35d6..ffbe797a6d 100644
--- a/src/lib/evas/include/evas_filter.h
+++ b/src/lib/evas/include/evas_filter.h
@@ -11,15 +11,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_EVAS_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EVAS_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -30,7 +30,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#ifdef DEBUG
# define FILTERS_DEBUG
diff --git a/src/lib/evas/include/evas_inline.x b/src/lib/evas/include/evas_inline.x
index fd00dbe2aa..7a2af7de1d 100644
--- a/src/lib/evas/include/evas_inline.x
+++ b/src/lib/evas/include/evas_inline.x
@@ -355,6 +355,14 @@ _evas_engine_context(Evas_Public_Data *e)
return e->backend;
}
+static inline void
+_evas_wrap_del(Evas_Object **eo, Evas_Object_Protected_Data *pd)
+{
+ if (!*eo) return ;
+ if (pd && pd->legacy.ctor) evas_object_del(*eo);
+ else efl_del(*eo);
+}
+
#define _EVAS_COLOR_CLAMP(x, y) do { \
if (x > y) { x = y; bad = 1; } \
if (x < 0) { x = 0; bad = 1; } } while (0)
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index a9bd98196c..bded8892b6 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -23,15 +23,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_EVAS_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EVAS_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -42,7 +42,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
/* save typing */
#define ENFN obj->layer->evas->engine.func
@@ -822,7 +822,6 @@ struct _Evas_Public_Data
int output_validity;
- int walking_list;
Evas_Event_Flags default_event_flags;
struct {
@@ -1130,6 +1129,8 @@ struct _Evas_Object_Protected_Data
// Pointer to the Evas_Object itself
Evas_Object *object;
+ Evas_Object *anim_player;
+
Evas_Size_Hints *size_hints;
int last_mouse_down_counter;
@@ -1183,7 +1184,6 @@ struct _Evas_Object_Protected_Data
Eina_Bool child_has_map : 1;
Eina_Bool efl_del_called : 1;
Eina_Bool no_render : 1; // since 1.15
- Eina_Bool clean_layer : 1; // destructor option
Eina_Bool snapshot_needs_redraw : 1;
Eina_Bool snapshot_no_obscure : 1;
@@ -1430,6 +1430,7 @@ struct _Evas_Func
int (*font_right_inset_get) (void *engine, Evas_Font_Set *font, const Evas_Text_Props *text_props);
/* EFL-GL Glue Layer */
+ Eina_Bool (*gl_supports_evas_gl) (void *engine);
void *(*gl_output_set) (void *engine, void *output);
void *(*gl_surface_create) (void *engine, void *config, int w, int h);
void *(*gl_pbuffer_surface_create) (void *engine, void *config, int w, int h, int const *attrib_list);
@@ -1551,7 +1552,7 @@ Evas_Object *evas_object_new(Evas *e);
void evas_object_change_reset(Evas_Object_Protected_Data *obj);
void evas_object_clip_recalc_do(Evas_Object_Protected_Data *obj, Evas_Object_Protected_Data *clipper);
void evas_object_cur_prev(Evas_Object_Protected_Data *obj);
-void evas_object_free(Evas_Object *obj, Eina_Bool clean_layer);
+void evas_object_free(Evas_Object_Protected_Data *obj, Eina_Bool clean_layer);
void evas_object_update_bounding_box(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas_Smart_Data *s);
void evas_object_inject(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas *e);
void evas_object_release(Evas_Object *obj, Evas_Object_Protected_Data *pd, int clean_layer);
@@ -1684,9 +1685,9 @@ void _efl_canvas_object_clip_prev_reset(Evas_Object_Protected_Data *obj, Eina_Bo
Eina_Bool _efl_canvas_object_clip_set_block(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Object *eo_clip, Evas_Object_Protected_Data *clip);
Eina_Bool _efl_canvas_object_clip_unset_block(Eo *eo_obj, Evas_Object_Protected_Data *obj);
-Eina_Bool _efl_canvas_object_efl_gfx_size_set_block(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Coord w, Evas_Coord h, Eina_Bool internal);
+Eina_Bool _efl_canvas_object_efl_gfx_entity_size_set_block(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Coord w, Evas_Coord h, Eina_Bool internal);
-void _evas_focus_device_del_cb(void *data, const Efl_Event *ev);
+void _evas_focus_device_invalidate_cb(void *data, const Efl_Event *ev);
/* Node functions. */
void evas_canvas3d_node_traverse(Evas_Canvas3D_Node *from, Evas_Canvas3D_Node *to, Evas_Canvas3D_Node_Traverse_Type type, Eina_Bool skip, Evas_Canvas3D_Node_Func func, void *data);
@@ -1877,11 +1878,10 @@ void _evas_touch_point_remove(Evas *e, int id);
void _evas_device_cleanup(Evas *e);
Evas_Device *_evas_device_top_get(const Evas *e);
-/* to show object if show is called during hide animation */
-Eina_Bool _efl_canvas_object_event_animation_is_running(Eo *eo_obj, const Efl_Event_Description *desc);
-void _efl_canvas_object_event_animation_cancel(Eo *eo_obj);
-
/* legacy/eo events */
+Efl_Input_Event *efl_input_event_instance_get(Eo *klass, Eo *owner);
+void efl_input_event_instance_clean(Eo *klass);
+
void *efl_input_pointer_legacy_info_fill(Evas *eo_evas, Efl_Input_Key *eo_ev, Evas_Callback_Type type, Evas_Event_Flags **pflags);
void *efl_input_key_legacy_info_fill(Efl_Input_Key *evt, Evas_Event_Flags **pflags);
void *efl_input_hold_legacy_info_fill(Efl_Input_Hold *evt, Evas_Event_Flags **pflags);
@@ -1906,10 +1906,13 @@ Eina_List *_evas_pointer_list_in_rect_get(Evas_Public_Data *edata,
void efl_canvas_output_info_get(Evas_Public_Data *e, Efl_Canvas_Output *output);
// Gesture Manager
-void _efl_gesture_manager_filter_event(Eo *gesture_manager, Eo *target, void *event);
-void _efl_gesture_manager_callback_del_hook(Eo *gesture_manager, Eo *target, const Efl_Event_Description *type);
-void _efl_gesture_manager_callback_add_hook(Eo *gesture_manager, Eo *target, const Efl_Event_Description *type);
+void _efl_canvas_gesture_manager_filter_event(Eo *gesture_manager, Eo *target, void *event);
+void _efl_canvas_gesture_manager_callback_del_hook(Eo *gesture_manager, Eo *target, const Efl_Event_Description *type);
+void _efl_canvas_gesture_manager_callback_add_hook(Eo *gesture_manager, Eo *target, const Efl_Event_Description *type);
+//evas focus functions
+void evas_focus_init(void);
+void evas_focus_shutdown(void);
extern Eina_Cow *evas_object_proxy_cow;
extern Eina_Cow *evas_object_map_cow;
diff --git a/src/lib/evas/vg/evas_vg_cache.c b/src/lib/evas/vg/evas_vg_cache.c
index 1e56fc14c5..f628a781d1 100644
--- a/src/lib/evas/vg/evas_vg_cache.c
+++ b/src/lib/evas/vg/evas_vg_cache.c
@@ -177,8 +177,7 @@ static void
_evas_cache_vg_data_free_cb(void *data)
{
Vg_File_Data *val = data;
-
- efl_del(val->root);
+ efl_unref(val->root);
free(val);
}
@@ -190,7 +189,7 @@ _evas_cache_svg_entry_free_cb(void *data)
eina_stringshare_del(entry->file);
eina_stringshare_del(entry->key);
free(entry->hash_key);
- efl_del(entry->root);
+ efl_unref(entry->root);
free(entry);
}
@@ -232,7 +231,8 @@ evas_cache_vg_file_info(const char *file, const char *key)
if (!vd)
{
vd = _vg_load_from_file(file, key);
- eina_hash_add(vg_cache->vg_hash, eina_strbuf_string_get(hash_key), vd);
+ //File is exists.
+ if (vd) eina_hash_add(vg_cache->vg_hash, eina_strbuf_string_get(hash_key), vd);
}
eina_strbuf_free(hash_key);
return vd;
@@ -262,17 +262,16 @@ _apply_transformation(Efl_VG *root, double w, double h, Vg_File_Data *vg_data)
eina_matrix3_scale(&m, sx, sy);
eina_matrix3_translate(&m, -vg_data->view_box.x, -vg_data->view_box.y);
}
- evas_vg_node_transformation_set(root, &m);
+ efl_canvas_vg_node_transformation_set(root, &m);
}
static Efl_VG *
_evas_vg_dup_vg_tree(Vg_File_Data *fd, double w, double h)
{
-
Efl_VG *root;
if (!fd) return NULL;
- if ( !w || !h ) return NULL;
+ if (w < 1 || h < 1) return NULL;
root = efl_duplicate(fd->root);
_apply_transformation(root, w, h, fd);
@@ -335,9 +334,8 @@ evas_cache_vg_tree_get(Evas_Cache_Vg_Entry *entry)
if (entry->root) return entry->root;
if (entry->file)
- {
- _evas_cache_svg_vg_tree_update(entry);
- }
+ _evas_cache_svg_vg_tree_update(entry);
+
return entry->root;
}
diff --git a/src/lib/evil/Evil.h b/src/lib/evil/Evil.h
index c8f1f68f8b..e09e261ead 100644
--- a/src/lib/evil/Evil.h
+++ b/src/lib/evil/Evil.h
@@ -106,6 +106,17 @@ extern "C" {
typedef unsigned long uid_t;
typedef unsigned long gid_t;
+#ifdef _MSC_VER
+# ifdef _WIN64
+typedef __int64 pid_t;
+# else
+typedef int pid_t;
+# endif
+typedef SSIZE_T ssize_t;
+typedef unsigned short mode_t;
+# define strdup(str) _strdup(str)
+#endif
+
#include "evil_macro.h"
#include "evil_dlfcn.h"
diff --git a/src/lib/evil/dirent.h b/src/lib/evil/dirent.h
deleted file mode 100644
index 9c58019b52..0000000000
--- a/src/lib/evil/dirent.h
+++ /dev/null
@@ -1,146 +0,0 @@
-#ifndef __EVIL_DIRENT_H__
-#define __EVIL_DIRENT_H__
-
-#ifdef EAPI
-# undef EAPI
-#endif /* EAPI */
-
-#ifdef _WIN32
-# ifdef EFL_EVIL_BUILD
-# ifdef DLL_EXPORT
-# define EAPI __declspec(dllexport)
-# else
-# define EAPI
-# endif /* ! DLL_EXPORT */
-# else
-# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EVIL_BUILD */
-#endif /* _WIN32 */
-
-
-/**
- * @file dirent.h
- * @brief The file that provides functions ported from Unix in dirent.h.
- * @defgroup Evil_Dirent_Group Dirent.h functions
- * @ingroup Evil
- *
- * This header provides functions ported from Unix in dirent.h.
- *
- * @{
- */
-
-
-#ifdef UNICODE
-# include <wchar.h>
-#endif
-
-/**
- * @def DT_UNKNOWN
- * Specifies that the file type is unknown.
- */
-#define DT_UNKNOWN 0
-
-/**
- * @def DT_DIR
- * Specifies that the file type is a directory.
- */
-#define DT_DIR 4
-
-/**
- * @typedef DIR
- * @brief A structure that describes a directory stream.
- */
-typedef struct DIR DIR;
-
-/**
- * @struct dirent
- * @brief A structure that describes a directory stream.
- */
-struct dirent
-{
- char d_name[260 + 1]; /**< The filename. */
- int d_mode; /**< The mode */
- unsigned char d_type; /**< The type */
-};
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-
-/**
- * @brief Open the given directory.
- *
- * @param name The directory to open.
- * @return A pointer to the directory stream.
- *
- * This function opens the directory @p name and return the directory
- * stream. On error or if @p dir is NULL, -1 is returned, and errno is
- * set appropriately (on Windows XP only). On success, 0 is returned.
- *
- * @see closedir()
- * @see readdir()
- *
- * Conformity: None.
- *
- * Supported OS: Windows XP, CE.
- */
-EAPI DIR *opendir(char const *name);
-
-/**
- * @brief Close the given directory.
- *
- * @param dir The directory stream to close.
- * @return A pointer to the directory stream.
- *
- * This function closes the stream directory @p dir. On error or is
- * @p path is NULL or an empty string, NULL is returned, and errno is set
- * appropriately (on Windows XP only).
- *
- * @see opendir()
- * @see readdir()
- *
- * Conformity: None.
- *
- * Supported OS: Windows XP, CE.
- */
-EAPI int closedir(DIR *dir);
-
-/**
- * @brief Read the given directory.
- *
- * @param dir The directory stream to read.
- * @return A pointer to a dirent structure, @c NULL oterhwise.
- *
- * This function returns a pointer to a dirent structure representing
- * the next directory entry in the directory stream pointed to by
- * @p dir. It returns NULL on reaching the end of the directory stream
- * or if an error occurred and errno is set appropriately (on Windows XP only).
- *
- * @see opendir()
- * @see readdir()
- *
- * Conformity: None.
- *
- * Supported OS: Windows XP, CE.
- */
-EAPI struct dirent *readdir(DIR *dir);
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#undef EAPI
-#define EAPI
-
-
-
-/**
- * @}
- */
-
-
-#endif /* __EVIL_DIRENT_H__ */
diff --git a/src/lib/evil/evil_dirent.c b/src/lib/evil/evil_dirent.c
deleted file mode 100644
index 6f6b86a738..0000000000
--- a/src/lib/evil/evil_dirent.c
+++ /dev/null
@@ -1,180 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#include <stdlib.h>
-#include <dirent.h>
-#include <errno.h>
-#include <sys/types.h>
-
-#ifndef WIN32_LEAN_AND_MEAN
-# define WIN32_LEAN_AND_MEAN
-#endif
-#include <windows.h>
-#undef WIN32_LEAN_AND_MEAN
-
-#include "evil_macro.h"
-#include "evil_stdio.h"
-
-
-struct DIR
-{
- struct dirent dirent;
- WIN32_FIND_DATA data;
- HANDLE handle;
-};
-
-
-DIR *opendir(char const *name)
-{
- DIR *dir;
- char *tmp;
- DWORD attr;
- size_t l;
-#ifdef UNICODE
- wchar_t *wname;
- char *d_name;
-#endif
-
- /* valid name */
- if (!name || !*name)
- {
- errno = ENOENT;
- return NULL;
- }
-
-#ifdef UNICODE
- wname = evil_char_to_wchar(name);
- if (!wname)
- {
- errno = ENOMEM;
- return NULL;
- }
-
- if((attr = GetFileAttributes(wname)) == 0xFFFFFFFF)
-#else
- if((attr = GetFileAttributes(name)) == 0xFFFFFFFF)
-#endif
- {
- errno = ENOENT;
- return NULL;
- }
-
-#ifdef UNICODE
- free(wname);
-#endif
-
- /* directory */
- if (!(attr & FILE_ATTRIBUTE_DIRECTORY))
- {
- errno = ENOTDIR;
- return NULL;
- }
-
- dir = (DIR *)malloc(sizeof(DIR));
- if (!dir)
- {
- errno = ENOMEM;
- return NULL;
- }
-
- l = strlen(name);
- tmp = (char *)malloc(sizeof(char) * l + 5);
- if (!tmp)
- {
- errno = ENOMEM;
- free(dir);
- return NULL;
- }
-
- memcpy(tmp, name, l);
- memcpy(tmp + l, "\\*.*", 5);
-
- EVIL_PATH_SEP_UNIX_TO_WIN32(tmp);
-
-#ifdef UNICODE
- wname = evil_char_to_wchar(tmp);
- if (!wname)
- {
- errno = ENOMEM;
- free(tmp);
- free(dir);
- return NULL;
- }
- dir->handle = FindFirstFile(wname, &dir->data);
- free(wname);
-#else
- dir->handle = FindFirstFile(tmp, &dir->data);
-#endif
-
- free(tmp);
-
- if (dir->handle == INVALID_HANDLE_VALUE)
- {
- free(dir);
- return NULL;
- }
-
-#ifdef UNICODE
- d_name = evil_wchar_to_char(dir->data.cFileName);
- strcpy(dir->dirent.d_name, d_name);
- free(d_name);
-#else
- strcpy(dir->dirent.d_name, dir->data.cFileName);
-#endif
- dir->dirent.d_mode = (int)dir->data.dwFileAttributes;
-
- if (dir->data.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY)
- dir->dirent.d_type = DT_DIR;
- else
- dir->dirent.d_type = DT_UNKNOWN;
-
- return dir;
-}
-
-int closedir(DIR *dir)
-{
- if (!dir)
- {
- errno = EBADF;
- return -1;
- }
-
- if (dir->handle != INVALID_HANDLE_VALUE)
- FindClose(dir->handle);
- free(dir);
-
- return 0;
-}
-
-struct dirent *readdir(DIR *dir)
-{
-#ifdef UNICODE
- char *d_name;
-#endif
-
- if (!dir)
- {
- errno = EBADF;
- return NULL;
- }
-
- if (dir->handle == INVALID_HANDLE_VALUE)
- return NULL;
-
-#ifdef UNICODE
- d_name = evil_wchar_to_char(dir->data.cFileName);
- strcpy(dir->dirent.d_name, d_name);
- free(d_name);
-#else
- strcpy(dir->dirent.d_name, dir->data.cFileName);
-#endif
-
- if (!FindNextFile(dir->handle, &dir->data))
- {
- FindClose(dir->handle);
- dir->handle = INVALID_HANDLE_VALUE;
- }
-
- return &dir->dirent;
-}
diff --git a/src/lib/evil/evil_link_xp.cpp b/src/lib/evil/evil_link_xp.cpp
deleted file mode 100644
index 2b5b956b4a..0000000000
--- a/src/lib/evil/evil_link_xp.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#include <errno.h>
-
-#include <shlobj.h>
-#include <objidl.h>
-#include <cstdio>
-
-#include "Evil.h"
-
-
-/*
- * Symbolic links and directory related functions
- *
- */
-
-
-/* REMARK: Windows has no symbolic link. */
-/* Nevertheless, it can create and read .lnk files */
-int
-symlink(const char *oldpath, const char *newpath)
-{
- char fullname[PATH_MAX];
- wchar_t *wnewpath;
- IShellLink *pISL;
- IPersistFile *pIPF;
- HRESULT res;
- size_t size;
-
- realpath(oldpath, fullname);
-
- res = CoInitialize(NULL);
- if (FAILED(res))
- {
- if (res == E_OUTOFMEMORY)
- errno = ENOMEM;
- return -1;
- }
-
- if (FAILED(CoCreateInstance(CLSID_ShellLink,
- NULL,
- CLSCTX_INPROC_SERVER,
- IID_IShellLink,
- (void **)&pISL)))
- goto no_instance;
-
- if (FAILED(pISL->SetPath(fullname)))
- goto no_setpath;
-
- if (FAILED(pISL->QueryInterface(IID_IPersistFile, (void **)&pIPF)))
- goto no_queryinterface;
-
- size = mbstowcs(NULL, newpath, 0);
- wnewpath = (wchar_t *)malloc((size + 1) * sizeof(wchar_t));
- if (!wnewpath)
- goto malloc_failure;
- if (mbstowcs(wnewpath, newpath, size + 1) == (size_t)(-1))
- goto translation_failure;
- if (FAILED(pIPF->Save(wnewpath, FALSE)))
- goto no_save;
-
- free(wnewpath);
- pIPF->Release();
- pISL->Release();
- CoUninitialize();
-
- return 0;
-
- no_save:
- translation_failure:
- malloc_failure:
- pIPF->Release();
- no_queryinterface:
- no_setpath:
- pISL->Release();
- no_instance:
- CoUninitialize();
- return -1;
-}
-
-ssize_t
-readlink(const char *path, char *buf, size_t bufsiz)
-{
- wchar_t *wpath;
- char new_path[PATH_MAX];
- IShellLink *pISL;
- IPersistFile *pIPF;
- size_t length;
- HRESULT res;
- size_t size;
-
- res = CoInitialize(NULL);
- if (FAILED(res))
- {
- if (res == E_OUTOFMEMORY)
- errno = ENOMEM;
- return -1;
- }
-
- if (FAILED(CoCreateInstance(CLSID_ShellLink,
- NULL,
- CLSCTX_INPROC_SERVER,
- IID_IShellLink,
- (void **)&pISL)))
- goto couninitialize;
-
- if (FAILED(pISL->QueryInterface(IID_IPersistFile, (void **)&pIPF)))
- goto release_shell_link;
-
- size = mbstowcs(NULL, path, 0);
- wpath = (wchar_t *)malloc((size + 1) * sizeof(wchar_t));
- if (!wpath)
- goto release_persist_file;
-
- mbstowcs(wpath, path, size + 1);
- if (FAILED(pIPF->Load(wpath, STGM_READ)))
- goto free_wpath;
-
- if (FAILED(pISL->Resolve(NULL, SLR_UPDATE | SLR_NO_UI)))
- goto free_wpath;
-
- if (FAILED(pISL->GetPath(new_path, PATH_MAX, NULL, 0)))
- goto free_wpath;
-
- length = strlen(new_path);
- if (length > bufsiz)
- length = bufsiz;
-
- memcpy(buf, new_path, length);
-
- free(wpath);
- pISL->Release();
- pIPF->Release();
- CoUninitialize();
-
- return length;
-
- free_wpath:
- free(wpath);
- release_persist_file:
- pIPF->Release();
- release_shell_link:
- pISL->Release();
- couninitialize:
- CoUninitialize();
- return -1;
-}
diff --git a/src/lib/evil/evil_macro.h b/src/lib/evil/evil_macro.h
index 966710ca4f..88cec3dcf8 100644
--- a/src/lib/evil/evil_macro.h
+++ b/src/lib/evil/evil_macro.h
@@ -9,7 +9,7 @@
# undef EAPI
#endif
-#ifdef EFL_EVIL_BUILD
+#ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
diff --git a/src/lib/evil/evil_unistd.h b/src/lib/evil/evil_unistd.h
index dbc6cfe826..5319c474f3 100644
--- a/src/lib/evil/evil_unistd.h
+++ b/src/lib/evil/evil_unistd.h
@@ -38,62 +38,6 @@ EAPI double evil_time_get(void);
/*
- * Symbolic links and directory related functions
- *
- */
-
-/**
- * @brief Create a shell link.
- *
- * @param oldpath The file name to be linked.
- * @param newpath The file name to create.
- * @return 0 on success, -1 otherwise.
- *
- * Create a shell link @p newpath to @p oldpath (@p newpath is the
- * name of the file created, @p oldpath is the string used in
- * creating the shell link).
- *
- * On success, this function returns 0. Otherwise, it returns -1 and
- * errno may be set to the following value:
- * - ENOMEM: Not enough memory.
- *
- * On Windows, the symbolic links do not exist. Nevertheless
- * shell links can be created. This function is named like the Unix
- * function for portability reasons.
- *
- * Conformity: None.
- *
- * Supported OS: Windows XP.
- */
-EAPI int symlink(const char *oldpath, const char *newpath);
-
-/**
- * @brief Read value of a shell link.
- *
- * @param path The file name to be linked.
- * @param buf The file name to create.
- * @param bufsiz The size of the buffer.
- * @return 0 on success, -1 otherwise.
- *
- * Place the content of the shell link @p path in the buffer
- * @p buf, which has size @p bufzsiz.
- *
- * On success, this function returns 0. Otherwise, it returns -1 and
- * errno may be set to the following value:
- * - ENOMEM: Not enough memory.
- *
- * On Windows, the symbolic links do not exist. Nevertheless
- * shell links can be managed. This function is named like the Unix
- * function for portability reasons.
- *
- * Conformity: None.
- *
- * Supported OS: Windows XP.
- */
-EAPI ssize_t readlink(const char *path, char *buf, size_t bufsiz);
-
-
-/*
* file related functions
*
*/
diff --git a/src/lib/evil/evil_util.c b/src/lib/evil/evil_util.c
index 36ee38e844..e47475371a 100644
--- a/src/lib/evil/evil_util.c
+++ b/src/lib/evil/evil_util.c
@@ -172,37 +172,13 @@ _evil_last_error_display(const char *fct)
const char *
evil_tmpdir_get(void)
{
- char *tmpdir;
-
- tmpdir = getenv("TMP");
- if (!tmpdir) tmpdir = getenv("TEMP");
- if (!tmpdir) tmpdir = getenv("USERPROFILE");
- if (!tmpdir) tmpdir = getenv("WINDIR");
- if (!tmpdir) tmpdir="C:\\";
-
- return tmpdir;
+ return NULL;
}
const char *
evil_homedir_get(void)
{
- char *homedir;
- char *homedrive;
- char *homepath;
-
- homedir = getenv("HOME");
- if (!homedir)
- {
- homedrive = getenv("HOMEDRIVE");
- homepath = getenv("HOMEPATH");
- if (homedrive && homepath)
- asprintf(&homedir, "%s%s", homedrive, homepath);
- }
- if (!homedir) homedir = getenv("USERPROFILE");
- if (!homedir) homedir = getenv("WINDIR");
- if (!homedir) homedir="C:\\";
-
- return homedir;
+ return NULL;
}
int
diff --git a/src/lib/evil/evil_util.h b/src/lib/evil/evil_util.h
index 6b3e50439d..e1fdf26387 100644
--- a/src/lib/evil/evil_util.h
+++ b/src/lib/evil/evil_util.h
@@ -81,10 +81,14 @@ EAPI const char *evil_last_error_get(void);
*
* Supported OS: Windows 95, Windows 98, Windows Me, Windows NT, Windows 2000,
* Windows XP.
+
+ * @deprecated
+ * This function is deprecated and returns @c NULL.
+ * Use eina_environment_tmp_get() instead.
*
* @ingroup Evil
*/
-__attribute__ ((__deprecated__)) EAPI const char *evil_tmpdir_get(void);
+EAPI const char *evil_tmpdir_get(void);
/**
* @brief Return a dir to store personal files.
@@ -103,10 +107,14 @@ __attribute__ ((__deprecated__)) EAPI const char *evil_tmpdir_get(void);
*
* Supported OS: Windows 95, Windows 98, Windows Me, Windows NT, Windows 2000,
* Windows XP.
+
+ * @deprecated
+ * This function is deprecated and returns @c NULL.
+ * Use eina_environment_home_get() instead.
*
* @ingroup Evil
*/
-__attribute__ ((__deprecated__)) EAPI const char *evil_homedir_get(void);
+EAPI const char *evil_homedir_get(void);
/**
* @brief check if the given path is absolute.
diff --git a/src/lib/evil/fnmatch.h b/src/lib/evil/fnmatch.h
index f2a9266e53..0464fa7ef6 100644
--- a/src/lib/evil/fnmatch.h
+++ b/src/lib/evil/fnmatch.h
@@ -3,19 +3,19 @@
#ifdef EAPI
# undef EAPI
-#endif /* EAPI */
+#endif
#ifdef _WIN32
-# ifdef EFL_EVIL_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EVIL_BUILD */
-#endif /* _WIN32 */
+# endif
+#endif
#ifdef __cplusplus
extern "C" {
@@ -51,4 +51,7 @@ EAPI int fnmatch(const char *__pattern, const char *__string, int __flags);
}
#endif
+#undef EAPI
+#define EAPI
+
#endif /* __EVIL_FNMATCH_H__ */
diff --git a/src/lib/evil/pwd.h b/src/lib/evil/pwd.h
index 266349052c..2d303381b7 100644
--- a/src/lib/evil/pwd.h
+++ b/src/lib/evil/pwd.h
@@ -8,7 +8,7 @@
* @defgroup Evil_Pwd_Group Pwd.h functions
* @ingroup Evil
*
- * This header provides functions ported from Unix in dirent.h.
+ * This header provides functions ported from Unix in pwd.h.
*
* @{
*/
@@ -20,10 +20,10 @@
#ifdef EAPI
# undef EAPI
-#endif /* EAPI */
+#endif
#ifdef _WIN32
-# ifdef EFL_EVIL_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
diff --git a/src/modules/ecore/system/systemd/ecore_system_systemd.c b/src/modules/ecore/system/systemd/ecore_system_systemd.c
index edc86a6642..78e3185287 100644
--- a/src/modules/ecore/system/systemd/ecore_system_systemd.c
+++ b/src/modules/ecore/system/systemd/ecore_system_systemd.c
@@ -249,11 +249,23 @@ _property_change_monitor(const char *name,
}
static void _ecore_system_systemd_shutdown(void);
+static Eina_Bool _ecore_system_systemd_init(void);
+static unsigned int reseting = 0;
+static void
+_ecore_system_systemd_reset()
+{
+ reseting = 1;
+ _ecore_system_systemd_shutdown();
+ _ecore_system_systemd_init();
+ reseting = 0;
+}
static Eina_Bool
_ecore_system_systemd_init(void)
{
eldbus_init();
+ if (!reseting)
+ ecore_fork_reset_callback_add(_ecore_system_systemd_reset, NULL);
_log_dom = eina_log_domain_register("ecore_system_systemd", NULL);
if (_log_dom < 0)
@@ -296,6 +308,8 @@ _ecore_system_systemd_shutdown(void)
Eldbus_Pending *pend;
DBG("ecore system 'systemd' unloaded");
+ if (!reseting)
+ ecore_fork_reset_callback_del(_ecore_system_systemd_reset, NULL);
while (_proxies)
{
diff --git a/src/modules/ecore/system/upower/ecore_system_upower.c b/src/modules/ecore/system/upower/ecore_system_upower.c
index 8a73ac44ac..17ef5170c8 100644
--- a/src/modules/ecore/system/upower/ecore_system_upower.c
+++ b/src/modules/ecore/system/upower/ecore_system_upower.c
@@ -408,12 +408,26 @@ disp_error:
return EINA_FALSE;
}
+static Eina_Bool _ecore_system_upower_init(void);
+static void _ecore_system_upower_shutdown(void);
+static unsigned int reseting;
+
+static void
+_ecore_system_upower_reset()
+{
+ reseting = 1;
+ _ecore_system_upower_shutdown();
+ _ecore_system_upower_init();
+ reseting = 0;
+}
static Eina_Bool
_ecore_system_upower_init(void)
{
Eldbus_Signal_Handler *s;
eldbus_init();
+ if (!reseting)
+ ecore_fork_reset_callback_add(_ecore_system_upower_reset, NULL);
_log_dom = eina_log_domain_register("ecore_system_upower", NULL);
if (_log_dom < 0)
@@ -469,6 +483,8 @@ _ecore_system_upower_shutdown(void)
Eldbus_Pending *pend;
DBG("ecore system 'upower' unloaded");
+ if (!reseting)
+ ecore_fork_reset_callback_del(_ecore_system_upower_reset, NULL);
eldbus_name_owner_changed_callback_del(_conn, "org.freedesktop.UPower",
_upower_name_owner_cb,
@@ -497,6 +513,11 @@ _ecore_system_upower_shutdown(void)
_obj = NULL;
}
+ EINA_LIST_FREE(_eldbus_pending, pend)
+ {
+ eldbus_pending_cancel(pend);
+ }
+
if (_conn)
{
eldbus_connection_unref(_conn);
@@ -509,11 +530,6 @@ _ecore_system_upower_shutdown(void)
_log_dom = -1;
}
- EINA_LIST_FREE(_eldbus_pending, pend)
- {
- eldbus_pending_cancel(pend);
- }
-
eldbus_shutdown();
}
diff --git a/src/modules/ecore_buffer/shm/ecore_buffer_shm.c b/src/modules/ecore_buffer/shm/ecore_buffer_shm.c
index 298225a634..2d65a20201 100644
--- a/src/modules/ecore_buffer/shm/ecore_buffer_shm.c
+++ b/src/modules/ecore_buffer/shm/ecore_buffer_shm.c
@@ -55,7 +55,6 @@ _ecore_buffer_shm_buffer_alloc(Ecore_Buffer_Module_Data bmdata, int width, int h
Ecore_Buffer_Shm_Data* b;
char *name;
int fd, page_size;
- Efl_Vpath_File *file_obj;
page_size = eina_cpu_page_size();
@@ -68,10 +67,7 @@ _ecore_buffer_shm_buffer_alloc(Ecore_Buffer_Module_Data bmdata, int width, int h
b->size = page_size * (((b->stride * b->h) + (page_size - 1)) / page_size);
b->am_owner = EINA_TRUE;
- file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS,
- "(:run:)/ecore-buffer-shared-XXXXXX");
- name = strdup(efl_vpath_file_result_get(file_obj));
- efl_del(file_obj);
+ name = eina_vpath_resolve("(:usr.run:)/ecore-buffer-shared-XXXXXX");
if (!name) goto err;
fd = mkostemp(name, O_CLOEXEC);
diff --git a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
index 75ba1da62c..e1c5a66670 100644
--- a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
+++ b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
@@ -272,7 +272,6 @@ _ecore_evas_show(Ecore_Evas *ee)
if (ee->visible) return;
ee->visible = 1;
ee->should_be_visible = 1;
- ee->draw_ok = EINA_TRUE;
if (ee->func.fn_show) ee->func.fn_show(ee);
}
@@ -293,7 +292,6 @@ _ecore_evas_hide(Ecore_Evas *ee)
if (!ee->visible) return;
ee->visible = 0;
ee->should_be_visible = 0;
- ee->draw_ok = EINA_FALSE;
if (ee->func.fn_hide) ee->func.fn_hide(ee);
}
@@ -561,16 +559,12 @@ ecore_evas_cocoa_new_internal(Ecore_Cocoa_Window *parent EINA_UNUSED, int x, int
ee->prop.withdrawn = EINA_TRUE;
ee->can_async_render = EINA_FALSE;
- ee->evas = evas_new();
+ ecore_evas_evas_new(ee, w, h);
INF("ecore_evas: %p, evas: %p", ee, ee->evas);
if (!ee->evas)
goto free_name;
- evas_data_attach_set(ee->evas, ee);
- evas_output_size_set(ee->evas, w, h);
- evas_output_viewport_set(ee->evas, 0, 0, w, h);
-
ee->prop.window = (Ecore_Window)ecore_cocoa_window_new(x, y, w, h);
if (!ee->prop.window)
@@ -600,15 +594,7 @@ ecore_evas_cocoa_new_internal(Ecore_Cocoa_Window *parent EINA_UNUSED, int x, int
iface->window_get = _ecore_evas_cocoa_window_get;
ee->engine.ifaces = eina_list_append(ee->engine.ifaces, iface);
- _ecore_evas_register(ee);
- ecore_event_window_register(ee->prop.window, ee, ee->evas,
- (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
- (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
- (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
- (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
- _ecore_event_window_direct_cb_set(ee->prop.window, _ecore_evas_input_direct_cb);
-
- evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
+ ecore_evas_done(ee, EINA_TRUE);
return ee;
diff --git a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
index 73e3a45621..c1c60f8b15 100644
--- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
+++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
@@ -63,6 +63,7 @@ typedef struct _Ecore_Evas_Engine_Drm_Data
Eina_Bool ticking : 1;
Eina_Bool once : 1;
Ecore_Job *tick_job;
+ Ecore_Job *focus_job;
} Ecore_Evas_Engine_Drm_Data;
static int _drm_init_count = 0;
@@ -198,6 +199,11 @@ _ecore_evas_drm_shutdown(Ecore_Evas_Engine_Drm_Data *edata)
Ecore_Event_Handler *h;
if (--_drm_init_count != 0) return _drm_init_count;
+ if (edata->focus_job)
+ {
+ ecore_job_del(edata->focus_job);
+ edata->focus_job = NULL;
+ }
ecore_drm2_outputs_destroy(edata->dev);
ecore_drm2_device_close(edata->dev);
ecore_drm2_shutdown();
@@ -383,6 +389,17 @@ _drm_pointer_warp(const Ecore_Evas *ee, Evas_Coord x, Evas_Coord y)
}
static void
+_drm_show_focus_job(void *data)
+{
+ Ecore_Evas *ee = data;
+ Ecore_Evas_Engine_Drm_Data *edata;
+
+ _ecore_evas_focus_device_set(ee, NULL, EINA_TRUE);
+ edata = ee->engine.data;
+ edata->focus_job = NULL;
+}
+
+static void
_drm_show(Ecore_Evas *ee)
{
Ecore_Evas_Engine_Drm_Data *edata;
@@ -406,14 +423,10 @@ _drm_show(Ecore_Evas *ee)
if (ee->visible) return;
ee->visible = 1;
- if (ee->prop.fullscreen)
- {
- evas_focus_in(ee->evas);
- if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
- }
if (ee->func.fn_show) ee->func.fn_show(ee);
edata = ee->engine.data;
+ edata->focus_job = ecore_job_add(_drm_show_focus_job, ee);
/* HACK: sometimes we still have an animator ticking when we vc switch
* so for now we just fire off a flip here to kick it when we come back.
* This is just papering over a bug for now until I have time to track
@@ -715,10 +728,14 @@ _cb_pageflip(int fd EINA_UNUSED, unsigned int frame EINA_UNUSED, unsigned int se
if (edata->ticking)
{
+ int x, y, w, h;
double t = (double)sec + ((double)usec / 1000000);
+ ecore_drm2_output_info_get(edata->output, &x, &y, &w, &h, NULL);
+
if (!edata->once) t = ecore_time_get();
- ecore_evas_animator_tick(ee, NULL, t - edata->offset);
+ ecore_evas_animator_tick(ee, &(Eina_Rectangle){x, y, w, h},
+ t - edata->offset);
}
else if (ret)
ecore_drm2_fb_flip(NULL, edata->output);
@@ -741,11 +758,16 @@ _tick_job(void *data)
{
Ecore_Evas_Engine_Drm_Data *edata;
Ecore_Evas *ee;
+ int x, y, w, h;
ee = data;
edata = ee->engine.data;
edata->tick_job = NULL;
- ecore_evas_animator_tick(ee, NULL, edata->tick_job_timestamp);
+
+ ecore_drm2_output_info_get(edata->output, &x, &y, &w, &h, NULL);
+
+ ecore_evas_animator_tick(ee, &(Eina_Rectangle){x, y, w, h},
+ edata->tick_job_timestamp);
}
static void
@@ -787,6 +809,12 @@ _drm_animator_register(Ecore_Evas *ee)
}
}
+ if (ee->animator_ticked || ee->animator_ran)
+ {
+ edata->ticking = EINA_TRUE;
+ return;
+ }
+
if (edata->tick_job) ERR("Double animator register");
else
if (!edata->ticking &&
@@ -799,11 +827,10 @@ _drm_animator_register(Ecore_Evas *ee)
+ ((double)usec / 1000000);
edata->tick_job = ecore_job_add(_tick_job, ee);
}
+ else
+ ecore_drm2_fb_flip(NULL, edata->output);
}
- if (!ecore_drm2_output_pending_get(edata->output) && !ee->in_async_render)
- ecore_drm2_fb_flip(NULL, edata->output);
-
edata->ticking = EINA_TRUE;
}
@@ -1000,11 +1027,13 @@ _ecore_evas_new_internal(const char *device, int x, int y, int w, int h, Eina_Bo
if (getenv("ECORE_EVAS_FORCE_SYNC_RENDER"))
ee->can_async_render = 0;
- ee->evas = evas_new();
- evas_data_attach_set(ee->evas, ee);
+ if (!ecore_evas_evas_new(ee, w, h))
+ {
+ ERR("Can not create a Canvas.");
+ goto eng_err;
+ }
+
evas_output_method_set(ee->evas, method);
- evas_output_size_set(ee->evas, w, h);
- evas_output_viewport_set(ee->evas, 0, 0, w, h);
if (ee->can_async_render)
evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_POST,
@@ -1059,13 +1088,7 @@ _ecore_evas_new_internal(const char *device, int x, int y, int w, int h, Eina_Bo
ecore_evas_data_set(ee, "device", edata->dev);
- _ecore_evas_register(ee);
- ecore_event_window_register(ee->prop.window, ee, ee->evas,
- (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
- (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
- (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
- (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
- _ecore_event_window_direct_cb_set(ee->prop.window, _ecore_evas_input_direct_cb);
+ ecore_evas_done(ee, EINA_FALSE);
ecore_drm2_output_info_get(edata->output, NULL, NULL, &mw, &mh, NULL);
diff --git a/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c b/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
index fd4fa7972e..93cf5eda24 100644
--- a/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
+++ b/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
@@ -1513,16 +1513,19 @@ _ecore_evas_extn_socket_prepare(Ecore_Evas *ee)
{
Extn *extn;
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
- int cur_b;
+ void *pixels = NULL;
extn = bdata->data;
if (!extn) return EINA_FALSE;
- if (bdata->pixels)
+ if (extn->b[extn->cur_b].buf)
{
- cur_b = extn->cur_b;
- bdata->pixels = _extnbuf_lock(extn->b[cur_b].buf, NULL, NULL, NULL);
- return EINA_TRUE;
+ pixels = _extnbuf_lock(extn->b[extn->cur_b].buf, NULL, NULL, NULL);
+ if (pixels)
+ {
+ bdata->pixels = pixels;
+ return EINA_TRUE;
+ }
}
return EINA_FALSE;
}
@@ -1542,27 +1545,30 @@ _ecore_evas_ews_update_image(void *data, Evas *e EINA_UNUSED, void *event_info)
prev_b = extn->prev_b;
_extnbuf_unlock(extn->b[prev_b].buf);
- EINA_LIST_FOREACH(post->updated_area, l, r)
+ if (post->updated_area)
{
- Ipc_Data_Update ipc;
- Eina_List *ll;
-
- ipc.x = r->x;
- ipc.y = r->y;
- ipc.w = r->w;
- ipc.h = r->h;
- EINA_LIST_FOREACH(extn->ipc.clients, ll, client)
- ecore_ipc_client_send(client, MAJOR, OP_UPDATE, 0, 0, 0, &ipc,
- sizeof(ipc));
- }
+ EINA_LIST_FOREACH(post->updated_area, l, r)
+ {
+ Ipc_Data_Update ipc;
+ Eina_List *ll;
+
+ ipc.x = r->x;
+ ipc.y = r->y;
+ ipc.w = r->w;
+ ipc.h = r->h;
+ EINA_LIST_FOREACH(extn->ipc.clients, ll, client)
+ ecore_ipc_client_send(client, MAJOR, OP_UPDATE, 0, 0, 0, &ipc,
+ sizeof(ipc));
+ }
- EINA_LIST_FOREACH(extn->ipc.clients, l, client)
- ecore_ipc_client_send(client, MAJOR, OP_UPDATE_DONE, 0, 0,
- prev_b, NULL, 0);
- if (extn->profile.done)
- {
- _ecore_evas_extn_socket_window_profile_change_done_send(ee);
- extn->profile.done = EINA_FALSE;
+ EINA_LIST_FOREACH(extn->ipc.clients, l, client)
+ ecore_ipc_client_send(client, MAJOR, OP_UPDATE_DONE, 0, 0,
+ prev_b, NULL, 0);
+ if (extn->profile.done)
+ {
+ _ecore_evas_extn_socket_window_profile_change_done_send(ee);
+ extn->profile.done = EINA_FALSE;
+ }
}
}
@@ -2137,7 +2143,7 @@ ecore_evas_extn_socket_new_internal(int w, int h)
ee->engine.ifaces = eina_list_append(ee->engine.ifaces, iface);
ee->rotation = 0;
- ee->visible = 0;
+ ee->visible = 1;
ee->w = w;
ee->h = h;
ee->req.w = ee->w;
@@ -2155,11 +2161,13 @@ ecore_evas_extn_socket_new_internal(int w, int h)
ee->prop.sticky = EINA_FALSE;
/* init evas here */
- ee->evas = evas_new();
- evas_data_attach_set(ee->evas, ee);
+ if (!ecore_evas_evas_new(ee, w, h))
+ {
+ ERR("Failed to create the canvas.");
+ ecore_evas_free(ee);
+ return NULL;
+ }
evas_output_method_set(ee->evas, rmethod);
- evas_output_size_set(ee->evas, w, h);
- evas_output_viewport_set(ee->evas, 0, 0, w, h);
evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_POST, _ecore_evas_ews_update_image, ee);
einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(ee->evas);
diff --git a/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c b/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c
index 7dd2ddc618..17bf83f7c1 100644
--- a/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c
+++ b/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c
@@ -4,7 +4,6 @@
#include <stdlib.h>
#include <sys/types.h>
-#include <dirent.h>
#include <Eina.h>
#include <Ecore.h>
@@ -617,22 +616,16 @@ ecore_evas_fb_new_internal(const char *disp_name, int rotation, int w, int h)
ee->prop.fullscreen = EINA_FALSE;
ee->prop.withdrawn = EINA_TRUE;
ee->prop.sticky = EINA_FALSE;
+ ee->prop.window = 1;
/* init evas here */
- ee->evas = evas_new();
- evas_data_attach_set(ee->evas, ee);
- evas_output_method_set(ee->evas, rmethod);
-
- if (ECORE_EVAS_PORTRAIT(ee))
+ if (!ecore_evas_evas_new(ee, w, h))
{
- evas_output_size_set(ee->evas, w, h);
- evas_output_viewport_set(ee->evas, 0, 0, w, h);
- }
- else
- {
- evas_output_size_set(ee->evas, h, w);
- evas_output_viewport_set(ee->evas, 0, 0, h, w);
+ ERR("Could not create the canvas.");
+ ecore_evas_free(ee);
+ return NULL;
}
+ evas_output_method_set(ee->evas, rmethod);
einfo = (Evas_Engine_Info_FB *)evas_engine_info_get(ee->evas);
if (einfo && disp_name)
@@ -655,15 +648,7 @@ ecore_evas_fb_new_internal(const char *disp_name, int rotation, int w, int h)
return NULL;
}
- ecore_evas_input_event_register(ee);
+ ecore_evas_done(ee, EINA_TRUE);
- _ecore_evas_register(ee);
- ecore_event_window_register(1, ee, ee->evas,
- (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
- (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
- (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
- (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
- _ecore_event_window_direct_cb_set(1, _ecore_evas_input_direct_cb);
- evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
return ee;
}
diff --git a/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c b/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c
index a6ddee93d2..8abc7401b6 100644
--- a/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c
+++ b/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c
@@ -510,12 +510,13 @@ _ecore_evas_internal_sdl_new(int rmethod, const char* name, int w, int h, int fu
ee->prop.hwsurface = hwsurface;
/* init evas here */
- ee->evas = evas_new();
- evas_data_attach_set(ee->evas, ee);
- evas_output_method_set(ee->evas, rmethod);
+ if (!ecore_evas_evas_new(ee, w, h))
+ {
+ ERR("Can not create Canvas.");
+ goto on_error;
+ }
- evas_output_size_set(ee->evas, w, h);
- evas_output_viewport_set(ee->evas, 0, 0, w, h);
+ evas_output_method_set(ee->evas, rmethod);
gl = !(rmethod == evas_render_method_lookup("buffer"));
ee->can_async_render = gl ? EINA_FALSE : EINA_TRUE;
@@ -611,19 +612,13 @@ _ecore_evas_internal_sdl_new(int rmethod, const char* name, int w, int h, int fu
}
_ecore_evas_sdl_init(w, h);
+ ee->prop.window = SDL_GetWindowID(swd->w);
- ecore_event_window_register(SDL_GetWindowID(swd->w), ee, ee->evas,
- (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
- (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
- (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
- (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
- _ecore_event_window_direct_cb_set(SDL_GetWindowID(swd->w), _ecore_evas_input_direct_cb);
- SDL_SetWindowData(swd->w, "_Ecore_Evas", ee);
+ ecore_evas_done(ee, EINA_FALSE);
+ SDL_SetWindowData(swd->w, "_Ecore_Evas", ee);
SDL_ShowCursor(SDL_ENABLE);
- _ecore_evas_register(ee);
-
_ecore_evas_focus_device_set(ee, NULL, EINA_TRUE);
ecore_evas_sdl_count++;
return ee;
diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
index 54daeb3259..3ca5794084 100644
--- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
+++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
@@ -55,10 +55,12 @@ _ecore_evas_wl_common_animator_register(Ecore_Evas *ee)
edata = (Ecore_Evas_Engine_Wl_Data *)ee->engine.data;
EINA_SAFETY_ON_TRUE_RETURN(edata->ticking);
+ EINA_SAFETY_ON_TRUE_RETURN(edata->frame != NULL);
edata->frame = ecore_wl2_window_frame_callback_add(edata->win,
_anim_cb_tick, ee);
- if (!ecore_wl2_window_pending_get(edata->win) && !ee->in_async_render)
+ if (!ecore_wl2_window_pending_get(edata->win) && !ee->in_async_render &&
+ !ee->animator_ticked && !ee->animator_ran && !ee->draw_block)
ecore_wl2_window_false_commit(edata->win);
edata->ticking = EINA_TRUE;
}
@@ -70,7 +72,8 @@ _ecore_evas_wl_common_animator_unregister(Ecore_Evas *ee)
edata = ee->engine.data;
edata->ticking = EINA_FALSE;
- ecore_wl2_window_frame_callback_del(edata->frame);
+ if (edata->frame)
+ ecore_wl2_window_frame_callback_del(edata->frame);
edata->frame = NULL;
}
@@ -112,9 +115,9 @@ _ecore_evas_wl_common_cb_mouse_in(void *data EINA_UNUSED, int type EINA_UNUSED,
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ev = event;
- ee = ecore_event_window_match(ev->window);
+ ee = ecore_event_window_match((Ecore_Window)ev->window);
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
- if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
+ if ((Ecore_Window)ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
if (_ecore_evas_mouse_in_check(ee, ev->dev)) return ECORE_CALLBACK_PASS_ON;
_ecore_evas_mouse_inout_set(ee, ev->dev, EINA_TRUE, EINA_FALSE);
@@ -133,9 +136,9 @@ _ecore_evas_wl_common_cb_mouse_out(void *data EINA_UNUSED, int type EINA_UNUSED,
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ev = event;
- ee = ecore_event_window_match(ev->window);
+ ee = ecore_event_window_match((Ecore_Window)ev->window);
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
- if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
+ if ((Ecore_Window)ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
if (!_ecore_evas_mouse_in_check(ee, ev->dev)) return ECORE_CALLBACK_PASS_ON;
ecore_event_evas_seat_modifier_lock_update(ee->evas,
@@ -155,9 +158,9 @@ _ecore_evas_wl_common_cb_focus_in(void *data EINA_UNUSED, int type EINA_UNUSED,
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ev = event;
- ee = ecore_event_window_match(ev->window);
+ ee = ecore_event_window_match((Ecore_Window)ev->window);
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
- if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
+ if ((Ecore_Window)ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
_ecore_evas_focus_device_set(ee, ev->dev, EINA_TRUE);
return ECORE_CALLBACK_PASS_ON;
}
@@ -171,9 +174,9 @@ _ecore_evas_wl_common_cb_focus_out(void *data EINA_UNUSED, int type EINA_UNUSED,
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ev = event;
- ee = ecore_event_window_match(ev->window);
+ ee = ecore_event_window_match((Ecore_Window)ev->window);
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
- if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
+ if ((Ecore_Window)ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
_ecore_evas_focus_device_set(ee, ev->dev, EINA_FALSE);
return ECORE_CALLBACK_PASS_ON;
}
@@ -211,12 +214,83 @@ _ecore_evas_wl_common_cb_disconnect(void *data EINA_UNUSED, int type EINA_UNUSED
wdata->defer_show = EINA_TRUE;
ee->visible = EINA_FALSE;
wdata->reset_pending = 1;
- ecore_evas_manual_render_set(ee, 1);
+ ee->draw_block = EINA_TRUE;
_ee_display_unset(ee);
}
return ECORE_CALLBACK_RENEW;
}
+static Eina_Bool
+ee_needs_alpha(Ecore_Evas *ee)
+{
+ return ee->shadow.l || ee->shadow.r || ee->shadow.t || ee->shadow.b ||
+ ee->alpha;
+}
+
+static void
+_ecore_evas_wayland_window_update(Ecore_Evas *ee, Ecore_Evas_Engine_Wl_Data *wdata, Eina_Bool new_alpha)
+{
+ Evas_Engine_Info_Wayland *einfo;
+ Eina_Bool has_shadow, needs_alpha, change;
+ int w, h, fw, fh, shw = 0, shh = 0;
+ int fullw, fullh;
+
+ einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas);
+
+ change = ee->shadow.changed || (new_alpha != ee->alpha);
+ ee->alpha = new_alpha;
+ has_shadow = ee->shadow.l || ee->shadow.r || ee->shadow.t || ee->shadow.b;
+
+ needs_alpha = ee_needs_alpha(ee);
+
+ if (einfo->info.destination_alpha != needs_alpha)
+ {
+ ecore_wl2_window_alpha_set(wdata->win, needs_alpha);
+ einfo->info.destination_alpha = needs_alpha;
+ if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
+ ERR("Failed to set Evas Engine Info for '%s'", ee->driver);
+
+ change |= EINA_TRUE;
+ }
+
+ ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
+ evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
+
+ if (has_shadow)
+ {
+ shh = ee->shadow.r + ee->shadow.l;
+ shw = ee->shadow.t + ee->shadow.b;
+ }
+
+ fullw = w + fw - shw;
+ fullh = h + fh - shh;
+
+ if (has_shadow && !ee->alpha)
+ {
+ ecore_wl2_window_opaque_region_set(wdata->win,
+ ee->shadow.l, ee->shadow.t,
+ fullw, fullh);
+ }
+ else
+ {
+ ecore_wl2_window_opaque_region_set(wdata->win, 0, 0, 0, 0);
+ }
+ ecore_wl2_window_input_region_set(wdata->win,
+ ee->shadow.l, ee->shadow.t,
+ fullw, fullh);
+ ecore_wl2_window_geometry_set(wdata->win,
+ ee->shadow.l, ee->shadow.t,
+ fullw, fullh);
+ if (!change) return;
+
+ if (ECORE_EVAS_PORTRAIT(ee))
+ evas_damage_rectangle_add(ee->evas, 0, 0, fullw, fullh);
+ else
+ evas_damage_rectangle_add(ee->evas, 0, 0, fullh, fullw);
+
+ ee->shadow.changed = EINA_FALSE;
+}
+
static void
_ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h)
{
@@ -241,6 +315,17 @@ _ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h)
ee->w = w;
ee->h = h;
+ if (wdata->win->xdg_set_min_size && wdata->win->xdg_toplevel && wdata->win->pending.min)
+ {
+ wdata->win->xdg_set_min_size(wdata->win->xdg_toplevel, ee->prop.min.w, ee->prop.min.h);
+ wdata->win->pending.min = 0;
+ }
+ if (wdata->win->xdg_set_max_size && wdata->win->xdg_toplevel && wdata->win->pending.max)
+ {
+ wdata->win->xdg_set_max_size(wdata->win->xdg_toplevel, ee->prop.max.w, ee->prop.max.h);
+ wdata->win->pending.max = 0;
+ }
+
if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel && wdata->win->pending.min)
{
wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, ee->prop.min.w, ee->prop.min.h);
@@ -375,7 +460,10 @@ _ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h)
}
}
- evas_output_size_get(ee->evas, &ow, &oh);
+ if (ECORE_EVAS_PORTRAIT(ee))
+ evas_output_size_get(ee->evas, &ow, &oh);
+ else
+ evas_output_size_get(ee->evas, &oh, &ow);
if (ECORE_EVAS_PORTRAIT(ee) && ((ow != w) || (oh != h)))
diff = 1;
@@ -406,6 +494,7 @@ _ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h)
if (ee->func.fn_resize) ee->func.fn_resize(ee);
}
+ _ecore_evas_wayland_window_update(ee, wdata, ee->alpha);
}
static void
@@ -477,15 +566,16 @@ _ecore_evas_wl_common_cb_window_configure(void *data EINA_UNUSED, int type EINA_
Ecore_Evas *ee;
Ecore_Evas_Engine_Wl_Data *wdata;
Ecore_Wl2_Event_Window_Configure *ev;
- int nw = 0, nh = 0, fw, fh, pfw, pfh;
- Eina_Bool active, prev_max, prev_full, state_change = EINA_FALSE;
+ int nw = 0, nh = 0, fw, fh, sw, sh, contentw, contenth;
+ int framew, frameh;
+ Eina_Bool active, prev_max, prev_full;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ev = event;
- ee = ecore_event_window_match(ev->win);
+ ee = ecore_event_window_match((Ecore_Window)ev->win);
if (!ee) return ECORE_CALLBACK_PASS_ON;
- if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
+ if ((Ecore_Window)ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
wdata = ee->engine.data;
if (!wdata) return ECORE_CALLBACK_PASS_ON;
@@ -505,32 +595,29 @@ _ecore_evas_wl_common_cb_window_configure(void *data EINA_UNUSED, int type EINA_
nw = ev->w;
nh = ev->h;
- pfw = fw = wdata->win->set_config.geometry.w - wdata->content.w;
- pfh = fh = wdata->win->set_config.geometry.h - wdata->content.h;
+ sw = ee->shadow.l + ee->shadow.r;
+ sh = ee->shadow.t + ee->shadow.b;
+ evas_output_framespace_get(ee->evas, NULL, NULL, &framew, &frameh);
+ contentw = wdata->win->set_config.geometry.w - (framew - sw);
+ contenth = wdata->win->set_config.geometry.h - (frameh - sh);
+ fw = wdata->win->set_config.geometry.w - contentw;
+ fh = wdata->win->set_config.geometry.h - contenth;
if ((prev_max != ee->prop.maximized) ||
(prev_full != ee->prop.fullscreen) ||
(active != wdata->activated))
{
- state_change = EINA_TRUE;
_ecore_evas_wl_common_state_update(ee);
- fw = wdata->win->set_config.geometry.w - wdata->content.w;
- fh = wdata->win->set_config.geometry.h - wdata->content.h;
+ sw = ee->shadow.l + ee->shadow.r;
+ sh = ee->shadow.t + ee->shadow.b;
+ evas_output_framespace_get(ee->evas, NULL, NULL, &framew, &frameh);
+ contentw = wdata->win->set_config.geometry.w - (framew - sw);
+ contenth = wdata->win->set_config.geometry.h - (frameh - sh);
+ fw = wdata->win->set_config.geometry.w - contentw;
+ fh = wdata->win->set_config.geometry.h - contenth;
}
-
if ((!nw) && (!nh))
- {
- if ((wdata->win->set_config.serial != wdata->win->req_config.serial) &&
- wdata->win->req_config.serial && wdata->win->surface &&
- ((!state_change) || ((pfw == fw) && (pfh == fh))))
- {
- if (wdata->win->zxdg_configure_ack)
- wdata->win->zxdg_configure_ack(wdata->win->zxdg_surface,
- wdata->win->req_config.serial);
- wdata->win->set_config.serial = wdata->win->req_config.serial;
- }
- return ECORE_CALLBACK_RENEW;
- }
+ return ECORE_CALLBACK_RENEW;
if (!ee->prop.borderless)
{
@@ -583,6 +670,8 @@ _ecore_evas_wl_common_cb_window_configure(void *data EINA_UNUSED, int type EINA_
}
}
+ _ecore_evas_wayland_window_update(ee, wdata, ee->alpha);
+
return ECORE_CALLBACK_PASS_ON;
}
@@ -597,10 +686,10 @@ _ecore_evas_wl_common_cb_window_configure_complete(void *data EINA_UNUSED, int t
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ev = event;
- ee = ecore_event_window_match(ev->win);
+ ee = ecore_event_window_match((Ecore_Window)ev->win);
if (!ee) return ECORE_CALLBACK_PASS_ON;
- if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
+ if ((Ecore_Window)ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas);
if (!einfo) return ECORE_CALLBACK_PASS_ON;
@@ -610,8 +699,8 @@ _ecore_evas_wl_common_cb_window_configure_complete(void *data EINA_UNUSED, int t
ERR("Failed to set Evas Engine Info for '%s'", ee->driver);
wdata = ee->engine.data;
+ ee->draw_block = EINA_FALSE;
if (wdata->frame) ecore_evas_manual_render(ee);
- ecore_evas_manual_render_set(ee, 0);
return ECORE_CALLBACK_PASS_ON;
}
@@ -623,9 +712,9 @@ _ecore_evas_wl_common_cb_aux_message(void *data EINA_UNUSED, int type EINA_UNUS
Ecore_Wl2_Event_Aux_Message *ev;
ev = event;
- ee = ecore_event_window_match(ev->win);
+ ee = ecore_event_window_match((Ecore_Window)ev->win);
if (!ee) return ECORE_CALLBACK_PASS_ON;
- if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
+ if ((Ecore_Window)ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
if (eina_streq(ev->key, "stack_del"))
{
if (ee->func.fn_delete_request)
@@ -643,9 +732,9 @@ _ecore_evas_wl_common_cb_aux_hint_supported(void *data EINA_UNUSED, int type EI
Ecore_Evas_Engine_Wl_Data *wdata;
ev = event;
- ee = ecore_event_window_match(ev->win);
+ ee = ecore_event_window_match((Ecore_Window)ev->win);
if (!ee) return ECORE_CALLBACK_PASS_ON;
- if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
+ if ((Ecore_Window)ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
wdata = ee->engine.data;
EINA_LIST_FREE(ee->prop.aux_hint.supported_list, hint) eina_stringshare_del(hint);
ee->prop.aux_hint.supported_list = ecore_wl2_window_aux_hints_supported_get(wdata->win);
@@ -661,9 +750,9 @@ _ecore_evas_wl_common_cb_aux_hint_allowed(void *data EINA_UNUSED, int type EINA
Ecore_Evas_Aux_Hint *aux;
ev = event;
- ee = ecore_event_window_match(ev->win);
+ ee = ecore_event_window_match((Ecore_Window)ev->win);
if (!ee) return ECORE_CALLBACK_PASS_ON;
- if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
+ if ((Ecore_Window)ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
EINA_LIST_FOREACH(ee->prop.aux_hint.hints, l, aux)
{
@@ -690,9 +779,9 @@ _ecore_evas_wl_common_cb_window_rotate(void *data EINA_UNUSED, int type EINA_UNU
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ev = event;
- ee = ecore_event_window_match(ev->win);
+ ee = ecore_event_window_match((Ecore_Window)ev->win);
if (!ee) return ECORE_CALLBACK_PASS_ON;
- if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
+ if ((Ecore_Window)ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
_ecore_evas_wl_common_rotation_set(ee, ev->rotation, ev->resize);
return ECORE_CALLBACK_PASS_ON;
}
@@ -858,9 +947,9 @@ _ecore_evas_wl_common_cb_www_drag(void *d EINA_UNUSED, int t EINA_UNUSED, void *
Ecore_Evas_Engine_Wl_Data *wdata;
Ecore_Evas *ee;
- ee = ecore_event_window_match(ev->window);
+ ee = ecore_event_window_match((Ecore_Window)ev->window);
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
- if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
+ if ((Ecore_Window)ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
wdata = ee->engine.data;
wdata->dragging = !!ev->dragging;
@@ -876,9 +965,9 @@ _ecore_evas_wl_common_cb_www(void *d EINA_UNUSED, int t EINA_UNUSED, void *event
Ecore_Evas_Engine_Wl_Data *wdata;
Ecore_Evas *ee;
- ee = ecore_event_window_match(ev->window);
+ ee = ecore_event_window_match((Ecore_Window)ev->window);
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
- if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
+ if ((Ecore_Window)ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
wdata = ee->engine.data;
wdata->x_rel += ev->x_rel;
@@ -906,14 +995,14 @@ _ecore_evas_wl_common_device_event_add(int event_type, Ecore_Wl2_Device_Type dev
ev->dev = efl_ref(dev);
ev->type = device_type;
ev->seat_id = id;
- ev->window_id = ee->prop.window;
+ ev->window = (Ecore_Wl2_Window *)ee->prop.window;
ecore_event_add(event_type, ev,
_ecore_evas_wl_common_cb_device_event_free, dev);
}
static EE_Wl_Device *
-_ecore_evas_wl_common_seat_add(Ecore_Evas *ee, unsigned int id)
+_ecore_evas_wl_common_seat_add(Ecore_Evas *ee, unsigned int id, const char *name)
{
Ecore_Evas_Engine_Wl_Data *wdata;
EE_Wl_Device *device;
@@ -923,9 +1012,13 @@ _ecore_evas_wl_common_seat_add(Ecore_Evas *ee, unsigned int id)
device = calloc(1, sizeof(EE_Wl_Device));
EINA_SAFETY_ON_NULL_RETURN_VAL(device, NULL);
- snprintf(buf, sizeof(buf), "seat-%u", id);
+ if (!name)
+ {
+ snprintf(buf, sizeof(buf), "seat-%u", id);
+ name = buf;
+ }
dev =
- evas_device_add_full(ee->evas, buf, "Wayland seat", NULL, NULL,
+ evas_device_add_full(ee->evas, name, "Wayland seat", NULL, NULL,
EVAS_DEVICE_CLASS_SEAT, EVAS_DEVICE_SUBCLASS_NONE);
EINA_SAFETY_ON_NULL_GOTO(dev, err_dev);
evas_device_seat_id_set(dev, id);
@@ -973,7 +1066,7 @@ _ecore_evas_wl_common_cb_global_added(void *d EINA_UNUSED, int t EINA_UNUSED, vo
if (already_present)
continue;
- if (!_ecore_evas_wl_common_seat_add(ee, ev->id))
+ if (!_ecore_evas_wl_common_seat_add(ee, ev->id, NULL))
break;
}
@@ -1103,7 +1196,8 @@ _ecore_evas_wl_common_cb_seat_capabilities_changed(void *d EINA_UNUSED, int t EI
{
_ecore_evas_wl_common_device_event_add
(ECORE_WL2_EVENT_DEVICE_REMOVED,
- ECORE_WL2_DEVICE_TYPE_POINTER, ev->id, NULL, ee);
+ ECORE_WL2_DEVICE_TYPE_POINTER, ev->id,
+ device->pointer, ee);
evas_device_del(device->pointer);
device->pointer = NULL;
@@ -1127,7 +1221,8 @@ _ecore_evas_wl_common_cb_seat_capabilities_changed(void *d EINA_UNUSED, int t EI
{
_ecore_evas_wl_common_device_event_add
(ECORE_WL2_EVENT_DEVICE_REMOVED,
- ECORE_WL2_DEVICE_TYPE_KEYBOARD, ev->id, NULL, ee);
+ ECORE_WL2_DEVICE_TYPE_KEYBOARD, ev->id,
+ device->keyboard, ee);
evas_device_del(device->keyboard);
device->keyboard = NULL;
@@ -1152,7 +1247,7 @@ _ecore_evas_wl_common_cb_seat_capabilities_changed(void *d EINA_UNUSED, int t EI
_ecore_evas_wl_common_device_event_add
(ECORE_WL2_EVENT_DEVICE_REMOVED,
ECORE_WL2_DEVICE_TYPE_TOUCH,
- ev->id, NULL, ee);
+ ev->id, device->touch, ee);
evas_device_del(device->touch);
device->touch = NULL;
@@ -1173,10 +1268,10 @@ _ecore_evas_wl_common_cb_iconify_state_change(void *data EINA_UNUSED, int type E
Ecore_Wl2_Event_Window_Iconify_State_Change *ev;
ev = event;
- ee = ecore_event_window_match(ev->win);
+ ee = ecore_event_window_match((Ecore_Window)ev->win);
if (!ee) return ECORE_CALLBACK_PASS_ON;
if (!ev->force) return ECORE_CALLBACK_PASS_ON;
- if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
+ if ((Ecore_Window)ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
if (ee->prop.iconified == ev->iconified)
return ECORE_CALLBACK_PASS_ON;
@@ -1318,7 +1413,6 @@ _ecore_evas_wl_common_free(Ecore_Evas *ee)
free(wdata);
ecore_event_window_unregister(ee->prop.window);
- ecore_evas_input_event_unregister(ee);
_ecore_evas_wl_common_shutdown();
@@ -1488,18 +1582,6 @@ _ecore_evas_wl_common_aux_hints_supported_update(Ecore_Evas *ee)
}
static void
-_ecore_evas_wl_common_raise(Ecore_Evas *ee)
-{
- Ecore_Evas_Engine_Wl_Data *wdata;
-
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
- if (!ee) return;
- wdata = ee->engine.data;
- ecore_wl2_window_raise(wdata->win);
-}
-
-static void
_ecore_evas_wl_common_title_set(Ecore_Evas *ee, const char *title)
{
Ecore_Evas_Engine_Wl_Data *wdata;
@@ -1558,6 +1640,11 @@ _ecore_evas_wl_common_size_min_set(Ecore_Evas *ee, int w, int h)
ee->prop.min.w = w;
ee->prop.min.h = h;
wdata = ee->engine.data;
+ if (wdata->win->xdg_set_min_size && wdata->win->xdg_toplevel)
+ {
+ wdata->win->xdg_set_min_size(wdata->win->xdg_toplevel, w, h);
+ wdata->win->pending.min = 0;
+ }
if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel)
{
wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, w, h);
@@ -1581,6 +1668,11 @@ _ecore_evas_wl_common_size_max_set(Ecore_Evas *ee, int w, int h)
ee->prop.max.w = w;
ee->prop.max.h = h;
wdata = ee->engine.data;
+ if (wdata->win->xdg_set_max_size && wdata->win->xdg_toplevel)
+ {
+ wdata->win->xdg_set_max_size(wdata->win->xdg_toplevel, w, h);
+ wdata->win->pending.max = 0;
+ }
if (wdata->win->zxdg_set_max_size && wdata->win->zxdg_toplevel)
{
wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, w, h);
@@ -1786,61 +1878,22 @@ _ecore_evas_wl_common_render_flush_pre(void *data, Evas *evas, void *event EINA_
static void
_ecore_evas_wayland_alpha_do(Ecore_Evas *ee, int alpha)
{
- Evas_Engine_Info_Wayland *einfo;
Ecore_Evas_Engine_Wl_Data *wdata;
- int fw, fh;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ee) return;
if (ee->alpha == alpha) return;
- ee->alpha = alpha;
- wdata = ee->engine.data;
- if (!wdata->sync_done) return;
-
- if (wdata->win) ecore_wl2_window_alpha_set(wdata->win, ee->alpha);
-
- _ecore_evas_wl_common_wm_rotation_protocol_set(ee);
-
- evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
-
- if ((einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas)))
- {
- einfo->info.destination_alpha = EINA_TRUE;
- if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
- ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
- evas_damage_rectangle_add(ee->evas, 0, 0, ee->w + fw, ee->h + fh);
- }
-}
-
-static void
-_ecore_evas_wayland_transparent_do(Ecore_Evas *ee, int transparent)
-{
- Evas_Engine_Info_Wayland *einfo;
- Ecore_Evas_Engine_Wl_Data *wdata;
- int fw, fh;
-
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
- if (!ee) return;
- if (ee->transparent == transparent) return;
- ee->transparent = transparent;
wdata = ee->engine.data;
- if (!wdata->sync_done) return;
-
- if (wdata->win)
- ecore_wl2_window_transparent_set(wdata->win, ee->transparent);
-
- evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
-
- if ((einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas)))
+ if (!wdata->sync_done)
{
- einfo->info.destination_alpha = EINA_TRUE;
- if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
- ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
- evas_damage_rectangle_add(ee->evas, 0, 0, ee->w + fw, ee->h + fh);
+ ee->alpha = alpha;
+ return;
}
+ _ecore_evas_wayland_window_update(ee, wdata, alpha);
+
+ _ecore_evas_wl_common_wm_rotation_protocol_set(ee);
}
static void
@@ -1853,11 +1906,6 @@ _ecore_evas_wl_common_render_updates(void *data, Evas *evas EINA_UNUSED, void *e
_ecore_evas_wayland_alpha_do(ee, ee->delayed.alpha);
ee->delayed.alpha_changed = EINA_FALSE;
}
- if (ee->delayed.transparent_changed)
- {
- _ecore_evas_wayland_transparent_do(ee, ee->delayed.transparent);
- ee->delayed.transparent_changed = EINA_FALSE;
- }
if (ee->delayed.rotation_changed)
{
_rotation_do(ee, ee->delayed.rotation, ee->delayed.rotation_resize);
@@ -1910,33 +1958,29 @@ _ecore_evas_wl_common_screen_geometry_get(const Ecore_Evas *ee, int *x, int *y,
}
static void
-_ecore_evas_wl_common_screen_dpi_get(const Ecore_Evas *ee EINA_UNUSED, int *xdpi, int *ydpi)
+_ecore_evas_wl_common_screen_dpi_get(const Ecore_Evas *ee, int *xdpi, int *ydpi)
{
+ Ecore_Wl2_Window *win;
+ Ecore_Wl2_Output *output;
int dpi = 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ if (!ee) return;
if (xdpi) *xdpi = 0;
if (ydpi) *ydpi = 0;
/* FIXME: Ideally this needs to get the DPI from a specific screen */
- /* TODO */
- /* dpi = ecore_wl_dpi_get(); */
+ win = ecore_evas_wayland2_window_get(ee);
+ output = ecore_wl2_window_output_find(win);
+ dpi = ecore_wl2_output_dpi_get(output);
+
if (xdpi) *xdpi = dpi;
if (ydpi) *ydpi = dpi;
}
static void
-_ecore_evas_wayland_resize_edge_set(Ecore_Evas *ee, int edge)
-{
- Evas_Engine_Info_Wayland *einfo;
-
- if ((einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas)))
- einfo->info.edges = edge;
-}
-
-static void
_ecore_evas_wayland_resize(Ecore_Evas *ee, int location)
{
Ecore_Evas_Engine_Wl_Data *wdata;
@@ -1946,10 +1990,7 @@ _ecore_evas_wayland_resize(Ecore_Evas *ee, int location)
if (!ee) return;
wdata = ee->engine.data;
if (wdata->win)
- {
- _ecore_evas_wayland_resize_edge_set(ee, location);
- ecore_wl2_window_resize(wdata->win, NULL, location);
- }
+ ecore_wl2_window_resize(wdata->win, NULL, location);
}
static void
@@ -2062,11 +2103,22 @@ _ecore_evas_wl_common_show(Ecore_Evas *ee)
wdata->defer_show = EINA_TRUE;
return;
}
+ ee->visible = 1;
if (wdata->win)
{
int fw, fh;
+ if (wdata->win->xdg_set_min_size && wdata->win->xdg_toplevel && wdata->win->pending.min)
+ {
+ wdata->win->xdg_set_min_size(wdata->win->xdg_toplevel, ee->prop.min.w, ee->prop.min.h);
+ wdata->win->pending.min = 0;
+ }
+ if (wdata->win->xdg_set_max_size && wdata->win->xdg_toplevel && wdata->win->pending.max)
+ {
+ wdata->win->xdg_set_max_size(wdata->win->xdg_toplevel, ee->prop.max.w, ee->prop.max.h);
+ wdata->win->pending.max = 0;
+ }
if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel && wdata->win->pending.min)
{
wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, ee->prop.min.w, ee->prop.min.h);
@@ -2078,15 +2130,15 @@ _ecore_evas_wl_common_show(Ecore_Evas *ee)
wdata->win->pending.max = 0;
}
+ _ecore_evas_wayland_window_update(ee, wdata, ee->alpha);
+
evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
- ecore_wl2_window_geometry_set(wdata->win, 0, 0, ee->w, ee->h);
ecore_wl2_window_show(wdata->win);
- ecore_wl2_window_alpha_set(wdata->win, ee->alpha);
-
einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas);
if (einfo)
{
+ einfo->info.destination_alpha = ee_needs_alpha(ee);
einfo->info.wl2_win = wdata->win;
einfo->info.hidden = wdata->win->pending.configure; //EINA_FALSE;
einfo->www_avail = !!wdata->win->www_surface;
@@ -2103,10 +2155,7 @@ _ecore_evas_wl_common_show(Ecore_Evas *ee)
ee->prop.withdrawn = EINA_FALSE;
if (ee->func.fn_state_change) ee->func.fn_state_change(ee);
- if (ee->visible) return;
- ee->visible = 1;
ee->should_be_visible = 1;
- ee->draw_ok = EINA_TRUE;
if (ee->func.fn_show) ee->func.fn_show(ee);
}
@@ -2145,7 +2194,6 @@ _ecore_evas_wl_common_hide(Ecore_Evas *ee)
if (!ee->visible) return;
ee->visible = 0;
ee->should_be_visible = 0;
- ee->draw_ok = EINA_FALSE;
if (ee->func.fn_hide) ee->func.fn_hide(ee);
}
@@ -2164,19 +2212,6 @@ _ecore_evas_wl_common_alpha_set(Ecore_Evas *ee, int alpha)
}
static void
-_ecore_evas_wl_common_transparent_set(Ecore_Evas *ee, int transparent)
-{
- if (ee->in_async_render)
- {
- ee->delayed.transparent = transparent;
- ee->delayed.transparent_changed = EINA_TRUE;
- return;
- }
-
- _ecore_evas_wayland_transparent_do(ee, transparent);
-}
-
-static void
_ecore_evas_wl_common_rotation_set(Ecore_Evas *ee, int rotation, int resize)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -2207,13 +2242,13 @@ _ee_cb_sync_done(void *data, int type EINA_UNUSED, void *event EINA_UNUSED)
if ((einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas)))
{
- einfo->info.destination_alpha = EINA_TRUE;
+ einfo->info.destination_alpha = ee_needs_alpha(ee);
einfo->info.rotation = ee->rotation;
einfo->info.wl2_win = wdata->win;
if (wdata->reset_pending)
{
- ecore_evas_manual_render_set(ee, 0);
+ ee->draw_block = EINA_FALSE;
}
if (evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
{
@@ -2252,10 +2287,12 @@ _ecore_wl2_devices_setup(Ecore_Evas *ee, Ecore_Wl2_Display *display)
EE_Wl_Device *device;
Ecore_Wl2_Seat_Capabilities cap;
unsigned int id;
+ Eina_Stringshare *name;
id = ecore_wl2_input_seat_id_get(input);
cap = ecore_wl2_input_seat_capabilities_get(input);
- device = _ecore_evas_wl_common_seat_add(ee, id);
+ name = ecore_wl2_input_name_get(input);
+ device = _ecore_evas_wl_common_seat_add(ee, id, name);
if (!device)
{
@@ -2332,7 +2369,7 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
NULL, // shaped_set
_ecore_evas_wl_common_show,
_ecore_evas_wl_common_hide,
- _ecore_evas_wl_common_raise,
+ NULL, // raise
NULL, // lower
NULL, // activate
_ecore_evas_wl_common_title_set,
@@ -2355,7 +2392,7 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
NULL, // func sticky set
_ecore_evas_wl_common_ignore_events_set,
_ecore_evas_wl_common_alpha_set,
- _ecore_evas_wl_common_transparent_set,
+ _ecore_evas_wl_common_alpha_set, // transparent set
NULL, // func profiles set
NULL, // func profile set
NULL, // window group set
@@ -2395,7 +2432,7 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
};
Ecore_Evas *
-_ecore_evas_wl_common_new_internal(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame, const char *engine_name)
+_ecore_evas_wl_common_new_internal(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame, const char *engine_name)
{
Ecore_Wl2_Display *ewd;
Ecore_Wl2_Window *p = NULL;
@@ -2404,7 +2441,6 @@ _ecore_evas_wl_common_new_internal(const char *disp_name, unsigned int parent, i
Ecore_Evas_Interface_Wayland *iface;
Ecore_Evas *ee = NULL;
int method = 0;
- int fw = 0, fh = 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -2475,26 +2511,24 @@ _ecore_evas_wl_common_new_internal(const char *disp_name, unsigned int parent, i
else
ee->can_async_render = 1;
- if (parent)
- {
- p = ecore_wl2_display_window_find(ewd, parent);
- ee->alpha = ecore_wl2_window_alpha_get(p);
- }
+ if (parent) ee->alpha = ecore_wl2_window_alpha_get((Ecore_Wl2_Window *)parent);
wdata->sync_done = EINA_FALSE;
wdata->parent = p;
wdata->display = ewd;
- wdata->win = ecore_wl2_window_new(ewd, p, x, y, w + fw, h + fh);
- ee->prop.window = ecore_wl2_window_id_get(wdata->win);
+ wdata->win = ecore_wl2_window_new(ewd, p, x, y, w, h);
+ ee->prop.window = (Ecore_Window)wdata->win;
ee->prop.aux_hint.supported_list = ecore_wl2_window_aux_hints_supported_get(wdata->win);
ecore_evas_aux_hint_add(ee, "wm.policy.win.msg.use", "1");
- ee->evas = evas_new();
- evas_data_attach_set(ee->evas, ee);
+ if (!ecore_evas_evas_new(ee, ee->w, ee->h))
+ {
+ ERR("Can not create Canvas.");
+ goto eng_err;
+ }
+
evas_output_method_set(ee->evas, method);
- evas_output_size_set(ee->evas, ee->w + fw, ee->h + fh);
- evas_output_viewport_set(ee->evas, 0, 0, ee->w + fw, ee->h + fh);
evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_POST,
_ecore_evas_wl_common_render_updates, ee);
@@ -2507,7 +2541,7 @@ _ecore_evas_wl_common_new_internal(const char *disp_name, unsigned int parent, i
wdata->sync_done = EINA_TRUE;
if ((einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas)))
{
- einfo->info.destination_alpha = EINA_TRUE;
+ einfo->info.destination_alpha = ee_needs_alpha(ee);
einfo->info.rotation = ee->rotation;
einfo->info.depth = 32;
einfo->info.wl2_win = wdata->win;
@@ -2534,29 +2568,22 @@ _ecore_evas_wl_common_new_internal(const char *disp_name, unsigned int parent, i
_ecore_evas_wl_common_wm_rotation_protocol_set(ee);
- _ecore_evas_register(ee);
- ecore_evas_input_event_register(ee);
-
- ecore_event_window_register(ee->prop.window, ee, ee->evas,
- (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
- (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
- (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
- (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
- _ecore_event_window_direct_cb_set(ee->prop.window,
- _ecore_evas_input_direct_cb);
+ ecore_evas_done(ee, EINA_FALSE);
wdata->sync_handler =
ecore_event_handler_add(ECORE_WL2_EVENT_SYNC_DONE, _ee_cb_sync_done, ee);
ee_list = eina_list_append(ee_list, ee);
- ecore_evas_manual_render_set(ee, 1);
+ ee->draw_block = EINA_TRUE;
return ee;
eng_err:
/* ecore_evas_free() will call ecore_wl2_display_disconnect()
- * and free(ee) */
+ * and free(ee), it will also call ecore_wl2_shutdown(), so we
+ * take an extra reference here to keep the count right. */
+ ecore_wl2_init();
ecore_evas_free(ee);
ee = NULL;
w_err:
diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h
index 07832c6e72..217096f275 100644
--- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h
+++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h
@@ -40,7 +40,6 @@ struct _Ecore_Evas_Engine_Wl_Data
Ecore_Wl2_Window *parent, *win;
Ecore_Event_Handler *sync_handler;
int fx, fy, fw, fh;
- Eina_Rectangle content;
Ecore_Wl2_Frame_Cb_Handle *frame;
int x_rel;
int y_rel;
@@ -96,6 +95,6 @@ struct _Ecore_Evas_Engine_Wl_Data
* @see ecore_evas_wayland_shm_new()
* @see ecore_evas_wayland_egl_new()
*/
-Ecore_Evas *_ecore_evas_wl_common_new_internal(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame, const char *engine_name);
+Ecore_Evas *_ecore_evas_wl_common_new_internal(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame, const char *engine_name);
#endif /* _ECORE_EVAS_WAYLAND_PRIVATE_H_ */
diff --git a/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c b/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
index 46c795b60b..9a5bd15914 100644
--- a/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
+++ b/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
@@ -342,6 +342,7 @@ _ecore_evas_win32_event_window_configure(void *data EINA_UNUSED, int type EINA_U
if (!ee) return ECORE_CALLBACK_PASS_ON;
if ((Ecore_Window)e->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
+ ee->draw_block = EINA_FALSE;
pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_TYPE_MOUSE);
pointer = evas_device_parent_get(pointer);
cursor = eina_hash_find(ee->prop.cursors, &pointer);
@@ -563,36 +564,13 @@ static void
_ecore_evas_win32_resize(Ecore_Evas *ee, int width, int height)
{
INF("ecore evas resize (%dx%d)", width, height);
- ee->req.w = width;
- ee->req.h = height;
- if ((ee->w != width) || (ee->h != height))
+ if ((ee->req.w != width) || (ee->req.h != height))
{
- ee->w = width;
- ee->h = height;
+ ee->req.w = width;
+ ee->req.h = height;
ecore_win32_window_resize((Ecore_Win32_Window *)ee->prop.window,
width, height);
- if (ECORE_EVAS_PORTRAIT(ee))
- {
- evas_output_size_set(ee->evas, ee->w, ee->h);
- evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
- }
- else
- {
- evas_output_size_set(ee->evas, ee->h, ee->w);
- evas_output_viewport_set(ee->evas, 0, 0, ee->h, ee->w);
- }
- if (ee->prop.avoid_damage)
- {
- int pdam;
-
- pdam = ecore_evas_avoid_damage_get(ee);
- ecore_evas_avoid_damage_set(ee, 0);
- ecore_evas_avoid_damage_set(ee, pdam);
- }
-/* if ((ee->shaped) || (ee->alpha)) */
-/* _ecore_evas_win32_region_border_resize(ee); */
- if (ee->func.fn_resize) ee->func.fn_resize(ee);
}
}
@@ -1334,7 +1312,6 @@ _ecore_evas_engine_software_gdi_init(Ecore_Evas *ee)
{
/* FIXME: REDRAW_DEBUG missing for now */
einfo->info.window = ((Ecore_Win32_Window *)ee->prop.window)->window;
- einfo->info.depth = ecore_win32_screen_depth_get();
einfo->info.rotation = 0;
einfo->info.borderless = 0;
einfo->info.fullscreen = 0;
@@ -1377,7 +1354,6 @@ _ecore_evas_engine_software_ddraw_init(Ecore_Evas *ee)
{
/* FIXME: REDRAW_DEBUG missing for now */
einfo->info.window = ((Ecore_Win32_Window *)ee->prop.window)->window;
- einfo->info.depth = ecore_win32_screen_depth_get();
einfo->info.rotation = 0;
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
{
@@ -1441,6 +1417,7 @@ _ecore_evas_win32_new_internal(int (*_ecore_evas_engine_backend_init)(Ecore_Evas
ee->req.w = ee->w;
ee->req.h = ee->h;
ee->can_async_render = EINA_FALSE;
+ ee->draw_block = EINA_TRUE;
ee->prop.max.w = 32767;
ee->prop.max.h = 32767;
@@ -1452,10 +1429,12 @@ _ecore_evas_win32_new_internal(int (*_ecore_evas_engine_backend_init)(Ecore_Evas
ee->prop.withdrawn = EINA_TRUE;
/* init evas here */
- ee->evas = evas_new();
- evas_data_attach_set(ee->evas, ee);
- evas_output_size_set(ee->evas, width, height);
- evas_output_viewport_set(ee->evas, 0, 0, width, height);
+ if (!ecore_evas_evas_new(ee, width, height))
+ {
+ ERR("Can not create Canvas.");
+ free(ee);
+ return NULL;
+ }
wdata->parent = parent;
ee->prop.window = (Ecore_Window)ecore_win32_window_new(parent, x, y, width, height);
@@ -1473,13 +1452,7 @@ _ecore_evas_win32_new_internal(int (*_ecore_evas_engine_backend_init)(Ecore_Evas
return NULL;
}
- _ecore_evas_register(ee);
- ecore_event_window_register(ee->prop.window, ee, ee->evas,
- (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
- (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
- (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
- (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
- _ecore_event_window_direct_cb_set(ee->prop.window, _ecore_evas_input_direct_cb);
+ ecore_evas_done(ee, EINA_FALSE);
return ee;
}
diff --git a/src/modules/ecore_evas/engines/x/ecore_evas_x.c b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
index 88779a2a7c..4cfafcdd67 100644
--- a/src/modules/ecore_evas/engines/x/ecore_evas_x.c
+++ b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
@@ -53,7 +53,7 @@
static int _ecore_evas_init_count = 0;
-static Ecore_Event_Handler *ecore_evas_event_handlers[13];
+static Ecore_Event_Handler *ecore_evas_event_handlers[14];
static int leader_ref = 0;
static Ecore_X_Window leader_win = 0;
@@ -131,6 +131,8 @@ struct _Ecore_Evas_Engine_Data_X11 {
unsigned long colormap; // store colormap used to create pixmap
} pixmap;
Eina_Bool destroyed : 1; // X window has been deleted and cannot be used
+ Eina_Bool fully_obscured : 1; // X window is fully obscured
+ Eina_Bool configured : 1; // X window has been configured
};
static Ecore_Evas_Interface_X11 * _ecore_evas_x_interface_x11_new(void);
@@ -227,6 +229,7 @@ _ecore_evas_x_protocols_set(Ecore_Evas *ee)
Ecore_X_Atom protos[3];
unsigned int num = 0, tmp = 0;
+ if (ee->deleted) return;
if (ee->func.fn_delete_request)
protos[num++] = ECORE_X_ATOM_WM_DELETE_WINDOW;
protos[num++] = ECORE_X_ATOM_NET_WM_PING;
@@ -254,6 +257,7 @@ _ecore_evas_x_sync_set(Ecore_Evas *ee)
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
Ecore_X_Sync_Counter sync_counter = edata->sync_counter;
+ if (ee->deleted) return;
if (((ee->should_be_visible) || (ee->visible)) &&
((ecore_x_e_comp_sync_supported_get(edata->win_root)) &&
(!ee->no_comp_sync) && (_ecore_evas_app_comp_sync)))
@@ -670,7 +674,7 @@ _render_updates_process(Ecore_Evas *ee, Eina_List *updates)
}
}
}
- else if (((ee->visible) && (ee->draw_ok)) ||
+ else if (((ee->visible) && (!ee->draw_block)) ||
((ee->should_be_visible) && (ee->prop.fullscreen)) ||
((ee->should_be_visible) && (ee->prop.override)))
{
@@ -1063,18 +1067,44 @@ _ecore_evas_x_event_visibility_change(void *data EINA_UNUSED, int type EINA_UNUS
edata = ee->engine.data;
if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
// printf("VIS CHANGE OBSCURED: %p %i\n", ee, e->fully_obscured);
+ edata->fully_obscured = e->fully_obscured;
if (e->fully_obscured)
{
/* FIXME: round trip */
if (!ecore_x_screen_is_composited(edata->screen_num))
- ee->draw_ok = 0;
+ ee->draw_block = !edata->configured;
+ }
+ else if (ee->draw_block)
+ {
+ if (!edata->configure_coming)
+ edata->configured = 1;
+ ee->draw_block = !edata->configured;
}
- else
- ee->draw_ok = 1;
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
+_ecore_evas_x_event_window_create(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
+{
+ Ecore_X_Event_Window_Create *e = event;
+ Ecore_Evas *ee;
+ Ecore_Evas_Engine_Data_X11 *edata;
+
+ ee = ecore_event_window_match(e->win);
+ if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
+ edata = ee->engine.data;
+ if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
+ if (!ee->draw_block) return ECORE_CALLBACK_RENEW;
+ if ((ee->req.w == e->w) && (ee->req.h == e->h))
+ {
+ /* window created with desired size: canvas can be drawn */
+ ee->draw_block = EINA_FALSE;
+ edata->configured = EINA_TRUE;
+ }
+ return ECORE_CALLBACK_RENEW;
+}
+
+static Eina_Bool
_ecore_evas_x_event_client_message(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
{
Ecore_Evas *ee;
@@ -1620,6 +1650,18 @@ _ecore_evas_x_event_window_configure(void *data EINA_UNUSED, int type EINA_UNUSE
if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
edata = ee->engine.data;
if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
+ if (!edata->configured)
+ {
+ if (edata->fully_obscured)
+ {
+ /* FIXME: round trip */
+ if (!ecore_x_screen_is_composited(edata->screen_num))
+ ee->draw_block = EINA_FALSE;
+ }
+ else
+ ee->draw_block = EINA_FALSE;
+ }
+ edata->configured = 1;
if (edata->direct_resize) return ECORE_CALLBACK_PASS_ON;
pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_TYPE_MOUSE);
@@ -2017,6 +2059,9 @@ _ecore_evas_x_init(void)
ecore_evas_event_handlers[12] =
ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE,
_ecore_evas_x_event_client_message, NULL);
+ ecore_evas_event_handlers[13] =
+ ecore_event_handler_add(ECORE_X_EVENT_WINDOW_CREATE,
+ _ecore_evas_x_event_window_create, NULL);
ecore_event_evas_init();
return _ecore_evas_init_count;
}
@@ -2209,11 +2254,10 @@ _ecore_evas_x_resize(Ecore_Evas *ee, int w, int h)
}
}
+ if ((!changed) && (ee->w == w) && (ee->h == h)) return;
_ecore_evas_x_shadow_update(ee);
if (edata->direct_resize)
{
- if ((ee->w == w) && (ee->h == h)) return;
-
ee->w = w;
ee->h = h;
if (changed) edata->configure_reqs++;
@@ -2336,6 +2380,7 @@ _ecore_evas_x_move_resize(Ecore_Evas *ee, int x, int y, int w, int h)
}
else
{
+ if ((!changed) && (ee->w == w) && (ee->h == h)) return;
edata->configure_coming = 1;
if (changed) edata->configure_reqs++;
if (ee->prop.window) ecore_x_window_resize(ee->prop.window, vw, vh);
@@ -3562,7 +3607,6 @@ _ecore_evas_x_screen_dpi_get(const Ecore_Evas *ee, int *xdpi, int *ydpi)
if (!out)
{
norandr:
- if (out) free(out);
scdpi = ecore_x_dpi_get();
if (xdpi) *xdpi = scdpi;
if (ydpi) *ydpi = scdpi;
@@ -4089,7 +4133,13 @@ ecore_evas_software_x11_new_internal(const char *disp_name, Ecore_X_Window paren
ee->can_async_render = 1;
/* init evas here */
- ee->evas = evas_new();
+ if (!ecore_evas_evas_new(ee, w, h))
+ {
+ ERR("Can not create a Canvas.");
+ ecore_evas_free(ee);
+ return NULL;
+ }
+
evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_FLUSH_PRE,
_ecore_evas_x_flush_pre, ee);
evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_FLUSH_POST,
@@ -4097,10 +4147,7 @@ ecore_evas_software_x11_new_internal(const char *disp_name, Ecore_X_Window paren
if (ee->can_async_render)
evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_POST,
_ecore_evas_x_render_updates, ee);
- evas_data_attach_set(ee->evas, ee);
evas_output_method_set(ee->evas, rmethod);
- evas_output_size_set(ee->evas, w, h);
- evas_output_viewport_set(ee->evas, 0, 0, w, h);
edata->win_root = parent;
edata->screen_num = 0;
@@ -4216,14 +4263,10 @@ ecore_evas_software_x11_new_internal(const char *disp_name, Ecore_X_Window paren
_ecore_evas_x_sync_set(ee);
ee->engine.func->fn_render = _ecore_evas_x_render;
- _ecore_evas_register(ee);
+ ee->draw_block = EINA_TRUE;
+
ecore_x_input_multi_select(ee->prop.window);
- ecore_event_window_register(ee->prop.window, ee, ee->evas,
- (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
- (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
- (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
- (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
- _ecore_event_window_direct_cb_set(ee->prop.window, _ecore_evas_input_direct_cb);
+ ecore_evas_done(ee, EINA_FALSE);
return ee;
}
@@ -4292,22 +4335,24 @@ ecore_evas_software_x11_pixmap_new_internal(const char *disp_name, Ecore_X_Windo
ee->can_async_render = 1;
/* init evas here */
- ee->evas = evas_new();
+ if (!ecore_evas_evas_new(ee, w, h))
+ {
+ ERR("Can not create Canvas.");
+ ecore_evas_free(ee);
+ return NULL;
+ }
evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_FLUSH_PRE,
_ecore_evas_x_flush_pre, ee);
evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_FLUSH_POST,
_ecore_evas_x_flush_post, ee);
- evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_PRE,
+ evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_PRE,
_ecore_evas_x_render_pre, ee);
if (ee->can_async_render)
evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_POST,
_ecore_evas_x_render_updates, ee);
- evas_data_attach_set(ee->evas, ee);
evas_output_method_set(ee->evas, rmethod);
- evas_output_size_set(ee->evas, w, h);
- evas_output_viewport_set(ee->evas, 0, 0, w, h);
edata->win_root = parent;
edata->screen_num = 0;
@@ -4435,7 +4480,7 @@ ecore_evas_software_x11_pixmap_new_internal(const char *disp_name, Ecore_X_Windo
ee->engine.func->fn_render = _ecore_evas_x_render;
_ecore_evas_register(ee);
- ee->draw_ok = 1;
+ ee->draw_block = EINA_FALSE;
/* ecore_x_input_multi_select(ee->prop.window); */
/* ecore_event_window_register(ee->prop.window, ee, ee->evas, */
@@ -4611,13 +4656,15 @@ ecore_evas_gl_x11_options_new_internal(const char *disp_name, Ecore_X_Window par
edata->state.sticky = 0;
/* init evas here */
- ee->evas = evas_new();
+ if (!ecore_evas_evas_new(ee, w, h))
+ {
+ ERR("Can not create Canvas.");
+ ecore_evas_free(ee);
+ return NULL;
+ }
evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_FLUSH_PRE, _ecore_evas_x_flush_pre, ee);
evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_FLUSH_POST, _ecore_evas_x_flush_post, ee);
- evas_data_attach_set(ee->evas, ee);
evas_output_method_set(ee->evas, rmethod);
- evas_output_size_set(ee->evas, w, h);
- evas_output_viewport_set(ee->evas, 0, 0, w, h);
if (parent == 0) parent = ecore_x_window_root_first_get();
edata->win_root = parent;
@@ -4663,15 +4710,12 @@ ecore_evas_gl_x11_options_new_internal(const char *disp_name, Ecore_X_Window par
_ecore_evas_x_aux_hints_update(ee);
_ecore_evas_x_sync_set(ee);
+ ee->draw_block = 1;
+
ee->engine.func->fn_render = _ecore_evas_x_render;
- _ecore_evas_register(ee);
ecore_x_input_multi_select(ee->prop.window);
- ecore_event_window_register(ee->prop.window, ee, ee->evas,
- (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
- (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
- (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
- (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
- _ecore_event_window_direct_cb_set(ee->prop.window, _ecore_evas_input_direct_cb);
+
+ ecore_evas_done(ee, EINA_FALSE);
return ee;
}
@@ -4752,17 +4796,19 @@ ecore_evas_gl_x11_pixmap_new_internal(const char *disp_name, Ecore_X_Window pare
edata->state.sticky = 0;
/* init evas here */
- ee->evas = evas_new();
- evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_FLUSH_PRE,
+ if (!ecore_evas_evas_new(ee, w, h))
+ {
+ ERR("Can not create Canvas.");
+ ecore_evas_free(ee);
+ return NULL;
+ }
+ evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_FLUSH_PRE,
_ecore_evas_x_flush_pre, ee);
- evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_FLUSH_POST,
+ evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_FLUSH_POST,
_ecore_evas_x_flush_post, ee);
- evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_PRE,
+ evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_PRE,
_ecore_evas_x_render_pre, ee);
- evas_data_attach_set(ee->evas, ee);
evas_output_method_set(ee->evas, rmethod);
- evas_output_size_set(ee->evas, w, h);
- evas_output_viewport_set(ee->evas, 0, 0, w, h);
if (ee->can_async_render)
evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_POST,
@@ -4864,6 +4910,8 @@ ecore_evas_gl_x11_pixmap_new_internal(const char *disp_name, Ecore_X_Window pare
ee->engine.func->fn_render = _ecore_evas_x_render;
_ecore_evas_register(ee);
+ ee->draw_block = EINA_TRUE;
+
/* ecore_x_input_multi_select(ee->prop.window); */
/* ecore_event_window_register(ee->prop.window, ee, ee->evas, */
/* (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process, */
diff --git a/src/modules/ecore_evas/vnc_server/ecore_evas_vnc_server.c b/src/modules/ecore_evas/vnc_server/ecore_evas_vnc_server.c
index 3b43c607af..c2a392400c 100644
--- a/src/modules/ecore_evas/vnc_server/ecore_evas_vnc_server.c
+++ b/src/modules/ecore_evas/vnc_server/ecore_evas_vnc_server.c
@@ -12,16 +12,6 @@
#include <Evas.h>
#include <Ecore_Evas.h>
-#ifdef BUILD_ENGINE_SOFTWARE_X11
-# include <Evas_Engine_Software_X11.h>
-# include <Ecore_X.h>
-#endif
-
-#ifdef BUILD_ENGINE_FB
-# include <Evas_Engine_FB.h>
-# include "ecore_evas_vnc_server_fb_keymap.h"
-#endif
-
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
@@ -29,6 +19,7 @@
#include "ecore_private.h"
#include "ecore_evas_private.h"
+#include "ecore_evas_vnc_server_fb_keymap.h"
static int _ecore_evas_vnc_server_log_dom;
static unsigned int _available_seat = 1;
diff --git a/src/modules/ecore_evas/vnc_server/ecore_evas_vnc_server_fb_keymap.c b/src/modules/ecore_evas/vnc_server/ecore_evas_vnc_server_fb_keymap.c
index 393693cd98..636026f4b1 100644
--- a/src/modules/ecore_evas/vnc_server/ecore_evas_vnc_server_fb_keymap.c
+++ b/src/modules/ecore_evas/vnc_server/ecore_evas_vnc_server_fb_keymap.c
@@ -6,7 +6,7 @@
static const char *_ecore_fb_li_kbd_syms[144 * 7] =
{
-#include <ecore_fb_keytable.h>
+#include "ecore_fb_keytable.h"
};
#include "ecore_evas_vnc_server_fb_keymap.h"
diff --git a/src/modules/ecore_imf/ibus/ibus_imcontext.c b/src/modules/ecore_imf/ibus/ibus_imcontext.c
index caa5fd83c5..753f3b76ca 100644
--- a/src/modules/ecore_imf/ibus/ibus_imcontext.c
+++ b/src/modules/ecore_imf/ibus/ibus_imcontext.c
@@ -52,7 +52,7 @@ struct _KeyEvent
int state;
};
-static Eina_Bool _sync_mode_use = EINA_FALSE;
+static Eina_Bool _sync_mode_use = EINA_TRUE;
static Ecore_IMF_Context *_focus_im_context = NULL;
static IBusBus *_bus = NULL;
diff --git a/src/modules/ecore_imf/wayland/wayland_imcontext.c b/src/modules/ecore_imf/wayland/wayland_imcontext.c
index 24742080bf..d7bcfe7994 100644
--- a/src/modules/ecore_imf/wayland/wayland_imcontext.c
+++ b/src/modules/ecore_imf/wayland/wayland_imcontext.c
@@ -634,8 +634,8 @@ text_input_keysym(void *data,
strcpy((char *)e->key, key);
strcpy((char *)e->string, string);
- e->window = ecore_wl2_window_id_get(imcontext->window);
- e->event_window = ecore_wl2_window_id_get(imcontext->window);
+ e->window = (Ecore_Window)imcontext->window;
+ e->event_window = (Ecore_Window)imcontext->window;
e->timestamp = time;
e->modifiers = 0;
@@ -762,6 +762,8 @@ wayland_im_context_del(Ecore_IMF_Context *ctx)
EINA_LOG_DOM_INFO(_ecore_imf_wayland_log_dom, "context_del");
+ _clear_hide_timer();
+
if (imcontext->language)
{
free(imcontext->language);
@@ -904,8 +906,7 @@ wayland_im_context_client_window_set(Ecore_IMF_Context *ctx, void *window)
if (window != NULL)
{
- imcontext->window =
- ecore_wl2_display_window_find(ewd, (Ecore_Window)window);
+ imcontext->window = window;
}
}
diff --git a/src/modules/ecore_imf/xim/ecore_imf_xim.c b/src/modules/ecore_imf/xim/ecore_imf_xim.c
index 5a10a7e539..30129a5274 100644
--- a/src/modules/ecore_imf/xim/ecore_imf_xim.c
+++ b/src/modules/ecore_imf/xim/ecore_imf_xim.c
@@ -739,7 +739,11 @@ static Ecore_IMF_Context_Class xim_class = {
static Ecore_IMF_Context *
xim_imf_module_create(void)
{
- Ecore_IMF_Context *ctx = ecore_imf_context_new(&xim_class);
+ Ecore_IMF_Context *ctx;
+
+ if (!ecore_x_init(NULL))
+ return NULL;
+ ctx = ecore_imf_context_new(&xim_class);
DBG("ctx=%p", ctx);
return ctx;
}
@@ -747,6 +751,7 @@ xim_imf_module_create(void)
static Ecore_IMF_Context *
xim_imf_module_exit(void)
{
+ ecore_x_shutdown();
DBG(" ");
return NULL;
}
@@ -771,12 +776,6 @@ _ecore_imf_xim_init(void)
DBG(" ");
- if (!ecore_x_init(NULL))
- {
- eina_shutdown();
- return EINA_FALSE;
- }
-
ecore_imf_module_register(&xim_info,
xim_imf_module_create,
xim_imf_module_exit);
@@ -795,8 +794,6 @@ _ecore_imf_xim_shutdown(void)
_ecore_imf_xim_info_im_shutdown(display, EINA_FALSE, info);
}
- ecore_x_shutdown();
-
if (_ecore_imf_xim_log_dom >= 0)
{
eina_log_domain_unregister(_ecore_imf_xim_log_dom);
diff --git a/src/modules/eina/mp/chained_pool/eina_chained_mempool.c b/src/modules/eina/mp/chained_pool/eina_chained_mempool.c
index 7fb0ded145..b32747ec4f 100644
--- a/src/modules/eina/mp/chained_pool/eina_chained_mempool.c
+++ b/src/modules/eina/mp/chained_pool/eina_chained_mempool.c
@@ -623,10 +623,6 @@ eina_chained_mempool_shutdown(void *data)
eina_spinlock_free(&mp->mutex);
-#ifdef EINA_HAVE_DEBUG_THREADS
- assert(eina_thread_equal(mp->self, eina_thread_self()));
-#endif
-
free(mp);
}
diff --git a/src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c b/src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c
index d40e82be0b..73b73e87e2 100644
--- a/src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c
+++ b/src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c
@@ -314,10 +314,7 @@ field_create(Efl_Ui_Clock_Module_Data *module_data, Efl_Ui_Clock_Type field_typ
if (field_type == EFL_UI_CLOCK_TYPE_AMPM)
{
- field_obj = efl_add(EFL_UI_BUTTON_CLASS, ctx_mod->mod_data.base,
- elm_widget_element_update(ctx_mod->mod_data.base,
- efl_added,
- PART_NAME_ARRAY[field_type]));
+ field_obj = elm_button_add(ctx_mod->mod_data.base);
efl_event_callback_add
(field_obj, EFL_UI_EVENT_CLICKED, _ampm_clicked_cb, ctx_mod);
}
diff --git a/src/modules/elementary/web/none/elm_web_none.c b/src/modules/elementary/web/none/elm_web_none.c
index 21ebaa9dcc..e06245a7b0 100644
--- a/src/modules/elementary/web/none/elm_web_none.c
+++ b/src/modules/elementary/web/none/elm_web_none.c
@@ -37,7 +37,7 @@ static int _none_log_dom = -1;
#define DBG(...) EINA_LOG_DOM_DBG(_none_log_dom, __VA_ARGS__)
EOLIAN static Eina_Bool
-_elm_web_none_elm_web_tab_propagate_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *sd EINA_UNUSED)
+_elm_web_none_elm_web_tab_propagate_get(const Eo *obj EINA_UNUSED, Elm_Web_None_Data *sd EINA_UNUSED)
{
return EINA_FALSE;
}
@@ -61,7 +61,7 @@ _elm_web_none_efl_canvas_group_group_add(Eo *obj, Elm_Web_None_Data *_pd EINA_UN
}
EOLIAN static Evas_Object*
-_elm_web_none_elm_web_webkit_view_get(Eo *obj, Elm_Web_None_Data *_pd EINA_UNUSED)
+_elm_web_none_elm_web_webkit_view_get(const Eo *obj, Elm_Web_None_Data *_pd EINA_UNUSED)
{
(void)obj;
ERR("Elementary not compiled with EWebKit support.");
@@ -104,7 +104,7 @@ _elm_web_none_elm_web_useragent_set(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd
}
EOLIAN static const char*
-_elm_web_none_elm_web_useragent_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+_elm_web_none_elm_web_useragent_get(const Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
{
return NULL;
}
@@ -116,7 +116,7 @@ _elm_web_none_elm_web_url_set(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_U
}
EOLIAN static const char*
-_elm_web_none_elm_web_url_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+_elm_web_none_elm_web_url_get(const Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
{
return NULL;
}
@@ -128,7 +128,7 @@ _elm_web_none_elm_web_html_string_load(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_
}
EOLIAN static const char*
-_elm_web_none_elm_web_title_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+_elm_web_none_elm_web_title_get(const Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
{
return NULL;
}
@@ -139,7 +139,7 @@ _elm_web_none_elm_web_bg_color_set(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd E
}
EOLIAN static void
-_elm_web_none_elm_web_bg_color_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED, int *r, int *g, int *b, int *a)
+_elm_web_none_elm_web_bg_color_get(const Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED, int *r, int *g, int *b, int *a)
{
if (r) *r = 0;
if (g) *g = 0;
@@ -148,7 +148,7 @@ _elm_web_none_elm_web_bg_color_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd E
}
EOLIAN static const char*
-_elm_web_none_elm_web_selection_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+_elm_web_none_elm_web_selection_get(const Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
{
return NULL;
}
@@ -189,13 +189,13 @@ _elm_web_none_elm_web_text_matches_highlight_set(Eo *obj EINA_UNUSED, Elm_Web_No
}
EOLIAN static Eina_Bool
-_elm_web_none_elm_web_text_matches_highlight_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+_elm_web_none_elm_web_text_matches_highlight_get(const Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
{
return EINA_FALSE;
}
EOLIAN static double
-_elm_web_none_elm_web_load_progress_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+_elm_web_none_elm_web_load_progress_get(const Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
{
return -1.0;
}
@@ -237,13 +237,13 @@ _elm_web_none_elm_web_navigate(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_
}
EOLIAN static Eina_Bool
-_elm_web_none_elm_web_back_possible_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+_elm_web_none_elm_web_back_possible_get(const Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
{
return EINA_FALSE;
}
EOLIAN static Eina_Bool
-_elm_web_none_elm_web_forward_possible_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+_elm_web_none_elm_web_forward_possible_get(const Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
{
return EINA_FALSE;
}
@@ -255,7 +255,7 @@ _elm_web_none_elm_web_navigate_possible_get(Eo *obj EINA_UNUSED, Elm_Web_None_Da
}
EOLIAN static Eina_Bool
-_elm_web_none_elm_web_history_enabled_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+_elm_web_none_elm_web_history_enabled_get(const Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
{
return EINA_FALSE;
}
@@ -266,25 +266,25 @@ _elm_web_none_elm_web_history_enabled_set(Eo *obj EINA_UNUSED, Elm_Web_None_Data
}
EOLIAN static void
-_elm_web_none_elm_web_zoom_set(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED, double zoom EINA_UNUSED)
+_elm_web_none_efl_ui_zoom_zoom_level_set(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED, double zoom EINA_UNUSED)
{
}
EOLIAN static double
-_elm_web_none_elm_web_zoom_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+_elm_web_none_efl_ui_zoom_zoom_level_get(const Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
{
return -1;
}
EOLIAN static void
-_elm_web_none_elm_web_zoom_mode_set(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED, Elm_Web_Zoom_Mode mode EINA_UNUSED)
+_elm_web_none_efl_ui_zoom_zoom_mode_set(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED, Efl_Ui_Zoom_Mode mode EINA_UNUSED)
{
}
-EOLIAN static Elm_Web_Zoom_Mode
-_elm_web_none_elm_web_zoom_mode_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+EOLIAN static Efl_Ui_Zoom_Mode
+_elm_web_none_efl_ui_zoom_zoom_mode_get(const Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
{
- return ELM_WEB_ZOOM_MODE_LAST;
+ return EFL_UI_ZOOM_MODE_LAST;
}
EOLIAN static void
@@ -303,7 +303,7 @@ _elm_web_none_elm_web_inwin_mode_set(Eo *obj EINA_UNUSED, Elm_Web_None_Data *sd
}
EOLIAN static Eina_Bool
-_elm_web_none_elm_web_inwin_mode_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *sd EINA_UNUSED)
+_elm_web_none_elm_web_inwin_mode_get(const Eo *obj EINA_UNUSED, Elm_Web_None_Data *sd EINA_UNUSED)
{
return EINA_FALSE;
}
diff --git a/src/modules/elementary/web/none/elm_web_none.eo b/src/modules/elementary/web/none/elm_web_none.eo
index a3aa49ff28..e072be2c5f 100644
--- a/src/modules/elementary/web/none/elm_web_none.eo
+++ b/src/modules/elementary/web/none/elm_web_none.eo
@@ -1,4 +1,4 @@
-class Elm.Web.None (Elm.Web)
+class Elm.Web.None (Elm.Web, Efl.Ui.Legacy)
{
[[Elementary web module class]]
implements {
@@ -33,8 +33,8 @@ class Elm.Web.None (Elm.Web)
Elm.Web.forward_possible { get; }
Elm.Web.navigate_possible_get;
Elm.Web.history_enabled { get; set; }
- Elm.Web.zoom { get; set; }
- Elm.Web.zoom_mode { get; set; }
+ Efl.Ui.Zoom.zoom_level { get; set; }
+ Efl.Ui.Zoom.zoom_mode { get; set; }
Elm.Web.region_show;
Elm.Web.region_bring_in;
Elm.Web.inwin_mode { get; set; }
diff --git a/src/modules/emotion/generic/emotion_generic.c b/src/modules/emotion/generic/emotion_generic.c
index 4aacecad4b..601e9e2d92 100644
--- a/src/modules/emotion/generic/emotion_generic.c
+++ b/src/modules/emotion/generic/emotion_generic.c
@@ -933,6 +933,10 @@ _fork_and_exec(Emotion_Generic_Video *ev)
if (!_player_exec(ev))
{
+ eina_stringshare_del(ev->shmname);
+ ecore_event_handler_del(ev->player_add);
+ ecore_event_handler_del(ev->player_del);
+ ecore_event_handler_del(ev->player_data);
ERR("could not start player.");
return EINA_FALSE;
}
diff --git a/src/modules/emotion/generic/emotion_generic.h b/src/modules/emotion/generic/emotion_generic.h
index 4dfc91eba5..2830d33d4a 100644
--- a/src/modules/emotion/generic/emotion_generic.h
+++ b/src/modules/emotion/generic/emotion_generic.h
@@ -1,6 +1,8 @@
#ifndef EMOTION_GENERIC_H
#define EMOTION_GENERIC_H
+#include <sys/types.h>
+
#include "Emotion_Generic_Plugin.h"
/* default values */
diff --git a/src/modules/evas/engines/drm/Evas_Engine_Drm.h b/src/modules/evas/engines/drm/Evas_Engine_Drm.h
index 2fcbc466f1..24d0fa41d5 100644
--- a/src/modules/evas/engines/drm/Evas_Engine_Drm.h
+++ b/src/modules/evas/engines/drm/Evas_Engine_Drm.h
@@ -15,7 +15,7 @@ typedef struct _Evas_Engine_Info_Drm
int depth, bpp;
unsigned int format, rotation;
- void *output;
+ Ecore_Drm2_Output *output;
Eina_Bool alpha : 1;
Eina_Bool vsync : 1;
} info;
diff --git a/src/modules/evas/engines/drm/evas_engine.h b/src/modules/evas/engines/drm/evas_engine.h
index af9cc4da3d..ea8a6cec03 100644
--- a/src/modules/evas/engines/drm/evas_engine.h
+++ b/src/modules/evas/engines/drm/evas_engine.h
@@ -41,8 +41,6 @@ extern int _evas_engine_drm_log_dom;
# endif
# define CRI(...) EINA_LOG_DOM_CRIT(_evas_engine_drm_log_dom, __VA_ARGS__)
-#define MAX_BUFFERS 10
-
typedef struct _Outbuf_Fb
{
int age;
@@ -62,13 +60,14 @@ struct _Outbuf
struct
{
- int num;
- Outbuf_Fb ofb[MAX_BUFFERS], *draw;
+ Eina_List *fb_list;
+ Outbuf_Fb *draw;
Ecore_Drm2_Output *output;
Ecore_Drm2_Plane *plane;
Eina_List *pending;
Eina_Rectangle *rects;
unsigned int rect_count;
+ int unused_duration;
} priv;
Eina_Bool alpha : 1;
diff --git a/src/modules/evas/engines/drm/evas_outbuf.c b/src/modules/evas/engines/drm/evas_outbuf.c
index 0e525d566b..8b87c00661 100644
--- a/src/modules/evas/engines/drm/evas_outbuf.c
+++ b/src/modules/evas/engines/drm/evas_outbuf.c
@@ -8,6 +8,9 @@
#define GREEN_MASK 0x00ff00
#define BLUE_MASK 0x0000ff
+#define MAX_BUFFERS 10
+#define QUEUE_TRIM_DURATION 100
+
static void
_outbuf_buffer_swap(Outbuf *ob, Eina_Rectangle *rects, unsigned int count)
{
@@ -28,23 +31,29 @@ _outbuf_buffer_swap(Outbuf *ob, Eina_Rectangle *rects, unsigned int count)
ofb->age = 0;
}
-static Eina_Bool
-_outbuf_fb_create(Outbuf *ob, Outbuf_Fb *ofb, int w, int h)
+static Outbuf_Fb *
+_outbuf_fb_create(Outbuf *ob, int w, int h)
{
- ofb->fb =
+ Outbuf_Fb *out;
+
+ out = calloc(1, sizeof(Outbuf_Fb));
+ if (!out) return NULL;
+
+ out->fb =
ecore_drm2_fb_create(ob->dev, w, h,
ob->depth, ob->bpp, ob->format);
- if (!ofb->fb)
+ if (!out->fb)
{
WRN("Failed To Create FB: %d %d", w, h);
- return EINA_FALSE;
+ free(out);
+ return NULL;
}
- ofb->age = 0;
- ofb->drawn = EINA_FALSE;
- ofb->valid = EINA_TRUE;
+ out->age = 0;
+ out->drawn = EINA_FALSE;
+ out->valid = EINA_TRUE;
- return EINA_TRUE;
+ return out;
}
static void
@@ -56,14 +65,13 @@ _outbuf_fb_destroy(Outbuf_Fb *ofb)
ofb->valid = EINA_FALSE;
ofb->drawn = EINA_FALSE;
ofb->age = 0;
+ free(ofb);
}
Outbuf *
_outbuf_setup(Evas_Engine_Info_Drm *info, int w, int h)
{
Outbuf *ob;
- char *num;
- int i = 0, fw = 0, fh = 0;
ob = calloc(1, sizeof(Outbuf));
if (!ob) return NULL;
@@ -80,44 +88,13 @@ _outbuf_setup(Evas_Engine_Info_Drm *info, int w, int h)
ob->priv.output = info->info.output;
- ob->priv.num = 3;
-
- num = getenv("EVAS_DRM_BUFFERS");
- if (num)
- {
- ob->priv.num = atoi(num);
- if (ob->priv.num <= 0) ob->priv.num = 3;
- else if (ob->priv.num > MAX_BUFFERS) ob->priv.num = MAX_BUFFERS;
- }
-
- if ((ob->rotation == 0) || (ob->rotation == 180))
- {
- fw = w;
- fh = h;
- }
- else if ((ob->rotation == 90) || (ob->rotation == 270))
- {
- fw = h;
- fh = w;
- }
-
- if ((!w) || (!h)) return ob;
- for (i = 0; i < ob->priv.num; i++)
- {
- if (!_outbuf_fb_create(ob, &(ob->priv.ofb[i]), fw, fh))
- {
- WRN("Failed to create framebuffer %d", i);
- continue;
- }
- }
-
return ob;
}
void
_outbuf_free(Outbuf *ob)
{
- int i = 0;
+ Outbuf_Fb *ofb;
while (ob->priv.pending)
{
@@ -144,8 +121,8 @@ _outbuf_free(Outbuf *ob)
_outbuf_flush(ob, NULL, NULL, EVAS_RENDER_MODE_UNDEF);
- for (i = 0; i < ob->priv.num; i++)
- _outbuf_fb_destroy(&ob->priv.ofb[i]);
+ EINA_LIST_FREE(ob->priv.fb_list, ofb)
+ _outbuf_fb_destroy(ofb);
free(ob);
}
@@ -159,7 +136,7 @@ _outbuf_rotation_get(Outbuf *ob)
void
_outbuf_reconfigure(Outbuf *ob, int w, int h, int rotation, Outbuf_Depth depth)
{
- int i = 0, fw = 0, fh = 0;
+ Outbuf_Fb *ofb;
unsigned int format = DRM_FORMAT_ARGB8888;
switch (depth)
@@ -210,30 +187,10 @@ _outbuf_reconfigure(Outbuf *ob, int w, int h, int rotation, Outbuf_Depth depth)
ob->depth = depth;
ob->format = format;
ob->rotation = rotation;
+ ob->priv.unused_duration = 0;
- for (i = 0; i < ob->priv.num; i++)
- _outbuf_fb_destroy(&ob->priv.ofb[i]);
-
- if ((ob->rotation == 0) || (ob->rotation == 180))
- {
- fw = w;
- fh = h;
- }
- else if ((ob->rotation == 90) || (ob->rotation == 270))
- {
- fw = h;
- fh = w;
- }
-
- if ((!w) || (!h)) return;
- for (i = 0; i < ob->priv.num; i++)
- {
- if (!_outbuf_fb_create(ob, &(ob->priv.ofb[i]), fw, fh))
- {
- WRN("Failed to create framebuffer %d", i);
- continue;
- }
- }
+ EINA_LIST_FREE(ob->priv.fb_list, ofb)
+ _outbuf_fb_destroy(ofb);
/* TODO: idle flush */
}
@@ -241,46 +198,90 @@ _outbuf_reconfigure(Outbuf *ob, int w, int h, int rotation, Outbuf_Depth depth)
static Outbuf_Fb *
_outbuf_fb_wait(Outbuf *ob)
{
- int i = 0, best = -1, best_age = -1;
+ Eina_List *l;
+ Outbuf_Fb *ofb, *best = NULL;
+ int best_age = -1, num_required = 1, num_allocated = 0;
/* We pick the oldest available buffer to avoid using the same two
* repeatedly and then having the third be stale when we need it
*/
- for (i = 0; i < ob->priv.num; i++)
+ EINA_LIST_FOREACH(ob->priv.fb_list, l, ofb)
{
- if (ecore_drm2_fb_busy_get(ob->priv.ofb[i].fb)) continue;
- if (ob->priv.ofb[i].valid && (ob->priv.ofb[i].age > best_age))
+ num_allocated++;
+ if (ecore_drm2_fb_busy_get(ofb->fb))
{
- best = i;
- best_age = ob->priv.ofb[i].age;
+ num_required++;
+ continue;
}
+ if (ofb->valid && (ofb->age > best_age))
+ {
+ best = ofb;
+ best_age = best->age;
+ }
+ }
+
+ if (num_required < num_allocated)
+ ob->priv.unused_duration++;
+ else
+ ob->priv.unused_duration = 0;
+
+ /* If we've had unused buffers for longer than QUEUE_TRIM_DURATION, then
+ * destroy the oldest buffer (currently in best) and recursively call
+ * ourself to get the next oldest.
+ */
+ if (best && (ob->priv.unused_duration > QUEUE_TRIM_DURATION))
+ {
+ ob->priv.unused_duration = 0;
+ ob->priv.fb_list = eina_list_remove(ob->priv.fb_list, best);
+ _outbuf_fb_destroy(best);
+ best = _outbuf_fb_wait(ob);
}
- if (best >= 0) return &(ob->priv.ofb[best]);
- return NULL;
+ return best;
}
static Eina_Bool
_outbuf_fb_assign(Outbuf *ob)
{
- int i;
+ int fw = 0, fh = 0;
+ Outbuf_Fb *ofb;
+ Eina_List *l;
ob->priv.draw = _outbuf_fb_wait(ob);
+ if (!ob->priv.draw)
+ {
+ EINA_SAFETY_ON_TRUE_RETURN_VAL(eina_list_count(ob->priv.fb_list) >= MAX_BUFFERS, EINA_FALSE);
+
+ if ((ob->rotation == 0) || (ob->rotation == 180))
+ {
+ fw = ob->w;
+ fh = ob->h;
+ }
+ else if ((ob->rotation == 90) || (ob->rotation == 270))
+ {
+ fw = ob->h;
+ fh = ob->w;
+ }
+ ob->priv.draw = _outbuf_fb_create(ob, fw, fh);
+ if (ob->priv.draw)
+ ob->priv.fb_list = eina_list_append(ob->priv.fb_list, ob->priv.draw);
+ }
+
while (!ob->priv.draw)
{
ecore_drm2_fb_release(ob->priv.output, EINA_TRUE);
ob->priv.draw = _outbuf_fb_wait(ob);
}
- for (i = 0; i < ob->priv.num; i++)
+ EINA_LIST_FOREACH(ob->priv.fb_list, l, ofb)
{
- if ((ob->priv.ofb[i].valid) && (ob->priv.ofb[i].drawn))
+ if ((ofb->valid) && (ofb->drawn))
{
- ob->priv.ofb[i].age++;
- if (ob->priv.ofb[i].age > 4)
+ ofb->age++;
+ if (ofb->age > 4)
{
- ob->priv.ofb[i].age = 0;
- ob->priv.ofb[i].drawn = EINA_FALSE;
+ ofb->age = 0;
+ ofb->drawn = EINA_FALSE;
}
}
}
@@ -296,7 +297,7 @@ _outbuf_state_get(Outbuf *ob)
if (!_outbuf_fb_assign(ob)) return MODE_FULL;
age = ob->priv.draw->age;
- if (age > ob->priv.num) return MODE_FULL;
+ if (age > 4) return MODE_FULL;
else if (age == 1) return MODE_COPY;
else if (age == 2) return MODE_DOUBLE;
else if (age == 3) return MODE_TRIPLE;
diff --git a/src/modules/evas/engines/eglfs/evas_engine.c b/src/modules/evas/engines/eglfs/evas_engine.c
index 34aa22fbe5..d4af49c43d 100644
--- a/src/modules/evas/engines/eglfs/evas_engine.c
+++ b/src/modules/evas/engines/eglfs/evas_engine.c
@@ -912,19 +912,14 @@ eng_image_native_set(void *engine EINA_UNUSED, void *data, void *image, void *na
}
}
- if ((!ns) && (!img->native.data)) return img;
-
evas_outbuf_use(ob);
- if (img->native.data)
+ if (!ns)
{
- if (img->native.func.free)
- img->native.func.free(img);
- glsym_evas_gl_common_image_native_disable(img);
+ glsym_evas_gl_common_image_free(img);
+ return NULL;
}
- if (!ns) return img;
-
if (ns->type == EVAS_NATIVE_SURFACE_WL)
{
wlid = wl_buf;
diff --git a/src/modules/evas/engines/gl_common/evas_gl_common.h b/src/modules/evas/engines/gl_common/evas_gl_common.h
index 508c757dde..7ae78a799d 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_common.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_common.h
@@ -79,15 +79,15 @@ typedef Eina_Bool (*evas_gl_make_current_cb)(void *engine_data, void *doit);
#endif
#ifdef _WIN32
-# ifdef EFL_EVAS_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EVAS_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -98,7 +98,7 @@ typedef Eina_Bool (*evas_gl_make_current_cb)(void *engine_data, void *doit);
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#define PROGRAM_HITCOUNT_MAX 0x1000000
@@ -563,6 +563,7 @@ EAPI void evas_gl_preload_render_lock(evas_gl_make_current_cb make_curre
EAPI void evas_gl_preload_render_unlock(evas_gl_make_current_cb make_current, void *engine_data);
EAPI void evas_gl_preload_render_relax(evas_gl_make_current_cb make_current, void *engine_data);
EAPI void evas_gl_symbols(void *(*GetProcAddress)(const char *name), const char *extsn);
+EAPI Eina_Bool evas_gl_extension_string_check(const char *ext, const char *exts);
EAPI void evas_gl_common_error_set(int error_enum);
EAPI int evas_gl_common_error_get(void);
@@ -577,6 +578,7 @@ typedef Evas_Engine_GL_Context *(*Evas_GL_Common_Context_New)(void);
typedef void (*Evas_GL_Common_Context_Resize_Call)(Evas_Engine_GL_Context *gc, int w, int h, int rot);
typedef int (*Evas_GL_Common_Buffer_Dump_Call)(Evas_Engine_GL_Context *gc,const char* dname, const char* fname, int frame, const char* suffix);
typedef void (*Evas_Gl_Symbols)(void *(*GetProcAddress)(const char *sym), const char *extsn);
+typedef Eina_Bool (*Evas_Gl_Extension_String_Check)(const char *exts, const char *ext);
EAPI void __evas_gl_err(int err, const char *file, const char *func, int line, const char *op);
diff --git a/src/modules/evas/engines/gl_common/evas_gl_context.c b/src/modules/evas/engines/gl_common/evas_gl_context.c
index cb1e3ad649..b010057c2a 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_context.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_context.c
@@ -84,6 +84,42 @@ sym_missing(void)
ERR("GL symbols missing!");
}
+/* This check is based heavily on the check from libepoxy.
+ * Previously we used strstr(), however there are some extensions
+ * whose names are subsets of others.
+ */
+EAPI Eina_Bool
+evas_gl_extension_string_check(const char *exts, const char *ext)
+{
+ const char *ptr;
+ int len;
+
+ if (!exts || !ext) return EINA_FALSE;
+ ptr = exts;
+
+ if (*ptr == '\0')
+ return EINA_FALSE;
+
+ len = strlen(ext);
+
+ while (1)
+ {
+ ptr = strstr(ptr, ext);
+ if (!ptr)
+ return EINA_FALSE;
+
+ if (ptr[len] == ' ' || ptr[len] == '\0')
+ return EINA_TRUE;
+
+ ptr += len;
+ }
+}
+
+/* Totally gross, but I didn't want to reindent all the
+ * strstr() callers :(
+ */
+static Evas_Gl_Extension_String_Check _ckext = evas_gl_extension_string_check;
+
static int
_has_ext(const char *ext, const char **pexts, int *pnum)
{
@@ -114,17 +150,11 @@ _has_ext(const char *ext, const char **pexts, int *pnum)
if (!exts) return EINA_FALSE;
*pexts = exts;
}
- return strstr(exts, ext) != NULL;
+ return _ckext(exts, ext);
}
}
#ifdef GL_GLES
-static int
-_has_extn(const char *ext, const char *exts)
-{
- if (!exts || !ext) return EINA_FALSE;
- return strstr(exts, ext) != NULL;
-}
EAPI void *
evas_gl_common_eglCreateImage(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list)
@@ -312,7 +342,7 @@ evas_gl_symbols(void *(*GetProcAddress)(const char *name), const char *extsn)
#ifdef GL_GLES
#define FINDSYMN(dst, sym, ext, typ) do { \
if (!dst) { \
- if (_has_extn(ext, extsn) && GetProcAddress) \
+ if (_ckext(extsn, ext) && GetProcAddress) \
dst = (typ) GetProcAddress(sym); \
if (!dst) \
dst = (typ) dlsym(RTLD_DEFAULT, sym); \
@@ -887,41 +917,41 @@ evas_gl_common_context_new(void)
{
if (getenv("EVAS_GL_INFO"))
fprintf(stderr, "EXT:\n%s\n", ext);
- if ((strstr(ext, "GL_ARB_texture_non_power_of_two")) ||
- (strstr(ext, "OES_texture_npot")) ||
- (strstr(ext, "GL_IMG_texture_npot")))
+ if ((_ckext(ext, "GL_ARB_texture_non_power_of_two")) ||
+ (_ckext(ext, "OES_texture_npot")) ||
+ (_ckext(ext, "GL_IMG_texture_npot")))
shared->info.tex_npo2 = 1;
- if ((strstr(ext, "GL_NV_texture_rectangle")) ||
- (strstr(ext, "GL_EXT_texture_rectangle")) ||
- (strstr(ext, "GL_ARB_texture_rectangle")))
+ if ((_ckext(ext, "GL_NV_texture_rectangle")) ||
+ (_ckext(ext, "GL_EXT_texture_rectangle")) ||
+ (_ckext(ext, "GL_ARB_texture_rectangle")))
shared->info.tex_rect = 1;
- if ((strstr(ext, "GL_ARB_get_program_binary")) ||
- (strstr(ext, "GL_OES_get_program_binary")))
+ if ((_ckext(ext, "GL_ARB_get_program_binary")) ||
+ (_ckext(ext, "GL_OES_get_program_binary")))
shared->info.bin_program = 1;
else
glsym_glGetProgramBinary = NULL;
#ifdef GL_UNPACK_ROW_LENGTH
shared->info.unpack_row_length = 1;
# ifdef GL_GLES
- if (!strstr(ext, "_unpack_subimage"))
+ if (!_ckext(ext, "_unpack_subimage"))
shared->info.unpack_row_length = 0;
# endif
#endif
#ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
- if ((strstr(ext, "GL_EXT_texture_filter_anisotropic")))
+ if ((_ckext(ext, "GL_EXT_texture_filter_anisotropic")))
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT,
&(shared->info.anisotropic));
#endif
#ifdef GL_BGRA
- if ((strstr(ext, "GL_EXT_bgra")) ||
- (strstr(ext, "GL_EXT_texture_format_BGRA8888")))
+ if ((_ckext(ext, "GL_EXT_bgra")) ||
+ (_ckext(ext, "GL_EXT_texture_format_BGRA8888")))
shared->info.bgra = 1;
#endif
- if (strstr(ext, "OES_compressed_ETC1_RGB8_texture"))
+ if (_ckext(ext, "OES_compressed_ETC1_RGB8_texture"))
shared->info.etc1 = 1;
- if (strstr(ext, "GL_EXT_texture_compression_s3tc") ||
- strstr(ext, "GL_S3_s3tc"))
+ if (_ckext(ext, "GL_EXT_texture_compression_s3tc") ||
+ _ckext(ext, "GL_S3_s3tc"))
shared->info.s3tc = 1;
#ifdef GL_GLES
// FIXME: there should be an extension name/string to check for
@@ -949,7 +979,7 @@ evas_gl_common_context_new(void)
(secsym_tbm_surface_get_info))
shared->info.sec_tbm_surface = 1;
#endif
- if (!strstr(ext, "GL_QCOM_tiled_rendering"))
+ if (!_ckext(ext, "GL_QCOM_tiled_rendering"))
{
glsym_glStartTiling = NULL;
glsym_glEndTiling = NULL;
@@ -1046,7 +1076,7 @@ evas_gl_common_context_new(void)
// Note: If we support ETC2 we'll try to always use ETC2 even when the
// image has colorspace ETC1 (backwards compatibility).
- if (ext && strstr(ext, "GL_EXT_compressed_ETC1_RGB8_sub_texture"))
+ if (_ckext(ext, "GL_EXT_compressed_ETC1_RGB8_sub_texture"))
shared->info.etc1_subimage = 1;
else
shared->info.etc1_subimage = shared->info.etc2;
diff --git a/src/modules/evas/engines/gl_common/evas_gl_core.h b/src/modules/evas/engines/gl_common/evas_gl_core.h
index 8083236c37..7aead8dd96 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_core.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_core.h
@@ -8,15 +8,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_EVAS_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EVAS_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -27,7 +27,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
typedef void *EVGLNative_Display;
typedef void *EVGLNative_Window;
diff --git a/src/modules/evas/engines/gl_common/evas_gl_image.c b/src/modules/evas/engines/gl_common/evas_gl_image.c
index 87f2a20a6b..c3a33e9b79 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_image.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_image.c
@@ -745,7 +745,8 @@ evas_gl_common_image_free(Evas_GL_Image *im)
if (im->fglyph)
{
- im->gc->font_glyph_images = eina_list_remove(im->gc->font_glyph_images, im);
+ if (im->gc)
+ im->gc->font_glyph_images = eina_list_remove(im->gc->font_glyph_images, im);
im->fglyph->ext_dat = NULL;
im->fglyph->ext_dat_free = NULL;
}
@@ -857,7 +858,6 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im)
Image_Entry *ie;
if (!im->im) return;
- // alloc ensure can change im->im, so only get the local variable later.
ie = &im->im->cache_entry;
if (!im->tex)
{
@@ -866,6 +866,8 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im)
im->h = ie->h;
}
evas_gl_common_image_alloc_ensure(im);
+ // alloc ensure can change im->im, so only get the local variable later.
+ ie = &im->im->cache_entry;
/*
if ((im->cs.space == EVAS_COLORSPACE_YCBCR422P601_PL) ||
(im->cs.space == EVAS_COLORSPACE_YCBCR422P709_PL))
diff --git a/src/modules/evas/engines/gl_drm/Evas_Engine_GL_Drm.h b/src/modules/evas/engines/gl_drm/Evas_Engine_GL_Drm.h
index 5dd18545a7..d7a14fdafb 100644
--- a/src/modules/evas/engines/gl_drm/Evas_Engine_GL_Drm.h
+++ b/src/modules/evas/engines/gl_drm/Evas_Engine_GL_Drm.h
@@ -23,7 +23,7 @@ struct _Evas_Engine_Info_GL_Drm
unsigned int rotation, depth;
unsigned int format, flags;
- void *output;
+ Ecore_Drm2_Output *output;
Eina_Bool destination_alpha : 1;
Eina_Bool vsync : 1;
diff --git a/src/modules/evas/engines/gl_drm/evas_engine.c b/src/modules/evas/engines/gl_drm/evas_engine.c
index 39f5442218..6877842008 100644
--- a/src/modules/evas/engines/gl_drm/evas_engine.c
+++ b/src/modules/evas/engines/gl_drm/evas_engine.c
@@ -29,6 +29,7 @@ struct scanout_handle
/* external variables */
int _evas_engine_gl_drm_log_dom = -1;
int _extn_have_buffer_age = 1;
+int _extn_have_context_priority = 0;
/* local variables */
static Eina_Bool initted = EINA_FALSE;
@@ -57,6 +58,7 @@ Evas_GL_Preload glsym_evas_gl_preload_shutdown = NULL;
EVGL_Engine_Call glsym_evgl_engine_shutdown = NULL;
EVGL_Current_Native_Context_Get_Call glsym_evgl_current_native_context_get = NULL;
Evas_Gl_Symbols glsym_evas_gl_symbols = NULL;
+Evas_Gl_Extension_String_Check _ckext = NULL;
Evas_GL_Common_Context_New glsym_evas_gl_common_context_new = NULL;
Evas_GL_Common_Context_Call glsym_evas_gl_common_context_flush = NULL;
@@ -168,6 +170,7 @@ eng_gbm_shutdown(Evas_Engine_Info_GL_Drm *info)
static void
symbols(void)
{
+ Evas_Gl_Extension_String_Check glsym_evas_gl_extension_string_check = NULL;
static Eina_Bool done = EINA_FALSE;
if (done) return;
@@ -202,15 +205,18 @@ symbols(void)
LINK2GENERIC(eglGetProcAddress);
LINK2GENERIC(evas_gl_common_eglCreateImage);
LINK2GENERIC(evas_gl_common_eglDestroyImage);
+ LINK2GENERIC(evas_gl_extension_string_check);
+
+ _ckext = glsym_evas_gl_extension_string_check;
done = EINA_TRUE;
}
void
-eng_gl_symbols(EGLDisplay edsp)
+eng_egl_symbols(EGLDisplay edsp)
{
static Eina_Bool done = EINA_FALSE;
- const char *exts = NULL;
+ const char *exts;
if (done) return;
@@ -218,7 +224,6 @@ eng_gl_symbols(EGLDisplay edsp)
if (!dst) dst = (typ)glsym_eglGetProcAddress(sym);
exts = eglQueryString(edsp, EGL_EXTENSIONS);
- glsym_evas_gl_symbols(glsym_eglGetProcAddress, exts);
FINDSYM(glsym_glEGLImageTargetTexture2DOES,
"glEGLImageTargetTexture2DOES", glsym_func_void);
@@ -236,6 +241,9 @@ eng_gl_symbols(EGLDisplay edsp)
FINDSYM(glsym_eglQueryWaylandBufferWL, "eglQueryWaylandBufferWL",
glsym_func_uint);
+ if (evas_gl_extension_string_check(exts, "EGL_IMG_context_priority"))
+ _extn_have_context_priority = 1;
+
done = EINA_TRUE;
}
@@ -259,15 +267,15 @@ gl_extn_veto(Render_Engine *re)
glsym_eglSwapBuffersWithDamage = NULL;
glsym_eglSetDamageRegionKHR = NULL;
}
- if (!strstr(str, "EGL_EXT_buffer_age"))
+ if (!_ckext(str, "EGL_EXT_buffer_age"))
_extn_have_buffer_age = 0;
- if (!strstr(str, "EGL_KHR_partial_update"))
+ if (!_ckext(str, "EGL_KHR_partial_update"))
glsym_eglSetDamageRegionKHR = NULL;
- if (!strstr(str, "EGL_EXT_swap_buffers_with_damage"))
+ if (!_ckext(str, "EGL_EXT_swap_buffers_with_damage"))
glsym_eglSwapBuffersWithDamage = NULL;
- if (strstr(str, "EGL_EXT_image_dma_buf_import"))
+ if (_ckext(str, "EGL_EXT_image_dma_buf_import"))
dmabuf_present = EINA_TRUE;
}
else
@@ -1215,19 +1223,14 @@ eng_image_native_set(void *engine, void *image, void *native)
}
}
- if ((!ns) && (!img->native.data)) return img;
-
evas_outbuf_use(ob);
- if (img->native.data)
+ if (!ns)
{
- if (img->native.func.free)
- img->native.func.free(img);
- glsym_evas_gl_common_image_native_disable(img);
+ glsym_evas_gl_common_image_free(img);
+ return NULL;
}
- if (!ns) return img;
-
if (ns->type == EVAS_NATIVE_SURFACE_WL_DMABUF)
{
wlid = wl_buf;
diff --git a/src/modules/evas/engines/gl_drm/evas_engine.h b/src/modules/evas/engines/gl_drm/evas_engine.h
index 3d3acf3de6..705d565d4f 100644
--- a/src/modules/evas/engines/gl_drm/evas_engine.h
+++ b/src/modules/evas/engines/gl_drm/evas_engine.h
@@ -28,6 +28,7 @@
extern int _evas_engine_gl_drm_log_dom;
extern int _extn_have_buffer_age;
+extern int _extn_have_context_priority;
# ifdef ERR
# undef ERR
@@ -64,6 +65,9 @@ extern Evas_GL_Common_Context_Resize_Call glsym_evas_gl_common_context_resize;
extern Evas_GL_Common_Buffer_Dump_Call glsym_evas_gl_common_buffer_dump;
extern Evas_GL_Preload_Render_Call glsym_evas_gl_preload_render_lock;
extern Evas_GL_Preload_Render_Call glsym_evas_gl_preload_render_unlock;
+extern Evas_Gl_Symbols glsym_evas_gl_symbols;
+extern void * (*glsym_eglGetProcAddress) (const char *a);
+extern Evas_Gl_Extension_String_Check _ckext;
typedef struct _Render_Engine Render_Engine;
struct _Render_Engine
@@ -138,7 +142,7 @@ void *evas_outbuf_egl_display_get(Outbuf *ob);
Context_3D *evas_outbuf_gl_context_new(Outbuf *ob);
void evas_outbuf_gl_context_use(Context_3D *ctx);
-void eng_gl_symbols(EGLDisplay edsp);
+void eng_egl_symbols(EGLDisplay edsp);
static inline Eina_Bool
_re_wincheck(Outbuf *ob)
diff --git a/src/modules/evas/engines/gl_drm/evas_outbuf.c b/src/modules/evas/engines/gl_drm/evas_outbuf.c
index aff5de87bf..4ab45bd694 100644
--- a/src/modules/evas/engines/gl_drm/evas_outbuf.c
+++ b/src/modules/evas/engines/gl_drm/evas_outbuf.c
@@ -144,15 +144,21 @@ static Eina_Bool
_evas_outbuf_init(void)
{
static int _init = 0;
+
if (_init) return EINA_TRUE;
#ifdef EGL_MESA_platform_gbm
- /* FIXME: Pretty sure we should be checking if EGL_EXT_platform_base
- * exists before looking these up and trusting them?
- */
- dlsym_eglGetPlatformDisplayEXT = (PFNEGLGETPLATFORMDISPLAYEXTPROC)
- eglGetProcAddress("eglGetPlatformDisplayEXT");
- dlsym_eglCreatePlatformWindowSurfaceEXT = (PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC)
- eglGetProcAddress("eglCreatePlatformWindowSurfaceEXT");
+ {
+ const char *exts;
+
+ exts = eglQueryString(NULL, EGL_EXTENSIONS);
+ if (_ckext(exts, "EGL_EXT_platform_base"))
+ {
+ dlsym_eglGetPlatformDisplayEXT = (PFNEGLGETPLATFORMDISPLAYEXTPROC)
+ eglGetProcAddress("eglGetPlatformDisplayEXT");
+ dlsym_eglCreatePlatformWindowSurfaceEXT = (PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC)
+ eglGetProcAddress("eglCreatePlatformWindowSurfaceEXT");
+ }
+ }
#endif
_init = 1;
return EINA_TRUE;
@@ -161,9 +167,10 @@ _evas_outbuf_init(void)
static Eina_Bool
_evas_outbuf_egl_setup(Outbuf *ob)
{
- int ctx_attr[3];
+ const char *exts;
+ int ctx_attr[5];
int cfg_attr[40];
- int maj = 0, min = 0, n = 0, i = 0;
+ int maj = 0, min = 0, n = 0, i = 0, cn = 0;
EGLint ncfg = 0;
EGLConfig *cfgs;
const GLubyte *vendor, *renderer, *version, *glslversion;
@@ -176,9 +183,15 @@ _evas_outbuf_egl_setup(Outbuf *ob)
}
/* setup gbm egl surface */
- ctx_attr[0] = EGL_CONTEXT_CLIENT_VERSION;
- ctx_attr[1] = 2;
- ctx_attr[2] = EGL_NONE;
+ ctx_attr[cn++] = EGL_CONTEXT_CLIENT_VERSION;
+ ctx_attr[cn++] = 2;
+
+ if (_extn_have_context_priority)
+ {
+ ctx_attr[cn++] = EGL_CONTEXT_PRIORITY_LEVEL_IMG;
+ ctx_attr[cn++] = EGL_CONTEXT_PRIORITY_HIGH_IMG;
+ }
+ ctx_attr[cn++] = EGL_NONE;
cfg_attr[n++] = EGL_RENDERABLE_TYPE;
cfg_attr[n++] = EGL_OPENGL_ES2_BIT;
@@ -226,6 +239,8 @@ _evas_outbuf_egl_setup(Outbuf *ob)
return EINA_FALSE;
}
+ eng_egl_symbols(ob->egl.disp);
+
if (!eglGetConfigs(ob->egl.disp, NULL, 0, &ncfg) || (ncfg == 0))
{
ERR("eglGetConfigs() fail. code=%#x", eglGetError());
@@ -299,6 +314,9 @@ _evas_outbuf_egl_setup(Outbuf *ob)
goto err;
}
+ exts = eglQueryString(ob->egl.disp, EGL_EXTENSIONS);
+ glsym_evas_gl_symbols(glsym_eglGetProcAddress, exts);
+
vendor = glGetString(GL_VENDOR);
renderer = glGetString(GL_RENDERER);
version = glGetString(GL_VERSION);
@@ -334,8 +352,6 @@ _evas_outbuf_egl_setup(Outbuf *ob)
goto err;
}
- eng_gl_symbols(ob->egl.disp);
-
ob->gl_context = glsym_evas_gl_common_context_new();
if (!ob->gl_context) goto err;
diff --git a/src/modules/evas/engines/gl_generic/evas_ector_gl.h b/src/modules/evas/engines/gl_generic/evas_ector_gl.h
index 49d9673934..6e4c46e5fc 100644
--- a/src/modules/evas/engines/gl_generic/evas_ector_gl.h
+++ b/src/modules/evas/engines/gl_generic/evas_ector_gl.h
@@ -4,15 +4,15 @@
#undef EAPI
#ifdef _WIN32
-# ifdef EFL_EVAS_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EVAS_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -23,7 +23,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#include "evas_ector_buffer.eo.h"
#include "evas_ector_gl_buffer.eo.h"
diff --git a/src/modules/evas/engines/gl_generic/evas_ector_gl_buffer.c b/src/modules/evas/engines/gl_generic/evas_ector_gl_buffer.c
index 3610fcd61d..f0a0b0c20a 100644
--- a/src/modules/evas/engines/gl_generic/evas_ector_gl_buffer.c
+++ b/src/modules/evas/engines/gl_generic/evas_ector_gl_buffer.c
@@ -190,7 +190,7 @@ _evas_ector_gl_buffer_evas_ector_buffer_engine_image_release(Eo *obj EINA_UNUSED
}
EOLIAN static void
-_evas_ector_gl_buffer_ector_buffer_size_get(Eo *obj EINA_UNUSED,
+_evas_ector_gl_buffer_ector_buffer_size_get(const Eo *obj EINA_UNUSED,
Evas_Ector_GL_Buffer_Data *pd,
int *w, int *h)
{
@@ -199,7 +199,7 @@ _evas_ector_gl_buffer_ector_buffer_size_get(Eo *obj EINA_UNUSED,
}
EOLIAN static Efl_Gfx_Colorspace
-_evas_ector_gl_buffer_ector_buffer_cspace_get(Eo *obj EINA_UNUSED,
+_evas_ector_gl_buffer_ector_buffer_cspace_get(const Eo *obj EINA_UNUSED,
Evas_Ector_GL_Buffer_Data *pd)
{
if (pd->alpha_only)
@@ -209,7 +209,7 @@ _evas_ector_gl_buffer_ector_buffer_cspace_get(Eo *obj EINA_UNUSED,
}
EOLIAN static Ector_Buffer_Flag
-_evas_ector_gl_buffer_ector_buffer_flags_get(Eo *obj EINA_UNUSED,
+_evas_ector_gl_buffer_ector_buffer_flags_get(const Eo *obj EINA_UNUSED,
Evas_Ector_GL_Buffer_Data *pd EINA_UNUSED)
{
return ECTOR_BUFFER_FLAG_CPU_READABLE | ECTOR_BUFFER_FLAG_DRAWABLE |
diff --git a/src/modules/evas/engines/gl_generic/evas_ector_gl_image_buffer.c b/src/modules/evas/engines/gl_generic/evas_ector_gl_image_buffer.c
index a14375dc43..2a85948eee 100644
--- a/src/modules/evas/engines/gl_generic/evas_ector_gl_image_buffer.c
+++ b/src/modules/evas/engines/gl_generic/evas_ector_gl_image_buffer.c
@@ -126,14 +126,14 @@ _evas_ector_gl_image_buffer_evas_ector_buffer_engine_image_release(Eo *obj EINA_
}
EOLIAN static Ector_Buffer_Flag
-_evas_ector_gl_image_buffer_ector_buffer_flags_get(Eo *obj EINA_UNUSED,
+_evas_ector_gl_image_buffer_ector_buffer_flags_get(const Eo *obj EINA_UNUSED,
Evas_Ector_GL_Image_Buffer_Data *pd EINA_UNUSED)
{
return ECTOR_BUFFER_FLAG_CPU_READABLE | ECTOR_BUFFER_FLAG_DRAWABLE;
}
EOLIAN static void
-_evas_ector_gl_image_buffer_ector_buffer_size_get(Eo *obj EINA_UNUSED,
+_evas_ector_gl_image_buffer_ector_buffer_size_get(const Eo *obj EINA_UNUSED,
Evas_Ector_GL_Image_Buffer_Data *pd,
int *w, int *h)
{
@@ -142,7 +142,7 @@ _evas_ector_gl_image_buffer_ector_buffer_size_get(Eo *obj EINA_UNUSED,
}
EOLIAN static Efl_Gfx_Colorspace
-_evas_ector_gl_image_buffer_ector_buffer_cspace_get(Eo *obj EINA_UNUSED,
+_evas_ector_gl_image_buffer_ector_buffer_cspace_get(const Eo *obj EINA_UNUSED,
Evas_Ector_GL_Image_Buffer_Data *pd EINA_UNUSED)
{
return EFL_GFX_COLORSPACE_ARGB8888;
diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c
index 0829e7a0b4..617ef47f73 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -484,18 +484,13 @@ eng_image_native_set(void *engine, void *image, void *native)
}
}
}
- if ((!ns) && (!im->native.data)) return im;
-
gl_generic_window_find(engine);
- if (im->native.data)
- {
- if (im->native.func.free)
- im->native.func.free(im);
- evas_gl_common_image_native_disable(im);
- }
-
- if (!ns) return im;
+ if (!ns)
+ {
+ evas_gl_common_image_free(im);
+ return NULL;
+ }
if (ns->type == EVAS_NATIVE_SURFACE_OPENGL)
{
@@ -1023,7 +1018,7 @@ eng_image_data_put(void *engine, void *image, DATA32 *image_data)
}
else if (im->gc->shared->info.sec_image_map)
{
- void *disp = disp = egl_display_get(engine);
+ void *disp = egl_display_get(engine);
secsym_eglUnmapImageSEC(disp, im->tex->pt->dyn.img, EGL_MAP_GL_TEXTURE_DEVICE_CPU_SEC);
}
}
@@ -1528,6 +1523,14 @@ evgl_init(Render_Engine_GL_Generic *engine)
#define EVGLINIT(_ret) Render_Output_GL_Generic *re; if ((re = evgl_init(engine)) == NULL) return _ret
+static Eina_Bool
+eng_gl_supports_evas_gl(void *engine EINA_UNUSED)
+{
+ // Evas GL should always work... But let's do a full init anyway.
+ EVGLINIT(EINA_FALSE);
+ return EINA_TRUE;
+}
+
static void *
eng_gl_output_set(void *eng, void *output)
{
@@ -2505,16 +2508,16 @@ eng_ector_create(void *engine EINA_UNUSED)
efl_domain_current_push(EFL_ID_DOMAIN_SHARED);
if (ector_backend && !strcasecmp(ector_backend, "default"))
{
- ector = efl_add(ECTOR_SOFTWARE_SURFACE_CLASS, NULL);
+ ector = efl_add_ref(ECTOR_SOFTWARE_SURFACE_CLASS, NULL);
}
else if (ector_backend && !strcasecmp(ector_backend, "experimental"))
{
- ector = efl_add(ECTOR_GL_SURFACE_CLASS, NULL);
+ ector = efl_add_ref(ECTOR_GL_SURFACE_CLASS, NULL);
use_gl = EINA_TRUE;
}
else
{
- ector = efl_add(ECTOR_CAIRO_SOFTWARE_SURFACE_CLASS, NULL);
+ ector = efl_add_ref(ECTOR_CAIRO_SOFTWARE_SURFACE_CLASS, NULL);
use_cairo = EINA_TRUE;
}
efl_domain_current_pop();
@@ -2524,7 +2527,7 @@ eng_ector_create(void *engine EINA_UNUSED)
static void
eng_ector_destroy(void *engine EINA_UNUSED, Ector_Surface *ector)
{
- if (ector) efl_del(ector);
+ if (ector) efl_unref(ector);
}
static Ector_Buffer *
@@ -2546,20 +2549,6 @@ eng_ector_buffer_new(void *engine, Evas *evas, int w, int h,
evas_ector_gl_buffer_prepare(efl_added, engine, w, h, cspace, flags));
}
-static Efl_Gfx_Render_Op
-_evas_render_op_to_ector_rop(Evas_Render_Op op)
-{
- switch (op)
- {
- case EVAS_RENDER_BLEND:
- return EFL_GFX_RENDER_OP_BLEND;
- case EVAS_RENDER_COPY:
- return EFL_GFX_RENDER_OP_COPY;
- default:
- return EFL_GFX_RENDER_OP_BLEND;
- }
-}
-
static void
eng_ector_renderer_draw(void *engine EINA_UNUSED, void *output,
void *context EINA_UNUSED, void *surface EINA_UNUSED,
@@ -2575,7 +2564,7 @@ eng_ector_renderer_draw(void *engine EINA_UNUSED, void *output,
eng_image_size_get(engine, glimg, &w, &h);
eina_array_push(c, eina_rectangle_new(0, 0, w, h));
- ector_renderer_draw(renderer, _evas_render_op_to_ector_rop(EVAS_RENDER_COPY), c, 0xffffffff);
+ ector_renderer_draw(renderer, EFL_GFX_RENDER_OP_BLEND, c, 0xffffffff);
while ((r = eina_array_pop(c)))
eina_rectangle_free(r);
@@ -2663,7 +2652,7 @@ eng_ector_begin(void *engine, void *output,
memset(pixels, 0, stride * h);
// it just uses the software backend to draw for now
- ector_buffer_pixels_set(ector, pixels, w, h, EFL_GFX_COLORSPACE_ARGB8888, EINA_TRUE);
+ ector_buffer_pixels_set(ector, pixels, w, h, stride, EFL_GFX_COLORSPACE_ARGB8888, EINA_TRUE);
ector_surface_reference_point_set(ector, x, y);
}
else
@@ -2687,7 +2676,7 @@ eng_ector_end(void *engine, void *output,
eng_image_data_put(engine, glim, pixels);
eng_image_data_put(engine, glim, pixels);
- ector_buffer_pixels_set(ector, NULL, 0, 0, EFL_GFX_COLORSPACE_ARGB8888, EINA_TRUE);
+ ector_buffer_pixels_set(ector, NULL, 0, 0, 0, EFL_GFX_COLORSPACE_ARGB8888, EINA_TRUE);
evas_common_cpu_end_opt();
}
else if (use_gl)
@@ -3180,6 +3169,7 @@ module_open(Evas_Module *em)
ORD(font_cache_set);
ORD(font_cache_get);
+ ORD(gl_supports_evas_gl);
ORD(gl_output_set);
ORD(gl_surface_create);
ORD(gl_pbuffer_surface_create);
diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c
index eb55c7720a..dabadcbb02 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.c
+++ b/src/modules/evas/engines/gl_x11/evas_engine.c
@@ -2384,16 +2384,12 @@ eng_image_native_set(void *engine, void *image, void *native)
#endif
}
}
- if ((!ns) && (!im->native.data)) return im;
-
- if (im->native.data)
- {
- if (im->native.func.free)
- im->native.func.free(im);
- glsym_evas_gl_common_image_native_disable(im);
- }
+ if (!ns)
+ {
+ glsym_evas_gl_common_image_free(im);
+ return NULL;
+ }
- if (!ns) return im;
if (ns->type == EVAS_NATIVE_SURFACE_X11)
{
@@ -2554,6 +2550,8 @@ eng_image_native_set(void *engine, void *image, void *native)
n->ns_data.x11.multiple_buffer = 0;
else
n->ns_data.x11.multiple_buffer = 1;
+ if (ob->detected.no_multi_buffer_native)
+ n->ns_data.x11.multiple_buffer = 0;
if (!n->ns_data.x11.surface)
{
diff --git a/src/modules/evas/engines/gl_x11/evas_engine.h b/src/modules/evas/engines/gl_x11/evas_engine.h
index c5cef71064..ed7277172d 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.h
+++ b/src/modules/evas/engines/gl_x11/evas_engine.h
@@ -75,6 +75,8 @@ struct _Outbuf
unsigned char msaa;
#ifndef GL_GLES
Eina_Bool loose_binding : 1;
+#else
+ Eina_Bool no_multi_buffer_native : 1;
#endif
} detected;
diff --git a/src/modules/evas/engines/gl_x11/evas_x_main.c b/src/modules/evas/engines/gl_x11/evas_x_main.c
index 10ab397c9d..b86916966b 100644
--- a/src/modules/evas/engines/gl_x11/evas_x_main.c
+++ b/src/modules/evas/engines/gl_x11/evas_x_main.c
@@ -345,6 +345,13 @@ try_gles2:
eng_window_free(gw);
return NULL;
}
+ // nvidia drivers in egl/gles mode dont need re-creating of the
+ // eglimage ... and doign so is super slow on them, so avoid the
+ // multi buffer path - as it's only for nvidia and this fixes
+ // the performance regression there, it's fairly safe to do
+ // as it's not universal across all drivers.
+ if (strstr((const char *)vendor, "NVIDIA"))
+ gw->detected.no_multi_buffer_native = 1;
eglGetConfigAttrib(gw->egl_disp, gw->egl_config, EGL_DEPTH_SIZE, &val);
gw->detected.depth_buffer_size = val;
diff --git a/src/modules/evas/engines/software_ddraw/Evas_Engine_Software_DDraw.h b/src/modules/evas/engines/software_ddraw/Evas_Engine_Software_DDraw.h
index 9735bb7c8b..bc2b69d291 100644
--- a/src/modules/evas/engines/software_ddraw/Evas_Engine_Software_DDraw.h
+++ b/src/modules/evas/engines/software_ddraw/Evas_Engine_Software_DDraw.h
@@ -17,7 +17,6 @@ struct _Evas_Engine_Info_Software_DDraw
struct {
HWND window;
- int depth;
int rotation;
unsigned int fullscreen : 1;
} info;
diff --git a/src/modules/evas/engines/software_ddraw/evas_ddraw_buffer.c b/src/modules/evas/engines/software_ddraw/evas_ddraw_buffer.c
index 3b94686d68..0886e37bb3 100644
--- a/src/modules/evas/engines/software_ddraw/evas_ddraw_buffer.c
+++ b/src/modules/evas/engines/software_ddraw/evas_ddraw_buffer.c
@@ -5,8 +5,7 @@
DD_Output_Buffer *
-evas_software_ddraw_output_buffer_new(int depth,
- int width,
+evas_software_ddraw_output_buffer_new(int width,
int height,
void *data)
{
@@ -16,10 +15,9 @@ evas_software_ddraw_output_buffer_new(int depth,
if (!ddob) return NULL;
ddob->data = data;
- ddob->depth = depth;
ddob->width = width;
ddob->height = height;
- ddob->pitch = width * depth / 8;
+ ddob->pitch = width * 4;
ddob->psize = ddob->pitch * height;
if (!ddob->data)
@@ -48,7 +46,6 @@ evas_software_ddraw_output_buffer_paste(DD_Output_Buffer *ddob,
int ddraw_width,
int ddraw_height,
int ddraw_pitch,
- int ddraw_depth,
int x,
int y)
{
@@ -69,9 +66,9 @@ evas_software_ddraw_output_buffer_paste(DD_Output_Buffer *ddob,
height = ((y + ddob->height) > ddraw_height)
? ddraw_height - y
: ddob->height;
- pitch = width * ddob->depth / 8;
+ pitch = width * 4;
- dd_data = (DATA8 *)ddraw_data + y * ddraw_pitch + x * ddraw_depth;
+ dd_data = (DATA8 *)ddraw_data + y * ddraw_pitch + x * 32;
evas_data = (unsigned char *)ddob->data;
for (j = 0; j < height; j++, evas_data += ddob->pitch, dd_data += ddraw_pitch)
memcpy(dd_data, evas_data, pitch);
@@ -84,9 +81,3 @@ evas_software_ddraw_output_buffer_data(DD_Output_Buffer *ddob,
if (bytes_per_line_ret) *bytes_per_line_ret = ddob->pitch;
return ddob->data;
}
-
-int
-evas_software_ddraw_output_buffer_depth(DD_Output_Buffer *ddob)
-{
- return ddob->depth;
-}
diff --git a/src/modules/evas/engines/software_ddraw/evas_ddraw_main.cpp b/src/modules/evas/engines/software_ddraw/evas_ddraw_main.cpp
index 2d98a04586..5d11b94124 100644
--- a/src/modules/evas/engines/software_ddraw/evas_ddraw_main.cpp
+++ b/src/modules/evas/engines/software_ddraw/evas_ddraw_main.cpp
@@ -3,7 +3,6 @@
int
evas_software_ddraw_init (HWND window,
- int depth,
int fullscreen,
Outbuf *buf)
{
@@ -38,12 +37,10 @@ evas_software_ddraw_init (HWND window,
pixel_format.dwSize = sizeof(pixel_format);
buf->priv.dd.surface_primary->GetPixelFormat(&pixel_format);
- if (pixel_format.dwRGBBitCount != (DWORD)depth)
+ if (pixel_format.dwRGBBitCount != 32)
goto release_object;
- buf->priv.dd.depth = depth;
-
- res = buf->priv.dd.object->SetDisplayMode(width, height, depth);
+ res = buf->priv.dd.object->SetDisplayMode(width, height, 32);
if (FAILED(res))
goto release_object;
@@ -54,7 +51,8 @@ evas_software_ddraw_init (HWND window,
surface_desc.dwBackBufferCount = 1;
res = buf->priv.dd.object->CreateSurface(&surface_desc,
- &buf->priv.dd.surface_primary, NULL);
+ &buf->priv.dd.surface_primary,
+ NULL);
if (FAILED(res))
goto release_object;
@@ -116,10 +114,8 @@ evas_software_ddraw_init (HWND window,
pixel_format.dwSize = sizeof(pixel_format);
buf->priv.dd.surface_primary->GetPixelFormat(&pixel_format);
- if (pixel_format.dwRGBBitCount != (DWORD)depth)
+ if (pixel_format.dwRGBBitCount != 32)
goto release_surface_back;
-
- buf->priv.dd.depth = depth;
}
return 1;
@@ -177,8 +173,7 @@ void *
evas_software_ddraw_lock(Outbuf *buf,
int *ddraw_width,
int *ddraw_height,
- int *ddraw_pitch,
- int *ddraw_depth)
+ int *ddraw_pitch)
{
DDSURFACEDESC surface_desc;
@@ -194,7 +189,6 @@ evas_software_ddraw_lock(Outbuf *buf,
*ddraw_width = surface_desc.dwWidth;
*ddraw_height = surface_desc.dwHeight;
*ddraw_pitch = surface_desc.lPitch;
- *ddraw_depth = surface_desc.ddpfPixelFormat.dwRGBBitCount >> 3;
return surface_desc.lpSurface;
}
diff --git a/src/modules/evas/engines/software_ddraw/evas_engine.c b/src/modules/evas/engines/software_ddraw/evas_engine.c
index 44e0f725f2..f74fe72f13 100644
--- a/src/modules/evas/engines/software_ddraw/evas_engine.c
+++ b/src/modules/evas/engines/software_ddraw/evas_engine.c
@@ -34,9 +34,7 @@ eng_output_setup(void *engine, void *in, unsigned int w, unsigned int h)
ob = evas_software_ddraw_outbuf_setup(w, h,
info->info.rotation,
- OUTBUF_DEPTH_INHERIT,
info->info.window,
- info->info.depth,
info->info.fullscreen);
if (!ob) goto on_error;
diff --git a/src/modules/evas/engines/software_ddraw/evas_engine.h b/src/modules/evas/engines/software_ddraw/evas_engine.h
index aac482f034..0d050bfb80 100644
--- a/src/modules/evas/engines/software_ddraw/evas_engine.h
+++ b/src/modules/evas/engines/software_ddraw/evas_engine.h
@@ -5,6 +5,7 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
+
#include <ddraw.h>
#include "../software_generic/Evas_Engine_Software_Generic.h"
@@ -14,7 +15,6 @@ typedef struct _DD_Output_Buffer DD_Output_Buffer;
struct _Outbuf
{
- Outbuf_Depth depth;
int width;
int height;
int rot;
@@ -28,7 +28,6 @@ struct _Outbuf
LPDIRECTDRAWSURFACE surface_primary;
LPDIRECTDRAWSURFACE surface_back;
LPDIRECTDRAWCLIPPER clipper;
- int depth;
unsigned char fullscreen : 1;
unsigned char swap : 1;
unsigned char bit_swap : 1;
@@ -67,7 +66,6 @@ struct _DD_Output_Buffer
void *data;
int width;
int height;
- int depth;
int pitch;
int psize;
};
@@ -108,9 +106,7 @@ void evas_software_ddraw_outbuf_free(Outbuf *buf);
Outbuf *evas_software_ddraw_outbuf_setup(int width,
int height,
int rotation,
- Outbuf_Depth depth,
HWND window,
- int w_depth,
int fullscreen);
void evas_software_ddraw_outbuf_reconfigure(Outbuf *buf,
@@ -144,14 +140,11 @@ int evas_software_ddraw_outbuf_width_get(Outbuf *buf);
int evas_software_ddraw_outbuf_height_get(Outbuf *buf);
-Outbuf_Depth evas_software_ddraw_outbuf_depth_get(Outbuf *buf);
-
int evas_software_ddraw_outbuf_rot_get(Outbuf *buf);
/* evas_ddraw_buffer.c */
-DD_Output_Buffer *evas_software_ddraw_output_buffer_new(int depth,
- int width,
+DD_Output_Buffer *evas_software_ddraw_output_buffer_new(int width,
int height,
void *data);
@@ -162,15 +155,12 @@ void evas_software_ddraw_output_buffer_paste(DD_Output_Buffer *ddob,
int ddraw_width,
int ddraw_height,
int ddraw_pitch,
- int ddraw_depth,
int x,
int y);
DATA8 *evas_software_ddraw_output_buffer_data(DD_Output_Buffer *ddob,
int *bytes_per_line_ret);
-int evas_software_ddraw_output_buffer_depth(DD_Output_Buffer *ddob);
-
/* evas_ddraw_main.cpp */
#ifdef __cplusplus
@@ -178,7 +168,6 @@ extern "C" {
#endif
int evas_software_ddraw_init (HWND window,
- int depth,
int fullscreen,
Outbuf *buf);
@@ -189,8 +178,7 @@ int evas_software_ddraw_masks_get(Outbuf *buf);
void *evas_software_ddraw_lock(Outbuf *buf,
int *ddraw_width,
int *ddraw_height,
- int *ddraw_pitch,
- int *ddraw_depth);
+ int *ddraw_pitch);
void evas_software_ddraw_unlock_and_flip(Outbuf *buf);
diff --git a/src/modules/evas/engines/software_ddraw/evas_outbuf.c b/src/modules/evas/engines/software_ddraw/evas_outbuf.c
index 55fd535333..0a4651337e 100644
--- a/src/modules/evas/engines/software_ddraw/evas_outbuf.c
+++ b/src/modules/evas/engines/software_ddraw/evas_outbuf.c
@@ -1,88 +1,6 @@
#include "evas_common_private.h"
#include "evas_engine.h"
-
-static Eina_List *ddpool = NULL;
-static int ddsize = 0;
-
-#define ddmemlimit 10 * 1024 * 1024
-#define ddcountlimit 32
-
-static DD_Output_Buffer *
-_find_ddob(int depth, int w, int h, void *data)
-{
- Eina_List *l;
- Eina_List *ddl;
- DD_Output_Buffer *ddob = NULL;
- DD_Output_Buffer *ddob2;
- int sz;
- int lbytes;
- int bpp;
-
- bpp = depth / 8;
- if (bpp == 3) bpp = 4;
- lbytes = (((w * bpp) + 3) / 4) * 4;
- sz = lbytes * h;
- EINA_LIST_FOREACH(ddpool, l, ddob2)
- {
- if (ddob2->depth != depth)
- continue;
- if (ddob2->psize == sz)
- {
- ddob = ddob2;
- ddl = l;
- goto have_ddob;
- }
- }
- if (!ddob)
- return evas_software_ddraw_output_buffer_new(depth, w, h, data);
-
- have_ddob:
- ddpool = eina_list_remove_list(ddpool, ddl);
- ddob->width = w;
- ddob->height = h;
- ddob->pitch = lbytes;
- ddsize -= ddob->psize * (ddob->depth / 8);
-
- return ddob;
-}
-
-static void
-_unfind_ddob(DD_Output_Buffer *ddob)
-{
- ddpool = eina_list_prepend(ddpool, ddob);
- ddsize += ddob->psize * ddob->depth / 8;
- while ((ddsize > (ddmemlimit)) ||
- (eina_list_count(ddpool) > ddcountlimit))
- {
- Eina_List *xl;
-
- xl = eina_list_last(ddpool);
- if (!xl)
- {
- ddsize = 0;
- break;
- }
- ddob = xl->data;
- ddpool = eina_list_remove_list(ddpool, xl);
- evas_software_ddraw_output_buffer_free(ddob);
- }
-}
-
-static void
-_clear_ddob(int sync EINA_UNUSED)
-{
- while (ddpool)
- {
- DD_Output_Buffer *ddob;
-
- ddob = ddpool->data;
- ddpool = eina_list_remove_list(ddpool, ddpool);
- evas_software_ddraw_output_buffer_free(ddob);
- }
- ddsize = 0;
-}
-
void
evas_software_ddraw_outbuf_init(void)
{
@@ -102,9 +20,7 @@ Outbuf *
evas_software_ddraw_outbuf_setup(int width,
int height,
int rotation,
- Outbuf_Depth depth,
HWND window,
- int w_depth,
int fullscreen)
{
Outbuf *buf;
@@ -115,10 +31,9 @@ evas_software_ddraw_outbuf_setup(int width,
buf->width = width;
buf->height = height;
- buf->depth = depth;
buf->rot = rotation;
- if (!evas_software_ddraw_init(window, w_depth, fullscreen, buf))
+ if (!evas_software_ddraw_init(window, fullscreen, buf))
{
free(buf);
return NULL;
@@ -128,7 +43,7 @@ evas_software_ddraw_outbuf_setup(int width,
Gfx_Func_Convert conv_func;
DD_Output_Buffer *ddob;
- ddob = evas_software_ddraw_output_buffer_new(w_depth, 1, 1, NULL);
+ ddob = evas_software_ddraw_output_buffer_new(1, 1, NULL);
conv_func = NULL;
if (ddob)
@@ -139,7 +54,7 @@ evas_software_ddraw_outbuf_setup(int width,
conv_func = evas_common_convert_func_get(0,
width,
height,
- evas_software_ddraw_output_buffer_depth (ddob),
+ 32,
buf->priv.mask.r,
buf->priv.mask.g,
buf->priv.mask.b,
@@ -149,7 +64,7 @@ evas_software_ddraw_outbuf_setup(int width,
conv_func = evas_common_convert_func_get(0,
height,
width,
- evas_software_ddraw_output_buffer_depth (ddob),
+ 32,
buf->priv.mask.r,
buf->priv.mask.g,
buf->priv.mask.b,
@@ -163,11 +78,10 @@ evas_software_ddraw_outbuf_setup(int width,
{
ERR("DDraw engine Error"
" {"
- " At depth %i:"
+ " At depth 32:"
" RGB format mask: %08x, %08x, %08x"
" Not supported by and compiled in converters!"
" }",
- buf->priv.dd.depth,
buf->priv.mask.r,
buf->priv.mask.g,
buf->priv.mask.b);
@@ -183,10 +97,10 @@ evas_software_ddraw_outbuf_reconfigure(Outbuf *buf,
int width,
int height,
int rotation,
- Outbuf_Depth depth)
+ Outbuf_Depth depth EINA_UNUSED)
{
if ((width == buf->width) && (height == buf->height) &&
- (rotation == buf->rot) && (depth == buf->depth))
+ (rotation == buf->rot))
return;
buf->width = width;
buf->height = height;
@@ -225,13 +139,7 @@ evas_software_ddraw_outbuf_new_region_for_update(Outbuf *buf,
(buf->priv.mask.g == 0x00ff00) &&
(buf->priv.mask.b == 0x0000ff))
{
- obr->ddob = _find_ddob(buf->priv.dd.depth, w, h, NULL);
-/* obr->ddob = evas_software_x11_x_output_buffer_new(buf->priv.dd.disp, */
-/* buf->priv.dd.vis, */
-/* buf->priv.dd.depth, */
-/* w, h, */
-/* use_shm, */
-/* NULL); */
+ obr->ddob = evas_software_ddraw_output_buffer_new(w, h, NULL);
im = (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(),
w, h,
(DATA32 *) evas_software_ddraw_output_buffer_data(obr->ddob, &bpl),
@@ -245,25 +153,9 @@ evas_software_ddraw_outbuf_new_region_for_update(Outbuf *buf,
evas_cache_image_surface_alloc(&im->cache_entry, w, h);
im->extended_info = obr;
if ((buf->rot == 0) || (buf->rot == 180))
- obr->ddob = _find_ddob(buf->priv.dd.depth, w, h, NULL);
-/*
- obr->ddob = evas_software_x11_x_output_buffer_new(buf->priv.dd.disp,
- buf->priv.dd.vis,
- buf->priv.dd.depth,
- w, h,
- use_shm,
- NULL);
- */
+ obr->ddob = evas_software_ddraw_output_buffer_new(w, h, NULL);
else if ((buf->rot == 90) || (buf->rot == 270))
- obr->ddob = _find_ddob(buf->priv.dd.depth, h, w, NULL);
-/*
- obr->ddob = evas_software_x11_x_output_buffer_new(buf->priv.dd.disp,
- buf->priv.dd.vis,
- buf->priv.dd.depth,
- h, w,
- use_shm,
- NULL);
- */
+ obr->ddob = evas_software_ddraw_output_buffer_new(h, w, NULL);
}
buf->priv.pending_writes = eina_list_append(buf->priv.pending_writes, im);
@@ -289,7 +181,7 @@ evas_software_ddraw_outbuf_push_updated_region(Outbuf *buf,
if ((buf->rot == 0) || (buf->rot == 180))
conv_func = evas_common_convert_func_get(0, w, h,
- evas_software_ddraw_output_buffer_depth(obr->ddob),
+ 32,
buf->priv.mask.r,
buf->priv.mask.g,
buf->priv.mask.b,
@@ -297,7 +189,7 @@ evas_software_ddraw_outbuf_push_updated_region(Outbuf *buf,
buf->rot);
else if ((buf->rot == 90) || (buf->rot == 270))
conv_func = evas_common_convert_func_get(0, h, w,
- evas_software_ddraw_output_buffer_depth(obr->ddob),
+ 32,
buf->priv.mask.r,
buf->priv.mask.g,
buf->priv.mask.b,
@@ -340,7 +232,7 @@ evas_software_ddraw_outbuf_push_updated_region(Outbuf *buf,
if (data != src_data)
conv_func(src_data, data,
0,
- bpl / ((evas_software_ddraw_output_buffer_depth(obr->ddob) / 8)) - obr->width,
+ bpl / 4 - obr->width,
obr->width,
obr->height,
x,
@@ -358,7 +250,6 @@ evas_software_ddraw_outbuf_flush(Outbuf *buf, Tilebuf_Rect *surface_damage EINA_
int ddraw_width;
int ddraw_height;
int ddraw_pitch;
- int ddraw_depth;
if (render_mode == EVAS_RENDER_MODE_ASYNC_INIT) return;
@@ -366,8 +257,7 @@ evas_software_ddraw_outbuf_flush(Outbuf *buf, Tilebuf_Rect *surface_damage EINA_
if (!(ddraw_data = evas_software_ddraw_lock(buf,
&ddraw_width,
&ddraw_height,
- &ddraw_pitch,
- &ddraw_depth)))
+ &ddraw_pitch)))
goto free_images;
/* copy safely the images that need to be drawn onto the back surface */
@@ -382,7 +272,6 @@ evas_software_ddraw_outbuf_flush(Outbuf *buf, Tilebuf_Rect *surface_damage EINA_
ddraw_width,
ddraw_height,
ddraw_pitch,
- ddraw_depth,
obr->x,
obr->y);
}
@@ -399,10 +288,8 @@ evas_software_ddraw_outbuf_flush(Outbuf *buf, Tilebuf_Rect *surface_damage EINA_
buf->priv.prev_pending_writes);
obr = im->extended_info;
evas_cache_image_drop(&im->cache_entry);
- if (obr->ddob) _unfind_ddob(obr->ddob);
-/*
- if (obr->ddob) evas_software_x11_x_output_buffer_free(obr->ddob);
- */
+ if (obr->ddob)
+ evas_software_ddraw_output_buffer_free(obr->ddob);
free(obr);
}
buf->priv.prev_pending_writes = buf->priv.pending_writes;
@@ -425,10 +312,10 @@ evas_software_ddraw_outbuf_idle_flush(Outbuf *buf)
buf->priv.prev_pending_writes);
obr = im->extended_info;
evas_cache_image_drop((Image_Entry *)im);
- if (obr->ddob) _unfind_ddob(obr->ddob);
+ if (obr->ddob)
+ evas_software_ddraw_output_buffer_free(obr->ddob);
free(obr);
}
- _clear_ddob(0);
}
int
@@ -443,12 +330,6 @@ evas_software_ddraw_outbuf_height_get(Outbuf *buf)
return buf->height;
}
-Outbuf_Depth
-evas_software_ddraw_outbuf_depth_get(Outbuf *buf)
-{
- return buf->depth;
-}
-
int
evas_software_ddraw_outbuf_rot_get(Outbuf *buf)
{
diff --git a/src/modules/evas/engines/software_gdi/Evas_Engine_Software_Gdi.h b/src/modules/evas/engines/software_gdi/Evas_Engine_Software_Gdi.h
index deac5b29e1..c565a5e009 100644
--- a/src/modules/evas/engines/software_gdi/Evas_Engine_Software_Gdi.h
+++ b/src/modules/evas/engines/software_gdi/Evas_Engine_Software_Gdi.h
@@ -17,7 +17,6 @@ struct _Evas_Engine_Info_Software_Gdi
struct {
HWND window;
- int depth;
int rotation;
unsigned int borderless : 1;
unsigned int fullscreen : 1;
diff --git a/src/modules/evas/engines/software_gdi/evas_engine.c b/src/modules/evas/engines/software_gdi/evas_engine.c
index 465607853e..de3b567021 100644
--- a/src/modules/evas/engines/software_gdi/evas_engine.c
+++ b/src/modules/evas/engines/software_gdi/evas_engine.c
@@ -16,6 +16,14 @@ struct _Render_Engine
};
/* engine api this module provides */
+static void
+eng_output_info_setup(void *info)
+{
+ Evas_Engine_Info_Software_Gdi *einfo = info;
+
+ einfo->render_mode = EVAS_RENDER_MODE_BLOCKING;
+}
+
static void *
eng_output_setup(void *engine, void *in, unsigned int w, unsigned int h)
{
@@ -35,9 +43,7 @@ eng_output_setup(void *engine, void *in, unsigned int w, unsigned int h)
ob = evas_software_gdi_outbuf_setup(w, h,
info->info.rotation,
- OUTBUF_DEPTH_INHERIT,
info->info.window,
- info->info.depth,
info->info.borderless,
info->info.fullscreen,
info->info.region,
@@ -81,9 +87,7 @@ eng_output_update(void *engine EINA_UNUSED, void *data, void *in, unsigned int w
ob = evas_software_gdi_outbuf_setup(w,
h,
info->info.rotation,
- OUTBUF_DEPTH_INHERIT,
info->info.window,
- info->info.depth,
info->info.borderless,
info->info.fullscreen,
info->info.region,
@@ -134,6 +138,7 @@ module_open(Evas_Module *em)
func = pfunc;
/* now to override methods */
#define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_)
+ ORD(output_info_setup);
ORD(output_setup);
ORD(output_update);
ORD(canvas_alpha_get);
diff --git a/src/modules/evas/engines/software_gdi/evas_engine.h b/src/modules/evas/engines/software_gdi/evas_engine.h
index 88d1cac214..329ec33399 100644
--- a/src/modules/evas/engines/software_gdi/evas_engine.h
+++ b/src/modules/evas/engines/software_gdi/evas_engine.h
@@ -47,7 +47,6 @@ struct BITMAPINFO_GDI
struct _Outbuf
{
- Outbuf_Depth depth;
int width;
int height;
int rot;
@@ -60,7 +59,6 @@ struct _Outbuf
HWND window;
HDC dc;
HRGN regions;
- int depth;
unsigned char borderless : 1;
unsigned char fullscreen : 1;
unsigned char region : 1;
@@ -101,7 +99,6 @@ struct _Gdi_Output_Buffer
int width;
int height;
void *data;
- int depth;
int pitch;
int psize;
};
@@ -109,7 +106,6 @@ struct _Gdi_Output_Buffer
/* evas_gdi_main.c */
int evas_software_gdi_init (HWND window,
- int depth,
unsigned int borderless,
unsigned int fullscreen,
unsigned int region,
@@ -123,7 +119,6 @@ void evas_software_gdi_bitmap_resize(Outbuf *buf);
Gdi_Output_Buffer *evas_software_gdi_output_buffer_new(HDC dc,
BITMAPINFO_GDI *bitmap_info,
- int depth,
int width,
int height,
void *data);
@@ -137,8 +132,6 @@ void evas_software_gdi_output_buffer_paste(Gdi_Output_Buffer *gdiob,
DATA8 *evas_software_gdi_output_buffer_data(Gdi_Output_Buffer *gdiob,
int *pitch);
-int evas_software_gdi_output_buffer_depth(Gdi_Output_Buffer *gdiob);
-
/* evas_outbuf.c */
void evas_software_gdi_outbuf_init(void);
@@ -148,9 +141,7 @@ void evas_software_gdi_outbuf_free(Outbuf *buf);
Outbuf *evas_software_gdi_outbuf_setup(int width,
int height,
int rotation,
- Outbuf_Depth depth,
HWND window,
- int w_depth,
unsigned int borderless,
unsigned int fullscreen,
unsigned int region,
@@ -188,8 +179,6 @@ int evas_software_gdi_outbuf_width_get(Outbuf *buf);
int evas_software_gdi_outbuf_height_get(Outbuf *buf);
-Outbuf_Depth evas_software_gdi_outbuf_depth_get(Outbuf *buf);
-
int evas_software_gdi_outbuf_rot_get(Outbuf *buf);
diff --git a/src/modules/evas/engines/software_gdi/evas_gdi_buffer.c b/src/modules/evas/engines/software_gdi/evas_gdi_buffer.c
index ab233ddec8..8d9c1ac425 100644
--- a/src/modules/evas/engines/software_gdi/evas_gdi_buffer.c
+++ b/src/modules/evas/engines/software_gdi/evas_gdi_buffer.c
@@ -6,7 +6,6 @@
Gdi_Output_Buffer *
evas_software_gdi_output_buffer_new(HDC dc,
BITMAPINFO_GDI *bitmap_info,
- int depth,
int width,
int height,
void *data)
@@ -20,7 +19,7 @@ evas_software_gdi_output_buffer_new(HDC dc,
{
bitmap_info->bih.biWidth = width;
bitmap_info->bih.biHeight = -height;
- bitmap_info->bih.biSizeImage = (depth >> 3) * width * height;
+ bitmap_info->bih.biSizeImage = 4 * width * height;
gdiob->bitmap = CreateDIBSection(dc,
(const BITMAPINFO *)bitmap_info,
DIB_RGB_COLORS,
@@ -39,9 +38,7 @@ evas_software_gdi_output_buffer_new(HDC dc,
gdiob->data = data;
gdiob->width = width;
gdiob->height = height;
- gdiob->depth = depth;
- gdiob->pitch = width * (depth >> 3);
-/* gdiob->psize = gdiob->pitch * height; */
+ gdiob->pitch = width * 4;
return gdiob;
}
@@ -83,9 +80,3 @@ evas_software_gdi_output_buffer_data(Gdi_Output_Buffer *gdiob,
if (pitch) *pitch = gdiob->pitch;
return gdiob->data;
}
-
-int
-evas_software_gdi_output_buffer_depth(Gdi_Output_Buffer *gdiob)
-{
- return gdiob->depth;
-}
diff --git a/src/modules/evas/engines/software_gdi/evas_gdi_main.c b/src/modules/evas/engines/software_gdi/evas_gdi_main.c
index 2ffc0c1270..98f1a79ab2 100644
--- a/src/modules/evas/engines/software_gdi/evas_gdi_main.c
+++ b/src/modules/evas/engines/software_gdi/evas_gdi_main.c
@@ -4,7 +4,6 @@
int
evas_software_gdi_init (HWND window,
- int depth,
unsigned int borderless,
unsigned int fullscreen EINA_UNUSED,
unsigned int region,
@@ -26,14 +25,12 @@ evas_software_gdi_init (HWND window,
return 0;
}
- /* FIXME: check depth */
- if (depth != GetDeviceCaps(buf->priv.gdi.dc, BITSPIXEL))
+ if (GetDeviceCaps(buf->priv.gdi.dc, BITSPIXEL) != 32)
{
ERR("[Engine] [GDI] no compatible depth");
ReleaseDC(window, buf->priv.gdi.dc);
return 0;
}
- buf->priv.gdi.depth = depth;
/* FIXME: support fullscreen */
@@ -49,32 +46,16 @@ evas_software_gdi_init (HWND window,
buf->priv.gdi.bitmap_info->bih.biWidth = buf->width;
buf->priv.gdi.bitmap_info->bih.biHeight = -buf->height;
buf->priv.gdi.bitmap_info->bih.biPlanes = 1;
- buf->priv.gdi.bitmap_info->bih.biSizeImage = (buf->priv.gdi.depth >> 3) * buf->width * buf->height;
+ buf->priv.gdi.bitmap_info->bih.biSizeImage = 4 * buf->width * buf->height;
buf->priv.gdi.bitmap_info->bih.biXPelsPerMeter = 0;
buf->priv.gdi.bitmap_info->bih.biYPelsPerMeter = 0;
buf->priv.gdi.bitmap_info->bih.biClrUsed = 0;
buf->priv.gdi.bitmap_info->bih.biClrImportant = 0;
- buf->priv.gdi.bitmap_info->bih.biBitCount = buf->priv.gdi.depth;
+ buf->priv.gdi.bitmap_info->bih.biBitCount = 32;
buf->priv.gdi.bitmap_info->bih.biCompression = BI_BITFIELDS;
-
- switch (depth)
- {
- case 16:
- buf->priv.gdi.bitmap_info->masks[0] = 0x0000f800;
- buf->priv.gdi.bitmap_info->masks[1] = 0x000007e0;
- buf->priv.gdi.bitmap_info->masks[2] = 0x0000001f;
- break;
- case 32:
- buf->priv.gdi.bitmap_info->masks[0] = 0x00ff0000;
- buf->priv.gdi.bitmap_info->masks[1] = 0x0000ff00;
- buf->priv.gdi.bitmap_info->masks[2] = 0x000000ff;
- break;
- default:
- ERR("[Engine] [GDI] wrong depth");
- free(buf->priv.gdi.bitmap_info);
- ReleaseDC(window, buf->priv.gdi.dc);
- return 0;
- }
+ buf->priv.gdi.bitmap_info->masks[0] = 0x00ff0000;
+ buf->priv.gdi.bitmap_info->masks[1] = 0x0000ff00;
+ buf->priv.gdi.bitmap_info->masks[2] = 0x000000ff;
return 1;
}
@@ -96,5 +77,5 @@ evas_software_gdi_bitmap_resize(Outbuf *buf)
{
buf->priv.gdi.bitmap_info->bih.biWidth = buf->width;
buf->priv.gdi.bitmap_info->bih.biHeight = -buf->height;
- buf->priv.gdi.bitmap_info->bih.biSizeImage = (buf->priv.gdi.depth >> 3) * buf->width * buf->height;
+ buf->priv.gdi.bitmap_info->bih.biSizeImage = 4 * buf->width * buf->height;
}
diff --git a/src/modules/evas/engines/software_gdi/evas_outbuf.c b/src/modules/evas/engines/software_gdi/evas_outbuf.c
index 68a1a3e463..e23cabe873 100644
--- a/src/modules/evas/engines/software_gdi/evas_outbuf.c
+++ b/src/modules/evas/engines/software_gdi/evas_outbuf.c
@@ -1,89 +1,6 @@
#include "evas_common_private.h"
#include "evas_engine.h"
-
-static Eina_List *gdipool = NULL;
-static int gdisize = 0;
-static int gdimemlimit = 10 * 1024 * 1024;
-static int gdicountlimit = 32;
-
-static Gdi_Output_Buffer *
-_find_gdiob(HDC dc, BITMAPINFO_GDI *bitmap_info, int depth, int w, int h, void *data)
-{
- Eina_List *l = NULL;
- Eina_List *gdil = NULL;
- Gdi_Output_Buffer *gdiob = NULL;
- Gdi_Output_Buffer *gdiob2;
- int sz;
- int lbytes;
- int bpp;
-
- bpp = depth >> 3;
- if (bpp == 3) bpp = 4;
- lbytes = (((w * bpp) + 3) / 4) * 4;
- sz = lbytes * h;
- EINA_LIST_FOREACH(gdipool, l, gdiob2)
- {
- if ((gdiob2->dc != dc) ||
- (gdiob2->bitmap_info != bitmap_info) ||
- (gdiob2->depth != depth))
- continue;
- if (gdiob2->psize == sz)
- {
- gdiob = gdiob2;
- gdil = l;
- goto have_gdiob;
- }
- }
- if (!gdiob)
- return evas_software_gdi_output_buffer_new(dc, bitmap_info, depth, w, h, data);
-
- have_gdiob:
- gdipool = eina_list_remove_list(gdipool, gdil);
- gdiob->width = w;
- gdiob->height = h;
- gdiob->pitch = lbytes;
- gdisize -= gdiob->psize * (gdiob->depth >> 3);
-
- return gdiob;
-}
-
-static void
-_unfind_gdiob(Gdi_Output_Buffer *gdiob)
-{
- gdipool = eina_list_prepend(gdipool, gdiob);
- gdisize += gdiob->psize * (gdiob->depth >> 3);
- while ((gdisize > (gdimemlimit)) ||
- ((int)eina_list_count(gdipool) > gdicountlimit))
- {
- Eina_List *xl;
-
- xl = eina_list_last(gdipool);
- if (!xl)
- {
- gdisize = 0;
- break;
- }
- gdiob = xl->data;
- gdipool = eina_list_remove_list(gdipool, xl);
- evas_software_gdi_output_buffer_free(gdiob);
- }
-}
-
-static void
-_clear_gdiob()
-{
- while (gdipool)
- {
- Gdi_Output_Buffer *gdiob;
-
- gdiob = gdipool->data;
- gdipool = eina_list_remove_list(gdipool, gdipool);
- evas_software_gdi_output_buffer_free(gdiob);
- }
- gdisize = 0;
-}
-
void
evas_software_gdi_outbuf_init(void)
{
@@ -104,7 +21,8 @@ evas_software_gdi_outbuf_free(Outbuf *buf)
buf->priv.pending_writes = eina_list_remove_list(buf->priv.pending_writes, buf->priv.pending_writes);
obr = im->extended_info;
evas_cache_image_drop(&im->cache_entry);
- if (obr->gdiob) _unfind_gdiob(obr->gdiob);
+ if (obr->gdiob)
+ evas_software_gdi_output_buffer_free(obr->gdiob);
/* if (obr->mxob) _unfind_xob(obr->mxob, 0); */
free(obr);
}
@@ -119,9 +37,7 @@ Outbuf *
evas_software_gdi_outbuf_setup(int width,
int height,
int rotation,
- Outbuf_Depth depth,
HWND window,
- int w_depth,
unsigned int borderless,
unsigned int fullscreen,
unsigned int region,
@@ -136,13 +52,12 @@ evas_software_gdi_outbuf_setup(int width,
buf->width = width;
buf->height = height;
- buf->depth = depth;
buf->rot = rotation;
buf->priv.mask_dither = mask_dither;
buf->priv.destination_alpha = destination_alpha;
- if (!evas_software_gdi_init(window, w_depth, borderless, fullscreen, region, buf))
+ if (!evas_software_gdi_init(window, borderless, fullscreen, region, buf))
{
free(buf);
return NULL;
@@ -152,7 +67,7 @@ evas_software_gdi_outbuf_setup(int width,
Gfx_Func_Convert conv_func;
Gdi_Output_Buffer *gdiob;
- gdiob = evas_software_gdi_output_buffer_new(buf->priv.gdi.dc, buf->priv.gdi.bitmap_info, w_depth, 1, 1, NULL);
+ gdiob = evas_software_gdi_output_buffer_new(buf->priv.gdi.dc, buf->priv.gdi.bitmap_info, 1, 1, NULL);
conv_func = NULL;
if (gdiob)
@@ -161,7 +76,7 @@ evas_software_gdi_outbuf_setup(int width,
conv_func = evas_common_convert_func_get(0,
width,
height,
- evas_software_gdi_output_buffer_depth (gdiob),
+ 32,
buf->priv.gdi.bitmap_info->masks[0],
buf->priv.gdi.bitmap_info->masks[1],
buf->priv.gdi.bitmap_info->masks[2],
@@ -171,7 +86,7 @@ evas_software_gdi_outbuf_setup(int width,
conv_func = evas_common_convert_func_get(0,
height,
width,
- evas_software_gdi_output_buffer_depth (gdiob),
+ 32,
buf->priv.gdi.bitmap_info->masks[0],
buf->priv.gdi.bitmap_info->masks[1],
buf->priv.gdi.bitmap_info->masks[2],
@@ -184,11 +99,10 @@ evas_software_gdi_outbuf_setup(int width,
{
ERR(".[ soft_gdi engine Error ]."
" {"
- " At depth %i:"
+ " At depth 32:"
" RGB format mask: %08lx, %08lx, %08lx"
" Not supported by and compiled in converters!"
" }",
- buf->priv.gdi.depth,
buf->priv.gdi.bitmap_info->masks[0],
buf->priv.gdi.bitmap_info->masks[1],
buf->priv.gdi.bitmap_info->masks[2]);
@@ -204,10 +118,10 @@ evas_software_gdi_outbuf_reconfigure(Outbuf *buf,
int width,
int height,
int rotation,
- Outbuf_Depth depth)
+ Outbuf_Depth depth EINA_UNUSED)
{
if ((width == buf->width) && (height == buf->height) &&
- (rotation == buf->rot) && (depth == buf->depth))
+ (rotation == buf->rot))
return;
buf->width = width;
buf->height = height;
@@ -249,15 +163,9 @@ evas_software_gdi_outbuf_new_region_for_update(Outbuf *buf,
(buf->priv.gdi.bitmap_info->masks[1] == 0x00ff00) &&
(buf->priv.gdi.bitmap_info->masks[2] == 0x0000ff))
{
- obr->gdiob = _find_gdiob(buf->priv.gdi.dc,
- buf->priv.gdi.bitmap_info,
- buf->priv.gdi.depth,
- w, h, NULL);
-/* obr->gdiob = evas_software_gdi_output_buffer_new(buf->priv.gdi.dc, */
-/* buf->priv.gdi.bitmap_info, */
-/* buf->priv.gdi.depth, */
-/* w, h, */
-/* NULL); */
+ obr->gdiob = evas_software_gdi_output_buffer_new(buf->priv.gdi.dc,
+ buf->priv.gdi.bitmap_info,
+ w, h, NULL);
im = (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(),
w, h,
(DATA32 *)evas_software_gdi_output_buffer_data(obr->gdiob, &bpl),
@@ -276,31 +184,13 @@ evas_software_gdi_outbuf_new_region_for_update(Outbuf *buf,
evas_cache_image_surface_alloc(&im->cache_entry, w, h);
im->extended_info = obr;
if ((buf->rot == 0) || (buf->rot == 180))
- obr->gdiob = _find_gdiob(buf->priv.gdi.dc,
- buf->priv.gdi.bitmap_info,
- buf->priv.gdi.depth,
- w, h, NULL);
-/*
- obr->gdiob = evas_software_x11_x_output_buffer_new(buf->priv.dd.disp,
- buf->priv.dd.vis,
- buf->priv.dd.depth,
- w, h,
- use_shm,
- NULL);
- */
+ obr->gdiob = evas_software_gdi_output_buffer_new(buf->priv.gdi.dc,
+ buf->priv.gdi.bitmap_info,
+ w, h, NULL);
else if ((buf->rot == 90) || (buf->rot == 270))
- obr->gdiob = _find_gdiob(buf->priv.gdi.dc,
- buf->priv.gdi.bitmap_info,
- buf->priv.gdi.depth,
- h, w, NULL);
-/*
- obr->gdiob = evas_software_x11_x_output_buffer_new(buf->priv.dd.disp,
- buf->priv.dd.vis,
- buf->priv.dd.depth,
- h, w,
- use_shm,
- NULL);
- */
+ obr->gdiob = evas_software_gdi_output_buffer_new(buf->priv.gdi.dc,
+ buf->priv.gdi.bitmap_info,
+ h, w, NULL);
/* if (buf->priv.gdi.mask) */
/* obr->mgdiob = _find_gdiob(buf->priv.gdi.dc, */
/* buf->priv.gdi.bitmap_info, */
@@ -336,16 +226,14 @@ evas_software_gdi_outbuf_push_updated_region(Outbuf *buf,
obr = update->extended_info;
if ((buf->rot == 0) || (buf->rot == 180))
- conv_func = evas_common_convert_func_get(0, w, h,
- evas_software_gdi_output_buffer_depth(obr->gdiob),
+ conv_func = evas_common_convert_func_get(0, w, h, 32,
buf->priv.gdi.bitmap_info->masks[0],
buf->priv.gdi.bitmap_info->masks[1],
buf->priv.gdi.bitmap_info->masks[2],
PAL_MODE_NONE,
buf->rot);
else if ((buf->rot == 90) || (buf->rot == 270))
- conv_func = evas_common_convert_func_get(0, h, w,
- evas_software_gdi_output_buffer_depth(obr->gdiob),
+ conv_func = evas_common_convert_func_get(0, h, w, 32,
buf->priv.gdi.bitmap_info->masks[0],
buf->priv.gdi.bitmap_info->masks[1],
buf->priv.gdi.bitmap_info->masks[2],
@@ -389,7 +277,7 @@ evas_software_gdi_outbuf_push_updated_region(Outbuf *buf,
if (data != src_data)
conv_func(src_data, data,
0,
- bpl / (evas_software_gdi_output_buffer_depth(obr->gdiob) >> 3) - obr->width,
+ bpl / 4 - obr->width,
obr->width,
obr->height,
x,
@@ -580,9 +468,9 @@ evas_software_gdi_outbuf_flush(Outbuf *buf, Tilebuf_Rect *surface_damage EINA_UN
buf->priv.prev_pending_writes);
obr = im->extended_info;
evas_cache_image_drop(&im->cache_entry);
- if (obr->gdiob) _unfind_gdiob(obr->gdiob);
+ if (obr->gdiob)
+ evas_software_gdi_output_buffer_free(obr->gdiob);
/* if (obr->mgdiob) _unfind_gdiob(obr->mgdiob); */
-/* if (obr->gdiob) evas_software_x11_x_output_buffer_free(obr->gdiob); */
free(obr);
}
buf->priv.prev_pending_writes = buf->priv.pending_writes;
@@ -605,11 +493,11 @@ evas_software_gdi_outbuf_idle_flush(Outbuf *buf)
buf->priv.prev_pending_writes);
obr = im->extended_info;
evas_cache_image_drop((Image_Entry *)im);
- if (obr->gdiob) _unfind_gdiob(obr->gdiob);
+ if (obr->gdiob)
+ evas_software_gdi_output_buffer_free(obr->gdiob);
/* if (obr->mxob) _unfind_xob(obr->mxob, 0); */
free(obr);
}
- _clear_gdiob();
}
int
@@ -624,12 +512,6 @@ evas_software_gdi_outbuf_height_get(Outbuf *buf)
return buf->height;
}
-Outbuf_Depth
-evas_software_gdi_outbuf_depth_get(Outbuf *buf)
-{
- return buf->depth;
-}
-
int
evas_software_gdi_outbuf_rot_get(Outbuf *buf)
{
diff --git a/src/modules/evas/engines/software_generic/evas_ector_software.h b/src/modules/evas/engines/software_generic/evas_ector_software.h
index 5d10143cc4..4b2385cc3a 100644
--- a/src/modules/evas/engines/software_generic/evas_ector_software.h
+++ b/src/modules/evas/engines/software_generic/evas_ector_software.h
@@ -1,18 +1,20 @@
#ifndef EVAS_ECTOR_GL_H
#define EVAS_ECTOR_GL_H
-#undef EAPI
+#ifdef EAPI
+# undef EAPI
+#endif
#ifdef _WIN32
-# ifdef EFL_EVAS_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EVAS_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -23,7 +25,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#include "evas_ector_buffer.eo.h"
#include "evas_ector_software_buffer.eo.h"
diff --git a/src/modules/evas/engines/software_generic/evas_ector_software_buffer.c b/src/modules/evas/engines/software_generic/evas_ector_software_buffer.c
index 0b85c33d9a..41730d7298 100644
--- a/src/modules/evas/engines/software_generic/evas_ector_software_buffer.c
+++ b/src/modules/evas/engines/software_generic/evas_ector_software_buffer.c
@@ -32,7 +32,7 @@ _evas_ector_software_buffer_evas_ector_buffer_engine_image_set(Eo *obj,
evas_cache_image_ref(&im->cache_entry);
pd->image = im;
- ector_buffer_pixels_set(obj, im->image.data, im->cache_entry.w, im->cache_entry.h, im->cache_entry.space, EINA_TRUE);
+ ector_buffer_pixels_set(obj, im->image.data, im->cache_entry.w, im->cache_entry.h, 0, im->cache_entry.space, EINA_TRUE);
}
EOLIAN static void *
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c
index 016179da2f..a4c404cb47 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -1899,7 +1899,6 @@ eng_image_data_slice_add(void *engdata, void *image,
for (int y = 0; y < (h / 2); y++)
cs_data[h + (h / 2) + y] = slice->bytes + (y * stride);
}
- else goto fail;
evas_common_image_colorspace_dirty(im);
break;
@@ -2773,7 +2772,7 @@ _map_draw_thread_cmd(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, RG
static void
evas_software_image_map_draw(void *engine EINA_UNUSED, void *data, void *context, RGBA_Image *surface, RGBA_Image *im, RGBA_Map *m, int smooth, int level, int offset)
{
- if (m->count - offset < 3) return;
+ if (m->count - offset < 4) return;
if ((m->pts[0 + offset].x == m->pts[3 + offset].x) &&
(m->pts[1 + offset].x == m->pts[2 + offset].x) &&
@@ -2834,7 +2833,7 @@ evas_software_image_map_draw(void *engine EINA_UNUSED, void *data, void *context
if (m->count > 4)
{
- evas_software_image_map_draw(engine, data, context, surface, im, m, smooth, level, offset + 2);
+ evas_software_image_map_draw(engine, data, context, surface, im, m, smooth, level, offset + 4);
}
}
@@ -3461,6 +3460,19 @@ _tls_check(void)
}
#endif
+static inline Eina_Bool
+_check_gl(void)
+{
+ if (!gl_lib_init()) return 0;
+ return 1;
+}
+
+static Eina_Bool
+eng_gl_supports_evas_gl(void *data EINA_UNUSED)
+{
+ return _check_gl();
+}
+
static void *
eng_gl_surface_create(void *data EINA_UNUSED, void *config, int w, int h)
{
@@ -3468,6 +3480,8 @@ eng_gl_surface_create(void *data EINA_UNUSED, void *config, int w, int h)
Render_Engine_GL_Surface *sfc;
Evas_GL_Config *cfg;
+ if (!_check_gl()) return NULL;
+
sfc = calloc(1, sizeof(Render_Engine_GL_Surface));
if (!sfc) return NULL;
@@ -3568,6 +3582,8 @@ eng_gl_surface_destroy(void *data EINA_UNUSED, void *surface)
#ifdef EVAS_GL
Render_Engine_GL_Surface *sfc;
+ if (!_check_gl()) return 0;
+
sfc = (Render_Engine_GL_Surface*)surface;
if (!sfc) return 0;
@@ -3598,11 +3614,7 @@ eng_gl_context_create(void *data EINA_UNUSED, void *share_context, int version,
Render_Engine_GL_Context *ctx;
Render_Engine_GL_Context *share_ctx;
- if (!_tls_check() && !gl_lib_init())
- {
- WRN("Failed to initialize Evas GL (with OSMesa)");
- return NULL;
- }
+ if (!_check_gl()) return NULL;
if (version != EVAS_GL_GLES_2_X)
{
@@ -3648,6 +3660,8 @@ eng_gl_context_destroy(void *data EINA_UNUSED, void *context)
#ifdef EVAS_GL
Render_Engine_GL_Context *ctx;
+ if (!_check_gl()) return 0;
+
ctx = (Render_Engine_GL_Context*)context;
if (!ctx) return 0;
@@ -3677,6 +3691,8 @@ eng_gl_make_current(void *data EINA_UNUSED, void *surface, void *context)
OSMesaContext share_ctx;
GLboolean ret;
+ if (!_check_gl()) return 0;
+
sfc = (Render_Engine_GL_Surface*)surface;
ctx = (Render_Engine_GL_Context*)context;
@@ -3760,6 +3776,8 @@ static void *
eng_gl_proc_address_get(void *data EINA_UNUSED, const char *name)
{
#ifdef EVAS_GL
+ if (!_check_gl()) return NULL;
+
if (_sym_OSMesaGetProcAddress) return _sym_OSMesaGetProcAddress(name);
return dlsym(RTLD_DEFAULT, name);
#else
@@ -3775,6 +3793,8 @@ eng_gl_native_surface_get(void *data EINA_UNUSED, void *surface, void *native_su
Render_Engine_GL_Surface *sfc;
Evas_Native_Surface *ns;
+ if (!_check_gl()) return 0;
+
sfc = (Render_Engine_GL_Surface*)surface;
ns = (Evas_Native_Surface*)native_surface;
@@ -3792,7 +3812,6 @@ eng_gl_native_surface_get(void *data EINA_UNUSED, void *surface, void *native_su
#endif
}
-
static void *
eng_gl_api_get(void *data EINA_UNUSED, int version)
{
@@ -3800,8 +3819,7 @@ eng_gl_api_get(void *data EINA_UNUSED, int version)
return NULL;
#ifdef EVAS_GL
- if (!_tls_init)
- gl_lib_init();
+ if (!_check_gl()) return NULL;
return &gl_funcs;
#else
@@ -4308,12 +4326,12 @@ eng_ector_create(void *engine EINA_UNUSED)
efl_domain_current_push(EFL_ID_DOMAIN_SHARED);
if (ector_backend && !strcasecmp(ector_backend, "default"))
{
- ector = efl_add(ECTOR_SOFTWARE_SURFACE_CLASS, NULL);
+ ector = efl_add_ref(ECTOR_SOFTWARE_SURFACE_CLASS, NULL);
use_cairo = EINA_FALSE;
}
else
{
- ector = efl_add(ECTOR_CAIRO_SOFTWARE_SURFACE_CLASS, NULL);
+ ector = efl_add_ref(ECTOR_CAIRO_SOFTWARE_SURFACE_CLASS, NULL);
use_cairo = EINA_TRUE;
}
efl_domain_current_pop();
@@ -4368,7 +4386,7 @@ eng_ector_surface_cache_drop(void *engine, void *key)
static void
eng_ector_destroy(void *data EINA_UNUSED, Ector_Surface *ector)
{
- if (ector) efl_del(ector);
+ if (ector) efl_unref(ector);
}
static Ector_Buffer *
@@ -4381,7 +4399,7 @@ eng_ector_buffer_wrap(void *data, Evas *e EINA_UNUSED, void *engine_image)
if (!efl_domain_current_push(EFL_ID_DOMAIN_SHARED))
return NULL;
- buf = efl_add(EVAS_ECTOR_SOFTWARE_BUFFER_CLASS, NULL,
+ buf = efl_add_ref(EVAS_ECTOR_SOFTWARE_BUFFER_CLASS, NULL,
evas_ector_buffer_engine_image_set(efl_added, data, ie));
efl_domain_current_pop();
@@ -4420,20 +4438,6 @@ eng_ector_buffer_new(void *data EINA_UNUSED, Evas *evas, int width, int height,
return buf;
}
-static Efl_Gfx_Render_Op
-_evas_render_op_to_ector_rop(Evas_Render_Op op)
-{
- switch (op)
- {
- case EVAS_RENDER_BLEND:
- return EFL_GFX_RENDER_OP_BLEND;
- case EVAS_RENDER_COPY:
- return EFL_GFX_RENDER_OP_COPY;
- default:
- return EFL_GFX_RENDER_OP_BLEND;
- }
-}
-
static void
_draw_thread_ector_cleanup(Evas_Thread_Command_Ector *ector)
{
@@ -4518,9 +4522,8 @@ eng_ector_renderer_draw(void *engine EINA_UNUSED, void *surface,
ector.r = renderer; // This has already been refcounted by Evas_Object_VG
ector.clips = c;
- ector.render_op = _evas_render_op_to_ector_rop(dc->render_op);
- ector.mul_col = ector_color_multiply(dc->mul.use ? dc->mul.col : 0xffffffff,
- dc->col.col);;
+ ector.render_op = EFL_GFX_RENDER_OP_BLEND;
+ ector.mul_col = 0xffffffff;
ector.free_it = EINA_FALSE;
if (do_async)
@@ -4570,7 +4573,7 @@ _draw_thread_ector_surface_set(void *data)
memset(pixels, 0, (w * h * 4));
}
- ector_buffer_pixels_set(ector_surface->ector, pixels, w, h, EFL_GFX_COLORSPACE_ARGB8888, EINA_TRUE);
+ ector_buffer_pixels_set(ector_surface->ector, pixels, w, h, 0, EFL_GFX_COLORSPACE_ARGB8888, EINA_TRUE);
ector_surface_reference_point_set(ector_surface->ector, x, y);
eina_mempool_free(_mp_command_ector_surface, ector_surface);
@@ -4608,7 +4611,7 @@ eng_ector_begin(void *engine EINA_UNUSED, void *surface,
// clear the surface before giving to ector
memset(pixels, 0, (w * h * 4));
- ector_buffer_pixels_set(ector, pixels, w, h, EFL_GFX_COLORSPACE_ARGB8888, EINA_TRUE);
+ ector_buffer_pixels_set(ector, pixels, w, h, 0, EFL_GFX_COLORSPACE_ARGB8888, EINA_TRUE);
ector_surface_reference_point_set(ector, x, y);
}
}
@@ -4632,7 +4635,7 @@ eng_ector_end(void *engine EINA_UNUSED, void *surface EINA_UNUSED,
}
else
{
- ector_buffer_pixels_set(ector, NULL, 0, 0, EFL_GFX_COLORSPACE_ARGB8888, EINA_TRUE);
+ ector_buffer_pixels_set(ector, NULL, 0, 0, 0, EFL_GFX_COLORSPACE_ARGB8888, EINA_TRUE);
evas_common_cpu_end_opt();
}
}
@@ -4817,26 +4820,27 @@ static Evas_Func func =
eng_font_pen_coords_get,
eng_font_text_props_info_create,
eng_font_right_inset_get,
+ eng_gl_supports_evas_gl, // returns true iif OSMesa is present
NULL, // No need to set output for software engine
- NULL, // need software mesa for gl rendering <- gl_surface_create
+ eng_gl_surface_create, // need software mesa for gl rendering <- gl_surface_create
NULL, // need software mesa for gl rendering <- gl_pbuffer_surface_create
- NULL, // need software mesa for gl rendering <- gl_surface_destroy
- NULL, // need software mesa for gl rendering <- gl_context_create
- NULL, // need software mesa for gl rendering <- gl_context_destroy
- NULL, // need software mesa for gl rendering <- gl_make_current
- NULL, // need software mesa for gl rendering <- gl_string_query
- NULL, // need software mesa for gl rendering <- gl_proc_address_get
- NULL, // need software mesa for gl rendering <- gl_native_surface_get
- NULL, // need software mesa for gl rendering <- gl_api_get
+ eng_gl_surface_destroy, // need software mesa for gl rendering <- gl_surface_destroy
+ eng_gl_context_create, // need software mesa for gl rendering <- gl_context_create
+ eng_gl_context_destroy, // need software mesa for gl rendering <- gl_context_destroy
+ eng_gl_make_current, // need software mesa for gl rendering <- gl_make_current
+ eng_gl_string_query, // need software mesa for gl rendering <- gl_string_query
+ eng_gl_proc_address_get, // need software mesa for gl rendering <- gl_proc_address_get
+ eng_gl_native_surface_get, // need software mesa for gl rendering <- gl_native_surface_get
+ eng_gl_api_get, // need software mesa for gl rendering <- gl_api_get
NULL, // need software mesa for gl rendering <- gl_direct_override
NULL, // need software mesa for gl rendering <- gl_get_pixels_set
NULL, // need software mesa for gl rendering <- gl_surface_lock
NULL, // need software mesa for gl rendering <- gl_surface_read_pixels
NULL, // need software mesa for gl rendering <- gl_surface_unlock
- NULL, // need software mesa for gl rendering <- gl_error_get
- NULL, // need software mesa for gl rendering <- gl_current_context_get
- NULL, // need software mesa for gl rendering <- gl_current_surface_get
- NULL, // need software mesa for gl rendering <- gl_rotation_angle_get
+ eng_gl_error_get, // need software mesa for gl rendering <- gl_error_get
+ eng_gl_current_context_get, // need software mesa for gl rendering <- gl_current_context_get
+ eng_gl_current_surface_get, // need software mesa for gl rendering <- gl_current_surface_get
+ eng_gl_rotation_angle_get, // need software mesa for gl rendering <- gl_rotation_angle_get
NULL, // need software mesa for gl rendering <- gl_surface_query
NULL, // need software mesa for gl rendering <- gl_surface_direct_renderable_get
NULL, // need software mesa for gl rendering <- gl_image_direct_set
@@ -5888,6 +5892,7 @@ gl_lib_init(void)
{
#ifdef EVAS_GL
// Current ctx & sfc stuff
+ if (gl_lib_handle) return 1;
if (!_tls_check()) return 0;
// dlopen OSMesa
@@ -5903,23 +5908,33 @@ gl_lib_init(void)
if (!gl_lib_handle) gl_lib_handle = dlopen("libOSMesa.so", RTLD_NOW);
if (!gl_lib_handle)
{
- DBG("Unable to open libOSMesa: %s", dlerror());
+ WRN("Unable to open libOSMesa: %s", dlerror());
+ DBG("Unable to support EvasGL in this engine module. Install OSMesa to get it running");
return 0;
}
//------------------------------------------------//
- if (!glue_sym_init()) return 0;
- if (!gl_sym_init()) return 0;
+ if (!glue_sym_init())
+ {
+ WRN("Unable to glue OSMesa syms");
+ return 0;
+ }
+ if (!gl_sym_init())
+ {
+ WRN("Unable to init OSMesa syms");
+ return 0;
+ }
override_gl_apis(&gl_funcs);
return 1;
#else
+ WRN("Evas GL not compiled in");
return 0;
#endif
}
-
+/*
static void
init_gl(void)
{
@@ -5938,7 +5953,6 @@ init_gl(void)
ORD(gl_string_query); // FIXME: Need to implement
ORD(gl_proc_address_get); // FIXME: Need to implement
ORD(gl_native_surface_get);
- ORD(gl_api_get);
ORD(gl_error_get);
ORD(gl_current_context_get);
ORD(gl_current_surface_get);
@@ -5946,7 +5960,7 @@ init_gl(void)
#undef ORD
}
}
-
+*/
/*
*****
@@ -5997,7 +6011,8 @@ module_open(Evas_Module *em)
NULL, sizeof(Evas_Thread_Command_Ector_Surface), 128);
ector_init();
- init_gl();
+// do on demand when first evas_gl_api_get is called...
+// init_gl();
ector_glsym_set(dlsym, RTLD_DEFAULT);
evas_common_pipe_init();
diff --git a/src/modules/evas/engines/software_generic/evas_native_common.h b/src/modules/evas/engines/software_generic/evas_native_common.h
index de3533550d..4121746fd7 100644
--- a/src/modules/evas/engines/software_generic/evas_native_common.h
+++ b/src/modules/evas/engines/software_generic/evas_native_common.h
@@ -6,15 +6,15 @@
#endif
#ifdef _WIN32
-# ifdef EFL_EVAS_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EVAS_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -25,7 +25,7 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
//#include <Evas_Common.h>
diff --git a/src/modules/evas/engines/wayland_common/Evas_Engine_Wayland.h b/src/modules/evas/engines/wayland_common/Evas_Engine_Wayland.h
index e733825c82..95934e9208 100644
--- a/src/modules/evas/engines/wayland_common/Evas_Engine_Wayland.h
+++ b/src/modules/evas/engines/wayland_common/Evas_Engine_Wayland.h
@@ -15,7 +15,7 @@ struct _Evas_Engine_Info_Wayland
struct
{
Ecore_Wl2_Window *wl2_win;
- int depth, rotation, edges;
+ int depth, rotation;
Eina_Bool destination_alpha : 1;
Eina_Bool hidden : 1;
} info;
diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c b/src/modules/evas/engines/wayland_egl/evas_engine.c
index 4f22f8a787..e26205e304 100644
--- a/src/modules/evas/engines/wayland_egl/evas_engine.c
+++ b/src/modules/evas/engines/wayland_egl/evas_engine.c
@@ -1083,18 +1083,14 @@ eng_image_native_set(void *engine, void *image, void *native)
}
}
- if ((!ns) && (!img->native.data)) return img;
-
eng_window_use(ob);
- if (img->native.data)
+ if (!ns)
{
- if (img->native.func.free)
- img->native.func.free(img);
- glsym_evas_gl_common_image_native_disable(img);
+ glsym_evas_gl_common_image_free(img);
+ return NULL;
}
- if (!ns) return img;
if (ns->type == EVAS_NATIVE_SURFACE_WL)
{
diff --git a/src/modules/evas/engines/wayland_egl/evas_wl_main.c b/src/modules/evas/engines/wayland_egl/evas_wl_main.c
index 7b916cc20e..02b7108bc4 100644
--- a/src/modules/evas/engines/wayland_egl/evas_wl_main.c
+++ b/src/modules/evas/engines/wayland_egl/evas_wl_main.c
@@ -46,16 +46,14 @@ eng_window_new(Evas_Engine_Info_Wayland *einfo, int w, int h, Render_Output_Swap
config_attrs[n++] = EGL_WINDOW_BIT;
config_attrs[n++] = EGL_RENDERABLE_TYPE;
config_attrs[n++] = EGL_OPENGL_ES2_BIT;
-# if 0
- /* FIXME: n900 - omap3 sgx libs break here */
+
config_attrs[n++] = EGL_RED_SIZE;
config_attrs[n++] = 1;
config_attrs[n++] = EGL_GREEN_SIZE;
config_attrs[n++] = 1;
config_attrs[n++] = EGL_BLUE_SIZE;
config_attrs[n++] = 1;
- /* FIXME: end n900 breakage */
-# endif
+
config_attrs[n++] = EGL_ALPHA_SIZE;
config_attrs[n++] = gw->alpha;
config_attrs[n++] = EGL_DEPTH_SIZE;
@@ -326,33 +324,10 @@ eng_outbuf_reconfigure(Outbuf *ob, int w, int h, int rot, Outbuf_Depth depth EIN
if (ob->win)
{
- int aw, ah, dx = 0, dy = 0;
-
- if ((ob->rot == 90) || (ob->rot == 270))
- wl_egl_window_get_attached_size(ob->win, &ah, &aw);
- else
- wl_egl_window_get_attached_size(ob->win, &aw, &ah);
-
- if (ob->info->info.edges & 4) // resize from left
- {
- if ((ob->rot == 90) || (ob->rot == 270))
- dx = ah - h;
- else
- dx = aw - w;
- }
-
- if (ob->info->info.edges & 1) // resize from top
- {
- if ((ob->rot == 90) || (ob->rot == 270))
- dy = aw - w;
- else
- dy = ah - h;
- }
-
if ((ob->rot == 90) || (ob->rot == 270))
- wl_egl_window_resize(ob->win, h, w, dx, dy);
+ wl_egl_window_resize(ob->win, h, w, 0, 0);
else
- wl_egl_window_resize(ob->win, w, h, dx, dy);
+ wl_egl_window_resize(ob->win, w, h, 0, 0);
}
}
diff --git a/src/modules/evas/engines/wayland_shm/evas_engine.c b/src/modules/evas/engines/wayland_shm/evas_engine.c
index f18ed25fd8..4f2aea5930 100644
--- a/src/modules/evas/engines/wayland_shm/evas_engine.c
+++ b/src/modules/evas/engines/wayland_shm/evas_engine.c
@@ -104,18 +104,15 @@ eng_output_resize(void *engine EINA_UNUSED, void *data, int w, int h)
{
Render_Engine *re;
Evas_Engine_Info_Wayland *einfo;
- Eina_Bool resize = EINA_FALSE;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!(re = (Render_Engine *)data)) return;
if (!(einfo = re->generic.ob->info)) return;
- if (einfo->info.edges) resize = EINA_TRUE;
-
_evas_outbuf_reconfigure(re->generic.ob, w, h,
einfo->info.rotation, einfo->info.depth,
- einfo->info.destination_alpha, resize);
+ einfo->info.destination_alpha, 0);
evas_common_tilebuf_free(re->generic.tb);
if ((re->generic.tb = evas_common_tilebuf_new(w, h)))
@@ -137,8 +134,10 @@ eng_output_update(void *engine, void *data, void *info, unsigned int w, unsigned
ewd = ecore_wl2_window_display_get(einfo->info.wl2_win);
if (ob->ewd != ewd)
{
+ /* We don't use a purging flush because we don't want to
+ * delete a buffer currently being displayed */
if (ewd)
- ob->dirty = EINA_TRUE;
+ ecore_wl2_surface_flush(ob->surface, EINA_FALSE);
re->generic.ob->ewd = ewd;
}
diff --git a/src/modules/evas/engines/wayland_shm/evas_engine.h b/src/modules/evas/engines/wayland_shm/evas_engine.h
index 7291b40465..c61b36a97a 100644
--- a/src/modules/evas/engines/wayland_shm/evas_engine.h
+++ b/src/modules/evas/engines/wayland_shm/evas_engine.h
@@ -99,8 +99,6 @@ struct _Outbuf
/* Eina_Bool redraw : 1; */
Eina_Bool destination_alpha : 1;
} priv;
-
- Eina_Bool dirty : 1;
};
Outbuf *_evas_outbuf_setup(int w, int h, Evas_Engine_Info_Wayland *info);
@@ -115,12 +113,4 @@ void *_evas_outbuf_update_region_new(Outbuf *ob, int x, int y, int w, int h, int
void _evas_outbuf_update_region_push(Outbuf *ob, RGBA_Image *update, int x, int y, int w, int h);
void _evas_outbuf_redraws_clear(Outbuf *ob);
-Ecore_Wl2_Surface *ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha);
-void ecore_wl2_surface_destroy(Ecore_Wl2_Surface *surface);
-void ecore_wl2_surface_reconfigure(Ecore_Wl2_Surface *surface, int w, int h, uint32_t flags, Eina_Bool force);
-void *ecore_wl2_surface_data_get(Ecore_Wl2_Surface *surface, int *w, int *h);
-int ecore_wl2_surface_assign(Ecore_Wl2_Surface *surface);
-void ecore_wl2_surface_post(Ecore_Wl2_Surface *surface, Eina_Rectangle *rects, unsigned int count);
-
-
#endif
diff --git a/src/modules/evas/engines/wayland_shm/evas_outbuf.c b/src/modules/evas/engines/wayland_shm/evas_outbuf.c
index f5d32bb3dc..a435fdca3c 100644
--- a/src/modules/evas/engines/wayland_shm/evas_outbuf.c
+++ b/src/modules/evas/engines/wayland_shm/evas_outbuf.c
@@ -266,22 +266,17 @@ _evas_outbuf_rotation_get(Outbuf *ob)
void
_evas_outbuf_reconfigure(Outbuf *ob, int w, int h, int rot, Outbuf_Depth depth, Eina_Bool alpha, Eina_Bool resize)
{
- Eina_Bool dirty;
-
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if ((depth == OUTBUF_DEPTH_NONE) ||
(depth == OUTBUF_DEPTH_INHERIT))
depth = ob->depth;
- if (!ob->dirty && (ob->w == w) && (ob->h == h) &&
+ if ((ob->w == w) && (ob->h == h) &&
(ob->rotation == rot) && (ob->depth == depth) &&
(ob->priv.destination_alpha == alpha))
return;
- dirty = ob->dirty;
- ob->dirty = EINA_FALSE;
-
ob->w = w;
ob->h = h;
ob->rotation = rot;
@@ -290,11 +285,11 @@ _evas_outbuf_reconfigure(Outbuf *ob, int w, int h, int rot, Outbuf_Depth depth,
if ((ob->rotation == 0) || (ob->rotation == 180))
{
- ecore_wl2_surface_reconfigure(ob->surface, w, h, resize, dirty);
+ ecore_wl2_surface_reconfigure(ob->surface, w, h, resize, alpha);
}
else if ((ob->rotation == 90) || (ob->rotation == 270))
{
- ecore_wl2_surface_reconfigure(ob->surface, h, w, resize, dirty);
+ ecore_wl2_surface_reconfigure(ob->surface, h, w, resize, alpha);
}
_evas_outbuf_idle_flush(ob);
diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c
index 867d95c9df..61f443b806 100644
--- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c
+++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c
@@ -2371,6 +2371,7 @@ evas_vg_load_file_data_svg(const char *file, const char *key EINA_UNUSED, int *e
*error = EVAS_LOAD_ERROR_GENERIC;
}
free(loader.svg_parse);
+ eina_file_close(f);
return vg_common_create_vg_node(loader.doc);
}
diff --git a/src/modules/evas/vg_savers/svg/evas_vg_save_svg.c b/src/modules/evas/vg_savers/svg/evas_vg_save_svg.c
index c44b0d536f..24433c262a 100644
--- a/src/modules/evas/vg_savers/svg/evas_vg_save_svg.c
+++ b/src/modules/evas/vg_savers/svg/evas_vg_save_svg.c
@@ -138,7 +138,7 @@ evas_vg_save_file_svg(Vg_File_Data *evg_data, const char *file, const char *key
if (!f)
{
ERR("Cannot open file '%s' for SVG save", file);
- return EFL_IMAGE_LOAD_ERROR_GENERIC;
+ return EFL_GFX_IMAGE_LOAD_ERROR_GENERIC;
}
root = vg_common_create_svg_node(evg_data);
diff --git a/src/scripts/elua/apps/docgen/doctree.lua b/src/scripts/elua/apps/docgen/doctree.lua
index 479303bdd1..91f1bd1389 100644
--- a/src/scripts/elua/apps/docgen/doctree.lua
+++ b/src/scripts/elua/apps/docgen/doctree.lua
@@ -38,6 +38,23 @@ M.Node = util.Object:clone {
PROTECTED = eolian.object_scope.PROTECTED
},
+ __ctor = function(self, obj)
+ self._obj = obj
+ assert(self._obj)
+ end,
+
+ name_get = function(self)
+ return self.obj:name_get()
+ end,
+
+ short_name_get = function(self)
+ return self.obj:short_name_get()
+ end,
+
+ namespaces_get = function(self)
+ return self._obj:namespaces_get():to_array()
+ end,
+
nspaces_get = function(self, root)
local tbl = self:namespaces_get()
-- temporary workaround
@@ -48,7 +65,7 @@ M.Node = util.Object:clone {
tbl[i] = tbl[i]:lower()
end
- tbl[#tbl + 1] = self:name_get():lower()
+ tbl[#tbl + 1] = self:short_name_get():lower()
if root ~= nil then
tbl[#tbl + 1] = not not root
end
@@ -90,36 +107,32 @@ local add_since = function(str, since)
end
M.Doc = Node:clone {
- __ctor = function(self, doc)
- self.doc = doc
- end,
-
summary_get = function(self)
- if not self.doc then
+ if not self._obj then
return nil
end
- return self.doc:summary_get()
+ return self._obj:summary_get()
end,
description_get = function(self)
- if not self.doc then
+ if not self._obj then
return nil
end
- return self.doc:description_get()
+ return self._obj:description_get()
end,
since_get = function(self)
- if not self.doc then
+ if not self._obj then
return nil
end
- return self.doc:since_get()
+ return self._obj:since_get()
end,
brief_get = function(self, doc2)
- if not self.doc and (not doc2 or not doc2.doc) then
+ if not self._obj and (not doc2 or not doc2._obj) then
return "No description supplied."
end
- local doc1, doc2 = self.doc, doc2 and doc2.doc or nil
+ local doc1, doc2 = self._obj, doc2 and doc2._obj or nil
if not doc1 then
doc1, doc2 = doc2, doc1
end
@@ -127,10 +140,10 @@ M.Doc = Node:clone {
end,
full_get = function(self, doc2, write_since)
- if not self.doc and (not doc2 or not doc2.doc) then
+ if not self._obj and (not doc2 or not doc2._obj) then
return "No description supplied."
end
- local doc1, doc2 = self.doc, doc2 and doc2.doc or nil
+ local doc1, doc2 = self._obj, doc2 and doc2._obj or nil
if not doc1 then
doc1, doc2 = doc2, doc1
end
@@ -160,7 +173,7 @@ M.Doc = Node:clone {
end,
exists = function(self)
- return not not self.doc
+ return not not self._obj
end
}
@@ -181,25 +194,8 @@ M.Class = Node:clone {
MIXIN = eolian.class_type.MIXIN,
INTERFACE = eolian.class_type.INTERFACE,
- __ctor = function(self, cl)
- self.class = cl
- assert(self.class)
- end,
-
- full_name_get = function(self)
- return self.class:full_name_get()
- end,
-
- name_get = function(self)
- return self.class:name_get()
- end,
-
- namespaces_get = function(self)
- return self.class:namespaces_get():to_array()
- end,
-
type_get = function(self)
- return self.class:type_get()
+ return self._obj:type_get()
end,
type_str_get = function(self)
@@ -216,15 +212,15 @@ M.Class = Node:clone {
end,
doc_get = function(self)
- return M.Doc(self.class:documentation_get())
+ return M.Doc(self._obj:documentation_get())
end,
legacy_prefix_get = function(self)
- return self.class:legacy_prefix_get()
+ return self._obj:legacy_prefix_get()
end,
eo_prefix_get = function(self)
- return self.class:eo_prefix_get()
+ return self._obj:eo_prefix_get()
end,
inherits_get = function(self)
@@ -233,7 +229,7 @@ M.Class = Node:clone {
return ret
end
ret = {}
- for cl in self.class:inherits_get() do
+ for cl in self._obj:inherits_get() do
ret[#ret + 1] = M.Class(cl)
end
self._cache_inhc = ret
@@ -241,7 +237,7 @@ M.Class = Node:clone {
end,
children_get = function(self)
- return revh[self:full_name_get()] or {}
+ return revh[self:name_get()] or {}
end,
functions_get = function(self, ft)
@@ -251,25 +247,25 @@ M.Class = Node:clone {
end
ret = {}
self._cache_funcs = ret
- for fn in self.class:functions_get(ft) do
+ for fn in self._obj:functions_get(ft) do
ret[#ret + 1] = M.Function(fn)
end
return ret
end,
- function_get_by_name = function(self, fn, ft)
+ function_by_name_get = function(self, fn, ft)
local fun = self._cache_func
if fun then
return fun
end
- fun = M.Function(self.class:function_get_by_name(fn, ft))
+ fun = M.Function(self._obj:function_by_name_get(fn, ft))
self._cache_func = fun
return fun
end,
events_get = function(self)
local ret = {}
- for ev in self.class:events_get() do
+ for ev in self._obj:events_get() do
ret[#ret + 1] = M.Event(ev)
end
return ret
@@ -277,14 +273,14 @@ M.Class = Node:clone {
implements_get = function(self)
local ret = {}
- for impl in self.class:implements_get() do
+ for impl in self._obj:implements_get() do
ret[#ret + 1] = M.Implement(impl)
end
return ret
end,
c_get_function_name_get = function(self)
- return self.class:c_get_function_name_get()
+ return self._obj:c_get_function_name_get()
end,
nspaces_get = function(self, root)
@@ -292,7 +288,7 @@ M.Class = Node:clone {
end,
is_same = function(self, other)
- return self.class == other.class
+ return self._obj == other._obj
end,
-- static getters
@@ -303,8 +299,7 @@ M.Class = Node:clone {
if ret then
return ret
end
- -- FIXME: unit
- local v = eolian.class_get_by_name(eos:unit_get(), name)
+ local v = eos:class_by_name_get(name)
if not v then
return nil
end
@@ -319,8 +314,7 @@ M.Class = Node:clone {
if ret then
return ret
end
- -- FIXME: unit
- local v = eolian.class_get_by_file(eos:unit_get(), name)
+ local v = eos:class_by_file_get(name)
if not v then
return nil
end
@@ -333,7 +327,7 @@ M.Class = Node:clone {
local ret, had = get_cache(M.Class, "_cache_all")
if not had then
-- FIXME: unit
- for cl in eolian.all_classes_get(eos:unit_get()) do
+ for cl in eos:classes_get() do
local cls = M.Class(cl)
if matches_filter(cls) then
ret[#ret + 1] = cls
@@ -362,17 +356,8 @@ M.Function = Node:clone {
METHOD = eolian.function_type.METHOD,
FUNCTION_POINTER = eolian.function_type.FUNCTION_POINTER,
- __ctor = function(self, fn)
- self.func = fn
- assert(self.func)
- end,
-
- name_get = function(self)
- return self.func:name_get()
- end,
-
type_get = function(self)
- return self.func:type_get()
+ return self._obj:type_get()
end,
type_str_get = function(self)
@@ -380,44 +365,44 @@ M.Function = Node:clone {
end,
scope_get = function(self, ft)
- return self.func:scope_get(ft)
+ return self._obj:scope_get(ft)
end,
full_c_name_get = function(self, ft, legacy)
- return self.func:full_c_name_get(ft, legacy)
+ return self._obj:full_c_name_get(ft, legacy)
end,
legacy_get = function(self, ft)
- return self.func:legacy_get(ft)
+ return self._obj:legacy_get(ft)
end,
implement_get = function(self)
- return M.Implement(self.func:implement_get())
+ return M.Implement(self._obj:implement_get())
end,
is_legacy_only = function(self, ft)
- return self.func:is_legacy_only(ft)
+ return self._obj:is_legacy_only(ft)
end,
is_class = function(self)
- return self.func:is_class()
+ return self._obj:is_class()
end,
is_beta = function(self)
- return self.func:is_beta()
+ return self._obj:is_beta()
end,
is_constructor = function(self, klass)
- return self.func:is_constructor(klass.class)
+ return self._obj:is_constructor(klass.class)
end,
is_function_pointer = function(self)
- return self.func:is_function_pointer()
+ return self._obj:is_function_pointer()
end,
property_keys_get = function(self, ft)
local ret = {}
- for par in self.func:property_keys_get(ft) do
+ for par in self._obj:property_keys_get(ft) do
ret[#ret + 1] = M.Parameter(par)
end
return ret
@@ -425,7 +410,7 @@ M.Function = Node:clone {
property_values_get = function(self, ft)
local ret = {}
- for par in self.func:property_values_get(ft) do
+ for par in self._obj:property_values_get(ft) do
ret[#ret + 1] = M.Parameter(par)
end
return ret
@@ -433,14 +418,14 @@ M.Function = Node:clone {
parameters_get = function(self)
local ret = {}
- for par in self.func:parameters_get() do
+ for par in self._obj:parameters_get() do
ret[#ret + 1] = M.Parameter(par)
end
return ret
end,
return_type_get = function(self, ft)
- local v = self.func:return_type_get(ft)
+ local v = self._obj:return_type_get(ft)
if not v then
return nil
end
@@ -448,7 +433,7 @@ M.Function = Node:clone {
end,
return_default_value_get = function(self, ft)
- local v = self.func:return_default_value_get(ft)
+ local v = self._obj:return_default_value_get(ft)
if not v then
return nil
end
@@ -456,15 +441,15 @@ M.Function = Node:clone {
end,
return_doc_get = function(self, ft)
- return M.Doc(self.func:return_documentation_get(ft))
+ return M.Doc(self._obj:return_documentation_get(ft))
end,
return_is_warn_unused = function(self, ft)
- return self.func:return_is_warn_unused(ft)
+ return self._obj:return_is_warn_unused(ft)
end,
is_const = function(self)
- return self.func:is_const()
+ return self._obj:is_const()
end,
nspaces_get = function(self, cl, root)
@@ -478,11 +463,11 @@ M.Function = Node:clone {
end,
is_same = function(self, other)
- return self.func == other.func
+ return self._obj == other._obj
end,
id_get = function(self)
- return tonumber(ffi.cast("uintptr_t", self.func))
+ return tonumber(ffi.cast("uintptr_t", self._obj))
end
}
@@ -492,13 +477,8 @@ M.Parameter = Node:clone {
OUT = eolian.parameter_dir.OUT,
INOUT = eolian.parameter_dir.INOUT,
- __ctor = function(self, par)
- self.param = par
- assert(self.param)
- end,
-
direction_get = function(self)
- return self.param:direction_get()
+ return self._obj:direction_get()
end,
direction_name_get = function(self)
@@ -512,7 +492,7 @@ M.Parameter = Node:clone {
end,
type_get = function(self)
- local v = self.param:type_get()
+ local v = self._obj:type_get()
if not v then
return nil
end
@@ -520,50 +500,37 @@ M.Parameter = Node:clone {
end,
default_value_get = function(self)
- local v = self.param:default_value_get()
+ local v = self._obj:default_value_get()
if not v then
return nil
end
return M.Expression(v)
end,
- name_get = function(self)
- return self.param:name_get()
- end,
-
doc_get = function(self)
- return M.Doc(self.param:documentation_get())
+ return M.Doc(self._obj:documentation_get())
end,
is_nonull = function(self)
- return self.param:is_nonull()
+ return self._obj:is_nonull()
end,
is_nullable = function(self)
- return self.param:is_nullable()
+ return self._obj:is_nullable()
end,
is_optional = function(self)
- return self.param:is_optional()
+ return self._obj:is_optional()
end,
is_same = function(self, other)
- return self.param == other.param
+ return self._obj == other._obj
end
}
M.Event = Node:clone {
- __ctor = function(self, ev)
- self.event = ev
- assert(self.event)
- end,
-
- name_get = function(self)
- return self.event:name_get()
- end,
-
type_get = function(self)
- local v = self.event:type_get()
+ local v = self._obj:type_get()
if not v then
return nil
end
@@ -571,27 +538,27 @@ M.Event = Node:clone {
end,
doc_get = function(self)
- return M.Doc(self.event:documentation_get())
+ return M.Doc(self._obj:documentation_get())
end,
scope_get = function(self)
- return self.event:scope_get()
+ return self._obj:scope_get()
end,
c_name_get = function(self)
- return self.event:c_name_get()
+ return self._obj:c_name_get()
end,
is_beta = function(self)
- return self.event:is_beta()
+ return self._obj:is_beta()
end,
is_hot = function(self)
- return self.event:is_hot()
+ return self._obj:is_hot()
end,
is_restart = function(self)
- return self.event:is_restart()
+ return self._obj:is_restart()
end,
nspaces_get = function(self, cl, root)
@@ -606,21 +573,12 @@ M.Event = Node:clone {
}
M.StructField = Node:clone {
- __ctor = function(self, fl)
- self.field = fl
- assert(self.field)
- end,
-
- name_get = function(self)
- return self.field:name_get()
- end,
-
doc_get = function(self)
- return M.Doc(self.field:documentation_get())
+ return M.Doc(self._obj:documentation_get())
end,
type_get = function(self)
- local v = self.field:type_get()
+ local v = self._obj:type_get()
if not v then
return nil
end
@@ -629,25 +587,16 @@ M.StructField = Node:clone {
}
M.EnumField = Node:clone {
- __ctor = function(self, fl)
- self.field = fl
- assert(self.field)
- end,
-
- name_get = function(self)
- return self.field:name_get()
- end,
-
c_name_get = function(self)
- return self.field:c_name_get()
+ return self._obj:c_name_get()
end,
doc_get = function(self)
- return M.Doc(self.field:documentation_get())
+ return M.Doc(self._obj:documentation_get())
end,
value_get = function(self, force)
- local v = self.field:value_get(force)
+ local v = self._obj:value_get(force)
if not v then
return nil
end
@@ -680,21 +629,16 @@ M.Type = Node:clone {
CLASS = eolian.type_type.CLASS,
UNDEFINED = eolian.type_type.UNDEFINED,
- __ctor = function(self, tp)
- self.type = tp
- assert(self.type)
- end,
-
type_get = function(self)
- return self.type:type_get()
+ return self._obj:type_get()
end,
file_get = function(self)
- return self.type:file_get()
+ return self._obj:file_get()
end,
base_type_get = function(self)
- local v = self.type:base_type_get()
+ local v = self._obj:base_type_get()
if not v then
return nil
end
@@ -702,7 +646,7 @@ M.Type = Node:clone {
end,
next_type_get = function(self)
- local v = self.type:next_type_get()
+ local v = self._obj:next_type_get()
if not v then
return nil
end
@@ -710,8 +654,7 @@ M.Type = Node:clone {
end,
typedecl_get = function(self)
- -- FIXME: unit
- local v = self.type:typedecl_get(eos:unit_get())
+ local v = self._obj:typedecl_get()
if not v then
return nil
end
@@ -719,8 +662,7 @@ M.Type = Node:clone {
end,
aliased_base_get = function(self)
- -- FIXME: unit
- local v = self.type:aliased_base_get(eos:unit_get())
+ local v = self._obj:aliased_base_get()
if not v then
return nil
end
@@ -728,40 +670,27 @@ M.Type = Node:clone {
end,
class_get = function(self)
- -- FIXME: unit
- return self.type:class_get(eos:unit_get())
+ return self._obj:class_get()
end,
is_owned = function(self)
- return self.type:is_owned()
+ return self._obj:is_owned()
end,
is_const = function(self)
- return self.type:is_const()
+ return self._obj:is_const()
end,
is_ptr = function(self)
- return self.type:is_ptr()
+ return self._obj:is_ptr()
end,
c_type_get = function(self)
- return self.type:c_type_get(eos:unit_get(), eolian.c_type_type.DEFAULT)
- end,
-
- name_get = function(self)
- return self.type:name_get()
- end,
-
- full_name_get = function(self)
- return self.type:full_name_get()
- end,
-
- namespaces_get = function(self)
- return self.type:namespaces_get()
+ return self._obj:c_type_get(eolian.c_type_type.DEFAULT)
end,
free_func_get = function(self)
- return self.type:free_func_get()
+ return self._obj:free_func_get()
end,
-- utils
@@ -769,7 +698,7 @@ M.Type = Node:clone {
serialize = function(self)
local tpt = self:type_get()
if tpt == self.UNKNOWN then
- error("unknown type: " .. self:full_name_get())
+ error("unknown type: " .. self:name_get())
elseif tpt == self.VOID then
return wrap_type_attrs(self, "void")
elseif tpt == self.UNDEFINED then
@@ -782,10 +711,10 @@ M.Type = Node:clone {
stypes[#stypes + 1] = stp:serialize()
stp = stp:next_type_get()
end
- return wrap_type_attrs(self, self:full_name_get() .. "<"
+ return wrap_type_attrs(self, self:name_get() .. "<"
.. table.concat(stypes, ", ") .. ">")
end
- return wrap_type_attrs(self, self:full_name_get())
+ return wrap_type_attrs(self, self:name_get())
end
error("unhandled type type: " .. tpt)
end
@@ -824,13 +753,8 @@ M.Typedecl = Node:clone {
ALIAS = eolian.typedecl_type.ALIAS,
FUNCTION_POINTER = eolian.typedecl_type.FUNCTION_POINTER,
- __ctor = function(self, tp)
- self.typedecl = tp
- assert(self.typedecl)
- end,
-
type_get = function(self)
- return self.typedecl:type_get()
+ return self._obj:type_get()
end,
type_str_get = function(self)
@@ -845,14 +769,14 @@ M.Typedecl = Node:clone {
struct_fields_get = function(self)
local ret = {}
- for fl in self.typedecl:struct_fields_get() do
+ for fl in self._obj:struct_fields_get() do
ret[#ret + 1] = M.StructField(fl)
end
return ret
end,
struct_field_get = function(self, name)
- local v = self.typedecl:struct_field_get(name)
+ local v = self._obj:struct_field_get(name)
if not v then
return nil
end
@@ -861,14 +785,14 @@ M.Typedecl = Node:clone {
enum_fields_get = function(self)
local ret = {}
- for fl in self.typedecl:enum_fields_get() do
+ for fl in self._obj:enum_fields_get() do
ret[#ret + 1] = M.EnumField(fl)
end
return ret
end,
enum_field_get = function(self, name)
- local v = self.typedecl:enum_field_get(name)
+ local v = self._obj:enum_field_get(name)
if not v then
return nil
end
@@ -876,19 +800,19 @@ M.Typedecl = Node:clone {
end,
enum_legacy_prefix_get = function(self)
- return self.typedecl:enum_legacy_prefix_get()
+ return self._obj:enum_legacy_prefix_get()
end,
doc_get = function(self)
- return M.Doc(self.typedecl:documentation_get())
+ return M.Doc(self._obj:documentation_get())
end,
file_get = function(self)
- return self.typedecl:file_get()
+ return self._obj:file_get()
end,
base_type_get = function(self)
- local v = self.typedecl:base_type_get()
+ local v = self._obj:base_type_get()
if not v then
return nil
end
@@ -896,8 +820,7 @@ M.Typedecl = Node:clone {
end,
aliased_base_get = function(self)
- -- FIXME: unit
- local v = self.typedecl:aliased_base_get(eos:unit_get())
+ local v = self._obj:aliased_base_get()
if not v then
return nil
end
@@ -905,32 +828,19 @@ M.Typedecl = Node:clone {
end,
is_extern = function(self)
- return self.typedecl:is_extern()
+ return self._obj:is_extern()
end,
c_type_get = function(self)
- -- FIXME: unit
- return self.typedecl:c_type_get(eos:unit_get())
- end,
-
- name_get = function(self)
- return self.typedecl:name_get()
- end,
-
- full_name_get = function(self)
- return self.typedecl:full_name_get()
- end,
-
- namespaces_get = function(self)
- return self.typedecl:namespaces_get():to_array()
+ return self._obj:c_type_get()
end,
free_func_get = function(self)
- return self.typedecl:free_func_get()
+ return self._obj:free_func_get()
end,
function_pointer_get = function(self)
- local v = self.typedecl:function_pointer_get()
+ local v = self._obj:function_pointer_get()
if not v then
return nil
end
@@ -945,8 +855,7 @@ M.Typedecl = Node:clone {
all_aliases_get = function()
local ret = {}
- -- FIXME: unit
- for tp in eolian.typedecl_all_aliases_get(eos:unit_get()) do
+ for tp in eos:aliases_get() do
local tpo = M.Typedecl(tp)
if matches_filter(tpo) then
ret[#ret + 1] = tpo
@@ -957,8 +866,7 @@ M.Typedecl = Node:clone {
all_structs_get = function()
local ret = {}
- -- FIXME: unit
- for tp in eolian.typedecl_all_structs_get(eos:unit_get()) do
+ for tp in eos:structs_get() do
local tpo = M.Typedecl(tp)
if matches_filter(tpo) then
ret[#ret + 1] = tpo
@@ -969,8 +877,7 @@ M.Typedecl = Node:clone {
all_enums_get = function()
local ret = {}
- -- FIXME: unit
- for tp in eolian.typedecl_all_enums_get(eos:unit_get()) do
+ for tp in eos:enums_get() do
local tpo = M.Typedecl(tp)
local tpn = tpo:nspaces_get()
if matches_filter(tpo) then
@@ -982,8 +889,7 @@ M.Typedecl = Node:clone {
aliases_by_file_get = function(fn)
local ret = {}
- -- FIXME: unit
- for tp in eolian.typedecl_aliases_get_by_file(eos:unit_get(), fn) do
+ for tp in eos:aliases_by_file_get(fn) do
ret[#ret + 1] = M.Typedecl(tp)
end
return ret
@@ -991,8 +897,7 @@ M.Typedecl = Node:clone {
structs_by_file_get = function(fn)
local ret = {}
- -- FIXME: unit
- for tp in eolian.typedecl_structs_get_by_file(eos:unit_get(), fn) do
+ for tp in eos:struts_by_file_get(fn) do
ret[#ret + 1] = M.Typedecl(tp)
end
return ret
@@ -1000,16 +905,14 @@ M.Typedecl = Node:clone {
enums_by_file_get = function(fn)
local ret = {}
- -- FIXME: unit
- for tp in eolian.typedecl_enums_get_by_file(eos:unit_get(), fn) do
+ for tp in eeos:enums_by_file_get(fn) do
ret[#ret + 1] = M.Typedecl(tp)
end
return ret
end,
alias_by_name_get = function(tn)
- -- FIXME: unit
- local v = eolian.typedecl_alias_get_by_name(eos:unit_get(), tn)
+ local v = eos:alias_by_name_get(tn)
if not v then
return nil
end
@@ -1017,8 +920,7 @@ M.Typedecl = Node:clone {
end,
struct_by_name_get = function(tn)
- -- FIXME: unit
- local v = eolian.typedecl_struct_get_by_name(eos:unit_get(), tn)
+ local v = eos:struct_by_name_get(tn)
if not v then
return nil
end
@@ -1026,8 +928,7 @@ M.Typedecl = Node:clone {
end,
enum_by_name_get = function(tn)
- -- FIXME: unit
- local v = eolian.typedecl_enum_get_by_name(eos:unit_get(), tn)
+ local v = eos:enum_by_name_get(tn)
if not v then
return nil
end
@@ -1039,12 +940,12 @@ M.Typedecl = Node:clone {
serialize = function(self)
local tpt = self:type_get()
if tpt == self.UNKNOWN then
- error("unknown typedecl: " .. self:full_name_get())
+ error("unknown typedecl: " .. self:name_get())
elseif tpt == self.STRUCT or
tpt == self.STRUCT_OPAQUE then
local buf = { "struct " }
add_typedecl_attrs(self, buf)
- buf[#buf + 1] = self:full_name_get()
+ buf[#buf + 1] = self:name_get()
if tpt == self.STRUCT_OPAQUE then
buf[#buf + 1] = ";"
return table.concat(buf)
@@ -1067,7 +968,7 @@ M.Typedecl = Node:clone {
elseif tpt == self.ENUM then
local buf = { "enum " }
add_typedecl_attrs(self, buf)
- buf[#buf + 1] = self:full_name_get()
+ buf[#buf + 1] = self:name_get()
local fields = self:enum_fields_get()
if #fields == 0 then
buf[#buf + 1] = " {}"
@@ -1093,7 +994,7 @@ M.Typedecl = Node:clone {
elseif tpt == self.ALIAS then
local buf = { "type " }
add_typedecl_attrs(self, buf)
- buf[#buf + 1] = self:full_name_get()
+ buf[#buf + 1] = self:name_get()
buf[#buf + 1] = ": "
buf[#buf + 1] = self:base_type_get():serialize()
buf[#buf + 1] = ";"
@@ -1107,11 +1008,11 @@ M.Typedecl = Node:clone {
serialize_c = function(self, ns)
local tpt = self:type_get()
if tpt == self.UNKNOWN then
- error("unknown typedecl: " .. self:full_name_get())
+ error("unknown typedecl: " .. self:name_get())
elseif tpt == self.STRUCT or
tpt == self.STRUCT_OPAQUE then
local buf = { "typedef struct " }
- local fulln = self:full_name_get():gsub("%.", "_");
+ local fulln = self:name_get():gsub("%.", "_");
keyref.add(fulln, ns, "c")
buf[#buf + 1] = "_" .. fulln;
if tpt == self.STRUCT_OPAQUE then
@@ -1133,7 +1034,7 @@ M.Typedecl = Node:clone {
return table.concat(buf)
elseif tpt == self.ENUM then
local buf = { "typedef enum" }
- local fulln = self:full_name_get():gsub("%.", "_");
+ local fulln = self:name_get():gsub("%.", "_");
keyref.add(fulln, ns, "c")
local fields = self:enum_fields_get()
if #fields == 0 then
@@ -1166,7 +1067,7 @@ M.Typedecl = Node:clone {
buf[#buf + 1] = "} " .. fulln .. ";"
return table.concat(buf)
elseif tpt == self.ALIAS then
- local fulln = self:full_name_get():gsub("%.", "_");
+ local fulln = self:name_get():gsub("%.", "_");
keyref.add(fulln, ns, "c")
return "typedef "
.. M.type_cstr_get(self:base_type_get(), fulln) .. ";"
@@ -1182,13 +1083,8 @@ M.Variable = Node:clone {
CONSTANT = eolian.variable_type.CONSTANT,
GLOBAL = eolian.variable_type.GLOBAL,
- __ctor = function(self, var)
- self.variable = var
- assert(self.variable)
- end,
-
type_get = function(self)
- return self.variable:type_get()
+ return self._obj:type_get()
end,
type_str_get = function(self)
@@ -1200,15 +1096,15 @@ M.Variable = Node:clone {
end,
doc_get = function(self)
- return M.Doc(self.variable:documentation_get())
+ return M.Doc(self._obj:documentation_get())
end,
file_get = function(self)
- return self.variable:file_get()
+ return self._obj:file_get()
end,
base_type_get = function(self)
- local v = self.variable:base_type_get()
+ local v = self._obj:base_type_get()
if not v then
return nil
end
@@ -1216,27 +1112,15 @@ M.Variable = Node:clone {
end,
value_get = function(self)
- local v = self.variable:value_get()
+ local v = self._obj:value_get()
if not v then
return nil
end
return M.Expression(v)
end,
- name_get = function(self)
- return self.variable:name_get()
- end,
-
- full_name_get = function(self)
- return self.variable:full_name_get()
- end,
-
- namespaces_get = function(self)
- return self.variable:namespaces_get():to_array()
- end,
-
is_extern = function(self)
- return self.variable:is_extern()
+ return self._obj:is_extern()
end,
nspaces_get = function(self, root)
@@ -1253,7 +1137,7 @@ M.Variable = Node:clone {
if self:is_extern() then
buf[#buf + 1] = "@extern "
end
- buf[#buf + 1] = self:full_name_get()
+ buf[#buf + 1] = self:name_get()
buf[#buf + 1] = ": "
buf[#buf + 1] = self:base_type_get():serialize()
local val = self:value_get()
@@ -1268,7 +1152,7 @@ M.Variable = Node:clone {
serialize_c = function(self, ns)
local buf = {}
local bt = self:base_type_get()
- local fulln = self:full_name_get():gsub("%.", "_"):upper()
+ local fulln = self:name_get():gsub("%.", "_"):upper()
keyref.add(fulln, ns, "c")
if self:type_get() == self.GLOBAL then
local ts = bt:c_type_get()
@@ -1309,8 +1193,7 @@ M.Variable = Node:clone {
all_globals_get = function()
local ret = {}
- -- FIXME: unit
- for v in eolian.variable_all_globals_get(eos:unit_get()) do
+ for v in eos:globals_get() do
ret[#ret + 1] = M.Variable(v)
end
return ret
@@ -1318,8 +1201,7 @@ M.Variable = Node:clone {
all_constants_get = function()
local ret = {}
- -- FIXME: unit
- for v in eolian.variable_all_constants_get(eos:unit_get()) do
+ for v in eos:constants_get() do
ret[#ret + 1] = M.Variable(v)
end
return ret
@@ -1327,8 +1209,7 @@ M.Variable = Node:clone {
globals_by_file_get = function(fn)
local ret = {}
- -- FIXME: unit
- for v in eolian.variable_globals_get_by_file(eos:unit_get(), fn) do
+ for v in eos:globals_by_file_get(fn) do
ret[#ret + 1] = M.Variable(v)
end
return ret
@@ -1336,16 +1217,14 @@ M.Variable = Node:clone {
constants_by_file_get = function(fn)
local ret = {}
- -- FIXME: unit
- for v in eolian.variable_constants_get_by_file(eos:unit_get(), fn) do
+ for v in eos:constants_by_file_get(fn) do
ret[#ret + 1] = M.Variable(v)
end
return ret
end,
global_by_name_get = function(vn)
- -- FIXME: unit
- local v = eolian.variable_global_get_by_name(eos:unit_get(), vn)
+ local v = eos:global_by_name_get(vn)
if not v then
return nil
end
@@ -1353,8 +1232,7 @@ M.Variable = Node:clone {
end,
constant_by_name_get = function(vn)
- -- FIXME: unit
- local v = eolian.variable_constant_get_by_name(eos:unit_get(), vn)
+ local v = eos:constant_by_name_get(vn)
if not v then
return nil
end
@@ -1363,43 +1241,27 @@ M.Variable = Node:clone {
}
M.Expression = Node:clone {
- __ctor = function(self, expr)
- self.expr = expr
- assert(self.expr)
- end,
-
eval_enum = function(self)
- -- FIXME: unit
- return self.expr:eval(eos:unit_get(), eolian.expression_mask.INT)
+ return self._obj:eval(eolian.expression_mask.INT)
end,
eval_type = function(self, tp)
- -- FIXME: unit
- return self.expr:eval_type(eos:unit_get(), tp.type)
+ return self._obj:eval_type(tp.type)
end,
serialize = function(self)
- return self.expr:serialize()
+ return self._obj:serialize()
end
}
M.Implement = Node:clone {
- __ctor = function(self, impl)
- self.impl = impl
- assert(self.impl)
- end,
-
- full_name_get = function(self)
- return self.impl:full_name_get()
- end,
-
class_get = function(self)
local ccl = self._cache_cl
if ccl then
return ccl
end
-- so that we don't re-instantiate, it gets cached over there too
- ccl = M.Class.by_name_get(self.impl:class_get():full_name_get())
+ ccl = M.Class.by_name_get(self._obj:class_get():name_get())
self._cache_cl = ccl
return ccl
end,
@@ -1409,14 +1271,14 @@ M.Implement = Node:clone {
if func then
return func, tp
end
- func, tp = self.impl:function_get()
+ func, tp = self._obj:function_get()
func = M.Function(func)
self._cache_func, self._cache_tp = func, tp
return func, tp
end,
doc_get = function(self, ftype, inh)
- return M.Doc(self.impl:documentation_get(ftype))
+ return M.Doc(self._obj:documentation_get(ftype))
end,
fallback_doc_get = function(self, inh)
@@ -1430,31 +1292,31 @@ M.Implement = Node:clone {
end,
is_auto = function(self, ftype)
- return self.impl:is_auto(ftype)
+ return self._obj:is_auto(ftype)
end,
is_empty = function(self, ftype)
- return self.impl:is_empty(ftype)
+ return self._obj:is_empty(ftype)
end,
is_pure_virtual = function(self, ftype)
- return self.impl:is_pure_virtual(ftype)
+ return self._obj:is_pure_virtual(ftype)
end,
is_prop_get = function(self)
- return self.impl:is_prop_get()
+ return self._obj:is_prop_get()
end,
is_prop_set = function(self)
- return self.impl:is_prop_set()
+ return self._obj:is_prop_set()
end,
is_overridden = function(self, cl)
- return cl.class ~= self.impl:class_get()
+ return cl.class ~= self._obj:class_get()
end
}
-M.DocTokenizer = Node:clone {
+M.DocTokenizer = util.Object:clone {
UNKNOWN = eolian.doc_token_type.UNKNOWN,
TEXT = eolian.doc_token_type.TEXT,
REF = eolian.doc_token_type.REF,
@@ -1484,15 +1346,15 @@ M.DocTokenizer = Node:clone {
return self.tok:type_get()
end,
- ref_get = function(self, root)
+ ref_resolve = function(self, root)
-- FIXME: unit
- local tp, d1, d2 = self.tok:ref_get(eos:unit_get())
+ local tp, d1, d2 = self.tok:ref_resolve(eos)
local reft = eolian.doc_ref_type
local ret = {}
if tp == reft.CLASS or tp == reft.FUNC or tp == reft.EVENT then
if not class_type_str[d1:type_get()] then
error("unknown class type for class '"
- .. d1:full_name_get() .. "'")
+ .. d1:name_get() .. "'")
end
elseif tp == reft.ALIAS then
elseif tp == reft.STRUCT or tp == reft.STRUCT_FIELD then
@@ -1503,7 +1365,7 @@ M.DocTokenizer = Node:clone {
else
error("invalid reference '" .. self:text_get() .. "'")
end
- for tok in d1:full_name_get():gmatch("[^%.]+") do
+ for tok in d1:name_get():gmatch("[^%.]+") do
ret[#ret + 1] = tok:lower()
end
if tp == reft.FUNC then
@@ -1522,12 +1384,12 @@ M.DocTokenizer = Node:clone {
M.scan_directory = function(dir)
if not dir then
- if not eos:system_directory_scan() then
+ if not eos:system_directory_add() then
error("failed scanning system directory")
end
return
end
- if not eos:directory_scan(dir) then
+ if not eos:directory_add(dir) then
error("failed scanning directory: " .. dir)
end
end
@@ -1545,16 +1407,16 @@ M.parse = function(st)
error("failed parsing eo files")
end
end
- -- build reverse inheritance hierarchy, FIXME: unit
- for cl in eolian.all_classes_get(eos:unit_get()) do
- local cln = cl:full_name_get()
+ -- build reverse inheritance hierarchy
+ for cl in eos:classes_get() do
+ local cln = cl:name_get()
for icl in cl:inherits_get() do
local t = revh[icl]
if not t then
t = {}
revh[icl] = t
end
- t[#t + 1] = M.Class.by_name_get(cl:full_name_get())
+ t[#t + 1] = M.Class.by_name_get(cl:name_get())
end
end
end
diff --git a/src/scripts/elua/apps/docgen/mono.lua b/src/scripts/elua/apps/docgen/mono.lua
new file mode 100644
index 0000000000..430a9ebebd
--- /dev/null
+++ b/src/scripts/elua/apps/docgen/mono.lua
@@ -0,0 +1,614 @@
+
+local writer = require("docgen.writer")
+local dtree = require("docgen.doctree")
+
+local M = {}
+
+local propt_to_type = {
+ [dtree.Function.PROPERTY] = "(get, set)",
+ [dtree.Function.PROP_GET] = "(get)",
+ [dtree.Function.PROP_SET] = "(set)",
+}
+
+local verbs = {
+ "add",
+ "get",
+ "is",
+ "del",
+ "thaw",
+ "freeze",
+ "save",
+ "wait",
+ "eject",
+ "raise",
+ "lower",
+ "load",
+ "dup",
+ "reset",
+ "unload",
+ "close",
+ "set",
+ "interpolate",
+ "has",
+ "grab",
+ "check",
+ "find",
+ "ungrab",
+ "unset",
+ "clear",
+ "pop",
+ "new",
+ "peek",
+ "push",
+ "update",
+ "show",
+ "move",
+ "hide",
+ "calculate",
+ "resize",
+ "attach",
+ "pack",
+ "unpack",
+ "emit",
+ "call",
+ "append"
+}
+
+local not_verbs = {
+ "below",
+ "above",
+ "name",
+ "unfreezable",
+ "value",
+ "r",
+ "g",
+ "b",
+ "a",
+ "finalize",
+ "destructor",
+ "to",
+ "circle",
+ "rect",
+ "path",
+ "commands",
+ "type",
+ "colorspace",
+ "op",
+ "type",
+ "properties",
+ "status",
+ "status",
+ "relative",
+ "ptr",
+ "pair",
+ "pos",
+ "end"
+}
+
+local get_class_name = function(cls)
+ local words = {}
+ local klass = cls:full_name_get()
+ for word in string.gmatch(klass, "%a+") do
+ words[#words+1] = word
+ end
+ for i = 1, #words -1 do
+ words[i] = string.lower(words[i])
+ end
+ return table.concat(words, '.')
+end
+
+local get_mono_type
+get_mono_type = function(tp)
+ if not tp then
+ return "void "
+ end
+
+ tpt = tp:type_get()
+ tpdecl = tp:typedecl_get()
+
+ if tpt == tp.REGULAR then
+ if tp:full_name_get() == "string" then
+ return "System.String"
+ elseif tp:full_name_get() == "list" then
+ ntp = tp:base_type_get()
+ --assert(btp ~= nil)
+ --ntp = btp:next_type_get()
+ return "eina.List<" .. get_mono_type(ntp) .. ">"
+ elseif tpdecl then
+ --print("typedecl type is ", tp:full_name_get())
+ tpt = tpdecl:type_get()
+ return get_class_name(tp) --tp:full_name_get()
+ else
+ --print("regular type is ", tp:full_name_get())
+ return tp:full_name_get()
+ end
+ elseif tpt == tp.CLASS then
+ return get_class_name(tp)
+ else
+ return "unknown"
+ end
+end
+
+
+local is_verb = function(word)
+ for i = 1, #verbs do
+ if verbs[i] == word then
+ return true
+ end
+ end
+ return false
+end
+
+local mono_method_name_get = function(f, ftype)
+ local cn = f:name_get(ftype)
+
+ local words = {}
+
+ for word in string.gmatch(cn, "%a+") do
+ words[#words+1] = word
+ end
+
+ if #words > 1 and is_verb(words[#words]) then
+ local tmp = words[#words]
+ words[#words] = words[1]
+ words[1] = tmp
+ end
+
+ for i = 1, #words do
+ words[i] = words[i]:gsub("^%l", string.upper)
+ end
+
+ if ftype == f.PROP_GET then
+ table.insert(words, 1, "Get")
+ elseif ftype == f.PROP_SET then
+ table.insert(words, 1, "Set")
+ end
+
+ return table.concat(words)
+end
+
+local gen_mono_param = function(par, out)
+ local part = par:type_get()
+ out = out or (par:direction_get() == par.OUT)
+ if out then
+ out = "out "
+ else
+ out = ""
+ end
+
+ return out .. get_mono_type(par:type_get()) .. ' ' .. par:name_get()
+ --local tstr = part:c_type_get()
+ --return out .. dtree.type_cstr_get(tstr, par:name_get())
+end
+
+local get_func_mono_sig_part = function(cn, tp)
+ return get_mono_type(tp) .. " " .. cn
+end
+
+local find_parent_impl
+find_parent_impl = function(fulln, cl)
+ for i, pcl in ipairs(cl:inherits_get()) do
+ for j, impl in ipairs(pcl:implements_get()) do
+ if impl:full_name_get() == fulln then
+ --if get_class_name(impl) == fulln then
+ return impl, pcl
+ end
+ end
+ local pimpl, pcl = find_parent_impl(fulln, pcl)
+ if pimpl then
+ return pimpl, pcl
+ end
+ end
+ return nil, cl
+end
+
+local find_parent_briefdoc
+find_parent_briefdoc = function(fulln, cl)
+ local pimpl, pcl = find_parent_impl(fulln, cl)
+ if not pimpl then
+ return dtree.Doc():brief_get()
+ end
+ local pdoc = pimpl:doc_get(dtree.Function.METHOD, true)
+ local pdocf = pimpl:fallback_doc_get(true)
+ if not pdoc:exists() and (not pdocf or not pdocf:exists()) then
+ return find_parent_briefdoc(fulln, pcl)
+ end
+ return pdoc:brief_get(pdocf)
+end
+
+
+local write_description = function(f, impl, func, cl)
+ local over = impl:is_overridden(cl)
+ local bdoc
+
+ local doc = impl:doc_get(func.METHOD, true)
+ local docf = impl:fallback_doc_get(true)
+ if over and (not doc:exists() and (not docf or not docf:exists())) then
+ bdoc = find_parent_briefdoc(impl:full_name_get(), cl)
+ else
+ bdoc = doc:brief_get(docf)
+ end
+ if bdoc ~= "No description supplied." then
+ f:write_raw(bdoc)
+ end
+end
+
+local write_scope = function(f, func)
+ local ftt = {
+ [func.scope.PROTECTED] = "protected",
+ [func.scope.PRIVATE] = "private"
+ }
+ if func:is_class() then
+ f:write_raw(" ")
+ f:write_m("class")
+ end
+ if func:type_get() == func.PROPERTY then
+ local ft1, ft2 = ftt[func:scope_get(func.PROP_GET)],
+ ftt[func:scope_get(func.PROP_SET)]
+ if ft1 and ft1 == ft2 then
+ f:write_raw(" ")
+ f:write_m(ft1)
+ elseif ft1 or ft2 then
+ local s = ""
+ if ft1 then
+ s = s .. ft1 .. " get" .. (ft2 and ", " or "")
+ end
+ if ft2 then
+ s = s .. ft2 .. " set"
+ end
+ f:write_raw(" ")
+ f:write_m(s)
+ end
+ else
+ local ft = ftt[func:scope_get(func:type_get())]
+ if ft then
+ f:write_raw(" ")
+ f:write_m(ft)
+ end
+ end
+end
+
+local write_function = function(f, func, cl)
+ local llbuf = writer.Buffer()
+ llbuf:write_link(func:nspaces_get(cl, true), func:name_get())
+ f:write_b(llbuf:finish())
+
+ local pt = propt_to_type[func:type_get()]
+ if pt then
+ f:write_raw(" ")
+ local llbuf = writer.Buffer()
+ llbuf:write_b(pt)
+ f:write_i(llbuf:finish())
+ end
+end
+
+local gen_func_mono_sig = function(f, ftype)
+ ftype = ftype or f.METHOD
+ assert(ftype ~= f.PROPERTY)
+
+ local cn = mono_method_name_get(f, ftype)
+ local rtype = f:return_type_get(ftype)
+ local prefix = ""
+ local suffix = ""
+
+ if f:is_class() then
+ prefix = "static "
+ elseif f:is_const() or ftype == f.PROP_GET then
+ suffix = " const"
+ end
+
+ if f:type_get() == f.METHOD then
+ local pars = f:parameters_get()
+ local cnrt = get_func_mono_sig_part(cn, rtype)
+ for i = 1, #pars do
+ pars[i] = gen_mono_param(pars[i])
+ end
+ return prefix .. cnrt .. "(" .. table.concat(pars, ", ") .. ")" .. suffix .. ";"
+ end
+
+ local keys = f:property_keys_get(ftype)
+ local vals = f:property_values_get(ftype)
+
+ if ftype == f.PROP_SET then
+ local cnrt = get_func_mono_sig_part(cn, rtype)
+ local pars = {}
+ for i, par in ipairs(keys) do
+ pars[#pars + 1] = gen_mono_param(par)
+ end
+ for i, par in ipairs(vals) do
+ pars[#pars + 1] = gen_mono_param(par)
+ end
+ return cnrt .. "(" .. table.concat(pars, ", ") .. ");"
+ end
+
+ -- getters
+ local cnrt
+ if not rtype then
+ if #vals == 1 then
+ cnrt = get_func_mono_sig_part(cn, vals[1]:type_get())
+ table.remove(vals, 1)
+ else
+ cnrt = get_func_mono_sig_part(cn)
+ end
+ else
+ cnrt = get_func_mono_sig_part(cn, rtype)
+ end
+ local pars = {}
+ for i, par in ipairs(keys) do
+ pars[#pars + 1] = gen_mono_param(par)
+ end
+ for i, par in ipairs(vals) do
+ print('parameter is value for get, so out')
+ pars[#pars + 1] = gen_mono_param(par, true)
+ end
+
+ return cnrt .. "(" .. table.concat(pars, ", ") .. ");"
+end
+
+local build_functable = function(f, tcl, tbl)
+ if #tbl == 0 then
+ return
+ end
+ local nt = {}
+ for i, implt in ipairs(tbl) do
+ local lbuf = writer.Buffer()
+
+ local cl, impl = unpack(implt)
+ local func = impl:function_get()
+
+ local wt = {}
+ wt[0] = cl
+ wt[1] = func
+ wt[2] = impl
+
+ nt[#nt + 1] = wt
+ end
+
+ local get_best_scope = function(f)
+ local ft = f:type_get()
+ if ft == f.PROPERTY then
+ local fs1, fs2 = f:scope_get(f.PROP_GET), f:scope_get(f.PROP_SET)
+ if fs1 == f.scope.PUBLIC or fs2 == f.scope.PUBLIC then
+ return f.scope.PUBLIC
+ elseif fs1 == f.scope.PROTECTED or fs2 == f.scope.PROTECTED then
+ return f.scope.PROTECTED
+ else
+ return f.scope.PRIVATE
+ end
+ else
+ return f:scope_get(ft)
+ end
+ end
+ table.sort(nt, function(v1, v2)
+ local cl1, cl2 = v1[0], v2[0]
+ if cl1 ~= cl2 then
+ return cl1:full_name_get() < cl2:full_name_get()
+ end
+
+ local f1, f2 = v1[1], v2[1]
+ local f1s, f2s = get_best_scope(f1), get_best_scope(f2)
+ if f1s ~= f2s then
+ if f1s ~= f1.scope.PROTECED then
+ -- public funcs go first, private funcs go last
+ return f1s == f1.scope.PUBLIC
+ else
+ -- protected funcs go second
+ return f2s == f2.scope.PRIVATE
+ end
+ end
+ return f1:name_get() < f2:name_get()
+ end)
+
+ return nt
+end
+
+local find_callables
+find_callables = function(cl, omeths, events, written)
+ for i, pcl in ipairs(cl:inherits_get()) do
+ for j, impl in ipairs(pcl:implements_get()) do
+ local func = impl:function_get()
+ local fid = func:id_get()
+ if not written[fid] then
+ omeths[#omeths + 1] = { pcl, impl }
+ written[fid] = true
+ end
+ end
+ for i, ev in ipairs(pcl:events_get()) do
+ local evid = ev:name_get()
+ if not written[evid] then
+ events[#events + 1] = { pcl, ev }
+ written[evid] = true
+ end
+ end
+ find_callables(pcl, omeths, events, written)
+ end
+end
+
+M.build_inherits = function(cl, t, lvl)
+ t = t or {}
+ lvl = lvl or 0
+ local lbuf = writer.Buffer()
+ if lvl > 0 then
+ local cln = cl:nspaces_get(true)
+ cln[#cln] = nil
+ cln[#cln] = cln[#cln] .. "_mono"
+ cln = ":" .. 'develop:api' .. ":"
+ .. table.concat(cln, ":")
+ lbuf:write_raw("[[", cln, "|", get_class_name(cl), "]]")
+ --lbuf:write_link(cl:nspaces_get(true), cl:full_name_get())
+ lbuf:write_raw(" ")
+ lbuf:write_i("(" .. cl:type_str_get() .. ")")
+
+ t[#t + 1] = { lvl - 1, lbuf:finish() }
+ end
+
+ for i, acl in ipairs(cl:inherits_get()) do
+ M.build_inherits(acl, t, lvl + 1)
+ end
+ return t
+end
+
+M.build_inherit_summary = function(cl, buf)
+ buf = buf or writer.Buffer()
+ buf:write_raw(" => ")
+
+ local cln = cl:nspaces_get(true)
+ cln[#cln] = nil
+ cln[#cln] = cln[#cln] .. "_mono"
+ cln = ":" .. 'develop:api' .. ":"
+ .. table.concat(cln, ":")
+ buf:write_raw("[[", cln, "|", get_class_name(cl), "]]")
+ buf:write_raw(" ")
+ buf:write_i("(" .. cl:type_str_get() .. ")")
+
+ local inherits = cl:inherits_get()
+ if #inherits ~= 0 then
+ M.build_inherit_summary(inherits[1], buf)
+ end
+ return buf
+end
+
+M.write_inherit_functable = function(f, tcl, tbl)
+ if #tbl == 0 then
+ return
+ end
+ local nt = build_functable(t, tcl, tbl)
+
+ local prevcl = tcl
+ for i, wt in ipairs(nt) do
+ local cl = wt[0]
+ local func = wt[1]
+ local impl = wt[2]
+
+ local ocl = impl:class_get()
+ local func = impl:function_get()
+
+ -- class grouping for inheritance
+ if cl ~= prevcl then
+ prevcl = cl
+ f:write_raw("^ ")
+ f:write_link(cl:nspaces_get(true), cl:full_name_get())
+ f:write_raw(" ^^^")
+ f:write_nl()
+ end
+
+ -- scope
+ f:write_raw("| ")
+ write_scope(f, func)
+ f:write_raw(" | ")
+ -- function
+ write_function(f, func, cl)
+ f:write_raw(" | ")
+ -- description
+ write_description(f, impl, func, cl)
+ f:write_raw(" |")
+ f:write_nl()
+ end
+ f:write_nl()
+end
+
+M.write_functable = function(f, tcl, tbl)
+ if #tbl == 0 then
+ return
+ end
+ local nt = build_functable(t, tcl, tbl)
+
+ local wrote = false
+ for i, wt in ipairs(nt) do
+ local cl = wt[0]
+ local func = wt[1]
+ local impl = wt[2]
+
+ local ocl = impl:class_get()
+ local func = impl:function_get()
+ local over = impl:is_overridden(cl)
+
+ -- function
+ write_function(f, func, cl)
+ -- scope
+ write_scope(f, func)
+
+ -- overrides
+ if over then
+ -- TODO: possibly also mention which part of a property was
+ -- overridden and where, get/set override point might differ!
+ -- but we get latest doc every time so it's ok for now
+ local llbuf = writer.Buffer()
+ llbuf:write_raw(" [Overridden from ")
+ llbuf:write_link(ocl:nspaces_get(true), ocl:full_name_get())
+ llbuf:write_raw("]")
+ f:write_i(llbuf:finish())
+ end
+
+ -- description
+ f:write_br(true)
+ f:write_raw("> ")
+ write_description(f, impl, func, cl)
+
+ -- code snippets
+ f:write_nl()
+ local codes = {}
+ if func:type_get() ~= dtree.Function.PROPERTY then
+ codes[#codes + 1] = gen_func_mono_sig(func, func:type_get())
+ else
+ codes[#codes + 1] = gen_func_mono_sig(func, dtree.Function.PROP_GET)
+ codes[#codes + 1] = gen_func_mono_sig(func, dtree.Function.PROP_SET)
+ end
+ f:write_code(table.concat(codes, "\n"), "c")
+ f:write_br(true)
+ end
+ f:write_nl()
+end
+
+M.build_class = function(cl)
+ local cln = cl:nspaces_get()
+ local fulln = cl:full_name_get()
+ --table.insert(cln, "mono")
+ cln[#cln] = cln[#cln] .. "_mono"
+ --printgen("Generating (MONO) class: " .. fulln .. " in ns ", unpack(cln))
+ local f = writer.Writer(cln, fulln .. " (mono)")
+ f:write_h(cl:full_name_get() .. " (" .. cl:type_str_get() .. ")", 1)
+
+ f:write_h("Description", 2)
+ f:write_raw(cl:doc_get():full_get(nil, true))
+ f:write_nl(2)
+
+ f:write_editable(cln, "description")
+ f:write_nl()
+
+ local inherits = cl:inherits_get()
+ if #inherits ~= 0 then
+ f:write_h("Inheritance", 2)
+
+ f:write_raw(M.build_inherit_summary(inherits[1]):finish())
+ f:write_nl()
+
+ f:write_folded("Full hierarchy", function()
+ f:write_list(M.build_inherits(cl))
+ end)
+ f:write_nl()
+ end
+
+ local written = {}
+ local ievs = {}
+ local meths, omeths = {}, {}
+ for i, impl in ipairs(cl:implements_get()) do
+ local func = impl:function_get()
+ written[func:id_get()] = true
+ meths[#meths + 1] = { cl, impl }
+ end
+ find_callables(cl, omeths, ievs, written)
+
+ f:write_h("Members", 2)
+ M.write_functable(f, cl, meths, true)
+ if #omeths ~= 0 then
+ f:write_h("Inherited", 3)
+ end
+ M.write_inherit_functable(f, cl, omeths, false)
+
+ f:finish()
+end
+
+return M
+
+
diff --git a/src/scripts/elua/apps/docgen/stats.lua b/src/scripts/elua/apps/docgen/stats.lua
index 5bbc592333..9659f86dcd 100644
--- a/src/scripts/elua/apps/docgen/stats.lua
+++ b/src/scripts/elua/apps/docgen/stats.lua
@@ -119,7 +119,7 @@ M.check_class = function(cl)
return
end
if not cl:doc_get():exists() then
- print_missing(cl:full_name_get(), ct)
+ print_missing(cl:name_get(), ct)
stat_incr(ct, true)
else
stat_incr(ct, false)
@@ -127,7 +127,7 @@ M.check_class = function(cl)
for i, ev in ipairs(cl:events_get()) do
if not ev:doc_get():exists() then
- print_missing(cl:full_name_get() .. "." .. ev:name_get(), "event")
+ print_missing(cl:name_get() .. "." .. ev:name_get(), "event")
stat_incr("event", true)
else
stat_incr("event", false)
@@ -136,7 +136,7 @@ M.check_class = function(cl)
end
M.check_method = function(fn, cl)
- local fulln = cl:full_name_get() .. "." .. fn:name_get()
+ local fulln = cl:name_get() .. "." .. fn:name_get()
if fn:return_type_get(fn.METHOD) then
if not fn:return_doc_get(fn.METHOD):exists() then
print_missing(fulln, "method return")
@@ -168,7 +168,7 @@ M.check_property = function(fn, cl, ft)
}
local pfx = pfxs[ft]
- local fulln = cl:full_name_get() .. "." .. fn:name_get()
+ local fulln = cl:name_get() .. "." .. fn:name_get()
if fn:return_type_get(ft) then
if not fn:return_doc_get(ft):exists() then
print_missing(fulln, pfx .. "etter return")
@@ -208,7 +208,7 @@ end
M.check_alias = function(v)
if not v:doc_get():exists() then
- print_missing(v:full_name_get(), "alias")
+ print_missing(v:name_get(), "alias")
stat_incr("alias", true)
else
stat_incr("alias", false)
@@ -217,14 +217,14 @@ end
M.check_struct = function(v)
if not v:doc_get():exists() then
- print_missing(v:full_name_get(), "struct")
+ print_missing(v:name_get(), "struct")
stat_incr("struct", true)
else
stat_incr("struct", false)
end
for i, fl in ipairs(v:struct_fields_get()) do
if not fl:doc_get():exists() then
- print_missing(v:full_name_get() .. "." .. fl:name_get(), "struct field")
+ print_missing(v:name_get() .. "." .. fl:name_get(), "struct field")
stat_incr("sfield", true)
else
stat_incr("sfield", false)
@@ -234,14 +234,14 @@ end
M.check_enum = function(v)
if not v:doc_get():exists() then
- print_missing(v:full_name_get(), "enum")
+ print_missing(v:name_get(), "enum")
stat_incr("enum", true)
else
stat_incr("enum", false)
end
for i, fl in ipairs(v:enum_fields_get()) do
if not fl:doc_get():exists() then
- print_missing(v:full_name_get() .. "." .. fl:name_get(), "enum field")
+ print_missing(v:name_get() .. "." .. fl:name_get(), "enum field")
stat_incr("efield", true)
else
stat_incr("efield", false)
@@ -251,7 +251,7 @@ end
M.check_constant = function(v)
if not v:doc_get():exists() then
- print_missing(v:full_name_get(), "constant")
+ print_missing(v:name_get(), "constant")
stat_incr("constant", true)
else
stat_incr("constant", false)
@@ -260,7 +260,7 @@ end
M.check_global = function(v)
if not v:doc_get():exists() then
- print_missing(v:full_name_get(), "global")
+ print_missing(v:name_get(), "global")
stat_incr("global", true)
else
stat_incr("global", false)
diff --git a/src/scripts/elua/apps/docgen/writer.lua b/src/scripts/elua/apps/docgen/writer.lua
index 92be2f1adf..2aeadf8da7 100644
--- a/src/scripts/elua/apps/docgen/writer.lua
+++ b/src/scripts/elua/apps/docgen/writer.lua
@@ -345,7 +345,7 @@ writers["dokuwiki"] = util.Object:clone {
hasraw = true
end
if tp == tokp.REF then
- local reft = tokp:ref_get(true)
+ local reft = tokp:ref_resolve(true)
local str = tokp:text_get()
if str:sub(1, 1) == "[" then
str = str:sub(2, #str - 1)
diff --git a/src/scripts/elua/apps/gendoc.lua b/src/scripts/elua/apps/gendoc.lua
index 55a380633c..36c47e2af3 100644
--- a/src/scripts/elua/apps/gendoc.lua
+++ b/src/scripts/elua/apps/gendoc.lua
@@ -7,6 +7,7 @@ local dutil = require("docgen.util")
local writer = require("docgen.writer")
local keyref = require("docgen.keyref")
local dtree = require("docgen.doctree")
+local mono = require("docgen.mono")
local printgen = function() end
@@ -306,11 +307,16 @@ end
-- builders
local nspaces_group = function(ns)
- if ns[1] == "efl" and (ns[2] ~= "class" and ns[2] ~= "interface" and ns[2] ~= "object" and ns[2] ~= "promise") then
- return ns[1] .. "." .. ns[2]
+ if #ns <= 2 then
+ return ns[1]
end
- return ns[1]
+ if ns[1] == "efl" and (ns[2] == "class" or ns[2] == "interface" or
+ ns[2] == "object" or ns[2] == "promise") then
+ return ns[1]
+ end
+
+ return ns[1] .. "." .. ns[2]
end
local nspaces_filter = function(items, ns)
@@ -337,7 +343,7 @@ local build_reftable = function(f, title, ctype, t, iscl)
writer.Buffer():write_link(
iscl and v:nspaces_get(true)
or dtree.Node.nspaces_get(v, true),
- v:full_name_get()
+ v:name_get()
):finish(),
v:doc_get():brief_get()
}
@@ -423,7 +429,7 @@ build_inherits = function(cl, t, lvl)
lvl = lvl or 0
local lbuf = writer.Buffer()
if lvl > 0 then
- lbuf:write_link(cl:nspaces_get(true), cl:full_name_get())
+ lbuf:write_link(cl:nspaces_get(true), cl:name_get())
lbuf:write_raw(" ")
lbuf:write_i("(" .. cl:type_str_get() .. ")")
@@ -441,7 +447,7 @@ build_inherit_summary = function(cl, buf)
buf = buf or writer.Buffer()
buf:write_raw(" => ")
- buf:write_link(cl:nspaces_get(true), cl:full_name_get())
+ buf:write_link(cl:nspaces_get(true), cl:name_get())
buf:write_raw(" ")
buf:write_i("(" .. cl:type_str_get() .. ")")
@@ -666,7 +672,7 @@ local find_parent_impl
find_parent_impl = function(fulln, cl)
for i, pcl in ipairs(cl:inherits_get()) do
for j, impl in ipairs(pcl:implements_get()) do
- if impl:full_name_get() == fulln then
+ if impl:name_get() == fulln then
return impl, pcl
end
end
@@ -729,7 +735,7 @@ local build_functable = function(f, tcl, tbl)
table.sort(nt, function(v1, v2)
local cl1, cl2 = v1[0], v2[0]
if cl1 ~= cl2 then
- return cl1:full_name_get() < cl2:full_name_get()
+ return cl1:name_get() < cl2:name_get()
end
local f1, f2 = v1[1], v2[1]
@@ -756,7 +762,7 @@ local write_description = function(f, impl, func, cl)
local doc = impl:doc_get(func.METHOD, true)
local docf = impl:fallback_doc_get(true)
if over and (not doc:exists() and (not docf or not docf:exists())) then
- bdoc = find_parent_briefdoc(impl:full_name_get(), cl)
+ bdoc = find_parent_briefdoc(impl:name_get(), cl)
else
bdoc = doc:brief_get(docf)
end
@@ -842,7 +848,7 @@ local write_functable = function(f, tcl, tbl)
-- but we get latest doc every time so it's ok for now
local llbuf = writer.Buffer()
llbuf:write_raw(" [Overridden from ")
- llbuf:write_link(ocl:nspaces_get(true), ocl:full_name_get())
+ llbuf:write_link(ocl:nspaces_get(true), ocl:name_get())
llbuf:write_raw("]")
f:write_i(llbuf:finish())
end
@@ -894,7 +900,7 @@ local write_inherit_functable = function(f, tcl, tbl)
if cl ~= prevcl then
prevcl = cl
f:write_raw("^ ")
- f:write_link(cl:nspaces_get(true), cl:full_name_get())
+ f:write_link(cl:nspaces_get(true), cl:name_get())
f:write_raw(" ^^^")
f:write_nl()
end
@@ -979,7 +985,7 @@ local build_evtable = function(f, tcl, tbl, newm)
table.sort(nt, function(v1, v2)
if v1[0] ~= v2[0] then
- return v1[0]:full_name_get() < v2[0]:full_name_get()
+ return v1[0]:name_get() < v2[0]:name_get()
end
return v1[2] < v2[2]
@@ -1048,7 +1054,7 @@ local write_inherit_evtable = function(f, tcl, tbl)
if cl ~= prevcl then
prevcl = cl
f:write_raw("^ ")
- f:write_link(cl:nspaces_get(true), cl:full_name_get())
+ f:write_link(cl:nspaces_get(true), cl:name_get())
f:write_raw(" ^^^")
f:write_nl()
end
@@ -1075,11 +1081,13 @@ end
local build_class = function(cl)
local cln = cl:nspaces_get()
- local fulln = cl:full_name_get()
+ local fulln = cl:name_get()
local f = writer.Writer(cln, fulln)
printgen("Generating class: " .. fulln)
- f:write_h(cl:full_name_get() .. " (" .. cl:type_str_get() .. ")", 1)
+ mono.build_class(cl)
+
+ f:write_h(cl:name_get() .. " (" .. cl:type_str_get() .. ")", 1)
f:write_h("Description", 2)
f:write_raw(cl:doc_get():full_get(nil, true))
@@ -1146,7 +1154,7 @@ end
local build_alias = function(tp)
local ns = dtree.Node.nspaces_get(tp)
- local fulln = tp:full_name_get()
+ local fulln = tp:name_get()
local f = writer.Writer(ns, fulln)
printgen("Generating alias: " .. fulln)
@@ -1164,7 +1172,7 @@ end
local build_struct = function(tp)
local ns = dtree.Node.nspaces_get(tp)
- local fulln = tp:full_name_get()
+ local fulln = tp:name_get()
local f = writer.Writer(ns, fulln)
printgen("Generating struct: " .. fulln)
@@ -1197,7 +1205,7 @@ end
local build_enum = function(tp)
local ns = dtree.Node.nspaces_get(tp)
- local fulln = tp:full_name_get()
+ local fulln = tp:name_get()
local f = writer.Writer(ns, fulln)
printgen("Generating enum: " .. fulln)
@@ -1230,7 +1238,7 @@ end
local build_variable = function(v, constant)
local ns = v:nspaces_get()
- local fulln = v:full_name_get()
+ local fulln = v:name_get()
local f = writer.Writer(ns, fulln)
printgen("Generating variable: " .. fulln)
@@ -1332,9 +1340,9 @@ local write_inherited_from = function(f, impl, cl, over, prop)
end
local buf = writer.Buffer()
buf:write_raw("Overridden from ")
- local pimpl, pcl = find_parent_impl(impl:full_name_get(), cl)
+ local pimpl, pcl = find_parent_impl(impl:name_get(), cl)
buf:write_link(
- impl:function_get():nspaces_get(pcl, true), impl:full_name_get()
+ impl:function_get():nspaces_get(pcl, true), impl:name_get()
)
if prop then
buf:write_raw(" ")
@@ -1360,7 +1368,7 @@ local impls_of = {}
local get_all_impls_of
get_all_impls_of = function(tbl, cl, fn, got)
- local cfn = cl:full_name_get()
+ local cfn = cl:name_get()
if got[cfn] then
return
end
@@ -1381,7 +1389,7 @@ local write_ilist = function(f, impl, cl)
local fn = impl:function_get()
local fnn = fn:name_get()
local ocl = fn:implement_get():class_get()
- local onm = ocl:full_name_get() .. "." .. fnn
+ local onm = ocl:name_get() .. "." .. fnn
local imps = impls_of[onm]
if not imps then
imps = {}
@@ -1393,7 +1401,7 @@ local write_ilist = function(f, impl, cl)
local t = {}
for i, icl in ipairs(imps) do
local buf = writer.Buffer()
- local cfn = icl:full_name_get() .. "." .. fnn
+ local cfn = icl:name_get() .. "." .. fnn
if icl:is_same(cl) then
buf:write_b(cfn)
else
@@ -1408,13 +1416,13 @@ build_method = function(impl, cl)
local over = impl:is_overridden(cl)
local fn = impl:function_get()
local mns = fn:nspaces_get(cl)
- local methn = cl:full_name_get() .. "." .. fn:name_get()
+ local methn = cl:name_get() .. "." .. fn:name_get()
local f = writer.Writer(mns, methn)
printgen("Generating method: " .. methn)
local doc = impl:doc_get(fn.METHOD)
if over and not doc:exists() then
- doc = find_parent_doc(impl:full_name_get(), cl, fn.METHOD)
+ doc = find_parent_doc(impl:name_get(), cl, fn.METHOD)
end
f:write_h("Description", 2)
@@ -1451,7 +1459,7 @@ build_property = function(impl, cl)
local over = impl:is_overridden(cl)
local fn = impl:function_get()
local pns = fn:nspaces_get(cl)
- local propn = cl:full_name_get() .. "." .. fn:name_get()
+ local propn = cl:name_get() .. "." .. fn:name_get()
local f = writer.Writer(pns, propn)
printgen("Generating property: " .. propn)
@@ -1466,13 +1474,13 @@ build_property = function(impl, cl)
if over then
if not doc:exists() then
- doc = find_parent_doc(impl:full_name_get(), cl, fn.PROPERTY)
+ doc = find_parent_doc(impl:name_get(), cl, fn.PROPERTY)
end
if isget and not gdoc:exists() then
- gdoc = find_parent_doc(impl:full_name_get(), cl, fn.PROP_GET)
+ gdoc = find_parent_doc(impl:name_get(), cl, fn.PROP_GET)
end
if isset and not sdoc:exists() then
- sdoc = find_parent_doc(impl:full_name_get(), cl, fn.PROP_SET)
+ sdoc = find_parent_doc(impl:name_get(), cl, fn.PROP_SET)
end
end
@@ -1587,7 +1595,7 @@ end
build_event = function(ev, cl)
local evn = ev:nspaces_get(cl)
- local evnm = cl:full_name_get() .. ": " .. ev:name_get()
+ local evnm = cl:name_get() .. ": " .. ev:name_get()
local f = writer.Writer(evn, evnm)
printgen("Generating event: " .. evnm)
@@ -1641,7 +1649,7 @@ end
local build_stats_keyref = function()
for i, cl in ipairs(dtree.Class.all_get()) do
stats.check_class(cl)
- keyref.add(cl:full_name_get():gsub("%.", "_"), cl:nspaces_get(), "c")
+ keyref.add(cl:name_get():gsub("%.", "_"), cl:nspaces_get(), "c")
for i, imp in ipairs(cl:implements_get()) do
-- TODO: handle doc overrides in stats system
if not imp:is_overridden(cl) then
@@ -1748,7 +1756,7 @@ getopt.parse {
if st == "clist" then
for i, cl in ipairs(dtree.Class.all_get()) do
- print(cl:full_name_get())
+ print(cl:name_get())
end
return
end
diff --git a/src/scripts/elua/apps/lualian.lua b/src/scripts/elua/apps/lualian.lua
index 4ffbf58ee1..f0837d7e35 100644
--- a/src/scripts/elua/apps/lualian.lua
+++ b/src/scripts/elua/apps/lualian.lua
@@ -52,7 +52,7 @@ getopt.parse {
lualian.include_dir(v)
end
if os.getenv("EFL_RUN_IN_TREE") then
- lualian.system_directory_scan()
+ lualian.system_directory_add()
end
lualian.load_eot_files()
for i, fname in ipairs(args) do
diff --git a/src/scripts/elua/modules/lualian.lua b/src/scripts/elua/modules/lualian.lua
index b8b32a830c..e515aaf8bc 100644
--- a/src/scripts/elua/modules/lualian.lua
+++ b/src/scripts/elua/modules/lualian.lua
@@ -102,12 +102,12 @@ end
local typeconv = function(tps, expr, isin)
if tps:type_get() == type_type.POINTER then
local base = tps:base_type_get()
- local f = (isin and known_ptr_in or known_ptr_out)[base:c_type_get(gen_unit, eolian.c_type_type.DEFAULT)]
+ local f = (isin and known_ptr_in or known_ptr_out)[base:c_type_get(eolian.c_type_type.DEFAULT)]
if f then return f(expr) end
return build_calln(tps, expr, isin)
end
- local tp = tps:name_get()
+ local tp = tps:short_name_get()
if is_num(tp) then
return isin and expr or ("tonumber(%s)"):format(expr)
@@ -188,7 +188,7 @@ local Method = Node:clone {
local proto = {
name = meth:name_get()
}
- proto.ret_type = rett and rett:c_type_get(gen_unit, eolian.c_type_type.RETURN) or "void"
+ proto.ret_type = rett and rett:c_type_get(eolian.c_type_type.RETURN) or "void"
local args, cargs, vargs = { "self" }, {}, {}
proto.args, proto.cargs, proto.vargs = args, cargs, vargs
local rets = {}
@@ -206,7 +206,7 @@ local Method = Node:clone {
for v in pars do
local dir, tps, nm = v:direction_get(), v:type_get(), kw_t(v:name_get())
- local tp = tps:c_type_get(gen_unit, eolian.c_type_type.PARAM)
+ local tp = tps:c_type_get(eolian.c_type_type.PARAM)
if dir == param_dir.OUT or dir == param_dir.INOUT then
if dir == param_dir.INOUT then
args[#args + 1] = nm
@@ -283,7 +283,7 @@ local Property = Method:clone {
nkeys = #keys,
nvals = #vals
}
- proto.ret_type = rett and rett:c_type_get(gen_unit, eolian.c_type_type.RETURN) or "void"
+ proto.ret_type = rett and rett:c_type_get(eolian.c_type_type.RETURN) or "void"
local args, cargs, vargs = { "self" }, {}, {}
proto.args, proto.cargs, proto.vargs = args, cargs, vargs
local rets = {}
@@ -298,7 +298,7 @@ local Property = Method:clone {
for i, v in ipairs(keys) do
local nm = kw_t(v:name_get())
local tps = v:type_get()
- local tp = tps:c_type_get(gen_unit, eolian.c_type_type.PARAM)
+ local tp = tps:c_type_get(eolian.c_type_type.PARAM)
args [#args + 1] = nm
cargs[#cargs + 1] = tp .. " " .. nm
vargs[#vargs + 1] = typeconv(tps, nm, true)
@@ -310,13 +310,13 @@ local Property = Method:clone {
if self.isget then
if #vals == 1 and not rett then
local tps = vals[1]:type_get()
- proto.ret_type = tps:c_type_get(gen_unit, eolian.c_type_type.PARAM)
+ proto.ret_type = tps:c_type_get(eolian.c_type_type.PARAM)
rets[#rets + 1] = typeconv(tps, "v", false)
else
for i, v in ipairs(vals) do
local dir, tps, nm = v:direction_get(), v:type_get(),
kw_t(v:name_get())
- local tp = tps:c_type_get(gen_unit, eolian.c_type_type.PARAM)
+ local tp = tps:c_type_get(eolian.c_type_type.PARAM)
cargs [#cargs + 1] = tp .. " *" .. nm
vargs [#vargs + 1] = nm
allocs[#allocs + 1] = { tp, nm }
@@ -327,7 +327,7 @@ local Property = Method:clone {
for i, v in ipairs(vals) do
local dir, tps, nm = v:direction_get(), v:type_get(),
kw_t(v:name_get())
- local tp = tps:c_type_get(gen_unit, eolian.c_type_type.PARAM)
+ local tp = tps:c_type_get(eolian.c_type_type.PARAM)
args [#args + 1] = nm
cargs[#cargs + 1] = tp .. " " .. nm
vargs[#vargs + 1] = typeconv(tps, nm, true)
@@ -407,7 +407,7 @@ local Mixin = Node:clone {
generate = function(self, s)
dom:log(log.level.INFO, " Generating for interface/mixin: "
- .. self.klass:full_name_get())
+ .. self.klass:name_get())
s:write("ffi.cdef [[\n")
self:gen_ffi(s)
@@ -419,7 +419,7 @@ local Mixin = Node:clone {
self:gen_children(s)
s:write("}\n")
- local knu = self.klass:full_name_get():gsub("%.", "_")
+ local knu = self.klass:name_get():gsub("%.", "_")
if not self.iface then
s:write(("__body[\"__mixin_%s\"] = true\n"):format(knu))
else
@@ -462,7 +462,7 @@ local Class = Node:clone {
generate = function(self, s)
dom:log(log.level.INFO, " Generating for class: "
- .. self.klass:full_name_get())
+ .. self.klass:name_get())
s:write("ffi.cdef [[\n")
self:gen_ffi(s)
@@ -482,7 +482,7 @@ local Class = Node:clone {
return eo.__ctor_common(__class, parent, eo.class_get("%s").__eo_ctor,
1, ...)
end
-]]):format(mname, self.klass:name_get(), self.klass:full_name_get():gsub("%.",
+]]):format(mname, self.klass:short_name_get(), self.klass:name_get():gsub("%.",
"_")))
end,
@@ -572,7 +572,7 @@ local File = Node:clone {
local kls = self.klass
local ckls = self.children[1]
- local kn = kls:full_name_get()
+ local kn = kls:name_get()
dom:log(log.level.INFO, "Generating for file: " .. self.fname)
dom:log(log.level.INFO, " Class : " .. kn)
@@ -669,7 +669,7 @@ end
local gen_class = function(klass)
local tp = klass:type_get()
if tp == class_type.UNKNOWN then
- error(klass:full_name_get() .. ": unknown type")
+ error(klass:name_get() .. ": unknown type")
elseif tp == class_type.MIXIN or tp == class_type.INTERFACE then
return Mixin(tp == class_type.INTERFACE, klass, gen_contents(klass))
end
@@ -684,14 +684,14 @@ local gen_class = function(klass)
elseif tp == class_type.INTERFACE or tp == class_type.MIXIN then
mixins[#mixins + 1] = v
else
- error(klass:full_name_get() .. ": unknown inherit " .. v)
+ error(klass:name_get() .. ": unknown inherit " .. v)
end
end
return Class(klass, parents, mixins, gen_contents(klass))
end
M.include_dir = function(dir)
- if not get_state():directory_scan(dir) then
+ if not get_state():directory_add(dir) then
error("Failed including directory: " .. dir)
end
end
@@ -700,8 +700,8 @@ M.load_eot_files = function()
return get_state():all_eot_files_parse()
end
-M.system_directory_scan = function()
- return get_state():system_directory_scan()
+M.system_directory_add = function()
+ return get_state():system_directory_add()
end
M.generate = function(fname, fstream)
@@ -711,7 +711,7 @@ M.generate = function(fname, fstream)
end
gen_unit = unit
local sfn = fname:match(".*[\\/](.+)$") or fname
- local klass = eolian.class_get_by_file(unit, sfn)
+ local klass = get_state():class_by_file_get(sfn)
File(fname, klass, { gen_class(klass) }):generate(fstream or io.stdout)
end
diff --git a/src/scripts/gendoc/doc_alias.template b/src/scripts/gendoc/doc_alias.template
index c0d5fa7a3d..0f3382344b 100644
--- a/src/scripts/gendoc/doc_alias.template
+++ b/src/scripts/gendoc/doc_alias.template
@@ -1,6 +1,6 @@
<!--(include)-->doc_macros.include<!--(end)-->#!
-~~Title: ${alias.full_name}$~~
-====== ${alias.full_name}$ (alias) ======
+~~Title: ${alias.name}$~~
+====== ${alias.name}$ (alias) ======
${BEST_SUMMARY(obj=alias)}$
diff --git a/src/scripts/gendoc/doc_class.template b/src/scripts/gendoc/doc_class.template
index 60f6779af1..6daaa5f087 100644
--- a/src/scripts/gendoc/doc_class.template
+++ b/src/scripts/gendoc/doc_class.template
@@ -1,6 +1,6 @@
<!--(include)-->doc_macros.include<!--(end)-->#!
-~~Title: ${cls.full_name}$~~
-====== ${cls.full_name}$ (${CLS_TYPE}$) ======
+~~Title: ${cls.name}$~~
+====== ${cls.name}$ (${CLS_TYPE}$) ======
${BEST_SUMMARY(obj=cls)}$
diff --git a/src/scripts/gendoc/doc_enum.template b/src/scripts/gendoc/doc_enum.template
index 03f6cd62cd..bdbb37a527 100644
--- a/src/scripts/gendoc/doc_enum.template
+++ b/src/scripts/gendoc/doc_enum.template
@@ -1,6 +1,6 @@
<!--(include)-->doc_macros.include<!--(end)-->#!
-~~Title: ${enum.full_name}$~~
-====== ${enum.full_name}$ (enum) ======
+~~Title: ${enum.name}$~~
+====== ${enum.name}$ (enum) ======
${BEST_SUMMARY(obj=enum)}$
@@ -23,7 +23,7 @@ ${OBJECT_STATIC_CONTENT(obj=enum, section='fields')}$
<code>
enum {
<!--(for field in enum.enum_fields)-->
- ${field.name}$: ${field.value.serialize}$,
+ ${field.name}$: ${field.value.serialize}$
<!--(end)-->
}
</code>
@@ -35,5 +35,5 @@ typedef enum {
<!--(for field in enum.enum_fields)-->
${field.c_name}$ = ${field.value.serialize}$,
<!--(end)-->
-} ${enum.full_name.replace('.', '_')}$;
+} ${enum.name.replace('.', '_')}$;
</code>
diff --git a/src/scripts/gendoc/doc_macros.include b/src/scripts/gendoc/doc_macros.include
index 577052ef64..1e62a2b62e 100644
--- a/src/scripts/gendoc/doc_macros.include
+++ b/src/scripts/gendoc/doc_macros.include
@@ -125,7 +125,7 @@ interface#!
<!--(for n in cls.namespaces)-->
:${n.lower()}$#!
<!--(end)-->
-:${cls.name.lower()}$|${cls.full_name}$]]
+:${cls.short_name.lower()}$|${cls.name}$]]
<!--(end)-->
#!##############################################################################
#!#### EVENT_LINK(cls, ev) ###################################################
@@ -135,9 +135,9 @@ interface#!
<!--(for n in cls.namespaces)-->
:${n.lower()}$#!
<!--(end)-->
-:${cls.name.lower()}$#!
+:${cls.short_name.lower()}$#!
:event#!
-:${ev.name.lower().replace(',','_')}$|${ev.name}$]]
+:${ev.short_name.lower().replace(',','_')}$|${ev.name}$]]
<!--(end)-->
#!##############################################################################
#!#### TYPEDECL_LINK(typedecl) ###############################################
@@ -147,7 +147,7 @@ interface#!
<!--(for n in typedecl.namespaces)-->
:${n.lower()}$#!
<!--(end)-->
-:${typedecl.name.lower()}$|${typedecl.full_name}$]]
+:${typedecl.short_name.lower()}$|${typedecl.name}$]]
<!--(end)-->
#!##############################################################################
#!#### TYPE_LINK(type) #######################################################
@@ -157,7 +157,7 @@ interface#!
<!--(for n in type.namespaces)-->
:${n.lower()}$#!
<!--(end)-->
-:${type.name.lower()}$|${type.full_name}$]]
+:${type.short_name.lower()}$|${type.name}$]]
<!--(end)-->
#!##############################################################################
#!#### FUNC_LINK(func) #######################################################
@@ -172,7 +172,7 @@ interface#!
<!--(else)-->
:property#!
<!--(end)-->
-:${func.name}$|${func.name}$]]
+:${func.short_name}$|${func.short_name}$]]
<!--(end)-->
#!##############################################################################
#!#### FUNC_SCOPE(func) ######################################################
@@ -253,7 +253,7 @@ interface#!
<!--(if i == 0)-->
^ parameters ^ type ^ description ^
<!--(end)-->
-|${PARAM_DIRECTION_TAG(param=par)}$ **${par.name}$**|${par.type.full_name}$ #!
+|${PARAM_DIRECTION_TAG(param=par)}$ **${par.name}$**|${par.type.name}$ #!
|${BEST_SUMMARY(obj=par)}$ ${BEST_DESCRIPTION(obj=par)}$|
<!--(else)-->
**This function do not accept any parameter.**
@@ -262,7 +262,7 @@ interface#!
<!--(if func.method_return_type)-->
${setvar("obj", "func.return_documentation(Eolian_Function_Type.METHOD)")}$#!
^ return ^ description ^
-|**${func.method_return_type.full_name}$**|${BEST_SUMMARY(obj=obj)}$ ${BEST_DESCRIPTION(obj=obj)}$|
+|**${func.method_return_type.name}$**|${BEST_SUMMARY(obj=obj)}$ ${BEST_DESCRIPTION(obj=obj)}$|
<!--(else)-->
**This function do not return anything.**
<!--(end)-->
@@ -277,14 +277,14 @@ ${setvar("obj", "func.return_documentation(Eolian_Function_Type.METHOD)")}$#!
<!--(if i == 0)-->
^ values ^ type ^ description ^
<!--(end)-->
-|**${val.name}$**|${val.type.full_name}$|${BEST_SUMMARY(obj=val)}$|
+|**${val.name}$**|${val.type.name}$|${BEST_SUMMARY(obj=val)}$|
<!--(end)-->
<!--(for i, key in enumerate(func.getter_keys or func.setter_keys))-->
<!--(if i == 0)-->
^ keys ^ type ^ description ^
<!--(end)-->
-|**${key.name}$**|${key.type.full_name}$|${BEST_SUMMARY(obj=key)}$|
+|**${key.name}$**|${key.type.name}$|${BEST_SUMMARY(obj=key)}$|
<!--(end)-->
<!--(end)-->
@@ -296,19 +296,19 @@ ${setvar("obj", "func.return_documentation(Eolian_Function_Type.METHOD)")}$#!
(#!
<!--(if impl.is_property)-->
<!--(for i, val in enumerate(impl.function.getter_values or impl.function.setter_values))-->
-${', ' if i else ''}$${val.type.name}$#!
+${', ' if i else ''}$${val.type.short_name}$#!
<!--(end)-->
<!--(elif impl.is_method)-->
<!--(for i, param in enumerate(impl.function.parameters))-->
${', ' if i else ''}$#!
-//${param.type.name}$// ''${param.direction.name.lower()}$'' **${param.name}$**#!
+//${param.type.short_name}$// ''${param.direction.name.lower()}$'' **${param.short_name}$**#!
<!--(end)-->
<!--(end)-->
) #!
${IMPLEMENT_TAGS}$ #!
<!--(if impl.is_method)-->
<!--(if impl.function.method_return_type)-->
- => //${impl.function.method_return_type.name}$// #!
+ => //${impl.function.method_return_type.short_name}$// #!
<!--(else)-->
=> //None// #!
<!--(end)-->
diff --git a/src/scripts/gendoc/doc_start.template b/src/scripts/gendoc/doc_start.template
index 640f805d9d..57526ca51f 100644
--- a/src/scripts/gendoc/doc_start.template
+++ b/src/scripts/gendoc/doc_start.template
@@ -2,51 +2,64 @@
~~Title: EFL Reference~~
{{page>:develop:api-include:reference:general&nouser&nolink&nodate}}
+====== Python-EFL documentation preview ======
+This is just a work in progress for the future development of the
+Python-EFL Unified API.
+
+Pratically there is nothing python related currently in this documentation,
+so it can be considered valid for all languages.
+
+
<!--(for ns in nspaces)-->
- <!--(if ns.name.startswith('Efl'))-->
-===== ${ns.name}$ =====
+===== ${ns.name}$ (namespace) =====
- <!--(for i, cls in enumerate(ns.regulars))-->
- <!--(if i == 0)-->
-^ Classes ^^
- <!--(end)-->
-| ${CLS_LINK}$ | ${BEST_SUMMARY(obj=cls)}$ |
+ <!--(for i, cls in enumerate(sorted(ns.regulars)))-->
+ <!--(if i == 0)-->
+^ Regular Classes ^^
<!--(end)-->
-#!
- <!--(for i, cls in enumerate(ns.interfaces))-->
- <!--(if i == 0)-->
-^ Interfaces ^^
- <!--(end)-->
| ${CLS_LINK}$ | ${BEST_SUMMARY(obj=cls)}$ |
+ <!--(end)-->
+#!
+ <!--(for i, cls in enumerate(sorted(ns.abstracts)))-->
+ <!--(if i == 0)-->
+^ Abstract Classes ^^
<!--(end)-->
+| ${CLS_LINK}$ | ${BEST_SUMMARY(obj=cls)}$ |
+ <!--(end)-->
#!
- <!--(for i, cls in enumerate(ns.mixins))-->
- <!--(if i == 0)-->
+ <!--(for i, cls in enumerate(sorted(ns.mixins)))-->
+ <!--(if i == 0)-->
^ Mixins ^^
- <!--(end)-->
+ <!--(end)-->
| ${CLS_LINK}$ | ${BEST_SUMMARY(obj=cls)}$ |
+ <!--(end)-->
+#!
+ <!--(for i, cls in enumerate(sorted(ns.interfaces)))-->
+ <!--(if i == 0)-->
+^ Interfaces ^^
<!--(end)-->
+| ${CLS_LINK}$ | ${BEST_SUMMARY(obj=cls)}$ |
+ <!--(end)-->
#!
- <!--(for i, typedecl in enumerate(ns.aliases))-->
- <!--(if i == 0)-->
+ <!--(for i, typedecl in enumerate(sorted(ns.aliases)))-->
+ <!--(if i == 0)-->
^ Aliases ^^
- <!--(end)-->
-| ${TYPEDECL_LINK}$ | ${BEST_SUMMARY(obj=typedecl)}$ |
<!--(end)-->
+| ${TYPEDECL_LINK}$ | ${BEST_SUMMARY(obj=typedecl)}$ |
+ <!--(end)-->
#!
- <!--(for i, typedecl in enumerate(ns.structs))-->
- <!--(if i == 0)-->
+ <!--(for i, typedecl in enumerate(sorted(ns.structs)))-->
+ <!--(if i == 0)-->
^ Structures ^^
- <!--(end)-->
-| ${TYPEDECL_LINK}$ | ${BEST_SUMMARY(obj=typedecl)}$ |
<!--(end)-->
+| ${TYPEDECL_LINK}$ | ${BEST_SUMMARY(obj=typedecl)}$ |
+ <!--(end)-->
#!
- <!--(for i, typedecl in enumerate(ns.enums))-->
- <!--(if i == 0)-->
+ <!--(for i, typedecl in enumerate(sorted(ns.enums)))-->
+ <!--(if i == 0)-->
^ Enumerations ^^
- <!--(end)-->
-| ${TYPEDECL_LINK}$ | ${BEST_SUMMARY(obj=typedecl)}$ |
<!--(end)-->
-
+| ${TYPEDECL_LINK}$ | ${BEST_SUMMARY(obj=typedecl)}$ |
<!--(end)-->
+
<!--(end)-->
diff --git a/src/scripts/gendoc/doc_struct.template b/src/scripts/gendoc/doc_struct.template
index 370e9be6e9..306dcfd961 100644
--- a/src/scripts/gendoc/doc_struct.template
+++ b/src/scripts/gendoc/doc_struct.template
@@ -1,6 +1,6 @@
<!--(include)-->doc_macros.include<!--(end)-->#!
-~~Title: ${struct.full_name}$~~
-====== ${struct.full_name}$ (struct) ======
+~~Title: ${struct.name}$~~
+====== ${struct.name}$ (struct) ======
${BEST_SUMMARY(obj=struct)}$
@@ -21,7 +21,7 @@ ${OBJECT_STATIC_CONTENT(obj=struct, section='fields')}$
===== Signature =====
<code>
-struct ${struct.full_name}$ {
+struct ${struct.name}$ {
<!--(for field in struct.struct_fields)-->
${field.name}$: ${field.type.name}$,
<!--(end)-->
@@ -31,9 +31,9 @@ struct ${struct.full_name}$ {
===== C Signature =====
<code>
-typedef struct _${struct.full_name.replace('.', '_')}$ {
+typedef struct _${struct.name.replace('.', '_')}$ {
<!--(for field in struct.struct_fields)-->
${field.name}$: **TODO (issue with Typedecl.c_type need Unit)**,
<!--(end)-->
-} ${struct.full_name.replace('.', '_')}$;
+} ${struct.name.replace('.', '_')}$;
</code>
diff --git a/src/scripts/gendoc/gendoc.py b/src/scripts/gendoc/gendoc.py
index 394c641f44..2ebaa605d4 100755
--- a/src/scripts/gendoc/gendoc.py
+++ b/src/scripts/gendoc/gendoc.py
@@ -41,16 +41,16 @@ _choices = ['start', 'classes', 'enums', 'structs', 'aliases']
parser.add_argument('--step', '-s', metavar='STEP', default=None,
choices=_choices,
help='A single step to run (default to all), '
- 'valid choises: '+ ', '.join(_choices))
+ 'valid choices: '+ ', '.join(_choices))
args = parser.parse_args()
# load the whole eolian db (from .eo files in source tree)
-eolian_db = eolian.Eolian()
-if not isinstance(eolian_db, eolian.Eolian):
+eolian_db = eolian.Eolian_State()
+if not isinstance(eolian_db, eolian.Eolian_State):
raise(RuntimeError('Eolian, failed to create Eolian state'))
-if not eolian_db.directory_scan(SCAN_FOLDER):
+if not eolian_db.directory_add(SCAN_FOLDER):
raise(RuntimeError('Eolian, failed to scan source directory'))
if not eolian_db.all_eot_files_parse():
@@ -72,44 +72,90 @@ def page_path_for_object(obj):
path = ['data', 'pages', 'develop', 'api']
for ns in obj.namespaces:
path.append(ns.lower())
- output_file = obj.name.lower() + '.txt'
+ output_file = obj.short_name.lower() + '.txt'
return os.path.join(args.root_path, *path, output_file)
+# render a (temporary) page for analizying the namespaces hierarchy
+t = Template('namespaces.template')
+nspaces = [ ns for ns in eolian_db.all_namespaces
+ if ns.name.startswith(args.namespace) ]
+
+tot_classes = tot_regulars = tot_abstracts = tot_mixins = tot_ifaces = 0
+tot_enums = tot_structs = tot_aliases = 0
+for ns in nspaces:
+ for cls in ns.classes:
+ tot_classes += 1
+ if cls.type == eolian.Eolian_Class_Type.REGULAR:
+ tot_regulars += 1
+ elif cls.type == eolian.Eolian_Class_Type.ABSTRACT:
+ tot_abstracts += 1
+ elif cls.type == eolian.Eolian_Class_Type.MIXIN:
+ tot_mixins += 1
+ elif cls.type == eolian.Eolian_Class_Type.INTERFACE:
+ tot_ifaces += 1
+ tot_enums += len(ns.enums)
+ tot_structs += len(ns.structs)
+ tot_aliases += len(ns.aliases)
+
+
+totals = [
+ ('Namespaces', len(nspaces)),
+ ('ALL Classes', tot_classes),
+ ('Regular classes', tot_regulars),
+ ('Abstract classes', tot_abstracts),
+ ('Mixins', tot_mixins),
+ ('Interfaces', tot_ifaces),
+ ('Enums', tot_enums),
+ ('Structs', tot_structs),
+ ('Aliases', tot_aliases),
+]
+
+root_ns = eolian_db.namespace_get_by_name(args.namespace)
+
+output_file = os.path.join(args.root_path,'data','pages','develop','api','namespaces.txt')
+t.render(output_file, args.verbose, root_ns=root_ns, totals=totals)
+
+
# render the main start.txt page
if args.step in ('start', None):
t = Template('doc_start.template')
+
+ nspaces = [ ns for ns in eolian_db.all_namespaces
+ if ns.name.startswith(args.namespace) ]
+
output_file = os.path.join(args.root_path,'data','pages','develop','api','start.txt')
- t.render(output_file, args.verbose, nspaces=eolian_db.all_namespaces)
+ t.render(output_file, args.verbose, nspaces=nspaces)
+
# render a page for each Class
if args.step in ('classes', None):
t = Template('doc_class.template')
- for cls in eolian_db.all_classes:
- if cls.full_name.startswith(args.namespace):
+ for cls in eolian_db.classes:
+ if cls.name.startswith(args.namespace):
output_file = page_path_for_object(cls)
- t.render(output_file, args.verbose, cls=cls.full_name)
+ t.render(output_file, args.verbose, cls=cls.name)
# render a page for each Enum
if args.step in ('enums', None):
t = Template('doc_enum.template')
- for enum in eolian_db.typedecl_all_enums:
- if enum.full_name.startswith(args.namespace):
+ for enum in eolian_db.enums:
+ if enum.name.startswith(args.namespace):
output_file = page_path_for_object(enum)
- t.render(output_file, args.verbose, enum=enum.full_name)
+ t.render(output_file, args.verbose, enum=enum.name)
# render a page for each Struct
if args.step in ('structs', None):
t = Template('doc_struct.template')
- for struct in eolian_db.typedecl_all_structs:
- if struct.full_name.startswith(args.namespace):
+ for struct in eolian_db.structs:
+ if struct.name.startswith(args.namespace):
output_file = page_path_for_object(struct)
- t.render(output_file, args.verbose, struct=struct.full_name)
+ t.render(output_file, args.verbose, struct=struct.name)
# render a page for each Alias
if args.step in ('aliases', None):
t = Template('doc_alias.template')
- for alias in eolian_db.typedecl_all_aliases:
- if alias.full_name.startswith(args.namespace):
+ for alias in eolian_db.aliases:
+ if alias.name.startswith(args.namespace):
output_file = page_path_for_object(alias)
- t.render(output_file, args.verbose, alias=alias.full_name)
+ t.render(output_file, args.verbose, alias=alias.name)
diff --git a/src/scripts/gendoc/namespaces.template b/src/scripts/gendoc/namespaces.template
new file mode 100644
index 0000000000..d373025d56
--- /dev/null
+++ b/src/scripts/gendoc/namespaces.template
@@ -0,0 +1,83 @@
+~~Title: EFL Namespaces~~
+
+#!##############################################################################
+#!#### CLS_LINK(cls) #########################################################
+#!##############################################################################
+<!--(macro CLS_LINK)-->
+[[:develop:api#!
+ <!--(for n in cls.namespaces)-->
+:${n.lower()}$#!
+ <!--(end)-->
+:${cls.short_name.lower()}$|${cls.short_name}$]]
+<!--(end)-->
+
+#!##############################################################################
+#!#### TYPEDECL_LINK(typedecl) ###############################################
+#!##############################################################################
+<!--(macro TYPEDECL_LINK)-->
+[[:develop:api#!
+ <!--(for n in typedecl.namespaces)-->
+:${n.lower()}$#!
+ <!--(end)-->
+:${typedecl.short_name.lower()}$|${typedecl.short_name}$]]
+<!--(end)-->
+
+#!##############################################################################
+#!#### NAMESPACE_ITEM(ns) ####################################################
+#!##############################################################################
+<!--(macro NAMESPACE_ITEM)-->
+**${ns.name}$** #!
+ <!--(if len(ns.regulars))-->
+ \\ Classes: <!--(for cls in ns.regulars)--> ${CLS_LINK(cls=cls)}$, <!--(end)--> #!
+ <!--(end)-->
+ <!--(if len(ns.abstracts))-->
+ \\ Abstracts: <!--(for cls in ns.abstracts)--> ${CLS_LINK(cls=cls)}$, <!--(end)--> #!
+ <!--(end)-->
+ <!--(if len(ns.mixins))-->
+ \\ Mixins: <!--(for cls in ns.mixins)--> ${CLS_LINK(cls=cls)}$, <!--(end)--> #!
+ <!--(end)-->
+ <!--(if len(ns.interfaces))-->
+ \\ Interfaces: <!--(for cls in ns.interfaces)--> ${CLS_LINK(cls=cls)}$, <!--(end)--> #!
+ <!--(end)-->
+ <!--(if len(ns.structs))-->
+ \\ Structs: <!--(for struct in ns.structs)--> ${TYPEDECL_LINK(typedecl=struct)}$, <!--(end)--> #!
+ <!--(end)-->
+ <!--(if len(ns.enums))-->
+ \\ Enums: <!--(for enum in ns.enums)--> ${TYPEDECL_LINK(typedecl=enum)}$, <!--(end)--> #!
+ <!--(end)-->
+ <!--(if len(ns.aliases))-->
+ \\ Aliases: <!--(for alias in ns.aliases)--> ${TYPEDECL_LINK(typedecl=alias)}$, <!--(end)--> #!
+ <!--(end)-->
+<!--(end)-->
+
+
+====== Unified-API namespaces hierarchy ======
+This page is just a temporary work to analyze the namespaces in the new API
+
+
+^** Some numbers just for information **^^
+<!--(for label, val in totals)-->
+| ${label}$ | **${val}$** |
+<!--(end)-->
+
+
+
+===== Namespaces hierarchy =====
+
+
+ * ${NAMESPACE_ITEM(ns=root_ns)}$
+<!--(for sub in root_ns.sub_namespaces)-->
+ * ${NAMESPACE_ITEM(ns=sub)}$
+ <!--(for sub in sub.sub_namespaces)-->
+ * ${NAMESPACE_ITEM(ns=sub)}$
+ <!--(for sub in sub.sub_namespaces)-->
+ * ${NAMESPACE_ITEM(ns=sub)}$
+ <!--(for sub in sub.sub_namespaces)-->
+ * ${NAMESPACE_ITEM(ns=sub)}$
+ <!--(end)-->
+ <!--(end)-->
+ <!--(end)-->
+<!--(end)-->
+
+
+
diff --git a/src/scripts/pyolian/README.md b/src/scripts/pyolian/README.md
index 61bf0dc52d..9ec4f20b82 100644
--- a/src/scripts/pyolian/README.md
+++ b/src/scripts/pyolian/README.md
@@ -25,6 +25,10 @@ tree, usually at efl compilation time (before the install step).
The only requirement is that **the source tree must be already built** (not
installed) because pyolian search the eolian .so/.dll inside the source tree.
+If you built the efl tree in a custom location (fe, you build out-of-tree) you
+can tell pyolian where to find the built eolian .so files using the
+`EOLIAN_SO_DIR` environment variable.
+
Command line usage
==================
@@ -358,7 +362,7 @@ defined as follows:
sometimes it is useful or necessary to set variables in the template.
Can also be used to capture the output of e.g. an evaluated macro.
-Moreover all the Eolian classes and enums (as defined in eolian.py) is available
+Moreover all the Eolian classes and enums (as defined in eolian.py) are available
in the template, fe:
* `Function` eolian.Function (class)
diff --git a/src/scripts/pyolian/eolian.py b/src/scripts/pyolian/eolian.py
index c15f167433..556f47720d 100644
--- a/src/scripts/pyolian/eolian.py
+++ b/src/scripts/pyolian/eolian.py
@@ -207,14 +207,6 @@ class Eolian_Unary_Operator(IntEnum):
NOT = 3 # ! int, float, bool
BNOT = 4 # ~ int
-class Eolian_Declaration_Type(IntEnum):
- UNKNOWN = 0
- CLASS = 1
- ALIAS = 2
- STRUCT = 3
- ENUM = 4
- VAR = 5
-
class Eolian_Doc_Token_Type(IntEnum):
UNKNOWN = 0
TEXT = 1
@@ -225,18 +217,6 @@ class Eolian_Doc_Token_Type(IntEnum):
MARK_TODO = 6
MARKUP_MONOSPACE = 7
-class Eolian_Doc_Ref_Type(IntEnum):
- INVALID = 0
- CLASS = 1
- FUNC = 2
- EVENT = 3
- ALIAS = 4
- STRUCT = 5
- STRUCT_FIELD = 6
- ENUM = 7
- ENUM_FIELD = 8
- VAR = 9
-
### internal Classes ########################################################
@@ -283,7 +263,7 @@ class EolianBaseObject(object):
if c_obj_pointer is None:
return super().__new__(cls)
- # cache based on the c pointer value (assume the eolian db is stabe)
+ # cache based on the c pointer value (assume the eolian db is stable)
if isinstance(c_obj_pointer, c_void_p):
key = c_obj_pointer.value
elif isinstance(c_obj_pointer, int):
@@ -312,160 +292,202 @@ class EolianBaseObject(object):
if isinstance(other, EolianBaseObject):
return self._obj.value == other._obj.value
elif isinstance(other, str):
- if hasattr(self, 'full_name'):
- return self.full_name == other
- elif hasattr(self, 'name'):
+ if hasattr(self, 'name'):
return self.name == other
+ elif hasattr(self, 'short_name'):
+ return self.short_name == other
return False
+ def __gt__(self, other):
+ if isinstance(other, EolianBaseObject):
+ if hasattr(self, 'name'):
+ return self.name > other.name
+ elif hasattr(self, 'short_name'):
+ return self.short_name > other.short_name
+
def __hash__(self):
return self._obj.value
+ @property
+ def _as_parameter_(self):
+ """ Used by ctypes to convert instances when calling C functions """
+ return self._obj
+
### Main Eolian Unit ########################################################
class Eolian_Unit(EolianBaseObject):
- def class_get_by_name(self, class_name):
- c_cls = lib.eolian_class_get_by_name(self._obj, _str_to_bytes(class_name))
- return Class(c_cls) if c_cls else None
-
- def class_get_by_file(self, file_name):
- c_cls = lib.eolian_class_get_by_file(self._obj, _str_to_bytes(file_name))
- return Class(c_cls) if c_cls else None
+ def __repr__(self):
+ return "<eolian.Eolian_Unit '{0.file}'>".format(self)
@property
- def all_classes(self):
- return Iterator(Class, lib.eolian_all_classes_get(self._obj))
+ def children(self):
+ return Iterator(Eolian_Unit, lib.eolian_unit_children_get(self))
- @property
- def all_namespaces(self):
- # TODO find a better way to find namespaces (maybe inside eolian?)
- nspaces = set()
- for obj in self.all_classes:
- nspaces.add(Namespace(self, obj.namespace))
- for obj in self.typedecl_all_aliases:
- nspaces.add(Namespace(self, obj.namespace))
- for obj in self.typedecl_all_structs:
- nspaces.add(Namespace(self, obj.namespace))
- for obj in self.typedecl_all_enums:
- nspaces.add(Namespace(self, obj.namespace))
- return sorted(nspaces)
+ @cached_property
+ def file(self):
+ return _str_to_py(lib.eolian_unit_file_get(self))
- def namespace_get_by_name(self, name):
- return Namespace(self, name)
+ @cached_property
+ def state(self):
+ c_state = lib.eolian_unit_state_get(self)
+ return Eolian_State(c_state) if c_state else None
@property
- def typedecl_all_enums(self):
- return Iterator(Typedecl, lib.eolian_typedecl_all_enums_get(self._obj))
+ def objects(self):
+ return Iterator(Object, lib.eolian_unit_objects_get(self))
- def typedecl_enum_get_by_name(self, name):
- c_tdecl = lib.eolian_typedecl_enum_get_by_name(self._obj, _str_to_bytes(name))
- return Typedecl(c_tdecl) if c_tdecl else None
+ def object_by_name_get(self, name):
+ c_obj = lib.eolian_unit_object_by_name_get(self, _str_to_bytes(name))
+ return Object(c_obj) if c_obj else None
- def typedecl_enums_get_by_file(self, fname):
- return Iterator(Typedecl,
- lib.eolian_typedecl_enums_get_by_file(self._obj, _str_to_bytes(fname)))
+ @property
+ def classes(self):
+ return Iterator(Class, lib.eolian_unit_classes_get(self))
+
+ def class_by_name_get(self, class_name):
+ c_cls = lib.eolian_unit_class_by_name_get(self, _str_to_bytes(class_name))
+ return Class(c_cls) if c_cls else None
@property
- def typedecl_all_structs(self):
- return Iterator(Typedecl, lib.eolian_typedecl_all_structs_get(self._obj))
+ def constants(self):
+ return Iterator(Variable, lib.eolian_unit_constants_get(self))
- def typedecl_struct_get_by_name(self, name):
- c_tdecl = lib.eolian_typedecl_struct_get_by_name(self._obj, _str_to_bytes(name))
- return Typedecl(c_tdecl) if c_tdecl else None
+ def constant_by_name_get(self, name):
+ c_var = lib.eolian_unit_constant_by_name_get(self, _str_to_bytes(name))
+ return Variable(c_var) if c_var else None
- def typedecl_structs_get_by_file(self, fname):
- return Iterator(Typedecl,
- lib.eolian_typedecl_structs_get_by_file(self._obj, _str_to_bytes(fname)))
+ @property
+ def globals(self):
+ return Iterator(Variable, lib.eolian_unit_globals_get(self))
+
+ def global_by_name_get(self, name):
+ c_var = lib.eolian_unit_global_by_name_get(self, _str_to_bytes(name))
+ return Variable(c_var) if c_var else None
@property
- def typedecl_all_aliases(self):
- return Iterator(Typedecl, lib.eolian_typedecl_all_aliases_get(self._obj))
+ def enums(self):
+ return Iterator(Typedecl, lib.eolian_unit_enums_get(self))
- def typedecl_alias_get_by_name(self, name):
- c_tdecl = lib.eolian_typedecl_alias_get_by_name(self._obj, _str_to_bytes(name))
+ def enum_by_name_get(self, name):
+ c_tdecl = lib.eolian_unit_enum_by_name_get(self, _str_to_bytes(name))
return Typedecl(c_tdecl) if c_tdecl else None
- def typedecl_aliases_get_by_file(self, fname):
- return Iterator(Typedecl,
- lib.eolian_typedecl_aliases_get_by_file(self._obj, _str_to_bytes(fname)))
-
@property
- def variable_all_constants(self):
- return Iterator(Variable, lib.eolian_variable_all_constants_get(self._obj))
-
- def variable_constant_get_by_name(self, name):
- c_var = lib.eolian_variable_constant_get_by_name(self._obj, _str_to_bytes(name))
- return Variable(c_var) if c_var else None
+ def structs(self):
+ return Iterator(Typedecl, lib.eolian_unit_structs_get(self))
- def variable_constants_get_by_file(self, fname):
- return Iterator(Variable,
- lib.eolian_variable_constants_get_by_file(self._obj, _str_to_bytes(fname)))
+ def struct_by_name_get(self, name):
+ c_tdecl = lib.eolian_unit_struct_by_name_get(self, _str_to_bytes(name))
+ return Typedecl(c_tdecl) if c_tdecl else None
@property
- def variable_all_globals(self):
- return Iterator(Variable, lib.eolian_variable_all_globals_get(self._obj))
+ def aliases(self):
+ return Iterator(Typedecl, lib.eolian_unit_aliases_get(self))
- def variable_global_get_by_name(self, name):
- c_var = lib.eolian_variable_global_get_by_name(self._obj, _str_to_bytes(name))
- return Variable(c_var) if c_var else None
+ def alias_by_name_get(self, name):
+ c_tdecl = lib.eolian_unit_alias_by_name_get(self, _str_to_bytes(name))
+ return Typedecl(c_tdecl) if c_tdecl else None
- def variable_globals_get_by_file(self, fname):
- return Iterator(Variable,
- lib.eolian_variable_globals_get_by_file(self._obj, _str_to_bytes(fname)))
@property
- def all_declarations(self):
- return Iterator(Declaration, lib.eolian_all_declarations_get(self._obj))
-
- def declaration_get_by_name(self, name):
- c_decl = lib.eolian_declaration_get_by_name(self._obj, _str_to_bytes(name))
- return Declaration(c_decl) if c_decl else None
+ def all_namespaces(self):
+ # TODO find a better way to find namespaces (maybe inside eolian?)
+ nspaces = set()
+ for obj in self.classes:
+ nspaces.add(Namespace(self, obj.namespace))
+ for obj in self.aliases:
+ nspaces.add(Namespace(self, obj.namespace))
+ for obj in self.structs:
+ nspaces.add(Namespace(self, obj.namespace))
+ for obj in self.enums:
+ nspaces.add(Namespace(self, obj.namespace))
+ return sorted(nspaces)
- def declarations_get_by_file(self, fname):
- return Iterator(Declaration,
- lib.eolian_declarations_get_by_file(self._obj, _str_to_bytes(fname)))
+ def namespace_get_by_name(self, name):
+ return Namespace(self, name)
-class Eolian(Eolian_Unit):
- def __init__(self):
- self._obj = lib.eolian_new() # Eolian *
+class Eolian_State(Eolian_Unit):
+ def __init__(self, c_state=None):
+ if c_state is None:
+ c_state = lib.eolian_state_new() # Eolian_State *
+ EolianBaseObject.__init__(self, c_state)
def __del__(self):
if not _already_halted: # do not free after eolian_shutdown
- lib.eolian_free(self._obj)
+ lib.eolian_state_free(self)
+
+ def __repr__(self):
+ return "<eolian.Eolian_State, %d units loaded>" % len(list(self.units))
def file_parse(self, filepath):
- c_unit = lib.eolian_file_parse(self._obj, _str_to_bytes(filepath))
+ c_unit = lib.eolian_state_file_parse(self, _str_to_bytes(filepath))
return Eolian_Unit(c_unit) if c_unit else None
@property
- def all_eo_file_paths(self):
- return Iterator(_str_to_py, lib.eolian_all_eo_file_paths_get(self._obj))
+ def eo_file_paths(self):
+ return Iterator(_str_to_py, lib.eolian_state_eo_file_paths_get(self))
@property
- def all_eot_file_paths(self):
- return Iterator(_str_to_py, lib.eolian_all_eot_file_paths_get(self._obj))
+ def eot_file_paths(self):
+ return Iterator(_str_to_py, lib.eolian_state_eot_file_paths_get(self))
@property
- def all_eo_files(self):
- return Iterator(_str_to_py, lib.eolian_all_eo_files_get(self._obj))
+ def eo_files(self):
+ return Iterator(_str_to_py, lib.eolian_state_eo_files_get(self))
@property
- def all_eot_files(self):
- return Iterator(_str_to_py, lib.eolian_all_eot_files_get(self._obj))
+ def eot_files(self):
+ return Iterator(_str_to_py, lib.eolian_state_eot_files_get(self))
- def directory_scan(self, dir_path):
- return bool(lib.eolian_directory_scan(self._obj, _str_to_bytes(dir_path)))
+ def directory_add(self, dir_path):
+ return bool(lib.eolian_state_directory_add(self, _str_to_bytes(dir_path)))
- def system_directory_scan(self):
- return bool(lib.eolian_system_directory_scan(self._obj))
+ def system_directory_add(self):
+ return bool(lib.eolian_state_system_directory_add(self))
def all_eo_files_parse(self):
- return bool(lib.eolian_all_eo_files_parse(self._obj))
+ return bool(lib.eolian_state_all_eo_files_parse(self))
def all_eot_files_parse(self):
- return bool(lib.eolian_all_eot_files_parse(self._obj))
+ return bool(lib.eolian_state_all_eot_files_parse(self))
+
+ def unit_by_file_get(self, file_name):
+ c_unit = lib.eolian_state_unit_by_file_get(self, _str_to_bytes(file_name))
+ return Eolian_Unit(c_unit) if c_unit else None
+
+ @property
+ def units(self):
+ return Iterator(Eolian_Unit, lib.eolian_state_units_get(self))
+
+ def objects_by_file_get(self, file_name):
+ return Iterator(Object,
+ lib.eolian_state_objects_by_file_get(self, _str_to_bytes(file_name)))
+
+ def class_by_file_get(self, file_name):
+ c_cls = lib.eolian_state_class_by_file_get(self, _str_to_bytes(file_name))
+ return Class(c_cls) if c_cls else None
+
+ def constants_by_file_get(self, file_name):
+ return Iterator(Variable,
+ lib.eolian_state_constants_by_file_get(self, _str_to_bytes(file_name)))
+
+ def globals_by_file_get(self, file_name):
+ return Iterator(Variable,
+ lib.eolian_state_globals_by_file_get(self, _str_to_bytes(file_name)))
+
+ def aliases_by_file_get(self, file_name):
+ return Iterator(Typedecl,
+ lib.eolian_state_aliases_by_file_get(self, _str_to_bytes(file_name)))
+
+ def structs_by_file_get(self, file_name):
+ return Iterator(Typedecl,
+ lib.eolian_state_structs_by_file_get(self, _str_to_bytes(file_name)))
+
+ def enums_by_file_get(self, file_name):
+ return Iterator(Typedecl,
+ lib.eolian_state_enums_by_file_get(self, _str_to_bytes(file_name)))
### Namespace Utility Class #################################################
@@ -479,7 +501,11 @@ class Namespace(object):
return "<eolian.Namespace '{0._name}'>".format(self)
def __eq__(self, other):
- return self.name == other.name
+ if isinstance(other, Namespace):
+ return self.name == other.name
+ if isinstance(other, str):
+ return self.name == other
+ raise TypeError('Namespace can only compare with Namespace or str')
def __lt__(self, other):
return self.name < other.name
@@ -499,120 +525,170 @@ class Namespace(object):
return self._name.split('.')
@property
+ def sub_namespaces(self):
+ base = self._name + '.'
+ deep = self._name.count('.') + 1
+ return [ ns for ns in self._unit.all_namespaces
+ if ns.name.startswith(base) and ns.name.count('.') == deep ]
+
+
+ @property
def classes(self):
- return [ c for c in self._unit.all_classes
- if c.namespace == self._name ]
+ return sorted([ c for c in self._unit.classes
+ if c.namespace == self._name ])
@property
def regulars(self):
- return [ c for c in self._unit.all_classes
- if c.type == Eolian_Class_Type.REGULAR and
- c.namespace == self._name]
+ return sorted([ c for c in self._unit.classes
+ if c.type == Eolian_Class_Type.REGULAR and
+ c.namespace == self._name])
+
+ @property
+ def abstracts(self):
+ return sorted([ c for c in self._unit.classes
+ if c.type == Eolian_Class_Type.ABSTRACT and
+ c.namespace == self._name])
@property
def mixins(self):
- return [ c for c in self._unit.all_classes
- if c.type == Eolian_Class_Type.MIXIN and
- c.namespace == self._name]
+ return sorted([ c for c in self._unit.classes
+ if c.type == Eolian_Class_Type.MIXIN and
+ c.namespace == self._name])
@property
def interfaces(self):
- return [ c for c in self._unit.all_classes
- if c.type == Eolian_Class_Type.INTERFACE and
- c.namespace == self._name]
+ return sorted([ c for c in self._unit.classes
+ if c.type == Eolian_Class_Type.INTERFACE and
+ c.namespace == self._name])
@property
def aliases(self):
- return [ td for td in self._unit.typedecl_all_aliases
- if td.namespace == self._name]
+ return sorted([ td for td in self._unit.aliases
+ if td.namespace == self._name])
@property
def structs(self):
- return [ td for td in self._unit.typedecl_all_structs
- if td.namespace == self._name]
+ return sorted([ td for td in self._unit.structs
+ if td.namespace == self._name])
@property
def enums(self):
- return [ td for td in self._unit.typedecl_all_enums
- if td.namespace == self._name]
+ return sorted([ td for td in self._unit.enums
+ if td.namespace == self._name])
### Eolian Classes ##########################################################
-class Class(EolianBaseObject):
+class Object(EolianBaseObject):
+ def __new__(cls, c_obj_pointer):
+ if cls is Object:
+ c_type = lib.eolian_object_type_get(c_obj_pointer)
+ cls = _eolian_type_class_mapping[c_type]
+ return super().__new__(cls)
+
def __repr__(self):
- return "<eolian.Class '{0.full_name}', {0.type!s}>".format(self)
+ return "<eolian.Object '{0.name}', {0.type!s}>".format(self)
+
+ @cached_property
+ def unit(self):
+ c_unit = lib.eolian_object_unit_get(self)
+ return Eolian_Unit(c_unit) if c_unit else None
@cached_property
def name(self):
- return _str_to_py(lib.eolian_class_name_get(self._obj))
+ return _str_to_py(lib.eolian_object_name_get(self))
+
+ @cached_property
+ def short_name(self):
+ return _str_to_py(lib.eolian_object_short_name_get(self))
+
+ @property
+ def namespaces(self):
+ return Iterator(_str_to_py, lib.eolian_object_namespaces_get(self))
+
+ @cached_property
+ def namespace(self):
+ return '.'.join(self.namespaces)
@cached_property
- def full_name(self):
- return _str_to_py(lib.eolian_class_full_name_get(self._obj))
+ def file(self):
+ return _str_to_py(lib.eolian_object_file_get(self))
+
+ @cached_property
+ def line(self):
+ return int(lib.eolian_object_line_get(self))
+
+ @cached_property
+ def column(self):
+ return int(lib.eolian_object_column_get(self))
+
+
+class Class(Object):
+ def __repr__(self):
+ return "<eolian.Class '{0.name}', {0.type!s}>".format(self)
@cached_property
def c_name(self):
- s = lib.eolian_class_c_name_get(self._obj)
+ s = lib.eolian_class_c_name_get(self)
ret = _str_to_py(s)
lib.eina_stringshare_del(c_void_p(s))
return ret
@cached_property
def c_get_function_name(self):
- s = lib.eolian_class_c_get_function_name_get(self._obj)
+ s = lib.eolian_class_c_get_function_name_get(self)
ret = _str_to_py(s)
lib.eina_stringshare_del(c_void_p(s))
return ret
@cached_property
def type(self):
- return Eolian_Class_Type(lib.eolian_class_type_get(self._obj))
+ return Eolian_Class_Type(lib.eolian_class_type_get(self))
@cached_property
def data_type(self):
- return _str_to_py(lib.eolian_class_data_type_get(self._obj))
+ return _str_to_py(lib.eolian_class_data_type_get(self))
@cached_property
def c_data_type(self):
- s = lib.eolian_class_c_data_type_get(self._obj)
+ s = lib.eolian_class_c_data_type_get(self)
ret = _str_to_py(s)
lib.eina_stringshare_del(c_void_p(s))
return ret
@cached_property
def legacy_prefix(self):
- return _str_to_py(lib.eolian_class_legacy_prefix_get(self._obj))
+ return _str_to_py(lib.eolian_class_legacy_prefix_get(self))
@cached_property
def eo_prefix(self):
- return _str_to_py(lib.eolian_class_eo_prefix_get(self._obj))
+ return _str_to_py(lib.eolian_class_eo_prefix_get(self))
@cached_property
def event_prefix(self):
- return _str_to_py(lib.eolian_class_event_prefix_get(self._obj))
+ return _str_to_py(lib.eolian_class_event_prefix_get(self))
@cached_property
def documentation(self):
- c_doc = lib.eolian_class_documentation_get(self._obj)
+ c_doc = lib.eolian_class_documentation_get(self)
return Documentation(c_doc) if c_doc else None
@property
def constructors(self):
- return Iterator(Constructor, lib.eolian_class_constructors_get(self._obj))
+ return Iterator(Constructor, lib.eolian_class_constructors_get(self))
@property
def events(self):
- return Iterator(Event, lib.eolian_class_events_get(self._obj))
+ return Iterator(Event, lib.eolian_class_events_get(self))
- def event_get_by_name(self, event_name):
- c_event = lib.eolian_class_event_get_by_name(self._obj,
+ def event_by_name_get(self, event_name):
+ c_event = lib.eolian_class_event_by_name_get(self,
_str_to_bytes(event_name))
return Event(c_event) if c_event else None
@property
def inherits(self):
- return Iterator(Class, lib.eolian_class_inherits_get(self._obj))
+ return Iterator(Class, lib.eolian_class_inherits_get(self))
@cached_property
def inherits_full(self):
@@ -641,35 +717,23 @@ class Class(EolianBaseObject):
if len(inherits) > 0:
return inherits[0]
- @property
- def namespaces(self):
- return Iterator(_str_to_py, lib.eolian_class_namespaces_get(self._obj))
-
- @cached_property
- def namespace(self):
- return '.'.join(self.namespaces)
-
- @cached_property
- def file(self):
- return _str_to_py(lib.eolian_class_file_get(self._obj))
-
@cached_property
def ctor_enable(self):
- return bool(lib.eolian_class_ctor_enable_get(self._obj))
+ return bool(lib.eolian_class_ctor_enable_get(self))
@cached_property
def dtor_enable(self):
- return bool(lib.eolian_class_dtor_enable_get(self._obj))
+ return bool(lib.eolian_class_dtor_enable_get(self))
- def function_get_by_name(self, func_name,
+ def function_by_name_get(self, func_name,
ftype=Eolian_Function_Type.UNRESOLVED):
- f = lib.eolian_class_function_get_by_name(self._obj,
+ f = lib.eolian_class_function_by_name_get(self,
_str_to_bytes(func_name),
ftype)
return Function(f) if f else None
def functions_get(self, ftype):
- return Iterator(Function, lib.eolian_class_functions_get(self._obj, ftype))
+ return Iterator(Function, lib.eolian_class_functions_get(self, ftype))
@property
def methods(self):
@@ -681,104 +745,88 @@ class Class(EolianBaseObject):
@property
def implements(self):
- return Iterator(Implement, lib.eolian_class_implements_get(self._obj))
+ return Iterator(Implement, lib.eolian_class_implements_get(self))
@property
def parts(self):
- return Iterator(Part, lib.eolian_class_parts_get(self._obj))
+ return Iterator(Part, lib.eolian_class_parts_get(self))
-class Part(EolianBaseObject):
+class Part(Object):
def __repr__(self):
return "<eolian.Part '{0.name}'>".format(self)
@cached_property
- def name(self):
- return _str_to_py(lib.eolian_part_name_get(self._obj))
-
- @cached_property
def class_(self):
- return Class(lib.eolian_part_class_get(self._obj))
+ return Class(lib.eolian_part_class_get(self))
@cached_property
def documentation(self):
- c_doc = lib.eolian_part_documentation_get(self._obj)
+ c_doc = lib.eolian_part_documentation_get(self)
return Documentation(c_doc) if c_doc else None
-class Constructor(EolianBaseObject):
+class Constructor(Object):
def __repr__(self):
- return "<eolian.Constructor '{0.full_name}', optional={0.is_optional}>".format(self)
-
- @cached_property
- def full_name(self):
- return _str_to_py(lib.eolian_constructor_full_name_get(self._obj))
+ return "<eolian.Constructor '{0.name}', optional={0.is_optional}>".format(self)
@cached_property
def function(self):
- return Function(lib.eolian_constructor_function_get(self._obj))
+ return Function(lib.eolian_constructor_function_get(self))
@cached_property
def is_optional(self):
- return bool(lib.eolian_constructor_is_optional(self._obj))
+ return bool(lib.eolian_constructor_is_optional(self))
@cached_property
def class_(self):
- return Class(lib.eolian_constructor_class_get(self._obj))
+ return Class(lib.eolian_constructor_class_get(self))
-class Event(EolianBaseObject):
+class Event(Object):
def __repr__(self):
return "<eolian.Event '{0.name}', c_name='{0.c_name}'>".format(self)
@cached_property
- def name(self):
- return _str_to_py(lib.eolian_event_name_get(self._obj))
-
- @cached_property
def c_name(self):
- s = lib.eolian_event_c_name_get(self._obj)
+ s = lib.eolian_event_c_name_get(self)
ret = _str_to_py(s)
lib.eina_stringshare_del(c_void_p(s))
return ret
@cached_property
def type(self):
- c_type = lib.eolian_event_type_get(self._obj)
+ c_type = lib.eolian_event_type_get(self)
return Type(c_type) if c_type else None
@cached_property
def documentation(self):
- c_doc = lib.eolian_event_documentation_get(self._obj)
+ c_doc = lib.eolian_event_documentation_get(self)
return Documentation(c_doc) if c_doc else None
@cached_property
def scope(self):
- return Eolian_Object_Scope(lib.eolian_event_scope_get(self._obj))
+ return Eolian_Object_Scope(lib.eolian_event_scope_get(self))
@cached_property
def is_beta(self):
- return bool(lib.eolian_event_is_beta(self._obj))
+ return bool(lib.eolian_event_is_beta(self))
@cached_property
def is_hot(self):
- return bool(lib.eolian_event_is_hot(self._obj))
+ return bool(lib.eolian_event_is_hot(self))
@cached_property
def is_restart(self):
- return bool(lib.eolian_event_is_restart(self._obj))
+ return bool(lib.eolian_event_is_restart(self))
-class Function(EolianBaseObject):
+class Function(Object):
def __repr__(self):
return "<eolian.Function '{0.name}'>".format(self)
- @cached_property
- def name(self):
- return _str_to_py(lib.eolian_function_name_get(self._obj))
-
def full_c_name_get(self, ftype, use_legacy=False):
- s = lib.eolian_function_full_c_name_get(self._obj, ftype, use_legacy)
+ s = lib.eolian_function_full_c_name_get(self, ftype, use_legacy)
ret = _str_to_py(s)
lib.eina_stringshare_del(c_void_p(s))
return ret
@@ -809,10 +857,10 @@ class Function(EolianBaseObject):
@cached_property
def type(self):
- return Eolian_Function_Type(lib.eolian_function_type_get(self._obj))
+ return Eolian_Function_Type(lib.eolian_function_type_get(self))
def scope_get(self, ftype):
- return Eolian_Object_Scope(lib.eolian_function_scope_get(self._obj, ftype))
+ return Eolian_Object_Scope(lib.eolian_function_scope_get(self, ftype))
@cached_property
def method_scope(self):
@@ -827,43 +875,43 @@ class Function(EolianBaseObject):
return self.scope_get(Eolian_Function_Type.PROP_SET)
def legacy_get(self, ftype):
- return _str_to_py(lib.eolian_function_legacy_get(self._obj, ftype))
+ return _str_to_py(lib.eolian_function_legacy_get(self, ftype))
def is_legacy_only(self, ftype):
- return bool(lib.eolian_function_is_legacy_only(self._obj, ftype))
+ return bool(lib.eolian_function_is_legacy_only(self, ftype))
@cached_property
def is_class(self):
- return bool(lib.eolian_function_is_class(self._obj))
+ return bool(lib.eolian_function_is_class(self))
@cached_property
def is_beta(self):
- return bool(lib.eolian_function_is_beta(self._obj))
+ return bool(lib.eolian_function_is_beta(self))
@cached_property
def object_is_const(self):
- return bool(lib.eolian_function_object_is_const(self._obj))
+ return bool(lib.eolian_function_object_is_const(self))
@cached_property
def class_(self):
- c_cls = lib.eolian_function_class_get(self._obj)
+ c_cls = lib.eolian_function_class_get(self)
return Class(c_cls) if c_cls else None
def is_constructor(self, klass):
- return bool(lib.eolian_function_is_constructor(self._obj, klass._obj))
+ return bool(lib.eolian_function_is_constructor(self, klass._obj))
# @cached_property
# def is_function_pointer(self):
- # return bool(lib.eolian_function_is_function_pointer(self._obj))
+ # return bool(lib.eolian_function_is_function_pointer(self))
@property
def parameters(self):
return Iterator(Function_Parameter,
- lib.eolian_function_parameters_get(self._obj))
+ lib.eolian_function_parameters_get(self))
def values_get(self, ftype): # TODO rename in property_values_get (or implement a proper Property class?)
return Iterator(Function_Parameter,
- lib.eolian_property_values_get(self._obj, ftype))
+ lib.eolian_property_values_get(self, ftype))
@property
def getter_values(self): # TODO rename ...
@@ -875,7 +923,7 @@ class Function(EolianBaseObject):
def keys_get(self, ftype): # TODO rename in property_keys_get (or implement a proper Property class?)
return Iterator(Function_Parameter,
- lib.eolian_property_keys_get(self._obj, ftype))
+ lib.eolian_property_keys_get(self, ftype))
@property
def getter_keys(self): # TODO rename ...
@@ -886,7 +934,7 @@ class Function(EolianBaseObject):
return self.keys_get(Eolian_Function_Type.PROP_SET)
def return_type_get(self, ftype):
- c_type = lib.eolian_function_return_type_get(self._obj, ftype)
+ c_type = lib.eolian_function_return_type_get(self, ftype)
return Type(c_type) if c_type else None
def return_default_value(self, ftye):
@@ -894,11 +942,11 @@ class Function(EolianBaseObject):
return Expression(c_expr) if c_expr else None
def return_documentation(self, ftype):
- c_doc = lib.eolian_function_return_documentation_get(self._obj, ftype)
+ c_doc = lib.eolian_function_return_documentation_get(self, ftype)
return Documentation(c_doc) if c_doc else None
def return_is_warn_unused(self, ftype):
- return bool(lib.eolian_function_return_is_warn_unused(self._obj, ftype))
+ return bool(lib.eolian_function_return_is_warn_unused(self, ftype))
@cached_property
def method_return_type(self):
@@ -916,106 +964,98 @@ class Function(EolianBaseObject):
def prop_readable(self):
# TODO: maybe there is a better way to do this...
ftype = Eolian_Function_Type.PROP_GET
- scope = lib.eolian_function_scope_get(self._obj, ftype)
+ scope = lib.eolian_function_scope_get(self, ftype)
return True if scope != Eolian_Object_Scope.UNKNOWN else False
@cached_property
def prop_writable(self):
# TODO: maybe there is a better way to do this...
ftype = Eolian_Function_Type.PROP_SET
- scope = lib.eolian_function_scope_get(self._obj, ftype)
+ scope = lib.eolian_function_scope_get(self, ftype)
return True if scope != Eolian_Object_Scope.UNKNOWN else False
@cached_property
def implement(self):
- c_impl = lib.eolian_function_implement_get(self._obj)
+ c_impl = lib.eolian_function_implement_get(self)
return Implement(c_impl) if c_impl else None
-class Function_Parameter(EolianBaseObject):
+class Function_Parameter(Object):
def __repr__(self):
return "<eolian.Function_Parameter '{0.name}', type={0.type}," \
" optional={0.is_optional}, nullable={0.is_nullable}>".format(self)
@cached_property
- def name(self):
- return _str_to_py(lib.eolian_parameter_name_get(self._obj))
-
- @cached_property
def direction(self):
- return Eolian_Parameter_Dir(lib.eolian_parameter_direction_get(self._obj))
+ return Eolian_Parameter_Dir(lib.eolian_parameter_direction_get(self))
@cached_property
def documentation(self):
- c_doc = lib.eolian_parameter_documentation_get(self._obj)
+ c_doc = lib.eolian_parameter_documentation_get(self)
return Documentation(c_doc) if c_doc else None
@cached_property
def is_nonull(self):
- return bool(lib.eolian_parameter_is_nonull(self._obj))
+ return bool(lib.eolian_parameter_is_nonull(self))
@cached_property
def is_nullable(self):
- return bool(lib.eolian_parameter_is_nullable(self._obj))
+ return bool(lib.eolian_parameter_is_nullable(self))
@cached_property
def is_optional(self):
- return bool(lib.eolian_parameter_is_optional(self._obj))
+ return bool(lib.eolian_parameter_is_optional(self))
@cached_property
def type(self):
- c_type = lib.eolian_parameter_type_get(self._obj)
+ c_type = lib.eolian_parameter_type_get(self)
return Type(c_type) if c_type else None
@cached_property
def default_value(self):
- c_expr = lib.eolian_parameter_default_value_get(self._obj)
+ c_expr = lib.eolian_parameter_default_value_get(self)
return Expression(c_expr) if c_expr else None
-class Implement(EolianBaseObject):
+class Implement(Object):
def __repr__(self):
- return "<eolian.Implement '{0.full_name}'>".format(self)
-
- @cached_property
- def full_name(self):
- return _str_to_py(lib.eolian_implement_full_name_get(self._obj))
+ return "<eolian.Implement '{0.name}'>".format(self)
@cached_property
def class_(self):
- c_cls = lib.eolian_implement_class_get(self._obj)
+ c_cls = lib.eolian_implement_class_get(self)
return Class(c_cls) if c_cls else None
@cached_property
def function(self):
- c_func = lib.eolian_implement_function_get(self._obj, None)
+ c_func = lib.eolian_implement_function_get(self, None)
return Function(c_func) if c_func else None
def documentation_get(self, ftype=Eolian_Function_Type.METHOD):
# something strange in this eolian api :/ (see 'documentation' property
- c_doc = lib.eolian_implement_documentation_get(self._obj, ftype)
+ c_doc = lib.eolian_implement_documentation_get(self, ftype)
return Documentation(c_doc) if c_doc else None
# TODO implement util properties for documentation_get
def is_auto(self, ftype=Eolian_Function_Type.METHOD):
- return bool(lib.eolian_implement_is_auto(self._obj, ftype))
+ return bool(lib.eolian_implement_is_auto(self, ftype))
# TODO implement util properties for is_auto
def is_empty(self, ftype=Eolian_Function_Type.METHOD):
- return bool(lib.eolian_implement_is_empty(self._obj, ftype))
+ return bool(lib.eolian_implement_is_empty(self, ftype))
# TODO implement util properties for is_empty
def is_pure_virtual(self, ftype=Eolian_Function_Type.METHOD):
- return bool(lib.eolian_implement_is_pure_virtual(self._obj, ftype))
+ return bool(lib.eolian_implement_is_pure_virtual(self, ftype))
# TODO implement util properties for is_pure_virtual
@cached_property
def is_prop_set(self):
- return bool(lib.eolian_implement_is_prop_set(self._obj))
+ return bool(lib.eolian_implement_is_prop_set(self))
@cached_property
def is_prop_get(self):
- return bool(lib.eolian_implement_is_prop_get(self._obj))
+ return bool(lib.eolian_implement_is_prop_get(self))
@property
def is_property(self):
@@ -1026,348 +1066,263 @@ class Implement(EolianBaseObject):
return not self.is_property
-class Type(EolianBaseObject): # OK (4 TODO Unit*)
+class Type(Object):
def __repr__(self):
- # return "<eolian.Type '{0.full_name}', type: {0.type!s}, c_type: '{0.c_type}'>".format(self)
- return "<eolian.Type '{0.full_name}', type={0.type!s}>".format(self)
+ # return "<eolian.Type '{0.name}', type: {0.type!s}, c_type: '{0.c_type}'>".format(self)
+ return "<eolian.Type '{0.name}', type={0.type!s}>".format(self)
@cached_property
- def name(self):
- return _str_to_py(lib.eolian_type_name_get(self._obj))
+ def free_func(self):
+ return _str_to_py(lib.eolian_type_free_func_get(self))
@cached_property
- def full_name(self):
- return _str_to_py(lib.eolian_type_full_name_get(self._obj))
-
- @property
- def namespaces(self):
- return Iterator(_str_to_py, lib.eolian_type_namespaces_get(self._obj))
+ def type(self):
+ return Eolian_Type_Type(lib.eolian_type_type_get(self))
@cached_property
- def namespace(self):
- return '.'.join(self.namespaces)
+ def builtin_type(self):
+ return Eolian_Type_Builtin_Type(lib.eolian_type_builtin_type_get(self))
- @cached_property
- def free_func(self):
- return _str_to_py(lib.eolian_type_free_func_get(self._obj))
+ def c_type_get(self, ctype):
+ s = lib.eolian_type_c_type_get(self, ctype)
+ ret = _str_to_py(s)
+ lib.eina_stringshare_del(c_void_p(s))
+ return ret
@cached_property
- def type(self):
- return Eolian_Type_Type(lib.eolian_type_type_get(self._obj))
+ def c_type_default(self):
+ return self.c_type_get(Eolian_C_Type_Type.DEFAULT)
@cached_property
- def builtin_type(self):
- return Eolian_Type_Builtin_Type(lib.eolian_type_builtin_type_get(self._obj))
+ def c_type_param(self):
+ return self.c_type_get(Eolian_C_Type_Type.PARAM)
- # TODO FIXME STRANGE API (need Eolian_Unit*)
@cached_property
- def c_type(self):
- # return _str_to_py(lib.eolian_type_c_type_get(self._obj))
- return 'FIXME'
+ def c_type_return(self):
+ return self.c_type_get(Eolian_C_Type_Type.RETURN)
- # TODO FIXME STRANGE API (need Eolian_Unit*)
- # @cached_property
- # def typedecl(self):
- # c_tdecl = lib.eolian_type_typedecl_get(self._obj)
- # return Typedecl(c_tdecl) if c_tdecl else None
+ @cached_property
+ def typedecl(self):
+ c_tdecl = lib.eolian_type_typedecl_get(self)
+ return Typedecl(c_tdecl) if c_tdecl else None
@cached_property
def base_type(self):
- c_type = lib.eolian_type_base_type_get(self._obj)
+ c_type = lib.eolian_type_base_type_get(self)
return Type(c_type) if c_type else None
@cached_property
def next_type(self):
- c_type = lib.eolian_type_next_type_get(self._obj)
+ c_type = lib.eolian_type_next_type_get(self)
return Type(c_type) if c_type else None
- # TODO FIXME STRANGE API (need Eolian_Unit*)
- # @cached_property
- # def aliased_base(self):
- # c_type = lib.eolian_type_aliased_base_get(self._obj)
- # return Type(c_type) if c_type else None
-
- # TODO FIXME STRANGE API (need Eolian_Unit*)
- # @cached_property
- # def class_(self):
- # c_cls = lib.eolian_type_class_get(self._obj)
- # return Class(c_cls) if c_cls else None
+ @cached_property
+ def aliased_base(self):
+ c_type = lib.eolian_type_aliased_base_get(self)
+ return Type(c_type) if c_type else None
@cached_property
- def file(self):
- return _str_to_py(lib.eolian_type_file_get(self._obj))
+ def class_(self):
+ c_cls = lib.eolian_type_class_get(self)
+ return Class(c_cls) if c_cls else None
@cached_property
def is_owned(self):
- return bool(lib.eolian_type_is_owned(self._obj))
+ return bool(lib.eolian_type_is_owned(self))
@cached_property
def is_const(self):
- return bool(lib.eolian_type_is_const(self._obj))
+ return bool(lib.eolian_type_is_const(self))
@cached_property
def is_ptr(self):
- return bool(lib.eolian_type_is_ptr(self._obj))
+ return bool(lib.eolian_type_is_ptr(self))
-class Typedecl(EolianBaseObject): # OK (2 TODO Unit*)
+class Typedecl(Object):
def __repr__(self):
- return "<eolian.Typedecl '{0.full_name}', type={0.type!s}>".format(self)
-
- @cached_property
- def name(self):
- return _str_to_py(lib.eolian_typedecl_name_get(self._obj))
-
- @cached_property
- def full_name(self):
- return _str_to_py(lib.eolian_typedecl_full_name_get(self._obj))
-
- @cached_property
- def file(self):
- return _str_to_py(lib.eolian_typedecl_file_get(self._obj))
+ return "<eolian.Typedecl '{0.name}', type={0.type!s}>".format(self)
@cached_property
def type(self):
- return Eolian_Typedecl_Type(lib.eolian_typedecl_type_get(self._obj))
-
- # TODO FIX THIS, need Eolian_Unit* param ???
- # @cached_property
- # def c_type(self):
- # return _str_to_py(lib.eolian_typedecl_c_type_get(self._obj))
-
- @property
- def namespaces(self):
- return Iterator(_str_to_py, lib.eolian_typedecl_namespaces_get(self._obj))
+ return Eolian_Typedecl_Type(lib.eolian_typedecl_type_get(self))
@cached_property
- def namespace(self):
- return '.'.join(self.namespaces)
+ def c_type(self):
+ s = lib.eolian_typedecl_c_type_get(self)
+ ret = _str_to_py(s)
+ lib.eina_stringshare_del(c_void_p(s))
+ return ret
@cached_property
def free_func(self):
- return _str_to_py(lib.eolian_typedecl_free_func_get(self._obj))
+ return _str_to_py(lib.eolian_typedecl_free_func_get(self))
@cached_property
def is_extern(self):
- return bool(lib.eolian_typedecl_is_extern(self._obj))
+ return bool(lib.eolian_typedecl_is_extern(self))
@property
def enum_fields(self):
return Iterator(Enum_Type_Field,
- lib.eolian_typedecl_enum_fields_get(self._obj))
+ lib.eolian_typedecl_enum_fields_get(self))
def enum_field_get(self, field):
- c_field = lib.eolian_typedecl_enum_field_get(self._obj, _str_to_bytes(field))
+ c_field = lib.eolian_typedecl_enum_field_get(self, _str_to_bytes(field))
return Enum_Type_Field(c_field) if c_field else None
@property
def struct_fields(self):
return Iterator(Struct_Type_Field,
- lib.eolian_typedecl_struct_fields_get(self._obj))
+ lib.eolian_typedecl_struct_fields_get(self))
def struct_field_get(self, field):
- c_field = lib.eolian_typedecl_struct_field_get(self._obj, _str_to_bytes(field))
+ c_field = lib.eolian_typedecl_struct_field_get(self, _str_to_bytes(field))
return Struct_Type_Field(c_field) if c_field else None
@cached_property
def base_type(self):
- c_type = lib.eolian_typedecl_base_type_get(self._obj)
+ c_type = lib.eolian_typedecl_base_type_get(self)
return Type(c_type) if c_type else None
- # TODO FIX THIS, need Eolian_Unit* param ???
- # @cached_property
- # def aliased_base(self):
- # c_type = lib.eolian_typedecl_aliased_base_get(self._obj)
- # return Type(c_type) if c_type else None
+ @cached_property
+ def aliased_base(self):
+ c_type = lib.eolian_typedecl_aliased_base_get(self)
+ return Type(c_type) if c_type else None
@cached_property
def documentation(self):
- c_doc = lib.eolian_typedecl_documentation_get(self._obj)
+ c_doc = lib.eolian_typedecl_documentation_get(self)
return Documentation(c_doc) if c_doc else None
@cached_property
def enum_legacy_prefix(self):
- return _str_to_py(lib.eolian_typedecl_enum_legacy_prefix_get(self._obj))
+ return _str_to_py(lib.eolian_typedecl_enum_legacy_prefix_get(self))
@cached_property
def function_pointer(self):
- c_func = lib.eolian_typedecl_function_pointer_get(self._obj)
+ c_func = lib.eolian_typedecl_function_pointer_get(self)
return Function(c_func) if c_func else None
-class Enum_Type_Field(EolianBaseObject):
+class Enum_Type_Field(Object):
def __repr__(self):
return "<eolian.Enum_Type_Field '{0.name}', c_name='{0.c_name}'>".format(self)
@cached_property
- def name(self):
- return _str_to_py(lib.eolian_typedecl_enum_field_name_get(self._obj))
-
- @cached_property
def c_name(self):
- s = lib.eolian_typedecl_enum_field_c_name_get(self._obj)
+ s = lib.eolian_typedecl_enum_field_c_name_get(self)
ret = _str_to_py(s)
lib.eina_stringshare_del(c_void_p(s))
return ret
@cached_property
def value(self):
- c_expr = lib.eolian_typedecl_enum_field_value_get(self._obj, True)
+ c_expr = lib.eolian_typedecl_enum_field_value_get(self, True)
return Expression(c_expr) if c_expr else None
@cached_property
def documentation(self):
- c_doc = lib.eolian_typedecl_enum_field_documentation_get(self._obj)
+ c_doc = lib.eolian_typedecl_enum_field_documentation_get(self)
return Documentation(c_doc) if c_doc else None
-class Struct_Type_Field(EolianBaseObject):
+class Struct_Type_Field(Object):
def __repr__(self):
return "<eolian.Struct_Type_Field '{0.name}', type={0.type!s}>".format(self)
@cached_property
- def name(self):
- return _str_to_py(lib.eolian_typedecl_struct_field_name_get(self._obj))
-
- @cached_property
def type(self):
- c_type = lib.eolian_typedecl_struct_field_type_get(self._obj)
+ c_type = lib.eolian_typedecl_struct_field_type_get(self)
return Type(c_type) if c_type else None
@cached_property
def documentation(self):
- c_doc = lib.eolian_typedecl_struct_field_documentation_get(self._obj)
+ c_doc = lib.eolian_typedecl_struct_field_documentation_get(self)
return Documentation(c_doc) if c_doc else None
-class Expression(EolianBaseObject):
+class Expression(Object):
def __repr__(self):
return "<eolian.Expression type={0.type!s}, serialize='{0.serialize}'>".format(self)
@cached_property
def type(self):
- return Eolian_Expression_Type(lib.eolian_expression_type_get(self._obj))
+ return Eolian_Expression_Type(lib.eolian_expression_type_get(self))
# TODO: EAPI Eolian_Value eolian_expression_value_get(const Eolian_Expression *expr);
@cached_property
def serialize(self):
- s = lib.eolian_expression_serialize(self._obj)
+ s = lib.eolian_expression_serialize(self)
ret = _str_to_py(s)
lib.eina_stringshare_del(c_void_p(s))
return ret
@cached_property
def binary_operator(self):
- c_op = lib.eolian_expression_binary_operator_get(self._obj)
+ c_op = lib.eolian_expression_binary_operator_get(self)
return Eolian_Binary_Operator(c_op) if c_op is not None else None
@cached_property
def binary_lhs(self):
- c_expr = lib.eolian_expression_binary_lhs_get(self._obj)
+ c_expr = lib.eolian_expression_binary_lhs_get(self)
return Expression(c_expr) if c_expr else None
@cached_property
def binary_rhs(self):
- c_expr = lib.eolian_expression_binary_rhs_get(self._obj)
+ c_expr = lib.eolian_expression_binary_rhs_get(self)
return Expression(c_expr) if c_expr else None
@cached_property
def unary_operator(self):
- c_op = lib.eolian_expression_unary_operator_get(self._obj)
+ c_op = lib.eolian_expression_unary_operator_get(self)
return Eolian_Unary_Operator(c_op) if c_op is not None else None
@cached_property
def unary_expression(self):
- c_expr = lib.eolian_expression_unary_expression_get(self._obj)
+ c_expr = lib.eolian_expression_unary_expression_get(self)
return Expression(c_expr) if c_expr is not None else None
-class Variable(EolianBaseObject):
+class Variable(Object):
def __repr__(self):
- return "<eolian.Variable '{0.full_name}', type={0.type!s}, file={0.file}>".format(self)
-
- @cached_property
- def name(self):
- return _str_to_py(lib.eolian_variable_name_get(self._obj))
-
- @cached_property
- def full_name(self):
- return _str_to_py(lib.eolian_variable_full_name_get(self._obj))
-
- @property
- def namespaces(self):
- return Iterator(_str_to_py, lib.eolian_variable_namespaces_get(self._obj))
-
- @cached_property
- def namespace(self):
- return '.'.join(self.namespaces)
+ return "<eolian.Variable '{0.name}', type={0.type!s}, file={0.file}>".format(self)
@cached_property
def type(self):
- return Eolian_Variable_Type(lib.eolian_variable_type_get(self._obj))
+ return Eolian_Variable_Type(lib.eolian_variable_type_get(self))
@cached_property
def value(self):
- c_expr = lib.eolian_variable_value_get(self._obj)
+ c_expr = lib.eolian_variable_value_get(self)
return Expression(c_expr) if c_expr else None
@cached_property
- def file(self):
- return _str_to_py(lib.eolian_variable_file_get(self._obj))
-
- @cached_property
def base_type(self):
- c_type = lib.eolian_variable_base_type_get(self._obj)
+ c_type = lib.eolian_variable_base_type_get(self)
return Type(c_type) if c_type else None
@cached_property
def is_extern(self):
- return bool(lib.eolian_variable_is_extern(self._obj))
+ return bool(lib.eolian_variable_is_extern(self))
@cached_property
def documentation(self):
- c_doc = lib.eolian_variable_documentation_get(self._obj)
+ c_doc = lib.eolian_variable_documentation_get(self)
return Documentation(c_doc) if c_doc else None
-class Declaration(EolianBaseObject):
- def __repr__(self):
- return "<eolian.Declaration '{0.name}'>".format(self)
-
- @cached_property
- def name(self):
- return _str_to_py(lib.eolian_declaration_name_get(self._obj))
-
- @cached_property
- def type(self):
- return Eolian_Declaration_Type(lib.eolian_declaration_type_get(self._obj))
-
- @cached_property
- def class_(self):
- c_cls = lib.eolian_declaration_class_get(self._obj)
- return Class(c_cls) if c_cls else None
-
- @cached_property
- def data_type(self):
- c_typedec = lib.eolian_declaration_data_type_get(self._obj)
- return Typedecl(c_typedec) if c_typedec else None
-
- @cached_property
- def variable(self):
- c_var = lib.eolian_declaration_variable_get(self._obj)
- return Variable(c_var) if c_var else None
-
-
class _Eolian_Doc_Token_Struct(ctypes.Structure):
_fields_ = [("type", c_int),
("text", c_char_p),
("text_end", c_char_p)]
-class Documentation(EolianBaseObject): # OK (1 TODO Unit*)
- # def __repr__(self):
- # return "<eolian.Documentation '{0.name}'>".format(self)
+class Documentation(Object): # OK (1 TODO Unit*)
+ def __repr__(self):
+ t = self.summary if len(self.summary) < 40 else self.summary[:40] + '...'
+ return "<eolian.Documentation summary='{}'>".format(t)
# this is too much for py, just use string.split('\n\n') instead
# def string_split(self, string):
@@ -1375,15 +1330,15 @@ class Documentation(EolianBaseObject): # OK (1 TODO Unit*)
@cached_property
def summary(self):
- return _str_to_py(lib.eolian_documentation_summary_get(self._obj))
+ return _str_to_py(lib.eolian_documentation_summary_get(self))
@cached_property
def description(self):
- return _str_to_py(lib.eolian_documentation_description_get(self._obj))
+ return _str_to_py(lib.eolian_documentation_description_get(self))
@cached_property
def since(self):
- return _str_to_py(lib.eolian_documentation_since_get(self._obj))
+ return _str_to_py(lib.eolian_documentation_since_get(self))
@cached_property
def summary_tokens(self):
@@ -1463,6 +1418,43 @@ def _str_to_py(s):
print('WARNING !!!!!!!!! Unknown type: %s' % type(s))
+### internal Object type -> Class mapping ###################################
+
+class _Eolian_Object_Type(IntEnum):
+ UNKNOWN = 0
+ CLASS = 1
+ TYPEDECL = 2
+ STRUCT_FIELD = 3
+ ENUM_FIELD = 4
+ TYPE = 5
+ VARIABLE = 6
+ EXPRESSION = 7
+ FUNCTION = 8
+ FUNCTION_PARAMETER = 9
+ EVENT = 10
+ PART = 11
+ IMPLEMENT = 12
+ CONSTRUCTOR = 13
+ DOCUMENTATION = 14
+
+_eolian_type_class_mapping = {
+ _Eolian_Object_Type.UNKNOWN: Object,
+ _Eolian_Object_Type.CLASS: Class,
+ _Eolian_Object_Type.TYPEDECL: Typedecl,
+ _Eolian_Object_Type.STRUCT_FIELD: Struct_Type_Field,
+ _Eolian_Object_Type.ENUM_FIELD: Enum_Type_Field,
+ _Eolian_Object_Type.TYPE: Type,
+ _Eolian_Object_Type.VARIABLE: Variable,
+ _Eolian_Object_Type.EXPRESSION: Expression,
+ _Eolian_Object_Type.FUNCTION: Function,
+ _Eolian_Object_Type.FUNCTION_PARAMETER: Function_Parameter,
+ _Eolian_Object_Type.EVENT: Event,
+ _Eolian_Object_Type.PART: Part,
+ _Eolian_Object_Type.IMPLEMENT: Implement,
+ _Eolian_Object_Type.CONSTRUCTOR: Constructor,
+ _Eolian_Object_Type.DOCUMENTATION: Documentation,
+}
+
### module init/shutdown ####################################################
def _cleanup():
global _already_halted
diff --git a/src/scripts/pyolian/eolian_lib.py b/src/scripts/pyolian/eolian_lib.py
index 66b1556b5b..3cd7bad285 100644
--- a/src/scripts/pyolian/eolian_lib.py
+++ b/src/scripts/pyolian/eolian_lib.py
@@ -11,10 +11,13 @@ import os
script_path = os.path.dirname(os.path.realpath(__file__))
root_path = os.path.abspath(os.path.join(script_path, '..', '..', '..'))
-search_in = (
+search_in = [
os.path.join(root_path, 'src', 'lib', 'eolian', '.libs'),
os.path.join(root_path, 'build', 'src', 'lib', 'eolian'),
-)
+]
+
+if 'EOLIAN_SO_DIR' in os.environ:
+ search_in.insert(0, os.environ['EOLIAN_SO_DIR'])
search_names = ('libeolian.so', 'eolian.dll')
@@ -32,726 +35,686 @@ lib = CDLL(file_path)
# EAPI int eolian_init(void);
-lib.eolian_init.argtypes = []
+lib.eolian_init.argtypes = None
lib.eolian_init.restype = c_int
# EAPI int eolian_shutdown(void);
-lib.eolian_shutdown.argtypes = []
+lib.eolian_shutdown.argtypes = None
lib.eolian_shutdown.restype = c_int
-# EAPI Eolian *eolian_new(void);
-lib.eolian_new.argtypes = []
-lib.eolian_new.restype = c_void_p
+### Eolian_State ############################################################
+
+# EAPI Eolian_State *eolian_state_new(void);
+lib.eolian_state_new.argtypes = None
+lib.eolian_state_new.restype = c_void_p
+
+# EAPI void eolian_state_free(Eolian_State *state);
+lib.eolian_state_free.argtypes = (c_void_p,)
+lib.eolian_state_free.restype = None
+
+# EAPI const Eolian_Unit *eolian_state_file_parse(Eolian_State *state, const char *filepath);
+lib.eolian_state_file_parse.argtypes = (c_void_p, c_char_p)
+lib.eolian_state_file_parse.restype = c_void_p
+
+# EAPI Eina_Iterator *eolian_state_eo_file_paths_get(const Eolian_State *state);
+lib.eolian_state_eo_file_paths_get.argtypes = (c_void_p,)
+lib.eolian_state_eo_file_paths_get.restype = c_void_p
+
+# EAPI Eina_Iterator *eolian_state_eot_file_paths_get(const Eolian_State *state);
+lib.eolian_state_eot_file_paths_get.argtypes = (c_void_p,)
+lib.eolian_state_eot_file_paths_get.restype = c_void_p
+
+# EAPI Eina_Iterator *eolian_state_eo_files_get(const Eolian_State *state);
+lib.eolian_state_eo_files_get.argtypes = (c_void_p,)
+lib.eolian_state_eo_files_get.restype = c_void_p
+
+# EAPI Eina_Iterator *eolian_state_eot_files_get(const Eolian_State *state);
+lib.eolian_state_eot_files_get.argtypes = (c_void_p,)
+lib.eolian_state_eot_files_get.restype = c_void_p
+
+# EAPI Eina_Bool eolian_state_directory_add(Eolian_State *state, const char *dir);
+lib.eolian_state_directory_add.argtypes = (c_void_p, c_char_p)
+lib.eolian_state_directory_add.restype = c_bool
+
+# EAPI Eina_Bool eolian_state_system_directory_add(Eolian_State *state);
+lib.eolian_state_system_directory_add.argtypes = (c_void_p,)
+lib.eolian_state_system_directory_add.restype = c_bool
+
+# EAPI Eina_Bool eolian_state_all_eo_files_parse(Eolian_State *state);
+lib.eolian_state_all_eo_files_parse.argtypes = (c_void_p,)
+lib.eolian_state_all_eo_files_parse.restype = c_bool
+
+# EAPI Eina_Bool eolian_state_all_eot_files_parse(Eolian_State *state);
+lib.eolian_state_all_eot_files_parse.argtypes = (c_void_p,)
+lib.eolian_state_all_eot_files_parse.restype = c_bool
+
+# EAPI const Eolian_Unit *eolian_state_unit_by_file_get(const Eolian_State *state, const char *file_name);
+lib.eolian_state_unit_by_file_get.argtypes = (c_void_p, c_char_p)
+lib.eolian_state_unit_by_file_get.restype = c_void_p
+
+# EAPI Eina_Iterator *eolian_state_units_get(const Eolian_State *state);
+lib.eolian_state_units_get.argtypes = (c_void_p,)
+lib.eolian_state_units_get.restype = c_void_p
+
+# EAPI Eina_Iterator *eolian_state_objects_by_file_get(const Eolian_State *state, const char *file_name);
+lib.eolian_state_objects_by_file_get.argtypes = (c_void_p, c_char_p)
+lib.eolian_state_objects_by_file_get.restype = c_void_p
+
+# EAPI const Eolian_Class *eolian_state_class_by_file_get(const Eolian_State *state, const char *file_name);
+lib.eolian_state_class_by_file_get.argtypes = (c_void_p, c_char_p)
+lib.eolian_state_class_by_file_get.restype = c_void_p
+
+# EAPI Eina_Iterator *eolian_state_globals_by_file_get(const Eolian_State *state, const char *file_name);
+lib.eolian_state_globals_by_file_get.argtypes = (c_void_p, c_char_p)
+lib.eolian_state_globals_by_file_get.restype = c_void_p
+
+# EAPI Eina_Iterator *eolian_state_constants_by_file_get(const Eolian_State *state, const char *file_name);
+lib.eolian_state_constants_by_file_get.argtypes = (c_void_p, c_char_p)
+lib.eolian_state_constants_by_file_get.restype = c_void_p
+
+# EAPI Eina_Iterator *eolian_state_aliases_by_file_get(const Eolian_State *state, const char *file_name);
+lib.eolian_state_aliases_by_file_get.argtypes = (c_void_p, c_char_p)
+lib.eolian_state_aliases_by_file_get.restype = c_void_p
+
+# EAPI Eina_Iterator *eolian_state_structs_by_file_get(const Eolian_State *state, const char *file_name);
+lib.eolian_state_structs_by_file_get.argtypes = (c_void_p, c_char_p)
+lib.eolian_state_structs_by_file_get.restype = c_void_p
+
+# EAPI Eina_Iterator *eolian_state_enums_by_file_get(const Eolian_State *state, const char *file_name);
+lib.eolian_state_enums_by_file_get.argtypes = (c_void_p, c_char_p)
+lib.eolian_state_enums_by_file_get.restype = c_void_p
+
+### Eolian_Unit #############################################################
-# EAPI void eolian_free(Eolian *state);
-lib.eolian_free.argtypes = [c_void_p,]
-lib.eolian_free.restype = None
+# EAPI Eina_Iterator *eolian_unit_children_get(const Eolian_Unit *unit);
+lib.eolian_unit_children_get.argtypes = (c_void_p,)
+lib.eolian_unit_children_get.restype = c_void_p
-# EAPI const Eolian_Unit *eolian_file_parse(Eolian *state, const char *filepath);
-lib.eolian_file_parse.argtypes = [c_void_p, c_char_p]
-lib.eolian_file_parse.restype = c_void_p
+# EAPI const Eolian_State *eolian_unit_state_get(const Eolian_Unit *unit);
+lib.eolian_unit_state_get.argtypes = (c_void_p,)
+lib.eolian_unit_state_get.restype = c_void_p
-# EAPI Eina_Iterator *eolian_all_eo_file_paths_get(const Eolian *state);
-lib.eolian_all_eo_file_paths_get.argtypes = [c_void_p,]
-lib.eolian_all_eo_file_paths_get.restype = c_void_p
+# EAPI const char *eolian_unit_file_get(const Eolian_Unit *unit);
+lib.eolian_unit_file_get.argtypes = (c_void_p,)
+lib.eolian_unit_file_get.restype = c_char_p
-# EAPI Eina_Iterator *eolian_all_eot_file_paths_get(const Eolian *state);
-lib.eolian_all_eot_file_paths_get.argtypes = [c_void_p,]
-lib.eolian_all_eot_file_paths_get.restype = c_void_p
+# EAPI const Eolian_Object *eolian_unit_object_by_name_get(const Eolian_Unit *unit, const char *name);
+lib.eolian_unit_object_by_name_get.argtypes = (c_void_p, c_char_p)
+lib.eolian_unit_object_by_name_get.restype = c_void_p
-# EAPI Eina_Iterator *eolian_all_eo_files_get(const Eolian *state);
-lib.eolian_all_eo_files_get.argtypes = [c_void_p,]
-lib.eolian_all_eo_files_get.restype = c_void_p
+# EAPI Eina_Iterator *eolian_unit_objects_get(const Eolian_Unit *unit);
+lib.eolian_unit_objects_get.argtypes = (c_void_p,)
+lib.eolian_unit_objects_get.restype = c_void_p
-# EAPI Eina_Iterator *eolian_all_eot_files_get(const Eolian *state);
-lib.eolian_all_eot_files_get.argtypes = [c_void_p,]
-lib.eolian_all_eot_files_get.restype = c_void_p
+# EAPI const Eolian_Class *eolian_unit_class_by_name_get(const Eolian_Unit *unit, const char *class_name);
+lib.eolian_unit_class_by_name_get.argtypes = (c_void_p, c_char_p)
+lib.eolian_unit_class_by_name_get.restype = c_void_p
-# EAPI Eina_Bool eolian_directory_scan(Eolian *state, const char *dir);
-lib.eolian_directory_scan.argtypes = [c_void_p, c_char_p]
-lib.eolian_directory_scan.restype = c_bool
+# EAPI Eina_Iterator *eolian_unit_classes_get(const Eolian_Unit *unit);
+lib.eolian_unit_classes_get.argtypes = (c_void_p,)
+lib.eolian_unit_classes_get.restype = c_void_p
-# EAPI Eina_Bool eolian_system_directory_scan(Eolian *state);
-lib.eolian_system_directory_scan.argtypes = [c_void_p,]
-lib.eolian_system_directory_scan.restype = c_bool
+# EAPI const Eolian_Typedecl *eolian_unit_alias_by_name_get(const Eolian_Unit *unit, const char *name);
+lib.eolian_unit_alias_by_name_get.argtypes = (c_void_p, c_char_p)
+lib.eolian_unit_alias_by_name_get.restype = c_void_p
-# EAPI Eina_Bool eolian_all_eo_files_parse(Eolian *state);
-lib.eolian_all_eo_files_parse.argtypes = [c_void_p,]
-lib.eolian_all_eo_files_parse.restype = c_bool
+# EAPI const Eolian_Typedecl *eolian_unit_struct_by_name_get(const Eolian_Unit *unit, const char *name);
+lib.eolian_unit_struct_by_name_get.argtypes = (c_void_p, c_char_p)
+lib.eolian_unit_struct_by_name_get.restype = c_void_p
-# EAPI Eina_Bool eolian_all_eot_files_parse(Eolian *state);
-lib.eolian_all_eot_files_parse.argtypes = [c_void_p,]
-lib.eolian_all_eot_files_parse.restype = c_bool
+# EAPI const Eolian_Typedecl *eolian_unit_enum_by_name_get(const Eolian_Unit *unit, const char *name);
+lib.eolian_unit_enum_by_name_get.argtypes = (c_void_p, c_char_p)
+lib.eolian_unit_enum_by_name_get.restype = c_void_p
-# EAPI const Eolian_Class *eolian_class_get_by_name(const Eolian_Unit *unit, const char *class_name);
-lib.eolian_class_get_by_name.argtypes = [c_void_p, c_char_p]
-lib.eolian_class_get_by_name.restype = c_void_p
+# EAPI Eina_Iterator *eolian_unit_aliases_get(const Eolian_Unit *unit);
+lib.eolian_unit_aliases_get.argtypes = (c_void_p,)
+lib.eolian_unit_aliases_get.restype = c_void_p
-# EAPI const Eolian_Class *eolian_class_get_by_file(const Eolian_Unit *unit, const char *file_name);
-lib.eolian_class_get_by_file.argtypes = [c_void_p, c_char_p]
-lib.eolian_class_get_by_file.restype = c_void_p
+# EAPI Eina_Iterator *eolian_unit_structs_get(const Eolian_Unit *unit);
+lib.eolian_unit_structs_get.argtypes = (c_void_p,)
+lib.eolian_unit_structs_get.restype = c_void_p
-# EAPI Eina_Stringshare *eolian_class_file_get(const Eolian_Class *klass);
-lib.eolian_class_file_get.argtypes = [c_void_p,]
-lib.eolian_class_file_get.restype = c_char_p
+# EAPI Eina_Iterator *eolian_unit_enums_get(const Eolian_Unit *unit);
+lib.eolian_unit_enums_get.argtypes = (c_void_p,)
+lib.eolian_unit_enums_get.restype = c_void_p
-# EAPI Eina_Stringshare *eolian_class_full_name_get(const Eolian_Class *klass);
-lib.eolian_class_full_name_get.argtypes = [c_void_p,]
-lib.eolian_class_full_name_get.restype = c_char_p
+# EAPI const Eolian_Variable *eolian_unit_global_by_name_get(const Eolian_Unit *unit, const char *name);
+lib.eolian_unit_global_by_name_get.argtypes = (c_void_p, c_char_p)
+lib.eolian_unit_global_by_name_get.restype = c_void_p
-# EAPI Eina_Stringshare *eolian_class_name_get(const Eolian_Class *klass);
-lib.eolian_class_name_get.argtypes = [c_void_p,]
-lib.eolian_class_name_get.restype = c_char_p
+# EAPI const Eolian_Variable *eolian_unit_constant_by_name_get(const Eolian_Unit *unit, const char *name);
+lib.eolian_unit_constant_by_name_get.argtypes = (c_void_p, c_char_p)
+lib.eolian_unit_constant_by_name_get.restype = c_void_p
-# EAPI Eina_Iterator *eolian_class_namespaces_get(const Eolian_Class *klass);
-lib.eolian_class_namespaces_get.argtypes = [c_void_p,]
-lib.eolian_class_namespaces_get.restype = c_void_p
+# EAPI Eina_Iterator *eolian_unit_constants_get(const Eolian_Unit *unit);
+lib.eolian_unit_constants_get.argtypes = (c_void_p,)
+lib.eolian_unit_constants_get.restype = c_void_p
+
+# EAPI Eina_Iterator *eolian_unit_globals_get(const Eolian_Unit *unit);
+lib.eolian_unit_globals_get.argtypes = (c_void_p,)
+lib.eolian_unit_globals_get.restype = c_void_p
+
+### Eolian_Object ###########################################################
+
+# EAPI Eolian_Object_Type eolian_object_type_get(const Eolian_Object *obj);
+lib.eolian_object_type_get.argtypes = (c_void_p,)
+lib.eolian_object_type_get.restype = c_int
+
+# EAPI const Eolian_Unit *eolian_object_unit_get(const Eolian_Object *obj);
+lib.eolian_object_unit_get.argtypes = (c_void_p,)
+lib.eolian_object_unit_get.restype = c_void_p
+
+# EAPI const char *eolian_object_file_get(const Eolian_Object *obj);
+lib.eolian_object_file_get.argtypes = (c_void_p,)
+lib.eolian_object_file_get.restype = c_char_p
+
+# EAPI int eolian_object_line_get(const Eolian_Object *obj);
+lib.eolian_object_line_get.argtypes = (c_void_p,)
+lib.eolian_object_line_get.restype = c_int
+
+# EAPI int eolian_object_column_get(const Eolian_Object *obj);
+lib.eolian_object_column_get.argtypes = (c_void_p,)
+lib.eolian_object_column_get.restype = c_int
+
+# EAPI const char *eolian_object_name_get(const Eolian_Object *obj);
+lib.eolian_object_name_get.argtypes = (c_void_p,)
+lib.eolian_object_name_get.restype = c_char_p
+
+# EAPI const char *eolian_object_short_name_get(const Eolian_Object *obj);
+lib.eolian_object_short_name_get.argtypes = (c_void_p,)
+lib.eolian_object_short_name_get.restype = c_char_p
+
+# EAPI Eina_Iterator *eolian_object_namespaces_get(const Eolian_Object *obj);
+lib.eolian_object_namespaces_get.argtypes = (c_void_p,)
+lib.eolian_object_namespaces_get.restype = c_void_p
+
+### Eolian_Class ############################################################
# EAPI Eolian_Class_Type eolian_class_type_get(const Eolian_Class *klass);
-lib.eolian_class_type_get.argtypes = [c_void_p,]
+lib.eolian_class_type_get.argtypes = (c_void_p,)
lib.eolian_class_type_get.restype = c_int
-# EAPI Eina_Iterator *eolian_all_classes_get(const Eolian_Unit *unit);
-lib.eolian_all_classes_get.argtypes = [c_void_p,]
-lib.eolian_all_classes_get.restype = c_void_p
-
# EAPI const Eolian_Documentation *eolian_class_documentation_get(const Eolian_Class *klass);
-lib.eolian_class_documentation_get.argtypes = [c_void_p,]
+lib.eolian_class_documentation_get.argtypes = (c_void_p,)
lib.eolian_class_documentation_get.restype = c_void_p
# EAPI Eina_Stringshare *eolian_class_legacy_prefix_get(const Eolian_Class *klass);
-lib.eolian_class_legacy_prefix_get.argtypes = [c_void_p,]
+lib.eolian_class_legacy_prefix_get.argtypes = (c_void_p,)
lib.eolian_class_legacy_prefix_get.restype = c_char_p
# EAPI Eina_Stringshare *eolian_class_eo_prefix_get(const Eolian_Class *klass);
-lib.eolian_class_eo_prefix_get.argtypes = [c_void_p,]
+lib.eolian_class_eo_prefix_get.argtypes = (c_void_p,)
lib.eolian_class_eo_prefix_get.restype = c_char_p
# EAPI Eina_Stringshare* eolian_class_event_prefix_get(const Eolian_Class *klass);
-lib.eolian_class_event_prefix_get.argtypes = [c_void_p,]
+lib.eolian_class_event_prefix_get.argtypes = (c_void_p,)
lib.eolian_class_event_prefix_get.restype = c_char_p
# EAPI Eina_Stringshare *eolian_class_data_type_get(const Eolian_Class *klass);
-lib.eolian_class_data_type_get.argtypes = [c_void_p,]
+lib.eolian_class_data_type_get.argtypes = (c_void_p,)
lib.eolian_class_data_type_get.restype = c_char_p
# EAPI Eina_Iterator *eolian_class_inherits_get(const Eolian_Class *klass);
-lib.eolian_class_inherits_get.argtypes = [c_void_p,]
+lib.eolian_class_inherits_get.argtypes = (c_void_p,)
lib.eolian_class_inherits_get.restype = c_void_p
# EAPI Eina_Iterator *eolian_class_functions_get(const Eolian_Class *klass, Eolian_Function_Type func_type);
-lib.eolian_class_functions_get.argtypes = [c_void_p, c_int]
+lib.eolian_class_functions_get.argtypes = (c_void_p, c_int)
lib.eolian_class_functions_get.restype = c_void_p
+# EAPI const Eolian_Function *eolian_class_function_by_name_get(const Eolian_Class *klass, const char *func_name, Eolian_Function_Type f_type);
+lib.eolian_class_function_by_name_get.argtypes = (c_void_p, c_char_p, c_int)
+lib.eolian_class_function_by_name_get.restype = c_void_p
+
+# EAPI Eina_Iterator *eolian_class_implements_get(const Eolian_Class *klass);
+lib.eolian_class_implements_get.argtypes = (c_void_p,)
+lib.eolian_class_implements_get.restype = c_void_p
+
+# EAPI Eina_Iterator *eolian_class_constructors_get(const Eolian_Class *klass);
+lib.eolian_class_constructors_get.argtypes = (c_void_p,)
+lib.eolian_class_constructors_get.restype = c_void_p
+
+# EAPI Eina_Iterator *eolian_class_events_get(const Eolian_Class *klass);
+lib.eolian_class_events_get.argtypes = (c_void_p,)
+lib.eolian_class_events_get.restype = c_void_p
+
+# EAPI Eina_Iterator *eolian_class_parts_get(const Eolian_Class *klass);
+lib.eolian_class_parts_get.argtypes = (c_void_p,)
+lib.eolian_class_parts_get.restype = c_void_p
+
+# EAPI const Eolian_Event *eolian_class_event_by_name_get(const Eolian_Class *klass, const char *event_name);
+lib.eolian_class_event_by_name_get.argtypes = (c_void_p, c_char_p)
+lib.eolian_class_event_by_name_get.restype = c_void_p
+
+# EAPI Eina_Bool eolian_class_ctor_enable_get(const Eolian_Class *klass);
+lib.eolian_class_ctor_enable_get.argtypes = (c_void_p,)
+lib.eolian_class_ctor_enable_get.restype = c_bool
+
+# EAPI Eina_Bool eolian_class_dtor_enable_get(const Eolian_Class *klass);
+lib.eolian_class_dtor_enable_get.argtypes = (c_void_p,)
+lib.eolian_class_dtor_enable_get.restype = c_bool
+
+# EAPI Eina_Stringshare *eolian_class_c_get_function_name_get(const Eolian_Class *klass);
+lib.eolian_class_c_get_function_name_get.argtypes = (c_void_p,)
+lib.eolian_class_c_get_function_name_get.restype = c_void_p # Stringshare TO BE FREED
+
+# EAPI Eina_Stringshare *eolian_class_c_name_get(const Eolian_Class *klass);
+lib.eolian_class_c_name_get.argtypes = (c_void_p,)
+lib.eolian_class_c_name_get.restype = c_void_p # Stringshare TO BE FREED
+
+# EAPI Eina_Stringshare *eolian_class_c_data_type_get(const Eolian_Class *klass);
+lib.eolian_class_c_data_type_get.argtypes = (c_void_p,)
+lib.eolian_class_c_data_type_get.restype = c_void_p # Stringshare TO BE FREED
+
+### Eolian_Function #########################################################
+
# EAPI Eolian_Function_Type eolian_function_type_get(const Eolian_Function *function_id);
-lib.eolian_function_type_get.argtypes = [c_void_p,]
+lib.eolian_function_type_get.argtypes = (c_void_p,)
lib.eolian_function_type_get.restype = c_int
# EAPI Eolian_Object_Scope eolian_function_scope_get(const Eolian_Function *function_id, Eolian_Function_Type ftype);
-lib.eolian_function_scope_get.argtypes = [c_void_p, c_int]
+lib.eolian_function_scope_get.argtypes = (c_void_p, c_int)
lib.eolian_function_scope_get.restype = c_int
-# EAPI Eina_Stringshare *eolian_function_name_get(const Eolian_Function *function_id);
-lib.eolian_function_name_get.argtypes = [c_void_p,]
-lib.eolian_function_name_get.restype = c_char_p
-
# EAPI Eina_Stringshare *eolian_function_full_c_name_get(const Eolian_Function *function_id, Eolian_Function_Type ftype, Eina_Bool use_legacy);
-lib.eolian_function_full_c_name_get.argtypes = [c_void_p, c_int, c_bool]
+lib.eolian_function_full_c_name_get.argtypes = (c_void_p, c_int, c_bool)
lib.eolian_function_full_c_name_get.restype = c_void_p # Stringshare TO BE FREED
-# EAPI const Eolian_Function *eolian_class_function_get_by_name(const Eolian_Class *klass, const char *func_name, Eolian_Function_Type f_type);
-lib.eolian_class_function_get_by_name.argtypes = [c_void_p, c_char_p, c_int]
-lib.eolian_class_function_get_by_name.restype = c_void_p
-
# EAPI Eina_Stringshare *eolian_function_legacy_get(const Eolian_Function *function_id, Eolian_Function_Type f_type);
-lib.eolian_function_legacy_get.argtypes = [c_void_p, c_int]
+lib.eolian_function_legacy_get.argtypes = (c_void_p, c_int)
lib.eolian_function_legacy_get.restype = c_char_p
# EAPI const Eolian_Implement *eolian_function_implement_get(const Eolian_Function *function_id);
-lib.eolian_function_implement_get.argtypes = [c_void_p,]
+lib.eolian_function_implement_get.argtypes = (c_void_p,)
lib.eolian_function_implement_get.restype = c_void_p
# EAPI Eina_Bool eolian_function_is_legacy_only(const Eolian_Function *function_id, Eolian_Function_Type ftype);
-lib.eolian_function_is_legacy_only.argtypes = [c_void_p, c_int]
+lib.eolian_function_is_legacy_only.argtypes = (c_void_p, c_int)
lib.eolian_function_is_legacy_only.restype = c_bool
# EAPI Eina_Bool eolian_function_is_class(const Eolian_Function *function_id);
-lib.eolian_function_is_class.argtypes = [c_void_p,]
+lib.eolian_function_is_class.argtypes = (c_void_p,)
lib.eolian_function_is_class.restype = c_bool
# EAPI Eina_Bool eolian_function_is_beta(const Eolian_Function *function_id);
-lib.eolian_function_is_beta.argtypes = [c_void_p,]
+lib.eolian_function_is_beta.argtypes = (c_void_p,)
lib.eolian_function_is_beta.restype = c_bool
# EAPI Eina_Bool eolian_function_is_constructor(const Eolian_Function *function_id, const Eolian_Class *klass);
-lib.eolian_function_is_constructor.argtypes = [c_void_p,c_void_p,]
+lib.eolian_function_is_constructor.argtypes = (c_void_p,c_void_p,)
lib.eolian_function_is_constructor.restype = c_bool
+# EAPI const Eolian_Type *eolian_function_return_type_get(const Eolian_Function *function_id, Eolian_Function_Type ftype);
+lib.eolian_function_return_type_get.argtypes = (c_void_p, c_int)
+lib.eolian_function_return_type_get.restype = c_void_p
+
+# EAPI const Eolian_Expression * eolian_function_return_default_value_get(const Eolian_Function *foo_id, Eolian_Function_Type ftype);
+lib.eolian_function_return_default_value_get.argtypes = (c_void_p, c_int)
+lib.eolian_function_return_default_value_get.restype = c_void_p
+
+# EAPI const Eolian_Documentation *eolian_function_return_documentation_get(const Eolian_Function *foo_id, Eolian_Function_Type ftype);
+lib.eolian_function_return_documentation_get.argtypes = (c_void_p, c_int)
+lib.eolian_function_return_documentation_get.restype = c_void_p
+
+# EAPI Eina_Bool eolian_function_return_is_warn_unused(const Eolian_Function *foo_id, Eolian_Function_Type ftype);
+lib.eolian_function_return_is_warn_unused.argtypes = (c_void_p, c_int)
+lib.eolian_function_return_is_warn_unused.restype = c_bool
+
+# EAPI Eina_Bool eolian_function_object_is_const(const Eolian_Function *function_id);
+lib.eolian_function_object_is_const.argtypes = (c_void_p,)
+lib.eolian_function_object_is_const.restype = c_bool
+
+# EAPI const Eolian_Class *eolian_function_class_get(const Eolian_Function *function_id);
+lib.eolian_function_class_get.argtypes = (c_void_p,)
+lib.eolian_function_class_get.restype = c_void_p
+
# TODO FIXME
# EAPI Eina_Bool eolian_function_is_function_pointer(const Eolian_Function *function_id);
-# lib.eolian_function_is_function_pointer.argtypes = [c_void_p,]
+# lib.eolian_function_is_function_pointer.argtypes = (c_void_p,)
# lib.eolian_function_is_function_pointer.restype = c_bool
# EAPI Eina_Iterator *eolian_function_parameters_get(const Eolian_Function *function_id);
-lib.eolian_function_parameters_get.argtypes = [c_void_p,]
+lib.eolian_function_parameters_get.argtypes = (c_void_p,)
lib.eolian_function_parameters_get.restype = c_void_p
# EAPI Eina_Iterator *eolian_property_keys_get(const Eolian_Function *foo_id, Eolian_Function_Type ftype);
-lib.eolian_property_keys_get.argtypes = [c_void_p, c_int]
+lib.eolian_property_keys_get.argtypes = (c_void_p, c_int)
lib.eolian_property_keys_get.restype = c_void_p
# EAPI Eina_Iterator *eolian_property_values_get(const Eolian_Function *foo_id, Eolian_Function_Type ftype);
-lib.eolian_property_values_get.argtypes = [c_void_p, c_int]
+lib.eolian_property_values_get.argtypes = (c_void_p, c_int)
lib.eolian_property_values_get.restype = c_void_p
+### Eolian_Function_Parameter ###############################################
+
# EAPI Eolian_Parameter_Dir eolian_parameter_direction_get(const Eolian_Function_Parameter *param);
-lib.eolian_parameter_direction_get.argtypes = [c_void_p,]
+lib.eolian_parameter_direction_get.argtypes = (c_void_p,)
lib.eolian_parameter_direction_get.restype = c_int
# EAPI const Eolian_Type *eolian_parameter_type_get(const Eolian_Function_Parameter *param);
-lib.eolian_parameter_type_get.argtypes = [c_void_p,]
+lib.eolian_parameter_type_get.argtypes = (c_void_p,)
lib.eolian_parameter_type_get.restype = c_void_p
# EAPI const Eolian_Expression *eolian_parameter_default_value_get(const Eolian_Function_Parameter *param);
-lib.eolian_parameter_default_value_get.argtypes = [c_void_p,]
+lib.eolian_parameter_default_value_get.argtypes = (c_void_p,)
lib.eolian_parameter_default_value_get.restype = c_void_p
-# EAPI Eina_Stringshare *eolian_parameter_name_get(const Eolian_Function_Parameter *param);
-lib.eolian_parameter_name_get.argtypes = [c_void_p,]
-lib.eolian_parameter_name_get.restype = c_char_p
-
# EAPI const Eolian_Documentation *eolian_parameter_documentation_get(const Eolian_Function_Parameter *param);
-lib.eolian_parameter_documentation_get.argtypes = [c_void_p,]
+lib.eolian_parameter_documentation_get.argtypes = (c_void_p,)
lib.eolian_parameter_documentation_get.restype = c_void_p
# EAPI Eina_Bool eolian_parameter_is_nonull(const Eolian_Function_Parameter *param_desc);
-lib.eolian_parameter_is_nonull.argtypes = [c_void_p,]
+lib.eolian_parameter_is_nonull.argtypes = (c_void_p,)
lib.eolian_parameter_is_nonull.restype = c_bool
# EAPI Eina_Bool eolian_parameter_is_nullable(const Eolian_Function_Parameter *param_desc);
-lib.eolian_parameter_is_nullable.argtypes = [c_void_p,]
+lib.eolian_parameter_is_nullable.argtypes = (c_void_p,)
lib.eolian_parameter_is_nullable.restype = c_bool
# EAPI Eina_Bool eolian_parameter_is_optional(const Eolian_Function_Parameter *param_desc);
-lib.eolian_parameter_is_optional.argtypes = [c_void_p,]
+lib.eolian_parameter_is_optional.argtypes = (c_void_p,)
lib.eolian_parameter_is_optional.restype = c_bool
-# EAPI const Eolian_Type *eolian_function_return_type_get(const Eolian_Function *function_id, Eolian_Function_Type ftype);
-lib.eolian_function_return_type_get.argtypes = [c_void_p, c_int]
-lib.eolian_function_return_type_get.restype = c_void_p
-
-# EAPI const Eolian_Expression * eolian_function_return_default_value_get(const Eolian_Function *foo_id, Eolian_Function_Type ftype);
-lib.eolian_function_return_default_value_get.argtypes = [c_void_p, c_int]
-lib.eolian_function_return_default_value_get.restype = c_void_p
-
-# EAPI const Eolian_Documentation *eolian_function_return_documentation_get(const Eolian_Function *foo_id, Eolian_Function_Type ftype);
-lib.eolian_function_return_documentation_get.argtypes = [c_void_p, c_int]
-lib.eolian_function_return_documentation_get.restype = c_void_p
-
-# EAPI Eina_Bool eolian_function_return_is_warn_unused(const Eolian_Function *foo_id, Eolian_Function_Type ftype);
-lib.eolian_function_return_is_warn_unused.argtypes = [c_void_p, c_int]
-lib.eolian_function_return_is_warn_unused.restype = c_bool
-
-# EAPI Eina_Bool eolian_function_object_is_const(const Eolian_Function *function_id);
-lib.eolian_function_object_is_const.argtypes = [c_void_p,]
-lib.eolian_function_object_is_const.restype = c_bool
-
-# EAPI const Eolian_Class *eolian_function_class_get(const Eolian_Function *function_id);
-lib.eolian_function_class_get.argtypes = [c_void_p,]
-lib.eolian_function_class_get.restype = c_void_p
-
-# EAPI Eina_Stringshare *eolian_implement_full_name_get(const Eolian_Implement *impl);
-lib.eolian_implement_full_name_get.argtypes = [c_void_p,]
-lib.eolian_implement_full_name_get.restype = c_char_p
+### Eolian_Implement ########################################################
# EAPI const Eolian_Class *eolian_implement_class_get(const Eolian_Implement *impl);
-lib.eolian_implement_class_get.argtypes = [c_void_p,]
+lib.eolian_implement_class_get.argtypes = (c_void_p,)
lib.eolian_implement_class_get.restype = c_void_p
# EAPI const Eolian_Function *eolian_implement_function_get(const Eolian_Implement *impl, Eolian_Function_Type *func_type);
-lib.eolian_implement_function_get.argtypes = [c_void_p, c_void_p]
+lib.eolian_implement_function_get.argtypes = (c_void_p, c_void_p)
lib.eolian_implement_function_get.restype = c_void_p
# EAPI const Eolian_Documentation *eolian_implement_documentation_get(const Eolian_Implement *impl, Eolian_Function_Type f_type);
-lib.eolian_implement_documentation_get.argtypes = [c_void_p, c_int]
+lib.eolian_implement_documentation_get.argtypes = (c_void_p, c_int)
lib.eolian_implement_documentation_get.restype = c_void_p
# EAPI Eina_Bool eolian_implement_is_auto(const Eolian_Implement *impl, Eolian_Function_Type f_type);
-lib.eolian_implement_is_auto.argtypes = [c_void_p, c_int]
+lib.eolian_implement_is_auto.argtypes = (c_void_p, c_int)
lib.eolian_implement_is_auto.restype = c_bool
# EAPI Eina_Bool eolian_implement_is_empty(const Eolian_Implement *impl, Eolian_Function_Type f_type);
-lib.eolian_implement_is_empty.argtypes = [c_void_p, c_int]
+lib.eolian_implement_is_empty.argtypes = (c_void_p, c_int)
lib.eolian_implement_is_empty.restype = c_bool
# EAPI Eina_Bool eolian_implement_is_pure_virtual(const Eolian_Implement *impl, Eolian_Function_Type f_type);
-lib.eolian_implement_is_pure_virtual.argtypes = [c_void_p, c_int]
+lib.eolian_implement_is_pure_virtual.argtypes = (c_void_p, c_int)
lib.eolian_implement_is_pure_virtual.restype = c_bool
# EAPI Eina_Bool eolian_implement_is_prop_get(const Eolian_Implement *impl);
-lib.eolian_implement_is_prop_get.argtypes = [c_void_p,]
+lib.eolian_implement_is_prop_get.argtypes = (c_void_p,)
lib.eolian_implement_is_prop_get.restype = c_bool
# EAPI Eina_Bool eolian_implement_is_prop_set(const Eolian_Implement *impl);
-lib.eolian_implement_is_prop_set.argtypes = [c_void_p,]
+lib.eolian_implement_is_prop_set.argtypes = (c_void_p,)
lib.eolian_implement_is_prop_set.restype = c_bool
-# EAPI Eina_Iterator *eolian_class_implements_get(const Eolian_Class *klass);
-lib.eolian_class_implements_get.argtypes = [c_void_p,]
-lib.eolian_class_implements_get.restype = c_void_p
-
-# EAPI Eina_Stringshare *eolian_constructor_full_name_get(const Eolian_Constructor *ctor);
-lib.eolian_constructor_full_name_get.argtypes = [c_void_p,]
-lib.eolian_constructor_full_name_get.restype = c_char_p
+### Eolian_Constructor ######################################################
# EAPI const Eolian_Class *eolian_constructor_class_get(const Eolian_Constructor *ctor);
-lib.eolian_constructor_class_get.argtypes = [c_void_p,]
+lib.eolian_constructor_class_get.argtypes = (c_void_p,)
lib.eolian_constructor_class_get.restype = c_void_p
# EAPI const Eolian_Function *eolian_constructor_function_get(const Eolian_Constructor *ctor);
-lib.eolian_constructor_function_get.argtypes = [c_void_p,]
+lib.eolian_constructor_function_get.argtypes = (c_void_p,)
lib.eolian_constructor_function_get.restype = c_void_p
# EAPI Eina_Bool eolian_constructor_is_optional(const Eolian_Constructor *ctor);
-lib.eolian_constructor_is_optional.argtypes = [c_void_p,]
+lib.eolian_constructor_is_optional.argtypes = (c_void_p,)
lib.eolian_constructor_is_optional.restype = c_bool
-# EAPI Eina_Iterator *eolian_class_constructors_get(const Eolian_Class *klass);
-lib.eolian_class_constructors_get.argtypes = [c_void_p,]
-lib.eolian_class_constructors_get.restype = c_void_p
-
-# EAPI Eina_Iterator *eolian_class_events_get(const Eolian_Class *klass);
-lib.eolian_class_events_get.argtypes = [c_void_p,]
-lib.eolian_class_events_get.restype = c_void_p
+### Eolian_Event ############################################################
-# EAPI Eina_Stringshare *eolian_event_name_get(const Eolian_Event *event);
-lib.eolian_event_name_get.argtypes = [c_void_p,]
-lib.eolian_event_name_get.restype = c_char_p
+# EAPI Eina_Stringshare *eolian_event_c_name_get(const Eolian_Event *event);
+lib.eolian_event_c_name_get.argtypes = (c_void_p,)
+lib.eolian_event_c_name_get.restype = c_void_p # Stringshare TO BE FREED
# EAPI const Eolian_Type *eolian_event_type_get(const Eolian_Event *event);
-lib.eolian_event_type_get.argtypes = [c_void_p,]
+lib.eolian_event_type_get.argtypes = (c_void_p,)
lib.eolian_event_type_get.restype = c_void_p
# EAPI const Eolian_Documentation *eolian_event_documentation_get(const Eolian_Event *event);
-lib.eolian_event_documentation_get.argtypes = [c_void_p,]
+lib.eolian_event_documentation_get.argtypes = (c_void_p,)
lib.eolian_event_documentation_get.restype = c_void_p
# EAPI Eolian_Object_Scope eolian_event_scope_get(const Eolian_Event *event);
-lib.eolian_event_scope_get.argtypes = [c_void_p,]
+lib.eolian_event_scope_get.argtypes = (c_void_p,)
lib.eolian_event_scope_get.restype = c_int
# EAPI Eina_Bool eolian_event_is_beta(const Eolian_Event *event);
-lib.eolian_event_is_beta.argtypes = [c_void_p,]
+lib.eolian_event_is_beta.argtypes = (c_void_p,)
lib.eolian_event_is_beta.restype = c_bool
# EAPI Eina_Bool eolian_event_is_hot(const Eolian_Event *event);
-lib.eolian_event_is_hot.argtypes = [c_void_p,]
+lib.eolian_event_is_hot.argtypes = (c_void_p,)
lib.eolian_event_is_hot.restype = c_bool
# EAPI Eina_Bool eolian_event_is_restart(const Eolian_Event *event);
-lib.eolian_event_is_restart.argtypes = [c_void_p,]
+lib.eolian_event_is_restart.argtypes = (c_void_p,)
lib.eolian_event_is_restart.restype = c_bool
-# EAPI Eina_Iterator *eolian_class_parts_get(const Eolian_Class *klass);
-lib.eolian_class_parts_get.argtypes = [c_void_p,]
-lib.eolian_class_parts_get.restype = c_void_p
-
-# EAPI Eina_Stringshare *eolian_part_name_get(const Eolian_Part *part);
-lib.eolian_part_name_get.argtypes = [c_void_p,]
-lib.eolian_part_name_get.restype = c_char_p
+### Eolian_Part #############################################################
# EAPI const Eolian_Class *eolian_part_class_get(const Eolian_Part *part);
-lib.eolian_part_class_get.argtypes = [c_void_p,]
+lib.eolian_part_class_get.argtypes = (c_void_p,)
lib.eolian_part_class_get.restype = c_void_p
# EAPI const Eolian_Documentation *eolian_part_documentation_get(const Eolian_Part *part);
-lib.eolian_part_documentation_get.argtypes = [c_void_p,]
+lib.eolian_part_documentation_get.argtypes = (c_void_p,)
lib.eolian_part_documentation_get.restype = c_void_p
-# EAPI Eina_Stringshare *eolian_event_c_name_get(const Eolian_Event *event);
-lib.eolian_event_c_name_get.argtypes = [c_void_p,]
-lib.eolian_event_c_name_get.restype = c_void_p # Stringshare TO BE FREED
-
-# EAPI const Eolian_Event *eolian_class_event_get_by_name(const Eolian_Class *klass, const char *event_name);
-lib.eolian_class_event_get_by_name.argtypes = [c_void_p, c_char_p]
-lib.eolian_class_event_get_by_name.restype = c_void_p
-
-# EAPI Eina_Bool eolian_class_ctor_enable_get(const Eolian_Class *klass);
-lib.eolian_class_ctor_enable_get.argtypes = [c_void_p,]
-lib.eolian_class_ctor_enable_get.restype = c_bool
-
-# EAPI Eina_Bool eolian_class_dtor_enable_get(const Eolian_Class *klass);
-lib.eolian_class_dtor_enable_get.argtypes = [c_void_p,]
-lib.eolian_class_dtor_enable_get.restype = c_bool
-
-# EAPI Eina_Stringshare *eolian_class_c_get_function_name_get(const Eolian_Class *klass);
-lib.eolian_class_c_get_function_name_get.argtypes = [c_void_p,]
-lib.eolian_class_c_get_function_name_get.restype = c_void_p # Stringshare TO BE FREED
-
-# EAPI Eina_Stringshare *eolian_class_c_name_get(const Eolian_Class *klass);
-lib.eolian_class_c_name_get.argtypes = [c_void_p,]
-lib.eolian_class_c_name_get.restype = c_void_p # Stringshare TO BE FREED
-
-# EAPI Eina_Stringshare *eolian_class_c_data_type_get(const Eolian_Class *klass);
-lib.eolian_class_c_data_type_get.argtypes = [c_void_p,]
-lib.eolian_class_c_data_type_get.restype = c_void_p # Stringshare TO BE FREED
-
-# EAPI const Eolian_Typedecl *eolian_typedecl_alias_get_by_name(const Eolian_Unit *unit, const char *name);
-lib.eolian_typedecl_alias_get_by_name.argtypes = [c_void_p, c_char_p]
-lib.eolian_typedecl_alias_get_by_name.restype = c_void_p
-
-# EAPI const Eolian_Typedecl *eolian_typedecl_struct_get_by_name(const Eolian_Unit *unit, const char *name);
-lib.eolian_typedecl_struct_get_by_name.argtypes = [c_void_p, c_char_p]
-lib.eolian_typedecl_struct_get_by_name.restype = c_void_p
-
-# EAPI const Eolian_Typedecl *eolian_typedecl_enum_get_by_name(const Eolian_Unit *unit, const char *name);
-lib.eolian_typedecl_enum_get_by_name.argtypes = [c_void_p, c_char_p]
-lib.eolian_typedecl_enum_get_by_name.restype = c_void_p
-
-# EAPI Eina_Iterator *eolian_typedecl_aliases_get_by_file(const Eolian_Unit *unit, const char *fname);
-lib.eolian_typedecl_aliases_get_by_file.argtypes = [c_void_p, c_char_p]
-lib.eolian_typedecl_aliases_get_by_file.restype = c_void_p
-
-# EAPI Eina_Iterator *eolian_typedecl_structs_get_by_file(const Eolian_Unit *unit, const char *fname);
-lib.eolian_typedecl_structs_get_by_file.argtypes = [c_void_p, c_char_p]
-lib.eolian_typedecl_structs_get_by_file.restype = c_void_p
-
-# EAPI Eina_Iterator *eolian_typedecl_enums_get_by_file(const Eolian_Unit *unit, const char *fname);
-lib.eolian_typedecl_enums_get_by_file.argtypes = [c_void_p, c_char_p]
-lib.eolian_typedecl_enums_get_by_file.restype = c_void_p
-
-# EAPI Eina_Iterator *eolian_typedecl_all_aliases_get(const Eolian_Unit *unit);
-lib.eolian_typedecl_all_aliases_get.argtypes = [c_void_p,]
-lib.eolian_typedecl_all_aliases_get.restype = c_void_p
-
-# EAPI Eina_Iterator *eolian_typedecl_all_structs_get(const Eolian_Unit *unit);
-lib.eolian_typedecl_all_structs_get.argtypes = [c_void_p,]
-lib.eolian_typedecl_all_structs_get.restype = c_void_p
-
-# EAPI Eina_Iterator *eolian_typedecl_all_enums_get(const Eolian_Unit *unit);
-lib.eolian_typedecl_all_enums_get.argtypes = [c_void_p,]
-lib.eolian_typedecl_all_enums_get.restype = c_void_p
+### Eolian_Typedecl #########################################################
# EAPI Eolian_Typedecl_Type eolian_typedecl_type_get(const Eolian_Typedecl *tp);
-lib.eolian_typedecl_type_get.argtypes = [c_void_p,]
+lib.eolian_typedecl_type_get.argtypes = (c_void_p,)
lib.eolian_typedecl_type_get.restype = c_int
# EAPI Eina_Iterator *eolian_typedecl_struct_fields_get(const Eolian_Typedecl *tp);
-lib.eolian_typedecl_struct_fields_get.argtypes = [c_void_p,]
+lib.eolian_typedecl_struct_fields_get.argtypes = (c_void_p,)
lib.eolian_typedecl_struct_fields_get.restype = c_void_p
# EAPI const Eolian_Struct_Type_Field *eolian_typedecl_struct_field_get(const Eolian_Typedecl *tp, const char *field);
-lib.eolian_typedecl_struct_field_get.argtypes = [c_void_p, c_char_p]
+lib.eolian_typedecl_struct_field_get.argtypes = (c_void_p, c_char_p)
lib.eolian_typedecl_struct_field_get.restype = c_void_p
-# EAPI Eina_Stringshare *eolian_typedecl_struct_field_name_get(const Eolian_Struct_Type_Field *fl);
-lib.eolian_typedecl_struct_field_name_get.argtypes = [c_void_p,]
-lib.eolian_typedecl_struct_field_name_get.restype = c_char_p
-
# EAPI const Eolian_Documentation *eolian_typedecl_struct_field_documentation_get(const Eolian_Struct_Type_Field *fl);
-lib.eolian_typedecl_struct_field_documentation_get.argtypes = [c_void_p,]
+lib.eolian_typedecl_struct_field_documentation_get.argtypes = (c_void_p,)
lib.eolian_typedecl_struct_field_documentation_get.restype = c_void_p
# EAPI const Eolian_Type *eolian_typedecl_struct_field_type_get(const Eolian_Struct_Type_Field *fl);
-lib.eolian_typedecl_struct_field_type_get.argtypes = [c_void_p,]
+lib.eolian_typedecl_struct_field_type_get.argtypes = (c_void_p,)
lib.eolian_typedecl_struct_field_type_get.restype = c_void_p
# EAPI Eina_Iterator *eolian_typedecl_enum_fields_get(const Eolian_Typedecl *tp);
-lib.eolian_typedecl_enum_fields_get.argtypes = [c_void_p,]
+lib.eolian_typedecl_enum_fields_get.argtypes = (c_void_p,)
lib.eolian_typedecl_enum_fields_get.restype = c_void_p
# EAPI const Eolian_Enum_Type_Field *eolian_typedecl_enum_field_get(const Eolian_Typedecl *tp, const char *field);
-lib.eolian_typedecl_enum_field_get.argtypes = [c_void_p, c_char_p]
+lib.eolian_typedecl_enum_field_get.argtypes = (c_void_p, c_char_p)
lib.eolian_typedecl_enum_field_get.restype = c_void_p
-# EAPI Eina_Stringshare *eolian_typedecl_enum_field_name_get(const Eolian_Enum_Type_Field *fl);
-lib.eolian_typedecl_enum_field_name_get.argtypes = [c_void_p,]
-lib.eolian_typedecl_enum_field_name_get.restype = c_char_p
-
# EAPI Eina_Stringshare *eolian_typedecl_enum_field_c_name_get(const Eolian_Enum_Type_Field *fl);
-lib.eolian_typedecl_enum_field_c_name_get.argtypes = [c_void_p,]
+lib.eolian_typedecl_enum_field_c_name_get.argtypes = (c_void_p,)
lib.eolian_typedecl_enum_field_c_name_get.restype = c_void_p # Stringshare TO BE FREED
# EAPI const Eolian_Documentation *eolian_typedecl_enum_field_documentation_get(const Eolian_Enum_Type_Field *fl);
-lib.eolian_typedecl_enum_field_documentation_get.argtypes = [c_void_p,]
+lib.eolian_typedecl_enum_field_documentation_get.argtypes = (c_void_p,)
lib.eolian_typedecl_enum_field_documentation_get.restype = c_void_p
# EAPI const Eolian_Expression *eolian_typedecl_enum_field_value_get(const Eolian_Enum_Type_Field *fl, Eina_Bool force);
-lib.eolian_typedecl_enum_field_value_get.argtypes = [c_void_p, c_bool]
+lib.eolian_typedecl_enum_field_value_get.argtypes = (c_void_p, c_bool)
lib.eolian_typedecl_enum_field_value_get.restype = c_void_p
# EAPI Eina_Stringshare *eolian_typedecl_enum_legacy_prefix_get(const Eolian_Typedecl *tp);
-lib.eolian_typedecl_enum_legacy_prefix_get.argtypes = [c_void_p,]
+lib.eolian_typedecl_enum_legacy_prefix_get.argtypes = (c_void_p,)
lib.eolian_typedecl_enum_legacy_prefix_get.restype = c_char_p
# EAPI const Eolian_Documentation *eolian_typedecl_documentation_get(const Eolian_Typedecl *tp);
-lib.eolian_typedecl_documentation_get.argtypes = [c_void_p,]
+lib.eolian_typedecl_documentation_get.argtypes = (c_void_p,)
lib.eolian_typedecl_documentation_get.restype = c_void_p
-# EAPI Eina_Stringshare *eolian_typedecl_file_get(const Eolian_Typedecl *tp);
-lib.eolian_typedecl_file_get.argtypes = [c_void_p,]
-lib.eolian_typedecl_file_get.restype = c_char_p
-
# EAPI const Eolian_Type *eolian_typedecl_base_type_get(const Eolian_Typedecl *tp);
-lib.eolian_typedecl_base_type_get.argtypes = [c_void_p,]
+lib.eolian_typedecl_base_type_get.argtypes = (c_void_p,)
lib.eolian_typedecl_base_type_get.restype = c_void_p
-# TODO FIXME STRANGE API (need Eolian_Unit*)
-# EAPI const Eolian_Type *eolian_typedecl_aliased_base_get(const Eolian_Unit *unit, const Eolian_Typedecl *tp);
-# lib.eolian_typedecl_aliased_base_get.argtypes = [c_void_p, c_void_p,]
-# lib.eolian_typedecl_aliased_base_get.restype = c_void_p
+# EAPI const Eolian_Type *eolian_typedecl_aliased_base_get(const Eolian_Typedecl *tp);
+lib.eolian_typedecl_aliased_base_get.argtypes = (c_void_p,)
+lib.eolian_typedecl_aliased_base_get.restype = c_void_p
# EAPI Eina_Bool eolian_typedecl_is_extern(const Eolian_Typedecl *tp);
-lib.eolian_typedecl_is_extern.argtypes = [c_void_p,]
+lib.eolian_typedecl_is_extern.argtypes = (c_void_p,)
lib.eolian_typedecl_is_extern.restype = c_bool
-# TODO FIXME STRANGE API (need Eolian_Unit*)
-# EAPI Eina_Stringshare *eolian_typedecl_c_type_get(const Eolian_Unit *unit, const Eolian_Typedecl *tp);
-# lib.eolian_typedecl_c_type_get.argtypes = [c_void_p,]
-# lib.eolian_typedecl_c_type_get.restype = None
-
-# EAPI Eina_Stringshare *eolian_typedecl_name_get(const Eolian_Typedecl *tp);
-lib.eolian_typedecl_name_get.argtypes = [c_void_p,]
-lib.eolian_typedecl_name_get.restype = c_char_p
-
-# EAPI Eina_Stringshare *eolian_typedecl_full_name_get(const Eolian_Typedecl *tp);
-lib.eolian_typedecl_full_name_get.argtypes = [c_void_p,]
-lib.eolian_typedecl_full_name_get.restype = c_char_p
-
-# EAPI Eina_Iterator *eolian_typedecl_namespaces_get(const Eolian_Typedecl *tp);
-lib.eolian_typedecl_namespaces_get.argtypes = [c_void_p,]
-lib.eolian_typedecl_namespaces_get.restype = c_void_p
+# EAPI Eina_Stringshare *eolian_typedecl_c_type_get(const Eolian_Typedecl *tp);
+lib.eolian_typedecl_c_type_get.argtypes = (c_void_p,)
+lib.eolian_typedecl_c_type_get.restype = c_void_p # Stringshare TO BE FREED
# EAPI Eina_Stringshare *eolian_typedecl_free_func_get(const Eolian_Typedecl *tp);
-lib.eolian_typedecl_free_func_get.argtypes = [c_void_p,]
+lib.eolian_typedecl_free_func_get.argtypes = (c_void_p,)
lib.eolian_typedecl_free_func_get.restype = c_char_p
# EAPI const Eolian_Function *eolian_typedecl_function_pointer_get(const Eolian_Typedecl *tp);
-lib.eolian_typedecl_function_pointer_get.argtypes = [c_void_p,]
+lib.eolian_typedecl_function_pointer_get.argtypes = (c_void_p,)
lib.eolian_typedecl_function_pointer_get.restype = c_void_p
+### Eolian_Type #############################################################
+
# EAPI Eolian_Type_Type eolian_type_type_get(const Eolian_Type *tp);
-lib.eolian_type_type_get.argtypes = [c_void_p,]
+lib.eolian_type_type_get.argtypes = (c_void_p,)
lib.eolian_type_type_get.restype = c_int
# EAPI Eolian_Type_Builtin_Type eolian_type_builtin_type_get(const Eolian_Type *tp);
-lib.eolian_type_builtin_type_get.argtypes = [c_void_p,]
+lib.eolian_type_builtin_type_get.argtypes = (c_void_p,)
lib.eolian_type_builtin_type_get.restype = c_int
-# EAPI Eina_Stringshare *eolian_type_file_get(const Eolian_Type *tp);
-lib.eolian_type_file_get.argtypes = [c_void_p,]
-lib.eolian_type_file_get.restype = c_char_p
-
# EAPI const Eolian_Type *eolian_type_base_type_get(const Eolian_Type *tp);
-lib.eolian_type_base_type_get.argtypes = [c_void_p,]
+lib.eolian_type_base_type_get.argtypes = (c_void_p,)
lib.eolian_type_base_type_get.restype = c_void_p
# EAPI const Eolian_Type *eolian_type_next_type_get(const Eolian_Type *tp);
-lib.eolian_type_next_type_get.argtypes = [c_void_p,]
+lib.eolian_type_next_type_get.argtypes = (c_void_p,)
lib.eolian_type_next_type_get.restype = c_void_p
-# TODO FIXME STRANGE API (need Eolian_Unit*)
-# EAPI const Eolian_Typedecl *eolian_type_typedecl_get(const Eolian_Unit *unit, const Eolian_Type *tp);
-# lib.eolian_type_typedecl_get.argtypes = [c_void_p,]
-# lib.eolian_type_typedecl_get.restype = c_void_p
+# EAPI const Eolian_Typedecl *eolian_type_typedecl_get(const Eolian_Type *tp);
+lib.eolian_type_typedecl_get.argtypes = (c_void_p,)
+lib.eolian_type_typedecl_get.restype = c_void_p
-# TODO FIXME STRANGE API (need Eolian_Unit*)
-# EAPI const Eolian_Type *eolian_type_aliased_base_get(const Eolian_Unit *unit, const Eolian_Type *tp);
-# lib.eolian_type_aliased_base_get.argtypes = [c_void_p,]
-# lib.eolian_type_aliased_base_get.restype = c_void_p
+# EAPI const Eolian_Type *eolian_type_aliased_base_get(const Eolian_Type *tp);
+lib.eolian_type_aliased_base_get.argtypes = (c_void_p,)
+lib.eolian_type_aliased_base_get.restype = c_void_p
-# TODO FIXME STRANGE API (need Eolian_Unit*)
-# EAPI const Eolian_Class *eolian_type_class_get(const Eolian_Unit *unit, const Eolian_Type *tp);
-# lib.eolian_type_class_get.argtypes = [c_void_p,]
-# lib.eolian_type_class_get.restype = c_void_p
+# EAPI const Eolian_Class *eolian_type_class_get(const Eolian_Type *tp);
+lib.eolian_type_class_get.argtypes = (c_void_p,)
+lib.eolian_type_class_get.restype = c_void_p
# EAPI Eina_Bool eolian_type_is_owned(const Eolian_Type *tp);
-lib.eolian_type_is_owned.argtypes = [c_void_p,]
+lib.eolian_type_is_owned.argtypes = (c_void_p,)
lib.eolian_type_is_owned.restype = c_bool
# EAPI Eina_Bool eolian_type_is_const(const Eolian_Type *tp);
-lib.eolian_type_is_const.argtypes = [c_void_p,]
+lib.eolian_type_is_const.argtypes = (c_void_p,)
lib.eolian_type_is_const.restype = c_bool
# EAPI Eina_Bool eolian_type_is_ptr(const Eolian_Type *tp);
-lib.eolian_type_is_ptr.argtypes = [c_void_p,]
+lib.eolian_type_is_ptr.argtypes = (c_void_p,)
lib.eolian_type_is_ptr.restype = c_bool
-# TODO FIXME STRANGE API (need Eolian_Unit*)
-# EAPI Eina_Stringshare *eolian_type_c_type_get(const Eolian_Unit *unit, const Eolian_Type *tp, Eolian_C_Type_Type ctype);
-# lib.eolian_type_c_type_get.argtypes = [c_void_p,]
-# lib.eolian_type_c_type_get.restype = c_void_p # Stringshare TO BE FREED
-
-# EAPI Eina_Stringshare *eolian_type_name_get(const Eolian_Type *tp);
-lib.eolian_type_name_get.argtypes = [c_void_p,]
-lib.eolian_type_name_get.restype = c_char_p
-
-# EAPI Eina_Stringshare *eolian_type_full_name_get(const Eolian_Type *tp);
-lib.eolian_type_full_name_get.argtypes = [c_void_p,]
-lib.eolian_type_full_name_get.restype = c_char_p
-
-# EAPI Eina_Iterator *eolian_type_namespaces_get(const Eolian_Type *tp);
-lib.eolian_type_namespaces_get.argtypes = [c_void_p,]
-lib.eolian_type_namespaces_get.restype = c_void_p
+# EAPI Eina_Stringshare *eolian_type_c_type_get(const Eolian_Type *tp, Eolian_C_Type_Type ctype);
+lib.eolian_type_c_type_get.argtypes = (c_void_p, c_int)
+lib.eolian_type_c_type_get.restype = c_void_p # Stringshare TO BE FREED
# EAPI Eina_Stringshare *eolian_type_free_func_get(const Eolian_Type *tp);
-lib.eolian_type_free_func_get.argtypes = [c_void_p,]
+lib.eolian_type_free_func_get.argtypes = (c_void_p,)
lib.eolian_type_free_func_get.restype = c_char_p
+### Eolian_Expression #######################################################
+
# EAPI Eina_Stringshare *eolian_expression_serialize(const Eolian_Expression *expr);
-lib.eolian_expression_serialize.argtypes = [c_void_p,]
+lib.eolian_expression_serialize.argtypes = (c_void_p,)
lib.eolian_expression_serialize.restype = c_void_p # Stringshare TO BE FREED
# EAPI Eolian_Expression_Type eolian_expression_type_get(const Eolian_Expression *expr);
-lib.eolian_expression_type_get.argtypes = [c_void_p,]
+lib.eolian_expression_type_get.argtypes = (c_void_p,)
lib.eolian_expression_type_get.restype = c_int
# EAPI Eolian_Binary_Operator eolian_expression_binary_operator_get(const Eolian_Expression *expr);
-lib.eolian_expression_binary_operator_get.argtypes = [c_void_p,]
+lib.eolian_expression_binary_operator_get.argtypes = (c_void_p,)
lib.eolian_expression_binary_operator_get.restype = c_int
# EAPI const Eolian_Expression *eolian_expression_binary_lhs_get(const Eolian_Expression *expr);
-lib.eolian_expression_binary_lhs_get.argtypes = [c_void_p,]
+lib.eolian_expression_binary_lhs_get.argtypes = (c_void_p,)
lib.eolian_expression_binary_lhs_get.restype = c_void_p
# EAPI const Eolian_Expression *eolian_expression_binary_rhs_get(const Eolian_Expression *expr);
-lib.eolian_expression_binary_rhs_get.argtypes = [c_void_p,]
+lib.eolian_expression_binary_rhs_get.argtypes = (c_void_p,)
lib.eolian_expression_binary_rhs_get.restype = c_void_p
# EAPI Eolian_Unary_Operator eolian_expression_unary_operator_get(const Eolian_Expression *expr);
-lib.eolian_expression_unary_operator_get.argtypes = [c_void_p,]
+lib.eolian_expression_unary_operator_get.argtypes = (c_void_p,)
lib.eolian_expression_unary_operator_get.restype = c_int
# EAPI const Eolian_Expression *eolian_expression_unary_expression_get(const Eolian_Expression *expr);
-lib.eolian_expression_unary_expression_get.argtypes = [c_void_p,]
+lib.eolian_expression_unary_expression_get.argtypes = (c_void_p,)
lib.eolian_expression_unary_expression_get.restype = c_void_p
-# EAPI const Eolian_Variable *eolian_variable_global_get_by_name(const Eolian_Unit *unit, const char *name);
-lib.eolian_variable_global_get_by_name.argtypes = [c_void_p, c_char_p]
-lib.eolian_variable_global_get_by_name.restype = c_void_p
-
-# EAPI const Eolian_Variable *eolian_variable_constant_get_by_name(const Eolian_Unit *unit, const char *name);
-lib.eolian_variable_constant_get_by_name.argtypes = [c_void_p, c_char_p]
-lib.eolian_variable_constant_get_by_name.restype = c_void_p
-
-# EAPI Eina_Iterator *eolian_variable_globals_get_by_file(const Eolian_Unit *unit, const char *fname);
-lib.eolian_variable_globals_get_by_file.argtypes = [c_void_p, c_char_p]
-lib.eolian_variable_globals_get_by_file.restype = c_void_p
-
-# EAPI Eina_Iterator *eolian_variable_constants_get_by_file(const Eolian_Unit *unit, const char *fname);
-lib.eolian_variable_constants_get_by_file.argtypes = [c_void_p, c_char_p]
-lib.eolian_variable_constants_get_by_file.restype = c_void_p
-
-# EAPI Eina_Iterator *eolian_variable_all_constants_get(const Eolian_Unit *unit);
-lib.eolian_variable_all_constants_get.argtypes = [c_void_p,]
-lib.eolian_variable_all_constants_get.restype = c_void_p
-
-# EAPI Eina_Iterator *eolian_variable_all_globals_get(const Eolian_Unit *unit);
-lib.eolian_variable_all_globals_get.argtypes = [c_void_p,]
-lib.eolian_variable_all_globals_get.restype = c_void_p
+### Eolian_Variable #########################################################
# EAPI Eolian_Variable_Type eolian_variable_type_get(const Eolian_Variable *var);
-lib.eolian_variable_type_get.argtypes = [c_void_p,]
+lib.eolian_variable_type_get.argtypes = (c_void_p,)
lib.eolian_variable_type_get.restype = c_int
# EAPI const Eolian_Documentation *eolian_variable_documentation_get(const Eolian_Variable *var);
-lib.eolian_variable_documentation_get.argtypes = [c_void_p,]
+lib.eolian_variable_documentation_get.argtypes = (c_void_p,)
lib.eolian_variable_documentation_get.restype = c_void_p
-# EAPI Eina_Stringshare *eolian_variable_file_get(const Eolian_Variable *var);
-lib.eolian_variable_file_get.argtypes = [c_void_p,]
-lib.eolian_variable_file_get.restype = c_char_p
-
# EAPI const Eolian_Type *eolian_variable_base_type_get(const Eolian_Variable *var);
-lib.eolian_variable_base_type_get.argtypes = [c_void_p,]
+lib.eolian_variable_base_type_get.argtypes = (c_void_p,)
lib.eolian_variable_base_type_get.restype = c_void_p
# EAPI const Eolian_Expression *eolian_variable_value_get(const Eolian_Variable *var);
-lib.eolian_variable_value_get.argtypes = [c_void_p,]
+lib.eolian_variable_value_get.argtypes = (c_void_p,)
lib.eolian_variable_value_get.restype = c_void_p
-# EAPI Eina_Stringshare *eolian_variable_name_get(const Eolian_Variable *var);
-lib.eolian_variable_name_get.argtypes = [c_void_p,]
-lib.eolian_variable_name_get.restype = c_char_p
-
-# EAPI Eina_Stringshare *eolian_variable_full_name_get(const Eolian_Variable *var);
-lib.eolian_variable_full_name_get.argtypes = [c_void_p,]
-lib.eolian_variable_full_name_get.restype = c_char_p
-
-# EAPI Eina_Iterator *eolian_variable_namespaces_get(const Eolian_Variable *var);
-lib.eolian_variable_namespaces_get.argtypes = [c_void_p,]
-lib.eolian_variable_namespaces_get.restype = c_void_p
-
# EAPI Eina_Bool eolian_variable_is_extern(const Eolian_Variable *var);
-lib.eolian_variable_is_extern.argtypes = [c_void_p,]
+lib.eolian_variable_is_extern.argtypes = (c_void_p,)
lib.eolian_variable_is_extern.restype = c_bool
-# EAPI const Eolian_Declaration *eolian_declaration_get_by_name(const Eolian_Unit *unit, const char *name);
-lib.eolian_declaration_get_by_name.argtypes = [c_void_p, c_char_p]
-lib.eolian_declaration_get_by_name.restype = c_void_p
-
-# EAPI Eina_Iterator *eolian_declarations_get_by_file(const Eolian *state, const char *fname);
-lib.eolian_declarations_get_by_file.argtypes = [c_void_p, c_char_p]
-lib.eolian_declarations_get_by_file.restype = c_void_p
-
-# EAPI Eina_Iterator *eolian_all_declarations_get(const Eolian_Unit *unit);
-lib.eolian_all_declarations_get.argtypes = [c_void_p,]
-lib.eolian_all_declarations_get.restype = c_void_p
-
-# EAPI Eolian_Declaration_Type eolian_declaration_type_get(const Eolian_Declaration *decl);
-lib.eolian_declaration_type_get.argtypes = [c_void_p,]
-lib.eolian_declaration_type_get.restype = c_int
-
-# EAPI Eina_Stringshare *eolian_declaration_name_get(const Eolian_Declaration *decl);
-lib.eolian_declaration_name_get.argtypes = [c_void_p,]
-lib.eolian_declaration_name_get.restype = c_char_p
-
-# EAPI const Eolian_Class *eolian_declaration_class_get(const Eolian_Declaration *decl);
-lib.eolian_declaration_class_get.argtypes = [c_void_p,]
-lib.eolian_declaration_class_get.restype = c_void_p
-
-# EAPI const Eolian_Typedecl *eolian_declaration_data_type_get(const Eolian_Declaration *decl);
-lib.eolian_declaration_data_type_get.argtypes = [c_void_p,]
-lib.eolian_declaration_data_type_get.restype = c_void_p
-
-# EAPI const Eolian_Variable *eolian_declaration_variable_get(const Eolian_Declaration *decl);
-lib.eolian_declaration_variable_get.argtypes = [c_void_p,]
-lib.eolian_declaration_variable_get.restype = c_void_p
+### Eolian_Documentation ####################################################
# EAPI Eina_Stringshare *eolian_documentation_summary_get(const Eolian_Documentation *doc);
-lib.eolian_documentation_summary_get.argtypes = [c_void_p,]
+lib.eolian_documentation_summary_get.argtypes = (c_void_p,)
lib.eolian_documentation_summary_get.restype = c_char_p
# EAPI Eina_Stringshare *eolian_documentation_description_get(const Eolian_Documentation *doc);
-lib.eolian_documentation_description_get.argtypes = [c_void_p,]
+lib.eolian_documentation_description_get.argtypes = (c_void_p,)
lib.eolian_documentation_description_get.restype = c_char_p
# EAPI Eina_Stringshare *eolian_documentation_since_get(const Eolian_Documentation *doc);
-lib.eolian_documentation_since_get.argtypes = [c_void_p,]
+lib.eolian_documentation_since_get.argtypes = (c_void_p,)
lib.eolian_documentation_since_get.restype = c_char_p
# NOT IMPLEMENTED
# EAPI Eina_List *eolian_documentation_string_split(const char *doc);
-# lib.eolian_documentation_string_split.argtypes = [c_char_p,]
+# lib.eolian_documentation_string_split.argtypes = (c_char_p,)
# lib.eolian_documentation_string_split.restype = c_void_p
# # EAPI const char *eolian_documentation_tokenize(const char *doc, Eolian_Doc_Token *ret);
-lib.eolian_documentation_tokenize.argtypes = [c_char_p, c_void_p]
+lib.eolian_documentation_tokenize.argtypes = (c_char_p, c_void_p)
lib.eolian_documentation_tokenize.restype = c_void_p # this need to be passed back as char*
# EAPI void eolian_doc_token_init(Eolian_Doc_Token *tok);
-lib.eolian_doc_token_init.argtypes = [c_void_p,]
+lib.eolian_doc_token_init.argtypes = (c_void_p,)
lib.eolian_doc_token_init.restype = None
# EAPI Eolian_Doc_Token_Type eolian_doc_token_type_get(const Eolian_Doc_Token *tok);
-lib.eolian_doc_token_type_get.argtypes = [c_void_p,]
+lib.eolian_doc_token_type_get.argtypes = (c_void_p,)
lib.eolian_doc_token_type_get.restype = c_int
# EAPI char *eolian_doc_token_text_get(const Eolian_Doc_Token *tok);
-lib.eolian_doc_token_text_get.argtypes = [c_void_p,]
+lib.eolian_doc_token_text_get.argtypes = (c_void_p,)
lib.eolian_doc_token_text_get.restype = c_void_p # char* TO BE FREED
-# EAPI Eolian_Doc_Ref_Type eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok, const void **data, const void **data2);
-# lib.eolian_doc_token_ref_get.argtypes = [c_void_p, c_void_p, ???, ???]
-# lib.eolian_doc_token_ref_get.restype = c_int
+# EAPI Eolian_Object_Type eolian_doc_token_ref_resolve(const Eolian_Doc_Token *tok, const Eolian_State *state, const Eolian_Object **data, const Eolian_Object **data2);
+# lib.eolian_doc_token_ref_resolve.argtypes = (c_void_p, c_void_p, ???, ???)
+# lib.eolian_doc_token_ref_resolve.restype = c_int
diff --git a/src/scripts/pyolian/generator.py b/src/scripts/pyolian/generator.py
index c50eead66a..cd4d105858 100755
--- a/src/scripts/pyolian/generator.py
+++ b/src/scripts/pyolian/generator.py
@@ -57,11 +57,11 @@ SCAN_FOLDER = os.path.join(root_path, 'src', 'lib')
# load the whole eolian db
-eolian_db = eolian.Eolian()
-if not isinstance(eolian_db, eolian.Eolian):
+eolian_db = eolian.Eolian_State()
+if not isinstance(eolian_db, eolian.Eolian_State):
raise(RuntimeError('Eolian, failed to create Eolian state'))
-if not eolian_db.directory_scan(SCAN_FOLDER):
+if not eolian_db.directory_add(SCAN_FOLDER):
raise(RuntimeError('Eolian, failed to scan source directory'))
if not eolian_db.all_eot_files_parse():
@@ -112,6 +112,7 @@ class Template(pyratemp.Template):
# 'eolian_version': eolian.__version__,
# 'eolian_version_info': eolian.__version_info__,
# Eolian Classes
+ 'Object': eolian.Object,
'Class': eolian.Class,
'Part': eolian.Part,
'Constructor': eolian.Constructor,
@@ -125,7 +126,6 @@ class Template(pyratemp.Template):
'Struct_Type_Field': eolian.Struct_Type_Field,
'Expression': eolian.Expression,
'Variable': eolian.Variable,
- 'Declaration': eolian.Declaration,
'Documentation': eolian.Documentation,
'Documentation_Token': eolian.Documentation_Token,
# Eolian Enums
@@ -142,9 +142,7 @@ class Template(pyratemp.Template):
'Eolian_Variable_Type': eolian.Eolian_Variable_Type,
'Eolian_Binary_Operator': eolian.Eolian_Binary_Operator,
'Eolian_Unary_Operator': eolian.Eolian_Unary_Operator,
- 'Eolian_Declaration_Type': eolian.Eolian_Declaration_Type,
'Eolian_Doc_Token_Type': eolian.Eolian_Doc_Token_Type,
- 'Eolian_Doc_Ref_Type': eolian.Eolian_Doc_Ref_Type,
})
# Call the parent __init__ func
@@ -163,15 +161,15 @@ class Template(pyratemp.Template):
if kargs:
ctx.update(kargs)
if cls:
- ctx['cls'] = eolian_db.class_get_by_name(cls)
+ ctx['cls'] = eolian_db.class_by_name_get(cls)
if ns:
ctx['namespace'] = eolian_db.namespace_get_by_name(ns)
if struct:
- ctx['struct'] = eolian_db.typedecl_struct_get_by_name(struct)
+ ctx['struct'] = eolian_db.struct_by_name_get(struct)
if enum:
- ctx['enum'] = eolian_db.typedecl_enum_get_by_name(enum)
+ ctx['enum'] = eolian_db.enum_by_name_get(enum)
if alias:
- ctx['alias'] = eolian_db.typedecl_alias_get_by_name(alias)
+ ctx['alias'] = eolian_db.alias_by_name_get(alias)
if verbose and filename:
print("rendering: {} => {}".format(
diff --git a/src/scripts/pyolian/test_eolian.py b/src/scripts/pyolian/test_eolian.py
index 5e43f727a6..34fdbafbdf 100755
--- a/src/scripts/pyolian/test_eolian.py
+++ b/src/scripts/pyolian/test_eolian.py
@@ -20,13 +20,13 @@ root_path = os.path.abspath(os.path.join(script_path, '..', '..', '..'))
SCAN_FOLDER = os.path.join(root_path, 'src', 'lib')
# the main Eolian unit state
-state = None
+eolian_db = None
class TestBaseObject(unittest.TestCase):
def test_base_object_equality(self):
- cls1 = state.class_get_by_name('Efl.Loop.Timer')
- cls2 = state.class_get_by_file('efl_loop_timer.eo')
+ cls1 = eolian_db.class_by_name_get('Efl.Loop.Timer')
+ cls2 = eolian_db.class_by_file_get('efl_loop_timer.eo')
self.assertIsInstance(cls1, eolian.Class)
self.assertIsInstance(cls2, eolian.Class)
self.assertEqual(cls1, cls2)
@@ -37,8 +37,8 @@ class TestBaseObject(unittest.TestCase):
self.assertNotEqual(cls1, None)
self.assertNotEqual(cls1, 0)
- enum1 = state.typedecl_enum_get_by_name('Efl.Ui.Focus.Direction')
- enum2 = state.typedecl_enum_get_by_name('Efl.Ui.Focus.Direction')
+ enum1 = eolian_db.enum_by_name_get('Efl.Ui.Focus.Direction')
+ enum2 = eolian_db.enum_by_name_get('Efl.Ui.Focus.Direction')
self.assertIsInstance(enum1, eolian.Typedecl)
self.assertIsInstance(enum2, eolian.Typedecl)
self.assertEqual(enum1, enum2)
@@ -52,39 +52,104 @@ class TestBaseObject(unittest.TestCase):
self.assertNotEqual(cls1, enum1)
+class TestEolianState(unittest.TestCase):
+ def test_unit_getters(self):
+ count = 0
+ for unit in eolian_db.units:
+ self.assertIsInstance(unit, eolian.Eolian_Unit)
+ self.assertTrue(unit.file.endswith(('.eo', '.eot')))
+ count += 1
+ self.assertGreater(count, 500)
+
+ unit = eolian_db.unit_by_file_get('efl_ui_win.eo')
+ self.assertIsInstance(unit, eolian.Eolian_Unit)
+ self.assertEqual(unit.file, 'efl_ui_win.eo')
+
+ def test_object_getters(self):
+ obj = eolian_db.object_by_name_get('Efl.Ui.Frame')
+ self.assertIsInstance(obj, eolian.Object)
+ self.assertFalse(type(obj) == eolian.Object)
+ self.assertEqual(obj.name, 'Efl.Ui.Frame')
+
+ count = 0
+ for obj in eolian_db.objects:
+ self.assertIsInstance(obj, eolian.Object)
+ self.assertFalse(type(obj) == eolian.Object)
+ count += 1
+ self.assertGreater(count, 800)
+
+ count = 0
+ for obj in eolian_db.objects_by_file_get('efl_loop.eo'):
+ self.assertIsInstance(obj, eolian.Object)
+ self.assertFalse(type(obj) == eolian.Object)
+ count += 1
+ self.assertGreater(count, 1)
+
+
class TestEolianUnit(unittest.TestCase):
+ def test_unit_get(self):
+ unit = eolian_db.unit_by_file_get('efl_ui_win.eo')
+ self.assertIsInstance(unit.state, eolian.Eolian_State)
+ self.assertEqual(unit.state, eolian_db)
+
+ def test_file_get(self):
+ unit = eolian_db.unit_by_file_get('efl_ui_win.eo')
+ self.assertIsInstance(unit, eolian.Eolian_Unit)
+ self.assertEqual(unit.file, 'efl_ui_win.eo')
+
+ def test_children_listing(self):
+ l = list(eolian_db.children)
+ self.assertGreater(len(l), 500)
+ self.assertIsInstance(l[0], eolian.Eolian_Unit)
+
def test_file_listing(self):
- l = list(state.all_eo_file_paths)
+ l = list(eolian_db.eo_file_paths)
self.assertGreater(len(l), 400)
self.assertTrue(l[0].endswith('.eo'))
- l = list(state.all_eo_files)
+ l = list(eolian_db.eo_files)
self.assertGreater(len(l), 400)
self.assertTrue(l[0].endswith('.eo'))
- l = list(state.all_eot_file_paths)
+ l = list(eolian_db.eot_file_paths)
self.assertGreater(len(l), 10)
self.assertTrue(l[0].endswith('.eot'))
-
- l = list(state.all_eot_files)
+
+ l = list(eolian_db.eot_files)
self.assertGreater(len(l), 10)
self.assertTrue(l[0].endswith('.eot'))
+ def test_object_listing(self):
+ unit = eolian_db.unit_by_file_get('efl_ui_win.eo')
+ self.assertIsNone(unit.object_by_name_get('Efl.Ui.Frame'))
+
+ obj = unit.object_by_name_get('Efl.Ui.Win')
+ self.assertIsInstance(obj, eolian.Object)
+ self.assertFalse(type(obj) == eolian.Object)
+ self.assertEqual(obj.name, 'Efl.Ui.Win')
+
+ count = 0
+ for obj in unit.objects:
+ self.assertIsInstance(obj, eolian.Object)
+ self.assertFalse(type(obj) == eolian.Object)
+ count += 1
+ self.assertGreater(count, 5)
+
def test_enum_listing(self):
- l = list(state.typedecl_enums_get_by_file('efl_ui_win.eo'))
+ l = list(eolian_db.enums_by_file_get('efl_ui_win.eo'))
self.assertGreater(len(l), 5)
self.assertIsInstance(l[0], eolian.Typedecl)
self.assertEqual(l[0].type, eolian.Eolian_Typedecl_Type.ENUM)
all_count = 0
- for enum in state.typedecl_all_enums:
+ for enum in eolian_db.enums:
self.assertIsInstance(enum, eolian.Typedecl)
self.assertEqual(enum.type, eolian.Eolian_Typedecl_Type.ENUM)
all_count += 1
self.assertGreater(all_count, 50)
def test_struct_listing(self):
- l = list(state.typedecl_structs_get_by_file('eina_types.eot'))
+ l = list(eolian_db.structs_by_file_get('eina_types.eot'))
self.assertGreater(len(l), 10)
self.assertIsInstance(l[0], eolian.Typedecl)
self.assertIn(l[0].type, (
@@ -92,7 +157,7 @@ class TestEolianUnit(unittest.TestCase):
eolian.Eolian_Typedecl_Type.STRUCT_OPAQUE))
all_count = 0
- for struct in state.typedecl_all_structs:
+ for struct in eolian_db.structs:
self.assertIsInstance(struct, eolian.Typedecl)
self.assertIn(struct.type, (
eolian.Eolian_Typedecl_Type.STRUCT,
@@ -101,12 +166,12 @@ class TestEolianUnit(unittest.TestCase):
self.assertGreater(all_count, 50)
def test_alias_listing(self):
- l = list(state.typedecl_aliases_get_by_file('edje_types.eot'))
+ l = list(eolian_db.aliases_by_file_get('edje_types.eot'))
self.assertGreater(len(l), 5)
self.assertIsInstance(l[0], eolian.Typedecl)
all_count = 0
- for alias in state.typedecl_all_aliases:
+ for alias in eolian_db.aliases:
self.assertIsInstance(alias, eolian.Typedecl)
self.assertIn(alias.type, (
eolian.Eolian_Typedecl_Type.ALIAS,
@@ -115,34 +180,25 @@ class TestEolianUnit(unittest.TestCase):
self.assertGreater(all_count, 10)
def test_variable_listing(self):
- l = list(state.variable_all_constants)
+ l = list(eolian_db.constants)
self.assertGreater(len(l), 2)
self.assertIsInstance(l[0], eolian.Variable)
- l = list(state.variable_all_globals)
+ l = list(eolian_db.globals)
self.assertGreater(len(l), 20)
self.assertIsInstance(l[0], eolian.Variable)
- l = list(state.variable_constants_get_by_file('efl_gfx_stack.eo'))
+ l = list(eolian_db.constants_by_file_get('efl_gfx_stack.eo'))
self.assertGreater(len(l), 1)
self.assertIsInstance(l[0], eolian.Variable)
- l = list(state.variable_globals_get_by_file('efl_net_http_types.eot'))
+ l = list(eolian_db.globals_by_file_get('efl_net_http_types.eot'))
self.assertGreater(len(l), 10)
self.assertIsInstance(l[0], eolian.Variable)
- def test_declaration_listing(self):
- l = list(state.declarations_get_by_file('eina_types.eot'))
- self.assertGreater(len(l), 10)
- self.assertIsInstance(l[0], eolian.Declaration)
-
- l = list(state.all_declarations)
- self.assertGreater(len(l), 100)
- self.assertIsInstance(l[0], eolian.Declaration)
-
def test_class_listing(self):
all_count = 0
- for cls in state.all_classes:
+ for cls in eolian_db.classes:
self.assertIsInstance(cls, eolian.Class)
all_count += 1
self.assertGreater(all_count, 400)
@@ -151,33 +207,33 @@ class TestEolianUnit(unittest.TestCase):
class TestEolianNamespace(unittest.TestCase):
def test_all_namespace(self):
count = 0
- for ns in state.all_namespaces:
+ for ns in eolian_db.all_namespaces:
self.assertIsInstance(ns, eolian.Namespace)
count += 1
self.assertGreater(count, 200)
def test_namespace_equality(self):
- ns1 = eolian.Namespace(state, 'Efl.Io')
- ns2 = eolian.Namespace(state, 'Efl.Net')
+ ns1 = eolian.Namespace(eolian_db, 'Efl.Io')
+ ns2 = eolian.Namespace(eolian_db, 'Efl.Net')
self.assertIsInstance(ns1, eolian.Namespace)
self.assertIsInstance(ns2, eolian.Namespace)
self.assertNotEqual(ns1, ns2)
- self.assertEqual(ns1, eolian.Namespace(state, 'Efl.Io'))
- self.assertEqual(ns2, eolian.Namespace(state, 'Efl.Net'))
+ self.assertEqual(ns1, eolian.Namespace(eolian_db, 'Efl.Io'))
+ self.assertEqual(ns2, eolian.Namespace(eolian_db, 'Efl.Net'))
def test_namespace_sorting(self):
- nspaces = state.all_namespaces
+ nspaces = eolian_db.all_namespaces
nspaces.sort(reverse=True)
self.assertGreater(nspaces[0], nspaces[-1])
self.assertLess(nspaces[1], nspaces[0])
def test_namespace_by_name(self):
- ns = eolian.Namespace(state, 'Efl.Net')
+ ns = eolian.Namespace(eolian_db, 'Efl.Net')
self.assertIsInstance(ns, eolian.Namespace)
self.assertEqual(ns.name, 'Efl.Net')
self.assertEqual(ns.namespaces, ['Efl', 'Net'])
- ns = state.namespace_get_by_name('Efl')
+ ns = eolian_db.namespace_get_by_name('Efl')
self.assertIsInstance(ns, eolian.Namespace)
self.assertEqual(ns.name, 'Efl')
@@ -213,16 +269,50 @@ class TestEolianNamespace(unittest.TestCase):
self.assertEqual(td.type, eolian.Eolian_Typedecl_Type.STRUCT)
+class TestEolianObject(unittest.TestCase):
+ def test_object_instance(self):
+ obj = eolian_db.object_by_name_get('Efl.Ui.Frame')
+ self.assertIsInstance(obj, eolian.Class)
+ self.assertEqual(obj.name, 'Efl.Ui.Frame')
+
+ def test_unit(self):
+ obj = eolian_db.object_by_name_get('Efl.Ui.Frame')
+ self.assertIsInstance(obj.unit, eolian.Eolian_Unit)
+ self.assertEqual(obj.unit.file, 'efl_ui_frame.eo')
+
+ def test_name(self):
+ obj = eolian_db.object_by_name_get('Efl.Ui.Frame')
+ self.assertEqual(obj.name, 'Efl.Ui.Frame')
+
+ def test_short_name(self):
+ obj = eolian_db.object_by_name_get('Efl.Ui.Frame')
+ self.assertEqual(obj.short_name, 'Frame')
+
+ def test_file(self):
+ obj = eolian_db.object_by_name_get('Efl.Ui.Frame')
+ self.assertEqual(obj.file, 'efl_ui_frame.eo')
+
+ def test_line(self):
+ obj = eolian_db.object_by_name_get('Efl.Ui.Frame')
+ self.assertIsInstance(obj.line, int)
+ self.assertGreater(obj.line, 0)
+
+ def test_column(self):
+ obj = eolian_db.object_by_name_get('Efl.Ui.Frame')
+ self.assertIsInstance(obj.column, int)
+ self.assertGreater(obj.column, 0)
+
+
class TestEolianClass(unittest.TestCase):
def test_class(self):
- cls = state.class_get_by_file('efl_loop_timer.eo')
+ cls = eolian_db.class_by_file_get('efl_loop_timer.eo')
self.assertIsInstance(cls, eolian.Class)
- cls = state.class_get_by_name('Efl.Loop.Timer')
+ cls = eolian_db.class_by_name_get('Efl.Loop.Timer')
self.assertIsInstance(cls, eolian.Class)
- self.assertEqual(cls.name, 'Timer')
- self.assertEqual(cls.full_name, 'Efl.Loop.Timer')
+ self.assertEqual(cls.name, 'Efl.Loop.Timer')
+ self.assertEqual(cls.short_name, 'Timer')
self.assertEqual(cls.file, 'efl_loop_timer.eo')
self.assertEqual(list(cls.namespaces), ['Efl', 'Loop'])
self.assertEqual(cls.type, eolian.Eolian_Class_Type.REGULAR)
@@ -231,10 +321,10 @@ class TestEolianClass(unittest.TestCase):
self.assertIsNone(cls.eo_prefix) # TODO fin a class with a value
self.assertIsNone(cls.event_prefix) # TODO same as above
self.assertIsNone(cls.data_type) # TODO same as above
- self.assertEqual(cls.base_class.full_name, 'Efl.Loop.Consumer')
- self.assertEqual([c.full_name for c in cls.inherits], ['Efl.Loop.Consumer'])
- self.assertEqual([c.full_name for c in cls.inherits_full], ['Efl.Loop.Consumer', 'Efl.Object'])
- self.assertEqual([c.full_name for c in cls.hierarchy], ['Efl.Loop.Consumer', 'Efl.Object'])
+ self.assertEqual(cls.base_class.name, 'Efl.Loop.Consumer')
+ self.assertEqual([c.name for c in cls.inherits], ['Efl.Loop.Consumer'])
+ self.assertEqual([c.name for c in cls.inherits_full], ['Efl.Loop.Consumer', 'Efl.Object'])
+ self.assertEqual([c.name for c in cls.hierarchy], ['Efl.Loop.Consumer', 'Efl.Object'])
self.assertFalse(cls.ctor_enable)
self.assertFalse(cls.dtor_enable)
self.assertEqual(cls.c_get_function_name, 'efl_loop_timer_class_get')
@@ -248,8 +338,8 @@ class TestEolianClass(unittest.TestCase):
class TestEolianFunction(unittest.TestCase):
def test_function(self):
- cls = state.class_get_by_name('Efl.Loop.Timer')
- f = cls.function_get_by_name('delay')
+ cls = eolian_db.class_by_name_get('Efl.Loop.Timer')
+ f = cls.function_by_name_get('delay')
self.assertIsInstance(f, eolian.Function)
self.assertEqual(f.name, 'delay')
self.assertEqual(f.type, eolian.Eolian_Function_Type.METHOD)
@@ -264,7 +354,7 @@ class TestEolianFunction(unittest.TestCase):
self.assertEqual(f.full_c_setter_name_legacy, 'ecore_timer_delay_set')
self.assertIsNone(f.method_return_type) # TODO correct ?
self.assertIsNone(f.setter_return_type) # TODO correct ?
- self.assertIsNone(f.getter_return_type) # TODO correct ?
+ self.assertIsNone(f.getter_return_type) # TODO correct ?
self.assertFalse(f.is_legacy_only(eolian.Eolian_Function_Type.PROP_GET))
self.assertFalse(f.is_class)
self.assertFalse(f.is_beta)
@@ -275,12 +365,12 @@ class TestEolianFunction(unittest.TestCase):
self.assertEqual(len(list(f.parameters)), 1)
self.assertFalse(f.return_is_warn_unused(eolian.Eolian_Function_Type.METHOD))
self.assertFalse(f.object_is_const)
- self.assertEqual(f.class_.full_name, 'Efl.Loop.Timer')
+ self.assertEqual(f.class_.name, 'Efl.Loop.Timer')
self.assertIsInstance(f.implement, eolian.Implement)
def test_function_parameter(self):
- cls = state.class_get_by_name('Efl.Loop.Timer')
- f = cls.function_get_by_name('delay')
+ cls = eolian_db.class_by_name_get('Efl.Loop.Timer')
+ f = cls.function_by_name_get('delay')
p = list(f.parameters)[0]
self.assertEqual(p.direction, eolian.Eolian_Parameter_Dir.IN)
self.assertEqual(p.name, 'add')
@@ -294,11 +384,11 @@ class TestEolianFunction(unittest.TestCase):
class TestEolianImplement(unittest.TestCase):
def test_implement(self):
- cls = state.class_get_by_name('Efl.Loop.Timer')
- f = cls.function_get_by_name('delay')
+ cls = eolian_db.class_by_name_get('Efl.Loop.Timer')
+ f = cls.function_by_name_get('delay')
im = f.implement
self.assertIsInstance(im, eolian.Implement)
- self.assertEqual(im.full_name, 'Efl.Loop.Timer.delay')
+ self.assertEqual(im.name, 'Efl.Loop.Timer.delay')
self.assertIsInstance(im.class_, eolian.Class)
self.assertIsInstance(im.function, eolian.Function)
self.assertIsInstance(im.documentation_get(), eolian.Documentation) # TODO is UNRESOLVED correct ?
@@ -313,9 +403,9 @@ class TestEolianImplement(unittest.TestCase):
class TestEolianEvent(unittest.TestCase):
def test_event(self):
- cls = state.class_get_by_name('Efl.Loop.Timer')
+ cls = eolian_db.class_by_name_get('Efl.Loop.Timer')
self.assertEqual([e.name for e in cls.events], ['tick'])
- ev = cls.event_get_by_name('tick')
+ ev = cls.event_by_name_get('tick')
self.assertIsInstance(ev, eolian.Event)
self.assertEqual(ev.name, 'tick')
self.assertEqual(ev.c_name, 'EFL_LOOP_TIMER_EVENT_TICK')
@@ -329,35 +419,35 @@ class TestEolianEvent(unittest.TestCase):
class TestEolianPart(unittest.TestCase):
def test_part(self):
- cls = state.class_get_by_name('Efl.Ui.Popup')
+ cls = eolian_db.class_by_name_get('Efl.Ui.Popup')
parts = list(cls.parts)
self.assertGreater(len(parts), 0)
part = parts[0]
self.assertEqual(part.name, 'backwall')
self.assertIsInstance(part.class_, eolian.Class)
- self.assertEqual(part.class_.full_name, 'Efl.Ui.Popup.Part')
+ self.assertEqual(part.class_.name, 'Efl.Ui.Popup.Part')
self.assertIsInstance(part.documentation, eolian.Documentation)
class TestEolianConstructor(unittest.TestCase):
def test_constructor(self):
- cls = state.class_get_by_name('Efl.Ui.Win')
+ cls = eolian_db.class_by_name_get('Efl.Ui.Win')
ctors = list(cls.constructors)
self.assertGreater(len(ctors), 0)
ctor = ctors[0]
self.assertIsInstance(ctor, eolian.Constructor)
- self.assertEqual(ctor.full_name, 'Efl.Ui.Win.win_name')
+ self.assertEqual(ctor.name, 'Efl.Ui.Win.win_name')
self.assertFalse(ctor.is_optional)
self.assertIsInstance(ctor.class_, eolian.Class)
- self.assertEqual(ctor.class_.full_name, 'Efl.Ui.Win')
+ self.assertEqual(ctor.class_.name, 'Efl.Ui.Win')
self.assertIsInstance(ctor.function, eolian.Function)
self.assertEqual(ctor.function.name, 'win_name')
class TestEolianDocumentation(unittest.TestCase):
def test_documentation(self):
- td = state.class_get_by_name('Efl.Net.Control')
+ td = eolian_db.class_by_name_get('Efl.Net.Control')
doc = td.documentation
self.assertIsInstance(doc, eolian.Documentation)
self.assertIsInstance(doc.summary, str)
@@ -369,10 +459,10 @@ class TestEolianDocumentation(unittest.TestCase):
class TestEolianVariable(unittest.TestCase):
def test_variable_global(self):
- var = state.variable_global_get_by_name('Efl.Net.Http.Error.BAD_CONTENT_ENCODING')
+ var = eolian_db.global_by_name_get('Efl.Net.Http.Error.BAD_CONTENT_ENCODING')
self.assertIsInstance(var, eolian.Variable)
- self.assertEqual(var.full_name, 'Efl.Net.Http.Error.BAD_CONTENT_ENCODING')
- self.assertEqual(var.name, 'BAD_CONTENT_ENCODING')
+ self.assertEqual(var.name, 'Efl.Net.Http.Error.BAD_CONTENT_ENCODING')
+ self.assertEqual(var.short_name, 'BAD_CONTENT_ENCODING')
self.assertEqual(var.type, eolian.Eolian_Variable_Type.GLOBAL)
self.assertEqual(var.file, 'efl_net_http_types.eot')
self.assertFalse(var.is_extern)
@@ -382,10 +472,10 @@ class TestEolianVariable(unittest.TestCase):
self.assertIsNone(var.value) # TODO is None correct here? no value?
def test_variable_constant(self):
- var = state.variable_constant_get_by_name('Efl.Gfx.Size.Hint.Fill')
+ var = eolian_db.constant_by_name_get('Efl.Gfx.Size.Hint.Fill')
self.assertIsInstance(var, eolian.Variable)
- self.assertEqual(var.full_name, 'Efl.Gfx.Size.Hint.Fill')
- self.assertEqual(var.name, 'Fill')
+ self.assertEqual(var.name, 'Efl.Gfx.Size.Hint.Fill')
+ self.assertEqual(var.short_name, 'Fill')
self.assertEqual(var.type, eolian.Eolian_Variable_Type.CONSTANT)
self.assertEqual(var.file, 'efl_gfx_size_hint.eo')
self.assertFalse(var.is_extern)
@@ -398,10 +488,10 @@ class TestEolianVariable(unittest.TestCase):
class TestEolianTypedecl(unittest.TestCase):
def test_typedecl_enum(self):
- td = state.typedecl_enum_get_by_name('Efl.Net.Http.Version')
+ td = eolian_db.enum_by_name_get('Efl.Net.Http.Version')
self.assertIsInstance(td, eolian.Typedecl)
- self.assertEqual(td.name, 'Version')
- self.assertEqual(td.full_name, 'Efl.Net.Http.Version')
+ self.assertEqual(td.name, 'Efl.Net.Http.Version')
+ self.assertEqual(td.short_name, 'Version')
self.assertEqual(td.file, 'efl_net_http_types.eot')
self.assertEqual(list(td.namespaces), ['Efl','Net','Http'])
self.assertIsInstance(td.documentation, eolian.Documentation)
@@ -410,9 +500,10 @@ class TestEolianTypedecl(unittest.TestCase):
self.assertIsNone(td.function_pointer) # TODO find a better test
self.assertFalse(td.is_extern)
self.assertEqual(len(list(td.enum_fields)), 3)
+ self.assertEqual(td.c_type, 'enum Efl_Net_Http_Version { v1_0 = 100, v1_1 = 101, v2_0 = 200 }')
def test_typedecl_enum_field(self):
- td = state.typedecl_enum_get_by_name('Efl.Net.Http.Version')
+ td = eolian_db.enum_by_name_get('Efl.Net.Http.Version')
field = td.enum_field_get('v1_0')
self.assertIsInstance(field, eolian.Enum_Type_Field)
self.assertEqual(field.name, 'v1_0')
@@ -421,10 +512,10 @@ class TestEolianTypedecl(unittest.TestCase):
self.assertIsInstance(field.value, eolian.Expression)
def test_typedecl_struct(self):
- td = state.typedecl_struct_get_by_name('Efl.Gfx.Color32')
+ td = eolian_db.struct_by_name_get('Efl.Gfx.Color32')
self.assertIsInstance(td, eolian.Typedecl)
- self.assertEqual(td.name, 'Color32')
- self.assertEqual(td.full_name, 'Efl.Gfx.Color32')
+ self.assertEqual(td.name, 'Efl.Gfx.Color32')
+ self.assertEqual(td.short_name, 'Color32')
self.assertEqual(td.file, 'efl_canvas_filter_internal.eo')
self.assertEqual(list(td.namespaces), ['Efl','Gfx'])
self.assertIsInstance(td.documentation, eolian.Documentation)
@@ -433,9 +524,10 @@ class TestEolianTypedecl(unittest.TestCase):
self.assertIsNone(td.function_pointer) # TODO find a better test
self.assertFalse(td.is_extern)
self.assertEqual(len(list(td.struct_fields)), 4)
+ self.assertEqual(td.c_type, 'struct Efl_Gfx_Color32 { uint8_t r; uint8_t g; uint8_t b; uint8_t a; }')
def test_typedecl_struct_field(self):
- td = state.typedecl_struct_get_by_name('Efl.Gfx.Color32')
+ td = eolian_db.struct_by_name_get('Efl.Gfx.Color32')
field = td.struct_field_get('b')
self.assertIsInstance(field, eolian.Struct_Type_Field)
self.assertEqual(field.name, 'b')
@@ -443,47 +535,93 @@ class TestEolianTypedecl(unittest.TestCase):
self.assertIsInstance(field.documentation, eolian.Documentation)
def test_typedecl_alias(self):
- alias = state.typedecl_alias_get_by_name('Eina.Error')
+ alias = eolian_db.alias_by_name_get('Eina.Error')
self.assertIsInstance(alias, eolian.Typedecl)
- self.assertEqual(alias.name, 'Error')
+ self.assertEqual(alias.type, eolian.Eolian_Typedecl_Type.ALIAS)
+ self.assertEqual(alias.name, 'Eina.Error')
+ self.assertEqual(alias.short_name, 'Error')
+ self.assertIsInstance(alias.aliased_base, eolian.Type)
+ self.assertEqual(alias.aliased_base.name, 'int')
+ self.assertEqual(alias.c_type, 'typedef int Eina_Error')
class TestEolianType(unittest.TestCase):
- def test_type_regular(self):
- cls = state.class_get_by_name('Efl.Loop.Timer')
- func = cls.function_get_by_name('delay')
+ def test_type_regular_builtin(self):
+ cls = eolian_db.class_by_name_get('Efl.Loop.Timer')
+ func = cls.function_by_name_get('delay')
param = list(func.parameters)[0]
- t = param.type
+ t = param.type # type: double
self.assertIsInstance(t, eolian.Type)
self.assertEqual(t.name, 'double')
- self.assertEqual(t.full_name, 'double')
+ self.assertEqual(t.short_name, 'double')
self.assertEqual(t.type, eolian.Eolian_Type_Type.REGULAR)
self.assertEqual(t.builtin_type, eolian.Eolian_Type_Builtin_Type.DOUBLE)
- self.assertEqual(t.file, 'efl_loop_timer.eo')
+ self.assertEqual(t.file, 'efl_loop_timer.eo') # TODO is this correct ?
self.assertIsNone(t.base_type) # TODO find a better test
self.assertIsNone(t.next_type) # TODO find a better test
self.assertFalse(t.is_owned)
self.assertFalse(t.is_const)
self.assertFalse(t.is_ptr)
- # self.assertEqual(list(t.namespaces), []) # TODO find a better test
- self.assertIsNone(t.free_func) # TODO find a better test
+ self.assertEqual(list(t.namespaces), [])
+ self.assertIsNone(t.free_func)
+ self.assertIsNone(t.class_)
+ self.assertEqual(t, t.aliased_base) # TODO find a better test
+ self.assertEqual(t.c_type_default, 'double') # TODO find a better test
+ self.assertEqual(t.c_type_param, 'double')
+ self.assertEqual(t.c_type_return, 'double')
-class TestEolianDeclaration(unittest.TestCase):
- def test_declaration(self):
- d = state.declaration_get_by_name('Eina.File')
- self.assertIsInstance(d, eolian.Declaration)
- self.assertEqual(d.name, 'Eina.File')
- self.assertEqual(d.type, eolian.Eolian_Declaration_Type.STRUCT)
- # self.assertIsNone(d.class_) # TODO find a better test
- # self.assertIsNone(d.variable) # TODO find a better test
- self.assertIsInstance(d.data_type, eolian.Typedecl)
- self.assertEqual(d.data_type.full_name, 'Eina.File')
+ def test_type_regular(self):
+ cls = eolian_db.class_by_name_get('Efl.Gfx')
+ func = cls.function_by_name_get('geometry')
+ param = list(func.setter_values)[0]
+ t = param.type # type: Eina.Rect
+ self.assertIsInstance(t, eolian.Type)
+ self.assertEqual(t.name, 'Eina.Rect')
+ self.assertEqual(t.short_name, 'Rect')
+ self.assertEqual(t.type, eolian.Eolian_Type_Type.REGULAR)
+ self.assertEqual(t.builtin_type, eolian.Eolian_Type_Builtin_Type.INVALID)
+ self.assertEqual(t.file, 'efl_gfx.eo') # TODO is this correct ?
+ self.assertEqual(list(t.namespaces), ['Eina'])
+ self.assertEqual(t.free_func, 'eina_rectangle_free')
+ self.assertIsNone(t.class_)
+ self.assertEqual(t, t.aliased_base)
+
+ self.assertEqual(t.c_type_default, 'Eina_Rect') # TODO find a better test
+ self.assertEqual(t.c_type_param, 'Eina_Rect')
+ self.assertEqual(t.c_type_return, 'Eina_Rect')
+
+ td = t.typedecl
+ self.assertIsInstance(td, eolian.Typedecl)
+ self.assertEqual(td.name, 'Eina.Rect')
+
+ def test_type_class(self):
+ cls = eolian_db.class_by_name_get('Efl.Content')
+ func = cls.function_by_name_get('content')
+ param = list(func.setter_values)[0]
+ t = param.type # type: Efl.Gfx (class interface)
+ self.assertIsInstance(t, eolian.Type)
+ self.assertEqual(t.name, 'Efl.Gfx')
+ self.assertEqual(t.short_name, 'Gfx')
+ self.assertEqual(t.type, eolian.Eolian_Type_Type.CLASS)
+ self.assertEqual(t.builtin_type, eolian.Eolian_Type_Builtin_Type.INVALID)
+ self.assertEqual(t.file, 'efl_content.eo') # TODO is this correct ?
+ self.assertEqual(list(t.namespaces), ['Efl'])
+ self.assertEqual(t.free_func, 'efl_del')
+ self.assertEqual(t, t.aliased_base)
+
+ self.assertEqual(t.c_type_default, 'Efl_Gfx *') # TODO find a better test
+ self.assertEqual(t.c_type_param, 'Efl_Gfx *')
+ self.assertEqual(t.c_type_return, 'Efl_Gfx *')
+
+ cls = t.class_
+ self.assertIsInstance(cls, eolian.Class)
+ self.assertEqual(cls.name, 'Efl.Gfx')
class TestEolianExpression(unittest.TestCase):
def test_expression_simple(self):
- td = state.typedecl_enum_get_by_name('Efl.Net.Http.Version')
+ td = eolian_db.enum_by_name_get('Efl.Net.Http.Version')
field = td.enum_field_get('v1_0')
exp = field.value
self.assertIsInstance(exp, eolian.Expression)
@@ -491,7 +629,7 @@ class TestEolianExpression(unittest.TestCase):
self.assertEqual(exp.serialize, '100')
def test_expression_unary(self):
- var = state.variable_constant_get_by_name('Efl.Gfx.Size.Hint.Fill')
+ var = eolian_db.constant_by_name_get('Efl.Gfx.Size.Hint.Fill')
exp = var.value
self.assertIsInstance(exp, eolian.Expression)
self.assertEqual(exp.type, eolian.Eolian_Expression_Type.UNARY)
@@ -501,7 +639,7 @@ class TestEolianExpression(unittest.TestCase):
self.assertIsInstance(unary, eolian.Expression)
self.assertEqual(unary.type, eolian.Eolian_Expression_Type.DOUBLE)
self.assertEqual(float(exp.serialize), 1.0)
-
+
# TODO test_expression_binary
# exp.binary_operator # TODO find a better test (only works for BINARY expr)
# exp.binary_lhs # TODO find a better test (only works for BINARY expr)
@@ -511,30 +649,30 @@ class TestEolianExpression(unittest.TestCase):
if __name__ == '__main__':
# create main eolian state
- state = eolian.Eolian()
- if not isinstance(state, eolian.Eolian):
+ eolian_db = eolian.Eolian_State()
+ if not isinstance(eolian_db, eolian.Eolian_State):
raise(RuntimeError('Eolian, failed to create Eolian state'))
# eolian system scan (BROKEN)
- # if not state.system_directory_scan():
+ # if not eolian_db.system_directory_add():
# raise(RuntimeError('Eolian, failed to scan system directories'))
# eolian source tree scan
- if not state.directory_scan(SCAN_FOLDER):
+ if not eolian_db.directory_add(SCAN_FOLDER):
raise(RuntimeError('Eolian, failed to scan source directory'))
# Parse all known eo files
- if not state.all_eot_files_parse():
+ if not eolian_db.all_eot_files_parse():
raise(RuntimeError('Eolian, failed to parse all EOT files'))
-
- if not state.all_eo_files_parse():
+
+ if not eolian_db.all_eo_files_parse():
raise(RuntimeError('Eolian, failed to parse all EO files'))
# start the test suite
suite = unittest.main(verbosity=2, exit=False)
# cleanup (or it will segfault on gc, that happend after atexit)
- del state
+ del eolian_db
# exit 0 (success) or 1 (failure)
exit(0 if suite.result.wasSuccessful() else 1)
diff --git a/src/scripts/pyolian/test_gen_class.template b/src/scripts/pyolian/test_gen_class.template
index ff8c17de62..cc0e845ab5 100644
--- a/src/scripts/pyolian/test_gen_class.template
+++ b/src/scripts/pyolian/test_gen_class.template
@@ -1,12 +1,12 @@
================================================================================
-Class: ${cls.full_name}$
+Class: ${cls.name}$ (${cls.short_name}$)
================================================================================
Class type: ${cls.type}$
-Base Class: ${cls.base_class.full_name if cls.base_class else None}$
-Inherits: ${', '.join([i.full_name for i in cls.inherits])}$
-Hierarchy: ${' => '.join([i.full_name for i in cls.hierarchy])}$
-InheritsFull: ${', '.join([i.full_name for i in cls.inherits_full])}$
+Base Class: ${cls.base_class.name if cls.base_class else None}$
+Inherits: ${', '.join([i.name for i in cls.inherits])}$
+Hierarchy: ${' => '.join([i.name for i in cls.hierarchy])}$
+InheritsFull: ${', '.join([i.name for i in cls.inherits_full])}$
Namespace: ${cls.namespace}$
Namespaces: ${list(cls.namespaces)}$
File: ${cls.file}$
@@ -32,7 +32,7 @@ Methods:
Properties:
===========
<!--(for func in cls.properties)-->
- * ${func.name}$ (<!--(for v in func.getter_values)-->${v.type.c_type}$ ${v.name}$, <!--(end)-->)
+ * ${func.name}$ (<!--(for v in func.getter_values)-->${v.type.c_type_default}$ ${v.name}$, <!--(end)-->)
<!--(else)-->
no properties available
<!--(end)-->
@@ -40,7 +40,7 @@ Properties:
Implements:
===========
<!--(for i in cls.implements)-->
- * ${i.full_name}$
+ * ${i.name}$
<!--(else)-->
no implements available
<!--(end)-->
diff --git a/src/scripts/pyolian/test_gen_namespace.template b/src/scripts/pyolian/test_gen_namespace.template
index 87557c6ad8..8cdb4f7ca7 100644
--- a/src/scripts/pyolian/test_gen_namespace.template
+++ b/src/scripts/pyolian/test_gen_namespace.template
@@ -6,15 +6,15 @@ Namespace: ${namespace.name}$ ${namespace.namespaces}$
Regular Classes:
================
<!--(for cls in namespace.regulars)-->
- * ${cls.full_name}$ (${cls.type.name.lower()}$)
+ * ${cls.name}$
<!--(else)-->
no classes available
<!--(end)-->
-Interfaces:
-===========
-<!--(for cls in namespace.interfaces)-->
- * ${cls.full_name}$ (${cls.type.name.lower()}$)
+Abstract Classes:
+================
+<!--(for cls in namespace.abstracts)-->
+ * ${cls.name}$
<!--(else)-->
no classes available
<!--(end)-->
@@ -22,7 +22,15 @@ Interfaces:
Mixins:
=======
<!--(for cls in namespace.mixins)-->
- * ${cls.full_name}$ (${cls.type.name.lower()}$)
+ * ${cls.name}$
+<!--(else)-->
+ no classes available
+<!--(end)-->
+
+Interfaces:
+===========
+<!--(for cls in namespace.interfaces)-->
+ * ${cls.name}$
<!--(else)-->
no classes available
<!--(end)-->
@@ -30,7 +38,7 @@ Mixins:
Aliases:
========
<!--(for typedecl in namespace.aliases)-->
- * ${typedecl.full_name}$
+ * ${typedecl.name}$
<!--(else)-->
no alias available
<!--(end)-->
@@ -38,7 +46,7 @@ Aliases:
Structs:
========
<!--(for typedecl in namespace.structs)-->
- * ${typedecl.full_name}$
+ * ${typedecl.name}$
<!--(for field in typedecl.struct_fields)-->
${field.type.name}$ ${field.name}$
<!--(end)-->
@@ -49,7 +57,7 @@ Structs:
Enums:
======
<!--(for typedecl in namespace.enums)-->
- * ${typedecl.full_name}$
+ * ${typedecl.name}$
<!--(for field in typedecl.enum_fields)-->
${field.c_name}$ = ${field.value.serialize}$
<!--(end)-->
diff --git a/src/static_libs/buildsystem/buildsystem.h b/src/static_libs/buildsystem/buildsystem.h
new file mode 100644
index 0000000000..5312fa85e7
--- /dev/null
+++ b/src/static_libs/buildsystem/buildsystem.h
@@ -0,0 +1,24 @@
+/*
+ * A little helper library for abstracting the path finding which depends on autotools (or later on other buildsystems)
+ *
+ * Author: Marcel Hollerbach
+ */
+#include <stdio.h>
+#include <Eina.h>
+
+/*
+ * Fills the provided buffer with the path to the binary of a given subsystem
+ */
+Eina_Bool bs_binary_get(char *path, size_t maxlen, const char *subsystem, const char *bin_name);
+
+/*
+ * Fills the provided buffer with the path to the data file/dir of a given subsystem
+ */
+Eina_Bool bs_data_path_get(char *path, size_t maxlen, const char *subsystem, const char *file);
+
+/*
+ * Fills the provided buffer with the path to the .so file for modules of a given subsystem
+ */
+Eina_Bool bs_mod_get(char *path, size_t maxlen, const char *subsystem, const char *mod_name);
+
+Eina_Bool bs_mod_dir_get(char *path, size_t maxlen, const char *subsystem, const char *mod_name);
diff --git a/src/static_libs/buildsystem/buildsystem_autotools.c b/src/static_libs/buildsystem/buildsystem_autotools.c
new file mode 100644
index 0000000000..83d8c1f2df
--- /dev/null
+++ b/src/static_libs/buildsystem/buildsystem_autotools.c
@@ -0,0 +1,50 @@
+#ifdef _WIN32
+# define BIN_EXT ".exe"
+#else
+# define BIN_EXT ""
+#endif
+
+#include "config.h"
+
+#include <stdio.h>
+#include <Eina.h>
+
+Eina_Bool
+bs_mod_get(char *path, size_t maxlen, const char *subsystem, const char *mod_name)
+{
+ if (!getenv("EFL_RUN_IN_TREE")) return EINA_FALSE;
+
+ snprintf(path, maxlen, PACKAGE_BUILD_DIR"/src/modules/%s/%s/.libs/module"SHARED_LIB_SUFFIX, subsystem, mod_name);
+
+ return EINA_TRUE;
+}
+
+Eina_Bool
+bs_mod_dir_get(char *path, size_t maxlen, const char *subsystem, const char *mod_name)
+{
+ if (!getenv("EFL_RUN_IN_TREE")) return EINA_FALSE;
+
+ snprintf(path, maxlen, PACKAGE_BUILD_DIR"/src/modules/%s/%s/.libs", subsystem, mod_name);
+
+ return EINA_TRUE;
+}
+
+Eina_Bool
+bs_binary_get(char *path, size_t maxlen, const char *subsystem, const char *bin_name)
+{
+ if (!getenv("EFL_RUN_IN_TREE")) return EINA_FALSE;
+
+ snprintf(path, maxlen, PACKAGE_BUILD_DIR"/src/bin/%s/%s"BIN_EXT, subsystem, bin_name);
+
+ return EINA_TRUE;
+}
+
+Eina_Bool
+bs_data_path_get(char *path, size_t maxlen, const char *subsystem, const char *file)
+{
+ if (!getenv("EFL_RUN_IN_TREE")) return EINA_FALSE;
+
+ snprintf(path, maxlen, PACKAGE_SRC_DIR"/data/%s/%s", subsystem, file);
+
+ return EINA_TRUE;
+}
diff --git a/src/static_libs/vg_common/vg_common.c b/src/static_libs/vg_common/vg_common.c
index 7f54e355e9..eb8a293829 100644
--- a/src/static_libs/vg_common/vg_common.c
+++ b/src/static_libs/vg_common/vg_common.c
@@ -547,7 +547,7 @@ vg_common_svg_node_free(Svg_Node *node)
}
static Efl_VG *
-_apply_gradient_property(Svg_Style_Gradient *g, Efl_VG *vg, Vg_File_Data *vg_data)
+_apply_gradient_property(Svg_Style_Gradient *g, Efl_VG *vg, Efl_VG *parent, Vg_File_Data *vg_data)
{
Efl_VG *grad_obj = NULL;
Efl_Gfx_Gradient_Stop *stops, *stop;
@@ -561,7 +561,7 @@ _apply_gradient_property(Svg_Style_Gradient *g, Efl_VG *vg, Vg_File_Data *vg_dat
//TODO: apply actual sizes (imporve bounds_get function?)...
//for example with figures and paths
if (!g->user_space)
- evas_vg_node_bounds_get(vg, &r);
+ efl_gfx_path_bounds_get(vg, &r);
else
{
r.w = vg_data->view_box.w;
@@ -570,7 +570,7 @@ _apply_gradient_property(Svg_Style_Gradient *g, Efl_VG *vg, Vg_File_Data *vg_dat
if (g->type == SVG_LINEAR_GRADIENT)
{
- grad_obj = evas_vg_gradient_linear_add(NULL);
+ grad_obj = evas_vg_gradient_linear_add(parent);
evas_vg_gradient_linear_start_set(grad_obj, g->linear->x1 * r.w + r.x, g->linear->y1 * r.h + r.y);
evas_vg_gradient_linear_end_set(grad_obj, g->linear->x2 * r.w + r.x, g->linear->y2 * r.h + r.y);
}
@@ -587,7 +587,7 @@ _apply_gradient_property(Svg_Style_Gradient *g, Efl_VG *vg, Vg_File_Data *vg_dat
int min = (r.h > r.w) ? r.w : r.h;
radius = sqrt(pow(min, 2) + pow(min, 2)) / sqrt(2.0);
}
- grad_obj = evas_vg_gradient_radial_add(NULL);
+ grad_obj = evas_vg_gradient_radial_add(parent);
evas_vg_gradient_radial_center_set(grad_obj, g->radial->cx * r.w + r.x, g->radial->cy * r.h + r.y);
evas_vg_gradient_radial_radius_set(grad_obj, g->radial->r * radius);
evas_vg_gradient_radial_focal_set(grad_obj, g->radial->fx * r.w + r.x, g->radial->fy * r.h + r.y);
@@ -610,7 +610,7 @@ _apply_gradient_property(Svg_Style_Gradient *g, Efl_VG *vg, Vg_File_Data *vg_dat
scale_reversed_X = ((double) r.w) / r.h;
}
- evas_vg_node_bounds_get(grad_obj, &grad_geom);
+ efl_gfx_path_bounds_get(grad_obj, &grad_geom);
double cy = grad_geom.h / 2 + grad_geom.y;
double cy_scaled = (grad_geom.h / 2) * scale_reversed_Y;
@@ -630,7 +630,7 @@ _apply_gradient_property(Svg_Style_Gradient *g, Efl_VG *vg, Vg_File_Data *vg_dat
eina_matrix3_scale(&m, scale_X, scale_Y);
eina_matrix3_translate(&m, cx_scaled - cx, cy_scaled - cy);
- efl_vg_transformation_set(grad_obj, &m);
+ efl_canvas_vg_node_transformation_set(grad_obj, &m);
}
}
else
@@ -663,13 +663,13 @@ _apply_gradient_property(Svg_Style_Gradient *g, Efl_VG *vg, Vg_File_Data *vg_dat
// vg tree creation
static void
-_apply_vg_property(Svg_Node *node, Efl_VG *vg, Vg_File_Data *vg_data)
+_apply_vg_property(Svg_Node *node, Efl_VG *vg, Efl_VG *parent, Vg_File_Data *vg_data)
{
Svg_Style_Property *style = node->style;
// update the vg name
if (node->id)
- evas_vg_node_name_set(vg, node->id);
+ efl_name_set(vg, node->id);
// apply the transformation
if (node->transform)
@@ -687,7 +687,7 @@ _apply_vg_property(Svg_Node *node, Efl_VG *vg, Vg_File_Data *vg_data)
else if (style->fill.paint.gradient)
{
// if the fill has gradient then apply.
- evas_vg_shape_fill_set(vg, _apply_gradient_property(style->fill.paint.gradient, vg, vg_data));
+ evas_vg_shape_fill_set(vg, _apply_gradient_property(style->fill.paint.gradient, vg, parent, vg_data));
}
else if (style->fill.paint.cur_color)
{
@@ -714,7 +714,7 @@ _apply_vg_property(Svg_Node *node, Efl_VG *vg, Vg_File_Data *vg_data)
else if (style->stroke.paint.gradient)
{
// if the fill has gradient then apply.
- evas_vg_shape_stroke_fill_set(vg, _apply_gradient_property(style->stroke.paint.gradient, vg, vg_data));
+ evas_vg_shape_stroke_fill_set(vg, _apply_gradient_property(style->stroke.paint.gradient, vg, parent, vg_data));
}
else if (style->stroke.paint.url)
{
@@ -762,8 +762,11 @@ vg_common_create_vg_node_helper(Svg_Node *node, Efl_VG *parent, Vg_File_Data *vg
case SVG_NODE_DOC:
case SVG_NODE_G:
{
- vg = evas_vg_container_add(parent);
- _apply_vg_property(node, vg, vg_data);
+ if (!parent)
+ vg = efl_add_ref(EFL_CANVAS_VG_CONTAINER_CLASS, NULL);
+ else
+ vg = efl_add(EFL_CANVAS_VG_CONTAINER_CLASS, parent);
+ _apply_vg_property(node, vg, parent, vg_data);
EINA_LIST_FOREACH(node->child, l, child)
{
vg_common_create_vg_node_helper(child, vg, vg_data);
@@ -812,7 +815,7 @@ vg_common_create_vg_node_helper(Svg_Node *node, Efl_VG *parent, Vg_File_Data *vg
break;
}
if (vg)
- _apply_vg_property(node, vg, vg_data);
+ _apply_vg_property(node, vg, parent, vg_data);
return vg;
}
@@ -881,20 +884,20 @@ _create_gradient_node(Efl_VG *vg)
{
const Efl_Gfx_Gradient_Stop *stops = NULL;
Efl_Gfx_Gradient_Stop *new_stop;
- unsigned int count, i;
+ unsigned int count = 0, i;
Svg_Style_Gradient *grad = calloc(1, sizeof(Svg_Style_Gradient));
grad->spread = evas_vg_gradient_spread_get(vg);
evas_vg_gradient_stop_get(vg, &stops, &count);
- for (i=0 ; i < count; i++)
+ for (i = 0; i < count; i++)
{
new_stop = calloc(1, sizeof(Efl_Gfx_Gradient_Stop));
memcpy(new_stop, stops, sizeof(Efl_Gfx_Gradient_Stop));
grad->stops = eina_list_append(grad->stops, new_stop);
stops++;
}
- if (efl_isa(vg, EFL_VG_GRADIENT_LINEAR_CLASS))
+ if (efl_isa(vg, EFL_CANVAS_VG_GRADIENT_LINEAR_CLASS))
{
grad->type = SVG_LINEAR_GRADIENT;
grad->linear = calloc(1, sizeof(Svg_Linear_Gradient));
@@ -927,7 +930,7 @@ _apply_svg_property(Svg_Node *node, Efl_VG *vg)
eina_matrix3_copy(node->transform, matrix);
}
- if ((id = evas_vg_node_name_get(vg)))
+ if ((id = efl_name_get(vg)))
{
node->id = eina_stringshare_add(id);
}
@@ -982,18 +985,18 @@ vg_common_create_svg_node_helper(Efl_VG *vg, Svg_Node *parent)
unsigned int points_count, commands_count;
const double *points;
- if (efl_isa(vg, EFL_VG_CONTAINER_CLASS))
+ if (efl_isa(vg, EFL_CANVAS_VG_CONTAINER_CLASS))
{
svg_node = _create_node(parent, SVG_NODE_G);
_apply_svg_property(svg_node, vg);
// apply property
- it = efl_vg_container_children_get(vg);
+ it = efl_canvas_vg_container_children_get(vg);
EINA_ITERATOR_FOREACH(it, child)
{
vg_common_create_svg_node_helper(child, svg_node);
}
}
- else
+ else if (efl_isa(vg, EFL_CANVAS_VG_SHAPE_CLASS))
{
svg_node = _create_node(parent, SVG_NODE_CUSTOME_COMMAND);
evas_vg_shape_path_get(vg, &commands, &points);
diff --git a/src/tests/.gitignore b/src/tests/.gitignore
index 741adfc01a..9b233a4f3e 100644
--- a/src/tests/.gitignore
+++ b/src/tests/.gitignore
@@ -1,4 +1,4 @@
-check-results.xml
+check-results*.xml
*_suite
*_suite.log
*_suite.trs
diff --git a/src/tests/ecore/ecore_suite.c b/src/tests/ecore/ecore_suite.c
index eb81132366..9e6baf6abb 100644
--- a/src/tests/ecore/ecore_suite.c
+++ b/src/tests/ecore/ecore_suite.c
@@ -4,9 +4,12 @@
#include "ecore_suite.h"
#include "../efl_check.h"
+#include <Ecore.h>
static const Efl_Test_Case etc[] = {
{ "Ecore", ecore_test_ecore },
+ { "idle", ecore_test_ecore_idle },
+ { "poller", ecore_test_ecore_idle },
#if HAVE_ECORE_X
{ "Ecore_X", ecore_test_ecore_x },
#endif
@@ -18,21 +21,55 @@ static const Efl_Test_Case etc[] = {
{ "Ecore_Evas", ecore_test_ecore_evas },
{ "Ecore_Animators", ecore_test_animator },
{ "Eina_Thread_Queue", ecore_test_ecore_thread_eina_thread_queue },
-#if HAVE_ECORE_DRM
- { "Ecore_Drm", ecore_test_ecore_drm },
-#endif
+ { "Eina_Thread_Queue", ecore_test_ecore_thread_eina_thread_queue2 },
#if HAVE_ECORE_FB
{ "Ecore_Fb", ecore_test_ecore_fb },
#endif
{ "Ecore_Input", ecore_test_ecore_input },
{ "Ecore_File", ecore_test_ecore_file },
- { "Ecore_Promise", ecore_test_ecore_promise },
{ "Ecore_Job", ecore_test_ecore_job },
{ "Ecore_Args", ecore_test_ecore_args },
- { "Ecore_Promise2", ecore_test_ecore_promise2 },
{ NULL, NULL }
};
+static Ecore_Timer *timeout;
+int timeout_reached = 0;
+
+static Eina_Bool
+timeout_cb()
+{
+#if CHECK_MINOR_VERSION >= 11
+ const char *tcname = tcase_name();
+
+ timeout_reached = 1;
+
+ if (tcname && strstr(tcname, "download"))
+ {
+ fprintf(stderr, "test timeout reached: download failed, probably network issue. skipping\n");
+ ecore_main_loop_quit();
+ }
+ else
+#endif
+ ck_abort_msg("test timeout reached!");
+ timeout = NULL;
+ return EINA_FALSE;
+}
+
+SUITE_INIT(ecore)
+{
+ timeout_reached = 0;
+ ck_assert_int_eq(ecore_init(), 1);
+ timeout = ecore_timer_add(5.0, timeout_cb, NULL);
+ ck_assert_msg(!!timeout, "timeout timer creation failed!");
+}
+
+SUITE_SHUTDOWN(ecore)
+{
+ ecore_timer_del(timeout);
+ timeout = NULL;
+ ck_assert_int_eq(ecore_shutdown(), 0);
+}
+
int
main(int argc, char **argv)
{
@@ -46,7 +83,7 @@ main(int argc, char **argv)
#endif
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
- "Ecore", etc);
+ "Ecore", etc, SUITE_INIT_FN(ecore), SUITE_SHUTDOWN_FN(ecore));
return (failed_count == 0) ? 0 : 255;
}
diff --git a/src/tests/ecore/ecore_suite.h b/src/tests/ecore/ecore_suite.h
index 50df87f154..d1a698ea99 100644
--- a/src/tests/ecore/ecore_suite.h
+++ b/src/tests/ecore/ecore_suite.h
@@ -2,8 +2,13 @@
#define _ECORE_SUITE_H
#include <check.h>
+#include "../efl_check.h"
+
+extern int timeout_reached;
void ecore_test_ecore(TCase *tc);
+void ecore_test_ecore_idle(TCase *tc);
+void ecore_test_ecore_poller(TCase *tc);
void ecore_test_ecore_x(TCase *tc);
void ecore_test_ecore_imf(TCase *tc);
void ecore_test_ecore_audio(TCase *tc);
@@ -11,13 +16,11 @@ void ecore_test_timer(TCase *tc);
void ecore_test_ecore_evas(TCase *tc);
void ecore_test_animator(TCase *tc);
void ecore_test_ecore_thread_eina_thread_queue(TCase *tc);
-void ecore_test_ecore_drm(TCase *tc);
+void ecore_test_ecore_thread_eina_thread_queue2(TCase *tc);
void ecore_test_ecore_fb(TCase *tc);
void ecore_test_ecore_input(TCase *tc);
void ecore_test_ecore_file(TCase *tc);
-void ecore_test_ecore_promise(TCase *tc);
void ecore_test_ecore_job(TCase *tc);
void ecore_test_ecore_args(TCase *tc);
-void ecore_test_ecore_promise2(TCase *tc);
#endif /* _ECORE_SUITE_H */
diff --git a/src/tests/ecore/ecore_test_animator.c b/src/tests/ecore/ecore_test_animator.c
index 172d77062b..271f9792ef 100644
--- a/src/tests/ecore/ecore_test_animator.c
+++ b/src/tests/ecore/ecore_test_animator.c
@@ -21,16 +21,14 @@ static Eina_Bool _anim_cb(void *data EINA_UNUSED, double pos)
return EINA_TRUE;
}
-START_TEST(ecore_test_animators)
+EFL_START_TEST(ecore_test_animators)
{
Ecore_Animator *animator;
double interval1 = 0.02;
double interval2 = 0.01;
- fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n");
-
ecore_animator_frametime_set(interval1);
- animator = ecore_animator_timeline_add(1, _anim_cb, &interval1);
+ animator = ecore_animator_timeline_add(0.1, _anim_cb, &interval1);
fail_if(!animator);
@@ -38,15 +36,13 @@ START_TEST(ecore_test_animators)
ecore_animator_frametime_set(interval2);
prev = 0;
- animator = ecore_animator_timeline_add(1, _anim_cb, &interval2);
+ animator = ecore_animator_timeline_add(0.1, _anim_cb, &interval2);
fail_if(!animator);
ecore_main_loop_begin();
- ecore_shutdown();
-
}
-END_TEST
+EFL_END_TEST
Eina_Bool test_pos(Ecore_Pos_Map posmap, double v1, double v2, double (*testmap)(double val, double v1, double v2))
{
@@ -88,14 +84,14 @@ double _sinusoidal(double val, double v1 EINA_UNUSED, double v2 EINA_UNUSED)
return (1 - cos(val * M_PI)) / 2;
}
-START_TEST(ecore_test_pos_map)
+EFL_START_TEST(ecore_test_pos_map)
{
fail_if(!test_pos(ECORE_POS_MAP_LINEAR, 0, 0, _linear));
fail_if(!test_pos(ECORE_POS_MAP_ACCELERATE, 0, 0, _accel));
fail_if(!test_pos(ECORE_POS_MAP_DECELERATE, 0, 0, _decel));
fail_if(!test_pos(ECORE_POS_MAP_SINUSOIDAL, 0, 0, _sinusoidal));
}
-END_TEST
+EFL_END_TEST
static void _animator_called_cb(void *data)
{
@@ -124,7 +120,7 @@ static Eina_Bool _quit_cb(void* data EINA_UNUSED)
return ECORE_CALLBACK_CANCEL;
}
-START_TEST(ecore_test_begin_end_tick)
+EFL_START_TEST(ecore_test_begin_end_tick)
{
Ecore_Timer *timer1, *timer2;
Ecore_Animator *animator;
@@ -132,8 +128,6 @@ START_TEST(ecore_test_begin_end_tick)
Eina_Bool is_begin_cb_called = EINA_FALSE;
Eina_Bool is_end_cb_called = EINA_FALSE;
- ecore_init();
-
ecore_animator_custom_source_tick_begin_callback_set(_animator_called_cb, &is_begin_cb_called);
ecore_animator_custom_source_tick_end_callback_set(_animator_called_cb, &is_end_cb_called);
@@ -153,10 +147,8 @@ START_TEST(ecore_test_begin_end_tick)
fail_if(!is_begin_cb_called);
fail_if(!is_end_cb_called);
fail_if(!is_animator_cb_called);
-
- ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
void ecore_test_animator(TCase *tc)
{
diff --git a/src/tests/ecore/ecore_test_args.c b/src/tests/ecore/ecore_test_args.c
index 36bb7d8858..44fc033b8c 100644
--- a/src/tests/ecore/ecore_test_args.c
+++ b/src/tests/ecore/ecore_test_args.c
@@ -24,16 +24,14 @@ _cb_args1(void *data EINA_UNUSED, const Efl_Event *event)
ecore_main_loop_quit();
}
-START_TEST(ecore_test_args1)
+EFL_START_TEST(ecore_test_args1)
{
- ecore_init();
efl_event_callback_add(efl_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS,
_cb_args1, NULL);
ecore_loop_arguments_send(8, args);
ecore_main_loop_begin();
- ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
static void
_cb_args2(void *data EINA_UNUSED, const Efl_Event *event)
@@ -45,20 +43,18 @@ _cb_args2(void *data EINA_UNUSED, const Efl_Event *event)
ecore_main_loop_quit();
}
-START_TEST(ecore_test_args2)
+EFL_START_TEST(ecore_test_args2)
{
const char *simple_args[] = {
"hello world"
};
- ecore_init();
efl_event_callback_add(efl_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS,
_cb_args2, NULL);
ecore_loop_arguments_send(1, simple_args);
ecore_main_loop_begin();
- ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
static void
_cb_args3(void *data EINA_UNUSED, const Efl_Event *event)
@@ -69,16 +65,14 @@ _cb_args3(void *data EINA_UNUSED, const Efl_Event *event)
ecore_main_loop_quit();
}
-START_TEST(ecore_test_args3)
+EFL_START_TEST(ecore_test_args3)
{
- ecore_init();
efl_event_callback_add(efl_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS,
_cb_args3, NULL);
ecore_loop_arguments_send(0, NULL);
ecore_main_loop_begin();
- ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
void ecore_test_ecore_args(TCase *tc)
{
diff --git a/src/tests/ecore/ecore_test_ecore.c b/src/tests/ecore/ecore_test_ecore.c
index 89f3c0dbef..8159e22fb4 100644
--- a/src/tests/ecore/ecore_test_ecore.c
+++ b/src/tests/ecore/ecore_test_ecore.c
@@ -10,9 +10,6 @@
#include "ecore_suite.h"
-#define FP_ERR (0.0000001)
-#define CHECK_FP(a, b) ((a - b) < FP_ERR)
-
#define ECORE_EVENT_CUSTOM_1 1
#define ECORE_EVENT_CUSTOM_2 2
@@ -20,37 +17,20 @@ static Eina_Bool
_quit_cb(void *data)
{
Eina_Bool *val = data;
- *val = EINA_TRUE;
+ if (val) *val = EINA_TRUE;
ecore_main_loop_quit();
return EINA_FALSE;
}
-static Eina_Bool
-_dummy_cb(void *data)
+EFL_START_TEST(ecore_test_ecore_init)
{
- return !!data;
}
+EFL_END_TEST
-START_TEST(ecore_test_ecore_init)
-{
- int ret;
-
- ret = ecore_init();
- fail_if(ret < 1);
-
- ret = ecore_shutdown();
- fail_if(ret != 0);
-}
-END_TEST
-
-START_TEST(ecore_test_ecore_main_loop)
+EFL_START_TEST(ecore_test_ecore_main_loop)
{
Eina_Bool did = EINA_FALSE;
Ecore_Timer *timer;
- int ret;
-
- ret = ecore_init();
- fail_if(ret < 1);
timer = ecore_timer_add(0.0, _quit_cb, &did);
fail_if(timer == NULL);
@@ -58,121 +38,9 @@ START_TEST(ecore_test_ecore_main_loop)
ecore_main_loop_begin();
fail_if(did == EINA_FALSE);
-
- ret = ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_main_loop_idler)
-{
- Eina_Bool did = EINA_FALSE;
- Ecore_Idler *idler;
- int ret;
-
- ret = ecore_init();
- fail_if(ret < 1);
-
- idler = ecore_idler_add(_quit_cb, &did);
- fail_if(idler == NULL);
-
- ecore_main_loop_begin();
-
- fail_if(did == EINA_FALSE);
-
- ret = ecore_shutdown();
-}
-END_TEST
-
-START_TEST(ecore_test_ecore_main_loop_idle_enterer)
-{
- Eina_Bool did = EINA_FALSE;
- Ecore_Idle_Enterer *idle_enterer;
- int ret;
-
- ret = ecore_init();
- fail_if(ret < 1);
-
- idle_enterer = ecore_idle_enterer_add(_quit_cb, &did);
- fail_if(idle_enterer == NULL);
-
- ecore_main_loop_begin();
-
- fail_if(did == EINA_FALSE);
-
- ret = ecore_shutdown();
-}
-END_TEST
-
-START_TEST(ecore_test_ecore_main_loop_idle_before_enterer)
-{
- Eina_Bool did = EINA_FALSE;
- Ecore_Idle_Enterer *idle_enterer;
- int ret;
-
- ret = ecore_init();
- fail_if(ret < 1);
-
- idle_enterer = ecore_idle_enterer_before_add(_quit_cb, &did);
- fail_if(idle_enterer == NULL);
-
- ecore_main_loop_begin();
-
- fail_if(did == EINA_FALSE);
-
- ret = ecore_shutdown();
-}
-END_TEST
-
-START_TEST(ecore_test_ecore_main_loop_idle_exiter)
-{
- Eina_Bool did = EINA_FALSE;
- Ecore_Timer *timer;
- Ecore_Idle_Exiter *idle_exiter;
- int ret;
-
- ret = ecore_init();
- fail_if(ret < 1);
-
- /* make system exit idle */
- timer = ecore_timer_add(0.0, _dummy_cb, (void *)(long)0);
- fail_if(timer == NULL);
-
- idle_exiter = ecore_idle_exiter_add(_quit_cb, &did);
- fail_if(idle_exiter == NULL);
-
- ecore_main_loop_begin();
-
- fail_if(did == EINA_FALSE);
-
- ret = ecore_shutdown();
-}
-END_TEST
-
-START_TEST(ecore_test_ecore_main_loop_timer)
-{
- Eina_Bool did = EINA_FALSE;
- Ecore_Timer *timer;
- double start, end, elapsed;
- int ret;
-
- ret = ecore_init();
- fail_if(ret < 1);
-
- timer = ecore_timer_add(2.0, _quit_cb, &did);
- fail_if(timer == NULL);
-
- start = ecore_time_get();
- ecore_main_loop_begin();
- end = ecore_time_get();
- elapsed = end - start;
-
- fail_if(did == EINA_FALSE);
- fail_if(elapsed < 2.0);
- fail_if(elapsed > 3.0); /* 1 second "error margin" */
-
- ret = ecore_shutdown();
-}
-END_TEST
// Disabled tests: inner main loops are not supposed to work!
#if 0
@@ -204,15 +72,11 @@ static Eina_Bool _timer1(void *data)
return EINA_FALSE;
}
-START_TEST(ecore_test_ecore_main_loop_timer_inner)
+EFL_START_TEST(ecore_test_ecore_main_loop_timer_inner)
{
Ecore_Timer *timer;
- int ret;
int times = 0;
- ret = ecore_init();
- fail_if(ret < 1);
-
timer = ecore_timer_add(1.0, _timer1, &times);
fail_if(timer == NULL);
@@ -221,10 +85,8 @@ START_TEST(ecore_test_ecore_main_loop_timer_inner)
/*END: outer mainloop */
fail_if(times != 1);
-
- ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
#endif
static Eina_Bool
@@ -238,16 +100,13 @@ _fd_handler_cb(void *data, Ecore_Fd_Handler *handler EINA_UNUSED)
return EINA_FALSE;
}
-START_TEST(ecore_test_ecore_main_loop_fd_handler)
+EFL_START_TEST(ecore_test_ecore_main_loop_fd_handler)
{
Eina_Bool did = EINA_FALSE;
Ecore_Fd_Handler *fd_handler;
int comm[2];
int ret;
- ret = ecore_init();
- fail_if(ret < 1);
-
ret = pipe(comm);
fail_if(ret != 0);
@@ -265,112 +124,37 @@ START_TEST(ecore_test_ecore_main_loop_fd_handler)
fail_if(did == EINA_FALSE);
- ret = ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
-static void
-_eo_read_cb(void *data, const Efl_Event *info EINA_UNUSED)
+EFL_START_TEST(ecore_test_ecore_main_loop_fd_handler_valid_flags)
{
- Eina_Bool *did = data;
-
- *did = EINA_TRUE;
- ecore_main_loop_quit();
-}
-
-START_TEST(ecore_test_efl_loop_fd)
-{
- Eina_Bool did = EINA_FALSE;
- Eo *fd;
- int comm[2];
- int ret;
-
- ret = ecore_init();
- fail_if(ret < 1);
-
- ret = pipe(comm);
- fail_if(ret != 0);
-
- fd = efl_add(EFL_LOOP_FD_CLASS, efl_main_loop_get(),
- efl_loop_fd_set(efl_added, comm[0]),
- efl_event_callback_add(efl_added, EFL_LOOP_FD_EVENT_READ, _eo_read_cb, &did));
- fail_if(fd == NULL);
-
- ret = write(comm[1], &did, 1);
- fail_if(ret != 1);
-
- ecore_main_loop_begin();
-
- close(comm[0]);
- close(comm[1]);
-
- fail_if(did == EINA_FALSE);
-
- ret = ecore_shutdown();
-}
-END_TEST
-
-static void
-_efl_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
-{
- Eina_Bool *dead = data;
-
- *dead = EINA_TRUE;
-}
-
-START_TEST(ecore_test_efl_loop_fd_lifecycle)
-{
- Eina_Bool did = EINA_FALSE;
- Eina_Bool dead = EINA_FALSE;
- Eo *fd;
+ Ecore_Fd_Handler *fd_handler;
int comm[2];
int ret;
- efl_object_init();
-
- ret = ecore_init();
- fail_if(ret < 1);
-
ret = pipe(comm);
fail_if(ret != 0);
- fd = efl_add(EFL_LOOP_FD_CLASS, efl_main_loop_get(),
- efl_loop_fd_set(efl_added, comm[0]),
- efl_event_callback_add(efl_added, EFL_LOOP_FD_EVENT_READ, _eo_read_cb, &did),
- efl_event_callback_add(efl_added, EFL_EVENT_DEL, _efl_del_cb, &dead));
- efl_ref(fd);
- fail_if(fd == NULL);
-
- ret = write(comm[1], &did, 1);
- fail_if(ret != 1);
+ fd_handler = ecore_main_fd_handler_add
+ (comm[0], 0, _fd_handler_cb, NULL, NULL, NULL);
+ fail_if(fd_handler != NULL);
- ecore_main_loop_begin();
+ if (fd_handler)
+ ecore_main_fd_handler_del(fd_handler);
close(comm[0]);
close(comm[1]);
-
- fail_if(did == EINA_FALSE);
- fail_if(dead == EINA_TRUE);
-
- ret = ecore_shutdown();
-
- efl_del(fd);
- fail_if(dead == EINA_FALSE);
-
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_main_loop_fd_handler_activate_modify)
+EFL_START_TEST(ecore_test_ecore_main_loop_fd_handler_activate_modify)
{
Eina_Bool did = EINA_FALSE;
Ecore_Fd_Handler *fd_handler;
int comm[2];
int ret;
- ret = ecore_init();
- fail_if(ret < 1);
-
ret = pipe(comm);
fail_if(ret != 0);
@@ -390,9 +174,8 @@ START_TEST(ecore_test_ecore_main_loop_fd_handler_activate_modify)
fail_if(did != EINA_TRUE);
- ret = ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
static Eina_Bool
_event_handler_cb(void *data, int type, void *event)
@@ -500,20 +283,17 @@ _filter_end(void *user_data, void *func_data EINA_UNUSED)
(*fdid)++;
}
-START_TEST(ecore_test_ecore_main_loop_event)
+EFL_START_TEST(ecore_test_ecore_main_loop_event)
{
Ecore_Event_Handler *handler, *handler2, *handler3;
Ecore_Event_Filter *filter_handler;
Ecore_Event *event;
- int res_counter;
+ Ecore_Event *event2;
int type, type2;
int *ev = NULL;
int did = 0;
int filter = 0;
- res_counter = ecore_init();
- fail_if(res_counter < 1);
-
/* Create 2 new event types */
type = ecore_event_type_new();
fail_if(type < 1);
@@ -548,6 +328,10 @@ START_TEST(ecore_test_ecore_main_loop_event)
event = ecore_event_add(ECORE_EVENT_SIGNAL_EXIT, NULL, NULL, NULL);
fail_if(event == NULL);
+ /* Add one more events: to check a type */
+ event2 = ecore_event_add(ECORE_EVENT_NONE, NULL, NULL, NULL);
+ fail_if(event2 != NULL);
+
ecore_main_loop_begin();
/*
@@ -596,10 +380,8 @@ START_TEST(ecore_test_ecore_main_loop_event)
/* Filter counter shouldn't change */
fail_if(filter != 0); // 0
-
- res_counter = ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
#if 0
static int _log_dom;
@@ -639,7 +421,7 @@ _event_recursive_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EI
return EINA_FALSE;
}
-START_TEST(ecore_test_ecore_main_loop_event_recursive)
+EFL_START_TEST(ecore_test_ecore_main_loop_event_recursive)
{
/* This test tests if the event handlers are really called only once when
* recursive main loops are used and any number of events may have occurred
@@ -647,14 +429,10 @@ START_TEST(ecore_test_ecore_main_loop_event_recursive)
*/
Ecore_Event *e;
int type;
- int ret;
_log_dom = eina_log_domain_register("test", EINA_COLOR_CYAN);
INF("main: begin");
- ret = ecore_init();
- fail_if(ret < 1);
-
type = ecore_event_type_new();
ecore_event_handler_add(type, _event_recursive_cb, NULL);
@@ -665,24 +443,18 @@ START_TEST(ecore_test_ecore_main_loop_event_recursive)
INF(" main loop end");
INF("main: end");
- ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
#endif
-START_TEST(ecore_test_ecore_app)
+EFL_START_TEST(ecore_test_ecore_app)
{
- int ret;
-
int argc_in = 2;
const char *argv_in[] = {"arg_str_1", "arg_str2"};
int argc_out = 0;
char **argv_out = NULL;
- ret = ecore_init();
- fail_if(ret < 1);
-
ecore_app_args_set(argc_in, argv_in);
ecore_app_args_get(&argc_out, &argv_out);
@@ -693,210 +465,15 @@ START_TEST(ecore_test_ecore_app)
fail_if( 0 != strcmp(argv_in[i], argv_out[i]) );
}
- ret = ecore_shutdown();
-}
-END_TEST
-
-Eina_Bool _poller_cb(void *data)
-{
- int *val = data;
- (*val)++;
- return ECORE_CALLBACK_RENEW;
-}
-
-START_TEST(ecore_test_ecore_main_loop_poller)
-{
- int ret;
-
- Ecore_Poller *poll1_ptr = NULL;
- int poll1_interval = 1;
- int poll1_counter = 0;
-
- Ecore_Poller *poll2_ptr = NULL;
- int poll2_interval = 2;
- int poll2_counter = 0;
-
- Ecore_Poller *poll3_ptr = NULL;
- int poll3_interval = 4;
- int poll3_counter = 0;
-
- Eina_Bool did = EINA_FALSE;
-
- ret = ecore_init();
- fail_if(ret < 1);
-
- /* Check ECORE_POLLER_CORE poll interval */
- double interval = 1.0;
- ecore_poller_poll_interval_set(ECORE_POLLER_CORE, interval);
- fail_unless(CHECK_FP(ecore_poller_poll_interval_get(ECORE_POLLER_CORE), interval));
-
- /* Create three pollers with different poller interval */
- poll1_ptr = ecore_poller_add(ECORE_POLLER_CORE, poll1_interval, _poller_cb, &poll1_counter);
- poll2_ptr = ecore_poller_add(ECORE_POLLER_CORE, poll2_interval, _poller_cb, &poll2_counter);
- poll3_ptr = ecore_poller_add(ECORE_POLLER_CORE, poll3_interval, _poller_cb, &poll3_counter);
-
- /* Add one time processed quit poller */
- ecore_poller_add(ECORE_POLLER_CORE, 8, _quit_cb, &did);
-
- /* Enter main loop and wait 8 seconds for quit */
- ecore_main_loop_begin();
-
- /* Check each poller poll interval */
- fail_if(ecore_poller_poller_interval_get(poll1_ptr) != poll1_interval);
- fail_if(ecore_poller_poller_interval_get(poll2_ptr) != poll2_interval);
- fail_if(ecore_poller_poller_interval_get(poll3_ptr) != poll3_interval);
-
- /* Check each poller call counter */
- ck_assert_int_eq(8, poll1_counter);
- ck_assert_int_eq(4, poll2_counter);
- ck_assert_int_eq(2, poll3_counter);
-
- /* Destroy renewable pollers */
- ecore_poller_del(poll3_ptr);
- ecore_poller_del(poll2_ptr);
- ecore_poller_del(poll1_ptr);
-
- fail_if(did == EINA_FALSE);
-
- ret = ecore_shutdown();
-}
-END_TEST
-
-Eina_Bool _poller_handler(void *data)
-{
- int *val = data;
- (*val)++;
- return ECORE_CALLBACK_RENEW;
-}
-
-Eina_Bool _poller_loop(void *data)
-{
- int *res = data;
-
- static Ecore_Poller *poll_ptr = NULL;
- static int count = 0;
-
- switch (count)
- {
- case 2:
- poll_ptr = ecore_poller_add(ECORE_POLLER_CORE, 2, _poller_handler, res);
- break;
- case 6:
- ecore_poller_poller_interval_set(poll_ptr, 1);
- break;
- case 10:
- ecore_poller_del(poll_ptr);
- break;
- default:
- // do nothing
- break;
- }
- count++;
- return ECORE_CALLBACK_RENEW;
-}
-
-START_TEST(ecore_test_ecore_main_loop_poller_add_del)
-{
- int ret, count_res = 0;
-
- Eina_Bool did = EINA_FALSE;
-
- ret = ecore_init();
- fail_if(ret < 1);
-
- /* Create renewable main poller */
- Ecore_Poller *poll_ptr = ecore_poller_add(ECORE_POLLER_CORE, 1, _poller_loop, &count_res);
-
- /* One time processed poller */
- ecore_poller_add(ECORE_POLLER_CORE, 16, _quit_cb, &did);
-
- /* Enter main loop and wait for quit*/
- ecore_main_loop_begin();
-
- fprintf(stderr, "count_res: %i\n", count_res);
- /* Validation call counter */
- fail_if(6 != count_res);
-
- /* Destroy renewable main poller */
- ecore_poller_del(poll_ptr);
-
- fail_if(did == EINA_FALSE);
-
- ret = ecore_shutdown();
-}
-END_TEST
-
-START_TEST(ecore_test_efl_loop_register)
-{
- Efl_Object *t, *n;
-
- ecore_init();
-
- t = efl_provider_find(efl_main_loop_get(), EFL_LOOP_CLASS);
- fail_if(!efl_isa(t, EFL_LOOP_CLASS));
-
- t = efl_provider_find(efl_main_loop_get(), EFL_LOOP_TIMER_CLASS);
- fail_if(t != NULL);
-
- n = efl_add(EFL_LOOP_TIMER_CLASS, efl_main_loop_get());
- fail_if(n != NULL);
-
- n = efl_add(EFL_LOOP_TIMER_CLASS, efl_main_loop_get(),
- efl_loop_timer_interval_set(efl_added, 1.0));
- efl_loop_register(efl_main_loop_get(), EFL_LOOP_TIMER_CLASS, n);
-
- t = efl_provider_find(efl_main_loop_get(), EFL_LOOP_TIMER_CLASS);
- fail_if(!efl_isa(t, EFL_LOOP_TIMER_CLASS));
- fail_if(t != n);
-
- efl_loop_unregister(efl_main_loop_get(), EFL_LOOP_TIMER_CLASS, n);
-
- t = efl_provider_find(efl_main_loop_get(), EFL_LOOP_TIMER_CLASS);
- fail_if(t != NULL);
-
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(ecore_test_efl_app_version)
-{
- const Efl_Version *ver;
- Eo *loop;
-
- ecore_init();
-
- loop = efl_loop_main_get(EFL_LOOP_CLASS);
- fail_if(!efl_isa(loop, EFL_LOOP_CLASS));
-
- efl_build_version_set(EFL_VERSION_MAJOR, EFL_VERSION_MINOR, 0, 0, NULL, EFL_BUILD_ID);
- ver = efl_loop_app_efl_version_get(loop);
- fail_if(!ver);
- fail_if(ver->major != EFL_VERSION_MAJOR);
- fail_if(ver->minor != EFL_VERSION_MINOR);
- fail_if(ver->micro != 0);
- fail_if(ver->revision != 0);
- fail_if(ver->flavor);
- fail_if(!eina_streq(ver->build_id, EFL_BUILD_ID));
-
- ver = efl_loop_efl_version_get(loop);
- fail_if(!ver);
- fail_if(ver->major != EFL_VERSION_MAJOR);
- fail_if(ver->minor != EFL_VERSION_MINOR);
-
- ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
void ecore_test_ecore(TCase *tc)
{
tcase_add_test(tc, ecore_test_ecore_init);
tcase_add_test(tc, ecore_test_ecore_main_loop);
- tcase_add_test(tc, ecore_test_ecore_main_loop_idler);
- tcase_add_test(tc, ecore_test_ecore_main_loop_idle_enterer);
- tcase_add_test(tc, ecore_test_ecore_main_loop_idle_before_enterer);
- tcase_add_test(tc, ecore_test_ecore_main_loop_idle_exiter);
- tcase_add_test(tc, ecore_test_ecore_main_loop_timer);
tcase_add_test(tc, ecore_test_ecore_main_loop_fd_handler);
+ tcase_add_test(tc, ecore_test_ecore_main_loop_fd_handler_valid_flags);
tcase_add_test(tc, ecore_test_ecore_main_loop_fd_handler_activate_modify);
tcase_add_test(tc, ecore_test_ecore_main_loop_event);
#if 0
@@ -904,10 +481,4 @@ void ecore_test_ecore(TCase *tc)
tcase_add_test(tc, ecore_test_ecore_main_loop_event_recursive);
#endif
tcase_add_test(tc, ecore_test_ecore_app);
- tcase_add_test(tc, ecore_test_ecore_main_loop_poller);
- tcase_add_test(tc, ecore_test_ecore_main_loop_poller_add_del);
- tcase_add_test(tc, ecore_test_efl_loop_fd);
- tcase_add_test(tc, ecore_test_efl_loop_fd_lifecycle);
- tcase_add_test(tc, ecore_test_efl_loop_register);
- tcase_add_test(tc, ecore_test_efl_app_version);
}
diff --git a/src/tests/ecore/ecore_test_ecore_audio.c b/src/tests/ecore/ecore_test_ecore_audio.c
index 1a88adff3d..0537014631 100644
--- a/src/tests/ecore/ecore_test_ecore_audio.c
+++ b/src/tests/ecore/ecore_test_ecore_audio.c
@@ -51,20 +51,20 @@ _seek_vol(void *data)
return EINA_FALSE;
}
-START_TEST(ecore_test_ecore_audio_obj_pulse)
+EFL_START_TEST(ecore_test_ecore_audio_obj_pulse)
{
Eo *in, *out;
Eina_Bool ret = EINA_FALSE;
Eina_Bool pulse_context_failed = EINA_FALSE;
- in = efl_add(ECORE_AUDIO_IN_SNDFILE_CLASS, NULL);
+ in = efl_add_ref(ECORE_AUDIO_IN_SNDFILE_CLASS, NULL);
fail_if(!in);
- ecore_audio_obj_name_set(in, "sample.wav");
+ efl_name_set(in, "sample.wav");
ret = ecore_audio_obj_source_set(in, TESTS_SRC_DIR"/sample.wav");
fail_if(!ret);
- out = efl_add(ECORE_AUDIO_OUT_PULSE_CLASS, NULL);
+ out = efl_add_ref(ECORE_AUDIO_OUT_PULSE_CLASS, NULL);
fail_if(!out);
ecore_timer_add(1.8, _seek_vol, in);
@@ -78,10 +78,10 @@ START_TEST(ecore_test_ecore_audio_obj_pulse)
ecore_main_loop_begin();
fail_if(pulse_context_failed);
- efl_del(out);
- efl_del(in);
+ efl_unref(out);
+ efl_unref(in);
}
-END_TEST
+EFL_END_TEST
#endif
#endif
@@ -96,24 +96,24 @@ static Eina_Bool
_idle_del(void *data)
{
Eo *in = data;
- efl_del(in);
+ efl_unref(in);
ecore_idler_add(_quit, NULL);
return EINA_FALSE;
}
-START_TEST(ecore_test_ecore_audio_cleanup)
+EFL_START_TEST(ecore_test_ecore_audio_cleanup)
{
Eo *in, *out;
int freq = 1000;
Eina_Bool ret = EINA_FALSE;
- in = efl_add(ECORE_AUDIO_IN_TONE_CLASS, NULL);
+ in = efl_add_ref(ECORE_AUDIO_IN_TONE_CLASS, NULL);
fail_if(!in);
efl_key_data_set(in, ECORE_AUDIO_ATTR_TONE_FREQ, &freq);
ecore_audio_obj_in_length_set(in, 2);
- out = efl_add(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL);
+ out = efl_add_ref(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL);
fail_if(!out);
ret = ecore_audio_obj_format_set(out, ECORE_AUDIO_FORMAT_OGG);
fail_if(!ret);
@@ -129,9 +129,9 @@ START_TEST(ecore_test_ecore_audio_cleanup)
ecore_file_remove(TESTS_BUILD_DIR"/tmp.ogg");
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_audio_obj_tone)
+EFL_START_TEST(ecore_test_ecore_audio_obj_tone)
{
Eo *in, *out;
double len;
@@ -139,10 +139,10 @@ START_TEST(ecore_test_ecore_audio_obj_tone)
Eina_Bool ret;
char *tmp;
- in = efl_add(ECORE_AUDIO_IN_TONE_CLASS, NULL);
+ in = efl_add_ref(ECORE_AUDIO_IN_TONE_CLASS, NULL);
fail_if(!in);
- ecore_audio_obj_name_set(in, "tone");
+ efl_name_set(in, "tone");
channel = ecore_audio_obj_in_channels_get(in);
fail_if(channel != 1);
@@ -197,10 +197,10 @@ START_TEST(ecore_test_ecore_audio_obj_tone)
len = ecore_audio_obj_in_remaining_get(in);
fail_if(len != 1.0);
- out = efl_add(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL);
+ out = efl_add_ref(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL);
fail_if(!out);
- ecore_audio_obj_name_set(out, "tmp.wav");
+ efl_name_set(out, "tmp.wav");
ret = ecore_audio_obj_format_set(out, ECORE_AUDIO_FORMAT_WAV);
fail_if(!ret);
ret = ecore_audio_obj_source_set(out, TESTS_BUILD_DIR"/tmp.wav");
@@ -214,15 +214,15 @@ START_TEST(ecore_test_ecore_audio_obj_tone)
ecore_main_loop_begin();
- efl_del(in);
- efl_del(out);
+ efl_unref(in);
+ efl_unref(out);
//TODO: Compare and fail
ecore_file_remove(TESTS_BUILD_DIR"/tmp.wav");
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_audio_obj_sndfile)
+EFL_START_TEST(ecore_test_ecore_audio_obj_sndfile)
{
Eo *in, *out;
double len, rem;
@@ -231,7 +231,7 @@ START_TEST(ecore_test_ecore_audio_obj_sndfile)
Ecore_Audio_Format fmt;
const char *src;
- in = efl_add(ECORE_AUDIO_IN_SNDFILE_CLASS, NULL);
+ in = efl_add_ref(ECORE_AUDIO_IN_SNDFILE_CLASS, NULL);
fail_if(!in);
fmt = ecore_audio_obj_format_get(in);
@@ -246,7 +246,7 @@ START_TEST(ecore_test_ecore_audio_obj_sndfile)
ret = ecore_audio_obj_format_set(in, ECORE_AUDIO_FORMAT_AUTO);
fail_if(!ret);
- ecore_audio_obj_name_set(in, "sample.ogg");
+ efl_name_set(in, "sample.ogg");
ret = ecore_audio_obj_source_set(in, TESTS_SRC_DIR"/sample.ogg");
fail_if(!ret);
@@ -277,10 +277,10 @@ START_TEST(ecore_test_ecore_audio_obj_sndfile)
len = ecore_audio_obj_in_seek(in, -1.5, SEEK_END);
fail_if(fabs(rem - 1 - len) > 0.6);
- out = efl_add(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL);
+ out = efl_add_ref(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL);
fail_if(!out);
- ecore_audio_obj_name_set(out, "tmp.wav");
+ efl_name_set(out, "tmp.wav");
ret = ecore_audio_obj_format_set(out, ECORE_AUDIO_FORMAT_WAV);
fail_if(!ret);
@@ -304,23 +304,23 @@ START_TEST(ecore_test_ecore_audio_obj_sndfile)
ecore_main_loop_begin();
- efl_del(in);
- efl_del(out);
+ efl_unref(in);
+ efl_unref(out);
//TODO: Compare and fail
ecore_file_remove(TESTS_BUILD_DIR"/tmp.wav");
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_audio_obj_in_out)
+EFL_START_TEST(ecore_test_ecore_audio_obj_in_out)
{
Eo *out2;
Eina_List *in3;
Eina_Bool attached;
- Eo *in = efl_add(ECORE_AUDIO_IN_CLASS, NULL);
- Eo *in2 = efl_add(ECORE_AUDIO_IN_CLASS, NULL);
- Eo *out = efl_add(ECORE_AUDIO_OUT_CLASS, NULL);
+ Eo *in = efl_add_ref(ECORE_AUDIO_IN_CLASS, NULL);
+ Eo *in2 = efl_add_ref(ECORE_AUDIO_IN_CLASS, NULL);
+ Eo *out = efl_add_ref(ECORE_AUDIO_OUT_CLASS, NULL);
fail_if(!in);
fail_if(!in2);
@@ -357,22 +357,22 @@ START_TEST(ecore_test_ecore_audio_obj_in_out)
fail_if(eina_list_count(in3) != 2);
fail_if(eina_list_data_get(in3) != in);
- efl_del(in2);
+ efl_unref(in2);
in3 = ecore_audio_obj_out_inputs_get(out);
fail_if(eina_list_count(in3) != 1);
fail_if(eina_list_data_get(in3) != in);
- efl_del(out);
+ efl_unref(out);
out2 = ecore_audio_obj_in_output_get(in);
fail_if(out2);
- efl_del(in);
+ efl_unref(in);
}
-END_TEST
+EFL_END_TEST
static int read_cb(void *data EINA_UNUSED, Eo *eo_obj EINA_UNUSED, void *buffer, int len)
{
@@ -412,14 +412,14 @@ Ecore_Audio_Vio out_vio = {
.write = write_cb,
};
-START_TEST(ecore_test_ecore_audio_obj_vio)
+EFL_START_TEST(ecore_test_ecore_audio_obj_vio)
{
Eo *in, *out;
- in = efl_add(ECORE_AUDIO_IN_CLASS, NULL);
+ in = efl_add_ref(ECORE_AUDIO_IN_CLASS, NULL);
fail_if(!in);
- out = efl_add(ECORE_AUDIO_OUT_CLASS, NULL);
+ out = efl_add_ref(ECORE_AUDIO_OUT_CLASS, NULL);
fail_if(!out);
ecore_audio_obj_vio_set(in, &in_vio, NULL, NULL);
@@ -429,10 +429,10 @@ START_TEST(ecore_test_ecore_audio_obj_vio)
ecore_main_loop_begin();
- efl_del(out);
- efl_del(in);
+ efl_unref(out);
+ efl_unref(in);
}
-END_TEST
+EFL_END_TEST
static void _myfree(void *data)
{
@@ -441,7 +441,7 @@ static void _myfree(void *data)
*freed = EINA_TRUE;
}
-START_TEST(ecore_test_ecore_audio_obj_in)
+EFL_START_TEST(ecore_test_ecore_audio_obj_in)
{
int i;
double speed, length;
@@ -454,7 +454,7 @@ START_TEST(ecore_test_ecore_audio_obj_in)
Ecore_Audio_Vio vio;
Eina_Bool freed = EINA_FALSE;
- Eo *in = efl_add(ECORE_AUDIO_IN_CLASS, NULL);
+ Eo *in = efl_add_ref(ECORE_AUDIO_IN_CLASS, NULL);
fail_if(!in);
@@ -529,11 +529,11 @@ START_TEST(ecore_test_ecore_audio_obj_in)
fail_if(buf[i] != 0x00);
}
- efl_del(in);
+ efl_unref(in);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_audio_obj)
+EFL_START_TEST(ecore_test_ecore_audio_obj)
{
int i;
const char *name;
@@ -541,10 +541,10 @@ START_TEST(ecore_test_ecore_audio_obj)
double volume;
Eo *objs[2], *obj;
- objs[0] = efl_add(ECORE_AUDIO_IN_CLASS, NULL);
+ objs[0] = efl_add_ref(ECORE_AUDIO_IN_CLASS, NULL);
fail_if(!objs[0]);
- objs[1] = efl_add(ECORE_AUDIO_OUT_CLASS, NULL);
+ objs[1] = efl_add_ref(ECORE_AUDIO_OUT_CLASS, NULL);
fail_if(!objs[1]);
for (i=0; i<2; i++) {
@@ -552,16 +552,16 @@ START_TEST(ecore_test_ecore_audio_obj)
fail_if(!obj);
- name = ecore_audio_obj_name_get(obj);
+ name = efl_name_get(obj);
fail_if(name);
- ecore_audio_obj_name_set(obj, "In1");
- name = ecore_audio_obj_name_get(obj);
+ efl_name_set(obj, "In1");
+ name = efl_name_get(obj);
ck_assert_str_eq(name, "In1");
- ecore_audio_obj_name_get(obj);
+ efl_name_get(obj);
paused = ecore_audio_obj_paused_get(obj);
fail_if(paused);
@@ -577,13 +577,13 @@ START_TEST(ecore_test_ecore_audio_obj)
volume = ecore_audio_obj_volume_get(obj);
fail_if(volume != 0.5);
- efl_del(obj);
+ efl_unref(obj);
}
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_audio_init)
+EFL_START_TEST(ecore_test_ecore_audio_init)
{
int ret;
@@ -594,18 +594,12 @@ START_TEST(ecore_test_ecore_audio_init)
ck_assert_int_eq(ret, 1);
}
-END_TEST
+EFL_END_TEST
void setup(void)
{
int ret;
- ret = eina_init();
- ck_assert_int_eq(ret, 1);
-
- ret = ecore_init();
- fail_if(ret < 1);
-
ret = ecore_audio_init();
ck_assert_int_eq(ret, 1);
}
@@ -613,8 +607,6 @@ void setup(void)
void teardown(void)
{
ecore_audio_shutdown();
- ecore_shutdown();
- eina_shutdown();
}
void
diff --git a/src/tests/ecore/ecore_test_ecore_drm.c b/src/tests/ecore/ecore_test_ecore_drm.c
deleted file mode 100644
index ac02f260b1..0000000000
--- a/src/tests/ecore/ecore_test_ecore_drm.c
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <stdio.h>
-#include <unistd.h>
-
-#include <Ecore_Drm.h>
-
-#include "ecore_suite.h"
-
-#define MAX_ITER 10
-
-START_TEST(ecore_test_ecore_drm_shutdown_bef_init)
-{
- int ret = 0;
-
- ret = ecore_drm_shutdown();
- fprintf(stderr, "Calling ecore_drm_shutdown without calling ecore_drm_init.\n");
- fail_if(ret != 0);
-
- ret = ecore_drm_init();
- fprintf(stderr, "Calling ecore_drm_init.\n");
- fail_if(ret != 1);
-
- ret = ecore_drm_shutdown();
- fprintf(stderr, "Calling ecore_drm_shutdown after ecore_drm_init.\n");
- fail_if(ret != 0);
-}
-END_TEST
-
-START_TEST(ecore_test_ecore_drm_init)
-{
- int ret, i, j;
-
- for (i = 1; i <= MAX_ITER; i++)
- {
- ret = ecore_drm_init();
- fprintf(stderr, "Created %d ecore drm instance.\n", i);
- fail_if(ret != i);
- }
-
- for (j = MAX_ITER - 1; j >= 0; j--)
- {
- ret = ecore_drm_shutdown();
- fprintf(stderr, "Deleted %d ecore drm instance.\n", MAX_ITER - j);
- fail_if(ret != j);
- }
-}
-END_TEST
-
-void ecore_test_ecore_drm(TCase *tc)
-{
- tcase_add_test(tc, ecore_test_ecore_drm_init);
- tcase_add_test(tc, ecore_test_ecore_drm_shutdown_bef_init);
-}
diff --git a/src/tests/ecore/ecore_test_ecore_evas.c b/src/tests/ecore/ecore_test_ecore_evas.c
index a9e97c0b60..2e53f62082 100644
--- a/src/tests/ecore/ecore_test_ecore_evas.c
+++ b/src/tests/ecore/ecore_test_ecore_evas.c
@@ -9,7 +9,7 @@
#define WINDOW_HEIGHT 200
#define WINDOW_WIDTH 200
-START_TEST(ecore_test_ecore_evas_associate)
+EFL_START_TEST(ecore_test_ecore_evas_associate)
{
Ecore_Evas *ee;
Evas *canvas;
@@ -34,9 +34,9 @@ START_TEST(ecore_test_ecore_evas_associate)
ret = ecore_evas_shutdown();
fail_if(ret != 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_evas_cocoa)
+EFL_START_TEST(ecore_test_ecore_evas_cocoa)
{
int ret;
Ecore_Evas *ee;
@@ -68,7 +68,7 @@ START_TEST(ecore_test_ecore_evas_cocoa)
ret = ecore_evas_shutdown();
fail_if(ret != 0);
}
-END_TEST
+EFL_END_TEST
void ecore_test_ecore_evas(TCase *tc)
{
diff --git a/src/tests/ecore/ecore_test_ecore_fb.c b/src/tests/ecore/ecore_test_ecore_fb.c
index ee5bbb1534..f639dfefb6 100644
--- a/src/tests/ecore/ecore_test_ecore_fb.c
+++ b/src/tests/ecore/ecore_test_ecore_fb.c
@@ -11,7 +11,7 @@
#define MAX_ITER 10
-START_TEST(ecore_test_ecore_fb_init)
+EFL_START_TEST(ecore_test_ecore_fb_init)
{
// SKIP fb test as all it tests is init and shutdown and nothing else
// and these require basically a linux box with root or special
@@ -36,7 +36,7 @@ START_TEST(ecore_test_ecore_fb_init)
}
*/
}
-END_TEST
+EFL_END_TEST
void ecore_test_ecore_fb(TCase *tc)
{
diff --git a/src/tests/ecore/ecore_test_ecore_file.c b/src/tests/ecore/ecore_test_ecore_file.c
index ce18d01e2b..2f1648f793 100644
--- a/src/tests/ecore/ecore_test_ecore_file.c
+++ b/src/tests/ecore/ecore_test_ecore_file.c
@@ -115,7 +115,7 @@ progress_cb(void *data EINA_UNUSED, const char *file EINA_UNUSED,
return ECORE_FILE_PROGRESS_CONTINUE;
}
-START_TEST(ecore_test_ecore_file_init)
+EFL_START_TEST(ecore_test_ecore_file_init)
{
int ret;
@@ -125,9 +125,9 @@ START_TEST(ecore_test_ecore_file_init)
ret = ecore_file_shutdown();
fail_if(ret != 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_file_operations)
+EFL_START_TEST(ecore_test_ecore_file_operations)
{
const char* dirs[] = {"b", "b/c", "b/c/d", "d", 0};
char *dirs2[] = {"a2", "b2", "c2", 0};
@@ -215,12 +215,15 @@ START_TEST(ecore_test_ecore_file_operations)
res = ecore_file_remove(dest_file);
fail_if(res != EINA_TRUE);
+ /* On Windows, symlink/readlink are not supported */
+#ifndef _WIN32
res = ecore_file_symlink(src_file, dest_file);
fail_if(res != EINA_TRUE);
ck_assert_str_eq(ecore_file_readlink(dest_file), src_file);
ck_assert_str_eq(ecore_file_realpath(dest_file), src_file);
res = ecore_file_unlink(dest_file);
fail_if(res != EINA_TRUE);
+#endif
dest_file = get_tmp_file();
fail_if(!dest_file);
@@ -302,8 +305,13 @@ START_TEST(ecore_test_ecore_file_operations)
fail_if(fd < 0);
fail_if(close(fd) != 0);
fail_if(ecore_file_can_read(src_file) != EINA_TRUE);
- fail_if(ecore_file_can_write(src_file) != EINA_FALSE);
- fail_if(ecore_file_can_exec(src_file) != EINA_FALSE);
+#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
+ if (getuid() || geteuid())
+#endif
+ {
+ fail_if(ecore_file_can_write(src_file) != EINA_FALSE);
+ fail_if(ecore_file_can_exec(src_file) != EINA_FALSE);
+ }
fail_if(ecore_file_cp(src_file, src_file) != EINA_FALSE);
fail_if(ecore_file_remove(src_file) != EINA_TRUE);
@@ -313,9 +321,14 @@ START_TEST(ecore_test_ecore_file_operations)
fd = open(src_file, O_RDWR | O_BINARY | O_CREAT, 0200);
fail_if(fd < 0);
fail_if(close(fd) != 0);
- fail_if(ecore_file_can_read(src_file) != EINA_FALSE);
- fail_if(ecore_file_can_write(src_file) != EINA_TRUE);
+#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
+ if (getuid() || geteuid())
+#endif
+ {
+ fail_if(ecore_file_can_read(src_file) != EINA_FALSE);
+ }
fail_if(ecore_file_can_exec(src_file) != EINA_FALSE);
+ fail_if(ecore_file_can_write(src_file) != EINA_TRUE);
fail_if(ecore_file_remove(src_file) != EINA_TRUE);
src_file = get_tmp_file();
@@ -324,8 +337,13 @@ START_TEST(ecore_test_ecore_file_operations)
fd = open(src_file, O_RDWR | O_BINARY | O_CREAT, 0100);
fail_if(fd < 0);
fail_if(close(fd) != 0);
- fail_if(ecore_file_can_read(src_file) != EINA_FALSE);
- fail_if(ecore_file_can_write(src_file) != EINA_FALSE);
+#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
+ if (getuid() || geteuid())
+#endif
+ {
+ fail_if(ecore_file_can_read(src_file) != EINA_FALSE);
+ fail_if(ecore_file_can_write(src_file) != EINA_FALSE);
+ }
fail_if(ecore_file_can_exec(src_file) != EINA_TRUE);
fail_if(ecore_file_remove(src_file) != EINA_TRUE);
@@ -334,7 +352,7 @@ START_TEST(ecore_test_ecore_file_operations)
fail_if(ecore_file_cp(not_exist_file, "test_file") != EINA_FALSE);
fail_if(ecore_file_mv(not_exist_file, "test_file") != EINA_FALSE);
- chdir(eina_environment_tmp_get());
+ ck_assert_int_eq(chdir(eina_environment_tmp_get()), 0);
fail_if(ecore_file_mkpath(src_dir) != EINA_TRUE);
fail_if(ecore_file_rmdir(src_dir) != EINA_TRUE);
fail_if(ecore_file_mkpath(NULL) != EINA_FALSE);
@@ -352,9 +370,9 @@ START_TEST(ecore_test_ecore_file_operations)
fail_if(ret != 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_file_path)
+EFL_START_TEST(ecore_test_ecore_file_path)
{
const char *src_dir, *src_file, *dest_file;
char *dup_dir, *path;
@@ -415,9 +433,9 @@ START_TEST(ecore_test_ecore_file_path)
ret = ecore_file_shutdown();
fail_if(ret != 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_file_monitor)
+EFL_START_TEST(ecore_test_ecore_file_monitor)
{
Ecore_File_Monitor *mon;
const char *src_dir;
@@ -470,13 +488,13 @@ START_TEST(ecore_test_ecore_file_monitor)
fail_if(ret != 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_file_download)
+EFL_START_TEST(ecore_test_ecore_file_download)
{
const char *download_dir;
const char *download_file;
- const char *download_url = "http://check.sourceforge.net/xml/check_unittest.xslt";
+ const char *download_url = "http://example.com";
char dest_name[MAXSIZE] = {'\0'};
Eina_Bool res;
Eina_Hash *headers;
@@ -488,22 +506,12 @@ START_TEST(ecore_test_ecore_file_download)
download_dir = get_tmp_dir();
fail_if(!download_dir);
- download_file = ecore_file_file_get(download_url);
+ download_file = ecore_file_file_get(download_url); //example.com
fail_if(!download_file);
fail_if(!ecore_file_download_protocol_available("http://"));
strcat(dest_name, download_dir);
strcat(dest_name, "/");
strcat(dest_name, download_file);
- res = ecore_file_download(download_url, dest_name, completion_cb,
- progress_cb, NULL, &job);
- fail_if(res != EINA_TRUE);
- fail_if(!job);
- ecore_main_loop_begin();
- fprintf(stderr, "Downloaded %lld bytes\n", ecore_file_size(dest_name));
- res = ecore_file_exists(dest_name);
- fail_if(res != EINA_TRUE);
- res = ecore_file_unlink(dest_name);
- fail_if(res != EINA_TRUE);
res = ecore_file_download("xxyyzz", dest_name, completion_cb,
progress_cb, NULL, &job);
@@ -515,27 +523,30 @@ START_TEST(ecore_test_ecore_file_download)
fail_if(!job);
ecore_file_download_abort(job);
ecore_main_loop_begin();
+ if (timeout_reached) goto end;
res = ecore_file_remove(dest_name);
fail_if(res != EINA_TRUE);
headers = eina_hash_string_small_new(NULL);
- eina_hash_add(headers, "Content-type", "text/xml");
+ eina_hash_add(headers, "Content-type", "text/html");
res = ecore_file_download_full(download_url, dest_name, completion_cb,
- progress_cb, NULL, NULL, headers);
+ progress_cb, NULL, &job, headers);
fail_if(res != EINA_TRUE);
+ fail_if(!job);
ecore_main_loop_begin();
+ if (timeout_reached) goto end;
fprintf(stderr, "Downloaded %lld bytes\n", ecore_file_size(dest_name));
res = ecore_file_exists(dest_name);
fail_if(res != EINA_TRUE);
-
+end:
res = ecore_file_recursive_rm(download_dir);
fail_if(res != EINA_TRUE);
ret = ecore_file_shutdown();
fail_if(ret != 0);
}
-END_TEST
+EFL_END_TEST
void ecore_test_ecore_file(TCase *tc)
{
diff --git a/src/tests/ecore/ecore_test_ecore_imf.c b/src/tests/ecore/ecore_test_ecore_imf.c
index 8bd017394c..9851c77fa1 100644
--- a/src/tests/ecore/ecore_test_ecore_imf.c
+++ b/src/tests/ecore/ecore_test_ecore_imf.c
@@ -6,12 +6,12 @@
#include "ecore_suite.h"
-START_TEST(ecore_test_ecore_imf_init)
+EFL_START_TEST(ecore_test_ecore_imf_init)
{
ecore_imf_init();
ecore_imf_shutdown();
}
-END_TEST
+EFL_END_TEST
static const char *built_modules[] = {
#ifdef ENABLE_XIM
@@ -34,6 +34,12 @@ _find_list(const Eina_List *lst, const char *item)
{
const Eina_List *n;
const char *s;
+
+ /* these modules (currently) require x11 to run */
+ if (eina_streq(item, "xim") || eina_streq(item, "ibus"))
+ {
+ if (!getenv("DISPLAY")) return EINA_TRUE;
+ }
EINA_LIST_FOREACH(lst, n, s)
{
if (strcmp(s, item) == 0)
@@ -42,10 +48,11 @@ _find_list(const Eina_List *lst, const char *item)
return EINA_FALSE;
}
-START_TEST(ecore_test_ecore_imf_modules)
+EFL_START_TEST(ecore_test_ecore_imf_modules)
{
Eina_List *modules;
const char **itr;
+ char *failure = NULL;
putenv("ECORE_IMF_MODULE=");
ecore_imf_init();
@@ -54,31 +61,46 @@ START_TEST(ecore_test_ecore_imf_modules)
for (itr = built_modules; *itr != NULL; itr++)
{
Eina_Bool found = _find_list(modules, *itr);
- fail_if(!found, "imf module should be built, but was not found: %s",
- *itr);
+ if (!found) failure = eina_strdup(*itr);
+ if (failure) break;
}
eina_list_free(modules);
ecore_imf_shutdown();
+ ck_assert_msg(!failure, "compiled imf module not found: %s", failure);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_imf_modules_load)
+EFL_START_TEST(ecore_test_ecore_imf_modules_load)
{
const char **itr;
+ char *failure = NULL;
putenv("ECORE_IMF_MODULE=");
ecore_imf_init();
for (itr = built_modules; *itr != NULL; itr++)
{
- Ecore_IMF_Context *ctx = ecore_imf_context_add(*itr);
- fail_if(ctx == NULL, "could not add imf context: %s", *itr);
+ Ecore_IMF_Context *ctx;
+
+ /* these modules (currently) require x11 to run */
+ if (eina_streq(*itr, "xim") || eina_streq(*itr, "ibus"))
+ {
+ if (!getenv("DISPLAY")) continue;
+ }
+
+ ctx = ecore_imf_context_add(*itr);
+ if (!ctx)
+ {
+ failure = eina_strdup(*itr);
+ break;
+ }
ecore_imf_context_del(ctx);
}
ecore_imf_shutdown();
+ ck_assert_msg(!failure, "could not add imf context: %s", failure);
}
-END_TEST
+EFL_END_TEST
void ecore_test_ecore_imf(TCase *tc)
{
diff --git a/src/tests/ecore/ecore_test_ecore_input.c b/src/tests/ecore/ecore_test_ecore_input.c
index ccb0c92405..6d0420eb64 100644
--- a/src/tests/ecore/ecore_test_ecore_input.c
+++ b/src/tests/ecore/ecore_test_ecore_input.c
@@ -11,25 +11,23 @@
#define MAX_ITER 10
-START_TEST(ecore_test_ecore_input_init)
+EFL_START_TEST(ecore_test_ecore_input_init)
{
int ret, i, j;
for (i = 1; i <= MAX_ITER; i++)
{
ret = ecore_event_init();
- fprintf(stderr, "Created %d ecore input instance.\n", i);
fail_if(ret != i);
}
for (j = MAX_ITER - 1; j >= 0; j--)
{
ret = ecore_event_shutdown();
- fprintf(stderr, "Deleted %d ecore input instance.\n", MAX_ITER - j);
fail_if(ret != j);
}
}
-END_TEST
+EFL_END_TEST
void ecore_test_ecore_input(TCase *tc)
{
diff --git a/src/tests/ecore/ecore_test_ecore_thread_eina_thread_queue.c b/src/tests/ecore/ecore_test_ecore_thread_eina_thread_queue.c
index 65bf85757e..d9b7501f8b 100644
--- a/src/tests/ecore/ecore_test_ecore_thread_eina_thread_queue.c
+++ b/src/tests/ecore/ecore_test_ecore_thread_eina_thread_queue.c
@@ -24,7 +24,7 @@ typedef struct
} Msg;
static void
-th1_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
+th1_do(void *data EINA_UNUSED, Ecore_Thread *th)
{
int val = 100;
@@ -33,19 +33,18 @@ th1_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
Msg *msg;
void *ref;
- usleep((rand() % 10) * 1000);
msg = eina_thread_queue_send(thq1, sizeof(Msg), &ref);
if (!msg) fail();
msg->value = val;
memset(msg->pad, 0x32, 10);
eina_thread_queue_send_done(thq1, ref);
- if (val == 1000) break;
+ if (val == 1000 || (ecore_thread_check(th))) break;
val++;
}
}
static void
-th2_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
+th2_do(void *data EINA_UNUSED, Ecore_Thread *th)
{
int val;
@@ -57,7 +56,6 @@ th2_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
msg = eina_thread_queue_wait(thq1, &ref);
if (!msg) fail();
val = msg->value;
- usleep((rand() % 20) * 1000);
eina_thread_queue_wait_done(thq1, ref);
msg = eina_thread_queue_send(thq2, sizeof(Msg), &ref);
@@ -65,23 +63,21 @@ th2_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
msg->value = val;
memset(msg->pad, 0x32, 10);
eina_thread_queue_send_done(thq2, ref);
- if (val == 1000) break;
+ if (val == 1000 || (ecore_thread_check(th))) break;
}
}
-START_TEST(ecore_test_ecore_thread_eina_thread_queue_t1)
+EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t1)
{
int val = 99;
-
- eina_init();
- ecore_init();
+ Ecore_Thread *eth1, *eth2;
thq1 = eina_thread_queue_new();
if (!thq1) fail();
thq2 = eina_thread_queue_new();
if (!thq2) fail();
- ecore_thread_feedback_run(th1_do, NULL, NULL, NULL, NULL, EINA_TRUE);
- ecore_thread_feedback_run(th2_do, NULL, NULL, NULL, NULL, EINA_TRUE);
+ eth1 = ecore_thread_feedback_run(th1_do, NULL, NULL, NULL, NULL, EINA_TRUE);
+ eth2 = ecore_thread_feedback_run(th2_do, NULL, NULL, NULL, NULL, EINA_TRUE);
for (;;)
{
@@ -92,19 +88,18 @@ START_TEST(ecore_test_ecore_thread_eina_thread_queue_t1)
if (DEBUG) printf("V: %i [%i]\n", msg->value, eina_thread_queue_pending_get(thq2));
if (msg->value != (val + 1))
{
- printf("ERRR %i not next after %i\n", msg->value, val);
- fail();
+ ck_abort_msg("ERRR %i not next after %i\n", msg->value, val);
}
val = msg->value;
- usleep((rand() % 30) * 1000);
eina_thread_queue_wait_done(thq2, ref);
if (val == 1000) break;
}
-
- ecore_shutdown();
- eina_shutdown();
+ ecore_thread_wait(eth1, 0.1);
+ ecore_thread_wait(eth2, 0.1);
+ eina_thread_queue_free(thq1);
+ eina_thread_queue_free(thq2);
}
-END_TEST
+EFL_END_TEST
/////////////////////////////////////////////////////////////////////////////
typedef struct
@@ -116,7 +111,7 @@ typedef struct
static volatile int msgs = 0;
static void
-thspeed2_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
+thspeed2_do(void *data EINA_UNUSED, Ecore_Thread *th)
{
Msg2 *msg;
void *ref;
@@ -129,45 +124,42 @@ thspeed2_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
msgs++;
eina_thread_queue_wait_done(thq1, ref);
}
- if (msgs == 10000000)
+ if (msgs == 1000 || (ecore_thread_check(th)))
{
- printf("msgs done\n");
+ if (DEBUG) printf("msgs done\n");
break;
}
}
}
-START_TEST(ecore_test_ecore_thread_eina_thread_queue_t2)
+EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t2)
{
Msg2 *msg;
void *ref;
int i, mcount;
-
- eina_init();
- ecore_init();
+ Ecore_Thread *th;
thq1 = eina_thread_queue_new();
if (!thq1) fail();
- ecore_thread_feedback_run(thspeed2_do, NULL, NULL, NULL, NULL, EINA_TRUE);
+ th = ecore_thread_feedback_run(thspeed2_do, NULL, NULL, NULL, NULL, EINA_TRUE);
- for (i = 0; i < 10000000; i++)
+ for (i = 0; i < 1000; i++)
{
msg = eina_thread_queue_send(thq1, sizeof(Msg2), &ref);
if (!msg) fail();
if (msg) eina_thread_queue_send_done(thq1, ref);
}
+ ecore_thread_wait(th, 100.0);
mcount = msgs;
- if (mcount < 1000000)
+ if (mcount < 1000)
{
- printf("ERR: not enough messages recieved\n");
- fail();
+ ck_abort_msg("ERR: not enough messages recieved -> %i\n", mcount);
}
- printf("%i messages sent\n", i);
-
- ecore_shutdown();
- eina_shutdown();
+ if (DEBUG) printf("%i messages sent\n", i);
+ ecore_thread_wait(th, 0.1);
+ eina_thread_queue_free(thq1);
}
-END_TEST
+EFL_END_TEST
/////////////////////////////////////////////////////////////////////////////
typedef struct
@@ -177,7 +169,7 @@ typedef struct
} Msg3;
static void
-th31_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
+th31_do(void *data EINA_UNUSED, Ecore_Thread *th)
{
int val = 100;
@@ -191,12 +183,12 @@ th31_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
msg->value = val;
eina_thread_queue_send_done(thq1, ref);
val++;
- if (val == 1000100) break;
+ if (val == 1100 || (ecore_thread_check(th))) break;
}
}
static void
-th32_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
+th32_do(void *data EINA_UNUSED, Ecore_Thread *th)
{
int val = 100;
@@ -210,17 +202,15 @@ th32_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
msg->value = val;
eina_thread_queue_send_done(thq2, ref);
val++;
- if (val == 1000100) break;
+ if (val == 1100 || (ecore_thread_check(th))) break;
}
}
-START_TEST(ecore_test_ecore_thread_eina_thread_queue_t3)
+EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t3)
{
int val1 = 99, val2 = 99, cnt = 0;
Eina_Thread_Queue *parent;
-
- eina_init();
- ecore_init();
+ Ecore_Thread *eth1, *eth2;
thq1 = eina_thread_queue_new();
if (!thq1) fail();
@@ -236,8 +226,8 @@ START_TEST(ecore_test_ecore_thread_eina_thread_queue_t3)
parent = eina_thread_queue_parent_get(thq2);
fail_if(parent != thqmaster);
- ecore_thread_feedback_run(th31_do, NULL, NULL, NULL, NULL, EINA_TRUE);
- ecore_thread_feedback_run(th32_do, NULL, NULL, NULL, NULL, EINA_TRUE);
+ eth1 = ecore_thread_feedback_run(th31_do, NULL, NULL, NULL, NULL, EINA_TRUE);
+ eth2 = ecore_thread_feedback_run(th32_do, NULL, NULL, NULL, NULL, EINA_TRUE);
for (;;)
{
Eina_Thread_Queue_Msg_Sub *sub;
@@ -255,8 +245,7 @@ START_TEST(ecore_test_ecore_thread_eina_thread_queue_t3)
{
if ((val1 + 1) != msg->value)
{
- printf("ERR: thq1 val wrong %i -> %i\n", val1, msg->value);
- fail();
+ ck_abort_msg("ERR: thq1 val wrong %i -> %i\n", val1, msg->value);
}
val1 = msg->value;
}
@@ -264,26 +253,26 @@ START_TEST(ecore_test_ecore_thread_eina_thread_queue_t3)
{
if ((val2 + 1) != msg->value)
{
- printf("ERR: thq2 val wrong %i -> %i\n", val2, msg->value);
- fail();
+ ck_abort_msg("ERR: thq2 val wrong %i -> %i\n", val2, msg->value);
}
val2 = msg->value;
}
else
{
- printf("ERRR: unknown thq\n");
- fail();
+ ck_abort_msg("ERRR: unknown thq\n");
}
eina_thread_queue_wait_done(thq, ref);
cnt++;
- if (cnt == 2000000) break;
+ if (cnt == 2000) break;
}
- printf("enough msgs\n");
-
- ecore_shutdown();
- eina_shutdown();
+ if (DEBUG) printf("enough msgs\n");
+ ecore_thread_wait(eth1, 0.1);
+ ecore_thread_wait(eth2, 0.1);
+ eina_thread_queue_free(thq1);
+ eina_thread_queue_free(thq2);
+ eina_thread_queue_free(thqmaster);
}
-END_TEST
+EFL_END_TEST
/////////////////////////////////////////////////////////////////////////////
typedef struct
@@ -293,7 +282,7 @@ typedef struct
} Msg4;
static void
-th41_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
+th41_do(void *data EINA_UNUSED, Ecore_Thread *th)
{
int val = 100;
@@ -306,14 +295,14 @@ th41_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
msg->value = val;
eina_thread_queue_send_done(thq1, ref);
val++;
- if (val == 1000100) break;
+ if (val == 1100 || (ecore_thread_check(th))) break;
}
}
static void
-th42_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
+th42_do(void *data EINA_UNUSED, Ecore_Thread *th)
{
- int val = 10000000;
+ int val = 10000;
for (;;)
{
@@ -324,34 +313,32 @@ th42_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
msg->value = val;
eina_thread_queue_send_done(thq1, ref);
val++;
- if (val == 11000000) break;
+ if (val == 11000 || (ecore_thread_check(th))) break;
}
}
-START_TEST(ecore_test_ecore_thread_eina_thread_queue_t4)
+EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t4)
{
int cnt = 0;
- int val1 = 99, val2 = 9999999;
+ int val1 = 99, val2 = 9999;
+ Ecore_Thread *eth1, *eth2;
- eina_init();
- ecore_init();
thq1 = eina_thread_queue_new();
if (!thq1) fail();
- ecore_thread_feedback_run(th41_do, NULL, NULL, NULL, NULL, EINA_TRUE);
- ecore_thread_feedback_run(th42_do, NULL, NULL, NULL, NULL, EINA_TRUE);
+ eth1 = ecore_thread_feedback_run(th41_do, NULL, NULL, NULL, NULL, EINA_TRUE);
+ eth2 = ecore_thread_feedback_run(th42_do, NULL, NULL, NULL, NULL, EINA_TRUE);
for (;;)
{
Msg4 *msg;
void *ref;
msg = eina_thread_queue_wait(thq1, &ref);
if (DEBUG) printf("V %08i: %i [%i]\n", cnt, msg->value, eina_thread_queue_pending_get(thq1));
- if (msg->value >= 10000000)
+ if (msg->value >= 10000)
{
if ((val2 + 1) != msg->value)
{
- printf("ERR: val wrong %i -> %i\n", val2, msg->value);
- fail();
+ ck_abort_msg("ERR: val wrong %i -> %i\n", val2, msg->value);
}
val2 = msg->value;
}
@@ -359,21 +346,20 @@ START_TEST(ecore_test_ecore_thread_eina_thread_queue_t4)
{
if ((val1 + 1) != msg->value)
{
- printf("ERR: val wrong %i -> %i\n", val1, msg->value);
- fail();
+ ck_abort_msg("ERR: val wrong %i -> %i\n", val1, msg->value);
}
val1 = msg->value;
}
eina_thread_queue_wait_done(thq1, ref);
cnt++;
- if (cnt == 2000000) break;
+ if (cnt == 2000) break;
}
- printf("msgs ok\n");
-
- ecore_shutdown();
- eina_shutdown();
+ if (DEBUG) printf("msgs ok\n");
+ ecore_thread_wait(eth1, 0.1);
+ ecore_thread_wait(eth2, 0.1);
+ eina_thread_queue_free(thq1);
}
-END_TEST
+EFL_END_TEST
/////////////////////////////////////////////////////////////////////////////
typedef struct
@@ -386,7 +372,7 @@ typedef struct
static Eina_Semaphore th4_sem;
static void
-th51_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
+th51_do(void *data EINA_UNUSED, Ecore_Thread *th)
{
int val = 100;
@@ -395,11 +381,10 @@ th51_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
Msg5 *msg;
void *ref;
- usleep((rand() % 10) * 1000);
msg = eina_thread_queue_send(thq1, sizeof(Msg5), &ref);
msg->value = val;
eina_thread_queue_send_done(thq1, ref);
- if (val == 1100) break;
+ if (val == 1100 || (ecore_thread_check(th))) break;
val++;
}
@@ -407,7 +392,7 @@ th51_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
}
static void
-th52_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
+th52_do(void *data EINA_UNUSED, Ecore_Thread *th)
{
int val;
@@ -419,33 +404,32 @@ th52_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
msg = eina_thread_queue_wait(thq1, &ref);
if (!msg) fail();
val = msg->value;
- usleep((rand() % 20) * 1000);
eina_thread_queue_wait_done(thq1, ref);
msg = eina_thread_queue_send(thq2, sizeof(Msg5), &ref);
if (!msg) fail();
msg->value = val;
eina_thread_queue_send_done(thq2, ref);
- if (val == 1100) break;
+ if (val == 1100 || (ecore_thread_check(th))) break;
}
eina_semaphore_release(&th4_sem, 1);
}
-START_TEST(ecore_test_ecore_thread_eina_thread_queue_t5)
+EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t5)
{
int val = 99;
+ Ecore_Thread *eth1, *eth2;
- ecore_init();
eina_semaphore_new(&th4_sem, 0);
thq1 = eina_thread_queue_new();
if (!thq1) fail();
thq2 = eina_thread_queue_new();
if (!thq2) fail();
- ecore_thread_feedback_run(th51_do, NULL, NULL, NULL, NULL, EINA_TRUE);
- ecore_thread_feedback_run(th52_do, NULL, NULL, NULL, NULL, EINA_TRUE);
+ eth1 = ecore_thread_feedback_run(th51_do, NULL, NULL, NULL, NULL, EINA_TRUE);
+ eth2 = ecore_thread_feedback_run(th52_do, NULL, NULL, NULL, NULL, EINA_TRUE);
for (;;)
{
@@ -457,18 +441,15 @@ START_TEST(ecore_test_ecore_thread_eina_thread_queue_t5)
if (DEBUG) printf("V: %i [%i]\n", msg->value, eina_thread_queue_pending_get(thq2));
if (msg->value != (val + 1))
{
- printf("ERRR %i not next after %i\n", msg->value, val);
- fail();
+ ck_abort_msg("ERRR %i not next after %i\n", msg->value, val);
}
val = msg->value;
- usleep((rand() % 10) * 1000);
eina_thread_queue_wait_done(thq2, ref);
if (val == 1100) break;
}
else
{
if (DEBUG) printf("V: none!\n");
- usleep((rand() % 10) * 1000);
}
}
@@ -476,13 +457,13 @@ START_TEST(ecore_test_ecore_thread_eina_thread_queue_t5)
eina_semaphore_lock(&th4_sem);
// All done!
+ ecore_thread_wait(eth1, 0.1);
+ ecore_thread_wait(eth2, 0.1);
eina_semaphore_free(&th4_sem);
eina_thread_queue_free(thq1);
eina_thread_queue_free(thq2);
-
- ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
/////////////////////////////////////////////////////////////////////////////
typedef struct
@@ -497,11 +478,11 @@ static Eina_Semaphore th6_sem;
const int EXIT_MESSAGE = -42;
static void
-th61_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
+th61_do(void *data EINA_UNUSED, Ecore_Thread *th)
{
int val = 100;
- for (val = 100; val < 10100; val++)
+ for (val = 100; val < 200; val++)
{
Msg6 *msg;
void *ref;
@@ -510,7 +491,7 @@ th61_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
fail_if(!msg);
msg->value = val;
eina_thread_queue_send_done(thq1, ref);
- usleep(1);
+ if (ecore_thread_check(th)) break;
}
eina_semaphore_release(&th6_sem, 1);
@@ -518,7 +499,7 @@ th61_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
}
static void
-th62_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
+th62_do(void *data EINA_UNUSED, Ecore_Thread *th)
{
int cnt = 0;
@@ -533,7 +514,7 @@ th62_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
if (DEBUG) printf("%s: v %08i: %i [%i]\n", __FUNCTION__, cnt, msg->value, eina_thread_queue_pending_get(thq1));
val = msg->value;
eina_thread_queue_wait_done(thq1, ref);
- if (val == EXIT_MESSAGE) break;
+ if (val == EXIT_MESSAGE || (ecore_thread_check(th))) break;
cnt++;
eina_spinlock_take(&msgnum_lock);
msgnum++;
@@ -541,14 +522,14 @@ th62_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
}
eina_spinlock_take(&msgnum_lock);
- ck_assert_int_eq(msgnum, 10000);
+ ck_assert_int_eq(msgnum, 100);
eina_spinlock_release(&msgnum_lock);
eina_semaphore_release(&th6_sem, 1);
if (DEBUG) printf("%s: message reading done!\n", __FUNCTION__);
}
static void
-th63_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
+th63_do(void *data EINA_UNUSED, Ecore_Thread *th)
{
int cnt = 0;
@@ -563,7 +544,7 @@ th63_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
if (DEBUG) printf("%s: v %08i: %i [%i]\n", __FUNCTION__, cnt, msg->value, eina_thread_queue_pending_get(thq1));
val = msg->value;
eina_thread_queue_wait_done(thq1, ref);
- if (val == EXIT_MESSAGE) break;
+ if (val == EXIT_MESSAGE || (ecore_thread_check(th))) break;
cnt++;
eina_spinlock_take(&msgnum_lock);
msgnum++;
@@ -571,39 +552,36 @@ th63_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
}
eina_spinlock_take(&msgnum_lock);
- ck_assert_int_eq(msgnum, 10000);
+ ck_assert_int_eq(msgnum, 100);
eina_spinlock_release(&msgnum_lock);
eina_semaphore_release(&th6_sem, 1);
if (DEBUG) printf("%s: message reading done!\n", __FUNCTION__);
}
-START_TEST(ecore_test_ecore_thread_eina_thread_queue_t6)
+EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t6)
{
- Ecore_Thread *t1, *t2, *t3;
int do_break = 0;
Msg6 *msg;
void *ref;
+ Ecore_Thread *eth1, *eth2, *eth3;
if (DEBUG) setbuf(stdout, NULL);
- eina_init();
- ecore_init();
-
eina_semaphore_new(&th6_sem, 0);
eina_spinlock_new(&msgnum_lock);
thq1 = eina_thread_queue_new();
fail_if(!thq1);
- t1 = ecore_thread_feedback_run(th61_do, NULL, NULL, NULL, NULL, EINA_TRUE);
- t2 = ecore_thread_feedback_run(th62_do, NULL, NULL, NULL, NULL, EINA_TRUE);
- t3 = ecore_thread_feedback_run(th63_do, NULL, NULL, NULL, NULL, EINA_TRUE);
+ eth1 = ecore_thread_feedback_run(th61_do, NULL, NULL, NULL, NULL, EINA_TRUE);
+ eth2 = ecore_thread_feedback_run(th62_do, NULL, NULL, NULL, NULL, EINA_TRUE);
+ eth3 = ecore_thread_feedback_run(th63_do, NULL, NULL, NULL, NULL, EINA_TRUE);
// Spin until we reach 10000 messages sent
while (!do_break)
{
eina_spinlock_take(&msgnum_lock);
if (DEBUG) printf("msgnum %i\n", msgnum);
- if (msgnum == 10000) do_break = 1;
- else ck_assert_int_lt(msgnum, 10000);
+ if (msgnum == 100) do_break = 1;
+ else ck_assert_int_lt(msgnum, 100);
eina_spinlock_release(&msgnum_lock);
}
@@ -622,14 +600,15 @@ START_TEST(ecore_test_ecore_thread_eina_thread_queue_t6)
fail_if(!eina_semaphore_lock(&th6_sem));
// All done!
+ ecore_thread_wait(eth1, 0.1);
+ ecore_thread_wait(eth2, 0.1);
+ ecore_thread_wait(eth3, 0.1);
eina_semaphore_free(&th6_sem);
eina_thread_queue_free(thq1);
eina_spinlock_free(&msgnum_lock);
- ecore_shutdown();
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
/////////////////////////////////////////////////////////////////////////////
typedef struct
@@ -641,41 +620,39 @@ typedef struct
int p[2];
static void
-thspeed7_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
+thspeed7_do(void *data EINA_UNUSED, Ecore_Thread *th)
{
Msg7 *msg;
void *ref;
int i;
- for (i = 0; i < 1000000; i++)
+ for (i = 0; i < 10000; i++)
{
msg = eina_thread_queue_send(thq1, sizeof(Msg7), &ref);
if (msg) eina_thread_queue_send_done(thq1, ref);
+ if (ecore_thread_check(th)) break;
}
}
-START_TEST(ecore_test_ecore_thread_eina_thread_queue_t7)
+EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t7)
{
Msg7 *msg;
void *ref;
int msgcnt = 0, ret;
-
- eina_init();
- ecore_init();
+ Ecore_Thread *eth1;
thq1 = eina_thread_queue_new();
if (!thq1) fail();
if (pipe(p) != 0)
{
- printf("ERR: pipe create fail\n");
- fail();
+ ck_abort_msg("ERR: pipe create fail\n");
}
eina_thread_queue_fd_set(thq1, p[1]);
ret = eina_thread_queue_fd_get(thq1);
fail_if(ret != p[1]);
- ecore_thread_feedback_run(thspeed7_do, NULL, NULL, NULL, NULL, EINA_TRUE);
+ eth1 = ecore_thread_feedback_run(thspeed7_do, NULL, NULL, NULL, NULL, EINA_TRUE);
for (;;)
{
char buf;
@@ -688,20 +665,25 @@ START_TEST(ecore_test_ecore_thread_eina_thread_queue_t7)
msgcnt++;
if (DEBUG) printf("msgcnt: %i\n", msgcnt);
}
- if (msgcnt == 1000000) break;
+ if (msgcnt == 10000) break;
}
- printf("msg fd ok\n");
-
- ecore_shutdown();
- eina_shutdown();
+ if (DEBUG) printf("msg fd ok\n");
+ ecore_thread_wait(eth1, 0.1);
+ eina_thread_queue_free(thq1);
+ close(p[0]);
+ close(p[1]);
}
-END_TEST
+EFL_END_TEST
void ecore_test_ecore_thread_eina_thread_queue(TCase *tc EINA_UNUSED)
{
tcase_add_test(tc, ecore_test_ecore_thread_eina_thread_queue_t1);
tcase_add_test(tc, ecore_test_ecore_thread_eina_thread_queue_t2);
tcase_add_test(tc, ecore_test_ecore_thread_eina_thread_queue_t3);
+}
+
+void ecore_test_ecore_thread_eina_thread_queue2(TCase *tc EINA_UNUSED)
+{
tcase_add_test(tc, ecore_test_ecore_thread_eina_thread_queue_t4);
tcase_add_test(tc, ecore_test_ecore_thread_eina_thread_queue_t5);
tcase_add_test(tc, ecore_test_ecore_thread_eina_thread_queue_t6);
diff --git a/src/tests/ecore/ecore_test_ecore_x.c b/src/tests/ecore/ecore_test_ecore_x.c
index bf7e57f204..4618449322 100644
--- a/src/tests/ecore/ecore_test_ecore_x.c
+++ b/src/tests/ecore/ecore_test_ecore_x.c
@@ -15,7 +15,7 @@
#include <Ecore_X.h>
-START_TEST(ecore_test_ecore_x_init)
+EFL_START_TEST(ecore_test_ecore_x_init)
{
int ret;
@@ -25,9 +25,9 @@ START_TEST(ecore_test_ecore_x_init)
ret = ecore_x_shutdown();
fail_if(ret != 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_x_bell)
+EFL_START_TEST(ecore_test_ecore_x_bell)
{
int i;
int ret;
@@ -46,7 +46,7 @@ START_TEST(ecore_test_ecore_x_bell)
ecore_x_shutdown();
}
-END_TEST
+EFL_END_TEST
#endif
diff --git a/src/tests/ecore/ecore_test_idle.c b/src/tests/ecore/ecore_test_idle.c
new file mode 100644
index 0000000000..512d00124f
--- /dev/null
+++ b/src/tests/ecore/ecore_test_idle.c
@@ -0,0 +1,103 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <unistd.h>
+
+#include <Eina.h>
+#include <Ecore.h>
+
+#include "ecore_suite.h"
+
+
+static Eina_Bool
+_quit_cb(void *data)
+{
+ Eina_Bool *val = data;
+ if (val) *val = EINA_TRUE;
+ ecore_main_loop_quit();
+ return EINA_FALSE;
+}
+
+static Eina_Bool
+_dummy_cb(void *data)
+{
+ return !!data;
+}
+
+EFL_START_TEST(ecore_test_ecore_main_loop_idler)
+{
+ Eina_Bool did = EINA_FALSE;
+ Ecore_Idler *idler;
+
+ idler = ecore_idler_add(_quit_cb, &did);
+ fail_if(idler == NULL);
+
+ ecore_main_loop_begin();
+
+ fail_if(did == EINA_FALSE);
+}
+EFL_END_TEST
+
+EFL_START_TEST(ecore_test_ecore_main_loop_idle_enterer)
+{
+ Eina_Bool did = EINA_FALSE;
+ Ecore_Idle_Enterer *idle_enterer;
+
+
+ idle_enterer = ecore_idle_enterer_add(_quit_cb, &did);
+ fail_if(idle_enterer == NULL);
+
+ ecore_main_loop_begin();
+
+ fail_if(did == EINA_FALSE);
+
+}
+EFL_END_TEST
+
+EFL_START_TEST(ecore_test_ecore_main_loop_idle_before_enterer)
+{
+ Eina_Bool did = EINA_FALSE;
+ Ecore_Idle_Enterer *idle_enterer;
+
+
+ idle_enterer = ecore_idle_enterer_before_add(_quit_cb, &did);
+ fail_if(idle_enterer == NULL);
+
+ ecore_main_loop_begin();
+
+ fail_if(did == EINA_FALSE);
+
+}
+EFL_END_TEST
+
+EFL_START_TEST(ecore_test_ecore_main_loop_idle_exiter)
+{
+ Eina_Bool did = EINA_FALSE;
+ Ecore_Timer *timer;
+ Ecore_Idle_Exiter *idle_exiter;
+
+
+ /* make system exit idle */
+ timer = ecore_timer_add(0.0, _dummy_cb, (void *)(long)0);
+ fail_if(timer == NULL);
+
+ idle_exiter = ecore_idle_exiter_add(_quit_cb, &did);
+ fail_if(idle_exiter == NULL);
+
+ ecore_main_loop_begin();
+
+ fail_if(did == EINA_FALSE);
+
+}
+EFL_END_TEST
+
+
+void ecore_test_ecore_idle(TCase *tc)
+{
+ tcase_add_test(tc, ecore_test_ecore_main_loop_idler);
+ tcase_add_test(tc, ecore_test_ecore_main_loop_idle_enterer);
+ tcase_add_test(tc, ecore_test_ecore_main_loop_idle_before_enterer);
+ tcase_add_test(tc, ecore_test_ecore_main_loop_idle_exiter);
+}
diff --git a/src/tests/ecore/ecore_test_job.c b/src/tests/ecore/ecore_test_job.c
index 537cbb7c43..5a2d6f3f75 100644
--- a/src/tests/ecore/ecore_test_job.c
+++ b/src/tests/ecore/ecore_test_job.c
@@ -14,23 +14,19 @@ _ecore_quit(void *data)
ecore_main_loop_quit();
}
-START_TEST(ecore_test_job)
+EFL_START_TEST(ecore_test_job)
{
Eina_Bool bob = EINA_FALSE;
Ecore_Job *job;
- ecore_init();
-
job = ecore_job_add(&_ecore_quit, &bob);
fail_if(!job);
ecore_main_loop_begin();
fail_if(bob != EINA_TRUE);
-
- ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
void ecore_test_ecore_job(TCase *tc)
{
diff --git a/src/tests/ecore/ecore_test_poller.c b/src/tests/ecore/ecore_test_poller.c
new file mode 100644
index 0000000000..9e981ff367
--- /dev/null
+++ b/src/tests/ecore/ecore_test_poller.c
@@ -0,0 +1,168 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <unistd.h>
+
+#include <Eina.h>
+#include <Ecore.h>
+
+#include "ecore_suite.h"
+
+#define FP_ERR (0.0000001)
+#define CHECK_FP(a, b) ((a - b) < FP_ERR)
+
+static Eina_Bool
+_quit_cb(void *data)
+{
+ Eina_Bool *val = data;
+ if (val) *val = EINA_TRUE;
+ ecore_main_loop_quit();
+ return EINA_FALSE;
+}
+
+Eina_Bool _poller_handler(void *data)
+{
+ int *val = data;
+ (*val)++;
+ return ECORE_CALLBACK_RENEW;
+}
+
+static Eina_Bool
+_poller_loop_add(void *data EINA_UNUSED)
+{
+ ecore_poller_add(ECORE_POLLER_CORE, 1, _quit_cb, NULL);
+ return ECORE_CALLBACK_RENEW;
+}
+
+static Eina_Bool
+_poller_loop_fail(void *data EINA_UNUSED)
+{
+ ecore_main_loop_quit();
+ ck_abort();
+ return ECORE_CALLBACK_RENEW;
+}
+
+static Eina_Bool
+_poller_loop_del(void *data)
+{
+ static int count = 0;
+
+ if (count++ == 0)
+ ecore_poller_del(data);
+ else
+ ecore_main_loop_quit();
+ return ECORE_CALLBACK_RENEW;
+}
+
+static Eina_Bool
+_poller_loop_modify(void *data)
+{
+ ecore_poller_poller_interval_set(data, 1);
+ return EINA_FALSE;
+}
+
+EFL_START_TEST(ecore_test_ecore_main_loop_poller_add)
+{
+ /* Create renewable main poller */
+ Ecore_Poller *poll_ptr = ecore_poller_add(ECORE_POLLER_CORE, 1, _poller_loop_add, NULL);
+
+ /* Enter main loop and wait for quit*/
+ ecore_main_loop_begin();
+
+ /* Destroy renewable main poller */
+ ecore_poller_del(poll_ptr);
+}
+EFL_END_TEST
+
+
+EFL_START_TEST(ecore_test_ecore_main_loop_poller_del)
+{
+ /* Create renewable main poller */
+ Ecore_Poller *poller = ecore_poller_add(ECORE_POLLER_CORE, 2, _poller_loop_fail, NULL);
+ ecore_poller_add(ECORE_POLLER_CORE, 1, _poller_loop_del, poller);
+
+ /* Enter main loop and wait for quit*/
+ ecore_main_loop_begin();
+}
+EFL_END_TEST
+
+EFL_START_TEST(ecore_test_ecore_main_loop_poller_modify)
+{
+ /* Create renewable main poller */
+ Ecore_Poller *poller = ecore_poller_add(ECORE_POLLER_CORE, 4, _quit_cb, NULL);
+ ecore_poller_add(ECORE_POLLER_CORE, 1, _poller_loop_modify, poller);
+ ecore_poller_add(ECORE_POLLER_CORE, 4, _poller_loop_fail, NULL);
+
+ /* Enter main loop and wait for quit*/
+ ecore_main_loop_begin();
+}
+EFL_END_TEST
+
+Eina_Bool _poller_cb(void *data)
+{
+ int *val = data;
+ (*val)++;
+ return ECORE_CALLBACK_RENEW;
+}
+
+EFL_START_TEST(ecore_test_ecore_main_loop_poller)
+{
+ Ecore_Poller *poll1_ptr = NULL;
+ int poll1_interval = 1;
+ int poll1_counter = 0;
+
+ Ecore_Poller *poll2_ptr = NULL;
+ int poll2_interval = 2;
+ int poll2_counter = 0;
+
+ Ecore_Poller *poll3_ptr = NULL;
+ int poll3_interval = 4;
+ int poll3_counter = 0;
+
+ Eina_Bool did = EINA_FALSE;
+
+ /* Check ECORE_POLLER_CORE poll interval */
+ double interval = 0.05;
+ ecore_poller_poll_interval_set(ECORE_POLLER_CORE, interval);
+ fail_unless(CHECK_FP(ecore_poller_poll_interval_get(ECORE_POLLER_CORE), interval));
+
+ /* Create three pollers with different poller interval */
+ poll1_ptr = ecore_poller_add(ECORE_POLLER_CORE, poll1_interval, _poller_cb, &poll1_counter);
+ poll2_ptr = ecore_poller_add(ECORE_POLLER_CORE, poll2_interval, _poller_cb, &poll2_counter);
+ poll3_ptr = ecore_poller_add(ECORE_POLLER_CORE, poll3_interval, _poller_cb, &poll3_counter);
+
+ /* Add one time processed quit poller */
+ ecore_poller_add(ECORE_POLLER_CORE, 8, _quit_cb, &did);
+
+ /* Enter main loop and wait 8 intervals for quit */
+ ecore_main_loop_begin();
+
+ /* Check each poller poll interval */
+ fail_if(ecore_poller_poller_interval_get(poll1_ptr) != poll1_interval);
+ fail_if(ecore_poller_poller_interval_get(poll2_ptr) != poll2_interval);
+ fail_if(ecore_poller_poller_interval_get(poll3_ptr) != poll3_interval);
+
+ /* Check each poller call counter */
+ ck_assert_int_eq(8, poll1_counter);
+ ck_assert_int_eq(4, poll2_counter);
+ ck_assert_int_eq(2, poll3_counter);
+
+ /* Destroy renewable pollers */
+ ecore_poller_del(poll3_ptr);
+ ecore_poller_del(poll2_ptr);
+ ecore_poller_del(poll1_ptr);
+
+ fail_if(did == EINA_FALSE);
+
+}
+EFL_END_TEST
+
+void ecore_test_ecore_poller(TCase *tc)
+{
+ tcase_add_test(tc, ecore_test_ecore_main_loop_poller);
+ tcase_add_test(tc, ecore_test_ecore_main_loop_poller_add);
+ tcase_add_test(tc, ecore_test_ecore_main_loop_poller_del);
+ tcase_add_test(tc, ecore_test_ecore_main_loop_poller_modify);
+}
diff --git a/src/tests/ecore/ecore_test_promise.c b/src/tests/ecore/ecore_test_promise.c
deleted file mode 100644
index 3a3aab6277..0000000000
--- a/src/tests/ecore/ecore_test_promise.c
+++ /dev/null
@@ -1,1067 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <Ecore.h>
-#include "ecore_suite.h"
-#include <time.h>
-
-typedef struct _Future_Ok Future_Ok;
-struct _Future_Ok
-{
- Eina_Bool then : 1;
- Eina_Bool cancel : 1;
- Eina_Bool progress : 1;
-};
-
-static void
-_then(void *data, const Efl_Event *ev)
-{
- Efl_Future_Event_Success *s = ev->info;
- int *value = s->value;
- Future_Ok *fo = data;
-
- fail_if(*value != 42);
- fo->then = EINA_TRUE;
-}
-
-static void
-_cancel(void *data, const Efl_Event *ev)
-{
- Efl_Future_Event_Failure *f = ev->info;
- Future_Ok *fo = data;
-
- fail_if(f->error != EINA_ERROR_FUTURE_CANCEL);
- fo->cancel = EINA_TRUE;
-}
-
-static void
-_progress(void *data, const Efl_Event *ev)
-{
- Efl_Future_Event_Progress *p = ev->info;
- const int *value = p->progress;
- Future_Ok *fo = data;
-
- fail_if(*value != 7);
- fo->progress = EINA_TRUE;
-}
-
-static void
-_death(void *data, const Efl_Event *ev EINA_UNUSED)
-{
- Eina_Bool *death = data;
-
- *death = EINA_TRUE;
-}
-
-// Test value set after then
-START_TEST(efl_test_promise_future_success)
-{
- Efl_Promise *p;
- Efl_Future *f;
- Future_Ok fo = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
- Eina_Bool deadf = EINA_FALSE, deadp = EINA_FALSE;
- int progress = 7;
- int value = 42;
-
- ecore_init();
-
- p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p);
-
- f = efl_promise_future_get(p);
- fail_if(!f);
-
- efl_event_callback_add(f, EFL_EVENT_DEL, _death, &deadf);
- efl_event_callback_add(p, EFL_EVENT_DEL, _death, &deadp);
-
- fail_if(!efl_future_then(f, _then, _cancel, _progress, &fo));
-
- fail_if(deadp || deadf);
-
- efl_promise_progress_set(p, &progress);
- efl_promise_value_set(p, &value, NULL);
-
- ecore_main_loop_iterate();
-
- fail_if(!fo.then || fo.cancel || !fo.progress);
- fail_if(!deadf || deadp);
-
- efl_del(p);
-
- fail_if(!deadp);
-
- ecore_shutdown();
-}
-END_TEST
-
-// Test value set before future_get
-START_TEST(efl_test_promise_future_success_before_get)
-{
- Efl_Promise *p;
- Efl_Future *f;
- Future_Ok fo = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
- Eina_Bool deadf = EINA_FALSE, deadp = EINA_FALSE;
- int value = 42;
-
- ecore_init();
-
- p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p);
-
- efl_promise_value_set(p, &value, NULL);
-
- efl_future_use(&f, efl_promise_future_get(p));
- fail_if(!f);
-
- efl_event_callback_add(f, EFL_EVENT_DEL, _death, &deadf);
- efl_event_callback_add(p, EFL_EVENT_DEL, _death, &deadp);
-
- fail_if(deadp || deadf);
-
- fail_if(!efl_future_then(f, _then, _cancel, _progress, &fo));
-
- ecore_main_loop_iterate();
-
- fail_if(f);
- fail_if(!fo.then || fo.cancel || fo.progress);
- fail_if(!deadf || deadp);
-
- efl_del(p);
-
- fail_if(!deadp);
-
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(efl_test_promise_future_cancel)
-{
- Efl_Promise *p;
- Efl_Future *f;
- Future_Ok fo = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
- Eina_Bool deadf = EINA_FALSE, deadp = EINA_FALSE, none = EINA_FALSE;
- int progress = 7;
- int value = 42;
-
- ecore_init();
-
- p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p);
-
- efl_future_use(&f, efl_promise_future_get(p));
- fail_if(!f);
-
- efl_event_callback_add(f, EFL_EVENT_DEL, _death, &deadf);
- efl_event_callback_add(p, EFL_EVENT_DEL, _death, &deadp);
- efl_event_callback_add(p, EFL_PROMISE_EVENT_FUTURE_NONE, _death, &none);
-
- fail_if(!efl_future_then(f, _then, _cancel, _progress, &fo));
-
- fail_if(deadp || deadf);
-
- efl_promise_progress_set(p, &progress);
- efl_future_cancel(f);
-
- efl_promise_value_set(p, &value, NULL);
-
- ecore_main_loop_iterate();
-
- fail_if(fo.then || !fo.cancel || !fo.progress);
- fail_if(!deadf || deadp);
- fail_if(!none);
-
- efl_del(p);
-
- fail_if(!deadp);
-
- ecore_shutdown();
-}
-END_TEST
-
-// Test value set before then
-START_TEST(efl_test_promise_before_future_success)
-{
- Efl_Promise *p;
- Efl_Future *f;
- Future_Ok fo = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
- Eina_Bool deadf = EINA_FALSE, deadp = EINA_FALSE;
- int progress = 7;
- int value = 42;
-
- ecore_init();
-
- p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p);
-
- f = efl_promise_future_get(p);
- fail_if(!f);
-
- efl_event_callback_add(f, EFL_EVENT_DEL, _death, &deadf);
- efl_event_callback_add(p, EFL_EVENT_DEL, _death, &deadp);
-
- efl_promise_progress_set(p, &progress);
- efl_promise_value_set(p, &value, NULL);
-
- fail_if(!efl_future_then(f, _then, _cancel, _progress, &fo));
-
- ecore_main_loop_iterate();
-
- fail_if(deadp || !deadf);
- fail_if(!fo.then || fo.cancel || fo.progress);
-
- efl_del(p);
-
- fail_if(!deadp);
-
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(efl_test_promise_before_future_cancel)
-{
- Efl_Promise *p;
- Efl_Future *f;
- Future_Ok fo = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
- Eina_Bool deadf = EINA_FALSE, deadp = EINA_FALSE, none = EINA_FALSE;
- int progress = 7;
- int value = 42;
-
- ecore_init();
-
- p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p);
-
- efl_future_use(&f, efl_promise_future_get(p));
- fail_if(!f);
-
- efl_event_callback_add(f, EFL_EVENT_DEL, _death, &deadf);
- efl_event_callback_add(p, EFL_EVENT_DEL, _death, &deadp);
- efl_event_callback_add(p, EFL_PROMISE_EVENT_FUTURE_NONE, _death, &none);
-
- efl_promise_progress_set(p, &progress);
- efl_future_cancel(f);
-
- fail_if(!efl_future_then(f, _then, _cancel, _progress, &fo));
-
- fail_if(deadp || !deadf);
-
- efl_promise_value_set(p, &value, NULL);
-
- ecore_main_loop_iterate();
-
- fail_if(fo.then || !fo.cancel || fo.progress);
- fail_if(!none);
-
- efl_del(p);
-
- fail_if(!deadp);
-
- ecore_shutdown();
-}
-END_TEST
-
-static void
-_chain_then(void *data, const Efl_Event *ev)
-{
- Efl_Future_Event_Success *s = ev->info;
- int *v = s->value;
- Future_Ok *fo = data;
-
- fo->then = EINA_TRUE;
-
- fail_if(*v != 42);
-
- efl_promise_value_set(s->next, v, NULL);
-}
-
-static void
-_chain_fail(void *data, const Efl_Event *ev)
-{
- Efl_Future_Event_Failure *f = ev->info;
- Future_Ok *fo = data;
-
- fo->cancel = EINA_TRUE;
-
- efl_promise_failed_set(f->next, f->error);
-}
-
-static void
-_chain_progress(void *data, const Efl_Event *ev)
-{
- Efl_Future_Event_Progress *p = ev->info;
- Future_Ok *fo = data;
-
- fo->progress = EINA_TRUE;
-
- efl_promise_progress_set(p->next, p->progress);
-}
-
-// Test chained then
-START_TEST(efl_test_promise_future_chain_success)
-{
- Efl_Promise *p;
- Efl_Future *f1, *f2;
- Future_Ok fo1 = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
- Future_Ok fo2 = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
- Eina_Bool deadf1 = EINA_FALSE, deadf2 = EINA_FALSE, deadp = EINA_FALSE;
- int progress = 7;
- int value = 42;
-
- ecore_init();
-
- p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p);
-
- f1 = efl_promise_future_get(p);
- fail_if(!f1);
-
- efl_event_callback_add(f1, EFL_EVENT_DEL, _death, &deadf1);
- efl_event_callback_add(p, EFL_EVENT_DEL, _death, &deadp);
-
- f2 = efl_future_then(f1, _chain_then, _chain_fail, _chain_progress, &fo1);
- fail_if(!f2);
-
- efl_event_callback_add(f2, EFL_EVENT_DEL, _death, &deadf2);
-
- fail_if(!efl_future_then(f2, _then, _cancel, _progress, &fo2));
-
- fail_if(deadp || deadf1 || deadf2);
-
- efl_promise_progress_set(p, &progress);
- efl_promise_value_set(p, &value, NULL);
-
- ecore_main_loop_iterate();
-
- fail_if(!fo1.then || fo1.cancel || !fo1.progress);
- fail_if(!fo2.then || fo2.cancel || !fo2.progress);
- fail_if(!deadf1 || !deadf2 || deadp);
-
- efl_del(p);
-
- fail_if(!deadp);
-
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(efl_test_promise_future_chain_cancel)
-{
- Efl_Promise *p;
- Efl_Future *f1, *f2;
- Future_Ok fo1 = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
- Future_Ok fo2 = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
- Eina_Bool deadf1 = EINA_FALSE, deadf2 = EINA_FALSE, deadp = EINA_FALSE, none = EINA_FALSE;
- int progress = 7;
- int value = 42;
-
- ecore_init();
-
- p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p);
-
- efl_future_use(&f1, efl_promise_future_get(p));
- fail_if(!f1);
-
- efl_event_callback_add(f1, EFL_EVENT_DEL, _death, &deadf1);
- efl_event_callback_add(p, EFL_EVENT_DEL, _death, &deadp);
- efl_event_callback_add(p, EFL_PROMISE_EVENT_FUTURE_NONE, _death, &none);
-
- f2 = efl_future_then(f1, _chain_then, _chain_fail, _chain_progress, &fo1);
- fail_if(!f2);
-
- efl_event_callback_add(f2, EFL_EVENT_DEL, _death, &deadf2);
-
- fail_if(!efl_future_then(f2, _then, _cancel, _progress, &fo2));
-
- fail_if(deadp || deadf1 || deadf2);
-
- efl_promise_progress_set(p, &progress);
- efl_future_cancel(f1);
-
- efl_promise_value_set(p, &value, NULL);
-
- ecore_main_loop_iterate();
-
- fail_if(fo1.then || !fo1.cancel || !fo1.progress);
- fail_if(fo2.then || !fo2.cancel || !fo2.progress);
- fail_if(!deadf1 || !deadf2 || deadp);
- fail_if(!none);
-
- efl_del(p);
-
- fail_if(!deadp);
-
- ecore_shutdown();
-}
-END_TEST
-
-// Test value set after multi then
-START_TEST(efl_test_promise_future_multi_success)
-{
- Efl_Promise *p;
- Efl_Future *f;
- Future_Ok fo1 = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
- Future_Ok fo2 = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
- Eina_Bool deadf = EINA_FALSE, deadp = EINA_FALSE;
- int progress = 7;
- int value = 42;
-
- ecore_init();
-
- p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p);
-
- f = efl_promise_future_get(p);
- fail_if(!f);
-
- efl_event_callback_add(f, EFL_EVENT_DEL, _death, &deadf);
- efl_event_callback_add(p, EFL_EVENT_DEL, _death, &deadp);
-
- efl_ref(f);
- fail_if(!efl_future_then(f, _then, _cancel, _progress, &fo1));
- fail_if(!efl_future_then(f, _then, _cancel, _progress, &fo2));
- efl_unref(f);
-
- fail_if(deadp || deadf);
-
- efl_promise_progress_set(p, &progress);
- efl_promise_value_set(p, &value, NULL);
-
- ecore_main_loop_iterate();
-
- fail_if(!fo1.then || fo1.cancel || !fo1.progress);
- fail_if(!fo2.then || fo2.cancel || !fo2.progress);
- fail_if(!deadf || deadp);
-
- efl_del(p);
-
- fail_if(!deadp);
-
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(efl_test_promise_future_multi_success_noref)
-{
- Efl_Promise *p;
- Efl_Future *f;
- Future_Ok fo1 = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
- Future_Ok fo2 = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
- Eina_Bool deadf = EINA_FALSE, deadp = EINA_FALSE;
- int progress = 7;
- int value = 42;
-
- ecore_init();
-
- p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p);
-
- f = efl_promise_future_get(p);
- fail_if(!f);
-
- efl_event_callback_add(f, EFL_EVENT_DEL, _death, &deadf);
- efl_event_callback_add(p, EFL_EVENT_DEL, _death, &deadp);
-
- fail_if(!efl_future_then(f, _then, _cancel, _progress, &fo1));
- fail_if(!efl_future_then(f, _then, _cancel, _progress, &fo2));
-
- fail_if(deadp || deadf);
-
- efl_promise_progress_set(p, &progress);
- efl_promise_value_set(p, &value, NULL);
-
- ecore_main_loop_iterate();
-
- fail_if(!fo1.then || fo1.cancel || !fo1.progress);
- fail_if(!fo2.then || fo2.cancel || !fo2.progress);
- fail_if(!deadf || deadp);
-
- efl_del(p);
-
- fail_if(!deadp);
-
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(efl_test_promise_future_multi_cancel)
-{
- Efl_Promise *p;
- Efl_Future *f;
- Future_Ok fo1 = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
- Future_Ok fo2 = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
- Eina_Bool deadf = EINA_FALSE, deadp = EINA_FALSE, none = EINA_FALSE;
- int progress = 7;
- int value = 42;
-
- ecore_init();
-
- p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p);
-
- efl_future_use(&f, efl_promise_future_get(p));
- fail_if(!f);
-
- efl_event_callback_add(f, EFL_EVENT_DEL, _death, &deadf);
- efl_event_callback_add(p, EFL_EVENT_DEL, _death, &deadp);
- efl_event_callback_add(p, EFL_PROMISE_EVENT_FUTURE_NONE, _death, &none);
-
- fail_if(!efl_future_then(f, _then, _cancel, _progress, &fo1));
- fail_if(!efl_future_then(f, _then, _cancel, _progress, &fo2));
-
- fail_if(deadp || deadf);
-
- efl_promise_progress_set(p, &progress);
- efl_future_cancel(f);
-
- efl_promise_value_set(p, &value, NULL);
-
- ecore_main_loop_iterate();
-
- fail_if(fo1.then || !fo1.cancel || !fo1.progress);
- fail_if(fo2.then || !fo2.cancel || !fo2.progress);
- fail_if(!deadf || deadp);
- fail_if(!none);
-
- efl_del(p);
-
- fail_if(!deadp);
-
- ecore_shutdown();
-}
-END_TEST
-
-// Test value set before multi then
-START_TEST(efl_test_promise_before_future_multi_success)
-{
- Efl_Promise *p;
- Efl_Future *f;
- Future_Ok fo1 = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
- Future_Ok fo2 = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
- Eina_Bool deadf = EINA_FALSE, deadp = EINA_FALSE;
- int progress = 7;
- int value = 42;
-
- ecore_init();
-
- p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p);
-
- f = efl_promise_future_get(p);
- fail_if(!f);
-
- efl_event_callback_add(f, EFL_EVENT_DEL, _death, &deadf);
- efl_event_callback_add(p, EFL_EVENT_DEL, _death, &deadp);
-
- efl_promise_progress_set(p, &progress);
- efl_promise_value_set(p, &value, NULL);
-
- efl_ref(f);
- fail_if(!efl_future_then(f, _then, _cancel, _progress, &fo1));
- fail_if(!efl_future_then(f, _then, _cancel, _progress, &fo2));
- efl_unref(f);
-
- ecore_main_loop_iterate();
-
- fail_if(deadp || !deadf);
- fail_if(!fo1.then || fo1.cancel || fo1.progress);
- fail_if(!fo2.then || fo2.cancel || fo2.progress);
-
- efl_del(p);
-
- fail_if(!deadp);
-
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(efl_test_promise_before_future_multi_success_noref)
-{
- Efl_Promise *p;
- Efl_Future *f;
- Future_Ok fo1 = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
- Future_Ok fo2 = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
- Eina_Bool deadf = EINA_FALSE, deadp = EINA_FALSE;
- int progress = 7;
- int value = 42;
-
- ecore_init();
-
- p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p);
-
- f = efl_promise_future_get(p);
- fail_if(!f);
-
- efl_event_callback_add(f, EFL_EVENT_DEL, _death, &deadf);
- efl_event_callback_add(p, EFL_EVENT_DEL, _death, &deadp);
-
- efl_promise_progress_set(p, &progress);
- efl_promise_value_set(p, &value, NULL);
-
- fail_if(!efl_future_then(f, _then, _cancel, _progress, &fo1));
- fail_if(!efl_future_then(f, _then, _cancel, _progress, &fo2));
-
- ecore_main_loop_iterate();
-
- fail_if(deadp || !deadf);
- fail_if(!fo1.then || fo1.cancel || fo1.progress);
- fail_if(!fo2.then || fo2.cancel || fo2.progress);
-
- efl_del(p);
-
- fail_if(!deadp);
-
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(efl_test_promise_before_future_multi_cancel)
-{
- Efl_Promise *p;
- Efl_Future *f;
- Future_Ok fo1 = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
- Future_Ok fo2 = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
- Future_Ok fo3 = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
- Eina_Bool deadf = EINA_FALSE, deadp = EINA_FALSE, none = EINA_FALSE;
- int progress = 7;
- int value = 42;
-
- ecore_init();
-
- p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p);
-
- efl_future_use(&f, efl_promise_future_get(p));
- fail_if(!f);
-
- efl_event_callback_add(f, EFL_EVENT_DEL, _death, &deadf);
- efl_event_callback_add(p, EFL_EVENT_DEL, _death, &deadp);
- efl_event_callback_add(p, EFL_PROMISE_EVENT_FUTURE_NONE, _death, &none);
-
- efl_promise_progress_set(p, &progress);
- efl_future_cancel(f);
-
- efl_ref(f);
- fail_if(!efl_future_then(f, _then, _cancel, _progress, &fo1));
- fail_if(!efl_future_then(f, _then, _cancel, _progress, &fo2));
- efl_unref(f);
-
- fail_if(efl_future_then(f, _then, _cancel, _progress, &fo3));
-
- fail_if(deadp || !deadf);
-
- efl_promise_value_set(p, &value, NULL);
-
- ecore_main_loop_iterate();
-
- fail_if(fo1.then || !fo1.cancel || fo1.progress);
- fail_if(fo2.then || !fo2.cancel || fo2.progress);
- fail_if(fo3.then || fo3.cancel || fo3.progress);
- fail_if(!none);
-
- efl_del(p);
-
- fail_if(!deadp);
-
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(efl_test_promise_before_future_multi_cancel_noref)
-{
- Efl_Promise *p;
- Efl_Future *f;
- Future_Ok fo1 = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
- Future_Ok fo2 = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
- Future_Ok fo3 = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
- Eina_Bool deadf = EINA_FALSE, deadp = EINA_FALSE, none = EINA_FALSE;
- int progress = 7;
- int value = 42;
-
- ecore_init();
-
- p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p);
-
- efl_future_use(&f, efl_promise_future_get(p));
- fail_if(!f);
-
- efl_event_callback_add(f, EFL_EVENT_DEL, _death, &deadf);
- efl_event_callback_add(p, EFL_EVENT_DEL, _death, &deadp);
- efl_event_callback_add(p, EFL_PROMISE_EVENT_FUTURE_NONE, _death, &none);
-
- efl_promise_progress_set(p, &progress);
-
- fail_if(!efl_future_then(f, _then, _cancel, _progress, &fo1));
- fail_if(!efl_future_then(f, _then, _cancel, _progress, &fo2));
-
- // efl_future_cancel is not delayed, only operation on promise are.
- efl_future_cancel(f);
-
- fail_if(efl_future_then(f, _then, _cancel, _progress, &fo3));
-
- fail_if(deadp || !deadf);
-
- efl_promise_value_set(p, &value, NULL);
-
- ecore_main_loop_iterate();
-
- fail_if(fo1.then || !fo1.cancel || fo1.progress);
- fail_if(fo2.then || !fo2.cancel || fo2.progress);
- fail_if(fo3.then || fo3.cancel || fo3.progress);
- fail_if(!none);
-
- efl_del(p);
-
- fail_if(!deadp);
-
- ecore_shutdown();
-}
-END_TEST
-
-static Eina_Bool cleanup = EINA_FALSE;
-
-static void
-_cleanup_called(void *s EINA_UNUSED)
-{
- cleanup = EINA_TRUE;
-}
-
-// Test optional value set without then
-START_TEST(efl_test_promise_future_optional_success)
-{
- Efl_Promise *p;
- Efl_Future *f;
- Eina_Bool deadf = EINA_FALSE, deadp = EINA_FALSE;
- int progress = 7;
- int value = 42;
-
- cleanup = EINA_FALSE;
-
- ecore_init();
-
- p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p);
-
- f = efl_promise_future_get(p);
- fail_if(!f);
-
- efl_event_callback_add(f, EFL_EVENT_DEL, _death, &deadf);
- efl_event_callback_add(p, EFL_EVENT_DEL, _death, &deadp);
-
- fail_if(deadp || deadf);
-
- efl_promise_progress_set(p, &progress);
- efl_promise_value_set(p, &value, _cleanup_called);
-
- fail_if(deadf || deadp);
-
- ecore_main_loop_iterate();
-
- fail_if(!deadf);
-
- efl_del(p);
-
- fail_if(!deadp || !cleanup);
-
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(efl_test_promise_future_optional_cancel)
-{
- Efl_Promise *p;
- Efl_Future *f;
- Eina_Bool deadf = EINA_FALSE, deadp = EINA_FALSE, none = EINA_FALSE;
- int progress = 7;
- int value = 42;
-
- cleanup = EINA_FALSE;
-
- ecore_init();
-
- p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p);
-
- efl_future_use(&f, efl_promise_future_get(p));
- fail_if(!f);
-
- efl_event_callback_add(f, EFL_EVENT_DEL, _death, &deadf);
- efl_event_callback_add(p, EFL_EVENT_DEL, _death, &deadp);
- efl_event_callback_add(p, EFL_PROMISE_EVENT_FUTURE_NONE, _death, &none);
-
- fail_if(deadp || deadf);
-
- efl_promise_progress_set(p, &progress);
- efl_future_cancel(f);
-
- efl_promise_value_set(p, &value, _cleanup_called);
-
- fail_if(deadf || deadp);
- fail_if(!none);
-
- ecore_main_loop_iterate();
-
- fail_if(!deadf || deadp);
-
- efl_del(p);
-
- fail_if(!deadp);
-
- ecore_shutdown();
-}
-END_TEST
-
-static int value[] = { 42, 7, 3 };
-
-static void
-_then_all(void *data, const Efl_Event *ev)
-{
- Future_Ok *fo = data;
- Efl_Future_Event_Success *s = ev->info;
- Eina_Accessor *ac = s->value;
- int *i;
-
- fail_if(!eina_accessor_data_get(ac, 0, (void**) &i));
- fail_if(i != &value[0]);
- fail_if(!eina_accessor_data_get(ac, 1, (void**) &i));
- fail_if(i != &value[1]);
- fail_if(!eina_accessor_data_get(ac, 2, (void**) &i));
- fail_if(i != &value[2]);
-
- fo->then = EINA_TRUE;
-}
-
-START_TEST(efl_test_promise_all)
-{
- Efl_Promise *p1, *p2, *p3;
- Efl_Future *all = NULL, *f1;
- Future_Ok donea = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
- Future_Ok donep1 = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
-
- ecore_init();
-
- p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- p3 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p1 || !p2 || !p3);
-
- f1 = efl_ref(efl_promise_future_get(p1));
- fail_if(!efl_future_then(f1, _then, _cancel, _progress, &donep1));
- efl_future_use(&all, efl_future_all(f1, efl_promise_future_get(p2), efl_promise_future_get(p3)));
- efl_unref(f1);
-
- fail_if(!efl_future_then(all, _then_all, _cancel, _progress, &donea));
- fail_if(!all);
-
- efl_promise_value_set(p1, &value[0], NULL);
-
- // XXX: assuming a single iteration does it? wrong. need to fix...
- ecore_main_loop_iterate();
- ecore_main_loop_iterate();
- ecore_main_loop_iterate();
-
- fail_if(!donep1.then || donep1.cancel || donep1.progress);
- fail_if(donea.then || donea.cancel || donea.progress);
-
- efl_promise_value_set(p2, &value[1], NULL);
- efl_promise_value_set(p3, &value[2], NULL);
-
- // XXX: assuming a single iteration does it? wrong. need to fix...
- ecore_main_loop_iterate();
- ecore_main_loop_iterate();
- ecore_main_loop_iterate();
-
- fail_if(!donea.then || donea.cancel || donea.progress);
- fail_if(all);
-
- efl_del(p1);
- efl_del(p2);
- efl_del(p3);
-
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(efl_test_promise_all_after_value_set)
-{
- Efl_Promise *p1, *p2, *p3;
- Efl_Future *all = NULL, *f1, *f2, *f3;
- Future_Ok donea = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
-
- ecore_init();
-
- p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- p3 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p1 || !p2 || !p3);
-
- f1 = efl_promise_future_get(p1);
- f2 = efl_promise_future_get(p2);
- f3 = efl_promise_future_get(p3);
-
- efl_promise_value_set(p1, &value[0], NULL);
- efl_promise_value_set(p2, &value[1], NULL);
- efl_promise_value_set(p3, &value[2], NULL);
-
- efl_future_use(&all, efl_future_all(f1, f2, f3));
-
- fail_if(!all);
-
- fail_if(!efl_future_then(all, _then_all, _cancel, _progress, &donea));
-
- // XXX: assuming a single iteration does it? wrong. need to fix...
- ecore_main_loop_iterate();
- ecore_main_loop_iterate();
- ecore_main_loop_iterate();
-
- fail_if(!donea.then || donea.cancel || donea.progress);
-
- fail_if(all);
-
- efl_del(p1);
- efl_del(p2);
- efl_del(p3);
-
- ecore_shutdown();
-}
-END_TEST
-
-static void
-_then_race(void *data, const Efl_Event *ev)
-{
- Future_Ok *fo = data;
- Efl_Future_Event_Success *s = ev->info;
- Efl_Future_Race_Success *rs = s->value;
-
- fail_if(rs->index != 1);
- fail_if(rs->value != &value[0]);
-
- fo->then = EINA_TRUE;
-}
-
-START_TEST(efl_test_promise_race)
-{
- Efl_Promise *p1, *p2, *p3;
- Efl_Future *race = NULL, *f1;
- Future_Ok donea = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
- Future_Ok donep1 = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
-
- ecore_init();
-
- p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- p3 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p1 || !p2 || !p3);
-
- f1 = efl_ref(efl_promise_future_get(p1));
- fail_if(!efl_future_then(f1, _then, _cancel, _progress, &donep1));
- efl_future_use(&race, efl_future_race(f1, efl_promise_future_get(p2), efl_promise_future_get(p3)));
- efl_unref(f1);
-
- fail_if(!efl_future_then(race, _then_race, _cancel, _progress, &donea));
- fail_if(!race);
-
- efl_promise_value_set(p2, &value[0], NULL);
-
- ecore_main_loop_iterate();
-
- fail_if(donep1.then || !donep1.cancel || donep1.progress);
- fail_if(!donea.then || donea.cancel || donea.progress);
-
- fail_if(race);
-
- efl_del(p1);
- efl_del(p2);
- efl_del(p3);
-
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(efl_test_future_link)
-{
- Efl_Promise *p;
- Efl_Future *f;
- Eo *o;
-
- ecore_init();
-
- o = efl_add(EFL_LOOP_TIMER_CLASS, efl_main_loop_get(),
- efl_loop_timer_interval_set(efl_added, 0.0));
- p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- efl_future_use(&f, efl_promise_future_get(p));
- efl_future_link(o, f);
-
- fail_if(!o || !p || !f);
- efl_del(o);
- fail_if(f);
-
- o = efl_add(EFL_LOOP_TIMER_CLASS, efl_main_loop_get(),
- efl_loop_timer_interval_set(efl_added, 0.0));
- efl_future_use(&f, efl_promise_future_get(p));
- efl_future_cancel(f);
-
- efl_del(o);
- efl_del(p);
-
- ecore_shutdown();
-}
-END_TEST
-
-static Efl_Future *recursive_future = NULL;
-
-static void
-_then_cleanup(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
-{
- efl_future_cancel(recursive_future);
-}
-
-START_TEST(efl_test_recursive_mess)
-{
- Efl_Promise *p;
- Future_Ok done = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
-
- ecore_init();
-
- p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- efl_future_use(&recursive_future, efl_promise_future_get(p));
- efl_future_then(recursive_future, _then_cleanup, _cancel, NULL, &done);
-
- efl_promise_value_set(p, &value[0], NULL);
-
- ecore_main_loop_iterate();
-
- efl_del(p);
-
- ecore_shutdown();
-}
-END_TEST
-
-void ecore_test_ecore_promise(TCase *tc)
-{
- tcase_add_test(tc, efl_test_promise_future_success);
- tcase_add_test(tc, efl_test_promise_future_cancel);
- tcase_add_test(tc, efl_test_promise_future_chain_success);
- tcase_add_test(tc, efl_test_promise_future_chain_cancel);
- tcase_add_test(tc, efl_test_promise_before_future_success);
- tcase_add_test(tc, efl_test_promise_before_future_cancel);
- tcase_add_test(tc, efl_test_promise_future_multi_success);
- tcase_add_test(tc, efl_test_promise_future_multi_success_noref);
- tcase_add_test(tc, efl_test_promise_future_multi_cancel);
- tcase_add_test(tc, efl_test_promise_before_future_multi_success);
- tcase_add_test(tc, efl_test_promise_before_future_multi_success_noref);
- tcase_add_test(tc, efl_test_promise_before_future_multi_cancel);
- tcase_add_test(tc, efl_test_promise_before_future_multi_success_noref);
- tcase_add_test(tc, efl_test_promise_before_future_multi_cancel_noref);
- tcase_add_test(tc, efl_test_promise_future_optional_success);
- tcase_add_test(tc, efl_test_promise_future_optional_cancel);
- tcase_add_test(tc, efl_test_promise_all);
- tcase_add_test(tc, efl_test_promise_all_after_value_set);
- tcase_add_test(tc, efl_test_promise_future_success_before_get);
- tcase_add_test(tc, efl_test_promise_race);
- tcase_add_test(tc, efl_test_future_link);
- tcase_add_test(tc, efl_test_recursive_mess);
-}
diff --git a/src/tests/ecore/ecore_test_timer.c b/src/tests/ecore/ecore_test_timer.c
index 66c072958e..b7661d0043 100644
--- a/src/tests/ecore/ecore_test_timer.c
+++ b/src/tests/ecore/ecore_test_timer.c
@@ -12,7 +12,7 @@
#define TIMEOUT_2 0.02 // timer2
#define TIMEOUT_3 0.06 // timer3
#define TIMEOUT_4 0.1 // timer4
-#define TIMEOUT_5 1.0 // timer5 - end ecore_main_loop_begin()
+#define TIMEOUT_5 0.5 // timer5 - end ecore_main_loop_begin()
#define SIZE 3
static int freeze_thaw = 0; // 1 - freeze timer, 0 - thaw
@@ -34,22 +34,6 @@ struct _timers // timer struct
double precision[3];
};
-static int
-_efl_test_jenkins_run(void)
-{
- char *jenkins_url = NULL;
-
- jenkins_url = getenv("JENKINS_URL");
-
- if (!jenkins_url)
- return 0;
-
- if (strcmp(jenkins_url, "https://build.enlightenment.org/") == 0)
- return 1;
- else
- return 0;
-}
-
static Eina_Bool
_timer1_cb(void *data)
{
@@ -152,7 +136,7 @@ _timer5_cb(void *data)
Timer 5 finishes testing.
*/
-START_TEST(ecore_test_timers)
+EFL_START_TEST(ecore_test_timers)
{
struct _timers timer = \
{
@@ -162,8 +146,6 @@ START_TEST(ecore_test_timers)
.precision = {0.01, 0.02, 0.03}
};
- fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n");
-
timer.timer1 = ecore_timer_add(TIMEOUT_1, _timer1_cb, &timer);
timer.timer2 = ecore_timer_add(TIMEOUT_2, _timer2_cb, &timer);
timer.add_timer2++;
@@ -185,112 +167,91 @@ START_TEST(ecore_test_timers)
ecore_timer_del(timer.timer4);
if (timer.timer5)
ecore_timer_del(timer.timer5);
-
- ecore_shutdown();
-
}
-END_TEST
+EFL_END_TEST
typedef struct _Test_Inside_Call
{
Ecore_Timer *t;
double start;
+ int it;
} Test_Inside_Call;
static Eina_Bool
_timeri_cb(void *data)
{
- static int it = 5;
Test_Inside_Call *c = data;
- fail_if(fabs(((ecore_time_get() - c->start) / (6 - it)) - 0.011) > 0.01);
+ fail_if(fabs((ecore_time_get() - c->start) - 0.011) > 0.01);
ecore_timer_reset(c->t);
+ c->start = ecore_time_get();
- it--;
+ c->it--;
- if (it == 0) ecore_main_loop_quit();
- return it != 0;
+ if (c->it > 0) return EINA_TRUE;
+ free(c);
+ ecore_main_loop_quit();
+ return EINA_FALSE;
}
-START_TEST(ecore_test_timer_inside_call)
+EFL_START_TEST(ecore_test_timer_inside_call)
{
- Test_Inside_Call c;
-
- fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n");
+ Test_Inside_Call *c;
- c.start = ecore_time_get();
- c.t = ecore_timer_add(0.01, _timeri_cb, &c);
+ c = malloc(sizeof(Test_Inside_Call));
+ c->start = ecore_time_get();
+ c->it = 5;
+ c->t = ecore_timer_add(0.01, _timeri_cb, c);
- fail_if(!c.t, "Error add timer\n");
+ fail_if(!c->t, "Error add timer\n");
ecore_main_loop_begin();
-
- ecore_shutdown();
-
}
-END_TEST
-
-static Eina_Bool
-_test_time_cb(void *data)
-{
- Eina_Bool *run = data;
+EFL_END_TEST
- *run = EINA_TRUE;
- return EINA_TRUE;
-}
-
-static void
-_test_death_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+EFL_START_TEST(ecore_test_timer_valid_callbackfunc)
{
- Eina_Bool *die = data;
-
- *die = EINA_TRUE;
+ Ecore_Timer *t = NULL;
+ fail_if((t = ecore_timer_add(0.5, NULL, NULL)), "ERROR: Invalid callback func!\n");
}
+EFL_END_TEST
-static void
-_test_run_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+static Eina_Bool
+_quit_cb(void *data)
{
- _test_time_cb(data);
+ Eina_Bool *val = data;
+ if (val) *val = EINA_TRUE;
+ ecore_main_loop_quit();
+ return EINA_FALSE;
}
-START_TEST(ecore_test_timer_lifecycle)
+EFL_START_TEST(ecore_test_ecore_main_loop_timer)
{
- Eina_Bool rl = EINA_FALSE, re = EINA_FALSE;
- Eina_Bool dl = EINA_FALSE, de = EINA_FALSE;
- Ecore_Timer *t;
- Eo *et;
+ Eina_Bool did = EINA_FALSE;
+ Ecore_Timer *timer;
+ double start, end, elapsed;
- efl_object_init();
- ecore_init();
- t = ecore_timer_add(1.0, _test_time_cb, &rl);
- efl_event_callback_add((Eo*) t, EFL_EVENT_DEL, _test_death_cb, &dl);
+ timer = ecore_timer_add(0.1, _quit_cb, &did);
+ fail_if(timer == NULL);
- et = efl_add(EFL_LOOP_TIMER_CLASS, efl_main_loop_get(),
- efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TICK, _test_run_cb, &re),
- efl_event_callback_add(efl_added, EFL_EVENT_DEL, _test_death_cb, &de),
- efl_loop_timer_interval_set(efl_added, 1.0));
- efl_ref(et);
-
- ecore_shutdown();
-
- fail_if(re == EINA_TRUE && rl == EINA_TRUE);
- fail_if(dl == EINA_FALSE);
- fail_if(de == EINA_TRUE);
+ start = ecore_time_get();
+ ecore_main_loop_begin();
+ end = ecore_time_get();
+ elapsed = end - start;
- efl_del(et);
- fail_if(de == EINA_FALSE);
+ fail_if(did == EINA_FALSE);
+ fail_if(elapsed < 0.05);
+ fail_if(elapsed > 0.15); /* .05 second "error margin" */
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
void ecore_test_timer(TCase *tc)
{
tcase_add_test(tc, ecore_test_timers);
-/* XXX: this seems a silly test - that we del the loop object?
- tcase_add_test(tc, ecore_test_timer_lifecycle);
- */
tcase_add_test(tc, ecore_test_timer_inside_call);
+ tcase_add_test(tc, ecore_test_timer_valid_callbackfunc);
+ tcase_add_test(tc, ecore_test_ecore_main_loop_timer);
}
diff --git a/src/tests/ecore/efl_app_suite.c b/src/tests/ecore/efl_app_suite.c
new file mode 100644
index 0000000000..3de672f4fa
--- /dev/null
+++ b/src/tests/ecore/efl_app_suite.c
@@ -0,0 +1,90 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <unistd.h>
+#define EFL_NOLEGACY_API_SUPPORT
+#include <Efl_Core.h>
+#include <Efl_Net.h>
+#include "efl_app_suite.h"
+#include "../efl_check.h"
+
+
+EFL_START_TEST(efl_app_test_efl_build_version)
+{
+ const Efl_Version *ver;
+ Eo *app;
+
+ ecore_init();
+
+ app = efl_app_get();
+ fail_if(!efl_isa(app, EFL_APP_CLASS));
+
+ efl_build_version_set(EFL_VERSION_MAJOR, EFL_VERSION_MINOR, 0, 0, NULL, EFL_BUILD_ID);
+ ver = efl_app_build_efl_version_get(app);
+ fail_if(!ver);
+ fail_if(ver->major != EFL_VERSION_MAJOR);
+ fail_if(ver->minor != EFL_VERSION_MINOR);
+ fail_if(ver->micro != 0);
+ fail_if(ver->revision != 0);
+ fail_if(ver->flavor);
+ fail_if(!eina_streq(ver->build_id, EFL_BUILD_ID));
+
+ ver = efl_app_efl_version_get(app);
+ fail_if(!ver);
+ fail_if(ver->major != EFL_VERSION_MAJOR);
+ fail_if(ver->minor != EFL_VERSION_MINOR);
+
+ ecore_shutdown();
+}
+EFL_END_TEST
+
+void efl_test_efl_app(TCase *tc)
+{
+ tcase_add_test(tc, efl_app_test_efl_build_version);
+}
+
+static const Efl_Test_Case etc[] = {
+ { "App", efl_test_efl_app },
+ { "Loop", efl_app_test_efl_loop },
+ { "Loop_Timer", efl_app_test_efl_loop_timer },
+ { "Loop_FD", efl_app_test_efl_loop_fd },
+ { "Promise", efl_app_test_promise },
+ { "Promise", efl_app_test_promise_2 },
+ { "Promise", efl_app_test_promise_3 },
+ { "Promise", efl_app_test_promise_safety },
+ { NULL, NULL }
+};
+
+SUITE_INIT(efl_app)
+{
+ ck_assert_int_eq(ecore_init(), 1);
+}
+
+SUITE_SHUTDOWN(efl_app)
+{
+ ck_assert_int_eq(ecore_shutdown(), 0);
+}
+
+int
+main(int argc, char **argv)
+{
+ int failed_count;
+
+ if (!_efl_test_option_disp(argc, argv, etc))
+ return 0;
+
+ eina_init();
+ efl_object_init();
+#ifdef NEED_RUN_IN_TREE
+ putenv("EFL_RUN_IN_TREE=1");
+#endif
+
+ failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
+ "Efl_App", etc, SUITE_INIT_FN(efl_app), SUITE_SHUTDOWN_FN(efl_app));
+
+ efl_object_shutdown();
+ eina_shutdown();
+ return (failed_count == 0) ? 0 : 255;
+}
diff --git a/src/tests/ecore/efl_app_suite.h b/src/tests/ecore/efl_app_suite.h
new file mode 100644
index 0000000000..29ed8f031f
--- /dev/null
+++ b/src/tests/ecore/efl_app_suite.h
@@ -0,0 +1,15 @@
+#ifndef _EFL_APP_SUITE_H
+#define _EFL_APP_SUITE_H
+
+#include <check.h>
+#include "../efl_check.h"
+void efl_app_test_efl_app(TCase *tc);
+void efl_app_test_efl_loop(TCase *tc);
+void efl_app_test_efl_loop_fd(TCase *tc);
+void efl_app_test_efl_loop_timer(TCase *tc);
+void efl_app_test_promise(TCase *tc);
+void efl_app_test_promise_2(TCase *tc);
+void efl_app_test_promise_3(TCase *tc);
+void efl_app_test_promise_safety(TCase *tc);
+
+#endif /* _EFL_APP_SUITE_H */
diff --git a/src/tests/ecore/efl_app_test_loop.c b/src/tests/ecore/efl_app_test_loop.c
new file mode 100644
index 0000000000..c924925169
--- /dev/null
+++ b/src/tests/ecore/efl_app_test_loop.c
@@ -0,0 +1,46 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <unistd.h>
+#define EFL_NOLEGACY_API_SUPPORT
+#include <Efl_Core.h>
+#include <Efl_Net.h>
+#include "efl_app_suite.h"
+#include "../efl_check.h"
+
+EFL_START_TEST(efl_app_test_efl_loop_register)
+{
+ Efl_Object *t, *n;
+
+ ecore_init();
+
+ t = efl_provider_find(efl_app_get(), EFL_LOOP_CLASS);
+ fail_if(!efl_isa(t, EFL_LOOP_CLASS));
+ fail_if(!efl_isa(t, EFL_APP_CLASS));
+
+ t = efl_provider_find(efl_app_get(), EFL_LOOP_TIMER_CLASS);
+ fail_if(t != NULL);
+
+ n = efl_add(EFL_LOOP_TIMER_CLASS, efl_app_get(),
+ efl_loop_timer_interval_set(efl_added, 1.0));
+ efl_loop_register(efl_app_get(), EFL_LOOP_TIMER_CLASS, n);
+
+ t = efl_provider_find(efl_app_get(), EFL_LOOP_TIMER_CLASS);
+ fail_if(!efl_isa(t, EFL_LOOP_TIMER_CLASS));
+ fail_if(t != n);
+
+ efl_loop_unregister(efl_app_get(), EFL_LOOP_TIMER_CLASS, n);
+
+ t = efl_provider_find(efl_app_get(), EFL_LOOP_TIMER_CLASS);
+ fail_if(t != NULL);
+
+ ecore_shutdown();
+}
+EFL_END_TEST
+
+void efl_app_test_efl_loop(TCase *tc)
+{
+ tcase_add_test(tc, efl_app_test_efl_loop_register);
+}
diff --git a/src/tests/ecore/efl_app_test_loop_fd.c b/src/tests/ecore/efl_app_test_loop_fd.c
new file mode 100644
index 0000000000..4403933aa8
--- /dev/null
+++ b/src/tests/ecore/efl_app_test_loop_fd.c
@@ -0,0 +1,97 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <unistd.h>
+#define EFL_NOLEGACY_API_SUPPORT
+#include <Efl_Core.h>
+#include <Efl_Net.h>
+#include "efl_app_suite.h"
+#include "../efl_check.h"
+
+
+static void
+_eo_read_cb(void *data, const Efl_Event *info EINA_UNUSED)
+{
+ Eina_Bool *did = data;
+
+ *did = EINA_TRUE;
+ ecore_main_loop_quit();
+}
+
+EFL_START_TEST(ecore_test_efl_loop_fd)
+{
+ Eina_Bool did = EINA_FALSE;
+ Eo *fd;
+ int comm[2];
+ int ret;
+
+ ret = pipe(comm);
+ fail_if(ret != 0);
+
+ fd = efl_add(EFL_LOOP_FD_CLASS, efl_main_loop_get(),
+ efl_loop_fd_set(efl_added, comm[0]),
+ efl_event_callback_add(efl_added, EFL_LOOP_FD_EVENT_READ, _eo_read_cb, &did));
+ fail_if(fd == NULL);
+
+ ret = write(comm[1], &did, 1);
+ fail_if(ret != 1);
+
+ efl_loop_begin(efl_main_loop_get());
+
+ close(comm[0]);
+ close(comm[1]);
+
+ fail_if(did == EINA_FALSE);
+
+}
+EFL_END_TEST
+
+static void
+_efl_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Eina_Bool *dead = data;
+
+ *dead = EINA_TRUE;
+}
+
+EFL_START_TEST(ecore_test_efl_loop_fd_lifecycle)
+{
+ Eina_Bool did = EINA_FALSE;
+ Eina_Bool dead = EINA_FALSE;
+ Eo *fd;
+ int comm[2];
+ int ret;
+
+ ret = pipe(comm);
+ fail_if(ret != 0);
+
+ fd = efl_add(EFL_LOOP_FD_CLASS, efl_main_loop_get(),
+ efl_loop_fd_set(efl_added, comm[0]),
+ efl_event_callback_add(efl_added, EFL_LOOP_FD_EVENT_READ, _eo_read_cb, &did),
+ efl_event_callback_add(efl_added, EFL_EVENT_DEL, _efl_del_cb, &dead));
+ fail_if(fd == NULL);
+
+ ret = write(comm[1], &did, 1);
+ fail_if(ret != 1);
+
+ efl_loop_begin(efl_main_loop_get());
+
+ close(comm[0]);
+ close(comm[1]);
+
+ fail_if(did == EINA_FALSE);
+ fail_if(dead == EINA_TRUE);
+
+ efl_del(fd);
+ fail_if(dead == EINA_FALSE);
+}
+EFL_END_TEST
+
+
+void efl_app_test_efl_loop_fd(TCase *tc)
+{
+ tcase_add_test(tc, ecore_test_efl_loop_fd);
+ tcase_add_test(tc, ecore_test_efl_loop_fd_lifecycle);
+}
diff --git a/src/tests/ecore/efl_app_test_loop_timer.c b/src/tests/ecore/efl_app_test_loop_timer.c
new file mode 100644
index 0000000000..fadb523395
--- /dev/null
+++ b/src/tests/ecore/efl_app_test_loop_timer.c
@@ -0,0 +1,82 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <unistd.h>
+#define EFL_NOLEGACY_API_SUPPORT
+#include <Efl_Core.h>
+#include <Efl_Net.h>
+#include "efl_app_suite.h"
+#include "../efl_check.h"
+
+/*
+static Eina_Bool
+_test_time_cb(void *data)
+{
+ Eina_Bool *run = data;
+
+ *run = EINA_TRUE;
+
+ return EINA_TRUE;
+}
+
+static void
+_test_death_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Eina_Bool *die = data;
+
+ *die = EINA_TRUE;
+}
+
+static void
+_test_run_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ _test_time_cb(data);
+}
+
+EFL_START_TEST(ecore_test_timer_lifecycle)
+{
+ Eina_Bool rl = EINA_FALSE, re = EINA_FALSE;
+ Eina_Bool dl = EINA_FALSE, de = EINA_FALSE;
+ Ecore_Timer *t;
+ Eo *et;
+
+ efl_object_init();
+
+ t = ecore_timer_add(1.0, _test_time_cb, &rl);
+ efl_event_callback_add((Eo*) t, EFL_EVENT_DEL, _test_death_cb, &dl);
+
+ et = efl_add(EFL_LOOP_TIMER_CLASS, efl_main_loop_get(),
+ efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TICK, _test_run_cb, &re),
+ efl_event_callback_add(efl_added, EFL_EVENT_DEL, _test_death_cb, &de),
+ efl_loop_timer_interval_set(efl_added, 1.0));
+ efl_ref(et);
+
+ fail_if(re == EINA_TRUE && rl == EINA_TRUE);
+ fail_if(dl == EINA_FALSE);
+ fail_if(de == EINA_TRUE);
+
+ efl_del(et);
+ fail_if(de == EINA_FALSE);
+
+ efl_object_shutdown();
+}
+EFL_END_TEST
+*/
+
+EFL_START_TEST(efl_app_test_loop_timer_invalid)
+{
+ Efl_Object *t = efl_add(EFL_LOOP_TIMER_CLASS, efl_app_get());
+ fail_if(t != NULL);
+}
+EFL_END_TEST
+
+void efl_app_test_efl_loop_timer(TCase *tc EINA_UNUSED)
+{
+ /* XXX: this seems a silly test - that we del the loop object?
+ tcase_add_test(tc, ecore_test_timer_lifecycle);
+ */
+
+ tcase_add_test(tc, efl_app_test_loop_timer_invalid);
+}
diff --git a/src/tests/ecore/ecore_test_promise2.c b/src/tests/ecore/efl_app_test_promise.c
index ff663f1685..fde88793b4 100644
--- a/src/tests/ecore/ecore_test_promise2.c
+++ b/src/tests/ecore/efl_app_test_promise.c
@@ -2,14 +2,13 @@
# include <config.h>
#endif
-#include <Ecore.h>
-#include <Eina.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <time.h>
-#include <stdarg.h>
-#include <Eo.h>
-#include "ecore_suite.h"
+#include <stdio.h>
+#include <unistd.h>
+#define EFL_NOLEGACY_API_SUPPORT
+#include <Efl_Core.h>
+#include <Efl_Net.h>
+#include "efl_app_suite.h"
+#include "../efl_check.h"
#define CHAIN_SIZE (3)
#define DEFAULT_ERROR (EFBIG)
@@ -33,7 +32,7 @@
typedef struct _PromiseCtx {
Eina_Promise *p;
- Ecore_Timer *t;
+ Efl_Object *t;
Eina_Bool fail;
Eina_Value *value;
} PromiseCtx;
@@ -122,7 +121,7 @@ static void
_cancel(void *data, const Eina_Promise *dead_ptr EINA_UNUSED)
{
PromiseCtx *ctx = data;
- if (ctx->t) ecore_timer_del(ctx->t);
+ if (ctx->t) efl_del(ctx->t);
ctx->t = NULL;
eina_value_free(ctx->value);
free(ctx);
@@ -135,8 +134,8 @@ _promise_cancel_test(void *data, const Eina_Promise *dead_ptr EINA_UNUSED)
*cancel_called = EINA_TRUE;
}
-static Eina_Bool
-_simple_timeout(void *data)
+static void
+_simple_timeout(void *data, const Efl_Event *ev EINA_UNUSED)
{
PromiseCtx *ctx = data;
@@ -149,8 +148,8 @@ _simple_timeout(void *data)
eina_promise_resolve(ctx->p, v);
eina_value_free(ctx->value);
}
+ efl_del(ctx->t);
free(ctx);
- return EINA_FALSE;
}
static Eina_Future_Scheduler *
@@ -177,7 +176,9 @@ _future_get(PromiseCtx *ctx, double timeout)
f = eina_future_new(ctx->p);
fail_if(!f);
- ctx->t = ecore_timer_add(timeout, _simple_timeout, ctx);
+ ctx->t = efl_add(EFL_LOOP_TIMER_CLASS, efl_main_loop_get(),
+ efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TICK, _simple_timeout, ctx),
+ efl_loop_timer_interval_set(efl_added, timeout));
fail_if(!ctx->t);
return f;
}
@@ -484,7 +485,7 @@ _promise_empty_done(void *data, const Eina_Value value, const Eina_Future *dead_
return value;
}
-START_TEST(efl_test_timeout)
+EFL_START_TEST(efl_test_timeout)
{
Eina_Future *f;
Eina_Bool done = EINA_FALSE;
@@ -498,9 +499,9 @@ START_TEST(efl_test_timeout)
fail_unless(done);
}
-END_TEST
+EFL_END_TEST
-START_TEST(efl_test_job)
+EFL_START_TEST(efl_test_job)
{
Eina_Future *f;
Eina_Bool done = EINA_FALSE;
@@ -514,9 +515,9 @@ START_TEST(efl_test_job)
fail_unless(done);
}
-END_TEST
+EFL_END_TEST
-START_TEST(efl_test_idle)
+EFL_START_TEST(efl_test_idle)
{
Eina_Future *f;
Eina_Bool done = EINA_FALSE;
@@ -530,10 +531,10 @@ START_TEST(efl_test_idle)
fail_unless(done);
}
-END_TEST
+EFL_END_TEST
-START_TEST(efl_test_promise_future_success)
+EFL_START_TEST(efl_test_promise_future_success)
{
Eina_Future *f;
fail_if(!ecore_init());
@@ -543,9 +544,9 @@ START_TEST(efl_test_promise_future_success)
ecore_main_loop_begin();
ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(efl_test_promise_future_failure)
+EFL_START_TEST(efl_test_promise_future_failure)
{
Eina_Future *f;
fail_if(!ecore_init());
@@ -555,9 +556,9 @@ START_TEST(efl_test_promise_future_failure)
ecore_main_loop_begin();
ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(efl_test_promise_future_chain_no_error)
+EFL_START_TEST(efl_test_promise_future_chain_no_error)
{
Eina_Future *f;
static int i = 0;
@@ -572,9 +573,9 @@ START_TEST(efl_test_promise_future_chain_no_error)
ecore_main_loop_begin();
ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(efl_test_promise_future_chain_error)
+EFL_START_TEST(efl_test_promise_future_chain_error)
{
Eina_Future *f;
static int i = 0;
@@ -589,9 +590,9 @@ START_TEST(efl_test_promise_future_chain_error)
ecore_main_loop_begin();
ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(efl_test_promise_future_cancel)
+EFL_START_TEST(efl_test_promise_future_cancel)
{
fail_if(!ecore_init());
int i;
@@ -638,9 +639,9 @@ START_TEST(efl_test_promise_future_cancel)
}
ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(efl_test_promise_future_inner_promise)
+EFL_START_TEST(efl_test_promise_future_inner_promise)
{
Eina_Future *f;
@@ -652,9 +653,9 @@ START_TEST(efl_test_promise_future_inner_promise)
ecore_main_loop_begin();
ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(efl_test_promise_future_inner_promise_fail)
+EFL_START_TEST(efl_test_promise_future_inner_promise_fail)
{
Eina_Future *f;
void *data =(void *) 0x01;
@@ -667,9 +668,9 @@ START_TEST(efl_test_promise_future_inner_promise_fail)
ecore_main_loop_begin();
ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(efl_test_promise_future_implicit_cancel)
+EFL_START_TEST(efl_test_promise_future_implicit_cancel)
{
Eina_Promise *p;
Eina_Future *f;
@@ -693,15 +694,15 @@ START_TEST(efl_test_promise_future_implicit_cancel)
The promise was resolved, but the mainloop is not running.
Since ecore_shutdown() will be called all the futures must be cancelled
*/
- ecore_shutdown();
+ ck_assert_int_eq(ecore_shutdown(), 0);
//All the futures were cancelled at this point
fail_if(cancel_count != CHAIN_SIZE);
//Cancel should not be called, since we called eina_promise_resolve()
fail_if(cancel_called);
}
-END_TEST
+EFL_END_TEST
-START_TEST(efl_test_promise_future_convert)
+EFL_START_TEST(efl_test_promise_future_convert)
{
Eina_Future *f;
@@ -714,9 +715,9 @@ START_TEST(efl_test_promise_future_convert)
ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(efl_test_promise_future_easy)
+EFL_START_TEST(efl_test_promise_future_easy)
{
Eina_Future *f;
Easy_Ctx easy1 = { 0 };
@@ -744,9 +745,9 @@ START_TEST(efl_test_promise_future_easy)
fail_if(!(easy2.success_called && !easy2.error_called && easy2.free_called));
fail_if(!(!easy3.success_called && easy3.error_called && easy3.free_called));
}
-END_TEST
+EFL_END_TEST
-START_TEST(efl_test_promise_future_all)
+EFL_START_TEST(efl_test_promise_future_all)
{
Eina_Future *futures[11];
unsigned int i, futures_called = 0, len = EINA_C_ARRAY_LENGTH(futures);
@@ -770,9 +771,9 @@ START_TEST(efl_test_promise_future_all)
ecore_shutdown();
fail_if(futures_called != len);
}
-END_TEST
+EFL_END_TEST
-START_TEST(efl_test_promise_future_race)
+EFL_START_TEST(efl_test_promise_future_race)
{
Race_Ctx ctx = { 0 };
Eina_Future *futures[11];
@@ -804,7 +805,7 @@ START_TEST(efl_test_promise_future_race)
fail_if(ctx.success != 1);
fail_if(ctx.failed != (len - 1));
}
-END_TEST
+EFL_END_TEST
static Eina_Value
_eo_future1_ok(Eo *eo EINA_UNUSED, const Eina_Value v)
@@ -861,7 +862,7 @@ _eo_chain_stop(void *data EINA_UNUSED, const Eina_Value v, const Eina_Future *de
return v;
}
-START_TEST(efl_test_promise_eo)
+EFL_START_TEST(efl_test_promise_eo)
{
Eina_Future *f;
Eo *obj;
@@ -871,7 +872,7 @@ START_TEST(efl_test_promise_eo)
fail_if(!ecore_init());
//Use a random object..
- obj = efl_add(EFL_IO_BUFFER_CLASS, NULL);
+ obj = efl_add_ref(EFL_IO_BUFFER_CLASS, NULL);
fail_if(!obj);
efl_key_data_set(obj, "free_called", &free_called);
f = eina_future_chain(_int_future_get(),
@@ -886,7 +887,7 @@ START_TEST(efl_test_promise_eo)
efl_object_shutdown();
ck_assert_int_eq(free_called, 2);
}
-END_TEST
+EFL_END_TEST
static Eina_Value
_eo_future_link_success(Eo *eo EINA_UNUSED, const Eina_Value v)
@@ -920,7 +921,7 @@ _eo_link_chain_end(void *data EINA_UNUSED, const Eina_Value v, const Eina_Future
return v;
}
-START_TEST(efl_test_promise_eo_link)
+EFL_START_TEST(efl_test_promise_eo_link)
{
Eina_Future *f;
Eo *obj;
@@ -930,7 +931,7 @@ START_TEST(efl_test_promise_eo_link)
fail_if(!ecore_init());
//Use a random object..
- obj = efl_add(EFL_IO_BUFFER_CLASS, NULL);
+ obj = efl_add_ref(EFL_IO_BUFFER_CLASS, NULL);
fail_if(!obj);
efl_key_data_set(obj, "err_called", &err_called);
@@ -952,7 +953,7 @@ START_TEST(efl_test_promise_eo_link)
efl_object_shutdown();
ck_assert_int_eq(err_called, 6);
}
-END_TEST
+EFL_END_TEST
static Eina_Value
_err_ignored(void *data EINA_UNUSED, const Eina_Value v, const Eina_Future *f EINA_UNUSED)
@@ -963,7 +964,7 @@ _err_ignored(void *data EINA_UNUSED, const Eina_Value v, const Eina_Future *f EI
return v;
}
-START_TEST(efl_test_promise_future_ignore_error)
+EFL_START_TEST(efl_test_promise_future_ignore_error)
{
Eina_Future *f;
@@ -975,7 +976,7 @@ START_TEST(efl_test_promise_future_ignore_error)
ecore_main_loop_begin();
ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
#define PROMISE_LOG_DOMAIN_STR ("promise_test_domain")
@@ -1059,7 +1060,7 @@ _log_test(const Eina_Log_Domain *d,
*log_ok = EINA_TRUE;
}
-START_TEST(efl_test_promise_log)
+EFL_START_TEST(efl_test_promise_log)
{
Promise_Log_Ctx ctx = { 0 };
Eina_Future *f;
@@ -1103,7 +1104,7 @@ START_TEST(efl_test_promise_log)
fail_if(!ctx.err_log_ok);
fail_if(!ctx.info_log_ok);
}
-END_TEST
+EFL_END_TEST
#ifdef EINA_SAFETY_CHECKS
@@ -1112,7 +1113,7 @@ _dummy_cancel(void *data EINA_UNUSED, const Eina_Promise *dead EINA_UNUSED)
{
}
-START_TEST(efl_test_promise_null)
+EFL_START_TEST(efl_test_promise_null)
{
Log_Ctx ctx = { 0 };
Eina_Promise *p;
@@ -1132,9 +1133,9 @@ START_TEST(efl_test_promise_null)
ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(efl_test_promise_reject_resolve_null)
+EFL_START_TEST(efl_test_promise_reject_resolve_null)
{
Log_Ctx ctx = { 0 };
Eina_Value v;
@@ -1153,7 +1154,7 @@ START_TEST(efl_test_promise_reject_resolve_null)
fail_unless(ctx.did);
ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
static Eina_Value
_future_null_cb(void *data, const Eina_Value v, const Eina_Future *dead)
@@ -1194,7 +1195,7 @@ _future_easy_null_free(void *data, const Eina_Future *dead)
(*cb_called)++;
}
-START_TEST(efl_test_future_null)
+EFL_START_TEST(efl_test_future_null)
{
Eina_Future *f;
Log_Ctx ctx = { 0 };
@@ -1237,7 +1238,7 @@ START_TEST(efl_test_future_null)
ck_assert_int_eq(easy_cb_calls, 2);
ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
static Eina_Value
_future_race_all_null_cb(void *data, const Eina_Value v, const Eina_Future *dead EINA_UNUSED)
@@ -1252,7 +1253,7 @@ _future_race_all_null_cb(void *data, const Eina_Value v, const Eina_Future *dead
return v;
}
-START_TEST(efl_test_future_all_null)
+EFL_START_TEST(efl_test_future_all_null)
{
Log_Ctx ctx = { 0 };
unsigned i, len;
@@ -1281,9 +1282,9 @@ START_TEST(efl_test_future_all_null)
ecore_shutdown();
ck_assert_int_eq(cb_called, len);
}
-END_TEST
+EFL_END_TEST
-START_TEST(efl_test_future_race_null)
+EFL_START_TEST(efl_test_future_race_null)
{
Log_Ctx ctx = { 0 };
unsigned i, len;
@@ -1312,35 +1313,63 @@ START_TEST(efl_test_future_race_null)
ecore_shutdown();
ck_assert_int_eq(cb_called, len);
}
-END_TEST
+EFL_END_TEST
#endif
+static void
+promise_init(void)
+{
+ /* enable ecore init count manipulation for these tests */
+ ecore_shutdown();
+}
-void ecore_test_ecore_promise2(TCase *tc)
+static void
+promise_shutdown(void)
{
- tcase_add_test(tc, efl_test_timeout);
- tcase_add_test(tc, efl_test_job);
- tcase_add_test(tc, efl_test_idle);
+ /* enable ecore init count manipulation for these tests */
+ ecore_init();
+}
+
+void efl_app_test_promise(TCase *tc)
+{
+ tcase_add_checked_fixture(tc, promise_init, promise_shutdown);
+ tcase_add_test(tc, efl_test_promise_future_convert);
+ tcase_add_test(tc, efl_test_promise_future_easy);
+ tcase_add_test(tc, efl_test_promise_future_all);
+ tcase_add_test(tc, efl_test_promise_future_race);
+ tcase_add_test(tc, efl_test_promise_future_ignore_error);
tcase_add_test(tc, efl_test_promise_future_success);
tcase_add_test(tc, efl_test_promise_future_failure);
+}
+
+void efl_app_test_promise_2(TCase *tc)
+{
+ tcase_add_checked_fixture(tc, promise_init, promise_shutdown);
tcase_add_test(tc, efl_test_promise_future_chain_no_error);
tcase_add_test(tc, efl_test_promise_future_chain_error);
tcase_add_test(tc, efl_test_promise_future_cancel);
tcase_add_test(tc, efl_test_promise_future_implicit_cancel);
tcase_add_test(tc, efl_test_promise_future_inner_promise);
tcase_add_test(tc, efl_test_promise_future_inner_promise_fail);
- tcase_add_test(tc, efl_test_promise_future_convert);
- tcase_add_test(tc, efl_test_promise_future_easy);
- tcase_add_test(tc, efl_test_promise_future_all);
- tcase_add_test(tc, efl_test_promise_future_race);
- tcase_add_test(tc, efl_test_promise_future_ignore_error);
+}
+
+void efl_app_test_promise_3(TCase *tc)
+{
+ tcase_add_checked_fixture(tc, promise_init, promise_shutdown);
+ tcase_add_test(tc, efl_test_timeout);
+ tcase_add_test(tc, efl_test_job);
+ tcase_add_test(tc, efl_test_idle);
tcase_add_test(tc, efl_test_promise_log);
//FIXME: We should move this to EO tests, however they depend on Ecore...
tcase_add_test(tc, efl_test_promise_eo);
tcase_add_test(tc, efl_test_promise_eo_link);
+}
+void efl_app_test_promise_safety(TCase *tc)
+{
#ifdef EINA_SAFETY_CHECKS
+ tcase_add_checked_fixture(tc, promise_init, promise_shutdown);
tcase_add_test(tc, efl_test_promise_null);
tcase_add_test(tc, efl_test_promise_reject_resolve_null);
tcase_add_test(tc, efl_test_future_null);
diff --git a/src/tests/ecore_con/ecore_con_suite.c b/src/tests/ecore_con/ecore_con_suite.c
index 1ef8b84d50..614af39500 100644
--- a/src/tests/ecore_con/ecore_con_suite.c
+++ b/src/tests/ecore_con/ecore_con_suite.c
@@ -4,6 +4,8 @@
#include "ecore_con_suite.h"
#include "../efl_check.h"
+#include <Ecore.h>
+#include <Ecore_Con.h>
static const Efl_Test_Case etc[] = {
{ "Ecore_Con", ecore_con_test_ecore_con },
@@ -13,6 +15,30 @@ static const Efl_Test_Case etc[] = {
{ NULL, NULL }
};
+#define TIMEOUT 10.0
+static Ecore_Timer *timeout_timer;
+
+static Eina_Bool
+_timeout_timer(void *d EINA_UNUSED)
+{
+ timeout_timer = NULL;
+ ck_abort_msg("Timeout exceeded!");
+ return EINA_FALSE;
+}
+
+SUITE_INIT(ecore_con)
+{
+ ck_assert_int_eq(ecore_con_init(), 1);
+ timeout_timer = ecore_timer_add(TIMEOUT, _timeout_timer, NULL);
+}
+
+SUITE_SHUTDOWN(ecore_con)
+{
+ if (timeout_timer) ecore_timer_del(timeout_timer);
+ timeout_timer = NULL;
+ ck_assert_int_eq(ecore_con_shutdown(), 0);
+}
+
int
main(int argc, char **argv)
{
@@ -26,7 +52,7 @@ main(int argc, char **argv)
#endif
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
- "Ecore_Con", etc);
+ "Ecore_Con", etc, SUITE_INIT_FN(ecore_con), SUITE_SHUTDOWN_FN(ecore_con));
return (failed_count == 0) ? 0 : 255;
}
diff --git a/src/tests/ecore_con/ecore_con_suite.h b/src/tests/ecore_con/ecore_con_suite.h
index 133b68ab2d..2c16d2d41d 100644
--- a/src/tests/ecore_con/ecore_con_suite.h
+++ b/src/tests/ecore_con/ecore_con_suite.h
@@ -2,7 +2,7 @@
#define _ECORE_CON_SUITE_H
#include <check.h>
-
+#include "../efl_check.h"
void ecore_con_test_ecore_con(TCase *tc);
void ecore_con_test_ecore_con_url(TCase *tc);
void ecore_con_test_ecore_con_eet(TCase *tc);
diff --git a/src/tests/ecore_con/ecore_con_test_ecore_con.c b/src/tests/ecore_con/ecore_con_test_ecore_con.c
index 87522c052c..81eb079b3b 100644
--- a/src/tests/ecore_con/ecore_con_test_ecore_con.c
+++ b/src/tests/ecore_con/ecore_con_test_ecore_con.c
@@ -182,7 +182,6 @@ _dns_err(void *data, int type EINA_UNUSED, void *ev EINA_UNUSED)
{
Eina_Bool *err_check = data;
*err_check = EINA_TRUE;
- ecore_main_loop_quit();
return ECORE_CALLBACK_RENEW;
}
@@ -200,11 +199,6 @@ void _ecore_con_server_client_tests(Ecore_Con_Type compl_type, const char *name,
void *del_ret;
const char *server_name;
- ret = eina_init();
- fail_if(ret != 1);
- ret = ecore_con_init();
- fail_if(ret != 1);
-
handlers[0] = ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_ADD,
_add, (void *) 1);
fail_if(handlers[0] == NULL);
@@ -316,19 +310,15 @@ void _ecore_con_server_client_tests(Ecore_Con_Type compl_type, const char *name,
fail_if (del_ret != (void *) 2);
del_ret = ecore_event_handler_del (handlers[5]);
fail_if (del_ret != (void *) 2);
-
- ret = ecore_con_shutdown();
- fail_if(ret != 0);
- ret = eina_shutdown();
}
-START_TEST(ecore_test_ecore_con_local_user)
+EFL_START_TEST(ecore_test_ecore_con_local_user)
{
_ecore_con_server_client_tests(ECORE_CON_LOCAL_USER, "test_sock", EINA_FALSE, 12345);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_con_local_user_home)
+EFL_START_TEST(ecore_test_ecore_con_local_user_home)
{
const char *xdg_runtime_dir = getenv("XDG_RUNTIME_DIR");
@@ -336,9 +326,9 @@ START_TEST(ecore_test_ecore_con_local_user_home)
_ecore_con_server_client_tests(ECORE_CON_LOCAL_USER, "test_soc", EINA_FALSE, 12345);
if (xdg_runtime_dir) setenv("XDG_RUNTIME_DIR", xdg_runtime_dir, 1);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_con_local_user_tmp)
+EFL_START_TEST(ecore_test_ecore_con_local_user_tmp)
{
const char *xdg_runtime_dir = getenv("XDG_RUNTIME_DIR");
const char *homedir = getenv("HOME");
@@ -349,9 +339,9 @@ START_TEST(ecore_test_ecore_con_local_user_tmp)
if (homedir) setenv("HOME", homedir, 1);
if (xdg_runtime_dir) setenv("XDG_RUNTIME_DIR", xdg_runtime_dir, 1);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_con_local_user_none)
+EFL_START_TEST(ecore_test_ecore_con_local_user_none)
{
const char *xdg_runtime_dir = getenv("XDG_RUNTIME_DIR");
const char *homedir = getenv("HOME");
@@ -365,99 +355,99 @@ START_TEST(ecore_test_ecore_con_local_user_none)
if (homedir) setenv("HOME", homedir, 1);
if (xdg_runtime_dir) setenv("XDG_RUNTIME_DIR", xdg_runtime_dir, 1);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_con_local_system)
+EFL_START_TEST(ecore_test_ecore_con_local_system)
{
_ecore_con_server_client_tests(ECORE_CON_LOCAL_SYSTEM, "test_sock", EINA_FALSE, 12345);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_con_local_system_fullpath)
+EFL_START_TEST(ecore_test_ecore_con_local_system_fullpath)
{
_ecore_con_server_client_tests(ECORE_CON_LOCAL_SYSTEM, "/tmp/test_sock", EINA_FALSE, 12345);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_con_local_system_negport)
+EFL_START_TEST(ecore_test_ecore_con_local_system_negport)
{
_ecore_con_server_client_tests(ECORE_CON_LOCAL_SYSTEM, "test_sock", EINA_FALSE, -6);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_con_local_system_negport_fullpath)
+EFL_START_TEST(ecore_test_ecore_con_local_system_negport_fullpath)
{
_ecore_con_server_client_tests(ECORE_CON_LOCAL_SYSTEM, "/tmp/test_sock", EINA_FALSE, -6);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_con_local_abstract)
+EFL_START_TEST(ecore_test_ecore_con_local_abstract)
{
_ecore_con_server_client_tests(ECORE_CON_LOCAL_ABSTRACT, "test_sock", EINA_FALSE, 12345);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_con_remote_tcp)
+EFL_START_TEST(ecore_test_ecore_con_remote_tcp)
{
_ecore_con_server_client_tests(ECORE_CON_REMOTE_TCP, "127.0.0.1", EINA_FALSE, 12345);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_con_remote_nodelay)
+EFL_START_TEST(ecore_test_ecore_con_remote_nodelay)
{
_ecore_con_server_client_tests(ECORE_CON_REMOTE_NODELAY, "127.0.0.1", EINA_FALSE, 12345);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_con_remote_tcp_tls)
+EFL_START_TEST(ecore_test_ecore_con_remote_tcp_tls)
{
_ecore_con_server_client_tests(ECORE_CON_REMOTE_TCP | ECORE_CON_USE_TLS, "127.0.0.1", EINA_TRUE, 12345);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_con_remote_tcp_tls_load_cert)
+EFL_START_TEST(ecore_test_ecore_con_remote_tcp_tls_load_cert)
{
_ecore_con_server_client_tests(ECORE_CON_REMOTE_TCP | ECORE_CON_USE_TLS | ECORE_CON_LOAD_CERT, "127.0.0.1", EINA_TRUE, 12345);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_con_remote_tcp_mixed)
+EFL_START_TEST(ecore_test_ecore_con_remote_tcp_mixed)
{
_ecore_con_server_client_tests(ECORE_CON_REMOTE_TCP | ECORE_CON_USE_MIXED, "127.0.0.1", EINA_TRUE, 12345);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_con_remote_tcp_mixed_load_cert)
+EFL_START_TEST(ecore_test_ecore_con_remote_tcp_mixed_load_cert)
{
_ecore_con_server_client_tests(ECORE_CON_REMOTE_TCP | ECORE_CON_USE_MIXED | ECORE_CON_LOAD_CERT, "127.0.0.1", EINA_TRUE, 12345);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_con_remote_nodelay_tls)
+EFL_START_TEST(ecore_test_ecore_con_remote_nodelay_tls)
{
_ecore_con_server_client_tests(ECORE_CON_REMOTE_NODELAY | ECORE_CON_USE_TLS, "127.0.0.1", EINA_TRUE, 12345);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_con_remote_nodelay_tls_load_cert)
+EFL_START_TEST(ecore_test_ecore_con_remote_nodelay_tls_load_cert)
{
_ecore_con_server_client_tests(ECORE_CON_REMOTE_NODELAY | ECORE_CON_USE_TLS | ECORE_CON_LOAD_CERT, "127.0.0.1", EINA_TRUE, 12345);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_con_remote_nodelay_mixed)
+EFL_START_TEST(ecore_test_ecore_con_remote_nodelay_mixed)
{
_ecore_con_server_client_tests(ECORE_CON_REMOTE_NODELAY | ECORE_CON_USE_MIXED, "127.0.0.1", EINA_TRUE, 12345);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_con_remote_nodelay_mixed_load_cert)
+EFL_START_TEST(ecore_test_ecore_con_remote_nodelay_mixed_load_cert)
{
_ecore_con_server_client_tests(ECORE_CON_REMOTE_NODELAY | ECORE_CON_USE_MIXED | ECORE_CON_LOAD_CERT, "127.0.0.1", EINA_TRUE, 12345);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_con_ssl_available)
+EFL_START_TEST(ecore_test_ecore_con_ssl_available)
{
int ret = ecore_con_ssl_available_get();
#ifdef HAVE_GNUTLS
@@ -468,32 +458,14 @@ START_TEST(ecore_test_ecore_con_ssl_available)
fail_if(!ret);
#endif
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_con_init)
-{
- int ret;
-
- ret = ecore_con_init();
- fail_if(ret != 1);
-
- ret = ecore_con_shutdown();
- fail_if(ret != 0);
-}
-END_TEST
-
-START_TEST(ecore_test_ecore_con_dns)
+EFL_START_TEST(ecore_test_ecore_con_dns)
{
Ecore_Con_Server *client;
Ecore_Event_Handler *e_err;
Ecore_Event_Handler *e_add;
Eina_Bool err_check = EINA_FALSE;
- int ret;
-
- ret = eina_init();
- fail_if(ret != 1);
- ret = ecore_con_init();
- fail_if(ret != 1);
e_add = ecore_event_handler_add(ECORE_CON_EVENT_SERVER_ADD, _dns_add_del, (void *) &err_check);
e_err = ecore_event_handler_add(ECORE_CON_EVENT_SERVER_ERROR, _dns_err, (void *) &err_check);
@@ -506,32 +478,21 @@ START_TEST(ecore_test_ecore_con_dns)
ecore_con_server_timeout_set(client, 5.0);
ecore_main_loop_begin();
- fail_if (err_check == EINA_FALSE);
+ fail_if (err_check != EINA_FALSE);
fail_if (ecore_event_handler_del(e_err) != (void *) &err_check);
fail_if (ecore_event_handler_del(e_add) != (void *) &err_check);
-
- ret = ecore_con_shutdown();
- fail_if(ret != 0);
- ret = eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_ecore_con_shutdown_bef_init)
+EFL_START_TEST(ecore_test_ecore_con_shutdown_bef_init)
{
- int ret;
-
- eina_init();
- ret = ecore_con_shutdown();
+ int ret = ecore_con_shutdown();
fail_if(ret != 0);
- ret = ecore_con_init();
- fail_if(ret != 1);
-
ret = ecore_con_shutdown();
fail_if(ret != 0);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
static void
_lookup_done_cb(const char *canonname, const char *ip, struct sockaddr *addr, int addrlen, void *data)
@@ -546,22 +507,18 @@ _lookup_done_cb(const char *canonname, const char *ip, struct sockaddr *addr, in
ecore_main_loop_quit();
}
-START_TEST(ecore_test_ecore_con_dns_lookup)
+EFL_START_TEST(ecore_test_ecore_con_dns_lookup)
{
const char link[] = "www.google.com";
- ecore_con_init();
fail_unless(ecore_con_lookup(link, _lookup_done_cb, link));
ecore_main_loop_begin();
-
- ecore_con_shutdown();
}
-END_TEST
+EFL_END_TEST
void ecore_con_test_ecore_con(TCase *tc)
{
- tcase_add_test(tc, ecore_test_ecore_con_init);
tcase_add_test(tc, ecore_test_ecore_con_local_user);
tcase_add_test(tc, ecore_test_ecore_con_local_user_home);
tcase_add_test(tc, ecore_test_ecore_con_local_user_tmp);
diff --git a/src/tests/ecore_con/ecore_con_test_ecore_con_eet.c b/src/tests/ecore_con/ecore_con_test_ecore_con_eet.c
index 9a054e3764..45778f8ba8 100644
--- a/src/tests/ecore_con/ecore_con_test_ecore_con_eet.c
+++ b/src/tests/ecore_con/ecore_con_test_ecore_con_eet.c
@@ -70,8 +70,6 @@ _eet_data_cb(void *data EINA_UNUSED, Ecore_Con_Reply *reply, const char *protoco
char toSend[] = SRV_MSG;
ECE_Test *received = value;
- fprintf(stderr, "id: %d\n message: %s\n",
- received->id, received->message);
fail_if(strcmp(received->message, CLI_MSG));
fail_if(received->id != 1);
@@ -111,16 +109,14 @@ _eet_raw_data_cb(void *data, Ecore_Con_Reply *reply, const char *protocol_name E
ecore_con_server_del(cl);
}
-START_TEST(ecore_con_test_ecore_con_eet_svr_cl)
+EFL_START_TEST(ecore_con_test_ecore_con_eet_svr_cl)
{
Ecore_Con_Eet *ece_svr, *ece_cl;
Ecore_Con_Server *svr, *cl;
int *cb_data = (int *) malloc(sizeof(int));
*cb_data = 1;
- eina_init();
eet_init();
- ecore_con_init();
_ece_test_descriptor_init();
svr = ecore_con_server_add(ECORE_CON_REMOTE_TCP, "127.0.0.1",
@@ -165,11 +161,9 @@ START_TEST(ecore_con_test_ecore_con_eet_svr_cl)
free(cb_data);
_ece_test_descriptor_shutdown();
ecore_con_server_del(svr);
- ecore_con_shutdown();
eet_shutdown();
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
static Eina_Bool
_eet_svr_discnct_cb(void *data EINA_UNUSED, Ecore_Con_Reply *reply EINA_UNUSED, Ecore_Con_Server *conn EINA_UNUSED)
@@ -193,16 +187,14 @@ _eet_svr_raw_data_cb(void *data, Ecore_Con_Reply *reply, const char *protocol_na
ecore_con_server_del(svr);
}
-START_TEST(ecore_con_test_ecore_con_eet_svr_del)
+EFL_START_TEST(ecore_con_test_ecore_con_eet_svr_del)
{
Ecore_Con_Eet *ece_svr, *ece_cl;
Ecore_Con_Server *svr, *cl;
int *cb_data = (int *) malloc(sizeof(int));
*cb_data = 0;
- eina_init();
eet_init();
- ecore_con_init();
_ece_test_descriptor_init();
svr = ecore_con_server_add(ECORE_CON_REMOTE_TCP, "127.0.0.1",
@@ -235,11 +227,9 @@ START_TEST(ecore_con_test_ecore_con_eet_svr_del)
free(cb_data);
_ece_test_descriptor_shutdown();
- ecore_con_shutdown();
eet_shutdown();
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void ecore_con_test_ecore_con_eet(TCase *tc)
{
diff --git a/src/tests/ecore_con/ecore_con_test_ecore_con_url.c b/src/tests/ecore_con/ecore_con_test_ecore_con_url.c
index 1b732189bb..bdf26f07c3 100644
--- a/src/tests/ecore_con/ecore_con_test_ecore_con_url.c
+++ b/src/tests/ecore_con/ecore_con_test_ecore_con_url.c
@@ -164,7 +164,7 @@ error_user:
#endif
#ifdef ECORE_CON_FTP_TEST_URL
-START_TEST(ecore_con_test_ecore_con_url_ftp_upload)
+EFL_START_TEST(ecore_con_test_ecore_con_url_ftp_upload)
{
Ecore_Con_Url *ec_url;
url_test *info = NULL;
@@ -172,8 +172,6 @@ START_TEST(ecore_con_test_ecore_con_url_ftp_upload)
char link[] = ECORE_CON_FTP_TEST_URL;
char url[4096], *username, *password, *file = NULL, *dir = NULL;
- ret = eina_init();
- fail_if(ret != 1);
ret = ecore_con_url_init();
fail_if(ret != 1);
@@ -196,13 +194,12 @@ START_TEST(ecore_con_test_ecore_con_url_ftp_upload)
ret = ecore_con_url_shutdown();
fail_if(ret != 0);
- ret = eina_shutdown();
}
-END_TEST
+EFL_END_TEST
#endif
#ifdef ECORE_CON_HTTP_TEST_URL
-START_TEST(ecore_con_test_ecore_con_url_post)
+EFL_START_TEST(ecore_con_test_ecore_con_url_post)
{
Ecore_Con_Url *ec_url;
url_test *info = NULL;
@@ -212,8 +209,6 @@ START_TEST(ecore_con_test_ecore_con_url_post)
char *username = NULL, *password = NULL;
char url[4096];
- ret = eina_init();
- fail_if(ret != 1);
ret = ecore_con_url_init();
fail_if(ret != 1);
@@ -240,12 +235,11 @@ START_TEST(ecore_con_test_ecore_con_url_post)
ret = ecore_con_url_shutdown();
fail_if(ret != 0);
- ret = eina_shutdown();
}
-END_TEST
+EFL_END_TEST
#endif
-START_TEST(ecore_con_test_ecore_con_url_download)
+EFL_START_TEST(ecore_con_test_ecore_con_url_download)
{
Ecore_Con_Url *url;
url_test *info;
@@ -257,8 +251,6 @@ START_TEST(ecore_con_test_ecore_con_url_download)
#endif
char url_data[] = "test";
- ret = eina_init();
- fail_if(ret != 1);
ret = ecore_con_url_init();
fail_if(ret != 1);
@@ -290,17 +282,14 @@ START_TEST(ecore_con_test_ecore_con_url_download)
ret = ecore_con_url_shutdown();
fail_if(ret != 0);
- ret = eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_con_test_ecore_con_url_create)
+EFL_START_TEST(ecore_con_test_ecore_con_url_create)
{
Ecore_Con_Url *url;
int ret;
- ret = eina_init();
- fail_if(ret != 1);
ret = ecore_con_url_init();
fail_if(ret != 1);
@@ -311,11 +300,10 @@ START_TEST(ecore_con_test_ecore_con_url_create)
ret = ecore_con_url_shutdown();
fail_if(ret != 0);
- ret = eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_con_test_ecore_con_url_init)
+EFL_START_TEST(ecore_con_test_ecore_con_url_init)
{
int ret;
@@ -325,7 +313,7 @@ START_TEST(ecore_con_test_ecore_con_url_init)
ret = ecore_con_url_shutdown();
fail_if(ret != 0);
}
-END_TEST
+EFL_END_TEST
static Eina_Bool
_url_cookies_compl_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event_info)
@@ -359,8 +347,6 @@ _ecore_con_url_cookies_test_init()
const char link[] = DEFAULT_LINK;
#endif
- eina_init();
- ecore_con_init();
ecore_con_url_init();
ec_url = ecore_con_url_new(link);
@@ -385,11 +371,9 @@ _ecore_con_url_cookies_test_shutdown(Ecore_Con_Url *ec_url, int tmpfd, Eina_Tmps
eina_tmpstr_del(*path);
ecore_con_url_free(ec_url);
ecore_con_url_shutdown();
- ecore_con_shutdown();
- eina_shutdown();
}
-START_TEST(ecore_con_test_ecore_con_url_cookies_clear)
+EFL_START_TEST(ecore_con_test_ecore_con_url_cookies_clear)
{
Ecore_Con_Url *ec_url = _ecore_con_url_cookies_test_init();
Eina_Tmpstr *path;
@@ -407,9 +391,9 @@ START_TEST(ecore_con_test_ecore_con_url_cookies_clear)
_ecore_con_url_cookies_test_shutdown(ec_url, tmpfd, &path);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_con_test_ecore_con_url_cookies_clear_session)
+EFL_START_TEST(ecore_con_test_ecore_con_url_cookies_clear_session)
{
Ecore_Con_Url *ec_url = _ecore_con_url_cookies_test_init();
Eina_Tmpstr *path;
@@ -427,9 +411,9 @@ START_TEST(ecore_con_test_ecore_con_url_cookies_clear_session)
_ecore_con_url_cookies_test_shutdown(ec_url, tmpfd, &path);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_con_test_ecore_con_url_cookies_ignore_session)
+EFL_START_TEST(ecore_con_test_ecore_con_url_cookies_ignore_session)
{
Ecore_Con_Url *ec_url = _ecore_con_url_cookies_test_init();
Eina_Tmpstr *path;
@@ -446,7 +430,7 @@ START_TEST(ecore_con_test_ecore_con_url_cookies_ignore_session)
_ecore_con_url_cookies_test_shutdown(ec_url, tmpfd, &path);
}
-END_TEST
+EFL_END_TEST
void ecore_con_test_ecore_con_url(TCase *tc)
{
diff --git a/src/tests/ecore_con/ecore_con_test_efl_net_ip_address.c b/src/tests/ecore_con/ecore_con_test_efl_net_ip_address.c
index 563af26c60..11ed3d7c97 100644
--- a/src/tests/ecore_con/ecore_con_test_efl_net_ip_address.c
+++ b/src/tests/ecore_con/ecore_con_test_efl_net_ip_address.c
@@ -128,51 +128,38 @@ _timeout(void *data,
struct resolve_ctx {
- Eina_Array *results;
+ Eina_Value *results;
Eina_Stringshare *canonical_name;
Eina_Stringshare *request_address;
- Efl_Future *future;
+ Eina_Future *future;
Eina_Error err;
};
static void
_resolve_cleanup(struct resolve_ctx *ctx)
{
- Eina_Array_Iterator it;
- unsigned int i;
- const Efl_Net_Ip_Address *o;
-
mark_point();
- if (ctx->results)
- {
- EINA_ARRAY_ITER_NEXT(ctx->results, i, o, it)
- efl_unref(o);
- eina_array_free(ctx->results);
- ctx->results = NULL;
- }
+ if (ctx->results) eina_value_free(ctx->results);
+ ctx->results = NULL;
ctx->err = 0;
eina_stringshare_replace(&ctx->canonical_name, NULL);
eina_stringshare_replace(&ctx->request_address, NULL);
- if (ctx->future)
- {
- efl_future_cancel(ctx->future);
- ctx->future = NULL;
- }
+ if (ctx->future) eina_future_cancel(ctx->future);
+ ctx->future = NULL;
}
static Eina_Bool
_resolve_found(const struct resolve_ctx *ctx, const char *string)
{
- Eina_Array_Iterator it;
- unsigned int i;
const Efl_Net_Ip_Address *o;
+ unsigned int i, len;
ck_assert_ptr_ne(ctx->results, NULL);
- EINA_ARRAY_ITER_NEXT(ctx->results, i, o, it)
+ EINA_VALUE_ARRAY_FOREACH(ctx->results, len, i, o)
{
if (strcmp(string, efl_net_ip_address_string_get(o)) == 0)
return EINA_TRUE;
@@ -186,8 +173,7 @@ static void
_assert_found_internal(const char *file, int line, const struct resolve_ctx *ctx, const char *string, Eina_Bool expected, Eina_Error err)
{
Eina_Bool found;
- Eina_Array_Iterator it;
- unsigned int i;
+ unsigned int i, len;
const Efl_Net_Ip_Address *o;
if (ctx->err != err)
@@ -206,7 +192,7 @@ _assert_found_internal(const char *file, int line, const struct resolve_ctx *ctx
fprintf(stderr, "ERROR: did%s expect '%s' in results:\n",
expected ? "" : " NOT", string);
- EINA_ARRAY_ITER_NEXT(ctx->results, i, o, it)
+ EINA_VALUE_ARRAY_FOREACH(ctx->results, len, i, o)
fprintf(stderr, "result %u: %s\n", i, efl_net_ip_address_string_get(o));
_ck_assert_failed(file, line, "Failed",
@@ -216,44 +202,35 @@ _assert_found_internal(const char *file, int line, const struct resolve_ctx *ctx
NULL);
}
-static void
-_resolve_done(void *data, const Efl_Event *event)
+static Eina_Value
+_resolve_done(void *data, const Eina_Value v, const Eina_Future *dead_future EINA_UNUSED)
{
struct resolve_ctx *ctx = data;
- Efl_Future_Event_Success *f = event->info;
- Efl_Net_Ip_Address_Resolve_Results *r = f->value;
- Eina_Array_Iterator it;
- unsigned int i;
- Efl_Net_Ip_Address *o;
-
- ck_assert_ptr_eq(ctx->results, NULL);
- ctx->results = eina_array_new(32);
+ Eina_Value_Array desc = { 0 };
- ctx->canonical_name = eina_stringshare_ref(r->canonical_name);
- ctx->request_address = eina_stringshare_ref(r->request_address);
-
- EINA_ARRAY_ITER_NEXT(r->results, i, o, it)
- eina_array_push(ctx->results, efl_ref(o));
+ mark_point();
- ctx->future = NULL;
- ecore_main_loop_quit();
+ if (eina_value_type_get(&v) == EINA_VALUE_TYPE_ERROR)
+ {
+ eina_value_error_get(&v, &ctx->err);
+ goto end;
+ }
- mark_point();
-}
+ eina_value_struct_get(&v, "canonical_name", &ctx->canonical_name);
+ eina_value_struct_get(&v, "request_address", &ctx->request_address);
+ eina_value_struct_get(&v, "results", &desc);
-static void
-_resolve_failed(void *data, const Efl_Event *event)
-{
- struct resolve_ctx *ctx = data;
- Efl_Future_Event_Failure *f = event->info;
+ ctx->results = eina_value_new(EINA_VALUE_TYPE_ARRAY);
+ eina_value_pset(ctx->results, &desc);
- mark_point();
+ end:
+ ecore_main_loop_quit();
- ctx->err = f->error;
ctx->future = NULL;
- ecore_main_loop_quit();
mark_point();
+
+ return v;
}
static void
@@ -262,7 +239,7 @@ _resolve(struct resolve_ctx *ctx, const char *address, int family, int flags)
ctx->future = efl_net_ip_address_resolve(EFL_NET_IP_ADDRESS_CLASS,
address, family, flags);
ck_assert_ptr_ne(ctx->future, NULL);
- efl_future_then(ctx->future, _resolve_done, _resolve_failed, NULL, ctx);
+ ctx->future = eina_future_then(ctx->future, _resolve_done, ctx);
LOOP_WITH_TIMEOUT(10);
}
@@ -295,7 +272,7 @@ _ipv4_check(Eo *o, const struct sockaddr_in *addr)
ck_assert_str_eq(efl_net_ip_address_string_get(o), buf);
}
-START_TEST(ecore_test_efl_net_ip_address_ipv4_manual_ok)
+EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_manual_ok)
{
struct sockaddr_in addr = {
.sin_family = AF_INET,
@@ -303,39 +280,35 @@ START_TEST(ecore_test_efl_net_ip_address_ipv4_manual_ok)
Eina_Slice slice = { .mem = &addr.sin_addr, .len = sizeof(addr.sin_addr) };
Eo *o;
- ecore_con_init();
-
addr.sin_port = htons(12345);
addr.sin_addr.s_addr = htonl(0xabcdefafU);
- o = efl_add(EFL_NET_IP_ADDRESS_CLASS, NULL,
+ o = efl_add_ref(EFL_NET_IP_ADDRESS_CLASS, NULL,
efl_net_ip_address_family_set(efl_added, AF_INET),
efl_net_ip_address_port_set(efl_added, ntohs(addr.sin_port)),
efl_net_ip_address_set(efl_added, slice));
_ipv4_check(o, &addr);
- efl_del(o);
+ efl_unref(o);
addr.sin_port = htons(8081);
addr.sin_addr.s_addr = htonl(0);
- o = efl_add(EFL_NET_IP_ADDRESS_CLASS, NULL,
+ o = efl_add_ref(EFL_NET_IP_ADDRESS_CLASS, NULL,
efl_net_ip_address_family_set(efl_added, AF_INET),
efl_net_ip_address_port_set(efl_added, ntohs(addr.sin_port)),
efl_net_ip_address_set(efl_added, slice));
_ipv4_check(o, &addr);
- efl_del(o);
+ efl_unref(o);
addr.sin_port = htons(0);
addr.sin_addr.s_addr = htonl(0x12345678);
- o = efl_add(EFL_NET_IP_ADDRESS_CLASS, NULL,
+ o = efl_add_ref(EFL_NET_IP_ADDRESS_CLASS, NULL,
efl_net_ip_address_family_set(efl_added, AF_INET),
efl_net_ip_address_set(efl_added, slice));
_ipv4_check(o, &addr);
- efl_del(o);
-
- ecore_con_shutdown();
+ efl_unref(o);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_efl_net_ip_address_ipv4_manual_fail)
+EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_manual_fail)
{
uint8_t c = 123;
Eina_Slice wrong_slice = { .mem = &c, .len = 1 };
@@ -345,49 +318,47 @@ START_TEST(ecore_test_efl_net_ip_address_ipv4_manual_fail)
Eina_Slice slice = { .mem = &addr.sin_addr, .len = sizeof(addr.sin_addr) };
Eo *o;
- ecore_con_init();
-
TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: pd->addr.sa_family == 0 is true");
- o = efl_add(EFL_NET_IP_ADDRESS_CLASS, NULL);
+ o = efl_add_ref(EFL_NET_IP_ADDRESS_CLASS, NULL);
ck_assert_ptr_eq(o, NULL);
TRAP_ERRORS_FINISH(1);
TRAP_ERRORS_BEGIN(eina_safety, ERR, NULL);
- o = efl_add(EFL_NET_IP_ADDRESS_CLASS, NULL,
+ o = efl_add_ref(EFL_NET_IP_ADDRESS_CLASS, NULL,
efl_net_ip_address_family_set(efl_added, 12345));
ck_assert_ptr_eq(o, NULL);
TRAP_ERRORS_FINISH(2);
TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: pd->addr.sa_family == 0 is true");
- o = efl_add(EFL_NET_IP_ADDRESS_CLASS, NULL,
+ o = efl_add_ref(EFL_NET_IP_ADDRESS_CLASS, NULL,
efl_net_ip_address_set(efl_added, wrong_slice));
ck_assert_ptr_eq(o, NULL);
TRAP_ERRORS_FINISH(2);
TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: pd->addr.sa_family == 0 is true");
- o = efl_add(EFL_NET_IP_ADDRESS_CLASS, NULL,
+ o = efl_add_ref(EFL_NET_IP_ADDRESS_CLASS, NULL,
efl_net_ip_address_port_set(efl_added, 1234));
ck_assert_ptr_eq(o, NULL);
TRAP_ERRORS_FINISH(2);
TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: pd->addr.sa_family == 0 is true");
- o = efl_add(EFL_NET_IP_ADDRESS_CLASS, NULL,
+ o = efl_add_ref(EFL_NET_IP_ADDRESS_CLASS, NULL,
efl_net_ip_address_port_set(efl_added, 1234),
efl_net_ip_address_set(efl_added, wrong_slice));
ck_assert_ptr_eq(o, NULL);
TRAP_ERRORS_FINISH(3);
TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: rw_slice.len != address.len is true");
- o = efl_add(EFL_NET_IP_ADDRESS_CLASS, NULL,
+ o = efl_add_ref(EFL_NET_IP_ADDRESS_CLASS, NULL,
efl_net_ip_address_family_set(efl_added, AF_INET),
efl_net_ip_address_set(efl_added, wrong_slice));
_ipv4_check(o, &addr);
- efl_del(o);
+ efl_unref(o);
TRAP_ERRORS_FINISH(1);
addr.sin_port = htons(12345);
addr.sin_addr.s_addr = htonl(0xabcdefafU);
- o = efl_add(EFL_NET_IP_ADDRESS_CLASS, NULL,
+ o = efl_add_ref(EFL_NET_IP_ADDRESS_CLASS, NULL,
efl_net_ip_address_family_set(efl_added, AF_INET),
efl_net_ip_address_port_set(efl_added, ntohs(addr.sin_port)),
efl_net_ip_address_set(efl_added, slice));
@@ -417,13 +388,11 @@ START_TEST(ecore_test_efl_net_ip_address_ipv4_manual_fail)
efl_net_ip_address_set(o, slice);
TRAP_ERRORS_FINISH(1);
- efl_del(o);
-
- ecore_con_shutdown();
+ efl_unref(o);
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_efl_net_ip_address_ipv4_create_ok)
+EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_ok)
{
struct sockaddr_in addr = {
.sin_family = AF_INET,
@@ -431,15 +400,13 @@ START_TEST(ecore_test_efl_net_ip_address_ipv4_create_ok)
Eina_Slice slice = { .mem = &addr.sin_addr, .len = sizeof(addr.sin_addr) };
Eo *o;
- ecore_con_init();
-
addr.sin_port = htons(12345);
addr.sin_addr.s_addr = htonl(0xabcdefafU);
o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS,
ntohs(addr.sin_port),
slice);
_ipv4_check(o, &addr);
- efl_del(o);
+ efl_unref(o);
addr.sin_port = htons(8081);
addr.sin_addr.s_addr = htonl(0);
@@ -447,7 +414,7 @@ START_TEST(ecore_test_efl_net_ip_address_ipv4_create_ok)
ntohs(addr.sin_port),
slice);
_ipv4_check(o, &addr);
- efl_del(o);
+ efl_unref(o);
addr.sin_port = htons(0);
addr.sin_addr.s_addr = htonl(0x12345678);
@@ -455,20 +422,17 @@ START_TEST(ecore_test_efl_net_ip_address_ipv4_create_ok)
ntohs(addr.sin_port),
slice);
_ipv4_check(o, &addr);
- efl_del(o);
+ efl_unref(o);
- ecore_con_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_efl_net_ip_address_ipv4_create_fail)
+EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_fail)
{
uint8_t c = 123;
Eina_Slice wrong_slice = { .mem = &c, .len = 1 };
Eo *o;
- ecore_con_init();
-
TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: address.len != 4 && address.len != 16 is true");
o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS,
1234,
@@ -476,46 +440,40 @@ START_TEST(ecore_test_efl_net_ip_address_ipv4_create_fail)
ck_assert_ptr_eq(o, NULL);
TRAP_ERRORS_FINISH(1);
- ecore_con_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_efl_net_ip_address_ipv4_create_sockaddr_ok)
+EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_sockaddr_ok)
{
struct sockaddr_in addr = {
.sin_family = AF_INET,
};
Eo *o;
- ecore_con_init();
-
addr.sin_port = htons(12345);
addr.sin_addr.s_addr = htonl(0xabcdefafU);
o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, &addr);
ck_assert_ptr_ne(&addr, efl_net_ip_address_sockaddr_get(o));
_ipv4_check(o, &addr);
- efl_del(o);
+ efl_unref(o);
addr.sin_port = htons(0);
addr.sin_addr.s_addr = htonl(0);
o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, &addr);
ck_assert_ptr_ne(&addr, efl_net_ip_address_sockaddr_get(o));
_ipv4_check(o, &addr);
- efl_del(o);
+ efl_unref(o);
- ecore_con_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_efl_net_ip_address_ipv4_create_sockaddr_fail)
+EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_sockaddr_fail)
{
struct sockaddr_in addr = {
.sin_family = AF_UNSPEC,
};
Eo *o;
- ecore_con_init();
-
TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: sockaddr == NULL");
o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, NULL);
ck_assert_ptr_eq(o, NULL);
@@ -526,46 +484,40 @@ START_TEST(ecore_test_efl_net_ip_address_ipv4_create_sockaddr_fail)
ck_assert_ptr_eq(o, NULL);
TRAP_ERRORS_FINISH(1);
- ecore_con_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_efl_net_ip_address_ipv4_parse_ok)
+EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_parse_ok)
{
Eo *o;
- ecore_con_init();
-
o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "127.0.0.1:12345");
ck_assert_ptr_ne(o, NULL);
ck_assert_str_eq(efl_net_ip_address_string_get(o), "127.0.0.1:12345");
- efl_del(o);
+ efl_unref(o);
o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "127.0.0.1:0");
ck_assert_ptr_ne(o, NULL);
ck_assert_str_eq(efl_net_ip_address_string_get(o), "127.0.0.1");
- efl_del(o);
+ efl_unref(o);
o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "127.0.0.1");
ck_assert_ptr_ne(o, NULL);
ck_assert_str_eq(efl_net_ip_address_string_get(o), "127.0.0.1");
- efl_del(o);
+ efl_unref(o);
o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "192.168.0.123:80");
ck_assert_ptr_ne(o, NULL);
ck_assert_str_eq(efl_net_ip_address_string_get(o), "192.168.0.123:80");
- efl_del(o);
+ efl_unref(o);
- ecore_con_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_efl_net_ip_address_ipv4_parse_fail)
+EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_parse_fail)
{
Eo *o;
- ecore_con_init();
-
TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: numeric_address == NULL");
o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, NULL);
ck_assert_ptr_eq(o, NULL);
@@ -594,16 +546,13 @@ START_TEST(ecore_test_efl_net_ip_address_ipv4_parse_fail)
ck_assert_ptr_eq(o, NULL);
TRAP_ERRORS_FINISH(0); /* no error messages! */
- ecore_con_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_efl_net_ip_address_ipv4_resolve_ok)
+EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_resolve_ok)
{
struct resolve_ctx ctx = { };
- ecore_con_init();
-
_resolve(&ctx, "localhost:http", 0, 0);
_assert_found(&ctx, "127.0.0.1:80", EINA_TRUE, 0);
_resolve_cleanup(&ctx);
@@ -632,16 +581,13 @@ START_TEST(ecore_test_efl_net_ip_address_ipv4_resolve_ok)
_assert_found(&ctx, "[::1]:80", EINA_FALSE, 0);
_resolve_cleanup(&ctx);
- ecore_con_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_efl_net_ip_address_ipv4_resolve_fail)
+EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_resolve_fail)
{
struct resolve_ctx ctx = { };
- ecore_con_init();
-
TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: address == NULL");
ctx.future = efl_net_ip_address_resolve(EFL_NET_IP_ADDRESS_CLASS,
NULL, 0, 0);
@@ -662,11 +608,10 @@ START_TEST(ecore_test_efl_net_ip_address_ipv4_resolve_fail)
_assert_found(&ctx, "[::1]:http", EINA_FALSE, EFL_NET_ERROR_COULDNT_RESOLVE_HOST);
_resolve_cleanup(&ctx);
- ecore_con_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_efl_net_ip_address_ipv4_checks)
+EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_checks)
{
const struct test {
uint32_t addr;
@@ -691,8 +636,6 @@ START_TEST(ecore_test_efl_net_ip_address_ipv4_checks)
#undef TEST
};
- ecore_con_init();
-
for (itr = tests; itr < tests + sizeof(tests)/sizeof(tests[0]); itr++)
{
struct sockaddr_in a = {
@@ -716,12 +659,11 @@ START_TEST(ecore_test_efl_net_ip_address_ipv4_checks)
ck_assert_int_eq(efl_net_ip_address_ipv6_local_link_check(o), EINA_FALSE);
ck_assert_int_eq(efl_net_ip_address_ipv6_local_site_check(o), EINA_FALSE);
- efl_del(o);
+ efl_unref(o);
}
- ecore_con_shutdown();
}
-END_TEST
+EFL_END_TEST
/* IPv6 *****************************************************************/
@@ -761,7 +703,7 @@ _ipv6_set(struct sockaddr_in6 *addr, uint16_t s1, uint16_t s2, uint16_t s3, uint
memcpy(&addr->sin6_addr, s, 16);
}
-START_TEST(ecore_test_efl_net_ip_address_ipv6_manual_ok)
+EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_manual_ok)
{
struct sockaddr_in6 addr = {
.sin6_family = AF_INET6,
@@ -769,31 +711,28 @@ START_TEST(ecore_test_efl_net_ip_address_ipv6_manual_ok)
Eina_Slice slice = { .mem = &addr.sin6_addr, .len = sizeof(addr.sin6_addr) };
Eo *o;
- ecore_con_init();
-
addr.sin6_port = htons(12345);
_ipv6_set(&addr, 1, 2, 3, 4, 5, 6, 7, 8);
- o = efl_add(EFL_NET_IP_ADDRESS_CLASS, NULL,
+ o = efl_add_ref(EFL_NET_IP_ADDRESS_CLASS, NULL,
efl_net_ip_address_family_set(efl_added, AF_INET6),
efl_net_ip_address_port_set(efl_added, ntohs(addr.sin6_port)),
efl_net_ip_address_set(efl_added, slice));
_ipv6_check(o, &addr);
- efl_del(o);
+ efl_unref(o);
addr.sin6_port = htons(8081);
_ipv6_set(&addr, 0, 0, 0, 0, 0, 0, 0, 0);
- o = efl_add(EFL_NET_IP_ADDRESS_CLASS, NULL,
+ o = efl_add_ref(EFL_NET_IP_ADDRESS_CLASS, NULL,
efl_net_ip_address_family_set(efl_added, AF_INET6),
efl_net_ip_address_port_set(efl_added, ntohs(addr.sin6_port)),
efl_net_ip_address_set(efl_added, slice));
_ipv6_check(o, &addr);
- efl_del(o);
+ efl_unref(o);
- ecore_con_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_efl_net_ip_address_ipv6_manual_fail)
+EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_manual_fail)
{
uint8_t c = 123;
Eina_Slice wrong_slice = { .mem = &c, .len = 1 };
@@ -803,21 +742,19 @@ START_TEST(ecore_test_efl_net_ip_address_ipv6_manual_fail)
Eina_Slice slice = { .mem = &addr.sin6_addr, .len = sizeof(addr.sin6_addr) };
Eo *o;
- ecore_con_init();
-
/* generic errors checked at ecore_test_efl_net_ip_address_ipv4_manual_fail */
TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: rw_slice.len != address.len is true");
- o = efl_add(EFL_NET_IP_ADDRESS_CLASS, NULL,
+ o = efl_add_ref(EFL_NET_IP_ADDRESS_CLASS, NULL,
efl_net_ip_address_family_set(efl_added, AF_INET6),
efl_net_ip_address_set(efl_added, wrong_slice));
_ipv6_check(o, &addr);
- efl_del(o);
+ efl_unref(o);
TRAP_ERRORS_FINISH(1);
addr.sin6_port = htons(12345);
_ipv6_set(&addr, 0, 0, 0, 0, 0, 0, 0, 1);
- o = efl_add(EFL_NET_IP_ADDRESS_CLASS, NULL,
+ o = efl_add_ref(EFL_NET_IP_ADDRESS_CLASS, NULL,
efl_net_ip_address_family_set(efl_added, AF_INET6),
efl_net_ip_address_port_set(efl_added, ntohs(addr.sin6_port)),
efl_net_ip_address_set(efl_added, slice));
@@ -847,13 +784,12 @@ START_TEST(ecore_test_efl_net_ip_address_ipv6_manual_fail)
efl_net_ip_address_set(o, slice);
TRAP_ERRORS_FINISH(1);
- efl_del(o);
+ efl_unref(o);
- ecore_con_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_efl_net_ip_address_ipv6_create_ok)
+EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_create_ok)
{
struct sockaddr_in6 addr = {
.sin6_family = AF_INET6,
@@ -861,15 +797,13 @@ START_TEST(ecore_test_efl_net_ip_address_ipv6_create_ok)
Eina_Slice slice = { .mem = &addr.sin6_addr, .len = sizeof(addr.sin6_addr) };
Eo *o;
- ecore_con_init();
-
addr.sin6_port = htons(12365);
_ipv6_set(&addr, 1, 2, 3, 4, 5, 6, 7, 8);
o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS,
ntohs(addr.sin6_port),
slice);
_ipv6_check(o, &addr);
- efl_del(o);
+ efl_unref(o);
addr.sin6_port = htons(8081);
_ipv6_set(&addr, 0, 0, 0, 0, 0, 0, 0, 0);
@@ -877,7 +811,7 @@ START_TEST(ecore_test_efl_net_ip_address_ipv6_create_ok)
ntohs(addr.sin6_port),
slice);
_ipv6_check(o, &addr);
- efl_del(o);
+ efl_unref(o);
addr.sin6_port = htons(0);
_ipv6_set(&addr, 0, 0, 0, 0, 0, 0, 0, 1);
@@ -885,139 +819,130 @@ START_TEST(ecore_test_efl_net_ip_address_ipv6_create_ok)
ntohs(addr.sin6_port),
slice);
_ipv6_check(o, &addr);
- efl_del(o);
+ efl_unref(o);
- ecore_con_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_efl_net_ip_address_ipv6_create_sockaddr_ok)
+EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_create_sockaddr_ok)
{
struct sockaddr_in6 addr = {
.sin6_family = AF_INET6,
};
Eo *o;
- ecore_con_init();
-
addr.sin6_port = htons(12345);
_ipv6_set(&addr, 1, 2, 3, 4, 5, 6, 7, 8);
o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, &addr);
ck_assert_ptr_ne(&addr, efl_net_ip_address_sockaddr_get(o));
_ipv6_check(o, &addr);
- efl_del(o);
+ efl_unref(o);
addr.sin6_port = htons(0);
_ipv6_set(&addr, 0, 0, 0, 0, 0, 0, 0, 0);
o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, &addr);
ck_assert_ptr_ne(&addr, efl_net_ip_address_sockaddr_get(o));
_ipv6_check(o, &addr);
- efl_del(o);
+ efl_unref(o);
- ecore_con_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_efl_net_ip_address_ipv6_parse_ok)
+EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_parse_ok)
{
Eo *o;
- ecore_con_init();
-
o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::1]:12345");
ck_assert_ptr_ne(o, NULL);
ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::1]:12345");
- efl_del(o);
+ efl_unref(o);
o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::1]:0");
ck_assert_ptr_ne(o, NULL);
ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::1]");
- efl_del(o);
+ efl_unref(o);
o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::1]");
ck_assert_ptr_ne(o, NULL);
ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::1]");
- efl_del(o);
+ efl_unref(o);
o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "::1");
ck_assert_ptr_ne(o, NULL);
ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::1]");
- efl_del(o);
+ efl_unref(o);
o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::]:12345");
ck_assert_ptr_ne(o, NULL);
ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::]:12345");
- efl_del(o);
+ efl_unref(o);
o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::]:0");
ck_assert_ptr_ne(o, NULL);
ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::]");
- efl_del(o);
+ efl_unref(o);
o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::]");
ck_assert_ptr_ne(o, NULL);
ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::]");
- efl_del(o);
+ efl_unref(o);
o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "::");
ck_assert_ptr_ne(o, NULL);
ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::]");
- efl_del(o);
+ efl_unref(o);
/* IPv4 Mapped */
o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::ffff:192.168.0.1]:12345");
ck_assert_ptr_ne(o, NULL);
ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::ffff:192.168.0.1]:12345");
- efl_del(o);
+ efl_unref(o);
o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::ffff:192.168.0.1]");
ck_assert_ptr_ne(o, NULL);
ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::ffff:192.168.0.1]");
- efl_del(o);
+ efl_unref(o);
/* IPv4 Compatible */
o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::192.168.0.1]:12345");
ck_assert_ptr_ne(o, NULL);
ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::192.168.0.1]:12345");
- efl_del(o);
+ efl_unref(o);
o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::192.168.0.1]");
ck_assert_ptr_ne(o, NULL);
ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::192.168.0.1]");
- efl_del(o);
+ efl_unref(o);
/* Link Local */
o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[fe80::1]:12345");
ck_assert_ptr_ne(o, NULL);
ck_assert_str_eq(efl_net_ip_address_string_get(o), "[fe80::1]:12345");
- efl_del(o);
+ efl_unref(o);
o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[fe80::1]");
ck_assert_ptr_ne(o, NULL);
ck_assert_str_eq(efl_net_ip_address_string_get(o), "[fe80::1]");
- efl_del(o);
+ efl_unref(o);
/* Site Local */
o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[fc00::1]:12345");
ck_assert_ptr_ne(o, NULL);
ck_assert_str_eq(efl_net_ip_address_string_get(o), "[fc00::1]:12345");
- efl_del(o);
+ efl_unref(o);
o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[fc00::1]");
ck_assert_ptr_ne(o, NULL);
ck_assert_str_eq(efl_net_ip_address_string_get(o), "[fc00::1]");
- efl_del(o);
+ efl_unref(o);
- ecore_con_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_efl_net_ip_address_ipv6_parse_fail)
+EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_parse_fail)
{
Eo *o;
- ecore_con_init();
-
/* generic error (null ptr) checked in ipv4_parse_fail */
/* incomplete numbers */
@@ -1037,9 +962,8 @@ START_TEST(ecore_test_efl_net_ip_address_ipv6_parse_fail)
ck_assert_ptr_eq(o, NULL);
TRAP_ERRORS_FINISH(0); /* no error messages! */
- ecore_con_shutdown();
}
-END_TEST
+EFL_END_TEST
static const char *
_ipv6_localhost_check(void)
@@ -1130,14 +1054,12 @@ _ipv6_localhost_check(void)
return found;
}
-START_TEST(ecore_test_efl_net_ip_address_ipv6_resolve_ok)
+EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_resolve_ok)
{
struct resolve_ctx ctx = { };
char buf[4096];
const char *localhost_str;
- ecore_con_init();
-
localhost_str = _ipv6_localhost_check();
if (localhost_str)
@@ -1183,16 +1105,13 @@ START_TEST(ecore_test_efl_net_ip_address_ipv6_resolve_ok)
_resolve_cleanup(&ctx);
}
- ecore_con_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_efl_net_ip_address_ipv6_resolve_fail)
+EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_resolve_fail)
{
struct resolve_ctx ctx = { };
- ecore_con_init();
-
/* generic checks at ipv4_resolve_fail */
#if defined(AI_V4MAPPED) && (AI_V4MAPPED > 0)
@@ -1201,11 +1120,10 @@ START_TEST(ecore_test_efl_net_ip_address_ipv6_resolve_fail)
_resolve_cleanup(&ctx);
#endif
- ecore_con_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(ecore_test_efl_net_ip_address_ipv6_checks)
+EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_checks)
{
const struct test {
const char *str;
@@ -1221,8 +1139,6 @@ START_TEST(ecore_test_efl_net_ip_address_ipv6_checks)
#undef TEST
};
- ecore_con_init();
-
for (itr = tests; itr < tests + sizeof(tests)/sizeof(tests[0]); itr++)
{
struct sockaddr_in6 a = {
@@ -1253,12 +1169,11 @@ START_TEST(ecore_test_efl_net_ip_address_ipv6_checks)
ck_assert_int_eq(efl_net_ip_address_ipv6_local_link_check(o), IN6_IS_ADDR_LINKLOCAL(ia));
ck_assert_int_eq(efl_net_ip_address_ipv6_local_site_check(o), IN6_IS_ADDR_SITELOCAL(ia));
- efl_del(o);
+ efl_unref(o);
}
- ecore_con_shutdown();
}
-END_TEST
+EFL_END_TEST
void ecore_con_test_efl_net_ip_address(TCase *tc)
{
diff --git a/src/tests/ecore_cxx/ecore_cxx_suite.cc b/src/tests/ecore_cxx/ecore_cxx_suite.cc
index 33ed9b6fe6..93b2685ad9 100644
--- a/src/tests/ecore_cxx/ecore_cxx_suite.cc
+++ b/src/tests/ecore_cxx/ecore_cxx_suite.cc
@@ -21,7 +21,7 @@ main(int argc, char* argv[])
putenv(const_cast<char*>("EFL_RUN_IN_TREE=1"));
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
- "Ecore C++", etc);
+ "Ecore C++", etc, NULL, NULL);
return (failed_count == 0) ? 0 : 255;
}
diff --git a/src/tests/ecore_cxx/ecore_cxx_suite.h b/src/tests/ecore_cxx/ecore_cxx_suite.h
index 34343317fc..e0683e4882 100644
--- a/src/tests/ecore_cxx/ecore_cxx_suite.h
+++ b/src/tests/ecore_cxx/ecore_cxx_suite.h
@@ -5,7 +5,7 @@
#include <algorithm>
#include <check.h>
-
+#include "../efl_check.h"
void ecore_cxx_test_safe_call(TCase* tc);
#endif /* _ECORE_CXX_SUITE_H */
diff --git a/src/tests/ecore_cxx/ecore_cxx_test_safe_call.cc b/src/tests/ecore_cxx/ecore_cxx_test_safe_call.cc
index b321018601..5ad5da5015 100644
--- a/src/tests/ecore_cxx/ecore_cxx_test_safe_call.cc
+++ b/src/tests/ecore_cxx/ecore_cxx_test_safe_call.cc
@@ -36,7 +36,7 @@ void call_async(efl::eina::mutex& mutex, efl::eina::condition_variable& cond, in
);
}
-START_TEST(ecore_cxx_safe_call_async)
+EFL_START_TEST(ecore_cxx_safe_call_async)
{
efl::ecore::ecore_init init;
@@ -65,7 +65,7 @@ START_TEST(ecore_cxx_safe_call_async)
::eina_error_set(0);
std::cout << "end of ecore_cxx_safe_call_async" << std::endl;
}
-END_TEST
+EFL_END_TEST
struct big_pod
{
@@ -244,7 +244,7 @@ void call_sync_int()
ck_assert(constructor_called == destructor_called);
}
-START_TEST(ecore_cxx_safe_call_sync)
+EFL_START_TEST(ecore_cxx_safe_call_sync)
{
efl::ecore::ecore_init init;
@@ -256,7 +256,7 @@ START_TEST(ecore_cxx_safe_call_sync)
thread.join();
}
-END_TEST
+EFL_END_TEST
void
ecore_cxx_test_safe_call(TCase* tc)
diff --git a/src/tests/ector/suite/ector_suite.c b/src/tests/ector/suite/ector_suite.c
index 9f04a644b9..d2d3d9207c 100644
--- a/src/tests/ector/suite/ector_suite.c
+++ b/src/tests/ector/suite/ector_suite.c
@@ -22,12 +22,23 @@
#include "ector_suite.h"
#include "../efl_check.h"
+#include <Ector.h>
static const Efl_Test_Case etc[] = {
{ "init", ector_test_init },
{ NULL, NULL }
};
+SUITE_INIT(ector)
+{
+ ck_assert_int_eq(ector_init(), 1);
+}
+
+SUITE_SHUTDOWN(ector)
+{
+ ck_assert_int_eq(ector_shutdown(), 0);
+}
+
int
main(int argc, char *argv[])
{
@@ -41,7 +52,7 @@ main(int argc, char *argv[])
#endif
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
- "Ector", etc);
+ "Ector", etc, SUITE_INIT_FN(ector), SUITE_SHUTDOWN_FN(ector));
return (failed_count == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}
diff --git a/src/tests/ector/suite/ector_suite.h b/src/tests/ector/suite/ector_suite.h
index 176a838818..7f9cd5938d 100644
--- a/src/tests/ector/suite/ector_suite.h
+++ b/src/tests/ector/suite/ector_suite.h
@@ -2,7 +2,7 @@
#define ECTOR_SUITE_H
#include <check.h>
-
+#include "../efl_check.h"
void ector_test_init(TCase *tc);
#endif
diff --git a/src/tests/ector/suite/ector_test_init.c b/src/tests/ector/suite/ector_test_init.c
index 5194cbd52c..6a1dddff64 100644
--- a/src/tests/ector/suite/ector_test_init.c
+++ b/src/tests/ector/suite/ector_test_init.c
@@ -24,12 +24,10 @@
#include "ector_suite.h"
-START_TEST(ector_init_simple)
+EFL_START_TEST(ector_init_simple)
{
- fail_if(ector_init() != 1);
- fail_if(ector_shutdown() != 0);
}
-END_TEST
+EFL_END_TEST
void
ector_test_init(TCase *tc)
diff --git a/src/tests/edje/data/test_text_cursor.edc b/src/tests/edje/data/test_text_cursor.edc
new file mode 100644
index 0000000000..7392e545bc
--- /dev/null
+++ b/src/tests/edje/data/test_text_cursor.edc
@@ -0,0 +1,22 @@
+collections {
+ styles {
+ style { name: "tb_style";
+ base: "font=Sans font_size=20 color=#fff";
+ }
+ }
+ group { name: "test_text_cursor";
+ parts {
+ part { name: "text";
+ type: TEXTBLOCK;
+ entry_mode: EDITABLE;
+ cursor_mode: BEFORE;
+ description { state: "default" 0.0;
+ min: 300 300;
+ text {
+ style: "tb_style";
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/tests/edje/data/test_textblock.edc b/src/tests/edje/data/test_textblock.edc
new file mode 100644
index 0000000000..e3569a6467
--- /dev/null
+++ b/src/tests/edje/data/test_textblock.edc
@@ -0,0 +1,20 @@
+collections {
+ styles {
+ style { name: "tb_style";
+ base: "font=Sans font_size=20 color=#fff";
+ }
+ }
+ group { name: "test_textblock";
+ parts {
+ part { name: "text";
+ type: TEXTBLOCK;
+ description { state: "default" 0.0;
+ min: 300 300;
+ text {
+ style: "tb_style";
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/tests/edje/edje_suite.c b/src/tests/edje/edje_suite.c
index 0ec7d5c95a..e8f39cf011 100644
--- a/src/tests/edje/edje_suite.c
+++ b/src/tests/edje/edje_suite.c
@@ -4,12 +4,58 @@
#include "edje_suite.h"
#include "../efl_check.h"
+#include <Ecore_Evas.h>
static const Efl_Test_Case etc[] = {
{ "Edje", edje_test_edje },
+ { "Container", edje_test_container },
+ { "Features", edje_test_features },
+ { "Signal", edje_test_signal },
+ { "Swallow", edje_test_swallow },
+ { "Text", edje_test_text },
{ NULL, NULL }
};
+const char *
+test_layout_get(const char *name)
+{
+ static char filename[PATH_MAX];
+
+ snprintf(filename, PATH_MAX, TESTS_BUILD_DIR"/data/%s", name);
+
+ return filename;
+}
+
+Evas *
+_setup_evas(void)
+{
+ Evas *evas;
+ Evas_Engine_Info *einfo;
+
+ evas = evas_new();
+
+ evas_output_method_set(evas, evas_render_method_lookup("buffer"));
+ einfo = evas_engine_info_get(evas);
+ evas_engine_info_set(evas, einfo);
+
+ evas_output_size_set(evas, 500, 500);
+ evas_output_viewport_set(evas, 0, 0, 500, 500);
+
+ return evas;
+}
+
+SUITE_INIT(edje)
+{
+ ck_assert_int_eq(ecore_evas_init(), 1);
+ ck_assert_int_eq(edje_init(), 1);
+}
+
+SUITE_SHUTDOWN(edje)
+{
+ ck_assert_int_eq(edje_shutdown(), 0);
+ ck_assert_int_eq(ecore_evas_shutdown(), 0);
+}
+
int
main(int argc, char **argv)
{
@@ -23,7 +69,7 @@ main(int argc, char **argv)
#endif
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
- "Edje", etc);
+ "Edje", etc, SUITE_INIT_FN(edje), SUITE_SHUTDOWN_FN(edje));
return (failed_count == 0) ? 0 : 255;
}
diff --git a/src/tests/edje/edje_suite.h b/src/tests/edje/edje_suite.h
index 35ab20d793..6f4ee5be83 100644
--- a/src/tests/edje/edje_suite.h
+++ b/src/tests/edje/edje_suite.h
@@ -2,8 +2,17 @@
#define _EDJE_SUITE_H
#include <check.h>
+#include "../efl_check.h"
+#include <Edje.h>
+Evas *_setup_evas(void);
+const char *test_layout_get(const char *name);
void edje_test_edje(TCase *tc);
+void edje_test_container(TCase *tc);
+void edje_test_features(TCase *tc);
+void edje_test_signal(TCase *tc);
+void edje_test_swallow(TCase *tc);
+void edje_test_text(TCase *tc);
#endif /* _EDJE_SUITE_H */
diff --git a/src/tests/edje/edje_test_container.c b/src/tests/edje/edje_test_container.c
new file mode 100644
index 0000000000..018de4d3a0
--- /dev/null
+++ b/src/tests/edje/edje_test_container.c
@@ -0,0 +1,282 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <unistd.h>
+#include <stdio.h>
+
+#define EFL_GFX_FILTER_BETA
+#define EFL_CANVAS_LAYOUT_BETA
+
+#include "edje_suite.h"
+
+#define EVAS_DATA_DIR TESTS_SRC_DIR "/../../lib/evas"
+
+
+
+EFL_START_TEST(edje_test_box)
+{
+ Evas *evas;
+ Evas_Object *obj, *sobj, *sobjs[5];
+ const Evas_Object *box;
+ Eina_Iterator *it;
+ int i;
+
+ evas = _setup_evas();
+
+ obj = edje_object_add(evas);
+ fail_unless(edje_object_file_set(obj, test_layout_get("test_box.edj"), "test_group"));
+
+ for (i = 0; i < 5; i++)
+ {
+ sobjs[i] = evas_object_rectangle_add(evas);
+ fail_if(!sobjs[i]);
+ }
+
+ edje_object_part_box_append(obj, "box", sobjs[3]);
+ edje_object_part_box_prepend(obj, "box", sobjs[1]);
+ edje_object_part_box_insert_before(obj, "box", sobjs[0], sobjs[1]);
+ edje_object_part_box_insert_after(obj, "box", sobjs[4], sobjs[3]);
+ edje_object_part_box_insert_at(obj, "box", sobjs[2], 2);
+
+ edje_object_freeze(obj);
+ box = edje_object_part_object_get(obj, "box");
+ edje_object_thaw(obj);
+ it = evas_object_box_iterator_new(box);
+
+ i = 0;
+ EINA_ITERATOR_FOREACH(it, sobj)
+ {
+ fail_if(sobj != sobjs[i++]);
+ }
+ eina_iterator_free(it);
+
+ evas_free(evas);
+}
+EFL_END_TEST
+
+EFL_START_TEST(edje_test_box_eoapi)
+{
+ Evas *evas;
+ Evas_Object *obj, *sobj, *sobjs[5];
+ Eina_Iterator *it;
+ int i;
+
+ evas = _setup_evas();
+
+ obj = edje_object_add(evas);
+ fail_unless(edje_object_file_set(obj, test_layout_get("test_box.edj"), "test_group"));
+
+ for (i = 0; i < 5; i++)
+ {
+ sobjs[i] = evas_object_rectangle_add(evas);
+ fail_if(!sobjs[i]);
+ }
+
+ /* same test case as legacy api above */
+ efl_pack_end(efl_part(obj, "box"), sobjs[3]);
+ efl_pack_begin(efl_part(obj, "box"), sobjs[1]);
+ efl_pack_before(efl_part(obj, "box"), sobjs[0], sobjs[1]);
+ efl_pack_after(efl_part(obj, "box"), sobjs[4], sobjs[3]);
+ efl_pack_at(efl_part(obj, "box"), sobjs[2], 2);
+ fail_if(efl_content_count(efl_part(obj, "box")) != 5);
+
+ it = efl_content_iterate(efl_part(obj, "box"));
+ i = 0;
+ EINA_ITERATOR_FOREACH(it, sobj)
+ fail_if(sobj != sobjs[i++]);
+ fail_if(i != 5);
+ eina_iterator_free(it);
+
+ /* clear up and test a bit more */
+ efl_pack_unpack_all(efl_part(obj, "box"));
+ fail_if(efl_content_count(efl_part(obj, "box")) != 0);
+
+ efl_pack(efl_part(obj, "box"), sobjs[1]);
+ efl_pack_at(efl_part(obj, "box"), sobjs[0], 0);
+ efl_pack_at(efl_part(obj, "box"), sobjs[2], -1);
+ it = efl_content_iterate(efl_part(obj, "box"));
+ i = 0;
+ EINA_ITERATOR_FOREACH(it, sobj)
+ fail_if(sobj != sobjs[i++]);
+ fail_if(i != 3);
+ eina_iterator_free(it);
+
+ fail_if(!efl_content_remove(efl_part(obj, "box"), sobjs[0]));
+ fail_if(efl_content_count(efl_part(obj, "box")) != 2);
+ fail_if(!efl_pack_unpack_at(efl_part(obj, "box"), 1));
+ fail_if(efl_content_count(efl_part(obj, "box")) != 1);
+ fail_if(efl_pack_index_get(efl_part(obj, "box"), sobjs[1]) != 0);
+
+ efl_pack_clear(efl_part(obj, "box"));
+ fail_if(efl_content_count(efl_part(obj, "box")) != 0);
+
+ evas_free(evas);
+}
+EFL_END_TEST
+
+EFL_START_TEST(edje_test_table)
+{
+ Evas *evas;
+ Evas_Object *obj, *sobj, *sobjs[4];
+ int i, k, l, cols, rows;
+
+ evas = _setup_evas();
+
+ obj = edje_object_add(evas);
+ fail_unless(edje_object_file_set(obj, test_layout_get("test_table.edj"), "test_group"));
+
+ /* check items from EDC */
+ for (l = 0; l < 2; l++)
+ for (k = 0; k < 2; k++)
+ {
+ const char *txt;
+ char buf[20];
+
+ /* items have a text part "text" containing their position */
+ sprintf(buf, "%d,%d", k, l);
+ sobj = edje_object_part_table_child_get(obj, "table", k, l);
+ fail_if(!sobj);
+ txt = edje_object_part_text_get(sobj, "text");
+ fail_if(!txt);
+ fail_if(strcmp(txt, buf) != 0);
+ }
+
+ /* Add more items */
+ for (l = 0; l < 2; l++)
+ for (k = 0; k < 2; k++)
+ {
+ i = l*2 + k;
+ sobjs[i] = evas_object_rectangle_add(evas);
+ fail_if(!sobjs[i]);
+ edje_object_part_table_pack(obj, "table", sobjs[i], k, l + 2, 1, 1);
+ }
+
+ for (l = 0; l < 2; l++)
+ for (k = 0; k < 2; k++)
+ {
+ i = l*2 + k;
+ sobj = edje_object_part_table_child_get(obj, "table", k, l + 2);
+ fail_if(sobj != sobjs[i]);
+ }
+
+ /* table size and clear */
+ edje_object_part_table_col_row_size_get(obj, "table", &cols, &rows);
+ fail_if(cols != 2);
+ fail_if(rows != 4);
+
+ edje_object_part_table_clear(obj, "table", EINA_TRUE);
+
+ edje_object_part_table_col_row_size_get(obj, "table", &cols, &rows);
+ fail_if(cols != 2);
+ fail_if(rows != 2);
+
+ for (l = 0; l < 2; l++)
+ for (k = 0; k < 2; k++)
+ {
+ const char *txt;
+ char buf[20];
+
+ /* items have a text part "text" containing their position */
+ sprintf(buf, "%d,%d", k, l);
+ sobj = edje_object_part_table_child_get(obj, "table", k, l);
+ fail_if(!sobj);
+ txt = edje_object_part_text_get(sobj, "text");
+ fail_if(!txt);
+ fail_if(strcmp(txt, buf) != 0);
+ }
+
+ evas_free(evas);
+}
+EFL_END_TEST
+
+EFL_START_TEST(edje_test_table_eoapi)
+{
+ Evas *evas;
+ Evas_Object *obj, *sobj, *sobjs[4], *proxy;
+ Eina_Iterator *it;
+ int i, k, l, cs, rs, cols, rows;
+
+ evas = _setup_evas();
+
+ obj = edje_object_add(evas);
+ fail_unless(edje_object_file_set(obj, test_layout_get("test_table.edj"), "test_group"));
+
+ /* check items from EDC */
+ fail_if(efl_content_count(efl_part(obj, "table")) != 4);
+ for (l = 0; l < 2; l++)
+ for (k = 0; k < 2; k++)
+ {
+ const char *txt;
+ char buf[20];
+
+ /* items have a text part "text" containing their position */
+ sprintf(buf, "%d,%d", k, l);
+ sobj = efl_pack_table_content_get(efl_part(obj, "table"), k, l);
+ fail_if(!sobj);
+ //txt = efl_part_text_get(sobj, "text");
+ txt = edje_object_part_text_get(sobj, "text");
+ fail_if(!txt);
+ fail_if(strcmp(txt, buf) != 0);
+ }
+
+ /* Add more items */
+ for (l = 0; l < 2; l++)
+ for (k = 0; k < 2; k++)
+ {
+ i = l*2 + k;
+ sobjs[i] = efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas);
+ fail_if(!sobjs[i]);
+ efl_pack_table(efl_part(obj, "table"), sobjs[i], k, l + 2, 1, 1);
+ }
+
+ fail_if(efl_content_count(efl_part(obj, "table")) != 8);
+
+ i = 0;
+ it = efl_content_iterate(efl_part(obj, "table"));
+ EINA_ITERATOR_FOREACH(it, sobj)
+ {
+ efl_pack_table_position_get(efl_part(obj, "table"), sobj, &k, &l, &cs, &rs);
+ fail_if(cs != 1);
+ fail_if(rs != 1);
+ if (l >= 2)
+ fail_if(sobj != sobjs[(l - 2)*2 + k]);
+ i++;
+ }
+ eina_iterator_free(it);
+ fail_if(i != 8);
+
+ /* table size and clear */
+ efl_pack_table_size_get(efl_part(obj, "table"), &cols, &rows);
+ fail_if(cols != 2);
+ fail_if(rows != 4);
+
+ efl_pack_clear(efl_part(obj, "table"));
+ fail_if(efl_content_count(efl_part(obj, "table")) != 4);
+
+ efl_pack_table_size_get(efl_part(obj, "table"), &cols, &rows);
+ fail_if(cols != 2);
+ fail_if(rows != 2);
+
+ /* test multiple ops on a proxy object */
+ proxy = efl_ref(efl_part(obj, "table"));
+ fail_if(!proxy);
+ fail_if(!efl_pack_clear(proxy));
+ fail_if(efl_content_count(efl_part(obj, "table")) != 4);
+ fail_if(!efl_pack_clear(proxy));
+ fail_if(efl_content_count(efl_part(obj, "table2")) != 1);
+ fail_if(efl_content_count(proxy) != 4);
+ efl_del(proxy);
+
+ evas_free(evas);
+}
+EFL_END_TEST
+
+
+void edje_test_container(TCase *tc)
+{
+ tcase_add_test(tc, edje_test_box);
+ tcase_add_test(tc, edje_test_box_eoapi);
+ tcase_add_test(tc, edje_test_table);
+ tcase_add_test(tc, edje_test_table_eoapi);
+}
diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c
index 6432062917..15e42f1243 100644
--- a/src/tests/edje/edje_test_edje.c
+++ b/src/tests/edje/edje_test_edje.c
@@ -8,29 +8,18 @@
#define EFL_GFX_FILTER_BETA
#define EFL_CANVAS_LAYOUT_BETA
-#include <Eina.h>
-#include <Edje.h>
-
#include "edje_suite.h"
-#include "edje_tests_helpers.h"
#define EVAS_DATA_DIR TESTS_SRC_DIR "/../../lib/evas"
-START_TEST(edje_test_edje_init)
+EFL_START_TEST(edje_test_edje_init)
{
- int ret;
-
- ret = edje_init();
- fail_if(ret != 1);
-
- ret = edje_shutdown();
- fail_if(ret != 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(edje_test_edje_load)
+EFL_START_TEST(edje_test_edje_load)
{
- Evas *evas = EDJE_TEST_INIT_EVAS();
+ Evas *evas = _setup_evas();
Edje_Load_Error error;
Evas_Object *obj;
@@ -39,23 +28,13 @@ START_TEST(edje_test_edje_load)
error = edje_object_load_error_get(obj);
fail_if(error != EDJE_LOAD_ERROR_DOES_NOT_EXIST);
- EDJE_TEST_FREE_EVAS();
+ evas_free(evas);
}
-END_TEST
+EFL_END_TEST
-static const char *
-test_layout_get(const char *name)
+EFL_START_TEST(edje_test_load_simple_layout)
{
- static char filename[PATH_MAX];
-
- snprintf(filename, PATH_MAX, TESTS_BUILD_DIR"/data/%s", name);
-
- return filename;
-}
-
-START_TEST(edje_test_load_simple_layout)
-{
- Evas *evas = EDJE_TEST_INIT_EVAS();
+ Evas *evas = _setup_evas();
Evas_Object *obj;
obj = edje_object_add(evas);
@@ -65,15 +44,15 @@ START_TEST(edje_test_load_simple_layout)
fail_unless(edje_object_part_exists(obj, "background"));
- EDJE_TEST_FREE_EVAS();
+ evas_free(evas);
}
-END_TEST
+EFL_END_TEST
-START_TEST(edje_test_simple_layout_geometry)
+EFL_START_TEST(edje_test_simple_layout_geometry)
{
int x, y, w, h;
int r, g, b, a;
- Evas *evas = EDJE_TEST_INIT_EVAS();
+ Evas *evas = _setup_evas();
Evas_Object *obj;
const Evas_Object *bg;
@@ -94,14 +73,14 @@ START_TEST(edje_test_simple_layout_geometry)
evas_object_color_get(bg, &r, &g, &b, &a);
fail_if(r != 255 || g != 255 || b != 255 || a != 255);
- EDJE_TEST_FREE_EVAS();
+ evas_free(evas);
}
-END_TEST
+EFL_END_TEST
-START_TEST(edje_test_complex_layout)
+EFL_START_TEST(edje_test_complex_layout)
{
int x, y, w, h;
- Evas *evas = EDJE_TEST_INIT_EVAS();
+ Evas *evas = _setup_evas();
Evas_Object *obj;
obj = edje_object_add(evas);
@@ -142,14 +121,14 @@ START_TEST(edje_test_complex_layout)
fail_if(x != 5 || y != 500+2);
fail_if(w != 1000-5-5 + 1 || h != 500-5-2 + 1);
- EDJE_TEST_FREE_EVAS();
+ evas_free(evas);
}
-END_TEST
+EFL_END_TEST
-START_TEST(edje_test_calculate_parens)
+EFL_START_TEST(edje_test_calculate_parens)
{
int x, y, w, h;
- Evas *evas = EDJE_TEST_INIT_EVAS();
+ Evas *evas = _setup_evas();
Evas_Object *obj;
Eina_Rect rect;
@@ -165,263 +144,13 @@ START_TEST(edje_test_calculate_parens)
edje_object_part_geometry_get(obj, "background", &x, &y, &w, &h);
fail_if(x != 0 || y != 0 || w != 100 || h != 100);
- EDJE_TEST_FREE_EVAS();
-}
-END_TEST
-
-START_TEST(edje_test_masking)
-{
- int x, y, w, h;
- Evas *evas = EDJE_TEST_INIT_EVAS();
- const Evas_Object *sub, *clip2, *clip;
- Evas_Object *obj;
-
- obj = edje_object_add(evas);
- fail_unless(edje_object_file_set(obj, test_layout_get("test_masking.edj"), "test_group"));
-
- evas_object_resize(obj, 100, 100);
- edje_object_part_geometry_get(obj, "background", &x, &y, &w, &h);
- fail_if(x != 0 || y != 0 || w != 100 || h != 100);
-
- clip = edje_object_part_object_get(obj, "clip2");
- fail_if(!clip);
-
- /* check value of no_render flag as seen from evas land */
- sub = edje_object_part_object_get(obj, "mask");
- fail_if(!efl_canvas_object_no_render_get(sub));
-
- /* check that text has a clip (based on description.clip_to) */
- sub = edje_object_part_object_get(obj, "text");
- fail_if(!efl_canvas_object_clip_get(sub));
-
- /* test description.clip_to override */
- sub = edje_object_part_object_get(obj, "noclip");
- clip2 = efl_canvas_object_clip_get(sub);
- fail_if(clip != clip2);
-
- EDJE_TEST_FREE_EVAS();
-}
-END_TEST
-
-START_TEST(edje_test_filters)
-{
- Evas *evas = EDJE_TEST_INIT_EVAS();
- const Evas_Object *text, *sub;
- Evas_Object *obj, *src = NULL;
- const char *prg, *name;
-
- setenv("EVAS_DATA_DIR", EVAS_DATA_DIR, 1);
-
- obj = edje_object_add(evas);
- fail_unless(edje_object_file_set(obj, test_layout_get("test_filters.edj"), "test_group"));
-
- evas_object_resize(obj, 200, 200);
-
- /* check value of no_render flag as seen from evas land */
- sub = edje_object_part_object_get(obj, "mask");
- fail_if(!efl_canvas_object_no_render_get(sub));
-
- /* check no_render inheritance */
- sub = edje_object_part_object_get(obj, "mask2");
- fail_if(efl_canvas_object_no_render_get(sub));
- sub = edje_object_part_object_get(obj, "mask3");
- fail_if(!efl_canvas_object_no_render_get(sub));
-
- /* text part: check filter status */
- text = edje_object_part_object_get(obj, "text");
- fail_if(!text);
-
- efl_gfx_filter_program_get(text, &prg, &name);
- fail_if(!prg);
- fail_if(!name || strcmp(name, "filterfile"));
-
- src = efl_gfx_filter_source_get(text, "mask");
- fail_if(!src);
-
- // TODO: Verify properly that the filter runs well
-
- EDJE_TEST_FREE_EVAS();
-}
-END_TEST
-
-START_TEST(edje_test_snapshot)
-{
- Evas *evas = EDJE_TEST_INIT_EVAS();
- const Evas_Object *sub;
- Evas_Object *obj;
-
- setenv("EVAS_DATA_DIR", EVAS_DATA_DIR, 1);
-
- obj = edje_object_add(evas);
- fail_unless(edje_object_file_set(obj, test_layout_get("test_snapshot.edj"), "test_group"));
-
- evas_object_resize(obj, 200, 200);
-
- /* check value of no_render flag as seen from evas land */
- sub = edje_object_part_object_get(obj, "snap");
- fail_if(!efl_isa(sub, EFL_CANVAS_SNAPSHOT_CLASS) &&
- !evas_object_image_snapshot_get(sub));
-
- // TODO: Verify that evas snapshot actually works (and has a filter)
-
- EDJE_TEST_FREE_EVAS();
-}
-END_TEST
-
-START_TEST(edje_test_size_class)
-{
- int minw, minh, minw2, minh2;
- Evas *evas = EDJE_TEST_INIT_EVAS();
- Eina_List *l;
- Eina_Stringshare *name;
- Evas_Object *obj, *obj2;
- Eina_Bool b;
-
- obj = edje_object_add(evas);
- fail_unless(edje_object_file_set(obj, test_layout_get("test_size_class.edj"), "test_group"));
-
- obj2 = edje_object_add(evas);
- fail_unless(edje_object_file_set(obj2, test_layout_get("test_size_class.edj"), "test_group"));
-
- evas_object_resize(obj, 200, 200);
- evas_object_resize(obj2, 200, 200);
-
- /* check predefined min size of rect part by edc */
- edje_object_part_geometry_get(obj, "rect", NULL, NULL, &minw, &minh);
- fail_if(minw != 50 || minh != 50);
-
- /* check that edje_size_class_set works */
- b = edje_size_class_set("rect_size", 100, 100, -1, -1);
- edje_object_part_geometry_get(obj, "rect", NULL, NULL, &minw, &minh);
- edje_object_part_geometry_get(obj2, "rect", NULL, NULL, &minw2, &minh2);
- fail_if(!b || minw != 100 || minh != 100 || minw2 != 100 || minh2 != 100);
-
- /* check that edje_size_class_get works */
- b = edje_size_class_get("rect_size", &minw, &minh, NULL, NULL);
- fail_if(!b || minw != 100 || minh != 100);
-
- /* check that edje_size_class_list works */
- l = edje_size_class_list();
- EINA_LIST_FREE(l, name)
- {
- fail_if(strcmp(name, "rect_size"));
- eina_stringshare_del(name);
- }
-
- /* check that edje_object_size_class_set works */
- b = edje_object_size_class_set(obj, "rect_size", 150, 150, -1, -1);
- edje_object_part_geometry_get(obj, "rect", NULL, NULL, &minw, &minh);
- edje_object_part_geometry_get(obj2, "rect", NULL, NULL, &minw2, &minh2);
- fail_if(!b || minw != 150 || minh != 150 || minw2 != 100 || minh2 != 100);
-
- /* check that edje_object_size_class_get works */
- b = edje_object_size_class_get(obj, "rect_size", &minw, &minh, NULL, NULL);
- fail_if(!b || minw != 150 || minh != 150);
-
- EDJE_TEST_FREE_EVAS();
+ evas_free(evas);
}
-END_TEST
+EFL_END_TEST
-START_TEST(edje_test_color_class)
+EFL_START_TEST(edje_test_access)
{
- Evas *evas = EDJE_TEST_INIT_EVAS();
-
- Eina_File *f;
- Eina_Iterator *it;
- Edje_Color_Class *itcc, *cc = NULL;
- char *filename;
-
- filename = realpath(test_layout_get("test_color_class.edj"), NULL);
- fail_if(!filename);
-
- f = eina_file_open(filename, EINA_FALSE);
- fail_if(!f);
-
- it = edje_mmap_color_class_iterator_new(f);
- fail_if(!it);
- EINA_ITERATOR_FOREACH(it, itcc)
- {
- if (!strcmp(itcc->name, "test_color_class"))
- {
- cc = itcc;
- break;
- }
- }
- fail_if((!cc) || (cc->r != 100) || (cc->g != 100) || (cc->b != 100) || (cc->a != 100));
-
- eina_iterator_free(it);
- eina_file_close(f);
- free(filename);
-
- EDJE_TEST_FREE_EVAS();
-}
-END_TEST
-
-START_TEST(edje_test_swallows)
-{
- Evas *evas = EDJE_TEST_INIT_EVAS();
- Evas_Object *ly, *o1, *o2;
-
- ly = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas);
- fail_unless(edje_object_file_set(ly, test_layout_get("test_swallows.edj"), "test_group"));
-
- fail_unless(edje_object_part_exists(ly, "swallow"));
-
-
- o1 = efl_add(EFL_CANVAS_LAYOUT_CLASS, ly);
- fail_if(!edje_object_part_swallow(ly, "swallow", o1));
- ck_assert_ptr_eq(efl_parent_get(o1), ly);
-
- edje_object_part_unswallow(ly, o1);
- ck_assert_ptr_eq(efl_parent_get(o1), evas_object_evas_get(o1));
-
- fail_if(!edje_object_part_swallow(ly, "swallow", o1));
- ck_assert_ptr_eq(efl_parent_get(o1), ly);
-
- o2 = efl_add(EFL_CANVAS_LAYOUT_CLASS, ly);
- fail_if(!edje_object_part_swallow(ly, "swallow", o2));
- ck_assert_ptr_eq(efl_parent_get(o2), ly);
- /* o1 is deleted at this point. */
- ck_assert_ptr_eq(efl_parent_get(o1), evas_object_evas_get(o1));
-
- EDJE_TEST_FREE_EVAS();
-}
-END_TEST
-
-START_TEST(edje_test_swallows_eoapi)
-{
- Evas *evas = EDJE_TEST_INIT_EVAS();
- Evas_Object *ly, *o1, *o2;
-
- ly = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas);
- fail_unless(edje_object_file_set(ly, test_layout_get("test_swallows.edj"), "test_group"));
-
- fail_unless(edje_object_part_exists(ly, "swallow"));
-
-
- o1 = efl_add(EFL_CANVAS_LAYOUT_CLASS, ly);
- fail_if(!efl_content_set(efl_part(ly, "swallow"), o1));
- ck_assert_ptr_eq(efl_parent_get(o1), ly);
-
- efl_content_remove(ly, o1);
- ck_assert_ptr_eq(efl_parent_get(o1), evas_object_evas_get(o1));
-
- fail_if(!efl_content_set(efl_part(ly, "swallow"), o1));
- ck_assert_ptr_eq(efl_parent_get(o1), ly);
-
- o2 = efl_add(EFL_CANVAS_LAYOUT_CLASS, ly);
- fail_if(!efl_content_set(efl_part(ly, "swallow"), o2));
- ck_assert_ptr_eq(efl_parent_get(o2), ly);
- /* o1 is deleted at this point. */
- ck_assert_ptr_eq(efl_parent_get(o1), evas_object_evas_get(o1));
-
- EDJE_TEST_FREE_EVAS();
-}
-END_TEST
-
-START_TEST(edje_test_access)
-{
- Evas *evas = EDJE_TEST_INIT_EVAS();
+ Evas *evas = _setup_evas();
const char *name;
Evas_Object *obj;
Eina_Iterator *it;
@@ -458,497 +187,52 @@ START_TEST(edje_test_access)
}
fail_if(i != 2);
- EDJE_TEST_FREE_EVAS();
+ evas_free(evas);
}
-END_TEST
+EFL_END_TEST
-START_TEST(edje_test_box)
-{
- Evas *evas;
- Evas_Object *obj, *sobj, *sobjs[5];
- const Evas_Object *box;
- Eina_Iterator *it;
- int i;
-
- evas = EDJE_TEST_INIT_EVAS();
-
- obj = edje_object_add(evas);
- fail_unless(edje_object_file_set(obj, test_layout_get("test_box.edj"), "test_group"));
-
- for (i = 0; i < 5; i++)
- {
- sobjs[i] = evas_object_rectangle_add(evas);
- fail_if(!sobjs[i]);
- }
-
- edje_object_part_box_append(obj, "box", sobjs[3]);
- edje_object_part_box_prepend(obj, "box", sobjs[1]);
- edje_object_part_box_insert_before(obj, "box", sobjs[0], sobjs[1]);
- edje_object_part_box_insert_after(obj, "box", sobjs[4], sobjs[3]);
- edje_object_part_box_insert_at(obj, "box", sobjs[2], 2);
-
- box = edje_object_part_object_get(obj, "box");
- it = evas_object_box_iterator_new(box);
-
- i = 0;
- EINA_ITERATOR_FOREACH(it, sobj)
- {
- fail_if(sobj != sobjs[i++]);
- }
- eina_iterator_free(it);
-
- EDJE_TEST_FREE_EVAS();
-}
-END_TEST
-
-START_TEST(edje_test_box_eoapi)
-{
- Evas *evas;
- Evas_Object *obj, *sobj, *sobjs[5];
- Eina_Iterator *it;
- int i;
-
- evas = EDJE_TEST_INIT_EVAS();
-
- obj = edje_object_add(evas);
- fail_unless(edje_object_file_set(obj, test_layout_get("test_box.edj"), "test_group"));
-
- for (i = 0; i < 5; i++)
- {
- sobjs[i] = evas_object_rectangle_add(evas);
- fail_if(!sobjs[i]);
- }
-
- /* same test case as legacy api above */
- efl_pack_end(efl_part(obj, "box"), sobjs[3]);
- efl_pack_begin(efl_part(obj, "box"), sobjs[1]);
- efl_pack_before(efl_part(obj, "box"), sobjs[0], sobjs[1]);
- efl_pack_after(efl_part(obj, "box"), sobjs[4], sobjs[3]);
- efl_pack_at(efl_part(obj, "box"), sobjs[2], 2);
- fail_if(efl_content_count(efl_part(obj, "box")) != 5);
-
- it = efl_content_iterate(efl_part(obj, "box"));
- i = 0;
- EINA_ITERATOR_FOREACH(it, sobj)
- fail_if(sobj != sobjs[i++]);
- fail_if(i != 5);
- eina_iterator_free(it);
-
- /* clear up and test a bit more */
- efl_pack_unpack_all(efl_part(obj, "box"));
- fail_if(efl_content_count(efl_part(obj, "box")) != 0);
-
- efl_pack(efl_part(obj, "box"), sobjs[1]);
- efl_pack_at(efl_part(obj, "box"), sobjs[0], 0);
- efl_pack_at(efl_part(obj, "box"), sobjs[2], -1);
- it = efl_content_iterate(efl_part(obj, "box"));
- i = 0;
- EINA_ITERATOR_FOREACH(it, sobj)
- fail_if(sobj != sobjs[i++]);
- fail_if(i != 3);
- eina_iterator_free(it);
-
- fail_if(!efl_content_remove(efl_part(obj, "box"), sobjs[0]));
- fail_if(efl_content_count(efl_part(obj, "box")) != 2);
- fail_if(!efl_pack_unpack_at(efl_part(obj, "box"), 1));
- fail_if(efl_content_count(efl_part(obj, "box")) != 1);
- fail_if(efl_pack_index_get(efl_part(obj, "box"), sobjs[1]) != 0);
-
- efl_pack_clear(efl_part(obj, "box"));
- fail_if(efl_content_count(efl_part(obj, "box")) != 0);
-
- EDJE_TEST_FREE_EVAS();
-}
-END_TEST
-
-START_TEST(edje_test_table)
-{
- Evas *evas;
- Evas_Object *obj, *sobj, *sobjs[4];
- int i, k, l, cols, rows;
-
- evas = EDJE_TEST_INIT_EVAS();
-
- obj = edje_object_add(evas);
- fail_unless(edje_object_file_set(obj, test_layout_get("test_table.edj"), "test_group"));
-
- /* check items from EDC */
- for (l = 0; l < 2; l++)
- for (k = 0; k < 2; k++)
- {
- const char *txt;
- char buf[20];
-
- /* items have a text part "text" containing their position */
- sprintf(buf, "%d,%d", k, l);
- sobj = edje_object_part_table_child_get(obj, "table", k, l);
- fail_if(!sobj);
- txt = edje_object_part_text_get(sobj, "text");
- fail_if(!txt);
- fail_if(strcmp(txt, buf) != 0);
- }
-
- /* Add more items */
- for (l = 0; l < 2; l++)
- for (k = 0; k < 2; k++)
- {
- i = l*2 + k;
- sobjs[i] = evas_object_rectangle_add(evas);
- fail_if(!sobjs[i]);
- edje_object_part_table_pack(obj, "table", sobjs[i], k, l + 2, 1, 1);
- }
-
- for (l = 0; l < 2; l++)
- for (k = 0; k < 2; k++)
- {
- i = l*2 + k;
- sobj = edje_object_part_table_child_get(obj, "table", k, l + 2);
- fail_if(sobj != sobjs[i]);
- }
-
- /* table size and clear */
- edje_object_part_table_col_row_size_get(obj, "table", &cols, &rows);
- fail_if(cols != 2);
- fail_if(rows != 4);
-
- edje_object_part_table_clear(obj, "table", EINA_TRUE);
-
- edje_object_part_table_col_row_size_get(obj, "table", &cols, &rows);
- fail_if(cols != 2);
- fail_if(rows != 2);
-
- for (l = 0; l < 2; l++)
- for (k = 0; k < 2; k++)
- {
- const char *txt;
- char buf[20];
-
- /* items have a text part "text" containing their position */
- sprintf(buf, "%d,%d", k, l);
- sobj = edje_object_part_table_child_get(obj, "table", k, l);
- fail_if(!sobj);
- txt = edje_object_part_text_get(sobj, "text");
- fail_if(!txt);
- fail_if(strcmp(txt, buf) != 0);
- }
-
- EDJE_TEST_FREE_EVAS();
-}
-END_TEST
-
-START_TEST(edje_test_table_eoapi)
-{
- Evas *evas;
- Evas_Object *obj, *sobj, *sobjs[4], *proxy;
- Eina_Iterator *it;
- int i, k, l, cs, rs, cols, rows;
-
- evas = EDJE_TEST_INIT_EVAS();
-
- obj = edje_object_add(evas);
- fail_unless(edje_object_file_set(obj, test_layout_get("test_table.edj"), "test_group"));
-
- /* check items from EDC */
- fail_if(efl_content_count(efl_part(obj, "table")) != 4);
- for (l = 0; l < 2; l++)
- for (k = 0; k < 2; k++)
- {
- const char *txt;
- char buf[20];
-
- /* items have a text part "text" containing their position */
- sprintf(buf, "%d,%d", k, l);
- sobj = efl_pack_table_content_get(efl_part(obj, "table"), k, l);
- fail_if(!sobj);
- //txt = efl_part_text_get(sobj, "text");
- txt = edje_object_part_text_get(sobj, "text");
- fail_if(!txt);
- fail_if(strcmp(txt, buf) != 0);
- }
-
- /* Add more items */
- for (l = 0; l < 2; l++)
- for (k = 0; k < 2; k++)
- {
- i = l*2 + k;
- sobjs[i] = efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas);
- fail_if(!sobjs[i]);
- efl_pack_table(efl_part(obj, "table"), sobjs[i], k, l + 2, 1, 1);
- }
-
- fail_if(efl_content_count(efl_part(obj, "table")) != 8);
-
- i = 0;
- it = efl_content_iterate(efl_part(obj, "table"));
- EINA_ITERATOR_FOREACH(it, sobj)
- {
- efl_pack_table_position_get(efl_part(obj, "table"), sobj, &k, &l, &cs, &rs);
- fail_if(cs != 1);
- fail_if(rs != 1);
- if (l >= 2)
- fail_if(sobj != sobjs[(l - 2)*2 + k]);
- i++;
- }
- eina_iterator_free(it);
- fail_if(i != 8);
-
- /* table size and clear */
- efl_pack_table_size_get(efl_part(obj, "table"), &cols, &rows);
- fail_if(cols != 2);
- fail_if(rows != 4);
-
- efl_pack_clear(efl_part(obj, "table"));
- fail_if(efl_content_count(efl_part(obj, "table")) != 4);
-
- efl_pack_table_size_get(efl_part(obj, "table"), &cols, &rows);
- fail_if(cols != 2);
- fail_if(rows != 2);
-
- /* test multiple ops on a proxy object */
- proxy = efl_ref(efl_part(obj, "table"));
- fail_if(!proxy);
- fail_if(!efl_pack_clear(proxy));
- fail_if(efl_content_count(efl_part(obj, "table")) != 4);
- fail_if(!efl_pack_clear(proxy));
- fail_if(efl_content_count(efl_part(obj, "table2")) != 1);
- fail_if(efl_content_count(proxy) != 4);
- efl_del(proxy);
-
- EDJE_TEST_FREE_EVAS();
-}
-END_TEST
-
-START_TEST(edje_test_combine_keywords)
+EFL_START_TEST(edje_test_combine_keywords)
{
Evas *evas;
Evas_Object *obj;
- evas = EDJE_TEST_INIT_EVAS();
+ evas = _setup_evas();
obj = edje_object_add(evas);
fail_unless(edje_object_file_set(obj, test_layout_get("test_combine_keywords.edj"), "test_group"));
- EDJE_TEST_FREE_EVAS();
-}
-END_TEST
-
-static void
-_message_signal_reply_cb(void *data, Evas_Object *obj EINA_UNUSED,
- const char *emission, const char *source)
-{
- int *id = data;
-
- fprintf(stderr, "source %s emit %s id %d\n", source, emission, *id);
- fflush(stderr);
- ck_assert_str_eq(source, "edc");
- ck_assert_ptr_ne(emission, NULL);
-
- if (!strncmp(emission, "int set", 7))
- ck_assert_str_eq(emission, "int set 7 12 42 255");
- else if (!strncmp(emission, "int", 3))
- ck_assert_str_eq(emission, "int 42");
- else if (!strncmp(emission, "float", 5))
- {
- char buf[64];
- sprintf(buf, "float %f", 0.12);
- ck_assert_str_eq(emission, buf);
- }
- else if (!strncmp(emission, "str", 3))
- ck_assert_str_eq(emission, "str hello world");
- else ck_abort_msg("Invalid emission!");
-
- (*id)++;
-}
-
-START_TEST(edje_test_message_send_legacy)
-{
- Evas *evas;
- Evas_Object *obj;
- Edje_Message_Int msgi;
- Edje_Message_Float msgf;
- Edje_Message_String msgs;
- Edje_Message_Int_Set *msgis;
- int id = 0;
-
- /* Ugly calls to process:
- *
- * 1. Send edje message (async)
- * 2. Process edje message (sync)
- * 3. EDC program emits edje signal (async)
- * 4. Process edje signal (sync)
- * 5. Finally reached signal cb
- */
-
- evas = EDJE_TEST_INIT_EVAS();
-
- obj = edje_object_add(evas);
- fail_unless(edje_object_file_set(obj, test_layout_get("test_messages.edj"), "test_group"));
- edje_object_signal_callback_add(obj, "*", "edc", _message_signal_reply_cb, &id);
-
- msgs.str = "hello world";
- edje_object_message_send(obj, EDJE_MESSAGE_STRING, 0, &msgs);
- edje_message_signal_process();
- ck_assert_int_eq(id, 1);
-
- msgi.val = 42;
- edje_object_message_send(obj, EDJE_MESSAGE_INT, 1, &msgi);
- edje_message_signal_process();
- ck_assert_int_eq(id, 2);
-
- msgf.val = 0.12;
- edje_object_message_send(obj, EDJE_MESSAGE_FLOAT, 2, &msgf);
- edje_message_signal_process();
- ck_assert_int_eq(id, 3);
-
- msgis = alloca(sizeof(*msgis) + 4 * sizeof(msgis->val));
- msgis->count = 4;
- msgis->val[0] = 7;
- msgis->val[1] = 12;
- msgis->val[2] = 42;
- msgis->val[3] = 255;
- edje_object_message_send(obj, EDJE_MESSAGE_INT_SET, 3, msgis);
- edje_message_signal_process();
- ck_assert_int_eq(id, 4);
-
- evas_object_del(obj);
-
- EDJE_TEST_FREE_EVAS();
-}
-END_TEST
-
-START_TEST(edje_test_message_send_eo)
-{
- Evas *evas;
- Evas_Object *obj;
- Eina_Value v, *va;
- int id = 0;
-
- evas = EDJE_TEST_INIT_EVAS();
-
- obj = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas,
- efl_file_set(efl_added, test_layout_get("test_messages.edj"), "test_group"));
-
- // FIXME: EO API HERE
- edje_object_signal_callback_add(obj, "*", "edc", _message_signal_reply_cb, &id);
-
- // NOTE: edje_object_message_signal_process may or may not be in EO (TBD)
-
- eina_value_setup(&v, EINA_VALUE_TYPE_STRING);
- eina_value_set(&v, "hello world");
- efl_layout_signal_message_send(obj, 0, v);
- eina_value_flush(&v);
- edje_message_signal_process();
- edje_object_calc_force(obj);
- ck_assert_int_eq(id, 1);
-
- eina_value_setup(&v, EINA_VALUE_TYPE_INT);
- eina_value_set(&v, 42);
- efl_layout_signal_message_send(obj, 1, v);
- eina_value_flush(&v);
- edje_message_signal_process();
- edje_object_calc_force(obj);
- ck_assert_int_eq(id, 2);
-
- eina_value_setup(&v, EINA_VALUE_TYPE_FLOAT);
- eina_value_set(&v, 0.12);
- efl_layout_signal_message_send(obj, 2, v);
- eina_value_flush(&v);
- edje_message_signal_process();
- edje_object_calc_force(obj);
- ck_assert_int_eq(id, 3);
-
- va = eina_value_array_new(EINA_VALUE_TYPE_INT, 4);
- eina_value_array_append(va, 7);
- eina_value_array_append(va, 12);
- eina_value_array_append(va, 42);
- eina_value_array_append(va, 255);
- efl_layout_signal_message_send(obj, 3, *va);
- eina_value_free(va);
- edje_message_signal_process();
- edje_object_calc_force(obj);
- ck_assert_int_eq(id, 4);
-
- efl_del(obj);
-
- EDJE_TEST_FREE_EVAS();
+ evas_free(evas);
}
-END_TEST
+EFL_END_TEST
-START_TEST(edje_test_signals)
+EFL_START_TEST(edje_test_part_caching)
{
- Evas *evas;
- Evas_Object *obj;
- const char *state;
-
- evas = EDJE_TEST_INIT_EVAS();
-
- obj = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas,
- efl_file_set(efl_added, test_layout_get("test_signals.edj"), "level1"),
- efl_gfx_size_set(efl_added, EINA_SIZE2D(320, 240)),
- efl_gfx_visible_set(efl_added, 1));
+ Evas *evas = _setup_evas();
+ Evas_Object *ly, *o1, *global_p = NULL;
- edje_object_signal_emit(obj, "mouse,in", "text");
-
- edje_object_message_signal_process(obj);
- state = edje_object_part_state_get(obj, "group:group:text", NULL);
- ck_assert_str_eq(state, "default");
-
- edje_object_message_signal_process(obj);
- state = edje_object_part_state_get(obj, "group:group:text", NULL);
- ck_assert_str_eq(state, "default");
-
- edje_object_message_signal_recursive_process(obj);
- state = edje_object_part_state_get(obj, "group:group:text", NULL);
- ck_assert_str_eq(state, "over");
-
- efl_del(obj);
-
- EDJE_TEST_FREE_EVAS();
-}
-END_TEST
+ ly = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas,
+ efl_file_set(efl_added, test_layout_get("test_swallows.edj"), "test_group")
+ );
-static int _signal_count;
-
-static void
-_signal_callback_count_cb(void *data, Evas_Object *obj EINA_UNUSED,
- const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
-{
- int *_data = data;
- _signal_count += *_data;
-}
-
-START_TEST(edje_test_signal_callback_del_full)
-{
- Evas *evas;
- Evas_Object *obj;
- int data[4] = { 1, 2, 4, 8 };
-
- evas = EDJE_TEST_INIT_EVAS();
-
- obj = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas,
- efl_file_set(efl_added,
- test_layout_get("test_signal_callback_del_full.edj"), "test"),
- efl_gfx_size_set(efl_added, EINA_SIZE2D(320, 240)),
- efl_gfx_visible_set(efl_added, 1));
-
- edje_object_signal_callback_add(obj, "some_signal", "event", _signal_callback_count_cb, &data[0]);
- edje_object_signal_callback_add(obj, "some_signal", "event", _signal_callback_count_cb, &data[1]);
- edje_object_signal_callback_add(obj, "some_signal", "event", _signal_callback_count_cb, &data[2]);
- edje_object_signal_callback_add(obj, "some_signal", "event", _signal_callback_count_cb, &data[3]);
+ for (int i = 0; i < 10; ++i)
+ {
+ Evas_Object *p;
- edje_object_signal_callback_del_full(obj, "some_signal", "event", _signal_callback_count_cb, &data[0]);
- edje_object_signal_callback_del_full(obj, "some_signal", "event", _signal_callback_count_cb, &data[3]);
+ p = efl_part(ly, "swallow");
+ o1 = efl_content_get(p);
- edje_object_signal_emit(obj, "some_signal", "event");
+ if (global_p)
+ ck_assert_ptr_eq(global_p, p);
+ global_p = p;
- edje_object_message_signal_process(obj);
- ck_assert_int_eq(_signal_count, (data[1] + data[2]));
+ ck_assert_int_eq(efl_ref_count(p), 1);
+ ck_assert_ptr_eq(efl_parent_get(p), NULL);
- efl_del(obj);
+ }
- EDJE_TEST_FREE_EVAS();
+ evas_free(evas);
}
-END_TEST
+EFL_END_TEST
void edje_test_edje(TCase *tc)
{
@@ -958,21 +242,7 @@ void edje_test_edje(TCase *tc)
tcase_add_test(tc, edje_test_simple_layout_geometry);
tcase_add_test(tc, edje_test_complex_layout);
tcase_add_test(tc, edje_test_calculate_parens);
- tcase_add_test(tc, edje_test_masking);
- tcase_add_test(tc, edje_test_filters);
- tcase_add_test(tc, edje_test_snapshot);
- tcase_add_test(tc, edje_test_size_class);
- tcase_add_test(tc, edje_test_color_class);
- tcase_add_test(tc, edje_test_swallows);
- tcase_add_test(tc, edje_test_swallows_eoapi);
tcase_add_test(tc, edje_test_access);
- tcase_add_test(tc, edje_test_box);
- tcase_add_test(tc, edje_test_box_eoapi);
- tcase_add_test(tc, edje_test_table);
- tcase_add_test(tc, edje_test_table_eoapi);
tcase_add_test(tc, edje_test_combine_keywords);
- tcase_add_test(tc, edje_test_message_send_legacy);
- tcase_add_test(tc, edje_test_message_send_eo);
- tcase_add_test(tc, edje_test_signals);
- tcase_add_test(tc, edje_test_signal_callback_del_full);
+ tcase_add_test(tc, edje_test_part_caching);
}
diff --git a/src/tests/edje/edje_test_features.c b/src/tests/edje/edje_test_features.c
new file mode 100644
index 0000000000..1cff283835
--- /dev/null
+++ b/src/tests/edje/edje_test_features.c
@@ -0,0 +1,229 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <unistd.h>
+#include <stdio.h>
+
+#define EFL_GFX_FILTER_BETA
+#define EFL_CANVAS_LAYOUT_BETA
+
+#include "edje_suite.h"
+
+#define EVAS_DATA_DIR TESTS_SRC_DIR "/../../lib/evas"
+
+
+EFL_START_TEST(edje_test_masking)
+{
+ int x, y, w, h;
+ Evas *evas = _setup_evas();
+ const Evas_Object *sub, *clip2, *clip;
+ Evas_Object *obj;
+
+ obj = edje_object_add(evas);
+ fail_unless(edje_object_file_set(obj, test_layout_get("test_masking.edj"), "test_group"));
+
+ evas_object_resize(obj, 100, 100);
+ edje_object_part_geometry_get(obj, "background", &x, &y, &w, &h);
+ fail_if(x != 0 || y != 0 || w != 100 || h != 100);
+
+ edje_object_freeze(obj);
+ clip = edje_object_part_object_get(obj, "clip2");
+ edje_object_thaw(obj);
+ fail_if(!clip);
+
+ /* check value of no_render flag as seen from evas land */
+ edje_object_freeze(obj);
+ sub = edje_object_part_object_get(obj, "mask");
+ edje_object_thaw(obj);
+ fail_if(!efl_canvas_object_no_render_get(sub));
+
+ /* check that text has a clip (based on description.clip_to) */
+ edje_object_freeze(obj);
+ sub = edje_object_part_object_get(obj, "text");
+ edje_object_thaw(obj);
+ fail_if(!efl_canvas_object_clip_get(sub));
+
+ /* test description.clip_to override */
+ edje_object_freeze(obj);
+ sub = edje_object_part_object_get(obj, "noclip");
+ edje_object_thaw(obj);
+ clip2 = efl_canvas_object_clip_get(sub);
+ fail_if(clip != clip2);
+
+ evas_free(evas);
+}
+EFL_END_TEST
+
+EFL_START_TEST(edje_test_filters)
+{
+ Evas *evas = _setup_evas();
+ const Evas_Object *text, *sub;
+ Evas_Object *obj, *src = NULL;
+ const char *prg, *name;
+
+ setenv("EVAS_DATA_DIR", EVAS_DATA_DIR, 1);
+
+ obj = edje_object_add(evas);
+ fail_unless(edje_object_file_set(obj, test_layout_get("test_filters.edj"), "test_group"));
+
+ evas_object_resize(obj, 200, 200);
+
+ /* check value of no_render flag as seen from evas land */
+ edje_object_freeze(obj);
+ sub = edje_object_part_object_get(obj, "mask");
+ edje_object_thaw(obj);
+ fail_if(!efl_canvas_object_no_render_get(sub));
+
+ /* check no_render inheritance */
+ edje_object_freeze(obj);
+ sub = edje_object_part_object_get(obj, "mask2");
+ edje_object_thaw(obj);
+ fail_if(efl_canvas_object_no_render_get(sub));
+ edje_object_freeze(obj);
+ sub = edje_object_part_object_get(obj, "mask3");
+ edje_object_thaw(obj);
+ fail_if(!efl_canvas_object_no_render_get(sub));
+
+ /* text part: check filter status */
+ edje_object_freeze(obj);
+ text = edje_object_part_object_get(obj, "text");
+ edje_object_thaw(obj);
+ fail_if(!text);
+
+ efl_gfx_filter_program_get(text, &prg, &name);
+ fail_if(!prg);
+ fail_if(!name || strcmp(name, "filterfile"));
+
+ src = efl_gfx_filter_source_get(text, "mask");
+ fail_if(!src);
+
+ // TODO: Verify properly that the filter runs well
+
+ evas_free(evas);
+}
+EFL_END_TEST
+
+EFL_START_TEST(edje_test_snapshot)
+{
+ Evas *evas = _setup_evas();
+ const Evas_Object *sub;
+ Evas_Object *obj;
+
+ setenv("EVAS_DATA_DIR", EVAS_DATA_DIR, 1);
+
+ obj = edje_object_add(evas);
+ fail_unless(edje_object_file_set(obj, test_layout_get("test_snapshot.edj"), "test_group"));
+
+ evas_object_resize(obj, 200, 200);
+
+ /* check value of no_render flag as seen from evas land */
+ edje_object_freeze(obj);
+ sub = edje_object_part_object_get(obj, "snap");
+ edje_object_thaw(obj);
+ fail_if(!efl_isa(sub, EFL_CANVAS_SNAPSHOT_CLASS) &&
+ !evas_object_image_snapshot_get(sub));
+
+ // TODO: Verify that evas snapshot actually works (and has a filter)
+
+ evas_free(evas);
+}
+EFL_END_TEST
+
+EFL_START_TEST(edje_test_size_class)
+{
+ int minw, minh, minw2, minh2;
+ Evas *evas = _setup_evas();
+ Eina_List *l;
+ Eina_Stringshare *name;
+ Evas_Object *obj, *obj2;
+ Eina_Bool b;
+
+ obj = edje_object_add(evas);
+ fail_unless(edje_object_file_set(obj, test_layout_get("test_size_class.edj"), "test_group"));
+
+ obj2 = edje_object_add(evas);
+ fail_unless(edje_object_file_set(obj2, test_layout_get("test_size_class.edj"), "test_group"));
+
+ evas_object_resize(obj, 200, 200);
+ evas_object_resize(obj2, 200, 200);
+
+ /* check predefined min size of rect part by edc */
+ edje_object_part_geometry_get(obj, "rect", NULL, NULL, &minw, &minh);
+ fail_if(minw != 50 || minh != 50);
+
+ /* check that edje_size_class_set works */
+ b = edje_size_class_set("rect_size", 100, 100, -1, -1);
+ edje_object_part_geometry_get(obj, "rect", NULL, NULL, &minw, &minh);
+ edje_object_part_geometry_get(obj2, "rect", NULL, NULL, &minw2, &minh2);
+ fail_if(!b || minw != 100 || minh != 100 || minw2 != 100 || minh2 != 100);
+
+ /* check that edje_size_class_get works */
+ b = edje_size_class_get("rect_size", &minw, &minh, NULL, NULL);
+ fail_if(!b || minw != 100 || minh != 100);
+
+ /* check that edje_size_class_list works */
+ l = edje_size_class_list();
+ EINA_LIST_FREE(l, name)
+ {
+ fail_if(strcmp(name, "rect_size"));
+ eina_stringshare_del(name);
+ }
+
+ /* check that edje_object_size_class_set works */
+ b = edje_object_size_class_set(obj, "rect_size", 150, 150, -1, -1);
+ edje_object_part_geometry_get(obj, "rect", NULL, NULL, &minw, &minh);
+ edje_object_part_geometry_get(obj2, "rect", NULL, NULL, &minw2, &minh2);
+ fail_if(!b || minw != 150 || minh != 150 || minw2 != 100 || minh2 != 100);
+
+ /* check that edje_object_size_class_get works */
+ b = edje_object_size_class_get(obj, "rect_size", &minw, &minh, NULL, NULL);
+ fail_if(!b || minw != 150 || minh != 150);
+
+ evas_free(evas);
+}
+EFL_END_TEST
+
+EFL_START_TEST(edje_test_color_class)
+{
+ Evas *evas = _setup_evas();
+
+ Eina_File *f;
+ Eina_Iterator *it;
+ Edje_Color_Class *itcc, *cc = NULL;
+ char *filename;
+
+ filename = realpath(test_layout_get("test_color_class.edj"), NULL);
+ fail_if(!filename);
+
+ f = eina_file_open(filename, EINA_FALSE);
+ fail_if(!f);
+
+ it = edje_mmap_color_class_iterator_new(f);
+ fail_if(!it);
+ EINA_ITERATOR_FOREACH(it, itcc)
+ {
+ if (!strcmp(itcc->name, "test_color_class"))
+ {
+ cc = itcc;
+ break;
+ }
+ }
+ fail_if((!cc) || (cc->r != 100) || (cc->g != 100) || (cc->b != 100) || (cc->a != 100));
+
+ eina_iterator_free(it);
+ eina_file_close(f);
+ free(filename);
+
+ evas_free(evas);
+}
+EFL_END_TEST
+
+void edje_test_features(TCase *tc)
+{
+ tcase_add_test(tc, edje_test_masking);
+ tcase_add_test(tc, edje_test_filters);
+ tcase_add_test(tc, edje_test_snapshot);
+ tcase_add_test(tc, edje_test_size_class);
+ tcase_add_test(tc, edje_test_color_class);
+}
diff --git a/src/tests/edje/edje_test_signal.c b/src/tests/edje/edje_test_signal.c
new file mode 100644
index 0000000000..2dc42b0ae7
--- /dev/null
+++ b/src/tests/edje/edje_test_signal.c
@@ -0,0 +1,240 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <unistd.h>
+#include <stdio.h>
+
+#define EFL_GFX_FILTER_BETA
+#define EFL_CANVAS_LAYOUT_BETA
+
+#include "edje_suite.h"
+
+#define EVAS_DATA_DIR TESTS_SRC_DIR "/../../lib/evas"
+
+static void
+_message_signal_reply_cb(void *data, Evas_Object *obj EINA_UNUSED,
+ const char *emission, const char *source)
+{
+ int *id = data;
+
+ fprintf(stderr, "source %s emit %s id %d\n", source, emission, *id);
+ fflush(stderr);
+ ck_assert_str_eq(source, "edc");
+ ck_assert_ptr_ne(emission, NULL);
+
+ if (!strncmp(emission, "int set", 7))
+ ck_assert_str_eq(emission, "int set 7 12 42 255");
+ else if (!strncmp(emission, "int", 3))
+ ck_assert_str_eq(emission, "int 42");
+ else if (!strncmp(emission, "float", 5))
+ {
+ char buf[64];
+ sprintf(buf, "float %f", 0.12);
+ ck_assert_str_eq(emission, buf);
+ }
+ else if (!strncmp(emission, "str", 3))
+ ck_assert_str_eq(emission, "str hello world");
+ else ck_abort_msg("Invalid emission!");
+
+ (*id)++;
+}
+
+EFL_START_TEST(edje_test_message_send_legacy)
+{
+ Evas *evas;
+ Evas_Object *obj;
+ Edje_Message_Int msgi;
+ Edje_Message_Float msgf;
+ Edje_Message_String msgs;
+ Edje_Message_Int_Set *msgis;
+ int id = 0;
+
+ /* Ugly calls to process:
+ *
+ * 1. Send edje message (async)
+ * 2. Process edje message (sync)
+ * 3. EDC program emits edje signal (async)
+ * 4. Process edje signal (sync)
+ * 5. Finally reached signal cb
+ */
+
+ evas = _setup_evas();
+
+ obj = edje_object_add(evas);
+ fail_unless(edje_object_file_set(obj, test_layout_get("test_messages.edj"), "test_group"));
+ edje_object_signal_callback_add(obj, "*", "edc", _message_signal_reply_cb, &id);
+
+ msgs.str = "hello world";
+ edje_object_message_send(obj, EDJE_MESSAGE_STRING, 0, &msgs);
+ edje_message_signal_process();
+ ck_assert_int_eq(id, 1);
+
+ msgi.val = 42;
+ edje_object_message_send(obj, EDJE_MESSAGE_INT, 1, &msgi);
+ edje_message_signal_process();
+ ck_assert_int_eq(id, 2);
+
+ msgf.val = 0.12;
+ edje_object_message_send(obj, EDJE_MESSAGE_FLOAT, 2, &msgf);
+ edje_message_signal_process();
+ ck_assert_int_eq(id, 3);
+
+ msgis = alloca(sizeof(*msgis) + 4 * sizeof(msgis->val));
+ msgis->count = 4;
+ msgis->val[0] = 7;
+ msgis->val[1] = 12;
+ msgis->val[2] = 42;
+ msgis->val[3] = 255;
+ edje_object_message_send(obj, EDJE_MESSAGE_INT_SET, 3, msgis);
+ edje_message_signal_process();
+ ck_assert_int_eq(id, 4);
+
+ evas_object_del(obj);
+
+ evas_free(evas);
+}
+EFL_END_TEST
+
+EFL_START_TEST(edje_test_message_send_eo)
+{
+ Evas *evas;
+ Evas_Object *obj;
+ Eina_Value v, *va;
+ int id = 0;
+
+ evas = _setup_evas();
+
+ obj = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas,
+ efl_file_set(efl_added, test_layout_get("test_messages.edj"), "test_group"));
+
+ // FIXME: EO API HERE
+ edje_object_signal_callback_add(obj, "*", "edc", _message_signal_reply_cb, &id);
+
+ // NOTE: edje_object_message_signal_process may or may not be in EO (TBD)
+
+ eina_value_setup(&v, EINA_VALUE_TYPE_STRING);
+ eina_value_set(&v, "hello world");
+ efl_layout_signal_message_send(obj, 0, v);
+ eina_value_flush(&v);
+ edje_message_signal_process();
+ edje_object_calc_force(obj);
+ ck_assert_int_eq(id, 1);
+
+ eina_value_setup(&v, EINA_VALUE_TYPE_INT);
+ eina_value_set(&v, 42);
+ efl_layout_signal_message_send(obj, 1, v);
+ eina_value_flush(&v);
+ edje_message_signal_process();
+ edje_object_calc_force(obj);
+ ck_assert_int_eq(id, 2);
+
+ eina_value_setup(&v, EINA_VALUE_TYPE_FLOAT);
+ eina_value_set(&v, 0.12);
+ efl_layout_signal_message_send(obj, 2, v);
+ eina_value_flush(&v);
+ edje_message_signal_process();
+ edje_object_calc_force(obj);
+ ck_assert_int_eq(id, 3);
+
+ va = eina_value_array_new(EINA_VALUE_TYPE_INT, 4);
+ eina_value_array_append(va, 7);
+ eina_value_array_append(va, 12);
+ eina_value_array_append(va, 42);
+ eina_value_array_append(va, 255);
+ efl_layout_signal_message_send(obj, 3, *va);
+ eina_value_free(va);
+ edje_message_signal_process();
+ edje_object_calc_force(obj);
+ ck_assert_int_eq(id, 4);
+
+ efl_del(obj);
+
+ evas_free(evas);
+}
+EFL_END_TEST
+
+EFL_START_TEST(edje_test_signals)
+{
+ Evas *evas;
+ Evas_Object *obj;
+ const char *state;
+
+ evas = _setup_evas();
+
+ obj = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas,
+ efl_file_set(efl_added, test_layout_get("test_signals.edj"), "level1"),
+ efl_gfx_entity_size_set(efl_added, EINA_SIZE2D(320, 240)),
+ efl_gfx_entity_visible_set(efl_added, 1));
+
+ edje_object_signal_emit(obj, "mouse,in", "text");
+
+ edje_object_message_signal_process(obj);
+ state = edje_object_part_state_get(obj, "group:group:text", NULL);
+ ck_assert_str_eq(state, "default");
+
+ edje_object_message_signal_process(obj);
+ state = edje_object_part_state_get(obj, "group:group:text", NULL);
+ ck_assert_str_eq(state, "default");
+
+ edje_object_message_signal_recursive_process(obj);
+ state = edje_object_part_state_get(obj, "group:group:text", NULL);
+ ck_assert_str_eq(state, "over");
+
+ efl_del(obj);
+
+ evas_free(evas);
+}
+EFL_END_TEST
+
+static int _signal_count;
+
+static void
+_signal_callback_count_cb(void *data, Evas_Object *obj EINA_UNUSED,
+ const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
+{
+ int *_data = data;
+ _signal_count += *_data;
+}
+
+EFL_START_TEST(edje_test_signal_callback_del_full)
+{
+ Evas *evas;
+ Evas_Object *obj;
+ int data[4] = { 1, 2, 4, 8 };
+
+ evas = _setup_evas();
+
+ obj = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas,
+ efl_file_set(efl_added,
+ test_layout_get("test_signal_callback_del_full.edj"), "test"),
+ efl_gfx_entity_size_set(efl_added, EINA_SIZE2D(320, 240)),
+ efl_gfx_entity_visible_set(efl_added, 1));
+
+ edje_object_signal_callback_add(obj, "some_signal", "event", _signal_callback_count_cb, &data[0]);
+ edje_object_signal_callback_add(obj, "some_signal", "event", _signal_callback_count_cb, &data[1]);
+ edje_object_signal_callback_add(obj, "some_signal", "event", _signal_callback_count_cb, &data[2]);
+ edje_object_signal_callback_add(obj, "some_signal", "event", _signal_callback_count_cb, &data[3]);
+
+ edje_object_signal_callback_del_full(obj, "some_signal", "event", _signal_callback_count_cb, &data[0]);
+ edje_object_signal_callback_del_full(obj, "some_signal", "event", _signal_callback_count_cb, &data[3]);
+
+ edje_object_signal_emit(obj, "some_signal", "event");
+
+ edje_object_message_signal_process(obj);
+ ck_assert_int_eq(_signal_count, (data[1] + data[2]));
+
+ efl_del(obj);
+
+ evas_free(evas);
+}
+EFL_END_TEST
+
+void edje_test_signal(TCase *tc)
+{
+ tcase_add_test(tc, edje_test_message_send_legacy);
+ tcase_add_test(tc, edje_test_message_send_eo);
+ tcase_add_test(tc, edje_test_signals);
+ tcase_add_test(tc, edje_test_signal_callback_del_full);
+
+}
diff --git a/src/tests/edje/edje_test_swallow.c b/src/tests/edje/edje_test_swallow.c
new file mode 100644
index 0000000000..dc04c1b0b2
--- /dev/null
+++ b/src/tests/edje/edje_test_swallow.c
@@ -0,0 +1,133 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <unistd.h>
+#include <stdio.h>
+
+#define EFL_GFX_FILTER_BETA
+#define EFL_CANVAS_LAYOUT_BETA
+
+#include "edje_suite.h"
+
+#define EVAS_DATA_DIR TESTS_SRC_DIR "/../../lib/evas"
+
+
+EFL_START_TEST(edje_test_swallows)
+{
+ Evas *evas = _setup_evas();
+ Evas_Object *ly, *o1, *o2;
+
+ ly = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas);
+ fail_unless(edje_object_file_set(ly, test_layout_get("test_swallows.edj"), "test_group"));
+
+ fail_unless(edje_object_part_exists(ly, "swallow"));
+
+
+ o1 = efl_add(EFL_CANVAS_LAYOUT_CLASS, ly);
+ fail_if(!edje_object_part_swallow(ly, "swallow", o1));
+ ck_assert_ptr_eq(efl_parent_get(o1), ly);
+
+ edje_object_part_unswallow(ly, o1);
+ ck_assert_ptr_eq(efl_parent_get(o1), evas_object_evas_get(o1));
+
+ fail_if(!edje_object_part_swallow(ly, "swallow", o1));
+ ck_assert_ptr_eq(efl_parent_get(o1), ly);
+
+ o2 = efl_add(EFL_CANVAS_LAYOUT_CLASS, ly);
+ fail_if(!edje_object_part_swallow(ly, "swallow", o2));
+ ck_assert_ptr_eq(efl_parent_get(o2), ly);
+ /* o1 is deleted at this point. */
+ ck_assert_ptr_eq(efl_parent_get(o1), evas_object_evas_get(o1));
+
+ evas_free(evas);
+}
+EFL_END_TEST
+
+EFL_START_TEST(edje_test_swallows_lifetime)
+{
+ Evas *evas = _setup_evas();
+ Evas_Object *ly, *o1;
+
+ ly = edje_object_add(evas);
+ fail_unless(edje_object_file_set(ly, test_layout_get("test_swallows.edj"), "test_group"));
+
+ fail_unless(edje_object_part_exists(ly, "swallow"));
+
+ o1 = edje_object_add(ly);
+ fail_if(!edje_object_part_swallow(ly, "swallow", o1));
+
+ evas_object_del(ly);
+ fail_if(!efl_parent_get(o1));
+
+ evas_free(evas);
+}
+EFL_END_TEST
+
+static void
+edje_test_swallows_invalidate_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
+{
+ ck_assert(data == edje_object_part_swallow_get(obj, "swallow"));
+}
+
+EFL_START_TEST(edje_test_swallows_invalidate)
+{
+ Evas *evas = _setup_evas();
+ Evas_Object *ly, *o1;
+
+ ly = edje_object_add(evas);
+ fail_unless(edje_object_file_set(ly, test_layout_get("test_swallows.edj"), "test_group"));
+
+ fail_unless(edje_object_part_exists(ly, "swallow"));
+
+ o1 = edje_object_add(ly);
+ fail_if(!edje_object_part_swallow(ly, "swallow", o1));
+
+ evas_object_event_callback_add(ly, EVAS_CALLBACK_DEL, edje_test_swallows_invalidate_del, o1);
+
+ evas_object_del(ly);
+ fail_if(!efl_parent_get(o1));
+
+ evas_free(evas);
+}
+EFL_END_TEST
+
+EFL_START_TEST(edje_test_swallows_eoapi)
+{
+ Evas *evas = _setup_evas();
+ Evas_Object *ly, *o1, *o2;
+
+ ly = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas);
+ fail_unless(edje_object_file_set(ly, test_layout_get("test_swallows.edj"), "test_group"));
+
+ fail_unless(edje_object_part_exists(ly, "swallow"));
+
+
+ o1 = efl_add(EFL_CANVAS_LAYOUT_CLASS, ly);
+ fail_if(!efl_content_set(efl_part(ly, "swallow"), o1));
+ ck_assert_ptr_eq(efl_parent_get(o1), ly);
+
+ efl_content_remove(ly, o1);
+ ck_assert_ptr_eq(efl_parent_get(o1), evas_object_evas_get(o1));
+
+ fail_if(!efl_content_set(efl_part(ly, "swallow"), o1));
+ ck_assert_ptr_eq(efl_parent_get(o1), ly);
+
+ o2 = efl_add(EFL_CANVAS_LAYOUT_CLASS, ly);
+ fail_if(!efl_content_set(efl_part(ly, "swallow"), o2));
+ ck_assert_ptr_eq(efl_parent_get(o2), ly);
+ /* o1 is deleted at this point. */
+ ck_assert_ptr_eq(efl_parent_get(o1), evas_object_evas_get(o1));
+
+ evas_free(evas);
+}
+EFL_END_TEST
+
+
+void edje_test_swallow(TCase *tc)
+{
+ tcase_add_test(tc, edje_test_swallows);
+ tcase_add_test(tc, edje_test_swallows_lifetime);
+ tcase_add_test(tc, edje_test_swallows_invalidate);
+ tcase_add_test(tc, edje_test_swallows_eoapi);
+}
diff --git a/src/tests/edje/edje_test_text.c b/src/tests/edje/edje_test_text.c
new file mode 100644
index 0000000000..d87ab48208
--- /dev/null
+++ b/src/tests/edje/edje_test_text.c
@@ -0,0 +1,120 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <unistd.h>
+#include <stdio.h>
+
+#define EFL_GFX_FILTER_BETA
+#define EFL_CANVAS_LAYOUT_BETA
+
+#include "edje_suite.h"
+
+#define EVAS_DATA_DIR TESTS_SRC_DIR "/../../lib/evas"
+
+
+EFL_START_TEST(edje_test_text_cursor)
+{
+ Evas *evas;
+ Evas_Object *obj;
+ const char *buf = "ABC<br/>DEF";
+ const char *txt;
+ int i, old_pos, new_pos;
+
+ evas = _setup_evas();
+
+ obj = edje_object_add(evas);
+ fail_unless(edje_object_file_set(obj, test_layout_get("test_text_cursor.edj"), "test_text_cursor"));
+ edje_object_part_text_set(obj, "text", buf);
+ txt = edje_object_part_text_get(obj, "text");
+ fail_if(!txt || strcmp(txt, buf));
+
+ edje_object_part_text_cursor_pos_set(obj, "text", EDJE_CURSOR_MAIN, 0);
+ ck_assert_int_eq(edje_object_part_text_cursor_pos_get(obj, "text", EDJE_CURSOR_MAIN), 0);
+ edje_object_part_text_cursor_pos_set(obj, "text", EDJE_CURSOR_MAIN, 1);
+ ck_assert_int_eq(edje_object_part_text_cursor_pos_get(obj, "text", EDJE_CURSOR_MAIN), 1);
+
+ /* Move cursor to the 0 pos from 1 pos */
+ old_pos = edje_object_part_text_cursor_pos_get(obj, "text", EDJE_CURSOR_MAIN);
+ ck_assert(edje_object_part_text_cursor_prev(obj, "text", EDJE_CURSOR_MAIN));
+ new_pos = edje_object_part_text_cursor_pos_get(obj, "text", EDJE_CURSOR_MAIN);
+ ck_assert_int_ne(old_pos, new_pos);
+
+ /* Move cursor to the -1 pos from 0 pos. It has to fail. */
+ old_pos = new_pos;
+ ck_assert(!edje_object_part_text_cursor_prev(obj, "text", EDJE_CURSOR_MAIN));
+ new_pos = edje_object_part_text_cursor_pos_get(obj, "text", EDJE_CURSOR_MAIN);
+ ck_assert_int_eq(old_pos, new_pos);
+
+ /* Jump to 2nd line from 1st line.
+ * It has to return EINA_TRUE which means success. */
+ old_pos = new_pos;
+ ck_assert(edje_object_part_text_cursor_down(obj, "text", EDJE_CURSOR_MAIN));
+ new_pos = edje_object_part_text_cursor_pos_get(obj, "text", EDJE_CURSOR_MAIN);
+ ck_assert_int_ne(old_pos, new_pos);
+
+ /* Try to jump to 3rd line from 2nd line. But, 3rd line does not exist.
+ * So, it has to return EINA_FALSE which means failure. */
+ old_pos = new_pos;
+ ck_assert(!edje_object_part_text_cursor_down(obj, "text", EDJE_CURSOR_MAIN));
+ new_pos = edje_object_part_text_cursor_pos_get(obj, "text", EDJE_CURSOR_MAIN);
+ ck_assert_int_eq(old_pos, new_pos);
+
+ /* Move cursor to the end of 2nd line. */
+ for (i = 0; i < 3; i++)
+ {
+ old_pos = new_pos;
+ ck_assert(edje_object_part_text_cursor_next(obj, "text", EDJE_CURSOR_MAIN));
+ new_pos = edje_object_part_text_cursor_pos_get(obj, "text", EDJE_CURSOR_MAIN);
+ ck_assert_int_ne(old_pos, new_pos);
+ }
+
+ /* Move cursor to the next of the end of 2nd line which does not exist. */
+ old_pos = new_pos;
+ ck_assert(!edje_object_part_text_cursor_next(obj, "text", EDJE_CURSOR_MAIN));
+ new_pos = edje_object_part_text_cursor_pos_get(obj, "text", EDJE_CURSOR_MAIN);
+ ck_assert_int_eq(old_pos, new_pos);
+
+ /* Jump to 1st line from 2nd line.
+ * It has to return EINA_TRUE which means success. */
+ old_pos = new_pos;
+ ck_assert(edje_object_part_text_cursor_up(obj, "text", EDJE_CURSOR_MAIN));
+ new_pos = edje_object_part_text_cursor_pos_get(obj, "text", EDJE_CURSOR_MAIN);
+ ck_assert_int_ne(old_pos, new_pos);
+
+ /* Try to jump to the above of 1st line from 1st line. But, there is no such line.
+ * So, it has to return EINA_FALSE which means failure. */
+ old_pos = new_pos;
+ ck_assert(!edje_object_part_text_cursor_up(obj, "text", EDJE_CURSOR_MAIN));
+ new_pos = edje_object_part_text_cursor_pos_get(obj, "text", EDJE_CURSOR_MAIN);
+ ck_assert_int_eq(old_pos, new_pos);
+
+ evas_free(evas);
+}
+EFL_END_TEST
+
+
+EFL_START_TEST(edje_test_textblock)
+{
+ Evas *evas;
+ Evas_Object *obj;
+ const char *buf = "Hello";
+ const char *txt;
+
+ evas = _setup_evas();
+
+ obj = edje_object_add(evas);
+ fail_unless(edje_object_file_set(obj, test_layout_get("test_textblock.edj"), "test_textblock"));
+ edje_object_part_text_set(obj, "text", buf);
+ txt = edje_object_part_text_get(obj, "text");
+ fail_if(!txt || strcmp(txt, buf));
+
+ evas_free(evas);
+}
+EFL_END_TEST
+
+void edje_test_text(TCase *tc)
+{
+ tcase_add_test(tc, edje_test_text_cursor);
+ tcase_add_test(tc, edje_test_textblock);
+}
diff --git a/src/tests/edje/edje_tests_helpers.h b/src/tests/edje/edje_tests_helpers.h
deleted file mode 100644
index 530d10e6e3..0000000000
--- a/src/tests/edje/edje_tests_helpers.h
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef EDJE_TEST_HELPERS_H
-#define EDJE_TEST_HELPERS_H
-
-#include <Ecore_Evas.h>
-
-/* FIXME: Currently depends on the buffer engine, should we do anything
- * fancier? */
-
-#define EDJE_TEST_INIT_EVAS() _setup_evas()
-
-#define EDJE_TEST_FREE_EVAS() \
- do \
- { \
- edje_shutdown(); \
- evas_free(evas); \
- ecore_evas_shutdown(); \
- } \
- while (0)
-
-static Evas *
-_setup_evas()
-{
- Evas *evas;
- Evas_Engine_Info *einfo;
-
- ecore_evas_init();
- edje_init();
-
- evas = evas_new();
-
- evas_output_method_set(evas, evas_render_method_lookup("buffer"));
- einfo = evas_engine_info_get(evas);
- evas_engine_info_set(evas, einfo);
-
- evas_output_size_set(evas, 500, 500);
- evas_output_viewport_set(evas, 0, 0, 500, 500);
-
- return evas;
-}
-
-#endif
-
diff --git a/src/tests/eet/eet_suite.c b/src/tests/eet/eet_suite.c
index a1d7840327..60cc8ce3e8 100644
--- a/src/tests/eet/eet_suite.c
+++ b/src/tests/eet/eet_suite.c
@@ -6,6 +6,7 @@
#include "eet_suite.h"
#include "../efl_check.h"
+#include <Eet.h>
char argv0[PATH_MAX];
@@ -25,6 +26,16 @@ static const Efl_Test_Case etc[] = {
{ NULL, NULL }
};
+SUITE_INIT(eet)
+{
+ ck_assert_int_eq(eet_init(), 1);
+}
+
+SUITE_SHUTDOWN(eet)
+{
+ ck_assert_int_eq(eet_shutdown(), 0);
+}
+
int
main(int argc, char *argv[])
{
@@ -40,7 +51,7 @@ main(int argc, char *argv[])
memcpy(argv0, argv[0], strlen(argv[0]) + 1);
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
- "Eet", etc);
+ "Eet", etc, SUITE_INIT_FN(eet), SUITE_SHUTDOWN_FN(eet));
return (failed_count == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}
diff --git a/src/tests/eet/eet_suite.h b/src/tests/eet/eet_suite.h
index b7c3e59ae6..9be74a9a0a 100644
--- a/src/tests/eet/eet_suite.h
+++ b/src/tests/eet/eet_suite.h
@@ -2,7 +2,7 @@
# define _EET_SUITE_H
#include <check.h>
-
+#include "../efl_check.h"
void eet_test_init(TCase *tc);
void eet_test_data(TCase *tc);
void eet_test_file(TCase *tc);
diff --git a/src/tests/eet/eet_test_cache.c b/src/tests/eet/eet_test_cache.c
index 6713c410a0..6dee39142c 100644
--- a/src/tests/eet/eet_test_cache.c
+++ b/src/tests/eet/eet_test_cache.c
@@ -44,7 +44,7 @@ _open_close_worker(void *path, Eina_Thread tid EINA_UNUSED)
return NULL;
}
-START_TEST(eet_test_cache_concurrency)
+EFL_START_TEST(eet_test_cache_concurrency)
{
char *file;
const char *buffer = "test data";
@@ -57,7 +57,6 @@ START_TEST(eet_test_cache_concurrency)
file = strdup("/tmp/eet_suite_testXXXXXX");
- eet_init();
eina_threads_init();
eina_lock_new(&open_worker_mutex);
@@ -95,9 +94,8 @@ START_TEST(eet_test_cache_concurrency)
fail_if(unlink(file) != 0);
eina_threads_shutdown();
- eet_shutdown();
}
-END_TEST
+EFL_END_TEST
void eet_test_cache(TCase *tc)
{
diff --git a/src/tests/eet/eet_test_cipher.c b/src/tests/eet/eet_test_cipher.c
index 2cee686a5c..c06c505b4c 100644
--- a/src/tests/eet/eet_test_cipher.c
+++ b/src/tests/eet/eet_test_cipher.c
@@ -12,7 +12,7 @@
#include "eet_suite.h"
#include "eet_test_common.h"
-START_TEST(eet_test_cipher_decipher_simple)
+EFL_START_TEST(eet_test_cipher_decipher_simple)
{
const char *buffer = "Here is a string of data to save !";
const char *key = "This is a crypto key";
@@ -23,8 +23,6 @@ START_TEST(eet_test_cipher_decipher_simple)
int size;
int tmpfd;
- eet_init();
-
fail_if(-1 == (tmpfd = mkstemp(file)));
fail_if(!!close(tmpfd));
@@ -61,10 +59,8 @@ START_TEST(eet_test_cipher_decipher_simple)
eet_close(ef);
fail_if(unlink(file) != 0);
-
- eet_shutdown();
}
-END_TEST
+EFL_END_TEST
void eet_test_cipher(TCase *tc)
{
diff --git a/src/tests/eet/eet_test_connection.c b/src/tests/eet/eet_test_connection.c
index 28c3d5d559..173fa5a37c 100644
--- a/src/tests/eet/eet_test_connection.c
+++ b/src/tests/eet/eet_test_connection.c
@@ -87,7 +87,7 @@ _eet_connection_write(const void *data,
return EINA_TRUE;
}
-START_TEST(eet_test_connection_check)
+EFL_START_TEST(eet_test_connection_check)
{
Eet_Data_Descriptor *edd;
Eet_Data_Descriptor_Class eddc;
@@ -95,8 +95,6 @@ START_TEST(eet_test_connection_check)
Eet_Test_Ex_Type etbt;
Eina_Bool on_going;
- eet_init();
-
eet_test_ex_set(&etbt, 0);
etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1));
etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1));
@@ -139,10 +137,8 @@ START_TEST(eet_test_connection_check)
fail_if(!eet_connection_close(ecd.conn, &on_going));
fail_if(on_going);
-
- eet_shutdown();
}
-END_TEST
+EFL_END_TEST
void eet_test_connection(TCase *tc)
{
diff --git a/src/tests/eet/eet_test_data.c b/src/tests/eet/eet_test_data.c
index 4899832392..ae5d013fcc 100644
--- a/src/tests/eet/eet_test_data.c
+++ b/src/tests/eet/eet_test_data.c
@@ -279,7 +279,7 @@ _eet_st3_cmp(Eet_St3 *st3,
fail_if(st3->boby != EET_TEST_INT + i);
} /* _eet_st3_cmp */
-START_TEST(eet_test_data_basic_type_encoding_decoding)
+EFL_START_TEST(eet_test_data_basic_type_encoding_decoding)
{
Eet_Data_Descriptor *edd;
Eet_Test_Basic_Type *result;
@@ -288,8 +288,6 @@ START_TEST(eet_test_data_basic_type_encoding_decoding)
void *transfert;
int size;
- eet_init();
-
eet_test_basic_set(&etbt, 0);
eet_test_setup_eddc(&eddc);
@@ -313,12 +311,10 @@ START_TEST(eet_test_data_basic_type_encoding_decoding)
free(result);
eet_data_descriptor_free(edd);
-
- eet_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eet_test_data_type_encoding_decoding)
+EFL_START_TEST(eet_test_data_type_encoding_decoding)
{
Eet_Data_Descriptor *edd;
Eet_Test_Ex_Type *result;
@@ -328,8 +324,6 @@ START_TEST(eet_test_data_type_encoding_decoding)
int size;
int test;
- eet_init();
-
eet_test_ex_set(&etbt, 0);
etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1));
etbt.hash = eina_hash_string_superfast_new(NULL);
@@ -379,12 +373,10 @@ START_TEST(eet_test_data_type_encoding_decoding)
eina_hash_foreach(result->ihash, func7, &test);
fail_if(test != 0);
-
- eet_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eet_test_data_type_dump_undump)
+EFL_START_TEST(eet_test_data_type_dump_undump)
{
Eet_Data_Descriptor *edd;
Eet_Test_Ex_Type *result;
@@ -398,8 +390,6 @@ START_TEST(eet_test_data_type_dump_undump)
int size2;
int test;
- eet_init();
-
eet_test_ex_set(&etbt, 0);
etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1));
etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1));
@@ -470,11 +460,10 @@ START_TEST(eet_test_data_type_dump_undump)
fail_if(test != 0);
- eet_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eet_test_data_type_escape_dump_undump)
+EFL_START_TEST(eet_test_data_type_escape_dump_undump)
{
void *blob;
int blob_len;
@@ -488,8 +477,6 @@ START_TEST(eet_test_data_type_escape_dump_undump)
" value \"\\\\My\\\\NewLine\\\\\" string: \"\\n\";\n"
"}\n";
- eet_init();
-
blob = eet_data_text_undump(inputstr, strlen(inputstr), &blob_len);
fail_if(!blob);
@@ -504,11 +491,10 @@ START_TEST(eet_test_data_type_escape_dump_undump)
eina_strbuf_free(strbuf);
free(blob);
- eet_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eet_test_data_fp)
+EFL_START_TEST(eet_test_data_fp)
{
Eet_Data_Descriptor_Class eddc;
Eet_Data_Descriptor *edd_5FP;
@@ -519,8 +505,6 @@ START_TEST(eet_test_data_fp)
void *blob;
int size;
- eet_init();
-
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Eet_5FP);
edd_5FP = eet_data_descriptor_stream_new(&eddc);
@@ -566,11 +550,10 @@ START_TEST(eet_test_data_fp)
fail_if(convert->f1 != 1);
fail_if(convert->f0 != 0);
- eet_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eet_test_data_union)
+EFL_START_TEST(eet_test_data_union)
{
Eet_Union_Test *eut;
Eet_List *l;
@@ -582,9 +565,6 @@ START_TEST(eet_test_data_union)
int size;
int i;
- eina_init();
- eet_init();
-
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Eet_Union_Test);
edd = eet_data_descriptor_stream_new(&eddc);
@@ -642,13 +622,10 @@ START_TEST(eet_test_data_union)
EUT_CMP(2);
EUT_CMP(3);
}
-
- eet_shutdown();
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eet_test_data_variant)
+EFL_START_TEST(eet_test_data_variant)
{
Eet_Variant_Test *evt;
Eet_List *l;
@@ -663,9 +640,6 @@ START_TEST(eet_test_data_variant)
int size;
int i;
- eina_init();
- eet_init();
-
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Eet_Variant_Test);
edd = eet_data_descriptor_stream_new(&eddc);
@@ -753,12 +727,10 @@ START_TEST(eet_test_data_variant)
EVT_CMP(3);
}
- eet_shutdown();
- eina_shutdown();
-} /* START_TEST */
-END_TEST
+} /* EFL_START_TEST */
+EFL_END_TEST
-START_TEST(eet_test_data_hash_value)
+EFL_START_TEST(eet_test_data_hash_value)
{
Eet_Hash *h;
Eina_Value *val;
@@ -770,9 +742,6 @@ START_TEST(eet_test_data_hash_value)
double d;
char *s;
- eina_init();
- eet_init();
-
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Eet_Hash);
edd = eet_data_descriptor_stream_new(&eddc);
@@ -810,11 +779,8 @@ START_TEST(eet_test_data_hash_value)
val = (Eina_Value *)eina_hash_find(h->hash, "val/string");
eina_value_get(val, &s);
fail_if((!val) || strcmp(s, EET_TEST_STRING));
-
- eet_shutdown();
- eina_shutdown();
-} /* START_TEST */
-END_TEST
+} /* EFL_START_TEST */
+EFL_END_TEST
void eet_test_data(TCase *tc)
{
diff --git a/src/tests/eet/eet_test_file.c b/src/tests/eet/eet_test_file.c
index fbf902b5df..6d77a7d817 100644
--- a/src/tests/eet/eet_test_file.c
+++ b/src/tests/eet/eet_test_file.c
@@ -11,7 +11,7 @@
#include "eet_suite.h"
#include "eet_test_common.h"
-START_TEST(eet_test_file_simple_write)
+EFL_START_TEST(eet_test_file_simple_write)
{
const char *buffer = "Here is a string of data to save !";
Eina_Iterator *it;
@@ -26,8 +26,6 @@ START_TEST(eet_test_file_simple_write)
file = strdup("/tmp/eet_suite_testXXXXXX");
- eet_init();
-
fail_if(-1 == (tmpfd = mkstemp(file)));
fail_if(!!close(tmpfd));
@@ -120,11 +118,10 @@ START_TEST(eet_test_file_simple_write)
fail_if(unlink(file) != 0);
- eet_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eet_test_file_data)
+EFL_START_TEST(eet_test_file_data)
{
Eet_Data_Descriptor *edd;
Eet_Test_Ex_Type *result;
@@ -140,8 +137,6 @@ START_TEST(eet_test_file_data)
file = strdup("/tmp/eet_suite_testXXXXXX");
- eet_init();
-
eet_test_ex_set(&etbt, 0);
etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1));
etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1));
@@ -280,11 +275,10 @@ START_TEST(eet_test_file_data)
fail_if(unlink(file) != 0);
- eet_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eet_test_file_data_dump)
+EFL_START_TEST(eet_test_file_data_dump)
{
Eet_Data_Descriptor *edd;
Eet_Test_Ex_Type *result;
@@ -298,8 +292,6 @@ START_TEST(eet_test_file_data_dump)
file = strdup("/tmp/eet_suite_testXXXXXX");
- eet_init();
-
eet_test_ex_set(&etbt, 0);
etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1));
etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1));
@@ -382,11 +374,10 @@ START_TEST(eet_test_file_data_dump)
fail_if(unlink(file) != 0);
- eet_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eet_test_file_fp)
+EFL_START_TEST(eet_test_file_fp)
{
char *file;
Eet_Data_Descriptor_Class eddc;
@@ -400,8 +391,6 @@ START_TEST(eet_test_file_fp)
file = strdup("/tmp/eet_suite_testXXXXXX");
- eet_init();
-
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Eet_5FP);
edd_5FP = eet_data_descriptor_file_new(&eddc);
@@ -456,9 +445,8 @@ START_TEST(eet_test_file_fp)
fail_if(unlink(file) != 0);
- eet_shutdown();
}
-END_TEST
+EFL_END_TEST
void eet_test_file(TCase *tc)
{
diff --git a/src/tests/eet/eet_test_identity.c b/src/tests/eet/eet_test_identity.c
index 30ccc8dddc..b22d537021 100644
--- a/src/tests/eet/eet_test_identity.c
+++ b/src/tests/eet/eet_test_identity.c
@@ -52,7 +52,7 @@ badpass_get(char *pass,
return strlen(pass);
}
-START_TEST(eet_test_identity_simple)
+EFL_START_TEST(eet_test_identity_simple)
{
const char *buffer = "Here is a string of data to save !";
const void *tmp;
@@ -66,8 +66,6 @@ START_TEST(eet_test_identity_simple)
file = strdup("/tmp/eet_suite_testXXXXXX");
- eet_init();
-
fail_if(-1 == (fd = mkstemp(file)));
fail_if(!!close(fd));
fail_if(!(noread = fopen("/dev/null", "wb")));
@@ -129,49 +127,46 @@ START_TEST(eet_test_identity_simple)
fail_if(unlink(file) != 0);
- eet_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eet_test_identity_open_simple)
+EFL_START_TEST(eet_test_identity_open_simple)
{
Eet_Key *k = NULL;
- eet_init();
-
k = eet_identity_open(_cert_pem, _key_pem, NULL);
fail_if(!k);
if (k)
eet_identity_close(k);
- eet_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eet_test_identity_open_pkcs8)
+EFL_START_TEST(eet_test_identity_open_pkcs8)
{
Eet_Key *k = NULL;
- eet_init();
-
k = eet_identity_open(_cert_pem, _key_enc_none_pem, NULL);
fail_if(!k);
if (k)
eet_identity_close(k);
- eet_shutdown();
}
-END_TEST
+EFL_END_TEST
+
+static int
+pw_cb(char *buf EINA_UNUSED, int size EINA_UNUSED, int rwflag EINA_UNUSED, void *data EINA_UNUSED)
+{
+ return 0;
+}
-START_TEST(eet_test_identity_open_pkcs8_enc)
+EFL_START_TEST(eet_test_identity_open_pkcs8_enc)
{
Eet_Key *k = NULL;
- eet_init();
-
- k = eet_identity_open(_cert_pem, _key_enc_pem, NULL);
+ k = eet_identity_open(_cert_pem, _key_enc_pem, pw_cb);
fail_if(k);
if (k)
@@ -189,9 +184,8 @@ START_TEST(eet_test_identity_open_pkcs8_enc)
if (k)
eet_identity_close(k);
- eet_shutdown();
}
-END_TEST
+EFL_END_TEST
static const char *_cert_dir_find(const char *_argv0)
{
diff --git a/src/tests/eet/eet_test_image.c b/src/tests/eet/eet_test_image.c
index f069697110..5e35e67e54 100644
--- a/src/tests/eet/eet_test_image.c
+++ b/src/tests/eet/eet_test_image.c
@@ -69,7 +69,7 @@ static const Eet_Test_Image test_alpha = {
}
};
-START_TEST(eet_test_image_normal)
+EFL_START_TEST(eet_test_image_normal)
{
Eet_File *ef;
char *file;
@@ -85,8 +85,6 @@ START_TEST(eet_test_image_normal)
file = strdup("/tmp/eet_suite_testXXXXXX");
- eet_init();
-
fail_if(-1 == (tmpfd = mkstemp(file)));
fail_if(!!close(tmpfd));
@@ -428,11 +426,10 @@ START_TEST(eet_test_image_normal)
fail_if(unlink(file) != 0);
- eet_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eet_test_image_small)
+EFL_START_TEST(eet_test_image_small)
{
char *file;
unsigned int image[4];
@@ -454,8 +451,6 @@ START_TEST(eet_test_image_small)
image[2] = IM2;
image[3] = IM3;
- eet_init();
-
fail_if(-1 == (tmpfd = mkstemp(file)));
fail_if(!!close(tmpfd));
@@ -491,9 +486,8 @@ START_TEST(eet_test_image_small)
free(data);
- eet_shutdown();
}
-END_TEST
+EFL_END_TEST
void eet_test_image(TCase *tc)
{
diff --git a/src/tests/eet/eet_test_init.c b/src/tests/eet/eet_test_init.c
index 9343cc15bf..bce13cb60c 100644
--- a/src/tests/eet/eet_test_init.c
+++ b/src/tests/eet/eet_test_init.c
@@ -6,17 +6,10 @@
#include "eet_suite.h"
-START_TEST(_eet_test_init)
+EFL_START_TEST(_eet_test_init)
{
- int ret;
-
- ret = eet_init();
- fail_if(ret != 1);
-
- ret = eet_shutdown();
- fail_if(ret != 0);
}
-END_TEST
+EFL_END_TEST
void eet_test_init(TCase *tc)
{
diff --git a/src/tests/eet_cxx/eet_cxx_suite.cc b/src/tests/eet_cxx/eet_cxx_suite.cc
index 4733af7d9c..a2b443cc0b 100644
--- a/src/tests/eet_cxx/eet_cxx_suite.cc
+++ b/src/tests/eet_cxx/eet_cxx_suite.cc
@@ -20,7 +20,7 @@ int main(int argc, char* argv[])
putenv(const_cast<char*>("EFL_RUN_IN_TREE=1"));
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
- "Eet C++", etc);
+ "Eet C++", etc, NULL, NULL);
return (failed_count == 0) ? 0 : 255;
}
diff --git a/src/tests/eet_cxx/eet_cxx_suite.h b/src/tests/eet_cxx/eet_cxx_suite.h
index a2780ea784..1e9e526934 100644
--- a/src/tests/eet_cxx/eet_cxx_suite.h
+++ b/src/tests/eet_cxx/eet_cxx_suite.h
@@ -5,7 +5,7 @@
#include <algorithm>
#include <check.h>
-
+#include "../efl_check.h"
void eet_cxx_test_descriptors(TCase* tc);
#endif /* _EET_CXX_SUITE_H */
diff --git a/src/tests/eet_cxx/eet_cxx_test_descriptors.cc b/src/tests/eet_cxx/eet_cxx_test_descriptors.cc
index 4dd4cf9699..98ae254ad4 100644
--- a/src/tests/eet_cxx/eet_cxx_test_descriptors.cc
+++ b/src/tests/eet_cxx/eet_cxx_test_descriptors.cc
@@ -15,7 +15,7 @@ struct pod_type
char c;
};
-START_TEST(eet_cxx_descriptors)
+EFL_START_TEST(eet_cxx_descriptors)
{
efl::eet::eet_init init;
@@ -41,7 +41,7 @@ START_TEST(eet_cxx_descriptors)
eet_close(file);
}
-END_TEST
+EFL_END_TEST
int constructors_called = 0
, destructors_called = 0;
@@ -65,7 +65,7 @@ struct non_pod
int i;
};
-START_TEST(eet_cxx_descriptors_non_pod)
+EFL_START_TEST(eet_cxx_descriptors_non_pod)
{
efl::eet::eet_init init;
@@ -98,7 +98,7 @@ START_TEST(eet_cxx_descriptors_non_pod)
ck_assert(constructors_called == destructors_called);
}
-END_TEST
+EFL_END_TEST
struct pod_composited
{
@@ -115,7 +115,7 @@ struct pod_value_composited
pod_type member;
};
-START_TEST(eet_cxx_descriptors_composition)
+EFL_START_TEST(eet_cxx_descriptors_composition)
{
efl::eet::eet_init init;
@@ -222,7 +222,7 @@ START_TEST(eet_cxx_descriptors_composition)
}
}
-END_TEST
+EFL_END_TEST
void
eet_cxx_test_descriptors(TCase* tc)
diff --git a/src/tests/eeze/eeze_suite.c b/src/tests/eeze/eeze_suite.c
index d96ab9138d..3b34930f9a 100644
--- a/src/tests/eeze/eeze_suite.c
+++ b/src/tests/eeze/eeze_suite.c
@@ -4,6 +4,7 @@
#include "eeze_suite.h"
#include "../efl_check.h"
+#include <Eeze.h>
static const Efl_Test_Case etc[] = {
{ "Init", eeze_test_init },
@@ -13,6 +14,16 @@ static const Efl_Test_Case etc[] = {
{ NULL, NULL }
};
+SUITE_INIT(eeze)
+{
+ ck_assert_int_eq(eeze_init(), 1);
+}
+
+SUITE_SHUTDOWN(eeze)
+{
+ ck_assert_int_eq(eeze_shutdown(), 0);
+}
+
int
main(int argc, char *argv[])
{
@@ -26,7 +37,7 @@ main(int argc, char *argv[])
#endif
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
- "Eeze", etc);
+ "Eeze", etc, SUITE_INIT_FN(eeze), SUITE_SHUTDOWN_FN(eeze));
return (failed_count == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}
diff --git a/src/tests/eeze/eeze_suite.h b/src/tests/eeze/eeze_suite.h
index d8fcfb3d57..2fd9b49f3e 100644
--- a/src/tests/eeze/eeze_suite.h
+++ b/src/tests/eeze/eeze_suite.h
@@ -2,7 +2,7 @@
#define _EEZE_SUITE_H
#include <check.h>
-
+#include "../efl_check.h"
void eeze_test_init(TCase *tc);
void eeze_test_udev(TCase *tc);
void eeze_test_net(TCase *tc);
diff --git a/src/tests/eeze/eeze_test_init.c b/src/tests/eeze/eeze_test_init.c
index 6c72acbd19..0bdbe890b3 100644
--- a/src/tests/eeze/eeze_test_init.c
+++ b/src/tests/eeze/eeze_test_init.c
@@ -6,17 +6,10 @@
#include "eeze_suite.h"
-START_TEST(eeze_test_eeze_init)
+EFL_START_TEST(eeze_test_eeze_init)
{
- int ret;
-
- ret = eeze_init();
- fail_if(ret != 1);
-
- ret = eeze_shutdown();
- fail_if(ret != 0);
}
-END_TEST
+EFL_END_TEST
void eeze_test_init(TCase *tc)
{
diff --git a/src/tests/eeze/eeze_test_net.c b/src/tests/eeze/eeze_test_net.c
index 7c03ce39c5..a3eca6a408 100644
--- a/src/tests/eeze/eeze_test_net.c
+++ b/src/tests/eeze/eeze_test_net.c
@@ -7,32 +7,21 @@
#include "eeze_suite.h"
-START_TEST(eeze_test_net_list)
+EFL_START_TEST(eeze_test_net_list)
{
- int ret;
Eina_List *list = NULL;
- ret = eeze_init();
- fail_if(ret != 1);
-
list = eeze_net_list();
fail_if(list == NULL);
-
- ret = eeze_shutdown();
- fail_if(ret != 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eeze_test_net_attr)
+EFL_START_TEST(eeze_test_net_attr)
{
- int ret;
int idx = 0;
Eeze_Net *net = NULL;
const char *tmp = NULL;
- ret = eeze_init();
- fail_if(ret != 1);
-
net = eeze_net_new("lo");
fail_if(net == NULL);
@@ -65,23 +54,16 @@ START_TEST(eeze_test_net_attr)
fail_if(tmp == NULL);
eeze_net_free(net);
-
- ret = eeze_shutdown();
- fail_if(ret != 0);
}
-END_TEST
+EFL_END_TEST
#ifdef HAVE_IPV6
-START_TEST(eeze_test_net_attr_ipv6)
+EFL_START_TEST(eeze_test_net_attr_ipv6)
{
- int ret;
Eeze_Net *net = NULL;
const char *tmp = NULL;
- ret = eeze_init();
- fail_if(ret != 1);
-
net = eeze_net_new("lo");
fail_if(net == NULL);
@@ -104,11 +86,8 @@ START_TEST(eeze_test_net_attr_ipv6)
cleanup:
eeze_net_free(net);
-
- ret = eeze_shutdown();
- fail_if(ret != 0);
}
-END_TEST
+EFL_END_TEST
#endif
diff --git a/src/tests/eeze/eeze_test_sensor.c b/src/tests/eeze/eeze_test_sensor.c
index 7cd415e65d..0677eb185c 100644
--- a/src/tests/eeze/eeze_test_sensor.c
+++ b/src/tests/eeze/eeze_test_sensor.c
@@ -33,19 +33,14 @@ event_cb(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *event)
return ECORE_CALLBACK_DONE;
}
-START_TEST(eeze_test_sensor_read)
+EFL_START_TEST(eeze_test_sensor_read)
{
Eeze_Sensor_Obj *sens = NULL;
- int ret = 0;
float x, y, z;
int acc;
double timestamp;
Eina_Bool rc = EINA_FALSE;
- ecore_init();
- ret = eeze_init();
- fail_if(ret != 1);
-
sens = eeze_sensor_new(EEZE_SENSOR_TYPE_ACCELEROMETER);
fail_if(sens == NULL);
rc = eeze_sensor_read(sens);
@@ -162,24 +157,16 @@ START_TEST(eeze_test_sensor_read)
/* Try free on NULL */
eeze_sensor_free(NULL);
-
- ret = eeze_shutdown();
- fail_if(ret != 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eeze_test_sensor_async_read)
+EFL_START_TEST(eeze_test_sensor_async_read)
{
Ecore_Event_Handler *handler;
Eeze_Sensor_Obj *sens = NULL;
- int ret = 0;
Eina_Bool rc = EINA_FALSE;
- ecore_init();
- ret = eeze_init();
- fail_if(ret != 1);
-
handler = ecore_event_handler_add(EEZE_SENSOR_EVENT_ACCELEROMETER, event_cb, NULL);
fail_if(handler == NULL);
sens = eeze_sensor_new(EEZE_SENSOR_TYPE_ACCELEROMETER);
@@ -238,20 +225,12 @@ START_TEST(eeze_test_sensor_async_read)
fail_if(rc != EINA_FALSE);
ecore_main_loop_begin();
-
- ret = eeze_shutdown();
- fail_if(ret != 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eeze_test_sensor_obj_get)
+EFL_START_TEST(eeze_test_sensor_obj_get)
{
Eeze_Sensor_Obj *obj = NULL, *obj_tmp = NULL;
- int ret = 0;
-
- ecore_init();
- ret = eeze_init();
- fail_if(ret != 1);
obj = calloc(1, sizeof(Eeze_Sensor_Obj));
fail_if(obj == NULL);
@@ -266,11 +245,8 @@ START_TEST(eeze_test_sensor_obj_get)
/* Try to get non existing obj */
obj_tmp = eeze_sensor_obj_get(EEZE_SENSOR_TYPE_LAST + 1);
fail_if(obj_tmp != NULL);
-
- ret = eeze_shutdown();
- fail_if(ret != 0);
}
-END_TEST
+EFL_END_TEST
void eeze_test_sensor(TCase *tc)
{
diff --git a/src/tests/eeze/eeze_test_udev.c b/src/tests/eeze/eeze_test_udev.c
index 74e2301f19..713d3d81fb 100644
--- a/src/tests/eeze/eeze_test_udev.c
+++ b/src/tests/eeze/eeze_test_udev.c
@@ -16,12 +16,10 @@ catch_events(const char *device EINA_UNUSED, Eeze_Udev_Event event EINA_UNUSED,
#if 0
// FIXME split udev tests into pieces here
-START_TEST(eeze_test_udev_types)
+EFL_START_TEST(eeze_test_udev_types)
{
Eina_List *type;
- eeze_init();
-
type = eeze_udev_find_by_type(EEZE_UDEV_TYPE_NONE, NULL);
type = eeze_udev_find_unlisted_similar(type);
type = eeze_udev_find_by_type(EEZE_UDEV_TYPE_KEYBOARD, NULL);
@@ -54,18 +52,14 @@ START_TEST(eeze_test_udev_types)
type = eeze_udev_find_by_type(0, NULL);
type = eeze_udev_find_unlisted_similar(type);
- eeze_shutdown();
}
-END_TEST
+EFL_END_TEST
#endif
-START_TEST(eeze_test_udev_watch)
+EFL_START_TEST(eeze_test_udev_watch)
{
Eeze_Udev_Watch *watch;
- ecore_init();
- eeze_init();
-
/* watch never gets triggered as this is run without user interaction */
watch = eeze_udev_watch_add(EEZE_UDEV_TYPE_KEYBOARD, (EEZE_UDEV_EVENT_ADD | EEZE_UDEV_EVENT_REMOVE), catch_events, NULL);
watch = eeze_udev_watch_add(EEZE_UDEV_TYPE_DRIVE_INTERNAL, (EEZE_UDEV_EVENT_ADD | EEZE_UDEV_EVENT_REMOVE), catch_events, NULL);
@@ -77,20 +71,15 @@ START_TEST(eeze_test_udev_watch)
watch = eeze_udev_watch_add(EEZE_UDEV_TYPE_GPIO, (EEZE_UDEV_EVENT_ADD | EEZE_UDEV_EVENT_REMOVE), catch_events, NULL);
watch = eeze_udev_watch_add(EEZE_UDEV_TYPE_NONE, (EEZE_UDEV_EVENT_ADD | EEZE_UDEV_EVENT_REMOVE), catch_events, NULL);
eeze_udev_watch_del(watch);
-
- eeze_shutdown();
- ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eeze_test_udev_syspath)
+EFL_START_TEST(eeze_test_udev_syspath)
{
Eina_List *type, *l;
const char *name;
Eina_Bool r;
- eeze_init();
-
type = eeze_udev_find_by_type(EEZE_UDEV_TYPE_KEYBOARD, NULL);
type = eeze_udev_find_unlisted_similar(type);
EINA_LIST_FOREACH(type, l, name)
@@ -147,18 +136,14 @@ START_TEST(eeze_test_udev_syspath)
}
eeze_udev_devpath_get_syspath("/dev/null");
-
- eeze_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eeze_test_udev_attr)
+EFL_START_TEST(eeze_test_udev_attr)
{
Eina_List *type;
const char *name, *check, *check2;
- eeze_init();
-
type = eeze_udev_find_by_type(EEZE_UDEV_TYPE_DRIVE_INTERNAL, NULL);
type = eeze_udev_find_unlisted_similar(type);
eeze_udev_find_by_filter("backlight", NULL, NULL);
@@ -203,20 +188,16 @@ START_TEST(eeze_test_udev_attr)
}
eina_stringshare_del(name);
}
-
- eeze_shutdown();
}
-END_TEST
+EFL_END_TEST
/*
-START_TEST(eeze_test_udev_device)
+EFL_START_TEST(eeze_test_udev_device)
{
Eina_List *type, *l;
_udev_device *device, *device2;
const char *name;
- eeze_init();
-
type = eeze_udev_find_by_type(EEZE_UDEV_TYPE_DRIVE_INTERNAL, NULL);
fail_if(type == NULL);
type = eeze_udev_find_unlisted_similar(type);
@@ -236,10 +217,8 @@ START_TEST(eeze_test_udev_device)
device2 = _copy_device(device);
fail_if(device2 != NULL);
-
- eeze_shutdown();
}
-END_TEST
+EFL_END_TEST
*/
void eeze_test_udev(TCase *tc)
diff --git a/src/tests/efl/efl_suite.c b/src/tests/efl/efl_suite.c
index 82cc6dfb32..d8aea76759 100644
--- a/src/tests/efl/efl_suite.c
+++ b/src/tests/efl/efl_suite.c
@@ -20,7 +20,7 @@
# include "config.h"
#endif
-#include <Eina.h>
+#include <Ecore.h>
#include "efl_suite.h"
#include "../efl_check.h"
@@ -31,6 +31,16 @@ static const Efl_Test_Case etc[] = {
{ NULL, NULL }
};
+SUITE_INIT(efl)
+{
+ ck_assert_int_eq(ecore_init(), 1);
+}
+
+SUITE_SHUTDOWN(efl)
+{
+ ck_assert_int_eq(ecore_shutdown(), 0);
+}
+
int
main(int argc, char **argv)
{
@@ -44,7 +54,7 @@ main(int argc, char **argv)
eina_init();
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
- "Efl", etc);
+ "Efl", etc, SUITE_INIT_FN(efl), SUITE_SHUTDOWN_FN(efl));
eina_shutdown();
diff --git a/src/tests/efl/efl_suite.h b/src/tests/efl/efl_suite.h
index b142037425..4c2ff15f19 100644
--- a/src/tests/efl/efl_suite.h
+++ b/src/tests/efl/efl_suite.h
@@ -20,7 +20,7 @@
#define EFL_SUITE_H_
#include <check.h>
-
+#include "../efl_check.h"
void efl_test_case_model_container(TCase *tc);
void efl_test_case_model_composite_boolean(TCase *tc);
diff --git a/src/tests/efl/efl_test_model_composite.c b/src/tests/efl/efl_test_model_composite.c
index 175adee339..bbc21bfac2 100644
--- a/src/tests/efl/efl_test_model_composite.c
+++ b/src/tests/efl/efl_test_model_composite.c
@@ -25,165 +25,90 @@
#include <Efl.h>
#include <Ecore.h>
-typedef struct _Test_Data
-{
- Eina_Bool success_flag;
- unsigned int child_count;
-} Test_Data;
-
-typedef struct _Test_Child_Data
-{
- Test_Data *tdata;
- unsigned int idx;
-} Test_Child_Data;
-
const int child_number = 3;
const int base_ints[] = { 41, 42, 43 };
const Eina_Bool base_selections[] = { EINA_FALSE, EINA_FALSE, EINA_TRUE };
-static void
-_future_error_then(void *data EINA_UNUSED, Efl_Event const* event EINA_UNUSED)
-{
- fprintf(stderr, "Promise failed!\n"); fflush(stderr);
- ck_abort_msg("Promise failed");
-}
-
-static void
-_property_get_then(void *data, Efl_Event const *event)
+static Eina_Value
+_children_slice_get_then(void *data EINA_UNUSED,
+ const Eina_Value v,
+ const Eina_Future *dead_future EINA_UNUSED)
{
- Test_Child_Data *t = data;
- Eina_Accessor *value_itt = (Eina_Accessor*)((Efl_Future_Event_Success*)event->info)->value;
- int v_int = 0;
- Eina_Bool v_bool = EINA_FALSE;
-
-#define _value_get_and_compare(it, i, var, cmp) \
- do { \
- Eina_Value *vvv = NULL; \
- if (!eina_accessor_data_get(it, i, (void **)&vvv) || !vvv || \
- !eina_value_get(vvv, &var) || var != cmp) \
- { \
- fprintf(stderr, "Could not get value!\n"); fflush(stderr); \
- ck_abort_msg("Could not get value"); \
- return; \
- } \
- } while(0)
-
- _value_get_and_compare(value_itt, 0, v_int, base_ints[t->idx]);
- _value_get_and_compare(value_itt, 1, v_bool, EINA_TRUE);
- _value_get_and_compare(value_itt, 2, v_bool, EINA_FALSE);
-
- t->tdata->child_count++;
- if (t->tdata->child_count == 3)
- t->tdata->success_flag = EINA_TRUE;
-
-#undef _value_get_and_compare
-}
-
-static void
-_selection_property_get_then(void *data, Efl_Event const *event)
-{
- Test_Child_Data *t = data;
- Eina_Accessor *value_itt = (Eina_Accessor*)((Efl_Future_Event_Success*)event->info)->value;
- int v_int = 0;
- Eina_Bool v_bool = EINA_FALSE;
-
-
-#define EFL_TEST_value_get_and_compare(it, i, var, cmp) \
- do { \
- Eina_Value *vvv = NULL; \
- if (!eina_accessor_data_get(it, i, (void **)&vvv) || !vvv || \
- !eina_value_get(vvv, &var)) \
- { \
- fprintf(stderr, "Could not get value!\n"); fflush(stderr); \
- ck_abort_msg("Could not get value"); \
- return; \
- } \
- else if(var != cmp) \
- { \
- fprintf(stderr, "Value did not match!\n"); fflush(stderr); \
- ck_abort_msg("Value did not match"); \
- return; \
- } \
- else \
- fprintf(stderr, "Value matched\n"); fflush(stderr); \
- } while(0)
-
- EFL_TEST_value_get_and_compare(value_itt, 0, v_bool, base_selections[t->idx]);
- EFL_TEST_value_get_and_compare(value_itt, 1, v_int, base_ints[t->idx]);
-
- t->tdata->child_count++;
- if (t->tdata->child_count == 3)
- t->tdata->success_flag = EINA_TRUE;
-
-#undef EFL_TEST_value_get_and_compare
-}
-
-static void
-_children_slice_get_then(void *data, Efl_Event const* event)
-{
- Eina_Accessor *children = (Eina_Accessor *)((Efl_Future_Event_Success*)event->info)->value;
+ unsigned int i, len;
Efl_Model *child;
- Test_Child_Data *t;
- unsigned int i = 0;
- EINA_ACCESSOR_FOREACH(children, i, child)
- {
- Efl_Future *futures[3] = {NULL,};
- Efl_Future *future_all = NULL;
+ fail_if(eina_value_type_get(&v) != EINA_VALUE_TYPE_ARRAY);
- futures[0] = efl_model_property_get(child, "test_p_int");
- futures[1] = efl_model_property_get(child, "test_p_true");
- futures[2] = efl_model_property_get(child, "test_p_false");
+ EINA_VALUE_ARRAY_FOREACH(&v, len, i, child)
+ {
+ Eina_Value *p_int = NULL;
+ Eina_Value *p_true = NULL;
+ Eina_Value *p_false = NULL;
+ int v_int = 0;
+ Eina_Bool v_true = EINA_FALSE;
+ Eina_Bool v_false = EINA_TRUE;
+
+ p_int = efl_model_property_get(child, "test_p_int");
+ p_true = efl_model_property_get(child, "test_p_true");
+ p_false = efl_model_property_get(child, "test_p_false");
+
+ eina_value_get(p_int, &v_int);
+ eina_value_get(p_true, &v_true);
+ eina_value_get(p_false, &v_false);
+
+ fail_if(v_int != base_ints[i]);
+ fail_if(v_true != EINA_TRUE);
+ fail_if(v_false != EINA_FALSE);
+ }
- future_all = efl_future_all(futures[0], futures[1], futures[2]);
+ ecore_main_loop_quit();
- t = calloc(1, sizeof(Test_Child_Data));
- t->tdata = data;
- t->idx = i;
- efl_future_then(future_all, _property_get_then, _future_error_then, NULL, t);
- }
+ return v;
}
-static void
-_selection_children_slice_get_then(void *data, Efl_Event const* event)
+static Eina_Value
+_selection_children_slice_get_then(void *data EINA_UNUSED,
+ const Eina_Value v,
+ const Eina_Future *dead_future EINA_UNUSED)
{
- Eina_Accessor *children = (Eina_Accessor *)((Efl_Future_Event_Success*)event->info)->value;
- Efl_Model *child;
- Test_Child_Data *t;
- unsigned int i = 0;
+ unsigned int i, len;
+ Efl_Model *child = NULL;
- EINA_ACCESSOR_FOREACH(children, i, child)
+ fail_if(eina_value_type_get(&v) != EINA_VALUE_TYPE_ARRAY);
+
+ EINA_VALUE_ARRAY_FOREACH(&v, len, i, child)
{
- Efl_Future *futures[2] = {NULL,};
- Efl_Future *future_all = NULL;
+ Eina_Value *p_int = NULL;
+ Eina_Value *p_bool = NULL;
+ int v_int = 0;
+ Eina_Bool v_bool = EINA_FALSE;
- futures[0] = efl_model_property_get(child, "selected");
- futures[1] = efl_model_property_get(child, "test_p_int");
+ p_bool = efl_model_property_get(child, "selected");
+ p_int = efl_model_property_get(child, "test_p_int");
- future_all = efl_future_all(futures[0], futures[1]);
+ eina_value_get(p_bool, &v_bool);
+ eina_value_get(p_int, &v_int);
- t = calloc(1, sizeof(Test_Child_Data));
- t->tdata = data;
- t->idx = i;
- efl_future_then(future_all, _selection_property_get_then, _future_error_then, NULL, t);
+ fail_if(v_bool != base_selections[i]);
+ fail_if(v_int != base_ints[i]);
}
+
+ ecore_main_loop_quit();
+
+ return v;
}
-START_TEST(efl_test_model_composite_boolean)
+EFL_START_TEST(efl_test_model_composite_boolean)
{
Efl_Model_Item *base_model, *child;
int i;
Eina_Value v;
Efl_Model_Composite_Boolean *model;
- Test_Data *tdata;
- Efl_Future *future;
-
- fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n");
- fail_if(!efl_object_init(), "ERROR: Cannot init EO!\n");
+ Eina_Future *future;
eina_value_setup(&v, EINA_VALUE_TYPE_INT);
- base_model = efl_add(EFL_MODEL_ITEM_CLASS, NULL);
+ base_model = efl_add_ref(EFL_MODEL_ITEM_CLASS, efl_main_loop_get());
ck_assert(!!base_model);
for (i = 0; i < child_number; ++i)
@@ -194,39 +119,39 @@ START_TEST(efl_test_model_composite_boolean)
efl_model_property_set(child, "test_p_int", &v);
}
- model = efl_add(EFL_MODEL_COMPOSITE_BOOLEAN_CLASS, NULL,
+ model = efl_add_ref(EFL_MODEL_COMPOSITE_BOOLEAN_CLASS, efl_main_loop_get(),
efl_ui_view_model_set(efl_added, base_model),
- efl_model_composite_boolean_property_add(efl_added, "test_p_true", EINA_TRUE),
- efl_model_composite_boolean_property_add(efl_added, "test_p_false", EINA_FALSE));
+ efl_model_composite_boolean_add(efl_added, "test_p_true", EINA_TRUE),
+ efl_model_composite_boolean_add(efl_added, "test_p_false", EINA_FALSE));
ck_assert(!!model);
- tdata = calloc(1, sizeof(Test_Data));
- future = efl_model_children_slice_get(model, 0, 0);
- efl_future_then(future, _children_slice_get_then, _future_error_then, NULL, tdata);
-
- while (!tdata->success_flag) ecore_main_loop_iterate();
+ future = efl_model_children_slice_get(model, 0, efl_model_children_count_get(model));
+ eina_future_then(future, _children_slice_get_then, NULL);
- ck_assert(tdata->success_flag);
+ ecore_main_loop_begin();
+}
+EFL_END_TEST
- ecore_shutdown();
+static Eina_Value
+_wait_propagate(void *data EINA_UNUSED,
+ const Eina_Value v,
+ const Eina_Future *dead_future EINA_UNUSED)
+{
+ ecore_main_loop_quit();
+ return v;
}
-END_TEST
-START_TEST(efl_test_model_composite_selection)
+EFL_START_TEST(efl_test_model_composite_selection)
{
Efl_Model_Item *base_model, *child;
int i;
Eina_Value v;
Efl_Model_Composite_Selection *model;
- Test_Data *tdata;
- Efl_Future *future;
-
- fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n");
- fail_if(!efl_object_init(), "ERROR: Cannot init EO!\n");
+ Eina_Future *future;
eina_value_setup(&v, EINA_VALUE_TYPE_INT);
- base_model = efl_add(EFL_MODEL_ITEM_CLASS, NULL);
+ base_model = efl_add_ref(EFL_MODEL_ITEM_CLASS, efl_main_loop_get());
ck_assert(!!base_model);
for (i = 0; i < child_number; ++i)
@@ -237,22 +162,19 @@ START_TEST(efl_test_model_composite_selection)
efl_model_property_set(child, "test_p_int", &v);
}
- model = efl_add(EFL_MODEL_COMPOSITE_SELECTION_CLASS, NULL,
+ model = efl_add_ref(EFL_MODEL_COMPOSITE_SELECTION_CLASS, efl_main_loop_get(),
efl_ui_view_model_set(efl_added, base_model));
ck_assert(!!model);
- efl_model_composite_selection_select(model, 2);
-
- tdata = calloc(1, sizeof(Test_Data));
- future = efl_model_children_slice_get(model, 0, 0);
- efl_future_then(future, _selection_children_slice_get_then, _future_error_then, NULL, tdata);
-
- while (!tdata->success_flag) ecore_main_loop_iterate();
+ future = efl_model_property_set(model, "selected", eina_value_int_new(2));
+ eina_future_then(future, _wait_propagate, NULL);
+ ecore_main_loop_begin();
- ck_assert(tdata->success_flag);
+ future = efl_model_children_slice_get(model, 0, efl_model_children_count_get(model));
+ eina_future_then(future, _selection_children_slice_get_then, NULL);
- ecore_shutdown();
+ ecore_main_loop_begin();
}
-END_TEST
+EFL_END_TEST
void
efl_test_case_model_composite_boolean(TCase *tc)
diff --git a/src/tests/efl/efl_test_model_container.c b/src/tests/efl/efl_test_model_container.c
index bfd1984d4d..0ccd34167a 100644
--- a/src/tests/efl/efl_test_model_container.c
+++ b/src/tests/efl/efl_test_model_container.c
@@ -25,102 +25,61 @@
#include <Efl.h>
#include <Ecore.h>
-typedef struct _Test_Container_Data {
- int item_count;
- Eina_Bool pass_flag;
- Eina_Bool fail_flag;
-} Test_Container_Data;
-
typedef struct _Test_Container_Item_Data {
- Test_Container_Data* test_data;
unsigned int index;
} Test_Container_Item_Data;
const int base_int[7] = {10, 11, 12, 13, 14, 0, 16};
const char * const base_str[7] = {"A", "B", "C", "D", "E", "", "GH"};
-static void
-_future_error_then(void *data EINA_UNUSED, Efl_Event const* event EINA_UNUSED)
+static Eina_Value
+_children_slice_future_then(void *data EINA_UNUSED,
+ const Eina_Value v, const Eina_Future *dead_future EINA_UNUSED)
{
- ck_abort_msg("Promise failed");
-}
+ unsigned int i, len;
+ Efl_Model *child = NULL;
-static void
-_container_property_get_then(void *data, Efl_Event const *event)
-{
- Eina_Accessor *value_itt = (Eina_Accessor*)((Efl_Future_Event_Success*)event->info)->value;
- Test_Container_Item_Data *test_item_data = data;
- Eina_Value *value_int = NULL;
- Eina_Value *value_str = NULL;
- int cmp_int = 0;
- const char *cmp_str = NULL;
+ fail_if(eina_value_type_get(&v) != EINA_VALUE_TYPE_ARRAY);
- test_item_data->test_data->item_count++;
-
- if (!value_itt || !eina_accessor_data_get(value_itt, 0, (void**)&value_int) ||
- !eina_accessor_data_get(value_itt, 1, (void**)&value_str))
+ EINA_VALUE_ARRAY_FOREACH(&v, len, i, child)
{
- test_item_data->test_data->fail_flag = EINA_TRUE;
- ecore_main_loop_quit();
- return;
- }
+ Eina_Value *value_int = NULL;
+ Eina_Value *value_str = NULL;
+ const char *cmp_str = NULL;
+ int cmp_int = 0;
- eina_value_get(value_int, &cmp_int);
- eina_value_get(value_str, &cmp_str);
+ value_int = efl_model_property_get(child, "test_p_int");
+ value_str = efl_model_property_get(child, "test_p_str");
- if (cmp_int != base_int[test_item_data->index] ||
- strcmp(cmp_str, base_str[test_item_data->index]) != 0)
- {
- test_item_data->test_data->fail_flag = EINA_TRUE;
- }
-
- if (test_item_data->test_data->item_count == 7)
- {
- test_item_data->test_data->pass_flag = EINA_TRUE;
- }
- ecore_main_loop_quit();
-}
+ fail_if(eina_value_type_get(value_int) != EINA_VALUE_TYPE_INT);
+ fail_if(eina_value_type_get(value_str) != EINA_VALUE_TYPE_STRING);
-static void
-_children_slice_future_then(void *data, Efl_Event const *event)
-{
- Eina_Accessor *children_accessor = (Eina_Accessor *)((Efl_Future_Event_Success*)event->info)->value;
- unsigned int i = 0;
- Efl_Model *child;
+ eina_value_get(value_int, &cmp_int);
+ eina_value_get(value_str, &cmp_str);
- if (children_accessor)
- {
- EINA_ACCESSOR_FOREACH(children_accessor, i, child)
- {
- Efl_Future *futures[3] = {NULL,};
- Efl_Future *future_all = NULL;
- Test_Container_Item_Data *test_item_data = calloc(1, sizeof(Test_Container_Item_Data));
+ if (cmp_int != base_int[i] ||
+ strcmp(cmp_str, base_str[i]) != 0)
+ {
+ abort();
+ }
+ }
+ fprintf(stderr, "len: %i\n", len);
- test_item_data->test_data = data;
- test_item_data->index = i;
+ fail_if(len != 7);
- futures[0] = efl_model_property_get(child, "test_p_int");
- futures[1] = efl_model_property_get(child, "test_p_str");
+ ecore_main_loop_quit();
- future_all = efl_future_all(futures[0], futures[1]);
- efl_future_then(future_all, _container_property_get_then, _future_error_then, NULL, test_item_data);
- }
- }
+ return v;
}
-
-START_TEST(efl_test_model_container_values)
+EFL_START_TEST(efl_test_model_container_values)
{
Efl_Model_Container* model;
- Efl_Future *future;
- Test_Container_Data test_data;
+ Eina_Future *future;
int **cmp_int;
const char **cmp_str;
int i;
- fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n");
- fail_if(!efl_object_init(), "ERROR: Cannot init EO!\n");
-
cmp_int = calloc(8, sizeof(int*));
cmp_str = calloc(8, sizeof(const char*));
for (i = 0; i < 7; ++i)
@@ -130,7 +89,7 @@ START_TEST(efl_test_model_container_values)
cmp_str[i] = strdup(base_str[i]);
}
- model = efl_add(EFL_MODEL_CONTAINER_CLASS, NULL);
+ model = efl_add_ref(EFL_MODEL_CONTAINER_CLASS, NULL);
efl_model_container_child_property_add(model, "test_p_int", EINA_VALUE_TYPE_INT,
eina_carray_iterator_new((void**)cmp_int));
@@ -146,22 +105,13 @@ START_TEST(efl_test_model_container_values)
free(cmp_int);
free(cmp_str);
- future = efl_model_children_slice_get(model, 0, 0);
-
- test_data.item_count = 0;
- test_data.pass_flag = EINA_FALSE;
- test_data.fail_flag = EINA_FALSE;
-
- efl_future_then(future, _children_slice_future_then, _future_error_then, NULL, &test_data);
-
- while ((!test_data.pass_flag) && (!test_data.fail_flag)) ecore_main_loop_iterate();
+ future = efl_model_children_slice_get(model, 0, efl_model_children_count_get(model));
- ck_assert(!!test_data.pass_flag);
- ck_assert(!test_data.fail_flag);
+ eina_future_then(future, _children_slice_future_then, NULL);
- ecore_shutdown();
+ ecore_main_loop_begin();
}
-END_TEST
+EFL_END_TEST
void
diff --git a/src/tests/efl_check.h b/src/tests/efl_check.h
index a7d39b6bd7..0e655541ab 100644
--- a/src/tests/efl_check.h
+++ b/src/tests/efl_check.h
@@ -1,11 +1,51 @@
#ifndef EFL_CHECK_H
#define EFL_CHECK_H
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <stdlib.h> /* getenv */
#include <stdio.h> /* fprintf, fputs */
#include <string.h> /* strcmp */
#include <unistd.h> /* execvp */
#include <errno.h> /* errno */
+#include <sys/time.h>
+
+#ifdef HAVE_FORK
+#include <sys/types.h>
+#include <sys/wait.h>
+#endif
+
+#ifndef EINA_UNUSED
+
+#ifdef __GNUC__
+
+# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
+# define EINA_UNUSED __attribute__ ((__unused__))
+# else
+# define EINA_UNUSED
+# endif
+#else
+# define EINA_UNUSED
+#endif
+
+#endif
+
+#ifdef HAVE_GETTIMEOFDAY
+# if CHECK_MINOR_VERSION >= 11
+# define ENABLE_TIMING_INFO
+# endif
+#endif
+
+#define DISABLE_ABORT_ON_CRITICAL_START \
+ do { \
+ int ___val = eina_log_abort_on_critical_get(); \
+ eina_log_abort_on_critical_set(0)
+
+#define DISABLE_ABORT_ON_CRITICAL_END \
+ eina_log_abort_on_critical_set(___val); \
+ } while (0)
typedef struct _Efl_Test_Case Efl_Test_Case;
struct _Efl_Test_Case
@@ -23,7 +63,7 @@ _efl_tests_list(const Efl_Test_Case *etc)
fprintf(stderr, "\t%s\n", itr->test_case);
}
-static int
+EINA_UNUSED static int
_efl_test_option_disp(int argc, char **argv, const Efl_Test_Case *etc)
{
int i;
@@ -76,7 +116,7 @@ _efl_test_use(int argc, const char **argv, const char *test_case)
return 1;
for (; argc > 0; argc--, argv++)
- if (strcmp(test_case, *argv) == 0)
+ if (strcasecmp(test_case, *argv) == 0)
return 1;
return 0;
}
@@ -92,7 +132,7 @@ _efl_test_fork_has(SRunner *sr)
{
char *res;
- res = getenv("CF_FORK");
+ res = getenv("CK_FORK");
if (res && (strcmp(res, "no") == 0))
return 0;
else
@@ -103,37 +143,204 @@ _efl_test_fork_has(SRunner *sr)
return 0;
}
+#ifdef ENABLE_TIMING_INFO
+EINA_UNUSED static double _timing_start_time;
+
+static int
+_timing_enabled(void)
+{
+ const char *lc = getenv("TIMING_ENABLED");
+ return !!lc;
+}
+
+static double
+_timing_time_get(void)
+{
+ struct timeval timev;
+
+ gettimeofday(&timev, NULL);
+ return (double)timev.tv_sec + (((double)timev.tv_usec) / 1000000);
+}
+
+EINA_UNUSED static void
+_timing_start(void)
+{
+ if (_timing_enabled())
+ _timing_start_time = _timing_time_get();
+}
+
+EINA_UNUSED static void
+_timing_end(void)
+{
+ double diff;
+ static int thres_set = 0;
+ static double thres = 0;
+
+ if (!_timing_enabled()) return;
+ if (!thres_set)
+ {
+ const char *env = getenv("TIME_DIFF_THRESHOLD");
+
+ if (env)
+ {
+ thres = strtod(env, NULL);
+ if (thres > 0)
+ thres_set = 1;
+ }
+ if (!thres_set)
+ thres = 0.0001;
+ thres_set = 1;
+ }
+ diff = _timing_time_get() - _timing_start_time;
+
+ if (diff > thres)
+ printf("TIME %s: %.5g\n", tcase_name(), diff);
+}
+
+# define EFL_START_TEST(TEST_NAME) \
+ START_TEST(TEST_NAME) \
+ _timing_start();
+
+# define EFL_END_TEST \
+ _timing_end(); \
+ END_TEST
+
+#else
+# define EFL_START_TEST(TEST_NAME) START_TEST(TEST_NAME)
+# define EFL_END_TEST END_TEST
+
+#endif
+
static int
-_efl_suite_build_and_run(int argc, const char **argv, const char *suite_name, const Efl_Test_Case *etc)
+_efl_suite_run_end(SRunner *sr, const char *name)
+{
+ int failed_count;
+
+ if (name)
+ {
+ char *n = strdup(name);
+ char buf[4096], *p;
+
+ for (p = n; p[0]; p++)
+ {
+ switch (p[0])
+ {
+ case ' ':
+ case '/':
+ case '\\':
+ case ';':
+ p[0] = '_';
+ break;
+ }
+ }
+ snprintf(buf, sizeof(buf), TESTS_BUILD_DIR "/check-results-%s.xml", n);
+ srunner_set_xml(sr, buf);
+ }
+ else
+ srunner_set_xml(sr, TESTS_BUILD_DIR "/check-results.xml");
+ srunner_run_all(sr, CK_ENV);
+ failed_count = srunner_ntests_failed(sr);
+ srunner_free(sr);
+ return failed_count;
+}
+
+EINA_UNUSED static int
+_efl_suite_build_and_run(int argc, const char **argv, const char *suite_name, const Efl_Test_Case *etc, SFun init, SFun shutdown)
{
Suite *s;
SRunner *sr;
TCase *tc;
- int i, failed_count;
+ int i, failed_count = 0;
+ int do_fork;
+ int num_forks = 0;
+ int can_fork = 0;
+#ifdef ENABLE_TIMING_INFO
+ double tstart, tcstart;
+ int timing = _timing_enabled();
+ if (timing)
+ tcstart = tstart = _timing_time_get();
+#endif
+ fflush(stdout);
s = suite_create(suite_name);
sr = srunner_create(s);
+ do_fork = _efl_test_fork_has(sr);
+ if (do_fork)
+ can_fork = !!etc[1].test_case /* can't parallelize 1 test */;
for (i = 0; etc[i].test_case; ++i)
{
+ int pid = 0;
+
if (!_efl_test_use(argc, argv, etc[i].test_case))
continue;
+#ifdef HAVE_FORK
+ if (do_fork && can_fork)
+ {
+ pid = fork();
+ if (pid > 0)
+ {
+ num_forks++;
+#ifdef ENABLE_TIMING_INFO
+ if (timing)
+ tcstart = _timing_time_get();
+#endif
+ continue;
+ }
+ }
+#endif
tc = tcase_create(etc[i].test_case);
+ if (init || shutdown)
+ tcase_add_checked_fixture(tc, init, shutdown);
- if (_efl_test_fork_has(sr))
+ if (do_fork)
tcase_set_timeout(tc, 0);
etc[i].build(tc);
suite_add_tcase(s, tc);
+#ifdef HAVE_FORK
+ if (do_fork && (!pid) && can_fork)
+ {
+ failed_count = _efl_suite_run_end(sr, etc[i].test_case);
+ if (failed_count > 255)
+ failed_count = 255;
+#ifdef ENABLE_TIMING_INFO
+ if (timing)
+ printf("TC TIME %s: %.5g\n", etc[i].test_case, _timing_time_get() - tcstart);
+#endif
+ exit(failed_count);
+ }
+#endif
}
- srunner_set_xml(sr, TESTS_BUILD_DIR "/check-results.xml");
- srunner_run_all(sr, CK_ENV);
- failed_count = srunner_ntests_failed(sr);
- srunner_free(sr);
+#ifdef HAVE_FORK
+ if (num_forks)
+ {
+ do
+ {
+ int status = 0;
+ waitpid(0, &status, 0);
+ failed_count += WEXITSTATUS(status);
+ } while (--num_forks);
+ }
+ else
+#endif
+ failed_count = _efl_suite_run_end(sr, NULL);
+#ifdef ENABLE_TIMING_INFO
+ if (timing)
+ {
+ printf("SUITE TIME(%u) %s: %.5g\n", getpid(), suite_name, _timing_time_get() - tstart);
+ fflush(stdout);
+ }
+#endif
return failed_count;
}
+#define SUITE_INIT(NAME) static void _##NAME##_suite_init(void)
+#define SUITE_INIT_FN(NAME) _##NAME##_suite_init
+#define SUITE_SHUTDOWN(NAME) static void _##NAME##_suite_shutdown(void)
+#define SUITE_SHUTDOWN_FN(NAME) _##NAME##_suite_shutdown
+
#endif
diff --git a/src/tests/efl_mono/BasicDirection.cs b/src/tests/efl_mono/BasicDirection.cs
new file mode 100644
index 0000000000..5db27a1534
--- /dev/null
+++ b/src/tests/efl_mono/BasicDirection.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Runtime.InteropServices;
+using System.Linq;
+
+namespace TestSuite
+{
+
+class TestIntDirections
+{
+ public static void simple_out()
+ {
+ int original = 1984;
+ int received;
+ test.ITesting t = new test.Testing();
+
+ t.IntOut(original, out received);
+
+ Test.AssertEquals(-original, received);
+ }
+
+ public static void simple_ptr_out()
+ {
+ int original = 1984;
+ int received;
+ test.ITesting t = new test.Testing();
+
+ t.IntPtrOut(original, out received);
+
+ Test.AssertEquals(original*2, received);
+ }
+}
+
+}
+
diff --git a/src/tests/efl_mono/Eina.cs b/src/tests/efl_mono/Eina.cs
index bd2d2976b9..f1e1dc49ff 100644
--- a/src/tests/efl_mono/Eina.cs
+++ b/src/tests/efl_mono/Eina.cs
@@ -28,55 +28,55 @@ public static class BaseData
public static readonly string[] append_seq_str = {"42","43","33"};
public static readonly string[] modified_seq_str = {"0x0","0x2A","0x42","42","43","33"};
- public static test.Numberwrapper NW(int n)
+ public static test.INumberwrapper NW(int n)
{
- var nw = new test.NumberwrapperConcrete();
+ var nw = new test.Numberwrapper();
nw.SetNumber(n);
return nw;
}
- public static test.Numberwrapper[] BaseSeqObj()
+ public static test.INumberwrapper[] BaseSeqObj()
{
- var a = new test.NumberwrapperConcrete();
- var b = new test.NumberwrapperConcrete();
- var c = new test.NumberwrapperConcrete();
+ var a = new test.Numberwrapper();
+ var b = new test.Numberwrapper();
+ var c = new test.Numberwrapper();
a.SetNumber(0x0);
b.SetNumber(0x2A);
c.SetNumber(0x42);
- return new test.NumberwrapperConcrete[]{a,b,c};
+ return new test.INumberwrapper[]{a,b,c};
}
public static test.Numberwrapper[] AppendSeqObj()
{
- var a = new test.NumberwrapperConcrete();
- var b = new test.NumberwrapperConcrete();
- var c = new test.NumberwrapperConcrete();
+ var a = new test.Numberwrapper();
+ var b = new test.Numberwrapper();
+ var c = new test.Numberwrapper();
a.SetNumber(42);
b.SetNumber(43);
c.SetNumber(33);
- return new test.NumberwrapperConcrete[]{a,b,c};
+ return new test.Numberwrapper[]{a,b,c};
}
public static test.Numberwrapper[] ModifiedSeqObj()
{
- var a = new test.NumberwrapperConcrete();
- var b = new test.NumberwrapperConcrete();
- var c = new test.NumberwrapperConcrete();
- var d = new test.NumberwrapperConcrete();
- var e = new test.NumberwrapperConcrete();
- var f = new test.NumberwrapperConcrete();
+ var a = new test.Numberwrapper();
+ var b = new test.Numberwrapper();
+ var c = new test.Numberwrapper();
+ var d = new test.Numberwrapper();
+ var e = new test.Numberwrapper();
+ var f = new test.Numberwrapper();
a.SetNumber(0x0);
b.SetNumber(0x2A);
c.SetNumber(0x42);
d.SetNumber(42);
e.SetNumber(43);
f.SetNumber(33);
- return new test.NumberwrapperConcrete[]{a,b,c,d,e,f};
+ return new test.Numberwrapper[]{a,b,c,d,e,f};
}
public static void NumberwrapperSequenceAssertEqual(
- test.Numberwrapper[] a
- , test.Numberwrapper[] b
+ test.INumberwrapper[] a
+ , test.INumberwrapper[] b
, [CallerLineNumber] int line = 0
, [CallerFilePath] string file = null
, [CallerMemberName] string member = null)
@@ -430,7 +430,7 @@ class TestEinaBinbuf
public static void test_eina_binbuf_in()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var binbuf = new eina.Binbuf(base_seq, (uint)base_seq.Length);
Test.Assert(t.EinaBinbufIn(binbuf));
Test.Assert(binbuf.Own);
@@ -441,7 +441,7 @@ class TestEinaBinbuf
public static void test_eina_binbuf_in_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var binbuf = new eina.Binbuf(base_seq, (uint)base_seq.Length);
Test.Assert(t.EinaBinbufInOwn(binbuf));
Test.Assert(!binbuf.Own);
@@ -453,7 +453,7 @@ class TestEinaBinbuf
public static void test_eina_binbuf_out()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
eina.Binbuf binbuf;
Test.Assert(t.EinaBinbufOut(out binbuf));
Test.Assert(!binbuf.Own);
@@ -467,7 +467,7 @@ class TestEinaBinbuf
public static void test_eina_binbuf_out_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
eina.Binbuf binbuf;
Test.Assert(t.EinaBinbufOutOwn(out binbuf));
Test.Assert(binbuf.Own);
@@ -480,7 +480,7 @@ class TestEinaBinbuf
public static void test_eina_binbuf_return()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var binbuf = t.EinaBinbufReturn();
Test.Assert(!binbuf.Own);
Test.Assert(binbuf.GetBytes().SequenceEqual(new byte[]{33}));
@@ -493,7 +493,7 @@ class TestEinaBinbuf
public static void test_eina_binbuf_return_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var binbuf = t.EinaBinbufReturnOwn();
Test.Assert(binbuf.Own);
Test.Assert(binbuf.GetBytes().SequenceEqual(new byte[]{33}));
@@ -616,7 +616,7 @@ class TestEinaSlice
public static void test_eina_slice_in()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var slc = new eina.Slice(pinnedPtr, (UIntPtr)3);
Test.Assert(t.EinaSliceIn(slc));
}
@@ -629,7 +629,7 @@ class TestEinaSlice
var slc = new eina.Rw_Slice(ptr, (UIntPtr)3);
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
Test.Assert(t.EinaRwSliceIn(slc));
Test.Assert(slc.GetBytes().SequenceEqual(new byte[3]{0x1,0x2B,0x43}));
@@ -639,7 +639,7 @@ class TestEinaSlice
public static void test_eina_slice_out()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var slc = new eina.Slice();
Test.Assert(t.EinaSliceOut(ref slc));
Test.Assert(slc.Mem != IntPtr.Zero);
@@ -649,7 +649,7 @@ class TestEinaSlice
public static void test_eina_rw_slice_out()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var slc = new eina.Rw_Slice();
Test.Assert(t.EinaRwSliceOut(ref slc));
Test.Assert(slc.Mem != IntPtr.Zero);
@@ -741,9 +741,9 @@ class TestEinaArray
public static void push_obj()
{
- var a = new eina.Array<test.NumberwrapperConcrete>();
+ var a = new eina.Array<test.INumberwrapper>();
Test.Assert(a.Handle != IntPtr.Zero);
- var o = new test.NumberwrapperConcrete();
+ var o = new test.Numberwrapper();
o.SetNumber(88);
Test.Assert(a.Push(o));
Test.Assert(a[0].raw_handle == o.raw_handle);
@@ -770,9 +770,9 @@ class TestEinaArray
public static void pop_obj()
{
- var a = new eina.Array<test.NumberwrapperConcrete>();
+ var a = new eina.Array<test.INumberwrapper>();
Test.Assert(a.Handle != IntPtr.Zero);
- var o = new test.NumberwrapperConcrete();
+ var o = new test.Numberwrapper();
o.SetNumber(88);
Test.Assert(a.Push(o));
var p = a.Pop();
@@ -807,24 +807,24 @@ class TestEinaArray
public static void data_set_obj()
{
- var a = new eina.Array<test.NumberwrapperConcrete>();
+ var a = new eina.Array<test.INumberwrapper>();
Test.Assert(a.Handle != IntPtr.Zero);
- var o1 = new test.NumberwrapperConcrete();
+ var o1 = new test.Numberwrapper();
o1.SetNumber(88);
Test.Assert(a.Push(o1));
Test.Assert(a[0].raw_handle == o1.raw_handle);
Test.Assert(a[0].GetNumber() == 88);
- var o2 = new test.NumberwrapperConcrete();
+ var o2 = new test.Numberwrapper();
o2.SetNumber(44);
a.DataSet(0, o2);
Test.Assert(a[0].raw_handle == o2.raw_handle);
Test.Assert(a[0].GetNumber() == 44);
- var o3 = new test.NumberwrapperConcrete();
+ var o3 = new test.Numberwrapper();
o3.SetNumber(22);
a[0] = o3;
@@ -866,26 +866,26 @@ class TestEinaArray
public static void count_obj()
{
- var a = new eina.Array<test.NumberwrapperConcrete>();
+ var a = new eina.Array<test.INumberwrapper>();
Test.Assert(a.Handle != IntPtr.Zero);
Test.Assert(a.Count() == 0);
- var o1 = new test.NumberwrapperConcrete();
+ var o1 = new test.Numberwrapper();
o1.SetNumber(88);
Test.Assert(a.Push(o1));
Test.Assert(a[0].raw_handle == o1.raw_handle);
Test.Assert(a[0].GetNumber() == 88);
Test.Assert(a.Count() == 1);
- var o2 = new test.NumberwrapperConcrete();
+ var o2 = new test.Numberwrapper();
o2.SetNumber(44);
Test.Assert(a.Push(o2));
Test.Assert(a[1].raw_handle == o2.raw_handle);
Test.Assert(a[1].GetNumber() == 44);
Test.Assert(a.Count() == 2);
- var o3 = new test.NumberwrapperConcrete();
+ var o3 = new test.Numberwrapper();
o3.SetNumber(22);
Test.Assert(a.Push(o3));
Test.Assert(a[2].raw_handle == o3.raw_handle);
@@ -959,22 +959,22 @@ class TestEinaArray
public static void eina_array_as_ienumerable_obj()
{
- var a = new test.NumberwrapperConcrete();
- var b = new test.NumberwrapperConcrete();
- var c = new test.NumberwrapperConcrete();
+ var a = new test.Numberwrapper();
+ var b = new test.Numberwrapper();
+ var c = new test.Numberwrapper();
a.SetNumber(88);
b.SetNumber(44);
c.SetNumber(22);
- var cmp = new test.NumberwrapperConcrete[]{a,b,c};
+ var cmp = new test.Numberwrapper[]{a,b,c};
- var arr = new eina.Array<test.NumberwrapperConcrete>();
+ var arr = new eina.Array<test.INumberwrapper>();
Test.Assert(arr.Handle != IntPtr.Zero);
Test.Assert(arr.Push(a));
Test.Assert(arr.Push(b));
Test.Assert(arr.Push(c));
int i = 0;
- foreach (test.NumberwrapperConcrete e in arr)
+ foreach (test.Numberwrapper e in arr)
{
Test.AssertEquals(cmp[i].GetNumber(), e.GetNumber());
Test.Assert(cmp[i].raw_handle == e.raw_handle);
@@ -990,7 +990,7 @@ class TestEinaArray
public static void test_eina_array_int_in()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var arr = new eina.Array<int>();
arr.Append(base_seq_int);
Test.Assert(t.EinaArrayIntIn(arr));
@@ -1002,7 +1002,7 @@ class TestEinaArray
public static void test_eina_array_int_in_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var arr = new eina.Array<int>();
arr.Append(base_seq_int);
Test.Assert(t.EinaArrayIntInOwn(arr));
@@ -1015,7 +1015,7 @@ class TestEinaArray
public static void test_eina_array_int_out()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
eina.Array<int> arr;
Test.Assert(t.EinaArrayIntOut(out arr));
Test.Assert(!arr.Own);
@@ -1028,7 +1028,7 @@ class TestEinaArray
public static void test_eina_array_int_out_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
eina.Array<int> arr;
Test.Assert(t.EinaArrayIntOutOwn(out arr));
Test.Assert(arr.Own);
@@ -1040,7 +1040,7 @@ class TestEinaArray
public static void test_eina_array_int_return()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var arr = t.EinaArrayIntReturn();
Test.Assert(!arr.Own);
Test.Assert(arr.ToArray().SequenceEqual(base_seq_int));
@@ -1052,7 +1052,7 @@ class TestEinaArray
public static void test_eina_array_int_return_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var arr = t.EinaArrayIntReturnOwn();
Test.Assert(arr.Own);
Test.Assert(arr.ToArray().SequenceEqual(base_seq_int));
@@ -1064,7 +1064,7 @@ class TestEinaArray
// String //
public static void test_eina_array_str_in()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var arr = new eina.Array<string>();
arr.Append(base_seq_str);
Test.Assert(t.EinaArrayStrIn(arr));
@@ -1076,7 +1076,7 @@ class TestEinaArray
public static void test_eina_array_str_in_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var arr = new eina.Array<string>();
arr.Append(base_seq_str);
Test.Assert(t.EinaArrayStrInOwn(arr));
@@ -1089,7 +1089,7 @@ class TestEinaArray
public static void test_eina_array_str_out()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
eina.Array<string> arr;
Test.Assert(t.EinaArrayStrOut(out arr));
Test.Assert(!arr.Own);
@@ -1102,7 +1102,7 @@ class TestEinaArray
public static void test_eina_array_str_out_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
eina.Array<string> arr;
Test.Assert(t.EinaArrayStrOutOwn(out arr));
Test.Assert(arr.Own);
@@ -1114,7 +1114,7 @@ class TestEinaArray
public static void test_eina_array_str_return()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var arr = t.EinaArrayStrReturn();
Test.Assert(!arr.Own);
Test.Assert(arr.ToArray().SequenceEqual(base_seq_str));
@@ -1126,7 +1126,7 @@ class TestEinaArray
public static void test_eina_array_str_return_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var arr = t.EinaArrayStrReturnOwn();
Test.Assert(arr.Own);
Test.Assert(arr.ToArray().SequenceEqual(base_seq_str));
@@ -1139,8 +1139,8 @@ class TestEinaArray
public static void test_eina_array_obj_in()
{
- test.Testing t = new test.TestingConcrete();
- var arr = new eina.Array<test.Numberwrapper>();
+ test.ITesting t = new test.Testing();
+ var arr = new eina.Array<test.INumberwrapper>();
arr.Append(BaseSeqObj());
Test.Assert(t.EinaArrayObjIn(arr));
Test.Assert(arr.Own);
@@ -1151,8 +1151,8 @@ class TestEinaArray
public static void test_eina_array_obj_in_own()
{
- test.Testing t = new test.TestingConcrete();
- var arr = new eina.Array<test.Numberwrapper>();
+ test.ITesting t = new test.Testing();
+ var arr = new eina.Array<test.INumberwrapper>();
arr.Append(BaseSeqObj());
Test.Assert(t.EinaArrayObjInOwn(arr));
Test.Assert(!arr.Own);
@@ -1164,8 +1164,8 @@ class TestEinaArray
public static void test_eina_array_obj_out()
{
- test.Testing t = new test.TestingConcrete();
- eina.Array<test.Numberwrapper> arr;
+ test.ITesting t = new test.Testing();
+ eina.Array<test.INumberwrapper> arr;
Test.Assert(t.EinaArrayObjOut(out arr));
Test.Assert(!arr.Own);
NumberwrapperSequenceAssertEqual(arr.ToArray(), BaseSeqObj());
@@ -1177,8 +1177,8 @@ class TestEinaArray
public static void test_eina_array_obj_out_own()
{
- test.Testing t = new test.TestingConcrete();
- eina.Array<test.Numberwrapper> arr;
+ test.ITesting t = new test.Testing();
+ eina.Array<test.INumberwrapper> arr;
Test.Assert(t.EinaArrayObjOutOwn(out arr));
Test.Assert(arr.Own);
NumberwrapperSequenceAssertEqual(arr.ToArray(), BaseSeqObj());
@@ -1189,7 +1189,7 @@ class TestEinaArray
public static void test_eina_array_obj_return()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var arr = t.EinaArrayObjReturn();
Test.Assert(!arr.Own);
NumberwrapperSequenceAssertEqual(arr.ToArray(), BaseSeqObj());
@@ -1201,7 +1201,7 @@ class TestEinaArray
public static void test_eina_array_obj_return_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var arr = t.EinaArrayObjReturnOwn();
Test.Assert(arr.Own);
NumberwrapperSequenceAssertEqual(arr.ToArray(), BaseSeqObj());
@@ -1212,9 +1212,9 @@ class TestEinaArray
public static void test_eina_array_obj_return_in_same_id()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var cmp = BaseSeqObj();
- var a = new eina.Array<test.Numberwrapper>();
+ var a = new eina.Array<test.INumberwrapper>();
a.Append(cmp);
var b = t.EinaArrayObjReturnIn(a);
NumberwrapperSequenceAssertEqual(a.ToArray(), b.ToArray());
@@ -1262,9 +1262,9 @@ class TestEinaInarray
public static void push_obj()
{
- var a = new eina.Inarray<test.NumberwrapperConcrete>();
+ var a = new eina.Inarray<test.INumberwrapper>();
Test.Assert(a.Handle != IntPtr.Zero);
- var o = new test.NumberwrapperConcrete();
+ var o = new test.Numberwrapper();
o.SetNumber(88);
Test.Assert(a.Push(o) == 0);
Test.Assert(a[0].raw_handle == o.raw_handle);
@@ -1294,9 +1294,9 @@ class TestEinaInarray
public static void pop_obj()
{
- var a = new eina.Inarray<test.NumberwrapperConcrete>();
+ var a = new eina.Inarray<test.INumberwrapper>();
Test.Assert(a.Handle != IntPtr.Zero);
- var o = new test.NumberwrapperConcrete();
+ var o = new test.Numberwrapper();
o.SetNumber(88);
Test.Assert(a.Push(o) >= 0);
var p = a.Pop();
@@ -1338,17 +1338,17 @@ class TestEinaInarray
public static void replace_at_obj()
{
- var a = new eina.Inarray<test.NumberwrapperConcrete>();
+ var a = new eina.Inarray<test.INumberwrapper>();
Test.Assert(a.Handle != IntPtr.Zero);
- var o1 = new test.NumberwrapperConcrete();
+ var o1 = new test.Numberwrapper();
o1.SetNumber(88);
Test.Assert(a.Push(o1) >= 0);
Test.Assert(a[0].raw_handle == o1.raw_handle);
Test.Assert(a[0].GetNumber() == 88);
- var o2 = new test.NumberwrapperConcrete();
+ var o2 = new test.Numberwrapper();
o2.SetNumber(44);
a.ReplaceAt(0, o2);
@@ -1356,7 +1356,7 @@ class TestEinaInarray
Test.Assert(a[0].GetNumber() == 44);
Test.Assert(a.Count() == 1);
- var o3 = new test.NumberwrapperConcrete();
+ var o3 = new test.Numberwrapper();
o3.SetNumber(22);
a[0] = o3;
@@ -1403,26 +1403,26 @@ class TestEinaInarray
public static void count_obj()
{
- var a = new eina.Inarray<test.NumberwrapperConcrete>();
+ var a = new eina.Inarray<test.INumberwrapper>();
Test.Assert(a.Handle != IntPtr.Zero);
Test.Assert(a.Count() == 0);
- var o1 = new test.NumberwrapperConcrete();
+ var o1 = new test.Numberwrapper();
o1.SetNumber(88);
Test.Assert(a.Push(o1) == 0);
Test.Assert(a[0].raw_handle == o1.raw_handle);
Test.Assert(a[0].GetNumber() == 88);
Test.Assert(a.Count() == 1);
- var o2 = new test.NumberwrapperConcrete();
+ var o2 = new test.Numberwrapper();
o2.SetNumber(44);
Test.Assert(a.Push(o2) == 1);
Test.Assert(a[1].raw_handle == o2.raw_handle);
Test.Assert(a[1].GetNumber() == 44);
Test.Assert(a.Count() == 2);
- var o3 = new test.NumberwrapperConcrete();
+ var o3 = new test.Numberwrapper();
o3.SetNumber(22);
Test.Assert(a.Push(o3) == 2);
Test.Assert(a[2].raw_handle == o3.raw_handle);
@@ -1502,22 +1502,22 @@ class TestEinaInarray
public static void eina_inarray_as_ienumerable_obj()
{
- var a = new test.NumberwrapperConcrete();
- var b = new test.NumberwrapperConcrete();
- var c = new test.NumberwrapperConcrete();
+ var a = new test.Numberwrapper();
+ var b = new test.Numberwrapper();
+ var c = new test.Numberwrapper();
a.SetNumber(88);
b.SetNumber(44);
c.SetNumber(22);
- var cmp = new test.NumberwrapperConcrete[]{a,b,c};
+ var cmp = new test.Numberwrapper[]{a,b,c};
- var arr = new eina.Inarray<test.NumberwrapperConcrete>();
+ var arr = new eina.Inarray<test.INumberwrapper>();
Test.Assert(arr.Handle != IntPtr.Zero);
Test.Assert(arr.Push(a) == 0);
Test.Assert(arr.Push(b) == 1);
Test.Assert(arr.Push(c) == 2);
int i = 0;
- foreach (test.NumberwrapperConcrete e in arr)
+ foreach (test.Numberwrapper e in arr)
{
Test.AssertEquals(cmp[i].GetNumber(), e.GetNumber());
Test.Assert(cmp[i].raw_handle == e.raw_handle);
@@ -1534,7 +1534,7 @@ class TestEinaInarray
public static void test_eina_inarray_int_in()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var arr = new eina.Inarray<int>();
arr.Append(base_seq_int);
Test.Assert(t.EinaInarrayIntIn(arr));
@@ -1546,7 +1546,7 @@ class TestEinaInarray
public static void test_eina_inarray_int_in_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var arr = new eina.Inarray<int>();
arr.Append(base_seq_int);
Test.Assert(t.EinaInarrayIntInOwn(arr));
@@ -1559,7 +1559,7 @@ class TestEinaInarray
public static void test_eina_inarray_int_out()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
eina.Inarray<int> arr;
Test.Assert(t.EinaInarrayIntOut(out arr));
Test.Assert(!arr.Own);
@@ -1572,7 +1572,7 @@ class TestEinaInarray
public static void test_eina_inarray_int_out_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
eina.Inarray<int> arr;
Test.Assert(t.EinaInarrayIntOutOwn(out arr));
Test.Assert(arr.Own);
@@ -1584,7 +1584,7 @@ class TestEinaInarray
public static void test_eina_inarray_int_return()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var arr = t.EinaInarrayIntReturn();
Test.Assert(!arr.Own);
Test.Assert(arr.ToArray().SequenceEqual(base_seq_int));
@@ -1596,7 +1596,7 @@ class TestEinaInarray
public static void test_eina_inarray_int_return_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var arr = t.EinaInarrayIntReturnOwn();
Test.Assert(arr.Own);
Test.Assert(arr.ToArray().SequenceEqual(base_seq_int));
@@ -1608,7 +1608,7 @@ class TestEinaInarray
// String //
public static void test_eina_inarray_str_in()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var arr = new eina.Inarray<string>();
arr.Append(base_seq_str);
Test.Assert(t.EinaInarrayStrIn(arr));
@@ -1620,7 +1620,7 @@ class TestEinaInarray
public static void test_eina_inarray_str_in_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var arr = new eina.Inarray<string>();
arr.Append(base_seq_str);
Test.Assert(t.EinaInarrayStrInOwn(arr));
@@ -1633,7 +1633,7 @@ class TestEinaInarray
public static void test_eina_inarray_str_out()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
eina.Inarray<string> arr;
Test.Assert(t.EinaInarrayStrOut(out arr));
Test.Assert(!arr.Own);
@@ -1646,7 +1646,7 @@ class TestEinaInarray
public static void test_eina_inarray_str_out_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
eina.Inarray<string> arr;
Test.Assert(t.EinaInarrayStrOutOwn(out arr));
Test.Assert(arr.Own);
@@ -1658,7 +1658,7 @@ class TestEinaInarray
public static void test_eina_inarray_str_return()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var arr = t.EinaInarrayStrReturn();
Test.Assert(!arr.Own);
Test.Assert(arr.ToArray().SequenceEqual(base_seq_str));
@@ -1670,7 +1670,7 @@ class TestEinaInarray
public static void test_eina_inarray_str_return_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var arr = t.EinaInarrayStrReturnOwn();
Test.Assert(arr.Own);
Test.Assert(arr.ToArray().SequenceEqual(base_seq_str));
@@ -1683,8 +1683,8 @@ class TestEinaInarray
public static void test_eina_inarray_obj_in()
{
- test.Testing t = new test.TestingConcrete();
- var arr = new eina.Inarray<test.Numberwrapper>();
+ test.ITesting t = new test.Testing();
+ var arr = new eina.Inarray<test.INumberwrapper>();
arr.Append(BaseSeqObj());
Test.Assert(t.EinaInarrayObjIn(arr));
Test.Assert(arr.Own);
@@ -1695,8 +1695,8 @@ class TestEinaInarray
public static void test_eina_inarray_obj_in_own()
{
- test.Testing t = new test.TestingConcrete();
- var arr = new eina.Inarray<test.Numberwrapper>();
+ test.ITesting t = new test.Testing();
+ var arr = new eina.Inarray<test.INumberwrapper>();
arr.Append(BaseSeqObj());
Test.Assert(t.EinaInarrayObjInOwn(arr));
Test.Assert(!arr.Own);
@@ -1708,8 +1708,8 @@ class TestEinaInarray
public static void test_eina_inarray_obj_out()
{
- test.Testing t = new test.TestingConcrete();
- eina.Inarray<test.Numberwrapper> arr;
+ test.ITesting t = new test.Testing();
+ eina.Inarray<test.INumberwrapper> arr;
Test.Assert(t.EinaInarrayObjOut(out arr));
Test.Assert(!arr.Own);
NumberwrapperSequenceAssertEqual(arr.ToArray(), BaseSeqObj());
@@ -1721,8 +1721,8 @@ class TestEinaInarray
public static void test_eina_inarray_obj_out_own()
{
- test.Testing t = new test.TestingConcrete();
- eina.Inarray<test.Numberwrapper> arr;
+ test.ITesting t = new test.Testing();
+ eina.Inarray<test.INumberwrapper> arr;
Test.Assert(t.EinaInarrayObjOutOwn(out arr));
Test.Assert(arr.Own);
NumberwrapperSequenceAssertEqual(arr.ToArray(), BaseSeqObj());
@@ -1733,7 +1733,7 @@ class TestEinaInarray
public static void test_eina_inarray_obj_return()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var arr = t.EinaInarrayObjReturn();
Test.Assert(!arr.Own);
NumberwrapperSequenceAssertEqual(arr.ToArray(), BaseSeqObj());
@@ -1745,7 +1745,7 @@ class TestEinaInarray
public static void test_eina_inarray_obj_return_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var arr = t.EinaInarrayObjReturnOwn();
Test.Assert(arr.Own);
NumberwrapperSequenceAssertEqual(arr.ToArray(), BaseSeqObj());
@@ -1756,9 +1756,9 @@ class TestEinaInarray
public static void test_eina_inarray_obj_return_in_same_id()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var cmp = BaseSeqObj();
- var a = new eina.Inarray<test.Numberwrapper>();
+ var a = new eina.Inarray<test.INumberwrapper>();
a.Append(cmp);
var b = t.EinaInarrayObjReturnIn(a);
NumberwrapperSequenceAssertEqual(a.ToArray(), b.ToArray());
@@ -1799,23 +1799,23 @@ class TestEinaList
public static void data_set_obj()
{
- var lst = new eina.List<test.NumberwrapperConcrete>();
+ var lst = new eina.List<test.INumberwrapper>();
- var o1 = new test.NumberwrapperConcrete();
+ var o1 = new test.Numberwrapper();
o1.SetNumber(88);
lst.Append(o1);
Test.Assert(lst[0].raw_handle == o1.raw_handle);
Test.Assert(lst[0].GetNumber() == 88);
- var o2 = new test.NumberwrapperConcrete();
+ var o2 = new test.Numberwrapper();
o2.SetNumber(44);
lst.DataSet(0, o2);
Test.Assert(lst[0].raw_handle == o2.raw_handle);
Test.Assert(lst[0].GetNumber() == 44);
- var o3 = new test.NumberwrapperConcrete();
+ var o3 = new test.Numberwrapper();
o3.SetNumber(22);
lst[0] = o3;
@@ -1855,25 +1855,25 @@ class TestEinaList
public static void append_count_obj()
{
- var lst = new eina.List<test.NumberwrapperConcrete>();
+ var lst = new eina.List<test.INumberwrapper>();
Test.Assert(lst.Count() == 0);
- var o1 = new test.NumberwrapperConcrete();
+ var o1 = new test.Numberwrapper();
o1.SetNumber(88);
lst.Append(o1);
Test.Assert(lst[0].raw_handle == o1.raw_handle);
Test.Assert(lst[0].GetNumber() == 88);
Test.Assert(lst.Count() == 1);
- var o2 = new test.NumberwrapperConcrete();
+ var o2 = new test.Numberwrapper();
o2.SetNumber(44);
lst.Append(o2);
Test.Assert(lst[1].raw_handle == o2.raw_handle);
Test.Assert(lst[1].GetNumber() == 44);
Test.Assert(lst.Count() == 2);
- var o3 = new test.NumberwrapperConcrete();
+ var o3 = new test.Numberwrapper();
o3.SetNumber(22);
lst.Append(o3);
Test.Assert(lst[2].raw_handle == o3.raw_handle);
@@ -1943,25 +1943,25 @@ class TestEinaList
public static void prepend_count_obj()
{
- var lst = new eina.List<test.NumberwrapperConcrete>();
+ var lst = new eina.List<test.INumberwrapper>();
Test.Assert(lst.Count() == 0);
- var o1 = new test.NumberwrapperConcrete();
+ var o1 = new test.Numberwrapper();
o1.SetNumber(88);
lst.Prepend(o1);
Test.Assert(lst[0].raw_handle == o1.raw_handle);
Test.Assert(lst[0].GetNumber() == 88);
Test.Assert(lst.Count() == 1);
- var o2 = new test.NumberwrapperConcrete();
+ var o2 = new test.Numberwrapper();
o2.SetNumber(44);
lst.Prepend(o2);
Test.Assert(lst[0].raw_handle == o2.raw_handle);
Test.Assert(lst[0].GetNumber() == 44);
Test.Assert(lst.Count() == 2);
- var o3 = new test.NumberwrapperConcrete();
+ var o3 = new test.Numberwrapper();
o3.SetNumber(22);
lst.Prepend(o3);
Test.Assert(lst[0].raw_handle == o3.raw_handle);
@@ -2073,21 +2073,21 @@ class TestEinaList
public static void eina_list_as_ienumerable_obj()
{
- var a = new test.NumberwrapperConcrete();
- var b = new test.NumberwrapperConcrete();
- var c = new test.NumberwrapperConcrete();
+ var a = new test.Numberwrapper();
+ var b = new test.Numberwrapper();
+ var c = new test.Numberwrapper();
a.SetNumber(88);
b.SetNumber(44);
c.SetNumber(22);
- var cmp = new test.NumberwrapperConcrete[]{a,b,c};
+ var cmp = new test.Numberwrapper[]{a,b,c};
- var lst = new eina.List<test.NumberwrapperConcrete>();
+ var lst = new eina.List<test.INumberwrapper>();
lst.Append(a);
lst.Append(b);
lst.Append(c);
int i = 0;
- foreach (test.NumberwrapperConcrete e in lst)
+ foreach (test.Numberwrapper e in lst)
{
Test.AssertEquals(cmp[i].GetNumber(), e.GetNumber());
Test.Assert(cmp[i].raw_handle == e.raw_handle);
@@ -2103,7 +2103,7 @@ class TestEinaList
public static void test_eina_list_int_in()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var lst = new eina.List<int>();
lst.AppendArray(base_seq_int);
Test.Assert(t.EinaListIntIn(lst));
@@ -2115,7 +2115,7 @@ class TestEinaList
public static void test_eina_list_int_in_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var lst = new eina.List<int>();
lst.AppendArray(base_seq_int);
Test.Assert(t.EinaListIntInOwn(lst));
@@ -2127,7 +2127,7 @@ class TestEinaList
public static void test_eina_list_int_out()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
eina.List<int> lst;
Test.Assert(t.EinaListIntOut(out lst));
Test.Assert(!lst.Own);
@@ -2139,7 +2139,7 @@ class TestEinaList
public static void test_eina_list_int_out_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
eina.List<int> lst;
Test.Assert(t.EinaListIntOutOwn(out lst));
Test.Assert(lst.Own);
@@ -2151,7 +2151,7 @@ class TestEinaList
public static void test_eina_list_int_return()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var lst = t.EinaListIntReturn();
Test.Assert(!lst.Own);
Test.Assert(lst.ToArray().SequenceEqual(base_seq_int));
@@ -2162,7 +2162,7 @@ class TestEinaList
public static void test_eina_list_int_return_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var lst = t.EinaListIntReturnOwn();
Test.Assert(lst.Own);
Test.Assert(lst.ToArray().SequenceEqual(base_seq_int));
@@ -2174,7 +2174,7 @@ class TestEinaList
// String //
public static void test_eina_list_str_in()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var lst = new eina.List<string>();
lst.AppendArray(base_seq_str);
Test.Assert(t.EinaListStrIn(lst));
@@ -2186,7 +2186,7 @@ class TestEinaList
public static void test_eina_list_str_in_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var lst = new eina.List<string>();
lst.AppendArray(base_seq_str);
Test.Assert(t.EinaListStrInOwn(lst));
@@ -2198,7 +2198,7 @@ class TestEinaList
public static void test_eina_list_str_out()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
eina.List<string> lst;
Test.Assert(t.EinaListStrOut(out lst));
Test.Assert(!lst.Own);
@@ -2210,7 +2210,7 @@ class TestEinaList
public static void test_eina_list_str_out_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
eina.List<string> lst;
Test.Assert(t.EinaListStrOutOwn(out lst));
Test.Assert(lst.Own);
@@ -2222,7 +2222,7 @@ class TestEinaList
public static void test_eina_list_str_return()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var lst = t.EinaListStrReturn();
Test.Assert(!lst.Own);
Test.Assert(lst.ToArray().SequenceEqual(base_seq_str));
@@ -2233,7 +2233,7 @@ class TestEinaList
public static void test_eina_list_str_return_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var lst = t.EinaListStrReturnOwn();
Test.Assert(lst.Own);
Test.Assert(lst.ToArray().SequenceEqual(base_seq_str));
@@ -2246,8 +2246,8 @@ class TestEinaList
public static void test_eina_list_obj_in()
{
- test.Testing t = new test.TestingConcrete();
- var lst = new eina.List<test.Numberwrapper>();
+ test.ITesting t = new test.Testing();
+ var lst = new eina.List<test.INumberwrapper>();
lst.AppendArray(BaseSeqObj());
Test.Assert(t.EinaListObjIn(lst));
Test.Assert(lst.Own);
@@ -2258,8 +2258,8 @@ class TestEinaList
public static void test_eina_list_obj_in_own()
{
- test.Testing t = new test.TestingConcrete();
- var lst = new eina.List<test.Numberwrapper>();
+ test.ITesting t = new test.Testing();
+ var lst = new eina.List<test.INumberwrapper>();
lst.AppendArray(BaseSeqObj());
Test.Assert(t.EinaListObjInOwn(lst));
Test.Assert(!lst.Own);
@@ -2270,8 +2270,8 @@ class TestEinaList
public static void test_eina_list_obj_out()
{
- test.Testing t = new test.TestingConcrete();
- eina.List<test.Numberwrapper> lst;
+ test.ITesting t = new test.Testing();
+ eina.List<test.INumberwrapper> lst;
Test.Assert(t.EinaListObjOut(out lst));
Test.Assert(!lst.Own);
NumberwrapperSequenceAssertEqual(lst.ToArray(), BaseSeqObj());
@@ -2282,8 +2282,8 @@ class TestEinaList
public static void test_eina_list_obj_out_own()
{
- test.Testing t = new test.TestingConcrete();
- eina.List<test.Numberwrapper> lst;
+ test.ITesting t = new test.Testing();
+ eina.List<test.INumberwrapper> lst;
Test.Assert(t.EinaListObjOutOwn(out lst));
Test.Assert(lst.Own);
NumberwrapperSequenceAssertEqual(lst.ToArray(), BaseSeqObj());
@@ -2294,7 +2294,7 @@ class TestEinaList
public static void test_eina_list_obj_return()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var lst = t.EinaListObjReturn();
Test.Assert(!lst.Own);
NumberwrapperSequenceAssertEqual(lst.ToArray(), BaseSeqObj());
@@ -2305,7 +2305,7 @@ class TestEinaList
public static void test_eina_list_obj_return_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var lst = t.EinaListObjReturnOwn();
Test.Assert(lst.Own);
NumberwrapperSequenceAssertEqual(lst.ToArray(), BaseSeqObj());
@@ -2316,9 +2316,9 @@ class TestEinaList
public static void test_eina_list_obj_return_in_same_id()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var cmp = BaseSeqObj();
- var a = new eina.List<test.Numberwrapper>();
+ var a = new eina.List<test.INumberwrapper>();
a.AppendArray(cmp);
var b = t.EinaListObjReturnIn(a);
NumberwrapperSequenceAssertEqual(a.ToArray(), b.ToArray());
@@ -2360,23 +2360,23 @@ class TestEinaInlist
public static void data_set_obj()
{
- var lst = new eina.Inlist<test.NumberwrapperConcrete>();
+ var lst = new eina.Inlist<test.INumberwrapper>();
- var o1 = new test.NumberwrapperConcrete();
+ var o1 = new test.Numberwrapper();
o1.SetNumber(88);
lst.Append(o1);
Test.Assert(lst[0].raw_handle == o1.raw_handle);
Test.Assert(lst[0].GetNumber() == 88);
- var o2 = new test.NumberwrapperConcrete();
+ var o2 = new test.Numberwrapper();
o2.SetNumber(44);
lst.DataSet(0, o2);
Test.Assert(lst[0].raw_handle == o2.raw_handle);
Test.Assert(lst[0].GetNumber() == 44);
- var o3 = new test.NumberwrapperConcrete();
+ var o3 = new test.Numberwrapper();
o3.SetNumber(22);
lst[0] = o3;
@@ -2418,25 +2418,25 @@ class TestEinaInlist
public static void append_count_obj()
{
- var lst = new eina.Inlist<test.NumberwrapperConcrete>();
+ var lst = new eina.Inlist<test.INumberwrapper>();
Test.Assert(lst.Count() == 0);
- var o1 = new test.NumberwrapperConcrete();
+ var o1 = new test.Numberwrapper();
o1.SetNumber(88);
lst.Append(o1);
Test.Assert(lst[0].raw_handle == o1.raw_handle);
Test.Assert(lst[0].GetNumber() == 88);
Test.Assert(lst.Count() == 1);
- var o2 = new test.NumberwrapperConcrete();
+ var o2 = new test.Numberwrapper();
o2.SetNumber(44);
lst.Append(o2);
Test.Assert(lst[1].raw_handle == o2.raw_handle);
Test.Assert(lst[1].GetNumber() == 44);
Test.Assert(lst.Count() == 2);
- var o3 = new test.NumberwrapperConcrete();
+ var o3 = new test.Numberwrapper();
o3.SetNumber(22);
lst.Append(o3);
Test.Assert(lst[2].raw_handle == o3.raw_handle);
@@ -2506,25 +2506,25 @@ class TestEinaInlist
public static void prepend_count_obj()
{
- var lst = new eina.Inlist<test.NumberwrapperConcrete>();
+ var lst = new eina.Inlist<test.INumberwrapper>();
Test.Assert(lst.Count() == 0);
- var o1 = new test.NumberwrapperConcrete();
+ var o1 = new test.Numberwrapper();
o1.SetNumber(88);
lst.Prepend(o1);
Test.Assert(lst[0].raw_handle == o1.raw_handle);
Test.Assert(lst[0].GetNumber() == 88);
Test.Assert(lst.Count() == 1);
- var o2 = new test.NumberwrapperConcrete();
+ var o2 = new test.Numberwrapper();
o2.SetNumber(44);
lst.Prepend(o2);
Test.Assert(lst[0].raw_handle == o2.raw_handle);
Test.Assert(lst[0].GetNumber() == 44);
Test.Assert(lst.Count() == 2);
- var o3 = new test.NumberwrapperConcrete();
+ var o3 = new test.Numberwrapper();
o3.SetNumber(22);
lst.Prepend(o3);
Test.Assert(lst[0].raw_handle == o3.raw_handle);
@@ -2564,21 +2564,21 @@ class TestEinaInlist
public static void eina_inlist_as_ienumerable_obj()
{
- var a = new test.NumberwrapperConcrete();
- var b = new test.NumberwrapperConcrete();
- var c = new test.NumberwrapperConcrete();
+ var a = new test.Numberwrapper();
+ var b = new test.Numberwrapper();
+ var c = new test.Numberwrapper();
a.SetNumber(88);
b.SetNumber(44);
c.SetNumber(22);
- var cmp = new test.NumberwrapperConcrete[]{a,b,c};
+ var cmp = new test.Numberwrapper[]{a,b,c};
- var lst = new eina.Inlist<test.NumberwrapperConcrete>();
+ var lst = new eina.Inlist<test.INumberwrapper>();
lst.Append(a);
lst.Append(b);
lst.Append(c);
int i = 0;
- foreach (test.NumberwrapperConcrete e in lst)
+ foreach (test.Numberwrapper e in lst)
{
Test.AssertEquals(cmp[i].GetNumber(), e.GetNumber());
Test.Assert(cmp[i].raw_handle == e.raw_handle);
@@ -2594,7 +2594,7 @@ class TestEinaInlist
public static void test_eina_inlist_int_in()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var lst = new eina.Inlist<int>();
lst.AppendArray(base_seq_int);
Test.Assert(t.EinaInlistIntIn(lst));
@@ -2606,7 +2606,7 @@ class TestEinaInlist
public static void test_eina_inlist_int_in_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var lst = new eina.Inlist<int>();
lst.AppendArray(base_seq_int);
Test.Assert(t.EinaInlistIntInOwn(lst));
@@ -2618,7 +2618,7 @@ class TestEinaInlist
public static void test_eina_inlist_int_out()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
eina.Inlist<int> lst;
Test.Assert(t.EinaInlistIntOut(out lst));
Test.Assert(!lst.Own);
@@ -2630,7 +2630,7 @@ class TestEinaInlist
public static void test_eina_inlist_int_out_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
eina.Inlist<int> lst;
Test.Assert(t.EinaInlistIntOutOwn(out lst));
Test.Assert(lst.Own);
@@ -2642,7 +2642,7 @@ class TestEinaInlist
public static void test_eina_inlist_int_return()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var lst = t.EinaInlistIntReturn();
Test.Assert(!lst.Own);
Test.Assert(lst.ToArray().SequenceEqual(base_seq_int));
@@ -2653,7 +2653,7 @@ class TestEinaInlist
public static void test_eina_inlist_int_return_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var lst = t.EinaInlistIntReturnOwn();
Test.Assert(lst.Own);
Test.Assert(lst.ToArray().SequenceEqual(base_seq_int));
@@ -2665,7 +2665,7 @@ class TestEinaInlist
// String //
public static void test_eina_inlist_str_in()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var lst = new eina.Inlist<string>();
lst.AppendArray(base_seq_str);
Test.Assert(t.EinaInlistStrIn(lst));
@@ -2677,7 +2677,7 @@ class TestEinaInlist
public static void test_eina_inlist_str_in_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var lst = new eina.Inlist<string>();
lst.AppendArray(base_seq_str);
Test.Assert(t.EinaInlistStrInOwn(lst));
@@ -2689,7 +2689,7 @@ class TestEinaInlist
public static void test_eina_inlist_str_out()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
eina.Inlist<string> lst;
Test.Assert(t.EinaInlistStrOut(out lst));
Test.Assert(!lst.Own);
@@ -2701,7 +2701,7 @@ class TestEinaInlist
public static void test_eina_inlist_str_out_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
eina.Inlist<string> lst;
Test.Assert(t.EinaInlistStrOutOwn(out lst));
Test.Assert(lst.Own);
@@ -2713,7 +2713,7 @@ class TestEinaInlist
public static void test_eina_inlist_str_return()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var lst = t.EinaInlistStrReturn();
Test.Assert(!lst.Own);
Test.Assert(lst.ToArray().SequenceEqual(base_seq_str));
@@ -2724,7 +2724,7 @@ class TestEinaInlist
public static void test_eina_inlist_str_return_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var lst = t.EinaInlistStrReturnOwn();
Test.Assert(lst.Own);
Test.Assert(lst.ToArray().SequenceEqual(base_seq_str));
@@ -2737,8 +2737,8 @@ class TestEinaInlist
public static void test_eina_inlist_obj_in()
{
- test.Testing t = new test.TestingConcrete();
- var lst = new eina.Inlist<test.Numberwrapper>();
+ test.ITesting t = new test.Testing();
+ var lst = new eina.Inlist<test.INumberwrapper>();
lst.AppendArray(BaseSeqObj());
Test.Assert(t.EinaInlistObjIn(lst));
Test.Assert(lst.Own);
@@ -2749,8 +2749,8 @@ class TestEinaInlist
public static void test_eina_inlist_obj_in_own()
{
- test.Testing t = new test.TestingConcrete();
- var lst = new eina.Inlist<test.Numberwrapper>();
+ test.ITesting t = new test.Testing();
+ var lst = new eina.Inlist<test.INumberwrapper>();
lst.AppendArray(BaseSeqObj());
Test.Assert(t.EinaInlistObjInOwn(lst));
Test.Assert(!lst.Own);
@@ -2761,8 +2761,8 @@ class TestEinaInlist
public static void test_eina_inlist_obj_out()
{
- test.Testing t = new test.TestingConcrete();
- eina.Inlist<test.Numberwrapper> lst;
+ test.ITesting t = new test.Testing();
+ eina.Inlist<test.INumberwrapper> lst;
Test.Assert(t.EinaInlistObjOut(out lst));
Test.Assert(!lst.Own);
NumberwrapperSequenceAssertEqual(lst.ToArray(), BaseSeqObj());
@@ -2773,8 +2773,8 @@ class TestEinaInlist
public static void test_eina_inlist_obj_out_own()
{
- test.Testing t = new test.TestingConcrete();
- eina.Inlist<test.Numberwrapper> lst;
+ test.ITesting t = new test.Testing();
+ eina.Inlist<test.INumberwrapper> lst;
Test.Assert(t.EinaInlistObjOutOwn(out lst));
Test.Assert(lst.Own);
NumberwrapperSequenceAssertEqual(lst.ToArray(), BaseSeqObj());
@@ -2785,7 +2785,7 @@ class TestEinaInlist
public static void test_eina_inlist_obj_return()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var lst = t.EinaInlistObjReturn();
Test.Assert(!lst.Own);
NumberwrapperSequenceAssertEqual(lst.ToArray(), BaseSeqObj());
@@ -2796,7 +2796,7 @@ class TestEinaInlist
public static void test_eina_inlist_obj_return_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var lst = t.EinaInlistObjReturnOwn();
Test.Assert(lst.Own);
NumberwrapperSequenceAssertEqual(lst.ToArray(), BaseSeqObj());
@@ -2807,9 +2807,9 @@ class TestEinaInlist
public static void test_eina_inlist_obj_return_in_same_id()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var cmp = BaseSeqObj();
- var a = new eina.Inlist<test.Numberwrapper>();
+ var a = new eina.Inlist<test.INumberwrapper>();
a.AppendArray(cmp);
var b = t.EinaInlistObjReturnIn(a);
NumberwrapperSequenceAssertEqual(a.ToArray(), b.ToArray());
@@ -2868,7 +2868,7 @@ class TestEinaHash
public static void data_set_obj()
{
- var hsh = new eina.Hash<test.Numberwrapper, test.Numberwrapper>();
+ var hsh = new eina.Hash<test.INumberwrapper, test.INumberwrapper>();
Test.Assert(hsh.Count == 0);
var a = NW(22);
@@ -2955,8 +2955,8 @@ class TestEinaHash
public static void eina_hash_as_ienumerable_obj()
{
- var hsh = new eina.Hash<test.Numberwrapper, test.Numberwrapper>();
- var dct = new Dictionary<int, test.Numberwrapper>();
+ var hsh = new eina.Hash<test.INumberwrapper, test.INumberwrapper>();
+ var dct = new Dictionary<int, test.INumberwrapper>();
var a = NW(22);
var aa = NW(222);
@@ -2975,7 +2975,7 @@ class TestEinaHash
int count = 0;
- foreach (KeyValuePair<test.Numberwrapper, test.Numberwrapper> kvp in hsh)
+ foreach (KeyValuePair<test.INumberwrapper, test.INumberwrapper> kvp in hsh)
{
Test.Assert(dct[kvp.Key.GetNumber()].raw_handle == kvp.Value.raw_handle);
Test.Assert(dct[kvp.Key.GetNumber()].GetNumber() == kvp.Value.GetNumber());
@@ -2997,7 +2997,7 @@ class TestEinaHash
public static void test_eina_hash_int_in()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var hsh = new eina.Hash<int,int>();
hsh[22] = 222;
Test.Assert(t.EinaHashIntIn(hsh));
@@ -3010,7 +3010,7 @@ class TestEinaHash
public static void test_eina_hash_int_in_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var hsh = new eina.Hash<int,int>();
hsh[22] = 222;
Test.Assert(t.EinaHashIntInOwn(hsh));
@@ -3025,7 +3025,7 @@ class TestEinaHash
public static void test_eina_hash_int_out()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
eina.Hash<int,int> hsh;
Test.Assert(t.EinaHashIntOut(out hsh));
Test.Assert(!hsh.Own);
@@ -3039,7 +3039,7 @@ class TestEinaHash
public static void test_eina_hash_int_out_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
eina.Hash<int,int> hsh;
Test.Assert(t.EinaHashIntOutOwn(out hsh));
Test.Assert(hsh.Own);
@@ -3053,7 +3053,7 @@ class TestEinaHash
public static void test_eina_hash_int_return()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var hsh = t.EinaHashIntReturn();
Test.Assert(!hsh.Own);
Test.Assert(hsh[22] == 222);
@@ -3066,7 +3066,7 @@ class TestEinaHash
public static void test_eina_hash_int_return_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var hsh = t.EinaHashIntReturnOwn();
Test.Assert(hsh.Own);
Test.Assert(hsh[22] == 222);
@@ -3081,7 +3081,7 @@ class TestEinaHash
public static void test_eina_hash_str_in()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var hsh = new eina.Hash<string,string>();
hsh["aa"] = "aaa";
Test.Assert(t.EinaHashStrIn(hsh));
@@ -3094,7 +3094,7 @@ class TestEinaHash
public static void test_eina_hash_str_in_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var hsh = new eina.Hash<string,string>();
hsh["aa"] = "aaa";
Test.Assert(t.EinaHashStrInOwn(hsh));
@@ -3109,7 +3109,7 @@ class TestEinaHash
public static void test_eina_hash_str_out()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
eina.Hash<string,string> hsh;
Test.Assert(t.EinaHashStrOut(out hsh));
Test.Assert(!hsh.Own);
@@ -3123,7 +3123,7 @@ class TestEinaHash
public static void test_eina_hash_str_out_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
eina.Hash<string,string> hsh;
Test.Assert(t.EinaHashStrOutOwn(out hsh));
Test.Assert(hsh.Own);
@@ -3137,7 +3137,7 @@ class TestEinaHash
public static void test_eina_hash_str_return()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var hsh = t.EinaHashStrReturn();
Test.Assert(!hsh.Own);
Test.Assert(hsh["aa"] == "aaa");
@@ -3150,7 +3150,7 @@ class TestEinaHash
public static void test_eina_hash_str_return_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var hsh = t.EinaHashStrReturnOwn();
Test.Assert(hsh.Own);
Test.Assert(hsh["aa"] == "aaa");
@@ -3165,13 +3165,13 @@ class TestEinaHash
public static void test_eina_hash_obj_in()
{
- test.Testing t = new test.TestingConcrete();
- var hsh = new eina.Hash<test.Numberwrapper,test.Numberwrapper>();
+ test.ITesting t = new test.Testing();
+ var hsh = new eina.Hash<test.INumberwrapper, test.INumberwrapper>();
var nwk1 = NW(22);
var nwv1 = NW(222);
hsh[nwk1] = nwv1;
- test.Numberwrapper nwk2;
- test.Numberwrapper nwv2;
+ test.INumberwrapper nwk2;
+ test.INumberwrapper nwv2;
Test.Assert(t.EinaHashObjIn(hsh, nwk1, nwv1, out nwk2, out nwv2));
Test.Assert(hsh.Own);
Test.Assert(hsh[nwk1].raw_handle == nwv1.raw_handle);
@@ -3186,13 +3186,13 @@ class TestEinaHash
public static void test_eina_hash_obj_in_own()
{
- test.Testing t = new test.TestingConcrete();
- var hsh = new eina.Hash<test.Numberwrapper,test.Numberwrapper>();
+ test.ITesting t = new test.Testing();
+ var hsh = new eina.Hash<test.INumberwrapper, test.INumberwrapper>();
var nwk1 = NW(22);
var nwv1 = NW(222);
hsh[nwk1] = nwv1;
- test.Numberwrapper nwk2;
- test.Numberwrapper nwv2;
+ test.INumberwrapper nwk2;
+ test.INumberwrapper nwv2;
Test.Assert(t.EinaHashObjInOwn(hsh, nwk1, nwv1, out nwk2, out nwv2));
Test.Assert(!hsh.Own);
Test.Assert(hsh[nwk1].raw_handle == nwv1.raw_handle);
@@ -3208,17 +3208,17 @@ class TestEinaHash
public static void test_eina_hash_obj_out()
{
- test.Testing t = new test.TestingConcrete();
- eina.Hash<test.Numberwrapper,test.Numberwrapper> hsh;
- test.Numberwrapper nwk1;
- test.Numberwrapper nwv1;
+ test.ITesting t = new test.Testing();
+ eina.Hash<test.INumberwrapper, test.INumberwrapper> hsh;
+ test.INumberwrapper nwk1;
+ test.INumberwrapper nwv1;
Test.Assert(t.EinaHashObjOut(out hsh, out nwk1, out nwv1));
Test.Assert(!hsh.Own);
Test.Assert(hsh[nwk1].raw_handle == nwv1.raw_handle);
Test.Assert(hsh[nwk1].GetNumber() == nwv1.GetNumber());
Test.Assert(hsh[nwk1].GetNumber() == 222);
- test.Numberwrapper nwk2 = NW(44);
- test.Numberwrapper nwv2 = NW(444);
+ test.INumberwrapper nwk2 = NW(44);
+ test.INumberwrapper nwv2 = NW(444);
hsh[nwk2] = nwv2;
hsh.Dispose();
Test.Assert(hsh.Handle == IntPtr.Zero);
@@ -3227,17 +3227,17 @@ class TestEinaHash
public static void test_eina_hash_obj_out_own()
{
- test.Testing t = new test.TestingConcrete();
- eina.Hash<test.Numberwrapper,test.Numberwrapper> hsh;
- test.Numberwrapper nwk1;
- test.Numberwrapper nwv1;
+ test.ITesting t = new test.Testing();
+ eina.Hash<test.INumberwrapper, test.INumberwrapper> hsh;
+ test.INumberwrapper nwk1;
+ test.INumberwrapper nwv1;
Test.Assert(t.EinaHashObjOutOwn(out hsh, out nwk1, out nwv1));
Test.Assert(hsh.Own);
Test.Assert(hsh[nwk1].raw_handle == nwv1.raw_handle);
Test.Assert(hsh[nwk1].GetNumber() == nwv1.GetNumber());
Test.Assert(hsh[nwk1].GetNumber() == 222);
- test.Numberwrapper nwk2 = NW(44);
- test.Numberwrapper nwv2 = NW(444);
+ test.INumberwrapper nwk2 = NW(44);
+ test.INumberwrapper nwv2 = NW(444);
hsh[nwk2] = nwv2;
hsh.Dispose();
Test.Assert(hsh.Handle == IntPtr.Zero);
@@ -3246,16 +3246,16 @@ class TestEinaHash
public static void test_eina_hash_obj_return()
{
- test.Testing t = new test.TestingConcrete();
- test.Numberwrapper nwk1;
- test.Numberwrapper nwv1;
+ test.ITesting t = new test.Testing();
+ test.INumberwrapper nwk1;
+ test.INumberwrapper nwv1;
var hsh = t.EinaHashObjReturn(out nwk1, out nwv1);
Test.Assert(!hsh.Own);
Test.Assert(hsh[nwk1].raw_handle == nwv1.raw_handle);
Test.Assert(hsh[nwk1].GetNumber() == nwv1.GetNumber());
Test.Assert(hsh[nwk1].GetNumber() == 222);
- test.Numberwrapper nwk2 = NW(44);
- test.Numberwrapper nwv2 = NW(444);
+ test.INumberwrapper nwk2 = NW(44);
+ test.INumberwrapper nwv2 = NW(444);
hsh[nwk2] = nwv2;
hsh.Dispose();
Test.Assert(hsh.Handle == IntPtr.Zero);
@@ -3264,16 +3264,16 @@ class TestEinaHash
public static void test_eina_hash_obj_return_own()
{
- test.Testing t = new test.TestingConcrete();
- test.Numberwrapper nwk1;
- test.Numberwrapper nwv1;
+ test.ITesting t = new test.Testing();
+ test.INumberwrapper nwk1;
+ test.INumberwrapper nwv1;
var hsh = t.EinaHashObjReturnOwn(out nwk1, out nwv1);
Test.Assert(hsh.Own);
Test.Assert(hsh[nwk1].raw_handle == nwv1.raw_handle);
Test.Assert(hsh[nwk1].GetNumber() == nwv1.GetNumber());
Test.Assert(hsh[nwk1].GetNumber() == 222);
- test.Numberwrapper nwk2 = NW(44);
- test.Numberwrapper nwv2 = NW(444);
+ test.INumberwrapper nwk2 = NW(44);
+ test.INumberwrapper nwv2 = NW(444);
hsh[nwk2] = nwv2;
hsh.Dispose();
Test.Assert(hsh.Handle == IntPtr.Zero);
@@ -3352,10 +3352,10 @@ class TestEinaIterator
public static void eina_array_obj_empty_iterator()
{
- var arr = new eina.Array<test.Numberwrapper>();
+ var arr = new eina.Array<test.INumberwrapper>();
var itr = arr.GetIterator();
int idx = 0;
- foreach (test.Numberwrapper e in itr)
+ foreach (test.INumberwrapper e in itr)
{
++idx;
}
@@ -3367,12 +3367,12 @@ class TestEinaIterator
public static void eina_array_obj_filled_iterator()
{
- var arr = new eina.Array<test.Numberwrapper>();
+ var arr = new eina.Array<test.INumberwrapper>();
var base_objs = BaseSeqObj();
arr.Append(base_objs);
var itr = arr.GetIterator();
int idx = 0;
- foreach (test.Numberwrapper e in itr)
+ foreach (test.INumberwrapper e in itr)
{
Test.Assert(e.raw_handle == base_objs[idx].raw_handle);
Test.Assert(e.GetNumber() == base_objs[idx].GetNumber());
@@ -3486,10 +3486,10 @@ class TestEinaIterator
public static void eina_list_obj_empty_iterator()
{
- var lst = new eina.List<test.Numberwrapper>();
+ var lst = new eina.List<test.INumberwrapper>();
var itr = lst.GetIterator();
int idx = 0;
- foreach (test.Numberwrapper e in itr)
+ foreach (test.INumberwrapper e in itr)
{
++idx;
}
@@ -3501,12 +3501,12 @@ class TestEinaIterator
public static void eina_list_obj_filled_iterator()
{
- var lst = new eina.List<test.Numberwrapper>();
+ var lst = new eina.List<test.INumberwrapper>();
var base_objs = BaseSeqObj();
lst.AppendArray(base_objs);
var itr = lst.GetIterator();
int idx = 0;
- foreach (test.Numberwrapper e in itr)
+ foreach (test.INumberwrapper e in itr)
{
Test.Assert(e.raw_handle == base_objs[idx].raw_handle);
Test.Assert(e.GetNumber() == base_objs[idx].GetNumber());
@@ -3724,10 +3724,10 @@ class TestEinaIterator
public static void eina_hash_keys_obj_empty_iterator()
{
- var hsh = new eina.Hash<test.Numberwrapper, test.Numberwrapper>();
+ var hsh = new eina.Hash<test.INumberwrapper, test.INumberwrapper>();
var itr = hsh.Keys();
bool entered = false;
- foreach (test.Numberwrapper e in itr)
+ foreach (test.INumberwrapper e in itr)
{
entered = true;
}
@@ -3739,10 +3739,10 @@ class TestEinaIterator
public static void eina_hash_values_obj_empty_iterator()
{
- var hsh = new eina.Hash<test.Numberwrapper, test.Numberwrapper>();
+ var hsh = new eina.Hash<test.INumberwrapper, test.INumberwrapper>();
var itr = hsh.Values();
bool entered = false;
- foreach (test.Numberwrapper e in itr)
+ foreach (test.INumberwrapper e in itr)
{
entered = true;
}
@@ -3754,8 +3754,8 @@ class TestEinaIterator
public static void eina_hash_keys_obj_filled_iterator()
{
- var hsh = new eina.Hash<test.Numberwrapper, test.Numberwrapper>();
- var dct = new eina.Hash<int, test.Numberwrapper>();
+ var hsh = new eina.Hash<test.INumberwrapper, test.INumberwrapper>();
+ var dct = new eina.Hash<int, test.INumberwrapper>();
var a = NW(22);
var b = NW(44);
var c = NW(88);
@@ -3772,7 +3772,7 @@ class TestEinaIterator
var itr = hsh.Keys();
int idx = 0;
- foreach (test.Numberwrapper e in itr)
+ foreach (test.INumberwrapper e in itr)
{
Test.Assert(dct[e.GetNumber()] != null);
Test.Assert(dct[e.GetNumber()].raw_handle == e.raw_handle);
@@ -3789,8 +3789,8 @@ class TestEinaIterator
public static void eina_hash_values_obj_filled_iterator()
{
- var hsh = new eina.Hash<test.Numberwrapper, test.Numberwrapper>();
- var dct = new eina.Hash<int, test.Numberwrapper>();
+ var hsh = new eina.Hash<test.INumberwrapper, test.INumberwrapper>();
+ var dct = new eina.Hash<int, test.INumberwrapper>();
var a = NW(22);
var b = NW(44);
var c = NW(88);
@@ -3807,7 +3807,7 @@ class TestEinaIterator
var itr = hsh.Values();
int idx = 0;
- foreach (test.Numberwrapper e in itr)
+ foreach (test.INumberwrapper e in itr)
{
Test.Assert(dct[e.GetNumber()] != null);
Test.Assert(dct[e.GetNumber()].raw_handle == e.raw_handle);
@@ -3830,7 +3830,7 @@ class TestEinaIterator
public static void test_eina_iterator_int_in()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var arr = new eina.Array<int>();
arr.Append(base_seq_int);
var itr = arr.GetIterator();
@@ -3853,7 +3853,7 @@ class TestEinaIterator
public static void test_eina_iterator_int_in_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var arr = new eina.Array<int>();
arr.Append(base_seq_int);
var itr = arr.GetIterator();
@@ -3880,7 +3880,7 @@ class TestEinaIterator
public static void test_eina_iterator_int_out()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
eina.Iterator<int> itr;
Test.Assert(t.EinaIteratorIntOut(out itr));
@@ -3904,7 +3904,7 @@ class TestEinaIterator
public static void test_eina_iterator_int_out_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
eina.Iterator<int> itr;
Test.Assert(t.EinaIteratorIntOutOwn(out itr));
@@ -3925,7 +3925,7 @@ class TestEinaIterator
public static void test_eina_iterator_int_return()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var itr = t.EinaIteratorIntReturn();
@@ -3947,7 +3947,7 @@ class TestEinaIterator
public static void test_eina_iterator_int_return_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var itr = t.EinaIteratorIntReturnOwn();
@@ -3969,7 +3969,7 @@ class TestEinaIterator
public static void test_eina_iterator_str_in()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var arr = new eina.Array<string>();
arr.Append(base_seq_str);
var itr = arr.GetIterator();
@@ -3992,7 +3992,7 @@ class TestEinaIterator
public static void test_eina_iterator_str_in_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var arr = new eina.Array<string>();
arr.Append(base_seq_str);
var itr = arr.GetIterator();
@@ -4023,7 +4023,7 @@ class TestEinaIterator
public static void test_eina_iterator_str_out()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
eina.Iterator<string> itr;
Test.Assert(t.EinaIteratorStrOut(out itr));
@@ -4046,7 +4046,7 @@ class TestEinaIterator
public static void test_eina_iterator_str_out_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
eina.Iterator<string> itr;
Test.Assert(t.EinaIteratorStrOutOwn(out itr));
@@ -4067,7 +4067,7 @@ class TestEinaIterator
public static void test_eina_iterator_str_return()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var itr = t.EinaIteratorStrReturn();
@@ -4089,7 +4089,7 @@ class TestEinaIterator
public static void test_eina_iterator_str_return_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var itr = t.EinaIteratorStrReturnOwn();
@@ -4111,8 +4111,8 @@ class TestEinaIterator
public static void test_eina_iterator_obj_in()
{
- test.Testing t = new test.TestingConcrete();
- var arr = new eina.Array<test.Numberwrapper>();
+ test.ITesting t = new test.Testing();
+ var arr = new eina.Array<test.INumberwrapper>();
arr.Append(BaseSeqObj());
var itr = arr.GetIterator();
@@ -4134,8 +4134,8 @@ class TestEinaIterator
public static void test_eina_iterator_obj_in_own()
{
- test.Testing t = new test.TestingConcrete();
- var arr = new eina.Array<test.Numberwrapper>();
+ test.ITesting t = new test.Testing();
+ var arr = new eina.Array<test.INumberwrapper>();
arr.Append(BaseSeqObj());
var itr = arr.GetIterator();
arr.OwnContent = false;
@@ -4161,8 +4161,8 @@ class TestEinaIterator
public static void test_eina_iterator_obj_out()
{
- test.Testing t = new test.TestingConcrete();
- eina.Iterator<test.Numberwrapper> itr;
+ test.ITesting t = new test.Testing();
+ eina.Iterator<test.INumberwrapper> itr;
Test.Assert(t.EinaIteratorObjOut(out itr));
@@ -4172,7 +4172,7 @@ class TestEinaIterator
var base_seq_obj = BaseSeqObj();
int idx = 0;
- foreach (test.Numberwrapper e in itr)
+ foreach (test.INumberwrapper e in itr)
{
Test.AssertEquals(e.GetNumber(), base_seq_obj[idx].GetNumber());
++idx;
@@ -4186,8 +4186,8 @@ class TestEinaIterator
public static void test_eina_iterator_obj_out_own()
{
- test.Testing t = new test.TestingConcrete();
- eina.Iterator<test.Numberwrapper> itr;
+ test.ITesting t = new test.Testing();
+ eina.Iterator<test.INumberwrapper> itr;
Test.Assert(t.EinaIteratorObjOutOwn(out itr));
@@ -4197,7 +4197,7 @@ class TestEinaIterator
var base_seq_obj = BaseSeqObj();
int idx = 0;
- foreach (test.Numberwrapper e in itr)
+ foreach (test.INumberwrapper e in itr)
{
Test.AssertEquals(e.GetNumber(), base_seq_obj[idx].GetNumber());
++idx;
@@ -4209,7 +4209,7 @@ class TestEinaIterator
public static void test_eina_iterator_obj_return()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var itr = t.EinaIteratorObjReturn();
@@ -4219,7 +4219,7 @@ class TestEinaIterator
var base_seq_obj = BaseSeqObj();
int idx = 0;
- foreach (test.Numberwrapper e in itr)
+ foreach (test.INumberwrapper e in itr)
{
Test.AssertEquals(e.GetNumber(), base_seq_obj[idx].GetNumber());
++idx;
@@ -4233,7 +4233,7 @@ class TestEinaIterator
public static void test_eina_iterator_obj_return_own()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var itr = t.EinaIteratorObjReturnOwn();
@@ -4243,7 +4243,7 @@ class TestEinaIterator
var base_seq_obj = BaseSeqObj();
int idx = 0;
- foreach (test.Numberwrapper e in itr)
+ foreach (test.INumberwrapper e in itr)
{
Test.AssertEquals(e.GetNumber(), base_seq_obj[idx].GetNumber());
++idx;
@@ -4254,4 +4254,75 @@ class TestEinaIterator
}
} // < TestEinaIterator
+
+class TestEinaAccessor
+{
+ public static void basic_accessor_list()
+ {
+ var lst = new eina.List<int>();
+ lst.Append(1);
+ lst.Append(2);
+ lst.Append(3);
+ lst.Append(4);
+
+ eina.Accessor<int> accessor = lst.GetAccessor();
+
+ var zipped = accessor.Zip(lst, (first, second) => new Tuple<int, int>(first, second));
+
+ foreach(Tuple<int, int> pair in zipped)
+ {
+ Test.AssertEquals(pair.Item1, pair.Item2);
+ }
+ }
+
+ public static void basic_accessor_array()
+ {
+ var arr = new eina.Array<string>();
+ arr.Append(base_seq_str);
+
+ eina.Accessor<string> accessor = arr.GetAccessor();
+
+ var zipped = accessor.Zip(arr, (first, second) => new Tuple<string, string>(first, second));
+
+ foreach(Tuple<string, string> pair in zipped)
+ {
+ Test.AssertEquals(pair.Item1, pair.Item2);
+ }
+ }
+
+ public static void basic_accessor_inlist()
+ {
+ var lst = new eina.Inlist<int>();
+ lst.Append(1);
+ lst.Append(2);
+ lst.Append(3);
+ lst.Append(4);
+
+ eina.Accessor<int> accessor = lst.GetAccessor();
+
+ var zipped = accessor.Zip(lst, (first, second) => new Tuple<int, int>(first, second));
+
+ foreach(Tuple<int, int> pair in zipped)
+ {
+ Test.AssertEquals(pair.Item1, pair.Item2);
+ }
+ }
+
+ public static void basic_accessor_inarray()
+ {
+ var arr = new eina.Inarray<int>();
+ arr.Append(base_seq_int);
+
+ eina.Accessor<int> accessor = arr.GetAccessor();
+
+ var zipped = accessor.Zip(arr, (first, second) => new Tuple<int, int>(first, second));
+
+ foreach(Tuple<int, int> pair in zipped)
+ {
+ Test.AssertEquals(pair.Item1, pair.Item2);
+ }
+ }
+}
+
+
}
diff --git a/src/tests/efl_mono/Eldbus.cs b/src/tests/efl_mono/Eldbus.cs
index 9c9fe35e88..820c8984ef 100644
--- a/src/tests/efl_mono/Eldbus.cs
+++ b/src/tests/efl_mono/Eldbus.cs
@@ -158,6 +158,8 @@ class TestEldbusObject
eldbus.Pending pending = obj.Send(message, objectMessageCb, -1);
+ AssertEquals(pending.GetMethod(), methodName);
+
timeout = ecore_timer_add(2.0, GetEcoreLoopClose(), IntPtr.Zero);
Assert(timeout != IntPtr.Zero);
@@ -216,6 +218,8 @@ class TestEldbusObject
eldbus.Pending pending = obj.Introspect(objectMessageCb);
+ AssertEquals(pending.GetMethod(), "Introspect");
+
timeout = ecore_timer_add(2.0, GetEcoreLoopClose(), IntPtr.Zero);
Assert(timeout != IntPtr.Zero);
@@ -236,13 +240,15 @@ class TestEldbusMessage
private static bool isSuccess = false;
- private static void ActivableList(eldbus.MessageDelegate messageCb)
+ private static void ActivatableList(eldbus.MessageDelegate messageCb)
{
isSuccess = false;
var conn = new eldbus.Connection(eldbus.Connection.Type.System);
- eldbus.Pending pending = conn.ActivableList(messageCb);
+ eldbus.Pending pending = conn.ActivatableList(messageCb);
+
+ AssertEquals(pending.GetMethod(), "ListActivatableNames");
timeout = ecore_timer_add(2.0, GetEcoreLoopClose(), IntPtr.Zero);
Assert(timeout != IntPtr.Zero);
@@ -303,7 +309,7 @@ class TestEldbusMessage
}
};
- ActivableList(responseMessageCb);
+ ActivatableList(responseMessageCb);
}
public static void utc_eldbus_message_info_data_get_p()
@@ -360,6 +366,8 @@ class TestEldbusMessage
const int timeoutSendMs = 1000;
eldbus.Pending pending = conn.Send(msg, messageMethodCb, timeoutSendMs);
+ AssertEquals(pending.GetMethod(), methodName);
+
timeout = ecore_timer_add(2.0, GetEcoreLoopClose(), IntPtr.Zero);
Assert(timeout != IntPtr.Zero);
@@ -438,7 +446,7 @@ class TestEldbusMessage
ecore_main_loop_quit();
}
};
- ActivableList(activatableListResponseCb);
+ ActivatableList(activatableListResponseCb);
}
}
diff --git a/src/tests/efl_mono/Eo.cs b/src/tests/efl_mono/Eo.cs
index 60d66821c7..997876b52f 100644
--- a/src/tests/efl_mono/Eo.cs
+++ b/src/tests/efl_mono/Eo.cs
@@ -1,4 +1,5 @@
using System;
+using System.Linq;
namespace TestSuite
{
@@ -14,11 +15,11 @@ class TestEo
//
public static void return_same_object()
{
- test.Testing testing = new test.TestingConcrete();
- test.Testing o1 = testing.ReturnObject();
+ test.ITesting testing = new test.Testing();
+ test.ITesting o1 = testing.ReturnObject();
Test.Assert(o1.raw_handle != IntPtr.Zero);
Test.Assert(o1.raw_handle == testing.raw_handle);
- test.Testing o2 = o1.ReturnObject();
+ test.ITesting o2 = o1.ReturnObject();
Test.Assert(o2.raw_handle != IntPtr.Zero);
Test.Assert(o2.raw_handle == o1.raw_handle);
}
@@ -28,7 +29,7 @@ class TestEo
{
bool delEventCalled = false;
{
- test.Testing obj = new test.TestingConcrete();
+ test.ITesting obj = new test.Testing();
obj.DEL += (object sender, EventArgs e) => { delEventCalled = true; };
}
@@ -45,8 +46,8 @@ class TestEo
{
bool delEventCalled = false;
{
- test.Testing obj = new test.TestingConcrete();
- obj.DEL += (object sender, EventArgs e) => { delEventCalled = true; };
+ test.ITesting obj = new test.Testing();
+ obj.DelEvt += (object sender, EventArgs e) => { delEventCalled = true; };
((IDisposable)obj).Dispose();
}
@@ -58,7 +59,7 @@ class TestEo
{
bool delEventCalled = false;
{
- test.Testing obj = new Derived();
+ test.ITesting obj = new Derived();
obj.DEL += (object sender, EventArgs e) => { delEventCalled = true; };
}
@@ -75,7 +76,7 @@ class TestEo
{
bool delEventCalled = false;
{
- test.Testing obj = new Derived();
+ test.ITesting obj = new Derived();
obj.DEL += (object sender, EventArgs e) => { delEventCalled = true; };
((IDisposable)obj).Dispose();
}
@@ -94,7 +95,7 @@ class TestEoInherit
{
public static void instantiate_inherited()
{
- efl.Loop loop = new MyLoop();
+ efl.ILoop loop = new MyLoop();
Test.Assert(loop.raw_handle != System.IntPtr.Zero);
}
}
@@ -103,7 +104,7 @@ class TestEoNames
{
public static void name_getset()
{
- test.Testing obj = new test.TestingConcrete();
+ test.ITesting obj = new test.Testing();
string name = "Dummy";
obj.SetName(name);
@@ -117,7 +118,7 @@ class TestEoConstructingMethods
{
bool called = false;
string name = "Test object";
- test.Testing obj = new test.TestingConcrete(null, (test.Testing a) => {
+ test.ITesting obj = new test.Testing(null, (test.ITesting a) => {
called = true;
Console.WriteLine("callback: obj raw_handle: {0:x}", a.raw_handle);
a.SetName(name);
@@ -129,7 +130,7 @@ class TestEoConstructingMethods
private class Derived : test.TestingInherit
{
- public Derived(test.Testing parent = null,
+ public Derived(test.ITesting parent = null,
test.TestingInherit.ConstructingMethod cb = null) : base(parent, cb) {
}
}
@@ -138,7 +139,7 @@ class TestEoConstructingMethods
{
bool called = false;
string name = "Another test object";
- Derived obj = new Derived(null, (test.Testing a) => {
+ Derived obj = new Derived(null, (test.ITesting a) => {
called = true;
a.SetComment(name);
});
@@ -152,43 +153,97 @@ class TestEoParent
{
public static void basic_parent()
{
- test.Testing parent = new test.TestingConcrete(null);
- test.Testing child = new test.TestingConcrete(parent);
+ test.ITesting parent = new test.Testing(null);
+ test.ITesting child = new test.Testing(parent);
Test.AssertEquals(parent, child.GetParent());
- test.Testing parent_retrieved = test.TestingConcrete.static_cast(child.GetParent());
+ test.ITesting parent_retrieved = test.Testing.static_cast(child.GetParent());
Test.AssertEquals(parent, parent_retrieved);
}
public static void parent_inherited_class()
{
- test.Numberwrapper parent = new test.NumberwrapperConcrete(null);
- test.Testing child = new test.TestingConcrete(parent);
+ test.INumberwrapper parent = new test.Numberwrapper(null);
+ test.ITesting child = new test.Testing(parent);
Test.AssertEquals(parent, child.GetParent());
- test.Numberwrapper parent_retrieved = test.NumberwrapperConcrete.static_cast(child.GetParent());
+ test.INumberwrapper parent_retrieved = test.Numberwrapper.static_cast(child.GetParent());
Test.AssertEquals(parent, parent_retrieved);
}
private class Derived : test.TestingInherit
{
- public Derived(test.Testing parent = null) : base (parent)
+ public Derived(test.ITesting parent = null) : base (parent)
{
}
}
public static void basic_parent_managed_inherit()
{
- test.Testing parent = new Derived(null);
- test.Testing child = new Derived(parent);
+ test.ITesting parent = new Derived(null);
+ test.ITesting child = new Derived(parent);
Test.AssertEquals(parent, child.GetParent());
- test.Testing parent_from_cast = test.TestingInherit.static_cast(child.GetParent());
+ test.ITesting parent_from_cast = test.Testing.static_cast(child.GetParent());
Test.AssertEquals(parent, parent_from_cast);
}
}
+class TestKlassMethods
+{
+ public static void basic_class_method()
+ {
+ int reference = 0xbeef;
+ test.Testing.SetKlassProp(reference);
+ Test.AssertEquals(reference, test.Testing.GetKlassProp());
+ }
+
+ public static void inherited_class_method()
+ {
+ int reference = 0xdead;
+ test.Child.SetKlassProp(reference);
+ Test.AssertEquals(reference, test.Child.GetKlassProp());
+ }
+}
+
+class TestTypedefs
+{
+ public static void basic_typedef_test()
+ {
+ test.ITesting obj = new test.Testing();
+ test.MyInt input = 1900;
+ test.MyInt receiver;
+
+ int ret = obj.BypassTypedef(input, out receiver);
+
+ Test.AssertEquals((test.MyInt)ret, input);
+ Test.AssertEquals(receiver, input);
+
+ }
+}
+
+class TestEoAccessors
+{
+ public static void basic_eo_accessors()
+ {
+ test.ITesting obj = new test.Testing();
+ eina.List<int> lst = new eina.List<int>();
+ lst.Append(4);
+ lst.Append(3);
+ lst.Append(2);
+ lst.Append(5);
+ eina.Accessor<int> acc = obj.CloneAccessor(lst.GetAccessor());
+
+ var zipped = acc.Zip(lst, (first, second) => new Tuple<int, int>(first, second));
+
+ foreach(Tuple<int, int> pair in zipped)
+ {
+ Test.AssertEquals(pair.Item1, pair.Item2);
+ }
+ }
+}
+
}
diff --git a/src/tests/efl_mono/EoPromises.cs b/src/tests/efl_mono/EoPromises.cs
new file mode 100644
index 0000000000..0c7c2e95e8
--- /dev/null
+++ b/src/tests/efl_mono/EoPromises.cs
@@ -0,0 +1,195 @@
+using System;
+using System.Threading.Tasks;
+using System.Threading;
+
+namespace TestSuite
+{
+
+class TestEoPromises
+{
+ public static void test_simple_task_run()
+ {
+ efl.ILoop loop = efl.App.GetLoopMain();
+ eina.Future future = loop.Idle();
+
+ bool callbackCalled = false;
+ int ret_code = 1992;
+
+ future.Then((eina.Value value) => {
+ callbackCalled = true;
+ eina.Value v = new eina.Value(eina.ValueType.Int32);
+ v.Set(ret_code);
+ loop.Quit(v);
+ return value;
+ });
+ eina.Value ret_value = loop.Begin();
+
+ Test.Assert(callbackCalled, "Future loop callback must have been called.");
+
+ Test.AssertEquals(ret_value.GetValueType(), eina.ValueType.Int32);
+
+ int ret_from_value;
+ Test.Assert(ret_value.Get(out ret_from_value));
+ Test.AssertEquals(ret_from_value, ret_code);
+
+ }
+
+ public static void test_object_promise()
+ {
+ efl.ILoop loop = efl.App.GetLoopMain();
+ test.Testing obj = new test.Testing();
+
+ eina.Future future = obj.GetFuture();
+
+ bool callbackCalled = false;
+ int receivedValue = -1;
+ int sentValue = 1984;
+ future.Then((eina.Value value) => {
+ callbackCalled = true;
+ Test.AssertEquals(value.GetValueType(), eina.ValueType.Int32);
+ value.Get(out receivedValue);
+
+ return value;
+ });
+
+ obj.FulfillPromise(sentValue);
+
+ loop.Iterate();
+ Test.Assert(callbackCalled, "Future callback must have been called.");
+ Test.AssertEquals(receivedValue, sentValue);
+ }
+
+ public static void test_object_promise_cancel()
+ {
+ efl.ILoop loop = efl.App.GetLoopMain();
+ test.Testing obj = new test.Testing();
+
+ eina.Future future = obj.GetFuture();
+
+ bool callbackCalled = false;
+ eina.Error receivedError = -1;
+ eina.Error sentError = 120;
+ future.Then((eina.Value value) => {
+ callbackCalled = true;
+ Test.AssertEquals(value.GetValueType(), eina.ValueType.Error);
+ value.Get(out receivedError);
+
+ return value;
+ });
+
+ obj.RejectPromise(sentError);
+
+ loop.Iterate();
+ Test.Assert(callbackCalled, "Future callback must have been called.");
+ Test.AssertEquals(receivedError, sentError);
+ }
+
+}
+
+class LoopConsumer
+{
+ public static async Task Consume(efl.ILoop loop)
+ {
+ Task<eina.Value> task = loop.IdleAsync();
+ eina.Value v = await task;
+ loop.Quit(v);
+ }
+}
+
+class TestLoopEoAsyncMethods
+{
+ public static void test_simple_async()
+ {
+ efl.ILoop loop = efl.App.GetLoopMain();
+ Task t = LoopConsumer.Consume(loop);
+
+ loop.Begin();
+ Test.Assert(t.Wait(1000), "Task should have been completed in time.");
+ }
+}
+
+class TestEoAsyncMethods
+{
+
+ public static void test_async_fulfill()
+ {
+ efl.ILoop loop = efl.App.GetLoopMain();
+ test.ITesting obj = new test.Testing();
+
+ Task<eina.Value> task = obj.GetFutureAsync();
+
+ int sentValue = 1337;
+
+ obj.FulfillPromise(sentValue);
+ loop.Iterate();
+
+ eina.Value v = task.Result;
+ Test.AssertEquals(v.GetValueType(), eina.ValueType.Int32);
+
+ int receivedValue;
+ v.Get(out receivedValue);
+ Test.AssertEquals(receivedValue, sentValue);
+ }
+
+ public static void test_async_cancel()
+ {
+ efl.ILoop loop = efl.App.GetLoopMain();
+ test.ITesting obj = new test.Testing();
+
+ CancellationTokenSource cancelSrc = new CancellationTokenSource();
+ Task<eina.Value> task = obj.GetFutureAsync(cancelSrc.Token);
+
+ cancelSrc.Cancel();
+ loop.Iterate();
+
+ bool raised = false;
+ try
+ {
+ eina.Value v = task.Result;
+ }
+ catch (AggregateException ae)
+ {
+ raised = true;
+ ae.Handle((x) =>
+ {
+ Test.Assert(x is TaskCanceledException, "AggregateException must have been TaskCanceledException");
+ return true;
+ });
+ }
+
+ Test.Assert(raised, "AggregateException must have been raised.");
+ }
+
+ public static void test_async_reject()
+ {
+ efl.ILoop loop = efl.App.GetLoopMain();
+ test.ITesting obj = new test.Testing();
+
+ Task<eina.Value> task = obj.GetFutureAsync();
+
+ eina.Error sentError = 1337;
+ obj.RejectPromise(sentError);
+
+ loop.Iterate();
+
+ bool raised = false;
+ try
+ {
+ eina.Value v = task.Result;
+ }
+ catch (AggregateException ae)
+ {
+ raised = true;
+ ae.Handle((x) =>
+ {
+ Test.Assert(x is efl.FutureException, "AggregateException must have been TaskCanceledException");
+ efl.FutureException ex = x as efl.FutureException;
+ Test.AssertEquals(ex.Error, sentError);
+ return true;
+ });
+ }
+
+ Test.Assert(raised, "AggregateException must have been raised.");
+ }
+}
+}
diff --git a/src/tests/efl_mono/Errors.cs b/src/tests/efl_mono/Errors.cs
index a903cf1605..b7359c1273 100644
--- a/src/tests/efl_mono/Errors.cs
+++ b/src/tests/efl_mono/Errors.cs
@@ -19,7 +19,7 @@ class TestEolianError
public static void global_eina_error()
{
- test.Testing obj = new test.TestingConcrete();
+ test.ITesting obj = new test.Testing();
Test.AssertRaises<efl.EflException>(() => obj.RaisesEinaError());
}
@@ -28,7 +28,7 @@ class TestEolianError
public static void global_eina_error_inherited()
{
- test.Testing obj = new Child();
+ test.ITesting obj = new Child();
Test.AssertRaises<efl.EflException>(() => obj.RaisesEinaError());
}
@@ -44,7 +44,7 @@ class TestEolianError
public static void exception_raised_from_inherited_virtual()
{
- test.Testing obj = new Overrider();
+ test.ITesting obj = new Overrider();
Test.AssertRaises<efl.EflException>(obj.CallChildrenRaiseError);
}
@@ -52,7 +52,7 @@ class TestEolianError
// return eina_error
public static void eina_error_return()
{
- test.Testing obj = new test.TestingConcrete();
+ test.ITesting obj = new test.Testing();
eina.Error expected = 42;
obj.SetErrorRet(expected);
eina.Error error = obj.ReturnsError();
@@ -79,7 +79,7 @@ class TestEolianError
public static void eina_error_return_from_inherited_virtual()
{
- test.Testing obj = new ReturnOverride();
+ test.ITesting obj = new ReturnOverride();
eina.Error expected = 42;
obj.SetErrorRet(expected);
eina.Error error = obj.ReturnsError();
@@ -108,11 +108,11 @@ class TestEolianError
// An event whose managed delegate generates an exception
// must set an eina_error so it can be reported back to
// the managed code
- efl.Loop loop = new efl.LoopConcrete();
+ test.ITesting obj = new test.Testing();
Listener listener = new Listener();
- loop.CALLBACK_ADD += listener.callback;
+ obj.EvtWithIntEvt += listener.callback;
- Test.AssertRaises<efl.EflException>(() => loop.IDLE += listener.another_callback);
+ Test.AssertRaises<efl.EflException>(() => { obj.EmitEventWithInt(2); });
}
}
}
diff --git a/src/tests/efl_mono/Events.cs b/src/tests/efl_mono/Events.cs
index 5719745a76..6f3268956c 100644
--- a/src/tests/efl_mono/Events.cs
+++ b/src/tests/efl_mono/Events.cs
@@ -1,5 +1,7 @@
using System;
+using static test.Testing; // For the event args
+
namespace TestSuite
{
@@ -7,31 +9,145 @@ class TestEoEvents
{
public bool called = false;
public bool correct_sender = false;
+ public efl.ILoop loop { get; set; }
protected void callback(object sender, EventArgs e) {
called = true;
- efl.Object obj = sender as efl.Object;
+ efl.IObject obj = sender as efl.IObject;
if (obj != null)
{
obj.SetName("loop_called");
correct_sender = true;
}
+
+ eina.Value v = new eina.Value(eina.ValueType.Int32);
+ v.Set(0);
+ loop.Quit(v);
}
protected void another_callback(object sender, EventArgs e) { }
- public static void callback_add_event()
+ public static void idle_event()
{
- efl.Loop loop = new efl.LoopConcrete();
+ efl.ILoop loop = new efl.Loop();
loop.SetName("loop");
TestEoEvents listener = new TestEoEvents();
- loop.CALLBACK_ADD += listener.callback;
+ listener.loop = loop;
+ loop.IdleEvt += listener.callback;
Test.Assert(!listener.called);
Test.Assert(!listener.correct_sender);
Test.AssertEquals("loop", loop.GetName());
- loop.IDLE += listener.another_callback;
+ loop.Begin();
Test.Assert(listener.called);
Test.Assert(listener.correct_sender);
Test.AssertEquals("loop_called", loop.GetName());
}
+
+ public static void event_with_string_payload()
+ {
+ test.ITesting obj = new test.Testing();
+ string received_string = null;
+
+ obj.EvtWithStringEvt += (object sender, EvtWithStringEvt_Args e) => {
+ received_string = e.arg;
+ };
+
+ obj.EmitEventWithString("Some args");
+
+ Test.AssertEquals("Some args", received_string);
+ }
+
+ public static void event_with_int_payload()
+ {
+ test.ITesting obj = new test.Testing();
+ int received_int= 0;
+
+ obj.EvtWithIntEvt += (object sender, EvtWithIntEvt_Args e) => {
+ received_int = e.arg;
+ };
+
+ obj.EmitEventWithInt(-1984);
+
+ Test.AssertEquals(-1984, received_int);
+ }
+
+ public static void event_with_bool_payload()
+ {
+ test.ITesting obj = new test.Testing();
+ bool received_bool = false;
+
+ obj.EvtWithBoolEvt += (object sender, EvtWithBoolEvt_Args e) => {
+ received_bool = e.arg;
+ };
+
+ obj.EmitEventWithBool(true);
+
+ Test.AssertEquals(true, received_bool);
+
+ obj.EmitEventWithBool(false);
+
+ Test.AssertEquals(false, received_bool);
+ }
+
+ public static void event_with_uint_payload()
+ {
+ test.ITesting obj = new test.Testing();
+ uint received_uint = 0;
+ obj.EvtWithUintEvt += (object sender, EvtWithUintEvt_Args e) => {
+ received_uint = e.arg;
+ };
+
+ obj.EmitEventWithUint(0xbeef);
+
+ Test.AssertEquals<uint>(0xbeef, received_uint);
+ }
+
+ public static void event_with_object_payload()
+ {
+ test.ITesting obj = new test.Testing();
+ test.ITesting received_obj = null;
+
+ obj.EvtWithObjEvt += (object sender, EvtWithObjEvt_Args e) => {
+ received_obj = e.arg;
+ };
+
+ test.ITesting sent_obj = new test.Testing();
+
+ obj.EmitEventWithObj(sent_obj);
+
+ Test.AssertEquals(sent_obj, received_obj);
+ }
+
+ public static void event_with_error_payload()
+ {
+ test.ITesting obj = new test.Testing();
+ eina.Error received_error = 0;
+
+ obj.EvtWithErrorEvt += (object sender, EvtWithErrorEvt_Args e) => {
+ received_error = e.arg;
+ };
+
+ eina.Error sent_error = -2001;
+
+ obj.EmitEventWithError(sent_error);
+
+ Test.AssertEquals(sent_error, received_error);
+ }
+
+ public static void event_with_struct_payload()
+ {
+ test.ITesting obj = new test.Testing();
+ test.StructSimple received_struct = default(test.StructSimple);
+
+ obj.EvtWithStructEvt += (object sender, EvtWithStructEvt_Args e) => {
+ received_struct = e.arg;
+ };
+
+ test.StructSimple sent_struct = default(test.StructSimple);
+ sent_struct.Fstring = "Struct Event";
+
+ obj.EmitEventWithStruct(sent_struct);
+
+ Test.AssertEquals(sent_struct.Fstring, received_struct.Fstring);
+ }
}
}
diff --git a/src/tests/efl_mono/FunctionPointerMarshalling.cs b/src/tests/efl_mono/FunctionPointerMarshalling.cs
new file mode 100644
index 0000000000..b6ba6df3d1
--- /dev/null
+++ b/src/tests/efl_mono/FunctionPointerMarshalling.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Linq;
+using System.Runtime.InteropServices;
+
+namespace TestSuite
+{
+
+class TestFunctionPointerMarshalling
+{
+ public static void func_pointer_marshalling()
+ {
+ test.ITesting obj = new test.Testing();
+ bool called = false;
+ eina.Strbuf buf = new eina.Strbuf();
+ string argument = "Some String";
+ eina.Value v = new eina.Value(eina.ValueType.String);
+ v.Set(argument);
+ string reference = new string(argument.ToCharArray().Reverse().ToArray());
+
+ obj.CallFormatCb(buf, v, (eina.Strbuf ibuf, eina.Value val) => {
+ called = true;
+ string str = null;
+ val.Get(out str);
+ buf.Append(new string(str.ToCharArray().Reverse().ToArray()));
+ });
+
+ Test.Assert(called, "Callback was not called");
+ Test.AssertEquals(reference, buf.Steal());
+ }
+}
+}
diff --git a/src/tests/efl_mono/FunctionPointers.cs b/src/tests/efl_mono/FunctionPointers.cs
index 2514d79b82..1e2431ce47 100644
--- a/src/tests/efl_mono/FunctionPointers.cs
+++ b/src/tests/efl_mono/FunctionPointers.cs
@@ -29,7 +29,7 @@ class TestFunctionPointers
public static void set_callback_basic()
{
setup();
- test.Testing obj = new test.TestingConcrete();
+ test.ITesting obj = new test.Testing();
obj.SetCallback(twice);
Test.Assert(called == false, "set_callback should not call the callback");
@@ -44,7 +44,7 @@ class TestFunctionPointers
{
setup();
- test.Testing obj = new test.TestingConcrete();
+ test.ITesting obj = new test.Testing();
obj.SetCallback(y => {
called = true;
return y + 4;
@@ -62,7 +62,7 @@ class TestFunctionPointers
{
setup();
- test.Testing obj = new test.TestingConcrete();
+ test.ITesting obj = new test.Testing();
obj.SetCallback(twice);
Test.Assert(called == false, "set_callback should not call the callback");
diff --git a/src/tests/efl_mono/Parts.cs b/src/tests/efl_mono/Parts.cs
new file mode 100644
index 0000000000..6137609a9c
--- /dev/null
+++ b/src/tests/efl_mono/Parts.cs
@@ -0,0 +1,41 @@
+#define CODE_ANALYSIS
+
+#pragma warning disable 1591
+
+using System;
+using System.Diagnostics.CodeAnalysis;
+
+namespace TestSuite {
+
+
+[SuppressMessage("Gendarme.Rules.Portability", "DoNotHardcodePathsRule")]
+public static class TestParts
+{
+ public static void basic_part_test()
+ {
+ test.ITesting t = new test.Testing();
+ do_part_test(t);
+ }
+
+ private class Child : test.TestingInherit
+ {
+ public Child() : base(null) {}
+ }
+
+ public static void inherited_part_test() {
+ var t = new Child();
+ do_part_test(t);
+ }
+
+ private static void do_part_test(test.ITesting t)
+ {
+ var p1 = t.Part1;
+ var p2 = t.Part2;
+ Test.Assert(p1 is test.Testing);
+ Test.AssertEquals("part1", p1.GetName());
+ Test.Assert(p2 is test.Testing);
+ Test.AssertEquals("part2", p2.GetName());
+ }
+}
+
+}
diff --git a/src/tests/efl_mono/Promises.cs b/src/tests/efl_mono/Promises.cs
new file mode 100644
index 0000000000..4191c31c5f
--- /dev/null
+++ b/src/tests/efl_mono/Promises.cs
@@ -0,0 +1,261 @@
+using System;
+using System.Collections.Generic;
+
+namespace TestSuite
+{
+
+class TestPromises
+{
+ public static void test_simple_cancel()
+ {
+ bool cleanCalled = false;
+ eina.Promise promise = new eina.Promise(() => { cleanCalled = true; });
+ eina.Future future = new eina.Future(promise);
+ future.Cancel();
+ Test.Assert(cleanCalled, "Promise clean callback should have been called.");
+ Test.AssertRaises<ObjectDisposedException>(() => { promise.Resolve(null); });
+ Test.AssertRaises<ObjectDisposedException>(future.Cancel);
+ }
+
+ public static void test_simple_resolve()
+ {
+ bool callbackCalled = false;
+ eina.Value received_value = null;
+
+ efl.ILoop loop = efl.App.GetLoopMain();
+ eina.Promise promise = new eina.Promise();
+ eina.Future future = new eina.Future(promise);
+
+ future = future.Then((eina.Value value) => {
+ callbackCalled = true;
+ received_value = value;
+ return value;
+ } );
+
+ eina.Value reference_value = new eina.Value(eina.ValueType.Int32);
+ reference_value.Set(1984);
+ promise.Resolve(reference_value);
+
+ loop.Iterate();
+
+ Test.Assert(callbackCalled, "Future callback should have been called.");
+ Test.AssertEquals(received_value, reference_value);
+ }
+
+ public static void test_simple_reject()
+ {
+ bool callbackCalled = false;
+ eina.Error received_error = eina.Error.NO_ERROR;
+
+ efl.ILoop loop = efl.App.GetLoopMain();
+ eina.Promise promise = new eina.Promise();
+ eina.Future future = new eina.Future(promise);
+
+ future = future.Then((eina.Value value) => {
+ callbackCalled = true;
+ value.Get(out received_error);
+ return value;
+ });
+
+ promise.Reject(eina.Error.EPERM);
+
+ loop.Iterate();
+
+ Test.Assert(callbackCalled, "Future callback should have been called.");
+ Test.AssertEquals(received_error, eina.Error.EPERM);
+
+ Test.AssertRaises<ObjectDisposedException>(() => { promise.Resolve(null); });
+ Test.AssertRaises<ObjectDisposedException>(future.Cancel);
+ }
+
+ public static void test_simple_future_cancel()
+ {
+ bool callbackCalled = false;
+ bool promiseCallbackCalled = false;
+ eina.Error received_error = eina.Error.NO_ERROR;
+
+ eina.Promise promise = new eina.Promise(() => { promiseCallbackCalled = true; });
+ eina.Future future = new eina.Future(promise);
+
+ future = future.Then((eina.Value value) => {
+ callbackCalled = true;
+ value.Get(out received_error);
+ return value;
+ });
+
+ future.Cancel();
+
+ Test.Assert(promiseCallbackCalled, "Promise cancel callback should have been called.");
+ Test.Assert(callbackCalled, "Future callback should have been called.");
+ Test.AssertEquals(received_error, eina.Error.ECANCELED);
+ }
+
+
+ private delegate eina.Future.ResolvedCb FutureCbGenerator(int x);
+ public static void test_then_chaining()
+ {
+ bool[] callbacksCalled = {false, false, false, false};
+ eina.Value[] received_value = {null, null, null, null};
+
+ FutureCbGenerator genResolvedCb = (int i) => {
+ return (eina.Value value) => {
+ callbacksCalled[i] = true;
+ int x;
+ value.Get(out x);
+ value.Set(x + i);
+ received_value[i] = value;
+ return value;
+ };
+ };
+
+ efl.ILoop loop = efl.App.GetLoopMain();
+ eina.Promise promise = new eina.Promise();
+ eina.Future future = new eina.Future(promise);
+ for (int i = 0; i < 4; i++)
+ future = future.Then(genResolvedCb(i));
+
+ eina.Value reference_value = new eina.Value(eina.ValueType.Int32);
+ reference_value.Set(0);
+ promise.Resolve(reference_value);
+
+ loop.Iterate();
+
+ int current_value = 0;
+ for (int i = 0; i < 4; i++)
+ {
+ current_value += i;
+ Test.Assert(callbacksCalled[i], $"Future callback {i} should have been called.");
+ int received;
+ received_value[i].Get(out received);
+ Test.AssertEquals(received, current_value);
+ }
+
+ Test.AssertRaises<ObjectDisposedException>(() => { promise.Resolve(null); });
+ Test.AssertRaises<ObjectDisposedException>(future.Cancel);
+ }
+
+ public static void test_then_chain_array()
+ {
+ bool[] callbacksCalled = {false, false, false, false};
+ eina.Value[] received_value = {null, null, null, null};
+
+ FutureCbGenerator genResolvedCb = (int i) => {
+ return (eina.Value value) => {
+ callbacksCalled[i] = true;
+ int x;
+ value.Get(out x);
+ value.Set(x + i);
+ received_value[i] = value;
+ return value;
+ };
+ };
+
+ var cbs = new List<eina.Future.ResolvedCb>();
+ for (int i = 0; i < 4; i++)
+ cbs.Add(genResolvedCb(i));
+
+ efl.ILoop loop = efl.App.GetLoopMain();
+ eina.Promise promise = new eina.Promise();
+ eina.Future future = new eina.Future(promise);
+ future = future.Chain(cbs);
+
+ eina.Value reference_value = new eina.Value(eina.ValueType.Int32);
+ reference_value.Set(0);
+ promise.Resolve(reference_value);
+
+ loop.Iterate();
+
+ int current_value = 0;
+ for (int i = 0; i < 4; i++)
+ {
+ current_value += i;
+ Test.Assert(callbacksCalled[i], $"Future chained callback {i} should have been called.");
+ int received;
+ received_value[i].Get(out received);
+ Test.AssertEquals(received, current_value);
+ }
+
+ Test.AssertRaises<ObjectDisposedException>(() => { promise.Resolve(null); });
+ Test.AssertRaises<ObjectDisposedException>(future.Cancel);
+ }
+
+ public static void test_cancel_after_resolve()
+ {
+ bool callbackCalled = false;
+ eina.Error received_error = eina.Error.NO_ERROR;
+
+ efl.ILoop loop = efl.App.GetLoopMain();
+ eina.Promise promise = new eina.Promise();
+ eina.Future future = new eina.Future(promise);
+
+ future = future.Then((eina.Value value) => {
+ callbackCalled = true;
+ value.Get(out received_error);
+ return value;
+ });
+
+ promise.Reject(eina.Error.EPERM);
+ future.Cancel();
+
+ loop.Iterate();
+
+ Test.Assert(callbackCalled, "Future callback should have been called.");
+ Test.AssertEquals(received_error, eina.Error.ECANCELED);
+
+ Test.AssertRaises<ObjectDisposedException>(() => { promise.Resolve(null); });
+ Test.AssertRaises<ObjectDisposedException>(future.Cancel);
+ }
+
+ public static void test_constructor_with_callback()
+ {
+ bool callbackCalled = false;
+ eina.Value received_value = null;
+
+ efl.ILoop loop = efl.App.GetLoopMain();
+ eina.Promise promise = new eina.Promise();
+#pragma warning disable 0219
+ eina.Future future = new eina.Future(promise,(eina.Value value) => {
+ callbackCalled = true;
+ received_value = value;
+ return value;
+ } );
+#pragma warning restore 0219
+
+ eina.Value reference_value = new eina.Value(eina.ValueType.Int32);
+ reference_value.Set(1984);
+ promise.Resolve(reference_value);
+
+ loop.Iterate();
+
+ Test.Assert(callbackCalled, "Future callback should have been called.");
+ Test.AssertEquals(received_value, reference_value);
+ }
+
+ public static void test_reject_on_disposal()
+ {
+ bool callbackCalled = false;
+ eina.Error received_error = eina.Error.NO_ERROR;
+
+ efl.ILoop loop = efl.App.GetLoopMain();
+ eina.Promise promise = new eina.Promise();
+ eina.Future future = new eina.Future(promise);
+
+ future = future.Then((eina.Value value) => {
+ callbackCalled = true;
+ value.Get(out received_error);
+ return value;
+ });
+
+ promise.Dispose();
+
+ loop.Iterate();
+
+ Test.Assert(callbackCalled, "Future callback should have been called.");
+ Test.AssertEquals(received_error, eina.Error.ECANCELED);
+
+ Test.AssertRaises<ObjectDisposedException>(() => { promise.Resolve(null); });
+ Test.AssertRaises<ObjectDisposedException>(future.Cancel);
+ }
+}
+
+}
diff --git a/src/tests/efl_mono/Strbuf.cs b/src/tests/efl_mono/Strbuf.cs
new file mode 100644
index 0000000000..97a70c23d2
--- /dev/null
+++ b/src/tests/efl_mono/Strbuf.cs
@@ -0,0 +1,59 @@
+using System;
+
+namespace TestSuite {
+
+class TestStrBuf
+{
+ public static void test_steal()
+ {
+ eina.Strbuf buf = new eina.Strbuf();
+
+ buf.Append("Here's");
+ buf.Append(' ');
+ buf.Append("Johnny!");
+
+ Test.AssertEquals("Here's Jonnny!".Length, buf.Length);
+ Test.AssertEquals("Here's Johnny!", buf.Steal());
+ }
+
+ public static void test_eolian()
+ {
+ test.ITesting obj = new test.Testing();
+ eina.Strbuf buf = new eina.Strbuf();
+
+ obj.AppendToStrbuf(buf, "Appended");
+ obj.AppendToStrbuf(buf, " to buf");
+
+ Test.AssertEquals("Appended to buf", buf.Steal());
+ }
+
+ private class Appender : test.TestingInherit
+ {
+ public bool called;
+ public Appender() : base(null)
+ {
+ called = false;
+ }
+
+ public override void AppendToStrbuf(eina.Strbuf buf, string str)
+ {
+ eina.Log.Error("Virtual wrapper called");
+ called = true;
+ buf.Append(str);
+ }
+ }
+
+ public static void test_virtual_eolian()
+ {
+ Appender obj = new Appender();
+ eina.Strbuf buf = new eina.Strbuf();
+
+ obj.CallAppendToStrbuf(buf, "Is");
+ obj.CallAppendToStrbuf(buf, " this");
+ obj.CallAppendToStrbuf(buf, " virtual?");
+
+ Test.Assert(obj.called);
+ Test.AssertEquals("Is this virtual?", buf.Steal());
+ }
+}
+} // namespace TestSuite
diff --git a/src/tests/efl_mono/Strings.cs b/src/tests/efl_mono/Strings.cs
index f798f20715..156b7ca9cf 100644
--- a/src/tests/efl_mono/Strings.cs
+++ b/src/tests/efl_mono/Strings.cs
@@ -8,7 +8,7 @@ class TestStrings
public static void in_string()
{
{
- test.Testing obj = new test.TestingConcrete();
+ test.ITesting obj = new test.Testing();
String sent = "in_string";
String returned = obj.InString(sent);
Test.AssertEquals(sent, returned);
@@ -21,7 +21,7 @@ class TestStrings
public static void in_own_string()
{
{
- test.Testing obj = new test.TestingConcrete();
+ test.ITesting obj = new test.Testing();
String sent = "in_own_string";
String returned = obj.InOwnString(sent);
Test.AssertEquals(sent, returned);
@@ -33,7 +33,7 @@ class TestStrings
public static void return_string()
{
{
- test.Testing obj = new test.TestingConcrete();
+ test.ITesting obj = new test.Testing();
Test.AssertEquals("string", obj.ReturnString());
}
System.GC.Collect();
@@ -43,7 +43,7 @@ class TestStrings
public static void return_own_string()
{
{
- test.Testing obj = new test.TestingConcrete();
+ test.ITesting obj = new test.Testing();
Test.AssertEquals("own_string", obj.ReturnOwnString());
}
System.GC.Collect();
@@ -54,7 +54,7 @@ class TestStrings
{
{
String str = String.Empty;
- test.Testing obj = new test.TestingConcrete();
+ test.ITesting obj = new test.Testing();
obj.OutString(out str);
Test.AssertEquals("out_string", str);
}
@@ -66,7 +66,7 @@ class TestStrings
{
{
String str = String.Empty;
- test.Testing obj = new test.TestingConcrete();
+ test.ITesting obj = new test.Testing();
obj.OutOwnString(out str);
Test.AssertEquals(str.ToString(), "out_own_string");
}
@@ -144,7 +144,7 @@ class TestStrings
* some time in the future */
public static void return_string_from_virtual()
{
- test.Testing obj = new StringReturner();
+ test.ITesting obj = new StringReturner();
/* for (int i = 0; i < 10000; i ++) // Uncomment this to check for memory leaks. */
Test.AssertEquals("inherited", obj.CallReturnString());
System.GC.Collect();
@@ -153,7 +153,7 @@ class TestStrings
/* The managed wrapper must surrender the ownership to the C after the virtual call. */
public static void return_own_string_from_virtual()
{
- test.Testing obj = new StringReturner();
+ test.ITesting obj = new StringReturner();
/* for (int i = 0; i < 10000; i ++) // Uncomment this to check for memory leaks. */
Test.AssertEquals("own_inherited", obj.CallReturnOwnString());
System.GC.Collect();
@@ -163,7 +163,7 @@ class TestStrings
* need to cache it until some time in the future. */
public static void out_string_from_virtual()
{
- test.Testing obj = new StringReturner();
+ test.ITesting obj = new StringReturner();
/* for (int i = 0; i < 10000; i ++) // Uncomment this to check for memory leaks. */
Test.AssertEquals("out_inherited", obj.CallOutString());
System.GC.Collect();
@@ -172,7 +172,7 @@ class TestStrings
/* The managed wrapper gives C the ownership of the filled out parameter */
public static void out_own_string_from_virtual()
{
- test.Testing obj = new StringReturner();
+ test.ITesting obj = new StringReturner();
/* for (int i = 0; i < 10000; i ++) // Uncomment this to check for memory leaks. */
Test.AssertEquals("out_own_inherited", obj.CallOutOwnString());
System.GC.Collect();
@@ -185,7 +185,7 @@ class TestStringshare
public static void in_stringshare()
{
{
- test.Testing obj = new test.TestingConcrete();
+ test.ITesting obj = new test.Testing();
String sent = "in_stringshare";
String returned = obj.InStringshare(sent);
Test.AssertEquals(sent, returned);
@@ -196,7 +196,7 @@ class TestStringshare
public static void in_own_stringshare()
{
{
- test.Testing obj = new test.TestingConcrete();
+ test.ITesting obj = new test.Testing();
String sent = "in_own_stringshare";
String returned = obj.InOwnStringshare(sent);
Test.AssertEquals(sent, returned);
@@ -207,7 +207,7 @@ class TestStringshare
public static void return_stringshare()
{
{
- test.Testing obj = new test.TestingConcrete();
+ test.ITesting obj = new test.Testing();
Test.AssertEquals("stringshare", obj.ReturnStringshare());
}
System.GC.Collect();
@@ -216,7 +216,7 @@ class TestStringshare
public static void return_own_stringshare()
{
{
- test.Testing obj = new test.TestingConcrete();
+ test.ITesting obj = new test.Testing();
Test.AssertEquals("own_stringshare", obj.ReturnOwnStringshare());
}
System.GC.Collect();
@@ -226,7 +226,7 @@ class TestStringshare
{
{
String str = String.Empty;
- test.Testing obj = new test.TestingConcrete();
+ test.ITesting obj = new test.Testing();
obj.OutStringshare(out str);
Test.AssertEquals("out_stringshare", str);
}
@@ -237,7 +237,7 @@ class TestStringshare
{
{
String str = String.Empty;
- test.Testing obj = new test.TestingConcrete();
+ test.ITesting obj = new test.Testing();
obj.OutOwnStringshare(out str);
Test.AssertEquals(str.ToString(), "out_own_stringshare");
}
@@ -304,28 +304,28 @@ class TestStringshare
public static void return_stringshare_from_virtual()
{
- test.Testing obj = new StringshareReturner();
+ test.ITesting obj = new StringshareReturner();
// for (int i = 0; i < 1000000; i ++) // Uncomment this to check for memory leaks.
Test.AssertEquals("inherited", obj.CallReturnStringshare());
}
public static void return_own_stringshare_from_virtual()
{
- test.Testing obj = new StringshareReturner();
+ test.ITesting obj = new StringshareReturner();
// for (int i = 0; i < 1000000; i ++) // Uncomment this to check for memory leaks.
Test.AssertEquals("own_inherited", obj.CallReturnOwnStringshare());
}
public static void out_stringshare_from_virtual()
{
- test.Testing obj = new StringshareReturner();
+ test.ITesting obj = new StringshareReturner();
// for (int i = 0; i < 1000000; i ++) // Uncomment this to check for memory leaks.
Test.AssertEquals("out_inherited", obj.CallOutStringshare());
}
public static void out_own_stringshare_from_virtual()
{
- test.Testing obj = new StringshareReturner();
+ test.ITesting obj = new StringshareReturner();
// for (int i = 0; i < 1000000; i ++) // Uncomment this to check for memory leaks.
Test.AssertEquals("out_own_inherited", obj.CallOutOwnStringshare());
}
diff --git a/src/tests/efl_mono/Structs.cs b/src/tests/efl_mono/Structs.cs
index dcdea0d757..4a9e7e9018 100644
--- a/src/tests/efl_mono/Structs.cs
+++ b/src/tests/efl_mono/Structs.cs
@@ -165,7 +165,7 @@ class TestStructs
complex.Fslice.Mem = eina.MemoryNative.Alloc(1);
Marshal.WriteByte(complex.Fslice.Mem, 125);
- complex.Fobj = new test.NumberwrapperConcrete();
+ complex.Fobj = new test.Numberwrapper();
complex.Fobj.SetNumber(42);
return complex;
@@ -245,68 +245,267 @@ class TestStructs
checkZeroedStructComplex(complex);
}
+ public static void parameter_initialization()
+ {
+ var simple = new test.StructSimple(0x1, 0x2, (char)0x3, 0x4, 0x5);
+ Test.AssertEquals(0x1, simple.Fbyte);
+ Test.AssertEquals(0x2, simple.Fubyte);
+ Test.AssertEquals(0x3, simple.Fchar);
+ Test.AssertEquals(0x4, simple.Fshort);
+ Test.AssertEquals(0x5, simple.Fushort);
+ Test.AssertEquals(0, simple.Fint);
+ }
+
// As parameters
public static void simple_in()
{
var simple = structSimpleWithValues();
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
bool r = t.StructSimpleIn(simple);
Test.Assert(r, "Function returned false");
}
- // public static void simple_ptr_in()
- // {
- // var simple = structSimpleWithValues();
- // test.Testing t = new test.TestingConcrete();
- // bool r = t.struct_simple_ptr_in(simple);
- // Test.Assert(r, "Function returned false");
- // }
+ public static void simple_ptr_in()
+ {
+ var simple = structSimpleWithValues();
+ int original = simple.Fint;
+ simple.Fmstring = "Struct Ptr In";
+ test.ITesting t = new test.Testing();
+ Test.Assert(t.StructSimplePtrIn(ref simple));
+ Test.AssertEquals(-original, simple.Fint);
+ Test.AssertEquals("nI rtP tcurtS", simple.Fmstring);
+ }
- // public static void simple_ptr_in_own()
- // {
- // var simple = structSimpleWithValues();
- // test.Testing t = new test.TestingConcrete();
- // bool r = t.struct_simple_ptr_in_own(simple);
- // Test.Assert(r, "Function returned false");
- // }
+ public static void simple_ptr_in_own()
+ {
+ var simple = structSimpleWithValues();
+ int original = simple.Fint;
+ simple.Fmstring = "Struct Ptr In Own";
+ test.ITesting t = new test.Testing();
+ test.StructSimple result = t.StructSimplePtrInOwn(ref simple);
+ Test.AssertEquals(-original, result.Fint);
+ Test.AssertEquals("nwO nI rtP tcurtS", result.Fmstring);
+ }
public static void simple_out()
{
var simple = new test.StructSimple();
- test.Testing t = new test.TestingConcrete();
- bool r = t.StructSimpleOut(ref simple);
+ test.ITesting t = new test.Testing();
+ bool r = t.StructSimpleOut(out simple);
Test.Assert(r, "Function returned false");
checkStructSimple(simple);
}
- // public static void simple_ptr_out()
- // {
- // }
+ public static void simple_ptr_out()
+ {
+ test.StructSimple simple;
+ test.ITesting t = new test.Testing();
+ test.StructSimple result = t.StructSimplePtrOut(out simple);
+ Test.AssertEquals(result.Fint, simple.Fint);
+ Test.AssertEquals(result.Fstring, simple.Fstring);
+ }
- // public static void simple_ptr_out_own()
- // {
- // }
+ public static void simple_ptr_out_own()
+ {
+ test.StructSimple simple;
+ test.ITesting t = new test.Testing();
+ test.StructSimple result = t.StructSimplePtrOutOwn(out simple);
+ Test.AssertEquals(result.Fint, simple.Fint);
+ Test.AssertEquals(simple.Fstring, "Ptr Out Own");
+ }
public static void simple_return()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var simple = t.StructSimpleReturn();
checkStructSimple(simple);
}
- // public static void simple_ptr_return()
- // {
- // }
+ public static void simple_ptr_return()
+ {
+ test.ITesting t = new test.Testing();
+ var simple = t.StructSimplePtrReturn();
+ Test.AssertEquals(simple.Fstring, "Ret Ptr");
+ }
- // public static void simple_ptr_return_own()
- // {
- // }
+ public static void simple_ptr_return_own()
+ {
+ test.ITesting t = new test.Testing();
+ var simple = t.StructSimplePtrReturnOwn();
+ Test.AssertEquals(simple.Fstring, "Ret Ptr Own");
+ }
+
+ public class StructReturner : test.TestingInherit
+ {
+ public test.StructSimple received;
+ public bool called;
+
+ public StructReturner() : base(null)
+ {
+ called = false;
+ received = default(test.StructSimple);
+ }
+
+ public override bool StructSimpleIn(test.StructSimple simple)
+ {
+ called = true;
+ received = simple;
+
+ return true;
+ }
+
+ public override bool StructSimplePtrIn(ref test.StructSimple simple)
+ {
+ called = true;
+ simple.Fstring = "Virtual Struct Ptr In";
+ return true;
+ }
+
+ public override test.StructSimple StructSimplePtrInOwn(ref test.StructSimple simple)
+ {
+ called = true;
+ received = simple;
+ return received;
+ }
+
+ public override bool StructSimpleOut(out test.StructSimple simple) {
+ called = true;
+ simple = new test.StructSimple();
+ simple.Fstring = "Virtual Struct Out";
+ return true;
+ }
+
+ public override test.StructSimple StructSimplePtrOut(out test.StructSimple simple) {
+ called = true;
+ // No way to explicitly define the ownership of the parameter.
+ simple = new test.StructSimple();
+ simple.Fstring = "Virtual Struct Ptr Out";
+ return simple;
+ }
+
+ public override test.StructSimple StructSimplePtrOutOwn(out test.StructSimple simple) {
+ called = true;
+ // No way to explicitly define the ownership of the parameter.
+ simple = new test.StructSimple();
+ simple.Fstring = "Virtual Struct Ptr Out Own";
+ return simple;
+ }
+
+ public override test.StructSimple StructSimpleReturn()
+ {
+ called = true;
+ var simple = new test.StructSimple();
+ simple.Fstring = "Virtual Struct Return";
+ return simple;
+ }
+
+ public override test.StructSimple StructSimplePtrReturn()
+ {
+ called = true;
+ var simple = new test.StructSimple();
+ simple.Fstring = "Virtual Struct Ptr Return";
+ return simple;
+ }
+
+ public override test.StructSimple StructSimplePtrReturnOwn()
+ {
+ called = true;
+ var simple = new test.StructSimple();
+ simple.Fstring = "Virtual Struct Ptr Return Own";
+ return simple;
+ }
+ }
+
+ public static void simple_in_virtual()
+ {
+ StructReturner t = new StructReturner();
+ var simple = structSimpleWithValues();
+ simple.Fstring = "Virtual Struct In";
+
+ t.CallStructSimpleIn(simple);
+ Test.Assert(t.called);
+ Test.AssertEquals(simple.Fstring, t.received.Fstring);
+ }
+
+ public static void simple_ptr_in_virtual()
+ {
+ StructReturner t = new StructReturner();
+ var simple = structSimpleWithValues();
+ string reference = "Virtual Struct Ptr In";
+
+ t.CallStructSimplePtrIn(ref simple);
+ Test.Assert(t.called);
+ Test.AssertEquals(simple.Fstring, reference);
+ }
+
+ public static void simple_ptr_in_own_virtual()
+ {
+ StructReturner t = new StructReturner();
+ var simple = structSimpleWithValues();
+ simple.Fstring = "Virtual Struct Ptr In Own";
+
+ t.CallStructSimplePtrInOwn(ref simple);
+ Test.Assert(t.called);
+ Test.AssertEquals(t.received.Fstring, simple.Fstring);
+ }
+
+ public static void simple_out_virtual()
+ {
+ StructReturner t = new StructReturner();
+ test.StructSimple simple;
+ t.CallStructSimpleOut(out simple);
+ Test.Assert(t.called, "override was not called");
+ Test.AssertEquals("Virtual Struct Out", simple.Fstring);
+ }
+
+ public static void simple_ptr_out_virtual()
+ {
+ StructReturner t = new StructReturner();
+ test.StructSimple simple;
+ t.CallStructSimplePtrOut(out simple);
+ Test.Assert(t.called, "override was not called");
+ Test.AssertEquals("Virtual Struct Ptr Out", simple.Fstring);
+ }
+
+ public static void simple_ptr_out_own_virtual()
+ {
+ StructReturner t = new StructReturner();
+ test.StructSimple simple;
+ t.CallStructSimplePtrOutOwn(out simple);
+ Test.Assert(t.called, "override was not called");
+ Test.AssertEquals("Virtual Struct Ptr Out Own", simple.Fstring);
+ }
+
+ public static void simple_return_virtual()
+ {
+ StructReturner t = new StructReturner();
+ test.StructSimple simple = t.CallStructSimpleReturn();
+ Test.Assert(t.called, "override was not called");
+ Test.AssertEquals("Virtual Struct Return", simple.Fstring);
+ }
+
+ public static void simple_ptr_return_virtual()
+ {
+ StructReturner t = new StructReturner();
+ test.StructSimple simple = t.CallStructSimplePtrReturn();
+ Test.Assert(t.called, "override was not called");
+ Test.AssertEquals("Virtual Struct Ptr Return", simple.Fstring);
+ }
+
+ public static void simple_ptr_return_own_virtual()
+ {
+ StructReturner t = new StructReturner();
+ test.StructSimple simple = t.CallStructSimplePtrReturnOwn();
+ Test.Assert(t.called, "override was not called");
+ Test.AssertEquals("Virtual Struct Ptr Return Own", simple.Fstring);
+ }
+ // Complex Structs
public static void complex_in()
{
var complex = structComplexWithValues();
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
bool r = t.StructComplexIn(complex);
Test.Assert(r, "Function returned false");
}
@@ -322,8 +521,8 @@ class TestStructs
public static void complex_out()
{
var complex = new test.StructComplex();
- test.Testing t = new test.TestingConcrete();
- bool r = t.StructComplexOut(ref complex);
+ test.ITesting t = new test.Testing();
+ bool r = t.StructComplexOut(out complex);
Test.Assert(r, "Function returned false");
checkStructComplex(complex);
}
@@ -338,7 +537,7 @@ class TestStructs
public static void complex_return()
{
- test.Testing t = new test.TestingConcrete();
+ test.ITesting t = new test.Testing();
var complex = t.StructComplexReturn();
checkStructComplex(complex);
}
diff --git a/src/tests/efl_mono/Value.cs b/src/tests/efl_mono/Value.cs
index 4744aa2ad7..78bf0b4b50 100644
--- a/src/tests/efl_mono/Value.cs
+++ b/src/tests/efl_mono/Value.cs
@@ -135,6 +135,17 @@ public static class TestEinaValue {
}
}
+ public static void TestErrorSimple()
+ {
+ using (eina.Value v = new eina.Value(eina.ValueType.Error)) {
+ eina.Error error = new eina.Error(eina.Error.NO_ERROR);
+ Test.Assert(v.Set(error));
+ eina.Error x;
+ Test.Assert(v.Get(out x));
+ Test.AssertEquals(error, x);
+ }
+ }
+
public static void TestSetWrongType()
{
using (eina.Value v = new eina.Value(eina.ValueType.String)) {
@@ -209,20 +220,20 @@ public static class TestEinaValue {
{
using (eina.Value a = new eina.Value(eina.ValueType.Optional)) {
Test.Assert(a.Optional);
- Test.Assert(a.Empty); // By default, optional values are empty
+ Test.Assert(a.OptionalEmpty); // By default, optional values are empty
// Sets expectation
int expected = 1984;
Test.Assert(a.Set(expected));
Test.Assert(a.Optional);
- Test.Assert(!a.Empty);
+ Test.Assert(!a.OptionalEmpty);
Test.Assert(a.Reset());
- Test.Assert(a.Empty);
+ Test.Assert(a.OptionalEmpty);
expected = -4891;
Test.Assert(a.Set(expected)); // Set() automatically infers the subtype from the argument.
- Test.Assert(!a.Empty);
+ Test.Assert(!a.OptionalEmpty);
int actual = 0;
Test.Assert(a.Get(out actual));
@@ -233,20 +244,20 @@ public static class TestEinaValue {
{
using (eina.Value a = new eina.Value(eina.ValueType.Optional)) {
Test.Assert(a.Optional);
- Test.Assert(a.Empty); // By default, optional values are empty
+ Test.Assert(a.OptionalEmpty); // By default, optional values are empty
// Sets expectation
uint expected = 1984;
Test.Assert(a.Set(expected));
Test.Assert(a.Optional);
- Test.Assert(!a.Empty);
+ Test.Assert(!a.OptionalEmpty);
Test.Assert(a.Reset());
- Test.Assert(a.Empty);
+ Test.Assert(a.OptionalEmpty);
expected = 0xdeadbeef;
Test.Assert(a.Set(expected));
- Test.Assert(!a.Empty);
+ Test.Assert(!a.OptionalEmpty);
uint actual = 0;
Test.Assert(a.Get(out actual));
@@ -257,26 +268,26 @@ public static class TestEinaValue {
{
using (eina.Value a = new eina.Value(eina.ValueType.Int32)) {
Test.Assert(!a.Optional);
- BoolRet dummy = () => a.Empty;
+ BoolRet dummy = () => a.OptionalEmpty;
Test.AssertRaises<eina.InvalidValueTypeException>(() => dummy());
}
using (eina.Value a = new eina.Value(eina.ValueType.Optional)) {
Test.Assert(a.Optional);
- Test.Assert(a.Empty); // By default, optional values are empty
+ Test.Assert(a.OptionalEmpty); // By default, optional values are empty
// Sets expectation
string expected = "Hello, world!";
Test.Assert(a.Set(expected));
Test.Assert(a.Optional);
- Test.Assert(!a.Empty);
+ Test.Assert(!a.OptionalEmpty);
Test.Assert(a.Reset());
- Test.Assert(a.Empty);
+ Test.Assert(a.OptionalEmpty);
expected = "!dlrow olleH";
Test.Assert(a.Set(expected));
- Test.Assert(!a.Empty);
+ Test.Assert(!a.OptionalEmpty);
string actual = String.Empty;
Test.Assert(a.Get(out actual));
@@ -291,7 +302,7 @@ public static class TestEinaValue {
{
Test.Assert(a.Optional);
- Test.Assert(a.Empty); // By default, optional values are empty
+ Test.Assert(a.OptionalEmpty); // By default, optional values are empty
// Sets expectation
Test.Assert(expected.Append(-1));
@@ -300,14 +311,14 @@ public static class TestEinaValue {
Test.Assert(a.Set(expected));
Test.Assert(a.Optional);
- Test.Assert(!a.Empty);
+ Test.Assert(!a.OptionalEmpty);
Test.Assert(a.Reset());
- Test.Assert(a.Empty);
+ Test.Assert(a.OptionalEmpty);
expected.Append(-42);
Test.Assert(a.Set(expected));
- Test.Assert(!a.Empty);
+ Test.Assert(!a.OptionalEmpty);
eina.Value actual = null;
Test.Assert(a.Get(out actual));
@@ -325,7 +336,7 @@ public static class TestEinaValue {
{
Test.Assert(a.Optional);
- Test.Assert(a.Empty); // By default, optional values are empty
+ Test.Assert(a.OptionalEmpty); // By default, optional values are empty
// Sets expectation
Test.Assert(expected.Append(-1));
@@ -334,14 +345,14 @@ public static class TestEinaValue {
Test.Assert(a.Set(expected));
Test.Assert(a.Optional);
- Test.Assert(!a.Empty);
+ Test.Assert(!a.OptionalEmpty);
Test.Assert(a.Reset());
- Test.Assert(a.Empty);
+ Test.Assert(a.OptionalEmpty);
expected.Append(-42);
Test.Assert(a.Set(expected));
- Test.Assert(!a.Empty);
+ Test.Assert(!a.OptionalEmpty);
eina.Value actual = null;
Test.Assert(a.Get(out actual));
@@ -800,6 +811,30 @@ public static class TestEinaValue {
}
}
+ public static void TestStringThroughValue() {
+ // Check if Value_Native->Value doesn't try to free the pointed string.
+ using(eina.Value value_ptr = new eina.Value(eina.ValueType.String)) {
+ string payload = "Something";
+ value_ptr.Set(payload);
+ eina.Value_Native byvalue = value_ptr;
+ eina.Value another_value_ptr = byvalue;
+ Test.AssertEquals(value_ptr, another_value_ptr);
+ }
+ }
+
+ public static void TestValueEmpty() {
+ using (eina.Value empty = new eina.Value(eina.ValueType.Empty)) {
+ Test.Assert(empty.Empty, "Value must be empty");
+
+ empty.Setup(eina.ValueType.Int32);
+
+ // Values already set-up are not empty. For this kind of empty, use Optional
+ Test.Assert(!empty.Empty, "Values already set-up must not be empty.");
+
+ empty.Set(42);
+ Test.Assert(!empty.Empty, "Values with payload must not be empty.");
+ }
+ }
// FIXME Add remaining list tests
diff --git a/src/tests/efl_mono/ValueEolian.cs b/src/tests/efl_mono/ValueEolian.cs
index ec95e42269..4c3531544b 100644
--- a/src/tests/efl_mono/ValueEolian.cs
+++ b/src/tests/efl_mono/ValueEolian.cs
@@ -11,15 +11,15 @@ namespace TestSuite {
public static class TestEinaValueEolian {
public static void TestEolianEinaValueInReturn()
{
- test.Testing obj = new test.TestingConcrete();
+ test.ITesting obj = new test.Testing();
using (eina.Value v = new eina.Value(eina.ValueType.Int32)) {
v.Set(42);
obj.SetValuePtr(v);
- Test.AssertEquals(eina.ValueOwnership.Managed, v.Ownership);
+ Test.AssertEquals(eina.Ownership.Managed, v.Ownership);
eina.Value v_received = obj.GetValuePtrOwn();
- Test.AssertEquals(eina.ValueOwnership.Managed, v_received.Ownership);
+ Test.AssertEquals(eina.Ownership.Managed, v_received.Ownership);
Test.AssertEquals(v, v_received);
v_received.Dispose();
}
@@ -27,17 +27,17 @@ public static class TestEinaValueEolian {
public static void TestEolianEinaValueInOwn()
{
- test.Testing obj = new test.TestingConcrete();
+ test.ITesting obj = new test.Testing();
using (eina.Value v = new eina.Value(eina.ValueType.Int32)) {
v.Set(2001);
- Test.AssertEquals(eina.ValueOwnership.Managed, v.Ownership);
+ Test.AssertEquals(eina.Ownership.Managed, v.Ownership);
obj.SetValuePtrOwn(v);
- Test.AssertEquals(eina.ValueOwnership.Unmanaged, v.Ownership);
+ Test.AssertEquals(eina.Ownership.Unmanaged, v.Ownership);
eina.Value v_received = obj.GetValuePtr();
- Test.AssertEquals(eina.ValueOwnership.Unmanaged, v_received.Ownership);
+ Test.AssertEquals(eina.Ownership.Unmanaged, v_received.Ownership);
Test.AssertEquals(v, v_received);
@@ -47,7 +47,7 @@ public static class TestEinaValueEolian {
public static void TestEolianEinaValueOut()
{
- test.Testing obj = new test.TestingConcrete();
+ test.ITesting obj = new test.Testing();
using (eina.Value v = new eina.Value(eina.ValueType.String)) {
eina.Value v_out = null;
@@ -57,13 +57,13 @@ public static class TestEinaValueEolian {
obj.OutValuePtr(out v_out);
Test.AssertEquals(v, v_out);
- Test.AssertEquals(eina.ValueOwnership.Unmanaged, v_out.Ownership);
+ Test.AssertEquals(eina.Ownership.Unmanaged, v_out.Ownership);
}
}
public static void TestEolianEinaValueOutOwn()
{
- test.Testing obj = new test.TestingConcrete();
+ test.ITesting obj = new test.Testing();
using (eina.Value v = new eina.Value(eina.ValueType.String)) {
eina.Value v_out = null;
@@ -73,30 +73,13 @@ public static class TestEinaValueEolian {
obj.OutValuePtrOwn(out v_out);
Test.AssertEquals(v, v_out);
- Test.AssertEquals(eina.ValueOwnership.Managed, v_out.Ownership);
- }
- }
-
- public static void TestEolianEinaValueInReturnByValue()
- {
- test.Testing obj = new test.TestingConcrete();
-
- using (eina.Value v = new eina.Value(eina.ValueType.Int32)) {
- v.Set(42);
- obj.SetValue(v);
- Test.AssertEquals(eina.ValueOwnership.Managed, v.Ownership);
-
- // Using get_value_ptr while get_value() is not supported.
- eina.Value v_received = obj.GetValuePtrOwn();
- Test.AssertEquals(eina.ValueOwnership.Managed, v_received.Ownership);
- Test.AssertEquals(v, v_received);
- v_received.Dispose();
+ Test.AssertEquals(eina.Ownership.Managed, v_out.Ownership);
}
}
public static void TestEolianEinaValueOutByValue()
{
- test.Testing obj = new test.TestingConcrete();
+ test.ITesting obj = new test.Testing();
using (eina.Value v = new eina.Value(eina.ValueType.String)) {
eina.Value v_out = null;
@@ -106,7 +89,31 @@ public static class TestEinaValueEolian {
obj.OutValue(out v_out);
Test.AssertEquals(v, v_out);
- Test.AssertEquals(eina.ValueOwnership.Managed, v_out.Ownership);
+ Test.AssertEquals(eina.Ownership.Managed, v_out.Ownership);
+ }
+ }
+
+ private class ValueHandler : test.TestingInherit
+ {
+ public eina.Value value;
+
+ public ValueHandler() : base(null)
+ {
+ value = null;
+ }
+
+ public override void SetValue(eina.Value value)
+ {
+ this.value = value;
+ }
+ }
+
+ public static void TestEolianEinaValueByValueConst()
+ {
+ ValueHandler obj = new ValueHandler();
+ using (eina.Value val = new eina.Value(eina.ValueType.String)) {
+ obj.CallSetValue(val);
+ Test.AssertEquals(val, obj.value);
}
}
}
diff --git a/src/tests/efl_mono/libefl_mono_native_test.c b/src/tests/efl_mono/libefl_mono_native_test.c
index eedc12fac7..caf7fd98a8 100644
--- a/src/tests/efl_mono/libefl_mono_native_test.c
+++ b/src/tests/efl_mono/libefl_mono_native_test.c
@@ -3,6 +3,9 @@
#include "config.h"
#endif
+#define EFL_PART_PROTECTED
+
+#include <Ecore.h>
#include <Eo.h>
#undef EOAPI
@@ -10,15 +13,15 @@
#define EOAPI EAPI EAPI_WEAK
#ifdef _WIN32
-# ifdef EFL_EO_BUILD
+# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
-# endif /* ! DLL_EXPORT */
+# endif
# else
# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EO_BUILD */
+# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -29,11 +32,13 @@
# else
# define EAPI
# endif
-#endif /* ! _WIN32 */
+#endif
#include "test_numberwrapper.eo.h"
#include "test_testing.eo.h"
+#include <interfaces/efl_part.eo.h>
+
#define EQUAL(a, b) ((a) == (b) ? 1 : (fprintf(stderr, "NOT EQUAL! %s:%i (%s)", __FILE__, __LINE__, __FUNCTION__), fflush(stderr), 0))
#define STR_EQUAL(a, b) (strcmp((a), (b)) == 0 ? 1 : (fprintf(stderr, "NOT EQUAL! %s:%i (%s) '%s' != '%s'", __FILE__, __LINE__, __FUNCTION__, (a), (b)), fflush(stderr), 0))
@@ -44,7 +49,12 @@ typedef struct Test_Testing_Data
Eina_Free_Cb free_cb;
Eina_Error error_code;
Eina_Value *stored_value;
-
+ Test_StructSimple stored_struct;
+ int stored_int;
+ Eo *part1;
+ Eo *part2;
+ Eina_Promise *promise;
+ Eina_List *list_for_accessor;
} Test_Testing_Data;
typedef struct Test_Numberwrapper_Data
@@ -80,7 +90,7 @@ char **_new_str_ref(const char* str)
static
Test_Numberwrapper *_new_obj(int n)
{
- return efl_add(TEST_NUMBERWRAPPER_CLASS, NULL, test_numberwrapper_number_set(efl_added, n));
+ return efl_add_ref(TEST_NUMBERWRAPPER_CLASS, NULL, test_numberwrapper_number_set(efl_added, n));
}
static
@@ -95,11 +105,37 @@ Test_Numberwrapper **_new_obj_ref(int n)
// Test.Testing //
// ############ //
+static Efl_Object*
+_test_testing_efl_object_constructor(Eo *obj, Test_Testing_Data *pd)
+{
+ efl_constructor(efl_super(obj, TEST_TESTING_CLASS));
+
+ // To avoid an infinite loop calling the same constructor
+ if (!efl_parent_get(obj))
+ {
+ pd->part1 = efl_add(TEST_TESTING_CLASS, obj, efl_name_set(efl_added, "part1"));
+ pd->part2 = efl_add(TEST_TESTING_CLASS, obj, efl_name_set(efl_added, "part2"));
+ }
+
+ return obj;
+}
+
Efl_Object *_test_testing_return_object(Eo *obj, EINA_UNUSED Test_Testing_Data *pd)
{
return obj;
}
+void _test_testing_int_out(EINA_UNUSED Eo *obj, EINA_UNUSED Test_Testing_Data *pd, int x, int *y)
+{
+ *y = -x;
+}
+
+void _test_testing_int_ptr_out(EINA_UNUSED Eo *obj, Test_Testing_Data *pd, int x, int **y)
+{
+ pd->stored_int = x * 2;
+ *y = &pd->stored_int;
+}
+
const char *_test_testing_in_string(EINA_UNUSED Eo *obj, EINA_UNUSED Test_Testing_Data *pd, const char *str)
{
const char *ret = malloc(sizeof(char)*(strlen(str) + 1));
@@ -3248,46 +3284,6 @@ Eina_Bool check_and_modify_struct_simple(Test_StructSimple *simple)
}
static
-Eina_Bool check_zeroed_struct_simple(Test_StructSimple *simple)
-{
- Eina_Bool ret =
- simple->fbyte == 0
- && simple->fubyte == 0
- && simple->fchar == '\0'
- && simple->fshort == 0
- && simple->fushort == 0
- && simple->fint == 0
- && simple->fuint == 0
- && simple->flong == 0
- && simple->fulong == 0
- && simple->fllong == 0
- && simple->fullong == 0
- && simple->fint8 == 0
- && simple->fuint8 == 0
- && simple->fint16 == 0
- && simple->fuint16 == 0
- && simple->fint32 == 0
- && simple->fuint32 == 0
- && simple->fint64 == 0
- && simple->fuint64 == 0
- && simple->fssize == 0
- && simple->fsize == 0
- && simple->fintptr == 0x00
- && simple->fptrdiff == 0
- && simple->ffloat == 0
- && simple->fdouble == 0
- && simple->fbool == EINA_FALSE
- && simple->fvoid_ptr == NULL
- && simple->fenum == TEST_SAMPLEENUM_V0
- && simple->fstring == NULL
- && simple->fmstring == NULL
- && simple->fstringshare == NULL
- ;
-
- return ret;
-}
-
-static
void struct_complex_with_values(Test_StructComplex *complex)
{
complex->farray = eina_array_new(4);
@@ -3374,32 +3370,6 @@ Eina_Bool check_and_modify_struct_complex(Test_StructComplex *complex)
return EINA_TRUE;
}
-static
-Eina_Bool check_zeroed_struct_complex(Test_StructComplex *complex)
-{
- Eina_Bool ret =
- complex->farray == NULL
- && complex->finarray == NULL
- && complex->flist == NULL
- && complex->finlist == NULL
- && complex->fhash == NULL
- && complex->fiterator == NULL
-
- && complex->fany_value.type == NULL
- && complex->fany_value.value._guarantee == 0
-
- && complex->fany_value_ptr == NULL
- && complex->fbinbuf == NULL
-
- && complex->fslice.len == 0
- && complex->fslice.mem == NULL
-
- && complex->fobj == NULL
- ;
-
- return ret;
-}
-
// with simple types
EOLIAN
@@ -3408,20 +3378,34 @@ Eina_Bool _test_testing_struct_simple_in(EINA_UNUSED Eo *obj, EINA_UNUSED Test_T
return check_and_modify_struct_simple(&simple);
}
+static void _reverse_string(char *str)
+{
+ int len = strlen(str);
+ if (len > 0) {
+ for (int i=0, k=len-1; i < len/2; i++, k--) {
+ char tmp = str[k];
+ str[k] = str[i];
+ str[i] = tmp;
+ }
+ }
+}
+
EOLIAN
Eina_Bool _test_testing_struct_simple_ptr_in(EINA_UNUSED Eo *obj, EINA_UNUSED Test_Testing_Data *pd, Test_StructSimple *simple)
{
- (void) simple;
- EINA_LOG_ERR("Not implemented!");
- return EINA_FALSE;
+ simple->fint = -simple->fint;
+ _reverse_string(simple->fmstring);
+ return EINA_TRUE;
}
EOLIAN
-Eina_Bool _test_testing_struct_simple_ptr_in_own(EINA_UNUSED Eo *obj, EINA_UNUSED Test_Testing_Data *pd, Test_StructSimple *simple)
+Test_StructSimple _test_testing_struct_simple_ptr_in_own(EINA_UNUSED Eo *obj, EINA_UNUSED Test_Testing_Data *pd, Test_StructSimple *simple)
{
- (void) simple;
- EINA_LOG_ERR("Not implemented!");
- return EINA_FALSE;
+ Test_StructSimple ret = *simple;
+ free(simple);
+ ret.fint = -ret.fint;
+ _reverse_string(ret.fmstring);
+ return ret;
}
EOLIAN
@@ -3439,19 +3423,20 @@ Eina_Bool _test_testing_struct_simple_out(EINA_UNUSED Eo *obj, EINA_UNUSED Test_
}
EOLIAN
-Eina_Bool _test_testing_struct_simple_ptr_out(EINA_UNUSED Eo *obj, EINA_UNUSED Test_Testing_Data *pd, Test_StructSimple **simple)
+Test_StructSimple _test_testing_struct_simple_ptr_out(EINA_UNUSED Eo *obj, Test_Testing_Data *pd, Test_StructSimple **simple)
{
- (void) simple;
- EINA_LOG_ERR("Not implemented!");
- return EINA_FALSE;
+ struct_simple_with_values(&pd->stored_struct);
+ *simple = &pd->stored_struct;
+ return **simple;
}
EOLIAN
-Eina_Bool _test_testing_struct_simple_ptr_out_own(EINA_UNUSED Eo *obj, EINA_UNUSED Test_Testing_Data *pd, Test_StructSimple **simple)
+Test_StructSimple _test_testing_struct_simple_ptr_out_own(EINA_UNUSED Eo *obj, EINA_UNUSED Test_Testing_Data *pd, Test_StructSimple **simple)
{
- (void) simple;
- EINA_LOG_ERR("Not implemented!");
- return EINA_FALSE;
+ *simple = malloc(sizeof(Test_StructSimple));
+ struct_simple_with_values(*simple);
+ (*simple)->fstring = "Ptr Out Own";
+ return **simple;
}
EOLIAN
@@ -3465,15 +3450,72 @@ Test_StructSimple _test_testing_struct_simple_return(EINA_UNUSED Eo *obj, EINA_U
EOLIAN
Test_StructSimple *_test_testing_struct_simple_ptr_return(EINA_UNUSED Eo *obj, EINA_UNUSED Test_Testing_Data *pd)
{
- EINA_LOG_ERR("Not implemented!");
- return NULL;
+ struct_simple_with_values(&pd->stored_struct);
+ pd->stored_struct.fstring = "Ret Ptr";
+ return &pd->stored_struct;
}
EOLIAN
Test_StructSimple *_test_testing_struct_simple_ptr_return_own(EINA_UNUSED Eo *obj, EINA_UNUSED Test_Testing_Data *pd)
{
- EINA_LOG_ERR("Not implemented!");
- return NULL;
+ Test_StructSimple *ret = malloc(sizeof(Test_StructSimple));
+ struct_simple_with_values(ret);
+ ret->fstring = "Ret Ptr Own";
+ return ret;
+}
+
+EOLIAN
+void _test_testing_call_struct_simple_in(Eo *obj, EINA_UNUSED Test_Testing_Data *pd, Test_StructSimple simple)
+{
+ test_testing_struct_simple_in(obj, simple);
+}
+
+EOLIAN
+void _test_testing_call_struct_simple_ptr_in(Eo *obj, EINA_UNUSED Test_Testing_Data *pd, Test_StructSimple *simple)
+{
+ test_testing_struct_simple_ptr_in(obj, simple);
+}
+
+EOLIAN
+void _test_testing_call_struct_simple_ptr_in_own(Eo *obj, EINA_UNUSED Test_Testing_Data *pd, Test_StructSimple *simple)
+{
+ test_testing_struct_simple_ptr_in_own(obj, simple);
+}
+
+EOLIAN
+void _test_testing_call_struct_simple_out(Eo *obj, EINA_UNUSED Test_Testing_Data *pd, Test_StructSimple *simple)
+{
+ test_testing_struct_simple_out(obj, simple);
+}
+
+EOLIAN
+void _test_testing_call_struct_simple_ptr_out(Eo *obj, EINA_UNUSED Test_Testing_Data *pd, Test_StructSimple **simple)
+{
+ test_testing_struct_simple_ptr_out(obj, simple);
+}
+
+EOLIAN
+void _test_testing_call_struct_simple_ptr_out_own(Eo *obj, EINA_UNUSED Test_Testing_Data *pd, Test_StructSimple **simple)
+{
+ test_testing_struct_simple_ptr_out_own(obj, simple);
+}
+
+EOLIAN
+Test_StructSimple _test_testing_call_struct_simple_return(Eo *obj, EINA_UNUSED Test_Testing_Data *pd)
+{
+ return test_testing_struct_simple_return(obj);
+}
+
+EOLIAN
+Test_StructSimple *_test_testing_call_struct_simple_ptr_return(Eo *obj, EINA_UNUSED Test_Testing_Data *pd)
+{
+ return test_testing_struct_simple_ptr_return(obj);
+}
+
+EOLIAN
+Test_StructSimple *_test_testing_call_struct_simple_ptr_return_own(Eo *obj, EINA_UNUSED Test_Testing_Data *pd)
+{
+ return test_testing_struct_simple_ptr_return_own(obj);
}
// with complex types
@@ -3588,7 +3630,7 @@ void _test_numberwrapper_number_set(EINA_UNUSED Eo *obj, Test_Numberwrapper_Data
pd->number = n;
}
-int _test_numberwrapper_number_get(EINA_UNUSED Eo *obj, Test_Numberwrapper_Data *pd)
+int _test_numberwrapper_number_get(EINA_UNUSED const Eo *obj, Test_Numberwrapper_Data *pd)
{
return pd->number;
}
@@ -3625,6 +3667,11 @@ void _test_testing_set_value(EINA_UNUSED Eo *obj, Test_Testing_Data *pd, Eina_Va
eina_value_copy(&value, pd->stored_value);
}
+void _test_testing_call_set_value(Eo *obj, EINA_UNUSED Test_Testing_Data *pd, const Eina_Value v)
+{
+ test_testing_set_value(obj, v);
+}
+
Eina_Value *_test_testing_get_value_ptr_own(EINA_UNUSED Eo *obj, Test_Testing_Data *pd)
{
Eina_Value *val = pd->stored_value;
@@ -3637,14 +3684,6 @@ Eina_Value *_test_testing_get_value_ptr(EINA_UNUSED Eo *obj, Test_Testing_Data *
return pd->stored_value;
}
-/* Currently the Eolian declaration FUNC_BODY in the .eo.c file seems to be broken for
- * generic value.
- */
-/* Eina_Value _test_testing_get_value(EINA_UNUSED Eo *obj, Test_Testing_Data *pd)
-{
- return *pd->stored_value;
-}*/
-
void _test_testing_clear_value(EINA_UNUSED Eo *obj, Test_Testing_Data *pd)
{
if (pd->stored_value) {
@@ -3669,6 +3708,157 @@ void _test_testing_out_value(EINA_UNUSED Eo *obj, Test_Testing_Data *pd, Eina_Va
*value = *pd->stored_value;
}
+void _test_testing_emit_event_with_string(Eo *obj, EINA_UNUSED Test_Testing_Data *pd, const char *data)
+{
+ char *ptr = strdup(data);
+ efl_event_callback_legacy_call(obj, TEST_TESTING_EVENT_EVT_WITH_STRING, ptr);
+ free(ptr);
+}
+
+void _test_testing_emit_event_with_bool(Eo *obj, EINA_UNUSED Test_Testing_Data *pd, Eina_Bool data)
+{
+ efl_event_callback_legacy_call(obj, TEST_TESTING_EVENT_EVT_WITH_BOOL, (void *) (uintptr_t) data);
+}
+
+void _test_testing_emit_event_with_int(Eo *obj, EINA_UNUSED Test_Testing_Data *pd, int data)
+{
+ efl_event_callback_legacy_call(obj, TEST_TESTING_EVENT_EVT_WITH_INT, (void *) (uintptr_t) data);
+}
+
+void _test_testing_emit_event_with_uint(Eo *obj, EINA_UNUSED Test_Testing_Data *pd, unsigned int data)
+{
+ efl_event_callback_legacy_call(obj, TEST_TESTING_EVENT_EVT_WITH_UINT, (void *) (uintptr_t) data);
+}
+
+void _test_testing_emit_event_with_obj(Eo *obj, EINA_UNUSED Test_Testing_Data *pd, Eo *data)
+{
+ efl_event_callback_legacy_call(obj, TEST_TESTING_EVENT_EVT_WITH_OBJ, data);
+}
+
+void _test_testing_emit_event_with_error(Eo *obj, EINA_UNUSED Test_Testing_Data *pd, Eina_Error data)
+{
+ efl_event_callback_legacy_call(obj, TEST_TESTING_EVENT_EVT_WITH_ERROR, &data);
+}
+
+void _test_testing_emit_event_with_struct(Eo *obj, EINA_UNUSED Test_Testing_Data *pd, Test_StructSimple data)
+{
+ efl_event_callback_legacy_call(obj, TEST_TESTING_EVENT_EVT_WITH_STRUCT, &data);
+}
+
+
+Efl_Object *_test_testing_efl_part_part_get(EINA_UNUSED const Eo *obj, Test_Testing_Data *pd, const char *name)
+{
+ if (!strcmp(name, "part1"))
+ return pd->part1;
+ else if (!strcmp(name, "part2"))
+ return pd->part2;
+ else
+ return NULL;
+}
+
+void _test_testing_append_to_strbuf(EINA_UNUSED Eo *obj, EINA_UNUSED Test_Testing_Data *pd, Eina_Strbuf *buf, const char *str)
+{
+ eina_strbuf_append(buf, str);
+}
+
+void _test_testing_call_append_to_strbuf(Eo * obj, EINA_UNUSED Test_Testing_Data *pd, Eina_Strbuf *buf, const char *str)
+{
+ test_testing_append_to_strbuf(obj, buf, str);
+}
+
+void _test_testing_call_format_cb(EINA_UNUSED Eo *obj, EINA_UNUSED Test_Testing_Data *pd, Eina_Strbuf *buf, const Eina_Value value,
+ void *func_data, Test_FormatCb func, Eina_Free_Cb func_free_cb)
+{
+ func(func_data, buf, value);
+ func_free_cb(func_data);
+}
+
+Test_MyInt _test_testing_bypass_typedef(EINA_UNUSED Eo *obj, EINA_UNUSED Test_Testing_Data *pd, Test_MyInt data, Test_MyInt *receiver)
+{
+ *receiver = data;
+ return data;
+}
+
+/* Class Properties */
+static int _test_testing_klass_prop = 0;
+
+int _test_testing_klass_prop_get(const Eo *klass, EINA_UNUSED void *pd)
+{
+ EINA_LOG_ERR("FAIL on GET");
+ if (klass != test_testing_class_get())
+ {
+ eina_error_set(EINVAL);
+ return -1;
+ }
+ return _test_testing_klass_prop;
+}
+
+void _test_testing_klass_prop_set(Eo *klass, EINA_UNUSED void *pd, int value)
+{
+ EINA_LOG_ERR("FAIL on SET");
+ if (klass != test_testing_class_get())
+ {
+ eina_error_set(EINVAL);
+ }
+ _test_testing_klass_prop = value;
+}
+
+static void _promise_cancelled(void *data, EINA_UNUSED const Eina_Promise *p)
+{
+ Test_Testing_Data *pd = data;
+ pd->promise = NULL;
+}
+
+Eina_Future* _test_testing_get_future(EINA_UNUSED Eo *obj, Test_Testing_Data *pd)
+{
+ if (pd->promise == NULL)
+ {
+ Eo *loop = efl_app_loop_main_get(EFL_APP_CLASS);
+ Eina_Future_Scheduler *scheduler = efl_loop_future_scheduler_get(loop);
+ pd->promise = eina_promise_new(scheduler, _promise_cancelled, pd);
+ }
+ return eina_future_new(pd->promise);
+}
+
+void _test_testing_fulfill_promise(Eo *obj, Test_Testing_Data *pd, int data)
+{
+ if (pd->promise == NULL)
+ {
+ EINA_LOG_ERR("Can't fulfill an object without a valid promise.");
+ return;
+ }
+ Eina_Value v;
+ eina_value_setup(&v, EINA_VALUE_TYPE_INT);
+ eina_value_set(&v, data);
+ eina_promise_resolve(pd->promise, v);
+}
+
+void _test_testing_reject_promise(Eo *obj, Test_Testing_Data *pd, Eina_Error err)
+{
+ if (pd->promise == NULL)
+ {
+ EINA_LOG_ERR("Can't fulfill an object without a valid promise.");
+ return;
+ }
+
+ eina_promise_reject(pd->promise, err);
+}
+
+Eina_Accessor *_test_testing_clone_accessor(Eo *obj, Test_Testing_Data *pd, Eina_Accessor *acc)
+{
+ if (pd->list_for_accessor)
+ eina_list_free(pd->list_for_accessor);
+
+ unsigned int i;
+ int *data;
+ EINA_ACCESSOR_FOREACH(acc, i, data)
+ {
+ pd->list_for_accessor = eina_list_append(pd->list_for_accessor, data);
+ }
+
+ return eina_list_accessor_new(pd->list_for_accessor);
+}
+
#include "test_testing.eo.c"
#include "test_numberwrapper.eo.c"
diff --git a/src/tests/efl_mono/test_child.eo b/src/tests/efl_mono/test_child.eo
new file mode 100644
index 0000000000..d12ba6d3c6
--- /dev/null
+++ b/src/tests/efl_mono/test_child.eo
@@ -0,0 +1,9 @@
+import eina_types;
+
+class Test.Child (Test.Testing) {
+
+ implements {
+ class.constructor;
+ class.destructor;
+ }
+}
diff --git a/src/tests/efl_mono/test_testing.eo b/src/tests/efl_mono/test_testing.eo
index fec5f901f9..26692ea948 100644
--- a/src/tests/efl_mono/test_testing.eo
+++ b/src/tests/efl_mono/test_testing.eo
@@ -1,5 +1,7 @@
import eina_types;
+type Test.MyInt: int;
+
enum Test.SampleEnum {
v0,
v1,
@@ -57,6 +59,7 @@ struct Test.StructSimple
fstring: string;
fmstring: mstring;
fstringshare: stringshare;
+ fmyint: Test.MyInt;
}
struct Test.StructComplex {
@@ -81,12 +84,38 @@ function Test.SimpleCb {
return: int;
};
-class Test.Testing (Efl.Object) {
+function Test.FormatCb {
+ params {
+ @in str: strbuf;
+ @in value: const(any_value);
+ }
+};
+
+class Test.Testing (Efl.Object, Efl.Part) {
+
+ parts {
+ part1: Test.Testing; [[ Part number one. ]]
+ part2: Test.Testing; [[ Part number two. ]]
+ }
methods {
return_object {
return: Test.Testing;
}
+ int_out {
+ params {
+ @in x: int;
+ @out y: int;
+ }
+ }
+
+ int_ptr_out {
+ params {
+ @in x: int;
+ @out y: ptr(int);
+ }
+ }
+
in_stringshare {
params {
@in v: stringshare;
@@ -1308,6 +1337,12 @@ class Test.Testing (Efl.Object) {
}
}
+ call_set_value {
+ params {
+ value: const(any_value);
+ }
+ }
+
get_value_ptr_own {
return: any_value_ptr @owned;
}
@@ -1355,19 +1390,19 @@ class Test.Testing (Efl.Object) {
return: bool;
}
- // struct_simple_ptr_in {
- // params {
- // @in simple: ptr(Test.StructSimple);
- // }
- // return: bool;
- // }
- //
- // struct_simple_ptr_in_own {
- // params {
- // @in simple: ptr(Test.StructSimple) @owned;
- // }
- // return: bool;
- // }
+ struct_simple_ptr_in {
+ params {
+ @in simple: ptr(Test.StructSimple);
+ }
+ return: bool;
+ }
+
+ struct_simple_ptr_in_own {
+ params {
+ @in simple: ptr(Test.StructSimple) @owned;
+ }
+ return: Test.StructSimple;
+ }
struct_simple_out {
params {
@@ -1376,31 +1411,79 @@ class Test.Testing (Efl.Object) {
return: bool;
}
- // struct_simple_ptr_out {
- // params {
- // @out simple: ptr(Test.StructSimple);
- // }
- // return: bool;
- // }
- //
- // struct_simple_ptr_out_own {
- // params {
- // @out simple: ptr(Test.StructSimple) @owned;
- // }
- // return: bool;
- // }
+ struct_simple_ptr_out {
+ params {
+ @out simple: ptr(Test.StructSimple);
+ }
+ return: Test.StructSimple;
+ }
+
+ struct_simple_ptr_out_own {
+ params {
+ @out simple: ptr(Test.StructSimple) @owned;
+ }
+ return: Test.StructSimple;
+ }
struct_simple_return {
return: Test.StructSimple;
}
- // struct_simple_ptr_return {
- // return: ptr(Test.StructSimple);
- // }
- //
- // struct_simple_ptr_return_own {
- // return: ptr(Test.StructSimple) @owned;
- // }
+ struct_simple_ptr_return {
+ return: ptr(Test.StructSimple);
+ }
+
+ struct_simple_ptr_return_own {
+ return: ptr(Test.StructSimple) @owned;
+ }
+
+ call_struct_simple_in {
+ params {
+ @in simple: Test.StructSimple;
+ }
+ }
+
+ call_struct_simple_ptr_in {
+ params {
+ @in simple: ptr(Test.StructSimple);
+ }
+ }
+
+ call_struct_simple_ptr_in_own {
+ params {
+ @in simple: ptr(Test.StructSimple) @owned;
+ }
+ }
+
+ call_struct_simple_out {
+ params {
+ @out simple: Test.StructSimple;
+ }
+ }
+
+ call_struct_simple_ptr_out {
+ params {
+ @out simple: ptr(Test.StructSimple);
+ }
+ }
+
+ call_struct_simple_ptr_out_own {
+ params {
+ @out simple: ptr(Test.StructSimple) @owned;
+ }
+ }
+
+ call_struct_simple_return {
+ return: Test.StructSimple;
+ }
+
+ call_struct_simple_ptr_return {
+ return: ptr(Test.StructSimple);
+ }
+
+ call_struct_simple_ptr_return_own {
+ return: ptr(Test.StructSimple) @owned;
+ }
struct_complex_in {
params {
@@ -1409,19 +1492,19 @@ class Test.Testing (Efl.Object) {
return: bool;
}
- // struct_complex_ptr_in {
- // params {
- // @in complex: ptr(Test.StructComplex);
- // }
- // return: bool;
- // }
- //
- // struct_complex_ptr_in_own {
- // params {
- // @in complex: ptr(Test.StructComplex) @owned;
- // }
- // return: bool;
- // }
+ struct_complex_ptr_in {
+ params {
+ @in complex: ptr(Test.StructComplex);
+ }
+ return: bool;
+ }
+
+ struct_complex_ptr_in_own {
+ params {
+ @in complex: ptr(Test.StructComplex) @owned;
+ }
+ return: bool;
+ }
struct_complex_out {
params {
@@ -1455,9 +1538,123 @@ class Test.Testing (Efl.Object) {
// struct_complex_ptr_return_own {
// return: ptr(Test.StructComplex) @owned;
// }
+
+ emit_event_with_string {
+ params {
+ @in data: string;
+ }
+ }
+ emit_event_with_bool {
+ params {
+ @in data: bool;
+ }
+ }
+ emit_event_with_int {
+ params {
+ @in data: int;
+ }
+ }
+ emit_event_with_uint {
+ params {
+ @in data: uint;
+ }
+ }
+ emit_event_with_obj {
+ params {
+ @in data: Test.Testing;
+ }
+ }
+
+ emit_event_with_error {
+ params {
+ @in data: Eina.Error;
+ }
+ }
+
+ emit_event_with_struct {
+ params {
+ @in data: Test.StructSimple;
+ }
+ }
+
+ append_to_strbuf {
+ params {
+ @in buf: strbuf;
+ @in str: string;
+ }
+ }
+
+ call_append_to_strbuf {
+ params {
+ @in buf: strbuf;
+ @in str: string;
+ }
+ }
+
+ call_format_cb {
+ params {
+ @in str: strbuf;
+ @in value: const(any_value);
+ @in func: Test.FormatCb;
+ }
+ }
+
+ bypass_typedef {
+ params {
+ @in data: Test.MyInt;
+ @out receiver: Test.MyInt;
+ }
+
+ return: Test.MyInt;
+ }
+
+ @property klass_prop @class {
+ get {}
+ set {}
+ values {
+ prop: int;
+ }
+ }
+
+ /* Futures */
+
+ get_future {
+ return: future<any_value_ptr>;
+ }
+
+ fulfill_promise {
+ params {
+ @in data: int;
+ }
+ }
+
+ reject_promise {
+ params {
+ @in error: Eina.Error;
+ }
+ }
+
+ /* Accessors */
+ clone_accessor {
+ params {
+ @in acc: accessor<ptr(int)>;
+ }
+ return: accessor<ptr(int)> @owned;
+ }
}
implements {
class.constructor;
class.destructor;
+ Efl.Object.constructor;
+ Efl.Part.part_get;
+ }
+ events {
+ evt,with,string @hot: string;
+ evt,with,bool: bool;
+ evt,with,int @hot: int;
+ evt,with,uint @hot: uint;
+ evt,with,obj @hot: Test.Testing;
+ evt,with,error @hot: Eina.Error;
+ evt,with,struct @hot: Test.StructSimple;
}
}
diff --git a/src/tests/efreet/efreet_async_test.c b/src/tests/efreet/efreet_async_test.c
index 49acaa0c16..0b116c30a4 100644
--- a/src/tests/efreet/efreet_async_test.c
+++ b/src/tests/efreet/efreet_async_test.c
@@ -1,7 +1,14 @@
+/*
+
+XXX: Disable test until a better implementation can be made
+For now efreet_menu_async_parse is deprecated.
+
+
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
+
#include <unistd.h>
#include <Eina.h>
@@ -61,6 +68,7 @@ main(void)
ecore_init();
efreet_init();
+
eina_lock_new(&lock);
create_threads();
@@ -69,9 +77,13 @@ main(void)
eina_thread_join(threads[i]);
eina_lock_free(&lock);
-
efreet_shutdown();
ecore_shutdown();
eina_shutdown();
+*/
+
+int
+main(void)
+{
return 0;
}
diff --git a/src/tests/efreet/efreet_suite.c b/src/tests/efreet/efreet_suite.c
index 463215354e..ea1161e8f7 100644
--- a/src/tests/efreet/efreet_suite.c
+++ b/src/tests/efreet/efreet_suite.c
@@ -4,6 +4,7 @@
#include "efreet_suite.h"
#include "../efl_check.h"
+#include <Efreet.h>
static const Efl_Test_Case etc[] = {
{ "Efreet", efreet_test_efreet },
@@ -11,6 +12,16 @@ static const Efl_Test_Case etc[] = {
{ NULL, NULL }
};
+SUITE_INIT(efreet)
+{
+ ck_assert_int_eq(efreet_init(), 1);
+}
+
+SUITE_SHUTDOWN(efreet)
+{
+ ck_assert_int_eq(efreet_shutdown(), 0);
+}
+
int
main(int argc, char **argv)
{
@@ -24,7 +35,7 @@ main(int argc, char **argv)
#endif
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
- "Efreet", etc);
+ "Efreet", etc, SUITE_INIT_FN(efreet), SUITE_SHUTDOWN_FN(efreet));
return (failed_count == 0) ? 0 : 255;
}
diff --git a/src/tests/efreet/efreet_suite.h b/src/tests/efreet/efreet_suite.h
index bfb47f9dab..3cc526363a 100644
--- a/src/tests/efreet/efreet_suite.h
+++ b/src/tests/efreet/efreet_suite.h
@@ -2,7 +2,7 @@
#define _EFREET_SUITE_H
#include <check.h>
-
+#include "../efl_check.h"
void efreet_test_efreet(TCase *tc);
void efreet_test_efreet_cache(TCase *tc);
diff --git a/src/tests/efreet/efreet_test_efreet.c b/src/tests/efreet/efreet_test_efreet.c
index d35ec9effd..eec3b7f6a8 100644
--- a/src/tests/efreet/efreet_test_efreet.c
+++ b/src/tests/efreet/efreet_test_efreet.c
@@ -7,17 +7,10 @@
#include "efreet_suite.h"
-START_TEST(efreet_test_efreet_init)
+EFL_START_TEST(efreet_test_efreet_init)
{
- int ret;
-
- ret = efreet_init();
- fail_if(ret != 1);
-
- ret = efreet_shutdown();
- fail_if(ret != 0);
}
-END_TEST
+EFL_END_TEST
void efreet_test_efreet(TCase *tc)
{
diff --git a/src/tests/efreet/efreet_test_efreet_cache.c b/src/tests/efreet/efreet_test_efreet_cache.c
index 2f8972de33..83f882d1cc 100644
--- a/src/tests/efreet/efreet_test_efreet_cache.c
+++ b/src/tests/efreet/efreet_test_efreet_cache.c
@@ -7,17 +7,11 @@
#include "efreet_suite.h"
-START_TEST(efreet_test_efreet_cache_init)
+EFL_START_TEST(efreet_test_efreet_cache_init)
{
- int ret;
-
- ret = efreet_init();
- fail_if(ret != 1);
-
- ret = efreet_shutdown();
- fail_if(ret != 0);
+ /* FIXME: this should maybe do something? */
}
-END_TEST
+EFL_END_TEST
void efreet_test_efreet_cache(TCase *tc)
{
diff --git a/src/tests/eina/eina_suite.c b/src/tests/eina/eina_suite.c
index 8e833356f3..dfa2bd1e5f 100644
--- a/src/tests/eina/eina_suite.c
+++ b/src/tests/eina/eina_suite.c
@@ -32,17 +32,17 @@
#include "../efl_check.h"
static const Efl_Test_Case etc[] = {
- { "FixedPoint", eina_test_fp },
+ { "fp", eina_test_fp },
{ "Inarray", eina_test_inarray },
{ "Array", eina_test_array },
- { "Binary Share", eina_test_binshare },
- { "String Share", eina_test_stringshare },
- { "UString Share", eina_test_ustringshare },
+ { "binshare", eina_test_binshare },
+ { "stringshare", eina_test_stringshare },
+ { "ustringshare", eina_test_ustringshare },
{ "Log", eina_test_log },
{ "Error", eina_test_error },
{ "Magic", eina_test_magic },
{ "Inlist", eina_test_inlist },
- { "Lazy alloc", eina_test_lalloc },
+ { "lalloc", eina_test_lalloc },
{ "Main", eina_test_main },
{ "Counter", eina_test_counter },
{ "Hash", eina_test_hash },
@@ -57,19 +57,19 @@ static const Efl_Test_Case etc[] = {
{ "Benchmark", eina_test_benchmark },
{ "Mempool", eina_test_mempool },
{ "Rectangle", eina_test_rectangle },
- { "Matrix Sparse", eina_test_matrixsparse },
- { "Eina Tiler", eina_test_tiler },
- { "Eina Strbuf", eina_test_strbuf },
- { "Eina Binbuf", eina_test_binbuf },
+ { "MatrixSparse", eina_test_matrixsparse },
+ { "Tiler", eina_test_tiler },
+ { "Strbuf", eina_test_strbuf },
+ { "Binbuf", eina_test_binbuf },
{ "String", eina_test_str },
- { "Unicode String", eina_test_ustr },
+ { "ustr", eina_test_ustr },
{ "QuadTree", eina_test_quadtree },
{ "Sched", eina_test_sched },
{ "Simple Xml Parser", eina_test_simple_xml_parser},
{ "Value", eina_test_value },
{ "COW", eina_test_cow },
{ "Barrier", eina_test_barrier },
- { "Tmp String", eina_test_tmpstr },
+ { "TmpStr", eina_test_tmpstr },
{ "Locking", eina_test_locking },
{ "ABI", eina_test_abi },
{ "Trash", eina_test_trash },
@@ -86,41 +86,47 @@ static const Efl_Test_Case etc[] = {
{ "Slice", eina_test_slice },
{ "Free Queue", eina_test_freeq },
{ "Util", eina_test_util },
- { "Short Lived Strings", eina_test_slstr },
+ { "slstr", eina_test_slstr },
+ { "Vpath", eina_test_vpath },
+ { "debug", eina_test_debug },
{ NULL, NULL }
};
-/* FIXME this is a copy from eina_test_mempool
- * we should remove the duplication
- */
static Eina_Array *_modules;
-static void _mempool_init(void)
+
+SUITE_INIT(eina)
{
- eina_init();
- /* force modules to be loaded in case they are not installed */
- _modules = eina_module_list_get(NULL,
- PACKAGE_BUILD_DIR "/src/modules",
- EINA_TRUE,
- NULL,
- NULL);
+ ck_assert_int_eq(eina_init(), 1);
+}
+
+SUITE_SHUTDOWN(eina)
+{
+ ck_assert_int_eq(eina_shutdown(), 0);
+}
+
+EFL_START_TEST(mempool_module_load)
+{
+ _modules = eina_module_list_get(NULL,
+ PACKAGE_BUILD_DIR "/src/modules/eina",
+ EINA_TRUE,
+ NULL,
+ NULL);
eina_module_list_load(_modules);
+ eina_module_list_unload(_modules);
}
+EFL_END_TEST
-static void _mempool_shutdown(void)
+static void
+mempool_init(TCase *tc)
{
- unsigned int i;
- Eina_Array_Iterator it;
- Eina_Module *module;
- eina_module_list_free(_modules);
- if (_modules)
- {
- EINA_ARRAY_ITER_NEXT(_modules, i, module, it)
- free(module);
- eina_array_free(_modules);
- }
- eina_shutdown();
+ tcase_add_test(tc, mempool_module_load);
}
+static const Efl_Test_Case mp_etc[] = {
+ { "mempool_init", mempool_init },
+ { NULL, NULL },
+};
+
int
main(int argc, char **argv)
{
@@ -132,13 +138,26 @@ main(int argc, char **argv)
#ifdef NEED_RUN_IN_TREE
putenv("EFL_RUN_IN_TREE=1");
#endif
+ /* force modules to be loaded in case they are not installed
+ * this function does not require eina_init to be called
+ */
- _mempool_init();
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
- "Eina", etc);
+ "eina_init_module", mp_etc, SUITE_INIT_FN(eina), SUITE_SHUTDOWN_FN(eina));
+
+ eina_init();
+ eina_module_list_load(_modules);
+ failed_count += _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
+ "Eina", etc, NULL, NULL);
- _mempool_shutdown();
+ if (_modules)
+ {
+ while (eina_array_count(_modules))
+ eina_module_free(eina_array_pop(_modules));
+ eina_array_free(_modules);
+ }
+ eina_shutdown();
return (failed_count == 0) ? 0 : 255;
}
diff --git a/src/tests/eina/eina_suite.h b/src/tests/eina/eina_suite.h
index 7bf643e478..5e7a1bf30f 100644
--- a/src/tests/eina/eina_suite.h
+++ b/src/tests/eina/eina_suite.h
@@ -20,6 +20,7 @@
#define EINA_SUITE_H_
#include <check.h>
+#include "../efl_check.h"
void eina_test_ustringshare(TCase *tc);
void eina_test_binshare(TCase *tc);
@@ -74,5 +75,7 @@ void eina_test_safepointer(TCase *tc);
void eina_test_slice(TCase *tc);
void eina_test_freeq(TCase *tc);
void eina_test_slstr(TCase *tc);
+void eina_test_vpath(TCase *tc);
+void eina_test_debug(TCase *tc);
#endif /* EINA_SUITE_H_ */
diff --git a/src/tests/eina/eina_test_abi.c b/src/tests/eina/eina_test_abi.c
index c8b109c9a8..67435ecb60 100644
--- a/src/tests/eina/eina_test_abi.c
+++ b/src/tests/eina/eina_test_abi.c
@@ -39,11 +39,10 @@ typedef uint32_t Eina_Unicode;
EAPI Eina_Unicode eina_unicode_utf8_get_next(const char *buf, int *iindex);
EAPI unsigned int eina_mempool_alignof(unsigned int size);
-START_TEST(eina_unicode_utf8)
+EFL_START_TEST(eina_unicode_utf8)
{
int ind;
unsigned char ch;
- eina_init();
/* Valid utf-8 cases */
/* First possible sequence of a certain length */
@@ -240,21 +239,15 @@ START_TEST(eina_unicode_utf8)
fail_if((eina_unicode_utf8_get_next("\xFC\x83\xBF\xBF\xBF\xBF", &ind) != 0xDCFC) ||
(ind != 1));
/* Add some more error cases here */
-
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_alignof)
+EFL_START_TEST(eina_alignof)
{
- eina_init();
-
fail_if(eina_mempool_alignof(6) != 8);
fail_if((eina_mempool_alignof(10) & 0x7) != 0);
-
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eina_test_abi(TCase *tc)
diff --git a/src/tests/eina/eina_test_accessor.c b/src/tests/eina/eina_test_accessor.c
index c6bd1e0d4b..7a75de6bb6 100644
--- a/src/tests/eina/eina_test_accessor.c
+++ b/src/tests/eina/eina_test_accessor.c
@@ -36,15 +36,13 @@ eina_accessor_check(EINA_UNUSED const Eina_Array *array,
return EINA_TRUE;
}
-START_TEST(eina_accessor_array_simple)
+EFL_START_TEST(eina_accessor_array_simple)
{
Eina_Accessor *it;
Eina_Array *ea;
int *tmp;
int i;
- eina_init();
-
ea = eina_array_new(11);
fail_if(!ea);
@@ -74,9 +72,8 @@ START_TEST(eina_accessor_array_simple)
eina_array_free(ea);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
typedef struct _Eina_Test_Inlist Eina_Test_Inlist;
struct _Eina_Test_Inlist
@@ -114,7 +111,7 @@ eina_accessor_inlist_data_check(EINA_UNUSED const Eina_Inlist *in_list,
return EINA_TRUE;
}
-START_TEST(eina_accessor_inlist_simple)
+EFL_START_TEST(eina_accessor_inlist_simple)
{
Eina_Inlist *lst = NULL;
Eina_Test_Inlist *tmp;
@@ -165,7 +162,7 @@ START_TEST(eina_accessor_inlist_simple)
fail_if(i != 2);
}
-END_TEST
+EFL_END_TEST
static Eina_Bool
eina_iterator_list_data_check(EINA_UNUSED const Eina_List *list,
@@ -184,7 +181,7 @@ eina_iterator_list_data_check(EINA_UNUSED const Eina_List *list,
return EINA_TRUE;
}
-START_TEST(eina_accessor_list_simple)
+EFL_START_TEST(eina_accessor_list_simple)
{
Eina_List *list = NULL;
Eina_Accessor *it;
@@ -192,8 +189,6 @@ START_TEST(eina_accessor_list_simple)
int *j;
int i = 0;
- eina_init();
-
list = eina_list_append(list, &data[0]);
fail_if(list == NULL);
@@ -233,7 +228,7 @@ START_TEST(eina_accessor_list_simple)
eina_accessor_free(it);
}
-END_TEST
+EFL_END_TEST
void
eina_test_accessor(TCase *tc)
diff --git a/src/tests/eina/eina_test_array.c b/src/tests/eina/eina_test_array.c
index 37ac3c2c62..c8c9764a5f 100644
--- a/src/tests/eina/eina_test_array.c
+++ b/src/tests/eina/eina_test_array.c
@@ -26,15 +26,13 @@
#include "eina_suite.h"
-START_TEST(eina_array_simple)
+EFL_START_TEST(eina_array_simple)
{
Eina_Array *ea;
char *tmp;
Eina_Array_Iterator it;
unsigned int i;
- eina_init();
-
ea = eina_array_new(11);
fail_if(!ea);
@@ -66,19 +64,16 @@ START_TEST(eina_array_simple)
eina_array_flush(ea);
eina_array_free(ea);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_array_static)
+EFL_START_TEST(eina_array_static)
{
Eina_Array sea;
char *tmp;
Eina_Array_Iterator it;
unsigned int i;
- eina_init();
-
eina_array_step_set(&sea, sizeof(sea), 10);
for (i = 0; i < 200; ++i)
@@ -104,9 +99,8 @@ START_TEST(eina_array_static)
eina_array_clean(&sea);
eina_array_flush(&sea);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
Eina_Bool
keep_int(void *data, void *gdata)
@@ -122,15 +116,13 @@ keep_int(void *data, void *gdata)
return EINA_TRUE;
}
-START_TEST(eina_array_remove_stuff)
+EFL_START_TEST(eina_array_remove_stuff)
{
Eina_Array *ea;
int *tmp;
Eina_Array_Iterator it;
unsigned int i;
- eina_init();
-
ea = eina_array_new(64);
fail_if(!ea);
@@ -179,9 +171,8 @@ START_TEST(eina_array_remove_stuff)
eina_array_free(ea);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eina_test_array(TCase *tc)
diff --git a/src/tests/eina/eina_test_barrier.c b/src/tests/eina/eina_test_barrier.c
index 81b257a2ce..369edc99bd 100644
--- a/src/tests/eina/eina_test_barrier.c
+++ b/src/tests/eina/eina_test_barrier.c
@@ -39,7 +39,6 @@ wk_func(void *data EINA_UNUSED, Eina_Thread thread EINA_UNUSED)
static void *
wk1_func(void *data EINA_UNUSED, Eina_Thread thread EINA_UNUSED)
{
- sleep(1);
eina_barrier_wait(&barrier);
return NULL;
}
@@ -47,7 +46,6 @@ wk1_func(void *data EINA_UNUSED, Eina_Thread thread EINA_UNUSED)
static void *
wk2_func(void *data EINA_UNUSED, Eina_Thread thread EINA_UNUSED)
{
- sleep(2);
eina_barrier_wait(&barrier);
return NULL;
}
@@ -55,19 +53,15 @@ wk2_func(void *data EINA_UNUSED, Eina_Thread thread EINA_UNUSED)
static void *
wk3_func(void *data EINA_UNUSED, Eina_Thread thread EINA_UNUSED)
{
- sleep(3);
eina_barrier_wait(&barrier);
return NULL;
}
-START_TEST(eina_barrier_test_simple)
+EFL_START_TEST(eina_barrier_test_simple)
{
Eina_Bool r;
int i;
- i = eina_init();
- _ck_assert_int(i, >=, 1);
-
i = eina_threads_init();
_ck_assert_int(i, >=, 1);
@@ -104,15 +98,14 @@ START_TEST(eina_barrier_test_simple)
eina_barrier_free(&barrier);
eina_threads_shutdown();
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eina_test_barrier(TCase *tc)
{
#ifndef _WIN32
- tcase_set_timeout(tc, 6);
+ tcase_set_timeout(tc, 1);
#endif
tcase_add_test(tc, eina_barrier_test_simple);
}
diff --git a/src/tests/eina/eina_test_benchmark.c b/src/tests/eina/eina_test_benchmark.c
index 4352c1622b..9fb7a568ef 100644
--- a/src/tests/eina/eina_test_benchmark.c
+++ b/src/tests/eina/eina_test_benchmark.c
@@ -39,7 +39,7 @@ _eina_benchmark_specimens(int request)
global_test = a;
}
-START_TEST(eina_benchmark_simple)
+EFL_START_TEST(eina_benchmark_simple)
{
Eina_Benchmark *eb;
Eina_Array_Iterator it;
@@ -67,7 +67,7 @@ START_TEST(eina_benchmark_simple)
eina_benchmark_free(eb);
}
-END_TEST
+EFL_END_TEST
void
eina_test_benchmark(TCase *tc)
diff --git a/src/tests/eina/eina_test_bezier.c b/src/tests/eina/eina_test_bezier.c
index 3ee007f41c..36de00dc13 100644
--- a/src/tests/eina/eina_test_bezier.c
+++ b/src/tests/eina/eina_test_bezier.c
@@ -27,12 +27,11 @@
#include "eina_suite.h"
-START_TEST(eina_bezier_test_values)
+EFL_START_TEST(eina_bezier_test_values)
{
Eina_Bezier b;
double sx, sy, cx1, cy1, cx2, cy2, ex, ey;
- eina_init();
eina_bezier_values_set(&b,
1, 2,
3, 4,
@@ -51,16 +50,14 @@ START_TEST(eina_bezier_test_values)
cy2 != 6 ||
ex != 7 ||
ey != 8);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_bezier_test_angle)
+EFL_START_TEST(eina_bezier_test_angle)
{
Eina_Bezier b;
double angle;
- eina_init();
eina_bezier_values_set(&b,
1, 1,
3, 1,
@@ -78,16 +75,14 @@ START_TEST(eina_bezier_test_angle)
angle = eina_bezier_angle_at(&b, 0.5);
fail_if(floor(angle) != 90);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_bezier_test_length)
+EFL_START_TEST(eina_bezier_test_length)
{
Eina_Bezier b;
double length;
- eina_init();
eina_bezier_values_set(&b,
1, 1,
3, 1,
@@ -104,16 +99,14 @@ START_TEST(eina_bezier_test_length)
length = eina_bezier_length_get(&b);
fail_if(length != 0);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_bezier_test_t_at)
+EFL_START_TEST(eina_bezier_test_t_at)
{
Eina_Bezier b;
double length, t;
- eina_init();
eina_bezier_values_set(&b,
1, 1,
3, 1,
@@ -126,16 +119,14 @@ START_TEST(eina_bezier_test_t_at)
t = eina_bezier_t_at(&b, length);
fail_if(t != 1);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_bezier_test_point_at)
+EFL_START_TEST(eina_bezier_test_point_at)
{
Eina_Bezier b;
double x, y;
- eina_init();
eina_bezier_values_set(&b,
1, 2,
3, 4,
@@ -150,16 +141,14 @@ START_TEST(eina_bezier_test_point_at)
fail_if(x != 7 ||
y != 8);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_bezier_test_split_at_length)
+EFL_START_TEST(eina_bezier_test_split_at_length)
{
Eina_Bezier b, l , r;
double len, len1, len2;
- eina_init();
eina_bezier_values_set(&b,
1, 2,
3, 4,
@@ -172,16 +161,14 @@ START_TEST(eina_bezier_test_split_at_length)
fail_if(len != (len1 + len2));
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_bezier_test_bounds_get)
+EFL_START_TEST(eina_bezier_test_bounds_get)
{
Eina_Bezier b;
double x, y, w, h;
- eina_init();
eina_bezier_values_set(&b,
0, 0,
100, 0,
@@ -192,16 +179,14 @@ START_TEST(eina_bezier_test_bounds_get)
fail_if(x !=0 || y!=0 || w !=100 || h !=100 );
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_bezier_test_on_interval)
+EFL_START_TEST(eina_bezier_test_on_interval)
{
Eina_Bezier b, res;
double px1, px2, py1, py2;
- eina_init();
eina_bezier_values_set(&b,
0, 0,
10, 20,
@@ -213,9 +198,8 @@ START_TEST(eina_bezier_test_on_interval)
fail_if(px1 != px2 || py1 != py2);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eina_test_bezier(TCase *tc)
diff --git a/src/tests/eina/eina_test_binbuf.c b/src/tests/eina/eina_test_binbuf.c
index ce3225d722..1f8fce805f 100644
--- a/src/tests/eina/eina_test_binbuf.c
+++ b/src/tests/eina/eina_test_binbuf.c
@@ -25,7 +25,7 @@
#include "eina_suite.h"
-START_TEST(binbuf_simple)
+EFL_START_TEST(binbuf_simple)
{
Eina_Binbuf *buf, *test_buf;
unsigned char *txt;
@@ -34,8 +34,6 @@ START_TEST(binbuf_simple)
Eina_Slice ro_slice;
Eina_Rw_Slice rw_slice;
- eina_init();
-
buf = eina_binbuf_new();
fail_if(!buf);
@@ -80,19 +78,16 @@ START_TEST(binbuf_simple)
eina_binbuf_free(buf);
- eina_shutdown();
#undef TEXT
}
-END_TEST
+EFL_END_TEST
-START_TEST(binbuf_remove)
+EFL_START_TEST(binbuf_remove)
{
Eina_Binbuf *buf;
const unsigned char cbuf[] = "12\0 456 78\0 abcthis is some more random junk here!";
size_t size = sizeof(cbuf) - 1; /* We don't care about the real NULL */
- eina_init();
-
buf = eina_binbuf_new();
fail_if(!buf);
@@ -112,16 +107,14 @@ START_TEST(binbuf_remove)
fail_if(0 != eina_binbuf_length_get(buf));
eina_binbuf_free(buf);
-
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
/* eina_binbuf_manage_new_length and eina_binbuf_manage_read_only_new_length
* are deprecated */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-START_TEST(binbuf_manage_simple)
+EFL_START_TEST(binbuf_manage_simple)
{
Eina_Binbuf *buf;
const char *_cbuf = "12\0 456 78\0 abcthis is some more random junk here!";
@@ -130,8 +123,6 @@ START_TEST(binbuf_manage_simple)
unsigned char *alloc_buf = malloc(size);
memcpy(alloc_buf, cbuf, size);
- eina_init();
-
buf = eina_binbuf_manage_new_length(alloc_buf, size);
fail_if(!buf);
@@ -144,19 +135,16 @@ START_TEST(binbuf_manage_simple)
eina_binbuf_free(buf);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(binbuf_manage_read_only_simple)
+EFL_START_TEST(binbuf_manage_read_only_simple)
{
Eina_Binbuf *buf;
const char *_cbuf = "12\0 456 78\0 abcthis is some more random junk here!";
const unsigned char *cbuf = (const unsigned char *) _cbuf;
size_t size = sizeof(cbuf) - 1; /* We don't care about the real NULL */
- eina_init();
-
buf = eina_binbuf_manage_read_only_new_length(cbuf, size);
fail_if(!buf);
@@ -174,18 +162,15 @@ START_TEST(binbuf_manage_read_only_simple)
eina_binbuf_free(buf);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
#pragma GCC diagnostic pop
-START_TEST(binbuf_insert)
+EFL_START_TEST(binbuf_insert)
{
#if 0
Eina_Binbuf *buf;
- eina_init();
-
buf = eina_binbuf_new();
fail_if(!buf);
@@ -227,12 +212,11 @@ START_TEST(binbuf_insert)
eina_binbuf_free(buf);
- eina_shutdown();
#endif
}
-END_TEST
+EFL_END_TEST
-START_TEST(binbuf_realloc)
+EFL_START_TEST(binbuf_realloc)
{
Eina_Binbuf *buf;
unsigned char pattern[1024 * 16];
@@ -248,8 +232,6 @@ START_TEST(binbuf_realloc)
}
pattern[i] = '\0';
- eina_init();
-
buf = eina_binbuf_new();
fail_if(!buf);
@@ -302,11 +284,10 @@ START_TEST(binbuf_realloc)
eina_binbuf_free(buf);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(binbuf_expand)
+EFL_START_TEST(binbuf_expand)
{
Eina_Binbuf *buf;
Eina_Rw_Slice rw_slice;
@@ -316,8 +297,6 @@ START_TEST(binbuf_expand)
size_t i;
Eina_Bool r;
- eina_init();
-
buf = eina_binbuf_new();
fail_if(!buf);
@@ -369,9 +348,8 @@ START_TEST(binbuf_expand)
eina_binbuf_free(buf);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void
diff --git a/src/tests/eina/eina_test_binshare.c b/src/tests/eina/eina_test_binshare.c
index 1b4a200597..0e3c01f652 100644
--- a/src/tests/eina/eina_test_binshare.c
+++ b/src/tests/eina/eina_test_binshare.c
@@ -34,13 +34,11 @@
#define TEST1 "te\0st/11"
#define TEST1_SIZE 8
-START_TEST(eina_binshare_simple)
+EFL_START_TEST(eina_binshare_simple)
{
const char *t0;
const char *t1;
- eina_init();
-
t0 = eina_binshare_add_length(TEST0, TEST0_SIZE);
t1 = eina_binshare_add_length(TEST1, TEST1_SIZE);
@@ -57,17 +55,14 @@ START_TEST(eina_binshare_simple)
eina_binshare_del(t0);
eina_binshare_del(t1);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_binshare_small)
+EFL_START_TEST(eina_binshare_small)
{
char buf[4];
int i;
- eina_init();
-
for (i = 1; i < 3; i++)
{
const char *t0, *t1;
@@ -91,18 +86,15 @@ START_TEST(eina_binshare_small)
eina_binshare_del(t0);
eina_binshare_del(t1);
}
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_binshare_test_share)
+EFL_START_TEST(eina_binshare_test_share)
{
const char *t0;
const char *t1;
- eina_init();
-
t0 = eina_binshare_add_length(TEST0, TEST0_SIZE);
t1 = eina_binshare_add_length(TEST0, TEST0_SIZE);
@@ -115,79 +107,65 @@ START_TEST(eina_binshare_test_share)
eina_binshare_del(t0);
eina_binshare_del(t1);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_binshare_putstuff)
+EFL_START_TEST(eina_binshare_putstuff)
{
const char *tmp;
int i;
- eina_init();
-
- for (i = 10000; i > 0; --i)
+ for (i = 100; i > 0; --i)
{
char build[64] = "string_";
+ unsigned int len;
eina_convert_xtoa(i, build + 7);
- tmp = eina_binshare_add_length(build, strlen(build));
- fail_if(tmp != eina_binshare_add_length(build, strlen(build)));
- fail_if((int)strlen(build) != eina_binshare_length(tmp));
+ len = strlen(build);
+ tmp = eina_binshare_add_length(build, len);
+ ck_assert_ptr_ne(tmp, NULL);
+ ck_assert_ptr_eq(tmp, eina_binshare_add_length(build, len));
+ ck_assert_int_eq(len, eina_binshare_length(tmp));
+ eina_binshare_del(tmp);
+ eina_binshare_del(tmp);
}
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_binshare_collision)
+EFL_START_TEST(eina_binshare_collision)
{
Eina_Array *ea;
char buffer[50];
int i;
-
- srand(time(NULL));
-
- eina_init();
+ const void *r;
ea = eina_array_new(256);
- fail_if(!ea);
-
- for (i = 0; i < 10000; ++i)
- {
- eina_convert_itoa(rand(), buffer);
- eina_array_push(ea,
- (void *)eina_binshare_add_length(buffer, strlen(buffer)));
- if (rand() > RAND_MAX / 2)
- {
- const char *r = eina_binshare_add_length(buffer, strlen(buffer));
- fail_if(r == NULL);
- }
- }
- for (i = 0; i < 10000; ++i)
+ for (i = 0; i < 256; ++i)
{
- const char *r;
-
+ unsigned int len;
eina_convert_itoa(60000 - i, buffer);
- eina_array_push(ea,
- (void *)eina_binshare_add_length(buffer, strlen(buffer)));
- r = eina_binshare_add_length(buffer, strlen(buffer));
- fail_if(r == NULL);
- r = eina_binshare_add_length(buffer, strlen(buffer));
- fail_if(r == NULL);
+ len = strlen(buffer);
+ r = eina_binshare_add_length(buffer, len);
+ ck_assert_ptr_ne(r, NULL);
+ eina_array_push(ea, r);
+ r = eina_binshare_add_length(buffer, len);
+ ck_assert_ptr_ne(r, NULL);
+ r = eina_binshare_add_length(buffer, len);
+ ck_assert_ptr_ne(r, NULL);
}
- for (i = 0; i < 200; ++i)
- eina_binshare_del(eina_array_data_get(ea, i));
-
- for (i = 0; i < 1000; ++i)
- eina_binshare_del(eina_array_pop(ea));
-
- eina_shutdown();
+ while (eina_array_count(ea))
+ {
+ r = eina_array_pop(ea);
+ eina_binshare_del(r);
+ eina_binshare_del(r);
+ eina_binshare_del(r);
+ }
eina_array_free(ea);
}
-END_TEST
+EFL_END_TEST
void
eina_test_binshare(TCase *tc)
diff --git a/src/tests/eina/eina_test_clist.c b/src/tests/eina/eina_test_clist.c
index 76af179057..fc0e6ceef2 100644
--- a/src/tests/eina/eina_test_clist.c
+++ b/src/tests/eina/eina_test_clist.c
@@ -102,7 +102,7 @@ static void iterating_two_phase_with_add_head(unsigned int n, const char *str, i
};
}
-START_TEST(eina_clist_basic)
+EFL_START_TEST(eina_clist_basic)
{
unsigned int n = 0;
@@ -175,7 +175,7 @@ START_TEST(eina_clist_basic)
fail_if(eina_clist_count(&string_list) != 0);
}
-END_TEST
+EFL_END_TEST
void
eina_test_clist(TCase *tc)
diff --git a/src/tests/eina/eina_test_convert.c b/src/tests/eina/eina_test_convert.c
index 8dd06e65fe..1b08a00a19 100644
--- a/src/tests/eina/eina_test_convert.c
+++ b/src/tests/eina/eina_test_convert.c
@@ -30,7 +30,7 @@
#include "eina_suite.h"
-START_TEST(eina_convert_simple)
+EFL_START_TEST(eina_convert_simple)
{
char tmp[128];
char ref[128];
@@ -63,7 +63,7 @@ START_TEST(eina_convert_simple)
fail_if(eina_convert_xtoa(0xFF00EF0E, tmp) != 8);
fail_if(strcmp(tmp, "ff00ef0e") != 0);
}
-END_TEST
+EFL_END_TEST
#define EET_TEST_DOUBLE0 123.45689
#define EET_TEST_DOUBLE1 1.0
@@ -85,13 +85,11 @@ _eina_convert_check(double test, int length)
fail_if(fabs(r - test) > DBL_MIN);
}
- START_TEST(eina_convert_double)
+ EFL_START_TEST(eina_convert_double)
{
long long int m = 0;
long e = 0;
- eina_init();
-
_eina_convert_check(EET_TEST_DOUBLE0, 20);
_eina_convert_check(-EET_TEST_DOUBLE0, 21);
_eina_convert_check(EET_TEST_DOUBLE1, 6);
@@ -103,9 +101,8 @@ _eina_convert_check(double test, int length)
fail_if(eina_convert_atod("0xjo", 8, &m, &e) != EINA_FALSE);
fail_if(eina_convert_atod("0xp", 8, &m, &e) != EINA_FALSE);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
static void
_eina_convert_fp_check(double d, Eina_F32p32 fp, int length)
@@ -152,7 +149,7 @@ _eina_convert_fp_check(double d, Eina_F32p32 fp, int length)
fail_if(fabs(fpd - d) > DBL_MIN);
}
- START_TEST(eina_convert_fp)
+ EFL_START_TEST(eina_convert_fp)
{
_eina_convert_fp_check(1.0, 0x0000000100000000, 6);
_eina_convert_fp_check(0.5, 0x0000000080000000, 8);
@@ -161,7 +158,7 @@ _eina_convert_fp_check(double d, Eina_F32p32 fp, int length)
_eina_convert_fp_check(0.5, 0x0000000080000000, 8);
_eina_convert_fp_check(128.625, 0x00000080a0000000, 10);
}
-END_TEST
+EFL_END_TEST
void
eina_test_convert(TCase *tc)
diff --git a/src/tests/eina/eina_test_counter.c b/src/tests/eina/eina_test_counter.c
index b686a50ec5..2f813e93e1 100644
--- a/src/tests/eina/eina_test_counter.c
+++ b/src/tests/eina/eina_test_counter.c
@@ -65,14 +65,12 @@ _eina_test_safety_print_cb(const Eina_Log_Domain *d, Eina_Log_Level level, const
}
#endif
-START_TEST(eina_counter_simple)
+EFL_START_TEST(eina_counter_simple)
{
Eina_Counter *cnt;
char *dump;
int i;
- eina_init();
-
cnt = eina_counter_new("eina_test");
fail_if(!cnt);
@@ -106,16 +104,13 @@ START_TEST(eina_counter_simple)
eina_counter_free(cnt);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_counter_break)
+EFL_START_TEST(eina_counter_break)
{
Eina_Counter *cnt;
- eina_init();
-
cnt = eina_counter_new("eina_test");
fail_if(!cnt);
@@ -182,9 +177,8 @@ START_TEST(eina_counter_break)
}
#endif
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void eina_test_counter(TCase *tc)
{
diff --git a/src/tests/eina/eina_test_cow.c b/src/tests/eina/eina_test_cow.c
index b00101a6e9..4f30f6d9df 100644
--- a/src/tests/eina/eina_test_cow.c
+++ b/src/tests/eina/eina_test_cow.c
@@ -42,7 +42,7 @@ _eina_test_log(const Eina_Log_Domain *d EINA_UNUSED,
*bol = EINA_TRUE;
}
-START_TEST(eina_cow_bad)
+EFL_START_TEST(eina_cow_bad)
{
const Eina_Cow_Test *cur;
Eina_Cow_Test *write;
@@ -86,9 +86,9 @@ START_TEST(eina_cow_bad)
eina_cow_del(cow);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cow)
+EFL_START_TEST(eina_cow)
{
const Eina_Cow_Test *prev;
const Eina_Cow_Test *cur;
@@ -143,7 +143,7 @@ START_TEST(eina_cow)
eina_cow_del(cow);
}
-END_TEST
+EFL_END_TEST
void
eina_test_cow(TCase *tc)
diff --git a/src/tests/eina/eina_test_crc.c b/src/tests/eina/eina_test_crc.c
index 61db0e22eb..d187073e1e 100644
--- a/src/tests/eina/eina_test_crc.c
+++ b/src/tests/eina/eina_test_crc.c
@@ -10,7 +10,7 @@
#include "eina_suite.h"
-START_TEST(eina_crc_simple)
+EFL_START_TEST(eina_crc_simple)
{
unsigned int seed = 0xffffffff, i, ret;
const char *data[] =
@@ -43,7 +43,7 @@ START_TEST(eina_crc_simple)
ret = eina_crc(s2, strlen(s2), ret, EINA_FALSE);
fail_if(ret != result[0]);
}
-END_TEST
+EFL_END_TEST
void eina_test_crc(TCase *tc)
{
diff --git a/src/tests/eina/eina_test_debug.c b/src/tests/eina/eina_test_debug.c
new file mode 100644
index 0000000000..ef524f7094
--- /dev/null
+++ b/src/tests/eina/eina_test_debug.c
@@ -0,0 +1,27 @@
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <Eina.h>
+
+#include "eina_suite.h"
+#ifndef _WIN32
+# include <signal.h>
+#endif
+#ifdef SIGPROF
+EFL_START_TEST(eina_test_debug_sighandler)
+{
+ /* ensure this doesn't crash */
+ raise(SIGPROF);
+}
+EFL_END_TEST
+#endif
+
+void
+eina_test_debug(TCase *tc)
+{
+#ifdef SIGPROF
+ if (!eina_streq(getenv("CK_FORK"), "no"))
+ tcase_add_test_raise_signal(tc, eina_test_debug_sighandler, SIGPROF);
+#endif
+}
diff --git a/src/tests/eina/eina_test_error.c b/src/tests/eina/eina_test_error.c
index a7e68ca782..572c6b02b7 100644
--- a/src/tests/eina/eina_test_error.c
+++ b/src/tests/eina/eina_test_error.c
@@ -69,14 +69,12 @@ _eina_test_safety_print_cb(const Eina_Log_Domain *d, Eina_Log_Level level, const
#endif
}
-START_TEST(eina_error_errno)
+EFL_START_TEST(eina_error_errno)
{
int test;
setenv("EINA_ERROR_LEVEL", "1", 0);
- eina_init();
-
test = eina_error_msg_register(TEST_TEXT);
fail_if(!eina_error_msg_get(test));
fail_if(strcmp(eina_error_msg_get(test), TEST_TEXT) != 0);
@@ -88,17 +86,14 @@ START_TEST(eina_error_errno)
ck_assert_int_eq(eina_error_get(), EBADF);
ck_assert_str_eq(eina_error_msg_get(EBADF), strerror(EBADF));
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_error_test_find)
+EFL_START_TEST(eina_error_test_find)
{
int test, r;
const char *str;
- eina_init();
-
/* Make sure the value isn't already there. */
r = eina_error_find(TEST_TEXT TEST_TEXT);
ck_assert_int_eq(r, 0);
@@ -116,17 +111,14 @@ START_TEST(eina_error_test_find)
r = eina_error_find(TEST_TEXT TEST_TEXT);
ck_assert_int_eq(r, test);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_error_test_modify)
+EFL_START_TEST(eina_error_test_modify)
{
int test, r;
const char *str, smsg[] = "Do not copy this string";
- eina_init();
-
test = eina_error_msg_register("Some Test Error");
ck_assert_int_ne(test, 0);
@@ -153,18 +145,15 @@ START_TEST(eina_error_test_modify)
r = eina_error_find("Change that!");
ck_assert_int_eq(r, test);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_error_test_lots)
+EFL_START_TEST(eina_error_test_lots)
{
char buf[64];
int codes[512];
unsigned int i;
- eina_init();
-
for (i = 0; i < sizeof(codes)/sizeof(codes[0]); i++)
{
snprintf(buf, sizeof(buf), "myerr-%u", i);
@@ -182,18 +171,15 @@ START_TEST(eina_error_test_lots)
ck_assert_int_eq(codes[i], found);
}
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
#ifdef EINA_SAFETY_CHECKS
-START_TEST(eina_error_test_failures)
+EFL_START_TEST(eina_error_test_failures)
{
struct log_ctx ctx;
Eina_Error local_error;
- eina_init();
-
eina_log_print_cb_set(_eina_test_safety_print_cb, &ctx);
#define TEST_MAGIC_SAFETY(fn, _msg) \
@@ -249,9 +235,8 @@ START_TEST(eina_error_test_failures)
eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
#endif
void
diff --git a/src/tests/eina/eina_test_file.c b/src/tests/eina/eina_test_file.c
index 07b42daf2e..242922083f 100644
--- a/src/tests/eina/eina_test_file.c
+++ b/src/tests/eina/eina_test_file.c
@@ -27,6 +27,10 @@
#include <unistd.h>
#include <fcntl.h>
+#ifdef _WIN32
+# include <windows.h>
+#endif
+
#include <Eina.h>
#include "eina_safety_checks.h"
#include "eina_file_common.h"
@@ -84,12 +88,10 @@ _eina_test_safety_print_cb(const Eina_Log_Domain *d, Eina_Log_Level level, const
#endif
-START_TEST(eina_file_split_simple)
+EFL_START_TEST(eina_file_split_simple)
{
Eina_Array *ea;
- eina_init();
-
#ifdef EINA_SAFETY_CHECKS
#ifdef SHOW_LOG
fprintf(stderr, "you should have a safety check failure below:\n");
@@ -147,9 +149,8 @@ START_TEST(eina_file_split_simple)
eina_array_free(ea);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
Eina_Tmpstr*
get_full_path(const char* tmpdirname, const char* filename)
@@ -174,10 +175,8 @@ get_eina_test_file_tmp_dir()
return tmp_dir;
}
-START_TEST(eina_file_direct_ls_simple)
+EFL_START_TEST(eina_file_direct_ls_simple)
{
- eina_init();
-
/*
* Windows: naming conventions
* https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx
@@ -234,14 +233,11 @@ START_TEST(eina_file_direct_ls_simple)
}
fail_if(rmdir(test_dirname) != 0);
eina_tmpstr_del(test_dirname);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_file_ls_simple)
+EFL_START_TEST(eina_file_ls_simple)
{
- eina_init();
-
/*
* Windows: naming conventions
* https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx
@@ -296,11 +292,10 @@ START_TEST(eina_file_ls_simple)
}
fail_if(rmdir(test_dirname) != 0);
eina_tmpstr_del(test_dirname);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_file_map_new_test)
+EFL_START_TEST(eina_file_map_new_test)
{
const char *eina_map_test_string = "Hello. I'm the eina map test string.";
const char *test_file_name_part = "/example.txt";
@@ -323,8 +318,6 @@ START_TEST(eina_file_map_new_test)
int test_dirname_size;
int start_point_final, last_chunk_size;
- eina_init();
-
Eina_Tmpstr *test_dirname = get_eina_test_file_tmp_dir();
fail_if(test_dirname == NULL);
test_dirname_size = strlen((char *)test_dirname);
@@ -436,9 +429,8 @@ START_TEST(eina_file_map_new_test)
free(test_file2_path);
eina_tmpstr_del(test_dirname);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
static const char *virtual_file_data = "this\n"
"is a test for the sake of testing\r\n"
@@ -448,7 +440,7 @@ static const char *virtual_file_data = "this\n"
"file !\n"
"without any issue !";
-START_TEST(eina_test_file_virtualize)
+EFL_START_TEST(eina_test_file_virtualize)
{
Eina_File *f;
Eina_File *tmp;
@@ -457,8 +449,6 @@ START_TEST(eina_test_file_virtualize)
void *map;
unsigned int i = 0;
- eina_init();
-
f = eina_file_virtualize("gloubi", virtual_file_data, strlen(virtual_file_data), EINA_FALSE);
fail_if(!f);
@@ -490,9 +480,8 @@ START_TEST(eina_test_file_virtualize)
eina_file_close(f);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
static void *
_eina_test_file_thread(void *data EINA_UNUSED, Eina_Thread t EINA_UNUSED)
@@ -500,7 +489,7 @@ _eina_test_file_thread(void *data EINA_UNUSED, Eina_Thread t EINA_UNUSED)
Eina_File *f;
unsigned int i;
- for (i = 0; i < 10000; ++i)
+ for (i = 0; i < 100; ++i)
{
f = eina_file_open("/bin/sh", EINA_FALSE);
fail_if(!f);
@@ -510,22 +499,19 @@ _eina_test_file_thread(void *data EINA_UNUSED, Eina_Thread t EINA_UNUSED)
return NULL;
}
-START_TEST(eina_test_file_thread)
+EFL_START_TEST(eina_test_file_thread)
{
Eina_Thread th[4];
unsigned int i;
- fail_if(!eina_init());
-
for (i = 0; i < 4; i++)
fail_if(!(eina_thread_create(&th[i], EINA_THREAD_NORMAL, -1, _eina_test_file_thread, NULL)));
for (i = 0; i < 4; i++)
fail_if(eina_thread_join(th[i]) != NULL);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
static const struct {
const char *test;
@@ -534,25 +520,22 @@ static const struct {
{ "/home/mydir/../myfile", "/home/myfile" }
};
-START_TEST(eina_test_file_path)
+EFL_START_TEST(eina_test_file_path)
{
unsigned int i;
char *path;
- fail_if(!eina_init());
-
for (i = 0; i < sizeof (sanitize) / sizeof (sanitize[0]); i++)
{
path = eina_file_path_sanitize(sanitize[i].test);
fail_if(strcmp(path, sanitize[i].result));
}
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
#ifdef XATTR_TEST_DIR
-START_TEST(eina_test_file_xattr)
+EFL_START_TEST(eina_test_file_xattr)
{
Eina_File *ef;
char *filename = "tmpfile";
@@ -576,7 +559,6 @@ START_TEST(eina_test_file_xattr)
int fd, count=0;
Eina_Xattr *xattr;
- eina_init();
test_file_path = get_full_path(XATTR_TEST_DIR, filename);
fd = open(test_file_path, O_RDONLY | O_BINARY | O_CREAT | O_TRUNC, S_IRWXU | S_IRWXG | S_IRWXO);
@@ -623,12 +605,11 @@ START_TEST(eina_test_file_xattr)
unlink(test_file_path);
eina_tmpstr_del(test_file_path);
eina_file_close(ef);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
#endif
-START_TEST(eina_test_file_copy)
+EFL_START_TEST(eina_test_file_copy)
{
const char *test_file1_name = "EinaCopyFromXXXXXX.txt";
const char *test_file2_name = "EinaCopyToXXXXXX.txt";
@@ -640,8 +621,6 @@ START_TEST(eina_test_file_copy)
Eina_Bool ret;
void *content1, *content2;
- eina_init();
-
fd1 = eina_file_mkstemp(test_file1_name, &test_file1_path);
fail_if(fd1 <= 0);
@@ -690,11 +669,10 @@ START_TEST(eina_test_file_copy)
eina_tmpstr_del(test_file1_path);
eina_tmpstr_del(test_file2_path);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_file_statat)
+EFL_START_TEST(eina_test_file_statat)
{
Eina_Tmpstr *test_file1_path, *test_file2_path;
Eina_Iterator *it;
@@ -704,8 +682,6 @@ START_TEST(eina_test_file_statat)
int template_size = strlen(template);
int fd, ret;
- eina_init();
-
Eina_Tmpstr *test_dirname = get_eina_test_file_tmp_dir();
fail_if(test_dirname == NULL);
@@ -739,11 +715,10 @@ START_TEST(eina_test_file_statat)
eina_tmpstr_del(test_file2_path);
eina_tmpstr_del(test_dirname);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_file_mktemp)
+EFL_START_TEST(eina_test_file_mktemp)
{
Eina_Tmpstr *tmpfile, *tmpdir = NULL;
char buf[PATH_MAX], fmt[256];
@@ -779,7 +754,18 @@ START_TEST(eina_test_file_mktemp)
if (readlink(fmt, buf, sizeof(buf)))
unlink(buf);
#else
- // TODO: need to implement windows support with GetFinalPathNameByHandle
+ {
+ char buf[4096];
+ HANDLE h;
+ DWORD l;
+
+ h = (HANDLE)_get_osfhandle(fd);
+ fail_if(h == INVALID_HANDLE_VALUE);
+ l = GetFinalPathNameByHandle(h, buf, sizeof(buf), 0);
+ fail_if(l == 0);
+ /* GetFinalPathNameByHandle() preprends path with \\?\ */
+ unlink(buf + 4);
+ }
#endif
close(fd);
@@ -788,7 +774,9 @@ START_TEST(eina_test_file_mktemp)
errno = 0;
tmpfile = NULL;
fd = eina_file_mkstemp(patterns[k], &tmpfile);
- fail_if((fd < 0) || !tmpfile || errno);
+ ck_assert(fd >= 0);
+ ck_assert(!!tmpfile);
+ ck_assert_msg(!errno, "ERROR(%s): %s\n", patterns[k], strerror(errno));
file = eina_file_open(tmpfile, EINA_FALSE);
fail_if(!file);
eina_file_close(file);
@@ -828,7 +816,7 @@ START_TEST(eina_test_file_mktemp)
unlink(tmpfile);
remove(tmpdir);
}
-END_TEST
+EFL_END_TEST
int create_file_not_empty(const char *file_name, Eina_Tmpstr **test_file_path, Eina_Bool close_file)
{
@@ -847,14 +835,12 @@ int create_file_not_empty(const char *file_name, Eina_Tmpstr **test_file_path,
return fd;
}
-START_TEST(eina_test_file_unlink)
+EFL_START_TEST(eina_test_file_unlink)
{
int fd;
Eina_Tmpstr *test_file_path;
const char *tmpfile = "eina_file_test_XXXXXX";
- eina_init();
-
/*If file was not opened as 'eina'*/
fd = create_file_not_empty(tmpfile, &test_file_path, EINA_TRUE);
fail_if(fd != 0);
@@ -866,9 +852,8 @@ START_TEST(eina_test_file_unlink)
fail_if(!eina_file_open(test_file_path, EINA_FALSE));
fail_if(!eina_file_unlink(test_file_path));
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eina_test_file(TCase *tc)
diff --git a/src/tests/eina/eina_test_fp.c b/src/tests/eina/eina_test_fp.c
index 9100c57e8c..b9f61efe01 100644
--- a/src/tests/eina/eina_test_fp.c
+++ b/src/tests/eina/eina_test_fp.c
@@ -27,7 +27,7 @@
#include "eina_suite.h"
-START_TEST(eina_fp_cos)
+EFL_START_TEST(eina_fp_cos)
{
Eina_F32p32 fc;
Eina_F32p32 fl;
@@ -37,8 +37,6 @@ START_TEST(eina_fp_cos)
double dresult;
double delta;
- fail_if(!eina_init());
-
fl = eina_f32p32_scale(EINA_F32P32_PI, 4);
step = eina_f32p32_div(fl, eina_f32p32_int_from(2048));
@@ -52,11 +50,10 @@ START_TEST(eina_fp_cos)
fail_if(delta > 0.005);
}
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_fp_sin)
+EFL_START_TEST(eina_fp_sin)
{
Eina_F32p32 fc;
Eina_F32p32 fl;
@@ -66,8 +63,6 @@ START_TEST(eina_fp_sin)
double dresult;
double delta;
- fail_if(!eina_init());
-
fl = eina_f32p32_scale(EINA_F32P32_PI, 4);
step = eina_f32p32_div(fl, eina_f32p32_int_from(2048));
@@ -82,11 +77,10 @@ START_TEST(eina_fp_sin)
}
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_fp_mul)
+EFL_START_TEST(eina_fp_mul)
{
Eina_F32p32 fc1, fc2;
Eina_F32p32 fresult;
@@ -98,12 +92,10 @@ START_TEST(eina_fp_mul)
double maxdelta = 0;
double maxdelta_per = 0;
- fail_if(!eina_init());
-
dl1 = 10;
- step1 = 0.001;
+ step1 = 0.007;
dl2 = 1000;
- step2 = 0.01;
+ step2 = 0.061;
for (dc1 = 0; dc1 < dl1; dc1 += step1)
{
@@ -135,11 +127,10 @@ START_TEST(eina_fp_mul)
}
printf("Max delta(multiplication): %f (%f%%)\n", maxdelta, maxdelta_per*100);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_fp_div)
+EFL_START_TEST(eina_fp_div)
{
Eina_F32p32 fc1, fc2;
Eina_F32p32 fresult;
@@ -151,12 +142,10 @@ START_TEST(eina_fp_div)
double maxdelta = 0;
double maxdelta_per = 0;
- fail_if(!eina_init());
-
dl1 = 10;
- step1 = 0.001;
+ step1 = 0.007;
dl2 = 1000;
- step2 = 0.01;
+ step2 = 0.061;
for (dc1 = 0; dc1 < dl1; dc1 += step1)
{
@@ -187,9 +176,8 @@ START_TEST(eina_fp_div)
}
printf("Max delta(division): %f (%f%%)\n", maxdelta, maxdelta_per*100);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eina_test_fp(TCase *tc)
diff --git a/src/tests/eina/eina_test_freeq.c b/src/tests/eina/eina_test_freeq.c
index 8cd0eeda21..07fec1134f 100644
--- a/src/tests/eina/eina_test_freeq.c
+++ b/src/tests/eina/eina_test_freeq.c
@@ -6,13 +6,11 @@
#include "eina_suite.h"
-START_TEST(freeq_simple)
+EFL_START_TEST(freeq_simple)
{
Eina_FreeQ *fq;
int *p;
- eina_init();
-
fq = eina_freeq_main_get();
fail_if(fq == NULL);
fail_if(eina_freeq_type_get(fq) != EINA_FREEQ_DEFAULT);
@@ -28,9 +26,8 @@ START_TEST(freeq_simple)
eina_freeq_free(fq);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
static int _n = 0;
@@ -40,12 +37,10 @@ static void freefn(void *data)
_n--;
}
-START_TEST(freeq_tune)
+EFL_START_TEST(freeq_tune)
{
void *p;
- eina_init();
-
eina_freeq_count_max_set(eina_freeq_main_get(), 3);
fail_if(eina_freeq_count_max_get(eina_freeq_main_get()) != 3);
@@ -72,16 +67,13 @@ START_TEST(freeq_tune)
fail_if(eina_freeq_ptr_pending(eina_freeq_main_get()) == EINA_TRUE);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(freeq_reduce)
+EFL_START_TEST(freeq_reduce)
{
void *p;
- eina_init();
-
_n++;
p = malloc(9);
eina_freeq_ptr_main_add(p, freefn, 9);
@@ -112,9 +104,8 @@ START_TEST(freeq_reduce)
fail_if(_n > 0);
fail_if(eina_freeq_ptr_pending(eina_freeq_main_get()) == EINA_TRUE);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
static void
postponed_free(void *data)
@@ -136,13 +127,12 @@ new_uint(int val)
return p;
}
-START_TEST(freeq_postponed)
+EFL_START_TEST(freeq_postponed)
{
Eina_FreeQ *fq;
unsigned int *values[20];
size_t k;
- eina_init();
_n = 0;
fq = eina_freeq_new(EINA_FREEQ_POSTPONED);
@@ -192,9 +182,8 @@ START_TEST(freeq_postponed)
eina_freeq_free(fq);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eina_test_freeq(TCase *tc)
diff --git a/src/tests/eina/eina_test_hash.c b/src/tests/eina/eina_test_hash.c
index c96ca0f079..87206d80ce 100644
--- a/src/tests/eina/eina_test_hash.c
+++ b/src/tests/eina/eina_test_hash.c
@@ -29,7 +29,7 @@
#include "eina_suite.h"
-#define EINA_HASH_BUCKET_SIZE 8
+#define EINA_HASH_BUCKET_SIZE 8
static unsigned int
_eina_string_key_length(const char *key)
@@ -61,7 +61,7 @@ eina_foreach_check(EINA_UNUSED const Eina_Hash *hash,
int i;
if (strlen(key) <= 0)
- return EINA_TRUE;
+ return EINA_TRUE;
i = atoi(key);
fail_if(i != *j);
@@ -69,15 +69,13 @@ eina_foreach_check(EINA_UNUSED const Eina_Hash *hash,
return EINA_TRUE;
}
-START_TEST(eina_hash_simple)
+EFL_START_TEST(eina_test_hash_simple)
{
Eina_Hash *hash = NULL;
int *test;
int array[] = { 1, 42, 4, 5, 6 };
/* As mempool is already initialized and it use hash, we should have 2 init. */
- fail_if(eina_init() != 2);
-
hash = eina_hash_string_superfast_new(NULL);
fail_if(hash == NULL);
@@ -121,20 +119,15 @@ START_TEST(eina_hash_simple)
fail_if(eina_hash_del(hash, "42", NULL) != EINA_TRUE);
eina_hash_free(hash);
-
- /* Same comment as eina_init */
- fail_if(eina_shutdown() != 1);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_hash_crc)
+EFL_START_TEST(eina_test_hash_crc)
{
Eina_Hash *hash = NULL;
int *test;
int array[] = { 1, 42, 4, 5, 6 };
- fail_if(eina_init() != 2);
-
hash = eina_hash_new(EINA_KEY_LENGTH(_eina_string_key_length),
EINA_KEY_CMP(_eina_string_key_cmp),
EINA_KEY_HASH(eina_hash_crc),
@@ -182,48 +175,44 @@ START_TEST(eina_test_hash_crc)
fail_if(eina_hash_del(hash, "42", NULL) != EINA_TRUE);
eina_hash_free(hash);
-
- /* Same comment as eina_init */
- fail_if(eina_shutdown() != 1);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_hash_extended)
+EFL_START_TEST(eina_test_hash_extended)
{
Eina_Hash *hash = NULL;
- int i;
-
- fail_if(eina_init() != 2);
+ unsigned int i;
+ unsigned int num_loops = 3011;
+ char *array;
hash = eina_hash_string_djb2_new(NULL);
- fail_if(hash == NULL);
+ fail_if(hash == NULL);
- fail_if(eina_hash_direct_add(hash, "42", "42") != EINA_TRUE);
+ fail_if(eina_hash_direct_add(hash, "42", "42") != EINA_TRUE);
- for (i = 43; i < 3043; ++i)
+ array = malloc(num_loops * 10);
+ ck_assert_ptr_ne(array, NULL);
+
+ for (i = 0; i < num_loops; ++i)
{
- char *tmp = malloc(10);
- fail_if(!tmp);
- eina_convert_itoa(i, tmp);
+ char *tmp = array + (i * 10);
+ eina_convert_itoa(i + 42, tmp);
fail_if(eina_hash_direct_add(hash, tmp, tmp) != EINA_TRUE);
}
- fail_if(eina_hash_find(hash, "42") == NULL);
+ fail_if(eina_hash_find(hash, "42") == NULL);
- eina_hash_free(hash);
-
- fail_if(eina_shutdown() != 1);
+ eina_hash_free(hash);
+ free(array);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_hash_double_item)
+EFL_START_TEST(eina_test_hash_double_item)
{
Eina_Hash *hash = NULL;
int i[] = { 7, 7 };
int *test;
- fail_if(eina_init() != 2);
-
hash = eina_hash_string_superfast_new(NULL);
fail_if(hash == NULL);
@@ -235,12 +224,10 @@ START_TEST(eina_hash_double_item)
fail_if(test != &i[0]);
eina_hash_free(hash);
-
- fail_if(eina_shutdown() != 1);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_hash_all_int)
+EFL_START_TEST(eina_test_hash_all_int)
{
Eina_Hash *hash;
int64_t j[] = { 4321312301243122, 6, 7, 128 };
@@ -249,184 +236,163 @@ START_TEST(eina_hash_all_int)
int *test;
int it;
- fail_if(eina_init() != 2);
-
hash = eina_hash_int32_new(NULL);
- fail_if(hash == NULL);
+ fail_if(hash == NULL);
for (it = 0; it < 4; ++it)
- fail_if(eina_hash_add(hash, &i[it], &i[it]) != EINA_TRUE);
+ fail_if(eina_hash_add(hash, &i[it], &i[it]) != EINA_TRUE);
- fail_if(eina_hash_del(hash, &i[1], &i[1]) != EINA_TRUE);
+ fail_if(eina_hash_del(hash, &i[1], &i[1]) != EINA_TRUE);
test = eina_hash_find(hash, &i[2]);
- fail_if(test != &i[2]);
+ fail_if(test != &i[2]);
test = eina_hash_find(hash, &i[3]);
- fail_if(test != &i[3]);
+ fail_if(test != &i[3]);
- eina_hash_free(hash);
+ eina_hash_free(hash);
hash = eina_hash_int64_new(NULL);
- fail_if(hash == NULL);
+ fail_if(hash == NULL);
for (it = 0; it < 4; ++it)
- fail_if(eina_hash_add(hash, &j[it], &j[it]) != EINA_TRUE);
+ fail_if(eina_hash_add(hash, &j[it], &j[it]) != EINA_TRUE);
- fail_if(eina_hash_del(hash, &j[1], &j[1]) != EINA_TRUE);
+ fail_if(eina_hash_del(hash, &j[1], &j[1]) != EINA_TRUE);
test2 = eina_hash_find(hash, &j[0]);
- fail_if(test2 != &j[0]);
-
- eina_hash_free(hash);
+ fail_if(test2 != &j[0]);
- fail_if(eina_shutdown() != 1);
+ eina_hash_free(hash);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_hash_int32_fuzze)
+EFL_START_TEST(eina_test_hash_int32_fuzze)
{
Eina_Hash *hash;
- Eina_List *added = NULL;
- unsigned int *r;
+ unsigned int *r, *array;
unsigned int i;
- unsigned int j;
unsigned int seed;
-
- eina_init();
+ unsigned int num_loops = 10000;
seed = time(NULL);
srand(seed);
- hash = eina_hash_int32_new(free);
+ hash = eina_hash_int32_new(NULL);
+
+ array = malloc(sizeof(int) * num_loops);
+ for (i = 0; i < num_loops; ++i)
+ {
+ r = array + i;
+ *r = rand() % 10000;
+ ck_assert_int_ne(eina_hash_direct_add(hash, r, r), 0);
+ }
- for (i = 0; i < 10000; ++i)
+ for (i = 0; i < num_loops / 2; ++i)
{
- r = malloc(sizeof (unsigned int));
- *r = rand();
- eina_hash_direct_add(hash, r, r);
+ unsigned int tr = rand() + 10000;
+ r = eina_hash_find(hash, &tr);
+ ck_assert_ptr_eq(r, NULL);
}
- for (j = 0; j < 100; ++j)
+ for (i = 0; i < num_loops / 2; ++i)
{
- for (i = 0; i < 1000; ++i)
- {
- do
- {
- unsigned int tr;
-
- tr = rand();
- r = eina_hash_find(hash, &tr);
- if (r)
- {
- r = NULL;
- continue;
- }
-
- r = malloc(sizeof (unsigned int));
- *r = tr;
- eina_hash_direct_add(hash, r, r);
- added = eina_list_append(added, r);
- }
- while (r == NULL);
- }
-
- EINA_LIST_FREE(added, r)
- {
- unsigned int *s;
-
- s = eina_hash_find(hash, r);
- fail_if(s != r);
- eina_hash_del(hash, r, r);
- }
+ unsigned int tr = (rand() % 10000) - (10000 * 2);
+ r = eina_hash_find(hash, &tr);
+ ck_assert_ptr_eq(r, NULL);
}
eina_hash_free(hash);
+ free(array);
+}
+EFL_END_TEST
+
+EFL_START_TEST(eina_test_hash_int64_fuzze)
+{
+ Eina_Hash *hash;
+ uint64_t *r, *array;
+ uint64_t i;
+ uint64_t num_loops = 10000;
- eina_shutdown();
+ srand(time(NULL));
+
+ hash = eina_hash_int64_new(NULL);
+
+ array = malloc(sizeof(int64_t) * num_loops);
+ for (i = 0; i < num_loops; ++i)
+ {
+ r = array + i;
+ *r = rand() % 10000;
+ ck_assert_int_ne(eina_hash_direct_add(hash, r, r), 0);
+ }
+
+ for (i = 0; i < num_loops / 2; ++i)
+ {
+ uint64_t tr = rand() + 10000;
+ r = eina_hash_find(hash, &tr);
+ ck_assert_ptr_eq(r, NULL);
+ }
+
+ for (i = 0; i < num_loops / 2; ++i)
+ {
+ uint64_t tr = (rand() % 10000) - (10000 * 2);
+ r = eina_hash_find(hash, &tr);
+ ck_assert_ptr_eq(r, NULL);
+ }
+
+ eina_hash_free(hash);
+ free(array);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_hash_string_fuzze)
+EFL_START_TEST(eina_test_hash_string_fuzze)
{
Eina_Hash *hash;
- Eina_List *added = NULL;
- char *r;
unsigned int i;
- unsigned int j;
unsigned int seed;
-
- eina_init();
+ char *array;
+ unsigned int num_loops = 100;
seed = time(NULL);
srand(seed);
- hash = eina_hash_string_superfast_new(free);
+ hash = eina_hash_string_superfast_new(NULL);
- for (i = 0; i < 10000; ++i)
- {
- char convert[128];
+ array = malloc(num_loops * 10);
+ ck_assert_ptr_ne(array, NULL);
- eina_convert_itoa(rand(), convert);
- r = strdup(convert);
- eina_hash_direct_add(hash, r, r);
+ for (i = 0; i < num_loops; ++i)
+ {
+ char *tmp = array + (i * 10);
+ eina_convert_itoa(i, tmp);
+ fail_if(eina_hash_direct_add(hash, tmp, tmp) != EINA_TRUE);
}
- for (j = 0; j < 50; ++j)
+ for (i = 0; i < num_loops; ++i)
{
- for (i = 0; i < 1000; ++i)
- {
- do
- {
- char convert[128];
-
- eina_convert_itoa(rand(), convert);
- r = eina_hash_find(hash, convert);
- if (r)
- {
- r = NULL;
- continue;
- }
-
- r = strdup(convert);
- eina_hash_direct_add(hash, r, r);
- added = eina_list_append(added, r);
- }
- while (r == NULL);
- }
-
- EINA_LIST_FREE(added, r)
- {
- char *s;
-
- s = eina_hash_find(hash, r);
- fail_if(s != r);
- eina_hash_del(hash, r, r);
- }
+ char convert[128];
+ char *r;
+
+ eina_convert_itoa(rand() + num_loops, convert);
+ r = eina_hash_find(hash, convert);
+ ck_assert_ptr_eq(r, NULL);
}
eina_hash_free(hash);
-
- eina_shutdown();
+ free(array);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_hash_seed)
+EFL_START_TEST(eina_test_hash_seed)
{
- eina_init();
-
fail_if(eina_seed == 0);
-
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_hash_add_del_by_hash)
+EFL_START_TEST(eina_test_hash_add_del_by_hash)
{
Eina_Hash *hash = NULL;
int array[] = { 1, 42, 4, 5, 6 };
int key_len, key_hash;
- fail_if(eina_init() != 2);
-
hash = eina_hash_new(EINA_KEY_LENGTH(_eina_string_key_length),
EINA_KEY_CMP(_eina_string_key_cmp),
EINA_KEY_HASH(eina_hash_crc),
@@ -446,22 +412,26 @@ START_TEST(eina_hash_add_del_by_hash)
fail_if(eina_hash_del_by_hash(hash, "4", key_len, key_hash, &array[2]) != EINA_FALSE);
key_len = _eina_string_key_length("42");
- key_hash = eina_hash_crc("42", key_len);
+ key_hash = eina_hash_crc("42", key_len);
fail_if(eina_hash_del_by_hash(hash, "42", key_len, key_hash, &array[1]) != EINA_TRUE);
fail_if(eina_hash_population(hash) != 3);
+ eina_hash_free(hash);
}
-END_TEST
+EFL_END_TEST
-void eina_test_hash(TCase *tc)
+void
+eina_test_hash(TCase *tc)
{
- tcase_add_test(tc, eina_hash_simple);
+ tcase_add_test(tc, eina_test_hash_simple);
tcase_add_test(tc, eina_test_hash_crc);
- tcase_add_test(tc, eina_hash_extended);
- tcase_add_test(tc, eina_hash_double_item);
- tcase_add_test(tc, eina_hash_all_int);
- tcase_add_test(tc, eina_hash_seed);
- tcase_add_test(tc, eina_hash_int32_fuzze);
- tcase_add_test(tc, eina_hash_string_fuzze);
- tcase_add_test(tc, eina_hash_add_del_by_hash);
+ tcase_add_test(tc, eina_test_hash_extended);
+ tcase_add_test(tc, eina_test_hash_double_item);
+ tcase_add_test(tc, eina_test_hash_all_int);
+ tcase_add_test(tc, eina_test_hash_seed);
+ tcase_add_test(tc, eina_test_hash_int32_fuzze);
+ tcase_add_test(tc, eina_test_hash_int64_fuzze);
+ tcase_add_test(tc, eina_test_hash_string_fuzze);
+ tcase_add_test(tc, eina_test_hash_add_del_by_hash);
}
+
diff --git a/src/tests/eina/eina_test_inarray.c b/src/tests/eina/eina_test_inarray.c
index f8e271e8ca..74581f2685 100644
--- a/src/tests/eina/eina_test_inarray.c
+++ b/src/tests/eina/eina_test_inarray.c
@@ -26,7 +26,7 @@
#include "eina_suite.h"
-START_TEST(eina_inarray_test_simple)
+EFL_START_TEST(eina_inarray_test_simple)
{
const int test_members = 5;
Eina_Inarray *array;
@@ -40,8 +40,6 @@ START_TEST(eina_inarray_test_simple)
{-1, -1}
};
- eina_init();
-
array = eina_inarray_new(sizeof(int), 2);
fail_unless(array != NULL);
@@ -84,19 +82,16 @@ START_TEST(eina_inarray_test_simple)
}
eina_inarray_free(array);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_inarray_test_alloc_at)
+EFL_START_TEST(eina_inarray_test_alloc_at)
{
Eina_Inarray *array;
int *member;
int i;
- eina_init();
-
array = eina_inarray_new(sizeof(int), 2);
fail_unless(array != NULL);
@@ -124,9 +119,8 @@ START_TEST(eina_inarray_test_alloc_at)
fail_unless(member[i] == i);
eina_inarray_free(array);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
static const short rand_numbers[] = {
9, 0, 2, 3, 6, 5, 4, 7, 8, 1, 10
@@ -169,13 +163,11 @@ short_cmp(const void *pa, const void *pb)
return *a - *b;
}
-START_TEST(eina_inarray_test_insert_sort)
+EFL_START_TEST(eina_inarray_test_insert_sort)
{
Eina_Inarray *array;
int i, pos;
- eina_init();
-
array = eina_inarray_new(sizeof(short), 1);
fail_unless(array != NULL);
@@ -235,17 +227,14 @@ START_TEST(eina_inarray_test_insert_sort)
eina_inarray_flush(array);
eina_inarray_free(array);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_inarray_test_sort)
+EFL_START_TEST(eina_inarray_test_sort)
{
Eina_Inarray *array;
int i;
- eina_init();
-
array = eina_inarray_new(sizeof(short), 1);
fail_unless(array != NULL);
@@ -257,17 +246,14 @@ START_TEST(eina_inarray_test_sort)
eina_inarray_sort(array, short_cmp);
fail_unless(check_short_sorted(array));
eina_inarray_free(array);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_inarray_test_reverse)
+EFL_START_TEST(eina_inarray_test_reverse)
{
Eina_Inarray *array;
int i;
- eina_init();
-
array = eina_inarray_new(sizeof(short), 1);
fail_unless(array != NULL);
@@ -285,9 +271,8 @@ START_TEST(eina_inarray_test_reverse)
}
eina_inarray_free(array);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
static Eina_Bool
array_foreach(const void *array EINA_UNUSED, void *p, void *user_data EINA_UNUSED)
@@ -311,7 +296,7 @@ array_foreach_stop_2nd(const void *array EINA_UNUSED, void *p, void *user_data E
return EINA_TRUE;
}
-START_TEST(eina_inarray_test_itr)
+EFL_START_TEST(eina_inarray_test_itr)
{
Eina_Inarray *array;
Eina_Iterator *it;
@@ -319,8 +304,6 @@ START_TEST(eina_inarray_test_itr)
short *member;
int i;
- eina_init();
-
array = eina_inarray_new(sizeof(short), 1);
fail_unless(array != NULL);
@@ -386,9 +369,8 @@ START_TEST(eina_inarray_test_itr)
eina_accessor_free(ac);
eina_inarray_free(array);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
int
cmp(const void *a, const void *b)
@@ -414,7 +396,7 @@ match_cb(const void *array EINA_UNUSED, void *p, void *user_data)
return EINA_FALSE;
}
-START_TEST(eina_inarray_test_search)
+EFL_START_TEST(eina_inarray_test_search)
{
Eina_Inarray *iarr;
int i, ret, temp=92, ret1;
@@ -423,8 +405,6 @@ START_TEST(eina_inarray_test_search)
unsigned int curr_len;
Eina_Bool rval;
- eina_init();
-
iarr = eina_inarray_new(sizeof(int), 0);
//search in empty array
@@ -490,9 +470,8 @@ START_TEST(eina_inarray_test_search)
fail_if(iarr->len != curr_len-3);
eina_inarray_free(iarr);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eina_test_inarray(TCase *tc)
diff --git a/src/tests/eina/eina_test_inlist.c b/src/tests/eina/eina_test_inlist.c
index 6d9ea2676e..51722552fd 100644
--- a/src/tests/eina/eina_test_inlist.c
+++ b/src/tests/eina/eina_test_inlist.c
@@ -84,7 +84,7 @@ _eina_test_inlist_build(int i)
return tmp;
}
-START_TEST(eina_inlist_simple)
+EFL_START_TEST(eina_inlist_simple)
{
Eina_Inlist *lst = NULL;
Eina_Inlist *tmpl = NULL;
@@ -96,8 +96,6 @@ START_TEST(eina_inlist_simple)
struct log_ctx ctx;
#endif
- fail_if(!eina_init());
-
tmp = _eina_test_inlist_build(42);
lst = eina_inlist_append(lst, EINA_INLIST_GET(tmp));
fail_if(!lst);
@@ -296,9 +294,8 @@ START_TEST(eina_inlist_simple)
while (lst)
lst = eina_inlist_remove(lst, lst);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
typedef struct _Eina_Test_Inlist_Sorted Eina_Test_Inlist_Sorted;
struct _Eina_Test_Inlist_Sorted
@@ -317,48 +314,122 @@ _eina_test_inlist_cmp(const void *d1, const void *d2)
return t1->value - t2->value;
}
+static int
+_eina_test_inlist_cmp2(const void *d1, const void *d2)
+{
+ const Eina_Test_Inlist_Sorted *t1 = d1;
+ const Eina_Test_Inlist_Sorted *t2 = d2;
+
+ return t2->value - t1->value;
+}
+
+#define _eina_test_inlist_check(LIST) \
+{ \
+ const Eina_Test_Inlist_Sorted *_t; \
+ int _i = 0; \
+ \
+ EINA_INLIST_FOREACH(LIST, _t) \
+ { \
+ ck_assert_int_eq(_t->value, values[_i]); \
+ _i++; \
+ } \
+}
+
+#define _eina_test_inlist_check_reverse(LIST) \
+{ \
+ const Eina_Test_Inlist_Sorted *_t; \
+ int _i = EINA_C_ARRAY_LENGTH(values) - 1; \
+ \
+ EINA_INLIST_FOREACH(LIST, _t) \
+ { \
+ ck_assert_int_eq(_t->value, values[_i]); \
+ _i--; \
+ } \
+}
+
+static int values_unsorted[] =
+{
+ 3,
+ 10,
+ 2,
+ 1,
+ 8,
+ 4,
+ 4,
+ 5,
+ 7,
+ 9,
+ 6,
+};
+
+static int values[] =
+{
+ 1,
+ 2,
+ 3,
+ 4,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9,
+ 10,
+};
+
+
static void
-_eina_test_inlist_check(const Eina_Inlist *list)
+_eina_test_inlist_check_insert(const Eina_Inlist *list)
{
const Eina_Test_Inlist_Sorted *t;
int last_value = 0;
EINA_INLIST_FOREACH(list, t)
{
- fail_if(t->value < last_value);
+ ck_assert_int_ge(t->value, last_value);
last_value = t->value;
}
}
-START_TEST(eina_inlist_sorted)
+static void
+_eina_test_inlist_check_insert_reverse(const Eina_Inlist *list)
+{
+ const Eina_Test_Inlist_Sorted *t;
+ int last_value = 0;
+
+ EINA_INLIST_FOREACH(list, t)
+ {
+ if (last_value)
+ ck_assert_int_le(t->value, last_value);
+ last_value = t->value;
+ }
+}
+
+EFL_START_TEST(eina_inlist_sorted)
{
- Eina_Test_Inlist_Sorted *tmp;
+ Eina_Test_Inlist_Sorted *t, tmp[EINA_C_ARRAY_LENGTH(values_unsorted)];
Eina_Inlist *list = NULL;
Eina_Inlist *sorted = NULL;
- int i;
-
- fail_if(!eina_init());
-
- srand(time(NULL));
+ unsigned int i;
- for (i = 0; i < 2000; ++i)
+ for (i = 0; i < EINA_C_ARRAY_LENGTH(values_unsorted); ++i)
{
- tmp = malloc(sizeof (Eina_Test_Inlist_Sorted));
- if (!tmp) continue ;
+ tmp[i].value = values_unsorted[i];
- tmp->value = rand();
-
- list = eina_inlist_prepend(list, EINA_INLIST_GET(tmp));
+ list = eina_inlist_prepend(list, EINA_INLIST_GET(&tmp[i]));
}
list = eina_inlist_sort(list, _eina_test_inlist_cmp);
_eina_test_inlist_check(list);
- EINA_INLIST_FOREACH(list, tmp)
- tmp->value = rand();
+ i = EINA_C_ARRAY_LENGTH(values_unsorted) - 1;
+ EINA_INLIST_FOREACH(list, t)
+ {
+ t->value = values_unsorted[i];
+ i--;
+ }
- i = 0;
while (list)
{
Eina_Inlist *p = list;
@@ -366,45 +437,93 @@ START_TEST(eina_inlist_sorted)
list = eina_inlist_remove(list, list);
sorted = eina_inlist_sorted_insert(sorted, p, _eina_test_inlist_cmp);
- _eina_test_inlist_check(sorted);
+ _eina_test_inlist_check_insert(sorted);
}
-
_eina_test_inlist_check(sorted);
-
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_inlist_sorted_state)
+EFL_START_TEST(eina_inlist_sorted_state)
{
- Eina_Test_Inlist_Sorted *tmp;
+ Eina_Test_Inlist_Sorted tmp[EINA_C_ARRAY_LENGTH(values_unsorted)];
Eina_Inlist_Sorted_State *state;
Eina_Inlist *list = NULL;
- int i;
-
- fail_if(!eina_init());
+ unsigned int i;
state = eina_inlist_sorted_state_new();
fail_if(!state);
- for (i = 0; i < 2000; ++i)
+ for (i = 0; i < EINA_C_ARRAY_LENGTH(values_unsorted); ++i)
{
- tmp = malloc(sizeof (Eina_Test_Inlist_Sorted));
- if (!tmp) continue ;
+ tmp[i].value = values_unsorted[i];
- tmp->value = rand();
+ list = eina_inlist_sorted_state_insert(list, EINA_INLIST_GET(&tmp[i]), _eina_test_inlist_cmp, state);
+ _eina_test_inlist_check_insert(list);
+ }
+ eina_inlist_sorted_state_free(state);
+ _eina_test_inlist_check(list);
+}
+EFL_END_TEST
+
+EFL_START_TEST(eina_inlist_sorted2)
+{
+ Eina_Test_Inlist_Sorted *t, tmp[EINA_C_ARRAY_LENGTH(values_unsorted)];
+ Eina_Inlist *list = NULL;
+ Eina_Inlist *sorted = NULL;
+ unsigned int i;
- list = eina_inlist_sorted_state_insert(list, EINA_INLIST_GET(tmp), _eina_test_inlist_cmp, state);
- _eina_test_inlist_check(list);
+ for (i = 0; i < EINA_C_ARRAY_LENGTH(values_unsorted); ++i)
+ {
+ tmp[i].value = values_unsorted[i];
+
+ list = eina_inlist_prepend(list, EINA_INLIST_GET(&tmp[i]));
}
- _eina_test_inlist_check(list);
+ list = eina_inlist_sort(list, _eina_test_inlist_cmp2);
- eina_inlist_sorted_state_free(state);
+ _eina_test_inlist_check_reverse(list);
- eina_shutdown();
+ i = EINA_C_ARRAY_LENGTH(values_unsorted) - 1;
+ EINA_INLIST_FOREACH(list, t)
+ {
+ t->value = values_unsorted[i];
+ i--;
+ }
+
+ while (list)
+ {
+ Eina_Inlist *p = list;
+
+ list = eina_inlist_remove(list, list);
+
+ sorted = eina_inlist_sorted_insert(sorted, p, _eina_test_inlist_cmp2);
+ _eina_test_inlist_check_insert_reverse(sorted);
+ }
+ _eina_test_inlist_check_reverse(sorted);
+}
+EFL_END_TEST
+
+EFL_START_TEST(eina_inlist_sorted_state2)
+{
+ Eina_Test_Inlist_Sorted tmp[EINA_C_ARRAY_LENGTH(values_unsorted)];
+ Eina_Inlist_Sorted_State *state;
+ Eina_Inlist *list = NULL;
+ unsigned int i;
+
+ state = eina_inlist_sorted_state_new();
+ fail_if(!state);
+
+ for (i = 0; i < EINA_C_ARRAY_LENGTH(values_unsorted); ++i)
+ {
+ tmp[i].value = values_unsorted[i];
+
+ list = eina_inlist_sorted_state_insert(list, EINA_INLIST_GET(&tmp[i]), _eina_test_inlist_cmp2, state);
+ _eina_test_inlist_check_insert_reverse(list);
+ }
+ eina_inlist_sorted_state_free(state);
+ _eina_test_inlist_check_reverse(list);
}
-END_TEST
+EFL_END_TEST
void
eina_test_inlist(TCase *tc)
@@ -412,4 +531,6 @@ eina_test_inlist(TCase *tc)
tcase_add_test(tc, eina_inlist_simple);
tcase_add_test(tc, eina_inlist_sorted);
tcase_add_test(tc, eina_inlist_sorted_state);
+ tcase_add_test(tc, eina_inlist_sorted2);
+ tcase_add_test(tc, eina_inlist_sorted_state2);
}
diff --git a/src/tests/eina/eina_test_iterator.c b/src/tests/eina/eina_test_iterator.c
index 2066269dcc..d71d7ec18e 100644
--- a/src/tests/eina/eina_test_iterator.c
+++ b/src/tests/eina/eina_test_iterator.c
@@ -39,13 +39,11 @@ _filter(const void *it EINA_UNUSED, void *data, void *fdata)
return numb->number % 2;
}
-START_TEST(eina_iterator_filter_simple)
+EFL_START_TEST(eina_iterator_filter_simple)
{
Eina_Iterator *it, *filtered;
Eina_Array *ea;
- eina_init();
-
ea = eina_array_new(11);
fail_if(!ea);
@@ -85,9 +83,8 @@ START_TEST(eina_iterator_filter_simple)
eina_array_free(ea);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
struct Free_test {
Eina_Bool got_freed;
@@ -106,12 +103,11 @@ _free(void *data)
test->got_freed = EINA_TRUE;
}
-START_TEST(eina_iterator_filter_free)
+EFL_START_TEST(eina_iterator_filter_free)
{
Eina_Iterator *it, *filtered;
Eina_Array *ea;
struct Free_test *data;
- eina_init();
data = calloc(1, sizeof(struct Free_test));
ea = eina_array_new(11);
@@ -127,9 +123,8 @@ START_TEST(eina_iterator_filter_free)
free(data);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
static Eina_Bool
eina_iterator_array_check(EINA_UNUSED const Eina_Array *array,
int *data, int *fdata)
@@ -140,15 +135,13 @@ eina_iterator_array_check(EINA_UNUSED const Eina_Array *array,
return EINA_TRUE;
}
-START_TEST(eina_iterator_array_simple)
+EFL_START_TEST(eina_iterator_array_simple)
{
Eina_Iterator *it;
Eina_Array *ea;
int *tmp;
int i;
- eina_init();
-
ea = eina_array_new(11);
fail_if(!ea);
@@ -175,9 +168,8 @@ START_TEST(eina_iterator_array_simple)
eina_array_free(ea);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
static Eina_Bool
eina_iterator_hash_key_check(const Eina_Hash *hash,
@@ -210,13 +202,12 @@ eina_iterator_hash_tuple_check(EINA_UNUSED const Eina_Hash *hash,
return EINA_TRUE;
}
-START_TEST(eina_iterator_hash_simple)
+EFL_START_TEST(eina_iterator_hash_simple)
{
Eina_Iterator *it;
Eina_Hash *hash;
int array[] = { 1, 42, 7, 8, 6 };
- eina_init();
hash = eina_hash_string_superfast_new(NULL);
fail_if(hash == NULL);
@@ -241,9 +232,8 @@ START_TEST(eina_iterator_hash_simple)
eina_hash_free(hash);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
typedef struct _Eina_Test_Inlist Eina_Test_Inlist;
struct _Eina_Test_Inlist
@@ -287,7 +277,7 @@ eina_iterator_inlist_data_check(EINA_UNUSED const Eina_Inlist *in_list,
return EINA_TRUE;
}
-START_TEST(eina_iterator_inlist_simple)
+EFL_START_TEST(eina_iterator_inlist_simple)
{
Eina_Inlist *lst = NULL;
Eina_Test_Inlist *tmp;
@@ -325,7 +315,7 @@ START_TEST(eina_iterator_inlist_simple)
fail_if(i != 5);
}
-END_TEST
+EFL_END_TEST
static Eina_Bool
eina_iterator_list_data_check(EINA_UNUSED const Eina_List *list,
@@ -354,14 +344,13 @@ eina_iterator_list_data_check(EINA_UNUSED const Eina_List *list,
return EINA_TRUE;
}
-START_TEST(eina_iterator_list_simple)
+EFL_START_TEST(eina_iterator_list_simple)
{
Eina_List *list = NULL;
Eina_Iterator *it;
int data[] = { 6, 9, 42, 1, 7, 1337, 81, 1664 };
int i = 0;
- eina_init();
list = eina_list_append(list, &data[0]);
fail_if(list == NULL);
@@ -390,7 +379,7 @@ START_TEST(eina_iterator_list_simple)
eina_iterator_foreach(it, EINA_EACH_CB(eina_iterator_list_data_check), &i);
eina_iterator_free(it);
}
-END_TEST
+EFL_END_TEST
static Eina_Bool
eina_reverse_iterator_list_data_check(EINA_UNUSED const Eina_List *list,
@@ -419,14 +408,13 @@ eina_reverse_iterator_list_data_check(EINA_UNUSED const Eina_List *list,
return EINA_TRUE;
}
-START_TEST(eina_reverse_iterator_list_simple)
+EFL_START_TEST(eina_reverse_iterator_list_simple)
{
Eina_List *list = NULL;
Eina_Iterator *it;
int data[] = { 6, 9, 42, 1, 7, 1337, 81, 1664 };
int i = 0;
- eina_init();
list = eina_list_append(list, &data[0]);
fail_if(list == NULL);
@@ -455,7 +443,7 @@ START_TEST(eina_reverse_iterator_list_simple)
eina_iterator_foreach(it, EINA_EACH_CB(eina_reverse_iterator_list_data_check), &i);
eina_iterator_free(it);
}
-END_TEST
+EFL_END_TEST
typedef struct _Eina_Rbtree_Int Eina_Rbtree_Int;
struct _Eina_Rbtree_Int
@@ -558,7 +546,7 @@ eina_iterator_rbtree_data_check_postfix(EINA_UNUSED const Eina_List *list,
return EINA_TRUE;
}
-START_TEST(eina_iterator_rbtree_simple)
+EFL_START_TEST(eina_iterator_rbtree_simple)
{
Eina_Rbtree *root = NULL;
Eina_Iterator *it;
@@ -622,7 +610,7 @@ START_TEST(eina_iterator_rbtree_simple)
&i);
eina_iterator_free(it);
}
-END_TEST
+EFL_END_TEST
void
eina_test_iterator(TCase *tc)
diff --git a/src/tests/eina/eina_test_lalloc.c b/src/tests/eina/eina_test_lalloc.c
index c9752e314b..6e5fd4799e 100644
--- a/src/tests/eina/eina_test_lalloc.c
+++ b/src/tests/eina/eina_test_lalloc.c
@@ -57,7 +57,7 @@ _test_free(Eina_Lazy_Allocator_Test *elat)
elat->num = 0;
}
-START_TEST(eina_lalloc_simple)
+EFL_START_TEST(eina_lalloc_simple)
{
Eina_Lazy_Allocator_Test *elat;
Eina_Lalloc *test;
@@ -81,7 +81,7 @@ START_TEST(eina_lalloc_simple)
eina_lalloc_free(test);
}
-END_TEST
+EFL_END_TEST
void
eina_test_lalloc(TCase *tc)
diff --git a/src/tests/eina/eina_test_list.c b/src/tests/eina/eina_test_list.c
index 42c6718872..e663064666 100644
--- a/src/tests/eina/eina_test_list.c
+++ b/src/tests/eina/eina_test_list.c
@@ -56,7 +56,7 @@ static int eina_int_cmp(const void *a, const void *b)
return *ia - *ib;
}
-START_TEST(eina_test_simple)
+EFL_START_TEST(eina_test_list_simple)
{
Eina_List *list = NULL;
Eina_List *tmp;
@@ -67,7 +67,6 @@ START_TEST(eina_test_simple)
int result[] = { 81, 9, 9, 7, 1 };
int i;
- eina_init();
list = eina_list_append(list, &data[0]);
fail_if(list == NULL);
@@ -215,11 +214,10 @@ START_TEST(eina_test_simple)
list = eina_list_free(list);
fail_if(list != NULL);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_merge)
+EFL_START_TEST(eina_test_list_merge)
{
Eina_List *l1;
Eina_List *l2;
@@ -229,7 +227,6 @@ START_TEST(eina_test_merge)
int data[] = { 6, 9, 42, 1, 7, 9, 81, 1664, 1337, 3, 21, 10, 0, 5, 2008 };
int i;
- eina_init();
l1 = eina_list_append(NULL, &data[0]);
l1 = eina_list_append(l1, &data[1]);
@@ -300,11 +297,10 @@ START_TEST(eina_test_merge)
fail_if(!eina_list_sorted_check(l1));
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_sorted_insert)
+EFL_START_TEST(eina_test_list_sorted_insert)
{
const int data[] = {6, 9, 42, 1, 7, 9, 81, 1664, 1337, 3, 21, 10, 0, 5, 2008};
const int data2[] = {5, 0, 3, 2, 1, 0, 1, 2, 3, 4, 5};
@@ -313,7 +309,6 @@ START_TEST(eina_test_sorted_insert)
void *d;
int *res, val = 2009;
- eina_init();
count = sizeof(data) / sizeof(data[0]);
@@ -356,17 +351,15 @@ START_TEST(eina_test_sorted_insert)
fail_if(!eina_list_sorted_check(l1));
eina_list_free(l1);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_list_split)
+EFL_START_TEST(eina_test_list_split)
{
Eina_List *left = NULL, *right = NULL ;
Eina_List *list = NULL;
unsigned int i;
- eina_init();
list = eina_list_append(list, "tigh");
list = eina_list_append(list, "adar");
@@ -393,72 +386,44 @@ START_TEST(eina_test_list_split)
list = eina_list_append(list, "roslin");
}
- eina_shutdown();
-}
-END_TEST
-
-static int uicmp(const void *d1, const void *d2)
-{
- const unsigned int *a = d1;
- const unsigned int *b = d2;
-
- if(*a == *b) return 0;
- if(*a > *b) return 1;
-
- return -1;
}
+EFL_END_TEST
#define SHUFFLE_SZ 100
-#define SHUFFLE_N 100000
-START_TEST(eina_test_shuffle)
+#define SHUFFLE_N 5
+EFL_START_TEST(eina_test_list_shuffle)
{
- double d;
unsigned int *p;
- unsigned int i, j;
+ unsigned int i;
unsigned int n[SHUFFLE_SZ];
- unsigned int rand_count[SHUFFLE_SZ];
Eina_List *list = NULL;
Eina_List *item = NULL;
+ Eina_List *copy, *cl;
- eina_init();
for(i = 0; i < SHUFFLE_SZ; i++)
{
n[i] = i;
- rand_count[i] = 0;
list = eina_list_append(list, &n[i]);
}
+ copy = eina_list_clone(list);
for(i = 0; i < SHUFFLE_N; i++)
{
list = eina_list_shuffle(list, NULL);
- p = eina_list_nth(list, SHUFFLE_SZ/2);
- rand_count[*p]++;
-
- j = 0;
- list = eina_list_sort(list, 0, (Eina_Compare_Cb)&uicmp);
+ cl = eina_list_data_get(copy);
EINA_LIST_FOREACH(list, item, p)
{
- if (*p != j++)
- fail_if(*p != j++);
+ if (eina_list_data_get(cl) != p) break;
+ cl = eina_list_next(cl);
}
- if (j != SHUFFLE_SZ)
- fail_if(j != SHUFFLE_SZ);
- }
-
- d = SHUFFLE_SZ/(float)(SHUFFLE_N);
- for(i = 0; i < SHUFFLE_SZ; i++)
- {
- fail_if(rand_count[i]*d > 1.20f);
- fail_if(rand_count[i]*d < 0.80f);
+ ck_assert_ptr_ne(item, NULL);
}
-
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
#define DATA_SIZE 100
-START_TEST(eina_test_clone)
+EFL_START_TEST(eina_test_list_clone)
{
unsigned int i;
unsigned int *d, *rd;
@@ -467,7 +432,6 @@ START_TEST(eina_test_clone)
Eina_List *clist = NULL;
Eina_List *rclist = NULL;
- eina_init();
for(i = 0; i < DATA_SIZE; i++)
{
@@ -502,11 +466,10 @@ START_TEST(eina_test_clone)
rclist = eina_list_free(rclist);
fail_if(rclist != NULL);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_move)
+EFL_START_TEST(eina_test_list_move)
{
Eina_List *list1 = NULL, *list2 = NULL;
Eina_Bool ret;
@@ -514,7 +477,6 @@ START_TEST(eina_test_move)
int data2[] = {6, 7, 8, 9, 10};
int i, *list_data;
- eina_init();
for (i = 0; i < 5; i++)
{
@@ -542,18 +504,17 @@ START_TEST(eina_test_move)
eina_list_free(list1);
eina_list_free(list2);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eina_test_list(TCase *tc)
{
- tcase_add_test(tc, eina_test_simple);
- tcase_add_test(tc, eina_test_merge);
- tcase_add_test(tc, eina_test_sorted_insert);
+ tcase_add_test(tc, eina_test_list_simple);
+ tcase_add_test(tc, eina_test_list_merge);
+ tcase_add_test(tc, eina_test_list_sorted_insert);
tcase_add_test(tc, eina_test_list_split);
- tcase_add_test(tc, eina_test_shuffle);
- tcase_add_test(tc, eina_test_clone);
- tcase_add_test(tc, eina_test_move);
+ tcase_add_test(tc, eina_test_list_shuffle);
+ tcase_add_test(tc, eina_test_list_clone);
+ tcase_add_test(tc, eina_test_list_move);
}
diff --git a/src/tests/eina/eina_test_lock.c b/src/tests/eina/eina_test_lock.c
index 6636706288..583ca1a7a9 100644
--- a/src/tests/eina/eina_test_lock.c
+++ b/src/tests/eina/eina_test_lock.c
@@ -71,7 +71,7 @@ _eina_test_lock_thread(void *data, Eina_Thread t)
fail_if(!eina_thread_equal(t, thread));
fail_if(strcmp("test", data));
- for (i = 0; i < 10000; i++)
+ for (i = 0; i < 150; i++)
{
fail_if(eina_spinlock_take(&spin) != EINA_LOCK_SUCCEED);
counter++;
@@ -81,18 +81,17 @@ _eina_test_lock_thread(void *data, Eina_Thread t)
return data;
}
-START_TEST(eina_test_spinlock)
+EFL_START_TEST(eina_test_spinlock)
{
unsigned int i;
- fail_if(!eina_init());
counter = 0;
fail_if(!eina_spinlock_new(&spin));
fail_if(!eina_thread_create(&thread, EINA_THREAD_NORMAL, -1, _eina_test_lock_thread, "test"));
- for (i = 0; i < 10000; i++)
+ for (i = 0; i < 150; i++)
{
fail_if(eina_spinlock_take(&spin) != EINA_LOCK_SUCCEED);
counter++;
@@ -101,16 +100,15 @@ START_TEST(eina_test_spinlock)
fail_if(strcmp("test", eina_thread_join(thread)));
- fail_if(counter != 20000);
+ fail_if(counter != 300);
fail_if(eina_spinlock_take_try(&spin) != EINA_LOCK_SUCCEED);
fail_if(eina_spinlock_release(&spin) != EINA_LOCK_SUCCEED);
eina_spinlock_free(&spin);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
static Eina_TLS key;
static int _eina_tls_free_count = 0;
@@ -148,9 +146,8 @@ _eina_test_tls_thread(void *data EINA_UNUSED, Eina_Thread t EINA_UNUSED)
return NULL;
}
-START_TEST(eina_test_tls)
+EFL_START_TEST(eina_test_tls)
{
- fail_if(!eina_init());
fail_if(!eina_tls_cb_new(&key, _eina_test_tls_free));
@@ -167,9 +164,8 @@ START_TEST(eina_test_tls)
eina_tls_free(key);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
static Eina_Barrier barrier;
static Eina_Lock mtcond;
@@ -197,12 +193,11 @@ _eina_test_rwlock_thread(void *data EINA_UNUSED, Eina_Thread t EINA_UNUSED)
return NULL;
}
-START_TEST(eina_test_rwlock)
+EFL_START_TEST(eina_test_rwlock)
{
struct timespec ts, ts2;
long delay;
- fail_if(!eina_init());
fail_if(!eina_rwlock_new(&mutex));
fail_if(!eina_lock_new(&mtcond));
@@ -251,9 +246,8 @@ START_TEST(eina_test_rwlock)
eina_lock_free(&mtcond);
eina_rwlock_free(&mutex);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eina_test_locking(TCase *tc)
diff --git a/src/tests/eina/eina_test_log.c b/src/tests/eina/eina_test_log.c
index cc20bfc98b..043cecf8cb 100644
--- a/src/tests/eina/eina_test_log.c
+++ b/src/tests/eina/eina_test_log.c
@@ -99,13 +99,12 @@ _eina_test_log_safety(const Eina_Log_Domain *d, Eina_Log_Level level, const char
#endif
}
-START_TEST(eina_log_macro)
+EFL_START_TEST(eina_log_macro)
{
struct log_ctx ctx;
int oldlevel;
int maxlevel;
- fail_if(!eina_init());
oldlevel = eina_log_level_get();
eina_log_level_set(EINA_LOG_LEVEL_DBG);
@@ -164,17 +163,15 @@ START_TEST(eina_log_macro)
eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
eina_log_level_set(oldlevel);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_log_domains_macros)
+EFL_START_TEST(eina_log_domains_macros)
{
struct log_ctx ctx;
int oldlevel;
int maxlevel;
- fail_if(!eina_init());
/* make global log level blocker */
oldlevel = eina_log_level_get();
@@ -241,13 +238,11 @@ START_TEST(eina_log_domains_macros)
eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
eina_log_level_set(oldlevel);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_log_domains_registry)
+EFL_START_TEST(eina_log_domains_registry)
{
- fail_if(!eina_init());
int i;
int d[50];
@@ -261,13 +256,11 @@ START_TEST(eina_log_domains_registry)
for (i = 0; i < 50; i++)
eina_log_domain_unregister(d[i]);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_log_domains_slot_reuse)
+EFL_START_TEST(eina_log_domains_slot_reuse)
{
- fail_if(!eina_init());
fail_if(!eina_threads_init());
// Create 9 domains
@@ -298,17 +291,14 @@ START_TEST(eina_log_domains_slot_reuse)
fail_if(new != removed);
eina_threads_shutdown();
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_log_level_indexes)
+EFL_START_TEST(eina_log_level_indexes)
{
struct log_ctx ctx;
int maxlevel;
- fail_if(!eina_init());
- fail_if(!eina_threads_init());
fail_if(!eina_threads_init());
int d = eina_log_domain_register("Levels", EINA_COLOR_GREEN);
@@ -369,12 +359,10 @@ START_TEST(eina_log_level_indexes)
eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
eina_threads_shutdown();
- eina_threads_shutdown();
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_log_customize)
+EFL_START_TEST(eina_log_customize)
{
struct log_ctx ctx;
int d;
@@ -382,7 +370,6 @@ START_TEST(eina_log_customize)
/* please don't define EINA_LOG_LEVELS for it */
#define TEST_DOM "_Test_Log_Dom"
- fail_if(!eina_init());
#define test_set_get(func, val) \
eina_log_ ## func ## _set(val); \
@@ -444,15 +431,13 @@ START_TEST(eina_log_customize)
#undef test_set_get_bool
#undef test_set_get
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_log_level_name)
+EFL_START_TEST(eina_log_level_name)
{
char name[4];
- fail_if(!eina_init());
#define tst(level, str) \
eina_log_level_name_get(level, name); \
@@ -471,9 +456,8 @@ START_TEST(eina_log_level_name)
#undef tst
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eina_test_log(TCase *tc)
diff --git a/src/tests/eina/eina_test_magic.c b/src/tests/eina/eina_test_magic.c
index 14a6f0dd7b..3404afb0fa 100644
--- a/src/tests/eina/eina_test_magic.c
+++ b/src/tests/eina/eina_test_magic.c
@@ -104,12 +104,11 @@ _eina_test_magic_print_cb(const Eina_Log_Domain *d, Eina_Log_Level level, const
ctx.expected_level = EINA_LOG_LEVEL_ERR
#endif
-START_TEST(eina_magic_simple)
+EFL_START_TEST(eina_magic_simple)
{
Eina_Magic_Struct *ems = NULL;
struct log_ctx ctx;
- eina_init();
eina_log_print_cb_set(_eina_test_safety_print_cb, &ctx);
@@ -189,9 +188,8 @@ START_TEST(eina_magic_simple)
eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void eina_test_magic(TCase *tc)
{
diff --git a/src/tests/eina/eina_test_main.c b/src/tests/eina/eina_test_main.c
index 434f415fb1..e70cdd038f 100644
--- a/src/tests/eina/eina_test_main.c
+++ b/src/tests/eina/eina_test_main.c
@@ -26,34 +26,25 @@
#include "eina_suite.h"
- START_TEST(eina_simple)
+EFL_START_TEST(eina_simple)
{
- fail_if(eina_init() != 2); /* one init by test suite */
- fail_if(eina_shutdown() != 1);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cpu)
+EFL_START_TEST(eina_cpu)
{
- fail_if(eina_init() != 2); /* one init by test suite */
-
fail_if(eina_cpu_count() <= 0);
eina_cpu_features_get();
- fail_if(eina_shutdown() != 1);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_hamster)
+EFL_START_TEST(eina_hamster)
{
- fail_if(eina_init() != 2); /* one init by test suite */
-
fail_if(eina_hamster_count() <= 0);
-
- fail_if(eina_shutdown() != 1);
}
-END_TEST
+EFL_END_TEST
void eina_test_main(TCase *tc)
{
diff --git a/src/tests/eina/eina_test_matrix.c b/src/tests/eina/eina_test_matrix.c
index 31662868e4..1d54f21e3f 100644
--- a/src/tests/eina/eina_test_matrix.c
+++ b/src/tests/eina/eina_test_matrix.c
@@ -29,13 +29,12 @@
#include "eina_suite.h"
-START_TEST(eina_matrix2)
+EFL_START_TEST(eina_matrix2)
{
Eina_Matrix2 m;
Eina_Matrix2 n;
double xx, xy, yx, yy;
- eina_init();
eina_matrix2_values_set(&m,
1, 0,
@@ -54,11 +53,10 @@ START_TEST(eina_matrix2)
fail_if(!EINA_DBL_EQ(xy, yx) ||
!EINA_DBL_EQ(xy, 0));
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_matrix2_operation)
+EFL_START_TEST(eina_matrix2_operation)
{
Eina_Matrix2 m1, m2, m3;
double xx, xy, yx, yy;
@@ -119,9 +117,9 @@ START_TEST(eina_matrix2_operation)
!EINA_DBL_EQ(xy, 5));
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_matrix4)
+EFL_START_TEST(eina_matrix4)
{
Eina_Matrix4 m;
Eina_Matrix4 n;
@@ -130,7 +128,6 @@ START_TEST(eina_matrix4)
zx, zy, zz, zw,
wx, wy, wz, ww;
- eina_init();
eina_matrix4_values_set(&m,
1, 0, 0, 0,
@@ -192,11 +189,10 @@ START_TEST(eina_matrix4)
!EINA_DBL_EQ(n.wz, 12) ||
!EINA_DBL_EQ(n.ww, 16));
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_matrix4_operation)
+EFL_START_TEST(eina_matrix4_operation)
{
double det;
double l=5, r=4, b=4, t=3, dn=3, df=2;
@@ -316,14 +312,13 @@ START_TEST(eina_matrix4_operation)
!EINA_DBL_EQ(wz, 5) ||
!EINA_DBL_EQ(ww, 1));
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_matrix4_2_3)
+EFL_START_TEST(eina_matrix4_2_3)
{
Eina_Matrix4 m4;
Eina_Matrix3 m3, m3b;
- eina_init();
eina_matrix3_values_set(&m3,
1, 3, 2,
@@ -335,11 +330,10 @@ START_TEST(eina_matrix4_2_3)
fail_if(memcmp(&m3, &m3b, sizeof (Eina_Matrix3)) != 0);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_matrix3)
+EFL_START_TEST(eina_matrix3)
{
Eina_Bool ret;
Eina_Matrix3 m, m1, m2;
@@ -347,7 +341,6 @@ START_TEST(eina_matrix3)
yx, yy, yz,
zx, zy, zz;
- eina_init();
eina_matrix3_values_set(&m,
1, 0, 0,
@@ -385,9 +378,8 @@ START_TEST(eina_matrix3)
ret = eina_matrix3_equal(&m1, &m2);
fail_if(ret != EINA_FALSE);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
#define MATRIX3_CMP(XX, XY, XZ, YX, YY, YZ, ZX, ZY, ZZ, AXX, AXY, AXZ, AYX, AYY, AYZ, AZX, AZY, AZZ) \
(EINA_DBL_EQ(XX, AXX) && \
@@ -400,7 +392,7 @@ END_TEST
EINA_DBL_EQ(ZY, AZY) && \
EINA_DBL_EQ(ZZ, AZZ))
-START_TEST(eina_matrix3_operations)
+EFL_START_TEST(eina_matrix3_operations)
{
Eina_Matrix3 m1, m2, m3;
double xx, xy, xz,
@@ -653,9 +645,9 @@ START_TEST(eina_matrix3_operations)
fail_if (!EINA_DBL_EQ(xx, 6) ||
!EINA_DBL_EQ(yy, 7));
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_matrix3_f16p16)
+EFL_START_TEST(eina_matrix3_f16p16)
{
Eina_Matrix3_F16p16 m1;
Eina_Matrix3 m2;
@@ -664,7 +656,6 @@ START_TEST(eina_matrix3_f16p16)
zx, zy, zz;
Eina_Matrix3_F16p16 m3;
- eina_init();
eina_matrix3_values_set(&m2,
1, 0, 0,
@@ -715,11 +706,10 @@ START_TEST(eina_matrix3_f16p16)
m3.zy != m3.zz ||
m3.zz != 196608);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_matrix3_map_transform)
+EFL_START_TEST(eina_matrix3_map_transform)
{
double x = 2, y = 3, x1, y1;
Eina_Matrix3 m;
@@ -727,7 +717,6 @@ START_TEST(eina_matrix3_map_transform)
Eina_Quad q;
Eina_Bool ret;
- eina_init();
eina_matrix3_values_set(&m,
0, 1, 0,
@@ -779,11 +768,10 @@ START_TEST(eina_matrix3_map_transform)
!EINA_DBL_EQ(q.x3, 0) ||
!EINA_DBL_EQ(q.y3, 3));
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_normal3_test)
+EFL_START_TEST(eina_normal3_test)
{
Eina_Matrix3 out;
Eina_Matrix4 m;
@@ -791,7 +779,6 @@ START_TEST(eina_normal3_test)
yx, yy, yz,
zx, zy, zz;
- eina_init();
eina_matrix4_values_set(&m,
1, 0, 0, 0,
0, 1, 0, 0,
@@ -826,9 +813,8 @@ START_TEST(eina_normal3_test)
(fabs(yz)) > DBL_EPSILON ||
(fabs(zy)) > DBL_EPSILON
);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eina_test_matrix(TCase *tc)
diff --git a/src/tests/eina/eina_test_matrixsparse.c b/src/tests/eina/eina_test_matrixsparse.c
index faa7f41f81..c1aba54f9d 100644
--- a/src/tests/eina/eina_test_matrixsparse.c
+++ b/src/tests/eina/eina_test_matrixsparse.c
@@ -58,7 +58,7 @@ static void matrixsparse_check(Eina_Matrixsparse *matrix,
}
}
-START_TEST(eina_test_simple)
+EFL_START_TEST(eina_test_simple)
{
Eina_Matrixsparse *matrix = NULL;
Eina_Matrixsparse_Cell *cell = NULL;
@@ -105,7 +105,6 @@ START_TEST(eina_test_simple)
value3 = -3;
value4 = -4;
- eina_init();
matrix = eina_matrixsparse_new(MAX_ROWS, MAX_COLS,
eina_matrixsparse_free_cell_cb, data);
@@ -266,11 +265,10 @@ START_TEST(eina_test_simple)
matrixsparse_check(matrix, data, MAX_ROWS, MAX_COLS);
eina_matrixsparse_free(matrix);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_resize)
+EFL_START_TEST(eina_test_resize)
{
Eina_Matrixsparse *matrix = NULL;
Eina_Bool r;
@@ -283,7 +281,6 @@ START_TEST(eina_test_resize)
for (j = 0; j < MAX_COLS; j++)
data[i][j] = 0;
- eina_init();
matrix = eina_matrixsparse_new(MAX_ROWS, MAX_COLS,
eina_matrixsparse_free_cell_cb, data);
@@ -378,11 +375,10 @@ START_TEST(eina_test_resize)
eina_matrixsparse_free(matrix);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_iterators)
+EFL_START_TEST(eina_test_iterators)
{
Eina_Matrixsparse *matrix = NULL;
Eina_Matrixsparse_Cell *cell = NULL;
@@ -405,7 +401,6 @@ START_TEST(eina_test_iterators)
printf("\n");
}
- eina_init();
matrix = eina_matrixsparse_new(MAX_ROWS, MAX_COLS,
eina_matrixsparse_free_cell_cb, data);
@@ -477,9 +472,8 @@ START_TEST(eina_test_iterators)
eina_matrixsparse_free(matrix);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eina_test_matrixsparse(TCase *tc)
diff --git a/src/tests/eina/eina_test_mempool.c b/src/tests/eina/eina_test_mempool.c
index 4b1d936a4f..9fa9c940a5 100644
--- a/src/tests/eina/eina_test_mempool.c
+++ b/src/tests/eina/eina_test_mempool.c
@@ -24,37 +24,6 @@
#include "eina_suite.h"
-static Eina_Array *_modules;
-
-static void
-_mempool_init(void)
-{
- eina_init();
- /* force modules to be loaded in case they are not installed */
- _modules = eina_module_list_get(NULL,
- PACKAGE_BUILD_DIR "/src/modules",
- EINA_TRUE,
- NULL,
- NULL);
- eina_module_list_load(_modules);
-}
-
-static void
-_mempool_shutdown(void)
-{
- unsigned int i;
- Eina_Array_Iterator it;
- Eina_Module *module;
- eina_module_list_free(_modules);
- if (_modules)
- {
- EINA_ARRAY_ITER_NEXT(_modules, i, module, it)
- free(module);
- eina_array_free(_modules);
- }
- eina_shutdown();
-}
-
static void
_eina_mempool_test(Eina_Mempool *mp,
Eina_Bool with_realloc, Eina_Bool with_gc, Eina_Bool accurate_from)
@@ -98,33 +67,25 @@ _eina_mempool_test(Eina_Mempool *mp,
}
#ifdef EINA_BUILD_CHAINED_POOL
-START_TEST(eina_mempool_chained_mempool)
+EFL_START_TEST(eina_mempool_chained_mempool)
{
Eina_Mempool *mp;
- _mempool_init();
-
mp = eina_mempool_add("chained_mempool", "test", NULL, sizeof (int), 256);
_eina_mempool_test(mp, EINA_FALSE, EINA_FALSE, EINA_TRUE);
-
- _mempool_shutdown();
}
-END_TEST
+EFL_END_TEST
#endif
#ifdef EINA_BUILD_PASS_THROUGH
-START_TEST(eina_mempool_pass_through)
+EFL_START_TEST(eina_mempool_pass_through)
{
Eina_Mempool *mp;
- _mempool_init();
-
mp = eina_mempool_add("pass_through", "test", NULL, sizeof (int), 8, 0);
_eina_mempool_test(mp, EINA_TRUE, EINA_FALSE, EINA_FALSE);
-
- _mempool_shutdown();
}
-END_TEST
+EFL_END_TEST
#endif
void
diff --git a/src/tests/eina/eina_test_module.c b/src/tests/eina/eina_test_module.c
index 4cd5bd5a29..68ad598899 100644
--- a/src/tests/eina/eina_test_module.c
+++ b/src/tests/eina/eina_test_module.c
@@ -45,16 +45,15 @@ static Eina_Bool list_cb(Eina_Module *m, void *data EINA_UNUSED)
}
-START_TEST(eina_module_load_unload)
+EFL_START_TEST(eina_module_load_unload)
{
Eina_Array *_modules;
unsigned int i;
Eina_Array_Iterator it;
Eina_Module *module;
- eina_init();
_modules = eina_module_list_get(NULL,
- PACKAGE_BUILD_DIR "/src/tests/",
+ PACKAGE_BUILD_DIR "/src/tests/eina",
EINA_TRUE,
&list_cb,
NULL);
@@ -65,25 +64,22 @@ START_TEST(eina_module_load_unload)
EINA_ARRAY_ITER_NEXT(_modules, i, module, it)
free(module);
eina_array_free(_modules);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_module_find_test)
+EFL_START_TEST(eina_module_find_test)
{
Eina_Array *_modules;
- eina_init();
_modules = eina_module_list_get(NULL,
- PACKAGE_BUILD_DIR "/src/tests/",
+ PACKAGE_BUILD_DIR "/src/tests/eina",
EINA_TRUE,
&list_cb,
NULL);
fail_if(!_modules);
fail_if(eina_module_find(_modules, NULL) != NULL);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eina_test_module(TCase *tc)
diff --git a/src/tests/eina/eina_test_quad.c b/src/tests/eina/eina_test_quad.c
index e05884f664..d8a3cf206a 100644
--- a/src/tests/eina/eina_test_quad.c
+++ b/src/tests/eina/eina_test_quad.c
@@ -9,14 +9,13 @@
#include "eina_suite.h"
-START_TEST(eina_quad_simple)
+EFL_START_TEST(eina_quad_simple)
{
Eina_Rectangle r1;
Eina_Quad r2;
double x0, x1, x2, x3;
double y0, y1, y2, y3;
- fail_if(!eina_init());
eina_quad_coords_set(&r2,
0.0, 5.0,
@@ -66,9 +65,8 @@ START_TEST(eina_quad_simple)
!EINA_FLT_EQ(r2.x3, 5.0) ||
!EINA_FLT_EQ(r2.y3, 40.0));
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eina_test_quad(TCase *tc)
diff --git a/src/tests/eina/eina_test_quadtree.c b/src/tests/eina/eina_test_quadtree.c
index 3a64b96582..175154de23 100644
--- a/src/tests/eina/eina_test_quadtree.c
+++ b/src/tests/eina/eina_test_quadtree.c
@@ -55,7 +55,7 @@ _eina_quadtree_rectangle_hort(const void *object, size_t middle)
return EINA_QUAD_BOTH;
}
-START_TEST(eina_quadtree_collision)
+EFL_START_TEST(eina_quadtree_collision)
{
struct
{
@@ -94,7 +94,6 @@ START_TEST(eina_quadtree_collision)
int count;
int i;
- fail_if(!eina_init());
q = eina_quadtree_new(640, 480,
_eina_quadtree_rectangle_vert,
@@ -185,9 +184,8 @@ START_TEST(eina_quadtree_collision)
eina_quadtree_free(q);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eina_test_quadtree(TCase *tc)
diff --git a/src/tests/eina/eina_test_quaternion.c b/src/tests/eina/eina_test_quaternion.c
index 1949af7a20..fc1ec16bef 100644
--- a/src/tests/eina/eina_test_quaternion.c
+++ b/src/tests/eina/eina_test_quaternion.c
@@ -92,26 +92,23 @@ eina_quaternion_f16p16_cmp(const Eina_Quaternion_F16p16 *a, const Eina_Quaternio
return EINA_FALSE;
}
-START_TEST(eina_test_quaternion_norm)
+EFL_START_TEST(eina_test_quaternion_norm)
{
static const Eina_Quaternion q = { 1, 3, 4, 5 };
double result = eina_quaternion_norm(&q);
- eina_init();
fail_if(!EINA_FLT_EQ(result, sqrt(51)));
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_quaternion_conjugate)
+EFL_START_TEST(eina_test_quaternion_conjugate)
{
static const Eina_Quaternion q1 = { 1, -1, -1, 3 }, q2 = { 1, 3, 4, 3 };
static const Eina_Quaternion r1 = { -1, 1, 1, 3 }, r2 = { -1, -3, -4, 3 };
Eina_Quaternion t1, t2;
- eina_init();
eina_quaternion_conjugate(&t1, &q1);
eina_quaternion_conjugate(&t2, &q2);
@@ -119,11 +116,10 @@ START_TEST(eina_test_quaternion_conjugate)
fail_if(!eina_quaternion_cmp(&t1, &r1));
fail_if(!eina_quaternion_cmp(&t2, &r2));
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_quaternion_matrix)
+EFL_START_TEST(eina_test_quaternion_matrix)
{
Eina_Quaternion q = { 7, 9, 5, 1 };
Eina_Quaternion q1 = {7, 9, 5, -1 };
@@ -135,7 +131,6 @@ START_TEST(eina_test_quaternion_matrix)
};
Eina_Matrix3 tm;
- eina_init();
eina_quaternion_rotation_matrix3_get(&tm, &q);
fail_if(!eina_matrix3_cmp(&tm, &m));
@@ -143,28 +138,25 @@ START_TEST(eina_test_quaternion_matrix)
eina_matrix3_quaternion_get(&tq, &m);
fail_if(!eina_quaternion_cmp(&tq, &q) && !eina_quaternion_cmp(&tq, &q1));
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_quaternion_op)
+EFL_START_TEST(eina_test_quaternion_op)
{
Eina_Quaternion q = { 7, 9, 5, 1 };
Eina_Quaternion z = { 0, 0, 0, 0 };
Eina_Quaternion neg, r;
- eina_init();
eina_quaternion_negative(&neg, &q);
eina_quaternion_add(&r, &q, &neg);
fail_if(!eina_quaternion_cmp(&z, &r));
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_quaternion_f16p16)
+EFL_START_TEST(eina_test_quaternion_f16p16)
{
Eina_F16p16 x = 65536, y = 65536;
Eina_F16p16 z = 65536, w = 65536;
@@ -173,7 +165,6 @@ START_TEST(eina_test_quaternion_f16p16)
Eina_Quaternion_F16p16 t, s, r = {65536, 65536, 65536, 65536};
- eina_init();
eina_quaternion_f16p16_set(&p, x, y, z, w);
fail_if(!eina_quaternion_cmp(&p, &q));
@@ -219,68 +210,60 @@ START_TEST(eina_test_quaternion_f16p16)
t.z != 131072 ||
t.w != 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_quaternion_dot)
+EFL_START_TEST(eina_test_quaternion_dot)
{
Eina_Quaternion q = {1, 3, 4, 5};
Eina_Quaternion r = {7, 9, 5, 1};
double res;
- eina_init();
res = eina_quaternion_dot(&q, &r);
fail_if(res != 59);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_quaternion_scale)
+EFL_START_TEST(eina_test_quaternion_scale)
{
Eina_Quaternion q = {1, 3, 4, 5};
double scale = 2;
Eina_Quaternion r, res = {2, 6, 8, 10};
- eina_init();
eina_quaternion_scale(&r, &q, scale);
fail_if(!eina_quaternion_cmp(&r, &res));
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_quaternion_set)
+EFL_START_TEST(eina_test_quaternion_set)
{
Eina_Quaternion q, r = {1, 3, 4, 5};
- eina_init();
eina_quaternion_set(&q, 1, 3, 4, 5);
fail_if(!eina_quaternion_cmp(&q, &r));
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_quaternion_mul)
+EFL_START_TEST(eina_test_quaternion_mul)
{
Eina_Quaternion p = {1, 3, 4, 5};
Eina_Quaternion q = {7, 9, 5, 1};
Eina_Quaternion r, res = {15, 71, 17, -49};
- eina_init();
eina_quaternion_mul(&r, &p, &q);
fail_if(!eina_quaternion_cmp(&r, &res));
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_matrix_recompose)
+EFL_START_TEST(eina_test_matrix_recompose)
{
const Eina_Point_3D translation = { 0, 0, 0 };
const Eina_Point_3D scale = { 1, 1, 1 };
@@ -289,7 +272,6 @@ START_TEST(eina_test_matrix_recompose)
const Eina_Quaternion rotation = { 0, 0, 0, 1 };
Eina_Matrix4 m4;
- eina_init();
eina_quaternion_matrix4_to(&m4,
&rotation,
@@ -300,26 +282,23 @@ START_TEST(eina_test_matrix_recompose)
fail_if(eina_matrix4_type_get(&m4) != EINA_MATRIX_TYPE_IDENTITY);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_quaternion_normalized)
+EFL_START_TEST(eina_test_quaternion_normalized)
{
Eina_Quaternion p = {1, 1, 1, 1};
Eina_Quaternion res, q = {0.5, 0.5, 0.5, 0.5};
- eina_init();
eina_quaternion_normalized(&res, &p);
fail_if(!eina_quaternion_cmp(&q, &res));
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
#if 0
-START_TEST(eina_test_matrix_quaternion)
+EFL_START_TEST(eina_test_matrix_quaternion)
{
const Eina_Point_3D rt = { -2, -3, 0 };
const Eina_Point_3D rsc = { 4, 5, 1 };
@@ -330,7 +309,6 @@ START_TEST(eina_test_matrix_quaternion)
Eina_Matrix4 m4, m4r;
Eina_Point_3D translation, scale, skew;
- eina_init();
eina_matrix3_identity(&m3);
eina_matrix3_rotate(&m3, 3.14159265);
@@ -362,19 +340,17 @@ START_TEST(eina_test_matrix_quaternion)
// Disable this test for the moment as it seems a rounding issue
// fail_if(!eina_matrix3_cmp(&m3r, &m3));
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
#endif
-START_TEST(eina_test_quaternion_f16p16_lerp)
+EFL_START_TEST(eina_test_quaternion_f16p16_lerp)
{
Eina_Quaternion_F16p16 r, p = {0, 0, 0, 0};
Eina_Quaternion_F16p16 q = {65536, 65536, 65536, 0};
Eina_Quaternion_F16p16 res1 = {65536, 65536, 65536, 0};
Eina_Quaternion_F16p16 res2 = {0, 0, 0, 0};
- eina_init();
eina_quaternion_f16p16_lerp(&r, &p, &q, 65536);
fail_if(!eina_quaternion_f16p16_cmp(&r, &res1));
@@ -391,17 +367,15 @@ START_TEST(eina_test_quaternion_f16p16_lerp)
eina_quaternion_f16p16_nlerp(&r, &p, &q, 65536);
fail_if(!eina_quaternion_f16p16_cmp(&r, &res1));
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_quaternion_lerp)
+EFL_START_TEST(eina_test_quaternion_lerp)
{
Eina_Quaternion rp = {0, 0, 1, 0};
Eina_Quaternion rq = {1, 0, 0, 0};
Eina_Quaternion rr, res = {0.5, 0.0, 0.5, 0.0};
- eina_init();
eina_quaternion_lerp(&rr, &rp, &rq, 0.5);
fail_if(!eina_quaternion_cmp(&rr, &res));
@@ -427,11 +401,10 @@ START_TEST(eina_test_quaternion_lerp)
eina_quaternion_nlerp(&rr, &rp, &rq, 1.0);
fail_if(!eina_quaternion_cmp(&rr, &res));
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_quaternion_f16p16_rotate_matrix)
+EFL_START_TEST(eina_test_quaternion_f16p16_rotate_matrix)
{
Eina_Quaternion_F16p16 q = {65536, 65536, 65536, 0};
Eina_Point_3D_F16p16 r = { 65536, 65536, 65536 };
@@ -440,7 +413,6 @@ START_TEST(eina_test_quaternion_f16p16_rotate_matrix)
131072, -262144, 131072,
131072, 131072, -262144 };
- eina_init();
eina_quaternion_f16p16_rotate(&r, &c, &q);
fail_if(r.x != res.x ||
@@ -450,18 +422,16 @@ START_TEST(eina_test_quaternion_f16p16_rotate_matrix)
eina_quaternion_f16p16_rotation_matrix3_get(&m, &q);
fail_if(!eina_matrix3_f16p16_cmp(&m, &mres));
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_quaternion_rotate)
+EFL_START_TEST(eina_test_quaternion_rotate)
{
Eina_Point_3D r = { 3, 3, 3 };
Eina_Point_3D c = { 0, 0, 0}, res = {3.0, 3.0, 3.0};
Eina_Point_3D res1 = {3.0, 3.0, -9.0};
Eina_Quaternion q = {1, 1, 1, 0};
- eina_init();
eina_quaternion_rotate(&r, &c, &q);
fail_if(!eina_point_3d_cmp(&r, &res));
@@ -470,11 +440,10 @@ START_TEST(eina_test_quaternion_rotate)
eina_quaternion_rotate(&r, &c, &q);
fail_if(!eina_point_3d_cmp(&r, &res1));
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_quaternion_operations)
+EFL_START_TEST(eina_test_quaternion_operations)
{
Eina_Quaternion in = {2, 2, 1, 1};
Eina_Quaternion in2 = {5, 5, 5, 5};
@@ -482,7 +451,6 @@ START_TEST(eina_test_quaternion_operations)
const double v[] = {0, 1, 2, 3};
double angle;
Eina_Matrix4 m;
- eina_init();
eina_quaternion_inverse(&out, &in);
fail_if((out.x + 0.2 > DBL_EPSILON) || (out.y + 0.2 > DBL_EPSILON) ||
@@ -535,9 +503,8 @@ START_TEST(eina_test_quaternion_operations)
(fabs(out.z) - 1.0) > DBL_EPSILON ||
(fabs(out.w) - 1.0) > DBL_EPSILON
);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eina_test_quaternion(TCase *tc)
diff --git a/src/tests/eina/eina_test_rbtree.c b/src/tests/eina/eina_test_rbtree.c
index f8ecff864f..3a800b695a 100644
--- a/src/tests/eina/eina_test_rbtree.c
+++ b/src/tests/eina/eina_test_rbtree.c
@@ -286,28 +286,30 @@ eina_rbtree_int_key(const Eina_Rbtree_Int *node,
}
static Eina_Rbtree_Int *
-_eina_rbtree_int_new(int value)
+_eina_rbtree_int_init(int num)
{
- Eina_Rbtree_Int *it;
-
- it = malloc(sizeof (Eina_Rbtree_Int));
- fail_if(!it);
+ return malloc(num * sizeof(Eina_Rbtree_Int));
+}
- it->value = value;
+static Eina_Rbtree_Int *
+_eina_rbtree_int_new(int value, Eina_Rbtree_Int *mem, int i)
+{
+ mem[i].value = value;
- return it;
+ return &mem[i];
}
-START_TEST(eina_rbtree_insertion)
+EFL_START_TEST(eina_rbtree_insertion)
{
Eina_Rbtree_Int *root = NULL;
Eina_Rbtree_Int *item;
int i;
+ Eina_Rbtree_Int *mem;
-
+ mem = _eina_rbtree_int_init(500);
for (i = 0; i < 500; ++i)
{
- item = _eina_rbtree_int_new(r1[i]);
+ item = _eina_rbtree_int_new(r1[i], mem, i);
root = (Eina_Rbtree_Int *)eina_rbtree_inline_insert(
&root->node,
&item->node,
@@ -319,19 +321,22 @@ START_TEST(eina_rbtree_insertion)
_eina_rbtree_black_height(&root->node,
EINA_RBTREE_CMP_NODE_CB(
eina_rbtree_int_cmp));
+ free(mem);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_rbtree_lookup)
+EFL_START_TEST(eina_rbtree_lookup)
{
Eina_Rbtree_Int *root = NULL;
Eina_Rbtree_Int *item;
int list[] = { 50, 100, 10, 43, 23 };
unsigned int i;
+ Eina_Rbtree_Int *mem;
- for (i = 0; i < sizeof (list) / sizeof (int); ++i)
+ mem = _eina_rbtree_int_init(EINA_C_ARRAY_LENGTH(list));
+ for (i = 0; i < EINA_C_ARRAY_LENGTH(list); ++i)
{
- item = _eina_rbtree_int_new(list[i]);
+ item = _eina_rbtree_int_new(list[i], mem, i);
root = (Eina_Rbtree_Int *)eina_rbtree_inline_insert(
&root->node,
&item->node,
@@ -357,26 +362,30 @@ START_TEST(eina_rbtree_lookup)
eina_rbtree_int_key),
NULL);
fail_if(item);
+ free(mem);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_rbtree_remove)
+EFL_START_TEST(eina_rbtree_remove)
{
Eina_Rbtree_Int *root = NULL;
Eina_Rbtree_Int *item;
Eina_Array *ea;
Eina_Array_Iterator it;
unsigned int i;
+ Eina_Rbtree_Int *mem;
+
+ unsigned int num_nodes = 20;
- eina_init();
+ mem = _eina_rbtree_int_init(num_nodes);
- ea = eina_array_new(11);
+ ea = eina_array_new(num_nodes);
fail_if(!ea);
- for (i = 0; i < 500; ++i)
+ for (i = 0; i < num_nodes; ++i)
{
- item = _eina_rbtree_int_new(r1[i]);
+ item = _eina_rbtree_int_new(r1[i], mem, i);
eina_array_push(ea, item);
root = (Eina_Rbtree_Int *)eina_rbtree_inline_insert(
&root->node,
@@ -402,37 +411,27 @@ START_TEST(eina_rbtree_remove)
}
fail_if(root != NULL);
-
- eina_shutdown();
+ eina_array_free(ea);
+ free(mem);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_rbtree_simple_remove)
+EFL_START_TEST(eina_rbtree_simple_remove)
{
Eina_Rbtree *root = NULL;
Eina_Rbtree *lookup;
int i;
-
- root =
- eina_rbtree_inline_insert(root, (Eina_Rbtree *)_eina_rbtree_int_new(
- 10),
- EINA_RBTREE_CMP_NODE_CB(
- eina_rbtree_int_cmp), NULL);
- root =
- eina_rbtree_inline_insert(root, (Eina_Rbtree *)_eina_rbtree_int_new(
- 42),
- EINA_RBTREE_CMP_NODE_CB(
- eina_rbtree_int_cmp), NULL);
- root =
- eina_rbtree_inline_insert(root, (Eina_Rbtree *)_eina_rbtree_int_new(
- 69),
- EINA_RBTREE_CMP_NODE_CB(
- eina_rbtree_int_cmp), NULL);
- root =
- eina_rbtree_inline_insert(root, (Eina_Rbtree *)_eina_rbtree_int_new(
- 1337),
- EINA_RBTREE_CMP_NODE_CB(
- eina_rbtree_int_cmp), NULL);
+ int values[] =
+ {
+ 10, 42, 69, 1337
+ };
+ Eina_Rbtree_Int *mem;
+
+ mem = _eina_rbtree_int_init(EINA_C_ARRAY_LENGTH(values));
+ for (i = 0; i < (int)EINA_C_ARRAY_LENGTH(values); i++)
+ root = eina_rbtree_inline_insert(root,
+ (Eina_Rbtree *)_eina_rbtree_int_new(values[i], mem, i),
+ EINA_RBTREE_CMP_NODE_CB( eina_rbtree_int_cmp), NULL);
_eina_rbtree_black_height(root,
EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp));
@@ -453,50 +452,26 @@ START_TEST(eina_rbtree_simple_remove)
eina_rbtree_int_cmp), NULL);
_eina_rbtree_black_height(root, EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp));
+ free(mem);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_rbtree_simple_remove2)
+EFL_START_TEST(eina_rbtree_simple_remove2)
{
Eina_Rbtree *root = NULL;
Eina_Rbtree *lookup;
int i;
-
- root =
- eina_rbtree_inline_insert(root, (Eina_Rbtree *)_eina_rbtree_int_new(
- 10),
- EINA_RBTREE_CMP_NODE_CB(
- eina_rbtree_int_cmp), NULL);
- root =
- eina_rbtree_inline_insert(root, (Eina_Rbtree *)_eina_rbtree_int_new(
- 42),
- EINA_RBTREE_CMP_NODE_CB(
- eina_rbtree_int_cmp), NULL);
- root =
- eina_rbtree_inline_insert(root, (Eina_Rbtree *)_eina_rbtree_int_new(
- 69),
- EINA_RBTREE_CMP_NODE_CB(
- eina_rbtree_int_cmp), NULL);
- root =
- eina_rbtree_inline_insert(root, (Eina_Rbtree *)_eina_rbtree_int_new(
- 1337),
- EINA_RBTREE_CMP_NODE_CB(
- eina_rbtree_int_cmp), NULL);
- root =
- eina_rbtree_inline_insert(root, (Eina_Rbtree *)_eina_rbtree_int_new(
- 77),
- EINA_RBTREE_CMP_NODE_CB(
- eina_rbtree_int_cmp), NULL);
- root =
- eina_rbtree_inline_insert(root, (Eina_Rbtree *)_eina_rbtree_int_new(
- 75),
- EINA_RBTREE_CMP_NODE_CB(
- eina_rbtree_int_cmp), NULL);
- root =
- eina_rbtree_inline_insert(root, (Eina_Rbtree *)_eina_rbtree_int_new(
- 81),
- EINA_RBTREE_CMP_NODE_CB(
- eina_rbtree_int_cmp), NULL);
+ int values[] =
+ {
+ 10, 42, 69, 1337, 77, 75, 81
+ };
+ Eina_Rbtree_Int *mem;
+
+ mem = _eina_rbtree_int_init(EINA_C_ARRAY_LENGTH(values));
+ for (i = 0; i < (int)EINA_C_ARRAY_LENGTH(values); i++)
+ root = eina_rbtree_inline_insert(root,
+ (Eina_Rbtree *)_eina_rbtree_int_new(values[i], mem, i),
+ EINA_RBTREE_CMP_NODE_CB( eina_rbtree_int_cmp), NULL);
_eina_rbtree_black_height(root,
EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp));
@@ -517,80 +492,39 @@ START_TEST(eina_rbtree_simple_remove2)
eina_rbtree_int_cmp), NULL);
_eina_rbtree_black_height(root, EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp));
+ free(mem);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_rbtree_simple_remove3)
+EFL_START_TEST(eina_rbtree_simple_remove3)
{
Eina_Rbtree *root = NULL;
Eina_Rbtree *lookup;
int i;
+ int values[] =
+ {
+ 1113497590,
+ 499187507,
+ 1693860487,
+ 26211080,
+ 797272577,
+ 1252184882,
+ 1448158229,
+ 1821884856,
+ 346086006,
+ 936357333,
+ 1462073936,
+ 1717320055,
+ 1845524606
+ };
+ Eina_Rbtree_Int *mem;
+
+ mem = _eina_rbtree_int_init(EINA_C_ARRAY_LENGTH(values));
+ for (i = 0; i < (int)EINA_C_ARRAY_LENGTH(values); i++)
+ root = eina_rbtree_inline_insert(root,
+ (Eina_Rbtree *)_eina_rbtree_int_new(values[i], mem, i),
+ EINA_RBTREE_CMP_NODE_CB( eina_rbtree_int_cmp), NULL);
- root =
- eina_rbtree_inline_insert(root, (Eina_Rbtree *)_eina_rbtree_int_new(
- 1113497590),
- EINA_RBTREE_CMP_NODE_CB(
- eina_rbtree_int_cmp), NULL);
- root =
- eina_rbtree_inline_insert(root, (Eina_Rbtree *)_eina_rbtree_int_new(
- 499187507),
- EINA_RBTREE_CMP_NODE_CB(
- eina_rbtree_int_cmp), NULL);
- root =
- eina_rbtree_inline_insert(root, (Eina_Rbtree *)_eina_rbtree_int_new(
- 1693860487),
- EINA_RBTREE_CMP_NODE_CB(
- eina_rbtree_int_cmp), NULL);
- root =
- eina_rbtree_inline_insert(root, (Eina_Rbtree *)_eina_rbtree_int_new(
- 26211080),
- EINA_RBTREE_CMP_NODE_CB(
- eina_rbtree_int_cmp), NULL);
- root =
- eina_rbtree_inline_insert(root, (Eina_Rbtree *)_eina_rbtree_int_new(
- 797272577),
- EINA_RBTREE_CMP_NODE_CB(
- eina_rbtree_int_cmp), NULL);
- root =
- eina_rbtree_inline_insert(root, (Eina_Rbtree *)_eina_rbtree_int_new(
- 1252184882),
- EINA_RBTREE_CMP_NODE_CB(
- eina_rbtree_int_cmp), NULL);
- root =
- eina_rbtree_inline_insert(root, (Eina_Rbtree *)_eina_rbtree_int_new(
- 1448158229),
- EINA_RBTREE_CMP_NODE_CB(
- eina_rbtree_int_cmp), NULL);
- root =
- eina_rbtree_inline_insert(root, (Eina_Rbtree *)_eina_rbtree_int_new(
- 1821884856),
- EINA_RBTREE_CMP_NODE_CB(
- eina_rbtree_int_cmp), NULL);
- root =
- eina_rbtree_inline_insert(root, (Eina_Rbtree *)_eina_rbtree_int_new(
- 346086006),
- EINA_RBTREE_CMP_NODE_CB(
- eina_rbtree_int_cmp), NULL);
- root =
- eina_rbtree_inline_insert(root, (Eina_Rbtree *)_eina_rbtree_int_new(
- 936357333),
- EINA_RBTREE_CMP_NODE_CB(
- eina_rbtree_int_cmp), NULL);
- root =
- eina_rbtree_inline_insert(root, (Eina_Rbtree *)_eina_rbtree_int_new(
- 1462073936),
- EINA_RBTREE_CMP_NODE_CB(
- eina_rbtree_int_cmp), NULL);
- root =
- eina_rbtree_inline_insert(root, (Eina_Rbtree *)_eina_rbtree_int_new(
- 1717320055),
- EINA_RBTREE_CMP_NODE_CB(
- eina_rbtree_int_cmp), NULL);
- root =
- eina_rbtree_inline_insert(root, (Eina_Rbtree *)_eina_rbtree_int_new(
- 1845524606),
- EINA_RBTREE_CMP_NODE_CB(
- eina_rbtree_int_cmp), NULL);
_eina_rbtree_black_height(root,
EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp));
@@ -611,70 +545,38 @@ START_TEST(eina_rbtree_simple_remove3)
eina_rbtree_int_cmp), NULL);
_eina_rbtree_black_height(root, EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp));
+ free(mem);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_rbtree_fuzzy)
+EFL_START_TEST(eina_rbtree_fuzzy)
{
Eina_Rbtree_Int *child;
Eina_Rbtree *root = NULL;
- Eina_List *added = NULL;
unsigned int i;
- unsigned int j;
-
- eina_init();
-
+ Eina_Rbtree_Int *mem;
- for (i = 0; i < 10000; i++)
+ mem = _eina_rbtree_int_init(100);
+ for (i = 0; i < 100; i++)
{
- child = _eina_rbtree_int_new(r2[i]);
+ child = _eina_rbtree_int_new(r2[i], mem, i);
+ root = eina_rbtree_inline_remove(root, (Eina_Rbtree*) child,
+ EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp), NULL);
root = eina_rbtree_inline_insert(root, (Eina_Rbtree*) child,
EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp), NULL);
}
- for (j = 0; j < 20; j++)
+ for (i = 0; i < 100; i++)
{
- for (i = 0; i < 1000; i++)
- {
- int r;
-
- do
- {
- r = r1[i];
-
- child = (Eina_Rbtree_Int *) eina_rbtree_inline_lookup(root, &r, sizeof (int),
- EINA_RBTREE_CMP_KEY_CB(eina_rbtree_int_key), NULL);
- if (child)
- {
- child = NULL;
- continue ;
- }
-
- child = _eina_rbtree_int_new(r);
- root = eina_rbtree_inline_insert(root, (Eina_Rbtree*) child,
- EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp), NULL);
- added = eina_list_append(added, child);
- }
- while (child == NULL);
- }
-
- EINA_LIST_FREE(added, child)
- {
- Eina_Rbtree *lookup;
-
- lookup = eina_rbtree_inline_lookup(root, &child->value, sizeof (int),
- EINA_RBTREE_CMP_KEY_CB(eina_rbtree_int_key), NULL);
- fail_if(lookup == NULL);
- fail_if(lookup != (Eina_Rbtree*) child);
-
- root = eina_rbtree_inline_remove(root, (Eina_Rbtree*) child,
- EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp), NULL);
- }
- }
+ int r;
- eina_shutdown();
+ r = r1[i];
+ ck_assert_ptr_eq(eina_rbtree_inline_lookup(root, &r, sizeof (int),
+ EINA_RBTREE_CMP_KEY_CB(eina_rbtree_int_key), NULL), NULL);
+ }
+ free(mem);
}
-END_TEST
+EFL_END_TEST
void
eina_test_rbtree(TCase *tc)
diff --git a/src/tests/eina/eina_test_rectangle.c b/src/tests/eina/eina_test_rectangle.c
index a6891f3553..b38cc75639 100644
--- a/src/tests/eina/eina_test_rectangle.c
+++ b/src/tests/eina/eina_test_rectangle.c
@@ -26,7 +26,7 @@
#include "eina_suite.h"
-START_TEST(eina_rectangle_pool)
+EFL_START_TEST(eina_rectangle_pool)
{
Eina_Rectangle_Pool *pool;
Eina_Rectangle *rects[8][8];
@@ -35,7 +35,6 @@ START_TEST(eina_rectangle_pool)
int w;
int h;
- fail_if(!eina_init());
pool = eina_rectangle_pool_new(256, 256);
fail_if(pool == NULL);
@@ -69,11 +68,10 @@ START_TEST(eina_rectangle_pool)
eina_rectangle_pool_free(pool);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_rectangle_pool_skyline)
+EFL_START_TEST(eina_rectangle_pool_skyline)
{
Eina_Rectangle_Pool *pool;
Eina_Rectangle *rects[8][8];
@@ -82,7 +80,6 @@ START_TEST(eina_rectangle_pool_skyline)
int w;
int h;
- fail_if(!eina_init());
pool = eina_rectangle_pool_new(256, 256);
fail_if(pool == NULL);
@@ -116,15 +113,13 @@ START_TEST(eina_rectangle_pool_skyline)
eina_rectangle_pool_free(pool);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_rectangle_union_intersect)
+EFL_START_TEST(eina_rectangle_union_intersect)
{
Eina_Rectangle r1, r2, r3, r4, r5, r6, r7, r8, rd;
- fail_if(!eina_init());
EINA_RECTANGLE_SET(&r1, 10, 10, 50, 50);
EINA_RECTANGLE_SET(&r2, 20, 20, 20, 20);
@@ -192,11 +187,10 @@ START_TEST(eina_rectangle_union_intersect)
|| rd.w != 20
|| rd.h != 20);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_rectangle_position_test)
+EFL_START_TEST(eina_rectangle_position_test)
{
Eina_Rectangle middle, top, down, right, left;
EINA_RECTANGLE_SET(&middle, -1, -1, 2.0, 2.0);
@@ -211,7 +205,7 @@ START_TEST(eina_rectangle_position_test)
ck_assert_int_eq(eina_rectangle_outside_position(&middle, &left), EINA_RECTANGLE_OUTSIDE_LEFT) ;
}
-END_TEST
+EFL_END_TEST
void
eina_test_rectangle(TCase *tc)
diff --git a/src/tests/eina/eina_test_safepointer.c b/src/tests/eina/eina_test_safepointer.c
index e7569588f2..c99a188c2e 100644
--- a/src/tests/eina/eina_test_safepointer.c
+++ b/src/tests/eina/eina_test_safepointer.c
@@ -26,51 +26,49 @@
#include "eina_suite.h"
-static int test_array[1024] = { 0, 1, 2, 3, 4, 5, 6, 7 };
+static int test_array[128] = { 0, 1, 2, 3, 4, 5, 6, 7 };
static int test_array2[64] = { 8, 9, 10, 11, 12, 13, 14 };
-static const void *pointers[1088] = { NULL };
+static const void *pointers[EINA_C_ARRAY_LENGTH(test_array) + EINA_C_ARRAY_LENGTH(test_array2)] = { NULL };
-START_TEST(eina_test_reusable)
+EFL_START_TEST(eina_test_safepointer_reusable)
{
unsigned int i;
- eina_init();
- for (i = 0; i < sizeof (test_array) / sizeof (test_array[0]); i++)
+ for (i = 0; i < EINA_C_ARRAY_LENGTH(test_array); i++)
{
- pointers[i] = eina_safepointer_register(&test_array[i]);
- fail_if(pointers[i] == NULL);
- fail_if(pointers[i] == &test_array[i]);
- fail_if(&test_array[i] != eina_safepointer_get(pointers[i]));
+ const void *ptr = pointers[i] = eina_safepointer_register(&test_array[i]);
+ ck_assert_ptr_ne(ptr, NULL);
+ ck_assert_ptr_ne(ptr, &test_array[i]);
+ ck_assert_ptr_eq(&test_array[i], eina_safepointer_get(pointers[i]));
}
- for (i = 0; i < sizeof (test_array2) / sizeof (test_array2[0]); i++)
+ for (i = 0; i < EINA_C_ARRAY_LENGTH(test_array2); i++)
{
- pointers[i + (sizeof (test_array) / sizeof (test_array[0]))] = eina_safepointer_register(&test_array2[i]);
- fail_if(pointers[i + (sizeof (test_array) / sizeof (test_array[0]))] == NULL);
- fail_if(pointers[i + (sizeof (test_array) / sizeof (test_array[0]))] == &test_array2[i]);
- fail_if(&test_array2[i] != eina_safepointer_get(pointers[i + (sizeof (test_array) / sizeof (test_array[0]))]));
- eina_safepointer_unregister(pointers[i + (sizeof (test_array) / sizeof (test_array[0]))]);
+ const void *ptr = pointers[i + EINA_C_ARRAY_LENGTH(test_array)] = eina_safepointer_register(&test_array2[i]);
+ ck_assert_ptr_ne(ptr, NULL);
+ ck_assert_ptr_ne(ptr, &test_array2[i]);
+ ck_assert_ptr_eq(&test_array2[i], eina_safepointer_get(ptr));
+ eina_safepointer_unregister(ptr);
}
- for (i = 0; i < sizeof (test_array) / sizeof (test_array[0]); i++)
+ for (i = 0; i < EINA_C_ARRAY_LENGTH(test_array); i++)
{
eina_safepointer_unregister(pointers[i]);
}
- for (i = 0; i < sizeof (pointers) / sizeof (pointers[0]); i++)
+ for (i = 0; i < EINA_C_ARRAY_LENGTH(pointers); i++)
{
unsigned int j;
- for (j = i + 1; j < sizeof (pointers) / sizeof (pointers[0]); j++)
+ for (j = i + 1; j < EINA_C_ARRAY_LENGTH(pointers); j++)
{
- fail_if(pointers[j] == pointers[i]);
+ ck_assert_ptr_ne(pointers[j], pointers[i]);
}
}
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
static Eina_Barrier b;
@@ -79,14 +77,14 @@ _thread1(void *data EINA_UNUSED, Eina_Thread t EINA_UNUSED)
{
unsigned int i;
- fail_if(!eina_barrier_wait(&b));
+ ck_assert_int_ne(eina_barrier_wait(&b), 0);
- for (i = 0; i < sizeof (test_array) / sizeof (test_array[0]); i++)
+ for (i = 0; i < EINA_C_ARRAY_LENGTH(test_array); i++)
{
- pointers[i] = eina_safepointer_register(&test_array[i]);
- fail_if(pointers[i] == NULL);
- fail_if(pointers[i] == &test_array[i]);
- fail_if(&test_array[i] != eina_safepointer_get(pointers[i]));
+ const void *ptr = pointers[i] = eina_safepointer_register(&test_array[i]);
+ ck_assert_ptr_ne(ptr, NULL);
+ ck_assert_ptr_ne(ptr, &test_array[i]);
+ ck_assert_ptr_eq(&test_array[i], eina_safepointer_get(ptr));
}
return NULL;
@@ -97,92 +95,87 @@ _thread2(void *data EINA_UNUSED, Eina_Thread t EINA_UNUSED)
{
unsigned int i;
- fail_if(!eina_barrier_wait(&b));
+ ck_assert_int_ne(eina_barrier_wait(&b), 0);
- for (i = 0; i < sizeof (test_array2) / sizeof (test_array2[0]); i++)
+ for (i = 0; i < EINA_C_ARRAY_LENGTH(test_array2); i++)
{
- pointers[i + (sizeof (test_array) / sizeof (test_array[0]))] = eina_safepointer_register(&test_array2[i]);
- fail_if(pointers[i + (sizeof (test_array) / sizeof (test_array[0]))] == NULL);
- fail_if(pointers[i + (sizeof (test_array) / sizeof (test_array[0]))] == &test_array2[i]);
- fail_if(&test_array2[i] != eina_safepointer_get(pointers[i + (sizeof (test_array) / sizeof (test_array[0]))]));
- eina_safepointer_unregister(pointers[i + (sizeof (test_array) / sizeof (test_array[0]))]);
+ const void *ptr = pointers[i + (EINA_C_ARRAY_LENGTH(test_array))] = eina_safepointer_register(&test_array2[i]);
+ ck_assert_ptr_ne(ptr, NULL);
+ ck_assert_ptr_ne(ptr, &test_array2[i]);
+ ck_assert_ptr_eq(&test_array2[i], eina_safepointer_get(ptr));
+ eina_safepointer_unregister(ptr);
}
return NULL;
}
-START_TEST(eina_test_threading)
+EFL_START_TEST(eina_test_safepointer_threading)
{
Eina_Thread t1, t2;
unsigned int i;
- eina_init();
// We need a barrier so that both thread are more likely
// to start running in parallel
- fail_if(!eina_barrier_new(&b, 2));
+ ck_assert_int_ne(eina_barrier_new(&b, 2), 0);
// Spawn them
- fail_if(!eina_thread_create(&t1, EINA_THREAD_NORMAL, -1, _thread1, NULL));
- fail_if(!eina_thread_create(&t2, EINA_THREAD_NORMAL, -1, _thread2, NULL));
+ ck_assert_int_ne(eina_thread_create(&t1, EINA_THREAD_NORMAL, -1, _thread1, NULL), 0);
+ ck_assert_int_ne(eina_thread_create(&t2, EINA_THREAD_NORMAL, -1, _thread2, NULL), 0);
// And wait for the outcome !
eina_thread_join(t1);
eina_thread_join(t2);
- for (i = 0; i < sizeof (test_array) / sizeof (test_array[0]); i++)
+ for (i = 0; i < EINA_C_ARRAY_LENGTH(test_array); i++)
{
eina_safepointer_unregister(pointers[i]);
}
eina_barrier_free(&b);
- for (i = 0; i < sizeof (pointers) / sizeof (pointers[0]); i++)
+ for (i = 0; i < EINA_C_ARRAY_LENGTH(pointers); i++)
{
unsigned int j;
- for (j = i + 1; j < sizeof (pointers) / sizeof (pointers[0]); j++)
+ for (j = i + 1; j < EINA_C_ARRAY_LENGTH(pointers); j++)
{
- fail_if(pointers[j] == pointers[i]);
+ ck_assert_ptr_ne(pointers[j], pointers[i]);
}
}
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_lowestbit)
+EFL_START_TEST(eina_test_safepointer_lowestbit)
{
unsigned int i;
- eina_init();
- for (i = 0; i < sizeof (test_array) / sizeof (test_array[0]); i++)
+ for (i = 0; i < EINA_C_ARRAY_LENGTH(test_array); i++)
{
- pointers[i] = eina_safepointer_register(&test_array[i]);
- fail_if(pointers[i] == NULL);
- fail_if(pointers[i] == &test_array[i]);
- fail_if(&test_array[i] != eina_safepointer_get(pointers[i]));
+ const void *ptr = eina_safepointer_register(&test_array[i]);
+ ck_assert_ptr_ne(ptr, NULL);
+ ck_assert_ptr_ne(ptr, &test_array[i]);
+ ck_assert_ptr_eq(&test_array[i], eina_safepointer_get(ptr));
- // We do guaranty that the two lower bit are always zero and will be internally ignored
- fail_if((((uintptr_t) pointers[i]) & 0x3) != 0);
- pointers[i] = (void*)(((uintptr_t) pointers[i]) | 0x3);
+ // We do guarantee that the two lower bit are always zero and will be internally ignored
+ ck_assert_int_eq((((uintptr_t) ptr) & 0x3), 0);
+ ptr = (void*)(((uintptr_t) ptr) | 0x3);
- fail_if(&test_array[i] != eina_safepointer_get(pointers[i]));
+ ck_assert_ptr_eq(&test_array[i], eina_safepointer_get(ptr));
- eina_safepointer_unregister(pointers[i]);
+ eina_safepointer_unregister(ptr);
- fail_if(eina_safepointer_get(pointers[i]) != NULL);
+ ck_assert_ptr_eq(eina_safepointer_get(ptr), NULL);
}
-
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eina_test_safepointer(TCase *tc)
{
- tcase_add_test(tc, eina_test_reusable);
- tcase_add_test(tc, eina_test_threading);
- tcase_add_test(tc, eina_test_lowestbit);
+ tcase_add_test(tc, eina_test_safepointer_reusable);
+ tcase_add_test(tc, eina_test_safepointer_threading);
+ tcase_add_test(tc, eina_test_safepointer_lowestbit);
}
diff --git a/src/tests/eina/eina_test_sched.c b/src/tests/eina/eina_test_sched.c
index 78ce182d8d..c054236e70 100644
--- a/src/tests/eina/eina_test_sched.c
+++ b/src/tests/eina/eina_test_sched.c
@@ -52,14 +52,13 @@ _thread_run(void *arg EINA_UNUSED, Eina_Thread tid EINA_UNUSED)
return NULL;
}
-START_TEST(eina_test_sched_prio_drop)
+EFL_START_TEST(eina_test_sched_prio_drop)
{
int niceval = getpriority(PRIO_PROCESS, 0);
int niceval2;
Eina_Thread tid;
Eina_Bool r;
- eina_init();
r = eina_thread_create(&tid, EINA_THREAD_NORMAL, -1, _thread_run, NULL);
fail_unless(r);
@@ -72,15 +71,14 @@ START_TEST(eina_test_sched_prio_drop)
/* niceness of main thread should not have changed */
ck_assert_int_eq(niceval2, niceval);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
#else
-START_TEST(eina_test_sched_prio_drop)
+EFL_START_TEST(eina_test_sched_prio_drop)
{
fprintf(stderr, "scheduler priority is not supported by your configuration.\n");
}
-END_TEST
+EFL_END_TEST
#endif
void
diff --git a/src/tests/eina/eina_test_simple_xml_parser.c b/src/tests/eina/eina_test_simple_xml_parser.c
index ad4bc8900d..34c8d69002 100644
--- a/src/tests/eina/eina_test_simple_xml_parser.c
+++ b/src/tests/eina/eina_test_simple_xml_parser.c
@@ -49,11 +49,10 @@ static const char *get_file_full_path(const char *filename)
return NULL;
}
-START_TEST(eina_simple_xml_parser_node_dump)
+EFL_START_TEST(eina_simple_xml_parser_node_dump)
{
FILE *f;
- eina_init();
f = fopen(get_file_full_path("sample.gpx"), "rb");
if (f)
{
@@ -86,24 +85,20 @@ START_TEST(eina_simple_xml_parser_node_dump)
fclose(f);
}
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_simple_xml_parser_null_node_dump)
+EFL_START_TEST(eina_simple_xml_parser_null_node_dump)
{
- eina_init();
char *out = eina_simple_xml_node_dump(NULL, " ");
fail_if(out != NULL);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_simple_xml_parser_childs_count)
+EFL_START_TEST(eina_simple_xml_parser_childs_count)
{
- eina_init();
const char *buf = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>\n"
"<test version=\"0.1\"><child>I'm a child.</child><child><![CDATA[I'm a 2-nd child.]]></child><!-- Some comment --></test>";
@@ -114,9 +109,8 @@ START_TEST(eina_simple_xml_parser_childs_count)
fail_if(eina_inlist_count(root->children) != 2);
eina_simple_xml_node_root_free(root);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
enum simple_xml_parser_current_state
{
@@ -221,11 +215,10 @@ eina_simple_xml_parser_parse_with_custom_callback_tag_cb(void *data,
return EINA_TRUE;
}
-START_TEST(eina_simple_xml_parser_parse_with_custom_callback)
+EFL_START_TEST(eina_simple_xml_parser_parse_with_custom_callback)
{
FILE *f;
- eina_init();
f = fopen(get_file_full_path("sample.gpx"), "rb");
if (f)
@@ -261,9 +254,8 @@ START_TEST(eina_simple_xml_parser_parse_with_custom_callback)
fclose(f);
}
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eina_test_simple_xml_parser(TCase *tc)
diff --git a/src/tests/eina/eina_test_slice.c b/src/tests/eina/eina_test_slice.c
index 7cab7cbda7..1c16054d06 100644
--- a/src/tests/eina/eina_test_slice.c
+++ b/src/tests/eina/eina_test_slice.c
@@ -26,7 +26,7 @@
#include "eina_suite.h"
-START_TEST(eina_test_slice_init)
+EFL_START_TEST(eina_test_slice_init)
{
Eina_Rw_Slice a = EINA_SLICE_STR_LITERAL("hello world");
char buf[1024] = "";
@@ -34,7 +34,6 @@ START_TEST(eina_test_slice_init)
Eina_Rw_Slice c = EINA_SLICE_STR("hi there");
EINA_RW_SLICE_DECLARE(d, 512);
- eina_init();
fail_unless(a.len == sizeof("hello world") - 1);
fail_unless(strcmp(a.mem, "hello world") == 0);
@@ -46,11 +45,10 @@ START_TEST(eina_test_slice_init)
fail_unless(d.len == 512);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_slice_ro)
+EFL_START_TEST(eina_test_slice_ro)
{
Eina_Slice slice = EINA_SLICE_STR_LITERAL("hi there");
Eina_Slice a, needle;
@@ -132,9 +130,9 @@ START_TEST(eina_test_slice_ro)
r = eina_slice_endswith(slice, (Eina_Slice)EINA_SLICE_STR_LITERAL(""));
fail_unless(r == EINA_FALSE);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_slice_rw)
+EFL_START_TEST(eina_test_slice_rw)
{
uint8_t buf[] = "hi there";
Eina_Rw_Slice rw_slice = EINA_SLICE_ARRAY(buf);
@@ -230,9 +228,9 @@ START_TEST(eina_test_slice_rw)
r = eina_rw_slice_endswith(rw_slice, (Eina_Slice)EINA_SLICE_STR_LITERAL(""));
fail_unless(r == EINA_FALSE);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_slice_print)
+EFL_START_TEST(eina_test_slice_print)
{
char buf[] = "Hello World";
Eina_Slice slice = {.len = strlen("Hello"), .mem = buf};
@@ -245,9 +243,9 @@ START_TEST(eina_test_slice_print)
snprintf(a, sizeof(a), EINA_SLICE_STR_FMT, EINA_SLICE_STR_PRINT(slice));
fail_unless(strcmp(a, "Hello") == 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_slice_find)
+EFL_START_TEST(eina_test_slice_find)
{
Eina_Slice slice = EINA_SLICE_STR_LITERAL("abcdef");
const char *p;
@@ -298,7 +296,7 @@ START_TEST(eina_test_slice_find)
p = eina_slice_find(slice, (Eina_Slice)EINA_SLICE_STR_LITERAL(""));
fail_unless(p == NULL);
}
-END_TEST
+EFL_END_TEST
void
eina_test_slice(TCase *tc)
diff --git a/src/tests/eina/eina_test_slstr.c b/src/tests/eina/eina_test_slstr.c
index d7778a23bc..fd17cef042 100644
--- a/src/tests/eina/eina_test_slstr.c
+++ b/src/tests/eina/eina_test_slstr.c
@@ -15,18 +15,16 @@ _slstr_copy(void)
return eina_slstr_copy_new(local);
}
-START_TEST(slstr_copy)
+EFL_START_TEST(slstr_copy)
{
Eina_Slstr *str;
- eina_init();
str = _slstr_copy();
ck_assert_str_eq(str, "Hello world 1");
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
static Eina_Slstr *
_slstr_steal(void)
@@ -36,18 +34,16 @@ _slstr_steal(void)
return eina_slstr_copy_new(local);
}
-START_TEST(slstr_steal)
+EFL_START_TEST(slstr_steal)
{
Eina_Slstr *str;
- eina_init();
str = _slstr_steal();
ck_assert_str_eq(str, "Hello world 2");
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
static Eina_Slstr *
_slstr_stringshare(void)
@@ -57,20 +53,18 @@ _slstr_stringshare(void)
return eina_slstr_stringshare_new(str);
}
-START_TEST(slstr_stringshare)
+EFL_START_TEST(slstr_stringshare)
{
Eina_Stringshare *ss;
Eina_Slstr *str;
- eina_init();
str = _slstr_stringshare();
ss = eina_stringshare_add("Hello world 3");
fail_if(ss != str);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
static Eina_Slstr *
_slstr_tmpstr(void)
@@ -80,18 +74,16 @@ _slstr_tmpstr(void)
return eina_slstr_tmpstr_new(str);
}
-START_TEST(slstr_tmpstr)
+EFL_START_TEST(slstr_tmpstr)
{
Eina_Slstr *str;
- eina_init();
str = _slstr_tmpstr();
ck_assert_str_eq(str, "Hello world 4");
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
static Eina_Slstr *
_slstr_strbuf(void)
@@ -105,18 +97,16 @@ _slstr_strbuf(void)
return eina_slstr_strbuf_new(str);
}
-START_TEST(slstr_strbuf)
+EFL_START_TEST(slstr_strbuf)
{
Eina_Slstr *str;
- eina_init();
str = _slstr_strbuf();
ck_assert_str_eq(str, "Hello world 5");
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
static Eina_Slstr *
_slstr_printf(int val)
@@ -124,23 +114,21 @@ _slstr_printf(int val)
return eina_slstr_printf("Hello %s %d", "world", val);
}
-START_TEST(slstr_slstr_printf)
+EFL_START_TEST(slstr_slstr_printf)
{
Eina_Slstr *str;
- eina_init();
str = _slstr_printf(6);
ck_assert_str_eq(str, "Hello world 6");
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
static void
-_many_do(void)
+_many_do(Eina_Bool threaded)
{
- const int many = 2048;
+ const int many = threaded ? 256 : 2048;
Eina_Slstr *str;
int k;
@@ -154,33 +142,30 @@ _many_do(void)
}
}
-START_TEST(slstr_many)
+EFL_START_TEST(slstr_many)
{
- eina_init();
- _many_do();
+ _many_do(0);
eina_slstr_local_clear();
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
static void *
_thread_cb(void *data EINA_UNUSED, Eina_Thread th EINA_UNUSED)
{
- _many_do();
+ _many_do(1);
return NULL;
}
-START_TEST(slstr_thread)
+EFL_START_TEST(slstr_thread)
{
const int threads = 8;
Eina_Thread th[threads];
int k;
- eina_init();
for (k = 0; k < threads; k++)
fail_if(!eina_thread_create(&th[k], EINA_THREAD_NORMAL, -1, _thread_cb, NULL));
@@ -190,9 +175,8 @@ START_TEST(slstr_thread)
eina_slstr_local_clear();
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eina_test_slstr(TCase *tc)
diff --git a/src/tests/eina/eina_test_str.c b/src/tests/eina/eina_test_str.c
index 23c8c6cf87..f92c1f260a 100644
--- a/src/tests/eina/eina_test_str.c
+++ b/src/tests/eina/eina_test_str.c
@@ -26,13 +26,12 @@
#include "eina_suite.h"
-START_TEST(str_simple)
+EFL_START_TEST(str_simple)
{
size_t i;
char *str, *ret;
const char *escape_ret = "\\ a\\\\x\\'";
- eina_init();
fail_if(!eina_str_has_prefix("", ""));
@@ -115,17 +114,15 @@ START_TEST(str_simple)
free(str);
free(ret);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(str_split)
+EFL_START_TEST(str_split)
{
char **result;
unsigned int elements;
char *str;
- eina_init();
result = eina_str_split_full(NULL, ":", 1, &elements);
fail_if(result != NULL);
@@ -248,17 +245,15 @@ START_TEST(str_split)
free(result[0]);
free(result);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(str_lcat_lcpy)
+EFL_START_TEST(str_lcat_lcpy)
{
char dst[9];
size_t ret;
size_t ds = (sizeof(dst) / sizeof(char));
- eina_init();
dst[0] = '\0';
@@ -290,17 +285,15 @@ START_TEST(str_lcat_lcpy)
fail_if(ret != 10);
fail_if(strcmp(dst, "copy2cop") != 0);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(str_join_len)
+EFL_START_TEST(str_join_len)
{
char dst[9];
size_t ret;
size_t ds = (sizeof(dst) / sizeof(char));
- eina_init();
dst[0] = '\0';
@@ -320,11 +313,10 @@ START_TEST(str_join_len)
fail_if(ret != 9);
fail_if(strcmp(dst, "abcd#efg") != 0);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(str_memdup)
+EFL_START_TEST(str_memdup)
{
struct temp {
int i;
@@ -334,7 +326,6 @@ START_TEST(str_memdup)
unsigned char buf[7];
unsigned char *temp_buf;
- eina_init();
t1.i = 1234;
t1.s = "hello";
@@ -351,16 +342,14 @@ START_TEST(str_memdup)
fail_if(strcmp((char *) temp_buf, "aaabbb") != 0);
free(temp_buf);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(str_strftime)
+EFL_START_TEST(str_strftime)
{
time_t curr_time;
struct tm *info;
char *buf;
- eina_init();
curr_time = time(NULL);
info = localtime(&curr_time);
@@ -369,12 +358,11 @@ START_TEST(str_strftime)
fail_if(buf == NULL);
free(buf);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
#ifdef HAVE_ICONV
-START_TEST(str_convert)
+EFL_START_TEST(str_convert)
{
char *utf8 = "\xc3\xa9\xc3\xa1\xc3\xba\xc3\xad\xc3\xa8\xc3\xa0\xc3\xb9\xc3\xac\xc3\xab\xc3\xa4\xc3\xbc\xc3\xaf";
char *utf16 = "\xe9\x0\xe1\x0\xfa\x0\xed\x0\xe8\x0\xe0\x0\xf9\x0\xec\x0\xeb\x0\xe4\x0\xfc\x0\xef\x0";
@@ -382,7 +370,6 @@ START_TEST(str_convert)
size_t ret_sz;
int i;
- eina_init();
ret = eina_str_convert("UTF-8", "UTF-16LE", utf8);
fail_if(ret == NULL);
@@ -398,9 +385,8 @@ START_TEST(str_convert)
fail_if(ret[i] != utf16[i]);
free(ret);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
#endif
void
diff --git a/src/tests/eina/eina_test_strbuf.c b/src/tests/eina/eina_test_strbuf.c
index 85176ccf67..778e8c301f 100644
--- a/src/tests/eina/eina_test_strbuf.c
+++ b/src/tests/eina/eina_test_strbuf.c
@@ -26,16 +26,14 @@
#include "eina_suite.h"
-START_TEST(strbuf_simple)
+EFL_START_TEST(eina_test_strbuf_simple)
{
Eina_Strbuf *buf;
char *txt;
Eina_Slice ro_slice;
Eina_Rw_Slice rw_slice;
#define TEST_TEXT \
- "This test should be so long that it is longer than the initial size of strbuf"
-
- eina_init();
+ "This test should be so long that it is longer than the initial size of strbuf"
buf = eina_strbuf_new();
fail_if(!buf);
@@ -74,19 +72,16 @@ START_TEST(strbuf_simple)
eina_strbuf_free(buf);
- eina_shutdown();
#undef TEST_TEXT
}
-END_TEST
+EFL_END_TEST
-START_TEST(strbuf_manage_simple)
+EFL_START_TEST(eina_test_strbuf_manage_simple)
{
Eina_Strbuf *buf;
char *txt;
#define TEST_TEXT \
- "This test should be so long that it is longer than the initial size of strbuf"
-
- eina_init();
+ "This test should be so long that it is longer than the initial size of strbuf"
txt = strdup(TEST_TEXT);
@@ -126,17 +121,14 @@ START_TEST(strbuf_manage_simple)
fail_if(strcmp(txt, TEST_TEXT TEST_TEXT));
free(txt);
- eina_shutdown();
#undef TEST_TEXT
}
-END_TEST
+EFL_END_TEST
-START_TEST(strbuf_remove)
+EFL_START_TEST(eina_test_strbuf_remove)
{
Eina_Strbuf *buf;
- eina_init();
-
buf = eina_strbuf_new();
fail_if(!buf);
@@ -162,7 +154,7 @@ START_TEST(strbuf_remove)
fail_if(strcmp(eina_strbuf_string_get(buf), ""));
#define TEST_TEXT \
- "This test should be so long that it is longer than the initial size of strbuf"
+ "This test should be so long that it is longer than the initial size of strbuf"
eina_strbuf_append(buf, TEST_TEXT TEST_TEXT);
fail_if(strlen(eina_strbuf_string_get(buf)) != eina_strbuf_length_get(buf));
eina_strbuf_remove(buf, 0, eina_strbuf_length_get(buf) - 1);
@@ -170,20 +162,16 @@ START_TEST(strbuf_remove)
#undef TEST_TEXT
eina_strbuf_free(buf);
-
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(strbuf_append)
+EFL_START_TEST(eina_test_strbuf_append)
{
Eina_Strbuf *buf;
Eina_Slice ro_slice = EINA_SLICE_STR_LITERAL("somethingELSE");
ro_slice.len -= strlen("ELSE");
- eina_init();
-
buf = eina_strbuf_new();
fail_if(!buf);
@@ -223,20 +211,16 @@ START_TEST(strbuf_append)
eina_strbuf_reset(buf);
eina_strbuf_free(buf);
-
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(strbuf_insert)
+EFL_START_TEST(eina_test_strbuf_insert)
{
Eina_Strbuf *buf;
Eina_Slice ro_slice = EINA_SLICE_STR_LITERAL("EINA");
ro_slice.len = 2;
- eina_init();
-
buf = eina_strbuf_new();
fail_if(!buf);
@@ -269,25 +253,21 @@ START_TEST(strbuf_insert)
fail_if(strncmp(eina_strbuf_string_get(buf) + 3, "678", 3));
eina_strbuf_insert_escaped(buf, "089 '\\", 9);
- fail_if(strlen(eina_strbuf_string_get(
- buf)) != eina_strbuf_length_get(buf));
- fail_if(strncmp(eina_strbuf_string_get(buf) + 9,
+ fail_if(strlen(eina_strbuf_string_get(
+ buf)) != eina_strbuf_length_get(buf));
+ fail_if(strncmp(eina_strbuf_string_get(buf) + 9,
"089\\ \\'\\\\",
strlen("089\\ \\'\\\\")));
eina_strbuf_reset(buf);
eina_strbuf_free(buf);
-
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(strbuf_replace)
+EFL_START_TEST(eina_test_strbuf_replace)
{
Eina_Strbuf *buf;
- eina_init();
-
buf = eina_strbuf_new();
fail_if(!buf);
@@ -323,14 +303,11 @@ START_TEST(strbuf_replace)
fail_if(strlen(eina_strbuf_string_get(buf)) != eina_strbuf_length_get(buf));
fail_if(strcmp(eina_strbuf_string_get(buf), "baaaab"));
-
eina_strbuf_free(buf);
-
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(strbuf_realloc)
+EFL_START_TEST(eina_test_strbuf_realloc)
{
Eina_Strbuf *buf;
char pattern[1024 * 16];
@@ -338,11 +315,9 @@ START_TEST(strbuf_realloc)
size_t sz;
for (i = 0; i < sizeof(pattern) - 1; i++)
- pattern[i] = 'a' + (i % 26);
+ pattern[i] = 'a' + (i % 26);
pattern[i] = '\0';
- eina_init();
-
buf = eina_strbuf_new();
fail_if(!buf);
@@ -379,7 +354,6 @@ START_TEST(strbuf_realloc)
1));
sz += sizeof(pattern) - 1;
-
eina_strbuf_remove(buf, 1024, 1024 + 1234);
fail_if(eina_strbuf_length_get(buf) != sz - 1234);
sz -= 1234;
@@ -392,134 +366,121 @@ START_TEST(strbuf_realloc)
fail_if(eina_strbuf_length_get(buf) != sz - 32);
eina_strbuf_free(buf);
-
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(strbuf_append_realloc)
+EFL_START_TEST(eina_test_strbuf_append_realloc)
{
Eina_Strbuf *buf;
- const size_t runs = 40960;
+ const size_t runs = 3 * 10;
const char target_pattern[] = "stringstrsstr";
const char *str;
size_t i, target_pattern_size;
- eina_init();
-
buf = eina_strbuf_new();
- fail_if(!buf);
+ fail_if(!buf);
for (i = 0; i < runs; i++)
{
- fail_if(!eina_strbuf_append(buf, "string"));
- fail_if(!eina_strbuf_append_n(buf, "string", 3));
- fail_if(!eina_strbuf_append_char(buf, 's'));
- fail_if(!eina_strbuf_append_length(buf, "string", 3));
+ ck_assert_int_ne(eina_strbuf_append(buf, "string"), 0); //6
+ ck_assert_int_ne(eina_strbuf_append_n(buf, "string", 3), 0); //3
+ ck_assert_int_ne(eina_strbuf_append_char(buf, 's'), 0); //1
+ ck_assert_int_ne(eina_strbuf_append_length(buf, "string", 3), 0); //3
}
target_pattern_size = strlen(target_pattern);
- fail_if(eina_strbuf_length_get(buf) != (runs * target_pattern_size));
+ ck_assert_int_eq(eina_strbuf_length_get(buf), runs * target_pattern_size);
str = eina_strbuf_string_get(buf);
- fail_if(str == NULL);
+ ck_assert_ptr_ne(str, NULL);
for (i = 0; i < runs; i++, str += target_pattern_size)
- fail_if(memcmp(str, target_pattern, target_pattern_size));
+ ck_assert_int_eq(memcmp(str, target_pattern, target_pattern_size), 0);
- eina_strbuf_free(buf);
-
- eina_shutdown();
+ eina_strbuf_free(buf);
}
-END_TEST
+EFL_END_TEST
-START_TEST(strbuf_prepend_realloc)
+EFL_START_TEST(eina_test_strbuf_prepend_realloc)
{
Eina_Strbuf *buf;
- const size_t runs = 40960;
+ const size_t runs = 3 * 10;
const char target_pattern[] = "strsstrstring";
const char *str;
size_t i, target_pattern_size;
- eina_init();
-
buf = eina_strbuf_new();
- fail_if(!buf);
+ fail_if(!buf);
for (i = 0; i < runs; i++)
{
- fail_if(!eina_strbuf_prepend(buf, "string"));
- fail_if(!eina_strbuf_prepend_n(buf, "string", 3));
- fail_if(!eina_strbuf_prepend_char(buf, 's'));
- fail_if(!eina_strbuf_prepend_length(buf, "string", 3));
+ ck_assert_int_ne(eina_strbuf_prepend(buf, "string"), 0); //6
+ ck_assert_int_ne(eina_strbuf_prepend_n(buf, "string", 3), 0); //3
+ ck_assert_int_ne(eina_strbuf_prepend_char(buf, 's'), 0); //1
+ ck_assert_int_ne(eina_strbuf_prepend_length(buf, "string", 3), 0); //3
}
target_pattern_size = strlen(target_pattern);
- fail_if(eina_strbuf_length_get(buf) != (runs * target_pattern_size));
+ ck_assert_int_eq(eina_strbuf_length_get(buf), runs * target_pattern_size);
str = eina_strbuf_string_get(buf);
- fail_if(str == NULL);
+ ck_assert_ptr_ne(str, NULL);
for (i = 0; i < runs; i++, str += target_pattern_size)
- fail_if(memcmp(str, target_pattern, target_pattern_size));
-
- eina_strbuf_free(buf);
+ ck_assert_int_eq(memcmp(str, target_pattern, target_pattern_size), 0);
- eina_shutdown();
+ eina_strbuf_free(buf);
}
-END_TEST
+EFL_END_TEST
-START_TEST(strbuf_trim)
+EFL_START_TEST(eina_test_strbuf_trim)
{
- Eina_Strbuf* buf;
- const char *str;
-
- eina_init();
- buf = eina_strbuf_new();
- fail_unless(buf != NULL);
-
- eina_strbuf_append(buf, " string ");
- eina_strbuf_trim(buf);
- str = eina_strbuf_string_get(buf);
- fail_if(str == NULL || strcmp(str, "string") != 0);
- eina_strbuf_reset(buf);
-
- eina_strbuf_append(buf, " string ");
- eina_strbuf_ltrim(buf);
- str = eina_strbuf_string_get(buf);
- fail_if(str == NULL || strcmp(str, "string ") != 0);
- eina_strbuf_rtrim(buf);
- str = eina_strbuf_string_get(buf);
- fail_if(str == NULL || strcmp(str, "string") != 0);
- eina_strbuf_reset(buf);
-
- eina_strbuf_append(buf," ");
- eina_strbuf_trim(buf);
- str = eina_strbuf_string_get(buf);
- fail_if(str == NULL || strcmp(str, "") != 0);
- eina_strbuf_reset(buf);
-
- eina_strbuf_append(buf," ");
- eina_strbuf_rtrim(buf);
- str = eina_strbuf_string_get(buf);
- fail_if(str == NULL || strcmp(str, "") != 0);
- eina_strbuf_reset(buf);
-
- eina_strbuf_append(buf, " ");
- eina_strbuf_ltrim(buf);
- str = eina_strbuf_string_get(buf);
- fail_if(str == NULL || strcmp(str, "") != 0);
- eina_strbuf_reset(buf);
-
- eina_strbuf_free(buf);
- eina_shutdown();
+ Eina_Strbuf *buf;
+ const char *str;
+
+ buf = eina_strbuf_new();
+ fail_unless(buf != NULL);
+
+ eina_strbuf_append(buf, " string ");
+ eina_strbuf_trim(buf);
+ str = eina_strbuf_string_get(buf);
+ fail_if(str == NULL || strcmp(str, "string") != 0);
+ eina_strbuf_reset(buf);
+
+ eina_strbuf_append(buf, " string ");
+ eina_strbuf_ltrim(buf);
+ str = eina_strbuf_string_get(buf);
+ fail_if(str == NULL || strcmp(str, "string ") != 0);
+ eina_strbuf_rtrim(buf);
+ str = eina_strbuf_string_get(buf);
+ fail_if(str == NULL || strcmp(str, "string") != 0);
+ eina_strbuf_reset(buf);
+
+ eina_strbuf_append(buf, " ");
+ eina_strbuf_trim(buf);
+ str = eina_strbuf_string_get(buf);
+ fail_if(str == NULL || strcmp(str, "") != 0);
+ eina_strbuf_reset(buf);
+
+ eina_strbuf_append(buf, " ");
+ eina_strbuf_rtrim(buf);
+ str = eina_strbuf_string_get(buf);
+ fail_if(str == NULL || strcmp(str, "") != 0);
+ eina_strbuf_reset(buf);
+
+ eina_strbuf_append(buf, " ");
+ eina_strbuf_ltrim(buf);
+ str = eina_strbuf_string_get(buf);
+ fail_if(str == NULL || strcmp(str, "") != 0);
+ eina_strbuf_reset(buf);
+
+ eina_strbuf_free(buf);
}
-END_TEST
+EFL_END_TEST
-START_TEST(strbuf_tolower)
+EFL_START_TEST(eina_test_strbuf_tolower)
{
- Eina_Strbuf* buf;
+ Eina_Strbuf *buf;
const char *str;
- eina_init();
buf = eina_strbuf_new();
fail_unless(buf != NULL);
@@ -538,17 +499,14 @@ START_TEST(strbuf_tolower)
fail_unless(str || strcmp(str, "upper1@ "));
eina_strbuf_free(buf);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(strbuf_substr_get)
+EFL_START_TEST(eina_test_strbuf_substr_get)
{
- Eina_Strbuf* buf, *substr;
+ Eina_Strbuf *buf, *substr;
const char *str;
- eina_init();
-
buf = eina_strbuf_new();
fail_unless(buf != NULL);
@@ -582,12 +540,10 @@ START_TEST(strbuf_substr_get)
fail_if(substr);
eina_strbuf_free(buf);
-
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-static const char*
+static const char *
test_prepend_vprintf(Eina_Strbuf *buf, char *fmt, va_list ap)
{
const char *str;
@@ -597,7 +553,7 @@ test_prepend_vprintf(Eina_Strbuf *buf, char *fmt, va_list ap)
return str;
}
-static const char*
+static const char *
test_prepend(Eina_Strbuf *buf, ...)
{
const char *str;
@@ -609,13 +565,12 @@ test_prepend(Eina_Strbuf *buf, ...)
return str;
}
-START_TEST(strbuf_prepend_print)
+EFL_START_TEST(eina_test_strbuf_prepend_print)
{
Eina_Bool ret;
- Eina_Strbuf* buf;
+ Eina_Strbuf *buf;
const char *str;
- eina_init();
buf = eina_strbuf_new();
fail_unless(buf != NULL);
@@ -639,12 +594,10 @@ START_TEST(strbuf_prepend_print)
fail_if(str == NULL || strcmp(str, "This is test string") != 0);
eina_strbuf_free(buf);
-
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(strbuf_release_test)
+EFL_START_TEST(eina_test_strbuf_release_test)
{
Eina_Strbuf *buf;
char *string;
@@ -656,9 +609,9 @@ START_TEST(strbuf_release_test)
string = eina_strbuf_release(buf);
ck_assert_str_eq(string, "strbuf_release_test");
}
-END_TEST
+EFL_END_TEST
-START_TEST(strbuf_strftime_test)
+EFL_START_TEST(eina_test_strbuf_strftime_test)
{
Eina_Strbuf *buf;
time_t curr_time;
@@ -687,24 +640,25 @@ START_TEST(strbuf_strftime_test)
eina_strbuf_free(buf);
}
-END_TEST
+EFL_END_TEST
void
eina_test_strbuf(TCase *tc)
{
- tcase_add_test(tc, strbuf_simple);
- tcase_add_test(tc, strbuf_remove);
- tcase_add_test(tc, strbuf_append);
- tcase_add_test(tc, strbuf_insert);
- tcase_add_test(tc, strbuf_replace);
- tcase_add_test(tc, strbuf_realloc);
- tcase_add_test(tc, strbuf_append_realloc);
- tcase_add_test(tc, strbuf_prepend_realloc);
- tcase_add_test(tc, strbuf_manage_simple);
- tcase_add_test(tc, strbuf_trim);
- tcase_add_test(tc, strbuf_tolower);
- tcase_add_test(tc, strbuf_substr_get);
- tcase_add_test(tc, strbuf_prepend_print);
- tcase_add_test(tc, strbuf_release_test);
- tcase_add_test(tc, strbuf_strftime_test);
+ tcase_add_test(tc, eina_test_strbuf_simple);
+ tcase_add_test(tc, eina_test_strbuf_remove);
+ tcase_add_test(tc, eina_test_strbuf_append);
+ tcase_add_test(tc, eina_test_strbuf_insert);
+ tcase_add_test(tc, eina_test_strbuf_replace);
+ tcase_add_test(tc, eina_test_strbuf_realloc);
+ tcase_add_test(tc, eina_test_strbuf_append_realloc);
+ tcase_add_test(tc, eina_test_strbuf_prepend_realloc);
+ tcase_add_test(tc, eina_test_strbuf_manage_simple);
+ tcase_add_test(tc, eina_test_strbuf_trim);
+ tcase_add_test(tc, eina_test_strbuf_tolower);
+ tcase_add_test(tc, eina_test_strbuf_substr_get);
+ tcase_add_test(tc, eina_test_strbuf_prepend_print);
+ tcase_add_test(tc, eina_test_strbuf_release_test);
+ tcase_add_test(tc, eina_test_strbuf_strftime_test);
}
+
diff --git a/src/tests/eina/eina_test_tiler.c b/src/tests/eina/eina_test_tiler.c
index d708a737be..46d1b024a7 100644
--- a/src/tests/eina/eina_test_tiler.c
+++ b/src/tests/eina/eina_test_tiler.c
@@ -53,7 +53,7 @@ check_iterator(Eina_Iterator *it, struct test_rect *cur_test)
fail_if(i == 0);
}
-START_TEST(eina_test_tile_grid_slicer_iterator)
+EFL_START_TEST(eina_test_tile_grid_slicer_iterator)
{
Eina_Iterator *it;
struct test_rect *cur_test;
@@ -87,7 +87,6 @@ START_TEST(eina_test_tile_grid_slicer_iterator)
{1, 2, 0, 0, 128, 1, 0},
{2, 2, 0, 0, 1, 1, 0}};
- eina_init();
cur_test = test1;
it = eina_tile_grid_slicer_iterator_new(200, 210, 10, 15, 128, 128);
@@ -124,11 +123,10 @@ START_TEST(eina_test_tile_grid_slicer_iterator)
check_iterator(it, cur_test);
eina_iterator_free(it);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_tiler_all)
+EFL_START_TEST(eina_test_tiler_all)
{
Eina_Tiler *tl;
Eina_Iterator *it;
@@ -137,7 +135,6 @@ START_TEST(eina_test_tiler_all)
int i = 0;
int width, height;
- eina_init();
tl = eina_tiler_new(1, 1);
@@ -183,11 +180,10 @@ START_TEST(eina_test_tiler_all)
eina_tiler_free(tl);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_tiler_stable)
+EFL_START_TEST(eina_test_tiler_stable)
{
Eina_Tiler *tl;
Eina_Rectangle *rp;
@@ -195,7 +191,6 @@ START_TEST(eina_test_tiler_stable)
Eina_Rectangle r;
int i = 0;
- eina_init();
tl = eina_tiler_new(640, 480);
fail_if(!tl);
@@ -233,18 +228,16 @@ START_TEST(eina_test_tiler_stable)
eina_tiler_free(tl);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_tiler_calculation)
+EFL_START_TEST(eina_test_tiler_calculation)
{
Eina_Tiler *t1, *t2, *t;
Eina_Iterator *itr;
Eina_Rectangle r1, r2, r3, *rp;
int i = 0;
- eina_init();
t1 = eina_tiler_new(500, 500);
fail_if(!t1);
@@ -349,18 +342,16 @@ START_TEST(eina_test_tiler_calculation)
eina_tiler_free(t1);
eina_tiler_free(t2);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_tiler_size)
+EFL_START_TEST(eina_test_tiler_size)
{
Eina_Rectangle *r;
Eina_Iterator *it;
Eina_Tiler *t;
Eina_Bool rects = EINA_FALSE;
- eina_init();
t = eina_tiler_new(131070, 131070);
fail_if(!t);
@@ -379,9 +370,8 @@ START_TEST(eina_test_tiler_size)
fail_if(!rects);
eina_iterator_free(it);
eina_tiler_free(t);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eina_test_tiler(TCase *tc)
diff --git a/src/tests/eina/eina_test_tmpstr.c b/src/tests/eina/eina_test_tmpstr.c
index e341ec62cd..33e7db709f 100644
--- a/src/tests/eina/eina_test_tmpstr.c
+++ b/src/tests/eina/eina_test_tmpstr.c
@@ -25,9 +25,8 @@
#include "eina_suite.h"
-START_TEST(tmpstr_simple)
+EFL_START_TEST(tmpstr_simple)
{
- eina_init();
const int cnt_tmp_strings = 10;
const int max_str_len = 255;
@@ -57,13 +56,11 @@ START_TEST(tmpstr_simple)
// Delete non tmp string (should do nothing)
eina_tmpstr_del("Some non tmp string");
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(tmpstr_simple_len)
+EFL_START_TEST(tmpstr_simple_len)
{
- eina_init();
const int cnt_tmp_strings = 10;
const int max_str_len = 255;
@@ -93,13 +90,11 @@ START_TEST(tmpstr_simple_len)
// Delete non tmp string (should do nothing)
eina_tmpstr_del("Some non tmp string");
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(tmpstr_manage)
+EFL_START_TEST(tmpstr_manage)
{
- eina_init();
char *buf = malloc(7);
strcpy(buf, "tmpstr");
@@ -107,13 +102,11 @@ START_TEST(tmpstr_manage)
fail_if(strcmp(buf, tstr1));
eina_tmpstr_del(tstr1);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(tmpstr_manage_len)
+EFL_START_TEST(tmpstr_manage_len)
{
- eina_init();
char *buf = malloc(10);
strcpy(buf, "tmpstr");
@@ -121,13 +114,11 @@ START_TEST(tmpstr_manage_len)
fail_if(strcmp(buf, tstr1));
eina_tmpstr_del(tstr1);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(tmpstr_len)
+EFL_START_TEST(tmpstr_len)
{
- eina_init();
const char *str1 = "12345";
const char *str2 = "123456789";
@@ -143,9 +134,8 @@ START_TEST(tmpstr_len)
eina_tmpstr_del(tstr1);
eina_tmpstr_del(tstr2);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eina_test_tmpstr(TCase *tc)
diff --git a/src/tests/eina/eina_test_trash.c b/src/tests/eina/eina_test_trash.c
index 92346eb7ba..ce736e2976 100644
--- a/src/tests/eina/eina_test_trash.c
+++ b/src/tests/eina/eina_test_trash.c
@@ -23,7 +23,7 @@
#include "eina_suite.h"
-START_TEST(trash_simple)
+EFL_START_TEST(trash_simple)
{
Eina_Trash *trash;
unsigned int i;
@@ -32,7 +32,6 @@ START_TEST(trash_simple)
int inp_char = inp_int + '0';
void *data;
- eina_init();
trash = calloc(1, sizeof(Eina_Trash));
fail_if(trash == NULL);
@@ -68,9 +67,8 @@ START_TEST(trash_simple)
fail_if(i != 98);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eina_test_trash(TCase *tc)
diff --git a/src/tests/eina/eina_test_ustr.c b/src/tests/eina/eina_test_ustr.c
index 5bf7bbee8f..6c8edcf258 100644
--- a/src/tests/eina/eina_test_ustr.c
+++ b/src/tests/eina/eina_test_ustr.c
@@ -72,9 +72,8 @@ static const Eina_Unicode STR3[] = {'P', 'a', 'n', 't', 's',' ', 'O', 'n', 0};
static const Eina_Unicode STR4[] = {'A', 0};
static const Eina_Unicode EMPTYSTR[] = {0};
-START_TEST(eina_unicode_strcmp_test)
+EFL_START_TEST(eina_unicode_strcmp_test)
{
- eina_init();
/* 1 & 2 */
fail_if(eina_unicode_strcmp(STR1,STR2) == 0);
@@ -97,16 +96,14 @@ START_TEST(eina_unicode_strcmp_test)
fail_if(eina_unicode_strcmp(STR4, STR4) != 0);
fail_if(eina_unicode_strcmp(EMPTYSTR, EMPTYSTR) != 0);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_unicode_strcpy_test)
+EFL_START_TEST(eina_unicode_strcpy_test)
{
Eina_Unicode buf[10] = { 0 };
Eina_Unicode *rv;
- eina_init();
rv = eina_unicode_strcpy(buf,STR1);
fail_if(rv != buf);
@@ -133,16 +130,14 @@ START_TEST(eina_unicode_strcpy_test)
fail_if(buf[0] != 0);
fail_if(buf[1] != '7');
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_unicode_strncpy_test)
+EFL_START_TEST(eina_unicode_strncpy_test)
{
Eina_Unicode buf[10] = { 0 };
Eina_Unicode *rv;
- eina_init();
rv = eina_unicode_strncpy(buf,STR1,9);
fail_if(rv != buf);
@@ -201,16 +196,14 @@ START_TEST(eina_unicode_strncpy_test)
}
#endif
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_ustr_strlen_test)
+EFL_START_TEST(eina_ustr_strlen_test)
{
- eina_init();
fail_if(eina_unicode_strlen(STR1) != 8);
fail_if(eina_unicode_strlen(STR2) != 9);
@@ -242,13 +235,11 @@ START_TEST(eina_ustr_strlen_test)
}
#endif
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_unicode_strnlen_test)
+EFL_START_TEST(eina_unicode_strnlen_test)
{
- eina_init();
/* Strlen style tests*/
fail_if(eina_unicode_strnlen(STR1,10) != 8);
@@ -287,15 +278,13 @@ START_TEST(eina_unicode_strnlen_test)
}
#endif
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_unicode_strdup_test)
+EFL_START_TEST(eina_unicode_strdup_test)
{
Eina_Unicode *buf;
- eina_init();
buf = eina_unicode_strdup(STR1);
fail_if(!buf);
@@ -307,16 +296,14 @@ START_TEST(eina_unicode_strdup_test)
fail_if(!buf);
fail_if(buf[0] != 0);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_unicode_strstr_test)
+EFL_START_TEST(eina_unicode_strstr_test)
{
Eina_Unicode *buf;
Eina_Unicode on[] = { 'O', 'n', 0 };
- eina_init();
buf = eina_unicode_strstr(STR1,on);
fail_if(!buf);
@@ -333,11 +320,10 @@ START_TEST(eina_unicode_strstr_test)
fail_if(!buf);
fail_if(buf != STR1);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_unicode_escape_test)
+EFL_START_TEST(eina_unicode_escape_test)
{
Eina_Unicode str[][10] = {{'P', 'a', ' ', 'O', 'n', 0},
{'P', 'a', ' ', '\\', '\'',0},
@@ -348,7 +334,6 @@ START_TEST(eina_unicode_escape_test)
Eina_Unicode *buf;
size_t i;
- eina_init();
for (i = 0; i < sizeof(str)/sizeof(str[0]); ++i)
{
@@ -359,15 +344,13 @@ START_TEST(eina_unicode_escape_test)
free(buf);
}
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_unicode_utf8)
+EFL_START_TEST(eina_unicode_utf8)
{
int ind;
unsigned char ch;
- eina_init();
/* Valid utf-8 cases */
/* First possible sequence of a certain length */
@@ -574,11 +557,10 @@ START_TEST(eina_unicode_utf8)
fail_if((eina_unicode_utf8_get_prev("\xED\x9F\xBF", &ind) != 0x00) ||
(ind != 0));
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_unicode_utf8_conversion)
+EFL_START_TEST(eina_unicode_utf8_conversion)
{
Eina_Unicode uni_in[] = {0x5D0, 0xFDF6, 0xDC80, 0x1F459, 0x3FFFFFF,
0x7FFFFFFF, 'a', 'b', 'c', 0};
@@ -592,7 +574,6 @@ START_TEST(eina_unicode_utf8_conversion)
char *c_sub_out;
int len;
- eina_init();
uni_out = eina_unicode_utf8_to_unicode(c_in, &len);
fail_if((len != 9) || eina_unicode_strcmp(uni_in, uni_out));
@@ -615,9 +596,8 @@ START_TEST(eina_unicode_utf8_conversion)
ck_assert_int_eq(len, 0);
ck_assert_str_eq("", c_sub_out);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eina_test_ustr(TCase *tc)
diff --git a/src/tests/eina/eina_test_ustringshare.c b/src/tests/eina/eina_test_ustringshare.c
index 8a31cf3144..9e9dd3ab8e 100644
--- a/src/tests/eina/eina_test_ustringshare.c
+++ b/src/tests/eina/eina_test_ustringshare.c
@@ -32,12 +32,11 @@
static const Eina_Unicode TEST0[] = {'t', 'e', 's', 't', '/', '0', 0};
static const Eina_Unicode TEST1[] = {'t', 'e', 's', 't', '/', '1', 0};
-START_TEST(eina_ustringshare_simple)
+EFL_START_TEST(eina_ustringshare_simple)
{
const Eina_Unicode *t0;
const Eina_Unicode *t1;
- eina_init();
t0 = eina_ustringshare_add(TEST0);
t1 = eina_ustringshare_add(TEST1);
@@ -57,17 +56,15 @@ START_TEST(eina_ustringshare_simple)
eina_ustringshare_del(t0);
eina_ustringshare_del(t1);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_ustringshare_test_share)
+EFL_START_TEST(eina_ustringshare_test_share)
{
const Eina_Unicode *t0;
const Eina_Unicode *t1;
- eina_init();
t0 = eina_ustringshare_add(TEST0);
t1 = eina_ustringshare_add(TEST0);
@@ -83,18 +80,16 @@ START_TEST(eina_ustringshare_test_share)
eina_ustringshare_del(t0);
eina_ustringshare_del(t1);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_ustringshare_putstuff)
+EFL_START_TEST(eina_ustringshare_putstuff)
{
const Eina_Unicode *tmp;
int i;
- eina_init();
- for (i = 10000; i > 0; --i)
+ for (i = 100; i > 0; --i)
{
Eina_Unicode string_[] = {'s', 't', 'r', 'i', 'n', 'g', '_', 0};
Eina_Unicode build[64];
@@ -107,9 +102,8 @@ START_TEST(eina_ustringshare_putstuff)
fail_if((int)eina_unicode_strlen(build) != eina_ustringshare_strlen(tmp));
}
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eina_test_ustringshare(TCase *tc)
diff --git a/src/tests/eina/eina_test_value.c b/src/tests/eina/eina_test_value.c
index 15cf35888e..caa47b7cee 100644
--- a/src/tests/eina/eina_test_value.c
+++ b/src/tests/eina/eina_test_value.c
@@ -31,7 +31,7 @@
#define FP_ERR (1)
#define CHECK_FP(a, b) ((a - b) <= FP_ERR)
-START_TEST(eina_value_test_simple)
+EFL_START_TEST(eina_value_test_simple)
{
Eina_Value *value;
char c;
@@ -47,7 +47,6 @@ START_TEST(eina_value_test_simple)
float f;
double d;
- eina_init();
value = eina_value_new(EINA_VALUE_TYPE_CHAR);
fail_unless(value != NULL);
@@ -126,15 +125,13 @@ START_TEST(eina_value_test_simple)
eina_value_flush(value);
eina_value_free(value);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_value_test_compare)
+EFL_START_TEST(eina_value_test_compare)
{
Eina_Value *a, *b;
- eina_init();
a = eina_value_new(EINA_VALUE_TYPE_CHAR);
fail_unless(a != NULL);
@@ -430,16 +427,14 @@ START_TEST(eina_value_test_compare)
eina_value_free(a);
eina_value_free(b);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_value_test_string)
+EFL_START_TEST(eina_value_test_string)
{
Eina_Value *value;
const char *s;
- eina_init();
value = eina_value_new(EINA_VALUE_TYPE_STRING);
fail_unless(value != NULL);
@@ -459,11 +454,10 @@ START_TEST(eina_value_test_string)
ck_assert_str_eq(s, "profusion");
eina_value_free(value);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_value_test_pvariant)
+EFL_START_TEST(eina_value_test_pvariant)
{
Eina_Value *value;
char c, in_c;
@@ -480,7 +474,6 @@ START_TEST(eina_value_test_pvariant)
double d, in_d;
const char *str, *in_str;
- eina_init();
value = eina_value_new(EINA_VALUE_TYPE_CHAR);
fail_unless(value != NULL);
@@ -590,11 +583,10 @@ START_TEST(eina_value_test_pvariant)
ck_assert_str_eq(str, "profusion");
eina_value_free(value);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_value_test_to_string)
+EFL_START_TEST(eina_value_test_to_string)
{
Eina_Value *value;
char c, in_c;
@@ -613,7 +605,6 @@ START_TEST(eina_value_test_to_string)
char *out;
char buf[256];
- eina_init();
value = eina_value_new(EINA_VALUE_TYPE_CHAR);
fail_unless(value != NULL);
@@ -795,11 +786,10 @@ START_TEST(eina_value_test_to_string)
free(out);
eina_value_free(value);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_value_test_to_binbuf)
+EFL_START_TEST(eina_value_test_to_binbuf)
{
Eina_Value *value;
char c, in_c;
@@ -808,7 +798,6 @@ START_TEST(eina_value_test_to_binbuf)
const char *out;
char buf[256];
- eina_init();
value = eina_value_new(EINA_VALUE_TYPE_CHAR);
fail_unless(value != NULL);
@@ -859,11 +848,10 @@ START_TEST(eina_value_test_to_binbuf)
eina_binbuf_free(bin);
eina_value_free(value);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_value_test_convert_char)
+EFL_START_TEST(eina_value_test_convert_char)
{
Eina_Value *value, conv;
char c;
@@ -880,7 +868,6 @@ START_TEST(eina_value_test_convert_char)
double d;
const char *str;
- eina_init();
value = eina_value_new(EINA_VALUE_TYPE_CHAR);
fail_unless(value != NULL);
@@ -990,11 +977,10 @@ START_TEST(eina_value_test_convert_char)
eina_value_flush(&conv);
eina_value_free(value);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_value_test_convert_uchar)
+EFL_START_TEST(eina_value_test_convert_uchar)
{
Eina_Value *value, conv;
char c;
@@ -1011,7 +997,6 @@ START_TEST(eina_value_test_convert_uchar)
double d;
const char *str;
- eina_init();
value = eina_value_new(EINA_VALUE_TYPE_UCHAR);
fail_unless(value != NULL);
@@ -1105,11 +1090,10 @@ START_TEST(eina_value_test_convert_uchar)
eina_value_flush(&conv);
eina_value_free(value);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_value_test_convert_short)
+EFL_START_TEST(eina_value_test_convert_short)
{
Eina_Value *value, conv;
short s;
@@ -1124,7 +1108,6 @@ START_TEST(eina_value_test_convert_short)
double d;
const char *str;
- eina_init();
value = eina_value_new(EINA_VALUE_TYPE_SHORT);
fail_unless(value != NULL);
@@ -1238,11 +1221,10 @@ START_TEST(eina_value_test_convert_short)
eina_value_flush(&conv);
eina_value_free(value);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_value_test_convert_ushort)
+EFL_START_TEST(eina_value_test_convert_ushort)
{
Eina_Value *value, conv;
int i;
@@ -1256,7 +1238,6 @@ START_TEST(eina_value_test_convert_ushort)
double d;
const char *str;
- eina_init();
value = eina_value_new(EINA_VALUE_TYPE_USHORT);
fail_unless(value != NULL);
@@ -1341,11 +1322,10 @@ START_TEST(eina_value_test_convert_ushort)
eina_value_flush(&conv);
eina_value_free(value);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_value_test_convert_int)
+EFL_START_TEST(eina_value_test_convert_int)
{
Eina_Value *value, conv;
int i;
@@ -1358,7 +1338,6 @@ START_TEST(eina_value_test_convert_int)
double d;
const char *str;
- eina_init();
value = eina_value_new(EINA_VALUE_TYPE_INT);
fail_unless(value != NULL);
@@ -1472,11 +1451,10 @@ START_TEST(eina_value_test_convert_int)
eina_value_flush(&conv);
eina_value_free(value);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_value_test_convert_uint)
+EFL_START_TEST(eina_value_test_convert_uint)
{
Eina_Value *value, conv;
unsigned int ui;
@@ -1486,7 +1464,6 @@ START_TEST(eina_value_test_convert_uint)
double d;
const char *str;
- eina_init();
value = eina_value_new(EINA_VALUE_TYPE_UINT);
fail_unless(value != NULL);
@@ -1559,11 +1536,10 @@ START_TEST(eina_value_test_convert_uint)
eina_value_flush(&conv);
eina_value_free(value);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_value_test_convert_long)
+EFL_START_TEST(eina_value_test_convert_long)
{
Eina_Value *value, conv;
char c;
@@ -1580,7 +1556,6 @@ START_TEST(eina_value_test_convert_long)
double d;
const char *str;
- eina_init();
value = eina_value_new(EINA_VALUE_TYPE_LONG);
fail_unless(value != NULL);
@@ -1710,11 +1685,10 @@ START_TEST(eina_value_test_convert_long)
eina_value_flush(&conv);
eina_value_free(value);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_value_test_convert_ulong)
+EFL_START_TEST(eina_value_test_convert_ulong)
{
Eina_Value *value, conv;
char c;
@@ -1731,7 +1705,6 @@ START_TEST(eina_value_test_convert_ulong)
double d;
const char *str;
- eina_init();
value = eina_value_new(EINA_VALUE_TYPE_ULONG);
fail_unless(value != NULL);
@@ -1839,11 +1812,10 @@ START_TEST(eina_value_test_convert_ulong)
eina_value_flush(&conv);
eina_value_free(value);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_value_test_convert_float)
+EFL_START_TEST(eina_value_test_convert_float)
{
Eina_Value *value, conv;
char c;
@@ -1863,7 +1835,6 @@ START_TEST(eina_value_test_convert_float)
float max_float_value = FLT_MAX;
float min_float_value = FLT_MIN;
- eina_init();
value = eina_value_new(EINA_VALUE_TYPE_FLOAT);
fail_unless(value != NULL);
@@ -2013,12 +1984,11 @@ START_TEST(eina_value_test_convert_float)
eina_value_flush(&conv);
eina_value_free(value);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_value_test_array)
+EFL_START_TEST(eina_value_test_array)
{
Eina_Value *value, other;
Eina_Value_Array desc;
@@ -2027,7 +1997,6 @@ START_TEST(eina_value_test_array)
char buf[1024];
char *str;
- eina_init();
value = eina_value_array_new(EINA_VALUE_TYPE_CHAR, 0);
fail_unless(value != NULL);
@@ -2126,11 +2095,10 @@ START_TEST(eina_value_test_array)
fail_unless(c == 31);
eina_value_free(value);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_value_test_list)
+EFL_START_TEST(eina_value_test_list)
{
Eina_Value *value, other;
Eina_Value_List desc;
@@ -2139,7 +2107,6 @@ START_TEST(eina_value_test_list)
char *str;
const char *s;
- eina_init();
value = eina_value_list_new(EINA_VALUE_TYPE_CHAR);
fail_unless(value != NULL);
@@ -2236,11 +2203,10 @@ START_TEST(eina_value_test_list)
ck_assert_str_eq(s, "eina");
eina_value_free(value);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_value_test_hash)
+EFL_START_TEST(eina_value_test_hash)
{
Eina_Value *value, other;
Eina_Value_Hash desc;
@@ -2250,7 +2216,6 @@ START_TEST(eina_value_test_hash)
char *str;
const char *s;
- eina_init();
value = eina_value_hash_new(EINA_VALUE_TYPE_CHAR, 0);
fail_unless(value != NULL);
@@ -2356,12 +2321,11 @@ START_TEST(eina_value_test_hash)
ck_assert_str_eq(s, "y");
eina_value_free(value);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_value_test_timeval)
+EFL_START_TEST(eina_value_test_timeval)
{
Eina_Value *value, other;
struct timeval itv, otv;
@@ -2370,7 +2334,6 @@ START_TEST(eina_value_test_timeval)
char *str;
char buf[64];
- eina_init();
value = eina_value_new(EINA_VALUE_TYPE_TIMEVAL);
fail_unless(value != NULL);
@@ -2440,12 +2403,11 @@ START_TEST(eina_value_test_timeval)
eina_value_free(value);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_value_test_blob)
+EFL_START_TEST(eina_value_test_blob)
{
Eina_Value *value, other;
Eina_Value_Blob in, out;
@@ -2453,7 +2415,6 @@ START_TEST(eina_value_test_blob)
int i = 0x11223344;
char *str;
- eina_init();
value = eina_value_new(EINA_VALUE_TYPE_BLOB);
fail_unless(value != NULL);
@@ -2529,12 +2490,11 @@ START_TEST(eina_value_test_blob)
eina_value_flush(&other);
eina_value_free(value);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_value_test_struct)
+EFL_START_TEST(eina_value_test_struct)
{
struct mybigst {
int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, x;
@@ -2588,7 +2548,6 @@ START_TEST(eina_value_test_struct)
char c;
char *str;
- eina_init();
value = eina_value_struct_new(&myst_desc);
fail_unless(value != NULL);
@@ -2715,12 +2674,11 @@ START_TEST(eina_value_test_struct)
eina_value_flush(&other);
eina_value_free(value);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_value_test_array_of_struct)
+EFL_START_TEST(eina_value_test_array_of_struct)
{
struct myst {
int a, b, c;
@@ -2742,7 +2700,6 @@ START_TEST(eina_value_test_array_of_struct)
char *str;
int i;
- eina_init();
value = eina_value_array_new(EINA_VALUE_TYPE_STRUCT, 0);
fail_unless(value != NULL);
@@ -2792,13 +2749,11 @@ START_TEST(eina_value_test_array_of_struct)
eina_value_flush(&array_item);
eina_value_free(value);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_value_test_optional_int)
+EFL_START_TEST(eina_value_test_optional_int)
{
- eina_init();
/* Eina_Value *value = eina_value_new(EINA_VALUE_TYPE_OPTIONAL); */
/* Eina_Bool is_empty; */
@@ -2832,13 +2787,11 @@ START_TEST(eina_value_test_optional_int)
/* ck_assert_int_eq(expected_value, actual_value); */
/* eina_value_free(value); */
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_value_test_optional_string)
+EFL_START_TEST(eina_value_test_optional_string)
{
- eina_init();
Eina_Value *value = eina_value_new(EINA_VALUE_TYPE_OPTIONAL);
Eina_Bool is_empty;
@@ -2873,13 +2826,11 @@ START_TEST(eina_value_test_optional_string)
ck_assert_str_eq(expected_value, actual_value);
eina_value_free(value);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_value_test_optional_struct_members)
+EFL_START_TEST(eina_value_test_optional_struct_members)
{
- eina_init();
struct s {
int64_t a;
@@ -2933,18 +2884,16 @@ START_TEST(eina_value_test_optional_struct_members)
eina_value_free(value);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_value_test_value)
+EFL_START_TEST(eina_value_test_value)
{
Eina_Value composed, v;
const int ivalue = 3500;
int i;
const char *str;
- eina_init();
fail_if(!eina_value_setup(&composed, EINA_VALUE_TYPE_VALUE));
fail_if(!eina_value_setup(&v, EINA_VALUE_TYPE_INT));
@@ -2967,16 +2916,14 @@ START_TEST(eina_value_test_value)
eina_value_flush(&v);
eina_value_flush(&composed);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_value_test_value_string)
+EFL_START_TEST(eina_value_test_value_string)
{
Eina_Value composed, v, str_v;
const char *msg = "A string", *str;
- eina_init();
fail_if(!eina_value_setup(&composed, EINA_VALUE_TYPE_VALUE));
fail_if(!eina_value_setup(&v, EINA_VALUE_TYPE_STRING));
@@ -3000,9 +2947,8 @@ START_TEST(eina_value_test_value_string)
eina_value_flush(&str_v);
eina_value_flush(&composed);
eina_value_flush(&v);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eina_test_value(TCase *tc)
diff --git a/src/tests/eina/eina_test_vector.c b/src/tests/eina/eina_test_vector.c
index d39f9d20dd..6030dfc528 100644
--- a/src/tests/eina/eina_test_vector.c
+++ b/src/tests/eina/eina_test_vector.c
@@ -28,7 +28,7 @@
#include "eina_suite.h"
-START_TEST(eina_test_vector2_operations)
+EFL_START_TEST(eina_test_vector2_operations)
{
Eina_Vector2 v1;
Eina_Vector2 v2;
@@ -40,7 +40,6 @@ START_TEST(eina_test_vector2_operations)
double res = 0;
const double arr[] = {5, 5};
- eina_init();
eina_vector2_set(&v1, x, y);
fail_if((v1.x != 1) || (v1.y != 2));
@@ -107,11 +106,10 @@ START_TEST(eina_test_vector2_operations)
eina_vector2_homogeneous_direction_transform(&v3, &m3, &v3);
fail_if((v3.x != 24) || (v3.y != 24));
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_vector3_operations)
+EFL_START_TEST(eina_test_vector3_operations)
{
Eina_Vector3 v1;
Eina_Vector3 v2;
@@ -126,7 +124,6 @@ START_TEST(eina_test_vector3_operations)
Eina_Bool res2 = EINA_FALSE;
const double arr[] = {5, 5, 5};
- eina_init();
eina_vector3_set(&v1, x, y, z);
fail_if((v1.x != 1) || (v1.y != 2) || (v1.z != 3));
@@ -238,9 +235,8 @@ START_TEST(eina_test_vector3_operations)
eina_vector3_homogeneous_direction_transform(&v3, &m4, &v3);
fail_if((v3.x != 72) || (v3.y != 72) || (v3.z != 72));
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eina_test_vector(TCase *tc)
diff --git a/src/tests/eina/eina_test_vpath.c b/src/tests/eina/eina_test_vpath.c
new file mode 100644
index 0000000000..b67925ed4a
--- /dev/null
+++ b/src/tests/eina/eina_test_vpath.c
@@ -0,0 +1,42 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <Eina.h>
+#include <check.h>
+#include "eina_suite.h"
+
+EFL_START_TEST(eina_test_vpath_valid)
+{
+ char test[PATH_MAX];
+
+ ck_assert_str_eq(eina_vpath_resolve("/"), "/");
+ ck_assert_str_eq(eina_vpath_resolve("./"), "./");
+ ck_assert_str_eq(eina_vpath_resolve("..bla"), "..bla");
+ ck_assert_str_eq(eina_vpath_resolve(".bla"), ".bla");
+
+ snprintf(test, sizeof(test), "%s/", eina_environment_home_get());
+ ck_assert_str_eq(eina_vpath_resolve("~/"), test);
+
+ snprintf(test, sizeof(test), "%s/bla", eina_environment_home_get());
+ ck_assert_str_eq(eina_vpath_resolve("(:home:)/bla"), test);
+
+}
+EFL_END_TEST
+
+EFL_START_TEST(eina_test_vpath_invalid)
+{
+ ck_assert_ptr_eq(eina_vpath_resolve("(:asdfasdfafasdf"), NULL);
+ ck_assert_ptr_eq(eina_vpath_resolve("(:missing_slash:)"), NULL);
+ ck_assert_ptr_eq(eina_vpath_resolve("(:"), NULL);
+ ck_assert_ptr_eq(eina_vpath_resolve("(:home:)"), NULL);
+ ck_assert_ptr_eq(eina_vpath_resolve("(:wrong_meta_key:)/"), NULL);
+
+}
+EFL_END_TEST
+
+void eina_test_vpath(TCase *tc)
+{
+ tcase_add_test(tc, eina_test_vpath_invalid);
+ tcase_add_test(tc, eina_test_vpath_valid);
+}
diff --git a/src/tests/eina/eina_test_xattr.c b/src/tests/eina/eina_test_xattr.c
index 88b30c1724..c3f8aff842 100644
--- a/src/tests/eina/eina_test_xattr.c
+++ b/src/tests/eina/eina_test_xattr.c
@@ -38,7 +38,7 @@ get_file_path(const char* tmpdirname, const char* filename)
}
#ifdef XATTR_TEST_DIR
-START_TEST(eina_test_xattr_set)
+EFL_START_TEST(eina_test_xattr_set)
{
char *filename = "tmpfile";
char *attribute1 = "user.comment1";
@@ -50,7 +50,6 @@ START_TEST(eina_test_xattr_set)
Eina_Bool ret;
Eina_Tmpstr *test_file_path;
- eina_init();
test_file_path = get_file_path(XATTR_TEST_DIR, filename);
fd = open(test_file_path, O_WRONLY | O_CREAT | O_TRUNC, S_IRWXU | S_IRWXG | S_IRWXO);
@@ -93,11 +92,10 @@ START_TEST(eina_test_xattr_set)
unlink(test_file_path);
eina_tmpstr_del(test_file_path);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_xattr_list)
+EFL_START_TEST(eina_test_xattr_list)
{
char *filename = "tmpfile";
char *filename_cp = "tmpfile_cp";
@@ -121,7 +119,6 @@ START_TEST(eina_test_xattr_list)
Eina_Iterator *it;
Eina_Xattr *xattr;
- eina_init();
test_file_path = get_file_path(XATTR_TEST_DIR, filename);
cp_file_path = get_file_path(XATTR_TEST_DIR, filename_cp);
@@ -243,11 +240,10 @@ START_TEST(eina_test_xattr_list)
unlink(cp_file_path);
eina_tmpstr_del(test_file_path);
eina_tmpstr_del(cp_file_path);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_test_xattr_types)
+EFL_START_TEST(eina_test_xattr_types)
{
char *filename = "tmpfile";
char *str_attr = "user.name", *ret_str;
@@ -260,7 +256,6 @@ START_TEST(eina_test_xattr_types)
Eina_Bool ret;
Eina_Tmpstr *test_file_path;
- eina_init();
test_file_path = get_file_path(XATTR_TEST_DIR, filename);
fd = open(test_file_path, O_WRONLY | O_CREAT | O_TRUNC, S_IRWXU | S_IRWXG | S_IRWXO);
@@ -289,9 +284,8 @@ START_TEST(eina_test_xattr_types)
unlink(test_file_path);
eina_tmpstr_del(test_file_path);
- eina_shutdown();
}
-END_TEST
+EFL_END_TEST
#endif
void
diff --git a/src/tests/eina_cxx/eina_cxx_suite.cc b/src/tests/eina_cxx/eina_cxx_suite.cc
index 6a03f22f81..a1a34eece5 100644
--- a/src/tests/eina_cxx/eina_cxx_suite.cc
+++ b/src/tests/eina_cxx/eina_cxx_suite.cc
@@ -32,7 +32,7 @@ main(int argc, char* argv[])
putenv(const_cast<char*>("EFL_RUN_IN_TREE=1"));
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
- "Eina C++", etc);
+ "Eina C++", etc, NULL, NULL);
return (failed_count == 0) ? 0 : 255;
}
diff --git a/src/tests/eina_cxx/eina_cxx_suite.h b/src/tests/eina_cxx/eina_cxx_suite.h
index 41e9af7f6a..0c6e633858 100644
--- a/src/tests/eina_cxx/eina_cxx_suite.h
+++ b/src/tests/eina_cxx/eina_cxx_suite.h
@@ -5,7 +5,7 @@
#include <algorithm>
#include <check.h>
-
+#include "../efl_check.h"
void eina_test_inlist(TCase* tc);
void eina_test_inarray(TCase* tc);
void eina_test_ptrlist(TCase* tc);
diff --git a/src/tests/eina_cxx/eina_cxx_test_accessor.cc b/src/tests/eina_cxx/eina_cxx_test_accessor.cc
index 864e0743c3..5978345dd8 100644
--- a/src/tests/eina_cxx/eina_cxx_test_accessor.cc
+++ b/src/tests/eina_cxx/eina_cxx_test_accessor.cc
@@ -24,7 +24,7 @@ struct is_eolian_object< ::wrapper> : std::true_type {};
} }
-START_TEST(eina_cxx_accessor_indexing)
+EFL_START_TEST(eina_cxx_accessor_indexing)
{
efl::eina::eina_init eina_init;
@@ -41,9 +41,9 @@ START_TEST(eina_cxx_accessor_indexing)
ck_assert(accessor[2] == 15);
ck_assert(accessor[3] == 20);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_eo_accessor_indexing)
+EFL_START_TEST(eina_cxx_eo_accessor_indexing)
{
efl::eina::eina_init eina_init;
efl::eo::eo_init eo_init;
@@ -67,9 +67,9 @@ START_TEST(eina_cxx_eo_accessor_indexing)
ck_assert(accessor[2] == w3);
ck_assert(accessor[3] == w4);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_accessor_iterator)
+EFL_START_TEST(eina_cxx_accessor_iterator)
{
efl::eina::eina_init eina_init;
@@ -95,9 +95,9 @@ START_TEST(eina_cxx_accessor_iterator)
ck_assert(pos != 3u || *first == 20);
}
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_eo_accessor_iterator)
+EFL_START_TEST(eina_cxx_eo_accessor_iterator)
{
efl::eina::eina_init eina_init;
efl::eo::eo_init eo_init;
@@ -130,9 +130,9 @@ START_TEST(eina_cxx_eo_accessor_iterator)
ck_assert(pos != 3u || *first == w4);
}
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_accessor_relops)
+EFL_START_TEST(eina_cxx_accessor_relops)
{
efl::eina::eina_init eina_init;
@@ -183,7 +183,7 @@ START_TEST(eina_cxx_accessor_relops)
ck_assert(fourth >= first); ck_assert(fourth >= second);
ck_assert(fourth >= third); ck_assert(fourth >= fourth);
}
-END_TEST
+EFL_END_TEST
void
eina_test_accessor(TCase* tc)
diff --git a/src/tests/eina_cxx/eina_cxx_test_error.cc b/src/tests/eina_cxx/eina_cxx_test_error.cc
index c0ba0833d1..7970ab4921 100644
--- a/src/tests/eina_cxx/eina_cxx_test_error.cc
+++ b/src/tests/eina_cxx/eina_cxx_test_error.cc
@@ -8,7 +8,7 @@
Eina_Error my_error, my_error_2;
-START_TEST(eina_cxx_get_error)
+EFL_START_TEST(eina_cxx_get_error)
{
efl::eina::eina_init eina_init;
@@ -33,9 +33,9 @@ START_TEST(eina_cxx_get_error)
ck_assert(ec3.message() == strerror(ENOMEM));
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_throw_on_error)
+EFL_START_TEST(eina_cxx_throw_on_error)
{
efl::eina::eina_init eina_init;
@@ -65,7 +65,7 @@ START_TEST(eina_cxx_throw_on_error)
ck_assert(!efl::eina::get_error_code());
}
}
-END_TEST
+EFL_END_TEST
void
eina_test_error(TCase *tc)
diff --git a/src/tests/eina_cxx/eina_cxx_test_inarray.cc b/src/tests/eina_cxx/eina_cxx_test_inarray.cc
index 2792c19168..57f7c6397e 100644
--- a/src/tests/eina_cxx/eina_cxx_test_inarray.cc
+++ b/src/tests/eina_cxx/eina_cxx_test_inarray.cc
@@ -9,7 +9,7 @@
#include "eina_cxx_suite.h"
-START_TEST(eina_cxx_inarray_pod_push_back)
+EFL_START_TEST(eina_cxx_inarray_pod_push_back)
{
efl::eina::eina_init eina_init;
@@ -28,9 +28,9 @@ START_TEST(eina_cxx_inarray_pod_push_back)
ck_assert(std::equal(array.begin(), array.end(), result));
ck_assert(std::equal(array.rbegin(), array.rend(), rresult));
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_inarray_pod_pop_back)
+EFL_START_TEST(eina_cxx_inarray_pod_pop_back)
{
efl::eina::eina_init eina_init;
@@ -48,9 +48,9 @@ START_TEST(eina_cxx_inarray_pod_pop_back)
ck_assert(std::equal(array.begin(), array.end(), result));
ck_assert(std::equal(array.rbegin(), array.rend(), rresult));
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_inarray_pod_insert)
+EFL_START_TEST(eina_cxx_inarray_pod_insert)
{
efl::eina::eina_init eina_init;
@@ -103,9 +103,9 @@ START_TEST(eina_cxx_inarray_pod_insert)
ck_assert(array4.back() == 1);
ck_assert(std::equal(array.begin(), array.end(), array4.begin()));
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_inarray_pod_constructors)
+EFL_START_TEST(eina_cxx_inarray_pod_constructors)
{
efl::eina::eina_init eina_init;
@@ -123,9 +123,9 @@ START_TEST(eina_cxx_inarray_pod_constructors)
efl::eina::inarray<int> array4(array2.begin(), array2.end());
ck_assert(array2 == array4);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_inarray_pod_erase)
+EFL_START_TEST(eina_cxx_inarray_pod_erase)
{
efl::eina::eina_init eina_init;
@@ -165,7 +165,7 @@ START_TEST(eina_cxx_inarray_pod_erase)
ck_assert(array1.front() == 10);
ck_assert(array1.back() == 25);
}
-END_TEST
+EFL_END_TEST
unsigned int constructors_called = 0u;
unsigned int destructors_called = 0u;
@@ -202,7 +202,7 @@ bool operator==(non_pod lhs, non_pod rhs)
return *lhs.x == *rhs.x;
}
-START_TEST(eina_cxx_inarray_nonpod_push_back)
+EFL_START_TEST(eina_cxx_inarray_nonpod_push_back)
{
efl::eina::eina_init eina_init;
{
@@ -224,9 +224,9 @@ START_TEST(eina_cxx_inarray_nonpod_push_back)
ck_assert(::constructors_called == ::destructors_called);
::constructors_called = ::destructors_called = 0;
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_inarray_nonpod_pop_back)
+EFL_START_TEST(eina_cxx_inarray_nonpod_pop_back)
{
{
efl::eina::eina_init eina_init;
@@ -250,9 +250,9 @@ START_TEST(eina_cxx_inarray_nonpod_pop_back)
ck_assert(::constructors_called == ::destructors_called);
::constructors_called = ::destructors_called = 0;
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_inarray_nonpod_insert)
+EFL_START_TEST(eina_cxx_inarray_nonpod_insert)
{
{
efl::eina::eina_init eina_init;
@@ -311,9 +311,9 @@ START_TEST(eina_cxx_inarray_nonpod_insert)
ck_assert(::constructors_called == ::destructors_called);
::constructors_called = ::destructors_called = 0;
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_inarray_nonpod_constructors)
+EFL_START_TEST(eina_cxx_inarray_nonpod_constructors)
{
{
efl::eina::eina_init eina_init;
@@ -337,9 +337,9 @@ START_TEST(eina_cxx_inarray_nonpod_constructors)
ck_assert(::constructors_called == ::destructors_called);
::constructors_called = ::destructors_called = 0;
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_inarray_nonpod_erase)
+EFL_START_TEST(eina_cxx_inarray_nonpod_erase)
{
{
efl::eina::eina_init eina_init;
@@ -385,9 +385,9 @@ START_TEST(eina_cxx_inarray_nonpod_erase)
ck_assert(::constructors_called == ::destructors_called);
::constructors_called = ::destructors_called = 0;
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_range_inarray)
+EFL_START_TEST(eina_cxx_range_inarray)
{
efl::eina::eina_init eina_init;
@@ -418,9 +418,9 @@ START_TEST(eina_cxx_range_inarray)
ck_assert(range_array[0] == 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_inarray_from_c)
+EFL_START_TEST(eina_cxx_inarray_from_c)
{
efl::eina::eina_init eina_init;
@@ -439,7 +439,7 @@ START_TEST(eina_cxx_inarray_from_c)
ck_assert(eina_inarray_count(c_array) == 3);
efl::eina::inarray<int> array(c_array);
}
-END_TEST
+EFL_END_TEST
void
eina_test_inarray(TCase *tc)
diff --git a/src/tests/eina_cxx/eina_cxx_test_inlist.cc b/src/tests/eina_cxx/eina_cxx_test_inlist.cc
index 717eb0c70f..e941e5339a 100644
--- a/src/tests/eina_cxx/eina_cxx_test_inlist.cc
+++ b/src/tests/eina_cxx/eina_cxx_test_inlist.cc
@@ -14,7 +14,7 @@ struct Eina_Test_Inlist
EINA_INLIST;
};
-START_TEST(eina_cxx_inlist_push_back)
+EFL_START_TEST(eina_cxx_inlist_push_back)
{
efl::eina::eina_init eina_init;
@@ -31,9 +31,9 @@ START_TEST(eina_cxx_inlist_push_back)
ck_assert(std::equal(list.begin(), list.end(), result));
ck_assert(std::equal(list.rbegin(), list.rend(), rresult));
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_inlist_pop_back)
+EFL_START_TEST(eina_cxx_inlist_pop_back)
{
efl::eina::eina_init eina_init;
@@ -51,9 +51,9 @@ START_TEST(eina_cxx_inlist_pop_back)
ck_assert(std::equal(list.begin(), list.end(), result));
ck_assert(std::equal(list.rbegin(), list.rend(), rresult));
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_inlist_push_front)
+EFL_START_TEST(eina_cxx_inlist_push_front)
{
efl::eina::eina_init eina_init;
@@ -70,9 +70,9 @@ START_TEST(eina_cxx_inlist_push_front)
ck_assert(std::equal(list.begin(), list.end(), result));
ck_assert(std::equal(list.rbegin(), list.rend(), rresult));
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_inlist_pop_front)
+EFL_START_TEST(eina_cxx_inlist_pop_front)
{
efl::eina::eina_init eina_init;
@@ -90,9 +90,9 @@ START_TEST(eina_cxx_inlist_pop_front)
ck_assert(std::equal(list.begin(), list.end(), result));
ck_assert(std::equal(list.rbegin(), list.rend(), rresult));
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_inlist_insert)
+EFL_START_TEST(eina_cxx_inlist_insert)
{
efl::eina::eina_init eina_init;
@@ -145,9 +145,9 @@ START_TEST(eina_cxx_inlist_insert)
ck_assert(list4.back() == 1);
ck_assert(std::equal(list.begin(), list.end(), list4.begin()));
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_inlist_constructors)
+EFL_START_TEST(eina_cxx_inlist_constructors)
{
efl::eina::eina_init eina_init;
@@ -165,9 +165,9 @@ START_TEST(eina_cxx_inlist_constructors)
efl::eina::inlist<int> list4(list2.begin(), list2.end());
ck_assert(list2 == list4);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_inlist_erase)
+EFL_START_TEST(eina_cxx_inlist_erase)
{
efl::eina::eina_init eina_init;
@@ -215,9 +215,9 @@ START_TEST(eina_cxx_inlist_erase)
ck_assert(list1.front() == 10);
ck_assert(list1.back() == 25);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_inlist_range)
+EFL_START_TEST(eina_cxx_inlist_range)
{
efl::eina::eina_init eina_init;
@@ -248,9 +248,9 @@ START_TEST(eina_cxx_inlist_range)
ck_assert(*const_range_list.begin() == 0);
ck_assert(*list.begin() == 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_inlist_from_c)
+EFL_START_TEST(eina_cxx_inlist_from_c)
{
efl::eina::eina_init eina_init;
@@ -273,7 +273,7 @@ START_TEST(eina_cxx_inlist_from_c)
while (c_list)
c_list = eina_inlist_remove(c_list, c_list);
}
-END_TEST
+EFL_END_TEST
void
eina_test_inlist(TCase *tc)
diff --git a/src/tests/eina_cxx/eina_cxx_test_iterator.cc b/src/tests/eina_cxx/eina_cxx_test_iterator.cc
index 6cbd98198a..b10d5617fe 100644
--- a/src/tests/eina_cxx/eina_cxx_test_iterator.cc
+++ b/src/tests/eina_cxx/eina_cxx_test_iterator.cc
@@ -10,7 +10,7 @@
#include "eina_cxx_suite.h"
#include "simple.eo.hh"
-START_TEST(eina_cxx_iterator_equal)
+EFL_START_TEST(eina_cxx_iterator_equal)
{
efl::eina::eina_init eina_init;
@@ -30,9 +30,9 @@ START_TEST(eina_cxx_iterator_equal)
ck_assert(std::equal(iterator, last_iterator, result));
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_eo_iterator_equal)
+EFL_START_TEST(eina_cxx_eo_iterator_equal)
{
efl::eina::eina_init eina_init;
efl::eo::eo_init eo_init;
@@ -56,7 +56,7 @@ START_TEST(eina_cxx_eo_iterator_equal)
ck_assert(std::equal(iterator, last_iterator, result));
}
-END_TEST
+EFL_END_TEST
void
eina_test_iterator(TCase *tc)
diff --git a/src/tests/eina_cxx/eina_cxx_test_log.cc b/src/tests/eina_cxx/eina_cxx_test_log.cc
index 6e51780dde..e83074f48c 100644
--- a/src/tests/eina_cxx/eina_cxx_test_log.cc
+++ b/src/tests/eina_cxx/eina_cxx_test_log.cc
@@ -14,7 +14,7 @@ int expensive_call()
return 11;
}
-START_TEST(eina_cxx_level_log)
+EFL_START_TEST(eina_cxx_level_log)
{
efl::eina::eina_init init;
@@ -31,9 +31,9 @@ START_TEST(eina_cxx_level_log)
domain.set_level(efl::eina::log_level::error);
ck_assert(domain.get_level() == ::EINA_LOG_LEVEL_ERR);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_expensive_log)
+EFL_START_TEST(eina_cxx_expensive_log)
{
efl::eina::eina_init init;
@@ -44,9 +44,9 @@ START_TEST(eina_cxx_expensive_log)
EINA_CXX_DOM_LOG_ERR(domain) << "foo " << ::expensive_call();
ck_assert(!expensive_called);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_domain_log)
+EFL_START_TEST(eina_cxx_domain_log)
{
efl::eina::eina_init init;
@@ -64,9 +64,9 @@ START_TEST(eina_cxx_domain_log)
EINA_CXX_LOG_DBG() << "foo " << 5;
EINA_CXX_LOG_WARN() << "foo " << 5;
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_default_domain_log)
+EFL_START_TEST(eina_cxx_default_domain_log)
{
efl::eina::eina_init init;
@@ -76,9 +76,9 @@ START_TEST(eina_cxx_default_domain_log)
EINA_CXX_DOM_LOG_DBG(efl::eina::default_domain) << "foo " << 5;
EINA_CXX_DOM_LOG_WARN(efl::eina::default_domain) << "foo " << 5;
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_global_domain_log)
+EFL_START_TEST(eina_cxx_global_domain_log)
{
efl::eina::eina_init init;
@@ -90,7 +90,7 @@ START_TEST(eina_cxx_global_domain_log)
EINA_CXX_DOM_LOG_DBG(efl::eina::global_domain) << "foo " << 5;
EINA_CXX_DOM_LOG_WARN(efl::eina::global_domain) << "foo " << 5;
}
-END_TEST
+EFL_END_TEST
void
eina_test_log(TCase* tc)
diff --git a/src/tests/eina_cxx/eina_cxx_test_optional.cc b/src/tests/eina_cxx/eina_cxx_test_optional.cc
index 31e9ffe12b..381198c288 100644
--- a/src/tests/eina_cxx/eina_cxx_test_optional.cc
+++ b/src/tests/eina_cxx/eina_cxx_test_optional.cc
@@ -19,7 +19,7 @@ struct nonpod
~nonpod() { nonpod_destructed++; }
};
-START_TEST(eina_cxx_optional_constructors)
+EFL_START_TEST(eina_cxx_optional_constructors)
{
namespace eina = efl::eina;
@@ -56,9 +56,9 @@ START_TEST(eina_cxx_optional_constructors)
<< " nonpod_destructed " << nonpod_destructed << std::endl;
ck_assert(::nonpod_constructed == ::nonpod_destructed);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_optional_rel_ops)
+EFL_START_TEST(eina_cxx_optional_rel_ops)
{
namespace eina = efl::eina;
@@ -87,9 +87,9 @@ START_TEST(eina_cxx_optional_rel_ops)
ck_assert(!(one != one));
ck_assert(!(one != one_again));
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_optional_assignment)
+EFL_START_TEST(eina_cxx_optional_assignment)
{
namespace eina = efl::eina;
@@ -132,9 +132,9 @@ START_TEST(eina_cxx_optional_assignment)
assert(a); assert(!b); assert(c); assert(d);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_optional_convertible_types)
+EFL_START_TEST(eina_cxx_optional_convertible_types)
{
namespace eina = efl::eina;
@@ -184,7 +184,7 @@ START_TEST(eina_cxx_optional_convertible_types)
fail_if(*b != *b_s);
fail_if(*c != *c_s);
}
-END_TEST
+EFL_END_TEST
void
diff --git a/src/tests/eina_cxx/eina_cxx_test_ptrarray.cc b/src/tests/eina_cxx/eina_cxx_test_ptrarray.cc
index f5d24474f1..2cc1d2f85f 100644
--- a/src/tests/eina_cxx/eina_cxx_test_ptrarray.cc
+++ b/src/tests/eina_cxx/eina_cxx_test_ptrarray.cc
@@ -25,7 +25,7 @@ struct is_eolian_object< ::wrapper> : std::true_type {};
} }
-START_TEST(eina_cxx_ptrarray_push_back)
+EFL_START_TEST(eina_cxx_ptrarray_push_back)
{
efl::eina::eina_init eina_init;
efl::eo::eo_init eo_init;
@@ -74,9 +74,9 @@ START_TEST(eina_cxx_ptrarray_push_back)
ck_assert(std::equal(array.rbegin(), array.rend(), rresult_));
}
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_ptrarray_pop_back)
+EFL_START_TEST(eina_cxx_ptrarray_pop_back)
{
efl::eina::eina_init eina_init;
efl::eo::eo_init eo_init;
@@ -128,9 +128,9 @@ START_TEST(eina_cxx_ptrarray_pop_back)
ck_assert(std::equal(array.rbegin(), array.rend(), rresult_));
}
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_ptrarray_insert)
+EFL_START_TEST(eina_cxx_ptrarray_insert)
{
efl::eina::eina_init eina_init;
efl::eo::eo_init eo_init;
@@ -277,9 +277,9 @@ START_TEST(eina_cxx_ptrarray_insert)
ck_assert(std::equal(array.begin(), array.end(), array4.begin()));
}
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_ptrarray_constructors)
+EFL_START_TEST(eina_cxx_ptrarray_constructors)
{
efl::eina::eina_init eina_init;
efl::eo::eo_init eo_init;
@@ -319,9 +319,9 @@ START_TEST(eina_cxx_ptrarray_constructors)
ck_assert(array2 == array4);
}
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_ptrarray_erase)
+EFL_START_TEST(eina_cxx_ptrarray_erase)
{
efl::eina::eina_init eina_init;
efl::eo::eo_init eo_init;
@@ -407,9 +407,9 @@ START_TEST(eina_cxx_ptrarray_erase)
ck_assert(array1.back() == w5);
}
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_ptrarray_range)
+EFL_START_TEST(eina_cxx_ptrarray_range)
{
efl::eina::eina_init eina_init;
efl::eo::eo_init eo_init;
@@ -479,7 +479,7 @@ START_TEST(eina_cxx_ptrarray_range)
// ck_assert(*array.begin() == 0);
}
}
-END_TEST
+EFL_END_TEST
void
eina_test_ptrarray(TCase* tc)
diff --git a/src/tests/eina_cxx/eina_cxx_test_ptrlist.cc b/src/tests/eina_cxx/eina_cxx_test_ptrlist.cc
index 82a1deeec8..9635c0efff 100644
--- a/src/tests/eina_cxx/eina_cxx_test_ptrlist.cc
+++ b/src/tests/eina_cxx/eina_cxx_test_ptrlist.cc
@@ -27,7 +27,7 @@ struct is_eolian_object< ::wrapper> : std::true_type {};
} }
-START_TEST(eina_cxx_ptrlist_push_back)
+EFL_START_TEST(eina_cxx_ptrlist_push_back)
{
efl::eina::eina_init eina_init;
efl::eo::eo_init eo_init;
@@ -74,9 +74,9 @@ START_TEST(eina_cxx_ptrlist_push_back)
ck_assert(std::equal(list.rbegin(), list.rend(), rresult_));
}
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_ptrlist_pop_back)
+EFL_START_TEST(eina_cxx_ptrlist_pop_back)
{
efl::eina::eina_init eina_init;
efl::eo::eo_init eo_init;
@@ -128,9 +128,9 @@ START_TEST(eina_cxx_ptrlist_pop_back)
ck_assert(std::equal(list.rbegin(), list.rend(), rresult_));
}
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_ptrlist_push_front)
+EFL_START_TEST(eina_cxx_ptrlist_push_front)
{
efl::eina::eina_init eina_init;
efl::eo::eo_init eo_init;
@@ -168,9 +168,9 @@ START_TEST(eina_cxx_ptrlist_push_front)
ck_assert(std::equal(list.rbegin(), list.rend(), rresult));
}
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_ptrlist_pop_front)
+EFL_START_TEST(eina_cxx_ptrlist_pop_front)
{
efl::eina::eina_init eina_init;
efl::eo::eo_init eo_init;
@@ -222,9 +222,9 @@ START_TEST(eina_cxx_ptrlist_pop_front)
ck_assert(std::equal(list.rbegin(), list.rend(), rresult_));
}
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_ptrlist_insert)
+EFL_START_TEST(eina_cxx_ptrlist_insert)
{
efl::eina::eina_init eina_init;
efl::eo::eo_init eo_init;
@@ -336,10 +336,10 @@ START_TEST(eina_cxx_ptrlist_insert)
ck_assert(std::equal(list.begin(), list.end(), list4.begin()));
}
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_ptrlist_malloc_clone_allocator)
+EFL_START_TEST(eina_cxx_ptrlist_malloc_clone_allocator)
{
efl::eina::eina_init eina_init;
@@ -349,9 +349,9 @@ START_TEST(eina_cxx_ptrlist_malloc_clone_allocator)
efl::eina::ptr_list<int, efl::eina::malloc_clone_allocator> list2 = list1;
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_ptrlist_constructors)
+EFL_START_TEST(eina_cxx_ptrlist_constructors)
{
efl::eina::eina_init eina_init;
efl::eo::eo_init eo_init;
@@ -399,9 +399,9 @@ START_TEST(eina_cxx_ptrlist_constructors)
ck_assert(list2 == list4);
}
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_ptrlist_erase)
+EFL_START_TEST(eina_cxx_ptrlist_erase)
{
efl::eina::eina_init eina_init;
@@ -449,9 +449,9 @@ START_TEST(eina_cxx_ptrlist_erase)
ck_assert(list1.front() == 10);
ck_assert(list1.back() == 25);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_ptrlist_range)
+EFL_START_TEST(eina_cxx_ptrlist_range)
{
efl::eina::eina_init eina_init;
@@ -482,7 +482,7 @@ START_TEST(eina_cxx_ptrlist_range)
ck_assert(*const_range_list.begin() == 0);
ck_assert(*list.begin() == 0);
}
-END_TEST
+EFL_END_TEST
void
eina_test_ptrlist(TCase* tc)
diff --git a/src/tests/eina_cxx/eina_cxx_test_stringshare.cc b/src/tests/eina_cxx/eina_cxx_test_stringshare.cc
index 11bce25c7f..84de56df26 100644
--- a/src/tests/eina_cxx/eina_cxx_test_stringshare.cc
+++ b/src/tests/eina_cxx/eina_cxx_test_stringshare.cc
@@ -9,7 +9,7 @@
#include "eina_cxx_suite.h"
-START_TEST(eina_cxx_stringshare_constructors)
+EFL_START_TEST(eina_cxx_stringshare_constructors)
{
efl::eina::eina_init eina_init;
@@ -26,9 +26,9 @@ START_TEST(eina_cxx_stringshare_constructors)
efl::eina::stringshare string4(string3.begin(), string3.end());
ck_assert(string2 == string3);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_stringshare_iterators)
+EFL_START_TEST(eina_cxx_stringshare_iterators)
{
efl::eina::eina_init eina_init;
@@ -44,7 +44,7 @@ START_TEST(eina_cxx_stringshare_iterators)
ck_assert(std::equal(string.cbegin(), string.cend(), str));
ck_assert(std::equal(string.crbegin(), string.crend(), rstr));
}
-END_TEST
+EFL_END_TEST
void
eina_test_stringshare(TCase *tc)
diff --git a/src/tests/eina_cxx/eina_cxx_test_thread.cc b/src/tests/eina_cxx/eina_cxx_test_thread.cc
index f464c26667..b9900f0238 100644
--- a/src/tests/eina_cxx/eina_cxx_test_thread.cc
+++ b/src/tests/eina_cxx/eina_cxx_test_thread.cc
@@ -33,7 +33,7 @@ void thread_2_arg(int a0, test t)
ck_assert(t.x == 10);
}
-START_TEST(eina_cxx_thread_constructors)
+EFL_START_TEST(eina_cxx_thread_constructors)
{
efl::eina::eina_init init;
efl::eina::eina_threads_init threads_init;
@@ -61,9 +61,9 @@ START_TEST(eina_cxx_thread_constructors)
ck_assert( ::args_2);
}
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_thread_mutexes)
+EFL_START_TEST(eina_cxx_thread_mutexes)
{
efl::eina::eina_init init;
efl::eina::mutex m;
@@ -87,7 +87,7 @@ START_TEST(eina_cxx_thread_mutexes)
efl::eina::lock_guard<efl::eina::mutex> lock1(m);
}
}
-END_TEST
+EFL_END_TEST
bool b = false;
@@ -99,7 +99,7 @@ void condition_thread(efl::eina::mutex& condition_mutex
condition_condition.notify_one();
}
-START_TEST(eina_cxx_thread_conditional)
+EFL_START_TEST(eina_cxx_thread_conditional)
{
efl::eina::eina_init init;
efl::eina::mutex m;
@@ -119,7 +119,7 @@ START_TEST(eina_cxx_thread_conditional)
thread.join();
}
-END_TEST
+EFL_END_TEST
void
eina_test_thread(TCase* tc)
diff --git a/src/tests/eina_cxx/eina_cxx_test_value.cc b/src/tests/eina_cxx/eina_cxx_test_value.cc
index d4864b6ac0..45f747a42a 100644
--- a/src/tests/eina_cxx/eina_cxx_test_value.cc
+++ b/src/tests/eina_cxx/eina_cxx_test_value.cc
@@ -6,7 +6,7 @@
#include "eina_cxx_suite.h"
-START_TEST(eina_cxx_value_constructors)
+EFL_START_TEST(eina_cxx_value_constructors)
{
efl::eina::eina_init init;
@@ -38,9 +38,9 @@ START_TEST(eina_cxx_value_constructors)
efl::eina::value vdouble(5.0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_value_get)
+EFL_START_TEST(eina_cxx_value_get)
{
efl::eina::eina_init init;
@@ -81,9 +81,9 @@ START_TEST(eina_cxx_value_get)
efl::eina::value vdouble(12.0);
ck_assert(efl::eina::get<double>(vdouble) == 12.0f);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_value_wrong_get)
+EFL_START_TEST(eina_cxx_value_wrong_get)
{
efl::eina::eina_init init;
@@ -98,9 +98,9 @@ START_TEST(eina_cxx_value_wrong_get)
{
}
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_value_comparison_operators)
+EFL_START_TEST(eina_cxx_value_comparison_operators)
{
efl::eina::eina_init init;
@@ -162,9 +162,9 @@ START_TEST(eina_cxx_value_comparison_operators)
ck_assert(vfloat != vdouble);
ck_assert(vdouble != vfloat);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_value_copying)
+EFL_START_TEST(eina_cxx_value_copying)
{
efl::eina::eina_init init;
char c = 5;
@@ -182,14 +182,14 @@ START_TEST(eina_cxx_value_copying)
ck_assert(efl::eina::get<int>(vchar) == 10);
ck_assert(efl::eina::get<int>(vint) == 10);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eina_cxx_value_temporaries)
+EFL_START_TEST(eina_cxx_value_temporaries)
{
efl::eina::eina_init init;
efl::eina::get<std::string>(efl::eina::value(std::string("Matroska")));
}
-END_TEST
+EFL_END_TEST
void
eina_test_value(TCase* tc)
diff --git a/src/tests/eio/eio_model_test_file.c b/src/tests/eio/eio_model_test_file.c
index 81ab19d2c7..4a7ac7d8f7 100644
--- a/src/tests/eio/eio_model_test_file.c
+++ b/src/tests/eio/eio_model_test_file.c
@@ -10,8 +10,7 @@
#include <Efl.h>
#include <stdio.h>
-#include <check.h>
-
+#include "eio_suite.h"
#define EFL_MODEL_TEST_FILENAME_PATH "/tmp"
#define EFL_MODEL_MAX_TEST_CHILDS 16
@@ -44,114 +43,160 @@ static struct reqs_t reqs;
static Ecore_Event_Handler *handler;
static Eina_Bool
- exit_func(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *ev)
- {
- Ecore_Event_Signal_Exit *e;
-
- e = (Ecore_Event_Signal_Exit *)ev;
- if (e->interrupt) fprintf(stdout, "Exit: interrupt\n");
- else if (e->quit) fprintf(stdout, "Exit: quit\n");
- else if (e->terminate) fprintf(stdout, "Exit: terminate\n");
- ecore_main_loop_quit();
- return ECORE_CALLBACK_CANCEL;
- }
+exit_func(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *ev)
+{
+ Ecore_Event_Signal_Exit *e;
+
+ e = (Ecore_Event_Signal_Exit *)ev;
+ if (e->interrupt) fprintf(stdout, "Exit: interrupt\n");
+ else if (e->quit) fprintf(stdout, "Exit: quit\n");
+ else if (e->terminate) fprintf(stdout, "Exit: terminate\n");
+ ecore_main_loop_quit();
+ return ECORE_CALLBACK_CANCEL;
+}
-static void
-promise_then_count(void *data EINA_UNUSED, Efl_Event const *event)
+static Eina_Value
+promise_then_accessor(void *data EINA_UNUSED,
+ const Eina_Value v,
+ const Eina_Future *dead_future EINA_UNUSED)
{
- int *total = ((Efl_Future_Event_Success*)event->info)->value;
- ck_assert_ptr_ne(total, NULL);
- printf("efl_model_loaded count %d\n", *total); fflush(stdout);
+ Eo *child = NULL;
+ unsigned int i, len;
+
+ fail_if(eina_value_type_get(&v) != EINA_VALUE_TYPE_ARRAY);
+
+ EINA_VALUE_ARRAY_FOREACH(&v, len, i, child)
+ ;
+
ecore_main_loop_quit();
+
+ return EINA_VALUE_EMPTY;
}
-static void
-promise_then_accessor(void *data EINA_UNUSED, Efl_Event const* event)
+static Eina_Value
+listing(void *data,
+ const Eina_Value v EINA_UNUSED,
+ const Eina_Future *dead_future EINA_UNUSED)
{
- Eina_Accessor *accessor = ((Efl_Future_Event_Success*)event->info)->value;
- ck_assert_ptr_ne(accessor, NULL);
- printf("efl_model_loaded accessor %p\n", accessor); fflush(stdout);
+ Eina_Future *future;
+ Efl_Model *filemodel = data;
+ static unsigned int it = 0;
+
+ if (it++ >= 3)
+ {
+ fprintf(stderr, "Failed to list any files after 3 attemps.\n");
+ ecore_main_loop_quit();
+ return eina_value_error_init(ECANCELED);
+ }
+
+ if (efl_model_children_count_get(filemodel) == 0)
+ {
+ future = efl_loop_job(efl_provider_find(filemodel, EFL_LOOP_CLASS));
+ future = eina_future_then(future, listing, filemodel);
+ }
+ else
+ {
+ future = efl_model_children_slice_get(filemodel, 0, efl_model_children_count_get(filemodel));
+ future = eina_future_then(future, &promise_then_accessor, NULL);
+ }
+
+ return eina_future_as_value(future);
+}
- Eo* child;
- int i = 0;
- EINA_ACCESSOR_FOREACH(accessor, i, child)
- {
- printf("efl_model_loaded child: %d pointer %p\n", i, child);
- }
+static Eina_Future *listingf = NULL;
- ecore_main_loop_quit();
+static Eina_Value
+clearup(void *data EINA_UNUSED,
+ const Eina_Value v,
+ const Eina_Future *dead_future EINA_UNUSED)
+{
+ listingf = NULL;
+
+ return v;
}
static void
-promise_then_value(void *user EINA_UNUSED, Efl_Event const* event)
+setup_waiter(Efl_Model *model)
{
- Eina_Value* value = ((Efl_Future_Event_Success*)event->info)->value;
- ck_assert_ptr_ne(value, NULL);
- char *str = eina_value_to_string(value);
+ Efl_Loop *loop = efl_provider_find(model, EFL_LOOP_CLASS);
- ck_assert_ptr_ne(str, NULL);
- printf("efl_model_loaded property: %s\n", str);
- free(str);
+ if (listingf) return ;
+ listingf = efl_loop_job(loop);
+ listingf = eina_future_then(listingf, listing, model);
+ listingf = eina_future_then(listingf, clearup, NULL);
+}
- ecore_main_loop_quit();
+static void
+_property_changed(void *data EINA_UNUSED, const Efl_Event *event)
+{
+ // Wait and check is_dir
+ Efl_Model_Property_Event *ev = event->info;
+ Efl_Model *filemodel = event->object;
+ const char *property;
+ Eina_Array_Iterator iterator;
+ unsigned int i;
+
+ EINA_ARRAY_ITER_NEXT(ev->changed_properties, i, property, iterator)
+ if (!strcmp(property, "is_dir"))
+ {
+ if (efl_model_children_count_get(filemodel) > 0)
+ setup_waiter(filemodel);
+ }
}
static void
-error_promise_then(void* data EINA_UNUSED, Efl_Event const* event EINA_UNUSED)
+_child_added(void *data EINA_UNUSED, const Efl_Event *event)
{
- ck_abort_msg(0, "Error Promise cb");
- ecore_main_loop_quit();
+ // Wait for a child being added to setup a job to list the directory
+ Efl_Model *filemodel = event->object;
+
+ if (efl_model_children_count_get(filemodel) > 0)
+ setup_waiter(filemodel);
}
-START_TEST(eio_model_test_test_file)
+EFL_CALLBACKS_ARRAY_DEFINE(model,
+ { EFL_MODEL_EVENT_PROPERTIES_CHANGED, _property_changed },
+ { EFL_MODEL_EVENT_CHILD_ADDED, _child_added })
+
+EFL_START_TEST(eio_model_test_test_file)
{
Eo *filemodel = NULL;
+ Eina_Value *result;
+ char *str;
memset(&reqs, 0, sizeof(struct reqs_t));
- fail_if(!eina_init(), "ERROR: Cannot init Eina!\n");
- fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n");
- fail_if(!efl_object_init(), "ERROR: Cannot init EO!\n");
- fail_if(!eio_init(), "ERROR: Cannot init EIO!\n");
-
- filemodel = efl_add(EIO_MODEL_CLASS, efl_main_loop_get(), eio_model_path_set(efl_added, EFL_MODEL_TEST_FILENAME_PATH));
+ filemodel = efl_add(EIO_MODEL_CLASS, efl_main_loop_get(),
+ eio_model_path_set(efl_added, EFL_MODEL_TEST_FILENAME_PATH));
fail_if(!filemodel, "ERROR: Cannot init model!\n");
handler = ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, exit_func, NULL);
- Efl_Future *future;
+ result = efl_model_property_get(filemodel, "filename");
+ fail_if(!result);
+ str = eina_value_to_string(result);
+ fail_if(!str);
+ free(str);
+ eina_value_free(result);
- future = efl_model_property_get(filemodel, "filename");
- efl_future_then(future, &promise_then_value, &error_promise_then, NULL, NULL);
- ecore_main_loop_begin();
+ result = efl_model_property_get(filemodel, "size");
+ fail_if(!result);
+ eina_value_free(result);
- future = efl_model_property_get(filemodel, "size");
- efl_future_then(future, &promise_then_value, &error_promise_then, NULL, NULL);
- ecore_main_loop_begin();
+ result = efl_model_property_get(filemodel, "mtime");
+ fail_if(!result);
+ eina_value_free(result);
- future = efl_model_property_get(filemodel, "mtime");
- efl_future_then(future, &promise_then_value, &error_promise_then, NULL, NULL);
- ecore_main_loop_begin();
+ efl_event_callback_array_add(filemodel, model(), NULL);
- future = efl_model_children_slice_get(filemodel, 0, 0);
- efl_future_then(future, &promise_then_accessor, &error_promise_then, NULL, NULL);
ecore_main_loop_begin();
- future = efl_model_children_count_get(filemodel);
- efl_future_then(future, &promise_then_count, &error_promise_then, NULL, NULL);
- ecore_main_loop_begin();
-
- efl_unref(filemodel);
-
- eio_shutdown();
- ecore_shutdown();
- eina_shutdown();
+ efl_del(filemodel);
}
-END_TEST
+EFL_END_TEST
void
eio_model_test_file(TCase *tc)
{
tcase_add_test(tc, eio_model_test_test_file);
}
-
diff --git a/src/tests/eio/eio_model_test_monitor_add.c b/src/tests/eio/eio_model_test_monitor_add.c
index e6b14d57b8..392aa31f0f 100644
--- a/src/tests/eio/eio_model_test_monitor_add.c
+++ b/src/tests/eio/eio_model_test_monitor_add.c
@@ -10,134 +10,119 @@
#include <Efl.h>
#include <stdio.h>
-#include <check.h>
+#include "eio_suite.h"
Eina_Tmpstr* temp_filename = NULL;
const char* tmpdir = NULL;
Eina_Bool children_deleted = EINA_FALSE;
-struct _pair
-{
- Eo *parent, *child;
-};
-
-void _children_removed_get_value_cb(void* data EINA_UNUSED, Efl_Event const* event)
-{
- Efl_Future_Event_Success* info = event->info;
- Eina_Value* value = info->value;
- char* filename = eina_value_to_string(value);
- if(temp_filename && strcmp(filename, temp_filename) == 0)
- ecore_main_loop_quit();
- free(filename);
-
- ecore_main_loop_quit();
-}
-
static void
_children_removed_cb(void *data EINA_UNUSED, const Efl_Event* event)
{
- if(children_deleted)
- {
- Efl_Model_Children_Event* evt = event->info;
- Efl_Future* future;
+ Efl_Model_Children_Event* evt = event->info;
+ Eina_Value *path;
+ char *str;
- future = efl_model_property_get(evt->child, "path");
+ fail_if(evt->child == NULL);
+ path = efl_model_property_get(evt->child, "path");
+ fail_if(path == NULL);
+ str = eina_value_to_string(path);
+ fail_if(str == NULL);
- efl_future_then(future, _children_removed_get_value_cb, NULL, NULL, NULL);
- }
-}
+ if (temp_filename && strcmp(str, temp_filename) == 0)
+ ecore_main_loop_quit();
-struct _added_get_value_data
-{
- Eo *object, *child;
-};
-typedef struct _added_get_value_data added_get_value_data;
+ free(str);
+ eina_value_free(path);
+}
-void _children_added_get_value_cb(void* d, Efl_Event const* event)
+static Eina_Value
+_children_get(void *data,
+ const Eina_Value v,
+ const Eina_Future *dead_future EINA_UNUSED)
{
- Efl_Future_Event_Success* info = event->info;
- Eina_Value* value = info->value;
- added_get_value_data* data = d;
+ Efl_Model *filemodel = data;
+ Eo *child = NULL;
+ unsigned int i, len;
- char* filename = eina_value_to_string(value);
+ fail_if(eina_value_type_get(&v) != EINA_VALUE_TYPE_ARRAY);
- if(temp_filename && strcmp(temp_filename, filename) == 0)
+ EINA_VALUE_ARRAY_FOREACH(&v, len, i, child)
{
- children_deleted = EINA_TRUE;
- efl_model_child_del(data->object, data->child);
+ Eina_Value *path;
+ char *str;
+
+ path = efl_model_property_get(child, "path");
+ fail_if(path == NULL);
+ str = eina_value_to_string(path);
+ fail_if(str == NULL);
+
+ if (strcmp(temp_filename, str) == 0)
+ {
+ children_deleted = EINA_TRUE;
+ efl_model_child_del(filemodel, child);
+ }
+ free(str);
+ eina_value_free(path);
}
- free(filename);
+
+ return v;
}
static void
_children_added_cb(void *d EINA_UNUSED, const Efl_Event* event)
{
Efl_Model_Children_Event* evt = event->info;
- Efl_Future* future;
-
- future = efl_model_property_get(evt->child, "path");
-
- added_get_value_data* data = malloc(sizeof(added_get_value_data));
- data->object = event->object;
- data->child = evt->child;
- efl_future_then(future, _children_added_get_value_cb, NULL, NULL, data);
+ Eina_Future *future;
+
+ future = efl_model_children_slice_get(event->object, evt->index, 1);
+ eina_future_then(future, _children_get, event->object);
}
-static void
-_create_file(void *data EINA_UNUSED, Efl_Event const* event EINA_UNUSED)
+static Eina_Value
+_create_file(void *data EINA_UNUSED,
+ const Eina_Value v,
+ const Eina_Future *dead_future EINA_UNUSED)
{
int fd;
+
if((fd = eina_file_mkstemp("prefixXXXXXX.ext", &temp_filename)) > 0)
{
close(fd);
}
-}
-
-static void
-_create_file_error(void *data EINA_UNUSED, Efl_Event const* event EINA_UNUSED)
-{
- ck_abort_msg(0, "Error Promise cb called in Create file");
- ecore_main_loop_quit();
+ return v;
}
-START_TEST(eio_model_test_test_monitor_add)
+EFL_START_TEST(eio_model_test_test_monitor_add)
{
Eo *filemodel = NULL;
-
- fail_if(!eina_init(), "ERROR: Cannot init Eina!\n");
- fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n");
- fail_if(!efl_object_init(), "ERROR: Cannot init EO!\n");
- fail_if(!eio_init(), "ERROR: Cannot init EIO!\n");
+ Eina_Future* future;
tmpdir = eina_environment_tmp_get();
- filemodel = efl_add(EIO_MODEL_CLASS, efl_main_loop_get(), eio_model_path_set(efl_added, tmpdir));
+ filemodel = efl_add(EIO_MODEL_CLASS,
+ efl_main_loop_get(),
+ eio_model_path_set(efl_added, tmpdir));
fail_if(!filemodel, "ERROR: Cannot init model!\n");
efl_event_callback_add(filemodel, EFL_MODEL_EVENT_CHILD_ADDED, &_children_added_cb, filemodel);
efl_event_callback_add(filemodel, EFL_MODEL_EVENT_CHILD_REMOVED, &_children_removed_cb, NULL);
- Efl_Future* future;
- future = efl_model_children_slice_get(filemodel, 0, 0);
+ future = efl_model_children_slice_get(filemodel, 0, efl_model_children_count_get(filemodel));
- efl_future_then(future, &_create_file, &_create_file_error, NULL, NULL);
+ eina_future_then(future, &_create_file, NULL);
ecore_main_loop_begin();
- efl_unref(filemodel);
-
- eio_shutdown();
- ecore_shutdown();
- eina_shutdown();
+ efl_del(filemodel);
fail_if(!children_deleted);
}
-END_TEST
+EFL_END_TEST
void
eio_model_test_monitor_add(TCase *tc)
{
tcase_add_test(tc, eio_model_test_test_monitor_add);
}
-
diff --git a/src/tests/eio/eio_suite.c b/src/tests/eio/eio_suite.c
index b5b63d1ff2..5b59c5c4dc 100644
--- a/src/tests/eio/eio_suite.c
+++ b/src/tests/eio/eio_suite.c
@@ -6,8 +6,19 @@
#include "eio_suite.h"
#include "../efl_check.h"
+#include <Eio.h>
+
+EFL_START_TEST(eio_init_test)
+EFL_END_TEST
+
+static void
+eio_test_init(TCase *tc)
+{
+ tcase_add_test(tc, eio_init_test);
+}
static const Efl_Test_Case etc[] = {
+ {"Eio", eio_test_init},
{"Eio_Monitor", eio_test_monitor},
{"Eio_Sentry", eio_test_sentry},
{"Eio Model", eio_model_test_file},
@@ -23,6 +34,16 @@ static const Efl_Test_Case etc[] = {
{NULL, NULL}
};
+SUITE_INIT(eio)
+{
+ ck_assert_int_eq(eio_init(), 1);
+}
+
+SUITE_SHUTDOWN(eio)
+{
+ ck_assert_int_eq(eio_shutdown(), 0);
+}
+
int
main(int argc, char **argv)
{
@@ -35,10 +56,11 @@ main(int argc, char **argv)
putenv("EFL_RUN_IN_TREE=1");
#endif
+ eio_monitoring_interval_set(0.05);
eina_init();
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
- "Eio", etc);
+ "Eio", etc, SUITE_INIT_FN(eio), SUITE_SHUTDOWN_FN(eio));
eina_shutdown();
diff --git a/src/tests/eio/eio_suite.h b/src/tests/eio/eio_suite.h
index 83f0303f6a..4f66cbc86b 100644
--- a/src/tests/eio/eio_suite.h
+++ b/src/tests/eio/eio_suite.h
@@ -2,7 +2,7 @@
#define _EIO_SUITE_H
#include <check.h>
-
+#include "../efl_check.h"
void eio_test_monitor(TCase *tc);
void eio_test_sentry(TCase *tc);
void eio_model_test_file(TCase *tc);
diff --git a/src/tests/eio/eio_test_eet.c b/src/tests/eio/eio_test_eet.c
index 47f3ff1e99..fbd6441ff1 100644
--- a/src/tests/eio/eio_test_eet.c
+++ b/src/tests/eio/eio_test_eet.c
@@ -65,7 +65,7 @@ _eet_error_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED, Eet_Error e
ecore_main_loop_quit();
}
-START_TEST(eio_test_eet_cipher_decipher)
+EFL_START_TEST(eio_test_eet_cipher_decipher)
{
int ret;
char *data = "This is the data to save in file";
@@ -73,9 +73,7 @@ START_TEST(eio_test_eet_cipher_decipher)
Eio_File *ef;
Eina_Tmpstr *file;
- ecore_init();
eet_init();
- eio_init();
ret = eina_file_mkstemp("eio_eet_example_XXXXXX", &file);
fail_if(ret == -1);
@@ -107,11 +105,9 @@ START_TEST(eio_test_eet_cipher_decipher)
fail_if(!ef);
eina_tmpstr_del(file);
- eio_shutdown();
eet_shutdown();
- ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
typedef struct
{
@@ -159,7 +155,7 @@ _data_read_done_cb(void *data, Eio_File *handler EINA_UNUSED, void *decoded)
ecore_main_loop_quit();
}
-START_TEST(eio_test_eet_data_cipher_decipher)
+EFL_START_TEST(eio_test_eet_data_cipher_decipher)
{
int ret;
const char *key = "This is a secret key";
@@ -167,9 +163,7 @@ START_TEST(eio_test_eet_data_cipher_decipher)
Test_Struct *tc;
Eina_Tmpstr *file;
- ecore_init();
eet_init();
- eio_init();
_test_struct_descriptor_init();
tc = _test_struct_new();
@@ -204,11 +198,9 @@ START_TEST(eio_test_eet_data_cipher_decipher)
fail_if(!ef);
eina_tmpstr_del(file);
- eio_shutdown();
eet_shutdown();
- ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eio_test_eet(TCase *tc)
diff --git a/src/tests/eio/eio_test_file.c b/src/tests/eio/eio_test_file.c
index b9eedefb96..5028215306 100644
--- a/src/tests/eio/eio_test_file.c
+++ b/src/tests/eio/eio_test_file.c
@@ -115,18 +115,11 @@ _open_done_cb(void *data, Eio_File *handler EINA_UNUSED, Eina_File *file)
ecore_main_loop_quit();
}
-START_TEST(eio_file_test_ls)
+EFL_START_TEST(eio_file_test_ls)
{
- int number_of_listed_files = 0, ret;
+ int number_of_listed_files = 0;
const char *new_dir = "new_dir";
- ret = ecore_init();
- fail_if(ret < 1);
- ret = eio_init();
- fail_if(ret < 1);
- ret = eina_init();
- fail_if(ret < 1);
-
Eina_Tmpstr *test_dirname = get_eio_test_file_tmp_dir();
Eina_Tmpstr *nested_dirname = create_test_dirs(test_dirname);
Eina_Tmpstr *nested_filename = get_full_path(test_dirname, files[3]);
@@ -188,24 +181,15 @@ START_TEST(eio_file_test_ls)
eina_tmpstr_del(test_dirname);
eina_tmpstr_del(nested_filename);
eina_tmpstr_del(new_dirname);
- eina_shutdown();
- eio_shutdown();
- ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eio_file_test_file)
+EFL_START_TEST(eio_file_test_file)
{
int number_of_listed_files = 0, ret;
Eina_Bool is_dir;
const char * new_file = "new_file";
- ret = ecore_init();
- fail_if(ret < 1);
- ret = eio_init();
- fail_if(ret < 1);
- ret = eina_init();
- fail_if(ret < 1);
ret = ecore_file_init();
fail_if(ret < 1);
@@ -303,23 +287,14 @@ START_TEST(eio_file_test_file)
eina_tmpstr_del(new_filename);
eina_tmpstr_del(new_dirname);
ecore_file_shutdown();
- eina_shutdown();
- eio_shutdown();
- ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eio_file_test_open)
+EFL_START_TEST(eio_file_test_open)
{
Eina_Bool opened_file;
int ret;
- ret = ecore_init();
- fail_if(ret < 1);
- ret = eio_init();
- fail_if(ret < 1);
- ret = eina_init();
- fail_if(ret < 1);
ret = ecore_file_init();
fail_if(ret < 1);
@@ -340,11 +315,8 @@ START_TEST(eio_file_test_open)
eina_tmpstr_del(test_dirname);
eina_tmpstr_del(nested_filename);
ecore_file_shutdown();
- eina_shutdown();
- eio_shutdown();
- ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eio_test_file(TCase *tc)
diff --git a/src/tests/eio/eio_test_manager.c b/src/tests/eio/eio_test_manager.c
index 2e396c1ad6..0a849adcc8 100644
--- a/src/tests/eio/eio_test_manager.c
+++ b/src/tests/eio/eio_test_manager.c
@@ -19,26 +19,19 @@ static Eina_Bool direct = EINA_FALSE;
#define DONE_CALLED 0xdeadbeef
static void
-_access_cb(void *data, Eina_Accessor *access)
+_access_cb(void *data, Eina_Array *paths)
{
uint64_t *number_of_listed_files = data;
- Eina_Stringshare *s;
- unsigned int count;
- EINA_ACCESSOR_FOREACH(access, count, s)
- {
- (*number_of_listed_files)++;
- }
+ *number_of_listed_files += eina_array_count(paths);
}
static void
-_progress_cb(void *data, const Efl_Event *ev)
+_progress_cb(void *data, Eina_Array *entries)
{
- Efl_Future_Event_Progress *p = ev->info;
- const Eina_Array *batch = p->progress;
uint64_t *number_of_listed_files = data;
- (*number_of_listed_files) += eina_array_count(batch);
+ (*number_of_listed_files) += eina_array_count(entries);
}
static Eina_Value
@@ -71,27 +64,42 @@ _future_cb(void *data,
return file;
}
-static void
-_done_cb(void *data, const Efl_Event *ev)
+static Eina_Value
+_done_cb(void *data,
+ const Eina_Value file,
+ const Eina_Future *dead EINA_UNUSED)
{
- Efl_Future_Event_Success *success = ev->info;
- uint64_t *files_count = success->value;
uint64_t *number_of_listed_files = data;
- fail_if((*number_of_listed_files) != test_count);
- fail_if(*files_count != test_count);
- *number_of_listed_files = DONE_CALLED;
- ecore_main_loop_quit();
-}
+ if (eina_value_type_get(&file) == EINA_VALUE_TYPE_ERROR)
+ {
+ Eina_Error err = 0;
+ const char *msg;
-static void
-_error_cb(void *data EINA_UNUSED, const Efl_Event *ev)
-{
- Efl_Future_Event_Failure *failure = ev->info;
- const char *msg = eina_error_msg_get(failure->error);
+ eina_value_error_get(&file, &err);
+ msg = eina_error_msg_get(err);
+
+ EINA_LOG_ERR("error: %s", msg);
+ abort();
+ }
+ else
+ {
+ Eina_Value convert = EINA_VALUE_EMPTY;
+ uint64_t files_count = 0;
+
+ eina_value_setup(&convert, EINA_VALUE_TYPE_ULONG);
+ eina_value_convert(&file, &convert);
+ eina_value_ulong_get(&convert, &files_count);
+
+ fail_if((*number_of_listed_files) != test_count);
+ fail_if(files_count != test_count);
+
+ *number_of_listed_files = DONE_CALLED;
+ }
- EINA_LOG_ERR("error: %s", msg);
ecore_main_loop_quit();
+
+ return file;
}
static Eina_Value
@@ -152,29 +160,30 @@ _stat_done_cb(void *data,
}
static void
-_test_ls(Efl_Future *(*func)(Eo *obj, const char *path, Eina_Bool recursive),
+_test_ls(Eina_Future *(*func)(const Eo *obj, const char *path, Eina_Bool recursive,
+ void *info_data, EflIoDirectInfo info, Eina_Free_Cb info_free_cb),
uint64_t expected_test_count,
const char* test_dirname)
{
Efl_Io_Manager *job = efl_add(EFL_IO_MANAGER_CLASS, efl_main_loop_get());
- Efl_Future *f = NULL;
+ Eina_Future *f = NULL;
uint64_t main_files = 0;
fail_if(!job);
- f = func(job, test_dirname, EINA_FALSE);
+ f = func(job, test_dirname, EINA_FALSE, &main_files, _progress_cb, NULL);
fail_if(!f);
test_count = expected_test_count;
- efl_future_then(f, &_done_cb, &_error_cb, &_progress_cb, &main_files);
+ eina_future_then(f, &_done_cb, &main_files);
ecore_main_loop_begin();
fail_if(main_files != DONE_CALLED);
main_files = 0;
- f = func(job, test_dirname, EINA_TRUE);
+ f = func(job, test_dirname, EINA_TRUE, &main_files, _progress_cb, NULL);
test_count = expected_test_count + 4;
- efl_future_then(f, &_done_cb, &_error_cb, &_progress_cb, &main_files);
+ eina_future_then(f, &_done_cb, &main_files);
ecore_main_loop_begin();
@@ -183,7 +192,7 @@ _test_ls(Efl_Future *(*func)(Eo *obj, const char *path, Eina_Bool recursive),
efl_del(job);
}
-START_TEST(efl_io_manager_test_stat)
+EFL_START_TEST(efl_io_manager_test_stat)
{
Eina_Tmpstr *test_dirname;
Eina_Tmpstr *nested_dirname;
@@ -193,12 +202,6 @@ START_TEST(efl_io_manager_test_stat)
Eina_Bool is_dir = EINA_TRUE;
int ret;
- ret = ecore_init();
- fail_if(ret < 1);
- ret = eio_init();
- fail_if(ret < 1);
- ret = eina_init();
- fail_if(ret < 1);
ret = ecore_file_init();
fail_if(ret < 1);
@@ -227,13 +230,10 @@ START_TEST(efl_io_manager_test_stat)
eina_tmpstr_del(test_dirname);
eina_tmpstr_del(nested_filename);
ecore_file_shutdown();
- eina_shutdown();
- eio_shutdown();
- ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(efl_io_manager_test_ls)
+EFL_START_TEST(efl_io_manager_test_ls)
{
Eina_Tmpstr *test_dirname;
Eina_Tmpstr *nested_dirname;
@@ -243,12 +243,6 @@ START_TEST(efl_io_manager_test_ls)
uint64_t main_files = 0;
int ret;
- ret = ecore_init();
- fail_if(ret < 1);
- ret = eio_init();
- fail_if(ret < 1);
- ret = eina_init();
- fail_if(ret < 1);
ret = ecore_file_init();
fail_if(ret < 1);
@@ -282,13 +276,10 @@ START_TEST(efl_io_manager_test_ls)
eina_tmpstr_del(test_dirname);
eina_tmpstr_del(nested_filename);
ecore_file_shutdown();
- eina_shutdown();
- eio_shutdown();
- ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(efl_io_manager_test_open)
+EFL_START_TEST(efl_io_manager_test_open)
{
Eina_Tmpstr *test_dirname;
Eina_Tmpstr *nested_dirname;
@@ -298,14 +289,8 @@ START_TEST(efl_io_manager_test_open)
Eina_Bool opened_file = EINA_FALSE;
int ret;
- ret = ecore_init();
- fail_if(ret < 1);
- ret = eina_init();
- fail_if(ret < 1);
ret = ecore_file_init();
fail_if(ret < 1);
- ret = eio_init();
- fail_if(ret < 1);
test_dirname = get_eio_test_file_tmp_dir();
nested_dirname = create_test_dirs(test_dirname);
@@ -326,33 +311,26 @@ START_TEST(efl_io_manager_test_open)
eina_tmpstr_del(nested_dirname);
eina_tmpstr_del(test_dirname);
- eio_shutdown();
eina_tmpstr_del(nested_filename);
ecore_file_shutdown();
- eina_shutdown();
- ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(efl_io_instantiated)
+EFL_START_TEST(efl_io_test_instantiated)
{
Efl_Io_Manager *manager;
+ ck_assert_int_eq(eio_shutdown(), 0);
ecore_init();
-
fail_if(efl_provider_find(efl_main_loop_get(), EFL_IO_MANAGER_CLASS) != NULL);
-
- eio_init();
+ ecore_shutdown();
+ ck_assert_int_eq(eio_init(), 1);
manager = efl_provider_find(efl_main_loop_get(), EFL_IO_MANAGER_CLASS);
fail_if(manager == NULL);
fail_if(!efl_isa(manager, EFL_IO_MANAGER_CLASS));
-
- eio_shutdown();
-
- ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eio_test_job(TCase *tc)
@@ -360,5 +338,5 @@ eio_test_job(TCase *tc)
tcase_add_test(tc, efl_io_manager_test_ls);
tcase_add_test(tc, efl_io_manager_test_stat);
tcase_add_test(tc, efl_io_manager_test_open);
- tcase_add_test(tc, efl_io_instantiated);
+ tcase_add_test(tc, efl_io_test_instantiated);
}
diff --git a/src/tests/eio/eio_test_manager_xattr.c b/src/tests/eio/eio_test_manager_xattr.c
index 136ae4dc16..2d88548239 100644
--- a/src/tests/eio/eio_test_manager_xattr.c
+++ b/src/tests/eio/eio_test_manager_xattr.c
@@ -36,13 +36,14 @@ static const char *attr_data[] =
int total_attributes = sizeof(attribute)/sizeof(attribute[0]);
static void
-_main_cb(void *data, Eina_Accessor *access)
+_main_cb(void *data, Eina_Array *array)
{
const char* attr;
int *num_of_attr = (int *)data;
- unsigned int count;
+ Eina_Array_Iterator iterator;
+ unsigned int j;
- EINA_ACCESSOR_FOREACH(access, count, attr)
+ EINA_ARRAY_ITER_NEXT(array, j, attr, iterator)
{
unsigned int i;
@@ -73,7 +74,7 @@ _future_done_cb(void *data EINA_UNUSED,
fprintf(stderr, "Something has gone wrong: %s\n", eina_error_msg_get(err));
abort();
}
- EINA_VALUE_ARRAY_FOREACH(&array, len, i, &v)
+ EINA_VALUE_ARRAY_FOREACH(&array, len, i, v)
{
buf = eina_value_to_binbuf(&v);
fail_if(!buf);
@@ -103,7 +104,7 @@ _future_all_cb(void *data,
fprintf(stderr, "Something has gone wrong: %s\n", eina_error_msg_get(err));
abort();
}
- EINA_VALUE_ARRAY_FOREACH(&array, len, i, &v)
+ EINA_VALUE_ARRAY_FOREACH(&array, len, i, v)
{
if (v.type == EINA_VALUE_TYPE_ERROR)
{
@@ -117,7 +118,7 @@ _future_all_cb(void *data,
return array;
}
-START_TEST(eio_test_job_xattr_set)
+EFL_START_TEST(eio_test_job_xattr_set)
{
char *filename = "eio-tmpfile";
Eina_Tmpstr *test_file_path;
@@ -126,10 +127,6 @@ START_TEST(eio_test_job_xattr_set)
Eo *job;
Eina_Future **futures = NULL;
- ecore_init();
- eina_init();
- eio_init();
-
job = efl_add(EFL_IO_MANAGER_CLASS, efl_main_loop_get());
test_file_path = get_full_path(XATTR_TEST_DIR, filename);
@@ -160,7 +157,7 @@ START_TEST(eio_test_job_xattr_set)
num_of_attr = 0;
- futures = calloc(total_attributes + 1, sizeof(Efl_Future*));
+ futures = calloc(total_attributes + 1, sizeof(Eina_Future*));
futures[total_attributes] = NULL;
for (i = 0; i < sizeof(attribute) / sizeof(attribute[0]); ++i)
@@ -188,11 +185,8 @@ START_TEST(eio_test_job_xattr_set)
close(fd);
unlink(test_file_path);
eina_tmpstr_del(test_file_path);
- eio_shutdown();
- eina_shutdown();
- ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
void eio_test_job_xattr(TCase *tc)
{
diff --git a/src/tests/eio/eio_test_map.c b/src/tests/eio/eio_test_map.c
index 7dbd50d5f4..abfb80f23a 100644
--- a/src/tests/eio/eio_test_map.c
+++ b/src/tests/eio/eio_test_map.c
@@ -53,7 +53,7 @@ _error_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED, int error)
ecore_main_loop_quit();
}
-START_TEST(eio_test_map_simple)
+EFL_START_TEST(eio_test_map_simple)
{
int fd;
const char *file = "eio_map_exampleXXXXXX.txt";
@@ -61,10 +61,6 @@ START_TEST(eio_test_map_simple)
Eio_File *ef;
Eina_Tmpstr *file_path;
- ecore_init();
- eina_init();
- eio_init();
-
fd = eina_file_mkstemp(file, &file_path);
fail_if(fd < 0);
fail_if(write(fd, data, strlen(data)) != (ssize_t)strlen(data));
@@ -89,11 +85,8 @@ START_TEST(eio_test_map_simple)
fail_if(!ef);
eina_tmpstr_del(file_path);
- eio_shutdown();
- eina_shutdown();
- ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eio_test_map(TCase *tc)
diff --git a/src/tests/eio/eio_test_monitor.c b/src/tests/eio/eio_test_monitor.c
index b05824165c..c1eb002b89 100644
--- a/src/tests/eio/eio_test_monitor.c
+++ b/src/tests/eio/eio_test_monitor.c
@@ -14,8 +14,8 @@
/////////////////timeout function
-#define TEST_TIMEOUT_SEC 10
-#define TEST_OPERATION_DELAY 0.5
+#define TEST_TIMEOUT_SEC 0.5
+#define TEST_OPERATION_DELAY 0.05
static Ecore_Timer *test_timeout_timer;
@@ -106,14 +106,16 @@ static Eina_Bool _modify_attrib_file(void *data)
static Eina_Bool _check_event_path(void *data, void *event)
{
- ck_assert_str_eq((const char*)data, ((Eio_Monitor_Event*)event)->filename);
+ const char *f = ((Eio_Monitor_Event*)event)->filename;
+ /* ignore directory creation events */
+ if (ecore_file_is_dir(f)) return ECORE_CALLBACK_RENEW;
+ ck_assert_str_eq((const char*)data, f);
return EINA_TRUE;
}
static Eina_Tmpstr *_common_init()
{
Eina_Tmpstr *dirname;
- fail_if(eio_init() != 1);
ecore_file_init();
//test timeout
@@ -127,36 +129,31 @@ static void _common_shutdown(Eina_Tmpstr *dirname)
{
_delete_directory((void*)dirname);
ecore_file_shutdown();
- fail_if(eio_shutdown() != 0);
eina_tmpstr_del(dirname);
+ _cancel_timeout();
}
/////// tests monitoring a directory
-START_TEST(eio_test_monitor_add_and_remove)
+EFL_START_TEST(eio_test_monitor_add_and_remove)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
Eio_Monitor *monitor;
- filename = eina_stringshare_printf("%s/eio_test_monitor_directory_file_created_notify", dirname);
+ filename = eina_stringshare_printf("%s/eio_test_monitor_add_and_remove", dirname);
_create_directory((void*)filename);
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
-
//monitor directory
monitor = eio_monitor_add(filename);
- usleep(500000);
-
eio_monitor_del(monitor);
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eio_test_monitor_add_remove_add)
+EFL_START_TEST(eio_test_monitor_add_remove_add)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
@@ -166,23 +163,18 @@ START_TEST(eio_test_monitor_add_remove_add)
filename = eina_stringshare_printf("%s/eio_test_monitor_add_remove_add", dirname);
_create_directory((void*)filename);
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
-
//monitor directory
monitor1 = eio_monitor_add(filename);
eio_monitor_del(monitor1);
- usleep(500000);
-
monitor2 = eio_monitor_add(filename);
eio_monitor_del(monitor2);
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eio_test_monitor_add_add_remove_remove)
+EFL_START_TEST(eio_test_monitor_add_add_remove_remove)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename1;
@@ -195,19 +187,16 @@ START_TEST(eio_test_monitor_add_add_remove_remove)
_create_directory((void*)filename1);
_create_directory((void*)filename2);
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
-
//monitor directory
monitor1 = eio_monitor_add(filename1);
monitor2 = eio_monitor_add(filename2);
- usleep(500000);
+
eio_monitor_del(monitor2);
eio_monitor_del(monitor1);
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
static void _file_created_cb(void *data, int type, void *event)
{
@@ -220,16 +209,13 @@ static void _file_created_cb(void *data, int type, void *event)
}
-START_TEST(eio_test_monitor_directory_file_created_notify)
+EFL_START_TEST(eio_test_monitor_directory_file_created_notify)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
filename = eina_stringshare_printf("%s/eio_test_monitor_directory_file_created_notify", dirname);
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
-
//monitor directory
eio_monitor_add(dirname);
ecore_event_handler_add(EIO_MONITOR_FILE_CREATED, (Ecore_Event_Handler_Cb)_file_created_cb, filename);
@@ -240,7 +226,7 @@ START_TEST(eio_test_monitor_directory_file_created_notify)
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
struct {
Eina_Stringshare *s;
@@ -276,7 +262,7 @@ _multi_file_created_cb(void *data EINA_UNUSED, int type, void *event)
ecore_main_loop_quit();
}
-START_TEST(eio_test_monitor_directory_multi_file_created_notify)
+EFL_START_TEST(eio_test_monitor_directory_multi_file_created_notify)
{
Eina_Tmpstr *dirname = _common_init();
@@ -284,9 +270,6 @@ START_TEST(eio_test_monitor_directory_multi_file_created_notify)
multi_files[1].s = eina_stringshare_printf("%s/eio_test_monitor_directory_m2file_created_notify", dirname);
multi_files[2].s = eina_stringshare_printf("%s/eio_test_monitor_directory_m3file_created_notify", dirname);
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
-
//monitor directory
eio_monitor_add(dirname);
ecore_event_handler_add(EIO_MONITOR_FILE_CREATED, (Ecore_Event_Handler_Cb)_multi_file_created_cb, NULL);
@@ -299,7 +282,7 @@ START_TEST(eio_test_monitor_directory_multi_file_created_notify)
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
static void _file_deleted_cb(void *data, int type, void *event)
{
@@ -311,7 +294,7 @@ static void _file_deleted_cb(void *data, int type, void *event)
}
}
-START_TEST(eio_test_monitor_directory_file_deleted_notify)
+EFL_START_TEST(eio_test_monitor_directory_file_deleted_notify)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
@@ -319,9 +302,6 @@ START_TEST(eio_test_monitor_directory_file_deleted_notify)
filename = eina_stringshare_printf("%s/eio_test_monitor_directory_file_deleted_notify", dirname);
_create_file((void*)filename);
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
-
//monitor directory
eio_monitor_add(dirname);
ecore_event_handler_add(EIO_MONITOR_FILE_DELETED, (Ecore_Event_Handler_Cb)_file_deleted_cb, filename);
@@ -332,7 +312,7 @@ START_TEST(eio_test_monitor_directory_file_deleted_notify)
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
static void _file_modified_cb(void *data, int type, void *event)
{
@@ -344,7 +324,7 @@ static void _file_modified_cb(void *data, int type, void *event)
}
}
-START_TEST(eio_test_monitor_directory_file_modified_notify)
+EFL_START_TEST(eio_test_monitor_directory_file_modified_notify)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
@@ -352,9 +332,6 @@ START_TEST(eio_test_monitor_directory_file_modified_notify)
filename = eina_stringshare_printf("%s/eio_test_monitor_directory_file_modified_notify", dirname);
_create_file((void*)filename);
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
-
//monitor directory
eio_monitor_add(dirname);
ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED, (Ecore_Event_Handler_Cb)_file_modified_cb, filename);
@@ -366,7 +343,7 @@ START_TEST(eio_test_monitor_directory_file_modified_notify)
//cleanup
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
static void _file_closed_cb(void *data, int type, void *event)
{
@@ -378,27 +355,30 @@ static void _file_closed_cb(void *data, int type, void *event)
}
}
-START_TEST(eio_test_monitor_directory_file_closed_notify)
+EFL_START_TEST(eio_test_monitor_directory_file_closed_notify)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
+ Eio_Monitor *monitor;
filename = eina_stringshare_printf("%s/eio_test_monitor_directory_file_closed_notify", dirname);
_create_file((void*)filename);
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
-
//monitor directory
- eio_monitor_add(dirname);
- ecore_event_handler_add(EIO_MONITOR_FILE_CLOSED, (Ecore_Event_Handler_Cb)_file_closed_cb, filename);
- ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename);
+ monitor = eio_monitor_add(dirname);
+ if (eio_monitor_fallback_check(monitor))
+ printf("skipping %s: using fallback monitoring\n", "eio_test_monitor_directory_file_closed_notify");
+ else
+ {
+ ecore_event_handler_add(EIO_MONITOR_FILE_CLOSED, (Ecore_Event_Handler_Cb)_file_closed_cb, filename);
+ ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename);
- ecore_main_loop_begin();
+ ecore_main_loop_begin();
+ }
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
static void _directory_created_cb(void *data, int type, void *event)
{
@@ -410,16 +390,13 @@ static void _directory_created_cb(void *data, int type, void *event)
}
}
-START_TEST(eio_test_monitor_directory_directory_created_notify)
+EFL_START_TEST(eio_test_monitor_directory_directory_created_notify)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
filename = eina_stringshare_printf("%s/eio_test_monitor_directory_directory_created_notify", dirname);
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
-
//monitor directory
eio_monitor_add(dirname);
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_CREATED, (Ecore_Event_Handler_Cb)_directory_created_cb, filename);
@@ -430,7 +407,7 @@ START_TEST(eio_test_monitor_directory_directory_created_notify)
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
static void _directory_deleted_cb(void *data, int type, void *event)
{
@@ -442,7 +419,7 @@ static void _directory_deleted_cb(void *data, int type, void *event)
}
}
-START_TEST(eio_test_monitor_directory_directory_deleted_notify)
+EFL_START_TEST(eio_test_monitor_directory_directory_deleted_notify)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
@@ -450,9 +427,6 @@ START_TEST(eio_test_monitor_directory_directory_deleted_notify)
filename = eina_stringshare_printf("%s/eio_test_monitor_directory_directory_deleted_notify", dirname);
_create_directory((void*)filename);
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
-
//monitor directory
eio_monitor_add(dirname);
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_DELETED, (Ecore_Event_Handler_Cb)_directory_deleted_cb, filename);
@@ -463,7 +437,7 @@ START_TEST(eio_test_monitor_directory_directory_deleted_notify)
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
static void _directory_modified_cb(void *data, int type, void *event)
{
@@ -476,7 +450,7 @@ static void _directory_modified_cb(void *data, int type, void *event)
}
-START_TEST(eio_test_monitor_directory_directory_modified_notify)
+EFL_START_TEST(eio_test_monitor_directory_directory_modified_notify)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
@@ -484,9 +458,6 @@ START_TEST(eio_test_monitor_directory_directory_modified_notify)
filename = eina_stringshare_printf("%s/eio_test_monitor_directory_directory_modified_notify", dirname);
_create_directory((void*)filename);
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
-
//monitor directory
eio_monitor_add(dirname);
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_MODIFIED, (Ecore_Event_Handler_Cb)_directory_modified_cb, filename);
@@ -497,7 +468,7 @@ START_TEST(eio_test_monitor_directory_directory_modified_notify)
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
static void _directory_self_deleted_cb(void *data, int type, void *event)
@@ -511,13 +482,10 @@ static void _directory_self_deleted_cb(void *data, int type, void *event)
}
-START_TEST(eio_test_monitor_directory_directory_self_deleted_notify)
+EFL_START_TEST(eio_test_monitor_directory_directory_self_deleted_notify)
{
Eina_Tmpstr *dirname = _common_init();
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
-
//monitor directory
eio_monitor_add(dirname);
ecore_event_handler_add(EIO_MONITOR_SELF_DELETED, (Ecore_Event_Handler_Cb)_directory_self_deleted_cb, dirname);
@@ -528,11 +496,11 @@ START_TEST(eio_test_monitor_directory_directory_self_deleted_notify)
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
//////// test monitoring a single file
-START_TEST(eio_test_monitor_file_file_modified_notify)
+EFL_START_TEST(eio_test_monitor_file_file_modified_notify)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
@@ -540,9 +508,6 @@ START_TEST(eio_test_monitor_file_file_modified_notify)
filename = eina_stringshare_printf("%s/filecreated", dirname);
_create_file((void*)filename);
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
-
//monitor file
eio_monitor_add(filename);
ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED, (Ecore_Event_Handler_Cb)_file_modified_cb, filename);
@@ -554,9 +519,9 @@ START_TEST(eio_test_monitor_file_file_modified_notify)
//cleanup
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eio_test_monitor_file_file_attrib_modified_notify)
+EFL_START_TEST(eio_test_monitor_file_file_attrib_modified_notify)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
@@ -564,9 +529,6 @@ START_TEST(eio_test_monitor_file_file_attrib_modified_notify)
filename = eina_stringshare_printf("%s/eio_test_monitor_file_file_attrib_modified_notify", dirname);
_create_file((void*)filename);
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
-
//monitor file
eio_monitor_add(filename);
ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED, (Ecore_Event_Handler_Cb)_file_modified_cb, filename);
@@ -577,32 +539,35 @@ START_TEST(eio_test_monitor_file_file_attrib_modified_notify)
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eio_test_monitor_file_file_closed_notify)
+EFL_START_TEST(eio_test_monitor_file_file_closed_notify)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
+ Eio_Monitor *monitor;
filename = eina_stringshare_printf("%s/eio_test_monitor_file_file_closed_notify", dirname);
_create_file((void*)filename);
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
-
//monitor file
- eio_monitor_add(dirname);
- ecore_event_handler_add(EIO_MONITOR_FILE_CLOSED, (Ecore_Event_Handler_Cb)_file_closed_cb, filename);
- ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename);
+ monitor = eio_monitor_add(dirname);
+ if (eio_monitor_fallback_check(monitor))
+ printf("skipping %s: using fallback monitoring\n", "eio_test_monitor_file_file_closed_notify");
+ else
+ {
+ ecore_event_handler_add(EIO_MONITOR_FILE_CLOSED, (Ecore_Event_Handler_Cb)_file_closed_cb, filename);
+ ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename);
- ecore_main_loop_begin();
+ ecore_main_loop_begin();
+ }
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eio_test_monitor_file_file_self_deleted_notify)
+EFL_START_TEST(eio_test_monitor_file_file_self_deleted_notify)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
@@ -610,9 +575,6 @@ START_TEST(eio_test_monitor_file_file_self_deleted_notify)
filename = eina_stringshare_printf("%s/eio_test_monitor_file_file_self_deleted_notify", dirname);
_create_file((void*)filename);
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
-
//monitor file
eio_monitor_add(filename);
ecore_event_handler_add(EIO_MONITOR_SELF_DELETED, (Ecore_Event_Handler_Cb)_directory_self_deleted_cb, filename);
@@ -623,9 +585,9 @@ START_TEST(eio_test_monitor_file_file_self_deleted_notify)
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eio_test_monitor_two_monitors_one_event)
+EFL_START_TEST(eio_test_monitor_two_monitors_one_event)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Tmpstr *dirname2;
@@ -635,9 +597,6 @@ START_TEST(eio_test_monitor_two_monitors_one_event)
eina_file_mkdtemp("checkFileCreationXXXXXX", &dirname2);
filename = eina_stringshare_printf("%s/eio_test_monitor_two_monitors_one_event", dirname);
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
-
//monitor directory
eio_monitor_add(dirname);
eio_monitor_add(dirname2);
@@ -650,10 +609,10 @@ START_TEST(eio_test_monitor_two_monitors_one_event)
_delete_directory((void*)dirname2);
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eio_test_monitor_two_monitors_one_removed_one_event)
+EFL_START_TEST(eio_test_monitor_two_monitors_one_removed_one_event)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Tmpstr *dirname2;
@@ -665,9 +624,6 @@ START_TEST(eio_test_monitor_two_monitors_one_removed_one_event)
eina_file_mkdtemp("checkFileCreationXXXXXX", &dirname2);
filename = eina_stringshare_printf("%s/eio_test_monitor_two_monitors_one_removed", dirname);
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
-
//monitor directory
monitor = eio_monitor_add(dirname2);
eio_monitor_add(dirname);
@@ -681,14 +637,14 @@ START_TEST(eio_test_monitor_two_monitors_one_removed_one_event)
_delete_directory((void*)dirname2);
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
static void _unexpected_event_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED)
{
ck_abort_msg("unexpected event");
}
-START_TEST(eio_test_monitor_two_monitors_one_removed_no_event)
+EFL_START_TEST(eio_test_monitor_two_monitors_one_removed_no_event)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Tmpstr *dirname2;
@@ -700,9 +656,6 @@ START_TEST(eio_test_monitor_two_monitors_one_removed_no_event)
eina_file_mkdtemp("checkFileCreationXXXXXX", &dirname2);
filename = eina_stringshare_printf("%s/eio_test_monitor_two_monitors_one_removed", dirname);
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
-
//monitor directory
monitor = eio_monitor_add(dirname);
eio_monitor_add(dirname2);
@@ -710,16 +663,16 @@ START_TEST(eio_test_monitor_two_monitors_one_removed_no_event)
ecore_event_handler_add(EIO_MONITOR_FILE_CREATED, (Ecore_Event_Handler_Cb)_unexpected_event_cb, filename);
ecore_timer_add(TEST_OPERATION_DELAY, _create_file, filename);
- ecore_timer_add(TEST_TIMEOUT_SEC - 1, _test_timeout_expected, NULL);
+ ecore_timer_add(0.2, _test_timeout_expected, NULL);
ecore_main_loop_begin();
_delete_directory((void*)dirname2);
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eio_test_monitor_two_files_in_same_directory)
+EFL_START_TEST(eio_test_monitor_two_files_in_same_directory)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
@@ -730,9 +683,6 @@ START_TEST(eio_test_monitor_two_files_in_same_directory)
_create_file((void*)filename);
_create_file((void*)filename2);
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
-
//monitor file
eio_monitor_add(filename);
eio_monitor_add(filename2);
@@ -745,10 +695,10 @@ START_TEST(eio_test_monitor_two_files_in_same_directory)
//cleanup
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eio_test_monitor_two_files_in_same_directory_one_removed)
+EFL_START_TEST(eio_test_monitor_two_files_in_same_directory_one_removed)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
@@ -760,9 +710,6 @@ START_TEST(eio_test_monitor_two_files_in_same_directory_one_removed)
_create_file((void*)filename);
_create_file((void*)filename2);
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
-
//monitor file
monitor = eio_monitor_add(filename);
eio_monitor_add(filename2);
@@ -771,14 +718,14 @@ START_TEST(eio_test_monitor_two_files_in_same_directory_one_removed)
ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED, (Ecore_Event_Handler_Cb)_unexpected_event_cb, filename);
ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename);
- ecore_timer_add(TEST_TIMEOUT_SEC - 1, _test_timeout_expected, NULL);
+ ecore_timer_add(0.2, _test_timeout_expected, NULL);
ecore_main_loop_begin();
//cleanup
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
void eio_test_monitor(TCase *tc)
diff --git a/src/tests/eio/eio_test_sentry.c b/src/tests/eio/eio_test_sentry.c
index fb07e842f1..d4e687ec73 100644
--- a/src/tests/eio/eio_test_sentry.c
+++ b/src/tests/eio/eio_test_sentry.c
@@ -2,6 +2,8 @@
# include <config.h>
#endif
+#define EIO_SENTRY_BETA
+
#include <stdio.h>
#include <unistd.h>
#include <string.h>
@@ -14,8 +16,8 @@
/////////////////timeout function
-#define TEST_TIMEOUT_SEC 10
-#define TEST_OPERATION_DELAY 0.5
+#define TEST_TIMEOUT_SEC 0.5
+#define TEST_OPERATION_DELAY 0.05
static Ecore_Timer *test_timeout_timer;
@@ -107,13 +109,14 @@ static Eina_Bool _modify_attrib_file(void *data)
static void _check_event_path(void *data, const Efl_Event *event)
{
Eio_Sentry_Event *event_info = event->info;
+ /* ignore directory creation events */
+ if (ecore_file_is_dir(event_info->trigger)) return;
ck_assert_str_eq((const char*)data, event_info->trigger);
}
static Eina_Tmpstr *_common_init()
{
Eina_Tmpstr *dirname;
- fail_if(eio_init() != 1);
ecore_file_init();
//test timeout
@@ -127,39 +130,34 @@ static void _common_shutdown(Eina_Tmpstr *dirname)
{
_delete_directory((void*)dirname);
ecore_file_shutdown();
- fail_if(eio_shutdown() != 0);
eina_tmpstr_del(dirname);
+ _cancel_timeout();
}
/////// tests monitoring a directory
-START_TEST(eio_test_sentry_add_and_remove)
+EFL_START_TEST(eio_test_sentry_add_and_remove)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
Eo *sentry;
- filename = eina_stringshare_printf("%s/eio_test_sentry_directory_file_created_notify", dirname);
+ filename = eina_stringshare_printf("%s/eio_test_sentry_add_and_remove", dirname);
_create_directory((void*)filename);
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
-
//monitor directory
- sentry = efl_add(EIO_SENTRY_CLASS, NULL);
+ sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
fail_if(!eio_sentry_add(sentry, filename));
- usleep(500000);
-
- eio_sentry_del(sentry, filename);
+ eio_sentry_remove(sentry, filename);
efl_unref(sentry);
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eio_test_sentry_add_remove_add)
+EFL_START_TEST(eio_test_sentry_add_remove_add)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
@@ -168,26 +166,21 @@ START_TEST(eio_test_sentry_add_remove_add)
filename = eina_stringshare_printf("%s/eio_test_sentry_add_remove_add", dirname);
_create_directory((void*)filename);
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
-
//monitor directory
- sentry = efl_add(EIO_SENTRY_CLASS, NULL);
+ sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
fail_if(!eio_sentry_add(sentry, filename));
- eio_sentry_del(sentry, filename);
-
- usleep(500000);
+ eio_sentry_remove(sentry, filename);
fail_if(!eio_sentry_add(sentry, filename));
- eio_sentry_del(sentry, filename);
+ eio_sentry_remove(sentry, filename);
efl_unref(sentry);
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eio_test_sentry_add_add_remove_remove)
+EFL_START_TEST(eio_test_sentry_add_add_remove_remove)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename1;
@@ -199,23 +192,20 @@ START_TEST(eio_test_sentry_add_add_remove_remove)
_create_directory((void*)filename1);
_create_directory((void*)filename2);
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
-
- sentry = efl_add(EIO_SENTRY_CLASS, NULL);
+ sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
//monitor directory
fail_if(!eio_sentry_add(sentry, filename1));
fail_if(!eio_sentry_add(sentry, filename2));
- usleep(500000);
- eio_sentry_del(sentry, filename1);
- eio_sentry_del(sentry, filename2);
+
+ eio_sentry_remove(sentry, filename1);
+ eio_sentry_remove(sentry, filename2);
efl_unref(sentry);
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
static void _target_notified_cb(void *data, const Efl_Event *event)
{
@@ -225,17 +215,14 @@ static void _target_notified_cb(void *data, const Efl_Event *event)
}
-START_TEST(eio_test_sentry_directory_file_created_notify)
+EFL_START_TEST(eio_test_sentry_directory_file_created_notify)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
Eo* sentry;
filename = eina_stringshare_printf("%s/eio_test_sentry_directory_file_created_notify", dirname);
- sentry = efl_add(EIO_SENTRY_CLASS, NULL);
-
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
+ sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
//monitor directory
fail_if(!eio_sentry_add(sentry, dirname));
@@ -249,9 +236,9 @@ START_TEST(eio_test_sentry_directory_file_created_notify)
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eio_test_sentry_directory_file_deleted_notify)
+EFL_START_TEST(eio_test_sentry_directory_file_deleted_notify)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
@@ -259,10 +246,7 @@ START_TEST(eio_test_sentry_directory_file_deleted_notify)
filename = eina_stringshare_printf("%s/eio_test_sentry_directory_file_deleted_notify", dirname);
_create_file((void*)filename);
- sentry = efl_add(EIO_SENTRY_CLASS, NULL);
-
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
+ sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
//monitor directory
fail_if(!eio_sentry_add(sentry, dirname));
@@ -276,9 +260,9 @@ START_TEST(eio_test_sentry_directory_file_deleted_notify)
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eio_test_sentry_directory_file_modified_notify)
+EFL_START_TEST(eio_test_sentry_directory_file_modified_notify)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
@@ -286,10 +270,7 @@ START_TEST(eio_test_sentry_directory_file_modified_notify)
filename = eina_stringshare_printf("%s/eio_test_sentry_directory_file_modified_notify", dirname);
_create_file((void*)filename);
- sentry = efl_add(EIO_SENTRY_CLASS, NULL);
-
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
+ sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
//monitor directory
fail_if(!eio_sentry_add(sentry, dirname));
@@ -304,9 +285,9 @@ START_TEST(eio_test_sentry_directory_file_modified_notify)
//cleanup
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eio_test_sentry_directory_file_closed_notify)
+EFL_START_TEST(eio_test_sentry_directory_file_closed_notify)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
@@ -314,35 +295,34 @@ START_TEST(eio_test_sentry_directory_file_closed_notify)
filename = eina_stringshare_printf("%s/eio_test_sentry_directory_file_closed_notify", dirname);
_create_file((void*)filename);
- sentry = efl_add(EIO_SENTRY_CLASS, NULL);
-
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
+ sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
//monitor directory
fail_if(!eio_sentry_add(sentry, dirname));
- efl_event_callback_add(sentry, EIO_SENTRY_EVENT_FILE_CLOSED, (Efl_Event_Cb)_target_notified_cb, filename);
- ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename);
+ if (eio_sentry_fallback_check(sentry, dirname))
+ printf("skipping %s: using fallback monitoring\n", "eio_test_sentry_directory_file_closed_notify");
+ else
+ {
+ efl_event_callback_add(sentry, EIO_SENTRY_EVENT_FILE_CLOSED, (Efl_Event_Cb)_target_notified_cb, filename);
+ ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename);
- ecore_main_loop_begin();
+ ecore_main_loop_begin();
+ }
efl_unref(sentry);
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eio_test_sentry_directory_directory_created_notify)
+EFL_START_TEST(eio_test_sentry_directory_directory_created_notify)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
Eo *sentry;
filename = eina_stringshare_printf("%s/eio_test_sentry_directory_directory_created_notify", dirname);
- sentry = efl_add(EIO_SENTRY_CLASS, NULL);
-
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
+ sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
//monitor directory
fail_if(!eio_sentry_add(sentry, dirname));
@@ -356,9 +336,9 @@ START_TEST(eio_test_sentry_directory_directory_created_notify)
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eio_test_sentry_directory_directory_deleted_notify)
+EFL_START_TEST(eio_test_sentry_directory_directory_deleted_notify)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
@@ -366,10 +346,7 @@ START_TEST(eio_test_sentry_directory_directory_deleted_notify)
filename = eina_stringshare_printf("%s/eio_test_sentry_directory_directory_deleted_notify", dirname);
_create_directory((void*)filename);
- sentry = efl_add(EIO_SENTRY_CLASS, NULL);
-
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
+ sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
//monitor directory
fail_if(!eio_sentry_add(sentry, dirname));
@@ -383,9 +360,9 @@ START_TEST(eio_test_sentry_directory_directory_deleted_notify)
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eio_test_sentry_directory_directory_modified_notify)
+EFL_START_TEST(eio_test_sentry_directory_directory_modified_notify)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
@@ -393,10 +370,7 @@ START_TEST(eio_test_sentry_directory_directory_modified_notify)
filename = eina_stringshare_printf("%s/eio_test_sentry_directory_directory_modified_notify", dirname);
_create_directory((void*)filename);
- sentry = efl_add(EIO_SENTRY_CLASS, NULL);
-
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
+ sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
//monitor directory
fail_if(!eio_sentry_add(sentry, dirname));
@@ -410,15 +384,12 @@ START_TEST(eio_test_sentry_directory_directory_modified_notify)
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eio_test_sentry_directory_directory_self_deleted_notify)
+EFL_START_TEST(eio_test_sentry_directory_directory_self_deleted_notify)
{
Eina_Tmpstr *dirname = _common_init();
- Eo *sentry = efl_add(EIO_SENTRY_CLASS, NULL);
-
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
+ Eo *sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
//monitor directory
fail_if(!eio_sentry_add(sentry, dirname));
@@ -432,11 +403,11 @@ START_TEST(eio_test_sentry_directory_directory_self_deleted_notify)
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
// //////// test monitoring a single file
-START_TEST(eio_test_sentry_file_file_modified_notify)
+EFL_START_TEST(eio_test_sentry_file_file_modified_notify)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
@@ -444,10 +415,7 @@ START_TEST(eio_test_sentry_file_file_modified_notify)
filename = eina_stringshare_printf("%s/filecreated", dirname);
_create_file((void*)filename);
- sentry = efl_add(EIO_SENTRY_CLASS, NULL);
-
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
+ sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
//monitor file
fail_if(!eio_sentry_add(sentry, filename));
@@ -462,9 +430,9 @@ START_TEST(eio_test_sentry_file_file_modified_notify)
//cleanup
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eio_test_sentry_file_file_attrib_modified_notify)
+EFL_START_TEST(eio_test_sentry_file_file_attrib_modified_notify)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
@@ -472,10 +440,7 @@ START_TEST(eio_test_sentry_file_file_attrib_modified_notify)
filename = eina_stringshare_printf("%s/eio_test_sentry_file_file_attrib_modified_notify", dirname);
_create_file((void*)filename);
- sentry = efl_add(EIO_SENTRY_CLASS, NULL);
-
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
+ sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
//monitor file
fail_if(!eio_sentry_add(sentry, filename));
@@ -489,10 +454,10 @@ START_TEST(eio_test_sentry_file_file_attrib_modified_notify)
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eio_test_sentry_file_file_closed_notify)
+EFL_START_TEST(eio_test_sentry_file_file_closed_notify)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
@@ -500,25 +465,27 @@ START_TEST(eio_test_sentry_file_file_closed_notify)
filename = eina_stringshare_printf("%s/eio_test_sentry_file_file_closed_notify", dirname);
_create_file((void*)filename);
- sentry = efl_add(EIO_SENTRY_CLASS, NULL);
-
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
+ sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
//monitor file
fail_if(!eio_sentry_add(sentry, dirname));
- efl_event_callback_add(sentry, EIO_SENTRY_EVENT_FILE_CLOSED, (Efl_Event_Cb)_target_notified_cb, filename);
- ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename);
+ if (eio_sentry_fallback_check(sentry, dirname))
+ printf("skipping %s: using fallback monitoring\n", "eio_test_sentry_file_file_closed_notify");
+ else
+ {
+ efl_event_callback_add(sentry, EIO_SENTRY_EVENT_FILE_CLOSED, (Efl_Event_Cb)_target_notified_cb, filename);
+ ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename);
- ecore_main_loop_begin();
+ ecore_main_loop_begin();
+ }
efl_unref(sentry);
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eio_test_sentry_file_file_self_deleted_notify)
+EFL_START_TEST(eio_test_sentry_file_file_self_deleted_notify)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
@@ -526,10 +493,7 @@ START_TEST(eio_test_sentry_file_file_self_deleted_notify)
filename = eina_stringshare_printf("%s/eio_test_sentry_file_file_self_deleted_notify", dirname);
_create_file((void*)filename);
- sentry = efl_add(EIO_SENTRY_CLASS, NULL);
-
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
+ sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
//monitor file
fail_if(!eio_sentry_add(sentry, filename));
@@ -543,9 +507,9 @@ START_TEST(eio_test_sentry_file_file_self_deleted_notify)
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eio_test_sentry_two_monitors_one_event)
+EFL_START_TEST(eio_test_sentry_two_monitors_one_event)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Tmpstr *dirname2;
@@ -555,10 +519,7 @@ START_TEST(eio_test_sentry_two_monitors_one_event)
eina_file_mkdtemp("checkFileCreationXXXXXX", &dirname2);
filename = eina_stringshare_printf("%s/eio_test_sentry_two_monitors_one_event", dirname);
- sentry = efl_add(EIO_SENTRY_CLASS, NULL);
-
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
+ sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
//monitor directory
fail_if(!eio_sentry_add(sentry, dirname));
@@ -574,10 +535,10 @@ START_TEST(eio_test_sentry_two_monitors_one_event)
_delete_directory((void*)dirname2);
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eio_test_sentry_two_monitors_one_removed_one_event)
+EFL_START_TEST(eio_test_sentry_two_monitors_one_removed_one_event)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Tmpstr *dirname2;
@@ -587,15 +548,12 @@ START_TEST(eio_test_sentry_two_monitors_one_removed_one_event)
eina_file_mkdtemp("checkFileCreationXXXXXX", &dirname2);
filename = eina_stringshare_printf("%s/eio_test_sentry_two_monitors_one_removed", dirname);
- sentry = efl_add(EIO_SENTRY_CLASS, NULL);
-
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
+ sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
//monitor directory
fail_if(!eio_sentry_add(sentry, dirname2));
fail_if(!eio_sentry_add(sentry, dirname));
- eio_sentry_del(sentry, dirname2);
+ eio_sentry_remove(sentry, dirname2);
efl_event_callback_add(sentry, EIO_SENTRY_EVENT_FILE_CREATED, (Efl_Event_Cb)_target_notified_cb, filename);
ecore_timer_add(TEST_OPERATION_DELAY, _create_file, filename);
@@ -607,14 +565,14 @@ START_TEST(eio_test_sentry_two_monitors_one_removed_one_event)
_delete_directory((void*)dirname2);
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
static void _unexpected_event_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
{
ck_abort_msg("unexpected event");
}
-START_TEST(eio_test_sentry_two_monitors_one_removed_no_event)
+EFL_START_TEST(eio_test_sentry_two_monitors_one_removed_no_event)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Tmpstr *dirname2;
@@ -624,19 +582,16 @@ START_TEST(eio_test_sentry_two_monitors_one_removed_no_event)
eina_file_mkdtemp("checkFileCreationXXXXXX", &dirname2);
filename = eina_stringshare_printf("%s/eio_test_sentry_two_monitors_one_removed", dirname);
- sentry = efl_add(EIO_SENTRY_CLASS, NULL);
-
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
+ sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
//monitor directory
fail_if(!eio_sentry_add(sentry, dirname));
fail_if(!eio_sentry_add(sentry, dirname2));
- eio_sentry_del(sentry, dirname);
+ eio_sentry_remove(sentry, dirname);
efl_event_callback_add(sentry, EIO_SENTRY_EVENT_FILE_CREATED, (Efl_Event_Cb)_unexpected_event_cb, filename);
ecore_timer_add(TEST_OPERATION_DELAY, _create_file, filename);
- ecore_timer_add(TEST_TIMEOUT_SEC - 1, _test_timeout_expected, NULL);
+ ecore_timer_add(0.2, _test_timeout_expected, NULL);
ecore_main_loop_begin();
@@ -645,9 +600,9 @@ START_TEST(eio_test_sentry_two_monitors_one_removed_no_event)
_delete_directory((void*)dirname2);
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eio_test_sentry_two_files_in_same_directory)
+EFL_START_TEST(eio_test_sentry_two_files_in_same_directory)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
@@ -658,10 +613,7 @@ START_TEST(eio_test_sentry_two_files_in_same_directory)
filename2 = eina_stringshare_printf("%s/eio_test_sentry_two_files_in_same_directory_2", dirname);
_create_file((void*)filename);
_create_file((void*)filename2);
- sentry = efl_add(EIO_SENTRY_CLASS, NULL);
-
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
+ sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
//monitor file
fail_if(!eio_sentry_add(sentry,filename));
@@ -677,10 +629,10 @@ START_TEST(eio_test_sentry_two_files_in_same_directory)
//cleanup
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eio_test_sentry_two_files_in_same_directory_one_removed)
+EFL_START_TEST(eio_test_sentry_two_files_in_same_directory_one_removed)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
@@ -691,20 +643,17 @@ START_TEST(eio_test_sentry_two_files_in_same_directory_one_removed)
filename2 = eina_stringshare_printf("%s/eio_test_sentry_two_files_in_same_directory_one_removed_2", dirname);
_create_file((void*)filename);
_create_file((void*)filename2);
- sentry = efl_add(EIO_SENTRY_CLASS, NULL);
-
- //sleep to avoid catching event generated by above manipulations
- usleep(500000);
+ sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
//monitor file
fail_if(!eio_sentry_add(sentry,filename));
fail_if(!eio_sentry_add(sentry,filename2));
- eio_sentry_del(sentry, filename);
+ eio_sentry_remove(sentry, filename);
efl_event_callback_add(sentry, EIO_SENTRY_EVENT_FILE_MODIFIED, (Efl_Event_Cb)_unexpected_event_cb, filename);
ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename);
- ecore_timer_add(TEST_TIMEOUT_SEC - 1, _test_timeout_expected, NULL);
+ ecore_timer_add(0.2, _test_timeout_expected, NULL);
ecore_main_loop_begin();
@@ -713,7 +662,7 @@ START_TEST(eio_test_sentry_two_files_in_same_directory_one_removed)
//cleanup
_common_shutdown(dirname);
}
-END_TEST
+EFL_END_TEST
void eio_test_sentry(TCase *tc)
diff --git a/src/tests/eio/eio_test_xattr.c b/src/tests/eio/eio_test_xattr.c
index a727d7db20..62b956af05 100644
--- a/src/tests/eio/eio_test_xattr.c
+++ b/src/tests/eio/eio_test_xattr.c
@@ -130,7 +130,7 @@ _error_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED, int error)
ecore_main_loop_quit();
}
-START_TEST(eio_test_xattr_set)
+EFL_START_TEST(eio_test_xattr_set)
{
char *filename = "eio-tmpfile";
Eina_Tmpstr *test_file_path;
@@ -138,10 +138,6 @@ START_TEST(eio_test_xattr_set)
int num_of_attr = 0, fd;
unsigned int i;
- ecore_init();
- eina_init();
- eio_init();
-
test_file_path = get_full_path(XATTR_TEST_DIR, filename);
fd = open(test_file_path,
O_WRONLY | O_CREAT | O_TRUNC,
@@ -182,13 +178,10 @@ START_TEST(eio_test_xattr_set)
close(fd);
unlink(test_file_path);
eina_tmpstr_del(test_file_path);
- eio_shutdown();
- eina_shutdown();
- ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eio_test_xattr_types_set)
+EFL_START_TEST(eio_test_xattr_types_set)
{
char *filename = "eio-tmpfile";
@@ -196,10 +189,6 @@ START_TEST(eio_test_xattr_types_set)
int fd, num_of_attr=0;
Eio_File *fp;
- ecore_init();
- eina_init();
- eio_init();
-
test_file_path = get_full_path(XATTR_TEST_DIR, filename);
fd = open(test_file_path,
O_WRONLY | O_CREAT | O_TRUNC,
@@ -253,11 +242,8 @@ START_TEST(eio_test_xattr_types_set)
close(fd);
unlink(test_file_path);
eina_tmpstr_del(test_file_path);
- eio_shutdown();
- eina_shutdown();
- ecore_shutdown();
}
-END_TEST
+EFL_END_TEST
#endif
void eio_test_xattr(TCase *tc)
diff --git a/src/tests/eldbus/eldbus_fake_server.c b/src/tests/eldbus/eldbus_fake_server.c
index 3a8776ef90..9679e900e6 100644
--- a/src/tests/eldbus/eldbus_fake_server.c
+++ b/src/tests/eldbus/eldbus_fake_server.c
@@ -53,7 +53,7 @@ static const Eldbus_Service_Interface_Desc test_interface_desc = {
Eldbus_Service_Interface *
-fake_server_start(Fake_Server_Data *data)
+fake_server_start(Fake_Server_Data *data, const char *name)
{
ck_assert_ptr_ne(NULL, data);
@@ -62,7 +62,7 @@ fake_server_start(Fake_Server_Data *data)
Eldbus_Service_Interface *interface = eldbus_service_interface_register(conn, FAKE_SERVER_PATH, &test_interface_desc);
eldbus_service_object_data_set(interface, FAKE_SERVER_DATA_KEY, data);
- eldbus_name_request(conn, FAKE_SERVER_BUS, ELDBUS_NAME_REQUEST_FLAG_DO_NOT_QUEUE,
+ eldbus_name_request(conn, name, ELDBUS_NAME_REQUEST_FLAG_DO_NOT_QUEUE,
_fake_server_name_request_cb, interface);
ecore_main_loop_begin();
@@ -166,8 +166,9 @@ _fake_server_name_request_cb(void *data EINA_UNUSED,
const Eldbus_Message *msg,
Eldbus_Pending *pending EINA_UNUSED)
{
- if (eldbus_message_error_get(msg, NULL, NULL))
- ck_abort_msg("error on _fake_server_name_request_cb");
+ const char *name, *text;
+ if (eldbus_message_error_get(msg, &name, &text))
+ ck_abort_msg("error on _fake_server_name_request_cb: %s %s", name, text);
unsigned int reply;
if (!eldbus_message_arguments_get(msg, "u", &reply))
diff --git a/src/tests/eldbus/eldbus_fake_server.h b/src/tests/eldbus/eldbus_fake_server.h
index a8a1f52fdf..e1854d5ed2 100644
--- a/src/tests/eldbus/eldbus_fake_server.h
+++ b/src/tests/eldbus/eldbus_fake_server.h
@@ -3,9 +3,9 @@
#include <Eldbus.h>
-#define FAKE_SERVER_BUS "org.Enlightenment.Test"
-#define FAKE_SERVER_PATH "/org/enlightenment"
-#define FAKE_SERVER_INTERFACE "org.enlightenment.FakeServer"
+#define FAKE_SERVER_BUS "org.Eldbus.Test"
+#define FAKE_SERVER_PATH "/org/eldbus"
+#define FAKE_SERVER_INTERFACE "org.Eldbus.FakeServer"
#define FAKE_SERVER_READONLY_PROPERTY "r"
#define FAKE_SERVER_WRITEONLY_PROPERTY "w"
#define FAKE_SERVER_READWRITE_PROPERTY "rw"
@@ -23,7 +23,7 @@ struct _Fake_Server_Data
int pong_response;
};
-Eldbus_Service_Interface *fake_server_start(Fake_Server_Data *data);
+Eldbus_Service_Interface *fake_server_start(Fake_Server_Data *data, const char *name);
void fake_server_stop(Eldbus_Service_Interface *interface);
#endif
diff --git a/src/tests/eldbus/eldbus_suite.c b/src/tests/eldbus/eldbus_suite.c
index 6b76759577..560deaf21f 100644
--- a/src/tests/eldbus/eldbus_suite.c
+++ b/src/tests/eldbus/eldbus_suite.c
@@ -4,6 +4,7 @@
#include "eldbus_suite.h"
#include "../efl_check.h"
+#include <Eldbus.h>
static const Efl_Test_Case etc[] = {
{ "eldbus_init", eldbus_test_eldbus_init },
@@ -22,6 +23,17 @@ static const Efl_Test_Case etc[] = {
{ NULL, NULL }
};
+SUITE_INIT(eldbus)
+{
+ ck_assert_int_eq(eldbus_init(), 1);
+}
+
+SUITE_SHUTDOWN(eldbus)
+{
+ //T6814
+ ck_assert_int_eq(eldbus_shutdown(), 0);
+}
+
int
main(int argc, char **argv)
{
@@ -35,7 +47,7 @@ main(int argc, char **argv)
#endif
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
- "Eldbus", etc);
+ "Eldbus", etc, SUITE_INIT_FN(eldbus), SUITE_SHUTDOWN_FN(eldbus));
return (failed_count == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}
diff --git a/src/tests/eldbus/eldbus_suite.h b/src/tests/eldbus/eldbus_suite.h
index 0f77dbefa8..09b165e845 100644
--- a/src/tests/eldbus/eldbus_suite.h
+++ b/src/tests/eldbus/eldbus_suite.h
@@ -2,7 +2,7 @@
#define _ELDBUS_SUITE_H
#include <check.h>
-
+#include "../efl_check.h"
void eldbus_test_eldbus_init(TCase *tc);
void eldbus_test_eldbus_model(TCase *tc);
void eldbus_test_eldbus_model_connection(TCase *tc);
diff --git a/src/tests/eldbus/eldbus_test_eldbus_init.c b/src/tests/eldbus/eldbus_test_eldbus_init.c
index 65f229e732..064caea162 100644
--- a/src/tests/eldbus/eldbus_test_eldbus_init.c
+++ b/src/tests/eldbus/eldbus_test_eldbus_init.c
@@ -14,96 +14,33 @@
static Eina_Bool
_quit_cb(void *data EINA_UNUSED)
{
+ ck_abort_msg("dbus timeout triggered!");
ecore_main_loop_quit();
return EINA_FALSE;
}
-START_TEST(eldbus_test_eldbus)
+EFL_START_TEST(eldbus_test_eldbus)
{
- int ret;
-
- ecore_init();
- ret = eldbus_init();
- fail_if(ret < 1);
-
- ret = eldbus_shutdown();
-
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(eldbus_test_eldbus_main_loop)
-{
- Ecore_Timer *timer;
- int ret;
-
- ecore_init();
- ret = eldbus_init();
- fail_if(ret < 1);
-
- timer = ecore_timer_add(0.1, _quit_cb, NULL);
- fail_if(timer == NULL);
-
- ecore_main_loop_begin();
-
- ret = eldbus_shutdown();
-
- ecore_shutdown();
-
}
-END_TEST
-
-#if 0
-/* TODO: This test assumes an existing dbus-daemon running. It
- * shouldn't do this, instead we should launch dbus-daemon ourselves
- * and create our private instance, use it and then kill it
- * afterwards.
- */
+EFL_END_TEST
-START_TEST(eldbus_test_eldbus_conn)
+EFL_START_TEST(eldbus_test_eldbus_conn)
{
Eldbus_Connection *conn;
- int ret;
- ecore_init();
-
- ret = eldbus_init();
- fail_if(ret < 1);
-
- /*
- * let's use connection type == system, so it works without a session,
- * however security rules may apply differently depending on the
- * machine/user
- */
- conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
+ conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
fail_if(conn == NULL);
eldbus_connection_unref(conn);
-
- ret = eldbus_shutdown();
-
- ecore_shutdown();
-
}
-END_TEST
+EFL_END_TEST
-START_TEST(eldbus_test_eldbus_conn_object)
+EFL_START_TEST(eldbus_test_eldbus_conn_object)
{
Eldbus_Connection *conn;
Eldbus_Object *obj;
- int ret;
-
- ecore_init();
-
- ret = eldbus_init();
- fail_if(ret < 1);
- /*
- * let's use connection type == system, so it works without a D-Bus session.
- * However security rules may apply differently depending on the
- * machine/user
- */
- conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
+ conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
fail_if(conn == NULL);
obj = eldbus_object_get(conn, "org.buu", "/org/buu");
@@ -113,33 +50,27 @@ START_TEST(eldbus_test_eldbus_conn_object)
eldbus_connection_unref(conn);
- ret = eldbus_shutdown();
-
- ecore_shutdown();
-
}
-END_TEST
+EFL_END_TEST
void name_owner_changed_cb(void *data, const char *bus EINA_UNUSED, const char *old_id EINA_UNUSED, const char *new_id)
{
const char **id = data;
*id = new_id;
+ ecore_main_loop_quit();
}
-START_TEST(eldbus_test_eldbus_name_owner_changed)
+EFL_START_TEST(eldbus_test_eldbus_name_owner_changed)
{
Eldbus_Connection *conn;
const char *id = NULL;
- ecore_init();
- eldbus_init();
-
- conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
+ conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
fail_if(conn == NULL);
eldbus_name_owner_changed_callback_add(conn, "org.bus.that.not.exist",
name_owner_changed_cb, &id, EINA_TRUE);
- ecore_timer_add(0.5, _quit_cb, NULL);
+ ecore_timer_add(0.1, _quit_cb, NULL);
ecore_main_loop_begin();
@@ -147,19 +78,13 @@ START_TEST(eldbus_test_eldbus_name_owner_changed)
eldbus_connection_unref(conn);
- eldbus_shutdown();
- ecore_shutdown();
}
-END_TEST
-#endif
+EFL_END_TEST
void eldbus_test_eldbus_init(TCase *tc)
{
tcase_add_test(tc, eldbus_test_eldbus);
- tcase_add_test(tc, eldbus_test_eldbus_main_loop);
-#if 0
tcase_add_test(tc, eldbus_test_eldbus_conn);
tcase_add_test(tc, eldbus_test_eldbus_conn_object);
tcase_add_test(tc, eldbus_test_eldbus_name_owner_changed);
-#endif
}
diff --git a/src/tests/eldbus/eldbus_test_eldbus_message.c b/src/tests/eldbus/eldbus_test_eldbus_message.c
index f15b635697..e98d5cf528 100644
--- a/src/tests/eldbus/eldbus_test_eldbus_message.c
+++ b/src/tests/eldbus/eldbus_test_eldbus_message.c
@@ -26,9 +26,9 @@ static const char *path = "/org/freedesktop/DBus";
static const char *method_name = "GetId";
static const char *signal_name = "NameOwnerChanged";
-const char *dbus_session_path = "/org/freedesktop/Test";
-const char *interface_session = "org.freedesktop.Test";
-const char *bus_session = "org.freedesktop.Test";
+static const char *dbus_session_path = "/org/freedesktop/Test";
+static const char *interface_session = "org.freedesktop.Test";
+static const char *bus_session = "org.freedesktop.Test.eldbus_test_eldbus_message";
#define CONTAINER_COUNT 2
@@ -46,26 +46,9 @@ static Eldbus_Message_Iter *iter_value_swap = NULL;
*
*
* @precondition
-* @step 1 Initialize ecore with ecore_init()
-* @step 2 Initialize eldbus with eldbus_init()
+* @step 1 Initialize eldbus with eldbus_init()
*/
-static void
-_setup(void)
-{
- ecore_init();
- int ret = eldbus_init();
- ck_assert_int_ge(ret, 1);
-}
-
-static void
-_teardown(void)
-{
- ecore_shutdown();
- int ret = eldbus_shutdown();
- ck_assert_int_eq(ret, 0);
-}
-
static Eina_Bool
_ecore_loop_close(void *data EINA_UNUSED)
{
@@ -524,9 +507,13 @@ _response_swap_value(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_P
{
Eina_Value *eina_value;
int swap_value;
+ const char *name, *err;
- if (!eldbus_message_error_get(msg, NULL, NULL))
+ if (eldbus_message_error_get(msg, &name, &err))
+ ck_abort_msg("%s: %s", name, err);
+ else
{
+
Eldbus_Message_Iter *iter = eldbus_message_iter_get(msg);
eina_value = eldbus_message_iter_struct_like_to_eina_value(iter);
eina_value_struct_get(eina_value, "arg0", &swap_value);
@@ -639,13 +626,13 @@ _activable_list_get(Eldbus_Message_Cb message_cb)
{
is_success = EINA_FALSE;
- Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
+ Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
ck_assert_ptr_ne(NULL, conn);
Eldbus_Pending *pending = eldbus_names_activatable_list(conn, message_cb, NULL);
ck_assert_ptr_ne(NULL, pending);
- timeout = ecore_timer_add(1.5, _ecore_loop_close, NULL);
+ timeout = ecore_timer_add(0.1, _ecore_loop_close, NULL);
ck_assert_ptr_ne(NULL, timeout);
ecore_main_loop_begin();
@@ -689,11 +676,11 @@ _activable_list_get(Eldbus_Message_Cb message_cb)
* @}
*/
-START_TEST(utc_eldbus_message_iterator_activatable_list_p)
+EFL_START_TEST(utc_eldbus_message_iterator_activatable_list_p)
{
_activable_list_get(_response_message_cb);
}
-END_TEST
+EFL_END_TEST
/**
* @addtogroup eldbus_message
@@ -738,13 +725,13 @@ END_TEST
* @}
*/
-START_TEST(utc_eldbus_message_info_data_get_p)
+EFL_START_TEST(utc_eldbus_message_info_data_get_p)
{
const int timeout_send_ms = 1000;
is_success = EINA_FALSE;
- Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
+ Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
ck_assert_ptr_ne(NULL, conn);
Eldbus_Message *msg = eldbus_message_method_call_new(bus, path, interface, method_name);
@@ -762,17 +749,16 @@ START_TEST(utc_eldbus_message_info_data_get_p)
Eldbus_Pending *pending = eldbus_connection_send(conn, msg, _message_method_cb, NULL, timeout_send_ms);
ck_assert_ptr_ne(NULL, pending);
- timeout = ecore_timer_add(1.5, _ecore_loop_close, NULL);
+ timeout = ecore_timer_add(0.1, _ecore_loop_close, NULL);
ck_assert_ptr_ne(NULL, timeout);
ecore_main_loop_begin();
ck_assert_msg(is_success, "Method %s is not call", method_name);
- eldbus_message_unref(msg);
eldbus_connection_unref(conn);
}
-END_TEST
+EFL_END_TEST
/**
* @addtogroup eldbus_message
@@ -806,13 +792,13 @@ END_TEST
* @}
*/
-START_TEST(utc_eldbus_message_signal_new_p)
+EFL_START_TEST(utc_eldbus_message_signal_new_p)
{
const int timeout_send_ms = 1000;
is_success = EINA_FALSE;
- Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
+ Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
ck_assert_ptr_ne(NULL, conn);
Eldbus_Signal_Handler *signal_handler = eldbus_signal_handler_add(conn, NULL, path, interface,
@@ -826,18 +812,17 @@ START_TEST(utc_eldbus_message_signal_new_p)
Eldbus_Pending *pending = eldbus_connection_send(conn, msg, _message_without_body_cb, NULL, timeout_send_ms);
ck_assert_ptr_ne(NULL, pending);
- timeout = ecore_timer_add(1.5, _ecore_loop_close, NULL);
+ timeout = ecore_timer_add(0.1, _ecore_loop_close, NULL);
ck_assert_ptr_ne(NULL, timeout);
ecore_main_loop_begin();
ck_assert_msg(is_success, "Signal NameOwnerChanged is not emit");
- eldbus_signal_handler_unref(signal_handler);
- eldbus_message_unref(msg);
+ eldbus_signal_handler_del(signal_handler);
eldbus_connection_unref(conn);
}
-END_TEST
+EFL_END_TEST
/**
* @addtogroup eldbus_message
@@ -872,9 +857,9 @@ END_TEST
* @}
*/
-START_TEST(utc_eldbus_message_ref_unref_p)
+EFL_START_TEST(utc_eldbus_message_ref_unref_p)
{
- Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
+ Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
ck_assert_ptr_ne(NULL, conn);
Eldbus_Message *msg = eldbus_message_method_call_new(bus, path, interface, method_name);
@@ -893,7 +878,7 @@ START_TEST(utc_eldbus_message_ref_unref_p)
eldbus_connection_unref(conn);
}
-END_TEST
+EFL_END_TEST
/**
* @addtogroup eldbus_message
@@ -925,17 +910,17 @@ END_TEST
* @}
*/
-START_TEST(utc_eldbus_message_basic_eina_value_p)
+EFL_START_TEST(utc_eldbus_message_basic_eina_value_p)
{
is_success = EINA_FALSE;
- Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
+ Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
ck_assert_ptr_ne(NULL, conn);
Eldbus_Pending *pending = eldbus_name_owner_has(conn, bus, _response_owner_has_cb, NULL);
ck_assert_ptr_ne(NULL, pending);
- timeout = ecore_timer_add(1.5, _ecore_loop_close, NULL);
+ timeout = ecore_timer_add(0.1, _ecore_loop_close, NULL);
ck_assert_ptr_ne(NULL, timeout);
ecore_main_loop_begin();
@@ -944,7 +929,7 @@ START_TEST(utc_eldbus_message_basic_eina_value_p)
eldbus_connection_unref(conn);
}
-END_TEST
+EFL_END_TEST
/**
* @addtogroup eldbus_message
@@ -975,11 +960,11 @@ END_TEST
* @}
*/
-START_TEST(utc_eldbus_message_iter_next_p)
+EFL_START_TEST(utc_eldbus_message_iter_next_p)
{
_activable_list_get(_activatable_list_response_cb);
}
-END_TEST
+EFL_END_TEST
/**
* @addtogroup eldbus_message
@@ -1012,10 +997,10 @@ END_TEST
* @}
* @}
*/
-START_TEST(utc_eldbus_message_arguments_vappend_p)
+EFL_START_TEST(utc_eldbus_message_arguments_vappend_p)
{
is_success = EINA_FALSE;
- Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
+ Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
ck_assert_ptr_ne(NULL, conn);
message_vparam = eldbus_message_method_call_new(bus, path, interface, "GetNameOwner");
@@ -1026,17 +1011,16 @@ START_TEST(utc_eldbus_message_arguments_vappend_p)
Eldbus_Pending *pending = eldbus_connection_send(conn, message_vparam, _message_response_cb, NULL, -1);
ck_assert_ptr_ne(NULL, pending);
- timeout = ecore_timer_add(1.5, _ecore_loop_close, NULL);
+ timeout = ecore_timer_add(0.1, _ecore_loop_close, NULL);
ck_assert_ptr_ne(NULL, timeout);
ecore_main_loop_begin();
ck_assert_msg(is_success, "Method GetNameOwner is not call");
- eldbus_message_unref(message_vparam);
eldbus_connection_unref(conn);
}
-END_TEST
+EFL_END_TEST
/**
* @addtogroup eldbus_message
@@ -1072,10 +1056,10 @@ END_TEST
* @}
* @}
*/
-START_TEST(utc_eldbus_message_arguments_vget_p)
+EFL_START_TEST(utc_eldbus_message_arguments_vget_p)
{
is_success = EINA_FALSE;
- Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
+ Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
ck_assert_ptr_ne(NULL, conn);
Eldbus_Message *message = eldbus_message_method_call_new(bus, path, interface, "NameHasOwner");
@@ -1087,17 +1071,16 @@ START_TEST(utc_eldbus_message_arguments_vget_p)
Eldbus_Pending *pending = eldbus_connection_send(conn, message, _message_vget_response_cb, NULL, -1);
ck_assert_ptr_ne(NULL, pending);
- timeout = ecore_timer_add(1.5, _ecore_loop_close, NULL);
+ timeout = ecore_timer_add(0.1, _ecore_loop_close, NULL);
ck_assert_ptr_ne(NULL, timeout);
ecore_main_loop_begin();
ck_assert_msg(is_success, "Can't get arguments");
- eldbus_message_unref(message);
eldbus_connection_unref(conn);
}
-END_TEST
+EFL_END_TEST
/**
* @addtogroup eldbus_message
@@ -1159,7 +1142,7 @@ END_TEST
* @}
* @}
*/
-START_TEST(utc_eldbus_message_eina_p)
+EFL_START_TEST(utc_eldbus_message_eina_p)
{
is_success = EINA_FALSE;
is_register_service = EINA_FALSE;
@@ -1194,7 +1177,7 @@ START_TEST(utc_eldbus_message_eina_p)
pending = eldbus_proxy_call(proxy, "SwapValue", _response_swap_iter_vget, NULL, -1 , "i", value_from_client);
ck_assert_ptr_ne(NULL, pending);
- timeout = ecore_timer_add(2.5, _ecore_loop_close, NULL);
+ timeout = ecore_timer_add(0.15, _ecore_loop_close, NULL);
ck_assert_ptr_ne(NULL, timeout);
ecore_main_loop_begin();
@@ -1203,14 +1186,11 @@ START_TEST(utc_eldbus_message_eina_p)
ck_assert_msg(is_register_service, "Can't registered service");
ck_assert_msg(is_iter_vget, "Can't get argument");
- eldbus_message_unref(msg);
- eldbus_proxy_unref(proxy);
- eldbus_object_unref(obj);
eldbus_connection_unref(conn_client);
eldbus_service_interface_unregister(iface);
eldbus_connection_unref(conn_server);
}
-END_TEST
+EFL_END_TEST
/**
* @addtogroup eldbus_message
@@ -1271,7 +1251,7 @@ END_TEST
* @}
* @}
*/
-START_TEST(utc_eldbus_message_container_p)
+EFL_START_TEST(utc_eldbus_message_container_p)
{
int i;
@@ -1315,7 +1295,7 @@ START_TEST(utc_eldbus_message_container_p)
Eldbus_Pending *pending = eldbus_proxy_send(proxy, msg, _container_receive_cb, NULL, -1);
ck_assert_ptr_ne(NULL, pending);
- timeout = ecore_timer_add(2.5, _ecore_loop_close, NULL);
+ timeout = ecore_timer_add(0.15, _ecore_loop_close, NULL);
ck_assert_ptr_ne(NULL, timeout);
ecore_main_loop_begin();
@@ -1324,14 +1304,11 @@ START_TEST(utc_eldbus_message_container_p)
ck_assert_msg(is_register_service, "Can't registered service");
ck_assert_msg(is_receive, "Can't get container data");
- eldbus_message_unref(msg);
- eldbus_proxy_unref(proxy);
- eldbus_object_unref(obj);
eldbus_connection_unref(conn_client);
eldbus_service_interface_unregister(iface);
eldbus_connection_unref(conn_server);
}
-END_TEST
+EFL_END_TEST
/**
* @addtogroup eldbus_message
@@ -1376,7 +1353,7 @@ END_TEST
* @}
* @}
*/
-START_TEST(utc_eldbus_message_error_new_p)
+EFL_START_TEST(utc_eldbus_message_error_new_p)
{
is_success = EINA_FALSE;
@@ -1401,20 +1378,18 @@ START_TEST(utc_eldbus_message_error_new_p)
eldbus_proxy_call(proxy, "SendBool", _on_send_bool, NULL, -1, "b", NULL);
- timeout = ecore_timer_add(2.5, _ecore_loop_close, NULL);
+ timeout = ecore_timer_add(0.15, _ecore_loop_close, NULL);
ck_assert_ptr_ne(NULL, timeout);
ecore_main_loop_begin();
- eldbus_proxy_unref(proxy);
- eldbus_object_unref(obj);
eldbus_connection_unref(conn_client);
eldbus_service_interface_unregister(iface);
eldbus_connection_unref(conn_server);
ck_assert_msg(is_success, "Can't get response");
}
-END_TEST
+EFL_END_TEST
/**
* @addtogroup eldbus_message
@@ -1451,7 +1426,7 @@ END_TEST
* @}
* @}
*/
-START_TEST(utc_eldbus_message_iter_del_p)
+EFL_START_TEST(utc_eldbus_message_iter_del_p)
{
Eldbus_Connection *conn_server = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
ck_assert_ptr_ne(NULL, conn_server);
@@ -1480,12 +1455,11 @@ START_TEST(utc_eldbus_message_iter_del_p)
eldbus_message_iter_del(iter);
}
- eldbus_object_unref(obj);
eldbus_connection_unref(conn_client);
eldbus_service_interface_unregister(iface);
eldbus_connection_unref(conn_server);
}
-END_TEST
+EFL_END_TEST
/**
* @addtogroup eldbus_message
@@ -1530,7 +1504,7 @@ END_TEST
* @}
* @}
*/
-START_TEST(utc_eldbus_message_iter_fixed_array_get_p)
+EFL_START_TEST(utc_eldbus_message_iter_fixed_array_get_p)
{
is_success = EINA_FALSE;
@@ -1556,13 +1530,11 @@ START_TEST(utc_eldbus_message_iter_fixed_array_get_p)
Eldbus_Pending *pending = eldbus_proxy_call(proxy, "SendArrayInt", _on_send_array_int, NULL, -1 , "");
ck_assert_ptr_ne(NULL, pending);
- timeout = ecore_timer_add(2.5, _ecore_loop_close, NULL);
+ timeout = ecore_timer_add(0.15, _ecore_loop_close, NULL);
ck_assert_ptr_ne(NULL, timeout);
ecore_main_loop_begin();
- eldbus_proxy_unref(proxy);
- eldbus_object_unref(obj);
eldbus_connection_unref(conn_client);
eldbus_service_interface_unregister(iface);
eldbus_connection_unref(conn_server);
@@ -1570,7 +1542,7 @@ START_TEST(utc_eldbus_message_iter_fixed_array_get_p)
ck_assert_msg(is_success, "Can't get response");
}
-END_TEST
+EFL_END_TEST
/**
* @addtogroup eldbus_message
@@ -1599,16 +1571,16 @@ END_TEST
* @}
* @}
*/
-START_TEST(utc_eldbus_hello_p)
+EFL_START_TEST(utc_eldbus_hello_p)
{
is_success = EINA_FALSE;
- Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
+ Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
ck_assert_ptr_ne(NULL, conn);
eldbus_hello(conn, _hello_cb, &cb_data);
- timeout = ecore_timer_add(1.5, _ecore_loop_close, NULL);
+ timeout = ecore_timer_add(0.1, _ecore_loop_close, NULL);
ck_assert_ptr_ne(NULL, timeout);
ecore_main_loop_begin();
@@ -1617,11 +1589,10 @@ START_TEST(utc_eldbus_hello_p)
ck_assert_msg(is_success, "Can't get response");
}
-END_TEST
+EFL_END_TEST
void eldbus_test_eldbus_message(TCase *tc)
{
- tcase_add_checked_fixture(tc, _setup, _teardown);
tcase_add_test(tc, utc_eldbus_message_iterator_activatable_list_p);
tcase_add_test(tc, utc_eldbus_message_info_data_get_p);
tcase_add_test(tc, utc_eldbus_message_signal_new_p);
diff --git a/src/tests/eldbus/eldbus_test_eldbus_model.c b/src/tests/eldbus/eldbus_test_eldbus_model.c
index bf05142943..ee0bb519e5 100644
--- a/src/tests/eldbus/eldbus_test_eldbus_model.c
+++ b/src/tests/eldbus/eldbus_test_eldbus_model.c
@@ -14,57 +14,68 @@
#include "eldbus_test_eldbus_model.h"
#include "eldbus_suite.h"
-static void
-_future_then_quit_cb(void *data , Efl_Event const *event)
-{
- Efl_Future_Event_Success* info = event->info;
- *(void**)data = info->value;
- ecore_main_loop_quit();
-}
-
-static void
-_future_then_quit_u_cb(void *data , Efl_Event const *event)
+static Eina_Value
+_future_then_quit_u_cb(void *data,
+ const Eina_Value v,
+ const Eina_Future *dead_future EINA_UNUSED)
{
unsigned *lhs = data;
- unsigned *rhs = ((Efl_Future_Event_Success*)event->info)->value;;
- *lhs = *rhs;
+ unsigned r = 0;
+
+ eina_value_uint_get(&v, &r);
+
+ *lhs = r;
ecore_main_loop_quit();
+
+ return v;
}
-static void
-_future_then_cp(void *data , Efl_Event const *event)
+static Eina_Value
+_future_then_cp(void *data ,
+ const Eina_Value v,
+ const Eina_Future *dead_future EINA_UNUSED)
{
- Eina_Value* value = ((Efl_Future_Event_Success*)event->info)->value;
- eina_value_copy(value, data);
+ Eina_Value *value = data;
+
+ eina_value_copy(&v, value);
ecore_main_loop_quit();
+
+ return v;
}
-static void
-_future_check_err(void *data EINA_UNUSED, Efl_Event const *value EINA_UNUSED)
+static Eina_Value
+_future_check_err(void *data,
+ const Eina_Value v,
+ const Eina_Future *dead_future EINA_UNUSED)
{
- ck_assert_msg(0, "Future Expected Error:\n");
+ Eina_Error *expected_error = data;
+ Eina_Error got = 0;
- ecore_main_loop_quit();
-}
+ fail_if(eina_value_type_get(&v) != EINA_VALUE_TYPE_ERROR);
-static void
-_error_then_ok(void* data, Efl_Event const* event)
-{
- Efl_Future_Event_Failure* info = event->info;
- Eina_Error const** expected_error = (Eina_Error const**)data;
+ eina_value_error_get(&v, &got);
+
+ if (expected_error)
+ ck_assert_int_eq(got, *expected_error);
- if (*expected_error)
- ck_assert_int_eq(info->error, **expected_error);
ecore_main_loop_quit();
+
+ return v;
}
-static void
-_error_then_cb(void* data EINA_UNUSED, Efl_Event const* event)
+static Eina_Value
+_future_then_quit_cb(void* data,
+ const Eina_Value v,
+ const Eina_Future *dead_future EINA_UNUSED)
{
- Efl_Future_Event_Failure* info = event->info;
- ck_assert_msg(0,"Future ERROR: %s\n", eina_error_msg_get(info->error));
+ Eina_Value **value = data;
+
+ *value = eina_value_dup(&v);
+
ecore_main_loop_quit();
+
+ return v;
}
static void
@@ -74,27 +85,27 @@ _efl_event_quit_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
efl_event_callback_stop(event->object);
}
-void *
-efl_model_future_then(Efl_Future *future)
+Eina_Value *
+efl_model_future_then(Eina_Future *future)
{
- void *data = NULL;
- efl_future_then(future, &_future_then_quit_cb, &_error_then_cb, NULL, &data);
+ Eina_Value *data = NULL;
+ eina_future_then(future, &_future_then_quit_cb, &data);
ecore_main_loop_begin();
return data;
}
void
-check_efl_model_future_error(Efl_Future *future, Eina_Error *err)
+check_efl_model_future_error(Eina_Future *future, Eina_Error *err)
{
- efl_future_then(future, &_future_check_err, &_error_then_ok, NULL, &err);
+ eina_future_then(future, &_future_check_err, err);
ecore_main_loop_begin();
}
int
-efl_model_future_then_u(Efl_Future *future)
+efl_model_future_then_u(Eina_Future *future)
{
unsigned i = -1;
- efl_future_then(future, &_future_then_quit_u_cb, &_error_then_cb, NULL, &i);
+ eina_future_then(future, &_future_then_quit_u_cb, &i);
ecore_main_loop_begin();
return i;
}
@@ -110,21 +121,24 @@ efl_model_wait_for_event(Eo *obj, const Efl_Event_Description* event)
Efl_Model *
efl_model_nth_child_get(Efl_Model *efl_model, unsigned int n)
{
- Eina_Accessor *accessor;
- Efl_Future *future;
+ Eina_Future *future;
+ Eina_Value *array;
+ Eo *child = NULL;
+ unsigned int len, i;
future = efl_model_children_slice_get(efl_model, n, 1);
- efl_ref(future);
- ck_assert_ptr_ne(NULL, future);
- accessor = efl_model_future_then(future);
- ck_assert_ptr_ne(NULL, accessor);
- Eo *child = NULL;
+ array = efl_model_future_then(future);
+ fail_if(eina_value_type_get(array) != EINA_VALUE_TYPE_ARRAY);
+
+ EINA_VALUE_ARRAY_FOREACH(array, len, i, child)
+ ;
+
+ child = efl_ref(child);
+ eina_value_free(array);
+
+ fail_if(!child);
- Eina_Bool ret = eina_accessor_data_get(accessor, 0, (void**)&child);
- efl_unref(future);
- ck_assert(ret);
- ck_assert_ptr_ne(NULL, child);
return child;
}
@@ -135,30 +149,13 @@ efl_model_first_child_get(Efl_Model *efl_model)
}
void
-check_init(void)
-{
- ecore_init();
- int ret = eldbus_init();
- ck_assert_int_ge(ret, 1);
-}
-
-void
-check_shutdown(void)
-{
- ecore_shutdown();
- int ret = eldbus_shutdown();
- ck_assert_int_eq(ret, 0);
-}
-
-void
check_property(Eo *object, const char *property_name, const char *expected_value)
{
- Efl_Future *future;
- future = efl_model_property_get(object, property_name);
- ck_assert_ptr_ne(NULL, future);
- Eina_Value *value = efl_model_future_then(future);
+ Eina_Value *value;
char *actual_value;
- eina_value_get(value, &actual_value);
+
+ value = efl_model_property_get(object, property_name);
+ actual_value = eina_value_to_string(value);
if (!actual_value)
ck_assert_ptr_eq(expected_value, actual_value);
else
@@ -167,12 +164,14 @@ check_property(Eo *object, const char *property_name, const char *expected_value
ck_assert_msg(is_property_equal, "'%s' != '%s'", expected_value, actual_value);
free(actual_value);
}
+ eina_value_free(value);
}
Eo *
create_connection(void)
{
- Eo *connection = efl_add_ref(ELDBUS_MODEL_CONNECTION_CLASS, efl_main_loop_get(), eldbus_model_connection_constructor(efl_added, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE));
+ Eo *connection = efl_add(ELDBUS_MODEL_CONNECTION_CLASS, efl_main_loop_get(),
+ eldbus_model_connect(efl_added, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE));
ck_assert_ptr_ne(NULL, connection);
return connection;
}
@@ -180,7 +179,10 @@ create_connection(void)
Eo *
create_object(void)
{
- Eo *object = efl_add_ref(ELDBUS_MODEL_OBJECT_CLASS, efl_main_loop_get(), eldbus_model_object_constructor(efl_added, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE, ELDBUS_FDO_BUS, ELDBUS_FDO_PATH));
+ Eo *object = efl_add(ELDBUS_MODEL_OBJECT_CLASS, efl_main_loop_get(),
+ eldbus_model_connect(efl_added, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE),
+ eldbus_model_object_bus_set(efl_added, ELDBUS_FDO_BUS),
+ eldbus_model_object_path_set(efl_added, ELDBUS_FDO_PATH));
ck_assert_ptr_ne(NULL, object);
return object;
}
@@ -189,9 +191,8 @@ void
check_efl_model_children_count_eq(Efl_Model *efl_model, unsigned int expected_children_count)
{
unsigned int actual_children_count;
- Efl_Future *future;
- future = efl_model_children_count_get(efl_model);
- actual_children_count = efl_model_future_then_u(future);
+
+ actual_children_count = efl_model_children_count_get(efl_model);
ck_assert_int_eq(expected_children_count, actual_children_count);
}
@@ -199,9 +200,8 @@ void
check_efl_model_children_count_ge(Efl_Model *efl_model, unsigned int minimum_children_count)
{
unsigned int actual_children_count;
- Efl_Future *future;
- future = efl_model_children_count_get(efl_model);
- actual_children_count = efl_model_future_then_u(future);
+
+ actual_children_count = efl_model_children_count_get(efl_model);
ck_assert_int_ge(actual_children_count, minimum_children_count);
}
@@ -209,126 +209,133 @@ void
check_efl_model_children_slice_get(Efl_Model *efl_model)
{
unsigned count;
- Efl_Future *future;
- Eina_Accessor *accessor;
+ Eina_Future *future;
+ Eina_Value *array;
+ Eo *first_child = NULL;
+ Eo *last_child = NULL;
+ Eo *nonexistent_child = NULL;
+ Eo *child = NULL;
- future = efl_model_children_count_get(efl_model);
- count = efl_model_future_then_u(future);
+ count = efl_model_children_count_get(efl_model);
ck_assert_msg((int)count > 0, "There must be at least 1 child to test");
// Test slice all
- future = efl_model_children_slice_get(efl_model, 0, 0);
- efl_ref(future);
- accessor = efl_model_future_then(future);
- ck_assert_ptr_ne(NULL, accessor);
+ future = efl_model_children_slice_get(efl_model, 0, count);
+ array = efl_model_future_then(future);
+ ck_assert_ptr_ne(NULL, array);
+ fail_if(eina_value_type_get(array) != EINA_VALUE_TYPE_ARRAY);
// Get first child
- Eo *first_child = NULL;
- Eina_Bool ret = eina_accessor_data_get(accessor, 0, (void**)&first_child);
- ck_assert(ret);
+ eina_value_array_get(array, 0, &first_child);
ck_assert_ptr_ne(NULL, first_child);
// get last child
- Eo *last_child = NULL;
- ret = eina_accessor_data_get(accessor, count - 1, (void**)&last_child);
- ck_assert(ret);
+ eina_value_array_get(array, count - 1, &last_child);
ck_assert_ptr_ne(NULL, last_child);
// Test nonexistent child
- Eo *nonexistent_child = NULL;
- ret = eina_accessor_data_get(accessor, count, (void**)&nonexistent_child);
- ck_assert(!ret);
+ eina_value_array_get(array, count, &nonexistent_child);
ck_assert_ptr_eq(NULL, nonexistent_child);
- efl_unref(future);
+ eina_value_free(array);
// Test slice first child
- Eo *child = NULL;
future = efl_model_children_slice_get(efl_model, 0, 1);
- efl_ref(future);
- accessor = efl_model_future_then(future);
- ck_assert_ptr_ne(NULL, accessor);
- ret = eina_accessor_data_get(accessor, 0, (void**)&child);
- ck_assert(ret);
+ array = efl_model_future_then(future);
+ ck_assert_ptr_ne(NULL, array);
+ eina_value_array_get(array, 0, &child);
ck_assert_ptr_ne(NULL, child);
- ret = eina_accessor_data_get(accessor, 1, (void**)&child);
- ck_assert(!ret);
+ eina_value_array_get(array, 1, &child);
ck_assert_ptr_eq(first_child, child);
- efl_unref(future);
+ eina_value_free(array);
// Test slice last child
future = efl_model_children_slice_get(efl_model, count - 1, 1);
- efl_ref(future);
- accessor = efl_model_future_then(future);
- ck_assert_ptr_ne(NULL, accessor);
- ret = eina_accessor_data_get(accessor, 0, (void**)&child);
- ck_assert(ret);
+ array = efl_model_future_then(future);
+ ck_assert_ptr_ne(NULL, array);
+ eina_value_array_get(array, 0, &child);
ck_assert_ptr_ne(NULL, child);
- ret = eina_accessor_data_get(accessor, 1, (void**)&child);
- ck_assert(!ret);
+ eina_value_array_get(array, 1, &child);
ck_assert_ptr_eq(last_child, child);
- efl_unref(future);
// Test slice nonexistent element
future = efl_model_children_slice_get(efl_model, count, 1);
- efl_ref(future);
ck_assert_ptr_ne(NULL, future);
- accessor = efl_model_future_then(future);
- ck_assert_ptr_eq(NULL, accessor);
- efl_unref(future);
+ array = efl_model_future_then(future);
+ fail_if(eina_value_type_get(array) != EINA_VALUE_TYPE_ERROR);
+ eina_value_free(array);
}
-START_TEST(smoke)
+EFL_START_TEST(smoke)
{
- check_init();
-
Eo *connection = create_connection();
- efl_unref(connection);
+ efl_del(connection);
+}
+EFL_END_TEST
+
+EFL_START_TEST(object)
+{
+ Eo *root = create_object();
+
+ efl_del(root);
- check_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(object)
+static Eina_Value
+_leave(void *data EINA_UNUSED, const Eina_Value v,
+ const Eina_Future *dead EINA_UNUSED)
+{
+ ecore_main_loop_quit();
+ return v;
+}
+static void
+_count_changed(void *data EINA_UNUSED, const Efl_Event *ev)
{
- check_init();
+ Eina_Future *f;
+ f = efl_loop_job(efl_provider_find(ev->object, EFL_LOOP_CLASS));
+ eina_future_then(f, _leave, NULL);
+}
- Eo *root = create_object();
+static Eina_Future *
+_async_slice_get(Efl_Model *model)
+{
+ efl_event_callback_add(model, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, _count_changed, NULL);
+ if (!efl_model_children_count_get(model))
+ ecore_main_loop_begin();
- efl_unref(root);
+ efl_event_callback_del(model, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, _count_changed, NULL);
- check_shutdown();
+ return efl_model_children_slice_get(model, 0, efl_model_children_count_get(model));
}
-END_TEST
-START_TEST(proxy)
+EFL_START_TEST(proxy)
{
- check_init();
+ Eina_Future *future = NULL;
+ Eina_Value *array = NULL;
+ Eo *proxy = NULL;
+ Eo *root;
+ unsigned int i, len;
- Eo *root = create_object();
+ root = create_object();
- Eina_Accessor *accessor = NULL;
- Efl_Future *future = NULL;
- future = efl_model_children_slice_get(root, 0, 0);
- efl_ref(future);
+ future = _async_slice_get(root);
ck_assert_ptr_ne(NULL, future);
- accessor = efl_model_future_then(future);
- ck_assert_ptr_ne(NULL, accessor);
+ array = efl_model_future_then(future);
+ ck_assert_ptr_ne(NULL, array);
- unsigned int i;
- Eo *proxy;
- EINA_ACCESSOR_FOREACH(accessor, i, proxy)
+ EINA_VALUE_ARRAY_FOREACH(array, len, i, proxy)
{
ck_assert_ptr_ne(NULL, proxy);
- //efl_model_load_and_wait_for_load_status(proxy, EFL_MODEL_LOAD_STATUS_LOADED);
+ //efl_model_load_and_wait_for_load_status(proxy, EFL_MODEL_LOAD_STATUS_LOADED);
}
- efl_unref(future);
- efl_unref(root);
+ eina_value_free(array);
+
+ efl_del(root);
- check_shutdown();
}
-END_TEST
+EFL_END_TEST
void
eldbus_test_eldbus_model(TCase *tc)
@@ -341,19 +348,19 @@ eldbus_test_eldbus_model(TCase *tc)
Eldbus_Model_Proxy *
eldbus_model_proxy_from_object_get(Eldbus_Model_Object *object, const char *interface_name)
{
- Eina_Accessor *accessor;
- Efl_Future *future = NULL;
- future = efl_model_children_slice_get(object, 0, 0);
- ck_assert_ptr_ne(NULL, future);
- efl_ref(future);
- accessor = efl_model_future_then(future);
- ck_assert_ptr_ne(NULL, accessor);
-
+ Eina_Future *future = NULL;
Eo *proxy = NULL;
- unsigned int i;
- EINA_ACCESSOR_FOREACH(accessor, i, proxy)
+ Eina_Value *array;
+ unsigned int len, i;
+
+ future = _async_slice_get(object);
+ array = efl_model_future_then(future);
+ ck_assert_ptr_ne(NULL, array);
+
+ EINA_VALUE_ARRAY_FOREACH(array, len, i, proxy)
{
const char *name;
+
name = eldbus_model_proxy_name_get(proxy);
ck_assert_ptr_ne(NULL, name);
if (strcmp(name, interface_name) == 0)
@@ -362,30 +369,31 @@ eldbus_model_proxy_from_object_get(Eldbus_Model_Object *object, const char *inte
proxy = NULL;
end:
- efl_unref(future);
+ eina_value_free(array);
return proxy;
}
static Eldbus_Model_Arguments *
_eldbus_model_arguments_from_proxy_get(Eldbus_Model_Proxy *proxy, const char *method_name, const Efl_Class *klass)
{
- Eina_Accessor *accessor;
- Efl_Future *future = NULL;
- future = efl_model_children_slice_get(proxy, 0, 0);
+ Eina_Future *future = NULL;
+ Eo *child = NULL;
+ Eina_Value *array;
+ unsigned int len, i;
+
+ future = _async_slice_get(proxy);
ck_assert_ptr_ne(NULL, future);
- efl_ref(future);
- accessor = efl_model_future_then(future);
- ck_assert_ptr_ne(NULL, accessor);
+ array = efl_model_future_then(future);
+ ck_assert_ptr_ne(NULL, array);
- Eo *child = NULL;
- unsigned int i;
- EINA_ACCESSOR_FOREACH(accessor, i, child)
+ EINA_VALUE_ARRAY_FOREACH(array, len, i, child)
{
+ const char *name;
+
if (!efl_isa(child, klass))
continue;
- const char *name;
- name = eldbus_model_arguments_name_get(child);
+ name = eldbus_model_arguments_arg_name_get(child);
ck_assert_ptr_ne(NULL, name);
if (strcmp(name, method_name) == 0)
goto end;
@@ -393,7 +401,7 @@ _eldbus_model_arguments_from_proxy_get(Eldbus_Model_Proxy *proxy, const char *me
child = NULL;
end:
- efl_unref(future);
+ eina_value_free(array);
return child;
}
@@ -412,41 +420,39 @@ eldbus_model_signal_from_proxy_get(Eldbus_Model_Proxy *proxy, const char *signal
void
check_efl_model_property_int_eq(Efl_Model *efl_model, const char *property, int expected_value)
{
- Eina_Value property_value;
- Efl_Future *future;
- future = efl_model_property_get(efl_model, property);
- ck_assert_ptr_ne(NULL, future);
-
- efl_future_then(future, &_future_then_cp, &_error_then_cb, NULL, &property_value);
- ecore_main_loop_begin();
+ const Eina_Value_Type *property_type;
+ Eina_Value *property_value;
+ int actual_value = 0;
- const Eina_Value_Type *property_type = eina_value_type_get(&property_value);
+ property_value = efl_model_property_get(efl_model, property);
+ property_type = eina_value_type_get(property_value);
ck_assert_ptr_eq(EINA_VALUE_TYPE_INT, property_type);
- int actual_value = 0;
- eina_value_get(&property_value, &actual_value);
+ eina_value_get(property_value, &actual_value);
ck_assert_int_eq(expected_value, actual_value);
- eina_value_flush(&property_value);
+ eina_value_free(property_value);
}
void
check_efl_model_property_int_set(Efl_Model *efl_model, const char *property, int value)
{
- Eina_Value eina_value, value_ret;
- Efl_Future *future;
+ Eina_Value eina_value = EINA_VALUE_EMPTY, value_ret = EINA_VALUE_EMPTY;
+ Eina_Future *future;
+ const Eina_Value_Type *property_type;
eina_value_setup(&eina_value, EINA_VALUE_TYPE_INT);
eina_value_set(&eina_value, value);
future = efl_model_property_set(efl_model, property, &eina_value);
- efl_future_then(future, &_future_then_cp, &_error_then_cb, NULL, &value_ret);
+ eina_future_then(future, &_future_then_cp, &value_ret);
ecore_main_loop_begin();
- const Eina_Value_Type *property_type = eina_value_type_get(&value_ret);
+ property_type = eina_value_type_get(&value_ret);
ck_assert_ptr_eq(EINA_VALUE_TYPE_INT, property_type);
int actual_value;
eina_value_get(&value_ret, &actual_value);
ck_assert_int_eq(value, actual_value);
eina_value_flush(&eina_value);
+ eina_value_flush(&value_ret);
}
diff --git a/src/tests/eldbus/eldbus_test_eldbus_model.h b/src/tests/eldbus/eldbus_test_eldbus_model.h
index 6eee973e3c..c23c36680d 100644
--- a/src/tests/eldbus/eldbus_test_eldbus_model.h
+++ b/src/tests/eldbus/eldbus_test_eldbus_model.h
@@ -19,11 +19,10 @@ void check_efl_model_children_count_ge(Efl_Model *obj, unsigned int minimum_chil
void check_efl_model_children_slice_get(Efl_Model *efl_model);
void check_efl_model_property_int_eq(Efl_Model *obj, const char *property, int expected_value);
void check_efl_model_property_int_set(Efl_Model *obj, const char *property, int value);
-void check_efl_model_future_error(Efl_Future *future, Eina_Error *err);
+void check_efl_model_future_error(Eina_Future *future, Eina_Error *err);
-
-void *efl_model_future_then(Efl_Future *future);
-int efl_model_future_then_u(Efl_Future *future);
+Eina_Value *efl_model_future_then(Eina_Future *future);
+int efl_model_future_then_u(Eina_Future *future);
Eldbus_Model_Proxy *eldbus_model_proxy_from_object_get(Eldbus_Model_Object *object, const char *interface_name);
Eldbus_Model_Method *eldbus_model_method_from_proxy_get(Eldbus_Model_Proxy *proxy, const char *method_name);
diff --git a/src/tests/eldbus/eldbus_test_eldbus_model_connection.c b/src/tests/eldbus/eldbus_test_eldbus_model_connection.c
index aadd13ae69..631faf1123 100644
--- a/src/tests/eldbus/eldbus_test_eldbus_model_connection.c
+++ b/src/tests/eldbus/eldbus_test_eldbus_model_connection.c
@@ -18,18 +18,16 @@ static Eo *connection = NULL;
static void
_setup(void)
{
- check_init();
connection = create_connection();
}
static void
_teardown(void)
{
- efl_unref(connection);
- check_shutdown();
+ efl_del(connection);
}
-START_TEST(properties_get)
+EFL_START_TEST(properties_get)
{
const Eina_Array *properties = NULL;
properties = efl_model_properties_get(connection);
@@ -39,85 +37,136 @@ START_TEST(properties_get)
unsigned int actual_properties_count = eina_array_count(properties);
ck_assert_int_eq(expected_properties_count, actual_properties_count);
}
-END_TEST
+EFL_END_TEST
-START_TEST(property_get)
+EFL_START_TEST(property_get)
{
- Efl_Future *future;
- future = efl_model_property_get(connection, UNIQUE_NAME_PROPERTY);
- efl_model_future_then(future);
+ Eina_Value *v;
+
+ v = efl_model_property_get(connection, UNIQUE_NAME_PROPERTY);
+ fail_if(v == NULL);
// Nonexistent property must raise ERROR
- future = NULL;
- future = efl_model_property_get(connection, "nonexistent");
- check_efl_model_future_error(future, &EFL_MODEL_ERROR_NOT_FOUND);
+ v = efl_model_property_get(connection, "nonexistent");
+ fail_if(v == NULL);
+ fail_if(eina_value_type_get(v) != EINA_VALUE_TYPE_ERROR);
+ /* fail_if(v != NULL || eina_value_type_get(v) != EINA_VALUE_TYPE_ERROR); */
+}
+EFL_END_TEST
+
+static Eina_Value
+_failed_property_set(void *data, const Eina_Value v,
+ const Eina_Future *dead_future EINA_UNUSED)
+{
+ Eina_Value *expected = data;
+
+ fail_if(eina_value_type_get(expected) != eina_value_type_get(&v));
+
+ if (eina_value_type_get(expected) == EINA_VALUE_TYPE_ERROR)
+ {
+ Eina_Error exerr = 0, goterr = 0;
+
+ eina_value_error_get(expected, &exerr);
+ eina_value_error_get(&v, &goterr);
+
+ fail_if(exerr != goterr);
+ }
+ ecore_main_loop_quit();
+
+ return v;
}
-END_TEST
-START_TEST(property_set)
+EFL_START_TEST(property_set)
{
Eina_Value value;
- Efl_Future *future;
+ Eina_Future *future;
// Nonexistent property must raise ERROR
eina_value_setup(&value, EINA_VALUE_TYPE_INT);
eina_value_set(&value, 1);
future = efl_model_property_set(connection, "nonexistent", &value);
- check_efl_model_future_error(future, &EFL_MODEL_ERROR_NOT_FOUND);
+ eina_future_then(future, _failed_property_set, eina_value_error_new(EFL_MODEL_ERROR_NOT_FOUND));
+
+ ecore_main_loop_begin();
// UNIQUE_NAME_PROPERTY is read-only
future = efl_model_property_set(connection, UNIQUE_NAME_PROPERTY, &value);
- check_efl_model_future_error(future, &EFL_MODEL_ERROR_READ_ONLY);
+ eina_future_then(future, _failed_property_set, eina_value_error_new(EFL_MODEL_ERROR_READ_ONLY));
+
+ ecore_main_loop_begin();
eina_value_flush(&value);
}
-END_TEST
+EFL_END_TEST
+
+static Eina_Value
+_leave(void *data EINA_UNUSED, const Eina_Value v,
+ const Eina_Future *dead EINA_UNUSED)
+{
+ ecore_main_loop_quit();
+ return v;
+}
+static void
+_count_changed(void *data EINA_UNUSED, const Efl_Event *ev)
+{
+ Eina_Future *f;
+ f = efl_loop_job(efl_provider_find(ev->object, EFL_LOOP_CLASS));
+ eina_future_then(f, _leave, NULL);
+}
static void
_test_children_count(Eo *efl_model)
{
// At least this connection <unique_name> and 'org.freedesktop.DBus' must exist
+ efl_event_callback_add(efl_model, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, _count_changed, NULL);
+ if (!efl_model_children_count_get(efl_model))
+ ecore_main_loop_begin();
+ efl_event_callback_del(efl_model, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, _count_changed, NULL);
+
check_efl_model_children_count_ge(efl_model, 2);
}
-START_TEST(children_count)
+EFL_START_TEST(children_count)
{
_test_children_count(connection);
}
-END_TEST
+EFL_END_TEST
-START_TEST(children_slice_get)
+EFL_START_TEST(children_slice_get)
{
+ efl_event_callback_add(connection, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, _count_changed, NULL);
+ if (!efl_model_children_count_get(connection))
+ ecore_main_loop_begin();
+ efl_event_callback_del(connection, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, _count_changed, NULL);
+
check_efl_model_children_slice_get(connection);
}
-END_TEST
+EFL_END_TEST
-START_TEST(child_add)
+EFL_START_TEST(child_add)
{
Eo *child;
child = efl_model_child_add(connection);
ck_assert_ptr_eq(NULL, child);
}
-END_TEST
+EFL_END_TEST
-START_TEST(child_del)
+EFL_START_TEST(child_del)
{
unsigned int expected_children_count = 0;
- Efl_Future *future;
- future = efl_model_children_count_get(connection);
- ck_assert_ptr_ne(NULL, future);
- expected_children_count = efl_model_future_then_u(future);
+ unsigned int actual_children_count = 0;
+ Eo *child;
- Eo *child = efl_model_first_child_get(connection);
+ expected_children_count = efl_model_children_count_get(connection);
+
+ child = efl_model_first_child_get(connection);
efl_model_child_del(connection, child);
- unsigned int actual_children_count = 0;
- future = efl_model_children_count_get(connection);
- actual_children_count = efl_model_future_then_u(future);
+ actual_children_count = efl_model_children_count_get(connection);
ck_assert_int_le(expected_children_count, actual_children_count);
}
-END_TEST
+EFL_END_TEST
void eldbus_test_eldbus_model_connection(TCase *tc)
{
@@ -127,6 +176,6 @@ void eldbus_test_eldbus_model_connection(TCase *tc)
tcase_add_test(tc, property_set);
tcase_add_test(tc, children_count);
tcase_add_test(tc, children_slice_get);
- /* tcase_add_test(tc, child_add); */
- /* tcase_add_test(tc, child_del); */
+ tcase_add_test(tc, child_add);
+ tcase_add_test(tc, child_del);
}
diff --git a/src/tests/eldbus/eldbus_test_eldbus_model_method.c b/src/tests/eldbus/eldbus_test_eldbus_model_method.c
index d240fefb4f..a04b6ca08c 100644
--- a/src/tests/eldbus/eldbus_test_eldbus_model_method.c
+++ b/src/tests/eldbus/eldbus_test_eldbus_model_method.c
@@ -25,11 +25,14 @@ static Eo *method = NULL;
static void
_setup(void)
{
- check_init();
-
- fake_server = fake_server_start(&fake_server_data);
-
- fake_server_object = efl_add(ELDBUS_MODEL_OBJECT_CLASS, efl_main_loop_get(), eldbus_model_object_constructor(efl_added, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE, FAKE_SERVER_BUS, FAKE_SERVER_PATH));
+ char buf[1024];
+ snprintf(buf, sizeof(buf), FAKE_SERVER_BUS ".%s", basename(__FILE__));
+ fake_server = fake_server_start(&fake_server_data, buf);
+
+ fake_server_object = efl_add(ELDBUS_MODEL_OBJECT_CLASS, efl_main_loop_get(),
+ eldbus_model_connect(efl_added, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE),
+ eldbus_model_object_bus_set(efl_added, buf),
+ eldbus_model_object_path_set(efl_added, FAKE_SERVER_PATH));
ck_assert_ptr_ne(NULL, fake_server_object);
fake_server_proxy = eldbus_model_proxy_from_object_get(fake_server_object, FAKE_SERVER_INTERFACE);
@@ -42,14 +45,12 @@ _setup(void)
static void
_teardown(void)
{
- efl_unref(fake_server_object);
+ efl_del(fake_server_object);
fake_server_stop(fake_server);
-
- check_shutdown();
}
-START_TEST(properties_get)
+EFL_START_TEST(properties_get)
{
const Eina_Array *properties = NULL;
properties = efl_model_properties_get(method);
@@ -59,33 +60,66 @@ START_TEST(properties_get)
const unsigned int actual_properties_count = eina_array_count(properties);
ck_assert_int_eq(expected_properties_count, actual_properties_count);
}
-END_TEST
+EFL_END_TEST
-START_TEST(property_get)
+EFL_START_TEST(property_get)
{
// Input only property returns error
- Efl_Future *future;
- future = efl_model_property_get(method, ARGUMENT_A);
- check_efl_model_future_error(future, NULL);
-
- future = efl_model_property_get(method, ARGUMENT_RESULT);
- efl_model_future_then(future);
+ Eina_Value *v;
+ Eina_Value i = EINA_VALUE_EMPTY;
+ int iv = -1;
+
+ v = efl_model_property_get(method, ARGUMENT_A);
+ fail_if(eina_value_type_get(v) != EINA_VALUE_TYPE_ERROR);
+ eina_value_free(v);
+
+ v = efl_model_property_get(method, ARGUMENT_RESULT);
+ eina_value_setup(&i, EINA_VALUE_TYPE_INT);
+ fail_if(eina_value_convert(v, &i) != EINA_TRUE);
+ fail_if(eina_value_int_get(&i, &iv) != EINA_TRUE);
+ fail_if(iv != 0);
+ eina_value_flush(&i);
+ eina_value_free(v);
// Nonexistent property returns error
- future = efl_model_property_get(method, "nonexistent");
- check_efl_model_future_error(future, NULL);
+ v = efl_model_property_get(method, "nonexistent");
+ fail_if(eina_value_type_get(v) != EINA_VALUE_TYPE_ERROR);
+ eina_value_free(v);
}
-END_TEST
+EFL_END_TEST
-START_TEST(property_set)
+static Eina_Value
+_expected_error(void *data,
+ const Eina_Value v,
+ const Eina_Future *dead_future EINA_UNUSED)
+{
+ fail_if(eina_value_type_get(&v) != EINA_VALUE_TYPE_ERROR);
+
+ if (data)
+ {
+ Eina_Error *expected = data;
+ Eina_Error error;
+
+ eina_value_error_get(&v, &error);
+
+ fail_if(*expected != error);
+ }
+
+ ecore_main_loop_quit();
+
+ return v;
+}
+
+EFL_START_TEST(property_set)
{
// Output argument returns error
- Efl_Future *future;
- Eina_Value dummy = {0};
+ Eina_Future *future;
+ Eina_Value dummy = EINA_VALUE_EMPTY;
+
future = efl_model_property_set(method, ARGUMENT_RESULT, &dummy);
- check_efl_model_future_error(future, NULL);
+ eina_future_then(future, _expected_error, NULL);
}
-END_TEST
+EFL_END_TEST
static void
_test_method_children_count(Eo *efl_model)
@@ -93,38 +127,41 @@ _test_method_children_count(Eo *efl_model)
check_efl_model_children_count_eq(efl_model, 0);
}
-START_TEST(children_count)
+EFL_START_TEST(children_count)
{
_test_method_children_count(method);
}
-END_TEST
+EFL_END_TEST
-START_TEST(children_slice_get)
+EFL_START_TEST(children_slice_get)
{
- Efl_Future *future;
+ Eina_Future *future;
+
future = efl_model_children_slice_get(method, 1, 1);
- check_efl_model_future_error(future, &EFL_MODEL_ERROR_NOT_SUPPORTED);
+ eina_future_then(future, _expected_error, &EFL_MODEL_ERROR_NOT_SUPPORTED);
+
+ ecore_main_loop_begin();
}
-END_TEST
+EFL_END_TEST
-START_TEST(child_add)
+EFL_START_TEST(child_add)
{
Eo *child;
child = efl_model_child_add(method);
ck_assert_ptr_eq(NULL, child);
}
-END_TEST
+EFL_END_TEST
-START_TEST(child_del)
+EFL_START_TEST(child_del)
{
// efl_model_child_del always returns ERROR
Eo *child = NULL;
efl_model_child_del(method, child);
//ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status);
}
-END_TEST
+EFL_END_TEST
-START_TEST(call)
+EFL_START_TEST(call)
{
check_efl_model_property_int_set(method, ARGUMENT_A, 12345678);
check_efl_model_property_int_set(method, ARGUMENT_B, 87654321);
@@ -134,7 +171,7 @@ START_TEST(call)
efl_model_wait_for_event(method, ELDBUS_MODEL_METHOD_EVENT_SUCCESSFUL_CALL);
check_efl_model_property_int_eq(method, ARGUMENT_RESULT, 99999999);
}
-END_TEST
+EFL_END_TEST
void eldbus_test_eldbus_model_method(TCase *tc)
{
diff --git a/src/tests/eldbus/eldbus_test_eldbus_model_object.c b/src/tests/eldbus/eldbus_test_eldbus_model_object.c
index ab4ae48590..c0a9d7cef9 100644
--- a/src/tests/eldbus/eldbus_test_eldbus_model_object.c
+++ b/src/tests/eldbus/eldbus_test_eldbus_model_object.c
@@ -18,18 +18,16 @@ static Eo *object = NULL;
static void
_setup(void)
{
- check_init();
object = create_object();
}
static void
_teardown(void)
{
- efl_unref(object);
- check_shutdown();
+ efl_del(object);
}
-START_TEST(properties_get)
+EFL_START_TEST(properties_get)
{
const Eina_Array *properties = NULL;
properties = efl_model_properties_get(object);
@@ -39,39 +37,66 @@ START_TEST(properties_get)
unsigned int actual_properties_count = eina_array_count(properties);
ck_assert_int_eq(expected_properties_count, actual_properties_count);
}
-END_TEST
+EFL_END_TEST
-START_TEST(property_get)
+EFL_START_TEST(property_get)
{
- Efl_Future *future;
- future = efl_model_property_get(object, UNIQUE_NAME_PROPERTY);
- efl_model_future_then(future);
+ Eina_Value *v;
+
+ v = efl_model_property_get(object, UNIQUE_NAME_PROPERTY);
+ fail_if(v == NULL);
+ fail_if(eina_value_type_get(v) == EINA_VALUE_TYPE_ERROR);
+ eina_value_free(v);
// Nonexistent property must raise ERROR
- future = NULL;
- future = efl_model_property_get(object, "nonexistent");
- check_efl_model_future_error(future, &EFL_MODEL_ERROR_NOT_FOUND);
+ v = efl_model_property_get(object, "nonexistent");
+ fail_if(v == NULL);
+ fail_if(eina_value_type_get(v) != EINA_VALUE_TYPE_ERROR);
+ eina_value_free(v);
+}
+EFL_END_TEST
+
+static Eina_Value
+_expect_error(void *data, const Eina_Value v, const Eina_Future *dead_future EINA_UNUSED)
+{
+ Eina_Error *expected = data;
+ Eina_Error result = 0;
+
+ fail_if(eina_value_type_get(&v) != EINA_VALUE_TYPE_ERROR);
+
+ if (!expected) return v;
+
+ eina_value_error_get(&v, &result);
+ fail_if(result != *expected);
+
+ ecore_main_loop_quit();
+
+ return v;
}
-END_TEST
-START_TEST(property_set)
+EFL_START_TEST(property_set)
{
- Eina_Value value;
- Efl_Future *future;
+ Eina_Future *future;
+ Eina_Value value = EINA_VALUE_EMPTY;
// Nonexistent property must raise ERROR
eina_value_setup(&value, EINA_VALUE_TYPE_INT);
eina_value_set(&value, 1);
+
future = efl_model_property_set(object, "nonexistent", &value);
- check_efl_model_future_error(future, &EFL_MODEL_ERROR_NOT_FOUND);
+ eina_future_then(future, _expect_error, &EFL_MODEL_ERROR_NOT_FOUND);
+
+ ecore_main_loop_begin();
// UNIQUE_NAME_PROPERTY is read-only
future = efl_model_property_set(object, UNIQUE_NAME_PROPERTY, &value);
- check_efl_model_future_error(future, &EFL_MODEL_ERROR_READ_ONLY);
+ eina_future_then(future, _expect_error, &EFL_MODEL_ERROR_READ_ONLY);
+
+ ecore_main_loop_begin();
eina_value_flush(&value);
}
-END_TEST
+EFL_END_TEST
static void
_test_children_count(Eo *efl_model)
@@ -80,55 +105,108 @@ _test_children_count(Eo *efl_model)
check_efl_model_children_count_ge(efl_model, 2);
}
-START_TEST(children_count)
+static Eina_Value
+_leave(void *data EINA_UNUSED, const Eina_Value v,
+ const Eina_Future *dead EINA_UNUSED)
+{
+ ecore_main_loop_quit();
+
+ return v;
+}
+
+static void
+_count_changed(void *data EINA_UNUSED, const Efl_Event *ev)
+{
+ Eina_Future *f;
+
+ f = efl_loop_job(efl_provider_find(ev->object, EFL_LOOP_CLASS));
+ eina_future_then(f, _leave, NULL);
+}
+
+EFL_START_TEST(children_count)
{
+ efl_event_callback_add(object, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, _count_changed, NULL);
+ efl_model_children_count_get(object);
+
+ ecore_main_loop_begin();
+
_test_children_count(object);
}
-END_TEST
+EFL_END_TEST
-START_TEST(children_slice_get)
+EFL_START_TEST(children_slice_get)
{
+ efl_event_callback_add(object, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, _count_changed, NULL);
+ efl_model_children_count_get(object);
+
+ ecore_main_loop_begin();
+
check_efl_model_children_slice_get(object);
}
-END_TEST
+EFL_END_TEST
-START_TEST(child_add)
+EFL_START_TEST(child_add)
{
Eo *child;
child = efl_model_child_add(object);
ck_assert_ptr_eq(NULL, child);
}
-END_TEST
+EFL_END_TEST
+
+#if 0
+static Eina_Value
+_one_child(void *data, const Eina_Value v, const Eina_Future *dead_future EINA_UNUSED)
+{
+ Eo **child = data;
+
+ fail_if(eina_value_type_get(&v) != EINA_VALUE_TYPE_ARRAY);
+ fail_if(eina_value_array_count(&v) != 1);
+ eina_value_array_get(&v, 0, &child);
+
+ ecore_main_loop_quit();
+
+ return v;
+}
-START_TEST(child_del)
+// FIXME: I don't know what the expected behavior for destroying a child of eldbus model object should be
+EFL_START_TEST(child_del)
{
+ Eina_Future *future;
+ Eo *child = NULL;
unsigned int expected_children_count = 0;
- Efl_Future *future;
- future = efl_model_children_count_get(object);
- ck_assert_ptr_ne(NULL, future);
- expected_children_count = efl_model_future_then_u(future);
- ck_assert_msg(expected_children_count, "There must be at least 1 child to test");
+ unsigned int actual_children_count = 0;
+
+ efl_event_callback_add(object, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, _count_changed, NULL);
+ efl_model_children_count_get(object);
+
+ ecore_main_loop_begin();
+
+ expected_children_count = efl_model_children_count_get(object);
- Eo *child = efl_model_first_child_get(object);
+ fail_if(expected_children_count == 0);
+
+ future = efl_model_children_slice_get(object, 0, 1);
+ eina_future_then(future, _one_child, &child);
+
+ ecore_main_loop_begin();
+
+ fail_if(!child);
efl_model_child_del(object, child);
- future = NULL;
- unsigned int actual_children_count = 0;
- future = efl_model_children_count_get(object);
- ck_assert_ptr_ne(NULL, future);
- actual_children_count = efl_model_future_then_u(future);
+ actual_children_count = efl_model_children_count_get(object);
ck_assert_int_le(expected_children_count, actual_children_count);
}
-END_TEST
+EFL_END_TEST
+#endif
void eldbus_test_eldbus_model_object(TCase *tc)
{
tcase_add_checked_fixture(tc, _setup, _teardown);
- /* tcase_add_test(tc, properties_get); */
- /* tcase_add_test(tc, property_get); */
- /* tcase_add_test(tc, property_set); */
- /* tcase_add_test(tc, children_count); */
+ tcase_add_test(tc, properties_get);
+ tcase_add_test(tc, property_get);
+ tcase_add_test(tc, property_set);
+ tcase_add_test(tc, children_count);
tcase_add_test(tc, children_slice_get);
tcase_add_test(tc, child_add);
- tcase_add_test(tc, child_del);
+ /* tcase_add_test(tc, child_del); */
}
diff --git a/src/tests/eldbus/eldbus_test_eldbus_model_proxy.c b/src/tests/eldbus/eldbus_test_eldbus_model_proxy.c
index fb984e6886..4e2b8ecc0d 100644
--- a/src/tests/eldbus/eldbus_test_eldbus_model_proxy.c
+++ b/src/tests/eldbus/eldbus_test_eldbus_model_proxy.c
@@ -14,12 +14,34 @@
static Eo *dbus_object1 = NULL;
static Eo *dbus_proxy = NULL;
+static Eina_Value
+_leave(void *data EINA_UNUSED, const Eina_Value v,
+ const Eina_Future *dead EINA_UNUSED)
+{
+ ecore_main_loop_quit();
+
+ return v;
+}
+
+static void
+_count_changed(void *data EINA_UNUSED, const Efl_Event *ev)
+{
+ Eina_Future *f;
+
+ f = efl_loop_job(efl_provider_find(ev->object, EFL_LOOP_CLASS));
+ eina_future_then(f, _leave, NULL);
+}
+
static void
_setup(void)
{
- check_init();
dbus_object1 = create_object();
+ efl_event_callback_add(dbus_object1, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, _count_changed, NULL);
+ efl_model_children_count_get(dbus_object1);
+
+ ecore_main_loop_begin();
+
dbus_proxy = eldbus_model_proxy_from_object_get(dbus_object1, ELDBUS_FDO_INTERFACE);
ck_assert_ptr_ne(NULL, dbus_proxy);
}
@@ -27,11 +49,10 @@ _setup(void)
static void
_teardown(void)
{
- efl_unref(dbus_object1);
- check_shutdown();
+ efl_del(dbus_object1);
}
-START_TEST(properties_get)
+EFL_START_TEST(properties_get)
{
const Eina_Array *properties = NULL;
// ELDBUS_FDO_INTERFACE have no properties
@@ -43,21 +64,28 @@ START_TEST(properties_get)
// properties contains 2 properties, "Interfaces" and "Features".
//ck_assert_int_eq(0, eina_array_count(properties));
}
-END_TEST
+EFL_END_TEST
-START_TEST(property_get)
+EFL_START_TEST(property_get)
{
// Nonexistent property must return ERROR
- Efl_Future *future;
- future = efl_model_property_get(dbus_proxy, "nonexistent");
- check_efl_model_future_error(future, &EFL_MODEL_ERROR_NOT_FOUND);
+ Eina_Value *value;
+ Eina_Error err = 0;
+
+ value = efl_model_property_get(dbus_proxy, "nonexistent");
+
+ fail_if(eina_value_type_get(value) != EINA_VALUE_TYPE_ERROR);
+ eina_value_error_get(value, &err);
+ fail_if(err != EFL_MODEL_ERROR_NOT_FOUND);
+
+ eina_value_free(value);
}
-END_TEST
+EFL_END_TEST
-START_TEST(property_set)
+EFL_START_TEST(property_set)
{
Eina_Value value;
- Efl_Future *future;
+ Eina_Future *future;
// Nonexistent property must return ERROR
eina_value_setup(&value, EINA_VALUE_TYPE_INT);
@@ -66,53 +94,65 @@ START_TEST(property_set)
check_efl_model_future_error(future, &EFL_MODEL_ERROR_NOT_FOUND);
eina_value_flush(&value);
}
-END_TEST
+EFL_END_TEST
static void
_test_dbus_proxy_children_count(Eo *efl_model)
{
+ efl_event_callback_add(efl_model, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, _count_changed, NULL);
+ efl_model_children_count_get(efl_model);
+
+ ecore_main_loop_begin();
+
// 'org.freedesktop.DBus::AddMatch' and 'org.freedesktop.DBus::ListNames' at least
check_efl_model_children_count_ge(efl_model, 2);
}
-START_TEST(children_count)
+EFL_START_TEST(children_count)
{
_test_dbus_proxy_children_count(dbus_proxy);
}
-END_TEST
+EFL_END_TEST
-START_TEST(children_slice_get)
+EFL_START_TEST(children_slice_get)
{
+ efl_event_callback_add(dbus_proxy, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, _count_changed, NULL);
+ efl_model_children_count_get(dbus_proxy);
+
+ ecore_main_loop_begin();
+
check_efl_model_children_slice_get(dbus_proxy);
}
-END_TEST
+EFL_END_TEST
-START_TEST(child_add)
+EFL_START_TEST(child_add)
{
Eo *child;
child = efl_model_child_add(dbus_proxy);
ck_assert_ptr_eq(NULL, child);
}
-END_TEST
+EFL_END_TEST
-START_TEST(child_del)
+#if 0
+EFL_START_TEST(child_del)
{
+ Eina_Future *future;
+ Eo *child;
unsigned int expected_children_count = 0;
- Efl_Future *future;
- future = efl_model_children_count_get(dbus_proxy);
+ unsigned int actual_children_count = 0;
+
+ expected_children_count = efl_model_children_count_get(dbus_proxy);
ck_assert_ptr_ne(NULL, future);
- expected_children_count = efl_model_future_then_u(future);
- Eo *child = efl_model_first_child_get(dbus_proxy);
+ child = efl_model_first_child_get(dbus_proxy);
efl_model_child_del(dbus_proxy, child);
- unsigned int actual_children_count = 0;
- future = efl_model_children_count_get(dbus_proxy);
- actual_children_count = efl_model_future_then_u(future);
+ actual_children_count = efl_model_children_count_get(dbus_proxy);
ck_assert_int_le(expected_children_count, actual_children_count);
}
-END_TEST
+EFL_END_TEST
+#endif
void eldbus_test_eldbus_model_proxy(TCase *tc)
{
@@ -123,5 +163,5 @@ void eldbus_test_eldbus_model_proxy(TCase *tc)
tcase_add_test(tc, children_count);
tcase_add_test(tc, children_slice_get);
tcase_add_test(tc, child_add);
- tcase_add_test(tc, child_del);
+ /* tcase_add_test(tc, child_del); */
}
diff --git a/src/tests/eldbus/eldbus_test_eldbus_model_signal.c b/src/tests/eldbus/eldbus_test_eldbus_model_signal.c
index 87a01df3e6..f896792bf6 100644
--- a/src/tests/eldbus/eldbus_test_eldbus_model_signal.c
+++ b/src/tests/eldbus/eldbus_test_eldbus_model_signal.c
@@ -23,11 +23,14 @@ static Eo *pong_signal = NULL;
static void
_setup(void)
{
- check_init();
-
- fake_server = fake_server_start(&fake_server_data);
-
- fake_server_object = efl_add(ELDBUS_MODEL_OBJECT_CLASS, efl_main_loop_get(), eldbus_model_object_constructor(efl_added, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE, FAKE_SERVER_BUS, FAKE_SERVER_PATH));
+ char buf[1024];
+ snprintf(buf, sizeof(buf), FAKE_SERVER_BUS ".%s", basename(__FILE__));
+ fake_server = fake_server_start(&fake_server_data, buf);
+
+ fake_server_object = efl_add(ELDBUS_MODEL_OBJECT_CLASS, efl_main_loop_get(),
+ eldbus_model_connect(efl_added, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE),
+ eldbus_model_object_bus_set(efl_added, buf),
+ eldbus_model_object_path_set(efl_added, FAKE_SERVER_PATH));
ck_assert_ptr_ne(NULL, fake_server_object);
fake_server_proxy = eldbus_model_proxy_from_object_get(fake_server_object, FAKE_SERVER_INTERFACE);
@@ -40,14 +43,13 @@ _setup(void)
static void
_teardown(void)
{
- efl_unref(fake_server_object);
+ efl_del(fake_server_object);
fake_server_stop(fake_server);
- check_shutdown();
}
-START_TEST(properties_get)
+EFL_START_TEST(properties_get)
{
const Eina_Array *properties = NULL;
properties = efl_model_properties_get(pong_signal);
@@ -57,30 +59,37 @@ START_TEST(properties_get)
const unsigned int actual_properties_count = eina_array_count(properties);
ck_assert_int_eq(expected_properties_count, actual_properties_count);
}
-END_TEST
+EFL_END_TEST
-START_TEST(property_get)
+EFL_START_TEST(property_get)
{
+ Eina_Value *value;
+ Eina_Error err;
+
// Signal properties always have output direction
- Efl_Future *future;
- future = efl_model_property_get(pong_signal, ARGUMENT_A);
- efl_model_future_then(future);
+ value = efl_model_property_get(pong_signal, ARGUMENT_A);
+ fail_if(value == NULL);
// Nonexistent property must return ERROR
- future = efl_model_property_get(pong_signal, "nonexistent");
- check_efl_model_future_error(future, &EFL_MODEL_ERROR_NOT_FOUND);
+ value = efl_model_property_get(pong_signal, "nonexistent");
+ fail_if(value == NULL);
+ fail_if(eina_value_type_get(value) != EINA_VALUE_TYPE_ERROR);
+
+ eina_value_error_get(value, &err);
+ fail_if(err != EFL_MODEL_ERROR_NOT_FOUND);
}
-END_TEST
+EFL_END_TEST
-START_TEST(property_set)
+EFL_START_TEST(property_set)
{
// Signals have output arguments only. All returns error
- Efl_Future *future;
- Eina_Value dummy = {0};
+ Eina_Value dummy = EINA_VALUE_EMPTY;
+ Eina_Future *future;
+
future = efl_model_property_set(pong_signal, ARGUMENT_A, &dummy);
check_efl_model_future_error(future, NULL);
}
-END_TEST
+EFL_END_TEST
static void
_test_signal_children_count(Eo *efl_model)
@@ -88,37 +97,38 @@ _test_signal_children_count(Eo *efl_model)
check_efl_model_children_count_eq(efl_model, 0);
}
-START_TEST(children_count)
+EFL_START_TEST(children_count)
{
_test_signal_children_count(pong_signal);
}
-END_TEST
+EFL_END_TEST
-START_TEST(children_slice_get)
+EFL_START_TEST(children_slice_get)
{
- Efl_Future *future;
+ Eina_Future *future;
+
future = efl_model_children_slice_get(pong_signal, 1, 1);
check_efl_model_future_error(future, &EFL_MODEL_ERROR_NOT_SUPPORTED);
}
-END_TEST
+EFL_END_TEST
-START_TEST(child_add)
+EFL_START_TEST(child_add)
{
Eo *child;
child = efl_model_child_add(pong_signal);
ck_assert_ptr_eq(NULL, child);
}
-END_TEST
+EFL_END_TEST
-START_TEST(child_del)
+EFL_START_TEST(child_del)
{
// efl_model_child_del always returns ERROR FIXME catch error
Eo *child = NULL;
efl_model_child_del(pong_signal, child);
}
-END_TEST
+EFL_END_TEST
-START_TEST(signals)
+EFL_START_TEST(signals)
{
Eldbus_Model_Method *ping_method = eldbus_model_method_from_proxy_get(fake_server_proxy, FAKE_SERVER_PING_METHOD_NAME);
ck_assert_ptr_ne(NULL, ping_method);
@@ -131,7 +141,7 @@ START_TEST(signals)
check_efl_model_property_int_eq(pong_signal, ARGUMENT_A, 100);
}
-END_TEST
+EFL_END_TEST
void eldbus_test_eldbus_model_signal(TCase *tc)
{
diff --git a/src/tests/eldbus/eldbus_test_eldbus_object.c b/src/tests/eldbus/eldbus_test_eldbus_object.c
index c679da4d8f..78991f7b1a 100644
--- a/src/tests/eldbus/eldbus_test_eldbus_object.c
+++ b/src/tests/eldbus/eldbus_test_eldbus_object.c
@@ -27,26 +27,9 @@ static int cb_data = 5;
* @defgroup eldbus_object
*
* @precondition
-* @step 1 Initialize ecore with ecore_init()
-* @step 2 Initialize eldbus with eldbus_init()
+* @step 1 Initialize eldbus with eldbus_init()
*/
-static void
-_setup(void)
-{
- ecore_init();
- int ret = eldbus_init();
- ck_assert_int_ge(ret, 1);
-}
-
-static void
-_teardown(void)
-{
- ecore_shutdown();
- int ret = eldbus_shutdown();
- ck_assert_int_eq(ret, 0);
-}
-
static Eina_Bool
_ecore_loop_close(void *data EINA_UNUSED)
{
@@ -201,11 +184,11 @@ _machine_id_get(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending E
* @}
*/
-START_TEST(utc_eldbus_object_send_info_get_p)
+EFL_START_TEST(utc_eldbus_object_send_info_get_p)
{
is_success = EINA_FALSE;
- Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
+ Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
ck_assert_ptr_ne(NULL, conn);
Eldbus_Object *obj = eldbus_object_get(conn, bus, path);
@@ -231,18 +214,16 @@ START_TEST(utc_eldbus_object_send_info_get_p)
Eldbus_Pending *pending = eldbus_object_send(obj, msg, _object_message_cb, &cb_data, -1);
ck_assert_ptr_ne(NULL, pending);
- timeout = ecore_timer_add(1.5, _ecore_loop_close, NULL);
+ timeout = ecore_timer_add(0.1, _ecore_loop_close, NULL);
ck_assert_ptr_ne(NULL, timeout);
ecore_main_loop_begin();
ck_assert_msg(is_success, "Method %s is not call", method_name);
- eldbus_message_unref(msg);
- eldbus_object_unref(obj);
eldbus_connection_unref(conn);
}
-END_TEST
+EFL_END_TEST
/**
* @addtogroup eldbus_object
@@ -275,11 +256,11 @@ END_TEST
* @}
*/
-START_TEST(utc_eldbus_introspect_p)
+EFL_START_TEST(utc_eldbus_introspect_p)
{
is_success = EINA_FALSE;
- Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
+ Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
ck_assert_ptr_ne(NULL, conn);
Eldbus_Object *obj = eldbus_object_get(conn, bus, path);
@@ -288,7 +269,7 @@ START_TEST(utc_eldbus_introspect_p)
Eldbus_Pending *pending = eldbus_object_introspect(obj, _object_message_cb, &cb_data);
ck_assert_ptr_ne(NULL, pending);
- timeout = ecore_timer_add(1.0, _ecore_loop_close, NULL);
+ timeout = ecore_timer_add(0.1, _ecore_loop_close, NULL);
ck_assert_ptr_ne(NULL, timeout);
ecore_main_loop_begin();
@@ -298,7 +279,7 @@ START_TEST(utc_eldbus_introspect_p)
eldbus_object_unref(obj);
eldbus_connection_unref(conn);
}
-END_TEST
+EFL_END_TEST
/**
* @addtogroup eldbus_object
@@ -349,10 +330,10 @@ END_TEST
* @}
* @}
*/
-START_TEST(utc_eldbus_object_peer_p)
+EFL_START_TEST(utc_eldbus_object_peer_p)
{
const char *dbus_path = "/org/freedesktop/Test";
- const char *bus_session = "org.freedesktop.Test";
+ const char *bus_session = "org.freedesktop.Test.utc_eldbus_object_peer_p";
is_success = EINA_FALSE;
is_register_service = EINA_FALSE;
@@ -380,7 +361,7 @@ START_TEST(utc_eldbus_object_peer_p)
Eldbus_Pending *pending2 = eldbus_object_peer_ping(obj, _peer_ping_cb, &cb_data);
ck_assert_ptr_ne(NULL, pending2);
- timeout = ecore_timer_add(2.5, _ecore_loop_close, NULL);
+ timeout = ecore_timer_add(0.15, _ecore_loop_close, NULL);
ck_assert_ptr_ne(NULL, timeout);
ecore_main_loop_begin();
@@ -394,7 +375,7 @@ START_TEST(utc_eldbus_object_peer_p)
eldbus_service_interface_unregister(iface);
eldbus_connection_unref(conn_server);
}
-END_TEST
+EFL_END_TEST
/**
*@}
@@ -402,7 +383,6 @@ END_TEST
void
eldbus_test_eldbus_object(TCase *tc)
{
- tcase_add_checked_fixture(tc, _setup, _teardown);
tcase_add_test(tc, utc_eldbus_object_send_info_get_p);
tcase_add_test(tc, utc_eldbus_introspect_p);
tcase_add_test(tc, utc_eldbus_object_peer_p);
diff --git a/src/tests/eldbus/eldbus_test_eldbus_pending_cancel.c b/src/tests/eldbus/eldbus_test_eldbus_pending_cancel.c
index d0aff791cf..f82743b1ca 100644
--- a/src/tests/eldbus/eldbus_test_eldbus_pending_cancel.c
+++ b/src/tests/eldbus/eldbus_test_eldbus_pending_cancel.c
@@ -30,25 +30,9 @@ const char *member = "GetId";
* @li eldbus_pending_path_get()
*
* @precondition
-* @step 1 Initialize ecore with ecore_init()
-* @step 2 Initialize eldbus with eldbus_init()
+* @step 1 Initialize eldbus with eldbus_init()
*/
-static void
-_setup(void)
-{
- ecore_init();
- int ret = eldbus_init();
- ck_assert_int_ge(ret, 1);
-}
-
-static void
-_teardown(void)
-{
- eldbus_shutdown();
- ecore_shutdown();
-}
-
static Eina_Bool
_ecore_loop_close(void *data EINA_UNUSED)
{
@@ -58,7 +42,7 @@ _ecore_loop_close(void *data EINA_UNUSED)
}
static void
-_response_message_cb(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
+_response_message_cb(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
if (timeout != NULL)
{
@@ -115,7 +99,7 @@ _pending_connection_get()
{
const int send_timeout_ms = 500;
- conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
+ conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
if (!conn)
{
return NULL;
@@ -131,7 +115,6 @@ _pending_connection_get()
message = eldbus_object_method_call_new(obj, interface, member);
if (!message)
{
- eldbus_object_unref(obj);
eldbus_connection_unref(conn);
return NULL;
}
@@ -139,8 +122,6 @@ _pending_connection_get()
Eldbus_Pending *pending = eldbus_connection_send(conn, message, _response_message_cb, NULL, send_timeout_ms);
if (!pending)
{
- eldbus_message_unref(message);
- eldbus_object_unref(obj);
eldbus_connection_unref(conn);
return NULL;
}
@@ -180,29 +161,26 @@ _pending_connection_get()
* @}
*/
-START_TEST(utc_eldbus_pending_info_get_cancel_p)
+EFL_START_TEST(utc_eldbus_pending_info_get_cancel_p)
{
Eldbus_Pending *pending = _pending_connection_get();
ck_assert_ptr_ne(NULL, pending);
eldbus_pending_cancel(pending);
- timeout = ecore_timer_add(1.5, _ecore_loop_close, NULL);
+ timeout = ecore_timer_add(0.1, _ecore_loop_close, NULL);
ck_assert_ptr_ne(NULL, timeout);
ecore_main_loop_begin();
ck_assert(is_success_cb == EINA_TRUE);
- eldbus_message_unref(message);
- eldbus_object_unref(obj);
eldbus_connection_unref(conn);
}
-END_TEST
+EFL_END_TEST
void
eldbus_test_eldbus_pending_cancel(TCase *tc)
{
- tcase_add_checked_fixture(tc, _setup, _teardown);
tcase_add_test(tc, utc_eldbus_pending_info_get_cancel_p);
-} \ No newline at end of file
+}
diff --git a/src/tests/eldbus/eldbus_test_eldbus_pending_data.c b/src/tests/eldbus/eldbus_test_eldbus_pending_data.c
index 0428535ac4..e10af32eb8 100644
--- a/src/tests/eldbus/eldbus_test_eldbus_pending_data.c
+++ b/src/tests/eldbus/eldbus_test_eldbus_pending_data.c
@@ -27,25 +27,9 @@ static Eldbus_Message *message = NULL;
* @li eldbus_pending_data_del()
*
* @precondition
-* @step 1 Initialize ecore with ecore_init()
-* @step 2 Initialize eldbus with eldbus_init()
+* @step 1 Initialize eldbus with eldbus_init()
*/
-static void
-_setup(void)
-{
- ecore_init();
- int ret = eldbus_init();
- ck_assert_int_ge(ret, 1);
-}
-
-static void
-_teardown(void)
-{
- eldbus_shutdown();
- ecore_shutdown();
-}
-
static Eina_Bool
_ecore_loop_close(void *data EINA_UNUSED)
{
@@ -118,7 +102,7 @@ _response_message_cb(void *data EINA_UNUSED, const Eldbus_Message *msg EINA_UNUS
* @}
*/
-START_TEST(utc_eldbus_pending_data_p)
+EFL_START_TEST(utc_eldbus_pending_data_p)
{
const char *bus = "org.freedesktop.DBus";
const char *path = "/org/freedesktop/DBus";
@@ -126,7 +110,7 @@ START_TEST(utc_eldbus_pending_data_p)
const char *member = "GetId";
const int send_timeout_ms = 500;
- conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
+ conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
ck_assert_ptr_ne(NULL, conn);
obj = eldbus_object_get(conn, bus, path);
@@ -140,7 +124,7 @@ START_TEST(utc_eldbus_pending_data_p)
eldbus_pending_data_set(pending, pending_key_store, &pending_data_stored);
- timeout = ecore_timer_add(1.5, _ecore_loop_close, NULL);
+ timeout = ecore_timer_add(0.1, _ecore_loop_close, NULL);
ck_assert_ptr_ne(NULL, timeout);
ecore_main_loop_begin();
@@ -151,11 +135,10 @@ START_TEST(utc_eldbus_pending_data_p)
eldbus_object_unref(obj);
eldbus_connection_unref(conn);
}
-END_TEST
+EFL_END_TEST
void
eldbus_test_eldbus_pending_data(TCase *tc)
{
- tcase_add_checked_fixture(tc, _setup, _teardown);
tcase_add_test(tc, utc_eldbus_pending_data_p);
}
diff --git a/src/tests/eldbus/eldbus_test_eldbus_proxy.c b/src/tests/eldbus/eldbus_test_eldbus_proxy.c
index 2fdf06f3eb..f8fda91c5a 100644
--- a/src/tests/eldbus/eldbus_test_eldbus_proxy.c
+++ b/src/tests/eldbus/eldbus_test_eldbus_proxy.c
@@ -29,25 +29,9 @@ static int proxy_data_stored = 5;
* @defgroup eldbus_proxy
*
* @preconditio
-* @step 1 Initialize ecore with ecore_init()
-* @step 2 Initialize eldbus with eldbus_init()
+* @step 1 Initialize eldbus with eldbus_init()
*/
-static void
-_setup(void)
-{
- ecore_init();
- int ret = eldbus_init();
- ck_assert_int_ge(ret, 1);
-}
-
-static void
-_teardown(void)
-{
- eldbus_shutdown();
- ecore_shutdown();
-}
-
static Eina_Bool
_ecore_loop_close(void *data EINA_UNUSED)
{
@@ -134,11 +118,11 @@ _proxy_message_cb(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending
* @}
*/
-START_TEST(utc_eldbus_proxy_info_get_call_p)
+EFL_START_TEST(utc_eldbus_proxy_info_get_call_p)
{
is_success = EINA_FALSE;
- Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
+ Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
ck_assert_ptr_ne(NULL, conn);
Eldbus_Object *obj = eldbus_object_get(conn, bus, path);
@@ -162,7 +146,7 @@ START_TEST(utc_eldbus_proxy_info_get_call_p)
Eldbus_Pending *pending = eldbus_proxy_call(proxy, method_name, _proxy_message_cb, &cb_data, -1, empty_string);
ck_assert_ptr_ne(NULL, pending);
- timeout = ecore_timer_add(1.5, _ecore_loop_close, NULL);
+ timeout = ecore_timer_add(0.1, _ecore_loop_close, NULL);
ck_assert_ptr_ne(NULL, timeout);
ecore_main_loop_begin();
@@ -173,7 +157,7 @@ START_TEST(utc_eldbus_proxy_info_get_call_p)
eldbus_object_unref(obj);
eldbus_connection_unref(conn);
}
-END_TEST
+EFL_END_TEST
/**
* @addtogroup eldbus_proxy
@@ -216,11 +200,11 @@ END_TEST
* @}
*/
-START_TEST(utc_eldbus_proxy_send_call_p)
+EFL_START_TEST(utc_eldbus_proxy_send_call_p)
{
is_success = EINA_FALSE;
- Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
+ Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
ck_assert_ptr_ne(NULL, conn);
Eldbus_Object *obj = eldbus_object_get(conn, bus, path);
@@ -235,19 +219,18 @@ START_TEST(utc_eldbus_proxy_send_call_p)
Eldbus_Pending *pending = eldbus_proxy_send(proxy, msg, _proxy_message_cb, &cb_data, -1);
ck_assert_ptr_ne(NULL, pending);
- timeout = ecore_timer_add(1.5, _ecore_loop_close, NULL);
+ timeout = ecore_timer_add(0.1, _ecore_loop_close, NULL);
ck_assert_ptr_ne(NULL, timeout);
ecore_main_loop_begin();
ck_assert_msg(is_success, "Method GetId is not call");
- eldbus_message_unref(msg);
eldbus_proxy_unref(proxy);
eldbus_object_unref(obj);
eldbus_connection_unref(conn);
}
-END_TEST
+EFL_END_TEST
/**
* @addtogroup eldbus_proxy
@@ -287,14 +270,14 @@ END_TEST
* @}
*/
-START_TEST(utc_eldbus_proxy_send_and_block_p)
+EFL_START_TEST(utc_eldbus_proxy_send_and_block_p)
{
const int timeout = 1000;
is_success = EINA_FALSE;
const char *errname, *errmsg;
char *text_reply = NULL;
- Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
+ Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
ck_assert_ptr_ne(NULL, conn);
Eldbus_Object *obj = eldbus_object_get(conn, bus, path);
@@ -326,12 +309,11 @@ START_TEST(utc_eldbus_proxy_send_and_block_p)
ck_assert_str_ne(text_reply, empty_string);
eldbus_message_unref(message_reply);
- eldbus_message_unref(msg);
eldbus_proxy_unref(proxy);
eldbus_object_unref(obj);
eldbus_connection_unref(conn);
}
-END_TEST
+EFL_END_TEST
/**
* @addtogroup eldbus_proxy
@@ -373,11 +355,11 @@ END_TEST
* @}
*/
-START_TEST(utc_eldbus_proxy_data_p)
+EFL_START_TEST(utc_eldbus_proxy_data_p)
{
is_success = EINA_FALSE;
- Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
+ Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
ck_assert_ptr_ne(NULL, conn);
Eldbus_Object *obj = eldbus_object_get(conn, bus, path);
@@ -403,7 +385,7 @@ START_TEST(utc_eldbus_proxy_data_p)
eldbus_object_unref(obj);
eldbus_connection_unref(conn);
}
-END_TEST
+EFL_END_TEST
/**
*@}
@@ -411,9 +393,8 @@ END_TEST
void
eldbus_test_eldbus_proxy(TCase *tc)
{
- tcase_add_checked_fixture(tc, _setup, _teardown);
tcase_add_test(tc, utc_eldbus_proxy_info_get_call_p);
tcase_add_test(tc, utc_eldbus_proxy_send_call_p);
tcase_add_test(tc, utc_eldbus_proxy_send_and_block_p);
tcase_add_test(tc, utc_eldbus_proxy_data_p);
-} \ No newline at end of file
+}
diff --git a/src/tests/eldbus/eldbus_test_eldbus_signal_handler.c b/src/tests/eldbus/eldbus_test_eldbus_signal_handler.c
index 255dd97d2e..5e9bfc5600 100644
--- a/src/tests/eldbus/eldbus_test_eldbus_signal_handler.c
+++ b/src/tests/eldbus/eldbus_test_eldbus_signal_handler.c
@@ -23,26 +23,9 @@ static Ecore_Timer *timeout = NULL;
* @defgroup eldbus_signal_handler
*
* @precondition
-* @step 1 Initialize ecore with ecore_init()
-* @step 2 Initialize eldbus with eldbus_init()
+* @step 1 Initialize eldbus with eldbus_init()
*/
-static void
-_setup(void)
-{
- ecore_init();
- int ret = eldbus_init();
- ck_assert_int_ge(ret, 1);
-}
-
-static void
-_teardown(void)
-{
- ecore_shutdown();
- int ret = eldbus_shutdown();
- ck_assert_int_eq(ret, 0);
-}
-
static Eina_Bool
_ecore_loop_close(void *data EINA_UNUSED)
{
@@ -109,7 +92,7 @@ _signal_handler_get(Eldbus_Connection *conn)
return NULL;
}
- timeout = ecore_timer_add(1.5, _ecore_loop_close, NULL);
+ timeout = ecore_timer_add(0.1, _ecore_loop_close, NULL);
if (!timeout)
{
eldbus_signal_handler_unref(signal_handler);
@@ -154,11 +137,11 @@ _signal_handler_get(Eldbus_Connection *conn)
* @}
* @}
*/
-START_TEST(utc_eldbus_signal_handler_add_p)
+EFL_START_TEST(utc_eldbus_signal_handler_add_p)
{
is_success_cb = EINA_FALSE;
- Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
+ Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
ck_assert_ptr_ne(NULL, conn);
Eldbus_Signal_Handler *signal_handler = eldbus_signal_handler_add(conn, NULL, path, interface,
@@ -172,18 +155,17 @@ START_TEST(utc_eldbus_signal_handler_add_p)
Eldbus_Pending *pending = eldbus_connection_send(conn, msg, _response_message_cb, NULL, -1);
ck_assert_ptr_ne(NULL, pending);
- timeout = ecore_timer_add(1.5, _ecore_loop_close, NULL);
+ timeout = ecore_timer_add(0.1, _ecore_loop_close, NULL);
ck_assert_ptr_ne(NULL, timeout);
ecore_main_loop_begin();
ck_assert_msg(is_success_cb, "Signal %s is not call", signal_name);
- eldbus_message_unref(msg);
eldbus_signal_handler_unref(signal_handler);
eldbus_connection_unref(conn);
}
-END_TEST
+EFL_END_TEST
/**
* @addtogroup eldbus_signal_handler
@@ -221,11 +203,11 @@ END_TEST
* @}
* @}
*/
-START_TEST(utc_eldbus_signal_handler_del_p)
+EFL_START_TEST(utc_eldbus_signal_handler_del_p)
{
is_success_cb = EINA_FALSE;
- Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
+ Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
ck_assert_ptr_ne(NULL, conn);
Eldbus_Signal_Handler *signal_handler = eldbus_signal_handler_add(conn, NULL, path, interface,
@@ -241,18 +223,16 @@ START_TEST(utc_eldbus_signal_handler_del_p)
Eldbus_Pending *pending = eldbus_connection_send(conn, msg, _response_message_cb, NULL, -1);
ck_assert_ptr_ne(NULL, pending);
- timeout = ecore_timer_add(1.5, _ecore_loop_close, NULL);
+ timeout = ecore_timer_add(0.1, _ecore_loop_close, NULL);
ck_assert_ptr_ne(NULL, timeout);
ecore_main_loop_begin();
ck_assert_msg(!is_success_cb, "Signal %s was called", signal_name);
- eldbus_message_unref(msg);
- eldbus_signal_handler_unref(signal_handler);
eldbus_connection_unref(conn);
}
-END_TEST
+EFL_END_TEST
/**
* @addtogroup eldbus_signal_handler
@@ -290,9 +270,9 @@ END_TEST
* @}
* @}
*/
-START_TEST(utc_eldbus_signal_handler_get_p)
+EFL_START_TEST(utc_eldbus_signal_handler_get_p)
{
- Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
+ Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
ck_assert_ptr_ne(NULL, conn);
Eldbus_Signal_Handler *signal_handler = eldbus_signal_handler_add(conn, bus, path, interface,
@@ -321,7 +301,7 @@ START_TEST(utc_eldbus_signal_handler_get_p)
eldbus_signal_handler_unref(signal_handler);
eldbus_connection_unref(conn);
}
-END_TEST
+EFL_END_TEST
/**
* @addtogroup eldbus_signal_handler
@@ -362,11 +342,11 @@ END_TEST
* @}
*/
-START_TEST(utc_eldbus_signal_handler_ref_unref_p)
+EFL_START_TEST(utc_eldbus_signal_handler_ref_unref_p)
{
is_success_cb = EINA_FALSE;
- Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
+ Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
ck_assert_ptr_ne(NULL, conn);
Eldbus_Signal_Handler *signal_handler = eldbus_signal_handler_add(conn, NULL, path, interface,
@@ -385,17 +365,16 @@ START_TEST(utc_eldbus_signal_handler_ref_unref_p)
Eldbus_Pending *pending = eldbus_connection_send(conn, msg, _response_message_cb, NULL, -1);
ck_assert_ptr_ne(NULL, pending);
- timeout = ecore_timer_add(1.5, _ecore_loop_close, NULL);
+ timeout = ecore_timer_add(0.1, _ecore_loop_close, NULL);
ck_assert_ptr_ne(NULL, timeout);
ecore_main_loop_begin();
ck_assert_msg(!is_success_cb, "Signal %s was called", signal_name);
- eldbus_message_unref(msg);
eldbus_connection_unref(conn);
}
-END_TEST
+EFL_END_TEST
/**
* @addtogroup eldbus_signal_handler
@@ -436,9 +415,9 @@ END_TEST
* @}
*/
-START_TEST(utc_eldbus_signal_handler_free_cb_add_del_p)
+EFL_START_TEST(utc_eldbus_signal_handler_free_cb_add_del_p)
{
- Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
+ Eldbus_Connection *conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
ck_assert_ptr_ne(NULL, conn);
Eldbus_Signal_Handler *signal_handler = _signal_handler_get(conn);
@@ -466,7 +445,7 @@ START_TEST(utc_eldbus_signal_handler_free_cb_add_del_p)
eldbus_connection_unref(conn);
}
-END_TEST
+EFL_END_TEST
/**
*@}
@@ -474,10 +453,9 @@ END_TEST
void
eldbus_test_eldbus_signal_handler(TCase *tc)
{
- tcase_add_checked_fixture(tc, _setup, _teardown);
tcase_add_test(tc, utc_eldbus_signal_handler_add_p);
tcase_add_test(tc, utc_eldbus_signal_handler_del_p);
tcase_add_test(tc, utc_eldbus_signal_handler_get_p);
tcase_add_test(tc, utc_eldbus_signal_handler_ref_unref_p);
tcase_add_test(tc, utc_eldbus_signal_handler_free_cb_add_del_p);
-} \ No newline at end of file
+}
diff --git a/src/tests/eldbus/eldbus_test_fake_server_eldbus_model_proxy.c b/src/tests/eldbus/eldbus_test_fake_server_eldbus_model_proxy.c
index 53626003d0..0cf6adc785 100644
--- a/src/tests/eldbus/eldbus_test_fake_server_eldbus_model_proxy.c
+++ b/src/tests/eldbus/eldbus_test_fake_server_eldbus_model_proxy.c
@@ -24,16 +24,19 @@ static Fake_Server_Data fake_server_data = {0};
static void
_setup(void)
{
- check_init();
-
fake_server_data = (Fake_Server_Data){
.readonly_property = FAKE_SERVER_READONLY_PROPERTY_VALUE,
.writeonly_property = FAKE_SERVER_WRITEONLY_PROPERTY_VALUE,
.readwrite_property = FAKE_SERVER_READWRITE_PROPERTY_VALUE
};
- fake_server = fake_server_start(&fake_server_data);
-
- fake_server_object = efl_add(ELDBUS_MODEL_OBJECT_CLASS, efl_main_loop_get(), eldbus_model_object_constructor(efl_added, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE, FAKE_SERVER_BUS, FAKE_SERVER_PATH));
+ char buf[1024];
+ snprintf(buf, sizeof(buf), FAKE_SERVER_BUS ".%s", basename(__FILE__));
+ fake_server = fake_server_start(&fake_server_data, buf);
+
+ fake_server_object = efl_add(ELDBUS_MODEL_OBJECT_CLASS, efl_main_loop_get(),
+ eldbus_model_connect(efl_added, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE),
+ eldbus_model_object_bus_set(efl_added, buf),
+ eldbus_model_object_path_set(efl_added, FAKE_SERVER_PATH));
ck_assert_ptr_ne(NULL, fake_server_object);
fake_server_proxy = eldbus_model_proxy_from_object_get(fake_server_object, FAKE_SERVER_INTERFACE);
@@ -45,37 +48,64 @@ _teardown(void)
efl_del(fake_server_object);
fake_server_stop(fake_server);
-
- check_shutdown();
}
-START_TEST(properties_get)
+EFL_START_TEST(properties_get)
{
const Eina_Array *properties = efl_model_properties_get(fake_server_proxy);
ck_assert_ptr_ne(NULL, properties);
- const unsigned int expected_properties_count = 3; // FAKE_SERVER_READONLY_PROPERTY, FAKE_SERVER_WRITEONLY_PROPERTY and FAKE_SERVER_READWRITE_PROPERTY properties
+ // FAKE_SERVER_READONLY_PROPERTY, FAKE_SERVER_WRITEONLY_PROPERTY and FAKE_SERVER_READWRITE_PROPERTY properties
+ const unsigned int expected_properties_count = 3;
const unsigned int actual_properties_count = eina_array_count(properties);
ck_assert_int_eq(expected_properties_count, actual_properties_count);
_teardown();
}
-END_TEST
+EFL_END_TEST
+
+static Eina_Future *f = NULL;
+
+static Eina_Value
+_leave(void *data EINA_UNUSED, const Eina_Value v,
+ const Eina_Future *dead EINA_UNUSED)
+{
+ ecore_main_loop_quit();
+ f = NULL;
+ return v;
+}
-START_TEST(property_get)
+static void
+_property_ready(void *data EINA_UNUSED, const Efl_Event *ev)
{
+ if (f) return ;
+ f = efl_loop_job(efl_provider_find(ev->object, EFL_LOOP_CLASS));
+ eina_future_then(f, _leave, NULL);
+}
+
+EFL_START_TEST(property_get)
+{
+ Eina_Value *value;
+
+ efl_event_callback_add(fake_server_proxy, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _property_ready, NULL);
+ value = efl_model_property_get(fake_server_proxy, FAKE_SERVER_READONLY_PROPERTY);
+ eina_value_free(value);
+ value = efl_model_property_get(fake_server_proxy, FAKE_SERVER_READWRITE_PROPERTY);
+ eina_value_free(value);
+
+ ecore_main_loop_begin();
+
check_efl_model_property_int_eq(fake_server_proxy, FAKE_SERVER_READONLY_PROPERTY, FAKE_SERVER_READONLY_PROPERTY_VALUE);
check_efl_model_property_int_eq(fake_server_proxy, FAKE_SERVER_READWRITE_PROPERTY, FAKE_SERVER_READWRITE_PROPERTY_VALUE);
// Write-only property returns error
- Efl_Future *future;
- future = efl_model_property_get(fake_server_proxy, FAKE_SERVER_WRITEONLY_PROPERTY);
- (void)future;
+ value = efl_model_property_get(fake_server_proxy, FAKE_SERVER_WRITEONLY_PROPERTY);
+ eina_value_free(value);
//ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status);
_teardown();
}
-END_TEST
+EFL_END_TEST
static void
_check_property_set(const char *property_name, int expected_property_value, int *actual_property_value)
@@ -91,20 +121,21 @@ _check_property_set(const char *property_name, int expected_property_value, int
ck_assert_int_eq(expected_property_value, *actual_property_value);
}
-START_TEST(property_set)
+EFL_START_TEST(property_set)
{
+ Eina_Future *future;
+ Eina_Value dummy = EINA_VALUE_EMPTY;
+
_check_property_set(FAKE_SERVER_WRITEONLY_PROPERTY, 0x12345678, &fake_server_data.writeonly_property);
_check_property_set(FAKE_SERVER_READWRITE_PROPERTY, 0x76543210, &fake_server_data.readwrite_property);
// Read-only property returns error
- Efl_Future *future;
- Eina_Value dummy = {0};
future = efl_model_property_set(fake_server_proxy, FAKE_SERVER_READONLY_PROPERTY, &dummy);
check_efl_model_future_error(future, &EFL_MODEL_ERROR_READ_ONLY);
_teardown();
}
-END_TEST
+EFL_END_TEST
static void
_test_fake_server_proxy_children_count(Eo *efl_model)
@@ -113,23 +144,23 @@ _test_fake_server_proxy_children_count(Eo *efl_model)
check_efl_model_children_count_eq(efl_model, 3);
}
-START_TEST(children_count)
+EFL_START_TEST(children_count)
{
_test_fake_server_proxy_children_count(fake_server_proxy);
_teardown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(children_slice_get)
+EFL_START_TEST(children_slice_get)
{
Eldbus_Model_Arguments *method1 = efl_model_nth_child_get(fake_server_proxy, 0);
Eldbus_Model_Arguments *method2 = efl_model_nth_child_get(fake_server_proxy, 1);
Eldbus_Model_Arguments *signal1 = efl_model_nth_child_get(fake_server_proxy, 2);
- const char *actual_method1_name = eldbus_model_arguments_name_get(method1);
- const char *actual_method2_name = eldbus_model_arguments_name_get(method2);
- const char *actual_signal1_name = eldbus_model_arguments_name_get(signal1);
+ const char *actual_method1_name = eldbus_model_arguments_arg_name_get(method1);
+ const char *actual_method2_name = eldbus_model_arguments_arg_name_get(method2);
+ const char *actual_signal1_name = eldbus_model_arguments_arg_name_get(signal1);
ck_assert_ptr_ne(NULL, actual_method1_name);
ck_assert_ptr_ne(NULL, actual_method2_name);
@@ -145,39 +176,37 @@ START_TEST(children_slice_get)
_teardown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(child_add)
+EFL_START_TEST(child_add)
{
Eo *child = efl_model_child_add(fake_server_proxy);
ck_assert_ptr_eq(NULL, child);
_teardown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(child_del)
+EFL_START_TEST(child_del)
{
// Tests that it is not possible to delete children
- Efl_Future *future;
+ Eo *child;
unsigned int expected_children_count = 0;
- future = efl_model_children_count_get(fake_server_proxy);
- expected_children_count = efl_model_future_then_u(future);
+ unsigned int actual_children_count = 0;
+
+ expected_children_count = efl_model_children_count_get(fake_server_proxy);
ck_assert_msg(expected_children_count, "There must be at least 1 child to test");
// efl_model_child_del always returns ERROR
- Eo *child = efl_model_first_child_get(fake_server_proxy);
+ child = efl_model_first_child_get(fake_server_proxy);
efl_model_child_del(fake_server_proxy, child);
- unsigned int actual_children_count = 0;
- future = efl_model_children_count_get(fake_server_proxy);
- actual_children_count = efl_model_future_then_u(future);
-
+ actual_children_count = efl_model_children_count_get(fake_server_proxy);
ck_assert_int_le(expected_children_count, actual_children_count);
_teardown();
}
-END_TEST
+EFL_END_TEST
void eldbus_test_fake_server_eldbus_model_proxy(TCase *tc)
{
diff --git a/src/tests/eldbus_cxx/eldbus_cxx_suite.cc b/src/tests/eldbus_cxx/eldbus_cxx_suite.cc
index ca15b776c8..d54502fbf0 100644
--- a/src/tests/eldbus_cxx/eldbus_cxx_suite.cc
+++ b/src/tests/eldbus_cxx/eldbus_cxx_suite.cc
@@ -21,7 +21,7 @@ int main(int argc, char* argv[])
putenv(const_cast<char*>("EFL_RUN_IN_TREE=1"));
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
- "Eldbus C++", etc);
+ "Eldbus C++", etc, NULL, NULL);
return (failed_count == 0) ? 0 : 255;
}
diff --git a/src/tests/eldbus_cxx/eldbus_cxx_suite.h b/src/tests/eldbus_cxx/eldbus_cxx_suite.h
index 1dd4a6461a..76609afbbe 100644
--- a/src/tests/eldbus_cxx/eldbus_cxx_suite.h
+++ b/src/tests/eldbus_cxx/eldbus_cxx_suite.h
@@ -5,7 +5,7 @@
#include <algorithm>
#include <check.h>
-
+#include "../efl_check.h"
void eldbus_test_connection(TCase* tc);
void eldbus_test_client(TCase* tc);
diff --git a/src/tests/eldbus_cxx/eldbus_cxx_test_eldbus_client.cc b/src/tests/eldbus_cxx/eldbus_cxx_test_eldbus_client.cc
index 485ea94c53..c7f66e5671 100644
--- a/src/tests/eldbus_cxx/eldbus_cxx_test_eldbus_client.cc
+++ b/src/tests/eldbus_cxx/eldbus_cxx_test_eldbus_client.cc
@@ -29,7 +29,7 @@ on_name_request(std::error_code const& ec, efl::eldbus::const_message
}
}
-START_TEST(eldbus_cxx_client)
+EFL_START_TEST(eldbus_cxx_client)
{
namespace edb = efl::eldbus;
@@ -452,7 +452,7 @@ START_TEST(eldbus_cxx_client)
std::cout << "out of loop" << std::endl;
}
-END_TEST
+EFL_END_TEST
void
eldbus_test_client(TCase* tc)
diff --git a/src/tests/eldbus_cxx/eldbus_cxx_test_eldbus_connect.cc b/src/tests/eldbus_cxx/eldbus_cxx_test_eldbus_connect.cc
index 7ca44a0448..134d85c404 100644
--- a/src/tests/eldbus_cxx/eldbus_cxx_test_eldbus_connect.cc
+++ b/src/tests/eldbus_cxx/eldbus_cxx_test_eldbus_connect.cc
@@ -10,27 +10,17 @@
#include "eldbus_cxx_suite.h"
-START_TEST(eldbus_cxx_session_connection)
+EFL_START_TEST(eldbus_cxx_session_connection)
{
efl::ecore::ecore_init ecore_init;
efl::eldbus::eldbus_init init;
efl::eldbus::connection c(efl::eldbus::session);
}
-END_TEST
-
-START_TEST(eldbus_cxx_system_connection)
-{
- efl::ecore::ecore_init ecore_init;
- efl::eldbus::eldbus_init init;
-
- efl::eldbus::connection c(efl::eldbus::system);
-}
-END_TEST
+EFL_END_TEST
void
eldbus_test_connection(TCase* tc)
{
tcase_add_test(tc, eldbus_cxx_session_connection);
- tcase_add_test(tc, eldbus_cxx_system_connection);
}
diff --git a/src/tests/elementary/efl_ui_suite.c b/src/tests/elementary/efl_ui_suite.c
new file mode 100644
index 0000000000..54e8ed184b
--- /dev/null
+++ b/src/tests/elementary/efl_ui_suite.c
@@ -0,0 +1,83 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+#include <check.h>
+#define EFL_NOLEGACY_API_SUPPORT
+#include <Efl_Ui.h>
+#include "../efl_check.h"
+
+EAPI_MAIN void
+efl_main(void *data EINA_UNUSED,
+ const Efl_Event *ev)
+{
+ Efl_Loop_Arguments *arge = ev->info;
+
+
+ fail_if(!arge->initialization);
+ fprintf(stderr, "ARGC %d\n", eina_array_count(arge->argv));
+ fail_if(eina_array_count(arge->argv) != 2);
+ fail_if(!eina_streq(eina_array_data_get(arge->argv, 1), "test"));
+
+ efl_loop_quit(ev->object, eina_value_string_init("success"));
+}
+
+EFL_START_TEST(efl_ui_test_init)
+{
+ /* EFL_MAIN */
+ Eina_Value *ret__;
+ int real__;
+
+ int argc = 2;
+ char *argv[] = { "efl_ui_suite", "test" };
+ _efl_startup_time = ecore_time_unix_get();
+ _EFL_APP_VERSION_SET();
+ fail_if(!ecore_init());
+ efl_event_callback_add(efl_app_get(), EFL_LOOP_EVENT_ARGUMENTS, efl_main, NULL);
+ fail_if(!ecore_init_ex(argc, argv));
+ __EFL_MAIN_CONSTRUCTOR;
+ ret__ = efl_loop_begin(efl_app_get());
+ real__ = efl_loop_exit_code_process(ret__);
+ __EFL_MAIN_DESTRUCTOR;
+ ecore_shutdown_ex();
+ ecore_shutdown();
+}
+EFL_END_TEST
+
+void efl_ui_test(TCase *tc)
+{
+ tcase_add_test(tc, efl_ui_test_init);
+}
+
+
+static const Efl_Test_Case etc[] = {
+ { "Efl_Ui", efl_ui_test },
+ { NULL, NULL }
+};
+
+SUITE_INIT(efl_ui)
+{
+ //???
+}
+
+SUITE_SHUTDOWN(efl_ui)
+{
+
+}
+
+int
+main(int argc, char **argv)
+{
+ int failed_count;
+
+ if (!_efl_test_option_disp(argc, argv, etc))
+ return 0;
+
+#ifdef NEED_RUN_IN_TREE
+ putenv("EFL_RUN_IN_TREE=1");
+#endif
+
+ failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
+ "Efl_Ui", etc, SUITE_INIT_FN(efl_ui), SUITE_SHUTDOWN_FN(efl_ui));
+
+ return (failed_count == 0) ? 0 : 255;
+}
diff --git a/src/tests/elementary/elm_code_file_test_load.c b/src/tests/elementary/elm_code_file_test_load.c
index b731f66b0d..4a2aced04d 100644
--- a/src/tests/elementary/elm_code_file_test_load.c
+++ b/src/tests/elementary/elm_code_file_test_load.c
@@ -9,17 +9,18 @@
#include "elm_suite.h"
#include "Elementary.h"
-START_TEST (elm_code_file_load)
+EFL_START_TEST (elm_code_file_load)
{
char *path = TESTS_SRC_DIR "/testfile.txt";
char real[EINA_PATH_MAX];
Elm_Code_File *file;
Elm_Code *code;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_open(code, path);
- realpath(path, real);
+ ck_assert_ptr_ne(realpath(path, real), NULL);
ck_assert_str_eq(ecore_file_file_get(path), elm_code_file_filename_get(file));
ck_assert_str_eq(real, elm_code_file_path_get(file));
@@ -27,15 +28,16 @@ START_TEST (elm_code_file_load)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_file_load_lines)
+EFL_START_TEST (elm_code_file_load_lines)
{
char *path = TESTS_SRC_DIR "/testfile.txt";
Elm_Code_File *file;
Elm_Code *code;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_open(code, path);
@@ -44,15 +46,16 @@ START_TEST (elm_code_file_load_lines)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_file_load_blank_lines)
+EFL_START_TEST (elm_code_file_load_blank_lines)
{
char *path = TESTS_SRC_DIR "/testfile-withblanks.txt";
Elm_Code_File *file;
Elm_Code *code;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_open(code, path);
@@ -61,15 +64,16 @@ START_TEST (elm_code_file_load_blank_lines)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_file_load_windows)
+EFL_START_TEST (elm_code_file_load_windows)
{
char *path = TESTS_SRC_DIR "/testfile-windows.txt";
Elm_Code_File *file;
Elm_Code *code;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_open(code, path);
@@ -78,7 +82,7 @@ START_TEST (elm_code_file_load_windows)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
static void _assert_line_content_eq(const char *content, Elm_Code_Line *line)
{
@@ -92,13 +96,14 @@ static void _assert_line_content_eq(const char *content, Elm_Code_Line *line)
ck_assert_uint_eq(content[c], line->content[c]);
}
-START_TEST (elm_code_file_load_content)
+EFL_START_TEST (elm_code_file_load_content)
{
char *path = TESTS_SRC_DIR "/testfile.txt";
Elm_Code_File *file;
Elm_Code *code;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_open(code, path);
@@ -108,16 +113,17 @@ START_TEST (elm_code_file_load_content)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_file_line_ending_unix)
+EFL_START_TEST (elm_code_file_line_ending_unix)
{
char *path = TESTS_SRC_DIR "/testfile.txt";
Elm_Code_File *file;
Elm_Code *code;
short len;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_open(code, path);
@@ -129,16 +135,17 @@ START_TEST (elm_code_file_line_ending_unix)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_file_line_ending_windows)
+EFL_START_TEST (elm_code_file_line_ending_windows)
{
char *path = TESTS_SRC_DIR "/testfile-windows.txt";
Elm_Code_File *file;
Elm_Code *code;
short len;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_open(code, path);
@@ -150,7 +157,7 @@ START_TEST (elm_code_file_line_ending_windows)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_code_file_test_load(TCase *tc)
{
diff --git a/src/tests/elementary/elm_code_file_test_memory.c b/src/tests/elementary/elm_code_file_test_memory.c
index f39228d427..4257e9c54b 100644
--- a/src/tests/elementary/elm_code_file_test_memory.c
+++ b/src/tests/elementary/elm_code_file_test_memory.c
@@ -7,11 +7,12 @@
#include "elm_suite.h"
#include "Elementary.h"
-START_TEST (elm_code_file_memory_lines)
+EFL_START_TEST (elm_code_file_memory_lines)
{
Elm_Code *code;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
ck_assert_uint_eq(0, elm_code_file_lines_get(code->file));
@@ -21,15 +22,16 @@ START_TEST (elm_code_file_memory_lines)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_file_memory_tokens)
+EFL_START_TEST (elm_code_file_memory_tokens)
{
Elm_Code_File *file;
Elm_Code_Line *line;
Elm_Code *code;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = code->file;
elm_code_file_line_append(file, "a line", 6, NULL);
@@ -40,7 +42,7 @@ START_TEST (elm_code_file_memory_tokens)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_code_file_test_memory(TCase *tc)
{
diff --git a/src/tests/elementary/elm_code_test_basic.c b/src/tests/elementary/elm_code_test_basic.c
index 5f6827b95e..5ae4915c85 100644
--- a/src/tests/elementary/elm_code_test_basic.c
+++ b/src/tests/elementary/elm_code_test_basic.c
@@ -9,11 +9,12 @@
#include "elm_suite.h"
#include "Elementary.h"
-START_TEST (elm_code_create_test)
+EFL_START_TEST (elm_code_create_test)
{
Elm_Code *code;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
ck_assert(!!code);
@@ -21,26 +22,27 @@ START_TEST (elm_code_create_test)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_open_test)
+EFL_START_TEST (elm_code_open_test)
{
char *path = TESTS_SRC_DIR "/testfile.txt";
char realpath1[PATH_MAX], realpath2[PATH_MAX];
Elm_Code *code;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
elm_code_file_open(code, path);
- realpath(path, realpath1);
- realpath(elm_code_file_path_get(code->file), realpath2);
+ ck_assert_ptr_ne(realpath(path, realpath1), NULL);
+ ck_assert_ptr_ne(realpath(elm_code_file_path_get(code->file), realpath2), NULL);
ck_assert(!!code);
ck_assert_str_eq(realpath1, realpath2);
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_code_test_basic(TCase *tc)
diff --git a/src/tests/elementary/elm_code_test_indent.c b/src/tests/elementary/elm_code_test_indent.c
index 9a35b7ce1f..6b564420f0 100644
--- a/src/tests/elementary/elm_code_test_indent.c
+++ b/src/tests/elementary/elm_code_test_indent.c
@@ -26,12 +26,13 @@ _indent_check(Elm_Code_File *file, const char *prev, const char *expected)
free(str);
}
-START_TEST (elm_code_indent_whitespace_test)
+EFL_START_TEST (elm_code_indent_whitespace_test)
{
Elm_Code *code;
Elm_Code_File *file;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
@@ -42,14 +43,15 @@ START_TEST (elm_code_indent_whitespace_test)
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_indent_comments_test)
+EFL_START_TEST (elm_code_indent_comments_test)
{
Elm_Code *code;
Elm_Code_File *file;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
@@ -64,16 +66,18 @@ START_TEST (elm_code_indent_comments_test)
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_indent_simple_braces)
+EFL_START_TEST (elm_code_indent_simple_braces)
{
Elm_Code *code;
Elm_Code_File *file;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
+ code->config.indent_style_efl = EINA_TRUE;
_indent_check(file, "if() {", " ");
_indent_check(file, "}", "");
@@ -83,9 +87,29 @@ START_TEST (elm_code_indent_simple_braces)
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_indent_matching_braces)
+EFL_START_TEST (elm_code_indent_tab_simple_braces)
+{
+ Elm_Code *code;
+ Elm_Code_File *file;
+
+ elm_init(1, NULL);
+ code = elm_code_create();
+ file = elm_code_file_new(code);
+ code->config.indent_style_efl = EINA_FALSE;
+
+ _indent_check(file, "if() {", "\t");
+ _indent_check(file, "}", "");
+
+ _indent_check(file, "\t{", "\t\t");
+ _indent_check(file, "\t}", "\t");
+
+ elm_shutdown();
+}
+EFL_END_TEST
+
+EFL_START_TEST (elm_code_indent_matching_braces)
{
Elm_Code_File *file;
Elm_Code_Line *line;
@@ -93,11 +117,12 @@ START_TEST (elm_code_indent_matching_braces)
const char *str;
unsigned int str_len;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
- elm_code_file_line_append(file, "", 8, NULL);
+ elm_code_file_line_append(file, "", 0, NULL);
line = elm_code_file_line_get(file, 1);
elm_code_file_line_insert(file, 1, " if ()", 8, NULL);
@@ -106,14 +131,17 @@ START_TEST (elm_code_indent_matching_braces)
elm_code_file_line_insert(file, 2, " {", 6, NULL);
str = elm_code_line_indent_matching_braces_get(line, &str_len);
+ ck_assert_int_eq(str_len, 5);
ck_assert_strn_eq(str, " ", str_len);
elm_code_file_line_insert(file, 3, " if (){", 14, NULL);
str = elm_code_line_indent_matching_braces_get(line, &str_len);
+ ck_assert_int_eq(str_len, 8);
ck_assert_strn_eq(str, " ", str_len);
elm_code_file_line_insert(file, 4, " }", 9, NULL);
str = elm_code_line_indent_matching_braces_get(line, &str_len);
+ ck_assert_int_eq(str_len, 5);
ck_assert_strn_eq(str, " ", str_len);
elm_code_file_line_insert(file, 5, " }", 6, NULL);
@@ -123,17 +151,51 @@ START_TEST (elm_code_indent_matching_braces)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_indent_startswith_keyword)
+EFL_START_TEST (elm_code_indent_tab_matching_braces)
{
Elm_Code_File *file;
+ Elm_Code_Line *line;
Elm_Code *code;
+ const char *str;
+ unsigned int str_len;
elm_init(1, NULL);
code = elm_code_create();
file = elm_code_file_new(code);
+ elm_code_file_line_append(file, "", 0, NULL);
+ line = elm_code_file_line_get(file, 1);
+
+ elm_code_file_line_insert(file, 1, "\tif ()", 6, NULL);
+ str = elm_code_line_indent_matching_braces_get(line, &str_len);
+ ck_assert_strn_eq(str, "", str_len);
+
+ elm_code_file_line_insert(file, 2, "\t{", 2, NULL);
+ str = elm_code_line_indent_matching_braces_get(line, &str_len);
+ ck_assert_int_eq(str_len, 1);
+ ck_assert_strn_eq(str, "\t", str_len);
+
+ elm_code_file_line_insert(file, 3, "\t}", 2, NULL);
+ str = elm_code_line_indent_matching_braces_get(line, &str_len);
+ ck_assert_strn_eq(str, "", str_len);
+
+ elm_code_free(code);
+ elm_shutdown();
+}
+END_TEST
+
+EFL_START_TEST (elm_code_indent_startswith_keyword)
+{
+ Elm_Code_File *file;
+ Elm_Code *code;
+
+ char *args[] = { "exe" };
+ elm_init(1, args);
+ code = elm_code_create();
+ file = elm_code_file_new(code);
+
_indent_check(file, "if ()", " ");
_indent_check(file, "else", " ");
_indent_check(file, "else if ()", " ");
@@ -159,13 +221,15 @@ START_TEST (elm_code_indent_startswith_keyword)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_code_test_indent(TCase *tc)
{
tcase_add_test(tc, elm_code_indent_whitespace_test);
tcase_add_test(tc, elm_code_indent_comments_test);
+ tcase_add_test(tc, elm_code_indent_tab_simple_braces);
tcase_add_test(tc, elm_code_indent_simple_braces);
tcase_add_test(tc, elm_code_indent_matching_braces);
+ tcase_add_test(tc, elm_code_indent_tab_matching_braces);
tcase_add_test(tc, elm_code_indent_startswith_keyword);
}
diff --git a/src/tests/elementary/elm_code_test_line.c b/src/tests/elementary/elm_code_test_line.c
index cdbc628079..3f4dea7fb9 100644
--- a/src/tests/elementary/elm_code_test_line.c
+++ b/src/tests/elementary/elm_code_test_line.c
@@ -7,13 +7,14 @@
#include "elm_suite.h"
#include "Elementary.h"
-START_TEST (elm_code_line_create_test)
+EFL_START_TEST (elm_code_line_create_test)
{
Elm_Code *code;
Elm_Code_File *file;
Elm_Code_Line *line;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
@@ -25,15 +26,16 @@ START_TEST (elm_code_line_create_test)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_line_token_count_test)
+EFL_START_TEST (elm_code_line_token_count_test)
{
Elm_Code *code;
Elm_Code_File *file;
Elm_Code_Line *line;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
@@ -49,15 +51,16 @@ START_TEST (elm_code_line_token_count_test)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_line_split_test)
+EFL_START_TEST (elm_code_line_split_test)
{
Elm_Code *code;
Elm_Code_File *file;
Elm_Code_Line *line, *newline;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
@@ -73,7 +76,7 @@ START_TEST (elm_code_line_split_test)
ck_assert_int_eq(5, newline->length);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_code_test_line(TCase *tc)
{
diff --git a/src/tests/elementary/elm_code_test_parse.c b/src/tests/elementary/elm_code_test_parse.c
index bc2af0f79c..91252283c2 100644
--- a/src/tests/elementary/elm_code_test_parse.c
+++ b/src/tests/elementary/elm_code_test_parse.c
@@ -20,7 +20,7 @@ static void _parser_file_callback(Elm_Code_File *file EINA_UNUSED, void *data EI
file_calls++;
}
-START_TEST (elm_code_parse_hook_memory_test)
+EFL_START_TEST (elm_code_parse_hook_memory_test)
{
Elm_Code *code;
Elm_Code_File *file;
@@ -28,7 +28,8 @@ START_TEST (elm_code_parse_hook_memory_test)
line_calls = 0;
file_calls = 0;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
@@ -41,9 +42,9 @@ START_TEST (elm_code_parse_hook_memory_test)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_parse_hook_file_test)
+EFL_START_TEST (elm_code_parse_hook_file_test)
{
Elm_Code *code;
Elm_Code_File *file;
@@ -52,7 +53,8 @@ START_TEST (elm_code_parse_hook_file_test)
line_calls = 0;
file_calls = 0;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
elm_code_parser_add(code, _parser_line_callback, _parser_file_callback, NULL);
@@ -65,15 +67,16 @@ START_TEST (elm_code_parse_hook_file_test)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_parse_todo_test)
+EFL_START_TEST (elm_code_parse_todo_test)
{
Elm_Code *code;
Elm_Code_File *file;
Elm_Code_Line *line;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
elm_code_parser_standard_add(code, ELM_CODE_PARSER_STANDARD_TODO);
file = elm_code_file_new(code);
@@ -89,7 +92,7 @@ START_TEST (elm_code_parse_todo_test)
ck_assert_int_eq(ELM_CODE_STATUS_TYPE_DEFAULT, line->status);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_code_test_parse(TCase *tc)
{
diff --git a/src/tests/elementary/elm_code_test_syntax.c b/src/tests/elementary/elm_code_test_syntax.c
index 7e1d0d13f6..2af474cbf5 100644
--- a/src/tests/elementary/elm_code_test_syntax.c
+++ b/src/tests/elementary/elm_code_test_syntax.c
@@ -37,7 +37,7 @@ _assert_line_token_types(Elm_Code_File *file, unsigned int number,unsigned int c
}
}
-START_TEST (elm_code_syntax_lookup)
+EFL_START_TEST (elm_code_syntax_lookup)
{
Elm_Code_Syntax *syntax;
@@ -48,20 +48,21 @@ START_TEST (elm_code_syntax_lookup)
syntax = elm_code_syntax_for_mime_get("text/unknown");
ck_assert(!syntax);
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_syntax_c)
+EFL_START_TEST (elm_code_syntax_c)
{
Elm_Code *code;
Elm_Code_File *file;
Elm_Code_Widget *widget;
Evas_Object *win;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
- win = elm_win_add(NULL, "syntax", ELM_WIN_BASIC);
+ win = win_add(NULL, "syntax", ELM_WIN_BASIC);
widget = elm_code_widget_add(win, code);
elm_obj_code_widget_code_get(widget)->file->mime = "text/x-csrc";
elm_code_widget_syntax_enabled_set(widget, EINA_TRUE);
@@ -114,15 +115,16 @@ START_TEST (elm_code_syntax_c)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_syntax_scope_change_braces_test)
+EFL_START_TEST (elm_code_syntax_scope_change_braces_test)
{
Elm_Code_File *file;
Elm_Code_Line *line;
Elm_Code *code;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
code->file->mime = "text/x-csrc";
elm_code_parser_standard_add(code, ELM_CODE_PARSER_STANDARD_SYNTAX);
@@ -144,7 +146,7 @@ START_TEST (elm_code_syntax_scope_change_braces_test)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_code_test_syntax(TCase *tc)
{
diff --git a/src/tests/elementary/elm_code_test_text.c b/src/tests/elementary/elm_code_test_text.c
index dfff80f152..51716ce323 100644
--- a/src/tests/elementary/elm_code_test_text.c
+++ b/src/tests/elementary/elm_code_test_text.c
@@ -8,7 +8,7 @@
#include "Elementary.h"
#include "elm_code_text.h"
-START_TEST (elm_code_text_get_test)
+EFL_START_TEST (elm_code_text_get_test)
{
Elm_Code *code;
Elm_Code_File *file;
@@ -17,7 +17,8 @@ START_TEST (elm_code_text_get_test)
const char *str;
unsigned int len;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
@@ -28,9 +29,9 @@ START_TEST (elm_code_text_get_test)
ck_assert_strn_eq("test", str, len);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_text_insert_test)
+EFL_START_TEST (elm_code_text_insert_test)
{
Elm_Code *code;
Elm_Code_File *file;
@@ -38,7 +39,8 @@ START_TEST (elm_code_text_insert_test)
const char *text;
unsigned int length;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
@@ -50,15 +52,16 @@ START_TEST (elm_code_text_insert_test)
ck_assert_strn_eq("testing", text, length);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_text_contains_test)
+EFL_START_TEST (elm_code_text_contains_test)
{
Elm_Code *code;
Elm_Code_File *file;
Elm_Code_Line *line;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
@@ -72,15 +75,16 @@ START_TEST (elm_code_text_contains_test)
ck_assert_int_eq(EINA_TRUE, elm_code_line_text_contains(line, "..."));
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_text_strpos_test)
+EFL_START_TEST (elm_code_text_strpos_test)
{
Elm_Code *code;
Elm_Code_File *file;
Elm_Code_Line *line;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
@@ -98,28 +102,30 @@ START_TEST (elm_code_text_strpos_test)
ck_assert_int_eq(13, elm_code_line_text_strpos(line, "...", 0));
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_text_newline_position_test)
+EFL_START_TEST (elm_code_text_newline_position_test)
{
short nllen;
const char *unixtext = "a test\nwith newline";
const char *wintext = "a windows\r\nnewline";
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
ck_assert_int_eq(6, elm_code_text_newlinenpos(unixtext, strlen(unixtext), &nllen));
ck_assert_int_eq(1, nllen);
ck_assert_int_eq(9, elm_code_text_newlinenpos(wintext, strlen(wintext), &nllen));
ck_assert_int_eq(2, nllen);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_text_is_whitespace_test)
+EFL_START_TEST (elm_code_text_is_whitespace_test)
{
const char *text;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
text = " ";
ck_assert_int_eq(1, elm_code_text_is_whitespace(text, strlen(text)));
@@ -130,7 +136,7 @@ START_TEST (elm_code_text_is_whitespace_test)
ck_assert_int_eq(0, elm_code_text_is_whitespace(text, strlen(text)));
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_code_test_text(TCase *tc)
{
diff --git a/src/tests/elementary/elm_code_test_widget.c b/src/tests/elementary/elm_code_test_widget.c
index e832449776..e510368fdb 100644
--- a/src/tests/elementary/elm_code_test_widget.c
+++ b/src/tests/elementary/elm_code_test_widget.c
@@ -24,102 +24,53 @@
#undef DBG
#define DBG(...) do { } while (0);
-// Guard against multiple redefinitions on Windows
-#define ELM_CODE_TEST
-
-#include "elm_code_parse.c"
-#include "elm_code_widget_selection.c"
-#include "elm_code_widget.c"
-
-#undef ELM_CODE_TEST
-
-static void _assert_cell_type(Evas_Textgrid_Cell cell, Elm_Code_Token_Type type, int id)
-{
- ck_assert_msg(cell.fg == type, "Wrong type for cell %d", id);
-}
-
-START_TEST (elm_code_widget_token_render_simple_test)
-{
- Elm_Code_File *file;
- Elm_Code_Line *line;
- Elm_Code *code;
- Elm_Code_Widget *widget;
- Evas_Object *win;
-
- int length;
- unsigned int gutter;
-
- Evas_Textgrid_Cell cells[25];
-
- elm_init(1, NULL);
- code = elm_code_create();
-
- win = elm_win_add(NULL, "code", ELM_WIN_BASIC);
- widget = elm_code_widget_add(win, code);
-
- file = code->file;
- elm_code_file_line_append(file, "some \"test content\", 45", 23, NULL);
- line = elm_code_file_line_get(file, 1);
- length = line->length;
-
- elm_code_line_token_add(line, 5, 18, 1, ELM_CODE_TOKEN_TYPE_COMMENT);
- elm_code_line_token_add(line, 21, 22, 1, ELM_CODE_TOKEN_TYPE_NUMBER);
-
- _elm_code_widget_fill_line_tokens(widget, cells, length+1, line);
- gutter = elm_obj_code_widget_text_left_gutter_width_get(widget);
-
- _assert_cell_type(cells[gutter+15], ELM_CODE_TOKEN_TYPE_COMMENT, 16);
- _assert_cell_type(cells[gutter+21], ELM_CODE_TOKEN_TYPE_NUMBER, 22);
-
- elm_code_free(code);
- elm_shutdown();
-}
-END_TEST
-
-START_TEST (elm_code_widget_construct)
+EFL_START_TEST (elm_code_widget_construct)
{
Elm_Code *code;
Elm_Code_Widget *widget;
Evas_Object *win;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
widget = elm_code_widget_add(win, code);
ck_assert(!!widget);
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_widget_construct_nocode)
+EFL_START_TEST (elm_code_widget_construct_nocode)
{
Elm_Code_Widget *widget;
Evas_Object *win;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
widget = elm_code_widget_add(win, NULL);
ck_assert(!widget);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_widget_position)
+EFL_START_TEST (elm_code_widget_position)
{
Elm_Code *code;
Elm_Code_Widget *widget;
Evas_Object *win;
Evas_Coord x, y, w, h, x2, y2, w2, h2;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
widget = elm_code_widget_add(win, code);
evas_object_show(widget);
evas_object_resize(widget, 100, 100);
@@ -142,11 +93,10 @@ START_TEST (elm_code_widget_position)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_code_test_widget(TCase *tc)
{
- tcase_add_test(tc, elm_code_widget_token_render_simple_test);
tcase_add_test(tc, elm_code_widget_construct);
tcase_add_test(tc, elm_code_widget_construct_nocode);
tcase_add_test(tc, elm_code_widget_position);
diff --git a/src/tests/elementary/elm_code_test_widget_selection.c b/src/tests/elementary/elm_code_test_widget_selection.c
index 59c1565be1..8ad7611c6a 100644
--- a/src/tests/elementary/elm_code_test_widget_selection.c
+++ b/src/tests/elementary/elm_code_test_widget_selection.c
@@ -9,19 +9,20 @@
#include "elm_code_widget_private.h"
#include "elm_code_widget_selection.h"
-START_TEST (elm_code_test_widget_selection_set)
+EFL_START_TEST (elm_code_test_widget_selection_set)
{
Elm_Code *code;
Elm_Code_File *file;
Elm_Code_Widget *widget;
Evas_Object *win;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
elm_code_file_line_append(file, "test", 4, NULL);
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
widget = elm_code_widget_add(win, code);
elm_code_widget_selection_start(widget, 1, 2);
@@ -31,9 +32,9 @@ START_TEST (elm_code_test_widget_selection_set)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_test_widget_selection_normalized_get)
+EFL_START_TEST (elm_code_test_widget_selection_normalized_get)
{
Elm_Code *code;
Elm_Code_File *file;
@@ -41,12 +42,13 @@ START_TEST (elm_code_test_widget_selection_normalized_get)
Elm_Code_Widget_Selection_Data *selection;
Evas_Object *win;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
elm_code_file_line_append(file, "test", 4, NULL);
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
widget = elm_code_widget_add(win, code);
elm_code_widget_selection_start(widget, 1, 3);
@@ -73,9 +75,9 @@ START_TEST (elm_code_test_widget_selection_normalized_get)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_test_widget_selection_text_get)
+EFL_START_TEST (elm_code_test_widget_selection_text_get)
{
Elm_Code *code;
Elm_Code_File *file;
@@ -83,12 +85,13 @@ START_TEST (elm_code_test_widget_selection_text_get)
Evas_Object *win;
char *selection;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
elm_code_file_line_append(file, "test", 4, NULL);
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
widget = elm_code_widget_add(win, code);
ck_assert_str_eq("", elm_code_widget_selection_text_get(widget));
@@ -106,9 +109,9 @@ START_TEST (elm_code_test_widget_selection_text_get)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_test_widget_selection_reverse_text_get)
+EFL_START_TEST (elm_code_test_widget_selection_reverse_text_get)
{
Elm_Code *code;
Elm_Code_File *file;
@@ -116,12 +119,13 @@ START_TEST (elm_code_test_widget_selection_reverse_text_get)
Evas_Object *win;
char *selection;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
elm_code_file_line_append(file, "test", 4, NULL);
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
widget = elm_code_widget_add(win, code);
ck_assert_str_eq("", elm_code_widget_selection_text_get(widget));
@@ -139,9 +143,9 @@ START_TEST (elm_code_test_widget_selection_reverse_text_get)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_test_widget_selection_text_get_twoline)
+EFL_START_TEST (elm_code_test_widget_selection_text_get_twoline)
{
Elm_Code *code;
Elm_Code_File *file;
@@ -149,13 +153,14 @@ START_TEST (elm_code_test_widget_selection_text_get_twoline)
Evas_Object *win;
char *selection;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
elm_code_file_line_append(file, "test", 4, NULL);
elm_code_file_line_append(file, "test", 4, NULL);
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
widget = elm_code_widget_add(win, code);
elm_code_widget_selection_start(widget, 1, 3);
@@ -168,9 +173,9 @@ START_TEST (elm_code_test_widget_selection_text_get_twoline)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_test_widget_selection_reverse_text_get_twoline)
+EFL_START_TEST (elm_code_test_widget_selection_reverse_text_get_twoline)
{
Elm_Code *code;
Elm_Code_File *file;
@@ -178,13 +183,14 @@ START_TEST (elm_code_test_widget_selection_reverse_text_get_twoline)
Evas_Object *win;
char *selection;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
elm_code_file_line_append(file, "test", 4, NULL);
elm_code_file_line_append(file, "test", 4, NULL);
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
widget = elm_code_widget_add(win, code);
elm_code_widget_selection_start(widget, 2, 2);
@@ -197,9 +203,9 @@ START_TEST (elm_code_test_widget_selection_reverse_text_get_twoline)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_test_widget_selection_text_get_multiline)
+EFL_START_TEST (elm_code_test_widget_selection_text_get_multiline)
{
Elm_Code *code;
Elm_Code_File *file;
@@ -207,14 +213,15 @@ START_TEST (elm_code_test_widget_selection_text_get_multiline)
Evas_Object *win;
char *selection;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
elm_code_file_line_append(file, "test", 4, NULL);
elm_code_file_line_append(file, "test", 4, NULL);
elm_code_file_line_append(file, "test", 4, NULL);
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
widget = elm_code_widget_add(win, code);
elm_code_widget_selection_start(widget, 1, 3);
@@ -227,9 +234,9 @@ START_TEST (elm_code_test_widget_selection_text_get_multiline)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_test_widget_selection_reverse_text_get_multiline)
+EFL_START_TEST (elm_code_test_widget_selection_reverse_text_get_multiline)
{
Elm_Code *code;
Elm_Code_File *file;
@@ -237,14 +244,15 @@ START_TEST (elm_code_test_widget_selection_reverse_text_get_multiline)
Evas_Object *win;
char *selection;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
elm_code_file_line_append(file, "test", 4, NULL);
elm_code_file_line_append(file, "test", 4, NULL);
elm_code_file_line_append(file, "test", 4, NULL);
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
widget = elm_code_widget_add(win, code);
elm_code_widget_selection_start(widget, 3, 2);
@@ -257,9 +265,9 @@ START_TEST (elm_code_test_widget_selection_reverse_text_get_multiline)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_test_widget_selection_delete)
+EFL_START_TEST (elm_code_test_widget_selection_delete)
{
Elm_Code *code;
Elm_Code_File *file;
@@ -269,12 +277,13 @@ START_TEST (elm_code_test_widget_selection_delete)
const char *text;
unsigned int length;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
elm_code_file_line_append(file, "text", 4, NULL);
- win = elm_win_add(NULL, "code", ELM_WIN_BASIC);
+ win = win_add(NULL, "code", ELM_WIN_BASIC);
widget = elm_code_widget_add(win, code);
line = elm_code_file_line_get(file, 1);
text = elm_code_line_text_get(line, &length);
@@ -293,9 +302,9 @@ START_TEST (elm_code_test_widget_selection_delete)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_test_widget_selection_reverse_delete)
+EFL_START_TEST (elm_code_test_widget_selection_reverse_delete)
{
Elm_Code *code;
Elm_Code_File *file;
@@ -305,12 +314,13 @@ START_TEST (elm_code_test_widget_selection_reverse_delete)
const char *text;
unsigned int length;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
elm_code_file_line_append(file, "text", 4, NULL);
- win = elm_win_add(NULL, "code", ELM_WIN_BASIC);
+ win = win_add(NULL, "code", ELM_WIN_BASIC);
widget = elm_code_widget_add(win, code);
line = elm_code_file_line_get(file, 1);
text = elm_code_line_text_get(line, &length);
@@ -329,9 +339,9 @@ START_TEST (elm_code_test_widget_selection_reverse_delete)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_test_widget_selection_delete_twoline)
+EFL_START_TEST (elm_code_test_widget_selection_delete_twoline)
{
Elm_Code *code;
Elm_Code_File *file;
@@ -341,14 +351,15 @@ START_TEST (elm_code_test_widget_selection_delete_twoline)
const char *text;
unsigned int length;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
elm_code_file_line_append(file, "text", 4, NULL);
elm_code_file_line_append(file, "TEXT", 4, NULL);
elm_code_file_line_append(file, "remove", 6, NULL);
- win = elm_win_add(NULL, "code", ELM_WIN_BASIC);
+ win = win_add(NULL, "code", ELM_WIN_BASIC);
widget = elm_code_widget_add(win, code);
line = elm_code_file_line_get(file, 1);
text = elm_code_line_text_get(line, NULL);
@@ -376,9 +387,9 @@ START_TEST (elm_code_test_widget_selection_delete_twoline)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_test_widget_selection_reverse_delete_twoline)
+EFL_START_TEST (elm_code_test_widget_selection_reverse_delete_twoline)
{
Elm_Code *code;
Elm_Code_File *file;
@@ -388,14 +399,15 @@ START_TEST (elm_code_test_widget_selection_reverse_delete_twoline)
const char *text;
unsigned int length;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
elm_code_file_line_append(file, "text", 4, NULL);
elm_code_file_line_append(file, "TEXT", 4, NULL);
elm_code_file_line_append(file, "remove", 6, NULL);
- win = elm_win_add(NULL, "code", ELM_WIN_BASIC);
+ win = win_add(NULL, "code", ELM_WIN_BASIC);
widget = elm_code_widget_add(win, code);
line = elm_code_file_line_get(file, 1);
text = elm_code_line_text_get(line, NULL);
@@ -423,9 +435,9 @@ START_TEST (elm_code_test_widget_selection_reverse_delete_twoline)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_test_widget_selection_delete_multiline)
+EFL_START_TEST (elm_code_test_widget_selection_delete_multiline)
{
Elm_Code *code;
Elm_Code_File *file;
@@ -435,7 +447,8 @@ START_TEST (elm_code_test_widget_selection_delete_multiline)
const char *text;
unsigned int length;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
elm_code_file_line_append(file, "text", 4, NULL);
@@ -444,7 +457,7 @@ START_TEST (elm_code_test_widget_selection_delete_multiline)
elm_code_file_line_append(file, "delete", 6, NULL);
elm_code_file_line_append(file, "REMOVE", 6, NULL);
- win = elm_win_add(NULL, "code", ELM_WIN_BASIC);
+ win = win_add(NULL, "code", ELM_WIN_BASIC);
widget = elm_code_widget_add(win, code);
line = elm_code_file_line_get(file, 1);
text = elm_code_line_text_get(line, NULL);
@@ -472,9 +485,9 @@ START_TEST (elm_code_test_widget_selection_delete_multiline)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_test_widget_selection_reverse_delete_multiline)
+EFL_START_TEST (elm_code_test_widget_selection_reverse_delete_multiline)
{
Elm_Code *code;
Elm_Code_File *file;
@@ -484,7 +497,8 @@ START_TEST (elm_code_test_widget_selection_reverse_delete_multiline)
const char *text;
unsigned int length;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
elm_code_file_line_append(file, "text", 4, NULL);
@@ -493,7 +507,7 @@ START_TEST (elm_code_test_widget_selection_reverse_delete_multiline)
elm_code_file_line_append(file, "delete", 6, NULL);
elm_code_file_line_append(file, "REMOVE", 6, NULL);
- win = elm_win_add(NULL, "code", ELM_WIN_BASIC);
+ win = win_add(NULL, "code", ELM_WIN_BASIC);
widget = elm_code_widget_add(win, code);
line = elm_code_file_line_get(file, 1);
text = elm_code_line_text_get(line, NULL);
@@ -521,9 +535,9 @@ START_TEST (elm_code_test_widget_selection_reverse_delete_multiline)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_test_widget_selection_select_line)
+EFL_START_TEST (elm_code_test_widget_selection_select_line)
{
Elm_Code *code;
Elm_Code_File *file;
@@ -531,13 +545,15 @@ START_TEST (elm_code_test_widget_selection_select_line)
Evas_Object *win;
char *selection;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
elm_code_file_line_append(file, "line selection", 14, NULL);
elm_code_file_line_append(file, "line2", 5, NULL);
+ elm_code_file_line_append(file, "\ttab", 4, NULL);
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
widget = elm_code_widget_add(win, code);
elm_code_widget_selection_select_line(widget, 1);
@@ -549,11 +565,17 @@ START_TEST (elm_code_test_widget_selection_select_line)
selection = elm_code_widget_selection_text_get(widget);
ck_assert_str_eq("line2", selection);
free(selection);
+
+ elm_code_widget_selection_select_line(widget, 3);
+ selection = elm_code_widget_selection_text_get(widget);
+ ck_assert_str_eq("\ttab", selection);
+ free(selection);
+
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_test_widget_selection_select_word)
+EFL_START_TEST (elm_code_test_widget_selection_select_word)
{
Elm_Code *code;
Elm_Code_File *file;
@@ -561,14 +583,15 @@ START_TEST (elm_code_test_widget_selection_select_word)
Evas_Object *win;
char *selection;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
elm_code_file_line_append(file, "word selection test", 19, NULL);
elm_code_file_line_append(file, "more stuff\tto test", 18, NULL);
elm_code_file_line_append(file, "word \"symbols\" test", 19, NULL);
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
widget = elm_code_widget_add(win, code);
elm_code_widget_selection_select_word(widget, 1, 3);
@@ -592,9 +615,9 @@ START_TEST (elm_code_test_widget_selection_select_word)
free(selection);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_test_widget_selection_select_word_punctuation)
+EFL_START_TEST (elm_code_test_widget_selection_select_word_punctuation)
{
Elm_Code *code;
Elm_Code_File *file;
@@ -602,12 +625,13 @@ START_TEST (elm_code_test_widget_selection_select_word_punctuation)
Evas_Object *win;
char *selection;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
elm_code_file_line_append(file, "comma, stop. question? mark!", 38, NULL);
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
widget = elm_code_widget_add(win, code);
elm_code_widget_selection_select_word(widget, 1, 3);
@@ -631,9 +655,9 @@ START_TEST (elm_code_test_widget_selection_select_word_punctuation)
free(selection);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_test_widget_selection_select_word_symbols)
+EFL_START_TEST (elm_code_test_widget_selection_select_word_symbols)
{
Elm_Code *code;
Elm_Code_File *file;
@@ -641,12 +665,13 @@ START_TEST (elm_code_test_widget_selection_select_word_symbols)
Evas_Object *win;
char *selection;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
elm_code_file_line_append(file, "colon: [array] (brackets) {braces}", 38, NULL);
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
widget = elm_code_widget_add(win, code);
elm_code_widget_selection_select_word(widget, 1, 3);
@@ -670,7 +695,7 @@ START_TEST (elm_code_test_widget_selection_select_word_symbols)
free(selection);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_code_test_widget_selection(TCase *tc)
{
diff --git a/src/tests/elementary/elm_code_test_widget_text.c b/src/tests/elementary/elm_code_test_widget_text.c
index e11ce6fad4..e9eff3c1fd 100644
--- a/src/tests/elementary/elm_code_test_widget_text.c
+++ b/src/tests/elementary/elm_code_test_widget_text.c
@@ -7,15 +7,16 @@
#include "elm_suite.h"
#include "Elementary.h"
-START_TEST (elm_code_test_widget_text_tab_width)
+EFL_START_TEST (elm_code_test_widget_text_tab_width)
{
Elm_Code *code;
Elm_Code_Widget *widget;
Evas_Object *win;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
widget = elm_code_widget_add(win, code);
elm_code_widget_tabstop_set(widget, 8);
@@ -26,9 +27,9 @@ START_TEST (elm_code_test_widget_text_tab_width)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_test_widget_text_position)
+EFL_START_TEST (elm_code_test_widget_text_position)
{
Elm_Code *code;
Elm_Code_File *file;
@@ -36,13 +37,14 @@ START_TEST (elm_code_test_widget_text_position)
Elm_Code_Widget *widget;
Evas_Object *win;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
elm_code_file_line_append(file, "a\tb", 4, NULL);
line = elm_code_file_line_get(file, 1);
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
widget = elm_code_widget_add(win, code);
elm_code_widget_tabstop_set(widget, 8);
@@ -53,7 +55,7 @@ START_TEST (elm_code_test_widget_text_position)
ck_assert_int_eq(1, elm_code_widget_line_text_position_for_column_get(widget, line, 7));
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_code_test_widget_text(TCase *tc)
{
diff --git a/src/tests/elementary/elm_code_test_widget_undo.c b/src/tests/elementary/elm_code_test_widget_undo.c
index 0e54fcbf08..9d3e59c9f1 100644
--- a/src/tests/elementary/elm_code_test_widget_undo.c
+++ b/src/tests/elementary/elm_code_test_widget_undo.c
@@ -8,7 +8,7 @@
#include "Elementary.h"
#include "elm_code_widget_private.h"
-START_TEST (elm_code_test_widget_undo_text_insert)
+EFL_START_TEST (elm_code_test_widget_undo_text_insert)
{
Elm_Code *code;
Elm_Code_File *file;
@@ -18,12 +18,13 @@ START_TEST (elm_code_test_widget_undo_text_insert)
unsigned int length;
const char *content;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
elm_code_file_line_append(file, "test", 4, NULL);
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
widget = elm_code_widget_add(win, code);
elm_code_widget_text_at_cursor_insert(widget, "a");
@@ -56,9 +57,9 @@ START_TEST (elm_code_test_widget_undo_text_insert)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_code_test_widget_undo_text_insert_multiple)
+EFL_START_TEST (elm_code_test_widget_undo_text_insert_multiple)
{
Elm_Code *code;
Elm_Code_File *file;
@@ -68,12 +69,13 @@ START_TEST (elm_code_test_widget_undo_text_insert_multiple)
unsigned int length;
const char *content;
- elm_init(1, NULL);
+ char *args[] = { "exe" };
+ elm_init(1, args);
code = elm_code_create();
file = elm_code_file_new(code);
elm_code_file_line_append(file, "test", 4, NULL);
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
widget = elm_code_widget_add(win, code);
elm_code_widget_text_at_cursor_insert(widget, "a");
@@ -93,151 +95,10 @@ START_TEST (elm_code_test_widget_undo_text_insert_multiple)
elm_code_free(code);
elm_shutdown();
}
-END_TEST
-
-START_TEST (elm_code_test_widget_undo_newline)
-{
- Elm_Code *code;
- Elm_Code_File *file;
- Elm_Code_Line *line;
- Elm_Code_Widget *widget;
- Evas_Object *win;
- unsigned int length;
- const char *content;
-
- elm_init(1, NULL);
- code = elm_code_create();
- file = elm_code_file_new(code);
- elm_code_file_line_append(file, "test", 4, NULL);
-
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
- widget = elm_code_widget_add(win, code);
-
- elm_code_widget_cursor_position_set(widget, 1, 5);
- _elm_code_widget_newline(widget);
- ck_assert_int_eq(2, elm_code_file_lines_get(file));
- line = elm_code_file_line_get(file, 1);
- content = elm_code_line_text_get(line, &length);
- ck_assert_strn_eq("test", content, 1);
-
- elm_code_widget_undo(widget);
-
- ck_assert_int_eq(1, elm_code_file_lines_get(file));
- line = elm_code_file_line_get(file, 1);
- content = elm_code_line_text_get(line, &length);
- ck_assert_strn_eq("test", content, 4);
-
- elm_code_free(code);
- elm_shutdown();
-}
-END_TEST
-
-START_TEST (elm_code_test_widget_undo_delete)
-{
- Elm_Code *code;
- Elm_Code_File *file;
- Elm_Code_Line *line;
- Elm_Code_Widget *widget;
- Evas_Object *win;
- unsigned int length;
- const char *content;
-
- elm_init(1, NULL);
- code = elm_code_create();
- file = elm_code_file_new(code);
- elm_code_file_line_append(file, "test", 4, NULL);
-
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
- widget = elm_code_widget_add(win, code);
-
- elm_code_widget_cursor_position_set(widget, 1, 4);
- _elm_code_widget_backspace(widget);
-
- line = elm_code_file_line_get(file, 1);
- content = elm_code_line_text_get(line, &length);
- ck_assert_strn_eq("tet", content, length);
-
- elm_code_widget_undo(widget);
- content = elm_code_line_text_get(line, &length);
- ck_assert_strn_eq("test", content, length);
-
- elm_code_widget_cursor_position_set(widget, 1, 2);
- _elm_code_widget_delete(widget);
-
- line = elm_code_file_line_get(file, 1);
- content = elm_code_line_text_get(line, &length);
- ck_assert_strn_eq("tst", content, length);
-
- elm_code_widget_undo(widget);
- content = elm_code_line_text_get(line, &length);
- ck_assert_strn_eq("test", content, length);
-
- elm_code_widget_cursor_position_set(widget, 1, 4);
- elm_code_widget_text_at_cursor_insert(widget, "\t");
- _elm_code_widget_backspace(widget);
- content = elm_code_line_text_get(line, &length);
- ck_assert_strn_eq("test", content, length);
- elm_code_widget_undo(widget);
- content = elm_code_line_text_get(line, &length);
- ck_assert_strn_eq("tes\tt", content, length);
-
- elm_code_widget_cursor_position_set(widget, 1, 4);
- _elm_code_widget_delete(widget);
- content = elm_code_line_text_get(line, &length);
- ck_assert_strn_eq("test", content, length);
- elm_code_widget_undo(widget);
- content = elm_code_line_text_get(line, &length);
- ck_assert_strn_eq("tes\tt", content, length);
-
- elm_code_free(code);
- elm_shutdown();
-}
-END_TEST
-
-START_TEST (elm_code_test_widget_undo_delete_multiple)
-{
- Elm_Code *code;
- Elm_Code_File *file;
- Elm_Code_Line *line;
- Elm_Code_Widget *widget;
- Evas_Object *win;
- unsigned int length;
- const char *content;
-
- elm_init(1, NULL);
- code = elm_code_create();
- file = elm_code_file_new(code);
- elm_code_file_line_append(file, "test", 4, NULL);
-
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
- widget = elm_code_widget_add(win, code);
-
- elm_code_widget_cursor_position_set(widget, 1, 4);
- _elm_code_widget_backspace(widget);
- _elm_code_widget_backspace(widget);
-
- line = elm_code_file_line_get(file, 1);
- content = elm_code_line_text_get(line, &length);
- ck_assert_strn_eq("tt", content, length);
-
- elm_code_widget_undo(widget);
- content = elm_code_line_text_get(line, &length);
- ck_assert_strn_eq("tet", content, length);
-
- elm_code_widget_undo(widget);
- content = elm_code_line_text_get(line, &length);
- ck_assert_strn_eq("test", content, length);
-
- elm_code_free(code);
- elm_shutdown();
-}
-END_TEST
+EFL_END_TEST
void elm_code_test_widget_undo(TCase *tc)
{
tcase_add_test(tc, elm_code_test_widget_undo_text_insert);
tcase_add_test(tc, elm_code_test_widget_undo_text_insert_multiple);
- tcase_add_test(tc, elm_code_test_widget_undo_newline);
- tcase_add_test(tc, elm_code_test_widget_undo_delete);
- tcase_add_test(tc, elm_code_test_widget_undo_delete_multiple);
}
diff --git a/src/tests/elementary/elm_suite.c b/src/tests/elementary/elm_suite.c
index 197a9d08db..b05eb64448 100644
--- a/src/tests/elementary/elm_suite.c
+++ b/src/tests/elementary/elm_suite.c
@@ -6,8 +6,11 @@
#include "elm_suite.h"
#include "../efl_check.h"
+static int main_pid = -1;
+static Eina_Bool did_shutdown;
+static Evas_Object *global_win;
+
static const Efl_Test_Case etc[] = {
- { "Elementary", elm_test_init },
{ "elm_config", elm_test_config },
{ "elm_check", elm_test_check },
{ "elm_colorselector", elm_test_colorselector },
@@ -88,21 +91,109 @@ static const Efl_Test_Case etc[] = {
{ NULL, NULL }
};
+SUITE_INIT(elm)
+{
+ char *args[] = { "exe" };
+ ck_assert_int_eq(elm_init(1, args), 1);
+}
+
+SUITE_INIT(elm2)
+{
+ char *args[] = { "exe" };
+
+ if (getpid() != main_pid)
+ {
+ ecore_fork_reset();
+ return;
+ }
+ if (!did_shutdown)
+ {
+ /* if running un-forked then remove cached init */
+ ck_assert_int_eq(elm_shutdown(), 0);
+ did_shutdown = 1;
+ }
+ ck_assert_int_eq(elm_init(1, args), 1);
+}
+
+SUITE_SHUTDOWN(elm)
+{
+ ck_assert_int_eq(elm_shutdown(), 0);
+ /* verify that ecore was de-initialized completely */
+ ck_assert_int_eq(ecore_init(), 1);
+ /* avoid slowdowns in fork mode */
+ if (getpid() != main_pid) return;
+ ck_assert_int_eq(ecore_shutdown(), 0);
+}
+
+
+static const Efl_Test_Case etc_init[] = {
+ { "init", elm_test_init },
+ { NULL, NULL }
+};
+
+Evas_Object *
+win_add()
+{
+ if (getpid() != main_pid)
+ {
+ if (global_win) return global_win;
+ }
+ return elm_win_add(NULL, "elm_suite", ELM_WIN_BASIC);;
+}
+
int
main(int argc, char **argv)
{
int failed_count;
+ Eina_Bool buffer = EINA_FALSE;
if (!_efl_test_option_disp(argc, argv, etc))
return 0;
#ifdef NEED_RUN_IN_TREE
putenv("EFL_RUN_IN_TREE=1");
- putenv("ELM_RUN_IN_TREE=1");
#endif
+ if (!getenv("ELM_ENGINE"))
+ putenv("ELM_ENGINE=buffer");
+ if (eina_streq(getenv("ELM_ENGINE"), "buffer"))
+ {
+ putenv("TESTS_GL_DISABLED=1");
+ buffer = EINA_TRUE;
+ }
+
+ main_pid = getpid();
+ ecore_app_no_system_modules();
+ efreet_cache_disable();
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
- "Elementary", etc);
+ "Elementary_Init", etc_init, SUITE_INIT_FN(elm), SUITE_SHUTDOWN_FN(elm));
+ failed_count += !elm_init(1, (char*[]){"exe"});
+ if (buffer) global_win = elm_win_add(NULL, "elm_suite", ELM_WIN_BASIC);
+ EINA_SAFETY_ON_TRUE_RETURN_VAL(failed_count, 255);
+ /* preload default theme */
+ failed_count += !elm_theme_group_path_find(NULL, "elm/button/base/default");
+ EINA_SAFETY_ON_TRUE_RETURN_VAL(failed_count, 255);
+ failed_count += !elm_theme_group_path_find(NULL, "elm/border/base/default");
+ EINA_SAFETY_ON_TRUE_RETURN_VAL(failed_count, 255);
+ failed_count += !elm_theme_group_path_find(NULL, "elm/win/base/default");
+ EINA_SAFETY_ON_TRUE_RETURN_VAL(failed_count, 255);
+
+ /* none of these will be found in the default theme,
+ * but all are "fetched" hundreds of times
+ * T6865
+ */
+ elm_theme_group_path_find(NULL, "elm/cursor/top_side/default");
+ elm_theme_group_path_find(NULL, "elm/cursor/bottom_side/default");
+ elm_theme_group_path_find(NULL, "elm/cursor/top_left_corner/default");
+ elm_theme_group_path_find(NULL, "elm/cursor/bottom_left_corner/default");
+ elm_theme_group_path_find(NULL, "elm/cursor/top_right_corner/default");
+ elm_theme_group_path_find(NULL, "elm/cursor/bottom_right_corner/default");
+
+
+ elm_theme_group_path_find(NULL, "elm/colorselector/item/color/default");
+
+ failed_count += _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
+ "Elementary", etc, SUITE_INIT_FN(elm2), SUITE_SHUTDOWN_FN(elm));
return (failed_count == 0) ? 0 : 255;
}
diff --git a/src/tests/elementary/elm_suite.h b/src/tests/elementary/elm_suite.h
index 2cae845284..f8ea895818 100644
--- a/src/tests/elementary/elm_suite.h
+++ b/src/tests/elementary/elm_suite.h
@@ -3,7 +3,9 @@
#include <check.h>
#include "elm_test_helper.h"
+#include "../efl_check.h"
+#include <Evas.h>
void elm_test_init(TCase *tc);
void elm_test_config(TCase *tc);
void elm_test_check(TCase *tc);
@@ -85,4 +87,6 @@ void elm_code_test_widget_text(TCase *tc);
void elm_code_test_widget_selection(TCase *tc);
void elm_code_test_widget_undo(TCase *tc);
+Evas_Object *win_add();
+
#endif /* _ELM_SUITE_H */
diff --git a/src/tests/elementary/elm_test_actionslider.c b/src/tests/elementary/elm_test_actionslider.c
index c84bfbac4b..5509cc79bb 100644
--- a/src/tests/elementary/elm_test_actionslider.c
+++ b/src/tests/elementary/elm_test_actionslider.c
@@ -2,28 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_actionslider_legacy_type_check)
+{
+ Evas_Object *win, *actionslider;
+ const char *type;
+
+ win = win_add(NULL, "actionslider", ELM_WIN_BASIC);
+
+ actionslider = elm_actionslider_add(win);
+
+ type = elm_object_widget_type_get(actionslider);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Actionslider"));
+
+ type = evas_object_type_get(actionslider);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_actionslider"));
+
+}
+EFL_END_TEST
+
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *actionslider;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "actionslider", ELM_WIN_BASIC);
+ win = win_add(NULL, "actionslider", ELM_WIN_BASIC);
actionslider = elm_actionslider_add(win);
- role = efl_access_role_get(actionslider);
+ role = efl_access_object_role_get(actionslider);
ck_assert(role == EFL_ACCESS_ROLE_SLIDER);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_actionslider(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_actionslider_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_atspi.c b/src/tests/elementary/elm_test_atspi.c
index 63d133c04e..1fdfa093ad 100644
--- a/src/tests/elementary/elm_test_atspi.c
+++ b/src/tests/elementary/elm_test_atspi.c
@@ -3,8 +3,8 @@
#endif
#define ELM_INTERNAL_API_ARGESFSDFEFC
-#define EFL_ACCESS_BETA
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_BETA
+#define EFL_ACCESS_OBJECT_PROTECTED
#include <Elementary.h>
#include "elm_priv.h"
@@ -14,7 +14,7 @@ static Evas_Object *g_win, *g_btn, *g_bg;
void generate_app(void)
{
- g_win = elm_win_add(NULL, "Title", ELM_WIN_BASIC);
+ g_win = win_add(NULL, "Title", ELM_WIN_BASIC);
evas_object_geometry_set(g_win, 100, 100, 100, 100);
g_bg = elm_bg_add(g_win);
@@ -26,11 +26,9 @@ void generate_app(void)
evas_object_show(g_win);
}
-START_TEST (test_efl_access_app_obj_name_get)
+EFL_START_TEST (test_efl_access_app_obj_name_get)
{
- elm_init(0, NULL);
-
- Eo* root = efl_add(ELM_ATSPI_APP_OBJECT_CLASS, NULL);
+ Eo* root = efl_add_ref(ELM_ATSPI_APP_OBJECT_CLASS, NULL);
ck_assert(root != NULL);
@@ -38,23 +36,21 @@ START_TEST (test_efl_access_app_obj_name_get)
elm_app_name_set("Test name");
- ret = efl_access_name_get(root);
+ ret = efl_access_object_i18n_name_get(root);
ck_assert_str_eq(ret, "Test name");
efl_unref(root);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (test_efl_access_name_get)
+EFL_START_TEST (test_efl_access_object_i18n_name_get)
{
- elm_init(0, NULL);
generate_app();
const char *name;
- name = efl_access_name_get(g_btn);
+ name = efl_access_object_i18n_name_get(g_btn);
if (name && name[0]) {
ck_assert(0);
@@ -63,201 +59,177 @@ START_TEST (test_efl_access_name_get)
// Set name with additional text tags
elm_object_text_set(g_btn, "Some<br>text");
- name = efl_access_name_get(g_btn);
+ name = efl_access_object_i18n_name_get(g_btn);
// Accessible name should have cleared tags
ck_assert(name != NULL);
ck_assert_str_eq(name, "Some\ntext");
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (test_efl_access_name_set)
+EFL_START_TEST (test_efl_access_object_i18n_name_set)
{
- elm_init(0, NULL);
generate_app();
const char *name;
elm_object_text_set(g_btn, "Other text");
- efl_access_name_set(g_btn, "Test name");
+ efl_access_object_i18n_name_set(g_btn, "Test name");
- name = efl_access_name_get(g_btn);
+ name = efl_access_object_i18n_name_get(g_btn);
ck_assert(name != NULL);
ck_assert_str_eq(name, "Test name");
- efl_access_name_set(g_btn, NULL);
- name = efl_access_name_get(g_btn);
+ efl_access_object_i18n_name_set(g_btn, NULL);
+ name = efl_access_object_i18n_name_get(g_btn);
ck_assert(name != NULL);
ck_assert_str_eq(name, "Other text");
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (test_efl_access_role_get)
+EFL_START_TEST (test_efl_access_object_role_get)
{
- elm_init(0, NULL);
-
- Eo* root = efl_add(ELM_ATSPI_APP_OBJECT_CLASS, NULL);
+ Eo* root = efl_add_ref(ELM_ATSPI_APP_OBJECT_CLASS, NULL);
Efl_Access_Role role;
- role = efl_access_role_get(root);
+ role = efl_access_object_role_get(root);
ck_assert(role == EFL_ACCESS_ROLE_APPLICATION);
efl_unref(root);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (test_efl_access_role_set)
+EFL_START_TEST (test_efl_access_object_role_set)
{
- elm_init(0, NULL);
generate_app();
Efl_Access_Role role;
- efl_access_role_set(g_btn, EFL_ACCESS_ROLE_ACCELERATOR_LABEL);
- role = efl_access_role_get(g_btn);
+ efl_access_object_role_set(g_btn, EFL_ACCESS_ROLE_ACCELERATOR_LABEL);
+ role = efl_access_object_role_get(g_btn);
if (role != EFL_ACCESS_ROLE_ACCELERATOR_LABEL)
ck_assert(0);
- efl_access_role_set(g_btn, EFL_ACCESS_ROLE_ENTRY);
- role = efl_access_role_get(g_btn);
+ efl_access_object_role_set(g_btn, EFL_ACCESS_ROLE_ENTRY);
+ role = efl_access_object_role_get(g_btn);
if (role != EFL_ACCESS_ROLE_ENTRY)
ck_assert(0);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (test_efl_access_role_name_get)
+EFL_START_TEST (test_efl_access_object_role_name_get)
{
- elm_init(0, NULL);
-
- Eo* root = efl_add(ELM_ATSPI_APP_OBJECT_CLASS, NULL);
+ Eo* root = efl_add_ref(ELM_ATSPI_APP_OBJECT_CLASS, NULL);
const char *ret = NULL;
- ret = efl_access_role_name_get(root);
+ ret = efl_access_object_role_name_get(root);
ck_assert(ret != NULL);
efl_unref(root);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (test_efl_access_localized_role_name_get)
+EFL_START_TEST (test_efl_access_object_localized_role_name_get)
{
- elm_init(0, NULL);
-
- Eo* root = efl_add(ELM_ATSPI_APP_OBJECT_CLASS, NULL);
+ Eo* root = efl_add_ref(ELM_ATSPI_APP_OBJECT_CLASS, NULL);
const char *ret = NULL;
- ret = efl_access_localized_role_name_get(root);
+ ret = efl_access_object_localized_role_name_get(root);
ck_assert(ret != NULL);
efl_unref(root);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (test_efl_access_description_set)
+EFL_START_TEST (test_efl_access_object_description_set)
{
- elm_init(0, NULL);
-
- Eo* root = efl_add(ELM_ATSPI_APP_OBJECT_CLASS, NULL);
+ Eo* root = efl_add_ref(ELM_ATSPI_APP_OBJECT_CLASS, NULL);
const char *ret = NULL;
const char *desc = "Test description";
- ret = efl_access_description_get(root);
+ ret = efl_access_object_description_get(root);
ck_assert(ret == NULL);
- efl_access_description_set(root, desc);
- ret = efl_access_description_get(root);
+ efl_access_object_description_set(root, desc);
+ ret = efl_access_object_description_get(root);
ck_assert(ret != NULL);
ck_assert_str_eq(ret, "Test description");
- efl_access_description_set(root, NULL);
- ret = efl_access_description_get(root);
+ efl_access_object_description_set(root, NULL);
+ ret = efl_access_object_description_get(root);
ck_assert(ret == NULL);
efl_unref(root);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
/* Test if initial description value is NULL */
-START_TEST (test_efl_access_description_get)
+EFL_START_TEST (test_efl_access_object_description_get)
{
- elm_init(0, NULL);
generate_app();
const char *descr;
- descr = efl_access_description_get(g_bg);
+ descr = efl_access_object_description_get(g_bg);
ck_assert(descr == NULL);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (test_efl_access_children_and_parent)
+EFL_START_TEST (test_efl_access_children_and_parent)
{
- elm_init(0, NULL);
-
generate_app();
- Eo* root = efl_add(ELM_ATSPI_APP_OBJECT_CLASS, NULL);
+ Eo* root = efl_add_ref(ELM_ATSPI_APP_OBJECT_CLASS, NULL);
Eina_List *child_list = NULL;
- child_list = efl_access_children_get(root);
+ child_list = efl_access_object_access_children_get(root);
- //bg_child_list = efl_access_children_get(eina_list_nth(child_list, 0));
+ //bg_child_list = efl_access_object_access_children_get(eina_list_nth(child_list, 0));
- ck_assert(eina_list_count(child_list) == 1);
+ ck_assert_int_eq(eina_list_count(child_list), 1);
Eo *win = NULL;
win = eina_list_nth(child_list, 0);
- ck_assert(win != NULL);
- ck_assert(win == g_win);
+ ck_assert_ptr_ne(win, NULL);
+ ck_assert_ptr_eq(win, g_win);
efl_unref(root);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (test_efl_access_children_and_parent2)
+EFL_START_TEST (test_efl_access_children_and_parent2)
{
- elm_init(0, NULL);
-
generate_app();
- Eo* root = efl_add(ELM_ATSPI_APP_OBJECT_CLASS, NULL);
+ Eo* root = efl_add_ref(ELM_ATSPI_APP_OBJECT_CLASS, NULL);
Eo *win = NULL;
Eina_List *root_children;
- root_children = efl_access_children_get(root);
+ root_children = efl_access_object_access_children_get(root);
win = eina_list_nth(root_children, 0);
Eina_List *win_children;
- win_children = efl_access_children_get(win);
+ win_children = efl_access_object_access_children_get(win);
ck_assert(eina_list_count(win_children) == 1);
@@ -268,89 +240,87 @@ START_TEST (test_efl_access_children_and_parent2)
ck_assert(btn == g_btn);
efl_unref(root);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
/* Initial value of translation domain should be NULL */
-START_TEST (test_efl_access_translation_domain_get)
+EFL_START_TEST (test_efl_access_object_translation_domain_get)
{
- elm_init(0, NULL);
generate_app();
const char *domain;
- domain = efl_access_translation_domain_get(g_btn);
+ domain = efl_access_object_translation_domain_get(g_btn);
ck_assert(domain == NULL);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (test_efl_access_translation_domain_set)
+EFL_START_TEST (test_efl_access_object_translation_domain_set)
{
- elm_init(0, NULL);
generate_app();
const char *domain;
- efl_access_translation_domain_set(g_btn, "Test translation_domain");
- domain = efl_access_translation_domain_get(g_btn);
+ efl_access_object_translation_domain_set(g_btn, "Test translation_domain");
+ domain = efl_access_object_translation_domain_get(g_btn);
ck_assert(domain != NULL);
ck_assert_str_eq(domain, "Test translation_domain");
- efl_access_translation_domain_set(g_btn, NULL);
- domain = efl_access_translation_domain_get(g_btn);
+ efl_access_object_translation_domain_set(g_btn, NULL);
+ domain = efl_access_object_translation_domain_get(g_btn);
ck_assert(domain == NULL);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (test_efl_access_relationship_append)
+EFL_START_TEST (test_efl_access_object_relationship_append)
{
- elm_init(0, NULL);
generate_app();
- Efl_Access_Relation_Set set;
Efl_Access_Relation *rel, *rel_to, *rel_from;
- Eina_List *l;
+ Eina_Iterator *it;
+ unsigned int i = 0;
- efl_access_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg);
- efl_access_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_win);
- set = efl_access_relation_set_get(g_btn);
+ efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg);
+ efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_win);
+ it = efl_access_object_relations_get(g_btn);
- ck_assert(set != NULL);
- ck_assert(eina_list_count(set) >= 2);
+ ck_assert(it != NULL);
rel_to = rel_from = NULL;
- EINA_LIST_FOREACH(set, l, rel)
+ EINA_ITERATOR_FOREACH(it, rel)
{
+ i++;
+
if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO)
rel_to = rel;
if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM)
rel_from = rel;
}
+ ck_assert(i >= 2);
ck_assert(rel_to != NULL);
ck_assert(eina_list_data_find(rel_to->objects, g_bg) != NULL);
ck_assert(rel_from != NULL);
ck_assert(eina_list_data_find(rel_from->objects, g_win) != NULL);
- efl_access_relation_set_free(set);
+ eina_iterator_free(it);
/* Check if append do not procude duplicated relations */
- efl_access_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg);
- efl_access_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_win);
- set = efl_access_relation_set_get(g_btn);
+ efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg);
+ efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_win);
+ it = efl_access_object_relations_get(g_btn); i = 0;
rel_to = rel_from = NULL;
- EINA_LIST_FOREACH(set, l, rel)
+ EINA_ITERATOR_FOREACH(it, rel)
{
+ i++;
+
if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO)
rel_to = rel;
if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM)
@@ -367,54 +337,56 @@ START_TEST (test_efl_access_relationship_append)
rel_from->objects = eina_list_remove(rel_from->objects, g_win);
ck_assert(eina_list_data_find(rel_from->objects, g_win) == NULL);
- efl_access_relation_set_free(set);
-
- elm_shutdown();
+ eina_iterator_free(it);
}
-END_TEST
+EFL_END_TEST
-START_TEST (test_efl_access_relationship_remove)
+EFL_START_TEST (test_efl_access_object_relationship_remove)
{
- elm_init(0, NULL);
generate_app();
- Efl_Access_Relation_Set set;
Efl_Access_Relation *rel, *rel_to, *rel_from;
- Eina_List *l;
+ Eina_Iterator *it;
+ unsigned int i = 0;
/* Test if removal of single relationship works */
- efl_access_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg);
- efl_access_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_win);
- efl_access_relationship_remove(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg);
- set = efl_access_relation_set_get(g_btn);
+ efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg);
+ efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_win);
+ efl_access_object_relationship_remove(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg);
+ it = efl_access_object_relations_get(g_btn);
- ck_assert(set != NULL);
- ck_assert(eina_list_count(set) >= 1);
+ ck_assert(it != NULL);
rel_to = rel_from = NULL;
- EINA_LIST_FOREACH(set, l, rel)
+ EINA_ITERATOR_FOREACH(it, rel)
{
+ i++;
+
if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO)
rel_to = rel;
if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM)
rel_from = rel;
}
+ ck_assert(i >= 1);
+
if (rel_to) ck_assert(eina_list_data_find(rel_to->objects, g_bg) == NULL);
ck_assert(rel_from != NULL);
ck_assert(eina_list_data_find(rel_from->objects, g_win) != NULL);
- efl_access_relation_set_free(set);
+ eina_iterator_free(it);
/* Test if removal of type relationship works */
- efl_access_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg);
- efl_access_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_win);
- efl_access_relationship_remove(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, NULL);
- set = efl_access_relation_set_get(g_btn);
+ efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg);
+ efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_win);
+ efl_access_object_relationship_remove(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, NULL);
+ it = efl_access_object_relations_get(g_btn); i = 0;
rel_to = rel_from = NULL;
- EINA_LIST_FOREACH(set, l, rel)
+ EINA_ITERATOR_FOREACH(it, rel)
{
+ i++;
+
if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO)
rel_to = rel;
if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM)
@@ -425,17 +397,19 @@ START_TEST (test_efl_access_relationship_remove)
ck_assert(rel_from != NULL);
ck_assert(eina_list_data_find(rel_from->objects, g_win) != NULL);
- efl_access_relation_set_free(set);
+ eina_iterator_free(it);
/* Test if relationship is implicity removed when object is deleted */
- efl_access_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg);
- efl_access_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_bg);
+ efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg);
+ efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_bg);
efl_del(g_bg);
- set = efl_access_relation_set_get(g_btn);
+ it = efl_access_object_relations_get(g_btn); i = 0;
rel_to = rel_from = NULL;
- EINA_LIST_FOREACH(set, l, rel)
+ EINA_ITERATOR_FOREACH(it, rel)
{
+ i++;
+
if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO)
rel_to = rel;
if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM)
@@ -445,57 +419,52 @@ START_TEST (test_efl_access_relationship_remove)
if (rel_to) ck_assert(eina_list_data_find(rel_to->objects, g_bg) == NULL);
if (rel_from) ck_assert(eina_list_data_find(rel_from->objects, g_bg) == NULL);
- efl_access_relation_set_free(set);
- elm_shutdown();
+ eina_iterator_free(it);
}
-END_TEST
+EFL_END_TEST
-START_TEST (test_efl_access_relationships_clear)
+EFL_START_TEST (test_efl_access_object_relationships_clear)
{
- Efl_Access_Relation_Set set;
Efl_Access_Relation *rel;
- Eina_List *l;
+ Eina_Iterator *it;
- elm_init(0, NULL);
generate_app();
- efl_access_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg);
- efl_access_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_bg);
- efl_access_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_win);
- efl_access_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_win);
+ efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg);
+ efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_bg);
+ efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_win);
+ efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_win);
- efl_access_relationships_clear(g_btn);
+ efl_access_object_relationships_clear(g_btn);
- set = efl_access_relation_set_get(g_btn);
- EINA_LIST_FOREACH(set, l, rel)
+ it = efl_access_object_relations_get(g_btn);
+ EINA_ITERATOR_FOREACH(it, rel)
{
ck_assert(!((rel->type == EFL_ACCESS_RELATION_FLOWS_TO) && eina_list_data_find(rel->objects, g_bg)));
ck_assert(!((rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) && eina_list_data_find(rel->objects, g_bg)));
ck_assert(!((rel->type == EFL_ACCESS_RELATION_FLOWS_TO) && eina_list_data_find(rel->objects, g_win)));
ck_assert(!((rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) && eina_list_data_find(rel->objects, g_win)));
}
-
- efl_access_relation_set_free(set);
- elm_shutdown();
+ eina_iterator_free(it);
}
-END_TEST
+EFL_END_TEST
void elm_test_atspi(TCase *tc)
{
tcase_add_test(tc, test_efl_access_app_obj_name_get);
- tcase_add_test(tc, test_efl_access_name_get);
- tcase_add_test(tc, test_efl_access_name_set);
- tcase_add_test(tc, test_efl_access_role_get);
- tcase_add_test(tc, test_efl_access_role_set);
- tcase_add_test(tc, test_efl_access_role_name_get);
- tcase_add_test(tc, test_efl_access_localized_role_name_get);
- tcase_add_test(tc, test_efl_access_description_set);
- tcase_add_test(tc, test_efl_access_description_get);
+ tcase_add_test(tc, test_efl_access_object_i18n_name_get);
+ tcase_add_test(tc, test_efl_access_object_i18n_name_set);
+ tcase_add_test(tc, test_efl_access_object_role_get);
+ tcase_add_test(tc, test_efl_access_object_role_set);
+ tcase_add_test(tc, test_efl_access_object_role_name_get);
+ tcase_add_test(tc, test_efl_access_object_localized_role_name_get);
+ tcase_add_test(tc, test_efl_access_object_description_set);
+ tcase_add_test(tc, test_efl_access_object_description_get);
tcase_add_test(tc, test_efl_access_children_and_parent);
tcase_add_test(tc, test_efl_access_children_and_parent2);
- tcase_add_test(tc, test_efl_access_translation_domain_get);
- tcase_add_test(tc, test_efl_access_translation_domain_set);
- tcase_add_test(tc, test_efl_access_relationship_append);
- tcase_add_test(tc, test_efl_access_relationship_remove);
- tcase_add_test(tc, test_efl_access_relationships_clear);
+ tcase_add_test(tc, test_efl_access_object_translation_domain_get);
+ tcase_add_test(tc, test_efl_access_object_translation_domain_set);
+ tcase_add_test(tc, test_efl_access_object_relationship_append);
+ tcase_add_test(tc, test_efl_access_object_relationship_remove);
+ tcase_add_test(tc, test_efl_access_object_relationships_clear);
}
diff --git a/src/tests/elementary/elm_test_bg.c b/src/tests/elementary/elm_test_bg.c
index 8c2047d7a2..979a3c2a7c 100644
--- a/src/tests/elementary/elm_test_bg.c
+++ b/src/tests/elementary/elm_test_bg.c
@@ -5,6 +5,53 @@
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_bg_legacy_type_check)
+{
+ Evas_Object *win, *bg;
+ const char *type;
+
+ win = win_add(NULL, "bg", ELM_WIN_BASIC);
+
+ bg = elm_bg_add(win);
+
+ type = elm_object_widget_type_get(bg);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Bg"));
+
+ type = evas_object_type_get(bg);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_bg"));
+
+}
+EFL_END_TEST
+
+EFL_START_TEST (elm_bg_legacy_file_set_get_check)
+{
+ Evas_Object *win, *bg;
+ const char *file = NULL, *key = NULL;
+
+ win = win_add(NULL, "bg", ELM_WIN_BASIC);
+
+ bg = elm_bg_add(win);
+
+ /* This test case will check the following things for legacy widget.
+ * It is all about backward compatibility.
+ * 1. Set and Get file path, key even if there is no proper image file for the given file path.
+ * 2. Even if there is a proper image file and the given file path is interpreted to full file path,
+ * the Get function should give original file path. NOT interpreted. */
+ elm_bg_file_set(bg, "~/test.png", "test_key");
+ elm_bg_file_get(bg, &file, &key);
+
+ ck_assert(file != NULL);
+ ck_assert(!strcmp(file, "~/test.png"));
+ ck_assert(key != NULL);
+ ck_assert(!strcmp(key, "test_key"));
+
+}
+EFL_END_TEST
+
void elm_test_bg(TCase *tc EINA_UNUSED)
{
+ tcase_add_test(tc, elm_bg_legacy_type_check);
+ tcase_add_test(tc, elm_bg_legacy_file_set_get_check);
}
diff --git a/src/tests/elementary/elm_test_box.c b/src/tests/elementary/elm_test_box.c
index 9e02995f90..56261ec7ac 100644
--- a/src/tests/elementary/elm_test_box.c
+++ b/src/tests/elementary/elm_test_box.c
@@ -2,28 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_box_legacy_type_check)
+{
+ Evas_Object *win, *box;
+ const char *type;
+
+ win = win_add(NULL, "box", ELM_WIN_BASIC);
+
+ box = elm_box_add(win);
+
+ type = elm_object_widget_type_get(box);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Box"));
+
+ type = evas_object_type_get(box);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_box"));
+
+}
+EFL_END_TEST
+
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *box;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "box", ELM_WIN_BASIC);
+ win = win_add(NULL, "box", ELM_WIN_BASIC);
box = elm_box_add(win);
- role = efl_access_role_get(box);
+ role = efl_access_object_role_get(box);
ck_assert(role == EFL_ACCESS_ROLE_FILLER);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_box(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_box_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_bubble.c b/src/tests/elementary/elm_test_bubble.c
index 490bef012a..3d6d71c458 100644
--- a/src/tests/elementary/elm_test_bubble.c
+++ b/src/tests/elementary/elm_test_bubble.c
@@ -2,29 +2,48 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_bubble_legacy_type_check)
+{
+ Evas_Object *win, *bubble;
+ const char *type;
+
+ win = win_add(NULL, "bubble", ELM_WIN_BASIC);
+
+ bubble = elm_bubble_add(win);
+
+ type = elm_object_widget_type_get(bubble);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Bubble"));
+
+ type = evas_object_type_get(bubble);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_bubble"));
+
+}
+EFL_END_TEST
+
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *bubble;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "bubble", ELM_WIN_BASIC);
+ win = win_add(NULL, "bubble", ELM_WIN_BASIC);
bubble = elm_bubble_add(win);
- role = efl_access_role_get(bubble);
+ role = efl_access_object_role_get(bubble);
ck_assert(role == EFL_ACCESS_ROLE_FILLER);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_bubble(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_bubble_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_button.c b/src/tests/elementary/elm_test_button.c
index 3a23fe8cad..f5bf6f117a 100644
--- a/src/tests/elementary/elm_test_button.c
+++ b/src/tests/elementary/elm_test_button.c
@@ -2,48 +2,65 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#define EFL_ACCESS_COMPONENT_PROTECTED
#define EFL_ACCESS_ACTION_PROTECTED
#include <Elementary.h>
#include "elm_suite.h"
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_button_legacy_type_check)
+{
+ Evas_Object *win, *button;
+ const char *type;
+
+ win = win_add(NULL, "button", ELM_WIN_BASIC);
+
+ button = elm_button_add(win);
+
+ type = elm_object_widget_type_get(button);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Button"));
+
+ type = evas_object_type_get(button);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_button"));
+
+}
+EFL_END_TEST
+
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *button;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "button", ELM_WIN_BASIC);
+ win = win_add(NULL, "button", ELM_WIN_BASIC);
button = elm_button_add(win);
- role = efl_access_role_get(button);
+ role = efl_access_object_role_get(button);
ck_assert(role == EFL_ACCESS_ROLE_PUSH_BUTTON);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_atspi_interfaces_check)
+EFL_START_TEST (elm_atspi_interfaces_check)
{
Evas_Object *win, *button;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "button", ELM_WIN_BASIC);
+ win = win_add(NULL, "button", ELM_WIN_BASIC);
button = elm_button_add(win);
- ck_assert(efl_isa(button, EFL_ACCESS_MIXIN));
+ ck_assert(efl_isa(button, EFL_ACCESS_OBJECT_MIXIN));
ck_assert(efl_isa(button, EFL_ACCESS_COMPONENT_MIXIN));
ck_assert(efl_isa(button, EFL_ACCESS_ACTION_MIXIN));
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_button(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
- tcase_add_test(tc, elm_atspi_interfaces_check);
+ tcase_add_test(tc, elm_button_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_atspi_interfaces_check);
}
diff --git a/src/tests/elementary/elm_test_calendar.c b/src/tests/elementary/elm_test_calendar.c
index 6cc3b5be50..cf30958297 100644
--- a/src/tests/elementary/elm_test_calendar.c
+++ b/src/tests/elementary/elm_test_calendar.c
@@ -2,28 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_calendar_legacy_type_check)
+{
+ Evas_Object *win, *calendar;
+ const char *type;
+
+ win = win_add(NULL, "calendar", ELM_WIN_BASIC);
+
+ calendar = elm_calendar_add(win);
+
+ type = elm_object_widget_type_get(calendar);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Calendar"));
+
+ type = evas_object_type_get(calendar);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_calendar"));
+
+}
+EFL_END_TEST
+
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *calendar;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "calendar", ELM_WIN_BASIC);
+ win = win_add(NULL, "calendar", ELM_WIN_BASIC);
calendar = elm_calendar_add(win);
- role = efl_access_role_get(calendar);
+ role = efl_access_object_role_get(calendar);
ck_assert(role == EFL_ACCESS_ROLE_CALENDAR);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_calendar(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_calendar_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_check.c b/src/tests/elementary/elm_test_check.c
index 2d1c06ec8f..af65407f00 100644
--- a/src/tests/elementary/elm_test_check.c
+++ b/src/tests/elementary/elm_test_check.c
@@ -2,16 +2,35 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
-START_TEST (elm_check_onoff_text)
+EFL_START_TEST (elm_check_legacy_type_check)
{
Evas_Object *win, *check;
+ const char *type;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "check", ELM_WIN_BASIC);
+ win = win_add(NULL, "check", ELM_WIN_BASIC);
+
+ check = elm_check_add(win);
+
+ type = elm_object_widget_type_get(check);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Check"));
+
+ type = evas_object_type_get(check);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_check"));
+
+}
+EFL_END_TEST
+
+EFL_START_TEST (elm_check_onoff_text)
+{
+ Evas_Object *win, *check;
+
+ win = win_add(NULL, "check", ELM_WIN_BASIC);
check = elm_check_add(win);
elm_object_style_set(check, "toggle");
@@ -25,17 +44,15 @@ START_TEST (elm_check_onoff_text)
ck_assert(elm_object_part_text_get(check, "on") == NULL);
ck_assert(elm_object_part_text_get(check, "off") == NULL);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_check_state)
+EFL_START_TEST (elm_check_state)
{
Evas_Object *win, *check;
Eina_Bool state = EINA_TRUE;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "check", ELM_WIN_BASIC);
+ win = win_add(NULL, "check", ELM_WIN_BASIC);
check = elm_check_add(win);
elm_check_state_pointer_set(check, &state);
@@ -46,29 +63,27 @@ START_TEST (elm_check_state)
ck_assert(elm_check_state_get(check) == EINA_FALSE);
ck_assert(state == EINA_FALSE);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *check;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "check", ELM_WIN_BASIC);
+ win = win_add(NULL, "check", ELM_WIN_BASIC);
check = elm_check_add(win);
- role = efl_access_role_get(check);
+ role = efl_access_object_role_get(check);
ck_assert(role == EFL_ACCESS_ROLE_CHECK_BOX);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_check(TCase *tc)
{
+ tcase_add_test(tc, elm_check_legacy_type_check);
tcase_add_test(tc, elm_check_onoff_text);
tcase_add_test(tc, elm_check_state);
tcase_add_test(tc, elm_atspi_role_get);
diff --git a/src/tests/elementary/elm_test_clock.c b/src/tests/elementary/elm_test_clock.c
index f391e21b60..fde065ee4f 100644
--- a/src/tests/elementary/elm_test_clock.c
+++ b/src/tests/elementary/elm_test_clock.c
@@ -2,29 +2,48 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_clock_legacy_type_check)
+{
+ Evas_Object *win, *clock;
+ const char *type;
+
+ win = win_add(NULL, "clock", ELM_WIN_BASIC);
+
+ clock = elm_clock_add(win);
+
+ type = elm_object_widget_type_get(clock);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Clock"));
+
+ type = evas_object_type_get(clock);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_clock"));
+
+}
+EFL_END_TEST
+
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *clk;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "clock", ELM_WIN_BASIC);
+ win = win_add(NULL, "clock", ELM_WIN_BASIC);
clk = elm_clock_add(win);
- role = efl_access_role_get(clk);
+ role = efl_access_object_role_get(clk);
ck_assert(role == EFL_ACCESS_ROLE_TEXT);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_clock(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_clock_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_colorselector.c b/src/tests/elementary/elm_test_colorselector.c
index 0703583211..194856f2b9 100644
--- a/src/tests/elementary/elm_test_colorselector.c
+++ b/src/tests/elementary/elm_test_colorselector.c
@@ -2,17 +2,36 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
-START_TEST (elm_colorselector_palette)
+EFL_START_TEST (elm_colorselector_legacy_type_check)
+{
+ Evas_Object *win, *colorselector;
+ const char *type;
+
+ win = win_add(NULL, "colorselector", ELM_WIN_BASIC);
+
+ colorselector = elm_colorselector_add(win);
+
+ type = elm_object_widget_type_get(colorselector);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Colorselector"));
+
+ type = evas_object_type_get(colorselector);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_colorselector"));
+
+}
+EFL_END_TEST
+
+EFL_START_TEST (elm_colorselector_palette)
{
Evas_Object *win, *c;
unsigned int palette_cnt;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "check", ELM_WIN_BASIC);
+ win = win_add(NULL, "check", ELM_WIN_BASIC);
c = elm_colorselector_add(win);
/* Get the count of default palettes */
@@ -29,29 +48,27 @@ START_TEST (elm_colorselector_palette)
ck_assert(eina_list_count(elm_colorselector_palette_items_get(c)) == palette_cnt);
evas_object_del(c);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *c;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "colorselector", ELM_WIN_BASIC);
+ win = win_add(NULL, "colorselector", ELM_WIN_BASIC);
c = elm_colorselector_add(win);
- role = efl_access_role_get(c);
+ role = efl_access_object_role_get(c);
ck_assert(role == EFL_ACCESS_ROLE_COLOR_CHOOSER);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_colorselector(TCase *tc)
{
+ tcase_add_test(tc, elm_colorselector_legacy_type_check);
tcase_add_test(tc, elm_colorselector_palette);
tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_config.c b/src/tests/elementary/elm_test_config.c
index 15a799837e..6546790f0d 100644
--- a/src/tests/elementary/elm_test_config.c
+++ b/src/tests/elementary/elm_test_config.c
@@ -2,17 +2,15 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#include <Elementary.h>
#include "elm_suite.h"
#include <stdbool.h>
typedef unsigned int uint;
-START_TEST (elm_config_eoapi)
+EFL_START_TEST (elm_config_eoapi)
{
- elm_init(1, NULL);
-
Eo *cfg = efl_provider_find(efl_main_loop_get(), EFL_CONFIG_INTERFACE);
fail_if(!cfg);
@@ -101,7 +99,8 @@ START_TEST (elm_config_eoapi)
CONFIG_CHKB(item_select_on_focus_disabled, !old);
CONFIG_CHKB(first_item_focus_on_first_focusin, 0);
CONFIG_CHKB(mirrored, 0);
- CONFIG_CHKB(clouseau_enabled, !old);
+ //see clouseau tests
+ //CONFIG_CHKB(clouseau_enabled, !old);
CONFIG_CHKD(glayer_long_tap_start_timeout, 0);
CONFIG_CHKD(glayer_double_tap_timeout, 0);
//color_overlay
@@ -142,28 +141,24 @@ START_TEST (elm_config_eoapi)
fail(channels[i].name);
}
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_config_win)
+EFL_START_TEST (elm_config_win)
{
- elm_init(1, NULL);
-
Eo *cfg = efl_provider_find(efl_main_loop_get(), EFL_CONFIG_INTERFACE);
fail_if(!cfg);
- Eo *win = efl_add(EFL_UI_WIN_CLASS, NULL);
+ Eo *win = efl_add_ref(EFL_UI_WIN_CLASS, NULL);
Eo *cfg2 = efl_provider_find(win, EFL_CONFIG_INTERFACE);
fail_if(cfg != cfg2);
elm_config_cache_flush_interval_set(42);
fail_if(efl_config_int_get(win, "cache_flush_interval") != 42);
- efl_del(win);
- elm_shutdown();
+ efl_unref(win);
}
-END_TEST
+EFL_END_TEST
static inline Eina_Bool
_eina_list_string_has(const Eina_List *list, const char *str)
@@ -178,10 +173,8 @@ _eina_list_string_has(const Eina_List *list, const char *str)
return EINA_FALSE;
}
-START_TEST (elm_config_profiles)
+EFL_START_TEST (elm_config_profiles)
{
- elm_init(1, NULL);
-
// this only tests some of the profile APIs. we're not going to mess with
// the global config during make check :)
@@ -225,9 +218,8 @@ START_TEST (elm_config_profiles)
elm_config_profile_dir_free(dir);
eina_stringshare_del(str);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_config(TCase *tc)
{
diff --git a/src/tests/elementary/elm_test_conformant.c b/src/tests/elementary/elm_test_conformant.c
index fb8d5ce257..cdfbd0402b 100644
--- a/src/tests/elementary/elm_test_conformant.c
+++ b/src/tests/elementary/elm_test_conformant.c
@@ -2,28 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_conformant_legacy_type_check)
+{
+ Evas_Object *win, *conformant;
+ const char *type;
+
+ win = win_add(NULL, "conformant", ELM_WIN_BASIC);
+
+ conformant = elm_conformant_add(win);
+
+ type = elm_object_widget_type_get(conformant);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Conformant"));
+
+ type = evas_object_type_get(conformant);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_conformant"));
+
+}
+EFL_END_TEST
+
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *conformant;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "conformant", ELM_WIN_BASIC);
+ win = win_add(NULL, "conformant", ELM_WIN_BASIC);
conformant = elm_conformant_add(win);
- role = efl_access_role_get(conformant);
+ role = efl_access_object_role_get(conformant);
ck_assert(role == EFL_ACCESS_ROLE_FILLER);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_conformant(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_conformant_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_ctxpopup.c b/src/tests/elementary/elm_test_ctxpopup.c
index 87dca0a4d2..a9d066e1ed 100644
--- a/src/tests/elementary/elm_test_ctxpopup.c
+++ b/src/tests/elementary/elm_test_ctxpopup.c
@@ -2,28 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_ctxpopup_legacy_type_check)
+{
+ Evas_Object *win, *ctxpopup;
+ const char *type;
+
+ win = win_add(NULL, "ctxpopup", ELM_WIN_BASIC);
+
+ ctxpopup = elm_ctxpopup_add(win);
+
+ type = elm_object_widget_type_get(ctxpopup);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Ctxpopup"));
+
+ type = evas_object_type_get(ctxpopup);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_ctxpopup"));
+
+}
+EFL_END_TEST
+
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *ctxpopup;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "icon", ELM_WIN_BASIC);
+ win = win_add(NULL, "icon", ELM_WIN_BASIC);
ctxpopup = elm_ctxpopup_add(win);
- role = efl_access_role_get(ctxpopup);
+ role = efl_access_object_role_get(ctxpopup);
ck_assert(role == EFL_ACCESS_ROLE_POPUP_MENU);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_ctxpopup(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_ctxpopup_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_datetime.c b/src/tests/elementary/elm_test_datetime.c
index 881841c587..7a874516ba 100644
--- a/src/tests/elementary/elm_test_datetime.c
+++ b/src/tests/elementary/elm_test_datetime.c
@@ -2,28 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_datetime_legacy_type_check)
+{
+ Evas_Object *win, *datetime;
+ const char *type;
+
+ win = win_add(NULL, "datetime", ELM_WIN_BASIC);
+
+ datetime = elm_datetime_add(win);
+
+ type = elm_object_widget_type_get(datetime);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Datetime"));
+
+ type = evas_object_type_get(datetime);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_datetime"));
+
+}
+EFL_END_TEST
+
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *datetime;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "datetime", ELM_WIN_BASIC);
+ win = win_add(NULL, "datetime", ELM_WIN_BASIC);
datetime = elm_datetime_add(win);
- role = efl_access_role_get(datetime);
+ role = efl_access_object_role_get(datetime);
ck_assert(role == EFL_ACCESS_ROLE_DATE_EDITOR);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_datetime(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_datetime_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_dayselector.c b/src/tests/elementary/elm_test_dayselector.c
index ae75efc495..776687a157 100644
--- a/src/tests/elementary/elm_test_dayselector.c
+++ b/src/tests/elementary/elm_test_dayselector.c
@@ -2,29 +2,48 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_dayselector_legacy_type_check)
+{
+ Evas_Object *win, *dayselector;
+ const char *type;
+
+ win = win_add(NULL, "dayselector", ELM_WIN_BASIC);
+
+ dayselector = elm_dayselector_add(win);
+
+ type = elm_object_widget_type_get(dayselector);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Dayselector"));
+
+ type = evas_object_type_get(dayselector);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_dayselector"));
+
+}
+EFL_END_TEST
+
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *dayselector;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "dayselector", ELM_WIN_BASIC);
+ win = win_add(NULL, "dayselector", ELM_WIN_BASIC);
dayselector = elm_dayselector_add(win);
- role = efl_access_role_get(dayselector);
+ role = efl_access_object_role_get(dayselector);
ck_assert(role == EFL_ACCESS_ROLE_PANEL);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_dayselector(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_dayselector_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_diskselector.c b/src/tests/elementary/elm_test_diskselector.c
index 15052bc2b6..19bf3600ce 100644
--- a/src/tests/elementary/elm_test_diskselector.c
+++ b/src/tests/elementary/elm_test_diskselector.c
@@ -2,28 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_diskselector_legacy_type_check)
+{
+ Evas_Object *win, *diskselector;
+ const char *type;
+
+ win = win_add(NULL, "diskselector", ELM_WIN_BASIC);
+
+ diskselector = elm_diskselector_add(win);
+
+ type = elm_object_widget_type_get(diskselector);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Diskselector"));
+
+ type = evas_object_type_get(diskselector);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_diskselector"));
+
+}
+EFL_END_TEST
+
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *diskselector;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "diskselector", ELM_WIN_BASIC);
+ win = win_add(NULL, "diskselector", ELM_WIN_BASIC);
diskselector = elm_diskselector_add(win);
- role = efl_access_role_get(diskselector);
+ role = efl_access_object_role_get(diskselector);
ck_assert(role == EFL_ACCESS_ROLE_LIST);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_diskselector(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_diskselector_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_entry.c b/src/tests/elementary/elm_test_entry.c
index 07adf129fa..8b8091120a 100644
--- a/src/tests/elementary/elm_test_entry.c
+++ b/src/tests/elementary/elm_test_entry.c
@@ -2,25 +2,43 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#define EFL_ACCESS_TEXT_BETA
#define EFL_ACCESS_TEXT_PROTECTED
#include <Elementary.h>
#include "elm_suite.h"
-START_TEST (elm_entry_del)
+EFL_START_TEST (elm_entry_legacy_type_check)
{
Evas_Object *win, *entry;
+ const char *type;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
+
+ entry = elm_entry_add(win);
+
+ type = elm_object_widget_type_get(entry);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Entry"));
+
+ type = evas_object_type_get(entry);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_entry"));
+
+}
+EFL_END_TEST
+
+EFL_START_TEST (elm_entry_del)
+{
+ Evas_Object *win, *entry;
+
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
entry = elm_entry_add(win);
elm_object_text_set(entry, "TEST");
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void
_dummy_cb(void *data EINA_UNUSED, Eo *obj EINA_UNUSED,
@@ -28,14 +46,13 @@ _dummy_cb(void *data EINA_UNUSED, Eo *obj EINA_UNUSED,
{
}
-START_TEST (elm_entry_signal_callback)
+EFL_START_TEST (elm_entry_signal_callback)
{
Evas_Object *win, *entry;
void *data;
int k;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
entry = elm_entry_add(win);
@@ -65,11 +82,10 @@ START_TEST (elm_entry_signal_callback)
data = elm_layout_signal_callback_del(entry, "sig", "src", _dummy_cb);
fail_if(data);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_entry_atspi_text_char_get)
+EFL_START_TEST (elm_entry_atspi_text_char_get)
{
Evas_Object *win, *entry;
Eina_Unicode *expected;
@@ -78,8 +94,7 @@ START_TEST (elm_entry_atspi_text_char_get)
const char *txt = "ĄA11Y Ł TEST";
const char *mtxt = "<b>ĄA11Y</b> <title>Ł</> TEST";
- elm_init(1, NULL);
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
entry = elm_entry_add(win);
elm_object_text_set(entry, mtxt);
@@ -105,19 +120,17 @@ START_TEST (elm_entry_atspi_text_char_get)
ck_assert(val == 0);
free(expected);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_entry_atspi_text_char_count)
+EFL_START_TEST (elm_entry_atspi_text_char_count)
{
Evas_Object *win, *entry;
int val;
const char *mtxt = "<b>AĄ11Y</b> <title>Ł</> TEST";
- elm_init(1, NULL);
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
entry = elm_entry_add(win);
elm_object_text_set(entry, mtxt);
@@ -125,11 +138,10 @@ START_TEST (elm_entry_atspi_text_char_count)
val = efl_access_text_character_count_get(entry);
ck_assert(val == 12);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_entry_atspi_text_string_get_char)
+EFL_START_TEST (elm_entry_atspi_text_string_get_char)
{
Evas_Object *win, *entry;
char *val;
@@ -137,8 +149,7 @@ START_TEST (elm_entry_atspi_text_string_get_char)
const char *txt = "Lorem ipśum dolor sit amęt";
- elm_init(1, NULL);
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
entry = elm_entry_add(win);
elm_object_text_set(entry, txt);
@@ -170,11 +181,10 @@ START_TEST (elm_entry_atspi_text_string_get_char)
ck_assert(end == -1);
ck_assert(val == NULL);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_entry_atspi_text_string_get_word)
+EFL_START_TEST (elm_entry_atspi_text_string_get_word)
{
Evas_Object *win, *entry;
char *val;
@@ -182,8 +192,7 @@ START_TEST (elm_entry_atspi_text_string_get_word)
const char *txt = "Lorem ipśum dolor sit amęt";
- elm_init(1, NULL);
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
entry = elm_entry_add(win);
elm_object_text_set(entry, txt);
@@ -216,11 +225,10 @@ START_TEST (elm_entry_atspi_text_string_get_word)
ck_assert(val == NULL);
if (val) free(val);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_entry_atspi_text_string_get_paragraph)
+EFL_START_TEST (elm_entry_atspi_text_string_get_paragraph)
{
Evas_Object *win, *entry;
char *val;
@@ -228,8 +236,7 @@ START_TEST (elm_entry_atspi_text_string_get_paragraph)
const char *txt = "Lorem ipśum<br> dolor sit<br> amęt";
- elm_init(1, NULL);
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
entry = elm_entry_add(win);
elm_object_text_set(entry, txt);
@@ -262,11 +269,10 @@ START_TEST (elm_entry_atspi_text_string_get_paragraph)
ck_assert(val == NULL);
if (val) free(val);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_entry_atspi_text_string_get_line)
+EFL_START_TEST (elm_entry_atspi_text_string_get_line)
{
Evas_Object *win, *entry;
char *val;
@@ -274,8 +280,7 @@ START_TEST (elm_entry_atspi_text_string_get_line)
const char *txt = "Lorem ipśum<br> dolor sit amęt";
- elm_init(1, NULL);
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
entry = elm_entry_add(win);
evas_object_resize(entry, 500, 500);
@@ -297,18 +302,16 @@ START_TEST (elm_entry_atspi_text_string_get_line)
ck_assert(end == 29);
if (val) free(val);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_entry_atspi_text_text_get)
+EFL_START_TEST (elm_entry_atspi_text_text_get)
{
Evas_Object *win, *entry;
char *val;
const char *txt = "Lorem Xpśum dolor sit amęt";
- elm_init(1, NULL);
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
entry = elm_entry_add(win);
elm_object_text_set(entry, txt);
@@ -328,11 +331,10 @@ START_TEST (elm_entry_atspi_text_text_get)
ck_assert_str_eq(val, "Xpśum dolor");
if (val) free(val);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_entry_atspi_text_selections)
+EFL_START_TEST (elm_entry_atspi_text_selections)
{
Evas_Object *win, *entry;
int val, start, end;
@@ -340,8 +342,7 @@ START_TEST (elm_entry_atspi_text_selections)
Eina_Bool ret;
const char *txt = "Lorem ipśum<br> dolor sit\n amęt";
- elm_init(1, NULL);
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
entry = elm_entry_add(win);
elm_object_text_set(entry, txt);
@@ -352,14 +353,14 @@ START_TEST (elm_entry_atspi_text_selections)
elm_entry_select_region_set(entry, 2, 4);
val = efl_access_text_selections_count_get(entry);
ck_assert(val == 1);
- efl_access_text_selection_get(entry, 0, &start, &end);
+ efl_access_text_access_selection_get(entry, 0, &start, &end);
ck_assert(start == 2);
ck_assert(end == 4);
elm_entry_select_region_set(entry, 6, 10);
val = efl_access_text_selections_count_get(entry);
ck_assert(val == 1);
- efl_access_text_selection_get(entry, 0, &start, &end);
+ efl_access_text_access_selection_get(entry, 0, &start, &end);
ck_assert(start == 6);
ck_assert(end == 10);
@@ -374,29 +375,27 @@ START_TEST (elm_entry_atspi_text_selections)
str = elm_entry_selection_get(entry);
ck_assert(str == NULL);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *entry;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
entry = elm_entry_add(win);
- role = efl_access_role_get(entry);
+ role = efl_access_object_role_get(entry);
ck_assert(role == EFL_ACCESS_ROLE_ENTRY);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_entry(TCase *tc)
{
+ tcase_add_test(tc, elm_entry_legacy_type_check);
tcase_add_test(tc, elm_entry_del);
tcase_add_test(tc, elm_entry_signal_callback);
tcase_add_test(tc, elm_entry_atspi_text_char_get);
diff --git a/src/tests/elementary/elm_test_fileselector.c b/src/tests/elementary/elm_test_fileselector.c
index da2738d0ad..dd22df1a57 100644
--- a/src/tests/elementary/elm_test_fileselector.c
+++ b/src/tests/elementary/elm_test_fileselector.c
@@ -2,36 +2,55 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_fileselector_legacy_type_check)
+{
+ Evas_Object *win, *fileselector;
+ const char *type;
+
+ win = win_add(NULL, "fileselector", ELM_WIN_BASIC);
+
+ fileselector = elm_fileselector_add(win);
+
+ type = elm_object_widget_type_get(fileselector);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Fileselector"));
-START_TEST (elm_atspi_role_get)
+ type = evas_object_type_get(fileselector);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_fileselector"));
+
+}
+EFL_END_TEST
+
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *fileselector;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "fileselector", ELM_WIN_BASIC);
+ win = win_add(NULL, "fileselector", ELM_WIN_BASIC);
fileselector = elm_fileselector_add(win);
- role = efl_access_role_get(fileselector);
+ role = efl_access_object_role_get(fileselector);
ck_assert(role == EFL_ACCESS_ROLE_FILE_CHOOSER);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
static void
_ready_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
Eina_Bool *ret = data;
*ret = EINA_TRUE;
+
+ ecore_main_loop_quit();
}
-START_TEST (elm_fileselector_selected)
+EFL_START_TEST (elm_fileselector_selected)
{
Evas_Object *win, *fileselector;
Eina_Tmpstr *tmp_path;
@@ -40,8 +59,6 @@ START_TEST (elm_fileselector_selected)
char *path;
Eina_Bool open, selected;
- elm_init(1, NULL);
-
if (!eina_file_mkdtemp("elm_test-XXXXXX", &tmp_path))
{
/* can not test */
@@ -57,7 +74,7 @@ START_TEST (elm_fileselector_selected)
fp = fopen(exist, "w");
fclose(fp);
- win = elm_win_add(NULL, "fileselector", ELM_WIN_BASIC);
+ win = win_add(NULL, "fileselector", ELM_WIN_BASIC);
fileselector = elm_fileselector_add(win);
evas_object_smart_callback_add(fileselector, "directory,open", _ready_cb, &open);
@@ -81,12 +98,12 @@ START_TEST (elm_fileselector_selected)
eina_stringshare_del(no_exist);
free(path);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_fileselector(TCase *tc)
{
+ tcase_add_test(tc, elm_fileselector_legacy_type_check);
tcase_add_test(tc, elm_atspi_role_get);
tcase_add_test(tc, elm_fileselector_selected);
}
diff --git a/src/tests/elementary/elm_test_fileselector_button.c b/src/tests/elementary/elm_test_fileselector_button.c
index aa6e12f37f..c5bba5ccfa 100644
--- a/src/tests/elementary/elm_test_fileselector_button.c
+++ b/src/tests/elementary/elm_test_fileselector_button.c
@@ -2,28 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_fileselector_button_legacy_type_check)
+{
+ Evas_Object *win, *fs_button;
+ const char *type;
+
+ win = win_add(NULL, "fileselector_button", ELM_WIN_BASIC);
+
+ fs_button = elm_fileselector_button_add(win);
+
+ type = elm_object_widget_type_get(fs_button);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Fileselector_Button"));
+
+ type = evas_object_type_get(fs_button);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_fileselector_button"));
+
+}
+EFL_END_TEST
+
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *fs_button;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "fileselector_button", ELM_WIN_BASIC);
+ win = win_add(NULL, "fileselector_button", ELM_WIN_BASIC);
fs_button = elm_fileselector_button_add(win);
- role = efl_access_role_get(fs_button);
+ role = efl_access_object_role_get(fs_button);
ck_assert(role == EFL_ACCESS_ROLE_PUSH_BUTTON);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_fileselector_button(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_fileselector_button_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_fileselector_entry.c b/src/tests/elementary/elm_test_fileselector_entry.c
index fce9d3dc75..9fa0f14b66 100644
--- a/src/tests/elementary/elm_test_fileselector_entry.c
+++ b/src/tests/elementary/elm_test_fileselector_entry.c
@@ -2,28 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_fileselector_entry_legacy_type_check)
+{
+ Evas_Object *win, *fileselector_entry;
+ const char *type;
+
+ win = win_add(NULL, "fileselector_entry", ELM_WIN_BASIC);
+
+ fileselector_entry = elm_fileselector_entry_add(win);
+
+ type = elm_object_widget_type_get(fileselector_entry);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Fileselector_Entry"));
+
+ type = evas_object_type_get(fileselector_entry);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_fileselector_entry"));
+
+}
+EFL_END_TEST
+
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *fs_entry;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "fileselectorentry", ELM_WIN_BASIC);
+ win = win_add(NULL, "fileselectorentry", ELM_WIN_BASIC);
fs_entry = elm_fileselector_entry_add(win);
- role = efl_access_role_get(fs_entry);
+ role = efl_access_object_role_get(fs_entry);
ck_assert(role == EFL_ACCESS_ROLE_GROUPING);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_fileselector_entry(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_fileselector_entry_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_flip.c b/src/tests/elementary/elm_test_flip.c
index e13bfde007..c0bbd4e79f 100644
--- a/src/tests/elementary/elm_test_flip.c
+++ b/src/tests/elementary/elm_test_flip.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_flip_legacy_type_check)
+{
+ Evas_Object *win, *flip;
+ const char *type;
+
+ win = win_add(NULL, "flip", ELM_WIN_BASIC);
+
+ flip = elm_flip_add(win);
+
+ type = elm_object_widget_type_get(flip);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Flip"));
+
+ type = evas_object_type_get(flip);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_flip"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *flip;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "flip", ELM_WIN_BASIC);
+ win = win_add(NULL, "flip", ELM_WIN_BASIC);
flip = elm_flip_add(win);
- role = efl_access_role_get(flip);
+ role = efl_access_object_role_get(flip);
ck_assert(role == EFL_ACCESS_ROLE_PAGE_TAB_LIST);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_flip(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_flip_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_flipselector.c b/src/tests/elementary/elm_test_flipselector.c
index 426892904c..a4c3bafa88 100644
--- a/src/tests/elementary/elm_test_flipselector.c
+++ b/src/tests/elementary/elm_test_flipselector.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_flipselector_legacy_type_check)
+{
+ Evas_Object *win, *flipselector;
+ const char *type;
+
+ win = win_add(NULL, "flipselector", ELM_WIN_BASIC);
+
+ flipselector = elm_flipselector_add(win);
+
+ type = elm_object_widget_type_get(flipselector);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Flipselector"));
+
+ type = evas_object_type_get(flipselector);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_flipselector"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *flipselector;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "flipselector", ELM_WIN_BASIC);
+ win = win_add(NULL, "flipselector", ELM_WIN_BASIC);
flipselector = elm_flipselector_add(win);
- role = efl_access_role_get(flipselector);
+ role = efl_access_object_role_get(flipselector);
ck_assert(role == EFL_ACCESS_ROLE_LIST);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_flipselector(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_flipselector_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_focus.c b/src/tests/elementary/elm_test_focus.c
index ce0b06aabb..7c1d032c5f 100644
--- a/src/tests/elementary/elm_test_focus.c
+++ b/src/tests/elementary/elm_test_focus.c
@@ -1,12 +1,11 @@
#include "elm_test_focus_common.h"
-START_TEST(focus_unregister_twice)
+EFL_START_TEST(focus_unregister_twice)
{
- elm_init(1, NULL);
- Efl_Ui_Focus_Object *r1 = efl_add(FOCUS_TEST_CLASS, NULL);
- Efl_Ui_Focus_Object *r2 = efl_add(FOCUS_TEST_CLASS, NULL);
+ Efl_Ui_Focus_Object *r1 = efl_add_ref(FOCUS_TEST_CLASS, NULL);
+ Efl_Ui_Focus_Object *r2 = efl_add_ref(FOCUS_TEST_CLASS, NULL);
- Efl_Ui_Focus_Manager *m = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
+ Efl_Ui_Focus_Manager *m = efl_add_ref(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
efl_ui_focus_manager_root_set(efl_added, r1)
);
@@ -16,42 +15,39 @@ START_TEST(focus_unregister_twice)
efl_ui_focus_manager_calc_unregister(m, r1);
efl_ui_focus_manager_calc_unregister(m, r1);
- efl_del(r2);
- efl_del(r1);
- efl_del(m);
+ efl_unref(r2);
+ efl_unref(r1);
+ efl_unref(m);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(focus_register_twice)
+EFL_START_TEST(focus_register_twice)
{
- elm_init(1, NULL);
-
Efl_Ui_Focus_Object *r1 = elm_focus_test_object_new("r1", 0, 0, 10, 10);
Efl_Ui_Focus_Object *r2 = elm_focus_test_object_new("r2", 0, 10, 10, 10);
- Efl_Ui_Focus_Manager *m = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
+ Efl_Ui_Focus_Manager *m = efl_add_ref(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
efl_ui_focus_manager_root_set(efl_added, r1)
);
fail_if(!efl_ui_focus_manager_calc_register(m, r2, r1, NULL));
- fail_if(efl_ui_focus_manager_calc_register(m, r2, r1, NULL));
+ //same confguration don't error out
+ fail_if(!efl_ui_focus_manager_calc_register(m, r2, r1, NULL));
+ //different confidurations error out
+ fail_if(efl_ui_focus_manager_calc_register(m, r2, r1, r1));
- efl_del(r1);
- efl_del(m);
+ efl_unref(r1);
+ efl_unref(m);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(pos_check)
+EFL_START_TEST(pos_check)
{
Efl_Ui_Focus_Manager *m;
Efl_Ui_Focus_Object *middle, *east, *west, *north, *south, *root;
- elm_init(1, NULL);
-
elm_focus_test_setup_cross(&middle, &south, &north, &east, &west);
m = elm_focus_test_manager_new(&root);
@@ -78,15 +74,14 @@ START_TEST(pos_check)
CHECK(north, east, west, NULL, middle)
CHECK(south, east, west, middle, NULL)
- efl_del(middle);
- efl_del(south);
- efl_del(north);
- efl_del(east);
- efl_del(west);
-
- elm_shutdown();
+ efl_unref(middle);
+ efl_unref(south);
+ efl_unref(north);
+ efl_unref(east);
+ efl_unref(west);
+ efl_unref(m);
}
-END_TEST
+EFL_END_TEST
static Eina_Bool
_equal_set(Eina_List *elems, Efl_Ui_Focus_Object *lst[])
@@ -114,14 +109,12 @@ _equal_set(Eina_List *elems, Efl_Ui_Focus_Object *lst[])
return EINA_TRUE;
}
-START_TEST(pos_check2)
+EFL_START_TEST(pos_check2)
{
Efl_Ui_Focus_Manager *m;
Efl_Ui_Focus_Relations *rel;
Efl_Ui_Focus_Object *root, *middle, *north_east, *north_west, *south_east, *south_west;
- elm_init(1, NULL);
-
middle = elm_focus_test_object_new("middle", 40, 40, 5, 5);
north_east = elm_focus_test_object_new("north_east", 60, 20, 5, 5);
@@ -151,29 +144,26 @@ START_TEST(pos_check2)
#undef ck_assert_set_eq
- efl_del(middle);
- efl_del(north_east);
- efl_del(north_west);
- efl_del(south_east);
- efl_del(south_west);
+ efl_unref(middle);
+ efl_unref(north_east);
+ efl_unref(north_west);
+ efl_unref(south_east);
+ efl_unref(south_west);
- elm_shutdown();
}
-END_TEST
-START_TEST(redirect)
+EFL_END_TEST
+EFL_START_TEST(redirect)
{
- elm_init(1, NULL);
-
TEST_OBJ_NEW(root, 0, 0, 20, 20);
TEST_OBJ_NEW(root2, 0, 0, 20, 20);
TEST_OBJ_NEW(one, 0, 0, 20, 20);
TEST_OBJ_NEW(two, 20, 0, 20, 20);
- Efl_Ui_Focus_Manager *m = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
+ Efl_Ui_Focus_Manager *m = efl_add_ref(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
efl_ui_focus_manager_root_set(efl_added, root)
);
- Efl_Ui_Focus_Manager *m2 = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
+ Efl_Ui_Focus_Manager *m2 = efl_add_ref(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
efl_ui_focus_manager_root_set(efl_added, root2)
);
@@ -185,11 +175,12 @@ START_TEST(redirect)
ck_assert_ptr_eq(efl_ui_focus_manager_move(m, EFL_UI_FOCUS_DIRECTION_RIGHT), two);
- elm_shutdown();
+ efl_unref(m);
+ efl_unref(m2);
}
-END_TEST
+EFL_END_TEST
-START_TEST(border_check)
+EFL_START_TEST(border_check)
{
Efl_Ui_Focus_Manager *m;
Efl_Ui_Focus_Object *middle, *east, *west, *north, *south, *root;
@@ -197,8 +188,6 @@ START_TEST(border_check)
Eina_Iterator *iter;
Efl_Ui_Focus_Object *obj;
- elm_init(1, NULL);
-
elm_focus_test_setup_cross(&middle, &south, &north, &east, &west);
m = elm_focus_test_manager_new(&root);
@@ -224,18 +213,15 @@ START_TEST(border_check)
ck_assert(eina_list_data_find(list, middle) == NULL);
ck_assert(eina_list_count(list) == 4);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(logical_chain)
+EFL_START_TEST(logical_chain)
{
Efl_Ui_Focus_Manager *m;
Efl_Ui_Focus_Object *lroot;
int i = 0;
- elm_init(1, NULL);
-
TEST_OBJ_NEW(root, 0, 0, 20, 20);
m = elm_focus_test_manager_new(&lroot);
@@ -290,38 +276,143 @@ START_TEST(logical_chain)
{
ck_assert_ptr_eq(logical_chain[i], efl_ui_focus_manager_move(m, EFL_UI_FOCUS_DIRECTION_PREVIOUS));
}
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(finalize_check)
+static void
+_check_chain(Efl_Ui_Focus_Manager *m, Efl_Ui_Focus_Object *objects[])
{
- Efl_Ui_Focus_Manager *m;
+ int i;
+ for (i = 0; objects[i]; ++i)
+ {
+ Efl_Ui_Focus_Object *next;
- elm_init(1, NULL);
+ if (i > 0)
+ efl_ui_focus_manager_move(m, EFL_UI_FOCUS_DIRECTION_NEXT);
+ else
+ {
+ Eo *root = efl_ui_focus_manager_root_get(m);
+ efl_ui_focus_manager_reset_history(m);
+ efl_ui_focus_manager_setup_on_first_touch(m, EFL_UI_FOCUS_DIRECTION_NEXT, root);
+ }
+ next = efl_ui_focus_manager_focus_get(efl_ui_focus_util_active_manager(EFL_UI_FOCUS_UTIL_CLASS, m));
- m = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL);
- fail_if(m);
+ ck_assert_ptr_eq(next, objects[i]);
+ }
- elm_shutdown();
+ ck_assert_ptr_eq(efl_ui_focus_manager_move(m, EFL_UI_FOCUS_DIRECTION_NEXT), NULL);
+
+ for (; i > 0; i--)
+ {
+ Efl_Ui_Focus_Object *prev;
+
+ if (!!objects[i])
+ efl_ui_focus_manager_move(m, EFL_UI_FOCUS_DIRECTION_PREVIOUS);
+ else
+ {
+ Eo *root = efl_ui_focus_manager_root_get(m);
+ efl_ui_focus_manager_reset_history(m);
+ efl_ui_focus_manager_setup_on_first_touch(m, EFL_UI_FOCUS_DIRECTION_PREVIOUS, root);
+ }
+
+ prev = efl_ui_focus_manager_focus_get(efl_ui_focus_util_active_manager(EFL_UI_FOCUS_UTIL_CLASS, m));
+ ck_assert_ptr_eq(prev, objects[i - 1]);
+ }
+ ck_assert_ptr_eq(efl_ui_focus_manager_move(m, EFL_UI_FOCUS_DIRECTION_PREVIOUS), NULL);
+}
+
+EFL_START_TEST(logical_chain_multi_redirect)
+{
+ Efl_Ui_Focus_Manager *m, *m2, *m3, *m4;
+ Efl_Ui_Focus_Object *root,*root2, *root3, *root4, *c1_1, *c1_2, *c1_3, *c2, *c3, *c4;
+
+ m = elm_focus_test_manager_new(&root);
+ m2 = elm_focus_test_manager_new(&root2);
+ m3 = elm_focus_test_manager_new(&root3);
+ m4 = elm_focus_test_manager_new(&root4);
+ c1_1 = elm_focus_test_object_new("child1", 0, 0, 20, 20);
+ c1_2 = elm_focus_test_object_new("child2", 0, 0, 20, 20);
+ c1_3 = elm_focus_test_object_new("child3", 0, 0, 20, 20);
+ focus_test_manager_set(c1_1, m2);
+ focus_test_manager_set(c1_2, m3);
+ focus_test_manager_set(c1_3, m4);
+ c2 = elm_focus_test_object_new("child1", 0, 0, 20, 20);
+ c3 = elm_focus_test_object_new("child2", 0, 0, 20, 20);
+ c4 = elm_focus_test_object_new("child3", 0, 0, 20, 20);
+
+ Efl_Ui_Focus_Object *objects[] = {c2, c3, c4, NULL};
+
+ efl_ui_focus_manager_calc_register(m, c1_1, root, m2);
+ efl_ui_focus_manager_calc_register(m, c1_2, root, m3);
+ efl_ui_focus_manager_calc_register(m, c1_3, root, m4);
+
+ efl_ui_focus_manager_calc_register(m2, c2, root2, NULL);
+ efl_ui_focus_manager_calc_register(m3, c3, root3, NULL);
+ efl_ui_focus_manager_calc_register(m4, c4, root4, NULL);
+
+ _check_chain(m, objects);
+
+ efl_unref(m2);
+ efl_unref(m);
}
-END_TEST
+EFL_END_TEST
-START_TEST(redirect_param)
+EFL_START_TEST(logical_chain_single_redirect)
{
Efl_Ui_Focus_Manager *m, *m2;
+ Efl_Ui_Focus_Object *root,*root2, *c1_1, *c1_2, *c1_3, *c2_1, *c2_2, *c2_3;
+
+ m = elm_focus_test_manager_new(&root);
+ m2 = elm_focus_test_manager_new(&root2);
+ c1_1 = elm_focus_test_object_new("child1", 0, 0, 20, 20);
+ c1_2 = elm_focus_test_object_new("child2", 0, 0, 20, 20);
+ focus_test_manager_set(c1_2, m2);
+ c1_3 = elm_focus_test_object_new("child3", 0, 0, 20, 20);
+ c2_1 = elm_focus_test_object_new("child1", 0, 0, 20, 20);
+ c2_2 = elm_focus_test_object_new("child2", 0, 0, 20, 20);
+ c2_3 = elm_focus_test_object_new("child3", 0, 0, 20, 20);
+
+ Efl_Ui_Focus_Object *objects[] = {c1_1, c2_1, c2_2, c2_3, c1_3, NULL};
+
+ efl_ui_focus_manager_calc_register(m, c1_1, root, NULL);
+ efl_ui_focus_manager_calc_register(m, c1_2, root, m2);
+ efl_ui_focus_manager_calc_register(m, c1_3, root, NULL);
+
+ efl_ui_focus_manager_calc_register(m2, c2_1, root2, NULL);
+ efl_ui_focus_manager_calc_register(m2, c2_2, root2, NULL);
+ efl_ui_focus_manager_calc_register(m2, c2_3, root2, NULL);
+
+ _check_chain(m, objects);
+
+ efl_unref(m2);
+ efl_unref(m);
+}
+EFL_END_TEST
+
+EFL_START_TEST(finalize_check)
+{
+ Efl_Ui_Focus_Manager *m;
+
+ m = efl_add_ref(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL);
+ fail_if(m);
+
+ efl_unref(m);
+}
+EFL_END_TEST
- elm_init(1, NULL);
+EFL_START_TEST(redirect_param)
+{
+ Efl_Ui_Focus_Manager *m, *m2;
TEST_OBJ_NEW(root, 0, 20, 20, 20);
TEST_OBJ_NEW(root2, 0, 20, 20, 20);
TEST_OBJ_NEW(child, 0, 20, 20, 20);
- m = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
+ m = efl_add_ref(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
efl_ui_focus_manager_root_set(efl_added, root)
);
- m2 = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
+ m2 = efl_add_ref(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
efl_ui_focus_manager_root_set(efl_added, root2)
);
@@ -330,21 +421,20 @@ START_TEST(redirect_param)
ck_assert_ptr_eq(efl_ui_focus_manager_redirect_get(m), m2);
- elm_shutdown();
+ efl_unref(m);
+ efl_unref(m2);
}
-END_TEST
+EFL_END_TEST
-START_TEST(invalid_args_check)
+EFL_START_TEST(invalid_args_check)
{
Efl_Ui_Focus_Manager *m;
- elm_init(1, NULL);
-
TEST_OBJ_NEW(root, 0, 20, 20, 20);
TEST_OBJ_NEW(child, 0, 20, 20, 20);
TEST_OBJ_NEW(child2, 0, 20, 20, 20);
- m = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
+ m = efl_add_ref(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
efl_ui_focus_manager_root_set(efl_added, root)
);
@@ -362,23 +452,21 @@ START_TEST(invalid_args_check)
ck_assert_int_eq(efl_ui_focus_manager_calc_register(m, child2, root, NULL), 1);
ck_assert_int_eq(efl_ui_focus_manager_calc_update_parent(m, child, child2), 1);
- elm_shutdown();
+ efl_unref(m);
}
-END_TEST
+EFL_END_TEST
-START_TEST(order_check)
+EFL_START_TEST(order_check)
{
Efl_Ui_Focus_Manager *m;
Eina_List *order = NULL;
- elm_init(1, NULL);
-
TEST_OBJ_NEW(root, 0, 20, 20, 20);
TEST_OBJ_NEW(child1, 0, 20, 20, 20);
TEST_OBJ_NEW(child2, 0, 20, 20, 20);
TEST_OBJ_NEW(child3, 0, 20, 20, 20);
- m = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
+ m = efl_add_ref(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
efl_ui_focus_manager_root_set(efl_added, root)
);
@@ -400,23 +488,21 @@ START_TEST(order_check)
order = eina_list_append(order, child2);
ck_assert_int_eq(efl_ui_focus_manager_calc_update_children(m, root, order), 0);
- elm_shutdown();
+ efl_unref(m);
}
-END_TEST
+EFL_END_TEST
-START_TEST(logical_shift)
+EFL_START_TEST(logical_shift)
{
Efl_Ui_Focus_Manager *m;
- elm_init(1, NULL);
-
TEST_OBJ_NEW(root, 0, 0, 10, 10);
TEST_OBJ_NEW(child, 0, 0, 10, 10);
TEST_OBJ_NEW(sub, 0, 0, 10, 10);
TEST_OBJ_NEW(sub_sub, 0, 0, 10, 10);
TEST_OBJ_NEW(sub_child, 0, 0, 10, 10);
- m = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
+ m = efl_add_ref(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
efl_ui_focus_manager_root_set(efl_added, root)
);
@@ -434,27 +520,25 @@ START_TEST(logical_shift)
efl_ui_focus_manager_focus_set(m, sub_sub);
ck_assert_ptr_eq(efl_ui_focus_manager_focus_get(m), sub_child);
- elm_shutdown();
+ efl_unref(m);
}
-END_TEST
+EFL_END_TEST
-START_TEST(root_redirect_chain)
+EFL_START_TEST(root_redirect_chain)
{
Efl_Ui_Focus_Manager *m, *m2;
- elm_init(1, NULL);
-
TEST_OBJ_NEW(root, 0, 20, 20, 20);
TEST_OBJ_NEW(root2, 0, 20, 20, 20);
TEST_OBJ_NEW(child, 0, 20, 20, 20);
- m = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
+ m = efl_add_ref(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
efl_ui_focus_manager_root_set(efl_added, root)
);
focus_test_manager_set(root2, m);
- m2 = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
+ m2 = efl_add_ref(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
efl_ui_focus_manager_root_set(efl_added, root2)
);
@@ -464,35 +548,34 @@ START_TEST(root_redirect_chain)
ck_assert_ptr_eq(efl_ui_focus_manager_redirect_get(m), m2);
- elm_shutdown();
+ efl_unref(m);
+ efl_unref(m2);
}
-END_TEST
+EFL_END_TEST
-START_TEST(root_redirect_chain_unset)
+EFL_START_TEST(root_redirect_chain_unset)
{
Efl_Ui_Focus_Manager *m, *m2, *m3, *m4;
- elm_init(1, NULL);
-
TEST_OBJ_NEW(root, 0, 20, 20, 20);
TEST_OBJ_NEW(root2, 0, 20, 20, 20);
TEST_OBJ_NEW(child, 0, 20, 20, 20);
- m = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
+ m = efl_add_ref(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
efl_ui_focus_manager_root_set(efl_added, root)
);
focus_test_manager_set(root2, m);
- m2 = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
+ m2 = efl_add_ref(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
efl_ui_focus_manager_root_set(efl_added, root2)
);
- m3 = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
+ m3 = efl_add_ref(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
efl_ui_focus_manager_root_set(efl_added, root2)
);
- m4 = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
+ m4 = efl_add_ref(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
efl_ui_focus_manager_root_set(efl_added, root2)
);
@@ -509,12 +592,15 @@ START_TEST(root_redirect_chain_unset)
ck_assert_ptr_eq(efl_ui_focus_manager_redirect_get(m3), NULL);
ck_assert_ptr_eq(efl_ui_focus_manager_redirect_get(m4), NULL);
- elm_shutdown();
+ efl_unref(m);
+ efl_unref(m2);
+ efl_unref(m3);
+ efl_unref(m4);
}
-END_TEST
+EFL_END_TEST
static Efl_Ui_Focus_Manager_Calc*
-_recursive_triangle_manager(int recusion_depth, Efl_Ui_Focus_Object **most_right, Efl_Ui_Focus_Object **most_left)
+_recursive_triangle_manager(int recusion_depth, Efl_Ui_Focus_Object **most_right, Efl_Ui_Focus_Object **most_left, Eina_List **managers)
{
Efl_Ui_Focus_Manager *m, *m_child1 = NULL, *m_child3 = NULL;
Efl_Ui_Focus_Object *child1, *child3;
@@ -522,7 +608,7 @@ _recursive_triangle_manager(int recusion_depth, Efl_Ui_Focus_Object **most_right
TEST_OBJ_NEW(root, 0, 20, 20, 20);
TEST_OBJ_NEW(child2, 0, 20, 20, 20);
- m = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
+ m = efl_add_ref(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
efl_ui_focus_manager_root_set(efl_added, root)
);
@@ -530,8 +616,8 @@ _recursive_triangle_manager(int recusion_depth, Efl_Ui_Focus_Object **most_right
if (recusion_depth < 3)
{
- m_child1 = _recursive_triangle_manager(recusion_depth + 1, NULL, most_left);
- m_child3 = _recursive_triangle_manager(recusion_depth + 1, most_right, NULL);
+ m_child1 = _recursive_triangle_manager(recusion_depth + 1, NULL, most_left, managers);
+ m_child3 = _recursive_triangle_manager(recusion_depth + 1, most_right, NULL, managers);
child1 = efl_ui_focus_manager_root_get(m_child1);
child3 = efl_ui_focus_manager_root_get(m_child3);
focus_test_manager_set(child1, m);
@@ -566,6 +652,8 @@ _recursive_triangle_manager(int recusion_depth, Efl_Ui_Focus_Object **most_right
efl_ui_focus_manager_calc_register(m, child2, root, NULL);
efl_ui_focus_manager_calc_register(m, child3, root, m_child3);
+ *managers = eina_list_append(*managers , m);
+
return m;
}
@@ -582,14 +670,13 @@ _get_highest_redirect(Efl_Ui_Focus_Manager *manager)
return manager;
}
-START_TEST(first_touch_check)
+EFL_START_TEST(first_touch_check)
{
Efl_Ui_Focus_Manager *m;
Efl_Ui_Focus_Object *most_left, *most_right;
+ Eina_List *managers = NULL;
- elm_init(1, NULL);
-
- m = _recursive_triangle_manager(0, &most_right, &most_left);
+ m = _recursive_triangle_manager(0, &most_right, &most_left, &managers);
efl_ui_focus_manager_setup_on_first_touch(m, EFL_UI_FOCUS_DIRECTION_NEXT, efl_ui_focus_manager_root_get(m));
printf("%p %p\n", most_left, most_right);
@@ -602,9 +689,282 @@ START_TEST(first_touch_check)
printf("%s\n", efl_name_get(efl_ui_focus_manager_focus_get(_get_highest_redirect(m))));
ck_assert_ptr_eq(efl_ui_focus_manager_focus_get(_get_highest_redirect(m)), most_right);
- elm_shutdown();
+ EINA_LIST_FREE(managers, m)
+ efl_unref(m);
+}
+EFL_END_TEST
+
+EFL_START_TEST(test_request_subchild_empty)
+{
+ Efl_Ui_Focus_Manager *m;
+ Efl_Ui_Focus_Object *root;
+
+ m = elm_focus_test_manager_new(&root);
+
+ ck_assert_ptr_eq(efl_ui_focus_manager_request_subchild(m, root), NULL);
+
+ efl_unref(m);
+}
+EFL_END_TEST
+
+EFL_START_TEST(test_request_subchild_one_element)
+{
+ Efl_Ui_Focus_Manager *m;
+ Efl_Ui_Focus_Object *root, *c1;
+
+ m = elm_focus_test_manager_new(&root);
+ c1 = elm_focus_test_object_new("child1", 0, 0, 20, 20);
+ efl_ui_focus_manager_calc_register(m, c1, root, NULL);
+
+ ck_assert_ptr_eq(efl_ui_focus_manager_request_subchild(m, root), c1);
+ ck_assert_ptr_eq(efl_ui_focus_manager_request_subchild(m, c1), NULL);
+
+ efl_unref(m);
+}
+EFL_END_TEST
+
+EFL_START_TEST(test_request_subchild_child_alongside)
+{
+ Efl_Ui_Focus_Manager *m;
+ Efl_Ui_Focus_Object *root, *c1, *c2;
+
+ m = elm_focus_test_manager_new(&root);
+ c1 = elm_focus_test_object_new("child1", 0, 0, 20, 20);
+ c2 = elm_focus_test_object_new("child2", 0, 0, 20, 20);
+ efl_ui_focus_manager_calc_register(m, c1, root, NULL);
+ efl_ui_focus_manager_calc_register(m, c2, root, NULL);
+
+ ck_assert_ptr_eq(efl_ui_focus_manager_request_subchild(m, root), c1);
+ ck_assert_ptr_eq(efl_ui_focus_manager_request_subchild(m, c1), NULL);
+ ck_assert_ptr_eq(efl_ui_focus_manager_request_subchild(m, c2), NULL);
+
+ efl_unref(m);
+}
+EFL_END_TEST
+
+EFL_START_TEST(test_request_subchild_child_logical_regular)
+{
+ Efl_Ui_Focus_Manager *m;
+ Efl_Ui_Focus_Object *root, *c1, *c2;
+
+ m = elm_focus_test_manager_new(&root);
+ c1 = elm_focus_test_object_new("child1", 0, 0, 20, 20);
+ c2 = elm_focus_test_object_new("child2", 0, 0, 20, 20);
+ efl_ui_focus_manager_calc_register_logical(m, c1, root, NULL);
+ efl_ui_focus_manager_calc_register(m, c2, c1, NULL);
+
+ ck_assert_ptr_eq(efl_ui_focus_manager_request_subchild(m, root), c2);
+ ck_assert_ptr_eq(efl_ui_focus_manager_request_subchild(m, c1), c2);
+ ck_assert_ptr_eq(efl_ui_focus_manager_request_subchild(m, c2), NULL);
+
+ efl_unref(m);
+}
+EFL_END_TEST
+
+EFL_START_TEST(test_request_subchild_child_regular_regular)
+{
+ Efl_Ui_Focus_Manager *m;
+ Efl_Ui_Focus_Object *root, *c1, *c2;
+
+ m = elm_focus_test_manager_new(&root);
+ c1 = elm_focus_test_object_new("child1", 0, 0, 20, 20);
+ c2 = elm_focus_test_object_new("child2", 0, 0, 20, 20);
+ efl_ui_focus_manager_calc_register(m, c1, root, NULL);
+ efl_ui_focus_manager_calc_register(m, c2, c1, NULL);
+
+ ck_assert_ptr_eq(efl_ui_focus_manager_request_subchild(m, root), c1);
+ ck_assert_ptr_eq(efl_ui_focus_manager_request_subchild(m, c1), c2);
+ ck_assert_ptr_eq(efl_ui_focus_manager_request_subchild(m, c2), NULL);
+
+ efl_unref(m);
+}
+EFL_END_TEST
+
+EFL_START_TEST(test_unregister_last_focused_no_history)
+{
+ Efl_Ui_Focus_Manager *m;
+ Efl_Ui_Focus_Object *root, *c1, *c2, *c3;
+
+ m = elm_focus_test_manager_new(&root);
+ c1 = elm_focus_test_object_new("child1", 0, 0, 20, 20);
+ c2 = elm_focus_test_object_new("child2", 0, 0, 20, 20);
+ c3 = elm_focus_test_object_new("child3", 0, 0, 20, 20);
+ efl_ui_focus_manager_calc_register(m, c1, root, NULL);
+ efl_ui_focus_manager_calc_register(m, c2, root, NULL);
+ efl_ui_focus_manager_calc_register(m, c3, root, NULL);
+
+ efl_ui_focus_manager_focus_set(m, c2);
+ ck_assert_ptr_eq(efl_ui_focus_manager_focus_get(m), c2);
+
+ efl_ui_focus_manager_calc_unregister(m, c2);
+ ck_assert_ptr_eq(efl_ui_focus_manager_focus_get(m), c1);
+
+ efl_unref(m);
+}
+EFL_END_TEST
+
+EFL_START_TEST(test_unregister_last_focused)
+{
+ Efl_Ui_Focus_Manager *m;
+ Efl_Ui_Focus_Object *root, *c1, *c2, *c3;
+
+ m = elm_focus_test_manager_new(&root);
+ c1 = elm_focus_test_object_new("child1", 0, 0, 20, 20);
+ c2 = elm_focus_test_object_new("child2", 0, 0, 20, 20);
+ c3 = elm_focus_test_object_new("child3", 0, 0, 20, 20);
+ efl_ui_focus_manager_calc_register(m, c1, root, NULL);
+ efl_ui_focus_manager_calc_register(m, c2, root, NULL);
+ efl_ui_focus_manager_calc_register(m, c3, root, NULL);
+
+ efl_ui_focus_manager_focus_set(m, c2);
+ ck_assert_ptr_eq(efl_ui_focus_manager_focus_get(m), c2);
+ efl_ui_focus_manager_focus_set(m, c3);
+ ck_assert_ptr_eq(efl_ui_focus_manager_focus_get(m), c3);
+
+ efl_ui_focus_manager_calc_unregister(m, c3);
+ ck_assert_ptr_eq(efl_ui_focus_manager_focus_get(m), c2);
+
+ efl_unref(m);
+}
+EFL_END_TEST
+
+EFL_START_TEST(test_unregister_last_focused_no_child)
+{
+ Efl_Ui_Focus_Manager *m;
+ Efl_Ui_Focus_Object *root, *c1;
+
+ m = elm_focus_test_manager_new(&root);
+ c1 = elm_focus_test_object_new("child1", 0, 0, 20, 20);
+ efl_ui_focus_manager_calc_register(m, c1, root, NULL);
+
+ efl_ui_focus_manager_focus_set(m, c1);
+ ck_assert_ptr_eq(efl_ui_focus_manager_focus_get(m), c1);
+ efl_ui_focus_manager_calc_unregister(m, c1);
+ ck_assert_ptr_eq(efl_ui_focus_manager_focus_get(m), NULL);
+
+ efl_unref(m);
+}
+EFL_END_TEST
+
+EFL_START_TEST(test_pop_history_element)
+{
+ Efl_Ui_Focus_Manager *m;
+ Efl_Ui_Focus_Object *root, *c1, *c2, *c3;
+
+ m = elm_focus_test_manager_new(&root);
+ c1 = elm_focus_test_object_new("child1", 0, 0, 20, 20);
+ c2 = elm_focus_test_object_new("child2", 0, 0, 20, 20);
+ c3 = elm_focus_test_object_new("child3", 0, 0, 20, 20);
+ efl_ui_focus_manager_calc_register(m, c1, root, NULL);
+ efl_ui_focus_manager_calc_register(m, c2, root, NULL);
+ efl_ui_focus_manager_calc_register(m, c3, root, NULL);
+
+ efl_ui_focus_manager_focus_set(m, c2);
+ ck_assert_ptr_eq(efl_ui_focus_manager_focus_get(m), c2);
+ ck_assert_int_eq(efl_ui_focus_object_focus_get(c2), EINA_TRUE);
+
+ efl_ui_focus_manager_pop_history_stack(m);
+ ck_assert_ptr_eq(efl_ui_focus_manager_focus_get(m), NULL);
+ ck_assert_int_eq(efl_ui_focus_object_focus_get(c2), EINA_FALSE);
+
+ efl_ui_focus_manager_focus_set(m, c1);
+ efl_ui_focus_manager_focus_set(m, c2);
+ ck_assert_ptr_eq(efl_ui_focus_manager_focus_get(m), c2);
+ ck_assert_int_eq(efl_ui_focus_object_focus_get(c2), EINA_TRUE);
+ efl_ui_focus_manager_pop_history_stack(m);
+ ck_assert_ptr_eq(efl_ui_focus_manager_focus_get(m), c1);
+ ck_assert_int_eq(efl_ui_focus_object_focus_get(c2), EINA_FALSE);
+ ck_assert_int_eq(efl_ui_focus_object_focus_get(c1), EINA_TRUE);
+
+ efl_unref(m);
+}
+EFL_END_TEST
+
+static void
+_focus_request_tree_check(Efl_Ui_Focus_Manager *m, Eina_Bool accept_logicals, Efl_Ui_Focus_Object *objs[])
+{
+ int i = 0;
+ for (i = 1; objs[i]; ++i)
+ {
+ ck_assert_ptr_eq(efl_ui_focus_manager_request_move(m, EFL_UI_FOCUS_DIRECTION_NEXT, objs[i], accept_logicals), objs[i + 1]);
+ }
+ i--;
+ for (; i > 0; --i)
+ {
+ ck_assert_ptr_eq(efl_ui_focus_manager_request_move(m, EFL_UI_FOCUS_DIRECTION_PREVIOUS, objs[i], accept_logicals), objs[i - 1]);
+ }
+}
+
+EFL_START_TEST(test_request_move)
+{
+ Efl_Ui_Focus_Manager *m;
+ Efl_Ui_Focus_Object *root, *c1, *c2, *c3, *c4, *c5, *c6;
+
+ m = elm_focus_test_manager_new(&root);
+ c1 = elm_focus_test_object_new("child1", 0, 0, 20, 20);
+ c2 = elm_focus_test_object_new("child2", 0, 0, 20, 20);
+ c3 = elm_focus_test_object_new("child3", 0, 0, 20, 20);
+ c4 = elm_focus_test_object_new("child4", 0, 0, 20, 20);
+ c5 = elm_focus_test_object_new("child5", 0, 0, 20, 20);
+ c6 = elm_focus_test_object_new("child6", 0, 0, 20, 20);
+
+ efl_ui_focus_manager_calc_register(m, c1, root, NULL);
+ efl_ui_focus_manager_calc_register_logical(m, c2, root, NULL);
+ efl_ui_focus_manager_calc_register(m, c3, c2, NULL);
+ efl_ui_focus_manager_calc_register(m, c4, c2, NULL);
+ efl_ui_focus_manager_calc_register(m, c5, c2, NULL);
+ efl_ui_focus_manager_calc_register(m, c6, root, NULL);
+
+ // c3 c4 c5
+ // \ | /
+ // \ | /
+ // c1 c2 c6
+ // \ | /
+ // rooot
+
+ Efl_Ui_Focus_Object *objs_logical[] = {NULL, root, c1, c2, c3, c4, c5, c6, NULL};
+ _focus_request_tree_check(m, EINA_TRUE, objs_logical);
+
+ Efl_Ui_Focus_Object *objs_regular[] = {NULL, c1, c3, c4, c5, c6, NULL};
+ _focus_request_tree_check(m, EINA_FALSE, objs_regular);
+
+}
+EFL_END_TEST
+
+EFL_START_TEST(redirect_unregister_entrypoint)
+{
+ Efl_Ui_Focus_Manager *m, *m2;
+
+ TEST_OBJ_NEW(root, 0, 20, 20, 20);
+ TEST_OBJ_NEW(root2, 0, 20, 20, 20);
+ TEST_OBJ_NEW(child, 0, 20, 20, 20);
+ TEST_OBJ_NEW(child2, 0, 20, 20, 20);
+ TEST_OBJ_NEW(child3, 0, 20, 20, 20);
+
+ m = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, efl_main_loop_get(),
+ efl_ui_focus_manager_root_set(efl_added, root)
+ );
+
+ m2 = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, efl_main_loop_get(),
+ efl_ui_focus_manager_root_set(efl_added, root2)
+ );
+
+
+ efl_ui_focus_manager_calc_register(m2, child3, root2, m2);
+
+ efl_ui_focus_manager_calc_register(m, child, root, m2);
+ efl_ui_focus_manager_calc_register(m, child2, root, NULL);
+ efl_ui_focus_manager_focus_set(m, child);
+
+ ck_assert_ptr_eq(efl_ui_focus_manager_redirect_get(m), m2);
+ efl_ui_focus_manager_calc_unregister(m, child);
+ ck_assert_ptr_eq(efl_ui_focus_manager_redirect_get(m), m2);
+ ck_assert_ptr_eq(efl_ui_focus_manager_focus_get(m), NULL);
+
+ efl_del(m);
+ efl_del(m2);
}
-END_TEST
+EFL_END_TEST
void elm_test_focus(TCase *tc)
{
@@ -616,6 +976,8 @@ void elm_test_focus(TCase *tc)
tcase_add_test(tc, border_check);
tcase_add_test(tc, finalize_check);
tcase_add_test(tc, logical_chain);
+ tcase_add_test(tc, logical_chain_multi_redirect);
+ tcase_add_test(tc, logical_chain_single_redirect);
tcase_add_test(tc, redirect_param);
tcase_add_test(tc, invalid_args_check);
tcase_add_test(tc, order_check);
@@ -623,4 +985,15 @@ void elm_test_focus(TCase *tc)
tcase_add_test(tc, root_redirect_chain);
tcase_add_test(tc, root_redirect_chain_unset);
tcase_add_test(tc, first_touch_check);
+ tcase_add_test(tc, test_request_subchild_empty);
+ tcase_add_test(tc, test_request_subchild_one_element);
+ tcase_add_test(tc, test_request_subchild_child_alongside);
+ tcase_add_test(tc, test_request_subchild_child_logical_regular);
+ tcase_add_test(tc, test_request_subchild_child_regular_regular);
+ tcase_add_test(tc, test_unregister_last_focused_no_history);
+ tcase_add_test(tc, test_unregister_last_focused);
+ tcase_add_test(tc, test_unregister_last_focused_no_child);
+ tcase_add_test(tc, test_pop_history_element);
+ tcase_add_test(tc, test_request_move);
+ tcase_add_test(tc, redirect_unregister_entrypoint);
}
diff --git a/src/tests/elementary/elm_test_focus_common.c b/src/tests/elementary/elm_test_focus_common.c
index a84dc062f3..63ee2dc454 100644
--- a/src/tests/elementary/elm_test_focus_common.c
+++ b/src/tests/elementary/elm_test_focus_common.c
@@ -17,7 +17,7 @@ elm_focus_test_object_new(const char *name, int x, int y, int w, int h)
{
Efl_Ui_Focus_Object *ret;
- ret = efl_add(FOCUS_TEST_CLASS, NULL,
+ ret = efl_add_ref(FOCUS_TEST_CLASS, NULL,
efl_name_set(efl_added, name)
);
Q(ret, x, y, w, h);
@@ -48,7 +48,7 @@ elm_focus_test_manager_new(Efl_Ui_Focus_Object **middle)
Efl_Ui_Focus_Manager *m;
root = elm_focus_test_object_new("middle", 40, 40, 20, 20);
- m = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
+ m = efl_add_ref(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
efl_ui_focus_manager_root_set(efl_added, root)
);
if (middle)
@@ -80,34 +80,35 @@ _focus_test_efl_ui_focus_object_focus_set(Eo *obj, Focus_Test_Data *pd, Eina_Boo
{
pd->focus = focus;
printf("Object %p now focused\n", obj);
+ efl_ui_focus_object_focus_set(efl_super(obj, FOCUS_TEST_CLASS), focus);
}
EOLIAN static Eina_Rect
-_focus_test_efl_ui_focus_object_focus_geometry_get(Eo *obj EINA_UNUSED, Focus_Test_Data *pd)
+_focus_test_efl_ui_focus_object_focus_geometry_get(const Eo *obj EINA_UNUSED, Focus_Test_Data *pd)
{
return pd->rect;
}
EOLIAN static void
-_focus_test_size(Eo *obj EINA_UNUSED, Focus_Test_Data *pd, Eina_Rect rect)
+_focus_test_test_size(Eo *obj EINA_UNUSED, Focus_Test_Data *pd, Eina_Rect rect)
{
pd->rect = rect;
}
EOLIAN static Eina_Rect
-_focus_test_efl_gfx_geometry_get(Eo *obj EINA_UNUSED, Focus_Test_Data *pd)
+_focus_test_efl_gfx_entity_geometry_get(const Eo *obj EINA_UNUSED, Focus_Test_Data *pd)
{
return pd->rect;
}
EOLIAN static Efl_Ui_Focus_Manager*
-_focus_test_efl_ui_focus_user_focus_manager_get(Eo *obj EINA_UNUSED, Focus_Test_Data *pd)
+_focus_test_efl_ui_focus_object_focus_manager_get(const Eo *obj EINA_UNUSED, Focus_Test_Data *pd)
{
return pd->manager;
}
EOLIAN static Efl_Ui_Focus_Object*
-_focus_test_efl_ui_focus_user_focus_parent_get(Eo *obj, Focus_Test_Data *pd EINA_UNUSED)
+_focus_test_efl_ui_focus_object_focus_parent_get(const Eo *obj, Focus_Test_Data *pd EINA_UNUSED)
{
return efl_parent_get(obj);
}
diff --git a/src/tests/elementary/elm_test_focus_common.h b/src/tests/elementary/elm_test_focus_common.h
index 7105d7f736..bfce152cc3 100644
--- a/src/tests/elementary/elm_test_focus_common.h
+++ b/src/tests/elementary/elm_test_focus_common.h
@@ -5,7 +5,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_PROTECTED
#define ELM_INTERNAL_API_ARGESFSDFEFC
#include <Elementary.h>
#include "elm_suite.h"
diff --git a/src/tests/elementary/elm_test_focus_sub.c b/src/tests/elementary/elm_test_focus_sub.c
index 733abb5d96..3f100dfae2 100644
--- a/src/tests/elementary/elm_test_focus_sub.c
+++ b/src/tests/elementary/elm_test_focus_sub.c
@@ -7,19 +7,19 @@ typedef struct {
EOLIAN static Eina_Rect
-_focus_test_sub_main_efl_ui_focus_object_focus_geometry_get(Eo *obj EINA_UNUSED, Focus_Test_Sub_Main_Data *pd EINA_UNUSED)
+_focus_test_sub_main_efl_ui_focus_object_focus_geometry_get(const Eo *obj EINA_UNUSED, Focus_Test_Sub_Main_Data *pd EINA_UNUSED)
{
return EINA_RECT(0, 0, 20, 20);
}
EOLIAN static Efl_Ui_Focus_Manager*
-_focus_test_sub_main_efl_ui_focus_user_focus_manager_get(Eo *obj, Focus_Test_Sub_Main_Data *pd EINA_UNUSED)
+_focus_test_sub_main_efl_ui_focus_object_focus_manager_get(const Eo *obj, Focus_Test_Sub_Main_Data *pd EINA_UNUSED)
{
return efl_key_data_get(obj, "__user_manager");
}
EOLIAN static Efl_Ui_Focus_Object*
-_focus_test_sub_main_efl_ui_focus_user_focus_parent_get(Eo *obj, Focus_Test_Sub_Main_Data *pd EINA_UNUSED)
+_focus_test_sub_main_efl_ui_focus_object_focus_parent_get(const Eo *obj, Focus_Test_Sub_Main_Data *pd EINA_UNUSED)
{
return efl_key_data_get(obj, "__user_parent");
}
@@ -75,7 +75,7 @@ _setup(Efl_Ui_Focus_Manager **m, Efl_Ui_Focus_Manager_Sub **sub, Efl_Ui_Focus_Ob
EFL_OBJECT_OP_FUNC(efl_ui_focus_manager_calc_unregister, _unregister),
);
- Efl_Ui_Focus_Manager *manager = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
+ Efl_Ui_Focus_Manager *manager = efl_add_ref(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
efl_ui_focus_manager_root_set(efl_added, root_manager)
);
//flush now all changes
@@ -85,7 +85,7 @@ _setup(Efl_Ui_Focus_Manager **m, Efl_Ui_Focus_Manager_Sub **sub, Efl_Ui_Focus_Ob
efl_object_override(manager, &manager_tracker);
- Focus_Test_Sub_Main *focus_main = efl_add(FOCUS_TEST_SUB_MAIN_CLASS, NULL);
+ Focus_Test_Sub_Main *focus_main = efl_add_ref(FOCUS_TEST_SUB_MAIN_CLASS, NULL);
efl_key_data_set(focus_main, "__user_manager", manager);
efl_key_data_set(focus_main, "__user_parent", root_manager);
@@ -96,7 +96,7 @@ _setup(Efl_Ui_Focus_Manager **m, Efl_Ui_Focus_Manager_Sub **sub, Efl_Ui_Focus_Ob
efl_composite_attach(focus_main, subm);
- efl_event_callback_call(focus_main, EFL_UI_FOCUS_USER_EVENT_MANAGER_CHANGED, NULL);
+ efl_event_callback_call(focus_main, EFL_UI_FOCUS_OBJECT_EVENT_MANAGER_CHANGED, NULL);
efl_ui_focus_manager_calc_register_logical(manager, focus_main, root_manager, subm);
@@ -105,13 +105,11 @@ _setup(Efl_Ui_Focus_Manager **m, Efl_Ui_Focus_Manager_Sub **sub, Efl_Ui_Focus_Ob
*r = root;
}
-START_TEST(correct_register)
+EFL_START_TEST(correct_register)
{
Eina_List *set1 = NULL;
Efl_Ui_Focus_Object *root;
Efl_Ui_Focus_Manager *manager, *sub;
- elm_init(0, NULL);
-
_setup(&manager, &sub, &root);
TEST_OBJ_NEW(child1, 0, 0, 10, 10);
@@ -136,22 +134,19 @@ START_TEST(correct_register)
efl_ui_focus_manager_calc_unregister(sub, child1);
efl_ui_focus_manager_calc_unregister(sub, child2);
efl_ui_focus_manager_calc_unregister(sub, child3);
- efl_del(child1);
- efl_del(child2);
- efl_del(child3);
- efl_del(sub);
- efl_del(manager);
- elm_shutdown();
+ efl_unref(child1);
+ efl_unref(child2);
+ efl_unref(child3);
+ efl_unref(sub);
+ efl_unref(manager);
}
-END_TEST
+EFL_END_TEST
-START_TEST(correct_unregister)
+EFL_START_TEST(correct_unregister)
{
Eina_List *set = NULL;
Efl_Ui_Focus_Object *root;
Efl_Ui_Focus_Manager *manager, *sub;
- elm_init(0, NULL);
-
_setup(&manager, &sub, &root);
TEST_OBJ_NEW(child1, 0, 0, 10, 10);
@@ -178,23 +173,20 @@ START_TEST(correct_unregister)
eina_list_free(unregistered);
unregistered = NULL;
- efl_del(sub);
- efl_del(manager);
- efl_del(root);
- efl_del(child1);
- efl_del(child2);
- efl_del(child3);
- elm_shutdown();
+ efl_unref(sub);
+ efl_unref(manager);
+ efl_unref(root);
+ efl_unref(child1);
+ efl_unref(child2);
+ efl_unref(child3);
}
-END_TEST
+EFL_END_TEST
-START_TEST(correct_un_register)
+EFL_START_TEST(correct_un_register)
{
Eina_List *set_add = NULL, *set_del = NULL;
Efl_Ui_Focus_Object *root;
Efl_Ui_Focus_Manager *manager, *sub;
- elm_init(0, NULL);
-
_setup(&manager, &sub, &root);
TEST_OBJ_NEW(child1, 0, 0, 10, 10);
@@ -219,15 +211,14 @@ START_TEST(correct_un_register)
fail_if(!_set_equal(registered, set_add));
fail_if(!_set_equal(unregistered, set_del));
- efl_del(sub);
- efl_del(manager);
- efl_del(root);
- efl_del(child1);
- efl_del(child2);
- efl_del(child3);
- elm_shutdown();
+ efl_unref(sub);
+ efl_unref(manager);
+ efl_unref(root);
+ efl_unref(child1);
+ efl_unref(child2);
+ efl_unref(child3);
}
-END_TEST
+EFL_END_TEST
void elm_test_focus_sub(TCase *tc)
{
diff --git a/src/tests/elementary/elm_test_frame.c b/src/tests/elementary/elm_test_frame.c
index 4c90e9cd43..4b56c9170f 100644
--- a/src/tests/elementary/elm_test_frame.c
+++ b/src/tests/elementary/elm_test_frame.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_frame_legacy_type_check)
+{
+ Evas_Object *win, *frame;
+ const char *type;
+
+ win = win_add(NULL, "frame", ELM_WIN_BASIC);
+
+ frame = elm_frame_add(win);
+
+ type = elm_object_widget_type_get(frame);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Frame"));
+
+ type = evas_object_type_get(frame);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_frame"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *frame;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "frame", ELM_WIN_BASIC);
+ win = win_add(NULL, "frame", ELM_WIN_BASIC);
frame = elm_frame_add(win);
- role = efl_access_role_get(frame);
+ role = efl_access_object_role_get(frame);
ck_assert(role == EFL_ACCESS_ROLE_FRAME);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_frame(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_frame_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_gengrid.c b/src/tests/elementary/elm_test_gengrid.c
index 76b199a52f..b388891ec0 100644
--- a/src/tests/elementary/elm_test_gengrid.c
+++ b/src/tests/elementary/elm_test_gengrid.c
@@ -2,28 +2,45 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
#include "elm_test_helper.h"
+EFL_START_TEST (elm_gengrid_legacy_type_check)
+{
+ Evas_Object *win, *gengrid;
+ const char *type;
+
+ win = win_add(NULL, "gengrid", ELM_WIN_BASIC);
+
+ gengrid = elm_gengrid_add(win);
+
+ type = elm_object_widget_type_get(gengrid);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Gengrid"));
+
+ type = evas_object_type_get(gengrid);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_gengrid"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *gengrid;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "gengrid", ELM_WIN_BASIC);
+ win = win_add(NULL, "gengrid", ELM_WIN_BASIC);
gengrid = elm_gengrid_add(win);
- role = efl_access_role_get(gengrid);
+ role = efl_access_object_role_get(gengrid);
ck_assert(role == EFL_ACCESS_ROLE_TREE_TABLE);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
// Temporary commnted since gengrid fields_update function do not call content callbacks
// (different behaviour then genlist - which calls)
@@ -33,7 +50,7 @@ static Evas_Object *content;
static Evas_Object *
gl_content_get(void *data EINA_UNUSED, Evas_Object *obj, const char *part EINA_UNUSED)
{
- content = elm_button_add(obj);
+ content = elm_gengrid_add(obj);
evas_object_show(content);
return content;
}
@@ -42,18 +59,17 @@ gl_content_get(void *data EINA_UNUSED, Evas_Object *obj, const char *part EINA_U
* Validate if gengrid implementation properly reset AT-SPI parent to Elm_Gengrid_Item
* from Elm_Gengrid
*/
-START_TEST(elm_atspi_children_parent)
+EFL_START_TEST(elm_atspi_children_parent)
{
- elm_init(1, NULL);
elm_config_atspi_mode_set(EINA_TRUE);
static Elm_Gengrid_Item_Class itc;
- Evas_Object *win = elm_win_add(NULL, "gengrid", ELM_WIN_BASIC);
+ Evas_Object *win = win_add(NULL, "gengrid", ELM_WIN_BASIC);
evas_object_resize(win, 100, 100);
Evas_Object *gengrid = elm_gengrid_add(win);
evas_object_resize(gengrid, 100, 100);
- Efl_Access *parent;
+ Efl_Access_Object *parent;
content = NULL;
itc.item_style = "default";
@@ -66,16 +82,16 @@ START_TEST(elm_atspi_children_parent)
elm_gengrid_item_fields_update(it, "*.", ELM_GENGRID_ITEM_FIELD_CONTENT);
ck_assert(content != NULL);
- parent = efl_access_parent_get(content);
+ parent = efl_provider_find(efl_parent_get(content), EFL_ACCESS_OBJECT_MIXIN);
ck_assert(it == parent);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
#endif
void elm_test_gengrid(TCase *tc)
{
+ tcase_add_test(tc, elm_gengrid_legacy_type_check);
tcase_add_test(tc, elm_atspi_role_get);
#if 0
tcase_add_test(tc, elm_atspi_children_parent);
diff --git a/src/tests/elementary/elm_test_genlist.c b/src/tests/elementary/elm_test_genlist.c
index 4f53014e48..cdce1374ff 100644
--- a/src/tests/elementary/elm_test_genlist.c
+++ b/src/tests/elementary/elm_test_genlist.c
@@ -2,8 +2,8 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_BETA
+#define EFL_ACCESS_OBJECT_PROTECTED
#include <Elementary.h>
#include "elm_suite.h"
@@ -14,43 +14,161 @@ static int counter;
static Efl_Access_Event_Children_Changed_Data ev_data;
Evas_Object *content;
+static void
+verify_item_iteration_api(Elm_Object_Item *parent)
+{
+ Elm_Object_Item *it, *first_child;
+ Eina_List *children, *l;
+ int i;
+
+ /* verify first_item_get() */
+ it = elm_genlist_first_item_get(genlist);
+ ck_assert_ptr_eq(it, parent);
+ ck_assert_ptr_eq(elm_object_item_data_get(it), NULL);
+ ck_assert_ptr_eq(elm_genlist_item_prev_get(it), NULL);
+
+ /* verify last_item_get() */
+ it = elm_genlist_last_item_get(genlist);
+ ck_assert_ptr_eq(elm_object_item_data_get(it), (void*)(uintptr_t)10);
+ ck_assert_ptr_eq(elm_genlist_item_next_get(it), NULL);
+
+ /* verify next item of parent item is it's first child */
+ first_child = elm_genlist_item_next_get(parent);
+ ck_assert_ptr_eq(elm_object_item_data_get(first_child), (void*)(uintptr_t)1);
+ ck_assert_ptr_eq(elm_genlist_item_parent_get(first_child), parent);
+
+ /* verify subitems_count() */
+ ck_assert_int_eq(elm_genlist_item_subitems_count(parent), 10);
+ ck_assert_int_eq(elm_genlist_item_subitems_count(first_child), 0);
+
+ /* verify list consistency */
+ it = first_child;
+ for (i = 1; i <= 9; i++)
+ {
+ ck_assert_ptr_eq(elm_object_item_data_get(it), (void*)(uintptr_t)i);
+ ck_assert_ptr_eq(elm_genlist_item_parent_get(it), parent);
+ it = elm_genlist_item_next_get(it);
+ }
+
+ /* verify children list */
+ i = 1;
+ children = (Eina_List *)elm_genlist_item_subitems_get(parent);
+ EINA_LIST_FOREACH(children, l, it)
+ {
+ ck_assert_ptr_eq(elm_object_item_data_get(it), (void*)(uintptr_t)i);
+ ck_assert_ptr_eq(elm_genlist_item_parent_get(it), parent);
+ i++;
+ }
+
+ /* verify item_expanded_depth_get() */
+ ck_assert_int_eq(elm_genlist_item_expanded_depth_get(parent), 0);
+ if (elm_genlist_item_type_get(parent) == ELM_GENLIST_ITEM_GROUP)
+ ck_assert_int_eq(elm_genlist_item_expanded_depth_get(first_child), 0);
+ else if (elm_genlist_item_type_get(parent) == ELM_GENLIST_ITEM_TREE)
+ ck_assert_int_eq(elm_genlist_item_expanded_depth_get(first_child), 1);
+
+ /* verify nth_item_get() and item_index_get() */
+ for (i = 0; i <= 11; i++) // also test the not existant item 11
+ {
+ it = elm_genlist_nth_item_get(genlist, i);
+ if (i == 11)
+ // item #11 do not exists
+ ck_assert_int_eq(elm_genlist_item_index_get(it), -1);
+ else
+ ck_assert_int_eq(elm_genlist_item_index_get(it), i + 1);
+
+ if ((i == 0) || (i == 11))
+ // test first and item #11 (that do not exists)
+ ck_assert_ptr_eq(elm_object_item_data_get(it), NULL);
+ else
+ ck_assert_ptr_eq(elm_object_item_data_get(it), (void*)(uintptr_t)i);
+ }
+}
+
+EFL_START_TEST (elm_genlist_item_iteration)
+{
+ Elm_Object_Item *parent;
+ int i;
+
+ win = win_add(NULL, "genlist", ELM_WIN_BASIC);
+
+ genlist = elm_genlist_add(win);
+
+ // perform test using a GROUP item
+ parent = elm_genlist_item_append(genlist, &itc, NULL, NULL,
+ ELM_GENLIST_ITEM_GROUP, NULL, NULL);
+ for (i = 1; i <= 10; i++)
+ elm_genlist_item_append(genlist, &itc, (void*)(uintptr_t)i, parent,
+ 0, NULL, NULL);
+
+ verify_item_iteration_api(parent);
+
+ // repeat same test with a TREE item
+ elm_genlist_clear(genlist);
+ parent = elm_genlist_item_append(genlist, &itc, NULL, NULL,
+ ELM_GENLIST_ITEM_TREE, NULL, NULL);
+ for (i = 1; i <= 10; i++)
+ elm_genlist_item_append(genlist, &itc, (void*)(uintptr_t)i, parent,
+ 0, NULL, NULL);
+
+ verify_item_iteration_api(parent);
+
+}
+EFL_END_TEST
+
+EFL_START_TEST (elm_genlist_legacy_type_check)
+{
+ const char *type;
+
+ win = win_add(NULL, "genlist", ELM_WIN_BASIC);
+
+ genlist = elm_genlist_add(win);
+
+ type = elm_object_widget_type_get(genlist);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Genlist"));
+
+ type = evas_object_type_get(genlist);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_genlist"));
+
+}
+EFL_END_TEST
void test_init(void)
{
- elm_init(1, NULL);
elm_config_atspi_mode_set(EINA_TRUE);
- win = elm_win_add(NULL, "genlist", ELM_WIN_BASIC);
+ win = win_add(NULL, "genlist", ELM_WIN_BASIC);
genlist = elm_genlist_add(win);
}
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
test_init();
Efl_Access_Role role;
- role = efl_access_role_get(genlist);
+ role = efl_access_object_role_get(genlist);
ck_assert(role == EFL_ACCESS_ROLE_LIST);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(elm_atspi_children_get1)
+EFL_START_TEST(elm_atspi_children_get1)
{
test_init();
Eina_List *children;
Elm_Object_Item *it[3];
- children = efl_access_children_get(genlist);
+ children = efl_access_object_access_children_get(genlist);
ck_assert(children == NULL);
it[0] = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
it[1] = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
it[2] = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
- children = efl_access_children_get(genlist);
+ children = efl_access_object_access_children_get(genlist);
ck_assert(eina_list_count(children) == 3);
ck_assert(eina_list_nth(children, 0) == it[0]);
ck_assert(eina_list_nth(children, 1) == it[1]);
@@ -58,11 +176,10 @@ START_TEST(elm_atspi_children_get1)
eina_list_free(children);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(elm_atspi_children_get2)
+EFL_START_TEST(elm_atspi_children_get2)
{
test_init();
Eina_List *children;
@@ -72,19 +189,18 @@ START_TEST(elm_atspi_children_get2)
it[1] = elm_genlist_item_prepend(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
it[2] = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_TREE, NULL, NULL);
- children = efl_access_children_get(genlist);
+ children = efl_access_object_access_children_get(genlist);
ck_assert(eina_list_nth(children, 1) == it[0]);
ck_assert(eina_list_nth(children, 0) == it[1]);
ck_assert(eina_list_nth(children, 2) == it[2]);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
static void
_children_changed_cb(void *data EINA_UNUSED, const Efl_Event *event)
{
- if (event->desc != EFL_ACCESS_EVENT_CHILDREN_CHANGED)
+ if (event->desc != EFL_ACCESS_OBJECT_EVENT_CHILDREN_CHANGED)
return;
ev_data = *(Efl_Access_Event_Children_Changed_Data*)event->info;
@@ -92,7 +208,7 @@ _children_changed_cb(void *data EINA_UNUSED, const Efl_Event *event)
counter++;
}
-START_TEST(elm_atspi_children_events_add)
+EFL_START_TEST(elm_atspi_children_events_add)
{
test_init();
@@ -101,7 +217,7 @@ START_TEST(elm_atspi_children_events_add)
Elm_Object_Item *it[3];
- efl_access_event_handler_add(EFL_ACCESS_MIXIN, _children_changed_cb, NULL);
+ efl_access_object_event_handler_add(EFL_ACCESS_OBJECT_MIXIN, _children_changed_cb, NULL);
it[0] = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
ck_assert(genlist == current);
@@ -121,11 +237,10 @@ START_TEST(elm_atspi_children_events_add)
ck_assert(ev_data.is_added == EINA_TRUE);
ck_assert(ev_data.child == it[2]);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(elm_atspi_children_events_del1)
+EFL_START_TEST(elm_atspi_children_events_del1)
{
test_init();
@@ -138,7 +253,7 @@ START_TEST(elm_atspi_children_events_del1)
it[1] = elm_genlist_item_prepend(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
it[2] = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_TREE, NULL, NULL);
- efl_access_event_handler_add(EFL_ACCESS_MIXIN, _children_changed_cb, NULL);
+ efl_access_object_event_handler_add(EFL_ACCESS_OBJECT_MIXIN, _children_changed_cb, NULL);
elm_object_item_del(it[0]);
ck_assert(genlist == current);
@@ -152,11 +267,10 @@ START_TEST(elm_atspi_children_events_del1)
ck_assert(ev_data.is_added == EINA_FALSE);
ck_assert(ev_data.child == it[2]);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(elm_atspi_children_events_del2)
+EFL_START_TEST(elm_atspi_children_events_del2)
{
test_init();
@@ -166,7 +280,7 @@ START_TEST(elm_atspi_children_events_del2)
it = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
- efl_access_event_handler_add(EFL_ACCESS_MIXIN, _children_changed_cb, NULL);
+ efl_access_object_event_handler_add(EFL_ACCESS_OBJECT_MIXIN, _children_changed_cb, NULL);
elm_genlist_clear(genlist);
ck_assert(genlist == current);
@@ -174,12 +288,50 @@ START_TEST(elm_atspi_children_events_del2)
ck_assert(ev_data.is_added == EINA_FALSE);
ck_assert(ev_data.child == it);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
+
+static int it_del = 0;
+
+static void
+_gl_destroy()
+{
+ ck_assert_int_eq(it_del, 2);
+}
+
+static void
+_it_destroy()
+{
+ it_del++;
+}
+
+static void
+_it_del()
+{
+ it_del = 1;
+}
+
+EFL_START_TEST(elm_genlist_item_destroy)
+{
+ Elm_Object_Item *git;
+
+ win = win_add(NULL, "genlist", ELM_WIN_BASIC);
+
+ genlist = elm_genlist_add(win);
+ efl_event_callback_add(genlist, EFL_EVENT_DESTRUCT, _gl_destroy, NULL);
+
+ git = elm_genlist_item_append(genlist, &itc, NULL, NULL, 0, NULL, NULL);
+ efl_event_callback_add(git, EFL_EVENT_DEL, _it_del, NULL);
+ efl_event_callback_add(git, EFL_EVENT_DESTRUCT, _it_destroy, NULL);
+
+}
+EFL_END_TEST
void elm_test_genlist(TCase *tc)
{
+ tcase_add_test(tc, elm_genlist_legacy_type_check);
+ tcase_add_test(tc, elm_genlist_item_destroy);
+ tcase_add_test(tc, elm_genlist_item_iteration);
tcase_add_test(tc, elm_atspi_role_get);
tcase_add_test(tc, elm_atspi_children_get1);
tcase_add_test(tc, elm_atspi_children_get2);
diff --git a/src/tests/elementary/elm_test_glview.c b/src/tests/elementary/elm_test_glview.c
index 79849d87b9..2d1c8a3609 100644
--- a/src/tests/elementary/elm_test_glview.c
+++ b/src/tests/elementary/elm_test_glview.c
@@ -2,33 +2,59 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_glview_legacy_type_check)
+{
+ Evas_Object *win, *glview;
+ const char *type;
+
+ win = win_add(NULL, "glview", ELM_WIN_BASIC);
+
+ glview = elm_glview_add(win);
+
+ if (glview)
+ {
+ type = elm_object_widget_type_get(glview);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Glview"));
+
+ type = evas_object_type_get(glview);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_glview"));
+ }
-START_TEST (elm_atspi_role_get)
+}
+EFL_END_TEST
+
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *glview;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "glview", ELM_WIN_BASIC);
+ win = win_add(NULL, "glview", ELM_WIN_BASIC);
glview = elm_glview_add(win);
// if no gl backend skip test
if (glview)
{
- role = efl_access_role_get(glview);
+ role = efl_access_object_role_get(glview);
ck_assert(role == EFL_ACCESS_ROLE_ANIMATION);
}
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_glview(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ if (getenv("TESTS_GL_DISABLED"))
+ {
+ fprintf(stdout, "glview tests disabled in buffer engine\n");
+ return;
+ }
+ tcase_add_test(tc, elm_glview_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_grid.c b/src/tests/elementary/elm_test_grid.c
index e41f8b1219..f014c712a3 100644
--- a/src/tests/elementary/elm_test_grid.c
+++ b/src/tests/elementary/elm_test_grid.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_grid_legacy_type_check)
+{
+ Evas_Object *win, *grid;
+ const char *type;
+
+ win = win_add(NULL, "grid", ELM_WIN_BASIC);
+
+ grid = elm_grid_add(win);
+
+ type = elm_object_widget_type_get(grid);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Grid"));
+
+ type = evas_object_type_get(grid);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_grid"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *grid;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "grid", ELM_WIN_BASIC);
+ win = win_add(NULL, "grid", ELM_WIN_BASIC);
grid = elm_grid_add(win);
- role = efl_access_role_get(grid);
+ role = efl_access_object_role_get(grid);
ck_assert(role == EFL_ACCESS_ROLE_FILLER);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_grid(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_grid_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_hover.c b/src/tests/elementary/elm_test_hover.c
index 5b048ed26c..42db4b667f 100644
--- a/src/tests/elementary/elm_test_hover.c
+++ b/src/tests/elementary/elm_test_hover.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_hover_legacy_type_check)
+{
+ Evas_Object *win, *hover;
+ const char *type;
+
+ win = win_add(NULL, "hover", ELM_WIN_BASIC);
+
+ hover = elm_hover_add(win);
+
+ type = elm_object_widget_type_get(hover);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Hover"));
+
+ type = evas_object_type_get(hover);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_hover"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *hover;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "hover", ELM_WIN_BASIC);
+ win = win_add(NULL, "hover", ELM_WIN_BASIC);
hover = elm_hover_add(win);
- role = efl_access_role_get(hover);
+ role = efl_access_object_role_get(hover);
ck_assert(role == EFL_ACCESS_ROLE_POPUP_MENU);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_hover(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_hover_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_hoversel.c b/src/tests/elementary/elm_test_hoversel.c
index 8c2ecc71f6..982ab6f824 100644
--- a/src/tests/elementary/elm_test_hoversel.c
+++ b/src/tests/elementary/elm_test_hoversel.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_hoversel_legacy_type_check)
+{
+ Evas_Object *win, *hoversel;
+ const char *type;
+
+ win = win_add(NULL, "hoversel", ELM_WIN_BASIC);
+
+ hoversel = elm_hoversel_add(win);
+
+ type = elm_object_widget_type_get(hoversel);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Hoversel"));
+
+ type = evas_object_type_get(hoversel);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_hoversel"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *hoversel;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "hoversel", ELM_WIN_BASIC);
+ win = win_add(NULL, "hoversel", ELM_WIN_BASIC);
hoversel = elm_hoversel_add(win);
- role = efl_access_role_get(hoversel);
+ role = efl_access_object_role_get(hoversel);
ck_assert(role == EFL_ACCESS_ROLE_PUSH_BUTTON);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_hoversel(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_hoversel_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_icon.c b/src/tests/elementary/elm_test_icon.c
index 2b2150665d..9580e4ebb4 100644
--- a/src/tests/elementary/elm_test_icon.c
+++ b/src/tests/elementary/elm_test_icon.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_icon_legacy_type_check)
+{
+ Evas_Object *win, *icon;
+ const char *type;
+
+ win = win_add(NULL, "icon", ELM_WIN_BASIC);
+
+ icon = elm_icon_add(win);
+
+ type = elm_object_widget_type_get(icon);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Icon"));
+
+ type = evas_object_type_get(icon);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_icon"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *icon;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "icon", ELM_WIN_BASIC);
+ win = win_add(NULL, "icon", ELM_WIN_BASIC);
icon = elm_icon_add(win);
- role = efl_access_role_get(icon);
+ role = efl_access_object_role_get(icon);
ck_assert(role == EFL_ACCESS_ROLE_ICON);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_icon(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_icon_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_image.c b/src/tests/elementary/elm_test_image.c
index 39f5107e90..109c56d122 100644
--- a/src/tests/elementary/elm_test_image.c
+++ b/src/tests/elementary/elm_test_image.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
@@ -17,22 +17,40 @@ struct _Test_Data
int success;
};
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_image_legacy_type_check)
+{
+ Evas_Object *win, *image;
+ const char *type;
+
+ win = win_add(NULL, "image", ELM_WIN_BASIC);
+
+ image = elm_image_add(win);
+
+ type = elm_object_widget_type_get(image);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Image"));
+
+ type = evas_object_type_get(image);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_image"));
+
+}
+EFL_END_TEST
+
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *image;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "image", ELM_WIN_BASIC);
+ win = win_add(NULL, "image", ELM_WIN_BASIC);
image = elm_image_add(win);
- role = efl_access_role_get(image);
+ role = efl_access_object_role_get(image);
ck_assert(role == EFL_ACCESS_ROLE_IMAGE);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
static void
_async_error_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
@@ -109,14 +127,14 @@ _timeout_cb(void *data)
return ECORE_CALLBACK_CANCEL;
}
-START_TEST (elm_image_async_path)
+EFL_START_TEST (elm_image_async_path)
{
Evas_Object *win, *image;
+ Ecore_Timer *t;
Eina_Bool ok;
Test_Data td;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "image", ELM_WIN_BASIC);
+ win = win_add(NULL, "image", ELM_WIN_BASIC);
td.success = 0;
td.image_id = 0;
@@ -130,25 +148,25 @@ START_TEST (elm_image_async_path)
ok = elm_image_file_set(image, invalid, NULL);
ck_assert(ok);
- ecore_timer_add(10.0, _timeout_cb, &td);
+ t = ecore_timer_add(10.0, _timeout_cb, &td);
elm_run();
ck_assert(td.success == 3);
- elm_shutdown();
+ ecore_timer_del(t);
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_image_async_mmap)
+EFL_START_TEST (elm_image_async_mmap)
{
Evas_Object *win, *image;
+ Ecore_Timer *t;
Eina_Bool ok;
Test_Data td;
Eina_File *f;
char path[PATH_MAX];
- elm_init(1, NULL);
- win = elm_win_add(NULL, "image", ELM_WIN_BASIC);
+ win = win_add(NULL, "image", ELM_WIN_BASIC);
td.success = 1; // skip "error" case
td.image_id = 1;
@@ -166,25 +184,46 @@ START_TEST (elm_image_async_mmap)
ok = elm_image_mmap_set(image, f, NULL);
ck_assert(ok);
- ecore_timer_add(10.0, _timeout_cb, &td);
+ t = ecore_timer_add(10.0, _timeout_cb, &td);
elm_run();
ck_assert(td.success == 3);
eina_file_close(f);
- elm_shutdown();
+ ecore_timer_del(t);
+}
+EFL_END_TEST
+
+EFL_START_TEST (elm_image_evas_object_color_set)
+{
+ Evas_Object *win, *image;
+ Eina_Bool ok;
+ Test_Data td;
+ Eina_File *f;
+ char path[PATH_MAX];
+ int r = 128, g = 99, b = 3, a = 230;
+ int rr = 0, gg = 0, bb = 0, aa = 0;
+
+ win = win_add(NULL, "image", ELM_WIN_BASIC);
+
+ image = elm_image_add(win);
+ evas_object_color_set(image, r, g, b, a);
+ evas_object_color_get(image, &rr, &gg, &bb, &aa);
+ ck_assert(r == rr);
+ ck_assert(g == gg);
+ ck_assert(b == bb);
+ ck_assert(a == aa);
}
-END_TEST
+EFL_END_TEST
-START_TEST (efl_ui_image_icon)
+EFL_START_TEST (efl_ui_image_icon)
{
Evas_Object *win, *image;
Eina_Bool ok;
const char *icon_name;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "image", ELM_WIN_BASIC);
+ win = win_add(NULL, "image", ELM_WIN_BASIC);
image = efl_add(EFL_UI_IMAGE_CLASS, win);
evas_object_show(image);
@@ -199,14 +238,15 @@ START_TEST (efl_ui_image_icon)
icon_name = efl_ui_image_icon_get(image);
ck_assert(icon_name == NULL);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_image(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
- tcase_add_test(tc, elm_image_async_path);
- tcase_add_test(tc, elm_image_async_mmap);
- tcase_add_test(tc, efl_ui_image_icon);
+ tcase_add_test(tc, elm_image_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_image_async_path);
+ tcase_add_test(tc, elm_image_async_mmap);
+ tcase_add_test(tc, elm_image_evas_object_color_set);
+ tcase_add_test(tc, efl_ui_image_icon);
}
diff --git a/src/tests/elementary/elm_test_index.c b/src/tests/elementary/elm_test_index.c
index 1de056b86d..c335da6551 100644
--- a/src/tests/elementary/elm_test_index.c
+++ b/src/tests/elementary/elm_test_index.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_index_legacy_type_check)
+{
+ Evas_Object *win, *index;
+ const char *type;
+
+ win = win_add(NULL, "index", ELM_WIN_BASIC);
+
+ index = elm_index_add(win);
+
+ type = elm_object_widget_type_get(index);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Index"));
+
+ type = evas_object_type_get(index);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_index"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *idx;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "index", ELM_WIN_BASIC);
+ win = win_add(NULL, "index", ELM_WIN_BASIC);
idx = elm_index_add(win);
- role = efl_access_role_get(idx);
+ role = efl_access_object_role_get(idx);
ck_assert(role == EFL_ACCESS_ROLE_SCROLL_BAR);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_index(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_index_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_init.c b/src/tests/elementary/elm_test_init.c
index 3e3210c9f7..da3a584cab 100644
--- a/src/tests/elementary/elm_test_init.c
+++ b/src/tests/elementary/elm_test_init.c
@@ -5,12 +5,10 @@
#include <Elementary.h>
#include "elm_suite.h"
-START_TEST (elm_main)
+EFL_START_TEST (elm_main)
{
- ck_assert(elm_init(1, NULL) == 1);
- ck_assert(elm_shutdown() == 0);
}
-END_TEST
+EFL_END_TEST
void elm_test_init(TCase *tc)
{
diff --git a/src/tests/elementary/elm_test_inwin.c b/src/tests/elementary/elm_test_inwin.c
index e0494844cb..5817aeb32a 100644
--- a/src/tests/elementary/elm_test_inwin.c
+++ b/src/tests/elementary/elm_test_inwin.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_inwin_legacy_type_check)
+{
+ Evas_Object *win, *inwin;
+ const char *type;
+
+ win = win_add(NULL, "inwin", ELM_WIN_BASIC);
+
+ inwin = elm_win_inwin_add(win);
+
+ type = elm_object_widget_type_get(inwin);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Inwin"));
+
+ type = evas_object_type_get(inwin);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_inwin"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *inwin;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "inwin", ELM_WIN_BASIC);
+ win = win_add(NULL, "inwin", ELM_WIN_BASIC);
inwin = elm_win_inwin_add(win);
- role = efl_access_role_get(inwin);
+ role = efl_access_object_role_get(inwin);
ck_assert(role == EFL_ACCESS_ROLE_GLASS_PANE);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_inwin(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_inwin_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_label.c b/src/tests/elementary/elm_test_label.c
index 75b27ea959..55ca1becdb 100644
--- a/src/tests/elementary/elm_test_label.c
+++ b/src/tests/elementary/elm_test_label.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_label_legacy_type_check)
+{
+ Evas_Object *win, *label;
+ const char *type;
+
+ win = win_add(NULL, "label", ELM_WIN_BASIC);
+
+ label = elm_label_add(win);
+
+ type = elm_object_widget_type_get(label);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Label"));
+
+ type = evas_object_type_get(label);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_label"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *label;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "label", ELM_WIN_BASIC);
+ win = win_add(NULL, "label", ELM_WIN_BASIC);
label = elm_label_add(win);
- role = efl_access_role_get(label);
+ role = efl_access_object_role_get(label);
ck_assert(role == EFL_ACCESS_ROLE_LABEL);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_label(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_label_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_layout.c b/src/tests/elementary/elm_test_layout.c
index dc506e4f8a..a5949f9f10 100644
--- a/src/tests/elementary/elm_test_layout.c
+++ b/src/tests/elementary/elm_test_layout.c
@@ -2,37 +2,53 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_layout_legacy_type_check)
+{
+ Evas_Object *win, *layout;
+ const char *type;
+
+ win = win_add(NULL, "layout", ELM_WIN_BASIC);
+
+ layout = elm_layout_add(win);
+
+ type = elm_object_widget_type_get(layout);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Layout"));
-START_TEST(elm_atspi_role_get)
+ type = evas_object_type_get(layout);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_layout"));
+
+}
+EFL_END_TEST
+
+EFL_START_TEST(elm_atspi_role_get)
{
Evas_Object *win, *layout;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "layout", ELM_WIN_BASIC);
+ win = win_add(NULL, "layout", ELM_WIN_BASIC);
layout = elm_layout_add(win);
- role = efl_access_role_get(layout);
+ role = efl_access_object_role_get(layout);
ck_assert(role == EFL_ACCESS_ROLE_FILLER);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(elm_layout_swallows)
+EFL_START_TEST(elm_layout_swallows)
{
char buf[PATH_MAX];
Evas_Object *win, *ly, *bt, *bt2;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "layout", ELM_WIN_BASIC);
+ win = win_add(NULL, "layout", ELM_WIN_BASIC);
- ly = efl_add(EFL_UI_LAYOUT_CLASS, win);
+ ly = efl_add(EFL_UI_LAYOUT_OBJECT_CLASS, win);
snprintf(buf, sizeof(buf), "%s/objects/test.edj", ELM_TEST_DATA_DIR);
elm_layout_file_set(ly, buf, "layout");
evas_object_show(ly);
@@ -50,26 +66,35 @@ START_TEST(elm_layout_swallows)
bt2 = efl_add(EFL_UI_BUTTON_CLASS, ly);
fail_if(!efl_content_set(efl_part(ly, "element1"), bt2));
ck_assert_ptr_eq(efl_parent_get(bt2), ly);
- /* bt is deleted at this point. */
- ck_assert_ptr_eq(efl_parent_get(bt), evas_object_evas_get(bt));
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
+
+static Eina_Value
+_propagated_cb(void *data EINA_UNUSED,
+ const Eina_Value v,
+ const Eina_Future *dead_future EINA_UNUSED)
+{
+ ecore_main_loop_quit();
+
+ fprintf(stderr, "delivered '%s'\n", eina_value_to_string(&v));
+
+ return v;
+}
-START_TEST(elm_layout_model_connect)
+EFL_START_TEST(elm_layout_model_connect)
{
char buf[PATH_MAX];
Evas_Object *win, *ly;
Efl_Model_Item *model;
Eina_Value v;
+ Eina_Future *f;
const char *part_text;
const char text_value[] = "A random string for elm_layout_model_connect test";
- elm_init(1, NULL);
- win = elm_win_add(NULL, "layout", ELM_WIN_BASIC);
+ win = win_add(NULL, "layout", ELM_WIN_BASIC);
- ly = efl_add(EFL_UI_LAYOUT_CLASS, win);
+ ly = efl_add(EFL_UI_LAYOUT_OBJECT_CLASS, win);
snprintf(buf, sizeof(buf), "%s/objects/test.edj", ELM_TEST_DATA_DIR);
elm_layout_file_set(ly, buf, "layout");
evas_object_show(ly);
@@ -77,23 +102,24 @@ START_TEST(elm_layout_model_connect)
model = efl_add(EFL_MODEL_ITEM_CLASS, win);
ck_assert(!!eina_value_setup(&v, EINA_VALUE_TYPE_STRING));
ck_assert(!!eina_value_set(&v, text_value));
- efl_model_property_set(model, "text_property", &v);
+ f = efl_model_property_set(model, "text_property", &v);
+ eina_future_then(f, _propagated_cb, NULL);
efl_ui_model_connect(ly, "text", "text_property");
efl_ui_view_model_set(ly, model);
- ecore_main_loop_iterate_may_block(EINA_TRUE);
+ ecore_main_loop_begin();
part_text = elm_layout_text_get(ly, "text");
ck_assert_str_eq(part_text, text_value);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_layout(TCase *tc)
{
+ tcase_add_test(tc, elm_layout_legacy_type_check);
tcase_add_test(tc, elm_atspi_role_get);
tcase_add_test(tc, elm_layout_swallows);
tcase_add_test(tc, elm_layout_model_connect);
diff --git a/src/tests/elementary/elm_test_list.c b/src/tests/elementary/elm_test_list.c
index 24ffcdc84c..125292613f 100644
--- a/src/tests/elementary/elm_test_list.c
+++ b/src/tests/elementary/elm_test_list.c
@@ -3,23 +3,43 @@
#endif
#define EFL_ACCESS_SELECTION_PROTECTED
-#define EFL_ACCESS_BETA
-#define EFL_ACCESS_PROTECTED
+#define EFL_ACCESS_OBJECT_BETA
+#define EFL_ACCESS_OBJECT_PROTECTED
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_list_legacy_type_check)
+{
+ Evas_Object *win, *list;
+ const char *type;
+
+ win = win_add(NULL, "list", ELM_WIN_BASIC);
+
+ list = elm_list_add(win);
+
+ type = elm_object_widget_type_get(list);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_List"));
+
+ type = evas_object_type_get(list);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_list"));
+
+}
+EFL_END_TEST
+
#if 0
// Skip following tests until Elm_Widget_Item will migrate to Eo infrastructure
// and following features can be implemented
-START_TEST (elm_list_atspi_selection_selected_children_count_get)
+EFL_START_TEST (elm_list_atspi_selection_selected_children_count_get)
{
Evas_Object *win, *list;
Elm_Object_Item *item;
int val;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "list", ELM_WIN_BASIC);
+
+ win = win_add(NULL, "list", ELM_WIN_BASIC);
list = elm_list_add(win);
item = elm_list_item_append(list, "First Element", NULL, NULL, NULL, NULL);
@@ -35,18 +55,17 @@ START_TEST (elm_list_atspi_selection_selected_children_count_get)
val = elm_interface_atspi_selection_selected_children_count_get(list);
ck_assert(val == 0);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_list_atspi_selection_child_select)
+EFL_START_TEST (elm_list_atspi_selection_child_select)
{
Evas_Object *win, *list;
Elm_Object_Item *item;
Eina_Bool val;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "list", ELM_WIN_BASIC);
+
+ win = win_add(NULL, "list", ELM_WIN_BASIC);
list = elm_list_add(win);
item = elm_list_item_append(list, "First Element", NULL, NULL, NULL, NULL);
@@ -55,18 +74,17 @@ START_TEST (elm_list_atspi_selection_child_select)
ck_assert(val == EINA_TRUE);
ck_assert(EINA_TRUE == elm_list_item_selected_get(item));
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_list_atspi_selection_selected_child_deselect)
+EFL_START_TEST (elm_list_atspi_selection_selected_child_deselect)
{
Evas_Object *win, *list;
Elm_Object_Item *item;
Eina_Bool val;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "list", ELM_WIN_BASIC);
+
+ win = win_add(NULL, "list", ELM_WIN_BASIC);
list = elm_list_add(win);
elm_list_multi_select_set(list, EINA_TRUE);
@@ -78,18 +96,17 @@ START_TEST (elm_list_atspi_selection_selected_child_deselect)
ck_assert(val == EINA_TRUE);
ck_assert(EINA_FALSE == elm_list_item_selected_get(item));
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_list_atspi_selection_is_child_selected)
+EFL_START_TEST (elm_list_atspi_selection_is_child_selected)
{
Evas_Object *win, *list;
Elm_Object_Item *item;
Eina_Bool val;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "list", ELM_WIN_BASIC);
+
+ win = win_add(NULL, "list", ELM_WIN_BASIC);
list = elm_list_add(win);
item = elm_list_item_append(list, "First Element", NULL, NULL, NULL, NULL);
@@ -101,18 +118,17 @@ START_TEST (elm_list_atspi_selection_is_child_selected)
val = elm_interface_atspi_selection_is_child_selected(list, 0);
ck_assert(val == EINA_TRUE);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_list_atspi_selection_all_children_select)
+EFL_START_TEST (elm_list_atspi_selection_all_children_select)
{
Evas_Object *win, *list;
Elm_Object_Item *item1, *item2;
Eina_Bool val;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "list", ELM_WIN_BASIC);
+
+ win = win_add(NULL, "list", ELM_WIN_BASIC);
list = elm_list_add(win);
@@ -128,19 +144,18 @@ START_TEST (elm_list_atspi_selection_all_children_select)
ck_assert(EINA_TRUE == elm_list_item_selected_get(item1));
ck_assert(EINA_TRUE == elm_list_item_selected_get(item2));
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_list_atspi_selection_clear)
+EFL_START_TEST (elm_list_atspi_selection_clear)
{
Evas_Object *win, *list;
Elm_Object_Item *item1, *item2;
Eina_Bool val;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "list", ELM_WIN_BASIC);
+
+ win = win_add(NULL, "list", ELM_WIN_BASIC);
list = elm_list_add(win);
elm_list_multi_select_set(list, EINA_TRUE);
@@ -155,18 +170,17 @@ START_TEST (elm_list_atspi_selection_clear)
ck_assert(EINA_FALSE == elm_list_item_selected_get(item1));
ck_assert(EINA_FALSE == elm_list_item_selected_get(item2));
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_list_atspi_selection_child_deselect)
+EFL_START_TEST (elm_list_atspi_selection_child_deselect)
{
Evas_Object *win, *list;
Elm_Object_Item *item;
Eina_Bool val;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "list", ELM_WIN_BASIC);
+
+ win = win_add(NULL, "list", ELM_WIN_BASIC);
list = elm_list_add(win);
elm_list_multi_select_set(list, EINA_TRUE);
@@ -178,70 +192,68 @@ START_TEST (elm_list_atspi_selection_child_deselect)
ck_assert(val == EINA_TRUE);
ck_assert(EINA_FALSE == elm_list_item_selected_get(item));
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
#endif
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *list;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "list", ELM_WIN_BASIC);
+
+ win = win_add(NULL, "list", ELM_WIN_BASIC);
list = elm_list_add(win);
- role = efl_access_role_get(list);
+ role = efl_access_object_role_get(list);
ck_assert(role == EFL_ACCESS_ROLE_LIST);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
/**
* Validate if genlist implementation properly reset parent to Elm_Genlist_Item
* from Elm_Genlist
*/
-START_TEST(elm_atspi_children_parent)
+EFL_START_TEST(elm_atspi_children_parent)
{
- Efl_Access *parent;
+ Efl_Access_Object *parent;
+ Elm_Object_Item *it;
- elm_init(1, NULL);
- Evas_Object *win = elm_win_add(NULL, "list", ELM_WIN_BASIC);
+ Evas_Object *win = win_add(NULL, "list", ELM_WIN_BASIC);
Evas_Object *icon = elm_icon_add(win);
Evas_Object *end = elm_icon_add(win);
Evas_Object *list = elm_list_add(win);
- elm_list_item_append(list, "First Element", icon, end, NULL, NULL);
+ it = elm_list_item_append(list, "First Element", icon, end, NULL, NULL);
evas_object_show(list);
- parent = efl_access_parent_get(icon);
- ck_assert(list == parent);
+ parent = efl_provider_find(efl_parent_get(icon), EFL_ACCESS_OBJECT_MIXIN);
+ ck_assert(it == parent);
- parent = efl_access_parent_get(end);
- ck_assert(list == parent);
+ parent = efl_provider_find(efl_parent_get(end), EFL_ACCESS_OBJECT_MIXIN);
+ ck_assert(it == parent);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_list(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_list_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
#if 0
- tcase_add_test(tc, elm_list_atspi_selection_selected_children_count_get);
- tcase_add_test(tc, elm_list_atspi_selection_child_select);
- tcase_add_test(tc, elm_list_atspi_selection_selected_child_deselect);
- tcase_add_test(tc, elm_list_atspi_selection_is_child_selected);
- tcase_add_test(tc, elm_list_atspi_selection_all_children_select);
- tcase_add_test(tc, elm_list_atspi_selection_clear);
- tcase_add_test(tc, elm_list_atspi_selection_child_deselect);
+ tcase_add_test(tc, elm_list_atspi_selection_selected_children_count_get);
+ tcase_add_test(tc, elm_list_atspi_selection_child_select);
+ tcase_add_test(tc, elm_list_atspi_selection_selected_child_deselect);
+ tcase_add_test(tc, elm_list_atspi_selection_is_child_selected);
+ tcase_add_test(tc, elm_list_atspi_selection_all_children_select);
+ tcase_add_test(tc, elm_list_atspi_selection_clear);
+ tcase_add_test(tc, elm_list_atspi_selection_child_deselect);
#endif
- tcase_add_test(tc, elm_atspi_children_parent);
+ tcase_add_test(tc, elm_atspi_children_parent);
}
diff --git a/src/tests/elementary/elm_test_map.c b/src/tests/elementary/elm_test_map.c
index 954892c20c..c39da353b2 100644
--- a/src/tests/elementary/elm_test_map.c
+++ b/src/tests/elementary/elm_test_map.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_map_legacy_type_check)
+{
+ Evas_Object *win, *map;
+ const char *type;
+
+ win = win_add(NULL, "map", ELM_WIN_BASIC);
+
+ map = elm_map_add(win);
+
+ type = elm_object_widget_type_get(map);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Map"));
+
+ type = evas_object_type_get(map);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_map"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *map;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "map", ELM_WIN_BASIC);
+ win = win_add(NULL, "map", ELM_WIN_BASIC);
map = elm_map_add(win);
- role = efl_access_role_get(map);
+ role = efl_access_object_role_get(map);
ck_assert(role == EFL_ACCESS_ROLE_IMAGE_MAP);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_map(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_map_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_mapbuf.c b/src/tests/elementary/elm_test_mapbuf.c
index 6b9507e1f1..9a1111d1b9 100644
--- a/src/tests/elementary/elm_test_mapbuf.c
+++ b/src/tests/elementary/elm_test_mapbuf.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_mapbuf_legacy_type_check)
+{
+ Evas_Object *win, *mapbuf;
+ const char *type;
+
+ win = win_add(NULL, "mapbuf", ELM_WIN_BASIC);
+
+ mapbuf = elm_mapbuf_add(win);
+
+ type = elm_object_widget_type_get(mapbuf);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Mapbuf"));
+
+ type = evas_object_type_get(mapbuf);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_mapbuf"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *mapbuf;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "mapbuf", ELM_WIN_BASIC);
+ win = win_add(NULL, "mapbuf", ELM_WIN_BASIC);
mapbuf = elm_mapbuf_add(win);
- role = efl_access_role_get(mapbuf);
+ role = efl_access_object_role_get(mapbuf);
ck_assert(role == EFL_ACCESS_ROLE_IMAGE_MAP);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_mapbuf(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_mapbuf_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_menu.c b/src/tests/elementary/elm_test_menu.c
index 69f2512ed7..05b9996e2e 100644
--- a/src/tests/elementary/elm_test_menu.c
+++ b/src/tests/elementary/elm_test_menu.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_menu_legacy_type_check)
+{
+ Evas_Object *win, *menu;
+ const char *type;
+
+ win = win_add(NULL, "menu", ELM_WIN_BASIC);
+
+ menu = elm_menu_add(win);
+
+ type = elm_object_widget_type_get(menu);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Menu"));
+
+ type = evas_object_type_get(menu);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_menu"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *menu;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "menu", ELM_WIN_BASIC);
+ win = win_add(NULL, "menu", ELM_WIN_BASIC);
menu = elm_menu_add(win);
- role = efl_access_role_get(menu);
+ role = efl_access_object_role_get(menu);
ck_assert(role == EFL_ACCESS_ROLE_MENU);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_menu(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_menu_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_multibuttonentry.c b/src/tests/elementary/elm_test_multibuttonentry.c
index 971d5c8647..79fd0f3ade 100644
--- a/src/tests/elementary/elm_test_multibuttonentry.c
+++ b/src/tests/elementary/elm_test_multibuttonentry.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_multibuttonentry_legacy_type_check)
+{
+ Evas_Object *win, *multibuttonentry;
+ const char *type;
+
+ win = win_add(NULL, "multibuttonentry", ELM_WIN_BASIC);
+
+ multibuttonentry = elm_multibuttonentry_add(win);
+
+ type = elm_object_widget_type_get(multibuttonentry);
+ ck_assert(type != NULL);
+ ck_assert_str_eq(type, "Elm_Multibuttonentry");
+
+ type = evas_object_type_get(multibuttonentry);
+ ck_assert(type != NULL);
+ ck_assert_str_eq(type, "elm_multibuttonentry");
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *multibuttonentry;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "multibuttonentry", ELM_WIN_BASIC);
+ win = win_add(NULL, "multibuttonentry", ELM_WIN_BASIC);
multibuttonentry = elm_multibuttonentry_add(win);
- role = efl_access_role_get(multibuttonentry);
+ role = efl_access_object_role_get(multibuttonentry);
ck_assert_int_eq(role, EFL_ACCESS_ROLE_PANEL);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_multibuttonentry(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_multibuttonentry_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_naviframe.c b/src/tests/elementary/elm_test_naviframe.c
index 55fa2e227f..f28f2e21be 100644
--- a/src/tests/elementary/elm_test_naviframe.c
+++ b/src/tests/elementary/elm_test_naviframe.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_naviframe_legacy_type_check)
+{
+ Evas_Object *win, *naviframe;
+ const char *type;
+
+ win = win_add(NULL, "naviframe", ELM_WIN_BASIC);
+
+ naviframe = elm_naviframe_add(win);
+
+ type = elm_object_widget_type_get(naviframe);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Naviframe"));
+
+ type = evas_object_type_get(naviframe);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_naviframe"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *naviframe;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "naviframe", ELM_WIN_BASIC);
+ win = win_add(NULL, "naviframe", ELM_WIN_BASIC);
naviframe = elm_naviframe_add(win);
- role = efl_access_role_get(naviframe);
+ role = efl_access_object_role_get(naviframe);
ck_assert(role == EFL_ACCESS_ROLE_PAGE_TAB_LIST);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_naviframe(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_naviframe_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_notify.c b/src/tests/elementary/elm_test_notify.c
index 6ef03d7aa3..d32e596cb8 100644
--- a/src/tests/elementary/elm_test_notify.c
+++ b/src/tests/elementary/elm_test_notify.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_notify_legacy_type_check)
+{
+ Evas_Object *win, *notify;
+ const char *type;
+
+ win = win_add(NULL, "notify", ELM_WIN_BASIC);
+
+ notify = elm_notify_add(win);
+
+ type = elm_object_widget_type_get(notify);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Notify"));
+
+ type = evas_object_type_get(notify);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_notify"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *notify;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "notify", ELM_WIN_BASIC);
+ win = win_add(NULL, "notify", ELM_WIN_BASIC);
notify = elm_notify_add(win);
- role = efl_access_role_get(notify);
+ role = efl_access_object_role_get(notify);
ck_assert(role == EFL_ACCESS_ROLE_NOTIFICATION);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_notify(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_notify_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_panel.c b/src/tests/elementary/elm_test_panel.c
index 312098d554..2460443e53 100644
--- a/src/tests/elementary/elm_test_panel.c
+++ b/src/tests/elementary/elm_test_panel.c
@@ -2,30 +2,48 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_panel_legacy_type_check)
+{
+ Evas_Object *win, *panel;
+ const char *type;
+
+ win = win_add(NULL, "panel", ELM_WIN_BASIC);
+
+ panel = elm_panel_add(win);
+
+ type = elm_object_widget_type_get(panel);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Panel"));
+
+ type = evas_object_type_get(panel);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_panel"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *panel;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "panel", ELM_WIN_BASIC);
+ win = win_add(NULL, "panel", ELM_WIN_BASIC);
panel = elm_panel_add(win);
- role = efl_access_role_get(panel);
+ role = efl_access_object_role_get(panel);
ck_assert(role == EFL_ACCESS_ROLE_PANEL);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_panel(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_panel_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_panes.c b/src/tests/elementary/elm_test_panes.c
index 08d6992dc8..367fce6943 100644
--- a/src/tests/elementary/elm_test_panes.c
+++ b/src/tests/elementary/elm_test_panes.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_panes_legacy_type_check)
+{
+ Evas_Object *win, *panes;
+ const char *type;
+
+ win = win_add(NULL, "panes", ELM_WIN_BASIC);
+
+ panes = elm_panes_add(win);
+
+ type = elm_object_widget_type_get(panes);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Panes"));
+
+ type = evas_object_type_get(panes);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_panes"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *panes;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "panes", ELM_WIN_BASIC);
+ win = win_add(NULL, "panes", ELM_WIN_BASIC);
panes = elm_panes_add(win);
- role = efl_access_role_get(panes);
+ role = efl_access_object_role_get(panes);
ck_assert(role == EFL_ACCESS_ROLE_SPLIT_PANE);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_panes(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_panes_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_photo.c b/src/tests/elementary/elm_test_photo.c
index cae85702b1..ec610996ff 100644
--- a/src/tests/elementary/elm_test_photo.c
+++ b/src/tests/elementary/elm_test_photo.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_photo_legacy_type_check)
+{
+ Evas_Object *win, *photo;
+ const char *type;
+
+ win = win_add(NULL, "photo", ELM_WIN_BASIC);
+
+ photo = elm_photo_add(win);
+
+ type = elm_object_widget_type_get(photo);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Photo"));
+
+ type = evas_object_type_get(photo);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_photo"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *photo;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "photo", ELM_WIN_BASIC);
+ win = win_add(NULL, "photo", ELM_WIN_BASIC);
photo = elm_photo_add(win);
- role = efl_access_role_get(photo);
+ role = efl_access_object_role_get(photo);
ck_assert(role == EFL_ACCESS_ROLE_IMAGE);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_photo(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_photo_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_photocam.c b/src/tests/elementary/elm_test_photocam.c
index 33aa91b731..311b73525b 100644
--- a/src/tests/elementary/elm_test_photocam.c
+++ b/src/tests/elementary/elm_test_photocam.c
@@ -2,36 +2,52 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_photocam_legacy_type_check)
+{
+ Evas_Object *win, *photocam;
+ const char *type;
+
+ win = win_add(NULL, "photocam", ELM_WIN_BASIC);
+
+ photocam = elm_photocam_add(win);
+
+ type = elm_object_widget_type_get(photocam);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Photocam"));
+
+ type = evas_object_type_get(photocam);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_photocam"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *photocam;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "photocam", ELM_WIN_BASIC);
+ win = win_add(NULL, "photocam", ELM_WIN_BASIC);
photocam = elm_photocam_add(win);
- role = efl_access_role_get(photocam);
+ role = efl_access_object_role_get(photocam);
ck_assert(role == EFL_ACCESS_ROLE_IMAGE);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (efl_ui_image_zoomable_icon)
+EFL_START_TEST (efl_ui_image_zoomable_icon)
{
Evas_Object *win, *img_zoomable;
Eina_Bool ok;
const char *icon_name;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "photocam", ELM_WIN_BASIC);
+ win = win_add(NULL, "photocam", ELM_WIN_BASIC);
img_zoomable = efl_add(EFL_UI_IMAGE_ZOOMABLE_CLASS, win);
evas_object_show(img_zoomable);
@@ -46,12 +62,12 @@ START_TEST (efl_ui_image_zoomable_icon)
icon_name = efl_ui_image_icon_get(img_zoomable);
ck_assert(icon_name == NULL);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_photocam(TCase *tc)
{
+ tcase_add_test(tc, elm_photocam_legacy_type_check);
tcase_add_test(tc, elm_atspi_role_get);
tcase_add_test(tc, efl_ui_image_zoomable_icon);
}
diff --git a/src/tests/elementary/elm_test_player.c b/src/tests/elementary/elm_test_player.c
index de46096bb0..307aa301b9 100644
--- a/src/tests/elementary/elm_test_player.c
+++ b/src/tests/elementary/elm_test_player.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_player_legacy_type_check)
+{
+ Evas_Object *win, *player;
+ const char *type;
+
+ win = win_add(NULL, "player", ELM_WIN_BASIC);
+
+ player = elm_player_add(win);
+
+ type = elm_object_widget_type_get(player);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Player"));
+
+ type = evas_object_type_get(player);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_player"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *player;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "player", ELM_WIN_BASIC);
+ win = win_add(NULL, "player", ELM_WIN_BASIC);
player = elm_player_add(win);
- role = efl_access_role_get(player);
+ role = efl_access_object_role_get(player);
ck_assert(role == EFL_ACCESS_ROLE_ANIMATION);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_player(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_player_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_plug.c b/src/tests/elementary/elm_test_plug.c
index e2ddcb4daf..3f3441862c 100644
--- a/src/tests/elementary/elm_test_plug.c
+++ b/src/tests/elementary/elm_test_plug.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_plug_legacy_type_check)
+{
+ Evas_Object *win, *plug;
+ const char *type;
+
+ win = win_add(NULL, "plug", ELM_WIN_BASIC);
+
+ plug = elm_plug_add(win);
+
+ type = elm_object_widget_type_get(plug);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Plug"));
+
+ type = evas_object_type_get(plug);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_plug"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *plug;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "plug", ELM_WIN_BASIC);
+ win = win_add(NULL, "plug", ELM_WIN_BASIC);
plug = elm_plug_add(win);
- role = efl_access_role_get(plug);
+ role = efl_access_object_role_get(plug);
ck_assert(role == EFL_ACCESS_ROLE_IMAGE);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_plug(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_plug_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_popup.c b/src/tests/elementary/elm_test_popup.c
index 17b8433b1d..e288bab9a9 100644
--- a/src/tests/elementary/elm_test_popup.c
+++ b/src/tests/elementary/elm_test_popup.c
@@ -2,29 +2,77 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_popup_legacy_type_check)
+{
+ Evas_Object *win, *popup;
+ const char *type;
+
+ win = win_add(NULL, "popup", ELM_WIN_BASIC);
+
+ popup = elm_popup_add(win);
+
+ type = elm_object_widget_type_get(popup);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Popup"));
-START_TEST (elm_atspi_role_get)
+ type = evas_object_type_get(popup);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_popup"));
+
+}
+EFL_END_TEST
+
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *popup;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "popup", ELM_WIN_BASIC);
+ win = win_add(NULL, "popup", ELM_WIN_BASIC);
popup = elm_popup_add(win);
- role = efl_access_role_get(popup);
+ role = efl_access_object_role_get(popup);
ck_assert(role == EFL_ACCESS_ROLE_DIALOG);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
+
+static void
+_focus_cb(void *data, Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ *((Eina_Bool*)data) = EINA_TRUE;
+}
+
+
+EFL_START_TEST (elm_popup_focus_get)
+{
+ Evas_Object *win, *popup;
+ Eina_Bool focused = EINA_FALSE;
+
+ win = win_add(NULL, "popup", ELM_WIN_BASIC);
+
+ popup = elm_popup_add(win);
+ elm_popup_scrollable_set(popup, EINA_TRUE);
+ elm_object_text_set(popup, "This Popup has content area and "
+ "timeout value is 3 seconds");
+ elm_popup_timeout_set(popup, 3.0);
+ evas_object_smart_callback_add(popup, "focused", _focus_cb, &focused);
+
+ // popup show should be called after adding all the contents and the buttons
+ // of popup to set the focus into popup's contents correctly.
+ evas_object_show(popup);
+ ck_assert(focused);
+}
+EFL_END_TEST
void elm_test_popup(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_popup_focus_get);
+ tcase_add_test(tc, elm_popup_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_prefs.c b/src/tests/elementary/elm_test_prefs.c
index 298cb59753..64186e56ec 100644
--- a/src/tests/elementary/elm_test_prefs.c
+++ b/src/tests/elementary/elm_test_prefs.c
@@ -2,31 +2,52 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_prefs_legacy_type_check)
+{
+ Evas_Object *win, *prefs;
+ const char *type;
+
+ win = win_add(NULL, "prefs", ELM_WIN_BASIC);
+
+ prefs = elm_prefs_add(win);
+
+ if (prefs)
+ {
+ type = elm_object_widget_type_get(prefs);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Prefs"));
+
+ type = evas_object_type_get(prefs);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_prefs"));
+ }
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
#if 0
Evas_Object *win, *prefs;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "prefs", ELM_WIN_BASIC);
+ win = win_add(NULL, "prefs", ELM_WIN_BASIC);
prefs = elm_prefs_add(win);
- role = efl_access_role_get(prefs);
+ role = efl_access_object_role_get(prefs);
ck_assert(role == EFL_ACCESS_ROLE_REDUNDANT_OBJECT);
- elm_shutdown();
#endif
}
-END_TEST
+EFL_END_TEST
void elm_test_prefs(TCase *tc)
{
+ tcase_add_test(tc, elm_prefs_legacy_type_check);
tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_progressbar.c b/src/tests/elementary/elm_test_progressbar.c
index c953ed8347..c0f6f0fb5b 100644
--- a/src/tests/elementary/elm_test_progressbar.c
+++ b/src/tests/elementary/elm_test_progressbar.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_progressbar_legacy_type_check)
+{
+ Evas_Object *win, *progressbar;
+ const char *type;
+
+ win = win_add(NULL, "progressbar", ELM_WIN_BASIC);
+
+ progressbar = elm_progressbar_add(win);
+
+ type = elm_object_widget_type_get(progressbar);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Progressbar"));
+
+ type = evas_object_type_get(progressbar);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_progressbar"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *progressbar;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "progressbar", ELM_WIN_BASIC);
+ win = win_add(NULL, "progressbar", ELM_WIN_BASIC);
progressbar = elm_progressbar_add(win);
- role = efl_access_role_get(progressbar);
+ role = efl_access_object_role_get(progressbar);
ck_assert(role == EFL_ACCESS_ROLE_PROGRESS_BAR);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_progressbar(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_progressbar_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_radio.c b/src/tests/elementary/elm_test_radio.c
index ee71b7be24..fedc14f2a5 100644
--- a/src/tests/elementary/elm_test_radio.c
+++ b/src/tests/elementary/elm_test_radio.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_radio_legacy_type_check)
+{
+ Evas_Object *win, *radio;
+ const char *type;
+
+ win = win_add(NULL, "radio", ELM_WIN_BASIC);
+
+ radio = elm_radio_add(win);
+
+ type = elm_object_widget_type_get(radio);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Radio"));
+
+ type = evas_object_type_get(radio);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_radio"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *radio;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "radio", ELM_WIN_BASIC);
+ win = win_add(NULL, "radio", ELM_WIN_BASIC);
radio = elm_radio_add(win);
- role = efl_access_role_get(radio);
+ role = efl_access_object_role_get(radio);
ck_assert(role == EFL_ACCESS_ROLE_RADIO_BUTTON);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_radio(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_radio_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_scroller.c b/src/tests/elementary/elm_test_scroller.c
index baae424ed1..cd2b52d0d1 100644
--- a/src/tests/elementary/elm_test_scroller.c
+++ b/src/tests/elementary/elm_test_scroller.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_scroller_legacy_type_check)
+{
+ Evas_Object *win, *scroller;
+ const char *type;
+
+ win = win_add(NULL, "scroller", ELM_WIN_BASIC);
+
+ scroller = elm_scroller_add(win);
+
+ type = elm_object_widget_type_get(scroller);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Scroller"));
+
+ type = evas_object_type_get(scroller);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_scroller"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *scroller;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "scroller", ELM_WIN_BASIC);
+ win = win_add(NULL, "scroller", ELM_WIN_BASIC);
scroller = elm_scroller_add(win);
- role = efl_access_role_get(scroller);
+ role = efl_access_object_role_get(scroller);
ck_assert(role == EFL_ACCESS_ROLE_SCROLL_PANE);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_scroller(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_scroller_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_segmentcontrol.c b/src/tests/elementary/elm_test_segmentcontrol.c
index dafce0ef68..7f29ce7977 100644
--- a/src/tests/elementary/elm_test_segmentcontrol.c
+++ b/src/tests/elementary/elm_test_segmentcontrol.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_segment_control_legacy_type_check)
+{
+ Evas_Object *win, *segment_control;
+ const char *type;
+
+ win = win_add(NULL, "segment_control", ELM_WIN_BASIC);
+
+ segment_control = elm_segment_control_add(win);
+
+ type = elm_object_widget_type_get(segment_control);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Segment_Control"));
+
+ type = evas_object_type_get(segment_control);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_segment_control"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *segmentcontrol;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "segmentcontrol", ELM_WIN_BASIC);
+ win = win_add(NULL, "segmentcontrol", ELM_WIN_BASIC);
segmentcontrol = elm_segment_control_add(win);
- role = efl_access_role_get(segmentcontrol);
+ role = efl_access_object_role_get(segmentcontrol);
ck_assert(role == EFL_ACCESS_ROLE_LIST);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_segmentcontrol(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_segment_control_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_separator.c b/src/tests/elementary/elm_test_separator.c
index f6e5ecae61..568e1c20d3 100644
--- a/src/tests/elementary/elm_test_separator.c
+++ b/src/tests/elementary/elm_test_separator.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_separator_legacy_type_check)
+{
+ Evas_Object *win, *separator;
+ const char *type;
+
+ win = win_add(NULL, "separator", ELM_WIN_BASIC);
+
+ separator = elm_separator_add(win);
+
+ type = elm_object_widget_type_get(separator);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Separator"));
+
+ type = evas_object_type_get(separator);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_separator"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *separator;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "icon", ELM_WIN_BASIC);
+ win = win_add(NULL, "icon", ELM_WIN_BASIC);
separator = elm_separator_add(win);
- role = efl_access_role_get(separator);
+ role = efl_access_object_role_get(separator);
ck_assert(role == EFL_ACCESS_ROLE_SEPARATOR);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_separator(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_separator_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_slider.c b/src/tests/elementary/elm_test_slider.c
index 0f08f4b117..f28682f321 100644
--- a/src/tests/elementary/elm_test_slider.c
+++ b/src/tests/elementary/elm_test_slider.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_slider_legacy_type_check)
+{
+ Evas_Object *win, *slider;
+ const char *type;
+
+ win = win_add(NULL, "slider", ELM_WIN_BASIC);
+
+ slider = elm_slider_add(win);
+
+ type = elm_object_widget_type_get(slider);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Slider"));
+
+ type = evas_object_type_get(slider);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_slider"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *slider;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "slider", ELM_WIN_BASIC);
+ win = win_add(NULL, "slider", ELM_WIN_BASIC);
slider = elm_slider_add(win);
- role = efl_access_role_get(slider);
+ role = efl_access_object_role_get(slider);
ck_assert(role == EFL_ACCESS_ROLE_SLIDER);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_slider(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_slider_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_slideshow.c b/src/tests/elementary/elm_test_slideshow.c
index c3b95d2bc5..25ec7dd196 100644
--- a/src/tests/elementary/elm_test_slideshow.c
+++ b/src/tests/elementary/elm_test_slideshow.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_slideshow_legacy_type_check)
+{
+ Evas_Object *win, *slideshow;
+ const char *type;
+
+ win = win_add(NULL, "slideshow", ELM_WIN_BASIC);
+
+ slideshow = elm_slideshow_add(win);
+
+ type = elm_object_widget_type_get(slideshow);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Slideshow"));
+
+ type = evas_object_type_get(slideshow);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_slideshow"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *slideshow;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "slideshow", ELM_WIN_BASIC);
+ win = win_add(NULL, "slideshow", ELM_WIN_BASIC);
slideshow = elm_slideshow_add(win);
- role = efl_access_role_get(slideshow);
+ role = efl_access_object_role_get(slideshow);
ck_assert(role == EFL_ACCESS_ROLE_DOCUMENT_PRESENTATION);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_slideshow(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_slideshow_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_spinner.c b/src/tests/elementary/elm_test_spinner.c
index 75d97b8d72..a6da140dda 100644
--- a/src/tests/elementary/elm_test_spinner.c
+++ b/src/tests/elementary/elm_test_spinner.c
@@ -2,30 +2,48 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_spinner_legacy_type_check)
+{
+ Evas_Object *win, *spinner;
+ const char *type;
+
+ win = win_add(NULL, "spinner", ELM_WIN_BASIC);
+
+ spinner = elm_spinner_add(win);
+
+ type = elm_object_widget_type_get(spinner);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Spinner"));
+
+ type = evas_object_type_get(spinner);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_spinner"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *spinner;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "spinner", ELM_WIN_BASIC);
+ win = win_add(NULL, "spinner", ELM_WIN_BASIC);
spinner = elm_spinner_add(win);
- role = efl_access_role_get(spinner);
+ role = efl_access_object_role_get(spinner);
ck_assert(role == EFL_ACCESS_ROLE_SPIN_BUTTON);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_spinner(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_spinner_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_table.c b/src/tests/elementary/elm_test_table.c
index 3cec20b2ad..4ba155193c 100644
--- a/src/tests/elementary/elm_test_table.c
+++ b/src/tests/elementary/elm_test_table.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_table_legacy_type_check)
+{
+ Evas_Object *win, *table;
+ const char *type;
+
+ win = win_add(NULL, "table", ELM_WIN_BASIC);
+
+ table = elm_table_add(win);
+
+ type = elm_object_widget_type_get(table);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Table"));
+
+ type = evas_object_type_get(table);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_table"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *table;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "table", ELM_WIN_BASIC);
+ win = win_add(NULL, "table", ELM_WIN_BASIC);
table = elm_table_add(win);
- role = efl_access_role_get(table);
+ role = efl_access_object_role_get(table);
ck_assert(role == EFL_ACCESS_ROLE_FILLER);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_table(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_table_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_thumb.c b/src/tests/elementary/elm_test_thumb.c
index a319caf5dd..9ca838db99 100644
--- a/src/tests/elementary/elm_test_thumb.c
+++ b/src/tests/elementary/elm_test_thumb.c
@@ -2,29 +2,48 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_thumb_legacy_type_check)
+{
+ Evas_Object *win, *thumb;
+ const char *type;
+
+ win = win_add(NULL, "thumb", ELM_WIN_BASIC);
+
+ thumb = elm_thumb_add(win);
+
+ type = elm_object_widget_type_get(thumb);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Thumb"));
+
+ /* It had abnormal object type... */
+ type = evas_object_type_get(thumb);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Thumb"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *thumb;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "thumb", ELM_WIN_BASIC);
+ win = win_add(NULL, "thumb", ELM_WIN_BASIC);
thumb = elm_thumb_add(win);
- role = efl_access_role_get(thumb);
+ role = efl_access_object_role_get(thumb);
ck_assert(role == EFL_ACCESS_ROLE_IMAGE);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_thumb(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_thumb_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_toolbar.c b/src/tests/elementary/elm_test_toolbar.c
index eec3233a97..b10350dfa5 100644
--- a/src/tests/elementary/elm_test_toolbar.c
+++ b/src/tests/elementary/elm_test_toolbar.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_toolbar_legacy_type_check)
+{
+ Evas_Object *win, *toolbar;
+ const char *type;
+
+ win = win_add(NULL, "toolbar", ELM_WIN_BASIC);
+
+ toolbar = elm_toolbar_add(win);
+
+ type = elm_object_widget_type_get(toolbar);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Toolbar"));
+
+ type = evas_object_type_get(toolbar);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_toolbar"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *toolbar;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "toolbar", ELM_WIN_BASIC);
+ win = win_add(NULL, "toolbar", ELM_WIN_BASIC);
toolbar = elm_toolbar_add(win);
- role = efl_access_role_get(toolbar);
+ role = efl_access_object_role_get(toolbar);
ck_assert(role == EFL_ACCESS_ROLE_TOOL_BAR);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_toolbar(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_toolbar_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_video.c b/src/tests/elementary/elm_test_video.c
index f5213734f3..676e128c89 100644
--- a/src/tests/elementary/elm_test_video.c
+++ b/src/tests/elementary/elm_test_video.c
@@ -2,29 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_video_legacy_type_check)
+{
+ Evas_Object *win, *video;
+ const char *type;
+
+ win = win_add(NULL, "video", ELM_WIN_BASIC);
+
+ video = elm_video_add(win);
+
+ type = elm_object_widget_type_get(video);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Video"));
+
+ type = evas_object_type_get(video);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_video"));
+
+}
+EFL_END_TEST
-START_TEST (elm_atspi_role_get)
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win, *video;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "video", ELM_WIN_BASIC);
+ win = win_add(NULL, "video", ELM_WIN_BASIC);
video = elm_video_add(win);
- role = efl_access_role_get(video);
+ role = efl_access_object_role_get(video);
ck_assert(role == EFL_ACCESS_ROLE_ANIMATION);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_video(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_video_legacy_type_check);
+ tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_web.c b/src/tests/elementary/elm_test_web.c
index 610d9fef05..5108cea1c1 100644
--- a/src/tests/elementary/elm_test_web.c
+++ b/src/tests/elementary/elm_test_web.c
@@ -2,31 +2,47 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#include <Elementary.h>
#include "elm_suite.h"
+EFL_START_TEST (elm_web_legacy_type_check)
+{
+ Evas_Object *win, *web;
+ const char *type;
+
+ win = win_add(NULL, "web", ELM_WIN_BASIC);
+
+ web = elm_web_add(win);
-START_TEST (elm_atspi_role_get)
+ type = elm_object_widget_type_get(web);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Web"));
+
+ type = evas_object_type_get(web);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_web"));
+
+}
+EFL_END_TEST
+
+EFL_START_TEST (elm_atspi_role_get)
{
-#if 0
Evas_Object *win, *web;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "web", ELM_WIN_BASIC);
+ win = win_add(NULL, "web", ELM_WIN_BASIC);
web = elm_web_add(win);
- role = efl_access_role_get(web);
+ role = efl_access_object_role_get(web);
ck_assert(role == EFL_ACCESS_ROLE_HTML_CONTAINER);
- elm_shutdown();
-#endif
}
-END_TEST
+EFL_END_TEST
void elm_test_web(TCase *tc)
{
+ tcase_add_test(tc, elm_web_legacy_type_check);
tcase_add_test(tc, elm_atspi_role_get);
}
diff --git a/src/tests/elementary/elm_test_win.c b/src/tests/elementary/elm_test_win.c
index 807a823baa..9e6dc156ba 100644
--- a/src/tests/elementary/elm_test_win.c
+++ b/src/tests/elementary/elm_test_win.c
@@ -2,10 +2,10 @@
# include "elementary_config.h"
#endif
-#define EFL_ACCESS_BETA
+#define EFL_ACCESS_OBJECT_BETA
#define EFL_ACCESS_COMPONENT_BETA
#define EFL_ACCESS_COMPONENT_PROTECTED
-#define EFL_CANVAS_BETA
+#define EFL_CANVAS_SCENE_BETA
#include <Elementary.h>
#ifdef HAVE_ELEMENTARY_X
@@ -36,22 +36,22 @@ _timer_delete_request_cb(void *data)
{
Eo *win = (Eo*) data;
_do_delete_request(win);
- return ECORE_CALLBACK_PASS_ON;
+ return EINA_FALSE;
}
static Eina_Bool
_timer_hide_window_cb(void *data)
{
Eo *win = (Eo*) data;
- efl_gfx_visible_set(win, EINA_FALSE);
- return ECORE_CALLBACK_PASS_ON;
+ efl_gfx_entity_visible_set(win, EINA_FALSE);
+ return EINA_FALSE;
}
static Eina_Bool
_timer_exit_cb(void *data EINA_UNUSED)
{
elm_exit();
- return ECORE_CALLBACK_PASS_ON;
+ return EINA_FALSE;
}
static Eina_Bool
@@ -60,36 +60,68 @@ _timer_fail_flag_cb(void *data)
Eina_Bool *fail_flag = (Eina_Bool*) data;
*fail_flag = EINA_TRUE;
elm_exit();
- return ECORE_CALLBACK_PASS_ON;
+ return EINA_FALSE;
}
+EFL_START_TEST (elm_win_legacy_type_check)
+{
+ Evas_Object *win, *win_socket, *win_inlined;
+ const char *type;
+
+ win = win_add(NULL, "win", ELM_WIN_BASIC);
+
+ type = elm_object_widget_type_get(win);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Win"));
+
+ type = evas_object_type_get(win);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_win"));
+
+ win_socket = win_add(NULL, "win", ELM_WIN_SOCKET_IMAGE);
+
+ type = elm_object_widget_type_get(win_socket);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Win"));
-START_TEST (elm_atspi_role_get)
+ type = evas_object_type_get(win_socket);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_win"));
+
+ win_inlined = win_add(win, "win", ELM_WIN_INLINED_IMAGE);
+
+ type = elm_object_widget_type_get(win_inlined);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Win"));
+
+ type = evas_object_type_get(win_inlined);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_win"));
+}
+EFL_END_TEST
+
+EFL_START_TEST (elm_atspi_role_get)
{
Evas_Object *win;
Efl_Access_Role role;
- elm_init(1, NULL);
- win = elm_win_add(NULL, "win", ELM_WIN_BASIC);
+ win = win_add(NULL, "win", ELM_WIN_BASIC);
- role = efl_access_role_get(win);
+ role = efl_access_object_role_get(win);
ck_assert(role == EFL_ACCESS_ROLE_WINDOW);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_atspi_component_position)
+EFL_START_TEST (elm_atspi_component_screen_position)
{
Eina_Bool ret;
int x, y;
- elm_init(0, NULL);
-
- Eo *win = elm_win_add(NULL, "win", ELM_WIN_BASIC);
+ Eo *win = win_add(NULL, "win", ELM_WIN_BASIC);
- ret = efl_access_component_position_set(win, EINA_TRUE, 45, 45);
+ ret = efl_access_component_screen_position_set(win, 45, 45);
ck_assert(ret == EINA_TRUE);
Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(win));
@@ -98,60 +130,36 @@ START_TEST (elm_atspi_component_position)
ck_assert((x == 45) && (y == 45));
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_atspi_component_size)
+EFL_START_TEST (elm_win_autohide)
{
- Eina_Bool ret;
- int w, h;
-
- elm_init(0, NULL);
-
- Eo *win = elm_win_add(NULL, "win", ELM_WIN_BASIC);
- evas_object_resize(win, 50, 50);
-
- ret = efl_access_component_size_set(win, 100, 100);
- ck_assert(ret == EINA_TRUE);
-
- evas_object_geometry_get(win, NULL, NULL, &w, &h);
- ck_assert((w == 100) && (h == 100));
-
- elm_shutdown();
-}
-END_TEST
-
-START_TEST (elm_win_autohide)
-{
- elm_init(0, NULL);
-
- Eo *win = elm_win_add(NULL, "win", ELM_WIN_BASIC);
- elm_win_autohide_set(win, EINA_TRUE);
- efl_gfx_visible_set(win, EINA_TRUE);
+ Eo *win = win_add(NULL, "win", ELM_WIN_BASIC);
+ if (elm_win_xwindow_get(win))
+ {
+ elm_win_autohide_set(win, EINA_TRUE);
+ efl_gfx_entity_visible_set(win, EINA_TRUE);
- Eina_Bool fail_flag = EINA_FALSE;
- ecore_timer_add(_timeout1, _timer_delete_request_cb, win);
- ecore_timer_add(_timeout2, _timer_exit_cb, &fail_flag);
+ Eina_Bool fail_flag = EINA_FALSE;
+ ecore_timer_add(_timeout1, _timer_delete_request_cb, win);
+ ecore_timer_add(_timeout2, _timer_exit_cb, &fail_flag);
- elm_run();
+ elm_run();
- Eina_Bool visible;
- visible = efl_gfx_visible_get(win);
- ck_assert(visible == EINA_FALSE);
-
- elm_shutdown();
+ Eina_Bool visible;
+ visible = efl_gfx_entity_visible_get(win);
+ ck_assert(visible == EINA_FALSE);
+ }
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_win_policy_quit_last_window_hidden)
+EFL_START_TEST (elm_win_policy_quit_last_window_hidden)
{
- elm_init(0, NULL);
-
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
- Eo *win = elm_win_add(NULL, "win", ELM_WIN_BASIC);
- efl_gfx_visible_set(win, EINA_TRUE);
+ Eo *win = win_add(NULL, "win", ELM_WIN_BASIC);
+ efl_gfx_entity_visible_set(win, EINA_TRUE);
Eina_Bool fail_flag = EINA_FALSE;
ecore_timer_add(_timeout1, _timer_hide_window_cb, win);
@@ -160,42 +168,40 @@ START_TEST (elm_win_policy_quit_last_window_hidden)
elm_run();
Eina_Bool visible;
- visible = efl_gfx_visible_get(win);
+ visible = efl_gfx_entity_visible_get(win);
ck_assert(fail_flag == EINA_FALSE);
ck_assert(efl_ref_count(win) >= 1);
ck_assert(visible == EINA_FALSE);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST (elm_win_autohide_and_policy_quit_last_window_hidden)
+EFL_START_TEST (elm_win_autohide_and_policy_quit_last_window_hidden)
{
- elm_init(0, NULL);
-
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
- Eo *win = elm_win_add(NULL, "win", ELM_WIN_BASIC);
- elm_win_autohide_set(win, EINA_TRUE);
- efl_gfx_visible_set(win, EINA_TRUE);
-
- Eina_Bool fail_flag = EINA_FALSE;
- ecore_timer_add(_timeout1, _timer_delete_request_cb, win);
- ecore_timer_add(_timeout_fail, _timer_fail_flag_cb, &fail_flag);
+ Eo *win = win_add(NULL, "win", ELM_WIN_BASIC);
+ if (elm_win_xwindow_get(win))
+ {
+ elm_win_autohide_set(win, EINA_TRUE);
+ efl_gfx_entity_visible_set(win, EINA_TRUE);
- elm_run();
+ Eina_Bool fail_flag = EINA_FALSE;
+ ecore_timer_add(_timeout1, _timer_delete_request_cb, win);
+ ecore_timer_add(_timeout_fail, _timer_fail_flag_cb, &fail_flag);
- Eina_Bool visible;
- visible = efl_gfx_visible_get(win);
+ elm_run();
- ck_assert(fail_flag == EINA_FALSE);
- ck_assert(efl_ref_count(win) >= 1);
- ck_assert(visible == EINA_FALSE);
+ Eina_Bool visible;
+ visible = efl_gfx_entity_visible_get(win);
- elm_shutdown();
+ ck_assert(fail_flag == EINA_FALSE);
+ ck_assert(efl_ref_count(win) >= 1);
+ ck_assert(visible == EINA_FALSE);
+ }
}
-END_TEST
+EFL_END_TEST
/* a very lax definition of == for doubles */
#define VALEQ(a, b) ((fabs((a) - (b))) <= 0.001)
@@ -259,7 +265,7 @@ _inputs_timer2_cb(void *data)
size_t cnt = 0;
int i = 0;
- it = efl_canvas_pointer_iterate(win, 0);
+ it = efl_canvas_scene_pointer_iterate(win, 0);
EINA_ITERATOR_FOREACH(it, ptr)
{
double x, y;
@@ -322,7 +328,7 @@ _inputs_timer3_cb(void *data)
size_t cnt = 0;
int i = 0;
- it = efl_canvas_pointer_iterate(win, 0);
+ it = efl_canvas_scene_pointer_iterate(win, 0);
EINA_ITERATOR_FOREACH(it, ptr)
{
int tool, ok = 0;
@@ -353,7 +359,7 @@ _inputs_timer3_cb(void *data)
fail_if(cnt != 2); // 2 moves (in the list), 2 ups (gone)
fail_if(!efl_canvas_pointer_inside_get(win, NULL));
- pos = efl_canvas_pointer_position_get(win);
+ pos = efl_canvas_scene_pointer_position_get(win);
ck_assert_int_eq(pos.x, points[1][0].x);
ck_assert_int_eq(pos.y, points[1][0].y);
@@ -362,7 +368,7 @@ _inputs_timer3_cb(void *data)
return ECORE_CALLBACK_DONE;
}
-START_TEST (efl_ui_win_multi_touch_inputs)
+EFL_START_TEST (efl_ui_win_multi_touch_inputs)
{
Eina_Bool fail_flag = EINA_FALSE;
Eo *win;
@@ -374,14 +380,12 @@ START_TEST (efl_ui_win_multi_touch_inputs)
* pointer x: down, move, move, ...
*/
- elm_init(0, NULL);
-
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
- win = elm_win_add(NULL, "win", ELM_WIN_BASIC);
+ win = win_add(NULL, "win", ELM_WIN_BASIC);
elm_win_autohide_set(win, EINA_TRUE);
- efl_gfx_visible_set(win, EINA_TRUE);
- efl_gfx_size_set(win, EINA_SIZE2D(100, 100));
+ efl_gfx_entity_visible_set(win, EINA_TRUE);
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(100, 100));
ecore_timer_add(_timeout1, _inputs_timer1_cb, win);
ecore_timer_add(_timeout2, _inputs_timer2_cb, win);
@@ -392,15 +396,14 @@ START_TEST (efl_ui_win_multi_touch_inputs)
fail_if(fail_flag != EINA_FALSE);
- elm_shutdown();
}
-END_TEST
+EFL_END_TEST
void elm_test_win(TCase *tc)
{
+ tcase_add_test(tc, elm_win_legacy_type_check);
tcase_add_test(tc, elm_atspi_role_get);
- tcase_add_test(tc, elm_atspi_component_position);
- tcase_add_test(tc, elm_atspi_component_size);
+ tcase_add_test(tc, elm_atspi_component_screen_position);
tcase_add_test(tc, elm_win_policy_quit_last_window_hidden);
tcase_add_test(tc, efl_ui_win_multi_touch_inputs);
#ifdef HAVE_ELEMENTARY_X
diff --git a/src/tests/elementary/focus_test.eo b/src/tests/elementary/focus_test.eo
index 2e8534ab78..8be44ed295 100644
--- a/src/tests/elementary/focus_test.eo
+++ b/src/tests/elementary/focus_test.eo
@@ -1,6 +1,6 @@
-class Focus.Test(Efl.Object, Efl.Ui.Focus.Object, Efl.Ui.Focus.User, Efl.Gfx) {
+class Focus.Test(Efl.Object, Efl.Ui.Focus.Object, Efl.Gfx.Entity) {
methods {
- size {
+ test_size {
params {
rect : Eina.Rect;
}
@@ -18,8 +18,8 @@ class Focus.Test(Efl.Object, Efl.Ui.Focus.Object, Efl.Ui.Focus.User, Efl.Gfx) {
Efl.Object.constructor;
Efl.Ui.Focus.Object.focus_geometry { get; }
Efl.Ui.Focus.Object.focus { set; }
- Efl.Ui.Focus.User.focus_manager { get; }
- Efl.Ui.Focus.User.focus_parent {get; }
- Efl.Gfx.geometry { get; }
+ Efl.Ui.Focus.Object.focus_manager { get; }
+ Efl.Ui.Focus.Object.focus_parent {get; }
+ Efl.Gfx.Entity.geometry { get; }
}
}
diff --git a/src/tests/elementary/focus_test_sub_main.eo b/src/tests/elementary/focus_test_sub_main.eo
index af3f330b12..ebf835831f 100644
--- a/src/tests/elementary/focus_test_sub_main.eo
+++ b/src/tests/elementary/focus_test_sub_main.eo
@@ -1,7 +1,7 @@
-class Focus.Test.Sub.Main(Efl.Object, Efl.Ui.Focus.User, Efl.Ui.Focus.Object, Efl.Ui.Focus.Manager.Sub) {
+class Focus.Test.Sub.Main(Efl.Object, Efl.Ui.Focus.Object, Efl.Ui.Focus.Manager_Sub) {
implements {
- Efl.Ui.Focus.User.focus_manager { get; }
- Efl.Ui.Focus.User.focus_parent { get; }
+ Efl.Ui.Focus.Object.focus_manager { get; }
+ Efl.Ui.Focus.Object.focus_parent { get; }
Efl.Ui.Focus.Object.focus_geometry { get; }
}
}
diff --git a/src/tests/elocation/elocation_suite.c b/src/tests/elocation/elocation_suite.c
index c9ff759e82..afae6e03b1 100644
--- a/src/tests/elocation/elocation_suite.c
+++ b/src/tests/elocation/elocation_suite.c
@@ -12,7 +12,7 @@
/* Test the init and shutdown pathes only. Good to do that as we don't set up
* other things and already triggered problems with this.
*/
-START_TEST(elocation_test_init)
+EFL_START_TEST(elocation_test_init)
{
Eina_Bool ret;
@@ -21,10 +21,10 @@ START_TEST(elocation_test_init)
elocation_shutdown();
}
-END_TEST
+EFL_END_TEST
/* Basic address object testing. Creating and freeing the object */
-START_TEST(elocation_test_address_object)
+EFL_START_TEST(elocation_test_address_object)
{
Eina_Bool ret;
Elocation_Address *address = NULL;
@@ -39,10 +39,10 @@ START_TEST(elocation_test_address_object)
elocation_shutdown();
}
-END_TEST
+EFL_END_TEST
/* Basic position object testing. Creating and freeing the object */
-START_TEST(elocation_test_position_object)
+EFL_START_TEST(elocation_test_position_object)
{
Eina_Bool ret;
Elocation_Position *position = NULL;
@@ -57,7 +57,7 @@ START_TEST(elocation_test_position_object)
elocation_shutdown();
}
-END_TEST
+EFL_END_TEST
/* Basic testing for the various functions of the GeoCode API */
static int cb_count = 0;
@@ -74,7 +74,7 @@ event_cb(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *event)
return ECORE_CALLBACK_DONE;
}
-START_TEST(elocation_test_api_geocode)
+EFL_START_TEST(elocation_test_api_geocode)
{
Eina_Bool ret;
Elocation_Position *position = NULL;
@@ -117,10 +117,10 @@ START_TEST(elocation_test_api_geocode)
elocation_shutdown();
}
-END_TEST
+EFL_END_TEST
/* Basic testing for position API */
-START_TEST(elocation_test_api_position)
+EFL_START_TEST(elocation_test_api_position)
{
Eina_Bool ret;
Elocation_Position *position = NULL;
@@ -138,10 +138,10 @@ START_TEST(elocation_test_api_position)
elocation_shutdown();
}
-END_TEST
+EFL_END_TEST
/* Basic testing for address API */
-START_TEST(elocation_test_api_address)
+EFL_START_TEST(elocation_test_api_address)
{
Eina_Bool ret;
Elocation_Address *address = NULL;
@@ -159,10 +159,10 @@ START_TEST(elocation_test_api_address)
elocation_shutdown();
}
-END_TEST
+EFL_END_TEST
/* Basic testing for status API */
-START_TEST(elocation_test_api_status)
+EFL_START_TEST(elocation_test_api_status)
{
Eina_Bool ret;
int status = 0;
@@ -175,7 +175,7 @@ START_TEST(elocation_test_api_status)
elocation_shutdown();
}
-END_TEST
+EFL_END_TEST
Suite *
elocation_suite(void)
diff --git a/src/tests/elput/elput_suite.c b/src/tests/elput/elput_suite.c
index 35132162aa..8df9302f06 100644
--- a/src/tests/elput/elput_suite.c
+++ b/src/tests/elput/elput_suite.c
@@ -4,6 +4,7 @@
#include "elput_suite.h"
#include "../efl_check.h"
+#include <Elput.h>
static const Efl_Test_Case etc[] =
{
@@ -13,6 +14,16 @@ static const Efl_Test_Case etc[] =
{ NULL, NULL }
};
+SUITE_INIT(elput)
+{
+ ck_assert_int_eq(elput_init(), 1);
+}
+
+SUITE_SHUTDOWN(elput)
+{
+ ck_assert_int_eq(elput_shutdown(), 0);
+}
+
int
main(int argc, char **argv)
{
@@ -25,7 +36,7 @@ main(int argc, char **argv)
#endif
count =
- _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, "Elput", etc);
+ _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, "Elput", etc, SUITE_INIT_FN(elput), SUITE_SHUTDOWN_FN(elput));
return (count == 0) ? 0 : 255;
}
diff --git a/src/tests/elput/elput_suite.h b/src/tests/elput/elput_suite.h
index 34a7ffd2e0..5241144647 100644
--- a/src/tests/elput/elput_suite.h
+++ b/src/tests/elput/elput_suite.h
@@ -2,7 +2,7 @@
# define _ELPUT_SUITE_H
# include <check.h>
-
+#include "../efl_check.h"
void elput_test_elput(TCase *tc);
#endif
diff --git a/src/tests/elput/elput_test_elput.c b/src/tests/elput/elput_test_elput.c
index 8207ee8d25..2d3202d810 100644
--- a/src/tests/elput/elput_test_elput.c
+++ b/src/tests/elput/elput_test_elput.c
@@ -11,17 +11,10 @@
#include "elput_suite.h"
-START_TEST(elput_test_elput_init)
+EFL_START_TEST(elput_test_elput_init)
{
- int ret;
-
- ret = elput_init();
- fail_if(ret < 1);
-
- ret = elput_shutdown();
- fail_if(ret != 0);
}
-END_TEST
+EFL_END_TEST
void elput_test_elput(TCase *tc)
{
diff --git a/src/tests/elua/elua_lib.c b/src/tests/elua/elua_lib.c
index c6a5b6341f..4f53e7d869 100644
--- a/src/tests/elua/elua_lib.c
+++ b/src/tests/elua/elua_lib.c
@@ -10,7 +10,7 @@
#include "elua_suite.h"
-START_TEST(elua_api)
+EFL_START_TEST(elua_api)
{
Elua_State *st;
lua_State *lst;
@@ -25,8 +25,6 @@ START_TEST(elua_api)
cargv[1] = arg2;
char *spath = NULL;
- fail_if(!elua_init());
-
st = elua_state_new("test");
fail_if(!st);
@@ -127,10 +125,8 @@ START_TEST(elua_api)
fail_if(remove(buf));
elua_state_free(st);
-
- elua_shutdown();
}
-END_TEST
+EFL_END_TEST
void elua_lib_test(TCase *tc)
{
diff --git a/src/tests/elua/elua_suite.c b/src/tests/elua/elua_suite.c
index 1ad5ac164b..0ed47f87b5 100644
--- a/src/tests/elua/elua_suite.c
+++ b/src/tests/elua/elua_suite.c
@@ -4,12 +4,23 @@
#include "elua_suite.h"
#include "../efl_check.h"
+#include <Elua.h>
static const Efl_Test_Case etc[] = {
{ "Elua Library", elua_lib_test},
{ NULL, NULL }
};
+SUITE_INIT(elua)
+{
+ ck_assert_int_eq(elua_init(), 1);
+}
+
+SUITE_SHUTDOWN(elua)
+{
+ ck_assert_int_eq(elua_shutdown(), 0);
+}
+
int
main(int argc, char **argv)
{
@@ -25,7 +36,7 @@ main(int argc, char **argv)
#endif
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
- "Elua", etc);
+ "Elua", etc, SUITE_INIT_FN(elua), SUITE_SHUTDOWN_FN(elua));
return (failed_count == 0) ? 0 : 255;
}
diff --git a/src/tests/elua/elua_suite.h b/src/tests/elua/elua_suite.h
index 7485f5346b..b7870729df 100644
--- a/src/tests/elua/elua_suite.h
+++ b/src/tests/elua/elua_suite.h
@@ -2,7 +2,7 @@
#define _ELUA_SUITE_H
#include <check.h>
-
+#include "../efl_check.h"
void elua_lib_test(TCase *tc);
#endif /* _ELUA_SUITE_H */
diff --git a/src/tests/emile/emile_suite.c b/src/tests/emile/emile_suite.c
index 7fc70631e5..edfbf26a4a 100644
--- a/src/tests/emile/emile_suite.c
+++ b/src/tests/emile/emile_suite.c
@@ -4,6 +4,7 @@
#include "emile_suite.h"
#include "../efl_check.h"
+#include <Emile.h>
static const Efl_Test_Case etc[] = {
{ "Emile_Base", emile_test_base },
@@ -11,6 +12,16 @@ static const Efl_Test_Case etc[] = {
{ NULL, NULL }
};
+SUITE_INIT(emile)
+{
+ ck_assert_int_eq(emile_init(), 1);
+}
+
+SUITE_SHUTDOWN(emile)
+{
+ ck_assert_int_eq(emile_shutdown(), 0);
+}
+
int
main(int argc, char *argv[])
{
@@ -24,7 +35,7 @@ main(int argc, char *argv[])
#endif
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
- "Emile", etc);
+ "Emile", etc, SUITE_INIT_FN(emile), SUITE_SHUTDOWN_FN(emile));
return (failed_count == 0) ? 0 : 255;
}
diff --git a/src/tests/emile/emile_suite.h b/src/tests/emile/emile_suite.h
index 9e940d107a..6f1268ec35 100644
--- a/src/tests/emile/emile_suite.h
+++ b/src/tests/emile/emile_suite.h
@@ -2,7 +2,7 @@
#define _EMILE_SUITE_H
#include <check.h>
-
+#include "../efl_check.h"
void emile_test_base(TCase *tc);
void emile_test_base64(TCase *tc);
diff --git a/src/tests/emile/emile_test_base.c b/src/tests/emile/emile_test_base.c
index d4514d1ea8..0108edbe54 100644
--- a/src/tests/emile/emile_test_base.c
+++ b/src/tests/emile/emile_test_base.c
@@ -7,12 +7,10 @@
#include "emile_suite.h"
-START_TEST(emile_test_init)
+EFL_START_TEST(emile_test_init)
{
- fail_if(emile_init() <= 0);
- fail_if(emile_shutdown() != 0);
}
-END_TEST
+EFL_END_TEST
void emile_test_base(TCase *tc)
{
diff --git a/src/tests/emile/emile_test_base64.c b/src/tests/emile/emile_test_base64.c
index ca035766c8..6ddbd82849 100644
--- a/src/tests/emile/emile_test_base64.c
+++ b/src/tests/emile/emile_test_base64.c
@@ -30,7 +30,7 @@ static const struct {
{ "abc123!?$*&()'-=@~", "YWJjMTIzIT8kKiYoKSctPUB+", "YWJjMTIzIT8kKiYoKSctPUB-", 18 }
};
-START_TEST(emile_test_base64_normal)
+EFL_START_TEST(emile_test_base64_normal)
{
Eina_Binbuf *buffer, *decoded;
Eina_Strbuf *str, *encoded;
@@ -75,9 +75,9 @@ START_TEST(emile_test_base64_normal)
eina_strbuf_reset(str);
fail_if(decoded);
}
-END_TEST
+EFL_END_TEST
-START_TEST(emile_test_base64_url)
+EFL_START_TEST(emile_test_base64_url)
{
Eina_Binbuf *buffer, *decoded;
Eina_Strbuf *str, *encoded;
@@ -114,7 +114,7 @@ START_TEST(emile_test_base64_url)
decoded = emile_base64url_decode(str);
fail_if(memcmp(eina_binbuf_string_get(decoded), "Man", 3));
}
-END_TEST
+EFL_END_TEST
void
emile_test_base64(TCase *tc)
diff --git a/src/tests/emotion/emotion_test_main-eo.c b/src/tests/emotion/emotion_test_main-eo.c
index b5848517cc..2d5df2f9ab 100644
--- a/src/tests/emotion/emotion_test_main-eo.c
+++ b/src/tests/emotion/emotion_test_main-eo.c
@@ -76,7 +76,7 @@ static const char *theme_file = NULL;
static void
bg_resize(Evas_Coord w, Evas_Coord h)
{
- efl_gfx_size_set(o_bg, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(o_bg, EINA_SIZE2D(w, h));
}
static void
@@ -113,10 +113,10 @@ bg_setup(void)
{
o_bg = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas);
efl_file_set(o_bg, theme_file, "background");
- efl_gfx_position_set(o_bg, EINA_POSITION2D(0, 0));
- efl_gfx_size_set(o_bg, EINA_SIZE2D(startw, starth));
+ efl_gfx_entity_position_set(o_bg, EINA_POSITION2D(0, 0));
+ efl_gfx_entity_size_set(o_bg, EINA_SIZE2D(startw, starth));
efl_gfx_stack_layer_set(o_bg, -999);
- efl_gfx_visible_set(o_bg, EINA_TRUE);
+ efl_gfx_entity_visible_set(o_bg, EINA_TRUE);
evas_object_focus_set(o_bg, EINA_TRUE);
efl_event_callback_add(o_bg, EFL_EVENT_KEY_DOWN, bg_key_down, NULL);
}
@@ -354,7 +354,7 @@ video_obj_frame_resize_cb(void *data, const Efl_Event *event)
evas_object_size_hint_min_set(event->object, iw, ih);
edje_object_part_swallow(oe, "video_swallow", event->object);
edje_object_size_min_calc(oe, &w, &h);
- efl_gfx_size_set(oe, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(oe, EINA_SIZE2D(w, h));
evas_object_size_hint_min_set(event->object, 0, 0);
edje_object_part_swallow(oe, "video_swallow", event->object);
}
@@ -557,10 +557,10 @@ video_obj_signal_frame_move_cb(void *data EINA_UNUSED, Evas_Object *o, const cha
Eina_Position2D pos;
evas_pointer_canvas_xy_get(evas_object_evas_get(o), &x, &y);
- pos = efl_gfx_position_get(o);
+ pos = efl_gfx_entity_position_get(o);
pos.x += (x - fd->x);
pos.y += (y - fd->y);
- efl_gfx_position_set(o, pos);
+ efl_gfx_entity_position_set(o, pos);
fd->x = x;
fd->y = y;
}
@@ -570,7 +570,7 @@ video_obj_signal_frame_move_cb(void *data EINA_UNUSED, Evas_Object *o, const cha
Eina_Size2D sz;
evas_pointer_canvas_xy_get(evas_object_evas_get(o), &x, &y);
- sz = efl_gfx_size_get(o);
+ sz = efl_gfx_entity_size_get(o);
evas_object_resize(o, sz.w + (x - fd->x), sz.h + (y - fd->y));
fd->x = x;
fd->y = y;
@@ -628,9 +628,9 @@ init_video_object(const char *module_filename, const char *filename)
edje_object_part_swallow(oe, "video_swallow", o);
offset = 20 * (eina_list_count(video_objs) - 1);
- efl_gfx_position_set(oe, EINA_POSITION2D(offset, offset));
+ efl_gfx_entity_position_set(oe, EINA_POSITION2D(offset, offset));
edje_object_size_min_calc(oe, &w, &h);
- efl_gfx_size_set(oe, EINA_SIZE2D(w, h));
+ efl_gfx_entity_size_set(oe, EINA_SIZE2D(w, h));
efl_event_callback_array_add(o, emotion_object_test_callbacks(), oe);
@@ -650,7 +650,7 @@ init_video_object(const char *module_filename, const char *filename)
efl_ui_drag_value_set(efl_part(oe, "video_volume"), 0.0, 0.5);
efl_text_set(efl_part(oe, "video_volume_txt"), "vol 0.50");
efl_layout_signal_emit(oe, "video_state", "play");
- efl_gfx_visible_set(oe, EINA_TRUE);
+ efl_gfx_entity_visible_set(oe, EINA_TRUE);
}
int
diff --git a/src/tests/emotion/emotion_test_main.c b/src/tests/emotion/emotion_test_main.c
index 24ab7dbffe..0ef2a52911 100644
--- a/src/tests/emotion/emotion_test_main.c
+++ b/src/tests/emotion/emotion_test_main.c
@@ -693,7 +693,6 @@ main(int argc, char **argv)
// init edje
if (!edje_init())
goto shutdown_ecore_evas;
- edje_frametime_set(1.0 / 30.0);
// search the theme file
struct stat st;
diff --git a/src/tests/eo/access/access_main.c b/src/tests/eo/access/access_main.c
index 1188a60694..4bc3db5bb2 100644
--- a/src/tests/eo/access/access_main.c
+++ b/src/tests/eo/access/access_main.c
@@ -13,7 +13,7 @@ main(int argc, char *argv[])
(void) argv;
efl_object_init();
- Eo *obj = efl_add(INHERIT_CLASS, NULL);
+ Eo *obj = efl_add_ref(INHERIT_CLASS, NULL);
simple_a_set(obj, 1);
inherit_prot_print(obj);
diff --git a/src/tests/eo/children/children_main.c b/src/tests/eo/children/children_main.c
index e9292f2c90..1af58f5c7f 100644
--- a/src/tests/eo/children/children_main.c
+++ b/src/tests/eo/children/children_main.c
@@ -22,7 +22,7 @@ main(int argc, char *argv[])
efl_object_init();
- Eo *parent = efl_add(SIMPLE_CLASS, NULL);
+ Eo *parent = efl_add_ref(SIMPLE_CLASS, NULL);
Eo *child1 = efl_add(SIMPLE_CLASS, parent);
Eo *child2 = efl_add(SIMPLE_CLASS, parent);
diff --git a/src/tests/eo/composite_objects/composite_objects_main.c b/src/tests/eo/composite_objects/composite_objects_main.c
index 438492e51c..4536af1a7a 100644
--- a/src/tests/eo/composite_objects/composite_objects_main.c
+++ b/src/tests/eo/composite_objects/composite_objects_main.c
@@ -26,7 +26,7 @@ main(int argc, char *argv[])
(void) argv;
efl_object_init();
- Eo *obj = efl_add(COMP_CLASS, NULL);
+ Eo *obj = efl_add_ref(COMP_CLASS, NULL);
efl_event_callback_add(obj, EV_A_CHANGED, _a_changed_cb, NULL);
fail_if(!efl_isa(obj, COMP_CLASS));
diff --git a/src/tests/eo/constructors/constructors_main.c b/src/tests/eo/constructors/constructors_main.c
index e3b0b93ad4..e13e4fdf33 100644
--- a/src/tests/eo/constructors/constructors_main.c
+++ b/src/tests/eo/constructors/constructors_main.c
@@ -24,7 +24,7 @@ main(int argc, char *argv[])
(void) argv;
efl_object_init();
- Eo *obj = efl_add(SIMPLE_CLASS, NULL);
+ Eo *obj = efl_add_ref(SIMPLE_CLASS, NULL);
fail_if(my_init_count != 2);
@@ -42,14 +42,14 @@ main(int argc, char *argv[])
fail_if(my_init_count != 0);
- obj = efl_add(SIMPLE2_CLASS, NULL);
+ obj = efl_add_ref(SIMPLE2_CLASS, NULL);
fail_if(obj);
- obj = efl_add(SIMPLE3_CLASS, NULL);
+ obj = efl_add_ref(SIMPLE3_CLASS, NULL);
fail_if(obj);
my_init_count = 0;
- obj = efl_add(SIMPLE4_CLASS, NULL);
+ obj = efl_add_ref(SIMPLE4_CLASS, NULL);
fail_if(my_init_count != 2);
@@ -57,33 +57,33 @@ main(int argc, char *argv[])
fail_if(my_init_count != 0);
- obj = efl_add(SIMPLE5_CLASS, NULL);
+ obj = efl_add_ref(SIMPLE5_CLASS, NULL);
fail_if(!obj);
efl_unref(obj);
- obj = efl_add(SIMPLE6_CLASS, NULL);
+ obj = efl_add_ref(SIMPLE6_CLASS, NULL);
fail_if(!obj);
efl_unref(obj);
- obj = efl_add(SIMPLE7_CLASS, NULL);
+ obj = efl_add_ref(SIMPLE7_CLASS, NULL);
fail_if(obj);
my_init_count = 0;
- obj = efl_add(SIMPLE_CLASS, NULL);
+ obj = efl_add_ref(SIMPLE_CLASS, NULL);
fail_if(!obj);
fail_if(my_init_count != 2);
a = simple_a_get(obj);
fail_if(a != 0);
my_init_count = 0;
- obj = efl_add(SIMPLE_CLASS, NULL, simple_a_set(efl_added, 7));
+ obj = efl_add_ref(SIMPLE_CLASS, NULL, simple_a_set(efl_added, 7));
fail_if(!obj);
fail_if(my_init_count != 2);
a = simple_a_get(obj);
fail_if(a != 7);
my_init_count = 0;
- obj = efl_add(SIMPLE_CLASS, NULL, simple_b_set(efl_added, 6), simple_a_set(efl_added, -1), b = simple_b_get(efl_added));
+ obj = efl_add_ref(SIMPLE_CLASS, NULL, simple_b_set(efl_added, 6), simple_a_set(efl_added, -1), b = simple_b_get(efl_added));
fail_if(obj);
fail_if(b != 6);
fail_if(my_init_count != 0);
diff --git a/src/tests/eo/function_overrides/function_overrides_main.c b/src/tests/eo/function_overrides/function_overrides_main.c
index 091af5ebe1..5828b1aa45 100644
--- a/src/tests/eo/function_overrides/function_overrides_main.c
+++ b/src/tests/eo/function_overrides/function_overrides_main.c
@@ -18,7 +18,7 @@ main(int argc, char *argv[])
efl_object_init();
Eina_Bool called = EINA_FALSE;
- Eo *obj = efl_add(INHERIT2_CLASS, NULL);
+ Eo *obj = efl_add_ref(INHERIT2_CLASS, NULL);
simple_a_set(obj, 1);
Simple_Public_Data *pd = efl_data_scope_get(obj, SIMPLE_CLASS);
@@ -26,7 +26,7 @@ main(int argc, char *argv[])
efl_unref(obj);
- obj = efl_add(INHERIT3_CLASS, NULL);
+ obj = efl_add_ref(INHERIT3_CLASS, NULL);
simple_a_set(obj, 1);
pd = efl_data_scope_get(obj, SIMPLE_CLASS);
@@ -34,7 +34,7 @@ main(int argc, char *argv[])
efl_unref(obj);
- obj = efl_add(INHERIT2_CLASS, NULL);
+ obj = efl_add_ref(INHERIT2_CLASS, NULL);
called = inherit2_print(obj);
fail_if(!called);
called = inherit2_print(obj);
@@ -42,7 +42,7 @@ main(int argc, char *argv[])
fail_if(!called);
efl_unref(obj);
- obj = efl_add(SIMPLE_CLASS, NULL);
+ obj = efl_add_ref(SIMPLE_CLASS, NULL);
called = inherit2_print(obj);
fail_if(called);
diff --git a/src/tests/eo/interface/interface_main.c b/src/tests/eo/interface/interface_main.c
index 8f07bb29e6..53142cfd7f 100644
--- a/src/tests/eo/interface/interface_main.c
+++ b/src/tests/eo/interface/interface_main.c
@@ -16,7 +16,7 @@ main(int argc, char *argv[])
(void) argv;
efl_object_init();
- Eo *obj = efl_add(SIMPLE_CLASS, NULL);
+ Eo *obj = efl_add_ref(SIMPLE_CLASS, NULL);
simple_a_set(obj, 1);
simple_b_set(obj, 2);
diff --git a/src/tests/eo/mixin/mixin_main.c b/src/tests/eo/mixin/mixin_main.c
index f3534cc7ed..2ef7b360a4 100644
--- a/src/tests/eo/mixin/mixin_main.c
+++ b/src/tests/eo/mixin/mixin_main.c
@@ -18,7 +18,7 @@ main(int argc, char *argv[])
(void) argv;
efl_object_init();
- Eo *obj = efl_add(SIMPLE_CLASS, NULL);
+ Eo *obj = efl_add_ref(SIMPLE_CLASS, NULL);
simple_a_set(obj, 1);
simple_b_set(obj, 2);
@@ -40,7 +40,7 @@ main(int argc, char *argv[])
efl_unref(obj);
- obj = efl_add(INHERIT_CLASS, NULL);
+ obj = efl_add_ref(INHERIT_CLASS, NULL);
simple_a_set(obj, 5);
a = simple_a_get(obj);
printf("%d\n", a);
diff --git a/src/tests/eo/signals/signals_main.c b/src/tests/eo/signals/signals_main.c
index 51fca1f39e..3639ff132d 100644
--- a/src/tests/eo/signals/signals_main.c
+++ b/src/tests/eo/signals/signals_main.c
@@ -65,7 +65,7 @@ main(int argc, char *argv[])
(void) argv;
efl_object_init();
- Eo *obj = efl_add(SIMPLE_CLASS, NULL);
+ Eo *obj = efl_add_ref(SIMPLE_CLASS, NULL);
Simple_Public_Data *pd = efl_data_scope_get(obj, SIMPLE_CLASS);
/* The order of these two is undetermined. */
diff --git a/src/tests/eo/signals/signals_simple.c b/src/tests/eo/signals/signals_simple.c
index 9449c3f8c0..0e016dc550 100644
--- a/src/tests/eo/signals/signals_simple.c
+++ b/src/tests/eo/signals/signals_simple.c
@@ -32,7 +32,7 @@ void
_cb_added(void *data EINA_UNUSED, const Efl_Event *event)
{
Simple_Public_Data *pd = efl_data_scope_get(event->object, MY_CLASS);
- const Efl_Callback_Array_Item *callback_array = event->info;
+ const Efl_Callback_Array_Item_Full *callback_array = event->info;
if (callback_array->desc != EV_A_CHANGED)
return;
@@ -46,7 +46,7 @@ void
_cb_deled(void *data EINA_UNUSED, const Efl_Event *event)
{
Simple_Public_Data *pd = efl_data_scope_get(event->object, MY_CLASS);
- const Efl_Callback_Array_Item *callback_array = event->info;
+ const Efl_Callback_Array_Item_Full *callback_array = event->info;
if (callback_array->desc != EV_A_CHANGED)
return;
diff --git a/src/tests/eo/suite/eo_error_msgs.c b/src/tests/eo/suite/eo_error_msgs.c
index ae5b5d0ddc..bd187d3f97 100644
--- a/src/tests/eo/suite/eo_error_msgs.c
+++ b/src/tests/eo/suite/eo_error_msgs.c
@@ -8,12 +8,6 @@ eo_test_print_cb(const Eina_Log_Domain *d, Eina_Log_Level level, const char *fil
if (level > _EINA_LOG_MAX)
return;
- ck_assert_int_eq(level, myctx->expected_level);
- if (myctx->msg)
- ck_assert_str_eq(myctx->msg, fmt);
- ck_assert_str_eq(myctx->fnc, fnc);
- myctx->did = EINA_TRUE;
-
#ifdef SHOW_LOG
eina_log_print_cb_stderr(d, level, file, fnc, line, fmt, NULL, args);
#else
@@ -21,6 +15,12 @@ eo_test_print_cb(const Eina_Log_Domain *d, Eina_Log_Level level, const char *fil
(void)file;
(void)line;
#endif
+
+ ck_assert_int_eq(level, myctx->expected_level);
+ if (myctx->msg)
+ ck_assert_str_eq(myctx->msg, fmt);
+ ck_assert_str_eq(myctx->fnc, fnc);
+ myctx->did = EINA_TRUE;
}
void
@@ -33,6 +33,14 @@ eo_test_safety_print_cb(const Eina_Log_Domain *d, Eina_Log_Level level, const ch
if (level > _EINA_LOG_MAX)
return;
+#ifdef SHOW_LOG
+ eina_log_print_cb_stderr(d, level, file, fnc, line, fmt, NULL, args);
+#else
+ (void)d;
+ (void)file;
+ (void)line;
+#endif
+
va_copy(cp_args, args);
str = va_arg(cp_args, const char *);
va_end(cp_args);
@@ -42,12 +50,4 @@ eo_test_safety_print_cb(const Eina_Log_Domain *d, Eina_Log_Level level, const ch
ck_assert_str_eq(myctx->msg, str);
ck_assert_str_eq(myctx->fnc, fnc);
myctx->did = EINA_TRUE;
-
-#ifdef SHOW_LOG
- eina_log_print_cb_stderr(d, level, file, fnc, line, fmt, NULL, args);
-#else
- (void)d;
- (void)file;
- (void)line;
-#endif
}
diff --git a/src/tests/eo/suite/eo_error_msgs.h b/src/tests/eo/suite/eo_error_msgs.h
index c3690fd345..56819040c0 100644
--- a/src/tests/eo/suite/eo_error_msgs.h
+++ b/src/tests/eo/suite/eo_error_msgs.h
@@ -27,4 +27,10 @@ eo_test_safety_print_cb(const Eina_Log_Domain *d, Eina_Log_Level level, const ch
ctx.did = EINA_FALSE; \
ctx.expected_level = EINA_LOG_LEVEL_ERR
+#define TEST_EO_CRITICAL(fn, _msg) \
+ ctx.msg = _msg; \
+ ctx.fnc = fn; \
+ ctx.did = EINA_FALSE; \
+ ctx.expected_level = EINA_LOG_LEVEL_CRITICAL
+
#endif /* _EO_ERROR_MSGS_H */
diff --git a/src/tests/eo/suite/eo_suite.c b/src/tests/eo/suite/eo_suite.c
index a9e6cc7444..06e0d4ec0e 100644
--- a/src/tests/eo/suite/eo_suite.c
+++ b/src/tests/eo/suite/eo_suite.c
@@ -4,6 +4,7 @@
#include "eo_suite.h"
#include "../../efl_check.h"
+#include <Eo.h>
static const Efl_Test_Case etc[] = {
{ "Eo init", eo_test_init },
@@ -14,9 +15,20 @@ static const Efl_Test_Case etc[] = {
{ "Eo eina value", eo_test_value },
{ "Eo threaded eo calls", eo_test_threaded_calls },
{ "Eo event calls", eo_test_event},
+ { "Eo lifecycle", eo_test_lifecycle},
{ NULL, NULL }
};
+SUITE_INIT(efl_object)
+{
+ ck_assert_int_eq(efl_object_init(), 1);
+}
+
+SUITE_SHUTDOWN(efl_object)
+{
+ ck_assert_int_eq(efl_object_shutdown(), 0);
+}
+
int
main(int argc, char **argv)
{
@@ -30,7 +42,7 @@ main(int argc, char **argv)
#endif
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
- "Eo", etc);
+ "Eo", etc, SUITE_INIT_FN(efl_object), SUITE_SHUTDOWN_FN(efl_object));
return (failed_count == 0) ? 0 : 255;
}
diff --git a/src/tests/eo/suite/eo_suite.h b/src/tests/eo/suite/eo_suite.h
index 173965fdf7..700325c465 100644
--- a/src/tests/eo/suite/eo_suite.h
+++ b/src/tests/eo/suite/eo_suite.h
@@ -2,7 +2,7 @@
#define _EO_SUITE_H
#include <check.h>
-
+#include "../../efl_check.h"
void eo_test_init(TCase *tc);
void eo_test_general(TCase *tc);
void eo_test_class_errors(TCase *tc);
@@ -11,5 +11,5 @@ void eo_test_call_errors(TCase *tc);
void eo_test_value(TCase *tc);
void eo_test_threaded_calls(TCase *tc);
void eo_test_event(TCase *tc);
-
+void eo_test_lifecycle(TCase *tc);
#endif /* _EO_SUITE_H */
diff --git a/src/tests/eo/suite/eo_test_call_errors.c b/src/tests/eo/suite/eo_test_call_errors.c
index 8bc4329ee5..5a737a415d 100644
--- a/src/tests/eo/suite/eo_test_call_errors.c
+++ b/src/tests/eo/suite/eo_test_call_errors.c
@@ -12,12 +12,11 @@
static struct log_ctx ctx;
-START_TEST(eo_pure_virtual_fct_call)
+EFL_START_TEST(eo_pure_virtual_fct_call)
{
- efl_object_init();
eina_log_print_cb_set(eo_test_print_cb, &ctx);
- Eo *obj = efl_add(SIMPLE_CLASS, NULL);
+ Eo *obj = efl_add_ref(SIMPLE_CLASS, NULL);
fail_if(!obj);
TEST_EO_ERROR("_efl_object_call_resolve", "in %s:%d: you called a pure virtual func '%s' (%d) of class '%s'.");
@@ -26,16 +25,14 @@ START_TEST(eo_pure_virtual_fct_call)
efl_unref(obj);
eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eo_api_not_implemented_call)
+EFL_START_TEST(eo_api_not_implemented_call)
{
- efl_object_init();
eina_log_print_cb_set(eo_test_print_cb, &ctx);
- Eo *obj = efl_add(SIMPLE_CLASS, NULL);
+ Eo *obj = efl_add_ref(SIMPLE_CLASS, NULL);
fail_if(!obj);
TEST_EO_ERROR("simple_no_implementation", "Unable to resolve op for api func %p for obj=%p (%s)");
@@ -44,16 +41,14 @@ START_TEST(eo_api_not_implemented_call)
efl_unref(obj);
eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eo_op_not_found_in_super)
+EFL_START_TEST(eo_op_not_found_in_super)
{
- efl_object_init();
eina_log_print_cb_set(eo_test_print_cb, &ctx);
- Eo *obj = efl_add(SIMPLE_CLASS, NULL);
+ Eo *obj = efl_add_ref(SIMPLE_CLASS, NULL);
fail_if(!obj);
TEST_EO_ERROR("_efl_object_call_resolve", "in %s:%d: func '%s' (%d) could not be resolved for class '%s' for super of '%s'.");
@@ -62,9 +57,8 @@ START_TEST(eo_op_not_found_in_super)
efl_unref(obj);
eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
//the fallback code that will be called
@@ -110,11 +104,10 @@ static const Efl_Class_Description errorcase_class_desc = {
EFL_DEFINE_CLASS(simple_errorcase_class_get, &errorcase_class_desc, EO_CLASS, NULL)
-START_TEST(eo_fallbackcall_execute)
+EFL_START_TEST(eo_fallbackcall_execute)
{
- efl_object_init();
- Eo *obj = efl_add(SIMPLE_CLASS, NULL);
+ Eo *obj = efl_add_ref(SIMPLE_CLASS, NULL);
fallback_called = EINA_FALSE;
simple_error_test(NULL);
@@ -124,9 +117,8 @@ START_TEST(eo_fallbackcall_execute)
simple_error_test(obj);
ck_assert_int_eq(fallback_called, 1);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
void eo_test_call_errors(TCase *tc)
{
diff --git a/src/tests/eo/suite/eo_test_class_behaviour_errors.c b/src/tests/eo/suite/eo_test_class_behaviour_errors.c
index 98ee81e462..02362257a5 100644
--- a/src/tests/eo/suite/eo_test_class_behaviour_errors.c
+++ b/src/tests/eo/suite/eo_test_class_behaviour_errors.c
@@ -32,9 +32,8 @@ _destructor_unref_class_initializer(Efl_Class *klass2)
return efl_class_functions_set(klass2, &ops, NULL);
}
-START_TEST(efl_destructor_unref)
+EFL_START_TEST(efl_destructor_unref)
{
- efl_object_init();
eina_log_print_cb_set(eo_test_print_cb, &ctx);
static Efl_Class_Description class_desc = {
@@ -50,21 +49,21 @@ START_TEST(efl_destructor_unref)
klass = efl_class_new(&class_desc, SIMPLE_CLASS, NULL);
fail_if(!klass);
- Eo *obj = efl_add(klass, NULL);
+ Eo *obj = efl_add_ref(klass, NULL);
fail_if(!obj);
+ DISABLE_ABORT_ON_CRITICAL_START;
TEST_EO_ERROR("efl_unref", "Obj:%s@%p. User refcount (%d) < 0. Too many unrefs.");
efl_unref(obj);
+ DISABLE_ABORT_ON_CRITICAL_END;
eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(efl_destructor_double_del)
+EFL_START_TEST(efl_destructor_double_del)
{
- efl_object_init();
eina_log_print_cb_set(eo_test_print_cb, &ctx);
static Efl_Class_Description class_desc = {
@@ -80,19 +79,20 @@ START_TEST(efl_destructor_double_del)
klass = efl_class_new(&class_desc, SIMPLE_CLASS, NULL);
fail_if(!klass);
- Eo *obj = efl_add(klass, NULL);
+ Eo *obj = efl_add_ref(klass, NULL);
efl_manual_free_set(obj, EINA_TRUE);
fail_if(!obj);
TEST_EO_ERROR("efl_unref", "Obj:%s@%p. User refcount (%d) < 0. Too many unrefs.");
- efl_del(obj);
- efl_del(obj);
+ efl_unref(obj);
+ DISABLE_ABORT_ON_CRITICAL_START;
+ efl_unref(obj);
+ DISABLE_ABORT_ON_CRITICAL_END;
eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
void eo_test_class_behaviour_errors(TCase *tc)
{
diff --git a/src/tests/eo/suite/eo_test_class_errors.c b/src/tests/eo/suite/eo_test_class_errors.c
index ef15c99707..a5052196c7 100644
--- a/src/tests/eo/suite/eo_test_class_errors.c
+++ b/src/tests/eo/suite/eo_test_class_errors.c
@@ -12,9 +12,8 @@
static struct log_ctx ctx;
-START_TEST(eo_inherit_errors)
+EFL_START_TEST(eo_inherit_errors)
{
- efl_object_init();
eina_log_print_cb_set(eo_test_print_cb, &ctx);
const Efl_Class *klass;
@@ -72,13 +71,11 @@ START_TEST(eo_inherit_errors)
(void) klass;
eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eo_inconsistent_mro)
+EFL_START_TEST(eo_inconsistent_mro)
{
- efl_object_init();
eina_log_print_cb_set(eo_test_print_cb, &ctx);
const Efl_Class *klass;
@@ -148,15 +145,13 @@ START_TEST(eo_inconsistent_mro)
eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
static void _stub_class_constructor(Efl_Class *klass EINA_UNUSED) {}
-START_TEST(eo_bad_interface)
+EFL_START_TEST(eo_bad_interface)
{
- efl_object_init();
eina_log_print_cb_set(eo_test_safety_print_cb, &ctx);
const Efl_Class *klass;
@@ -195,9 +190,8 @@ START_TEST(eo_bad_interface)
eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
static void _null_fct(Eo *eo_obj EINA_UNUSED, void *d EINA_UNUSED) { }
void null_fct (void) {}
@@ -212,9 +206,8 @@ _null_class_initializer(Efl_Class *klass)
return efl_class_functions_set(klass, &ops, NULL);
}
-START_TEST(eo_null_api)
+EFL_START_TEST(eo_null_api)
{
- efl_object_init();
eina_log_print_cb_set(eo_test_print_cb, &ctx);
const Efl_Class *klass;
@@ -236,9 +229,8 @@ START_TEST(eo_null_api)
eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
static Eina_Bool
_redefined_class_initializer(Efl_Class *klass)
@@ -251,9 +243,8 @@ _redefined_class_initializer(Efl_Class *klass)
return efl_class_functions_set(klass, &ops, NULL);
}
-START_TEST(eo_api_redefined)
+EFL_START_TEST(eo_api_redefined)
{
- efl_object_init();
eina_log_print_cb_set(eo_test_print_cb, &ctx);
const Efl_Class *klass;
@@ -275,9 +266,8 @@ START_TEST(eo_api_redefined)
eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
static Eina_Bool
_dich_func_class_initializer(Efl_Class *klass)
@@ -290,9 +280,8 @@ _dich_func_class_initializer(Efl_Class *klass)
return efl_class_functions_set(klass, &ops, NULL);
}
-START_TEST(eo_dich_func_override)
+EFL_START_TEST(eo_dich_func_override)
{
- efl_object_init();
eina_log_print_cb_set(eo_test_print_cb, &ctx);
const Efl_Class *klass;
@@ -314,9 +303,8 @@ START_TEST(eo_dich_func_override)
eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
void eo_test_class_errors(TCase *tc)
{
diff --git a/src/tests/eo/suite/eo_test_class_singleton.c b/src/tests/eo/suite/eo_test_class_singleton.c
index e5db1ff62c..a38a52b915 100644
--- a/src/tests/eo/suite/eo_test_class_singleton.c
+++ b/src/tests/eo/suite/eo_test_class_singleton.c
@@ -15,7 +15,7 @@ _singleton_efl_constructor(Eo *eo_obj EINA_UNUSED, void *_pd EINA_UNUSED)
{
if (!singleton_obj)
{
- singleton_obj = efl_add(SIMPLE_CLASS, NULL);
+ singleton_obj = efl_add_ref(SIMPLE_CLASS, NULL);
}
else
{
diff --git a/src/tests/eo/suite/eo_test_domain.c b/src/tests/eo/suite/eo_test_domain.c
index 45a1fe377f..114f57060d 100644
--- a/src/tests/eo/suite/eo_test_domain.c
+++ b/src/tests/eo/suite/eo_test_domain.c
@@ -17,7 +17,6 @@ _a_set(Eo *obj EINA_UNUSED, void *class_data, int a)
Domain_Public_Data *pd = class_data;
printf("Set Begin\n");
pd->a = a;
- sleep(1);
printf("Set End\n");
printf("Call Events\n");
efl_event_callback_legacy_call(obj, EV_DOMAIN_A_CHANGED, &pd->a);
@@ -32,7 +31,7 @@ _a_get(Eo *obj EINA_UNUSED, void *class_data)
return pd->a;
}
-//return obj = efl_add(DOMAIN_CLASS, NULL);
+//return obj = efl_add_ref(DOMAIN_CLASS, NULL);
EFL_VOID_FUNC_BODYV(domain_recursive, EFL_FUNC_CALL(n), int n);
diff --git a/src/tests/eo/suite/eo_test_event.c b/src/tests/eo/suite/eo_test_event.c
index 66902db233..9694ba3a76 100644
--- a/src/tests/eo/suite/eo_test_event.c
+++ b/src/tests/eo/suite/eo_test_event.c
@@ -57,13 +57,12 @@ _cb1(void *data, const Efl_Event *event)
efl_event_callback_add(event->object, EFL_TEST_EVENT_EVENT_TESTER, _cb3, data);
}
-START_TEST(eo_event)
+EFL_START_TEST(eo_event)
{
Test_Data data;
- efl_object_init();
Eo *obj;
- obj = efl_add(efl_test_event_class_get(), NULL);
+ obj = efl_add_ref(efl_test_event_class_get(), NULL);
efl_event_callback_priority_add(obj, EFL_TEST_EVENT_EVENT_TESTER, EFL_CALLBACK_PRIORITY_BEFORE, _cb2, &data);
efl_event_callback_priority_add(obj, EFL_TEST_EVENT_EVENT_TESTER, EFL_CALLBACK_PRIORITY_BEFORE, _cb1, &data);
@@ -79,9 +78,8 @@ START_TEST(eo_event)
ck_assert_int_ne(data.event2, 0);
ck_assert_int_ne(data.event3, 0);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
static void
_cb_rec_3(void *data EINA_UNUSED, const Efl_Event *event)
@@ -117,13 +115,12 @@ _cb_rec_1(void *data, const Efl_Event *event)
}
}
-START_TEST(eo_event_call_in_call)
+EFL_START_TEST(eo_event_call_in_call)
{
Test_Data data;
- efl_object_init();
Eo *obj;
- obj = efl_add(efl_test_event_class_get(), NULL);
+ obj = efl_add_ref(efl_test_event_class_get(), NULL);
efl_event_callback_priority_add(obj, EFL_TEST_EVENT_EVENT_TESTER, EFL_CALLBACK_PRIORITY_BEFORE, _cb_rec_1, &data);
memset(&data, 0, sizeof(Test_Data));
@@ -132,9 +129,8 @@ START_TEST(eo_event_call_in_call)
ck_assert_int_ne(data.event2, 0);
ck_assert_int_ne(data.event3, 0);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
static Eina_Bool emitted = 0;
@@ -162,9 +158,8 @@ _generation_clamp_step1(void *data EINA_UNUSED, const Efl_Event *e)
}
-START_TEST(eo_event_generation_bug)
+EFL_START_TEST(eo_event_generation_bug)
{
- efl_object_init();
/*
* The idea is:
@@ -179,7 +174,7 @@ START_TEST(eo_event_generation_bug)
Eo *obj;
- obj = efl_add(efl_test_event_class_get(), NULL);
+ obj = efl_add_ref(efl_test_event_class_get(), NULL);
emitted = 0;
efl_event_callback_priority_add(obj, EFL_TEST_EVENT_EVENT_TESTER, EFL_CALLBACK_PRIORITY_BEFORE, _generation_clamp_step1, NULL);
efl_event_callback_priority_add(obj, EFL_TEST_EVENT_EVENT_TESTER_SUBSCRIBE, EFL_CALLBACK_PRIORITY_BEFORE, _generation_clamp_subscribe, NULL);
@@ -187,9 +182,8 @@ START_TEST(eo_event_generation_bug)
ck_assert_int_ne(emitted, 0);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
void eo_test_event(TCase *tc)
diff --git a/src/tests/eo/suite/eo_test_general.c b/src/tests/eo/suite/eo_test_general.c
index 46c351fdd9..603b14e836 100644
--- a/src/tests/eo/suite/eo_test_general.c
+++ b/src/tests/eo/suite/eo_test_general.c
@@ -11,6 +11,8 @@
#include <Eo.h>
+#include "eo_internal.h"
+
#include "eo_suite.h"
#include "eo_test_class_simple.h"
#include "eo_test_class_singleton.h"
@@ -19,30 +21,27 @@
/* Loading this internal header for testing purposes. */
#include "eo_ptr_indirection.h"
-START_TEST(eo_simple)
+EFL_START_TEST(eo_simple)
{
- efl_object_init();
- Eo *obj = efl_add(EO_CLASS, NULL);
+ Eo *obj = efl_add_ref(EO_CLASS, NULL);
fail_if(obj);
- obj = efl_add(SIMPLE_CLASS, NULL);
+ obj = efl_add_ref(SIMPLE_CLASS, NULL);
fail_if(!obj);
efl_constructor(obj);
efl_destructor(obj);
efl_unref(obj);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eo_singleton)
+EFL_START_TEST(eo_singleton)
{
- efl_object_init();
- Eo *obj = efl_add(SINGLETON_CLASS, NULL);
+ Eo *obj = efl_add_ref(SINGLETON_CLASS, NULL);
fail_if(!obj);
- Eo *obj2 = efl_add(SINGLETON_CLASS, NULL);
+ Eo *obj2 = efl_add_ref(SINGLETON_CLASS, NULL);
fail_if(!obj2);
ck_assert_ptr_eq(obj, obj2);
@@ -50,9 +49,8 @@ START_TEST(eo_singleton)
efl_unref(obj);
efl_unref(obj2);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
#define OVERRIDE_A_SIMPLE 100859
#define OVERRIDE_A 324000
@@ -68,11 +66,10 @@ _simple_obj_override_a_double_set(Eo *obj, void *class_data EINA_UNUSED, int a)
simple_a_set(efl_super(obj, EFL_OBJECT_OVERRIDE_CLASS), 2 * a);
}
-START_TEST(efl_object_override_tests)
+EFL_START_TEST(efl_object_override_tests)
{
- efl_object_init();
- Eo *obj = efl_add(SIMPLE_CLASS, NULL);
+ Eo *obj = efl_add_ref(SIMPLE_CLASS, NULL);
fail_if(!obj);
/* First get the value before the override to make sure it works and to
@@ -133,9 +130,8 @@ START_TEST(efl_object_override_tests)
efl_unref(obj);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
static int _eo_signals_cb_current = 0;
static int _eo_signals_cb_flag = 0;
@@ -178,14 +174,17 @@ _eo_signals_efl_del_cb(void *_data EINA_UNUSED, const Efl_Event *event EINA_UNUS
_eo_signals_cb_flag |= 0x4;
}
+static int check_is_deled = 0;
+
void
-_eo_signals_cb_added_deled(void *data, const Efl_Event *event)
+_eo_signals_cb_added_deled(void *data EINA_UNUSED, const Efl_Event *event)
{
- const Efl_Callback_Array_Item *callback_array = event->info;
- const Efl_Callback_Array_Item *(*callback_data)(void) = data;
+ const Efl_Callback_Array_Item_Full *callback_array = event->info;
- fail_if((callback_data() != callback_array) &&
- (callback_array->func != _eo_signals_cb_added_deled));
+ if (check_is_deled)
+ fail_if(callback_array->func == _eo_signals_cb_added_deled);
+ else
+ fail_if(callback_array->func != _eo_signals_cb_added_deled);
}
EFL_CALLBACKS_ARRAY_DEFINE(_eo_signals_callbacks,
@@ -194,16 +193,16 @@ EFL_CALLBACKS_ARRAY_DEFINE(_eo_signals_callbacks,
{ EV_A_CHANGED, _eo_signals_a_changed_never },
{ EFL_EVENT_DEL, _eo_signals_efl_del_cb });
-START_TEST(eo_signals)
+EFL_START_TEST(eo_signals)
{
- efl_object_init();
- Eo *obj = efl_add(SIMPLE_CLASS, NULL);
+ Eo *obj = efl_add_ref(SIMPLE_CLASS, NULL);
Eina_Bool r;
efl_event_callback_add(obj, EFL_EVENT_CALLBACK_ADD, _eo_signals_cb_added_deled, &_eo_signals_callbacks);
r = efl_event_callback_add(obj, EFL_EVENT_CALLBACK_DEL, _eo_signals_cb_added_deled, &_eo_signals_callbacks);
fail_if(!r);
+ check_is_deled = 1;
efl_event_callback_array_priority_add(obj, _eo_signals_callbacks(), -100, (void *) 1);
efl_event_callback_array_add(obj, _eo_signals_callbacks(), (void *) 3);
r = efl_event_callback_array_priority_add(obj, _eo_signals_callbacks(), -50, (void *) 2);
@@ -227,7 +226,7 @@ START_TEST(eo_signals)
efl_unref(obj);
- obj = efl_add(SIMPLE_CLASS, NULL);
+ obj = efl_add_ref(SIMPLE_CLASS, NULL);
/* Legacy support signals. */
{
const Efl_Event_Description *a_desc = efl_object_legacy_only_event_description_get("a,changed");
@@ -276,13 +275,11 @@ START_TEST(eo_signals)
}
efl_unref(obj);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(efl_data_fetch)
+EFL_START_TEST(efl_data_fetch)
{
- efl_object_init();
/* Usually should be const, not const only for the test... */
static Efl_Class_Description class_desc = {
@@ -298,7 +295,7 @@ START_TEST(efl_data_fetch)
const Efl_Class *klass = efl_class_new(&class_desc, EO_CLASS, NULL);
fail_if(!klass);
- Eo *obj = efl_add(klass, NULL);
+ Eo *obj = efl_add_ref(klass, NULL);
fail_if(!obj);
#ifdef EO_DEBUG
fail_if(efl_data_scope_get(obj, SIMPLE_CLASS));
@@ -309,25 +306,23 @@ START_TEST(efl_data_fetch)
klass = efl_class_new(&class_desc, EO_CLASS, NULL);
fail_if(!klass);
- obj = efl_add(klass, NULL);
+ obj = efl_add_ref(klass, NULL);
fail_if(!obj);
fail_if(efl_data_scope_get(obj, klass));
fail_if(!efl_data_scope_get(obj, EFL_OBJECT_CLASS));
efl_unref(obj);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(efl_data_safe_fetch)
+EFL_START_TEST(efl_data_safe_fetch)
{
- efl_object_init();
- Eo *obj = efl_add(SIMPLE2_CLASS, NULL);
+ Eo *obj = efl_add_ref(SIMPLE2_CLASS, NULL);
fail_if(!obj || !efl_data_scope_safe_get(obj, SIMPLE2_CLASS));
efl_unref(obj);
- obj = efl_add(SIMPLE3_CLASS, NULL);
+ obj = efl_add_ref(SIMPLE3_CLASS, NULL);
fail_if(!obj);
fail_if(!efl_isa(obj, SIMPLE_CLASS));
fail_if(!efl_isa(obj, SIMPLE2_CLASS));
@@ -339,13 +334,11 @@ START_TEST(efl_data_safe_fetch)
efl_unref(obj);
fail_if(efl_data_scope_safe_get(obj, SIMPLE3_CLASS) != NULL);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(efl_isa_tests)
+EFL_START_TEST(efl_isa_tests)
{
- efl_object_init();
const Efl_Class *klass, *iface, *mixin;
@@ -397,7 +390,7 @@ START_TEST(efl_isa_tests)
fail_if(!klass);
}
- Eo *obj = efl_add(klass, NULL);
+ Eo *obj = efl_add_ref(klass, NULL);
fail_if(!obj);
fail_if(efl_isa(obj, SIMPLE_CLASS));
fail_if(!efl_isa(obj, iface));
@@ -406,7 +399,7 @@ START_TEST(efl_isa_tests)
fail_if(!efl_isa(obj, EO_CLASS));
efl_unref(obj);
- obj = efl_add(SIMPLE_CLASS, NULL);
+ obj = efl_add_ref(SIMPLE_CLASS, NULL);
fail_if(!obj);
fail_if(efl_isa(obj, klass));
fail_if(efl_isa(obj, iface));
@@ -415,20 +408,18 @@ START_TEST(efl_isa_tests)
fail_if(!efl_isa(obj, EO_CLASS));
efl_unref(obj);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(efl_composite_tests)
+EFL_START_TEST(efl_composite_tests)
{
- efl_object_init();
- Eo *obj = efl_add(SIMPLE_CLASS, NULL);
+ Eo *obj = efl_add_ref(SIMPLE_CLASS, NULL);
fail_if(!obj);
- Eo *obj2 = efl_add(SIMPLE_CLASS, NULL);
+ Eo *obj2 = efl_add_ref(SIMPLE_CLASS, NULL);
fail_if(!obj2);
- Eo *obj3 = efl_add(SIMPLE_CLASS, NULL);
+ Eo *obj3 = efl_add_ref(SIMPLE_CLASS, NULL);
fail_if(!obj3);
efl_composite_attach(obj, obj2);
@@ -439,18 +430,17 @@ START_TEST(efl_composite_tests)
fail_if(!efl_composite_part_is(obj2));
/* Check that a deletion of a child detaches from the parent. */
- efl_del(obj2);
+ efl_unref(obj2);
fail_if(!efl_composite_attach(obj3, obj));
/* Check that a deletion of the parent detaches the child. */
- efl_del(obj3);
+ efl_unref(obj3);
fail_if(efl_composite_part_is(obj));
efl_unref(obj);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
static Eina_Bool _man_should_con = EINA_TRUE;
static Eina_Bool _man_should_des = EINA_TRUE;
@@ -483,9 +473,8 @@ _class_initializer(Efl_Class *klass)
return efl_class_functions_set(klass, &ops, NULL);
}
-START_TEST(eo_man_free)
+EFL_START_TEST(eo_man_free)
{
- efl_object_init();
/* Usually should be const, not const only for the test... */
static Efl_Class_Description class_desc = {
@@ -502,11 +491,11 @@ START_TEST(eo_man_free)
fail_if(!klass);
cur_klass = klass;
- Eo *obj = efl_add(klass, NULL);
+ Eo *obj = efl_add_ref(klass, NULL);
fail_if(!obj);
efl_unref(obj);
- obj = efl_add(klass, NULL);
+ obj = efl_add_ref(klass, NULL);
fail_if(!obj);
fail_if(efl_manual_free(obj));
efl_unref(obj);
@@ -516,7 +505,7 @@ START_TEST(eo_man_free)
cur_klass = klass;
fail_if(!klass);
- obj = efl_add(klass, NULL);
+ obj = efl_add_ref(klass, NULL);
fail_if(!obj);
fail_if(efl_manual_free(obj));
fail_if(efl_destructed_is(obj));
@@ -524,7 +513,7 @@ START_TEST(eo_man_free)
fail_if(!efl_destructed_is(obj));
fail_if(!efl_manual_free(obj));
- obj = efl_add(klass, NULL);
+ obj = efl_add_ref(klass, NULL);
fail_if(!obj);
efl_unref(obj);
fail_if(!efl_destructed_is(obj));
@@ -535,41 +524,43 @@ START_TEST(eo_man_free)
cur_klass = klass;
fail_if(!klass);
- obj = efl_add(klass, NULL);
+ obj = efl_add_ref(klass, NULL);
fail_if(!obj);
fail_if(efl_manual_free(obj));
efl_unref(obj);
- obj = efl_add(klass, NULL);
+ obj = efl_add_ref(klass, NULL);
fail_if(!obj);
efl_manual_free_set(obj, EINA_TRUE);
efl_unref(obj);
efl_ref(obj);
efl_unref(obj);
+ DISABLE_ABORT_ON_CRITICAL_START;
efl_unref(obj);
+ DISABLE_ABORT_ON_CRITICAL_END;
fail_if(!efl_manual_free(obj));
- obj = efl_add(klass, NULL);
+ obj = efl_add_ref(klass, NULL);
fail_if(!obj);
efl_manual_free_set(obj, EINA_TRUE);
efl_unref(obj);
efl_ref(obj);
efl_unref(obj);
+ DISABLE_ABORT_ON_CRITICAL_START;
efl_unref(obj);
efl_unref(obj);
efl_unref(obj);
+ DISABLE_ABORT_ON_CRITICAL_END;
fail_if(!efl_manual_free(obj));
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(efl_refs)
+EFL_START_TEST(efl_refs)
{
- efl_object_init();
- Eo *obj = efl_add(SIMPLE_CLASS, NULL);
- Eo *obj2 = efl_add(SIMPLE_CLASS, NULL);
- Eo *obj3 = efl_add(SIMPLE_CLASS, NULL);
+ Eo *obj = efl_add_ref(SIMPLE_CLASS, NULL);
+ Eo *obj2 = efl_add_ref(SIMPLE_CLASS, NULL);
+ Eo *obj3 = efl_add_ref(SIMPLE_CLASS, NULL);
efl_xref(obj, obj2);
fail_if(efl_ref_count(obj) != 2);
@@ -604,7 +595,7 @@ START_TEST(efl_refs)
efl_unref(obj3);
/* Check hierarchy */
- obj = efl_add(SIMPLE_CLASS, NULL);
+ obj = efl_add_ref(SIMPLE_CLASS, NULL);
obj2 = efl_ref(efl_add(SIMPLE_CLASS, obj));
Eo *wref = NULL;
@@ -620,7 +611,7 @@ START_TEST(efl_refs)
fail_if(wref);
/* efl_add_ref and normal efl_add */
- obj = efl_add(SIMPLE_CLASS, NULL);
+ obj = efl_add_ref(SIMPLE_CLASS, NULL);
obj2 = efl_add(SIMPLE_CLASS, obj);
obj3 = efl_add_ref(SIMPLE_CLASS, obj);
@@ -628,15 +619,18 @@ START_TEST(efl_refs)
ck_assert_int_eq(efl_ref_count(obj2), 1);
ck_assert_int_eq(efl_ref_count(obj3), 2);
- efl_del(obj);
+ efl_unref(obj);
efl_del(obj2);
efl_unref(obj3);
efl_del(obj3);
/* Setting and removing parents. */
- obj = efl_add(SIMPLE_CLASS, NULL);
+ obj = efl_add_ref(SIMPLE_CLASS, NULL);
obj2 = efl_ref(efl_add(SIMPLE_CLASS, obj));
- obj3 = efl_ref(efl_add(SIMPLE_CLASS, NULL));
+ obj3 = efl_add_ref(SIMPLE_CLASS, NULL);
+
+ efl_parent_set(obj, obj);
+ ck_assert_ptr_eq(efl_parent_get(obj), NULL);
efl_parent_set(obj2, obj3);
efl_parent_set(obj3, obj);
@@ -648,17 +642,15 @@ START_TEST(efl_refs)
ck_assert_int_eq(efl_ref_count(obj2), 1);
ck_assert_int_eq(efl_ref_count(obj3), 1);
- efl_parent_set(obj2, obj);
- efl_parent_set(obj3, obj);
- ck_assert_int_eq(efl_ref_count(obj2), 2);
- ck_assert_int_eq(efl_ref_count(obj3), 2);
+ fail_if(!efl_invalidated_get(obj2));
+ fail_if(!efl_invalidated_get(obj3));
- efl_del(obj);
- efl_del(obj2);
- efl_del(obj3);
+ efl_unref(obj);
+ efl_unref(obj2);
+ efl_unref(obj3);
/* Setting and removing parents for add_ref */
- obj = efl_add(SIMPLE_CLASS, NULL);
+ obj = efl_add_ref(SIMPLE_CLASS, NULL);
obj2 = efl_add_ref(SIMPLE_CLASS, obj);
obj3 = efl_add_ref(SIMPLE_CLASS, NULL);
@@ -675,38 +667,42 @@ START_TEST(efl_refs)
ck_assert_int_eq(efl_ref_count(obj2), 1);
ck_assert_int_eq(efl_ref_count(obj3), 1);
- efl_parent_set(obj2, obj);
- efl_parent_set(obj3, obj);
- ck_assert_int_eq(efl_ref_count(obj2), 2);
- ck_assert_int_eq(efl_ref_count(obj3), 2);
+ fail_if(!efl_invalidated_get(obj2));
+ fail_if(!efl_invalidated_get(obj3));
- efl_del(obj);
- efl_del(obj2);
- efl_del(obj3);
+ {
+ int ref_pre = efl_ref_count(obj2);
+ efl_parent_set(obj2, obj3);
+ ck_assert_int_eq(ref_pre, efl_ref_count(obj2));
+ }
+
+ efl_unref(obj);
+ efl_unref(obj2);
+ efl_unref(obj3);
/* Just check it doesn't seg atm. */
- obj = efl_add(SIMPLE_CLASS, NULL);
+ obj = efl_add_ref(SIMPLE_CLASS, NULL);
efl_ref(obj);
efl_unref(obj);
efl_unref(obj);
- obj = efl_add(SIMPLE_CLASS, NULL);
+ obj = efl_add_ref(SIMPLE_CLASS, NULL);
obj2 = efl_add(SIMPLE_CLASS, obj);
+ DISABLE_ABORT_ON_CRITICAL_START;
efl_unref(obj2);
+ DISABLE_ABORT_ON_CRITICAL_END;
efl_ref(obj2);
efl_del(obj2);
efl_unref(obj);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(efl_weak_reference)
+EFL_START_TEST(efl_weak_reference)
{
- efl_object_init();
- Eo *obj = efl_add(SIMPLE_CLASS, NULL);
- Eo *obj2 = efl_add(SIMPLE_CLASS, NULL);
+ Eo *obj = efl_add_ref(SIMPLE_CLASS, NULL);
+ Eo *obj2 = efl_add_ref(SIMPLE_CLASS, NULL);
Eo *wref = NULL, *wref2 = NULL, *wref3 = NULL;
efl_wref_add(obj, &wref);
fail_if(!wref);
@@ -714,7 +710,7 @@ START_TEST(efl_weak_reference)
efl_unref(obj);
fail_if(wref);
- obj = efl_add(SIMPLE_CLASS, NULL);
+ obj = efl_add_ref(SIMPLE_CLASS, NULL);
efl_wref_add(obj, &wref);
efl_ref(obj);
@@ -726,7 +722,7 @@ START_TEST(efl_weak_reference)
efl_unref(obj);
fail_if(wref);
- obj = efl_add(SIMPLE_CLASS, NULL);
+ obj = efl_add_ref(SIMPLE_CLASS, NULL);
efl_wref_add(obj, &wref);
efl_wref_del(obj, &wref);
@@ -768,16 +764,14 @@ START_TEST(efl_weak_reference)
efl_unref(obj2);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eo_generic_data)
+EFL_START_TEST(eo_generic_data)
{
- efl_object_init();
- Eo *obj = efl_add(SIMPLE_CLASS, NULL);
- Eo *obj2 = efl_add(SIMPLE_CLASS, NULL);
- Eo *obj3 = efl_add(SIMPLE_CLASS, NULL);
+ Eo *obj = efl_add_ref(SIMPLE_CLASS, NULL);
+ Eo *obj2 = efl_add_ref(SIMPLE_CLASS, NULL);
+ Eo *obj3 = efl_add_ref(SIMPLE_CLASS, NULL);
Eo *objtmp;
void *data = NULL;
Eina_Value *value;
@@ -857,10 +851,10 @@ START_TEST(eo_generic_data)
efl_key_ref_set(obj, "test1", obj2);
efl_key_ref_set(obj, "test2", obj3);
- efl_del(obj2);
- efl_del(obj2);
- efl_del(obj3);
- efl_del(obj3);
+ efl_unref(obj2);
+ efl_unref(obj2);
+ efl_unref(obj3);
+ efl_unref(obj3);
objtmp = efl_key_ref_get(obj, "test1");
fail_if(objtmp);
@@ -869,8 +863,8 @@ START_TEST(eo_generic_data)
- obj2 = efl_add(SIMPLE_CLASS, NULL);
- obj3 = efl_add(SIMPLE_CLASS, NULL);
+ obj2 = efl_add_ref(SIMPLE_CLASS, NULL);
+ obj3 = efl_add_ref(SIMPLE_CLASS, NULL);
efl_key_wref_set(obj, "test1", obj2);
objtmp = efl_key_wref_get(obj, "test1");
@@ -912,8 +906,8 @@ START_TEST(eo_generic_data)
efl_key_wref_set(obj, "test1", obj2);
efl_key_wref_set(obj, "test2", obj3);
- efl_del(obj2);
- efl_del(obj3);
+ efl_unref(obj2);
+ efl_unref(obj3);
objtmp = efl_key_wref_get(obj, "test1");
fail_if(objtmp);
@@ -941,16 +935,14 @@ START_TEST(eo_generic_data)
efl_unref(obj2);
efl_unref(obj3);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eo_magic_checks)
+EFL_START_TEST(eo_magic_checks)
{
char _buf[sizeof(long)]; /* Just enough to hold eina magic + a bit more. */
char *buf = _buf;
- efl_object_init();
memset(_buf, 1, sizeof(_buf));
@@ -967,7 +959,7 @@ START_TEST(eo_magic_checks)
obj = efl_add((Efl_Class *) buf, NULL);
fail_if(obj);
- obj = efl_add(SIMPLE_CLASS, NULL);
+ obj = efl_add_ref(SIMPLE_CLASS, NULL);
fail_if(!obj);
simple_a_set((Eo *) buf, ++i);
@@ -1033,9 +1025,8 @@ START_TEST(eo_magic_checks)
buf = NULL;
}
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
/* resolve issues */
@@ -1059,9 +1050,8 @@ _multi_class_initializer(Efl_Class *klass)
return efl_class_functions_set(klass, &ops, NULL);
}
-START_TEST(efl_func_resolve)
+EFL_START_TEST(efl_func_resolve)
{
- efl_object_init();
/* Usually should be const, not const only for the test... */
static Efl_Class_Description class_desc = {
@@ -1077,12 +1067,12 @@ START_TEST(efl_func_resolve)
const Efl_Class *klass = efl_class_new(&class_desc, SIMPLE_CLASS, NULL);
fail_if(!klass);
- Eo *obj = efl_add(klass, NULL);
+ Eo *obj = efl_add_ref(klass, NULL);
fail_if(!resolve_a_print(obj));
efl_unref(obj);
- obj = efl_add(SIMPLE_CLASS, NULL);
+ obj = efl_add_ref(SIMPLE_CLASS, NULL);
fail_if(!obj);
efl_manual_free_set(obj, EINA_TRUE);
@@ -1093,49 +1083,43 @@ START_TEST(efl_func_resolve)
fail_if(!efl_destructed_is(obj));
efl_manual_free(obj);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(efl_add_do_and_custom)
+EFL_START_TEST(efl_add_do_and_custom)
{
Simple_Public_Data *pd = NULL;
Eo *obj = NULL;
- efl_object_init();
- obj = efl_add(SIMPLE_CLASS, NULL, efl_constructor(efl_added));
+ obj = efl_add_ref(SIMPLE_CLASS, NULL, efl_constructor(efl_added));
fail_if(!obj);
efl_unref(obj);
- obj = efl_add(SIMPLE_CLASS, NULL, simple_a_set(efl_added, 7));
+ obj = efl_add_ref(SIMPLE_CLASS, NULL, simple_a_set(efl_added, 7));
fail_if(!obj);
pd = efl_data_scope_get(obj, SIMPLE_CLASS);
fail_if(pd->a != 7);
efl_unref(obj);
- obj = efl_add(SIMPLE_CLASS, NULL, efl_constructor(efl_added), simple_a_set(efl_added, 7));
+ obj = efl_add_ref(SIMPLE_CLASS, NULL, efl_constructor(efl_added), simple_a_set(efl_added, 7));
fail_if(!obj);
pd = efl_data_scope_get(obj, SIMPLE_CLASS);
fail_if(pd->a != 7);
efl_unref(obj);
Eina_Bool finalized;
- obj = efl_add(SIMPLE_CLASS, NULL, finalized = efl_finalized_get(efl_added));
+ obj = efl_add_ref(SIMPLE_CLASS, NULL, finalized = efl_finalized_get(efl_added));
fail_if(finalized);
finalized = efl_finalized_get(obj);
fail_if(!finalized);
efl_unref(obj);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eo_pointers_indirection)
+EFL_START_TEST(eo_pointers_indirection)
{
-#ifdef HAVE_EO_ID
- efl_object_init();
-
static const Efl_Class_Description class_desc = {
EO_VERSION,
"Simple",
@@ -1150,7 +1134,7 @@ START_TEST(eo_pointers_indirection)
fail_if(!klass);
/* Check simple id validity */
- Eo *obj = efl_add(klass, NULL);
+ Eo *obj = efl_add_ref(klass, NULL);
fail_if(!obj);
fail_if(!efl_isa(obj, klass));
obj = (Eo *)((char *)(obj) + 1);
@@ -1161,17 +1145,17 @@ START_TEST(eo_pointers_indirection)
fail_if(efl_isa(obj, klass));
/* Check id invalidity after deletion */
- Eo *obj1 = efl_add(klass, NULL);
+ Eo *obj1 = efl_add_ref(klass, NULL);
fail_if(!obj1);
efl_unref(obj1);
- Eo *obj2 = efl_add(klass, NULL);
+ Eo *obj2 = efl_add_ref(klass, NULL);
fail_if(!obj2);
fail_if(!efl_isa(obj2, klass));
fail_if(efl_isa(obj1, klass));
efl_unref(obj2);
/* Check id sanity checks for "close enough" ids. */
- obj1 = efl_add(klass, NULL);
+ obj1 = efl_add_ref(klass, NULL);
fail_if(!obj1);
obj2 = (Eo *) (((Eo_Id) obj1) & ~MASK_OBJ_TAG);
fail_if(efl_class_get(obj2));
@@ -1184,7 +1168,7 @@ START_TEST(eo_pointers_indirection)
/* Creation of the objects */
for ( obj_id = 0; obj_id < NB_OBJS; obj_id++)
{
- objs[obj_id] = efl_add(klass, NULL);
+ objs[obj_id] = efl_add_ref(klass, NULL);
if(!objs[obj_id])
fail_if(!objs[obj_id]);
if(!efl_isa(objs[obj_id], klass))
@@ -1200,7 +1184,7 @@ START_TEST(eo_pointers_indirection)
/* Creation of the deleted objects */
for ( obj_id = 0; obj_id < NB_OBJS; obj_id+=2000)
{
- objs[obj_id] = efl_add(klass, NULL);
+ objs[obj_id] = efl_add_ref(klass, NULL);
if(!objs[obj_id])
fail_if(!objs[obj_id]);
if(!efl_isa(objs[obj_id], klass))
@@ -1212,11 +1196,8 @@ START_TEST(eo_pointers_indirection)
/* Just be sure that we trigger an already freed error */
efl_unref(objs[0]);
free(objs);
-
- efl_object_shutdown();
-#endif
}
-END_TEST
+EFL_END_TEST
static Eo *
@@ -1235,9 +1216,8 @@ _add_failures_class_initializer(Efl_Class *klass)
return efl_class_functions_set(klass, &ops, NULL);
}
-START_TEST(efl_add_failures)
+EFL_START_TEST(efl_add_failures)
{
- efl_object_init();
static const Efl_Class_Description class_desc = {
EO_VERSION,
@@ -1251,15 +1231,13 @@ START_TEST(efl_add_failures)
const Efl_Class *klass = efl_class_new(&class_desc, EO_CLASS, NULL);
- Eo *obj = efl_add(klass, NULL);
+ Eo *obj = efl_add_ref(klass, NULL);
fail_if(obj);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
-#ifdef HAVE_EO_ID
static Eina_Bool intercepted = EINA_FALSE;
static void
@@ -1275,12 +1253,9 @@ _del_intercept_reuse(Eo *obj)
{
efl_reuse(obj);
}
-#endif
-START_TEST(efl_del_intercept)
+EFL_START_TEST(efl_del_intercept)
{
-#ifdef HAVE_EO_ID
- efl_object_init();
static const Efl_Class_Description class_desc = {
EO_VERSION,
@@ -1297,7 +1272,7 @@ START_TEST(efl_del_intercept)
/* Check unref interception */
intercepted = EINA_FALSE;
- Eo *obj = efl_add(klass, NULL);
+ Eo *obj = efl_add_ref(klass, NULL);
fail_if(!obj);
fail_if(!efl_isa(obj, klass));
efl_del_intercept_set(obj, _del_intercept);
@@ -1307,40 +1282,37 @@ START_TEST(efl_del_intercept)
/* Check del interception */
intercepted = EINA_FALSE;
- obj = efl_add(klass, NULL);
+ obj = efl_add_ref(klass, NULL);
fail_if(!obj);
fail_if(!efl_isa(obj, klass));
efl_del_intercept_set(obj, _del_intercept);
- efl_del(obj);
+ efl_unref(obj);
fail_if(!intercepted);
fail_if(efl_isa(obj, klass));
/* Check reuse works as expected. */
- Eo *parent = efl_add(SIMPLE_CLASS, NULL);
- obj = efl_add(klass, NULL);
+ Eo *parent = efl_add_ref(SIMPLE_CLASS, NULL);
+ obj = efl_add_ref(klass, NULL);
fail_if(!obj);
ck_assert_int_eq(efl_ref_count(obj), 1);
efl_parent_set(obj, parent);
- ck_assert_int_eq(efl_ref_count(obj), 1);
+ ck_assert_int_eq(efl_ref_count(obj), 2);
efl_del_intercept_set(obj, _del_intercept_reuse);
efl_del_intercept_set(obj, NULL);
/* This essentially checks it get unsunk */
- ck_assert_int_eq(efl_ref_count(obj), 1);
+ ck_assert_int_eq(efl_ref_count(obj), 2);
efl_parent_set(obj, parent);
- ck_assert_int_eq(efl_ref_count(obj), 1);
- efl_del(obj);
+ ck_assert_int_eq(efl_ref_count(obj), 2);
+ efl_unref(obj);
- efl_object_shutdown();
-#endif
}
-END_TEST
+EFL_END_TEST
-START_TEST(efl_name)
+EFL_START_TEST(efl_name)
{
- efl_object_init();
- Eo *obj = efl_add(SIMPLE_CLASS, NULL);
- Eo *obj2 = efl_add(SIMPLE_CLASS, NULL);
- Eo *obj3 = efl_add(SIMPLE_CLASS, NULL);
+ Eo *obj = efl_add_ref(SIMPLE_CLASS, NULL);
+ Eo *obj2 = efl_add_ref(SIMPLE_CLASS, NULL);
+ Eo *obj3 = efl_add_ref(SIMPLE_CLASS, NULL);
Eo *objtmp;
const char *id;
@@ -1386,16 +1358,14 @@ START_TEST(efl_name)
objtmp = efl_name_find(obj, "*mple:joe");
fail_if(objtmp != obj2);
- efl_del(obj);
+ efl_unref(obj);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eo_comment)
+EFL_START_TEST(eo_comment)
{
- efl_object_init();
- Eo *obj = efl_add(SIMPLE_CLASS, NULL);
+ Eo *obj = efl_add_ref(SIMPLE_CLASS, NULL);
const char *comment;
comment = efl_comment_get(obj);
@@ -1416,16 +1386,14 @@ START_TEST(eo_comment)
comment = efl_comment_get(obj);
fail_if(NULL != comment);
- efl_del(obj);
+ efl_unref(obj);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(eo_rec_interface)
+EFL_START_TEST(eo_rec_interface)
{
- efl_object_init();
- Eo *s = efl_add(SEARCHABLE_CLASS, NULL);
+ Eo *s = efl_add_ref(SEARCHABLE_CLASS, NULL);
Eo *obj = efl_add(SIMPLE_CLASS, s);
Eo *obj2 = efl_add(SIMPLE_CLASS, obj);
Eo *objtmp;
@@ -1435,9 +1403,8 @@ START_TEST(eo_rec_interface)
efl_del(obj);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
typedef struct
{
@@ -1455,24 +1422,40 @@ thr1(void *data, Eina_Thread t EINA_UNUSED)
fail_if(efl_domain_switch(EFL_ID_DOMAIN_THREAD) != EINA_TRUE);
fail_if(efl_domain_get() != EFL_ID_DOMAIN_THREAD);
printf("ADD2\n");
- Eo *obj = efl_add(DOMAIN_CLASS, NULL);
+ Eo *obj = efl_add_ref(DOMAIN_CLASS, NULL);
printf("ADD2 DONE = %p\n", obj);
printf("VERIFY finalized_get()\n");
fail_if(!efl_finalized_get(d->objs));
+ s2 = efl_add_ref(DOMAIN_CLASS, obj);
+ ck_assert(s2);
+ efl_parent_set(s2, NULL);
+ efl_unref(s2);
+
printf("VERIFY parent_set(invalid) -- WILL SHOW ERRORS\n");
efl_domain_current_push(EFL_ID_DOMAIN_SHARED);
- s1 = efl_add(DOMAIN_CLASS, NULL);
+ s1 = efl_add_ref(DOMAIN_CLASS, NULL);
efl_domain_current_pop();
- efl_del(s1);
+ efl_unref(s1);
efl_parent_set(d->objs, s1);
printf("END OF ERRORS\n");
+ printf("VERIFY parent_set(invalid2) -- WILL SHOW ERRORS\n");
+ efl_domain_current_push(EFL_ID_DOMAIN_SHARED);
+ s1 = efl_add_ref(DOMAIN_CLASS, NULL);
+ s2 = efl_add_ref(DOMAIN_CLASS, s1);
+ efl_domain_current_pop();
+ efl_parent_set(s2, NULL);
+ efl_parent_set(s1, s2);
+ efl_unref(s1);
+ efl_unref(s2);
+ printf("END OF ERRORS\n");
+
printf("VERIFY composite\n");
efl_domain_current_push(EFL_ID_DOMAIN_SHARED);
- s1 = efl_add(SIMPLE_CLASS, NULL, simple_a_set(efl_added, 7));
- s2 = efl_add(SIMPLE_CLASS, NULL, simple_a_set(efl_added, 42));
+ s1 = efl_add_ref(SIMPLE_CLASS, NULL, simple_a_set(efl_added, 7));
+ s2 = efl_add_ref(SIMPLE_CLASS, NULL, simple_a_set(efl_added, 42));
efl_domain_current_pop();
efl_composite_attach(d->objs, s1);
@@ -1480,9 +1463,9 @@ thr1(void *data, Eina_Thread t EINA_UNUSED)
int i2 = simple_a_get(s1);
fail_if(i1 != i2);
fail_if(efl_composite_attach(d->objs, s2));
- efl_del(s1);
+ efl_unref(s1);
fail_if(!efl_composite_attach(d->objs, s2));
- efl_del(s2);
+ efl_unref(s2);
printf("SET ON LOCAL\n");
domain_a_set(obj, 1234);
@@ -1499,7 +1482,6 @@ thr1(void *data, Eina_Thread t EINA_UNUSED)
int v = domain_a_get(d->obj);
printf("........ v = %i\n", v);
fail_if(v == 1234);
- sleep(1);
printf("FAAAAIL DONE\n");
printf("ADOPT...\n");
@@ -1510,14 +1492,13 @@ thr1(void *data, Eina_Thread t EINA_UNUSED)
v = domain_a_get(d->obj);
printf("........ v = %i\n", v);
fail_if(v != 8910);
- sleep(1);
printf("SUCCEED DONE\n");
printf("RETURN DOMAIN DATA\n");
fail_if(efl_domain_data_return(dom) != EINA_TRUE);
printf("RETURN DOMAIN DATA DONE\n");
- efl_del(obj);
+ efl_unref(obj);
return NULL;
}
@@ -1530,16 +1511,18 @@ _timeout(int val EINA_UNUSED)
}
#endif
-START_TEST(eo_domain)
+EFL_START_TEST(eo_domain)
{
Eo *obj, *objs;
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
- efl_object_init();
#ifndef _WIN32
- signal(SIGALRM, _timeout);
- alarm(10);
+ if (!eina_streq(getenv("CK_FORK"), "no"))
+ {
+ signal(SIGALRM, _timeout);
+ alarm(10);
+ }
#endif
fail_if(efl_domain_get() != EFL_ID_DOMAIN_MAIN);
@@ -1579,12 +1562,12 @@ START_TEST(eo_domain)
fail_if(efl_domain_current_get() != EFL_ID_DOMAIN_MAIN);
printf("ADD1\n");
- obj = efl_add(DOMAIN_CLASS, NULL);
+ obj = efl_add_ref(DOMAIN_CLASS, NULL);
printf("ADD1 DONE = %p\n", obj);
efl_domain_current_push(EFL_ID_DOMAIN_SHARED);
printf("ADDS\n");
- objs = efl_add(DOMAIN_CLASS, NULL, domain_a_set(efl_added, 42));
+ objs = efl_add_ref(DOMAIN_CLASS, NULL, domain_a_set(efl_added, 42));
printf("ADDS DONE = %p\n", objs);
efl_domain_current_pop();
@@ -1596,6 +1579,8 @@ START_TEST(eo_domain)
domain_a_set(objs, 1234);
fail_if(domain_a_get(objs) != 1234);
+ ck_assert(SIMPLE_CLASS);
+
Eina_Thread t;
Data data;
data.obj = obj;
@@ -1610,10 +1595,9 @@ START_TEST(eo_domain)
printf("JOIN DONE\n");
printf("DELETING OBJECTS\n");
- efl_del(obj);
- efl_del(objs);
+ efl_unref(obj);
+ efl_unref(objs);
- efl_object_shutdown();
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
#ifndef _WIN32
@@ -1621,7 +1605,7 @@ START_TEST(eo_domain)
signal(SIGALRM, NULL);
#endif
}
-END_TEST
+EFL_END_TEST
static int
@@ -1652,9 +1636,8 @@ _cast_inherit_class_initializer_2(Efl_Class *klass)
return efl_class_functions_set(klass, &ops, NULL);
}
-START_TEST(efl_cast_test)
+EFL_START_TEST(efl_cast_test)
{
- efl_object_init();
static const Efl_Class_Description class_desc_1 = {
EO_VERSION,
@@ -1685,39 +1668,74 @@ START_TEST(efl_cast_test)
Eo *obj;
// Testing normal calls
- obj = efl_add(SIMPLE_CLASS, NULL);
+ obj = efl_add_ref(SIMPLE_CLASS, NULL);
fail_if(!obj);
ck_assert_int_eq(inherit_value(obj), 0);
efl_unref(obj);
- obj = efl_add(klass1, NULL);
+ obj = efl_add_ref(klass1, NULL);
fail_if(!obj);
ck_assert_int_eq(inherit_value(obj), 1);
efl_unref(obj);
- obj = efl_add(klass2, NULL);
+ obj = efl_add_ref(klass2, NULL);
fail_if(!obj);
ck_assert_int_eq(inherit_value(obj), 2);
efl_unref(obj);
// Testing efl_super
- obj = efl_add(klass2, NULL);
+ obj = efl_add_ref(klass2, NULL);
fail_if(!obj);
ck_assert_int_eq(inherit_value(efl_super(obj, klass2)), 1);
ck_assert_int_eq(inherit_value(efl_super(obj, klass1)), 0);
efl_unref(obj);
// Testing efl_cast
- obj = efl_add(klass2, NULL);
+ obj = efl_add_ref(klass2, NULL);
fail_if(!obj);
ck_assert_int_eq(inherit_value(efl_cast(obj, klass2)), 2);
ck_assert_int_eq(inherit_value(efl_cast(obj, klass1)), 1);
ck_assert_int_eq(inherit_value(efl_cast(obj, SIMPLE_CLASS)), 0);
efl_unref(obj);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
+
+static void _destruct_test_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ int *var = data;
+ *var = 1;
+}
+
+static void _destruct_test_destruct_cb(void *data, const Efl_Event *ev)
+{
+ int *var = data;
+ *var *= 2;
+
+ ck_assert_int_eq(efl_ref_count(ev->object), 0);
+
+ // test disabled: object isn't yet marked as destructed (we're inside the
+ // base class destructor here).
+ //ck_assert_int_ne(efl_destructed_is(ev->object), 0);
+}
+
+EFL_START_TEST(efl_object_destruct_test)
+{
+ int var = 0;
+ Eo *obj;
+
+
+ obj = efl_add_ref(SIMPLE_CLASS, NULL);
+ fail_if(efl_ref_count(obj) != 1);
+ efl_event_callback_add(obj, EFL_EVENT_DEL, _destruct_test_del_cb, &var);
+ efl_event_callback_add(obj, EFL_EVENT_DESTRUCT, _destruct_test_destruct_cb, &var);
+ efl_unref(obj);
+
+ // var should be 2 if del then destruct, 0 otherwise
+ ck_assert_int_eq(var, 2);
+
+}
+EFL_END_TEST
static void
_auto_unref_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
@@ -1725,16 +1743,15 @@ _auto_unref_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
*((int *) data) = 1;
}
-START_TEST(efl_object_auto_unref_test)
+EFL_START_TEST(efl_object_auto_unref_test)
{
int _auto_unref_del;
Eo *obj, *parent;
- efl_object_init();
// Test unref after valid call
_auto_unref_del = 0;
- obj = efl_add(SIMPLE_CLASS, NULL);
+ obj = efl_add_ref(SIMPLE_CLASS, NULL);
fail_if(efl_ref_count(obj) != 1);
efl_event_callback_add(obj, EFL_EVENT_DEL, _auto_unref_del_cb, &_auto_unref_del);
___efl_auto_unref_set(obj, 1);
@@ -1745,7 +1762,7 @@ START_TEST(efl_object_auto_unref_test)
// Test unref after invalid call
_auto_unref_del = 0;
- obj = efl_add(SIMPLE_CLASS, NULL);
+ obj = efl_add_ref(SIMPLE_CLASS, NULL);
fail_if(efl_ref_count(obj) != 1);
efl_event_callback_add(obj, EFL_EVENT_DEL, _auto_unref_del_cb, &_auto_unref_del);
___efl_auto_unref_set(obj, 1);
@@ -1756,7 +1773,7 @@ START_TEST(efl_object_auto_unref_test)
// Same with a parent
_auto_unref_del = 0;
- parent = efl_add(SIMPLE_CLASS, NULL);
+ parent = efl_add_ref(SIMPLE_CLASS, NULL);
obj = efl_add(SIMPLE_CLASS, parent);
fail_if(efl_ref_count(obj) != 1);
efl_allow_parent_unref_set(obj, 1);
@@ -1766,11 +1783,10 @@ START_TEST(efl_object_auto_unref_test)
fail_if(efl_ref_count(obj) != 1);
efl_name_set(obj, "name");
fail_if(!_auto_unref_del);
- efl_del(parent);
+ efl_unref(parent);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
void eo_test_general(TCase *tc)
{
@@ -1797,5 +1813,6 @@ void eo_test_general(TCase *tc)
tcase_add_test(tc, eo_rec_interface);
tcase_add_test(tc, eo_domain);
tcase_add_test(tc, efl_cast_test);
+ tcase_add_test(tc, efl_object_destruct_test);
tcase_add_test(tc, efl_object_auto_unref_test);
}
diff --git a/src/tests/eo/suite/eo_test_init.c b/src/tests/eo/suite/eo_test_init.c
index 1f82be4a07..cee49211e1 100644
--- a/src/tests/eo/suite/eo_test_init.c
+++ b/src/tests/eo/suite/eo_test_init.c
@@ -7,24 +7,21 @@
#include "eo_suite.h"
#include "eo_test_class_simple.h"
-START_TEST(eo_test_simple)
+EFL_START_TEST(eo_test_simple)
{
fail_if(!efl_object_init()); /* one init by test suite */
- fail_if(!efl_object_init());
fail_if(!efl_object_shutdown());
- fail_if(efl_object_shutdown());
}
-END_TEST
+EFL_END_TEST
-START_TEST(eo_test_init_shutdown)
+EFL_START_TEST(eo_test_init_shutdown)
{
Eo *obj;
- fail_if(!efl_object_init());
ck_assert_str_eq("Efl.Object", efl_class_name_get(EFL_OBJECT_CLASS));
/* XXX-1: Essential for the next test to assign the wrong op. */
- obj = efl_add(SIMPLE_CLASS, NULL);
+ obj = efl_add_ref(SIMPLE_CLASS, NULL);
simple_a_set(obj, 1);
ck_assert_int_eq(1, simple_a_get(obj));
@@ -38,9 +35,8 @@ START_TEST(eo_test_init_shutdown)
/* XXX-1: Verify that the op was not cached. */
ck_assert_int_eq(0xBEEF, simple2_class_beef_get(SIMPLE2_CLASS));
- fail_if(efl_object_shutdown());
}
-END_TEST
+EFL_END_TEST
void eo_test_init(TCase *tc)
{
diff --git a/src/tests/eo/suite/eo_test_lifecycle.c b/src/tests/eo/suite/eo_test_lifecycle.c
new file mode 100644
index 0000000000..b0c67bca45
--- /dev/null
+++ b/src/tests/eo/suite/eo_test_lifecycle.c
@@ -0,0 +1,172 @@
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdio.h>
+
+#include <Eo.h>
+
+#include "eo_suite.h"
+#include "eo_test_class_simple.h"
+
+EFL_START_TEST(eo_test_base_del)
+{
+ Eo *par = efl_add_ref(SIMPLE_CLASS, NULL);
+ Eo *obj = efl_add(SIMPLE_CLASS, par);
+
+ efl_del(obj);
+
+ ck_assert_ptr_eq(efl_class_name_get(obj), NULL);
+
+}
+EFL_END_TEST
+
+EFL_START_TEST(eo_test_base_unref)
+{
+ Eo *obj = efl_add_ref(SIMPLE_CLASS, NULL);
+
+ efl_unref(obj);
+
+ ck_assert_ptr_eq(efl_class_name_get(obj), NULL);
+
+}
+EFL_END_TEST
+
+typedef struct {
+ unsigned int time, del_time, invalidate_time, noref_time, destruct_time;
+} Helper;
+
+static void
+_invalidate(void *data, const Efl_Event *ev)
+{
+ Helper *help = data;
+
+ ck_assert_ptr_ne(efl_parent_get(ev->object), NULL);
+
+ help->invalidate_time = help->time;
+ help->time ++;
+}
+
+static void
+_noref(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Helper *help = data;
+
+ help->noref_time = help->time;
+ help->time ++;
+}
+
+static void
+_del(void *data, const Efl_Event *ev)
+{
+ Helper *help = data;
+
+ ck_assert_ptr_eq(efl_parent_get(ev->object), NULL);
+
+ help->del_time = help->time;
+ help->time ++;
+}
+
+static void
+_destruct(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Helper *help = data;
+
+ help->destruct_time = help->time;
+ help->time ++;
+}
+
+EFL_START_TEST(eo_test_shutdown_eventting)
+{
+ Eo *par = efl_add_ref(SIMPLE_CLASS, NULL);
+ Eo *obj = efl_add(SIMPLE_CLASS, par);
+ Helper data;
+
+ data.time = 1;
+ data.del_time = 0;
+ data.invalidate_time = 0;
+ data.noref_time = 0;
+ data.destruct_time = 0;
+
+ efl_event_callback_add(obj, EFL_EVENT_DEL, _del, &data);
+ efl_event_callback_add(obj, EFL_EVENT_INVALIDATE, _invalidate, &data);
+ efl_event_callback_add(obj, EFL_EVENT_NOREF, _noref, &data);
+ efl_event_callback_add(obj, EFL_EVENT_DESTRUCT, _destruct, &data);
+
+ efl_del(obj);
+
+ //documented assertions:
+ ck_assert_int_ne(data.del_time, 0);
+ ck_assert_int_ne(data.invalidate_time, 0);
+ ck_assert_int_ne(data.noref_time, 0);
+ ck_assert_int_ne(data.destruct_time, 0);
+
+ //everything happened before destruct
+ ck_assert_int_lt(data.del_time, data.destruct_time);
+ ck_assert_int_lt(data.invalidate_time, data.destruct_time);
+ ck_assert_int_lt(data.noref_time, data.destruct_time);
+
+ //invalidate has to happen before the destructor
+ ck_assert_int_lt(data.invalidate_time, data.destruct_time);
+
+ ck_assert_ptr_eq(efl_class_name_get(obj), NULL);
+
+}
+EFL_END_TEST
+
+static void
+_noref2(void *data EINA_UNUSED, const Efl_Event *ev)
+{
+ //correctly delete this
+ efl_del(ev->object);
+ //error unref
+ efl_unref(ev->object);
+}
+
+EFL_START_TEST(eo_test_del_in_noref)
+{
+ Eo *par = efl_add_ref(SIMPLE_CLASS, NULL);
+ Eo *obj = efl_add(SIMPLE_CLASS, par);
+
+ efl_event_callback_add(obj, EFL_EVENT_NOREF, _noref2, NULL);
+
+ efl_ref(obj);
+ DISABLE_ABORT_ON_CRITICAL_START;
+ efl_unref(obj); //this fires noref
+ DISABLE_ABORT_ON_CRITICAL_END;
+
+ ck_assert_ptr_eq(efl_class_name_get(obj), NULL);
+
+}
+EFL_END_TEST
+
+static void
+_noref3(void *data EINA_UNUSED, const Efl_Event *ev)
+{
+ //this is a wrong fixme
+ efl_unref(ev->object);
+}
+
+EFL_START_TEST(eo_test_unref_noref)
+{
+ Eo *obj = efl_add_ref(SIMPLE_CLASS, NULL);
+
+ efl_event_callback_add(obj, EFL_EVENT_NOREF, _noref3, NULL);
+
+ DISABLE_ABORT_ON_CRITICAL_START;
+ efl_unref(obj);
+ DISABLE_ABORT_ON_CRITICAL_END;
+
+ ck_assert_ptr_eq(efl_class_name_get(obj), NULL);
+
+}
+EFL_END_TEST
+
+void eo_test_lifecycle(TCase *tc)
+{
+ tcase_add_test(tc, eo_test_base_del);
+ tcase_add_test(tc, eo_test_base_unref);
+ tcase_add_test(tc, eo_test_shutdown_eventting);
+ tcase_add_test(tc, eo_test_del_in_noref);
+ tcase_add_test(tc, eo_test_unref_noref);
+}
diff --git a/src/tests/eo/suite/eo_test_threaded_calls.c b/src/tests/eo/suite/eo_test_threaded_calls.c
index bbbc3746ca..411eb4536f 100644
--- a/src/tests/eo/suite/eo_test_threaded_calls.c
+++ b/src/tests/eo/suite/eo_test_threaded_calls.c
@@ -99,7 +99,7 @@ _thread_job(void *data, Eina_Thread t EINA_UNUSED)
fail_if(EINA_LOCK_SUCCEED != eina_spinlock_take(&locks[0]));
}
- obj = efl_add(THREAD_TEST_CLASS, NULL, thread_test_constructor(efl_added, v));
+ obj = efl_add_ref(THREAD_TEST_CLASS, NULL, thread_test_constructor(efl_added, v));
thread_test_try_swap_stack(obj);
v = thread_test_v_get(obj);
@@ -111,11 +111,10 @@ _thread_job(void *data, Eina_Thread t EINA_UNUSED)
return (void *) (uintptr_t) v;
}
-START_TEST(eo_threaded_calls_test)
+EFL_START_TEST(eo_threaded_calls_test)
{
Eina_Thread threads[2];
- efl_object_init();
fail_if(!eina_spinlock_new(&locks[0]));
fail_if(!eina_spinlock_new(&locks[1]));
@@ -133,9 +132,8 @@ START_TEST(eo_threaded_calls_test)
eina_barrier_free(&barrier);
eina_barrier_free(&barrier0);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
void eo_test_threaded_calls(TCase *tc)
{
diff --git a/src/tests/eo/suite/eo_test_value.c b/src/tests/eo/suite/eo_test_value.c
index 7daaf60c47..515ae79d8e 100644
--- a/src/tests/eo/suite/eo_test_value.c
+++ b/src/tests/eo/suite/eo_test_value.c
@@ -9,15 +9,14 @@
#include "eo_suite.h"
#include "eo_test_class_simple.h"
-START_TEST(eo_value)
+EFL_START_TEST(eo_value)
{
- efl_object_init();
char *str, *str2;
Eina_Value val2, eo_val;
void *tmpp = NULL;
Efl_Dbg_Info *eo_dbg_info;
- Eo *obj = efl_add(SIMPLE_CLASS, NULL);
+ Eo *obj = efl_add_ref(SIMPLE_CLASS, NULL);
eo_dbg_info = EFL_DBG_INFO_LIST_APPEND(NULL, "Root");
efl_dbg_info_get(obj, eo_dbg_info);
@@ -45,9 +44,8 @@ START_TEST(eo_value)
efl_dbg_info_free(eo_dbg_info);
efl_unref(obj);
- efl_object_shutdown();
}
-END_TEST
+EFL_END_TEST
void eo_test_value(TCase *tc)
{
diff --git a/src/tests/eo_cxx/eo_cxx_suite.cc b/src/tests/eo_cxx/eo_cxx_suite.cc
index 2362d38359..11e014ffff 100644
--- a/src/tests/eo_cxx/eo_cxx_suite.cc
+++ b/src/tests/eo_cxx/eo_cxx_suite.cc
@@ -6,7 +6,6 @@
#include "../efl_check.h"
static const Efl_Test_Case etc[] = {
- { "Promise", eo_cxx_test_promise },
{ NULL, NULL }
};
@@ -21,7 +20,7 @@ main(int argc, char* argv[])
putenv(const_cast<char*>("EFL_RUN_IN_TREE=1"));
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
- "Eo C++", etc);
+ "Eo C++", etc, NULL, NULL);
return (failed_count == 0) ? 0 : 255;
}
diff --git a/src/tests/eo_cxx/eo_cxx_suite.h b/src/tests/eo_cxx/eo_cxx_suite.h
index a5a1d6147c..0645b878ff 100644
--- a/src/tests/eo_cxx/eo_cxx_suite.h
+++ b/src/tests/eo_cxx/eo_cxx_suite.h
@@ -5,7 +5,6 @@
#include <algorithm>
#include <check.h>
-
-void eo_cxx_test_promise(TCase* tc);
+#include "../efl_check.h"
#endif /* _EINA_CXX_SUITE_H */
diff --git a/src/tests/eo_cxx/eo_cxx_test_promise.cc b/src/tests/eo_cxx/eo_cxx_test_promise.cc
deleted file mode 100644
index 642c9c00c4..0000000000
--- a/src/tests/eo_cxx/eo_cxx_test_promise.cc
+++ /dev/null
@@ -1,1001 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <Eina.hh>
-#include <Eo.hh>
-#include <Ecore.hh>
-
-#include "eo_cxx_suite.h"
-
-START_TEST(eo_cxx_future_construct_and_destroy)
-{
- Efl_Promise *p;
- Efl_Future *f;
-
- ecore_init();
-
- {
- p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p);
-
- f = efl_promise_future_get(p);
- fail_if(!f);
-
- efl::shared_future<int> future(efl_ref(f));
- }
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(eo_cxx_future_wait)
-{
- Efl_Promise *p;
- Efl_Future *f;
-
- ecore_init();
-
- p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p);
-
- f = efl_promise_future_get(p);
- fail_if(!f);
-
- {
- efl::shared_future<int> future(efl_ref(f));
-
- std::thread thread([&]
- {
- efl::ecore::main_loop_thread_safe_call_sync([]{}); // wait for ecore_main_loop_begin() call to start
- efl::ecore::main_loop_thread_safe_call_async
- ([&]
- {
- int* i = static_cast<int*>(malloc(sizeof(int)));
- *i = 5;
- efl_promise_value_set(p, i, & ::free);
- });
-
- future.wait();
- efl::ecore::main_loop_thread_safe_call_sync([] { ecore_main_loop_quit(); });
- });
-
- ecore_main_loop_begin();
-
- thread.join();
- }
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(eo_cxx_future_get)
-{
- Efl_Promise *p;
- Efl_Future *f;
-
- ecore_init();
-
- p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p);
-
- f = efl_promise_future_get(p);
- fail_if(!f);
-
- {
- efl::shared_future<int> future(efl_ref(f));
-
- std::thread thread([&]
- {
- efl::ecore::main_loop_thread_safe_call_sync([]{}); // wait for ecore_main_loop_begin() call to start
- efl::ecore::main_loop_thread_safe_call_async
- ([&]
- {
- int* i = static_cast<int*>(malloc(sizeof(int)));
- *i = 5;
- efl_promise_value_set(p, i, & ::free);
- });
-
- int i = future.get();
- ck_assert_int_eq(i, 5);
- efl::ecore::main_loop_thread_safe_call_sync([] { ecore_main_loop_quit(); });
- });
-
- ecore_main_loop_begin();
-
- thread.join();
- }
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(eo_cxx_future_get_error)
-{
- Efl_Promise *p;
- Efl_Future *f;
-
- ecore_init();
-
- p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p);
-
- f = efl_promise_future_get(p);
- fail_if(!f);
-
- {
- efl::shared_future<int> future(efl_ref(f));
-
- std::thread thread([&]
- {
- efl::ecore::main_loop_thread_safe_call_sync([]{}); // wait for ecore_main_loop_begin() call to start
- efl::ecore::main_loop_thread_safe_call_async
- ([&]
- {
- efl_promise_failed_set(p, ENOMEM);
- });
-
- try {
- future.get();
- ck_abort_msg("Execution should not have continued, exception expected");
- }
- catch(std::system_error const& e)
- {
- }
- efl::ecore::main_loop_thread_safe_call_sync([] { ecore_main_loop_quit(); });
- });
-
- ecore_main_loop_begin();
-
- thread.join();
- }
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(eo_cxx_future_then_value)
-{
- Efl_Promise *promise;
- Efl_Future *f;
-
- ecore_init();
-
- promise = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!promise);
-
- f = efl_promise_future_get(promise);
- fail_if(!f);
-
- {
- efl::shared_future<int> future(efl_ref(f)), rfuture;
-
-
- std::thread thread
- ([&]
- {
- efl::ecore::main_loop_thread_safe_call_sync
- ([&]
- {
- rfuture = then
- (future, [] (int i) -> int
- {
- ck_assert_int_eq(i, 5);
- return 42;
- }, [] (std::error_code)
- {
- throw std::bad_alloc();
- });
- });
- efl::ecore::main_loop_thread_safe_call_async
- ([&]
- {
- int* i = static_cast<int*>(malloc(sizeof(int)));
- *i = 5;
- efl_promise_value_set(promise, i, &::free);
- });
-
- int i = rfuture.get();
- ck_assert_int_eq(i, 42);
- efl::ecore::main_loop_thread_safe_call_sync([] { ecore_main_loop_quit(); });
- });
-
- ecore_main_loop_begin();
- thread.join();
- }
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(eo_cxx_future_composite_construct_and_destroy)
-{
- ecore_init();
-
- {
- Efl_Promise *p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p1);
-
- Efl_Future *f1 = efl_promise_future_get(p1);
- fail_if(!f1);
-
- Efl_Promise *p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p1);
-
- Efl_Future *f2 = efl_promise_future_get(p2);
- fail_if(!f2);
-
- Efl_Future *f3 = efl_future_all(f1, f2);
- fail_if(!f3);
-
- efl::shared_future<int> future1(efl_ref(f1))
- , future2(efl_ref(f2));
- efl::shared_future<int, int> future3(efl_ref(f3));
- }
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(eo_cxx_future_composite_wait)
-{
- ecore_init();
-
- {
- Efl_Promise *p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p1);
-
- Efl_Future* f1 = efl_promise_future_get(p1);
- fail_if(!f1);
-
- Efl_Promise *p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p2);
-
- Efl_Future* f2 = efl_promise_future_get(p2);
- fail_if(!f2);
-
- Efl_Future *f3 = efl_future_all(f1, f2);
- fail_if(!f3);
-
- efl::shared_future<int> future1(efl_ref(f1))
- , future2(efl_ref(f2));
- efl::shared_future<int, int> future3(efl_ref(f3));
-
- std::thread thread([&]
- {
- efl::ecore::main_loop_thread_safe_call_sync([]{}); // wait for ecore_main_loop_begin() call to start
- efl::ecore::main_loop_thread_safe_call_async
- ([&]
- {
- int* i1 = static_cast<int*>(malloc(sizeof(int)));
- *i1 = 5;
- efl_promise_value_set(p1, i1, & ::free);
- int* i2 = static_cast<int*>(malloc(sizeof(int)));
- *i2 = 42;
- efl_promise_value_set(p2, i2, & ::free);
- });
-
- future3.wait();
- efl::ecore::main_loop_thread_safe_call_sync([] { ecore_main_loop_quit(); });
- });
-
- ecore_main_loop_begin();
-
- thread.join();
- }
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(eo_cxx_future_composite_get)
-{
- ecore_init();
-
- {
- Efl_Promise *p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p1);
-
- Efl_Future *f1 = efl_promise_future_get(p1);
- fail_if(!f1);
-
- Efl_Promise *p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p2);
-
- Efl_Future *f2 = efl_promise_future_get(p2);
- fail_if(!f2);
-
- Efl_Future *f3 = efl_future_all(f1, f2);
- fail_if(!f3);
-
- efl::shared_future<int> future1(efl_ref(f1))
- , future2(efl_ref(f2));
- efl::shared_future<int, int> future3(efl_ref(f3));
-
- std::thread thread([&]
- {
- efl::ecore::main_loop_thread_safe_call_sync([]{}); // wait for ecore_main_loop_begin() call to start
- efl::ecore::main_loop_thread_safe_call_async
- ([&]
- {
- int* i1 = static_cast<int*>(malloc(sizeof(int)));
- *i1 = 5;
- efl_promise_value_set(p1, i1, & ::free);
- int* i2 = static_cast<int*>(malloc(sizeof(int)));
- *i2 = 42;
- efl_promise_value_set(p2, i2, & ::free);
- });
-
- std::tuple<int, int> tuple = future3.get();
- ck_assert_int_eq(std::get<0>(tuple), 5);
- ck_assert_int_eq(std::get<1>(tuple), 42);
- efl::ecore::main_loop_thread_safe_call_sync([] { ecore_main_loop_quit(); });
- });
-
- ecore_main_loop_begin();
-
- thread.join();
- }
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(eo_cxx_future_composite_then_value)
-{
-
- ecore_init();
-
- {
- Efl_Promise *p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p1);
-
- Efl_Future *f1 = efl_promise_future_get(p1);
- fail_if(!f1);
-
- Efl_Promise *p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p2);
-
- Efl_Future *f2 = efl_promise_future_get(p2);
- fail_if(!f2);
-
- Efl_Future *f3 = efl_future_all(f1, f2);
- fail_if(!f3);
-
- efl::shared_future<int, int> future(efl_ref(f3));
- efl::shared_future<int> rfuture;
-
- std::thread thread
- ([&]
- {
- efl::ecore::main_loop_thread_safe_call_sync
- ([&]
- {
- rfuture = then
- (future, [] (int i1, int i2) -> int
- {
- ck_assert_int_eq(i1, 5);
- ck_assert_int_eq(i2, 42);
- return 42;
- }, [] (std::error_code)
- {
- throw std::bad_alloc();
- });
- });
- efl::ecore::main_loop_thread_safe_call_async
- ([&]
- {
- int* i1 = static_cast<int*>(malloc(sizeof(int)));
- *i1 = 5;
- efl_promise_value_set(p1, i1, &::free);
- int* i2 = static_cast<int*>(malloc(sizeof(int)));
- *i2 = 42;
- efl_promise_value_set(p2, i2, &::free);
- });
-
- int i;
- i = rfuture.get();
- ck_assert_int_eq(i, 42);
- efl::ecore::main_loop_thread_safe_call_sync([] { ecore_main_loop_quit(); });
- });
-
- ecore_main_loop_begin();
- thread.join();
- }
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(eo_cxx_future_all_construct_and_destroy)
-{
- ecore_init();
-
- {
- Efl_Promise *p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p1);
-
- Efl_Future *f1 = efl_promise_future_get(p1);
- fail_if(!f1);
-
- Efl_Promise *p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p1);
-
- Efl_Future *f2 = efl_promise_future_get(p2);
- fail_if(!f2);
-
- Efl_Future *f3 = efl_future_all(f1, f2);
- fail_if(!f3);
-
- efl::shared_future<int> future1(efl_ref(f1))
- , future2(efl_ref(f2));
- efl::shared_future<int, int> future3 = all(future1, future2);
- }
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(eo_cxx_future_all_wait)
-{
- ecore_init();
-
- {
- Efl_Promise *p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p1);
-
- Efl_Future* f1 = efl_promise_future_get(p1);
- fail_if(!f1);
-
- Efl_Promise *p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p2);
-
- Efl_Future* f2 = efl_promise_future_get(p2);
- fail_if(!f2);
-
- efl::shared_future<int> future1(efl_ref(f1))
- , future2(efl_ref(f2));
- efl::shared_future<int, int> future3 = all(future1, future2);
-
- std::thread thread([&]
- {
- efl::ecore::main_loop_thread_safe_call_sync([]{}); // wait for ecore_main_loop_begin() call to start
- efl::ecore::main_loop_thread_safe_call_async
- ([&]
- {
- int* i1 = static_cast<int*>(malloc(sizeof(int)));
- *i1 = 5;
- efl_promise_value_set(p1, i1, & ::free);
- int* i2 = static_cast<int*>(malloc(sizeof(int)));
- *i2 = 42;
- efl_promise_value_set(p2, i2, & ::free);
- });
-
- future3.wait();
- efl::ecore::main_loop_thread_safe_call_sync([] { ecore_main_loop_quit(); });
- });
-
- ecore_main_loop_begin();
-
- thread.join();
- }
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(eo_cxx_future_all_get)
-{
- ecore_init();
-
- {
- Efl_Promise *p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p1);
-
- Efl_Future *f1 = efl_promise_future_get(p1);
- fail_if(!f1);
-
- Efl_Promise *p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p2);
-
- Efl_Future *f2 = efl_promise_future_get(p2);
- fail_if(!f2);
-
- efl::shared_future<int> future1(efl_ref(f1))
- , future2(efl_ref(f2));
- efl::shared_future<int, int> future3 = all(future1, future2);
-
- std::thread thread([&]
- {
- efl::ecore::main_loop_thread_safe_call_sync([]{}); // wait for ecore_main_loop_begin() call to start
- efl::ecore::main_loop_thread_safe_call_async
- ([&]
- {
- int* i1 = static_cast<int*>(malloc(sizeof(int)));
- *i1 = 5;
- efl_promise_value_set(p1, i1, & ::free);
- int* i2 = static_cast<int*>(malloc(sizeof(int)));
- *i2 = 42;
- efl_promise_value_set(p2, i2, & ::free);
- });
-
- std::tuple<int, int> tuple = future3.get();
- ck_assert_int_eq(std::get<0>(tuple), 5);
- ck_assert_int_eq(std::get<1>(tuple), 42);
- efl::ecore::main_loop_thread_safe_call_sync([] { ecore_main_loop_quit(); });
- });
-
- ecore_main_loop_begin();
-
- thread.join();
- }
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(eo_cxx_future_all_then_value)
-{
-
- ecore_init();
-
- {
- Efl_Promise *p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p1);
-
- Efl_Future *f1 = efl_promise_future_get(p1);
- fail_if(!f1);
-
- Efl_Promise *p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p2);
-
- Efl_Future *f2 = efl_promise_future_get(p2);
- fail_if(!f2);
-
- efl::shared_future<int> future1(efl_ref(f1)), future2(efl_ref(f2));
- efl::shared_future<int, int> future = all(future1, future2);
- efl::shared_future<int> rfuture;
-
- std::thread thread
- ([&]
- {
- efl::ecore::main_loop_thread_safe_call_sync
- ([&]
- {
- rfuture = then
- (future, [] (int i1, int i2) -> int
- {
- ck_assert_int_eq(i1, 5);
- ck_assert_int_eq(i2, 42);
- return 42;
- }, [] (std::error_code)
- {
- throw std::bad_alloc();
- });
- });
- efl::ecore::main_loop_thread_safe_call_async
- ([&]
- {
- int* i1 = static_cast<int*>(malloc(sizeof(int)));
- *i1 = 5;
- efl_promise_value_set(p1, i1, &::free);
- int* i2 = static_cast<int*>(malloc(sizeof(int)));
- *i2 = 42;
- efl_promise_value_set(p2, i2, &::free);
- });
-
- int i;
- i = rfuture.get();
- ck_assert_int_eq(i, 42);
- efl::ecore::main_loop_thread_safe_call_sync([] { ecore_main_loop_quit(); });
- });
-
- ecore_main_loop_begin();
- thread.join();
- }
- ecore_shutdown();
-}
-END_TEST
-
-// race
-START_TEST(eo_cxx_future_race_construct_and_destroy)
-{
- ecore_init();
-
- {
- Efl_Promise *p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p1);
-
- Efl_Future *f1 = efl_promise_future_get(p1);
- fail_if(!f1);
-
- Efl_Promise *p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p1);
-
- Efl_Future *f2 = efl_promise_future_get(p2);
- fail_if(!f2);
-
- efl::shared_future<int> future1(efl_ref(f1)), future2(efl_ref(f2));
- efl::shared_future<double> future3(efl_ref(f2));
- efl::shared_race_future<int> race1 = race(future1, future2);
- efl::shared_race_future<efl::eina::variant<int, double>> race2 = race(future1, future3);
- }
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(eo_cxx_future_race_wait)
-{
- ecore_init();
-
- {
- Efl_Promise *p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p1);
-
- Efl_Future* f1 = efl_promise_future_get(p1);
- fail_if(!f1);
-
- Efl_Promise *p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p2);
-
- Efl_Future* f2 = efl_promise_future_get(p2);
- fail_if(!f2);
-
- efl::shared_future<int> future1(efl_ref(f1))
- , future2(efl_ref(f2));
- efl::shared_race_future<int> future3 = race(future1, future2);
-
- std::thread thread([&]
- {
- efl::ecore::main_loop_thread_safe_call_sync([]{}); // wait for ecore_main_loop_begin() call to start
- efl::ecore::main_loop_thread_safe_call_async
- ([&]
- {
- int* i1 = static_cast<int*>(malloc(sizeof(int)));
- *i1 = 5;
- efl_promise_value_set(p1, i1, & ::free);
- });
-
- future3.wait();
- efl::ecore::main_loop_thread_safe_call_sync([] { ecore_main_loop_quit(); });
- });
-
- ecore_main_loop_begin();
-
- thread.join();
- }
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(eo_cxx_future_race_get)
-{
- ecore_init();
-
- {
- Efl_Promise *p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p1);
-
- Efl_Future *f1 = efl_promise_future_get(p1);
- fail_if(!f1);
-
- Efl_Promise *p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p2);
-
- Efl_Future *f2 = efl_promise_future_get(p2);
- fail_if(!f2);
-
- efl::shared_future<int> future1(efl_ref(f1))
- , future2(efl_ref(f2));
- efl::shared_race_future<int> future3 = race(future1, future2);
-
- std::thread thread([&]
- {
- efl::ecore::main_loop_thread_safe_call_sync([]{}); // wait for ecore_main_loop_begin() call to start
- efl::ecore::main_loop_thread_safe_call_async
- ([&]
- {
- int* i1 = static_cast<int*>(malloc(sizeof(int)));
- *i1 = 5;
- efl_promise_value_set(p1, i1, & ::free);
- });
-
- int value = future3.get();
- ck_assert_int_eq(value, 5);
- efl::ecore::main_loop_thread_safe_call_sync([] { ecore_main_loop_quit(); });
- });
-
- ecore_main_loop_begin();
-
- thread.join();
- }
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(eo_cxx_future_race_then_value)
-{
-
- ecore_init();
-
- {
- Efl_Promise *p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p1);
-
- Efl_Future *f1 = efl_promise_future_get(p1);
- fail_if(!f1);
-
- Efl_Promise *p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p2);
-
- Efl_Future *f2 = efl_promise_future_get(p2);
- fail_if(!f2);
-
- efl::shared_future<int> future1(efl_ref(f1)), future2(efl_ref(f2));
- efl::shared_race_future<int> future = race(future1, future2);
- efl::shared_future<int> rfuture;
-
- std::thread thread
- ([&]
- {
- efl::ecore::main_loop_thread_safe_call_sync
- ([&]
- {
- rfuture = then
- (future, [] (int i) -> int
- {
- ck_assert_int_eq(i, 5);
- return 42;
- }, [] (std::error_code)
- {
- throw std::bad_alloc();
- });
- });
- efl::ecore::main_loop_thread_safe_call_async
- ([&]
- {
- int* i1 = static_cast<int*>(malloc(sizeof(int)));
- *i1 = 5;
- efl_promise_value_set(p1, i1, &::free);
- });
-
- int i;
- i = rfuture.get();
- ck_assert_int_eq(i, 42);
- efl::ecore::main_loop_thread_safe_call_sync([] { ecore_main_loop_quit(); });
- });
-
- ecore_main_loop_begin();
- thread.join();
- }
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(eo_cxx_future_race_variant_get)
-{
- ecore_init();
-
- {
- Efl_Promise *p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p1);
-
- Efl_Future *f1 = efl_promise_future_get(p1);
- fail_if(!f1);
-
- Efl_Promise *p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p2);
-
- Efl_Future *f2 = efl_promise_future_get(p2);
- fail_if(!f2);
-
- efl::shared_future<int> future1(efl_ref(f1));
- efl::shared_future<double> future2(efl_ref(f2));
- efl::shared_race_future<efl::eina::variant<int, double>> future3 = race(future1, future2);
-
- std::thread thread([&]
- {
- efl::ecore::main_loop_thread_safe_call_sync([]{}); // wait for ecore_main_loop_begin() call to start
- efl::ecore::main_loop_thread_safe_call_async
- ([&]
- {
- int* i1 = static_cast<int*>(malloc(sizeof(int)));
- *i1 = 5;
- efl_promise_value_set(p1, i1, & ::free);
- });
-
- efl::eina::variant<int, double> value = future3.get();
- ck_assert(efl::eina::get<int>(&value) != nullptr);
- ck_assert_int_eq(efl::eina::get<int>(value), 5);
- efl::ecore::main_loop_thread_safe_call_sync([] { ecore_main_loop_quit(); });
- });
-
- ecore_main_loop_begin();
-
- thread.join();
- }
- ecore_shutdown();
-}
-END_TEST
-
-START_TEST(eo_cxx_future_race_variant_then_value)
-{
-
- ecore_init();
-
- {
- Efl_Promise *p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p1);
-
- Efl_Future *f1 = efl_promise_future_get(p1);
- fail_if(!f1);
-
- Efl_Promise *p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
- fail_if(!p2);
-
- Efl_Future *f2 = efl_promise_future_get(p2);
- fail_if(!f2);
-
- efl::shared_future<int> future1(efl_ref(f1));
- efl::shared_future<double> future2(efl_ref(f2));
- efl::shared_race_future<efl::eina::variant<int, double>> future = race(future1, future2);
- efl::shared_future<int> rfuture;
-
- std::thread thread
- ([&]
- {
- efl::ecore::main_loop_thread_safe_call_sync
- ([&]
- {
- rfuture = then
- (future, [] (efl::eina::variant<int, double> v) -> int
- {
- ck_assert(efl::eina::get<int>(&v) != nullptr);
- ck_assert_int_eq(efl::eina::get<int>(v), 5);
- return 42;
- }, [] (std::error_code)
- {
- throw std::bad_alloc();
- });
- });
- efl::ecore::main_loop_thread_safe_call_async
- ([&]
- {
- int* i1 = static_cast<int*>(malloc(sizeof(int)));
- *i1 = 5;
- efl_promise_value_set(p1, i1, &::free);
- });
-
- int i;
- i = rfuture.get();
- ck_assert_int_eq(i, 42);
- efl::ecore::main_loop_thread_safe_call_sync([] { ecore_main_loop_quit(); });
- });
-
- ecore_main_loop_begin();
- thread.join();
- }
- ecore_shutdown();
-}
-END_TEST
-
-template <typename...Args>
-void eo_cxx_promise_construct_and_destroy_impl()
-{
- ecore_init();
-
- {
- efl::promise<Args...> promise;
- efl::shared_future<Args...> f = promise.get_future();
- }
- ecore_shutdown();
-}
-
-START_TEST(eo_cxx_promise_construct_and_destroy)
-{
- eo_cxx_promise_construct_and_destroy_impl<int>();
-}
-END_TEST
-
-template <typename T>
-struct test_value_get;
-
-template <>
-struct test_value_get<int>
-{
- static int get() { return 5; }
-};
-
-template <typename T>
-void eo_cxx_promise_value_set_impl()
-{
- ecore_init();
-
- {
- efl::promise<T> promise;
- efl::shared_future<T> f = promise.get_future();
-
- std::thread thread
- ([&] {
- efl::ecore::main_loop_thread_safe_call_sync([]{}); // wait for ecore_main_loop_begin() call to start
- efl::ecore::main_loop_thread_safe_call_async
- ([&]
- {
- promise.set_value(test_value_get<T>::get());
- });
-
- T value = f.get();
- ck_assert_int_eq(value, test_value_get<T>::get());
- efl::ecore::main_loop_thread_safe_call_sync([] { ecore_main_loop_quit(); });
- });
-
- ecore_main_loop_begin();
-
- thread.join();
- }
- ecore_shutdown();
-}
-
-START_TEST(eo_cxx_promise_value_set)
-{
- eo_cxx_promise_value_set_impl<int>();
-}
-END_TEST
-
-template <typename T>
-void eo_cxx_promise_progress_set_impl()
-{
- ecore_init();
-
- {
- efl::promise<int, T> promise;
- efl::shared_future<int, efl::progress<T>> f = promise.get_future();
-
- on_progress
- (f, [&] (T const& value)
- {
- ck_assert_int_eq(value, test_value_get<T>::get());
- ecore_main_loop_quit();
- });
-
- std::thread thread
- ([&] {
- efl::ecore::main_loop_thread_safe_call_sync([]{}); // wait for ecore_main_loop_begin() call to start
- efl::ecore::main_loop_thread_safe_call_async
- ([&]
- {
- promise.set_progress(test_value_get<T>::get());
- });
- });
-
- ecore_main_loop_begin();
-
- thread.join();
- }
- ecore_shutdown();
-}
-
-START_TEST(eo_cxx_promise_progress_set)
-{
- eo_cxx_promise_progress_set_impl<int>();
-}
-END_TEST
-
-void
-eo_cxx_test_promise(TCase* tc)
-{
- tcase_add_test(tc, eo_cxx_future_construct_and_destroy);
- tcase_add_test(tc, eo_cxx_future_wait);
- tcase_add_test(tc, eo_cxx_future_get);
- tcase_add_test(tc, eo_cxx_future_get_error);
- tcase_add_test(tc, eo_cxx_future_then_value);
- tcase_add_test(tc, eo_cxx_future_composite_construct_and_destroy);
- tcase_add_test(tc, eo_cxx_future_composite_wait);
- tcase_add_test(tc, eo_cxx_future_composite_get);
- tcase_add_test(tc, eo_cxx_future_composite_then_value);
-
- tcase_add_test(tc, eo_cxx_future_all_construct_and_destroy);
- tcase_add_test(tc, eo_cxx_future_all_wait);
- tcase_add_test(tc, eo_cxx_future_all_get);
- tcase_add_test(tc, eo_cxx_future_all_then_value);
-
- tcase_add_test(tc, eo_cxx_future_race_construct_and_destroy);
- tcase_add_test(tc, eo_cxx_future_race_wait);
- tcase_add_test(tc, eo_cxx_future_race_get);
- tcase_add_test(tc, eo_cxx_future_race_then_value);
-
- tcase_add_test(tc, eo_cxx_future_race_variant_get);
- tcase_add_test(tc, eo_cxx_future_race_variant_then_value);
-
- tcase_add_test(tc, eo_cxx_promise_construct_and_destroy);
- tcase_add_test(tc, eo_cxx_promise_value_set);
- tcase_add_test(tc, eo_cxx_promise_progress_set);
-}
diff --git a/src/tests/eolian/data/class_simple_ref.c b/src/tests/eolian/data/class_simple_ref.c
index ea0fdac5ad..10fa96b038 100644
--- a/src/tests/eolian/data/class_simple_ref.c
+++ b/src/tests/eolian/data/class_simple_ref.c
@@ -4,7 +4,7 @@ Eina_Bool _class_simple_a_set(Eo *obj, Evas_Simple_Data *pd, int value);
EOAPI EFL_FUNC_BODYV(efl_canvas_object_simple_a_set, Eina_Bool, EINA_TRUE /* true */, EFL_FUNC_CALL(value), int value);
-int _class_simple_a_get(Eo *obj, Evas_Simple_Data *pd);
+int _class_simple_a_get(const Eo *obj, Evas_Simple_Data *pd);
EOAPI EFL_FUNC_BODY_CONST(efl_canvas_object_simple_a_get, int, 100);
diff --git a/src/tests/eolian/data/docs.eo b/src/tests/eolian/data/docs.eo
index 1f48af5a88..f6bea43744 100644
--- a/src/tests/eolian/data/docs.eo
+++ b/src/tests/eolian/data/docs.eo
@@ -81,6 +81,6 @@ class Docs {
}
}
events {
- clicked; [[Event docs.]]
+ clicked: void; [[Event docs.]]
}
}
diff --git a/src/tests/eolian/data/events.eo b/src/tests/eolian/data/events.eo
index ba49faaa43..a7aa2ef264 100644
--- a/src/tests/eolian/data/events.eo
+++ b/src/tests/eolian/data/events.eo
@@ -5,10 +5,10 @@ struct Evas_Event_Clicked_Double_Info {
class Events {
event_prefix: totally_not_events;
events {
- clicked @beta; [[Comment for clicked]]
+ clicked @beta: void; [[Comment for clicked]]
clicked,double: Evas_Event_Clicked_Double_Info; /* No comment */
- hot @hot;
- restart @restart;
- hot_restart @hot @restart;
+ hot @hot: void;
+ restart @restart: void;
+ hot_restart @hot @restart: void;
}
}
diff --git a/src/tests/eolian/data/object_impl_add_ref.c b/src/tests/eolian/data/object_impl_add_ref.c
index f97248aa27..1ccb10236d 100644
--- a/src/tests/eolian/data/object_impl_add_ref.c
+++ b/src/tests/eolian/data/object_impl_add_ref.c
@@ -14,7 +14,7 @@ _object_impl_a_set(Eo *obj, Object_Impl_Data *pd, const char *part, const Eina_L
}
EOLIAN static Eina_List *
-_object_impl_a_get(Eo *obj, Object_Impl_Data *pd, const char *part)
+_object_impl_a_get(const Eo *obj, Object_Impl_Data *pd, const char *part)
{
}
@@ -82,7 +82,7 @@ _object_impl_add_c_set(Eo *obj, Object_Impl_Data *pd, Eina_List *value)
}
EOLIAN static Eina_List *
-_object_impl_add_c_get(Eo *obj, Object_Impl_Data *pd)
+_object_impl_add_c_get(const Eo *obj, Object_Impl_Data *pd)
{
}
diff --git a/src/tests/eolian/data/object_impl_ref.c b/src/tests/eolian/data/object_impl_ref.c
index 335613af01..ddc0d7ccd5 100644
--- a/src/tests/eolian/data/object_impl_ref.c
+++ b/src/tests/eolian/data/object_impl_ref.c
@@ -14,7 +14,7 @@ _object_impl_a_set(Eo *obj, Object_Impl_Data *pd, const char *part, const Eina_L
}
EOLIAN static Eina_List *
-_object_impl_a_get(Eo *obj, Object_Impl_Data *pd, const char *part)
+_object_impl_a_get(const Eo *obj, Object_Impl_Data *pd, const char *part)
{
}
diff --git a/src/tests/eolian/data/override_ref.c b/src/tests/eolian/data/override_ref.c
index 95ee937ae0..a4b0c90d25 100644
--- a/src/tests/eolian/data/override_ref.c
+++ b/src/tests/eolian/data/override_ref.c
@@ -1,6 +1,6 @@
EOAPI EFL_VOID_FUNC_BODY(override_a_set);
-void _override_a_get(Eo *obj, Override_Data *pd);
+void _override_a_get(const Eo *obj, Override_Data *pd);
EOAPI EFL_VOID_FUNC_BODY_CONST(override_a_get);
@@ -13,7 +13,7 @@ static void __eolian_override_b_set(Eo *obj EINA_UNUSED, Override_Data *pd, int
EOAPI EFL_VOID_FUNC_BODYV(override_b_set, EFL_FUNC_CALL(idx, a, b, c), int idx, float a, char b, int c);
-void _override_b_get(Eo *obj, Override_Data *pd, int idx, float *a, char *b, int *c);
+void _override_b_get(const Eo *obj, Override_Data *pd, int idx, float *a, char *b, int *c);
EOAPI EFL_VOID_FUNC_BODYV_CONST(override_b_get, EFL_FUNC_CALL(idx, a, b, c), int idx, float *a, char *b, int *c);
@@ -21,7 +21,7 @@ void _override_c_set(Eo *obj, Override_Data *pd, int idx, int c);
EOAPI EFL_VOID_FUNC_BODYV(override_c_set, EFL_FUNC_CALL(idx, c), int idx, int c);
-static int __eolian_override_c_get(Eo *obj EINA_UNUSED, Override_Data *pd EINA_UNUSED, int idx EINA_UNUSED)
+static int __eolian_override_c_get(const Eo *obj EINA_UNUSED, Override_Data *pd EINA_UNUSED, int idx EINA_UNUSED)
{
return 50;
}
@@ -48,7 +48,7 @@ static void __eolian_override_base_z_set(Eo *obj EINA_UNUSED, Override_Data *pd,
}
-static void __eolian_override_base_z_get(Eo *obj EINA_UNUSED, Override_Data *pd, int *a, char *b, float *c)
+static void __eolian_override_base_z_get(const Eo *obj EINA_UNUSED, Override_Data *pd, int *a, char *b, float *c)
{
if (a) *a = pd->a;
if (b) *b = pd->b;
diff --git a/src/tests/eolian/eolian_generated_future.c b/src/tests/eolian/eolian_generated_future.c
index 5fb4202708..556f55a1db 100644
--- a/src/tests/eolian/eolian_generated_future.c
+++ b/src/tests/eolian/eolian_generated_future.c
@@ -11,51 +11,5 @@
struct Generated_Future_Data {};
typedef struct Generated_Future_Data Generated_Future_Data;
-static void _generated_future_method_progress_type(Eo *obj EINA_UNUSED, Generated_Future_Data *pd EINA_UNUSED,
- Efl_Future **future1 EINA_UNUSED)
-{
-}
-
-static Efl_Future * _generated_future_prop1_get(Eo *obj EINA_UNUSED, Generated_Future_Data *pd EINA_UNUSED)
-{
- return NULL;
-}
-
-static void _generated_future_prop2_get(Eo *obj EINA_UNUSED, Generated_Future_Data *pd EINA_UNUSED, int *i EINA_UNUSED,
- Efl_Future **future1 EINA_UNUSED)
-{
-}
-
-static void _generated_future_prop3_set(Eo *obj EINA_UNUSED, Generated_Future_Data *pd EINA_UNUSED,
- Efl_Future *future1 EINA_UNUSED)
-{
-}
-
-static void _generated_future_method1(Eo *obj EINA_UNUSED, Generated_Future_Data *pd EINA_UNUSED,
- Efl_Future **future1 EINA_UNUSED)
-{
-}
-
-static void _generated_future_method2(Eo *obj EINA_UNUSED, Generated_Future_Data *pd EINA_UNUSED,
- Efl_Future **future1 EINA_UNUSED)
-{
-}
-
-static void _generated_future_method3(Eo *obj EINA_UNUSED, Generated_Future_Data *pd EINA_UNUSED,
- Efl_Future *future1 EINA_UNUSED)
-{
- ck_assert(future1 != NULL);
-}
-
-static void _generated_future_method_multiple_args_1(Eo *obj EINA_UNUSED, Generated_Future_Data *pd EINA_UNUSED,
- Efl_Future **future1 EINA_UNUSED, void *data EINA_UNUSED)
-{
-}
-
-static void _generated_future_method_multiple_args_2(Eo *obj EINA_UNUSED, Generated_Future_Data *pd EINA_UNUSED,
- void *data EINA_UNUSED, Efl_Future **future1 EINA_UNUSED)
-{
-}
-
#include "generated_future.eo.h"
#include "generated_future.eo.c"
diff --git a/src/tests/eolian/eolian_generation.c b/src/tests/eolian/eolian_generation.c
index 785d73d434..5e5042d3e9 100644
--- a/src/tests/eolian/eolian_generation.c
+++ b/src/tests/eolian/eolian_generation.c
@@ -90,7 +90,7 @@ _eolian_gen_execute(const char *eo_filename, const char *options, const char *ou
return system(command);
}
-START_TEST(eolian_dev_impl_code)
+EFL_START_TEST(eolian_dev_impl_code)
{
char output_filepath[PATH_MAX] = "";
snprintf(output_filepath, PATH_MAX, "%s/eolian_object_impl",
@@ -104,9 +104,9 @@ START_TEST(eolian_dev_impl_code)
fail_if(0 != _eolian_gen_execute(TESTS_SRC_DIR"/data/object_impl_add.eo", "-gi", output_filepath));
fail_if(!_files_compare(TESTS_SRC_DIR"/data/object_impl_add_ref.c", output_filepath, "c"));
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_types_generation)
+EFL_START_TEST(eolian_types_generation)
{
char output_filepath[PATH_MAX] = "";
snprintf(output_filepath, PATH_MAX, "%s/eolian_typedef",
@@ -123,9 +123,9 @@ START_TEST(eolian_types_generation)
fail_if(0 != _eolian_gen_execute(TESTS_SRC_DIR"/data/struct.eo", "-gs", output_filepath));
fail_if(!_files_compare(TESTS_SRC_DIR"/data/struct_ref_stub.h", output_filepath, "eo.stub.h"));
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_default_values_generation)
+EFL_START_TEST(eolian_default_values_generation)
{
char output_filepath[PATH_MAX] = "";
snprintf(output_filepath, PATH_MAX, "%s/eolian_class_simple",
@@ -134,9 +134,9 @@ START_TEST(eolian_default_values_generation)
fail_if(0 != _eolian_gen_execute(TESTS_SRC_DIR"/data/class_simple.eo", "-gc", output_filepath));
fail_if(!_files_compare(TESTS_SRC_DIR"/data/class_simple_ref.c", output_filepath, "eo.c"));
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_override_generation)
+EFL_START_TEST(eolian_override_generation)
{
char output_filepath[PATH_MAX] = "";
snprintf(output_filepath, PATH_MAX, "%s/eolian_override",
@@ -145,9 +145,9 @@ START_TEST(eolian_override_generation)
fail_if(0 != _eolian_gen_execute(TESTS_SRC_DIR"/data/override.eo", "-gc", output_filepath));
fail_if(!_files_compare(TESTS_SRC_DIR"/data/override_ref.c", output_filepath, "eo.c"));
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_functions_descriptions)
+EFL_START_TEST(eolian_functions_descriptions)
{
char output_filepath[PATH_MAX] = "";
snprintf(output_filepath, PATH_MAX, "%s/eolian_class_simple",
@@ -159,9 +159,9 @@ START_TEST(eolian_functions_descriptions)
fail_if(0 != _eolian_gen_execute(TESTS_SRC_DIR"/data/class_simple.eo", "-gl", output_filepath));
fail_if(!_files_compare(TESTS_SRC_DIR"/data/class_simple_ref_legacy.h", output_filepath, "eo.legacy.h"));
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_import)
+EFL_START_TEST(eolian_import)
{
char output_filepath[PATH_MAX] = "";
snprintf(output_filepath, PATH_MAX, "%s/eolian_import_types",
@@ -170,9 +170,9 @@ START_TEST(eolian_import)
fail_if(0 != _eolian_gen_execute(TESTS_SRC_DIR"/data/import_types.eot", "-gh", output_filepath));
fail_if(!_files_compare(TESTS_SRC_DIR"/data/import_types_ref.h", output_filepath, "eot.h"));
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_docs)
+EFL_START_TEST(eolian_docs)
{
char output_filepath[PATH_MAX] = "";
snprintf(output_filepath, PATH_MAX, "%s/eolian_docs",
@@ -184,9 +184,9 @@ START_TEST(eolian_docs)
fail_if(0 != _eolian_gen_execute(TESTS_SRC_DIR"/data/docs.eo", "-gl", output_filepath));
fail_if(!_files_compare(TESTS_SRC_DIR"/data/docs_ref_legacy.h", output_filepath, "eo.legacy.h"));
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_function_pointers)
+EFL_START_TEST(eolian_function_pointers)
{
// .eot
@@ -215,9 +215,9 @@ START_TEST(eolian_function_pointers)
fail_if(0 != _eolian_gen_execute(TESTS_SRC_DIR"/data/function_as_argument.eo", "-gi", output_filepath));
fail_if(!_files_compare(TESTS_SRC_DIR"/data/function_as_argument_impl_ref.c", output_filepath, "c"));
}
-END_TEST
+EFL_END_TEST
-START_TEST(owning)
+EFL_START_TEST(owning)
{
char output_filepath[PATH_MAX] = "";
snprintf(output_filepath, PATH_MAX, "%s/eolian_owning",
@@ -227,7 +227,7 @@ START_TEST(owning)
fail_if(!_files_compare(TESTS_SRC_DIR"/data/owning.eo.c", output_filepath, "eo.c"));
}
-END_TEST
+EFL_END_TEST
void eolian_generation_test(TCase *tc)
{
diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c
index 8227a568f9..758ff9840e 100644
--- a/src/tests/eolian/eolian_parsing.c
+++ b/src/tests/eolian/eolian_parsing.c
@@ -10,7 +10,7 @@
#include "eolian_suite.h"
-START_TEST(eolian_namespaces)
+EFL_START_TEST(eolian_namespaces)
{
const Eolian_Class *class11, *class112, *class21, *class_no, *impl_class,
*iclass;
@@ -22,27 +22,26 @@ START_TEST(eolian_namespaces)
const Eolian_Unit *unit;
void *dummy;
- eolian_init();
- Eolian *eos = eolian_new();
+ Eolian_State *eos = eolian_state_new();
/* Parsing */
- fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
- fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/nmsp1_class1.eo")));
+ fail_if(!eolian_state_directory_add(eos, TESTS_SRC_DIR"/data"));
+ fail_if(!(unit = eolian_state_file_parse(eos, TESTS_SRC_DIR"/data/nmsp1_class1.eo")));
/* Classes existence */
- fail_if(!(class11 = eolian_class_get_by_name(unit, "nmsp1.class1")));
- fail_if(!(class112 = eolian_class_get_by_name(unit, "nmsp1.nmsp11.class2")));
- fail_if(!(class21 = eolian_class_get_by_name(unit, "nmsp2.class1")));
- fail_if(!(class_no = eolian_class_get_by_name(unit, "no_nmsp")));
+ fail_if(!(class11 = eolian_unit_class_by_name_get(unit, "nmsp1.class1")));
+ fail_if(!(class112 = eolian_unit_class_by_name_get(unit, "nmsp1.nmsp11.class2")));
+ fail_if(!(class21 = eolian_unit_class_by_name_get(unit, "nmsp2.class1")));
+ fail_if(!(class_no = eolian_unit_class_by_name_get(unit, "no_nmsp")));
/* Check names and namespaces*/
- fail_if(strcmp(eolian_class_name_get(class11), "class1"));
+ fail_if(strcmp(eolian_class_short_name_get(class11), "class1"));
fail_if(!(iter = eolian_class_namespaces_get(class11)));
fail_if(!(eina_iterator_next(iter, (void**)&val1)));
fail_if(eina_iterator_next(iter, &dummy));
fail_if(strcmp(val1, "nmsp1"));
eina_iterator_free(iter);
- fail_if(strcmp(eolian_class_name_get(class112), "class2"));
+ fail_if(strcmp(eolian_class_short_name_get(class112), "class2"));
fail_if(!(iter = eolian_class_namespaces_get(class112)));
fail_if(!(eina_iterator_next(iter, (void**)&val1)));
fail_if(!(eina_iterator_next(iter, (void**)&val2)));
@@ -51,14 +50,14 @@ START_TEST(eolian_namespaces)
fail_if(strcmp(val2, "nmsp11"));
eina_iterator_free(iter);
- fail_if(strcmp(eolian_class_name_get(class21), "class1"));
+ fail_if(strcmp(eolian_class_short_name_get(class21), "class1"));
fail_if(!(iter = eolian_class_namespaces_get(class21)));
fail_if(!(eina_iterator_next(iter, (void**)&val1)));
fail_if(eina_iterator_next(iter, &dummy));
fail_if(strcmp(val1, "nmsp2"));
eina_iterator_free(iter);
- fail_if(strcmp(eolian_class_name_get(class_no), "no_nmsp"));
+ fail_if(strcmp(eolian_class_short_name_get(class_no), "no_nmsp"));
fail_if(eolian_class_namespaces_get(class_no));
/* Inherits */
@@ -90,12 +89,11 @@ START_TEST(eolian_namespaces)
fail_if(eina_iterator_next(iter, &dummy));
eina_iterator_free(iter);
- eolian_free(eos);
- eolian_shutdown();
+ eolian_state_free(eos);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_events)
+EFL_START_TEST(eolian_events)
{
const Eolian_Class *class;
Eina_Iterator *iter;
@@ -105,14 +103,13 @@ START_TEST(eolian_events)
const Eolian_Unit *unit;
void *dummy;
- eolian_init();
- Eolian *eos = eolian_new();
+ Eolian_State *eos = eolian_state_new();
/* Parsing */
- fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
- fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/events.eo")));
+ fail_if(!eolian_state_directory_add(eos, TESTS_SRC_DIR"/data"));
+ fail_if(!(unit = eolian_state_file_parse(eos, TESTS_SRC_DIR"/data/events.eo")));
/* Class */
- fail_if(!(class = eolian_class_get_by_name(unit, "Events")));
+ fail_if(!(class = eolian_unit_class_by_name_get(unit, "Events")));
fail_if(strcmp(eolian_class_event_prefix_get(class), "totally_not_events"));
/* Events */
@@ -130,7 +127,7 @@ START_TEST(eolian_events)
fail_if(!(name = eolian_event_name_get(ev)));
fail_if(!(type = eolian_event_type_get(ev)));
fail_if(strcmp(name, "clicked,double"));
- type_name = eolian_type_name_get(type);
+ type_name = eolian_type_short_name_get(type);
fail_if(strcmp(type_name, "Evas_Event_Clicked_Double_Info"));
fail_if(eolian_event_is_beta(ev));
fail_if(eolian_event_is_hot(ev));
@@ -162,16 +159,15 @@ START_TEST(eolian_events)
fail_if(eina_iterator_next(iter, &dummy));
eina_iterator_free(iter);
- /* Check eolian_class_event_get_by_name */
- fail_if(!eolian_class_event_get_by_name(class, "clicked,double"));
- fail_if(eolian_class_event_get_by_name(class, "clicked,triple"));
+ /* Check eolian_class_event_by_name_get */
+ fail_if(!eolian_class_event_by_name_get(class, "clicked,double"));
+ fail_if(eolian_class_event_by_name_get(class, "clicked,triple"));
- eolian_free(eos);
- eolian_shutdown();
+ eolian_state_free(eos);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_override)
+EFL_START_TEST(eolian_override)
{
Eina_Iterator *iter;
const Eolian_Class *impl_class = NULL;
@@ -180,15 +176,14 @@ START_TEST(eolian_override)
const Eolian_Implement *impl;
const Eolian_Unit *unit;
- eolian_init();
- Eolian *eos = eolian_new();
+ Eolian_State *eos = eolian_state_new();
/* Parsing */
- fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
- fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/override.eo")));
+ fail_if(!eolian_state_directory_add(eos, TESTS_SRC_DIR"/data"));
+ fail_if(!(unit = eolian_state_file_parse(eos, TESTS_SRC_DIR"/data/override.eo")));
/* Class */
- fail_if(!(class = eolian_class_get_by_name(unit, "Override")));
- fail_if(!(base = eolian_class_get_by_name(unit, "Base")));
+ fail_if(!(class = eolian_unit_class_by_name_get(unit, "Override")));
+ fail_if(!(base = eolian_unit_class_by_name_get(unit, "Base")));
/* Implements */
fail_if(!(iter = eolian_class_implements_get(class)));
@@ -226,34 +221,31 @@ START_TEST(eolian_override)
eina_iterator_free(iter);
- eolian_free(eos);
- eolian_shutdown();
+ eolian_state_free(eos);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_consts)
+EFL_START_TEST(eolian_consts)
{
const Eolian_Function *fid = NULL;
const Eolian_Class *class;
const Eolian_Unit *unit;
- eolian_init();
- Eolian *eos = eolian_new();
+ Eolian_State *eos = eolian_state_new();
/* Parsing */
- fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
- fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/consts.eo")));
- fail_if(!(class = eolian_class_get_by_name(unit, "Consts")));
+ fail_if(!eolian_state_directory_add(eos, TESTS_SRC_DIR"/data"));
+ fail_if(!(unit = eolian_state_file_parse(eos, TESTS_SRC_DIR"/data/consts.eo")));
+ fail_if(!(class = eolian_unit_class_by_name_get(unit, "Consts")));
/* Method */
- fail_if(!(fid = eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD)));
+ fail_if(!(fid = eolian_class_function_by_name_get(class, "foo", EOLIAN_METHOD)));
fail_if(EINA_FALSE == eolian_function_object_is_const(fid));
- eolian_free(eos);
- eolian_shutdown();
+ eolian_state_free(eos);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_ctor_dtor)
+EFL_START_TEST(eolian_ctor_dtor)
{
Eina_Iterator *iter;
const Eolian_Class *impl_class = NULL;
@@ -264,13 +256,12 @@ START_TEST(eolian_ctor_dtor)
const Eolian_Unit *unit;
void *dummy;
- eolian_init();
- Eolian *eos = eolian_new();
+ Eolian_State *eos = eolian_state_new();
/* Parsing */
- fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
- fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/ctor_dtor.eo")));
- fail_if(!(class = eolian_class_get_by_name(unit, "Ctor_Dtor")));
- fail_if(!(base = eolian_class_get_by_name(unit, "Base")));
+ fail_if(!eolian_state_directory_add(eos, TESTS_SRC_DIR"/data"));
+ fail_if(!(unit = eolian_state_file_parse(eos, TESTS_SRC_DIR"/data/ctor_dtor.eo")));
+ fail_if(!(class = eolian_unit_class_by_name_get(unit, "Ctor_Dtor")));
+ fail_if(!(base = eolian_unit_class_by_name_get(unit, "Base")));
/* Class ctor/dtor */
fail_if(!eolian_class_ctor_enable_get(class));
@@ -297,7 +288,7 @@ START_TEST(eolian_ctor_dtor)
eina_iterator_free(iter);
/* Custom ctors/dtors */
- fail_if(!eolian_class_function_get_by_name(base, "destructor", EOLIAN_METHOD));
+ fail_if(!eolian_class_function_by_name_get(base, "destructor", EOLIAN_METHOD));
fail_if(!(iter = eolian_class_constructors_get(class)));
fail_if(!(eina_iterator_next(iter, (void**)&ctor)));
fail_if(eolian_constructor_is_optional(ctor));
@@ -318,12 +309,11 @@ START_TEST(eolian_ctor_dtor)
fail_if(eina_iterator_next(iter, &dummy));
eina_iterator_free(iter);
- eolian_free(eos);
- eolian_shutdown();
+ eolian_state_free(eos);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_typedef)
+EFL_START_TEST(eolian_typedef)
{
const Eolian_Type *type = NULL;
const Eolian_Typedecl *tdl = NULL;
@@ -333,63 +323,62 @@ START_TEST(eolian_typedef)
const Eolian_Unit *unit;
const char *file;
- eolian_init();
- Eolian *eos = eolian_new();
+ Eolian_State *eos = eolian_state_new();
/* Parsing */
- fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
- fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/typedef.eo")));
+ fail_if(!eolian_state_directory_add(eos, TESTS_SRC_DIR"/data"));
+ fail_if(!(unit = eolian_state_file_parse(eos, TESTS_SRC_DIR"/data/typedef.eo")));
/* Check that the class Dummy is still readable */
- fail_if(!(class = eolian_class_get_by_name(unit, "Typedef")));
- fail_if(!eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD));
+ fail_if(!(class = eolian_unit_class_by_name_get(unit, "Typedef")));
+ fail_if(!eolian_class_function_by_name_get(class, "foo", EOLIAN_METHOD));
/* Basic type */
- fail_if(!(tdl = eolian_typedecl_alias_get_by_name(unit, "Evas.Coord")));
+ fail_if(!(tdl = eolian_unit_alias_by_name_get(unit, "Evas.Coord")));
fail_if(eolian_typedecl_type_get(tdl) != EOLIAN_TYPEDECL_ALIAS);
- fail_if(!(type_name = eolian_typedecl_name_get(tdl)));
+ fail_if(!(type_name = eolian_typedecl_short_name_get(tdl)));
fail_if(strcmp(type_name, "Coord"));
- fail_if(!(type_name = eolian_typedecl_c_type_get(unit, tdl)));
+ fail_if(!(type_name = eolian_typedecl_c_type_get(tdl)));
fail_if(strcmp(type_name, "typedef int Evas_Coord"));
eina_stringshare_del(type_name);
fail_if(!(type = eolian_typedecl_base_type_get(tdl)));
- fail_if(!(type_name = eolian_type_name_get(type)));
+ fail_if(!(type_name = eolian_type_short_name_get(type)));
fail_if(eolian_type_is_owned(type));
fail_if(eolian_type_is_const(type));
fail_if(eolian_type_base_type_get(type));
fail_if(strcmp(type_name, "int"));
/* File */
- fail_if(!(file = eolian_typedecl_file_get(tdl)));
+ fail_if(!(file = eolian_object_file_get((const Eolian_Object *)tdl)));
fail_if(strcmp(file, "typedef.eo"));
/* Lowest alias base */
- fail_if(!(tdl = eolian_typedecl_alias_get_by_name(unit, "Evas.Coord3")));
- fail_if(!(type = eolian_typedecl_aliased_base_get(unit, tdl)));
- fail_if(strcmp(eolian_type_name_get(type), "int"));
+ fail_if(!(tdl = eolian_unit_alias_by_name_get(unit, "Evas.Coord3")));
+ fail_if(!(type = eolian_typedecl_aliased_base_get(tdl)));
+ fail_if(strcmp(eolian_type_short_name_get(type), "int"));
/* Complex type */
- fail_if(!(tdl = eolian_typedecl_alias_get_by_name(unit, "List_Objects")));
- fail_if(!(type_name = eolian_typedecl_name_get(tdl)));
+ fail_if(!(tdl = eolian_unit_alias_by_name_get(unit, "List_Objects")));
+ fail_if(!(type_name = eolian_typedecl_short_name_get(tdl)));
fail_if(strcmp(type_name, "List_Objects"));
fail_if(!(type = eolian_typedecl_base_type_get(tdl)));
- fail_if(!(type_name = eolian_type_c_type_get(unit, type, EOLIAN_C_TYPE_DEFAULT)));
+ fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_DEFAULT)));
fail_if(eolian_type_is_owned(type));
fail_if(strcmp(type_name, "Eina_List *"));
eina_stringshare_del(type_name);
fail_if(!(type = eolian_type_base_type_get(type)));
fail_if(!!eolian_type_next_type_get(type));
- fail_if(!(type_name = eolian_type_c_type_get(unit, type, EOLIAN_C_TYPE_DEFAULT)));
+ fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_DEFAULT)));
fail_if(strcmp(type_name, "Eo *"));
fail_if(eolian_type_is_owned(type));
eina_stringshare_del(type_name);
/* List */
- fail_if(!(iter = eolian_typedecl_aliases_get_by_file(unit, "typedef.eo")));
+ fail_if(!(iter = eolian_state_aliases_by_file_get(eos, "typedef.eo")));
fail_if(!eina_iterator_next(iter, (void**)&tdl));
- fail_if(!(type_name = eolian_typedecl_name_get(tdl)));
+ fail_if(!(type_name = eolian_typedecl_short_name_get(tdl)));
fail_if(strcmp(type_name, "Coord"));
fail_if(!eina_iterator_next(iter, (void**)&tdl));
- fail_if(!(type_name = eolian_typedecl_name_get(tdl)));
+ fail_if(!(type_name = eolian_typedecl_short_name_get(tdl)));
fail_if(strcmp(type_name, "List_Objects"));
/* coord2 and coord3, skip */
fail_if(!eina_iterator_next(iter, (void**)&tdl));
@@ -402,12 +391,11 @@ START_TEST(eolian_typedef)
fail_if(!eina_iterator_next(iter, (void**)&tdl));
fail_if(eina_iterator_next(iter, (void**)&tdl));
- eolian_free(eos);
- eolian_shutdown();
+ eolian_state_free(eos);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_complex_type)
+EFL_START_TEST(eolian_complex_type)
{
const Eolian_Function *fid = NULL;
const Eolian_Function_Parameter *param = NULL;
@@ -418,31 +406,30 @@ START_TEST(eolian_complex_type)
const Eolian_Unit *unit;
void *dummy;
- eolian_init();
- Eolian *eos = eolian_new();
+ Eolian_State *eos = eolian_state_new();
/* Parsing */
- fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
- fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/complex_type.eo")));
- fail_if(!(class = eolian_class_get_by_name(unit, "Complex_Type")));
+ fail_if(!eolian_state_directory_add(eos, TESTS_SRC_DIR"/data"));
+ fail_if(!(unit = eolian_state_file_parse(eos, TESTS_SRC_DIR"/data/complex_type.eo")));
+ fail_if(!(class = eolian_unit_class_by_name_get(unit, "Complex_Type")));
/* Properties return type */
- fail_if(!(fid = eolian_class_function_get_by_name(class, "a", EOLIAN_PROPERTY)));
+ fail_if(!(fid = eolian_class_function_by_name_get(class, "a", EOLIAN_PROPERTY)));
fail_if(!(type = eolian_function_return_type_get(fid, EOLIAN_PROP_SET)));
- fail_if(!(type_name = eolian_type_c_type_get(unit, type, EOLIAN_C_TYPE_RETURN)));
+ fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_RETURN)));
fail_if(!eolian_type_is_owned(type));
fail_if(eolian_type_builtin_type_get(type) != EOLIAN_TYPE_BUILTIN_LIST);
fail_if(strcmp(type_name, "Eina_List *"));
eina_stringshare_del(type_name);
fail_if(!(type = eolian_type_base_type_get(type)));
fail_if(!!eolian_type_next_type_get(type));
- fail_if(!(type_name = eolian_type_c_type_get(unit, type, EOLIAN_C_TYPE_DEFAULT)));
+ fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_DEFAULT)));
fail_if(eolian_type_is_owned(type));
fail_if(eolian_type_builtin_type_get(type) != EOLIAN_TYPE_BUILTIN_ARRAY);
fail_if(strcmp(type_name, "Eina_Array *"));
eina_stringshare_del(type_name);
fail_if(!(type = eolian_type_base_type_get(type)));
fail_if(!!eolian_type_next_type_get(type));
- fail_if(!(type_name = eolian_type_c_type_get(unit, type, EOLIAN_C_TYPE_DEFAULT)));
+ fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_DEFAULT)));
fail_if(!eolian_type_is_owned(type));
fail_if(strcmp(type_name, "Eo *"));
eina_stringshare_del(type_name);
@@ -453,27 +440,27 @@ START_TEST(eolian_complex_type)
eina_iterator_free(iter);
fail_if(strcmp(eolian_parameter_name_get(param), "value"));
fail_if(!(type = eolian_parameter_type_get(param)));
- fail_if(!(type_name = eolian_type_c_type_get(unit, type, EOLIAN_C_TYPE_PARAM)));
+ fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_PARAM)));
fail_if(!eolian_type_is_owned(type));
fail_if(strcmp(type_name, "Eina_List *"));
eina_stringshare_del(type_name);
fail_if(!(type = eolian_type_base_type_get(type)));
fail_if(!!eolian_type_next_type_get(type));
- fail_if(!(type_name = eolian_type_c_type_get(unit, type, EOLIAN_C_TYPE_DEFAULT)));
+ fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_DEFAULT)));
fail_if(eolian_type_is_owned(type));
fail_if(strcmp(type_name, "const char *"));
eina_stringshare_del(type_name);
/* Methods return type */
- fail_if(!(fid = eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD)));
+ fail_if(!(fid = eolian_class_function_by_name_get(class, "foo", EOLIAN_METHOD)));
fail_if(!(type = eolian_function_return_type_get(fid, EOLIAN_METHOD)));
- fail_if(!(type_name = eolian_type_c_type_get(unit, type, EOLIAN_C_TYPE_RETURN)));
+ fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_RETURN)));
fail_if(!eolian_type_is_owned(type));
fail_if(strcmp(type_name, "Eina_List *"));
eina_stringshare_del(type_name);
fail_if(!(type = eolian_type_base_type_get(type)));
fail_if(!!eolian_type_next_type_get(type));
- fail_if(!(type_name = eolian_type_c_type_get(unit, type, EOLIAN_C_TYPE_DEFAULT)));
+ fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_DEFAULT)));
fail_if(eolian_type_is_owned(type));
fail_if(eolian_type_builtin_type_get(type) != EOLIAN_TYPE_BUILTIN_STRINGSHARE);
fail_if(strcmp(type_name, "Eina_Stringshare *"));
@@ -485,54 +472,51 @@ START_TEST(eolian_complex_type)
eina_iterator_free(iter);
fail_if(strcmp(eolian_parameter_name_get(param), "buf"));
fail_if(!(type = eolian_parameter_type_get(param)));
- fail_if(!(type_name = eolian_type_c_type_get(unit, type, EOLIAN_C_TYPE_PARAM)));
+ fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_PARAM)));
fail_if(!eolian_type_is_owned(type));
fail_if(eolian_type_builtin_type_get(type) != EOLIAN_TYPE_BUILTIN_MSTRING);
fail_if(strcmp(type_name, "char *"));
eina_stringshare_del(type_name);
- eolian_free(eos);
- eolian_shutdown();
+ eolian_state_free(eos);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_scope)
+EFL_START_TEST(eolian_scope)
{
const Eolian_Function *fid = NULL;
const Eolian_Class *class;
const Eolian_Unit *unit;
- eolian_init();
- Eolian *eos = eolian_new();
+ Eolian_State *eos = eolian_state_new();
/* Parsing */
- fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
- fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/scope.eo")));
- fail_if(!(class = eolian_class_get_by_name(unit, "Scope")));
+ fail_if(!eolian_state_directory_add(eos, TESTS_SRC_DIR"/data"));
+ fail_if(!(unit = eolian_state_file_parse(eos, TESTS_SRC_DIR"/data/scope.eo")));
+ fail_if(!(class = eolian_unit_class_by_name_get(unit, "Scope")));
/* Property scope */
- fail_if(eolian_class_function_get_by_name(class, "a", EOLIAN_PROPERTY));
- fail_if(!(fid = eolian_class_function_get_by_name(class, "a", EOLIAN_PROP_GET)));
+ fail_if(eolian_class_function_by_name_get(class, "a", EOLIAN_PROPERTY));
+ fail_if(!(fid = eolian_class_function_by_name_get(class, "a", EOLIAN_PROP_GET)));
fail_if(eolian_function_scope_get(fid, EOLIAN_PROP_GET) != EOLIAN_SCOPE_PROTECTED);
- fail_if(!(fid = eolian_class_function_get_by_name(class, "b", EOLIAN_PROP_GET)));
+ fail_if(!(fid = eolian_class_function_by_name_get(class, "b", EOLIAN_PROP_GET)));
fail_if(eolian_function_scope_get(fid, EOLIAN_PROP_GET) != EOLIAN_SCOPE_PUBLIC);
- fail_if(!(fid = eolian_class_function_get_by_name(class, "c", EOLIAN_PROPERTY)));
+ fail_if(!(fid = eolian_class_function_by_name_get(class, "c", EOLIAN_PROPERTY)));
fail_if(eolian_function_scope_get(fid, EOLIAN_PROP_GET) != EOLIAN_SCOPE_PUBLIC);
fail_if(eolian_function_scope_get(fid, EOLIAN_PROP_SET) != EOLIAN_SCOPE_PROTECTED);
/* Method scope */
- fail_if(!(fid = eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD)));
+ fail_if(!(fid = eolian_class_function_by_name_get(class, "foo", EOLIAN_METHOD)));
fail_if(eolian_function_scope_get(fid, EOLIAN_METHOD) != EOLIAN_SCOPE_PUBLIC);
- fail_if(!(fid = eolian_class_function_get_by_name(class, "bar", EOLIAN_METHOD)));
+ fail_if(!(fid = eolian_class_function_by_name_get(class, "bar", EOLIAN_METHOD)));
fail_if(eolian_function_scope_get(fid, EOLIAN_METHOD) != EOLIAN_SCOPE_PROTECTED);
- fail_if(!(fid = eolian_class_function_get_by_name(class, "foobar", EOLIAN_METHOD)));
+ fail_if(!(fid = eolian_class_function_by_name_get(class, "foobar", EOLIAN_METHOD)));
fail_if(eolian_function_scope_get(fid, EOLIAN_METHOD) != EOLIAN_SCOPE_PUBLIC);
- eolian_free(eos);
- eolian_shutdown();
+ eolian_state_free(eos);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_simple_parsing)
+EFL_START_TEST(eolian_simple_parsing)
{
const Eolian_Function *fid = NULL;
const char *string = NULL, *ptype = NULL;
@@ -545,14 +529,13 @@ START_TEST(eolian_simple_parsing)
Eolian_Value v;
void *dummy;
- eolian_init();
- Eolian *eos = eolian_new();
+ Eolian_State *eos = eolian_state_new();
/* Parsing */
- fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
- fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/class_simple.eo")));
- fail_if(!(class = eolian_class_get_by_name(unit, "Class_Simple")));
- fail_if(eolian_class_get_by_file(unit, "class_simple.eo") != class);
- fail_if(strcmp(eolian_class_file_get(class), "class_simple.eo"));
+ fail_if(!eolian_state_directory_add(eos, TESTS_SRC_DIR"/data"));
+ fail_if(!(unit = eolian_state_file_parse(eos, TESTS_SRC_DIR"/data/class_simple.eo")));
+ fail_if(!(class = eolian_unit_class_by_name_get(unit, "Class_Simple")));
+ fail_if(eolian_state_class_by_file_get(eos, "class_simple.eo") != class);
+ fail_if(strcmp(eolian_object_file_get((const Eolian_Object *)class), "class_simple.eo"));
/* Class */
fail_if(eolian_class_type_get(class) != EOLIAN_CLASS_REGULAR);
@@ -575,7 +558,7 @@ START_TEST(eolian_simple_parsing)
eina_stringshare_del(string);
/* Property */
- fail_if(!(fid = eolian_class_function_get_by_name(class, "a", EOLIAN_PROPERTY)));
+ fail_if(!(fid = eolian_class_function_by_name_get(class, "a", EOLIAN_PROPERTY)));
fail_if(strcmp(eolian_function_name_get(fid), "a"));
fail_if(!eolian_function_is_beta(fid));
fail_if(eolian_function_class_get(fid) != class);
@@ -584,10 +567,10 @@ START_TEST(eolian_simple_parsing)
fail_if(!tp);
printf("BUILT %d\n", (int)eolian_type_builtin_type_get(tp));
fail_if(eolian_type_builtin_type_get(tp) != EOLIAN_TYPE_BUILTIN_BOOL);
- fail_if(strcmp(eolian_type_name_get(tp), "bool"));
+ fail_if(strcmp(eolian_type_short_name_get(tp), "bool"));
expr = eolian_function_return_default_value_get(fid, EOLIAN_PROP_SET);
fail_if(!expr);
- v = eolian_expression_eval(unit, expr, EOLIAN_MASK_BOOL);
+ v = eolian_expression_eval(expr, EOLIAN_MASK_BOOL);
fail_if(v.type != EOLIAN_EXPR_BOOL);
/* Get return */
tp = eolian_function_return_type_get(fid, EOLIAN_PROP_GET);
@@ -599,35 +582,35 @@ START_TEST(eolian_simple_parsing)
fail_if(!(eina_iterator_next(iter, (void**)&param)));
fail_if(eina_iterator_next(iter, &dummy));
eina_iterator_free(iter);
- fail_if(strcmp(eolian_type_name_get(eolian_parameter_type_get(param)), "int"));
+ fail_if(strcmp(eolian_type_short_name_get(eolian_parameter_type_get(param)), "int"));
fail_if(strcmp(eolian_parameter_name_get(param), "value"));
expr = eolian_parameter_default_value_get(param);
fail_if(!expr);
- v = eolian_expression_eval(unit, expr, EOLIAN_MASK_INT);
+ v = eolian_expression_eval(expr, EOLIAN_MASK_INT);
fail_if(v.type != EOLIAN_EXPR_INT);
fail_if(v.value.i != 100);
/* legacy only + c only */
- fail_if(eolian_class_function_get_by_name(class, "b", EOLIAN_PROPERTY));
- fail_if(!(fid = eolian_class_function_get_by_name(class, "b", EOLIAN_PROP_SET)));
+ fail_if(eolian_class_function_by_name_get(class, "b", EOLIAN_PROPERTY));
+ fail_if(!(fid = eolian_class_function_by_name_get(class, "b", EOLIAN_PROP_SET)));
fail_if(eolian_function_is_legacy_only(fid, EOLIAN_PROP_GET));
fail_if(!eolian_function_is_legacy_only(fid, EOLIAN_PROP_SET));
fail_if(eolian_function_is_beta(fid));
/* Method */
- fail_if(!(fid = eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD)));
+ fail_if(!(fid = eolian_class_function_by_name_get(class, "foo", EOLIAN_METHOD)));
fail_if(!eolian_function_is_beta(fid));
fail_if(!eolian_type_is_ptr(eolian_function_return_type_get(fid, EOLIAN_METHOD)));
/* Function return */
tp = eolian_function_return_type_get(fid, EOLIAN_METHOD);
fail_if(!tp);
- string = eolian_type_c_type_get(unit, tp, EOLIAN_C_TYPE_RETURN);
+ string = eolian_type_c_type_get(tp, EOLIAN_C_TYPE_RETURN);
fail_if(!string);
fail_if(strcmp(string, "char *"));
eina_stringshare_del(string);
expr = eolian_function_return_default_value_get(fid, EOLIAN_METHOD);
fail_if(!expr);
- v = eolian_expression_eval(unit, expr, EOLIAN_MASK_NULL);
+ v = eolian_expression_eval(expr, EOLIAN_MASK_NULL);
fail_if(v.type != EOLIAN_EXPR_NULL);
fail_if(eolian_function_is_legacy_only(fid, EOLIAN_METHOD));
@@ -635,43 +618,42 @@ START_TEST(eolian_simple_parsing)
fail_if(!(iter = eolian_function_parameters_get(fid)));
fail_if(!(eina_iterator_next(iter, (void**)&param)));
fail_if(eolian_parameter_direction_get(param) != EOLIAN_IN_PARAM);
- fail_if(strcmp(eolian_type_name_get(eolian_parameter_type_get(param)), "int"));
+ fail_if(strcmp(eolian_type_short_name_get(eolian_parameter_type_get(param)), "int"));
fail_if(strcmp(eolian_parameter_name_get(param), "a"));
fail_if(!(eina_iterator_next(iter, (void**)&param)));
fail_if(eolian_parameter_direction_get(param) != EOLIAN_INOUT_PARAM);
- ptype = eolian_type_name_get(eolian_parameter_type_get(param));
+ ptype = eolian_type_short_name_get(eolian_parameter_type_get(param));
fail_if(strcmp(ptype, "char"));
fail_if(strcmp(eolian_parameter_name_get(param), "b"));
fail_if(!(eina_iterator_next(iter, (void**)&param)));
fail_if(eolian_parameter_direction_get(param) != EOLIAN_OUT_PARAM);
fail_if(eolian_type_builtin_type_get(eolian_parameter_type_get(param)) != EOLIAN_TYPE_BUILTIN_DOUBLE);
- fail_if(strcmp(eolian_type_name_get(eolian_parameter_type_get(param)), "double"));
+ fail_if(strcmp(eolian_type_short_name_get(eolian_parameter_type_get(param)), "double"));
fail_if(strcmp(eolian_parameter_name_get(param), "c"));
expr = eolian_parameter_default_value_get(param);
fail_if(!expr);
- v = eolian_expression_eval(unit, expr, EOLIAN_MASK_FLOAT);
+ v = eolian_expression_eval(expr, EOLIAN_MASK_FLOAT);
fail_if(v.type != EOLIAN_EXPR_DOUBLE);
fail_if(v.value.d != 1337.6);
fail_if(!(eina_iterator_next(iter, (void**)&param)));
fail_if(eolian_parameter_direction_get(param) != EOLIAN_IN_PARAM);
- fail_if(strcmp(eolian_type_name_get(eolian_parameter_type_get(param)), "int"));
+ fail_if(strcmp(eolian_type_short_name_get(eolian_parameter_type_get(param)), "int"));
fail_if(!eolian_type_is_ptr(eolian_parameter_type_get(param)));
fail_if(strcmp(eolian_parameter_name_get(param), "d"));
fail_if(eina_iterator_next(iter, &dummy));
eina_iterator_free(iter);
/* legacy only + c only */
- fail_if(!(fid = eolian_class_function_get_by_name(class, "bar", EOLIAN_METHOD)));
+ fail_if(!(fid = eolian_class_function_by_name_get(class, "bar", EOLIAN_METHOD)));
fail_if(!eolian_function_is_legacy_only(fid, EOLIAN_METHOD));
fail_if(eolian_function_is_beta(fid));
fail_if(!eolian_type_is_ptr(eolian_function_return_type_get(fid, EOLIAN_METHOD)));
- eolian_free(eos);
- eolian_shutdown();
+ eolian_state_free(eos);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_struct)
+EFL_START_TEST(eolian_struct)
{
const Eolian_Struct_Type_Field *field = NULL;
const Eolian_Type *type = NULL, *ftype = NULL;
@@ -682,107 +664,103 @@ START_TEST(eolian_struct)
const char *type_name;
const char *file;
- eolian_init();
- Eolian *eos = eolian_new();
+ Eolian_State *eos = eolian_state_new();
/* Parsing */
- fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
- fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/struct.eo")));
+ fail_if(!eolian_state_directory_add(eos, TESTS_SRC_DIR"/data"));
+ fail_if(!(unit = eolian_state_file_parse(eos, TESTS_SRC_DIR"/data/struct.eo")));
/* Check that the class Dummy is still readable */
- fail_if(!(class = eolian_class_get_by_name(unit, "Struct")));
- fail_if(!eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD));
+ fail_if(!(class = eolian_unit_class_by_name_get(unit, "Struct")));
+ fail_if(!eolian_class_function_by_name_get(class, "foo", EOLIAN_METHOD));
/* named struct */
- fail_if(!(tdl = eolian_typedecl_struct_get_by_name(unit, "Named")));
- fail_if(!(type_name = eolian_typedecl_name_get(tdl)));
- fail_if(!(file = eolian_typedecl_file_get(tdl)));
+ fail_if(!(tdl = eolian_unit_struct_by_name_get(unit, "Named")));
+ fail_if(!(type_name = eolian_typedecl_short_name_get(tdl)));
+ fail_if(!(file = eolian_object_file_get((const Eolian_Object *)tdl)));
fail_if(eolian_typedecl_type_get(tdl) != EOLIAN_TYPEDECL_STRUCT);
fail_if(strcmp(type_name, "Named"));
fail_if(strcmp(file, "struct.eo"));
fail_if(!(field = eolian_typedecl_struct_field_get(tdl, "field")));
fail_if(!(ftype = eolian_typedecl_struct_field_type_get(field)));
fail_if(!eolian_type_is_ptr(ftype));
- fail_if(!(type_name = eolian_type_name_get(ftype)));
+ fail_if(!(type_name = eolian_type_short_name_get(ftype)));
fail_if(strcmp(type_name, "int"));
fail_if(!(field = eolian_typedecl_struct_field_get(tdl, "something")));
fail_if(!(ftype = eolian_typedecl_struct_field_type_get(field)));
fail_if(eolian_type_is_ptr(ftype));
- fail_if(!(type_name = eolian_type_c_type_get(unit, ftype, EOLIAN_C_TYPE_DEFAULT)));
+ fail_if(!(type_name = eolian_type_c_type_get(ftype, EOLIAN_C_TYPE_DEFAULT)));
fail_if(strcmp(type_name, "const char *"));
eina_stringshare_del(type_name);
/* referencing */
- fail_if(!(tdl = eolian_typedecl_struct_get_by_name(unit, "Another")));
- fail_if(!(type_name = eolian_typedecl_name_get(tdl)));
- fail_if(!(file = eolian_typedecl_file_get(tdl)));
+ fail_if(!(tdl = eolian_unit_struct_by_name_get(unit, "Another")));
+ fail_if(!(type_name = eolian_typedecl_short_name_get(tdl)));
+ fail_if(!(file = eolian_object_file_get((const Eolian_Object *)tdl)));
fail_if(eolian_typedecl_type_get(tdl) != EOLIAN_TYPEDECL_STRUCT);
fail_if(strcmp(type_name, "Another"));
fail_if(strcmp(file, "struct.eo"));
fail_if(!(field = eolian_typedecl_struct_field_get(tdl, "field")));
fail_if(!(ftype = eolian_typedecl_struct_field_type_get(field)));
- fail_if(!(type_name = eolian_type_name_get(ftype)));
+ fail_if(!(type_name = eolian_type_short_name_get(ftype)));
fail_if(strcmp(type_name, "Named"));
fail_if(eolian_type_type_get(ftype) != EOLIAN_TYPE_REGULAR);
- fail_if(eolian_typedecl_type_get(eolian_type_typedecl_get(unit, ftype))
+ fail_if(eolian_typedecl_type_get(eolian_type_typedecl_get(ftype))
!= EOLIAN_TYPEDECL_STRUCT);
/* opaque struct */
- fail_if(!(tdl = eolian_typedecl_struct_get_by_name(unit, "Opaque")));
+ fail_if(!(tdl = eolian_unit_struct_by_name_get(unit, "Opaque")));
fail_if(eolian_typedecl_type_get(tdl) != EOLIAN_TYPEDECL_STRUCT_OPAQUE);
/* use in function */
- fail_if(!(func = eolian_class_function_get_by_name(class, "bar", EOLIAN_METHOD)));
+ fail_if(!(func = eolian_class_function_by_name_get(class, "bar", EOLIAN_METHOD)));
fail_if(!(type = eolian_function_return_type_get(func, EOLIAN_METHOD)));
fail_if(eolian_type_type_get(type) != EOLIAN_TYPE_REGULAR);
fail_if(!eolian_type_is_ptr(type));
- fail_if(!(tdl = eolian_type_typedecl_get(unit, type)));
+ fail_if(!(tdl = eolian_type_typedecl_get(type)));
fail_if(eolian_typedecl_type_get(tdl) != EOLIAN_TYPEDECL_STRUCT);
- eolian_free(eos);
- eolian_shutdown();
+ eolian_state_free(eos);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_extern)
+EFL_START_TEST(eolian_extern)
{
const Eolian_Typedecl *tdl = NULL;
const Eolian_Class *class;
const Eolian_Unit *unit;
- eolian_init();
- Eolian *eos = eolian_new();
+ Eolian_State *eos = eolian_state_new();
/* Parsing */
- fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
- fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/extern.eo")));
+ fail_if(!eolian_state_directory_add(eos, TESTS_SRC_DIR"/data"));
+ fail_if(!(unit = eolian_state_file_parse(eos, TESTS_SRC_DIR"/data/extern.eo")));
/* Check that the class Dummy is still readable */
- fail_if(!(class = eolian_class_get_by_name(unit, "Extern")));
- fail_if(!eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD));
+ fail_if(!(class = eolian_unit_class_by_name_get(unit, "Extern")));
+ fail_if(!eolian_class_function_by_name_get(class, "foo", EOLIAN_METHOD));
/* regular type */
- fail_if(!(tdl = eolian_typedecl_alias_get_by_name(unit, "Foo")));
+ fail_if(!(tdl = eolian_unit_alias_by_name_get(unit, "Foo")));
fail_if(eolian_typedecl_is_extern(tdl));
/* extern type */
- fail_if(!(tdl = eolian_typedecl_alias_get_by_name(unit, "Evas.Coord")));
+ fail_if(!(tdl = eolian_unit_alias_by_name_get(unit, "Evas.Coord")));
fail_if(!eolian_typedecl_is_extern(tdl));
/* regular struct */
- fail_if(!(tdl = eolian_typedecl_struct_get_by_name(unit, "X")));
+ fail_if(!(tdl = eolian_unit_struct_by_name_get(unit, "X")));
fail_if(eolian_typedecl_is_extern(tdl));
/* extern struct */
- fail_if(!(tdl = eolian_typedecl_struct_get_by_name(unit, "Y")));
+ fail_if(!(tdl = eolian_unit_struct_by_name_get(unit, "Y")));
fail_if(!eolian_typedecl_is_extern(tdl));
- eolian_free(eos);
- eolian_shutdown();
+ eolian_state_free(eos);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_var)
+EFL_START_TEST(eolian_var)
{
const Eolian_Variable *var = NULL;
const Eolian_Expression *exp = NULL;
@@ -792,65 +770,63 @@ START_TEST(eolian_var)
Eolian_Value v;
const char *name;
- eolian_init();
- Eolian *eos = eolian_new();
+ Eolian_State *eos = eolian_state_new();
/* Parsing */
- fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
- fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/var.eo")));
+ fail_if(!eolian_state_directory_add(eos, TESTS_SRC_DIR"/data"));
+ fail_if(!(unit = eolian_state_file_parse(eos, TESTS_SRC_DIR"/data/var.eo")));
/* Check that the class Dummy is still readable */
- fail_if(!(class = eolian_class_get_by_name(unit, "Var")));
- fail_if(!eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD));
+ fail_if(!(class = eolian_unit_class_by_name_get(unit, "Var")));
+ fail_if(!eolian_class_function_by_name_get(class, "foo", EOLIAN_METHOD));
/* regular constant */
- fail_if(!(var = eolian_variable_constant_get_by_name(unit, "Foo")));
+ fail_if(!(var = eolian_unit_constant_by_name_get(unit, "Foo")));
fail_if(eolian_variable_type_get(var) != EOLIAN_VAR_CONSTANT);
fail_if(eolian_variable_is_extern(var));
fail_if(!(type = eolian_variable_base_type_get(var)));
- fail_if(!(name = eolian_type_name_get(type)));
+ fail_if(!(name = eolian_type_short_name_get(type)));
fail_if(strcmp(name, "int"));
fail_if(!(exp = eolian_variable_value_get(var)));
- v = eolian_expression_eval_type(unit, exp, type);
+ v = eolian_expression_eval_type(exp, type);
fail_if(v.type != EOLIAN_EXPR_INT);
fail_if(v.value.i != 5);
/* regular global */
- fail_if(!(var = eolian_variable_global_get_by_name(unit, "Bar")));
+ fail_if(!(var = eolian_unit_global_by_name_get(unit, "Bar")));
fail_if(eolian_variable_type_get(var) != EOLIAN_VAR_GLOBAL);
fail_if(eolian_variable_is_extern(var));
fail_if(!(type = eolian_variable_base_type_get(var)));
- fail_if(!(name = eolian_type_name_get(type)));
+ fail_if(!(name = eolian_type_short_name_get(type)));
fail_if(strcmp(name, "float"));
fail_if(!(exp = eolian_variable_value_get(var)));
- v = eolian_expression_eval_type(unit, exp, type);
+ v = eolian_expression_eval_type(exp, type);
fail_if(v.type != EOLIAN_EXPR_FLOAT);
fail_if(((int)v.value.f) != 10);
/* no-value global */
- fail_if(!(var = eolian_variable_global_get_by_name(unit, "Baz")));
+ fail_if(!(var = eolian_unit_global_by_name_get(unit, "Baz")));
fail_if(eolian_variable_type_get(var) != EOLIAN_VAR_GLOBAL);
fail_if(eolian_variable_is_extern(var));
fail_if(!(type = eolian_variable_base_type_get(var)));
- fail_if(!(name = eolian_type_name_get(type)));
+ fail_if(!(name = eolian_type_short_name_get(type)));
fail_if(strcmp(name, "long"));
fail_if(eolian_variable_value_get(var));
/* extern global */
- fail_if(!(var = eolian_variable_global_get_by_name(unit, "Bah")));
+ fail_if(!(var = eolian_unit_global_by_name_get(unit, "Bah")));
fail_if(eolian_variable_type_get(var) != EOLIAN_VAR_GLOBAL);
fail_if(!eolian_variable_is_extern(var));
fail_if(!(type = eolian_variable_base_type_get(var)));
- fail_if(!(name = eolian_type_name_get(type)));
+ fail_if(!(name = eolian_type_short_name_get(type)));
fail_if(strcmp(name, "double"));
fail_if(eolian_variable_value_get(var));
- eolian_free(eos);
- eolian_shutdown();
+ eolian_state_free(eos);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_enum)
+EFL_START_TEST(eolian_enum)
{
const Eolian_Enum_Type_Field *field = NULL;
const Eolian_Variable *var = NULL;
@@ -863,22 +839,21 @@ START_TEST(eolian_enum)
const char *name;
Eolian_Value v;
- eolian_init();
- Eolian *eos = eolian_new();
+ Eolian_State *eos = eolian_state_new();
/* Parsing */
- fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
- fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/enum.eo")));
+ fail_if(!eolian_state_directory_add(eos, TESTS_SRC_DIR"/data"));
+ fail_if(!(unit = eolian_state_file_parse(eos, TESTS_SRC_DIR"/data/enum.eo")));
/* Check that the class Dummy is still readable */
- fail_if(!(class = eolian_class_get_by_name(unit, "Enum")));
- fail_if(!eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD));
+ fail_if(!(class = eolian_unit_class_by_name_get(unit, "Enum")));
+ fail_if(!eolian_class_function_by_name_get(class, "foo", EOLIAN_METHOD));
- fail_if(!(tdl = eolian_typedecl_enum_get_by_name(unit, "Foo")));
+ fail_if(!(tdl = eolian_unit_enum_by_name_get(unit, "Foo")));
fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "first")));
fail_if(!(exp = eolian_typedecl_enum_field_value_get(field, EINA_FALSE)));
- v = eolian_expression_eval(unit, exp, EOLIAN_MASK_ALL);
+ v = eolian_expression_eval(exp, EOLIAN_MASK_ALL);
fail_if(v.type != EOLIAN_EXPR_INT);
fail_if(v.value.i != 0);
@@ -887,16 +862,16 @@ START_TEST(eolian_enum)
fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "baz")));
fail_if(!(exp = eolian_typedecl_enum_field_value_get(field, EINA_FALSE)));
- v = eolian_expression_eval(unit, exp, EOLIAN_MASK_ALL);
+ v = eolian_expression_eval(exp, EOLIAN_MASK_ALL);
fail_if(v.type != EOLIAN_EXPR_INT);
fail_if(v.value.i != 15);
- fail_if(!(tdl = eolian_typedecl_enum_get_by_name(unit, "Bar")));
+ fail_if(!(tdl = eolian_unit_enum_by_name_get(unit, "Bar")));
fail_if(strcmp(eolian_typedecl_enum_legacy_prefix_get(tdl), "test"));
fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "foo")));
fail_if(!(exp = eolian_typedecl_enum_field_value_get(field, EINA_FALSE)));
- v = eolian_expression_eval(unit, exp, EOLIAN_MASK_ALL);
+ v = eolian_expression_eval(exp, EOLIAN_MASK_ALL);
fail_if(v.type != EOLIAN_EXPR_INT);
fail_if(v.value.i != 15);
@@ -904,145 +879,140 @@ START_TEST(eolian_enum)
fail_if(strcmp(cname, "TEST_FOO"));
eina_stringshare_del(cname);
- fail_if(!(tdl = eolian_typedecl_enum_get_by_name(unit, "Baz")));
+ fail_if(!(tdl = eolian_unit_enum_by_name_get(unit, "Baz")));
fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "flag1")));
fail_if(!(exp = eolian_typedecl_enum_field_value_get(field, EINA_FALSE)));
- v = eolian_expression_eval(unit, exp, EOLIAN_MASK_ALL);
+ v = eolian_expression_eval(exp, EOLIAN_MASK_ALL);
fail_if(v.type != EOLIAN_EXPR_INT);
fail_if(v.value.i != (1 << 0));
fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "flag2")));
fail_if(!(exp = eolian_typedecl_enum_field_value_get(field, EINA_FALSE)));
- v = eolian_expression_eval(unit, exp, EOLIAN_MASK_ALL);
+ v = eolian_expression_eval(exp, EOLIAN_MASK_ALL);
fail_if(v.type != EOLIAN_EXPR_INT);
fail_if(v.value.i != (1 << 1));
fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "flag3")));
fail_if(!(exp = eolian_typedecl_enum_field_value_get(field, EINA_FALSE)));
- v = eolian_expression_eval(unit, exp, EOLIAN_MASK_ALL);
+ v = eolian_expression_eval(exp, EOLIAN_MASK_ALL);
fail_if(v.type != EOLIAN_EXPR_INT);
fail_if(v.value.i != (1 << 2));
- fail_if(!(tdl = eolian_typedecl_enum_get_by_name(unit, "Name.Spaced")));
+ fail_if(!(tdl = eolian_unit_enum_by_name_get(unit, "Name.Spaced")));
fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "pants")));
cname = eolian_typedecl_enum_field_c_name_get(field);
fail_if(strcmp(cname, "NAME_SPACED_PANTS"));
eina_stringshare_del(cname);
- fail_if(!(var = eolian_variable_constant_get_by_name(unit, "Bah")));
+ fail_if(!(var = eolian_unit_constant_by_name_get(unit, "Bah")));
fail_if(eolian_variable_type_get(var) != EOLIAN_VAR_CONSTANT);
fail_if(eolian_variable_is_extern(var));
fail_if(!(type = eolian_variable_base_type_get(var)));
- fail_if(!(name = eolian_type_name_get(type)));
+ fail_if(!(name = eolian_type_short_name_get(type)));
fail_if(strcmp(name, "Baz"));
fail_if(!(exp = eolian_variable_value_get(var)));
- v = eolian_expression_eval(unit, exp, EOLIAN_MASK_ALL);
+ v = eolian_expression_eval(exp, EOLIAN_MASK_ALL);
fail_if(v.type != EOLIAN_EXPR_INT);
fail_if(v.value.i != (1 << 0));
- fail_if(!(var = eolian_variable_constant_get_by_name(unit, "Pants")));
+ fail_if(!(var = eolian_unit_constant_by_name_get(unit, "Pants")));
fail_if(eolian_variable_type_get(var) != EOLIAN_VAR_CONSTANT);
fail_if(!(exp = eolian_variable_value_get(var)));
- v = eolian_expression_eval(unit, exp, EOLIAN_MASK_ALL);
+ v = eolian_expression_eval(exp, EOLIAN_MASK_ALL);
fail_if(v.type != EOLIAN_EXPR_INT);
fail_if(v.value.i != 5);
- eolian_free(eos);
- eolian_shutdown();
+ eolian_state_free(eos);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_class_funcs)
+EFL_START_TEST(eolian_class_funcs)
{
const Eolian_Function *fid = NULL;
const Eolian_Class *class;
const Eolian_Unit *unit;
- eolian_init();
- Eolian *eos = eolian_new();
+ Eolian_State *eos = eolian_state_new();
/* Parsing */
- fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
- fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/class_funcs.eo")));
- fail_if(!(class = eolian_class_get_by_name(unit, "Class_Funcs")));
+ fail_if(!eolian_state_directory_add(eos, TESTS_SRC_DIR"/data"));
+ fail_if(!(unit = eolian_state_file_parse(eos, TESTS_SRC_DIR"/data/class_funcs.eo")));
+ fail_if(!(class = eolian_unit_class_by_name_get(unit, "Class_Funcs")));
/* Class properties */
- fail_if(eolian_class_function_get_by_name(class, "a", EOLIAN_PROPERTY));
- fail_if(!(fid = eolian_class_function_get_by_name(class, "a", EOLIAN_PROP_GET)));
+ fail_if(eolian_class_function_by_name_get(class, "a", EOLIAN_PROPERTY));
+ fail_if(!(fid = eolian_class_function_by_name_get(class, "a", EOLIAN_PROP_GET)));
fail_if(!eolian_function_is_class(fid));
- fail_if(!(fid = eolian_class_function_get_by_name(class, "b", EOLIAN_PROP_GET)));
+ fail_if(!(fid = eolian_class_function_by_name_get(class, "b", EOLIAN_PROP_GET)));
fail_if(eolian_function_is_class(fid));
/* Class methods */
- fail_if(!(fid = eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD)));
+ fail_if(!(fid = eolian_class_function_by_name_get(class, "foo", EOLIAN_METHOD)));
fail_if(!eolian_function_is_class(fid));
fail_if(eolian_function_scope_get(fid, EOLIAN_METHOD) != EOLIAN_SCOPE_PUBLIC);
- fail_if(!(fid = eolian_class_function_get_by_name(class, "bar", EOLIAN_METHOD)));
+ fail_if(!(fid = eolian_class_function_by_name_get(class, "bar", EOLIAN_METHOD)));
fail_if(eolian_function_is_class(fid));
fail_if(eolian_function_scope_get(fid, EOLIAN_METHOD) != EOLIAN_SCOPE_PUBLIC);
- fail_if(!(fid = eolian_class_function_get_by_name(class, "baz", EOLIAN_METHOD)));
+ fail_if(!(fid = eolian_class_function_by_name_get(class, "baz", EOLIAN_METHOD)));
fail_if(!eolian_function_is_class(fid));
fail_if(eolian_function_scope_get(fid, EOLIAN_METHOD) != EOLIAN_SCOPE_PROTECTED);
- fail_if(!(fid = eolian_class_function_get_by_name(class, "bah", EOLIAN_METHOD)));
+ fail_if(!(fid = eolian_class_function_by_name_get(class, "bah", EOLIAN_METHOD)));
fail_if(eolian_function_is_class(fid));
fail_if(eolian_function_scope_get(fid, EOLIAN_METHOD) != EOLIAN_SCOPE_PROTECTED);
- eolian_free(eos);
- eolian_shutdown();
+ eolian_state_free(eos);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_free_func)
+EFL_START_TEST(eolian_free_func)
{
const Eolian_Class *class;
const Eolian_Typedecl *tdl;
const Eolian_Type *type;
const Eolian_Unit *unit;
- eolian_init();
- Eolian *eos = eolian_new();
+ Eolian_State *eos = eolian_state_new();
/* Parsing */
- fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
- fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/free_func.eo")));
+ fail_if(!eolian_state_directory_add(eos, TESTS_SRC_DIR"/data"));
+ fail_if(!(unit = eolian_state_file_parse(eos, TESTS_SRC_DIR"/data/free_func.eo")));
/* Check that the class Dummy is still readable */
- fail_if(!(class = eolian_class_get_by_name(unit, "Free_Func")));
- fail_if(!eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD));
+ fail_if(!(class = eolian_unit_class_by_name_get(unit, "Free_Func")));
+ fail_if(!eolian_class_function_by_name_get(class, "foo", EOLIAN_METHOD));
/* regular struct */
- fail_if(!(tdl = eolian_typedecl_struct_get_by_name(unit, "Named1")));
+ fail_if(!(tdl = eolian_unit_struct_by_name_get(unit, "Named1")));
fail_if(eolian_typedecl_free_func_get(tdl));
- fail_if(!(tdl = eolian_typedecl_struct_get_by_name(unit, "Named2")));
+ fail_if(!(tdl = eolian_unit_struct_by_name_get(unit, "Named2")));
fail_if(strcmp(eolian_typedecl_free_func_get(tdl), "test_free"));
/* typedef */
- fail_if(!(tdl = eolian_typedecl_alias_get_by_name(unit, "Typedef1")));
+ fail_if(!(tdl = eolian_unit_alias_by_name_get(unit, "Typedef1")));
fail_if(eolian_typedecl_free_func_get(tdl));
- fail_if(!(tdl = eolian_typedecl_alias_get_by_name(unit, "Typedef2")));
+ fail_if(!(tdl = eolian_unit_alias_by_name_get(unit, "Typedef2")));
fail_if(strcmp(eolian_typedecl_free_func_get(tdl), "def_free"));
/* opaque struct */
- fail_if(!(tdl = eolian_typedecl_struct_get_by_name(unit, "Opaque1")));
+ fail_if(!(tdl = eolian_unit_struct_by_name_get(unit, "Opaque1")));
fail_if(eolian_typedecl_free_func_get(tdl));
- fail_if(!(tdl = eolian_typedecl_struct_get_by_name(unit, "Opaque2")));
+ fail_if(!(tdl = eolian_unit_struct_by_name_get(unit, "Opaque2")));
fail_if(strcmp(eolian_typedecl_free_func_get(tdl), "opaque_free"));
/* pointer */
- fail_if(!(tdl = eolian_typedecl_alias_get_by_name(unit, "Pointer1")));
+ fail_if(!(tdl = eolian_unit_alias_by_name_get(unit, "Pointer1")));
fail_if(!(type = eolian_typedecl_base_type_get(tdl)));
fail_if(eolian_type_free_func_get(type));
- fail_if(!(tdl = eolian_typedecl_alias_get_by_name(unit, "Pointer2")));
+ fail_if(!(tdl = eolian_unit_alias_by_name_get(unit, "Pointer2")));
fail_if(!(type = eolian_typedecl_base_type_get(tdl)));
fail_if(strcmp(eolian_type_free_func_get(type), "ptr_free"));
- eolian_free(eos);
- eolian_shutdown();
+ eolian_state_free(eos);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_null)
+EFL_START_TEST(eolian_null)
{
const Eolian_Class *class;
const Eolian_Function *func;
@@ -1050,15 +1020,14 @@ START_TEST(eolian_null)
const Eolian_Unit *unit;
Eina_Iterator *iter;
- eolian_init();
- Eolian *eos = eolian_new();
+ Eolian_State *eos = eolian_state_new();
/* Parsing */
- fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
- fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/null.eo")));
+ fail_if(!eolian_state_directory_add(eos, TESTS_SRC_DIR"/data"));
+ fail_if(!(unit = eolian_state_file_parse(eos, TESTS_SRC_DIR"/data/null.eo")));
- fail_if(!(class = eolian_class_get_by_name(unit, "Null")));
- fail_if(!(func = eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD)));
+ fail_if(!(class = eolian_unit_class_by_name_get(unit, "Null")));
+ fail_if(!(func = eolian_class_function_by_name_get(class, "foo", EOLIAN_METHOD)));
fail_if(!(iter = eolian_function_parameters_get(func)));
@@ -1089,101 +1058,94 @@ START_TEST(eolian_null)
fail_if(eina_iterator_next(iter, (void**)&param));
eina_iterator_free(iter);
- eolian_free(eos);
- eolian_shutdown();
+ eolian_state_free(eos);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_import)
+EFL_START_TEST(eolian_import)
{
const Eolian_Class *class;
const Eolian_Typedecl *tdl;
const Eolian_Unit *unit;
- eolian_init();
- Eolian *eos = eolian_new();
+ Eolian_State *eos = eolian_state_new();
- fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
+ fail_if(!eolian_state_directory_add(eos, TESTS_SRC_DIR"/data"));
- fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/import.eo")));
- fail_if(!(class = eolian_class_get_by_name(unit, "Import")));
+ fail_if(!(unit = eolian_state_file_parse(eos, TESTS_SRC_DIR"/data/import.eo")));
+ fail_if(!(class = eolian_unit_class_by_name_get(unit, "Import")));
- fail_if(!(tdl = eolian_typedecl_alias_get_by_name(unit, "Imported")));
- fail_if(strcmp(eolian_typedecl_file_get(tdl), "import_types.eot"));
+ fail_if(!(tdl = eolian_unit_alias_by_name_get(unit, "Imported")));
+ fail_if(strcmp(eolian_object_file_get((const Eolian_Object *)tdl), "import_types.eot"));
- fail_if(!(tdl = eolian_typedecl_struct_get_by_name(unit, "Imported_Struct")));
- fail_if(strcmp(eolian_typedecl_file_get(tdl), "import_types.eot"));
+ fail_if(!(tdl = eolian_unit_struct_by_name_get(unit, "Imported_Struct")));
+ fail_if(strcmp(eolian_object_file_get((const Eolian_Object *)tdl), "import_types.eot"));
- eolian_free(eos);
- eolian_shutdown();
+ eolian_state_free(eos);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_decl)
+EFL_START_TEST(eolian_decl)
{
- const Eolian_Declaration *decl;
+ const Eolian_Object *decl;
const Eolian_Typedecl *tdl;
- const Eolian_Class *class;
const Eolian_Variable *var;
const Eolian_Unit *unit;
Eina_Iterator *itr;
- eolian_init();
- Eolian *eos = eolian_new();
+ Eolian_State *eos = eolian_state_new();
- fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
+ fail_if(!eolian_state_directory_add(eos, TESTS_SRC_DIR"/data"));
- fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/decl.eo")));
- fail_if(!(class = eolian_class_get_by_name(unit, "Decl")));
+ fail_if(!(unit = eolian_state_file_parse(eos, TESTS_SRC_DIR"/data/decl.eo")));
+ fail_if(!(eolian_unit_class_by_name_get(unit, "Decl")));
- fail_if(!(itr = eolian_declarations_get_by_file(eos, "decl.eo")));
+ fail_if(!(itr = eolian_state_objects_by_file_get(eos, "decl.eo")));
fail_if(!eina_iterator_next(itr, (void**)&decl));
- fail_if(eolian_declaration_type_get(decl) != EOLIAN_DECL_STRUCT);
- fail_if(strcmp(eolian_declaration_name_get(decl), "A"));
- fail_if(!(tdl = eolian_declaration_data_type_get(decl)));
+ fail_if(eolian_object_type_get(decl) != EOLIAN_OBJECT_TYPEDECL);
+ fail_if(strcmp(eolian_object_name_get(decl), "A"));
+ tdl = (const Eolian_Typedecl *)decl;
fail_if(eolian_typedecl_type_get(tdl) != EOLIAN_TYPEDECL_STRUCT);
- fail_if(strcmp(eolian_typedecl_name_get(tdl), "A"));
+ fail_if(strcmp(eolian_typedecl_short_name_get(tdl), "A"));
fail_if(!eina_iterator_next(itr, (void**)&decl));
- fail_if(eolian_declaration_type_get(decl) != EOLIAN_DECL_ENUM);
- fail_if(strcmp(eolian_declaration_name_get(decl), "B"));
- fail_if(!(tdl = eolian_declaration_data_type_get(decl)));
+ fail_if(eolian_object_type_get(decl) != EOLIAN_OBJECT_TYPEDECL);
+ fail_if(strcmp(eolian_object_name_get(decl), "B"));
+ tdl = (const Eolian_Typedecl *)decl;
fail_if(eolian_typedecl_type_get(tdl) != EOLIAN_TYPEDECL_ENUM);
- fail_if(strcmp(eolian_typedecl_name_get(tdl), "B"));
+ fail_if(strcmp(eolian_typedecl_short_name_get(tdl), "B"));
fail_if(!eina_iterator_next(itr, (void**)&decl));
- fail_if(eolian_declaration_type_get(decl) != EOLIAN_DECL_ALIAS);
- fail_if(strcmp(eolian_declaration_name_get(decl), "C"));
- fail_if(!(tdl = eolian_declaration_data_type_get(decl)));
+ fail_if(eolian_object_type_get(decl) != EOLIAN_OBJECT_TYPEDECL);
+ fail_if(strcmp(eolian_object_name_get(decl), "C"));
+ tdl = (const Eolian_Typedecl *)decl;
fail_if(eolian_typedecl_type_get(tdl) != EOLIAN_TYPEDECL_ALIAS);
- fail_if(strcmp(eolian_typedecl_name_get(tdl), "C"));
+ fail_if(strcmp(eolian_typedecl_short_name_get(tdl), "C"));
fail_if(!eina_iterator_next(itr, (void**)&decl));
- fail_if(eolian_declaration_type_get(decl) != EOLIAN_DECL_VAR);
- fail_if(strcmp(eolian_declaration_name_get(decl), "pants"));
- fail_if(!(var = eolian_declaration_variable_get(decl)));
- fail_if(strcmp(eolian_variable_name_get(var), "pants"));
+ fail_if(eolian_object_type_get(decl) != EOLIAN_OBJECT_VARIABLE);
+ fail_if(strcmp(eolian_object_name_get(decl), "pants"));
+ var = (const Eolian_Variable *)decl;
+ fail_if(strcmp(eolian_variable_short_name_get(var), "pants"));
fail_if(!eina_iterator_next(itr, (void**)&decl));
- fail_if(eolian_declaration_type_get(decl) != EOLIAN_DECL_CLASS);
- fail_if(strcmp(eolian_declaration_name_get(decl), "Decl"));
- fail_if(eolian_declaration_class_get(decl) != class);
+ fail_if(eolian_object_type_get(decl) != EOLIAN_OBJECT_CLASS);
+ fail_if(strcmp(eolian_object_name_get(decl), "Decl"));
fail_if(eina_iterator_next(itr, (void**)&decl));
- fail_if(!(decl = eolian_declaration_get_by_name(unit, "pants")));
- fail_if(eolian_declaration_type_get(decl) != EOLIAN_DECL_VAR);
+ fail_if(!(decl = eolian_unit_object_by_name_get(unit, "pants")));
+ fail_if(eolian_object_type_get(decl) != EOLIAN_OBJECT_VARIABLE);
- fail_if(!(decl = eolian_declaration_get_by_name(unit, "A")));
- fail_if(eolian_declaration_type_get(decl) != EOLIAN_DECL_STRUCT);
+ fail_if(!(decl = eolian_unit_object_by_name_get(unit, "A")));
+ fail_if(eolian_object_type_get(decl) != EOLIAN_OBJECT_TYPEDECL);
- eolian_free(eos);
- eolian_shutdown();
+ eolian_state_free(eos);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_docs)
+EFL_START_TEST(eolian_docs)
{
const Eolian_Typedecl *tdl;
const Eolian_Class *class;
@@ -1197,14 +1159,13 @@ START_TEST(eolian_docs)
const Eolian_Unit *unit;
Eina_Iterator *itr;
- eolian_init();
- Eolian *eos = eolian_new();
+ Eolian_State *eos = eolian_state_new();
- fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
+ fail_if(!eolian_state_directory_add(eos, TESTS_SRC_DIR"/data"));
- fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/docs.eo")));
+ fail_if(!(unit = eolian_state_file_parse(eos, TESTS_SRC_DIR"/data/docs.eo")));
- fail_if(!(tdl = eolian_typedecl_struct_get_by_name(unit, "Foo")));
+ fail_if(!(tdl = eolian_unit_struct_by_name_get(unit, "Foo")));
fail_if(!(doc = eolian_typedecl_documentation_get(tdl)));
fail_if(strcmp(eolian_documentation_summary_get(doc),
"This is struct Foo. It does stuff."));
@@ -1258,7 +1219,7 @@ START_TEST(eolian_docs)
fail_if(eolian_doc_token_type_get(&tok) != EOLIAN_DOC_TOKEN_REF);
txt = eolian_doc_token_text_get(&tok);
fail_if(strcmp(txt, "pants"));
- fail_if(eolian_doc_token_ref_get(unit, &tok, NULL, NULL) != EOLIAN_DOC_REF_VAR);
+ fail_if(eolian_doc_token_ref_resolve(&tok, eos, NULL, NULL) != EOLIAN_OBJECT_VARIABLE);
free(txt);
tdoc = eolian_documentation_tokenize(tdoc, &tok);
fail_if(eolian_doc_token_type_get(&tok) != EOLIAN_DOC_TOKEN_TEXT);
@@ -1269,7 +1230,7 @@ START_TEST(eolian_docs)
fail_if(eolian_doc_token_type_get(&tok) != EOLIAN_DOC_TOKEN_REF);
txt = eolian_doc_token_text_get(&tok);
fail_if(strcmp(txt, "Docs.meth"));
- fail_if(eolian_doc_token_ref_get(unit, &tok, NULL, NULL) != EOLIAN_DOC_REF_FUNC);
+ fail_if(eolian_doc_token_ref_resolve(&tok, eos, NULL, NULL) != EOLIAN_OBJECT_FUNCTION);
free(txt);
tdoc = eolian_documentation_tokenize(tdoc, &tok);
fail_if(eolian_doc_token_type_get(&tok) != EOLIAN_DOC_TOKEN_TEXT);
@@ -1306,7 +1267,7 @@ START_TEST(eolian_docs)
"Another field documentation."));
fail_if(eolian_documentation_description_get(doc));
- fail_if(!(tdl = eolian_typedecl_enum_get_by_name(unit, "Bar")));
+ fail_if(!(tdl = eolian_unit_enum_by_name_get(unit, "Bar")));
fail_if(!(doc = eolian_typedecl_documentation_get(tdl)));
fail_if(strcmp(eolian_documentation_summary_get(doc),
"Docs for enum Bar."));
@@ -1328,7 +1289,7 @@ START_TEST(eolian_docs)
"Docs for bar."));
fail_if(eolian_documentation_description_get(doc));
- fail_if(!(tdl = eolian_typedecl_alias_get_by_name(unit, "Alias")));
+ fail_if(!(tdl = eolian_unit_alias_by_name_get(unit, "Alias")));
fail_if(!(doc = eolian_typedecl_documentation_get(tdl)));
fail_if(strcmp(eolian_documentation_summary_get(doc),
"Docs for typedef."));
@@ -1337,19 +1298,19 @@ START_TEST(eolian_docs)
fail_if(strcmp(eolian_documentation_since_get(doc),
"2.0"));
- fail_if(!(var = eolian_variable_global_get_by_name(unit, "pants")));
+ fail_if(!(var = eolian_unit_global_by_name_get(unit, "pants")));
fail_if(!(doc = eolian_variable_documentation_get(var)));
fail_if(strcmp(eolian_documentation_summary_get(doc),
"Docs for var."));
fail_if(eolian_documentation_description_get(doc));
- fail_if(!(tdl = eolian_typedecl_struct_get_by_name(unit, "Opaque")));
+ fail_if(!(tdl = eolian_unit_struct_by_name_get(unit, "Opaque")));
fail_if(!(doc = eolian_typedecl_documentation_get(tdl)));
fail_if(strcmp(eolian_documentation_summary_get(doc),
"Opaque struct docs. See @Foo for another struct."));
fail_if(eolian_documentation_description_get(doc));
- fail_if(!(class = eolian_class_get_by_name(unit, "Docs")));
+ fail_if(!(class = eolian_unit_class_by_name_get(unit, "Docs")));
fail_if(!(doc = eolian_class_documentation_get(class)));
fail_if(strcmp(eolian_documentation_summary_get(doc),
"Docs for class."));
@@ -1358,7 +1319,7 @@ START_TEST(eolian_docs)
"@Foo @Bar @Alias @pants @Docs.meth @Docs.prop "
"@Docs.prop.get @Docs.prop.set @Foo.field1 @Bar.foo @Docs"));
- fail_if(!(fid = eolian_class_function_get_by_name(class, "meth", EOLIAN_METHOD)));
+ fail_if(!(fid = eolian_class_function_by_name_get(class, "meth", EOLIAN_METHOD)));
const Eolian_Implement *fimp = eolian_function_implement_get(fid);
fail_if(!(doc = eolian_implement_documentation_get(fimp, EOLIAN_METHOD)));
fail_if(strcmp(eolian_documentation_summary_get(doc),
@@ -1390,7 +1351,7 @@ START_TEST(eolian_docs)
"Return documentation."));
fail_if(eolian_documentation_description_get(doc));
- fail_if(!(fid = eolian_class_function_get_by_name(class, "prop", EOLIAN_PROPERTY)));
+ fail_if(!(fid = eolian_class_function_by_name_get(class, "prop", EOLIAN_PROPERTY)));
fimp = eolian_function_implement_get(fid);
fail_if(!(doc = eolian_implement_documentation_get(fimp, EOLIAN_PROPERTY)));
fail_if(strcmp(eolian_documentation_summary_get(doc),
@@ -1418,18 +1379,17 @@ START_TEST(eolian_docs)
fail_if(eina_iterator_next(itr, (void**)&par));
eina_iterator_free(itr);
- fail_if(!(event = eolian_class_event_get_by_name(class, "clicked")));
+ fail_if(!(event = eolian_class_event_by_name_get(class, "clicked")));
fail_if(!(doc = eolian_event_documentation_get(event)));
fail_if(strcmp(eolian_documentation_summary_get(doc),
"Event docs."));
fail_if(eolian_documentation_description_get(doc));
- eolian_free(eos);
- eolian_shutdown();
+ eolian_state_free(eos);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_function_types)
+EFL_START_TEST(eolian_function_types)
{
const Eolian_Typedecl *decl = NULL;
const Eolian_Typedecl *arg_decl = NULL;
@@ -1441,16 +1401,15 @@ START_TEST(eolian_function_types)
const char* type_name = NULL;
void *dummy;
- eolian_init();
- Eolian *eos = eolian_new();
+ Eolian_State *eos = eolian_state_new();
- fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
+ fail_if(!eolian_state_directory_add(eos, TESTS_SRC_DIR"/data"));
/* Parsing */
- fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/function_types.eot")));
+ fail_if(!(unit = eolian_state_file_parse(eos, TESTS_SRC_DIR"/data/function_types.eot")));
/* void func(void); */
- fail_if(!(decl = eolian_typedecl_alias_get_by_name(unit, "VoidFunc")));
+ fail_if(!(decl = eolian_unit_alias_by_name_get(unit, "VoidFunc")));
fail_if(eolian_typedecl_type_get(decl) != EOLIAN_TYPEDECL_FUNCTION_POINTER);
fail_if(!(fid = eolian_typedecl_function_pointer_get(decl)));
@@ -1460,7 +1419,7 @@ START_TEST(eolian_function_types)
fail_if((eolian_function_parameters_get(fid)));
/* Function pointer with return and parameters */
- fail_if(!(decl = eolian_typedecl_alias_get_by_name(unit, "SimpleFunc")));
+ fail_if(!(decl = eolian_unit_alias_by_name_get(unit, "SimpleFunc")));
fail_if(eolian_typedecl_type_get(decl) != EOLIAN_TYPEDECL_FUNCTION_POINTER);
fail_if(!(fid = eolian_typedecl_function_pointer_get(decl)));
@@ -1468,33 +1427,33 @@ START_TEST(eolian_function_types)
fail_if(strcmp(eolian_function_name_get(fid), "SimpleFunc"));
fail_if(!(type = eolian_function_return_type_get(fid, EOLIAN_FUNCTION_POINTER))); // void is null_return_type?
- fail_if(!(type_name = eolian_type_c_type_get(unit, type, EOLIAN_C_TYPE_RETURN)));
+ fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_RETURN)));
fail_if(strcmp(type_name, "const char *"));
fail_if(!(iter = (eolian_function_parameters_get(fid))));
fail_if(!(eina_iterator_next(iter, (void**)&param)));
fail_if(strcmp(eolian_parameter_name_get(param), "a"));
fail_if(!(type = eolian_parameter_type_get(param)));
- fail_if(!(type_name = eolian_type_c_type_get(unit, type, EOLIAN_C_TYPE_PARAM)));
+ fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_PARAM)));
fail_if(strcmp(type_name, "int"));
fail_if(!(eina_iterator_next(iter, (void**)&param)));
fail_if(strcmp(eolian_parameter_name_get(param), "b"));
fail_if(!(type = eolian_parameter_type_get(param)));
- fail_if(!(type_name = eolian_type_c_type_get(unit, type, EOLIAN_C_TYPE_PARAM)));
+ fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_PARAM)));
fail_if(strcmp(type_name, "double"));
fail_if(eina_iterator_next(iter, &dummy));
/* Function pointer with parameter attributes (in/out) */
- fail_if(!(decl = eolian_typedecl_alias_get_by_name(unit, "ComplexFunc")));
+ fail_if(!(decl = eolian_unit_alias_by_name_get(unit, "ComplexFunc")));
fail_if(eolian_typedecl_type_get(decl) != EOLIAN_TYPEDECL_FUNCTION_POINTER);
fail_if(!(fid = eolian_typedecl_function_pointer_get(decl)));
fail_if(eolian_function_type_get(fid) != EOLIAN_FUNCTION_POINTER);
fail_if(!(type = eolian_function_return_type_get(fid, EOLIAN_FUNCTION_POINTER)));
- fail_if(!(type_name = eolian_type_c_type_get(unit, type, EOLIAN_C_TYPE_RETURN)));
+ fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_RETURN)));
fail_if(strcmp(type_name, "double"));
fail_if(!(iter = (eolian_function_parameters_get(fid))));
@@ -1504,7 +1463,7 @@ START_TEST(eolian_function_types)
fail_if(!(type = eolian_parameter_type_get(param)));
fail_if(eolian_parameter_direction_get(param) != EOLIAN_IN_PARAM);
fail_if(eolian_type_is_owned(type));
- fail_if(!(type_name = eolian_type_c_type_get(unit, type, EOLIAN_C_TYPE_PARAM)));
+ fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_PARAM)));
fail_if(strcmp(type_name, "const char *"));
/*out own string */
@@ -1513,13 +1472,13 @@ START_TEST(eolian_function_types)
fail_if(eolian_parameter_direction_get(param) != EOLIAN_OUT_PARAM);
fail_if(!(type = eolian_parameter_type_get(param)));
fail_if(!eolian_type_is_owned(type));
- fail_if(!(type_name = eolian_type_c_type_get(unit, type, EOLIAN_C_TYPE_PARAM)));
+ fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_PARAM)));
fail_if(strcmp(type_name, "char *"));
fail_if(eina_iterator_next(iter, &dummy));
/* Function pointer receiving another function pointer */
- fail_if(!(decl = eolian_typedecl_alias_get_by_name(unit, "FuncAsArgFunc")));
+ fail_if(!(decl = eolian_unit_alias_by_name_get(unit, "FuncAsArgFunc")));
fail_if(eolian_typedecl_type_get(decl) != EOLIAN_TYPEDECL_FUNCTION_POINTER);
fail_if(!(fid = eolian_typedecl_function_pointer_get(decl)));
@@ -1534,9 +1493,9 @@ START_TEST(eolian_function_types)
fail_if(!(type = eolian_parameter_type_get(param)));
fail_if(eolian_parameter_direction_get(param) != EOLIAN_IN_PARAM);
fail_if(eolian_type_is_owned(type));
- fail_if(!(type_name = eolian_type_name_get(type)));
+ fail_if(!(type_name = eolian_type_short_name_get(type)));
fail_if(strcmp(type_name, "VoidFunc"));
- fail_if(!(arg_decl = eolian_type_typedecl_get(unit, type)));
+ fail_if(!(arg_decl = eolian_type_typedecl_get(type)));
fail_if(eolian_typedecl_type_get(arg_decl) != EOLIAN_TYPEDECL_FUNCTION_POINTER);
fail_if(!(eina_iterator_next(iter, (void**)&param)));
@@ -1545,19 +1504,18 @@ START_TEST(eolian_function_types)
fail_if(!(type = eolian_parameter_type_get(param)));
fail_if(eolian_type_is_owned(type));
fail_if(eolian_type_type_get(type) != EOLIAN_TYPE_REGULAR);
- fail_if(!(type_name = eolian_type_name_get(type)));
+ fail_if(!(type_name = eolian_type_short_name_get(type)));
fail_if(strcmp(type_name, "SimpleFunc"));
- fail_if(!(arg_decl = eolian_type_typedecl_get(unit, type)));
+ fail_if(!(arg_decl = eolian_type_typedecl_get(type)));
fail_if(eolian_typedecl_type_get(arg_decl) != EOLIAN_TYPEDECL_FUNCTION_POINTER);
fail_if(eina_iterator_next(iter, &dummy));
- eolian_free(eos);
- eolian_shutdown();
+ eolian_state_free(eos);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_function_as_arguments)
+EFL_START_TEST(eolian_function_as_arguments)
{
const Eolian_Class *cls = NULL;
const Eolian_Function *fid = NULL;
@@ -1569,16 +1527,15 @@ START_TEST(eolian_function_as_arguments)
const char *type_name = NULL;
void *dummy;
- eolian_init();
- Eolian *eos = eolian_new();
+ Eolian_State *eos = eolian_state_new();
- fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
+ fail_if(!eolian_state_directory_add(eos, TESTS_SRC_DIR"/data"));
- fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/function_as_argument.eo")));
+ fail_if(!(unit = eolian_state_file_parse(eos, TESTS_SRC_DIR"/data/function_as_argument.eo")));
- fail_if(!(cls = eolian_class_get_by_name(unit, "Function_As_Argument")));
+ fail_if(!(cls = eolian_unit_class_by_name_get(unit, "Function_As_Argument")));
- fail_if(!(fid = eolian_class_function_get_by_name(cls, "set_cb", EOLIAN_METHOD)));
+ fail_if(!(fid = eolian_class_function_by_name_get(cls, "set_cb", EOLIAN_METHOD)));
fail_if(!(iter = (eolian_function_parameters_get(fid))));
@@ -1587,19 +1544,18 @@ START_TEST(eolian_function_as_arguments)
fail_if(!(type = eolian_parameter_type_get(param)));
fail_if(eolian_parameter_direction_get(param) != EOLIAN_IN_PARAM);
fail_if(eolian_type_is_owned(type));
- fail_if(!(type_name = eolian_type_name_get(type)));
+ fail_if(!(type_name = eolian_type_short_name_get(type)));
fail_if(strcmp(type_name, "SimpleFunc"));
- fail_if(!(arg_decl = eolian_type_typedecl_get(unit, type)));
+ fail_if(!(arg_decl = eolian_type_typedecl_get(type)));
fail_if(eolian_typedecl_type_get(arg_decl) != EOLIAN_TYPEDECL_FUNCTION_POINTER);
fail_if(eina_iterator_next(iter, &dummy));
- eolian_free(eos);
- eolian_shutdown();
+ eolian_state_free(eos);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_parts)
+EFL_START_TEST(eolian_parts)
{
const Eolian_Unit *unit;
const Eolian_Class *cls;
@@ -1611,14 +1567,13 @@ START_TEST(eolian_parts)
"Override", "Base", "Parts"
};
- eolian_init();
- Eolian *eos = eolian_new();
+ Eolian_State *eos = eolian_state_new();
- fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
+ fail_if(!eolian_state_directory_add(eos, TESTS_SRC_DIR"/data"));
- fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/parts.eo")));
+ fail_if(!(unit = eolian_state_file_parse(eos, TESTS_SRC_DIR"/data/parts.eo")));
- fail_if(!(cls = eolian_class_get_by_name(unit, "Parts")));
+ fail_if(!(cls = eolian_unit_class_by_name_get(unit, "Parts")));
fail_if(!(iter = eolian_class_parts_get(cls)));
@@ -1636,15 +1591,14 @@ START_TEST(eolian_parts)
ck_assert_str_eq(pattern, eolian_documentation_summary_get(doc));
fail_if(!(klass = eolian_part_class_get(part)));
- ck_assert_str_eq(part_classes[i], eolian_class_name_get(klass));
+ ck_assert_str_eq(part_classes[i], eolian_class_short_name_get(klass));
i++;
}
eina_iterator_free(iter);
- eolian_free(eos);
- eolian_shutdown();
+ eolian_state_free(eos);
}
-END_TEST
+EFL_END_TEST
void eolian_parsing_test(TCase *tc)
{
diff --git a/src/tests/eolian/eolian_static.c b/src/tests/eolian/eolian_static.c
new file mode 100644
index 0000000000..fc156beb56
--- /dev/null
+++ b/src/tests/eolian/eolian_static.c
@@ -0,0 +1,26 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <Eolian.h>
+
+#include "eolian_suite.h"
+
+EFL_START_TEST(eolian_static_check)
+{
+ Eolian_State *eos = eolian_state_new();
+ fail_if(!eolian_state_directory_add(eos, EO_SRC_DIR));
+ fail_if(!eolian_state_all_eot_files_parse(eos));
+ fail_if(!eolian_state_all_eo_files_parse(eos));
+#if 0
+ /* too many failures to enable this yet */
+ fail_if(!eolian_state_check(eos));
+#endif
+ eolian_state_free(eos);
+}
+EFL_END_TEST
+
+void eolian_static_test(TCase *tc)
+{
+ tcase_add_test(tc, eolian_static_check);
+}
diff --git a/src/tests/eolian/eolian_suite.c b/src/tests/eolian/eolian_suite.c
index 1704b7f81b..3b6de0a68d 100644
--- a/src/tests/eolian/eolian_suite.c
+++ b/src/tests/eolian/eolian_suite.c
@@ -8,13 +8,25 @@
#include "eolian_suite.h"
#include "../efl_check.h"
+#include <Eolian.h>
static const Efl_Test_Case etc[] = {
{ "Eolian Parsing", eolian_parsing_test},
+ { "Eolian Static Analysis", eolian_static_test},
{ "Eolian Generation", eolian_generation_test},
{ NULL, NULL }
};
+SUITE_INIT(eolian)
+{
+ ck_assert_int_eq(eolian_init(), 1);
+}
+
+SUITE_SHUTDOWN(eolian)
+{
+ ck_assert_int_eq(eolian_shutdown(), 0);
+}
+
int
main(int argc, char **argv)
{
@@ -30,7 +42,7 @@ main(int argc, char **argv)
#endif
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
- "Eolian", etc);
+ "Eolian", etc, SUITE_INIT_FN(eolian), SUITE_SHUTDOWN_FN(eolian));
return (failed_count == 0) ? 0 : 255;
}
diff --git a/src/tests/eolian/eolian_suite.h b/src/tests/eolian/eolian_suite.h
index 0c1a99b161..d40b1df924 100644
--- a/src/tests/eolian/eolian_suite.h
+++ b/src/tests/eolian/eolian_suite.h
@@ -2,8 +2,9 @@
#define _EOLIAN_SUITE_H
#include <check.h>
-
+#include "../efl_check.h"
void eolian_parsing_test(TCase *tc);
+void eolian_static_test(TCase *tc);
void eolian_generation_test(TCase *tc);
#endif /* _EOLIAN_SUITE_H */
diff --git a/src/tests/eolian/generated_future.eo b/src/tests/eolian/generated_future.eo
index 5e19c90d06..96ccc3ad74 100644
--- a/src/tests/eolian/generated_future.eo
+++ b/src/tests/eolian/generated_future.eo
@@ -1,57 +1,6 @@
class Generated_Future (Efl.Object)
{
methods {
- method1 {
- params {
- @inout future1: future<int>;
- }
- }
- method_progress_type {
- params {
- @inout future1: future<int, double>;
- }
- }
- method_multiple_args_1 {
- params {
- @inout future1: future<int>;
- @in data: void_ptr;
- }
- }
- method_multiple_args_2 {
- params {
- @in data: void_ptr;
- @inout future1: future<int>;
- }
- }
- method2 {
- params {
- @out future1: future<int>;
- }
- }
- method3 {
- params {
- @in future1: future<int>;
- }
- }
- @property prop1 {
- get {}
- values {
- future1: future<int>;
- }
- }
- @property prop2 {
- get {}
- values {
- i: int;
- future1: future<int>;
- }
- }
- @property prop3 {
- set {}
- values {
- future1: future<int>;
- }
- }
}
}
diff --git a/src/tests/eolian_cxx/callback.eo b/src/tests/eolian_cxx/callback.eo
index 2e528d5f56..b72e932f60 100644
--- a/src/tests/eolian_cxx/callback.eo
+++ b/src/tests/eolian_cxx/callback.eo
@@ -8,7 +8,7 @@ class Callback (Efl.Object)
{
data: Callback_Data;
events {
- prefix,event1;
+ prefix,event1: void;
prefix,event2: Callback;
prefix,event3: int;
prefix,event4: list<int*>;
diff --git a/src/tests/eolian_cxx/docs.eo b/src/tests/eolian_cxx/docs.eo
index 9d2e576866..5ca93f02f2 100644
--- a/src/tests/eolian_cxx/docs.eo
+++ b/src/tests/eolian_cxx/docs.eo
@@ -81,6 +81,6 @@ class Docs {
}
}
events {
- clicked; [[Event docs.]]
+ clicked: void; [[Event docs.]]
}
}
diff --git a/src/tests/eolian_cxx/eolian_cxx_suite.cc b/src/tests/eolian_cxx/eolian_cxx_suite.cc
index 6a1b94033b..e30fc6e252 100644
--- a/src/tests/eolian_cxx/eolian_cxx_suite.cc
+++ b/src/tests/eolian_cxx/eolian_cxx_suite.cc
@@ -28,7 +28,7 @@ main(int argc, char* argv[])
putenv(const_cast<char*>("EFL_RUN_IN_TREE=1"));
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
- "Eolian C++", etc);
+ "Eolian C++", etc, NULL, NULL);
return (failed_count == 0) ? 0 : 255;
}
diff --git a/src/tests/eolian_cxx/eolian_cxx_suite.h b/src/tests/eolian_cxx/eolian_cxx_suite.h
index 63691d6a2d..53cec1a0f8 100644
--- a/src/tests/eolian_cxx/eolian_cxx_suite.h
+++ b/src/tests/eolian_cxx/eolian_cxx_suite.h
@@ -2,7 +2,7 @@
#define _EOLIAN_CXX_SUITE_H
#include <check.h>
-
+#include "../efl_check.h"
void eolian_cxx_test_parse(TCase* tc);
void eolian_cxx_test_wrapper(TCase* tc);
void eolian_cxx_test_generate(TCase* tc);
diff --git a/src/tests/eolian_cxx/eolian_cxx_test_address_of.cc b/src/tests/eolian_cxx/eolian_cxx_test_address_of.cc
index f73de98f97..f6ef5a5747 100644
--- a/src/tests/eolian_cxx/eolian_cxx_test_address_of.cc
+++ b/src/tests/eolian_cxx/eolian_cxx_test_address_of.cc
@@ -11,7 +11,7 @@
#include "eolian_cxx_suite.h"
-START_TEST(eolian_cxx_test_addess_of_conversions)
+EFL_START_TEST(eolian_cxx_test_addess_of_conversions)
{
efl::eo::eo_init init;
@@ -26,7 +26,7 @@ START_TEST(eolian_cxx_test_addess_of_conversions)
fail_unless(a_ptr == (void*) c_ptr);
fail_unless(a_ptr == (void*) d_ptr);
}
-END_TEST
+EFL_END_TEST
void
eolian_cxx_test_address_of(TCase* tc)
diff --git a/src/tests/eolian_cxx/eolian_cxx_test_binding.cc b/src/tests/eolian_cxx/eolian_cxx_test_binding.cc
index 6cc6c6198e..e4d90202b5 100644
--- a/src/tests/eolian_cxx/eolian_cxx_test_binding.cc
+++ b/src/tests/eolian_cxx/eolian_cxx_test_binding.cc
@@ -11,7 +11,7 @@
#include "eolian_cxx_suite.h"
-START_TEST(eolian_cxx_test_binding_constructor_only_required)
+EFL_START_TEST(eolian_cxx_test_binding_constructor_only_required)
{
efl::eo::eo_init init;
@@ -24,12 +24,12 @@ START_TEST(eolian_cxx_test_binding_constructor_only_required)
}
);
- fail_if(1 != g.req_ctor_a_value_get());
- fail_if(2 != g.req_ctor_b_value_get());
+ ck_assert_int_eq(1, g.req_ctor_a_value_get());
+ ck_assert_int_eq(2, g.req_ctor_b_value_get());
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_cxx_test_binding_constructor_all_optionals)
+EFL_START_TEST(eolian_cxx_test_binding_constructor_all_optionals)
{
efl::eo::eo_init i;
@@ -55,14 +55,14 @@ START_TEST(eolian_cxx_test_binding_constructor_all_optionals)
}
);
- fail_if(2 != g.req_ctor_a_value_get());
- fail_if(3 != g.opt_ctor_a_value_get());
- fail_if(4 != g.req_ctor_b_value_get());
- fail_if(5 != g.opt_ctor_b_value_get());
+ ck_assert_int_eq(2, g.req_ctor_a_value_get());
+ ck_assert_int_eq(3, g.opt_ctor_a_value_get());
+ ck_assert_int_eq(4, g.req_ctor_b_value_get());
+ ck_assert_int_eq(5, g.opt_ctor_b_value_get());
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_cxx_test_type_generation)
+EFL_START_TEST(eolian_cxx_test_type_generation)
{
efl::eo::eo_init eo_init;
@@ -72,9 +72,9 @@ START_TEST(eolian_cxx_test_type_generation)
name1::name2::Type_Generation g3(efl::eo::instantiate
, [] (name1::name2::Type_Generation) {});
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_cxx_test_type_generation_in)
+EFL_START_TEST(eolian_cxx_test_type_generation_in)
{
efl::eo::eo_init i;
@@ -92,9 +92,9 @@ START_TEST(eolian_cxx_test_type_generation_in)
g.instring("foobar");
g.instringown("foobar");
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_cxx_test_type_generation_return)
+EFL_START_TEST(eolian_cxx_test_type_generation_return)
{
efl::eo::eo_init i;
@@ -129,9 +129,9 @@ START_TEST(eolian_cxx_test_type_generation_return)
ck_assert_str_eq(string.c_str(), "foobar");
}
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_cxx_test_type_generation_optional)
+EFL_START_TEST(eolian_cxx_test_type_generation_optional)
{
efl::eo::eo_init init;
@@ -175,9 +175,9 @@ START_TEST(eolian_cxx_test_type_generation_optional)
ck_assert(*k == 42);
g.optionaloutintptrown(nullptr);
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_cxx_test_type_callback)
+EFL_START_TEST(eolian_cxx_test_type_callback)
{
efl::eo::eo_init i;
@@ -221,7 +221,7 @@ START_TEST(eolian_cxx_test_type_callback)
ck_assert(event4);
ck_assert(event5);
}
-END_TEST
+EFL_END_TEST
void
eolian_cxx_test_binding(TCase* tc)
diff --git a/src/tests/eolian_cxx/eolian_cxx_test_cyclic.cc b/src/tests/eolian_cxx/eolian_cxx_test_cyclic.cc
index dcd88ac151..aff6deb36c 100644
--- a/src/tests/eolian_cxx/eolian_cxx_test_cyclic.cc
+++ b/src/tests/eolian_cxx/eolian_cxx_test_cyclic.cc
@@ -16,10 +16,10 @@ typedef Eo Cyclic2;
#include "eolian_cxx_suite.h"
-START_TEST(eolian_cxx_test_cyclic_call)
+EFL_START_TEST(eolian_cxx_test_cyclic_call)
{
}
-END_TEST
+EFL_END_TEST
void
eolian_cxx_test_cyclic(TCase* tc)
diff --git a/src/tests/eolian_cxx/eolian_cxx_test_documentation.cc b/src/tests/eolian_cxx/eolian_cxx_test_documentation.cc
index 26f249432b..3ebdec86bf 100644
--- a/src/tests/eolian_cxx/eolian_cxx_test_documentation.cc
+++ b/src/tests/eolian_cxx/eolian_cxx_test_documentation.cc
@@ -22,18 +22,18 @@ using efl::eolian::grammar::attributes::struct_def;
klass_def init_test_data(efl::eolian::eolian_state const& state)
{
- ck_assert(::eolian_directory_scan(state.value, PACKAGE_DATA_DIR));
- ck_assert(::eolian_all_eot_files_parse(state.value));
- ck_assert(::eolian_file_parse(state.value, PACKAGE_DATA_DIR"/docs.eo"));
+ ck_assert(::eolian_state_directory_add(state.value, PACKAGE_DATA_DIR));
+ ck_assert(::eolian_state_all_eot_files_parse(state.value));
+ ck_assert(::eolian_state_file_parse(state.value, PACKAGE_DATA_DIR"/docs.eo"));
- const Eolian_Class *c_klass = ::eolian_class_get_by_name(state.as_unit(), "Docs");
+ const Eolian_Class *c_klass = ::eolian_state_class_by_name_get(state.value, "Docs");
ck_assert_ptr_ne(c_klass, NULL);
klass_def klass(c_klass, state.as_unit());
return klass;
}
-START_TEST(eolian_cxx_test_class_docs)
+EFL_START_TEST(eolian_cxx_test_class_docs)
{
efl::eina::eina_init eina_init;
efl::eolian::eolian_init eolian_init;
@@ -57,9 +57,9 @@ START_TEST(eolian_cxx_test_class_docs)
"@Docs");
ck_assert_str_eq(doc.since.c_str(), "1.17");
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_cxx_test_function_docs)
+EFL_START_TEST(eolian_cxx_test_function_docs)
{
efl::eina::eina_init eina_init;
efl::eolian::eolian_init eolian_init;
@@ -105,9 +105,9 @@ START_TEST(eolian_cxx_test_function_docs)
ck_assert_str_eq(doc.description.c_str(), "");
ck_assert_str_eq(doc.since.c_str(), "1.17");
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_cxx_test_property_docs)
+EFL_START_TEST(eolian_cxx_test_property_docs)
{
efl::eina::eina_init eina_init;
efl::eolian::eolian_init eolian_init;
@@ -145,9 +145,9 @@ START_TEST(eolian_cxx_test_property_docs)
ck_assert_str_eq(doc.description.c_str(), "");
ck_assert_str_eq(doc.since.c_str(), "1.17"); // Members inherit from parent *class*
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_cxx_test_event_docs)
+EFL_START_TEST(eolian_cxx_test_event_docs)
{
efl::eina::eina_init eina_init;
efl::eolian::eolian_init eolian_init;
@@ -161,9 +161,9 @@ START_TEST(eolian_cxx_test_event_docs)
ck_assert_str_eq(doc.description.c_str(), "");
ck_assert_str_eq(doc.since.c_str(), "1.17"); // Members inherit from parent *class*
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_cxx_test_enum_docs)
+EFL_START_TEST(eolian_cxx_test_enum_docs)
{
efl::eina::eina_init eina_init;
efl::eolian::eolian_init eolian_init;
@@ -172,7 +172,7 @@ START_TEST(eolian_cxx_test_enum_docs)
klass_def klass = init_test_data(eolian_state);
auto unit = eolian_state.as_unit();
- enum_def _enum(::eolian_typedecl_enum_get_by_name(unit, "Bar"), unit);
+ enum_def _enum(::eolian_state_enum_by_name_get(eolian_state.value, "Bar"), unit);
documentation_def doc = _enum.documentation;
ck_assert_str_eq(doc.summary.c_str(), "Docs for enum Bar.");
@@ -204,9 +204,9 @@ START_TEST(eolian_cxx_test_enum_docs)
ck_assert_str_eq(doc.description.c_str(), "");
ck_assert_str_eq(doc.since.c_str(), "");
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_cxx_test_struct_docs)
+EFL_START_TEST(eolian_cxx_test_struct_docs)
{
efl::eina::eina_init eina_init;
efl::eolian::eolian_init eolian_init;
@@ -215,7 +215,7 @@ START_TEST(eolian_cxx_test_struct_docs)
klass_def klass = init_test_data(eolian_state);
auto unit = eolian_state.as_unit();
- struct_def _struct(::eolian_typedecl_struct_get_by_name(unit, "Foo"), unit);
+ struct_def _struct(::eolian_state_struct_by_name_get(eolian_state.value, "Foo"), unit);
documentation_def doc = _struct.documentation;
ck_assert_str_eq(doc.summary.c_str(), "This is struct Foo. "
@@ -274,7 +274,7 @@ START_TEST(eolian_cxx_test_struct_docs)
ck_assert_str_eq(doc.description.c_str(), "");
ck_assert_str_eq(doc.since.c_str(), "");
}
-END_TEST
+EFL_END_TEST
void
eolian_cxx_test_documentation(TCase* tc)
diff --git a/src/tests/eolian_cxx/eolian_cxx_test_generate.cc b/src/tests/eolian_cxx/eolian_cxx_test_generate.cc
index a6f0f110d3..d93c77d16f 100644
--- a/src/tests/eolian_cxx/eolian_cxx_test_generate.cc
+++ b/src/tests/eolian_cxx/eolian_cxx_test_generate.cc
@@ -10,7 +10,7 @@
#include <grammar/header.hpp>
-START_TEST(eolian_cxx_test_generate_complex_types)
+EFL_START_TEST(eolian_cxx_test_generate_complex_types)
{
using efl::eolian::grammar::class_header;
using efl::eolian::grammar::attributes::unused_type;
@@ -66,7 +66,7 @@ START_TEST(eolian_cxx_test_generate_complex_types)
// ck_assert(buffer.size() == (sizeof(result) - 1));
// ck_assert(std::equal(buffer.begin(), buffer.end(), result));
}
-END_TEST
+EFL_END_TEST
void
eolian_cxx_test_generate(TCase* tc)
diff --git a/src/tests/eolian_cxx/eolian_cxx_test_parse.cc b/src/tests/eolian_cxx/eolian_cxx_test_parse.cc
index 48d414663e..5462d4ef78 100644
--- a/src/tests/eolian_cxx/eolian_cxx_test_parse.cc
+++ b/src/tests/eolian_cxx/eolian_cxx_test_parse.cc
@@ -9,23 +9,23 @@
#include "eolian_cxx_suite.h"
-START_TEST(eolian_cxx_test_parse_complex_types)
+EFL_START_TEST(eolian_cxx_test_parse_complex_types)
{
efl::eolian::eolian_init init;
- // fail_if(!::eolian_directory_scan(PACKAGE_DATA_DIR"/data"));
- // fail_if(!::eolian_eo_file_parse(PACKAGE_DATA_DIR"/data/complex_type.eo"));
+ // fail_if(!::eolian_state_directory_add(PACKAGE_DATA_DIR"/data"));
+ // fail_if(!::eolian_state_file_parse(PACKAGE_DATA_DIR"/data/complex_type.eo"));
// TODO finish
}
-END_TEST
+EFL_END_TEST
-START_TEST(eolian_cxx_test_parse_qualifiers)
+EFL_START_TEST(eolian_cxx_test_parse_qualifiers)
{
efl::eolian::eolian_init init;
// XXX: implement
//eolian_cxx::type_qualify("");
//fail_if();
}
-END_TEST
+EFL_END_TEST
void
eolian_cxx_test_parse(TCase* tc)
diff --git a/src/tests/eolian_cxx/eolian_cxx_test_wrapper.cc b/src/tests/eolian_cxx/eolian_cxx_test_wrapper.cc
index 971bb77886..0c2856f33a 100644
--- a/src/tests/eolian_cxx/eolian_cxx_test_wrapper.cc
+++ b/src/tests/eolian_cxx/eolian_cxx_test_wrapper.cc
@@ -9,7 +9,7 @@
#include "eolian_cxx_suite.h"
-START_TEST(eolian_cxx_test_wrapper_size)
+EFL_START_TEST(eolian_cxx_test_wrapper_size)
{
efl::eo::eo_init init;
@@ -19,7 +19,7 @@ START_TEST(eolian_cxx_test_wrapper_size)
fail_if(sizeof(b) != sizeof(Eo*));
fail_if(sizeof(b) != sizeof(c));
}
-END_TEST
+EFL_END_TEST
void
eolian_cxx_test_wrapper(TCase* tc)
diff --git a/src/tests/eolian_cxx/generic.c b/src/tests/eolian_cxx/generic.c
index d7483b33bd..f558208d4d 100644
--- a/src/tests/eolian_cxx/generic.c
+++ b/src/tests/eolian_cxx/generic.c
@@ -50,22 +50,22 @@ static void _generic_optional_ctor_b(Eo *obj EINA_UNUSED, Generic_Data *pd EINA_
pd->opt_ctor_b_val = value;
}
-static int _generic_req_ctor_a_value_get(Eo *obj EINA_UNUSED, Generic_Data *pd)
+static int _generic_req_ctor_a_value_get(const Eo *obj EINA_UNUSED, Generic_Data *pd)
{
return pd->req_ctor_a_val;
}
-static int _generic_req_ctor_b_value_get(Eo *obj EINA_UNUSED, Generic_Data *pd)
+static int _generic_req_ctor_b_value_get(const Eo *obj EINA_UNUSED, Generic_Data *pd)
{
return pd->req_ctor_b_val;
}
-static int _generic_opt_ctor_a_value_get(Eo *obj EINA_UNUSED, Generic_Data *pd)
+static int _generic_opt_ctor_a_value_get(const Eo *obj EINA_UNUSED, Generic_Data *pd)
{
return pd->opt_ctor_a_val;
}
-static int _generic_opt_ctor_b_value_get(Eo *obj EINA_UNUSED, Generic_Data *pd)
+static int _generic_opt_ctor_b_value_get(const Eo *obj EINA_UNUSED, Generic_Data *pd)
{
return pd->opt_ctor_b_val;
}
diff --git a/src/tests/eolian_cxx/generic.eo b/src/tests/eolian_cxx/generic.eo
index b6d2621448..d21473c067 100644
--- a/src/tests/eolian_cxx/generic.eo
+++ b/src/tests/eolian_cxx/generic.eo
@@ -105,13 +105,13 @@ class Generic (Efl.Object)
Efl.Object.constructor;
}
events {
- prefix,event1;
+ prefix,event1: void;
prefix,event2: Generic;
prefix,event3: int;
prefix,event4: list<ptr(int)>;
prefix,event5: Generic.Event;
- protected,event1 @protected;
- beta,event1 @beta;
- protected,beta,event1 @beta @protected;
+ protected,event1 @protected: void;
+ beta,event1 @beta: void;
+ protected,beta,event1 @beta @protected: void;
}
}
diff --git a/src/tests/eolian_js/eolian_js_test_constructor_method_impl.c b/src/tests/eolian_js/eolian_js_test_constructor_method_impl.c
index 6fe2cb4b9b..ae50c33459 100644
--- a/src/tests/eolian_js/eolian_js_test_constructor_method_impl.c
+++ b/src/tests/eolian_js/eolian_js_test_constructor_method_impl.c
@@ -132,7 +132,7 @@ _constructor_method_class_classoutmethod1(Eo* obj EINA_UNUSED, Constructor_Metho
{
fprintf(stderr, "classoutmethod1\n");
fflush(stderr);
- return efl_add(MY_CLASS, NULL, constructor_method_class_constructor1(efl_added, one), constructor_method_class_constructor2(efl_added, two));
+ return efl_add_ref(MY_CLASS, NULL, constructor_method_class_constructor1(efl_added, one), constructor_method_class_constructor2(efl_added, two));
}
EOLIAN static void
@@ -140,7 +140,7 @@ _constructor_method_class_classoutmethod2(Eo* obj EINA_UNUSED, Constructor_Metho
{
fprintf(stderr, "classoutmethod2\n");
fflush(stderr);
- *out_class = efl_add(MY_CLASS, NULL, constructor_method_class_constructor1(efl_added, one), constructor_method_class_constructor2(efl_added, two));
+ *out_class = efl_add_ref(MY_CLASS, NULL, constructor_method_class_constructor1(efl_added, one), constructor_method_class_constructor2(efl_added, two));
}
diff --git a/src/tests/eolian_js/test_object.eo b/src/tests/eolian_js/test_object.eo
index 447ba2d970..ea81366162 100644
--- a/src/tests/eolian_js/test_object.eo
+++ b/src/tests/eolian_js/test_object.eo
@@ -338,9 +338,9 @@ class Test.Object (Efl.Object) {
Efl.Object.destructor;
}
events {
- test;
+ test: void;
test,structarg: Test.Struct_Ex;
test,stringarg: string;
- repeated,event,name;
+ repeated,event,name: void;
}
}
diff --git a/src/tests/evas/dicts/README_hyph_de_DE.txt b/src/tests/evas/dicts/README_hyph_de_DE.txt
new file mode 100644
index 0000000000..25d8dbf268
--- /dev/null
+++ b/src/tests/evas/dicts/README_hyph_de_DE.txt
@@ -0,0 +1,30 @@
+Hyphenation dictionary
+----------------------
+
+Language: German (de DE).
+Origin: Based on the TeX hyphenation tables
+ http://www.tug.org/tex-archive/language/hyphenation/dehyphn.tex
+License: GNU LGPL license.
+Author: conversion author is Marco Huggenberger<marco@by-night.ch>
+ revised conversion and extensions: Daniel Naber
+ http://qa.openoffice.org/issues/show_bug.cgi?id=26355
+
+Please note, this dictionary is based on syllable matching patterns
+and thus should be suitable under other variations of German
+
+HYPH de DE hyph_de_DE
+HYPH de CH hyph_de_CH
+
+--------------------------------------------------------------------------------
+Trennmuster (hyph_de_DE.dic):
+--------------------------------------------------------------------------------
+
+Die Trennmuster (hyph_de_DE.dic) basieren auf den TeX Trennmustern
+"dehyphn.tex", revision level 31.
+Lizenz der Trennmuster: GNU LGPL. Die Anpassung der Trennmuster an
+den in OpenOffice.org benutzten "ALTLinux LibHnj Hyphenator" wurde
+mit dem Script substrings.pl durchgefhrt, das unter
+http://lingucomponent.openoffice.org/hyphenator.html als Teil der
+Datei altlinux_Hyph.zip heruntergeladen werden kann.
+Die Original-Trennmuster knnen hier heruntergeladen werden:
+http://www.tug.org/tex-archive/language/hyphenation/dehyphn.tex
diff --git a/src/tests/evas/dicts/README_hyph_en_US.txt b/src/tests/evas/dicts/README_hyph_en_US.txt
new file mode 100644
index 0000000000..dd743f68e4
--- /dev/null
+++ b/src/tests/evas/dicts/README_hyph_en_US.txt
@@ -0,0 +1,53 @@
+hyph_en_US.dic - American English hyphenation patterns for OpenOffice.org
+
+version 2010-02-23
+
+Changes
+
+- set correct LEFTHYPHENMIN = 2, RIGHTHYPHENMIN = 3
+- handle apostrophes (forbid *o'=clock etc.)
+- set COMPOUNDLEFTHYPHENMIN, COMPOUNDRIGHTHYPHENMIN values
+- UTF-8 encoding
+- Unicode ligature support
+
+License
+
+BSD-style. Unlimited copying, redistribution and modification of this file
+is permitted with this copyright and license information.
+
+See original license in this file.
+
+Conversion and modifications by László Németh (nemeth at OOo).
+
+Based on the plain TeX hyphenation table
+(http://tug.ctan.org/text-archive/macros/plain/base/hyphen.tex) and
+the TugBoat hyphenation exceptions log in
+http://www.ctan.org/tex-archive/info/digests/tugboat/tb0hyf.tex, processed
+by the hyphenex.sh script (see in the same directory).
+
+Originally developed and distributed with the Hyphen hyphenation library,
+see http://hunspell.sourceforge.net/ for the source files and the conversion
+scripts.
+
+Licenses
+
+hyphen.tex:
+% The Plain TeX hyphenation tables [NOT TO BE CHANGED IN ANY WAY!]
+% Unlimited copying and redistribution of this file are permitted as long
+% as this file is not modified. Modifications are permitted, but only if
+% the resulting file is not named hyphen.tex.
+
+output of hyphenex.sh:
+% Hyphenation exceptions for US English, based on hyphenation exception
+% log articles in TUGboat.
+%
+% Copyright 2007 TeX Users Group.
+% You may freely use, modify and/or distribute this file.
+%
+% This is an automatically generated file. Do not edit!
+%
+% Please contact the TUGboat editorial staff <tugboat@tug.org>
+% for corrections and omissions.
+
+hyph_en_US.txt:
+See the previous licenses.
diff --git a/src/tests/evas/dicts/hyph_de_DE.dic b/src/tests/evas/dicts/hyph_de_DE.dic
new file mode 100644
index 0000000000..97751f811e
--- /dev/null
+++ b/src/tests/evas/dicts/hyph_de_DE.dic
@@ -0,0 +1,7500 @@
+ISO8859-1
+.aa6l
+.6a1ba
+.ab3a4s
+.a1be
+.ab3ei
+.a1bi2
+.ab3it
+.a1b1l8
+.a1b1r
+.a1b3u
+.a1d
+.a1do
+.ad3o4r
+.a2l1t
+.alti6
+.a3na3c
+.an5a2l1g
+.a1n1e
+.an2gs
+.ang8s2t1
+.a6n1s
+.ap1p
+.a2r1s
+.ar6sc
+.a2r1t
+.ar6ta
+.8ar6tei
+.as2z
+.au2f1
+.au2s3
+.1be
+.be5er1b
+.be3na
+.be2r1t
+.ber6t5r6
+.1bi
+.b6ie
+.bie6r5
+.bi2ms
+.bim6s5t
+.1br
+.brot3
+.br6u6s
+.c8h6
+.1che6f5
+.1da8c
+.da2r
+.d2a1ri
+.dar5in
+.da1r5u
+.1de
+.den6ka
+.de1re
+.de5r6en
+.de1sp2
+.des6pe
+.de8s2p2o
+.de3s1z
+.1di
+.dia3s4
+.dien4
+.dy2s1
+.e6hr
+.eh1re
+.ehre6n5
+.ei1ne6
+.ei6n5eh
+.ei8nen
+.ei6ns
+.ein5sa
+.e2n1d
+.en1de
+.en6der
+.en6d5r4
+.en3k4
+.en8ta8
+.en1te
+.en8tei
+.en4t3r6
+.e1p2o1
+.er1b
+.er1ba
+.er6ban
+.er1be
+.er6b5ei
+.erbl8
+.er6bla
+.e8rd
+.er1du
+.er6d5um
+.e1re
+.2er3ei
+.e1r5er
+.2e1ri
+.er3in
+.er3o4b
+.er1w
+.erwi5s
+.e1s1p2
+.e2s8t1l
+.es8t1n
+.ex1a2
+.ex3em
+.fa2ls
+.fal6sc
+.1fe
+.fe6s1t5a
+.flu4g3
+.1fu
+.furc8h8
+.1ga
+.ga1ne
+.ga6ner
+.1ge
+.ge3n4a
+.ge5r8
+.ge1s6
+.ha2lb5
+.hal1be6
+.hal6br
+.haup4
+.hau4t
+.hei1ma6
+.he4r3e
+.her6za
+.he5x
+.hin3
+.hi2r1s
+.hir8sc
+.ho4c
+.hu3sa
+.hy5o
+.i1be5
+.i1ma
+.ima6ge
+.in1
+.i1ni6
+.isc8h
+.i1s5chi
+.ja6gd5
+.1ka
+.ka6l1k
+.kal6k5o
+.ka6ph
+.ki4e
+.1k2o
+.kop6f3
+.1kr8
+.kraf6
+.1k
+.k5ra
+.la2b1b
+.lab6br
+.1li
+.l8i1i
+.liie6
+.lo6s5k2
+.1ls
+.l4s3t
+.1ma
+.ma5d2
+.1mi
+.mi2t1
+.no6th
+.no1to
+.no6top
+.o1be
+.ob2e8ri
+.o1b1l8
+.o8bs2
+.ob6s1t5e
+.or3c
+.o2r1t
+.or2ts
+.ort6s5e
+.o1st3a
+.os1te
+.oste8r
+.1pe
+.p8er
+.pe4re6
+.pe3t2s
+.1ph6
+.1p2o
+.po8str6
+.r6au4m3
+.re5an
+.ro8q
+.ru5the
+.r5b6e2
+.sc8h8
+.1se
+.se6e
+.se5n6h
+.se5ra
+.1si
+.si2e
+.sp2
+.1spi
+.spi1k
+.spi6ke
+.st4
+.1sy
+.sy2n1
+.1tag
+.ta1ge
+.tage4s5
+.tan6kl8
+.ta8th
+.te6e
+.te8str6
+.to1d
+.to1de4
+.to6der
+.t8o1ni
+.to8nin
+.to6we
+.um1
+.u2mp
+.umpf4
+.un1
+.u1ne6
+.un1ge
+.ung8e5n
+.ur1c
+.u1re
+.ur5en
+.1ve
+.ver1
+.v2e1ri
+.ve6rin
+.v2or1
+.vora8
+.1wah
+.wah6l5
+.1weg
+.we1ge
+.we8ge1s
+.we8s2t
+.wes3te
+.wo6r
+.wor3a
+.wu6n4s
+.1zi
+.zi4e
+.1zu
+.z2uc
+.zuc8h8
+.2n1d
+.n1de
+.nde8re
+.c8h8
+aa1c
+aa2gr4
+aa1l5e
+aa6r5a
+aa2r1t
+a5arti
+aa2s1t
+aa2t2s
+6a1ba
+ab3a2r1t
+a2b1d
+1abdr4
+a1be
+6ab8el
+abe2n1d
+aben6dr4
+ab5e6rk
+ab5e2r1r
+ab5e2s1se
+1a2b1f8
+1a2b1g2
+a2b1h
+1abh
+a1bi
+ab1ir
+a2b1k2
+1ab1k2o
+a1bl8
+ab1la
+5a6blag
+a6bl8a
+ab4ler
+a1b1lu
+a8bl
+5a6bl
+a2b1m
+ab1ma
+abma5c
+1a2b1n
+a1br
+ab1ra
+ab1re
+5a6brec
+ab1ro
+a8b1s
+ab8s1k2
+abs2z
+a2b1t
+3abtei
+a1bu
+ab1ur
+1a2b1w
+a8b1z
+5ab1ze
+5ab1zu
+a1b
+ab1n
+abu8
+a1ce
+a4ce.
+ac8h
+a5chal
+ach5a2r1t
+ach5au
+a1che
+a8chent
+ach6er.
+a6ch5er1f
+a1chi
+ach1l6
+a6ch3m
+a2ch5n6
+a1cho
+ac6hr
+ach3re
+a1chu
+a8ch1w
+a1chy
+ach5f
+ac2k
+ac1k2o
+a2c2ks
+acks6t8
+ack5sta
+a1d
+8ad.
+a6d5ac
+ad3ant
+ad8ar
+a2d1d
+5ad1di
+a1de
+a8dein
+ade5o8
+a1di
+adi5en
+1ad1j
+a2d1l
+1adle
+a1do
+ad1op
+adr4
+a2dre
+3adres
+a2dt1
+1a2d1v
+a6d
+a1e2d
+ae1r
+a1er.
+1aero
+8afa
+a3fal
+af1an
+a5far
+a5fat
+af1au
+a1fe
+a6fen2t1l
+a2f1ex1
+a2ff
+af1fr6
+afr6
+af5rau
+af1re
+1afri
+a2ft
+af1te
+af6tent
+af1tr6
+af6tra
+aft5re
+a1fu
+a6f5um
+8a1f
+a1ga
+ag5a1be
+a1ge
+5a4gent
+ag8er
+age1s
+age1s5e
+a2g1g
+1ag1gr4
+a1g5las
+ag1lo
+a1gn8
+ag2ne
+a1go
+1a2g8o1g
+a1gu
+a6g5u2n1d
+a1ha
+a1he
+a2h5ein
+a4h3er1h8
+a1hi
+ahl1a
+ah1le
+ah1ma
+ah4m3ar
+ahn1a
+a5ho
+a6hr
+ahra6
+ahr5ab
+ah1re
+ah8rei
+ahre6n8s
+ahre4s3
+ah2r1t
+ahr8ti
+ah1ru
+a1hu
+ah8
+ai1d
+ai3d2s
+ai1e
+a2if6
+ai6ns
+a3in1se
+ai1re
+ai4re.
+aisc8h
+a5i8s2ch.
+ai1s8e
+ai2s1m
+a3ismu
+ais6n
+ai1so6
+a1j
+a1ka
+1aka1d
+a4ka1de
+a1ke
+a1ki
+a2k1k2
+1ak1k2o
+a1kr8
+5akro1
+a5lal
+al5a6ns
+3al8a6r1m
+a2lb
+al1be
+al8be1b
+al8ber1w
+albl8
+alb5la
+al1bu
+3album
+a8l1c
+a1le
+ale1b
+a6l5e6be
+a4l3ein
+a8lel
+a1ler
+a8ler1b
+a8ler1h8
+a6le2r1t
+5a6l5eth
+a2l1g
+1al1gi
+al4g1li
+a1li
+a2l3int
+a6ll
+al1la
+al4lab
+al8lan
+al4l3ar
+al1le
+alle3g
+a1lo
+a4l5ob
+a2ls
+al1sc
+alsc8h
+al6s6ch2m
+a2l1t
+al4the
+altr6
+al4t3re
+8a1lu
+al6u5i
+a6lur
+alu3ta
+a1l
+a1ma
+a6ma1te
+a1me
+8ame.
+5a6mei1se
+a2m1m
+am1me
+am6m5ei
+am6mum
+am2n8
+a2mp
+ampf3a6
+a2ms
+am1sc
+amsc8h
+am6s8chw
+a2m1t
+am2ta
+a1mu
+a1m
+a3na2c
+a1na1d
+ana1di
+anadi5e
+an3a1k2o
+an3a6l1p
+3a8na1ly
+an3a1me
+an3a2ra
+a1nas
+an5as1ti
+a1nat
+ana2t5s
+a2n1d
+an1de
+an8dent
+ande4s3
+a1ne
+a2n1ec
+a8n5eis
+an1e2k
+4aner.
+a6n5e8rd
+a8ner1f
+ane6rk
+a6n5er1ke
+an1f
+1anfa
+an1fe
+5anfe2r1t
+1an1f
+an1ga
+3angab
+an1ge
+ange1b
+5ange1bo
+an3g1li
+ang6lis
+an2gn8
+an1gr4
+3angri
+an2g5t6
+an1h
+5anh
+a1ni
+ani5g
+an6i1k
+ani4ka
+an2io
+an5i8on
+an1kl8
+an1k2n8
+an6kno
+an1kr8
+an4kro
+1an5l6
+an1m
+an1ma
+anma5c
+anmar4
+an1na
+3an1n2ah
+an1ne
+anne4s3
+a1no
+5a6n1o2d
+5a6n3o1ma
+5a6no8rd
+1an1r
+a6ns
+an1sa
+an1sc
+ansc8h
+5anschl6
+an1so
+an4so1z
+an1st
+an1sta
+5anstal
+an1s2z
+an1te
+5antenn
+an1th
+a8n1w
+5anw
+a5ny
+an1ze
+an4z3e1d
+5anzeig
+an1zi
+5anzieh
+an1zu
+3anzug
+an1
+5ans
+a1n
+an8d
+a1os
+a1pa
+ap1fe
+3apfel
+a1ph
+a2ph1t2
+aph56
+a1pi
+8apl8
+a1p2o
+apo1c
+apo1s
+a6pos2t
+a6po1th
+1ap1pa
+ap1pr6
+a1pr6
+a5p
+a3p
+a1ra
+a4r3af
+a2r3a6ll
+ar1b
+ar1be
+3arbei
+2ar2b1t
+ar1c
+2a1re
+ar3ein
+a8r1g
+ar2gl
+2a1ri
+ar2ie
+ari5es
+a6rk
+ar1ke
+ar8ke2r1s
+ar1l
+ar6les
+a2rn
+ar1na
+ar4nan
+ar5o6c8h
+ar1o2d
+a1rol
+ar2on
+ar3ony
+a8ror
+a3ros
+ar5ox
+a2r1s
+arsc8h
+ar6schl6
+a2r1t
+8ar5tei
+artr6
+ar6t5ri
+a1ru
+a1ry
+1ar2z1t
+arz1w8
+ar8z
+ar8m
+ar6
+ar5m
+ar12
+a1sa
+asc8h
+a1sche
+a6schec
+asch5l6
+as6ch3m
+a6s2chn6
+as1h
+a3s4hi
+asp2
+as1pa
+asp5l8
+as1te
+as5te1v
+1a2sth
+a1str6
+ast3re
+8a1ta
+ata5c
+ata3la
+a6tapf
+at8a5pl8
+a1te
+a6te1li
+aten5a
+ate5ran
+6a2t1f2
+6a2t1g2
+a1th
+ath6a
+at3hal
+1a2th1l
+2a1ti
+a2t1l
+atl8a
+5atlant
+3atlas
+a2t1m8
+8atmus
+6a2t1n
+a1to
+a6t5ops
+ato6ra
+ato2r1t
+a6t5ort.
+4a1tr6
+a6t5ru
+a2t1t
+at2t1h
+at5t6h
+6a1tu
+a2tz
+atz1w8
+a1t
+a1t
+au1a
+au1br
+au6bre
+a2uc
+auc8h
+auch3a
+au1e
+aue4l
+au1fe
+5au4f3ent
+au2ff
+3auf1f
+au2f1g2
+3auf1ga
+1au2f1n
+au2f1t
+3auf1tr6
+1au2f1w
+au1ge
+3auge.
+a6uk
+au1kl8
+au4kle
+au1le
+aule8s
+6aum
+au1ma
+au8mar
+au2m5p
+1au2s1b2
+3au2s1d
+1au2s1f2
+1au2s3g2
+au1si
+au8sin
+au4sta
+1au2s1w
+1aus1z
+au1te
+aut5eng
+au1th
+1au1to
+au1e8
+a1v
+a1ve
+aver1
+ave5r6a
+av2e1r6i
+a1w
+a6wes
+a1x
+a1xi
+a2xia
+a6x2io
+a1ya
+a1z
+a1zi
+azi5er.
+8a
+1ba
+ba1d
+ba1de
+8ba8del
+ba1la
+ba1na
+ban6k5r8
+ba5ot
+ba8rd
+bar1di
+bardi6n
+ba1ro
+bas1te
+basten6
+bau3sp2
+2b1b
+bbl8
+bb6le
+b2b1li
+2b1c
+2b1d
+1be
+be1a
+be8at.
+be1c8h
+8be2cht
+bec2k
+8be1cke.
+be5el
+be1en
+bee3r4e
+be2e8rei
+be5e1ta
+be1f2
+8be2ff
+be1g2
+be1h8
+bei1s
+bei1se
+6b5eisen
+bei3tr6
+b8el
+b4e1l8o
+be1lu
+belu3t2
+be3na2c
+be2n1d
+ben1d6o
+be1ne
+be6n5e2r1s
+be6n5er1w
+be1no
+be4nor
+be6ns
+ben4se6
+bens5el
+be1n
+be1n
+be1o2
+b8er.
+be1ra
+be8rac
+be8r1g
+ber1ga
+ber8gab.
+be2r1r
+be1r
+be1s8c
+be1se
+bes5er1h8
+be1s2p2
+be5th6a
+be2ts
+bet5sc
+be1un
+be1ur
+8bex
+be1z
+bezw8
+be6zwec
+2b1f8
+2b1g2
+b1ga
+bga2s5
+b1ge1
+2b1h
+bho1le6
+1bi
+bi1bl8
+b6ie
+bi1el
+b2il
+bi1la
+bi1l5
+bi1na
+bi1no
+bi4no1k
+bi6stu
+bi5tr6
+bi2t1t
+bit4t5r6
+b1j
+2b1k2
+b1k6
+bl8
+b6la.
+6b1la1d
+6blag
+8blam
+1blat
+b8la2t1t
+3blau.
+b6la1v
+3ble.
+b1le1b
+b1le1d
+8b1leg
+8b1leh
+8blei1d
+8bleih
+6b3lein
+bl4e4m3o2
+b1li
+4blic8h
+b4li2n1d
+8bling
+b2l2io
+5blit
+b4li2tz
+b1loh
+8b1los
+1blu
+5blum
+2b1lun
+blut3a
+blu2ts
+blut5sc
+3bl
+bl6s5c
+5bl
+3bl
+bl8sc
+2b1m
+2b1n
+1bo
+bo1c8h
+bo1d
+bo5d6s
+boe5
+8bo2ff
+8bon1k
+bo1ra
+b1o2r1t
+2b1p2
+b1q
+1br
+bra2il6
+brast8
+bre4a
+b5re1d
+8bre1f
+br2ie
+8b5riem
+b1r2ig
+b6ri1ga
+bro1s
+b1rup
+b2ruz
+8brh
+br2s5c
+8bs
+b1sa
+b8sang
+b2s1ar
+b1sc
+b1se
+bs3er1l
+bs3erz
+b1so
+b8sof
+b1s2p2
+b2st1h
+bstr6
+b3stru
+b5st
+b1su
+b6sun
+2b1t
+b2t1h
+1bu
+b6ui
+bu1ie
+bu6l6k
+b8u1re
+bu1si
+bu6sin
+6b1v
+2b1w
+1by1
+by1t
+by6te.
+8b1z
+1b
+b56s5
+1b
+b1b6e2
+b34ber1
+b65be1re
+b1ge6
+bge1l5e
+b2r1s
+br6sc
+1ca
+cag6
+ca5la
+c2a6re
+ca5y
+c1c
+1ce
+ce1li
+celi4c
+celic8h5
+ce1ro
+c8h
+2ch.
+1c8hae
+ch1ah
+ch3a2k1t
+cha1me
+cha6mer
+8c6hanz
+5cha1ra
+3ch2a1ri
+5cha1to
+6ch1b2
+1che1f
+6chei
+ch3e2il
+ch3eis
+che6rk
+6cher1kl8
+6ch1f2
+4ch1h
+5chia1d
+5chias
+6chi6ns
+8ch1j
+chl6
+5ch4lor
+6ch2m
+2chn6
+ch1ni
+ch8n6ie
+5cho.
+8chob
+c2hoi
+choi8d
+6ch1p
+c6hr
+ch3ren
+ch6res
+ch3r
+2chs
+2cht
+cht5h6a
+cht3hi
+5chth2on
+ch1ti
+ch6tin
+6chuh
+chu4la
+6ch3unt
+chu2t6t
+8chw
+1ci
+ci5tr6
+c2k
+2ck.
+ck1ei
+4c2k1h
+ck3l8
+ck3n8
+c1k2o
+ck5o8f
+c1k1r8
+2c2ks
+ckst8
+ckstr6
+ck5stra
+ck6s5u
+c2l
+1c8o
+con6ne
+8cor1b
+cos6t
+c3q
+1c6r
+8c1t
+1cu
+1cy
+5c1
+c5
+1da.
+8daas
+2d1a2b1g2
+8da1br
+6da2b1t
+6d1a2b1w
+1dac
+da2gr4
+6d5a6l1k
+8d5a2m1t
+dan1c
+dan1ce
+dan6ce.
+da1ni
+dan6ie
+dani5er
+dan1ke
+dan8ker
+2d1an5l6
+danla6
+6da6ns
+8dan1zi
+6dan1zu
+d1ap
+da2r1a8
+2d1ar1b
+d3ar1c
+da6r1m
+dar1me
+dar6men
+4d3a2r1t
+8darz
+1dat
+8da2t1m8
+2d1auf
+2d1aus
+2d1b
+2d1c
+2d1d
+d5de
+d3d2h
+d1d
+dd2m1m
+ddm1me8
+1de
+2deal
+de5an
+dec8h
+de3cha
+de1e
+de1f
+de1fe6
+6de2ff
+2d1e6hr
+5d4eic
+de5isc
+de1la
+de8lar
+de2ls
+del6s5e
+del1sp2
+del6spr6
+de1ma
+de4mag
+de1mu
+de8mun
+de1ne
+de8nep
+dene6r
+den1ge
+8denge.
+8deng8en
+de5o6d
+2deol
+de5ram
+de8rd
+8der2d1b
+de1re
+d2erei
+der5ein
+de1ro
+de2r1r
+d8e2r1s
+d2e1ru
+der5um
+de1sa
+de4s3am
+de4s3an
+de4sau
+de1si
+de6s2il
+de4sin
+de1so
+de8sor
+de1sp2
+de4spr6
+de2su
+8deul
+de5us.
+2d1f
+df2l
+2d1g
+2d1h
+1di
+dia5c
+di5a1ra
+di1ce5
+dic8h
+di3c6hr
+di5ena
+di1gn8
+d2il
+di1la
+di2l8s
+di1na
+8di2n1d
+6din1f
+4d3in1h
+2d1i6ns
+d2io
+di5o6d
+d2ip
+di3p4t
+di1se
+di8sen
+dis1p2
+dis1pe
+di5s8p8er
+di6s5to
+dis3tr6
+di1ta
+di8tan
+di1ti
+di8tin
+d1j
+6dje
+2dju
+2d1k
+2d1l
+2d1m
+2d1n6
+d1ni6
+dn1j
+dnje6
+1do
+6d5o1be
+do6ber1f
+6d5ony
+do3ran
+6do8rd
+2d1o8r1g
+do2r1t
+dor4t3h
+6do1th
+do2t1t
+dott8e
+2d1p
+d5q
+dr4
+1drah
+8drak
+d5r6a2n1d
+6d1re.
+4drec8h
+d6rec2k
+4d3reg
+8d3reic
+dre2if
+d5rei1fe
+8drem
+8d1ren
+2d1rer
+8dres.
+6d5r1h8
+1dria
+d1ric
+8dri2n1d
+droi6
+dro5x
+1dru
+8drut
+dr2s5c
+1dr
+dr5b
+dr8sc
+2ds
+d1sa
+d6san
+d1sat6
+d1sc
+dsc8h
+5d6scha.
+d1schi
+5dschi1k
+d1se
+dse8e
+d8se8r1g
+8ds1l
+d1sp2
+d4s1pak
+ds2p2o
+d8sp
+d1st
+d1s
+2dt
+d1ta
+d1te
+d1ti
+d1to
+d2t1s6
+d1tu
+d5t
+1du
+du5a2ls
+du1b6
+du1e
+du2ft
+duf4t3r6
+4d3uh
+d6ui
+du5ie
+8du2m1l
+8du2m1w
+2d1u2n1d
+du8ni
+6d5unt
+dur2c
+durc8h3
+6dur1l
+du2r1s
+6dursa
+8du2r1t
+dus1t
+dusc8h
+du8sc6hr
+2d1v
+2d1w
+dwa8l
+2d1z
+1d
+6dh
+8d2n1d
+d6r
+d1b
+d8bl8
+d5l
+dr1f
+dr6fl
+d8sc
+d54st
+1d
+ea1be
+ea4ben
+e1ac
+e1ah
+e1a2k1t
+e1al.
+e5al1f
+e1a2l1g
+ea1li
+e5a8lin
+e1a6l1k
+e1a6ll
+e5a6l1p
+e1a2l1t
+e5a2l1w
+e1am
+e1a2n1d
+ea1ni
+ea6nim
+e1ar.
+e5ar1f
+e1a6rk
+e5a6r1m
+e3a2r1t
+e5at.
+e6a1te
+e6a5t6l
+e8a2ts
+e5a2t1t
+e6au.
+e1aus
+e1b
+e1ba
+e6b5am
+e1be
+ebe6ns
+eben4s5e6
+ebl8
+eb1li
+eb4lie
+e8bs
+eb1se
+eb4ser
+eb1si
+eb4s3in
+ec8h
+e1che
+e8cherz
+e1chi
+e6ch3m
+8e2ch3n6
+ec6h1r
+e2chs
+ech1se
+ech8se2n1d
+ech4su
+e1chu
+ec2k
+ec1ka
+eck5an
+e5c2l
+e1d
+ee5a
+ee3e
+ee5g
+e1ei
+ee5isc
+eei4s3t
+ee1le
+ee6le2n1d
+e1e6ll
+ee5l
+e1e8rd
+ee3r4e
+ee8reng
+eere6s5
+ee5r
+ee1ta
+ee6tat
+e1ex
+e1f
+e6fau
+e1fe
+e8fe8b
+e2ff
+ef5fe
+3effek
+efr6
+ef3rom
+e1ge
+ege6ra
+eg1los
+eglo6si
+1egy
+e1ha
+e6h5ac8h
+eh5a6ns
+e6hap
+eh5auf
+e1he
+e1hi
+ehl3a
+eh1le
+eh3l5ein
+eh1mu
+eh1ne
+eh2n5ec
+e1ho
+e6hr
+ehr1a
+eh1re
+ehre6n
+eh1ri
+eh1ru
+eh6r5um
+e1hu
+eh1w
+e1hy
+e1h
+e1h
+e3ht
+ei1a
+eia6s
+ei1ba
+ei6bar
+eic8h
+eich3a
+eic6h5r
+ei1d
+ei4dar
+ei1de
+ei6d5ei
+ei8der1f
+ei2ds
+ei3d4sc
+ei1e
+e2if
+ei1fe
+8eifen
+eifr6
+3eifri
+1eign8
+e2il
+ei6l1d
+ei1ma
+ei6mab
+ei8mag
+ein1a4
+ei8nat
+ei1ne
+ei8ner1h8
+ei8ness
+ei6ne1te
+ein1g
+e8i1ni
+ein1k
+ei1no
+ei6n5o1d
+ei8no1k
+ei4nor
+ei6ns
+e3in1s
+e2i1o
+e1i2rr
+ei5ru
+ei1sa
+ei8sab
+eisc8h
+ei5s2chn6
+ei1se
+ei6s5ent
+ei1so
+ei8sol
+ei1ta
+ei4t3al
+eit3ar
+eit1h
+ei6thi
+ei8tho
+ei2ts
+eit1sam
+eit8sa2m1t
+ei1tu
+ei6t5um
+e1j
+1e4k1d
+e1ke
+e1ki
+e1k2l8
+e1kn8
+ek2ni4
+e1la
+e2l1al
+6elan
+e6lan1f
+e8l1an5l6
+e6l5a6ns
+el3ar1b
+el3a6r1m
+e6l3a2r1t
+5e6las1ti
+e6lau1ge
+e2lb
+el8bs
+elb1st5a
+e1le
+6ele1f
+ele6h
+e6l5e1he
+e8le2if
+e6l5ein1h
+1elek
+e8lel
+3ele1me
+e6lemen
+e6len1te
+e6l5e1pi
+e1ler
+e4l3e2rr
+ele2r1s
+e6l5ersc
+el1f
+elf2l
+e2l1g2
+e1li
+e6l5i6ns
+e6ll
+el1le
+el1l8er
+4e1lo
+e4l3o1fe
+e2ls
+el1so
+el8soh
+e2l1t
+el5ten
+el8tent
+5elte2rn
+e1lu
+elut2
+e1l
+e1l
+e2m1d
+em1de
+em8dei
+e2m1m
+em1me
+em8meis
+4e1mo
+emo5s
+e2mp
+1emp1f
+1emp1t
+e2m1t
+1emto
+e1mu
+emu6rk4
+emur2ks5
+e1m
+ena1be
+en5a6ben
+ena2c
+enac8h
+en5a2chs
+en5ac2k
+e1na1d
+en5af
+en5a6ll
+en3a2l1t
+en1am
+en3an.
+en3ant
+en3anz
+en1a6p
+en1ar
+en1a6s
+6e1nat
+e4n3auf
+en3aus
+en1c
+en2ce
+e2n1d
+enda6l
+en1de
+end5er1f
+end5e8r1g
+en8dess
+e1ne
+4ene.
+e2nec
+en5ec2k
+ene1f
+e8ne2ff
+e6n5e6hr
+e6n5eim
+e8n3eis
+6enem.
+6enen
+e4nent
+4ener.
+e8ne8rd
+e6n3er1f
+e4ne8r1g
+5ener1gi
+ener1l
+e6n5erla
+en5e2r1s
+e6nerst
+en5er1w
+6enes
+e6n5ess
+e2nex
+en3glo
+2e1ni
+en1ni
+enn6i6s5
+en1no
+enn6os4
+en6ns8
+e1no
+eno1be
+e6nober
+eno8f
+e6n5opf
+e4n3o8rd
+e6ns
+en1se
+en8se2r1s
+ens1k2
+ens8kl8
+en1sp2
+ens1p2o
+ens6por
+en1ta
+en5t6ag
+en4t3a5go
+en1te
+enter1b
+en8ter1bu
+en1ti
+en6ti1d
+en2t1l
+3entl8a
+en1tr6
+ent5ric
+en2t1w
+5entwic
+5entwu
+1en2t1z
+e1nu
+en6u5i
+e3ny
+en1za
+en8zan
+en1f
+e1ns
+e1ng
+eo1c
+e5o6fe
+eo1k
+e5o2k1k2
+e1on.
+e3on1f
+e5on1k
+e5on5l6
+e5on1r
+e5opf
+e5ops
+e5or.
+e1o8rd
+e1o8r1g
+eo5r6h8
+eo1t
+e1pa
+e1pe
+e8pee
+e6p5e6g
+ep5ent
+e1p2f
+e1pi
+5epi1d
+epi1de
+e6pidem
+e1pl8
+e1p2o
+5epos
+e6pos.
+ep4p3a
+e1pr6
+e1p
+e1q
+e1ra.
+er5aal
+8er6a1ba
+era1be
+e5r6ab8el
+er5a6ben
+e5ra1bi
+er3a8b1s
+er3ac8h
+era5e
+era5k6l8
+e2r3a6ll
+er3a2m1t
+e3r6a2n1d
+e3ra1ne
+er3a6ns
+e5r8anz.
+e1rap
+er3ar1c
+e3r2a1ri
+er3a6si
+e1rat
+era2t3s
+er3auf
+e3r6aum
+er1b
+er8bs
+3erb1se
+er1c
+e1re
+4e5re.
+er3ec2k
+er5e2g1g
+e2r5e2h
+2erei
+e3r4ei.
+e8rei1ne
+e6r5ein1r
+6eren.
+e4r3en1m
+e1rer
+4erer.
+e6r5e6r1m
+er5er5o
+ere2r1s
+er5erst
+e4r3erz
+e2r3ess
+er1f
+er1f
+5erfl
+e8r1g
+er1ga
+er8gan.
+er1ge
+erge1b
+5erge2b1n
+er2g5h
+er1g
+5ergnz
+er1h8
+5erh1hu
+2e1ri
+eri5ak
+e6r5iat
+e4r3i2n1d
+e6r5i6n5i6
+er5i6ns
+e6r5int
+er2it
+eri1ti
+er5it2io
+e6rk
+er1kl8
+3er1kl
+er1l
+er1ls
+5erls.
+e6r1m
+er1me
+erme6n6s
+e2rn
+er1na
+er6nab
+er6ns
+3ernst
+6e1ro.
+e1ro1d
+er1o2f
+e1r8o1g
+6e3roi
+ero5i1d
+ero8i1de
+e3rol
+e1rom
+e1r2on
+e3rop8
+e2r1or
+e1ros
+e1rot
+er5ox
+e2r1s
+ersc8h4
+er1sta
+5erstat
+e2r1t
+er5tei
+er6t5ein
+er2t1h
+er5t6her
+2e1ru
+e1r4uf
+eru2f4s3
+e4r3u6hr
+e2r3u2ms
+e5r6us
+er1w
+5erwer1b
+e1ry
+erzw8
+er5zwa
+er3zwu
+er8m
+er5s
+er8
+e3rs.
+e6r12b
+e1sa
+esa8b
+e8s1ap
+e6s5a6v
+e1sc
+esc8h
+esch4l6
+e1se
+ese1a
+ese1b
+es5e1be
+eser1v
+eser1ve5
+e8s1h
+e1si
+es2il
+es5i6ll
+es3int
+es1k2
+es1k2o
+es4kop
+e2s1l
+e1so
+eso8b
+e1sp2
+es1pe
+es4pei6s5
+es2p2o
+es2pu
+e2s1se
+5essenz
+e1sta
+e6s4ta8b1s
+e6staf
+e6st5ak
+est3ar
+e1sto
+e8stob
+e1str6
+e6st5res
+e1su
+es3ur
+e2s1z
+e1s
+e1ta
+e1t8ag
+e1t2a1ri
+etar2i5e
+et8a8ta
+e1te
+eten6te
+eth6a
+et5hal
+e5thel
+e1ti
+1e2t1n
+e1to
+e1tr6
+e2t3rec
+e2ts
+etsc8h
+e8tscha
+et8se
+e2t1t
+et6tei
+et2th
+et2t1r6
+e1tu
+etu1s
+e2tz
+et1ze
+et8zent
+et8zw8
+e1t
+e1t
+e1t
+eu1a2
+eu1e
+eu1er
+eue1re
+eu2e8rei
+eu5fe
+e6ui
+euin5
+e6uk2
+e1um.
+eu1ni
+eu6n2io
+eun1te
+e5unter
+eu1o6
+eu5p
+eu1ro
+3europ
+eu1sp2
+eu5str6
+eu8zo
+e1v
+eva2l6s
+e1ve
+ever1
+eve2re2
+eve5r6en
+ev2e1r4i
+e1w
+e2wig
+e1xo
+ex1or
+1e8x3p2
+e8x1t
+1extr6
+ey3er.
+e1z
+e12
+e58
+e1
+e1e
+e8es
+fac8h
+fa6ch5i
+fa1d
+fa1de8
+fa6del
+fa5el.
+fa6ll
+fal6lo
+fa2l1t
+falt8e
+fa1na
+fan4gr4
+6f1an5l6
+6fap
+far1b
+far6ba
+far4bl8
+fa2rr
+far6r5a
+2f1a2r1t
+fa1sc
+fau8str6
+fa3y
+2f1b2
+6f1c
+2f1d
+1fe
+2f1ec2k
+fe1d
+fe6dr4
+feh1le
+feh6lei
+f6eim
+8fei6ns
+f5eis
+fe1le
+fel5en
+fe2l1t
+8f5elte2rn
+8fe2mp
+fe5rant
+fe8rd
+4ferd.
+fe2rr
+fer1ri8
+fe1sto
+fe8stof
+fe6str6
+fe1stu
+fe6stum
+fe1ta
+fe8t8ag
+fe2t1t
+fet6ta
+fex1
+2ff
+f1fa
+f6f5a6r1m
+f5fe
+ffe5in
+ffe6la
+ffe1le
+ffe8ler
+2f2f1f
+f1fla
+ffl8e
+ff3lei
+ff1li
+ff4lie
+f2fs
+ff8sa
+ff6s5ta
+2f1g2
+f1ge
+fge1w
+fgewen6
+4f1h
+1fi
+fi1d4
+fi3ds
+fie1b4
+f2il
+fi1la
+fi1le
+fi8lei
+fi2l1m
+fil4m5a
+f8in.
+fi1na
+8fin1f
+fisc8h
+fi8scho
+fi6u
+6f1j
+2f1k2
+f8lanz
+fl8e
+4f3lein
+f1li
+8flib
+4fling
+f2lix
+6f3l2on
+5flop
+1flor
+5f8lc
+3flt
+2f1m
+2f1n
+1fo
+foh1
+f2on
+fo6na
+2f1op
+fo5ra
+fo6r1m
+for1me
+for8mei
+fo2r1s
+for8str6
+fo2r1t
+for8th
+for6t5r6
+fo5ru
+fo2t1t
+6f5otte
+2f1p8
+f1q
+fr6
+f5ram
+1f8ran
+f8r8a
+f8re.
+frei1
+5fr4ei.
+f3reic
+f3rest
+f1rib
+8f1ric
+6f1r2ig
+1fr2is
+fr2on
+fro8na
+frs5t
+2fs
+f1sc
+f1se
+f2s1er
+f5str6
+f1st
+fs3tt
+2ft
+f1tak
+f1te
+ft5e6h
+fte1re6
+ft1h
+f1ti
+f5to
+f1tr6
+ft5ra1d
+f2ts
+ft1sc
+ft2so
+f1tu
+f2t1w
+ft1wi3d4
+f2t1z
+1fu
+6f5u2ms
+6fun1f
+fun4ka
+fu1e
+fue6n
+fu8e2n1d
+6f1v
+2f1w
+2f1z
+1f
+f1c
+8f6r1m
+6f1ug
+f8
+f1de3
+8ff
+3fr
+1f
+fn1f
+fn4f3u
+1ga
+ga6bl8
+6g1a2b1w
+8ga8b1z
+ga1d
+ga1de
+g3a4der
+ga8ho
+ga5isc
+4gak
+ga1la
+6g5a2m1t
+ga1na
+ga1ne
+gan5er1b
+1gan6g5a
+ga5n1j
+6g1an5l6
+ga6ns
+8gan1sc
+6gar1b
+2g1ar1c
+2g1a6r1m
+ga5ro
+ga2r1t
+6g3arti
+ga8sa
+ga8sc
+ga1str6
+ga6st3re
+2g1a2t1m8
+6g5auf
+gau5fr6
+g5aus
+2g1b
+g5c
+6gd
+g1da
+1ge
+ge1a2
+ge6an
+ge8at.
+ge1e2
+ge6es
+ge1f2
+8ge2ff
+ge1g2l
+ge1im
+4g3ei1se
+geist5r6
+ge2lb
+gel1br
+gel8bra
+ge2l1t
+gel2t8s
+ge5l
+g2e1ni
+ge8nin
+gen3k
+6g5en2t1f2
+ge3n
+ge1or
+ge1ra
+ge6rab
+ger8au
+ger1h8
+8gerh
+g2e1ri
+ger8i6ns
+ge1ro
+6g5erz.
+ge1r
+ge1r
+ge1s
+ge1s2p2
+ges1te
+ge2s7te.
+ge2s7ten
+ge2s7ter
+ges1ti
+ge2s7ti1k
+ge5unt
+4g3ex3
+2g1f8
+2g1g
+g1ha
+6g1hei
+5ghel.
+g5henn
+6g1hi
+g1ho
+1g6hr
+g1h
+1gi
+g2il
+gi5la
+gi1me
+gi8me.
+gi1na
+4g3i6ns
+gis1tr6
+g1j
+2g1k
+8gl.
+1gla1d
+g5lag
+glan4z3
+1glas
+6glass
+5glaub
+g3lauf
+1gle.
+g5le1b
+3gleic
+g3lein
+5gleis
+1glem
+2g1ler
+8g3leu
+g1li
+gli8a
+g2lie
+3glie1d
+1g2li1k
+1g2lim
+g6l2io
+1gloa
+5glom
+1gl2on
+1glop
+g1los
+g4loss
+g5luf
+1g2ly
+1gl
+2g1m
+gn8
+6gn.
+1gna
+gna2c
+8gnac8h
+2g1n2ah
+g1nas
+g1ne
+g8neu
+g1ni
+g2n6ie
+g3n6is
+1gno
+8gnot
+1go
+goe1
+8gof
+2g8o1g
+5go1gr4
+6g5oh
+g8o1ni
+gon6i5e
+gon6is
+6gonist
+go1ra
+8go8rd
+2g1p2
+g1q
+1gr4
+g5rahm
+gra8m
+gra4s3t
+6g1rec
+gre6ge
+4g3reic
+g5reit
+8grenn
+gr2i4e
+g5riem
+5gr2if
+2g1r2ig
+g5ring
+6groh
+2grot
+gro6
+4grut
+2gs
+gs1ab
+g5sah
+gs1ak
+gs1an
+g1s8a2n1d
+gs1ar
+gs1au
+g1sc
+g1se
+gs1e1f
+g5s8e2il
+gs5ein
+g2s1er
+g1si
+gs1in
+g2s1o
+gso2r
+gsp2
+gs1pr6
+g2s1u
+2g1t
+g3te
+g2t1h
+1gu
+gu5as
+gu2e
+2gue.
+6gue1d
+4g3uh
+8gu2ms
+6g5unt
+gut3h
+gu2tu
+4g1v
+2g1w
+gy1n
+g1z
+1g
+8g8m
+6g6r1m
+1g
+1g
+6gb
+1haa
+ha1b8r
+ha1d
+ha1de
+ha8del
+hade4n
+8hae
+ha5el.
+ha2ft
+haf6tr6
+2hal.
+ha1la
+ha2lb
+hal4b5a
+6ha1le
+8han.
+ha1na
+ha2n1d
+han6dr4
+han1ge
+han6ge.
+2ha1ni
+h5an1th
+6hanz
+6har1b
+h3ar1be
+ha6r1m
+h3ar1me
+ha5ro
+ha2t1h
+h1a2t1m8
+hau1sa
+hau6san
+h8a8
+h1b2
+h1c
+h1d
+he1b
+he2bl8
+hec8h
+he3cho
+h3e2cht
+he1d
+he5d6s
+he1f
+5he2ft
+he1he
+h5e6he.
+hei1d
+hei8ds
+h1e2if
+2hein
+he3i2s1m
+he5i2st.
+hei2t8s3
+he2k1t
+hek6ta
+he6ll
+hel1la
+hel8lau
+8he2l1t
+he1me
+he6mer
+1he2m1m
+6h1e2mp
+he1ne
+h6enen
+hen5e2n1d
+henkl8
+hen5klo
+hen1tr6
+hen6tri
+he2nu
+8heo
+he8q
+her3ab
+he5rak
+her3an
+4he1rap
+her3au
+her1b
+h3er1bi
+he1ro
+he8ro8b
+h2e1ru
+he4r3um
+her1ze
+her6z5er
+he1sp2
+he4s1pe
+he1st
+he1ta6
+het5am
+he5th
+heu3sc
+he1xa
+hey5e
+h1f2
+h1g
+h1go
+hgol8
+h1h
+h1iat
+hi2e6r5i
+hi1k
+hi5k1t
+h2il
+hil1a2
+hil1f
+hil4fr6
+hi5nak
+hin4ta
+hi2nu
+h2io
+hi5ob
+hi2rn
+hir5n5e
+hir6ner
+hi1sp2
+hi1th
+hi5tr6
+5hi2tz
+h1j
+h6jo
+h1k2
+hla2b1b4
+hla4ga
+hla6gr4
+h5lai
+hl8am
+h1las
+h1l8a
+h8l1c
+h1le1d
+h3lein
+h1ler
+h5l6er.
+h1li
+h2l2if
+h2lim
+h8lin1f
+h2l5int
+h2l2ip
+h2lit
+h4lor
+h3l6o1se
+h1ls
+h1me
+hme5e
+h1ne
+h2nee
+h2nei
+hn3eig
+h2nel
+hne8n
+hne4p3f
+h2n8erz
+h6ne2tz
+h1ni
+h2n2ip
+h2nit
+h1nol
+h6ns
+hn5sp2
+h1nu
+h2n2uc
+h2nu1d
+h2nul
+hoc8h1
+1hoh
+hoh1le
+hoh8lei
+2hoi
+ho1la
+ho4l3ar
+1holz
+h2on
+ho1ra
+6ho8r1g
+ho2rn
+5horn.
+ho3s1l
+hos1p2
+ho4spi
+h1p
+hpi6
+h1q
+6hr
+h1rai
+h8rank
+h5r6aum
+hr1c
+hr1c6r
+hrcre8
+h1re1d
+h3reg
+h8r4ei.
+h1rer
+h4r3er1b
+h8re2r1t
+h8r1g2
+h1ric
+hr5i6ns
+h2rom
+h2r1t
+hr6t5er1l
+hr2t1h
+hrtr6
+hr6t5ra
+hr8tri
+h6rum
+hr1z
+hs3ac8h
+h1sam
+h6s5a2m1t
+h1sc
+h1se
+h6s5ec
+h6s5er1l
+hs8erle
+h1so
+h4sob
+h1sp2
+h8sp8a
+hs1pe
+h8spel
+hs6p2o
+hs1pu
+h4spun
+h1str6
+h1stu
+h4s3tum
+h1su
+hs3u2n1d
+h1s
+h5ta.
+h5tab
+ht3ac
+ht1ak
+ht3ang
+h5tanz
+ht1ar
+ht1at
+h5taub
+h1te
+h2t1ec
+hte1f
+h4t3e2ff
+h2t3e1he
+h4t3e2if
+h8teim
+h4t3ein
+h4t3eis
+h6te2mp
+h8ten2t1f2
+hte1re
+hte8ren
+hter1f4
+h6ter1f
+hte8r1g
+h8ter1gr4
+h4t3er1h8
+hte2r1s
+h6t5ersc
+h8terst
+h8te1se
+h8tess
+h2t1eu
+h4t3ex
+ht1he
+ht5hu
+h1ti
+htr6
+ht5rak
+h2ts
+hts3ah
+ht1sc
+ht1se
+ht6sex
+ht8s1k2
+ht8so
+h1tu
+h2tz8
+h5tm
+hub5l8
+hu6b5r
+huh1l
+hu6hr
+h5uhr.
+hu6ld
+huld5a6
+hu1le
+hu8lent
+hu8l
+h5up.
+h1v
+h5weib
+h3weis
+h1z
+h1k
+h8kl8
+h2l8s
+h1ma
+hm6a8tu8
+hsc8h
+h1sche
+h8sche.
+h2t1s
+hu4s3c
+2h.
+2he
+8hi
+h6s
+hs5c
+hh1ne6
+h2ls
+hl4s3t
+h2t1t
+htte8re
+ia1d
+i5a2d1n6
+i1af
+i5ak.
+i1al.
+i1al1a
+i1a2lb
+i1a6ld
+ia1le
+i5alei
+i1al1f
+i1a2l1g
+i3a6l1h
+i1a6l1k
+i1a6ll
+i1a6l1p
+i1a8l1r
+i1a2ls
+i1a2l1t
+i1al1v
+i5a2l1w
+i3alz
+i1an.
+ia5na
+i3a2n1d
+ia1n8e
+ia8ne8b
+i1ang
+i3ank
+i5ann
+i1ant
+i1anz
+i6a1p2o
+i1ar.
+ia1ra
+ia6rab
+i5a2rr
+i1as.
+i1a2s1m
+i1ass
+i5a2st.
+i1at.
+i5a2ts
+i1au
+ia1z
+i5a2z1z
+i1be
+i6b5eig
+i6b5ei1s
+ibl8
+ib2le
+ib1li
+i4blis
+i1br
+i6b1r2ig
+i1bu
+i6b5unt
+i1b
+i6bb
+ic8h
+i1che
+i6ch5ei
+i6cher1b
+i1chi
+i6ch5i6ns
+ich1l6
+i6ch3m
+i2ch1n6
+i1cho
+i2cht
+icht5an
+icht3r6
+i1chu
+i8ch1w
+ic2k
+i2c2ks
+ickst8
+ick6s5te
+ic5l
+i1d
+id3a6r1m
+i1de
+3i2deal
+ide8na
+3i2deol
+ide5r8
+i1di
+id2io
+i6diot
+idr4
+id5rec
+i2d1t
+ie1a
+ie1b
+ie1ba
+ie6b5ar
+ie1be
+iebe4s3
+ie2bl8
+ie1b1r
+ie8bra
+ie4bre
+ie8b
+ie1d
+ie2dr4
+ie1e8
+ie1f
+ie6f5a1d
+ie2f5f
+ie2f1l
+iefr6
+ie4fro
+ie2f1t
+i1ei
+ie1le
+ie4l3ec
+ie8lei
+i1e4lek
+i3e6ll
+i1en.
+i1e2n1d
+ie1n6e
+i3en1f
+i5enn
+ien1ne
+ien6ne.
+i1en1p2
+i1en1r
+ie6ns
+i5ensa
+ien1sta
+ien8stal
+i5en1v
+i1enz
+ie5o
+ier3a4b
+ie4rap
+i2e1re
+ie4rec
+i2erei
+ie6r5ein
+ie6r5eis
+ie1r8er
+ie2rn
+i3ern.
+i2e1ru
+ie8rum
+ie8ru2n1d
+ie1sc
+iesc8h
+ie6s5che
+ie1ta
+ie6tau
+ie1te
+ie8te2r1t
+ie5the
+ie1tr6
+ie6t5ri
+i1e2t1t
+ie5un
+iex5
+2if
+i1fa
+if5ang
+i6fau
+i2ff
+if1fr6
+if5lac
+if1li
+i5f6lie
+ifr6
+i1fre
+i2ft
+ift5a
+if6t5r6
+i1ga
+ig3a2r1t
+2i1ge
+ige1s
+i8gess
+ig5he
+i5gla
+ign8
+ig2ni
+i5go
+i1gr4
+i2g3rot
+i2gs
+ig3s2p2
+i1ha
+i8ham
+i8ha6ns
+i1he
+i1hi
+ih1n
+i6h1r
+i1hu
+i8hum
+ih1w
+8i1i
+ii2s
+ii2t
+i1j
+i1k
+i1ka
+i6kak
+i8kerz
+i6kes
+ikl8
+ik4ler
+i1ku
+i6k5unt
+2il
+i5lac
+i1lag
+il3a6ns
+i5las
+i1lau
+il6auf
+i1le
+ile8h
+i8lel
+il1f
+il2fl
+i1li
+il2ip
+i4l3ipp
+i6ll
+il1le
+il6l5enn
+i1lo
+i2l1t
+ilt8e
+i1lu
+i1l
+i1ma
+i8ma2r1t
+i2m1b2
+i1me
+i8me1le
+i1mi
+i8mi1d
+i2m1m
+im1me
+imme6l5a
+i1mu
+i1m
+i5m
+i1n2ah
+ina5he
+i1nat
+in1au
+inau8s
+i2n1d
+8ind.
+in4d3an
+in1de
+5index
+ind2r4
+in1du
+3indus
+i1ne
+i5nec
+i2n1ei
+i8ner1w
+in1f
+in1fe
+3infek
+1in1fo
+in1ge
+ing8en
+5ing2e1ni
+in2gs
+ing5s6o
+in1h
+5inhab
+i1ni
+in6ie
+ini5er.
+5in1j
+in1k
+in8kt
+in1na
+in8nan
+i1no
+inoi8d
+ino1k
+in3o4ku
+i6ns
+in5sau
+in1sp2
+5in1s2pe
+ins1ti
+5instit
+in1str6
+5instru
+ins1z
+ins4ze
+in1te
+5inte1re
+5inter1v
+in3the
+in5t2r6
+i5ny
+in2
+i1nr
+in1s
+in8
+in5d
+i1ns
+2io
+io1a8
+io1c
+io1d
+io1de4
+io2di
+ioi8
+i1ol.
+i1om.
+i1on.
+i5on1b2
+i1o6n2s1
+i1ont
+i5ops
+i5o8p1t
+i1or.
+i3oral
+io3rat
+i5orc
+i1os.
+i1ot.
+i1o8x
+2ip
+i1pa
+i1pi
+i1p2l8
+i1pr6
+i1q
+i1ra
+ir1b
+ir6bl8
+i1re
+i1ri
+i6r1m
+ir1me
+ir8me8d
+ir2m1o2
+i2rn
+ir1na
+ir8nak
+i1ro
+i2rr
+irr1h8
+ir5rho
+i2r1s
+irsc8h
+ir6schl6
+ir6sc6h5r
+i5r6us
+i5ry
+i5r
+i1sa
+i1sam
+i8sa2m1t
+i6sar
+i2s1au
+isc8h
+i1sche
+i8scheh
+i8s6chei
+is6ch5m
+isc6h3r
+isch8
+i1se
+is8e1le
+ise3ra
+i4s3er1h8
+is3e2rr
+i1si
+isi1d
+isi6de
+i8si2n1d
+is1k2
+is1k2o
+is4kop
+i1so
+is2on
+iso1n5e
+isp2
+is1p2o
+is6por
+i1stu
+i8s5tum
+i5s1ty1
+i5s
+i1ta
+i4t5ab.
+i2t1a2m
+i8ta1x
+i1te
+ite2r1s
+i8tersc
+i1thi
+i1tho
+i5t6hr6
+i4t8h
+i1ti
+i8ti8d
+iti1k
+iti6kl8
+i2t1m8
+it1me
+itmen4
+i1to
+i8tof
+itr6
+it3ran
+it3rau
+i1tri
+itr2i5o
+i2ts
+it1sc
+it2se
+itsp2
+it5spa
+i2t1t
+ittr6
+it8tru
+i1tu
+i2tz
+it1ze
+it6z5e8r1g
+it6z1w8
+i1t
+it6r5e8
+itt2
+it2ts5
+i1t
+i1u
+iu6r
+2i1v
+i6va1d
+iv2a1ti
+iva8tin
+i1ve
+i8vei
+i6v5e1ne
+iver1
+i8ver1h8
+i2vob
+i8vur
+i1w
+iwi2
+i5xa
+i1xe
+i1z
+i1ze
+ize8n
+i1zi
+i8zir
+i6z5w8
+i8m
+i16r
+i5t.
+i5v
+i18
+i8
+i1e
+i65e2r1s
+ja5la
+je2t3r6
+6jm
+5jo
+jo5as
+jo1ra
+jou6l
+j2uc
+juc8h
+ju5cha
+ju1ge
+jugen4
+juge2n1d5
+jun2g5s6
+3j
+1ka
+kac8h
+8ka2chs
+8ka2k1z
+ka1la
+ka6l5d
+ka2m5t
+ka1na
+2k1an5l6
+8kapf
+k8a6pl8
+ka5r6a
+kar1b
+6k3ar1be
+ka1ro
+kar1p
+kar6p5f
+ka2r1t
+4k3arti
+8karz
+ka1r
+ka1si
+kasi5e
+ka1te
+ka6te1b
+ka2t1t
+kat8ta
+kau2f6s
+kau3t2
+2k1b
+2k1c
+4k1d
+ke6hr
+keh2r6s
+kehrs5a
+8keic
+2k1eig
+6k5ein
+6k5eis
+ke1la
+ke6lar
+ke1le
+ke8leis
+k4e8lo
+8ke2mp
+ken1te
+k5ente.
+k3en2t1f2
+8k5en2t1s
+6k1en2t1z
+ke1ra
+ker1l
+k5erlau
+2k1f8
+2k1g
+2k1h
+k2if
+ki5fl
+8ki1k
+kin2g6s5
+6kin1h
+k2io
+ki5os
+ki5sp2
+ki5th
+8ki88
+2k1k2
+kl8
+1kla
+8klac
+kla1ge
+k5lag8er
+kle1b
+kle4br
+k3leib
+3klei1d
+kle5isc
+4k3leit
+k3lek
+k1ler
+6k5l6er.
+5klet
+k1li
+2klic
+8k3lig
+k2lim
+k2lin
+5kl2ip
+5klop
+k3lor
+1kl
+2k1m
+k1ma
+k3man
+kma1ni
+kman6i5e
+kn8
+k1ne
+6kner
+k2ni
+kn8
+1k2o
+ko1a2
+ko1d
+ko1de
+ko6de.
+ko1i
+koi8t
+ko1mi
+ko6min
+ko1op
+ko1or
+ko1ph
+ko6pht2
+ko3ra
+ko8rd
+kor1de
+kor6d5er
+ko5ru
+ko2ts
+ko5t6sc
+k3ou
+3kow
+6k5ox
+2k1p2
+k1q
+1kr8
+4k3ra1d
+2k1rec
+4k3reic
+kre5i1e
+2krib
+6k1r2ig
+2kr2ip
+6kro1ba
+2ks
+k1sa
+k6sab
+k1sal
+ksa2l8s
+k1sam
+k8sa2m1t
+k6san
+k1sc
+k1se
+k2s1ex
+ksp2
+k5spat
+k5s1pe
+k1spi
+k8sp2il
+ks1p2o
+ks6por
+k1spr6
+kst8
+k1su
+k2s1uf
+2k1t
+kta8l
+kt5a6re
+k8tein
+kte8re
+k2t1h
+k8tin1f
+ktr6
+k2t3rec
+k2t1s
+1ku
+k2uc
+ku1c8h
+kuc2k8
+k3u6hr
+k6ui
+ku5ie
+ku2m2s1
+kun1f
+kun2ft
+kunf2ts5
+ku6n2s
+kunst3
+ku1ra
+ku8rau
+ku4ro
+kurz1
+4kus1ti
+ku1ta
+ku8
+6k1v
+2k1w
+ky5n
+2k1z
+1k
+k4m
+4k31mi
+k1se5
+1k
+k1c
+k1s
+1k
+k1c
+k2r1s
+kr6sc
+1la.
+8l1a2b1f8
+8la2b1h
+la1b2r
+2l1a8b1s
+lac8h
+lac6h3r
+la1d
+la8dr4
+5la1du
+8l1a2d1v
+6la2ff
+la2f5t
+la2gn8
+la1ke
+5laken
+8la2m1b
+la1me
+la6mer
+la2mp
+lam1pe
+5lampe.
+2l1a2m1t
+la1na
+1la2n1d
+lan4d3a
+lan4d3r4
+lan4gr4
+lan1m
+8lan1me
+6lann
+8la8n1w
+6lan1
+8l1ap1pa
+lap8p1l8
+lap6pr6
+l8ar.
+la5ra
+la4r4af
+la8rag
+la8ran
+la6r5a6s
+lar1b
+l3ar1be
+l2a1re
+la8rei
+la6r1m
+6larm.
+la8sa
+la1sc
+la8sta
+l2a1t8i
+6l5a2t1m8
+4laus3s4
+4l1au1to
+1la1w
+2lb
+l1ba
+l8bab
+l8bauf
+l1be
+lbe1d
+l8be1de
+l1bi
+l4b3i6ns
+lbl8
+l5blo
+l8bs
+lb1sta
+lbst5an
+lbs1t3e
+8lc
+lc8h
+l1che
+l8che2r1t
+l1chi
+l6ch3m
+l5cho
+l8ch5w
+6ld
+l1de
+l4d3ei
+ldr4
+ld1re
+l1d
+l6db
+le1b
+le2bl8
+le1br
+le8bre
+lec8h
+le2cht
+lech2t6s5
+le1d
+led2r4
+le1f
+6le2ff
+le1ga
+le4gas
+1le6hr
+lei6br
+le8in1f
+8leinn
+5lei1stu
+le2k1t
+4lektr6
+le1le
+le1ler
+le6l5e2r1s
+l4e1mo2
+8le2mp
+l8en.
+le2n1d
+8len2ds
+len1du
+6lendun
+le1ne
+l6enen
+le8ne2n1d
+len8er1w
+6l5en2t1s
+4l3en2t1w
+4l1en2t1z
+8len1zy
+8leo1z
+6le1pi
+le6p2ip
+8le1p2o
+1ler
+l6er.
+ler1b
+8ler8bs
+le8rd
+6l5er1de
+le1re
+l2erei
+le8reis
+le8re2n1d
+le4r3er
+4l3e8r1g
+l8er1gr4
+le6rk
+6ler1kl8
+ler1zi
+6l5erzie
+8ler8
+le1se
+8lesel
+le1si
+lesi5e
+les1k2
+le3s1k2o
+le3th6a
+le2t1s
+5le2uc
+4leu1ro
+leu4s3t
+le5xe
+6l1e8x3p2
+l1f
+2l1g
+l1ge
+lge2n1d8
+l8gh
+lg1li
+lg2lie3
+l3glie1d6
+6l1h
+1li
+li1ar
+li1as
+2lic2k
+li1d
+li8dr4
+li1en
+li5en6n
+li8e2r1s
+li8e2r1t
+2lie
+3lig
+li1ga
+li8ga8b
+li1g6n8
+l2il
+li1l8a
+8li2m1b2
+li1na
+li2n1d
+4l3in1du
+lin2gs5
+4l3in1h
+6l5in1j
+lin2k4s3
+4lin2k1t
+2lint
+8lin1v
+l2ip
+4lipp
+5lip1t
+li1sa
+4li1sam
+l2i1v
+livi5e
+6l1j
+6l1k
+l8keim
+l8kj
+lk2l8
+l1k2o
+lko8f
+lkor8
+l2ks
+lk2sa
+lk2se
+6ll
+l1la
+ll3a4be
+l8la2b1t
+ll8an5l6
+l2l1b
+l8l1c
+l6l1d6
+l1le
+l4l3eim
+l6l5ei1se
+l1ler
+ller3a
+l4le1ti
+l1li
+l5l2ip
+l1lo
+l4l3o2r1t
+ll5o1v
+l2ls
+ll1sp2
+ll6spr6
+l2l1t
+llte8
+l1lu
+l4l3u8r1g
+l1l
+l5l
+l6lb
+2l1m
+l1mo
+l6m5o6d
+6ln
+l1na
+l1no
+8lo1bl8
+lo6br
+loc8h
+3lo2ch.
+lo1fe
+l5o4fen
+l8o1g
+lo1ge
+5loge.
+5lohn
+4l3o6hr
+1lo1k
+l2on
+lo1pe
+4l3o4p8er
+lo1ra
+2l1o8rd
+6lo8r1g
+4lo2r1t
+lo1ru
+1los.
+l6o1se
+lo8sei
+lo1si
+3losig
+lo1v
+lo6ve
+lo1wi5
+6l1p
+lp2f
+l1ph
+l8pho
+l8p1n
+l2pst
+lp4s3te
+l2p1t
+l1q
+8l1r
+2ls
+l1sa
+l6s1a6r1m
+l1sc
+l1se
+l8sec
+l6s5e8r1g
+l4s3e2r1s
+l8s1h
+ls1l
+l5s6la
+l1sp2
+ls1p2o
+ls4por
+ls2pu
+l1str6
+l1su
+l8su1ni
+l1s
+2l1t
+l6t5a2mp
+l4t3ein
+l5ten
+l6t5eng
+l6t5er1p
+l4t3hei
+lt3her
+l2t1ho
+l6t5i6b
+lt2i1l
+ltr6
+l8tr
+l2ts
+lt1sc
+lt1se
+lt6s1er
+lt4s3o
+l1t5u2ms
+lu8br
+lu1d
+lu2dr4
+lu1en8
+8lu8fe
+lu2ft
+luft3a
+luf8tr6
+lu6g5r4
+2luh
+l1u6hr
+l6ui
+lu5it
+5l6uk
+2l1u2m1f6
+2l1u2m1w
+1lun
+lu1ni
+6l5u6n2io
+4l3un1te
+lu5ol
+4lu8r1g
+6lu2r1s
+l3u2r1t
+lu4sto
+lus1tr6
+lu6st5re
+lu8su
+lu6tal
+lu1te
+lu6t5e6g
+lu8te8r1g
+lu3the
+lu1to
+lu6t5or
+lu2t1r6
+lu65
+l1v
+l1ve
+lver1
+lv2e5r6u8
+2l1w
+1ly
+lya6
+6ly2m1p2
+ly1no
+l1ze
+l8zess
+l1zo
+l8zo8f
+lzw8
+l3zwei
+lz5wu
+3l2n1d
+l5on
+l6sc
+l2t1s
+5luf
+2l1ug
+lu6s5c
+l5v
+l1l
+1ls
+l16t
+6l11b6e2
+1ma
+8m1a2b1g2
+mac8h
+ma5chan
+ma1d2
+ma5el
+4ma2g1g
+ma1g8n8
+ma1la
+ma8lau
+ma6l5d
+8mal1de
+ma1li
+mali5e
+m8a1lu8
+ma8lut
+2m1a2mp
+3man
+ma2n1d2
+man3ds
+8man1gr4
+ma1ni
+man2i5o
+ma6ns
+8m5an1st
+6m1ap1pa
+mar1b
+4m3ar1be
+ma6rk
+mar8kr8
+ma1r4o
+ma2r1s
+marsc8h
+mar8s6ch2m
+3mas
+ma1sc
+ma1t
+4m5auf
+ma5yo
+2m1b
+m1b6r
+2m1c
+2m1d
+m2ds
+md6s
+1me
+me1c8h
+me5isc
+5me6ld
+me2ls
+mel8sa
+8me2mp
+me5nal
+me2n1d
+men4dr4
+me6ns
+men1sc
+mensc8h
+men8schl6
+men8s8chw
+men2t1s
+8mentsp2
+me1ra
+me8r1g
+mer4gl
+me1ro
+3mes
+me1se
+me6s5ei
+me1th
+me8
+2m1f6
+2m1g
+2m1h
+1mi
+mi1a
+mi6a1le
+m2il
+mi1la
+2m1i2m1m
+mi1na
+mi5n
+mi1sa
+mi4s3an
+mit1h
+mitr6
+mi5t6ra
+3mi2t1t
+mitta8
+mi65
+6mj
+2m1k8
+2m1l
+2m1m
+m1ma
+m6ma1d2
+m6m5ak
+m1me
+m8menth
+m8men2t1w
+mme6ra
+m2m1n8
+m2ms
+mm5sp2
+mm5u2ms
+mmu2t5s
+m8mn
+m1n8
+m5ni
+1mo
+mo5ar
+mo1d
+mo4dr4
+8mof
+m8o1g
+mo1ga
+mo8gal
+mo1k
+mok2l8
+mo4kla
+mo6l5d
+m2on
+mo2n1d
+mon8do
+mo1no
+mo4n3o1d
+m1o6ns
+mon2s1tr6
+mon1t8a
+6m5ony
+mo1pa6
+mo1ra
+mo8rd
+mor8d5a
+mo1sc
+mo1sp2
+5mot
+moy5
+2mp
+m1pa
+mpfa6
+mpf3l
+m1ph
+mphe6
+m1pi
+mpin6
+m1pl8
+mp2li
+m2plu
+m1p2o
+mpo8s1te
+m1pr6
+mpr5
+mp1t
+mp8th
+m1pu
+mput6
+mpu5ts
+m1p
+8m1q
+2m1r
+2ms
+ms5au
+m1sc
+msc8h
+msch4l6
+msp2
+ms6p2o
+mspr6
+m3spri
+m1str6
+2m1t
+mt1ar
+m8tein
+m2t1h
+m2ts
+mt6se
+mt8s
+mu5e
+6m5uh
+mu1mi1
+1mun
+mu2n1d
+mun6dr4
+mu1se
+muse5e
+mu1ta
+2m1v
+mvol2
+mvo6ll3
+2m1w
+1my
+2m1z
+m1k
+m6kl8
+1mn
+m1s
+m5tr6
+mu4s3c
+3m
+m1b2
+6ml
+1m
+5mn
+3mt
+1na.
+n5ab.
+8n1a2b1n
+n1a8b1s
+n1a8b1z
+na6b
+na2c
+nac8h
+na1ch3e
+3na2cht
+1nae
+na5el
+n1afr6
+1nag
+1n2ah
+na8ha
+na8ho
+1nai
+6nair
+na1k2o
+na4kol
+n1a2k1t
+nal1a
+8na1ly
+1na1ma
+na1me
+na4mer
+na1m2n8
+n1a2mp
+8n1a2m1t
+5nan1c
+nan6ce
+n1a2n1d
+n6and.
+2n1ang
+1na1ni
+1nann
+n1a6ns
+8na8n1w
+5napf.
+1n2ar.
+na2ra
+2n1ar1c
+n8a8rd
+1n2a1ri
+n8a6rk
+6n1a6r1m
+5n6a2r1s
+2n1a2r1t
+n8ar1v
+6na2t1m8
+na2ts
+nat6s5e
+1nau1e
+4nauf
+n3aug
+5na6ui
+n5a6uk
+n6a5um
+6n1au2s1b2
+6n1au1to
+1na1v
+2na1x
+3na1z
+1n8a
+n1b2
+n1ba
+nbau5s
+n1c
+nc8h
+nche5e
+n6ch5m
+2n1d
+nda8d
+n2d1ak
+n6d5a6ns
+n1de
+n2d1ei
+nde1la
+nde8lac
+nde2ls
+ndel6sa
+nder1h8
+n8derhi
+nde4se
+nde1sta
+nde8stal
+n2d1j
+n2d1n6
+nd1ni6
+ndn6is5
+n1do
+n6d5o2r6t
+ndr4
+nd3rec
+nd3rot
+n2ds
+nd1sa
+nd1sam
+nd8sa2m1t
+nd6sau
+n2dt
+ndt1h
+n1du
+n8du2m1d
+1ne
+ne5as
+ne1b
+ne2bl8
+6n5e2b1n
+2nec
+5ne1ei
+ne5en
+ne1g4l
+2n1egy
+4n1ein
+8neis
+ne1le
+4n3e4lem
+8ne2m1b
+2n1e2mp
+nen1a
+1ne1ne
+6n5e4ne8r1g
+nen3k
+8nen2t1b2
+4n3en3th
+8nen2t1l
+8n5en2t1n
+8n5en2t1s
+ne1ra
+ne5r8al
+ne8ras
+ner1b
+8ner1bi
+ne8rd
+ner1de
+6n5erde.
+ne1re
+n2erei
+nere5i6d
+ner1f
+ner1fo
+nerfor6
+ner1h8
+6n5erh
+ner1l
+8nerl
+2n1e2rr
+ne2r1s
+n8ers.
+ne2r1t
+nertr6
+6n5ertra
+2n1erz
+ne1si
+nesi3e
+net1h
+neu4ra
+neu5sc
+8neu
+n1f
+n2f5f
+nf2l
+nfl8e
+nflei8
+nf1li
+nf5lin
+n2ft
+nf2ts
+nft8st
+n1ga
+n8g5ac
+n6g5d
+n1ge
+ng8en
+nge1ra
+nge8ram
+n2g1g2
+ng1h
+ng1li
+n6glic
+n1gr4
+ng3r2ip
+ng8ru
+n2gs
+ng2se4
+ng2si
+n1gu
+n2g1um
+n1gy
+n1g
+n8gl
+n1h
+nhe6r5e
+1ni
+ni1bl8
+nic8h
+ni5ch
+ni1d
+ni1de
+ni8de1e
+n6ie
+ni1en
+nie6s5te
+niet5h
+ni8e2t1n
+n2i1ge
+4n3i6gel
+n6i1k
+n2il
+ni1la
+2n1i2mp
+ni5na
+2n1i2n1d
+8nin1f
+6n5in1h
+1ni1ni
+ni8nit
+6n5inn
+2n1i6ns
+4n1int
+n6is
+nis1tr6
+ni1th
+ni1tr6
+n1j
+n6ji
+n1ka
+n8ka1d
+nk5a6ns
+n1ke
+nker1l
+n8kerla
+n1ki
+n6k5in1h
+nkl8
+n5kl
+n1k2n8
+n8k5not
+n1kr8
+nk3rot
+n8kr
+n2ks
+nksp2
+nk5s1p2o
+n2k1t
+nk6t5r6
+n1ku
+n8kuh
+n1k
+n6kb
+n5l6
+n1li
+nli4mi
+n1m
+n1me
+nme6n4s
+n1na
+n1ne
+n8ne8r1g
+n1ni
+nn2i5o
+n1no
+nn1ta
+nn4t3ak
+nnt1h
+n1nu
+nnu1e
+n1ny
+n1n
+n1n
+n1n
+no5a
+no1bl8
+no4b3la
+4n3o8bs
+2no2b1t
+noc8h
+no1che8
+no1d
+no1di
+no6die
+no4dis
+no8ia
+no5isc
+no1le
+6n5o6le3u
+no1ma
+no4mal
+n8o1ni
+non6ie
+noni6er
+2n1on1k
+n1ony
+no1pe
+4n3o4p8er
+6nopf
+nop1t
+6n1opti
+no3ra
+n1o4ram
+no8rd
+nor6da
+4n1o8r1g
+2n1o2r1t
+n6os
+no1st
+8no2st.
+no1ta
+no8tan
+no1te
+no8ter
+no1ty1
+noty6pe
+6n5ox
+n1p2
+n1q
+n1r
+nrs3
+6ns
+n1sac
+ns3ang
+n1sc
+n1se
+n8sel1f
+n8s5er1f
+n8se8r1g
+n6se6rk
+ns5er1w
+n1si
+n8sint
+nsp2
+n1s2pe
+n1spr6
+n1sta
+n6s5tat.
+n1sto
+n6stob
+n1str6
+n1ta
+n1tag
+n4t3a4go
+nt5an1h
+n2t3a6rk
+n2t3a2r1t
+n1te
+n4t3eis
+nte5n6ar
+nte1ne
+nte8nei
+nter3a
+nte1re
+nt2e6rei
+nt1h6a
+nt6har
+n3ther
+nt5hie
+n3thus
+n1ti
+nti1c
+n8tin1h
+nti1t
+n2t1l
+ntlo6b
+n2t1m8
+nt1me
+ntmen8
+n1to
+n2t3o4ti
+n1tr6
+ntra5f
+ntra5ut
+nt8rea
+n2t3rec
+nt8rep
+n4t3rin
+nt8rop
+n4t3rot
+n4tr
+n2t1s
+nts6an
+nt2s1k2
+n1tu
+n2t1z
+n1t
+n1t
+n8tl
+n1t
+1nu
+nu1a
+nu5el
+nu5en
+4n1u6hr
+n6ui
+nu5ie
+8nu2m1l
+6n5u2ms
+6n5u2m1w
+2n1u2n1d
+6nu1ni
+6n5un1r
+2n1unt
+2nup
+2nu6r
+n5u1ri
+nus1k2
+nu3s1kr8
+nu5ta
+n1v
+8n1w
+1nys
+n1za
+n6z5a6b
+n2z1ar
+n6zaus
+n1zi
+nzi4ga
+n1zo
+n8zof
+n1zu
+n6z5unt
+n1zw8
+n1zwi
+n6zwir
+1nc
+5n1e
+5n6i
+n8l
+n6m
+n6re
+n5rz
+5nus
+n1l
+1nt
+n52z
+5n.
+6n12b
+5n
+o5ab.
+oa2l
+o8ala
+o1a2m
+o1an
+o1ba
+ob1ac
+o1be
+obe4ra
+o6ber1h8
+5o4be2r1s
+o4b2e1ru
+obe1se
+obe6ser
+1ob1j
+o1bl8
+o2b1li
+o8bs
+ob5s1k2
+3ob2st.
+ob8sta
+obstr6
+obst5re
+ob5s1z
+oc8h
+o1che
+oche8b
+o8chec
+o3chi
+och1l6
+o6ch3m
+ocho8f
+oc6hr
+o3chro
+o2cht
+och3to
+o3chu
+o8ch1w
+o1d
+o2d1ag
+o2d1d
+od2dr4
+o1de
+ode5i
+ode6n5e
+o2dt
+od1tr6
+o5e6b
+oe1d
+oe1de
+o5e6der.
+oe8du
+o1e1f
+o1e2l
+o1e2p
+o1er.
+o5e8x
+o1fa
+o2ff
+of1fa
+of8fan
+1of1fi
+of8fin
+of6f5la
+o5fla
+o1fr6
+8o1g
+og2n8
+o1ha
+o1he
+o6h5eis
+o1hi
+ohl1a
+oh1le
+oh4l3er
+5ohm.
+oh2ni
+o1ho
+o6hr
+oh1re
+oh1ru
+o1hu
+oh1w
+o1hy
+o1h
+o5ia
+oi1d
+o1id.
+o8i1di
+oi8dr4
+o5i2ds
+oisc8h
+o5i8s2ch.
+oi1se
+oiset6
+o1i2s1m
+o3i2st.
+o5i6tu
+o1j
+o1k
+ok2l8
+o1kla
+ok3lau
+o8kl
+o2k1t
+1okta
+o1la
+o6ld
+old5am
+old5r4
+o1le
+ole5in
+o1le1r
+ole3u
+o2l1g
+ol6gl
+o6l1k
+ol2k2l8
+ol2k4s1
+o6ll
+ol1la
+ol8lak
+ol8lauf.
+ol1le
+ol6lel
+ol8less
+o1lo
+o2l1s
+ols1te
+ol2ster
+ol6s1k2
+o1lu
+o1ly
+oly1e2
+5olym
+o1ma
+o2mab
+o3m6an
+o8mau
+o2m1b
+om1be4
+o1me
+o8merz
+o2ms
+om5sp2
+o1mu
+o1mun
+o8munt
+o1m
+o1m
+o1na
+ona8m
+o2n1a1x
+o1ne
+on8ent
+o6n5er1b
+8o1ni
+on6ie
+oni5er.
+on1k
+on1na
+on6n5a6b
+o1no
+ono1c
+ono1k
+o4no2k1t
+1o6ns
+on2t1s8
+o1n
+oo8f
+1o8o1g
+oo2pe
+oo2sa
+o1pa
+o1pe
+op8er
+3o4pe1ra
+opf2l
+o3pf1li
+opf3lo
+opf3r6
+o1pi
+o1pl8
+o2p1li
+o5p6n
+op8pa
+op6p1l8
+o1pr6
+op1t
+o3p4ter
+1opti
+o1p
+o5p
+o1q
+o1ra.
+o3ra1d
+o8ra2d1d
+1oram
+o6rang
+o5ras
+o8rauf
+orc8h
+or5cha
+o8rd
+or1da
+or4d3a4m
+or1de
+or8dei
+or8deu
+1or2d1n6
+or1do
+or4dos
+o1re
+o5re.
+o2re2h
+o8r5ein
+ore5isc
+or6enn
+or1f
+or8fla
+or8f1li
+o8r1g
+1or1ga
+or1ge
+5orgel.
+or2gl
+o1ri
+or2ie
+ori1en
+5o6rient
+o2rn
+or1na
+or8nan
+or8n
+o1ro
+o2rr
+or1r2h8
+o2r1t
+or6t5an
+or8tau
+or8te1re
+o1r6us
+o1ry
+o1r
+or12
+o1sa
+o1sa3i
+6o1se
+o8se6rk
+o1s1k2
+o6ske
+o6ski
+os2kl8
+os2k2o
+os2kr8
+os1n
+os1ni
+osn6i5e
+o1so
+o2s1o2d
+osp2
+os1pe
+o3s4p8er
+o1sta
+o4stam
+o6stau
+ostr6
+o3stra
+ost3re
+o1su6
+o6s5ur
+os1z
+o5s6ze
+o1ta
+ot3auf
+o6taus
+o1te
+o6ter1w
+o1th
+othe5u
+o2t6h1r6
+o1ti
+o1to
+oto1a
+otr6
+ot1re
+o1tri
+o1tro
+o2ts
+ot1sc
+o3t1su
+o2t1t
+ot6t5e8r1g
+ot2t3h
+ot2t5r6
+ot8t
+o1tu
+ou3e
+ouf1
+ou5f6l
+o5u6gr4
+o6ui
+ou5ie
+ou1ra
+ou6rar
+ou1t6a
+o1v
+o1wa
+o1we
+o6wer.
+o1wi
+o1wi1d6
+o1wo
+o5wu
+o1xe
+oy5al.
+oy1e
+oy1i
+o5yo
+o1z
+oza2r
+o1ze
+1o2zea
+o1zo
+ozo3is
+o8
+o1e
+o5e2l1t
+o1t
+3paa
+pa6ce
+5pa1d
+pag2
+1pak
+pa1la
+pa8na8t
+pa1ni
+pan6ie
+pani5el
+pa1no
+pa4nor
+pa6n1s2
+1pap
+pap8s
+p2a1re
+pa8rei
+pa6rk
+par8kr8
+par2o8n
+par5o6ti
+pa2r1t
+part8e
+5p8ar5tei
+3par2t1n
+pa2s1se
+pas6sep
+pa1th
+pa4th6a
+1pau
+6paug
+pau3sc
+p1b
+8p5c
+4p1d
+1pe
+4peic
+pe5isc
+2pek
+pen3k
+pen8to8
+p8er
+pe1ra
+pe1re6
+per5ea
+per5e1b
+pe4rem
+2pe2rr
+per1ra
+per8ran
+3pe2r1s
+4per1si
+pe3r
+pe4sta
+pe2t2s
+p1fe
+p2f1ec
+p4fei
+p2f1f
+pf2l
+5pf8lanz
+pfl8e
+pf8leg
+pf3lei
+2p2ft
+pf3ta
+p1g
+1ph
+2ph.
+2p1haf
+6ph1b2
+8ph1d
+6p5heit
+ph5e1me
+6ph1g
+phi6e
+8ph1k2
+6phn
+p5ho6ll
+pht2
+ph3th6a
+4ph3t1he
+phu6
+6ph1z
+pi1en
+pi5e2rr
+p2il
+pi1la
+pi1na
+pi6ns
+5pin1se
+p2io
+pi8o1ni
+pion6i8e
+1pis
+pi1s2k2
+pi1th
+p1k
+pl8
+5pla
+p2lau
+4plei
+p3lein
+2p1ler
+6p5les
+p1li
+2p3lig
+p6li1k
+6p5ling
+p2li1z
+plo1mi
+plo8min
+6p1m
+p1n
+1p2o
+8poh
+5pol
+po1la
+po8lan
+po1ly1
+po3ny
+po1ra
+2po2rn
+po2r1t
+por4t3h
+po5r
+5po1ti
+p1pa
+p1pe
+p6p5ei
+ppe6la
+pp5f
+p2p1h
+p1pi
+pp1l8
+ppp6
+ppr6
+pp5ren
+pp1s
+p2pst
+pp2s1te
+p5p
+pr6
+3preis
+1pres
+2p3r2ig
+5prinz
+1prob
+1pro1d
+5pr8o1g
+pro8p1t
+pro6t5a
+pro1te
+prote5i
+8pro
+pr3l
+1prs
+pr1te4
+1prf
+psc8h
+p5schl6
+2pst
+1p2sy
+p1t
+p8to8d
+p2t1s
+5p6ty1
+1pu
+pu1b2
+2p2uc
+pu1d
+pu2dr4
+pu2ff
+puf8fr6
+6p5uh
+pu6n8s
+pu1re
+pu8rei
+pu5s6h
+pu1ta
+p1v
+p3w
+5py
+py5l
+p1z
+p1de
+p6der
+p56m
+p8nu
+8pr
+pt5h
+p2t1s
+qu6
+1q6ui
+8ra2b1k2
+ra1bl8
+ra6b1la
+3rable
+ra2br
+r1a2b1t
+6ra8b1z
+ra1d
+ra4dan
+ra2dr4
+r8afa
+5ra3fal
+ra1fe
+ra4f3er
+ra5gla
+ra2g3n8
+6ra1ha
+ral5am
+5ra6ld
+4ra2l1g
+ra1li
+ra8li6ns
+2ra6ll
+ra2l5t
+ra1me
+8ramei
+r3anal
+r6a2n1d
+ran1de
+ran8der
+ran4dr4
+8ran1f
+6ran1ga
+5ran1gi
+ran8g1li
+r3an1gr4
+ra6ns
+ransp2
+rans5pa
+8ra8n1w
+r8anz.
+ra5or
+6rapf
+r8a5pl8
+rap1se
+rap6s5er
+2r1ar1b
+1rar1h8
+r1a6r1m
+ra5ro
+2r1a2r1t
+6r1arz
+ra1te
+ra8tei
+ra1th
+ra6t5he
+6ra2t1l
+r4a1tr6
+ra4t3ro
+ra2t1t
+r5atta
+rau1e
+raue4n
+6raus.
+r5au4sta
+rau1te
+rau8tel
+rau2t5s
+ray1
+r1b
+rbl8
+rb5lass
+r6b1ler
+rb1li
+rb4lie
+r1bo
+rbon6n
+r1br
+rbrec8h
+r8bre2cht
+r8bs
+rb6s5t
+r1ce
+r8ces
+rc8h
+r1che
+rch1l6
+r6ch3m
+rc6hr
+rch3re
+r2cht
+rch3tr6
+r8ch1w
+8rd
+r1da
+r1dac
+rdac8h
+r8da2chs
+r8d1ap
+rda5ro
+r1de
+rde5i6ns
+r1di
+rd2io5
+r8dir
+r1do
+rd3ost
+r1dr4
+r8drau
+1re.
+re1ak
+3re1a2k1t
+re3a2ls
+re1am
+re6am.
+re1as
+re1b
+re1be
+4reben
+re6bl8
+rec8h
+rech5a
+re1d
+r8e1di
+re3er
+re1f
+8re2ff
+3refl
+2reh
+5re1ha
+r4ei.
+reic8h
+rei2ch6s5
+rei1e
+8reier
+6r1eign8
+re5i2mp
+4r3ein1a4
+6r3ein1b2
+6rein1g
+6r5einn
+6rein1r
+4r3ei6ns
+r3eint
+re1li
+reli3e
+8r5e2l1t
+re2mp
+6r1emp1f
+2re2m1t
+ren5a6b
+ren8gl
+r3en1ni
+1re1no
+5ren1te
+4r3enth
+8ren2t1l
+4r3en2t1w
+8r1en2t1z
+ren4zw8
+re1on
+re1q
+requ6
+re1q6ui5
+1rer
+rer1b
+rer4bl8
+6rer8bs
+4r3e8rd
+rer1h8
+8rerh
+re6rk
+8rer1kl8
+rer1l
+4r3erla
+8rerl
+re2rn
+4r3er6ns
+6r5er1n
+rer5o
+re2rr
+rer1re
+6r5erreg
+re2r1t
+r5ertr6
+rer1w
+r5erwec
+r5er8
+re2sa
+re1sc
+resc8h
+re8s6ch2m
+2ress
+re5u8ni
+re1w
+6rewo
+2r1ex
+r1f
+r1fe
+r8fe8rd
+rf1li
+rf4lie
+8r1g
+r1ga
+r8gah
+r1ge
+rge1b
+rge4bl8
+rge5na
+rge1s
+rgest4
+rgn8
+rg6ne
+r2g1ni2
+r1go
+r8gob
+r1gr4
+r4g3ret
+r2gs
+rg1se
+rg8sel
+r1h8
+r2hy
+5rhy1t
+ri1ar
+ric8h
+ri5cha
+ri1d
+ri2d2g
+r2ie
+rie2g4s5
+ri8ei
+ri1el
+ri6e1le
+ri1en
+ri3er.
+rie2r1s
+ri5ers.
+r2if
+ri1fa
+ri6fan
+ri1fe
+ri8fer
+ri8fr6
+1r2ig
+ri1k
+ri8kn8
+r2il
+ri5la
+ri1m8
+ri1na
+ri2n1d
+r8in1de
+rin4ga
+rin6gr4
+1rinn
+rin1ne
+6rinner
+ri1no1
+ri6ns
+r8in1sp2
+4rinst
+ri1n2
+r2io
+rio1c
+ri5o6c8h
+ri1o2d
+ri3o6st
+2r1ir
+r2is
+ris1k2
+ri3s1k2o
+risp2
+ri8spr6
+ri5s1v
+r2it
+ri1ta
+6r5i6tal
+ri5tr6
+r2i1v
+ri1ve
+ri6ve.
+8r1j
+6rk
+r1ke
+rke6hr
+rkeh2r6s5
+r1ki
+rkl8
+rk1li
+r3k2lin
+r1k2n8
+r2ks
+rkst8
+rk3str6
+r2k1t
+rk4t3an
+rk6to
+r1ku
+r6kuh
+r1k
+rk4s3t
+r1l
+r5li
+rli1ne
+rline5a
+6r1m
+r1ma
+r3man
+r6m1an5l6
+rma4p
+r4m3a1ph
+r1mi
+r8min1f
+r1mo
+r8mob
+r2ms
+rm5sa
+2rn
+r1na
+rna8be
+r5ne
+rn2ei
+r6ne2if
+r6nex
+r6n1h
+rn1k
+r1no
+r6n5oc
+r6ns
+rn1sp2
+r1n
+r1n
+ro1be
+ro6be2rn
+6ro8bs
+ro1c8h
+roc2k
+3ro2ck.
+ro1d
+ro5de
+ro1e
+4ro1fe
+ro1he
+ro8he2r1t
+1ro6hr
+ro5i1d
+ro1in
+ro5isc
+ro1ly
+6r5olym
+r2on
+6r1o8o1g
+ro1ph
+ro6phan
+r3o2r1t
+ro1s2p2
+ro5s6w
+ro1ta
+ro4tau
+ro1tr6
+ro6ts
+5rout
+r1p
+r1pe
+rp8er
+rpe8re6
+rp2f
+r2ps
+r2p1t
+r1q
+2rr
+r1ra
+r1re
+r1rer6
+rr1h8
+rr6hos
+r5rh
+r1ri
+r1ro
+rro8f
+rr8or
+rror5a
+r1ru
+r3ry
+r1r
+r1r
+r1r
+2r1s
+r2s1te
+r2s1ti
+r6sab
+r4san1f
+r1se
+rse6e
+rse5na
+r2s1h
+rs1k2
+r6s1ka
+r6ski
+rs2kl8
+r8s1k2o
+r2s1l
+rs2p2
+r1sta
+r6stauf
+r8ster1w
+rstr6
+r8stran
+r2s1w
+rs1wi3d4
+r2s1z
+2r1t
+2r2t3a2r1t
+r8taut
+r5tei
+rt5e2i1ge
+r8te1pe
+r4t3er1h8
+rter1l
+r8terla
+r4t3hei
+r5t6hu
+r4t3int
+rtr6
+r4t5re2if
+r2ts
+rt1sc
+rt1se
+rt6s1er
+rt6s5o
+rt6s5u
+r6t5u2n1d
+2r8tu2r1t
+ru1be6
+ru1en
+1r4uf
+ru2fs
+ruf4st
+r6ui
+ru1ie
+2r1u2m1g
+2r1u2m1l
+2ru2ms
+ru2n1d
+run1de
+run8der
+run4d5r4
+6run2d1z
+6run1f
+8ru6ns
+2r1unt
+2r1ur
+r6us
+ru6sta
+rus1tr6
+ru6tr6
+1ru2ts
+r1v
+r1ve
+rven1
+rvi2c
+r1w
+r1x
+r1za
+rz5ac
+r6z5al
+r8z1ar
+r1ze
+r8ze8rd
+r6z5er1f
+rz8er1h8
+r2z1t
+rz4t3h
+r1zu
+r8zum
+r4s1te
+ru8sc
+r1f
+5r6hr
+r5le
+3r6ll
+r1mi
+5rmis
+r1r
+r2sc
+3r2mp
+1sa.
+1saa
+sa1be
+s3a4ben
+sa2bl8
+2s1a8b1s
+6s1a2b1t
+6s1a2b1w
+sac2k
+3sa2ck.
+sa1d
+sa1de
+6s3a4der
+1saf
+s8a1fa
+4s1a2ff
+sa5fr6
+1sag
+1sai
+sa1i2k1
+4s1a2k1t
+1sal
+sa1la
+sa6l1p
+4s3alpi
+sa2l1t
+6salter
+salz3a
+1sam
+s5an1b2
+san2c
+1sa2n1d
+san1ge
+s5angeh
+6s1an5l6
+2s1a6ns
+6s3an1tr6
+8s1a8n1w
+s1ap
+s6a1ph
+8sa1p2o
+sap5p6
+s8ar.
+2s1ar1b
+3sa8r1g
+s1a6r1m
+sa5ro
+2s1a2r1t
+6s1arz
+1sas
+1sat
+s8a1t8a
+2s1a2t1l
+sa1to
+sa8tom
+3s8au1e
+s5au2ff
+sa6u5i
+s6aur
+2s1aus
+5s6au1se
+2s1b2
+2s1ca
+s4ce
+sc8h
+8s2ch.
+3scha.
+scha1d
+5scha1de
+3schaf
+3schal
+sch5a1me
+8schan1c
+8s6ch1b2
+1sche
+6s1che1f
+8schex
+2s6ch1f2
+2sch1g
+2s4ch1h
+1schi
+2sch1k2
+schl6
+5schlag
+5schlu
+s6ch2m
+6sch3m
+s2chn6
+6sch1n8a
+1scho
+6scho8rd
+6s6ch1p
+sc6hr
+3schri
+8sch1ric
+8sch1r2ig
+8schrou
+6s2chs
+2s2cht
+sch3ta
+sch3tr6
+1schu
+8s6ch3unt
+6sch1v
+2sch1z
+5sch
+5sch
+2s1c8o
+s1c6r
+scre6
+6s1cu
+2s1d
+1se
+se5an
+se1ap
+se1b
+se1be
+se6ben
+se5ec
+se1ei
+see5i6g
+se3er1l
+se1f
+8se2ff
+se1ha
+se6han
+se8hi
+se8h
+sei1d
+6s5eid.
+2s1eig
+s8e2il
+5sein.
+sei5n6e
+6s5ein1h
+3s8eit
+3sel.
+se1la
+se4lar
+se2lb4
+se1le
+6s3e4lem
+se1ler
+se8ler1l
+2s1e2mp
+sen3a2c
+se1ne
+se5nec
+6s5en2t1s
+4s1en2t1z
+s8er.
+se1re
+s2erei
+se8reim
+s2e1ri
+se1r5inn
+se6r1m
+8serm
+8s5er1zi
+ser8
+6ser1f
+se1um
+8sexa
+6s1e8x3p2
+2s1f2
+sfa6ll
+sfal1le
+sfal8ler
+2s3g2
+s1ge
+sge5b2
+s1h
+s8he1w
+5s6h2ip
+5s4hop
+1si
+2siat
+si1b
+sic8h
+si2cht
+sich2t6s
+si1d
+si1de
+6s5i6de1e
+sie1ge
+siege6s5
+si1en
+si5e2rr
+s2i1f2
+si1g2n8
+si6g5r4
+si1k
+si1ka
+si8kau
+sik1i
+si4kin
+si2kl8
+si8k
+s2il
+si1la
+si2lb
+sil6br
+si1na
+2s1in1f
+sin5g1h
+2s1in1h
+sin1ne
+sinne6s5
+2s1i6ns
+si5ru
+si5str6
+4s1j
+s1k2
+6sk.
+s1ka
+2skau
+ske8l6c
+skelc8h5
+s6ke1le
+1s2ki.
+3s4kin.
+s6ki1z
+s8kj
+6skn8
+s1k2o
+2s3kow
+s1kr8
+3s2krib
+3s2kr2ip
+2s1ku
+8s1k
+s1l
+s8lal
+slei3t
+s4low
+2s1m
+s1n
+6sna
+6snot
+1so
+so1c8h
+so1d
+2s1o1do
+so4dor
+so1fe
+6s5o4fen
+so1lo3
+s2on
+so5o8f
+4so1pe
+so1ra
+2s1o8rd
+so8r1g
+4s1or1ga
+so2u5c
+so3un
+4s3ox
+sp2
+8s3paa
+5spal
+1span
+2s1pap
+s1pe
+s2pec
+s4peis
+1s2pek
+sp8er
+s6pe8r1g
+4s3pe2r1s
+s6pes
+2s1pf
+s1ph
+8sphi
+1s2ph
+1spi
+spi4e
+6s5pig
+spi6ns
+6s5pin1se
+2s1pis
+spl8
+2s5pla
+s1p2o
+2s5pol
+5s6pom
+6s5pos
+6s5po1ti
+spr6
+1spra
+3s8prec
+6s3preis
+5spring
+6s1prob
+1spru
+s1pu
+s2pul
+1s2pur
+6s5py
+5spn
+1sp
+s1q
+2s1r
+2ssa
+2s1se
+2s1si
+2s1so
+2s1s
+2ss
+2ss
+2s1sc8h
+sse8nu
+ssi1ni
+ssin6i6s
+ssoi6r
+2st.
+1sta
+4s1ta1fe4
+2s1tag
+sta3la
+6s1ta1le
+4s2ta2l1g
+8sta6l1k
+8s2t1a2m1t
+6st5an1f
+4st3a6ns
+6st5a8n1w
+6star1b
+sta4te
+6staus
+2s2t1b2
+6s2t1c
+6s2t1d
+s1te
+4s1te2il
+3s2tep
+6s5tep1pi
+8ste2s1se
+6s2t1f2
+2s2t1g2
+2sth
+st1h6a
+st3hei
+s8t1hi
+st1ho
+st5hu
+s1ti
+s2ti4el
+4s2ti2g1m
+6s2t1i2n1d
+4s2tin1f
+s2ti8r
+2s2t1k2
+2s2t1l
+2s2t1m8
+1sto
+sto6ll
+6s5toll.
+4st3o1pe
+6s5topf.
+6sto8rd
+6s2t1p2
+str6
+4s1trai
+s3tral
+6s5tr6aum
+3str8a
+3s2trec
+6s3tre1f
+8s3treib
+5s4tre2if
+6st1re1no
+6stres
+6st3re1v
+2s2t5r2ig
+8s2t1r2is
+s8tro1ma
+st5r6o1se
+4st1r4uf
+3strum
+6s1trg
+2s2t1s6
+2s2t1t
+1stu
+stu5a
+4s1t2uc
+2s1tu1e
+8stun.
+2s2t1v
+2s2t1w
+s1ty1
+s2tyl
+6s2tz
+1st
+8s5tg
+1st
+1st
+8s5tc8h
+4s1tr.
+1su
+su2b1
+3s2uc
+su1e
+su2fe
+su1ma
+su8mar
+su2m1f6
+6sumfa
+8su2m1k8
+2s1unt
+sup1p2
+su1ra
+6s5u6ran
+su2r1t
+6surte
+2s1v
+2s1w
+1sy
+8syl.
+sy5la
+syn1
+sy2na
+sy1ne4
+s1z
+s1ze
+s4ze2n1d
+sze1ne
+5s6z4ene.
+8s1zu
+1s
+6s52n1d
+s1ug
+6su1gi
+6s1u
+5sm
+2s12b
+1sc
+s8di
+1sn
+5s
+taa2t2s3
+4tab.
+t6a1ba
+taba6k
+ta8ban
+ta1b2l8
+ta1br
+ta6b1re
+4ta8b1s
+t3ab1sc
+8ta8b1z
+tac8h
+6t3a2cht
+ta1d
+ta1de
+ta6der
+6tadr4
+ta2d6s
+ta2d2t1
+1ta1fe4
+1tag
+ta6ga6
+ta1ge
+ta8gei
+tage4s
+ta2gs
+tag6s5t
+tah8
+tahl3
+tai1ne
+tai6ne.
+ta5ir.
+ta2k1t
+tak8ta
+tal3au
+1ta1le
+ta8leng
+ta1ler
+ta6l5e2r1t
+ta1me
+6t5a6mer
+6ta2mp
+tam1pe6
+2t1a2m1t
+ta2n1d
+tan5d6a
+tan8dr4
+tan2ds
+tand1s5a
+ta1ni
+tan6i5e
+6t1an5l6
+2t1an1r
+t3a6ns
+8t5an1tr6
+ta1nu6
+t5a8n1w
+8tanwa
+tan8zw8
+ta1ra
+ta8rau
+tar1b
+6tar1be
+1t2a1ri
+2ta6rk
+2t1a6r1m
+ta1ro
+2ta2r1t
+t3arti
+6tarz
+ta1sc
+ta1si
+ta6si1en
+tas1te
+ta8stem
+ta8s1to
+t5au2f1b2
+4t1au2f1n
+8taus.
+5tau1se
+8t1au2s1f2
+6t1au2s3g2
+t5au8s1l
+2t1b2
+2t1c
+tc8h
+t6chu
+2t1d
+te2am
+tea4s
+te1b
+te1be
+te8ben
+tec8h
+5t8e2ch3n6
+te1f
+4te2ff
+te1gr4
+te4g3re
+te1ha
+te6hau
+2te1he
+te4hel
+2t1e6hr
+tei1d
+te5id.
+teig5l
+6t1eign8
+tei8gr4
+1te2il
+4tein1h
+t5einhe
+4teis
+tei1se
+t5eisen
+8tei1w
+te1la
+te8lam
+te4lar
+te1le
+4t1elek
+8telem
+te1ma
+te6man
+te6n5ag
+te1ne
+ten8er1w
+ten5k
+te6ns
+ten1s4p2
+ten1tr6
+ten8tro
+4t3en2t1w
+8t1en2t1z
+te1pl8
+te6p1li
+5tep1pi
+ter5a6b
+te3ral
+ter5au
+ter1b
+ter1ba
+8terbar
+ter1be
+t5erbe.
+6terben
+8ter8bs
+4t3er2b1t
+te8rd
+ter1de
+t5erde.
+te1re
+tere1b
+ter5e1be
+t2erei
+ter5ein
+te1rer
+te8re2r1s
+ter1f4
+ter1h8
+8terh
+te6rk
+ter1kl8
+6t3er1kl
+te2rn
+ter1no
+ter8nor
+te2rr
+ter1re
+ter6re.
+te2r1s
+tersc8h4
+t8erscha
+te1se
+t5e6sel
+te2s1ta
+te8stau
+t3eu1ro
+te1xa
+tex3e
+8t1e8x3p2
+te8x1t
+tex6ta
+2t1f2
+2t1g2
+2th.
+th6a
+5tha.
+2t1haa
+6t1hab
+6t5haf
+t5hah
+8thak
+3t2hal.
+6tha2ls
+6t3ha2n1d
+2t1hau
+1the.
+3t4hea
+t1he1b
+t5he2il
+t3heit
+t3hel1f
+1t8heo
+5t4he1rap
+5ther1f
+6t5herz
+1thes
+1thet
+5thi.
+2t1h2il
+t3him
+8thir
+3this
+t5h1j
+2th1l
+2th1m
+th1n
+t5hob
+t5hof
+4t1holz
+thop1t
+6th1opti
+1t6hr6
+4ths
+t1hum
+1thy
+4t1h
+2t1h
+t1h
+ti1a2m
+ti1b
+tie1f
+tie1fe
+tie6fer
+ti1en
+t2i1ge
+ti8gerz
+tig3l
+ti1k
+ti8kin
+t2il
+ti5lat
+1ti2l1g
+t1i2n1d
+tin4k3l8
+tisp2
+ti3spa
+ti5str6
+5ti1te
+ti5tr6
+t2i1v
+ti1ve
+ti8vel
+ti8vr
+2t1j
+2t1k2
+2t1l
+tl8a
+2t1m8
+2t1n
+3to1be
+8t1ob1j
+toc8h
+to3cha
+5to2cht
+8toc2k
+to1d
+to1de4
+to8del
+to8du
+to1e
+to1fe
+6t5o6fen
+to1in
+toi6r
+to6ll
+5toll.
+to1me
+to8me1ne
+t2o6ns
+2t1ony
+to1pe
+to4p8er
+5topf.
+6top1t
+to1ra
+to1s
+to2s1te
+to1s1k2
+to6s1ka
+tos2l
+2to1ti
+to1tr6
+t8ou
+2t1p2
+6t1q
+tr6
+trac8h
+tra5cha
+tr8afa
+tra8far
+tra2f5t
+1trag
+tra6gl
+tra6gr4
+t3rahm
+1trai
+t6ra6ns
+tra3sc
+tra6st
+3trau1e
+t4re.
+2trec
+t3rec8h
+t8rec2k
+6t1re1d
+t8ree
+4t1reg
+3treib
+4tre2if
+8t3reis
+8tre1p2o
+tr6e6t5r6
+t3re1v
+4t3re1z
+1trib
+t6ric2k
+tr2ie
+tri6er
+2t1r2ig
+t8rink
+tr2io
+tri6o5d
+tri1z
+tri1zi5
+tro1a
+3troc
+troc2k
+trocke6
+tro5i8d
+tro1ma
+tro3m6an
+tro8man.
+tr2on
+tro3ny
+5tropf
+6t5ro1sa
+t5ro
+5trub
+5trup
+trut5
+1trg
+6t1rh
+5trb
+tr53bu
+t1rc
+t1rs
+2ts
+ts1ab
+t1sac
+tsa8d
+ts1ak
+t1sal
+t6s5a2l1t
+ts1an
+ts1ar
+ts3auf
+tsc8h
+t3sc6hr
+t5sch
+t1se
+tse6e
+tse1e5i
+tsei6n6s
+ts3ent
+ts1er
+t8ser1f
+t4se6rk
+t8s1h
+t1si
+5t6si1k
+t4s3int
+t1so
+tso2r1t
+ts5ort.
+tsp2
+ts1p2o
+t5s6por
+tspr6
+t6sprei
+t1st
+t2s1te
+t1sta
+t6s5tanz
+t2s1th
+ts1ti
+t6stit
+t1sto
+t4s3tor
+t1su
+1t2sua
+t2s1uf
+t8sum.
+t2s1u8n
+t2s1ur
+2t1t
+tt5e2if
+tte6sa
+tt1h6a
+ttr6
+tt8ret
+t2ts
+tt1sc
+tt1se
+tt8s1er
+tt5s6z
+1t2uc
+tuc8h
+tuch5a
+1tu1e
+6tuh
+t5u6hr
+t6u1i
+tu6it
+1tu2m1h
+6t5u2m1r
+1tu2ms
+8tu2m1t
+6tu2n1d
+6tun1f
+2t1unt
+tu5ra
+tu6rau
+tu1re
+tu6re.
+tu4r3er
+2t1v
+2t1w
+1ty1
+ty6a
+ty8la
+8tym
+6ty6o
+2tz
+tz5al
+tz1an
+tz1ar
+t1ze
+t8zec
+tzeh6
+tzehn5
+t6z5ei.
+t1zo
+t6zor
+t1zu
+t4z3um
+t1z
+t6zu
+5tg
+6th
+t52l1t
+t8n
+t1re8
+8t8st
+6t1u
+t2ff
+tf5fe
+t5ffen
+8t8k
+1tn
+4tb
+t1b6e2
+t34ber1
+t65b8er.
+5tc8h
+1tr.
+u3al.
+u5a2lb
+u5al1f
+u3a6l1h
+u5a6l1k
+u3a6l1p
+u3an.
+ua5na
+u3a2n1d
+u5a6ns
+u5ar.
+ua6th
+u1au
+ua1y
+u1ba
+u2bab
+u1bi
+ub6ie
+ubi5er.
+u1br
+u6b5r2it
+u8bs
+ubs2k2
+u5b
+u1b
+u8bb
+2uc
+uc8h
+u1che
+u6ch5ec
+u1chi
+uch1l6
+u6ch3m
+u2ch5n6
+uc6h1r
+u2cht
+uch5to
+uchtr6
+ucht5re
+u1chu
+u8ch1w
+uc2k
+uc1k1a
+uck5in
+u1d
+ud4a
+u1ei
+u6e1la
+ue1ne8
+u6ep
+u1er
+uer1a
+ue1re
+ue1rer
+ue8rer1l
+uer5o
+u8e1sc
+u2est
+u8e1v
+u1fa
+u1fe
+u2f1ei
+u4f3ent
+u8fer1h8
+u2ff
+uf1fr6
+uf1l
+ufr6
+uf1ra
+uf1re
+uf1r
+uf1r
+u2fs
+uf1s2p2
+uf1st
+u2ft
+uf2t1s
+u1ga
+u8ga2b1t
+u8ga1d
+u6gap
+u1ge
+uge1b8
+u8gn8
+u1go
+ugo3s4
+u1ha
+u1he
+u1hi
+uh1le
+u1ho
+u6hr
+uh1re
+u1hu
+uh1w
+u1h
+u1h
+6ui
+ui5en
+u1ig
+u3i6ns
+uin1te
+uin8tes
+uisc8h
+u5i8s2ch.
+u1j
+6uk
+u1ke
+u1ki
+u1kl8
+u8klu
+u1k6n8
+u5ky
+u1la
+u6ld
+ul2ds
+uld8se
+u1le
+u6ll
+ul1la
+ul8lac
+ul6lau
+ul1le
+ul6le6l
+ul6lo
+u6ln
+ul1ni8
+u1lo
+ulo6i
+u2l1t
+ult6a
+ult8e
+u1lu
+ul1v
+ul2vr
+u1l
+u1l
+u2m1f6
+3umfan
+u2m1l
+5umlau
+u1mo
+u8mo8f
+u2mp
+um1ph
+um8pho
+u1mu
+umu8s
+u5m
+u1n1a
+un2al
+un6at
+unau2
+u2n1d
+6und.
+un1de
+un2d1ei
+5undein
+un1du
+un4d3um
+un2d1z
+3undzw8
+un1d8
+un8db
+u1ne
+une2b
+u2n1ec
+une2h
+u8n3eis
+un1f
+3unfal
+1un1f
+un1ge
+5unge1a2
+3un1gl
+un2g2s1
+un8g
+u1ni
+1u2n2if
+un4it
+un1kr8
+un8kro
+un2k5s
+u1no
+un1p2
+unpa2
+u6ns
+uns2p2
+un1v
+unvol4
+unvo6ll5
+u5os.
+u1pa
+u1pi
+u1p2l8
+u1pr6
+u2p4s3t
+up1t
+up2t1a
+u1q
+u1ra
+ur5a8b1s
+ura8d
+ur5ah
+u6rak
+ur3a2l5t
+u6rana
+u6r5a6ns
+u8rap
+ur5a6ri
+u8ra2t1t
+u1re
+ur3eig
+u8r1g
+ur1gr4
+ur8gri
+u1ri
+ur5i6ns
+ur1l
+3urlau
+u6r1m
+ur1me
+urmen6
+u2rn
+ur1na
+ur8nan
+u1ro
+u2r1s
+3ursac
+ur8sau
+ur1se
+ur8sei
+ur4s1k2
+u2r1t
+3ur5tei
+u1ru
+ur6u5i6
+u2r1u6r
+u1ry
+ur2za
+ur6z
+ur56m
+u5r
+u1r
+ur8c2k3
+u1sa
+u1sag
+usa4gi
+u2s1ar
+u2s1au
+usc8h
+u1sche
+u8schec
+us8chw
+usch5wi
+u1se
+u2s1ei
+use1ke
+use8kel
+u8s1l
+u1sta
+u4st3a4b
+us3tau
+u1su
+u2s1uf
+u8su2rn
+ut1ac
+u1tal
+uta8m
+u1tan
+ut1ar
+u1tas
+ut1au
+u1te
+u8teic
+u4tent
+u8ter1f4
+ut2e1ri
+u6terin
+u4t3hei
+ut5ho
+ut1hu
+u1ti
+uti1ne5
+uti6q
+u1to
+uto5c
+u1tr6
+u2ts
+ut1sa
+ut1s6p2
+ut1st
+utstr6
+ut6stro
+u1tu
+u2tz
+utz5w8
+u1u
+u1v
+u1ve
+uve5n
+uver1
+uve3r4
+u1w
+u1xe
+u5ya
+uy5e6
+u1yi
+u1ze
+u2z1eh
+u8zer1h8
+u5
+u1e
+ue6n
+ue1n5e
+8van1b2
+6vang
+6var1b
+va8r8d
+v8a6t5a
+va1te
+va8tei
+v4a2t1r6
+2v1b
+6v5c
+6vd
+1ve
+6ve5g6
+ver1
+ver5b
+verb8l8
+ve2re2
+ve8r1g8
+v2e2ru8
+ve1s
+ve2s3p2
+ve3xe
+2v1f
+2v1g
+6v5h
+vi6el
+vie6w5
+vi1g4
+v2il
+vi1le
+vi8le8h
+vi6ll
+vil1le
+vil6le.
+8vint
+vi1ru
+vi1tr6
+2v1k
+2v1l
+2v1m
+4v5n
+8vo8f
+vo2il
+voi6le
+vo6ll
+vol1le
+vol8le2n1d
+vol8li
+v2or1
+vo2re
+vo1ri
+vo8rin
+vo2ro
+2v1p
+8vra
+v6re
+2v2s
+2v1t
+2v1v
+4v3w
+2v1z
+wa2ff
+waf5fe8
+wa6g5n8
+1wah
+wah8n
+wa5la
+wa6ld
+wal1di
+wal8din
+wa2l1t
+wal6ta
+wa2n1d
+wan4dr4
+5w2a1re
+wa8ru
+war4za
+1was
+w5c
+w1d
+5wec8h
+we1f
+we6fl
+1weg
+we1ge
+we8geng
+weg5h
+weg3l
+we2g1r4
+we6hr
+weh1re
+weh6r5er
+5wei1se
+weit3r6
+we2l2t
+welt3r6
+we6rat
+8wer1c
+we8rd
+5wer1du
+wer1f
+wer4fl
+we6rk
+5werk.
+wer4ka
+wer8ku
+we2r1t
+wer4ta
+wer8te6r1m
+we2sp2
+wes1te
+we8s4te2n1d
+we8str6
+we8st
+we2t1t
+wet8ta
+wic8h
+wi2chs
+wich6s5t
+1wi1d
+wi2dr4
+wie1d
+wie1de4
+wieder5
+wi1k6
+wi2m1m
+wim6ma
+wi2n1d
+win4d3r4
+5wi2r1t
+wisc8h
+wisch5l6
+1wj
+6wk
+2w1l
+8w1n
+wo1c
+woc8h
+wo1che6
+wol6f
+wo2r1t
+wor6t5r6
+6ws2
+w1s1k2
+6w5t
+wu2n1d
+wun1de
+5wunde.
+wun6gr4
+wu1sc
+wu2t1
+6w5w
+wy5a
+w6r1m
+wr1me5
+w1sc
+1xag
+x1ak
+xa1me
+x3a4men
+8xa2m1t
+x1an
+8x1b
+x1c
+1xe.
+x3e4g
+1xen
+xe1ro
+x1erz
+1xes
+8xf
+x1g
+8x1h
+1xi
+8xi1d
+xi8so
+4xis1te
+x1k
+6x1l
+x1m
+8xn
+1xo
+8x5o6d
+8x3p2
+x1r
+x1s6
+8x1t
+x6tak
+x8ter1f4
+x2t1h
+1xu
+xu1e
+x5ul
+6x3w
+x1z
+5ya.
+y5an.
+y5ank
+y1b
+y1c
+yc8h
+y6cha
+y4chia
+y1d
+yen6n
+y5e2rn
+y1g
+y5h
+y5in
+y1j
+y1k2
+y1lak
+yl1al
+yla8m
+y5la1x
+y1le
+y1lo
+y5lu
+y8m1n8
+y2m1p2
+y3mu
+y1na
+yno2d
+yn1t
+y1on.
+y1o4p
+y5ou
+y1p2o1
+y1pr6
+y8ps
+y1r
+yr2i3e
+y2r1r2
+y1si
+y2s5iat
+ys8ty1
+y1t
+y3w
+y1z
+y8m
+z5a6b
+za1b5l8
+8za6d
+1zah
+za5is
+4z3ak
+6z1am
+zan1ge
+5zange.
+8z1an5l6
+2z1a1ra
+6z5as
+z5auf
+3zaun
+2z1b
+6z1c
+6z1d
+1ze
+ze1d
+ze1di
+ze4di1k
+ze1f
+4z3e2ff
+8zein
+zei4ta
+zei1te
+zei8te2r1s
+ze6la
+ze1le
+ze8lec
+ze2l1t
+zel8th
+4ze2mp
+zen1ge
+6z5engel
+zen1zi
+zen8zin
+ze8r1g
+8zer1g
+z2e1r8i
+ze1ro
+ze2r1s8
+ze2r1t
+zerta8
+zer8tab
+zer8tag
+8zerz
+ze8s1te
+zeu6gr4
+2z1ex
+2z1f8
+z1g
+4z1h
+1zi
+zi1en
+zi5es.
+4z3i2mp
+zi1na
+6z5in1f
+6z5in1ni
+zi6ns
+zin1se
+zin6s5er
+zin1su
+8zinsuf
+zist5r6
+zi5th
+zi1tr6
+6z1j
+2z1k
+2z1l
+2z1m
+6z1n
+1zo
+z8o1g
+zo6gl
+4z3oh
+zo1on
+zo2rn
+zor6na8
+4z1p
+z5q
+6z1r
+2z1s8
+2z1t
+z4t3e2n1d
+z4t3hei
+z8thi
+1zu
+zu3al
+zu1b4
+zu1f2
+6z5u6hr
+zu1n2a
+zu1ne
+8zunem
+zun1f8
+8zungl
+zu1o
+zup8fi
+zu1s8
+zu1z
+2z1v
+zw8
+z1wal
+5zwec2k
+zwei3s
+z1wel
+z1wer
+z6we8r1g
+8z5wes
+1zwi
+zwi1s
+6z1wo
+1zy
+2z1z
+zz8a
+z1zi
+zzi1s
+1z
+1z
+6z1l.
+z1le
+1z
+2z12b
+1a6
+b1l8
+c8h
+1che
+3chi
+2chs
+ch8sc
+ch8sp2
+5chu
+c2k
+c1k5a
+d1a
+1de
+d5era
+1di
+6d5ia
+1e
+5fa
+f1l
+2ft
+f2t6s
+g1h
+g3le
+gn8
+1gna
+6g5nan
+2gs
+g5str6
+1he
+1hi
+h1le
+h5ne
+1hn5l6
+6hr
+h1re
+h5ri
+h1ru
+1hu
+h1w
+6i
+1isc
+isc8h
+6i1sche
+5i2s1m
+5j
+1k
+8l1c
+1le
+8lei
+2ls
+l1sc
+lsc8h
+l6schl6
+1mi
+mi1e
+m8n8
+2m8s
+5na
+2n1d
+n1de
+5nd2e1ru
+1ne
+ne5i8
+ng3l
+nk5l8
+1no
+6ns
+n6s5c
+1pa
+p6s5c
+3q
+r1c
+1re
+re8m
+8r1g
+r1ge
+5rge2rn
+r6gl
+1ri
+6r1m
+r1me
+3rmel
+1ro
+2r1t
+r2t6s5
+1ru
+r2z1t
+3rz2t1l
+5r
+sc8h
+1sche
+6s5chen
+1se
+se6n8s
+2s1th
+ta8b
+1te
+t2e1ri4
+ter5it
+6thy
+1ti
+32t1k2
+1to
+2ts
+tsc8h
+t8schl6
+ts1p2
+5tu
+ub1l8
+u1e
+1ug
+u8ga
+6u5i
+1um.
+1us.
+1u
+1z
+1b
+c8h
+1che
+5chi
+2chs
+chs1te
+ch8s2tei
+ch8str6
+2cht6
+1de
+56dem
+2ff
+5f2f1n
+1he
+h1l8
+6hr
+h1re
+1hu
+1is
+1ke
+12k2o
+1l.
+6l1k
+l6k5l8
+6l1p
+l8pl8
+1mu
+5na
+1ni
+ni2g6s3
+1no
+5o6t
+pf3l
+p6s5c
+1re
+8r1g
+r8g1li
+1ri
+2r1t
+r8tr6
+1ru
+s1te
+5ste2rr
+1te
+5th
+1ti
+1tu
+1v
+1w
+we8
+2z
+1b6e2
+34ber1
+b1l8
+1b1r
+52bu
+c8h
+1che
+1chi
+8ch3l6
+2chs
+ch6s5c
+8c2k
+c1k1a
+ck5e2r1s
+d1a2
+1de
+6deu
+1di
+di8t
+2d1o4
+2d5s6
+1ge
+ge4l5a
+g1l
+h5a
+1he
+8heh
+6h5e6rk
+h1le
+6hr
+h1re
+h1ru
+1hu
+h1w
+3k
+1le
+6ll
+l4l5a
+l8lo
+6l1p
+l4ps
+2ls
+l6s5c
+1lu
+2n1d
+n8da
+n1f
+n1fe
+n8fei
+nk5l8
+n8za
+n6zw8
+5pi
+1re
+8rei
+r1f
+r8fl
+r8fr6
+8r1g
+r1ge
+r8geng
+1ri
+1ro
+2r1s
+r8sta
+1ru
+1se
+se8n
+8sta
+s1te
+8stes
+3ta
+1te
+1ti
+2t1t
+t8tr6
+1tu
+2tz
+t1ze
+t8zei
+1v
+1a8
+5a.
+8as
+1b8
+1c
+1d
+1e
+5ec
+8e8g
+8e8h
+21ei
+8em
+1f8
+1g
+1h
+1i
+1k
+1l
+1m
+1n
+1o
+1p8
+5q
+1r
+1s2
+st8
+1ta
+1te
+t3hei
+1ti
+5to
+1tr6
+1u8
+65um
+1v
+1w
+1z
+2s1ta.
+i1sta
+i2s1tal
+2s1ta1ni
+2s1tan.
+fe2s1ta
+nd1st
+nd2s1te
+ve2s1te
+3s2tec
+stec8h
+4s5t8e2ch3n6
+3s2teg
+3s2teh
+3s2tein
+3s2teig
+3s2te2if
+3s2te6ll
+3s2telz
+a4s3tel
+3s2te2m1m
+3s2te2mp
+ss1te
+s3s2ter
+t3s2te2rn
+3s2teu1e
+6s4t3eu1ro
+bs2ti
+te2s3ti
+ve2s1ti
+3s2tic
+3s2tie1b
+3s2tieg
+3s2t2if
+3s2t2il
+3s2tim
+3s2tink
+3s2ti1tu
+a2s1to
+gu2s1to
+ku2s1to
+i1sto
+i2s1tol
+i2s1tor
+ve2s1to
+2s1tung
+2s7tus
+o1stu
+o2s1tul
+aus3s4
+ens3s4
+gs3s4
+.mis2s1
+s2s1b8
+s1sche
+s2s3chen
+s2s3d
+s2s5ec
+2s2s1ei
+s2s3f2
+s2s3g2
+s2s3h
+s2s3k2
+s2s3l
+s2s3m
+s2s3n
+s2s3p8
+s2s5q
+s2s3r
+s2s3s2
+sss2t8
+as2s3te
+is2s3te
+us2s3te
+s2s3te
+s2sth
+s2st3hei
+s2s3ti
+s2s1to
+s2s1tr6
+s1su
+6ss5um
+s2s3v
+s2s3w
+s2s3z
+1cker.
+1cke2r1t
+c1ka
+1cka1d
+1cke.
+1ckel
+1cken
+4ck1ent
+1cke1re
+1cke2rn
+1ck2e1ru
+1ckie
+1ckig
+c1ku
+1ckun
+ta8s7ta7tur
+ta1sta
+tast6a1tu
+.fli7ck8en7tep7pic8h
+.f1li
+.f2lic2k
+.fli1cken
+.fli4ck1ent
+.flicken1te
+.flicken5tep1pi
+.mitt7wo8ch7a8be2n1d
+.3mi2t1t
+.mit2t1w
+.mittwo1c
+.mittwoc8h
+.mittwocha1be
+.ja7cken.
+.jac2k
+.ja1cken
+.ja7cken7ta7sche.
+.ja4ck1ent
+.jacken1ta
+.jackenta1sc
+.jackentasc8h
+.jackenta1sche
+.let7s8cho.
+.le2t1s
+.letsc8h
+.let1scho
+.men8s7tru7a7ti7on
+.1me
+.me6ns
+.men1str6
+.menstru2a1ti
+.menstruat2io
+ni7ve8au7st8a7bi7li7tt.
+n2i1v
+ni1ve
+nive1aus
+niveau4sta
+niveau4st3a4b
+niveausta1bi
+niveaustab2il
+niveaustabi1li
+niveaustabili1t
+niveaustabilitt2
+.ur7in8stin2k1t
+.u1ri
+.ur5i6ns
+.u4rinst
+.urins1ti
+.urin3s2tink
+.wach8s8tu7be
+.wac8h
+.wa2chs
+.wach1stu
+.stau8be1cken
+.1sta
+.stau1be
+.staubec2k
+.stau8b7ent7wick7lung
+.stauben2t1w
+.staub5entwic
+.staubentwic2k
+.staubentwick3l8
+.staubentwick1lun
diff --git a/src/tests/evas/dicts/hyph_en_US.dic b/src/tests/evas/dicts/hyph_en_US.dic
new file mode 100644
index 0000000000..803f90eabb
--- /dev/null
+++ b/src/tests/evas/dicts/hyph_en_US.dic
@@ -0,0 +1,11128 @@
+UTF-8
+LEFTHYPHENMIN 2
+RIGHTHYPHENMIN 3
+% The Plain TeX hyphenation tables [NOT TO BE CHANGED IN ANY WAY!]
+% The Plain TeX hyphenation tables [NOT TO BE CHANGED IN ANY WAY!]
+% The Plain TeX hyphenation tables [NOT TO BE CHANGED IN ANY WAY!]
+% Unlimited copying and redistribution of this file are permitted as long
+% Unlimited copying and redistribution of this file are permitted as long
+% Unlimited copying and redistribution of this file are permitted as long
+% Unlimited copying and redistribution of this file are permitted as long
+% as this file is not modified. Modifications are permitted, but only if
+% as this file is not modified. Modifications are permitted, but only if
+% as this file is not modified. Modifications are permitted, but only if
+% as this file is not modified. Modifications are permitted, but only if
+% as this file is not modified. Modifications are permitted, but only iff
+% as this file is not modified. Modifications are permitted, but only ifi
+% as this file is not modified. Modifications are permitted, but only ifl
+% the resulting file is not named hyphen.tex.
+% the resulting file is not named hyphen.tex.
+% the resulting file is not named hyphen.tex.
+% the resulting file is not named hyphen.tex.
+.a2ch4
+.ad4der
+.a2d
+.ad1d4
+.a2f1t
+.a2f
+.a4l3t
+.am5at
+.4a1ma
+.an5c
+.a2n
+.2ang4
+.an1i5m
+.an1t4
+.an3te
+.anti5s
+.ant2i
+.a4r5s2
+.2a2r
+.ar4t2ie4
+.ar1ti
+.ar4ty
+.as3c
+.as1p
+.a2s1s
+.aster5
+.a2tom5
+.a1to
+.au1d
+.av4i
+.awn4
+.ba4g
+.ba5na
+.ba2n
+.bas4e
+.ber4
+.be5r1a
+.be3s1m
+.4bes4
+.b4e5s2to
+.bri2
+.but4ti
+.bu4t3t2
+.cam4pe
+.1ca
+.ca4m1p
+.can5c
+.ca2n
+.capa5b
+.ca1pa
+.car5ol
+.c2a2r
+.ca4t
+.ce4la
+.2ch4
+.chill5i
+.ch4il2
+.chil1l
+.1ci2
+.cit5r
+.2c1it
+.co3e2
+.1co
+.co4r
+.cor5n1er
+.corn2e
+.de4moi2
+.d4em
+.de1mo
+.de3o
+.de3r1a
+.de3r1i
+.de1s4c
+.des2
+.dic1t2io5
+.3di2c1t
+.do4t
+.1do
+.du4c
+.1du
+.du4m1b5
+.earth5
+.ear2t
+.e2a2r
+.eas3i
+.2e1b4
+.eer4
+.eg2
+.e2l5d
+.el3em
+.enam3
+.e1na
+.en3g
+.e2n3s2
+.eq5ui5t
+.e1q
+.equ2
+.eq2ui2
+.er4ri
+.er1r4
+.es3
+.4eu3
+.eye5
+.fes3
+.for5mer
+.1fo
+.fo2r
+.for1m
+.for2me
+.1ga2
+.ge2
+.gen3t4
+.1gen
+.ge5o2g
+.1geo
+.1g2i5a
+.gi4b
+.go4r
+.1go
+.hand5i
+.ha2n
+.h4and
+.ha4n5k2
+.he2
+.hero5i2
+.h2ero
+.h1es3
+.he4t3
+.hi3b
+.hi3er
+.h2ie4
+.hon5ey
+.ho2n
+.hon3o
+.hov5
+.id4l
+.2id
+.idol3
+.i1do
+.im3m
+.im5p1i2n
+.i4m1p
+.im2pi
+.in1
+.in3ci
+.2ine2
+.4i4n2k2
+.2i2n3s2
+.ir5r4
+.4ir
+.is4i
+.ju3r
+.la4cy
+.la4m
+.lat5er
+.l4ath5
+.le2
+.leg5e
+.len4
+.lep5
+.lev1
+.l2i4g
+.li1g5a
+.li2n
+.l2i3o
+.l1i4t
+.ma1g5a5
+.1ma
+.mal5o
+.ma1n5a
+.ma2n
+.mar5ti
+.m2a2r
+.me2
+.mer3c
+.me5ter
+.me1te
+.m2is1
+.mis4t5i
+.mon3e
+.1mo
+.mo2n
+.mo3ro
+.mo2r
+.mu5ta
+.1mu
+.mu2ta5b
+.ni4c
+.od2
+.od1d5
+.of5te
+.o2ft
+.or5a1to
+.o1ra
+.or3c
+.or1d
+.or3t
+.os3
+.os4tl
+.4oth3
+.out3
+.ou2
+.ped5al
+.2p2ed
+.p2e2d2a
+.pe5te
+.pe2t
+.pe5tit
+.p2i4e4
+.pio5n4
+.3p2i1o
+.pi2t
+.pre3m
+.pr2
+.ra4c
+.ran4t
+.ra2n
+.ratio5n1a
+.ratio2n4
+.ra1t2io
+.ree2
+.re5mit
+.res2
+.re5stat
+.res2t
+.res1ta
+.r2i4g
+.ri2t5u
+.ro4q
+.ros5t
+.row5d
+.ru4d
+.3s4c2i3e4
+.s1ci
+.5se2l2f5
+.5se2l4ff
+.5se2l2fi
+.5se2l2fl2
+.sel1l5
+.se2n
+.se5r2ie4
+.ser1i
+.s2h2
+.si2
+.s3ing4
+.2s1in
+.st4
+.sta5b2l2
+.s1ta
+.s2tab
+.s4y2
+.1ta4
+.te4
+.3ten5a2n
+.te1na
+.th2
+.ti2
+.til4
+.ti1m5o5
+.1tim
+.ting4
+.2t1in
+.t4i4n5k2
+.to1n4a
+.1to
+.to2n
+.to4p
+.top5i
+.to2u5s
+.tou2
+.trib5ut
+.tr4ib
+.u1n1a
+.un3ce
+.under5
+.un1de
+.u2n1e
+.u4n5k2
+.un5o
+.un3u4
+.up3
+.ure3
+.us5a2
+.2us
+.ven4de
+.ve5r1a
+.wil5i
+.wi2
+.wil2
+.ye4
+4ab.
+a5bal
+a5ba2n
+abe2
+ab5erd
+ab2i5a
+ab5i2t5ab
+abi2t
+abi1ta
+ab5lat
+ab2l2
+ab5o5l1iz
+abol2i
+4abr
+ab5rog
+ab3ul
+a4c2a2r
+a1ca
+ac5ard
+ac5aro
+a5ceou2
+ac1er
+a5che4t
+a2ch
+ache2
+4a2ci
+a3c2ie4
+a2c1in
+a3c2io
+ac5rob
+act5if2
+a2c1t
+act5i4ff
+act5i1fi
+act5i3fl2
+ac3ul
+ac4um
+a2d
+ad4d1in
+ad1d4
+ad5er.
+2adi
+a3d4i3a
+ad3i1ca
+adi4er
+ad2ie4
+a3d2io
+a3dit
+a5di1u
+ad4le
+ad3ow
+a1do
+ad5ra2n
+a1dr
+ad4su
+a2d1s2
+4a1du
+a3du2c
+ad5um
+ae4r
+aer2i4e4
+aer1i
+a2f
+a4ff4
+a2fi
+a2fl2
+a4f1f4
+a4gab
+a1ga
+aga4n
+ag5el1l
+a1ge4o
+4ag4eu
+ag1i
+4ag4l2
+ag1n
+a2go
+3a3g4o4g
+ag3o3ni
+ago2n2
+a5guer
+a2gue
+ag5ul
+a4gy
+a3ha
+a3he
+a4h4l4
+a3ho
+ai2
+a5i1a
+a3ic.
+ai5ly
+a4i4n
+ain5in
+a2ini
+a2i1n5o
+ait5en
+a2ite
+a1j
+ak1en
+al5ab
+al3a2d
+a4l2a2r
+4aldi4
+a2ld
+2ale
+al3end
+a4lent2i
+a1len1t
+a5le5o
+al1i
+al4ia.
+al2i1a
+al2i4e4
+al5lev
+al1l
+al2le
+4allic
+all2i
+4a2lm
+a5log.
+a4ly.
+a1ly
+4a2lys4
+5a5lys1t
+5alyt
+3alyz
+4a1ma
+a2m5ab
+am3ag
+ama5ra
+am2a2r
+am5asc
+a4ma3tis
+a4m5a1to
+am5er1a
+am3ic
+am5if
+am5i4ff
+am5i1fi
+am5i3fl2
+am5i1ly
+am1in
+am2i4no
+a2mo
+a5mo2n
+amor5i
+amo2r
+amp5en
+a4m1p
+a2n
+an3age
+a1na
+3ana1ly
+a3n2a2r
+an3ar3c
+anar4i
+a3nati
+an2at
+4and
+ande4s2
+an1de
+an3dis1
+an1dl
+an4dow
+an1do
+a5nee
+a3nen
+an5e2st.
+a1nes
+a2nest
+a3n4eu
+2ang
+ang5ie4
+an1gl2
+a4n1ic
+a3nies
+an2ie4
+an3i3f
+an3i4ff
+an3i3fi
+an3i3fl2
+an4ime
+an1im
+a5nim1i
+a5n2ine
+an1in
+an3i4o
+a3n2ip
+an3is2h
+an3it
+a3ni1u
+an4kli
+a4nk2
+an1k1l
+5anniz
+a4n1n2
+ano4
+an5ot
+an4oth5
+an2sa2
+a2n1s2
+an4s1co
+ans4c
+an4s1n4
+an2sp
+ans3po
+an4st
+an4su2r
+an1su
+anta2l4
+an1t
+an1ta
+an4t2ie4
+ant2i
+4an1to
+an2tr
+an4tw4
+an3u1a
+an3ul
+a5nur
+4ao
+ap2a2r4
+a1pa
+ap5at
+ap5er3o
+a3ph4er
+4aphi
+a4pilla
+apil1l
+ap5ill2a2r
+ap3i2n
+ap3i1ta
+a3pi2tu
+a2p2l2
+apo4c5
+ap5o1la
+apor5i
+a1p4or
+apos3t
+a1pos
+aps5e4s
+a2p1s2
+ap2se
+a3pu
+aque5
+aqu2
+2a2r
+ar3a2c1t
+a5rade
+ara2d
+ar5adis1
+ar2adi
+ar3al
+a5rame1te
+aram3et
+ar2an4g
+ara2n
+ara3p
+ar4at
+a5ra1t2io
+ar5a1t2iv
+a5rau
+ar5av4
+araw4
+arbal4
+ar1b
+ar4cha2n
+ar1c
+ar3cha
+ar2ch
+ar5d2ine
+ard2i
+ard1in4
+ar4dr
+ar5eas
+a3ree
+ar3en1t
+a5r2e2ss
+ar4fi
+ar1f
+ar4fi
+ar4f4l2
+ar4fl2
+ar1i
+ar5i2al
+ar2i3a
+ar3i2a2n
+a3ri5et
+ar2ie4
+ar4im
+ar5in2at
+ar2i1na
+ar3i1o
+ar2iz
+ar2mi
+ar1m
+ar5o5d
+a5roni
+aro2n
+a3roo2
+ar2p
+ar3q
+arre4
+ar1r4
+ar4sa2
+a4rs2
+ar2s2h
+4as.
+a2s4ab
+asa2
+as3an1t
+asa2n
+ashi4
+as2h
+a5sia.
+as2i1a
+a3si1b
+a3sic
+5a5si4t
+ask3i
+ask2
+as4l2
+a4soc
+a1so
+as5ph
+as4s2h
+a2ss
+as3ten
+as1t4r
+asu1r5a
+a1su
+asu2r
+a2ta
+at3ab2l2
+a2tab
+at5ac
+at3alo
+ata2l
+at5ap
+ate5c
+at5e2ch
+at3e1go
+ateg4
+at3en.
+at3er1a
+ater5n
+a5ter1na
+at3est
+at5ev
+4ath
+ath5em
+ath2e
+a5the2n
+at4ho
+ath5om
+4ati.
+a5t2i1a
+a2t5i5b
+at1ic
+at3if2
+at3i4ff
+at3i1fi
+at3i3fl2
+ation5a2r
+a1t2io
+atio2n
+atio1n1a
+at3i1tu
+a4tog
+a1to
+a2tom
+at5om2iz
+a4top
+a4tos2
+a1tr
+at5rop
+at4sk2
+a4t1s2
+at4tag
+a4t3t2
+at1ta
+at5te
+at4th
+a2tu
+at5u1a
+a4t5ue
+at3ul
+at3u1ra
+a2ty
+au4b
+augh3
+au3gu
+au4l2
+aun5d
+au3r
+au5si1b
+a2us
+a4ut5en
+au1th
+a2va
+av3ag4
+a5va2n
+av4e4no
+av3er1a
+av5ern
+av5ery
+av1i
+avi4er
+av2ie4
+av3ig
+av5oc
+a1vor
+3away
+aw3i2
+aw4ly
+aws4
+ax4i5c
+ax3i
+ax4id
+ay5al
+aye4
+ays4
+azi4er
+a2z1i
+az2ie4
+az2z5i
+a4z1z2
+5ba.
+bad5ger
+ba2d
+ba4ge
+bal1a
+ban5dag
+ba2n
+b4and
+ban1d2a
+ban4e
+ban3i
+barbi5
+b2a2r
+bar1b
+bar2i4a
+bar1i
+bas4si
+ba2ss
+1bat
+ba4z
+2b1b
+b2be
+b3ber
+bbi4na
+4b1d
+4be.
+beak4
+bea2t3
+4be2d
+b2e3d2a
+be3de
+b4e3di
+be3gi
+be5gu
+1bel
+be1l2i
+be3lo
+4be5m
+be5n2ig
+be5nu
+4bes4
+be3sp
+b2e5st4r
+3bet
+be1t5iz
+be5tr
+be3tw4
+be3w
+be5y1o4
+2bf
+2b4ff
+2b1fi
+2bfl2
+4b3h
+bi2b
+b2i4d
+3b2ie4
+bi5en
+bi4er
+2b3if
+2b3i4ff
+2b3i1fi
+2b3i3fl2
+1bil
+bi3l2iz
+bil1i
+bin2a5r4
+bi1na
+b4in4d
+bi5net
+b2ine
+bi3o2gr
+b2io
+bi5ou2
+bi2t
+3b2i3t2io
+bi1ti
+bi3tr
+3bit5u1a
+bi1tu
+b5i4tz
+b1j
+bk4
+b2l2
+bl4ath5
+b4le.
+blen4
+5ble1sp
+bles2
+b3lis
+b4lo
+blun4t
+4b1m
+4b3n
+bne5g
+3bod
+bod3i
+bo4e
+bol3ic
+bol2i
+bom4bi
+bo4m1b
+bo1n4a
+bo2n
+bon5at
+3boo2
+5bor.
+4b1o1ra
+bor5d
+5bore
+5bori
+5bos4
+b5o1ta
+b4oth5
+bo4to
+boun2d3
+bou2
+4bp
+4brit
+br4oth3
+2b5s2
+bsor4
+b1so
+2bt
+b2t4l
+b4to
+b3tr
+buf4fer1
+bu4f1f
+buffer1
+bu4ff
+bu4ga
+bu3l2i
+bu1mi4
+bu4n
+bunt4i
+bun1t
+bu3re
+bus5ie4
+b2us
+buss4e
+bu2ss
+5bust
+4bu1ta
+3bu1t2io
+b4u1t2i
+b5u1to
+b1v
+4b5w
+5by.
+bys4
+1ca
+cab3in
+ca1b2l2
+ca2ch4
+ca5den
+ca2d
+4cag4
+2c5ah
+ca3lat
+cal4la
+cal1l
+cal2l5in4
+call2i
+4calo
+c4an5d
+ca2n
+can4e
+ca4n4ic
+can5is
+can3iz
+can4ty
+can1t
+cany4
+ca5per
+car5om
+c2a2r
+cast5er
+cas5t2ig
+cast2i
+4cas4y
+c4a4th
+4ca1t2iv
+cav5al
+ca2va
+c3c
+ccha5
+c2ch
+c3c2i4a
+c1ci
+ccom1pa5
+c1co
+cco4m1p
+cco2n4
+ccou3t
+ccou2
+2ce.
+4ced.
+4ce1den
+3cei2
+5cel.
+3cel1l
+1cen
+3cenc
+2cen4e
+4ceni
+3cen1t
+3cep
+ce5ram
+cer1a
+4ce1s4a2
+3ces1si
+c2e2ss
+ces5si5b
+ces5t
+cet4
+c5e4ta
+cew4
+2ch
+4ch.
+4ch3ab
+5cha4n1ic
+cha2n
+ch5a5nis
+che2
+cheap3
+4ch4ed
+ch5e5lo
+3chemi
+ch5ene
+che2n
+ch3er.
+ch3e4r1s2
+4ch1in
+5chi2ne.
+ch2ine
+ch5i5n2e2ss
+chi1nes
+5ch2ini
+5ch2io
+3chit
+chi2z
+3cho2
+ch4ti
+1ci
+3c2i1a
+ci2a5b
+ci2a5r
+ci5c
+4cier
+c2ie4
+5c4i2f3ic.
+ci1fi
+5c4i2fic.
+ci1fi
+4c4i5i4
+ci4la
+3cil1i
+2cim
+2cin
+c4i1na
+3cin2at
+cin3em
+c2ine
+c1ing
+c5ing.
+5c2i1no
+cio2n4
+c2io
+4cipe4
+c2ip
+ci3ph
+4cip4ic
+cip3i
+4cis1ta
+4cis1t2i
+2c1it
+ci1t3iz
+ci1ti
+5ciz
+ck1
+ck3i
+1c4l4
+4cl2a2r
+c5la5ra1t2io
+clar4at
+5clare
+cle4m
+4clic
+clim4
+c1ly4
+c5n
+1co
+co5ag
+c4oa
+coe2
+2cog
+co4gr
+coi4
+co3inc
+col5i
+5colo
+col3o4r
+com5er
+co2me
+co1n4a
+co2n
+c4one
+con3g
+con5t
+co3pa
+cop3ic
+co4p2l2
+4cor1b
+coro3n
+cos4e
+cov1
+cove4
+cow5a
+co2z5e
+co5z1i
+c1q
+cras5t
+cr2as
+5crat.
+5crat1ic
+cre3a2t
+5c2r2ed
+4c3re1ta
+cre4v2
+cri2
+cri5f
+cri5ff
+cri5fi
+cri5fl2
+c4rin
+cr2is4
+5cri1ti
+cro4p2l2
+crop5o
+cros4e
+cru4d
+4c3s2
+2c1t
+c2ta4b
+c1ta
+ct5ang
+cta2n
+c5tan1t
+c2te
+c3ter
+c4t4ic1u
+ctim3i
+c1tim
+ctu4r
+c1tu
+c4tw4
+cud5
+c4uf
+c4u4ff
+c4u1fi
+c4u3fl2
+c4ui2
+cu5i1ty
+5cul2i
+cul4tis4
+cul1ti
+cu4lt
+3c4ul1tu2
+cu2ma
+c3ume
+cu4mi
+3cun
+cu3pi
+cu5py
+cu2r5a4b
+cu1ra
+cu5r2i3a
+1c2us
+cus1s4i
+cu2ss
+3c4ut
+cu4t2ie4
+c4u1t2i
+4c5u1t2iv
+4cutr
+1cy
+c2ze4
+1d2a
+5da.
+2d3a4b
+da2ch4
+4da2f
+4da4ff4
+4da2fi
+4da2fl2
+2dag
+da2m2
+d2an3g
+da2n
+dard5
+d2a2r
+dark5
+4dary
+3dat
+4da1t2iv
+4da1to
+5dav4
+dav5e
+5day
+d1b
+d5c
+d1d4
+2de.
+dea2f5
+dea4ff4
+dea2fi
+dea2fl2
+de4b5i2t
+d2e1b
+de4bo2n
+deca2n4
+de1ca
+de4cil
+de1c2i
+de5com
+de1co
+2d1ed
+4dee.
+de5if
+dei2
+de5i4ff
+de5i1fi
+de5i3fl2
+del2i4e4
+del2i
+de4l5i5q
+de5lo
+d4em
+5dem.
+3demic
+dem5ic.
+de5mil
+de4mo2n3s2
+de1mo
+demo2n
+demo2r5
+1den
+de4n2a2r
+de1na
+d4e3no
+denti5f2
+den1t
+dent2i
+denti5ff
+denti5fi
+denti5fl2
+de3nu
+de1p
+de3pa
+depi4
+de2pu
+d3e1q
+d4er1h4
+5der3m4
+d5ern5iz
+de4r5s2
+des2
+d2es.
+de1s2c
+de2s5o
+des3t2i
+d2e3st4r
+de4su
+de1t
+de2to
+de1v
+de2v3i4l
+de1vi
+4dey
+4d1f
+4d4ff
+4d1fi
+4d1fl2
+d4ga
+d3ge4t
+dg1i
+d2gy
+d1h2
+5di.
+1d4i3a
+dia5b
+d4i4cam
+di1ca
+d4ice
+3di2c1t
+3d2id
+5di3en
+d2ie4
+d1if
+d1i4ff
+d1i1fi
+d1i3fl2
+di3ge
+d2ig
+di4la1to
+di1la
+d1in
+1di1na
+3di2ne.
+d2ine
+5d2ini
+di5niz
+1d2io
+dio5g
+di4p2l2
+d2ip
+d4ir2
+di1re
+dir1t5i
+dis1
+5disi
+d4is3t
+d2i1ti
+1d2i1v
+d1j
+d5k2
+4d5la
+3dle.
+3dled
+3dles.
+dles2
+4d3l2e2ss
+2d3lo
+4d5lu
+2d1ly
+d1m
+4d1n4
+1do
+3do.
+do5de
+5doe
+2d5of
+2d5o4ff
+2d5o2fi
+2d5ofl2
+d4og
+do4la
+dol2i4
+do5lo4r
+dom5iz
+do3n2at
+do2n
+do1n1a
+doni4
+doo3d
+doo2
+do4p4p
+d4or
+3dos
+4d5out
+dou2
+do4v
+3dox
+d1p
+1dr
+drag5o2n2
+dra2go
+4dr2ai2
+dre4
+dre2a5r
+5dren
+dr4i4b
+dril4
+dro4p
+4drow
+5drupli
+dru3p2l2
+4dry
+2d1s2
+ds4p
+d4sw2
+d4s4y
+d2th
+1du
+d1u1a
+du2c
+d1u3ca
+duc5er
+4duct.
+du2c1t
+4duc4t1s2
+du5el
+du4g
+d3ul4e
+dum4be
+du4m1b
+du4n
+4dup
+du4pe
+d1v
+d1w
+d2y
+5dyn
+dy4s2e
+dys5p
+e1a4b
+e3a2c1t
+ea2d1
+ead5ie4
+e2adi
+ea4ge
+ea5ger
+ea4l
+eal5er
+e2ale
+eal3ou2
+eam3er
+e5and
+ea2n
+ear3a
+e2a2r
+ear4c
+ear5es
+ear4ic
+ear1i
+ear4il
+ear5k
+ear2t
+eart3e
+ea5sp
+e3a2ss
+east3
+ea2t
+eat5en
+eath3i
+e4ath
+e5at3if2
+e5at3i4ff
+e5at3i1fi
+e5at3i3fl2
+e4a3tu
+ea2v
+eav3en
+eav5i
+eav5o
+2e1b
+e4bel.
+e1bel
+e4be2l1s2
+e4ben
+e4bi2t
+e3br
+e4ca2d
+e1ca
+ecan5c
+eca2n
+ec1ca5
+ec3c
+e1ce
+ec5es1sa2
+ec2e2ss
+e1c2i
+e4cib
+ec5ificat
+eci1fi
+ecifi1ca
+ec5ificat
+eci1fi
+ecifi1ca
+ec5i3f2ie4
+ec5i3fie4
+ec5i1fy
+e2c3im
+e2c1i4t
+e5c2ite
+e4clam
+e1c4l4
+e4cl2us
+e2col
+e1co
+e4com1m
+e4compe
+eco4m1p
+e4con1c
+eco2n
+e2cor
+ec3o1ra
+eco5ro
+e1cr
+e4crem
+ec4ta2n
+e2c1t
+ec1ta
+ec4te
+e1cu
+e4cul
+ec3u1la
+2e2d2a
+4ed3d4
+e4d1er
+ede4s2
+4edi
+e3d4i3a
+ed3ib
+ed3i1ca
+ed3im
+ed1it
+edi5z
+4e1do
+e4dol
+edo2n2
+e4dri
+e1dr
+e4dul
+e1du
+ed5u1l4o
+ee2c
+e4ed3i
+ee2f
+e1e4ff
+ee2fi
+ee2fl2
+eel3i
+ee4ly
+ee2m
+ee4na
+ee4p1
+ee2s4
+eest4
+ee4ty
+e5ex
+e1f
+1e4ff
+e1fi
+e1fl2
+e4f3ere
+efer1
+1e4f1f
+e4fic
+e1fi
+e4fic
+5ef2i1c4i
+5efi1ci
+efil4
+efil4
+e3f2i2ne
+e2fin
+e3fine
+e2fin
+ef5i5n2ite
+ef2ini
+efin2it
+efi5n2ite
+efini
+efin2it
+3efit
+3efit
+efor5es
+e1fo
+efo2r
+e4fu4se.
+e3fu
+ef2us
+4egal
+e1ga
+eger4
+eg5ib
+eg4ic
+eg5ing
+e5git5
+eg5n
+e4go.
+e1go
+e4gos
+eg1ul
+e5gur
+5e1gy
+e1h4
+eher4
+ei2
+e5ic
+e2i5d
+e2ig2
+ei5g4l2
+e3i4m1b
+e3in3f
+e3in4ff
+e3in3fi
+e3in3fl2
+e1ing
+e5inst
+e2i2n1s2
+eir4d
+e4ir
+e2it3e
+e2i3th
+e5i1ty
+e1j
+e4jud
+ej5udi
+eki4n
+ek1i
+ek4la
+ek1l
+e1la
+e4la.
+e4lac
+e3l4an4d
+ela2n
+e4l5a1t2iv
+e4law
+elax1a4
+e3le2a
+el5ebra
+el2e1b
+ele3br
+5elec
+e4led
+el3e1ga
+e5len
+e4l1er
+e1les2
+e2l2f
+e2l4ff
+e2l2fi
+e2l2fl2
+el2i
+e3libe4
+e4l5ic.
+el3i1ca
+e3lier
+el2ie4
+el5i3gib
+el2ig
+el4igi
+e5lim
+e4l3ing
+e3l2io
+e2lis
+el5is2h
+e3l2iv3
+4ella
+el1l
+el4lab
+ell4o4
+e5loc
+el5og
+el3op.
+el2s2h
+e2l1s2
+el4ta
+e4lt
+e5lud
+el5ug
+e4mac
+e1ma
+e4mag
+e5ma2n
+em5a1na
+e4m5b
+e1me
+e2mel
+e4met
+em3i1ca
+em2i4e4
+em5igra
+em2ig4
+emi1gr
+em1in2
+em5ine
+em3i3ni
+e4m2is
+em5is2h
+e5m4i2s1s
+em3iz
+5emniz
+e4m1n
+emo4g
+e1mo
+emo3n2i5o
+emo2n
+em3pi
+e4m1p
+e4mul
+e1mu
+em5u1la
+emu3n2
+e3my
+en5a2mo
+e1na
+e4nan1t
+en2a2n
+ench4er
+en2ch
+enche2
+en3dic
+e5nea
+e5nee
+en3em
+en5ero
+en1er
+en5e1si
+e1nes
+e2n5est
+en3etr
+e3ne4w
+en5i4c3s2
+e5n2ie4
+e5nil
+e3n2i4o
+en3is2h
+en3it
+e5ni1u
+5eniz
+4e4n1n2
+4eno
+e4no4g
+e4nos
+en3ov
+en4sw2
+e2n1s2
+ent5age
+en1t
+en1ta
+4enth1es
+enth2e
+en3u1a
+en5uf
+en5u4ff
+en5u1fi
+en5u3fl2
+e3ny.
+4e4n3z
+e5of
+e5o4ff
+e5o2fi
+e5ofl2
+eo2g
+e4oi4
+e3ol
+eop3a2r
+eo2pa
+e1or
+eo3re
+eo5rol
+eos4
+e4ot
+eo4to
+e5out
+eou2
+e5ow
+e2pa
+e3p4ai2
+ep5anc
+epa2n
+e5pel
+e3pen1t
+ep5e5t2i1t2io
+epe2t
+epeti1ti
+ephe4
+e4pli
+e1p2l2
+e1po
+e4prec
+epr2
+ep5re1ca
+e4p2r2ed
+ep3re1h4
+e3pro
+e4prob
+ep4s4h
+e2p1s2
+ep5ti5b
+e2p1t
+e4pu2t
+ep5u1ta
+e1q
+equi3l
+equ2
+eq2ui2
+e4q3ui3s
+er1a
+e2ra4b
+4er4and
+era2n
+er3a2r
+4er4ati.
+2er1b
+er4b2l2
+er3ch
+er1c
+er4che2
+2e2re.
+e3re1a4l
+ere5co
+ere3in
+erei2
+er5el.
+er3e1mo
+er5e1na
+er5ence
+4erene
+er3en1t
+ere4q
+er5e2ss
+er3es2t
+eret4
+er1h4
+er1i
+e1r2i3a4
+5erick1
+e3rien
+er2ie4
+eri4er
+er3in4e
+e1r2i1o
+4erit
+er4i1u
+er2i4v
+e4ri1va
+er3m4
+er4nis4
+4er3n2it
+5erniz
+er3no4
+2ero
+er5ob
+e5r2oc
+ero4r
+er1ou2
+e4r1s2
+er3set
+er2se
+ert3er
+4er2tl
+er3tw4
+4eru
+eru4t
+5erwau
+er1w
+e1s4a2
+e4sa2ge.
+e4sages
+es2c
+e2s1ca
+es5ca2n
+e3scr
+es5cu
+e1s2e
+e2sec
+es5e1cr
+e4s5enc
+e4sert.
+e4ser4t1s2
+e4ser1va
+4es2h
+e3sha
+esh5e2n
+e1si
+e2sic
+e2s2id
+es5i1den
+e4s5ig1n4a
+es2ig
+e2s5im
+e2s4i4n
+esis4te
+e1sis
+e5si4u
+e5skin
+esk2
+esk1i
+es4mi
+e2s1m
+e2sol
+e1so
+es3olu
+e2so2n
+es5o1n1a4
+e1sp
+e2s3per
+es5pi1ra
+esp4ir
+es4pre
+espr2
+2e2ss
+es4si4b
+es1si
+esta2n4
+es1ta
+es3t2ig
+est2i
+es5tim
+4es2to
+e3sto2n
+2est4r
+e5stro
+estruc5
+e2su2r
+e1su
+es5ur1r4
+es4w2
+e2ta4b
+e1ta
+e3ten4d
+e3teo
+ethod3
+et1ic
+e5tide
+et2id
+e2t1in4
+et2i4no
+e5t4ir
+e5t2i1t2io
+eti1ti
+et5i1t2iv
+4e2t1n2
+et5o1n1a
+e1to
+eto2n
+e3tra
+e3tre
+et3ric
+et5rif
+et5ri4ff
+et5ri1fi
+et5ri3fl2
+et3rog
+et5ros
+et3u1a
+e1tu
+et5ym
+e1ty
+e4t5z
+4eu
+e5un
+e3up
+eu3ro
+e2us4
+eute4
+euti5l
+e4u1t2i
+eu5tr
+eva2p5
+e1va
+e2vas
+ev5ast
+e5vea
+ev3el1l
+eve4l3o
+e5veng
+even4i
+ev1er
+e5v2er1b
+e1vi
+ev3id
+e2vi4l
+e4v1in
+e3v2i4v
+e5voc
+e5vu
+e1wa
+e4wag
+e5wee
+e3wh
+ewil5
+ewi2
+ew3in4g
+e3wit
+1ex3p
+5ey1c
+5eye.
+eys4
+1fa
+4ff
+ffa
+fa3b2l2
+ffa3b2l2
+f4ab3r
+ff4ab3r
+fa4ce
+ffa4ce
+4fag
+ffag
+fa4i4n4
+fai2
+ffa4i4n4
+ffai2
+fal2l5e
+fal1l
+ffal2l5e
+ffal1l
+4f4a4ma
+ff4a4ma
+fam5is
+ffam5is
+5f2a2r
+ff2a2r
+far5th
+ffar5th
+fa3ta
+ffa3ta
+fa3th2e
+f4ath
+ffa3th2e
+ff4ath
+4fa1to
+ffa1to
+fau4lt5
+fau4l2
+ffau4lt5
+ffau4l2
+4f5b
+ff5b
+4fd
+ffd
+4fe.
+ffe.
+feas4
+ffeas4
+fe4ath3
+fea2t
+ffe4ath3
+ffea2t
+f2e4b
+ff2e4b
+4fe1ca
+ffe1ca
+5fe2c1t
+ffe2c1t
+2fed
+ffed
+fe3l2i
+ffe3l2i
+fe4mo
+ffe4mo
+fen2d
+ffen2d
+fen1d5e
+ffen1d5e
+fer1
+ffer1
+5fer1r4
+ffer1r4
+fev4
+ffev4
+4f1f
+f4fes
+ffes
+f4f2ie4
+f1fi
+ffie
+f5f2in.
+f2fin
+ffin.
+f2f5is
+ffis
+f4f2ly5
+ff4l2
+ffly
+f2fy
+ffy
+4fh
+ffh
+1fi
+1fi
+f2i3a
+fi1a
+2f3ic.
+2fic.
+4f3ical
+fi1ca
+4fical
+fi1ca
+f3ica2n
+fica2n
+4ficate
+4ficate
+f3i1cen
+fi1cen
+fi3cer
+fi3cer
+f2i1c4i
+fi1ci
+5fi3c2i1a
+5fi3c2i1a
+5fic2ie4
+5fic2ie4
+4fi4c3s2
+4fi4c3s2
+fi3cu
+fi3cu
+fi5del
+f2id
+fid
+fi5del
+fight5
+f2ig
+fig
+fight5
+fil5i
+fil1i
+fil2l5in4
+fil1l
+fill2i
+fil2l5in4
+fil1l
+fill2i
+4fi1ly
+4fi1ly
+2fin
+2fin
+5fi1na
+5fi1na
+f4in2d5
+find
+f2i2ne
+fine
+f1in3g
+fin3g
+f2i4n4n2
+fi4n1n2
+fis4t2i
+fis1t2i
+f4l2
+fl2
+f5l2e2ss
+fles2
+fles2
+fl2e2ss
+flin4
+flin4
+flo3re
+flo3re
+f2ly5
+fly
+4fm
+ffm
+4fn
+ffn
+1fo
+ffo
+5fo2n
+ffo2n
+fon4de
+f2ond
+ffon4de
+ff2ond
+fon4t
+ffon4t
+fo2r
+ffo2r
+fo5rat
+fo1ra
+ffo5rat
+ffo1ra
+for5ay
+ffor5ay
+fore5t
+ffore5t
+for4i
+ffor4i
+for1t5a
+ffor1t5a
+fos5
+ffos5
+4f5p
+ff5p
+fra4t
+ffra4t
+f5rea
+ff5rea
+fres5c
+ffres5c
+fri2
+ffri2
+fril4
+ffril4
+frol5
+ffrol5
+2f3s
+ff3s
+2ft
+fft
+f4to
+ff4to
+f2ty
+ff2ty
+3fu
+ffu
+fu5el
+ffu5el
+4fug
+ffug
+fu4min
+fu1mi
+ffu4min
+ffu1mi
+fu5ne
+ffu5ne
+fu3ri
+ffu3ri
+fusi4
+f2us
+ffusi4
+ff2us
+fu2s4s
+ffu2s4s
+4fu1ta
+ffu1ta
+1fy
+1ga
+ga2f4
+ga4ff4
+ga2fi
+ga2fl2
+5gal.
+3gal1i
+ga3lo
+2gam
+ga5met
+g5a2mo
+gan5is
+ga2n
+ga3niz
+gani5za1
+4gano4
+gar5n4
+g2a2r
+ga2ss4
+g4ath3
+4ga1t2iv
+4gaz
+g3b
+gd4
+2ge.
+2ged
+geez4
+gel4in
+gel2i
+ge5lis
+ge5l1iz
+4ge1ly
+1gen
+ge4n2at
+ge1na
+g5e5niz
+4g4eno
+4geny
+1geo
+ge3om
+g4ery
+5ge1si
+geth5
+4ge1to
+ge4ty
+ge4v
+4g1g2
+g2ge
+g3ger
+gglu5
+ggl2
+g1go4
+gh3in
+gh5out
+ghou2
+gh4to
+5gi.
+1g2i4a
+gi2a5r
+g1ic
+5gi3c2i1a
+g2i1ci
+g4i1co
+gien5
+g2ie4
+5gies.
+gil4
+g3i1men
+3g4in.
+g4in5ge
+5g4i2n1s2
+5g2io
+3g4ir
+gir4l
+g3is1l2
+gi4u
+5g2iv
+3giz
+gl2
+gla4
+gl2ad5i
+gla2d
+5glas
+1gle
+gli4b
+g3l2ig
+3glo
+glo3r
+g1m
+g4my
+g1n4a
+g4na.
+gne4t4t2
+g1ni
+g2n1in
+g4n2i4o
+g1no
+g4no4n
+1go
+3go.
+gob5
+5goe
+3g4o4g
+go3is
+goi2
+go2n2
+4g3o3n1a
+gon5do5
+g2ond
+go3ni
+5goo2
+go5riz
+gor5ou2
+5gos.
+gov1
+g3p
+1gr
+4gra1d2a
+gra2d
+g4r2ai2
+gra2n2
+5gra4ph.
+g5ra3ph4er
+5graph1ic
+gr4aphi
+4g3ra1phy
+4gray
+gre4n
+4gress.
+gr2e2ss
+4grit
+g4ro
+gruf4
+gru4ff
+gru1fi
+gru3fl2
+gs2
+g5ste
+gth3
+gu4a
+3guar2d
+gu2a2r
+2gue
+5gui5t
+g2ui2
+3gun
+3g2us
+4gu4t
+g3w
+1gy
+2g5y3n
+gy5ra
+h3ab4l2
+ha2ch4
+hae4m
+hae4t
+h5agu
+ha3la
+hala3m
+ha4m
+han4ci
+ha2n
+han4cy
+5hand.
+h4and
+h2an4g
+hang5er
+han1g5o
+h5a5niz
+ha4n4k2
+han4te
+han1t
+ha2p3l2
+ha2p5t
+ha3ra2n
+h2a2r
+ha5r2as
+har2d
+hard3e
+har4le4
+har1l
+harp5en
+har2p
+har5ter
+ha2s5s
+haun4
+5haz
+haz3a1
+h1b
+1hea2d1
+3he2a2r
+he4ca2n
+he1ca
+h5ecat
+h4ed
+h4e5do5
+he3l4i
+hel4lis
+hel1l
+hell2i
+hel4ly
+h5elo
+he4m4p
+he2n
+he1na4
+hen5at
+he1o5r
+hep5
+h4er1a
+hera3p
+her4ba
+h2er1b
+here5a
+h3ern
+h5er1ou2
+h2ero
+h3ery
+h1es
+he2s5p
+he4t
+he2t4ed
+h4eu4
+h1f
+h4ff
+h1fi
+h1fl2
+h1h
+hi5a2n
+h2i1a
+hi4co
+high5
+h2ig
+h4il2
+himer4
+h4i1na
+hion4e
+h2io
+hio2n
+h2i4p
+hir4l
+h4ir
+hi3ro
+hir4p
+hir4r4
+his3el
+h4ise
+h4i2s4s
+hith5er
+h2ith
+hith2e
+h2i2v
+4hk
+4h1l4
+hla2n4
+h2lo
+hlo3ri
+4h1m
+hmet4
+2h1n
+h5odiz
+h5o2d1s2
+ho4g
+ho1ge4
+hol5a2r
+ho1la
+3hol4e
+ho4ma
+ho2me3
+ho1n4a
+ho2n
+ho5ny
+3hood
+hoo2
+hoo2n4
+hor5at
+ho1ra
+ho5r2is
+hort3e
+ho5ru
+hos4e
+ho5sen
+hos1p
+1ho2us
+hou2
+house3
+hov5el
+4h5p
+4hr4
+hree5
+hro5niz
+hro2n
+hro3po
+4h1s2
+h4s2h
+h4t2a2r
+h1ta
+ht1en
+ht5es
+h4ty
+hu4g
+hu4min
+hu1mi
+hun5ke
+hu4nk2
+hun4t
+hus3t4
+h2us
+hu4t
+h1w
+h4war4t
+hw2a2r
+hy3pe
+hy3ph
+hy2s
+2i1a
+i2al
+fi2al
+iam4
+fiam4
+iam5e1te
+fiam5e1te
+i2a2n
+fi2a2n
+4ianc
+fianc
+ian3i
+fian3i
+4ian4t
+fian4t
+ia5pe
+fia5pe
+ia2ss4
+fia2ss4
+i4a1t2iv
+fi4a1t2iv
+ia4tric
+ia1tr
+fia4tric
+fia1tr
+i4a2tu
+fi4a2tu
+ibe4
+fibe4
+ib3er1a
+fib3er1a
+ib5ert
+fib5ert
+ib5i1a
+fib5i1a
+ib3in
+fib3in
+ib5it.
+ibi2t
+fib5it.
+fibi2t
+ib5ite
+fib5ite
+i1b2l2
+fi1b2l2
+ib3li
+fib3li
+i5bo
+fi5bo
+i1br
+fi1br
+i2b5ri
+fi2b5ri
+i5bu4n
+fi5bu4n
+4icam
+i1ca
+ficam
+5icap
+ficap
+4ic2a2r
+fic2a2r
+i4car.
+fi4car.
+i4cara
+fi4cara
+icas5
+ficas5
+i4cay
+fi4cay
+iccu4
+ic3c
+ficcu4
+fic3c
+4iceo
+ficeo
+4i2ch
+fi2ch
+2i1ci
+i5c2id
+fi5c2id
+ic5i1na
+i2cin
+fic5i1na
+fi2cin
+i2c2ip
+fi2c2ip
+ic3i1pa
+fic3i1pa
+i4c1ly4
+i1c4l4
+fi4c1ly4
+fi1c4l4
+i2c5oc
+i1co
+fi2c5oc
+fi1co
+4i1cr
+fi1cr
+5icra
+ficra
+i4cry
+fi4cry
+ic4te
+i2c1t
+fic4te
+fi2c1t
+ic1tu2
+fic1tu2
+ic4t3u1a
+fic4t3u1a
+ic3u1la
+fic3u1la
+ic4um
+fic4um
+ic5uo
+fic5uo
+i3cur
+fi3cur
+2id
+i4dai2
+i1d2a
+fi4dai2
+fi1d2a
+id5anc
+ida2n
+fid5anc
+fida2n
+id5d4
+fid5d4
+ide3a4l
+fide3a4l
+ide4s2
+fide4s2
+i2di
+fi2di
+id5i2a2n
+i1d4i3a
+fid5i2a2n
+fi1d4i3a
+idi4a2r
+fidi4a2r
+i5d2ie4
+fi5d2ie4
+i1d3io
+fi1d3io
+idi5ou2
+fidi5ou2
+id1it
+fid1it
+id5i1u
+fid5i1u
+i3dle
+fi3dle
+i4dom
+i1do
+fi4dom
+fi1do
+id3ow
+fid3ow
+i4dr
+fi4dr
+i2du
+fi2du
+id5uo
+fid5uo
+2ie4
+fie4
+ied4e
+fied4e
+5ie5ga
+fie5ga
+ie2ld3
+fie2ld3
+ie1n5a4
+fie1n5a4
+ien4e
+fien4e
+i5e4n1n2
+fi5e4n1n2
+i3ent2i
+ien1t
+fi3ent2i
+fien1t
+i1er.
+fi1er.
+i3es2c
+fi3es2c
+i1est
+fi1est
+i3et
+fi3et
+4if.
+fif.
+if5ero
+ifer1
+fif5ero
+fifer1
+iff5en
+i4f1f
+iff5en
+i4ff
+fiff5en
+fi4ff
+if4fr
+iffr
+fiffr
+4i2f3ic.
+i1fi
+4i2fic.
+i1fi
+fi2fic.
+1fi1fi
+i3f2ie4
+i3fie4
+fi3fie4
+i3f4l2
+i3fl2
+fi3fl2
+4i2ft
+fi2ft
+2ig
+iga5b
+i1ga
+figa5b
+fi1ga
+ig3er1a
+fig3er1a
+ight3i
+fight3i
+4igi
+figi
+i3gib
+fi3gib
+ig3il4
+fig3il4
+ig3in
+fig3in
+ig3it
+fig3it
+i4g4l2
+fi4g4l2
+i2go
+fi2go
+ig3or
+fig3or
+ig5ot
+fig5ot
+i5gre
+i1gr
+fi5gre
+fi1gr
+ig2u5i2
+fig2u5i2
+ig1ur
+fig1ur
+i3h
+fi3h
+4i5i4
+fi5i4
+i3j
+fi3j
+4ik
+fik
+i1la
+fi1la
+il3a4b
+fil3a4b
+i4l4ade
+ila2d
+fi4l4ade
+fila2d
+i2l5am
+fi2l5am
+ila5ra
+il2a2r
+fila5ra
+fil2a2r
+i3leg
+fi3leg
+il1er
+fil1er
+ilev4
+filev4
+i2l5f
+fi2l5f
+i2l5ff
+fi2l5ff
+i2l5fi
+1fi2l5fi
+i2l5fl2
+fi2l5fl2
+il1i
+il3i1a
+fil3i1a
+il2ib
+fil2ib
+il3io
+fil3io
+il4ist
+fil4ist
+2il1it
+fil1it
+il2iz
+fil2iz
+ill5ab
+il1l
+fill5ab
+4i2l1n2
+fi2l1n2
+il3o1q
+fil3o1q
+il4ty
+i4lt
+fil4ty
+fi4lt
+il5ur
+fil5ur
+il3v
+fil3v
+i4mag
+i1ma
+fi4mag
+fi1ma
+im3age
+fim3age
+ima5ry
+im2a2r
+fima5ry
+fim2a2r
+iment2a5r
+i1men
+i3men1t
+imen1ta
+fiment2a5r
+fi1men
+fi3men1t
+fimen1ta
+4imet
+fimet
+im1i
+fim1i
+im5i1d4a
+im2id
+fim5i1d4a
+fim2id
+imi5le
+fimi5le
+i5m2ini
+fi5m2ini
+4imit
+fimit
+im4ni
+i4m1n
+fim4ni
+fi4m1n
+i3mo2n
+i1mo
+fi3mo2n
+fi1mo
+i2mu
+fi2mu
+im3u1la
+fim3u1la
+2in.
+fin.
+i4n3au
+i1na
+fi4n3au
+4inav
+finav
+incel4
+fincel4
+in3cer
+fin3cer
+4ind
+in5dling
+fin5dling
+2ine
+i3nee
+fi3nee
+in4er4a2r
+in1er
+iner1a
+fin4er4a2r
+fin1er
+finer1a
+i5n2e2ss
+i1nes
+fi5n2e2ss
+fi1nes
+4in1ga
+fin1ga
+4inge
+finge
+in5gen
+fin5gen
+4ingi
+fingi
+in5gling
+ingl2
+fin5gling
+fingl2
+4in1go
+fin1go
+4in1gu
+fin1gu
+2ini
+fini
+i5ni.
+fi5ni.
+i4n4i1a
+fi4n4i1a
+in3i4o
+fin3i4o
+in1is
+fin1is
+i5ni4te.
+in2it
+in2ite
+fi5ni4te.
+fin2it
+fin2ite
+5i3n2i1t2io
+ini1ti
+fi3n2i1t2io
+fini1ti
+in3i1ty
+fin3i1ty
+4i4nk2
+fi4nk2
+4i4n1l
+fi4n1l
+2i4n1n2
+2i1no
+fi1no
+i4no4c
+fi4no4c
+ino4s
+fino4s
+i4not
+fi4not
+2i2n1s2
+fi2n1s2
+in3se
+fin3se
+insu1r5a
+in1su
+insu2r
+finsu1r5a
+fin1su
+finsu2r
+2int.
+in1t
+fint.
+fin1t
+2in4th
+fin4th
+in1u
+fin1u
+i5n2us
+fi5n2us
+4iny
+finy
+2io
+fio
+4io.
+fio.
+io1ge4
+fio1ge4
+io2gr
+fio2gr
+i1ol
+fi1ol
+io4m
+fio4m
+ion3at
+io2n
+io1n1a
+fion3at
+fio2n
+fio1n1a
+ion4ery
+ion1er
+fion4ery
+fion1er
+ion3i
+fion3i
+i2o5ph
+fi2o5ph
+ior3i
+fior3i
+i4os
+fi4os
+i4o5th
+fi4o5th
+i5oti
+fi5oti
+io4to
+fio4to
+i4our
+iou2
+fi4our
+fiou2
+2ip
+fip
+ipe4
+fipe4
+iphr2as4
+ip4hr4
+fiphr2as4
+fip4hr4
+ip3i
+fip3i
+ip4ic
+fip4ic
+ip4re4
+ipr2
+fip4re4
+fipr2
+ip3ul
+fip3ul
+i3qua
+iqu2
+fi3qua
+fiqu2
+iq5ue1f
+fiq5ue1f
+iq5u1e4ff
+fiq5u1e4ff
+iq5ue1fi
+1fiq5ue1fi
+iq5ue1fl2
+fiq5ue1fl2
+iq3u2id
+iq2ui2
+fiq3u2id
+fiq2ui2
+iq3ui3t
+fiq3ui3t
+4ir
+fir
+i1ra
+fi1ra
+i2ra4b
+fi2ra4b
+i4rac
+fi4rac
+ird5e
+fird5e
+ire4de
+i2r2ed
+fire4de
+fi2r2ed
+i4re1f
+fi4re1f
+i4r1e4ff
+fi4r1e4ff
+i4re3fi
+1fi4re3fi
+i4re1fl2
+fi4re1fl2
+i4rel4
+fi4rel4
+i4res
+fi4res
+ir5gi
+irg2
+fir5gi
+firg2
+ir1i
+fir1i
+iri5de
+ir2id
+firi5de
+fir2id
+ir4is
+fir4is
+iri3tu
+firi3tu
+5i5r2iz
+fi5r2iz
+ir4min
+ir1m
+fir4min
+fir1m
+iro4g
+firo4g
+5iron.
+iro2n
+firon.
+firo2n
+ir5ul
+fir5ul
+2is.
+fis.
+is5ag
+isa2
+fis5ag
+fisa2
+is3a2r
+fis3a2r
+isas5
+fisas5
+2is1c
+fis1c
+is3ch2
+fis3ch2
+4ise
+fise
+is3er
+fis3er
+3i4s3f
+fi4s3f
+3i4s4ff
+fi4s4ff
+3i4s3fi
+1fi4s3fi
+3i4s3fl2
+fi4s3fl2
+is5ha2n
+is2h
+fis5ha2n
+fis2h
+is3ho2n3
+isho4
+fis3ho2n3
+fisho4
+ish5op
+fish5op
+is3i1b
+fis3i1b
+is2i4d
+fis2i4d
+i5sis
+fi5sis
+is5i1t2iv
+isi1ti
+fis5i1t2iv
+fisi1ti
+4is4k2
+fis4k2
+isla2n4
+is1l2
+fisla2n4
+fis1l2
+4is4m1s2
+i2s1m
+fis4m1s2
+fi2s1m
+i2so
+fi2so
+iso5mer
+i3som
+iso2me
+fiso5mer
+fi3som
+fiso2me
+is1p
+fis1p
+is2pi
+fis2pi
+is4py
+fis4py
+4i2s1s
+fi2s1s
+is4sal
+is1sa2
+fis4sal
+fis1sa2
+issen4
+fissen4
+is4s1e4s
+fis4s1e4s
+is4ta.
+is1ta
+fis4ta.
+fis1ta
+is1te
+fis1te
+is1t2i
+ist4ly
+is2tl
+fist4ly
+fis2tl
+4istral
+ist4r
+is1tra
+fistral
+fist4r
+fis1tra
+i2su
+fi2su
+is5us
+fis5us
+4i3ta.
+i1ta
+fi3ta.
+fi1ta
+ita4bi
+i2tab
+fita4bi
+fi2tab
+i4tag
+fi4tag
+4ita5m
+fita5m
+i3ta2n
+fi3ta2n
+i3tat
+fi3tat
+2ite
+fite
+it3er1a
+fit3er1a
+i5ter1i
+fi5ter1i
+it4es
+fit4es
+2ith
+fith
+i1ti
+fi1ti
+4i1t2i1a
+fi1t2i1a
+4i2tic
+fi2tic
+it3i1ca
+fit3i1ca
+5i5tick1
+fi5tick1
+i2t3ig
+fi2t3ig
+it5il1l
+fit5il1l
+i2tim
+fi2tim
+2i1t2io
+fi1t2io
+4itis
+fitis
+i4ti2s4m
+fi4ti2s4m
+i2t5o5m
+i1to
+fi2t5o5m
+fi1to
+4ito2n
+fito2n
+i4tram
+i1tra
+fi4tram
+fi1tra
+it5ry
+fit5ry
+4i4t3t2
+fi4t3t2
+it3u1at
+i1tu
+itu1a
+fit3u1at
+fi1tu
+fitu1a
+i5tud2
+fi5tud2
+it3ul
+fit3ul
+4itz.
+i4tz
+fitz.
+fi4tz
+i1u
+fi1u
+2iv
+fiv
+iv3el1l
+fiv3el1l
+iv3en.
+fiv3en.
+i4v3er.
+fi4v3er.
+i4vers.
+ive4r1s2
+fi4vers.
+five4r1s2
+iv5il.
+i2vil
+fiv5il.
+fi2vil
+iv5io
+fiv5io
+iv1it
+fiv1it
+i5vore
+fi5vore
+iv3o3ro
+fiv3o3ro
+i4v3ot
+fi4v3ot
+4i5w
+fi5w
+ix4o
+fix4o
+4iy
+fiy
+4iz2a2r2
+iza1
+fiz2a2r2
+fiza1
+i2z1i4
+fi2z1i4
+5izon1t
+i1zo
+izo2n
+fizon1t
+fi1zo
+fizo2n
+5ja
+jac4q
+ja4p
+1je
+je4r5s2
+4jes4t2ie4
+jest2i
+4jes2ty
+jew3
+jo4p
+5judg
+3ka.
+k3ab
+k5ag
+kais4
+kai2
+kal4
+k1b
+k2ed
+1kee
+ke4g
+ke5l2i
+k3en4d
+k1er
+kes4
+k3e2st.
+ke4ty
+k3f
+k4ff
+k3fi
+k3fl2
+kh4
+k1i
+5ki.
+5k2ic
+k4il1l
+kilo5
+k4im
+k4in.
+kin4de
+k4ind
+k5i5n2e2ss
+k2ine
+ki1nes
+kin4g
+k2i4p
+kis4
+k5is2h
+kk4
+k1l
+4k3ley
+4k1ly
+k1m
+k5nes
+1k2no
+ko5r
+kos2h4
+k3ou2
+kro5n
+4k1s2
+k4sc
+ks4l2
+k4s4y
+k5t
+k1w
+lab3ic
+flab3ic
+l4abo
+fl4abo
+l4a2ci4
+fl4a2ci4
+l4ade
+la2d
+fl4ade
+fla2d
+la3d2y
+fla3d2y
+lag4n
+flag4n
+la2m3o
+fla2m3o
+3l4and
+la2n
+fl4and
+fla2n
+lan4dl
+flan4dl
+lan5et
+flan5et
+lan4te
+lan1t
+flan4te
+flan1t
+lar4g2
+l2a2r
+flar4g2
+fl2a2r
+lar3i
+flar3i
+las4e
+flas4e
+la5ta2n
+la2ta
+fla5ta2n
+fla2ta
+4latel2i4
+flatel2i4
+4la1t2iv
+fla1t2iv
+4lav
+flav
+la4v4a
+fla4v4a
+2l1b
+fl1b
+lbin4
+flbin4
+4l1c2
+fl1c2
+lce4
+flce4
+l3ci
+fl3ci
+2ld
+fld
+l2de
+fl2de
+ld4ere
+fld4ere
+ld4er1i
+fld4er1i
+ldi4
+fldi4
+ld5is1
+fld5is1
+l3dr
+fl3dr
+l4dri
+fl4dri
+le2a
+fle2a
+le4bi
+l2e1b
+fle4bi
+fl2e1b
+le2ft5
+le1f
+fle2ft5
+fle1f
+5leg.
+fleg.
+5le4g1g2
+fle4g1g2
+le4mat
+le1ma
+fle4mat
+fle1ma
+lem5at1ic
+flem5at1ic
+4len.
+flen.
+3lenc
+flenc
+5le2ne.
+fle2ne.
+1len1t
+flen1t
+le3ph
+fle3ph
+le4pr2
+fle4pr2
+le2ra5b
+ler1a
+fle2ra5b
+fler1a
+ler4e
+fler4e
+3lerg2
+flerg2
+3l4er1i
+fl4er1i
+l4ero
+fl4ero
+les2
+le5s1co
+les2c
+fle5s1co
+fles2c
+5lesq
+flesq
+3l2e2ss
+5less.
+fless.
+l3e1va
+fl3e1va
+lev4er.
+lev1er
+flev4er.
+flev1er
+lev4er1a
+flev4er1a
+lev4e4r1s2
+flev4e4r1s2
+3ley
+fley
+4leye
+fleye
+2lf
+flf
+2l4ff
+fl4ff
+2l1fi
+fl1fi
+2lfl2
+fl2fl2
+l5fr
+fl5fr
+4l1g4
+fl1g4
+l5ga
+fl5ga
+lg2a2r3
+flg2a2r3
+l4ges
+fl4ges
+l1go3
+fl1go3
+2l3h
+fl3h
+li4ag
+l2i1a
+fli4ag
+fl2i1a
+li2am4
+fli2am4
+liar5iz
+li2a2r
+liar1i
+fliar5iz
+fli2a2r
+fliar1i
+li4as
+fli4as
+li4a1to
+fli4a1to
+li5bi
+fli5bi
+5lic2io
+l2i1ci
+flic2io
+fl2i1ci
+li4cor
+li1co
+fli4cor
+fli1co
+4li4c3s2
+fli4c3s2
+4lict.
+li2c1t
+flict.
+fli2c1t
+l4icu
+fl4icu
+l3i1cy
+fl3i1cy
+l3i1d2a
+l2id
+fl3i1d2a
+fl2id
+lid5er
+flid5er
+3li2di
+fli2di
+lif3er1
+flif3er1
+l4i4f1f
+l4i4ff
+fl4i4ff
+li4f4l2
+li4fl2
+fl2i4fl2
+5ligate
+l2ig
+li1ga
+fligate
+fl2ig
+fli1ga
+3ligh
+fligh
+li4gra
+li1gr
+fli4gra
+fli1gr
+3l4ik
+fl4ik
+4l4i4l
+fl4i4l
+lim4b2l2
+li4m1b
+flim4b2l2
+fli4m1b
+lim3i
+flim3i
+li4mo
+fli4mo
+l4i4m4p
+fl4i4m4p
+l4i1na
+fl4i1na
+1l4ine
+fl4ine
+lin3ea
+flin3ea
+l2in3i
+fl2in3i
+link5er
+l4i4nk2
+flink5er
+fl4i4nk2
+li5og
+l2io
+fli5og
+fl2io
+4l4iq
+fl4iq
+lis4p
+flis4p
+l1it
+fl1it
+l2it.
+fl2it.
+5lit3i1ca
+li1ti
+l4i2tic
+flit3i1ca
+fli1ti
+fl4i2tic
+l5i5ti4c3s2
+fl5i5ti4c3s2
+liv3er
+l2iv
+fliv3er
+fl2iv
+l1iz
+fl1iz
+4lj
+flj
+lka3
+flka3
+l3kal4
+fl3kal4
+lka4t
+flka4t
+l1l
+fl1l
+l4law
+fl4law
+l2le
+fl2le
+l5le2a
+fl5le2a
+l3lec
+fl3lec
+l3leg
+fl3leg
+l3lel
+fl3lel
+l3le4n
+fl3le4n
+l3le4t
+fl3le4t
+ll2i
+fll2i
+l2lin4
+fl2lin4
+l5l4i1na
+fl5l4i1na
+ll4o
+fll4o
+lloq2ui5
+llo1q
+lloqu2
+flloq2ui5
+fllo1q
+flloqu2
+l2l5out
+llou2
+fl2l5out
+fllou2
+l5low
+fl5low
+2lm
+flm
+l5met
+fl5met
+lm3ing
+flm3ing
+l4mo2d1
+l1mo
+fl4mo2d1
+fl1mo
+lmo2n4
+flmo2n4
+2l1n2
+fl1n2
+3lo.
+flo.
+lob5al
+flob5al
+lo4ci
+flo4ci
+4lof
+flof
+4lo4ff
+flo4ff
+4lo2fi
+flo2fi
+4lofl2
+fl2ofl2
+3log1ic
+flog1ic
+l5o1go
+fl5o1go
+3logu
+flogu
+lom3er
+lo2me
+flom3er
+flo2me
+5long
+lo2n
+flong
+flo2n
+lon4i
+flon4i
+l3o3niz
+fl3o3niz
+lood5
+loo2
+flood5
+floo2
+5lo4pe.
+flo4pe.
+lop3i
+flop3i
+l3o4p1m
+fl3o4p1m
+lo1ra4
+flo1ra4
+lo4ra1to
+flo4ra1to
+lo5r2ie4
+flo5r2ie4
+lor5ou2
+flor5ou2
+5los.
+flos.
+los5et
+flos5et
+5los5o3phiz
+lo2so
+los4op
+los2oph
+flos5o3phiz
+flo2so
+flos4op
+flos2oph
+5los5o1phy
+flos5o1phy
+los4t
+flos4t
+lo4ta
+flo4ta
+loun5d
+lou2
+floun5d
+flou2
+2lout
+flout
+4lov
+flov
+2lp
+flp
+lpa5b
+l1pa
+flpa5b
+fl1pa
+l3pha
+fl3pha
+l5phi
+fl5phi
+lp5ing
+lpi2n
+flp5ing
+flpi2n
+l3pit
+fl3pit
+l4p2l2
+fl4p2l2
+l5pr2
+fl5pr2
+4l1r
+fl1r
+2l1s2
+fl1s2
+l4sc
+fl4sc
+l2se
+fl2se
+l4s2ie4
+fl4s2ie4
+4lt
+flt
+lt5ag
+l1ta
+flt5ag
+fl1ta
+ltane5
+lta2n
+fltane5
+flta2n
+l1te
+fl1te
+lten4
+flten4
+lter1a4
+flter1a4
+lth3i
+flth3i
+l5ties.
+lt2ie4
+fl5ties.
+flt2ie4
+ltis4
+fltis4
+l1tr
+fl1tr
+l1tu2
+fl1tu2
+ltu1r3a
+fltu1r3a
+lu5a
+flu5a
+lu3br
+flu3br
+lu2ch4
+flu2ch4
+lu3ci
+flu3ci
+lu3en
+flu3en
+luf4
+fluf4
+lu4ff
+flu4ff
+lu1fi
+flu1fi
+lu3fl2
+fl2u3fl2
+lu5id
+l2ui2
+flu5id
+fl2ui2
+lu4ma
+flu4ma
+5lu1mi
+flu1mi
+l5umn.
+lu4m1n
+fl5umn.
+flu4m1n
+5lum3n4i1a
+flum3n4i1a
+lu3o
+flu3o
+luo3r
+fluo3r
+4lup
+flup
+lu2ss4
+l2us
+flu2ss4
+fl2us
+lus3te
+flus3te
+1lut
+flut
+l5ven
+fl5ven
+l5vet4
+fl5vet4
+2l1w
+fl1w
+1ly
+4lya
+flya
+4ly1b
+fly1b
+ly5me4
+fly5me4
+ly3no
+fly3no
+2lys4
+flys4
+l5y3s2e
+fl5y3s2e
+1ma
+2mab
+ma2ca
+ma5ch2ine
+ma2ch
+ma4ch1in
+ma4c4l4
+mag5in
+mag1i
+5mag1n
+2mah
+ma2id5
+mai2
+4ma2ld
+ma3l2ig
+mal1i
+ma5lin
+mal4l2i
+mal1l
+mal4ty
+ma4lt
+5ma3n4i1a
+ma2n
+man5is
+man3iz
+4map
+ma5ri2ne.
+m2a2r
+mar1i
+mar2in4e
+ma5r2iz
+mar4ly
+mar1l
+mar3v
+ma5sce
+mas4e
+mas1t
+5mate
+m4ath3
+ma3tis
+4mati3za1
+ma1tiz
+4m1b
+m1ba4t5
+m5bil
+m4b3ing
+mb2i4v
+4m5c
+4me.
+2med
+4med.
+5me3d4i3a
+m4edi
+me3d2ie4
+m5e5d2y
+me2g
+mel5o2n
+me4l4t
+me2m
+me1m1o3
+1men
+me1n4a
+men5ac
+men4de
+4mene
+men4i
+me2n1s4
+men1su5
+3men1t
+men4te
+me5o2n
+m5er1sa2
+me4r1s2
+2mes
+3mest2i
+me4ta
+met3a2l
+me1te
+me5thi
+m4etr
+5met3ric
+me5tr2ie4
+me3try
+me4v
+4m1f
+4m4ff
+4m1fi
+4m1fl2
+2mh
+5mi.
+m2i3a
+mi1d4a
+m2id
+mid4g
+m2ig4
+3mil3i1a
+mil1i
+m5i5l2ie4
+m4il1l
+mi1n4a
+3m4ind
+m5i3nee
+m2ine
+m4ingl2
+min5gli
+m5ing1ly
+min4t
+m4in1u
+miot4
+m2io
+m2is
+mi4s4er.
+m4ise
+mis3er
+mis5l2
+mis4t2i
+m5i4stry
+mist4r
+4m2ith
+m2iz
+4mk
+4m1l
+m1m
+mma5ry
+m1ma
+mm2a2r
+4m1n
+m1n4a
+m4n1in
+mn4o
+1mo
+4mocr
+5moc5ra1tiz
+mo2d1
+mo4go
+mois2
+moi2
+mo4i5se
+4m2ok
+mo5lest
+moles2
+mo3me
+mon5et
+mo2n
+mon5ge
+mo3n4i3a
+mon4i2s1m
+mon1is
+mon4ist
+mo3niz
+monol4
+mo3ny.
+mo2r
+4mo5ra.
+mo1ra
+mos2
+mo5sey
+mo3sp
+m4oth3
+m5ouf
+mou2
+m5ou4ff
+m5ou1fi
+m5ou3fl2
+3mo2us
+mo2v
+4m1p
+mpara5
+m1pa
+mp2a2r
+mpa5rab
+mp4a4r5i
+m3pe2t
+mphas4
+m2pi
+mp2i4a
+mp5ies
+mp2ie4
+m4p1i2n
+m5p4ir
+mp5is
+mpo3ri
+m1p4or
+mpos5ite
+m1pos
+m4po2us
+mpou2
+mpov5
+mp4tr
+m2p1t
+m2py
+4m3r
+4m1s2
+m4s2h
+m5si
+4mt
+1mu
+mul2a5r4
+mu1la
+5mu4lt
+mul1ti3
+3mum
+mun2
+4mup
+mu4u
+4mw
+1na
+2n1a2b
+n4abu
+4nac.
+na4ca
+n5a2c1t
+nag5er.
+nak4
+na4l1i
+na5l2i1a
+4na4lt
+na5mit
+n2a2n
+nan1ci4
+nan4it
+na4nk4
+nar3c
+n2a2r
+4nare
+nar3i
+nar4l
+n5ar1m
+n4as
+nas4c
+nas5t2i
+n2at
+na3ta2l
+na2ta
+nat5o5m2iz
+na2tom
+na1to
+n2au
+nau3se
+na2us
+3naut
+nav4e
+4n1b4
+nc2a2r5
+n1ca
+n4ces.
+n3cha
+n2ch
+n5cheo
+nche2
+n5ch4il2
+n3chis
+n2c1in
+n1ci
+n2c4it
+ncou1r5a
+n1co
+ncou2
+n1cr
+n1cu
+n4dai2
+n1d2a
+n5da2n
+n1de
+nd5e2st.
+ndes2
+ndi4b
+n5d2if
+n5d2i4ff
+n5d2i1fi
+n5d2i3fl2
+n1dit
+n3diz
+n5du2c
+n1du
+ndu4r
+nd2we
+nd1w
+2ne.
+n3e2a2r
+n2e2b
+neb3u
+ne2c
+5neck1
+2ned
+ne4gat
+ne1ga
+ne4g5a1t2iv
+5nege
+ne4la
+nel5iz
+nel2i
+ne5mi
+ne4mo
+1nen
+4nene
+3neo
+ne4po
+ne2q
+n1er
+ne2ra5b
+ner1a
+n4er3a2r
+n2ere
+n4er5i
+ner4r4
+1nes
+2nes.
+4ne1sp
+2nest
+4nes4w2
+3net1ic
+ne4v
+n5eve
+ne4w
+n3f
+n4ff
+n3fi
+n3fl2
+n4gab
+n1ga
+n3gel
+nge4n4e
+n1gen
+n5gere
+n3ger1i
+ng5ha
+n3gib
+ng1in
+n5git
+n4gla4
+ngl2
+ngov4
+n1go
+ng5s2h
+ngs2
+n1gu
+n4gum
+n2gy
+4n1h4
+nha4
+nhab3
+nhe4
+3n4i1a
+ni3a2n
+ni4ap
+ni3ba
+ni4b2l2
+n2i4d
+ni5di
+ni4er
+n2ie4
+ni2fi
+ni2fi
+ni5ficat
+nifi1ca
+ni5ficat
+nifi1ca
+n5i1gr
+n2ig
+n4ik4
+n1im
+ni3m2iz
+nim1i
+n1in
+5ni2ne.
+n2ine
+nin4g
+n2i4o
+5n2is.
+nis4ta
+n2it
+n4ith
+3n2i1t2io
+ni1ti
+n3itor
+ni1to
+ni3tr
+n1j
+4nk2
+n5k2ero
+nk1er
+n3ket
+nk3in
+nk1i
+n1k1l
+4n1l
+n5m
+nme4
+nmet4
+4n1n2
+nne4
+nni3al
+n3n4i1a
+nn2i4v
+nob4l2
+no3ble
+n5o1c4l4
+4n3o2d
+3noe
+4nog
+no1ge4
+nois5i
+noi2
+no5l4i
+5nol1o1gis
+3nomic
+n5o5m2iz
+no4mo
+no3my
+no4n
+non4ag
+no1n1a
+non5i
+n5oniz
+4nop
+5nop5o5l2i
+no2r5ab
+no1ra
+no4rary
+nor2a2r
+4nos2c
+nos4e
+nos5t
+no5ta
+1nou2
+3noun
+nov3el3
+nowl3
+n1p4
+npi4
+npre4c
+npr2
+n1q
+n1r
+nru4
+2n1s2
+n2s5ab
+nsa2
+nsati4
+ns4c
+n2se
+n4s3e4s
+ns2id1
+ns2ig4
+n2s1l2
+n2s3m
+n4soc
+n1so
+ns4pe
+n5spi
+nsta5b2l2
+ns1ta
+ns2tab
+n1t
+n2ta4b
+n1ta
+nte4r3s2
+nt2i
+n5ti2b
+nti4er
+nt2ie4
+nti2f2
+nti4ff
+nti2fi
+nti3fl2
+n3t2ine
+n2t1in
+n4t3ing
+nt2i4p
+ntrol5l2i
+ntrol1l
+n4t4s2
+ntu3me
+n1tu
+n3tum
+nu1a
+nu4d
+nu5en
+nuf4fe
+nu4f1f
+nuffe
+nu4ff
+n3ui4n
+n2ui2
+3nu3it
+n4um
+nu1me
+n5u1mi
+3nu4n
+n3uo
+nu3tr
+n1v2
+n1w4
+nym4
+nyp4
+4nz
+n3za1
+4oa
+oa2d3
+o5a5les2
+o2ale
+oard3
+o2a2r
+oas4e
+oast5e
+oat5i
+ob3a3b
+o5b2a2r
+o1be4l
+o1bi
+o2bin
+ob5ing
+o3br
+ob3ul
+o1ce
+o2ch4
+o3che4t
+oche2
+ocif3
+o1ci
+oci4ff
+oci1fi
+oci3fl2
+o4cil
+o4clam
+o1c4l4
+o4cod
+o1co
+oc3rac
+oc5ra1tiz
+ocre3
+5ocrit
+ocri2
+octo2r5a
+o2c1t
+oc1to
+oc3u1la
+o5cure
+od5d1ed
+od1d4
+od3ic
+o1d2i3o
+o2do4
+od4or3
+o4d5uct.
+o1du
+odu2c
+odu2c1t
+o4d5uc4t1s2
+o4el
+o5eng
+o3er
+oe4ta
+o3ev
+o2fi
+o2fi
+of5ite
+ofite
+of4i4t4t2
+ofi4t4t2
+o2g5a5r
+o1ga
+o4g5a1t2iv
+o4ga1to
+o1ge
+o5gene
+o1gen
+o5geo
+o4ger
+o3g2ie4
+1o1gis
+og3it
+o4gl2
+o5g2ly
+3ogniz
+og1ni
+o4g4ro
+o1gr
+og2u5i2
+1o1gy
+2o2g5y3n
+o1h2
+ohab5
+oi2
+oic3es
+oi3der
+o2id
+oi4f1f4
+oi4ff4
+o2ig4
+oi5let
+o3ing
+oint5er
+oin1t
+o5i2s1m
+oi5so2n
+oi2so
+oist5en
+ois1te
+oi3ter
+o2ite
+o5j
+2ok
+o3ken
+ok5ie4
+ok1i
+o1la
+o4la2n
+ola2ss4
+o2l2d
+ol2d1e
+ol3er
+o3les2c
+oles2
+o3let
+ol4fi
+o2lf
+o2l4fi
+ol2i
+o3l2i1a
+o3lice
+ol5id.
+ol2id
+o3li4f
+o3l4i4ff
+o3li4fi
+o3li4fl2
+o5l4i4l
+ol3ing
+o5l2io
+o5l2is.
+ol3is2h
+o5l2ite
+ol1it
+o5l2i1t2io
+oli1ti
+o5l2iv
+oll2i4e4
+ol1l
+oll2i
+ol5o3giz
+olo4r
+ol5p2l2
+o2lp
+o4l2t
+ol3ub
+ol3ume
+ol3un
+o5l2us
+ol2v
+o2ly
+o2m5ah
+o1ma
+oma5l
+om5a1tiz
+om2be
+o4m1b
+om4b2l2
+o2me
+om3e1n4a
+o1men
+om5er2se
+ome4r1s2
+o4met
+om5e3try
+om4etr
+o3m2i3a
+om3ic.
+om3i1ca
+o5m2id
+om1in
+o5m2ini
+5ommend
+om1m
+om1men
+omo4ge
+o1mo
+o4mo2n
+om3pi
+o4m1p
+ompro5
+ompr2
+o2n
+o1n1a
+on4ac
+o3n2a2n
+on1c
+3oncil
+on1ci
+2ond
+on5do
+o3nen
+o2n5est
+o1nes
+on4gu
+on1ic
+o3n2i4o
+on1is
+o5ni1u
+on3key
+o4nk2
+on4odi
+o4n3o2d
+on3o3my
+o2n3s2
+on5spi4
+onspi1r5a
+onsp4ir
+on1su4
+onten4
+on1t
+on3t4i
+onti2f5
+onti4ff
+onti2fi
+onti3fl2
+on5um
+on1va5
+on1v2
+oo2
+ood5e
+ood5i
+o2o4k
+oop3i
+o3ord
+oost5
+o2pa
+o2p2e5d
+op1er
+3oper1a
+4op4erag
+2oph
+o5pha2n
+o5ph4er
+op3ing
+opi2n
+o3pit
+o5po2n
+o4posi
+o1pos
+o1pr2
+op1u
+opy5
+o1q
+o1ra
+o5ra.
+o4r3ag
+or5al1iz
+oral1i
+or5an4ge
+ora2n
+or2ang
+ore5a
+o5re1a4l
+or3ei2
+or4e5s2h
+or5e2st.
+ores2t
+orew4
+or4gu
+org2
+4o5r2i3a
+or3i1ca
+o5ril
+or1in
+o1r2i1o
+or3i1ty
+o3ri1u
+or2mi
+or1m
+orn2e
+o5rof
+o5ro4ff
+o5ro2fi
+o5rofl2
+or3oug
+orou2
+or5pe
+or1p
+3orrh4
+or1r4
+or4se
+o4rs2
+ors5en
+orst4
+or3thi
+or3thy
+or4ty
+o5rum
+o1ry
+os3al
+osa2
+os2c
+os4ce
+o3scop
+os1co
+4oscopi
+o5scr
+os4i4e4
+os5i1t2iv
+osi1ti
+os3i1to
+os3i1ty
+o5si4u
+os4l2
+o2so
+o2s4pa
+os4po
+os2ta
+o5stati
+os5til
+ost2i
+os5tit
+o4ta2n
+o1ta
+otele4g
+ot3er.
+ot5e4r1s2
+o4tes
+4oth
+oth5e1si
+oth2e
+oth1es
+oth3i4
+ot3ic.
+ot5i1ca
+o3tice
+o3tif2
+o3ti4ff
+o3ti1fi
+o3ti3fl2
+o3tis
+oto5s2
+o1to
+ou2
+ou3b2l2
+ouch5i
+ou2ch
+ou5et
+ou4l
+ounc5er
+oun2d
+ou5v2
+ov4en
+over4ne
+ove4r3s2
+ov4ert
+o3vis
+o4vi1ti4
+o5v4ol
+ow3der
+ow3el
+ow5est3
+ow1i2
+own5i
+o4wo2
+oy1a
+1pa
+pa4ca
+pa4ce
+pa2c4t
+p4a2d
+5paga4n
+pa1ga
+p3agat
+p4ai2
+pa4i4n4
+p4al
+pa1n4a
+pa2n
+pan3el
+pan4ty
+pan1t
+pa3ny
+pa1p
+pa4pu
+para5b2l2
+p2a2r
+pa2rab
+par5age
+par5d2i
+3pare
+par5el
+p4a4r1i
+par4is
+pa2te
+pa5ter
+5pathic
+p4ath
+pa5thy
+pa4tric
+pa1tr
+pav4
+3pay
+4p1b
+pd4
+4pe.
+3pe4a
+pear4l
+pe2a2r
+pe2c
+2p2ed
+3pede
+3p4edi
+pe3d4i3a4
+ped4ic
+p4ee
+pee4d
+pek4
+pe4la
+pel2i4e4
+pel2i
+pe4n2a2n
+pe1na
+p4enc
+pen4th
+pen1t
+pe5o2n
+p4era.
+per1a
+pera5b2l2
+pe2ra4b
+p4erag
+p4er1i
+peri5st
+per2is
+per4mal
+per3m4
+per1ma
+per2me5
+p4ern
+p2er3o
+per3ti
+p4e5ru
+per1v
+pe2t
+pe5ten
+pe5tiz
+4pf
+4p4ff
+4p1fi
+4pfl2
+4pg
+4ph.
+phar5i
+ph2a2r
+ph4e3no
+phe2n
+ph4er
+ph4es.
+ph1es
+ph1ic
+5ph2ie4
+ph5ing
+5phis1t2i
+3phiz
+p4h2l4
+3phob
+3phone
+pho2n
+5phoni
+pho4r
+4p4h1s2
+ph3t
+5phu
+1phy
+p2i3a
+pi2a2n4
+pi4c2ie4
+p2i1ci
+pi4cy
+p4id
+p5i1d2a
+pi3de
+5pi2di
+3piec
+p2ie4
+pi3en
+pi4grap
+p2ig
+pi1gr
+pi3lo
+pi2n
+p4in.
+p4ind4
+p4i1no
+3p2i1o
+pio2n4
+p3ith
+pi5tha
+pi2tu
+2p3k2
+1p2l2
+3pla2n
+plas5t
+pl2i3a
+pli5er
+pl2ie4
+4pl2ig
+pli4n
+ploi4
+plu4m
+plu4m4b
+4p1m
+2p3n
+po4c
+5pod.
+po5em
+po3et5
+5po4g
+poin2
+poi2
+5poin1t
+poly5t
+po2ly
+po4ni
+po2n
+po4p
+1p4or
+po4ry
+1pos
+po2s1s
+p4ot
+po4ta
+5poun
+pou2
+4p1p
+ppa5ra
+p1pa
+pp2a2r
+p2pe
+p4p2ed
+p5pel
+p3pen
+p3per
+p3pe2t
+ppo5s2ite
+p1pos
+pr2
+pray4e4
+5pre1c2i
+pre5co
+pre3e2m
+pre4f5ac
+pre1f
+pre1fa
+pre4la
+pr1e3r4
+p3re1s2e
+3pr2e2ss
+pre5ten
+pre3v2
+5pr2i4e4
+prin4t3
+pr2i4s
+pri2s3o
+p3ro1ca
+pr2oc
+prof5it
+pro2fi
+profit
+pro2fi
+pro3l
+pros3e
+pro1t
+2p1s2
+p2se
+ps4h
+p4si1b
+2p1t
+p2t5a4b
+p1ta
+p2te
+p2th
+p1ti3m
+ptu4r
+p1tu
+p4tw4
+pub3
+pue4
+puf4
+pu4ff
+pu1fi
+pu3fl2
+pu4l3c2
+pu4m
+pu2n
+pur4r4
+5p2us
+pu2t
+5pute
+put3er
+pu3tr
+put4t1ed
+pu4t3t2
+put4t1in
+p3w
+qu2
+qua5v4
+2que.
+3quer
+3quet
+2rab
+ra3bi
+rach4e2
+ra2ch
+r5a1c4l4
+raf5fi
+ra2f
+ra4f1f4
+raffi
+ra2f4t
+r2ai2
+ra4lo
+ram3et
+r2ami
+ra3ne5o
+ra2n
+ran4ge
+r2ang
+r4ani
+ra5no4
+rap3er
+3ra1phy
+rar5c
+r2a2r
+rare4
+rar5e1f
+rar5e4ff
+rar5e3fi
+rar5e1fl2
+4raril
+rar1i
+r2as
+ratio2n4
+ra1t2io
+rau4t
+ra5vai2
+ra2va
+rav3el
+ra5z2ie4
+ra2z1i
+r1b
+r4bab
+r4bag
+rbi2
+r2b3i4f
+r2b3i4ff
+r2b3i4fi
+r2b3i4fl2
+r2bin
+r5b2ine
+rb5ing.
+rb4o
+r1c
+r2ce
+r1cen4
+r3cha
+r2ch
+rch4er
+rche2
+r4ci4b
+r1ci
+r2c4it
+rcum3
+r4dal
+r1d2a
+rd2i
+r1d4i4a
+rdi4er
+rd2ie4
+rd1in4
+rd3ing
+2re.
+re1a4l
+re3a2n
+re5ar1r4
+re2a2r
+5rea2v
+re4aw
+r5ebrat
+r2e1b
+re3br
+rec5ol1l
+re2col
+re1co
+re4c5ompe
+reco4m1p
+re4cre
+re1cr
+2r2ed
+re1de
+re3dis1
+r4edi
+red5it
+re4fac
+re1f
+re1fa
+re2fe
+re5fer.
+refer1
+re3fi
+re3fi
+re4fy
+reg3is
+re5it
+rei2
+re1l2i
+re5lu
+r4en4ta
+ren1t
+ren4te
+re1o
+re5pi2n
+re4posi
+re1po
+re1pos
+re1pu
+r1er4
+r4er1i
+r2ero4
+r4e5ru
+r4es.
+re4spi
+re1sp
+res4s5i4b
+r2e2ss
+res1si
+res2t
+re5s2ta2l
+res1ta
+r2e3st4r
+re4ter
+re4ti4z
+re3tri
+r4eu2
+re5u1t2i
+rev2
+re4val
+re1va
+rev3el
+r5ev5er.
+rev1er
+re5ve4r1s2
+re5vert
+re5vi4l
+re1vi
+rev5olu
+re4wh
+r1f
+r4ff
+r1fi
+r1fl2
+r3fu4
+r4fy
+rg2
+rg3er
+r3get
+r3g1ic
+rgi4n
+rg3ing
+r5gis
+r5git
+r1gl2
+rgo4n2
+r1go
+r3gu
+rh4
+4rh.
+4rhal
+r2i3a
+ria4b
+ri4ag
+r4ib
+rib3a
+ric5as5
+ri1ca
+r4ice
+4r2i1ci
+5ri5c2id
+ri4c2ie4
+r4i1co
+rid5er
+r2id
+ri3enc
+r2ie4
+ri3en1t
+ri1er
+ri5et
+rig5a2n
+r2ig
+ri1ga
+5r4igi
+ril3iz
+ril1i
+5rima2n
+ri1ma
+rim5i
+3ri1mo
+rim4pe
+ri4m1p
+r2i1na
+5rina.
+r4in4d
+r2in4e
+rin4g
+r2i1o
+5riph
+r2ip
+riph5e
+ri2p2l2
+rip5lic
+r4iq
+r2is
+r4is.
+r2is4c
+r3is2h
+ris4p
+ri3ta3b
+ri1ta
+r5ited.
+r2ite
+ri2t1ed
+rit5er.
+rit5e4r1s2
+r4i2t3ic
+ri1ti
+ri2tu
+rit5ur
+riv5el
+r2iv
+riv3et
+riv3i
+r3j
+r3ket
+rk4le
+rk1l
+rk4lin
+r1l
+rle4
+r2led
+r4l2ig
+r4lis
+rl5is2h
+r3lo4
+r1m
+rma5c
+r1ma
+r2me
+r3men
+rm5e4r1s2
+rm3ing
+r4ming.
+r4m2io
+r3mit
+r4my
+r4n2a2r
+r1na
+r3nel
+r4n1er
+r5net
+r3ney
+r5nic
+r1nis4
+r3n2it
+r3n2iv
+rno4
+r4nou2
+r3nu
+rob3l2
+r2oc
+ro3cr
+ro4e
+ro1fe
+ro5fil
+ro2fi
+ro5fil
+ro2fi
+r2ok2
+ro5k1er
+5role.
+rom5e1te
+ro2me
+ro4met
+rom4i
+ro4m4p
+ron4al
+ro2n
+ro1n1a
+ron4e
+ro5n4is
+ron4ta
+ron1t
+1room
+roo2
+5root
+ro3pel
+rop3ic
+ror3i
+ro5ro
+ro2s5per
+ro2s4s
+ro4th2e
+r4oth
+ro4ty
+ro4va
+rov5el
+rox5
+r1p
+r4pe4a
+r5pen1t
+rp5er.
+r3pe2t
+rp4h4
+rp3ing
+rpi2n
+r3po
+r1r4
+rre4c
+rre4f
+rr1e4ff
+rre4fi
+rre4fl2
+r4re1o
+rre4s2t
+rr2i4o
+rr2i4v
+rro2n4
+rros4
+rrys4
+4rs2
+r1sa2
+rsa5ti
+rs4c
+r2se
+r3sec
+rse4cr
+r4s5er.
+rs3e4s
+r5se5v2
+r1s2h
+r5sha
+r1si
+r4si4b
+rso2n3
+r1so
+r1sp
+r5sw2
+rta2ch4
+r1ta
+r4tag
+r3t2e1b
+r3ten4d
+r1te5o
+r1ti
+r2t5i2b
+rt2i4d
+r4tier
+rt2ie4
+r3t2ig
+rtil3i
+rtil4l
+r4ti1ly
+r4tist
+r4t2iv
+r3tri
+rtr2oph4
+rt4s2h4
+r4t1s2
+ru3a
+ru3e4l
+ru3en
+ru4gl2
+ru3i4n
+r2ui2
+rum3p2l2
+ru4m2p
+ru2n
+ru4nk5
+run4ty
+run1t
+r5usc2
+r2us
+ru2t1i5n
+r4u1t2i
+rv4e
+rvel4i
+r3ven
+rv5er.
+r5vest
+rv4e2s
+r3vey
+r3vic
+r3v2i4v
+r3vo
+r1w
+ry4c
+5rynge
+ryn5g
+ry3t
+sa2
+2s1ab
+5sack1
+sac3ri2
+s3a2c1t
+5sai2
+sa4l2a2r4
+s4a2l4m
+sa5lo
+sa4l4t
+3sanc
+sa2n
+san4de
+s4and
+s1ap
+sa5ta
+5sa3t2io
+sa2t3u
+sau4
+sa5vor
+5saw
+4s5b
+scan4t5
+s1ca
+sca2n
+sca4p
+scav5
+s4ced
+4s3cei2
+s4ces
+s2ch2
+s4cho2
+3s4c2ie4
+s1ci
+5sc4in4d
+s2cin
+scle5
+s1c4l4
+s4cli
+scof4
+s1co
+sco4ff
+sco2fi
+scofl2
+4scopy5
+scou1r5a
+scou2
+s1cu
+4s5d
+4se.
+se4a
+seas4
+sea5w
+se2c3o
+3se2c1t
+4s4ed
+se4d4e
+s5edl
+se2g
+se1g3r
+5sei2
+se1le
+5se2l2f
+5se2l4ff
+5se2l2fi
+5se2l2fl2
+5selv
+4se1me
+se4mol
+se1mo
+sen5at
+se1na
+4senc
+sen4d
+s5e2ned
+sen5g
+s5en1in
+4sen4t1d
+sen1t
+4sen2tl
+se2p3a3
+4s1er.
+s4er1l
+s2er4o
+4ser3vo
+s1e4s
+s4e5s2h
+ses5t
+5se5um
+s4eu
+5sev
+sev3en
+sew4i2
+5sex
+4s3f
+4s4ff
+4s3fi
+4s3fl2
+2s3g
+s2h
+2sh.
+sh1er
+5shev
+sh1in
+sh3io
+3sh2i4p
+sh2i2v5
+sho4
+sh5o2l2d
+sho2n3
+shor4
+short5
+4sh1w
+si1b
+s5ic3c
+3si2de.
+s2id
+5side4s2
+5si2di
+si5diz
+4sig1n4a
+s2ig
+sil4e
+4si1ly
+2s1in
+s2i1na
+5si2ne.
+s2ine
+s3ing
+1s2io
+5sio2n
+sio1n5a
+s4i2r
+si1r5a
+1sis
+3s2i1t2io
+si1ti
+5si1u
+1s2iv
+5siz
+sk2
+4ske
+s3ket
+sk5ine
+sk1i
+sk5in4g
+s1l2
+s3lat
+s2le
+sl2ith5
+sl1it
+2s1m
+s3ma
+smal1l3
+sma2n3
+smel4
+s5men
+5s4m2ith
+smo2l5d4
+s1mo
+s1n4
+1so
+so4ce
+so2ft3
+so4lab
+so1la
+so2l3d2
+so3lic
+sol2i
+5sol2v
+3som
+3s4on.
+so2n
+so1n1a4
+son4g
+s4op
+5soph1ic
+s2oph
+s5o3phiz
+s5o1phy
+sor5c
+sor5d
+4sov
+so5vi
+2s1pa
+5sp4ai2
+spa4n
+spen4d
+2s5peo
+2sper
+s2phe
+3sph4er
+spho5
+spil4
+sp5ing
+spi2n
+4s3p2i1o
+s4p1ly
+s1p2l2
+s4po2n
+s1p4or4
+4sp4ot
+squal4l
+squ2
+s1r
+2ss
+s1sa2
+ssas3
+s2s5c
+s3sel
+s5sen5g
+s4ses.
+ss1e4s
+s5set
+s1si
+s4s2ie4
+ssi4er
+s4s5i1ly
+s4s1l2
+ss4li
+s4s1n4
+sspen4d4
+ss2t
+ssu1r5a
+s1su
+ssu2r
+ss5w2
+2st.
+s2tag
+s1ta
+s2ta2l
+stam4i
+5st4and
+sta2n
+s4ta4p
+5stat.
+s4t1ed
+stern5i
+s5t2ero
+ste2w
+ste1w5a
+s3th2e
+st2i
+s4ti.
+s5t2i1a
+s1tic
+5s4tick1
+s4t2ie4
+s3tif2
+s3ti4ff
+s3ti1fi
+s3ti3fl2
+st3ing
+s2t1in
+5st4ir
+s1tle
+s2tl
+5stock1
+s1to
+sto2m3a
+5stone
+sto2n
+s4top
+3store
+st4r
+s4tra2d
+s1tra
+5stra2tu
+s4tray
+s4tr2id
+4stry
+4st3w4
+s2ty
+1su
+su1al
+su4b3
+su2g3
+su5is
+s2ui2
+suit3
+s4ul
+su2m
+su1m3i
+su2n
+su2r
+4sv
+sw2
+4s1wo2
+s4y
+4sy1c
+3syl
+syn5o
+sy5rin
+1ta
+3ta.
+2tab
+ta5bles2
+tab2l2
+5tab5o5l1iz
+tabol2i
+4t4a2ci
+ta5do
+ta2d
+4ta2f4
+4ta4ff4
+4ta2fi
+4ta2fl2
+tai5lo
+tai2
+ta2l
+ta5la
+tal5en
+t2ale
+tal3i
+4talk
+tal4lis
+tal1l
+tall2i
+ta5log
+ta5mo
+tan4de
+ta2n
+t4and
+1tan1ta3
+tan1t
+ta5per
+ta5p2l2
+tar4a
+t2a2r
+4tar1c
+4tare
+ta3r2iz
+tar1i
+tas4e
+ta5s4y
+4tat1ic
+ta4tur
+ta2tu
+taun4
+tav4
+2taw
+tax4is
+tax3i
+2t1b
+4tc
+t4ch
+tch5e4t
+tche2
+4t1d
+4te.
+te2ad4i
+tea2d1
+4tea2t
+te1ce4
+5te2c1t
+2t1ed
+t4e5di
+1tee
+teg4
+te5ger4
+te5gi
+3tel.
+tel2i4
+5te2l1s2
+te2ma2
+tem3at
+3ten2a2n
+te1na
+3tenc
+3tend
+4te1nes
+1ten1t
+ten4tag
+ten1ta
+1teo
+te4p
+te5pe
+ter3c
+5ter3d
+1ter1i
+ter5ies
+ter2ie4
+ter3is
+teri5za1
+5t4er3n2it
+ter5v
+4tes.
+4t2e2ss
+t3ess.
+teth5e
+3t4eu
+3tex
+4tey
+2t1f
+2t4ff
+2t1fi
+2t1fl2
+4t1g
+2th.
+tha2n4
+th2e
+4thea
+th3eas
+the5a2t
+the3is
+thei2
+3the4t
+th5ic.
+th5i1ca
+4th4il2
+5th4i4nk2
+4t4h1l4
+th5ode
+5thod3ic
+4thoo2
+thor5it
+tho5riz
+2t4h1s2
+1t2i1a
+ti4ab
+ti4a1to
+2ti2b
+4tick1
+t4i1co
+t4ic1u
+5ti2di
+t2id
+3tien
+t2ie4
+tif2
+ti4ff
+ti1fi
+ti3fl2
+ti5fy
+2t2ig
+5tigu
+til2l5in4
+til1l
+till2i
+1tim
+4ti4m1p
+tim5ul
+ti2mu
+2t1in
+t2i1na
+3ti2ne.
+t2ine
+3t2ini
+1t2io
+ti5oc
+tion5ee
+tio2n
+5tiq
+ti3sa2
+3t4ise
+ti2s4m
+ti5so
+tis4p
+5tisti1ca
+tis1t2i
+tis1tic
+ti3tl
+ti4u
+1t2iv
+ti1v4a
+1tiz
+ti3za1
+ti3ze4n
+ti2ze
+2tl
+t5la
+tla2n4
+3tle.
+3tled
+3tles.
+tles2
+t5let.
+t5lo
+4t1m
+tme4
+2t1n2
+1to
+to3b
+to5crat
+4to2do4
+2tof
+2to4ff
+2to2fi
+2tofl2
+to2gr
+to5ic
+toi2
+to2ma
+to4m4b
+to3my
+ton4a4l1i
+to2n
+to1n1a
+to3n2at
+4tono
+4tony
+to2ra
+to3r2ie4
+tor5iz
+tos2
+5tour
+tou2
+4tout
+to3w2a2r
+4t1p
+1tra
+t2ra3b
+tra5ch
+tr4a2ci4
+tra2c4it
+trac4te
+tra2c1t
+tr2as4
+tra5ven
+trav5e2s5
+tre5f
+tr1e5ff
+tre5fi
+tre5fl2
+tre4m
+trem5i
+5tr2i3a
+tri5ces
+tr4ice
+5tri3c2i1a
+t4r2i1ci
+4tri4c3s2
+2trim
+tr2i4v
+tro5m4i
+tron5i
+tro2n
+4trony
+tro5phe
+tr2oph
+tro3sp
+tro3v
+tr2u5i2
+tr2us4
+4t1s2
+t4sc
+ts2h4
+t4sw2
+4t3t2
+t4tes
+t5to
+t1tu4
+1tu
+tu1a
+tu3a2r
+tu4b4i
+tud2
+4tue
+4tuf4
+4tu4ff
+4tu1fi
+4tu3fl2
+5t2u3i2
+3tum
+tu4nis
+tu1ni
+2t3up.
+3ture
+5turi
+tur3is
+tur5o
+tu5ry
+3t2us
+4tv
+tw4
+4t1wa
+twis4
+twi2
+4t1wo2
+1ty
+4tya
+2tyl
+type3
+ty5ph
+4tz
+t2z4e
+4uab
+uac4
+ua5na
+ua2n
+uan4i
+uar5an1t
+u2a2r
+uara2n
+uar2d
+uar3i
+uar3t
+u1at
+uav4
+ub4e
+u4bel
+u3ber
+u4b2ero
+u1b4i
+u4b5ing
+u3b4le.
+ub2l2
+u3ca
+uci4b
+u1ci
+u2c4it
+ucle3
+u1c4l4
+u3cr
+u3cu
+u4cy
+ud5d4
+ud3er
+ud5est
+udes2
+ude1v4
+u1dic
+ud3ied
+ud2ie4
+ud3ies
+ud5is1
+u5dit
+u4do2n
+u1do
+ud4si
+u2d1s2
+u4du
+u4ene
+ue2n1s4
+uen4te
+uen1t
+uer4il
+uer1i
+3u1fa
+u3f4l2
+u3fl2
+ugh3e2n
+ug5in
+2ui2
+uil5iz
+uil1i
+ui4n
+u1ing
+uir4m
+u4ir
+ui1ta4
+u2iv3
+ui4v4er.
+u5j
+4uk
+u1la
+ula5b
+u5lati
+ul2ch4
+u4l1c2
+5ulche2
+ul3der
+u2ld
+ul2de
+ul4e
+u1len
+ul4gi
+u4l1g4
+ul2i
+u5l2i1a
+ul3ing
+ul5is2h
+ul4l2a2r
+ul1l
+ul4li4b
+ull2i
+ul4lis
+4u2l3m
+u1l4o
+4u2l1s2
+uls5e4s
+ul2se
+ul1ti
+u4lt
+ul1tra3
+ul1tr
+4ul1tu2
+u3lu
+ul5ul
+ul5v
+u2m5ab
+u1ma
+um4bi
+u4m1b
+um4b1ly
+umb2l2
+u1mi
+u4m3ing
+umor5o
+u1mo
+umo2r
+u4m2p
+un2at4
+u1na
+u2ne
+un4er
+u1ni
+un4im
+u2n1in
+un5is2h
+un2i3v
+u2n3s4
+un4sw2
+un2t3a4b
+un1t
+un1ta
+un4ter.
+un4tes
+unu4
+un5y
+u4n5z
+u4o4rs2
+u5os
+u1ou2
+u1pe
+upe4r5s2
+u5p2i3a
+up3ing
+upi2n
+u3p2l2
+u4p3p
+upport5
+up1p4or
+up2t5i2b
+u2p1t
+up1tu4
+u1ra
+4ura.
+u4rag
+u4r2as
+ur4be
+ur1b
+ur1c4
+ur1d
+ure5a2t
+ur4fer1
+ur1f
+ur4fr
+u3rif
+u3ri4ff
+u3ri1fi
+u3ri3fl2
+uri4fic
+uri1fi
+uri4fic
+ur1in
+u3r2i1o
+u1rit
+ur3iz
+ur2l
+url5ing.
+ur4no4
+uros4
+ur4pe
+ur1p
+ur4pi
+urs5er
+u4rs2
+ur2se
+ur5tes
+ur3th2e
+ur1ti4
+ur4t2ie4
+u3ru
+2us
+u5sa2d
+usa2
+u5sa2n
+us4ap
+usc2
+us3ci
+use5a
+u5s2i1a
+u3sic
+us4lin
+us1l2
+us1p
+us5s1l2
+u2ss
+us5tere
+us1t4r
+u2su
+usu2r4
+u2ta4b
+u1ta
+u3tat
+4u4te.
+4utel
+4uten
+uten4i
+4u1t2i
+uti5l2iz
+util1i
+u3t2ine
+u2t1in
+ut3ing
+utio1n5a
+u1t2io
+utio2n
+u4tis
+5u5tiz
+u4t1l
+u2t5of
+u1to
+u2t5o4ff
+u2t5o2fi
+u2t5ofl2
+uto5g
+uto5mat1ic
+uto2ma
+u5to2n
+u4tou2
+u4t1s4
+u3u
+uu4m
+u1v2
+ux1u3
+u2z4e
+1va
+5va.
+2v1a4b
+vac5il
+v4a2ci
+vac3u
+vag4
+va4ge
+va5l2i4e4
+val1i
+val5o
+val1u
+va5mo
+va5niz
+va2n
+va5pi
+var5ied
+v2a2r
+var1i
+var2ie4
+3vat
+4ve.
+4ved
+veg3
+v3el.
+vel3l2i
+vel1l
+ve4lo
+v4e1ly
+ven3om
+v4eno
+v5enue
+v4erd
+5v2e2re.
+v4erel
+v3eren
+ver5enc
+v4eres
+ver3ie4
+ver1i
+vermi4n
+ver3m4
+3ver2se
+ve4r1s2
+ver3th
+v4e2s
+4ves.
+ves4te
+ve4te
+vet3er
+ve4ty
+vi5al1i
+v2i1a
+vi2al
+5vi2a2n
+5vi2de.
+v2id
+5vi2d1ed
+4v3i1den
+5vide4s2
+5vi2di
+v3if
+v3i4ff
+v3i1fi
+v3i3fl2
+vi5gn
+v2ig
+v4ik4
+2vil
+5v2il1it
+vil1i
+v3i3l2iz
+v1in
+4vi4na
+v2inc
+v4in5d
+4ving
+vi1o3l
+v2io
+v3io4r
+vi1ou2
+v2i4p
+vi5ro
+v4ir
+vis3it
+vi3so
+vi3su
+4vi1ti
+vit3r
+4vi1ty
+3v2iv
+5vo.
+voi4
+3v2ok
+vo4la
+v5ole
+5vo4l2t
+3vol2v
+vom5i
+vo2r5ab
+vo1ra
+vori4
+vo4ry
+vo4ta
+4vo1tee
+4vv4
+v4y
+w5ab2l2
+2wac
+wa5ger
+wa2g5o
+wait5
+wai2
+w5al.
+wam4
+war4t
+w2a2r
+was4t
+wa1te
+wa5ver
+w1b
+wea5r2ie4
+we2a2r
+wear1i
+we4ath3
+wea2t
+we4d4n4
+weet3
+wee5v
+wel4l
+w1er
+west3
+w3ev
+whi4
+wi2
+wil2
+wil2l5in4
+wil1l
+will2i
+win4de
+w4ind
+win4g
+w4ir4
+3w4ise
+w2ith3
+wiz5
+w4k
+wl4es2
+wl3in
+w4no
+1wo2
+wom1
+wo5v4en
+w5p
+wra4
+wri4
+wri1ta4
+w3s2h
+ws4l2
+ws4pe
+w5s4t
+4wt
+wy4
+x1a
+xac5e
+x4a2go
+xam3
+x4ap
+xas5
+x3c2
+x1e
+xe4cu1to
+xe1cu
+xe3c4ut
+x2ed
+xer4i
+x2e5ro
+x1h
+xhi2
+xh4il5
+xhu4
+x3i
+x2i5a
+xi5c
+xi5di
+x2id
+x4ime
+xi5m2iz
+xim1i
+x3o
+x4ob
+x3p
+xp4an4d
+x1pa
+xpa2n
+xpec1to5
+xpe2c
+xpe2c1t
+x2p2e3d
+x1t2
+x3ti
+x1u
+xu3a
+xx4
+y5ac
+3y2a2r4
+y5at
+y1b
+y1c
+y2ce
+yc5er
+y3ch
+ych4e2
+ycom4
+y1co
+ycot4
+y1d
+y5ee
+y1er
+y4er1f
+y4er4ff
+y4er1fi
+y4er1fl2
+yes4
+ye4t
+y5gi
+4y3h
+y1i
+y3la
+ylla5b2l2
+yl1l
+y3lo
+y5lu
+ymbol5
+y4m1b
+yme4
+ym1pa3
+y4m1p
+yn3c4hr4
+yn2ch
+yn5d
+yn5g
+yn5ic
+5ynx
+y1o4
+yo5d
+y4o5g
+yom4
+yo5net
+yo2n
+y4o2n3s2
+y4os
+y4p2ed
+yper5
+yp3i
+y3po
+y4po4c
+yp2ta
+y2p1t
+y5pu
+yra5m
+yr5i3a
+y3ro
+yr4r4
+ys4c
+y3s2e
+ys3i1ca
+y1s3io
+3y1sis
+y4so
+y2ss4
+ys1t
+ys3ta
+ysu2r4
+y1su
+y3thin
+yt3ic
+y1w
+za1
+z5a2b
+z2a2r2
+4zb
+2ze
+ze4n
+ze4p
+z1er
+z2e3ro
+zet4
+2z1i
+z4il
+z4is
+5zl
+4zm
+1zo
+zo4m
+zo5ol
+zoo2
+zte4
+4z1z2
+z4zy
+.as9s8o9c8i8a8te.
+.as1so
+.asso1ci
+.asso3c2i1a
+.as9s8o9c8i8a8t8es.
+.de8c9l8i9n8a9t8i8on.
+.de1c4l4
+.decl4i1na
+.declin2at
+.declina1t2io
+.declinatio2n
+.ob8l8i8g9a9t8o8ry.
+.ob2l2
+.obl2ig
+.obli1ga
+.obliga1to
+.obligato1ry
+.ph8i8l9a8n9t8h8r8o8p8ic.
+.ph4il2
+.phi1la
+.phila2n
+.philan1t
+.philant4hr4
+.philanthrop3ic
+.pr8e8s8e8nt.
+.p3re1s2e
+.presen1t
+.pr8e8s8e8n8ts.
+.presen4t4s2
+.pr8o8j8e8ct.
+.pro5j
+.pro1je
+.proje2c1t
+.pr8o8j8e8c8ts.
+.projec4t1s2
+.re8c9i9p8r8o8c9i9t8y.
+.re1c2i
+.rec2ip
+.recipr2
+.recipr2oc
+.re1cipro1ci
+.recipro2c1it
+.reciproci1ty
+.re9c8o8g9n8i9z8a8n8ce.
+.re1co
+.re2cog
+.rec3ogniz
+.recog1ni
+.recogniza1
+.recogniza2n
+.re8f9o8r9m8a9t8i8on.
+.re1f
+.re1fo
+.refo2r
+.refor1m
+.refor1ma
+.reforma1t2io
+.reformatio2n
+.re8t9r8i9b8u9t8i8on.
+.re3tri
+.retr4ib
+.retri3bu1t2io
+.retrib4u1t2i
+.retributio2n
+.ta9b8le.
+.2tab
+.tab2l2
+.ac8a8d9e9m8y.
+.a1ca
+.aca2d
+.acad4em
+.acade3my
+.ac8a8d9e9m8i8e8s.
+.academ2i4e4
+.ac9c8u9s8a9t8i8v8e.
+.ac3c
+.ac1c2us
+.accusa2
+.accusa1t2iv
+.ac8r8o9n8y8m.
+.acro2n
+.acronym4
+.ac8r8y8l9a8m8i8d8e.
+.acry3la
+.acrylam2id
+.ac8r8y8l9a8m8i8d8e8s.
+.acrylamide4s2
+.ac8r8y8l9a8l8d8e9h8y8d8e.
+.acryla2ld
+.acrylal2de
+.acrylalde1h4
+.acrylaldehy1d
+.ad8d9a9b8l8e.
+.ad1d2a
+.ad2d3a4b
+.addab2l2
+.ad8d9i9b8l8e.
+.addi1b2l2
+.ad8r8e8n9a9l8i8n8e.
+.a1dr
+.adre4
+.a5dren
+.adre1na
+.adrena4l1i
+.adrena1l4ine
+.ae8r8o9s8p8a8c8e.
+.ae4r
+.a2ero
+.aero2s4pa
+.aerospa4ce
+.af9t8e8r9t8h8o8u8g8h8t.
+.afterthou2
+.af9t8e8r9t8h8o8u8g8h8t8s.
+.afterthough4t1s2
+.ag8r8o8n9o9m8i8s8t.
+.a1gr
+.ag4ro
+.agro2n
+.agronom2is
+.ag8r8o8n9o9m8i8s8t8s.
+.agronomis4t1s2
+.al9g8e9b8r8a9i9c8a8l9l8y.
+.a4l1g4
+.alg2e1b
+.alge3br
+.algebr2ai2
+.algebrai1ca
+.algebraical1l
+.algebraical1ly
+.am9p8h8e8t9a9m8i8n8e.
+.a4m1p
+.amphe4t
+.amphe1ta
+.amphetam1in
+.amphetam2ine
+.am9p8h8e8t9a9m8i8n8e8s.
+.amphetami1nes
+.an9a9l8y8s8e.
+.3ana1ly
+.a1na
+.an4a2lys4
+.anal5y3s2e
+.an9a9l8y8s8e8d.
+.analy4s4ed
+.an8a8l8y9s8e8s.
+.analys1e4s
+.an9i8s8o9t8r8o8p9i8c.
+.ani2so
+.anisotrop3ic
+.an9i8s8o9t8r8o8p9i9c8a8l9l8y.
+.anisotropi1ca
+.anisotropical1l
+.anisotropical1ly
+.an9i8s8o8t9r8o9p8i8s8m.
+.anisotropi2s1m
+.an9i8s8o8t9r8o8p8y.
+.anisotropy5
+.an8o8m9a8l8y.
+.ano4
+.anoma5l
+.ano1ma
+.anoma1ly
+.an8o8m9a8l8i8e8s.
+.anomal1i
+.anomal2i4e4
+.an8t8i9d8e8r8i8v9a9t8i8v8e.
+.ant2id
+.antider1i
+.antider2i4v
+.antide4ri1va
+.antideri3vat
+.antider2iva1t2iv
+.an8t8i9d8e8r8i8v9a9t8i8v8e8s.
+.antiderivativ4e2s
+.an8t8i9h8o8l8o9m8o8r9p8h8i8c.
+.anti3h
+.antiholo1mo
+.antiholomo2r
+.antiholomor1p
+.antiholomorp4h4
+.antiholomorph1ic
+.an9t8i8n9o9m8y.
+.an2t1in
+.ant2i1no
+.antino3my
+.an9t8i8n9o9m8i8e8s.
+.antinom2ie4
+.an9t8i9n8u9c8l8e8a8r.
+.antin1u
+.antinucle3
+.antinu1c4l4
+.antinucle2a
+.antinucle2a2r
+.an9t8i9n8u9c8l8e9o8n.
+.antinucleo2n
+.an9t8i9r8e8v9o9l8u9t8i8o8n9a8r8y.
+.ant4ir
+.antirev2
+.antirev5olu
+.antirevo1lut
+.antirevol4u1t2i
+.antirevolutio1n5a
+.antirevolu1t2io
+.antirevolutio2n
+.antirevolution2a2r
+.ap8o8t8h9e9o9s8e8s.
+.ap4ot
+.ap4oth
+.apoth2e
+.apotheos4
+.apotheos1e4s
+.ap8o8t8h9e9o9s8i8s.
+.apotheo1sis
+.ap9p8e8n9d8i8x.
+.a4p1p
+.ap2pe
+.ap3pen
+.ar9c8h8i9m8e9d8e8a8n.
+.ar1c
+.ar2ch
+.archi2med
+.archimedea2n
+.ar9c8h8i9p8e8l9a8g8o.
+.arch2i4p
+.archipe4
+.archipe4la
+.archipela2go
+.ar9c8h8i9p8e8l9a9g8o8s.
+.ar9c8h8i8v8e.
+.arch2i2v
+.ar9c8h8i8v8e8s.
+.archiv4e2s
+.ar9c8h8i8v9i8n8g.
+.archiv1in
+.archi4ving
+.ar9c8h8i8v9i8s8t.
+.ar9c8h8i8v9i8s8t8s.
+.archivis4t1s2
+.ar9c8h8e9t8y8p9a8l.
+.arche2
+.arche4t
+.arche1ty
+.archety1pa
+.archetyp4al
+.ar9c8h8e9t8y8p9i9c8a8l.
+.archetyp3i
+.archetypi1ca
+.ar8c9t8a8n9g8e8n8t.
+.ar2c1t
+.arct5ang
+.arc1ta
+.arcta2n
+.arctan1gen
+.arctangen1t
+.ar8c9t8a8n9g8e8n8t8s.
+.arctangen4t4s2
+.as9s8i8g8n9a9b8l8e.
+.as1si
+.as4sig1n4a
+.ass2ig
+.assig2n1a2b
+.assignab2l2
+.as9s8i8g8n9o8r.
+.assig1no
+.as9s8i8g8n9o8r8s.
+.assigno4rs2
+.as9s8i8s8t9a8n8t9s8h8i8p.
+.as1sis
+.assis1ta
+.assista2n
+.assistan1t
+.assistan4t4s2
+.assistants2h4
+.assistant3sh2i4p
+.as9s8i8s8t9a8n8t9s8h8i8p8s.
+.assistantshi2p1s2
+.as8y8m8p9t8o9m8a8t8i8c.
+.as4y
+.asy4m1p
+.asym2p1t
+.asymp1to
+.asympto2ma
+.asymptomat1ic
+.as9y8m8p9t8o8t9i8c.
+.as8y8n9c8h8r8o9n8o8u8s.
+.asyn3c4hr4
+.asyn2ch
+.asynchro2n
+.asynchro1nou2
+.asynchrono2us
+.at8h9e8r9o9s8c8l8e9r8o9s8i8s.
+.4ath
+.ath2e
+.ath2ero
+.atheros2c
+.atheroscle5
+.atheros1c4l4
+.ath2eroscl4ero
+.atherosclero1sis
+.at9m8o8s9p8h8e8r8e.
+.a4t1m
+.at1mo
+.atmos2
+.atmo3sp
+.atmos2phe
+.atmo3sph4er
+.at9m8o8s9p8h8e8r8e8s.
+.at9t8r8i8b9u8t8e8d.
+.a4t3t2
+.attr4ib
+.attribu2t1ed
+.at9t8r8i8b9u8t9a8b8l8e.
+.attri4bu1ta
+.attribu2ta4b
+.attributab2l2
+.au9t8o9m8a9t8i8o8n.
+.au1to
+.auto2ma
+.automa1t2io
+.automatio2n
+.au9t8o8m9a9t8o8n.
+.au1toma1to
+.automato2n
+.au9t8o8m9a9t8a.
+.automa2ta
+.au9t8o9n8u8m9b8e8r9i8n8g.
+.au5to2n
+.auton5um
+.autonu4m1b
+.autonumber1i
+.autonumberin4g
+.au9t8o8n9o9m8o8u8s.
+.au4tono
+.autono4mo
+.autono3mo2us
+.autonomou2
+.au8t8o9r8o8u8n8d9i8n8g.
+.autorou2
+.autoroun2d
+.autoround1in
+.av9o8i8r9d8u9p8o8i8s.
+.avoi4
+.avo4ir
+.avoir1du
+.avoir4dup
+.avoi2rdupoi2
+.ba8n8d9l8e8a8d8e8r.
+.b4and
+.ban1dl
+.bandle2a
+.bandlea2d1
+.ba8n8d9l8e8a8d8e8r8s.
+.bandleade4r5s2
+.ba8n8k9r8u8p8t.
+.ba4nk2
+.bankru2p1t
+.ba8n8k9r8u8p8t9c8y.
+.bankrup4tc
+.bankrupt1cy
+.ba8n8k9r8u8p8t9c8i8e8s.
+.bankrupt1ci
+.bankruptc2ie4
+.ba8r9o8n8i8e8s.
+.b2a2r
+.ba5roni
+.baro2n
+.baron2ie4
+.ba8s8e9l8i8n8e9s8k8i8p.
+.basel2i
+.base1l4ine
+.baseli1nes
+.baselinesk2
+.baselinesk1i
+.baselinesk2i4p
+.ba9t8h8y8m9e9t8r8y.
+.1bat
+.b4ath
+.bathyme4
+.bathym4etr
+.bathyme3try
+.ba8t8h8y9s8c8a8p8h8e.
+.bathy2s
+.bathys4c
+.bathysca4p
+.bathys1ca
+.be8a8n9i8e8s.
+.bea2n
+.bea3nies
+.bean2ie4
+.be9h8a8v9i8o8u8r.
+.be1h4
+.behav1i
+.behavi1ou2
+.behav2io
+.behavi4our
+.be9h8a8v9i8o8u8r8s.
+.behaviou4rs2
+.be8v8i8e8s.
+.be1vi
+.bev2ie4
+.bi8b9l8i9o8g9r8a9p8h8y9s8t8y8l8e.
+.bi2b
+.bi1b2l2
+.bib3li
+.bibli5og
+.bibl2io
+.biblio2gr
+.biblio4g3ra1phy
+.bibliography2s
+.bibliographys1t
+.bibliographys2ty
+.bibliographys2tyl
+.bi9d8i8f9f8e8r9e8n9t8i8a8l.
+.b2i4d
+.bi2di
+.bid1if
+.bidi4f1f
+.bidiffer1
+.bidiffer3en1t
+.bidifferent2i
+.bidifferen1t2i1a
+.bidifferenti2al
+.bi9d8i8ff8e8r9e8n9t8i8a8l.
+.bid1i4ff
+.bidiffer1
+.bidiffer3en1t
+.bidifferent2i
+.bidifferen1t2i1a
+.bidifferenti2al
+.bi8g9g8e8s8t.
+.b2ig
+.bi4g1g2
+.big2ge
+.bi8l8l9a8b8l8e.
+.1bil
+.bill5ab
+.bil1l
+.billab2l2
+.bi8o9m8a8t8h9e9m8a8t9i8c8s.
+.b2io
+.bio4m
+.bio1ma
+.biom4ath3
+.biomath5em
+.biomath2e
+.bio1mathe1ma
+.biomathemat1ic
+.biomathemati4c3s2
+.bi8o9m8e8d9i9c8a8l.
+.bio2me
+.bio2med
+.biom4edi
+.biomed3i1ca
+.bi8o9m8e8d9i9c8i8n8e.
+.biomed2i1ci
+.biomedi2cin
+.biomedic2ine
+.bi8o9r8h8y8t8h8m8s.
+.biorh4
+.biorhyt4h1m
+.biorhyth4m1s2
+.bi8t9m8a8p.
+.bi2t
+.bi4t1m
+.bit1ma
+.bit4map
+.bi8t9m8a8p8s.
+.bitma2p1s2
+.bl8a8n8d9e8r.
+.b2l2
+.b3l4and
+.bla2n
+.blan1de
+.bl8a8n8d9e8s8t.
+.blande4s2
+.bl8i8n8d9e8r.
+.bl4ind
+.blin1de
+.bl8o8n8d8e8s.
+.b4lo
+.blo2n
+.bl2ond
+.blon1de
+.blondes2
+.bl8u8e9p8r8i8n8t.
+.bluepr2
+.blueprin4t3
+.bl8u8e9p8r8i8n8t8s.
+.blueprin4t4s2
+.bo9l8o8m9e9t8e8r.
+.bolo2me
+.bolo4met
+.bolome1te
+.bo8o8k9s8e8l8l9e8r.
+.3boo2
+.bo2o4k
+.boo4k1s2
+.booksel1l
+.booksel2le
+.bo8o8k9s8e8l8l9e8r8s.
+.bookselle4r1s2
+.bo8o8l9e8a8n.
+.boole2a
+.boolea2n
+.bo8o8l9e8a8n8s.
+.boolea2n1s2
+.bo8r9n8o9l8o8g9i9c8a8l.
+.borno4
+.borno3log1ic
+.bornologi1ca
+.bo8t9u9l8i8s8m.
+.bo1tu
+.botul2i
+.botuli2s1m
+.br8u8s8q8u8e8r.
+.br2us
+.brusqu2
+.brus3quer
+.bu8f9f8e8r.
+.buf4fer1
+.bu4f1f
+.bu8ff8e8r.
+.buffer1
+.bu4ff
+.bu8f9f8e8r8s.
+.buffe4r1s2
+.bu8ff8e8r8s.
+.buffe4r1s2
+.bu8s8i8e8r.
+.bus5ie4
+.b2us
+.bu8s8i8e8s8t.
+.busi1est
+.bu8s8s8i8n8g.
+.bu2ss
+.bus1si
+.bus2s1in
+.buss3ing
+.bu8t8t8e8d.
+.but2t1ed
+.bu8z8z9w8o8r8d.
+.bu4z1z2
+.buzz1wo2
+.bu8z8z9w8o8r8d8s.
+.buzzwor2d1s2
+.ca9c8o8p8h9o9n8y.
+.ca1co
+.cac2oph
+.cacopho5ny
+.cacopho2n
+.ca9c8o8p8h9o9n8i8e8s.
+.caco5phoni
+.cacophon2ie4
+.ca8l8l9e8r.
+.cal1l
+.cal2le
+.ca8l8l9e8r8s.
+.calle4r1s2
+.ca8m9e8r8a9m8e8n.
+.cam5er1a
+.camera1men
+.ca8r8t9w8h8e8e8l.
+.cartw4
+.ca8r8t9w8h8e8e8l8s.
+.cartwhee2l1s2
+.ca9t8a8r8r8h8s.
+.ca2ta
+.cat2a2r
+.catar1r4
+.catarrh4
+.catarr4h1s2
+.ca8t9a9s8t8r8o8p8h9i8c.
+.catas1t4r
+.catastr2oph
+.catastroph1ic
+.ca8t9a9s8t8r8o8p8h9i9c8a8l8l8y.
+.1catastrophi1ca
+.catastrophical1l
+.catastrophical1ly
+.ca8t9e9n8o8i8d.
+.cat4eno
+.catenoi2
+.cateno2id
+.ca8t9e9n8o8i8d8s.
+.catenoi2d1s2
+.ca8u9l8i9f8l8o8w9e8r.
+.cau4l2
+.caul2i
+.cauli4f4l2
+.cauliflow1er
+.ca8u9l8i9fl8o8w9e8r.
+.cauli4fl2
+.cauliflow1er
+.ch8a8p9a8r9r8a8l.
+.chap2a2r4
+.cha1pa
+.chapar1r4
+.ch8a8r9t8r8e8u8s8e.
+.ch2a2r
+.chartr4eu2
+.chartre2us4
+.ch8e8m8o9t8h8e8r9a8p8y.
+.che2
+.che1mo
+.chem4oth3
+.chemoth2e
+.chemoth4er1a
+.chemothera3p
+.ch8e8m8o9t8h8e8r9a9p8i8e8s.
+.chemotherap2ie4
+.ch8l8o8r8o9m8e8t8h9a8n8e.
+.c4h1l4
+.ch2lo
+.chloro2me
+.chloro4met
+.chlorometha2n4
+.ch8l8o8r8o9m8e8t8h9a8n8e8s.
+.chlorometha1nes
+.ch8o9l8e8s9t8e8r8i8c.
+.3cho2
+.c3hol4e
+.choles2
+.choles1ter1i
+.ci8g9a9r8e8t8t8e.
+.c2ig
+.ci1ga
+.cig2a2r
+.cigare4t3t2
+.ci8g9a9r8e8t8t8e8s.
+.cigaret4tes
+.ci8n8q8u8e9f8o8i8l.
+.2cin
+.cin1q
+.cinqu2
+.cinque1f
+.cinque1fo
+.cinquefoi2
+.co9a8s8s8o9c8i8a9t8i8v8e.
+.c4oa
+.coa2ss
+.coas1so
+.coasso1ci
+.coasso3c2i1a
+.coassoci4a1t2iv
+.co9g8n8a8c.
+.2cog
+.cog1n4a
+.co9g8n8a8c8s.
+.cogna4c3s2
+.co9k8e8r9n8e8l.
+.c2ok
+.cok1er
+.coker3nel
+.co9k8e8r9n8e8l8s.
+.cokerne2l1s2
+.co8l9l8i8n9e8a9t8i8o8n.
+.col1l
+.coll2i
+.col2lin4
+.col1l4ine
+.collin3ea
+.collinea2t
+.collinea1t2io
+.collineatio2n
+.co8l9u8m8n8s.
+.colu4m1n
+.colum2n1s2
+.co8m9p8a8r9a8n8d.
+.co4m1p
+.compara5
+.com1pa
+.comp2a2r
+.compara2n
+.compar4and
+.co8m9p8a8r9a8n8d8s.
+.comparan2d1s2
+.co8m9p8e8n9d8i8u8m.
+.compendi1u
+.co8m9p8o9n8e8n8t9w8i8s8e.
+.compo2n
+.compo3nen
+.componen1t
+.componentw4
+.componentwis4
+.componentwi2
+.component3w4ise
+.co8m8p9t8r8o8l9l8e8r.
+.comp4tr
+.com2p1t
+.comptrol1l
+.comptrol2le
+.co8m8p9t8r8o8l9l8e8r8s.
+.comptrolle4r1s2
+.co8n9f8o8r8m9a8b8l8e.
+.co2n
+.con3f
+.con1fo
+.confo2r
+.confor1m
+.confor1ma
+.confor2mab
+.conformab2l2
+.co8n9f8o8r8m9i8s8t.
+.confor2mi
+.conform2is
+.co8n9f8o8r8m9i8s8t8s.
+.conformis4t1s2
+.co8n9f8o8r8m9i8t8y.
+.confor3mit
+.conformi1ty
+.co8n9g8r8e8s8s.
+.con3g
+.con1gr
+.congr2e2ss
+.co8n9g8r8e8s8s8e8s.
+.congress1e4s
+.co8n9t8r8i8b9u8t8e.
+.con5t
+.contr4ib
+.co8n9t8r8i8b9u8t8e8s.
+.co8n9t8r8i8b9u8t8e8d.
+.contribu2t1ed
+.co9r8e9l8a9t8i8o8n.
+.core1la
+.corela1t2io
+.corelatio2n
+.co9r8e9l8a9t8i8o8n8s.
+.corelatio2n3s2
+.co9r8e9l8i9g8i8o8n9i8s8t.
+.core1l2i
+.corel2ig
+.corel4igi
+.coreli5g2io
+.coreligion3i
+.coreligio2n
+.coreligion1is
+.co9r8e9l8i9g8i8o8n9i8s8t8s.
+.coreligionis4t1s2
+.co9r8e9o8p9s8i8s.
+.core1o
+.coreo2p1s2
+.coreop1sis
+.co9r8e9s8p8o8n9d8e8n8t.
+.core1sp
+.cores4po2n
+.coresp2ond
+.corespon1de
+.corespon1den
+.coresponden1t
+.co9r8e9s8p8o8n9d8e8n8t8s.
+.coresponden4t4s2
+.co9s8e9c8a8n8t.
+.cos4e
+.cose1ca
+.coseca2n
+.cosecan1t
+.co9t8a8n9g8e8n8t.
+.co4ta2n
+.co1ta
+.cot2ang
+.cotan1gen
+.cotangen1t
+.co8u8r9s8e8s.
+.cou2
+.cou4rs2
+.cour2se
+.cours3e4s
+.co9w8o8r8k9e8r.
+.co4wo2
+.cowork1er
+.co9w8o8r8k9e8r8s.
+.coworke4r1s2
+.cr8a8n8k9c8a8s8e.
+.cra2n
+.cra4nk2
+.crank1ca
+.cr8a8n8k9s8h8a8f8t.
+.cran4k1s2
+.cranks2h
+.cranksha2f
+.cranksha2ft
+.cr8o8c9o9d8i8l8e.
+.cr2oc
+.cro4cod
+.cro1co
+.cr8o8c9o9d8i8l8e8s.
+.crocodiles2
+.cr8o8s8s9h8a8t8c8h.
+.cro2s4s
+.cross2h
+.crossha4tc
+.crosshat4ch
+.cr8o8s8s9h8a8t8c8h8e8d.
+.crosshatche2
+.crosshat4ch4ed
+.cr8o8s8s9o8v8e8r.
+.cros1so
+.cros4sov
+.cr8y8p9t8o9g8r8a8m.
+.cry2p1t
+.cryp1to
+.crypto2gr
+.cr8y8p9t8o9g8r8a8m8s.
+.cryptogra4m1s2
+.cu8f8f9l8i8n8k.
+.c4uf
+.cu4f1f
+.cuff4l2
+.cufflin4
+.cuffl4i4nk2
+.cu8ffl8i8n8k.
+.cuffl4i4nk2
+.cu8f8f9l8i8n8k8s.
+.cufflin4k1s2
+.cu8ffl8i8n8k8s.
+.cufflin4k1s2
+.cu9n8e8i9f8o8r8m.
+.3cun
+.cu2ne
+.cunei2
+.cunei1fo
+.cuneifo2r
+.cuneifor1m
+.cu8s9t8o8m9i8z9a9b8l8e.
+.1c2us
+.cus1to
+.custom2iz
+.customiza1
+.customiz5a2b
+.customizab2l2
+.cu8s9t8o8m9i8z8e.
+.customi2ze
+.cu8s9t8o8m9i8z8e8s.
+.cu8s9t8o8m9i8z8e8d.
+.da8c8h8s9h8u8n8d.
+.1d2a
+.da2ch4
+.dac4h1s2
+.dach4s2h
+.da8m9s8e8l9f8l8y.
+.da2m2
+.da4m1s2
+.dam5se2l2f
+.damself4l2
+.damself2ly5
+.da8m9s8e8l9fl8y.
+.dam5se2l2fl2
+.damselfly
+.da8m9s8e8l9f8l8i8e8s.
+.damselfl2ie4
+.da8m9s8e8l9fl8i8e8s.
+.damselfl2ie4
+.da8c8t8y8l9o9g8r8a8m.
+.da2c1t
+.dac1ty
+.dac2tyl
+.dacty3lo
+.dactylo1gr
+.da8c8t8y8l9o9g8r8a8p8h.
+.da8t8a9b8a8s8e.
+.3dat
+.da2ta
+.da2tab
+.da8t8a9b8a8s8e8s.
+.databas1e4s
+.da8t8a9p8a8t8h.
+.dat5ap
+.datap5at
+.data1pa
+.datap4ath
+.da8t8a9p8a8t8h8s.
+.datapa2t4h1s2
+.da8t8e9s8t8a8m8p.
+.dat3est
+.dates1ta
+.datesta4m1p
+.da8t8e9s8t8a8m8p8s.
+.datestam2p1s2
+.de9c8l8a8r9a8b8l8e.
+.de4cl2a2r
+.decla2rab
+.declarab2l2
+.de9f8i8n9i9t8i8v8e.
+.de1f
+.de1fi
+.de2fin
+.def2ini
+.defin2it
+.defini1ti
+.defini1t2iv
+.de9fi8n9i9t8i8v8e.
+.de1fi
+.de2fin
+.defini
+.defin2it
+.defini1ti
+.defini1t2iv
+.de9l8e8c9t8a9b8l8e.
+.d5elec
+.dele2c1t
+.delec2ta4b
+.delec1ta
+.delectab2l2
+.de8m8i9s8e8m8i9q8u8a9v8e8r.
+.de4m2is
+.dem4ise
+.demisemi3qua
+.demisemiqu2
+.demisemiqua5v4
+.de8m8i9s8e8m8i9q8u8a9v8e8r8s.
+.demisemiquave4r1s2
+.de9m8o8c9r8a9t8i8s8m.
+.de4mocr
+.democrati2s4m
+.de8m8o8s.
+.demos2
+.de9r8i8v9a9t8i8v8e.
+.der2i4v
+.de4ri1va
+.deri3vat
+.der2iva1t2iv
+.de9r8i8v9a9t8i8v8e8s.
+.derivativ4e2s
+.di8a9l8e8c9t8i8c.
+.1d4i3a
+.di2al
+.di2ale
+.diale2c1t
+.di8a9l8e8c9t8i8c8s.
+.dialecti4c3s2
+.di8a9l8e8c9t8i9c8i8a8n.
+.dialect2i1ci
+.d2i1alecti3c2i1a
+.dialectici2a2n
+.di8a9l8e8c9t8i9c8i8a8n8s.
+.dialecticia2n1s2
+.di9c8h8l8o8r8o9m8e8t8h9a8n8e.
+.d4i2ch
+.dic4h1l4
+.dich2lo
+.dichloro2me
+.dichloro4met
+.dichlorometha2n4
+.di8f9f8r8a8c8t.
+.d1if
+.dif4fr
+.di4f1f
+.diffra2c1t
+.di8ff8r8a8c8t.
+.d1i4ff
+.diffr
+.diffra2c1t
+.di8f9f8r8a8c8t8s.
+.diffrac4t1s2
+.di8ff8r8a8c8t8s.
+.diffrac4t1s2
+.di8f9f8r8a8c9t8i8o8n.
+.diffrac1t2io
+.diffractio2n
+.di8ff8r8a8c9t8i8o8n.
+.diffrac1t2io
+.diffractio2n
+.di8f9f8r8a8c9t8i8o8n8s.
+.diffractio2n3s2
+.di8ff8r8a8c9t8i8o8n8s.
+.diffractio2n3s2
+.di8r8e8r.
+.d4ir2
+.di1re
+.dir1er4
+.di8r8e9n8e8s8s.
+.dire1nes
+.diren2e2ss
+.di8s9p8a8r9a8n8d.
+.dis1
+.dis1p
+.di2s1pa
+.disp2a2r
+.dispara2n
+.dispar4and
+.di8s9p8a8r9a8n8d8s.
+.disparan2d1s2
+.di8s9t8r8a8u8g8h8t9l8y.
+.d4is3t
+.dist4r
+.dis1tra
+.distraugh3
+.distraugh2tl
+.distraught1ly
+.di8s9t8r8i8b9u8t8e.
+.distr4ib
+.di8s9t8r8i8b9u8t8e8s.
+.di8s9t8r8i8b9u8t8e8d.
+.distribu2t1ed
+.do8u9b8l8e9s8p8a8c8e.
+.dou2
+.dou3b2l2
+.dou5ble1sp
+.doubles2
+.double2s1pa
+.doublespa4ce
+.do8u9b8l8e9s8p8a8c9i8n8g.
+.doublesp4a2ci
+.doublespa2c1in
+.doublespac1ing
+.do8l8l9i8s8h.
+.dol1l
+.doll2i
+.dollis2h
+.dr8i8f8t9a8g8e.
+.1dr
+.dr4i2ft
+.drif1ta
+.dr8i8v9e8r8s.
+.dr2iv
+.drive4r1s2
+.dr8o8m9e9d8a8r8y.
+.dro2me
+.dro2med
+.drom2e2d2a
+.drome4dary
+.dromed2a2r
+.dr8o8m9e9d8a8r8i8e8s.
+.dromedar1i
+.dromedar2ie4
+.du9o8p9o9l8i8s8t.
+.duopol2i
+.du9o8p9o9l8i8s8t8s.
+.duopolis4t1s2
+.du9o8p9o8l8y.
+.duopo2ly
+.dy8s9l8e8x8i8a.
+.d2y
+.dys1l2
+.dys2le
+.dyslex3i
+.dyslex2i5a
+.dy8s9l8e8c9t8i8c.
+.dysle2c1t
+.ea8s8t9e8n8d9e8r8s.
+.east3
+.eas3ten
+.eas3tend
+.easten1de
+.eastende4r5s2
+.ec8o9n8o8m9i8c8s.
+.e1co
+.eco2n
+.eco3nomic
+.economi4c3s2
+.ec8o8n9o9m8i8s8t.
+.econom2is
+.ec8o8n9o9m8i8s8t8s.
+.economis4t1s2
+.ei9g8e8n9c8l8a8s8s.
+.ei2
+.e2ig2
+.ei1gen
+.eigen1c4l4
+.eigencla2ss
+.ei9g8e8n9c8l8a8s8s8e8s.
+.eigenclass1e4s
+.ei9g8e8n9v8a8l9u8e.
+.eigen1v2
+.eigen1va
+.eigenval1u
+.ei9g8e8n9v8a8l9u8e8s.
+.el8e8c8t8r8o9m8e8c8h8a8n9i9c8a8l.
+.5elec
+.ele2c1t
+.electro2me
+.electrome2ch
+.electrome5cha4n1ic
+.electromecha2n
+.electromechani1ca
+.el8e8c8t8r8o9m8e8c8h8a8n8o9a8c8o8u8s8t8i8c.
+.electromechano4
+.electromechan4oa
+.electromechanoa1co
+.electromechanoacou2
+.electromechanoaco2us
+.electromechanoacoust2i
+.electromechanoacous1tic
+.el8i8t9i8s8t.
+.el2i
+.el1it
+.eli1ti
+.el4itis
+.el8i8t9i8s8t8s.
+.elitis4t1s2
+.en9t8r8e9p8r8e9n8e8u8r.
+.en1t
+.entrepr2
+.entrepren4eu
+.en9t8r8e9p8r8e9n8e8u8r9i8a8l.
+.entrepreneur2i3a
+.entrepreneuri2al
+.ep9i9n8e8p8h9r8i8n8e.
+.epi2n
+.ep2ine
+.epinep4hr4
+.ep2inephr2in4e
+.eq8u8i9v8a8r8i9a8n8t.
+.equ2iv3
+.equi1va
+.equiv2a2r
+.equivar1i
+.equivar3i2a2n
+.equivar2i3a
+.equivar4ian4t
+.eq8u8i9v8a8r8i9a8n8c8e.
+.equivar4ianc
+.et8h9a8n8e.
+.etha2n4
+.et8h9y8l9e8n8e.
+.ev8e8r9s8i9b8l8e.
+.ev1er
+.eve4r1s2
+.ever1si
+.ever4si4b
+.eversi1b2l2
+.ev8e8r8t.
+.ev8e8r8t8s.
+.ever4t1s2
+.ev8e8r8t9e8d.
+.ever2t1ed
+.ev8e8r8t9i8n8g.
+.ever1ti
+.ever2t1in
+.ex9q8u8i8s9i8t8e.
+.exqu2
+.exq2ui2
+.exquis2ite
+.ex9t8r8a9o8r9d8i9n8a8r8y.
+.ex1t2
+.ex1tra
+.extr4ao
+.extraord2i
+.extraord1in4
+.extraor1di1na
+.extraordin2a2r
+.fa8l8l9i8n8g.
+.1fa
+.fal1l
+.fall2i
+.fal2lin4
+.fe8r8m8i9o8n8s.
+.fer1
+.fer3m4
+.fer4m2io
+.fermio2n
+.fermio2n3s2
+.fi9n8i8t8e9l8y.
+.1fi
+.2fin
+.f2ini
+.fin2it
+.fin2ite
+.finite1ly
+.fi9n8i8t8e9l8y.
+.1fi
+.2fin
+.fini
+.fin2it
+.fin2ite
+.finite1ly
+.fl8a9g8e8l9l8u8m.
+.f4l2
+.flag5el1l
+.fl8a9g8e8l9l8u8m.
+.fl2
+.flag5el1l
+.fl8a9g8e8l9l8a.
+.flag4ella
+.fl8a9g8e8l9l8a.
+.flag4ella
+.fl8a8m9m8a9b8l8e8s.
+.flam1m
+.flam1ma
+.flam2mab
+.flammab2l2
+.flammables2
+.fl8a8m9m8a9b8l8e8s.
+.flam1m
+.flam1ma
+.flam2mab
+.flammab2l2
+.flammables2
+.fl8e8d8g9l8i8n8g.
+.fledgl2
+.fl8e8d8g9l8i8n8g.
+.fledgl2
+.fl8o8w9c8h8a8r8t.
+.flow2ch
+.flowch2a2r
+.fl8o8w9c8h8a8r8t.
+.flow2ch
+.flowch2a2r
+.fl8o8w9c8h8a8r8t8s.
+.flowchar4t1s2
+.fl8o8w9c8h8a8r8t8s.
+.flowchar4t1s2
+.fl8u8o8r8o9c8a8r9b8o8n.
+.flu3o
+.fluo3r
+.fluor2oc
+.fluoro1ca
+.fluoroc2a2r
+.fluorocar1b
+.fluorocarb4o
+.fluorocarbo2n
+.fl8u8o8r8o9c8a8r9b8o8n.
+.flu3o
+.fluo3r
+.fluor2oc
+.fluoro1ca
+.fluoroc2a2r
+.fluorocar1b
+.fluorocarb4o
+.fluorocarbo2n
+.fo8r9m8i9d8a9b8l8e.
+.for2mi
+.formi1d4a
+.form2id
+.formi2d3a4b
+.formidab2l2
+.fo8r9m8i9d8a9b8l8y.
+.formidab1ly
+.fo8r9s8y8t8h9i8a.
+.fo4rs2
+.fors4y
+.forsyth2i1a
+.fo8r8t8h9r8i8g8h8t.
+.fort4hr4
+.forthr2ig
+.fr8e8e9l8o8a8d8e8r.
+.freel4oa
+.freeloa2d3
+.fr8e8e9l8o8a8d8e8r8s.
+.freeloade4r5s2
+.fr8i8e8n8d9l8i8e8r.
+.fri2
+.fr2ie4
+.fr2ie4ndl2ie4
+.fr8i9v8o8l9i8t8y.
+.fr2iv
+.frivol2i
+.frivol1it
+.frivoli1ty
+.fr8i9v8o8l9i9t8i8e8s.
+.frivoli1ti
+.frivolit2ie4
+.fr8i8v9o9l8o8u8s.
+.frivolou2
+.frivolo2us
+.ga9l8a8c9t8i8c.
+.gala2c1t
+.ga8l9a8x8y.
+.ga8l9a8x9i8e8s.
+.galax3i
+.galax2ie4
+.ga8s9o8m9e9t8e8r.
+.ga1so
+.ga3som
+.gaso2me
+.gaso4met
+.gasome1te
+.ge9o9d8e8s9i8c.
+.geodes2
+.geode1si
+.geode2sic
+.ge9o9d8e8t9i8c.
+.geode1t
+.geodet1ic
+.ge8o9m8e8t9r8i8c.
+.ge3om
+.geo2me
+.geo4met
+.geom4etr
+.geo5met3ric
+.ge8o9m8e8t9r8i8c8s.
+.geome4tri4c3s2
+.ge9o9s8t8r8o8p8h8i8c.
+.geos4
+.geost4r
+.geostr2oph
+.geostroph1ic
+.ge8o9t8h8e8r9m8a8l.
+.ge4ot
+.ge4oth
+.geoth2e
+.geother3m4
+.geother1ma
+.ge9o8t9r8o9p8i8s8m.
+.geotropi2s1m
+.gn8o9m8o8n.
+.g1no
+.gno4mo
+.gno4mo2n
+.gn8o9m8o8n8s.
+.gnomo2n3s2
+.gr8a8n8d9u8n8c8l8e.
+.1gr
+.gra2n2
+.gr4and
+.gran1du
+.grandu4n
+.grandun1c4l4
+.gr8a8n8d9u8n8c8l8e8s.
+.granduncles2
+.gr8i8e8v9a8n8c8e.
+.gr2ie4
+.grie1va
+.grieva2n
+.gr8i8e8v9a8n8c8e8s.
+.gr8i8e8v9o8u8s.
+.grievou2
+.grievo2us
+.gr8i8e8v9o8u8s9l8y.
+.grievous1l2
+.grievous1ly
+.ha8i8r9s8t8y8l8e.
+.hai2
+.ha4ir
+.hai4rs2
+.hairs2ty
+.hairs2tyl
+.ha8i8r9s8t8y8l8e8s.
+.hairstyles2
+.ha8i8r9s8t8y8l9i8s8t.
+.ha8i8r9s8t8y8l9i8s8t8s.
+.hairstylis4t1s2
+.ha8l8f9s8p8a8c8e.
+.ha2lf
+.hal2f3s
+.half2s1pa
+.halfspa4ce
+.ha8l8f9s8p8a8c8e8s.
+.ha8l8f9w8a8y.
+.ha8r9b8i8n9g8e8r.
+.h2a2r
+.har1b
+.harbi2
+.har2bin
+.harb4inge
+.ha8r9b8i8n9g8e8r8s.
+.harbinge4r1s2
+.ha8r9l8e9q8u8i8n.
+.har4le4
+.har1l
+.harle1q
+.harlequ2
+.harleq2ui2
+.harlequi4n
+.ha8r9l8e9q8u8i8n8s.
+.harlequ2i2n1s2
+.ha8t8c8h9e8r8i8e8s.
+.ha4tc
+.hat4ch
+.hatche2
+.hatcher1i
+.hatcher2ie4
+.he8m8i9d8e8m8i9s8e8m8i9q8u8a9v8e8r.
+.hem2id
+.hemid4em
+.hemide4m2is
+.hemidem4ise
+.hemidemisemi3qua
+.hemidemisemiqu2
+.hemidemisemiqua5v4
+.he8m8i9d8e8m8i9s8e8m8i9q8u8a9v8e8r8s.
+.hemidemisemiquave4r1s2
+.he9m8o9g8l8o9b8i8n.
+.hemo4g
+.he1mo
+.hemo4gl2
+.hemo3glo
+.hemoglo1bi
+.hemoglo2bin
+.he9m8o9p8h8i8l9i8a.
+.hem2oph
+.hemoph4il2
+.hemophil1i
+.hemophil3i1a
+.he9m8o9p8h8i8l9i8a8c.
+.he9m8o9p8h8i8l9i8a8c8s.
+.hemophilia4c3s2
+.he8m8o9r8h8e9o8l9o8g8y.
+.hemo2r
+.hemorh4
+.hemorhe3ol
+.hemorheol1o1gy
+.he9p8a8t9i8c.
+.hep5
+.he2pa
+.hepat1ic
+.he8r9m8a8p8h9r8o9d8i8t8e.
+.her3m4
+.her1ma
+.her4map
+.hermap4hr4
+.hermaphrod2ite
+.he8r9m8a8p8h9r8o9d8i8t9i8c.
+.hermaphrod2i1ti
+.hermaphrod4i2tic
+.he9r8o8e8s.
+.hero4e
+.he8x8a9d8e8c9i9m8a8l.
+.hex1a
+.hexa2d
+.hexade1c2i
+.hexade2c3im
+.hexadeci1ma
+.ho9l8o9n8o9m8y.
+.holo2n
+.holon3o3my
+.ho9m8e8o9m8o8r9p8h8i8c.
+.ho2me3
+.homeo1mo
+.homeomo2r
+.homeomor1p
+.homeomorp4h4
+.homeomorph1ic
+.ho9m8e8o9m8o8r9p8h8i8s8m.
+.homeomorphi2s1m
+.ho9m8o9t8h8e8t8i8c.
+.ho1mo
+.hom4oth3
+.homoth2e
+.homo3the4t
+.homothet1ic
+.ho8r8s8e9r8a8d9i8s8h.
+.hor4se
+.ho4rs2
+.horser1a
+.horsera2d
+.horser2adi
+.horseradis1
+.horseradis2h
+.ho8t9b8e8d.
+.ho2t1b
+.hot4be2d
+.ho8t9b8e8d8s.
+.hotbe2d1s2
+.hy9d8r8o9t8h8e8r9m8a8l.
+.hy1d
+.hy1dr
+.hydro4th2e
+.hydr4oth
+.hydrother3m4
+.hydrother1ma
+.hy9p8o9t8h8a8l9a9m8u8s.
+.hy3po
+.hyp4ot
+.hyp4oth
+.hypotha3la
+.hypothala3m
+.hypothala1mu
+.hypothalam2us
+.id8e8a8l8s.
+.ide3a4l
+.idea2l1s2
+.id8e8o9g8r8a8p8h8s.
+.ideo2g
+.ideo1gr
+.ideogra4p4h1s2
+.id8i8o9s8y8n9c8r8a8s8y.
+.i2di
+.i1d3io
+.idi4os
+.idios4y
+.idiosyn1cr
+.idiosyncr2as
+.idios4yncras4y
+.id8i8o9s8y8n9c8r8a9s8i8e8s.
+.idiosyncras2ie4
+.id8i8o9s8y8n9c8r8a8t8i8c.
+.idiosyn5crat1ic
+.id8i8o9s8y8n9c8r8a8t9i9c8a8l9l8y.
+.idiosyncrati1ca
+.idiosyncratical1l
+.idiosyncratical1ly
+.ig9n8i8t9e8r.
+.2ig
+.ig1ni
+.ign2it
+.ign2ite
+.ig9n8i8t9e8r8s.
+.ignite4r1s2
+.ig9n8i9t8o8r.
+.ign3itor
+.igni1to
+.ig8n8o8r8e9s8p8a8c8e8s.
+.ig1no
+.ignore1sp
+.ignore2s1pa
+.ignorespa4ce
+.im9p8e8d9a8n8c8e.
+.im2p2ed
+.imp2e2d2a
+.impeda2n
+.im9p8e8d9a8n8c8e8s.
+.in9d8u9b8i9t8a9b8l8e.
+.4ind
+.in1du
+.indu1b4i
+.indubi2t
+.indubi1ta
+.indubi2tab
+.indubitab2l2
+.in9f8i8n9i8t8e9l8y.
+.in3f
+.in1fi
+.in2fin
+.inf2ini
+.infin2it
+.infin2ite
+.infinite1ly
+.in9fi8n9i8t8e9l8y.
+.in3fi
+.in2fin
+.infini
+.infin2it
+.infin2ite
+.infinite1ly
+.in9f8i8n9i9t8e8s9i9m8a8l.
+.infinit4es
+.infinite1si
+.infinite2s5im
+.infinitesi1ma
+.in9fi8n9i9t8e8s9i9m8a8l.
+.infinit4es
+.infinite1si
+.infinite2s5im
+.infinitesi1ma
+.in9f8r8a9s8t8r8u8c9t8u8r8e.
+.infr2as
+.infras1t4r
+.infrastru2c1t
+.infrastructu4r
+.infrastruc1tu
+.infrastruc3ture
+.in9f8r8a9s8t8r8u8c9t8u8r8e8s.
+.in9s8t8a8l8l9e8r.
+.ins2ta2l
+.ins1ta
+.instal1l
+.instal2le
+.in9s8t8a8l8l9e8r8s.
+.installe4r1s2
+.in9t8e8r9d8i8s9c8i9p8l8i9n8a8r8y.
+.in1t
+.in5ter3d
+.interd2i
+.interdis1
+.interd2is1c
+.interdis1ci
+.interdisc2ip
+.interdisci1p2l2
+.interdiscipli4n
+.interdiscipl4i1na
+.interdisciplin2a2r
+.in9t8e8r9g8a9l8a8c9t8i8c.
+.interg2
+.inter1ga
+.intergala2c1t
+.in9u8t8i8l8e.
+.in1u
+.in4u1t2i
+.in9u8t8i8l9i9t8y.
+.inutil1i
+.inut2il1it
+.inutili1ty
+.ir9r8e9d8u8c9i8b8l8e.
+.ir2r2ed
+.irre1du
+.irredu2c
+.irreduci4b
+.irredu1ci
+.irreduci1b2l2
+.ir9r8e9d8u8c9i8b8l8y.
+.irreducib1ly
+.ir9r8e8v9o9c8a9b8l8e.
+.irrev2
+.irre5voc
+.irrevo1ca
+.irrevoca1b2l2
+.is8o8t9r8o8p8y.
+.i2so
+.isotropy5
+.is8o9t8r8o8p9i8c.
+.isotrop3ic
+.it8i8n9e8r9a8r8y.
+.i1ti
+.i2t1in
+.it2ine
+.itin4er4a2r
+.itin1er
+.itiner1a
+.it8i8n9e8r9a8r9i8e8s.
+.itinerar1i
+.itinerar2ie4
+.je9r8e9m8i9a8d8s.
+.1je
+.jerem2i3a
+.jeremia2d
+.jeremia2d1s2
+.ke8y9n8o8t8e.
+.ke8y9n8o8t8e8s.
+.keyno4tes
+.ke8y9s8t8r8o8k8e.
+.keys4
+.keys1t
+.keyst4r
+.keystr2ok2
+.ke8y9s8t8r8o8k8e8s.
+.keystrokes4
+.ki8l8n9i8n8g.
+.k1i
+.k4i2l1n2
+.kiln1in
+.kilnin4g
+.la8c9i9e8s8t.
+.l4a2ci4
+.la3c2ie4
+.laci1est
+.la8m9e8n9t8a9b8l8e.
+.la1men
+.la3men1t
+.lamen2ta4b
+.lamen1ta
+.lamentab2l2
+.la8n8d9s8c8a8p9e8r.
+.3l4and
+.la2n
+.lan2d1s2
+.landsca4p
+.lands1ca
+.landsca5per
+.la8n8d9s8c8a8p9e8r8s.
+.landscape4r1s2
+.la8r9c8e9n8y.
+.l2a2r
+.lar1c
+.lar2ce
+.lar1cen4
+.la8r9c8e9n9i8s8t.
+.lar4ceni
+.le8a8f9h8o8p9p8e8r.
+.le2a
+.lea2f
+.lea4fh
+.leafho4p1p
+.leafhop2pe
+.leafhop3per
+.le8a8f9h8o8p9p8e8r8s.
+.leafhoppe4r1s2
+.le8t9t8e8r9s8p8a8c9i8n8g.
+.le4t3t2
+.lette4r1s2
+.letter1sp
+.letter2s1pa
+.lettersp4a2ci
+.letterspa2c1in
+.letterspac1ing
+.li8f8e9s8p8a8n.
+.life1sp
+.life2s1pa
+.lifespa4n
+.li8f8e9s8p8a8n8s.
+.lifespa2n1s2
+.li8f8e9s8t8y8l8e.
+.lifes2ty
+.lifes2tyl
+.li8f8e9s8t8y8l8e8s.
+.lifestyles2
+.li8g8h8t9w8e8i8g8h8t.
+.3ligh
+.lightw4
+.lightwei2
+.l2ightwe2ig2
+.li8m9o8u9s8i8n8e8s.
+.li4mo
+.li3mo2us
+.limou2
+.limou2s1in
+.limous2ine
+.limousi1nes
+.li8n8e9b8a8c8k8e8r.
+.1l4ine
+.lin2e2b
+.lineback1
+.lineback1er
+.li8n8e9s8p8a8c8i8n8g.
+.li1nes
+.li4ne1sp
+.line2s1pa
+.linesp4a2ci
+.linespa2c1in
+.linespac1ing
+.li9o8n9e8s8s.
+.lio2n
+.lio1nes
+.lion2e2ss
+.li8t8h9o9g8r8a8p8h8e8d.
+.l2ith
+.litho4g
+.litho1gr
+.lithograph4ed
+.li8t8h9o9g8r8a8p8h8s.
+.lithogra4p4h1s2
+.lo9b8o8t9o8m8y.
+.lobo4to
+.loboto3my
+.lo9b8o8t9o8m9i8z8e.
+.lobotom2iz
+.lobotomi2ze
+.lo8g8e8s.
+.lo1ge
+.lo8n8g9e8s8t.
+.5long
+.lo2n
+.lo9q8u8a8c9i8t8y.
+.lo1q
+.loqu2
+.loquac4
+.loqu4a2ci
+.loqua2c1it
+.loquaci1ty
+.lo8v8e9s8t8r8u8c8k.
+.4lov
+.lov4e2s
+.lov2est4r
+.lovestruc5
+.lovestruck1
+.ma8c8r8o9e8c8o9n8o8m8i8c8s.
+.macro4e
+.macroe1co
+.macroeco2n
+.macroeco3nomic
+.macroeconomi4c3s2
+.ma8l9a9p8r8o8p9i8s8m.
+.malapr2
+.malapropi2s1m
+.ma8l9a9p8r8o8p9i8s8m8s.
+.malaprop4is4m1s2
+.ma8n9s8l8a8u8g8h9t8e8r.
+.ma2n1s2
+.man2s1l2
+.manslaugh3
+.ma8n9u9s8c8r8i8p8t.
+.man2us
+.manusc2
+.manuscri2
+.manuscr2ip
+.manuscri2p1t
+.ma8r9g8i8n9a8l.
+.marg2
+.margi4n
+.margi1na
+.ma8t8h9e9m8a9t8i9c8i8a8n.
+.m4ath3
+.math5em
+.math2e
+.1mathe1ma
+.mathemat1ic
+.mathemat2i1ci
+.mathemati3c2i1a
+.mathematici2a2n
+.ma8t8h9e9m8a9t8i9c8i8a8n8s.
+.mathematicia2n1s2
+.ma8t8t8e8s.
+.mat5te
+.ma4t3t2
+.mat4tes
+.me8d9i8c9a8i8d.
+.2med
+.m4edi
+.med3i1ca
+.medicai2
+.medica2id
+.me8d8i9o8c8r8e.
+.me1d2io
+.mediocre3
+.me8d8i9o8c9r8i9t8i8e8s.
+.medi5ocrit
+.mediocri2
+.medio5cri1ti
+.mediocrit2ie4
+.me8g8a9l8i8t8h.
+.me2g
+.m4egal
+.me1ga
+.me3gal1i
+.megal1it
+.megal2ith
+.me8g8a9l8i8t8h8s.
+.megali2t4h1s2
+.me8t8a9b8o8l9i8c.
+.me4ta
+.me2ta4b
+.metabol3ic
+.metabol2i
+.me9t8a8b9o9l8i8s8m.
+.metaboli2s1m
+.me9t8a8b9o9l8i8s8m8s.
+.metabol4is4m1s2
+.me9t8a8b9o9l8i8t8e.
+.metabo5l2ite
+.metabol1it
+.me9t8a8b9o9l8i8t8e8s.
+.metabolit4es
+.me8t8a9l8a8n9g8u8a8g8e.
+.met3a2l
+.meta5la
+.metala2n
+.metal2ang
+.metalan1gu
+.metalangu4a
+.me8t8a9l8a8n9g8u8a8g8e8s.
+.me8t8a9p8h8o8r9i8c.
+.metapho4r
+.me8t8h9a8n8e.
+.metha2n4
+.me9t8r8o8p9o9l8i8s.
+.m4etr
+.metropol2i
+.me9t8r8o8p9o9l8i8s8e8s.
+.metropol4ise
+.metropolis1e4s
+.me8t9r8o9p8o8l9i9t8a8n.
+.metropol1it
+.metropoli3ta2n
+.metropoli1ta
+.me8t9r8o9p8o8l9i9t8a8n8s.
+.metropolita2n1s2
+.mi8c8r8o9e8c8o9n8o8m8i8c8s.
+.m4i1cr
+.micro4e
+.microe1co
+.microeco2n
+.microeco3nomic
+.microeconomi4c3s2
+.mi9c8r8o9f8i8c8h8e.
+.micro2fi
+.microf4i2ch
+.microfiche2
+.mi9c8r8o9fi8c8h8e.
+.micro2fi
+.microfi2ch
+.microfiche2
+.mi9c8r8o9f8i8c8h8e8s.
+.microfich1es
+.mi9c8r8o9fi8c8h8e8s.
+.microfich1es
+.mi8c8r8o9o8r8g8a8n9i8s8m.
+.microo2
+.microorg2
+.microor1ga
+.microorgan5is
+.microorga2n
+.microorgani2s1m
+.mi8c8r8o9o8r8g8a8n9i8s8m8s.
+.microorgan4is4m1s2
+.mi8l8l9a8g8e.
+.m4il1l
+.mi8l9l8i9l8i8t8e8r.
+.mill2i
+.mil4l4i4l
+.millil1i
+.mill2il1it
+.millil2ite
+.mi8m8e8o9g8r8a8p8h8e8d.
+.mimeo2g
+.mimeo1gr
+.mimeograph4ed
+.mi8m8e8o9g8r8a8p8h8s.
+.mimeogra4p4h1s2
+.mi8m9i8c9r8i8e8s.
+.mim1i
+.mim4i1cr
+.mimicri2
+.mimicr2ie4
+.mi8n9i8s.
+.m2ini
+.min1is
+.mi8n8i9s8y8m9p8o9s8i8u8m.
+.minis4y
+.minisy4m1p
+.minisym1pos
+.minisympo5si4u
+.mi8n8i9s8y8m9p8o9s8i8a.
+.minisympos2i1a
+.mi9n8u8t9e8r.
+.m4in1u
+.mi9n8u8t9e8s8t.
+.mi8s9c8h8i8e9v8o8u8s9l8y.
+.m2is1c
+.mis3ch2
+.misch2ie4
+.mischievou2
+.mischievo2us
+.mischievous1l2
+.mischievous1ly
+.mi9s8e8r8s.
+.m4ise
+.mis3er
+.mise4r1s2
+.mi9s8o8g9a9m8y.
+.mi2so
+.miso1ga
+.miso2gam
+.mo8d9e8l9l8i8n8g.
+.mo2d1
+.model1l
+.modell2i
+.model2lin4
+.mo8l9e9c8u8l8e.
+.mole1cu
+.mole4cul
+.molecul4e
+.mo8l9e9c8u8l8e8s.
+.molecules2
+.mo8n9a8r8c8h8s.
+.mo1n1a
+.monar3c
+.mon2a2r
+.monar2ch
+.monarc4h1s2
+.mo8n8e8y9l8e8n9d8e8r.
+.moneylen1de
+.mo8n8e8y9l8e8n9d8e8r8s.
+.moneylende4r5s2
+.mo8n8o9c8h8r8o8m8e.
+.mono2ch4
+.monoc4hr4
+.monochro2me
+.mo8n8o9e8n9e8r9g8e8t8i8c.
+.mo3noe
+.monoen1er
+.monoenerg2
+.monoener3get
+.monoenerget1ic
+.mo8n9o8i8d.
+.monoi2
+.mono2id
+.mo8n8o9p8o8l8e.
+.mo4nop
+.mo8n8o9p8o8l8e8s.
+.monopoles2
+.mo9n8o8p9o8l8y.
+.monopo2ly
+.mo8n8o9s8p8l8i8n8e.
+.monos1p2l2
+.monospli4n
+.monosp1l4ine
+.mo8n8o9s8p8l8i8n8e8s.
+.monospli1nes
+.mo8n8o9s8t8r8o8f8i8c.
+.monos5t
+.monost4r
+.monostro2fi
+.mo8n8o9s8t8r8o8fi8c.
+.monostro2fi
+.mo9n8o8t9o9n8i8e8s.
+.mono1to
+.mo2noto2n
+.monoton2ie4
+.mo9n8o8t9o9n8o8u8s.
+.mono4tono
+.monoto1nou2
+.monotono2us
+.mo9r8o8n9i8s8m.
+.moro5n4is
+.moro2n
+.moroni2s1m
+.mo8s9q8u8i9t8o.
+.mos2
+.mosqu2
+.mosq2ui2
+.mosqui1to
+.mo8s9q8u8i9t8o8s.
+.mosquitos2
+.mo8s9q8u8i9t8o8e8s.
+.mu8d9r8o8o8m.
+.mu1dr
+.mud1room
+.mudroo2
+.mu8d9r8o8o8m8s.
+.mudroo4m1s2
+.mu8l9t8i9f8a8c9e8t8e8d.
+.5mu4lt
+.mul1ti3
+.multif2
+.multi1fa
+.multifa4ce
+.multifacet4
+.multiface2t1ed
+.mu8l9t8i9p8l8i8c9a8b8l8e.
+.mult2ip
+.multi1p2l2
+.multipli1ca
+.multiplica1b2l2
+.mu8l8t8i9u8s8e8r.
+.multi4u
+.multi2us
+.ne8o9f8i8e8l8d8s.
+.3neo
+.ne5of
+.neo2fi
+.neof2ie4
+.neofie2ld3
+.neofiel2d1s2
+.ne8o9fi8e8l8d8s.
+.ne5o2fi
+.neofie4
+.neofie2ld3
+.neofiel2d1s2
+.ne8o9n8a8z8i.
+.neo2n
+.neo1n1a
+.neona2z1i
+.ne8o9n8a8z8i8s.
+.neonaz4is
+.ne8p8h9e8w8s.
+.nephe4
+.ne8p8h9r8i8t8e.
+.nep4hr4
+.nephr2ite
+.ne8p8h9r8i8t8i8c.
+.nephr4i2t3ic
+.nephri1ti
+.ne8w9e8s8t.
+.ne4w
+.newest3
+.ne8w8s9l8e8t9t8e8r.
+.news4l2
+.news2le
+.newsle4t3t2
+.ne8w8s9l8e8t9t8e8r8s.
+.newslette4r1s2
+.ni8t8r8o9m8e8t8h9a8n8e.
+.n2it
+.ni3tr
+.nitro2me
+.nitro4met
+.nitrometha2n4
+.no9n8a8m8e.
+.no4n
+.no1n1a
+.no8n9a8r9i8t8h9m8e8t9i8c.
+.nonar3i
+.non2a2r
+.nonar2ith
+.nonarit4h1m
+.nonarithmet4
+.nonarithmet1ic
+.no8n9e8m8e8r9g8e8n8c8y.
+.none1me
+.nonemerg2
+.nonemer1gen
+.nonemergen1cy
+.no8n9e8q8u8i9v8a8r8i9a8n8c8e.
+.none2q
+.nonequ2
+.noneq2ui2
+.nonequ2iv3
+.nonequi1va
+.nonequiv2a2r
+.nonequivar1i
+.nonequivar3i2a2n
+.nonequivar2i3a
+.nonequivar4ianc
+.no8n8e9t8h8e9l8e8s8s.
+.noneth2e
+.nonethe1les2
+.nonethe3l2e2ss
+.no8n9e8u8c8l8i8d9e8a8n.
+.non4eu
+.noneu1c4l4
+.noneucl2id
+.noneuclidea2n
+.no8n9i8s8o9m8o8r9p8h8i8c.
+.non5i
+.non1is
+.noni2so
+.noni3som
+.noniso1mo
+.nonisomo2r
+.nonisomor1p
+.nonisomorp4h4
+.nonisomorph1ic
+.no8n9p8s8e8u8d8o9c8o8m9p8a8c8t.
+.non1p4
+.non2p1s2
+.nonp2se
+.nonps4eu
+.nonpseu1do
+.nonpseudo1co
+.nonpseudoco4m1p
+.nonpseudocom1pa
+.nonpseudocompa2c4t
+.no8n9s8m8o8o8t8h.
+.no2n3s2
+.non2s3m
+.nons1mo
+.nonsmoo2
+.nonsmo4oth
+.no8n9u8n8i9f8o8r8m.
+.no3nu4n
+.nonu1ni
+.nonuni1fo
+.nonunifo2r
+.nonunifor1m
+.no8n9u8n8i9f8o8r8m9l8y.
+.nonunifor4m1l
+.nonuniform1ly
+.no8r9e8p9i9n8e8p8h9r8i8n8e.
+.nore5pi2n
+.norep2ine
+.norepinep4hr4
+.norep2inephr2in4e
+.no8t9w8i8t8h9s8t8a8n8d9i8n8g.
+.notw4
+.notwi2
+.notw2ith3
+.notwi2t4h1s2
+.notwith5st4and
+.notwiths1ta
+.notwithsta2n
+.notwithstand1in
+.nu9c8l8e8o9t8i8d8e.
+.nucle3
+.nu1c4l4
+.nucle4ot
+.nucleot2id
+.nu9c8l8e8o9t8i8d8e8s.
+.nucleotide4s2
+.nu8t9c8r8a8c8k9e8r.
+.nu4tc
+.nutcrack1
+.nutcrack1er
+.nu8t9c8r8a8c8k9e8r8s.
+.nutcracke4r1s2
+.oe8r9s8t8e8d8s.
+.o3er
+.oe4r1s2
+.oers4t1ed
+.oerste2d1s2
+.of8f9l8i8n8e.
+.o4f1f
+.off4l2
+.offlin4
+.off1l4ine
+.offl8i8n8e.
+.offl2ine
+.of8f9l8o8a8d.
+.offl4oa
+.offloa2d3
+.offl8o8a8d.
+.offl4oa
+.offloa2d3
+.of8f9l8o8a8d8s.
+.offloa2d1s2
+.offl8o8a8d8s.
+.offloa2d1s2
+.of8f9l8o8a8d8e8d.
+.offloa2d1ed
+.offl8o8a8d8e8d.
+.offloa2d1ed
+.ol8i9g8o8p9o9l8i8s8t.
+.ol2i
+.ol2ig
+.oli2go
+.ol2igopol2i
+.ol8i9g8o8p9o9l8i8s8t8s.
+.oligopolis4t1s2
+.ol8i9g8o8p9o8l8y.
+.oligopo2ly
+.ol8i9g8o8p9o8l9i8e8s.
+.oligopol2ie4
+.op9e8r9a8n8d.
+.op1er
+.3oper1a
+.op4er4and
+.opera2n
+.op9e8r9a8n8d8s.
+.operan2d1s2
+.or8a8n8g9u8t8a8n.
+.ora2n
+.or2ang
+.oran1gu
+.oran4gu4t
+.orangu1ta
+.ora2nguta2n
+.or8a8n8g9u8t8a8n8s.
+.oranguta2n1s2
+.or9t8h8o9d8o8n9t8i8s8t.
+.ortho2do4
+.orthodo2n
+.orthodon3t4i
+.orthodon1t
+.or9t8h8o9d8o8n9t8i8s8t8s.
+.orthodontis4t1s2
+.or9t8h8o9k8e8r9a9t8o8l9o8g8y.
+.orth2ok
+.orthok1er
+.orthoker1a
+.orthokera1to
+.orthokeratol1o1gy
+.or8t8h8o9n8i8t8r8o9t8o8l8u8e8n8e.
+.ortho2n
+.orthon2it
+.orthoni3tr
+.orthonitro1to
+.orthonitrotolu3en
+.orthonitrotolu4ene
+.ov8e8r9v8i8e8w.
+.overv2ie4
+.ov8e8r9v8i8e8w8s.
+.ox9i8d9i8c.
+.ox3i
+.oxi5di
+.ox2id
+.pa8d9d8i8n8g.
+.1pa
+.p4a2d
+.pad4d1in
+.pad1d4
+.pa8i8n9l8e8s8s9l8y.
+.p4ai2
+.pa4i4n4
+.pa4i4n1l
+.painles2
+.pain3l2e2ss
+.painles4s1l2
+.painless1ly
+.pa8l9e8t8t8e.
+.p4al
+.p2ale
+.pale4t3t2
+.pa8l9e8t8t8e8s.
+.palet4tes
+.pa8r9a9b8o8l8a.
+.p2a2r
+.pa2rab
+.parabo1la
+.pa8r9a9b8o8l9i8c.
+.parabol3ic
+.parabol2i
+.pa9r8a8b9o9l8o8i8d.
+.paraboloi2
+.parabolo2id
+.pa8r9a9d8i8g8m.
+.para2d
+.par2adi
+.parad2ig
+.paradig1m
+.pa8r9a9d8i8g8m8s.
+.paradig4m1s2
+.pa8r8a9c8h8u8t8e.
+.para2ch
+.parachu4t
+.pa8r8a9c8h8u8t8e8s.
+.pa8r8a9d8i9m8e8t8h8y8l9b8e8n8z8e8n8e.
+.parad4imet
+.paradimethy2l1b
+.paradimethylb4e4n3z
+.paradimethylben2ze
+.paradimethylbenze4n
+.pa8r8a9f8l8u8o8r8o9t8o8l8u8e8n8e.
+.para2f
+.paraf4l2
+.paraflu3o
+.parafluo3r
+.parafluoro1to
+.parafluorotolu3en
+.parafluorotolu4ene
+.pa8r8a9fl8u8o8r8o9t8o8l8u8e8n8e.
+.para2fl2
+.paraflu3o
+.parafluo3r
+.parafluoro1to
+.parafluorotolu3en
+.parafluorotolu4ene
+.pa8r8a9g8r8a8p8h9e8r.
+.para1gr
+.parag5ra3ph4er
+.pa8r8a9l8e9g8a8l.
+.par3al
+.par2ale
+.paral4egal
+.parale1ga
+.pa8r9a8l9l8e8l9i8s8m.
+.paral1l
+.paral2le
+.paral3lel
+.parallel2i
+.paralle2lis
+.paralleli2s1m
+.pa8r8a9m8a8g9n8e8t9i8s8m.
+.par4a1ma
+.param3ag
+.para5mag1n
+.paramagneti2s4m
+.pa8r8a9m8e8d8i8c.
+.para2med
+.param4edi
+.pa8r8a9m8e8t8h8y8l9a8n8i8s8o8l8e.
+.param3et
+.paramethy3la
+.paramethyla2n
+.paramethylani2so
+.pa9r8a8m9e9t8r8i8z8e.
+.param4etr
+.parametri2ze
+.pa8r8a9m8i8l9i9t8a8r8y.
+.par2ami
+.paramil1i
+.param2il1it
+.paramili1ta
+.p2a2ramilit2a2r
+.pa8r8a9m8o8u8n8t.
+.para2mo
+.paramou2
+.paramoun1t
+.pa8t8h9o9g8e8n9i8c.
+.p4ath
+.pat4ho
+.patho4g
+.patho1ge4
+.patho1gen
+.pe8e8v9i8s8h.
+.p4ee
+.pee1vi
+.peevis2h
+.pe8e8v9i8s8h9n8e8s8s.
+.peevis2h1n
+.peevish1nes
+.peevishn2e2ss
+.pe8n9t8a9g8o8n.
+.pen1t
+.pen1ta
+.penta2go
+.pentago2n2
+.pe8n9t8a9g8o8n8s.
+.pentago2n3s2
+.pe9t8r8o9l8e9u8m.
+.petrol4eu
+.ph8e9n8o8m9e9n8o8n.
+.ph4e3no
+.phe2n
+.pheno2me
+.pheno1men
+.ph4enom4eno
+.phenomeno4n
+.ph8e8n8y8l9a8l8a9n8i8n8e.
+.pheny3la
+.phenylala2n
+.phenylala5n2ine
+.phenylalan1in
+.ph8i9l8a8t9e9l8i8s8t.
+.phi4latel2i4
+.philate2lis
+.ph8i9l8a8t9e9l8i8s8t8s.
+.philatelis4t1s2
+.ph8o9n8e8m8e.
+.3phone
+.pho2n
+.phone1me
+.ph8o9n8e8m8e8s.
+.phone2mes
+.ph8o9n8e9m8i8c.
+.phone5mi
+.ph8o8s9p8h8o8r9i8c.
+.phos1p
+.phospho5
+.phospho4r
+.ph8o9t8o9g8r8a8p8h8s.
+.pho1to
+.photo2gr
+.photogra4p4h1s2
+.ph8o9t8o9o8f8f9s8e8t.
+.photoo2
+.photoo4f1f
+.photoof2f3s
+.ph8o9t8o9o8ff9s8e8t.
+.photoo4ff
+.photooff3s
+.pi8c9a9d8o8r.
+.pi1ca
+.pica2d
+.pica1do
+.picad4or
+.pi8c9a9d8o8r8s.
+.picado4rs2
+.pi8p8e9l8i8n8e.
+.p2ip
+.pipe4
+.pipel2i
+.pipe1l4ine
+.pi8p8e9l8i8n8e8s.
+.pipeli1nes
+.pi8p8e9l8i8n9i8n8g.
+.pipel2in3i
+.pipelin1in
+.pipelinin4g
+.pi9r8a9n8h8a8s.
+.p4ir
+.pi1ra
+.pira2n
+.pira4n1h4
+.piranha4
+.pl8a8c8a9b8l8e.
+.1p2l2
+.pla1ca
+.placa1b2l2
+.pl8a8n8t9h8o8p9p8e8r.
+.3pla2n
+.plan1t
+.plantho4p1p
+.planthop2pe
+.planthop3per
+.pl8a8n8t9h8o8p9p8e8r8s.
+.planthoppe4r1s2
+.pl8e8a8s9a8n8c8e.
+.ple2a
+.pleasa2
+.plea3sanc
+.pleasa2n
+.pl8u8g9i8n.
+.plug5in
+.pl8u8g9i8n8s.
+.plu5g4i2n1s2
+.po8l9t8e8r9g8e8i8s8t.
+.po4l2t
+.pol1te
+.polterg2
+.poltergei2
+.po8l8y9e8n8e.
+.po2ly
+.po8l8y9e8t8h9y8l9e8n8e.
+.polye4t
+.po9l8y8g9a9m8i8s8t.
+.poly1ga
+.poly2gam
+.polygam2is
+.po9l8y8g9a9m8i8s8t8s.
+.polygamis4t1s2
+.po8l8y8g9o8n9i9z8a9t8i8o8n.
+.poly1go
+.polygo2n2
+.polygo3ni
+.polygoniza1
+.polygoniza1t2io
+.polygo2nizatio2n
+.po9l8y8p8h9o9n8o8u8s.
+.polypho2n
+.polypho1nou2
+.polyphono2us
+.po8l8y9s8t8y8r8e8n8e.
+.po2lys4
+.polys1t
+.polys2ty
+.po8m8e9g8r8a8n9a8t8e.
+.po2me
+.pome2g
+.pome1gr
+.pomegra2n2
+.pomegra1na
+.pomegran2at
+.po8r8o9e8l8a8s9t8i8c.
+.1p4or
+.poro4e
+.poro4el
+.poroe1la
+.poroelast2i
+.poroelas1tic
+.po8r9o8u8s.
+.porou2
+.poro2us
+.po8r9t8a9b8l8e.
+.por1ta
+.por2tab
+.portab2l2
+.po8s8t9a8m9b8l8e.
+.1pos
+.pos2ta
+.posta4m1b
+.postamb2l2
+.po8s8t9a8m9b8l8e8s.
+.postambles2
+.po8s8t9h8u9m8o8u8s.
+.posthu1mo
+.posthu3mo2us
+.posthumou2
+.po8s8t9s8c8r8i8p8t.
+.pos4t1s2
+.post4sc
+.postscri2
+.postscr2ip
+.postscri2p1t
+.po8s8t9s8c8r8i8p8t8s.
+.pos4t1s2crip4t1s2
+.po8s9t8u8r9a8l.
+.pos1tu
+.postu1ra
+.pr8e9a8m9b8l8e.
+.prea4m1b
+.preamb2l2
+.pr8e9a8m9b8l8e8s.
+.preambles2
+.pr8e9l8o8a8d8e8d.
+.prel4oa
+.preloa2d3
+.preloa2d1ed
+.pr8e9p8a8r9i8n8g.
+.pre2pa
+.prep4a4r1i
+.prep2a2r
+.preparin4g
+.pr8e9p8r8i8n8t.
+.pr2epr2
+.preprin4t3
+.pr8e9p8r8i8n8t8s.
+.preprin4t4s2
+.pr8e9p8r8o8c8e8s9s8o8r.
+.pre3pro
+.prepr2oc
+.prepro1ce
+.preproc2e2ss
+.preproces1so
+.pr8e9p8r8o8c8e8s9s8o8r8s.
+.preprocesso4rs2
+.pr8e9s8p8l8i8t9t8i8n8g.
+.pre1sp
+.pres1p2l2
+.prespl1it
+.prespl4i4t3t2
+.presplit2t1in
+.pr8e9w8r8a8p.
+.prewra4
+.pr8e9w8r8a8p8p8e8d.
+.prewra4p1p
+.prewrap2pe
+.prewrap4p2ed
+.pr8i8e8s8t9e8s8s8e8s.
+.5pr2i4e4
+.pri1est
+.pries4t2e2ss
+.priestess1e4s
+.pr8e8t9t8y9p8r8i8n9t8e8r.
+.pre4t3t2
+.pret1ty
+.pr2ettypr2
+.prettyprin4t3
+.pr8e8t9t8y9p8r8i8n9t8i8n8g.
+.prettyprint2i
+.prettyprin4t3ing
+.prettyprin2t1in
+.pr8o9c8e9d8u8r9a8l.
+.pr2oc
+.pro1ce
+.proce1du
+.procedu1ra
+.pr8o8c8e8s8s.
+.proc2e2ss
+.pr8o9c8u8r9a8n8c8e.
+.procu1ra
+.procura2n
+.pr8o8g9e9n8i8e8s.
+.pro1ge
+.pro1gen
+.proge5n2ie4
+.pr8o8g9e9n8y.
+.pro4geny
+.pr8o9g8r8a8m9m8a8b8l8e.
+.pro1gr
+.program1m
+.program1ma
+.program2mab
+.programmab2l2
+.pr8o8m9i9n8e8n8t.
+.prom4i
+.prom1in
+.prom2ine
+.promi1nen
+.prominen1t
+.pr8o9m8i8s9c8u9o8u8s.
+.prom2is
+.prom2is1c
+.promis1cu
+.promiscu1ou2
+.promiscuo2us
+.pr8o8m9i8s9s8o8r8y.
+.prom4i2s1s
+.promis1so
+.promisso1ry
+.pr8o8m9i8s8e.
+.prom4ise
+.pr8o8m9i8s8e8s.
+.promis1e4s
+.pr8o9p8e8l9l8e8r.
+.pro3pel
+.propel1l
+.propel2le
+.pr8o9p8e8l9l8e8r8s.
+.propelle4r1s2
+.pr8o9p8e8l9l8i8n8g.
+.propell2i
+.propel2lin4
+.pr8o9h8i8b9i9t8i8v8e.
+.pro1h2
+.prohibi2t
+.prohibi1ti
+.prohibi1t2iv
+.pr8o9h8i8b9i9t8i8v8e9l8y.
+.prohibitiv4e1ly
+.pr8o9s8c8i8u8t9t8o.
+.pros2c
+.pros1ci
+.prosci1u
+.prosciu4t3t2
+.prosciut5to
+.pr8o9t8e8s8t9e8r.
+.pro1t
+.pro4tes
+.pr8o9t8e8s8t9e8r8s.
+.proteste4r1s2
+.pr8o9t8e8s9t8o8r.
+.prot4es2to
+.pr8o9t8e8s9t8o8r8s.
+.protesto4rs2
+.pr8o9t8o9l8a8n9g8u8a8g8e.
+.pro1to
+.proto1la
+.proto4la2n
+.protol2ang
+.protolan1gu
+.protolangu4a
+.pr8o9t8o9t8y8p9a8l.
+.proto1ty
+.prototy1pa
+.prototyp4al
+.pr8o8v9i8n8c8e.
+.prov1in
+.prov2inc
+.pr8o8v9i8n8c8e8s.
+.pr8o9v8i8n9c8i8a8l.
+.provin1ci
+.provin3c2i1a
+.provinci2al
+.pr8o8w9e8s8s.
+.prow2e2ss
+.ps8e8u9d8o9d8i8f9f8e8r9e8n9t8i8a8l.
+.2p1s2
+.p2se
+.ps4eu
+.pseu1do
+.pseudod1if
+.pseudodi4f1f
+.pseudodiffer1
+.pseudodiffer3en1t
+.pseudodifferent2i
+.pseudodifferen1t2i1a
+.pseudodifferenti2al
+.ps8e8u9d8o9d8i8ff8e8r9e8n9t8i8a8l.
+.pseudod1i4ff
+.pseudodiffer1
+.pseudodiffer3en1t
+.pseudodifferent2i
+.pseudodifferen1t2i1a
+.pseudodifferenti2al
+.ps8e8u9d8o9f8i9n8i8t8e.
+.pseu2d5of
+.pseudo2fi
+.pseudo2fin
+.pseudof2ini
+.pseudofin2it
+.pseudofin2ite
+.ps8e8u9d8o9fi9n8i8t8e.
+.pseu2d5o2fi
+.pseudo2fin
+.pseudofini
+.pseudofin2it
+.pseudofin2ite
+.ps8e8u9d8o9f8i9n8i8t8e9l8y.
+.pseudofinite1ly
+.ps8e8u9d8o9fi9n8i8t8e9l8y.
+.pseudofinite1ly
+.ps8e8u9d8o9f8o8r8c8e8s.
+.pseudo1fo
+.pseudofo2r
+.pseudofor1c
+.pseudofor2ce
+.ps8e8u9d8o8g9r8a9p8h8e8r.
+.pseud4og
+.pseudo1gr
+.pseudog5ra3ph4er
+.ps8e8u9d8o9g8r8o8u8p.
+.pseudo4g4ro
+.pseudogrou2
+.ps8e8u9d8o9g8r8o8u8p8s.
+.2p1s2eudogrou2p1s2
+.ps8e8u9d8o9n8y8m.
+.pseu4do2n
+.pseudonym4
+.ps8e8u9d8o9n8y8m8s.
+.pseudony4m1s2
+.ps8e8u9d8o9w8o8r8d.
+.pseudo4wo2
+.ps8e8u9d8o9w8o8r8d8s.
+.pseudowor2d1s2
+.ps8y9c8h8e9d8e8l9i8c.
+.ps4y
+.p4sy1c
+.psy3ch
+.psych4e2
+.psy4ch4ed
+.psychedel2i
+.ps8y8c8h8s.
+.psyc4h1s2
+.pu9b8e8s9c8e8n8c8e.
+.pub3
+.pub4e
+.pu4bes4
+.pubes2c
+.pubes1cen
+.pubes3cenc
+.qu8a8d9d8i8n8g.
+.qu2
+.qua2d
+.quad4d1in
+.quad1d4
+.qu8a9d8r8a8t9i8c.
+.qua1dr
+.quadrat1ic
+.qu8a9d8r8a8t9i8c8s.
+.quadrati4c3s2
+.qu8a8d9r8a9t8u8r8e.
+.quadra2tu
+.quadra3ture
+.qu8a8d9r8i9p8l8e8g9i8c.
+.quadri2p2l2
+.quadr2ip
+.quadripleg4ic
+.qu8a8i8n8t9e8r.
+.quai2
+.qua4i4n
+.quain1t
+.qu8a8i8n8t9e8s8t.
+.qu8a9s8i9e8q8u8i8v9a9l8e8n8c8e.
+.quas2ie4
+.quasie1q
+.qu2asiequ2
+.quasieq2ui2
+.quasiequ2iv3
+.quasiequi1va
+.quasiequiv2ale
+.quasiequiva3lenc
+.qu8a9s8i9e8q8u8i8v9a9l8e8n8c8e8s.
+.qu8a9s8i9e8q8u8i8v9a9l8e8n8t.
+.quasiequiva1len1t
+.qu8a9s8i9h8y9p8o9n8o8r9m8a8l.
+.quasi3h
+.quasihy3po
+.quasihypo2n
+.quasihyponor1m
+.quasihyponor1ma
+.qu8a9s8i9r8a8d9i9c8a8l.
+.quas4i2r
+.quasi1r5a
+.quasira2d
+.quasir2adi
+.quasirad3i1ca
+.qu8a9s8i9r8e8s8i8d9u8a8l.
+.quasi4res
+.quasire1si
+.quasire2s2id
+.quasiresi2du
+.quasiresid1u1a
+.qu8a9s8i9s8m8o8o8t8h.
+.qua1sis
+.quasi2s1m
+.quasis1mo
+.quasismoo2
+.quasismo4oth
+.qu8a9s8i9s8t8a9t8i8o8n9a8r8y.
+.quasis1ta
+.quasistation5a2r
+.quasista1t2io
+.quasistatio2n
+.quasistatio1n1a
+.qu8a9s8i9t8o8p8o8s.
+.qu5a5si4t
+.quasi1to
+.quasito1pos
+.qu8a9s8i9t8r8i9a8n9g8u9l8a8r.
+.quasi5tr2i3a
+.quasitri2a2n
+.quasitri2ang
+.quasitrian1gu
+.quasitriangu1la
+.quasitriangul2a2r
+.qu8a9s8i9t8r8i8v9i8a8l.
+.quasitr2i4v
+.quasitriv3i
+.quasitriv2i1a
+.quasitrivi2al
+.qu8i8n9t8e8s9s8e8n8c8e.
+.q2ui2
+.qui4n
+.quin1t
+.quin4t2e2ss
+.quintes4senc
+.qu8i8n9t8e8s9s8e8n8c8e8s.
+.qu8i8n9t8e8s9s8e8n9t8i8a8l.
+.quin1tessen1t
+.quintessent2i
+.quintessen1t2i1a
+.quintessenti2al
+.ra8b9b8i8t9r8y.
+.2rab
+.ra2b1b
+.rabbi2t
+.rabbi3tr
+.rabbit5ry
+.ra9d8i9o8g9r8a9p8h8y.
+.ra2d
+.r2adi
+.ra3d2io
+.radio5g
+.radio2gr
+.radio4g3ra1phy
+.ra8f8f9i8s8h.
+.raf5fi
+.ra2f
+.ra4f1f4
+.raf2f5is
+.raffis2h
+.ra8ffi8s8h.
+.raffi
+.raffis
+.raffis2h
+.ra8f8f9i8s8h9l8y.
+.raffis4h1l4
+.raffish1ly
+.ra8ffi8s8h9l8y.
+.raffis4h1l4
+.raffish1ly
+.ra8m9s8h8a8c8k8l8e.
+.ra4m1s2
+.ram4s2h
+.ramshack1
+.ramshack1l
+.ra8v9e8n9o8u8s.
+.rav4e4no
+.rave1nou2
+.raveno2us
+.re9a8r8r8a8n8g8e9m8e8n8t.
+.re5ar1r4
+.re2a2r
+.rearran4ge
+.rearra2n
+.rearr2ang
+.rearrange1me
+.rearrange1men
+.rearrange3men1t
+.re9a8r8r8a8n8g8e9m8e8n8t8s.
+.rearrangemen4t4s2
+.re8c9i9p8r8o8c9i9t8i8e8s.
+.reciproci1ti
+.reciprocit2ie4
+.re8c9t8a8n9g8l8e.
+.rec4ta2n
+.re2c1t
+.rect5ang
+.rec1ta
+.rectan1gl2
+.rectan1gle
+.re8c9t8a8n9g8l8e8s.
+.rectangles2
+.re8c9t8a8n9g8u9l8a8r.
+.rectan1gu
+.rectangu1la
+.rectangul2a2r
+.re9d8i9r8e8c8t.
+.2r2ed
+.r4edi
+.red4ir2
+.redi1re
+.redire2c1t
+.re9d8i9r8e8c8t9i8o8n.
+.redirec1t2io
+.redirectio2n
+.re9d8u8c9i8b8l8e.
+.re1du
+.redu2c
+.reduci4b
+.redu1ci
+.reduci1b2l2
+.re9e8c8h8o.
+.ree2c
+.ree2ch
+.ree3cho2
+.re9p8h8r8a8s8e.
+.rep4hr4
+.rephr2as
+.re9p8h8r8a8s8e8s.
+.rephras1e4s
+.re9p8h8r8a8s8e8d.
+.rephra4s4ed
+.re9p8o9s8i9t8i8o8n.
+.re4posi
+.re1po
+.re1pos
+.repo3s2i1t2io
+.reposi1ti
+.repositio2n
+.re9p8o9s8i9t8i8o8n8s.
+.repositio2n3s2
+.re9p8r8i8n8t.
+.repr2
+.reprin4t3
+.re9p8r8i8n8t8s.
+.reprin4t4s2
+.re9s8t8o8r9a8b8l8e.
+.r4es2to
+.resto2ra
+.resto2rab
+.restorab2l2
+.re8t8r8o9f8i8t.
+.retro2fi
+.re8t8r8o9fi8t.
+.retro2fi
+.re8t8r8o9f8i8t9t8e8d.
+.retrof4i4t4t2
+.retrofit2t1ed
+.re8t8r8o9fi8t9t8e8d.
+.retrofi4t4t2
+.retrofit2t1ed
+.re9u8s9a8b8l8e.
+.r4eu2
+.re2us4
+.reusa2
+.reu2s1ab
+.reusab2l2
+.re9u8s8e.
+.re9w8i8r8e.
+.rewi2
+.rew4ir4
+.re9w8r8a8p.
+.rewra4
+.re9w8r8a8p8p8e8d.
+.rewra4p1p
+.rewrap2pe
+.rewrap4p2ed
+.re9w8r8i8t8e.
+.rewri4
+.rewr2ite
+.rh8i9n8o8c9e8r9o8s.
+.rh4
+.rh2i1no
+.rhi4no4c
+.rhino1ce
+.rhinoc2ero
+.ri8g8h8t9e8o8u8s.
+.righ1teo
+.righteou2
+.righteo2us
+.ri8g8h8t9e8o8u8s9n8e8s8s.
+.righteous1n4
+.righteous1nes
+.righteousn2e2ss
+.ri8n8g9l8e8a8d8e8r.
+.rin4g
+.ringl2
+.rin1gle
+.ringle2a
+.ringlea2d1
+.ri8n8g9l8e8a8d8e8r8s.
+.ringleade4r5s2
+.ro9b8o8t.
+.ro9b8o8t8s.
+.robo4t1s2
+.ro9b8o8t8i8c.
+.ro9b8o8t9i8c8s.
+.roboti4c3s2
+.ro8u8n8d9t8a8b8l8e.
+.rou2
+.roun2d
+.round1ta
+.round2tab
+.roundtab2l2
+.ro8u8n8d9t8a8b8l8e8s.
+.roundta5bles2
+.sa8l8e8s9c8l8e8r8k.
+.sa2
+.s2ale
+.sales2
+.sales2c
+.salescle5
+.sales1c4l4
+.sa8l8e8s9c8l8e8r8k8s.
+.salescler4k1s2
+.sa8l8e8s9w8o8m8a8n.
+.sales4w2
+.sale4s1wo2
+.saleswom1
+.saleswo1ma
+.saleswoma2n
+.sa8l8e8s9w8o8m8e8n.
+.saleswo2me
+.saleswo1men
+.sa8l9m8o9n8e8l9l8a.
+.s4a2l4m
+.salmo2n4
+.sal1mo
+.salmon4ella
+.salmonel1l
+.sa8l9t8a9t8i8o8n.
+.sa4l4t
+.sal1ta
+.salta1t2io
+.saltatio2n
+.sa8r9s8a9p8a8r9i8l9l8a.
+.s2a2r
+.sa2r4sa2
+.sa4rs2
+.sars1ap
+.s2a2rsap2a2r4
+.sarsa1pa
+.sarsap4a4r1i
+.sarsaparil1l
+.sa8u8e8r9k8r8a8u8t.
+.sau4
+.sauerkrau4t
+.sc8a8t9o9l8o8g9i9c8a8l.
+.s1ca
+.sca1to
+.scato3log1ic
+.s1catologi1ca
+.sc8h8e8d9u8l9i8n8g.
+.s2ch2
+.sche2
+.s4ch4ed
+.sche4dul
+.sche1du
+.schedul2i
+.schedul3ing
+.sc8h8i8z9o9p8h8r8e8n8i8c.
+.schi2z
+.schi1zo
+.schiz2oph
+.schizop4hr4
+.sc8h8n8a8u9z8e8r.
+.sc2h1n
+.sch1na
+.schn2au
+.schnau2z4e
+.schnauz1er
+.sc8h8o8o8l9c8h8i8l8d.
+.s4cho2
+.schoo2
+.schoo4l1c2
+.s2chool2ch
+.schoolch4il2
+.schoolchi2ld
+.sc8h8o8o8l9c8h8i8l8d9r8e8n.
+.schoolchil3dr
+.schoolchildre4
+.schoolchil5dren
+.sc8h8o8o8l9t8e8a8c8h8e8r.
+.schoo4l2t
+.school1te
+.s2chooltea2ch
+.schoolteache2
+.sc8h8o8o8l9t8e8a8c8h9e8r8s.
+.schoolteach3e4r1s2
+.sc8r8u9t8i9n8y.
+.scru2t1i5n
+.scr4u1t2i
+.scrut4iny
+.sc8y8t8h9i8n8g.
+.s1cy
+.scy3thin
+.se8l8l9e8r.
+.sel2le
+.se8l8l9e8r8s.
+.selle4r1s2
+.se8c9r8e9t8a8r9i8a8t.
+.se1cr
+.se4c3re1ta
+.secret2a2r
+.secretar1i
+.secretar2i3a
+.se8c9r8e9t8a8r9i8a8t8s.
+.secretaria4t1s2
+.se8m9a9p8h8o8r8e.
+.se1ma
+.se4map
+.semapho4r
+.se8m9a9p8h8o8r8e8s.
+.se9m8e8s9t8e8r.
+.4se1me
+.se2mes
+.se8m8i9d8e8f9i9n8i8t8e.
+.sem2id
+.semide1f
+.semidef5i5n2ite
+.semide1fi
+.semide2fin
+.semidef2ini
+.semidefin2it
+.se8m8i9d8e8fi9n8i8t8e.
+.semide1fi
+.semidefi5n2ite
+.semide2fin
+.semidefini
+.semidefin2it
+.se8m8i9d8i9r8e8c8t.
+.semi2di
+.semid4ir2
+.semidi1re
+.semidire2c1t
+.se8m8i9h8o9m8o9t8h8e8t9i8c.
+.semi3h
+.semiho1mo
+.semihom4oth3
+.semihomoth2e
+.semihomo3the4t
+.semihomothet1ic
+.se8m8i9r8i8n8g.
+.sem4ir
+.semir1i
+.semirin4g
+.se8m8i9r8i8n8g8s.
+.semirings2
+.se8m8i9s8i8m9p8l8e.
+.se4m2is
+.semisi4m1p
+.semisim1p2l2
+.se8m8i9s8k8i8l8l8e8d.
+.sem4is4k2
+.semisk1i
+.semisk4il1l
+.semiskil2le
+.se8r8o9e8p8i9d8e9m8i9o9l8o8g9i9c8a8l.
+.s2er4o
+.sero4e
+.seroep4id
+.seroepi3de
+.seroepid4em
+.seroepidem2io
+.seroepidemi1ol
+.seroepidemio3log1ic
+.seroepidemiologi1ca
+.se8r9v8o9m8e8c8h9a8n8i8s8m.
+.4ser3vo
+.servo2me
+.servome2ch
+.servomech5a5nis
+.servomecha2n
+.servomechani2s1m
+.se8r9v8o9m8e8c8h9a8n8i8s8m8s.
+.servomechan4is4m1s2
+.se8s9q8u8i9p8e9d8a9l8i8a8n.
+.s1e4s
+.sesqu2
+.sesq2ui2
+.sesqu2ip
+.sesquipe4
+.sesqui2p2ed
+.sesquip2e2d2a
+.sesquipedal1i
+.sesquipedal2i1a
+.sesquipedali2a2n
+.se8t9u8p.
+.se1tu
+.se8t9u8p8s.
+.setu2p1s2
+.se9v8e8r8e9l8y.
+.5sev
+.sev1er
+.sev4erel
+.severe1ly
+.sh8a8p8e9a8b8l8e.
+.sha3pe4a
+.shape1a4b
+.shapeab2l2
+.sh8o8e9s8t8r8i8n8g.
+.sho4
+.sho2est4r
+.shoestrin4g
+.sh8o8e9s8t8r8i8n8g8s.
+.shoestrings2
+.si8d8e9s8t8e8p.
+.5side4s2
+.s2id
+.sideste4p
+.si8d8e9s8t8e8p8s.
+.sideste2p1s2
+.si8d8e9s8w8i8p8e.
+.sides4w2
+.sideswi2
+.sidesw2ip
+.sideswipe4
+.sk8y9s8c8r8a8p8e8r.
+.sk2
+.skys4c
+.skyscrap3er
+.sk8y9s8c8r8a8p8e8r8s.
+.skyscrape4r1s2
+.sm8o8k8e9s8t8a8c8k.
+.2s1m
+.s1mo
+.s4m2ok
+.smokes4
+.smokes1ta
+.smokestack1
+.sm8o8k8e9s8t8a8c8k8s.
+.smokestac4k1s2
+.sn8o8r9k8e8l9i8n8g.
+.s1n4
+.snorke5l2i
+.snorke4l3ing
+.so9l8e9n8o8i8d.
+.1so
+.sol4eno
+.solenoi2
+.soleno2id
+.so9l8e9n8o8i8d8s.
+.solenoi2d1s2
+.so8l8u8t8e.
+.so1lut
+.so8l8u8t8e8s.
+.so8v9e8r9e8i8g8n.
+.4sov
+.soverei2
+.sovere2ig2
+.so8v9e8r9e8i8g8n8s.
+.sovereig2n1s2
+.sp8a9c8e8s.
+.2s1pa
+.spa4ce
+.sp8e9c8i8o8u8s.
+.spe2c
+.spe1c2i
+.spec2io
+.speciou2
+.specio2us
+.sp8e8l8l9e8r.
+.spel1l
+.spel2le
+.sp8e8l8l9e8r8s.
+.spelle4r1s2
+.sp8e8l8l9i8n8g.
+.spell2i
+.spel2lin4
+.sp8e9l8u8n8k9e8r.
+.spelu4nk2
+.spelunk1er
+.sp8e8n8d9t8h8r8i8f8t.
+.spen4d
+.spend2th
+.spendt4hr4
+.spendthr4i2ft
+.sp8h8e8r9o8i8d.
+.s2phe
+.3sph4er
+.sph2ero
+.spheroi2
+.sphero2id
+.sp8h8e8r9o8i8d9a8l.
+.spheroi1d2a
+.sp8h8i8n9g8e8s.
+.sph5ing
+.sph4inge
+.sp8i8c9i9l8y.
+.sp2i1ci
+.spici1ly
+.sp8i8n9o8r8s.
+.spi2n
+.sp4i1no
+.spino4rs2
+.sp8o8k8e8s9w8o8m8a8n.
+.sp2ok
+.spokes4
+.spokes4w2
+.spoke4s1wo2
+.spokeswom1
+.spokeswo1ma
+.spokeswoma2n
+.sp8o8k8e8s9w8o8m8e8n.
+.spokeswo2me
+.spokeswo1men
+.sp8o8r8t8s9c8a8s8t.
+.s1p4or4
+.spor4t1s2
+.sport4sc
+.sports1ca
+.sp8o8r8t8s9c8a8s8t9e8r.
+.sportscast5er
+.sp8o8r9t8i8v8e9l8y.
+.spor1ti
+.spor4t2iv
+.sportiv4e1ly
+.sp8o8r8t8s9w8e8a8r.
+.sport4sw2
+.sportswe2a2r
+.sp8o8r8t8s9w8r8i8t8e8r.
+.sportswri4
+.sportswr2ite
+.sp8o8r8t8s9w8r8i8t8e8r8s.
+.sportswrit5e4r1s2
+.sp8r8i8g8h8t9l8i8e8r.
+.spr2
+.spr2ig
+.sprigh2tl
+.sprightl2ie4
+.sq8u8e8a9m8i8s8h.
+.squ2
+.squeam2is
+.squeamis2h
+.st8a8n8d9a8l8o8n8e.
+.5st4and
+.sta2n
+.stan1d2a
+.standalo2n
+.st8a8r9t8l8i8n8g.
+.st2a2r
+.star2tl
+.st8a8r9t8l8i8n8g9l8y.
+.startlingl2
+.startling1ly
+.st8a9t8i8s9t8i8c8s.
+.statis1t2i
+.statis1tic
+.statisti4c3s2
+.st8e8a8l8t8h9i8l8y.
+.stea4l
+.stea4lt
+.stealth3i
+.steal4th4il2
+.stealthi1ly
+.st8e8e8p8l8e9c8h8a8s8e.
+.s1tee
+.stee4p1
+.stee1p2l2
+.steeple2ch
+.st8e8r8e8o9g8r8a8p8h9i8c.
+.stere1o
+.stereo2g
+.stereo1gr
+.stereo5graph1ic
+.stereogr4aphi
+.st8o9c8h8a8s9t8i8c.
+.s1to
+.sto2ch4
+.stochast2i
+.stochas1tic
+.st8r8a8n8g8e9n8e8s8s.
+.st4r
+.s1tra
+.stran4ge
+.stra2n
+.str2ang
+.strange4n4e
+.stran1gen
+.strange1nes
+.strangen2e2ss
+.st8r8a8p9h8a8n8g8e8r.
+.straph2an4g
+.straphang5er
+.strapha2n
+.st8r8a8t9a9g8e8m.
+.stra2ta
+.st8r8a8t9a9g8e8m8s.
+.stratage4m1s2
+.st8r8e8t8c8h9i9e8r.
+.stre4tc
+.stret4ch
+.stretch2ie4
+.st8r8i8p9t8e8a8s8e.
+.str2ip
+.stri2p1t
+.strip2te
+.st8r8o8n8g9h8o8l8d.
+.stro2n
+.strongho2l2d
+.st8r8o8n8g9e8s8t.
+.st8u9p8i8d9e8r.
+.s1tu
+.stup4id
+.stupi3de
+.st8u9p8i8d9e8s8t.
+.stupide4s2
+.su8b9d8i8f9f8e8r9e8n9t8i8a8l.
+.1su
+.su4b3
+.su4b1d
+.subd1if
+.subdi4f1f
+.subdiffer1
+.subdiffer3en1t
+.subdifferent2i
+.subdifferen1t2i1a
+.subdifferenti2al
+.su8b9d8i8ff8e8r9e8n9t8i8a8l.
+.subd1i4ff
+.subdiffer1
+.subdiffer3en1t
+.subdifferent2i
+.subdifferen1t2i1a
+.subdifferenti2al
+.su8b9e8x9p8r8e8s9s8i8o8n.
+.sub4e
+.sub1ex3p
+.subexpr2
+.subex3pr2e2ss
+.subexpres1si
+.subexpres1s2io
+.subexpres5sio2n
+.su8b9e8x9p8r8e8s9s8i8o8n8s.
+.subexpressio2n3s2
+.su8m9m8a9b8l8e.
+.su2m
+.sum1m
+.sum1ma
+.sum2mab
+.summab2l2
+.su8p8e8r9e8g8o.
+.su1pe
+.supere1go
+.su8p8e8r9e8g8o8s.
+.supere4gos
+.su9p8r8e8m9a9c8i8s8t.
+.supr2
+.supre4mac
+.supre1ma
+.suprem4a2ci
+.su9p8r8e8m9a9c8i8s8t8s.
+.supremacis4t1s2
+.su8r9v8e8i8l9l8a8n8c8e.
+.su2r
+.surv4e
+.survei2
+.surveil1l
+.surveilla2n
+.sw8i8m9m8i8n8g9l8y.
+.sw2
+.swi2
+.swim1m
+.swimm4ingl2
+.swimm5ing1ly
+.sy8m8p9t8o9m8a8t8i8c.
+.sy4m1p
+.sym2p1t
+.symp1to
+.sympto2ma
+.symptomat1ic
+.sy8n9c8h8r8o9m8e8s8h.
+.syn3c4hr4
+.syn2ch
+.synchro2me
+.synchro2mes
+.synchrom4es2h
+.sy8n9c8h8r8o9n8o8u8s.
+.synchro2n
+.synchro1nou2
+.synchrono2us
+.sy8n9c8h8r8o9t8r8o8n.
+.synchrotro2n
+.ta8f8f9r8a8i8l.
+.4ta2f4
+.ta4f1f4
+.taffr2ai2
+.ta8ff9r8a8i8l.
+.4ta4ff4
+.taffr2ai2
+.ta8l8k9a9t8i8v8e.
+.ta2l
+.4talk
+.talka3
+.talka4t
+.talka1t2iv
+.ta9p8e8s9t8r8y.
+.tap2est4r
+.tape4stry
+.ta9p8e8s9t8r8i8e8s.
+.tapestr2ie4
+.ta8r9p8a8u9l8i8n.
+.t2a2r
+.tar2p
+.tar1pa
+.tarpau4l2
+.tarpaul2i
+.ta8r9p8a8u9l8i8n8s.
+.tarpaul2i2n1s2
+.te9l8e8g9r8a9p8h8e8r.
+.tele1gr
+.teleg5ra3ph4er
+.te9l8e8g9r8a9p8h8e8r8s.
+.telegraphe4r1s2
+.te8l8e9k8i9n8e8t9i8c.
+.teleki4n
+.telek1i
+.telek2ine
+.teleki3net1ic
+.te8l8e9k8i9n8e8t9i8c8s.
+.telekineti4c3s2
+.te8l8e9r8o9b8o8t9i8c8s.
+.te4l1er
+.tel4ero
+.teler5ob
+.teleroboti4c3s2
+.te8l8l9e8r.
+.tel1l
+.tel2le
+.te8l8l9e8r8s.
+.telle4r1s2
+.te8m9p8o9r8a8r9i8l8y.
+.te4m1p
+.tem1p4or
+.tempo1ra
+.tempo4raril
+.tempor2a2r
+.temporar1i
+.temporari1ly
+.te8n9u8r8e.
+.te8s8t9b8e8d.
+.tes2t1b
+.test4be2d
+.te8x8t9w8i8d8t8h.
+.3tex
+.tex1t2
+.textw4
+.textwi2
+.textw2id
+.textwid2th
+.th8a8l9a9m8u8s.
+.tha3la
+.thala3m
+.thala1mu
+.thalam2us
+.th8e8r9m8o9e8l8a8s9t8i8c.
+.th2e
+.ther3m4
+.ther1mo
+.thermo4el
+.thermoe1la
+.thermoelast2i
+.thermoelas1tic
+.ti8m8e9s8t8a8m8p.
+.ti2mes
+.times1ta
+.timesta4m1p
+.ti8m8e9s8t8a8m8p8s.
+.timestam2p1s2
+.to8o8l9k8i8t.
+.too2
+.toolk1i
+.to8o8l9k8i8t8s.
+.toolki4t1s2
+.to8p8o9g8r8a8p8h9i9c8a8l.
+.to5po4g
+.topo1gr
+.topo5graph1ic
+.topogr4aphi
+.topographi1ca
+.to8q8u8e8s.
+.to1q
+.toqu2
+.tr8a8i9t8o8r9o8u8s.
+.1tra
+.tr2ai2
+.trai1to
+.traitorou2
+.traitoro2us
+.tr8a8n8s9c8e8i8v8e8r.
+.tra2n
+.tra2n1s2
+.trans4c
+.tran4s3cei2
+.transce2iv
+.tr8a8n8s9c8e8i8v8e8r8s.
+.transceive4r1s2
+.tr8a8n8s9g8r8e8s8s.
+.tran2s3g
+.trans1gr
+.transgr2e2ss
+.tr8a8n8s9v8e8r9s8a8l.
+.tran4sv
+.transve4r1s2
+.transver1sa2
+.tr8a8n8s9v8e8r9s8a8l8s.
+.transversa2l1s2
+.tr8a8n8s9v8e8s9t8i8t8e.
+.transv4e2s
+.transvest2i
+.transvest2ite
+.tr8a8n8s9v8e8s9t8i8t8e8s.
+.transvestit4es
+.tr8a9v8e8r8s9a9b8l8e.
+.trave4r1s2
+.traver1sa2
+.traver2s1ab
+.traversab2l2
+.tr8a9v8e8r9s8a8l.
+.tr8a9v8e8r9s8a8l8s.
+.traversa2l1s2
+.tr8i9e8t8h8y8l9a8m8i8n8e.
+.tri5et
+.tr2ie4
+.triethy3la
+.triethylam1in
+.triethylam2ine
+.tr8e8a8c8h9e8r8i8e8s.
+.trea2ch
+.treache2
+.treacher1i
+.treacher2ie4
+.tr8o8u9b8a9d8o8u8r.
+.trou2
+.trouba2d
+.trouba1do
+.trou2badou2
+.tu8r9k8e8y.
+.1tu
+.tu8r9k8e8y8s.
+.turkeys4
+.tu8r8n9a8r8o8u8n8d.
+.tur4n2a2r
+.tur1na
+.turnarou2
+.turnaroun2d
+.tu8r8n9a8r8o8u8n8d8s.
+.turnaroun2d1s2
+.ty8p9a8l.
+.1ty
+.ty1pa
+.typ4al
+.un9a8t9t8a8c8h8e8d.
+.un2at4
+.una4t3t2
+.unat1ta
+.unatta2ch
+.unattache2
+.unatta4ch4ed
+.un9e8r8r9i8n8g9l8y.
+.un4er
+.uner4r4
+.unerrin4g
+.unerringl2
+.unerring1ly
+.un9f8r8i8e8n8d9l8y.
+.un3f
+.unfri2
+.unfr2ie4
+.unfrien2d1ly
+.un9f8r8i8e8n8d9l8i9e8r.
+.unfr2ie4ndl2ie4
+.va8g8u8e8r.
+.1va
+.vag4
+.va5guer
+.va2gue
+.va8u8d8e9v8i8l8l8e.
+.vaude1v4
+.vaude2v3i4l
+.vaude1vi
+.vaudevil1l
+.vaudevil2le
+.vi8c9a8r8s.
+.v4ic2a2r
+.vi1ca
+.vica4rs2
+.vi8l9l8a8i8n9e8s8s.
+.2vil
+.vil1l
+.villai2
+.villa4i4n
+.villa2ine
+.villai5n2e2ss
+.villai1nes
+.vi8s9u8a8l.
+.vi3su
+.visu1al
+.vi8s9u8a8l9l8y.
+.visual1l
+.visual1ly
+.vi9v8i8p9a9r8o8u8s.
+.3v2iv
+.viv2i4p
+.vivi1pa
+.vivip2a2r
+.viviparou2
+.viviparo2us
+.vo8i8c8e9p8r8i8n8t.
+.voi4
+.voi3cep
+.voicepr2
+.voiceprin4t3
+.vs8p8a8c8e.
+.v2s1pa
+.vspa4ce
+.wa8d9d8i8n8g.
+.wa2d
+.wad4d1in
+.wad1d4
+.wa8l8l9f8l8o8w8e8r.
+.wal1l
+.wal2lf
+.wallf4l2
+.wallflow1er
+.wa8l8l9fl8o8w8e8r.
+.wal2lfl2
+.wallflow1er
+.wa8l8l9f8l8o8w9e8r8s.
+.wallflowe4r1s2
+.wa8l8l9fl8o8w9e8r8s.
+.wallflowe4r1s2
+.wa8r8m9e8s8t.
+.w2a2r
+.war1m
+.war2me
+.war2mes
+.wa8s8t8e9w8a8t8e8r.
+.was4t
+.waste2w
+.waste1w5a
+.wastewa1te
+.wa8v8e9g8u8i8d8e.
+.waveg3
+.waveg2ui2
+.wavegu2id
+.wa8v8e9g8u8i8d8e8s.
+.waveguide4s2
+.wa8v8e9l8e8t.
+.wa8v8e9l8e8t8s.
+.wavele4t1s2
+.we8b9l8i8k8e.
+.w2e1b
+.web2l2
+.web3l4ik
+.we8e8k9n8i8g8h8t.
+.weekn2ig
+.we8e8k9n8i8g8h8t8s.
+.weeknigh4t1s2
+.wh8e8e8l9c8h8a8i8r.
+.whee4l1c2
+.wheel2ch
+.wheelchai2
+.wheelcha4ir
+.wh8e8e8l9c8h8a8i8r8s.
+.wheelchai4rs2
+.wh8i8c8h9e8v8e8r.
+.whi4
+.wh4i2ch
+.whiche2
+.whichev1er
+.wh8i8t8e9s8i8d8e8d.
+.wh2ite
+.whit4es
+.white1si
+.white2s2id
+.whitesi2d1ed
+.wh8i8t8e9s8p8a8c8e.
+.white1sp
+.white2s1pa
+.whitespa4ce
+.wh8i8t8e9s8p8a8c8e8s.
+.wi8d8e9s8p8r8e8a8d.
+.w2id
+.wide4s2
+.wide1sp
+.wides4pre
+.widespr2
+.widesprea2d1
+.wi8n8g9s8p8a8n.
+.win4g
+.wings2
+.wing2s1pa
+.wingspa4n
+.wi8n8g9s8p8a8n8s.
+.wingspa2n1s2
+.wi8n8g9s8p8r8e8a8d.
+.wingspr2
+.wingsprea2d1
+.wi8t8c8h9c8r8a8f8t.
+.wi4tc
+.wit4ch
+.witchcra2f4t
+.witchcra2f
+.wo8r8d9s8p8a8c9i8n8g.
+.1wo2
+.wor2d1s2
+.words4p
+.word2s1pa
+.wordsp4a2ci
+.wordspa2c1in
+.wordspac1ing
+.wo8r8k9a8r8o8u8n8d.
+.work2a2r
+.workarou2
+.workaroun2d
+.wo8r8k9a8r8o8u8n8d8s.
+.workaroun2d1s2
+.wo8r8k9h8o8r8s8e.
+.workh4
+.workhor4se
+.workho4rs2
+.wo8r8k9h8o8r8s8e8s.
+.workhors3e4s
+.wr8a8p9a8r8o8u8n8d.
+.wra4
+.wrap2a2r4
+.wra1pa
+.wraparou2
+.wraparoun2d
+.wr8e8t8c8h9e8d.
+.wre4tc
+.wret4ch
+.wretche2
+.wret4ch4ed
+.wr8e8t8c8h9e8d9l8y.
+.wretche2d1ly
+.ye8s9t8e8r9y8e8a8r.
+.yes4
+.yesterye2a2r
+.al9g8e9b8r8a8i9s8c8h8e.
+.algebra2is1c
+.algebrais3ch2
+.algebraische2
+.al9l8e9g8h8e9n8y.
+.al1l
+.al2le
+.al3leg
+.alleghe2n
+.ar9k8a8n9s8a8s.
+.arka2n
+.arkan2sa2
+.arka2n1s2
+.at8p9a8s8e.
+.a4t1p
+.at1pa
+.at8p9a8s8e8s.
+.atpas1e4s
+.au8s9t8r8a8l9a8s8i8a8n.
+.a2us
+.aus1t4r
+.aus1tra
+.australas2i1a
+.australasi2a2n
+.au8t8o9m8a8t8i9s8i8e8r9t8e8r.
+.automa3tis
+.automatis2ie4
+.automatisiert3er
+.be9d8i8e9n8u8n8g.
+.4be2d
+.b4e3di
+.be5di3en
+.bed2ie4
+.bedie3nu4n
+.be8m8b8o.
+.4be5m
+.be4m5b
+.bi8b9l8i9o9g8r8a9p8h8i9s8c8h8e.
+.bibliogr4aphi
+.bibliograph2is1c
+.bibliographis3ch2
+.bibliographische2
+.bo8s9t8o8n.
+.5bos4
+.bos1to
+.bosto2n
+.br8o8w8n9i8a8n.
+.brown5i
+.brow3n4i1a
+.browni3a2n
+.br8u8n8s9w8i8c8k.
+.bru2n
+.bru2n3s4
+.brun4sw2
+.brunswi2
+.brunswick1
+.bu9d8a9p8e8s8t.
+.bu1d2a
+.ca8r9i8b9b8e8a8n.
+.car1i
+.car4ib
+.cari2b1b
+.carib2be
+.caribbea2n
+.ch8a8r8l8e8s9t8o8n.
+.char4le4
+.char1l
+.charles2
+.charl4es2to
+.charle3sto2n
+.ch8a8r9l8o8t8t8e8s9v8i8l8l8e.
+.char3lo4
+.charlo4t3t2
+.charlot4tes
+.charlotte4sv
+.charlottes2vil
+.charlottesvil1l
+.charlottesvil2le
+.co9l8u8m9b8i8a.
+.colum4bi
+.colu4m1b
+.columb2i1a
+.cz8e8c8h8o9s8l8o9v8a9k8i8a.
+.c2ze4
+.cze2ch
+.cze3cho2
+.czechos4l2
+.czechos4lov
+.czechoslo1va
+.czechoslovak1i
+.czechoslovak2i1a
+.de8l9a9w8a8r8e.
+.de1la
+.de4law
+.delaw2a2r
+.di8j8k9s8t8r8a.
+.di3j
+.dij4k1s2
+.dijkst4r
+.dijks1tra
+.du8a8n8e.
+.d1u1a
+.dua2n
+.dy9n8a9m8i9s8c8h8e.
+.5dyn
+.dy1na
+.dynam2is
+.dynam2is1c
+.dynamis3ch2
+.dynamische2
+.en8g9l8i8s8h.
+.engl2
+.englis2h
+.eu8l8e8r9i8a8n.
+.eul4e
+.eu3l4er1i
+.eule1r2i3a4
+.euleri2a2n
+.ev8a8n9s8t8o8n.
+.e1va
+.eva2n
+.evan4st
+.eva2n1s2
+.evans1to
+.evansto2n
+.fe8b9r8u9a8r8y.
+.f2e4b
+.fe3br
+.febru3a
+.febru2a2r
+.fe8s8t9s8c8h8r8i8f8t.
+.fes4t1s2
+.fest4sc
+.fests2ch2
+.festsc4hr4
+.festschr4i2ft
+.fl8o8r9i9d8a.
+.flor2id
+.flori1d2a
+.fl8o8r9i9d8a.
+.flor2id
+.flori1d2a
+.fl8o8r9i9d9i8a8n.
+.flori2di
+.florid5i2a2n
+.flori1d4i3a
+.fl8o8r9i9d9i8a8n.
+.flori2di
+.florid5i2a2n
+.flori1d4i3a
+.fo8r9s8c8h8u8n8g8s9i8n9s8t8i9t8u8t.
+.fors4c
+.fors2ch2
+.forschungs2
+.forschung2s1in
+.forschungs2i2n1s2
+.forschungsinst2i
+.forschungsinsti1tu
+.fr8e8e9b8s8d.
+.fre2e1b
+.free2b5s2
+.freeb4s5d
+.fu8n8k9t8s8i8o8n8a8l.
+.3fu
+.fu4nk2
+.funk5t
+.funk4t1s2
+.funkt1s2io
+.funkt5sio2n
+.funktsio1n5a
+.ga8u8s8s9i8a8n.
+.ga2us
+.gau2ss
+.gaus1si
+.gauss2i1a
+.gaussi2a2n
+.gh8o8s8t9s8c8r8i8p8t.
+.ghos4t1s2
+.ghost4sc
+.ghostscri2
+.ghostscr2ip
+.ghostscri2p1t
+.gh8o8s8t9v8i8e8w.
+.ghos4tv
+.ghostv2ie4
+.gr8a8s8s9m8a8n8n9i8a8n.
+.gr2as
+.gra2ss
+.gras2s1m
+.grass3ma
+.grassma2n3
+.grassma4n1n2
+.grassman3n4i1a
+.grassma2nni3a2n
+.gr8e8i8f8s9w8a8l8d.
+.grei2
+.grei2f3s
+.greifsw2
+.greifswa2ld
+.gr8o8t8h8e8n9d8i8e8c8k.
+.g4ro
+.gro4th2e
+.gr4oth
+.grothe2n
+.grothend2ie4
+.grothendieck1
+.gr8u8n8d9l8e8h9r8e8n.
+.gru2n
+.grundle1h4
+.grundle4hr4
+.ha9d8a9m8a8r8d.
+.ha2d
+.ha1d2a
+.hada2m2
+.had4a1ma
+.hadam2a2r
+.ha8i9f8a.
+.hai1fa
+.ha8m8i8l9t8o8n9i8a8n.
+.ha4m
+.hami4lt
+.hamil1to
+.hamilto2n
+.hamilto3n4i1a
+.hamiltoni3a2n
+.he8l9s8i8n8k8i.
+.he2l1s2
+.hel2s1in
+.hels4i4nk2
+.helsink1i
+.he8r9m8i8t9i8a8n.
+.her3mit
+.hermi1ti
+.herm4i1t2i1a
+.hermiti2a2n
+.hi8b8b8s.
+.hi2b1b
+.hib2b5s2
+.ho8k9k8a8i9d8o.
+.h2ok
+.hokk4
+.hokkai2
+.hokka2id
+.hokkai1do
+.ja8c9k8o8w9s8k8i.
+.5ja
+.jack1
+.jackowsk2
+.jackowsk1i
+.ja8n9u9a8r8y.
+.ja2n
+.jan3u1a
+.janu2a2r
+.ja9p8a9n8e8s8e.
+.ja4p
+.ja1pa
+.japa2n
+.japa1nes
+.japane1s2e
+.ka8d9o8m9t8s8e8v.
+.ka2d
+.ka1do
+.kado4mt
+.kadom4t1s2
+.kadomt5sev
+.ka8n9s8a8s.
+.ka2n
+.kan2sa2
+.ka2n1s2
+.ka8r8l8s9r8u8h8e.
+.k2a2r
+.kar1l
+.kar2l1s2
+.karls1r
+.ko8r9t8e9w8e8g.
+.ko5r
+.kr8i8s8h8n8a.
+.kr2is
+.kr3is2h
+.kris2h1n
+.krish1na
+.kr8i8s8h9n8a9i8s8m.
+.krishnai2
+.krishnai2s1m
+.kr8i8s8h9n8a8n.
+.krishn2a2n
+.la8n9c8a8s9t8e8r.
+.lan1ca
+.lancast5er
+.le9g8e8n8d8r8e.
+.le1gen
+.legen1dr
+.legendre4
+.le8i8c8e8s9t8e8r.
+.lei2
+.le5ic
+.leices5t
+.li8p9s8c8h8i8t8z.
+.l2ip
+.li2p1s2
+.lips2ch2
+.lips3chit
+.lipschi4tz
+.li8p9s8c8h8i8t8z9i8a8n.
+.lipschit2z1i
+.lipschitz2i1a
+.lipschitzi2a2n
+.lo8j9b8a8n.
+.lo5j
+.lojba2n
+.lo8u9i9s8i9a8n8a.
+.lou2
+.lo2ui2
+.louis2i1a
+.louisi2a2n
+.louisia1na
+.ma8c9o8s.
+.ma1co
+.ma8n9c8h8e8s9t8e8r.
+.man2ch
+.manche2
+.manch1es
+.ma8r9k8o8v9i8a8n.
+.marko5vi2a2n
+.markov2i1a
+.ma8r8k8t9o8b8e8r9d8o8r8f.
+.mark5t
+.mark1to
+.markto3b
+.marktober1do
+.marktoberd4or
+.marktoberdor1f
+.ma8s8s9a9c8h8u9s8e8t8t8s.
+.ma2ss
+.mas1sa2
+.massa2ch
+.massach2us
+.massachuse4t3t2
+.massachuset4t1s2
+.ma8x9w8e8l8l.
+.maxwel4l
+.mi9c8r8o9s8o8f8t.
+.micro2so
+.microso2ft3
+.mi8n9n8e9a8p9o9l8i8s.
+.m2i4n1n2
+.minne4
+.minneapol2i
+.mi8n9n8e9s8o8t8a.
+.min1nes
+.minne1so
+.minneso1ta
+.mo8s9c8o8w.
+.mos2c
+.mos1co
+.na8c8h9r8i8c8h8t8e8n.
+.1na
+.na2ch
+.nac4hr4
+.na2chr4i2ch
+.nachricht1en
+.na8s8h9v8i8l8l8e.
+.n4as
+.nas2h
+.nash2vil
+.nashvil1l
+.nashvil2le
+.ne8t9b8s8d.
+.ne2t1b
+.net2b5s2
+.netb4s5d
+.ne8t9s8c8a8p8e.
+.ne4t1s2
+.net4sc
+.netsca4p
+.nets1ca
+.ni8j9m8e9g8e8n.
+.ni3j
+.nijme2g
+.nijme1gen
+.no8e9t8h8e8r9i8a8n.
+.3noe
+.noeth2e
+.noether1i
+.noethe1r2i3a4
+.noetheri2a2n
+.no8o8r8d9w8i8j8k8e8r9h8o8u8t.
+.noo2
+.no3ord
+.noord1w
+.noordwi2
+.noordwi3j
+.noordwijk1er
+.noordwijker1h4
+.noordwijkerhou2
+.no9v8e8m9b8e8r.
+.nove4m5b
+.op8e8n9b8s8d.
+.ope4n1b4
+.open2b5s2
+.openb4s5d
+.op8e8n9o8f8f8i8c8e.
+.op4eno
+.openo4f1f
+.openof1fi
+.op8e8n9o8ffi8c8e.
+.pa8l8a9t8i8n8o.
+.pala2t1in
+.palat2i1no
+.pa9l8e8r9m8o.
+.paler3m4
+.paler1mo
+.pe9t8r8o8v9s8k8i.
+.petro3v
+.petrovsk2
+.petrovsk1i
+.pf8a8f8f9i8a8n.
+.4pf
+.p1fa
+.pfa2f
+.pfa4f1f4
+.pfaf1fi
+.pfaff2i3a
+.pfaffi2a2n
+.pf8a8ffi8a8n.
+.pfaffia2n
+.ph8i8l9a9d8e8l9p8h8i8a.
+.phi4l4ade
+.phila2d
+.philade2lp
+.philadel5phi
+.philadelph2i1a
+.ph8i8l9o9s8o8p8h9i9s8c8h8e.
+.philo2so
+.philos4op
+.philos2oph
+.philosoph2is1c
+.philosophis3ch2
+.philosophische2
+.po8i8n9c8a8r8e.
+.poin2
+.poi2
+.poinc2a2r5
+.poin1ca
+.po9t8e8n9t8i8a8l9g8l8e8i9c8h8u8n8g.
+.p4ot
+.po1ten1t
+.potent2i
+.poten1t2i1a
+.potenti2al
+.potentia4l1g4
+.potentialgl2
+.potential1gle
+.potentialglei2
+.potentialgle5ic
+.potentialgle4i2ch
+.ra9d8h8a9k8r8i8s8h9n8a8n.
+.rad1h2
+.radhakr2is
+.radhakr3is2h
+.radhakris2h1n
+.radhakrish1na
+.radhakrishn2a2n
+.ra8t8h8s9k8e8l9l8e8r.
+.r4ath
+.ra2t4h1s2
+.rathsk2
+.rath4ske
+.rathskel1l
+.rathskel2le
+.ri8e9m8a8n8n9i8a8n.
+.r2ie4
+.rie5ma2n
+.rie1ma
+.riema4n1n2
+.rieman3n4i1a
+.riema2nni3a2n
+.ry8d9b8e8r8g.
+.ry1d
+.ryd1b
+.rydberg2
+.sc8h8o8t9t8i8s8c8h8e.
+.scho4t3t2
+.schott2is1c
+.s2ch2ottis3ch2
+.schottische2
+.sc8h8r8o9d8i8n8g9e8r.
+.sc4hr4
+.schrod1in
+.schrod4inge
+.sc8h8w8a9b8a9c8h8e8r.
+.sch1w
+.s2chwaba2ch
+.schwabache2
+.sc8h8w8a8r8z9s8c8h8i8l8d.
+.schw2a2r
+.s2ch2warzs2ch2
+.schwarzsch4il2
+.schwarzschi2ld
+.se8p9t8e8m9b8e8r.
+.se2p1t
+.sep2te
+.septe4m5b
+.st8o8k8e8s9s8c8h8e.
+.st2ok
+.stokes4
+.stok2e2ss
+.stokes2s5c
+.stokess2ch2
+.stokessche2
+.st8u8t8t9g8a8r8t.
+.stu4t3t2
+.stut4t1g
+.stutt1ga
+.stuttg2a2r
+.su8s9q8u8e9h8a8n9n8a.
+.s2us
+.susqu2
+.susque1h4
+.susqueha2n
+.susqueha4n1n2
+.susquehan1na
+.ta8u9b8e8r9i8a8n.
+.tau4b
+.taub4e
+.tau3ber
+.tauber1i
+.taube1r2i3a4
+.tauberi2a2n
+.te8c8h9n8i9s8c8h8e.
+.te2ch
+.tec2h1n
+.techn2is1c
+.te2chnis3ch2
+.technische2
+.te8n9n8e8s9s8e8e.
+.t4e4n1n2
+.tenne4
+.ten1nes
+.tenn2e2ss
+.to9m8a9s8z8e8w9s8k8i.
+.to2ma
+.tomas2ze
+.tomaszewsk2
+.tomaszewsk1i
+.ty9p8o9g8r8a8p8h8i8q8u8e.
+.ty3po
+.ty5po4g
+.typo1gr
+.typogr4aphi
+.typographiqu2
+.uk8r8a8i8n9i8a8n.
+.4uk
+.ukr2ai2
+.ukra4i4n
+.ukra2ini
+.ukrai4n4i1a
+.ukraini3a2n
+.ve8r9a8l8l9g8e9m8e8i8n9e8r8t8e.
+.veral1l
+.veral4l1g4
+.verallge1me
+.verallgemei2
+.verallgeme2ine
+.verallgemein1er
+.ve8r9e8i8n9i9g8u8n8g.
+.vere3in
+.verei2
+.vere2ini
+.verein2ig
+.vereini3gun
+.ve8r9t8e8i9l8u8n9g8e8n.
+.vertei2
+.verteilun1gen
+.vi8i8i8t8h.
+.v4i5i4
+.v4i5i5i4
+.vii2ith
+.vi8i8t8h.
+.vi2ith
+.wa8h8r9s8c8h8e8i8n9l8i8c8h9k8e8i8t8s9t8h8e8o9r8i8e.
+.wa4hr4
+.wah4rs2
+.wahrs4c
+.wahrs2ch2
+.wahrsche2
+.wahrschei2
+.wahrsche4i4n1l
+.wahrs2cheinl4i2ch
+.wahrscheinlic4hk
+.wahrschei2nlichkei2
+.wahrscheinlichkei4t1s2
+.wahrscheinlichkeits3th2e
+.wahrscheinlichkeitsthe1o5r
+.wahrscheinlichkeitstheor2ie4
+.we8r9n8e8r.
+.w1er
+.wer4n1er
+.we8r9t8h8e8r9i8a8n.
+.werth2e
+.werther1i
+.werthe1r2i3a4
+.wertheri2a2n
+.wi8n9c8h8e8s9t8e8r.
+.win2ch
+.winche2
+.winch1es
+.wi8r8t9s8c8h8a8f8t.
+.w4ir4
+.wir4t1s2
+.wirt4sc
+.wirts2ch2
+.wirtscha2f
+.wirtscha2ft
+.wi8s9s8e8n9s8c8h8a8f8t9l8i8c8h.
+.w4i2s1s
+.wissen4
+.wisse2n1s2
+.wissens4c
+.wissens2ch2
+.wissenscha2f
+.wissenscha2ft
+.wissenschaf2tl
+.wissens2chaftl4i2ch
+.xv8i8i8i8t8h.
+.xv4i5i4
+.xv4i5i5i4
+.xvii2ith
+.xv8i8i8t8h.
+.xvi2ith
+.xx8i8i8i8r8d.
+.xx4
+.xx3i
+.xx4i5i4
+.xx4i5i5i4
+.xxii4ir
+.xx8i8i8n8d.
+.xxi4ind
+.yi8n8g9y8o8n8g.
+.y1i
+.yin2gy
+.yingy1o4
+.yingyo2n
+.sh8u9x8u8e.
+.shux1u3
+.ji9s8u8a8n.
+.ji2su
+.jisua2n
+.ze8a9l8a8n8d.
+.2ze
+.zea4l
+.zea3l4and
+.zeala2n
+.ze8i8t9s8c8h8r8i8f8t.
+.zei2
+.zei4t1s2
+.zeit4sc
+.zeits2ch2
+.zeitsc4hr4
+.zeitschr4i2ft
+.affin9i1ty
+.affin2it
+.affin9ity's
+.daffi9est
+.daffie
+.de9fi9ance
+.defi1a
+.defi2a2n
+.defianc
+.de9fi9ance's
+.de9fi9an4t
+.de9fi9ant1ly
+.defian2tl
+.defic8i4t1s2
+.de4fic
+.d5efi1ci
+.defi2c1it
+.de9fil9ing
+.defil4
+.defil1i
+.fi9ancé
+.fi1a
+.fi2a2n
+.fianc
+.fi9ancé's
+.fi9ancée
+.fi9ancées
+.fi9ancés
+.fil9i9buster
+.fil1i
+.fil2ib
+.fili5bust
+.filib2us
+.fil9i9buster's
+.fil9i9bus9te2r2ed
+.filibus5tere
+.fil9i9bus9ter9in4g
+.filibus1ter1i
+.fil9i9buste4r1s2
+.fil9i9gree
+.fil2ig
+.fili5gre
+.fili1gr
+.fil9i9gree's
+.fil9i9greed
+.fil9i9gree9ing
+.filigreei2
+.fil9i9gree2s4
+.fin8der
+.find
+.fin1de
+.fin8der's
+.find9e4r5s2
+.fin8n1er
+.fi4n1n2
+.finne4
+.fin8ni4er
+.finn2ie4
+.fin8ni9est
+.fis8ticuff3s
+.fis1t2i
+.fis1tic
+.fist4ic1u
+.fistic4u4ff
+.fluffi9est
+.fluffie
+.fly9lea2f
+.fly
+.flyle2a
+.fly9leaf's
+.fly9leav4e2s
+.flylea2v
+.fly9sheet
+.flys4
+.flys2h
+.fly9speck1
+.flyspe2c
+.fly9speck's
+.fly9speck2ed
+.fly9speck9in4g
+.flyspeck3i
+.fly9spec4k1s2
+.fly9swat9ter
+.flysw2
+.flyswat5te
+.flyswa4t3t2
+.fly9swat9te4r1s2
+.huffi9est
+.huffie
+.iffi9est
+.iffie
+.puffi9est
+.puffie
+.re9fil9ing
+.re3fi
+.refil4
+.refil1i
+.scruffi9est
+.scruffie
+.spiffi9est
+.spiffie
+.stuffi9est
+.stuffie
+.viewfin8der
+.v2ie4
+.view1fi
+.view2fin
+.viewfind
+.viewfin1de
+.viewfin8der's
+.viewfind9e4r5s2
+.affin9ityffis
+.de9fi9anceffis
+.fi9ancéffis
+.fil9i9busterffis
+.fil9i9greeffis
+.fin8derffis
+.fly9leafffis
+.fly9speckffis
+.viewfin8derffis
diff --git a/src/tests/evas/evas_suite.c b/src/tests/evas/evas_suite.c
index 78fe314c9a..e84d23f5dc 100644
--- a/src/tests/evas/evas_suite.c
+++ b/src/tests/evas/evas_suite.c
@@ -10,6 +10,7 @@
static const Efl_Test_Case etc[] = {
{ "Evas", evas_test_init },
+ { "Evas New", evas_test_new },
{ "Object", evas_test_object },
{ "Object Textblock", evas_test_textblock },
{ "Object Text", evas_test_text },
@@ -17,7 +18,11 @@ static const Efl_Test_Case etc[] = {
{ "Render Engines", evas_test_render_engines },
{ "Filters", evas_test_filters },
{ "Images", evas_test_image_object },
+ { "Images", evas_test_image_object2 },
{ "Meshes", evas_test_mesh },
+ { "Meshes", evas_test_mesh1 },
+ { "Meshes", evas_test_mesh2 },
+ { "Meshes", evas_test_mesh3 },
{ "Masking", evas_test_mask },
{ "Evas GL", evas_test_evasgl },
{ "Object Smart", evas_test_object_smart },
@@ -25,6 +30,18 @@ static const Efl_Test_Case etc[] = {
{ NULL, NULL }
};
+SUITE_INIT(evas)
+{
+ ck_assert_int_eq(evas_init(), 1);
+ ck_assert_int_eq(ecore_evas_init(), 1);
+}
+
+SUITE_SHUTDOWN(evas)
+{
+ ck_assert_int_eq(ecore_evas_shutdown(), 0);
+ ck_assert_int_eq(evas_shutdown(), 0);
+}
+
int
main(int argc, char **argv)
{
@@ -37,12 +54,8 @@ main(int argc, char **argv)
putenv("EFL_RUN_IN_TREE=1");
#endif
- ecore_evas_init();
-
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
- "Evas", etc);
-
- ecore_evas_shutdown();
+ "Evas", etc, SUITE_INIT_FN(evas), SUITE_SHUTDOWN_FN(evas));
return (failed_count == 0) ? 0 : 255;
}
diff --git a/src/tests/evas/evas_suite.h b/src/tests/evas/evas_suite.h
index cb22dd4762..0da47fe13f 100644
--- a/src/tests/evas/evas_suite.h
+++ b/src/tests/evas/evas_suite.h
@@ -2,8 +2,9 @@
#define _EVAS_SUITE_H
#include <check.h>
-
+#include "../efl_check.h"
void evas_test_init(TCase *tc);
+void evas_test_new(TCase *tc);
void evas_test_object(TCase *tc);
void evas_test_textblock(TCase *tc);
void evas_test_text(TCase *tc);
@@ -11,7 +12,11 @@ void evas_test_callbacks(TCase *tc);
void evas_test_render_engines(TCase *tc);
void evas_test_filters(TCase *tc);
void evas_test_image_object(TCase *tc);
+void evas_test_image_object2(TCase *tc);
void evas_test_mesh(TCase *tc);
+void evas_test_mesh1(TCase *tc);
+void evas_test_mesh2(TCase *tc);
+void evas_test_mesh3(TCase *tc);
void evas_test_mask(TCase *tc);
void evas_test_evasgl(TCase *tc);
void evas_test_object_smart(TCase *tc);
diff --git a/src/tests/evas/evas_test_callbacks.c b/src/tests/evas/evas_test_callbacks.c
index c871276f65..0b61ca55a2 100644
--- a/src/tests/evas/evas_test_callbacks.c
+++ b/src/tests/evas/evas_test_callbacks.c
@@ -25,7 +25,6 @@ do \
{ \
evas_object_del(rect); \
evas_free(evas); \
- ecore_evas_shutdown(); \
} \
while (0)
@@ -43,7 +42,7 @@ _obj_event_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
counter++;
}
-START_TEST(evas_object_event_callbacks_priority)
+EFL_START_TEST(evas_object_event_callbacks_priority)
{
START_CALLBACK_TEST();
counter = 1;
@@ -93,7 +92,7 @@ START_TEST(evas_object_event_callbacks_priority)
END_CALLBACK_TEST();
}
-END_TEST
+EFL_END_TEST
static void
_event_cb(void *data, Evas *e, void *event_info)
@@ -106,7 +105,7 @@ _event_cb(void *data, Evas *e, void *event_info)
counter++;
}
-START_TEST(evas_event_callbacks_priority)
+EFL_START_TEST(evas_event_callbacks_priority)
{
START_CALLBACK_TEST();
evas_object_focus_set(rect, EINA_FALSE);
@@ -144,7 +143,7 @@ START_TEST(evas_event_callbacks_priority)
END_CALLBACK_TEST();
}
-END_TEST
+EFL_END_TEST
void evas_test_callbacks(TCase *tc)
{
diff --git a/src/tests/evas/evas_test_evasgl.c b/src/tests/evas/evas_test_evasgl.c
index 67f39de598..603ed874f1 100644
--- a/src/tests/evas/evas_test_evasgl.c
+++ b/src/tests/evas/evas_test_evasgl.c
@@ -42,7 +42,6 @@ _detect_osmesa(void)
Ecore_Evas *ee; Evas *evas; Evas_Object *im = NULL; \
if (!strcmp(engine, "buffer") && !_detect_osmesa()) return; \
putenv("EVAS_GL_API_DEBUG=1"); \
- ecore_evas_init(); \
if (!options || !strcmp(engine, "buffer")) ee = ecore_evas_new(engine, 0, 0, 1, 1, NULL); \
else ee = ecore_evas_gl_x11_options_new(NULL, 0, 0, 0, 1, 1, options); \
if (!ee) { printf("Could not create ecore evas. Skipping Evas GL tests.\n"); \
@@ -60,7 +59,6 @@ _detect_osmesa(void)
init_failed: \
evas_object_del(im); \
ecore_evas_free(ee); \
- ecore_evas_shutdown(); \
do {} while (0)
static void
@@ -479,12 +477,12 @@ _test_evasgl_formats(const char *engine)
}
#define TEST_ADD_OPT(name, opt) \
- START_TEST(evas ## name ## _opengl_x11) \
+ EFL_START_TEST(evas ## name ## _opengl_x11) \
{ name("opengl_x11"); } \
- END_TEST \
- START_TEST(evas ## name ## _buffer) \
+ EFL_END_TEST \
+ EFL_START_TEST(evas ## name ## _buffer) \
{ name("buffer"); } \
- END_TEST
+ EFL_END_TEST
#define TEST_ADD(name) TEST_ADD_OPT(name, NULL)
TEST_ADD(_test_evasgl_init)
diff --git a/src/tests/evas/evas_test_filters.c b/src/tests/evas/evas_test_filters.c
index 6095c63a2a..f3c5fa8426 100644
--- a/src/tests/evas/evas_test_filters.c
+++ b/src/tests/evas/evas_test_filters.c
@@ -25,7 +25,6 @@
Ecore_Evas *ee; Evas *evas; \
Evas_Object *to; \
setenv("EVAS_DATA_DIR", EVAS_DATA_DIR, 1); \
- ecore_evas_init(); \
ee = ecore_evas_buffer_new(1, 1); \
ecore_evas_show(ee); \
ecore_evas_manual_render_set(ee, EINA_TRUE); \
@@ -41,7 +40,6 @@
#define END_FILTER_TEST() \
evas_object_del(to); \
ecore_evas_free(ee); \
- ecore_evas_shutdown(); \
do {} while (0)
#ifdef LITTLE_ENDIAN
@@ -61,7 +59,7 @@
#endif
-START_TEST(evas_filter_parser)
+EFL_START_TEST(evas_filter_parser)
{
Evas_Filter_Program *pgm;
@@ -196,7 +194,7 @@ START_TEST(evas_filter_parser)
// fillmodes are parsed when converting from instructions to commands
}
-END_TEST
+EFL_END_TEST
struct Filter_Test_Case {
int l, r, t, b;
@@ -278,7 +276,7 @@ static struct Filter_Test_Case _test_cases[] = {
static const int _test_cases_count = sizeof(_test_cases) / sizeof(_test_cases[0]);
-START_TEST(evas_filter_text_padding_test)
+EFL_START_TEST(evas_filter_text_padding_test)
{
START_FILTER_TEST();
Evas_Coord x, y, w, h, W, H;
@@ -308,7 +306,7 @@ START_TEST(evas_filter_text_padding_test)
END_FILTER_TEST();
}
-END_TEST
+EFL_END_TEST
/* This will only check that all pixels are valid premultiplied values
* and that they are not all zero.
@@ -344,7 +342,7 @@ _ecore_evas_pixels_check(Ecore_Evas *ee)
return nonzero;
}
-START_TEST(evas_filter_text_render_test)
+EFL_START_TEST(evas_filter_text_render_test)
{
Evas_Filter_Program *pgm;
@@ -408,7 +406,7 @@ START_TEST(evas_filter_text_render_test)
}
}
-END_TEST
+EFL_END_TEST
static inline Eina_Bool
strequal(const char *a, const char *b)
@@ -418,7 +416,7 @@ strequal(const char *a, const char *b)
return !strcmp(a, b);
}
-START_TEST(evas_filter_state_test)
+EFL_START_TEST(evas_filter_state_test)
{
/* dumb code testing state values */
static const char *code =
@@ -458,7 +456,7 @@ START_TEST(evas_filter_state_test)
END_FILTER_TEST();
}
-END_TEST
+EFL_END_TEST
void evas_test_filters(TCase *tc)
{
diff --git a/src/tests/evas/evas_test_image.c b/src/tests/evas/evas_test_image.c
index 392084145a..bbe64654af 100644
--- a/src/tests/evas/evas_test_image.c
+++ b/src/tests/evas/evas_test_image.c
@@ -38,10 +38,6 @@ static const char *exts[] = {
#ifdef BUILD_LOADER_WEBP
,"webp"
#endif
-#ifdef BUILD_LOADER_JPEG
- ,"jpeg"
- ,"jpg"
-#endif
#ifdef BUILD_LOADER_TGV
,"tgv"
#endif
@@ -49,9 +45,16 @@ static const char *exts[] = {
,"jp2"
,"j2k"
#endif
+/* ADD NEW FORMATS HERE
+ * JPEG MUST BE LAST
+ */
+#ifdef BUILD_LOADER_JPEG
+ ,"jpeg"
+ ,"jpg"
+#endif
};
-START_TEST(evas_object_image_loader)
+EFL_START_TEST(evas_object_image_loader)
{
Evas *e = _setup_evas();
Evas_Object *o;
@@ -87,9 +90,8 @@ START_TEST(evas_object_image_loader)
evas_object_del(o);
evas_free(e);
- ecore_evas_shutdown();
}
-END_TEST
+EFL_END_TEST
typedef struct _Orientation_Test_Res Orientation_Test_Res;
struct _Orientation_Test_Res {
@@ -236,7 +238,7 @@ static int _compare_img_transverse(const uint32_t *d1, const uint32_t *d2, int w
return 0;
}
-START_TEST(evas_object_image_loader_orientation)
+EFL_START_TEST(evas_object_image_loader_orientation)
{
Evas *e = _setup_evas();
Evas_Object *orig, *rot;
@@ -282,11 +284,10 @@ START_TEST(evas_object_image_loader_orientation)
evas_object_del(rot);
evas_free(e);
- ecore_evas_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(evas_object_image_orient)
+EFL_START_TEST(evas_object_image_orient)
{
Evas *e = _setup_evas();
Evas_Object *orig;
@@ -332,12 +333,11 @@ START_TEST(evas_object_image_orient)
evas_object_del(orig);
evas_free(e);
- ecore_evas_shutdown();
}
-END_TEST
+EFL_END_TEST
#ifdef BUILD_LOADER_TGV
-START_TEST(evas_object_image_tgv_loader_data)
+EFL_START_TEST(evas_object_image_tgv_loader_data)
{
Evas *e = _setup_evas();
Evas_Object *obj, *ref;
@@ -390,85 +390,78 @@ START_TEST(evas_object_image_tgv_loader_data)
eina_strbuf_free(str);
evas_free(e);
- ecore_evas_shutdown();
}
-END_TEST
+EFL_END_TEST
#endif
-START_TEST(evas_object_image_all_loader_data)
+EFL_START_TEST(evas_object_image_all_loader_data)
{
Evas *e = _setup_evas();
Evas_Object *obj, *ref;
Eina_Strbuf *str;
- unsigned int i;
+ struct stat st;
+ int w, h, s, r_w, r_h, r_s;
+ const uint32_t *d, *r_d;
+ Evas_Colorspace c, r_c;
obj = evas_object_image_add(e);
ref = evas_object_image_add(e);
str = eina_strbuf_new();
- for (i = 0; i < sizeof (exts) / sizeof (exts[0]); i++)
- {
- struct stat st;
- int w, h, s, r_w, r_h, r_s;
- const uint32_t *d, *r_d;
- Evas_Colorspace c, r_c;
-
- eina_strbuf_reset(str);
+ eina_strbuf_reset(str);
- eina_strbuf_append_printf(str, "%s/Pic4-%s.png", TESTS_IMG_DIR, exts[i]);
+ eina_strbuf_append_printf(str, "%s/Pic4-%s.png", TESTS_IMG_DIR, exts[_i]);
- if (stat(eina_strbuf_string_get(str), &st) != 0) continue;
+ if (stat(eina_strbuf_string_get(str), &st) != 0) goto end;
- evas_object_image_file_set(obj, eina_strbuf_string_get(str), NULL);
- fail_if(evas_object_image_load_error_get(obj) != EVAS_LOAD_ERROR_NONE);
- evas_object_image_size_get(obj, &w, &h);
- s = evas_object_image_stride_get(obj);
- c = evas_object_image_colorspace_get(obj);
- d = evas_object_image_data_get(obj, EINA_FALSE);
+ evas_object_image_file_set(obj, eina_strbuf_string_get(str), NULL);
+ fail_if(evas_object_image_load_error_get(obj) != EVAS_LOAD_ERROR_NONE);
+ evas_object_image_size_get(obj, &w, &h);
+ s = evas_object_image_stride_get(obj);
+ c = evas_object_image_colorspace_get(obj);
+ d = evas_object_image_data_get(obj, EINA_FALSE);
- eina_strbuf_reset(str);
+ eina_strbuf_reset(str);
- eina_strbuf_append_printf(str, "%s/Pic4.%s", TESTS_IMG_DIR, exts[i]);
- evas_object_image_file_set(ref, eina_strbuf_string_get(str), NULL);
- fail_if(evas_object_image_load_error_get(ref) != EVAS_LOAD_ERROR_NONE);
- evas_object_image_size_get(ref, &r_w, &r_h);
- r_s = evas_object_image_stride_get(ref);
- r_c = evas_object_image_colorspace_get(ref);
- r_d = evas_object_image_data_get(ref, EINA_FALSE);
+ eina_strbuf_append_printf(str, "%s/Pic4.%s", TESTS_IMG_DIR, exts[_i]);
+ evas_object_image_file_set(ref, eina_strbuf_string_get(str), NULL);
+ fail_if(evas_object_image_load_error_get(ref) != EVAS_LOAD_ERROR_NONE);
+ evas_object_image_size_get(ref, &r_w, &r_h);
+ r_s = evas_object_image_stride_get(ref);
+ r_c = evas_object_image_colorspace_get(ref);
+ r_d = evas_object_image_data_get(ref, EINA_FALSE);
- fail_if(w != r_w || h != r_h);
- fail_if(s != r_s);
- fail_if(c != r_c);
- fail_if(w*4 != s);
- if (strcmp(exts[i], "jpeg") == 0 || strcmp(exts[i], "jpg") == 0)
+ fail_if(w != r_w || h != r_h);
+ fail_if(s != r_s);
+ fail_if(c != r_c);
+ fail_if(w*4 != s);
+ if (strcmp(exts[_i], "jpeg") == 0 || strcmp(exts[_i], "jpg") == 0)
+ {
+ //jpeg norm allows a variation of 1 bit per component
+ for (int j = 0; j < s * h; j++)
{
- //jpeg norm allows a variation of 1 bit per component
- for (int j = 0; j < s * h; j++)
- {
- fail_if(abs(((char*)d)[j] - ((char*)r_d)[j]) > 1);
- }
- }
- else
- {
- fail_if(memcmp(d, r_d, w * h * 4));
+ fail_if(abs(((char*)d)[j] - ((char*)r_d)[j]) > 1);
}
}
-
+ else
+ {
+ fail_if(memcmp(d, r_d, w * h * 4));
+ }
+end:
evas_object_del(obj);
evas_object_del(ref);
eina_strbuf_free(str);
evas_free(e);
- ecore_evas_shutdown();
}
-END_TEST
+EFL_END_TEST
const char *buggy[] = {
"BMP301K"
};
-START_TEST(evas_object_image_buggy)
+EFL_START_TEST(evas_object_image_buggy)
{
Evas *e = _setup_evas();
Evas_Object *obj, *ref;
@@ -521,9 +514,8 @@ START_TEST(evas_object_image_buggy)
eina_strbuf_free(str);
evas_free(e);
- ecore_evas_shutdown();
}
-END_TEST
+EFL_END_TEST
static void check_rotate_region(Evas_Image_Orient orientation, int *r_x, int *r_y, int *r_w, int *r_h, int w, int h)
{
@@ -579,7 +571,7 @@ static void check_rotate_region(Evas_Image_Orient orientation, int *r_x, int *r_
}
-START_TEST(evas_object_image_partially_load_orientation)
+EFL_START_TEST(evas_object_image_partially_load_orientation)
{
static const Orientation_Test_Res res[] = {
{ TESTS_IMG_DIR"/Light_exif.jpg", "Original", EVAS_IMAGE_ORIENT_NONE, _compare_img },
@@ -632,11 +624,10 @@ START_TEST(evas_object_image_partially_load_orientation)
evas_object_del(orig);
evas_free(e);
- ecore_evas_shutdown();
}
-END_TEST
+EFL_END_TEST
-START_TEST(evas_object_image_defaults)
+EFL_START_TEST(evas_object_image_defaults)
{
Evas *e = _setup_evas();
Evas_Object *o;
@@ -659,12 +650,11 @@ START_TEST(evas_object_image_defaults)
efl_del(o);
evas_free(e);
- ecore_evas_shutdown();
}
-END_TEST
+EFL_END_TEST
// FIXME: belongs to another file
-START_TEST(evas_object_image_map_unmap)
+EFL_START_TEST(evas_object_image_map_unmap)
{
Evas *e = _setup_evas();
Evas_Object *o, *o2;
@@ -823,12 +813,11 @@ START_TEST(evas_object_image_map_unmap)
// TODO: test more color conversions
evas_free(e);
- ecore_evas_shutdown();
}
-END_TEST
+EFL_END_TEST
#if BUILD_LOADER_JP2K
-START_TEST(evas_object_image_jp2k_loader_data)
+EFL_START_TEST(evas_object_image_jp2k_loader_data)
{
Evas *e = _setup_evas();
Evas_Object *obj, *ref;
@@ -875,9 +864,8 @@ START_TEST(evas_object_image_jp2k_loader_data)
eina_strbuf_free(str);
evas_free(e);
- ecore_evas_shutdown();
}
-END_TEST
+EFL_END_TEST
#endif
void evas_test_image_object(TCase *tc)
@@ -893,9 +881,25 @@ void evas_test_image_object(TCase *tc)
# if BUILD_LOADER_JP2K
tcase_add_test(tc, evas_object_image_jp2k_loader_data);
# endif
- tcase_add_test(tc, evas_object_image_all_loader_data);
+#ifdef BUILD_LOADER_JPEG
+ /* jpeg takes forever from manual value comparisons */
+ tcase_add_loop_test(tc, evas_object_image_all_loader_data, 0, EINA_C_ARRAY_LENGTH(exts) - 2);
+#else
+ tcase_add_loop_test(tc, evas_object_image_all_loader_data, 0, EINA_C_ARRAY_LENGTH(exts));
+#endif
tcase_add_test(tc, evas_object_image_buggy);
tcase_add_test(tc, evas_object_image_map_unmap);
#endif
tcase_add_test(tc, evas_object_image_partially_load_orientation);
}
+
+
+void evas_test_image_object2(TCase *tc)
+{
+#if BUILD_LOADER_PNG
+#ifdef BUILD_LOADER_JPEG
+ /* jpeg takes forever from manual value comparisons */
+ tcase_add_loop_test(tc, evas_object_image_all_loader_data, EINA_C_ARRAY_LENGTH(exts) - 2, EINA_C_ARRAY_LENGTH(exts));
+#endif
+#endif
+}
diff --git a/src/tests/evas/evas_test_init.c b/src/tests/evas/evas_test_init.c
index 827798f3ef..3b17752745 100644
--- a/src/tests/evas/evas_test_init.c
+++ b/src/tests/evas/evas_test_init.c
@@ -8,10 +8,10 @@
#include "evas_suite.h"
-START_TEST(evas_simple)
+EFL_START_TEST(evas_simple)
{
}
-END_TEST
+EFL_END_TEST
void evas_test_init(TCase *tc)
{
diff --git a/src/tests/evas/evas_test_mask.c b/src/tests/evas/evas_test_mask.c
index 56b12e811e..bdb3b627dd 100644
--- a/src/tests/evas/evas_test_mask.c
+++ b/src/tests/evas/evas_test_mask.c
@@ -15,7 +15,6 @@
#define START_MASK_TEST(w, h) \
Ecore_Evas *ee; Evas *e; \
- ecore_evas_init(); \
ee = ecore_evas_buffer_new(w, h); \
ecore_evas_show(ee); \
ecore_evas_manual_render_set(ee, EINA_TRUE); \
@@ -27,7 +26,6 @@
Evas_Object *o; \
EINA_LIST_FREE(tofree, o) { evas_object_del(o); } \
ecore_evas_free(ee); \
- ecore_evas_shutdown(); \
} while (0)
#define AUTODEL(o) do { tofree = eina_list_prepend(tofree, o); } while (0)
@@ -57,7 +55,7 @@ _bgra_compare(unsigned int *data, unsigned int *ref, int w, int h)
}
// The usual useless unit test
-START_TEST(evas_mask_test_setget)
+EFL_START_TEST(evas_mask_test_setget)
{
Evas *e = _setup_evas();
Evas_Object *obj = NULL, *mask = NULL;
@@ -99,12 +97,11 @@ START_TEST(evas_mask_test_setget)
evas_object_del(obj);
evas_free(e);
- ecore_evas_shutdown();
}
-END_TEST
+EFL_END_TEST
// This test is also very basic but will check the pixels
-START_TEST(evas_mask_test_compare_clip)
+EFL_START_TEST(evas_mask_test_compare_clip)
{
Evas_Object *obj, *mask, *rect, *bg, *clip, *text;
unsigned int *data, *refdata[3];
@@ -250,10 +247,10 @@ START_TEST(evas_mask_test_compare_clip)
free(data);
END_MASK_TEST();
}
-END_TEST
+EFL_END_TEST
// This will simply check that a mask is recursively applied to children
-START_TEST(evas_mask_test_mask_of_mask)
+EFL_START_TEST(evas_mask_test_mask_of_mask)
{
Evas_Object *bg, *tbl, *rect0, *mask0, *mask1, *obj;
unsigned int *data, *refdata;
@@ -372,7 +369,7 @@ START_TEST(evas_mask_test_mask_of_mask)
free(data);
END_MASK_TEST();
}
-END_TEST
+EFL_END_TEST
// NOTE: Much more extensive tests are required. But they should
// be based on "exactness" or a pixel similarity tool.
diff --git a/src/tests/evas/evas_test_matrix.c b/src/tests/evas/evas_test_matrix.c
index e8fb89185d..0f0fb2e4bc 100644
--- a/src/tests/evas/evas_test_matrix.c
+++ b/src/tests/evas/evas_test_matrix.c
@@ -13,7 +13,7 @@
#include "evas_suite.h"
#include "evas_tests_helpers.h"
-START_TEST(evas_matrix)
+EFL_START_TEST(evas_matrix)
{
Eina_Vector3 position;
Eina_Quaternion orientation;
@@ -33,7 +33,7 @@ START_TEST(evas_matrix)
fail_if((mat.xx - 0.99 < DBL_EPSILON) || (mat.xy - 0.0 < DBL_EPSILON) ||
(mat.yx -0.0 < DBL_EPSILON) || (mat.yy -0.49 < DBL_EPSILON));
}
-END_TEST
+EFL_END_TEST
void evas_test_matrix(TCase *tc)
{
diff --git a/src/tests/evas/evas_test_mesh.c b/src/tests/evas/evas_test_mesh.c
index 958e443f70..6ac928daab 100644
--- a/src/tests/evas/evas_test_mesh.c
+++ b/src/tests/evas/evas_test_mesh.c
@@ -43,6 +43,7 @@
EINA_ITERATOR_FOREACH(it, file) \
{ \
int set_ok, save_ok; \
+ Eina_File *f; \
mesh = efl_add(EVAS_CANVAS3D_MESH_CLASS, e); \
mesh2 = efl_add(EVAS_CANVAS3D_MESH_CLASS, e); \
fail_if(mesh == NULL); \
@@ -56,18 +57,25 @@
fail_if(!set_ok); \
res = _compare_meshes(mesh, mesh2); \
fail_if(res == 1); \
- set_ok = efl_file_mmap_set(mesh, eina_file_open(file->path, 0), NULL); \
+ f = eina_file_open(file->path, 0); \
+ fail_if(!f); \
+ set_ok = efl_file_mmap_set(mesh, f, NULL); \
+ eina_file_close(f); \
save_ok = efl_file_save(mesh, buffer, NULL, NULL); \
fail_if(!set_ok); \
fail_if(!save_ok); \
- set_ok = efl_file_mmap_set(mesh2, eina_file_open(buffer, 0), NULL); \
+ f = eina_file_open(buffer, 0); \
+ fail_if(!f); \
+ set_ok = efl_file_mmap_set(mesh2, f, NULL); \
+ eina_file_close(f); \
fail_if(!set_ok); \
res = _compare_meshes(mesh, mesh2); \
fail_if(res == 1); \
efl_del(mesh2); \
efl_del(mesh); \
unlink(buffer); \
- }
+ } \
+ eina_iterator_free(it);
static Evas_Canvas3D_Mesh_Frame *
return_zero_frame(Evas_Canvas3D_Mesh_Data *pd)
@@ -121,7 +129,7 @@ static int _compare_meshes(Evas_Canvas3D_Mesh *mesh1, Evas_Canvas3D_Mesh *mesh2)
return 0;
}
-START_TEST(evas_object_mesh_loader_saver)
+EFL_START_TEST(evas_object_mesh_loader_saver)
{
char buffer[PATH_MAX];
Evas *e = _setup_evas();
@@ -131,26 +139,47 @@ START_TEST(evas_object_mesh_loader_saver)
char *file_mask = strdup("evas_test_mesh_XXXXXX");
int res = 0, tmpfd;
const Eina_File_Direct_Info *file;
+ struct
+ {
+ const char *dir;
+ const char *fmt;
+ } values[4] =
+ {
+ { TESTS_OBJ_MESH_DIR, ".eet" },
+ { TESTS_MD2_MESH_DIR, ".eet" },
+ { TESTS_PLY_MESH_DIR, ".eet" },
+ { TESTS_PLY_MESH_DIR, ".ply" },
+ };
/* create tmp file name, assume tmp.eet and tmp.ply also work */
tmpfd = eina_file_mkstemp(file_mask, &tmp);
fail_if(tmpfd == -1);
fail_if(!!close(tmpfd));
- CHECK_MESHES_IN_FOLDER(TESTS_OBJ_MESH_DIR, ".eet")
- CHECK_MESHES_IN_FOLDER(TESTS_MD2_MESH_DIR, ".eet")
- CHECK_MESHES_IN_FOLDER(TESTS_PLY_MESH_DIR, ".eet")
- CHECK_MESHES_IN_FOLDER(TESTS_PLY_MESH_DIR, ".ply")
+ CHECK_MESHES_IN_FOLDER(values[_i].dir, values[_i].fmt)
- eina_iterator_free(it);
unlink(tmp);
evas_free(e);
- ecore_evas_shutdown();
}
-END_TEST
+EFL_END_TEST
void evas_test_mesh(TCase *tc)
{
- tcase_add_test(tc, evas_object_mesh_loader_saver);
+ tcase_add_loop_test(tc, evas_object_mesh_loader_saver, 0, 1);
+}
+
+void evas_test_mesh1(TCase *tc)
+{
+ tcase_add_loop_test(tc, evas_object_mesh_loader_saver, 1, 2);
+}
+
+void evas_test_mesh2(TCase *tc)
+{
+ tcase_add_loop_test(tc, evas_object_mesh_loader_saver, 2, 3);
+}
+
+void evas_test_mesh3(TCase *tc)
+{
+ tcase_add_loop_test(tc, evas_object_mesh_loader_saver, 3, 4);
}
diff --git a/src/tests/evas/evas_test_new.c b/src/tests/evas/evas_test_new.c
new file mode 100644
index 0000000000..c95c43a230
--- /dev/null
+++ b/src/tests/evas/evas_test_new.c
@@ -0,0 +1,21 @@
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdio.h>
+
+#include <Evas.h>
+
+#include "evas_suite.h"
+
+EFL_START_TEST(evas_free_none)
+{
+ Evas *evas = evas_new();
+ Evas_Object *obj = evas_object_rectangle_add(evas);
+}
+EFL_END_TEST
+
+void evas_test_new(TCase *tc)
+{
+ tcase_add_test(tc, evas_free_none);
+}
diff --git a/src/tests/evas/evas_test_object.c b/src/tests/evas/evas_test_object.c
index 70e5d40f05..ac4424e327 100644
--- a/src/tests/evas/evas_test_object.c
+++ b/src/tests/evas/evas_test_object.c
@@ -9,7 +9,7 @@
#include "evas_suite.h"
#include "evas_tests_helpers.h"
-START_TEST(evas_object_various)
+EFL_START_TEST(evas_object_various)
{
Evas *evas = EVAS_TEST_INIT_EVAS();
@@ -20,16 +20,15 @@ START_TEST(evas_object_various)
evas_object_unref(obj);
evas = EVAS_TEST_INIT_EVAS();
+ obj = evas_object_rectangle_add(evas);
efl_ref(obj);
evas_free(evas);
efl_unref(obj);
/* Twice because EVAS_TEST_INIT_EVAS inits it twice. */
- ecore_evas_shutdown();
- ecore_evas_shutdown();
}
-END_TEST
+EFL_END_TEST
void evas_test_object(TCase *tc)
{
diff --git a/src/tests/evas/evas_test_object_smart.c b/src/tests/evas/evas_test_object_smart.c
index 648402a12f..287c673291 100644
--- a/src/tests/evas/evas_test_object_smart.c
+++ b/src/tests/evas/evas_test_object_smart.c
@@ -43,7 +43,6 @@ do \
{ \
evas_object_del(smart_obj); \
evas_free(evas); \
- ecore_evas_shutdown(); \
} \
while (0)
@@ -94,7 +93,7 @@ do \
} \
while (0)
-START_TEST(evas_object_smart_paragraph_direction)
+EFL_START_TEST(evas_object_smart_paragraph_direction)
{
START_EVAS_OBJECT_SMART_TEST();
@@ -174,7 +173,7 @@ START_TEST(evas_object_smart_paragraph_direction)
DELETE_EVAS_TEXT();
END_EVAS_OBJECT_SMART_TEST();
}
-END_TEST
+EFL_END_TEST
void evas_test_object_smart(TCase *tc)
{
diff --git a/src/tests/evas/evas_test_render_engines.c b/src/tests/evas/evas_test_render_engines.c
index 99f2955ce6..6e9aef730a 100644
--- a/src/tests/evas/evas_test_render_engines.c
+++ b/src/tests/evas/evas_test_render_engines.c
@@ -48,7 +48,7 @@ static const char *built_engines[] = {
NULL
};
-START_TEST(evas_render_engines)
+EFL_START_TEST(evas_render_engines)
{
Eina_List *lst = evas_render_method_list();
const char **itr;
@@ -61,9 +61,9 @@ START_TEST(evas_render_engines)
evas_render_method_list_free(lst);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evas_render_lookup)
+EFL_START_TEST(evas_render_lookup)
{
const char **itr;
@@ -73,7 +73,7 @@ START_TEST(evas_render_lookup)
fail_if(id == 0, "could not load engine: %s", *itr);
}
}
-END_TEST
+EFL_END_TEST
void evas_test_render_engines(TCase *tc)
{
diff --git a/src/tests/evas/evas_test_text.c b/src/tests/evas/evas_test_text.c
index c279d5571c..7c66fc96c0 100644
--- a/src/tests/evas/evas_test_text.c
+++ b/src/tests/evas/evas_test_text.c
@@ -33,11 +33,10 @@ do \
{ \
evas_object_del(to); \
evas_free(evas); \
- ecore_evas_shutdown(); \
} \
while (0)
-START_TEST(evas_text_simple)
+EFL_START_TEST(evas_text_simple)
{
START_TEXT_TEST();
const char *buf = "Test - בדיקה";
@@ -45,10 +44,10 @@ START_TEST(evas_text_simple)
fail_if(strcmp(evas_object_text_text_get(to), buf));
END_TEXT_TEST();
}
-END_TEST
+EFL_END_TEST
/* Various text related geometries */
-START_TEST(evas_text_geometries)
+EFL_START_TEST(evas_text_geometries)
{
START_TEXT_TEST();
const char *buf = "Tests";
@@ -162,10 +161,10 @@ START_TEST(evas_text_geometries)
END_TEXT_TEST();
}
-END_TEST
+EFL_END_TEST
/* Various evas stuff, such as scale */
-START_TEST(evas_text_evas)
+EFL_START_TEST(evas_text_evas)
{
Evas_Coord w, h, bw, bh;
START_TEXT_TEST();
@@ -186,7 +185,7 @@ START_TEST(evas_text_evas)
END_TEXT_TEST();
}
-END_TEST
+EFL_END_TEST
static void
_test_ellipsis(Evas_Object *to, const char *buf, const char *font, Evas_Font_Size size, double ellipsis)
@@ -223,7 +222,7 @@ _test_ellipsis(Evas_Object *to, const char *buf, const char *font, Evas_Font_Siz
fail_if(w < 100);
}
-START_TEST(evas_text_ellipsis)
+EFL_START_TEST(evas_text_ellipsis)
{
START_TEXT_TEST();
const char *buf = "נסיון בלה בלה בלה בלה";
@@ -270,11 +269,11 @@ START_TEST(evas_text_ellipsis)
END_TEXT_TEST();
}
-END_TEST
+EFL_END_TEST
/* Tests for functions that are in evas_object_text.c but
* don't really have anything to do with it. */
-START_TEST(evas_text_unrelated)
+EFL_START_TEST(evas_text_unrelated)
{
START_TEXT_TEST();
const char *buf = "נסיון";
@@ -293,7 +292,7 @@ START_TEST(evas_text_unrelated)
END_TEXT_TEST();
}
-END_TEST
+EFL_END_TEST
#define _CHECK_SET_GET(x) \
do \
@@ -309,7 +308,7 @@ do \
} \
while (0)
-START_TEST(evas_text_set_get)
+EFL_START_TEST(evas_text_set_get)
{
START_TEXT_TEST();
const char *buf = "Test - בדיקה";
@@ -413,9 +412,9 @@ START_TEST(evas_text_set_get)
END_TEXT_TEST();
}
-END_TEST
+EFL_END_TEST
-START_TEST(evas_text_style)
+EFL_START_TEST(evas_text_style)
{
Evas_Coord l, r, t, b;
START_TEXT_TEST();
@@ -464,10 +463,10 @@ START_TEST(evas_text_style)
fail_if(strcmp(evas_object_text_text_get(to), buf));
END_TEXT_TEST();
}
-END_TEST
+EFL_END_TEST
#ifdef HAVE_FRIBIDI
-START_TEST(evas_text_bidi)
+EFL_START_TEST(evas_text_bidi)
{
START_TEXT_TEST();
const char *buf = "Test - בדיקה";
@@ -625,10 +624,10 @@ START_TEST(evas_text_bidi)
END_TEXT_TEST();
}
-END_TEST
+EFL_END_TEST
#endif
-START_TEST(evas_text_render)
+EFL_START_TEST(evas_text_render)
{
Ecore_Evas *ee = ecore_evas_buffer_new(500, 500);
Evas *evas = ecore_evas_get(ee);
@@ -654,9 +653,9 @@ START_TEST(evas_text_render)
ecore_evas_free(ee);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evas_text_font_load)
+EFL_START_TEST(evas_text_font_load)
{
Ecore_Evas *ee = ecore_evas_buffer_new(500, 500);
Evas *evas = ecore_evas_get(ee);
@@ -680,7 +679,7 @@ START_TEST(evas_text_font_load)
ecore_evas_free(ee);
}
-END_TEST
+EFL_END_TEST
void evas_test_text(TCase *tc)
{
diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c
index 0e6057cf58..1f6cb139b2 100644
--- a/src/tests/evas/evas_test_textblock.c
+++ b/src/tests/evas/evas_test_textblock.c
@@ -16,6 +16,8 @@
#include "evas_suite.h"
#include "evas_tests_helpers.h"
+#define TESTS_DIC_DIR TESTS_SRC_DIR"/dicts"
+
/* Functions defined in evas_object_textblock.c */
EAPI Eina_Bool
_evas_textblock_check_item_node_link(Evas_Object *obj);
@@ -58,11 +60,10 @@ do \
evas_object_del(tb); \
evas_textblock_style_free(st); \
evas_free(evas); \
- ecore_evas_shutdown(); \
} \
while (0)
-START_TEST(evas_textblock_simple)
+EFL_START_TEST(evas_textblock_simple)
{
START_TB_TEST();
const char *buf = "Th<i>i</i>s is a <br/> te<b>s</b>t.";
@@ -78,7 +79,7 @@ START_TEST(evas_textblock_simple)
END_TB_TEST();
}
-END_TEST
+EFL_END_TEST
#define _CHECK_CURSOR_COORDS() \
do \
@@ -101,7 +102,7 @@ do \
fail_if(ret == -1); \
} \
while (0)
-START_TEST(evas_textblock_cursor)
+EFL_START_TEST(evas_textblock_cursor)
{
START_TB_TEST();
Evas_Coord x, y, w, h;
@@ -974,10 +975,10 @@ START_TEST(evas_textblock_cursor)
}
END_TB_TEST();
}
-END_TEST
+EFL_END_TEST
#ifdef HAVE_FRIBIDI
-START_TEST(evas_textblock_split_cursor)
+EFL_START_TEST(evas_textblock_split_cursor)
{
START_TB_TEST();
Evas_Coord x, w, x2, w2;
@@ -1292,10 +1293,10 @@ START_TEST(evas_textblock_split_cursor)
END_TB_TEST();
}
-END_TEST
+EFL_END_TEST
#endif
-START_TEST(evas_textblock_format_removal)
+EFL_START_TEST(evas_textblock_format_removal)
{
START_TB_TEST();
int i;
@@ -1721,10 +1722,10 @@ START_TEST(evas_textblock_format_removal)
END_TB_TEST();
}
-END_TEST
+EFL_END_TEST
/* Testing items */
-START_TEST(evas_textblock_items)
+EFL_START_TEST(evas_textblock_items)
{
Evas_Coord x, y, w, h, w2, h2, nw, nh, ih;
START_TB_TEST();
@@ -1854,10 +1855,10 @@ START_TEST(evas_textblock_items)
END_TB_TEST();
}
-END_TEST
+EFL_END_TEST
/* Wrapping tests */
-START_TEST(evas_textblock_wrapping)
+EFL_START_TEST(evas_textblock_wrapping)
{
Evas_Coord bw, bh, w, h, nw, nh;
int i;
@@ -2293,10 +2294,10 @@ START_TEST(evas_textblock_wrapping)
END_TB_TEST();
}
-END_TEST
+EFL_END_TEST
/* Various textblock stuff */
-START_TEST(evas_textblock_various)
+EFL_START_TEST(evas_textblock_various)
{
Evas_Coord w, h, bw, bh;
START_TB_TEST();
@@ -2408,10 +2409,10 @@ START_TEST(evas_textblock_various)
END_TB_TEST();
}
-END_TEST
+EFL_END_TEST
/* Various geometries. e.g. range geometry. */
-START_TEST(evas_textblock_geometries)
+EFL_START_TEST(evas_textblock_geometries)
{
START_TB_TEST();
const char *buf = "This is a <br/> test.";
@@ -2891,10 +2892,10 @@ START_TEST(evas_textblock_geometries)
END_TB_TEST();
}
-END_TEST
+EFL_END_TEST
/* Should handle all the text editing. */
-START_TEST(evas_textblock_editing)
+EFL_START_TEST(evas_textblock_editing)
{
START_TB_TEST();
const char *buf = "First par.<ps/>Second par.";
@@ -2976,6 +2977,21 @@ START_TEST(evas_textblock_editing)
evas_textblock_cursor_paragraph_first(cur);
fail_if(evas_textblock_cursor_paragraph_next(cur));
+ /* Test cursor range delete with <br/> tags when legacy newline is enabled.
+ * After deleting first <br/> tag, the second <br/> tag shouldn't be changed to <ps/> */
+ evas_object_textblock_legacy_newline_set(tb, EINA_TRUE);
+ evas_object_textblock_text_markup_set(tb, "A<br/><br/>B");
+ evas_textblock_cursor_paragraph_first(cur);
+ evas_textblock_cursor_paragraph_first(main_cur);
+ evas_textblock_cursor_pos_set(main_cur, 2);
+ ck_assert_str_eq(evas_textblock_cursor_range_text_get(cur, main_cur, EVAS_TEXTBLOCK_TEXT_MARKUP), "A<br/>");
+
+ evas_textblock_cursor_range_delete(cur, main_cur);
+ ck_assert_str_eq(evas_object_textblock_text_markup_get(tb), "<br/>B");
+
+ /* Restore legacy newline disabled setting */
+ evas_object_textblock_legacy_newline_set(tb, EINA_FALSE);
+
{
/* Limit to 1000 iterations so we'll never get into an infinite loop,
* even if broken */
@@ -3019,10 +3035,10 @@ START_TEST(evas_textblock_editing)
END_TB_TEST();
}
-END_TEST
+EFL_END_TEST
/* Text getters */
-START_TEST(evas_textblock_text_getters)
+EFL_START_TEST(evas_textblock_text_getters)
{
START_TB_TEST();
const char *buf = "This is a <br/> test.<ps/>"
@@ -3247,10 +3263,10 @@ START_TEST(evas_textblock_text_getters)
END_TB_TEST();
}
-END_TEST
+EFL_END_TEST
/* Formats */
-START_TEST(evas_textblock_formats)
+EFL_START_TEST(evas_textblock_formats)
{
START_TB_TEST();
const char *buf = "Th<b>i<font_size=15 wrap=none>s i</font_size=13>s</> a <br/> te<ps/>st<item></>.";
@@ -3552,10 +3568,10 @@ START_TEST(evas_textblock_formats)
END_TB_TEST();
}
-END_TEST
+EFL_END_TEST
/* Different text styles, for example, shadow. */
-START_TEST(evas_textblock_style)
+EFL_START_TEST(evas_textblock_style)
{
Evas_Coord w, h, nw, nh;
Evas_Coord l, r, t, b;
@@ -3701,13 +3717,47 @@ START_TEST(evas_textblock_style)
evas_object_textblock_size_formatted_get(tb, &nw, &nh);
ck_assert_int_eq(nw, bw);
+ evas_textblock_style_set(newst, "DEFAULT='font=Sans font_size=30'small_size='+ font_size=10'");
+ evas_object_textblock_text_markup_set(tb, "Test <small_size>SMALL</small_size>");
+ evas_object_textblock_size_formatted_get(tb, &w, &h);
+ ck_assert_int_gt(w, 0);
+ ck_assert_int_gt(h, 0);
+
+ evas_textblock_style_set(newst, "DEFAULT='font=Sans font_size=30'small_size='+font_size=50'");
+ evas_object_textblock_size_formatted_get(tb, &nw, &nh);
+ ck_assert_int_gt(nw, w);
+ ck_assert_int_gt(nh, h);
+
+ END_TB_TEST();
+}
+EFL_END_TEST
+
+/* Basic test for style user push/peek/pop. */
+START_TEST(evas_textblock_style_user)
+{
+ Evas_Textblock_Style *user_st;
+
+ START_TB_TEST();
+
+ user_st = evas_textblock_style_new();
+ fail_if(!user_st);
+ evas_textblock_style_set(user_st, "DEFAULT='" TEST_FONT " font_size=50 color=#000'");
+
+ evas_object_textblock_style_user_push(tb, user_st);
+ fail_if(evas_object_textblock_style_user_peek(tb) != user_st);
+
+ evas_object_textblock_style_user_pop(tb);
+ fail_if(evas_object_textblock_style_user_peek(tb) != NULL);
+
+ /* new/free should be handled from outside of Evas Textblock. */
+ evas_textblock_style_free(user_st);
END_TB_TEST();
}
END_TEST
/* Various setters and getters */
-START_TEST(evas_textblock_set_get)
+EFL_START_TEST(evas_textblock_set_get)
{
START_TB_TEST();
const char *buf = "";
@@ -3748,10 +3798,10 @@ START_TEST(evas_textblock_set_get)
evas_font_hinting_set(evas, EVAS_FONT_HINTING_BYTECODE);
END_TB_TEST();
}
-END_TEST
+EFL_END_TEST
/* Aux evas stuff, such as scale. */
-START_TEST(evas_textblock_evas)
+EFL_START_TEST(evas_textblock_evas)
{
Evas_Coord w, h, sw, sh;
START_TB_TEST();
@@ -3768,10 +3818,10 @@ START_TEST(evas_textblock_evas)
END_TB_TEST();
}
-END_TEST
+EFL_END_TEST
/* All the string escaping stuff */
-START_TEST(evas_textblock_escaping)
+EFL_START_TEST(evas_textblock_escaping)
{
int len;
START_TB_TEST();
@@ -3807,9 +3857,9 @@ START_TEST(evas_textblock_escaping)
END_TB_TEST();
}
-END_TEST
+EFL_END_TEST
-START_TEST(evas_textblock_size)
+EFL_START_TEST(evas_textblock_size)
{
START_TB_TEST();
Evas_Coord w, h, h2, nw, nh;
@@ -3923,9 +3973,9 @@ START_TEST(evas_textblock_size)
/* FIXME: There is a lot more to be done. */
END_TB_TEST();
}
-END_TEST
+EFL_END_TEST
-START_TEST(evas_textblock_delete)
+EFL_START_TEST(evas_textblock_delete)
{
START_TB_TEST();
const Evas_Object_Textblock_Node_Format *fmt;
@@ -3959,7 +4009,7 @@ START_TEST(evas_textblock_delete)
END_TB_TEST();
}
-END_TEST;
+EFL_END_TEST;
/* Runs x,y in [from,to] range */
static void
@@ -3984,7 +4034,7 @@ _obstacle_run(Evas_Object *tb, Evas_Object *obj,
}
}
-START_TEST(evas_textblock_obstacle)
+EFL_START_TEST(evas_textblock_obstacle)
{
START_TB_TEST();
Evas_Coord fw, fh;
@@ -4043,7 +4093,7 @@ START_TEST(evas_textblock_obstacle)
_obstacle_run(tb, rect3, 0, fw, 0, 0, fh);
END_TB_TEST();
}
-END_TEST;
+EFL_END_TEST;
#ifdef HAVE_HYPHEN
static void
@@ -4067,7 +4117,7 @@ _hyphenation_width_stress(Evas_Object *tb, Evas_Textblock_Cursor *cur)
ck_assert_int_eq(w, bw);
}
-START_TEST(evas_textblock_hyphenation)
+EFL_START_TEST(evas_textblock_hyphenation)
{
START_TB_TEST();
Evas_Coord w, fw;
@@ -4127,12 +4177,27 @@ START_TEST(evas_textblock_hyphenation)
evas_object_textblock_text_markup_set(tb, buf);
_hyphenation_width_stress(tb, cur);
+ setenv("EVAS_DICTS_HYPHEN_DIR", TESTS_DIC_DIR, 1);
+
+ buf = "europäi-";
+ evas_object_textblock_text_markup_set(tb, buf);
+ evas_object_textblock_size_formatted_get(tb, &w, NULL);
+
+ buf = "europäischen";
+ evas_object_textblock_text_markup_set(tb, buf);
+ evas_textblock_cursor_format_prepend(cur, "<wrap=hyphenation lang=de_DE>");
+ evas_object_resize(tb, w, 100);
+ evas_object_textblock_size_formatted_get(tb, &fw, NULL);
+ ck_assert_int_eq(w, fw);
+
+ unsetenv("EVAS_DICTS_HYPHEN_DIR");
+
END_TB_TEST();
}
-END_TEST;
+EFL_END_TEST;
#endif
-START_TEST(evas_textblock_text_iface)
+EFL_START_TEST(evas_textblock_text_iface)
{
START_TB_TEST();
Evas_Coord nw, nh;
@@ -4202,7 +4267,7 @@ START_TEST(evas_textblock_text_iface)
END_TB_TEST();
}
-END_TEST;
+EFL_END_TEST;
static void
_test_check_annotation(Evas_Object *tb,
@@ -4246,7 +4311,7 @@ _test_check_annotation(Evas_Object *tb,
#define _CREATE_PARAMS(X) (sizeof(X) / sizeof(X[0])), (X)
#define _COMP_PARAMS(...) _CREATE_PARAMS(_COMP_STR(__VA_ARGS__))
-START_TEST(evas_textblock_annotation)
+EFL_START_TEST(evas_textblock_annotation)
{
START_TB_TEST();
Efl_Text_Annotate_Annotation *an, *an2;
@@ -4371,8 +4436,8 @@ START_TEST(evas_textblock_annotation)
/* Check "item" annotations */
efl_text_set(tb, "abcd");
evas_textblock_cursor_pos_set(cur, 4);
- an = efl_text_cursor_object_item_insert(tb, cur, "size=16x16");
- _test_check_annotation(tb, 4, 4, _COMP_PARAMS("size=16x16"));
+ an = efl_text_cursor_item_insert(tb, cur, "", "size=16x16");
+ _test_check_annotation(tb, 4, 4, _COMP_PARAMS("size=16x16 href="));
/* Check that format is not extended if it's an "object item" */
evas_textblock_cursor_pos_set(cur, 5);
@@ -4417,20 +4482,62 @@ START_TEST(evas_textblock_annotation)
/* Test getting of object item */
evas_textblock_cursor_pos_set(cur, 4);
- an = efl_text_cursor_object_item_annotation_get(tb, cur);
+ an = efl_text_cursor_item_annotation_get(tb, cur);
ck_assert(!an);
- an = efl_text_cursor_object_item_insert(tb, cur, "size=16x16");
+ an = efl_text_cursor_item_insert(tb, cur, "", "size=16x16");
evas_textblock_cursor_pos_set(cur, 4);
- an = efl_text_cursor_object_item_annotation_get(tb, cur);
+ an = efl_text_cursor_item_annotation_get(tb, cur);
ck_assert(an);
- ck_assert_str_eq("size=16x16", efl_text_annotation_get(tb, an));
+ ck_assert_str_eq("size=16x16 href=", efl_text_annotation_get(tb, an));
END_TB_TEST();
}
-END_TEST;
+EFL_END_TEST;
+
+#define START_EFL_CANVAS_TEXT_TEST() \
+ Evas *evas; \
+ Eo *txt; \
+ Efl_Text_Cursor_Cursor *cur; \
+ evas = EVAS_TEST_INIT_EVAS(); \
+ evas_font_hinting_set(evas, EVAS_FONT_HINTING_AUTO); \
+ txt = efl_add(EFL_CANVAS_TEXT_CLASS, evas); \
+ fail_if(!txt); \
+ efl_canvas_text_legacy_newline_set(txt, EINA_FALSE); \
+ efl_canvas_text_style_set(txt, NULL, style_buf); \
+ fail_if(!efl_canvas_text_style_get(txt, NULL) || \
+ strcmp(style_buf, efl_canvas_text_style_get(txt, NULL))); \
+ cur = efl_text_cursor_new(txt); \
+ fail_if(!cur); \
+do \
+{ \
+} \
+while (0)
+
+#define END_EFL_CANVAS_TEXT_TEST() \
+do \
+{ \
+ efl_text_cursor_free(txt, cur); \
+ efl_del(txt); \
+ evas_free(evas); \
+} \
+while (0)
+
+EFL_START_TEST(efl_canvas_text_simple)
+{
+ START_EFL_CANVAS_TEXT_TEST();
+
+ /* It is simple test for Efl_Canvas_Text.
+ * The main object is "txt". */
+ const char *buf = "Th<i>i</i>s is a <br/> te<b>s</b>t.";
+ efl_text_set(txt, buf);
+ fail_if(strcmp(efl_text_get(txt), buf));
+
+ END_EFL_CANVAS_TEXT_TEST();
+}
+EFL_END_TEST
-START_TEST(efl_canvas_text_cursor)
+EFL_START_TEST(efl_canvas_text_cursor)
{
START_TB_TEST();
@@ -4444,7 +4551,7 @@ START_TEST(efl_canvas_text_cursor)
/*01234 5 6789012345678 19 01234 */
efl_text_set(tb, "тest \u202bנסיוןabcנסיון\u202c bang");
efl_canvas_text_size_native_get(tb, &nw, &nh);
- efl_gfx_size_set(tb, EINA_SIZE2D(nw, nh));
+ efl_gfx_entity_size_set(tb, EINA_SIZE2D(nw, nh));
/* Logical cursor after "test " */
evas_textblock_cursor_pos_set(cur, 6);
@@ -4461,7 +4568,7 @@ START_TEST(efl_canvas_text_cursor)
END_TB_TEST();
}
-END_TEST
+EFL_END_TEST
void evas_test_textblock(TCase *tc)
{
@@ -4473,6 +4580,7 @@ void evas_test_textblock(TCase *tc)
tcase_add_test(tc, evas_textblock_size);
tcase_add_test(tc, evas_textblock_editing);
tcase_add_test(tc, evas_textblock_style);
+ tcase_add_test(tc, evas_textblock_style_user);
tcase_add_test(tc, evas_textblock_evas);
tcase_add_test(tc, evas_textblock_text_getters);
tcase_add_test(tc, evas_textblock_formats);
@@ -4490,6 +4598,7 @@ void evas_test_textblock(TCase *tc)
#endif
tcase_add_test(tc, evas_textblock_text_iface);
tcase_add_test(tc, evas_textblock_annotation);
+ tcase_add_test(tc, efl_canvas_text_simple);
tcase_add_test(tc, efl_canvas_text_cursor);
}
diff --git a/src/tests/evas/evas_tests_helpers.h b/src/tests/evas/evas_tests_helpers.h
index 561502aba3..af970b1a11 100644
--- a/src/tests/evas/evas_tests_helpers.h
+++ b/src/tests/evas/evas_tests_helpers.h
@@ -15,7 +15,6 @@ do \
evas_object_del(tb); \
evas_textblock_style_free(st); \
evas_free(evas); \
- ecore_evas_shutdown(); \
} \
while (0)
@@ -25,7 +24,6 @@ _setup_evas()
Evas *evas;
Evas_Engine_Info *einfo;
- ecore_evas_init();
evas = evas_new();
evas_output_method_set(evas, evas_render_method_lookup("buffer"));
diff --git a/src/tests/evil/evil_suite.c b/src/tests/evil/evil_suite.c
index 454a217e64..3331d287b2 100644
--- a/src/tests/evil/evil_suite.c
+++ b/src/tests/evil/evil_suite.c
@@ -25,15 +25,13 @@
#include "evil_suite.h"
#include "../efl_check.h"
+#include <Evil.h>
static const Efl_Test_Case etc[] = {
- /* { "Dirent", evil_test_dirent }, */
{ "Dlfcn", evil_test_dlfcn },
/* { "Fcntl", evil_test_fcntl }, */
/* { "Fnmatch", evil_test_fnmatch }, */
- /* { "Inet", evil_test_inet }, */
/* { "Langinfo", evil_test_langinfo }, */
- /* { "Link", evil_test_link }, */
{ "Libgen", evil_test_libgen },
{ "Main", evil_test_main },
/* { "Mman", evil_test_mman }, */
@@ -42,11 +40,22 @@ static const Efl_Test_Case etc[] = {
{ "Stdlib", evil_test_stdlib },
/* { "String", evil_test_string }, */
/* { "Time", evil_test_time }, */
- /* { "Unistd", evil_test_unistd }, */
+ { "Unistd", evil_test_unistd },
/* { "Util", evil_test_util }, */
{ NULL, NULL }
};
+
+SUITE_INIT(evil)
+{
+ ck_assert_int_eq(evil_init(), 1);
+}
+
+SUITE_SHUTDOWN(evil)
+{
+ ck_assert_int_eq(evil_shutdown(), 0);
+}
+
int
main(int argc, char **argv)
{
@@ -60,7 +69,7 @@ main(int argc, char **argv)
#endif
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
- "Evil", etc);
+ "Evil", etc, SUITE_INIT_FN(evil), SUITE_SHUTDOWN_FN(evil));
return (failed_count == 0) ? 0 : 255;
}
diff --git a/src/tests/evil/evil_suite.h b/src/tests/evil/evil_suite.h
index 20f8d03a60..e7efc926ab 100644
--- a/src/tests/evil/evil_suite.h
+++ b/src/tests/evil/evil_suite.h
@@ -20,14 +20,11 @@
#define EVIL_SUITE_H_
#include <check.h>
-
-/* void evil_test_dirent(TCase *tc); */
+#include "../efl_check.h"
void evil_test_dlfcn(TCase *tc);
/* void evil_test_fcntl(TCase *tc); */
/* void evil_test_fnmatch(TCase *tc); */
-/* void evil_test_inet(TCase *tc); */
/* void evil_test_langinfo(TCase *tc); */
-/* void evil_test_link(TCase *tc); */
void evil_test_libgen(TCase *tc);
void evil_test_main(TCase *tc);
/* void evil_test_mman(TCase *tc); */
@@ -36,7 +33,7 @@ void evil_test_stdio(TCase *tc);
void evil_test_stdlib(TCase *tc);
/* void evil_test_string(TCase *tc); */
/* void evil_test_time(TCase *tc); */
-/* void evil_test_unistd(TCase *tc); */
+void evil_test_unistd(TCase *tc);
/* void evil_test_util(TCase *tc); */
#endif /* EVIL_SUITE_H_ */
diff --git a/src/tests/evil/evil_test_dlfcn.c b/src/tests/evil/evil_test_dlfcn.c
index 0d0980e45d..d932e710a8 100644
--- a/src/tests/evil/evil_test_dlfcn.c
+++ b/src/tests/evil/evil_test_dlfcn.c
@@ -29,7 +29,7 @@ typedef int (*_evil_init)(void);
typedef int (*_evil_shutdwon)(void);
-START_TEST(evil_dlfcn_dlopen_success)
+EFL_START_TEST(evil_dlfcn_dlopen_success)
{
void *mod;
int res;
@@ -40,9 +40,9 @@ START_TEST(evil_dlfcn_dlopen_success)
res = dlclose(mod);
fail_if(res != 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_dlfcn_dlopen_failure)
+EFL_START_TEST(evil_dlfcn_dlopen_failure)
{
void *mod;
@@ -50,9 +50,9 @@ START_TEST(evil_dlfcn_dlopen_failure)
mod = dlopen("c:\\windows\\system32\\kernel32.dl", 0);
fail_if(mod != NULL);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_dlfcn_dlsym_success)
+EFL_START_TEST(evil_dlfcn_dlsym_success)
{
_evil_init sym_init;
_evil_shutdwon sym_shutdown;
@@ -64,18 +64,18 @@ START_TEST(evil_dlfcn_dlsym_success)
sym_init = dlsym(mod, "evil_init");
fail_if(sym_init == NULL);
- fail_if(sym_init() != 1);
+ fail_if(sym_init() != 2);
sym_shutdown = dlsym(mod, "evil_shutdown");
fail_if(sym_shutdown == NULL);
- fail_if(sym_shutdown() != 0);
+ fail_if(sym_shutdown() != 1);
res = dlclose(mod);
fail_if(res != 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_dlfcn_dlsym_failure)
+EFL_START_TEST(evil_dlfcn_dlsym_failure)
{
void *mod;
void *sym;
@@ -91,9 +91,9 @@ START_TEST(evil_dlfcn_dlsym_failure)
res = dlclose(mod);
fail_if(res != 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_dlfcn_dladdr)
+EFL_START_TEST(evil_dlfcn_dladdr)
{
Dl_info info;
void *mod;
@@ -119,7 +119,7 @@ START_TEST(evil_dlfcn_dladdr)
res = dlclose(mod);
fail_if(res != 0);
}
-END_TEST
+EFL_END_TEST
void evil_test_dlfcn(TCase *tc)
{
diff --git a/src/tests/evil/evil_test_libgen.c b/src/tests/evil/evil_test_libgen.c
index eb8c17f18b..263e6de836 100644
--- a/src/tests/evil/evil_test_libgen.c
+++ b/src/tests/evil/evil_test_libgen.c
@@ -26,7 +26,7 @@
#include "evil_suite.h"
-START_TEST(evil_libgen_null)
+EFL_START_TEST(evil_libgen_null)
{
char *dname;
char *bname;
@@ -36,9 +36,9 @@ START_TEST(evil_libgen_null)
bname = basename(NULL);
fail_if(strcmp(bname, ".") != 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_libgen_empty)
+EFL_START_TEST(evil_libgen_empty)
{
const char *path = "";
char *dirc;
@@ -59,9 +59,9 @@ START_TEST(evil_libgen_empty)
free(dirc);
free(basec);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_libgen_path)
+EFL_START_TEST(evil_libgen_path)
{
const char *path = "/usr/lib";
char *dirc;
@@ -82,9 +82,9 @@ START_TEST(evil_libgen_path)
free(dirc);
free(basec);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_libgen_path_with_slash)
+EFL_START_TEST(evil_libgen_path_with_slash)
{
const char *path = "/usr/";
char *dirc;
@@ -105,9 +105,9 @@ START_TEST(evil_libgen_path_with_slash)
free(dirc);
free(basec);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_libgen_folder)
+EFL_START_TEST(evil_libgen_folder)
{
const char *path = "usr";
char *dirc;
@@ -128,9 +128,9 @@ START_TEST(evil_libgen_folder)
free(dirc);
free(basec);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_libgen_slash)
+EFL_START_TEST(evil_libgen_slash)
{
const char *path = "/";
char *dirc;
@@ -151,9 +151,9 @@ START_TEST(evil_libgen_slash)
free(dirc);
free(basec);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_libgen_dot)
+EFL_START_TEST(evil_libgen_dot)
{
const char *path = ".";
char *dirc;
@@ -174,9 +174,9 @@ START_TEST(evil_libgen_dot)
free(dirc);
free(basec);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_libgen_dot_dot)
+EFL_START_TEST(evil_libgen_dot_dot)
{
const char *path = "..";
char *dirc;
@@ -197,9 +197,9 @@ START_TEST(evil_libgen_dot_dot)
free(dirc);
free(basec);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_libgen_win_dir_1)
+EFL_START_TEST(evil_libgen_win_dir_1)
{
const char *path = "c:/foo/bar";
char *dirc;
@@ -220,9 +220,9 @@ fail_if(strcmp(bname, "bar") != 0);
free(dirc);
free(basec);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_libgen_win_dir_2)
+EFL_START_TEST(evil_libgen_win_dir_2)
{
const char *path = "c:/foo\\bar";
char *dirc;
@@ -243,9 +243,9 @@ START_TEST(evil_libgen_win_dir_2)
free(dirc);
free(basec);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_libgen_win_dir_3)
+EFL_START_TEST(evil_libgen_win_dir_3)
{
const char *path = "c:\\foo/bar";
char *dirc;
@@ -266,9 +266,9 @@ START_TEST(evil_libgen_win_dir_3)
free(dirc);
free(basec);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_libgen_win_dir_4)
+EFL_START_TEST(evil_libgen_win_dir_4)
{
const char *path = "c:\\foo\\bar";
char *dirc;
@@ -289,7 +289,7 @@ START_TEST(evil_libgen_win_dir_4)
free(dirc);
free(basec);
}
-END_TEST
+EFL_END_TEST
void evil_test_libgen(TCase *tc)
{
diff --git a/src/tests/evil/evil_test_main.c b/src/tests/evil/evil_test_main.c
index d116aef166..bae448219f 100644
--- a/src/tests/evil/evil_test_main.c
+++ b/src/tests/evil/evil_test_main.c
@@ -24,12 +24,10 @@
#include "evil_suite.h"
-START_TEST(evil_main_simple)
+EFL_START_TEST(evil_main_simple)
{
- fail_if(evil_init() != 1);
- fail_if(evil_shutdown() != 0);
}
-END_TEST
+EFL_END_TEST
void evil_test_main(TCase *tc)
{
diff --git a/src/tests/evil/evil_test_stdio.c b/src/tests/evil/evil_test_stdio.c
index eeab2d08e5..6b39059e9c 100644
--- a/src/tests/evil/evil_test_stdio.c
+++ b/src/tests/evil/evil_test_stdio.c
@@ -66,7 +66,7 @@ _evil_test_stdio_file_new_and_opened(const char *n, const char *t)
return f;
}
-START_TEST(evil_stdio_rename_src_file_none)
+EFL_START_TEST(evil_stdio_rename_src_file_none)
{
int res;
@@ -76,9 +76,9 @@ START_TEST(evil_stdio_rename_src_file_none)
res = rename("evil_foo.txt", NULL);
fail_if(res != -1);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_stdio_rename_dst_file_none)
+EFL_START_TEST(evil_stdio_rename_dst_file_none)
{
int res1;
int res2;
@@ -98,9 +98,9 @@ START_TEST(evil_stdio_rename_dst_file_none)
fail_if(res3 == -1);
fail_if(res4 == 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_stdio_rename_dst_file_exists)
+EFL_START_TEST(evil_stdio_rename_dst_file_exists)
{
int res1;
int res2;
@@ -123,9 +123,9 @@ START_TEST(evil_stdio_rename_dst_file_exists)
fail_if(res2 == -1);
fail_if(res3 == 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_stdio_rename_dst_file_used)
+EFL_START_TEST(evil_stdio_rename_dst_file_used)
{
FILE *f;
int res1;
@@ -153,9 +153,9 @@ START_TEST(evil_stdio_rename_dst_file_used)
fail_if(res2 == -1);
fail_if(res3 == -1);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_stdio_rename_dst_file_move_to_dir)
+EFL_START_TEST(evil_stdio_rename_dst_file_move_to_dir)
{
int res1;
int res2;
@@ -178,9 +178,9 @@ START_TEST(evil_stdio_rename_dst_file_move_to_dir)
fail_if(res3 == -1);
fail_if(res4 == 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_stdio_rename_dst_dir_none)
+EFL_START_TEST(evil_stdio_rename_dst_dir_none)
{
int res1;
int res2;
@@ -197,9 +197,9 @@ START_TEST(evil_stdio_rename_dst_dir_none)
fail_if(res2 == -1);
fail_if(res3 == 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_stdio_rename_dst_dir_exists)
+EFL_START_TEST(evil_stdio_rename_dst_dir_exists)
{
int res1;
int res2;
@@ -222,7 +222,7 @@ START_TEST(evil_stdio_rename_dst_dir_exists)
fail_if(res2 == -1);
fail_if(res3 == 0);
}
-END_TEST
+EFL_END_TEST
void evil_test_stdio(TCase *tc)
{
diff --git a/src/tests/evil/evil_test_stdlib.c b/src/tests/evil/evil_test_stdlib.c
index 9de3a149ff..a39515ccb4 100644
--- a/src/tests/evil/evil_test_stdlib.c
+++ b/src/tests/evil/evil_test_stdlib.c
@@ -26,7 +26,7 @@
#include "evil_suite.h"
-START_TEST(evil_stdlib_setenv_NULL)
+EFL_START_TEST(evil_stdlib_setenv_NULL)
{
char *val;
int res;
@@ -37,9 +37,9 @@ START_TEST(evil_stdlib_setenv_NULL)
val = getenv("EVIL_TEST_ENV");
fail_if(val != 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_stdlib_setenv_NULL_after_set)
+EFL_START_TEST(evil_stdlib_setenv_NULL_after_set)
{
char *val;
int res;
@@ -58,9 +58,9 @@ START_TEST(evil_stdlib_setenv_NULL_after_set)
val = getenv("EVIL_TEST_ENV");
fail_if(val != 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_stdlib_getenv_one)
+EFL_START_TEST(evil_stdlib_getenv_one)
{
char *val;
int res;
@@ -79,9 +79,9 @@ START_TEST(evil_stdlib_getenv_one)
val = getenv("EVIL_TEST_ENV");
fail_if(val != 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_stdlib_getenv_two)
+EFL_START_TEST(evil_stdlib_getenv_two)
{
char *val;
int res;
@@ -114,9 +114,9 @@ START_TEST(evil_stdlib_getenv_two)
val = getenv("EVIL_TEST_ENV2");
fail_if(val != 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_stdlib_getenv_two_swapped)
+EFL_START_TEST(evil_stdlib_getenv_two_swapped)
{
char *val;
int res;
@@ -149,9 +149,9 @@ START_TEST(evil_stdlib_getenv_two_swapped)
val = getenv("EVIL_TEST_ENV2");
fail_if(val != 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_stdlib_unsetenv)
+EFL_START_TEST(evil_stdlib_unsetenv)
{
char *val;
int res;
@@ -167,9 +167,9 @@ START_TEST(evil_stdlib_unsetenv)
val = getenv("EVIL_TEST_ENV");
fail_if(val != 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_stdlib_mkdtemp)
+EFL_START_TEST(evil_stdlib_mkdtemp)
{
char template[] = "file_XXXXXX";
char *res;
@@ -179,9 +179,9 @@ START_TEST(evil_stdlib_mkdtemp)
fail_if(rmdir(res) < 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_stdlib_mkdtemp_fail)
+EFL_START_TEST(evil_stdlib_mkdtemp_fail)
{
char template[] = "file_XXX";
char *res;
@@ -189,9 +189,9 @@ START_TEST(evil_stdlib_mkdtemp_fail)
res = mkdtemp(template);
fail_if(res != NULL);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_stdlib_mkstemp)
+EFL_START_TEST(evil_stdlib_mkstemp)
{
char template[] = "file_XXXXXX";
int fd;
@@ -203,9 +203,9 @@ START_TEST(evil_stdlib_mkstemp)
fail_if(unlink(template) == -1);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_stdlib_mkstemp_fail)
+EFL_START_TEST(evil_stdlib_mkstemp_fail)
{
char template[] = "file_XXX";
int fd;
@@ -213,9 +213,9 @@ START_TEST(evil_stdlib_mkstemp_fail)
fd = mkstemp(template);
fail_if(fd >= 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_stdlib_mkstemps)
+EFL_START_TEST(evil_stdlib_mkstemps)
{
char template[] = "file_XXXXXX.ext";
int fd;
@@ -227,9 +227,9 @@ START_TEST(evil_stdlib_mkstemps)
fail_if(unlink(template) == -1);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_stdlib_mkstemps_fail_1)
+EFL_START_TEST(evil_stdlib_mkstemps_fail_1)
{
char template[] = "file_XXX.ext";
int fd;
@@ -237,9 +237,9 @@ START_TEST(evil_stdlib_mkstemps_fail_1)
fd = mkstemps(template, 4);
fail_if(fd >= 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_stdlib_mkstemps_fail_2)
+EFL_START_TEST(evil_stdlib_mkstemps_fail_2)
{
char template[] = "file_XXX";
int fd;
@@ -247,9 +247,9 @@ START_TEST(evil_stdlib_mkstemps_fail_2)
fd = mkstemps(template, 4);
fail_if(fd >= 0);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_stdlib_realpath_1)
+EFL_START_TEST(evil_stdlib_realpath_1)
{
char buf[PATH_MAX];
char *filename = "C:\\Windows\\System32\\kernel32.dll";
@@ -258,9 +258,9 @@ START_TEST(evil_stdlib_realpath_1)
res = realpath(filename, buf);
fail_if(res == NULL);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_stdlib_realpath_2)
+EFL_START_TEST(evil_stdlib_realpath_2)
{
char buf[PATH_MAX];
char *filename = "C:\\Windows\\System32\\.\\kernel32.dll";
@@ -269,9 +269,9 @@ START_TEST(evil_stdlib_realpath_2)
res = realpath(filename, buf);
fail_if(res == NULL);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_stdlib_realpath_3)
+EFL_START_TEST(evil_stdlib_realpath_3)
{
char buf[PATH_MAX];
char *filename = "C:\\Windows\\System32\\..\\System32\\kernel32.dll";
@@ -280,9 +280,9 @@ START_TEST(evil_stdlib_realpath_3)
res = realpath(filename, buf);
fail_if(res == NULL);
}
-END_TEST
+EFL_END_TEST
-START_TEST(evil_stdlib_realpath_fail)
+EFL_START_TEST(evil_stdlib_realpath_fail)
{
char buf[PATH_MAX];
char *filename = "C:\\Windows\\System32\\System32\\kernel.dll";
@@ -291,7 +291,7 @@ START_TEST(evil_stdlib_realpath_fail)
res = realpath(filename, buf);
fail_if(res != NULL);
}
-END_TEST
+EFL_END_TEST
void evil_test_stdlib(TCase *tc)
{
diff --git a/src/tests/evil/evil_test_unistd.c b/src/tests/evil/evil_test_unistd.c
new file mode 100644
index 0000000000..5252d49775
--- /dev/null
+++ b/src/tests/evil/evil_test_unistd.c
@@ -0,0 +1,115 @@
+/* EVIL - EFL library for Windows port
+ * Copyright (C) 2017 Vincent Torri
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library;
+ * if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+
+# define WIN32_LEAN_AND_MEAN
+# include <winsock2.h>
+# undef WIN32_LEAN_AND_MEAN
+
+#include <Evil.h>
+
+#include "evil_suite.h"
+
+
+#define FDREAD 0
+#define FDWRITE 1
+
+typedef struct
+{
+ int val;
+ int fd_write;
+} data;
+
+
+static DWORD WINAPI
+thread(void *param)
+{
+ data *d;
+ void *buf[1];
+
+ Sleep (2 * 1000);
+ d = (data *)param;
+ buf[0] = param;
+ send(d->fd_write, (char *)buf, sizeof(buf), 0);
+
+ return 0;
+}
+
+EFL_START_TEST(evil_unistd_pipe)
+{
+ int sockets[2];
+ struct timeval t;
+ fd_set rfds;
+ int ret;
+ data *d;
+ DWORD thread_id;
+ HANDLE h;
+
+ FD_ZERO(&rfds);
+ t.tv_sec = 5;
+ t.tv_usec = 0;
+
+ ret = pipe(sockets);
+ fail_if(ret < 0);
+
+ FD_SET(sockets[FDREAD], &rfds);
+ fcntl(sockets[FDREAD], F_SETFL, O_NONBLOCK);
+
+ d = (data *)malloc(sizeof (data));
+ fail_if(d == NULL);
+
+ d->val = 14;
+ d->fd_write = sockets[FDWRITE];
+
+ h = CreateThread(NULL, 0, thread, d, 0, &thread_id);
+ fail_if(h == NULL);
+
+ ret = select(sockets[FDREAD] + 1, &rfds, NULL, NULL, &t);
+ fail_if(ret <= 0);
+
+ {
+ void *buf[1];
+ data *d2 = NULL;
+ int len;
+
+ while ((len = recv(sockets[FDREAD], (char *)buf, sizeof(buf), 0)) > 0)
+ {
+ if (len == sizeof(buf))
+ {
+ d2 = (data *)buf[0];
+ break;
+ }
+ }
+ fail_if(!d2 || (d2->val != d->val));
+ }
+
+ CloseHandle(h);
+ free(d);
+}
+EFL_END_TEST
+
+void evil_test_unistd(TCase *tc)
+{
+ tcase_add_test(tc, evil_unistd_pipe);
+}
diff --git a/src/wayland_protocol/efl-hints.xml b/src/wayland_protocol/efl-hints.xml
index 9f2b775dda..a29787e25f 100644
--- a/src/wayland_protocol/efl-hints.xml
+++ b/src/wayland_protocol/efl-hints.xml
@@ -9,13 +9,13 @@
<entry name="both" value="4"/>
</enum>
<request name="set_aspect">
- <arg name="surface" type="object" interface="zxdg_surface_v6"/>
+ <arg name="surface" type="object" interface="xdg_surface"/>
<arg name="width" type="uint"/>
<arg name="height" type="uint"/>
<arg name="aspect" type="uint" enum="aspect"/>
</request>
<request name="set_weight">
- <arg name="surface" type="object" interface="zxdg_surface_v6"/>
+ <arg name="surface" type="object" interface="xdg_surface"/>
<arg name="width" type="int"/>
<arg name="height" type="int"/>
</request>